aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils/ipsc
ModeNameSize
-rw-r--r--Makefile992logstatsplainblame
-rw-r--r--distinfo198logstatsplainblame
d---------files110logstatsplain
-rw-r--r--pkg-descr259logstatsplainblame
efile.am?h=BALSA_2_2_4'>a11y/Makefile.am16
-rw-r--r--a11y/calendar/.cvsignore6
-rw-r--r--a11y/calendar/Makefile.am78
-rw-r--r--a11y/calendar/ea-cal-view-event.c479
-rw-r--r--a11y/calendar/ea-cal-view-event.h64
-rw-r--r--a11y/calendar/ea-cal-view.c440
-rw-r--r--a11y/calendar/ea-cal-view.h64
-rw-r--r--a11y/calendar/ea-calendar-helpers.c148
-rw-r--r--a11y/calendar/ea-calendar-helpers.h43
-rw-r--r--a11y/calendar/ea-calendar.c151
-rw-r--r--a11y/calendar/ea-calendar.h38
-rw-r--r--a11y/calendar/ea-day-view-cell.c336
-rw-r--r--a11y/calendar/ea-day-view-cell.h91
-rw-r--r--a11y/calendar/ea-day-view-main-item.c1259
-rw-r--r--a11y/calendar/ea-day-view-main-item.h64
-rw-r--r--a11y/calendar/ea-day-view.c261
-rw-r--r--a11y/calendar/ea-day-view.h64
-rw-r--r--a11y/calendar/ea-gnome-calendar.c248
-rw-r--r--a11y/calendar/ea-gnome-calendar.h65
-rw-r--r--a11y/calendar/ea-week-view.c305
-rw-r--r--a11y/calendar/ea-week-view.h65
-rw-r--r--a11y/e-table/.cvsignore4
-rw-r--r--a11y/e-table/gal-a11y-e-cell-popup.c146
-rw-r--r--a11y/e-table/gal-a11y-e-cell-popup.h64
-rw-r--r--a11y/e-table/gal-a11y-e-cell-registry.c132
-rw-r--r--a11y/e-table/gal-a11y-e-cell-registry.h58
-rw-r--r--a11y/e-table/gal-a11y-e-cell-text.c567
-rw-r--r--a11y/e-table/gal-a11y-e-cell-text.h48
-rw-r--r--a11y/e-table/gal-a11y-e-cell-toggle.c163
-rw-r--r--a11y/e-table/gal-a11y-e-cell-toggle.h47
-rw-r--r--a11y/e-table/gal-a11y-e-cell-tree.c209
-rw-r--r--a11y/e-table/gal-a11y-e-cell-tree.h50
-rw-r--r--a11y/e-table/gal-a11y-e-cell.c551
-rw-r--r--a11y/e-table/gal-a11y-e-cell.h99
-rw-r--r--a11y/e-table/gal-a11y-e-table-factory.c83
-rw-r--r--a11y/e-table/gal-a11y-e-table-factory.h36
-rw-r--r--a11y/e-table/gal-a11y-e-table-item-factory.c96
-rw-r--r--a11y/e-table/gal-a11y-e-table-item-factory.h34
-rw-r--r--a11y/e-table/gal-a11y-e-table-item.c1285
-rw-r--r--a11y/e-table/gal-a11y-e-table-item.h44
-rw-r--r--a11y/e-table/gal-a11y-e-table.c157
-rw-r--r--a11y/e-table/gal-a11y-e-table.h43
-rw-r--r--a11y/e-table/gal-a11y-e-tree-factory.c81
-rw-r--r--a11y/e-table/gal-a11y-e-tree-factory.h34
-rw-r--r--a11y/e-table/gal-a11y-e-tree.c159
-rw-r--r--a11y/e-table/gal-a11y-e-tree.h41
-rw-r--r--a11y/e-text/.cvsignore4
-rw-r--r--a11y/e-text/gal-a11y-e-text-factory.c87
-rw-r--r--a11y/e-text/gal-a11y-e-text-factory.h36
-rw-r--r--a11y/e-text/gal-a11y-e-text.c1121
-rw-r--r--a11y/e-text/gal-a11y-e-text.h40
-rw-r--r--a11y/ea-cell-table.c207
-rw-r--r--a11y/ea-cell-table.h63
-rw-r--r--a11y/ea-factory.h113
-rw-r--r--a11y/gal-a11y-factory.h94
-rw-r--r--a11y/gal-a11y-util.c31
-rw-r--r--a11y/gal-a11y-util.h21
-rw-r--r--a11y/widgets/.cvsignore2
-rw-r--r--a11y/widgets/Makefile.am31
-rw-r--r--a11y/widgets/ea-calendar-cell.c305
-rw-r--r--a11y/widgets/ea-calendar-cell.h92
-rw-r--r--a11y/widgets/ea-calendar-item.c1247
-rw-r--r--a11y/widgets/ea-calendar-item.h77
-rw-r--r--a11y/widgets/ea-widgets.c35
-rw-r--r--a11y/widgets/ea-widgets.h34
-rw-r--r--acinclude.m4182
-rw-r--r--addressbook/.cvsignore6
-rw-r--r--addressbook/ChangeLog2951
-rw-r--r--addressbook/ChangeLog.pre-1-416758
-rw-r--r--addressbook/E-CARD-NEEDED-FIELDS9
-rw-r--r--addressbook/Makefile.am11
-rw-r--r--addressbook/conduit/.cvsignore9
-rw-r--r--addressbook/conduit/Makefile.am39
-rw-r--r--addressbook/conduit/address-conduit.c1713
-rw-r--r--addressbook/conduit/e-address.conduit.in9
-rw-r--r--addressbook/gui/.cvsignore6
-rw-r--r--addressbook/gui/Makefile.am1
-rw-r--r--addressbook/gui/component/.cvsignore14
-rw-r--r--addressbook/gui/component/GNOME_Evolution_Addressbook.server.in.in143
-rw-r--r--addressbook/gui/component/Makefile.am108
-rw-r--r--addressbook/gui/component/addressbook-component.c431
-rw-r--r--addressbook/gui/component/addressbook-component.h62
-rw-r--r--addressbook/gui/component/addressbook-config.c1439
-rw-r--r--addressbook/gui/component/addressbook-config.h52
-rw-r--r--addressbook/gui/component/addressbook.c1087
-rw-r--r--addressbook/gui/component/addressbook.h20
-rw-r--r--addressbook/gui/component/apps_evolution_addressbook.schemas.in.in42
-rw-r--r--addressbook/gui/component/autocompletion-config.c150
-rw-r--r--addressbook/gui/component/autocompletion-config.h30
-rw-r--r--addressbook/gui/component/component-factory.c87
-rw-r--r--addressbook/gui/component/ldap-config.glade2722
-rw-r--r--addressbook/gui/component/select-names/.cvsignore15
-rw-r--r--addressbook/gui/component/select-names/Evolution-Addressbook-SelectNames.idl42
-rw-r--r--addressbook/gui/component/select-names/GNOME_Evolution_Addressbook_SelectNames.server.in.in31
-rw-r--r--addressbook/gui/component/select-names/Makefile.am96
-rw-r--r--addressbook/gui/component/select-names/e-select-names-bonobo.c600
-rw-r--r--addressbook/gui/component/select-names/e-select-names-bonobo.h66
-rw-r--r--addressbook/gui/component/select-names/e-select-names-completion.c1231
-rw-r--r--addressbook/gui/component/select-names/e-select-names-completion.h68
-rw-r--r--addressbook/gui/component/select-names/e-select-names-config-keys.h39
-rw-r--r--addressbook/gui/component/select-names/e-select-names-config.c117
-rw-r--r--addressbook/gui/component/select-names/e-select-names-config.h43
-rw-r--r--addressbook/gui/component/select-names/e-select-names-factory.c59
-rw-r--r--addressbook/gui/component/select-names/e-select-names-factory.h30
-rw-r--r--addressbook/gui/component/select-names/e-select-names-manager.c755
-rw-r--r--addressbook/gui/component/select-names/e-select-names-manager.h68
-rw-r--r--addressbook/gui/component/select-names/e-select-names-marshal.list3
-rw-r--r--addressbook/gui/component/select-names/e-select-names-model.c769
-rw-r--r--addressbook/gui/component/select-names/e-select-names-model.h88
-rw-r--r--addressbook/gui/component/select-names/e-select-names-popup.c399
-rw-r--r--addressbook/gui/component/select-names/e-select-names-popup.h36
-rw-r--r--addressbook/gui/component/select-names/e-select-names-section.etspec7
-rw-r--r--addressbook/gui/component/select-names/e-select-names-table-model.c366
-rw-r--r--addressbook/gui/component/select-names/e-select-names-table-model.h51
-rw-r--r--addressbook/gui/component/select-names/e-select-names-text-model.c852
-rw-r--r--addressbook/gui/component/select-names/e-select-names-text-model.h53
-rw-r--r--addressbook/gui/component/select-names/e-select-names.c845
-rw-r--r--addressbook/gui/component/select-names/e-select-names.etspec7
-rw-r--r--addressbook/gui/component/select-names/e-select-names.h101
-rw-r--r--addressbook/gui/component/select-names/recipient.glade45
-rw-r--r--addressbook/gui/component/select-names/select-names.glade435
-rw-r--r--addressbook/gui/contact-editor/.cvsignore11
-rw-r--r--addressbook/gui/contact-editor/Makefile.am43
-rw-r--r--addressbook/gui/contact-editor/contact-editor.glade2360
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor-address.c620
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor-address.h73
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor-fullname.c287
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor-fullname.h71
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor-marshal.list2
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.c2612
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.h134
-rw-r--r--addressbook/gui/contact-editor/e-contact-quick-add.c457
-rw-r--r--addressbook/gui/contact-editor/e-contact-quick-add.h40
-rw-r--r--addressbook/gui/contact-editor/fulladdr.glade446
-rw-r--r--addressbook/gui/contact-editor/fullname.glade674
-rw-r--r--addressbook/gui/contact-editor/test-editor.c142
-rw-r--r--addressbook/gui/contact-list-editor/.cvsignore6
-rw-r--r--addressbook/gui/contact-list-editor/Makefile.am39
-rw-r--r--addressbook/gui/contact-list-editor/contact-list-editor.glade313
-rw-r--r--addressbook/gui/contact-list-editor/e-contact-list-editor-marshal.list4
-rw-r--r--addressbook/gui/contact-list-editor/e-contact-list-editor.c1297
-rw-r--r--addressbook/gui/contact-list-editor/e-contact-list-editor.etspec7
-rw-r--r--addressbook/gui/contact-list-editor/e-contact-list-editor.h113
-rw-r--r--addressbook/gui/contact-list-editor/e-contact-list-model.c265
-rw-r--r--addressbook/gui/contact-list-editor/e-contact-list-model.h51
-rw-r--r--addressbook/gui/merging/.cvsignore8
-rw-r--r--addressbook/gui/merging/Makefile.am24
-rw-r--r--addressbook/gui/merging/eab-contact-commit-duplicate-detected.glade212
-rw-r--r--addressbook/gui/merging/eab-contact-compare.c736
-rw-r--r--addressbook/gui/merging/eab-contact-compare.h73
-rw-r--r--addressbook/gui/merging/eab-contact-duplicate-detected.glade212
-rw-r--r--addressbook/gui/merging/eab-contact-merging.c197
-rw-r--r--addressbook/gui/merging/eab-contact-merging.h30
-rw-r--r--addressbook/gui/search/.cvsignore7
-rw-r--r--addressbook/gui/search/Makefile.am23
-rw-r--r--addressbook/gui/search/addresstypes.xml83
-rw-r--r--addressbook/gui/search/e-addressbook-search-dialog.c158
-rw-r--r--addressbook/gui/search/e-addressbook-search-dialog.h66
-rw-r--r--addressbook/gui/widgets/.cvsignore19
-rw-r--r--addressbook/gui/widgets/Makefile.am89
-rw-r--r--addressbook/gui/widgets/e-addressbook-model.c693
-rw-r--r--addressbook/gui/widgets/e-addressbook-model.h80
-rw-r--r--addressbook/gui/widgets/e-addressbook-reflow-adapter.c517
-rw-r--r--addressbook/gui/widgets/e-addressbook-reflow-adapter.h44
-rw-r--r--addressbook/gui/widgets/e-addressbook-table-adapter.c356
-rw-r--r--addressbook/gui/widgets/e-addressbook-table-adapter.h36
-rw-r--r--addressbook/gui/widgets/e-addressbook-treeview-adapter.c630
-rw-r--r--addressbook/gui/widgets/e-addressbook-treeview-adapter.h44
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.c1855
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.etspec58
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.h144
-rw-r--r--addressbook/gui/widgets/e-minicard-label.c508
-rw-r--r--addressbook/gui/widgets/e-minicard-label.h86
-rw-r--r--addressbook/gui/widgets/e-minicard-view-widget.c440
-rw-r--r--addressbook/gui/widgets/e-minicard-view-widget.h73
-rw-r--r--addressbook/gui/widgets/e-minicard-view.c581
-rw-r--r--addressbook/gui/widgets/e-minicard-view.h94
-rw-r--r--addressbook/gui/widgets/e-minicard.c968
-rw-r--r--addressbook/gui/widgets/e-minicard.h123
-rw-r--r--addressbook/gui/widgets/eab-contact-display.c486
-rw-r--r--addressbook/gui/widgets/eab-contact-display.h61
-rw-r--r--addressbook/gui/widgets/eab-gui-util.c819
-rw-r--r--addressbook/gui/widgets/eab-gui-util.h70
-rw-r--r--addressbook/gui/widgets/eab-marshal.list11
-rw-r--r--addressbook/gui/widgets/eab-popup-control.c1236
-rw-r--r--addressbook/gui/widgets/eab-popup-control.h85
-rw-r--r--addressbook/gui/widgets/eab-vcard-control.c310
-rw-r--r--addressbook/gui/widgets/eab-vcard-control.h8
-rw-r--r--addressbook/gui/widgets/gal-view-factory-minicard.c85
-rw-r--r--addressbook/gui/widgets/gal-view-factory-minicard.h35
-rw-r--r--addressbook/gui/widgets/gal-view-factory-treeview.c86
-rw-r--r--addressbook/gui/widgets/gal-view-factory-treeview.h35
-rw-r--r--addressbook/gui/widgets/gal-view-minicard.c227
-rw-r--r--addressbook/gui/widgets/gal-view-minicard.h45
-rw-r--r--addressbook/gui/widgets/gal-view-treeview.c234
-rw-r--r--addressbook/gui/widgets/gal-view-treeview.h43
-rw-r--r--addressbook/gui/widgets/test-reflow.c199
-rw-r--r--addressbook/printing/.cvsignore9
-rw-r--r--addressbook/printing/Makefile.am57
-rw-r--r--addressbook/printing/e-contact-print-envelope.c242
-rw-r--r--addressbook/printing/e-contact-print-envelope.h32
-rw-r--r--addressbook/printing/e-contact-print-style-editor.c155
-rw-r--r--addressbook/printing/e-contact-print-style-editor.h73
-rw-r--r--addressbook/printing/e-contact-print-types.h73
-rw-r--r--addressbook/printing/e-contact-print.c1106
-rw-r--r--addressbook/printing/e-contact-print.glade2018
-rw-r--r--addressbook/printing/e-contact-print.h36
-rw-r--r--addressbook/printing/medbook.ecps30
-rw-r--r--addressbook/printing/phonelist.ecps29
-rw-r--r--addressbook/printing/smallbook.ecps30
-rw-r--r--addressbook/printing/test-contact-print-style-editor.c93
-rw-r--r--addressbook/printing/test-print.c88
-rw-r--r--addressbook/tools/.cvsignore5
-rw-r--r--addressbook/tools/Makefile.am49
-rwxr-xr-xaddressbook/tools/csv2vcard236
-rw-r--r--addressbook/tools/evolution-addressbook-abuse.c91
-rw-r--r--addressbook/tools/evolution-addressbook-clean.in24
-rw-r--r--addressbook/tools/evolution-addressbook-export-list-cards.c780
-rw-r--r--addressbook/tools/evolution-addressbook-export-list-folders.c99
-rw-r--r--addressbook/tools/evolution-addressbook-export.c162
-rw-r--r--addressbook/tools/evolution-addressbook-export.h81
-rw-r--r--addressbook/tools/evolution-addressbook-import.c90
-rw-r--r--addressbook/util/.cvsignore4
-rw-r--r--addressbook/util/Makefile.am36
-rw-r--r--addressbook/util/eab-book-util.c293
-rw-r--r--addressbook/util/eab-book-util.h69
-rw-r--r--addressbook/util/eab-destination.c1569
-rw-r--r--addressbook/util/eab-destination.h128
-rw-r--r--addressbook/util/eab-marshal.list5
-rw-r--r--art/.cvsignore2
-rw-r--r--art/16_copy.pngbin516 -> 0 bytes-rw-r--r--art/16_customize.pngbin266 -> 0 bytes-rw-r--r--art/16_cut.pngbin531 -> 0 bytes-rw-r--r--art/16_paste.pngbin626 -> 0 bytes-rw-r--r--art/ChangeLog45
-rw-r--r--art/ChangeLog.pre-1-4712
-rw-r--r--art/Makefile.am272
-rw-r--r--art/about-box.pngbin54200 -> 0 bytes-rw-r--r--art/add-attachment.pngbin715 -> 0 bytes-rw-r--r--art/add-nntp-folder-24.pngbin863 -> 0 bytes-rw-r--r--art/add-service.pngbin1186 -> 0 bytes-rw-r--r--art/alarm.pngbin4384 -> 0 bytes-rw-r--r--art/all_contacts.xpm158
-rw-r--r--art/apply-filters-16.xpm48
-rw-r--r--art/appointment-reminder-excl.pngbin1234 -> 0 bytes-rw-r--r--art/appointment-reminder.pngbin1233 -> 0 bytes-rw-r--r--art/arrow-left-24.pngbin429 -> 0 bytes-rw-r--r--art/arrow-right-24.pngbin431 -> 0 bytes-rw-r--r--art/attachment.xpm22
-rw-r--r--art/bcg.pngbin526 -> 0 bytes-rw-r--r--art/bell.xpm83
-rw-r--r--art/briefcase.pngbin2358 -> 0 bytes-rw-r--r--art/butterfly.pngbin12117 -> 0 bytes-rw-r--r--art/calendar-and-tasks-settings.pngbin4134 -> 0 bytes-rw-r--r--art/cellphone.pngbin3440 -> 0 bytes-rw-r--r--art/check-filled.xpm21
-rw-r--r--art/compose-message.pngbin1062 -> 0 bytes-rw-r--r--art/composer-settings.pngbin3508 -> 0 bytes-rw-r--r--art/configure_16_addressbook.xpm77
-rw-r--r--art/configure_16_calendar.xpm76
-rw-r--r--art/configure_16_folder.xpm85
-rw-r--r--art/configure_16_mail.xpm61
-rw-r--r--art/connect_to_url-16.xpm123
-rw-r--r--art/contact-is-a-list.pngbin173 -> 0 bytes-rw-r--r--art/contact-list-16.pngbin450 -> 0 bytes-rw-r--r--art/copy-message.pngbin863 -> 0 bytes-rw-r--r--art/copy.pngbin918 -> 0 bytes-rw-r--r--art/copy_16_message.xpm58
-rw-r--r--art/cut.pngbin1063 -> 0 bytes-rw-r--r--art/dayview.xpm34
-rw-r--r--art/delete-message.pngbin1210 -> 0 bytes-rw-r--r--art/drafts-16.pngbin539 -> 0 bytes-rw-r--r--art/edit.xpm84
-rw-r--r--art/empty.gifbin104 -> 0 bytes-rw-r--r--art/empty.xpm21
-rw-r--r--art/encrypt.xpm80
-rw-r--r--art/envelope.pngbin2393 -> 0 bytes-rw-r--r--art/es-appointments.pngbin433 -> 0 bytes-rw-r--r--art/es-weather.pngbin1002 -> 0 bytes-rw-r--r--art/evo-16-address-conduit.pngbin498 -> 0 bytes-rw-r--r--art/evo-16-calendar-conduit.pngbin505 -> 0 bytes-rw-r--r--art/evo-16-todo-conduit.pngbin702 -> 0 bytes-rw-r--r--art/evo-48-address-conduit.pngbin2919 -> 0 bytes-rw-r--r--art/evo-48-calendar-conduit.pngbin2889 -> 0 bytes-rw-r--r--art/evo-48-todo-conduit.pngbin3677 -> 0 bytes-rw-r--r--art/evolution-calendar-mini.pngbin502 -> 0 bytes-rw-r--r--art/evolution-calendar.pngbin2733 -> 0 bytes-rw-r--r--art/evolution-contacts-mini.pngbin452 -> 0 bytes-rw-r--r--art/evolution-contacts-plain.pngbin2744 -> 0 bytes-rw-r--r--art/evolution-contacts.pngbin2744 -> 0 bytes-rw-r--r--art/evolution-inbox-mini.pngbin478 -> 0 bytes-rw-r--r--art/evolution-inbox.pngbin2937 -> 0 bytes-rw-r--r--art/evolution-junk-mini.pngbin926 -> 0 bytes-rw-r--r--art/evolution-junk.pngbin4083 -> 0 bytes-rw-r--r--art/evolution-notes-mini.pngbin516 -> 0 bytes-rw-r--r--art/evolution-notes.pngbin3400 -> 0 bytes-rw-r--r--art/evolution-tasks-mini.pngbin708 -> 0 bytes-rw-r--r--art/evolution-tasks.pngbin3601 -> 0 bytes-rw-r--r--art/evolution-today-mini.pngbin664 -> 0 bytes-rw-r--r--art/evolution-today.pngbin3713 -> 0 bytes-rw-r--r--art/evolution-trash-mini.pngbin723 -> 0 bytes-rw-r--r--art/evolution-trash.pngbin2913 -> 0 bytes-rw-r--r--art/evolution.pngbin5182 -> 0 bytes-rw-r--r--art/executive-summary-bg.pngbin86508 -> 0 bytes-rw-r--r--art/executive-summary-curve.pngbin1786 -> 0 bytes-rw-r--r--art/faq-16.pngbin639 -> 0 bytes-rw-r--r--art/fetch-mail.pngbin1027 -> 0 bytes-rw-r--r--art/find_contact.xpm127
-rw-r--r--art/find_message.xpm130
-rw-r--r--art/flag-for-followup-16.pngbin562 -> 0 bytes-rw-r--r--art/flag-for-followup-48.pngbin3397 -> 0 bytes-rw-r--r--art/flag-for-followup-done-16.pngbin515 -> 0 bytes-rw-r--r--art/flag-for-followup-done-48.pngbin3273 -> 0 bytes-rw-r--r--art/flag-for-followup-done.xpm78
-rw-r--r--art/flag-for-followup.xpm78
-rw-r--r--art/folder-copy-16.pngbin376 -> 0 bytes-rw-r--r--art/folder-mini.pngbin342 -> 0 bytes-rw-r--r--art/folder-move-16.pngbin273 -> 0 bytes-rw-r--r--art/folder-settings.pngbin2753 -> 0 bytes-rw-r--r--art/folder.pngbin2088 -> 0 bytes-rw-r--r--art/folder.xpm73
-rw-r--r--art/font.pngbin2403 -> 0 bytes-rw-r--r--art/forget_passwords.xpm125
-rw-r--r--art/forward.pngbin693 -> 0 bytes-rw-r--r--art/forward.xpm51
-rw-r--r--art/globe.pngbin4118 -> 0 bytes-rw-r--r--art/goto-16.pngbin470 -> 0 bytes-rw-r--r--art/goto-24.pngbin679 -> 0 bytes-rw-r--r--art/hand-16.xpm115
-rw-r--r--art/hide_deleted_messages.xpm39
-rw-r--r--art/hide_read_messages.xpm23
-rw-r--r--art/hide_selected_messages.xpm33
-rw-r--r--art/house.pngbin4135 -> 0 bytes-rw-r--r--art/ico-calendar.pngbin2677 -> 0 bytes-rw-r--r--art/ico-mail.pngbin2937 -> 0 bytes-rw-r--r--art/ico-rdf.pngbin3627 -> 0 bytes-rw-r--r--art/ico-weather.pngbin4343 -> 0 bytes-rw-r--r--art/imap-16.pngbin482 -> 0 bytes-rw-r--r--art/import.pngbin2309 -> 0 bytes-rw-r--r--art/import.xpm59
-rw-r--r--art/inbox-16.pngbin587 -> 0 bytes-rw-r--r--art/inbox-full-16.pngbin549 -> 0 bytes-rw-r--r--art/inbox-mini.pngbin587 -> 0 bytes-rw-r--r--art/inbox.pngbin3385 -> 0 bytes-rw-r--r--art/info-bulb.pngbin2661 -> 0 bytes-rw-r--r--art/insert-image-24.pngbin711 -> 0 bytes-rw-r--r--art/insert-link-24.pngbin782 -> 0 bytes-rw-r--r--art/insert-table-24.pngbin430 -> 0 bytes-rw-r--r--art/jump.xpm30
-rw-r--r--art/ldap-mini.pngbin542 -> 0 bytes-rw-r--r--art/ldap-settings.pngbin2109 -> 0 bytes-rw-r--r--art/ldap.pngbin2614 -> 0 bytes-rw-r--r--art/listview.xpm34
-rw-r--r--art/mail-accounts-settings.pngbin2328 -> 0 bytes-rw-r--r--art/mail-config-druid-48.pngbin3529 -> 0 bytes-rw-r--r--art/mail-config-druid-account-name.pngbin3150 -> 0 bytes-rw-r--r--art/mail-config-druid-identity.pngbin2646 -> 0 bytes-rw-r--r--art/mail-config-druid-receive.pngbin3551 -> 0 bytes-rw-r--r--art/mail-config-druid-send.pngbin3379 -> 0 bytes-rw-r--r--art/mail-config-druid.pngbin3529 -> 0 bytes-rw-r--r--art/mail-need-reply.xpm101
-rw-r--r--art/mail-new.xpm67
-rw-r--r--art/mail-read.xpm70
-rw-r--r--art/mail-replied.xpm52
-rw-r--r--art/mail.pngbin2855 -> 0 bytes-rw-r--r--art/malehead.pngbin2280 -> 0 bytes-rw-r--r--art/mark-as-important-16.pngbin235 -> 0 bytes-rw-r--r--art/mark.xpm21
-rw-r--r--art/meeting-request-16.pngbin907 -> 0 bytes-rw-r--r--art/meeting-request.pngbin3520 -> 0 bytes-rw-r--r--art/monkey-16.pngbin977 -> 0 bytes-rw-r--r--art/monthview.xpm34
-rw-r--r--art/move-message.pngbin777 -> 0 bytes-rw-r--r--art/move_message.xpm59
-rw-r--r--art/myevo-appointments.pngbin2857 -> 0 bytes-rw-r--r--art/myevo-mail-summary.pngbin3278 -> 0 bytes-rw-r--r--art/myevo-post-it.pngbin3715 -> 0 bytes-rw-r--r--art/myweather-clouds.pngbin414 -> 0 bytes-rw-r--r--art/myweather-fog.pngbin748 -> 0 bytes-rw-r--r--art/myweather-rain.pngbin186 -> 0 bytes-rw-r--r--art/myweather-snow.pngbin354 -> 0 bytes-rw-r--r--art/myweather-storm.pngbin429 -> 0 bytes-rw-r--r--art/myweather-sun.pngbin295 -> 0 bytes-rw-r--r--art/myweather-suncloud.pngbin469 -> 0 bytes-rw-r--r--art/new-message.xpm38
-rw-r--r--art/new_all_day_event.pngbin692 -> 0 bytes-rw-r--r--art/new_appointment.pngbin1542 -> 0 bytes-rw-r--r--art/new_appointment.xpm126
-rw-r--r--art/new_contact.xpm98
-rw-r--r--art/new_task-16.pngbin427 -> 0 bytes-rw-r--r--art/new_task.pngbin1032 -> 0 bytes-rw-r--r--art/next-message.pngbin1051 -> 0 bytes-rw-r--r--art/offline.pngbin640 -> 0 bytes-rw-r--r--art/online.pngbin547 -> 0 bytes-rw-r--r--art/open-in-new-window-16.pngbin504 -> 0 bytes-rw-r--r--art/outbox-16.pngbin575 -> 0 bytes-rw-r--r--art/outbox-full-16.pngbin551 -> 0 bytes-rw-r--r--art/outbox-mini.pngbin575 -> 0 bytes-rw-r--r--art/outbox.pngbin2861 -> 0 bytes-rw-r--r--art/paste.pngbin1053 -> 0 bytes-rw-r--r--art/pattern.pngbin271 -> 0 bytes-rw-r--r--art/pgp-signature-bad.pngbin4233 -> 0 bytes-rw-r--r--art/pgp-signature-nokey.pngbin2907 -> 0 bytes-rw-r--r--art/pgp-signature-ok.pngbin3140 -> 0 bytes-rw-r--r--art/pin.pngbin354 -> 0 bytes-rw-r--r--art/post-message-16.pngbin574 -> 0 bytes-rw-r--r--art/post-reply-24.pngbin896 -> 0 bytes-rw-r--r--art/previous-message.pngbin1052 -> 0 bytes-rw-r--r--art/print-preview-24.pngbin1035 -> 0 bytes-rw-r--r--art/print-preview.xpm153
-rw-r--r--art/print.pngbin867 -> 0 bytes-rw-r--r--art/print.xpm107
-rw-r--r--art/priority-high.xpm22
-rw-r--r--art/priority-low.xpm21
-rw-r--r--art/properties-16.pngbin606 -> 0 bytes-rw-r--r--art/public-folder-mini.pngbin516 -> 0 bytes-rw-r--r--art/public-folder.pngbin3416 -> 0 bytes-rw-r--r--art/rdf.pngbin4372 -> 0 bytes-rw-r--r--art/receive-24.pngbin869 -> 0 bytes-rw-r--r--art/recur.xpm21
-rw-r--r--art/refresh-nntp-folders-24.pngbin575 -> 0 bytes-rw-r--r--art/remove-nntp-folder-24.pngbin878 -> 0 bytes-rw-r--r--art/reply-to-all.pngbin950 -> 0 bytes-rw-r--r--art/reply.pngbin916 -> 0 bytes-rw-r--r--art/reply.xpm46
-rw-r--r--art/reply_to_all.xpm52
-rw-r--r--art/save-16.pngbin540 -> 0 bytes-rw-r--r--art/save-24.pngbin634 -> 0 bytes-rw-r--r--art/save-as-16.pngbin667 -> 0 bytes-rw-r--r--art/save.xpm45
-rw-r--r--art/schedule-meeting-16.pngbin834 -> 0 bytes-rw-r--r--art/schedule-meeting-16.xpm178
-rw-r--r--art/schedule-meeting-24.pngbin1441 -> 0 bytes-rw-r--r--art/score-high.xpm26
-rw-r--r--art/score-higher.xpm26
-rw-r--r--art/score-highest.xpm26
-rw-r--r--art/score-low.xpm26
-rw-r--r--art/score-lower.xpm26
-rw-r--r--art/score-lowest.xpm26
-rw-r--r--art/score-normal.xpm24
-rw-r--r--art/search-16.pngbin526 -> 0 bytes-rw-r--r--art/search-and-replace-16.pngbin638 -> 0 bytes-rw-r--r--art/send-16.pngbin518 -> 0 bytes-rw-r--r--art/send-24-receive.pngbin985 -> 0 bytes-rw-r--r--art/send-24.pngbin807 -> 0 bytes-rw-r--r--art/send-48-receive.pngbin2788 -> 0 bytes-rw-r--r--art/send-later-16.pngbin509 -> 0 bytes-rw-r--r--art/send-receive.xpm56
-rw-r--r--art/send.pngbin807 -> 0 bytes-rw-r--r--art/service-close.pngbin360 -> 0 bytes-rw-r--r--art/service-configure.pngbin341 -> 0 bytes-rw-r--r--art/service-down-disabled.pngbin331 -> 0 bytes-rw-r--r--art/service-down.pngbin249 -> 0 bytes-rw-r--r--art/service-left-disabled.pngbin319 -> 0 bytes-rw-r--r--art/service-left.pngbin268 -> 0 bytes-rw-r--r--art/service-right-disabled.pngbin318 -> 0 bytes-rw-r--r--art/service-right.pngbin270 -> 0 bytes-rw-r--r--art/service-up-disabled.pngbin347 -> 0 bytes-rw-r--r--art/service-up.pngbin267 -> 0 bytes-rw-r--r--art/settings-16.pngbin503 -> 0 bytes-rw-r--r--art/settings.pngbin1132 -> 0 bytes-rw-r--r--art/show_all_messages.xpm27
-rw-r--r--art/splash-1-0.pngbin91906 -> 0 bytes-rw-r--r--art/splash.pngbin98522 -> 0 bytes-rw-r--r--art/stock-edit-16.pngbin492 -> 0 bytes-rw-r--r--art/stock-edit-24.pngbin1092 -> 0 bytes-rw-r--r--art/stock-junk-24.pngbin1276 -> 0 bytes-rw-r--r--art/stock-notjunk-24.pngbin1459 -> 0 bytes-rw-r--r--art/summary-settings.pngbin4659 -> 0 bytes-rw-r--r--art/summary_preferences-16.pngbin584 -> 0 bytes-rw-r--r--art/talking-heads.pngbin3643 -> 0 bytes-rw-r--r--art/task-assigned-to.xpm30
-rw-r--r--art/task-assigned.xpm30
-rw-r--r--art/task-recurring.xpm59
-rw-r--r--art/task.pngbin172 -> 0 bytes-rw-r--r--art/task.xpm27
-rw-r--r--art/thankyou.pngbin4090 -> 0 bytes-rw-r--r--art/timezone-16.xpm162
-rw-r--r--art/timezone-48.pngbin3613 -> 0 bytes-rw-r--r--art/tree-expanded.xpm22
-rw-r--r--art/tree-unexpanded.xpm22
-rw-r--r--art/undelete_message-16.pngbin591 -> 0 bytes-rw-r--r--art/wax-seal-broken.pngbin27264 -> 0 bytes-rw-r--r--art/wax-seal.pngbin22433 -> 0 bytes-rw-r--r--art/weekview.xpm34
-rw-r--r--art/work_offline.xpm33
-rw-r--r--art/work_online-16.pngbin458 -> 0 bytes-rw-r--r--art/working-16.pngbin490 -> 0 bytes-rw-r--r--art/workweekview.xpm34
-rw-r--r--art/world_map-960.pngbin111584 -> 0 bytes-rw-r--r--art/yearview.xpm44
-rwxr-xr-xautogen.sh24
-rw-r--r--calendar/.cvsignore6
-rw-r--r--calendar/AUTHORS7
-rw-r--r--calendar/ChangeLog4785
-rw-r--r--calendar/ChangeLog.pre-1-421872
-rw-r--r--calendar/Makefile.am12
-rw-r--r--calendar/conduits/.cvsignore2
-rw-r--r--calendar/conduits/Makefile.am1
-rw-r--r--calendar/conduits/calendar/.cvsignore9
-rw-r--r--calendar/conduits/calendar/Makefile.am34
-rw-r--r--calendar/conduits/calendar/calendar-conduit.c1908
-rw-r--r--calendar/conduits/calendar/e-calendar.conduit.in9
-rw-r--r--calendar/conduits/todo/.cvsignore9
-rw-r--r--calendar/conduits/todo/Makefile.am34
-rw-r--r--calendar/conduits/todo/e-todo.conduit.in9
-rw-r--r--calendar/conduits/todo/todo-conduit.c1413
-rw-r--r--calendar/gui/.cvsignore25
-rw-r--r--calendar/gui/GNOME_Evolution_Calendar.server.in.in146
-rw-r--r--calendar/gui/Makefile.am261
-rw-r--r--calendar/gui/alarm-notify/.cvsignore12
-rw-r--r--calendar/gui/alarm-notify/GNOME_Evolution_Calendar_AlarmNotify.server.in.in16
-rw-r--r--calendar/gui/alarm-notify/Makefile.am67
-rw-r--r--calendar/gui/alarm-notify/alarm-notify-dialog.c394
-rw-r--r--calendar/gui/alarm-notify/alarm-notify-dialog.h44
-rw-r--r--calendar/gui/alarm-notify/alarm-notify.c200
-rw-r--r--calendar/gui/alarm-notify/alarm-notify.glade189
-rw-r--r--calendar/gui/alarm-notify/alarm-notify.h62
-rw-r--r--calendar/gui/alarm-notify/alarm-queue.c1301
-rw-r--r--calendar/gui/alarm-notify/alarm-queue.h34
-rw-r--r--calendar/gui/alarm-notify/alarm.c305
-rw-r--r--calendar/gui/alarm-notify/alarm.h42
-rw-r--r--calendar/gui/alarm-notify/config-data.c168
-rw-r--r--calendar/gui/alarm-notify/config-data.h34
-rw-r--r--calendar/gui/alarm-notify/notify-main.c192
-rw-r--r--calendar/gui/alarm-notify/save.c142
-rw-r--r--calendar/gui/alarm-notify/save.h35
-rw-r--r--calendar/gui/alarm-notify/util.c45
-rw-r--r--calendar/gui/alarm-notify/util.h29
-rw-r--r--calendar/gui/apps_evolution_calendar.schemas.in.in359
-rw-r--r--calendar/gui/cal-search-bar.c513
-rw-r--r--calendar/gui/cal-search-bar.h70
-rw-r--r--calendar/gui/calendar-commands.c810
-rw-r--r--calendar/gui/calendar-commands.h42
-rw-r--r--calendar/gui/calendar-component.c902
-rw-r--r--calendar/gui/calendar-component.h67
-rw-r--r--calendar/gui/calendar-config-keys.h75
-rw-r--r--calendar/gui/calendar-config.c1027
-rw-r--r--calendar/gui/calendar-config.h220
-rw-r--r--calendar/gui/calendar-offline-handler.c345
-rw-r--r--calendar/gui/calendar-offline-handler.h69
-rw-r--r--calendar/gui/calendar-view-factory.c228
-rw-r--r--calendar/gui/calendar-view-factory.h64
-rw-r--r--calendar/gui/calendar-view.c288
-rw-r--r--calendar/gui/calendar-view.h66
-rw-r--r--calendar/gui/comp-editor-factory.c663
-rw-r--r--calendar/gui/comp-editor-factory.h58
-rw-r--r--calendar/gui/comp-util.c342
-rw-r--r--calendar/gui/comp-util.h45
-rw-r--r--calendar/gui/control-factory.c217
-rw-r--r--calendar/gui/control-factory.h30
-rw-r--r--calendar/gui/dialogs/.cvsignore8
-rw-r--r--calendar/gui/dialogs/Makefile.am106
-rw-r--r--calendar/gui/dialogs/alarm-options.c811
-rw-r--r--calendar/gui/dialogs/alarm-options.glade573
-rw-r--r--calendar/gui/dialogs/alarm-options.h28
-rw-r--r--calendar/gui/dialogs/alarm-page.c869
-rw-r--r--calendar/gui/dialogs/alarm-page.glade490
-rw-r--r--calendar/gui/dialogs/alarm-page.h62
-rw-r--r--calendar/gui/dialogs/cal-prefs-dialog.c686
-rw-r--r--calendar/gui/dialogs/cal-prefs-dialog.glade1319
-rw-r--r--calendar/gui/dialogs/cal-prefs-dialog.h41
-rw-r--r--calendar/gui/dialogs/cancel-comp.c99
-rw-r--r--calendar/gui/dialogs/cancel-comp.h30
-rw-r--r--calendar/gui/dialogs/changed-comp.c115
-rw-r--r--calendar/gui/dialogs/changed-comp.h30
-rw-r--r--calendar/gui/dialogs/comp-editor-page.c416
-rw-r--r--calendar/gui/dialogs/comp-editor-page.h111
-rw-r--r--calendar/gui/dialogs/comp-editor-util.c351
-rw-r--r--calendar/gui/dialogs/comp-editor-util.h40
-rw-r--r--calendar/gui/dialogs/comp-editor.c1497
-rw-r--r--calendar/gui/dialogs/comp-editor.h109
-rw-r--r--calendar/gui/dialogs/copy-source-dialog.c163
-rw-r--r--calendar/gui/dialogs/copy-source-dialog.h31
-rw-r--r--calendar/gui/dialogs/delete-comp.c159
-rw-r--r--calendar/gui/dialogs/delete-comp.h32
-rw-r--r--calendar/gui/dialogs/delete-error.c109
-rw-r--r--calendar/gui/dialogs/delete-error.h30
-rw-r--r--calendar/gui/dialogs/e-delegate-dialog.c322
-rw-r--r--calendar/gui/dialogs/e-delegate-dialog.glade113
-rw-r--r--calendar/gui/dialogs/e-delegate-dialog.h72
-rw-r--r--calendar/gui/dialogs/event-editor.c522
-rw-r--r--calendar/gui/dialogs/event-editor.h61
-rw-r--r--calendar/gui/dialogs/event-page.c1371
-rw-r--r--calendar/gui/dialogs/event-page.glade601
-rw-r--r--calendar/gui/dialogs/event-page.h61
-rw-r--r--calendar/gui/dialogs/meeting-page.c833
-rw-r--r--calendar/gui/dialogs/meeting-page.etspec21
-rw-r--r--calendar/gui/dialogs/meeting-page.glade241
-rw-r--r--calendar/gui/dialogs/meeting-page.h67
-rw-r--r--calendar/gui/dialogs/new-calendar.c268
-rw-r--r--calendar/gui/dialogs/new-calendar.glade239
-rw-r--r--calendar/gui/dialogs/new-calendar.h28
-rw-r--r--calendar/gui/dialogs/new-task-list.c145
-rw-r--r--calendar/gui/dialogs/new-task-list.glade193
-rw-r--r--calendar/gui/dialogs/new-task-list.h28
-rw-r--r--calendar/gui/dialogs/recur-comp.c106
-rw-r--r--calendar/gui/dialogs/recur-comp.h34
-rw-r--r--calendar/gui/dialogs/recurrence-page.c2411
-rw-r--r--calendar/gui/dialogs/recurrence-page.glade724
-rw-r--r--calendar/gui/dialogs/recurrence-page.h62
-rw-r--r--calendar/gui/dialogs/save-comp.c70
-rw-r--r--calendar/gui/dialogs/save-comp.h29
-rw-r--r--calendar/gui/dialogs/schedule-page.c517
-rw-r--r--calendar/gui/dialogs/schedule-page.glade24
-rw-r--r--calendar/gui/dialogs/schedule-page.h59
-rw-r--r--calendar/gui/dialogs/send-comp.c93
-rw-r--r--calendar/gui/dialogs/send-comp.h31
-rw-r--r--calendar/gui/dialogs/task-details-page.c781
-rw-r--r--calendar/gui/dialogs/task-details-page.glade384
-rw-r--r--calendar/gui/dialogs/task-details-page.h61
-rw-r--r--calendar/gui/dialogs/task-editor.c486
-rw-r--r--calendar/gui/dialogs/task-editor.h61
-rw-r--r--calendar/gui/dialogs/task-page.c926
-rw-r--r--calendar/gui/dialogs/task-page.glade477
-rw-r--r--calendar/gui/dialogs/task-page.h60
-rw-r--r--calendar/gui/e-alarm-list.c690
-rw-r--r--calendar/gui/e-alarm-list.h79
-rw-r--r--calendar/gui/e-cal-list-view-config.c247
-rw-r--r--calendar/gui/e-cal-list-view-config.h55
-rw-r--r--calendar/gui/e-cal-list-view.c525
-rw-r--r--calendar/gui/e-cal-list-view.etspec17
-rw-r--r--calendar/gui/e-cal-list-view.h97
-rw-r--r--calendar/gui/e-cal-model-calendar.c465
-rw-r--r--calendar/gui/e-cal-model-calendar.h60
-rw-r--r--calendar/gui/e-cal-model-tasks.c1017
-rw-r--r--calendar/gui/e-cal-model-tasks.h68
-rw-r--r--calendar/gui/e-cal-model.c1597
-rw-r--r--calendar/gui/e-cal-model.h111
-rw-r--r--calendar/gui/e-cal-view.c1492
-rw-r--r--calendar/gui/e-cal-view.h137
-rw-r--r--calendar/gui/e-calendar-marshal.list15
-rw-r--r--calendar/gui/e-calendar-table-config.c263
-rw-r--r--calendar/gui/e-calendar-table-config.h55
-rw-r--r--calendar/gui/e-calendar-table.c1464
-rw-r--r--calendar/gui/e-calendar-table.etspec25
-rw-r--r--calendar/gui/e-calendar-table.h101
-rw-r--r--calendar/gui/e-calendar-view.c1492
-rw-r--r--calendar/gui/e-calendar-view.h137
-rw-r--r--calendar/gui/e-cell-date-edit-config.c339
-rw-r--r--calendar/gui/e-cell-date-edit-config.h55
-rw-r--r--calendar/gui/e-cell-date-edit-text.c234
-rw-r--r--calendar/gui/e-cell-date-edit-text.h74
-rw-r--r--calendar/gui/e-comp-editor-registry.c212
-rw-r--r--calendar/gui/e-comp-editor-registry.h79
-rw-r--r--calendar/gui/e-date-edit-config.c269
-rw-r--r--calendar/gui/e-date-edit-config.h55
-rw-r--r--calendar/gui/e-date-time-list.c566
-rw-r--r--calendar/gui/e-date-time-list.h83
-rw-r--r--calendar/gui/e-day-view-config.c475
-rw-r--r--calendar/gui/e-day-view-config.h55
-rw-r--r--calendar/gui/e-day-view-layout.c352
-rw-r--r--calendar/gui/e-day-view-layout.h56
-rw-r--r--calendar/gui/e-day-view-main-item.c796
-rw-r--r--calendar/gui/e-day-view-main-item.h65
-rw-r--r--calendar/gui/e-day-view-time-item.c671
-rw-r--r--calendar/gui/e-day-view-time-item.h74
-rw-r--r--calendar/gui/e-day-view-top-item.c701
-rw-r--r--calendar/gui/e-day-view-top-item.h66
-rw-r--r--calendar/gui/e-day-view.c7229
-rw-r--r--calendar/gui/e-day-view.h586
-rw-r--r--calendar/gui/e-itip-control.c2373
-rw-r--r--calendar/gui/e-itip-control.glade493
-rw-r--r--calendar/gui/e-itip-control.h82
-rw-r--r--calendar/gui/e-meeting-attendee.c1000
-rw-r--r--calendar/gui/e-meeting-attendee.h172
-rw-r--r--calendar/gui/e-meeting-list-view.c460
-rw-r--r--calendar/gui/e-meeting-list-view.h62
-rw-r--r--calendar/gui/e-meeting-model.c1780
-rw-r--r--calendar/gui/e-meeting-model.h116
-rw-r--r--calendar/gui/e-meeting-store.c1295
-rw-r--r--calendar/gui/e-meeting-store.h108
-rw-r--r--calendar/gui/e-meeting-time-sel-item.c999
-rw-r--r--calendar/gui/e-meeting-time-sel-item.h78
-rw-r--r--calendar/gui/e-meeting-time-sel.c2850
-rw-r--r--calendar/gui/e-meeting-time-sel.etspec19
-rw-r--r--calendar/gui/e-meeting-time-sel.h379
-rw-r--r--calendar/gui/e-meeting-types.h78
-rw-r--r--calendar/gui/e-meeting-utils.c52
-rw-r--r--calendar/gui/e-meeting-utils.h49
-rw-r--r--calendar/gui/e-mini-calendar-config.c247
-rw-r--r--calendar/gui/e-mini-calendar-config.h55
-rw-r--r--calendar/gui/e-select-names-editable.c228
-rw-r--r--calendar/gui/e-select-names-editable.h64
-rw-r--r--calendar/gui/e-select-names-renderer.c176
-rw-r--r--calendar/gui/e-select-names-renderer.h63
-rw-r--r--calendar/gui/e-tasks.c1163
-rw-r--r--calendar/gui/e-tasks.h83
-rw-r--r--calendar/gui/e-timezone-entry.c320
-rw-r--r--calendar/gui/e-timezone-entry.h80
-rw-r--r--calendar/gui/e-week-view-config.c332
-rw-r--r--calendar/gui/e-week-view-config.h55
-rw-r--r--calendar/gui/e-week-view-event-item.c945
-rw-r--r--calendar/gui/e-week-view-event-item.h70
-rw-r--r--calendar/gui/e-week-view-layout.c425
-rw-r--r--calendar/gui/e-week-view-layout.h69
-rw-r--r--calendar/gui/e-week-view-main-item.c400
-rw-r--r--calendar/gui/e-week-view-main-item.h66
-rw-r--r--calendar/gui/e-week-view-titles-item.c296
-rw-r--r--calendar/gui/e-week-view-titles-item.h66
-rw-r--r--calendar/gui/e-week-view.c3676
-rw-r--r--calendar/gui/e-week-view.h438
-rw-r--r--calendar/gui/gnome-cal.c2925
-rw-r--r--calendar/gui/gnome-cal.h189
-rw-r--r--calendar/gui/gnome-calendar-conduit.pngbin3000 -> 0 bytes-rw-r--r--calendar/gui/goto-dialog.glade225
-rw-r--r--calendar/gui/goto.c266
-rw-r--r--calendar/gui/goto.h31
-rw-r--r--calendar/gui/itip-bonobo-control.c265
-rw-r--r--calendar/gui/itip-bonobo-control.h31
-rw-r--r--calendar/gui/itip-utils.c979
-rw-r--r--calendar/gui/itip-utils.h35
-rw-r--r--calendar/gui/main.c181
-rw-r--r--calendar/gui/migration.c150
-rw-r--r--calendar/gui/migration.h31
-rw-r--r--calendar/gui/misc.c80
-rw-r--r--calendar/gui/misc.h30
-rw-r--r--calendar/gui/print.c2658
-rw-r--r--calendar/gui/print.h43
-rw-r--r--calendar/gui/tag-calendar.c230
-rw-r--r--calendar/gui/tag-calendar.h33
-rw-r--r--calendar/gui/tasks-component.c812
-rw-r--r--calendar/gui/tasks-component.h60
-rw-r--r--calendar/gui/tasks-control.c627
-rw-r--r--calendar/gui/tasks-control.h34
-rw-r--r--calendar/gui/weekday-picker.c572
-rw-r--r--calendar/gui/weekday-picker.h71
-rw-r--r--calendar/idl/.cvsignore2
-rw-r--r--calendar/idl/Makefile.am5
-rw-r--r--calendar/idl/evolution-calendar.idl48
-rw-r--r--calendar/importers/.cvsignore6
-rw-r--r--calendar/importers/GNOME_Evolution_Calendar_Importer.server.in.in54
-rw-r--r--calendar/importers/Makefile.am53
-rw-r--r--calendar/importers/evolution-calendar-importer.h37
-rw-r--r--calendar/importers/icalendar-importer.c753
-rw-r--r--calendar/importers/main.c56
-rw-r--r--calendar/zones.h387
-rw-r--r--camel.pc.in15
-rw-r--r--camel/.cvsignore13
-rw-r--r--camel/CODING.STYLE19
-rw-r--r--camel/ChangeLog1488
-rw-r--r--camel/ChangeLog.pre-1-422083
-rw-r--r--camel/Makefile.am296
-rw-r--r--camel/README54
-rw-r--r--camel/README.COPYRIGHT46
-rw-r--r--camel/README.HACKING14
-rw-r--r--camel/README.mt171
-rw-r--r--camel/broken-date-parser.c532
-rw-r--r--camel/broken-date-parser.h33
-rw-r--r--camel/camel-address.c240
-rw-r--r--camel/camel-address.h79
-rw-r--r--camel/camel-arg.c130
-rw-r--r--camel/camel-arg.h119
-rw-r--r--camel/camel-block-file.c1181
-rw-r--r--camel/camel-block-file.h144
-rw-r--r--camel/camel-certdb.c665
-rw-r--r--camel/camel-certdb.h154
-rw-r--r--camel/camel-charset-map-private.h621
-rw-r--r--camel/camel-charset-map.c352
-rw-r--r--camel/camel-charset-map.h51
-rw-r--r--camel/camel-cipher-context.c585
-rw-r--r--camel/camel-cipher-context.h174
-rw-r--r--camel/camel-data-cache.c421
-rw-r--r--camel/camel-data-cache.h98
-rw-r--r--camel/camel-data-wrapper.c389
-rw-r--r--camel/camel-data-wrapper.h105
-rw-r--r--camel/camel-digest-folder.c396
-rw-r--r--camel/camel-digest-folder.h52
-rw-r--r--camel/camel-digest-store.c203
-rw-r--r--camel/camel-digest-store.h59
-rw-r--r--camel/camel-digest-summary.c90
-rw-r--r--camel/camel-digest-summary.h62
-rw-r--r--camel/camel-disco-diary.c436
-rw-r--r--camel/camel-disco-diary.h98
-rw-r--r--camel/camel-disco-folder.c399
-rw-r--r--camel/camel-disco-folder.h121
-rw-r--r--camel/camel-disco-store.c373
-rw-r--r--camel/camel-disco-store.h125
-rw-r--r--camel/camel-exception-list.def37
-rw-r--r--camel/camel-exception.c306
-rw-r--r--camel/camel-exception.h87
-rw-r--r--camel/camel-file-utils.c546
-rw-r--r--camel/camel-file-utils.h63
-rw-r--r--camel/camel-filter-driver.c1473
-rw-r--r--camel/camel-filter-driver.h119
-rw-r--r--camel/camel-filter-search.c703
-rw-r--r--camel/camel-filter-search.h54
-rw-r--r--camel/camel-folder-search.c1174
-rw-r--r--camel/camel-folder-search.h133
-rw-r--r--camel/camel-folder-summary.c2831
-rw-r--r--camel/camel-folder-summary.h350
-rw-r--r--camel/camel-folder-thread.c861
-rw-r--r--camel/camel-folder-thread.h75
-rw-r--r--camel/camel-folder.c2161
-rw-r--r--camel/camel-folder.h348
-rw-r--r--camel/camel-gpg-context.c1794
-rw-r--r--camel/camel-gpg-context.h64
-rw-r--r--camel/camel-html-parser.c807
-rw-r--r--camel/camel-html-parser.h78
-rw-r--r--camel/camel-http-stream.c583
-rw-r--r--camel/camel-http-stream.h105
-rw-r--r--camel/camel-i18n.h62
-rw-r--r--camel/camel-iconv.c646
-rw-r--r--camel/camel-iconv.h50
-rw-r--r--camel/camel-index-control.c213
-rw-r--r--camel/camel-index.c396
-rw-r--r--camel/camel-index.h165
-rw-r--r--camel/camel-internet-address.c551
-rw-r--r--camel/camel-internet-address.h65
-rw-r--r--camel/camel-junk-plugin.c75
-rw-r--r--camel/camel-junk-plugin.h59
-rw-r--r--camel/camel-lock-client.c321
-rw-r--r--camel/camel-lock-client.h41
-rw-r--r--camel/camel-lock-helper.c390
-rw-r--r--camel/camel-lock-helper.h69
-rw-r--r--camel/camel-lock.c425
-rw-r--r--camel/camel-lock.h63
-rw-r--r--camel/camel-medium.c332
-rw-r--r--camel/camel-medium.h97
-rw-r--r--camel/camel-mime-filter-basic.c291
-rw-r--r--camel/camel-mime-filter-basic.h71
-rw-r--r--camel/camel-mime-filter-bestenc.c300
-rw-r--r--camel/camel-mime-filter-bestenc.h101
-rw-r--r--camel/camel-mime-filter-canon.c239
-rw-r--r--camel/camel-mime-filter-canon.h65
-rw-r--r--camel/camel-mime-filter-charset.c277
-rw-r--r--camel/camel-mime-filter-charset.h62
-rw-r--r--camel/camel-mime-filter-crlf.c172
-rw-r--r--camel/camel-mime-filter-crlf.h73
-rw-r--r--camel/camel-mime-filter-enriched.c591
-rw-r--r--camel/camel-mime-filter-enriched.h67
-rw-r--r--camel/camel-mime-filter-from.c217
-rw-r--r--camel/camel-mime-filter-from.h57
-rw-r--r--camel/camel-mime-filter-html.c200
-rw-r--r--camel/camel-mime-filter-html.h57
-rw-r--r--camel/camel-mime-filter-index.c157
-rw-r--r--camel/camel-mime-filter-index.h65
-rw-r--r--camel/camel-mime-filter-linewrap.c147
-rw-r--r--camel/camel-mime-filter-linewrap.h60
-rw-r--r--camel/camel-mime-filter-save.c115
-rw-r--r--camel/camel-mime-filter-save.h61
-rw-r--r--camel/camel-mime-filter-tohtml.c447
-rw-r--r--camel/camel-mime-filter-tohtml.h82
-rw-r--r--camel/camel-mime-filter-windows.c180
-rw-r--r--camel/camel-mime-filter-windows.h65
-rw-r--r--camel/camel-mime-filter.c256
-rw-r--r--camel/camel-mime-filter.h94
-rw-r--r--camel/camel-mime-message.c963
-rw-r--r--camel/camel-mime-message.h140
-rw-r--r--camel/camel-mime-parser.c1982
-rw-r--r--camel/camel-mime-parser.h146
-rw-r--r--camel/camel-mime-part-utils.c137
-rw-r--r--camel/camel-mime-part-utils.h44
-rw-r--r--camel/camel-mime-part.c912
-rw-r--r--camel/camel-mime-part.h115
-rw-r--r--camel/camel-mime-utils.c4346
-rw-r--r--camel/camel-mime-utils.h273
-rw-r--r--camel/camel-movemail.c542
-rw-r--r--camel/camel-movemail.h44
-rw-r--r--camel/camel-multipart-encrypted.c273
-rw-r--r--camel/camel-multipart-encrypted.h83
-rw-r--r--camel/camel-multipart-signed.c763
-rw-r--r--camel/camel-multipart-signed.h108
-rw-r--r--camel/camel-multipart.c589
-rw-r--r--camel/camel-multipart.h104
-rw-r--r--camel/camel-news-address.c65
-rw-r--r--camel/camel-news-address.h56
-rw-r--r--camel/camel-object.c1834
-rw-r--r--camel/camel-object.h290
-rw-r--r--camel/camel-operation.c687
-rw-r--r--camel/camel-operation.h74
-rw-r--r--camel/camel-partition-table.c998
-rw-r--r--camel/camel-partition-table.h152
-rw-r--r--camel/camel-private.h168
-rw-r--r--camel/camel-process.c151
-rw-r--r--camel/camel-process.h44
-rw-r--r--camel/camel-provider.c192
-rw-r--r--camel/camel-provider.h201
-rw-r--r--camel/camel-sasl-anonymous.c152
-rw-r--r--camel/camel-sasl-anonymous.h70
-rw-r--r--camel/camel-sasl-cram-md5.c142
-rw-r--r--camel/camel-sasl-cram-md5.h59
-rw-r--r--camel/camel-sasl-digest-md5.c898
-rw-r--r--camel/camel-sasl-digest-md5.h62
-rw-r--r--camel/camel-sasl-gssapi.c340
-rw-r--r--camel/camel-sasl-gssapi.h64
-rw-r--r--camel/camel-sasl-kerberos4.c224
-rw-r--r--camel/camel-sasl-kerberos4.h62
-rw-r--r--camel/camel-sasl-login.c134
-rw-r--r--camel/camel-sasl-login.h61
-rw-r--r--camel/camel-sasl-ntlm.c706
-rw-r--r--camel/camel-sasl-ntlm.h57
-rw-r--r--camel/camel-sasl-plain.c104
-rw-r--r--camel/camel-sasl-plain.h59
-rw-r--r--camel/camel-sasl-popb4smtp.c151
-rw-r--r--camel/camel-sasl-popb4smtp.h59
-rw-r--r--camel/camel-sasl.c285
-rw-r--r--camel/camel-sasl.h78
-rw-r--r--camel/camel-search-private.c684
-rw-r--r--camel/camel-search-private.h82
-rw-r--r--camel/camel-seekable-stream.c202
-rw-r--r--camel/camel-seekable-stream.h87
-rw-r--r--camel/camel-seekable-substream.c302
-rw-r--r--camel/camel-seekable-substream.h68
-rw-r--r--camel/camel-service.c958
-rw-r--r--camel/camel-service.h155
-rw-r--r--camel/camel-session.c901
-rw-r--r--camel/camel-session.h217
-rw-r--r--camel/camel-smime-context.c1061
-rw-r--r--camel/camel-smime-context.h79
-rw-r--r--camel/camel-store-summary.c928
-rw-r--r--camel/camel-store-summary.h176
-rw-r--r--camel/camel-store.c1228
-rw-r--r--camel/camel-store.h242
-rw-r--r--camel/camel-stream-buffer.c471
-rw-r--r--camel/camel-stream-buffer.h106
-rw-r--r--camel/camel-stream-filter.c406
-rw-r--r--camel/camel-stream-filter.h63
-rw-r--r--camel/camel-stream-fs.c304
-rw-r--r--camel/camel-stream-fs.h74
-rw-r--r--camel/camel-stream-mem.c248
-rw-r--r--camel/camel-stream-mem.h74
-rw-r--r--camel/camel-stream-null.c91
-rw-r--r--camel/camel-stream-null.h57
-rw-r--r--camel/camel-stream-process.c273
-rw-r--r--camel/camel-stream-process.h59
-rw-r--r--camel/camel-stream.c281
-rw-r--r--camel/camel-stream.h90
-rw-r--r--camel/camel-string-utils.c110
-rw-r--r--camel/camel-string-utils.h47
-rw-r--r--camel/camel-tcp-stream-openssl.c954
-rw-r--r--camel/camel-tcp-stream-raw.c562
-rw-r--r--camel/camel-tcp-stream-raw.h64
-rw-r--r--camel/camel-tcp-stream-ssl.c1211
-rw-r--r--camel/camel-tcp-stream-ssl.h75
-rw-r--r--camel/camel-tcp-stream.c249
-rw-r--r--camel/camel-tcp-stream.h140
-rw-r--r--camel/camel-text-index.c1948
-rw-r--r--camel/camel-text-index.h114
-rw-r--r--camel/camel-transport.c141
-rw-r--r--camel/camel-transport.h82
-rw-r--r--camel/camel-types.h83
-rw-r--r--camel/camel-uid-cache.c334
-rw-r--r--camel/camel-uid-cache.h60
-rw-r--r--camel/camel-url-scanner.c450
-rw-r--r--camel/camel-url-scanner.h73
-rw-r--r--camel/camel-url.c584
-rw-r--r--camel/camel-url.h90
-rw-r--r--camel/camel-utf8.c400
-rw-r--r--camel/camel-utf8.h41
-rw-r--r--camel/camel-vee-folder.c1683
-rw-r--r--camel/camel-vee-folder.h84
-rw-r--r--camel/camel-vee-store.c324
-rw-r--r--camel/camel-vee-store.h60
-rw-r--r--camel/camel-vtrash-folder.c209
-rw-r--r--camel/camel-vtrash-folder.h63
-rw-r--r--camel/camel.c115
-rw-r--r--camel/camel.h91
-rw-r--r--camel/devel-docs/camel-index.txt407
-rw-r--r--camel/devel-docs/camel_data_wrapper.diabin3062 -> 0 bytes-rw-r--r--camel/devel-docs/camel_parser_states.diabin2505 -> 0 bytes-rw-r--r--camel/devel-docs/camel_stream.diabin2669 -> 0 bytes-rw-r--r--camel/providers/.cvsignore2
-rw-r--r--camel/providers/Makefile.am12
-rw-r--r--camel/providers/imap/.cvsignore11
-rw-r--r--camel/providers/imap/Makefile.am48
-rw-r--r--camel/providers/imap/camel-imap-command.c822
-rw-r--r--camel/providers/imap/camel-imap-command.h80
-rw-r--r--camel/providers/imap/camel-imap-folder.c2729
-rw-r--r--camel/providers/imap/camel-imap-folder.h90
-rw-r--r--camel/providers/imap/camel-imap-message-cache.c527
-rw-r--r--camel/providers/imap/camel-imap-message-cache.h111
-rw-r--r--camel/providers/imap/camel-imap-private.h76
-rw-r--r--camel/providers/imap/camel-imap-provider.c158
-rw-r--r--camel/providers/imap/camel-imap-search.c499
-rw-r--r--camel/providers/imap/camel-imap-search.h62
-rw-r--r--camel/providers/imap/camel-imap-store-summary.c619
-rw-r--r--camel/providers/imap/camel-imap-store-summary.h102
-rw-r--r--camel/providers/imap/camel-imap-store.c2845
-rw-r--r--camel/providers/imap/camel-imap-store.h148
-rw-r--r--camel/providers/imap/camel-imap-summary.c255
-rw-r--r--camel/providers/imap/camel-imap-summary.h79
-rw-r--r--camel/providers/imap/camel-imap-types.h39
-rw-r--r--camel/providers/imap/camel-imap-utils.c1261
-rw-r--r--camel/providers/imap/camel-imap-utils.h95
-rw-r--r--camel/providers/imap/camel-imap-wrapper.c185
-rw-r--r--camel/providers/imap/camel-imap-wrapper.h70
-rw-r--r--camel/providers/imap/libcamelimap.urls1
-rw-r--r--camel/providers/imapp/.cvsignore11
-rw-r--r--camel/providers/imapp/Makefile.am45
-rw-r--r--camel/providers/imapp/camel-imapp-driver.c771
-rw-r--r--camel/providers/imapp/camel-imapp-driver.h81
-rw-r--r--camel/providers/imapp/camel-imapp-engine.c1180
-rw-r--r--camel/providers/imapp/camel-imapp-engine.h155
-rw-r--r--camel/providers/imapp/camel-imapp-exception.h35
-rw-r--r--camel/providers/imapp/camel-imapp-fetch-stream.c183
-rw-r--r--camel/providers/imapp/camel-imapp-fetch-stream.h47
-rw-r--r--camel/providers/imapp/camel-imapp-folder.c269
-rw-r--r--camel/providers/imapp/camel-imapp-folder.h66
-rw-r--r--camel/providers/imapp/camel-imapp-provider.c97
-rw-r--r--camel/providers/imapp/camel-imapp-store-summary.c616
-rw-r--r--camel/providers/imapp/camel-imapp-store-summary.h102
-rw-r--r--camel/providers/imapp/camel-imapp-store.c1006
-rw-r--r--camel/providers/imapp/camel-imapp-store.h77
-rw-r--r--camel/providers/imapp/camel-imapp-stream.c761
-rw-r--r--camel/providers/imapp/camel-imapp-stream.h90
-rw-r--r--camel/providers/imapp/camel-imapp-summary.c166
-rw-r--r--camel/providers/imapp/camel-imapp-summary.h65
-rw-r--r--camel/providers/imapp/camel-imapp-utils.c1339
-rw-r--r--camel/providers/imapp/camel-imapp-utils.h145
-rw-r--r--camel/providers/imapp/libcamelimapp.urls1
-rw-r--r--camel/providers/local/.cvsignore11
-rw-r--r--camel/providers/local/Makefile.am61
-rw-r--r--camel/providers/local/camel-local-folder.c646
-rw-r--r--camel/providers/local/camel-local-folder.h109
-rw-r--r--camel/providers/local/camel-local-private.h53
-rw-r--r--camel/providers/local/camel-local-provider.c222
-rw-r--r--camel/providers/local/camel-local-store.c442
-rw-r--r--camel/providers/local/camel-local-store.h68
-rw-r--r--camel/providers/local/camel-local-summary.c614
-rw-r--r--camel/providers/local/camel-local-summary.h88
-rw-r--r--camel/providers/local/camel-maildir-folder.c245
-rw-r--r--camel/providers/local/camel-maildir-folder.h58
-rw-r--r--camel/providers/local/camel-maildir-store.c416
-rw-r--r--camel/providers/local/camel-maildir-store.h55
-rw-r--r--camel/providers/local/camel-maildir-summary.c807
-rw-r--r--camel/providers/local/camel-maildir-summary.h84
-rw-r--r--camel/providers/local/camel-mbox-folder.c549
-rw-r--r--camel/providers/local/camel-mbox-folder.h62
-rw-r--r--camel/providers/local/camel-mbox-store.c753
-rw-r--r--camel/providers/local/camel-mbox-store.h58
-rw-r--r--camel/providers/local/camel-mbox-summary.c1029
-rw-r--r--camel/providers/local/camel-mbox-summary.h75
-rw-r--r--camel/providers/local/camel-mh-folder.c231
-rw-r--r--camel/providers/local/camel-mh-folder.h58
-rw-r--r--camel/providers/local/camel-mh-store.c533
-rw-r--r--camel/providers/local/camel-mh-store.h60
-rw-r--r--camel/providers/local/camel-mh-summary.c420
-rw-r--r--camel/providers/local/camel-mh-summary.h53
-rw-r--r--camel/providers/local/camel-spool-folder.c186
-rw-r--r--camel/providers/local/camel-spool-folder.h64
-rw-r--r--camel/providers/local/camel-spool-store.c483
-rw-r--r--camel/providers/local/camel-spool-store.h69
-rw-r--r--camel/providers/local/camel-spool-summary.c344
-rw-r--r--camel/providers/local/camel-spool-summary.h69
-rw-r--r--camel/providers/local/libcamellocal.urls5
-rw-r--r--camel/providers/nntp/.cvsignore12
-rw-r--r--camel/providers/nntp/Makefile.am36
-rw-r--r--camel/providers/nntp/camel-nntp-auth.c92
-rw-r--r--camel/providers/nntp/camel-nntp-auth.h42
-rw-r--r--camel/providers/nntp/camel-nntp-folder.c405
-rw-r--r--camel/providers/nntp/camel-nntp-folder.h72
-rw-r--r--camel/providers/nntp/camel-nntp-grouplist.c219
-rw-r--r--camel/providers/nntp/camel-nntp-grouplist.h48
-rw-r--r--camel/providers/nntp/camel-nntp-newsrc.c651
-rw-r--r--camel/providers/nntp/camel-nntp-newsrc.h34
-rw-r--r--camel/providers/nntp/camel-nntp-private.h64
-rw-r--r--camel/providers/nntp/camel-nntp-provider.c113
-rw-r--r--camel/providers/nntp/camel-nntp-resp-codes.h55
-rw-r--r--camel/providers/nntp/camel-nntp-store.c576
-rw-r--r--camel/providers/nntp/camel-nntp-store.h92
-rw-r--r--camel/providers/nntp/camel-nntp-stream.c462
-rw-r--r--camel/providers/nntp/camel-nntp-stream.h66
-rw-r--r--camel/providers/nntp/camel-nntp-summary.c584
-rw-r--r--camel/providers/nntp/camel-nntp-summary.h67
-rw-r--r--camel/providers/nntp/camel-nntp-types.h33
-rw-r--r--camel/providers/nntp/camel-nntp-utils.c299
-rw-r--r--camel/providers/nntp/camel-nntp-utils.h41
-rw-r--r--camel/providers/nntp/libcamelnntp.urls2
-rw-r--r--camel/providers/nntp/test-newsrc.c10
-rw-r--r--camel/providers/pop3/.cvsignore10
-rw-r--r--camel/providers/pop3/Makefile.am38
-rw-r--r--camel/providers/pop3/camel-pop3-engine.c382
-rw-r--r--camel/providers/pop3/camel-pop3-engine.h134
-rw-r--r--camel/providers/pop3/camel-pop3-folder.c558
-rw-r--r--camel/providers/pop3/camel-pop3-folder.h77
-rw-r--r--camel/providers/pop3/camel-pop3-provider.c108
-rw-r--r--camel/providers/pop3/camel-pop3-store.c657
-rw-r--r--camel/providers/pop3/camel-pop3-store.h79
-rw-r--r--camel/providers/pop3/camel-pop3-stream.c471
-rw-r--r--camel/providers/pop3/camel-pop3-stream.h69
-rw-r--r--camel/providers/pop3/libcamelpop3.urls1
-rw-r--r--camel/providers/sendmail/.cvsignore11
-rw-r--r--camel/providers/sendmail/Makefile.am28
-rw-r--r--camel/providers/sendmail/camel-sendmail-provider.c63
-rw-r--r--camel/providers/sendmail/camel-sendmail-transport.c262
-rw-r--r--camel/providers/sendmail/camel-sendmail-transport.h63
-rw-r--r--camel/providers/sendmail/libcamelsendmail.urls1
-rw-r--r--camel/providers/smtp/.cvsignore10
-rw-r--r--camel/providers/smtp/Makefile.am35
-rw-r--r--camel/providers/smtp/camel-smtp-provider.c65
-rw-r--r--camel/providers/smtp/camel-smtp-transport.c1455
-rw-r--r--camel/providers/smtp/camel-smtp-transport.h89
-rw-r--r--camel/providers/smtp/libcamelsmtp.urls1
-rw-r--r--camel/tests/.cvsignore7
-rw-r--r--camel/tests/Makefile.am3
-rw-r--r--camel/tests/README44
-rw-r--r--camel/tests/data/camel-test.gpg.pub24
-rw-r--r--camel/tests/data/camel-test.gpg.sec33
-rwxr-xr-xcamel/tests/data/gendoc.pl65
-rwxr-xr-xcamel/tests/data/genline.pl72
-rwxr-xr-xcamel/tests/data/getaddr.pl32
-rw-r--r--camel/tests/data/messages/.cvsignore1
-rw-r--r--camel/tests/folder/.cvsignore21
-rw-r--r--camel/tests/folder/Makefile.am28
-rw-r--r--camel/tests/folder/README12
-rw-r--r--camel/tests/folder/test1.c50
-rw-r--r--camel/tests/folder/test10.c103
-rw-r--r--camel/tests/folder/test2.c58
-rw-r--r--camel/tests/folder/test3.c339
-rw-r--r--camel/tests/folder/test4.c53
-rw-r--r--camel/tests/folder/test5.c53
-rw-r--r--camel/tests/folder/test6.c56
-rw-r--r--camel/tests/folder/test7.c55
-rw-r--r--camel/tests/folder/test8.c205
-rw-r--r--camel/tests/folder/test9.c229
-rw-r--r--camel/tests/lib/.cvsignore12
-rw-r--r--camel/tests/lib/Makefile.am22
-rw-r--r--camel/tests/lib/address-data.h93
-rw-r--r--camel/tests/lib/addresses.c54
-rw-r--r--camel/tests/lib/addresses.h5
-rw-r--r--camel/tests/lib/camel-test.c355
-rw-r--r--camel/tests/lib/camel-test.h68
-rw-r--r--camel/tests/lib/folders.c568
-rw-r--r--camel/tests/lib/folders.h20
-rw-r--r--camel/tests/lib/messages.c290
-rw-r--r--camel/tests/lib/messages.h15
-rw-r--r--camel/tests/lib/session.c44
-rw-r--r--camel/tests/lib/session.h19
-rw-r--r--camel/tests/lib/streams.c244
-rw-r--r--camel/tests/lib/streams.h12
-rw-r--r--camel/tests/message/.cvsignore15
-rw-r--r--camel/tests/message/Makefile.am25
-rw-r--r--camel/tests/message/README9
-rw-r--r--camel/tests/message/test1.c201
-rw-r--r--camel/tests/message/test2.c326
-rw-r--r--camel/tests/message/test3.c199
-rw-r--r--camel/tests/message/test4.c129
-rw-r--r--camel/tests/mime-filter/.cvsignore8
-rw-r--r--camel/tests/mime-filter/Makefile.am36
-rw-r--r--camel/tests/mime-filter/charset-gb2312.0.in448
-rw-r--r--camel/tests/mime-filter/charset-gb2312.0.out448
-rw-r--r--camel/tests/mime-filter/charset-iso-2022-jp.0.in5
-rw-r--r--camel/tests/mime-filter/charset-iso-2022-jp.0.out5
-rw-r--r--camel/tests/mime-filter/crlf-1.in19
-rw-r--r--camel/tests/mime-filter/crlf-1.out19
-rw-r--r--camel/tests/mime-filter/data/html.0.in10
-rw-r--r--camel/tests/mime-filter/data/html.0.out10
-rw-r--r--camel/tests/mime-filter/data/html.1.in10
-rw-r--r--camel/tests/mime-filter/data/html.1.out10
-rw-r--r--camel/tests/mime-filter/test-charset.c140
-rw-r--r--camel/tests/mime-filter/test-crlf.c160
-rw-r--r--camel/tests/mime-filter/test-tohtml.c132
-rw-r--r--camel/tests/misc/.cvsignore14
-rw-r--r--camel/tests/misc/Makefile.am27
-rw-r--r--camel/tests/misc/README4
-rw-r--r--camel/tests/misc/split.c113
-rw-r--r--camel/tests/misc/url.c123
-rw-r--r--camel/tests/misc/utf7.c106
-rw-r--r--camel/tests/smime/.cvsignore5
-rw-r--r--camel/tests/smime/Makefile.am24
-rw-r--r--camel/tests/smime/README2
-rw-r--r--camel/tests/smime/pgp-mime.c214
-rw-r--r--camel/tests/smime/pgp.c246
-rw-r--r--camel/tests/smime/pkcs7.c178
-rw-r--r--camel/tests/stream/.cvsignore14
-rw-r--r--camel/tests/stream/Makefile.am25
-rw-r--r--camel/tests/stream/README4
-rw-r--r--camel/tests/stream/test1.c119
-rw-r--r--camel/tests/stream/test2.c53
-rw-r--r--camel/tests/stream/test3.c104
-rw-r--r--composer/.cvsignore22
-rw-r--r--composer/ChangeLog399
-rw-r--r--composer/ChangeLog.pre-1-44037
-rw-r--r--composer/Composer.idl4
-rw-r--r--composer/Evolution-Composer.idl141
-rw-r--r--composer/Makefile.am87
-rw-r--r--composer/bad-icon.xpm53
-rw-r--r--composer/e-msg-composer-attachment-bar.c850
-rw-r--r--composer/e-msg-composer-attachment-bar.h77
-rw-r--r--composer/e-msg-composer-attachment.c457
-rw-r--r--composer/e-msg-composer-attachment.glade237
-rw-r--r--composer/e-msg-composer-attachment.h77
-rw-r--r--composer/e-msg-composer-hdrs.c1342
-rw-r--r--composer/e-msg-composer-hdrs.h152
-rw-r--r--composer/e-msg-composer-select-file.c136
-rw-r--r--composer/e-msg-composer-select-file.h35
-rw-r--r--composer/e-msg-composer.c5055
-rw-r--r--composer/e-msg-composer.h226
-rw-r--r--composer/evolution-composer.c397
-rw-r--r--composer/evolution-composer.h75
-rw-r--r--composer/listener.c275
-rw-r--r--composer/listener.h51
-rw-r--r--configure.in1384
-rw-r--r--data/.cvsignore4
-rw-r--r--data/Makefile.am65
-rw-r--r--data/cde_app_root/.cvsignore2
-rw-r--r--data/cde_app_root/Makefile.am1
-rw-r--r--data/cde_app_root/dt/.cvsignore2
-rw-r--r--data/cde_app_root/dt/Makefile.am1
-rw-r--r--data/cde_app_root/dt/appconfig/.cvsignore2
-rw-r--r--data/cde_app_root/dt/appconfig/Makefile.am1
-rw-r--r--data/cde_app_root/dt/appconfig/appmanager/.cvsignore2
-rw-r--r--data/cde_app_root/dt/appconfig/appmanager/C/.cvsignore2
-rw-r--r--data/cde_app_root/dt/appconfig/appmanager/C/Makefile.am1
-rw-r--r--data/cde_app_root/dt/appconfig/appmanager/C/Ximian/.cvsignore2
-rwxr-xr-xdata/cde_app_root/dt/appconfig/appmanager/C/Ximian/Evolution17
-rw-r--r--data/cde_app_root/dt/appconfig/appmanager/C/Ximian/Makefile.am6
-rw-r--r--data/cde_app_root/dt/appconfig/appmanager/Makefile.am1
-rw-r--r--data/cde_app_root/dt/appconfig/icons/.cvsignore2
-rw-r--r--data/cde_app_root/dt/appconfig/icons/C/.cvsignore2
-rw-r--r--data/cde_app_root/dt/appconfig/icons/C/Evolution.l.pm307
-rw-r--r--data/cde_app_root/dt/appconfig/icons/C/Evolution.m.pm291
-rw-r--r--data/cde_app_root/dt/appconfig/icons/C/Evolution.t.pm103
-rw-r--r--data/cde_app_root/dt/appconfig/icons/C/Makefile.am15
-rw-r--r--data/cde_app_root/dt/appconfig/icons/C/Ximian.l.pm147
-rw-r--r--data/cde_app_root/dt/appconfig/icons/C/Ximian.m.pm272
-rw-r--r--data/cde_app_root/dt/appconfig/icons/C/Ximian.t.pm289
-rw-r--r--data/cde_app_root/dt/appconfig/icons/Makefile.am1
-rw-r--r--data/cde_app_root/dt/appconfig/types/.cvsignore2
-rw-r--r--data/cde_app_root/dt/appconfig/types/C/.cvsignore3
-rw-r--r--data/cde_app_root/dt/appconfig/types/C/Makefile.am6
-rw-r--r--data/cde_app_root/dt/appconfig/types/C/Ximian.dt.in30
-rw-r--r--data/cde_app_root/dt/appconfig/types/Makefile.am1
-rw-r--r--data/evolution.141
-rw-r--r--data/evolution.desktop.in.in12
-rw-r--r--data/evolution.keys.in24
-rw-r--r--data/evolution.mime5
-rw-r--r--default_user/.cvsignore2
-rw-r--r--default_user/ChangeLog0
-rw-r--r--default_user/ChangeLog.pre-1-4336
-rw-r--r--default_user/Makefile.am19
-rw-r--r--default_user/addressbook-sources.xml10
-rw-r--r--default_user/local/.cvsignore2
-rw-r--r--default_user/local/Calendar/.cvsignore2
-rw-r--r--default_user/local/Calendar/Makefile.am3
-rw-r--r--default_user/local/Calendar/calendar.ics5
-rw-r--r--default_user/local/Calendar/folder-metadata.xml5
-rw-r--r--default_user/local/Contacts/.cvsignore2
-rw-r--r--default_user/local/Contacts/Makefile.am5
-rw-r--r--default_user/local/Contacts/create-initial0
-rw-r--r--default_user/local/Contacts/folder-metadata.xml5
-rw-r--r--default_user/local/Drafts/.cvsignore2
-rw-r--r--default_user/local/Drafts/Makefile.am4
-rw-r--r--default_user/local/Drafts/folder-metadata.xml5
-rw-r--r--default_user/local/Drafts/mbox0
-rw-r--r--default_user/local/Inbox/.cvsignore2
-rw-r--r--default_user/local/Inbox/Makefile.am7
-rw-r--r--default_user/local/Inbox/folder-metadata.xml5
-rw-r--r--default_user/local/Inbox/mbox432
-rw-r--r--default_user/local/Makefile.am9
-rw-r--r--default_user/local/Outbox/.cvsignore2
-rw-r--r--default_user/local/Outbox/Makefile.am4
-rw-r--r--default_user/local/Outbox/folder-metadata.xml5
-rw-r--r--default_user/local/Outbox/mbox0
-rw-r--r--default_user/local/Sent/.cvsignore2
-rw-r--r--default_user/local/Sent/Makefile.am4
-rw-r--r--default_user/local/Sent/folder-metadata.xml5
-rw-r--r--default_user/local/Sent/mbox0
-rw-r--r--default_user/local/Tasks/.cvsignore2
-rw-r--r--default_user/local/Tasks/Makefile.am3
-rw-r--r--default_user/local/Tasks/folder-metadata.xml5
-rw-r--r--default_user/local/Tasks/tasks.ics5
-rw-r--r--default_user/local/Trash/.cvsignore2
-rw-r--r--default_user/local/Trash/Makefile.am4
-rw-r--r--default_user/local/Trash/folder-metadata.xml5
-rw-r--r--default_user/searches.xml110
-rw-r--r--default_user/vfolders.xml25
-rw-r--r--designs/ChangeLog36
-rw-r--r--designs/OOA/Comments3
-rw-r--r--designs/OOA/ooa.glade488
-rw-r--r--designs/OOA/oooa_question.pngbin16230 -> 0 bytes-rw-r--r--designs/OOA/oooa_screenshot.pngbin14630 -> 0 bytes-rw-r--r--designs/OOA/outlook_question.pngbin9421 -> 0 bytes-rw-r--r--designs/OOA/outlook_screenshot.pngbin54458 -> 0 bytes-rw-r--r--designs/OOA/spec.txt29
-rw-r--r--designs/read_receipts/.cvsignore1
-rw-r--r--designs/read_receipts/Comments3
-rw-r--r--designs/read_receipts/notification-of-rr-request.jpgbin26853 -> 0 bytes-rw-r--r--designs/read_receipts/proposal.pngbin26147 -> 0 bytes-rw-r--r--designs/read_receipts/read.glade339
-rw-r--r--designs/read_receipts/read.gladep7
-rw-r--r--designs/read_receipts/read_receipt_options.jpgbin40847 -> 0 bytes-rw-r--r--designs/read_receipts/receipt.jpgbin103530 -> 0 bytes-rw-r--r--designs/read_receipts/secure_options.jpgbin18181 -> 0 bytes-rw-r--r--designs/read_receipts/spec.txt67
-rw-r--r--devel-docs/.cvsignore3
-rw-r--r--devel-docs/Makefile.am3
-rw-r--r--devel-docs/camel/.cvsignore12
-rw-r--r--devel-docs/camel/Makefile.am101
-rw-r--r--devel-docs/camel/README_AND_TODO.txt43
-rw-r--r--devel-docs/camel/camel-docs.sgml28
-rw-r--r--devel-docs/camel/camel-sections.txt154
-rw-r--r--devel-docs/camel/camel.types9
-rw-r--r--devel-docs/camel/tmpl/.cvsignore2
-rw-r--r--devel-docs/camel/tmpl/camel-data-wrapper.sgml26
-rw-r--r--devel-docs/camel/tmpl/camel-folder.sgml96
-rw-r--r--devel-docs/camel/tmpl/camel-mime-message.sgml171
-rw-r--r--devel-docs/camel/tmpl/camel-mime-part.sgml151
-rw-r--r--devel-docs/camel/tmpl/camel-recipient.sgml88
-rw-r--r--devel-docs/camel/tmpl/camel-service.sgml72
-rw-r--r--devel-docs/camel/tmpl/camel-store.sgml45
-rw-r--r--devel-docs/camel/tmpl/camel-stream.sgml101
-rw-r--r--devel-docs/misc/ref_and_id_proposition.txt237
-rw-r--r--devel-docs/query/virtual-folder-in-depth.sgml407
-rw-r--r--devel-docs/query/virtual-folder-in-depth.txt309
-rw-r--r--doc/.cvsignore2
-rw-r--r--doc/COPYING-DOCS355
-rw-r--r--doc/Camel-Classes65
-rw-r--r--doc/ChangeLog0
-rw-r--r--doc/ChangeLog.pre-1-41146
-rw-r--r--doc/Design201
-rw-r--r--doc/Keybindings13
-rw-r--r--doc/Makefile.am3
-rw-r--r--doc/NAMESPACE65
-rw-r--r--doc/devel/.cvsignore5
-rw-r--r--doc/devel/ChangeLog6
-rw-r--r--doc/devel/ChangeLog.pre-1-4286
-rw-r--r--doc/devel/Makefile.am179
-rw-r--r--doc/devel/calendar/.cvsignore2
-rw-r--r--doc/devel/calendar/Makefile.am7
-rw-r--r--doc/devel/calendar/alarm-generation.sgml155
-rw-r--r--doc/devel/calendar/architecture.sgml162
-rw-r--r--doc/devel/calendar/cal-client/.cvsignore13
-rw-r--r--doc/devel/calendar/cal-client/Makefile.am196
-rw-r--r--doc/devel/calendar/cal-client/evolution-cal-client-decl.txt526
-rw-r--r--doc/devel/calendar/cal-client/evolution-cal-client-docs.sgml15
-rw-r--r--doc/devel/calendar/cal-client/evolution-cal-client-sections.txt69
-rw-r--r--doc/devel/calendar/cal-client/evolution-cal-client.args0
-rw-r--r--doc/devel/calendar/cal-client/evolution-cal-client.hierarchy2
-rw-r--r--doc/devel/calendar/cal-client/evolution-cal-client.types4
-rw-r--r--doc/devel/calendar/cal-client/tmpl/cal-client.sgml354
-rw-r--r--doc/devel/calendar/cal-client/tmpl/evolution-cal-client-unused.sgml84
-rw-r--r--doc/devel/calendar/cal-util/.cvsignore13
-rw-r--r--doc/devel/calendar/cal-util/Makefile.am196
-rw-r--r--doc/devel/calendar/cal-util/evolution-cal-util-decl.txt1039
-rw-r--r--doc/devel/calendar/cal-util/evolution-cal-util-docs.sgml19
-rw-r--r--doc/devel/calendar/cal-util/evolution-cal-util-sections.txt161
-rw-r--r--doc/devel/calendar/cal-util/evolution-cal-util.args0
-rw-r--r--doc/devel/calendar/cal-util/evolution-cal-util.hierarchy2
-rw-r--r--doc/devel/calendar/cal-util/evolution-cal-util.signals0
-rw-r--r--doc/devel/calendar/cal-util/evolution-cal-util.types4
-rw-r--r--doc/devel/calendar/cal-util/tmpl/cal-component.sgml992
-rw-r--r--doc/devel/calendar/cal-util/tmpl/cal-recur.sgml45
-rw-r--r--doc/devel/calendar/cal-util/tmpl/cal-util.sgml48
-rw-r--r--doc/devel/calendar/cal-util/tmpl/evolution-cal-util-unused.sgml322
-rw-r--r--doc/devel/calendar/cal-util/tmpl/timeutil.sgml73
-rw-r--r--doc/devel/calendar/evolution-calendar.sgml52
-rw-r--r--doc/devel/calendar/public-reference.sgml24
-rw-r--r--doc/devel/evolution-devel-guide.sgml98
-rw-r--r--doc/devel/executive-summary/.cvsignore12
-rw-r--r--doc/devel/executive-summary/Makefile.am191
-rw-r--r--doc/devel/executive-summary/evolution-services-decl.txt536
-rw-r--r--doc/devel/executive-summary/evolution-services-sections.txt95
-rw-r--r--doc/devel/executive-summary/evolution-services.args0
-rw-r--r--doc/devel/executive-summary/evolution-services.hierarchy7
-rw-r--r--doc/devel/executive-summary/evolution-services.types10
-rw-r--r--doc/devel/executive-summary/private-reference.sgml20
-rw-r--r--doc/devel/executive-summary/public-reference.sgml22
-rw-r--r--doc/devel/executive-summary/tmpl/evolution-services-unused.sgml8
-rw-r--r--doc/devel/executive-summary/tmpl/executive-summary-component-factory-client.sgml53
-rw-r--r--doc/devel/executive-summary/tmpl/executive-summary-component-factory.sgml46
-rw-r--r--doc/devel/executive-summary/tmpl/executive-summary-component.sgml37
-rw-r--r--doc/devel/executive-summary/tmpl/executive-summary-html-view.sgml75
-rw-r--r--doc/devel/fdl.sgml671
-rw-r--r--doc/devel/importer/.cvsignore10
-rw-r--r--doc/devel/importer/Makefile.am195
-rw-r--r--doc/devel/importer/evolution-shell-importer-sections.txt79
-rw-r--r--doc/devel/importer/evolution-shell-importer.args0
-rw-r--r--doc/devel/importer/evolution-shell-importer.hierarchy7
-rw-r--r--doc/devel/importer/evolution-shell-importer.types9
-rw-r--r--doc/devel/importer/private-reference.sgml21
-rw-r--r--doc/devel/importer/public-reference.sgml20
-rw-r--r--doc/devel/importer/tmpl/evolution-importer-client.sgml84
-rw-r--r--doc/devel/importer/tmpl/evolution-importer.sgml96
-rw-r--r--doc/devel/importer/tmpl/evolution-shell-importer-unused.sgml10
-rw-r--r--doc/devel/preface.sgml113
-rw-r--r--doc/devel/reference.sgml49
-rw-r--r--doc/white-papers/calendar/calendar.sgml209
-rw-r--r--doc/white-papers/mail/camel.sgml356
-rw-r--r--doc/white-papers/mail/ibex.sgml158
-rw-r--r--doc/white-papers/widgets/e-table.sgml279
-rw-r--r--e-util/.cvsignore9
-rw-r--r--e-util/ChangeLog340
-rw-r--r--e-util/ChangeLog.pre-1-42649
-rw-r--r--e-util/Makefile.am117
-rw-r--r--e-util/e-account-list.c472
-rw-r--r--e-util/e-account-list.h75
-rw-r--r--e-util/e-account.c560
-rw-r--r--e-util/e-account.h106
-rw-r--r--e-util/e-bit-array.c429
-rw-r--r--e-util/e-bit-array.h104
-rw-r--r--e-util/e-categories-config.c202
-rw-r--r--e-util/e-categories-config.h34
-rw-r--r--e-util/e-categories-master-list-wombat.c183
-rw-r--r--e-util/e-categories-master-list-wombat.h31
-rw-r--r--e-util/e-component-listener.c171
-rw-r--r--e-util/e-component-listener.h47
-rw-r--r--e-util/e-config-listener.c607
-rw-r--r--e-util/e-config-listener.h80
-rw-r--r--e-util/e-corba-utils.c42
-rw-r--r--e-util/e-corba-utils.h30
-rw-r--r--e-util/e-dialog-utils.c284
-rw-r--r--e-util/e-dialog-utils.h45
-rw-r--r--e-util/e-dialog-widgets.c811
-rw-r--r--e-util/e-dialog-widgets.h60
-rw-r--r--e-util/e-gtk-utils.c216
-rw-r--r--e-util/e-gtk-utils.h49
-rw-r--r--e-util/e-gui-utils.c171
-rw-r--r--e-util/e-gui-utils.h14
-rw-r--r--e-util/e-host-utils.c380
-rw-r--r--e-util/e-host-utils.h38
-rw-r--r--e-util/e-html-utils.c521
-rw-r--r--e-util/e-html-utils.h39
-rw-r--r--e-util/e-i18n.h74
-rw-r--r--e-util/e-iconv.c614
-rw-r--r--e-util/e-iconv.h49
-rw-r--r--e-util/e-iterator.c183
-rw-r--r--e-util/e-iterator.h71
-rw-r--r--e-util/e-lang-utils.c68
-rw-r--r--e-util/e-lang-utils.h31
-rw-r--r--e-util/e-list-iterator.c249
-rw-r--r--e-util/e-list-iterator.h46
-rw-r--r--e-util/e-list.c191
-rw-r--r--e-util/e-list.h71
-rw-r--r--e-util/e-marshal.list51
-rw-r--r--e-util/e-memory.c1306
-rw-r--r--e-util/e-memory.h74
-rw-r--r--e-util/e-meta.c521
-rw-r--r--e-util/e-meta.h60
-rw-r--r--e-util/e-mktemp.c271
-rw-r--r--e-util/e-mktemp.h32
-rw-r--r--e-util/e-msgport.c1041
-rw-r--r--e-util/e-msgport.h88
-rw-r--r--e-util/e-passwords.c594
-rw-r--r--e-util/e-passwords.h59
-rw-r--r--e-util/e-path.c255
-rw-r--r--e-util/e-path.h36
-rw-r--r--e-util/e-pilot-map.c448
-rw-r--r--e-util/e-pilot-map.h58
-rw-r--r--e-util/e-pilot-settings.c150
-rw-r--r--e-util/e-pilot-settings.h73
-rw-r--r--e-util/e-pilot-util.c62
-rw-r--r--e-util/e-pilot-util.h29
-rw-r--r--e-util/e-request.c102
-rw-r--r--e-util/e-request.h33
-rw-r--r--e-util/e-sexp.c1379
-rw-r--r--e-util/e-sexp.h172
-rw-r--r--e-util/e-sorter-array.c259
-rw-r--r--e-util/e-sorter-array.h77
-rw-r--r--e-util/e-sorter.c153
-rw-r--r--e-util/e-sorter.h82
-rw-r--r--e-util/e-text-event-processor-emacs-like.c495
-rw-r--r--e-util/e-text-event-processor-emacs-like.h70
-rw-r--r--e-util/e-text-event-processor-types.h132
-rw-r--r--e-util/e-text-event-processor.c148
-rw-r--r--e-util/e-text-event-processor.h77
-rw-r--r--e-util/e-time-utils.c492
-rw-r--r--e-util/e-time-utils.h58
-rw-r--r--e-util/e-trie.c345
-rw-r--r--e-util/e-trie.h47
-rw-r--r--e-util/e-uid.c61
-rw-r--r--e-util/e-uid.h28
-rw-r--r--e-util/e-url.c341
-rw-r--r--e-util/e-url.h56
-rw-r--r--e-util/e-util-marshal.list2
-rw-r--r--e-util/e-util.c1230
-rw-r--r--e-util/e-util.h231
-rw-r--r--e-util/e-xml-hash-utils.c252
-rw-r--r--e-util/e-xml-hash-utils.h69
-rw-r--r--e-util/e-xml-utils.c502
-rw-r--r--e-util/e-xml-utils.h101
-rw-r--r--e-util/eggtrayicon.c341
-rw-r--r--e-util/eggtrayicon.h76
-rw-r--r--e-util/md5-utils.c363
-rw-r--r--e-util/md5-utils.h52
-rw-r--r--evolution-shell.pc.in23
-rw-r--r--filter/.cvsignore10
-rw-r--r--filter/ChangeLog118
-rw-r--r--filter/ChangeLog.pre-1-42967
-rw-r--r--filter/Makefile.am90
-rw-r--r--filter/filter-code.c127
-rw-r--r--filter/filter-code.h56
-rw-r--r--filter/filter-colour.c229
-rw-r--r--filter/filter-colour.h58
-rw-r--r--filter/filter-context.c279
-rw-r--r--filter/filter-context.h62
-rw-r--r--filter/filter-datespec.c480
-rw-r--r--filter/filter-datespec.h74
-rw-r--r--filter/filter-editor.c169
-rw-r--r--filter/filter-editor.h58
-rw-r--r--filter/filter-element.c385
-rw-r--r--filter/filter-element.h93
-rw-r--r--filter/filter-file.c323
-rw-r--r--filter/filter-file.h73
-rw-r--r--filter/filter-filter.c538
-rw-r--r--filter/filter-filter.h63
-rw-r--r--filter/filter-folder.c264
-rw-r--r--filter/filter-folder.h59
-rw-r--r--filter/filter-input.c353
-rw-r--r--filter/filter-input.h62
-rw-r--r--filter/filter-int.c254
-rw-r--r--filter/filter-int.h63
-rw-r--r--filter/filter-label.c182
-rw-r--r--filter/filter-label.h70
-rw-r--r--filter/filter-marshal.list2
-rw-r--r--filter/filter-option.c367
-rw-r--r--filter/filter-option.h69
-rw-r--r--filter/filter-part.c544
-rw-r--r--filter/filter-part.h85
-rw-r--r--filter/filter-rule.c897
-rw-r--r--filter/filter-rule.h123
-rw-r--r--filter/filter-source.c377
-rw-r--r--filter/filter-source.h56
-rw-r--r--filter/filter.glade1316
-rw-r--r--filter/filtertypes.xml725
-rw-r--r--filter/libfilter-i18n.h62
-rw-r--r--filter/rule-context.c889
-rw-r--r--filter/rule-context.h136
-rw-r--r--filter/rule-editor.c751
-rw-r--r--filter/rule-editor.h103
-rw-r--r--filter/score-context.c101
-rw-r--r--filter/score-context.h58
-rw-r--r--filter/score-editor.c133
-rw-r--r--filter/score-editor.h58
-rw-r--r--filter/score-rule.c201
-rw-r--r--filter/score-rule.h60
-rw-r--r--filter/searchtypes.xml529
-rw-r--r--filter/vfolder-context.c100
-rw-r--r--filter/vfolder-context.h59
-rw-r--r--filter/vfolder-editor.c133
-rw-r--r--filter/vfolder-editor.h58
-rw-r--r--filter/vfolder-rule.c643
-rw-r--r--filter/vfolder-rule.h62
-rw-r--r--filter/vfoldertypes.xml421
-rw-r--r--help/.cvsignore2
-rw-r--r--help/C/.cvsignore4
-rw-r--r--help/C/Makefile.am57
-rw-r--r--help/C/POTFILES.in16
-rw-r--r--help/C/apx-authors.xml80
-rw-r--r--help/C/apx-bugs.xml30
-rw-r--r--help/C/apx-fdl.xml667
-rw-r--r--help/C/apx-gloss.xml480
-rw-r--r--help/C/apx-gpl.xml419
-rw-r--r--help/C/config-prefs.xml1096
-rw-r--r--help/C/config-sync.xml138
-rw-r--r--help/C/evolution-1.5-C.omf25
-rw-r--r--help/C/evolution-1.5.xml125
-rw-r--r--help/C/figures/calendar.pngbin102053 -> 0 bytes-rw-r--r--help/C/figures/config-cal.pngbin61474 -> 0 bytes-rw-r--r--help/C/figures/config-mail.pngbin61733 -> 0 bytes-rw-r--r--help/C/figures/contact-editor.pngbin52598 -> 0 bytes-rw-r--r--help/C/figures/contact.pngbin98575 -> 0 bytes-rw-r--r--help/C/figures/exchange-delegation.pngbin62447 -> 0 bytes-rw-r--r--help/C/figures/exchange-identity.pngbin29201 -> 0 bytes-rw-r--r--help/C/figures/exchange-receive-options.pngbin31765 -> 0 bytes-rw-r--r--help/C/figures/exchange-receive.pngbin31500 -> 0 bytes-rw-r--r--help/C/figures/filter-new-fig.pngbin27412 -> 0 bytes-rw-r--r--help/C/figures/folder-bar.pngbin93009 -> 0 bytes-rw-r--r--help/C/figures/full-1.pngbin1218 -> 0 bytes-rw-r--r--help/C/figures/full-2.pngbin1260 -> 0 bytes-rw-r--r--help/C/figures/full-3.pngbin1290 -> 0 bytes-rw-r--r--help/C/figures/full-4.pngbin1251 -> 0 bytes-rw-r--r--help/C/figures/full-5.pngbin1293 -> 0 bytes-rw-r--r--help/C/figures/full-6.pngbin1284 -> 0 bytes-rw-r--r--help/C/figures/full-7.pngbin818 -> 0 bytes-rw-r--r--help/C/figures/mail-druid-pic.pngbin32267 -> 0 bytes-rw-r--r--help/C/figures/mail-inbox.pngbin95031 -> 0 bytes-rw-r--r--help/C/figures/mail-threaded.pngbin7093 -> 0 bytes-rw-r--r--help/C/figures/mainwindow-pic.pngbin101231 -> 0 bytes-rw-r--r--help/C/figures/newmsg.pngbin59054 -> 0 bytes-rw-r--r--help/C/figures/print-dest.pngbin26005 -> 0 bytes-rw-r--r--help/C/figures/print-preview.pngbin77198 -> 0 bytes-rw-r--r--help/C/figures/replymsg.pngbin63824 -> 0 bytes-rw-r--r--help/C/figures/schedule.pngbin44752 -> 0 bytes-rw-r--r--help/C/figures/summary.pngbin110480 -> 0 bytes-rw-r--r--help/C/figures/vfolder-createrule-fig.pngbin35099 -> 0 bytes-rw-r--r--help/C/legal.xml99
-rw-r--r--help/C/menuref.xml397
-rw-r--r--help/C/preface.xml218
-rw-r--r--help/C/topic.dat11
-rw-r--r--help/C/usage-calendar.xml761
-rw-r--r--help/C/usage-contact.xml581
-rw-r--r--help/C/usage-exchange.xml1002
-rw-r--r--help/C/usage-exec-summary.xml217
-rw-r--r--help/C/usage-mail-org.xml1302
-rw-r--r--help/C/usage-mail.xml1883
-rw-r--r--help/C/usage-mainwindow.xml1576
-rw-r--r--help/C/usage-print.xml115
-rw-r--r--help/C/usage-sync.sgml39
-rw-r--r--help/C/usage-sync.xml39
-rw-r--r--help/COPYING-DOCS355
-rw-r--r--help/ChangeLog4
-rw-r--r--help/ChangeLog.pre-1-42072
-rw-r--r--help/Makefile.am6
-rw-r--r--help/README_Translations46
-rw-r--r--help/devel/executive-summary/evolution-services.hierarchy7
-rw-r--r--help/devel/importer/evolution-shell-importer.hierarchy7
-rw-r--r--help/es.po/apx-authors.sgml.po178
-rw-r--r--help/es.po/apx-bugs.sgml.po56
-rw-r--r--help/es.po/apx-gloss.sgml.po745
-rw-r--r--help/es.po/config-prefs.sgml.po1364
-rw-r--r--help/es.po/config-setupassist.sgml.po446
-rw-r--r--help/es.po/config-sync.sgml.po264
-rw-r--r--help/es.po/evolution.sgml.po165
-rw-r--r--help/es.po/menuref.sgml.po3062
-rw-r--r--help/es.po/preface.sgml.po932
-rw-r--r--help/es.po/usage-calendar.sgml.po816
-rw-r--r--help/es.po/usage-contact.sgml.po1225
-rw-r--r--help/es.po/usage-mail.sgml.po2322
-rw-r--r--help/es.po/usage-mainwindow.sgml.po788
-rw-r--r--help/es.po/usage-notes.sgml.po111
-rw-r--r--help/es.po/usage-print.sgml.po196
-rw-r--r--help/es.po/usage-sync.sgml.po60
-rw-r--r--help/es/Makefile.in321
-rw-r--r--help/es/apx-authors.sgml46
-rw-r--r--help/es/apx-bugs.sgml23
-rw-r--r--help/es/apx-fdl.sgml670
-rw-r--r--help/es/apx-gloss.sgml183
-rw-r--r--help/es/apx-gpl.sgml420
-rw-r--r--help/es/config-prefs.sgml595
-rw-r--r--help/es/config-sync.sgml76
-rw-r--r--help/es/evolution-es.omf16
-rw-r--r--help/es/evolution.sgml82
-rw-r--r--help/es/menuref.sgml247
-rw-r--r--help/es/preface.sgml227
-rw-r--r--help/es/topic.dat11
-rw-r--r--help/es/usage-calendar.sgml432
-rw-r--r--help/es/usage-contact.sgml348
-rw-r--r--help/es/usage-exchange.sgml425
-rw-r--r--help/es/usage-exec-summary.sgml240
-rw-r--r--help/es/usage-mail-org.sgml674
-rw-r--r--help/es/usage-mail.sgml1173
-rw-r--r--help/es/usage-mainwindow.sgml885
-rw-r--r--help/es/usage-print.sgml62
-rw-r--r--help/es/usage-sync.sgml28
-rw-r--r--help/no/.cvsignore9
-rw-r--r--help/no/ChangeLog0
-rw-r--r--help/no/ChangeLog.pre-1-413
-rw-r--r--help/no/Makefile.am51
-rw-r--r--help/no/apx-authors.sgml98
-rw-r--r--help/no/apx-bugs.sgml38
-rw-r--r--help/no/apx-gloss.sgml419
-rw-r--r--help/no/config-encryption.sgml147
-rw-r--r--help/no/config-prefs.sgml744
-rw-r--r--help/no/config-sync.sgml126
-rw-r--r--help/no/evolution-faq.sgml973
-rw-r--r--help/no/evolution-no.omf16
-rw-r--r--help/no/evolution.sgml128
-rw-r--r--help/no/figures/calendar.pngbin42615 -> 0 bytes-rw-r--r--help/no/figures/config-cal.pngbin7338 -> 0 bytes-rw-r--r--help/no/figures/config-mail.pngbin9210 -> 0 bytes-rw-r--r--help/no/figures/contact-editor.pngbin37707 -> 0 bytes-rw-r--r--help/no/figures/contact.pngbin39742 -> 0 bytes-rw-r--r--help/no/figures/filter-assist-fig.pngbin5575 -> 0 bytes-rw-r--r--help/no/figures/filter-new-fig.pngbin8802 -> 0 bytes-rw-r--r--help/no/figures/full-1.pngbin1218 -> 0 bytes-rw-r--r--help/no/figures/full-2.pngbin1260 -> 0 bytes-rw-r--r--help/no/figures/full-3.pngbin1290 -> 0 bytes-rw-r--r--help/no/figures/full-4.pngbin1251 -> 0 bytes-rw-r--r--help/no/figures/full-5.pngbin1293 -> 0 bytes-rw-r--r--help/no/figures/full-6.pngbin1284 -> 0 bytes-rw-r--r--help/no/figures/full-7.pngbin818 -> 0 bytes-rw-r--r--help/no/figures/mail-composer.pngbin14971 -> 0 bytes-rw-r--r--help/no/figures/mail-druid-pic.pngbin8457 -> 0 bytes-rw-r--r--help/no/figures/mail-inbox.pngbin127593 -> 0 bytes-rw-r--r--help/no/figures/mainwindow-pic.pngbin130739 -> 0 bytes-rw-r--r--help/no/figures/newmsg.pngbin14798 -> 0 bytes-rw-r--r--help/no/figures/print-dest.pngbin7358 -> 0 bytes-rw-r--r--help/no/figures/print-preview.pngbin51801 -> 0 bytes-rw-r--r--help/no/figures/replymsg.pngbin19338 -> 0 bytes-rw-r--r--help/no/figures/vfolder-createrule-fig.pngbin8321 -> 0 bytes-rw-r--r--help/no/menuref.sgml421
-rw-r--r--help/no/preface.sgml83
-rw-r--r--help/no/topic.dat10
-rw-r--r--help/no/usage-calendar.sgml561
-rw-r--r--help/no/usage-contact.sgml609
-rw-r--r--help/no/usage-encryption.sgml147
-rw-r--r--help/no/usage-exec-summary.sgml315
-rw-r--r--help/no/usage-mail-org.sgml1021
-rw-r--r--help/no/usage-mail.sgml2005
-rw-r--r--help/no/usage-mainwindow.sgml1174
-rw-r--r--help/no/usage-notes.sgml49
-rw-r--r--help/no/usage-print.sgml115
-rw-r--r--help/no/usage-sync.sgml39
-rw-r--r--help/omf.make53
-rwxr-xr-xhelp/update_po.pl212
-rwxr-xr-xhelp/update_translation.pl240
-rw-r--r--help/xmldocs.make96
-rw-r--r--mail/.cvsignore29
-rw-r--r--mail/ChangeLog3091
-rw-r--r--mail/ChangeLog.pre-1-424750
-rw-r--r--mail/GNOME_Evolution_Mail.server.in.in193
-rw-r--r--mail/Makefile.am254
-rw-r--r--mail/README.async366
-rw-r--r--mail/Spell.idl71
-rw-r--r--mail/e-searching-tokenizer.c1251
-rw-r--r--mail/e-searching-tokenizer.h74
-rw-r--r--mail/em-account-prefs.c580
-rw-r--r--mail/em-account-prefs.h99
-rw-r--r--mail/em-camel-stream.c326
-rw-r--r--mail/em-camel-stream.h71
-rw-r--r--mail/em-composer-prefs.c1010
-rw-r--r--mail/em-composer-prefs.h130
-rw-r--r--mail/em-composer-utils.c600
-rw-r--r--mail/em-composer-utils.h43
-rw-r--r--mail/em-folder-browser.c1018
-rw-r--r--mail/em-folder-browser.h60
-rw-r--r--mail/em-folder-selection-button.c255
-rw-r--r--mail/em-folder-selection-button.h69
-rw-r--r--mail/em-folder-selection.c218
-rw-r--r--mail/em-folder-selection.h51
-rw-r--r--mail/em-folder-selector.c362
-rw-r--r--mail/em-folder-selector.h88
-rw-r--r--mail/em-folder-tree-model.c1198
-rw-r--r--mail/em-folder-tree-model.h121
-rw-r--r--mail/em-folder-tree.c1710
-rw-r--r--mail/em-folder-tree.h80
-rw-r--r--mail/em-folder-view.c2020
-rw-r--r--mail/em-folder-view.h117
-rw-r--r--mail/em-format-html-display.c1352
-rw-r--r--mail/em-format-html-display.h63
-rw-r--r--mail/em-format-html-print.c186
-rw-r--r--mail/em-format-html-print.h37
-rw-r--r--mail/em-format-html-quote.c277
-rw-r--r--mail/em-format-html-quote.h49
-rw-r--r--mail/em-format-html.c1627
-rw-r--r--mail/em-format-html.h158
-rw-r--r--mail/em-format-quote.c289
-rw-r--r--mail/em-format-quote.h56
-rw-r--r--mail/em-format.c1255
-rw-r--r--mail/em-format.h204
-rw-r--r--mail/em-html-stream.c169
-rw-r--r--mail/em-html-stream.h64
-rw-r--r--mail/em-icon-stream.c208
-rw-r--r--mail/em-icon-stream.h62
-rw-r--r--mail/em-inline-filter.c335
-rw-r--r--mail/em-inline-filter.h62
-rw-r--r--mail/em-junk-filter.c352
-rw-r--r--mail/em-junk-filter.h30
-rw-r--r--mail/em-junk-plugin.c24
-rw-r--r--mail/em-junk-plugin.h46
-rw-r--r--mail/em-mailer-prefs.c484
-rw-r--r--mail/em-mailer-prefs.h127
-rw-r--r--mail/em-marshal.list5
-rw-r--r--mail/em-message-browser.c214
-rw-r--r--mail/em-message-browser.h30
-rw-r--r--mail/em-migrate.c706
-rw-r--r--mail/em-migrate.h42
-rw-r--r--mail/em-popup.c839
-rw-r--r--mail/em-popup.h171
-rw-r--r--mail/em-subscribe-editor.c853
-rw-r--r--mail/em-subscribe-editor.h9
-rw-r--r--mail/em-sync-stream.c286
-rw-r--r--mail/em-sync-stream.h69
-rw-r--r--mail/em-utils.c2324
-rw-r--r--mail/em-utils.h127
-rw-r--r--mail/evolution-mail.schemas.in.in654
-rw-r--r--mail/evolution-mbox-upgrade.c420
-rw-r--r--mail/importers/.cvsignore15
-rw-r--r--mail/importers/GNOME_Evolution_Mail_Elm_Intelligent_Importer.server.in.in26
-rw-r--r--mail/importers/GNOME_Evolution_Mail_Mbox_Importer.server.in.in29
-rw-r--r--mail/importers/GNOME_Evolution_Mail_Netscape_Intelligent_Importer.server.in.in26
-rw-r--r--mail/importers/GNOME_Evolution_Mail_Outlook_Importer.server.in.in29
-rw-r--r--mail/importers/GNOME_Evolution_Mail_Pine_Intelligent_Importer.server.in.in26
-rw-r--r--mail/importers/Makefile.am102
-rw-r--r--mail/importers/elm-importer.c593
-rw-r--r--mail/importers/evolution-mbox-importer.c335
-rw-r--r--mail/importers/evolution-outlook-importer.c318
-rw-r--r--mail/importers/mozilla-status-headers.h29
-rw-r--r--mail/importers/netscape-importer.c2162
-rw-r--r--mail/importers/pine-importer.c643
-rw-r--r--mail/local-config.glade325
-rw-r--r--mail/mail-account-editor.c225
-rw-r--r--mail/mail-account-editor.h67
-rw-r--r--mail/mail-account-gui.c2105
-rw-r--r--mail/mail-account-gui.h143
-rw-r--r--mail/mail-autofilter.c444
-rw-r--r--mail/mail-autofilter.h51
-rw-r--r--mail/mail-component-factory.c106
-rw-r--r--mail/mail-component.c900
-rw-r--r--mail/mail-component.h99
-rw-r--r--mail/mail-config-druid.c768
-rw-r--r--mail/mail-config-druid.h68
-rw-r--r--mail/mail-config-factory.c105
-rw-r--r--mail/mail-config-factory.h45
-rw-r--r--mail/mail-config.c1524
-rw-r--r--mail/mail-config.glade6020
-rw-r--r--mail/mail-config.h186
-rw-r--r--mail/mail-crypto.c52
-rw-r--r--mail/mail-crypto.h42
-rw-r--r--mail/mail-folder-cache.c956
-rw-r--r--mail/mail-folder-cache.h51
-rw-r--r--mail/mail-font-prefs.c130
-rw-r--r--mail/mail-font-prefs.h66
-rw-r--r--mail/mail-importer.c288
-rw-r--r--mail/mail-importer.h53
-rw-r--r--mail/mail-mt.c982
-rw-r--r--mail/mail-mt.h126
-rw-r--r--mail/mail-offline-handler.c258
-rw-r--r--mail/mail-offline-handler.h65
-rw-r--r--mail/mail-ops.c2449
-rw-r--r--mail/mail-ops.h167
-rw-r--r--mail/mail-search.glade197
-rw-r--r--mail/mail-security.glade214
-rw-r--r--mail/mail-send-recv.c943
-rw-r--r--mail/mail-send-recv.h45
-rw-r--r--mail/mail-session.c855
-rw-r--r--mail/mail-session.h58
-rw-r--r--mail/mail-signature-editor.c447
-rw-r--r--mail/mail-signature-editor.h42
-rw-r--r--mail/mail-tools.c424
-rw-r--r--mail/mail-tools.h75
-rw-r--r--mail/mail-types.h40
-rw-r--r--mail/mail-vfolder.c1022
-rw-r--r--mail/mail-vfolder.h33
-rw-r--r--mail/mail.h33
-rw-r--r--mail/message-list.c3378
-rw-r--r--mail/message-list.etspec35
-rw-r--r--mail/message-list.h216
-rw-r--r--mail/message-tag-editor.c128
-rw-r--r--mail/message-tag-editor.h73
-rw-r--r--mail/message-tag-followup.c354
-rw-r--r--mail/message-tag-followup.h83
-rw-r--r--mail/message-tags.glade335
-rw-r--r--mail/subscribe-dialog.glade334
-rw-r--r--marshal.mk7
-rw-r--r--po/.cvsignore19
-rw-r--r--po/ChangeLog386
-rw-r--r--po/ChangeLog.pre-1-44726
-rw-r--r--po/POTFILES.in393
-rw-r--r--po/POTFILES.skip15
-rw-r--r--po/am.po17383
-rw-r--r--po/az.po26876
-rw-r--r--po/be.po24245
-rw-r--r--po/bg.po25933
-rw-r--r--po/ca.po26854
-rw-r--r--po/cs.po27206
-rw-r--r--po/da.po27781
-rw-r--r--po/de.po27451
-rw-r--r--po/el.po24193
-rw-r--r--po/en_AU.po17451
-rw-r--r--po/en_GB.po17849
-rw-r--r--po/es.po27787
-rw-r--r--po/et.po28634
-rw-r--r--po/eu.po29757
-rw-r--r--po/fi.po22075
-rw-r--r--po/fr.po28900
-rwxr-xr-xpo/ga.po21306
-rw-r--r--po/gl.po27342
-rw-r--r--po/hu.po30959
-rw-r--r--po/it.po17820
-rw-r--r--po/ja.po25319
-rw-r--r--po/ko.po22528
-rw-r--r--po/lt.po25534
-rw-r--r--po/lv.po29026
-rwxr-xr-xpo/mk.po28228
-rw-r--r--po/ml.po27397
-rw-r--r--po/ms.po27375
-rw-r--r--po/nl.po27295
-rw-r--r--po/nn.po28240
-rw-r--r--po/no.po27026
-rw-r--r--po/pl.po17825
-rw-r--r--po/pt.po27687
-rw-r--r--po/pt_BR.po27270
-rw-r--r--po/ro.po26178
-rw-r--r--po/ru.po27378
-rw-r--r--po/sk.po27195
-rw-r--r--po/sl.po24850
-rw-r--r--po/sr.po27223
-rw-r--r--po/sr@Latn.po27229
-rw-r--r--po/sv.po31583
-rw-r--r--po/tr.po28174
-rw-r--r--po/uk.po22334
-rw-r--r--po/vi.po28616
-rw-r--r--po/zh_CN.po27088
-rw-r--r--po/zh_TW.po32560
-rw-r--r--server.mk11
-rw-r--r--shell/.cvsignore27
-rw-r--r--shell/ChangeLog1031
-rw-r--r--shell/ChangeLog.pre-1-415363
-rw-r--r--shell/Evolution-Component.idl82
-rw-r--r--shell/Evolution-ConfigControl.idl34
-rw-r--r--shell/Evolution-Offline.idl61
-rw-r--r--shell/Evolution-Shell.idl53
-rw-r--r--shell/Evolution-Wizard.idl42
-rw-r--r--shell/Evolution-common.idl36
-rw-r--r--shell/Evolution.idl19
-rw-r--r--shell/GNOME_Evolution_Shell.server.in.in51
-rw-r--r--shell/GNOME_Evolution_TestComponent.server41
-rw-r--r--shell/Makefile.am279
-rw-r--r--shell/README14
-rw-r--r--shell/apps_evolution_shell.schemas.in.in253
-rw-r--r--shell/check-empty.xpm21
-rw-r--r--shell/check-filled.xpm21
-rw-r--r--shell/check-missing.xpm20
-rw-r--r--shell/e-activity-handler.c396
-rw-r--r--shell/e-activity-handler.h85
-rw-r--r--shell/e-component-registry.c324
-rw-r--r--shell/e-component-registry.h99
-rw-r--r--shell/e-config-upgrade.c1929
-rw-r--r--shell/e-config-upgrade.h28
-rw-r--r--shell/e-corba-config-page.c264
-rw-r--r--shell/e-corba-config-page.h68
-rw-r--r--shell/e-history.c261
-rw-r--r--shell/e-history.h83
-rw-r--r--shell/e-icon-factory.c162
-rw-r--r--shell/e-icon-factory.h33
-rw-r--r--shell/e-setup.c331
-rw-r--r--shell/e-setup.h32
-rw-r--r--shell/e-shell-about-box.c534
-rw-r--r--shell/e-shell-about-box.h62
-rw-r--r--shell/e-shell-config-autocompletion.c129
-rw-r--r--shell/e-shell-config-autocompletion.h34
-rw-r--r--shell/e-shell-config-default-folders.c203
-rw-r--r--shell/e-shell-config-default-folders.h34
-rw-r--r--shell/e-shell-config-folder-settings.c82
-rw-r--r--shell/e-shell-config-folder-settings.h32
-rw-r--r--shell/e-shell-config-offline.c168
-rw-r--r--shell/e-shell-config-offline.h33
-rw-r--r--shell/e-shell-config.c69
-rw-r--r--shell/e-shell-config.h30
-rw-r--r--shell/e-shell-constants.h50
-rw-r--r--shell/e-shell-corba-icon-utils.c208
-rw-r--r--shell/e-shell-corba-icon-utils.h40
-rw-r--r--shell/e-shell-folder-commands.c653
-rw-r--r--shell/e-shell-folder-commands.h42
-rw-r--r--shell/e-shell-folder-creation-dialog.c580
-rw-r--r--shell/e-shell-folder-creation-dialog.h49
-rw-r--r--shell/e-shell-folder-title-bar.c749
-rw-r--r--shell/e-shell-folder-title-bar.h84
-rw-r--r--shell/e-shell-importer.c1247
-rw-r--r--shell/e-shell-importer.h28
-rw-r--r--shell/e-shell-marshal.list30
-rw-r--r--shell/e-shell-offline-handler.c871
-rw-r--r--shell/e-shell-offline-handler.h82
-rw-r--r--shell/e-shell-settings-dialog.c392
-rw-r--r--shell/e-shell-settings-dialog.h65
-rw-r--r--shell/e-shell-shared-folder-picker-dialog.c557
-rw-r--r--shell/e-shell-shared-folder-picker-dialog.h33
-rw-r--r--shell/e-shell-startup-wizard.c872
-rw-r--r--shell/e-shell-startup-wizard.h30
-rw-r--r--shell/e-shell-utils.c149
-rw-r--r--shell/e-shell-utils.h34
-rw-r--r--shell/e-shell-view-menu.c868
-rw-r--r--shell/e-shell-view-menu.h32
-rw-r--r--shell/e-shell-window-commands.c390
-rw-r--r--shell/e-shell-window-commands.h30
-rw-r--r--shell/e-shell-window.c825
-rw-r--r--shell/e-shell-window.h71
-rw-r--r--shell/e-shell.c1073
-rw-r--r--shell/e-shell.h145
-rw-r--r--shell/e-shortcuts-view-model.c341
-rw-r--r--shell/e-shortcuts-view-model.h66
-rw-r--r--shell/e-shortcuts-view.c800
-rw-r--r--shell/e-shortcuts-view.h74
-rw-r--r--shell/e-shortcuts.c1289
-rw-r--r--shell/e-shortcuts.h167
-rw-r--r--shell/e-sidebar.c453
-rw-r--r--shell/e-sidebar.h66
-rw-r--r--shell/e-splash.c451
-rw-r--r--shell/e-splash.h71
-rw-r--r--shell/e-storage-set-store.c1361
-rw-r--r--shell/e-storage-set-store.h91
-rw-r--r--shell/e-storage-set-view-checkboxes.etstate5
-rw-r--r--shell/e-storage-set-view-no-checkboxes.etstate4
-rw-r--r--shell/e-storage-set-view.etspec8
-rw-r--r--shell/e-task-bar.c187
-rw-r--r--shell/e-task-bar.h71
-rw-r--r--shell/e-task-widget.c251
-rw-r--r--shell/e-task-widget.h78
-rw-r--r--shell/e-uri-schema-registry.c181
-rw-r--r--shell/e-uri-schema-registry.h70
-rw-r--r--shell/e-user-creatable-items-handler.c789
-rw-r--r--shell/e-user-creatable-items-handler.h73
-rw-r--r--shell/evolution-activity-client.c461
-rw-r--r--shell/evolution-config-control.c241
-rw-r--r--shell/evolution-config-control.h70
-rw-r--r--shell/evolution-folder-selector-button.c455
-rw-r--r--shell/evolution-nognome.in13
-rw-r--r--shell/evolution-shell-client.c139
-rw-r--r--shell/evolution-shell-component-utils.c169
-rw-r--r--shell/evolution-shell-component-utils.h54
-rw-r--r--shell/evolution-storage-set-view-factory.c74
-rw-r--r--shell/evolution-storage-set-view-factory.h30
-rw-r--r--shell/evolution-storage-set-view.c481
-rw-r--r--shell/evolution-storage-set-view.h70
-rw-r--r--shell/evolution-storage.c1349
-rw-r--r--shell/evolution-test-component.c715
-rw-r--r--shell/evolution-wizard.c409
-rw-r--r--shell/evolution-wizard.h83
-rw-r--r--shell/glade/.cvsignore4
-rw-r--r--shell/glade/Makefile.am9
-rw-r--r--shell/glade/e-active-connection-dialog.glade144
-rw-r--r--shell/glade/e-folder-list.glade110
-rw-r--r--shell/glade/e-shell-config-default-folders.glade194
-rw-r--r--shell/glade/e-shell-folder-creation-dialog.glade180
-rw-r--r--shell/glade/e-shell-shared-folder-picker-dialog.glade252
-rw-r--r--shell/glade/evolution-startup-wizard.glade92
-rw-r--r--shell/importer/.cvsignore10
-rw-r--r--shell/importer/GNOME_Evolution_Importer.idl97
-rw-r--r--shell/importer/Makefile.am66
-rw-r--r--shell/importer/evolution-importer-client.c251
-rw-r--r--shell/importer/evolution-importer-client.h74
-rw-r--r--shell/importer/evolution-importer-listener.c224
-rw-r--r--shell/importer/evolution-importer-listener.h71
-rw-r--r--shell/importer/evolution-importer.c229
-rw-r--r--shell/importer/evolution-importer.h96
-rw-r--r--shell/importer/evolution-intelligent-importer.c197
-rw-r--r--shell/importer/evolution-intelligent-importer.h74
-rw-r--r--shell/importer/import.glade119
-rw-r--r--shell/importer/intelligent.c485
-rw-r--r--shell/importer/intelligent.h28
-rw-r--r--shell/main.c625
-rw-r--r--smime/.cvsignore2
-rw-r--r--smime/ChangeLog263
-rw-r--r--smime/Makefile.am1
-rw-r--r--smime/gui/.cvsignore3
-rw-r--r--smime/gui/Makefile.am35
-rw-r--r--smime/gui/certificate-manager.c745
-rw-r--r--smime/gui/certificate-manager.h30
-rw-r--r--smime/gui/certificate-viewer.c298
-rw-r--r--smime/gui/certificate-viewer.h31
-rw-r--r--smime/gui/e-cert-selector.c247
-rw-r--r--smime/gui/e-cert-selector.h67
-rw-r--r--smime/gui/smime-ui.glade2100
-rw-r--r--smime/lib/.cvsignore3
-rw-r--r--smime/lib/Makefile.am28
-rw-r--r--smime/lib/e-asn1-object.c393
-rw-r--r--smime/lib/e-asn1-object.h105
-rw-r--r--smime/lib/e-cert-db.c1077
-rw-r--r--smime/lib/e-cert-db.h128
-rw-r--r--smime/lib/e-cert-trust.c418
-rw-r--r--smime/lib/e-cert-trust.h86
-rw-r--r--smime/lib/e-cert.c1227
-rw-r--r--smime/lib/e-cert.h103
-rw-r--r--smime/lib/e-pkcs12.c452
-rw-r--r--smime/lib/e-pkcs12.h71
-rw-r--r--smime/tests/.cvsignore3
-rw-r--r--smime/tests/Makefile.am17
-rw-r--r--smime/tests/import-cert.c38
-rw-r--r--sounds/.cvsignore2
-rw-r--r--sounds/Makefile.am5
-rw-r--r--sounds/default_alarm.wavbin8624 -> 0 bytes-rw-r--r--stamp.h.in1
-rw-r--r--tools/.cvsignore11
-rw-r--r--tools/Makefile.am37
-rw-r--r--tools/evolution-launch-composer.c357
-rw-r--r--tools/killev.c218
-rwxr-xr-xtools/verify-evolution-install.sh640
-rw-r--r--ui/.cvsignore8
-rw-r--r--ui/ChangeLog137
-rw-r--r--ui/ChangeLog.pre-1-41894
-rw-r--r--ui/Makefile.am26
-rw-r--r--ui/evolution-addressbook.h25
-rw-r--r--ui/evolution-addressbook.xml149
-rw-r--r--ui/evolution-calendar.xml107
-rw-r--r--ui/evolution-comp-editor.xml91
-rw-r--r--ui/evolution-composer-entries.xml33
-rw-r--r--ui/evolution-contact-editor.xml99
-rw-r--r--ui/evolution-contact-list-editor.xml65
-rw-r--r--ui/evolution-event-editor.xml53
-rw-r--r--ui/evolution-executive-summary.xml12
-rw-r--r--ui/evolution-mail-global.xml120
-rw-r--r--ui/evolution-mail-list.xml116
-rw-r--r--ui/evolution-mail-message.xml437
-rw-r--r--ui/evolution-mail-messagedisplay.xml56
-rw-r--r--ui/evolution-message-composer.h53
-rw-r--r--ui/evolution-message-composer.xml153
-rw-r--r--ui/evolution-signature-editor.xml73
-rw-r--r--ui/evolution-subscribe.xml57
-rw-r--r--ui/evolution-task-editor.xml41
-rw-r--r--ui/evolution-tasks.xml65
-rw-r--r--ui/evolution.xml134
-rw-r--r--ui/my-evolution.xml29
-rw-r--r--views/.cvsignore2
-rw-r--r--views/ChangeLog19
-rw-r--r--views/ChangeLog.pre-1-4109
-rw-r--r--views/Makefile.am3
-rw-r--r--views/addressbook/.cvsignore2
-rw-r--r--views/addressbook/Address_Cards.galview2
-rw-r--r--views/addressbook/By_Company.galview12
-rw-r--r--views/addressbook/Makefile.am3
-rw-r--r--views/addressbook/Phone_List.galview11
-rw-r--r--views/addressbook/galview.xml6
-rw-r--r--views/calendar/.cvsignore2
-rw-r--r--views/calendar/Makefile.am5
-rw-r--r--views/calendar/galview.xml11
-rw-r--r--views/mail/.cvsignore2
-rw-r--r--views/mail/As_Sent_Folder.galview10
-rw-r--r--views/mail/By_Follow_Up_Flag.galview14
-rw-r--r--views/mail/By_Sender.galview12
-rw-r--r--views/mail/By_Status.galview12
-rw-r--r--views/mail/By_Subject.galview12
-rw-r--r--views/mail/Makefile.am3
-rw-r--r--views/mail/Messages.galview10
-rw-r--r--views/mail/galview.xml9
-rw-r--r--views/tasks/.cvsignore2
-rw-r--r--views/tasks/Makefile.am3
-rw-r--r--views/tasks/Tasks.galview7
-rw-r--r--views/tasks/With_Category.galview8
-rw-r--r--views/tasks/galview.xml5
-rw-r--r--widgets/.cvsignore9
-rw-r--r--widgets/ChangeLog58
-rw-r--r--widgets/ChangeLog.pre-1-4506
-rw-r--r--widgets/LICENSE1
-rw-r--r--widgets/Makefile.am8
-rw-r--r--widgets/e-timezone-dialog/.cvsignore7
-rw-r--r--widgets/e-timezone-dialog/Makefile.am16
-rw-r--r--widgets/e-timezone-dialog/e-timezone-dialog.c684
-rw-r--r--widgets/e-timezone-dialog/e-timezone-dialog.glade302
-rw-r--r--widgets/e-timezone-dialog/e-timezone-dialog.h68
-rw-r--r--widgets/menus/.cvsignore8
-rw-r--r--widgets/menus/Makefile.am11
-rw-r--r--widgets/menus/gal-define-views-dialog.c351
-rw-r--r--widgets/menus/gal-define-views-dialog.h78
-rw-r--r--widgets/menus/gal-define-views-model.c322
-rw-r--r--widgets/menus/gal-define-views-model.h72
-rw-r--r--widgets/menus/gal-define-views.glade232
-rw-r--r--widgets/menus/gal-view-collection.c823
-rw-r--r--widgets/menus/gal-view-collection.h151
-rw-r--r--widgets/menus/gal-view-etable.c305
-rw-r--r--widgets/menus/gal-view-etable.h78
-rw-r--r--widgets/menus/gal-view-factory-etable.c120
-rw-r--r--widgets/menus/gal-view-factory-etable.h62
-rw-r--r--widgets/menus/gal-view-factory.c107
-rw-r--r--widgets/menus/gal-view-factory.h79
-rw-r--r--widgets/menus/gal-view-instance-save-as-dialog.c299
-rw-r--r--widgets/menus/gal-view-instance-save-as-dialog.glade243
-rw-r--r--widgets/menus/gal-view-instance-save-as-dialog.h89
-rw-r--r--widgets/menus/gal-view-instance.c600
-rw-r--r--widgets/menus/gal-view-instance.h116
-rw-r--r--widgets/menus/gal-view-menus.c525
-rw-r--r--widgets/menus/gal-view-menus.h44
-rw-r--r--widgets/menus/gal-view-new-dialog.c284
-rw-r--r--widgets/menus/gal-view-new-dialog.glade175
-rw-r--r--widgets/menus/gal-view-new-dialog.h86
-rw-r--r--widgets/menus/gal-view.c206
-rw-r--r--widgets/menus/gal-view.h98
-rw-r--r--widgets/misc/.cvsignore16
-rw-r--r--widgets/misc/ChangeLog224
-rw-r--r--widgets/misc/ChangeLog.pre-1-41903
-rw-r--r--widgets/misc/Makefile.am161
-rw-r--r--widgets/misc/e-calendar-item.c3235
-rw-r--r--widgets/misc/e-calendar-item.h379
-rw-r--r--widgets/misc/e-calendar.c661
-rw-r--r--widgets/misc/e-calendar.h102
-rw-r--r--widgets/misc/e-canvas-background.c496
-rw-r--r--widgets/misc/e-canvas-background.h71
-rw-r--r--widgets/misc/e-canvas-utils.c171
-rw-r--r--widgets/misc/e-canvas-utils.h55
-rw-r--r--widgets/misc/e-canvas-vbox.c381
-rw-r--r--widgets/misc/e-canvas-vbox.h93
-rw-r--r--widgets/misc/e-canvas.c1096
-rw-r--r--widgets/misc/e-canvas.h157
-rw-r--r--widgets/misc/e-cell-date-edit.c977
-rw-r--r--widgets/misc/e-cell-date-edit.h106
-rw-r--r--widgets/misc/e-cell-percent.c158
-rw-r--r--widgets/misc/e-cell-percent.h51
-rw-r--r--widgets/misc/e-cell-renderer-combo.c180
-rw-r--r--widgets/misc/e-cell-renderer-combo.h58
-rw-r--r--widgets/misc/e-charset-picker.c557
-rw-r--r--widgets/misc/e-charset-picker.h48
-rw-r--r--widgets/misc/e-clipped-label.c423
-rw-r--r--widgets/misc/e-clipped-label.h102
-rw-r--r--widgets/misc/e-colors.c103
-rw-r--r--widgets/misc/e-colors.h44
-rw-r--r--widgets/misc/e-combo-button.c531
-rw-r--r--widgets/misc/e-combo-button.h80
-rw-r--r--widgets/misc/e-combo-cell-editable.c423
-rw-r--r--widgets/misc/e-combo-cell-editable.h67
-rw-r--r--widgets/misc/e-config-page.c152
-rw-r--r--widgets/misc/e-config-page.h76
-rw-r--r--widgets/misc/e-cursors.c156
-rw-r--r--widgets/misc/e-cursors.h68
-rw-r--r--widgets/misc/e-dateedit.c1946
-rw-r--r--widgets/misc/e-dateedit.h178
-rw-r--r--widgets/misc/e-dropdown-button.c249
-rw-r--r--widgets/misc/e-dropdown-button.h71
-rw-r--r--widgets/misc/e-filter-bar.c722
-rw-r--r--widgets/misc/e-filter-bar.h118
-rw-r--r--widgets/misc/e-gui-utils.c238
-rw-r--r--widgets/misc/e-gui-utils.h58
-rw-r--r--widgets/misc/e-hsv-utils.c178
-rw-r--r--widgets/misc/e-hsv-utils.h52
-rw-r--r--widgets/misc/e-map.c1788
-rw-r--r--widgets/misc/e-map.h138
-rw-r--r--widgets/misc/e-multi-config-dialog.c514
-rw-r--r--widgets/misc/e-multi-config-dialog.h77
-rw-r--r--widgets/misc/e-popup-menu.c240
-rw-r--r--widgets/misc/e-popup-menu.h142
-rw-r--r--widgets/misc/e-printable.c209
-rw-r--r--widgets/misc/e-printable.h90
-rw-r--r--widgets/misc/e-reflow-model.c355
-rw-r--r--widgets/misc/e-reflow-model.h112
-rw-r--r--widgets/misc/e-reflow.c1506
-rw-r--r--widgets/misc/e-reflow.h146
-rw-r--r--widgets/misc/e-search-bar.c1243
-rw-r--r--widgets/misc/e-search-bar.h151
-rw-r--r--widgets/misc/e-selection-model-array.c557
-rw-r--r--widgets/misc/e-selection-model-array.h96
-rw-r--r--widgets/misc/e-selection-model-simple.c115
-rw-r--r--widgets/misc/e-selection-model-simple.h70
-rw-r--r--widgets/misc/e-selection-model.c689
-rw-r--r--widgets/misc/e-selection-model.h170
-rw-r--r--widgets/misc/e-source-option-menu.c301
-rw-r--r--widgets/misc/e-source-option-menu.h64
-rw-r--r--widgets/misc/e-source-selector.c747
-rw-r--r--widgets/misc/e-source-selector.h80
-rw-r--r--widgets/misc/e-title-bar.c404
-rw-r--r--widgets/misc/e-title-bar.h86
-rw-r--r--widgets/misc/e-unicode.c2055
-rw-r--r--widgets/misc/e-unicode.h115
-rw-r--r--widgets/misc/e-url-entry.c176
-rw-r--r--widgets/misc/e-url-entry.h69
-rw-r--r--widgets/misc/e-util-marshal.list3
-rw-r--r--widgets/misc/gal-categories.glade166
-rw-r--r--widgets/misc/gal-combo-box.c834
-rw-r--r--widgets/misc/gal-combo-box.h91
-rw-r--r--widgets/misc/gal-combo-text.c433
-rw-r--r--widgets/misc/gal-combo-text.h76
-rw-r--r--widgets/misc/pixmaps/.cvsignore2
-rw-r--r--widgets/misc/pixmaps/cursor_cross.xpm38
-rw-r--r--widgets/misc/pixmaps/cursor_hand_closed.xpm38
-rw-r--r--widgets/misc/pixmaps/cursor_hand_open.xpm38
-rw-r--r--widgets/misc/pixmaps/cursor_zoom_in.xpm37
-rw-r--r--widgets/misc/pixmaps/cursor_zoom_out.xpm37
-rw-r--r--widgets/misc/test-calendar.c221
-rw-r--r--widgets/misc/test-charset-picker.c18
-rw-r--r--widgets/misc/test-color.c76
-rw-r--r--widgets/misc/test-dateedit.c285
-rw-r--r--widgets/misc/test-dropdown-button.c103
-rw-r--r--widgets/misc/test-multi-config-dialog.c94
-rw-r--r--widgets/misc/test-source-option-menu.c88
-rw-r--r--widgets/misc/test-source-selector.c131
-rw-r--r--widgets/misc/test-title-bar.c77
-rw-r--r--widgets/table/.cvsignore13
-rw-r--r--widgets/table/add-col.xpm22
-rw-r--r--widgets/table/arrow-down.xpm21
-rw-r--r--widgets/table/arrow-up.xpm21
-rw-r--r--widgets/table/check-empty.xpm21
-rw-r--r--widgets/table/check-filled.xpm21
-rw-r--r--widgets/table/clip.pngbin192 -> 0 bytes-rw-r--r--widgets/table/e-cell-checkbox.c67
-rw-r--r--widgets/table/e-cell-checkbox.h50
-rw-r--r--widgets/table/e-cell-combo.c697
-rw-r--r--widgets/table/e-cell-combo.h63
-rw-r--r--widgets/table/e-cell-date.c166
-rw-r--r--widgets/table/e-cell-date.h49
-rw-r--r--widgets/table/e-cell-float.c93
-rw-r--r--widgets/table/e-cell-float.h53
-rw-r--r--widgets/table/e-cell-number.c85
-rw-r--r--widgets/table/e-cell-number.h49
-rw-r--r--widgets/table/e-cell-pixbuf.c417
-rw-r--r--widgets/table/e-cell-pixbuf.h53
-rw-r--r--widgets/table/e-cell-popup.c518
-rw-r--r--widgets/table/e-cell-popup.h101
-rw-r--r--widgets/table/e-cell-progress.c456
-rw-r--r--widgets/table/e-cell-progress.h74
-rw-r--r--widgets/table/e-cell-size.c110
-rw-r--r--widgets/table/e-cell-size.h49
-rw-r--r--widgets/table/e-cell-spin-button.c670
-rw-r--r--widgets/table/e-cell-spin-button.h103
-rw-r--r--widgets/table/e-cell-text.c2756
-rw-r--r--widgets/table/e-cell-text.h123
-rw-r--r--widgets/table/e-cell-toggle.c488
-rw-r--r--widgets/table/e-cell-toggle.h62
-rw-r--r--widgets/table/e-cell-tree.c911
-rw-r--r--widgets/table/e-cell-tree.h77
-rw-r--r--widgets/table/e-cell-vbox.c489
-rw-r--r--widgets/table/e-cell-vbox.h65
-rw-r--r--widgets/table/e-cell.c499
-rw-r--r--widgets/table/e-cell.h224
-rw-r--r--widgets/table/e-table-click-to-add.c562
-rw-r--r--widgets/table/e-table-click-to-add.h77
-rw-r--r--widgets/table/e-table-col-dnd.h39
-rw-r--r--widgets/table/e-table-col.c236
-rw-r--r--widgets/table/e-table-col.h101
-rw-r--r--widgets/table/e-table-column-specification.c150
-rw-r--r--widgets/table/e-table-column-specification.h73
-rw-r--r--widgets/table/e-table-column.c291
-rw-r--r--widgets/table/e-table-config-field.c300
-rw-r--r--widgets/table/e-table-config-field.h69
-rw-r--r--widgets/table/e-table-config-no-group.glade2039
-rw-r--r--widgets/table/e-table-config.c1204
-rw-r--r--widgets/table/e-table-config.glade2107
-rw-r--r--widgets/table/e-table-config.h115
-rw-r--r--widgets/table/e-table-defines.h45
-rw-r--r--widgets/table/e-table-example-1.c308
-rw-r--r--widgets/table/e-table-example-2.c349
-rw-r--r--widgets/table/e-table-extras.c292
-rw-r--r--widgets/table/e-table-extras.h82
-rw-r--r--widgets/table/e-table-field-chooser-dialog.c224
-rw-r--r--widgets/table/e-table-field-chooser-dialog.h79
-rw-r--r--widgets/table/e-table-field-chooser-item.c711
-rw-r--r--widgets/table/e-table-field-chooser-item.h75
-rw-r--r--widgets/table/e-table-field-chooser.c282
-rw-r--r--widgets/table/e-table-field-chooser.glade123
-rw-r--r--widgets/table/e-table-field-chooser.h79
-rw-r--r--widgets/table/e-table-group-container.c1512
-rw-r--r--widgets/table/e-table-group-container.h98
-rw-r--r--widgets/table/e-table-group-leaf.c686
-rw-r--r--widgets/table/e-table-group-leaf.h90
-rw-r--r--widgets/table/e-table-group.c712
-rw-r--r--widgets/table/e-table-group.h178
-rw-r--r--widgets/table/e-table-header-item.c1896
-rw-r--r--widgets/table/e-table-header-item.h118
-rw-r--r--widgets/table/e-table-header-utils.c481
-rw-r--r--widgets/table/e-table-header-utils.h55
-rw-r--r--widgets/table/e-table-header.c952
-rw-r--r--widgets/table/e-table-header.h120
-rw-r--r--widgets/table/e-table-item.c3716
-rw-r--r--widgets/table/e-table-item.h231
-rw-r--r--widgets/table/e-table-memory-callbacks.c208
-rw-r--r--widgets/table/e-table-memory-callbacks.h91
-rw-r--r--widgets/table/e-table-memory-store.c583
-rw-r--r--widgets/table/e-table-memory-store.h138
-rw-r--r--widgets/table/e-table-memory.c277
-rw-r--r--widgets/table/e-table-memory.h76
-rw-r--r--widgets/table/e-table-model.c579
-rw-r--r--widgets/table/e-table-model.h170
-rw-r--r--widgets/table/e-table-one.c243
-rw-r--r--widgets/table/e-table-one.h57
-rw-r--r--widgets/table/e-table-scrolled.c229
-rw-r--r--widgets/table/e-table-scrolled.h76
-rw-r--r--widgets/table/e-table-search.c223
-rw-r--r--widgets/table/e-table-search.h71
-rw-r--r--widgets/table/e-table-selection-model.c347
-rw-r--r--widgets/table/e-table-selection-model.h76
-rw-r--r--widgets/table/e-table-simple.c289
-rw-r--r--widgets/table/e-table-simple.h122
-rw-r--r--widgets/table/e-table-size-test.c307
-rw-r--r--widgets/table/e-table-sort-info.c481
-rw-r--r--widgets/table/e-table-sort-info.h107
-rw-r--r--widgets/table/e-table-sorted-variable.c228
-rw-r--r--widgets/table/e-table-sorted-variable.h65
-rw-r--r--widgets/table/e-table-sorted.c310
-rw-r--r--widgets/table/e-table-sorted.h65
-rw-r--r--widgets/table/e-table-sorter.c462
-rw-r--r--widgets/table/e-table-sorter.h74
-rw-r--r--widgets/table/e-table-sorting-utils.c349
-rw-r--r--widgets/table/e-table-sorting-utils.h83
-rw-r--r--widgets/table/e-table-specification.c432
-rw-r--r--widgets/table/e-table-specification.h89
-rw-r--r--widgets/table/e-table-state.c299
-rw-r--r--widgets/table/e-table-state.h74
-rw-r--r--widgets/table/e-table-subset-variable.c250
-rw-r--r--widgets/table/e-table-subset-variable.h82
-rw-r--r--widgets/table/e-table-subset.c482
-rw-r--r--widgets/table/e-table-subset.h89
-rw-r--r--widgets/table/e-table-tooltip.h44
-rw-r--r--widgets/table/e-table-tree.h48
-rw-r--r--widgets/table/e-table-utils.c191
-rw-r--r--widgets/table/e-table-utils.h49
-rw-r--r--widgets/table/e-table-without.c392
-rw-r--r--widgets/table/e-table-without.h91
-rw-r--r--widgets/table/e-table.c3277
-rw-r--r--widgets/table/e-table.diabin4514 -> 0 bytes-rw-r--r--widgets/table/e-table.h358
-rw-r--r--widgets/table/e-tree-memory-callbacks.c275
-rw-r--r--widgets/table/e-tree-memory-callbacks.h119
-rw-r--r--widgets/table/e-tree-memory.c717
-rw-r--r--widgets/table/e-tree-memory.h101
-rw-r--r--widgets/table/e-tree-model.c1098
-rw-r--r--widgets/table/e-tree-model.h227
-rw-r--r--widgets/table/e-tree-scrolled.c228
-rw-r--r--widgets/table/e-tree-scrolled.h75
-rw-r--r--widgets/table/e-tree-selection-model.c802
-rw-r--r--widgets/table/e-tree-selection-model.h77
-rw-r--r--widgets/table/e-tree-simple.c208
-rw-r--r--widgets/table/e-tree-simple.h85
-rw-r--r--widgets/table/e-tree-sorted-variable.c477
-rw-r--r--widgets/table/e-tree-sorted-variable.h85
-rw-r--r--widgets/table/e-tree-sorted.c1390
-rw-r--r--widgets/table/e-tree-sorted.h86
-rw-r--r--widgets/table/e-tree-table-adapter.c1174
-rw-r--r--widgets/table/e-tree-table-adapter.h95
-rw-r--r--widgets/table/e-tree.c3328
-rw-r--r--widgets/table/e-tree.h312
-rw-r--r--widgets/table/image1.pngbin1858 -> 0 bytes-rw-r--r--widgets/table/image2.pngbin1987 -> 0 bytes-rw-r--r--widgets/table/image3.pngbin2051 -> 0 bytes-rw-r--r--widgets/table/remove-col.xpm22
-rw-r--r--widgets/table/sample.table45
-rw-r--r--widgets/table/spec.xml21
-rw-r--r--widgets/table/table-test.c62
-rw-r--r--widgets/table/table-test.h27
-rw-r--r--widgets/table/test-check.c221
-rw-r--r--widgets/table/test-cols.c265
-rw-r--r--widgets/table/test-table.c478
-rw-r--r--widgets/table/tree-expanded.xpm23
-rw-r--r--widgets/table/tree-unexpanded.xpm23
-rw-r--r--widgets/text/.cvsignore11
-rw-r--r--widgets/text/e-completion-callbacks.c98
-rw-r--r--widgets/text/e-completion-callbacks.h68
-rw-r--r--widgets/text/e-completion-match.c184
-rw-r--r--widgets/text/e-completion-match.h67
-rw-r--r--widgets/text/e-completion-view.c859
-rw-r--r--widgets/text/e-completion-view.h98
-rw-r--r--widgets/text/e-completion.c339
-rw-r--r--widgets/text/e-completion.h91
-rw-r--r--widgets/text/e-entry-test.c83
-rw-r--r--widgets/text/e-entry.c1399
-rw-r--r--widgets/text/e-entry.h87
-rw-r--r--widgets/text/e-table-text-model.c234
-rw-r--r--widgets/text/e-table-text-model.h64
-rw-r--r--widgets/text/e-text-model-repos.c87
-rw-r--r--widgets/text/e-text-model-repos.h69
-rw-r--r--widgets/text/e-text-model-test.c91
-rw-r--r--widgets/text/e-text-model-uri.c344
-rw-r--r--widgets/text/e-text-model-uri.h56
-rw-r--r--widgets/text/e-text-model.c601
-rw-r--r--widgets/text/e-text-model.h113
-rw-r--r--widgets/text/e-text-test.c168
-rw-r--r--widgets/text/e-text.c3827
-rw-r--r--widgets/text/e-text.h244
2432 files changed, 0 insertions, 1901098 deletions
diff --git a/.cvsignore b/.cvsignore
deleted file mode 100644
index e06716e16f..0000000000
--- a/.cvsignore
+++ /dev/null
@@ -1,30 +0,0 @@
-ABOUT-NLS
-Makefile
-Makefile.in
-autom4te*.cache
-aclocal.m4
-config.cache
-config.guess
-config.h
-config.h.in
-config.log
-config.rpath
-config.status
-config.sub
-configure
-install-sh
-intl
-libtool
-ltconfig
-ltmain.sh
-m4
-missing
-mkinstalldirs
-stamp-h
-stamp-h.in
-stamp.h
-xml-i18n-*
-xlibtool
-xltmain.sh
-intltool-*
-*.pc \ No newline at end of file
diff --git a/AUTHORS b/AUTHORS
deleted file mode 100644
index 75e6a26764..0000000000
--- a/AUTHORS
+++ /dev/null
@@ -1,85 +0,0 @@
-Evolution was written by:
-
-Addressbook
- Arturo Esponosa <arturo@nuclecu.unam.mx> (Original Gnomecard author)
- Nat Friedman <nat@ximian.com>
- Chris Lahey <clahey@ximian.com>
- Chris Toshok <toshok@ximian.com>
- Jon Trowbridge <trow@ximian.com>
-
-Artwork
- Tuomas Kuosmanen <tigert@ximian.com>
- Jakub Steiner <jimmac@ximian.com>
-
-Calendar
- Seth Alves <seth@ximian.com>
- Eric Busboom <eric@softwarestudio.org> (libical author)
- Arturo Esponosa <arturo@nuclecu.unam.mx> (Gnomecal contributor)
- Damon Chaplin <damon@ximian.com>
- Federico Mena-Quintero <federico@ximian.com>
- Rodrigo Moya <rodrigo@ximian.com>
- Jesse Pavel <jesse@ximian.com>
- JP Rosevear <jpr@ximian.com>
- Russell Steinthal <rms39@columbia.edu> (Gnomecal maintainer)
-
-Documentation
- Kevin Breit <mrproper@ximian.com>
- Aaron Weber <aaron@ximian.com>
-
-Mailer
- Radek Doulik <rodo@ximian.com>
- Larry Ewing <lewing@ximian.com>
- Bertrand Guiheneuf <bertrand@ximian.com>
- Jason Leach <jleach@ximian.com>
- Matt Loper <matt@ximian.com>
- Ettore Perazzoli <ettore@ximian.com>
- Jeffrey Stedfast <fejj@ximian.com>
- Jon Trowbridge <trow@ximian.com>
- Peter Williams <peterw@ximian.com>
- Dan Winship <danw@ximian.com>
- Michael Zucchi <notzed@ximian.com>
-
-Notes
- Anders Carlsson <andersca@gnu.org>
-
-Pilot
- JP Rosevear <jpr@ximian.com>
-
-Shell
- Miguel de Icaza <miguel@ximian.com>
- Jason Leach <jleach@ximian.com>
- Ettore Perazzoli <ettore@ximian.com>
-
-Translations
- Akira TAGOH <tagoh@gnome.gr.jp>
- Andraz Tori <andraz.tori1@guest.arnes.si>
- Andreas Hyden <a.hyden@cyberpoint.se>
- Arjan Scherpenisse <acscherp@wins.uva.nl>
- Clara Tattoni <clara.tattoni@libero.it>
- Fatih Demir <kabalak@gmx.net>
- Gediminas Paulauskas <menesis@delfi.lt>
- GNOME PL Team <translators@gnome.pl>
- Gustavo Maciel Dias Vieira <gdvieira@zaz.com.br>
- Hctor Garca Alvarez <hector@scouts-es.org>
- Jess Bravo lvarez <jba@pobox.com>
- Keld Simonsen <keld@dkuug.dk>
- Kjartan Maraas <kmaraas@gnome.org>
- Matthias Warkus <mawa@iname.com>
- Spiros Papadimitriou <spapadim+@cs.cmu.edu>
- Sung-Hyun Nam <namsh@kldp.org>
- Szabolcs BAN <shooby@gnome.hu>
- Tiago Anto <tiagoantao@bigfoot.com>
- Duarte Loreto <happyguy_pt@hotmail.com>
- Valek Filippov <frob@df.ru>
- Vincent Renardias <vincent@redhat.com>
- Yuri Syrota <rasta@renome.rovno.ua>
-
-UI
- Anna Dirks <anna@ximian.com>
-
-Widgets
- Damon Chaplin <damon@ximian.com>
- Miguel de Icaza <miguel@ximian.com>
- Chris Lahey <clahey@ximian.com>
- Federico Mena-Quintero <federico@ximian.com>
- Chris Toshok <toshok@ximian.com>
diff --git a/COPYING b/COPYING
deleted file mode 100644
index d60c31a97a..0000000000
--- a/COPYING
+++ /dev/null
@@ -1,340 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/COPYING-DOCS b/COPYING-DOCS
deleted file mode 100644
index b42936beb3..0000000000
--- a/COPYING-DOCS
+++ /dev/null
@@ -1,355 +0,0 @@
- GNU Free Documentation License
- Version 1.1, March 2000
-
- Copyright (C) 2000 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-
-0. PREAMBLE
-
-The purpose of this License is to make a manual, textbook, or other
-written document "free" in the sense of freedom: to assure everyone
-the effective freedom to copy and redistribute it, with or without
-modifying it, either commercially or noncommercially. Secondarily,
-this License preserves for the author and publisher a way to get
-credit for their work, while not being considered responsible for
-modifications made by others.
-
-This License is a kind of "copyleft", which means that derivative
-works of the document must themselves be free in the same sense. It
-complements the GNU General Public License, which is a copyleft
-license designed for free software.
-
-We have designed this License in order to use it for manuals for free
-software, because free software needs free documentation: a free
-program should come with manuals providing the same freedoms that the
-software does. But this License is not limited to software manuals;
-it can be used for any textual work, regardless of subject matter or
-whether it is published as a printed book. We recommend this License
-principally for works whose purpose is instruction or reference.
-
-
-1. APPLICABILITY AND DEFINITIONS
-
-This License applies to any manual or other work that contains a
-notice placed by the copyright holder saying it can be distributed
-under the terms of this License. The "Document", below, refers to any
-such manual or work. Any member of the public is a licensee, and is
-addressed as "you".
-
-A "Modified Version" of the Document means any work containing the
-Document or a portion of it, either copied verbatim, or with
-modifications and/or translated into another language.
-
-A "Secondary Section" is a named appendix or a front-matter section of
-the Document that deals exclusively with the relationship of the
-publishers or authors of the Document to the Document's overall subject
-(or to related matters) and contains nothing that could fall directly
-within that overall subject. (For example, if the Document is in part a
-textbook of mathematics, a Secondary Section may not explain any
-mathematics.) The relationship could be a matter of historical
-connection with the subject or with related matters, or of legal,
-commercial, philosophical, ethical or political position regarding
-them.
-
-The "Invariant Sections" are certain Secondary Sections whose titles
-are designated, as being those of Invariant Sections, in the notice
-that says that the Document is released under this License.
-
-The "Cover Texts" are certain short passages of text that are listed,
-as Front-Cover Texts or Back-Cover Texts, in the notice that says that
-the Document is released under this License.
-
-A "Transparent" copy of the Document means a machine-readable copy,
-represented in a format whose specification is available to the
-general public, whose contents can be viewed and edited directly and
-straightforwardly with generic text editors or (for images composed of
-pixels) generic paint programs or (for drawings) some widely available
-drawing editor, and that is suitable for input to text formatters or
-for automatic translation to a variety of formats suitable for input
-to text formatters. A copy made in an otherwise Transparent file
-format whose markup has been designed to thwart or discourage
-subsequent modification by readers is not Transparent. A copy that is
-not "Transparent" is called "Opaque".
-
-Examples of suitable formats for Transparent copies include plain
-ASCII without markup, Texinfo input format, LaTeX input format, SGML
-or XML using a publicly available DTD, and standard-conforming simple
-HTML designed for human modification. Opaque formats include
-PostScript, PDF, proprietary formats that can be read and edited only
-by proprietary word processors, SGML or XML for which the DTD and/or
-processing tools are not generally available, and the
-machine-generated HTML produced by some word processors for output
-purposes only.
-
-The "Title Page" means, for a printed book, the title page itself,
-plus such following pages as are needed to hold, legibly, the material
-this License requires to appear in the title page. For works in
-formats which do not have any title page as such, "Title Page" means
-the text near the most prominent appearance of the work's title,
-preceding the beginning of the body of the text.
-
-
-2. VERBATIM COPYING
-
-You may copy and distribute the Document in any medium, either
-commercially or noncommercially, provided that this License, the
-copyright notices, and the license notice saying this License applies
-to the Document are reproduced in all copies, and that you add no other
-conditions whatsoever to those of this License. You may not use
-technical measures to obstruct or control the reading or further
-copying of the copies you make or distribute. However, you may accept
-compensation in exchange for copies. If you distribute a large enough
-number of copies you must also follow the conditions in section 3.
-
-You may also lend copies, under the same conditions stated above, and
-you may publicly display copies.
-
-
-3. COPYING IN QUANTITY
-
-If you publish printed copies of the Document numbering more than 100,
-and the Document's license notice requires Cover Texts, you must enclose
-the copies in covers that carry, clearly and legibly, all these Cover
-Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
-the back cover. Both covers must also clearly and legibly identify
-you as the publisher of these copies. The front cover must present
-the full title with all words of the title equally prominent and
-visible. You may add other material on the covers in addition.
-Copying with changes limited to the covers, as long as they preserve
-the title of the Document and satisfy these conditions, can be treated
-as verbatim copying in other respects.
-
-If the required texts for either cover are too voluminous to fit
-legibly, you should put the first ones listed (as many as fit
-reasonably) on the actual cover, and continue the rest onto adjacent
-pages.
-
-If you publish or distribute Opaque copies of the Document numbering
-more than 100, you must either include a machine-readable Transparent
-copy along with each Opaque copy, or state in or with each Opaque copy
-a publicly-accessible computer-network location containing a complete
-Transparent copy of the Document, free of added material, which the
-general network-using public has access to download anonymously at no
-charge using public-standard network protocols. If you use the latter
-option, you must take reasonably prudent steps, when you begin
-distribution of Opaque copies in quantity, to ensure that this
-Transparent copy will remain thus accessible at the stated location
-until at least one year after the last time you distribute an Opaque
-copy (directly or through your agents or retailers) of that edition to
-the public.
-
-It is requested, but not required, that you contact the authors of the
-Document well before redistributing any large number of copies, to give
-them a chance to provide you with an updated version of the Document.
-
-
-4. MODIFICATIONS
-
-You may copy and distribute a Modified Version of the Document under
-the conditions of sections 2 and 3 above, provided that you release
-the Modified Version under precisely this License, with the Modified
-Version filling the role of the Document, thus licensing distribution
-and modification of the Modified Version to whoever possesses a copy
-of it. In addition, you must do these things in the Modified Version:
-
-A. Use in the Title Page (and on the covers, if any) a title distinct
- from that of the Document, and from those of previous versions
- (which should, if there were any, be listed in the History section
- of the Document). You may use the same title as a previous version
- if the original publisher of that version gives permission.
-B. List on the Title Page, as authors, one or more persons or entities
- responsible for authorship of the modifications in the Modified
- Version, together with at least five of the principal authors of the
- Document (all of its principal authors, if it has less than five).
-C. State on the Title page the name of the publisher of the
- Modified Version, as the publisher.
-D. Preserve all the copyright notices of the Document.
-E. Add an appropriate copyright notice for your modifications
- adjacent to the other copyright notices.
-F. Include, immediately after the copyright notices, a license notice
- giving the public permission to use the Modified Version under the
- terms of this License, in the form shown in the Addendum below.
-G. Preserve in that license notice the full lists of Invariant Sections
- and required Cover Texts given in the Document's license notice.
-H. Include an unaltered copy of this License.
-I. Preserve the section entitled "History", and its title, and add to
- it an item stating at least the title, year, new authors, and
- publisher of the Modified Version as given on the Title Page. If
- there is no section entitled "History" in the Document, create one
- stating the title, year, authors, and publisher of the Document as
- given on its Title Page, then add an item describing the Modified
- Version as stated in the previous sentence.
-J. Preserve the network location, if any, given in the Document for
- public access to a Transparent copy of the Document, and likewise
- the network locations given in the Document for previous versions
- it was based on. These may be placed in the "History" section.
- You may omit a network location for a work that was published at
- least four years before the Document itself, or if the original
- publisher of the version it refers to gives permission.
-K. In any section entitled "Acknowledgements" or "Dedications",
- preserve the section's title, and preserve in the section all the
- substance and tone of each of the contributor acknowledgements
- and/or dedications given therein.
-L. Preserve all the Invariant Sections of the Document,
- unaltered in their text and in their titles. Section numbers
- or the equivalent are not considered part of the section titles.
-M. Delete any section entitled "Endorsements". Such a section
- may not be included in the Modified Version.
-N. Do not retitle any existing section as "Endorsements"
- or to conflict in title with any Invariant Section.
-
-If the Modified Version includes new front-matter sections or
-appendices that qualify as Secondary Sections and contain no material
-copied from the Document, you may at your option designate some or all
-of these sections as invariant. To do this, add their titles to the
-list of Invariant Sections in the Modified Version's license notice.
-These titles must be distinct from any other section titles.
-
-You may add a section entitled "Endorsements", provided it contains
-nothing but endorsements of your Modified Version by various
-parties--for example, statements of peer review or that the text has
-been approved by an organization as the authoritative definition of a
-standard.
-
-You may add a passage of up to five words as a Front-Cover Text, and a
-passage of up to 25 words as a Back-Cover Text, to the end of the list
-of Cover Texts in the Modified Version. Only one passage of
-Front-Cover Text and one of Back-Cover Text may be added by (or
-through arrangements made by) any one entity. If the Document already
-includes a cover text for the same cover, previously added by you or
-by arrangement made by the same entity you are acting on behalf of,
-you may not add another; but you may replace the old one, on explicit
-permission from the previous publisher that added the old one.
-
-The author(s) and publisher(s) of the Document do not by this License
-give permission to use their names for publicity for or to assert or
-imply endorsement of any Modified Version.
-
-
-5. COMBINING DOCUMENTS
-
-You may combine the Document with other documents released under this
-License, under the terms defined in section 4 above for modified
-versions, provided that you include in the combination all of the
-Invariant Sections of all of the original documents, unmodified, and
-list them all as Invariant Sections of your combined work in its
-license notice.
-
-The combined work need only contain one copy of this License, and
-multiple identical Invariant Sections may be replaced with a single
-copy. If there are multiple Invariant Sections with the same name but
-different contents, make the title of each such section unique by
-adding at the end of it, in parentheses, the name of the original
-author or publisher of that section if known, or else a unique number.
-Make the same adjustment to the section titles in the list of
-Invariant Sections in the license notice of the combined work.
-
-In the combination, you must combine any sections entitled "History"
-in the various original documents, forming one section entitled
-"History"; likewise combine any sections entitled "Acknowledgements",
-and any sections entitled "Dedications". You must delete all sections
-entitled "Endorsements."
-
-
-6. COLLECTIONS OF DOCUMENTS
-
-You may make a collection consisting of the Document and other documents
-released under this License, and replace the individual copies of this
-License in the various documents with a single copy that is included in
-the collection, provided that you follow the rules of this License for
-verbatim copying of each of the documents in all other respects.
-
-You may extract a single document from such a collection, and distribute
-it individually under this License, provided you insert a copy of this
-License into the extracted document, and follow this License in all
-other respects regarding verbatim copying of that document.
-
-
-7. AGGREGATION WITH INDEPENDENT WORKS
-
-A compilation of the Document or its derivatives with other separate
-and independent documents or works, in or on a volume of a storage or
-distribution medium, does not as a whole count as a Modified Version
-of the Document, provided no compilation copyright is claimed for the
-compilation. Such a compilation is called an "aggregate", and this
-License does not apply to the other self-contained works thus compiled
-with the Document, on account of their being thus compiled, if they
-are not themselves derivative works of the Document.
-
-If the Cover Text requirement of section 3 is applicable to these
-copies of the Document, then if the Document is less than one quarter
-of the entire aggregate, the Document's Cover Texts may be placed on
-covers that surround only the Document within the aggregate.
-Otherwise they must appear on covers around the whole aggregate.
-
-
-8. TRANSLATION
-
-Translation is considered a kind of modification, so you may
-distribute translations of the Document under the terms of section 4.
-Replacing Invariant Sections with translations requires special
-permission from their copyright holders, but you may include
-translations of some or all Invariant Sections in addition to the
-original versions of these Invariant Sections. You may include a
-translation of this License provided that you also include the
-original English version of this License. In case of a disagreement
-between the translation and the original English version of this
-License, the original English version will prevail.
-
-
-9. TERMINATION
-
-You may not copy, modify, sublicense, or distribute the Document except
-as expressly provided for under this License. Any other attempt to
-copy, modify, sublicense or distribute the Document is void, and will
-automatically terminate your rights under this License. However,
-parties who have received copies, or rights, from you under this
-License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-
-10. FUTURE REVISIONS OF THIS LICENSE
-
-The Free Software Foundation may publish new, revised versions
-of the GNU Free Documentation License from time to time. Such new
-versions will be similar in spirit to the present version, but may
-differ in detail to address new problems or concerns. See
-http://www.gnu.org/copyleft/.
-
-Each version of the License is given a distinguishing version number.
-If the Document specifies that a particular numbered version of this
-License "or any later version" applies to it, you have the option of
-following the terms and conditions either of that specified version or
-of any later version that has been published (not as a draft) by the
-Free Software Foundation. If the Document does not specify a version
-number of this License, you may choose any version ever published (not
-as a draft) by the Free Software Foundation.
-
-
-ADDENDUM: How to use this License for your documents
-
-To use this License in a document you have written, include a copy of
-the License in the document and put the following copyright and
-license notices just after the title page:
-
- Copyright (c) YEAR YOUR NAME.
- Permission is granted to copy, distribute and/or modify this document
- under the terms of the GNU Free Documentation License, Version 1.1
- or any later version published by the Free Software Foundation;
- with the Invariant Sections being LIST THEIR TITLES, with the
- Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
- A copy of the license is included in the section entitled "GNU
- Free Documentation License".
-
-If you have no Invariant Sections, write "with no Invariant Sections"
-instead of saying which ones are invariant. If you have no
-Front-Cover Texts, write "no Front-Cover Texts" instead of
-"Front-Cover Texts being LIST"; likewise for Back-Cover Texts.
-
-If your document contains nontrivial examples of program code, we
-recommend releasing these examples in parallel under your choice of
-free software license, such as the GNU General Public License,
-to permit their use in free software.
diff --git a/ChangeLog b/ChangeLog
deleted file mode 100644
index 48617b5247..0000000000
--- a/ChangeLog
+++ /dev/null
@@ -1,349 +0,0 @@
-2003-12-07 JP Rosevear <jpr@ximian.com>
-
- * configure.in: update version reliance
-
-2003-12-06 JP Rosevear <jpr@ximian.com>
-
- * tools/Makefile.am: Remove hard coded disable deprecated flags
-
-2003-12-05 Radek Doulik <rodo@ximian.com>
-
- * configure.in: require gtkhtml 3.1.3 (new gtk_html_flush method
- to be used in mailer)
-
-2003-12-02 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in (EVOLUTION_DIR): Remove the Junk folder
-
-2003-12-01 Rodney Dawes <dobey@ximian.com>
-
- * data/Makefile.am: Install evolution.desktop as
- evolution-$(BASE_VERSION).desktop
- * data/evolution.desktop.in: Remove generated file
- * data/evolution.desktop.in.in: Add (Unstable) to name
- Fix comment to be more correct and have correct capitalization
-
-2003-12-01 Rodney Dawes <dobey@ximian.com>
-
- * tools/killev.c: Use BASE_VERSION for repo_ids and OAFIIDs,
- Update gnome-spell repo_id to correct version,
- Update gtkhtml editor OAFIID to GtkHTML 3.1
-
-2003-12-01 JP Rosevear <jpr@ximian.com>
-
- * configure.in: define privconduitdir
-
-2003-11-28 Anders Carlsson <andersca@gnome.org>
-
- * configure.in: Look for mozilla-nss.pc, not mozilla.pc.
-
-2003-11-26 JP Rosevear <jpr@ximian.com>
-
- * configure.in: make sure the mozilla .pc file exists before
- checking for it
-
-2003-11-24 Rodrigo Moya <rodrigo@ximian.com>
-
- * tools/killev.c (main): kill Evo 2.0's alarm daemon, not 1.4's.
-
-2003-11-19 JP Rosevear <jpr@ximian.com>
-
- * MAINTAINERS: Update
-
-2003-11-18 JP Rosevear <jpr@ximian.com>
-
- * configure.in: remove db3 check
-
-2003-11-18 Rodrigo Moya <rodrigo@ximian.com>
-
- * tools/killev.c (main): kill the alarm notification service, not
- the factory, which no longer exists.
-
-2003-11-17 JP Rosevear <jpr@ximian.com>
-
- * Makefile.am: make sure server.mk is disted
-
-2003-11-17 JP Rosevear <jpr@ximian.com>
-
- * Makefile.am (EXTRA_DIST): do the right thing for disting
-
-2003-11-17 JP Rosevear <jpr@ximian.com>
-
- * configure.in: use the server.mk file to get rules for building
- versioned .server files
-
- * */Makefile.am: use simplified rule subst
-
-2003-11-17 JP Rosevear <jpr@ximian.com>
-
- * Makefile.am: Install versioned package config files
-
-2003-11-14 JP Rosevear <jpr@ximian.com>
-
- * configure.in: make source selector flags/libs
-
-2003-11-14 JP Rosevear <jpr@ximian.com>
-
- * MAINTAINERS: Update
-
-2003-11-11 Chris Toshok <toshok@ximian.com>
-
- * Makefile.am (SUBDIRS): remove libversit from the build.
-
- * configure.in (CERT_UI): change the libraries we link.
- (AC_OUTPUT): remove libversit/Makefile
-
-2003-11-11 JP Rosevear <jpr@ximian.com>
-
- * configure.in: determine the e-d-s version, version the gettext
- files properly
-
-2003-11-07 Dan Winship <danw@ximian.com>
-
- * configure.in (AC_OUTPUT): Remove e-util/ename/Makefile
-
-2003-11-07 JP Rosevear <jpr@ximian.com>
-
- * configure.in: we don't have to configure the libical subdir now
-
-2003-11-07 JP Rosevear <jpr@ximian.com>
-
- * configure.in: pull in evolution-data-server stuff and remove
- backends from output
-
-2003-10-31 JP Rosevear <jpr@ximian.com>
-
- * configure.in: set up vars and rules for versioning the .server
- files
-
- * Makefile.am's: use rules for versioning .server file, ensure
- built files are removed before disting
-
-2003-10-30 Chris Toshok <toshok@ximian.com>
-
- * configure.in: (AC_OUTPUT): remove smime/tests for now.
-
-2003-10-30 Chris Toshok <toshok@ximian.com>
-
- * configure.in: set enable_smime=yes wherever nss would be
- enabled.. fixes manually specifying the nss libs and enabling the
- smime ui. Also, add a section for generating the correct SMIME UI
- flags. gross, but necessary. it should probably be wrapped in
- with all the other nss library crap.
- (AC_OUTPUT): add smime/tests
-
-2003-10-29 Chris Toshok <toshok@ximian.com>
-
- * Makefile.am (SUBDIRS): use $SMIME_DIR. instead of explicitly
- including smime.
-
- * configure.in: add some smime foo - a status message, an
- AM_CONDITIONAL (ENABLE_SMIME)
-
-2003-10-17 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in: added a configure check for AI_ADDRCONFIG
-
-2003-10-24 Dan Winship <danw@ximian.com>
-
- * libversit/Makefile.am: Change YFLAGS to AM_YFLAGS to stop an
- automake 1.7 warning
-
-2003-10-23 Rodney Dawes <dobey@ximian.com>
-
- * confiugre.in: Remove mail/importers/Makefile from AC_OUTPUT
- yet again
-
-2003-10-23 Chris Toshok <toshok@ximian.com>
-
- * configure.in: add smime/* dirs. to AC_OUTPUT.
-
- * Makefile.am (SUBDIRS): add smime/.
-
-2003-10-23 Frederic Crozat <fcrozat@mandrakesoft.com>
-
- * configure.in: Check for gnome-thumbnail.h existence
- (really committed this time).
-
-2003-10-22 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Set $ACLOCAL to have the $ACLOCAL_FLAGS in it, so
- it doesn't fail to regenerate the files if you run make without a
- manual autogen after making changes to configure.in and friends.
- [Many thanks to Marco Pesenti Gritti for pointing out the fix to
- me.]
-
-2003-10-22 Rodney Dawes <dobey@ximian.com>
-
- * configure.in: Require ORBit 2.8.0 or newer for threading
-
-2003-10-22 Rodney Dawes <dobey@ximian.com>
-
- * configure.in: Revert broken previous commit and actually remove
- mail/importers/Makefile from AC_OUTPUT
-
-2003-10-22 Rodney Dawes <dobey@ximian.com>
-
- * configure.in: Removed mail/importers/Makefile from AC_OUTPUT
-
-2003-10-22 Rodney Dawes <dobey@ximian.com>
-
- * configure.in: Removed addressbook/tools/Makefile from AC_OUTPUT
-
-2003-10-22 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in: Removed pedantic pgp/mime configure flag.
-
-2003-10-22 Dan Winship <danw@ximian.com>
-
- * executive-summary/*: Removed; this code has not been used since
- pre-1.0.
-
- * importers/*: Removed; the actual importers were moved to
- {mail,calendar}/importers long ago.
-
- * my-evolution/*: Removed; gone in evolution 2.0.
-
- * notes/*: Removed; never finished and no one is working on it.
-
- * omf-install/*: Removed; part of old doc system
-
- * tests/*: Removed; these are ancient. Camel regression tests are
- in camel/tests now.
-
- * configure.in (E_UTIL_{CFLAGS,LIBS}): Remove soup-2.0 since
- e-proxy is gone.
- (EVOLUTION_MAIL_{CFLAGS,LIBS}): Remove soup-2.0 since the mailer
- uses CamelHTTPStream now.
- (EVOLUTION_EXECUTIVE_SUMMARY_{CFLAGS,LIBS}): Gone
- (AC_OUTPUT): Remove my-evolution/Makefile
-
- * README: evolution no longer depends on soup
-
-2003-10-21 Dan Winship <danw@ximian.com>
-
- * configure.in (GNOME_COMPILE_WARNINGS): Turn off the annoying
- "comparison between signed and unsigned" warning in gcc 3.3
-
- * evolution-calendar.pc.in (Cflags): add
- -I${privincludedir}/libical
-
-2003-10-08 Frederic Crozat <fcrozat@mandrakesoft.com>
-
- * configure.in: Check for gnome-thumbnail.h existence.
-
-2003-09-04 Dan Winship <danw@ximian.com>
-
- * camel.pc.in (Requires):
- * evolution-addressbook.pc.in (Requires):
- * evolution-calendar.pc.in (Requires):
- * evolution-shell.pc.in (Requires): Require gal-2.2
-
-2003-08-27 Bolian Yin <bolian.yin@sun.com>
-
- * configure.in: add a11y/widgets/Makefile
- * Makefile.am: move a11y directory before widgets directory.
-
-2003-08-21 Not Zed <NotZed@Ximian.com>
-
- * HACKING: Wrote one.
-
-2003-08-20 Bolian Yin <bolian.yin@sun.com>
-
- * configure.in: Add a11y checking, and a11y Makefiles
- * Makefile.am: add a11y subdirectory
-
-2003-08-13 Mike Kestner <mkestner@ximian.com>
-
- * configure.in: don't make 1.5 the default version (ie LN_S)
- update to use gal-2.2
-
-2003-08-01 Not Zed <NotZed@Ximian.com>
-
- * configure.in: Add option for '--enable-imapp', for 'new' imap
- code.
-
-2003-07-26 Larry Ewing <lewing@ximian.com>
-
- * configure.in: use libgtkhtml-3.1 for linking.
-
-2003-07-26 Rodney Dawes <dobey@ximian.com>
-
- * configure.in: Bump version to "1.5", so that we end up being
- parallel installable with 1.4 again, but we can still release
- a "1.5.0" tarball when we get to that point in 6 months
-
-2003-07-23 Dan Winship <danw@ximian.com>
-
- * configure.in: Define EVO_MARSHAL_RULE, which creates glib
- marshaller .c and .h files that don't cause gcc warnings
-
- * marshal.mk: The Makefile fragment used by EVO_MARSHAL_RULE.
- (Can't include newlines in an AC_SUBST, so we have to use
- AC_SUBST_FILE)
-
- * Makefile.am (EXTRA_DIST): add marshal.mk
-
-2003-07-20 Hasbullah Bin Pit <sebol@ikhlas.com>
-
- *configure.in: Added 'ms' (Malay) to ALL_LINGUAS.
-
-2003-07-10 Rodney Dawes <dobey@ximian.com>
-
- * configure.in: Change version to 1.4.99 since HEAD is not the
- stable 1.4 branch, as evolution-1-4-branch was created post-1.4.1
-
-2003-07-01 Dan Winship <danw@ximian.com>
-
- * configure.in: Check for gnome-icon-lookup.h (which could mean
- either plain GNOME 2.2 or Sun GNOME 2.0)
-
-2003-06-30 Rodrigo Moya <rodrigo@ximian.com>
-
- * configure.in:
- * Makefile.am: removed libwombat from the build.
-
- * evolution-calendar.pc.in: removed -lwombat.
-
- * libwombat/*: removed unused directory.
-
-== Version 1.4.1 ==
-
-2003-06-25 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Depend on GtkHTML 3.0.6, gal 1.99.8.
-
- * README: Update
-
-2003-06-23 Ettore Perazzoli <ettore@ximian.com>
-
- * data/Makefile.am: Added implicity rule to subst @BASE_VERSION@
- in evolution.desktop.in.in to generate evolution.desktop.in.
- (desktop_in_file): Removed.
- (desktop_in_in_file): New.
- (kdedesktop_file): Update substitution to use
- $(desktop_in_in_file) instead of $(desktop_in_file).
- (noinst_DATA): Add $(desktop_file).
- (install-data-local): Depend on $(mime_file) and $(keys_file).
- (EXTRA_DIST): Remove $(desktop_file), replace $(desktop_in_file)
- with $(desktop_in_in_file).
-
-2003-06-19 Dan Winship <danw@ximian.com>
-
- * tools/killev.c (kill_component): clean this up a little and make
- it deal with "evolution" vs "evolution-1.4"
-
-2003-06-19 Danilo Šegan <dsegan@gmx.net>
-
- * configure.in: Added "sr" and "sr@Latn" to ALL_LINGUAS.
-
-2003-06-17 Not Zed <NotZed@Ximian.com>
-
- * NEWS: Updated for current mail stuff.
-
-2003-06-13 Ettore Perazzoli <ettore@ximian.com>
-
- * tools/Makefile.am: Remove evolution-launch-composer since it's
- no longer needed.
-
-
diff --git a/ChangeLog.pre-1-4 b/ChangeLog.pre-1-4
deleted file mode 100644
index 944140f011..0000000000
--- a/ChangeLog.pre-1-4
+++ /dev/null
@@ -1,8530 +0,0 @@
-== Version 1.4.0 ==
-
-2003-06-02 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Bump version number to 1.4.0.
- (VERSION_COMMENT): Set to an empty string.
- (GAL_REQUIRED): Require 1.99.7.
-
-2003-05-28 Rodney Dawes <dobey@ximian.com>
-
- * configure.in: AC_SUBST() for GAL_REQUIRED and GTKHTML_REQUIRED
-
-2003-05-27 Not Zed <NotZed@Ximian.com>
-
- * camel.pc.in: make libs/cflags point to privlibdir/includedir,
- otherwise this just doesn't work.
-
-== Version 1.3.92 ==
-
-2003-05-22 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Bump version to 1.3.92.
-
-2003-05-22 Rodney Dawes <dobey@ximian.com>
-
- * camel.pc.in:
- * evolution-addressbook.pc.in:
- * evolution-calendar.pc.in:
- * evolution-shell.pc.in: s/GAL_VERSION/GAL_REQUIRED/
-
-2003-05-22 Dmitry G. Mastrukov <dmitry@taurussoft.org>
-
- * configure.in: Added Belarusian to ALL_LINGUAS.
-
-2003-05-21 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Bump version to 1.3.91.99.
-
-== Version 1.3.91 ==
-
-2003-05-21 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Renamed GAL_VERSION to GAL_REQUIRED; also, made it
- not AC_SUBST() it anymore since it's only used in configure.
- Added GTKHTML_REQUIRED and made all the libgtkhtml-3.0 checks use
- it.
-
-2003-05-19 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Remove GNOME_PREFIX stuff. Add
- --disable-default-binary command line option, with corresponding
- DEFAULT_BINARY Automake conditional.
-
-2003-05-19 Not Zed <notzed@lostzed.mmc.com.au>
-
- * NEWS: Updated for mail/ camel/ filter/ and e-util/
-
-2003-04-30 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Bump version number to 1.3.3.99.
-
-== Version 1.3.3 ==
-
-2003-04-29 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: 1.3.3.
-
-2003-04-28 Jeffrey Stedfast <fejj@ximian.com>
-
- * NEWS: Updated for mailer fixes
-
-2003-04-28 Rodney Dawes <dobey@ximian.com>
-
- * data/cde_app_root/: Use $(privdatadir) instead of
- $(prefix)/share/evolution-$(BASE_VERSION) for the cde stuff
-
-2003-04-21 Rodney Dawes <dobey@ximian.com>
-
- * configure.in: Fix KDE_APPLNK_DIR to not install to a diff prefix,
- and disable installing the file to the KDE applnk path by default
-
-2003-04-11 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: 1.3.2.99.
-
-== Version 1.3.2 ==
-
-2003-04-08 Dan Winship <danw@ximian.com>
-
- * tools/Makefile.am (EXTRA_DIST): Fix
-
-2003-04-07 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in: Oops, don't use a == when comparing strings in
- shell.
-
-2003-04-07 Chris Toshok <toshok@ximian.com>
-
- * tools/Makefile.am (privlibexec_PROGRAMS): remove
- evolution-addressbook-export.
-
- * tools/evolution-addressbook-export.c: nuke.
-
-2003-04-07 Chris Toshok <toshok@ximian.com>
-
- * configure.in: add addressbook/tools/Makefile to AC_OUTPUT.
-
-2003-04-07 Dan Winship <danw@ximian.com>
-
- * tools/Makefile.am (privlibexec_SCRIPTS, privlibexec_PROGRAMS):
- Install these in privlibexecdir, not privdatadir. Move killev from
- SCRIPTS to PROGRAMS.
- (killev_SOURCES, killev_LDADD): Add
-
- * tools/killev.c: New C port of killev, since
- "bonobo-activation-query" does not return as much information as
- "oaf-client" did. Also has prettier output. (Still shells out to
- killall/pkill to do the actual killing.)
-
- * tools/killev: Gone
-
- * tools/evolution-move-tasks: Removed since the evolution-calendar
- code that called it is also gone now.
-
-2003-04-07 Not Zed <NotZed@Ximian.com>
-
- * NEWS: Updated for mail/camel/composer/filter for 1.3.2
-
-2003-04-06 Christophe Merlet <redfox@redfoxcenter.org>
-
- * data/Makefile.am: Create $(DESTDIR)$(kdedeskdopdir).
-
-2003-04-04 Chris Toshok <toshok@ximian.com>
-
- * acinclude.m4 (EVO_LDAP_CHECK): bleah, add "" in for the "no"
- case in with_static_ldap.
-
-2003-04-03 Chris Toshok <toshok@ximian.com>
-
- * acinclude.m4 (EVO_LDAP_CHECK): the existence of libldap.la
- should have no bearing on whether or not we try to statically link
- ldap.
-
-2003-03-29 Duarte Loreto <happyguy_pt@hotmail.com>
-
- * AUTHORS: Added myself as new Portuguese translator.
-
-2003-03-28 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Ported check for "killall" vs. "killp" back from
- 1.2.
-
-2003-03-28 Ettore Perazzoli <ettore@ximian.com>
-
- * data/Makefile.am: Fix installation of the .desktop file.
-
-2003-03-27 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Add gal-2.0 to the list of packages to determine
- WOMBAT_CFLAGS and WOMBAT_LIBS.
-
-2003-03-26 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Autogen help/Makefile.
-
- * Makefile.am (SUBDIRS): Add help. [#38234]
-
-2003-03-25 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in: Fixed Heimdal include path.
-
-2003-03-25 Rodney Dawes <dobey@ximian.com>
-
- * data/evolution.desktop.in: Fix 39901 and 40233
-
-2003-03-21 Rodney Dawes <dobey@ximian.com>
-
- * configure.in: Fix the mit krb5+krb4 check to work with --without-kr5
-
-2003-03-19 Ettore Perazzoli <ettore@ximian.com>
-
- * README: Updated considerably.
-
-2003-03-18 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in: Fixed a type-o in the krb5 checks.
-
-2003-03-19 Not Zed <NotZed@Ximian.com>
-
- * configure.in (CAMEL_*, E_UTIL_*, ): Add gthread-2.0, to get any
- thread-specific flags (like -D_REENTRANT). Duh. For #39886.
- (LIBIBEX*): Removed old libibex stuff.
-
-2003-03-14 Chris Toshok <toshok@ximian.com>
-
- * tools/evolution-addressbook-export.c (save_cards): use
- bonobo_main_quit, and clean this up a bit.
-
-2003-03-06 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in: Added AC_C_INLINE - this should fix bug #39171.
-
-2003-03-05 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in: Fix kerberos include paths.
-
-2003-03-05 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Update version number to 1.3.1.99.
-
-== Version 1.3.1 ==
-
-2003-02-28 Dan Winship <danw@ximian.com>
-
- * tools/Makefile.am (evolution_launch_composer_LDADD): Fix
- dependencies
-
-2003-02-28 Hans Petter Jansson <hpj@ximian.com>
-
- * configure.in: Add calendar/importers/Makefile to output.
-
-2003-02-27 Chris Toshok <toshok@ximian.com>
-
- * tools/.cvsignore: ignore some stuff, yo.
-
- * tools/Makefile.am: add in the evolution-launch-composer stuff.
-
- * tools/evolution-launch-composer.c: port this from the 1.2 branch.
-
-2003-02-27 JP Rosevear <jpr@ximian.com>
-
- * configure.in: export gnome-pilot cflags
-
-2003-02-21 Dan Winship <danw@ximian.com>
-
- * libversit/Makefile.am: Make this a shared library to prevent
- linking portability problems
-
- * tools/Makefile.am (evolution_addressbook_import_LDADD): cleanup
-
-2003-02-19 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in (ENABLE_IPv6): AC_DEFINE() ENABLE_IPv6 if it should
- be enabled.
-
-2003-02-07 Rodney Dawes <dobey@ximian.com>
-
- * data/Makefile.am: Fix installation of desktop/mime files
-
-2003-02-06 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Add fr to ALL_LINGUAS again.
-
-2003-02-06 Rodney Dawes <dobey@ximian.com>
-
- * configure.in: Fix KRB4_CFLAGS to work correctly
- * data/Makefile.am: Fix desktop file installation path
- * data/evolution.desktop.in: Use correct binary and categories, add
- StartupNotify=1 also, for startup-notification-enabled systems
-
-2003-02-06 Dan Winship <danw@ximian.com>
-
- * configure.in: export priv*dir for libical's configure to use.
-
- * evolution-addressbook.pc.in (Libs): Remove -L${libdir}.
- (CFlags): s/includedir/privincludedir/
-
- * evolution-calendar.pc.in: Likewise
-
- * evolution-shell.pc.in: Likewise. Also change iconsdir to
- imagesdir
-
- * sounds/Makefile.am: remove soundsdir def
-
- * tools/Makefile.am: subst in $(toolsdir) instead of $(bindir)
-
- * tools/evolution-addressbook-clean.in:
- s/EVOLUTION_BINDIR/EVOLUTION_TOOLSDIR/
-
- * tools/evolution-addressbook-abuse.c (main):
- s/PACKAGE/GETTEXT_PACKAGE/ in gettext init
- * tools/evolution-addressbook-export.c (main): Likewise
- * tools/evolution-addressbook-import.c (main): Likewise
-
-2003-02-05 Dan Winship <danw@ximian.com>
-
- * configure.in: Define and AC_SUBST privlibexecdir, privdatadir,
- privincludedir, serverdir, evolutionuidir, imagesdir, buttonsdir,
- soundsdir, gladedir, etspecdir, and viewsdir.
-
- * data/Makefile.am (dtappintegrate, dtappunintegrate): use
- privdatadir
-
-2003-02-04 Dan Winship <danw@ximian.com>
-
- * configure.in: Update AC_DEFINEs to use the new syntax to make
- acconfig.h unnecessary. (Remove unneeded HAVE_KDE_APPLNK define).
- Call GNOME_COMPILE_WARNINGS and add $WARN_CFLAGS to CFLAGS to get
- back to the evo 1.2 behavior of defaulting to -Wall everywhere.
- Fix up privlibdir definition to avoid undefined variables in
- evolution-shell.pc.
-
- * acinclude.m4: Update AC_DEFINE
-
- * acconfig.h: Gone
-
-2003-02-03 Chris Toshok <toshok@ximian.com>
-
- * configure.in (EVOLUTION_MAIL): add gnome-vfs-module-2.0 to the
- deps so we pick up the right include path.
-
-2003-02-03 Chris Toshok <toshok@ximian.com>
-
- * configure.in: remove the --enable-shlib-components stuff.
-
-2003-01-28 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in (HAVE_KRB5): Updated to add gssapi libs, since this
- is what we use krb5 for :-)
-
-2003-01-28 Rodney Dawes <dobey@ximian.com>
-
- * tools/Makefile.am (EXTRA_DIST): s/bin_SCRIPTS/tools_SCRIPTS/
-
-2003-01-27 Ettore Perazzoli <ettore@ximian.com>
-
- * tools/evolution-addressbook-export.c: #include bonobo-activation
- instead of oaf.
- (main): Initialize using gnome_program_init().
- (save_cards): Use g_main_loop_quit() instead of gtk_exit().
-
- * tools/evolution-addressbook-import.c: Update include list for
- GNOME 2.
- (main): Initialize using gnome_program_init().
- (unref_executable): Use g_main_loop_quit() instead of gtk_exit().
- (add_cb): Likewise.
-
- * tools/evolution-addressbook-abuse.c: Update include list for
- GNOME 2.
- (main): Initialize using gnome_program_init().
- (use_addressbook): Use g_object_unref() instead of
- gtk_object_unref().
- (main): Use g_timeout_add() instead of gtk_timeout_add().
- (add_cb): Use g_main_loop_quit() instead of gtk_exit().
-
- * configure.in (AC_SUBST): Add tools/Makefile.
-
- * Makefile.am (SUBDIRS): Add tools/ back into the list.
-
- * tools/Makefile.am: Install everything in
- $(datadir)/evolution-$(BASE_VERSION)/tools.
- (INCLUDES): Add the defines that gnome_program_init() likes and
- also add the _DISABLE_DEPRECATED stuff.
-
-2003-01-26 Chris Toshok <toshok@ximian.com>
-
- * configure.in (AC_OUTPUT): add in the conduit Makefile's.
-
-2003-01-26 Chris Toshok <toshok@ximian.com>
-
- * configure.in: only do the CONDUIT_CFLAGS/LIBS stuff if pilot
- conduits have been enabled.
-
-2003-01-26 Chris Toshok <toshok@ximian.com>
-
- * configure.in: in the --enable-pilot-conduits stanza, use
- PKG_CHECK_MODULES to get the gnome-pilot-2.0 (and therefore
- pilot-link) cflags/libs before doing our utf-8 check. also,
- enable the addressbook/calendar CONDUIT_{CFLAGS/LIBS} variables.
-
-2003-01-24 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in (evolutionuidir): Define iconsdir.
-
-2003-01-24 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in (FULL_GNOME_DEPS): Doh. Use the
- MANUAL_[NSPR,NSS]_[CFLAGS,LIBS] variables where appropriate.
-
-2003-01-23 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in (idldir): Define componentdir instead of
- COMPONENT_DIR. Set it to $privlibdir/components instead of
- $libdir/evolution-$(BASE_VERSION)/components.
-
-2003-01-22 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in (MOZILLA_NSS): Simplify the whole process into
- about 8 lines by using pkg-config.
-
-2003-01-22 Ettore Perazzoli <ettore@ximian.com>
-
- * data/Makefile.am: For now, do not install the evolution.1
- manpage. Install all the other files with a -$(BASE_VERSION)
- suffix.
- (dtappintegrate): Update for the new location of cde_app_root.
- (dtappunintegrate): Likewise.
-
- * data/cde_app_root/dt/appconfig/appmanager/C/Ximian/Makefile.am
- (cdeappmanagerdir): Version using $(BASE_VERSION).
- * data/cde_app_root/dt/appconfig/types/C/Makefile.am
- (cdetypesdir): Likewise.
- * data/cde_app_root/dt/appconfig/icons/C/Makefile.am
- (cdeiconsdir): Likewise.
-
- * sounds/Makefile.am (soundsdir): Version using $(BASE_VERSION).
-
- * configure.in: Define BASE_VERSION. Set idldir to
- $datadir/idl/evolution-$BASE_VERSION instead of just
- $datadir/idl/evolution.
-
-2003-01-14 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in (ALL_LINGUAS): Remove fr for now, since it doesn't
- seem to work.
- (AC_OUTPUT): Remove calendar/importers/Makefile for now.
-
-2003-01-14 Rodney Dawes <dobey@ximian.com>
-
- * Makefile.am (EXTRA_DIST): intltool, not xml-i18n-tools
-
-2003-01-07 Dan Winship <danw@ximian.com>
-
- * Makefile.am (SUBDIRS): add po
-
- * configure.in: Move ALL_LINGUAS definition to before
- AM_GLIB_GNU_GETTEXT, or else no linguas for you!
-
-2003-01-06 Dan Winship <danw@ximian.com>
-
- * configure.in (AC_INIT): Use "Evolution", not "evolution", since
- that becomes the value of the PACKAGE variable
- (privlibdir): parse $VERSION by hand since.
- EVOLUTION_MAJOR_VERSION, etc aren't defined any more (and trying
- to pass a variable to AC_INIT won't work). This and the above
- change fix the problem that privlibdir was being defined as
- "${libdir}/Evolution/." instead of "${libdir}/evolution/1.3"
- (GAL_VERSION): AC_SUBST this since it's needed in the .pc files
- (idldir): define this here rather than in each Makefile.am that
- needs it.
- (AC_OUTPUT): Add .pc files
-
- * Makefile.am (pkgconfig_DATA): Add pc files.
- (confexec_DATA): Remove this (fooConf.sh files)
- (SUBDIRS): Move filter earlier in the build. (I think it was
- calendar that depends on it now?)
- (%Conf.sh): Remove this. The .pc files are output by configure.in
- now.
-
- * camel.pc.in, evolution-addressbook.pc.in,
- evolution-calendar.pc.in, evolution-shell.pc.in: Replace the
- *Conf.sh files with these. In addition to the basic variables,
- include camel_providerdir (in camel.pc) and idldir, IDL_INCLUDES
- and privlibdir (in the others).
-
-2002-12-04 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Define COMPONENT_DIR.
-
-2002-11-22 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in: Add NSPR CFLAGS and LDFLAGS to the E_UTIL build
- flags.
-
-2002-11-20 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: AC_OUTPUT(my-evolution/Makefile).
-
-2002-11-20 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am (changelogs): Add my-evolution.
-
-2002-11-20 Not Zed <NotZed@Ximian.com>
-
- * libibex/*: cvs removed it all. Not much use having it around
- anymore.
-
-2002-11-19 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Check for gconftool-2, and added
- AM_GCONF_SOURCE_2.
-
-2002-11-18 Not Zed <NotZed@Ximian.com>
-
- * configure.in: Added back IMPORTERS_CFLAGS and
- mail/importers/Makefile
-
-2002-11-16 Chris Toshok <toshok@ximian.com>
-
- * configure.in: we require >= 0.0.9.99 of gal.
-
-2002-11-15 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Set up the my-evolution flags properly, do not
- AC_SUBST GNOME_Evolution_Mail.server.in.
-
-2002-11-13 Not Zed <NotZed@Ximian.com>
-
- * Makefile.am (SUBDIRS): re-added filter, mail, composer
-
- * configure.in: Added EVOLUTION_MAIL settings, and mail/makefile.
-
-2002-11-11 Joe Shaw <joe@ximian.com>
-
- * Makefile.am (SUBDIRS): remove tools for now, it's not in
- configure.in.
-
-2002-11-11 Chris Toshok <toshok@ximian.com>
-
- * Makefile.am (SUBDIRS): add addressbook.
-
-2002-11-08 Chris Toshok <toshok@ximian.com>
-
- * configure.in: add some more addressbook paths.
-
-2002-11-08 Not Zed <NotZed@Ximian.com>
-
- * configure.in: Added composer/Makefile & gtkhtml-3.0 deps.
-
-2002-11-07 Chris Toshok <toshok@ximian.com>
-
- * configure.in (AC_OUTPUT): GNOME_Evolution_Summary.oaf.in = >
- GNOME_Evolution_Summary.server.in
-
-2002-11-07 JP Rosevear <jpr@ximian.com>
-
- * configure.in: update e-util and calendar compile flags
-
-2002-11-07 Rodrigo Moya <rodrigo@ximian.com>
-
- * configure.in: added libgnome-2.0 to camel requirements.
-
-2002-11-06 Chris Toshok <toshok@ximian.com>
-
- * configure.in: add some more addressbook dirs to AC_OUTPUT.
-
-2002-11-05 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in: Re-enable the filter cflags/libs stuff.
-
-2002-11-05 Chris Toshok <toshok@ximian.com>
-
- * Makefile.am (SUBDIRS): add wombat.
-
-2002-11-05 Chris Toshok <toshok@ximian.com>
-
- * configure.in: add wombat and addressbook compile flags, and add
- wombat and some addressbook dirs to AC_OUTPUT.
-
-2002-11-05 Dan Winship <danw@ximian.com>
-
- * configure.in: change the commented-out soup check to refer to
- the new soup 2.0 in the libsoup module
-
-2002-11-05 Rodrigo Moya <rodrigo@ximian.com>
-
- * configure.in: use correct libgtkhtml-3.0 for calendar and added
- generation of calendar GUI's directories.
-
-2002-11-05 Rodrigo Moya <rodrigo@ximian.com>
-
- * configure.in: enabled libwombat.
-
-2002-11-04 Rodrigo Moya <rodrigo@ximian.com>
-
- * configure.in:
- * Makefile.am: added libversit directory to build.
-
-2002-11-04 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am (SUBDIRS): Add shell.
-
-2002-11-04 Rodrigo Moya <rodrigo@ximian.com>
-
- * configure.in: added calendar/idl/Makefile to AC_OUTPUT
-
-2002-11-04 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Add an AM_GLIB_GNU_GETTEXT.
-
-2002-11-03 Rodrigo Moya <rodrigo@ximian.com>
-
- * configure.in:
- * Makefile.am: re-added calendar component (only non-UI stuff).
-
- * data/Makefile.am: use intltools instead of xml-i18n-tools.
-
-2002-11-03 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: AC_PROG_INTLTOOL instead of
- AM_PROG_XML_I18N_TOOLS.
-
-2002-11-01 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Update to use Autoconf 2.53. Remove checks for
- scrollkeeper. Remove intl/Makefile and macros/Makefile from
- AC_OUTPUT list. Set up GETTEXT_PACKAGE. Removed
- AM_ACLOCAL_INCLUDE(macros). Added AM_PATH_ORBIT2.
- (EVO_SET_COMPILE_FLAGS): Use PKG_CHECK_MODULES.
- (IDL_INCLUDES): New, -I params to pass to $(ORBIT_IDL) when
- compiling IDL files into stubs.
-
- * autogen.sh: Changed to use gnome-autogen.sh.
-
-2002-10-30 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: 1.1.90.99.
-
-== Version 1.1.90 (Release Candidate 1) ==
-
-2002-10-28 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: gal 0.21, GtkHTML 1.1.5.
-
-2002-10-23 Chris Toshok <toshok@ximian.com>
-
- * configure.in: Update dep for GAL to 0.21.0.
-
-2002-10-07 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Update version number to 1.1.2.99.
-
-== Version 1.1.2 ==
-
-2002-10-07 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: 1.1.2. Update deps for GAL and GtkHTML.
-
-2002-09-27 gettextize <bug-gnu-gettext@gnu.org>
-
- * Makefile.am (SUBDIRS): Add m4.
- (ACLOCAL_AMFLAGS): New variable.
- (EXTRA_DIST): Add config.rpath.
- * configure.in (AC_OUTPUT): Add po/Makefile.in, m4/Makefile.
-
-2002-09-23 Radek Doulik <rodo@ximian.com>
-
- * configure.in: use pkg-config for gtkhtml
-
-2002-09-23 JP Rosevear <jpr@ximian.com>
-
- * configure.in: fix kde applnk test to not test for things if
- disabled
-
- * configure.in: Fix up mozilla tests and allow static linking of
- nss/nspr (Frank Belew <frb@ximian.com>)
-
-2002-09-23 Aaron Weber <aaron@ximian.com>
-
- * README: Update URLs for mailing lists, Evolution application
- page, help information. Remove note that Evolution is beta. In
- general, changes to the "soft" data. Also, jeff's commit to this
- file from 2001-11-21 seems to have been lost, so I re-removed the
- stuff he took out. And changed libnspr to mozilla-nspr, and
- libnss3 to mozilla-nss.
-
- * data/evolution.1: Update with information about where the real
- help is. Clarify example formatting.
-
-2002-09-16 Ettore Perazzoli <ettore@ximian.com>
-
- * data/cde_app_root/Makefile.am: New.
- * data/cde_app_root/dt/Makefile.am: New.
- * data/cde_app_root/dt/appconfig/Makefile.am: New.
- * data/cde_app_root/dt/appconfig/appmanager/Makefile.am: New.
- * data/cde_app_root/dt/appconfig/appmanager/C/Makefile.am: New.
- * data/cde_app_root/dt/appconfig/appmanager/C/Ximian/Makefile.am: New.
- * data/cde_app_root/dt/appconfig/icons/Makefile.am: New.
- * data/cde_app_root/dt/appconfig/icons/C/Makefile.am: New.
- * data/cde_app_root/dt/appconfig/types/Makefile.am: New.
- * data/cde_app_root/dt/appconfig/types/C/Makefile.am: New.
-
- * configure.in: Add a `--with-cde-path' option. Check for
- dtappintegrate in that path. Define HAVE_DTAPPINTEGRATE and
- GNOME_PREFIX. Also, generate
- data/cde_app_root/dt/appconfig/types/C/Ximian.dt.in and
- shell/evolution-nognome.
-
-2002-09-12 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: 1.1.1.99.
-
-2002-09-11 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am (SUBDIRS): Put po on the top.
-
-== Version 1.1.1 ==
-
-2002-09-09 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: 1.1.1. Also bump some requirements.
-
- * README: Update according to the new requirements.
-
-2002-09-06 Larry Ewing <lewing@ximian.com>
-
- * NEWS: update with some gtkhtml features.
-
-2002-09-05 Ettore Perazzoli <ettore@ximian.com>
-
- * NEWS: Updated with the new 1.2 features (unfinished).
-
- * NEWS-1.0: New, contains the changes up to version 1.0.8.
-
-2002-09-04 Dan Winship <danw@ximian.com>
-
- * acinclude.m4 (EVO_CHECK_TIMEZONE): Remove this from here.
-
- * configure.in: Put it here. (Connector no longer needs to share
- it). Also, check "tm_gmtoff" before "timezone", and if we have
- "timezone", check for "altzone" too.
-
- * acconfig.h: Add HAVE_ALTZONE
-
-2002-08-28 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in: e-util now requires soup and gconf flags.
-
-2002-08-12 Dan Winship <danw@ximian.com>
-
- * tools/evolution-addressbook-import.c (main): Use default book,
- not local one.
-
- * tools/evolution-addressbook-export.c (main): Likewise.
-
- * tools/evolution-addressbook-abuse.c (abuse_timeout): Likewise.
-
-2002-08-11 Jeffrey Stedfast <fejj@ximian.com>
-
- * README: Update required gal and gtkhtml dependency information.
-
-2002-08-06 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in (THREADS_CFLAGS): Need to check for gal 0.19.99.18
- for e_xml_save_file().
-
-2002-08-01 Ettore Perazzoli <ettore@ximian.com>
-
- * README: Update Soup information and remove hard spaces.
-
- * configure.in: Check for Soup 0.7 or later. [Hm, we should make
- sure that it's actually a 0.7.x version.]
-
-2002-07-22 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in: Add checks for IPv6 support.
-
-2002-07-30 Not Zed <NotZed@Ximian.com>
-
- * configure.in (EVOLUTION_MAIL): added soup to compile flags.
-
-2002-07-24 Ettore Perazzoli <ettore@ximian.com>
-
- [Patch by Frank Belew <frb@ximian.com>.]
-
- * configure.in: If no --with-kde-applnk-path is given, try to
- detect the directory using `kde-config'.
-
-2002-07-22 Dan Winship <danw@ximian.com>
-
- * acinclude.m4: Move EVO_CHECK_LIB into here, and also create
- EVO_PURIFY_SUPPORT, EVO_TIMEZONE_CHECK, and EVO_LDAP_CHECK from
- stuff in configure.in. (This stuff is also used by Connector.)
-
- * configure.in: Remove the stuff that was moved to acinclude.m4.
-
- * evolution_addressbookConf.sh.in: Remove db3 and ldap references
- since pas-backend-file and pas-backend-ldap are no longer in
- libpas, and those flags weren't doing anything useful here before
- anyway. (Our attempts to force static linking to those libraries
- end up getting mangled when passed through gnome-config.)
-
- * evolution_calendarConf.sh.in: Likewise, remove db3 references.
-
-2002-07-22 Dan Winship <danw@ximian.com>
-
- * configure.in: Check if we're trying to build with the old
- libversit module borrowed from gnome-pim instead of our own new
- one, and refuse to build if so.
-
- * libversit/Makefile.am: Remove libversit.la stuff since we don't
- want it and it messes up the build slightly.
-
-2002-07-18 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Prepend "$(WERROR)" to all the *_CFLAGS variables
- so you can do `make WERROR=-Werror' to turn all compiler warnings
- into errors.
-
-2002-07-09 Peter Williams <peterw@ximian.com>
-
- * libversit/Makefile.am (privlib_LIBRARIES): Install libversit.a so
- that people compiling against the addressbook can do so successfully.
-
- * Makefile.am: create our *Conf.sh files and dist them and install
- them.
-
- * configure.in: Define and subst some variables that the Conf.sh
- file need.
-
-2002-07-10 Peter Williams <peterw@ximian.com>
-
- * configure.in (privlibdir): Define a versioned library directory
- that we can use for things that are ABI-sensitive: camel
- providers, importers... Define camel_providerder in terms of this,
- resulting in a new location for the providers. Camel will have to
- be rebuilt for it to get the new -D flag.
-
-2002-07-12 Peter Williams <peterw@ximian.com>
-
- * configure.in (E_UTIL_LIBS): e-util relies on bonobo-conf
- in e-passwords.c and e-categories-master-list-wombat.c, so
- reflect that here. And the e-port code needs THREADS_LIBS.
-
-2002-07-09 Peter Williams <peterw@ximian.com>
-
- * tools/Makefile.am (INCLUDES): Add include lines to get
- ebook headers relative to <ebook/foo.h>, not "foo.h".
-
-2002-07-09 <jpr@ximian.com>
-
- * configure.in: re-order nss and nspr flags
-
-2002-07-03 Peter Williams <peterw@ximian.com>
-
- * README: Fix the URL for the DB 3.1.17 package; it's moved.
-
-2002-06-28 Ettore Perazzoli <ettore@ximian.com>
-
- [As suggested by #24466.]
-
- * data/evolution.desktop.in (Categories): Added.
-
-2002-06-27 Dan Winship <danw@ximian.com>
-
- * libversit/Makefile.am: Hack around a libtool/make problem that
- was causing libversit.a to be rebuilt at "make install" time,
- causing further relinking down the line.
-
-2002-06-18 JP Rosevear <jpr@ximian.com>
-
- * configure.in: check for libsoftokn3 if we couldn't link the
- first time
-
-2002-06-14 Chris Toshok <toshok@ximian.com>
-
- * libversit/vobject.c (unUseStr): fix a braindead typo that caused
- us to leak strings in certain circumstances (when the string being
- freed was second in the list, the head of the list would get
- lost.)
-
-2002-06-05 Christopher James Lahey <clahey@ximian.com>
-
- * configure.in: Changed the required version of gal to 0.19.99.17.
-
-2002-06-04 Christopher James Lahey <clahey@ximian.com>
-
- * configure.in: Changed the required version of gal to 0.19.99.16.
-
-2002-06-02 Larry Ewing <lewing@ximian.com>
-
- * configure.in: require gtkhtml-1.1.1.1 aka multicite branch.
-
-2002-05-14 Dan Winship <danw@ximian.com>
-
- * data/evolution.1: Document "evolution default:mail"
-
-2002-05-08 Ettore Perazzoli <ettore@ximian.com>
-
- * README: Add an explanation/warning about why we want Berkeley DB
- 3.1.17 and nothing else.
-
-2002-04-28 Larry Ewing <lewing@ximian.com>
-
- * configure.in: require gtkhtml-1.1.1.
-
-2002-04-29 Christopher James Lahey <clahey@ximian.com>
-
- * configure.in (EVO_CHECK_LIB): Bumped the required version number
- of gal to 0.19.99.15.
-
-2002-04-26 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in: Don't generate libibex/Makefile anymore.
-
- * Makefile.am: Removed libibex from SUBDIRS.
-
- * tools/Makefile.am: Don't link with libibex.
-
- * tests/Makefile.am: Same here.
-
-2002-04-22 Christopher James Lahey <clahey@ximian.com>
-
- * configure.in: Require gal 0.19.99.14.
-
-2002-04-17 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Require GAL 0.19.99.13.
-
-2002-04-17 Christopher James Lahey <clahey@ximian.com>
-
- * configure.in: Bumped required gal version number to 0.19.99.12.
-
-2002-04-17 Christopher James Lahey <clahey@ximian.com>
-
- * configure.in: Bumped required gal version number to 0.19.99.11.
-
-2002-04-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in: Add checks for gethostbyaddr_r
-
-2002-04-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in: Check for socklen_t and if it doesn't exist,
- define it as unsigned int.
-
-2002-04-04 JP Rosevear <jpr@ximian.com>
-
- * configure.in: Fix static linking on solaris which doesn't have a
- static libresolv.
-
-2002-04-01 Chris Toshok <toshok@ximian.com>
-
- * libversit/vobject.c (newStrItem): only include if USE_STRTBL is
- defined.
- (deleteStrItem): same.
- (hashStr): same.
- (lookupStr): if USE_STRTBL is defined, use existing behavior. if
- not defined, just dup the string.
- (unUseStr): if USE_STRTBL is defined, use existing behavior. if
- not defined, just free the string.
-
-2002-04-01 Dan Winship <danw@ximian.com>
-
- Darwin/OS X portability from Max Horn <max@quendi.de>
-
- * libversit/vcc.y: Remove #include <malloc.h>.
-
- * libversit/vobject.c: Likewise, and #include <stdlib.h>
-
-2002-03-30 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Add argument `--enable-shlib-components'. New
- substitutions OAF_SHLIB_LOCATION, OAF_SHLIB_PREFIX,
- OAF_SHLIB_SUFFIX.
-
-2002-03-29 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Check for GConf. Add gthreads to LIBIBEX_CFLAGS
- and LIBIBEX_LIBS.
-
-2002-03-28 Christopher James Lahey <clahey@ximian.com>
-
- * configure.in: Bumped the required version of gal to 0.19.99.10.
-
-2002-03-24 Peter Williams <peterw@ximian.com>
-
- * tools/killev: Change the OAFIID for the GtkHTML editor to
- have :1.1 at the end.
-
-2002-03-19 Dan Winship <danw@ximian.com>
-
- * tools/Makefile.am (evolution_addressbook_import_LDADD):
- s/libversit.la/libversit.a/
-
-2002-03-13 Chris Toshok <toshok@ximian.com>
-
- * configure.in (EVOLUTION_ADDRESSBOOK_DEPS): add gal.
-
-2002-03-12 Christopher James Lahey <clahey@ximian.com>
-
- * configure.in: Bumped the required version of gal.
-
-2002-03-06 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in: Allow the user to enable OpenSSL over Mozilla NSS
- using --enable-openssl or --disable-nss.
-
-2002-02-24 jacob berkman <jacob@ximian.com>
-
- * sounds/Makefile.am (EXTRA_DIST): add $(sounds_DATA)
-
-2002-02-22 Larry Ewing <lewing@ximian.com>
-
- * configure.in: add libglade the to the E_UTIL flags.
-
-2002-02-13 Christopher James Lahey <clahey@ximian.com>
-
- * configure.in: Bumped the required version of gal.
-
-2002-02-12 Tivo Leedjrv <leedjarv@interest.ee>
-
- * configure.in: Added et to ALL_LINGUAS.
-
-2002-02-09 JP Rosevear <jpr@ximian.com>
-
- * configure.in: make sure PISOCK cflags are added where
- appropriate
-
-2002-02-08 Damon Chaplin <damon@ximian.com>
-
- * Makefile.am (SUBDIRS): added sounds.
-
- * configure.in (AC_OUTPUT): added sounds/Makefile.
-
- * sounds/Makefile.am: new file.
- * sounds/default_alarm.wav: default alarm sound, currently only used
- when vCalendar files are imported with audio alarms. We need a better
- sound.
-
-2002-02-07 Christopher James Lahey <clahey@ximian.com>
-
- * configure.in: Bumped the required version of gal.
-
-2002-01-28 Radek Doulik <rodo@ximian.com>
-
- * configure.in: added bonobo to filter flags to avoid compile
- error
-
-2002-01-27 Ettore Perazzoli <ettore@ximian.com>
-
- * tools/Makefile.am: Use GNOME_FULL_LIBS and GNOME_FULL_CFLAGS.
-
- * configure.in: Define the CAMEL_{CFLAGS,LIBS} using
- EVO_SET_COMPILE_FLAGS. Likewise define E_UTIL_{CFLAGS,LIBS},
- E_NAME_{CFLAGS,LIBS}, SHELL_{CFLAGS,LIBS},
- IMPORTERS_{CFLAGS,LIBS}, WOMBAT_{CFLAGS,LIBS} and
- E_WIDGETS_{CFLAGS,LIBS}, LIBFILTER_{CFLAGS,LIBS}. Remove
- GAL_{LIBS,CFLAGS}. Add GNOME_FULL_{CFLAGS,LIBS}. Also, move all
- this stuff after OpenSSL check so they benefit from all the
- cflags/ldflags discoveries for the support libraries.
-
-2002-01-25 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Require gal 0.19.99.1.
-
-2002-01-24 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Define a new macro EVO_SET_COMPILE_FLAGS. Define
- EVOLUTION_ADDRESSBOOK_CFLAGS, EVOLUTION_ADDRESSBOOK_LIBS,
- EVOLUTION_ADDRESSBOOK_CONDUIT_CFLAGS,
- EVOLUTION_ADDRESSBOOK_CONDUIT_LIBS, EVOLUTION_SUMMARY_LIBS,
- EVOLUTION_SUMMARY_CFLAGS, EVOLUTION_CALENDAR_LIBS,
- EVOLUTION_CALENDAR_CFLAGS, EVOLUTION_CALENDAR_CONDUIT_LIBS,
- EVOLUTION_CALENDAR_CONDUIT_CFLAGS through it. Remove SOUP_CFLAGS
- and SOUP_LIBS.
-
-2002-01-15 Iain Holmes <iain@ximian.com>
-
- * configure.in: Add a check for libsoup. Define SOUP_CFLAGS and
- SOUP_LIBS
-
- * README: Update to include the SOUP dependancy.
-
-2002-01-04 Pablo Saratxaga <pablo@mandrakesoft.com>
-
- * configure.in: Added "eu" to ALL_LINGUAS
-
-2001-12-17 Dan Winship <danw@ximian.com>
-
- * configure.in (camel_providerdir): Define this here, using only
- EVOLUTION_MAJOR_VERSION and EVOLUTION_MINOR_VERSION (and not MICRO
- and NANO).
-
-2001-12-13 Chris Toshok <toshok@ximian.com>
-
- * configure.in: check for alloca.h.
-
-2001-12-12 Ettore Perazzoli <ettore@ximian.com>
-
- [Fix #16358, No man page for Evolution.]
-
- * data/Makefile.am (man_MANS): Install the man page.
-
- * data/evolution.1: New man page for Evolution.
-
-2001-12-10 JP Rosevear <jpr@ximian.com>
-
- * configure.in: use UTF-8 as the char set when testing pilot link
-
-2001-12-11 Ettore Perazzoli <ettore@ximian.com>
-
- * data/evolution.desktop.in (_Name): "Ximian Evolution", not
- "Evolution".
-
-2001-12-11 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Up VERSION to 1.1.0.99.
-
-2001-12-06 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in: s/PREVIEW_VERSION/VERSION_COMMENT
-
-2001-12-04 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in: Add a AC_DEFINE for PREVIEW_RELEASE which is a
- string that will be appended to the X-Mailer header.
-
-2001-11-21 Jeffrey Stedfast <fejj@ximian.com>
-
- * README: Updated. Don't say that the user needs to copy their
- mozilla database files into ~/evolution, since Evolution now
- builds it's own default database files if they don't exist and
- also remove instructions for building with OpenSSL.
-
- * acconfig.h: Remove HAVE_OPENSSL define
-
- * configure.in: Remove checks for OpenSSL libraries.
-
-2001-11-20 Wang Jian <lark@linux.net.cn>
-
- * configure.in(ALL_LINGUAS): Re-Added zh_CN. It is checked
- against gettext 0.10.40 and 0.10.35 without any problem.
- Please contact me if anyone wants to disable it (AGAIN).
-
-2001-11-19 Abel Cheung <maddog@linuxhall.org>
-
- * configure.in: I will keep adding zh_TW to ALL_LINGUAS before
- somebody is willing to tell me why it is deleted without
- reason. It was checked against newest gettext (0.10.40) and
- older gettext (0.10.35) without any problem. A few
- translations are not removed from ALL_LINGUAS even though
- they failed in msgfmt checking.
-
-2001-11-14 Ettore Perazzoli <ettore@ximian.com>
-
- * README: Updated.
-
- * configure.in: 0.99.2. Require gtkhtml 0.16.1 and GAL 0.18.1.
-
-2001-11-14 Ettore Perazzoli <ettore@ximian.com>
-
- * NEWS: Redone with the bug #s from Bugzilla.
-
-2001-11-14 Federico Mena Quintero <federico@ximian.com>
-
- * NEWS: Calendar/tasks NEWS.
-
-2001-11-13 JP Rosevear <jpr@ximian.com>
-
- * configure.in: restore cflags and ldflags properly
-
-2001-11-12 JP Rosevear <jpr@ximian.com>
-
- * configure.in: save the ldflags properly
-
-2001-11-09 JP Rosevear <jpr@ximian.com>
-
- * configure.in: Check to make sure pilot-link has the charset
- conversion stuff enabled
-
-2001-11-09 Ettore Perazzoli <ettore@ximian.com>
-
- * tools/killev: Chop the output from `uname -s'. Thanks to
- Michael Gerdts for suggesting the fix.
-
-2001-11-09 Abel Cheung <maddog@linux.org.hk>
-
- * configure.in: Re-added zh_TW to ALL_LINGUAS. Translator keep
- complaining to me, and waste a month before discovering it was
- disabled while I know nothing about it. Please at least complain
- to me if it's gettext problem.
-
-2001-11-06 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Up to 0.99.1 for snapshot purposes.
-
-2001-11-05 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Upgrade version number to 0.99.0. Require GtkHTML
- 0.16 and GAL 0.18.
-
-2001-11-05 JP Rosevear <jpr@ximian.com>
-
- * NEWS: Small update
-
-2001-11-05 Ettore Perazzoli <ettore@ximian.com>
-
- * NEWS: Updated.
-
-2001-10-31 Ettore Perazzoli <ettore@ximian.com>
-
- * data/evolution.desktop.in (Icon): evolution.png instead of
- evolution-icon.png.
-
-2001-10-31 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Update version to 0.17.100.
-
-2001-10-31 JP Rosevear <jpr@ximian.com>
-
- * NEWS (Conduits): update
-
-2001-10-30 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Add oaf to MAILER_CFLAGS and MAILER_LIBS too.
-
-2001-10-30 Jeffrey Stedfast <fejj@ximian.com>
-
- * NEWS (Mailer): Updated mailer NEWS.
-
-2001-10-30 <NotZed@Ximian.com>
-
- * NEWS (Mailer): My mailer news.
-
-2001-10-30 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Add oaf to the BONOBO_VFS_GNOME_CFLAGS too.
-
-2001-10-30 Federico Mena Quintero <federico@ximian.com>
-
- * NEWS (Calendar): Calendar NEWS.
-
-2001-10-30 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Add oaf to the BONOBO_GNOME_LIBS,
- BONOBO_GNOME_CFLAGS, BONOBO_HTML_GNOME_LIBS,
- BONOBO_HTML_GNOME_CFLAGS.
-
-2001-10-30 Federico Mena Quintero <federico@ximian.com>
-
- * configure.in: Require GAL version 0.15.99.10. I know you all
- love this.
-
-2001-10-30 Radek Doulik <rodo@ximian.com>
-
- * configure.in: require gtkhtml version 0.15.99.2
-
-2001-10-29 Damon Chaplin <damon@ximian.com>
-
- * configure.in (ALL_LINGUAS): added en_AU (copied en_GB).
-
-2001-10-30 Christopher James Lahey <clahey@ximian.com>
-
- * configure.in: Require gal 0.15.99.9.
-
-2001-10-30 <notzed@ximian.com>
-
- * configure.in: Move the configure version number check down
- a bit for gtkhtml/gal, c'ause i'm sick of fixing a manual
- patch i have every bloody time the version changes.
-
-2001-10-29 Joe Shaw <joe@ximian.com>
-
- * configure.in: Require gal 0.15.99.8
-
- * addressbook/backend/ebook/e-card-simple.c,
- addressbook/gui/component/addressbook-storage.c,
- addressbook/gui/widgets/e-addressbook-view.c,
- calendar/gui/e-calendar-table.c,
- calendar/gui/e-itip-control.c,
- calendar/gui/e-meeting-model.c,
- calendar/gui/itip-utils.c,
- calendar/gui/print.c,
- calendar/gui/alarm-notify/alarm-notify-dialog.c,
- filter/rule-editor.c,
- mail/mail-config.c,
- mail/mail-folder-cache.c,
- mail/mail-format.c,
- mail/mail-local.c,
- mail/mail-ops.c,
- mail/mail-vfolder.c,
- shell/e-local-storage.c,
- shell/e-summary-storage.c: Change includes of
- e-util/e-unicode-i18n.h to gal/util/e-unicode-i18n.h
-
- * e-util/Makefile.am: Don't build e-unicode-i18n.[ch] anymore.
-
-2001-10-29 Christopher James Lahey <clahey@ximian.com>
-
- * NEWS (Addressbook): Added my addressbook changes.
-
-2001-10-29 Ettore Perazzoli <ettore@ximian.com>
-
- * AUTHORS: Add Larry and Radek.
-
-2001-10-30 Radek Doulik <rodo@ximian.com>
-
- * configure.in: require gtkhtml version 0.15.99.1
-
-2001-10-29 Rodrigo Moya <rodrigo@ximian.com>
-
- * configure.in: added calendar/importers/Makefile
-
-2001-10-29 Christopher James Lahey <clahey@ximian.com>
-
- * configure.in: Bumped required version of gal to 0.15.99.7.
-
-2001-10-28 JP Rosevear <jpr@ximian.com>
-
- * data/Makefile.am: no need to use destdir
-
-2001-10-27 Christopher James Lahey <clahey@ximian.com>
-
- * configure.in: Bumped required version of gal to 0.15.99.6.
-
-2001-10-27 Dan Winship <danw@ximian.com>
-
- * configure.in: Change the help string on "--enable-nntp" to
- mention the fact that NNTP support is incomplete and unsupported.
- If the user doesn't pass --enable-nntp, don't mention NNTP at all
- in the summary at the end. Also, mention which SSL library is
- being used when SSL support is enabled, and don't mention anything
- about S/MIME since it doesn't work.
-
-2001-10-26 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: GAL 0.15.99.5.
-
-2001-10-26 Kevin Breit <mrproper@ximian.com>
-
- * AUTHORS: Updated my email address.
-
-2001-10-26 <NotZed@Ximian.com>
-
- * configure.in: Bump gal requirement.
-
-2001-10-23 Chris Toshok <toshok@ximian.com>
-
- * tools/killev: and add a way to get some more spew about the
- commands we're executing.
-
-2001-10-23 Chris Toshok <toshok@ximian.com>
-
- * tools/killev: use eq instead of ==.
-
-2001-10-23 Christopher James Lahey <clahey@ximian.com>
-
- * configure.in: Bumped required GAL to 0.15.99.3 so EEntry's
- "draw_button" argument can be used in
- addressbook/gui/component/select-names/e-select-names.c.
-
-2001-10-22 Damon Chaplin <damon@ximian.com>
-
- * configure.in: bumped required GAL to 0.15.99.2.
-
-2001-10-22 Ettore Perazzoli <ettore@ximian.com>
-
- * acconfig.h: HAVE_KDE_APPLNK.
-
- * configure.in (EVO_CHECK_LIB): AC_DEFINE `HAVE_KDE_APPLNK' in the
- case in which the kde applnk dir is found. Also fix the logic
- with the checking so it doesn't get fooled.
-
-2001-10-22 JP Rosevear <jpr@ximian.com>
-
- * data/Makefile.am: include destdir in the path of the kde desktop
- installation dir
-
-2001-10-20 Ettore Perazzoli <ettore@ximian.com>
-
- * data/Makefile.am [HAVE_KDE_APPLNK]: Install `evolution.desktop'
- in the `KDE_APPLNK_DIR'.
-
- * configure.in: New option `--with-kde-applnk-path'. Define the
- `HAVE_KDE_APPLNK' Automake conditional, and the `KDE_APPLNK_DIR'
- value.
-
-2001-10-19 Dan Winship <danw@ximian.com>
-
- * tools/Makefile.am (EXTRA_DIST): Merge the two EXTRA_DIST
- declarations together so they both happen.
-
-2001-10-18 Chris Toshok <toshok@ximian.com>
-
- * tools/killev: use a new fangled perl script that queries oaf for
- interfaces we want to kill.
-
-2001-10-18 Christopher James Lahey <clahey@ximian.com>
-
- * configure.in: Bumped the required version of gal to 0.15.99.1
- for use in evolution-addressbook-export.
-
- * tools/.cvsignore: Added evolution-addressbook-clean,
- evolution-addressbook-export, evolution-addressbook-import, and
- .libs.
-
- * tools/Makefile.am: Added evolution-addressbook-clean,
- evolution-addressbook-export, and evolution-addressbook-import.
-
- * tools/evolution-addressbook-clean.in: Main script to clean up
- the local contact database.
-
- * tools/evolution-addressbook-export.c: Exports the local
- addressbook to the specified file
- (--output-file). If no --output-file is given, writes out to a
- unique file in the /tmp directory. In either case, prints the
- filename to stdout.
-
- * tools/evolution-addressbook-import.c: Imports the specified file
- (--input-file) to the local addressbook.
-
-2001-10-18 Wang Jian <lark@linux.net.cn>
-
- * configure.in(ALL_LINGUAS): Added zh_CN for Simplified Chinese.
-
-2001-10-17 Christopher James Lahey <clahey@ximian.com>
-
- * NEWS (Addressbook): Wrote Addressbook news.
-
-2001-10-12 Chris Toshok <toshok@ximian.com>
-
- * tools/killev: kill evolution-ldif-importer.
-
-2001-10-11 Federico Mena Quintero <federico@ximian.com>
-
- * configure.in (AC_OUTPUT): Fix the order of the help/ subdirs.
- These must be sorted as a preorder walk for a tree!
-
-2001-10-10 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: 0.16.99.
-
-2001-10-10 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: 0.16. Require GtkHTML 0.15 or later and GAL 0.14
- or later. Also, make $with_nspr_includes default to
- `/usr/include/nspr' instead of `/usr/include/mozilla' and
- $with_nss_includes to `/usr/include/moznss' instead of
- `/usr/include/mozilla'.
-
-2001-10-10 Ettore Perazzoli <ettore@ximian.com>
-
- * NEWS: Added info about the shell, plus some minor fixes for
- consistency.
-
-2001-10-10 Christopher James Lahey <clahey@ximian.com>
-
- * NEWS (Addressbook): Updated.
-
-2001-10-09 Federico Mena Quintero <federico@ximian.com>
-
- * NEWS (Calendar): Calendar NEWS.
-
-2001-10-09 <NotZed@Ximian.com>
-
- * NEWS (Mailer): Updated for beta 6.
-
-2001-10-09 Rodrigo Moya <rodrigo@ximian.com>
-
- * configure.in: add libart to list of libraries to use in
- EXTRA_GNOME_CFLAGS/LIBS, which is needed for latest libart versions
-
-2001-10-09 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: AC_OUTPUT(default_user/local/Makefile) before
- AC_OUTPUT()ing the other subdirs of `default_user/local'. Fix
- pointed out by Dmitry G. Mastrukov <dmitry@fitmark.net>.
-
-2001-10-07 Dan Winship <danw@ximian.com>
-
- * configure.in: Remove movemail check, since it's not relevant any
- more.
-
-2001-10-05 Larry Ewing <lewing@ximian.com>
-
- * configure.in: Bumped required version of gtkhtml to 0.14.99.1
-
-2001-10-05 Christopher James Lahey <clahey@ximian.com>
-
- * configure.in: Bumped required version of gal to 0.13.99.1.
-
-2001-10-01 Aaron Weber <aaron@ximian.com>
-
- * help/C/Makefile.am: removed an extraneous tab.
-
-2001-10-01 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: 0.15.99.
-
-2001-10-01 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: 0.15. Require gal 0.13 and gtkhtml 0.14.
-
-2001-10-01 Christopher James Lahey <clahey@ximian.com>
-
- * NEWS (Addressbook): Added more news.
-
-2001-09-30 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in (nspr_libs): Order the linkline to be the same as
- the order in Mozilla (it is suggested that they be in this order).
- (nss_libs): Same.
-
-2001-09-27 Dan Winship <danw@ximian.com>
-
- * configure.in: Remove references to the "compose" program, since
- that functionality went into the shell.
- (AC_OUTPUT): Sort and remove duplicates.
-
- * cmdline/*: gone
-
-2001-09-26 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in: Added a flag to enable pedantic PGP/MIME - this is
- not recommended for end-users. It is mostly meant for testing
- purposes.
-
-2001-09-26 Chris Toshok <toshok@ximian.com>
-
- * configure.in: make sure the solaris network libs get added to
- the LDAP link line before we test for openldap. Thanks to Frank
- Belew for finding this.
-
-2001-09-22 Christopher James Lahey <clahey@ximian.com>
-
- * configure.in: Bumped the required version of gal to 0.12.99.0.
-
-2001-09-21 Nat Friedman <nat@ximian.com>
-
- * configure.in (EVOLUTION_MICRO_VERSION): Changed to 99.
- (VERSION): Added ".$EVOLUTION_MICRO_VERSION" suffix.
-
-2001-09-21 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Bump version to 0.14. Depend on gal >= 0.12,
- gtkhtml >= 0.13.
-
-2001-09-21 Michael Zucchi <NotZed@Ximian.com>
-
- * NEWS (Mail): Updated.
-
-2001-09-21 Christopher James Lahey <clahey@ximian.com>
-
- * NEWS (Addressbook): Added more NEWS items here.
-
-2001-09-19 JP Rosevear <jpr@ximian.com>
-
- * configure.in: Remove dead directory from AC_OUTPUT
-
-2001-09-16 Christopher James Lahey <clahey@ximian.com>
-
- * configure.in: Updated required version of gal to 0.11.99.4.
-
-2001-09-14 JP Rosevear <jpr@ximian.com>
-
- * configure.in: remove unneeded conditionals
-
-2001-09-13 Yanko Kaneti <yaneti@declera.com>
-
- * configure.in (ALL_LINGUAS): Added bg to ALL_LINGUAS.
-
-2001-09-13 Larry Ewing <lewing@ximian.com>
-
- * data/evolution.mime: override the gnome-vfs.mime to match .vcf
- as text/x-vcard.
-
-2001-09-11 JP Rosevear <jpr@ximian.com>
-
- * configure.in: temporarily disable zh_TW
-
-2001-09-10 Abel Cheung <maddog@linux.org.hk>
-
- * configure.in: Added "zh_TW" to ALL_LINGUAS.
-
-2001-09-07 Dan Winship <danw@ximian.com>
-
- * configure.in: one-line OpenSSL fix from Yanko Kaneti
- <yaneti@declera.com>
-
-2001-09-05 Ettore Perazzoli <ettore@ximian.com>
-
- * README: Updated slightly.
-
-2001-09-04 Ettore Perazzoli <ettore@ximian.com>
-
- [Fixes by Neil Conway <neilconway@home.com, as per #8090.]
-
- * configure.in: Fix the error message if scrollkeeper is not found.
-
- * README: A bunch of minor fixes, tweaks and cleanups.
-
-2001-09-04 Ettore Perazzoli <ettore@ximian.com>
-
- [Fix #8089, Undocumented Scrollkeeper dependency.]
-
- * README: Add scrollkeeper 0.1.4 to the list of dependencies.
-
-2001-09-04 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in: Only check for OpenSSL if we were not able to find
- Mozilla's NSS libraries.
-
-2001-09-04 Peter Williams <peterw@ximian.com>
-
- * omf-install/Makefile.am (install-data-local): Don't put
- $(srcdir) in the file path twice.
-
-2001-09-01 Christopher James Lahey <clahey@ximian.com>
-
- * configure.in: Bumped the required version of gal to 0.11.99.2.
-
-2001-08-31 Zbigniew Chyla <cyba@gnome.pl>
-
- * configure.in: Bumped required version of GAL to 0.11.3
- (for g_utf8_collate)
-
-2001-08-24 Ettore Perazzoli <ettore@ximian.com>
-
- [Patch from Nike Gerdts <michael.gerdts@usa.alcatel.com> for
- #6882, DB3_CFLAGS and DB3_LDFLAGS order messes up CPPFLAGS and
- LDFLAGS.]
-
- * configure.in: Put DB3_CFLAGS before the already-defined CPPFLAGS
- instead of after them; likewise, put DB3_LDADD before the already
- defined LDADD.
-
-2001-08-24 Dan Winship <danw@ximian.com>
-
- * configure.in: We don't need to check for both bonobo-conf 0.11
- AND bonobo-conf 0.2.
-
-2001-08-22 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: 0.13.99.
-
-2001-08-22 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Bump requirements to GAL 0.11, bonobo-conf 0.11,
- GtkHTML 0.12. Don't autogen
- `doc/devel/executive-summary/Makefile'. Bump version number to
- 0.13.
-
-2001-08-21 Ettore Perazzoli <ettore@ximian.com>
-
- * NEWS (Global): Added.
-
-2001-08-21 Christopher James Lahey <clahey@ximian.com>
-
- * NEWS (Addressbook): Updated NEWS for addressbook.
-
-2001-08-21 Peter Williams <peterw@ximian.com>
-
- * NEWS (Mail): Updated some more.
-
-2001-08-21 Jeffrey Stedfast <fejj@ximian.com>
-
- * NEWS: Updated.
-
-2001-08-20 Jon Trowbridge <trow@ximian.com>
-
- * configure.in: Require gal 0.10.99.5.
-
-2001-08-19 Aaron Weber <aaron@ximian.com>
-
- *Makefile.am: added "help" to subdirs.
-
-2001-08-19 Chris Toshok <toshok@ximian.com>
-
- * omf-install/Makefile.am (scrollkeeper_localstate_dir) use
- $(SCROLLKEEPER_LOCALSTATE_DIR), and not something based on
- evolution's local state dir. this should fix the core dumps
- during install on freebsd and solaris.
-
- * configure.in (GLIB_CONFIG): use $GLIB_CONFIG if it's set,
- otherwise default to glib-config. a cheap solution to get this
- working on freebsd (where they have glib12-config, but not
- glib-config.) also, switch all `glib-config`s to `$GLIB_CONFIG`.
- (SCROLLKEEPER_LOCALSTATE_DIR): use scrollkeeper-config to figure
- this out, and AC_SUBST so omf-install/Makefile.am can use it.
-
-2001-08-17 Iain Holmes <iain@ximian.com>
-
- * Makefile.am: Move the libical compile order.
-
-2001-08-16 "Big Iain" Holmes <iain@ximian.com>
-
- * configure.in: Add widgets/e-timezone-dialog/Makefile
-
-2001-08-16 Jason Leach <jleach@ximian.com>
-
- * AUTHORS: I know what you did last summer!
-
-2001-08-16 Jon Trowbridge <trow@ximian.com>
-
- * configure.in: Require gal 0.10.99.3.
-
-2001-08-16 Kjartan Maraas <kmaraas@gnome.org>
-
- * README: Some info on adding --localstatedir to the configure
- options.
- * Makefile.am: Added omf-install to the build.
- * configure.in: Adjust for the move of the user docs.
-
-2001-08-15 Kjartan Maraas <kmaraas@gnome.org>
-
- * configure.in: Addded missing dirs to the build. Add checks for
- scrollkeeper and jw to get the docs building on later Red Hat's.
- * omf-install/*: Added this for integration with scrollkeeper.
-
-2001-08-14 Dan Winship <danw@ximian.com>
-
- * configure.in (LDAP_LIBS): Remove an obvious typo reported by
- Miles
-
-2001-08-11 Kjartan Maraas <kmaraas@gnome.org>
-
- * README: Be truthful about the versions of libs we need.
-
-2001-08-10 Chris Toshok <toshok@ximian.com>
-
- * configure.in: if libldap.la is there, default to static linking
- of openldap. if it's not, default to dynamic. also, provide
- --with-static-ldap for users that want to override these defaults.
-
-2001-08-09 Chris Toshok <toshok@ximian.com>
-
- * configure.in: link statically with OpenLDAP.
-
-2001-08-09 Jon Trowbridge <trow@ximian.com>
-
- * configure.in: Require GAL 0.10.99.2.
-
-2001-08-09 Christopher James Lahey <clahey@ximian.com>
-
- * tools/killev: Added #!/bin/sh
-
-2001-08-08 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in: Don't link to libnssckbi3 when linking to nss.
-
-2001-08-08 JP Rosevear <jpr@ximian.com>
-
- * README: Update pilot information
-
-2001-08-07 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Require gal 0.10.99.1 or greater.
-
-2001-08-05 Ettore Perazzoli <ettore@ximian.com>
-
- [Fixes #5594, "killev doesn't kill all evolution processes".]
-
- * tools/killev: Added bonobo-moniker-xmldb, gnome-gtkhtml-editor
- and gnome-spell-component.
-
-2001-07-31 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Bump version number to 0.12.99.
-
-2001-07-31 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Ooops. We want GAL >= 0.10.0 and GtkHTML >=
- 0.11.0.
-
-2001-07-31 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Remove `$EVOLUTION_MICRO_VERSION' from `VERSION'.
- (EVO_CHECK_LIB):
-
-2001-07-31 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Bump version number to 0.12.0.
-
-2001-07-31 Ettore Perazzoli <ettore@ximian.com>
-
- * NEWS: Added info about the shell changes and slightly changed
- the formatting for the addressbook ones.
-
- * configure.in: Require GtkHTML 0.10.0 and GAL 0.9.0.
-
-2001-07-31 Christopher James Lahey <clahey@ximian.com>
-
- * NEWS (Addressbook): Updated NEWS for addressbook.
-
-2001-07-31 Larry Ewing <lewing@ximian.com>
-
- * configure.in: bump required version of gtkhtml to 0.10.99.
-
-2001-07-20 JP Rosevear <jpr@ximian.com>
-
- * configure.in: Bump to 0.11.99
-
-2001-07-17 Dan Winship <danw@ximian.com>
-
- * configure.in: Fix up the "exactly version N" case of EVO_CHECK_LIB
-
-2001-07-16 Not Zed <NotZed@Ximian.com>
-
- * configure.in: Changed to use test -h instead of -L for checking
- /var/mail vs /var/spool/mail
-
-2001-07-13 JP Rosevear <jpr@ximian.com>
-
- * NEWS: more updates
-
-2001-07-13 Jeffrey Stedfast <fejj@ximian.com>
-
- * NEWS (Mail): Merged mine and Peter's entries.
-
-2001-07-12 JP Rosevear <jpr@ximian.com>
-
- * NEWS: Start new entry
-
-2001-07-11 Peter Williams <peterw@ximian.com>
-
- * acconfig.h: Add HAVE_BROKEN_SPOOL here.
-
-2001-07-10 Peter Williams <peterw@ximian.com>
-
- * configure.in (have_nss_includes): Fix nss include check to work.
-
-2001-07-11 Not Zed <NotZed@Ximian.com>
-
- * configure.in: Added option --with-broken-spool for solaris mbox
- spool format.
-
-2001-07-10 Marius Andreiana <mandreiana@yahoo.com>
-
- * configure.in: Added ro (Romanian) to ALL_LINGUAS
-
-2001-07-05 Peter Williams <peterw@ximian.com>
-
- * configure.in (SYSTEM_MAIL_DIR): Make sure /var/mail
- isn't a symbolic link such as on Red Hat 7.
-
-2001-07-05 Christopher James Lahey <clahey@ximian.com>
-
- * configure.in: Upped the required version of gal.
-
-2001-07-03 Dietmar Maurer <dietmar@ximian.com>
-
- * *: use bonobo-conf everywhere
-
-2001-07-03 Damon Chaplin <damon@ximian.com>
-
- * configure.in (MAILER_LIBS):
- (MAILER_CFLAGS): added bonobo_conf.
-
-2001-07-02 Christopher James Lahey <clahey@ximian.com>
-
- * configure.in: Made evolution depend on bonobo-conf 0.2.
-
-2001-07-02 Larry Ewing <lewing@ximian.com>
-
- * configure.in: Check for gtkhtml 0.9.99.1.
-
-2001-07-02 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in: Check for libGal 0.8.99.7.
-
-2001-07-02 Peter Williams <peterw@ximian.com>
-
- * configure.in (evolution_db_version): s,AC_DEFINE,AC_DEFINE_UNQUOTED
- to make these not totally useless.
-
-2001-07-01 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am (SUBDIRS): Build the composer after the addressbook,
- as it needs some CORBA stuff from the latter.
-
-2001-06-30 Federico Mena Quintero <federico@ximian.com>
-
- * tools/killev: Added evolution-alarm-notify.
-
-2001-06-29 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Require GAL 0.8.99.6.
-
-2001-06-29 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Add `camel/tests/mime-filter/Makefile' to the
- `AC_OUTPUT()' list.
-
-2001-06-27 Peter Williams <peterw@ximian.com>
-
- * configure.in (gal): Bump required gal version for new accessors
- in ETree.
-
-2001-06-24 Chris Toshok <toshok@ximian.com>
-
- * configure.in: add addressbook/gui/contact-list-editor, and
- correct path of contact-editor.
-
-2001-06-21 Rodrigo Moya <rodrigo@gnome-db.org>
-
- * libwombat/: added new directory for the libwombat library, which
- will contain the implementation of all CORBA interfaces defined
- in the wombat.idl file
-
-2001-06-21 Dan Winship <danw@ximian.com>
-
- * configure.in: Fix the OpenLDAP check to default to "no" if you
- don't specify anything.
-
-2001-06-20 Kevin Breit <battery841@mediaone.net>
-
- * docs/C/usage-sync: Reworded a little bit for more descrip.
-
-2001-06-20 Kevin Breit <battery841@mediaone.net>
-
- * doc/C/usage-calendar.sgml: Documented categorizing an event.
-
-2001-06-20 Kevin Breit <battery841@mediaone.net>
-
- * doc/C/usage-mail.sgml: Updated Bcc: example
-
-2001-06-20 Dan Winship <danw@ximian.com>
-
- * configure.in: Change --enable-ldap to --with-openldap, allow a
- path prefix as an argument. Add some libtooly goodness to the
- libldap check in case it depends on ssl libraries.
-
-2001-06-19 Dan Winship <danw@ximian.com>
-
- * configure.in: Tweak the db3 header check to like our RH7 build
- machine again.
-
-2001-06-19 Christopher James Lahey <clahey@ximian.com>
-
- * libversit/vcc.y (LexBuf): Changed buf to an int here.
- (lexGetQuotedPrintable): Changed cur to an int here.
-
-2001-06-18 Dan Winship <danw@ximian.com>
-
- * configure.in: Add "--with-db3" to fill in both
- --with-db3-includes and --with-db3-libs. Make them get cached
- properly so you don't need to specify it every time. Simplify some
- code.
-
- * acconfig.h: Add #defines for the current supported db3 version
- so that when we change it we don't have to hunt all of them down
-
-2001-06-18 Dan Winship <danw@ximian.com>
-
- * configure.in: Check the modes on $system_mail_dir and set up
- variables for camel/Makefile to make camel-lock-helper
- setuid/setgid.
-
-2001-06-11 JP Rosevear <jpr@ximian.com>
-
- * configure.in: One slight db3 check correction
-
-2001-06-11 Chris Toshok <toshok@ximian.com>
-
- * configure.in: fix typo in -ldb3 check.
-
-2001-06-11 JP Rosevear <jpr@ximian.com>
-
- * configure.in: Update db3 configure checks for RedHat. /me beats
- a sleeping cat to death
-
-2001-06-09 Christopher James Lahey <clahey@ximian.com>
-
- * configure.in: Bumped required version of gal to 0.8.99.2.
-
-2001-06-09 Christopher James Lahey <clahey@ximian.com>
-
- * configure.in: Added addressbook/gui/merging/Makefile.
-
-2001-06-08 Jason Leach <jleach@ximian.com>
-
- * my-evolution/Makefile.am (INCLUDES): builddir != srcdir fix.
-
-2001-06-08 Iain Holmes <iain@ximian.com>
-
- * Makefile.am: Byebye executive-summary, hello my-evolution
-
- * configure.in: Remove all the executive-summary Makefiles. Add the
- my-evolution.
-
-2001-06-08 Jon Trowbridge <trow@ximian.com>
-
- * AUTHORS: Vanity, thy name is trow.
-
-2001-06-05 JP Rosevear <jpr@ximian.com>
-
- * config.log: Bump version to 0.10.99
-
-2001-05-31 Christopher James Lahey <clahey@ximian.com>
-
- * README: Included information about db3.
-
- * acconfig.h: Added HAVE_DB_H and HAVE_DB3_DB_H.
-
- * configure.in: Added various checks for db3 libraries and
- includes. Of note are the new configure options
- --with-db3-includes=PREFIX and --with-db3-libs=PREFIX to specify
- the location for your db3 library.
-
-2001-05-31 Christopher James Lahey <clahey@ximian.com>
-
- * configure.in (GTKHTML_DATADIR): Use --moddatadir to derive this.
-
-2001-05-30 Dan Winship <danw@ximian.com>
-
- * configure.in: Bump gal dependency to 0.8.99.1
-
-2001-05-29 JP Rosevear <jpr@ximian.com>
-
- * README: update version requirements
-
-2001-05-23 Dan Winship <danw@ximian.com>
-
- * README: Remove reference to verify-evolution-install.sh since it
- doesn't work any more.
-
- * configure.in (EVO_CHECK_LIB): allow this to take a max version
- too, mostly so we can bound the allowable gal versions for
- releases, but also to require libxml < 2.0.
- (OpenSSL): Fixicate to work on NetBSD (OpenSSL in /usr, no libdl).
-
-2001-05-23 Kjartan Maraas <kmaraas@gnome.org>
-
- * tools/killev: s/evolution-vcard-import/evolution-vcard-importer
-
-2001-05-22 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in: Create MAILER_CFLAGS and MAILER_LIBS so that we
- don't have the same libs multiple times in the libtool
- command-line.
-
-2001-05-20 Duncan Mak <duncan@ximian.com>
-
- * tools/killev (sysname): Add in evolution-vcard-importer as part
- of the list of processes to kill in killev.
-
-2001-05-18 Jon Trowbridge <trow@ximian.com>
-
- * Makefile.am (SUBDIRS): Changed build order. Now addressbook
- gets built before mail.
-
-2001-05-15 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in: Create CAMEL_CFLAGS and CAMEL_LIBS so that we
- don't have to link in all sorts of unnecessary garbage from GNOME
- that we don't need.
-
-2001-05-15 Chris Toshok <toshok@ximian.com>
-
- * tools/killev: add the importers.
-
-2001-05-14 Kevin Breit <battery841@mediaone.net>
-
- * doc/C/evolution-C.omf: added file for Scrollkeeper
-
-2001-05-09 Chris Toshok <toshok@ximian.com>
-
- * configure.in: add the nspr includes to the list of includes used
- to test for NSS headers, and don't assume -lpthread in the
- nss/nspr libs - use PTHREAD_LIB.
-
-2001-05-09 Iain Holmes <iain@ximian.com>
-
- * tools/killev: Added rdf-summary killing stuff from R Burton
- (r.burton@180sw.com)
-
-2001-05-09 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in: OpenSSL LDFLAGS also needs to include -lcrypt
-
-2001-05-08 Iain Holmes <iain@ximian.com>
-
- * Makefile.am: Add the importers subdir.
-
- * configure.in: Make the importers/Makefile
-
-2001-05-08 Christopher James Lahey <clahey@ximian.com>
-
- * configure.in: Bumped check for gal to 0.7.99.3.
-
-2001-05-04 Jeffrey Stedfast <fejj@ximian.com>
-
- * acconfig.h: undef HAVE_SSL and HAVE_OPENSSL
-
- * configure.in: Check for OpenSSL.
-
-2001-05-05 Gediminas Paulauskas <menesis@delfi.lt>
-
- * configure.in: upped required gtkhtml version to 0.9.3, even that is
- not enough for idl changes.
- * README: you need LIB_XML_1_BRANCH. updated all version requirements
- from configure.in
-
-2001-04-26 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Don't autogen
- `executive-summary/widgets/Makefile', as that subdir doesn't get
- distributed anymore.
-
-2001-04-26 Dan Winship <danw@ximian.com>
-
- * README: We no longer depend on libunicode.
-
- * configure.in: Remove check for libunicode. Remove unicode cflags
- and libs from all CFLAGS and LIBS variables. Add GAL_LIBS for
- things that need to depend on just gal (for gunicode).
-
- * configure.in: Check for gethostbyname_r so e_gethostbyname_r
- will DTRT.
-
-2001-04-24 Dan Winship <danw@ximian.com>
-
- * configure.in: Bump up the gal requirement
-
-2001-04-23 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Don't autogen the the Makefile for the importer
- docs.
-
- * Makefile.am (SUBDIRS): Build the docs last.
-
-2001-04-21 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in (have_nspr_libs): We need to link in more than just
- libnspr4, we also need libpthread.
- (have_nss_libs): Don't forget to add nsprlibs to the LDFLAGS.
-
-2001-04-21 Duncan Mak <duncan@ximian.com>
-
- * art/Makefile.am (images_DATA): Added in composer-message.png.
-
-2001-04-16 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: `mail/importers/Makefile' must come after
- `mail/Makefile'.
-
-2001-04-16 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am (SUBDIRS): Add `doc'.
-
- * configure.in: Check for Editor.idl using `$GNOME_PATH' as well.
-
-2001-04-12 Christopher James Lahey <clahey@ximian.com>
-
- * configure.in: Updated the required version of gal to 0.6.99.0.
-
-2001-04-11 JP Rosevear <jpr@ximian.com>
-
- * configure.in: Check if gethostbyname_r take five params
-
- * acconfig.h: add GETHOSTBYNAME_R_FIVE_ARGS
-
-2001-04-10 Gediminas Paulauskas <menesis@delfi.lt>
-
- * AUTHORS: /me is a translator.
- * configure.in (EVO_CHECK_LIB): fail with AC_MSG_ERROR, not echo &&
- exit 1.
-
-2001-04-10 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in (EVOLUTION_DIR): create the makefile in
- camel/tests/smime
-
-2001-04-08 Chris Toshok <toshok@ximian.com>
-
- * tools/killev (sysname): add some more 16 character versions for
- freebsd.
-
-2001-04-04 Kjartan Maraas <kmaraas@gnome.org>
-
- * AUTHORS: Brag.
-
-2001-04-04 Gediminas Paulauskas <menesis@delfi.lt>
-
- * art/evolution-today-mini.png: converted from exec-16-summary.xpm,
- removed the latter.
- * art/evolution-trash.png, art/evolution-trash-mini.png: images for
- trash folder, one converted from deleted_message.xpm, another from mc.
- * art/Makefile.am: install.
-
-2001-04-02 Jeffrey Stedfast <fejj@ximian.com>
-
- * README (SSL): Remind users that they will currently have to copy
- their cert database from their mozilla directory into ~/evolution.
-
-2001-04-01 Gediminas Paulauskas <menesis@delfi.lt>
-
- * art/Makefile.am: added missing (new) files.
-
-2001-03-30 Dan Winship <danw@ximian.com>
-
- * configure.in (EVOLUTION_MICRO_VERSION): Bump this to 10. (We
- forgot to do this before branching *again*...)
-
-2001-03-28 Dan Winship <danw@ximian.com>
-
- * README: add a bit mentioning that if configure claims you don't
- have something installed when you think you do, that it's probably
- because you installed it in the wrong prefix, or because you need
- a -devel package.
-
- * configure.in: Add a new macro EVO_CHECK_LIB that checks for a
- gnome-config-based library of a given version or later, correctly,
- and if doesn't find it, suggests that you consult the README. Fix
- the various library checks to use this. Meanwhile, remove a bunch
- of old cruft and reorganize a little.
-
- * acconfig.h: Remove cruft
-
-2001-03-28 Jon Trowbridge <trow@ximian.com>
-
- * AUTHORS: In a burst of egomania, added myself.
-
-2001-03-26 Radek Doulik <rodo@ximian.com>
-
- * configure.in: create camel/misc/Makefile
-
-2001-03-22 Dan Winship <danw@ximian.com>
-
- * README: Update xml-i18n-tools version
-
-2001-03-22 Jakub Steiner <jimmac@ximian.com>
-
- * art/new-message.xpm: file->new->mail message
- * art/folder.xpm: file->new->folder
- * art/new_appointment.xpm: file->new->appontment
- * art/print-preview.xpm: file->print preview
- * art/configure_16_calendar.xpm: for the tools menu
-
-2001-03-22 Jakub Steiner <jimmac@ximian.com>
-
- * art/splash.png: move it a bit up so the icons fit better
-
-2001-03-22 Christopher James Lahey <clahey@ximian.com>
-
- * configure.in: Bumped gal requirement to 0.5.99.11.
-
-2001-03-22 Jakub Steiner <jimmac@ximian.com>
-
- * art/configure_16_folder.xpm, configure_16_mail.xpm,
- copy_16_message.xpm, edit.xpm, encrypt.xpm,
- evo-16-address-conduit.png, evo-16-calendar-conduit.png,
- evo-16-todo-conduit.png, exec-16-summary.xpm, import.xpm,
- print.xpm, reply_to_all.xpm, reply.xpm, save.xpm,
- send-receive.xpm, work_offline.xpm, find_contact.xpm,
- send-24-receive.png, evo-48-calendar-conduit.png,
- evo-48-todo-conduit.png, import.png, send-48-receive.png,
- move_message.xpm, all_contacts.xpm, forward.xpm,
- configure_16_addressbook.xpm, Makefile.am,
- evo-48-address-conduit.png: renamed icons to make Miguel's
- speedups possible
- * art/evolution-inbox.png: color coded one
- * art/envelope.png: reverted back to the non-color coded one
- * art/evolution-contacts-plain.png: non-color coded one for
- the "new contact" dialogue
-
-2001-03-21 Dan Winship <danw@ximian.com>
-
- * configure.in: Require bison, not yacc (for vcc.y)
-
-2001-03-20 Miguel de Icaza <miguel@ximian.com>
-
- * art/Makefile.am (images_DATA): Added all the new icons to the
- distribution.
-
-2001-03-20 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in: More fixes for NSPR and NSS checks - use fixed it
- to use AC_CHECK_HEADERS instead of AC_CHECK_FILES. Also made it
- not default the nspr lib path to /usr/lib/mozilla which may not be
- in the user's library path when checking for nspr libs.
-
-2001-03-20 Jakub Steiner <jimmac@ximian.com>
-
- * art/48_send-receive.png: send-receive for the s/r dialog
- * art/24_send-receive.png: send-receive to replace the
- fetch-mail-doggie
- * art/16_send-receive.xpm: send-receive for (future) menu
- item
- * art/16_import.xpm: for the file menu
- * art/16_work_offline.xpm: for the file menu
- * AUTHORS: so I can show off
- * art/splash.png: making radek famous ;)
- * art/envelope.png, evolution-calendar.png, evolution-contacts.png,
- evolution-tasks.png, evolution-today.png:
- new concept of color coded apps:
- - mailer: #efb43e
- - calendar: #bab5ab
- - contacts: #9794ab
- - tasks: #6e9e6e
- - exec. summary: #c4757e
-
-2001-03-19 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in: Fix ettore's fix ;-)
-
-2001-03-19 Christopher James Lahey <clahey@ximian.com>
-
- * configure.in: Bumped gal requirement to 0.5.99.8.
-
-2001-03-19 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Make sure we never define `NSPR_CFLAGS' or
- `NSS_CFLAGS' as just "-I".
-
-2001-03-19 Jeffrey Stedfast <fejj@ximian.com>
-
- * NEWS: pulled from the 0.9 release.
-
-2001-03-18 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in: Updated the checks for NSS and NSPR
-
-2001-03-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * README: Added directions on how to build with SSL support.
-
- * configure.in: Updated the checks for NSS and NSPR
-
-2001-03-16 Jakub Steiner <jimmac@ximian.com>
-
- * art/48_import.png: for the import druid
-
-2001-03-15 Dan Winship <danw@ximian.com>
-
- * configure.in: Bump gal requirement to 0.5.99.7
-
-2001-03-15 Gediminas Paulauskas <menesis@delfi.lt>
-
- * configure.in: create doc/devel/executive-summary/Makefile
- * evolution.png: moved to art/.
- * evolution.desktop: moved to data/.
- * Makefile.am: reflect those moves.
- * art/*.xpm: moved 8 files from calendar/gui here.
- * art/Makefile.am: added moved files.
- distribute *.xpm, install *.png and *view.xpm.
-
-2001-03-12 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in: Updated to AC_SUBST the NSPR/NSS flags.
-
-2001-03-14 Dan Winship <danw@ximian.com>
-
- * README: Pull up some of the clarifications from the 0.9 branch
-
-2001-03-13 Chris Toshok <toshok@ximian.com>
-
- * configure.in: add -lresolv to LDAP_LIBS if it's there.
-
-2001-03-13 Iain Holmes <iain@ximian.com>
-
- * configure.in: Added the mail/importers dir.
-
-2001-03-12 Jeffrey Stedfast <fejj@ximian.com>
-
- * README: Rearranged some of the dependencies to try to get them
- into a more correct order (needed for people building all of these
- packages by hand).
-
-2001-03-12 JP Rosevear <jpr@ximian.com>
-
- * README: Update
-
-2001-03-09 Dan Winship <danw@ximian.com>
-
- * configure.in (EVOLUTION_MICRO_VERSION): Hm... probably would be
- clever to be calling this 0.9 rather than 0.8, since it's almost
- 0.10.
-
-2001-03-09 Christopher James Lahey <clahey@ximian.com>
-
- * libversit/vcc.y: Changed int to char when returning a character
- from a stream (since it needs to be able to hold EOF.)
-
-2001-03-07 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in: Removed --enable-assbarn-security and replaced it
- with the real options:
- --with-nspr-includes=PREFIX
- --with-nspr-libs=PREFIX
- --with-nss=PREFIX
-
- * acconfig.h: #undef HAVE_NSS
-
-2001-03-07 Ettore Perazzoli <ettore@ximian.com>
-
- * configure.in: Require GAL 0.5.99.6 or later.
-
-2001-03-07 Kjartan Maraas <kmaraas@gnome.org>
-
- * shell/main: /* xgettext:no-c-format */ before the welcome
- message.
- * configure.in: Don't try to generate a Makefile in
- camel/providers/vee as it's empty.
-
-2001-03-05 JP Rosevear <jpr@ximian.com>
-
- * README: Update pilot instructions
-
-2001-03-05 Christopher James Lahey <clahey@ximian.com>
-
- * configure.in: Check for gal 0.5.99.4.
-
-2001-03-04 Dan Winship <danw@ximian.com>
-
- * configure.in: Reorganize a bit to get rid of warnings about
- AC_TRY_COMPILE being used before AC_ISC_POSIX
-
-2001-03-04 Christopher James Lahey <clahey@ximian.com>
-
- * configure.in: Added views/addressbook/Makefile.
-
-2001-03-02 JP Rosevear <jpr@ximian.com>
-
- * art/Makefile.am: install conduit icons
-
-2001-03-02 Chris Toshok <toshok@ximian.com>
-
- * configure.in: add logic to make sure we're building against OpenLDAP >= 2
-
-2001-03-01 Christopher James Lahey <clahey@ximian.com>
-
- * Makefile.am (SUBDIRS), configure.in: Added views stuff.
-
-2001-03-01 Dan Winship <danw@ximian.com>
-
- * configure.in: Redo the Kerberos stuff again to deal with the
- stuff currently on my machine. I think it should deal with both
- the MIT and KTH versions of both krb4 and krb5 now.
-
-2001-03-01 Jakub Steiner <jimmac@ximian.com>
-
- * art/48_evo-address-conduit.png: 48^2 version of the
- addressbook pilot conduit. (for the new control center)
- * art/16_evo-address-conduit.png: 16x16 version for current
- gnomecc
- * art/48_evo-todo-conduit.png: for new gnomecc
- * art/16_evo-todo-conduit.png: for old gnomecc
- * art/48_evo-calendar-conduit.png: for new gnomecc
- * art/16_evo-calendar-conduit.png: for old gnomecc
-
-2001-03-01 Christopher James Lahey <clahey@ximian.com>
-
- * configure.in: Check for gal 0.5.99.2.
-
-2001-02-19 Christopher James Lahey <clahey@ximian.com>
-
- * configure.in: Check for gal 0.5.99.1.
-
-2001-02-15 Christopher James Lahey <clahey@ximian.com>
-
- * configure.in: Check for gal 0.5.99.0.
-
-2001-02-14 Dan Winship <danw@ximian.com>
-
- * various .cvsignore files: Ignore generated .oaf files
-
-2001-02-13 JP Rosevear <jpr@ximian.com>
-
- * art/Makefile.am: install new files
-
- * art/*view.xpm: add files from calendar/gui
-
-2001-02-11 Chris Toshok <toshok@ximian.com>
-
- * configure.in: rework ldap check logic so it'll work to
- --disable-ldap if you've previously configured with --enable-ldap.
-
-2001-02-11 Gediminas Paulauskas <menesis@delfi.lt>
-
- * data/evolution.keys, evolution.desktop: removed, they are generated.
- * data/evolution.keys.in, evolution.desktop.in: new untranslated files.
- * data/evolution.desktop: removed, it duplicates above.
- * Makefile.am, data/Makefile.am: reflect above changes, merge
- translations.
-
-2001-02-09 Jeffrey Stedfast <fejj@ximian.com>
-
- * configure.in: Added hacks to check for Mozilla libs like nspr
- and nss that we will need for SSL and S/MIME.
-
-2001-02-09 Michael Meeks <michael@ximian.com>
-
- * configure.in: depend on bonobo >= 0.36
-
-2001-02-08 Christopher James Lahey <clahey@ximian.com>
-
- * configure.in: Upped the version number of gal required to 0.5.
-
-2001-02-07 JP Rosevear <jpr@ximian.com>
-
- * README: Update to latest requirements
-
-2001-02-05 Jeffrey Stedfast <fejj@ximian.com>
-
- * .cvsignore: Added xml-* files.
-
-2001-02-05 Gustavo Maciel Dias Vieira <gdvieira@zaz.com.br>
-
- * configure.in (ALL_LINGUAS): Added pt_BR to ALL_LINGUAS.
-
-2001-02-04 Christopher James Lahey <clahey@ximian.com>
-
- * configure.in: Require version 0.4.99.8 of gal.
-
-2001-02-03 Federico Mena Quintero <federico@ximian.com>
-
- * configure.in: Make sure we have gnome-libs 1.2.9 or higher.
-
-2001-02-01 Chris Toshok <toshok@ximian.com>
-
- * configure.in: allow --enable/disable-ldap.
-
-2001-02-01 Jason Leach <jasonleach@usa.net>
-
- * tools/killev: Fix this script to make it work with Solaris.
- Patch from Louise Miller.
-
-2001-01-29 Eskil Heyn Olsen <eskil@eazel.com>
-
- reviewed by: JP Rosevear <jpr@ximian.com>
-
- * acconfig.h:
- Added the ENABLE_NNTP define
-
- * configure.in:
- Fixed the NNTP m4 section.
-
-2001-01-29 Stanislav Visnovsky <visnovsky@nenya.ms.mff.cuni.cz>
-
- * configure.in: added sk to ALL_LINGUAS.
- * evolution.desktop: added Slovak messages.
-
-2001-01-27 Jason Leach <jasonleach@usa.net>
-
- * configure.in (AC_OUTPUT): remove
- widgets/shortcut-bar/Makefile from here.
-
-2001-01-25 Christopher James Lahey <clahey@helixcode.com>
-
- * configure.in: Upped the required version of gal in evolution.
-
-2001-01-25 Ettore Perazzoli <ettore@ximian.com>
-
- * art/Makefile.am (images_DATA): Add the missing .xpm files.
-
-2001-01-25 Ettore Perazzoli <ettore@ximian.com>
-
- * art/Makefile.am (images_DATA): Add `24_find_contacts.xpm',
- `16_print_xpm', `16_configure_addressbook'.
-
-2001-01-25 Ettore Perazzoli <ettore@ximian.com>
-
- * art/Makefile.am (images_DATA): Add `24_all_contacts.xpm'.
-
-2001-01-24 Christopher James Lahey <clahey@helixcode.com>
-
- * configure.in: Upped the required version of gal in evolution.
-
-2001-01-22 Tuomas Kuosmanen <tigert@ximian.com>
-
- * art/splash.png: From the "Ideas from the shower" department:
- new splash screen.
-
-2001-01-17 JP Rosevear <jpr@ximian.com>
-
- * README: Update package requirements
-
-2001-01-19 Jason Leach <jasonleach@usa.net>
-
- * configure.in: Changed a leftover $with_x_mailer to
- $with_sub_version. Made it so that if $with_sub_version isn't
- specified, we don't try to output it, and also corrected the way
- SUB_VERSION is defined.
-
-2001-01-18 Federico Mena Quintero <federico@ximian.com>
-
- * Makefile.am: Um, why was the doc directory removed from SUBDIRS?
-
-2001-01-17 Larry Ewing <lewing@helixcode.com>
-
- * configure.in (EVOLUTION_DIR): add the
- doc/devel/importer/Makefile as a target.
-
-2001-01-17 Ettore Perazzoli <ettore@ximian.com>
-
- * acconfig.h: Add `SUB_VERSION', remove `XMAILER_VERSION'.
-
- * configure.in: Removed `--with-x-mailer' option; replaced with a
- more generic `--with-sub-version' option. So, don't define
- `X_MAILER'; instead, define `SUB_VERSION'.
-
-2001-01-16 Chris Toshok <toshok@helixcode.com>
-
- * configure.in: add --enable-nntp switch. default is no.
-
-2001-01-16 Dan Winship <danw@ximian.com>
-
- * configure.in, acconfig.h: Add --with-x-mailer to set the version
- string that appears in the X-Mailer header.
-
-2001-01-15 Christopher James Lahey <clahey@ximian.com>
-
- * configure.in: Changed the required version of gal.
-
-2001-01-15 Tuomas Kuosmanen <tigert@ximian.com>
-
- * art/16_copy_message.xpm, art/16_move_message.xpm: icons for the
- Message->Move/Copy to folder -menu entries.
-
-2001-01-15 Tuomas Kuosmanen <tigert@ximian.com>
-
- * art/evolution-calendar-mini.png: New version of calendar icon that
- looks more like a calendar and not a dictionary or something :)
-
- Btw, the icons get scaled for some reason, even though that is
- not necessary as all of those should be 16x16 pixels. Can anyone look
- into this?
-
-2001-01-15 Dietmar Maurer <dietmar@ximian.com>
-
- * *.c: changed the signature of the property_bag get/set
- functions.
-
-2001-01-14 JP Rosevear <jpr@ximian.com>
-
- * configure.in: remove old config message
-
-2001-01-14 Damon Chaplin <damon@helixcode.com>
-
- * tools/evolution-move-tasks: new script to move tasks from the
- Calendar folder to the new Tasks folder, so people won't lose tasks.
- This can be deleted after a few releases.
-
- * tools/Makefile.am (bin_SCRIPTS): added above.
-
- * configure.in: added default_user/local/Tasks/Makefile to AC_OUTPUT.
-
-2001-01-12 Jeffrey Stedfast <fejj@ximian.com>
-
- * config.h.in: Removed GPG stuff.
-
- * acconfig.h: Take out all refs to PGP and GPG stuff.
-
- * configure.in: Take out the PGP/GPG detection stuff.
-
-2001-01-12 Federico Mena Quintero <federico@ximian.com>
-
- * configure.in: Suggest what to do if gtk-doc is not found.
-
-2001-01-12 Christopher James Lahey <clahey@helixcode.com>
-
- * configure.in: Make evolution depend on the new version of gal.
-
-2001-01-12 Dan Winship <danw@ximian.com>
-
- * MAINTAINERS, AUTHORS, README: Ximianize. Also update the README
- a bit and mention the OAF stable branch.
-
-2001-01-11 Dan Winship <danw@helixcode.com>
-
- * art/priority-high.xpm: Add a white outline around the "!" so it
- still shows up clearly in selected rows when your theme selection
- color is reddish. (Problem pointed out by Federico.)
-
-2001-01-11 Federico Mena Quintero <federico@helixcode.com>
-
- * configure.in: At the end of the configure process, report
- whether the documentation files will be built or not.
-
-2001-01-10 Tuomas Kuosmanen <tigert@helixcode.com>
-
- * art/move-message.png, art/move-message.png: New versions.
-
-2001-01-09 Federico Mena Quintero <federico@helixcode.com>
-
- * configure.in (AC_OUTPUT): Added calendar/gui/alarm-notify/Makefile.
-
-2001-01-05 Tuomas Kuosmanen <tigert@helixcode.com>
-
- * art/evolution-contacts-mini.png: This looks more pretty.
-
-2001-01-03 Christopher James Lahey <clahey@helixcode.com>
-
- * configure.in: Removed camel/providers/mbox/Makefile and
- camel/providers/mh/Makefile.
-
-2001-01-01 Michael Meeks <michael@helixcode.com>
-
- * configure.in: Require bonobo 0.31
-
-2000-12-24 Not Zed <NotZed@HelixCode.com>
-
- * configure.in: If we find threads ok, then always turn on
- ENABLE_THREADS.
-
-2000-12-14 Christopher James Lahey <clahey@helixcode.com>
-
- * NEWS (Addressbook): Added a bit of addressbook NEWS.
-
- * configure.in: Updated the gal check to require gal 0.4.
-
-2000-12-14 Christopher James Lahey <clahey@helixcode.com>
-
- * art/mail-new.xpm, art/mail-read.xpm, art/mail-replied.xpm: Moved
- these images each up one pixel.
-
-2000-12-14 Jeffrey Stedfast <fejj@helixcode.com>
-
- * NEWS: Update.
-
-2000-12-14 JP Rosevear <jpr@helixcode.com>
-
- * NEWS: Update
-
-2000-12-14 Christopher James Lahey <clahey@helixcode.com>
-
- * art/splash.png: New splash from Jimmac.
-
-2000-12-12 Christopher James Lahey <clahey@helixcode.com>
-
- * README: Removed mention of ETable and EText in widgets
- directory.
-
-2000-12-12 Dan Winship <danw@helixcode.com>
-
- * README: Mention the gconf stable branch.
-
-2000-12-07 Christopher James Lahey <clahey@helixcode.com>
-
- * configure.in: Updated the required version of gal.
-
-2000-12-07 Radek Doulik <rodo@helixcode.com>
-
- * configure.in (GTKHTML_LIBS): renamed HTMLEditor.idl to
- Editor.idl
-
-2000-12-06 Kjartan Maraas <kmaraas@gnome.org>
-
- * data/evolution.keys: Added some Norwegian translations.
-
-2000-12-06 Christopher James Lahey <clahey@helixcode.com>
-
- * configure.in: Increased the required version of gal.
-
-2000-12-05 JP Rosevear <jpr@helixcode.com>
-
- * README: minor tweak
-
-2000-12-05 Not Zed <NotZed@HelixCode.com>
-
- * configure.in: Added camel/tests/stream/Makefile.am.
-
-2000-12-01 Dan Winship <danw@helixcode.com>
-
- * README: gnome-vfs depends on gconf, so add that.
-
-2000-11-30 Jeffrey Stedfast <fejj@helixcode.com>
-
- * configure.in: Bumped required gal version to 0.2.99.4 for
- e_str_make_safe.
-
- * README: Added some necessary :'s in the pilot-link cvs stuff.
-
-2000-11-30 Gediminas Paulauskas <menesis@delfi.lt>
-
- * calendar/gui/main.c, executive-summary/component/main.c, mail/main.c,
- shell/main.c, notes/main.c,
- addressbook/gui/component/addressbook-factory.c:
- removed #ifdef ENABLE_NLS/#endif on Miguel's request.
-
-2000-11-29 JP Rosevear <jpr@helixcode.com>
-
- * README: Update pilot info
-
-2000-11-29 Dan Winship <danw@helixcode.com>
-
- * configure.in: Bump required gal version to 0.2.99.3 for iconv
- changes
-
-2000-11-29 Federico Mena Quintero <federico@helixcode.com>
-
- * COPYING-DOCS: Added a copy of the GNU Free Documentation
- License.
-
- * Makefile.am (EXTRA_DIST): Added COPYING-DOCS.
-
-2000-11-28 JP Rosevear <jpr@helixcode.com>
-
- * acconfig.h: Add USE_FLOCK, USE_FCNTL, USE_FLOCK
-
- * configure.in: Auto* magic for various camel locking types
-
-2000-11-28 Not Zed <NotZed@HelixCode.com>
-
- * configure.in (AC_OUTPUT): Added camel/tests/folder/Makefile
-
-2000-11-27 JP Rosevear <jpr@helixcode.com>
-
- * AUTHORS: Update - hopefully I assigned blame correctly :-)
-
- * MAINTAINERS: ditto
-
-2000-11-27 JP Rosevear <jpr@helixcode.com>
-
- * configure.in: Correct the bonobo version error message
-
- * README: Update
-
-2000-11-24 Not Zed <NotZed@HelixCode.com>
-
- * configure.in: Added camel/tests stuff to output macro.
-
-2000-11-14 Not Zed <NotZed@HelixCode.com>
-
- * configure.in: Added local provider dir to output macro.
-
-2000-11-21 Dan Winship <danw@helixcode.com>
-
- * configure.in: Check for libgpgme. (Support not added to mail
- yet.)
-
-2000-11-21 Federico Mena Quintero <federico@helixcode.com>
-
- * configure.in (EVOLUTION_DIR): Removed the
- default_user/local/Tasks/Makefile until the relevant files are on
- CVS.
-
-2000-11-18 Miguel de Icaza <miguel@helixcode.com>
-
- * Added widgets/menus that contains the gal-view-menus.c code from
- Gal that depended on Bonobo.
-
- * configure.in: Update list of Makefiles;
-
- * widgets/Makefile.am: Update.
-
-2000-11-13 Christopher James Lahey <clahey@helixcode.com>
-
- * configure.in: Update the gal reqiurement version.
-
-2000-11-10 Michael Meeks <michael@helixcode.com>
-
- * configure.in: Require Bonobo >= 0.29, due to the XSync
- fix.
-
-2000-11-09 Christopher James Lahey <clahey@helixcode.com>
-
- * configure.in: Require gal 0.2.99.1.
-
-2000-11-06 Jeffrey Stedfast <fejj@helixcode.com>
-
- * configure.in: Require gal 0.2.1.3
-
-2000-11-06 Dan Winship <danw@helixcode.com>
-
- * configure.in (GTKHTML_LIBS): ${prefix} doesn't get defaulted
- until the end of configure, so check if it's "NONE" and use
- ${ac_default_prefix} if so.
-
-2000-11-06 Radek Doulik <rodo@helixcode.com>
-
- * configure.in (GTKHTML_LIBS): also look for HTMLEditor.idl in
- ${prefix}/share/gtkhtml
-
-2000-11-03 Radek Doulik <rodo@helixcode.com>
-
- * configure.in (BONOBO_HTML_GNOME_CFLAGS): raise required version
- number to 0.8
- added check for HTMLEditor.idl file
-
-2000-11-02 Christopher James Lahey <clahey@helixcode.com>
-
- * configure.in: Require gal 0.2.1.2.
-
-2000-11-02 Michael Meeks <michael@helixcode.com>
-
- * configure.in: Require Bonobo-0.27+
-
-2000-11-01 Gediminas Paulauskas <menesis@delfi.lt>
-
- * addressbook/ename/.cvsignore, addressbook/gui/minicard/.cvsignore,
- calendar/doc/.cvsignore, widgets/e-paned/.cvsignore,
- widgets/e-table/.cvsignore, widgets/e-text/.cvsignore: added these
- files.
- * calendar/gui/.cvsignore, composer/.cvsignore,
- executive-summary/.cvsignore, executive-summary/component/.cvsignore,
- po/.cvsignore: added some files to ignore.
-
- * addressbook/gui/component/addressbook-factory.c, mail/main.c,
- shell/main.c, calendar/gui/main.c, notes/main.c,
- executive-summary/component/main.c: call *textdomain() only if
- ENABLE_NLS is defined.
-
-2000-11-01 Gediminas Paulauskas <menesis@delfi.lt>
-
- * configure.in: added lt to ALL_LINGUAS.
-
-2000-10-30 Dan Winship <danw@helixcode.com>
-
- * configure.in: fix up printing of kerberos configuration status
-
-2000-10-27 Christopher James Lahey <clahey@helixcode.com>
-
- * configure.in: Require gal cvs version.
-
-2000-10-27 <jpr@helixcode.com>
-
- * tools/killev: Kill executive summary components
-
-2000-10-25 Iain Holmes <iain@helixcode.com>
-
- * configure.in: Added executive-summary stuff
-
- * Makefile.am: Added the executive-summary subdirs.
-
-2000-10-23 Dan Winship <danw@helixcode.com>
-
- * notes/Makefile.am (INCLUDES): Update EVOLUTION_LOCALEDIR
-
- * configure.in: set localedir here to use in Makefiles.
- (AM_GNOME_GETTEXT doesn't actually always set it to
- $(datadir)/locale).
-
-2000-10-23 Christopher James Lahey <clahey@helixcode.com>
-
- * configure.in: Updated the gal check to check for gal 0.2.1.
-
-2000-10-22 Robert Brady <rwb197@zepler.org>
-
- * configure.in: Added "en_GB" to ALL_LINGUAS.
-
-2000-10-20 Michael Meeks <michael@helixcode.com>
-
- * notes/component-factory.c (control_activate_cb):
-
-2000-10-19 Christopher James Lahey <clahey@helixcode.com>
-
- * NEWS (General, Addressbook): Updated NEWS for addressbook and
- ETable.
-
-2000-10-19 Christopher James Lahey <clahey@helixcode.com>
-
- * configure.in: Updated the gal check to check for gal 0.2.
-
-2000-10-19 Ettore Perazzoli <ettore@helixcode.com>
-
- * configure.in (EVOLUTION_MICRO_VERSION): 6.
-
- * Makefile.am (EXTRA_DIST): Remove `evolution.spec.in'.
- (dist-hook:): Removed.
-
-2000-10-18 Michael Meeks <michael@helixcode.com>
-
- * notes/component-factory.c (control_activate, control_deactivate),
- (create_view): cripple, not worth updating to new UI code.
-
-2000-10-17 Tuomas Kuosmanen <tigert@helixcode.com>
-
- * art/splash.png: This looks happier than the dark piece of rusty
- metal. And the Big Dig in Boston is ugly looking too. Finnish
- road poles are much more cool!
-
-2000-10-15 Peter Williams <peterw@helixcode.com>
-
- * tools/verify-evolution-install.sh (libcamelvee): Check
- for linkage against version 0.5 libcamelvee, not version 0.3.
- This should track with the version of Evolution itself.
- (rm -f $ldddfile): Remove a temporary file.
-
-2000-10-15 Kjartan Maraas <kmaraas@gnome.org>
-
- * configure.in: Added "nn" to ALL_LINGUAS.
-
-2000-10-14 Ettore Perazzoli <ettore@helixcode.com>
-
- * art/Makefile.am (images_DATA): Add `splash.png'.
-
-2000-10-14 Tuomas Kuosmanen <tigert@helixcode.com>
-
- * art/splash.png: umm.. it's a splash screen image.
-
-2000-10-11 JP Rosevear <jpr@helixcode.com>
-
- * configure.in: Fix bonobo error message
-
-2000-10-11 Jesse Pavel <jpavel@helixcode.com>
-
- * data/evolution.keys: Added support for the text/calendar and
- text/x-calendar MIME types.
-
-2000-10-10 Gediminas Paulauskas <menesis@delfi.lt>
-
- * configure.in: Added lt to ALL_LINGUAS.
-
-2000-10-10 Tuomas Kuosmanen <tigert@helixcode.com>
-
- * calendar/gui/recur.xpm: Updated round-we-go-thingy icon..
-
-2000-10-06 Chris Toshok <toshok@helixcode.com>
-
- * art/empty.xpm: make it transparent instead of white.
-
-2000-10-06 Christophe Merlet <christophe@merlet.net>
-
- * *.desktop: Added french strings.
-
-2000-10-05 Dan Winship <danw@helixcode.com>
-
- * tools/Makefile.am (EXTRA_DIST): Add verify-evolution-install.sh
- to EXTRA_DIST
-
-2000-10-05 Jeffrey Stedfast <fejj@helixcode.com>
-
- * configure.in: Check for isblank
-
- * config.h.in:
- * acconfig.h: #undef HAVE_ISBLANK
-
-2000-10-05 Michael Meeks <michael@helixcode.com>
-
- * configure.in: Bump Bonobo requirement to >= 0.20
-
-2000-10-05 Iain Holmes <iain@helixcode.com>
-
- * executive-summary/*: Added the executive summary stuff.
-
- * ui/evolution-executive-summary.xml: New.
-
- * art/add-service.png: New icon.
-
-2000-10-03 Matt Bissiri <bissiri@eecs.umich.edu>
-
- * ui/evolution-addressbook-ldap.xml,
- * ui/evolution-addressbook.xml,
- * ui/evolution-calendar.xml,
- * ui/evolution-contact-editor.xml:
- Fixed typo `_decr' -> `_descr', so some missing tooltips will appear.
- Also fixed some typos in descr values.
-
-2000-09-29 Peter Williams <peterw@helixcode.com>
-
- * ui/Makefile.am (XML_FILES): Install the new evolution-subscribe.xml
- file.
-
-2000-09-29 Chris Toshok <toshok@helixcode.com>
-
- * ui/evolution-mail.xml: add a Settings/Manage Subscriptions...
- menu item.
-
- * ui/evolution-subscribe.xml: add a File/Close menu item.
-
-2000-09-28 Chris Toshok <toshok@helixcode.com>
-
- * ui/evolution-subscribe.xml: add a FolderSearch control, and
- change "Refresh" to "RefreshList".
-
-2000-09-27 Chris Toshok <toshok@helixcode.com>
-
- * ui/evolution-subscribe.xml: add an Refresh List button..
-
-2000-09-27 Chris Toshok <toshok@helixcode.com>
-
- * ui/Makefile.am (XML_FILES): add evolution-subscribe.xml.
-
- * ui/evolution-subscribe.xml: new file.
-
-2000-09-25 Jeffrey Stedfast <fejj@helixcode.com>
-
- * ui/evolution-mail.xml: Moved the (un)select all menu items over
- to the Edit menu - this looks nicer.
-
-2000-09-25 Jeffrey Stedfast <fejj@helixcode.com>
-
- * ui/evolution-mail.xml: Added some new menu items to the Message
- menu like (un)select all and moved "mark as read" to the Message
- menu.
-
-2000-09-25 Jeffrey Stedfast <fejj@helixcode.com>
-
- * configure.in: Moved addressbook/ename to e-util/ename so
- generate e-util/ename/Makefile and don't generate
- addressbook/ename/Makefile
-
-2000-09-23 Tuomas Kuosmanen <tigert@localhost>
-
- * art/attachment.xpm
- * art/add-attachment.png: OOPS. The attachment.xpm was not the one
- I thought, so I accidentally replaced the paperclip icon in the mail
- list column, which wasnt my intention. I hope this works now. The old
- one is back, instead the toolbar icon to add attachment is now called
- "add-attachment.png" as you can see also from above. Bummer. Sorry :)
-
-2000-09-22 Christopher James Lahey <clahey@helixcode.com>
-
- * libversit/vcc.y: Fixed some warnings. Fixed a bug where quoted
- printable fields were reading in semi-colons that should have been
- field separators.
-
-2000-09-22 Christopher James Lahey <clahey@helixcode.com>
-
- * ui/Makefile.am: Added evolution-addressbook-ldap.xml.
-
- * ui/evolution-addressbook-ldap.xml: New file. (A Variation on
- evolution-addressbook.xml)
-
- * ui/evolution-addressbook.xml: Added View All and Stop buttons.
-
-2000-09-21 Federico Mena Quintero <federico@helixcode.com>
-
- * ui/evolution-calendar.xml: Removed the AboutCalendar stuff.
-
- * ui/evolution.xml: Fix mis-spelling of "calendar".
-
-2000-09-21 Michael Meeks <michael@helixcode.com>
-
- * notes/component-factory.c (control_activate): upd.
-
-2000-09-20 Christopher James Lahey <clahey@helixcode.com>
-
- * ui/.cvsignore: Added a cvsignore file here.
-
-2000-09-20 Christopher James Lahey <clahey@helixcode.com>
-
- * ui/Makefile.am (XML_FILES): Added evolution-contact-editor.xml.
-
- * ui/evolution-contact-editor.xml: New file for the UI for the
- evolution contact editor.
-
-2000-09-20 Tuomas Kuosmanen <tigert@gimp.org>
-
- * art/attachment.xpm
- * art/send.png: new icons for "compose mail" dialog...
-
-2000-09-19 Dan Winship <danw@helixcode.com>
-
- * configure.in: alter the krb4 check a bit to deal with configure
- cache suckage. (If you do AC_CHECK_LIB with the same library and
- function name but different LDFLAGS, it will still use the result
- of the previous check. So use a different function the second
- time.)
-
-2000-09-18 Dan Winship <danw@helixcode.com>
-
- * README: add gal as a dependency
-
-2000-09-18 Jeffrey Stedfast <fejj@helixcode.com>
-
- * art/score-*.xpm: stupid looking icons for use with displaying
- scores in the message-list view. These need a makeover BADLY ;-)
-
-2000-09-18 Christopher James Lahey <clahey@helixcode.com>
-
- * configure.in: Added check for gnome-app-lib. Removed
- directories that have been moved to gal.
-
-2000-09-15 Dan Winship <danw@helixcode.com>
-
- * configure.in, evolution.spec.in: remove spec file. We haven't
- been keeping it up to date, and it's only good for RH anyway, and
- if people really want a spec file they can get it from our SRPMs.
-
-2000-09-07 Michael Meeks <michael@helixcode.com>
-
- * configure.in: Require Bonobo 0.19
-
-2000-09-13 Christopher James Lahey <clahey@helixcode.com>
-
- * configure.in: Added widgets/e-reflow/Makefile. Replaced
- addressbook/gui/minicard/Makefile with
- addressbook/gui/widgets/Makefile.
-
-2000-09-13 Tuomas Kuosmanen <tigert@localhost>
-
- * art/pin.png: added icon for the folder tree "pin down" button
-
-2000-09-12 JP Rosevear <jpr@helixcode.com>
-
- * NEWS (Calendar): Pilot stuff
-
-2000-09-12 Ettore Perazzoli <ettore@helixcode.com>
-
- * configure.in: The notes subdir isn't actually used, so remove
- it.
-
-2000-09-12 Ettore Perazzoli <ettore@helixcode.com>
-
- * configure.in: 0.5.
-
-2000-09-12 Jeffrey Stedfast <fejj@helixcode.com>
-
- * NEWS (Mailer): Added Sent/Outbox feature descriptions
-
-2000-09-12 Dan Winship <danw@helixcode.com>
-
- * NEWS (Mailer): add most (but not all) 0.5 Mailer features
-
- * configure.in: s/Sentbox/Sent/
-
-2000-09-12 Ettore Perazzoli <ettore@helixcode.com>
-
- * art/Makefile.am (buttonsdir): Install the new button icons into
- `$(datadir)/images/evolution/buttons'.
-
-2000-09-11 Tuomas Kuosmanen <tigert@helixcode.com>
-
- * art/fetch-mail.png
- * art/compose-message.png
- * art/reply.png
- * art/reply-to-all.png
- * art/forward.png
- * art/move-message.png
- * art/copy-message.png: New icons for the main window toolbar
-
-2000-09-11 Christopher James Lahey <clahey@helixcode.com>
-
- * NEWS: Added 0.5 changes for ETable and Addressbook.
-
-2000-09-07 Dan Winship <danw@helixcode.com>
-
- * README: Add a mention of the verify-evolution-install.sh script
- in tools/.
-
-2000-09-03 Jeffrey Stedfast <fejj@helixcode.com>
-
- Reversed my last change as it broke configure, how do I get it so
- that we can do folders with spaces in the name!?
-
-2000-09-03 Jeffrey Stedfast <fejj@helixcode.com>
-
- * configure.in: Renamed default_user/local/Sentbox to
- default_user/local/Sent\ Mail as Ettore and Danw are picky about
- folder names
-
-2000-09-02 Christopher James Lahey <clahey@helixcode.com>
-
- * configure.in: Added calendar/conduits/Makefile,
- calendar/conduits/calendar/Makefile and
- calendar/conduits/todo/Makefile to the list of makefiles to
- output.
-
-2000-09-01 Jeffrey Stedfast <fejj@helixcode.com>
-
- * configure.in: Add default_user/local/Sentbox/Makefile to the
- list of makefiles to output
-
-2000-08-31 Peter Williams <peterw@helixcode.com>
-
- * configure.in (kerberos): Check and see if krb_sendauth needs
- prototyping. (#define NEED_KRB_SENDAUTH_PROTO). Also check
- for a libkrb that doesn't need -ldes.
-
- * acconfig.h: #undef it
-
-2000-08-30 Lauris Kaplinski <lauris@helixcode.com>
-
- * configure.in: AC_DEFINE(USING_GNOME_PRINT_0_20)
-
- * acconfig.h: #undef that
-
-2000-08-30 Peter Williams <peterw@helixcode.com>
-
- * configure.in: Robustify the kerberos checks.
-
-2000-08-29 Dan Winship <danw@helixcode.com>
-
- * configure.in, acconfig.h: decruft
-
-2000-08-28 Jesus Bravo Alvarez <jba@pobox.com>
-
- * configure.in: Added Portuguese (pt) to ALL_LINGUAS
-
-2000-08-26 JP Rosevear <jpr@helixcode.com>
-
- * configure.in: Require oafized bonobo
-
-2000-08-24 Federico Mena Quintero <federico@helixcode.com>
-
- * configure.in: Ahem. If you add dependencies on libraries, make
- sure things still build. Fixed the libunicode foo.
-
-2000-08-22 Lauris Kaplinski <lauris@helixcode.com>
-
- * widgets/e-text/e-text.c (_get_position_from_xy): Don't crash on illegal string
-
-2000-08-22 Lauris Kaplinski <lauris@helixcode.com>
-
- * widgets/e-text/e-text.c (e_text_event): Use e_utf8_from_gtk_event_key
- to translate GDK_KEY_PRESS to insertable UTF-8 string
-
-2000-08-22 Christopher James Lahey <clahey@helixcode.com>
-
- * announcement-0.4.1.txt: Updated dependency list.
-
-2000-08-22 Lauris Kaplinski <lauris@helixcode.com>
-
- * widgets/e-text/e-text.c: Use byte based UTF-8 syntax
-
-2000-08-22 Christopher James Lahey <clahey@helixcode.com>
-
- * announcement-0.4.1.txt: Announcement message
-
-2000-08-19 Mathieu Lacage <mathieu@gnu.org>
-
- Fixes compile for non-standard prefixes. Mainly in idl
- compilation where -I`gnome-config --datadir`/idl is replaced
- by `gnome-config --cflags idl` (ugly but it works at least)
- and add some random _CFLAGS here and there and _LIBS for linking.
- * addressbook/gui/component/select-names/Makefile.am
- * composer/Makefile.am
- * e-util/Makefile.am
- * filter/Makefile.am
- * mail/Makefile.am
- * shell/Makefile.am
- * widgets/e-text/Makefile.am
-
-
-2000-08-21 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-paned/e-hpaned.c, widgets/e-paned/e-paned.c,
- widgets/e-paned/e-paned.h, widgets/e-paned/e-vpaned.c: Added code
- to make handle position persist across resizes.
-
-2000-08-20 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-text/e-text.c: Fixed a warning.
-
-2000-08-20 arik devens <arik@helixcode.com>
-
- * widgets/e-text/Makefile.am (INCLUDES): added UNICODE_CFLAGS
- support so that compiling in an alternate prefix works.
-
-2000-08-19 Lauris Kaplinski <lauris@helixcode.com>
-
- * widgets/e-text/e-text.h: Commented out Suckfont, added EFont
- * widgets/e-text/e-text.c: Ported to UTF-8
-
-2000-08-18 Peter Williams <peterw@helixcode.com>
-
- * configure.in (gnome-vfs): Check for new enough gnome-vfs
- (needs gnome_vfs_mime_get_default_action_without_fallback)
-
-2000-08-14 Federico Mena Quintero <federico@helixcode.com>
-
- * configure.in (AC_OUTPUT): Generate
- doc/devel/calendar/cal-util/Makefile.
-
-2000-08-14 Peter Williams <peterw@helixcode.com>
-
- * configure.in: Check for db1/db.h too, which is what
- RH 7.0 uses for the old db headers. Patch from Kenny Graunke
- <kwg@teleport.com>
-
-2000-08-13 Chris Toshok <toshok@helixcode.com>
-
- * configure.in: offer --enable-pilot-conduits to add pilot
- conduits if the user wants them.
-
-2000-08-13 Dan Winship <danw@helixcode.com>
-
- * configure.in: Fix the name of the binary to look for for PGP5
-
-2000-08-12 Michael Meeks <michael@helixcode.com>
-
- * configure.in: Check for Bonobo 0.17
-
-2000-08-12 Christopher James Lahey <clahey@helixcode.com>
-
- * configure.in: Added addressbook/gui/search/Makefile.
-
-2000-08-12 Dan Winship <danw@helixcode.com>
-
- * configure.in, README: Depend on gnome-vfs 0.3
-
-2000-08-10 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-text/.cvsignore, widgets/e-text/Makefile.am,
- widgets/e-text/e-entry-test.c: Added a test for the EEntry widget.
-
-2000-08-09 Dan Winship <danw@helixcode.com>
-
- * data/evolution.keys: New file containing MIME keys for
- Evolution. Currently just the addressbook minicard display.
-
- * data/Makefile.am (mime_DATA): add evolution.keys
-
-2000-08-09 Peter Williams <peterw@helixcode.com>
-
- * configure.in (EVOLUTION_DIR): Remove the warning about camel-async.
-
-2000-08-08 Peter Williams <peterw@helixcode.com>
-
- * Makefile.am (SUBDIRS): Reenable the calendar. Oops.
-
-2000-08-05 Dan Winship <danw@helixcode.com>
-
- * tools/verify-evolution-install.sh: Look for oafinfo files in
- oaf's prefix, not gnome-libs's. Allow binaries to be installed
- anywhere in $PATH.
-
- * configure.in, README: Update the README and the text of the
- Bonobo configure check to match reality. Remove the 0.15 vs
- 0.15-and-a-half check since we require post-0.16 now.
-
-2000-08-03 JP Rosevear <jpr@helixcode.com>
-
- * configure.in: Remove gconf check
-
-2000-08-03 Alastair McKinstry <mckinstry@computer.org>
-
- * configure.in (ALL_LINGUAS): Add Irish translation
-
-2000-08-02 Michael Meeks <michael@helixcode.com>
-
- * configure.in: update for BonoboX
-
-2000-08-02 Dan Winship <danw@helixcode.com>
-
- * configure.in (AC_OUTPUT): Add camel/providers/nntp
-
-2000-08-02 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-text/e-text.c: Made clicking choose the right
- character even if show_borders is on.
-
-2000-08-01 Dan Winship <danw@helixcode.com>
-
- * configure.in, acconfig.h: Add checks for GPG, PGP 5 and PGP 2.
- Only record the first one found.
-
-2000-08-01 Damon Chaplin <damon@helixcode.com>
-
- * configure.in (AC_OUTPUT): removed calendar/doc/*
-
-2000-08-01 Not Zed <NotZed@HelixCode.com>
-
- * configure.in: Added mh provider.
-
-2000-07-27 Dan Winship <danw@helixcode.com>
-
- * configure.in: Check for gconf_client_get_default (gconf 0.5 vs
- newer)
-
-2000-07-26 Ettore Perazzoli <ettore@helixcode.com>
-
- * configure.in: Bump version number to 0.3.
-
-2000-07-26 Peter Williams <peterw@helixcode.com>
-
- * widgets/e-table/e-table-scrolled.c (right_click_proxy): Default
- the return value to 0.
-
-2000-07-25 Dan Winship <danw@helixcode.com>
-
- * configure.in: some unrelated changes: check for mkdtemp,
- gnome_vfs_mime_get_default_action_without_fallback, and a
- setuid/setgid movemail binary.
-
- * acconfig.h: add MOVEMAIL_PATH
-
-2000-07-25 Christopher James Lahey <clahey@helixcode.com>
-
- * configure.in: Added addressbook/conduit/Makefile.
-
-2000-07-21 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-text/e-text.c: Made focus in not change your selection
- position.
-
-2000-07-21 Szabolcs BAN <shooby@gnome.hu>
-
- * calendar/gui/event-editor.c: Typo fix
-
-2000-07-20 Peter Williams <peterw@helixcode.com>
-
- * configure.in (THREADS_CFLAGS): Make threads mandatory
- again.
-
-2000-07-19 Fatih Demir <kabalak@gmx.net>
-
- * evolution.desktop & data/evolution.desktop: Added
- the Turkish desktop entries.
-
-2000-07-17 Federico Mena Quintero <federico@helixcode.com>
-
- * configure.in (EVOLUTION_DIR): Typo fix.
-
- * configure.in (AC_OUTPUT): Added the doc/devel Makefiles.
- (EVOLUTION_DIR): Substitute EVOLUTION_DIR for the top_srcdir.
- Added checks for gtk-doc.
-
-2000-07-13 Peter Williams <peterw@curious-george.helixcode.com>
-
- * configure.in (end): Bigass warnings for camel-async branch
- (remove them later).
-
-2000-07-12 Federico Mena Quintero <federico@helixcode.com>
-
- * configure.in: Make gnome-print-0.20 mandatory. We will bail out
- with CVS HEAD versions to avoid breakage.
-
-2000-07-10 Ettore Perazzoli <ettore@helixcode.com>
-
- * Version 0.2.
-
- * configure.in: Reverse the GtkHTML check.
-
-2000-07-10 Jeffrey Stedfast <fejj@helixcode.com>
-
- * configure.in: Updated to check for required GtkHTML and
- gnome-print
-
-2000-07-10 Ettore Perazzoli <ettore@helixcode.com>
-
- * configure.in: Remove the conduits stuff for now. They depend on
- CVS gnome-pilot, and this is not good for the release.
-
-2000-07-10 Dan Winship <danw@helixcode.com>
-
- * README: updates
-
-2000-07-10 Seth Alves <alves@hungry.com>
-
- * configure.in: added makefiles for calendar conduits
-
-2000-07-10 Dan Winship <danw@helixcode.com>
-
- * configure.in: Add a check for Bonobo 0.15 vs Bonobo post-0.15
-
-2000-07-09 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-text/e-text.c: Don't draw quite as large a "flat_box".
- If draw_borders is TRUE, cause the cursor to change even if not
- editing.
-
-2000-07-09 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-text/e-entry.c: Removed some border padding and set
- the "draw_borders" argument of the contained GtkText.
-
- * widgets/e-text/e-text.c, widget/e-text/e-text.h: Added a
- "draw_borders" argument which, if set, makes the EText look more
- like a GtkEntry.
-
-2000-07-09 Tuomas Kuosmanen <tigert@gimp.org>
-
- * art/evolution-contacts.png: updated so it has better contrast
- against the background.
-
- * art/evolution-contacts-small.png: Fits the style of the new contacts
- icon, this is a sigle card.
-
-2000-07-09 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-text/e-text-model.c (e_text_model_real_get_text):
- Return "" instead of NULL.
-
-2000-07-07 Christopher James Lahey <clahey@helixcode.com>
-
- * art/Makefile.am: Fixed EXTRA_DIST for make distcheck.
-
-2000-07-07 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-text/e-entry.c: Set "anchor" and "fill_clip_rectangle"
- arguments.
-
- * widgets/e-text/e-text.c, widgets/e-text/e-text.h: Added
- "fill_clip_rectangle" argument which describes whether to accept
- clicks throughout the clipping rectangle.
-
-2000-07-07 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-text/e-entry.c: Fixed some typos.
-
-2000-07-07 Tuomas Kuosmanen <tigert@gimp.org>
-
- * art/evolution-contacts.png: Changed icon (hi ettore)
- The old handshake one was a little too firm handshake..
- this is a rolodex icon..
-
-2000-07-07 Dan Winship <danw@helixcode.com>
-
- * configure.in: make pthreads not required again, since they
- aren't, and remove widgets/e-toolbar/Makefile from AC_OUTPUT since
- that dir doesn't exist any more.
-
-2000-07-06 Chris Toshok <toshok@helixcode.com>
-
- * configure.in (AC_OUTPUT): remove the default_user Directories
- dir.
-
-2000-07-06 Christopher James Lahey <clahey@helixcode.com>
-
- * Makefile.am, libical/configure.in: Fixed some make distcheck
- errors.
-
-2000-07-05 Ettore Perazzoli <ettore@helixcode.com>
-
- * configure.in (GNOME_VFS_CFLAGS): Define.
- (GNOME_VFS_LIBS): Define.
-
-2000-07-03 Ettore Perazzoli <ettore@helixcode.com>
-
- * configure.in: Add
- `addressbook/gui/component/select-names/Makefile' to the
- `AC_OUTPUT()' list.
-
-2000-07-03 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-text/Makefile.am: Added e-entry.c and e-entry.h.
-
- * widgets/e-text/e-entry.c, widgets/e-text/e-entry.h: New files to
- be a widget containing a text item.
-
- * widgets/e-text/e-text.c: Fixed some spacing.
-
-2000-06-29 Ettore Perazzoli <ettore@helixcode.com>
-
- * notes/component-factory.c (owner_set_cb): Get an
- EvolutionShellClient instead of an Evolution_Shell to match the
- changes in libeshell.
-
-2000-06-29 Peter Williams <peterw@helixcode.com>
-
- * configure.in: Re-enable GNOME_PILOT_CHECK.
- Change AC_MSG_CHECKING([For...]) to [for...]. It's the little
- things that matter.
-
-2000-06-28 Ettore Perazzoli <ettore@helixcode.com>
-
- * configure.in: `AM_PATH_GCONF'.
-
-2000-06-27 Peter Williams <peterw@curious-george.helixcode.com>
-
- * configure.in (ctime_r): Check for whether ctime_r takes
- two (Linux) or three (Solaris) arguments.
- (AC_OUTPUT): Don't create notes/Makefile twice.
-
- * acconfig.h: Add CTIME_R_THREE_ARGS to the list.
-
-2000-06-26 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-text/e-text.c: Calculate height including if
- clip_height is set to -1.
-
-2000-06-26 Peter Williams <peterw@curious-george.helixcode.com>
-
- * configure.in (THREADS_CFLAGS): Add option --enable-broken-threads
- to turn on the threading stuff in evolution-mail. Defaults to no.
-
- * acconfig.h: Add USE_BROKEN_THREADS to the list.
-
-2000-06-25 Ettore Perazzoli <ettore@helixcode.com>
-
- * configure.in: Use `glib-config' instead of `$GLIB_CONFIG' as the
- latter is not actually defined anywhere.
-
-2000-06-25 Peter Williams <peterw@helixcode.com>
-
- * configure.in (pthread stuff): Make threads required due
- to threaded evolution-mail. Subst in the THREADS_LIBS et
- al.
-
- * tests/Makefile.am: Remove USE_THREADS conditional as we
- always use threads now.
-
-2000-06-21 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-text/e-text.c: Fixed some vertical scroll bugs.
-
-2000-06-21 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-text/e-text.c: Fix a bug with intial vertical scroll.
-
-2000-06-21 Christopher James Lahey <clahey@helixcode.com>
-
- * notes/e-note.c, widgets/meeting-time-sel/e-meeting-time-sel.c,
- widgets/shortcut-bar/e-icon-bar.c: Removed the usage of "x" and
- "y" arguments to EText.
-
- * widgets/e-text/e-text.c, widgets/e-text/e-text.h: Removed the
- "x" and "y" arguments to EText. Added vertical scrolling.
-
-2000-06-20 Damon Chaplin <damon@helixcode.com>
-
- * widgets/meeting-time-sel/e-meeting-time-sel-item.c:
- * widgets/meeting-time-sel/e-meeting-time-sel.c: fixed a few warnings.
-
-2000-06-17 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-text/e-text.c: Made EText use the font from the
- canvas's style if one isn't set.
-
-2000-06-17 Damon Chaplin <damon@helixcode.com>
-
- * widgets/meeting-time-sel/*: updated to use EText items rather than
- GtkEntry widgets and added support for adding new rows.
-
-2000-06-15 Dan Winship <danw@helixcode.com>
-
- * README: bye bye goad
-
-2000-06-14 Damon Chaplin <damon@helixcode.com>
-
- * README (http): added command to co ORBit.
-
-2000-06-13 Jeffrey Stedfast <fejj@helixcode.com>
-
- * configure.in: Added IMAP into the build
-
-2000-06-13 Ettore Perazzoli <ettore@helixcode.com>
-
- * notes/Makefile.am (SHELL_OBJS): Removed.
- (evolution_notes_LDADD): Link with
- `$(top_builddir)/shell/libeshell.a'.
-
-2000-06-12 Ettore Perazzoli <ettore@helixcode.com>
-
- * widgets/Makefile.am (SUBDIRS): build `misc' before everything
- else.
-
- * Makefile.am: Install `evolution.png' and `evolution.desktop'
- where appropriate.
-
- * evolution.png: New. For now, it's just a copy of
- `art/evolution-inbox.png'.
-
- * evolution.desktop: New.
-
-2000-06-10 Zbigniew Chyla <chyla@buy.pl>
-
- * configure.in: Added pl (Polish) to ALL_LINGUAS
-
-2000-06-09 Ettore Perazzoli <ettore@helixcode.com>
-
- * configure.in: Added new directory `shell/glade'.
-
-2000-06-07 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-paned/e-hpaned.c, widgets/e-paned/e-paned.c,
- widgets/e-paned/e-paned.h, widgets/e-paned/e-vpaned.c: Added a
- "quantum" argument for making the panes move in jumps.
-
-2000-06-07 Anders Carlsson <andersca@gnu.org>
-
- * configure.in: Create notes/Makefile
-
- * notes/*: Add preliminary yellow sticky notes.
-
-2000-06-05 Mathieu Lacage <mathieu@gnome.org>
-
- * addressbook/contact-editor/Makefile.am: make it
- compile: add proper bonobo linking params.
- * addressbook/gui/minicard/Makefile.am: idem.
- * wombat/Makefile.am: add BONOBO_VFS_GNOME_CFLAGS.
- cleanup some useless includes and libs.
-
-2000-06-02 Ettore Perazzoli <ettore@helixcode.com>
-
- * configure.in (ALL_LINGUAS): Add `it' and `de'.
-
-2000-06-02 Christopher James Lahey <clahey@helixcode.com>
-
- * configure.in: Released Evolution 0.1.
-
-2000-06-02 Christopher James Lahey <clahey@helixcode.com>
-
- * tests/test-movemail.c: Reverted removal of e_setup_base_dir.
-
-2000-06-02 Jesus Bravo Alvarez <jba@pobox.com>
-
- * configure.in: Added pt (Portuguese) to ALL_LINGUAS
-
-2000-06-02 Dan Winship <danw@helixcode.com>
-
- * README: Update dependencies. Rewrite the GOAD vs OAF thing some
- more to reflect OAF's new ascendency. Make the fact that you don't
- need pilot stuff clearer. Add some new directories to the
- directory layout section.
-
-2000-06-02 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/misc/e-clipped-label.c: Free the finish data.
-
-2000-06-01 Christopher James Lahey <clahey@helixcode.com>
-
- * tests/test-movemail.c (main): Don't call e_setup_base_dir.
-
-2000-06-01 Dan Winship <danw@helixcode.com>
-
- * configure.in (AC_OUTPUT): add doc, doc/C
-
- * Makefile.am (SUBDIRS): add doc
-
-2000-05-31 Federico Mena Quintero <federico@helixcode.com>
-
- * widgets/misc/e-scroll-frame.[ch]: Imported GtkScrollFrame from
- EOG and renamed it to EScrollFrame.
-
- * widgets/misc/Makefile.am (libemiscwidgets_a_SOURCES): Added
- e-scroll-frame.[ch].
-
-2000-05-30 Ettore Perazzoli <ettore@helixcode.com>
-
- * widgets/e-paned/e-vpaned.c (e_vpaned_handle_shown): Show the
- handle even if the requisition for the child is zero.
- * widgets/e-paned/e-hpaned.c (e_hpaned_handle_shown): Likewise.
-
-2000-05-26 Hctor Garca Alvarez <hector@scouts-es.org>
-
- * configure.in: Added Spanish language
-
-2000-05-25 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-paned/e-hpaned.c, widgets/e-paned/e-vpaned.c: Fixed a
- bug where we were resizing a non-existent window.
-
-2000-05-25 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-paned/e-hpaned.c, widgets/e-paned/e-paned.c,
- widgets/e-paned/e-paned.h, widgets/e-paned/e-vpaned.c: Made
- the handlebar disappear if either side is empty, hidden, or
- requests 0 size.
-
-2000-05-24 Christopher James Lahey <clahey@helixcode.com>
-
- * configure.in: Added widgets/e-paned/Makefile.
-
- * tests/ui-tests/message-browser.c: Switched from GtkPaned to
- EPaned.
-
- * widgets/Makefile.am: Added e-paned directory.
-
- * widgets/e-paned/, widgets/e-paned/.cvsignore,
- widgets/e-paned/Makefile.am, widgets/e-paned/e-hpaned.c,
- widgets/e-paned/e-hpaned.h, widgets/e-paned/e-paned.c,
- widgets/e-paned/e-paned.h, widgets/e-paned/e-vpaned.c,
- widgets/e-paned/e-vpaned.h: New widget based completely on
- GtkPaned from 1.4. This will be more advanced soon.
-
-2000-05-22 Jeff Stedfast <fejj@helixcode.com>
-
- * configure.in: Readded camel/providers/smtp
-
-2000-05-22 Szabolcs BAN <shooby@gnome.hu>
-
- * configure.in: Added Hungarian language
-
-2000-05-18 Dan Winship <danw@helixcode.com>
-
- * configure.in (AC_OUTPUT): add camel/providers/vee
-
-2000-05-16 Ettore Perazzoli <ettore@helixcode.com>
-
- * art/Makefile.am: Install the mini icons.
-
-2000-05-16 Chris Toshok <toshok@helixcode.com>
-
- * configure.in: add --with-purify-options support, and default it
- to what we at helix need
-
-Tue May 16 06:11:40 2000 Tuomas Kuosmanen <tigert@gimp.org>
-
- * art/evolution-calendar-mini.png art/evolution-inbox-mini.png
- art/evolution-tasks-mini.png art/evolution-contacts-mini.png
- art/evolution-notes-mini.png: new mini-icons for the tree view
- of folders and stuff.
-
-2000-05-14 Federico Mena Quintero <federico@helixcode.com>
-
- * configure.in (AC_OUTPUT): Added calendar/gui/dialogs/Makefile.am.
-
-2000-05-10 Matt Loper <matt@helixcode.com>
-
- * README: Added version and availability of required libunicode
- library.
-
-2000-05-10 Dan Winship <danw@helixcode.com>
-
- * configure.in: Update versions needed for gnome-print, bonobo,
- and gtkhtml.
-
-2000-05-10 Christopher James Lahey <clahey@helixcode.com>
-
- * HACKING: We need a HACKING file.
-
-2000-05-10 Christopher James Lahey <clahey@helixcode.com>
-
- * Makefile.am: Removed dist-hook section.
-
- * configure.in: Set the version number. Added a check for gnome
- window icons. Removed a bunch of unused Makefiles.
-
- * tools/Makefile.am: Created a proper EXTRA_DIST section.
-
- * widgets/e-text/Makefile.am: Added
- e-text-event-processor-types.h.
-
-2000-05-09 Christopher James Lahey <clahey@helixcode.com>
-
- * art/Makefile.am: Added briefcase.png to get installed.
-
-2000-05-09 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-text/e-text.c: Remove the tooltip callback when
- destroyed.
-
-2000-05-09 Matt Loper <matt@helixcode.com>
-
- * calendar/pcs/cal-backend.c (cal_backend_add_cal): Return nothing
- for a 'void' function.
-
-2000-05-08 Christopher James Lahey <clahey@helixcode.com>
-
- * widget/e-text/e-text.c, widgets/e-text/e-text.h: Added an
- activate signal.
-
-2000-05-06 Chris Toshok <toshok@helixcode.com>
-
- * configure.in: Added new Directories section for the default_user.
-
-2000-05-06 Ettore Perazzoli <ettore@helixcode.com>
-
- * configure.in: Updated for the new `default_user' directory
- setup.
-
-2000-05-06 Chris Toshok <toshok@helixcode.com>
-
- * configure.in: check for purify.
-
-2000-05-06 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-text/e-text.c, widgets/e-text/e-text.h: Added a
- "changed" signal that gets sent whenever the text changes.
-
-2000-05-05 Ettore Perazzoli <ettore@helixcode.com>
-
- * Added `--enable-purify' flag.
-
-2000-05-05 Chris Toshok <toshok@helixcode.com>
-
- * shell/Makefile.am: add support for building purified evolution.
-
- * shell/.cvsignore: ignore evolution.pure
-
-2000-05-05 Chris Toshok <toshok@helixcode.com>
-
- * addressbook/backend/ebook/.cvsignore,
- addressbook/contact-editor/.cvsignore,
- addressbook/gui/component/.cvsignore,
- addressbook/gui/minicard/.cvsignore,
- addressbook/printing/.cvsignore,
- calendar/cal-client/.cvsignore,
- calendar/gui/.cvsignore,
- calendar/pcs/.cvsignore,
- filter/.cvsignore,
- mail/.cvsignore,
- shell/.cvsignore,
- tests/.cvsignore,
- widgets/e-table/.cvsignore,
- widgets/e-text/.cvsignore,
- widgets/meeting-time-sel/.cvsignore,
- widgets/shortcut-bar/.cvsignore,
- wombat/.cvsignore: ignore the .pure directory
-
-2000-05-04 Dan Winship <danw@helixcode.com>
-
- * configure.in: Oops. The Kerberos check was succeeding when it
- shouldn't have (and thus breaking the pop3 build for "normal"
- people). Fix.
-
-2000-05-03 Michael Meeks <michael@helixcode.com>
-
- * configure.in (xmlversion): Fix to remove older 'libxml' prefix.
-
-2000-05-02 Ettore Perazzoli <ettore@helixcode.com>
-
- * configure.in: Do not output `doc/Makefile' because there is
- nothing to generate it from.
-
-2000-05-02 Dan Winship <danw@helixcode.com>
-
- * configure.in, acconfig.h: add some minimal Kerberos checking.
- This isn't intended to be generically useful at this point, it's
- just there to give me a second POP auth mechanism to play with.
-
- Also remove a bit of cruft, and reorganize configure.in a bit.
-
-2000-05-02 NotZed <NotZed@HelixCode.com>
-
- * tests/test13.c: And here too.
-
- * tests/test2.c (main): REmoved gmime-utils.h
-
- * tests/Makefile.am (LDADD): Add libeutil to default link line.
- (test_movemail_LDADD): Fixed order for libutil linking.
-
-2000-05-02 Matt Loper <matt@helixcode.com>
-
- * tests/Makefile.am: set G_LOG_DOMAIN.
- * tests/ui-tests/Makefile.am: same.
- * widgets/e-text/Makefile.am: same.
- * widgets/meeting-time-sel/Makefile.am: same.
-
-2000-05-01 NotZed <NotZed@HelixCode.com>
-
- * tests/test11.c (main): *sigh* moved back to sync api.
-
-2000-05-01 NotZed <NotZed@HelixCode.com>
-
- * tests/test11.c (search_cb): Try deleting messages ...
- (main): Fix for provider api changes.
-
-2000-05-01 Anders Carlsson <andersca@gnu.org>
-
- * configure.in: Check if bonobo uses oaf, so you don't
- need to specify --enable-oaf.
-
-2000-04-27 Ettore Perazzoli <ettore@helixcode.com>
-
- * acconfig.h: New configured #define `USING_OAF'.
-
- * configure.in: Added `--enable-oaf' option and corresponding
- `OAF_LIBS' and `OAF_FLAGS' variables. Code friendly provided by
- Maciej Stachowiak <mjs@eazel.com>.
-
-2000-04-27 NotZed <NotZed@HelixCode.com>
-
- * tests/test10.c: Fix for removal of camelmimebodypart, and changes
- to recipient stuff.
-
- * tests/test1.c: Fix for removal of camelmimebodypart, and changes
- to recipient stuff.
-
-2000-04-27 Christopher James Lahey <clahey@helixcode.com>
-
- * configure.in: Added addressbook/ename/Makefile.
-
-2000-04-27 Matt Loper <matt@helixcode.com>
-
- * configure.in: added tools/Makefile.
-
- * Makefile.am: Added tools.
-
- * tools/: New directory for tools relating to evolution.
-
- * tools/killev: New script for killing all evolution-related
- stuff.
-
- * tools/Makefile.am: New file.
-
- * tools/.cvsignore: New file.
-
-2000-04-26 NotZed <NotZed@HelixCode.com>
-
- * tests/test13.c (main): And here too.
-
- * tests/test2.c (main): Same here.
-
- * tests/test1.c (main): Change for removed simpledatawrapper.
-
-2000-04-26 Matt Loper <matt@helixcode.com>
-
- * tests/.cvsignore: Added test13.
-
- * default_user/.cvsignore: New file.
-
- * widgets/e-text/e-text.c (e_text_destroy): Kill text->timer and
- text->timeout on destroy.
-
-2000-04-26 Dan Winship <danw@helixcode.com>
-
- * tests: Update for the camel changes.
-
- * Makefile.am (SUBDIRS): Remove tests. They aren't terribly
- useful/interesting any more for the most part, and they frequently
- don't compile.
-
-2000-04-24 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-text/e-text.c: Made the tooltip show up in the correct
- place and configuration when using the "max_lines", "anchor"
- (untested), or "justification" arguments.
-
-From a patch by Iain Holmes <ih@csd.abdn.ac.uk>
-
- * widgets/e-text/e-text-event-processor-emacs-like.c,
- widget/e-text/e-text-event-processor-types.h,
- widgets/e-text/e-text.c, widgets/e-text/e-text.h: Changed C-w and
- C-y to control the X clipboard. Added double and triple click
- events.
-
-2000-04-24 Fatih Demir <kabalak@gmx.net>
-
- * configure.in : Added tr to ALL_LINGUAS .
-
-2000-04-24 NotZed <NotZed@HelixCode.com>
-
- * tests/test13.c (main): Fixed for method movements.
-
- * tests/test3.c (main): Removed from build, data-wrapper-repository removed.
-
-2000-04-23 NotZed <NotZed@HelixCode.com>
-
- * tests/test2.c (main): Changed to use construct_from_stream.
-
- * tests/test1.c (main): Chagned to use construct_from_stream.
-
-2000-04-24 Matt Loper <matt@helixcode.com>
-
- * default_user/Makefile.am: new file.
-
- * default_user/Main_Shortcuts.xml: New file; is used to fill the
- shortcut bar's "main shortcuts" pane.
-
- * default_user/Other_Shortcuts.xml: New file, used to fill the
- shortcut bar's "other shortcuts" pane.
-
- * default_user/Inbox.mbox: New file. This is the first message a
- new user will see when they fire up Evolution. Needs work.
-
- * Makefile.am: added default_user directory.
- * configure.in: same.
-
-2000-04-23 NotZed <NotZed@HelixCode.com>
-
- * tests/test10.c: Removed some unecessary includes. From
- Ali Abdin <aliabdin@aucegypt.edu>
- (create_sample_mime_message): Changed for date api change.
-
- * tests/Makefile.am (noinst_PROGRAMS): Put test10 back.
-
-2000-04-22 NotZed <NotZed@HelixCode.com>
-
- * tests/test1.c (main): Changed for date api change.
-
-2000-04-20 NotZed <NotZed@HelixCode.com>
-
- * tests/test11.c: Fixed some headers.
-
- * tests/Makefile.am (noinst_PROGRAMS): Removed test9.
- (noinst_PROGRAMS): Removed test12, temporarirly (nntp not being
- built).
- Removed test10.
-
-2000-04-20 Yukihiro Nakai <nakai@gnome.gr.jp>
-
- * configure.in: Add Japanese to ALL_LINGUAS
-
-2000-04-19 Dan Winship <danw@helixcode.com>
-
- * README: More detail on exactly what versions of what libraries
- are needed.
-
-2000-04-18 Dan Winship <danw@helixcode.com>
-
- * tests/*: remove camel-log references
-
-2000-04-17 Dan Winship <danw@helixcode.com>
-
- * configure.in (xmlpatch): Require gnome-xml 1.8.7 (or later,
- but not 2.0). xmlParseMemory's behavior in 1.8.7 is incompatible
- with its behavior in 1.8.6 and earlier.
-
- * tests/test-url.c: New program to test CamelURL
-
-2000-04-16 Christopher James Lahey <clahey@helixcode.com>
-
- * addressbook/backend/ebook/e-card.c,
- addressbook/backend/ebook/e-card.h,
- addressbook/backend/ebook/test-card.c,
- addressbook/backend/pas/pas-backend-file.c,
- addressbook/contact-editor/e-contact-editor.c: Added
- orginizational unit, nickname, and internet free-busy fields.
-
- * addressbook/contact-editor/contact-editor.glade: Renamed some
- incorrectly named fields.
-
-2000-04-16 Christopher James Lahey <clahey@helixcode.com>
-
- * addressbook/backend/ebook/e-card.c,
- addressbook/backend/ebook/e-card.h,
- addressbook/backend/ebook/test-card.c,
- addressbook/backend/pas/pas-backend-file.c,
- addressbook/gui/minicard/e-minicard.c: Added orginization and role
- fields.
-
- * addressbook/contact-editor/contact-editor.glade,
- addressbook/contact-editor/e-contact-editor-strings.h: Renamed
- some incorrectly named fields.
-
- * addressbook/contact-editor/e-contact-editor.c: Added
- orginization and role fields as well as hooking up the birth date
- field.
-
- * addressbook/gui/minicard/e-minicard-view.c: Added a missing include.
-
-2000-04-15 Matt Loper <matt@helixcode.com>
-
- * addressbook/gui/component/addressbook.c
- (search_entry_activated): New function. Gets called when the quick
- search entry is called on to perform a search.
- (make_quick_search_widget): New function; returns a "quick search"
- widget.
- (control_activate): During the construction of the toolbar, a
- "quick search" widget is included.
-
-2000-04-14 Chris Toshok <toshok@helixcode.com>
-
- * tests/.cvsignore: add test12
-
- * tests/test12.c (main): add test for nntp stuff.
-
- * tests/Makefile.am (noinst_PROGRAMS): same.
-
-
-2000-04-14 Christopher James Lahey <clahey@helixcode.com>
-
- * addressbook/backend/ebook/e-card.c,
- addressbook/backend/ebook/e-card.h,
- addressbook/backend/pas/pas-backend-file.c,
- addressbook/backend/pas/pas-backend-ldap.c,
- addressbook/contact-editor/e-contact-editor.c: Added a note field.
-
-2000-04-15 Ettore Perazzoli <ettore@helixcode.com>
-
- * addressbook/backend/ebook/e-card-cursor.h: #include
- "addressbook/backend/ebook" to make sure we pick up the right
- addressbook.h. Butt ugly, but at least it makes it possible for
- me to build Evolution.
-
- * addressbook/gui/minicard/Makefile.am (INCLUDES): Use
- `$(builddir)' so that we pick up the IDL-generated includes
- correctly.
- * addressbook/backend/pas/Makefile.am: Likewise. Also use
- `$(srcdir)'.
-
- * addressbook/backend/ebook/Makefile.am: Use `$(srcdir)' so that
- it works with builddir != srcdir.
- * addressbook/backend/pas/Makefile.am: Likewise.
-
-2000-04-14 Chris Toshok <toshok@helixcode.com>
-
- * addressbook/backend/pas/pas-backend-ldap.c
- (pas_backend_ldap_ensure_connected): don't ldap_simple_bind_s if
- the ldap_open failed, and fix warnings.
- (pas_backend_ldap_build_all_cards_list): don't do search if the
- ensure_connected failed, and fix warnings.
- (pas_backend_ldap_search): same.
- (poll_ldap): fix warnings.
- (pas_backend_ldap_process_get_book_view): same.
- (pas_backend_ldap_get_vcard): same.
- (pas_backend_ldap_load_uri): same.
-
- * configure.in: quiet configure in the case where it can't find
- ldap libs.
-
-2000-04-13 Christopher James Lahey <clahey@helixcode.com>
-
- * addressbook/contact-editor/e-contact-editor.c (extract_info):
- Check for 0 length fields when building the outgoing ECard.
-
-2000-04-13 Christopher James Lahey <clahey@helixcode.com>
-
- * addressbook/backend/pas/pas-book-view.c: Give correct warnings.
-
- * addressbook/backend/ebook/e-card.c (e_card_set_arg): g_strdup
- url and title.
-
-2000-04-13 Chris Toshok <toshok@helixcode.com>
-
- * addressbook/contact-editor/e-contact-editor.c
- (fill_in_info): reflect the title attribute in the contact editor.
- (extract_info): same.
-
- * addressbook/backend/pas/pas-backend-ldap.c: add the title attribute.
-
- * addressbook/gui/minicard/test-reflow.c: add a title.
-
- * addressbook/gui/minicard/e-minicard.c (remodel): add support for
- the title attribute.
-
- * addressbook/backend/ebook/e-card.c (e_card_get_vcard): save out
- the title to the vcard.
-
- * addressbook/backend/ebook/test-card.c: add title field foo to
- the test.
-
- * addressbook/backend/ebook/e-card.c: reflect the title field.
-
- * addressbook/backend/ebook/e-card.h: un-#if 0 the title field.
-
- * addressbook/backend/pas/pas-backend-ldap.c (poll_ldap): new
- function that polls ldap for more search responses.
- (pas_backend_ldap_search): use the async search interface and
- register an idle call to poll for the responses.
- (view_destroy): make sure to g_source_remove the idle id.
-
-2000-04-12 Chris Toshok <toshok@helixcode.com>
-
- * addressbook/backend/pas/pas-backend-file.c (entry_compare):
- rework this function to use a table mapping search field names to
- vcard properties and extra information (such as whether or not the
- property is a list.)
-
- * addressbook/backend/pas/pas-backend-ldap.c
- (construct_email_list): new function, to build the ECardList for
- email addresses.
- (construct_phone_list): new function, to build the ECardList for
- phone numbers.
- (pas_backend_ldap_search): use a table mapping ldap attributes to
- ecard properties, and use the special list construction functions
- if the property calls for it. general cleanup. added a comment
- about not calling ber_free if there was a decoding error.
-
-
-2000-04-12 Matt Loper <matt@helixcode.com>
-
- * art/Makefile.am: Add tigert's contact-dlg-related images.
-
- * addressbook/contact-editor/e-contact-editor.c (_add_images): Add
- tigert's images.
-
- * addressbook/contact-editor/Makefile.am: add EVOLUTION_IMAGES.
-
-2000-04-12 Tuomas Kuosmanen <tigert@gimp.org>
-
- * art/house.png, art/malehead.png, art/cellphone.png,
- art/briefcase.png, art/envelope.png, art/globe.png:
- New icons for the contact manager.. more to follow once I get
- around to do more artist work..
-
-2000-04-12 Chris Toshok <toshok@helixcode.com>
-
- * addressbook/backend/pas/pas-backend-ldap.c
- (pas_backend_ldap_build_all_cards_list): delay the setting of the
- ldap variable until we've ensured we were connected. Also, set
- the search limit to LDAP_MAX_SEARCH_RESPONSES (we'll eventually
- want a user setting here i assume.)
- (pas_backend_ldap_search): same here, and also send back lists of
- CARDS_PER_VIEW_NOTIFICATION length in each
- pas_book_view_notify_add call. also, don't call ber_free if there
- was a decoding error, since the ldap library frees it for us.
-
-2000-04-11 Miguel de Icaza <miguel@gnu.org>
-
- * configure.in (have_pthread): Properly use AC_ARG_WITH
-
-2000-04-11 Chris Toshok <toshok@helixcode.com>
-
- * wombat/Makefile.am (wombat_LDADD): add LDAP_LIBS here.
-
- * configure.in: check for -lldap and -llber and if both are
- present include ldap support in the pas/wombat.
-
- * addressbook/backend/pas/Makefile.am (libpas_la_SOURCES): include
- pas-backend.ldap.c if ENABLE_LDAP.
-
- * addressbook/backend/pas/pas-backend-ldap.c: get searching
- working (converting between the sexp and ldap stuff.)
-
- * wombat/wombat.c (setup_pas): register the ldap pas backend if
- HAVE_LDAP is defined.
-
-2000-04-11 Christopher James Lahey <clahey@helixcode.com>
-
- * configure.in: Changed AC_DEFUN to AC_DEFINE.
-
- * acconfig.h: Added HAVE_TIMEZONE and HAVE_TM_GMTOFF.
-
-2000-04-11 Chris Toshok <toshok@helixcode.com>
-
- * configure.in: check for timezone as a variable (as it is in
- linux, but not in freebsd or netbsd.)
-
-2000-04-11 Larry Ewing <lewing@helixcode.com>
-
- * widgets/e-table/e-cell-toggle.c (etog_draw): update for new
- gdk-pixbuf. Added a disabled chuck of code to do alpha blending
- on pixmaps.
-
-2000-04-11 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-text/e-text.c: Moved some logic a bit. Minor changes.
-
-00-04-11 Iain Holmes <ih@csd.abdn.ac.uk>
-
- * widgets/e-text/e-text.c
- (e_text_set_args): Recalculate bounds when width or clip_width changes.
- (tooltip_event): Forward clicks on the tooltip onto the text item.
- (_do_tooltip): Correct the origin co-ordinates to the items co-ords.
- (e_text_point): Return 0 when the mouse is on the item.
- (_do_tooltip): Make the tooltip obey the parent items
- line_wrap and max_lines.
-
-00-04-11 Chris Toshok <toshok@helixcode.com>
-
- * addressbook/backend/pas/pas-backend-file.c
- (get_e_card_prop): new function, taking code from func_contains to
- get string properties.
- (entry_compare): new function generic, taking strstr-like function
- as a parameter.
- (func_contains): rewrite function to use entry_compare.
- (is_helper): new helper function to map strcmp to a strstr-like
- function.
- (func_is): new function, implementing "is" for searches.
- (endswith_helper): new function.
- (func_endswith) new function, implementing "endswith" for
- searches.
- (beginswith_helper): new function.
- (func_beginswith): new function, implementing "beginswith" for
- searches.
- (compare_email): new function for searching all email addresses of
- a contact.
- (compare_phone): new function for searching all phone numbers of a
- contact.
- (compare_address): new function for searching all addresses of a
- contact (unimplemented as yet).
- (entry_compare): add support for searching the list items "email",
- "phone" and "address".
- (vcard_matches_search): free the esexp_result.
- (entry_compare): we want comparison functions to take 2 args.
-
-2000-04-11 Christopher James Lahey <clahey@helixcode.com>
-
- * addressbook/gui/minicard/e-minicard-view.c: This was setting
- E_REFLOW(view)->items to NULL too soon. Fixed now.
-
-2000-04-11 Chris Toshok <toshok@helixcode.com>
-
- * addressbook/backend/pas/pas-backend-file.c
- (pas_backend_file_search): remove spew.
- (pas_backend_file_process_create_card): move the sync to the
- earliest possible point after the db operation.
- (pas_backend_file_process_remove_card): same.
- (pas_backend_file_process_modify_card): same, and call
- pas_book_respond_modify, not pas_book_respond_remove, here.
-
- * addressbook/gui/component/addressbook.c (card_deleted_cb): new
- function.
- (delete_contact_cb): wire up button to call
- e_minicard_view_remove_selection.
-
- * addressbook/gui/minicard/e-minicard-view.c
- (e_minicard_view_remove_selection): fix warning, and stick "view"
- in the name.
-
-2000-04-10 Christopher James Lahey <clahey@helixcode.com>
-
- * addressbook/backend/ebook/e-book-view.c,
- addressbook/backend/ebook/e-book.c: Changed some incorrect
- gtk_object_refs and gtk_object_unrefs into bonobo_object_refs and
- bonobo_object_unrefs.
-
- * addressbook/backend/pas/pas-card-cursor.c: Changed a
- gtk_object_destroy to a gtk_object_unref.
-
- * addressbook/gui/minicard/e-minicard-view.c,
- addressbook/gui/minicard/e-minicard-view.h: Set a list pointer to
- NULL after freeing its contents. Added
- e_minicard_view_remove_selection function.
-
- * addressbook/gui/minicard/e-reflow.c: Set a list pointer to NULL
- after freeing its contents.
-
-2000-04-11 Chris Toshok <toshok@helixcode.com>
-
- * addressbook/gui/component/addressbook.c (find_contact_cb):
- implement braindead dialog to input the query string for the view.
-
- also, change all callbacks to get the EMinicardView instead of the
- EBook.
-
- * addressbook/gui/minicard/e-minicard-view.c
- (e_minicard_view_get_arg): add missing break.
-
-2000-04-10 Christopher James Lahey <clahey@helixcode.com>
-
- * addressbook/gui/minicard/e-minicard-view.c,
- addressbook/gui/minicard/e-minicard-view.h: Added a "query"
- argument to the e-minicard-view. Documented all the arguments to
- the e-minicard-view.
-
-2000-04-10 Chris Toshok <toshok@helixcode.com>
-
- * addressbook/gui/minicard/e-minicard-view.c (get_view): change
- the empty search string ("") to the valid (contains "full_name" "").
-
- * wombat/Makefile.am (wombat_LDADD): reorder so libeutil.la comes
- after libpas (since it uses the sexp stuff now.)
-
- * addressbook/backend/pas/Makefile.am (INCLUDES): add
- -I$(top_srcdir)/addressbook/backend/ebook
-
- * addressbook/backend/pas/pas-backend-file.c
- (view_destroy): free the search context and unref the sexp.
- (string_to_dbt): save the zero byte of strings, so we don't have
- to g_strndup everywhere.
- (func_contains): new function, implementing the (contains) search
- function.
- (vcard_matches_search): generic predicate to tell whether or not a
- vcard entry matches the current book view.
- (pas_backend_file_search): rip some of this code out of
- get_book_view (the portion building the list of cards) and make it
- use the e-sexp stuff.
- (pas_backend_file_process_create_card): use vcard_matches_search
- to only notify if the card will appear in the view.
- (pas_backend_file_process_remove_card): use vcard_matches_search
- to only notify if the card will be removed from the view.
- (pas_backend_file_process_modify_card): use vcard_matches_search
- to notify if the modified card was added, removed, or changed in
- the view.
-
-2000-04-10 Miguel de Icaza <miguel@gnu.org>
-
- * configure.in (GNOME_PRINT_CFLAGS): Update to support
- --disable-threads correctly.
-
-2000-04-10 Chris Toshok <toshok@helixcode.com>
-
- * addressbook/backend/pas/pas-backend-file.c
- (pas_backend_file_process_get_book_view): use view != NULL instead
- of checking db_error when we call pas_book_respond_get_book_view)
-
-2000-04-10 Dan Winship <danw@helixcode.com>
-
- * configure.in: check for mkstemp
-
-2000-04-10 Damon Chaplin <damon@helixcode.com>
-
- * configure.in (AC_OUTPUT): removed libical stuff since it has its
- own configure.in.
-
-2000-04-10 Christopher James Lahey <clahey@helixcode.com>
-
- * addressbook/backend/ebook/e-book-view.c: Fixed a bug where I was
- sending the wrong information to some callbacks.
-
- * addressbook/backend/ebook/e-card.c,
- addressbook/backend/ebook/e-card.h: Added an e_card_duplicate
- function. Made ids get stored in vcards. Made sure to delete the
- url if it exists.
-
- * addressbook/backend/pas/Makefile.am: Made pas include
- addressbook/backend/ebook/ in the search path.
-
- * addressbook/backend/pas/pas-backend-file.c: Fixed some bugs and
- made the create card function store the generated id in the card
- being saved.
-
- * addressbook/backend/pas/pas-book-view.c: Fixed a double free
- bug.
-
- * addressbook/contact-editor/e-contact-editor.c: Fixed some bugs.
- Made the contact editor actually return a valid card when
- gtk_object_get(editor, "card", ...) is called.
-
- * addressbook/contact-editor/e-contact-editor.h: Fixed a copy and
- paste error.
-
- * addressbook/gui/component/addressbook.c: Made this get the card
- properly.
-
- * addressbook/gui/minicard/Makefile.am: Made this include
- contact-editor directory in the search path and link against
- libecontacteditor so that double clicking can open a dialog.
-
- * addressbook/gui/minicard/e-minicard.c: Fixed some small bugs.
- Made double clicking open a contact editor dialog if this minicard
- is contained in a minicard view. (It needs the minicard view to
- get the EBook to save to.
-
- * wombat/Makefile.am: Link wombat against libebook, since
- pas-backend-file now uses ECard.
-
-2000-04-09 Matt Loper <matt@helixcode.com>
-
- * addressbook/gui/component/addressbook.c (control_activate): Make
- "New Contact" menuitem add a card with new_contact_cb().
-
- * addressbook/Makefile.am: Compile contact-editor, _then_ gui,
- since the gui now depends on the contact editor (shouldn't the
- contact-editor directory be moved into 'gui'?).
-
- * addressbook/gui/component/addressbook.c (card_added_cb): New
- function. Gets called when a card is successfully added via the
- contact-editor.
- (new_contact_cb): New function. Gets called when a user clicks the
- "new contact" button on the toolbar, and creates a contact-editor
- to edit a new contact entry.
- (control_activate): Call gnome_app_fill_toolbar_with_data()
- instead of gnome_app_fill_toolbar(), so that our toolbar can find
- the right book to add a new card to.
- (addressbook_factory): On an "activate" signal, send the book up
- to control_activate_cb.
-
- * addressbook/gui/component/addressbook-factory.c (init_bonobo):
- Call glade_gnome_init(), so that our contact-editor (which
- requires glade) doesn't barf.
-
- * addressbook/gui/component/Makefile.am: added the contact-editor
- to our libraries and include files.
-
- * addressbook/contact-editor/e-contact-editor.c
- (e_contact_editor_new): Set "card" gtk property to the passed-in
- card property.
-
- * addressbook/gui/component/addressbook.c (addressbook_factory):
- Added gtk_widget_push/pop_colormap/visual, which I assume is
- necessary for canvas use.
-
-2000-04-08 Christopher James Lahey <clahey@helixcode.com>
-
- * addressbook/contact-editor/Makefile.am,
- addressbook/contact-editor/e-contact-editor.c,
- addressbook/contact-editor/e-contact-editor.h,
- addressbook/contact-editor/test-editor.c: Made the contact editor
- load from an ECard.
-
- * addressbook/backend/ebook/e-card.c,
- addressbook/backend/ebook/e-card.h,
- addressbook/gui/minicard/e-minicard.c: Added support for the URL
- field.
-
-2000-04-08 Christopher James Lahey <clahey@helixcode.com>
-
- * addressbook/backend/ebook/e-card.c (e_card_get_vcard): Fixed a
- small typo.
-
-2000-04-08 Dan Winship <danw@helixcode.com>
-
- * art/Makefile.am: pixmap_DATA should have been images_DATA (after
- pixmapdir was renamed to imagesdir)
-
-2000-04-08 Christopher James Lahey <clahey@helixcode.com>
-
- * addressbook/gui/minicard/.cvsignore,
- addressbook/gui/minicard/Makefile.am,
- addressbook/gui/minicard/e-minicard-view.c,
- addressbook/gui/minicard/e-minicard-view.h,
- addressbook/gui/minicard/e-minicard.c,
- addressbook/gui/minicard/e-minicard.h,
- addressbook/gui/minicard/e-reflow-sorted.c,
- addressbook/gui/minicard/e-reflow-sorted.h,
- addressbook/gui/minicard/e-reflow.c,
- addressbook/gui/minicard/e-reflow.h,
- addressbook/gui/minicard/test-minicard-view.c,
- addressbook/gui/minicard/test-reflow.c,
- widgets/e-minicard/.cvsignore, widgets/e-minicard/Makefile.am,
- widgets/e-minicard/e-minicard-label.c,
- widgets/e-minicard/e-minicard-label.h,
- widgets/e-minicard/e-minicard-view.c,
- widgets/e-minicard/e-minicard-view.h,
- widgets/e-minicard/e-minicard.c, widgets/e-minicard/e-minicard.h,
- widgets/e-minicard/e-reflow-sorted.c,
- widgets/e-minicard/e-reflow-sorted.h,
- widgets/e-minicard/e-reflow.c, widgets/e-minicard/e-reflow.h,
- widgets/e-minicard/test-minicard-label.c,
- widgets/e-minicard/test-minicard-view.c,
- widgets/e-minicard/test-minicard.c,
- widgets/e-minicard/test-reflow.c: CVS move mistake. Fixed the
- correct changes in the correct places.
-
-2000-04-08 Christopher James Lahey <clahey@helixcode.com>
-
- * art/Makefile.am: pixmap_DATA isn't defined so don't use it as a variable.
-
- * addressbook/gui/component/,
- addressbook/gui/component/.cvsignore, addressbook/gui/Makefile.am,
- addressbook/gui/component/addressbook-factory.c,
- addressbook/gui/component/addressbook.c,
- addressbook/gui/component/addressbook.gnorba,
- addressbook/gui/component/addressbook.h: New directory to proivde
- the component for contact management. Simply uses an e-minicard-view.
-
- * addressbook/gui/minicard/e-minicard-view.c,
- addressbook/gui/minicard/e-minicard-view.h: New subclass of
- e-reflow-sorted that takes an EBook and uses it to compute the
- card data to display.
-
- * addressbook/gui/minicard/e-minicard.c,
- addressbook/gui/minicard/e-minicard.h: This now backends to a
- ECard instead of a ETableModel.
-
- * addressbook/gui/minicard/e-reflow.c,
- addressbook/gui/minicard/e-reflow.h: This now has a virtualized
- add method.
-
- * addressbook/gui/minicard/e-reflow-sorted.c,
- addressbook/gui/minicard/e-reflow-sorted.h: New subclass of
- e-reflow that allows the data to be sorted on the fly.
-
- * addressbook/gui/minicard/test-minicard-view.c: New test to test
- the new minicard view.
-
- * addressbook/gui/minicard/test-reflow.c: Uses the new ECard
- backend of the e-minicard.
-
- * addressbook/gui/minicard/.cvsignore,
- addressbook/gui/minicard/Makefile.am: Added new test. Fixed
- dependencies. Added new files.
-
- * addressbook/gui/, addressbook/gui/Makefile.am,
- addressbook/gui/.cvsignore: New directory for addressbook gui
- bits. Added subdirectories. Created an initial .cvsignore.
-
- * addressbook/Makefile.am (SUBDIRS): Removed demo and added gui.
-
- * addressbook/backend/pas/pas-backend-file.c: Added code to do
- notification on bookviews when changes in the backend are made.
-
- * addressbook/backend/pas/pas-book-view.c,
- addressbook/backend/pas/pas-book-view.h: Added helper functions to
- notify the view about the addition or modification of a single
- card. Fixed a mistaken extra free.
-
- * addressbook/backend/ebook/e-card-list-iterator.h: Fixed
- incorrect parent class.
-
- * addressbook/backend/ebook/test-client.c: Made this accept an
- optional parameter that specifies the vcard to add.
-
- * configure.in: Replaced widgets/e-minicard/Makefile and
- addressbook/demo/Makefile with addressbook/gui/minicard/Makefile
- and addressbook/gui/component/Makefile respectively.
-
- * widgets/Makefile.am: Removed e-minicard since it's being moved
- to addressbook/gui/minicard.
-
- * widgets/e-text/e-text.c: Fixed the border width around tooltips
- and made the main tooltip area yellow.
-
-2000-04-08 Dan Winship <danw@helixcode.com>
-
- * configure.in, acconfig.h: add SYSTEM_MAIL_DIR
-
-2000-04-08 Jesus Bravo Alvarez <jba@pobox.com>
-
- * configure.in (ALL_LINGUAS): Added Galician (gl).
-
-2000-04-07 Jeffrey Stedfast <fejj@stampede.org>
- * configure.in: Modified to create camel/providers/smtp/Makefile
-
-2000-04-07 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-text/e-text.c: Made text tooltips appear in place.
- Iain figured out that to get them to not appear, we hide the
- tooltip when the mouse leaves the tooltip window, not the canvas
- item (this works because the tooltip window always covers the
- canvas item completely.)
-
-2000-04-07 Matt Loper <matt@helixcode.com>
-
- * addressbook/demo/addressbook.c (control_activate_cb): New
- function. Called when the control is (de)activated.
- (control_activate): New function; called when the control is
- activated, and sets up toolbar/menu times.
- (control_deactivate): New function; removes those toolbar/menu
- items.
- (do_nothing_cb): Does nothing :-)
- (addressbook_factory): Hook up to control_activate_cb().
-
-2000-04-07 Chris Toshok <toshok@laptoph.xtoph.org>
-
- * addressbook/backend/pas/pas-backend-file.c
- (pas_backend_file_process_get_book_view): correctly (well,
- untested) implement.
- (view_destroy): new function.
-
-2000-04-06 Christopher James Lahey <clahey@helixcode.com>
-
- * addressbook/demo/demo.c, addressbook/demo/addressbook-widget.c:
- Changed calls to e_cell_text_new to match new function signature.
-
-2000-04-06 Miguel de Icaza <miguel@gnu.org>
-
- * art/Makefile.am (images_DATA): Renamed from pixmaps to images.
-
-2000-04-05 Matt Loper <matt@helixcode.com>
-
- * README: Added wombat.
-
-2000-04-04 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-text/e-text-test.c: Got rid of some runtime errors.
- Changed to "fixed" font so that it will work on everyone's
- machine. Added a white background rectangle. Made resizing the
- window resize the contained text item. Changed to using affines
- (e_canvas_item_move_absolute) instead of "x" and "y" attributes.
- Set the text in the entries so that they match the original values
- of the displayed text object.
-
-2000-04-04 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-minicard/e-minicard.c: Fixed some referencing and
- lifetime issues.
-
-2000-04-04 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-text/e-text.c: Removed an unnecessary get_bounds call.
-
- (From a patch by Iain Holmes <ih@csd.abdn.ac.uk>)
-
- * widgets/e-text/e-text.c: Made tooltips look more like the
- underlying text. Made tooltips show up more consistently.
-
-2000-04-04 Christopher James Lahey <clahey@helixcode.com>
-
- * addressbook/demo/Makefile.am, addressbook/demo/e-test-model.c,
- addressbook/demo/e-test-model.h: Changed this to backend to an
- ebook.
-
- * addressbook/backend/ebook/e-card-iterator.c,
- addressbook/backend/ebook/e-card-iterator.h,
- addressbook/backend/ebook/e-card-list-iterator.c,
- addressbook/backend/ebook/e-card-list.c,
- addressbook/backend/ebook/e-card-list.h,
- addressbook/backend/ebook/e-card.c,
- addressbook/backend/ebook/e-card.h: Fixed const correctness and
- changed a couple of functions to be external.
-
- * addressbook/Makefile.am: Fixed subdir ordering.
-
-2000-04-04 Christopher James Lahey <clahey@helixcode.com>
-
- * addressbook/backend/ebook/e-book-view.c: Fixed an incorrect
- function.
-
- * addressbook/backend/ebook/e-book-view.h,
- addressbook/backend/ebook/e-book.h: Fixed some incorrect function
- pointer declarations.
-
- * addressbook/backend/ebook/e-card-iterator.c,
- addressbook/backend/ebook/e-card-iterator.h,
- addressbook/backend/ebook/e-card-list-iterator.c,
- addressbook/backend/ebook/e-card-list-iterator.h,
- addressbook/backend/ebook/e-card-list.c,
- addressbook/backend/ebook/e-card-list.h,
- addressbook/backend/ebook/e-card.c,
- addressbook/backend/ebook/e-card.h,
- addressbook/backend/ebook/test-card.c: Built new iterator system
- for getting fields with multiple entries.
-
- * addressbook/backend/ebook/Makefile.am: Added new files
- addressbook/backend/ebook/e-card-iterator.c,
- addressbook/backend/ebook/e-card-iterator.h,
- addressbook/backend/ebook/e-card-list-iterator.c,
- addressbook/backend/ebook/e-card-list-iterator.h,
- addressbook/backend/ebook/e-card-list.c, and
- addressbook/backend/ebook/e-card-list.h.
-
-2000-04-04 Yuri Syrota <rasta@renome.rovno.ua>
-
- * configure.in: Added uk to ALL_LINGUAS.
-
-2000-04-04 Andreas Hyden <a.hyden@cyberpoint.se>
-
- * configure.in: Added no and sv to ALL_LINGUAS.
-
-2000-04-03 Christopher James Lahey <clahey@helixcode.com>
-
- * addressbook/backend/ebook/e-card-cursor.h,
- addressbook/backend/ebook/e-card.c: A bit of clean up.
-
- * addressbook/backend/ebook/e-book-types.h,
- addressbook/backend/ebook/e-book-view-listener.c,
- addressbook/backend/ebook/e-book-view-listener.h,
- addressbook/backend/ebook/e-book-view.c,
- addressbook/backend/ebook/e-book-view.h,
- addressbook/backend/pas/pas-book-view.c,
- addressbook/backend/pas/pas-book-view.h: New files for live views.
-
- * addressbook/backend/ebook/Makefile.am,
- addressbook/backend/ebook/e-book-listener.c,
- addressbook/backend/ebook/e-book-listener.h,
- addressbook/backend/ebook/e-book.c,
- addressbook/backend/ebook/e-book.h,
- addressbook/backend/ebook/test-client-list.c,
- addressbook/backend/ebook/test-client.c,
- addressbook/backend/pas/pas-backend-file.c,
- addressbook/backend/pas/pas-book.c,
- addressbook/backend/pas/pas-book.h,
- addressbook/backend/idl/addressbook.idl: Added live views and
- searching to the interface (neither is working yet.)
-
-2000-04-01 Matt Loper <matt@helixcode.com>
-
- * tests/.cvsignore: Added test-movemail.
-
- * art/.cvsignore: New file.
-
-2000-03-31 Christopher James Lahey <clahey@helixcode.com>
-
- * addressbook/demo/demo.c, addressbook/demo/addressbook-widget.c:
- Added some missing gtk_object_refs.
-
-2000-03-30 Matt Loper <matt@helixcode.com>
-
- * addressbook/backend/pas/pas-backend-file.c
- (pas_backend_file_build_all_cards_list): Get first card (with
- R_FIRST) on first seq().
-
-2000-03-30 Chris Toshok <toshok@laptoph.xtoph.org>
-
- * addressbook/backend/pas/pas-backend-ldap.h: new-file
- * addressbook/backend/pas/pas-backend-ldap.c: new file
-
-2000-03-30 Dan Winship <danw@helixcode.com>
-
- * configure.in:
- * Makefile.am:
- * art/Makefile.am: install new shortcut bar pixmaps.
-
-2000-03-30 Tuomas Kuosmanen <tigert@gimp.org>
-
- * art/evolution-calendar.png art/evolution-inbox.png
- art/evolution-tasks.png art/evolution-contacts.png
- art/evolution-notes.png evolution-today.png:
- added some artwork for the main shortcutbar.. someone
- could stick them in it.
-
-2000-03-29 Christopher James Lahey <clahey@helixcode.com>
-
- * addressbook/backend/ebook/e-card-cursor.c: Fixed management of
- the corba-cursor object by calling CORBA_Object_duplicate on it on
- e-card-cursor creation and calling CORBA_Object_release on
- e-card-cursor destruction. Also, properly free string returned
- from Evolution_CardCursor_get_nth function.
-
-2000-03-29 Matt Loper <matt@helixcode.com>
-
- * addressbook/backend/ebook/test-client.c (get_cursor_cb): Added
- some debugging.
-
- * addressbook/backend/ebook/e-book-listener.c: Added inline
- documentation for exposed functions.
- * addressbook/backend/ebook/e-card-cursor.c: same.
- * addressbook/backend/ebook/e-card.c: same.
-
- * Makefile.am: add calendar compilation back in.
-
- * addressbook/backend/pas/pas-book-factory.c
- (PAS_BOOK_FACTORY_GOAD_ID): changed to
- "evolution:addressbook-server".
-
- * addressbook/backend/pas/Makefile.am: no need to install a
- .gnorba file from here, as the wombat.gnorba file in
- evolution/wombat will do its job.
-
- * addressbook/backend/ebook/test-client.c (ebook_create): if
- ebook_new fails, print a warning and return.
-
- * addressbook/backend/ebook/e-book.c (CARDSERVER_GOAD_ID): changed
- to "evolution:addressbook-server".
-
- * wombat/wombat.c: Changed headerfile path.
-
- * wombat/Makefile.am: Use relative paths to libraries in the build
- tree, rather than requiring libraries (such as libpcs) to already
- be installed.
-
-2000-03-28 Matt Loper <matt@helixcode.com>
-
- * wombat/Makefile.am: new file.
-
- * wombat/wombat.gnorba: Cleaned up.
-
- * wombat/wombat.c (setup_pcs): filled in the rest.
-
- * Makefile.am: added wombat.
-
- * wombat/wombat.gnorba: new file.
-
- * wombat/.cvsignore: new file.
-
- * wombat/wombat.c (setup_pcs): fill out this function some.
-
- * configure.in: added wombat.
-
-2000-03-28 Chris Toshok <toshok@laptoph.xtoph.org>
-
- * addressbook/backend/pas/pas-card-cursor.c (create_cursor): use
- g_new0 to allocate the BonoboObjectServant.
-
- * addressbook/backend/pas/pas-backend-file.c
- (pas_backend_file_build_all_cards_list): remove unnecessary
- strdup/free.
-
-2000-03-28 Christopher James Lahey <clahey@helixcode.com>
-
- * addressbook/backend/pas/pas-backend-file.c: Removed an infinite
- loop.
-
- * addressbook/backend/ebook/test-client-list.c: New test that
- doesn't add an extra database item.
-
- * addressbook/backend/ebook/Makefile.am,
- addressbook/backend/ebook/.cvsignore: Added test-client-list.
-
-2000-03-28 Christopher James Lahey <clahey@helixcode.com>
-
- * addressbook/backend/pas/pas-card-cursor.c: Fixed memory
- allocation.
-
- * addressbook/backend/pas/pas-backend-file.c: Fixed memory
- allocation. Made database stuff not do an extra entry.
-
- * addressbook/backend/ebook/test-client.c: Add test for
- get_all_cards functionality. Changed database name to test.db.
-
- * addressbook/backend/ebook/e-card-cursor.c: Changed bonobo_object
- to gtk_object in a couple of places.
-
-2000-03-28 Chris Toshok <toshok@laptoph.xtoph.org>
-
- * addressbook/backend/pas/pas-backend-file.c
- (pas_backend_file_create_unique_id): create id's for entries using
- the following format: ("pas-id-%08lX%08X", time(NULL), c++).
-
-2000-03-27 Dan Winship <danw@helixcode.com>
-
- * tests/test-movemail.c: new test program. Can be used to copy POP
- mail into your evolution inbox.
-
-2000-03-27 Chris Toshok <toshok@laptoph.xtoph.org>
-
- * addressbook/backend/pas/pas-backend-file.c
- (pas_backend_file_get_vcard): remove unneeded g_strdup;
- (get_length): implement function.
- (get_nth): implement function.
- (cursor_destroy): free up the internal glist of vcards, and fix
- warning.
- (pas_backend_file_build_all_cards_list): new function, to build up
- the list of cards in the db.
- (pas_backend_file_process_get_all_cards): call
- pas_backend_file_build_+all_cards_list, and fix warning.
-
-2000-03-27 Christopher James Lahey <clahey@helixcode.com>
-
- * addressbook/backend/ebook/test-card.c: Fixed some warnings.
-
- * addressbook/backend/ebook/test-client.c: Added a section to test
- cursors and returning an id when adding.
-
- * addressbook/backend/ebook/e-card-pairs.h: Removed the address
- pairs since they were added to e-card.c.
-
- * addressbook/backend/ebook/e-card.c,
- addressbook/backend/ebook/e-card.h: Made the set_id function take
- a const char *.
-
- * addressbook/backend/ebook/e-book-listener.c,
- addressbook/backend/ebook/e-book-listener.h,
- addressbook/backend/ebook/e-book.c,
- addressbook/backend/ebook/e-book.h,
- addressbook/backend/idl/addressbook.idl,
- addressbook/backend/pas/pas-backend-file.c,
- addressbook/backend/pas/pas-book.c,
- addressbook/backend/pas/pas-book.h: Added a get_all_cards function
- and made the response to the create_card function include the card
- id.
-
- * addressbook/backend/ebook/Makefile.am: Added e-card-cursor.c and
- e-card-cursor.h.
-
- * addressbook/backend/ebook/e-card-cursor.c,
- addressbook/backend/ebook/e-card-cursor.h: New class for proxying
- to an Evolution_CardCursor.
-
- * addressbook/backend/pas/Makefile.am: Added pas-card-cursor.c and
- pas-card-cursor.h.
-
- * addressbook/backend/pas/pas-card-cursor.c,
- addressbook/backend/pas/pas-card-cursor.h: New bonobo class for
- making an Evolution_CardCursor server.
-
-2000-03-27 NotZed <NotZed@HelixCode.com>
-
- * tests/test9.c (main): This test is basically now invalid.
- * tests/test11.c (main): Fix for async search api. Probably works.
- Removed camel-mbox-*.h headers, should be private.
-
-2000-03-27 Tuomas Kuosmanen <tigert@gimp.org>
- * art/attachment.xpm art/mail-new.xpm art/mail-read.xpm
- art/mail-replied.xpm art/mark.xpm art/meeting.xpm
- art/priority-high.xpm art/priority-low.xpm
-
- Added some new icons for the message-list view..
-
-2000-03-26 Chris Toshok <toshok@laptoph.xtoph.org>
-
- * configure.in: check for db_185.h (present in newer db
- distributions.)
-
- * addressbook/backend/pas/pas-backend-file.c
- (pas_backend_file_create_unique_id): new function.
- (pas_backend_file_process_create_card): call
- pas_backend_file_create_unique_id and pas_book_notify_add (if the
- db->put was successful). also, sync out db.
- (pas_backend_file_process_remove_card): call
- pas_book_notify_remove if the db->del was successful, and sync out
- db.
- (pas_backend_file_process_modify_card): call
- pas_book_notify_change if db->put was successful, and sync out db.
- (string_to_dbt): new function.
- (pas_backend_file_process_create_card): use string_to_dbt
- (pas_backend_file_process_remove_card): likewise
- (pas_backend_file_process_modify_card): likewise
- (pas_backend_file_get_vcard): likewise
- (pas_backend_file_upgrade_db): new function, to upgrade a db file
- if we change the data format.
- (pas_backend_file_maybe_upgrade_db): check db version vs. current
- code version, and upgrade it necessary.
- (pas_backend_file_load_uri): call pas_backend_file_maybe_upgrade.
-
-2000-03-26 Christopher James Lahey <clahey@helixcode.com>
-
- * addressbook/backend/ebook/test-client.c: Load an ECard instead
- of a VCard and then get the VCard from that ECard. Just tests
- ECard and the client stuff at the same time. Also, replaces
- carriage returns with newlines.
-
- * addressbook/backend/ebook/e-book.c: Fixed a small parity error.
-
-2000-03-25 Chris Toshok <toshok@laptoph.xtoph.org>
-
- * addressbook/backend/ebook/test-client.c: create a card and then
- look it up.
-
-2000-03-26 Chris Toshok <toshok@laptoph.xtoph.org>
-
- * addressbook/backend/pas/pas-backend-file.c
- (pas_backend_file_process_create_card): add db calls to flesh out
- the interface. hardcoded id that needs to change, once we decide
- how we're going to create it.
- (pas_backend_file_process_remove_card): add db calls to flesh out
- the interface.
- (pas_backend_file_process_modify_card): likewise
- (pas_backend_file_process_check_connection): likewise
- (pas_backend_file_get_vcard): likewise
- (pas_backend_file_load_uri): likewise
-
-2000-03-26 Christopher James Lahey <clahey@helixcode.com>
-
- * addressbook/backend/ebook/e-book.c: Set the card id properly
- when retrieving a card.
-
-2000-03-22 NotZed <NotZed@HelixCode.com>
-
- * e-util/e-sexp.h: Formatting cleanup.
-
-2000-03-07 NotZed <NotZed@HelixCode.com>
-
- * e-util/Makefile.am (libeutil_la_SOURCES): s-sexp.h -> e-sexp.h.
-
- * addressbook/backend/ebook/e-card.c,
- addressbook/backend/ebook/e-card.h: Added the ability to set the
- card's id (and made getting it work correctly also.)
-
-2000-03-25 Chris Toshok <toshok@laptoph.xtoph.org>
-
- * addressbook/backend/ebook/e-book.c (e_book_pop_op): pass GList*
- as second parameter to g_list_remove_link, not the data pointer.
-
-2000-03-26 Christopher James Lahey <clahey@helixcode.com>
-
- * addressbook/backend/ebook/e-card-types.h: Removed the
- address->description field.
-
- * addressbook/backend/ebook/e-card.c: Added VCard output and
- the use of GtkArguments.
-
- * addressbook/backend/ebook/test-card.c: Updated this to use the
- GtkArguments.
-
- * addressbook/backend/ebook/e-book.c: Fixed a memory leak.
-
-2000-03-25 Matt Loper <matt@helixcode.com>
-
- * ebook/e-book.c,
- ebook/e-book.h,
- ebook/e-book.h,
- ebook/e-card-fields.h,
- ebook/e-card.h,
- ebook/e-commerce.h: old, removed. Up-to-date EBook stuff is kept
- in addressbook/backend/ebook.
-
-2000-03-23 Christopher James Lahey <clahey@helixcode.com>
-
- * addressbook/backend/ebook/e-card.c,
- addressbook/backend/ebook/e-card.h,
- addressbook/backend/ebook/e-card-types.h,
- addressbook/backend/ebook/e-card-pairs.h,
- addressbook/backend/ebook/test-card.c: Added parsing and testing
- for name, full name, birthday, telephone, email, and street
- address properties.
-
-2000-03-22 Christopher James Lahey <clahey@helixcode.com>
-
- * addressbook/backend/ebook/.cvsignore,
- addressbook/backend/pas/.cvsignore,
- addressbook/backend/idl/.cvsignore,
- addressbook/backend/.cvsignore: Updated .cvsignore files.
-
-2000-03-22 Christopher James Lahey <clahey@helixcode.com>
-
- * addressbook/Makefile.am, configure.in: Added the
- addressbook/backend directory.
-
- * addressbook/backend/Makefile.am: Removed the libversit directory
- as it's now included in the base evolution directory.
-
- * addressbook/backend/ebook/e-card-pairs.h,
- addressbook/backend/ebook/Makefile.am: Changed the place where
- libversit is looked for.
-
- * addressbook/backend/ebook/e-book-listener.c: Fixed some
- indentation.
-
- * addressbook/backend/ebook/e-card-pairs.h,
- addressbook/backend/ebook/e-card-types.h: Commented out some code
- to get this to compile.
-
- * addressbook/backend/ebook/e-card.c,
- addressbook/backend/ebook/e-card.h: Turned this into a GTK+
- object.
-
- * addressbook/backend/pas/pas.c,
- addressbook/backend/ebook/test-client.c: Include gnome.h and
- gnorba.h.
-
- * addressbook/backend/idl/addressbook.idl: Include Bonobo.idl
- instead of bonobo-unknown.idl.
-
- * addressbook/backend/pas/pas-backend-file.c,
- addressbook/backend/pas/pas-book.c,
- addressbook/contact-editor/test-editor.c,
- addressbook/contact-editor/e-contact-editor.c,
- addressbook/printing/e-contact-print.c,
- addressbook/printing/test-contact-print-style-editor.c,
- addressbook/printing/test-print.c: Killed some warnings.
-
-2000-03-21 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-text/e-text.c: Changed gnome_canvas_item_grab_focus to
- e_canvas_item_grab_focus.
-
-2000-03-21 Christopher James Lahey <clahey@helixcode.com>
-
- * addressbook/demo/addressbook-widget.c: Make background pixmap
- get properly set to NULL.
-
-2000-03-20 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-text/e-text.c, widgets/e-text/e-text.h: Added the
- ability to access the text event processor.
-
-2000-03-13 Christopher James Lahey <clahey@helixcode.com>
-
- * addressbook/demo/addressbook-widget.c: Made the addressbook
- component look in the users home directory for the addressbook.xml
- file.
-
-2000-03-20 Matt Loper <matt@helixcode.com>
-
- * tests/ui-tests/.cvsignore: added filter.
-
- * addressbook/demo/.cvsignore: added test-addressbook.
-
-2000-03-17 Elliot Lee <sopwith@redhat.com>
- * calendar/cal-client/Makefile.am,
- calendar/cal-util/Makefile.am, calendar/gui/Makefile.am,
- calendar/pcs/Makefile.am, mail/Makefile.am,
- widgets/e-text/Makefile.am: Fix for srcdir != builddir.
-
-2000-03-14 Dan Winship <danw@helixcode.com>
-
- * Makefile.am (SUBDIRS): build shell before mail, since mail
- relies on the shell idl files being compiled.
-
-2000-03-13 Christopher James Lahey <clahey@helixcode.com>
-
- * addressbook/demo/Makefile.am: Added files for addressbook bonobo
- component. Changed non bonobo version to compile as
- test-addressbook.
-
- * addressbook/demo/addressbook.c,
- addressbook/demo/addressbook.gnorba,
- addressbook/demo/addressbook.h,
- addressbook/demo/addressbook-factory.c,
- addressbook/demo/addressbook-widget.c,
- addressbook/demo/addressbook-widget.h: New factory to create an
- addressbook bonobo component.
-
-2000-03-12 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-text/.cvsignore: Added e-text-test.
-
- * addressbook/demo/e-test-model.c,
- addressbook/demo/e-test-model.h: A model storing data in an array
- of Address objects.
-
- * addressbook/demo/demo.c: Changed to use
- addressbook/demo/e-test-model.c and
- addressbook/demo/e-test-model.h.
-
- * addressbook/demo/Makefile.am: Added e-test-model.c and
- e-test-model.h.
-
-2000-03-12 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/Makefile.am: Rearranged SUBDIRS for dependencies.
-
- * widgets/e-text/e-text-model.c, widgets/e-text-model.h: New
- object which stores a piece of text data. All methods are
- virtual.
-
- * widgets/e-text/e-text.c, widgets/e-text/e-text.h: Modified this
- to use an ETextModel for its data.
-
- * widgets/e-text/Makefile.am: Added e-text-model.c and e-text-model.h.
-
- * widgets/e-minicard/test-minicard-label.c: Made this work again.
-
- * widgets/e-minicard/e-minicard.c,
- widgets/e-minicard/e-minicard.h: Made this use an ETableModel to
- get its data.
-
- * widgets/e-minicard/e-minicard-label.c,
- widgets/e-minicard/e-minicard-label.h: Added the ability to set
- the text model used for the contained text widget.
-
- * widgets/e-minicard/Makefile.am: Added e-table since e-minicard
- is now dependent on an e-table-model for its data.
-
- * addressbook/demo, addressbook/demo/.cvsignore,
- addressbook/demo/Makefile.am, addressbook/demo/demo.c,
- addressbook/demo/spec: A new program to test ETable and EMinicard
- integration.
-
- * configure.in: Added addressbook/demo/Makefile.
-
- * addressbook/Makefile.am: Added the demo/ subdirectory.
-
-2000-03-10 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-minicard/e-minicard.c,
- widgets/e-minicard/e-minicard-label.c,
- widgets/e-minicard/e-minicard-label.h,
- widgets/e-minicard/e-reflow.c, widgets/e-minicard/test-reflow.c,
- widgets/e-text/e-text.c, widgets/e-text/e-text.h: Adapted to use
- the new e-canvas reflow system.
-
-2000-03-07 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-text/e-text.c, widgets/e-text/e-text.h: Added a
- "break_characters" argument. It lets you define a set of
- characters which should cause optional linebreaks to occur. Made
- setting the "clip_height" argument to -1 mean no height clipping.
- Moved calling the "resize" signal into an idle handler to avoid
- reentering the canvas update loop. Made EText recalc bounds if
- the affine has changed. Fixed up tooltip_count (this counts the
- number of ENTER and LEAVE events.)
-
- * widgets/e-text/e-text-test.c: Got rid of a few warnings.
-
- * widgets/e-minicard/e-minicard-label.h: Reindent a few lines.
-
- * widgets/e-minicard/e-minicard.c,
- widgets/e-minicard/e-minicard-label.c: Switch from using "x" and
- "y" to set the children's position to using
- e_canvas_item_move_absolute.
-
-2000-03-05 Matt Loper <matt.loper@splashtech.com>
-
- * tests/ui-tests/message-browser.c: Commenting added.
- (on_url_data_requested): renamed from "on_url_requested", to
- reflect that a stream of data is what's actually being asked for.
- (hydrate_persist_stream_from_gstring): New function.
- (camel_stream_to_gstring): New function.
- (on_object_requested): Cleaned up.
-
-2000-03-04 bertrand <bertrand@helixcode.com>
-
- * tests/ui-tests/Makefile.am: add bonobo to the build
- process.
-
- * tests/ui-tests/message-browser.c (main):
- initialize Bonobo. Use bonobo_main.
- (get_gtk_html_contents_window): set signal handlers
- for url requests and objects requests.
- (on_object_requested): answer to object requests.
-
-2000-03-03 bertrand <bertrand@helixcode.com>
-
- * tests/ui-tests/message-browser.c (main): initialize
- gdkrgb. Push visual/colormap.
- (on_url_requested): in the case where a camel url is requested,
- write the camel stream to gtkhtml.
-
- * tests/ui-tests/Makefile.am (filter_LDADD): add
- gnomeprint in the lib list.
-
-2000-03-01 Ettore Perazzoli <ettore@helixcode.com>
-
- * configure.in: Build `filter/Makefile'. Added check for GtkHTML.
- Set `GTKHTML_CFLAGS' and `GTKHTML_LIBS' to the appropriate values
- for linking with GtkHTML.
-
-2000-03-01 Federico Mena Quintero <federico@helixcode.com>
-
- * configure.in (AC_OUTPUT): Added calendar/idl/Makefile,
- calendar/cal-client/Makefile, and calendar/pcs/Makefile to the
- list of files to generate.
-
-2000-02-29 Iain Holmes <ih@csd.abdn.ac.uk>
-
- * widgets/e-text/e-text.c: Don't show the tooltip if the text is being
- editted or isn't clipped. Remove the tooltip when editting starts.
-
- * widgets/e-text/Makefile.am: Build the test program
-
-2000-02-29 NotZed <NotZed@HelixCode.com>
-
- * tests/ui-tests/Makefile.am (filter_LDADD): Added test program.
-
- * tests/ui-tests/filterdescription.xml, saveoptions.xml: Data
- files for test program.
-
- * tests/ui-tests/filter.c (main): Test program for filter ui.
-
-2000-02-28 NotZed <NotZed@HelixCode.com>
-
- * widgets/e-minicard/Makefile.am (INCLUDES): Fixed references to
- eutil.
-
- * Makefile.am (SUBDIRS): Build e-util before other stuff.
- (SUBDIRS): Build filter after camel.
-
-2000-02-28 Chris Lahey <clahey@umich.edu>
-
- * widgets/e-text/e-text.c: Compilation error.
-
-2000-02-28 Chris Lahey <clahey@umich.edu>
-
- * widgets/e-text/e-text.c, widgets/e-text/e-text.h: Updated these
- to use the canvas ::update system properly.
-
-2000-02-24 Dan Winship <danw@helixcode.com>
-
- * acconfig.h:
- * configure.in: define SENDMAIL_PATH with the path to sendmail.
-
-2000-02-24 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-text.c, widgets/e-text.h, e-text-event-processor.c,
- e-text-event-processor.h, e-text-event-processor-emacs-like.c,
- e-text-event-processor-emacs-like.h,
- e-text-event-processor-types.h: This were moved to widgets/e-text/
- a while ago but never removed. They have now been removed.
-
- * widgets/e-text/e-text.c, widgets/e-text/e-text.h: Removed some
- warnings from this file. Made tooltips disappear when you're
- finished with them.
-
- * widgets/e-minicard/test-reflow.c,
- widgets/e-minicard/test-minicard.c,
- widgets/e-minicard/test-minicard-label.c: Commented out unused
- about_callback functions.
-
- * widgets/e-minicard/e-reflow.c: Made e-reflow pass an EFocus to
- its e-minicard children.
-
- * widgets/e-minicard/e-minicard.c: Made e-minicard take and return
- an EFocus for its "has_focus" argument. This makes shift-tab work properly.
-
- * widgets/e-minicard/e-minicard-label.c: Made e-minicard-label take and return
- an EFocus for its "has_focus" argument. Made the font that
- e-minicard-label uses only be allocated once.
-
-2000-02-21 Matt Loper <matt@helixcode.com>
-
- * tests/ui-tests/message-browser.c (on_link_clicked): stop
- sscanf() abuse.
-
- * tests/Makefile.am: changed references to libibex.a to
- libibex.la.
-
- * libical/src/libical/.cvsignore: Added *.lo, *.la, and .libs.
- * libical/src/libicalss/.cvsignore: same.
-
- * tests/.cvsignore: Added test11.
-
- * libical/Makefile.in: autogenerated file removed from cvs, and
- added to .cvsignore.
- * libical/src/Makefile.in: same.
- * libical/src/libical/Makefile.in: same.
- * libical/src/libicalss/Makefile.in: same.
-
-2000-02-22 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * tests/ui-tests/message-browser.c (on_link_clicked):
- uggly hack to test part saving and
- b64 streams.
-
-2000-02-21 Dan Winship <danw@helixcode.com>
-
- * tests/test10.c:
- * tests/test11.c: update for camel changes
-
-2000-02-20 Matt Loper <matt@helixcode.com>
-
- * tests/Makefile.am: Changed dependencies on libibex.la to
- libibex.a. In test9_LDADD, placed libcamelmbox.la before
- libibex.la, as the former requires the latter.
-
-2000-02-20 Iain Holmes <ih@csd.abdn.ac.uk>
-
- * widgets/e-text/e-text.[ch] (_do_tooltip): Show the text of the item,
- in a tooltip style.
- (e_text_event): Add a timeout on the Enter and remove it on the Leave
- events.
-
- * e-text-test.c: New file to test e-text items.
-
-2000-02-20 Matt Loper <matt@helixcode.com>
-
- * .cvsignore: added ABOUT-NLS.
- * ABOUT-NLS: removed.
-
-2000-02-19 Matt Loper <matt@helixcode.com>
-
- * tests/ui-tests/message-browser.c (on_link_clicked): When a link
- is clicked, indicate the link with a dialog.
-
- * libical/src/test/.cvsignore: Added Makefile.
-
- * libical/.cvsignore: Added Makefile, configure, config.status.
-
- * libical/src/.cvsignore: New file.
-
- * libical/Makefile: autogenerated file removed from cvs.
- * libical/configure: same.
- * libical/config.status: same.
- * libical/src/Makefile: same.
- * libical/src/test/Makefile: same.
-
- * widgets/e-minicard/.cvsignore: Added minicard-label-test,
- minicard-test, and reflow-test.
-
- * shell/.cvsignore: added files autogenerated from Evolution.idl.
-
- * libversit/.cvsignore: Added .libs, vcc.c, vcc.lo, vobject.lo,
- vcaltmp.lo, libversit.la
-
- * libical/src/test/.cvsignore: New file.
-
- * libical/src/libical/.cvsignore: New file.
-
- * libical/src/libicalss/.cvsignore: New file.
-
- * libical/.cvsignore: New file, with config.log in it.
-
- * tests/ui-tests/message-browser.c: minor cleanup.
-
- * tests/ui-tests/.cvsignore: added message-browser.
-
-2000-02-18 NotZed <NotZed@HelixCode.com>
-
- * tests/test11.c (main): Use a relative path to the mbox provider
- module.
-
-2000-02-18 Matt Loper <matt@helixcode.com>
-
- * tests/ui-tests/message-browser.c (filename_to_camel_msg): Call
- camel_data_wrapper_set_input_stream, rather than
- camel_data_wrapper_construct_from_stream. For the whole message,
- allow someone to see the header ("to", "from", etc.). Clicking on
- tree items to see their elements, now works also.
-
-2000-02-18 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * configure.in: Make gnomeui the last library on the command line,
- as its path is the one most likely to hold other old libraries
- (libxml) and we need newer versions.
-
- (BONOBO_VFS_GNOME_CFLAGS): Add libical to the
- AC_CONFIG_SUBDIRS
-
- (BONOBO_HTML_GNOME_CFLAGS): VFS checking needs to
- go before we rquery them.
-
- Use the new method for gnome-print
- checking instead of the old crufty gtk+ based one that nobody can
- debug. ever.
-
-2000-02-16 Matt Loper <matt@helixcode.com>
-
- * tests/ui-tests/message-browser.c (tree_selection_changed): New
- callback function, which will later change the main html window to
- reflect the newly-selected tree item.
- (get_gtk_html_contents_window): New function. Gets the content
- part of a message.
- (get_gtk_html_header_window): New function. Will get the header
- part of a message, when applicable.
-
- * camel/camel-formatter.c (str_tolower): Now returns a new string,
- rather than changing it in place.
- (initialize_camel_formatter): New function; gives a root
- CamelDataWrapper and a stream to a CamelFormatter.
- (camel_formatter_wrapper_to_html): New function. Translates any
- CamelDataWrapper into html.
- (lookup_unique_id): Allows the root object to be a
- CamelDataWrapper, which is more general than the previously
- required CamelMimeMessage.
-
-
-2000-02-14 NotZed <notzed@zedzone.helixcode.com>
-
- * configure.in (EXTRA_GNOME_CFLAGS): Add libunicode to CFLAGS/LIBS.
-
-2000-02-13 NotZed <notzed@zedzone.helixcode.com>
-
- * configure.in: Added check for libunicode.
-
- * Makefile.am (SUBDIRS): Added libibex.
-
- * tests/test11.c (main): New test, tests search api.
-
-2000-02-13 Matt Loper <matt@helixcode.com>
-
- * tests/ui-tests/test-multipart-mixed.msg: New rfc822 file, which
- crashes message-browser.
-
- * tests/ui-tests/message-browser.c (get_gtk_html_window): Takes a
- CamelMimeMessage as a param, rather than a filename.
- (main): Puts our windows in an hpane rather than a vbox. Also
- opens a file dlg box if a filename wasn't given as a first param.
-
- * camel/camel-stream-fs.c (_init_with_name): Set stream_fs->fd to
- -1 if we fail to load the file.
- (camel_stream_fs_new_with_name): If stream_fs->fd is -1, return
- NULL. These changes make it so that a CamelStreamFs won't be
- created if you give it a bogus filename; they may be replaced once
- exception handling is in place.
-
- * tests/ui-tests/message-browser.c (handle_tree_item): Expand tree
- items.
- (mime_message_to_html): New function; translates a
- CamelMimeMessage into two strings (one for the header, and one for
- the body).
- (get_gtk_html_window): New function; fills out a window with
- html. The html is taken from a processed rfc822 file, via a
- CamelFormatter.
-
- * camel/camel-formatter.c: Added assertions.
- (handle_text_html): Don't call text_to_html on something that's
- already html.
- (multipart_foreach): function deleted.
-
- * tests/ui-tests/message-browser.c: Added preliminary support for
- the viewing of messages via gtkhtml. Lots of commenting.
-
-2000-02-11 Christopher James Lahey <clahey@helixcode.com>
-
- * addressbook/contact-editor/e-contact-editor.c: Fixed the
- location the first time you see the drop down menus for changing
- which phone, email, or snail mail address you see.
-
-2000-02-11 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-text/e-text.c (e_text_event): Made a click on a text
- widget set the cursor properly.
-
-2000-02-11 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-text/e-text.h: Removed some arguments from the .h that
- will never be implemented.
-
-
-2000-02-10 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/data-wrapper-repository.c (data_wrapper_repository_init):
- default the text/* mime types to CamelSimpleDataWrapper so
- that Michael can use get_stream.
-
-2000-02-10 NotZed <notzed@zedzone.helixcode.com>
-
- * camel/camel-simple-data-wrapper-stream.h: The superclass is
- actually a seekable stream, not just a stream.
-
-2000-02-10 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * tests/Makefile.am (THREAD_RELATED_TESTS): don't
- build thread related tests if evolution has been
- compiled with no thread support.
-
- * configure.in (have_pthread): allow user to enable/disable
- thread support at configure time
- (EXTRA_GNOME_CFLAGS):
- (EXTRA_GNOME_LIBS): thread support is directly
- included in this variable if enabled. No more
- EXTRA_GNOME_CFLAGS_THREADS
- Other special support should be added in
- EXTRA_GNOME_LIBS and EXTRA_GNOME_CFLAGS
- instead of redefining a new variable
- each time we want to add a new lib.
- (bonobo, ....)
-
- * camel/camel.c (camel_init): only try to initialize threads if
- we enabled threads support.
-
- * tests/ui-tests/Makefile.am (message_browser_LDADD): use
- EXTRA_GNOME_LIBS
-
- * configure.in (have_pthread): remove HAVE_PTHREADS
- variable. Define ENABLE_THREADS instead.
-
- * camel/Makefile.am: use ENABLE_THREADS not HAVE_PTHREADS
- to test if we build thread relateed code.
-
- * tests/Makefile.am: use EXTRA_GNOME_LIBS,
- not EXTRA_GNOME_LIBS_THREADS
-
-2000-02-10 NotZed <notzed@zedzone.helixcode.com>
-
- * camel/hash-table-utils.c (g_strcase_hash): Removed a bizarre
- comparison construct for converting case.
-
-2000-02-09 NotZed <notzed@zedzone.helixcode.com>
-
- * camel/data-wrapper-repository.c (data_wrapper_repository_init):
- Uses case-insensitive compares.
-
- * camel/gmime-content-field.c (gmime_content_field_new): Uses
- case-insensitive compares.
-
- * camel/data-wrapper-repository.c (data_wrapper_repository_init):
- Use case-insensitive mime types.
-
- * camel/camel-simple-data-wrapper-stream.c (read): Increment the
- copy source address to match the data read offset.
- (seek): Actually implement the seek.
-
- * camel/camel-mime-part-utils.c
- (camel_mime_part_store_stream_in_buffer): If we get a -1 read,
- DONT update the total bytes, and try and truncate the array in
- reverse. Eek.
-
- * camel/camel-mime-part.c (camel_mime_part_encoding_from_string):
- This was DEFINETLEY not the right way to do it. strncmp!=strcmp
- (camel_mime_part_encoding_to_string): Handle the default case.
- : include string.h for strcmp() etc.
-
-2000-02-09 Matt Loper <matt@helixcode.com>
-
- * tests/ui-tests/test-multipart-alt.msg: New test file; run
- message-browser on it, and it will crash.
-
-2000-02-09 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * tests/ui-tests/message-browser.c (handle_tree_item):
- show the item.
- (handle_tree_item): show the containers and the containees
- (get_message_tree_ctrl): call handle_tree_item
- on the message itself
-
- * camel/camel-mime-message.c (camel_mime_message_init):
- set the mime type to "mime/message".
- --- THIS IS NOT THE CONTENT TYPE ---
-
- * camel/camel-mime-body-part.c (camel_mime_body_part_init):
- set the mime type to "body-part".
- --- THIS IS NOT THE CONTENT TYPE ---
-
- * camel/camel-data-wrapper.c (camel_data_wrapper_set_mime_type):
- mime_type is const.
- (_set_input_stream): really set the input stream
- (_set_output_stream): really set the output stream
- various other typo fixes.
-
- * tests/ui-tests/message-browser.c: various typo
- fixes in the ctree construction.
-
- * camel/string-utils.c (string_trim): fix braindead
- trailing trim bug.
-
- * camel/gmime-content-field.c (gmime_content_field_construct_from_string):
- strip the leading and trailing quotes when constructing the
- content field. This should be done in a more generic
- RFC822 approach, but this fixes a bug that prevent
- matt from analysing some multipart messages.
-
- * camel/camel-data-wrapper.h: reorganize the
- deprecated and new methods.
-
- * camel/providers/mbox/camel-mbox-folder.c
- (_check_get_or_maybe_generate_summary_file):
- Use "From " as the message separating string.
-
- * camel/providers/mbox/camel-mbox-folder.c (_append_message):
- set the mode when creating the mbox file.
-
- * camel/providers/mbox/camel-mbox-utils.c (camel_mbox_write_xev):
- ditto
- * camel/providers/mbox/camel-mbox-summary.c (camel_mbox_save_summary):
- ditto
-
-2000-02-09 Matt Loper <matt@helixcode.com>
-
- * tests/ui-tests/message-browser.c (print_usage_and_quit): Minor
- cleanup.
-
-2000-02-09 NotZed <notzed@zedzone.helixcode.com>
-
- * camel/camel-simple-data-wrapper-stream.c (class_init): Actually
- initialise the class. It simple couldn't have worked before.
- (camel_simple_data_wrapper_stream_construct): Commented out code
- which crashes just to get something working, memory corruption??
-
-2000-02-09 Christopher James Lahey <clahey@helixcode.com>
-
- * configure.in: Add new Makefiles to Makefile list.
-
- * widgets/e-text/Makefile.am: Build libetext.
-
- * widgets/e-minicard/Makefile.am: Build libeminicard and test
- programs.
-
- * widgets/Makefile.am: Remove all e-text and e-minicard code and
- add them to the SUBDIRS list.
-
-2000-02-08 Matt Loper <matt@helixcode.com>
-
- * tests/ui-tests/message-browser.c: New file; shows a message in
- tree format, where multipart's have multiple leaves.
-
- * camel/camel-formatter.c: Changed references from
- 'multipart/alternate' to 'multipart/alternative'.
-
- * tests/test-formatter.c (convert_to_html_and_print): Use the
- buffer length of the stream to create strings which are then
- printed, rather than printing the stream (which might not have a
- trailing \0) directly.
-
- * camel/camel-formatter.c (str_tolower): New function; makes a
- string lowercase.
-
- * tests/test-formatter.c (convert_to_html_and_print): Fixed call
- to 'camel_formatter_mime_message_to_html' to contain correct
- params.
-
- * camel/camel-formatter.c: New member to 'CamelFormatterPrivate',
- 'attachments', will be used to let the caller know which items
- should be treated as attachments (as opposed to objects which are
- inline to the body).
- (text_to_html): name changed from 'encode_entities'. Also now
- converts newlines to <br> tags.
- (camel_formatter_mime_message_to_html): Now takes two output
- streams -- one for the header, and one for the body.
- (get_bonobo_tag_for_object): New function; tries to make a tag out
- of (1) the leaf of a mime message and (2) a bonobo object that can
- handle its mime type, but can return NULL if it fails to find the
- mime type.
- (handle_vcard): New function; will write out a vcard as html.
-
-2000-02-07 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-text.h, widgets/e-text.c: Added line wrap and a max
- number of lines (max number of lines is only obeyed if text is not
- being edited).
-
-2000-02-07 Christopher James Lahey <clahey@helixcode.com>
-
- * addressbook/printing/e-contact-print.c: Removed an unneccessary
- include of libhnj. All uses of libhnj are commented out.
-
-2000-02-07 Matt Loper <matt@helixcode.com>
-
- * camel/camel-formatter.c (mime_part_to_html): function deleted.
-
- * tests/test-formatter.c (print_usage_and_quit): New function,
- which gives usage information.
-
- * camel/camel-formatter.c: made the 'stream' a member of the
- CamelFormatter class, so that streams don't have to be explicitly
- sent as a param where a CamelFormatter is also sent..
- (handle_text_plain): Use 'encode_entities' to change '<' to
- '&gt;', etc.
-
-2000-02-03 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-formatter.c (find_preferred_displayable_body_part_in_multipart_alternative):
- (mime_part_to_html): typo fix :
- use find_preferred_displayable_body_part_in_multipart_alternative
- instead of the other names. Allows camel to have no undefined symbols.
-
-2000-02-02 Matt Loper <matt@helixcode.com>
-
- * tests/test-formatter.c: New file; intended to test the
- CamelFormatter class.
-
- * camel/camel-formatter.c: Lots of cleanup, commenting, some new
- functions, and a really basic skeleton for getting bonobo objects
- into the html.
- (encode_entities): New function, stolen from Daniel Velliard.
-
-2000-01-28 Christopher James Lahey <clahey@helixcode.com>
-
- * addressbook/printing/e-contact-print-style-editor.h,
- addressbook/printing/e-contact-print-style-editor.c,
- addressbook/printing/test-contact-print-style-editor.c: Files to
- load the contact print style editor from the glade file. Doesn't
- really do anything yet.
-
- * addressbook/printing/Makefile.am: Added style editor stuff.
-
- * addressbook/printing/e-contact-print.glade: Changed a bit.
- Fixed an out of place widget.
-
- * addressbook/printing/.cvsignore: Added
- contact-print-style-editor-test.
-
- * addressbook/printing/smallbook.ecps: Fixed up the values to
- match the new types.
-
- * addressbook/printing/medbook.ecps,
- addressbook/printing/phonelist.ecps: Added two new printing
- styles.
-
- * addressbook/printing/e-contact-print.h: Fixed an incorrect
- comment.
-
- * addressbook/printing/e-contact-print.c: Added columns and letter
- tabs. Tweaked spacing all over the place. Fixed card height
- function so that column wrapping is always done correctly. Added
- pulling of style information from a file. Added line wrapping
- within each text field.
-
- * addressbook/printing/e-contact-print-types.h: Added a type field
- for different types of print styles.
-
-
-2000-01-28 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-text.c (e_text_command): Handle the grab and ungrab
- command instead of doing focus by hand. This fixes a problem
- related to the scroll wheel.
- (e_text_command): Reset the blink timer in many more command
- situations so that the cursor blinks less when you're interacting
- with it.
-
- * widgets/e-text-event-processor-emacs-like.c: Send the grab focus
- command when starting a selection and the ungrab focus command
- when ending it.
-
- * widgets/e-text-event-processor-types.h: Added grab command type
- so that the event processor can tell the widget to grab the focus.
-
- * widgets/e-reflow.c: Redefined all sizes using #defines so that
- they can be tweaked later. Added scroll wheel handling and set up
- adjustment increments so that the scroll bars will work correctly.
-
- * widgets/e-minicard.h: Added minicard focus type enum. This
- doesn't mean anything yet, but it will later be used to say which
- direction the focus is coming from (below for shift-tab, above for
- tab.)
-
-2000-01-28 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-minicard-label.c, widgets/e-minicard.c: Use
- e_canvas_item_grab_focus so that it will work with old versions of
- gnome-canvas.
-
- * widgets/e-canvas.c, widgets/e-canvas.h: Finished working around
- focus bugs.
-
-2000-01-28 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/test-reflow.c: Set the minimum_width.
-
- * widgets/e-reflow.h, widgets/e-reflow.c: Added one more column
- line so that the right edge of the reflow will have a line. Also
- added a minimum_width so that even if the reflow is thinner than
- the window, when you resize it larger all the lines are drawn.
-
-2000-01-27 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-reflow.h, widgets/e-reflow.c: Added an arrow cursor
- for the draggable columns. Made the clickable column area
- larger.
-
- * widgets/e-text.h, widgets/e-text.c: Added an I beam cursor for
- the text item when it is editable.
-
- * widgets/e-minicard-label.c: Forward enter and leave
- notifications to the contained editable text item.
-
-2000-01-26 Matt Loper <matt@helixcode.com>
-
- * camel/camel-formatter.c: By looking up a mimetype in a
- hashtable, we can now get a handler function for an arbitrary
- mimetype.
-
-2000-01-25 Mathieu Lacage <mathieu@advogato.org>
-
- * .cvsignore s: cvs shutup.
-
-2000-01-25 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-reflow.c, widgets/e-minicard.c: Handle shift-tab
- properly now.
-
- * widgets/e-minicard-label.c: Reindented some areas.
-
- * widgets/test-reflow.c: Use e-canvas. Set the back pixmap to
- NULL for the canvas so that scrolling won't flash grey.
-
- * widgets/e-canvas.c, widgets/e-canvas.h: These subclass
- GnomeCanvas to work around a few bugs so that evolution will work
- well with old versions of gnome-libs.
-
- * widgets/Makefile.am: Added e-canvas.c and e-canvas.h.
-
- * addressbook/contact-editor/contact-editor.glade: Not much
- change. Mostly internal reorganization by glade itself.
-
-2000-01-25 Christopher James Lahey <clahey@helixcode.com>
-
- * addressbook/printing/smallbook.ecps: Example contact printing
- style. Not used yet.
-
- * addressbook/printing/e-contact-print.glade: A glade file for
- editing contact printing styles. Not used yet.
-
- * addressbook/printing/test-print.c: Test file for printing.
-
- * addressbook/printing/e-contact-print.c,
- addressbook/printing/e-contact-print.h,
- addressbook/printing/e-contact-print-types.h,
- addressbook/printing/Makefile.am, addressbook/printing/.cvsignore:
- New files for contact printing support.
-
- * addressbook/Makefile.am (SUBDIRS): Add printing.
-
- * configure.in: Check for gnome-print. Build the
- addressbook/printing Makefile.
-
-2000-01-24 bertrand <bertrand@helixcode.com>
-
- * camel/camel-data-wrapper.h:
- * camel/camel-data-wrapper.c
- (_set_input_stream):
- (_get_input_stream):
- (_set_output_stream):
- (_get_output_stream):
- The CamelDataWrapper can now be provided with input and
- output streams, so that nothing has to be kept in memory.
-
- * camel/camel-stream.c (camel_stream_class_init):
- added the "data_available" signal.
-
-
-2000-01-24 Federico Mena Quintero <federico@helixcode.com>
-
- * configure.in: Added the gnome-pilot and capplet checks; they
- will likely be reworked for the Evolution framework, but for now
- the calendar/ directory needs them.
-
- * configure.in: Added checks for gnome-vfs.
-
-2000-01-24 bertrand <bertrand@helixcode.com>
-
- * camel/camel-seekable-stream.c:
- * camel/camel-seekable-stream.h:
- new files.
-
- * camel/camel-simple-data-wrapper-stream.h: parent class is now
- CamelSeekableStream
- * camel/camel-stream-buffered-fs.h: idem
- * camel/camel-stream-buffered-fs.c: idem
- * camel/camel-stream-mem.h: idem
- * camel/camel-stream-mem.c: idem
- (_seek): change declaration
- * camel/camel-stream-fs.c: parent class is now
- CamelSeekableStream
- (_seek): change declaration
-
- * camel/camel-stream-fs.h: parent class is now
- CamelSeekableStream
-
- * camel/camel-stream-fs.[ch]: converted all
- gint64 variables into guint32.
-
-
- * camel/camel-stream-fs.c (_read): fix stupid bug.
- (_write): ditto.
-
- * camel/camel-exception.c (camel_exception_new): don't
- forget to clean the exception when creating it.
-
- * camel/camel-recipient.c (camel_recipient_table_add_list):
- add recipient_list to the recipients, not recipients_list.
- I don't know what that variable was doing here.
-
-
-2000-01-24 Matt Loper <matt@helixcode.com>
-
- * camel/camel-formatter.c (write_header_info_to_stream): new
- function, broken out from 'camel_formatter_make_html'.
- (write_mimepart_to_stream): same.
- (find_text_body_part_in_multipart_related): new function.
- (camel_formatter_make_html): Now tries to deal with
- multipart/related, multipart/alternate, and text/(plain|html).
-
-
-2000-01-23 bertrand <bertrand@helixcode.com>
-
- * camel/camel-store.c (camel_store_get_session):
- added a public get_session method.
-
- * camel/providers/mbox/camel-mbox-summary.c (camel_mbox_save_summary):
- (camel_mbox_load_summary): load/save message sizes in the summary file
-
- * camel/providers/mbox/camel-mbox-summary.h:
- added a size field to the message information
- structure.
-
- * camel/providers/mbox/camel-mbox-utils.c (parsed_information_to_mbox_summary):
- copy message size to the mbox summary information too.
-
- * camel/camel-stream-fs.c (_seek): updated to
- work with bounded fs streams.
- (_write): ditto.
- (_read): ditto.
-
- * camel/camel-stream-fs.h (struct ):
- added the cur_pos, inf_bound and sup_bound
- members to allow for bounded fs stream.
-
- * camel/camel-stream-fs.c (_set_bounds): new func.
- (_init_with_fd_and_bounds): idem.
- (_init_with_name_and_bounds): idem.
- New functions to allow the usage of bounded fs streams.
-
- The bounded fs stream allow, for example, to make a stream
- from a message stored in an mbox file.
-
-
-2000-01-22 bertrand <bertrand@helixcode.com>
-
- * camel/providers/mbox/camel-mbox-folder.c (_check_get_or_maybe_generate_summary_file):
- use the real summary file path instead of a
- stupid hardcoded one. Fixes yet another bug.
-
- * camel/providers/mbox/camel-mbox-utils.c (parsed_information_to_mbox_summary):
- don't forget to copy the date too. Fix a very annoying bug.
-
- * camel/providers/mbox/camel-mbox-folder.c (_append_message):
- implemented. A lot of fixes too. Works now.
- (_get_uid_list): implemented.
-
-2000-01-21 bertrand <bertrand@helixcode.com>
-
- * tests/test10.c:
- test the mbox provider.
-
- * camel/camel-folder.c (_set_name):
- if camel_folder_get_mode returns an
- exception, return it instead of
- overriding it with a new one.
- (camel_folder_is_open): make the is_open
- method public.
- (_set_name): use the is_open instead of
- get_mode.
- (_set_name): set the fullname even in the case
- where the folder has no parent.
- (_set_name): use %c, not %d to add the
- separator char into the full path.
-
- * camel/camel-store.c: add exception handling everywhere in
- the store related functions arguments.
- * camel/providers/mbox/camel-mbox-folder.c: idem
- * camel/providers/mbox/camel-mbox-folder.h: idem
- * camel/providers/mbox/camel-mbox-store.h: idem
-
- * camel/providers/mbox/Makefile.am (libcamelmbox_la_SOURCES):
- added camel-mbox-provider.c to the mbox provider
- sources.
-
- * camel/providers/mbox/camel-mbox-provider.c:
- provider registration code.
-
- * camel/providers/mbox/camel-mbox-folder.c (_get_message_count): implemented
- (_append_message): implemented
-
- * camel/providers/mbox/camel-mbox-parser.c (initialize_buffer):
- use \0 to mark the end of the buffer.
- (read_next_buffer_chunk): ditto.
- (read_header): test the presence of a \0 instead of
- reading the eof field
- (read_message_begining): idem.
- (camel_mbox_parse_file): idem.
- Remove the eof field from the parser
- structure.
- (read_next_buffer_chunk): removed some nasty bugs
- again.
-
-
-2000-01-21 Federico Mena Quintero <federico@helixcode.com>
-
- * libversit/vcc.y: Removed the VFS crap; my mistake, it should not
- go here.
-
- * configure.in: Added yacc requirements for libversit.
-
-2000-01-21 Matt Loper <matt@helixcode.com>
-
- * camel/camel-formatter.c (camel_formatter_make_html): added a
- CamelMimeMessage as a param to this function, and removed it as a
- member of the object.
-
-2000-01-21 Federico Mena Quintero <federico@helixcode.com>
-
- * configure.in (AC_OUTPUT): Added libversit/Makefile and
- calendar/Makefile.
-
- * Makefile.am (SUBDIRS): Added libversit and calendar.
-
-2000-01-20 bertrand <bertrand@helixcode.com>
-
- * camel/providers/mbox/camel-mbox-parser.c (camel_mbox_parse_file):
- compute and return the file size.
-
-
-2000-01-20 Matt Loper <matt@helixcode.com>
-
- * camel/camel-formatter.c, camel/camel-formatter.h: New
- files. You'll be able to use a CamelFormatter to get
- html-formatted versions of a CamelMimeMessage.
-
-2000-01-20 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-text-event-processor-types.h: Changed some line
- spacing.
-
- * widgets/test-reflow.c: Connected to the resize signal of the
- reflow.
-
- * widgets/e-minicard.c: Made width argument set function only
- update if width is different.
-
- * widgets/e-reflow.h, widgets/e-reflow.c: Added draggable column dividers.
-
- * addressbook/contact-editor/test-editor.c: Open two dialogs for
- more interesting testing.
-
- * addressbook/contact-editor/e-contact-editor.h,
- addressbook/contact-editor/e-contact-editor.c: Modified to use
- glade. Added menus to change which phone/address/email entries to
- view. Added images to the dialog.
-
- * addressbook/contact-editor/e-contact-editor-strings.h,
- addressbook/contact-editor/contact-editor.glade: Glade files for
- the contact editor dialog.
-
- * addressbook/contact-editor/Makefile.am: Added images and added
- glade stuff.
-
- * addressbook/contact-editor/arrow.png,
- addressbook/contact-editor/briefcase.png,
- addressbook/contact-editor/netfreebusy.png,
- addressbook/contact-editor/netmeeting.png: Image files for the
- contact editor dialog.
-
-2000-01-19 bertrand <bertrand@helixcode.com>
-
- * camel/providers/mbox/camel-mbox-folder.c (_get_message_count):
- implemented.
-
- * camel/providers/mbox/camel-mbox-summary.c (camel_mbox_save_summary):
- (camel_mbox_load_summary): save/load the next uid.
-
- * camel/providers/mbox/camel-mbox-parser.c (camel_mbox_parse_file):
- Compute the next available uid.
- * camel/providers/mbox/camel-mbox-folder.c (_create):
- (_check_get_or_maybe_generate_summary_file):
- Set and use the next_uid field properly.
- * camel/providers/mbox/camel-mbox-summary.h: added
- an extra field to store the next available uid.
-
- * camel/providers/mbox/camel-mbox-folder.c
- (_check_get_or_maybe_generate_summary_file):
- routine called when the folder is opened.
- Reads or creates the summary file.
- (_create): initialize the internal summary
- structure.
- (_close): save the summary file on closing.
- (_init_with_store): initialize mbox specific
- folder members.
-
-2000-01-18 bertrand <bertrand@helixcode.com>
-
- * tests/test9.c:
- tests for summary and parsing process of mbox files.
-
- * camel/providers/mbox/camel-mbox-parser.c (camel_mbox_parse_file): do
- not use case insensitive comp to detect message separators. Kill
- some nasty bugs in netscape file parsing,
-
- * camel/providers/mbox/camel-mbox-utils.c (parsed_information_to_mbox_summary):
- don't use g_array_append but write directly inside the
- array data instead. Better performance and bug fix.
-
- * camel/providers/mbox/camel-mbox-summary.c (camel_mbox_load_summary):
- fix the name and bugs.
-
- * camel/camel-folder-summary.h: update the class
- method definition to match the public defs.
-
- * camel/providers/mbox/camel-mbox-summary.c (camel_mbox_save_summary):
- (mbox_load_summary): summary file read/write routines.
-
- * camel/providers/mbox/camel-mbox-utils.c (parsed_information_to_mbox_summary):
- routine to construct the summary after the mbox
- file has been parsed and the x-evolution fields
- inserted.
-
-2000-01-17 bertrand <bertrand@helixcode.com>
-
- * camel/providers/mbox/camel-mbox-utils.c (camel_mbox_write_xev):
- dont use the x_evolution field but rather the uid to
- determine the presence of "X-Evolution" in the mail.
-
- * camel/providers/mbox/camel-mbox-parser.c (camel_mbox_parse_file):
- parse the status and uid values if the x-evolution
- has been found.
-
- * camel/providers/mbox/camel-mbox-utils.c (camel_mbox_xev_parse_header_content):
- return the parsed status field correctly.
-
- * camel/providers/mbox/camel-mbox-utils.h:
- fixed bad prototype.
-
- * camel/providers/mbox/camel-mbox-parser.c (camel_mbox_parse_file):
- parse and store the "To:" header.
-
- * camel/providers/mbox/camel-mbox-parser.h:
- added a "to" field
-
- * camel/camel-folder-summary.c:
- create the arrays here.
-
- * camel/camel-folder-summary.h: the list of
- summary information is no longer a GList but
- rather a GArray.
-
-2000-01-17 Chrsitopher James Lahey <clahey@helixcode.com>
-
- * head.png, phone.png, email.png, web.png, snailmail.png: Images
- for e-contact-editor.c.
-
- * addressbook/contact-editor/text-editor.c: Test program
- for contact editor widget.
-
- * addressbook/contact-editor/e-contact-editor.c,
- addressbook/contact-editor/e-contact-editor.h: Contact editor
- widget files.
-
- * addressbook/contact-editor/.cvsignore,
- addressbook/contact-editor/Makefile.am: New directory for contact
- editor files.
-
- * addressbook/.cvsignore, addressbook/Makefile.am: New directory
- for addressbook files.
-
- * widgets/.cvsignore: Added reflow-test.
-
- * Makefile.am (SUBDIRS): Added addressbook subdirectory.
-
- * configure.in, widgets/Makefile.am: Removed widgets/toolbar from
- SUBDIRS since the lack of content was preventing it from
- compiling.
-
- * widgets/e-text.c, widgets/e-text.h: Fixed a crashing bug.
-
-2000-01-17 bertrand <bertrand@helixcode.com>
-
- * tests/test9.c (main): test for the mbox utils.
-
-2000-01-17 Federico Mena Quintero <federico@helixcode.com>
-
- * configure.in: Add the gnomecanvaspixbuf argument to gnome-config
- invocations.
-
-2000-01-17 bertrand <bertrand@helixcode.com>
-
- * camel/providers/mbox/camel-mbox-utils.c (camel_mbox_write_xev):
- (copy_file_chunk):
- (camel_mbox_xev_write_header_content):
- (string_to_flag):
- (flag_to_string):
- (string_to_uid):
- (uid_to_string):
- A bunch of new funcs to handle x-evolution
- private header field.
- (copy_file_chunk): fixed a nasty bug.
- (camel_mbox_write_xev): create the copy file descriptor
- with the proper arguments. Exceptions implememnted.
- (camel_mbox_write_xev): changed the way bytes are counted.
- No more uses the message size cause it did not take into
- account the message separators characters.
- (camel_mbox_write_xev): hopefully fixed the last bugs.
- works ok now.
-
-
-2000-01-15 bertrand <bertrand@helixcode.com>
-
- * camel/providers/mbox/camel-mbox-parser.c
- (camel_mbox_parse_file):
- store the end of headers position.
-
- * camel/providers/mbox/camel-mbox-parser.h:
- added the end_of_header_position to locate the
- begining of the mail body.
-
-
- * camel/providers/mbox/camel-mbox-utils.c (uid_to_string):
- (string_to_uid):
- (flag_to_string):
- (string_to_flag):
- new functions to handle uids and
- flags in the X-Evolution header.
- (camel_mbox_xev_parse_header_content):
- new function to parse an X-Evolution
- header.
- (camel_mbox_xev_write_header_content):
- new function to write the X-Evolution
- header.
-
-2000-01-13 bertrand <bertrand@helixcode.com>
-
- * camel/providers/mbox/camel-mbox-parser.c (read_next_buffer_chunk):
- eof is true when no more chars are available, not
- when we've read the entire file.
- (initialize_buffer): ditto.
- (read_message_begining): documented.
- (read_header): ditto.
- (new_message_detected): ditto.
- (advance_n_chars): ditto.
- (goto_next_char): ditto.
- (read_next_buffer_chunk): ditto.
- (initialize_buffer): ditto.
- (parser_free): ditto.
- (new_parser): ditto.
-
-2000-01-12 <clahey@galapagos.helixcode.com>
-
- * widgets/e-text-event-processor-types.h,
- widgets/e-text-event-processor-emacs-like.c, widgets/e-text.c,
- widgets/e-text.h: Added selection and clipboard support. Added up
- and down arrow keys. Fixed choice of font colors for the
- selection to be based on the current style.
-
- * widgets/e-minicard.c: Caused a click to grab the focus. Changed
- the fake information added.
-
- * widgets/e-minicard-label.c: Forward mouse events to the field
- EText item.
-
-2000-01-13 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-canvas-utils.c, widgets/e-canvas-utils.h:
- e_canvas_item_move_absolute is just a helper function not supplied
- by the gnome_canvas.[ch] I put it here so that multiple items can
- use it.
-
- * widgets/e-reflow.c, widgets/e-reflow.h: This item contains a
- number of other items and places them into multiple columns. The
- items contained must support a number of arguments and signals to
- allow the reflow to interact with them.
-
- * widgets/test-reflow.c: This is a test program for e-reflow.
-
- * widgets/e-text.c, widgets/e-text.h: Added properly drawn
- selected text. Added some preliminary code for X selection
- handling and cut & paste.
-
- * widgets/e-minicard.c, widgets/e-minicard.h: Added ARG_HAS_FOCUS
- handling. Made label display random for more interesting tests of
- multiple cards. Tweaked sizing information for better display.
-
- * widgets/e-minicard-label.c, widgets/e-minicard-label.h: Added
- ARG_HAS_FOCUS handling.
-
- * widgets/Makefile.am: Added the reflow test and reflow files.
-
-2000-01-12 bertrand <bertrand@helixcode.com>
-
- * camel/providers/mbox/camel-mbox-parser.h (camel_mbox_parse_file):
- Added the prototype of camel_mbox_parse_file.
-
- * camel/providers/mbox/camel-mbox-parser.c (camel_mbox_parse_file):
- updated in-line documentation.
-
- * tests/Makefile.am (noinst_PROGRAMS):
- remove non updated tests from the build
- process.
-
- * corrected a bunch of bugs
-
- * camel/providers/mbox/camel-mbox-parser.c
- (camel_mbox_parse_file):
- parser the subject and date.
-
-
- * camel/providers/mbox/camel-mbox-parser.c
- (camel_mbox_parse_file): added the ability to
- follow the parsing progression.
-
- * camel/providers/mbox/camel-mbox-parser.h:
- parse the x-evolution field.
-
- * camel/Makefile.am (libcamel_la_SOURCES):
- disabled gmime-rfc2047 as it depends on libunicode
- and is not used for the moment.
-
-2000-01-12 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-minicard.c, widgets/e-minicard.h: Added a resize
- signal for when the card changes height. Made it so that when you
- press tab inside of a field, it goes to the next field.
-
- * widgets/e-minicard-label.c, widgets/e-minicard-label.h: Added a
- resize signal for when the label changes height.
-
- * widgets/e-text.c, widgets/e-text.h: Added a resize signal for
- multiple lines. Added scrolling based on cursor position.
-
- * widgets/Makefile.am: Removed an extraneous build target.
-
-2000-01-11 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/e-text-event-processor-emacs-like.c: Blocked the tab key
- from getting inserted into the buffer since the renderer doesn't
- know what a tab is.
-
- * widgets/e-text.c, widgets/e-text.h: Fixed a memory leak. Added
- a blinking cursor and scrolling for the text item.
-
-2000-01-11 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/test-minicard.c: Removed some code which got in the way
- of testing properly.
-
- * widgets/e-minicard-label.c (e_minicard_label_realize): Made the
- field text item editable.
-
- * widgets/Makefile.am: Added e-text-event-process*.[ch].
-
- * widgets/e-text.c, widgets/e-text.h: Changed these to support
- editing.
-
- * widgets/e-text-event-processor.c,
- widgets/e-text-event-processor.h,
- widgets/e-text-event-processor-types.h,
- widgets/e-text-event-processor-emacs-like.c,
- widgets/e-text-event-processor-emacs-like.h: These are a new pair
- of classes which handle all events from the text item and convert
- them into commands.
-
-
-2000-01-10 Christopher James Lahey <clahey@helixcode.com>
-
- * widgets/Makefile.am: Added minicard and text stuff.
-
- * widgets/e-minicard.c, widgets/e-minicard.h,
- widgets/e-minicard-label.c, widgets/e-minicard-label.h: Added
- canvas items for the minicard view in the contact manager.
-
- * widgets/test-minicard.c, widgets/test-minicard-label.c: Tests
- for the minicard items.
-
- * widgets/e-text.h, widgets/e-text.c: New canvas item. Based on
- GnomeCanvasText. Adds ellipsis capabilities. Used in
- e-minicard*.[ch].
-
- * widgets/.cvsignore: Added minicard-test and minicard-label-test.
-
-2000-01-06 Miguel de Icaza <miguel@gnu.org>
-
- * configure.in: Add Bonobo detection, Bonobo flags for compilation
- for the components and the shell.
-
-2000-01-06 Elliot Lee <sopwith@redhat.com>
- * composer/Makefile.am, widgets/e-table/Makefile.am: Work with
- builddir != srcdir
-
-2000-01-05 Miguel de Icaza <miguel@gnu.org>
-
- * configure.in (EXTRA_GNOME_CFLAGS_THREADS,
- EXTRA_GNOME_LIBS_THREADS): New variables that hold the thread
- version of the compile/link lines.
-
-1999-11-20 Miguel de Icaza <miguel@gnu.org>
-
- * configure.in (PACKAGE): Raise warning level.
-
-2000-01-04 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/providers/mbox/camel-mbox-folder.c (_list_subfolders):
- in the io_error label does not return before the
- list has been freed.
-
-2000-01-03 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/providers/mbox/camel-mbox-folder.c (_list_subfolders):
- detects netscape ".sdb" folders as well as simple
- non-suffixed folders (as the ones used in pine).
-
-
- * camel/string-utils.c (string_prefix):
- finished implementation.
- (string_prefix): added a boolean flag to indicate if the
- suffix has been found. When the suffix does not match,
- return NULL.
-
-1999-12-26 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-exception.c (camel_exception_setv):
- new function. Allow printf-like description
- string constructions.
-
- * camel/camel-exception.h: cosmetic changes.
-
- * camel/providers/mbox/camel-mbox-store.h:
- * camel/providers/mbox/camel-mbox-store.c:
- * camel/providers/mbox/camel-mbox-folder.h:
- * camel/providers/mbox/camel-mbox-folder.c:
- More work on the mbox provider.
-
-
-1999-12-22 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/providers/mbox/camel-mbox-store.h:
- * camel/providers/mbox/camel-mbox-store.c:
- * camel/providers/mbox/camel-mbox-folder.h:
- * camel/providers/mbox/camel-mbox-folder.c:
- part of the mbox provider.
-
-1999-12-20 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-folder.c (_set_name):
- check that the folder is closed or raise an exception.
- (_set_name): unset the name fields as soon as possible,
- even if an exception is raised.
-
- * configure.in:
- build mbox provider Makefile
-
- * camel/Makefile.am (SUBDIRS):
- re-enable providers compilation
-
-1999-12-19 Damon Chaplin <damon@karuna.freeserve.co.uk>
-
- * configure.in (AC_OUTPUT): added widgets/meeting-time-sel/Makefile
-
-1999-12-19 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-folder-utils.c: include camel-log.h
- to avoid unresolved symbols.
-
-1999-12-18 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-folder.c (camel_folder_get_summary):
- documented.
-
- * camel/camel-folder-pt-proxy.c (_append_message):
- updated to take the change on append into account.
-
- * camel/camel-folder.h:
- updated class def concerning append.
- * camel/camel-folder.c
- (camel_folder_append_message): documented.
- (camel_folder_append_message): don't return the
- message number. Use specific methods instead.
- (_append_message): idem.
-
- (_delete): use exception mechanism.
- (camel_folder_delete): idem.
- (_delete_messages): idem.
- (camel_folder_delete_messages): idem.
- (_get_parent_folder): idem.
- (camel_folder_get_parent_folder): idem.
- (_get_parent_store): idem.
- (_get_mode): idem.
- (camel_folder_get_parent_store): idem.
- (camel_folder_get_mode): idem.
- (_list_subfolders): idem.
- (camel_folder_list_subfolders): idem.
- (_expunge): idem.
- (camel_folder_expunge): idem.
- (_has_message_number_capability): idem.
- (camel_folder_has_message_number_capability): idem.
- (_get_message_by_number): idem.
- (camel_folder_get_message_by_number): idem.
- (camel_folder_get_message_count): idem.
- (_list_permanent_flags): idem.
- (camel_folder_list_permanent_flags): idem.
- (_copy_message_to): idem.
- (camel_folder_copy_message_to): idem.
- (camel_folder_has_summary_capability): idem.
- (camel_folder_get_summary): idem.
- (camel_folder_has_uid_capability): idem.
- (camel_folder_get_message_uid): idem.
- (_get_message_uid_by_number): idem.
- (camel_folder_get_message_uid_by_number): idem.
- (camel_folder_get_message_by_uid): idem.
- (camel_folder_get_uid_list): idem.
-
-1999-12-17 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-folder.c (_set_name):
- use exception mechanism.
- (camel_folder_set_name): idem.
- (camel_folder_set_full_name): idem.
- (_get_name): idem.
- (camel_folder_get_name): idem.
- (_get_full_name): idem.
- (camel_folder_get_full_name): idem.
- (_can_hold_folders): idem.
- (_can_hold_messages): idem.
- (_exists): idem.
- (camel_folder_exists): idem.
- (_is_open): idem.
- (_get_subfolder): idem.
- (camel_folder_get_subfolder): idem.
-
- * camel/camel-exception.c (camel_exception_clear):
- New function. Clear an exception.
- (camel_exception_get_id):
- New function.
- (camel_exception_get_description):
- New function.
-
- * camel/camel-folder.c (_set_name):
- Use the exception system. When the folder
- has no parent, don't set its full name
- field.
-
-
-1999-12-16 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-folder.c (camel_folder_expunge):
- (_expunge):
- * camel/camel-folder-pt-proxy.c (_expunge):
- changed the return value. Now returns the list
- of expunged messages
-
- * camel/camel-folder.c (_init_with_store):
- cleaned up. Use the exception system now.
- (_open): ditto.
- (camel_folder_open): ditto.
- (camel_folder_open_async): ditto.
- (_close): ditto.
- (camel_folder_close): ditto.
- (camel_folder_close_async): ditto.
-
- * camel/camel-exception.c (camel_exception_set):
- When no exception is given, do nothing, just
- return.
- (camel_exception_set): documented.
- (camel_exception_new): idem.
- (camel_exception_free): idem.
- (camel_exception_xfer): idem.
-
-
- * camel/camel-folder.c:
- * camel/camel-folder.h: more clean-ups.
- Removed message list related code.
- This was braindead design.
-
-
- * camel/camel-folder-utils.c (camel_aml_expunge_messages):
- implemented. The routines in this file will be
- called by providers to handle the list of
- message already standing in memory.
-
-1999-12-15 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-folder-utils.c:
- * camel/camel-folder-utils.h:
- New files, misc utilities for the
- folder providers. Includes active message
- list utilities.
-
-
- * camel/camel-folder.c (_has_message_number_capability):
- (camel_folder_has_message_number_capability):
- Added this to know if a folder provides
- number-based message access.
-
- * camel/camel-folder.c (_get_message_count):
- added warning when called directly.
- (_append_message): ditto
- (_open_async): ditto
- (_close_async): ditto
- (_delete_messages): ditto
- (_expunge): ditto
- (_get_message_by_number): ditto
- (_get_message_uid): ditto
- (_get_message_uid_by_number): ditto
- (_get_message_by_uid): ditto
- (_get_uid_list): ditto
-
-
- * camel/camel-folder-pt-proxy.c (_open_async):
- (_open):
- (_close_async):
- (_close):
- (camel_folder_pt_proxy_class_init):
- update
- (_get_message_by_number):
- Update to reflect changes in CamelFolder
-
- * camel/camel-folder.h:
- * camel/camel-folder.c (_get_subfolder):
- (camel_folder_get_subfolder):
- The CamelFolder::get_folder is renamed to
- get_subfolder as it is more intuitive.
-
- * camel/camel-folder.c (_get_message_by_number):
- (camel_folder_get_message_by_number):
- * camel/camel-folder.h
- (camel_folder_get_message_by_number):
- The get_message method is now named
- get_message_by_number for consistency
- with the _by_uid methods.
-
- * camel/camel-folder.[ch]:
- clean-ups.
-
-1999-12-13 Nat Friedman <nat@helixcode.com>
-
- * ebook/e-book.h: New file.
- * ebook/e-book.c: New file.
- * ebook/e-card.h: New file.
- * ebook/e-card-fields.h: New file.
- * ebook/e-commerce.h: New file. :-)
-
-1999-12-08 Ettore Perazzoli <ettore@gnu.org>
-
- * tests/test1.c (main): Removed the strdup()s, which are not
- deeded anymore.
-
- * camel/camel-mime-message.c (_set_subject): `subject' made const.
- (camel_mime_message_set_subject): Likewise.
- (_set_from): `from' made const.
- (camel_mime_message_set_from): Likewise.
- (_set_reply_to): Made `reply_to' const.
- (camel_mime_message_set_reply_to): Likewise.
- (_set_set_received_date): Made `received_date' const.
- (camel_mime_message_set_reply_to): Likewise.
- (_set_field): `value' made const. Also, strdup the string before
- assigning.
-
- * camel/camel-mime-message.h: Virtual methods changed to use const
- strings when setting header values.
-
-1999-11-17 Ettore Perazzoli <ettore@gnu.org>
-
- * composer/Makefile.am (EXTRA_DIST): Added `$(glade_DATA)'.
-
- * camel/Makefile.am (EXTRA_DIST): Added
- `$(libcamel_extra_sources)'.
- (libcamelinclude_HEADERS): Added `gmime-base64.h'.
-
-1999-11-17 Ettore Perazzoli <ettore@gnu.org>
-
- * camel/camel-mime-message.c (_write_to_stream): Removed extra ':'
- in the `Mime-Version' header.
-
- * tests/ui-tests/msg-composer-test.c: Removed.
-
- * Makefile.am (SUBDIRS): Added `composer'.
-
- * configure.in: Create `composer/Makefile'.
-
- * camel/camel-simple-data-wrapper-stream.c
- (camel_simple_data_wrapper_stream_construct): Updated accordingly.
- (camel_simple_data_wrapper_stream_new): Updated accordingly.
- * camel/camel-stream-data-wrapper.c
- (camel_stream_data_wrapper_construct): Updated accordingly.
-
- * camel/camel-data-wrapper.h: Replaced `IS_CAMEL...()' type check
- macro name with `CAMEL_IS...()'.
- * camel/camel-folder-pt-proxy.h: Likewise.
- * camel/camel-folder-summary.h: Likewise.
- * camel/camel-folder.h: Likewise.
- * camel/camel-medium.h: Likewise.
- * camel/camel-mime-body-part.h: Likewise.
- * camel/camel-mime-message.h: Likewise.
- * camel/camel-mime-part.h: Likewise.
- * camel/camel-multipart.h: Likewise.
- * camel/camel-service.h: Likewise.
- * camel/camel-session.h: Likewise.
- * camel/camel-simple-data-wrapper-stream.h: Likewise.
- * camel/camel-simple-data-wrapper.h: Likewise.
- * camel/camel-store.h: Likewise.
- * camel/camel-stream-buffered-fs.h: Likewise.
- * camel/camel-stream-data-wrapper.h: Likewise.
- * camel/camel-stream-fs.h: Likewise.
- * camel/camel-stream-mem.h: Likewise.
- * camel/camel-stream.h: Likewise.
-
- * tests/test1.c (main): Updated to match the `RECIPIENT_TYPE'
- changes.
-
- * camel/camel-mime-message.h: Changed `RECIPIENT_TYPE_TO',
- `RECIPIENT_TYPE_CC' and `RECIPIENT_TYPE_BCC' into
- `CAMEL_RECIPIENT_TYPE_TO', `CAMEL_RECIPIENT_TYPE_CC' and
- `CAMEL_RECIPIENT_TYPE_BCC', respectively.
-
-1999-11-17 Ettore Perazzoli <ettore@gnu.org>
-
- * camel/camel-mime-message.c (_write_to_stream): Write
- "Mime-Version: 1.0" to the stream.
-
- * tests/test1.c: If executed with a file name parameter, attach a
- file with with that name to the email without loading it into
- core, thus demonstrating usage of my latest changes.
-
- * camel/camel-mime-part.c (_set_encoding): Updated to use
- `CamelMimePartEncodingType'.
- (camel_mime_part_set_encoding): Likewise.
- (_get_encoding): Likewise.
- (camel_mime_part_get_encoding): Likewise.
- (_write_content_to_stream): Honour the `encoding' member.
- (_construct_from_stream): Made static.
- (camel_mime_part_encoding_to_string): New function.
- (_write_to_stream): Write the encoding string using it.
- (camel_mime_part_init): Set encoding to
- `CAMEL_MIME_PART_ENCODING_DEFAULT'.
- (_finalize): Don't free `encoding' anymore.
- (camel_mime_part_encoding_from_string): New function.
- (_parse_header_pair): Use it.
-
- * camel/camel-mime-part.h: New enum `CamelMimePartEncodingType'.
- Member `encoding' of `struct _CamelMimePart' changed from `gchar
- *' to `CamelMimePartEncodingType'. All the encoding-related
- methods changed to use this type instead of `gchar *'.
-
- * camel/gmime-base64.c (gmime_encode_base64): Got it to work.
-
- * camel/Makefile.am (libcamel_la_SOURCES): Compile
- `gmime-base64.c'.
-
- * camel/gmime-base64.h: New, previously missing, header.
-
- * camel/camel-stream-data-wrapper.c: New file implementing the
- `CamelStreamDataWrapper' class.
- * camel/camel-stream-data-wrapper.h: Corresponding header.
-
- * camel/camel-simple-data-wrapper.c: Implemented the `get_stream'
- virtual method.
- (_get_stream): New function implementing the method.
- (camel_simple_data_wrapper_class_init): Install it in the class
- struct.
- (camel_simple_data_wrapper_init): New function initializing the
- `stream' member to NULL,
- (camel_simple_data_wrapper_class_init): Set it as the
- GtkObjectInitFunc.
-
- * camel/camel-simple-data-wrapper.h: New member `stream' in
- `struct _CamelSimpleDataWrapper'.
-
- * camel/camel-simple-data-wrapper-stream.c: New file implementing
- the `CamelSimpleDataWrapperStream' class.
- * camel/camel-simple-data-wrapper-stream.h: Corresponding header.
-
- * camel/camel-data-wrapper.c (camel_data_wrapper_get_stream): New
- function.
- (_get_stream): New private function, just returning NULL.
- (camel_data_wrapper_class_init): Install it as the default
- `get_stream' virtual method.
-
- * camel/camel-data-wrapper.h: New virtual method `get_stream' in
- `CamelDataWrapperClass'.
- (camel_data_wrapper_get_stream): New function prototype.
-
-1999-11-05 Ettore Perazzoli <ettore@gnu.org>
-
- * tests/ui-tests/msg-composer-test.c: New file for testing the
- `EMsgComposer' widget.
- * tests/ui-tests/Makefile.am (noinst_PROGRAMS): Compile it. Do
- not compile `store_listing' for now because it's currently broken.
- (INCLUDES): Added the `widgets' source directory to the include
- path list.
- (LDADD): Removed the MH dependency; link with
- `libevolutionwidgets.la' from the `widgets' directory.
-
- * configure.in: Create `widgets/Makefile'.
-
- * camel/gmime-rfc2047.c (rfc2047_clean): Removed C++-like comment.
- * camel/camel-folder.c (camel_folder_get_message_uid_by_number):
- Likewise.
- * camel/gmime-content-field.c (gmime_content_field_get_parameter):
- Likewise.
- * camel/camel.c (camel_init): Likewise.
- * camel/camel-provider.c (camel_provider_register): Likewise.
- * camel/camel-multipart.c (_construct_from_stream): Likewise.
- * camel/camel-mime-part.c (_write_content_to_stream): Likewise.
- * camel/camel-medium.c (camel_medium_class_init): Likewise.
-
- * camel/camel-data-wrapper.h (camel_data_wrapper_get_type): Make
- prototype non-static.
-
- * camel/Makefile.am (libcamelinclude_HEADERS): Move
- `camel-exception-list.def' from `EXTRA_DIST' to
- `libcamelinclude_HEADERS'.
-
- * camel/camel.h: Do not #include <config.h>.
- * camel/data-wrapper-repository.h: Likewise.
-
-1999-11-05 Ettore Perazzoli <ettore@gnu.org>
-
- * tests/Makefile.am (INCLUDES): Add `-I$(top_srcdir)'.
-
-1999-10-13 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-folder.c (camel_folder_close): the
- folder->close method is now asynchronous.
-
- * camel/camel-folder-pt-proxy.c (_folder_open_cb):
- (_open):
- (_folder_open_cb):
- (_open):
- open/close method implemented in the thread proxy
- folder. More to come.
-
- * camel/camel-exception.c (camel_exception_xfer):
- new utility func.
-
- * camel/camel-marshal-utils.c: some new marshallers
-
- * camel/camel-folder-pt-proxy.c: Some explanations
- on the thread proxy system.
-
-1999-10-11 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-marshal-utils.c:
- camel/camel-marshal-utils.h:
- Handles operation marshalling.
-
- * camel/camel-thread-proxy.c:
- camel/camel-thread-proxy.h:
- new files. Generic proxy system.
-
- * camel/camel-folder-pt-proxy.c
- moved all proxy related code in dedicated files.
-
- (camel_folder_pt_proxy_init):
- removed proxy initialisation code
- (_finalize):
- removed proxy finalization code
-
-
- * camel/camel-exception.c
- (camel_exception_new):
- (camel_exception_set):
- (camel_exception_free):
- New funcs.
-
-1999-09-21 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-folder-pt-proxy.c (_async_close):
- implemented.
-
- * configure.in:
- Check pthreads.
-
- * camel/Makefile.am:
- camel-folder-pt-proxy.c is only compiled
- when pthreads are available.
-
- * camel/camel-folder-pt-proxy.c:
- Signal proxying implemenatation.
- (_signal_marshaller_server_side):
- (_signal_marshaller_client_side):
- (_init_signals_proxy):
- Code not is tested and has to be best
- explained as it uses threads conditions and
- gtk signal system.
- (_thread_notification_catch): notify pending signals
- as well as thread availability.
-
-1999-09-20 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-folder-pt-proxy.c (_op_exec_or_plan_for_exec):
- completed
-
- Binch of new funcs:
- (_maybe_run_next_op):
- Called by the watch notification when
- a threaded op is completed
- (_thread_notification_catch):
- notification watch call back
- (_init_notify_system):
- set up the notification channel
- (notify_availability):
- called by threads before completion.
-
-1999-09-18 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-folder-pt-proxy.c (_op_exec_or_plan_for_exec):
- new func. Try to exec an operation in a thread
- or queue it if a thread is already busy.
-
- * camel/camel-op-queue.c (camel_op_queue_set_service_availability):
- (camel_op_queue_get_service_availability):
- new funcs.
-
- * camel/camel-op-queue.c (camel_op_new):
- (camel_op_free):
- new funcs. Uses glib mem chunks.
-
-
-1999-09-17 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-folder-pt-proxy.c (_init_with_store):
- added notify io_channel.
-
- * camel/camel-op-queue.h:
- * camel/camel-op-queue.c:
- New object. Operation queue. Meant to be used in
- non-blocking proxy objects.
- (camel_op_queue_run_next_op): new func.
- run the next operation.
-
-1999-09-14 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/Makefile.am (libcamel_la_SOURCES):
- added camel-folder-pt-proxy.[ch] to the build
- process.
-
- * camel/camel-folder-pt-proxy.c (_init_with_store):
- started implementation of the pthread-based
- folder proxy.
-
-
-1999-09-08 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/providers/MH/mh-summary.c
- (mh_load_summary):
- (mh_save_summary):
- (mh_create_summary):
- implemented summary (files) for MH folders.
-
- * camel/providers/MH/camel-mh-folder.c
- (_get_message_by_uid): implemented.
- (camel_mh_folder_class_init):
- (_get_message_uid): implemented
-
- * camel/camel-folder.c (camel_folder_has_uid_capability):
- (camel_folder_get_message_uid):
- (camel_folder_get_message_uid_by_number):
- (camel_folder_get_message_by_uid):
- (camel_folder_get_uid_list):
- Documented UID methods.
- (camel_folder_get_message_uid_by_number):
- const'ified uid.
- (camel_folder_get_message_by_uid): idem
- removed stupid camel_folder_get_message_uid_by_number
- method.
-
- * tests/ui-tests/store_listing.c (close_all):
- close all open folders and stores. (necessary
- for UID list saving ).
-
- * camel/providers/MH/mh-uid.c (mh_generate_uid_list):
- fix: store UID list in CamelMHFolder object.
-
- * camel/providers/MH/camel-mh-folder.c (_open):
- read or create UID list.
- (_close): save UID list.
-
-1999-09-07 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/md5-utils.c (md5_get_digest_from_file):
- correct parameter decl (const)
-
- * camel/md5-utils.h: typo.
-
- * camel/providers/MH/mh-uid.c
- More work on UID stuff for MH.
- (mh_save_uid_list):
- (mh_load_uid_list):
- (mh_generate_uid_list):
- new funcs. Manage on-disk uid list.
-
- * camel/providers/MH/mh-utils.c (mh_is_a_message_file):
- Util routines live here now.
-
- * camel/md5-utils.c
- Documented all funcs.
-
- (md5_get_digest_from_stream):
- correct typo.
- (md5_get_digest_from_file):
- same typo corrected.
-
-
- * camel/md5-utils.h :
- raw routines are declared public now.
- Md5 use has to be versatile.
-
- * camel/providers/MH/mh-uid.c (mh_uid_get_for_file):
- new func. Returns an UID for an MH message.
-
-1999-09-06 bertrand <Bertrand.Guiheneuf@aful.org>
-
-
- * camel/md5-utils.h:
- * camel/md5-utils.c:
- changed names to follow camel style.
- (md5_get_digest_from_stream):
- new methods.
- (md5_get_digest_from_file):
- new function : get file md5 signature.
- To be used in providers code.
-
- * camel/md5-utils.c: imported md5 coding
- routine from rpm. Compiles.
-
-
-1999-09-05 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-folder.c (camel_folder_has_uid_capability):
- (camel_folder_get_message_uid):
- (camel_folder_get_message_uid_by_number):
- (camel_folder_get_message_by_uid):
- (camel_folder_get_uid_list):
- Basic UID framework.
-
- * devel-docs/misc/ref_and_id_proposition.txt:
- New revision. Some fixes.
-
- * camel/camel-folder.h (struct _CamelFolder): added
- uid_capability field.
-
-
- * camel/camel-folder.c (camel_folder_close): publicized
- the close method.
-
- * tests/ui-tests/store_listing.c (show_folder_messages):
- use folder summary instead of opening all messages.
- (show_folder_messages): re-enabled old CPU/Mem consumming
- method. Useful for pop3 for instance.
-
- * camel/providers/MH/camel-mh-folder.c (_create_summary):
- basic and highly non-efficient summary implementation.
- Should be seen as a proof of concept only.
- subfolder summary still has to be implemented.
-
- * camel/providers/maildir/camel-maildir-folder.c (_init_with_store):
- hasn't summary for the moment.
- * camel/providers/maildir/camel-maildir-folder.c
- cosmetic changes.
-
-
-1999-09-04 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/providers/MH/camel-mh-folder.c (_create_summary):
- started summary implementation.
- (_open): correct use of open.
-
- * camel/camel-folder.c (camel_folder_get_summary):
- get folder associated summary object.
-
- * camel/Makefile.am:
- added summary files build
-
- * camel/camel-folder-summary.[ch]:
- basic summary framework
-
-1999-09-03 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * devel-docs/camel/Makefile.am:
- sgml doc has camel-recipient now.
-
- * camel/camel-recipient.c (camel_recipient_foreach_recipient_type):
- added in-line documentation.
-
-1999-09-02 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/providers/maildir: Added (experimental) maildir
- provider written by Jukka Zitting <hukka@greywolves.org>
-
- * camel/providers/Makefile.am (SUBDIRS): build maildir
- provider.
-
- * camel/camel-provider.c (camel_provider_get_for_protocol):
- bug fix. patch from Jukka Zitting <hukka@greywolves.org>
-
- * camel/camel-mime-message.c (_write_one_recipient_to_stream):
- changed decl to fit CRLFunc.
- (_write_recipients_to_stream):
- calls camel_recipient_foreach_recipient_type now.
-
- * camel/camel-recipient.c (camel_recipient_foreach_recipient_type):
- new convinience function. Iterate over all recipient types.
-
- * camel/gmime-utils.c (gmime_write_header_table_to_stream):
- s/write_header_table_to_stream/gmime_write_header_table_to_stream/
- (gmime_write_header_with_glist_to_stream):
- s/write_header_with_glist_to_stream/gmime_write_header_with_glist_to_stream/
-
-1999-09-01 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-mime-message.c (_finalize):
- (_add_recipient):
- (_remove_recipient):
- (_get_recipients): now use CamelRecipientTable
-
- * camel/gmime-content-field.c:
- (gmime_content_field_unref): test if object
- to free is non void.
-
- * camel/camel-folder.c (_finalize):
- (_set_name):
- * camel/camel-mime-part.c (_finalize):
- (_set_description):
- (_set_disposition):
- * camel/camel-service.c (_finalize):
- * camel/camel-stream-fs.c (_finalize):
- * camel/gmime-content-field.c:
- (gmime_content_field_construct_from_string):
-
- * camel/url-util.c (g_url_free):
-
- When using g_free (obj) don't test if obj != NULL
- g_free () already do that. Thanks to elerium for
- the feedback.
-
-1999-08-30 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-recipient.c (camel_recipient_get):
- (camel_recipient_remove):
- (camel_recipient_add):
- new func. More work on new independant recipient code.
-
-1999-08-29 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * MAINTAINERS: updated my e-mail address.
-
-1999-08-28 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-mime-part.c (camel_mime_part_set_text):
- text parameter declared const
-
- * camel/camel-mime-part-utils.c (camel_mime_part_store_stream_in_buffer):
- actually test correctly nb_bytes_read_chunk is >0
-
- * camel/gstring-util.c:
- * camel/gmime-content-field.c:
- * camel/providers/MH/camel-mh-folder.c:
- * camel/camel-stream-fs.c:
- include string.h
-
- * camel/camel-stream-mem.c (_write): return
- the numver of written bytes.
-
- * camel/camel-stream-buffered-fs.c (_eos):
- return sthg
-
- * camel/camel-stream.c (default_camel_seek):
- return something.
-
-1999-08-26 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-mime-part.c (_get_content_object):
- contruct the content from the buffer before calling
- CamelMedium implementation.
- (_construct_from_stream): Do not construct the content
- by default, just store the content bytes in
- a temporary buffer. Content will be constructed only
- at caller request (when calling CamelMedium::get_content_object)
- Providers with better access to the messages (mbox/MH ...)
- will have to provider lighter implementation, that is
- shall not read content at all unless the caller asks
- for it (again with get_content).
-
- * camel/camel-mime-part-utils.c: new file, groups
- mime-part related utils. Meant to be used by providers
- subclassing MimeMessage.
- (camel_mime_part_construct_headers_from_stream):
- (camel_mime_part_construct_content_from_stream):
- no more useless temporary hash table.
-
- * camel/camel-mime-part.c (_construct_from_stream): calls
- mime-part-utils functions now.
-
- * camel/gmime-utils.c (_store_header_pair_from_string):
- do not use hash table to store header, use an array instead.
-
-1999-08-25 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-mime-part.c: now descend from CamelMedium.
-
- * tests/test1.c (main): all headers must be strdup'ed
- (main): unref created objects
-
- * camel/camel-medium.c (_set_content_object):
- (_get_content_object): these methods are
- in CamelMedium now.
-
-1999-08-24 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-medium.c (camel_medium_class_init):
- new class. Will handle all sort of information media
- (Mime mail messages, Lotus Notes mail messages,
- postit notes, faxes, who knows .... :)
- CamelMimePart will inherit from it.
-
- * camel/camel-mime-part.c (_set_disposition):
- (_set_description):
- description and disposition parameters are now const.
-
-
- * camel/gmime-content-field.c (gmime_content_field_free): added
- assertion code.
-
- * camel/providers/MH/camel-mh-folder.c (_get_message):
- uses buffered stream.
-
- * camel/camel-stream-buffered-fs.c:
- new stream to accelerate file ops.
-
-1999-08-20 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-stream-fs.c (camel_stream_fs_new_with_name):
- name parameter is const. This fixes a bug in destroy ()
-
-1999-08-18 Robert Brady <rwb197@ecs.soton.ac.uk>
-
- * camel/gmime-rfc2047.c: more work on encoder.
-
-1999-08-17 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-stream.c (camel_stream_read):
- return the number of bytes read.
- How can this have ever worked ?
- (camel_stream_flush): don't return anything.
-
- * camel/gmime-utils.c (get_header_table_from_stream):
- mem leak fixed.
-
-1999-08-16 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * tests/ui-tests/store_listing.c:
- Now has a popup menu on mailbox tree to allow
- easier tests. Implemented the copy stuff.
- Works well for the MH provider :)))
-
- * camel/providers/MH/camel-mh-folder.c (_copy_message_to):
- Test MH provider fast copy implemented.
-
-
-1999-08-15 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-folder.c (camel_folder_expunge):
- moved the active list readjustment code here.
- Much saner, providers won't have to worry about
- that.
- (_copy_message_to): new method.
-
- * camel/providers/MH/camel-mh-folder.c (_expunge):
- no more active list readjustment stuff.
-
- * camel/camel-folder.h: the expunge virtual no more
- returns a list of expunged messages. Now providers
- only have to set the expunge flag on the expunged
- messages.
-
- * camel/camel-folder.c (camel_folder_get_message):
- moved the caching code here. Finally, I don't want
- providers to crash the libs with a bad message cache
- implementation.
- (_close): do not call the CamelFolder virtual expunge
- method directly, use camel_folder_expunge() instead.
- (camel_folder_expunge): added the want_list param.
- The client can decide if it wants the expunged message
- list or not. If yes, it'll have to unref the messages
- itself.
-
-1999-08-14 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * tests/ui-tests/store_listing.c (delete_selected_messages):
- (expunge_selected_folders):
- Implemented deletion/expunge mechanism.
-
- * camel/camel-folder.c (_get_message):
- Added some debug info.
-
- * camel/providers/MH/camel-mh-folder.c (_expunge):
- implemented and tested.
-
- * camel/camel-mime-message.c (_set_flag):
- changed the old braindead implementation.
- boolean are inserted in the flag hash
- table casted as gpointers.
-
-
- * camel/camel-mime-message.c: indentation fix
-
-
-1999-08-13 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-folder.c (_get_message): default implementation
- to be called first by providers methods. It looks in the
- folder message list (in memory) to see if the message has
- not already been retrieved, and in this case, returns
- the same CamelMimeMessage object
-
- * camel/providers/MH/camel-mh-folder.c (_get_message): set
- message->message_number correctly.
-
- * camel/camel-folder.h (struct _CamelFolder):
- New field (message_list) which will hold a
- reference on each message obtained by the folder,
- which is necessary in order for the caching procedure
- to work (Getting the same message from a folder twice
- will return the same CamelMimeMessage object).
-
- * camel/camel-folder.c (camel_folder_get_message):
- When the store retreives a message put it in its
- message list.
- (_finalize): free message list.
-
- * ChangeLog: fix typo (parmanent)
-
- * camel/camel-folder.c (_get_permanent_flag_list):
- (camel_folder_get_permanent_flag_list):
- new method, returns the list of permanent
- flags supported by the folder.
-
- * camel/camel-mime-message.c (_get_flag_list):
- (camel_mime_message_get_flag_list): new method,
- return the list of flag name used by this message.
-
- * camel/hash-table-utils.c (g_strcase_equal):
- (g_strcase_hash): those two func go here now.
-
- * camel/hash_table_utils.c (hash_table_generic_free):
- free a (gpointer, gpointer) hash table pair.
-
- * camel/camel-mime-message.c (camel_mime_message_init): use
- case insensitive hash table functions.
- (_set_flag):
- (camel_mime_message_set_flag):
- (_get_flag):
- (camel_mime_message_get_flag):
- Use const for flag name, they are now
- duplicated.
-
-1999-08-12 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * tests/ui-tests/store_listing.c (show_folder_messages):
- remove stupid debug code.
- (add_mail_store): use camel_session_get_store instead
- of creating MH store directly.
- (main): load MH provider.
-
- * camel/camel-provider.c (camel_provider_register_as_module):
- register new provider.
- (camel_provider_get_for_protocol):
- Now, implementation is correct.
-
- * camel/camel-store.c (_finalize):
- * camel/camel-store.h (struct _CamelStore):
- further disabled url_name field use.
- URL will be generated dynamically.
-
- * camel/camel-session.c (camel_session_get_store_for_protocol):
- compilation and runtime fixes.
-
- * camel/providers/MH/camel-mh-store.c (_init):
- synced with CamelStore.
-
- * camel/camel-store.c (_init):
- in CamelStore::init, url_name is now const.
- disabled url_name copy.
-
- * camel/camel-session.c (camel_session_get_store):
- new function: returns a store for an URL.
- (camel_session_get_store_for_protocol):
- new functionc: returns a store for a given
- store protocol (as IMAP/POP/MH ...)
- * camel/string-utils.c (g_strcase_equal):
- (g_strcase_hash): case insensitive hash table
- funcs.
-
- * camel/camel-session.c (camel_session_init): hash table
- keys are case insensitive.
-
- * camel/camel-provider.c (camel_provider_get_for_protocol):
- new function, returns the last registered
- provider for a protocol.
-
- * camel/providers/MH/camel-mh-provider.c:
- new file. MH provider registration stuff.
-
- * camel/camel-provider.c (camel_provider_register_as_module):
- load a provider from a shared object (plugin).
- (camel_provider_register): register a provider
- "by hand". Used for statically defined providers.
-
- * tests/test7.c: new test.
- tests providers loading framework.
-
-1999-08-11
-
- * camel/camel-service.c (_finalize):
- * camel/camel-stream-fs.c (_finalize):
- (_destroy): close file descriptor.
- * camel/camel-stream-mem.c (_finalize):
- * camel/camel-store.c (_finalize):
- * camel/camel-folder.c (_finalize):
- * camel/camel-multipart.c (_finalize):
- * camel/camel-simple-data-wrapper.c (_finalize):
- * camel/camel-mime-part.c (_finalize):
- implemented destructors.
-
-
- * camel/gmime-content-field.c (gmime_content_field_ref):
- (gmime_content_field_unref):
- New reference mechanism for GMimeContentField objects.
-
- * camel/camel-data-wrapper.c (_finalize):
- Started implementing destructors.
-
- * camel/camel-mime-part.c (_construct_from_stream):
- * camel/gmime-content-field.c (gmime_content_field_write_to_stream):
- * camel/camel-multipart.c (_construct_from_stream):
- removed forgotten anarchic traces.
-
-1999-08-10 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * tests/ui-tests/store_listing.c:
- * tests/ui-tests/store_listing.glade:
- Quick and (very) dirty hack to test Camel more
- easily.
-
- * camel/camel-folder.c (camel_folder_append_message):
- new method.
-
-1999-08-09 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * devel-docs/misc/ref_and_id_proposition.txt:
- new file. Document message UID and vfolder
- implementation.
-
-1999-08-08 Robert Brady <rwb197@ecs.soton.ac.uk>
-
- * camel/gmime-rfc2047.c: more advanced RFC2047 encoder started.
-
-1999-08-08 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/providers/MH/camel-mh-folder.c (_get_message):
- fix. In MH, message number is not related to
- message position in folder.
-
- * camel/providers/MH/camel-mh-folder.c (_is_a_message_file):
- util func.
- (_get_message_count): implemented.
-
-1999-08-06 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * devel-docs/camel/:
- updated some autogen doc stuff.
- Still don't understand warnings :(
-
- * camel/camel-data-wrapper.c:
- * camel/providers/MH/camel-mh-store.c:
- * camel/url-util.c:
- * camel/gmime-content-field.c:
- * camel/camel-store.c:
- various inline doc corrections.
-
- * camel/camel-folder.c (get_message_count):
- new method. Returns the number of message
- in the folder.
-
-
-
-1999-08-06 Robert Brady <rwb197@ecs.soton.ac.uk>
-
- * tests/test6.c: encoder test.
-
- * camel/gmime-rfc2047.c: Fixed decoder bug : sequence
- ?= is not always the terminator for an encoded-string.
-
-
-1999-08-06 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/providers/MH/camel-mh-folder.c (_list_subfolders):
- stat was not testing the good file. Fixed.
-
- * tests/test4.c (main): added real test for MH folder
- provider. All tested things seem to work OK :)
-
-1998-08-06 Robert Brady <rwb197@ecs.soton.ac.uk>
-
- * tests/test5.c: test for RFC2047 decoder.
-
- * camel/gmime-rfc2047.c: Improved RFC2047 decoder.
-
-1999-08-06 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/providers/MH/camel-mh-folder.c (_exists): add debug information
- (_list_subfolders): test if first char in folder name is not '.'
- before adding it to the folder list.
-
- * camel/camel-store.c (_init):
- disable session check temporarily
- (_get_separator):
- (_get_folder): new static func.
- Fixed several oddities in class definition.
-
- * camel/providers/MH/camel-mh-store.c (camel_mh_store_get_type):
- parent type is CAMEL_STORE_TYPE not CAMEL_FOLDER_TYPE
-
- * camel/camel-store.c:
- prent class is CamelServiceClass not GtkObjectClass
-
- * camel/url-util.c :
- cosmetic changes + use of const when possible.
- (find_host):
- fix a bug: when there is no host and no port don't skip the '/'
- all static find_* func are now named _func_*
- (g_url_free): destructor func.
- cache field has been disabled. Constructing the url string
- won't be too slow and will occur rarely enough that we
- do not need to add complexity to this code.
-
- * camel/providers/MH/camel-mh-store.c:
- parent class is CamelStorClass not GtkObjectClass
-
-1999-08-05 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * tests/test4.c:
- test mh provider.
-
- * camel/providers/MH/camel-mh-folder.c (_get_message):
- implemented
-
- * camel/camel-folder.c (_get_message):
- new method.
- (camel_folder_get_message):
- corresponding public call
-
- * camel/README.HACKING:
- Some notes.
-
- * camel/CODING.STYLE:
- short note about coding style.
-
- * camel/README.COPYRIGHT:
- Note about copyright policy.
-
- * camel/providers/MH/camel-mh-folder.c (_list_subfolders):
- minor typo fixes.
-
-
-1999-08-04 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/gmime-rfc2047.c:
- * camel/gmime-rfc2047.h:
- indentation and cosmetic changes.
-
- * camel/providers/MH/camel-mh-folder.c (_list_subfolders):
- implemented.
- * camel/providers/MH/camel-mh-folder.c (_delete):
- finshed implementation
- (_delete_messages): implemented.
-
-
-1999-08-04 Robert Brady <rwb197@ecs.soton.ac.uk>
-
- * camel/gmime-rfc2047.[ch]: added an implemention of RFC2047
- (support for character sets other than US-ASCII in MIME
- headers). Not actually called from anywhere yet.
-
-
-1999-08-03 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/providers/MH/camel-mh-folder.c (_create):
- implemented.
- (_delete): started implementation.
-
- * camel/camel-folder.c (_get_folder): default implementation
- calls camel_store_get_folder ().
-
- * camel/providers/MH/camel-mh-folder.c (_init_with_store):
- implemented.
-
- * camel/camel-folder.h (struct _CamelFolder):
- remove useless exist_on_store field.
-
- * camel/camel-folder.c (_exists):
- do not use exist_on_store field.
-
- * camel/camel-folder.c (camel_folder_set_name):
- (camel_folder_get_name):
- new public functions
- (_set_name): set full_path.
-
- (_set_full_name):
- (camel_folder_set_full_name):
- commented out this functions def.
- It would make things very difficult to handle, and would not
- be very useful.
-
- * camel/providers/MH/camel-mh-store.h:
- * camel/providers/MH/camel-mh-store.c (camel_mh_store_set_toplevel_dir):
- (camel_mh_store_get_toplevel_dir):
- * camel/providers/MH/camel-mh-folder.c (_set_name):
- * camel/providers/MH/camel-mh-folder.h:
- use (gchar *) instead of (GString *) everywhere.
- use const when necessary.
-
- * camel/camel-folder.h (struct _CamelFolder):
- removed unused message_list field.
-
- * camel/camel-mime-part.c (_set_content_object):
- There is a probleme here. We can not allow mime part
- content-type field and content_object mime-type to be
- different. I thus chosed to set mime part object
- content field to be freed (if necessary) and set
- to be a pointer to content_object mime type
- field.
- (_construct_from_stream): set content_object mime type
- to be the same as mime_part's one. This is necessary
- because we use _set_content_type.
-
- This two things are a bit hackish ansd may need
- to be redesigned.
-
- * camel/gmime-utils.c (gmime_write_header_pair_to_stream):
- use g_strdup_printf and remove a bug.
-
- * camel/camel-simple-data-wrapper.c (_construct_from_stream):
- more debugging output + nb_bytes_read is now a signed int
- to avoid bug when eos is encountered.
-
- * camel/camel-mime-part.c (_construct_from_stream):
- sync to data_wrapper_repository function name changes.
- Use default "text/plain" type when conten-type field
- is not found. (following RFC 2046 spec).
-
- * camel/data-wrapper-repository.c (data_wrapper_repository_set_data_wrapper_type):
- (data_wrapper_repository_get_data_wrapper_type):
- change function name prefix (s/data_wrapper/data_wrapper_repository/)
-
- * camel/camel-multipart.c (_read_part):
- add `\n` at eol but not before boundary.
-
- * camel/gmime-utils.c (get_header_table_from_stream):
- correct implementation of end of stream detection.
-
-1999-08-01 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-multipart.c (_read_part):
- use a stream to store the part instead of GString.
-
- * camel/camel-mime-part.c (camel_mime_part_set_text):
- set data wrapper content type to "text/plain".
-
- * camel/camel-stream-mem.c:
- * camel/camel-stream-mem.h:
- new memory buffer based stream.
-
- * camel/camel-stream-fs.c (_seek):
- implementation for file system based stream.
-
- * camel/camel-stream.c (camel_stream_seek):
- new method.
-
- * camel/camel-stream-fs.c (camel_stream_fs_class_init):
- pass CamelStreamFsClass instead of CamelStreamClass.
-
-1999-08-01 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/gmime-utils.c (gmime_write_header_pair_to_stream):
- corrected a bug with memory not allocated for '\0' in strtmp
-
- * camel/gmime-utils.c (gmime_read_line_from_stream):
- do not return NULL when line is empty.
-
- * camel/camel-multipart.c (_read_part): return true when end
- of multipart is found, not the opposite
-
-1999-07-31 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/gmime-utils.c (gmime_read_line_from_stream):
- Don't return crlf at end of line.
-
-1999-07-30 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/gmime-utils.c (gmime_read_line_from_stream):
- new function: reads a line from a stream.
- should be in streams utils maybe.
-
-1999-07-29 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-mime-part.c (_construct_from_stream):
- Uses data wrapper repository to find what data wrapper
- to use to construct the content from a stream. When
- no object is registered for the mime type found in
- content type field a CamelSimpleDataWrapper is
- used.
-
- * camel/camel-mime-part.c (_get_content_type):
- (camel_mime_part_get_content_type): returns
- a pointer on the content_type field instead
- of the gchar * mime "type/subtype".
-
-1999-07-28 bertrand <Bertrand.Guiheneuf@aful.org>
-
-
- * camel/data-wrapper-repository.c
- * camel/data-wrapper-repository.h
- New files. Handles mime type <-> camel object
- (for example "multipart" <-> CamelMultipart
- * tests/tesst3.c: test data repository thing.
-
-1999-07-26 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-multipart.c (_write_to_stream):
- implemented output of multipart.
-
- * tests/test1.c (main): testing content objects operations.
-
-1999-07-25 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-mime-part.c (camel_mime_part_set_text):
- new util function to set a mime part content to be
- a text string.
-
- * camel/camel-simple-data-wrapper.c (camel_simple_data_wrapper_set_buffer_from_text):
- new util func.
- (camel_simple_data_wrapper_new): new func.
-
- * camel/camel-multipart.c (_write_to_stream):
- implemented output of multiparts.
-
-1999-07-24 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/gmime-content-field.c (gmime_content_field_get_parameter):
- New function. Returns the value associated to a
- mime parameter.
-
-
-1999-07-22 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-multipart.h:
- * camel/camel-multipart.c:
- New class. Models multipart mime objects.
-
- * camel/camel-mime-body-part.h:
- * camel/camel-mime-body-part.c:
- New class. Body part is a mime part contained in
- a multipart object.
-
-
-1999-07-21 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-log.h:
- implemented hard log level stuff.
- * came/*.c use "CAMEL_LOG_*" instead of "CAMEL_LOG (*"
- in order to allow hard level switch.
-
- * tests/test1.c:
- * tests/test2.c:
- updated to use gchar instead of GString. Tests passed.
-
-
-1999-07-19 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-stream.c:
- * camel/camel-stream.h:
- "const"-antified
-
-
- * camel/camel-simple-data-wrapper.c: (_construct_from_stream)
- do not use any limit when constructing the object from a stream
-
- * camel/camel-stream-fs.c:
- * camel/camel-stream-fs.h:
- * camel/camel-mime-message.c:
- * camel/camel-mime-message.h:
- * camel/camel-session.c:
- * camel/camel-session.h:
- * camel/camel-service.c:
- * camel/camel-service.h:
- * camel/camel-store.c:
- * camel/camel-store.h:
- * camel/camel-folder.c:
- * camel/camel-folder.h:
- * camel/gmime-utils.c:
- * camel/gmime-utils.h:
- GString -> gchar
- constantified what had to be.
-
- * camel/string-utils.c:
- * camel/string-utils.h:
- New files. Meant to replace gstring-util for gchar *
-
-1999-07-16 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/gmime-content-field.c (gmime_content_field_construct_from_string):
- GString -> gchar
- use const to indicate copied parameter.
-
-1999-07-15 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-simple-data-wrapper.c:
- * camel/camel-simple-data-wrapper.h:
- Gstring -> gchar
-
-1999-07-15 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/url-util.c:
- * camel/url-util.h:
- Do not use GStrings any more.
- Added assertion code.
- Cosmetic reformating
-
- * AUTHORS:
- * ChangeLog:
- Changed my email address.
-
-
-1999-07-13 Miguel de Icaza <miguel@gnu.org>
-
- * camel/gmime-base64.c (gmime_encode_base64): Implemented base64
- encoder based on CamelStreams. Should the encoder/decoder be a
- Stream itself?
-
- * camel/gmime-utils.c: include config.h here.
- * camel/url-util.c: ditto.
- * camel/gstring-util.c: ditto.
- * camel/gmime-content-field.c: ditto.
- * camel/camel-stream.c: ditto.
- * camel/camel-stream-fs.c: ditto.
- * camel/camel-store.c: ditto.
- * camel/camel-simple-data-wrapper.c: ditto.
- * camel/camel-session.c: ditto.
- * camel/camel-service.c: ditto.
- * camel/camel-mime-part.c: ditto.
- * camel/camel-mime-message.c: ditto.
- * camel/camel-log.c: ditto.
- * camel/camel-data-wrapper.c: ditto
- * camel/camel-folder.c: ditto.
-
- * camel/camel-stream.c (camel_stream_write): Moved api
- documentation to the places that they document.
- (camel_stream_class_init): Virtual classes do not need to have a
- default implementation. So null them all.
- (camel_stream_write): Return value from write.
- (camel_stream_available): implement.
- (camel_stream_write_strings): documented.
-
- * devel-docs/query/virtual-folder-in-depth.sgml: Small
- reformatting
-
-1999-06-28 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * tests/test2.c (main): now use
- CamelDataWrapper::contruct_form_stream to test
- message parsing
-
- * camel/camel-data-wrapper.c:
- * camel/camel-data-wrapper.h:
- construct_from_stream no longer has maximimum size arg.
-
- * camel/camel-mime-part.c (_construct_from_stream): new.
- Construct the mime_part from a stream.
-
- * camel/camel-mime-part.c:
- new field (content_type) and associated methods.
- (camel_mime_part_init): initialize content_type field.
- (_parse_header_pair): now set content_type MimePart field
- instead of using DataWrapper Mime typing facility.
-
-1999-06-28 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-data-wrapper.h:
- s/content_type/mime_type/
-
-1999-06-24 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-simple-data-wrapper.[ch]:
- new class. Simple implementation of a data wrapper:
- simply keeps the stream result in a byte array.
-
- * camel/camel-mime-part.c (_parse_header_pair): added a warning.
- Have to think about the correct way to store content type stuff.
-
-1999-06-24 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-mime-message.c (_write_one_recipient_to_stream):
- includes gmime-utils header.
- patch from Ulrich Drepper <drepper at cygnus.com>
- set separator string in write_header_with_glist_to_stream()
-
- * camel/camel-log.c (camel_log):
- patch from Ulrich Drepper <drepper at cygnus.com>
- Do not use stderr in initialization of logfile descriptor.
-
- * camel/camel-stream-fs.c (camel_stream_fs_new_with_name):
- patch from Ulrich Drepper <drepper at cygnus.com>
- initialize mode field in open().
-
-1999-06-22 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-data-wrapper.c (_get_content_type):
- moved all the content-type stuff here.
- (camel_data_wrapper_init): initialize the instance
- content-type field.
-
- * camel/camel-mime-part.c (_parse_header_pair):
- parse Content-Type stuff in header.
- (_write_to_stream): write the content type stuff to
- the stream.
-
- * camel/gmime-content-field.c (gmime_content_field_get_mime_type):
- new function, returns "type/subtype" mime type string.
- (gmime_content_field_construct_from_string):
- new function, construbt a content_field object
- form a string. be used to set the mime_type from a
- string.
-
- * camel/camel-mime-part.c (_set_content_type):
- (camel_mime_part_set_content_type):
- (_get_content_type):
- (_get_content_type):
- new methods.
-
-1999-06-21 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/gmime-utils.c (get_header_table_from_stream):
- replace CR/LF+'\t' with ' '
-
- * camel/camel-mime-message.c (_set_recipient_list_from_string):
- trim \t when splitting
-
- * camel/gmime-utils.c (get_header_table_from_file):
- corrected bug in scanning tabulations ('t' -> '\t')
-
- * tests/test2.c (main): read mail.test instead
- of mail1.test
-
- * camel/camel-mime-part.c (_add_header):
- added comments
-
-1999-06-03 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * devel-docs/query/virtual-folder-in-depth.sgml:
- sgmlized Giao's doc about virtual folders.
-
-1999-05-31 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * tests/test2.c (main):
- use new stream code instead of raw file * stuff.
-
- * camel/gmime-utils.c (get_header_table_from_stream):
- new func. Will replace get_header_table_from_file and will
- be used to parse headers from files as well as from
- memory buffers.
-
- * camel/camel-stream-fs.c:
- CamelStream Subclass. File system based
- stream.
-
-
-1999-05-30 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-stream.h: new class. Represents an
- abstract stream object.
-
- * camel/camel-mime-message.c (_set_recipient_list_from_string):
- remove leading and trailing spaces in recipient addresses.
-
- * camel/gmime-utils.c (_store_header_pair_from_gstring):
- remove leading and trailing spaces from header values.
-
- * camel/gstring-util.c (g_string_trim): new
- func: remove leading or trailng chars from
- a specified char set.
- (g_string_split): allow trimming of substrings.
-
- * tests/test1.c (main): remove gtk_main call
-
-1999-05-28 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-mime-part.c
- (_parse_header_pair):
- (_init_header_name_table):
- More header parsing code.
-
-
-1999-05-27 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * tests/test2.c (main): rewrite message obtained via
- parsing into a file. Actually, it works pretty well :))
-
- * camel/camel-mime-message.c (_set_recipient_list_from_string):
- create recipient list form a comma separated string.
- (_parse_header_pair): added recipient lists parsing.
-
- * camel/camel-mime-part.c (_parse_header_pair):
- new (protected) method. Parse a head pair and
- decides what to do with it.
-
- (_add_header): Call in _parse_header_pair
-
- * camel/camel-mime-message.c (_parse_header_pair):
- overload header parsing MimePart mthod.
-
- * camel/gstring-util.c (g_string_split):
- new func: split a gstring into a GList of
- substring.
-
-1999-05-26 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/gmime-utils.c (get_header_lines_from_file):
- new func. Parses message header zone and returns
- a Glist of all header lines.
-
- * tests/test2.c: tests message parsing
-
- * camel/gmime-utils.c (write_header_table_to_file):
- new func to write a table of headers.
-
-1999-05-20 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-mime-message.c (_write_to_file):
- recipient list printing
-
- * tests/test1.c (main): more tests.
-
-1999-05-19 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-mime-part.c (_write_to_file): test if content
- exists before calling its write_to method.
-
- * camel/camel-mime-message.c (_write_to_file): bugs fix.
-
- * camel/camel-mime-message.c (camel_mime_message_new_with_session):
- new func. Creates a message with the session field set
- up correctly.
-
-1999-05-18 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * tests/test1.c (main): tests
-
- * camel/camel-mime-message.c (_write_to_file):
- started write_to framework for mime_messages
-
- * camel/camel-mime-message.c (*_message_number):
- message number funcs.
-
-1999-05-15 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-mime-message.c (*_flag):
- flags handling methods
-
-1999-05-14 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-mime-message.c (camel_mime_message_class_init):
- added recipient handling class funcs.
-
-1999-05-13 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-mime-message.c (camel_mime_message_init):
- create recipients hash table
- (_remove_recipient):
- (_add_recipient):
- (_get_recipients): new funcs.
- Internal Recipients data structure is
- a bit complicated though.
-
- * camel/camel-mime-part.c (camel_mime_part_init):
- create headers hash table
-
- * camel/camel-mime-message.h:
- a bunch of get/set header field
- method done. Does nothing yet though.
-
- * camel/camel-mime-message.[ch] :
- new file.
-
-1999-05-12 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-mime-part.h (struct ):
- disposition is now a full GMimeContentField
- object.
-
- * camel/gmime-content-field.c: new file
- handle "type/subtype ;parameter=value ; parameter=value ..."
- BNF grammar elements
- (gmime_content_field_write_to_file): new func
-
- * camel/gmime-utils.c (gmime_write_header_pair_to_file):
- namespace change
-
-1999-05-11 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-mime-part.c (_write_to_file):
- overload wrapper class method.
- (_write_to_file): start to write some text in
- file.
-
- * camel/camel-store.c: typo fix.
-
- * camel/camel-store.c:
- * camel/camel-service.c:
- * camel/camel-folder.c:
- * camel/camel-data-wrapper.c:
- * camel/camel-mime-part.c:
- static functions naming follows gnome
- coding style guide.
-
- * camel/camel-mime-part.h: implemented public interfaces
-
-
-1999-05-10 Bertrand Guiheneuf <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-mime-part.c (__camel_mime_part_get_header_lines):
- (__camel_mime_part_set_header_lines):
- (__camel_mime_part_get_content_languages):
- (__camel_mime_part_set_content_languages):
- (__camel_mime_part_get_encoding):
- (__camel_mime_part_set_encoding):
- (__camel_mime_part_get_content_MD5):
- (__camel_mime_part_set_content_MD5):
- (__camel_mime_part_get_content_id):
- (__camel_mime_part_set_content_id):
- A bunch of new set/get func.
-
- * camel/gstring-util.c (g_string_list_free):
- convenience function for string list
- complete deallocation.
-
-1999-05-09 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-mime-part.c (__camel_mime_part_add_header):
- new method
-
- * camel/camel-mime-part.h (struct CamelMimePart):
- added core fields.
-
-1999-05-08 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-mime-part.[ch]:
- new class. models a mime mail part.
-
- * camel/camel-data-wrapper.c
- (camel_data_wrapper_write_to_buffer): method to
- stream data content in a buffer.
- (camel_data_wrapper_write_to_file):
- (camel_data_wrapper_construct_from_buffer):
- (camel_data_wrapper_construct_from_file):
- new methods.
-
-1999-05-07 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-data-wrapper.[ch]:new class.
- This should not be a class but rather an
- interface. The day Gtk support interfaces,
- it dataWrapper should become an interface.
-
-1999-05-04 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-service.c (camel_service_get_url):
- new method.
-
- * devel-docs/camel/camel-sections.txt: added
- function doc references
-
- * camel/camel-folder.c (__camel_folder_close):
- fixed indentation.
- (camel_folder_expunge): new method.
- (__camel_folder_close): used expunge flag
-
-1999-05-03 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-folder.c (camel_folder_get_mode):
- typo fix
-
- * camel/camel-folder.c (__camel_folder_list_subfolders):
- new func.
-
- * some doc stuffs
-
-
-1999-05-01 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-folder.c
- (__camel_folder_get_mode):
- (camel_folder_get_mode):
- (camel_folder_get_parent_store):
- (__camel_folder_get_parent_store):
- (camel_folder_get_parent_folder):
- (__camel_folder_get_parent_folder):
- new methods
-
- * camel/camel-service.c: put __ prefix before
- private virtual funcs.
-
- * camel/camel-folder.c (camel_folder_delete):
- (camel_folder_delete_messages):
- new methods.
-
- * camel/url-util.c (g_url_new): some
- more comments
-
-1999-04-27 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-folder.c (camel_folder_create):
- new public function.
-
-1999-04-25 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-session.c (camel_session_get_store_from_provider):
- initialize folder object.
-
- * camel/camel-store.c (init): new method.
- called by session object at instantiation time.
-
- * camel/camel-store.h (struct _CamelStore):
- new fields : session and url_name
-
-1999-04-25 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-session.c (camel_session_set_provider):
- new method to set the default provider for a protocol.
- (camel_session_get_store_from_provider):
- new method to instantiate a folder from a provider.
-
- * camel/camel-provider.h: s/GString/gchar/g
- + typo fix.
-
- * camel/camel-provider.[ch]:
- basic provider structure. Have to write the
- code for dynamic loading.
-
-1999-04-24 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/url-util.[ch]: s/new_g_url/g_url_new
-
- * camel/url-util.c (new_g_url): URL
- rewritten completely. Error handling not
- implemented in public functions.
- But URL scan works pretty well :)))
-
-1999-04-24 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/url-util.[ch]: I needed the url
- functions to use GString, and I wanted a more
- general scheme so I finally started rewriting
- the whole thing from scratch.
- No more code from gzilla :(
-
-1999-04-23 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/url-util.[ch]:
- Utility functions to parse URLs.
- Stolen shamelessly from gzilla (www.gzilla.com)
- written by Raph Levien <raph@acm.org>
-
- * camel/Makefile.am: added url-util.[ch]
- compilation.
-
- * Makefile.am (SUBDIRS): removed devel-docs
- until I come up with a correct Makefile.am
-
- * camel/camel-store.h:
- * camel/camel-folder.h:
- correct declarations of structs
-
-
-1999-04-22 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/providers/MH/camel-mh-store.c:
- more test implementation.
-
- * camel/camel-store.c (camel_store_get_type): typo fix
-
-
-1999-04-21 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/providers/MH/camel-mh-folder.c (camel_mh_folder_get_type):
- start test provider.
-
-1999-04-20 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-store.h: now CamelStore inherits from
- CamelService.
-
- * camel/camel-service.c (camel_service_class_init):
- basic abstract service class.
-
-1999-04-19 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/README: added some (few) explanations.
-
-1999-04-18 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-store.[ch]: started implementation
- * camel/camel-folder.c (camel_folder_get_type): typo
- uncommented the store related code.
- (camel_folder_create): enable som store relted code.
- Not finished. Have to define public methods first.
-
- * camel/camel-log.h: some explanation about the
- log system
-
-1999-04-18 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-folder.c:
- (camel_folder_create): implemented (partially)
- have to write CamelStore before finishing it.
-
- * camel/camel-folder.h (CamelFolder): added full_name field
- (CamelFolderClass): added set/get_full_name methods
-
-1999-04-18 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-folder.c: some work
- * camel/camel-log.c: log system for camel
- * camel/gstring-util.c: some utilities for GString objects
-
-
-1999-04-18 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * autogen.sh (PKG_NAME): groomf -> gnome-mailer
-
diff --git a/HACKING b/HACKING
deleted file mode 100644
index ce31d66dac..0000000000
--- a/HACKING
+++ /dev/null
@@ -1,277 +0,0 @@
-
-1 Patch guidelines
-
-This section lists some guidelines for writing a good patch which is
-more likely to be accepted.
-
-Any new features or large scale work should first be discussed on the
-evolution-hackers list first. This will ensure the idea fits in the
-direction we wish to take Evolution, and also that the effort is not
-duplicated. See section 3 for details on the mailing lists.
-
-1.1 Patch basics
-
-o The patch should apply cleanly at the time it is made.
-
-o It must compile once applied.
-
-o It must not generate any more compile time warnings than were
- already there. This may be platform dependent so simply do your
- best.
-
-o It must conform to C89/C90 (ANSI/ISO C), and build with gcc using
- the default compile flags.
-
- The primary trap is that in C99 you may define variables anywhere in
- the code, in C89 they must be declared in a declaration block which
- follows any block start '{'.
-
- If you wish to ensure the code is C89, try the following.
-
- From the gcc manual page:
- "To select
- this standard in GCC, use one of the options `-ansi', `-std=c89' or
- `-std=iso9899:1990'; to obtain all the diagnostics required by the
- standard, you should also specify `-pedantic'" ...
-
- You may actually have to use '-std=gnu89' if libraries have taken
- advantage of gcc extensions and where not compiled similarly, as the
- above options will disable all gnu extensions.
-
- [FIXME: Add the same option for Forte here]
-
-o It should not add any extra debug printing by default, unless the
- patch is specifically to add extra debug printing.
-
-o It should not use any gcc extensions, except where they are properly
- checked for and not used with other compilers. glib provides some
- of these features as portable macros and should be used when they
- cover the required functionality.
-
-1.1 GUI changes
-
-If the change requires non-trivial user interface changes, then they
-will have to be discussed and approved on the evolution-hackers list
-first. This is highly recommended before embarking on any UI work, or
-large scale work in general. The Gnome HIG document is the place to
-start on any UI changes or additions.
-
-1.2 Translated string changes
-
-Any changes to translated strings in a stable release must be
-discussed on the hackers list (see section 3), and/or as part of the
-patch submission. There must be very good reasons for changing the
-strings in this case.
-
-1.3 Coding style
-
-Generally the coding style employed matches the "Linux Kernel" style,
-that is, basically K&R style indenting with 8 space tabs. Tabs should
-be used rather than space characters. Reformatting of otherwise
-unchanged code is not acceptable. Editors should have any automatic
-reformatting features disabled.
-
-K&R style indenting puts braces on the same line. The opening
-parenthesis of a function call or conditional statement should be on
-the same line as the function. "else" "} else" and "} else {" must
-always occur on lines by themselves.
-
-A single blank line should follow {} blocks (if not immediately
-followed by the close of another block), and conditional statements,
-and be used to separate logical groups of statements in the same
-block.
-
-A single blank line only should separate functions, and other
-structures at the top level of the file (i.e. outside functions). The
-same rule applies to variable declarations at the start of a block.
-
-An example of the most-developer-preferred formatting:
-
-TheType
-the_function (int frank)
-{
- int a = 1;
-
- if (a == frank) {
- a = foo (a);
- } else {
- do {
- a = bob (frank) + a;
- } until (a == frank);
-
- frank = a;
- }
-
- return (TheType) a;
-}
-
-Where there are slight stylistic differences, the style in the
-surrounding code should be followed.
-
-1.3.1 Object casts
-
-You can either use C style casts, or Gtk style casts. Note that Gtk
-style casts can add significant execution overhead, which is not
-adding any extra checking. e.g. if arguments have already been
-type-checked by preconditions. Putting a space between a cast and a
-variable is optional, but preferred by most of the developers.
-
-1.3.2 Preconditions
-
-External api entry points should have preconditions (g_return_if_fail,
-etc), although their use varies from case to case. Internal entry
-points and/or when you are guaranteed the type has already been
-checked, are unecessary. Object initialisation and other virtual
-method invocations are considered internal entry points.
-
-1.3.3 Line lengths
-
-Do not expend effort and resort to unreadable formatting merely to fit
-any long lines into 80 column widths. We use 8 space tabs, and
-because of the lack of namespacing other than extending the function
-name, many of the function and type names are too long for this to be
-practical. We now all uses high resolution displays, and not
-circa-80's VT100 terminals!
-
-On the other hand, lines should generally not exceed 100 characters,
-and absolutely not exceed 160 characters. If your tab nesting is too
-deep you probably have a poor design that needs rethinking.
-
-1.4 Design
-
-This is a tricky issue to document, but the design of new code should
-`fit' with the existing design of the relevent module. It should at
-the very least, be no worse.
-
-Code should not cross existing abstraction boundaries or attempt
-to remove or work around them, if required the existing design may
-need adjustment.
-
-Type and method names should follow the existing practice in the
-surrounding code. Method arguments should follow the same order as
-related methods, and should use the same names for matching
-parameters.
-
-Per file, static class globals are ok, true globals may be ok, but
-should be used sparingly. Use 'i' for a loop variable, if that's all
-it is, don't use 'the_current_index'. etc.
-
-If in doubt, ask on the lists.
-
-2. Patch submission guidelines
-
-This section outlines procedures that should be followed when
-submitting patches to evolution, via the evolution-patches mailing
-list.
-
-You must subcribe to the list at
-`http://lists.ximian.com/mailman/listinfo/evolution-patches' before you
-can submit patches to it.
-
-Also note that if you attach a patch to a bug report, it should always
-be sent to the list for attention.
-
-Any non-trival patches (patches of more than 1 or 2 changed lines in
-more than 5 isolated locations) also require copyright assignment.
-See http://developer.ximian.com/projects/evolution/copyright.html for
-details.
-
-If you follow the guidelines listed here, you should generally expect
-a response within 2 working days. If you re-send the same patch
-repeatedly, you will more likely receive less attention. Do not
-re-send the same patch repeatedly.
-
-2.1 Subject Lines
-
-If the patch addresses a specific bug in bugzilla.ximian.com, then the
-bug number must be included in the subject line, preferably near the
-beginning of the subject line. A concise summary of the bug(s) being
-addressed, should be the remainder of the subject.
-
-It is unnecessary to add "[PATCH]", "patch" or similar to the subject
-line, unless it is being cross-posted to other non-patch lists.
-
-It is absolutely unnecessary to add "please consider", "please review",
-or "seeking review", or similar, to the subject line. Please do not do
-this.
-
-Where the patch does not address a specific bug number, then the subject
-line should simply be a concise summary of the problem/feature it
-addresses.
-
-In all cases the subject line should include the module(s) to which the
-patch applies, and would generally match the component on the bug or
-the top-level module directory (e.g. camel, mail, addressbook, use 'all'
-for more than 3 or 4 modules).
-
-2.2 Message Body
-
-Patches should be attached as attachments, preferably as a single
-diff, when possible, and the changes are related. The diff must be in
-unified diff format, "-up" is a suitable argument to give to "cvs
-diff" (-p may be dropped if not supported by your diff). If you have
-added files, then -N should also be used, but if you are using cvs,
-"cvs add" is needed, and requires write access to the repository.
-
-If the patch does not address a specific bug, then the patch email
-should describe which feature or problem it addresses. If it does
-address a specific bug, then further explanation beyond the bug
-commentary is optional, although often convenient.
-
-It would also be helpful to summarise the module to which it applies
-in the message body.
-
-In all cases you should include which branch, or branches, the patch
-is intended to apply to. If this is not given it will be assumed to
-be the trunk (HEAD), and such patches will and must not be applied to
-any stable branch without further approval.
-
-2.3 ChangeLogs
-
-All patches must include appropriate ChangeLog diff's, to the
-appropriate ChangeLog(s) for the given change (emacs will automatically
-find the correct one, and format the entry appropriately). All but
-the most trivial of patches will not be considered or discussed
-without this. It is ok to contain extra ChangeLog entries for other
-pending patches, but they should not be excessively long - it isn't
-that hard to isolate patch diffs. If the patch addresses a bug in
-bugzilla.ximian.com, then the ChangeLog entry must include some
-reference to that bug number (either the number, or #number, or 'bug
-xxx'). If it addresses a bug in another bug system, it must also
-indicate which bug system ('gnome bugzilla' 'red-hat bugzilla', etc).
-
-2.4 Stable branches
-
-Generally, any patch to the stable branch from non-core developers
-must address a specific bug in bugzilla.ximian.com. The patch should
-also be attached to the bug in question, with the keyword 'patch' set
-on the bug report. The patch email must identify which stable branch
-and version it is to apply to.
-
-3 Mailing lists
-
-3.1 Evolution Hackers
-
-If you wish to discuss patches before they are submitted, or ideas
-before you start to work on them, do it on the evolution-hackers list,
-which may be subscribed and viewed at
-`http://lists.ximian.com/mailman/listinfo/evolution-hackers'.
-
-This is a low-volume list (5-10 posts per day on average).
-
-Some patches may be discussed here to get a wider audience, although
-once a patch has been made it should generally be discussed on
-evolution-patches.
-
-Feature requests, bug reports, and other user related discussions,
-without the intention to write code to address them, will be ignored.
-
-3.2 Evolution Patches
-
-The patch submission list evolution-patches may be subscribed and
-viewed at
-`http://lists.ximian.com/mailman/listinfo/evolution-patches'. Once a
-patch has been written, it may be submitted here for discussion, as
-well as final approval.
-
-Any non-patch related postings to this list will be ignored.
diff --git a/INSTALL b/INSTALL
deleted file mode 100644
index b42a17ac46..0000000000
--- a/INSTALL
+++ /dev/null
@@ -1,182 +0,0 @@
-Basic Installation
-==================
-
- These are generic installation instructions.
-
- The `configure' shell script attempts to guess correct values for
-various system-dependent variables used during compilation. It uses
-those values to create a `Makefile' in each directory of the package.
-It may also create one or more `.h' files containing system-dependent
-definitions. Finally, it creates a shell script `config.status' that
-you can run in the future to recreate the current configuration, a file
-`config.cache' that saves the results of its tests to speed up
-reconfiguring, and a file `config.log' containing compiler output
-(useful mainly for debugging `configure').
-
- If you need to do unusual things to compile the package, please try
-to figure out how `configure' could check whether to do them, and mail
-diffs or instructions to the address given in the `README' so they can
-be considered for the next release. If at some point `config.cache'
-contains results you don't want to keep, you may remove or edit it.
-
- The file `configure.in' is used to create `configure' by a program
-called `autoconf'. You only need `configure.in' if you want to change
-it or regenerate `configure' using a newer version of `autoconf'.
-
-The simplest way to compile this package is:
-
- 1. `cd' to the directory containing the package's source code and type
- `./configure' to configure the package for your system. If you're
- using `csh' on an old version of System V, you might need to type
- `sh ./configure' instead to prevent `csh' from trying to execute
- `configure' itself.
-
- Running `configure' takes awhile. While running, it prints some
- messages telling which features it is checking for.
-
- 2. Type `make' to compile the package.
-
- 3. Optionally, type `make check' to run any self-tests that come with
- the package.
-
- 4. Type `make install' to install the programs and any data files and
- documentation.
-
- 5. You can remove the program binaries and object files from the
- source code directory by typing `make clean'. To also remove the
- files that `configure' created (so you can compile the package for
- a different kind of computer), type `make distclean'. There is
- also a `make maintainer-clean' target, but that is intended mainly
- for the package's developers. If you use it, you may have to get
- all sorts of other programs in order to regenerate files that came
- with the distribution.
-
-Compilers and Options
-=====================
-
- Some systems require unusual options for compilation or linking that
-the `configure' script does not know about. You can give `configure'
-initial values for variables by setting them in the environment. Using
-a Bourne-compatible shell, you can do that on the command line like
-this:
- CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
-
-Or on systems that have the `env' program, you can do it like this:
- env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
-
-Compiling For Multiple Architectures
-====================================
-
- You can compile the package for more than one kind of computer at the
-same time, by placing the object files for each architecture in their
-own directory. To do this, you must use a version of `make' that
-supports the `VPATH' variable, such as GNU `make'. `cd' to the
-directory where you want the object files and executables to go and run
-the `configure' script. `configure' automatically checks for the
-source code in the directory that `configure' is in and in `..'.
-
- If you have to use a `make' that does not supports the `VPATH'
-variable, you have to compile the package for one architecture at a time
-in the source code directory. After you have installed the package for
-one architecture, use `make distclean' before reconfiguring for another
-architecture.
-
-Installation Names
-==================
-
- By default, `make install' will install the package's files in
-`/usr/local/bin', `/usr/local/man', etc. You can specify an
-installation prefix other than `/usr/local' by giving `configure' the
-option `--prefix=PATH'.
-
- You can specify separate installation prefixes for
-architecture-specific files and architecture-independent files. If you
-give `configure' the option `--exec-prefix=PATH', the package will use
-PATH as the prefix for installing programs and libraries.
-Documentation and other data files will still use the regular prefix.
-
- In addition, if you use an unusual directory layout you can give
-options like `--bindir=PATH' to specify different values for particular
-kinds of files. Run `configure --help' for a list of the directories
-you can set and what kinds of files go in them.
-
- If the package supports it, you can cause programs to be installed
-with an extra prefix or suffix on their names by giving `configure' the
-option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
-
-Optional Features
-=================
-
- Some packages pay attention to `--enable-FEATURE' options to
-`configure', where FEATURE indicates an optional part of the package.
-They may also pay attention to `--with-PACKAGE' options, where PACKAGE
-is something like `gnu-as' or `x' (for the X Window System). The
-`README' should mention any `--enable-' and `--with-' options that the
-package recognizes.
-
- For packages that use the X Window System, `configure' can usually
-find the X include and library files automatically, but if it doesn't,
-you can use the `configure' options `--x-includes=DIR' and
-`--x-libraries=DIR' to specify their locations.
-
-Specifying the System Type
-==========================
-
- There may be some features `configure' can not figure out
-automatically, but needs to determine by the type of host the package
-will run on. Usually `configure' can figure that out, but if it prints
-a message saying it can not guess the host type, give it the
-`--host=TYPE' option. TYPE can either be a short name for the system
-type, such as `sun4', or a canonical name with three fields:
- CPU-COMPANY-SYSTEM
-
-See the file `config.sub' for the possible values of each field. If
-`config.sub' isn't included in this package, then this package doesn't
-need to know the host type.
-
- If you are building compiler tools for cross-compiling, you can also
-use the `--target=TYPE' option to select the type of system they will
-produce code for and the `--build=TYPE' option to select the type of
-system on which you are compiling the package.
-
-Sharing Defaults
-================
-
- If you want to set default values for `configure' scripts to share,
-you can create a site shell script called `config.site' that gives
-default values for variables like `CC', `cache_file', and `prefix'.
-`configure' looks for `PREFIX/share/config.site' if it exists, then
-`PREFIX/etc/config.site' if it exists. Or, you can set the
-`CONFIG_SITE' environment variable to the location of the site script.
-A warning: not all `configure' scripts look for a site script.
-
-Operation Controls
-==================
-
- `configure' recognizes the following options to control how it
-operates.
-
-`--cache-file=FILE'
- Use and save the results of the tests in FILE instead of
- `./config.cache'. Set FILE to `/dev/null' to disable caching, for
- debugging `configure'.
-
-`--help'
- Print a summary of the options to `configure', and exit.
-
-`--quiet'
-`--silent'
-`-q'
- Do not print messages saying which checks are being made. To
- suppress all normal output, redirect it to `/dev/null' (any error
- messages will still be shown).
-
-`--srcdir=DIR'
- Look for the package's source code in directory DIR. Usually
- `configure' can determine that directory automatically.
-
-`--version'
- Print the version of Autoconf used to generate the `configure'
- script, and exit.
-
-`configure' also accepts some other, not widely useful, options.
diff --git a/MAINTAINERS b/MAINTAINERS
deleted file mode 100644
index c23ea2e96e..0000000000
--- a/MAINTAINERS
+++ /dev/null
@@ -1,20 +0,0 @@
-Overall Maintainers:
-Ettore Perazzoli <ettore@ximian.com>
-JP Rosevear <jpr@ximian.com>
-
-Mail:
-Jeff Steadfast <fejj@ximian.com>
-Michael Zucchi <notzed@ximian.com>
-
-Addressbook:
-Chris Toshok <toshok@ximian.com>
-Hans Petter Jansson <hpj@ximian.com>
-
-Calendar
-Rodrigo Moya <rodrigo@ximian.com>
-Hans Petter Jansson <hpj@ximian.com>
-
-Composer:
-Larry Ewing <lewing@ximian.com>
-Radek Doulik <rodo@ximian.com>
-
diff --git a/Makefile.am b/Makefile.am
deleted file mode 100644
index 82425329dd..0000000000
--- a/Makefile.am
+++ /dev/null
@@ -1,73 +0,0 @@
-changelogs = \
- ChangeLog \
- ChangeLog.pre-1-4
-
-%-$(BASE_VERSION).pc: %.pc
- mv $< $@
-
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = \
- camel-$(BASE_VERSION).pc \
- evolution-shell-$(BASE_VERSION).pc
-
-EXTRA_DIST = \
- AUTHORS \
- $(changelogs) \
- COPYING-DOCS \
- README \
- HACKING \
- MAINTAINERS \
- NEWS \
- NEWS-1.0 \
- marshal.mk \
- server.mk \
- intltool-merge.in \
- intltool-update.in \
- intltool-extract.in \
- $(pkgconfig_DATA:-$(BASE_VERSION).pc=.pc.in)
-
-if ENABLE_SMIME
-SMIME_DIR=smime
-endif
-
-SUBDIRS = \
- data \
- e-util \
- a11y \
- widgets \
- shell \
- camel \
- filter \
- $(SMIME_DIR) \
- addressbook \
- calendar \
- art \
- composer \
- mail \
- ui \
- default_user \
- views \
- tools \
- help \
- po
-
-
-# CDE Stuff
-
-if HAVE_DTAPPINTEGRATE
-
-# This installs Evolution into the Application Manager on CDE
-dtappintegrate:
- ( cd data && make dtappintegrate )
-
-# ...And this uninstalls it
-dtappunintegrate:
- ( cd data ; make dtappunintegrate )
-
-# Install/uninstall for CDE
-cde-install: install dtappintegrate
-cde-uninstall: dtappunintegrate uninstall
-
-endif
-
-ACLOCAL_AMFLAGS = -I m4
diff --git a/NEWS b/NEWS
deleted file mode 100644
index 0591b22d48..0000000000
--- a/NEWS
+++ /dev/null
@@ -1,780 +0,0 @@
-Evolution 1.4.1, 2003-06-25
----------------------------
-
-Bugzilla bugs fixed (see http://bugzilla.ximian.com/show_bug.cgi):
-
- * Addressbook
-
- #41826 - Focus the first minicard when focusing the view for the
- first time (gilbert.fang@sun.com)
- #43841 - Contact editor will not save Web Page address (Toshok)
- #44477 - Make sure the master category list is upgraded (Toshok)
-
- * Calendar
-
- #41582 - Display incorrect after switching between week and day
- view (Rodrigo)
- #43585 - Ugly tasks printout (Hans Petter)
- #45273 - Tab through events in day view (Bolian Yin)
- #45275 - Shift+F10 to activate Popup menu in ToDo List (Bolian Yin)
- #45423 - Provide shortcus for "Go to today" and "Go to date" (Bolian Yin)
-
- * Mail
-
- #22542 - Creating a folder in the vFolder store fails with a
- meaningless message (Michael)
- #31745 - Cannot view mails under '#mh' namespace. Temporary
- workaround, strip #'s (Michael)
- #33593 - Message remains displayed after last message removed from
- list (Michael)
- #40788 - Broken POP3 server causing evolution to hang/crash (Jeff)
- #42630 - collapsed thread always shows as unread (Jeff)
- #43917 - ECharsetPicker doesn't save user-specified charset strings
- properly (Jeff)
- #43972 - Invert selection doesn't work (Jeff)
- #43974 - Cannot retrieve "Local Delivery" mail (Michael)
- #44121 - Invalid multipart/signed message showing empty (Michael)
- #44139 - Composer spacing is not HIG compliant (Jeff)
- #44322 - Evolution crash with weird IMAP foldername (Michael)
- #44344 - Dont use quoted-printable encoding on anything but text/*
- parts, interoperation with Lookout and others (Jeff)
- #44457 - Crash viewing video content as inline-text (Jeff)
- #44519 - Popup message view redraws when new mail arrives (Michael)
- #44609 - HIG issue with vFolder properties editor (Michael)
- #44991 - Cannot send mail in GB-2312 (Jeff)
- #45082 - GB18030 BIG5HKSCS and EUC-TW charsets not supported in
- evolution mail (suresh.chandrasekharan@sun.com)
- #45063 - Message display refreshes when new mail arrives,
- introducted by #33593 (Michael)
- #45386 - Warnings when sending mail (Michael)
- #45368 - Crash when closing the folder browser
-
- * Summary
-
- #44111 - Crash on exit (Ettore)
- #44798 - Crash when closing print preview dialog (Ettore)
-
- * All
-
- #42691 - Build, make clean doesn't rebuild bonobo-activation
- .server files (Michael)
- #44717 - Tarball cointains generated files (Frederic Crozat)
-
-Other bugs
-
- * Calendar
-
- - Fix invalid shared use of list of calendar factories (Rodrigo)
- - Make the calendar editor window title reflect the summary contents (Rodrigo)
-
- * Mail
-
- - Fix bug in indexer string normalisation (they weren't) (Larry)
- - Major memory leak in message-threading (Larry)
- - Only try to snoop a content-type if its application/octet-stream
- when displaying mail parts (Jeff)
- - Major memory leak in filter-file based filters (Jeff)
- - Try to make asynchronous dns lookup more asynchronously
- cancellable (Michael)
- - Fix a degenerate algorithm case in vFolder shutdown which could
- cause excessive exit cpu usage (Michael)
-
- * Shell
-
- - Wrong version number used for configuration upgrade (Michael)
-
- * All
-
- - Lots of miscellaneous memory leaks
-
-Updated translations:
-
- - cs (Miloslav Trmac, Stanislav Brabec)
- - el (Kostas Papadimas)
- - es (Francisco Javier F. Serrador)
- - hu (Andras Timar)
- - it (Marco Ciampa)
- - ko (Kan Jeong-Hee)
- - mk (Ivan Stojmirov)
- - nl (Vincent van Adrighem)
- - pt_BR (Gustavo Maciel Dias Vieira)
- - sr, sr@Latn (prevod.org)
- - sv (Christian Rose)
- - tr (Gorkem Cetin)
- - zh_CN (Wang Li, Funda Wang)
-
-
-Evolution 1.4, 2003-06-02
--------------------------
-
-Bugzilla bugs fixed (see http://bugzilla.ximian.com/show_bug.cgi):
-
- * Calendar
-
- #43388 - Problems importing appointments (Rodrigo)
- #43455 - Crash on exit (Rodrigo)
- #43763 - 2 right mouse menus appear in Week & Month views (Rodrigo)
- #43775 - Crash under Chinese locale (JP)
-
- * Mail
-
- #42854 - Copying files from one IMAP folder to another makes
- multiple copies of file (Jeff)
- #43862 - First run imap account won't load folders until account
- is disabled and re-enabled (Jeff, Michael)
- #42691 - Server files not regenerated after distclean (Michael)
- #43805 - Evolution locked while editing reply to an mail (Jeff)
- #43410 - Flag for Followup dialog opens up too small in Evo (Michael)
- #43688 - Can't save signatures (Michael)
-
- * Summary
-
- #43506 - Spontaneous crash (Ettore)
-
- * Misc
-
- #43596 - Symlink icon file so it doesn't break existing panel
- setups (Ettore)
-
-Other bugs fixed:
-
- * Addressbook
-
- - Removed conflicting shortcut for the Print Preview menu item
- (Rodney)
-
- * Misc
-
- - Corrected some problems in the pkgconfig files (Rodney)
- - Fixed an issue with GConf schema file installation (Joe Marcus
- Clarke)
-
-Updated translations:
-
- - nl (Vincent van Adrighem)
- - ru (GNOME Russian Team)
- - be (GNOME Belarusian Team)
- - es (Francisco Javier F. Serrador)
-
-
-Evolution 1.3.92, 2003-05-22
-----------------------------
-
-Bugzilla bugs fixed (see http://bugzilla.ximian.com/show_bug.cgi):
-
- * Addressbook
-
- #38084 - Rename local folder issue in contacts (sean.gao@sun.com)
- #41130 - HIG compliance (Anna)
- #41137 - HIG compliance (Anna)
- #41140 - HIG compliance (Anna)
- #41144 - Use stock buttons in the ldap config page (Toshok)
- #41211 - Add icon to "Add" button in "Add to Contacts" dialog (Toshok)
- #41229 - HIG compliance (Anna)
- #41231 - HIG compliance (Anna)
- #41232 - HIG compliance (Anna)
- #41245 - HIG compliance (Toshok)
- #41248 - HIG compliance (Anna)
- #41249 - HIG compliance (Anna)
- #41250 - HIG compliance (Anna)
- #41251 - HIG compliance (Anna)
- #41254 - HIG compliance (Anna)
- #41255 - Use stock Add/Remove icons in the contact list editor (Toshok)
- #41910 - Crash when deleting addresses from long contact lists (Toshok)
- #42048 - "Print" not hooked up in etable view (Toshok)
- #42177 - Cannot tab out of date edit widgets in contact editor (Toshok)
- #42472 - Selecting a field in a contact highlights entire row (Toshok)
- #42596 - Selecting text in a contact address field selects all
- rows of text (Toshok)
- #42604 - Display not shifted when cursor moved to next address
- line (Toshok)
- #42606 - Not saving information entered in Notes field of Contact
- editor (Toshok)
- #42620 - Crash related to mailing address checkbox (Toshok)
- #42625 - Clicking in white space of contact brings up empty
- contact editor (Toshok)
- #42780 - Crash on solaris due to missing NULL in g_guild_filename.
- (sean.gao@sun.com)
- #42825 - clicking on letters in LDAP address card view does not
- load selected letter (Dan, Toshok)
- #43005 - Crash on reply (Toshok)
- #43016 - Crash when adding duplicate contact (Toshok)
- #43023 - All contacts have disappeared (Toshok)
- #43090 - GalView menu missing from the addressbook (Toshok)
- #43175 - Evolution crashed pasting large amount of text into
- address field (Toshok)
- #43213 - auto-completion folder list wasn't populated correctly on
- fresh install (Toshok)
-
- * Calendar
-
- #40972 - connector crashed while evolution was idle (Rodrigo)
- #41234 - button order of "Enter Delegate" dialog (Rodrigo)
- #41329 - Changing Options in scheduling tab causes display time to shift
- #41579 - Double clicked on meeting in Exchange calendar, Evo
- crashed (Rodrigo)
- #41760 - Alarm dialog does not reappear after snoozing Exchange
- alarm (Rodrigo)
- #41811 - Calendar update failing and crashing (JP)
- #41930 - Warning while running gdb includes: "Some clown returned
- undeclared exception" (JP)
- #41935 - day view ignores scroll wheel (JP)
- #42056 - Accelerators in meeting selector not working/looks bad
- (Hans Petter)
- #42220 - calendar not refreshing correctly after changing meeting
- times (Rodrigo)
- #43029 - When running under valgrind Evolution crashed while
- exiting (JP)
- #43308 - scheduling page alignment (JP)
-
- * Mail
-
- #40074 - Thread expansion state not remembered (Jeff)
- #41748 - Send/Recv not sending mail in connector Outbox (Michael)
- #42000 - Crash selecting a non-selectable folder (Michael)
- #42045 - Another workaround for mailers sending out invalid date
- formats (Jeff)
- #42118 - Edit->Mark as unread doesn't behave the same as right
- click->mark as unread (Jeff)
- #42170 - Thread expansion state lost on deleting messages (Jeff)
- #42212 - Crash entering address in composer (Rodrigo)
- #42294 - Custom fixed font setting not applying to composer
- (Michael)
- #42333 - Crash opening a mail again that was still being opened
- (Jeff)
- #42356 - Adding colour from not working properly (Jeff)
- #42456 - Spelling preferences Enable/Disable button inconsisency
- (Michael)
- #42540 - Crash when pressing send/recv too quickly (Michael)
- #42710 - Invalid 8 bit header data getting to the UI layer
- generating warnings (Michael)
- #42763 - Crash deleting local folder with indexing turned off
- (Jeff)
- #42838 - Crash setting up local mail account (Michael)
- #42854 - Copying many messages between IMAP folders results in
- several duplicates (Jeff)
- #43214 - changing server settings enables the account (Jeff)
- #43234 - crash reading mail (Michael)
- #42748 - Check spelling while I type - broken (Larry)
- #42749 - Composer ignores color for misspelled words (Larry)
- #43392 - Reproducible crash after searching mail w/ attachment and
- closing (Jeff)
- #43406 - Evo crashed during POP download/filtering (Jeff)
-
- * Shell
-
- #36956 - Window title too long (Ettore)
- #40391 - Updated contributor list in the about box (Michael)
- #42038 - Crash hitting escape or closing window on rename box
- (Michael, Ettore)
- #42342 - Send/receive sensitive when startedi in offline mode
- (Ettore)
- #42465 - Unread count problem in the shortcut bar (Ettore)
- #42491 - Compilation problems on Forte (Antonio Xu)
- #42518 - Folder bar selection lost on folder delete (Ettore)
- #43079 - Don't crash when an invalid "default:" URI is given on
- the command-line (Ettore)
- #43119 - Memory corruption problem in settings dialog (Ettore)
- #43216 - Crash on exit (Ettore)
- #43322 - Crash on exit (Ettore)
-
- * Summary
-
- #41131 - HIG compliance (Anna)
- #41133 - HIG compliance (Anna)
- #41849 - Charsets not respected in news feed display (Michael)
- #43101 - Crash on exit (JP)
- #43117 - Crash on exit (Ettore)
-
-Other bugs:
-
- * Addressbook
-
- - 64bit cleanup and warning fixes (Jeremy Katz)
- - Fixed some probable memory corruption (Toshok, Sean Gao)
-
- * Calendar
-
- - Fixed crash in cal_client_discard_alarm (Rodrigo)
- - Fixed Bonobo unrefing problems on components (JP)
- - Fixed multiple initialization in calendar factory (Rodrigo)
-
- * Mail
-
- - Crash on exit if password dialog was open (Ettore)
- - Make Ok the default response on the password dialog (Ettore)
- - Crash in SMTP if unable to resolve the remote host name (Jeff)
- - Fix an automake 1.6 issues with camel-lock-helper (Dan)
- - Reload page if citation color changes (Larry)
- - Made all the composer preferences work (Larry)
- - Made newly created HTML signatures work again (Radek)
-
- * Shell
-
- - HIGified config settings dialog a bit more (Anna)
- - Fixed a bunch of reference count problems (JP)
- - Improved the look of the "open other user's folder" dialog
- (Dan)
-
- * Summary
-
- - Fixed a typo that caused the summary to not see the default
- calendar folder (Ettore)
- - Made the print dialog close properly (Ettore)
- - Reference count fixes (JP)
-
- * All
-
- - Various container referencing issues (JPR)
- - 64 bit and portability fixups (Jeremy Katz)
- - Cleaned up lots of compile time warnings and run-time debugging
- output (everyone)
-
-Updated translations:
-
- - cs (Miloslav Trmac)
- - da (Kenneth Rode Christiansen)
- - de (Christian Neumair)
- - es (Francisco Javier Fernandez)
- - fr (Christophe Fergeau)
- - it (Marco Ciampa)
- - ja (Takuo Kitame)
- - no (Kjartan Maraas)
- - pt (Duarte Loreto)
- - pt_BR (Gustavo Maciel Das Vieira)
- - ru (GNOME Russian Team)
- - sv (Christian Rose, Anders Carlsson)
-
- - Fixed encoding of the ca, en_AU, en_CB, et, eu, ro catalogs (Abel
- Cheung)
-
-
-Evolution 1.3.3, 2003-04-29
----------------------------
-
-Bugzilla bugs fixed (see http://bugzilla.ximian.com/show_bug.cgi):
-
- * Addressbook
-
- #37351 - Contact List drag-n-drop broken from sorted list view (Toshok)
- #40954 - Wombat crashes when opening an appointment (Toshok)
- #41843 - Don't use localized field names in the csv exporter (Gilbert Fang)
- #41779 - Fix crash when adding emails to existing contacts (Toshok)
-
- * Calendar
-
- #21499 - No docs in snaps (Rodney)
- #22444 - Deleting recurring meetings menu option (Rodrigo)
- #34498 - alarm-notify not noticing meetings canceled by organizer (Rodrigo)
- #35814 - same mnemonic for File:New:Mail Message and :Meeting (Rodney)
- #37552 - GUI doesn't notice Connector failed to delete task (JP)
- #39735 - Calendar View settings not persistent between sessions (JP)
- #40257 - selecting day from calendar control causes window resize (JP)
- #41129, #41215, #41221, #41256, #41148, #41216, #41235 - gui spacing (Rodrigo, Anna)
- #41230 - forwarded tasks blank when viewed in a separate window (JP)
- #41458 - Crash sending meeting invite (Dan)
- #41459 - remove "Delegate to..." from right click menu in meeting dialog (JP)
- #41641 - crash opening calendar for the first time (Hans)
- #41661 - Only one popup dialog for repeated message alarm (Rodrigo)
- #41671 - audio alarms pop up message dialog instead of playing tune (Rodrigo)
-
- * Mail
-
- #21499 - No docs in snaps (Rodney)
- #38927 - Signature editor help brings up composer help
- #40694 - Focus not in To field of new message when From field is
- visible. (Toshok)
- #40989 - Deleted sub-folders hang around (Michael)
- #41043 - Send/receive accelerators broken (Michael)
- #41142 - Message search dialog has questionable button order (Jeff)
- #41149 - Spacing/padding of "Filters" dialog (Jeff)
- #41150 - Use stock buttons in "Filters" dialog (Jeff)
- #41151 - Spacing/padding of "Add/Edit Filters" window (Jeff)
- #41152 - Spacing/padding of "Vfolders" dialog (Jeff)
- #41153 - Use stock buttons in "VFolders" window (Jeff)
- #41155 - Spacing/padding in "Add/Edit Vfolders" dialog (Jeff)
- #41156 - Use stock** buttons in "add/edit vfolders" dialog (Jeff)
- #41163 - Forwarding HTML mail with inline images results in
- misformatted mail (Michael)
- #41164 - Can't import mails at all (Michael)
- #41190 - Crash cursor navigating Inbox (Michael)
- #41199 - Subscribe dialog's toolbar -- why? :) (Michael)
- #41205 - Use icons on Add/Edit/Delete buttons in "Search Editor" (Jeff)
- #41208 - Spacing/padding in "advanced search" dialog (Jeff)
- #41209 - Spacing/padding of "Create VFolder from Search" dialog (Jeff)
- #41238 - Crash when opening "attachment properties" (Jeff)
- #41239 - Spacing/padding of "attachment properties" (Jeff)
- #41241 - Title capitalisation of "Attachment Properties" (Jeff)
- #41244 - Spacing/padding of "Reformat Mailbox" dialog (Jeff)
- #41389 - Crash creating new Exchange acct (Jeff)
- #41398 - vFolder Sources IMAP folder names not being unencoded
- correctly (Michael)
- #41419 - Variable font key has trailing slash (katzj@redhat.com)
- #41448 - Crash on startup (Michael)
- #41461 - camel_text_to_html doesn't do as good a job with URLs as
- e_text_to_html (Jeff)
- #41513 - Plain text attachments not showing up in the composer (Jeff)
- #41578 - Up/down buttons broken in vfolder list (Jeff)
- #41648 - 1.2 -> 1.3 vfolder conversion (Michael)
- #41730 - Empty "Organization" headers (Jeff)
- #41789 - Bonobo components can pause/freeze the gui (Jeff)
- #41972 - Searching on labels is broken (Michael)
- #42024 - Improper use of Error dialog (Jeff)
-
- * Shell
-
- #21499 - Documentation not working in the snapshots (Rodney)
- #33919 - Crash when opening other user's folder (Dan)
- #41002 - Default folder bar size too narrow (Ettore)
- #41008 - HIG compliance (Anna)
- #41010 - HIG compliance (Anna)
- #41022 - HIG compliance (Anna)
- #41024 - HIG compliance (Anna)
- #41025 - HIG compliance (Anna)
- #41036 - HIG compliance (Anna)
- #41059 - Crash connecting to other user's folder (Ettore)
- #41013 - Startup wizard display problems (Michael)
- #41128 - HIG compliance (Anna)
- #41145 - HIG compliance (Anna)
- #41146 - HIG compliance (Anna)
- #41147 - HIG compliance (Anna)
- #41225 - HIG compliance (Anna)
- #41227 - HIG compliance (Anna)
- #41242 - HIG compliance (Anna)
- #41304 - Missing dialog title (Michael)
- #41392 - HIG compliance (Anna)
- #41413 - Creating folder needs to make sure parent folder is
- expanded (Dan)
- #41468 - New Exchange public folders do not follow type of parent
- folder (Dan)
- #41469 - Upgrade routine crashing on Solaris (Jeff)
- #41484 - Make proxies work (Sanshao Jiang)
- #41567 - HIG compliance (Anna)
- #41569 - HIG compliance (Anna)
- #41648 - Vfolder upgrade problem (Michael)
- #41916 - Memory corruption in Storage interface (Rodrigo)
-
- * Summary
-
- #39693 - Summary weather settings annoyances (Ettore)
- #40902 - HIG compliance (Ettore)
-
-Other bugs:
-
- * Addressbook
-
- - Mostly, if not completely, fixed 33708 (Dan, Toshok)
- - Fix duplicate entry in exported CSV (Gilbert Fang)
- - Use stock buttons (Rodney)
-
- * Misc
-
- - Made Solaris/CDE integration work again (Rodney)
- - Removed some debugging spewage (everyone)
- - Don't crash on malformed GConf folder settings (Toshok)
- - Don't error out if the directory already exists when creating a
- new folder (Ettore)
- - Fixed various memory leaks all over the place (Hans)
-
-Updated translations:
-
- - cs (Miloslav Trmac)
- - de (Christian Neumair)
- - es (Francisco Javier Fernandez)
- - it (Marco Ciampa)
- - nl (Vincent van Adrighem)
- - no (Kjartan Maraas)
- - pt (Duarte Loreto)
- - sv (Christian Rose)
- - zh_CN (Wang Jian)
-
-
-Evolution 1.3.2, 2003-04-11
----------------------------
-
-Bugzilla bugs fixed (see http://bugzilla.ximian.com/show_bug.cgi):
-
- * Addressbook
-
- #7103 - Addressbook doesn't play nice with dark themes. (Toshok)
- #19178 - importers only target default contact folder. (Toshok)
- #20210 - Cannot save changes when invoked from mailer. (Toshok)
- #23036 - Export Contact Data to CSV, XLS, etc. (for mail merge,
- etc.) (Gilbert Fang)
- #25148 - Selected contacts fields are not scrolling properly.
- (Toshok)
- #31786 - LDAP config dialog not properly internationalized.
- (Toshok)
- #32113 - Problem with UTF8 and contact list. (Toshok)
- #34085 - drag+drop not finalizing. (Toshok)
- #34651 - Searches with 8bit ascii char. not working in Select
- Contacts. (Toshok)
- #37204 - Ximian, Inc. contact info update. (Michael)
- #38202 - Evolution crashed when I clicked the send button. (Michael)
- #39170 - void function should not has a 'return' keyword. (Philip
- Zhao)
- #39256 - "Forward Contact", "Send Message to Contact" don't
- work. (Michael)
- #39381 - crash when adding an address from an email to addressbook.
- (Toshok)
- #39507 - Select-names search broken. (Toshok)
- #39730 - Search Base Callback Not Working. (Toshok).
- #39763 - Pasting text into "To:" field doesn't work. (Toshok)
- #39788 - Can't add email address to contact. (Toshok)
- #40026 - Using pulldown to view multiple emails changes email to
- random characters. (Toshok)
- #40046 - To: and Cc: fields not accepting accented letters.
- (Toshok)
- #40403 - can't edit contact lists. (Toshok)
- #40715 - Merge email address dialog non functional when adding
- contact that already exists. . (Toshok)
- #40727 - email autocompletion not listing all names. (Toshok)
- #40841 - Ctrl-v was being used for both "Save As VCard" and
- "Paste". (Toshok)
- #40901 - HIG-ify the LDAP server editor dialog's button
- layout. (Toshok)
-
- * Calendar
-
- #17231 - Private settings not retained. (JP)
- #31382 - Free/busy retrieval didn't work for http source. (Rodrigo)
- #31660 - Appointments with "for" recurrence synced with no end date.
- (JP)
- #32248 - Todo items imported from pilot have time set to 00:00. (JP)
- #34095 - Memory leaks. (Hans Petter)
- #34505 - Duplicate alarm dialogs for appts in exchange calendar.
- (Rodrigo)
- #35926 - Contacts entry in appointment editor to be removed.
- (Hans Petter, Dan)
- #37935 - Drawing problems in mini-calendar. (Hans Petter)
- #39262 - Crash when importing an ics file to local calendar. (Rodrigo)
- #39356 - New evo users didn't get calendar. (Rodrigo)
- #39692 - File type names should not be OAF component types. (Ettore)
- #39735 - View settings not persistent between sessions. (Jeff)
- #39736 - Times in day view too large. (Hans Petter)
- #39740 - Crash clicking in Attendees field when creating new
- meeting. (Rodrigo)
- #39757 - Couldn't delete reminder for appointment. (Hans Petter)
- #39770 - Not meeting request sent. (Rodrigo)
- #39803 - Bottom part of text cut off in month view. (Hans Petter)
- #39895 - Selection vanishes when day view loses focus. (Michael/Hans)
- #39954 - Crash when setting recurrence rule for an appointment.
- (Hans Petter)
- #39955 - Crash when forwarding an appointment as icalendar. (JP)
- #39961 - Appointment schedule autopick menu displays under File.
- (Rodrigo)
- #40133 - wombat startup error. (Toshok)
- #40195 - Cannot create new calendar folders (JP)
- #40252 - LOG(e...) syntax error (Michael)
- #40258 - Recurring event displayed truncated description. (Hans Petter)
- #40578 - Event summaries cut off in month view. (Hans Petter)
- #40655 - Mini-calendar always showed January 1970. (Hans Petter)
- #40661 - Missing header for Forte compilation. (Rodrigo)
- #40722 - Crash when closing a meeting. (JP)
- #40789 - Didn't remember reminder text. (JP)
- #40790 - Didn't launch programs added as reminders. (JP)
- #40792 - Buttons in Select File dialog for sound reminder didn't
- work. (Ettore)
- #40876 - Cannot create a meeting with a resource in Exchange
- calendar (JP)
- #40894 - calendar switching weeks selected in small right subcalendars
- (JP)
- #41127 - Evolution crashed when sending new meeting invitation (JP)
-
- * Mail
-
- #29564 - Message list loses focus when you expunge. (Michael)
- #33786 - Crash when invalid expression fed to vFolder. (Michael)
- #36245 - Translation string context problem. (Dan)
- #37084 - Mailer forgets message list pane size on startup.
- (Michael)
- #38227 - Button spacing issues. (Ettore)
- #38461 - Mail importers cannot import to non-local folders.
- (Michael)
- #38659 - RFC2047 word encoding errors. (Jeff)
- #38926 - Configuration dialogs overlap each other. (Ettore, Jeff)
- #39165 - Losing all vFolder rules after editing them, until
- restart. (Michael)
- #39168 - compiler compatability, empty structs. (Jeff)
- #39170 - Compiler compatibility, returning a void return value.
- (Jeff)
- #39173 - prototype mismatch. (Jeff)
- #39204 - Charset handling problems with broken mails. (Jeff)
- #39256 - Send message to contact/forward contact doesn't work.
- (Michael)
- #39325 - Allow user to enable/disable account from account list.
- (Jeff)
- #39382 - Signature editor dialog buttons messed up. (Jeff)
- #39464 - Trying to remove a duplicate vfolder crashes. (Michael)
- #39486 - Cancelling send/receive could cause a crash. (Michael)
- #39654 - vFolder source remove button doesn't work. (Jeff)
- #39696 - Default composer window title is meaningless. (Jeff)
- #39741 - Configuration dialogs overlap each other. (Ettore, Jeff)
- #39744 - Sending 8 bit mime to a smtp server which doesn't say it
- supports it. (Jeff)
- #39759 - Crash using search dialog. (Michael)
- #39800 - Make To: have focus on a new message. (Jeff)
- #39809 - Dialog's don't match gnome 2 layout. (Jeff)
- #39813 - Crash/noop adding signature script. (Jeff)
- #39870 - Message browser button sensitivity not correct. (Jeff)
- #39914 - Configuration dialogs overlap each other. (Ettore, Jeff)
- #39924, and many others - Subject entry box didn't work
- properly/support i18n very well. (Jeff)
- #40043 - A warning dialog wont go away. (Jeff)
- #40074 - Threads always open expanded. (Jeff)
- #40083 - Search box doesn't work on subscription dialog - it was
- removed. (Jeff)
- #40103 - Deadlock at startup. (Michael)
- #40124 - Cannot unsubscribe from folders that aren't selectable.
- (Jeff)
- #40188 - Context menu on addresses crashes. (Michael)
- #40300 - Files are only detected for recovery when you start an
- editor. (Michael)
- #40314 - Some folders not expandable in subscriptions dialog.
- (Jeff)
- #40472 - Crash after entering password. (Michael)
- #40522 - Two passphrase dialogues viewing encrypted mail. (Michael)
- #40536 - Send/receive dialogue should transient for parent.
- (Michael)
- #40608 - Crash saving attachment. (Jeff)
- #40679 - Composer crash browsing files to attach. (Jeff)
- #40728 - Crash while scrolling. (Jeff)
- #40764 - Composer backs up drafts too often. (Jeff)
- #40778 - incorrect IMAP BODY parsing/display (Jeff)
- #40900 - vfolder creation dialog has wrong button order. (Michael)
- #40904 - Spontaneous crash. (Jeff)
- #40921 - Cancel subscription dialogue while busy -> crash. (Michael)
- #41004 - HIG compliance. (Jeff)
-
- * Shell
-
- #17034 - Use UTF-8 in about box. (Michael)
- #34371 - Tries to open other user's folder with blank user field.
- (Ettore)
- #38775 - Version number hardcoded in warning dialog text. (Michael)
- #38974 - Xlib dependency causing linking error on Solaris. (Ettore)
- #39096 - Start-up crash on Solaris. (Ettore)
- #39467 - Crash when splash image not found. (Michael)
- #39599 - Crash when folder icons missing. (Ettore)
- #39692 - OAFIIDs being shown in the importer dialog. (Ettore)
- #39706 - Settings window too big. (Michael)
- #40377 - Old stale wombat servers not being killed. (Ettore)
- #40413 - Problem with closing the folder selector dialog. (Ettore)
- #40474 - Summary settings not imported from 1.2. (Michael)
- #40590 - Signature settings upgrade problem. (Michael)
- #40652 - Folder bar not resizing after resizing Evolution window.
- (Michael)
- #40748 - Cannot resize icons in the shortcut bar. (Ettore)
- #40854 - Problem with selecting other user's folder. (Dan)
- #40888 - Crash when selecting other user's folder. (Dan)
-
- * Summary
-
- #5344 - Missing weather locations. (Marten Woxberg)
- #7153 - Stock folder names not translated. (Ettore)
- #12066 - Missing weather locations. (Dan)
- #15740 - Missing weather locations. (Dan)
- #18015 - Missing weather locations. (Dan)
- #19957 - AM/PM setting not being honoured. (Ettore)
- #40358 - Summary page not showing properly in non-C locales.
- (Ettore)
- #40141 - Preferences settings inconsistency when clicking "Close".
- (Michael)
- #32027 - Missing locations. (Dan)
-
-Other bugs:
-
- * Addressbook
-
- - HIG'ify the e-address-popup's buttons layout. (Toshok)
- - Add input method support to the minicard view. (Toshok)
- - Make the minicard view listen for style changes. (Toshok)
- - Fix the select names component to be more friendly to non-shlib
- components. (Dan)
- - Fix various errors in the contact editor caused by parsing
- addresses when we don't need to - especially after the user has
- explicitly entered the elements of the address
- themselves. (Toshok)
- - Replace GtkImage based arrow buttons in the contact editor with
- GtkArrow. (Toshok)
-
- * Calendar
-
- - Replaced all references to GdkFont deprecatedness with Pango.
- (Hans Petter)
- - Alarm notification fixes. (Rodrigo)
- - Timezone dialog fix. (Dan)
- - Use weak refs instead of destroy signal. (Rodrigo, Hans Petter)
- - Use GtkMessageDialogs for meeting-related questions. (Rodrigo)
- - GtkObject -> GObject fixes. (Everyone)
- - Connector-related fixes. (Dan)
- - Made meeting/scheduling work correctly. (JP)
- - Only remove alarms for backends that request it (Rodrigo)
- - HIG'ify dialogs (Ettore)
-
- * Mail
-
- - Clear passwords didn't work. (Michael)
- - Show preview and view threaded were made per-folder, as in
- 1.2.x, 1.3.1 had them global. (Michael)
- - Make the printing dialog, and account editor transient for the
- parent. (Larry, Jeff)
- - Check for unique filter/vFolder names in all cases. (Michael)
- - Most warnings removed. (Jeff, Michael)
- - some text/plain mails detected as text/html, re-do the fix for
- #16817 to make it pickier. (Michael)
- - Imap buffer overflow potential. (Timo Sirainen)
- - GSSAPI SASL support. (Jeff)
- - Handle broken header charset checking similarly to badly
- labelled/broken body content. (Dan)
- - Various glib deprecation issues, and use non-locale specific
- string compares in various places. (Jeff, Michael)
- - Mail piped to the sendmail transport is canoncalised into Un*x
- format, using network format (CRLF) confuses some versions of
- postfix. (Jeff)
- - Some work on fixing cut and paste shortcuts in composer. (Jeff)
- - Made the EvolutionComposer corba interfaces work again/port to
- GNOME 2. (Michael)
-
- * Shell
-
- - Fixed some problems with the folder dialogs. (Dan)
- - Fixed shell .server files. (Dan)
- - Added --force-shutdown to the shell as a killev replacement.
- (Dan)
- - Make Evolution use large WM icons. (Ettore)
- - Made the offline dialog work again. (Ettore)
- - Fixed importer framework to support non-local folders. (Ettore)
-
- * Summary
-
- - Make creation of the summary settings page faster. (Dan)
-
- * All
-
- - A number of compiler portability fixes, varadic macro's,
- __FUNCTION__ -> G_GNUC_FUNCTION, inline usage, void returns, etc
- (Everyone)
- - Fixed druid colors. (Dan)
-
-Updated translations:
-
- - cs (Miloslav Trmac)
- - de (Christian Neumair)
- - es (Francisco Javier Fernandez)
- - fi (Sami Pesonen)
- - hu (Andras Timar)
- - it (Marco Ciampa)
- - no (Kjartan Maraas)
- - pt (Duarte Loreto)
- - pt_BR (Gustavo Maciel Dias Vieira)
- - sk (Stanislav Visnovsky)
- - sv (Christian Rose)
- - uk (Yuriy Syrota)
- - zh_TW (Chao-Hsiung Liao)
-
-
-Evolution 1.3.1, 2003-03-05
----------------------------
-
-First release based on GNOME 2.
diff --git a/NEWS-1.0 b/NEWS-1.0
deleted file mode 100644
index b3e5fc7e57..0000000000
--- a/NEWS-1.0
+++ /dev/null
@@ -1,2939 +0,0 @@
-Evolution 1.0.8, 2002-06-23
----------------------------
-
-Bugzilla Bugs Fixed (see http://bugzilla.ximian.com/show_bug.cgi):
-
- * Addressbook
-
- #17332 -- Addressbook crashes in LDAP address completion code.
- (Toshok)
- #26130 -- Close contact editor before save as crashes. (Toshok)
-
- * Calendar
-
- #25757 -- Fix quoting of icalendar properties (JP)
- #25829, #25830, #26066
- -- Fix a number of meeting usability and interop issues (JP)
- #25697 -- Exchange reminders still not quite working (Rodrigo)
-
-Other fixes:
-
- * Addressbook
-
- - Some memory leak fixes in the addressbook backends and
- libversit. (Toshok)
-
- * Calendar
-
- - Update time zone information (Damon)
-
-Updated translations:
-
- - sk (Stanislav Visnovsky)
- - sv (Christian Rose)
-
-
-Evolution 1.0.7, 2002-06-07
----------------------------
-
-Bugzilla Bugs Fixed (see http://bugzilla.ximian.com/show_bug.cgi):
-
- * Addressbook
-
- #25054 -- "New Contact List" button is no longer active in
- folders that don't support contact lists. (Toshok)
-
- * Calendar
-
- #16962 -- Make the schedule page use the work hours set in the
- preferences. (JP)
- #23350 -- Crash when refreshing meeting or task. (JP)
- #24783 -- Fix crash in wombat. (Rodrigo)
-
- * Mail
-
- #11391 -- Bogus gnome_vfs_file_info_unref() that caused an
- occasional crash. (Frederic Crozat)
- #15185 -- Non-RFC-compliant From/To/Cc being displayed as empty
- in mail display. (Dan)
- #19920 -- Messages hiding in threaded view. (Michael)
- #21604 -- Various crashes. (Michael)
- #23782 -- Stop button causes a hang. (Michael)
- #25056 -- wombat segfaults when scrolling around calendar in month view
- (Rodrigo)
- #25456 -- Crash when deleting an account that has not been added
- to the Evolution storage yet. (Jeff)
- #24615 -- VFolders with the UNMATCHED vfolder as a source hang.
- (Michael)
-
- * Shell
-
- #24284 -- Copyright notice inconsistent in the about box.
- (Ettore)
-
-Other fixes:
-
- * Misc
-
- - Fixed some typos in the names of some French locations.
- (Christophe Merlet)
-
-Updated translations:
-
- - et (GNOME ET Team)
- - eu (Josu Walio)
- - sk (Stanislav Visnovsky)
- - fr (Christophe Merlet)
- - fi (Sami Pesonen)
- - vi (pclouds)
-
-
-Evolution 1.0.5, 2002-05-06
----------------------------
-
-Bugzilla Bugs Fixed (see http://bugzilla.ximian.com/show_bug.cgi):
-
- * Mail
-
- #24140 -- Crash when downloading a message with invalid header.
- (Jeff)
-
- #17174 -- Mail spools appear to be unread forever. (Michael)
-
- * Shell
-
- #23538 -- Intermittent bug when moving folders around. (Michael)
-
-Other fixes:
-
- * Calendar
-
- - Make reminders work with remote backends. (Rodrigo)
-
- * Misc
-
- - Added support for adding an Evolution icon to the CDE
- Application Manager. (Ettore)
-
-Updated translations:
-
- - bg (Borislav Aleksandrov)
- - pl (GNOME PL Team)
-
-
-Evolution 1.0.4, 2002-04-18
----------------------------
-
-Bugzilla Bugs Fixed (see http://bugzilla.ximian.com/show_bug.cgi):
-
- * Addressbook
-
- #22965 -- Comply with RFC 2739 for calCalURI and calFBURL. (Toshok)
-
- * Calendar
-
- #22624 -- Unable to accept meeting request that doesn't list user
- as attendee. (JP)
-
- * Startup Wizard
-
- #22047 -- Crash after closing the start-up wizard. (Ettore)
-
- * Mail
-
- #8214 -- "Error Synchronizing Folder" on incoming mail spool.
- (Michael)
- #18929 -- If we get multiple Content-Type header values, change
- subsequent headers to X-Invalid-Content-Type so it doesn't
- wreck processing. (Michael)
- #22363 -- Problems resyncing IMAP folders when going Online. (Jeff)
- #21716 -- Fixes to decoding illegally rfc2047 encoded words. (Michael)
- #22657 -- Fixes printing for some localizations (Radek)
-
-
-Other fixes:
-
- * Calendar
-
- - Use default tasks folder in calendar view. (Rodrigo)
- - Added getQuery method to CalBackend to allow custom queries for
- each calendar backend. (Rodrigo)
-
- * Mail
-
- - Fixed Daylight-Savings-Time calculations on systems that use
- tm.tm_gmtoff rather than 'timezone' (affects BSD systems). (Jeff)
- - Fixed the annoying EINPROGRESS error dialogs when connecting
- to IMAP/SMTP/POP via SSL. (Jeff)
- - Changed the date format used in From-lines in mbox spools to be
- the same as those used by Pine to fix interoperability issues.
- (Michael)
- - Fixed some filtertypes.xml typos. (Michael)
-
- * Summary
-
- - Change the dot.kde.org url.
-
-Updated translations:
-
- - fi (Sami Pesonen)
- - fr (Christophe Merlet, Frederic Riss)
- - ko (Young-Ho Cha)
- - nl (Tino Meinen)
- - no (Kjartan Maraas)
- - pt_BR (Gustavo Maciel Dias Vieira)
-
-
-Evolution 1.0.3, 2002-03-19
----------------------------
-
-Bugzilla Bugs Fixed (see http://bugzilla.ximian.com/show_bug.cgi):
-
- * Addressbook
-
- #16097 -- Need a way to let the user specify the DN to
- authenticate against. (Toshok)
- #16680 -- LDAP performance problem. (Toshok)
- #16968 -- Changing search type immediately requeries. (Toshok)
- #20089 -- Cannot copy contacts with comma from "Contacts" to LDAP.
- (Toshok)
- #20690 -- LDAP contacts dont show when using letter shortcuts.
- (Toshok)
- #20740 -- LDAP performance problem. (Toshok)
- #20871 -- SelectNames dialog needs search feedback. (Toshok)
-
- * Calendar
-
- #14705 -- iMIP compatibility with versions of Outlook. (Better fix
- for the pseudo-fix in 1.0.1). We now support Outlook in
- both Workgroup and Internet-Only modes. (Dan)
- #19054 -- Minimum number of alarm repetitions should be
- 1. (Federico)
- #19234 -- BYMONTH off-by-one in RRULE:FREQ=YEARLY. (Damon)
- #20510 -- Load free busy info as attendees are added. (JP)
- #20022 -- Itip addresses are case sensitive. (JP)
- #20226 -- Timezone data missing from some itip replies. (JP)
- #20346 -- Calendar should indicate if backend dies. (Rodrigo)
- #20780 -- Better subjects in iMIP messages. (Dan)
- #20787 -- Accepted/declined messages aren't always clear. (JP)
- #20800 -- Sorting of free busy information in schedule page does
- not work. (JP)
- #20783 -- Accepting updated meeting request doesn't work. (Rodrigo)
- #21198 -- Outlook didn't recognize Evolution's acceptance of an
- updated meeting request. (Dan)
- #21240 -- Calendar Reminders don't appear for appointments in remote
- servers. (Rodrigo)
-
- * Mail
-
- #19564 -- Don't crash when changing to disconnected mode. (Michael)
- #20779 -- Set a 'name' parameter in the Content-Type header
- since Outlook doesn't seem to check the filename
- parameter on the Content-Disposition header. (Jeff)
-
- * Shell
-
- #20234 -- Deleting folder gratuitiously causes /local to open.
- (Ettore)
- #20237 -- Shell silently drops xfer errors. (Ettore)
- #20311 -- New window from shortcuts should not show the folder
- bar and the shortcut bar. (Ettore)
-
- * Summary
-
- #18025 -- Summary crash upon switching to offline mode. (Ettore)
-
-Other fixes:
-
- * Calendar
-
- - Show more descriptive messages on opening errors. (Rodrigo)
- - Remove $filename.ics from remote URIs. (Rodrigo)
-
- * Addressbook
-
- - Fix search weirdness in local addressbooks. (Toshok)
- - Let backends return general error status from load_uri instead
- of just TRUE/FALSE. (Toshok)
- - EBook(View) handling fixes in ESelectNames and
- EAddressbookModel. (Clahey)
- - Rethink (and change) some of the default queries to ones that
- are at the same time useful and more easily implemented
- efficiently by the backends, in both the component's view and in
- the select-names dialog. (Toshok)
- - Change the "beginswith" query implementation on the name field
- to search both first and last name, so it's a little more useful
- in the general case. (Toshok)
-
-Updated translations:
-
- - es (Carlos Perell Marn)
- - fr (Christophe Merlet)
- - jp (Akira TAGOH)
- - nl (Vincent van Adrighem)
- - nn (Roy-Magne Mo)
- - no (Kjartan Maraas)
- - pt_BR (Gustavo Maciel Dias Vieira)
-
-
-Evolution 1.0.2, 2002-01-24
----------------------------
-
-Bugzilla Bugs Fixed (see http://bugzilla.ximian.com/show_bug.cgi):
-
- * Addressbook
-
- #17725 -- Non-ASCII letter headings are black when printing
- (Zbigniew Chyla)
-
- * Calendar
-
- #6544 -- Make Timezone names translatable (Damon)
- #18801 -- Alarms with specific trigger times are not shown (Damon)
-
- * Importers
-
- #16864 -- LDIF importer chokes on long description field (Toshok)
- #17441 -- Crash trying to import VCards file into an LDAP folder
- (Ettore)
-
- * Mail
-
- #6896 -- message_list_select() with wraparound won't select very
- first message (Jeff)
- #11499 -- All recovered Composer windows have HTML enabled (Jeff)
- #16947 -- Crash while setting up a new mail account (Jeff)
- #17205 -- Crash of evolution-mail on start-up (Jeff)
- #17634 -- Marking a message as unread should undelete it, as well
- (Jeff)
- #17694 -- Exchange 5.5 reporting 2 messages as having the same UID
- breaks Evolution (Jeff)
- #17759 -- Cancelling Send/Receive can lose mail for local case
- (Jeff)
- #18142 -- Mailer crash when trying to send an email (Jeff)
-
-Other fixes:
-
- * Summary
-
- - Change the list of items in the mail preferences (Iain)
-
- * Calendar
-
- - Make Tasks default to public as in Outlook (Rodrigo)
-
- * Importers
-
- - Make the druid as a transient window for the main shell (Iain)
-
- * Mail
-
- - Follow symlinks for mbox files (Jeff)
- - Fixed copy/paste problems in mail-account-gui.c (Ian Goldberg,
- Jeff)
- - Make Vfolders work with add-on storages (Dan)
-
- * Shell
-
- - Don't crash on missing icon on start-up (Michael Meeks)
- - Change activation/deactivation order for views in order to
- reduce flicker in the toolbars (Michael Meeks)
-
-Updated translations:
-
- - bg (Alexander Shopov)
- - el (Nick Niktaris, Panayotis Pakos, Simos Xenitellis)
- - fr (Christophe Merlet)
- - hu (Andras Timar)
- - it (Clara Tattoni, Ettore)
- - lv (Peteris Krisjanis)
- - nn (Roy-Magne Mo)
- - no (Kjartan Maraas)
- - sk (Stanislav Visnovsky)
- - sv (Christian Rose)
-
-
-Evolution 1.0.1, 2001-12-18
----------------------------
-
-New features:
-
- * csv2vcard script to convert CSV addressbook files from Outlook
- into VCard files that the Evolution importer can understand (by
- Michael MacDonald).
-
- * Alarms are now properly synced in the calendar conduit.
-
-Bugs fixed:
-
- * Addressbook
-
- #10114 -- No icon for Delete in the New Contact List editor
- #10241 -- Occasional address completion flakiness
- #10910 -- "Save" in list editor vs. "Save and Close" in contact editor
- #11776 -- Email addresses are case sensitive
- #13751 -- AddressBook address entry form usability problem
- #14002 -- Select names dialog stays up after composer is closed
- #14074 -- Editing fields under the "Collaboration" LDAP contact
- #14715 -- Wombat gets locked up when LDAP server is down
- #14876 -- Modifying LDAP contacts destroys existing objectclass entries
- #15379 -- Printing from the addressbook totally broken
- #16156 -- "Save As", "Send As", "Send To" not available in list editor
- #16176 -- Tab order starts wrong
- #16510 -- Small contact editor fixes
- #16744 -- Crash
- #16852 -- Crash closing empty mail
- #16910 -- Crashed addressbook when selecting addresses
- #17109 -- Crashed when editing a contact
- #17126 -- Adding some addresses does not work
-
- * Calendar
-
- #7641 -- Crash in EMap widget when used in Evolution
- #8993 -- Attendees not stripped properly from itip replies
- #13843 -- Deleting tasks causes crash
- #13952 -- Notifier repeatedly gives alarm after appointment ended
- #14087 -- Daily repeat event with end-date misses one day
- #14489 -- UI bug in Calendar Settings
- #14699 -- gtk_signal_disconnect_by_data warning
- #14705 -- iMIP compatibility with versions of Outlook. (We now support
- Outlook in an Exchange environment by default, but the old
- behavior can be turned on with the environment variable
- EVOLUTION_SEND_IMIP_AS_ATTACHMENT. This will be fixed better
- later.)
- #15401 -- Use UTF-8-aware gnome-print calls
- #15456 -- Typo in translatable string
- #15774 -- Crashed by selecting "decline" in meeting request
- #15941 -- Location missing for the calendar
- #15749 -- Empty end time in all-day-event crashes calendar.
- #15774 -- Selecting decline in schedule meeting request makes evo crash
- #15798 -- Calendar Date Never Updates
- #16232 -- e-itip-control.c - init() doing odd stuff
- #16359 -- Calendar Crash
- #16460 -- Changing a meeting doesn't always offer to send an update
- #16571 -- Weird URI in meeting request email
- #16910 -- Crashed when entering a completion percentage
- #16224 -- remove unsupported columns from Tasks view
- #16880 -- Cannot import ical (ics) even its own
- #17344 -- iCalendar should not be translated
- #17526 -- Refreshing request does not show relevant information
- #17527 -- Refresh requests have wrong menu
- #17531 -- libical does not build with bison 1.30
- #17606 -- libical does not build with autoconf 2.52
- (none) -- Scheduling page did not accurately display no information range
-
- * Conduits
-
- #1183 -- Handle alarms in conduits
- #14452 -- Converting names wrong from Palm
- #15810 -- Crashed during EAddress sync
- #15922 -- Crash
- #16460 -- Changing a meeting doesn't always offer to send an
- update
- #16997 -- Pilot compilation with libiconv
- #17230 -- Custom data on Pilot being over written
-
- * Importers
-
- #14701 -- Importing locks up Evolution
-
- * Mail
-
- #2233 -- Don't show RTF attachments inline
- #5547 -- Crash: Error closing a HTML-mail
- #12062 -- Can't use 'n' to skip to next unread if multiple messages
- are selected
- #13898 -- Crash: Cannot create emails in evolution
- #14127 -- Wrong error message
- #14348 -- Some things that need open messages...
- #14517 -- "Clear" needed twice for non-body+subject searches
- #14662 -- GPG signature showing as attachment
- #14678 -- Timestamp on outgoing mail incorrect on FreeBSD
- #14734 -- Evolution-mail crashes while accessing imap servers
- #14770 -- Appending messages to other IMAP folder can cause INBOX to
- stop updating
- #14838 -- Saving passwords doesn't work
- #14848 -- Forwarding wrong email due to next/prev
- #14965 -- Message copy fails with space in folder names
- #14976 -- Crash when reading a message from an IMAP server
- #15264 -- Crash: evolution-mail seg fault on exit
- #15374 -- "___" in autogenerated name of vfolder created by sender of
- #15415 -- Virtual Folders Editor: display of non-ascii symbols is broken
- #15449 -- `N' wraps `P' doesn't
- #15451 -- Crash when pressing stop during "going offline"
- #15489 -- Evolution crashed while deleting my IMAP mail account
- #15491 -- Evolution crashes/becomes unusable if ppp connection is lost
- #15498 -- Crash: Faulty vFolder editor
- #15512 -- Hangs while scanning for changed messages on S/IMAP+Exchange
- #15552 -- Crash
- #15608 -- RCPT TO: response error: Success
- #15647 -- Composer "send" button has wrong tooltip when offline
- #15657 -- Empty recipients
- #15693 -- Crash: Loading message contents from IMAP and close application
- #15745 -- Search edit window widgets disabled. / Mail component crash.
- #15813 -- Decrypting cuts off initial text
- #15843 -- Attachments inside attachments
- #15946 -- Opening IMAP mailbox made it crash
- #15952 -- Mailer crashed after hitting page down key
- #16227 -- "Body contains" seems to want a regexp
- #16254 -- Add Sender to Addressbook missing from menus
- #16284 -- Evolution-mail crashed selecting "create vfolder on subject"
- #16371 -- Corrupt Email crashes Mail component
- #16416 -- X-Mailer says "Preview Release"
- #16501 -- Crash while creating new account
- #16520 -- Crash
- #16559 -- Race-condition in the Camel type system
- #16669 -- Camel 64-bit badness
- #16695 -- A few dialogs are missing sensible titles
- #16698 -- Crash: Can't empty trash; segfault when I try to exit
- #16722 -- Attachment properties dialog crash
- #16903 -- Crash: segv retrieving mail
- #16924 -- Crash on a particular spam message
- #16936 -- Crash when opening a specific message
- #16947 -- Crash: Trouble Setting up a new mail account
- #17085 -- Bad encoding for subject
- #17386 -- Crash when reading a specific message
-
- * Shell
-
- #7827 -- Switching desktops leaves the folder bar popped up
- #14518 -- Crashed when starting the program
- #14701 -- Importing locks up Evolution
- #15435 -- "Rename folder" dialog: non-ASCII folder names are displayed
- #16507 -- Right Click -> View does nothing
- #16693 -- Crash when creating a new folder
- #17258 -- Shell displays splash even if Evolution is already running
-
- * Summary
-
- #8029 -- Locations.h file for translators
- #11212 -- Degree symbol in weather
- #14483 -- "Hello"?
- #14996 -- All-day appointments are displayed incorrectly in the
- summary view
- #16417 -- Have a better default than CNN headlines
- #16772 -- Summary crashes on startup
- #17249 -- Crash going offline
-
- * Misc
-
- #16358 -- Evolution doesn't have a man page
- #17377 -- Evolution doesn't work on multi-visual displays
-
-
-Evolution 1.0, 2001-11-14
--------------------------
-
-Misc:
- Removed OpenSSL support.
-
-Mailer:
- #14893 -- Mailer hanging if you specify an invalid password
-
-
-Evolution 0.99.2 (Release Candidate 2), 2001-11-14
---------------------------------------------------
-
-Misc:
- #14783 -- killev does not check for system type properly
- #14630 -- HTML docs refer to missing gifs in stylesheet-images
- #15027 -- Typos in the docs
- #15028 -- Corrections to the user documentation
- #15056 -- Spelling Error
-
-Shell:
-
- #6295 -- Go to folder dialog should have the e-tree focused
- #13872 -- Crash
-
-Summary
-
- #13478 -- Summary hangs at startup
- #14518 -- Crashing while starting the program
-
-Mailer:
-
- #10560 -- Messages in Korean charset displayed as blank
- #10735 -- Extra cruft at bottom of Compose window's View menu
- #11177 -- Closing main window while dialog up, hangs
- #11647 -- "Body contains" and "Body does not contain" searches are
- matching strings in the message header
- #13996 -- Searches not available in IMAP in offline mode
- #14351 -- pgp 5.5.8 not supported, recognized as 2.6.x
- #14361 -- IMAP/SSL APPENDs hang
- #14542 -- Crash pressing ctrl-a ctrl-k
- #14569 -- Crash when moving a folder
- #14620 -- Weird font issue in Mdk 7.2
- #14659 -- GPG messages are truncated
- #14672 -- evolution-mail crashes on startup
- #14794 -- PGP signing problem, complaining about 2.6.x when 6.5.1
- is installed
- #14826 -- Crashed the editor by using Alt-C (capitalize word)
- #14838 -- Saving passwords dosen't work
- #14848 -- Forwarding wrong email in separate window when using prev/next
- buttons
- #14861 -- DnD a message from a folder with a space in the name fails
- #14951 -- Cancelling before IMAP connect causes IMAP to loop forever
- #14965 -- Message copy fails with space in folder names
- #15038 -- Can page up or page down off of table
- #15154 -- Long line rendering bug
- #15267 -- Outgoing filter move/copy to folder crashes Mailer
- #15296 -- Mailer hangs when fetching mail
- #15324 -- Table handling code not rendering centered content when
- it should
- #15374 -- "___" in autogenerated name of vfolder created by sender of message
- #15393 -- Pointer grab when shift-double clicking
-
-Addressbook:
-
- #9501 -- Appointment Editor has "Save changes?" confirmation but
- Contact editor does not
- #14107 -- Crash: Address auto-complete pop-up appears after sending mail
- #14646 -- Doesn't handle failure in default_book case
- #14743 -- Contacts crashes when saving a List
- #14780 -- Pushing categories in Contact editor crashes Contacts
- #17355 -- e-select-names/completion from arbitrary storages
-
-Pilot conduits:
-
- #9465 -- Palm Addressbook sync corrupts character set
- #14562 -- Crash
- #15355 -- Bogus warning in calendar conduit
-
-Calendar:
-
- #10285 -- Problem printing the calendar
- #13631 -- Left-over debug print
- #14021 -- Problems entering a task
- #14335 -- UTF-8 Error in schedule meeting
- #14337 -- Meeting is added to calender even when selecting decline
- #14362 -- Appointments (public or private) don't show in the Day
- view of the calendar
- #14392 -- Event editor removes wrong pages when object updated
- #14524 -- Meeting page dragging broken for all day events
- #14655 -- evolution-alarm-notify crash on start
- #14687 -- load_uri failures are not noticed by the client talking
- to the wombat
- #14704 -- Free/busy info not in UTC
- #14765 -- Schedule page timezone problems
- #14842 -- EWeekView - typing in event & day incorrect
- #14845 -- Crash assigning category to new task
- #14941 -- Crash
- #15137 -- Crash when double clicking on empty appointment
-
-
-Version 0.99.0 (1.0 Release Candidate 1), 2001-11-05
-----------------------------------------------------
-
-Shell:
-
- - Fixed problems with icons not showing up in the druids. (Ettore,
- Anna)
-
- - Fixed some dnd brokenness. (Ettore)
-
- - Fixed some random crashes and made the shell more robust in case
- of activation problems or components crashing. (Ettore)
-
- - Implemented a newer, prettier about box. (Ettore)
-
- - Made sure the quit message always gets displayed. (Ettore)
-
- - Made sure the shell doesn't allow for folder names with slashes.
- (Ettore)
-
- - Made the folder selection and folder creation dialogs play better
- with the WM for out-of-proc components. (Ettore)
-
- - Make sure components don't display dialogs before the shell
- windows are displayed. (Ettore)
-
- - Fixed some problems with copying/transferring/renaming folders.
- (Ettore)
-
- - Made the pop-up folder bar have the expected size when popped up.
- (Ettore)
-
-Mailer:
-
- - Fixed SMTP truncation, IMAP/SSL truncation/hangs when
- sending/appending messages. (Jeff)
-
- - Implemented rename for imap/maildir folders. Rename also tracked
- in vfolder and filter code. Use rename for local folders when we
- can instead of copy/delete. (Michael, Jeff)
-
- - Fixed startup wizard next page race bugs. (Michael)
-
- - Fixed toolbars vanishing, Bonobo Suxors. (Michael)
-
- - Made filter/vfolder on mailing lists honour domains, but also
- backward compatible. (Michael)
-
- - Fixed the password coming up behind the main window. (Michael,
- Ettore)
-
- - Fixed numerous crash on startup/exit/while doing nothing/switching
- folder/components, many races and other architectural errors.
- (Michael, Jeff)
-
- - Bunch of vFolder fixes and feature completion. (Michael)
-
- - Added a 'index body' option to configure folder. (Michael)
-
- - Fixed 'unread' counts, again. (Michael)
-
- - Fixed some problems leaking file descriptors and overusing them
- when not necessary. (Michael)
-
- - Implemented iconv() caching and Solaris friendly iconv name
- converter. Made override display charset work in more cases.
- (Michael, Jeff)
-
- - Various untranslated buttons/menus and other translation issues
- fixed. (Michael, Jeff)
-
- - Offline searching in IMAP. (Michael)
-
- - Don't warn the user if he drags a message and drops it in the same
- place. (Jeff)
-
- - Fixed replying-to and forwarding messages with attachments to
- attach the appropriate attachments in the new message. (Jeff, Larry)
-
- - Don't allow the user to edit the default searches and keep all the
- search menus consistant accross all folders. (Jeff)
-
- - Allow the user to drag&drop and/or move messages to the Trash
- folder. (Jeff)
-
- - Various fixes to the filtering code. (Jeff, Michael)
-
- - Make various dialogs non-modal. (Jeff)
-
- - Fixes to POP3 UID caching so users can "leave mail on server" and
- not get duplicates. (Jeff)
-
- - Fixes to IMAP caching code where servers support the UIDPLUS
- extension. Will also now un-cache a folder when the user deletes
- it from the IMAP server. (Jeff)
-
- - Removed support for PGP 2.6.x due to security issues (pgp would
- always return 0 suggesting that the signature was valid even when
- it wasn't). (Jeff)
-
- - "Whitespace-only" recipients are now ignored, rather than being
- flagged as invalid. (Trow)
-
- - Fixed bugs related to message searching: memory leak, i18n problems,
- etc. (Trow)
-
- - We no longer leave stray windows lying around after doing the
- "Add Sender to Addressbook" operation. (Trow)
-
- - Bcc: headers are now shown when viewing drafts, sent mail. (Trow)
-
- - Lots and lots and lots of other little and not so little things.
- (Michael, Jeff, Dan, Trow)
-
-Addressbook:
-
- - General bug fixes. (Everybody)
-
- - Printing fixes. (Trow)
-
- - Fixed the dreaded "this should never happen" bug. (Trow)
-
- - Plugged memory leaks. (Trow)
-
- - Fixed use-score sort ordering when doing completion. (Trow)
-
- - Fixed EAddressPopup race conditions. (Trow)
-
- - Implemented transfer function for shell, so moving contact
- folders now works. (Trow)
-
- - Fixed occasional completion flakiness. (Trow)
-
- - Fixed contact count on folder bar. (Trow)
-
- - Fixes for LDAP/multibook address completion. (Toshok, Trow)
-
- - Added a "Do you want to save changes?" dialog to the contact
- and contact list editors. (Toshok)
-
- - Fixed date (birthday and anniversary) handling for LDAP. (Toshok)
-
- - Fixed nasty LDAP modification bug. (Toshok)
-
- - Add a config setting (/Addressbook/default_book_uri) to specify where
- vcards and email addresses from mail messages are stored as contacts.
- (Toshok)
-
- - Fixed problem that arose in an earlier beta where some contacts
- couldn't be modified or deleted from local addressbook.
- (Chris Toshok)
-
- - LDIF Importer. (Chris Toshok, Michael M. Morrison)
-
- - Fixed Memory Leaks. (Trow)
-
- - Always show the correct message about the number of contacts on the
- message bar. (Trow)
-
- - Fixed printing of contacts. (Trow)
-
- - Fixed the incredibly annoying bug which caused completed
- (underlined) contacts to spontaneously revert when edited.
- (Trow)
-
- - Better event handling in minicard view. (Chris Lahey)
-
- - Fixed Bold font in select names dialog. (Chris Lahey)
-
- - Show error dialog if saving a contact to a file fails. (Chris Lahey)
-
- - Handle carriage returns in any contact field properly. (Chris Lahey)
-
-Summary:
-
- - Worked around gnome-vfs problems that were causing crashes. (Trow)
-
- - Set the defaults to be CNN and Boston (Ettore)
-
- - Move the location of the RDF file to be in a place that will always exist.
-
- - Fixed numerous bugs (Trow, iain)
-
- - Made the offline stuff work correctly (iain)
-
- - Fixed a bug were the summary wouldn't retain settings if all folders,
- or RDFs, or weather stations were removed. (iain)
-
-Importers:
-
- - Made the pine importer work for multidepth mail folders. (iain)
-
-Calendar:
-
- - Underlined accelerators now work in the editor dialogs. (Damon)
-
- - Many fixes for scheduling meetings. (JP)
-
- - Status bar messages for long queries. (Rodrigo)
-
- - Appointments with empty summaries are now deleted from the views.
- Also, you can press Escape to cancel editing [#780]. (Federico)
-
- - The alarm daemon no longer displays "old" alarms twice. (Federico)
-
- - Alarms now handle timezones correctly [#5852]. (Federico)
-
- - Repeating alarms are now handled [#12163]. (Federico)
-
- - The alarm daemon is launched as soon as the calendar starts, not
- when you actually open a folder [#13867]. (Federico)
-
- - You can now set a default reminder to be added to new appointments
- [#13649]. (Federico)
-
- - Fixes for printing week views [#13687, #13688]. (Damon)
-
- - Tasks printout now matches the task list better [#10280]. (Damon)
-
- - Better handling of DATE values, as opposed to DATE-TIME ones. (Damon)
-
- - Many changes to handle the default timezone better. (Damon)
-
- - Recurrence generation fixes [#11525]. (Damon)
-
- - Fixed merging of complete VCALENDAR components. (Damon)
-
- - Fixes to the folder transfer functions. (Ettore, Federico)
-
- - Tasks activation fixes. (Damon)
-
- - Outlook interoperability fixes. (Damon, JP)
-
- - Miscellaneous fixes to the event/task editors. (Damon, JP, Federico)
-
- - New iCalendar importer. (Rodrigo)
-
- - Fixed problems introduced in Beta 6 due to the changes in the URI
- management functions. (Rodrigo)
-
- - Prettier alarm notification dialog. (Larry)
-
- - Session management for the alarm daemon. (Federico)
-
- - Added activity bars for long calendar operations. (Rodrigo)
-
- - Added iCal file importer. (Rodrigo)
-
- - Show error dialogs on calendar failures. (Rodrigo)
-
-Conduits:
-
- - Addressbook phone numbers now preserved if they can't all be
- synced to desktop (JP)
-
- - Sync addressbook phone numbers from non-english pilots (JP)
-
- - Various memory leak fixes (JP)
-
- - Handle multi-day calendar events (without recurrences) (JP)
-
- - Make sure task records are marked complete in every relevant field
- (JP)
-
- - Use new timezone stuff everywhere (JP, Damon)
-
- - Translate task priorities better (JP)
-
-
-Version 0.16 (Beta 6), 2001-10-10
----------------------------------
-
-Shell:
-
- - Now the shell restarts stale components from previous sessions
- properly. This should reduce the need for oaf-slay to only the
- cases in which a specific component is completely stuck (which
- hopefully should never happen). (Ettore)
-
- - Fixed the saving of the size of the shortcut bar and the folder
- bar. (Ettore)
-
- - Always display a new default view for the shell, unless the user
- specified an `evolution:' URI on the command-line. (Ettore)
-
- - Fix the weird behavior for right click -> open in new window in a
- pop-up folder bar. (Ettore)
-
- - Make the copy/move and dnd code to detect copying of folders onto
- themselves correctly. (Ettore)
-
-Mailer:
-
- - Bcc: addresses are now visible when browsing messages in
- the "Sent" folder. (Trow)
-
- - Various backend fixes like thread safeness of concurrent
- triggered events, more forgiving address header decoding,
- fixes for recent breakage to progress reports, adding a deleted
- event/state for folders, various deadlocks. (Michael, Jeff)
-
- - Fixed quick-searching by receipients to work. (Michael)
-
- - Caching of iconv handles to improve performance of many internal
- mail reading/indexing operations. (Michael)
-
- - Major oops in mbox code that caused significant performance
- problems getting/filtering mail fixed. (Michael)
-
- - Message charsets can now be overridden by a user-chosen charset
- encoding in the mail display. (Jeff)
-
- - Report errors when file cannot be attached in the composer. (Jeff)
-
- - File->Folder->Properties and Delete Folder now work for VFolders.
- (Michael)
-
- - VFolders, Filters and Searches are saved in a safe manner so that
- they should not be lost with quota/filled disk problems. (Michael)
-
- - VFolders now update with new mail on their sources. (Michael)
-
- - Fixed the "Load HTML Images" radio button options in the mail
- config dialog to work properly. (Jeff)
-
- - When an IMAP folder is deleted, removed any cached messages that
- had been in that folder when it was "alive". (Jeff)
-
- - New icons for PGP signature authenticity. (Jeff, Jimmac)
-
-Addressbook:
-
- - General fixes. (Chris Toshok, Trow, Iain, Chris Lahey, JP)
-
- - LDAP configuration dialog fixes. (Chris Toshok)
-
- - New authentication work. (Chris Toshok)
-
- - Fixed crashes related to editing the Master Category List. (Trow)
-
- - Address completion is no longer confused by whitespace. (Trow)
-
- - More work on having multiple wombats. (Chris Toshok)
-
- - Contact names no longer mysteriously disappear when using the
- SelectNames dialog. (Trow)
-
-Calendar:
-
- - Backend improvements (Rodrigo)
-
- - Compilation fixes for latest Bonobo (Rodrigo)
-
- - Fixed problem with exceptions to recurring events. (Damon)
-
- - Fixed handling of UNTIL property in recurring events. (Damon)
-
- - The alarm daemon will now notify you of alarms that should have
- occurred while it was not running. (Federico)
-
- - Handle monthly-by-day and "last day" recurrences in the conduits. (JP)
-
- - Added priorities to the fields in the attendee list. (Chris)
-
- - Enhancements to the event editor for meetings. (JP)
-
-Summary:
-
- - Bugfixes. (Iain)
-
- - Recurring events have the correct time and date. (Iain)
-
-
-Version 0.15 (Beta 5), 2001-10-02
----------------------------------
-
-Shell:
-
- - Fixed a problem with shortcuts not appearing when created by the
- mailer. (Ettore)
-
- - Fixed right-click menu behavior for folders in the folder bar.
- (Ettore)
-
- - Got Rename to work again. (Ettore)
-
- - Fixed some folder copy/move/dnd bugs. (Ettore)
-
- - Added a menu item to configure the Pilot settings. (Ettore)
-
- - Fixed some other miscellaneous bugs/crashes. (Ettore)
-
- - Added ability to run the intelligent importers from the File->Import
- menu item. (iain)
-
-Mailer:
-
- - Fixed the multiple error-dialog thing. (Michael)
-
- - Fixes to PGP decrypting and verification code. (Jeff)
-
- - Made vFolders work a lot better. (Michael)
-
- - Added a confirm expunge option to the mail settings dialog.
- (Jeff)
-
- - Fixed the update-IMAP-unread-counts bug. (Jeff)
-
- - Show messages in the user's preferred charset if the message
- itself doesn't contain charset information or if the message
- charset is wrong (ie the system can't convert the text to utf-8).
- (Jeff)
-
- - Many backend fixes that users won't notice. (Michael, Jeff, Dan)
-
- - Fixed the crash that accompanied the invalid address warning. (Trow)
-
- - Properly encode the mailto: links we generate inside of displayed
- messages. (Trow)
-
- - Improve the signature editor. (iain)
-
-Calendar:
-
- - Backend improvements (JP, Rodrigo).
-
- - The alarm daemon can now re-enter properly [#10840]. (Federico)
-
- - Alarms can now have zero-time offsets [#7892]. (Federico)
-
- - Warning fixes. (Chris)
-
- - Fixed custom Glade widgets on non-Linux systems. (Dan)
-
- - Fixed crashing problems in the event/task editor. (Damon)
-
-Addressbook:
-
- - Miscellaneous bug fixes. (Trow, Chris Toshok, Chris Lahey, JP,
- Peter Williams)
-
- - Better handling of addresses containing commas or other special
- characters. (Trow)
-
- - Fixed bugs related to sending mail by left-clicking on an address
- inside a message. (Trow)
-
- - Auto-completion now matches against contact nicknames. (Trow)
-
- - Added help text and generally cleaned up the contact editor.
- (Anna)
-
- - Handle multiple wombats properly. (Chris Toshok)
-
- - Made which book to use for address completion configurable (no gui
- for this yet.) (Chris Toshok)
-
- - Made Print Preview work in addressbook. (Chris Lahey)
-
-Pilot:
-
- - Now syncs exception dates in calendar and addressbook notes. (JP)
-
- - Does not overwrite custom data on pilot. (JP)
-
- - Address completion no longer marks records as changed. (JP)
-
- - Miscellaneous other bug fixes. (JP)
-
-Summary:
-
- - Cache images instead of repeatedly reloading them (iain)
-
- - Only redraw when the summary is visible (iain)
-
- - Use the encoding specified in the RDF file (Takuo Kitame)
-
- - Leak fixes (Larry)
-
- - Show todays tasks works (iain)
-
- - Make the preferences dialog nicer. (iain)
-
-Importers:
-
- - Handle cases where the Netscape transport is nothing. (iain)
-
-Version 0.14 (Beta 4), 2001-09-21
----------------------------------
-
-General:
-
- - Lots of i18n fixes. (Zbigniew Chyla and others)
-
- - Made the splash screen use BackingStore. (Ettore)
-
- - Added a quit dialog box. (Ettore)
-
- - Fixed a shell crash that could happen when launching Evolution
- before a previously launched instance was done initializing itself.
- (Ettore)
-
- - Fixed other random shell crashes. (Ettore)
-
- - Got the shell to remember window geometries on exit. (Ettore)
-
- - Fixed some things for Automake 1.5 (unfinished). (Richard
- Boulton)
-
- - Add nice highlighting to DnD operations in the folder tree.
- (Ettore, Clahey)
-
- - Fixed several leaks. (Dan)
-
- - Fixed some problems with folder creation and deletion. (Toshok)
-
- - Made the Summary the default folder. (Ettore)
-
- - Made the title bar display the unread message count again.
- (Ettore)
-
-Mail:
-
- - Had a few beers while sitting back and relaxin'. (Jeff, Michael)
-
- - Check for valid addresses before sending. (Trow)
-
- - Use contact preferences when deciding whether or not to put the
- composer into HTML mode by default. (Trow)
-
- - Properly address mail from "hidden" contact lists. (Trow)
-
- - Redid folder unread counts/folder tree backend code
- completely. (Michael)
-
- - Implemented/fixed getfolderinfo in maildir/spool/local
- folder/vfolder, required to make unread counts work. (Michael)
-
- - Redid 'local folder' handling code completely. (Michael, Peter)
- Also fixed the properties dialogue to get the list of supported
- types dynamically, and set the right one at startup. (Michael)
-
- - Redid vfolder code in evolution-mail completely. Main visible
- change is they open at startup, and the vfolder editor works
- much better. (Michael)
-
- - Made it so fcntl(2) locking failures on filesystems (e.g. NFS)
- that dont support locking are treated as success. (Michael)
-
- - Fix imap inbox filtering, then moved it to CamelFolder, and
- partly implemented it for spool and maildir mailboxes. (Michael)
-
- - Made the vfolder UNMATCHED folder's name translatable. (Michael)
-
- - Change the way the 'not body contains' filter rule works, so that
- it runs much more efficiently, particularly on IMAP. (Michael)
-
- - Camel will not try and convert charsets of data that contain
- invalid charset data, thus data will not be tainted by
- a failed conversion process. (Michael)
-
- - A few threading scheduling changes to try to optimise the user
- experience. Also changed the way threads are terminated,
- avoiding some possible libpthread bugs. (Michael)
-
- - Changed vfolder uri's to not include the query, set it separately.
-
- - Removed a lot of special case code for vfolder/file uri's, other
- dead or newly redundant code, cleanups, etc. (Michael)
-
- - Fixed a bug in libibex that would overallocate block data and
- corrupt it and crash, also fail-back and reset the index in
- more cases. (Michael)
-
- - Fix filtering on score so the expression compiles. (Michael)
-
- - Came to visit USA at a very wrong time. (Michael)
-
- - Removed X-Evolution headers before sending messages. (Jeff)
-
- - When configuring a new default account, make sure to set it as the
- default. (Jeff)
-
- - Convert all textual parts to 8bit before saving them, this makes
- saved messages more human readable. (Jeff)
-
- - Don't cache PGP passphrases unless the user requests to do so.
- (Jeff)
-
- - Unsubscribe from folders before deleting them. (Jeff)
-
- - Fixed a number of race conditions in the subscribe dialog. (Jeff)
-
- - Save transport (SMTP) passwords if the user has asked us to. (Jeff)
-
- - Hide the S/MIME frame in the account editor, we won't be
- supporting it for 1.0. (Jeff)
-
- - Fixed it so that icons are displayed for PGP messages. (Jeff)
-
- - Give a description for each of the Source and Transport types when
- configuring an account. This makes a few things less confusing.
- (Jeff)
-
- - When performing a Send & Receive on a disconnected IMAP server, if
- the user provides a password, connect tot he IMAP server and display
- it's folders too. (Jeff)
-
- - Return a folder info for each IMAP folder created when the user
- creates a recursive directory structure. (Jeff)
-
- - Added support for more charset conversions (including all
- Windows-cp125x charsets). (Jeff)
-
- - When the disk is full, warn the user and don't crash. (Jeff)
-
- - Handle POP servers that don't support the UIDL extension. (Jeff)
-
- - Several PGP fixes. (Jeff)
-
-Addressbook:
-
- - Miscellaneous bug fixes. (Jon Trowbridge, Chris Toshok, Chris Lahey,
- Ettore Perazzoli, Iain Holmes, Zbigniew Chyla, Jacob Berkman)
-
- - Fixed race conditions associated with adding/removing contacts.
- The addressbook should be much more stable now. (Trow)
-
- - Fixed reference counting bugs in addressbook & wombat. (Trow)
-
- - Made address lookup smarter; cut & paste of address now mostly works.
- (Trow)
-
- - Plugged Trow's memory leaks. (Larry)
-
- - Name completion now works with one-word names, so it is now much
- easier to send mail to Cher. (Trow)
-
- - Better handling of contact lists in the composer entries. (Trow,
- Toshok)
-
- - SelectNames dialog fixes. (Trow)
-
- - Better handling of contact lists in the pilot conduits. (JP)
-
- - Added Free busy URL and Calendar URI info to contact editor and
- ECard. (JP)
-
- - Made it so you can select uneditable text in Contact Editor.
- (Chris Toshok)
-
- - Worked on LDAP dialog. (Chris Toshok)
-
- - General LDAP work. (Chris Toshok)
-
- - Fixed charset handling within VCard handling. (Chris Lahey)
-
- - Reworked Drag & Drop for card view.
-
-Calendar & Tasks:
-
- - Free/Busy changes. (JP, Rodrigo)
-
- - iTIP fixes (JP)
-
- - i18n fixes, particularly for printing (Zbigniew Chyla)
-
- - Added option to confirm deletions (Federico)
-
- - Improved alarm system (Federico)
-
- - Fixed crashing bug when deleting a folder (Federico)
-
- - Added option to hide completed tasks (Damon)
-
- - Timezone changes for interoperability with Outlook (Damon)
-
- - Fixed problems displaying/parsing times in locales which don't specify
- 'am' and 'pm' strings (Damon)
-
- - Added toolbar button to delete the selected calendar event (Damon)
-
- - Meeting selector integrated (JP)
-
-Summary:
-
- - Fixed bugs and leaks. (Iain)
-
- - Fixed bug with handling of the Slashot RDF files. (Iain)
-
- - Made the Addressbook and Tasks links open the editor for
- them. (Iain)
-
- - Mail summary doesn't force all folders to be opened. (Iain)
-
- - Calendar summary shows if an alarm is set for an appointment. (Iain)
-
- - Timezone fixes. (Iain, Damon)
-
-Importers:
-
- - Fixed more bugs. (Iain)
-
- - Netscape importer shouldn't crash on Movemail users anymore.
- (Iain)
-
- - Pine importer should import addressbooks better. (Iain)
-
- - VCard importer will actually import things now. (Iain)
-
-
-Version 0.13 (Beta 3), 2001-08-21
----------------------------------
-
-Global:
-
- - New startup assistant to create mail accounts, import mail and set
- your timezone. (Iain, Taylor)
-
- - Improved the appearance and behavior of the clickable title bar and
- the folder tree. (Ettore)
-
- - "Stock" folders such as Inbox have their names translated now and
- cannot be removed. (Ettore)
-
- - Moved the Summary (formerly known as "My Evolution") to be a
- normal node instead of being the toplevel node. (Ettore)
-
- - Fixed some problems with copying, moving and removing folderes.
- (Jason)
-
- - Fixed the handling of documentation files in the Help menu. It
- now integrates nicely with Nautilus and Scrollkeeper. (Aaron,
- Kjartan)
-
- - Implemented the `File -> New' menu. (Ettore)
-
- - Improved error messages on start-up. (Ettore)
-
- - Fixed various crashes and minor bugs. (Ettore, Jason)
-
- - Various UI tweaks and improvements. (Anna, Tuomas, Jakub)
-
-Mail:
-
- - Fixed creating IMAP folders. (Jeff)
-
- - Add a shortcut to the INBOX of IMAP or spool stores when
- their accounts are first created. (Peter)
-
- - Fixed Crash on Exit bugs. (Jeff)
-
- - Many more i18n fixes. (Zbigniew Chyla, Jeff and others)
-
- - Subscribe dialog UI tweaks. (Peter, Anna)
-
- - Displaying PGP signed messages now shows icons. (Jeff)
-
- - Sensitize menu items based on number of selected messages. (Peter)
-
- - Always-sign options for PGP. (Jeff)
-
- - Fixed keep-on-server for POP servers that don't support UIDL.
- (Jeff)
-
- - Several IMAP fixes. (Peter, Jeff, Danw)
-
- - Fix crash after conversion of an empty folder to another
- format. (Peter)
-
- - Ibex now limits its file descriptor usage. (Michael)
-
- - When deleting an account, remove the shortcuts that point to it. (Peter)
-
- - Several IMAP fixes. (Peter, Jeff, Danw)
-
- - Miscellaneous bugfixes all around. (Peter, Jeff, Danw, Michael, others)
-
-Calendar & Tasks:
-
- - Calendar no longer crashes when you scroll a busy month view
- (Federico).
-
- - Performance improvements throughout (Damon).
-
- - Improved search bar; now handles categories. (Jon, Federico)
-
- - The date navigator now reflects the results of the search bar.
- (Federico)
-
- - An empty task is no longer added when you have selected a
- category. (Federico)
-
- - Internationalization fixes (Zbigniew).
-
- - Timezone fixes (Damon).
-
- - Time transparency and component classification support (Damon).
-
- - Folder bar now displays the selected time range (Damon).
-
- - Improved settings dialog (Anna, Damon, Federico).
-
- - iTIP/iMIP fixes for attendees, cancellation. (JP).
-
- - Category icon drawing fixes. (Rodrigo)
-
- - Alarm fixes. (Federico)
-
- - Calendar components can be saved independently. (JP)
-
- - New icons. (Tuomas)
-
- - Contacts support. (Damon)
-
- - You can double-click on appointments to edit them. (Damon)
-
- - Share more code between the backends. (Rodrigo)
-
- - Miscellaneous fixes all over the place. (Damon, JP, Rodrigo, Federico)
-
-Addressbook:
-
- - Various fixes. (Anna Dirks, Dan Winship, Jason Leach, Jos Dehaes,
- Kjartan Maraas, Lahey, Nat Friedman, Radek Doulik, Toshok, Trow)
-
- - Made addressbook menus match the right click menus. (Lahey)
-
- - Made addressbook use camel for building email addresses. (Trow)
-
- - Fixed up phone number matching to not cause errors. (Lahey)
-
- - Made the alphabet bar change the current search. (Lahey)
-
- - Made duplicate contact matching less sensitive. (Lahey)
-
- - Changed advanced search to match behavior in mailer. (Toshok)
-
- - Redesigned LDAP server dialog. (Anna Dirks)
-
- - Work on addressbook authentication. (Toshok)
-
- - Changes to EDestination. (Trow)
-
- - Magic comma work. (Trow)
-
- - Redesigned ESelectNames dialog. (Anna Dirks)
-
- - Made LDAP changes appear in gui immediately if they're made by the
- local client. (Toshok)
-
- - Made ECard hold a link to its original EBook. (Lahey, Trow)
-
- - Adapted for new ESearchBar. (Federico, Trow)
-
- - Added the ability to create cards from anywhere in evolution.
- (Lahey)
-
- - Made searches for completion not use invalid cached data. (Trow)
-
- - Encode strings typed in by the user for use in sexps. (Toshok)
-
- - Made EContactEditor make the save button active more often.
- (Toshok)
-
- - Made ESelectNames handle LDAP storages. (Toshok)
-
- - Added full country list to addressbook full address editor.
- (Lahey)
-
- - Added the contact count to the folder bar. (Lahey)
-
- - Updated icons. (Damon, Ettore)
-
- - Worked on addressbook conduit. (JP)
-
- - Made ESelectNames only show names on the left that aren't on the
- right. (Trow)
-
- - Fixed up minicard dragging. (Toshok)
-
-My Evolution:
-
- - Miscellaneous fixes all over the place. (iain)
-
- - New icons. (Tuomas and Jakub)
-
- - Works for people whos text colour was a light colour. (iain)
-
-
-Version 0.12 (Beta 2), 2001-07-31
----------------------------------
-
-Shell:
-
- - Change the name of the local storage node from "local" to "Local
- Folders". (Jason)
-
- - Fixed a problem with invalid URIs crashing the shell. (Jason)
-
- - Hide internal folder types (like "vtrash") from user. (Ettore)
-
- - Fixed some crashes that could happen when creating folders.
- (Ettore)
-
- - Fixed the URIs for the installed manuals in the help menu.
- (Ettore)
-
- - Added a status bar to show components' tasks instead of using
- pop-up progress dialogs. (Ettore)
-
- - Other miscellaneous bug and leak fixes. (Jason, Ettore)
-
- - Initialize GConf properly when GtkHTML is built with GConf
- support. (Frederic Crozat)
-
- - Make the shortcut bar not change the current group when renaming
- it. (Jason)
-
-Mail:
-
- - Use new shell ActivityClient interface for progress reporting so
- the ongoing activities appear at the bottom of the window instead of
- using a pop-up. (Michael)
-
- - "Remember this password" check box added. (Peter, Jeff)
-
- - UI for timespan editor cleaned up. (Peter)
-
- - UTF8 issues with PGP and mail display addressed. (Jeff)
-
- - Translate some more strings. (Jeff, Zbigniew Chyla)
-
- - Fix camel_session_*_timeout functions. (Michael)
-
- - Fix application/pgp handling. (Jeff)
-
- - Fix DnD with no messages selected. (Jeff)
-
- - Respect the GTK+ theme when generating the header in the mail
- display. (Jeff)
-
- - Make the default date column smaller. (Peter)
-
- - Don't display "0 hidden" messages. (Peter)
-
- - 'q' now toggles the message (pre)view. (Peter)
-
- - Rename the "Date" column to "Sent". (Peter)
-
- - Fix saving of passwords (some passwords were being saved and
- loaded under different URI's). (Jeff)
-
- - Enter now always open the message in a new window. (Peter)
-
- - Gray out unsupported authentication mechanisms. (Jeff)
-
- - Fix saving/loading of several preferences. (Peter, Jason)
-
- - Overwrite attachment files correctly. (Jeff)
-
- - Don't lose the selection when deleting the last message. (Jason)
-
- - Improve guessing of which address to use when replying. (Jeff, Jason)
-
- - If SSL isn't supported, indicate so. (Peter)
-
- - Improve handling of NoSelect IMAP folders. (Peter)
-
- - Add a browse button for local mailboxes. (Jason)
-
- - VTrash handling improvements. (Jeff, Peter)
-
- - Display "unsent" in outbox summary. (Peter)
-
- - Only have main view folder browsers save view settings. (Peter)
-
- - Fixes to POP3 cache. (Jeff)
-
- - Handle variants of charset names. (Jeff)
-
- - Progress reporting and optimizations for IMAP. (Dan)
-
- - Progress reporting for SMTP. (Michel)
-
- - Handle unencoded eight-bit headers. (Jeff)
-
- - Miscellaneous improvements to Camel backend. (Michael, Jeff)
-
- - Several crashes fixed. (everyone)
-
-Addressbook:
-
- - Fixed some warnings. (Chris T.)
-
- - I18n fixes. (Zbigniew Chyla)
-
- - Address quoting in composer bug fixed. (Jon)
-
- - Made it so that Other Contacts doesn't show up if you don't have
- LDAP compiled in. (Jason)
-
- - Made it so that Other Contacts doesn't show up if you don't have
- any LDAP servers configured. (Jos Dehaes)
-
- - General bug fixes. (Chris T., Jon, Frederic Crozat, Jason,
- JP, Ettore, Chris L.)
-
- - Some LDAP cleanup. (Chris T.)
-
- - Crash fixes. (Jon, Dan)
-
- - Work on contact lists. (Chris T., Jon)
-
- - Made Contact Editor Save & Close button not active if nothing is
- changed. (Chris T.)
-
- - Added accelerators to a few dialogs. (Taylor Hayward)
-
- - Made evolution-vcard-importer.c load the file into the correct directory.
- (Iain)
-
-Calendar & Tasks:
-
- - Show icons for categories. (Rodrigo)
-
- - Multiple selections for cut/copy/paste in task list. (Rodrigo)
-
- - Added missing underlined shortcuts for dialogs. (Taylor)
-
- - Many timezone-related fixes. (Damon, Federico)
-
- - Alarm notification dialogs. (Federico)
-
- - iTIP and iMIP ongoing work. (JP)
-
- - Consistency & cosmetic fixes for dialogs and menus. (Damon,
- Federico)
-
- - You can now create new calendar/tasks folders in the shell.
- (Ettore)
-
- - Printing fixes. (Damon)
-
- - Added a search bar for tasks folders. (Federico)
-
- - The task pad in the day view is now filtered as well. (Federico)
-
- - Timezone support for conduits. (JP)
-
- - General bug fixes. (Federico, JP, Damon, Rodrigo)
-
-My Evolution:
-
- - Removed the wipe trackers option. (Iain)
-
- - Fix broken links in the Calendar. (Iain)
-
- - Added some more German cities. (Iain)
-
- - Fixed the New Feed button. (Iain)
-
- - Fixed the KDE and Newsforge urls. (Iain and Jason)
-
-
-Version 0.11 (Beta 1), 2001-07-12
----------------------------------
-
-Shell:
-
- - Drag and drop handling (Chris T.)
-
- - Online/Offline operation (Ettore)
-
- - Numerous code cleanups and bug fixes (Ettore & Jason)
-
-Mail:
-
- - Added ability to specify a charset in the composer and for the
- Preview Pane. (Jeff, Danw)
-
- - Auto-save messages during composition and composer
- crash-recovery. (Larry)
-
- - Better signature file handling. (Radek)
-
- - File->Insert menu. (Larry)
-
- - Address-completion in the composer. (Trow)
-
- - Much improved PGP/GPG. (Jeff)
-
- - Cut/Copy/Paste and Drag & Drop. (Jeff)
-
- - Disconnected IMAP, IMAP filtering, and other IMAP improvements. (Danw)
-
- - Empty Trash On Exit. (Jeff)
-
- - More informative Folder message counts (new/hidden/total). (Peter)
-
- - Implemented "Select Thread". (Peter)
-
- - Movemail fixes and improvements. (Michael)
-
- - Improved/Configurable Forward/Reply functionality. (Jeff, Trow, Danw)
-
- - Improved Message browser window. (Jeff, Peter)
-
- - Load HTML images Sometimes/Always/Never. (Danw)
-
- - rfc2184 conformance. (Jeff)
-
- - Online/Offline modes. (Ettore, Danw, Jeff)
-
- - HTML indexing. (Michael)
-
- - Spool providers. (Michael)
-
- - Many i18n fixes. (Jeff, Trow, Larry, Michael)
-
- - Fixed saving of html signature preferences. (Peter)
-
- - Cleaned up exiting by having remote stores sync folders (Peter)
-
- - Attached binhex files do not cause infinite loops (Peter)
-
- - Don't send BCC headers when sending via SMTP (Peter)
-
- - Let you show and hide attached message/rfc822's (Peter)
-
- - Implemented Create/Remove/Move Folder. (Jason, Jeff)
-
- - Maildir fixes and improvments, support for subdirectories. (Michael)
-
- - Progress reporting using via shell activity interface. (Michael)
-
- - Many bug fixes all around. (Michael, Jeff, Danw, Peter, Trow and others)
-
-Addressbook:
-
- - Cut/Copy/Paste (Chris T.)
-
- - Improvements to address completion, matching and merging (Jon, Chris L.)
-
- - LDAP improvements (Chris T.)
-
- - Numerous bug fixing (Jon, Chris L., Chris T.)
-
-Calendar & Tasks:
-
- - Timezone support (Damon)
-
- - Cut/Copy/Paste (Rodrigo)
-
- - Event/Task editor rewrite (Federico & JP)
-
- - Improved Printing (Damon)
-
- - Itip/Imip improvements (JP)
-
-Importers:
-
- - Fixes, bug fixes and more fixes. (Iain & Jason)
-
-General:
-
- - New graphics/icons (Jakub & Tuomas)
-
- - UI Improvements (Anna & Taylor)
-
- - 'make distcheck' should hopefully be working again (Peter)
-
- - Have 'make install' work for non-root users in Camel, albeit
- with a large and important warning message (Peter)
-
-My Evolution:
-
- - Completely new and prettier My Evolution (nee Executive Summary)
-
- - Pretty graphics (Jakub)
-
- - Mail, Calendar and Task summaries to tell you what you need to do
- today.
-
- - Weather forecasts so you don't need to look out the window (I
- dunno, hackers seem to dislike looking out the window or
- something...)
-
- - News feeds so you don't need to go to websites to see what news
- articles you don't want to read.
-
- - Printing, you can print it out and make it look like you've got
- lots of stuff to do when really you're just trying to pass the
- time by playing Aisleriot or GLine all day (Iain)
-
-
-Version 0.10 "Tasmanian Devil", 2001-04-26
-------------------------------------------
-
-Shell:
-
- - Fixed some usability bugs in the folder selection and creation
- dialogs. (Ettore)
-
- - Added a --debug option. (Dan)
-
- - Added support for drag and drop operations. (Ettore)
-
-Mail:
-
- - SSL (S/IMAP, S/POP, and S/SMTP). (Jeff)
-
- - Virtual Trash folders in each mail storage and "Empty Trash" menu
- item to expunge all folders in a store. (Jeff)
-
- - Email addresses in mail headers are now right-clickable to add
- them to the Addressbook (Jon, Radek)
-
- - Hide deleted messages is now a mode rather than a one-time
- operation. (Michael)
-
- - When sending plain text mail, use the new plain text mode of the
- GtkHTML editor (Larry)
-
- - Cancellable operations, cancellable/async dns lookup, slightly
- improved progress reporting. (Michael)
-
- - Allow per-identity Draft and Sent folders. (Dan)
-
- - Replies quoted with "> " in messages are now displayed dimmed to
- make it easier to find the new bits of text. (Radek)
-
- - Saved searches. Searches now configurable via XML with supporting
- C code. (Michael)
-
- - UNMATCHED vFolder (shows all messages that are in no other
- vFolder). (Michael)
-
- - SASL Authentication (Kerberos4, DIGEST-MD5, CRAM-MD5, PLAIN,
- LOGIN, ANONYMOUS) for IMAP and SMTP (haven't done POP yet)
- (Jeff, Dan)
-
- - Filter/vFolder on Mailing List. (Michael)
-
- - Resend sent items. (Jeff)
-
- - Allow users to turn on/off headers in the composer and added
- Reply-To header entry in the composer. (Miguel, Jeff)
-
- - Numerous OpenPGP (PGP/MIME) fixes. (Jeff)
-
- - Replying to a message chooses account based on message
- addressee's. (Jeff)
-
- - Redid Forward Inline and Forward Quoted. (Jeff)
-
- - IMAP fixes: greater configurability for faster startup/mail check
- (Dan), folders should now notice new messages when you switch to
- them (Dan), copying/moving many messages at once should be much
- faster (Jeff), better support for old IMAP servers (Dan)
-
- - IMAP message bodies are now cached to local disk to speed up
- re-access (Dan)
-
- - New config dialogs (last time!) (Anna, Dan)
-
- - Sorting by a text field in the message list no longer generates a
- random order. (Michael)
-
- - Fixed "crash when getting new mail from 2 POP servers" bug. (Dan)
-
- - Numerous bugfixes, cleanups and optimisations. (Everyone)
-
-Addressbook:
-
- - Added support for non editable sources. (Toshok)
-
- - Added address completion for use in contact entries using the
- select names system. (Jon Trowbridge)
-
- - Fixed some major crashes in the addressbook backend. (Clahey)
-
- - Updated Ximian's contact information. (Jason Leach)
-
- - Finished LDAP support. (Toshok)
-
-Calendar:
-
- - Event creation fixes. (Miguel)
-
- - Calendar loading fixes and removal of old code. (Federico)
-
- - Made the iTIP control have better spacings. (Anna)
-
- - i18n fixes. (Kjartan)
-
-Tasks:
-
- - Created a popup list item for ETable to select the Status,
- Classification, Priority, Percent & Transparencey fields. (Damon)
-
- - Created a popup date editor item for ETable to set all the dates in the
- tasks. (Damon)
-
-Importers:
-
- - Created Intelligent Importers that look for certain files on your disk
- and works out what type of data it is. Currently Intelligent Importers
- exist for Pine, Elm and Netscape. (Iain)
-
-General:
-
- - Rewrote ETree in gal. Changed evolution to support the changes in
- API. (Clahey)
-
- - Lots of Etable/ETree bug fixes. (Clahey)
-
- - Lots of i18n/l10n fixes. (Kjartan Maraas, Gedeminas Paulauskas,
- and the Evolution gang)
-
- - Fixed the shell interface so it could correctly create folders. (Iain)
-
-
-Version 0.9 "Platypus", 2001-03-12
-----------------------------------
-
-Shell:
-
- - Importing framework. (Iain)
-
- - Made the splash screen a regular window. (Miguel)
-
- - Added a menu item to hide the shortcut bar to the shortuct bar
- right-click menu. (Jason)
-
- - Update the shortcut labels to contain the number of unread
- messages as well. (Jason)
-
- - Pre-select a newly created folder in the folder selection dialog.
- (Ettore)
-
-Mail:
-
- - GPG/PGP support is now mostly working and sort of configurable.
- Except that the pretty pictures are missing. (Jeff)
-
- - Exciting new configuration druid (Anna, Jeff) and configuration
- editor-of-the-month (Jeff). You can now have multiple identities
- that use different transports. (Jeff)
-
- - The folder-tree unread message counts now work much better. But
- vfolders only display their unread message counts *after you've
- looked at the folder for the first time*. (Dan)
-
- - New mail send/receive stuff with status dialog. (NotZed)
-
- - "Stop" button and support for cancelling operations. (NotZed)
-
- - Various fixes involving IMAP folders and subscriptions. (Dan)
-
- - Fake messages to root threads in the message list are now gone. (NotZed)
-
- - NNTP support is no longer configured by default, as this code is
- not expected to be completed by 1.0.
-
- - Interface for hiding messages matching certain criteria. (NotZed)
-
- - Quick search bar now includes "Sender contains" option (Tuomas? Eek!)
-
- - The mailer now properly launches "gnome_segv" when it crashes. I
- mean, if it were to crash. (Dan)
-
- - IMAP attachments are now not loaded unless you look at them. (Dan)
-
- - The X-Mailer header can now include a compile-time-specified
- string (for specifying package version, etc). (Dan)
-
- - The Date header in the message list now formats dates differently
- depending on how long ago they are. (Chris)
-
- - The composer doesn't ask if you want to save before closing if you
- haven't changed anything. Also, it has more useful window titles
- (Jason Leach) And you can now turn off the "are you sure you
- didn't mean to enter a subject?" dialog box. (Jeff)
-
- - The "Menu" key on a Windows keyboard (the one with the picture of
- a pop-up menu) now pops up the message list right-click menu.
- (Dan)
-
- - Lots of internal stuff that doesn't much affect the user-visible
- functionality, particularly involving multithreading, message
- threading, filters/searching, and regression testing. (NotZed)
-
- - Importers for Outlook Express 4 and mbox (used by most mailers like
- Netscape, Pine, Elm, Eudora) (Iain & Jeff)
-
-Addressbook:
-
- - Fixed crashing bug on PPC. (Clahey)
-
- - Updated to work with both OpenLDAP 1 and OpenLDAP 2. (Toshok)
-
- - Added configuration dialog for LDAP. (Toshok)
-
- - Plenty of bug fixes. (Clahey, Toshok, Meeks, JP, Larry, Jason,
- Federico, Dan, Zucchi, Gediminas Paulauskas, Ettore)
-
- - Moved category dialog to gal. (JP)
-
- - Worked on LDAP authentication. (Toshok)
-
- - Worked on status messages. (Toshok)
-
- - Worked on GalView stuff. (Clahey)
-
- - Improved the select names dialog GUI. (Clahey)
-
-Calendar:
-
- - New "go to date" dialog. (JP)
-
- - Categories support for appointments. (JP)
-
- - New alarms page in event editor. (Anna, JP)
-
- - Weekday picker now follows the week start setting. (Federico)
-
- - Date-editing widgets are more consistent with each other.
- (Federico)
-
- - Colorization fixes to the views. (Damon)
-
- - Optimizations to the views. (Damon)
-
- - New, simpler loading interface for calendars in the Wombat. (Federico)
-
- - Removal of lots of old Gnomecal code. (Federico, JP)
-
- - Alarm instance generation support for the Wombat. (Federico)
-
- - Alarm trigger queueing for the GUI. (Federico)
-
- - More robust launching and registration of the components. (Federico)
-
- - More i18n friendliness. (JP, Federico)
-
- - Start of the alarm notification daemon. (Federico)
-
- - Cosmetic and focus fixes all over the place. (Federico, JP)
-
-Tasks:
-
- - New, stand-alone tasks component. (Damon)
-
- - Categories support. (JP, Damon)
-
- - Your old tasks are migrated automatically to the new tasks folder.
- (Federico)
-
- - You get asked for confirmation when trying to delete a task entry.
- (Federico)
-
-Conduits:
-
- - Many bug fixes and cleanups. (JP)
-
-Executive Summary:
-
- - Bugfixes and memory leaks removed. (Iain)
-
- - Calendar summary component. (Iain)
-
- - RDF Summary saves it's state. (Iain)
-
- - Mail summary shows vFolder summaries as well. (Iain)
-
- - User changable number of columns. (Iain)
-
-
-Version 0.8 "Archaeopteryx", 2000-12-14
----------------------------------------
-
-Shell:
-
- - Added a `--no-splash' option. (Ettore)
-
- - Plugged a number of memory leaks. (Federico)
-
- - Added interfaces to display an arbitrary string associated with a
- folder, and highlight it on demand. (Ettore, Dan)
-
- - Changed the Storage IDLs so that you can associate a physical URI
- to the toplevel node as well. (Ettore)
-
- - If a shell is already running, `evolution' will just make it
- create a new view instead of creating a new shell. (Ettore)
-
-Mail:
-
- Display:
-
- - The folder tree now shows unread message counts for mail
- folders. For local folders, this updates in real time. For IMAP, it
- only updates when you "Get Mail". To be continued. (Dan)
-
- - New "important" column in the message list. User-settable. (Dan)
-
- - The message list "Size" column now displays more prettily and
- sorts correctly. (Jeff)
-
- - New command to view the raw source to a message. (Jeff)
-
- - More reliable MIME icon code in the mailer and the composer.
- (Dan, Iain)
-
- - Lots of internationalization fixes. (Dan, Kjartan)
-
- Composer / Outgoing mail
-
- - Various fixes to use the best charset and MIME encoding for
- outgoing messages. (Michael, Jeff)
-
- - You can now forward messages inline, instead of attaching them.
- Forwarding multiple messages now results in a multipart/digest
- attachment. (Jeff)
-
- - Replies are now preceded by "On DATE, PERSON wrote:" (Jeff)
-
- - Better reply editing, automagically sets indentation and paragraph
- style to Normal. (Radek)
-
- - HTML signature support. (Radek)
-
- - Inline image support. (Radek)
-
- - Fixes for addresses with commas. (Jeff, Michael)
-
- - Fix to not allow attaching directories, devices, etc.
- (Jeff)
-
- - Fixed the sign of the GMT offset in generated Date headers.
- (Michael)
-
- - Fixed a bug in base64 encoding. (Michael)
-
- - Fixed a problem in connecting to non-ESMTP SMTP servers. (Jeff)
-
- Miscellaneous Commands / Features:
-
- - The mailer will now remember your passwords, if you configure
- that option for a service. (Dan)
-
- - New "Apply Filters" command to apply filter rules to selected
- messages. (Jeff)
-
- - No more "No new mail" dialog. (Jeff)
-
- - Individual messages can now be saved to disk. (Jeff)
-
- - Synced the Message menu with the right-click menu. (Jeff)
-
- - Mailer now uses the same search bar as the addressbook. (Anna,
- Chris, Jeff)
-
- Filters:
-
- - Now supports filtering on system flags (ie Answered, Seen,
- Unseen). (Jeff)
-
- - Regular expression searches are now moved to their own Option
- menu. (Jeff)
-
- - Allows regex searching on the entire message header. (Jeff)
-
- - Now has soundex filters (x sounds like y). (Jeff)
-
- IMAP:
-
- - "Get Mail" now scans all folders. (Dan)
-
- - IMAP password dialog no longer pops up at startup: click on the
- server in the folder tree to connect. (Dan)
-
- - Folder subscription support. (Chris Toshok, Dan)
-
- - Various IMAP folder naming fixes. (May fix Cyrus support) (Dan)
-
- - Seen/deleted flags are preserved across "Get Mail". (Jeff)
-
- - Fixed a bug that could cause messages to be marked as seen
- even when the UI thought they weren't. (Dan)
-
- - Fixes for IMAP folders with spaces in their names (again).
- (Jeff)
-
- - IMAP Kerberos 4 authentication support. (Dan)
-
- POP3:
-
- - Fixed a bunch of error cases in POP3 connection. (Dan)
-
- - Fixed POP3 to more reliably delete messages when it was supposed
- to be doing so. (Dan)
-
- Local mail:
-
- - Major local mail rewrite that fixed memory leaks, reduced
- memory consumption, improved efficiency, etc. (Michael)
-
- - Maildir support. (Michael)
-
- - Local mail folders are now locked (via dot locking and/or
- fcntl/flock) while Evolution is modifying them, and it will
- notice if they've changed while it's not looking. (Michael)
-
-Calendar:
-
- - To-do and calendar conduits working except for extended
- character support (ie accented chars) (JP)
-
- - Updated wombat implementation of change reporting (JP)
-
- - Majorly kick-ass new recurrence page in the event editor with an
- easy UI, a preview of what will happen, and lots of love. (Anna)
-
- - Imported a new libical with the APIs we require for alarms, the
- start of the timezone code. This may be the last Evolution
- release that uses a CVS-imported libical; in the future we should
- depend on official tarballs. (Federico)
-
- - Event editor now deals gracefully with iCalendar recurrences we
- cannot edit. (Federico)
-
- - Plenty of fixes to the ETable calendar model for the task list
- (Damon).
-
- - The task list now saves its state, selected columns and sort order
- (Damon).
-
- - Lots of love to the iTIP engine and user interface. Scheduling
- appointments via email should be working fine, and they should
- also work when you receive them. (Jesse)
-
- - Lots of work on the calendar preferences code. (Damon)
-
- - Many functional and cosmetic fixes to the day and week
- views. (Damon)
-
- - Event and task editors now ask if you try to close them without
- saving changes. (Damon)
-
- - You are now prompted if you are sure that you want to delete an
- appointment. (Federico)
-
- - Plenty of memory leaks fixed. (JP, Federico)
-
- - Prettified the event editor a bit by making widget spacings
- consistent. (Federico)
-
- - Fixed semantics for handling exception dates (Federico)
-
- - Some fixes to the recurrence instance generation engine. (Damon)
-
- - Fixed insertion of new objects via notification into the task
- list. (JP, Federico)
-
- - Misc. polishing for the event editor's innards. (Damon, Federico)
-
- - Misc. cruft removal from old Gnomecal code (Federico, Miguel)
-
- - Prettier icons for the task list. (Federico)
-
-Addressbook:
-
- - Addressbook conduit now working, experimentally, except for
- extended character support (ie accented chars.) (JP)
-
- - Extended wombat functionality with getChanges call. (JP)
-
- - Full name and address dialogs in contact editor fixed. (Chris)
-
-Executive Summary: (iain)
-
- - Now compiled by default.
-
- - Prettier default dialogs.
-
- - Customisable background.
-
- - RDF Summary, and Mail Summary components.
-
- - Fixes and optimisations.
-
- - Can restore state.
-
-Version 0.7, "Loch Ness Monster", ????
---------------------------------------
-
-There have been no verified sightings of this release.
-
-
-Version 0.6, "Procompsognathus", 2000-10-19
--------------------------------------------
-
-General:
-
- - Split out lots of functionality to gal. Evolution now depends on
- gal. (Chris Lahey, Gal Team)
-
-Shell:
-
- - Added a cute splash screen. (Ettore, TigerT)
-
- - Improved the way `~/evolution' is initialized the first time.
- (Iain)
-
- - Fixed the problem with the folder bar disappearing too son when
- clicking on the scrollbar. (Ettore)
-
- - Updated to use the new toolbar and UI merging code from Bonobo.
- (Michael Meeks, Ettore)
-
-Mail:
-
- - Numerous i18n encoding, decoding, and display fixes. Non-ASCII
- text should be displayed correctly in most context in the mailer
- now. The composer no longer sends undeclared 8bit data. (Jeff)
-
- - The IMAP provider now caches summary info between sessions, so
- startup should be much faster for large folders. (Dan)
-
- - Subscribe/unsubscribe UI for newsgroups. (IMAP subscriptions will
- be supported in a later release.) NNTP authentication support.
- Various other NNTP fixes. (Chris Toshok)
-
- - New "full search" button to do more complicated searches. (NotZed)
-
- - Composer attachment bar improvements. You can now drag files to
- the composer window to attach them to the message. (Iain)
-
- - Message list state (columns selected, sorting, etc) is now saved
- between sessions. (NotZed)
-
- - "Get Mail" now works for IMAP. IMAP mail no longer arrives
- asynchronously (although if you delete mail from another client,
- it will be deleted asynchronously). (Dan)
-
- - Image attachments now use thumbnail images rather than a generic
- image icon. (Iain)
-
- - Various IMAP provider bugs (Dan, Jeff)
-
- - Filter code cleanup/improvements. (NotZed) Filtering can read and
- write message scores. (Jeff) On-demand filters no longer expunge
- the source folder, and don't filter deleted messages. (Jeff)
- Filters now log their actions. (Jeff)
-
- - Drafts, Outbox, and Sent folders now default to showing "To"
- instead of "From" in the header list. Messages output to the Sent
- folder are marked as "Seen". "Send later" on a reply will mark the
- message as having been replied to. (Jeff)
-
- - Message list "attachment" column is now functional. The
- read/unread state of a fake thread header now matches the state of
- the thread. (NotZed) Message list sorting is more clever (Jeff)
-
- - The "Print" toolbar button now opens a Print dialog rather than a
- Print Preview window. (Miguel)
-
- - New "Select All" command. "Mark all messages as seen" became "Mark
- (selected) messages seen". (Jeff)
-
-Calendar:
-
- - Improved todo list and calendar view gui (Damon)
-
- - Printing works again (Federico)
-
- - Config dialog improvement and implementation (Damon)
-
- - Todo and calendar conduits working, except for archiving (JP)
-
-Addressbook:
-
- - Lots of internal refactoring of addressbook, including changes due
- to gal. (Chris, Chris)
-
- - Lots of bug fixes. (Chris, Chris, Matt Bissiri, Iain, Dan)
-
- - Added a working field to save whether the contact wants
- HTML. (Chris Lahey)
-
- - Added "Stop" and "View All" toolbar buttons. (Chris Lahey)
-
- - Lots of work on modifiable LDAP. (Chris Toshok)
-
- - Recognizes a lot more Prefixes and Suffixes when parsing names. (Nat)
-
- - The card view doesn't write out cards unless they've changed. (Chris Lahey)
-
- - New layout of address editor dialog. (Anna, Chris Lahey)
-
-Version 0.5.1, "Salamended", 2000-09-15
----------------------------------------
-
-General:
-
- - Fixed a font-handling problem that would cause Evolution to crash
- at startup with certain Gtk themes. (Chris)
-
- - Fixed some build problems. (Chris)
-
- - We no longer ship an out-of-date Red Hat-only RPM spec file.
-
-Shell:
-
- - The shell now installs the `Sent' folder at startup if it doesn't
- exist yet. (Ettore)
-
- - If a component crashes unexpectedly, the shell displays a dialog
- box informing the user of that. (Ettore)
-
- - Fixed a bug in the folder selector dialog that would result in
- crashes while trying to move messages in the mailer. (Dan)
-
-Addressbook:
-
- - Fixed a bug that would cause the addressbook to crash when
- embedded in the composer. (Dan)
-
-Mail:
-
- - Fixed a display problem caused by expunging an IMAP folder. (Dan)
-
- - Fixed POP mail so that "keep on server" is obeyed correctly. (Dan,
- Jeff)
-
- - Fixed replies so that replying to a message twice doesn't turn off
- the "replied" flag. (Dan)
-
- - Fixed a bug that prevented "Send later" from working. (Dan)
-
-
-Version 0.5, "Salamander", 2000-09-13
--------------------------------------
-
-Shell:
-
- - Switched to using ETree for the folder view. (Chris Toshok,
- Ettore)
-
- - Added interfaces to change the string displayed in the tree view
- as the name of the folder. (Ettore)
-
-Calendar:
-
- - Uses only the new iCalendar standard internally; this means future
- interoperability with new calendaring programs. (JP, Federico)
-
- - New ultra-cool date range selector, aka little calendar. (Damon)
-
- - Plenty of internal refactoring. (JP, Damon, Federico)
-
- - Pilot synch work, mostly on pcs infrastructure and some todo work (JP)
- <EXPERIMENTAL>
-
- - Pilot synch work, mostly on pcs infrastructure and some todo work (JP)
- <EXPERIMENTAL>
-
-Addressbook:
-
- - New advanced search dialog. (Michael Zucchi, Chris Lahey)
-
- - Added parsing of addresses. (Jesse Pavel)
-
- - Converted most of addressbook to UTF8. (Lauris)
-
-Mailer:
-
- - Filters (but not vfolders) are now more powerful: they can check
- any message header, and can do regexp searches on the headers and
- body. (Jeff)
-
- - A first draft of an automated mailing list recognizer
- has been added. (It will need more/better rules.) (Ettore)
-
- - Attachments are handled differently now. All attachments always
- have an icon and a header, and you can right-click on the icon to
- view/hide, save, or launch an external viewer. (Dan)
-
- - It is no longer necessary to quit and restart after adding a new
- IMAP server. (Peter)
-
- - Lots of i18n/charset fixing. (Lauris)
-
- - Shiny new toolbar icons. (Tuomas)
-
- - Giant menu reorganization. Most message operations are now in the
- "Message" menu, and folder operations in the "Folder" menu.
- (Ettore, Dan, Peter)
-
- - "Mark as seen" timeout is now configurable. Mail view remembers
- the location of the message list/message display split. (Richard
- Hult)
-
- - New filter category: "On-demand", for filters to be applied
- at arbitrary times rather than during mail incorporation. (Peter)
-
- - POP/IMAP config pages allow you to specify a port... this may
- go away in a later release when we support ssl/ssh tunneling
- directly. (Peter)
-
- - Reply To All will now remove your own addresses from the recipient
- lists. (Jesse Pavel)
-
- - Folders are synced when you switch to another folder now. (Dan)
-
- - An IMAP bug that caused all messages to be marked as read before
- they were read has been fixed. (Dan)
-
- - The IMAP provider is now more robust about dealing with other
- concurrent IMAP clients. (Jeff)
-
- - POP and IMAP are better about when they do and don't try to
- reconnect. This was part of Camel operation cancellation support,
- which unfortunately didn't make it into 0.5. (Peter)
-
- - Sent and Outbox folders are now functional. You now have 2
- options when sending a message - "Send Now" which will send the
- message imediately and "Send Later" which will queue the message in
- Outbox for later sending. When a message is successfully sent, it
- is copied to the Sent folder for your records. (Jeff)
-
-ETable:
-
- - ETree fixes. (Chris Toshok)
-
- - Lots of small usability fixes. (Chris Lahey)
-
- - Lots of grouping bug fixes. Specifically, fixed crashes when
- grouping in trees and made ETable not go crazy when you change
- data and the table is grouped. (Chris Lahey)
-
- - Improved table printing when grouped. (Chris Lahey)
-
- - Converted most of ETable to UTF8. (Lauris)
-
-
-Version 0.4, "Alewife", 2000-08-14
-----------------------------------
-
-Shell:
-
- - Added interfaces to display messages and a progress bar when the
- component is busy. (Ettore)
-
- - Changed the shell BonoboUIHandler code to allow placing menu items
- such as "Print" in the right places. (Ettore)
-
- - Added code to check if an existing `~/evolution' directory
- actually has the content we expect and, if not, complain to the
- user. (Dan)
-
- - Fixed some Bonobo-related refcounting problems. (Michael Meeks)
-
- - Removed the GConf dependency. (JP)
-
- - Improved the API for the folder selection dialog. (Ettore)
-
- - Memory leak fixes. (Peter)
-
-Calendar:
-
- The calendar is in the middle of major rewrite. Evolution 0.4
- ships with essentially the same calendar component as 0.3 did.
-
-Addressbook:
-
- - More work on the Palm Pilot conduits. (Chris Toshok)
-
- - Fixed some LDAP-related crashes. (Chris Toshok)
-
- - Added support for displaying embedded vCards through a Bonobo
- component. (Chris Lahey)
-
- - Added support for generic fields. (Chris Lahey)
-
- - Fixed the navigation order for the Tab key in the contact editor
- window. (Chris Lahey)
-
- - Fixed some Bonobo-related bugs and crashes. (Chris Lahey, Michael
- Meeks)
-
- - Only display entries that have an email address in the address
- selector dialog. (Chris Lahey)
-
- - Added an utility program to import vCards from Gnomecard. (Chris
- Lahey)
-
-Mailer:
-
- Generic
-
- - Long mailer operations (such as fetching new mail) now run
- asynchronously rather than blocking the UI. This involved
- a major rewrite of much of the Camel and mailer code. (Peter)
-
- - GPG/PGP message decryption support (Nathan Thompson-Amato, Dan)
-
- - Unfinished messages in the composer can be saved to the "Drafts"
- folder and finished later. (Jeff)
-
- - Double-clicking on a message in the message view now opens it in a
- separate window. (Jeff)
-
- - vCards attached to messages now bring up a minicard view with a
- button to add the vCard to the addressbook (Chris Lahey, Dan)
-
- - Inline uuencoded/binhexed "attachment" support (Dan)
-
- - "Mark All Messages Seen" command. (Cody Russell)
-
- Filters / VFolders
-
- - Major filter/vfolder dialog rewrite (Michael Zucchi) VFolders can
- now search any (searchable) folder, not just Inbox.
-
- - Auto-filter/auto-vfolder code (right click on a message in the
- list and pick one of the options at the bottom of the menu to
- create a filter/vfolder rule for similar messages). (Michael)
-
- - You can now set the color of messages in the message list, based
- on filter rules. (Local stores can also now store arbitrary user
- flags, although there is not yet UI code to set/view them.)
- (Michael)
-
- - Added "Save" button to the quicksearch bar to save a search as a
- vfolder. (Michael)
-
- Configuration
-
- - Major mail config dialog rewrite (JP).
-
- - The mailer now remembers your threaded/unthreaded message view
- setting between sessions. (Jeremy Wise).
-
- - Support for multiple identities (JP, Jeff), sources (JP, Peter), and
- IMAP servers (JP, Dan)
-
- Providers
-
- - You can now leave POP mail on the server. (This will [currently]
- only work right with POP servers that support the UIDL command.
- On other servers, it will never download some messages unless you
- never delete mail.)
-
- - There is now an MH-like local store available, and code to convert
- a folder from one type to the other. (Michael)
-
- - The mbox provider now writes out "From " lines that are more
- compatible with other mailers (like Mutt) that are picky about
- their exact format. (Michael)
-
- - The IMAP provider now supports searching (Jeff). Also various
- other speed/efficiency/robustness improvements (Jeff), and support
- for old IMAP4 servers as well as IMAP4rev1 (Jon K Hellan).
-
-
-Version 0.3, "Jellyfish", 2000-07-21
-------------------------------------
-
-Shell:
-
- - Pop-up folder selection. (Ettore)
-
- - Added support for multiple views. (Ettore)
-
- - Added support for saving component-specific settings, and
- some initial code to save the view's configuration.
- (Ettore)
-
- - Fixed the Bonobo menu code so that it works with all the
- locales. (Ettore)
-
-Mailer:
-
- - Lots of IMAP fixes. (Jeff)
-
- - You can use an external setuid/setgid movemail program
- (although we don't ship our own yet). If you have one
- installed with emacs, the configure script will find
- that. Otherwise, you can specify --with-movemail=/path.
- (Dan)
-
- - You can toggle HTML/plain text for an individual message
- in the composer now. (Ettore)
-
- - Bonobo embedding sort of works again, but there are
- problems with size allocation somewhere. Attachments can now
- also be handled by external applications. (Dan)
-
- - text/plain mail is now line-wrapped in the mail display,
- to deal with people who don't put newlines in their mail.
- (Dan)
-
- - Allow user to specify IMAP namespace in the mail config
- dialog. (Dan, Jeff)
-
- - Quoted-printable encoder fixes. (Michael Zucchi)
-
- - Various NNTP fixes, include a news pane in the config
- dialog. (Chris Toshok)
-
- - Some memory corruption fixes. (Peter Williams)
-
- - Fix for message not being re-drawn as deleted. (Peter
- Williams, Jeff)
-
- - Moving a message to another folder copies the flags now
- (Jeff)
-
- - Close signature in HTML mail with </PRE>, not <PRE>, and
- default to ~/.signature. (Michael Meeks)
-
- - Fixed some confusing behavior in the message threading
- algorithm. (Dan)
-
- - Improvements to the item selection code. (Chris Lahey)
-
-Calendar:
-
- - Added support for a bunch of previously unsupported iCalendar
- properties. (Federico)
-
- - Conduit for synchronizing the calendar with gnome-pilot
- (requires gnome-pilot from CVS). (Seth)
-
- - ETable-based to-do list view ("taskpad"), for your viewing
- pleasure.
-
-Addressbook:
-
- - Conduit for synchronizing the addressbook with gnome-pilot
- (requires gnome-pilot from CVS). (Chris Toshok)
-
- - Conduit for synchronizing the addressbook with gnome-pilot
- (requires gnome-pilot from CVS). (Chris Toshok)
-
- - Fixed some random crashes. (Chris Lahey)
-
- - Implemented a vCard Bonobo control so that we can support
- inline vCard viewing in the mailer. (Chris Lahey)
-
- - Quick search looks at both the name and the company name now.
- (Chris Lahey)
-
- - Added more functionality to the contact editor's toolbar. (Chris
- Lahey)
-
- - Support for printing single cards. (Chris Lahey)
-
-Version 0.2, "Saccharomyces", 2000-07-11
-----------------------------------------
-
-Shell:
-
- * Folder selection dialog (Ettore).
-
- * Folder creation dialog (Ettore).
-
-Addressbook:
-
- * LDAP server configuration dialog (Chris Toshok).
-
- * Integration of LDAP servers in the shell's tree view (Chris Toshok).
-
- * ETable-based view (Chris Lahey).
-
- * Printing support for the ETable-based view (Chris Lahey).
-
- * Address selection dialog integrated with the message composer (Chris
- Lahey).
-
- * Many miscellaneous bugs fixed (everyone).
-
-Calendar:
-
- * Printing support (Michael, Federico).
-
- * Many, many behavior fixes and polishing to the day/week/month view
- widgets (Damon).
-
- * New glade-based event editor. This is unfinished but usable (Seth,
- Federico).
-
- * Mouse wheel scrolling support (Anders).
-
- * We have an awesome new engine for computing recurring events
- (Damon). This will be plugged in to the new iCalendar code.
-
- * Internal and public API fixes (Federico, Seth).
-
- * Shell-related changes (Ettore).
-
- * Data model for ETable; this is not used yet (Federico).
-
- * New iCalendar support; this is not used yet (Federico).
-
- * Pilot syncing updates; this is not used yet (Seth).
-
- * Many miscellaneous bugs fixed (everyone).
-
-
-Mailer:
-
- Major features:
-
- * Basic IMAP support (Jeff)
-
- * Threaded message view (Michael, Chris Toshok)
-
- * Filters now work (original work by Michael, bugfixes by Dan)
-
-
- Smaller features:
-
- * Implemented moving messages between folders (Dan)
-
- * Very basic printing support (Dan, but it was only like 5 lines
- of code, because gnome-print kicks ass)
-
- * "Delete", "Forward", and "Refile" operations now work on
- multiple messages. (Chris Lahey, Peter Williams, Dan)
-
- * Toggle read/unread flag when the user clicks on the envelope
- icon (Chris Lahey, Dan).
-
- * The "New folder" menu item now works (Ettore, Dan).
-
- * The filter/vfolder druid now uses the new shell folder selection
- UI (Michael)
-
- * Added "Cc" to the set of filter/vfolderable headers and make the
- filter/vfolder "messages to address" rule work with to or cc.
- (Dan)
-
- * New key bindings: "Delete" deletes the current message and jumps
- to the next undeleted message. "N" and "P" go to next/previous
- unread message. (Dan)
-
- * Keep asking for POP/IMAP password until the user gets it correct
- or hits Cancel, and remember the result until the user exits (or
- chooses "Forget Passwords"). (Dan, Jeff)
-
- * Kludge Camel to output ISO-8859-1 instead of UTF-8, since
- neither GtkHTML nor ETable supports UTF-8 still. (Dan)
-
- * Use the gnome-vfs "sniff buffer" interface to try to identify
- the MIME type of attachments without useful type information
- (Dan)
-
- * Allow saving drafts in the composer (Ettore)
-
- * Added "Received date" header to the set of possible message list
- headers. (Dan)
-
- * Partial gladification of the config dialog (JP Rosevear)
-
-
- Bug fixes:
-
- * Message read/unread/deleted flags should now be saved reliably
- when you exit, and summary should not be rebuilt when a rebuild
- isn't needed. Expunging should work reliably (Dan, Ettore,
- Jeff).
-
- * Fix disappearing toolbar bug (Dan).
-
- * Fixed a bug that made downloading of very large messages over
- POP incredibly slow, and various other smaller POP bugs. (Dan)
-
- * Fixed bugs that made large attachments sometimes get dropped and
- small ones sometimes get truncated. (Dan)
-
- * Fixed filter/vfolder "messages to address" rule to correctly
- match "to" rather than "from". (Michael)
-
- * Fix some text/plain formatting bugs in the composer. (Dan,
- Ettore)
-
- * Turn off search mode when getting new mail (to avoid corrupting
- the display). Make "get mail" always put unfiltered mail into
- Inbox rather than the current folder. (Dan)
-
- * Fixed a bug that caused "Re:" to be prepended even to subjects
- that started with "Re:" when replying. Added a default subject
- to forwarded messages. (Dan)
-
- * Make the "Attach" dialog in the composer remember the last
- directory it was in. (Dan)
-
- * Code to parse invalid date formats since some mailers generate
- them... (Jeff)
-
- * Fixed various small SMTP bugs (Jeff, Chris Lahey)
-
- * Fixed some memory leaks (Peter, Jeff)
-
- * Make replies use the text/plain part of a multipart/alternative
- if the user configured plain text rather than HTML mail sending.
- (Dan)
-
- * Various config dialog fixes (Jeff)
-
- * Partial filter/vfolder GUI facelift (Jacob)
diff --git a/README b/README
deleted file mode 100644
index 56b4e1820f..0000000000
--- a/README
+++ /dev/null
@@ -1,252 +0,0 @@
-Evolution is the integrated mail, calendar and address book suite from
-Ximian, Inc.
-
-See http://www.ximian.com/products/evolution for more information.
-
-If you are using Evolution, you may wish to subscribe to the Evolution
-users mailing list. If you are interested in contributing to
-development on it, you should certainly subscribe to the Evolution
-Hackers mailing list. Visit
-
- http://developer.ximian.com/community/lists.html
-
-to subscribe or view archives of the Ximian mailing lists.
-
-If you are planning to work on any part of Evolution, please send mail
-to the mailing list first, to avoid duplicated effort (and to make
-sure that you aren't basing your work on interfaces that are expected
-to change).
-
-There is also a #evolution IRC channel on irc.gnome.org.
-
-Help for Evolution is available in the user manual (select "Help" from
-the menu after running the application), at the Ximian knowledge base
-(http://support.ximian.com), in the Evolution man page (run "man
-evolution" at the command line), and in the --help strings (run
-"evolution --help" at the command line).
-
-The rest of this file is dedicated to building Evolution.
-
-
-DEPENDENCIES
-------------
-
-In order to build Evolution you need to have the full set of GNOME 2
-or GNOME 2.2 development libraries installed.
-
-GNOME 2 comes with most of the modern distributions, so in most cases
-it should be enough to just install all the devel packages from your
-distribution. If, on the other hand, you want to build GNOME 2 from
-source, please refer to this page:
-
- http://gnome.org/start/2.2/notes/rninstallation.html
-
-Please make sure you have the most recent versions of the libraries
-installed, since bugs in the libraries can cause bugs in Evolution.
-
-Additional dependencies, besides the stock GNOME libraries (the
-dependencies should be compiled in the order they are listed here):
-
- * [If compiling against GNOME 2.0] libgnomeprint and
- libgnomeprintui 2.2.0 or later
-
- These library come with GNOME 2.2 installations, but not
- with GNOME 2.0 ones. The source code can be downloaded from
- the following locations:
-
- ftp://ftp.gnome.org/pub/gnome/sources/libgnomeprint
- ftp://ftp.gnome.org/pub/gnome/sources/libgnomeprintui
-
- * [If compiling against GNOME 2.2] libgnomecanvas 2.2.0.2 or
- later
-
- If you have a GNOME 2.2 installation, you need to upgrade
- libgnomecanvas to this version (or a later one), since
- Evolution exposes a bug in the older versions of the library
- which causes a crash.
-
- If you have a GNOME 2.0 installation, libgnomecanvas 2.0 is
- safe to use.
-
- * gtkhtml 3.0.1 or later
-
- ftp://ftp.gnome.org/pub/gnome/sources/gtkhtml
-
- * gal 1.99.8 or later
-
- ftp://ftp.gnome.org/pub/gnome/sources/gal
-
- * Berkeley's libdb 3.1.17
-
- It is important to use *exactly* this version, and not a
- later one, to compile Evolution. Please check the "Building
- Berkeley DB" section below for more information.
-
- ftp://ftp.ximian.com/pub/source/evolution
-
- * [Optional] Mozilla NSPR/NSS libraries
-
- These are needed if you want to compile Evolution with SSL
- support.
-
- http://www.mozilla.org/
-
- Many distributions ship these as Mozilla development
- packages.
-
- * [Optional] gnome-pilot 2.0 or later
-
- This is only necessary if you want to be able to synchronize
- your Palm device with Evolution.
-
- ftp://ftp.gnome.org/pub/gnome/sources/gnome-pilot
- ftp://ftp.gnome.org/pub/gnome/sources/gnome-pilot-conduits
-
- * [Optional] gnome-spell 1.0.1 or later
-
- This is only necessary if you want to have the spell
- checking functionality in Evolution's message composer.
-
- ftp://ftp.gnome.org/pub/gnome/sources/gnome-spell
-
-
-COMPILING BERKELEY DB
----------------------
-
- --- IMPORTANT WARNING ---
-
- The on-disk format of DB files has been changing between versions 2, 3
- and 4. Also, because of the libdb API, there is no way to easily
- handle the different formats from within the application. For this
- reason, Evolution has chosen to use one specific version of the
- library (version 3) and stick to it, so that users do not need to
- convert their addressbook files to use them with different version of
- Evolution.
-
- That's why Evolution REQUIRES libdb 3.1.17, and NO OTHER VERSION.
-
- If you force the check to accept a version different from 3.1.17, your
- binary of Evolution will be using a different format from the chosen
- one; this means that it will not be able to read addressbook databases
- created by other versions of Evolution which were compiled in the
- standard way. Also, we DO NOT GUARRANTEE that Evolution will work
- with different versions of libdb at all, even if it can be trivially
- made to compile against them.
-
- SPECIAL NOTE FOR BINARY PACKAGERS:
-
- If you are making binary packages for end-users (e.g. if you are a
- distribution vendor), please statically link Evolution to Berkeley
- DB 3.1.17, as mandated by the configure.in check. DO NOT patch
- configure.in to work around the check. Forcing the check to link
- to a different version of the library will only give headaches and
- pain to your users, who will see their addressbook disappear and
- will complain to us (the Evolution team) about losing their data.
-
- Besides, libdb will be linked statically, which means that your
- distribution doesn't actually need to ship DB 3.1.17 itself
- separately.
-
- The Evolution team will be infinitely grateful for your
- co-operation. Thanks!
-
-If you don't have version 3.1.17 installed on your system or Evolution
-doesn't detect it for some reason, here is a way to get Evolution to
-link to it without messing up your system installation.
-
- * Install the content of the tarball somewhere *other* than the
- evolution source tree, e.g: NOT evolution/db-3.1.17 .
-
- * Compile according to instructions, but installing into some custom
- prefix, for example:
-
- ../dist/configure --prefix=/home/user/berkeleydb-3.1.17
-
- * Configure Evolution specifying that it has to look for the DB
- library there, for example:
-
- ./configure --prefix=/opt/gnome
- --with-db3-includes=/home/user/berkeleydb-3.1.17/include
- --with-db3-libs=/home/user/berkeleydb-3.1.17/lib
-
-Evolution links statically to the library, so after you have compiled
-Evolution you can remove the installed library from your system.
-
-
-CONFIGURING EVOLUTION
----------------------
-
-First you have to decide whether you want to install Evolution (and
-its dependencies) into the same prefix as the rest of your GNOME
-install, or into a new prefix.
-
-Installing everything into the same prefix as the rest of your GNOME
-install will make it much easier to build and run programs, and easier
-to switch between using packages and building it yourself, but it may
-also make it harder to uninstall later. Also, it increases the chance
-that something goes wrong and your GNOME installation gets ruined.
-
-If you want to install in a different prefix, you need to do the
-following things:
-
- * Set the PKG_CONFIG_PATH environment variable to contain a
- colon-separated list of all the pkg-config directories that
- will be involved in the build. This basically means a list
- of $prefix/lib/pkgconfig directory names, where $prefix is
- the prefix where a library is installed.
-
- For example, if you have GNOME installed in /usr and you
- are installing Evolution and its dependencies in
- /opt/evolution, you want to do something like the following
- (assuming you are using Bash):
-
- export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/opt/evolution/lib/pkgconfig
-
- * Edit the bonobo-activation-config.xml file (which is
- normally found in /etc/bonobo-activation/) to include the
- location where you are installing Evolution.
-
- In the example given above (GNOME in /usr, Evolution and
- dependencies in /opt/evolution), your
- bonobo-activation-config.xml will have to look like this:
-
- <?xml version="1.0"?>
- <oafconfig>
- <searchpath>
- <item>/usr/lib/bonobo/servers</item>
- <item>/opt/evolution/lib/bonobo/servers</item>
- </searchpath>
- </oafconfig>
-
- * Pass an appropriate --prefix parameter to the configure
- scripts of Evolution and its dependencies, eg:
-
- ./configure --prefix=/opt/evolution
-
-More information on how to use the configure script is available in
-the INSTALL file which is part of the Evolution tarball.
-
-
-OPTIONAL FEATURES
------------------
-
-Some optional features can be enabled at compilation time by passing
-appropriate flags to the configure script:
-
- * GNOME Pilot support.
-
- Assuming you have installed gnome-pilot, add the following
- options:
-
- --with-pisock=<prefix> --enable-pilot-conduits=yes
-
- Where <prefix> is the location where pilot-link (a package
- that gnome-pilot depends on) was installed.
-
- * SSL support.
-
- Make sure you have Mozilla's NSS nad NSPR libraries
- installed and pass the following flag:
-
- --enable-nss
-
diff --git a/RELEASE-NOTES b/RELEASE-NOTES
deleted file mode 100644
index 45172e08e3..0000000000
--- a/RELEASE-NOTES
+++ /dev/null
@@ -1,88 +0,0 @@
-WARNING
-
-Evolution 1.1.2 is a BETA quality release. This means that it has
-bugs, including possibly destructive bugs that can cause valuable data
-to be lost.
-
-For this reason, please make sure you back up your mail and your
-calendar/addressbook information before using Evolution 1.1.2 on them.
-In particular, you are strongly advised to backup the `evolution'
-directory in your home directory if you are upgrading from a 1.0.x
-version of Evolution to Evolution 1.1.2.
-
-
-UPGRADING FROM 1.0.x
-
-The format of certain configuration files has changed in this version
-of Evolution. When you start Evolution 1.1.2 for the first time, it
-will automatically migrate your configuration so that it will work as
-expected with this version.
-
-IMPORTANT: After you have succesfully installed Evolution 1.1.2,
-please make sure that Evolution 1.0.x isn't running anymore and type
-command `killev' on the command-line (without quotes) before launching
-the new version of Evolution.
-
-
-RETURNING TO 1.0.x
-
-If you want to return to a 1.0.x version after trying 1.1.2, you have
-to restore the original configuration files. From the command-line,
-you can do the following, after having quit Evolution:
-
- killev
- cd ~/evolution
- mv filters.xml.bak-1.0 filters.xml
- mv vfolders.xml.bak-1.0 vfolders.xml
- mv shortcuts.xml.bak-1.0 shortcuts.xml
- mv mail/imap.bak-1.0 mail/imap
-
-Note that any changes to filters, vfolders or shortcuts made with
-1.1.2 will be lost after this operation.
-
-Also note that the upgrade mechanism runs automatically only the first
-time you run 1.1.2. For this reason, if you run Evolution 1.1.2, then
-go back to 1.0 using the aforementioned procedure, and then go back to
-using 1.1.2 again, the settings will not be upgraded.
-
-To force the upgrade to happen again in this case, use the following
-command to start Evolution 1.1.2:
-
- evolution --force-upgrade
-
-IMPORTANT: After you have succesfully installed Evolution 1.0.x,
-please make sure that Evolution 1.1.2 isn't running anymore and type
-command `killev' on the command-line (without quotes) before launching
-the older version of Evolution.
-
-
-SEARCH CRITERIA CHANGES
-
-When you specify multiple words in search "contains" criterion,
-Evolution will now search the mail messages that contain all the words
-specified, in any order. (The 1.0.x behavior was to look for the
-whole string in "subject contains" matches, and matched no messages in
-the case of body searches.)
-
-This applies to the search bar, the filter rules and the vfolder
-rules. Filter rules and vfolder rules might need to be re-adjusted
-after you upgrade to version 1.1.2.
-
-
-IMAP FOLDER NAME CHANGES (I18N)
-
-If you created any folder names using non-ASCII characters using prior
-versions of Evolution, you will find they may not be displayed
-properly anymore. This is because previous versions did not implement
-IMAP I18N folder names correctly as specified in RFC 2060.
-
-The upgrade script will try to rectify any filters or vfolders using
-any such names. However, as it does not know the character set used
-by the server, non ISO-8859-1 (latin-1) characters will not be
-properly converted. You may need to reverify the filter and vFolder
-rules in this case.
-
-Also note that if such folder names do not display properly that it is
-purely cosmetic and may be fixed by renaming the folder(s) in
-question.
-
diff --git a/a11y/.cvsignore b/a11y/.cvsignore
deleted file mode 100644
index 282522db03..0000000000
--- a/a11y/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/a11y/ChangeLog b/a11y/ChangeLog
deleted file mode 100644
index 6752384193..0000000000
--- a/a11y/ChangeLog
+++ /dev/null
@@ -1,103 +0,0 @@
-2003-12-05 Bolian Yin <bolian.yin@sun.com>
-
- * calendar/ea-cal-view-event.c (ea_cal_view_event_new): shortcut when cal_view is NULL.
- * calendar/ea-cal-view.c: Change an action name.
- * calendar/ea-calendar.c (ea_calendar_focus_watcher): add check for event atk object.
- * calendar/ea-week-view.c (ea_week_view_get_n_children): correct impl.
- (get_visible_text_item_count): removed.
-
-2003-12-06 JP Rosevear <jpr@ximian.com>
-
- * */Makefile.am: Remove hard coded disable deprecated flags
-
-2003-12-03 Ettore Perazzoli <ettore@ximian.com>
-
- * calendar/Makefile.am (SHELL_IDLS): Only get Evolution.idl.
-
-2003-11-11 Bolian Yin <bolian.yin@sun.com>
-
- Fixes #50538
-
- * new files:
- widgets/ea-calendar-cell.[hc]
-
- * widgets/ea-calendar-item: impl. atk selection and atk table interface.
-
- * widgets/Makefile.am : use shared object library (.so)
-
-2003-11-07 JP Rosevear <jpr@ximian.com>
-
- * calendar/Makefile.am (INCLUDES): don't include toplevel libical
-
-2003-11-07 JP Rosevear <jpr@ximian.com>
-
- * Handle some more renaming
-
-2003-11-07 JP Rosevear <jpr@ximian.com>
-
- * Reflect renaming of ECalView to ECalendarView
-
-2003-11-04 Bolian Yin <bolian.yin@sun.com>
-
- Fixes # 48509
-
- * new files:
- ea-cell-table.h ea-cell-table.c
- * calendar/Makefile.am: add entries for new files
- * calendar/New files added:
- ea-day-view-main-item.c ea-day-view-main-item.h
- ea-day-view-cell.c ea-day-view-cell.h
- * Add debug info and remove some non-C99 compilers warnings.
- * calendar/ea-cal-view: add action interface.
-
-2003-10-09 Jeffrey Stedfast <fejj@ximian.com>
-
- * calendar/Makefile.am: INCLUDE path fixes for changes made to
- libical build.
-
-2003-08-27 Bolian Yin <bolian.yin@sun.com>
-
- * Makefile.am: add widgets directory; move calendar idl stuff to
- calendar directory; stop make a single shared lib for whole a11y
- stuff.
-
- * ea-factory.h: make factory macros available to GOBJECT
-
- * calendar/Makefile.am: add calendar idl stuff
-
- * calendar/ea-cal-view-event.c: add atkcomponent interface.
-
- * calendar/ea-gnome-calendar.c (ea_gcal_switch_view_cb): add
- details for "children_changed".
-
- * new widgets directory for widgets a11y stuff, new files are:
- widgets/Makefile.am, widgets/ea-calendar-item.c,
- widgets/ea-calendar-item.h, widgets/ea-widgets.c,
- widgets/ea-widgets.h
-
-2003-08-20 Rodrigo Moya <rodrigo@ximian.com>
-
- * calendar/ea-cal-view-event.c (ea_cal_view_event_get_name):
- adapted to changes in ECalViewEvent.
-
-2003-08-20 Bolian Yin <bolian.yin@sun.com>
- setup the a11y directory for evolution accessibility work
- New files are:
- ChangeLog
- ea-factory.h
- Makefile.am
- calendar/ea-calendar.c
- calendar/ea-calendar.h
- calendar/ea-calendar-helpers.c
- calendar/ea-calendar-helpers.h
- calendar/ea-cal-view.c
- calendar/ea-cal-view.h
- calendar/ea-cal-view-event.c
- calendar/ea-cal-view-event.h
- calendar/ea-day-view.c
- calendar/ea-day-view.h
- calendar/ea-week-view.c
- calendar/ea-week-view.h
- calendar/ea-gnome-calendar.c
- calendar/ea-gnome-calendar.h
- calendar/Makefile.am
diff --git a/a11y/Makefile.am b/a11y/Makefile.am
deleted file mode 100644
index c3e7a89fed..0000000000
--- a/a11y/Makefile.am
+++ /dev/null
@@ -1,16 +0,0 @@
-SUBDIRS = . calendar widgets
-
-# for debug
-#A11Y_CFLAGS += -pedantic -ansi -DACC_DEBUG -Werror
-
-privlib_LTLIBRARIES = libevolution-a11y.la
-
-INCLUDES = \
- -I$(top_srcdir)/a11y \
- $(A11Y_CFLAGS)
-
-libevolution_a11y_la_SOURCES = \
- ea-factory.h \
- ea-cell-table.h \
- ea-cell-table.c
-
diff --git a/a11y/calendar/.cvsignore b/a11y/calendar/.cvsignore
deleted file mode 100644
index 0e1e389af7..0000000000
--- a/a11y/calendar/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-Makefile
-Makefile.in
-Evolution-*.c
-Evolution.h
-evolution-calendar-*.c
-evolution-calendar.h
diff --git a/a11y/calendar/Makefile.am b/a11y/calendar/Makefile.am
deleted file mode 100644
index 0c4aba11a0..0000000000
--- a/a11y/calendar/Makefile.am
+++ /dev/null
@@ -1,78 +0,0 @@
-# Calendar IDL files
-
-# for debug
-#A11Y_CFLAGS += -pedantic -ansi -DACC_DEBUG -Werror
-
-CALENDAR_IDLS = $(top_srcdir)/calendar/idl/evolution-calendar.idl
-SHELL_IDLS = \
- $(top_srcdir)/shell/Evolution.idl
-
-CALENDAR_IDL_GENERATED_H = evolution-calendar.h
-CALENDAR_IDL_GENERATED_C = \
- evolution-calendar-common.c \
- evolution-calendar-skels.c \
- evolution-calendar-stubs.c
-
-SHELL_IDL_GENERATED_H = Evolution.h
-SHELL_IDL_GENERATED_C = \
- Evolution-common.c \
- Evolution-skels.c \
- Evolution-stubs.c
-
-$(CALENDAR_IDL_GENERATED_H): $(CALENDAR_IDLS)
- $(ORBIT_IDL) -I $(srcdir) $(IDL_INCLUDES) \
- $(top_srcdir)/calendar/idl/evolution-calendar.idl
-
-$(SHELL_IDL_GENERATED_H): $(SHELL_IDLS)
- $(ORBIT_IDL) -I $(srcdir) $(IDL_INCLUDES) \
- $(top_srcdir)/shell/Evolution.idl
-
-IDL_GENERATED = $(SHELL_IDL_GENERATED_H) $(CALENDAR_IDL_GENERATED_H)
-BUILT_SOURCES = $(IDL_GENERATED)
-CLEANFILES = $(BUILT_SOURCES) $(CALENDAR_IDL_GENERATED_C) $(SHELL_IDL_GENERATED_C)
-
-privlib_LTLIBRARIES = libevolution-calendar-a11y.la
-
-INCLUDES = \
- -DG_LOG_DOMAIN=\"evolution-a11y\" \
- -I$(top_srcdir)/shell \
- -I$(top_srcdir)/calendar \
- -I$(top_srcdir)/calendar/cal-client \
- -I$(top_srcdir)/calendar/gui \
- -I$(top_srcdir)/widgets \
- -I$(top_srcdir)/a11y \
- -DEVOLUTION_DATADIR=\""$(datadir)"\" \
- -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \
- -DEVOLUTION_ETSPECDIR=\""$(etspecdir)"\" \
- -DEVOLUTION_IMAGESDIR=\""$(imagesdir)"\" \
- -DEVOLUTION_GALVIEWSDIR=\""$(viewsdir)"\" \
- -DEVOLUTION_UIDIR=\""$(evolutionuidir)"\" \
- -DPREFIX=\""$(prefix)"\" \
- $(A11Y_CFLAGS) \
- $(EVOLUTION_CALENDAR_CFLAGS)
-
-libevolution_calendar_a11y_la_SOURCES = \
- $(CALENDAR_IDL_GENERATED_H) \
- $(SHELL_IDL_GENERATED_H) \
- ea-calendar.c \
- ea-calendar.h \
- ea-calendar-helpers.c \
- ea-calendar-helpers.h \
- ea-cal-view.c \
- ea-cal-view.h \
- ea-cal-view-event.c \
- ea-cal-view-event.h \
- ea-day-view.c \
- ea-day-view.h \
- ea-day-view-main-item.c \
- ea-day-view-main-item.h \
- ea-day-view-cell.c \
- ea-day-view-cell.h \
- ea-week-view.c \
- ea-week-view.h \
- ea-gnome-calendar.c \
- ea-gnome-calendar.h
-
-libevolution_calendar_a11y_la_LIBADD = \
- $(top_builddir)/a11y/libevolution-a11y.la
-
diff --git a/a11y/calendar/ea-cal-view-event.c b/a11y/calendar/ea-cal-view-event.c
deleted file mode 100644
index 37b0d5ed90..0000000000
--- a/a11y/calendar/ea-cal-view-event.c
+++ /dev/null
@@ -1,479 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* vim:expandtab:shiftwidth=8:tabstop=8:
- */
-/* Evolution Accessibility: ea-cal-view-event.c
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Bolian Yin <bolian.yin@sun.com> Sun Microsystem Inc., 2003
- *
- */
-
-#include "ea-cal-view-event.h"
-#include "ea-calendar-helpers.h"
-#include "ea-day-view.h"
-#include "ea-week-view.h"
-#include <gal/e-text/e-text.h>
-
-static void ea_cal_view_event_class_init (EaCalViewEventClass *klass);
-
-static G_CONST_RETURN gchar* ea_cal_view_event_get_name (AtkObject *accessible);
-static G_CONST_RETURN gchar* ea_cal_view_event_get_description (AtkObject *accessible);
-static AtkObject* ea_cal_view_event_get_parent (AtkObject *accessible);
-static gint ea_cal_view_event_get_index_in_parent (AtkObject *accessible);
-
-/* component interface */
-static void atk_component_interface_init (AtkComponentIface *iface);
-static void ea_cal_view_get_extents (AtkComponent *component,
- gint *x, gint *y, gint *width, gint *height,
- AtkCoordType coord_type);
-
-#ifdef ACC_DEBUG
-static gint n_ea_cal_view_event_created = 0, n_ea_cal_view_event_destroyed = 0;
-static void ea_cal_view_finalize (GObject *object);
-#endif
-
-static gpointer parent_class = NULL;
-
-GType
-ea_cal_view_event_get_type (void)
-{
- static GType type = 0;
- AtkObjectFactory *factory;
- GTypeQuery query;
- GType derived_atk_type;
-
-
- if (!type) {
- static GTypeInfo tinfo = {
- sizeof (EaCalViewEventClass),
- (GBaseInitFunc) NULL, /* base init */
- (GBaseFinalizeFunc) NULL, /* base finalize */
- (GClassInitFunc) ea_cal_view_event_class_init, /* class init */
- (GClassFinalizeFunc) NULL, /* class finalize */
- NULL, /* class data */
- sizeof (EaCalViewEvent), /* instance size */
- 0, /* nb preallocs */
- (GInstanceInitFunc) NULL, /* instance init */
- NULL /* value table */
- };
-
- static const GInterfaceInfo atk_component_info = {
- (GInterfaceInitFunc) atk_component_interface_init,
- (GInterfaceFinalizeFunc) NULL,
- NULL
- };
-
- /*
- * Figure out the size of the class and instance
- * we are run-time deriving from (atk object for E_TEXT, in this case)
- */
-
- factory = atk_registry_get_factory (atk_get_default_registry (),
- E_TYPE_TEXT);
- derived_atk_type = atk_object_factory_get_accessible_type (factory);
- g_type_query (derived_atk_type, &query);
-
- tinfo.class_size = query.class_size;
- tinfo.instance_size = query.instance_size;
-
- /* we inherit the component, text and other interfaces from E_TEXT */
- type = g_type_register_static (derived_atk_type,
- "EaCalViewEvent", &tinfo, 0);
- g_type_add_interface_static (type, ATK_TYPE_COMPONENT,
- &atk_component_info);
- }
-
- return type;
-}
-
-static void
-ea_cal_view_event_class_init (EaCalViewEventClass *klass)
-{
- AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
-#ifdef ACC_DEBUG
- GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- gobject_class->finalize = ea_cal_view_finalize;
-#endif
-
- parent_class = g_type_class_peek_parent (klass);
-
-
- class->get_name = ea_cal_view_event_get_name;
- class->get_description = ea_cal_view_event_get_description;
- class->get_parent = ea_cal_view_event_get_parent;
- class->get_index_in_parent = ea_cal_view_event_get_index_in_parent;
-
-}
-
-#ifdef ACC_DEBUG
-static void ea_cal_view_finalize (GObject *object)
-{
- ++n_ea_cal_view_event_destroyed;
- printf ("ACC_DEBUG: n_ea_cal_view_event_destroyed = %d\n",
- n_ea_cal_view_event_destroyed);
-}
-#endif
-
-AtkObject*
-ea_cal_view_event_new (GObject *obj)
-{
- AtkObject *atk_obj = NULL;
- GObject *target_obj;
- ECalendarView *cal_view;
-
- g_return_val_if_fail (E_IS_TEXT (obj), NULL);
- cal_view = ea_calendar_helpers_get_cal_view_from (GNOME_CANVAS_ITEM (obj));
- if (!cal_view)
- return NULL;
-
- if (E_IS_WEEK_VIEW (cal_view)) {
- gint event_num, span_num;
- EWeekViewEvent *week_view_event;
- EWeekViewEventSpan *event_span;
- EWeekView *week_view = E_WEEK_VIEW (cal_view);
-
- /* for week view, we need to check if a atkobject exists for
- * the first span of the same event
- */
- if (!e_week_view_find_event_from_item (week_view,
- GNOME_CANVAS_ITEM (obj),
- &event_num,
- &span_num))
- return NULL;
- week_view_event = &g_array_index (week_view->events,
- EWeekViewEvent,
- event_num);
- /* get the first span */
- event_span = &g_array_index (week_view->spans,
- EWeekViewEventSpan,
- week_view_event->spans_index);
- target_obj = G_OBJECT (event_span->text_item);
- atk_obj = g_object_get_data (target_obj, "accessible-object");
-
- }
- else
- target_obj = obj;
-
- if (!atk_obj) {
- static AtkRole event_role = ATK_ROLE_INVALID;
- atk_obj = ATK_OBJECT (g_object_new (EA_TYPE_CAL_VIEW_EVENT,
- NULL));
- atk_object_initialize (atk_obj, target_obj);
- if (event_role == ATK_ROLE_INVALID)
- event_role = atk_role_register ("Calendar Event");
- atk_obj->role = event_role;
-#ifdef ACC_DEBUG
- ++n_ea_cal_view_event_created;
- printf ("ACC_DEBUG: n_ea_cal_view_event_created = %d\n",
- n_ea_cal_view_event_created);
-#endif
- }
-
- /* the registered factory for E_TEXT is cannot create a EaCalViewEvent,
- * we should save the EaCalViewEvent object in it.
- */
- g_object_set_data (obj, "accessible-object", atk_obj);
-
- return atk_obj;
-}
-
-static G_CONST_RETURN gchar*
-ea_cal_view_event_get_name (AtkObject *accessible)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- ECalendarViewEvent *event;
- gchar *tmp_name;
- gchar *new_name = g_strdup ("");
- const char *summary;
-
-
- g_return_val_if_fail (EA_IS_CAL_VIEW_EVENT (accessible), NULL);
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (accessible);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj || !E_IS_TEXT (g_obj))
- return NULL;
- event = ea_calendar_helpers_get_cal_view_event_from (GNOME_CANVAS_ITEM(g_obj));
-
- if (event && event->comp_data) {
- if (e_cal_util_component_has_alarms (event->comp_data->icalcomp)) {
- tmp_name = new_name;
- new_name = g_strconcat (new_name, "alarm ", NULL);
- g_free (tmp_name);
- }
-
- if (e_cal_util_component_has_recurrences (event->comp_data->icalcomp)) {
- tmp_name = new_name;
- new_name = g_strconcat (new_name, "recurrence ", NULL);
- g_free (tmp_name);
- }
-
- if (event->different_timezone) {
- tmp_name = new_name;
- new_name = g_strconcat (new_name, "time-zone ", NULL);
- g_free (tmp_name);
- }
-
- if (e_cal_util_component_has_organizer (event->comp_data->icalcomp)) {
- tmp_name = new_name;
- new_name = g_strconcat (new_name, "meeting ", NULL);
- g_free (tmp_name);
- }
- }
- tmp_name = new_name;
- new_name = g_strconcat (new_name, "event. Summary is ", NULL);
- g_free (tmp_name);
-
- summary = icalcomponent_get_summary (event->comp_data->icalcomp);
- if (summary) {
- tmp_name = new_name;
- new_name = g_strconcat (new_name, summary, NULL);
- g_free (tmp_name);
- }
- else {
- tmp_name = new_name;
- new_name = g_strconcat (new_name, "empty", NULL);
- g_free (tmp_name);
- }
-
- ATK_OBJECT_CLASS (parent_class)->set_name (accessible, new_name);
-#ifdef ACC_DEBUG
- printf("EvoAcc: name for event accobj=%p, is %s\n",
- (void *)accessible, new_name);
-#endif
- g_free (new_name);
- return accessible->name;
-}
-
-static G_CONST_RETURN gchar*
-ea_cal_view_event_get_description (AtkObject *accessible)
-{
- if (accessible->description)
- return accessible->description;
-
- return "calendar view event";
-}
-
-static AtkObject *
-ea_cal_view_event_get_parent (AtkObject *accessible)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- GnomeCanvasItem *canvas_item;
- ECalendarView *cal_view;
-
- g_return_val_if_fail (EA_IS_CAL_VIEW_EVENT (accessible), NULL);
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (accessible);
-
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (g_obj == NULL)
- /* Object is defunct */
- return NULL;
- canvas_item = GNOME_CANVAS_ITEM (g_obj);
-
- cal_view = ea_calendar_helpers_get_cal_view_from (canvas_item);
-
- if (!cal_view)
- return NULL;
-
- return gtk_widget_get_accessible (GTK_WIDGET (cal_view));
-}
-
-static gint
-ea_cal_view_event_get_index_in_parent (AtkObject *accessible)
-{
- GObject *g_obj;
- GnomeCanvasItem *canvas_item;
- ECalendarView *cal_view;
- ECalendarViewEvent *cal_view_event;
-
- g_return_val_if_fail (EA_IS_CAL_VIEW_EVENT (accessible), -1);
- g_obj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE(accessible));
- if (!g_obj)
- /* defunct object*/
- return -1;
-
- canvas_item = GNOME_CANVAS_ITEM (g_obj);
- cal_view = ea_calendar_helpers_get_cal_view_from (canvas_item);
- if (!cal_view)
- return -1;
-
- cal_view_event = ea_calendar_helpers_get_cal_view_event_from (canvas_item);
- if (!cal_view_event)
- return -1;
-
- if (E_IS_DAY_VIEW (cal_view)) {
- gint day, event_num, num_before;
- EDayViewEvent *day_view_event;
- EDayView *day_view = E_DAY_VIEW (cal_view);
-
- /* the long event comes first in the order */
- for (event_num = day_view->long_events->len - 1; event_num >= 0;
- --event_num) {
- day_view_event = &g_array_index (day_view->long_events,
- EDayViewEvent, event_num);
- if (cal_view_event == (ECalendarViewEvent*)day_view_event)
- return event_num;
-
- }
- num_before = day_view->long_events->len;
-
- for (day = 0; day < day_view->days_shown; ++day) {
- for (event_num = day_view->events[day]->len - 1; event_num >= 0;
- --event_num) {
- day_view_event = &g_array_index (day_view->events[day],
- EDayViewEvent, event_num);
- if (cal_view_event == (ECalendarViewEvent*)day_view_event)
- return num_before + event_num;
- }
- num_before += day_view->events[day]->len;
- }
- }
- else if (E_IS_WEEK_VIEW (cal_view)) {
- gint index;
- EWeekViewEvent *week_view_event;
- EWeekView *week_view = E_WEEK_VIEW (cal_view);
-
- for (index = week_view->events->len - 1; index >= 0; --index) {
- week_view_event = &g_array_index (week_view->events,
- EWeekViewEvent, index);
- if (cal_view_event == (ECalendarViewEvent*)week_view_event)
- return index;
- }
- }
- else {
- g_assert_not_reached ();
- return -1;
- }
- return -1;
-}
-
-/* Atk Component Interface */
-
-static void
-atk_component_interface_init (AtkComponentIface *iface)
-{
- g_return_if_fail (iface != NULL);
-
- iface->get_extents = ea_cal_view_get_extents;
-}
-
-static void
-ea_cal_view_get_extents (AtkComponent *component,
- gint *x,
- gint *y,
- gint *width,
- gint *height,
- AtkCoordType coord_type)
-{
- GObject *g_obj;
- GnomeCanvasItem *canvas_item;
- gint x_window, y_window;
- gint scroll_x, scroll_y;
- ECalendarView *cal_view;
- gint item_x, item_y, item_w, item_h;
- GtkWidget *canvas = NULL;
-
- g_return_if_fail (EA_IS_CAL_VIEW_EVENT (component));
-
- g_obj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE(component));
- if (!g_obj)
- /* defunct object*/
- return;
- g_return_if_fail (E_IS_TEXT (g_obj));
-
- canvas_item = GNOME_CANVAS_ITEM (g_obj);
- cal_view = ea_calendar_helpers_get_cal_view_from (canvas_item);
- if (!cal_view)
- return;
-
- if (E_IS_DAY_VIEW (cal_view)) {
- gint day, event_num;
-
- if (!e_day_view_find_event_from_item (E_DAY_VIEW (cal_view),
- canvas_item,
- &day, &event_num))
- return;
- if (day == E_DAY_VIEW_LONG_EVENT) {
- gint start_day, end_day;
- if (!e_day_view_get_long_event_position (E_DAY_VIEW (cal_view),
- event_num,
- &start_day,
- &end_day,
- &item_x,
- &item_y,
- &item_w,
- &item_h))
- return;
- canvas = E_DAY_VIEW (cal_view)->top_canvas;
- }
- else {
- if (!e_day_view_get_event_position (E_DAY_VIEW (cal_view), day,
- event_num,
- &item_x, &item_y,
- &item_w, &item_h))
-
- return;
- canvas = E_DAY_VIEW (cal_view)->main_canvas;
- }
- }
- else if (E_IS_WEEK_VIEW (cal_view)) {
- gint event_num, span_num;
- if (!e_week_view_find_event_from_item (E_WEEK_VIEW (cal_view),
- canvas_item, &event_num,
- &span_num))
- return;
-
- if (!e_week_view_get_span_position (E_WEEK_VIEW (cal_view),
- event_num, span_num,
- &item_x, &item_y, &item_w))
- return;
- item_h = E_WEEK_VIEW_ICON_HEIGHT;
- canvas = E_WEEK_VIEW (cal_view)->main_canvas;
- }
- else
- return;
-
- if (!canvas)
- return;
-
- gdk_window_get_origin (canvas->window,
- &x_window, &y_window);
- gnome_canvas_get_scroll_offsets (GNOME_CANVAS (canvas), &scroll_x, &scroll_y);
-
- *x = item_x + x_window - scroll_x;
- *y = item_y + y_window - scroll_y;
- *width = item_w;
- *height = item_h;
-
- if (coord_type == ATK_XY_WINDOW) {
- GdkWindow *window;
- gint x_toplevel, y_toplevel;
-
- window = gdk_window_get_toplevel (GTK_WIDGET (cal_view)->window);
- gdk_window_get_origin (window, &x_toplevel, &y_toplevel);
-
- *x -= x_toplevel;
- *y -= y_toplevel;
- }
-
-#ifdef ACC_DEBUG
- printf ("Event Bounds (%d, %d, %d, %d)\n", *x, *y, *width, *height);
-#endif
-}
diff --git a/a11y/calendar/ea-cal-view-event.h b/a11y/calendar/ea-cal-view-event.h
deleted file mode 100644
index f139dde9fb..0000000000
--- a/a11y/calendar/ea-cal-view-event.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* vim:expandtab:shiftwidth=8:tabstop=8:
- */
-/* Evolution Accessibility: ea-cal-view-event.h
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Bolian Yin <bolian.yin@sun.com> Sun Microsystem Inc., 2003
- *
- */
-
-#ifndef __EA_CAL_VIEW_EVENT_H__
-#define __EA_CAL_VIEW_EVENT_H__
-
-#include <atk/atkgobjectaccessible.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define EA_TYPE_CAL_VIEW_EVENT (ea_cal_view_event_get_type ())
-#define EA_CAL_VIEW_EVENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EA_TYPE_CAL_VIEW_EVENT, EaCalViewEvent))
-#define EA_CAL_VIEW_EVENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EA_TYPE_CAL_VIEW_EVENT, EaCalViewEventClass))
-#define EA_IS_CAL_VIEW_EVENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EA_TYPE_CAL_VIEW_EVENT))
-#define EA_IS_CAL_VIEW_EVENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EA_TYPE_CAL_VIEW_EVENT))
-#define EA_CAL_VIEW_EVENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EA_TYPE_CAL_VIEW_EVENT, EaCalViewEventClass))
-
-typedef struct _EaCalViewEvent EaCalViewEvent;
-typedef struct _EaCalViewEventClass EaCalViewEventClass;
-
-struct _EaCalViewEvent
-{
- AtkGObjectAccessible parent;
-};
-
-GType ea_cal_view_event_get_type (void);
-
-struct _EaCalViewEventClass
-{
- AtkGObjectAccessibleClass parent_class;
-};
-
-AtkObject *ea_cal_view_event_new (GObject *obj);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* __EA_CAL_VIEW_EVENT_H__ */
diff --git a/a11y/calendar/ea-cal-view.c b/a11y/calendar/ea-cal-view.c
deleted file mode 100644
index 2d86d9ef10..0000000000
--- a/a11y/calendar/ea-cal-view.c
+++ /dev/null
@@ -1,440 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* vim:expandtab:shiftwidth=8:tabstop=8:
- */
-/* Evolution Accessibility: ea-cal-view.c
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Bolian Yin <bolian.yin@sun.com> Sun Microsystem Inc., 2003
- *
- */
-
-#include "ea-cal-view.h"
-#include "ea-calendar-helpers.h"
-#include "e-day-view.h"
-#include "e-week-view.h"
-#include "calendar-commands.h"
-#include "goto.h"
-#include <glib/gstrfuncs.h>
-
-static void ea_cal_view_class_init (EaCalViewClass *klass);
-
-static AtkObject* ea_cal_view_get_parent (AtkObject *accessible);
-static void ea_cal_view_real_initialize (AtkObject *accessible, gpointer data);
-
-static void ea_cal_view_event_changed_cb (ECalendarView *cal_view,
- ECalendarViewEvent *event, gpointer data);
-static void ea_cal_view_event_added_cb (ECalendarView *cal_view,
- ECalendarViewEvent *event, gpointer data);
-
-static gboolean idle_dates_changed (gpointer data);
-static void ea_cal_view_dates_change_cb (GnomeCalendar *gcal, gpointer data);
-
-static void atk_action_interface_init (AtkActionIface *iface);
-static gboolean action_interface_do_action (AtkAction *action, gint i);
-static gint action_interface_get_n_actions (AtkAction *action);
-static G_CONST_RETURN gchar*
-action_interface_get_description(AtkAction *action, gint i);
-static G_CONST_RETURN gchar*
-action_interface_get_keybinding (AtkAction *action, gint i);
-static G_CONST_RETURN gchar*
-action_interface_action_get_name(AtkAction *action, gint i);
-
-static gpointer parent_class = NULL;
-
-GType
-ea_cal_view_get_type (void)
-{
- static GType type = 0;
- AtkObjectFactory *factory;
- GTypeQuery query;
- GType derived_atk_type;
-
- if (!type) {
- static GTypeInfo tinfo = {
- sizeof (EaCalViewClass),
- (GBaseInitFunc) NULL, /* base init */
- (GBaseFinalizeFunc) NULL, /* base finalize */
- (GClassInitFunc) ea_cal_view_class_init, /* class init */
- (GClassFinalizeFunc) NULL, /* class finalize */
- NULL, /* class data */
- sizeof (EaCalView), /* instance size */
- 0, /* nb preallocs */
- (GInstanceInitFunc) NULL, /* instance init */
- NULL /* value table */
- };
-
- static const GInterfaceInfo atk_action_info = {
- (GInterfaceInitFunc) atk_action_interface_init,
- (GInterfaceFinalizeFunc) NULL,
- NULL
- };
-
- /*
- * Figure out the size of the class and instance
- * we are run-time deriving from (GailWidget, in this case)
- */
-
- factory = atk_registry_get_factory (atk_get_default_registry (),
- GTK_TYPE_WIDGET);
- derived_atk_type = atk_object_factory_get_accessible_type (factory);
- g_type_query (derived_atk_type, &query);
-
- tinfo.class_size = query.class_size;
- tinfo.instance_size = query.instance_size;
-
- type = g_type_register_static (derived_atk_type,
- "EaCalView", &tinfo, 0);
- g_type_add_interface_static (type, ATK_TYPE_ACTION,
- &atk_action_info);
- }
-
- return type;
-}
-
-static void
-ea_cal_view_class_init (EaCalViewClass *klass)
-{
- AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_peek_parent (klass);
-
- class->get_parent = ea_cal_view_get_parent;
- class->initialize = ea_cal_view_real_initialize;
-}
-
-AtkObject*
-ea_cal_view_new (GtkWidget *widget)
-{
- GObject *object;
- AtkObject *accessible;
-
- g_return_val_if_fail (E_IS_CALENDAR_VIEW (widget), NULL);
-
- object = g_object_new (EA_TYPE_CAL_VIEW, NULL);
-
- accessible = ATK_OBJECT (object);
- atk_object_initialize (accessible, widget);
-
- return accessible;
-}
-
-static void
-ea_cal_view_real_initialize (AtkObject *accessible, gpointer data)
-{
- ECalendarView *cal_view;
- GnomeCalendar *gcal;
- static AtkRole role = ATK_ROLE_INVALID;
-
- g_return_if_fail (EA_IS_CAL_VIEW (accessible));
- g_return_if_fail (E_IS_CALENDAR_VIEW (data));
-
- ATK_OBJECT_CLASS (parent_class)->initialize (accessible, data);
- if (role == ATK_ROLE_INVALID)
- role = atk_role_register ("Calendar View");
- accessible->role = role;
- cal_view = E_CALENDAR_VIEW (data);
-
- /* add listener for event_changed, event_added
- * we don't need to listen on event_removed. When the e_text
- * of the event is removed, the cal_view_event will go to the state
- * of "defunct" (changed by weak ref callback of atkgobjectaccessible
- */
- g_signal_connect (G_OBJECT(cal_view), "event_changed",
- G_CALLBACK (ea_cal_view_event_changed_cb), NULL);
- g_signal_connect (G_OBJECT(cal_view), "event_added",
- G_CALLBACK (ea_cal_view_event_added_cb), NULL);
-
- /* listen for date changes of calendar */
- gcal = e_calendar_view_get_calendar (cal_view);
-
- if (gcal)
- g_signal_connect (gcal, "dates_shown_changed",
- G_CALLBACK (ea_cal_view_dates_change_cb),
- accessible);
-}
-
-static AtkObject*
-ea_cal_view_get_parent (AtkObject *accessible)
-{
- ECalendarView *cal_view;
- GnomeCalendar *gnomeCalendar;
-
- g_return_val_if_fail (EA_IS_CAL_VIEW (accessible), NULL);
-
- if (!GTK_ACCESSIBLE (accessible)->widget)
- return NULL;
- cal_view = E_CALENDAR_VIEW (GTK_ACCESSIBLE (accessible)->widget);
-
- gnomeCalendar = e_calendar_view_get_calendar (cal_view);
-
- return gtk_widget_get_accessible (GTK_WIDGET(gnomeCalendar));
-}
-
-static void
-ea_cal_view_event_changed_cb (ECalendarView *cal_view, ECalendarViewEvent *event,
- gpointer data)
-{
- AtkObject *atk_obj;
- EaCalView *ea_cal_view;
- AtkObject *event_atk_obj = NULL;
-
- g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
-
- atk_obj = gtk_widget_get_accessible (GTK_WIDGET(cal_view));
- if (!EA_IS_CAL_VIEW (atk_obj))
- return;
- ea_cal_view = EA_CAL_VIEW (atk_obj);
-
- if ((E_IS_DAY_VIEW (cal_view)) && event && event->canvas_item) {
- event_atk_obj =
- ea_calendar_helpers_get_accessible_for (event->canvas_item);
- }
- else if ((E_IS_WEEK_VIEW (cal_view)) && event) {
- EWeekViewEventSpan *span;
- EWeekViewEvent *week_view_event = (EWeekViewEvent *)event;
- EWeekView *week_view = E_WEEK_VIEW (cal_view);
- /* get the first span of the event */
- span = &g_array_index (week_view->spans, EWeekViewEventSpan,
- week_view_event->spans_index);
- if (span && span->text_item)
- event_atk_obj = ea_calendar_helpers_get_accessible_for (span->text_item);
- }
- if (event_atk_obj) {
-#ifdef ACC_DEBUG
- printf ("AccDebug: event=%p changed\n", (void *)event);
-#endif
- g_object_notify (G_OBJECT(event_atk_obj), "accessible-name");
- g_signal_emit_by_name (event_atk_obj, "visible_data_changed");
- }
-
-}
-
-static void
-ea_cal_view_event_added_cb (ECalendarView *cal_view, ECalendarViewEvent *event,
- gpointer data)
-{
- AtkObject *atk_obj;
- EaCalView *ea_cal_view;
- AtkObject *event_atk_obj = NULL;
- gint index;
-
- g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
-
- atk_obj = gtk_widget_get_accessible (GTK_WIDGET(cal_view));
- if (!EA_IS_CAL_VIEW (atk_obj))
- return;
- ea_cal_view = EA_CAL_VIEW (atk_obj);
-
- if ((E_IS_DAY_VIEW (cal_view)) && event && event->canvas_item) {
- event_atk_obj =
- ea_calendar_helpers_get_accessible_for (event->canvas_item);
- }
- else if ((E_IS_WEEK_VIEW (cal_view)) && event) {
- EWeekViewEventSpan *span;
- EWeekViewEvent *week_view_event = (EWeekViewEvent *)event;
- EWeekView *week_view = E_WEEK_VIEW (cal_view);
- /* get the first span of the event */
- span = &g_array_index (week_view->spans, EWeekViewEventSpan,
- week_view_event->spans_index);
- if (span && span->text_item)
- event_atk_obj = ea_calendar_helpers_get_accessible_for (span->text_item);
-
- }
- if (event_atk_obj) {
- index = atk_object_get_index_in_parent (event_atk_obj);
- if (index < 0)
- return;
-#ifdef ACC_DEBUG
- printf ("AccDebug: event=%p added\n", (void *)event);
-#endif
- g_signal_emit_by_name (atk_obj, "children_changed::add",
- index, event_atk_obj, NULL);
- }
-}
-
-static gboolean
-idle_dates_changed (gpointer data)
-{
- AtkObject *ea_cal_view;
-
- g_return_val_if_fail (data, FALSE);
- g_return_val_if_fail (EA_IS_CAL_VIEW (data), FALSE);
-
- ea_cal_view = ATK_OBJECT(data);
-
- if (ea_cal_view->name) {
- g_free (ea_cal_view->name);
- ea_cal_view->name = NULL;
- }
- g_object_notify (G_OBJECT (ea_cal_view), "accessible-name");
- g_signal_emit_by_name (ea_cal_view, "visible_data_changed");
- g_signal_emit_by_name (ea_cal_view, "children_changed", NULL);
-#ifdef ACC_DEBUG
- printf ("AccDebug: cal view date changed\n");
-#endif
-
- return FALSE;
-}
-
-static void
-ea_cal_view_dates_change_cb (GnomeCalendar *gcal, gpointer data)
-{
- g_idle_add (idle_dates_changed, data);
-}
-
-/* atk action interface */
-
-#define CAL_VIEW_ACTION_NUM 5
-
-static const char * action_name [CAL_VIEW_ACTION_NUM] = {
- "New Appointment",
- "New All Day Event",
- "New Meeting",
- "Go to Today",
- "Go to Date"
-};
-
-static void
-atk_action_interface_init (AtkActionIface *iface)
-{
- g_return_if_fail (iface != NULL);
-
- iface->do_action = action_interface_do_action;
- iface->get_n_actions = action_interface_get_n_actions;
- iface->get_description = action_interface_get_description;
- iface->get_keybinding = action_interface_get_keybinding;
- iface->get_name = action_interface_action_get_name;
-}
-
-static gboolean
-action_interface_do_action (AtkAction *action, gint index)
-{
- GtkWidget *widget;
- gboolean return_value = TRUE;
- time_t dtstart, dtend;
- ECalendarView *cal_view;
-
- widget = GTK_ACCESSIBLE (action)->widget;
- if (widget == NULL)
- /*
- * State is defunct
- */
- return FALSE;
-
- if (!GTK_WIDGET_IS_SENSITIVE (widget) || !GTK_WIDGET_VISIBLE (widget))
- return FALSE;
-
- cal_view = E_CALENDAR_VIEW (widget);
- switch (index) {
- case 0:
- /* New Appointment */
- e_calendar_view_new_appointment (cal_view);
- break;
- case 1:
- /* New All Day Event */
- e_calendar_view_get_selected_time_range (cal_view,
- &dtstart, &dtend);
- e_calendar_view_new_appointment_for (cal_view,
- dtstart, dtend, TRUE, FALSE);
- break;
- case 2:
- /* New Meeting */
- e_calendar_view_get_selected_time_range (cal_view,
- &dtstart, &dtend);
- e_calendar_view_new_appointment_for (cal_view,
- dtstart, dtend, FALSE, TRUE);
- break;
- case 3:
- /* Go to today */
- break;
- calendar_goto_today (e_calendar_view_get_calendar (cal_view));
- case 4:
- /* Go to date */
- goto_dialog (e_calendar_view_get_calendar (cal_view));
- break;
- default:
- return_value = FALSE;
- break;
- }
- return return_value;
-}
-
-static gint
-action_interface_get_n_actions (AtkAction *action)
-{
- return CAL_VIEW_ACTION_NUM;
-}
-
-static G_CONST_RETURN gchar*
-action_interface_get_description(AtkAction *action, gint index)
-{
- return action_interface_action_get_name (action, index);
-}
-
-static G_CONST_RETURN gchar*
-action_interface_get_keybinding (AtkAction *action, gint index)
-{
- GtkWidget *widget;
- EaCalView *ea_cal_view;
-
- widget = GTK_ACCESSIBLE (action)->widget;
- if (widget == NULL)
- /*
- * State is defunct
- */
- return NULL;
-
- if (!GTK_WIDGET_IS_SENSITIVE (widget) || !GTK_WIDGET_VISIBLE (widget))
- return FALSE;
-
- ea_cal_view = EA_CAL_VIEW (action);
-
- switch (index) {
- case 0:
- /* New Appointment */
- return "<Alt>fna;<Control>n";
- break;
- case 1:
- /* New Event */
- return "<Alt>fnd;<Shift><Control>d";
- break;
- case 2:
- /* New Meeting */
- return "<Alt>fne;<Shift><Control>e";
- break;
- case 3:
- /* Go to today */
- return "<Alt>vt;<Alt><Control>t";
- break;
- case 4:
- /* Go to date */
- return "<Alt>vd;<Alt><Control>g";
- break;
- default:
- break;
- }
- return NULL;
-}
-
-static G_CONST_RETURN gchar*
-action_interface_action_get_name(AtkAction *action, gint i)
-{
- if (i >= 0 && i < CAL_VIEW_ACTION_NUM)
- return action_name [i];
- return NULL;
-}
diff --git a/a11y/calendar/ea-cal-view.h b/a11y/calendar/ea-cal-view.h
deleted file mode 100644
index 858aa497d4..0000000000
--- a/a11y/calendar/ea-cal-view.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* vim:expandtab:shiftwidth=8:tabstop=8:
- */
-/* Evolution Accessibility: ea-cal-view.h
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Bolian Yin <bolian.yin@sun.com> Sun Microsystem Inc., 2003
- *
- */
-
-#ifndef __EA_CAL_VIEW_H__
-#define __EA_CAL_VIEW_H__
-
-#include <gtk/gtkaccessible.h>
-#include "e-cal-view.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define EA_TYPE_CAL_VIEW (ea_cal_view_get_type ())
-#define EA_CAL_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EA_TYPE_CAL_VIEW, EaCalView))
-#define EA_CAL_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EA_TYPE_CAL_VIEW, EaCalViewClass))
-#define EA_IS_CAL_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EA_TYPE_CAL_VIEW))
-#define EA_IS_CAL_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EA_TYPE_CAL_VIEW))
-#define EA_CAL_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EA_TYPE_CAL_VIEW, EaCalViewClass))
-
-typedef struct _EaCalView EaCalView;
-typedef struct _EaCalViewClass EaCalViewClass;
-
-struct _EaCalView
-{
- GtkAccessible parent;
-};
-
-GType ea_cal_view_get_type (void);
-
-struct _EaCalViewClass
-{
- GtkAccessibleClass parent_class;
-};
-
-AtkObject* ea_cal_view_new (GtkWidget *widget);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __EA_CAL_VIEW_H__ */
diff --git a/a11y/calendar/ea-calendar-helpers.c b/a11y/calendar/ea-calendar-helpers.c
deleted file mode 100644
index 535265ebeb..0000000000
--- a/a11y/calendar/ea-calendar-helpers.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* vim:expandtab:shiftwidth=8:tabstop=8:
- */
-/* Evolution Accessibility: ea-calendar-helpers.c
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Bolian Yin <bolian.yin@sun.com> Sun Microsystem Inc., 2003
- *
- */
-
-#include "ea-calendar-helpers.h"
-#include "ea-cal-view-event.h"
-#include "e-day-view.h"
-#include "e-week-view.h"
-
-#include <gal/e-text/e-text.h>
-
-/**
- * ea_calendar_helpers_get_accessible_for
- * @canvas_item: the canvas item (e_text) for a event
- * @returns: the atk object for the canvas_item
- *
- **/
-AtkObject *
-ea_calendar_helpers_get_accessible_for (GnomeCanvasItem *canvas_item)
-{
- AtkObject *atk_obj = NULL;
- GObject *g_obj;
-
- g_return_val_if_fail (E_IS_TEXT (canvas_item), NULL);
-
- g_obj = G_OBJECT (canvas_item);
- /* we cannot use atk_gobject_accessible_for_object here,
- * EaDayViewEvent/EaWeekViewEvent cannot be created by the
- * registered facotry of E_TEXT
- */
- atk_obj = g_object_get_data (g_obj, "accessible-object");
- if (!atk_obj)
- atk_obj = ea_cal_view_event_new (g_obj);
- return atk_obj;
-}
-
-/**
- * ea_calendar_helpers_get_view_widget_from:
- * @canvas_item: the canvas item (e_text) for a event
- * @returns: the cal view widget if exists
- *
- * Get the cal view widget contains the canvas_item.
- *
- **/
-ECalendarView *
-ea_calendar_helpers_get_cal_view_from (GnomeCanvasItem *canvas_item)
-{
- GnomeCanvas *canvas;
- GtkWidget *view_widget = NULL;
-
- g_return_val_if_fail (canvas_item, NULL);
- g_return_val_if_fail (E_IS_TEXT (canvas_item), NULL);
-
- /* canvas_item is the e_text for the event */
- /* canvas_item->canvas is the ECanvas for day view */
- /* parent of canvas_item->canvas is the EDayView or EWeekView widget */
- canvas = canvas_item->canvas;
- view_widget = gtk_widget_get_parent (GTK_WIDGET(canvas));
- if (!view_widget || !E_IS_CALENDAR_VIEW (view_widget))
- return NULL;
- return E_CALENDAR_VIEW (view_widget);
-}
-
-/**
- * ea_calendar_helpers_get_cal_view_event_from
- * @canvas_item: the cavas_item (e_text) for the event
- * @returns: the ECalendarViewEvent
- *
- * Get the ECalendarViewEvent for the canvas_item.
- *
- **/
-ECalendarViewEvent *
-ea_calendar_helpers_get_cal_view_event_from (GnomeCanvasItem *canvas_item)
-{
- ECalendarView *cal_view;
- gboolean event_found;
- ECalendarViewEvent *cal_view_event;
-
- g_return_val_if_fail (E_IS_TEXT (canvas_item), NULL);
-
- cal_view = ea_calendar_helpers_get_cal_view_from (canvas_item);
-
- if (!cal_view)
- return NULL;
-
- if (E_IS_DAY_VIEW (cal_view)) {
- gint event_day, event_num;
- EDayViewEvent *day_view_event;
- EDayView *day_view = E_DAY_VIEW (cal_view);
- event_found = e_day_view_find_event_from_item (day_view, canvas_item,
- &event_day, &event_num);
- if (!event_found)
- return NULL;
- if (event_day == E_DAY_VIEW_LONG_EVENT) {
- /* a long event */
- day_view_event = &g_array_index (day_view->long_events,
- EDayViewEvent, event_num);
- }
- else {
- /* a main canvas event */
- day_view_event = &g_array_index (day_view->events[event_day],
- EDayViewEvent, event_num);
- }
- cal_view_event = (ECalendarViewEvent *) day_view_event;
- }
- else if (E_IS_WEEK_VIEW (cal_view)) {
- gint event_num, span_num;
- EWeekViewEvent *week_view_event;
- EWeekView *week_view = E_WEEK_VIEW (cal_view);
- event_found = e_week_view_find_event_from_item (week_view,
- canvas_item,
- &event_num,
- &span_num);
- if (!event_found)
- return NULL;
-
- week_view_event = &g_array_index (week_view->events, EWeekViewEvent,
- event_num);
-
- cal_view_event = (ECalendarViewEvent *)week_view_event;
- }
- else {
- g_assert_not_reached ();
- return NULL;
- }
- return cal_view_event;
-}
diff --git a/a11y/calendar/ea-calendar-helpers.h b/a11y/calendar/ea-calendar-helpers.h
deleted file mode 100644
index 50d997d91d..0000000000
--- a/a11y/calendar/ea-calendar-helpers.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* vim:expandtab:shiftwidth=8:tabstop=8:
- */
-/* Evolution Accessibility: ea-calendar-helpers.h
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Bolian Yin <bolian.yin@sun.com> Sun Microsystem Inc., 2003
- *
- */
-
-/* Evolution Accessibility
- */
-
-#ifndef _EA_CALENDAR_HELPERS_H__
-#define _EA_CALENDAR_HELPERS_H__
-
-#include "ea-cal-view.h"
-
-AtkObject *
-ea_calendar_helpers_get_accessible_for (GnomeCanvasItem *canvas_item);
-
-ECalendarView *
-ea_calendar_helpers_get_cal_view_from (GnomeCanvasItem *canvas_item);
-
-ECalendarViewEvent *
-ea_calendar_helpers_get_cal_view_event_from (GnomeCanvasItem *canvas_item);
-
-#endif /* _EA_CALENDAR_HELPERS_H__ */
diff --git a/a11y/calendar/ea-calendar.c b/a11y/calendar/ea-calendar.c
deleted file mode 100644
index bb528cb919..0000000000
--- a/a11y/calendar/ea-calendar.c
+++ /dev/null
@@ -1,151 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* vim:expandtab:shiftwidth=8:tabstop=8:
- */
-/* Evolution Accessibility: ea-calendar.c
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Bolian Yin <bolian.yin@sun.com> Sun Microsystem Inc., 2003
- *
- */
-
-#include <gal/e-text/e-text.h>
-#include "ea-calendar-helpers.h"
-#include "ea-factory.h"
-#include "ea-calendar.h"
-
-#include "calendar/ea-cal-view.h"
-#include "calendar/ea-cal-view-event.h"
-#include "calendar/ea-day-view.h"
-#include "calendar/ea-day-view-main-item.h"
-#include "calendar/ea-week-view.h"
-#include "calendar/ea-gnome-calendar.h"
-
-
-EA_FACTORY (EA_TYPE_CAL_VIEW, ea_cal_view, ea_cal_view_new)
-EA_FACTORY (EA_TYPE_DAY_VIEW, ea_day_view, ea_day_view_new)
-EA_FACTORY_GOBJECT (EA_TYPE_DAY_VIEW_MAIN_ITEM, ea_day_view_main_item, ea_day_view_main_item_new)
-EA_FACTORY (EA_TYPE_WEEK_VIEW, ea_week_view, ea_week_view_new)
-EA_FACTORY (EA_TYPE_GNOME_CALENDAR, ea_gnome_calendar, ea_gnome_calendar_new)
-
-static gboolean ea_calendar_focus_watcher (GSignalInvocationHint *ihint,
- guint n_param_values,
- const GValue *param_values,
- gpointer data);
-
-void
-gnome_calendar_a11y_init (void)
-{
- EA_SET_FACTORY (gnome_calendar_get_type(), ea_gnome_calendar);
- /* we only add focus watcher when accessibility is enabled
- */
- if (atk_get_root ()) {
- g_signal_add_emission_hook (g_signal_lookup ("event", E_TYPE_TEXT),
- 0, ea_calendar_focus_watcher,
- NULL, (GDestroyNotify) NULL);
- g_signal_add_emission_hook (g_signal_lookup ("event-after",
- e_day_view_get_type()),
- 0, ea_calendar_focus_watcher,
- NULL, (GDestroyNotify) NULL);
- g_signal_add_emission_hook (g_signal_lookup ("event",
- e_day_view_main_item_get_type()),
- 0, ea_calendar_focus_watcher,
- NULL, (GDestroyNotify) NULL);
-
- }
-}
-
-void
-e_cal_view_a11y_init (void)
-{
- EA_SET_FACTORY (e_cal_view_get_type(), ea_cal_view);
-}
-
-void
-e_day_view_a11y_init (void)
-{
- EA_SET_FACTORY (e_day_view_get_type(), ea_day_view);
-}
-
-void e_day_view_main_item_a11y_init (void)
-{
- EA_SET_FACTORY (e_day_view_main_item_get_type (), ea_day_view_main_item);
-}
-
-void
-e_week_view_a11y_init (void)
-{
- EA_SET_FACTORY (e_week_view_get_type(), ea_week_view);
-}
-
-gboolean
-ea_calendar_focus_watcher (GSignalInvocationHint *ihint,
- guint n_param_values,
- const GValue *param_values,
- gpointer data)
-{
- GObject *object;
- GdkEvent *event;
- AtkObject *ea_event = NULL;
-
- object = g_value_get_object (param_values + 0);
- event = g_value_get_boxed (param_values + 1);
-
- if (E_IS_TEXT (object)) {
- /* "event" signal on canvas item
- */
- GnomeCanvasItem *canvas_item;
-
- canvas_item = GNOME_CANVAS_ITEM (object);
- if (event->type == GDK_FOCUS_CHANGE) {
- if (event->focus_change.in) {
- ea_event =
- ea_calendar_helpers_get_accessible_for (canvas_item);
- if (!ea_event)
- /* not canvas item we want */
- return TRUE;
-
- }
- atk_focus_tracker_notify (ea_event);
- }
- }
- else if (E_IS_DAY_VIEW (object)) {
- EDayView *day_view = E_DAY_VIEW (object);
- if (event->type == GDK_FOCUS_CHANGE) {
- if (event->focus_change.in) {
- /* give main item chance to emit focus */
- gnome_canvas_item_grab_focus (day_view->main_canvas_item);
- }
- }
- }
- else if (E_IS_DAY_VIEW_MAIN_ITEM (object)) {
- if (event->type == GDK_FOCUS_CHANGE) {
- if (event->focus_change.in) {
- /* we should emit focus on main item */
- ea_event = atk_gobject_accessible_for_object (object);
- }
- else
- /* focus out */
- ea_event = NULL;
-#ifdef ACC_DEBUG
- printf ("EvoAcc: focus notify on day main item %p\n", (void *)object);
-#endif
- atk_focus_tracker_notify (ea_event);
- }
- }
- return TRUE;
-}
diff --git a/a11y/calendar/ea-calendar.h b/a11y/calendar/ea-calendar.h
deleted file mode 100644
index 4b1779c0b5..0000000000
--- a/a11y/calendar/ea-calendar.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* vim:expandtab:shiftwidth=8:tabstop=8:
- */
-/* Evolution Accessibility: ea-calendar.h
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Bolian Yin <bolian.yin@sun.com> Sun Microsystem Inc., 2003
- *
- */
-
-/* Evolution Accessibility
-*/
-
-#ifndef _EA_CALENDAR_H__
-#define _EA_CALENDAR_H__
-
-void gnome_calendar_a11y_init (void);
-void e_cal_view_a11y_init (void);
-void e_day_view_a11y_init (void);
-void e_day_view_main_item_a11y_init (void);
-void e_week_view_a11y_init (void);
-
-#endif /* _EA_CALENDAR_H__ */
diff --git a/a11y/calendar/ea-day-view-cell.c b/a11y/calendar/ea-day-view-cell.c
deleted file mode 100644
index 52fb860fd6..0000000000
--- a/a11y/calendar/ea-day-view-cell.c
+++ /dev/null
@@ -1,336 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* vim:expandtab:shiftwidth=8:tabstop=8:
- */
-/* Evolution Accessibility: ea-day-view-cell.c
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Bolian Yin <bolian.yin@sun.com> Sun Microsystem Inc., 2003
- *
- */
-
-#include "ea-day-view-cell.h"
-#include "ea-day-view-main-item.h"
-#include "ea-day-view.h"
-#include "ea-factory.h"
-
-/* EDayViewCell */
-
-static void e_day_view_cell_class_init (EDayViewCellClass *class);
-
-EA_FACTORY_GOBJECT (EA_TYPE_DAY_VIEW_CELL, ea_day_view_cell, ea_day_view_cell_new)
-
-GType
-e_day_view_cell_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static GTypeInfo tinfo = {
- sizeof (EDayViewCellClass),
- (GBaseInitFunc) NULL, /* base init */
- (GBaseFinalizeFunc) NULL, /* base finalize */
- (GClassInitFunc) e_day_view_cell_class_init, /* class init */
- (GClassFinalizeFunc) NULL, /* class finalize */
- NULL, /* class data */
- sizeof (EDayViewCell), /* instance size */
- 0, /* nb preallocs */
- (GInstanceInitFunc) NULL, /* instance init */
- NULL /* value table */
- };
-
- type = g_type_register_static (G_TYPE_OBJECT,
- "EDayViewCell", &tinfo, 0);
- }
-
- return type;
-}
-
-static void
-e_day_view_cell_class_init (EDayViewCellClass *class)
-{
- EA_SET_FACTORY (e_day_view_cell_get_type (), ea_day_view_cell);
-}
-
-EDayViewCell *
-e_day_view_cell_new (EDayView *day_view, gint row, gint column)
-{
- GObject *object;
- EDayViewCell *cell;
-
- g_return_val_if_fail (E_IS_DAY_VIEW (day_view), NULL);
-
- object = g_object_new (E_TYPE_DAY_VIEW_CELL, NULL);
- cell = E_DAY_VIEW_CELL (object);
- cell->day_view = day_view;
- cell->row = row;
- cell->column = column;
-
-#ifdef ACC_DEBUG
- printf ("EvoAcc: e_day_view_cell created %p\n", (void *)cell);
-#endif
-
- return cell;
-}
-
-/* EaDayViewCell */
-
-static void ea_day_view_cell_class_init (EaDayViewCellClass *klass);
-
-static G_CONST_RETURN gchar* ea_day_view_cell_get_name (AtkObject *accessible);
-static G_CONST_RETURN gchar* ea_day_view_cell_get_description (AtkObject *accessible);
-static AtkStateSet* ea_day_view_cell_ref_state_set (AtkObject *obj);
-static AtkObject * ea_day_view_cell_get_parent (AtkObject *accessible);
-
-/* component interface */
-static void atk_component_interface_init (AtkComponentIface *iface);
-static void component_interface_get_extents (AtkComponent *component,
- gint *x, gint *y,
- gint *width, gint *height,
- AtkCoordType coord_type);
-static gpointer parent_class = NULL;
-
-#ifdef ACC_DEBUG
-static gint n_ea_day_view_cell_created = 0, n_ea_day_view_cell_destroyed = 0;
-static void ea_day_view_cell_finalize (GObject *object);
-#endif
-
-GType
-ea_day_view_cell_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static GTypeInfo tinfo = {
- sizeof (EaDayViewCellClass),
- (GBaseInitFunc) NULL, /* base init */
- (GBaseFinalizeFunc) NULL, /* base finalize */
- (GClassInitFunc) ea_day_view_cell_class_init, /* class init */
- (GClassFinalizeFunc) NULL, /* class finalize */
- NULL, /* class data */
- sizeof (EaDayViewCell), /* instance size */
- 0, /* nb preallocs */
- (GInstanceInitFunc) NULL, /* instance init */
- NULL /* value table */
- };
-
- static const GInterfaceInfo atk_component_info = {
- (GInterfaceInitFunc) atk_component_interface_init,
- (GInterfaceFinalizeFunc) NULL,
- NULL
- };
-
- type = g_type_register_static (ATK_TYPE_GOBJECT_ACCESSIBLE,
- "EaDayViewCell", &tinfo, 0);
- g_type_add_interface_static (type, ATK_TYPE_COMPONENT,
- &atk_component_info);
- }
-
- return type;
-}
-
-static void
-ea_day_view_cell_class_init (EaDayViewCellClass *klass)
-{
- AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
-
-#ifdef ACC_DEBUG
- GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- gobject_class->finalize = ea_day_view_cell_finalize;
-#endif
-
- parent_class = g_type_class_peek_parent (klass);
-
- class->get_name = ea_day_view_cell_get_name;
- class->get_description = ea_day_view_cell_get_description;
- class->ref_state_set = ea_day_view_cell_ref_state_set;
-
- class->get_parent = ea_day_view_cell_get_parent;
-}
-
-AtkObject*
-ea_day_view_cell_new (GObject *obj)
-{
- gpointer object;
- AtkObject *atk_object;
-
- g_return_val_if_fail (E_IS_DAY_VIEW_CELL (obj), NULL);
-
- object = g_object_new (EA_TYPE_DAY_VIEW_CELL, NULL);
- atk_object = ATK_OBJECT (object);
- atk_object_initialize (atk_object, obj);
- atk_object->role = ATK_ROLE_TABLE_CELL;
-
-#ifdef ACC_DEBUG
- ++n_ea_day_view_cell_created;
- printf ("ACC_DEBUG: n_ea_day_view_cell_created = %d\n",
- n_ea_day_view_cell_created);
-#endif
- return atk_object;
-}
-
-#ifdef ACC_DEBUG
-static void ea_day_view_cell_finalize (GObject *object)
-{
- ++n_ea_day_view_cell_destroyed;
- printf ("ACC_DEBUG: n_ea_day_view_cell_destroyed = %d\n",
- n_ea_day_view_cell_destroyed);
-}
-#endif
-
-static G_CONST_RETURN gchar*
-ea_day_view_cell_get_name (AtkObject *accessible)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- EDayViewCell *cell;
-
- g_return_val_if_fail (EA_IS_DAY_VIEW_CELL (accessible), NULL);
-
- if (!accessible->name) {
- AtkObject *ea_main_item;
- GnomeCanvasItem *main_item;
- gchar *new_name = g_strdup ("");
- const gchar *row_label, *column_label;
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (accessible);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return NULL;
-
- cell = E_DAY_VIEW_CELL (g_obj);
- main_item = cell->day_view->main_canvas_item;
- ea_main_item = atk_gobject_accessible_for_object (G_OBJECT (main_item));
- column_label = atk_table_get_column_description (ATK_TABLE (ea_main_item),
- cell->column);
- row_label = atk_table_get_row_description (ATK_TABLE (ea_main_item),
- cell->row);
- new_name = g_strconcat (column_label, " ", row_label, NULL);
- ATK_OBJECT_CLASS (parent_class)->set_name (accessible, new_name);
- g_free (new_name);
- }
- return accessible->name;
-}
-
-static G_CONST_RETURN gchar*
-ea_day_view_cell_get_description (AtkObject *accessible)
-{
- return ea_day_view_cell_get_name (accessible);
-}
-
-static AtkStateSet*
-ea_day_view_cell_ref_state_set (AtkObject *obj)
-{
- AtkStateSet *state_set;
- GObject *g_obj;
- AtkObject *parent;
- gint x, y, width, height;
- gint parent_x, parent_y, parent_width, parent_height;
-
- state_set = ATK_OBJECT_CLASS (parent_class)->ref_state_set (obj);
- g_obj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE(obj));
- if (!g_obj)
- return state_set;
-
- atk_state_set_add_state (state_set, ATK_STATE_SELECTABLE);
-
- parent = atk_object_get_parent (obj);
- atk_component_get_extents (ATK_COMPONENT (obj), &x, &y,
- &width, &height, ATK_XY_WINDOW);
- atk_component_get_extents (ATK_COMPONENT (parent), &parent_x, &parent_y,
- &parent_width, &parent_height, ATK_XY_WINDOW);
-
-
- if (x + width < parent_x || x > parent_x + parent_width ||
- y + height < parent_y || y > parent_y + parent_height)
- /* the cell is out of the main canvas */
- ;
- else
- atk_state_set_add_state (state_set, ATK_STATE_VISIBLE);
-
- return state_set;
-}
-
-static AtkObject *
-ea_day_view_cell_get_parent (AtkObject *accessible)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- EDayViewCell *cell;
-
- g_return_val_if_fail (EA_IS_DAY_VIEW_CELL (accessible), NULL);
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (accessible);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return NULL;
-
- cell = E_DAY_VIEW_CELL (g_obj);
- return gtk_widget_get_accessible (GTK_WIDGET (cell->day_view->main_canvas));
-}
-
-/* Atk Component Interface */
-
-static void
-atk_component_interface_init (AtkComponentIface *iface)
-{
- g_return_if_fail (iface != NULL);
-
- iface->get_extents = component_interface_get_extents;
-}
-
-static void
-component_interface_get_extents (AtkComponent *component,
- gint *x, gint *y, gint *width, gint *height,
- AtkCoordType coord_type)
-{
- GObject *g_obj;
- AtkObject *atk_obj;
- EDayViewCell *cell;
- EDayView *day_view;
- GtkWidget *main_canvas;
- gint day_view_width, day_view_height;
- gint scroll_x, scroll_y;
-
- *x = *y = *width = *height = 0;
-
- g_return_if_fail (EA_IS_DAY_VIEW_CELL (component));
-
- g_obj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE(component));
- if (!g_obj)
- /* defunct object*/
- return;
-
- cell = E_DAY_VIEW_CELL (g_obj);
- day_view = cell->day_view;
- main_canvas = cell->day_view->main_canvas;
-
- atk_obj = atk_gobject_accessible_for_object (G_OBJECT (main_canvas));
- atk_component_get_extents (ATK_COMPONENT (atk_obj),
- x, y,
- &day_view_width, &day_view_height,
- coord_type);
- gnome_canvas_get_scroll_offsets (GNOME_CANVAS (day_view->main_canvas),
- &scroll_x, &scroll_y);
- *x += day_view->day_offsets[cell->column] - scroll_x;
- *y += day_view->row_height * cell->row
- - scroll_y;
- printf ("ybl: cellrow=%d, cellcol=%d, scroll_x=%d, scroll_y=%d\n",
- cell->row, cell->column, scroll_x, scroll_y);
- *width = day_view->day_widths[cell->column];
- *height = day_view->row_height;
-}
diff --git a/a11y/calendar/ea-day-view-cell.h b/a11y/calendar/ea-day-view-cell.h
deleted file mode 100644
index cba2fec15b..0000000000
--- a/a11y/calendar/ea-day-view-cell.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* vim:expandtab:shiftwidth=8:tabstop=8:
- */
-/* Evolution Accessibility: ea-day-view-cell.h
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Bolian Yin <bolian.yin@sun.com> Sun Microsystem Inc., 2003
- *
- */
-
-#ifndef __EA_DAY_VIEW_CELL_H__
-#define __EA_DAY_VIEW_CELL_H__
-
-#include <atk/atkgobjectaccessible.h>
-#include "e-day-view.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define E_TYPE_DAY_VIEW_CELL (e_day_view_cell_get_type ())
-#define E_DAY_VIEW_CELL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_DAY_VIEW_CELL, EDayViewCell))
-#define E_DAY_VIEW_CELL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_DAY_VIEW_CELL, EDayViewCellClass))
-#define E_IS_DAY_VIEW_CELL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_DAY_VIEW_CELL))
-#define E_IS_DAY_VIEW_CELL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_DAY_VIEW_CELL))
-#define E_DAY_VIEW_CELL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TYPE_DAY_VIEW_CELL, EDayViewCellClass))
-
-typedef struct _EDayViewCell EDayViewCell;
-typedef struct _EDayViewCellClass EDayViewCellClass;
-
-struct _EDayViewCell
-{
- GObject parent;
- EDayView *day_view;
- gint row;
- gint column;
-};
-
-GType e_day_view_cell_get_type (void);
-
-struct _EDayViewCellClass
-{
- GObjectClass parent_class;
-};
-
-EDayViewCell * e_day_view_cell_new (EDayView *day_view, gint row, gint column);
-
-#define EA_TYPE_DAY_VIEW_CELL (ea_day_view_cell_get_type ())
-#define EA_DAY_VIEW_CELL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EA_TYPE_DAY_VIEW_CELL, EaDayViewCell))
-#define EA_DAY_VIEW_CELL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EA_TYPE_DAY_VIEW_CELL, EaDayViewCellClass))
-#define EA_IS_DAY_VIEW_CELL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EA_TYPE_DAY_VIEW_CELL))
-#define EA_IS_DAY_VIEW_CELL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EA_TYPE_DAY_VIEW_CELL))
-#define EA_DAY_VIEW_CELL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EA_TYPE_DAY_VIEW_CELL, EaDayViewCellClass))
-
-typedef struct _EaDayViewCell EaDayViewCell;
-typedef struct _EaDayViewCellClass EaDayViewCellClass;
-
-struct _EaDayViewCell
-{
- AtkGObjectAccessible parent;
-};
-
-GType ea_day_view_cell_get_type (void);
-
-struct _EaDayViewCellClass
-{
- AtkGObjectAccessibleClass parent_class;
-};
-
-AtkObject* ea_day_view_cell_new (GObject *gobj);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __EA_DAY_VIEW_CELL_H__ */
diff --git a/a11y/calendar/ea-day-view-main-item.c b/a11y/calendar/ea-day-view-main-item.c
deleted file mode 100644
index af8d704178..0000000000
--- a/a11y/calendar/ea-day-view-main-item.c
+++ /dev/null
@@ -1,1259 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* vim:expandtab:shiftwidth=8:tabstop=8:
- */
-/* Evolution Accessibility: ea-day-view-main-item.c
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Bolian Yin <bolian.yin@sun.com> Sun Microsystem Inc., 2003
- *
- */
-
-#include "ea-day-view-main-item.h"
-#include "e-day-view-top-item.h"
-#include "ea-day-view.h"
-#include "ea-day-view-cell.h"
-#include "ea-cell-table.h"
-
-/* EaDayViewMainItem */
-static void ea_day_view_main_item_class_init (EaDayViewMainItemClass *klass);
-
-static void ea_day_view_main_item_finalize (GObject *object);
-static G_CONST_RETURN gchar* ea_day_view_main_item_get_name (AtkObject *accessible);
-static G_CONST_RETURN gchar* ea_day_view_main_item_get_description (AtkObject *accessible);
-
-static gint ea_day_view_main_item_get_n_children (AtkObject *obj);
-static AtkObject* ea_day_view_main_item_ref_child (AtkObject *obj,
- gint i);
-static AtkObject * ea_day_view_main_item_get_parent (AtkObject *accessible);
-static gint ea_day_view_main_item_get_index_in_parent (AtkObject *accessible);
-
-/* callbacks */
-static void ea_day_view_main_item_dates_change_cb (GnomeCalendar *gcal, gpointer data);
-static void ea_day_view_main_item_time_change_cb (EDayView *day_view, gpointer data);
-
-/* component interface */
-static void atk_component_interface_init (AtkComponentIface *iface);
-static void component_interface_get_extents (AtkComponent *component,
- gint *x, gint *y,
- gint *width, gint *height,
- AtkCoordType coord_type);
-/* atk table interface */
-static void atk_table_interface_init (AtkTableIface *iface);
-static gint table_interface_get_index_at (AtkTable *table,
- gint row,
- gint column);
-static gint table_interface_get_column_at_index (AtkTable *table,
- gint index);
-static gint table_interface_get_row_at_index (AtkTable *table,
- gint index);
-static AtkObject* table_interface_ref_at (AtkTable *table,
- gint row,
- gint column);
-static gint table_interface_get_n_rows (AtkTable *table);
-static gint table_interface_get_n_columns (AtkTable *table);
-static gint table_interface_get_column_extent_at (AtkTable *table,
- gint row,
- gint column);
-static gint table_interface_get_row_extent_at (AtkTable *table,
- gint row,
- gint column);
-
-static gboolean table_interface_is_row_selected (AtkTable *table,
- gint row);
-static gboolean table_interface_is_column_selected (AtkTable *table,
- gint row);
-static gboolean table_interface_is_selected (AtkTable *table,
- gint row,
- gint column);
-static gint table_interface_get_selected_rows (AtkTable *table,
- gint **rows_selected);
-static gint table_interface_get_selected_columns (AtkTable *table,
- gint **columns_selected);
-static gboolean table_interface_add_row_selection (AtkTable *table, gint row);
-static gboolean table_interface_remove_row_selection (AtkTable *table,
- gint row);
-static gboolean table_interface_add_column_selection (AtkTable *table,
- gint column);
-static gboolean table_interface_remove_column_selection (AtkTable *table,
- gint column);
-static AtkObject* table_interface_get_row_header (AtkTable *table, gint row);
-static AtkObject* table_interface_get_column_header (AtkTable *table,
- gint in_col);
-static AtkObject* table_interface_get_caption (AtkTable *table);
-
-static G_CONST_RETURN gchar*
-table_interface_get_column_description (AtkTable *table, gint in_col);
-
-static G_CONST_RETURN gchar*
-table_interface_get_row_description (AtkTable *table, gint row);
-
-static AtkObject* table_interface_get_summary (AtkTable *table);
-
-/* atk selection interface */
-static void atk_selection_interface_init (AtkSelectionIface *iface);
-static gboolean selection_interface_add_selection (AtkSelection *selection,
- gint i);
-static gboolean selection_interface_clear_selection (AtkSelection *selection);
-static AtkObject* selection_interface_ref_selection (AtkSelection *selection,
- gint i);
-static gint selection_interface_get_selection_count (AtkSelection *selection);
-static gboolean selection_interface_is_child_selected (AtkSelection *selection,
- gint i);
-
-/* helpers */
-static EaCellTable *
-ea_day_view_main_item_get_cell_data (EaDayViewMainItem *ea_main_item);
-
-static void
-ea_day_view_main_item_destory_cell_data (EaDayViewMainItem *ea_main_item);
-
-static gint
-ea_day_view_main_item_get_child_index_at (EaDayViewMainItem *ea_main_item,
- gint row, gint column);
-static gint
-ea_day_view_main_item_get_row_at_index (EaDayViewMainItem *ea_main_item,
- gint index);
-static gint
-ea_day_view_main_item_get_column_at_index (EaDayViewMainItem *ea_main_item,
- gint index);
-static gint
-ea_day_view_main_item_get_row_label (EaDayViewMainItem *ea_main_item,
- gint row, gchar *buffer,
- gint buffer_size);
-
-#ifdef ACC_DEBUG
-static gint n_ea_day_view_main_item_created = 0;
-static gint n_ea_day_view_main_item_destroyed = 0;
-#endif
-
-static gpointer parent_class = NULL;
-
-GType
-ea_day_view_main_item_get_type (void)
-{
- static GType type = 0;
- AtkObjectFactory *factory;
- GTypeQuery query;
- GType derived_atk_type;
-
- if (!type) {
- static GTypeInfo tinfo = {
- sizeof (EaDayViewMainItemClass),
- (GBaseInitFunc) NULL, /* base init */
- (GBaseFinalizeFunc) NULL, /* base finalize */
- (GClassInitFunc) ea_day_view_main_item_class_init,
- (GClassFinalizeFunc) NULL, /* class finalize */
- NULL, /* class data */
- sizeof (EaDayViewMainItem), /* instance size */
- 0, /* nb preallocs */
- (GInstanceInitFunc) NULL, /* instance init */
- NULL /* value table */
- };
-
- static const GInterfaceInfo atk_component_info = {
- (GInterfaceInitFunc) atk_component_interface_init,
- (GInterfaceFinalizeFunc) NULL,
- NULL
- };
-
- static const GInterfaceInfo atk_table_info = {
- (GInterfaceInitFunc) atk_table_interface_init,
- (GInterfaceFinalizeFunc) NULL,
- NULL
- };
- static const GInterfaceInfo atk_selection_info = {
- (GInterfaceInitFunc) atk_selection_interface_init,
- (GInterfaceFinalizeFunc) NULL,
- NULL
- };
-
-
- /*
- * Figure out the size of the class and instance
- * we are run-time deriving from (GailCanvasItem, in this case)
- *
- */
-
- factory = atk_registry_get_factory (atk_get_default_registry (),
- e_day_view_main_item_get_type());
- derived_atk_type = atk_object_factory_get_accessible_type (factory);
- g_type_query (derived_atk_type, &query);
-
- tinfo.class_size = query.class_size;
- tinfo.instance_size = query.instance_size;
-
- type = g_type_register_static (derived_atk_type,
- "EaDayViewMainItem", &tinfo, 0);
- g_type_add_interface_static (type, ATK_TYPE_COMPONENT,
- &atk_component_info);
- g_type_add_interface_static (type, ATK_TYPE_TABLE,
- &atk_table_info);
- g_type_add_interface_static (type, ATK_TYPE_SELECTION,
- &atk_selection_info);
- }
-
- return type;
-}
-
-static void
-ea_day_view_main_item_class_init (EaDayViewMainItemClass *klass)
-{
- GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
-
- gobject_class->finalize = ea_day_view_main_item_finalize;
- parent_class = g_type_class_peek_parent (klass);
-
- class->get_name = ea_day_view_main_item_get_name;
- class->get_description = ea_day_view_main_item_get_description;
-
- class->get_n_children = ea_day_view_main_item_get_n_children;
- class->ref_child = ea_day_view_main_item_ref_child;
- class->get_parent = ea_day_view_main_item_get_parent;
- class->get_index_in_parent = ea_day_view_main_item_get_index_in_parent;
-}
-
-AtkObject*
-ea_day_view_main_item_new (GObject *obj)
-{
- AtkObject *accessible;
- GnomeCalendar *gcal;
- EDayViewMainItem *main_item;
-
- g_return_val_if_fail (E_IS_DAY_VIEW_MAIN_ITEM (obj), NULL);
-
- accessible = ATK_OBJECT (g_object_new (EA_TYPE_DAY_VIEW_MAIN_ITEM,
- NULL));
-
- atk_object_initialize (accessible, obj);
- accessible->role = ATK_ROLE_TABLE;
-
-#ifdef ACC_DEBUG
- ++n_ea_day_view_main_item_created;
- printf ("ACC_DEBUG: n_ea_day_view_main_item_created = %d\n",
- n_ea_day_view_main_item_created);
-#endif
- main_item = E_DAY_VIEW_MAIN_ITEM (obj);
- g_signal_connect (main_item->day_view, "selected_time_changed",
- G_CALLBACK (ea_day_view_main_item_time_change_cb),
- accessible);
-
- /* listen for date changes of calendar */
- gcal = e_calendar_view_get_calendar (E_CALENDAR_VIEW (main_item->day_view));
- if (gcal)
- g_signal_connect (gcal, "dates_shown_changed",
- G_CALLBACK (ea_day_view_main_item_dates_change_cb),
- accessible);
-
- return accessible;
-}
-
-static void
-ea_day_view_main_item_finalize (GObject *object)
-{
- EaDayViewMainItem *ea_main_item;
-
- g_return_if_fail (EA_IS_DAY_VIEW_MAIN_ITEM (object));
-
- ea_main_item = EA_DAY_VIEW_MAIN_ITEM (object);
-
- /* Free the allocated cell data */
- ea_day_view_main_item_destory_cell_data (ea_main_item);
-
- G_OBJECT_CLASS (parent_class)->finalize (object);
-#ifdef ACC_DEBUG
- ++n_ea_day_view_main_item_destroyed;
- printf ("ACC_DEBUG: n_ea_day_view_main_item_destroyed = %d\n",
- n_ea_day_view_main_item_destroyed);
-#endif
-}
-
-static G_CONST_RETURN gchar*
-ea_day_view_main_item_get_name (AtkObject *accessible)
-{
- AtkObject *parent;
- g_return_val_if_fail (EA_IS_DAY_VIEW_MAIN_ITEM (accessible), NULL);
- parent = atk_object_get_parent (accessible);
- return atk_object_get_name (parent);
-}
-
-static G_CONST_RETURN gchar*
-ea_day_view_main_item_get_description (AtkObject *accessible)
-{
- return "a table to view and select the current time range";
-}
-
-static gint
-ea_day_view_main_item_get_n_children (AtkObject *accessible)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- EDayViewMainItem *main_item;
- EDayView *day_view;
-
- g_return_val_if_fail (EA_IS_DAY_VIEW_MAIN_ITEM (accessible), -1);
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (accessible);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return -1;
-
- main_item = E_DAY_VIEW_MAIN_ITEM (g_obj);
- day_view = main_item->day_view;
-
- return day_view->rows * day_view->days_shown;
-}
-
-static AtkObject *
-ea_day_view_main_item_ref_child (AtkObject *accessible, gint index)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- EDayViewMainItem *main_item;
- EDayView *day_view;
- gint n_children;
- EDayViewCell *cell;
- EaCellTable *cell_data;
- EaDayViewMainItem *ea_main_item;
-
- g_return_val_if_fail (EA_IS_DAY_VIEW_MAIN_ITEM (accessible), NULL);
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (accessible);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return NULL;
-
- main_item = E_DAY_VIEW_MAIN_ITEM (g_obj);
- day_view = main_item->day_view;
-
- n_children = ea_day_view_main_item_get_n_children (accessible);
- if (index < 0 || index >= n_children)
- return NULL;
-
- ea_main_item = EA_DAY_VIEW_MAIN_ITEM (accessible);
- cell_data = ea_day_view_main_item_get_cell_data (ea_main_item);
- if (!cell_data)
- return NULL;
-
- cell = ea_cell_table_get_cell_at_index (cell_data, index);
- if (!cell) {
- gint row, column;
-
- row = ea_day_view_main_item_get_row_at_index (ea_main_item, index);
- column = ea_day_view_main_item_get_column_at_index (ea_main_item, index);
- cell = e_day_view_cell_new (day_view, row, column);
- ea_cell_table_set_cell_at_index (cell_data, index, cell);
- g_object_unref (cell);
- }
- return g_object_ref (atk_gobject_accessible_for_object (G_OBJECT(cell)));
-}
-
-static AtkObject *
-ea_day_view_main_item_get_parent (AtkObject *accessible)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- EDayViewMainItem *main_item;
-
- g_return_val_if_fail (EA_IS_DAY_VIEW_MAIN_ITEM (accessible), NULL);
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (accessible);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return NULL;
-
- main_item = E_DAY_VIEW_MAIN_ITEM (g_obj);
- return gtk_widget_get_accessible (GTK_WIDGET (main_item->day_view));
-}
-
-static gint
-ea_day_view_main_item_get_index_in_parent (AtkObject *accessible)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
-
- g_return_val_if_fail (EA_IS_DAY_VIEW_MAIN_ITEM (accessible), -1);
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (accessible);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return -1;
-
- /* always the first child of ea-day-view */
- return 0;
-}
-
-/* callbacks */
-
-static void
-ea_day_view_main_item_dates_change_cb (GnomeCalendar *gcal, gpointer data)
-{
- EaDayViewMainItem *ea_main_item;
-
- g_return_if_fail (GNOME_IS_CALENDAR (gcal));
- g_return_if_fail (data);
- g_return_if_fail (EA_IS_DAY_VIEW_MAIN_ITEM (data));
-
- ea_main_item = EA_DAY_VIEW_MAIN_ITEM (data);
-
-#ifdef ACC_DEBUG
- printf ("EvoAcc: ea_day_view_main_item update cb\n");
-#endif
-
- ea_day_view_main_item_destory_cell_data (ea_main_item);
-}
-
-static void
-ea_day_view_main_item_time_change_cb (EDayView *day_view, gpointer data)
-{
- EaDayViewMainItem *ea_main_item;
-
- g_return_if_fail (E_IS_DAY_VIEW (day_view));
- g_return_if_fail (data);
- g_return_if_fail (EA_IS_DAY_VIEW_MAIN_ITEM (data));
-
- ea_main_item = EA_DAY_VIEW_MAIN_ITEM (data);
-
-#ifdef ACC_DEBUG
- printf ("EvoAcc: ea_day_view_main_item time changed cb\n");
-#endif
- g_signal_emit_by_name (data, "selection_changed");
-}
-
-/* helpers */
-
-static gint
-ea_day_view_main_item_get_child_index_at (EaDayViewMainItem *ea_main_item,
- gint row, gint column)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- EDayViewMainItem *main_item;
- EDayView *day_view;
-
- g_return_val_if_fail (ea_main_item, -1);
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return -1;
-
- main_item = E_DAY_VIEW_MAIN_ITEM (g_obj);
- day_view = main_item->day_view;
-
- if (row >= 0 && row < day_view->rows &&
- column >= 0 && column < day_view->days_shown)
- return column * day_view->rows + row;
- return -1;
-}
-
-static gint
-ea_day_view_main_item_get_row_at_index (EaDayViewMainItem *ea_main_item,
- gint index)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- EDayViewMainItem *main_item;
- EDayView *day_view;
- gint n_children;
-
- g_return_val_if_fail (ea_main_item, -1);
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return -1;
-
- main_item = E_DAY_VIEW_MAIN_ITEM (g_obj);
- day_view = main_item->day_view;
-
- n_children = ea_day_view_main_item_get_n_children (ATK_OBJECT (ea_main_item));
- if (index >= 0 && index < n_children)
- return index % day_view->rows;
- return -1;
-}
-
-static gint
-ea_day_view_main_item_get_column_at_index (EaDayViewMainItem *ea_main_item,
- gint index)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- EDayViewMainItem *main_item;
- EDayView *day_view;
- gint n_children;
-
- g_return_val_if_fail (ea_main_item, -1);
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return -1;
-
- main_item = E_DAY_VIEW_MAIN_ITEM (g_obj);
- day_view = main_item->day_view;
-
- n_children = ea_day_view_main_item_get_n_children (ATK_OBJECT (ea_main_item));
- if (index >= 0 && index < n_children)
- return index / day_view->rows;
- return -1;
-}
-
-static gint
-ea_day_view_main_item_get_row_label (EaDayViewMainItem *ea_main_item,
- gint row, gchar *buffer, gint buffer_size)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- EDayViewMainItem *main_item;
- EDayView *day_view;
- gchar *suffix;
- gint hour, minute, suffix_width;
-
- g_return_val_if_fail (ea_main_item, 0);
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return 0 ;
-
- main_item = E_DAY_VIEW_MAIN_ITEM (g_obj);
- day_view = main_item->day_view;
-
- hour = day_view->first_hour_shown;
- minute = day_view->first_minute_shown;
- minute += row * day_view->mins_per_row;
- hour = (hour + minute / 60) % 24;
- minute %= 60;
-
- e_day_view_convert_time_to_display (day_view, hour, &hour,
- &suffix, &suffix_width);
- return g_snprintf (buffer, buffer_size, "%i:%02i %s",
- hour, minute, suffix);
-}
-
-static EaCellTable *
-ea_day_view_main_item_get_cell_data (EaDayViewMainItem *ea_main_item)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- EDayViewMainItem *main_item;
- EDayView *day_view;
- EaCellTable *cell_data;
-
- g_return_val_if_fail (ea_main_item, NULL);
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return NULL;
-
- main_item = E_DAY_VIEW_MAIN_ITEM (g_obj);
- day_view = main_item->day_view;
-
- cell_data = g_object_get_data (G_OBJECT(ea_main_item),
- "ea-day-view-cell-table");
- if (!cell_data) {
- cell_data = ea_cell_table_create (day_view->rows,
- day_view->days_shown, TRUE);
- g_object_set_data (G_OBJECT(ea_main_item),
- "ea-day-view-cell-table", cell_data);
- }
- return cell_data;
-}
-
-static void
-ea_day_view_main_item_destory_cell_data (EaDayViewMainItem *ea_main_item)
-{
- EaCellTable *cell_data;
-
- g_return_if_fail (ea_main_item);
-
- cell_data = g_object_get_data (G_OBJECT(ea_main_item),
- "ea-day-view-cell-table");
- if (cell_data) {
- ea_cell_table_destroy (cell_data);
- g_object_set_data (G_OBJECT(ea_main_item),
- "ea-day-view-cell-table", NULL);
- }
-}
-
-/* Atk Component Interface */
-
-static void
-atk_component_interface_init (AtkComponentIface *iface)
-{
- g_return_if_fail (iface != NULL);
-
- iface->get_extents = component_interface_get_extents;
-}
-
-static void
-component_interface_get_extents (AtkComponent *component,
- gint *x, gint *y, gint *width, gint *height,
- AtkCoordType coord_type)
-{
- GObject *g_obj;
- AtkObject *ea_canvas;
- EDayViewMainItem *main_item;
- EDayView *day_view;
-
- *x = *y = *width = *height = 0;
-
- g_return_if_fail (EA_IS_DAY_VIEW_MAIN_ITEM (component));
-
- g_obj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE(component));
- if (!g_obj)
- /* defunct object*/
- return;
- main_item = E_DAY_VIEW_MAIN_ITEM (g_obj);
- day_view = main_item->day_view;
-
- ea_canvas = gtk_widget_get_accessible (day_view->main_canvas);
- atk_component_get_extents (ATK_COMPONENT (ea_canvas), x, y,
- width, height, coord_type);
-}
-
-/* atk table interface */
-
-static void
-atk_table_interface_init (AtkTableIface *iface)
-{
- g_return_if_fail (iface != NULL);
-
- iface->ref_at = table_interface_ref_at;
-
- iface->get_n_rows = table_interface_get_n_rows;
- iface->get_n_columns = table_interface_get_n_columns;
- iface->get_index_at = table_interface_get_index_at;
- iface->get_column_at_index = table_interface_get_column_at_index;
- iface->get_row_at_index = table_interface_get_row_at_index;
- iface->get_column_extent_at = table_interface_get_column_extent_at;
- iface->get_row_extent_at = table_interface_get_row_extent_at;
-
- iface->is_selected = table_interface_is_selected;
- iface->get_selected_rows = table_interface_get_selected_rows;
- iface->get_selected_columns = table_interface_get_selected_columns;
- iface->is_row_selected = table_interface_is_row_selected;
- iface->is_column_selected = table_interface_is_column_selected;
- iface->add_row_selection = table_interface_add_row_selection;
- iface->remove_row_selection = table_interface_remove_row_selection;
- iface->add_column_selection = table_interface_add_column_selection;
- iface->remove_column_selection = table_interface_remove_column_selection;
-
- iface->get_row_header = table_interface_get_row_header;
- iface->get_column_header = table_interface_get_column_header;
- iface->get_caption = table_interface_get_caption;
- iface->get_summary = table_interface_get_summary;
- iface->get_row_description = table_interface_get_row_description;
- iface->get_column_description = table_interface_get_column_description;
-}
-
-static AtkObject*
-table_interface_ref_at (AtkTable *table,
- gint row,
- gint column)
-{
- gint index;
-
- EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table);
- index = ea_day_view_main_item_get_child_index_at (ea_main_item,
- row, column);
- return ea_day_view_main_item_ref_child (ATK_OBJECT (ea_main_item), index);
-}
-
-static gint
-table_interface_get_n_rows (AtkTable *table)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- EDayViewMainItem *main_item;
- EDayView *day_view;
- EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table);
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return -1;
-
- main_item = E_DAY_VIEW_MAIN_ITEM (g_obj);
- day_view = main_item->day_view;
-
- return day_view->rows;
-}
-
-static gint
-table_interface_get_n_columns (AtkTable *table)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- EDayViewMainItem *main_item;
- EDayView *day_view;
- EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table);
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return -1;
-
- main_item = E_DAY_VIEW_MAIN_ITEM (g_obj);
- day_view = main_item->day_view;
-
- return day_view->days_shown;
-}
-
-static gint
-table_interface_get_index_at (AtkTable *table,
- gint row,
- gint column)
-{
- EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table);
- return ea_day_view_main_item_get_child_index_at (ea_main_item,
- row, column);
-}
-
-static gint
-table_interface_get_column_at_index (AtkTable *table,
- gint index)
-{
- EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table);
- return ea_day_view_main_item_get_column_at_index (ea_main_item, index);
-}
-
-static gint
-table_interface_get_row_at_index (AtkTable *table,
- gint index)
-{
- EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table);
- return ea_day_view_main_item_get_row_at_index (ea_main_item, index);
-}
-
-static gint
-table_interface_get_column_extent_at (AtkTable *table,
- gint row,
- gint column)
-{
- gint index;
- gint width = 0, height = 0;
- AtkObject *child;
- EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table);
-
- index = ea_day_view_main_item_get_child_index_at (ea_main_item,
- row, column);
- child = atk_object_ref_accessible_child (ATK_OBJECT (ea_main_item),
- index);
- if (child)
- atk_component_get_size (ATK_COMPONENT (child),
- &width, &height);
-
- return width;
-}
-
-static gint
-table_interface_get_row_extent_at (AtkTable *table,
- gint row,
- gint column)
-{
- gint index;
- gint width = 0, height = 0;
- AtkObject *child;
- EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table);
-
- index = ea_day_view_main_item_get_child_index_at (ea_main_item,
- row, column);
- child = atk_object_ref_accessible_child (ATK_OBJECT (ea_main_item),
- index);
- if (child)
- atk_component_get_size (ATK_COMPONENT (child),
- &width, &height);
-
- return height;
-}
-
-static gboolean
-table_interface_is_row_selected (AtkTable *table,
- gint row)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- EDayViewMainItem *main_item;
- EDayView *day_view;
- EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table);
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return FALSE;
-
- main_item = E_DAY_VIEW_MAIN_ITEM (g_obj);
- day_view = main_item->day_view;
-
- if (day_view->selection_start_day == -1)
- /* no selection */
- return FALSE;
- if (day_view->selection_start_day != day_view->selection_end_day)
- /* all row is selected */
- return TRUE;
- if (row >= day_view->selection_start_row &&
- row <= day_view->selection_end_row)
- return TRUE;
- return FALSE;
-}
-
-static gboolean
-table_interface_is_selected (AtkTable *table,
- gint row,
- gint column)
-{
- return table_interface_is_row_selected (table, row) &&
- table_interface_is_column_selected (table, column);
-}
-
-static gboolean
-table_interface_is_column_selected (AtkTable *table,
- gint column)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- EDayViewMainItem *main_item;
- EDayView *day_view;
- EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table);
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return FALSE;
-
- main_item = E_DAY_VIEW_MAIN_ITEM (g_obj);
- day_view = main_item->day_view;
-
- if (column >= day_view->selection_start_day &&
- column <= day_view->selection_end_day)
- return TRUE;
- return FALSE;
-}
-
-static gint
-table_interface_get_selected_rows (AtkTable *table,
- gint **rows_selected)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- EDayViewMainItem *main_item;
- EDayView *day_view;
- EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table);
- gint start_row = -1, n_rows = 0;
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return -1;
-
- main_item = E_DAY_VIEW_MAIN_ITEM (g_obj);
- day_view = main_item->day_view;
-
- if (day_view->selection_start_day == -1)
- return 0;
-
- if (day_view->selection_start_day != day_view->selection_end_day) {
- /* all the rows should be selected */
- n_rows = day_view->rows;
- start_row = 0;
- }
- else if (day_view->selection_start_row != -1) {
- start_row = day_view->selection_start_row;
- n_rows = day_view->selection_end_row - start_row + 1;
- }
- if (n_rows > 0 && start_row != -1 && rows_selected) {
- gint index;
-
- *rows_selected = (gint *) g_malloc (n_rows * sizeof (gint));
- for (index = 0; index < n_rows; ++index)
- (*rows_selected)[index] = start_row + index;
- }
- return n_rows;
-}
-
-static gint
-table_interface_get_selected_columns (AtkTable *table,
- gint **columns_selected)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- EDayViewMainItem *main_item;
- EDayView *day_view;
- EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table);
- gint start_column = -1, n_columns = 0;
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return -1;
-
- main_item = E_DAY_VIEW_MAIN_ITEM (g_obj);
- day_view = main_item->day_view;
-
- if (day_view->selection_start_day == -1)
- return 0;
-
- start_column = day_view->selection_start_day;
- n_columns = day_view->selection_end_day - start_column + 1;
- if (n_columns > 0 && start_column != -1 && columns_selected) {
- gint index;
-
- *columns_selected = (gint *) g_malloc (n_columns * sizeof (gint));
- for (index = 0; index < n_columns; ++index)
- (*columns_selected)[index] = start_column + index;
- }
- return n_columns;
-}
-
-static gboolean
-table_interface_add_row_selection (AtkTable *table,
- gint row)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- EDayViewMainItem *main_item;
- EDayView *day_view;
- EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table);
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return FALSE;
-
- main_item = E_DAY_VIEW_MAIN_ITEM (g_obj);
- day_view = main_item->day_view;
-
- /* FIXME: we need multi-selection */
-
- day_view->selection_start_day = 0;
- day_view->selection_end_day = 0;
- day_view->selection_start_row = row;
- day_view->selection_end_row = row;
-
- e_day_view_ensure_rows_visible (day_view,
- day_view->selection_start_row,
- day_view->selection_end_row);
- e_day_view_update_calendar_selection_time (day_view);
- gtk_widget_queue_draw (day_view->main_canvas);
- return TRUE;
-}
-
-static gboolean
-table_interface_remove_row_selection (AtkTable *table,
- gint row)
-{
- return FALSE;
-}
-
-static gboolean
-table_interface_add_column_selection (AtkTable *table,
- gint column)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- EDayViewMainItem *main_item;
- EDayView *day_view;
- EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table);
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return FALSE;
-
- main_item = E_DAY_VIEW_MAIN_ITEM (g_obj);
- day_view = main_item->day_view;
-
- /* FIXME: we need multi-selection */
-
- day_view->selection_start_day = column;
- day_view->selection_end_day = column;
- day_view->selection_start_row = 0;
- day_view->selection_end_row = day_view->rows;
-
- e_day_view_update_calendar_selection_time (day_view);
- gtk_widget_queue_draw (day_view->main_canvas);
- return TRUE;
-}
-
-static gboolean
-table_interface_remove_column_selection (AtkTable *table,
- gint column)
-{
- /* FIXME: NOT IMPLEMENTED */
- return FALSE;
-}
-
-static AtkObject*
-table_interface_get_row_header (AtkTable *table,
- gint row)
-{
- /* FIXME: NOT IMPLEMENTED */
- return NULL;
-}
-
-static AtkObject*
-table_interface_get_column_header (AtkTable *table,
- gint in_col)
-{
- /* FIXME: NOT IMPLEMENTED */
- return NULL;
-}
-
-static AtkObject*
-table_interface_get_caption (AtkTable *table)
-{
- /* FIXME: NOT IMPLEMENTED */
- return NULL;
-}
-
-static G_CONST_RETURN gchar*
-table_interface_get_column_description (AtkTable *table,
- gint in_col)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- EDayViewMainItem *main_item;
- EDayView *day_view;
- EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table);
- const gchar *description;
- EaCellTable *cell_data;
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return NULL;
-
- main_item = E_DAY_VIEW_MAIN_ITEM (g_obj);
- day_view = main_item->day_view;
-
- if (in_col < 0 || in_col >= day_view->days_shown)
- return NULL;
- cell_data = ea_day_view_main_item_get_cell_data (ea_main_item);
- if (!cell_data)
- return NULL;
-
- description = ea_cell_table_get_column_label (cell_data, in_col);
- if (!description) {
- gchar buffer[128];
- e_day_view_top_item_get_day_label (day_view, in_col, buffer, 128);
- ea_cell_table_set_column_label (cell_data, in_col, buffer);
- description = ea_cell_table_get_column_label (cell_data, in_col);
- }
- return description;
-}
-
-static G_CONST_RETURN gchar*
-table_interface_get_row_description (AtkTable *table,
- gint row)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- EDayViewMainItem *main_item;
- EDayView *day_view;
- EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table);
- const gchar *description;
- EaCellTable *cell_data;
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return NULL;
-
- main_item = E_DAY_VIEW_MAIN_ITEM (g_obj);
- day_view = main_item->day_view;
-
- if (row < 0 || row >= 12 * 24)
- return NULL;
- cell_data = ea_day_view_main_item_get_cell_data (ea_main_item);
- if (!cell_data)
- return NULL;
-
- description = ea_cell_table_get_row_label (cell_data, row);
- if (!description) {
- gchar buffer[128];
- ea_day_view_main_item_get_row_label (ea_main_item, row, buffer, sizeof (buffer));
- ea_cell_table_set_row_label (cell_data, row, buffer);
- description = ea_cell_table_get_row_label (cell_data,
- row);
- }
- return description;
-}
-
-static AtkObject*
-table_interface_get_summary (AtkTable *table)
-{
- /* FIXME: NOT IMPLEMENTED */
- return NULL;
-}
-
-/* atkselection interface */
-
-static void
-atk_selection_interface_init (AtkSelectionIface *iface)
-{
- g_return_if_fail (iface != NULL);
-
- iface->add_selection = selection_interface_add_selection;
- iface->clear_selection = selection_interface_clear_selection;
- iface->ref_selection = selection_interface_ref_selection;
- iface->get_selection_count = selection_interface_get_selection_count;
- iface->is_child_selected = selection_interface_is_child_selected;
-}
-
-static gboolean
-selection_interface_add_selection (AtkSelection *selection, gint i)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- EDayViewMainItem *main_item;
- EDayView *day_view;
- EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (selection);
- gint column, row;
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return FALSE;
-
- main_item = E_DAY_VIEW_MAIN_ITEM (g_obj);
- day_view = main_item->day_view;
-
- row = ea_day_view_main_item_get_row_at_index (ea_main_item, i);
- column = ea_day_view_main_item_get_column_at_index (ea_main_item, i);
-
- if (row == -1 || column == -1)
- return FALSE;
-
- /*FIXME: multi-selection is needed */
- day_view->selection_start_day = column;
- day_view->selection_end_day = column;
- day_view->selection_start_row = row;
- day_view->selection_end_row = row;
-
- e_day_view_ensure_rows_visible (day_view,
- day_view->selection_start_row,
- day_view->selection_end_row);
- e_day_view_update_calendar_selection_time (day_view);
- gtk_widget_queue_draw (day_view->main_canvas);
- return TRUE;
-}
-
-static gboolean
-selection_interface_clear_selection (AtkSelection *selection)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- EDayViewMainItem *main_item;
- EDayView *day_view;
- EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (selection);
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return FALSE;
-
- main_item = E_DAY_VIEW_MAIN_ITEM (g_obj);
- day_view = main_item->day_view;
-
- day_view->selection_start_row = -1;
- day_view->selection_start_day = -1;
- day_view->selection_end_row = -1;
- day_view->selection_end_day = -1;
-
- e_day_view_update_calendar_selection_time (day_view);
- gtk_widget_queue_draw (day_view->main_canvas);
-
- return TRUE;
-}
-
-static AtkObject*
-selection_interface_ref_selection (AtkSelection *selection, gint i)
-{
- if (selection_interface_is_child_selected (selection, i))
- return ea_day_view_main_item_ref_child (ATK_OBJECT (selection), i);
- return NULL;
-}
-
-static gint
-selection_interface_get_selection_count (AtkSelection *selection)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- EDayViewMainItem *main_item;
- EDayView *day_view;
- EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (selection);
- gint start_index, end_index;
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return 0;
-
- main_item = E_DAY_VIEW_MAIN_ITEM (g_obj);
- day_view = main_item->day_view;
-
- if (day_view->selection_start_day == -1 ||
- day_view->selection_start_row == -1)
- return 0;
- start_index = ea_day_view_main_item_get_child_index_at (ea_main_item,
- day_view->selection_start_row,
- day_view->selection_start_day);
- end_index = ea_day_view_main_item_get_child_index_at (ea_main_item,
- day_view->selection_end_row,
- day_view->selection_end_day);
-
- return end_index - start_index + 1;
-}
-
-static gboolean
-selection_interface_is_child_selected (AtkSelection *selection, gint i)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- EDayViewMainItem *main_item;
- EDayView *day_view;
- EaDayViewMainItem* ea_main_item = EA_DAY_VIEW_MAIN_ITEM (selection);
- gint column, row;
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_main_item);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return FALSE;
-
- main_item = E_DAY_VIEW_MAIN_ITEM (g_obj);
- day_view = main_item->day_view;
-
- row = ea_day_view_main_item_get_row_at_index (ea_main_item, i);
- column = ea_day_view_main_item_get_column_at_index (ea_main_item, i);
-
- if (column < day_view->selection_start_day ||
- column > day_view->selection_end_day)
- return FALSE;
-
- if ((column == day_view->selection_start_day ||
- column == day_view->selection_end_day) &&
- (row < day_view->selection_start_row ||
- row > day_view->selection_end_row))
- return FALSE;
-
- /* if comes here, the cell is selected */
- return TRUE;
-}
diff --git a/a11y/calendar/ea-day-view-main-item.h b/a11y/calendar/ea-day-view-main-item.h
deleted file mode 100644
index d22372d064..0000000000
--- a/a11y/calendar/ea-day-view-main-item.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* vim:expandtab:shiftwidth=8:tabstop=8:
- */
-/* Evolution Accessibility: ea-day-view-main-item.h
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Bolian Yin <bolian.yin@sun.com> Sun Microsystem Inc., 2003
- *
- */
-
-#ifndef __EA_DAY_VIEW_MAIN_ITEM_H__
-#define __EA_DAY_VIEW_MAIN_ITEM_H__
-
-#include <atk/atkgobjectaccessible.h>
-#include "e-day-view-main-item.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define EA_TYPE_DAY_VIEW_MAIN_ITEM (ea_day_view_main_item_get_type ())
-#define EA_DAY_VIEW_MAIN_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EA_TYPE_DAY_VIEW_MAIN_ITEM, EaDayViewMainItem))
-#define EA_DAY_VIEW_MAIN_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EA_TYPE_DAY_VIEW_MAIN_ITEM, EaDayViewMainItemClass))
-#define EA_IS_DAY_VIEW_MAIN_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EA_TYPE_DAY_VIEW_MAIN_ITEM))
-#define EA_IS_DAY_VIEW_MAIN_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EA_TYPE_DAY_VIEW_MAIN_ITEM))
-#define EA_DAY_VIEW_MAIN_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EA_TYPE_DAY_VIEW_MAIN_ITEM, EaDayViewMainItemClass))
-
-typedef struct _EaDayViewMainItem EaDayViewMainItem;
-typedef struct _EaDayViewMainItemClass EaDayViewMainItemClass;
-
-struct _EaDayViewMainItem
-{
- AtkGObjectAccessible parent;
-};
-
-GType ea_day_view_main_item_get_type (void);
-
-struct _EaDayViewMainItemClass
-{
- AtkGObjectAccessibleClass parent_class;
-};
-
-AtkObject* ea_day_view_main_item_new (GObject *obj);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __EA_DAY_VIEW_MAIN_ITEM_H__ */
diff --git a/a11y/calendar/ea-day-view.c b/a11y/calendar/ea-day-view.c
deleted file mode 100644
index f91583da24..0000000000
--- a/a11y/calendar/ea-day-view.c
+++ /dev/null
@@ -1,261 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* vim:expandtab:shiftwidth=8:tabstop=8:
- */
-/* Evolution Accessibility: ea-day-view.c
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Bolian Yin <bolian.yin@sun.com> Sun Microsystem Inc., 2003
- *
- */
-
-#include "ea-day-view.h"
-#include "ea-cal-view-event.h"
-
-#include "ea-calendar-helpers.h"
-#include "calendar-commands.h"
-#include <glib/gstrfuncs.h>
-
-static void ea_day_view_class_init (EaDayViewClass *klass);
-
-static G_CONST_RETURN gchar* ea_day_view_get_name (AtkObject *accessible);
-static G_CONST_RETURN gchar* ea_day_view_get_description (AtkObject *accessible);
-static gint ea_day_view_get_n_children (AtkObject *obj);
-static AtkObject* ea_day_view_ref_child (AtkObject *obj,
- gint i);
-static gpointer parent_class = NULL;
-
-GType
-ea_day_view_get_type (void)
-{
- static GType type = 0;
- AtkObjectFactory *factory;
- GTypeQuery query;
- GType derived_atk_type;
-
- if (!type) {
- static GTypeInfo tinfo = {
- sizeof (EaDayViewClass),
- (GBaseInitFunc) NULL, /* base init */
- (GBaseFinalizeFunc) NULL, /* base finalize */
- (GClassInitFunc) ea_day_view_class_init, /* class init */
- (GClassFinalizeFunc) NULL, /* class finalize */
- NULL, /* class data */
- sizeof (EaDayView), /* instance size */
- 0, /* nb preallocs */
- (GInstanceInitFunc) NULL, /* instance init */
- NULL /* value table */
- };
-
- /*
- * Figure out the size of the class and instance
- * we are run-time deriving from (EaCalView, in this case)
- *
- * Note: we must still use run-time deriving here, because
- * our parent class EaCalView is run-time deriving.
- */
-
- factory = atk_registry_get_factory (atk_get_default_registry (),
- e_cal_view_get_type());
- derived_atk_type = atk_object_factory_get_accessible_type (factory);
- g_type_query (derived_atk_type, &query);
-
- tinfo.class_size = query.class_size;
- tinfo.instance_size = query.instance_size;
-
- type = g_type_register_static (derived_atk_type,
- "EaDayView", &tinfo, 0);
- }
-
- return type;
-}
-
-static void
-ea_day_view_class_init (EaDayViewClass *klass)
-{
- AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_peek_parent (klass);
-
- class->get_name = ea_day_view_get_name;
- class->get_description = ea_day_view_get_description;
-
- class->get_n_children = ea_day_view_get_n_children;
- class->ref_child = ea_day_view_ref_child;
-}
-
-AtkObject*
-ea_day_view_new (GtkWidget *widget)
-{
- GObject *object;
- AtkObject *accessible;
-
- g_return_val_if_fail (E_IS_DAY_VIEW (widget), NULL);
-
- object = g_object_new (EA_TYPE_DAY_VIEW, NULL);
-
- accessible = ATK_OBJECT (object);
- atk_object_initialize (accessible, widget);
-
-#ifdef ACC_DEBUG
- printf ("EvoAcc: ea_day_view created %p\n", (void *)accessible);
-#endif
-
- return accessible;
-}
-
-static G_CONST_RETURN gchar*
-ea_day_view_get_name (AtkObject *accessible)
-{
- EDayView *day_view;
- GnomeCalendar *gcal;
- const gchar *label_text;
- GnomeCalendarViewType view_type;
- gchar buffer[128] = "";
- gint n_events;
-
-
- g_return_val_if_fail (EA_IS_DAY_VIEW (accessible), NULL);
-
- if (!GTK_ACCESSIBLE (accessible)->widget)
- return NULL;
- day_view = E_DAY_VIEW (GTK_ACCESSIBLE (accessible)->widget);
-
- gcal = e_calendar_view_get_calendar (E_CALENDAR_VIEW (day_view));
- label_text = calendar_get_text_for_folder_bar_label (gcal);
-
- n_events = atk_object_get_n_accessible_children (accessible);
- /* the child main item is always there */
- --n_events;
- if (n_events > 0)
- g_snprintf (buffer, sizeof (buffer),
- ", %d events", n_events);
- view_type = gnome_calendar_get_view (gcal);
- if (view_type == GNOME_CAL_WORK_WEEK_VIEW)
- accessible->name = g_strconcat ("work week view :",
- label_text, buffer,
- NULL);
- else
- accessible->name = g_strconcat ("day view :",
- label_text, buffer,
- NULL);
- return accessible->name;
-}
-
-static G_CONST_RETURN gchar*
-ea_day_view_get_description (AtkObject *accessible)
-{
- EDayView *day_view;
-
- g_return_val_if_fail (EA_IS_DAY_VIEW (accessible), NULL);
-
- if (!GTK_ACCESSIBLE (accessible)->widget)
- return NULL;
- day_view = E_DAY_VIEW (GTK_ACCESSIBLE (accessible)->widget);
-
- if (accessible->description)
- return accessible->description;
- else {
- GnomeCalendar *gcal;
- GnomeCalendarViewType view_type;
-
- gcal = e_calendar_view_get_calendar (E_CALENDAR_VIEW (day_view));
- view_type = gnome_calendar_get_view (gcal);
-
- if (view_type == GNOME_CAL_WORK_WEEK_VIEW)
- return "calendar view for a work week";
- else
- return "calendar view for one or more days";
- }
-}
-
-static gint
-ea_day_view_get_n_children (AtkObject *accessible)
-{
- EDayView *day_view;
- gint day;
- gint child_num = 0;
-
- g_return_val_if_fail (EA_IS_DAY_VIEW (accessible), -1);
-
- if (!GTK_ACCESSIBLE (accessible)->widget)
- return -1;
-
- day_view = E_DAY_VIEW (GTK_ACCESSIBLE (accessible)->widget);
-
- child_num += day_view->long_events->len;
-
- for (day = 0; day < day_view->days_shown; day++) {
- child_num += day_view->events[day]->len;
- }
-
- /* "+1" for the main item */
- return child_num + 1;
-}
-
-static AtkObject *
-ea_day_view_ref_child (AtkObject *accessible, gint index)
-{
- EDayView *day_view;
- gint child_num;
- gint day;
- AtkObject *atk_object = NULL;
- EDayViewEvent *event = NULL;
-
- g_return_val_if_fail (EA_IS_DAY_VIEW (accessible), NULL);
-
- child_num = atk_object_get_n_accessible_children (accessible);
- if (child_num <= 0 || index < 0 || index >= child_num)
- return NULL;
-
- if (!GTK_ACCESSIBLE (accessible)->widget)
- return NULL;
- day_view = E_DAY_VIEW (GTK_ACCESSIBLE (accessible)->widget);
-
- if (index == 0) {
- /* index == 0 is the main item */
- atk_object = atk_gobject_accessible_for_object (G_OBJECT (day_view->main_canvas_item));
- g_object_ref (atk_object);
- }
- else {
- --index;
- /* a long event */
- if (index < day_view->long_events->len) {
- event = &g_array_index (day_view->long_events,
- EDayViewEvent, index);
- }
- else {
- index -= day_view->long_events->len;
- day = 0;
- while (index >= day_view->events[day]->len) {
- index -= day_view->events[day]->len;
- ++day;
- }
-
- event = &g_array_index (day_view->events[day],
- EDayViewEvent, index);
- }
- if (event && event->canvas_item) {
- /* Not use atk_gobject_accessible_for_object here,
- * we need to do special thing here
- */
- atk_object = ea_calendar_helpers_get_accessible_for (event->canvas_item);
- g_object_ref (atk_object);
- }
- }
- return atk_object;
-}
diff --git a/a11y/calendar/ea-day-view.h b/a11y/calendar/ea-day-view.h
deleted file mode 100644
index 5ca4614f03..0000000000
--- a/a11y/calendar/ea-day-view.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* vim:expandtab:shiftwidth=8:tabstop=8:
- */
-/* Evolution Accessibility: ea-day-view.h
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Bolian Yin <bolian.yin@sun.com> Sun Microsystem Inc., 2003
- *
- */
-
-#ifndef __EA_DAY_VIEW_H__
-#define __EA_DAY_VIEW_H__
-
-#include "ea-cal-view.h"
-#include "e-day-view.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define EA_TYPE_DAY_VIEW (ea_day_view_get_type ())
-#define EA_DAY_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EA_TYPE_DAY_VIEW, EaDayView))
-#define EA_DAY_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EA_TYPE_DAY_VIEW, EaDayViewClass))
-#define EA_IS_DAY_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EA_TYPE_DAY_VIEW))
-#define EA_IS_DAY_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EA_TYPE_DAY_VIEW))
-#define EA_DAY_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EA_TYPE_DAY_VIEW, EaDayViewClass))
-
-typedef struct _EaDayView EaDayView;
-typedef struct _EaDayViewClass EaDayViewClass;
-
-struct _EaDayView
-{
- EaCalView parent;
-};
-
-GType ea_day_view_get_type (void);
-
-struct _EaDayViewClass
-{
- EaCalViewClass parent_class;
-};
-
-AtkObject* ea_day_view_new (GtkWidget *widget);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __EA_DAY_VIEW_H__ */
diff --git a/a11y/calendar/ea-gnome-calendar.c b/a11y/calendar/ea-gnome-calendar.c
deleted file mode 100644
index 9d057ee31a..0000000000
--- a/a11y/calendar/ea-gnome-calendar.c
+++ /dev/null
@@ -1,248 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* vim:expandtab:shiftwidth=8:tabstop=8:
- */
-/* Evolution Accessibility: ea-gnome-calendar.c
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Bolian Yin <bolian.yin@sun.com> Sun Microsystem Inc., 2003
- *
- */
-
-#include "ea-gnome-calendar.h"
-#include "calendar-commands.h"
-#include <gtk/gtknotebook.h>
-
-static void ea_gnome_calendar_class_init (EaGnomeCalendarClass *klass);
-
-static G_CONST_RETURN gchar* ea_gnome_calendar_get_name (AtkObject *accessible);
-static G_CONST_RETURN gchar* ea_gnome_calendar_get_description (AtkObject *accessible);
-static gint ea_gnome_calendar_get_n_children (AtkObject* obj);
-static AtkObject * ea_gnome_calendar_ref_child (AtkObject *obj, gint i);
-
-static void ea_gcal_switch_view_cb (GtkNotebook *widget, GtkNotebookPage *page,
- guint index, gpointer data);
-static void ea_gcal_dates_change_cb (GnomeCalendar *gcal, gpointer data);
-
-static gpointer parent_class = NULL;
-
-GType
-ea_gnome_calendar_get_type (void)
-{
- static GType type = 0;
- AtkObjectFactory *factory;
- GTypeQuery query;
- GType derived_atk_type;
-
- if (!type) {
- static GTypeInfo tinfo = {
- sizeof (EaGnomeCalendarClass),
- (GBaseInitFunc) NULL, /* base init */
- (GBaseFinalizeFunc) NULL, /* base finalize */
- (GClassInitFunc) ea_gnome_calendar_class_init, /* class init */
- (GClassFinalizeFunc) NULL, /* class finalize */
- NULL, /* class data */
- sizeof (EaGnomeCalendar), /* instance size */
- 0, /* nb preallocs */
- (GInstanceInitFunc) NULL, /* instance init */
- NULL /* value table */
- };
-
- /*
- * Figure out the size of the class and instance
- * we are run-time deriving from (GailWidget, in this case)
- */
-
- factory = atk_registry_get_factory (atk_get_default_registry (),
- GTK_TYPE_WIDGET);
- derived_atk_type = atk_object_factory_get_accessible_type (factory);
- g_type_query (derived_atk_type, &query);
- tinfo.class_size = query.class_size;
- tinfo.instance_size = query.instance_size;
-
- type = g_type_register_static (derived_atk_type,
- "EaGnomeCalendar", &tinfo, 0);
-
- }
-
- return type;
-}
-
-static void
-ea_gnome_calendar_class_init (EaGnomeCalendarClass *klass)
-{
- AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_peek_parent (klass);
-
- class->get_name = ea_gnome_calendar_get_name;
- class->get_description = ea_gnome_calendar_get_description;
-
- class->get_n_children = ea_gnome_calendar_get_n_children;
- class->ref_child = ea_gnome_calendar_ref_child;
-}
-
-AtkObject*
-ea_gnome_calendar_new (GtkWidget *widget)
-{
- GObject *object;
- AtkObject *accessible;
- GnomeCalendar *gcal;
- GtkWidget *notebook;
-
- g_return_val_if_fail (GNOME_IS_CALENDAR (widget), NULL);
-
- object = g_object_new (EA_TYPE_GNOME_CALENDAR, NULL);
-
- accessible = ATK_OBJECT (object);
- atk_object_initialize (accessible, widget);
-
- accessible->role = ATK_ROLE_FILLER;
-
- gcal = GNOME_CALENDAR (widget);
-
- /* listen on view type change
- */
- g_signal_connect (widget, "dates_shown_changed",
- G_CALLBACK (ea_gcal_dates_change_cb),
- accessible);
- notebook = gnome_calendar_get_view_notebook_widget (gcal);
- if (notebook) {
- g_signal_connect (notebook, "switch_page",
- G_CALLBACK (ea_gcal_switch_view_cb),
- accessible);
- }
-
-#ifdef ACC_DEBUG
- printf ("EvoAcc: ea-gnome-calendar created: %p\n", (void *)accessible);
-#endif
-
- return accessible;
-}
-
-static G_CONST_RETURN gchar*
-ea_gnome_calendar_get_name (AtkObject *accessible)
-{
- if (accessible->name)
- return accessible->name;
- return "Gnome Calendar";
-}
-
-static G_CONST_RETURN gchar*
-ea_gnome_calendar_get_description (AtkObject *accessible)
-{
- if (accessible->description)
- return accessible->description;
- return "Gnome Calendar";
-}
-
-static gint
-ea_gnome_calendar_get_n_children (AtkObject* obj)
-{
- g_return_val_if_fail (EA_IS_GNOME_CALENDAR (obj), 0);
-
- if (!GTK_ACCESSIBLE (obj)->widget)
- return -1;
- return 4;
-}
-
-static AtkObject *
-ea_gnome_calendar_ref_child (AtkObject *obj, gint i)
-{
- AtkObject * child = NULL;
- GnomeCalendar * calendarWidget;
- GtkWidget *childWidget;
-
- g_return_val_if_fail (EA_IS_GNOME_CALENDAR (obj), NULL);
- /* valid child index range is [0-3] */
- if (i < 0 || i >3 )
- return NULL;
-
- if (!GTK_ACCESSIBLE (obj)->widget)
- return NULL;
- calendarWidget = GNOME_CALENDAR (GTK_ACCESSIBLE (obj)->widget);
-
- switch (i) {
- case 0:
- /* for the search bar */
- childWidget = gnome_calendar_get_search_bar_widget (calendarWidget);
- child = gtk_widget_get_accessible (childWidget);
- atk_object_set_parent (child, obj);
- atk_object_set_name (child, "search bar");
- atk_object_set_description (child, "evolution calendar search bar");
- break;
- case 1:
- /* for the day/week view */
- childWidget = gnome_calendar_get_current_view_widget (calendarWidget);
- child = gtk_widget_get_accessible (childWidget);
- atk_object_set_parent (child, obj);
- break;
- case 2:
- /* for calendar */
- childWidget = gnome_calendar_get_e_calendar_widget (calendarWidget);
- child = gtk_widget_get_accessible (childWidget);
- break;
- case 3:
- /* for todo list */
- childWidget = GTK_WIDGET (gnome_calendar_get_task_pad (calendarWidget));
- child = gtk_widget_get_accessible (childWidget);
- break;
- default:
- break;
- }
- if (child)
- g_object_ref(child);
- return child;
-}
-
-static void
-ea_gcal_switch_view_cb (GtkNotebook *widget, GtkNotebookPage *page,
- guint index, gpointer data)
-{
- GtkWidget *new_widget;
-
- new_widget = gtk_notebook_get_nth_page (widget, index);
-
- /* views are always the second child in gnome calendar
- */
- if (new_widget)
- g_signal_emit_by_name (G_OBJECT(data), "children_changed::add",
- 1, gtk_widget_get_accessible (new_widget), NULL);
-
-#ifdef ACC_DEBUG
- printf ("AccDebug: view switch to widget %p (index=%d) \n",
- (void *)new_widget, index);
-#endif
-}
-
-static void
-ea_gcal_dates_change_cb (GnomeCalendar *gcal, gpointer data)
-{
- const gchar *new_name;
-
- g_return_if_fail (GNOME_IS_CALENDAR (gcal));
- g_return_if_fail (data);
- g_return_if_fail (EA_IS_GNOME_CALENDAR (data));
-
- new_name = calendar_get_text_for_folder_bar_label (gcal);
- atk_object_set_name (ATK_OBJECT(data), new_name);
- g_signal_emit_by_name (data, "visible_data_changed");
-
-#ifdef ACC_DEBUG
- printf ("AccDebug: calendar dates changed, label=%s\n", new_name);
-#endif
-}
diff --git a/a11y/calendar/ea-gnome-calendar.h b/a11y/calendar/ea-gnome-calendar.h
deleted file mode 100644
index 2cb39219c4..0000000000
--- a/a11y/calendar/ea-gnome-calendar.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* vim:expandtab:shiftwidth=8:tabstop=8:
- */
-/* Evolution Accessibility: ea-gnome-calendar.h
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Bolian Yin <bolian.yin@sun.com> Sun Microsystem Inc., 2003
- *
- */
-
-#ifndef __EA_GNOME_CALENDAR_H__
-#define __EA_GNOME_CALENDAR_H__
-
-#include <gtk/gtkaccessible.h>
-#include "gnome-cal.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define EA_TYPE_GNOME_CALENDAR (ea_gnome_calendar_get_type ())
-#define EA_GNOME_CALENDAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EA_TYPE_GNOME_CALENDAR, EaGnomeCalendar))
-#define EA_GNOME_CALENDAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EA_TYPE_GNOME_CALENDAR, EaGnomeCalendarClass))
-#define EA_IS_GNOME_CALENDAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EA_TYPE_GNOME_CALENDAR))
-#define EA_IS_GNOME_CALENDAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EA_TYPE_GNOME_CALENDAR))
-#define EA_GNOME_CALENDAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EA_TYPE_GNOME_CALENDAR, EaGnomeCalendarClass))
-
-typedef struct _EaGnomeCalendar EaGnomeCalendar;
-typedef struct _EaGnomeCalendarClass EaGnomeCalendarClass;
-
-struct _EaGnomeCalendar
-{
- GtkAccessible parent;
-};
-
-GType ea_gnome_calendar_get_type (void);
-
-struct _EaGnomeCalendarClass
-{
- GtkAccessibleClass parent_class;
-};
-
-AtkObject* ea_gnome_calendar_new (GtkWidget *widget);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* __EA_GNOME_CALENDAR_H__ */
diff --git a/a11y/calendar/ea-week-view.c b/a11y/calendar/ea-week-view.c
deleted file mode 100644
index 3c3e13a268..0000000000
--- a/a11y/calendar/ea-week-view.c
+++ /dev/null
@@ -1,305 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* vim:expandtab:shiftwidth=8:tabstop=8:
- */
-/* Evolution Accessibility: ea-week-view.c
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Bolian Yin <bolian.yin@sun.com> Sun Microsystem Inc., 2003
- *
- */
-
-#include "ea-week-view.h"
-#include "ea-cal-view.h"
-#include "ea-cal-view-event.h"
-#include "ea-calendar-helpers.h"
-#include "calendar-commands.h"
-#include <gal/e-text/e-text.h>
-
-static void ea_week_view_class_init (EaWeekViewClass *klass);
-
-static G_CONST_RETURN gchar* ea_week_view_get_name (AtkObject *accessible);
-static G_CONST_RETURN gchar* ea_week_view_get_description (AtkObject *accessible);
-static gint ea_week_view_get_n_children (AtkObject *obj);
-static AtkObject* ea_week_view_ref_child (AtkObject *obj,
- gint i);
-
-static gpointer parent_class = NULL;
-
-GType
-ea_week_view_get_type (void)
-{
- static GType type = 0;
- AtkObjectFactory *factory;
- GTypeQuery query;
- GType derived_atk_type;
-
- if (!type) {
- static GTypeInfo tinfo = {
- sizeof (EaWeekViewClass),
- (GBaseInitFunc) NULL, /* base init */
- (GBaseFinalizeFunc) NULL, /* base finalize */
- (GClassInitFunc) ea_week_view_class_init, /* class init */
- (GClassFinalizeFunc) NULL, /* class finalize */
- NULL, /* class data */
- sizeof (EaWeekView), /* instance size */
- 0, /* nb preallocs */
- (GInstanceInitFunc) NULL, /* instance init */
- NULL /* value table */
- };
-
- /*
- * Figure out the size of the class and instance
- * we are run-time deriving from (EaCalView, in this case)
- *
- * Note: we must still use run-time deriving here, because
- * our parent class EaCalView is run-time deriving.
- */
-
- factory = atk_registry_get_factory (atk_get_default_registry (),
- e_cal_view_get_type());
- derived_atk_type = atk_object_factory_get_accessible_type (factory);
- g_type_query (derived_atk_type, &query);
-
- tinfo.class_size = query.class_size;
- tinfo.instance_size = query.instance_size;
-
- type = g_type_register_static (derived_atk_type,
- "EaWeekView", &tinfo, 0);
-
- }
-
- return type;
-}
-
-static void
-ea_week_view_class_init (EaWeekViewClass *klass)
-{
- AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_peek_parent (klass);
-
- class->get_name = ea_week_view_get_name;
- class->get_description = ea_week_view_get_description;
-
- class->get_n_children = ea_week_view_get_n_children;
- class->ref_child = ea_week_view_ref_child;
-}
-
-AtkObject*
-ea_week_view_new (GtkWidget *widget)
-{
- GObject *object;
- AtkObject *accessible;
-
- g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
-
- object = g_object_new (EA_TYPE_WEEK_VIEW, NULL);
-
- accessible = ATK_OBJECT (object);
- atk_object_initialize (accessible, widget);
-
-#ifdef ACC_DEBUG
- printf ("EvoAcc: ea_week_view created %p\n", (void *)accessible);
-#endif
-
- return accessible;
-}
-
-static G_CONST_RETURN gchar*
-ea_week_view_get_name (AtkObject *accessible)
-{
- EWeekView *week_view;
- GnomeCalendar *gcal;
- const gchar *label_text;
- GnomeCalendarViewType view_type;
- gchar buffer[128] = "";
- gint n_events;
-
- g_return_val_if_fail (EA_IS_WEEK_VIEW (accessible), NULL);
-
- if (!GTK_ACCESSIBLE (accessible)->widget)
- return NULL;
- week_view = E_WEEK_VIEW (GTK_ACCESSIBLE (accessible)->widget);
-
- gcal = e_calendar_view_get_calendar (E_CALENDAR_VIEW (week_view));
- label_text = calendar_get_text_for_folder_bar_label (gcal);
-
- n_events = atk_object_get_n_accessible_children (accessible);
- /* the child main item is always there */
- --n_events;
- if (n_events > 0)
- g_snprintf (buffer, sizeof (buffer),
- ", %d events", n_events);
-
- view_type = gnome_calendar_get_view (gcal);
-
- if (view_type == GNOME_CAL_MONTH_VIEW)
- accessible->name = g_strconcat ("month view :",
- label_text, buffer,
- NULL);
-
- else
- accessible->name = g_strconcat ("week view :",
- label_text, buffer,
- NULL);
- return accessible->name;
-}
-
-static G_CONST_RETURN gchar*
-ea_week_view_get_description (AtkObject *accessible)
-{
- EWeekView *week_view;
-
- g_return_val_if_fail (EA_IS_WEEK_VIEW (accessible), NULL);
-
- if (!GTK_ACCESSIBLE (accessible)->widget)
- return NULL;
- week_view = E_WEEK_VIEW (GTK_ACCESSIBLE (accessible)->widget);
-
- if (accessible->description)
- return accessible->description;
- else {
- GnomeCalendar *gcal;
- GnomeCalendarViewType view_type;
-
- gcal = e_calendar_view_get_calendar (E_CALENDAR_VIEW (week_view));
- view_type = gnome_calendar_get_view (gcal);
-
- if (view_type == GNOME_CAL_MONTH_VIEW)
- return "calendar view for a month";
- else
- return "calendar view for one or more weeks";
- }
-}
-
-static gint
-ea_week_view_get_n_children (AtkObject *accessible)
-{
- EWeekView *week_view;
- GnomeCanvasGroup *canvas_group;
- gint i, count = 0;
- gint event_index;
-
- g_return_val_if_fail (EA_IS_WEEK_VIEW (accessible), -1);
-
- if (!GTK_ACCESSIBLE (accessible)->widget)
- return -1;
- week_view = E_WEEK_VIEW (GTK_ACCESSIBLE (accessible)->widget);
-
- for (event_index = 0; event_index < week_view->events->len;
- ++event_index) {
- EWeekViewEvent *event;
- EWeekViewEventSpan *span;
-
- event = &g_array_index (week_view->events,
- EWeekViewEvent, event_index);
- if (!event)
- continue;
- span = &g_array_index (week_view->spans, EWeekViewEventSpan,
- event->spans_index + 0);
-
- if (!span)
- continue;
-
- /* at least one of the event spans is visible, count it */
- if (span->text_item)
- ++count;
- }
-
- /* add the number of visible jump buttons */
- for (i = 0; i < E_WEEK_VIEW_MAX_WEEKS * 7; i++) {
- if (week_view->jump_buttons[i]->object.flags & GNOME_CANVAS_ITEM_VISIBLE)
- ++count;
- }
-
-#ifdef ACC_DEBUG
- printf("AccDebug: week view %p has %d children\n", (void *)week_view, count);
-#endif
- return count;
-}
-
-static AtkObject *
-ea_week_view_ref_child (AtkObject *accessible, gint index)
-{
- EWeekView *week_view;
- gint child_num, max_count;
- AtkObject *atk_object = NULL;
- gint event_index;
- gint jump_button = -1;
- gint span_num = 0;
- gint count = 0;
-
- g_return_val_if_fail (EA_IS_WEEK_VIEW (accessible), NULL);
-
- child_num = atk_object_get_n_accessible_children (accessible);
- if (child_num <= 0 || index < 0 || index >= child_num)
- return NULL;
-
- if (!GTK_ACCESSIBLE (accessible)->widget)
- return NULL;
- week_view = E_WEEK_VIEW (GTK_ACCESSIBLE (accessible)->widget);
- max_count = week_view->events->len;
-
- for (event_index = 0; event_index < max_count; ++event_index) {
- EWeekViewEvent *event;
- EWeekViewEventSpan *span;
- gint current_day;
-
- event = &g_array_index (week_view->events,
- EWeekViewEvent, event_index);
- if (!event)
- continue;
-
- span = &g_array_index (week_view->spans, EWeekViewEventSpan,
- event->spans_index + span_num);
-
- if (!span)
- continue;
-
- current_day = span->start_day;
- if (span->text_item)
- ++count;
- else if (current_day != jump_button) {
- /* we should go to the jump button */
- jump_button = current_day;
- ++count;
- }
- else
- continue;
-
- if (count == (index + 1)) {
- if (span->text_item) {
- /* Not use atk_gobject_accessible_for_object for event
- * text_item we need to do special thing here
- */
- atk_object = ea_calendar_helpers_get_accessible_for (span->text_item);
- }
- else {
- atk_object = atk_gobject_accessible_for_object (G_OBJECT(week_view->jump_buttons[current_day == -1 ? 0 : current_day]));
- }
- g_object_ref (atk_object);
- break;
- }
- }
-
-#ifdef ACC_DEBUG
- printf ("EvoAcc: ea_week_view_ref_child [%d]=%p\n",
- index, (void *)atk_object);
-#endif
- return atk_object;
-}
diff --git a/a11y/calendar/ea-week-view.h b/a11y/calendar/ea-week-view.h
deleted file mode 100644
index f0ed117375..0000000000
--- a/a11y/calendar/ea-week-view.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* vim:expandtab:shiftwidth=8:tabstop=8:
- */
-/* Evolution Accessibility: ea-week-view.h
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Bolian Yin <bolian.yin@sun.com> Sun Microsystem Inc., 2003
- *
- */
-
-#ifndef __EA_WEEK_VIEW_H__
-#define __EA_WEEK_VIEW_H__
-
-#include <gtk/gtkaccessible.h>
-#include "e-week-view.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define EA_TYPE_WEEK_VIEW (ea_week_view_get_type ())
-#define EA_WEEK_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EA_TYPE_WEEK_VIEW, EaWeekView))
-#define EA_WEEK_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EA_TYPE_WEEK_VIEW, EaWeekViewClass))
-#define EA_IS_WEEK_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EA_TYPE_WEEK_VIEW))
-#define EA_IS_WEEK_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EA_TYPE_WEEK_VIEW))
-#define EA_WEEK_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EA_TYPE_WEEK_VIEW, EaWeekViewClass))
-
-typedef struct _EaWeekView EaWeekView;
-typedef struct _EaWeekViewClass EaWeekViewClass;
-
-struct _EaWeekView
-{
- GtkAccessible parent;
-};
-
-GType ea_week_view_get_type (void);
-
-struct _EaWeekViewClass
-{
- GtkAccessibleClass parent_class;
-};
-
-AtkObject* ea_week_view_new (GtkWidget *widget);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* __EA_WEEK_VIEW_H__ */
diff --git a/a11y/e-table/.cvsignore b/a11y/e-table/.cvsignore
deleted file mode 100644
index 5b48d3f593..0000000000
--- a/a11y/e-table/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-.libs
-Makefile.in
-Makefile
-*.la
diff --git a/a11y/e-table/gal-a11y-e-cell-popup.c b/a11y/e-table/gal-a11y-e-cell-popup.c
deleted file mode 100644
index 88325e726e..0000000000
--- a/a11y/e-table/gal-a11y-e-cell-popup.c
+++ /dev/null
@@ -1,146 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* vim:expandtab:shiftwidth=8:tabstop=8:
- */
-/* Evolution Accessibility: gal-a11y-e-cell-popup.h
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Yang Wu <yang.wu@sun.com> Sun Microsystem Inc., 2003
- *
- */
-
-#include <config.h>
-#include <gal/e-table/e-cell-popup.h>
-#include "gal-a11y-e-cell-popup.h"
-#include "gal-a11y-util.h"
-#include <atk/atkobject.h>
-#include <gdk/gdkkeysyms.h>
-#include <gtk/gtkwidget.h>
-
-static AtkObjectClass *parent_class = NULL;
-#define PARENT_TYPE (gal_a11y_e_cell_get_type ())
-
-static void gal_a11y_e_cell_popup_class_init (GalA11yECellPopupClass *klass);
-static void popup_cell_action (GalA11yECell *cell);
-
-/**
- * gal_a11y_e_cell_popup_get_type:
- * @void:
- *
- * Registers the &GalA11yECellPopup class if necessary, and returns the type ID
- * associated to it.
- *
- * Return value: The type ID of the &GalA11yECellPopup class.
- **/
-GType
-gal_a11y_e_cell_popup_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- GTypeInfo info = {
- sizeof (GalA11yECellPopupClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) gal_a11y_e_cell_popup_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (GalA11yECellPopup),
- 0,
- (GInstanceInitFunc) NULL,
- NULL /* value_cell_popup */
- };
-
- type = g_type_register_static (PARENT_TYPE, "GalA11yECellPopup", &info, 0);
- gal_a11y_e_cell_type_add_action_interface (type);
- }
-
- return type;
-}
-
-static void
-gal_a11y_e_cell_popup_class_init (GalA11yECellPopupClass *klass)
-{
- AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-}
-
-AtkObject *
-gal_a11y_e_cell_popup_new (ETableItem *item,
- ECellView *cell_view,
- AtkObject *parent,
- int model_col,
- int view_col,
- int row)
-{
- AtkObject *a11y;
- GalA11yECell *cell;
- ECellPopup *popupcell;
- ECellView* child_view = NULL;
-
- popupcell= E_CELL_POPUP(cell_view->ecell);
-
- if (popupcell && popupcell->popup_cell_view)
- child_view = popupcell->popup_cell_view->child_view;
-
- if (child_view && child_view->ecell) {
- a11y = gal_a11y_e_cell_registry_get_object (NULL,
- item,
- child_view,
- parent,
- model_col,
- view_col,
- row);
- } else {
- a11y = g_object_new (GAL_A11Y_TYPE_E_CELL_POPUP, NULL);
- gal_a11y_e_cell_construct (a11y,
- item,
- cell_view,
- parent,
- model_col,
- view_col,
- row);
- }
- g_return_val_if_fail (a11y != NULL, NULL);
- cell = GAL_A11Y_E_CELL(a11y);
- gal_a11y_e_cell_add_action (cell,
- "popup", /* action name*/
- "popup a child", /* action description */
- "<Alt>Down", /* action keybinding */
- popup_cell_action);
-
- a11y->role = ATK_ROLE_TABLE_CELL;
- return a11y;
-}
-
-static void
-popup_cell_action (GalA11yECell *cell)
-{
- ECellPopup *ecp;
- gint finished;
- GdkEvent event;
-
- event.key.type = GDK_KEY_PRESS;
- event.key.window = GTK_LAYOUT(GNOME_CANVAS_ITEM(cell->item)->canvas)->bin_window;;
- event.key.send_event = TRUE;
- event.key.time = GDK_CURRENT_TIME;
- event.key.state = GDK_MOD1_MASK;
- event.key.keyval = GDK_Down;
-
- g_signal_emit_by_name (cell->item, "event", &event, &finished);
-}
diff --git a/a11y/e-table/gal-a11y-e-cell-popup.h b/a11y/e-table/gal-a11y-e-cell-popup.h
deleted file mode 100644
index 5809f9b4f4..0000000000
--- a/a11y/e-table/gal-a11y-e-cell-popup.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* vim:expandtab:shiftwidth=8:tabstop=8:
- */
-/* Evolution Accessibility: gal-a11y-e-cell-popup.h
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Yang Wu <yang.wu@sun.com> Sun Microsystem Inc., 2003
- *
- */
-
-#ifndef __GAL_A11Y_E_CELL_POPUP_H__
-#define __GAL_A11Y_E_CELL_POPUP_H__
-
-#include <glib-object.h>
-#include <gal/e-table/e-table-item.h>
-#include <a11y/e-table/gal-a11y-e-cell.h>
-#include <atk/atkgobjectaccessible.h>
-
-#define GAL_A11Y_TYPE_E_CELL_POPUP (gal_a11y_e_cell_popup_get_type ())
-#define GAL_A11Y_E_CELL_POPUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAL_A11Y_TYPE_E_CELL_POPUP, GalA11yECellPopup))
-#define GAL_A11Y_E_CELL_POPUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAL_A11Y_TYPE_E_CELL_POPUP, GalA11yECellPopupClass))
-#define GAL_A11Y_IS_E_CELL_POPUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAL_A11Y_TYPE_E_CELL_POPUP))
-#define GAL_A11Y_IS_E_CELL_POPUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAL_A11Y_TYPE_E_CELL_POPUP))
-
-typedef struct _GalA11yECellPopup GalA11yECellPopup;
-typedef struct _GalA11yECellPopupClass GalA11yECellPopupClass;
-
-/* This struct should actually be larger as this isn't what we derive from.
- * The GalA11yECellPopupPrivate comes right after the parent class structure.
- **/
-struct _GalA11yECellPopup {
- GalA11yECell object;
-};
-
-struct _GalA11yECellPopupClass {
- GalA11yECellClass parent_class;
-};
-
-
-/* Standard Glib function */
-GType gal_a11y_e_cell_popup_get_type (void);
-AtkObject *gal_a11y_e_cell_popup_new (ETableItem *item,
- ECellView *cell_view,
- AtkObject *parent,
- int model_col,
- int view_col,
- int row);
-
-#endif /* ! __GAL_A11Y_E_CELL_POPUP_H__ */
diff --git a/a11y/e-table/gal-a11y-e-cell-registry.c b/a11y/e-table/gal-a11y-e-cell-registry.c
deleted file mode 100644
index 7110179554..0000000000
--- a/a11y/e-table/gal-a11y-e-cell-registry.c
+++ /dev/null
@@ -1,132 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Christopher James Lahey <clahey@ximian.com>
- *
- * Copyright (C) 2002 Ximian, Inc.
- */
-
-#include <config.h>
-#include "gal-a11y-e-cell-registry.h"
-#include "gal-a11y-e-cell.h"
-
-static GObjectClass *parent_class;
-static GalA11yECellRegistry *default_registry;
-#define PARENT_TYPE (G_TYPE_OBJECT)
-
-struct _GalA11yECellRegistryPrivate {
- GHashTable *table;
-};
-
-/* Static functions */
-
-static void
-gal_a11y_e_cell_registry_finalize (GObject *obj)
-{
- GalA11yECellRegistry *registry = GAL_A11Y_E_CELL_REGISTRY (obj);
-
- g_hash_table_destroy (registry->priv->table);
- g_free (registry->priv);
-}
-
-static void
-gal_a11y_e_cell_registry_class_init (GalA11yECellRegistryClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- object_class->finalize = gal_a11y_e_cell_registry_finalize;
-}
-
-static void
-gal_a11y_e_cell_registry_init (GalA11yECellRegistry *registry)
-{
- registry->priv = g_new (GalA11yECellRegistryPrivate, 1);
- registry->priv->table = g_hash_table_new (NULL, NULL);
-}
-
-/**
- * gal_a11y_e_cell_registry_get_type:
- * @void:
- *
- * Registers the &GalA11yECellRegistry class if necessary, and returns the type ID
- * associated to it.
- *
- * Return value: The type ID of the &GalA11yECellRegistry class.
- **/
-GType
-gal_a11y_e_cell_registry_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- GTypeInfo info = {
- sizeof (GalA11yECellRegistryClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) gal_a11y_e_cell_registry_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (GalA11yECellRegistry),
- 0,
- (GInstanceInitFunc) gal_a11y_e_cell_registry_init,
- NULL /* value_cell */
- };
-
- type = g_type_register_static (PARENT_TYPE, "GalA11yECellRegistry", &info, 0);
- }
-
- return type;
-}
-
-static void
-init_default_registry (void)
-{
- if (default_registry == NULL) {
- default_registry = g_object_new (gal_a11y_e_cell_registry_get_type(), NULL);
- }
-}
-
-
-AtkObject *
-gal_a11y_e_cell_registry_get_object (GalA11yECellRegistry *registry,
- ETableItem *item,
- ECellView *cell_view,
- AtkObject *parent,
- int model_col,
- int view_col,
- int row)
-{
- GalA11yECellRegistryFunc func = NULL;
- GType type;
-
- if (registry == NULL) {
- init_default_registry ();
- registry = default_registry;
- }
-
- type = GTK_OBJECT_TYPE (cell_view->ecell);
- while (func == NULL && type != 0) {
- func = g_hash_table_lookup (registry->priv->table, GINT_TO_POINTER (type));
- type = g_type_parent (type);
- }
-
- if (func)
- return func (item, cell_view, parent, model_col, view_col, row);
- else
- return gal_a11y_e_cell_new (item, cell_view, parent, model_col, view_col, row);
-}
-
-void
-gal_a11y_e_cell_registry_add_cell_type (GalA11yECellRegistry *registry,
- GType type,
- GalA11yECellRegistryFunc func)
-{
- if (registry == NULL) {
- init_default_registry ();
- registry = default_registry;
- }
-
- g_hash_table_insert (registry->priv->table, GINT_TO_POINTER (type), func);
-}
diff --git a/a11y/e-table/gal-a11y-e-cell-registry.h b/a11y/e-table/gal-a11y-e-cell-registry.h
deleted file mode 100644
index eecd41139c..0000000000
--- a/a11y/e-table/gal-a11y-e-cell-registry.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Christopher James Lahey <clahey@ximian.com>
- *
- * Copyright (C) 2001 Chris Lahey
- */
-
-#ifndef __GAL_A11Y_E_CELL_REGISTRY_H__
-#define __GAL_A11Y_E_CELL_REGISTRY_H__
-
-#include <glib-object.h>
-#include <atk/atkobject.h>
-#include <gal/e-table/e-table-item.h>
-#include <gal/e-table/e-cell.h>
-
-#define GAL_A11Y_TYPE_E_CELL_REGISTRY (gal_a11y_e_cell_registry_get_type ())
-#define GAL_A11Y_E_CELL_REGISTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAL_A11Y_TYPE_E_CELL_REGISTRY, GalA11yECellRegistry))
-#define GAL_A11Y_E_CELL_REGISTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAL_A11Y_TYPE_E_CELL_REGISTRY, GalA11yECellRegistryClass))
-#define GAL_A11Y_IS_E_CELL_REGISTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAL_A11Y_TYPE_E_CELL_REGISTRY))
-#define GAL_A11Y_IS_E_CELL_REGISTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAL_A11Y_TYPE_E_CELL_REGISTRY))
-
-typedef struct _GalA11yECellRegistry GalA11yECellRegistry;
-typedef struct _GalA11yECellRegistryClass GalA11yECellRegistryClass;
-typedef struct _GalA11yECellRegistryPrivate GalA11yECellRegistryPrivate;
-
-typedef AtkObject *(*GalA11yECellRegistryFunc) (ETableItem *item,
- ECellView *cell_view,
- AtkObject *parent,
- int model_col,
- int view_col,
- int row);
-
-struct _GalA11yECellRegistry {
- GObject object;
-
- GalA11yECellRegistryPrivate *priv;
-};
-
-struct _GalA11yECellRegistryClass {
- GObjectClass parent_class;
-};
-
-
-/* Standard Glib function */
-GType gal_a11y_e_cell_registry_get_type (void);
-AtkObject *gal_a11y_e_cell_registry_get_object (GalA11yECellRegistry *registry,
- ETableItem *item,
- ECellView *cell_view,
- AtkObject *parent,
- int model_col,
- int view_col,
- int row);
-void gal_a11y_e_cell_registry_add_cell_type (GalA11yECellRegistry *registry,
- GType type,
- GalA11yECellRegistryFunc func);
-
-#endif /* ! __GAL_A11Y_E_CELL_REGISTRY_H__ */
diff --git a/a11y/e-table/gal-a11y-e-cell-text.c b/a11y/e-table/gal-a11y-e-cell-text.c
deleted file mode 100644
index e23d1f2feb..0000000000
--- a/a11y/e-table/gal-a11y-e-cell-text.c
+++ /dev/null
@@ -1,567 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Christopher James Lahey <clahey@ximian.com>
- *
- * Copyright (C) 2002 Ximian, Inc.
- */
-
-#include <config.h>
-#include "gal-a11y-e-cell-text.h"
-#include "gal-a11y-util.h"
-#include <gal/e-table/e-cell-text.h>
-#include <atk/atkobject.h>
-#include <atk/atktext.h>
-#include <atk/atkeditabletext.h>
-#include <atk/atkaction.h>
-
-#define CS_CLASS(a11y) (G_TYPE_INSTANCE_GET_CLASS ((a11y), C_TYPE_STREAM, GalA11yECellTextClass))
-static AtkObjectClass *parent_class;
-#define PARENT_TYPE (gal_a11y_e_cell_get_type ())
-
-/* Static functions */
-static G_CONST_RETURN gchar*
-ect_get_name (AtkObject * a11y)
-{
- GalA11yECell *gaec = GAL_A11Y_E_CELL (a11y);
- ECellText *ect = E_CELL_TEXT (gaec->cell_view->ecell);
- return e_cell_text_get_text (ect, gaec->item->table_model, gaec->model_col, gaec->row);
-}
-
-static gchar *
-ect_get_text (AtkText *text,
- gint start_offset,
- gint end_offset)
-{
- GalA11yECell *gaec = GAL_A11Y_E_CELL (text);
- ECellText *ect = E_CELL_TEXT (gaec->cell_view->ecell);
- gchar *ret_val;
- gchar *full_text = e_cell_text_get_text (ect, gaec->item->table_model, gaec->model_col, gaec->row);
-
- if (end_offset == -1)
- end_offset = strlen (full_text);
- else
- end_offset = g_utf8_offset_to_pointer (full_text, end_offset) - full_text;
-
- start_offset = g_utf8_offset_to_pointer (full_text, start_offset) - full_text;
-
- ret_val = g_strndup (full_text + start_offset, end_offset - start_offset);
-
- e_cell_text_free_text (ect, full_text);
-
- return ret_val;
-}
-
-static gchar *
-ect_get_text_after_offset (AtkText *text,
- gint offset,
- AtkTextBoundary boundary_type,
- gint *start_offset,
- gint *end_offset)
-{
- /* Unimplemented */
- return NULL;
-}
-
-static gchar *
-ect_get_text_at_offset (AtkText *text,
- gint offset,
- AtkTextBoundary boundary_type,
- gint *start_offset,
- gint *end_offset)
-{
- /* Unimplemented */
- return NULL;
-}
-
-static gunichar
-ect_get_character_at_offset (AtkText *text,
- gint offset)
-{
- GalA11yECell *gaec = GAL_A11Y_E_CELL (text);
- ECellText *ect = E_CELL_TEXT (gaec->cell_view->ecell);
- gunichar ret_val;
- gchar *at_offset;
- gchar *full_text = e_cell_text_get_text (ect, gaec->item->table_model, gaec->model_col, gaec->row);
- at_offset = g_utf8_offset_to_pointer (full_text, offset);
- ret_val = g_utf8_get_char_validated (at_offset, -1);
- e_cell_text_free_text (ect, full_text);
-
- return ret_val;
-}
-
-
-static gchar*
-ect_get_text_before_offset (AtkText *text,
- gint offset,
- AtkTextBoundary boundary_type,
- gint *start_offset,
- gint *end_offset)
-{
- /* Unimplemented */
- return NULL;
-}
-
-
-static gint
-ect_get_caret_offset (AtkText *text)
-{
- GalA11yECell *gaec = GAL_A11Y_E_CELL (text);
- ECellText *ect = E_CELL_TEXT (gaec->cell_view->ecell);
- gint start, end;
-
- if (e_cell_text_get_selection (gaec->cell_view,
- gaec->view_col, gaec->row,
- &start, &end)) {
- gchar *full_text = e_cell_text_get_text (ect, gaec->item->table_model, gaec->model_col, gaec->row);
- end = g_utf8_pointer_to_offset (full_text, full_text + end);
- e_cell_text_free_text (ect, full_text);
-
- return end;
- }
- else
- return -1;
-}
-
-static AtkAttributeSet*
-ect_get_run_attributes (AtkText *text,
- gint offset,
- gint *start_offset,
- gint *end_offset)
-{
- /* Unimplemented */
- return NULL;
-}
-
-
-static AtkAttributeSet*
-ect_get_default_attributes (AtkText *text)
-{
- /* Unimplemented */
- return NULL;
-}
-
-
-static void
-ect_get_character_extents (AtkText *text,
- gint offset,
- gint *x,
- gint *y,
- gint *width,
- gint *height,
- AtkCoordType coords)
-{
- /* Unimplemented */
-}
-
-
-static gint
-ect_get_character_count (AtkText *text)
-{
- GalA11yECell *gaec = GAL_A11Y_E_CELL (text);
- ECellText *ect = E_CELL_TEXT (gaec->cell_view->ecell);
- gint ret_val;
-
- gchar *full_text = e_cell_text_get_text (ect, gaec->item->table_model, gaec->model_col, gaec->row);
-
- ret_val = g_utf8_strlen (full_text, -1);
- e_cell_text_free_text (ect, full_text);
- return ret_val;
-}
-
-
-static gint
-ect_get_offset_at_point (AtkText *text,
- gint x,
- gint y,
- AtkCoordType coords)
-{
- /* Unimplemented */
- return 0;
-}
-
-
-static gint
-ect_get_n_selections (AtkText *text)
-{
- GalA11yECell *gaec = GAL_A11Y_E_CELL (text);
- gint selection_start, selection_end;
- if (e_cell_text_get_selection (gaec->cell_view,
- gaec->view_col, gaec->row,
- &selection_start,
- &selection_end)
- && selection_start != selection_end)
- return 1;
- return 0;
-}
-
-
-static gchar*
-ect_get_selection (AtkText *text,
- gint selection_num,
- gint *start_offset,
- gint *end_offset)
-{
- GalA11yECell *gaec = GAL_A11Y_E_CELL (text);
- ECellText *ect = E_CELL_TEXT (gaec->cell_view->ecell);
- gchar *ret_val;
- gint selection_start, selection_end;
-
- if (selection_num == 0
- && e_cell_text_get_selection (gaec->cell_view,
- gaec->view_col, gaec->row,
- &selection_start,
- &selection_end)
- && selection_start != selection_end) {
- gint real_start, real_end, len;
- gchar *full_text = e_cell_text_get_text (ect, gaec->item->table_model, gaec->model_col, gaec->row);
- len = strlen (full_text);
- real_start = MIN (selection_start, selection_end);
- real_end = MAX (selection_start, selection_end);
- real_start = MIN (MAX (0, real_start), len);
- real_end = MIN (MAX (0, real_end), len);
-
- ret_val = g_strndup (full_text + real_start, real_end - real_start);
-
- real_start = g_utf8_pointer_to_offset (full_text, full_text + real_start);
- real_end = g_utf8_pointer_to_offset (full_text, full_text + real_end);
-
- if (start_offset)
- *start_offset = real_start;
- if (end_offset)
- *end_offset = real_end;
- e_cell_text_free_text (ect, full_text);
- } else {
- if (start_offset)
- *start_offset = 0;
- if (end_offset)
- *end_offset = 0;
- ret_val = NULL;
- }
-
- return ret_val;
-}
-
-
-static gboolean
-ect_add_selection (AtkText *text,
- gint start_offset,
- gint end_offset)
-{
- GalA11yECell *gaec = GAL_A11Y_E_CELL (text);
- ECellText *ect = E_CELL_TEXT (gaec->cell_view->ecell);
-
- if (start_offset != end_offset) {
- gint real_start, real_end, len;
- gchar *full_text =
- e_cell_text_get_text (ect, gaec->item->table_model, gaec->model_col, gaec->row);
-
- len = g_utf8_strlen (full_text, -1);
- if (end_offset == -1)
- end_offset = len;
-
- real_start = MIN (start_offset, end_offset);
- real_end = MAX (start_offset, end_offset);
-
- real_start = MIN (MAX (0, real_start), len);
- real_end = MIN (MAX (0, real_end), len);
-
- real_start = g_utf8_offset_to_pointer (full_text, real_start) - full_text;
- real_end = g_utf8_offset_to_pointer (full_text, real_end) - full_text;
- e_cell_text_free_text (ect, full_text);
-
- if (e_cell_text_set_selection (gaec->cell_view,
- gaec->view_col, gaec->row,
- real_start, real_end)) {
- g_signal_emit_by_name (ATK_OBJECT(text), "text_selection_changed");
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
-
-static gboolean
-ect_remove_selection (AtkText *text,
- gint selection_num)
-{
- GalA11yECell *gaec = GAL_A11Y_E_CELL (text);
- ECellText *ect = E_CELL_TEXT (gaec->cell_view->ecell);
- gint selection_start, selection_end;
-
- if (selection_num == 0
- && e_cell_text_get_selection (gaec->cell_view,
- gaec->view_col, gaec->row,
- &selection_start,
- &selection_end)
- && selection_start != selection_end
- && e_cell_text_set_selection (gaec->cell_view,
- gaec->view_col, gaec->row,
- selection_end, selection_end)) {
- g_signal_emit_by_name (ATK_OBJECT(text), "text_selection_changed");
- return TRUE;
- }
- else
- return FALSE;
-}
-
-
-static gboolean
-ect_set_selection (AtkText *text,
- gint selection_num,
- gint start_offset,
- gint end_offset)
-{
- if (selection_num == 0) {
- atk_text_add_selection (text, start_offset, end_offset);
- return TRUE;
- }
- else
- return FALSE;
-}
-
-
-static gboolean
-ect_set_caret_offset (AtkText *text,
- gint offset)
-{
- GalA11yECell *gaec = GAL_A11Y_E_CELL (text);
- ECellText *ect = E_CELL_TEXT (gaec->cell_view->ecell);
- gchar *full_text;
- gint len;
-
- full_text = e_cell_text_get_text (ect, gaec->item->table_model, gaec->model_col, gaec->row);
-
- len = g_utf8_strlen (full_text, -1);
- if (offset == -1)
- offset = len;
- else
- offset = MIN (MAX (0, offset), len);
-
- offset = g_utf8_offset_to_pointer (full_text, offset) - full_text;
-
- e_cell_text_free_text (ect, full_text);
-
- return e_cell_text_set_selection (gaec->cell_view,
- gaec->view_col, gaec->row,
- offset, offset);
-}
-
-static gboolean
-ect_set_run_attributes (AtkEditableText *text,
- AtkAttributeSet *attrib_set,
- gint start_offset,
- gint end_offset)
-{
- /* Unimplemented */
- return FALSE;
-}
-
-static void
-ect_set_text_contents (AtkEditableText *text,
- const gchar *string)
-{
- GalA11yECell *gaec = GAL_A11Y_E_CELL (text);
- ECellText *ect = E_CELL_TEXT (gaec->cell_view->ecell);
-
- e_cell_text_set_value (ect, gaec->item->table_model, gaec->model_col, gaec->row, string);
- e_table_item_enter_edit (gaec->item, gaec->view_col, gaec->row);
-}
-
-static void
-ect_insert_text (AtkEditableText *text,
- const gchar *string,
- gint length,
- gint *position)
-{
- /* Utf8 unimplemented */
- GalA11yECell *gaec = GAL_A11Y_E_CELL (text);
- ECellText *ect = E_CELL_TEXT (gaec->cell_view->ecell);
-
- gchar *full_text = e_cell_text_get_text (ect, gaec->item->table_model, gaec->model_col, gaec->row);
- gchar *result = g_strdup_printf ("%.*s%.*s%s", *position, full_text, length, string, full_text + *position);
-
- e_cell_text_set_value (ect, gaec->item->table_model, gaec->model_col, gaec->row, result);
-
- *position += length;
-
- g_free (result);
- e_cell_text_free_text (ect, full_text);
-}
-
-static void
-ect_copy_text (AtkEditableText *text,
- gint start_pos,
- gint end_pos)
-{
- GalA11yECell *gaec = GAL_A11Y_E_CELL (text);
- if (start_pos != end_pos
- && atk_text_set_selection (text, 0, start_pos, end_pos))
- e_cell_text_copy_clipboard (gaec->cell_view,
- gaec->view_col, gaec->row);
-}
-
-static void
-ect_delete_text (AtkEditableText *text,
- gint start_pos,
- gint end_pos)
-{
- GalA11yECell *gaec = GAL_A11Y_E_CELL (text);
- if (start_pos != end_pos
- && atk_text_set_selection (text, 0, start_pos, end_pos))
- e_cell_text_delete_selection (gaec->cell_view,
- gaec->view_col, gaec->row);
-}
-
-static void
-ect_cut_text (AtkEditableText *text,
- gint start_pos,
- gint end_pos)
-{
- ect_copy_text (text, start_pos, end_pos);
- ect_delete_text (text, start_pos, end_pos);
-}
-
-static void
-ect_paste_text (AtkEditableText *text,
- gint position)
-{
- GalA11yECell *gaec = GAL_A11Y_E_CELL (text);
-
- e_table_item_enter_edit (gaec->item, gaec->view_col, gaec->row);
-
- if (atk_text_set_caret_offset (text, position))
- e_cell_text_paste_clipboard (gaec->cell_view,
- gaec->view_col, gaec->row);
-}
-
-static void
-ect_do_action_edit (AtkAction *action)
-{
- GalA11yECell *a11y = GAL_A11Y_E_CELL (action);
- e_table_item_enter_edit (a11y->item, a11y->view_col, a11y->row);
-}
-
-static void
-ect_atk_text_iface_init (AtkTextIface *iface)
-{
- iface->get_text = ect_get_text;
- iface->get_text_after_offset = ect_get_text_after_offset;
- iface->get_text_at_offset = ect_get_text_at_offset;
- iface->get_character_at_offset = ect_get_character_at_offset;
- iface->get_text_before_offset = ect_get_text_before_offset;
- iface->get_caret_offset = ect_get_caret_offset;
- iface->get_run_attributes = ect_get_run_attributes;
- iface->get_default_attributes = ect_get_default_attributes;
- iface->get_character_extents = ect_get_character_extents;
- iface->get_character_count = ect_get_character_count;
- iface->get_offset_at_point = ect_get_offset_at_point;
- iface->get_n_selections = ect_get_n_selections;
- iface->get_selection = ect_get_selection;
- iface->add_selection = ect_add_selection;
- iface->remove_selection = ect_remove_selection;
- iface->set_selection = ect_set_selection;
- iface->set_caret_offset = ect_set_caret_offset;
-}
-
-static void
-ect_atk_editable_text_iface_init (AtkEditableTextIface *iface)
-{
- iface->set_run_attributes = ect_set_run_attributes;
- iface->set_text_contents = ect_set_text_contents;
- iface->insert_text = ect_insert_text;
- iface->copy_text = ect_copy_text;
- iface->cut_text = ect_cut_text;
- iface->delete_text = ect_delete_text;
- iface->paste_text = ect_paste_text;
-}
-
-static void
-ect_class_init (GalA11yECellTextClass *klass)
-{
- AtkObjectClass *a11y = ATK_OBJECT_CLASS (klass);
- parent_class = g_type_class_ref (PARENT_TYPE);
- a11y->get_name = ect_get_name;
-}
-
-static void
-ect_init (GalA11yECellText *a11y)
-{
- gal_a11y_e_cell_add_action (a11y,
- "edit",
- "begin editing this cell",
- NULL,
- (ACTION_FUNC)ect_do_action_edit);
-}
-
-/**
- * gal_a11y_e_cell_text_get_type:
- * @void:
- *
- * Registers the &GalA11yECellText class if necessary, and returns the type ID
- * associated to it.
- *
- * Return value: The type ID of the &GalA11yECellText class.
- **/
-GType
-gal_a11y_e_cell_text_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- GTypeInfo info = {
- sizeof (GalA11yECellTextClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) ect_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (GalA11yECellText),
- 0,
- (GInstanceInitFunc) ect_init,
- NULL /* value_cell_text */
- };
-
- static const GInterfaceInfo atk_text_info = {
- (GInterfaceInitFunc) ect_atk_text_iface_init,
- (GInterfaceFinalizeFunc) NULL,
- NULL
- };
-
- static const GInterfaceInfo atk_editable_text_info = {
- (GInterfaceInitFunc) ect_atk_editable_text_iface_init,
- (GInterfaceFinalizeFunc) NULL,
- NULL
- };
-
- type = g_type_register_static (PARENT_TYPE, "GalA11yECellText", &info, 0);
- g_type_add_interface_static (type, ATK_TYPE_TEXT, &atk_text_info);
- g_type_add_interface_static (type, ATK_TYPE_EDITABLE_TEXT, &atk_editable_text_info);
- gal_a11y_e_cell_type_add_action_interface (type);
- }
-
- return type;
-}
-
-AtkObject *
-gal_a11y_e_cell_text_new (ETableItem *item,
- ECellView *cell_view,
- AtkObject *parent,
- int model_col,
- int view_col,
- int row)
-{
- AtkObject *a11y;
-
- a11y = g_object_new (gal_a11y_e_cell_text_get_type (), NULL);
-
- gal_a11y_e_cell_construct (a11y,
- item,
- cell_view,
- parent,
- model_col,
- view_col,
- row);
- return a11y;
-}
diff --git a/a11y/e-table/gal-a11y-e-cell-text.h b/a11y/e-table/gal-a11y-e-cell-text.h
deleted file mode 100644
index 3d9a4447be..0000000000
--- a/a11y/e-table/gal-a11y-e-cell-text.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Christopher James Lahey <clahey@ximian.com>
- *
- * Copyright (C) 2001 Chris Lahey
- */
-
-#ifndef __GAL_A11Y_E_CELL_TEXT_H__
-#define __GAL_A11Y_E_CELL_TEXT_H__
-
-#include <glib-object.h>
-#include <gal/e-table/e-table-item.h>
-#include <gal/e-table/e-cell-text.h>
-#include <a11y/e-table/gal-a11y-e-cell.h>
-
-#define GAL_A11Y_TYPE_E_CELL_TEXT (gal_a11y_e_cell_text_get_type ())
-#define GAL_A11Y_E_CELL_TEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAL_A11Y_TYPE_E_CELL_TEXT, GalA11yECellText))
-#define GAL_A11Y_E_CELL_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAL_A11Y_TYPE_E_CELL_TEXT, GalA11yECellTextClass))
-#define GAL_A11Y_IS_E_CELL_TEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAL_A11Y_TYPE_E_CELL_TEXT))
-#define GAL_A11Y_IS_E_CELL_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAL_A11Y_TYPE_E_CELL_TEXT))
-
-typedef struct _GalA11yECellText GalA11yECellText;
-typedef struct _GalA11yECellTextClass GalA11yECellTextClass;
-typedef struct _GalA11yECellTextPrivate GalA11yECellTextPrivate;
-
-/* This struct should actually be larger as this isn't what we derive from.
- * The GalA11yECellTextPrivate comes right after the parent class structure.
- **/
-struct _GalA11yECellText {
- GalA11yECell object;
-};
-
-struct _GalA11yECellTextClass {
- GalA11yECellClass parent_class;
-};
-
-
-/* Standard Glib function */
-GType gal_a11y_e_cell_text_get_type (void);
-AtkObject *gal_a11y_e_cell_text_new (ETableItem *item,
- ECellView *cell_view,
- AtkObject *parent,
- int model_col,
- int view_col,
- int row);
-
-#endif /* ! __GAL_A11Y_E_CELL_TEXT_H__ */
diff --git a/a11y/e-table/gal-a11y-e-cell-toggle.c b/a11y/e-table/gal-a11y-e-cell-toggle.c
deleted file mode 100644
index f3b5bf2879..0000000000
--- a/a11y/e-table/gal-a11y-e-cell-toggle.c
+++ /dev/null
@@ -1,163 +0,0 @@
-#include <gtk/gtk.h>
-#include "gal-a11y-e-cell-toggle.h"
-#include <gal/e-table/e-cell-toggle.h>
-#include <gal/e-table/e-table-model.h>
-
-#define PARENT_TYPE (gal_a11y_e_cell_get_type ())
-static GObjectClass *parent_class;
-
-static void gal_a11y_e_cell_toggle_class_init (GalA11yECellToggleClass *klass);
-
-static void
-gal_a11y_e_cell_toggle_dispose (GObject *object)
-{
- GalA11yECellToggle *a11y = GAL_A11Y_E_CELL_TOGGLE (object);
-
- ETableModel *e_table_model = GAL_A11Y_E_CELL (a11y)->item->table_model;
-
- if (e_table_model)
- g_signal_handler_disconnect (e_table_model, a11y->model_id);
-
- if (parent_class->dispose)
- parent_class->dispose (object);
-}
-
-GType
-gal_a11y_e_cell_toggle_get_type (void)
-{
- static GType type = 0;
-
- if (!type)
- {
- static const GTypeInfo tinfo =
- {
- sizeof (GalA11yECellToggleClass),
- (GBaseInitFunc) NULL, /* base init */
- (GBaseFinalizeFunc) NULL, /* base finalize */
- (GClassInitFunc) gal_a11y_e_cell_toggle_class_init, /* class init */
- (GClassFinalizeFunc) NULL, /* class finalize */
- NULL, /* class data */
- sizeof (GalA11yECellToggle), /* instance size */
- 0, /* nb preallocs */
- NULL, /* instance init */
- NULL /* value table */
- };
-
-
- type = g_type_register_static (GAL_A11Y_TYPE_E_CELL,
- "GalA11yECellToggle", &tinfo, 0);
- gal_a11y_e_cell_type_add_action_interface (type);
-
- }
- return type;
-}
-
-
-static void
-gal_a11y_e_cell_toggle_class_init (GalA11yECellToggleClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- object_class->dispose = gal_a11y_e_cell_toggle_dispose;
- parent_class = g_type_class_ref (PARENT_TYPE);
-}
-
-static void
-toggle_cell_action (GalA11yECell *cell)
-{
- ECellToggle * ect;
- gint finished;
- GdkEventButton event;
- gint x, y, width, height;
- gint row, col;
-
- row = cell->row;
- col = cell->view_col;
-
- e_table_item_get_cell_geometry (cell->item, &row, &col,
- &x, &y, &width, &height);
-
- event.x = x + width / 2 + (int)(GNOME_CANVAS_ITEM (cell->item)->x1);
- event.y = y + height / 2 + (int)(GNOME_CANVAS_ITEM (cell->item)->y1);
-
- event.type = GDK_BUTTON_PRESS;
- event.window = GTK_LAYOUT(GNOME_CANVAS_ITEM(cell->item)->canvas)->bin_window;
- event.button = 1;
- event.send_event = TRUE;
- event.time = GDK_CURRENT_TIME;
- event.axes = NULL;
-
- g_signal_emit_by_name (cell->item, "event", &event, &finished);
-}
-
-static void
-model_change_cb (ETableModel *etm,
- gint row,
- gint col,
- GalA11yECell *cell)
-{
- gint value;
-
- if (col == cell->model_col && row == cell->row) {
-
- value = GPOINTER_TO_INT (
- e_table_model_value_at (cell->cell_view->e_table_model,
- cell->model_col, cell->row));
- if (value)
- gal_a11y_e_cell_add_state (cell, ATK_STATE_CHECKED, TRUE);
- else
- gal_a11y_e_cell_remove_state (cell, ATK_STATE_CHECKED, TRUE);
- }
-}
-
-
-AtkObject*
-gal_a11y_e_cell_toggle_new (ETableItem *item,
- ECellView *cell_view,
- AtkObject *parent,
- int model_col,
- int view_col,
- int row)
-{
- AtkObject *a11y;
- GalA11yECell *cell;
- GalA11yECellToggle *toggle_cell;
- gint value;
-
- a11y = ATK_OBJECT(g_object_new (GAL_A11Y_TYPE_E_CELL_TOGGLE, NULL));
-
- g_return_val_if_fail (a11y != NULL, NULL);
-
- cell = GAL_A11Y_E_CELL(a11y);
- toggle_cell = GAL_A11Y_E_CELL_TOGGLE(a11y);
- a11y->role = ATK_ROLE_TABLE_CELL;
-
- gal_a11y_e_cell_construct (a11y,
- item,
- cell_view,
- parent,
- model_col,
- view_col,
- row);
-
- gal_a11y_e_cell_add_action (cell,
- "toggle", /* action name*/
- "toggle the cell", /* action description */
- NULL, /* action keybinding */
- toggle_cell_action);
-
- toggle_cell->model_id = g_signal_connect (item->table_model,
- "model_cell_changed",
- (GCallback) model_change_cb,
- a11y);
-
- value = GPOINTER_TO_INT (
- e_table_model_value_at (cell->cell_view->e_table_model,
- cell->model_col, cell->row));
- if (value)
- gal_a11y_e_cell_add_state (cell, ATK_STATE_CHECKED, FALSE);
- else
- gal_a11y_e_cell_remove_state (cell, ATK_STATE_CHECKED, FALSE);
-
- return a11y;
-}
diff --git a/a11y/e-table/gal-a11y-e-cell-toggle.h b/a11y/e-table/gal-a11y-e-cell-toggle.h
deleted file mode 100644
index 06f9448e02..0000000000
--- a/a11y/e-table/gal-a11y-e-cell-toggle.h
+++ /dev/null
@@ -1,47 +0,0 @@
-#ifndef __GAL_A11Y_E_CELL_TOGGLE_H__
-#define __GAL_A11Y_E_CELL_TOGGLE_H__
-
-#include <atk/atk.h>
-#include "gal-a11y-e-cell.h"
-#include "gal-a11y-e-cell-toggle.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define GAL_A11Y_TYPE_E_CELL_TOGGLE (gal_a11y_e_cell_toggle_get_type ())
-#define GAL_A11Y_E_CELL_TOGGLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAL_A11Y_TYPE_E_CELL_TOGGLE, GalA11yECellToggle))
-#define GAL_A11Y_E_CELL_TOGGLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAL_A11Y_E_CELL_TOGGLE, GalA11yECellToggleClass))
-#define GAL_A11Y_IS_E_CELL_TOGGLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAL_A11Y_TYPE_E_CELL_TOGGLE))
-#define GAL_A11Y_IS_E_CELL_TOGGLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAL_A11Y_TYPE_E_CELL_TOGGLE))
-#define GAL_A11Y_E_CELL_TOGGLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAL_A11Y_TYPE_E_CELL_TOGGLE, GalA11yECellToggleClass))
-
-typedef struct _GalA11yECellToggle GalA11yECellToggle;
-typedef struct _GalA11yECellToggleClass GalA11yECellToggleClass;
-
-struct _GalA11yECellToggle
-{
- GalA11yECell parent;
- gint model_id;
-};
-
-GType gal_a11y_e_cell_toggle_get_type (void);
-
-struct _GalA11yECellToggleClass
-{
- GalA11yECellClass parent_class;
-};
-
-AtkObject *gal_a11y_e_cell_toggle_new (ETableItem *item,
- ECellView *cell_view,
- AtkObject *parent,
- int model_col,
- int view_col,
- int row);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* __GAL_A11Y_E_CELL_TOGGLE_H__ */
diff --git a/a11y/e-table/gal-a11y-e-cell-tree.c b/a11y/e-table/gal-a11y-e-cell-tree.c
deleted file mode 100644
index e6ff75667b..0000000000
--- a/a11y/e-table/gal-a11y-e-cell-tree.c
+++ /dev/null
@@ -1,209 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Tim Wo <tim.wo@sun.com>, Sun Microsystem Inc. 2003.
- *
- * Copyright (C) 2002 Ximian, Inc.
- */
-
-#include <config.h>
-#include <atk/atk.h>
-#include "gal-a11y-e-cell-tree.h"
-#include "gal-a11y-util.h"
-#include "gal/e-table/e-cell-tree.h"
-#include "gal/e-table/e-table.h"
-#include "gal/e-table/e-tree-table-adapter.h"
-
-#define CS_CLASS(a11y) (G_TYPE_INSTANCE_GET_CLASS ((a11y), C_TYPE_STREAM, GalA11yECellTreeClass))
-static AtkObjectClass *a11y_parent_class;
-#define A11Y_PARENT_TYPE (gal_a11y_e_cell_get_type ())
-
-static void
-ectr_model_row_changed_cb (ETableModel *etm,
- gint row,
- GalA11yECell *a11y)
-{
- ETreePath node;
- ETreeModel *tree_model;
- ETreeTableAdapter *tree_table_adapter;
-
- g_return_if_fail (a11y);
- if (a11y->row != row)
- return;
-
- node = e_table_model_value_at (etm, -1, a11y->row);
- tree_model = e_table_model_value_at (etm, -2, a11y->row);
- tree_table_adapter = e_table_model_value_at (etm, -3, a11y->row);
-
- if (e_tree_model_node_is_expandable (tree_model, node)) {
- gboolean is_exp = e_tree_table_adapter_node_is_expanded (tree_table_adapter, node);
- if (is_exp)
- gal_a11y_e_cell_add_state (a11y, ATK_STATE_EXPANDED, TRUE);
- else
- gal_a11y_e_cell_remove_state (a11y, ATK_STATE_EXPANDED, TRUE);
- }
-}
-
-static void
-ectr_subcell_weak_ref (GalA11yECellTree *a11y,
- GalA11yECell *subcell_a11y)
-{
- g_signal_handler_disconnect (GAL_A11Y_E_CELL (a11y)->item->table_model,
- a11y->model_row_changed_id);
- g_object_unref (a11y);
-}
-
-static void
-ectr_do_action_expand (AtkAction *action)
-{
- GalA11yECell *a11y;
- ETableModel *table_model;
- ETreePath node;
- ETreeModel *tree_model;
- ETreeTableAdapter *tree_table_adapter;
-
- a11y = GAL_A11Y_E_CELL (action);
- table_model = a11y->item->table_model;
- node = e_table_model_value_at (table_model, -1, a11y->row);
- tree_model = e_table_model_value_at (table_model, -2, a11y->row);
- tree_table_adapter = e_table_model_value_at (table_model, -3, a11y->row);
-
- if (e_tree_model_node_is_expandable (tree_model, node)) {
- e_tree_table_adapter_node_set_expanded (tree_table_adapter,
- node,
- TRUE);
- gal_a11y_e_cell_add_state (a11y, ATK_STATE_EXPANDED, TRUE);
- }
-}
-
-static void
-ectr_do_action_collapse (AtkAction *action)
-{
- GalA11yECell *a11y;
- ETableModel *table_model;
- ETreePath node;
- ETreeModel *tree_model;
- ETreeTableAdapter *tree_table_adapter;
-
- a11y = GAL_A11Y_E_CELL (action);
- table_model = a11y->item->table_model;
- node = e_table_model_value_at (table_model, -1, a11y->row);
- tree_model = e_table_model_value_at (table_model, -2, a11y->row);
- tree_table_adapter = e_table_model_value_at (table_model, -3, a11y->row);
-
- if (e_tree_model_node_is_expandable (tree_model, node)) {
- e_tree_table_adapter_node_set_expanded (tree_table_adapter,
- node,
- FALSE);
- gal_a11y_e_cell_remove_state (a11y, ATK_STATE_EXPANDED, TRUE);
- }
-}
-
-static void
-ectr_class_init (GalA11yECellTreeClass *klass)
-{
- a11y_parent_class = g_type_class_ref (A11Y_PARENT_TYPE);
-}
-
-static void
-ectr_init (GalA11yECellTree *a11y)
-{
-}
-
-GType
-gal_a11y_e_cell_tree_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- GTypeInfo info = {
- sizeof (GalA11yECellTreeClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) ectr_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (GalA11yECellTree),
- 0,
- (GInstanceInitFunc) ectr_init,
- NULL /* value_cell_text */
- };
-
- type = g_type_register_static (A11Y_PARENT_TYPE, "GalA11yECellTree", &info, 0);
- gal_a11y_e_cell_type_add_action_interface (type);
- }
-
- return type;
-}
-
-AtkObject *
-gal_a11y_e_cell_tree_new (ETableItem *item,
- ECellView *cell_view,
- AtkObject *parent,
- int model_col,
- int view_col,
- int row)
-{
- AtkObject *subcell_a11y;
- GalA11yECellTree *a11y;
- GtkWidget *e_table;
-
- ETreePath node;
- ETreeModel *tree_model;
- ETreeTableAdapter *tree_table_adapter;
-
- ECellView *subcell_view;
- subcell_view = e_cell_tree_view_get_subcell_view (cell_view);
-
- if (subcell_view->ecell) {
- subcell_a11y = gal_a11y_e_cell_registry_get_object (NULL,
- item,
- subcell_view,
- parent,
- model_col,
- view_col,
- row);
- gal_a11y_e_cell_add_action (subcell_a11y,
- "expand",
- "expands the row in the ETree containing this cell",
- NULL,
- (ACTION_FUNC)ectr_do_action_expand);
-
- gal_a11y_e_cell_add_action (subcell_a11y,
- "collapse",
- "collapses the row in the ETree containing this cell",
- NULL,
- (ACTION_FUNC)ectr_do_action_collapse);
-
- /* init AtkStates for the cell's a11y object */
- node = e_table_model_value_at (item->table_model, -1, row);
- tree_model = e_table_model_value_at (item->table_model, -2, row);
- tree_table_adapter = e_table_model_value_at (item->table_model, -3, row);
- if (e_tree_model_node_is_expandable (tree_model, node)) {
- gal_a11y_e_cell_add_state (subcell_a11y, ATK_STATE_EXPANDABLE, FALSE);
- if (e_tree_table_adapter_node_is_expanded (tree_table_adapter, node))
- gal_a11y_e_cell_add_state (subcell_a11y, ATK_STATE_EXPANDED, FALSE);
- }
- }
- else
- subcell_a11y = NULL;
-
- /* create a companion a11y object, this object has type GalA11yECellTree
- and it connects to some signals to determine whether a tree cell is
- expanded or collapsed */
- a11y = g_object_new (gal_a11y_e_cell_tree_get_type (), NULL);
- gal_a11y_e_cell_construct (a11y,
- item,
- cell_view,
- parent,
- model_col,
- view_col,
- row);
- a11y->model_row_changed_id =
- g_signal_connect (item->table_model, "model_row_changed",
- G_CALLBACK (ectr_model_row_changed_cb),
- subcell_a11y);
- g_object_weak_ref (subcell_a11y, ectr_subcell_weak_ref, a11y);
-
- return subcell_a11y;
-}
diff --git a/a11y/e-table/gal-a11y-e-cell-tree.h b/a11y/e-table/gal-a11y-e-cell-tree.h
deleted file mode 100644
index 355670b5a4..0000000000
--- a/a11y/e-table/gal-a11y-e-cell-tree.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Tim Wo <tim.wo@sun.com>, Sun Microsystem Inc. 2003.
- *
- * Copyright (C) 2002 Ximian, Inc.
- */
-
-#ifndef __GAL_A11Y_E_CELL_TREE_H__
-#define __GAL_A11Y_E_CELL_TREE_H__
-
-#include <glib-object.h>
-#include <gal/e-table/e-table-item.h>
-#include <gal/e-table/e-cell-tree.h>
-#include "gal-a11y-e-cell.h"
-
-#define GAL_A11Y_TYPE_E_CELL_TREE (gal_a11y_e_cell_tree_get_type ())
-#define GAL_A11Y_E_CELL_TREE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAL_A11Y_TYPE_E_CELL_TREE, GalA11yECellTree))
-#define GAL_A11Y_E_CELL_TREE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAL_A11Y_TYPE_E_CELL_TREE, GalA11yECellTreeClass))
-#define GAL_A11Y_IS_E_CELL_TREE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAL_A11Y_TYPE_E_CELL_TREE))
-#define GAL_A11Y_IS_E_CELL_TREE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAL_A11Y_TYPE_E_CELL_TREE))
-
-typedef struct _GalA11yECellTree GalA11yECellTree;
-typedef struct _GalA11yECellTreeClass GalA11yECellTreeClass;
-typedef struct _GalA11yECellTreePrivate GalA11yECellTreePrivate;
-
-/* This struct should actually be larger as this isn't what we derive from.
- * The GalA11yECellTreePrivate comes right after the parent class structure.
- **/
-struct _GalA11yECellTree {
- GalA11yECell object;
-
- int model_row_changed_id;
-};
-
-struct _GalA11yECellTreeClass {
- GalA11yECellClass parent_class;
-};
-
-
-/* Standard Glib function */
-GType gal_a11y_e_cell_tree_get_type (void);
-AtkObject *gal_a11y_e_cell_tree_new (ETableItem *item,
- ECellView *cell_view,
- AtkObject *parent,
- int model_col,
- int view_col,
- int row);
-
-#endif /* ! __GAL_A11Y_E_CELL_TREE_H__ */
diff --git a/a11y/e-table/gal-a11y-e-cell.c b/a11y/e-table/gal-a11y-e-cell.c
deleted file mode 100644
index 34a7429cd5..0000000000
--- a/a11y/e-table/gal-a11y-e-cell.c
+++ /dev/null
@@ -1,551 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Christopher James Lahey <clahey@ximian.com>
- *
- * Copyright (C) 2002 Ximian, Inc.
- */
-
-#include <config.h>
-#include "gal/e-table/e-table.h"
-#include "gal-a11y-e-cell.h"
-#include "gal-a11y-util.h"
-#include <atk/atkobject.h>
-#include <atk/atkcomponent.h>
-#include <atk/atkaction.h>
-
-#define CS_CLASS(a11y) (G_TYPE_INSTANCE_GET_CLASS ((a11y), C_TYPE_STREAM, GalA11yECellClass))
-static GObjectClass *parent_class;
-#define PARENT_TYPE (atk_object_get_type ())
-
-
-#if 0
-static void
-unref_item (gpointer user_data, GObject *obj_loc)
-{
- GalA11yECell *a11y = GAL_A11Y_E_CELL (user_data);
- a11y->item = NULL;
- g_object_unref (a11y);
-}
-
-static void
-unref_cell (gpointer user_data, GObject *obj_loc)
-{
- GalA11yECell *a11y = GAL_A11Y_E_CELL (user_data);
- a11y->cell_view = NULL;
- g_object_unref (a11y);
-}
-#endif
-
-static void
-eti_dispose (GObject *object)
-{
- GalA11yECell *a11y = GAL_A11Y_E_CELL (object);
-
-#if 0
- if (a11y->item)
- g_object_unref (G_OBJECT (a11y->item)); /*, unref_item, a11y); */
- if (a11y->cell_view)
- g_object_unref (G_OBJECT (a11y->cell_view)); /*, unref_cell, a11y); */
- if (a11y->parent)
- g_object_unref (a11y->parent);
-#endif
-
- if (a11y->state_set)
- g_object_unref (a11y->state_set);
-
- if (parent_class->dispose)
- parent_class->dispose (object);
-}
-
-/* Static functions */
-static AtkStateSet *
-eti_ref_state_set (AtkObject *accessible)
-{
- GalA11yECell *cell = GAL_A11Y_E_CELL (accessible);
- g_return_val_if_fail (cell->state_set, NULL);
-
- g_object_ref(cell->state_set);
- return cell->state_set;
-}
-
-static AtkObject*
-eti_get_parent (AtkObject *accessible)
-{
- GalA11yECell *a11y = GAL_A11Y_E_CELL (accessible);
- return a11y->parent;
-}
-
-static gint
-eti_get_index_in_parent (AtkObject *accessible)
-{
- GalA11yECell *a11y = GAL_A11Y_E_CELL (accessible);
-
- return a11y->row * a11y->item->cols + a11y->view_col;
-}
-
-
-/* Component IFace */
-static void
-eti_get_extents (AtkComponent *component,
- gint *x,
- gint *y,
- gint *width,
- gint *height,
- AtkCoordType coord_type)
-{
- GalA11yECell *a11y = GAL_A11Y_E_CELL (component);
- int row;
- int col;
- int xval;
- int yval;
-
- row = a11y->row;
- col = a11y->view_col;
-
-
- e_table_item_get_cell_geometry (a11y->item,
- &row,
- &col,
- &xval,
- &yval,
- width,
- height);
-
- atk_component_get_position (ATK_COMPONENT (a11y->parent),
- x, y, coord_type);
- if (x && *x != G_MININT)
- *x += xval;
- if (y && *y != G_MININT)
- *y += yval;
-}
-
-static gboolean
-eti_grab_focus (AtkComponent *component)
-{
- GalA11yECell *a11y;
- gint view_row;
- GtkWidget *e_table, *toplevel;
-
- a11y = GAL_A11Y_E_CELL (component);
- e_table = gtk_widget_get_parent (GNOME_CANVAS_ITEM (a11y->item)->canvas);
- view_row = e_table_view_to_model_row (E_TABLE (e_table), a11y->row);
-
- e_selection_model_select_single_row (a11y->item->selection, view_row);
- e_selection_model_change_cursor (a11y->item->selection, view_row, a11y->view_col);
-
- gtk_widget_grab_focus (e_table);
- toplevel = gtk_widget_get_toplevel (e_table);
- if (GTK_WIDGET_TOPLEVEL (toplevel))
- gtk_window_present (toplevel);
-}
-
-/* Table IFace */
-
-static void
-eti_atk_component_iface_init (AtkComponentIface *iface)
-{
- iface->get_extents = eti_get_extents;
- iface->grab_focus = eti_grab_focus;
-}
-
-static void
-eti_class_init (GalA11yECellClass *klass)
-{
- AtkObjectClass *atk_object_class = ATK_OBJECT_CLASS (klass);
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- object_class->dispose = eti_dispose;
-
- atk_object_class->get_parent = eti_get_parent;
- atk_object_class->get_index_in_parent = eti_get_index_in_parent;
- atk_object_class->ref_state_set = eti_ref_state_set;
-}
-
-static void
-eti_init (GalA11yECell *a11y)
-{
- a11y->item = NULL;
- a11y->cell_view = NULL;
- a11y->parent = NULL;
- a11y->model_col = -1;
- a11y->view_col = -1;
- a11y->row = -1;
-
- a11y->state_set = atk_state_set_new ();
- atk_state_set_add_state (a11y->state_set, ATK_STATE_TRANSIENT);
- atk_state_set_add_state (a11y->state_set, ATK_STATE_ENABLED);
-}
-
-
-static ActionInfo *
-_gal_a11y_e_cell_get_action_info (GalA11yECell *cell,
- gint index)
-{
- GList *list_node;
-
- g_return_val_if_fail (GAL_A11Y_IS_E_CELL (cell), NULL);
- if (cell->action_list == NULL)
- return NULL;
- list_node = g_list_nth (cell->action_list, index);
- if (!list_node)
- return NULL;
- return (ActionInfo *) (list_node->data);
-}
-
-static void
-_gal_a11y_e_cell_destroy_action_info (gpointer action_info,
- gpointer user_data)
-{
- ActionInfo *info = (ActionInfo *)action_info;
-
- g_return_if_fail (info != NULL);
- g_free (info->name);
- g_free (info->description);
- g_free (info->keybinding);
- g_free (info);
-}
-
-
-gboolean
-gal_a11y_e_cell_add_action ( GalA11yECell * cell,
- const gchar *action_name,
- const gchar *action_description,
- const gchar *action_keybinding,
- ACTION_FUNC action_func)
-{
- ActionInfo *info;
- g_return_val_if_fail (GAL_A11Y_IS_E_CELL (cell), FALSE);
- info = g_new (ActionInfo, 1);
-
- if (action_name != NULL)
- info->name = g_strdup (action_name);
- else
- info->name = NULL;
-
- if (action_description != NULL)
- info->description = g_strdup (action_description);
- else
- info->description = NULL;
- if (action_keybinding != NULL)
- info->keybinding = g_strdup (action_keybinding);
- else
- info->keybinding = NULL;
- info->do_action_func = action_func;
-
- cell->action_list = g_list_append (cell->action_list, (gpointer) info);
- return TRUE;
-}
-
-gboolean
-gal_a11y_e_cell_remove_action (GalA11yECell *cell,
- gint action_index)
-{
- GList *list_node;
-
- g_return_val_if_fail (GAL_A11Y_IS_E_CELL (cell), FALSE);
- list_node = g_list_nth (cell->action_list, action_index);
- if (!list_node)
- return FALSE;
- g_return_val_if_fail (list_node->data != NULL, FALSE);
- _gal_a11y_e_cell_destroy_action_info (list_node->data, NULL);
- cell->action_list = g_list_remove_link (cell->action_list, list_node);
-
- return TRUE;
-}
-
-gboolean
-gal_a11y_e_cell_remove_action_by_name (GalA11yECell *cell,
- const gchar *action_name)
-{
- GList *list_node;
- gboolean action_found= FALSE;
-
- g_return_val_if_fail (GAL_A11Y_IS_E_CELL (cell), FALSE);
- for (list_node = cell->action_list; list_node && !action_found;
- list_node = list_node->next) {
- if (!g_strcasecmp (((ActionInfo *)(list_node->data))->name, action_name)) {
- action_found = TRUE;
- break;
- }
- }
-
- g_return_val_if_fail (action_found, FALSE);
- _gal_a11y_e_cell_destroy_action_info (list_node->data, NULL);
- cell->action_list = g_list_remove_link (cell->action_list, list_node);
-
- return TRUE;
-}
-
-static gint
-gal_a11y_e_cell_action_get_n_actions (AtkAction *action)
-{
- GalA11yECell *cell = GAL_A11Y_E_CELL(action);
- if (cell->action_list != NULL)
- return g_list_length (cell->action_list);
- else
- return 0;
-}
-
-static G_CONST_RETURN gchar *
-gal_a11y_e_cell_action_get_name (AtkAction *action,
- gint index)
-{
- GalA11yECell *cell = GAL_A11Y_E_CELL(action);
- ActionInfo *info = _gal_a11y_e_cell_get_action_info (cell, index);
-
- if (info == NULL)
- return NULL;
- return info->name;
-}
-
-static G_CONST_RETURN gchar *
-gal_a11y_e_cell_action_get_description (AtkAction *action,
- gint index)
-{
- GalA11yECell *cell = GAL_A11Y_E_CELL(action);
- ActionInfo *info = _gal_a11y_e_cell_get_action_info (cell, index);
-
- if (info == NULL)
- return NULL;
- return info->description;
-}
-
-static gboolean
-gal_a11y_e_cell_action_set_description (AtkAction *action,
- gint index,
- const gchar *desc)
-{
- GalA11yECell *cell = GAL_A11Y_E_CELL(action);
- ActionInfo *info = _gal_a11y_e_cell_get_action_info (cell, index);
-
- if (info == NULL)
- return FALSE;
- g_free (info->description);
- info->description = g_strdup (desc);
- return TRUE;
-}
-
-static G_CONST_RETURN gchar *
-gal_a11y_e_cell_action_get_keybinding (AtkAction *action,
- gint index)
-{
- GalA11yECell *cell = GAL_A11Y_E_CELL(action);
- ActionInfo *info = _gal_a11y_e_cell_get_action_info (cell, index);
- if (info == NULL)
- return NULL;
-
- return info->keybinding;
-}
-
-static gboolean
-idle_do_action (gpointer data)
-{
- GalA11yECell *cell;
-
- cell = GAL_A11Y_E_CELL (data);
- cell->action_idle_handler = 0;
- cell->action_func (cell);
-
- return FALSE;
-}
-
-static gboolean
-gal_a11y_e_cell_action_do_action (AtkAction *action,
- gint index)
-{
- GalA11yECell *cell = GAL_A11Y_E_CELL(action);
- ActionInfo *info = _gal_a11y_e_cell_get_action_info (cell, index);
-
- if (info == NULL)
- return FALSE;
- g_return_val_if_fail (info->do_action_func, FALSE);
- if (cell->action_idle_handler)
- return FALSE;
- cell->action_func = info->do_action_func;
- cell->action_idle_handler = g_idle_add (idle_do_action, cell);
-
- return TRUE;
-}
-
-static void
-gal_a11y_e_cell_atk_action_interface_init (AtkActionIface *iface)
-{
- g_return_if_fail (iface != NULL);
-
- iface->get_n_actions = gal_a11y_e_cell_action_get_n_actions;
- iface->do_action = gal_a11y_e_cell_action_do_action;
- iface->get_name = gal_a11y_e_cell_action_get_name;
- iface->get_description = gal_a11y_e_cell_action_get_description;
- iface->set_description = gal_a11y_e_cell_action_set_description;
- iface->get_keybinding = gal_a11y_e_cell_action_get_keybinding;
-}
-
-void
-gal_a11y_e_cell_type_add_action_interface (GType type)
-{
- static const GInterfaceInfo atk_action_info =
- {
- (GInterfaceInitFunc) gal_a11y_e_cell_atk_action_interface_init,
- (GInterfaceFinalizeFunc) NULL,
- NULL
- };
-
- g_type_add_interface_static (type, ATK_TYPE_ACTION,
- &atk_action_info);
-}
-
-gboolean
-gal_a11y_e_cell_add_state (GalA11yECell *cell,
- AtkStateType state_type,
- gboolean emit_signal)
-{
- if (!atk_state_set_contains_state (cell->state_set, state_type)) {
- gboolean rc;
-
- rc = atk_state_set_add_state (cell->state_set, state_type);
- /*
- * The signal should only be generated if the value changed,
- * not when the cell is set up. So states that are set
- * initially should pass FALSE as the emit_signal argument.
- */
-
- if (emit_signal) {
- atk_object_notify_state_change (ATK_OBJECT (cell), state_type, TRUE);
- /* If state_type is ATK_STATE_VISIBLE, additional
- notification */
- if (state_type == ATK_STATE_VISIBLE)
- g_signal_emit_by_name (cell, "visible_data_changed");
- }
-
- return rc;
- }
- else
- return FALSE;
-}
-
-gboolean
-gal_a11y_e_cell_remove_state (GalA11yECell *cell,
- AtkStateType state_type,
- gboolean emit_signal)
-{
- if (atk_state_set_contains_state (cell->state_set, state_type)) {
- gboolean rc;
-
- rc = atk_state_set_remove_state (cell->state_set, state_type);
- /*
- * The signal should only be generated if the value changed,
- * not when the cell is set up. So states that are set
- * initially should pass FALSE as the emit_signal argument.
- */
-
- if (emit_signal) {
- atk_object_notify_state_change (ATK_OBJECT (cell), state_type, FALSE);
- /* If state_type is ATK_STATE_VISIBLE, additional notification */
- if (state_type == ATK_STATE_VISIBLE)
- g_signal_emit_by_name (cell, "visible_data_changed");
- }
-
- return rc;
- }
- else
- return FALSE;
-}
-
-/**
- * gal_a11y_e_cell_get_type:
- * @void:
- *
- * Registers the &GalA11yECell class if necessary, and returns the type ID
- * associated to it.
- *
- * Return value: The type ID of the &GalA11yECell class.
- **/
-GType
-gal_a11y_e_cell_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- GTypeInfo info = {
- sizeof (GalA11yECellClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) eti_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (GalA11yECell),
- 0,
- (GInstanceInitFunc) eti_init,
- NULL /* value_cell */
- };
-
- static const GInterfaceInfo atk_component_info = {
- (GInterfaceInitFunc) eti_atk_component_iface_init,
- (GInterfaceFinalizeFunc) NULL,
- NULL
- };
-
- type = g_type_register_static (PARENT_TYPE, "GalA11yECell", &info, 0);
- g_type_add_interface_static (type, ATK_TYPE_COMPONENT, &atk_component_info);
- }
-
- return type;
-}
-
-AtkObject *
-gal_a11y_e_cell_new (ETableItem *item,
- ECellView *cell_view,
- AtkObject *parent,
- int model_col,
- int view_col,
- int row)
-{
- AtkObject *a11y;
-
- a11y = g_object_new (gal_a11y_e_cell_get_type (), NULL);
-
- gal_a11y_e_cell_construct (a11y,
- item,
- cell_view,
- parent,
- model_col,
- view_col,
- row);
- return a11y;
-}
-
-void
-gal_a11y_e_cell_construct (AtkObject *object,
- ETableItem *item,
- ECellView *cell_view,
- AtkObject *parent,
- int model_col,
- int view_col,
- int row)
-{
- GalA11yECell *a11y = GAL_A11Y_E_CELL (object);
- a11y->item = item;
- a11y->cell_view = cell_view;
- a11y->parent = parent;
- a11y->model_col = model_col;
- a11y->view_col = view_col;
- a11y->row = row;
- ATK_OBJECT (a11y) ->role = ATK_ROLE_TABLE_CELL;
-
-#if 0
- if (parent)
- g_object_ref (parent);
-
- if (item)
- g_object_ref (G_OBJECT (item)); /*,
- unref_item,
- a11y);*/
- if (cell_view)
- g_object_ref (G_OBJECT (cell_view)); /*,
- unref_cell,
- a11y);*/
-#endif
-}
diff --git a/a11y/e-table/gal-a11y-e-cell.h b/a11y/e-table/gal-a11y-e-cell.h
deleted file mode 100644
index 53a6c0089d..0000000000
--- a/a11y/e-table/gal-a11y-e-cell.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Christopher James Lahey <clahey@ximian.com>
- *
- * Copyright (C) 2001 Chris Lahey
- */
-
-#ifndef __GAL_A11Y_E_CELL_H__
-#define __GAL_A11Y_E_CELL_H__
-
-#include <glib-object.h>
-#include <gal/e-table/e-table-item.h>
-#include <gal/e-table/e-cell.h>
-
-#define GAL_A11Y_TYPE_E_CELL (gal_a11y_e_cell_get_type ())
-#define GAL_A11Y_E_CELL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAL_A11Y_TYPE_E_CELL, GalA11yECell))
-#define GAL_A11Y_E_CELL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAL_A11Y_TYPE_E_CELL, GalA11yECellClass))
-#define GAL_A11Y_IS_E_CELL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAL_A11Y_TYPE_E_CELL))
-#define GAL_A11Y_IS_E_CELL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAL_A11Y_TYPE_E_CELL))
-
-typedef struct _GalA11yECell GalA11yECell;
-typedef struct _GalA11yECellClass GalA11yECellClass;
-typedef struct _GalA11yECellPrivate GalA11yECellPrivate;
-typedef struct _ActionInfo ActionInfo;
-typedef void (*ACTION_FUNC) (GalA11yECell *cell);
-
-
-/* This struct should actually be larger as this isn't what we derive from.
- * The GalA11yECellPrivate comes right after the parent class structure.
- **/
-struct _GalA11yECell {
- AtkObject object;
-
- ETableItem *item;
- ECellView *cell_view;
- AtkObject *parent;
- int model_col;
- int view_col;
- int row;
- AtkStateSet *state_set;
- GList *action_list;
- gint action_idle_handler;
- ACTION_FUNC action_func;
-};
-
-struct _GalA11yECellClass {
- AtkObjectClass parent_class;
-};
-
-struct _ActionInfo {
- gchar *name;
- gchar *description;
- gchar *keybinding;
- ACTION_FUNC do_action_func;
-};
-
-
-
-/* Standard Glib function */
-GType gal_a11y_e_cell_get_type (void);
-AtkObject *gal_a11y_e_cell_new (ETableItem *item,
- ECellView *cell_view,
- AtkObject *parent,
- int model_col,
- int view_col,
- int row);
-void gal_a11y_e_cell_construct (AtkObject *object,
- ETableItem *item,
- ECellView *cell_view,
- AtkObject *parent,
- int model_col,
- int view_col,
- int row);
-
-void gal_a11y_e_cell_type_add_action_interface (GType type);
-
-gboolean gal_a11y_e_cell_add_action (GalA11yECell *cell,
- const gchar *action_name,
- const gchar *action_description,
- const gchar *action_keybinding,
- ACTION_FUNC action_func);
-
-gboolean gal_a11y_e_cell_remove_action (GalA11yECell *cell,
- gint action_id);
-
-gboolean gal_a11y_e_cell_remove_action_by_name (GalA11yECell *cell,
- const gchar *action_name);
-
-gboolean gal_a11y_e_cell_add_state (GalA11yECell *cell,
- AtkStateType state_type,
- gboolean emit_signal);
-
-gboolean gal_a11y_e_cell_remove_state (GalA11yECell *cell,
- AtkStateType state_type,
- gboolean emit_signal);
-
-
-#endif /* ! __GAL_A11Y_E_CELL_H__ */
diff --git a/a11y/e-table/gal-a11y-e-table-factory.c b/a11y/e-table/gal-a11y-e-table-factory.c
deleted file mode 100644
index 14eaca3d19..0000000000
--- a/a11y/e-table/gal-a11y-e-table-factory.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Christopher James Lahey <clahey@ximian.com>
- *
- * Copyright (C) 2002 Ximian, Inc.
- */
-
-#include <config.h>
-#include "gal-a11y-e-table-factory.h"
-#include "gal-a11y-e-table.h"
-
-#define CS_CLASS(factory) (G_TYPE_INSTANCE_GET_CLASS ((factory), C_TYPE_STREAM, GalA11yETableFactoryClass))
-static AtkObjectFactoryClass *parent_class;
-#define PARENT_TYPE (ATK_TYPE_OBJECT_FACTORY)
-
-/* Static functions */
-
-static GType
-gal_a11y_e_table_factory_get_accessible_type (void)
-{
- return GAL_A11Y_TYPE_E_TABLE;
-}
-
-static AtkObject*
-gal_a11y_e_table_factory_create_accessible (GObject *obj)
-{
- AtkObject *accessible;
-
- accessible = gal_a11y_e_table_new (obj);
-
- return accessible;
-}
-
-static void
-gal_a11y_e_table_factory_class_init (GalA11yETableFactoryClass *klass)
-{
- AtkObjectFactoryClass *factory_class = ATK_OBJECT_FACTORY_CLASS (klass);
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- factory_class->create_accessible = gal_a11y_e_table_factory_create_accessible;
- factory_class->get_accessible_type = gal_a11y_e_table_factory_get_accessible_type;
-}
-
-static void
-gal_a11y_e_table_factory_init (GalA11yETableFactory *factory)
-{
-}
-
-/**
- * gal_a11y_e_table_factory_get_type:
- * @void:
- *
- * Registers the &GalA11yETableFactory class if necessary, and returns the type ID
- * associated to it.
- *
- * Return value: The type ID of the &GalA11yETableFactory class.
- **/
-GType
-gal_a11y_e_table_factory_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- GTypeInfo info = {
- sizeof (GalA11yETableFactoryClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) gal_a11y_e_table_factory_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (GalA11yETableFactory),
- 0,
- (GInstanceInitFunc) gal_a11y_e_table_factory_init,
- NULL /* value_table */
- };
-
- type = g_type_register_static (PARENT_TYPE, "GalA11yETableFactory", &info, 0);
- }
-
- return type;
-}
diff --git a/a11y/e-table/gal-a11y-e-table-factory.h b/a11y/e-table/gal-a11y-e-table-factory.h
deleted file mode 100644
index eb8eb55414..0000000000
--- a/a11y/e-table/gal-a11y-e-table-factory.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Christopher James Lahey <clahey@ximian.com>
- *
- * Copyright (C) 2001 Chris Lahey
- */
-
-#ifndef __GAL_A11Y_E_TABLE_FACTORY_H__
-#define __GAL_A11Y_E_TABLE_FACTORY_H__
-
-#include <glib-object.h>
-#include <atk/atkobjectfactory.h>
-
-#define GAL_A11Y_TYPE_E_TABLE_FACTORY (gal_a11y_e_table_factory_get_type ())
-#define GAL_A11Y_E_TABLE_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAL_A11Y_TYPE_E_TABLE_FACTORY, GalA11yETableFactory))
-#define GAL_A11Y_E_TABLE_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAL_A11Y_TYPE_E_TABLE_FACTORY, GalA11yETableFactoryClass))
-#define GAL_A11Y_IS_E_TABLE_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAL_A11Y_TYPE_E_TABLE_FACTORY))
-#define GAL_A11Y_IS_E_TABLE_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAL_A11Y_TYPE_E_TABLE_FACTORY))
-
-typedef struct _GalA11yETableFactory GalA11yETableFactory;
-typedef struct _GalA11yETableFactoryClass GalA11yETableFactoryClass;
-
-struct _GalA11yETableFactory {
- AtkObject object;
-};
-
-struct _GalA11yETableFactoryClass {
- AtkObjectClass parent_class;
-};
-
-
-/* Standard Glib function */
-GType gal_a11y_e_table_factory_get_type (void);
-
-#endif /* ! __GAL_A11Y_E_TABLE_FACTORY_H__ */
diff --git a/a11y/e-table/gal-a11y-e-table-item-factory.c b/a11y/e-table/gal-a11y-e-table-item-factory.c
deleted file mode 100644
index c5fd5c410c..0000000000
--- a/a11y/e-table/gal-a11y-e-table-item-factory.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Authors: Yuedong Du <yuedong.du@sun.com>
- *
- * Copyright (C) 2003 Ximian, Inc.
- */
-
-#include <config.h>
-#include "gal-a11y-e-table-item-factory.h"
-#include "gal-a11y-e-table-item.h"
-#include "gal-a11y-e-table.h"
-#include <gal/e-table/e-table.h>
-#include <gal/e-table/e-tree.h>
-#include <atk/atk.h>
-
-
-#define CS_CLASS(factory) (G_TYPE_INSTANCE_GET_CLASS ((factory), C_TYPE_STREAM, GalA11yETableItemFactoryClass))
-static AtkObjectFactoryClass *parent_class;
-#define PARENT_TYPE (ATK_TYPE_OBJECT_FACTORY)
-
-/* Static functions */
-
-static GType
-gal_a11y_e_table_item_factory_get_accessible_type (void)
-{
- return GAL_A11Y_TYPE_E_TABLE_ITEM;
-}
-
-static AtkObject*
-gal_a11y_e_table_item_factory_create_accessible (GObject *obj)
-{
- AtkObject * accessible;
- ETableItem * eti;
- GnomeCanvas * gc;
- GtkWidget * table;
-
- g_return_if_fail (E_IS_TABLE_ITEM(obj));
- eti = E_TABLE_ITEM(obj);
- gc = GNOME_CANVAS_ITEM(eti)->canvas;
-
- table = gtk_widget_get_parent(GTK_WIDGET(gc));
-
- accessible = gtk_widget_get_accessible (table);
- accessible = atk_object_ref_accessible_child (accessible, 0);
-
- return accessible;
-}
-
-static void
-gal_a11y_e_table_item_factory_class_init (GalA11yETableItemFactoryClass *klass)
-{
- AtkObjectFactoryClass *factory_class = ATK_OBJECT_FACTORY_CLASS (klass);
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- factory_class->create_accessible = gal_a11y_e_table_item_factory_create_accessible;
- factory_class->get_accessible_type = gal_a11y_e_table_item_factory_get_accessible_type;
-}
-
-static void
-gal_a11y_e_table_item_factory_init (GalA11yETableItemFactory *factory)
-{
-}
-
-/**
- * gal_a11y_e_table_factory_get_type:
- * @void:
- *
- * Registers the &GalA11yETableFactory class if necessary, and returns the type ID
- * associated to it.
- *
- * Return value: The type ID of the &GalA11yETableFactory class.
- **/
-GType
-gal_a11y_e_table_item_factory_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- GTypeInfo info = {
- sizeof (GalA11yETableItemFactoryClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) gal_a11y_e_table_item_factory_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (GalA11yETableItemFactory),
- 0,
- (GInstanceInitFunc) gal_a11y_e_table_item_factory_init,
- NULL /* value_table */
- };
-
- type = g_type_register_static (PARENT_TYPE, "GalA11yETableItemFactory", &info, 0);
- }
-
- return type;
-}
diff --git a/a11y/e-table/gal-a11y-e-table-item-factory.h b/a11y/e-table/gal-a11y-e-table-item-factory.h
deleted file mode 100644
index cbbff9fb18..0000000000
--- a/a11y/e-table/gal-a11y-e-table-item-factory.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Authors: * Yuedong Du <yuedong.du@sun.com>
- *
- * Copyright (C) 2003 Ximian, Inc.
- */
-
-#ifndef __GAL_A11Y_E_TABLE_ITEM_FACTORY_H__
-#define __GAL_A11Y_E_TABLE_ITEM_FACTORY_H__
-
-#include <glib-object.h>
-#include <atk/atkobjectfactory.h>
-
-#define GAL_A11Y_TYPE_E_TABLE_ITEM_FACTORY (gal_a11y_e_table_item_factory_get_type ())
-#define GAL_A11Y_E_TABLE_ITEM_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAL_A11Y_TYPE_E_TABLE_ITEM_FACTORY, GalA11yETableItemFactory))
-#define GAL_A11Y_E_TABLE_ITEM_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAL_A11Y_TYPE_E_TABLE_ITEM_FACTORY, GalA11yETableItemFactoryClass))
-#define GAL_A11Y_IS_E_TABLE_ITEM_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAL_A11Y_TYPE_E_TABLE_ITEM_FACTORY))
-#define GAL_A11Y_IS_E_TABLE_ITEM_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAL_A11Y_TYPE_E_TABLE_ITEM_FACTORY))
-
-typedef struct _GalA11yETableItemFactory GalA11yETableItemFactory;
-typedef struct _GalA11yETableItemFactoryClass GalA11yETableItemFactoryClass;
-
-struct _GalA11yETableItemFactory {
- AtkObject object;
-};
-
-struct _GalA11yETableItemFactoryClass {
- AtkObjectClass parent_class;
-};
-
-
-/* Standard Glib function */
-GType gal_a11y_e_table_item_factory_get_type (void);
-
-#endif /* ! __GAL_A11Y_E_TABLE_FACTORY_H__ */
diff --git a/a11y/e-table/gal-a11y-e-table-item.c b/a11y/e-table/gal-a11y-e-table-item.c
deleted file mode 100644
index fcfa1cc0e6..0000000000
--- a/a11y/e-table/gal-a11y-e-table-item.c
+++ /dev/null
@@ -1,1285 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Christopher James Lahey <clahey@ximian.com>
- * Bolian Yin <bolian.yin@sun.com>
- *
- * Copyright (C) 2002 Ximian, Inc.
- */
-
-#include <config.h>
-#include "gal-a11y-e-table-item.h"
-#include "gal-a11y-e-cell-registry.h"
-#include "gal-a11y-e-cell.h"
-#include "gal-a11y-util.h"
-#include <gal/e-table/e-table-subset.h>
-
-#include <atk/atkobject.h>
-#include <atk/atktable.h>
-#include <atk/atkcomponent.h>
-#include <atk/atkobjectfactory.h>
-#include <atk/atkregistry.h>
-#include <atk/atkgobjectaccessible.h>
-
-#define CS_CLASS(a11y) (G_TYPE_INSTANCE_GET_CLASS ((a11y), C_TYPE_STREAM, GalA11yETableItemClass))
-static GObjectClass *parent_class;
-static AtkComponentIface *component_parent_iface;
-static GType parent_type;
-static gint priv_offset;
-static GQuark quark_accessible_object = 0;
-#define GET_PRIVATE(object) ((GalA11yETableItemPrivate *) (((char *) object) + priv_offset))
-#define PARENT_TYPE (parent_type)
-
-struct _GalA11yETableItemPrivate {
- AtkObject *parent;
- gint index_in_parent;
- gint cols;
- gint rows;
- gpointer *cell_data;
- int selection_change_id;
- int cursor_change_id;
- ETableCol ** columns;
- ESelectionModel *selection;
-};
-
-static gboolean gal_a11y_e_table_item_ref_selection (GalA11yETableItem *a11y,
- ESelectionModel *selection);
-static gboolean gal_a11y_e_table_item_unref_selection (GalA11yETableItem *a11y);
-
-#if 0
-static void
-unref_accessible (gpointer user_data, GObject *obj_loc)
-{
- GalA11yETableItem *a11y = GAL_A11Y_E_TABLE_ITEM (user_data);
- GET_PRIVATE (a11y)->item = NULL;
- g_object_unref (a11y);
-}
-#endif
-
-inline static gint
-view_to_model_row(ETableItem *eti, int row)
-{
- if (eti->uses_source_model) {
- ETableSubset *etss = E_TABLE_SUBSET(eti->table_model);
- if (row >= 0 && row < etss->n_map) {
- eti->row_guess = row;
- return etss->map_table[row];
- } else
- return -1;
- } else
- return row;
-}
-
-inline static gint
-view_to_model_col(ETableItem *eti, int col)
-{
- ETableCol *ecol = e_table_header_get_column (eti->header, col);
- return ecol ? ecol->col_idx : -1;
-}
-
-inline static GObject *
-eti_a11y_get_gobject (AtkObject *accessible)
-{
- return atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (accessible));
-}
-
-static void
-eti_dispose (GObject *object)
-{
- gint i,j;
- GalA11yETableItem *a11y = GAL_A11Y_E_TABLE_ITEM (object);
- GalA11yETableItemPrivate *priv = GET_PRIVATE (a11y);
-
- priv->parent = NULL;
-
- if ( priv->cell_data != NULL ) {
- g_free(priv->cell_data);
- priv->cell_data = NULL;
- }
-
- if (priv->columns) {
- g_free(priv->columns);
- priv->columns = NULL;
- }
-
- if (parent_class->dispose)
- parent_class->dispose (object);
- if (priv->selection)
- gal_a11y_e_table_item_unref_selection (a11y);
-}
-
-/* Static functions */
-static AtkObject *
-eti_get_parent (AtkObject *accessible)
-{
- AtkGObjectAccessible *atk_gobj;
- GalA11yETableItem *a11y;
-
- g_return_val_if_fail (GAL_A11Y_IS_E_TABLE_ITEM (accessible), NULL);
- if (!eti_a11y_get_gobject (accessible))
- /* defunct */
- return NULL;
-
- a11y = GAL_A11Y_E_TABLE_ITEM (accessible);
- return GET_PRIVATE (a11y)->parent;
-}
-
-static gint
-eti_get_n_children (AtkObject *accessible)
-{
- AtkGObjectAccessible *atk_gobj;
-
- g_return_val_if_fail (GAL_A11Y_IS_E_TABLE_ITEM (accessible), 0);
- if (!eti_a11y_get_gobject (accessible))
- return 0;
-
- return atk_table_get_n_columns (ATK_TABLE (accessible)) *
- atk_table_get_n_rows (ATK_TABLE (accessible));
-}
-
-static AtkObject*
-eti_ref_child (AtkObject *accessible, gint index)
-{
- AtkGObjectAccessible *atk_gobj;
- ETableItem *item;
- gint col, row;
-
- g_return_val_if_fail (GAL_A11Y_IS_E_TABLE_ITEM (accessible), NULL);
- item = E_TABLE_ITEM (eti_a11y_get_gobject (accessible));
- if (!item)
- return NULL;
-
- if (index < item->cols) {
- AtkObject *child;
-
- /* A column header is required */
- child = atk_table_get_column_header (ATK_TABLE (accessible), index);
- if (child)
- g_object_ref (child);
- return child;
- }
-
- index -= item->cols;
- col = index % item->cols;
- row = index / item->cols;
-
- return atk_table_ref_at (ATK_TABLE (accessible), row, col);
-}
-
-static gint
-eti_get_index_in_parent (AtkObject *accessible)
-{
- AtkGObjectAccessible *atk_gobj;
- GalA11yETableItem *a11y;
-
- g_return_val_if_fail (GAL_A11Y_IS_E_TABLE_ITEM (accessible), -1);
- if (!eti_a11y_get_gobject (accessible))
- return -1;
-
- a11y = GAL_A11Y_E_TABLE_ITEM (accessible);
- return GET_PRIVATE (a11y)->index_in_parent;
-}
-
-static void
-eti_get_extents (AtkComponent *component,
- gint *x,
- gint *y,
- gint *width,
- gint *height,
- AtkCoordType coord_type)
-{
- ETableItem *item;
- double real_width;
- double real_height;
- int fake_width;
- int fake_height;
-
- item = E_TABLE_ITEM (eti_a11y_get_gobject (ATK_OBJECT (component)));
- if (!item)
- return;
-
- if (component_parent_iface &&
- component_parent_iface->get_extents)
- component_parent_iface->get_extents (component,
- x,
- y,
- &fake_width,
- &fake_height,
- coord_type);
-
- gtk_object_get (GTK_OBJECT (item),
- "width", &real_width,
- "height", &real_height,
- NULL);
-
- if (width)
- *width = real_width;
- if (height)
- *height = real_height;
-}
-
-static AtkObject*
-eti_ref_accessible_at_point (AtkComponent *component,
- gint x,
- gint y,
- AtkCoordType coord_type)
-{
- int row = -1;
- int col = -1;
- int x_origin, y_origin;
- ETableItem *item;
-
- item = E_TABLE_ITEM (eti_a11y_get_gobject (ATK_OBJECT (component)));
- if (!item)
- return;
-
- atk_component_get_position (component,
- &x_origin,
- &y_origin,
- coord_type);
- x -= x_origin;
- y -= y_origin;
-
- e_table_item_compute_location (item, &x, &y,
- &row, &col);
-
- if (row != -1 && col != -1) {
- return atk_table_ref_at (ATK_TABLE (component), row, col);
- } else {
- return NULL;
- }
-}
-
-
-static void
-cell_destroyed (gpointer data)
-{
- AtkObject *parent;
- gint index, n_cols;
- GalA11yETableItem * item;
- GalA11yECell * cell;
-
- g_return_if_fail (GAL_A11Y_IS_E_CELL (data));
- cell = GAL_A11Y_E_CELL (data);
-
- item = atk_gobject_accessible_for_object (GAL_A11Y_E_CELL(data)->item);
-
- g_return_if_fail (item && GAL_A11Y_IS_E_TABLE_ITEM (item));
-
- g_return_if_fail (cell->row < GET_PRIVATE(item)->rows && cell->view_col < GET_PRIVATE(item)->cols);
-
- index = cell->row * cell->item->cols + cell->view_col;
-
- if (GET_PRIVATE (item)->cell_data && GET_PRIVATE (item)->cell_data [index] == data)
- GET_PRIVATE (item)->cell_data [index] = NULL;
-}
-
-/* atk table */
-static AtkObject*
-eti_ref_at (AtkTable *table, gint row, gint column)
-{
- ETableItem *item;
- AtkObject* ret;
-
- item = E_TABLE_ITEM (eti_a11y_get_gobject (ATK_OBJECT (table)));
- if (!item)
- return NULL;
-
- if (column >= 0 &&
- column < item->cols &&
- row >= 0 &&
- row < item->rows &&
- item->cell_views_realized) {
- ECellView *cell_view = item->cell_views[column];
- ETableCol *ecol = e_table_header_get_column (item->header, column);
- gpointer * cell_data;
-
- cell_data = GET_PRIVATE (table)->cell_data;
-
- if (cell_data[row*item->cols + column] == NULL) {
- ret = gal_a11y_e_cell_registry_get_object (NULL,
- item,
- cell_view,
- ATK_OBJECT (table),
- ecol->col_idx,
- column,
- row);
- cell_data[row*item->cols + column] = ret;
- if (ATK_IS_OBJECT (ret))
- g_object_weak_ref (G_OBJECT (ret),
- (GWeakNotify) cell_destroyed,
- ret);
-
- else
- ret = NULL;
- } else {
- ret = (AtkObject *) cell_data[row*item->cols + column];
- if (ATK_IS_OBJECT (ret)) {
- g_object_ref (ret);
- } else {
- ret = NULL;
- }
- }
-
-
- return ret;
- }
-
- return NULL;
-}
-
-static gint
-eti_get_index_at (AtkTable *table, gint row, gint column)
-{
- ETableItem *item;
-
- item = E_TABLE_ITEM (eti_a11y_get_gobject (ATK_OBJECT (table)));
- if (!item)
- return -1;
-
- return column + row * item->cols;
-}
-
-static gint
-eti_get_column_at_index (AtkTable *table, gint index)
-{
- ETableItem *item;
-
- item = E_TABLE_ITEM (eti_a11y_get_gobject (ATK_OBJECT (table)));
- if (!item)
- return -1;
-
- return index % item->cols;
-}
-
-static gint
-eti_get_row_at_index (AtkTable *table, gint index)
-{
- ETableItem *item;
-
- item = E_TABLE_ITEM (eti_a11y_get_gobject (ATK_OBJECT (table)));
- if (!item)
- return -1;
-
- return index / item->cols;
-}
-
-static gint
-eti_get_n_columns (AtkTable *table)
-{
- ETableItem *item;
-
- item = E_TABLE_ITEM (eti_a11y_get_gobject (ATK_OBJECT (table)));
- if (!item)
- return -1;
-
- return item->cols;
-}
-
-static gint
-eti_get_n_rows (AtkTable *table)
-{
- ETableItem *item;
-
- item = E_TABLE_ITEM (eti_a11y_get_gobject (ATK_OBJECT (table)));
- if (!item)
- return -1;
-
- return item->rows;
-}
-
-static gint
-eti_get_column_extent_at (AtkTable *table,
- gint row,
- gint column)
-{
- ETableItem *item;
- int width;
-
- item = E_TABLE_ITEM (eti_a11y_get_gobject (ATK_OBJECT (table)));
- if (!item)
- return -1;
-
- e_table_item_get_cell_geometry (item,
- &row,
- &column,
- NULL,
- NULL,
- &width,
- NULL);
-
- return width;
-}
-
-static gint
-eti_get_row_extent_at (AtkTable *table,
- gint row,
- gint column)
-{
- ETableItem *item;
- int height;
-
- item = E_TABLE_ITEM (eti_a11y_get_gobject (ATK_OBJECT (table)));
- if (!item)
- return -1;
-
- e_table_item_get_cell_geometry (item,
- &row,
- &column,
- NULL,
- NULL,
- NULL,
- &height);
-
- return height;
-}
-
-static AtkObject *
-eti_get_caption (AtkTable *table)
-{
- /* Unimplemented */
- return NULL;
-}
-
-static G_CONST_RETURN gchar *
-eti_get_column_description (AtkTable *table,
- gint column)
-{
- ETableItem *item;
- ETableCol *ecol;
-
- item = E_TABLE_ITEM (eti_a11y_get_gobject (ATK_OBJECT (table)));
- if (!item)
- return NULL;
-
- ecol = e_table_header_get_column (item->header, column);
-
- return ecol->text;
-}
-
-static AtkObject *
-eti_get_column_header (AtkTable *table, gint column)
-{
- ETableItem *item;
- ETableCol *ecol;
- AtkObject *atk_obj = NULL;
- ECell *ecell;
-
- item = E_TABLE_ITEM (eti_a11y_get_gobject (ATK_OBJECT (table)));
- if (!item)
- return NULL;
-
- ecol = e_table_header_get_column (item->header, column);
- ecell = ecol->ecell;
- if (ecell)
- atk_obj = atk_gobject_accessible_for_object (G_OBJECT (ecell));
- return atk_obj;
-}
-
-static G_CONST_RETURN gchar *
-eti_get_row_description (AtkTable *table,
- gint row)
-{
- /* Unimplemented */
- return NULL;
-}
-
-static AtkObject *
-eti_get_row_header (AtkTable *table,
- gint row)
-{
- /* Unimplemented */
- return NULL;
-}
-
-static AtkObject *
-eti_get_summary (AtkTable *table)
-{
- /* Unimplemented */
- return NULL;
-}
-
-static gboolean
-table_is_row_selected (AtkTable *table, gint row)
-{
- ETableItem *item;
-
- item = E_TABLE_ITEM (eti_a11y_get_gobject (ATK_OBJECT (table)));
- if (!item)
- return FALSE;
-
- return e_selection_model_is_row_selected(item->selection, row);
-}
-
-static gboolean
-table_is_selected (AtkTable *table, gint row, gint column)
-{
- return table_is_row_selected (table, row);
-}
-
-static gint
-table_get_selected_rows (AtkTable *table, gint **rows_selected)
-{
- ETableItem *item;
- gint n_selected, row, index_selected;
-
- item = E_TABLE_ITEM (eti_a11y_get_gobject (ATK_OBJECT (table)));
- if (!item)
- return 0;
-
- n_selected = e_selection_model_selected_count (item->selection);
- if (rows_selected) {
- *rows_selected = (gint *) g_malloc (n_selected * sizeof (gint));
-
- index_selected = 0;
- for (row = 0; row < item->rows && index_selected < n_selected; ++row) {
- if (atk_table_is_row_selected (table, row)) {
- (*rows_selected)[index_selected] = row;
- ++index_selected;
- }
- }
- }
- return n_selected;
-}
-
-static gboolean
-table_add_row_selection (AtkTable *table, gint row)
-{
- ETableItem *item;
- gint cursor_row, cursor_col, row_count;
- GdkModifierType state = GDK_CONTROL_MASK;
- ESelectionModel *selection;
-
- item = E_TABLE_ITEM (eti_a11y_get_gobject (ATK_OBJECT (table)));
- if (!item)
- return FALSE;
-
- if (table_is_row_selected (table, row))
- return TRUE;
- e_selection_model_toggle_single_row (item->selection,
- view_to_model_row (item, row));
-
- return TRUE;
-}
-
-static gboolean
-table_remove_row_selection (AtkTable *table, gint row)
-{
- ETableItem *item;
-
- item = E_TABLE_ITEM (eti_a11y_get_gobject (ATK_OBJECT (table)));
- if (!item)
- return FALSE;
-
- if (!atk_table_is_row_selected (table, row))
- return TRUE;
- e_selection_model_toggle_single_row (item->selection, row);
- return TRUE;
-}
-
-static void
-eti_atk_table_iface_init (AtkTableIface *iface)
-{
- iface->ref_at = eti_ref_at;
- iface->get_index_at = eti_get_index_at;
- iface->get_column_at_index = eti_get_column_at_index;
- iface->get_row_at_index = eti_get_row_at_index;
- iface->get_n_columns = eti_get_n_columns;
- iface->get_n_rows = eti_get_n_rows;
- iface->get_column_extent_at = eti_get_column_extent_at;
- iface->get_row_extent_at = eti_get_row_extent_at;
- iface->get_caption = eti_get_caption;
- iface->get_column_description = eti_get_column_description;
- iface->get_column_header = eti_get_column_header;
- iface->get_row_description = eti_get_row_description;
- iface->get_row_header = eti_get_row_header;
- iface->get_summary = eti_get_summary;
-
- iface->is_row_selected = table_is_row_selected;
- iface->is_selected = table_is_selected;
- iface->get_selected_rows = table_get_selected_rows;
- iface->add_row_selection = table_add_row_selection;
- iface->remove_row_selection = table_remove_row_selection;
-}
-
-static void
-eti_atk_component_iface_init (AtkComponentIface *iface)
-{
- component_parent_iface = g_type_interface_peek_parent (iface);
-
- iface->ref_accessible_at_point = eti_ref_accessible_at_point;
- iface->get_extents = eti_get_extents;
-}
-
-static void
-eti_rows_inserted (ETableModel * model, int row, int count,
- AtkObject * table_item)
-{
- gint n_cols,n_rows,i,j;
- gint size;
- gpointer *cell_data;
- ETableItem *item = E_TABLE_ITEM (atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (table_item)));
- GalA11yETableItem * item_a11y;
- gint old_nrows;
-
- g_return_if_fail (table_item);
- item_a11y = GAL_A11Y_E_TABLE_ITEM (table_item);
-
- n_cols = atk_table_get_n_columns (ATK_TABLE(table_item));
- n_rows = atk_table_get_n_rows (ATK_TABLE(table_item));
-
- old_nrows = GET_PRIVATE(item_a11y)->rows;
-
- g_return_if_fail (n_cols > 0 && n_rows > 0);
- g_return_if_fail (old_nrows == n_rows - count);
-
- cell_data = GET_PRIVATE(table_item)->cell_data;
- GET_PRIVATE(table_item)->cell_data = g_realloc (cell_data, (n_rows*n_cols) * sizeof(gpointer));
- cell_data = GET_PRIVATE(table_item)->cell_data;
-
- GET_PRIVATE(table_item)->rows = n_rows;
-
- /* If rows are insert in the middle of a table. */
- if (row + count < n_rows ) {
- memmove(&cell_data[(row+count)*n_cols], &cell_data[row*n_cols],
- (old_nrows-row)*n_cols*sizeof(gpointer));
-
- /* Update cell's index. */
- for (i = row + count; i < n_rows; i ++) {
- for (j = 0; j < n_cols; j ++)
- if (cell_data[i*n_cols + j] != NULL) {
- AtkObject * a11y;
-
- a11y = ATK_OBJECT(cell_data[i*n_cols + j]);
- GAL_A11Y_E_CELL(a11y)->row = i;
- }
- }
- }
-
- /* Clear cache for the new added rows. */
- for (i = row ; i < row+count; i ++)
- for (j = 0 ; j < n_cols; j ++)
- cell_data [i*n_cols + j] = NULL;
-
- g_signal_emit_by_name (table_item, "row-inserted", row,
- count, NULL);
-
- for (i = row; i < (row + count); i ++) {
- for (j = 0; j < n_cols; j ++) {
- g_signal_emit_by_name (table_item,
- "children_changed::add",
- ( (i*n_cols) + j), NULL, NULL);
- }
- }
-
- g_signal_emit_by_name (table_item, "visible-data-changed");
-}
-
-static void
-eti_rows_deleted (ETableModel * model, int row, int count,
- AtkObject * table_item)
-{
- gint i,j, n_rows, n_cols, old_nrows;
- gpointer *cell_data;
- ETableItem *item = E_TABLE_ITEM (atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (table_item)));
-
- n_rows = atk_table_get_n_rows (ATK_TABLE(table_item));
- n_cols = atk_table_get_n_columns (ATK_TABLE(table_item));
-
- cell_data = GET_PRIVATE(table_item)->cell_data;
- old_nrows = GET_PRIVATE(table_item)->rows;
-
- g_return_if_fail ( row+count <= old_nrows);
- g_return_if_fail (old_nrows == n_rows + count);
- GET_PRIVATE(table_item)->rows = n_rows;
-
- /* DEFUNCT the deleted cells. */
- for (i = row; i < row+count; i ++) {
- for (j = 0; j < n_cols; j ++) {
- if (cell_data[i*n_cols + j] != NULL) {
- AtkObject * a11y;
-
- a11y = ATK_OBJECT(cell_data[i*n_cols + j]);
- gal_a11y_e_cell_add_state (GAL_A11Y_E_CELL(a11y), ATK_STATE_DEFUNCT, TRUE);
- cell_data[i*n_cols + j] = NULL;
- }
- }
- }
-
- /* If more rows left, update the a11y object. */
- if (old_nrows > row + count) {
-
- /* Remove the defunct cells in cache. */
- memmove (&cell_data[row*n_cols], &cell_data[(row+count)*n_cols],
- ( old_nrows-row-count)*n_cols*sizeof(gpointer));
-
- GET_PRIVATE(table_item)->cell_data = g_realloc (cell_data, n_rows*n_cols*sizeof(gpointer));
- cell_data = GET_PRIVATE(table_item)->cell_data;
-
- /* Update index of cells below the deleted rows. */
- for (i = row; i < n_rows; i ++) {
- for (j = 0; j < n_cols; j ++) {
- if (cell_data[i*n_cols + j] != NULL) {
- AtkObject * a11y;
-
- a11y = ATK_OBJECT(cell_data[i*n_cols + j]);
- GAL_A11Y_E_CELL(a11y)->row = i;
- }
- }
- }
- }
-
- g_signal_emit_by_name (table_item, "row-deleted", row,
- count, NULL);
-
- for (i = row; i < (row + count); i ++) {
- for (j = 0; j < n_cols; j ++) {
- g_signal_emit_by_name (table_item,
- "children_changed::remove",
- ( (i*n_cols) + j), NULL, NULL);
- }
- }
- g_signal_emit_by_name (table_item, "visible-data-changed");
-}
-
-enum {
- ETI_HEADER_UNCHANGED = 0,
- ETI_HEADER_REORDERED,
- ETI_HEADER_NEW_ADDED,
- ETI_HEADER_REMOVED,
-};
-
-/*
- * 1. Check what actually happened: column reorder, remove or add
- * 2. Update cache
- * 3. Emit signals
- */
-static void
-eti_header_structure_changed (ETableHeader *eth, AtkObject *a11y)
-{
-
- gboolean reorder_found=FALSE, added_found=FALSE, removed_found=FALSE;
- GalA11yETableItem * a11y_item;
- ETableCol ** cols, **prev_cols;
- GalA11yETableItemPrivate *priv;
- gint *state = NULL, *prev_state = NULL, *reorder = NULL;
- gint i,j,n_rows,n_cols, prev_n_cols;
- gpointer * cell_data, * tmp;
-
- a11y_item = GAL_A11Y_E_TABLE_ITEM (a11y);
- priv = GET_PRIVATE (a11y_item);
-
- g_return_if_fail (priv && priv->cell_data);
- cell_data = priv->cell_data ;
-
- /* Assume rows do not changed. */
- n_rows = priv->rows;
-
- prev_n_cols = priv->cols;
- prev_cols = priv->columns;
-
- cols = e_table_header_get_columns (eth);
- n_cols = eth->col_count;
-
- g_return_if_fail (cols && prev_cols && n_cols > 0);
-
- /* Init to ETI_HEADER_UNCHANGED. */
- state = g_malloc0 (sizeof (gint) * n_cols);
- prev_state = g_malloc0 (sizeof (gint) * prev_n_cols);
- reorder = g_malloc0 (sizeof (gint) * n_cols);
-
- /* Compare with previously saved column headers. */
- for ( i = 0 ; i < n_cols && cols[i]; i ++ ) {
- for ( j = 0 ; j < prev_n_cols && prev_cols[j]; j ++ ) {
- if ( prev_cols [j] == cols[i] && i != j ) {
-
- reorder_found = TRUE;
- state [i] = ETI_HEADER_REORDERED;
- reorder [i] = j;
-
- break;
- } else if (prev_cols[j] == cols[i]) {
- /* OK, this column is not changed. */
- break;
- }
- }
-
- /* cols[i] is new added column. */
- if ( j == prev_n_cols ) {
- gint row;
-
- added_found = TRUE;
- state[i] = ETI_HEADER_NEW_ADDED;
- }
- }
-
- /* Now try to find if there are removed columns. */
- for (i = 0 ; i < prev_n_cols && prev_cols[i]; i ++) {
- for (j = 0 ; j < n_cols && cols[j]; j ++)
- if ( prev_cols [j] == cols[i] )
- break;
-
- /* Removed columns found. */
- if ( j == n_cols ) {
- removed_found = TRUE;
- prev_state[j] = ETI_HEADER_REMOVED;
- }
- }
-
- /* If nothing interesting just return. */
- if (!reorder_found && !added_found && !removed_found)
- return;
-
- /* Now update our cache. */
- tmp = g_malloc0 (n_rows*n_cols*sizeof(gpointer));
- g_return_if_fail (tmp);
-
- for (i = 0 ; i < n_rows; i ++) {
- for ( j = 0 ; j < n_cols; j ++ ) {
- if ( state[j] == ETI_HEADER_REORDERED ) {
- tmp [i*n_cols+j] = cell_data[i*prev_n_cols+reorder[j]];
- if (tmp[i*n_cols+j] && ATK_IS_OBJECT(tmp[i*n_cols+j])) {
- GAL_A11Y_E_CELL(tmp[i*n_cols+j])->view_col = j;
- }
- } else if (state[j] == ETI_HEADER_UNCHANGED) {
- tmp [i*n_cols+j] = cell_data[i*prev_n_cols+j];
- } /* else: new added, keep NULL. */
- }
- }
-
- g_free (cell_data);
- priv->cell_data = tmp;
-
- /* Emit signals */
- if (reorder_found)
- g_signal_emit_by_name (G_OBJECT(a11y_item), "column_reordered");
-
-
- if (removed_found) {
- for (i = 0; i < prev_n_cols; i ++ ) {
- if (prev_state[i] == ETI_HEADER_REMOVED) {
- g_signal_emit_by_name (G_OBJECT(a11y_item), "column-deleted", i, 1);
- for (j = 0 ; j < n_rows; j ++)
- g_signal_emit_by_name (G_OBJECT(a11y_item), "children_changed::remove", (j*prev_n_cols+i), NULL, NULL);
- }
- }
- }
-
- if (added_found) {
- for ( i = 0; i < n_cols; i ++ ) {
- if (state[i] == ETI_HEADER_NEW_ADDED) {
- g_signal_emit_by_name (G_OBJECT(a11y_item), "column-inserted", i, 1);
- for (j = 0 ; j < n_rows; j ++)
- g_signal_emit_by_name (G_OBJECT(a11y_item), "children_changed::add", (j*n_cols+i), NULL, NULL);
- }
- }
- }
-
- priv->cols = n_cols;
-
- g_free (state);
- g_free (reorder);
- g_free (prev_state);
-
- g_free (priv->columns);
- priv->columns = cols;
-}
-
-
-static void
-eti_real_initialize (AtkObject *obj,
- gpointer data)
-{
- ETableItem * eti;
- ETableModel * model;
-
- ATK_OBJECT_CLASS (parent_class)->initialize (obj, data);
- eti = E_TABLE_ITEM (data);
-
- model = eti->table_model;
-
- g_signal_connect (model, "model-rows-inserted",
- G_CALLBACK (eti_rows_inserted),
- obj);
- g_signal_connect (model, "model-rows-deleted",
- G_CALLBACK (eti_rows_deleted),
- obj);
- g_signal_connect (G_OBJECT (eti->header), "structure_change",
- G_CALLBACK (eti_header_structure_changed), obj);
-
-}
-
-static void
-eti_class_init (GalA11yETableItemClass *klass)
-{
- AtkObjectClass *atk_object_class = ATK_OBJECT_CLASS (klass);
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- quark_accessible_object = g_quark_from_static_string ("gtk-accessible-object");
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- object_class->dispose = eti_dispose;
-
- atk_object_class->get_parent = eti_get_parent;
- atk_object_class->get_n_children = eti_get_n_children;
- atk_object_class->ref_child = eti_ref_child;
- atk_object_class->get_index_in_parent = eti_get_index_in_parent;
- atk_object_class->initialize = eti_real_initialize;
-}
-
-static void
-eti_init (GalA11yETableItem *a11y)
-{
- GalA11yETableItemPrivate *priv;
-
- priv = GET_PRIVATE (a11y);
-
- priv->parent = NULL;
- priv->index_in_parent = -1;
- priv->selection_change_id = 0;
- priv->cursor_change_id = 0;
- priv->selection = NULL;
-}
-
-/* atk selection */
-
-static void atk_selection_interface_init (AtkSelectionIface *iface);
-static gboolean selection_add_selection (AtkSelection *selection,
- gint i);
-static gboolean selection_clear_selection (AtkSelection *selection);
-static AtkObject* selection_ref_selection (AtkSelection *selection,
- gint i);
-static gint selection_get_selection_count (AtkSelection *selection);
-static gboolean selection_is_child_selected (AtkSelection *selection,
- gint i);
-
-/* callbacks */
-static void eti_a11y_selection_model_removed_cb (ETableItem *eti,
- ESelectionModel *selection,
- gpointer data);
-static void eti_a11y_selection_model_added_cb (ETableItem *eti,
- ESelectionModel *selection,
- gpointer data);
-static void eti_a11y_selection_changed_cb (ESelectionModel *selection,
- GalA11yETableItem *a11y);
-static void eti_a11y_cursor_changed_cb (ESelectionModel *selection,
- int row, int col,
- GalA11yETableItem *a11y);
-
-/**
- * gal_a11y_e_table_item_get_type:
- * @void:
- *
- * Registers the &GalA11yETableItem class if necessary, and returns the type ID
- * associated to it.
- *
- * Return value: The type ID of the &GalA11yETableItem class.
- **/
-GType
-gal_a11y_e_table_item_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- AtkObjectFactory *factory;
-
- GTypeInfo info = {
- sizeof (GalA11yETableItemClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) eti_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (GalA11yETableItem),
- 0,
- (GInstanceInitFunc) eti_init,
- NULL /* value_table_item */
- };
-
- static const GInterfaceInfo atk_component_info = {
- (GInterfaceInitFunc) eti_atk_component_iface_init,
- (GInterfaceFinalizeFunc) NULL,
- NULL
- };
- static const GInterfaceInfo atk_table_info = {
- (GInterfaceInitFunc) eti_atk_table_iface_init,
- (GInterfaceFinalizeFunc) NULL,
- NULL
- };
-
- static const GInterfaceInfo atk_selection_info = {
- (GInterfaceInitFunc) atk_selection_interface_init,
- (GInterfaceFinalizeFunc) NULL,
- NULL
- };
-
-
- factory = atk_registry_get_factory (atk_get_default_registry (), GNOME_TYPE_CANVAS_ITEM);
- parent_type = atk_object_factory_get_accessible_type (factory);
-
- type = gal_a11y_type_register_static_with_private (PARENT_TYPE, "GalA11yETableItem", &info, 0,
- sizeof (GalA11yETableItemPrivate), &priv_offset);
-
- g_type_add_interface_static (type, ATK_TYPE_COMPONENT, &atk_component_info);
- g_type_add_interface_static (type, ATK_TYPE_TABLE, &atk_table_info);
- g_type_add_interface_static (type, ATK_TYPE_SELECTION, &atk_selection_info);
- }
-
- return type;
-}
-
-AtkObject *
-gal_a11y_e_table_item_new (AtkObject *parent,
- ETableItem *item,
- int index_in_parent)
-{
- GalA11yETableItem *a11y;
- int n;
-
- a11y = g_object_new (gal_a11y_e_table_item_get_type (), NULL);
-
- atk_object_initialize (ATK_OBJECT (a11y), item);
-
- GET_PRIVATE (a11y)->parent = parent;
- GET_PRIVATE (a11y)->index_in_parent = index_in_parent;
-
- g_return_val_if_fail (item->cols >= 0 && item->rows >= 0, NULL);
- /* Initialize cell data. */
- n = item->cols * item->rows;
- GET_PRIVATE (a11y)->cols = item->cols;
- GET_PRIVATE (a11y)->rows = item->rows;
- if (n > 0) {
- GET_PRIVATE (a11y)->cell_data = g_malloc0(n*sizeof(gpointer));
- /* memory error. */
- if ( GET_PRIVATE (a11y)->cell_data == NULL)
- return NULL;
- } else
- GET_PRIVATE (a11y)->cell_data = NULL;
-
-
- GET_PRIVATE (a11y)->columns = e_table_header_get_columns (item->header);
- if ( GET_PRIVATE (a11y)->columns == NULL)
- return NULL;
-
- if (item) {
- g_signal_connect (G_OBJECT(item), "selection_model_removed",
- G_CALLBACK (eti_a11y_selection_model_removed_cb), NULL);
- g_signal_connect (G_OBJECT(item), "selection_model_added",
- G_CALLBACK (eti_a11y_selection_model_added_cb), NULL);
- if (item->selection)
- gal_a11y_e_table_item_ref_selection (a11y,
- item->selection);
- }
- if (parent)
- g_object_ref (parent);
-
-#if 0
- if (item)
- g_object_weak_ref (G_OBJECT (item),
- unref_accessible,
- a11y);
-#endif
-
- return ATK_OBJECT (a11y);
-}
-
-static gboolean
-gal_a11y_e_table_item_ref_selection (GalA11yETableItem *a11y,
- ESelectionModel *selection)
-{
- GalA11yETableItemPrivate *priv;
-
- g_return_val_if_fail (a11y && selection, FALSE);
-
- priv = GET_PRIVATE (a11y);
- priv->selection_change_id = g_signal_connect (
- G_OBJECT(selection), "selection_changed",
- G_CALLBACK (eti_a11y_selection_changed_cb), a11y);
- priv->cursor_change_id = g_signal_connect (
- G_OBJECT(selection), "cursor_changed",
- G_CALLBACK (eti_a11y_cursor_changed_cb), a11y);
-
- priv->selection = selection;
- g_object_ref (selection);
-
- return TRUE;
-}
-
-static gboolean
-gal_a11y_e_table_item_unref_selection (GalA11yETableItem *a11y)
-{
- GalA11yETableItemPrivate *priv;
-
- g_return_val_if_fail (a11y, FALSE);
-
- priv = GET_PRIVATE (a11y);
-
- g_return_val_if_fail (priv->selection_change_id != 0, FALSE);
- g_return_val_if_fail (priv->cursor_change_id != 0, FALSE);
-
-
- g_signal_handler_disconnect (priv->selection,
- priv->selection_change_id);
- g_signal_handler_disconnect (priv->selection,
- priv->cursor_change_id);
- priv->cursor_change_id = 0;
- priv->selection_change_id = 0;
-
- g_object_unref (priv->selection);
- priv->selection = NULL;
-
- return TRUE;
-}
-
-/* callbacks */
-
-static void
-eti_a11y_selection_model_removed_cb (ETableItem *eti, ESelectionModel *selection,
- gpointer data)
-{
- AtkObject *atk_obj;
- GalA11yETableItem *a11y;
-
- g_return_if_fail (E_IS_TABLE_ITEM (eti));
- g_return_if_fail (E_IS_SELECTION_MODEL (selection));
-
- atk_obj = atk_gobject_accessible_for_object (G_OBJECT (eti));
- a11y = GAL_A11Y_E_TABLE_ITEM (atk_obj);
-
- if (selection == GET_PRIVATE (a11y)->selection)
- gal_a11y_e_table_item_unref_selection (a11y);
-}
-
-static void
-eti_a11y_selection_model_added_cb (ETableItem *eti, ESelectionModel *selection,
- gpointer data)
-{
- AtkObject *atk_obj;
- GalA11yETableItem *a11y;
-
- g_return_if_fail (E_IS_TABLE_ITEM (eti));
- g_return_if_fail (E_IS_SELECTION_MODEL (selection));
-
- atk_obj = atk_gobject_accessible_for_object (G_OBJECT (eti));
- a11y = GAL_A11Y_E_TABLE_ITEM (atk_obj);
-
- if (GET_PRIVATE (a11y)->selection)
- gal_a11y_e_table_item_unref_selection (a11y);
- gal_a11y_e_table_item_ref_selection (a11y, selection);
-}
-
-static void
-eti_a11y_selection_changed_cb (ESelectionModel *selection, GalA11yETableItem *a11y)
-{
- g_return_if_fail (GAL_A11Y_IS_E_TABLE_ITEM (a11y));
-
- g_signal_emit_by_name (a11y, "selection_changed");
-}
-
-static void
-eti_a11y_cursor_changed_cb (ESelectionModel *selection,
- int row, int col, GalA11yETableItem *a11y)
-{
- AtkObject * cell;
- g_return_if_fail (GAL_A11Y_IS_E_TABLE_ITEM (a11y));
-
- g_signal_emit_by_name (a11y, "selection_changed");
-
- cell = atk_table_ref_at (ATK_TABLE (a11y), row, col);
- if (ATK_IS_OBJECT (cell))
- g_signal_emit_by_name (a11y,
- "active-descendant-changed",
- cell);
-}
-
-/* atk selection */
-
-static void atk_selection_interface_init (AtkSelectionIface *iface)
-{
- g_return_if_fail (iface != NULL);
- iface->add_selection = selection_add_selection;
- iface->clear_selection = selection_clear_selection;
- iface->ref_selection = selection_ref_selection;
- iface->get_selection_count = selection_get_selection_count;
- iface->is_child_selected = selection_is_child_selected;
-}
-
-static gboolean
-selection_add_selection (AtkSelection *selection, gint index)
-{
- AtkTable *table;
- gint row, col;
- ETableItem *item;
-
- item = E_TABLE_ITEM (eti_a11y_get_gobject (ATK_OBJECT (selection)));
- if (!item)
- return FALSE;
-
- table = ATK_TABLE (selection);
-
- row = atk_table_get_row_at_index (table, index);
- atk_table_add_row_selection (table, row);
-
- col = atk_table_get_column_at_index (table, index);
- e_selection_model_change_cursor (item->selection,
- view_to_model_row (item, row),
- view_to_model_col (item, col));
- e_selection_model_cursor_changed (item->selection,
- view_to_model_row (item, row),
- view_to_model_col (item, col));
- e_selection_model_cursor_activated (item->selection,
- view_to_model_row (item, row),
- view_to_model_col (item, col));
- return TRUE;
-}
-
-static gboolean
-selection_clear_selection (AtkSelection *selection)
-{
- ETableItem *item;
-
- item = E_TABLE_ITEM (eti_a11y_get_gobject (ATK_OBJECT (selection)));
- if (!item)
- return FALSE;
-
- e_selection_model_clear (item->selection);
- return TRUE;
-}
-
-static AtkObject *
-selection_ref_selection (AtkSelection *selection, gint index)
-{
- AtkTable *table;
- gint row, col;
-
- table = ATK_TABLE (selection);
- row = atk_table_get_row_at_index (table, index);
- col = atk_table_get_column_at_index (table, index);
- if (!atk_table_is_row_selected (table, row))
- return NULL;
-
- return atk_table_ref_at (table, row, col);
-}
-
-static gint
-selection_get_selection_count (AtkSelection *selection)
-{
- AtkTable *table;
- gint n_selected;
-
- table = ATK_TABLE (selection);
- n_selected = atk_table_get_selected_rows (table, NULL);
- if (n_selected > 0)
- n_selected *= atk_table_get_n_columns (table);
- return n_selected;
-}
-
-static gboolean
-selection_is_child_selected (AtkSelection *selection, gint i)
-{
- gint row;
-
- row = atk_table_get_row_at_index (ATK_TABLE (selection), i);
- return atk_table_is_row_selected (ATK_TABLE (selection), row);
-}
diff --git a/a11y/e-table/gal-a11y-e-table-item.h b/a11y/e-table/gal-a11y-e-table-item.h
deleted file mode 100644
index f3a447131d..0000000000
--- a/a11y/e-table/gal-a11y-e-table-item.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Christopher James Lahey <clahey@ximian.com>
- *
- * Copyright (C) 2001 Chris Lahey
- */
-
-#ifndef __GAL_A11Y_E_TABLE_ITEM_H__
-#define __GAL_A11Y_E_TABLE_ITEM_H__
-
-#include <glib-object.h>
-#include <gal/e-table/e-table-item.h>
-#include <atk/atkgobjectaccessible.h>
-
-#define GAL_A11Y_TYPE_E_TABLE_ITEM (gal_a11y_e_table_item_get_type ())
-#define GAL_A11Y_E_TABLE_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAL_A11Y_TYPE_E_TABLE_ITEM, GalA11yETableItem))
-#define GAL_A11Y_E_TABLE_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAL_A11Y_TYPE_E_TABLE_ITEM, GalA11yETableItemClass))
-#define GAL_A11Y_IS_E_TABLE_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAL_A11Y_TYPE_E_TABLE_ITEM))
-#define GAL_A11Y_IS_E_TABLE_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAL_A11Y_TYPE_E_TABLE_ITEM))
-
-typedef struct _GalA11yETableItem GalA11yETableItem;
-typedef struct _GalA11yETableItemClass GalA11yETableItemClass;
-typedef struct _GalA11yETableItemPrivate GalA11yETableItemPrivate;
-
-/* This struct should actually be larger as this isn't what we derive from.
- * The GalA11yETableItemPrivate comes right after the parent class structure.
- **/
-struct _GalA11yETableItem {
- AtkGObjectAccessible parent;
-};
-
-struct _GalA11yETableItemClass {
- AtkGObjectAccessibleClass parent_class;
-};
-
-
-/* Standard Glib function */
-GType gal_a11y_e_table_item_get_type (void);
-AtkObject *gal_a11y_e_table_item_new (AtkObject *parent,
- ETableItem *item,
- int index_in_parent);
-
-#endif /* ! __GAL_A11Y_E_TABLE_ITEM_H__ */
diff --git a/a11y/e-table/gal-a11y-e-table.c b/a11y/e-table/gal-a11y-e-table.c
deleted file mode 100644
index 6cd87f41c6..0000000000
--- a/a11y/e-table/gal-a11y-e-table.c
+++ /dev/null
@@ -1,157 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Christopher James Lahey <clahey@ximian.com>
- *
- * Copyright (C) 2002 Ximian, Inc.
- */
-
-#include <config.h>
-#include "gal-a11y-e-table.h"
-#include "gal-a11y-e-table-item.h"
-#include "gal-a11y-util.h"
-#include <gal/e-table/e-table.h>
-#include <gal/e-table/e-table-group.h>
-#include <gal/e-table/e-table-group-leaf.h>
-
-#define CS_CLASS(a11y) (G_TYPE_INSTANCE_GET_CLASS ((a11y), C_TYPE_STREAM, GalA11yETableClass))
-static AtkObjectClass *parent_class;
-static GType parent_type;
-static gint priv_offset;
-#define GET_PRIVATE(object) ((GalA11yETablePrivate *) (((char *) object) + priv_offset))
-#define PARENT_TYPE (parent_type)
-
-struct _GalA11yETablePrivate {
- AtkObject *child_item;
-};
-
-/* Static functions */
-
-static void
-init_child_item (GalA11yETable *a11y)
-{
- GalA11yETablePrivate *priv = GET_PRIVATE (a11y);
- ETable *table = E_TABLE (GTK_ACCESSIBLE (a11y)->widget);
- if (priv->child_item == NULL) {
- priv->child_item = gal_a11y_e_table_item_new (ATK_OBJECT (a11y), E_TABLE_GROUP_LEAF (table->group)->item, 0);
- priv->child_item->role = ATK_ROLE_TABLE;
- }
-}
-
-static AtkObject*
-et_ref_accessible_at_point (AtkComponent *component,
- gint x,
- gint y,
- AtkCoordType coord_type)
-{
- GalA11yETable *a11y = GAL_A11Y_E_TABLE (component);
- init_child_item (a11y);
- return GET_PRIVATE (a11y)->child_item;
-}
-
-static gint
-et_get_n_children (AtkObject *accessible)
-{
- return 1;
-}
-
-static AtkObject*
-et_ref_child (AtkObject *accessible,
- gint i)
-{
- GalA11yETable *a11y = GAL_A11Y_E_TABLE (accessible);
- if (i != 0)
- return NULL;
- init_child_item (a11y);
- g_object_ref (GET_PRIVATE (a11y)->child_item);
- return GET_PRIVATE (a11y)->child_item;
-}
-
-static void
-et_class_init (GalA11yETableClass *klass)
-{
- AtkObjectClass *atk_object_class = ATK_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- atk_object_class->get_n_children = et_get_n_children;
- atk_object_class->ref_child = et_ref_child;
-}
-
-static void
-et_atk_component_iface_init (AtkComponentIface *iface)
-{
- iface->ref_accessible_at_point = et_ref_accessible_at_point;
-}
-
-static void
-et_init (GalA11yETable *a11y)
-{
- GalA11yETablePrivate *priv;
-
- priv = GET_PRIVATE (a11y);
-
- priv->child_item = NULL;
-}
-
-/**
- * gal_a11y_e_table_get_type:
- * @void:
- *
- * Registers the &GalA11yETable class if necessary, and returns the type ID
- * associated to it.
- *
- * Return value: The type ID of the &GalA11yETable class.
- **/
-GType
-gal_a11y_e_table_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- AtkObjectFactory *factory;
-
- GTypeInfo info = {
- sizeof (GalA11yETableClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) et_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (GalA11yETable),
- 0,
- (GInstanceInitFunc) et_init,
- NULL /* value_table */
- };
-
- static const GInterfaceInfo atk_component_info = {
- (GInterfaceInitFunc) et_atk_component_iface_init,
- (GInterfaceFinalizeFunc) NULL,
- NULL
- };
-
- factory = atk_registry_get_factory (atk_get_default_registry (), GTK_TYPE_WIDGET);
- parent_type = atk_object_factory_get_accessible_type (factory);
-
- type = gal_a11y_type_register_static_with_private (PARENT_TYPE, "GalA11yETable", &info, 0,
- sizeof (GalA11yETablePrivate), &priv_offset);
- g_type_add_interface_static (type, ATK_TYPE_COMPONENT, &atk_component_info);
- }
-
- return type;
-}
-
-AtkObject *
-gal_a11y_e_table_new (GObject *widget)
-{
- GalA11yETable *a11y;
- ETable *table;
-
- table = E_TABLE (widget);
-
- a11y = g_object_new (gal_a11y_e_table_get_type (), NULL);
-
- GTK_ACCESSIBLE (a11y)->widget = GTK_WIDGET (widget);
-
- return ATK_OBJECT (a11y);
-}
diff --git a/a11y/e-table/gal-a11y-e-table.h b/a11y/e-table/gal-a11y-e-table.h
deleted file mode 100644
index 0a0901e3bc..0000000000
--- a/a11y/e-table/gal-a11y-e-table.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Christopher James Lahey <clahey@ximian.com>
- *
- * Copyright (C) 2001 Chris Lahey
- */
-
-#ifndef __GAL_A11Y_E_TABLE_H__
-#define __GAL_A11Y_E_TABLE_H__
-
-#include <glib-object.h>
-#include <atk/atkobject.h>
-#include <atk/atkcomponent.h>
-#include <gtk/gtkaccessible.h>
-
-#define GAL_A11Y_TYPE_E_TABLE (gal_a11y_e_table_get_type ())
-#define GAL_A11Y_E_TABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAL_A11Y_TYPE_E_TABLE, GalA11yETable))
-#define GAL_A11Y_E_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAL_A11Y_TYPE_E_TABLE, GalA11yETableClass))
-#define GAL_A11Y_IS_E_TABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAL_A11Y_TYPE_E_TABLE))
-#define GAL_A11Y_IS_E_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAL_A11Y_TYPE_E_TABLE))
-
-typedef struct _GalA11yETable GalA11yETable;
-typedef struct _GalA11yETableClass GalA11yETableClass;
-typedef struct _GalA11yETablePrivate GalA11yETablePrivate;
-
-/* This struct should actually be larger as this isn't what we derive from.
- * The GalA11yETablePrivate comes right after the parent class structure.
- **/
-struct _GalA11yETable {
- GtkAccessible object;
-};
-
-struct _GalA11yETableClass {
- GtkAccessibleClass parent_class;
-};
-
-
-/* Standard Glib function */
-GType gal_a11y_e_table_get_type (void);
-AtkObject *gal_a11y_e_table_new (GObject *table);
-
-#endif /* ! __GAL_A11Y_E_TABLE_H__ */
diff --git a/a11y/e-table/gal-a11y-e-tree-factory.c b/a11y/e-table/gal-a11y-e-tree-factory.c
deleted file mode 100644
index 2fa34c5fbc..0000000000
--- a/a11y/e-table/gal-a11y-e-tree-factory.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Authors: Yuedong Du <yuedong.du@sun.com>
- *
- * Copyright (C) 2003 Ximian, Inc.
- */
-
-#include <config.h>
-#include "gal-a11y-e-tree-factory.h"
-#include "gal-a11y-e-tree.h"
-
-#define CS_CLASS(factory) (G_TYPE_INSTANCE_GET_CLASS ((factory), C_TYPE_STREAM, GalA11yETreeFactoryClass))
-static AtkObjectFactoryClass *parent_class;
-#define PARENT_TYPE (ATK_TYPE_OBJECT_FACTORY)
-
-/* Static functions */
-
-static GType
-gal_a11y_e_tree_factory_get_accessible_type (void)
-{
- return GAL_A11Y_TYPE_E_TREE;
-}
-
-static AtkObject*
-gal_a11y_e_tree_factory_create_accessible (GObject *obj)
-{
- AtkObject *accessible;
-
- accessible = gal_a11y_e_tree_new (obj);
-
- return accessible;
-}
-
-static void
-gal_a11y_e_tree_factory_class_init (GalA11yETreeFactoryClass *klass)
-{
- AtkObjectFactoryClass *factory_class = ATK_OBJECT_FACTORY_CLASS (klass);
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- factory_class->create_accessible = gal_a11y_e_tree_factory_create_accessible;
- factory_class->get_accessible_type = gal_a11y_e_tree_factory_get_accessible_type;
-}
-
-static void
-gal_a11y_e_tree_factory_init (GalA11yETreeFactory *factory)
-{
-}
-
-/**
- * gal_a11y_e_tree_factory_get_type:
- * @void:
- *
- * Registers the &GalA11yETreeFactory class if necessary, and returns the type ID
- * associated to it.
- *
- * Return value: The type ID of the &GalA11yETreeFactory class.
- **/
-GType
-gal_a11y_e_tree_factory_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- GTypeInfo info = {
- sizeof (GalA11yETreeFactoryClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) gal_a11y_e_tree_factory_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (GalA11yETreeFactory),
- 0,
- (GInstanceInitFunc) gal_a11y_e_tree_factory_init,
- NULL /* value_tree */
- };
-
- type = g_type_register_static (PARENT_TYPE, "GalA11yETreeFactory", &info, 0);
- }
-
- return type;
-}
diff --git a/a11y/e-table/gal-a11y-e-tree-factory.h b/a11y/e-table/gal-a11y-e-tree-factory.h
deleted file mode 100644
index 434e526db9..0000000000
--- a/a11y/e-table/gal-a11y-e-tree-factory.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Authors: Yuedong Du <yuedong.du@ximian.com>
- *
- * Copyright (C) 2003 Ximian, Inc.
- */
-
-#ifndef __GAL_A11Y_E_TREE_FACTORY_H__
-#define __GAL_A11Y_E_TREE_FACTORY_H__
-
-#include <glib-object.h>
-#include <atk/atkobjectfactory.h>
-
-#define GAL_A11Y_TYPE_E_TREE_FACTORY (gal_a11y_e_table_factory_get_type ())
-#define GAL_A11Y_E_TREE_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAL_A11Y_TYPE_E_TREE_FACTORY, GalA11yETreeFactory))
-#define GAL_A11Y_E_TREE_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAL_A11Y_TYPE_E_TREE_FACTORY, GalA11yETreeFactoryClass))
-#define GAL_A11Y_IS_E_TREE_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAL_A11Y_TYPE_E_TREE_FACTORY))
-#define GAL_A11Y_IS_E_TREE_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAL_A11Y_TYPE_E_TREE_FACTORY))
-
-typedef struct _GalA11yETreeFactory GalA11yETreeFactory;
-typedef struct _GalA11yETreeFactoryClass GalA11yETreeFactoryClass;
-
-struct _GalA11yETreeFactory {
- AtkObject object;
-};
-
-struct _GalA11yETreeFactoryClass {
- AtkObjectClass parent_class;
-};
-
-
-/* Standard Glib function */
-GType gal_a11y_e_tree_factory_get_type (void);
-
-#endif /* ! __GAL_A11Y_E_TREE_FACTORY_H__ */
diff --git a/a11y/e-table/gal-a11y-e-tree.c b/a11y/e-table/gal-a11y-e-tree.c
deleted file mode 100644
index dc7755c6f2..0000000000
--- a/a11y/e-table/gal-a11y-e-tree.c
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Authors: Yuedong Du <yuedong.du@sun.com>
- *
- * Copyright (C) 2003 Ximian, Inc.
- */
-
-#include <config.h>
-#include "gal-a11y-e-tree.h"
-#include "gal-a11y-util.h"
-#include <gal/e-table/e-tree.h>
-#include <gal/e-table/e-table-item.h>
-
-#define CS_CLASS(a11y) (G_TYPE_INSTANCE_GET_CLASS ((a11y), C_TYPE_STREAM, GalA11yETreeClass))
-static AtkObjectClass *parent_class;
-static GType parent_type;
-static gint priv_offset;
-#define GET_PRIVATE(object) ((GalA11yETreePrivate *) (((char *) object) + priv_offset))
-#define PARENT_TYPE (parent_type)
-
-struct _GalA11yETreePrivate {
- AtkObject *child_item;
-};
-
-/* Static functions */
-
-static void
-init_child_item (GalA11yETree *a11y)
-{
- GalA11yETreePrivate *priv = GET_PRIVATE (a11y);
- ETree *tree = E_TREE (GTK_ACCESSIBLE (a11y)->widget);
- ETableItem * eti;
-
- g_return_if_fail (tree);
- eti = e_tree_get_item (tree);
- if (priv->child_item == NULL) {
- priv->child_item = gal_a11y_e_table_item_new (ATK_OBJECT (a11y),eti, 0);
- g_return_if_fail (priv->child_item);
- priv->child_item->role = ATK_ROLE_TREE_TABLE;
- }
-}
-
-static AtkObject*
-et_ref_accessible_at_point (AtkComponent *component,
- gint x,
- gint y,
- AtkCoordType coord_type)
-{
- GalA11yETree *a11y = GAL_A11Y_E_TREE (component);
- init_child_item (a11y);
- return GET_PRIVATE (a11y)->child_item;
-}
-
-static gint
-et_get_n_children (AtkObject *accessible)
-{
- return 1;
-}
-
-static AtkObject*
-et_ref_child (AtkObject *accessible,
- gint i)
-{
- GalA11yETree *a11y = GAL_A11Y_E_TREE (accessible);
- if (i != 0)
- return NULL;
- init_child_item (a11y);
- g_object_ref (GET_PRIVATE (a11y)->child_item);
- return GET_PRIVATE (a11y)->child_item;
-}
-
-static void
-et_class_init (GalA11yETreeClass *klass)
-{
- AtkObjectClass *atk_object_class = ATK_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- atk_object_class->get_n_children = et_get_n_children;
- atk_object_class->ref_child = et_ref_child;
-}
-
-static void
-et_atk_component_iface_init (AtkComponentIface *iface)
-{
- iface->ref_accessible_at_point = et_ref_accessible_at_point;
-}
-
-static void
-et_init (GalA11yETree *a11y)
-{
- GalA11yETreePrivate *priv;
-
- priv = GET_PRIVATE (a11y);
-
- priv->child_item = NULL;
-}
-
-/**
- * gal_a11y_e_tree_get_type:
- * @void:
- *
- * Registers the &GalA11yETree class if necessary, and returns the type ID
- * associated to it.
- *
- * Return value: The type ID of the &GalA11yETree class.
- **/
-GType
-gal_a11y_e_tree_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- AtkObjectFactory *factory;
-
- GTypeInfo info = {
- sizeof (GalA11yETreeClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) et_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (GalA11yETree),
- 0,
- (GInstanceInitFunc) et_init,
- NULL /* value_tree */
- };
-
- static const GInterfaceInfo atk_component_info = {
- (GInterfaceInitFunc) et_atk_component_iface_init,
- (GInterfaceFinalizeFunc) NULL,
- NULL
- };
-
- factory = atk_registry_get_factory (atk_get_default_registry (), GTK_TYPE_WIDGET);
- parent_type = atk_object_factory_get_accessible_type (factory);
-
- type = gal_a11y_type_register_static_with_private (PARENT_TYPE, "GalA11yETree", &info, 0,
- sizeof (GalA11yETreePrivate), &priv_offset);
- g_type_add_interface_static (type, ATK_TYPE_COMPONENT, &atk_component_info);
- }
-
- return type;
-}
-
-AtkObject *
-gal_a11y_e_tree_new (GObject *widget)
-{
- GalA11yETree *a11y;
- ETree *tree;
- AtkObject * item;
-
- tree = E_TREE (widget);
-
- a11y = g_object_new (gal_a11y_e_tree_get_type (), NULL);
-
- GTK_ACCESSIBLE (a11y)->widget = GTK_WIDGET (widget);
-
- return ATK_OBJECT (a11y);
-}
diff --git a/a11y/e-table/gal-a11y-e-tree.h b/a11y/e-table/gal-a11y-e-tree.h
deleted file mode 100644
index 65b8deb6cf..0000000000
--- a/a11y/e-table/gal-a11y-e-tree.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Authors: Yuedong Du <yuedong.du@sun.com>
- *
- * Copyright (C) 2003 Ximian, Inc.
- */
-
-#ifndef __GAL_A11Y_E_TREE_H__
-#define __GAL_A11Y_E_TREE_H__
-
-#include <glib-object.h>
-#include <atk/atkobject.h>
-#include <atk/atkcomponent.h>
-#include <gtk/gtkaccessible.h>
-
-#define GAL_A11Y_TYPE_E_TREE (gal_a11y_e_tree_get_type ())
-#define GAL_A11Y_E_TREE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAL_A11Y_TYPE_E_TREE, GalA11yETree))
-#define GAL_A11Y_E_TREE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAL_A11Y_TYPE_E_TREE, GalA11yETreeClass))
-#define GAL_A11Y_IS_E_TREE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAL_A11Y_TYPE_E_TREE))
-#define GAL_A11Y_IS_E_TREE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAL_A11Y_TYPE_E_TREE))
-
-typedef struct _GalA11yETree GalA11yETree;
-typedef struct _GalA11yETreeClass GalA11yETreeClass;
-typedef struct _GalA11yETreePrivate GalA11yETreePrivate;
-
-/* This struct should actually be larger as this isn't what we derive from.
- * The GalA11yETablePrivate comes right after the parent class structure.
- **/
-struct _GalA11yETree {
- GtkAccessible object;
-};
-
-struct _GalA11yETreeClass {
- GtkAccessibleClass parent_class;
-};
-
-
-/* Standard Glib function */
-GType gal_a11y_e_tree_get_type (void);
-AtkObject *gal_a11y_e_tree_new (GObject *tree);
-
-#endif /* ! __GAL_A11Y_E_TREE_H__ */
diff --git a/a11y/e-text/.cvsignore b/a11y/e-text/.cvsignore
deleted file mode 100644
index 5b48d3f593..0000000000
--- a/a11y/e-text/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-.libs
-Makefile.in
-Makefile
-*.la
diff --git a/a11y/e-text/gal-a11y-e-text-factory.c b/a11y/e-text/gal-a11y-e-text-factory.c
deleted file mode 100644
index 24e3c28116..0000000000
--- a/a11y/e-text/gal-a11y-e-text-factory.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Christopher James Lahey <clahey@ximian.com>
- *
- * Copyright (C) 2002 Ximian, Inc.
- */
-
-#include <config.h>
-#include "gal/e-text/e-text.h"
-#include "gal-a11y-e-text-factory.h"
-#include "gal-a11y-e-text.h"
-
-#define CS_CLASS(factory) (G_TYPE_INSTANCE_GET_CLASS ((factory), C_TYPE_STREAM, GalA11yETextFactoryClass))
-static AtkObjectFactoryClass *parent_class;
-#define PARENT_TYPE (ATK_TYPE_OBJECT_FACTORY)
-
-/* Static functions */
-
-static GType
-gal_a11y_e_text_factory_get_accessible_type (void)
-{
- return GAL_A11Y_TYPE_E_TEXT;
-}
-
-static AtkObject*
-gal_a11y_e_text_factory_create_accessible (GObject *obj)
-{
- AtkObject *atk_object;
-
- g_return_val_if_fail (E_IS_TEXT (obj), NULL);
-
- atk_object = g_object_new (GAL_A11Y_TYPE_E_TEXT, NULL);
- atk_object_initialize (atk_object, obj);
-
- return atk_object;
-}
-
-static void
-gal_a11y_e_text_factory_class_init (GalA11yETextFactoryClass *klass)
-{
- AtkObjectFactoryClass *factory_class = ATK_OBJECT_FACTORY_CLASS (klass);
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- factory_class->create_accessible = gal_a11y_e_text_factory_create_accessible;
- factory_class->get_accessible_type = gal_a11y_e_text_factory_get_accessible_type;
-}
-
-static void
-gal_a11y_e_text_factory_init (GalA11yETextFactory *factory)
-{
-}
-
-/**
- * gal_a11y_e_text_factory_get_type:
- * @void:
- *
- * Registers the &GalA11yETextFactory class if necessary, and returns the type ID
- * associated to it.
- *
- * Return value: The type ID of the &GalA11yETextFactory class.
- **/
-GType
-gal_a11y_e_text_factory_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- GTypeInfo info = {
- sizeof (GalA11yETextFactoryClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) gal_a11y_e_text_factory_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (GalA11yETextFactory),
- 0,
- (GInstanceInitFunc) gal_a11y_e_text_factory_init,
- NULL /* value_text */
- };
-
- type = g_type_register_static (PARENT_TYPE, "GalA11yETextFactory", &info, 0);
- }
-
- return type;
-}
diff --git a/a11y/e-text/gal-a11y-e-text-factory.h b/a11y/e-text/gal-a11y-e-text-factory.h
deleted file mode 100644
index 56a8d29ab9..0000000000
--- a/a11y/e-text/gal-a11y-e-text-factory.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Christopher James Lahey <clahey@ximian.com>
- *
- * Copyright (C) 2001 Chris Lahey
- */
-
-#ifndef __GAL_A11Y_E_TEXT_FACTORY_H__
-#define __GAL_A11Y_E_TEXT_FACTORY_H__
-
-#include <glib-object.h>
-#include <atk/atkobjectfactory.h>
-
-#define GAL_A11Y_TYPE_E_TEXT_FACTORY (gal_a11y_e_text_factory_get_type ())
-#define GAL_A11Y_E_TEXT_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAL_A11Y_TYPE_E_TEXT_FACTORY, GalA11yETextFactory))
-#define GAL_A11Y_E_TEXT_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAL_A11Y_TYPE_E_TEXT_FACTORY, GalA11yETextFactoryClass))
-#define GAL_A11Y_IS_E_TEXT_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAL_A11Y_TYPE_E_TEXT_FACTORY))
-#define GAL_A11Y_IS_E_TEXT_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAL_A11Y_TYPE_E_TEXT_FACTORY))
-
-typedef struct _GalA11yETextFactory GalA11yETextFactory;
-typedef struct _GalA11yETextFactoryClass GalA11yETextFactoryClass;
-
-struct _GalA11yETextFactory {
- AtkObjectFactory object;
-};
-
-struct _GalA11yETextFactoryClass {
- AtkObjectFactoryClass parent_class;
-};
-
-
-/* Standard Glib function */
-GType gal_a11y_e_text_factory_get_type (void);
-
-#endif /* ! __GAL_A11Y_E_TEXT_FACTORY_H__ */
diff --git a/a11y/e-text/gal-a11y-e-text.c b/a11y/e-text/gal-a11y-e-text.c
deleted file mode 100644
index be7835e17d..0000000000
--- a/a11y/e-text/gal-a11y-e-text.c
+++ /dev/null
@@ -1,1121 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Christopher James Lahey <clahey@ximian.com>
- *
- * Copyright (C) 2002 Ximian, Inc.
- */
-
-#include <config.h>
-#include "gal-a11y-e-text.h"
-#include "gal-a11y-util.h"
-#include <atk/atkobject.h>
-#include <atk/atktable.h>
-#include <atk/atkcomponent.h>
-#include <atk/atkobjectfactory.h>
-#include <atk/atkregistry.h>
-#include <atk/atkgobjectaccessible.h>
-#include "gal/e-text/e-text.h"
-#include "gal/e-text/e-text-model-repos.h"
-#include <gtk/gtkmain.h>
-
-#define CS_CLASS(a11y) (G_TYPE_INSTANCE_GET_CLASS ((a11y), C_TYPE_STREAM, GalA11yETextClass))
-static GObjectClass *parent_class;
-static AtkComponentIface *component_parent_iface;
-static GType parent_type;
-static gint priv_offset;
-static GQuark quark_accessible_object = 0;
-#define GET_PRIVATE(object) ((GalA11yETextPrivate *) (((char *) object) + priv_offset))
-#define PARENT_TYPE (parent_type)
-
-struct _GalA11yETextPrivate {
- int dummy;
-};
-
-static void
-et_dispose (GObject *object)
-{
- if (parent_class->dispose)
- parent_class->dispose (object);
-}
-
-/* Static functions */
-
-static void
-et_get_extents (AtkComponent *component,
- gint *x,
- gint *y,
- gint *width,
- gint *height,
- AtkCoordType coord_type)
-{
- EText *item = E_TEXT (atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (component)));
- double real_width;
- double real_height;
- int fake_width;
- int fake_height;
-
- if (component_parent_iface &&
- component_parent_iface->get_extents)
- component_parent_iface->get_extents (component,
- x,
- y,
- &fake_width,
- &fake_height,
- coord_type);
-
- gtk_object_get (GTK_OBJECT (item),
- "text_width", &real_width,
- "text_height", &real_height,
- NULL);
-
- if (width)
- *width = real_width;
- if (height)
- *height = real_height;
-}
-
-static const gchar *
-et_get_full_text (AtkText *text)
-{
- EText *etext = E_TEXT (atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (text)));
- ETextModel *model;
- const char *full_text;
-
- gtk_object_get (GTK_OBJECT (etext),
- "model", &model,
- NULL);
-
- full_text = e_text_model_get_text (model);
-
- return full_text;
-}
-
-static void
-et_set_full_text (AtkEditableText *text,
- const char *full_text)
-{
- EText *etext = E_TEXT (atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (text)));
- ETextModel *model;
-
- gtk_object_get (GTK_OBJECT (etext),
- "model", &model,
- NULL);
-
- e_text_model_set_text (model, full_text);
-}
-
-static gchar *
-et_get_text (AtkText *text,
- gint start_offset,
- gint end_offset)
-{
- gint start, end, real_start, real_end, len;
- const char *full_text = et_get_full_text (text);
- if (full_text == NULL)
- return;
- len = g_utf8_strlen (full_text, -1);
-
- start = MIN (MAX (0, start_offset), len);
- end = MIN (MAX (-1, end_offset), len);
-
- if (end_offset == -1)
- end = strlen (full_text);
- else
- end = g_utf8_offset_to_pointer (full_text, end) - full_text;
-
- start = g_utf8_offset_to_pointer (full_text, start) - full_text;
-
- real_start = MIN (start, end);
- real_end = MAX (start, end);
-
- return g_strndup (full_text + real_start, real_end - real_start);
-}
-
-static gboolean
-is_a_seperator (gunichar c)
-{
- return g_unichar_ispunct(c) || g_unichar_isspace(c);
-}
-
-static gint
-find_word_start (const char *text,
- gint begin_offset,
- gint step)
-{
- gint offset;
- char *at_offset;
- gunichar current, previous;
- gint len;
-
- offset = begin_offset;
- len = g_utf8_strlen (text, -1);
-
- while (offset > 0 && offset < len) {
- at_offset = g_utf8_offset_to_pointer (text, offset);
- current = g_utf8_get_char_validated (at_offset, -1);
- at_offset = g_utf8_offset_to_pointer (text, offset-1);
- previous = g_utf8_get_char_validated (at_offset, -1);
- if ((! is_a_seperator (current)) && is_a_seperator (previous))
- break;
- offset += step;
- }
-
- return offset;
-}
-
-static gint
-find_word_end (const char *text,
- gint begin_offset,
- gint step)
-{
- gint offset;
- char *at_offset;
- gunichar current, previous;
- gint len;
-
- offset = begin_offset;
- len = g_utf8_strlen (text, -1);
-
- while (offset > 0 && offset < len) {
- at_offset = g_utf8_offset_to_pointer (text, offset);
- current = g_utf8_get_char_validated (at_offset, -1);
- at_offset = g_utf8_offset_to_pointer (text, offset-1);
- previous = g_utf8_get_char_validated (at_offset, -1);
- if (is_a_seperator (current) && (! is_a_seperator (previous)))
- break;
- offset += step;
- }
-
- return offset;
-}
-
-static gint
-find_sentence_start (const char *text,
- gint begin_offset,
- gint step)
-{
- gint offset, last_word_end, len;
- char *at_offset;
- gunichar ch;
- int i;
-
- offset = find_word_start (text, begin_offset, step);
- len = g_utf8_strlen (text, -1);
-
- while (offset>0 && offset <len) {
- last_word_end = find_word_end (text, offset - 1, -1);
- if (last_word_end == 0)
- break;
- for (i = last_word_end; i < offset; i++) {
- at_offset = g_utf8_offset_to_pointer (text, i);
- ch = g_utf8_get_char_validated (at_offset, -1);
- if (ch == '.' || ch == '!' || ch == '?')
- return offset;
- }
-
- offset = find_word_start (text, offset + step, step);
- }
-
- return offset;
-}
-
-static gint
-find_sentence_end (const char *text,
- gint begin_offset,
- gint step)
-{
- gint offset;
- char *at_offset;
- gunichar previous;
- gint len;
-
- offset = begin_offset;
- len = g_utf8_strlen (text, -1);
-
- while (offset > 0 && offset < len) {
- at_offset = g_utf8_offset_to_pointer (text, offset - 1);
- previous = g_utf8_get_char_validated (at_offset, -1);
- if (previous == '.' || previous == '!' || previous == '?')
- break;
- offset += step;
- }
-
- return offset;
-}
-
-static gint
-find_line_start (const char *text,
- gint begin_offset,
- gint step)
-{
- gint offset;
- char *at_offset;
- gunichar previous;
- gint len;
-
- offset = begin_offset;
- len = g_utf8_strlen (text, -1);
-
- while (offset > 0 && offset < len) {
- at_offset = g_utf8_offset_to_pointer (text, offset - 1);
- previous = g_utf8_get_char_validated (at_offset, -1);
- if (previous == '\n' || previous == '\r')
- break;
- offset += step;
- }
-
- return offset;
-}
-
-static gint
-find_line_end (const char *text,
- gint begin_offset,
- gint step)
-{
- gint offset;
- char *at_offset;
- gunichar current;
- gint len;
-
- offset = begin_offset;
- len = g_utf8_strlen (text, -1);
-
- while (offset >= 0 && offset < len) {
- at_offset = g_utf8_offset_to_pointer (text, offset);
- current = g_utf8_get_char_validated (at_offset, -1);
- if (current == '\n' || current == '\r')
- break;
- offset += step;
- }
-
- return offset;
-}
-
-static gchar *
-et_get_text_after_offset (AtkText *text,
- gint offset,
- AtkTextBoundary boundary_type,
- gint *start_offset,
- gint *end_offset)
-{
- gint start, end, len;
- const char *full_text = et_get_full_text (text);
- g_return_val_if_fail (full_text, NULL);
-
- switch (boundary_type)
- {
- case ATK_TEXT_BOUNDARY_CHAR:
- start = offset + 1;
- end = offset + 2;
- break;
- case ATK_TEXT_BOUNDARY_WORD_START:
- start = find_word_start (full_text, offset + 1, 1);
- end = find_word_start (full_text, start + 1, 1);
- break;
- case ATK_TEXT_BOUNDARY_WORD_END:
- start = find_word_end (full_text, offset + 1, 1);
- end = find_word_end (full_text, start + 1, 1);
- break;
- case ATK_TEXT_BOUNDARY_SENTENCE_START:
- start = find_sentence_start (full_text, offset + 1, 1);
- end = find_sentence_start (full_text, start + 1, 1);
- break;
- case ATK_TEXT_BOUNDARY_SENTENCE_END:
- start = find_sentence_end (full_text, offset + 1, 1);
- end = find_sentence_end (full_text, start + 1, 1);
- break;
- case ATK_TEXT_BOUNDARY_LINE_START:
- start = find_line_start (full_text, offset + 1, 1);
- end = find_line_start (full_text, start + 1, 1);
- break;
- case ATK_TEXT_BOUNDARY_LINE_END:
- start = find_line_end (full_text, offset + 1, 1);
- end = find_line_end (full_text, start + 1, 1);
- break;
- defalut:
- return NULL;
- }
-
- len = g_utf8_strlen (full_text, -1);
- if (start_offset)
- *start_offset = MIN (MAX (0, start), len);
- if (end_offset)
- *end_offset = MIN (MAX (0, end), len);
- return et_get_text (text, start, end);
-}
-
-static gchar *
-et_get_text_at_offset (AtkText *text,
- gint offset,
- AtkTextBoundary boundary_type,
- gint *start_offset,
- gint *end_offset)
-{
- gint start, end, len;
- const char *full_text = et_get_full_text (text);
- g_return_val_if_fail (full_text, NULL);
-
- switch (boundary_type)
- {
- case ATK_TEXT_BOUNDARY_CHAR:
- start = offset;
- end = offset + 1;
- break;
- case ATK_TEXT_BOUNDARY_WORD_START:
- start = find_word_start (full_text, offset - 1, -1);
- end = find_word_start (full_text, offset, 1);
- break;
- case ATK_TEXT_BOUNDARY_WORD_END:
- start = find_word_end (full_text, offset, -1);
- end = find_word_end (full_text, offset + 1, 1);
- break;
- case ATK_TEXT_BOUNDARY_SENTENCE_START:
- start = find_sentence_start (full_text, offset - 1, -1);
- end = find_sentence_start (full_text, offset, 1);
- break;
- case ATK_TEXT_BOUNDARY_SENTENCE_END:
- start = find_sentence_end (full_text, offset, -1);
- end = find_sentence_end (full_text, offset + 1, 1);
- break;
- case ATK_TEXT_BOUNDARY_LINE_START:
- start = find_line_start (full_text, offset - 1, -1);
- end = find_line_start (full_text, offset, 1);
- break;
- case ATK_TEXT_BOUNDARY_LINE_END:
- start = find_line_end (full_text, offset, -1);
- end = find_line_end (full_text, offset + 1, 1);
- break;
- defalut:
- return NULL;
- }
-
- len = g_utf8_strlen (full_text, -1);
- if (start_offset)
- *start_offset = MIN (MAX (0, start), len);
- if (end_offset)
- *end_offset = MIN (MAX (0, end), len);
- return et_get_text (text, start, end);
-}
-
-static gunichar
-et_get_character_at_offset (AtkText *text,
- gint offset)
-{
- const char *full_text = et_get_full_text (text);
- char *at_offset;
-
- at_offset = g_utf8_offset_to_pointer (full_text, offset);
- return g_utf8_get_char_validated (at_offset, -1);
-}
-
-
-static gchar*
-et_get_text_before_offset (AtkText *text,
- gint offset,
- AtkTextBoundary boundary_type,
- gint *start_offset,
- gint *end_offset)
-{
- gint start, end, len;
- const char *full_text = et_get_full_text (text);
- g_return_val_if_fail (full_text, NULL);
-
- switch (boundary_type)
- {
- case ATK_TEXT_BOUNDARY_CHAR:
- start = offset - 1;
- end = offset;
- break;
- case ATK_TEXT_BOUNDARY_WORD_START:
- end = find_word_start (full_text, offset - 1, -1);
- start = find_word_start (full_text, end - 1, -1) ;
- break;
- case ATK_TEXT_BOUNDARY_WORD_END:
- end = find_word_end (full_text, offset, -1);
- start = find_word_end (full_text, end - 1, -1);
- break;
- case ATK_TEXT_BOUNDARY_SENTENCE_START:
- end = find_sentence_start (full_text, offset, -1);
- start = find_sentence_start (full_text, end - 1, -1);
- break;
- case ATK_TEXT_BOUNDARY_SENTENCE_END:
- end = find_sentence_end (full_text, offset, -1);
- start = find_sentence_end (full_text, end - 1, -1);
- break;
- case ATK_TEXT_BOUNDARY_LINE_START:
- end = find_line_start (full_text, offset, -1);
- start = find_line_start (full_text, end - 1, -1);
- break;
- case ATK_TEXT_BOUNDARY_LINE_END:
- end = find_line_end (full_text, offset, -1);
- start = find_line_end (full_text, end - 1, -1);
- break;
- default:
- return NULL;
- }
-
- len = g_utf8_strlen (full_text, -1);
- if (start_offset)
- *start_offset = MIN (MAX (0, start), len);
- if (end_offset)
- *end_offset = MIN (MAX (0, end), len);
- return et_get_text (text, start, end);
-}
-
-static gint
-et_get_caret_offset (AtkText *text)
-{
- GObject *obj;
- EText *etext;
- int offset;
-
- g_return_val_if_fail (ATK_IS_GOBJECT_ACCESSIBLE(text), -1);
- obj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (text));
- if (obj == NULL)
- return -1;
-
- g_return_val_if_fail (E_IS_TEXT (obj), -1);
- etext = E_TEXT (obj);
-
- gtk_object_get (GTK_OBJECT (etext),
- "cursor_pos", &offset,
- NULL);
- return offset;
-}
-
-
-static AtkAttributeSet*
-et_get_run_attributes (AtkText *text,
- gint offset,
- gint *start_offset,
- gint *end_offset)
-{
- /* Unimplemented */
- return NULL;
-}
-
-
-static AtkAttributeSet*
-et_get_default_attributes (AtkText *text)
-{
- /* Unimplemented */
- return NULL;
-}
-
-
-static void
-et_get_character_extents (AtkText *text,
- gint offset,
- gint *x,
- gint *y,
- gint *width,
- gint *height,
- AtkCoordType coords)
-{
- GObject *obj;
- EText *etext;
- GnomeCanvas *canvas;
- gint x_widget, y_widget, x_window, y_window;
- GdkWindow *window;
- GtkWidget *widget;
- int index;
- int trailing;
- PangoRectangle pango_pos;
-
- g_return_if_fail (ATK_IS_GOBJECT_ACCESSIBLE(text));
- obj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (text));
- if (obj == NULL)
- return;
- g_return_if_fail (E_IS_TEXT (obj));
- etext = E_TEXT(obj);
- canvas = GNOME_CANVAS_ITEM(etext)->canvas;
- widget = GTK_WIDGET(canvas);
- window = widget->window;
- gdk_window_get_origin (window, &x_widget, &y_widget);
-
- pango_layout_index_to_pos (etext->layout, offset, &pango_pos);
- pango_pos.x = PANGO_PIXELS (pango_pos.x);
- pango_pos.y = PANGO_PIXELS (pango_pos.y);
- pango_pos.width = (pango_pos.width + PANGO_SCALE / 2) / PANGO_SCALE;
- pango_pos.height = (pango_pos.height + PANGO_SCALE / 2) / PANGO_SCALE;
-
- *x = pango_pos.x + x_widget;
- *y = pango_pos.y + y_widget;
-
- *width = pango_pos.width;
- *height = pango_pos.height;
-
- if (etext->draw_borders) {
- *x += 3; /*BORDER_INDENT;*/
- *y += 3; /*BORDER_INDENT;*/
- }
-
- *x += etext->xofs;
- *y += etext->yofs;
-
- if (etext->editing) {
- *x -= etext->xofs_edit;
- *y -= etext->yofs_edit;
- }
-
- *x += etext->cx;
- *y += etext->cy;
-
- if (coords == ATK_XY_WINDOW) {
- window = gdk_window_get_toplevel (window);
- gdk_window_get_origin (window, &x_window, &y_window);
- *x -= x_window;
- *y -= y_window;
- }
- else if (coords == ATK_XY_SCREEN) {
- }
- else {
- *x = 0;
- *y = 0;
- *height = 0;
- *width = 0;
- }
-}
-
-
-static gint
-et_get_character_count (AtkText *text)
-{
- const char *full_text = et_get_full_text (text);
-
- return g_utf8_strlen (full_text, -1);
-}
-
-
-static gint
-et_get_offset_at_point (AtkText *text,
- gint x,
- gint y,
- AtkCoordType coords)
-{
- GObject *obj;
- EText *etext;
- GnomeCanvas *canvas;
- gint x_widget, y_widget, x_window, y_window;
- GdkWindow *window;
- GtkWidget *widget;
- int index;
- int trailing;
-
- g_return_val_if_fail (ATK_IS_GOBJECT_ACCESSIBLE(text), -1);
- obj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (text));
- if (obj == NULL)
- return -1;
- g_return_val_if_fail (E_IS_TEXT (obj), -1);
- etext = E_TEXT(obj);
- canvas = GNOME_CANVAS_ITEM(etext)->canvas;
- widget = GTK_WIDGET(canvas);
- window = widget->window;
- gdk_window_get_origin (window, &x_widget, &y_widget);
-
- if (coords == ATK_XY_SCREEN) {
- x = x - x_widget;
- y = y - y_widget;
- }
- else if (coords == ATK_XY_WINDOW) {
- window = gdk_window_get_toplevel (window);
- gdk_window_get_origin (window, &x_window, &y_window);
- x = x - x_widget + x_window;
- y = y - y_widget + y_window;
- }
- else
- return -1;
-
- if (etext->draw_borders) {
- x -= 3; /*BORDER_INDENT;*/
- y -= 3; /*BORDER_INDENT;*/
- }
-
- x -= etext->xofs;
- y -= etext->yofs;
-
- if (etext->editing) {
- x += etext->xofs_edit;
- y += etext->yofs_edit;
- }
-
- x -= etext->cx;
- y -= etext->cy;
-
- pango_layout_xy_to_index (etext->layout,
- x * PANGO_SCALE - PANGO_SCALE / 2,
- y * PANGO_SCALE - PANGO_SCALE / 2,
- &index,
- &trailing);
-
- return g_utf8_pointer_to_offset (etext->text, etext->text + index + trailing);
-}
-
-
-static gint
-et_get_n_selections (AtkText *text)
-{
- EText *etext = E_TEXT (atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (text)));
- if (etext->selection_start !=
- etext->selection_end)
- return 1;
- return 0;
-}
-
-
-static gchar*
-et_get_selection (AtkText *text,
- gint selection_num,
- gint *start_offset,
- gint *end_offset)
-{
- gint start, end, real_start, real_end, len;
- EText *etext;
- if (selection_num == 0) {
- const char *full_text = et_get_full_text (text);
- if (full_text == NULL)
- return NULL;
- len = g_utf8_strlen (full_text, -1);
- etext = E_TEXT (atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (text)));
- start = MIN (etext->selection_start, etext->selection_end);
- end = MAX (etext->selection_start, etext->selection_end);
- start = MIN (MAX (0, start), len);
- end = MIN (MAX (0, end), len);
- if (start != end) {
- if (start_offset)
- *start_offset = start;
- if (end_offset)
- *end_offset = end;
- real_start = g_utf8_offset_to_pointer (full_text, start) - full_text;
- real_end = g_utf8_offset_to_pointer (full_text, end) - full_text;
- return g_strndup (full_text + real_start, real_end - real_start);
- }
- }
-
- return NULL;
-}
-
-
-static gboolean
-et_add_selection (AtkText *text,
- gint start_offset,
- gint end_offset)
-{
- GObject *obj;
- EText *etext;
-
- g_return_val_if_fail (ATK_IS_GOBJECT_ACCESSIBLE (text), FALSE);
- obj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (text));
- if (obj == NULL)
- return FALSE;
- g_return_val_if_fail (E_IS_TEXT (obj), FALSE);
- etext = E_TEXT (obj);
-
- g_return_val_if_fail (start_offset >= 0, FALSE);
- g_return_val_if_fail (start_offset >= -1, FALSE);
- if (end_offset == -1)
- end_offset = et_get_character_count (text);
-
- if (start_offset != end_offset) {
- gint real_start, real_end;
- real_start = MIN (start_offset, end_offset);
- real_end = MAX (start_offset, end_offset);
- etext->selection_start = real_start;
- etext->selection_end = real_end;
-
- gnome_canvas_item_grab_focus (GNOME_CANVAS_ITEM (etext));
- gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (etext));
-
- g_signal_emit_by_name (ATK_OBJECT (text), "text_selection_changed");
-
- return TRUE;
- }
-
- return FALSE;
-}
-
-
-static gboolean
-et_remove_selection (AtkText *text,
- gint selection_num)
-{
- GObject *obj;
- EText *etext;
-
- g_return_val_if_fail (ATK_IS_GOBJECT_ACCESSIBLE (text), FALSE);
- obj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (text));
- if (obj == NULL)
- return FALSE;
- g_return_val_if_fail (E_IS_TEXT (obj), FALSE);
- etext = E_TEXT (obj);
-
- if (selection_num == 0
- && etext->selection_start != etext->selection_end) {
- etext->selection_end = etext->selection_start;
- g_signal_emit_by_name (ATK_OBJECT(text), "text_selection_changed");
- return TRUE;
- }
-
- return FALSE;
-}
-
-
-static gboolean
-et_set_selection (AtkText *text,
- gint selection_num,
- gint start_offset,
- gint end_offset)
-{
- GObject *obj;
- EText *etext;
- int offset;
-
- g_return_val_if_fail (ATK_IS_GOBJECT_ACCESSIBLE (text), FALSE);
- obj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (text));
- if (obj == NULL)
- return FALSE;
- g_return_val_if_fail (E_IS_TEXT (obj), FALSE);
- etext = E_TEXT (obj);
- if (selection_num == 0)
- return et_add_selection (text, start_offset, end_offset);
- return FALSE;
-}
-
-
-static gboolean
-et_set_caret_offset (AtkText *text,
- gint offset)
-{
- GObject *obj;
- EText *etext;
-
- g_return_val_if_fail (ATK_IS_GOBJECT_ACCESSIBLE (text), FALSE);
- obj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (text));
- if (obj == NULL)
- return FALSE;
-
- g_return_val_if_fail (E_IS_TEXT (obj), FALSE);
- etext = E_TEXT (obj);
-
- if (offset < -1)
- return FALSE;
- else {
- ETextEventProcessorCommand command;
-
- if (offset == -1)
- offset = et_get_character_count (text);
-
- command.action = E_TEP_MOVE;
- command.position = E_TEP_VALUE;
- command.value = offset;
- command.time = GDK_CURRENT_TIME;
- g_signal_emit_by_name (etext->tep, "command", &command);
- return TRUE;
- }
-}
-
-static gboolean
-et_set_run_attributes (AtkEditableText *text,
- AtkAttributeSet *attrib_set,
- gint start_offset,
- gint end_offset)
-{
- /* Unimplemented */
- return FALSE;
-}
-
-static void
-et_set_text_contents (AtkEditableText *text,
- const gchar *string)
-{
- et_set_full_text (text, string);
-}
-
-static void
-et_insert_text (AtkEditableText *text,
- const gchar *string,
- gint length,
- gint *position)
-{
- /* Utf8 unimplemented */
- char *result;
-
- const char *full_text = et_get_full_text (ATK_TEXT (text));
- if (full_text == NULL)
- return;
-
- result = g_strdup_printf ("%.*s%.*s%s", *position, full_text, length, string, full_text + *position);
-
- et_set_full_text (text, result);
-
- *position += length;
-
- g_free (result);
-}
-
-static void
-et_copy_text (AtkEditableText *text,
- gint start_pos,
- gint end_pos)
-{
- GObject *obj;
- EText *etext;
-
- g_return_if_fail (ATK_IS_GOBJECT_ACCESSIBLE (text));
- obj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (text));
- if (obj == NULL)
- return;
-
- g_return_if_fail (E_IS_TEXT (obj));
- etext = E_TEXT (obj);
-
- if (start_pos != end_pos) {
- etext->selection_start = start_pos;
- etext->selection_end = end_pos;
- e_text_copy_clipboard (etext);
- }
-}
-
-static void
-et_delete_text (AtkEditableText *text,
- gint start_pos,
- gint end_pos)
-{
- GObject *obj;
- EText *etext;
-
- g_return_if_fail (ATK_IS_GOBJECT_ACCESSIBLE(text));
- obj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (text));
- if (obj == NULL)
- return;
-
- g_return_if_fail (E_IS_TEXT (obj));
- etext = E_TEXT (obj);
-
- etext->selection_start = start_pos;
- etext->selection_end = end_pos;
-
- e_text_delete_selection (etext);
-}
-
-static void
-et_cut_text (AtkEditableText *text,
- gint start_pos,
- gint end_pos)
-{
- et_copy_text (text, start_pos, end_pos);
- et_delete_text (text, start_pos, end_pos);
-}
-
-static void
-et_paste_text (AtkEditableText *text,
- gint position)
-{
- GObject *obj;
- EText *etext;
-
- g_return_if_fail (ATK_IS_GOBJECT_ACCESSIBLE (text));
- obj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (text));
- if (obj == NULL)
- return;
-
- g_return_if_fail (E_IS_TEXT (obj));
- etext = E_TEXT (obj);
-
- gtk_object_set (GTK_OBJECT (etext),
- "cursor_pos", position,
- NULL);
- e_text_paste_clipboard (etext);
-}
-
-static void
-et_atk_component_iface_init (AtkComponentIface *iface)
-{
- iface->get_extents = et_get_extents;
-}
-
-static void
-et_atk_text_iface_init (AtkTextIface *iface)
-{
- iface->get_text = et_get_text;
- iface->get_text_after_offset = et_get_text_after_offset;
- iface->get_text_at_offset = et_get_text_at_offset;
- iface->get_character_at_offset = et_get_character_at_offset;
- iface->get_text_before_offset = et_get_text_before_offset;
- iface->get_caret_offset = et_get_caret_offset;
- iface->get_run_attributes = et_get_run_attributes;
- iface->get_default_attributes = et_get_default_attributes;
- iface->get_character_extents = et_get_character_extents;
- iface->get_character_count = et_get_character_count;
- iface->get_offset_at_point = et_get_offset_at_point;
- iface->get_n_selections = et_get_n_selections;
- iface->get_selection = et_get_selection;
- iface->add_selection = et_add_selection;
- iface->remove_selection = et_remove_selection;
- iface->set_selection = et_set_selection;
- iface->set_caret_offset = et_set_caret_offset;
-}
-
-static void
-et_atk_editable_text_iface_init (AtkEditableTextIface *iface)
-{
- iface->set_run_attributes = et_set_run_attributes;
- iface->set_text_contents = et_set_text_contents;
- iface->insert_text = et_insert_text;
- iface->copy_text = et_copy_text;
- iface->cut_text = et_cut_text;
- iface->delete_text = et_delete_text;
- iface->paste_text = et_paste_text;
-}
-
-static void
-_et_reposition_cb (ETextModel *model,
- ETextModelReposFn fn,
- gpointer repos_data,
- gpointer user_data)
-{
- AtkObject *accessible;
- AtkText *text;
-
- accessible = ATK_OBJECT (user_data);
- text = ATK_TEXT (accessible);
-
- if (fn == e_repos_delete_shift) {
- EReposDeleteShift *info = (EReposDeleteShift *) repos_data;
- g_signal_emit_by_name (text, "text-changed::delete", info->pos, info->len);
- }
- else if (fn == e_repos_insert_shift) {
- EReposInsertShift *info = (EReposInsertShift *) repos_data;
- g_signal_emit_by_name (text, "text-changed::insert", info->pos, info->len);
- }
-}
-
-static void
-_et_command_cb (ETextEventProcessor *tep,
- ETextEventProcessorCommand *command,
- gpointer user_data)
-{
- AtkObject *accessible;
- AtkText *text;
-
- accessible = ATK_OBJECT (user_data);
- text = ATK_TEXT (accessible);
-
- switch (command->action) {
- case E_TEP_MOVE:
- g_signal_emit_by_name (text, "text-caret-moved", et_get_caret_offset (text));
- break;
- case E_TEP_SELECT:
- g_signal_emit_by_name (text, "text-selection-changed");
- break;
- }
-}
-
-static void
-et_real_initialize (AtkObject *obj,
- gpointer data)
-{
- GalA11yEText *a11y;
- EText *etext;
-
- ATK_OBJECT_CLASS (parent_class)->initialize (obj, data);
-
- g_return_if_fail (GAL_A11Y_IS_E_TEXT (obj));
- g_return_if_fail (E_IS_TEXT (data));
-
- a11y = GAL_A11Y_E_TEXT (obj);
- etext = E_TEXT (data);
-
- /* Set up signal callbacks */
- g_signal_connect (etext->model, "reposition",
- G_CALLBACK (_et_reposition_cb), obj);
-
- g_signal_connect_after (etext->tep, "command",
- (GCallback) _et_command_cb, obj);
-
- obj->role = ATK_ROLE_TEXT;
-}
-
-static void
-et_class_init (GalA11yETextClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- AtkObjectClass *atk_class = ATK_OBJECT_CLASS (klass);
-
- quark_accessible_object = g_quark_from_static_string ("gtk-accessible-object");
- parent_class = g_type_class_ref (PARENT_TYPE);
- component_parent_iface = g_type_interface_peek(parent_class, ATK_TYPE_COMPONENT);
- object_class->dispose = et_dispose;
- atk_class->initialize = et_real_initialize;
-}
-
-static void
-et_init (GalA11yEText *a11y)
-{
-#if 0
- GalA11yETextPrivate *priv;
-
- priv = GET_PRIVATE (a11y);
-#endif
-}
-
-/**
- * gal_a11y_e_text_get_type:
- * @void:
- *
- * Registers the &GalA11yEText class if necessary, and returns the type ID
- * associated to it.
- *
- * Return value: The type ID of the &GalA11yEText class.
- **/
-GType
-gal_a11y_e_text_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- AtkObjectFactory *factory;
-
- GTypeInfo info = {
- sizeof (GalA11yETextClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) et_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (GalA11yEText),
- 0,
- (GInstanceInitFunc) et_init,
- NULL /* value_text */
- };
-
- static const GInterfaceInfo atk_component_info = {
- (GInterfaceInitFunc) et_atk_component_iface_init,
- (GInterfaceFinalizeFunc) NULL,
- NULL
- };
- static const GInterfaceInfo atk_text_info = {
- (GInterfaceInitFunc) et_atk_text_iface_init,
- (GInterfaceFinalizeFunc) NULL,
- NULL
- };
- static const GInterfaceInfo atk_editable_text_info = {
- (GInterfaceInitFunc) et_atk_editable_text_iface_init,
- (GInterfaceFinalizeFunc) NULL,
- NULL
- };
-
- factory = atk_registry_get_factory (atk_get_default_registry (), GNOME_TYPE_CANVAS_ITEM);
- parent_type = atk_object_factory_get_accessible_type (factory);
-
- type = gal_a11y_type_register_static_with_private (PARENT_TYPE, "GalA11yEText", &info, 0,
- sizeof (GalA11yETextPrivate), &priv_offset);
-
- g_type_add_interface_static (type, ATK_TYPE_COMPONENT, &atk_component_info);
- g_type_add_interface_static (type, ATK_TYPE_TEXT, &atk_text_info);
- g_type_add_interface_static (type, ATK_TYPE_EDITABLE_TEXT, &atk_editable_text_info);
- }
-
- return type;
-}
diff --git a/a11y/e-text/gal-a11y-e-text.h b/a11y/e-text/gal-a11y-e-text.h
deleted file mode 100644
index 66d2d6283b..0000000000
--- a/a11y/e-text/gal-a11y-e-text.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Christopher James Lahey <clahey@ximian.com>
- *
- * Copyright (C) 2001 Chris Lahey
- */
-
-#ifndef __GAL_A11Y_E_TEXT_H__
-#define __GAL_A11Y_E_TEXT_H__
-
-#include <glib-object.h>
-#include <gal/e-table/e-table-item.h>
-
-#define GAL_A11Y_TYPE_E_TEXT (gal_a11y_e_text_get_type ())
-#define GAL_A11Y_E_TEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAL_A11Y_TYPE_E_TEXT, GalA11yEText))
-#define GAL_A11Y_E_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAL_A11Y_TYPE_E_TEXT, GalA11yETextClass))
-#define GAL_A11Y_IS_E_TEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAL_A11Y_TYPE_E_TEXT))
-#define GAL_A11Y_IS_E_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAL_A11Y_TYPE_E_TEXT))
-
-typedef struct _GalA11yEText GalA11yEText;
-typedef struct _GalA11yETextClass GalA11yETextClass;
-typedef struct _GalA11yETextPrivate GalA11yETextPrivate;
-
-/* This struct should actually be larger as this isn't what we derive from.
- * The GalA11yETextPrivate comes right after the parent class structure.
- **/
-struct _GalA11yEText {
- AtkObject object;
-};
-
-struct _GalA11yETextClass {
- AtkObject parent_class;
-};
-
-
-/* Standard Glib function */
-GType gal_a11y_e_text_get_type (void);
-
-#endif /* ! __GAL_A11Y_E_TEXT_H__ */
diff --git a/a11y/ea-cell-table.c b/a11y/ea-cell-table.c
deleted file mode 100644
index 80f5ecbaaa..0000000000
--- a/a11y/ea-cell-table.c
+++ /dev/null
@@ -1,207 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* vim:expandtab:shiftwidth=8:tabstop=8:
- */
-/* Evolution Accessibility: ea-cell-table.c
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Bolian Yin <bolian.yin@sun.com> Sun Microsystem Inc., 2003
- *
- */
-
-#include "ea-cell-table.h"
-
-EaCellTable *
-ea_cell_table_create (gint rows, gint columns, gboolean column_first)
-{
- EaCellTable * cell_data;
- gint index;
-
- g_return_val_if_fail (((columns > 0) && (rows > 0)), NULL);
-
- cell_data = g_new0 (EaCellTable, 1);
-
- cell_data->column_first = column_first;
- cell_data->columns = columns;
- cell_data->rows = rows;
-
- cell_data->column_labels = g_new0 (gchar*, columns);
- for (index = columns -1; index >= 0; --index)
- cell_data->column_labels [index] = NULL;
-
- cell_data->row_labels = g_new0 (gchar*, rows);
- for (index = rows -1; index >= 0; --index)
- cell_data->row_labels [index] = NULL;
-
- cell_data->cells = g_new0(gpointer, (columns * rows));
- for (index = (columns * rows) -1; index >= 0; --index)
- cell_data->cells [index] = NULL;
- return cell_data;
-}
-
-void
-ea_cell_table_destroy (EaCellTable * cell_data)
-{
- gint index;
- g_return_if_fail (cell_data);
-
- g_print ("destroy cell table (%d, %d)\n", cell_data->rows,
- cell_data->columns);
- for (index = 0; index < cell_data->columns; ++index)
- if (cell_data->column_labels [index])
- g_free (cell_data->column_labels [index]);
- g_free (cell_data->column_labels);
-
- for (index = 0; index < cell_data->rows; ++index)
- if (cell_data->row_labels [index])
- g_free (cell_data->row_labels [index]);
- g_free (cell_data->row_labels);
-
- for (index = (cell_data->columns * cell_data->rows) -1;
- index >= 0; --index)
- if (cell_data->cells[index] &&
- G_IS_OBJECT (cell_data->cells[index]))
- g_object_unref (cell_data->cells[index]);
-
- g_free (cell_data->cells);
-}
-
-gpointer
-ea_cell_table_get_cell (EaCellTable * cell_data,
- gint row, gint column)
-{
- gint index;
-
- g_return_val_if_fail (cell_data, NULL);
-
- index = ea_cell_table_get_index (cell_data, column, row);
- if (index == -1)
- return NULL;
-
- return cell_data->cells[index];
-}
-
-gboolean
-ea_cell_table_set_cell (EaCellTable * cell_data,
- gint row, gint column, gpointer cell)
-{
- gint index;
-
- g_return_val_if_fail (cell_data, FALSE);
-
- index = ea_cell_table_get_index (cell_data, column, row);
- if (index == -1)
- return FALSE;
-
- if (cell && G_IS_OBJECT(cell))
- g_object_ref (cell);
- if (cell_data->cells[index] &&
- G_IS_OBJECT (cell_data->cells[index]))
- g_object_unref (cell_data->cells[index]);
- cell_data->cells[index] = cell;
-
- return TRUE;
-}
-
-gpointer
-ea_cell_table_get_cell_at_index (EaCellTable * cell_data,
- gint index)
-{
- g_return_val_if_fail (cell_data, NULL);
-
- if (index >=0 && index < (cell_data->columns * cell_data->rows))
- return cell_data->cells [index];
- return NULL;
-}
-
-gboolean
-ea_cell_table_set_cell_at_index (EaCellTable * cell_data,
- gint index, gpointer cell)
-{
- g_return_val_if_fail (cell_data, FALSE);
-
- if (index < 0 || index >=cell_data->columns * cell_data->rows)
- return FALSE;
-
- if (cell && G_IS_OBJECT(cell))
- g_object_ref (cell);
- if (cell_data->cells[index] &&
- G_IS_OBJECT (cell_data->cells[index]))
- g_object_unref (cell_data->cells[index]);
- cell_data->cells[index] = cell;
-
- return TRUE;
-}
-
-G_CONST_RETURN gchar*
-ea_cell_table_get_column_label (EaCellTable * cell_data,
- gint column)
-{
- g_return_val_if_fail (cell_data, NULL);
- g_return_val_if_fail ((column >= 0 && column < cell_data->columns), NULL);
-
- return cell_data->column_labels[column];
-}
-
-void
-ea_cell_table_set_column_label (EaCellTable * cell_data,
- gint column, const gchar *label)
-{
- g_return_if_fail (cell_data);
- g_return_if_fail ((column >= 0 && column < cell_data->columns));
-
- if (cell_data->column_labels[column])
- g_free (cell_data->column_labels[column]);
- cell_data->column_labels[column] = g_strdup(label);
-}
-
-G_CONST_RETURN gchar*
-ea_cell_table_get_row_label (EaCellTable * cell_data,
- gint row)
-{
- g_return_val_if_fail (cell_data, NULL);
- g_return_val_if_fail ((row >= 0 && row < cell_data->rows), NULL);
-
- return cell_data->row_labels[row];
-}
-
-void
-ea_cell_table_set_row_label (EaCellTable * cell_data,
- gint row, const gchar *label)
-{
- g_return_if_fail (cell_data);
- g_return_if_fail ((row >= 0 && row < cell_data->rows));
-
- if (cell_data->row_labels[row])
- g_free (cell_data->row_labels[row]);
- cell_data->row_labels[row] = g_strdup(label);
-}
-
-gint
-ea_cell_table_get_index (EaCellTable *cell_data,
- gint row, gint column)
-{
- g_return_val_if_fail (cell_data, -1);
- if (row < 0 || row >= cell_data->rows ||
- column < 0 || column >= cell_data->columns)
- return -1;
-
- if (cell_data->column_first)
- return column * cell_data->rows + row;
- else
- return row * cell_data->columns + column;
-}
diff --git a/a11y/ea-cell-table.h b/a11y/ea-cell-table.h
deleted file mode 100644
index 932fe8b4fd..0000000000
--- a/a11y/ea-cell-table.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* vim:expandtab:shiftwidth=8:tabstop=8:
- */
-/* Evolution Accessibility: ea-table-cell.c
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Bolian Yin <bolian.yin@sun.com> Sun Microsystem Inc., 2003
- *
- */
-
-/* EaCellTable */
-
-#include <glib.h>
-#include <glib-object.h>
-
-struct _EaCellTable {
- gint columns;
- gint rows;
- gboolean column_first; /* index order */
- gchar **column_labels;
- gchar **row_labels;
- gpointer *cells;
-};
-
-typedef struct _EaCellTable EaCellTable;
-
-EaCellTable * ea_cell_table_create (gint rows, gint columns,
- gboolean column_first);
-void ea_cell_table_destroy (EaCellTable * cell_data);
-gpointer ea_cell_table_get_cell (EaCellTable * cell_data,
- gint row, gint column);
-gboolean ea_cell_table_set_cell (EaCellTable * cell_data,
- gint row, gint column, gpointer cell);
-gpointer ea_cell_table_get_cell_at_index (EaCellTable * cell_data,
- gint index);
-gboolean ea_cell_table_set_cell_at_index (EaCellTable * cell_data,
- gint index, gpointer cell);
-
-G_CONST_RETURN gchar*
-ea_cell_table_get_column_label (EaCellTable * cell_data, gint column);
-void ea_cell_table_set_column_label (EaCellTable * cell_data,
- gint column, const gchar *label);
-G_CONST_RETURN gchar*
-ea_cell_table_get_row_label (EaCellTable * cell_data, gint row);
-void ea_cell_table_set_row_label (EaCellTable * cell_data,
- gint row, const gchar *label);
-gint ea_cell_table_get_index (EaCellTable *cell_data,
- gint row, gint column);
diff --git a/a11y/ea-factory.h b/a11y/ea-factory.h
deleted file mode 100644
index 06ae612d6f..0000000000
--- a/a11y/ea-factory.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* vim:expandtab:shiftwidth=8:tabstop=8:
- */
-/* Evolution Accessibility: ea-factory.h
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Bolian Yin <bolian.yin@sun.com> Sun Microsystem Inc., 2003
- *
- */
-
-/* Evolution Accessibility
-*/
-
-#ifndef _EA_FACTORY_H__
-#define _EA_FACTORY_H__
-
-#include <glib-object.h>
-#include <atk/atkobject.h>
-
-#define EA_FACTORY_PARTA_GOBJECT(type, type_as_function, opt_create_accessible) \
-static AtkObject* \
-type_as_function ## _factory_create_accessible (GObject *obj) \
-{ \
- AtkObject *accessible; \
- g_return_val_if_fail (G_IS_OBJECT (obj), NULL); \
- accessible = opt_create_accessible (G_OBJECT (obj)); \
- return accessible; \
-}
-
-#define EA_FACTORY_PARTA(type, type_as_function, opt_create_accessible) \
-static AtkObject* \
-type_as_function ## _factory_create_accessible (GObject *obj) \
-{ \
- GtkWidget *widget; \
- AtkObject *accessible; \
- \
- g_return_val_if_fail (GTK_IS_WIDGET (obj), NULL); \
- \
- widget = GTK_WIDGET (obj); \
- \
- accessible = opt_create_accessible (widget); \
- return accessible; \
-}
-
-#define EA_FACTORY_PARTB(type, type_as_function, opt_create_accessible) \
- \
-static GType \
-type_as_function ## _factory_get_accessible_type (void) \
-{ \
- return type; \
-} \
- \
- \
-static void \
-type_as_function ## _factory_class_init (AtkObjectFactoryClass *klass) \
-{ \
- klass->create_accessible = type_as_function ## _factory_create_accessible; \
- klass->get_accessible_type = type_as_function ## _factory_get_accessible_type;\
-} \
- \
-static GType \
-type_as_function ## _factory_get_type (void) \
-{ \
- static GType t = 0; \
- \
- if (!t) \
- { \
- char *name; \
- static const GTypeInfo tinfo = \
- { \
- sizeof (AtkObjectFactoryClass), \
- NULL, NULL, (GClassInitFunc) type_as_function ## _factory_class_init, \
- NULL, NULL, sizeof (AtkObjectFactory), 0, NULL, NULL \
- }; \
- \
- name = g_strconcat (g_type_name (type), "Factory", NULL); \
- t = g_type_register_static ( \
- ATK_TYPE_OBJECT_FACTORY, name, &tinfo, 0); \
- g_free (name); \
- } \
- \
- return t; \
-}
-
-#define EA_FACTORY(type, type_as_function, opt_create_accessible) \
- EA_FACTORY_PARTA(type, type_as_function, opt_create_accessible) \
- EA_FACTORY_PARTB(type, type_as_function, opt_create_accessible)
-
-#define EA_FACTORY_GOBJECT(type, type_as_function, opt_create_accessible) \
- EA_FACTORY_PARTA_GOBJECT(type, type_as_function, opt_create_accessible) \
- EA_FACTORY_PARTB(type, type_as_function, opt_create_accessible)
-
-#define EA_SET_FACTORY(obj_type, type_as_function) \
- atk_registry_set_factory_type (atk_get_default_registry (), \
- obj_type, \
- type_as_function ## _factory_get_type ())
-
-#endif /* _EA_FACTORY_H__ */
diff --git a/a11y/gal-a11y-factory.h b/a11y/gal-a11y-factory.h
deleted file mode 100644
index 22da85eca8..0000000000
--- a/a11y/gal-a11y-factory.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* GAL A11Y
- * gal-a11y-factory.h
- *
- * Copyright 2003 Ximian Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors:
- * Gilbert Fang <gilbert.fang@sun.com>, Sun Microsystem Inc. 2003.
- *
- * This file is mainly from the gailfactory.h of GAIL.
- */
-
-#ifndef _GAL_A11Y_FACTORY_H__
-#define _GAL_A11Y_FACTORY_H__
-
-#include <glib-object.h>
-#include <atk/atkobject.h>
-#include <atk/atkobjectfactory.h>
-
-#define GAL_A11Y_FACTORY(type, type_as_function, opt_create_accessible) \
- \
-static GType \
-type_as_function ## _factory_get_accessible_type (void) \
-{ \
- return type; \
-} \
- \
-static AtkObject* \
-type_as_function ## _factory_create_accessible (GObject *obj) \
-{ \
- GtkWidget *widget; \
- AtkObject *accessible; \
- \
- g_return_val_if_fail (GTK_IS_WIDGET (obj), NULL); \
- \
- widget = GTK_WIDGET (obj); \
- \
- accessible = opt_create_accessible (widget); \
- \
- return accessible; \
-} \
- \
-static void \
-type_as_function ## _factory_class_init (AtkObjectFactoryClass *klass) \
-{ \
- klass->create_accessible = type_as_function ## _factory_create_accessible; \
- klass->get_accessible_type = type_as_function ## _factory_get_accessible_type;\
-} \
- \
-static GType \
-type_as_function ## _factory_get_type (void) \
-{ \
- static GType t = 0; \
- \
- if (!t) \
- { \
- char *name; \
- static const GTypeInfo tinfo = \
- { \
- sizeof (AtkObjectFactoryClass), \
- NULL, NULL, (GClassInitFunc) type_as_function ## _factory_class_init, \
- NULL, NULL, sizeof (AtkObjectFactory), 0, NULL, NULL \
- }; \
- \
- name = g_strconcat (g_type_name (type), "Factory", NULL); \
- t = g_type_register_static ( \
- ATK_TYPE_OBJECT_FACTORY, name, &tinfo, 0); \
- g_free (name); \
- } \
- \
- return t; \
-}
-
-#define GAL_A11Y_WIDGET_SET_FACTORY(widget_type, type_as_function) \
- atk_registry_set_factory_type (atk_get_default_registry (), \
- widget_type, \
- type_as_function ## _factory_get_type ())
-
-#endif /* _GAL_A11Y_FACTORY_H__ */
diff --git a/a11y/gal-a11y-util.c b/a11y/gal-a11y-util.c
deleted file mode 100644
index 0cf7c69dbb..0000000000
--- a/a11y/gal-a11y-util.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Christopher James Lahey <clahey@ximian.com>
- *
- * Copyright (C) 2002 Ximian, Inc.
- */
-
-#include <config.h>
-#include "gal-a11y-util.h"
-
-GType
-gal_a11y_type_register_static_with_private (GType parent_type,
- const gchar *type_name,
- GTypeInfo *info,
- GTypeFlags flags,
- gint priv_size,
- gint *priv_offset)
-{
- GTypeQuery query;
-
- g_type_query (parent_type, &query);
-
- info->class_size = query.class_size;
- info->instance_size = query.instance_size + priv_size;
-
- if (priv_offset)
- *priv_offset = query.instance_size;
-
- return g_type_register_static (parent_type, type_name, info, flags);
-}
diff --git a/a11y/gal-a11y-util.h b/a11y/gal-a11y-util.h
deleted file mode 100644
index b7f742b122..0000000000
--- a/a11y/gal-a11y-util.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Christopher James Lahey <clahey@ximian.com>
- *
- * Copyright (C) 2001 Chris Lahey
- */
-
-#ifndef __GAL_A11Y_UTIL_H__
-#define __GAL_A11Y_UTIL_H__
-
-#include <glib-object.h>
-
-GType gal_a11y_type_register_static_with_private (GType parent_type,
- const gchar *type_name,
- GTypeInfo *info,
- GTypeFlags flags,
- int priv_size,
- gint *priv_offset);
-
-#endif /* ! __GAL_A11Y_UTIL_H__ */
diff --git a/a11y/widgets/.cvsignore b/a11y/widgets/.cvsignore
deleted file mode 100644
index 282522db03..0000000000
--- a/a11y/widgets/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/a11y/widgets/Makefile.am b/a11y/widgets/Makefile.am
deleted file mode 100644
index 2480c3bba7..0000000000
--- a/a11y/widgets/Makefile.am
+++ /dev/null
@@ -1,31 +0,0 @@
-
-# for debug
-#A11Y_CFLAGS += -pedantic -ansi -DACC_DEBUG -Werror
-
-privlib_LTLIBRARIES = libevolution-widgets-a11y.la
-
-INCLUDES = \
- -DG_LOG_DOMAIN=\"evolution-a11y\" \
- -I$(top_srcdir)/widgets \
- -I$(top_srcdir)/a11y \
- -DEVOLUTION_DATADIR=\""$(datadir)"\" \
- -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \
- -DEVOLUTION_ETSPECDIR=\""$(etspecdir)"\" \
- -DEVOLUTION_IMAGESDIR=\""$(imagesdir)"\" \
- -DEVOLUTION_GALVIEWSDIR=\""$(viewsdir)"\" \
- -DEVOLUTION_UIDIR=\""$(evolutionuidir)"\" \
- -DPREFIX=\""$(prefix)"\" \
- $(A11Y_CFLAGS) \
- $(EVOLUTION_CALENDAR_CFLAGS)
-
-libevolution_widgets_a11y_la_SOURCES = \
- ea-calendar-item.c \
- ea-calendar-item.h \
- ea-calendar-cell.c \
- ea-calendar-cell.h \
- ea-widgets.c \
- ea-widgets.h
-
-libevolution_widgets_a11y_la_LIBADD = \
- $(top_builddir)/a11y/libevolution-a11y.la
-
diff --git a/a11y/widgets/ea-calendar-cell.c b/a11y/widgets/ea-calendar-cell.c
deleted file mode 100644
index 4b0fe75156..0000000000
--- a/a11y/widgets/ea-calendar-cell.c
+++ /dev/null
@@ -1,305 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* vim:expandtab:shiftwidth=8:tabstop=8:
- */
-/* Evolution Accessibility: ea-calendar-cell.c
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Bolian Yin <bolian.yin@sun.com> Sun Microsystem Inc., 2003
- *
- */
-
-#include "ea-calendar-cell.h"
-#include "ea-calendar-item.h"
-#include "ea-factory.h"
-
-/* ECalendarCell */
-
-static void e_calendar_cell_class_init (ECalendarCellClass *class);
-
-EA_FACTORY_GOBJECT (EA_TYPE_CALENDAR_CELL, ea_calendar_cell, ea_calendar_cell_new)
-
-GType
-e_calendar_cell_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static GTypeInfo tinfo = {
- sizeof (ECalendarCellClass),
- (GBaseInitFunc) NULL, /* base init */
- (GBaseFinalizeFunc) NULL, /* base finalize */
- (GClassInitFunc) e_calendar_cell_class_init, /* class init */
- (GClassFinalizeFunc) NULL, /* class finalize */
- NULL, /* class data */
- sizeof (ECalendarCell), /* instance size */
- 0, /* nb preallocs */
- (GInstanceInitFunc) NULL, /* instance init */
- NULL /* value table */
- };
-
- type = g_type_register_static (G_TYPE_OBJECT,
- "ECalendarCell", &tinfo, 0);
- }
-
- return type;
-}
-
-static void
-e_calendar_cell_class_init (ECalendarCellClass *class)
-{
- EA_SET_FACTORY (e_calendar_cell_get_type (), ea_calendar_cell);
-}
-
-ECalendarCell *
-e_calendar_cell_new (ECalendarItem *calitem, gint row, gint column)
-{
- GObject *object;
- ECalendarCell *cell;
-
- g_return_val_if_fail (E_IS_CALENDAR_ITEM (calitem), NULL);
-
- object = g_object_new (E_TYPE_CALENDAR_CELL, NULL);
- cell = E_CALENDAR_CELL (object);
- cell->calitem = calitem;
- cell->row = row;
- cell->column = column;
-
-#ifdef ACC_DEBUG
- g_print ("EvoAcc: e_calendar_cell created %p\n", (void *)cell);
-#endif
-
- return cell;
-}
-
-/* EaCalendarCell */
-
-static void ea_calendar_cell_class_init (EaCalendarCellClass *klass);
-
-static G_CONST_RETURN gchar* ea_calendar_cell_get_name (AtkObject *accessible);
-static G_CONST_RETURN gchar* ea_calendar_cell_get_description (AtkObject *accessible);
-static AtkObject * ea_calendar_cell_get_parent (AtkObject *accessible);
-
-/* component interface */
-static void atk_component_interface_init (AtkComponentIface *iface);
-static void component_interface_get_extents (AtkComponent *component,
- gint *x, gint *y,
- gint *width, gint *height,
- AtkCoordType coord_type);
-
-static gpointer parent_class = NULL;
-
-#ifdef ACC_DEBUG
-static gint n_ea_calendar_cell_created = 0, n_ea_calendar_cell_destroyed = 0;
-static void ea_calendar_cell_finalize (GObject *object);
-#endif
-
-GType
-ea_calendar_cell_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static GTypeInfo tinfo = {
- sizeof (EaCalendarCellClass),
- (GBaseInitFunc) NULL, /* base init */
- (GBaseFinalizeFunc) NULL, /* base finalize */
- (GClassInitFunc) ea_calendar_cell_class_init, /* class init */
- (GClassFinalizeFunc) NULL, /* class finalize */
- NULL, /* class data */
- sizeof (EaCalendarCell), /* instance size */
- 0, /* nb preallocs */
- (GInstanceInitFunc) NULL, /* instance init */
- NULL /* value table */
- };
-
- static const GInterfaceInfo atk_component_info = {
- (GInterfaceInitFunc) atk_component_interface_init,
- (GInterfaceFinalizeFunc) NULL,
- NULL
- };
-
- type = g_type_register_static (ATK_TYPE_GOBJECT_ACCESSIBLE,
- "EaCalendarCell", &tinfo, 0);
- g_type_add_interface_static (type, ATK_TYPE_COMPONENT,
- &atk_component_info);
- }
-
- return type;
-}
-
-static void
-ea_calendar_cell_class_init (EaCalendarCellClass *klass)
-{
- AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
-
-#ifdef ACC_DEBUG
- GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- gobject_class->finalize = ea_calendar_cell_finalize;
-#endif
-
- parent_class = g_type_class_peek_parent (klass);
-
- class->get_name = ea_calendar_cell_get_name;
- class->get_description = ea_calendar_cell_get_description;
-
- class->get_parent = ea_calendar_cell_get_parent;
-}
-
-AtkObject*
-ea_calendar_cell_new (GObject *obj)
-{
- gpointer object;
- AtkObject *atk_object;
-
- g_return_val_if_fail (E_IS_CALENDAR_CELL (obj), NULL);
- object = g_object_new (EA_TYPE_CALENDAR_CELL, NULL);
- atk_object = ATK_OBJECT (object);
- atk_object_initialize (atk_object, obj);
- atk_object->role = ATK_ROLE_TABLE_CELL;
-
-#ifdef ACC_DEBUG
- ++n_ea_calendar_cell_created;
- g_print ("ACC_DEBUG: n_ea_calendar_cell_created = %d\n",
- n_ea_calendar_cell_created);
-#endif
- return atk_object;
-}
-
-#ifdef ACC_DEBUG
-static void ea_calendar_cell_finalize (GObject *object)
-{
- ++n_ea_calendar_cell_destroyed;
- g_print ("ACC_DEBUG: n_ea_calendar_cell_destroyed = %d\n",
- n_ea_calendar_cell_destroyed);
-}
-#endif
-
-static G_CONST_RETURN gchar*
-ea_calendar_cell_get_name (AtkObject *accessible)
-{
- GObject *g_obj;
-
- g_return_val_if_fail (EA_IS_CALENDAR_CELL (accessible), NULL);
-
- g_obj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE(accessible));
- if (!g_obj)
- /* defunct object*/
- return NULL;
-
- if (!accessible->name) {
- AtkObject *atk_obj;
- EaCalendarItem *ea_calitem;
- ECalendarCell *cell;
- gint day_index;
- gint year, month, day;
- gchar buffer[128];
-
- cell = E_CALENDAR_CELL (g_obj);
- atk_obj = ea_calendar_cell_get_parent (accessible);
- ea_calitem = EA_CALENDAR_ITEM (atk_obj);
- day_index = atk_table_get_index_at (ATK_TABLE (ea_calitem),
- cell->row, cell->column);
- e_calendar_item_get_date_for_offset (cell->calitem, day_index,
- &year, &month, &day);
-
- g_snprintf (buffer, 128, "%d-%d-%d", year, month + 1, day);
- ATK_OBJECT_CLASS (parent_class)->set_name (accessible, buffer);
- }
- return accessible->name;
-}
-
-static G_CONST_RETURN gchar*
-ea_calendar_cell_get_description (AtkObject *accessible)
-{
- return ea_calendar_cell_get_name (accessible);
-}
-
-static AtkObject *
-ea_calendar_cell_get_parent (AtkObject *accessible)
-{
- GObject *g_obj;
- ECalendarCell *cell;
- ECalendarItem *calitem;
-
- g_return_val_if_fail (EA_IS_CALENDAR_CELL (accessible), NULL);
-
- g_obj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE(accessible));
- if (!g_obj)
- /* defunct object*/
- return NULL;
-
- cell = E_CALENDAR_CELL (g_obj);
- calitem = cell->calitem;
- return atk_gobject_accessible_for_object (G_OBJECT (calitem));
-}
-
-/* Atk Component Interface */
-
-static void
-atk_component_interface_init (AtkComponentIface *iface)
-{
- g_return_if_fail (iface != NULL);
-
- iface->get_extents = component_interface_get_extents;
-}
-
-static void
-component_interface_get_extents (AtkComponent *component,
- gint *x, gint *y, gint *width, gint *height,
- AtkCoordType coord_type)
-{
- GObject *g_obj;
- AtkObject *atk_obj, *atk_canvas;
- ECalendarCell *cell;
- ECalendarItem *calitem;
- EaCalendarItem *ea_calitem;
- gint day_index;
- gint year, month, day;
- gint canvas_x, canvas_y, canvas_width, canvas_height;
-
- *x = *y = *width = *height = 0;
-
- g_return_if_fail (EA_IS_CALENDAR_CELL (component));
-
-
- g_obj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE(component));
- if (!g_obj)
- /* defunct object*/
- return;
-
- cell = E_CALENDAR_CELL (g_obj);
- calitem = cell->calitem;
- atk_obj = atk_gobject_accessible_for_object (G_OBJECT (calitem));
- ea_calitem = EA_CALENDAR_ITEM (atk_obj);
- day_index = atk_table_get_index_at (ATK_TABLE (ea_calitem),
- cell->row, cell->column);
- e_calendar_item_get_date_for_offset (calitem, day_index,
- &year, &month, &day);
-
- if (!e_calendar_item_get_day_extents (calitem,
- year, month, day,
- x, y, width, height))
- return;
- atk_canvas = atk_object_get_parent (ATK_OBJECT (ea_calitem));
- atk_component_get_extents (ATK_COMPONENT (atk_canvas),
- &canvas_x, &canvas_y,
- &canvas_width, &canvas_height,
- coord_type);
- *x += canvas_x;
- *y += canvas_y;
-}
diff --git a/a11y/widgets/ea-calendar-cell.h b/a11y/widgets/ea-calendar-cell.h
deleted file mode 100644
index f87ede90a7..0000000000
--- a/a11y/widgets/ea-calendar-cell.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* vim:expandtab:shiftwidth=8:tabstop=8:
- */
-/* Evolution Accessibility: ea-calendar-cell.h
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Bolian Yin <bolian.yin@sun.com> Sun Microsystem Inc., 2003
- *
- */
-
-#ifndef __EA_CALENDAR_CELL_H__
-#define __EA_CALENDAR_CELL_H__
-
-#include <atk/atkgobjectaccessible.h>
-#include "misc/e-calendar-item.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define E_TYPE_CALENDAR_CELL (e_calendar_cell_get_type ())
-#define E_CALENDAR_CELL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_CALENDAR_CELL, ECalendarCell))
-#define E_CALENDAR_CELL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_CALENDAR_CELL, ECalendarCellClass))
-#define E_IS_CALENDAR_CELL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_CALENDAR_CELL))
-#define E_IS_CALENDAR_CELL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_CALENDAR_CELL))
-#define E_CALENDAR_CELL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TYPE_CALENDAR_CELL, ECalendarCellClass))
-
-typedef struct _ECalendarCell ECalendarCell;
-typedef struct _ECalendarCellClass ECalendarCellClass;
-
-struct _ECalendarCell
-{
- GObject parent;
- ECalendarItem *calitem;
- gint row;
- gint column;
-};
-
-GType e_calendar_cell_get_type (void);
-
-struct _ECalendarCellClass
-{
- GObjectClass parent_class;
-};
-
-ECalendarCell * e_calendar_cell_new (ECalendarItem *calitem,
- gint row, gint column);
-
-#define EA_TYPE_CALENDAR_CELL (ea_calendar_cell_get_type ())
-#define EA_CALENDAR_CELL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EA_TYPE_CALENDAR_CELL, EaCalendarCell))
-#define EA_CALENDAR_CELL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EA_TYPE_CALENDAR_CELL, EaCalendarCellClass))
-#define EA_IS_CALENDAR_CELL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EA_TYPE_CALENDAR_CELL))
-#define EA_IS_CALENDAR_CELL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EA_TYPE_CALENDAR_CELL))
-#define EA_CALENDAR_CELL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EA_TYPE_CALENDAR_CELL, EaCalendarCellClass))
-
-typedef struct _EaCalendarCell EaCalendarCell;
-typedef struct _EaCalendarCellClass EaCalendarCellClass;
-
-struct _EaCalendarCell
-{
- AtkGObjectAccessible parent;
-};
-
-GType ea_calendar_cell_get_type (void);
-
-struct _EaCalendarCellClass
-{
- AtkGObjectAccessibleClass parent_class;
-};
-
-AtkObject* ea_calendar_cell_new (GObject *gobj);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __EA_CALENDAR_CELL_H__ */
diff --git a/a11y/widgets/ea-calendar-item.c b/a11y/widgets/ea-calendar-item.c
deleted file mode 100644
index 6170e7f50c..0000000000
--- a/a11y/widgets/ea-calendar-item.c
+++ /dev/null
@@ -1,1247 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* vim:expandtab:shiftwidth=8:tabstop=8:
- */
-/* Evolution Accessibility: ea-calendar-item.c
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Bolian Yin <bolian.yin@sun.com> Sun Microsystem Inc., 2003
- *
- */
-
-#include <stdio.h>
-#include <time.h>
-#include <string.h>
-#include <libgnomecanvas/gnome-canvas.h>
-#include <glib/gdate.h>
-#include "ea-calendar-item.h"
-#include "ea-calendar-cell.h"
-#include "ea-cell-table.h"
-
-#define EA_CALENDAR_COLUMN_NUM E_CALENDAR_COLS_PER_MONTH
-
-/* EaCalendarItem */
-static void ea_calendar_item_class_init (EaCalendarItemClass *klass);
-static void ea_calendar_item_finalize (GObject *object);
-
-static G_CONST_RETURN gchar* ea_calendar_item_get_name (AtkObject *accessible);
-static G_CONST_RETURN gchar* ea_calendar_item_get_description (AtkObject *accessible);
-static gint ea_calendar_item_get_n_children (AtkObject *accessible);
-static AtkObject *ea_calendar_item_ref_child (AtkObject *accessible, gint index);
-
-/* atk table interface */
-static void atk_table_interface_init (AtkTableIface *iface);
-static gint table_interface_get_index_at (AtkTable *table,
- gint row,
- gint column);
-static gint table_interface_get_column_at_index (AtkTable *table,
- gint index);
-static gint table_interface_get_row_at_index (AtkTable *table,
- gint index);
-static AtkObject* table_interface_ref_at (AtkTable *table,
- gint row,
- gint column);
-static gint table_interface_get_n_rows (AtkTable *table);
-static gint table_interface_get_n_columns (AtkTable *table);
-static gint table_interface_get_column_extent_at (AtkTable *table,
- gint row,
- gint column);
-static gint table_interface_get_row_extent_at (AtkTable *table,
- gint row,
- gint column);
-
-static gboolean table_interface_is_row_selected (AtkTable *table,
- gint row);
-static gboolean table_interface_is_column_selected (AtkTable *table,
- gint row);
-static gboolean table_interface_is_selected (AtkTable *table,
- gint row,
- gint column);
-static gint table_interface_get_selected_rows (AtkTable *table,
- gint **rows_selected);
-static gint table_interface_get_selected_columns (AtkTable *table,
- gint **columns_selected);
-static gboolean table_interface_add_row_selection (AtkTable *table, gint row);
-static gboolean table_interface_remove_row_selection (AtkTable *table,
- gint row);
-static gboolean table_interface_add_column_selection (AtkTable *table,
- gint column);
-static gboolean table_interface_remove_column_selection (AtkTable *table,
- gint column);
-static AtkObject* table_interface_get_row_header (AtkTable *table, gint row);
-static AtkObject* table_interface_get_column_header (AtkTable *table,
- gint in_col);
-static AtkObject* table_interface_get_caption (AtkTable *table);
-
-static G_CONST_RETURN gchar*
-table_interface_get_column_description (AtkTable *table, gint in_col);
-
-static G_CONST_RETURN gchar*
-table_interface_get_row_description (AtkTable *table, gint row);
-
-static AtkObject* table_interface_get_summary (AtkTable *table);
-
-/* atk selection interface */
-static void atk_selection_interface_init (AtkSelectionIface *iface);
-static gboolean selection_interface_add_selection (AtkSelection *selection,
- gint i);
-static gboolean selection_interface_clear_selection (AtkSelection *selection);
-static AtkObject* selection_interface_ref_selection (AtkSelection *selection,
- gint i);
-static gint selection_interface_get_selection_count (AtkSelection *selection);
-static gboolean selection_interface_is_child_selected (AtkSelection *selection,
- gint i);
-
-/* callbacks */
-static void selection_preview_change_cb (ECalendarItem *calitem);
-static void date_range_changed_cb (ECalendarItem *calitem);
-static void selection_changed_cb (ECalendarItem *calitem);
-
-/* helpers */
-static EaCellTable *ea_calendar_item_get_cell_data (EaCalendarItem *ea_calitem);
-static void ea_calendar_item_destory_cell_data (EaCalendarItem *ea_calitem);
-static gboolean ea_calendar_item_get_column_label (EaCalendarItem *ea_calitem,
- gint column,
- gchar *buffer,
- gint buffer_size);
-static gboolean ea_calendar_item_get_row_label (EaCalendarItem *ea_calitem,
- gint row,
- gchar *buffer,
- gint buffer_size);
-
-#ifdef ACC_DEBUG
-static gint n_ea_calendar_item_created = 0;
-static gint n_ea_calendar_item_destroyed = 0;
-#endif
-
-static gpointer parent_class = NULL;
-
-GType
-ea_calendar_item_get_type (void)
-{
- static GType type = 0;
- AtkObjectFactory *factory;
- GTypeQuery query;
- GType derived_atk_type;
-
- if (!type) {
- static GTypeInfo tinfo = {
- sizeof (EaCalendarItemClass),
- (GBaseInitFunc) NULL, /* base init */
- (GBaseFinalizeFunc) NULL, /* base finalize */
- (GClassInitFunc) ea_calendar_item_class_init, /* class init */
- (GClassFinalizeFunc) NULL, /* class finalize */
- NULL, /* class data */
- sizeof (EaCalendarItem), /* instance size */
- 0, /* nb preallocs */
- (GInstanceInitFunc) NULL, /* instance init */
- NULL /* value table */
- };
-
- static const GInterfaceInfo atk_table_info = {
- (GInterfaceInitFunc) atk_table_interface_init,
- (GInterfaceFinalizeFunc) NULL,
- NULL
- };
- static const GInterfaceInfo atk_selection_info = {
- (GInterfaceInitFunc) atk_selection_interface_init,
- (GInterfaceFinalizeFunc) NULL,
- NULL
- };
-
- /*
- * Figure out the size of the class and instance
- * we are run-time deriving from (GailCanvasItem, in this case)
- */
-
- factory = atk_registry_get_factory (atk_get_default_registry (),
- GNOME_TYPE_CANVAS_ITEM);
- derived_atk_type = atk_object_factory_get_accessible_type (factory);
- g_type_query (derived_atk_type, &query);
-
- tinfo.class_size = query.class_size;
- tinfo.instance_size = query.instance_size;
-
- type = g_type_register_static (derived_atk_type,
- "EaCalendarItem", &tinfo, 0);
- g_type_add_interface_static (type, ATK_TYPE_TABLE,
- &atk_table_info);
- g_type_add_interface_static (type, ATK_TYPE_SELECTION,
- &atk_selection_info);
- }
-
- return type;
-}
-
-static void
-ea_calendar_item_class_init (EaCalendarItemClass *klass)
-{
- GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
-
- gobject_class->finalize = ea_calendar_item_finalize;
- parent_class = g_type_class_peek_parent (klass);
-
- class->get_name = ea_calendar_item_get_name;
- class->get_description = ea_calendar_item_get_description;
-
- class->get_n_children = ea_calendar_item_get_n_children;
- class->ref_child = ea_calendar_item_ref_child;
-}
-
-AtkObject*
-ea_calendar_item_new (GObject *obj)
-{
- gpointer object;
- AtkObject *atk_object;
-
- g_return_val_if_fail (E_IS_CALENDAR_ITEM (obj), NULL);
- object = g_object_new (EA_TYPE_CALENDAR_ITEM, NULL);
- atk_object = ATK_OBJECT (object);
- atk_object_initialize (atk_object, obj);
- atk_object->role = ATK_ROLE_TABLE;
-#ifdef ACC_DEBUG
- ++n_ea_calendar_item_created;
- g_print ("ACC_DEBUG: n_ea_calendar_item_created = %d\n",
- n_ea_calendar_item_created);
-#endif
- /* connect signal handlers */
- g_signal_connect (obj, "selection_preview_changed",
- G_CALLBACK (selection_preview_change_cb),
- atk_object);
- g_signal_connect (obj, "date_range_changed",
- G_CALLBACK (date_range_changed_cb),
- atk_object);
- g_signal_connect (obj, "selection_preview_changed",
- G_CALLBACK (selection_changed_cb),
- atk_object);
-
- return atk_object;
-}
-
-static void
-ea_calendar_item_finalize (GObject *object)
-{
- EaCalendarItem *ea_calitem;
-
- g_return_if_fail (EA_IS_CALENDAR_ITEM (object));
-
- ea_calitem = EA_CALENDAR_ITEM (object);
-
- /* Free the allocated cell data */
- ea_calendar_item_destory_cell_data (ea_calitem);
-
- G_OBJECT_CLASS (parent_class)->finalize (object);
-#ifdef ACC_DEBUG
- ++n_ea_calendar_item_destroyed;
- printf ("ACC_DEBUG: n_ea_calendar_item_destroyed = %d\n",
- n_ea_calendar_item_destroyed);
-#endif
-}
-
-static G_CONST_RETURN gchar*
-ea_calendar_item_get_name (AtkObject *accessible)
-{
- GObject *g_obj;
- ECalendarItem *calitem;
- gint start_year, start_month, start_day;
- gint end_year, end_month, end_day;
- static gchar new_name[256] = "";
-
- g_return_val_if_fail (EA_IS_CALENDAR_ITEM (accessible), NULL);
-
- if (accessible->name)
- return accessible->name;
-
- g_obj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE(accessible));
- g_return_val_if_fail (E_IS_CALENDAR_ITEM (g_obj), NULL);
-
- calitem = E_CALENDAR_ITEM (g_obj);
- if (e_calendar_item_get_date_range (calitem,
- &start_year, &start_month, &start_day,
- &end_year, &end_month, &end_day)) {
- ++start_month;
- ++end_month;
- sprintf (new_name, "calendar (from %d-%d-%d to %d-%d-%d)",
- start_year, start_month, start_day,
- end_year, end_month, end_day);
- }
-
-#if 0
- if (e_calendar_item_get_selection (calitem, &select_start, &select_end)) {
- GDate select_start, select_end;
- gint year1, year2, month1, month2, day1, day2;
-
- year1 = g_date_get_year (&select_start);
- month1 = g_date_get_month (&select_start);
- day1 = g_date_get_day (&select_start);
-
- year2 = g_date_get_year (&select_end);
- month2 = g_date_get_month (&select_end);
- day2 = g_date_get_day (&select_end);
-
- sprintf (new_name + strlen (new_name),
- " : current selection: from %d-%d-%d to %d-%d-%d.",
- year1, month1, day1,
- year2, month2, day2);
- }
-#endif
-
- return new_name;
-}
-
-static G_CONST_RETURN gchar*
-ea_calendar_item_get_description (AtkObject *accessible)
-{
- if (accessible->description)
- return accessible->description;
-
- return "evolution calendar item";
-}
-
-static gint
-ea_calendar_item_get_n_children (AtkObject *accessible)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- ECalendarItem *calitem;
- gint n_children = 0;
- gint start_year, start_month, start_day;
- gint end_year, end_month, end_day;
- GDate *start_date, *end_date;
-
- g_return_val_if_fail (EA_IS_CALENDAR_ITEM (accessible), -1);
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (accessible);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return -1;
-
- calitem = E_CALENDAR_ITEM (g_obj);
- if (!e_calendar_item_get_date_range (calitem, &start_year,
- &start_month, &start_day,
- &end_year, &end_month,
- &end_day))
- return 0;
-
- start_date = g_date_new_dmy (start_day, start_month + 1, start_year);
- end_date = g_date_new_dmy (end_day, end_month + 1, end_year);
-
- n_children = g_date_days_between (start_date, end_date) + 1;
- g_free (start_date);
- g_free (end_date);
- return n_children;
-}
-
-static AtkObject *
-ea_calendar_item_ref_child (AtkObject *accessible, gint index)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- ECalendarItem *calitem;
- gint n_children;
- ECalendarCell *cell;
- EaCellTable *cell_data;
- EaCalendarItem *ea_calitem;
-
- g_return_val_if_fail (EA_IS_CALENDAR_ITEM (accessible), NULL);
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (accessible);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return NULL;
-
- calitem = E_CALENDAR_ITEM (g_obj);
-
- n_children = ea_calendar_item_get_n_children (accessible);
- if (index < 0 || index >= n_children)
- return NULL;
-
- ea_calitem = EA_CALENDAR_ITEM (accessible);
- cell_data = ea_calendar_item_get_cell_data (ea_calitem);
- if (!cell_data)
- return NULL;
-
- cell = ea_cell_table_get_cell_at_index (cell_data, index);
- if (!cell) {
- cell = e_calendar_cell_new (calitem,
- index / EA_CALENDAR_COLUMN_NUM,
- index % EA_CALENDAR_COLUMN_NUM);
- ea_cell_table_set_cell_at_index (cell_data, index, cell);
- g_object_unref (cell);
- }
-
-#ifdef ACC_DEBUG
- g_print ("AccDebug: ea_calendar_item children[%d]=%p\n", index,
- (gpointer)cell);
-#endif
- return g_object_ref (atk_gobject_accessible_for_object (G_OBJECT(cell)));
-}
-
-/* atk table interface */
-
-static void
-atk_table_interface_init (AtkTableIface *iface)
-{
- g_return_if_fail (iface != NULL);
-
- iface->ref_at = table_interface_ref_at;
-
- iface->get_n_rows = table_interface_get_n_rows;
- iface->get_n_columns = table_interface_get_n_columns;
- iface->get_index_at = table_interface_get_index_at;
- iface->get_column_at_index = table_interface_get_column_at_index;
- iface->get_row_at_index = table_interface_get_row_at_index;
- iface->get_column_extent_at = table_interface_get_column_extent_at;
- iface->get_row_extent_at = table_interface_get_row_extent_at;
-
- iface->is_selected = table_interface_is_selected;
- iface->get_selected_rows = table_interface_get_selected_rows;
- iface->get_selected_columns = table_interface_get_selected_columns;
- iface->is_row_selected = table_interface_is_row_selected;
- iface->is_column_selected = table_interface_is_column_selected;
- iface->add_row_selection = table_interface_add_row_selection;
- iface->remove_row_selection = table_interface_remove_row_selection;
- iface->add_column_selection = table_interface_add_column_selection;
- iface->remove_column_selection = table_interface_remove_column_selection;
-
- iface->get_row_header = table_interface_get_row_header;
- iface->get_column_header = table_interface_get_column_header;
- iface->get_caption = table_interface_get_caption;
- iface->get_summary = table_interface_get_summary;
- iface->get_row_description = table_interface_get_row_description;
- iface->get_column_description = table_interface_get_column_description;
-}
-
-static AtkObject*
-table_interface_ref_at (AtkTable *table,
- gint row,
- gint column)
-{
- gint index;
-
- EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (table);
- index = EA_CALENDAR_COLUMN_NUM * row + column;
- return ea_calendar_item_ref_child (ATK_OBJECT (ea_calitem), index);
-}
-
-static gint
-table_interface_get_n_rows (AtkTable *table)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (table);
- gint n_children;
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return -1;
-
- n_children = ea_calendar_item_get_n_children (ATK_OBJECT (ea_calitem));
- return (n_children - 1) / EA_CALENDAR_COLUMN_NUM + 1;
-}
-
-static gint
-table_interface_get_n_columns (AtkTable *table)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (table);
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return -1;
-
- return EA_CALENDAR_COLUMN_NUM;
-}
-
-static gint
-table_interface_get_index_at (AtkTable *table,
- gint row,
- gint column)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (table);
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return -1;
-
- return row * EA_CALENDAR_COLUMN_NUM + column;
-}
-
-static gint
-table_interface_get_column_at_index (AtkTable *table,
- gint index)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (table);
- gint n_children;
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return -1;
-
- n_children = ea_calendar_item_get_n_children (ATK_OBJECT (ea_calitem));
- if (index >= 0 && index < n_children)
- return index % EA_CALENDAR_COLUMN_NUM;
- return -1;
-}
-
-static gint
-table_interface_get_row_at_index (AtkTable *table,
- gint index)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (table);
- gint n_children;
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return -1;
-
- n_children = ea_calendar_item_get_n_children (ATK_OBJECT (ea_calitem));
- if (index >= 0 && index < n_children)
- return index / EA_CALENDAR_COLUMN_NUM;
- return -1;
-}
-
-static gint
-table_interface_get_column_extent_at (AtkTable *table,
- gint row,
- gint column)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- ECalendarItem *calitem;
- EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (table);
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return FALSE;
-
- calitem = E_CALENDAR_ITEM (g_obj);
- return calitem->cell_width;
-}
-
-static gint
-table_interface_get_row_extent_at (AtkTable *table,
- gint row, gint column)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- ECalendarItem *calitem;
- EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (table);
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return FALSE;
-
- calitem = E_CALENDAR_ITEM (g_obj);
- return calitem->cell_height;
-}
-
-/* any day in the row is selected, the row is selected */
-static gboolean
-table_interface_is_row_selected (AtkTable *table,
- gint row)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- gint n_rows;
- ECalendarItem *calitem;
- gint row_index_start, row_index_end;
- gint sel_index_start, sel_index_end;
-
- GDate start_date, end_date;
-
- g_return_val_if_fail (EA_IS_CALENDAR_ITEM (table), FALSE);
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (table);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return FALSE;
-
- n_rows = table_interface_get_n_rows (table);
- if (row < 0 || row >= n_rows)
- return FALSE;
-
- row_index_start = row * EA_CALENDAR_COLUMN_NUM;
- row_index_end = row_index_start + EA_CALENDAR_COLUMN_NUM - 1;
-
- calitem = E_CALENDAR_ITEM (g_obj);
- e_calendar_item_get_selection (calitem, &start_date, &end_date);
-
- sel_index_start =
- e_calendar_item_get_offset_for_date (calitem,
- g_date_get_year (&start_date),
- g_date_get_month (&start_date),
- g_date_get_day (&start_date));
- sel_index_end =
- e_calendar_item_get_offset_for_date (calitem,
- g_date_get_year (&end_date),
- g_date_get_month (&end_date),
- g_date_get_day (&end_date));
-
- if ((sel_index_start < row_index_start &&
- sel_index_end >= row_index_start) ||
- (sel_index_start >= row_index_start &&
- sel_index_start <= row_index_end))
- return TRUE;
- return FALSE;
-}
-
-static gboolean
-table_interface_is_selected (AtkTable *table,
- gint row,
- gint column)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- gint n_rows, n_columns;
- ECalendarItem *calitem;
- gint index;
- gint sel_index_start, sel_index_end;
-
- GDate start_date, end_date;
-
- g_return_val_if_fail (EA_IS_CALENDAR_ITEM (table), FALSE);
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (table);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return FALSE;
-
- n_rows = table_interface_get_n_rows (table);
- if (row < 0 || row >= n_rows)
- return FALSE;
- n_columns = table_interface_get_n_columns (table);
- if (column < 0 || column >= n_columns)
- return FALSE;
-
- index = table_interface_get_index_at (table, row, column);
-
- calitem = E_CALENDAR_ITEM (g_obj);
- e_calendar_item_get_selection (calitem, &start_date, &end_date);
-
- sel_index_start =
- e_calendar_item_get_offset_for_date (calitem,
- g_date_get_year (&start_date),
- g_date_get_month (&start_date),
- g_date_get_day (&start_date));
- sel_index_end =
- e_calendar_item_get_offset_for_date (calitem,
- g_date_get_year (&end_date),
- g_date_get_month (&end_date),
- g_date_get_day (&end_date));
-
- if (sel_index_start <= index && sel_index_end >= index)
- return TRUE;
- return FALSE;
-}
-
-static gboolean
-table_interface_is_column_selected (AtkTable *table,
- gint column)
-{
- return FALSE;
-}
-
-static gint
-table_interface_get_selected_rows (AtkTable *table,
- gint **rows_selected)
-{
- *rows_selected = NULL;
- return -1;
-}
-
-static gint
-table_interface_get_selected_columns (AtkTable *table,
- gint **columns_selected)
-{
- *columns_selected = NULL;
- return -1;
-}
-
-static gboolean
-table_interface_add_row_selection (AtkTable *table,
- gint row)
-{
- return FALSE;
-}
-
-static gboolean
-table_interface_remove_row_selection (AtkTable *table,
- gint row)
-{
- return FALSE;
-}
-
-static gboolean
-table_interface_add_column_selection (AtkTable *table,
- gint column)
-{
- return FALSE;
-}
-
-static gboolean
-table_interface_remove_column_selection (AtkTable *table,
- gint column)
-{
- /* FIXME: NOT IMPLEMENTED */
- return FALSE;
-}
-
-static AtkObject*
-table_interface_get_row_header (AtkTable *table,
- gint row)
-{
- /* FIXME: NOT IMPLEMENTED */
- return NULL;
-}
-
-static AtkObject*
-table_interface_get_column_header (AtkTable *table,
- gint in_col)
-{
- /* FIXME: NOT IMPLEMENTED */
- return NULL;
-}
-
-static AtkObject*
-table_interface_get_caption (AtkTable *table)
-{
- /* FIXME: NOT IMPLEMENTED */
- return NULL;
-}
-
-static G_CONST_RETURN gchar*
-table_interface_get_column_description (AtkTable *table, gint in_col)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- ECalendarItem *calitem;
- EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (table);
- const gchar *description = NULL;
- EaCellTable *cell_data;
- gint n_columns;
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return NULL;
-
- calitem = E_CALENDAR_ITEM (g_obj);
- n_columns = table_interface_get_n_columns (table);
- if (in_col < 0 || in_col >= n_columns)
- return NULL;
- cell_data = ea_calendar_item_get_cell_data (ea_calitem);
- if (!cell_data)
- return NULL;
-
- description = ea_cell_table_get_column_label (cell_data, in_col);
- if (!description) {
- gchar buffer[128] = "column description";
- ea_calendar_item_get_column_label (ea_calitem, in_col,
- buffer, sizeof (buffer));
- ea_cell_table_set_column_label (cell_data, in_col, buffer);
- description = ea_cell_table_get_column_label (cell_data,
- in_col);
- }
- return description;
-}
-
-static G_CONST_RETURN gchar*
-table_interface_get_row_description (AtkTable *table, gint row)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- ECalendarItem *calitem;
- EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (table);
- const gchar *description = NULL;
- EaCellTable *cell_data;
- gint n_rows;
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return NULL;
-
- calitem = E_CALENDAR_ITEM (g_obj);
- n_rows = table_interface_get_n_rows (table);
- if (row < 0 || row >= n_rows)
- return NULL;
- cell_data = ea_calendar_item_get_cell_data (ea_calitem);
- if (!cell_data)
- return NULL;
-
- description = ea_cell_table_get_row_label (cell_data, row);
- if (!description) {
- gchar buffer[128] = "row description";
- ea_calendar_item_get_row_label (ea_calitem, row,
- buffer, sizeof (buffer));
- ea_cell_table_set_row_label (cell_data, row, buffer);
- description = ea_cell_table_get_row_label (cell_data,
- row);
- }
- return description;
-}
-
-static AtkObject*
-table_interface_get_summary (AtkTable *table)
-{
- /* FIXME: NOT IMPLEMENTED */
- return NULL;
-}
-
-/* atkselection interface */
-
-static void
-atk_selection_interface_init (AtkSelectionIface *iface)
-{
- g_return_if_fail (iface != NULL);
-
- iface->add_selection = selection_interface_add_selection;
- iface->clear_selection = selection_interface_clear_selection;
- iface->ref_selection = selection_interface_ref_selection;
- iface->get_selection_count = selection_interface_get_selection_count;
- iface->is_child_selected = selection_interface_is_child_selected;
-}
-
-static gboolean
-selection_interface_add_selection (AtkSelection *selection, gint index)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- ECalendarItem *calitem;
- EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (selection);
- gint year, month, day;
- GDate start_date, end_date;
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return FALSE;
-
- calitem = E_CALENDAR_ITEM (g_obj);
- if (!e_calendar_item_get_date_for_offset (calitem, index,
- &year, &month, &day))
- return FALSE;
-
- /* FIXME: not support mulit-selection */
- g_date_set_dmy (&start_date, day, month + 1, year);
- end_date = start_date;
- e_calendar_item_set_selection (calitem, &start_date, &end_date);
- return TRUE;
-}
-
-static gboolean
-selection_interface_clear_selection (AtkSelection *selection)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- ECalendarItem *calitem;
- EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (selection);
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return FALSE;
-
- calitem = E_CALENDAR_ITEM (g_obj);
- e_calendar_item_set_selection (calitem, NULL, NULL);
-
- return TRUE;
-}
-
-static AtkObject*
-selection_interface_ref_selection (AtkSelection *selection, gint i)
-{
- GObject *g_obj;
- ECalendarItem *calitem;
- EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (selection);
- gint count, sel_offset;
- GDate start_date, end_date;
-
- count = selection_interface_get_selection_count (selection);
- if (i < 0 || i >= count)
- return NULL;
-
- g_obj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (ea_calitem));
-
- calitem = E_CALENDAR_ITEM (g_obj);
- e_calendar_item_get_selection (calitem, &start_date, &end_date);
- sel_offset = e_calendar_item_get_offset_for_date (calitem,
- g_date_get_year (&start_date),
- g_date_get_month (&start_date),
- g_date_get_day (&start_date));
-
- return ea_calendar_item_ref_child (ATK_OBJECT (selection), sel_offset + i);
-}
-
-static gint
-selection_interface_get_selection_count (AtkSelection *selection)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- ECalendarItem *calitem;
- EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (selection);
- GDate start_date, end_date;
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return 0;
-
- calitem = E_CALENDAR_ITEM (g_obj);
- e_calendar_item_get_selection (calitem, &start_date, &end_date);
-
- return g_date_days_between (&start_date, &end_date) + 1;
-}
-
-static gboolean
-selection_interface_is_child_selected (AtkSelection *selection, gint index)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- ECalendarItem *calitem;
- EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (selection);
- gint row, column, n_children;
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return FALSE;
-
- calitem = E_CALENDAR_ITEM (g_obj);
- n_children = atk_object_get_n_accessible_children (ATK_OBJECT (selection));
- if (index < 0 || index >= n_children)
- return FALSE;
-
- row = index / EA_CALENDAR_COLUMN_NUM;
- column = index % EA_CALENDAR_COLUMN_NUM;
-
- return table_interface_is_selected (ATK_TABLE (selection), row, column);
-}
-
-/* callbacks */
-
-static void
-selection_preview_change_cb (ECalendarItem *calitem)
-{
- AtkObject *atk_obj;
-
- g_return_if_fail (E_IS_CALENDAR_ITEM (calitem));
- atk_obj = atk_gobject_accessible_for_object (G_OBJECT (calitem));
-
- g_signal_emit_by_name (atk_obj, "selection_changed");
-}
-
-static void
-date_range_changed_cb (ECalendarItem *calitem)
-{
- AtkObject *atk_obj;
-
- g_return_if_fail (E_IS_CALENDAR_ITEM (calitem));
- atk_obj = atk_gobject_accessible_for_object (G_OBJECT (calitem));
- ea_calendar_item_destory_cell_data (EA_CALENDAR_ITEM (atk_obj));
-
- g_signal_emit_by_name (atk_obj, "model_changed");
-}
-
-static void
-selection_changed_cb (ECalendarItem *calitem)
-{
- selection_preview_change_cb (calitem);
-}
-
-/* helpers */
-
-static EaCellTable *
-ea_calendar_item_get_cell_data (EaCalendarItem *ea_calitem)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- ECalendarItem *calitem;
- EaCellTable *cell_data;
-
- g_return_val_if_fail (ea_calitem, NULL);
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return NULL;
-
- calitem = E_CALENDAR_ITEM (g_obj);
-
- cell_data = g_object_get_data (G_OBJECT(ea_calitem),
- "ea-calendar-cell-table");
-
- if (!cell_data) {
- gint n_cells = ea_calendar_item_get_n_children (ATK_OBJECT(ea_calitem));
- cell_data = ea_cell_table_create (n_cells/EA_CALENDAR_COLUMN_NUM,
- EA_CALENDAR_COLUMN_NUM,
- FALSE);
- g_object_set_data (G_OBJECT(ea_calitem),
- "ea-calendar-cell-table", cell_data);
- }
- return cell_data;
-}
-
-static void
-ea_calendar_item_destory_cell_data (EaCalendarItem *ea_calitem)
-{
- EaCellTable *cell_data;
-
- g_return_if_fail (ea_calitem);
-
- cell_data = g_object_get_data (G_OBJECT(ea_calitem),
- "ea-calendar-cell-table");
- if (cell_data) {
- ea_cell_table_destroy (cell_data);
- g_object_set_data (G_OBJECT(ea_calitem),
- "ea-calendar-cell-table", NULL);
- }
-}
-
-static gboolean
-ea_calendar_item_get_row_label (EaCalendarItem *ea_calitem, gint row,
- gchar *buffer, gint buffer_size)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- ECalendarItem *calitem;
- gint index, week_num;
- gint year, month, day;
-
- g_return_val_if_fail (ea_calitem, FALSE);
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return FALSE;
-
- calitem = E_CALENDAR_ITEM (g_obj);
-
- index = atk_table_get_index_at (ATK_TABLE (ea_calitem), row, 0);
- if (!e_calendar_item_get_date_for_offset (calitem, index,
- &year, &month, &day))
- return FALSE;
-
- week_num = e_calendar_item_get_week_number (calitem,
- day, month, year);
-
- g_snprintf (buffer, buffer_size, "week number : %d", week_num);
- return TRUE;
-}
-
-static gboolean
-ea_calendar_item_get_column_label (EaCalendarItem *ea_calitem, gint column,
- gchar *buffer, gint buffer_size)
-{
- AtkGObjectAccessible *atk_gobj;
- GObject *g_obj;
- ECalendarItem *calitem;
- gchar *week_char;
- gint char_size;
-
- g_return_val_if_fail (ea_calitem, FALSE);
-
- atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem);
- g_obj = atk_gobject_accessible_get_object (atk_gobj);
- if (!g_obj)
- return FALSE;
-
- calitem = E_CALENDAR_ITEM (g_obj);
- week_char = g_utf8_offset_to_pointer (calitem->days, column);
- char_size = strlen (calitem->days) -
- strlen (g_utf8_find_next_char (calitem->days, NULL));
-
- if (week_char && char_size < buffer_size) {
- memcpy (buffer, week_char, char_size);
- buffer[char_size] = '\0';
- return TRUE;
- }
- return FALSE;
-}
-
-/* the coordinate the e-calendar canvas coord */
-gboolean
-e_calendar_item_get_day_extents (ECalendarItem *calitem,
- gint year, gint month, gint date,
- gint *x, gint *y,
- gint *width, gint *height)
-{
- GnomeCanvasItem *item;
- GtkWidget *widget;
- GtkStyle *style;
- PangoFontDescription *font_desc;
- PangoContext *pango_context;
- PangoFontMetrics *font_metrics;
- gint char_height, xthickness, ythickness, text_y;
- gint new_year, new_month, num_months, months_offset;
- gint month_x, month_y, month_cell_x, month_cell_y;
- gint month_row, month_col;
- gint day_row, day_col;
- gint days_from_week_start;
-
- g_return_val_if_fail (E_IS_CALENDAR_ITEM (calitem), FALSE);
-
- item = GNOME_CANVAS_ITEM (calitem);
- widget = GTK_WIDGET (item->canvas);
- style = widget->style;
-
- /* Set up Pango prerequisites */
- font_desc = calitem->font_desc;
- if (!font_desc)
- font_desc = style->font_desc;
- pango_context = gtk_widget_get_pango_context (widget);
- font_metrics = pango_context_get_metrics (pango_context, font_desc,
- pango_context_get_language (pango_context));
-
- char_height =
- PANGO_PIXELS (pango_font_metrics_get_ascent (font_metrics)) +
- PANGO_PIXELS (pango_font_metrics_get_descent (font_metrics));
-
- xthickness = style->xthickness;
- ythickness = style->ythickness;
-
- new_year = year;
- new_month = month;
- e_calendar_item_normalize_date (calitem, &new_year, &new_month);
- num_months = calitem->rows * calitem->cols;
- months_offset = (new_year - calitem->year) * 12
- + new_month - calitem->month;
-
- if (months_offset > num_months || months_offset < 0)
- return FALSE;
-
- month_row = months_offset / calitem->cols;
- month_col = months_offset % calitem->cols;
-
- month_x = item->x1 + xthickness + calitem->x_offset
- + month_col * calitem->month_width;
- month_y = item->y1 + ythickness + month_row * calitem->month_height;
-
- month_cell_x = month_x + E_CALENDAR_ITEM_XPAD_BEFORE_WEEK_NUMBERS
- + calitem->month_lpad + E_CALENDAR_ITEM_XPAD_BEFORE_CELLS;
- text_y = month_y + ythickness * 2
- + E_CALENDAR_ITEM_YPAD_ABOVE_MONTH_NAME
- + char_height + E_CALENDAR_ITEM_YPAD_BELOW_MONTH_NAME
- + E_CALENDAR_ITEM_YPAD_ABOVE_DAY_LETTERS + calitem->month_tpad;
-
- month_cell_y = text_y + char_height
- + E_CALENDAR_ITEM_YPAD_BELOW_DAY_LETTERS + 1
- + E_CALENDAR_ITEM_YPAD_ABOVE_CELLS;
-
- days_from_week_start =
- e_calendar_item_get_n_days_from_week_start (calitem, new_year,
- new_month);
- day_row = (date + days_from_week_start - 1) / EA_CALENDAR_COLUMN_NUM;
- day_col = (date + days_from_week_start - 1) % EA_CALENDAR_COLUMN_NUM;
-
- *x = month_cell_x + day_col * calitem->cell_width;
- *y = month_cell_y + day_row * calitem->cell_height;
- *width = calitem->cell_width;
- *height = calitem->cell_height;
-
- return TRUE;
-}
-
-/* month is from 0 to 11 */
-gboolean
-e_calendar_item_get_date_for_offset (ECalendarItem *calitem, gint day_offset,
- gint *year, gint *month, gint *day)
-{
- gint start_year, start_month, start_day;
- gint end_year, end_month, end_day;
- GDate *start_date;
-
- g_return_val_if_fail (E_IS_CALENDAR_ITEM (calitem), FALSE);
-
- if (!e_calendar_item_get_date_range (calitem, &start_year,
- &start_month, &start_day,
- &end_year, &end_month,
- &end_day))
- return FALSE;
-
- start_date = g_date_new_dmy (start_day, start_month + 1, start_year);
-
- g_date_add_days (start_date, day_offset);
-
- *year = g_date_get_year (start_date);
- *month = g_date_get_month (start_date) - 1;
- *day = g_date_get_day (start_date);
-
- return TRUE;
-}
-
-/* month is from 0 to 11 */
-gint
-e_calendar_item_get_offset_for_date (ECalendarItem *calitem,
- gint year, gint month, gint day)
-{
- gint start_year, start_month, start_day;
- gint end_year, end_month, end_day;
- GDate *start_date, *end_date;
- gint n_days;
-
- g_return_val_if_fail (E_IS_CALENDAR_ITEM (calitem), -1);
-
- if (!e_calendar_item_get_date_range (calitem, &start_year,
- &start_month, &start_day,
- &end_year, &end_month,
- &end_day))
- return FALSE;
-
- start_date = g_date_new_dmy (start_day, start_month + 1, start_year);
- end_date = g_date_new_dmy (day, month + 1, year);
-
- n_days = g_date_days_between (start_date, end_date);
- g_free (start_date);
- g_free (end_date);
- return n_days;
-}
-
-gint
-e_calendar_item_get_n_days_from_week_start (ECalendarItem *calitem,
- gint year, gint month)
-{
- struct tm tmp_tm;
- gint start_weekday, days_from_week_start;
-
- memset (&tmp_tm, 0, sizeof (tmp_tm));
- tmp_tm.tm_year = year - 1900;
- tmp_tm.tm_mon = month;
- tmp_tm.tm_mday = 1;
- tmp_tm.tm_isdst = -1;
- mktime (&tmp_tm);
- start_weekday = (tmp_tm.tm_wday + 6) % 7; /* 0 to 6 */
- days_from_week_start = (start_weekday + 7 - calitem->week_start_day)
- % 7;
- return days_from_week_start;
-}
diff --git a/a11y/widgets/ea-calendar-item.h b/a11y/widgets/ea-calendar-item.h
deleted file mode 100644
index 04df5f94ac..0000000000
--- a/a11y/widgets/ea-calendar-item.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* vim:expandtab:shiftwidth=8:tabstop=8:
- */
-/* Evolution Accessibility: ea-calendar-item.h
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Bolian Yin <bolian.yin@sun.com> Sun Microsystem Inc., 2003
- *
- */
-
-#ifndef __EA_CALENDAR_ITEM_H__
-#define __EA_CALENDAR_ITEM_H__
-
-#include <atk/atkgobjectaccessible.h>
-#include <misc/e-calendar-item.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define EA_TYPE_CALENDAR_ITEM (ea_calendar_item_get_type ())
-#define EA_CALENDAR_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EA_TYPE_CALENDAR_ITEM, EaCalendarItem))
-#define EA_CALENDAR_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EA_TYPE_CALENDAR_ITEM, EaCalendarItemClass))
-#define EA_IS_CALENDAR_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EA_TYPE_CALENDAR_ITEM))
-#define EA_IS_CALENDAR_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EA_TYPE_CALENDAR_ITEM))
-#define EA_CALENDAR_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EA_TYPE_CALENDAR_ITEM, EaCalendarItemClass))
-
-typedef struct _EaCalendarItem EaCalendarItem;
-typedef struct _EaCalendarItemClass EaCalendarItemClass;
-
-struct _EaCalendarItem
-{
- AtkGObjectAccessible parent;
-};
-
-GType ea_calendar_item_get_type (void);
-
-struct _EaCalendarItemClass
-{
- AtkGObjectAccessibleClass parent_class;
-};
-
-AtkObject *ea_calendar_item_new (GObject *obj);
-gboolean e_calendar_item_get_day_extents (ECalendarItem *calitem,
- gint year, gint month, gint date,
- gint *x, gint *y,
- gint *width, gint *height);
-gboolean e_calendar_item_get_date_for_offset (ECalendarItem *calitem,
- gint day_offset,
- gint *year, gint *month,
- gint *day);
-gint e_calendar_item_get_offset_for_date (ECalendarItem *calitem,
- gint year, gint month, gint day);
-gint e_calendar_item_get_n_days_from_week_start (ECalendarItem *calitem,
- gint year, gint month);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* __EA_CALENDAR_ITEM_H__ */
diff --git a/a11y/widgets/ea-widgets.c b/a11y/widgets/ea-widgets.c
deleted file mode 100644
index edead1b785..0000000000
--- a/a11y/widgets/ea-widgets.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* vim:expandtab:shiftwidth=8:tabstop=8:
- */
-/* Evolution Accessibility: ea-widgets.c
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Bolian Yin <bolian.yin@sun.com> Sun Microsystem Inc., 2003
- *
- */
-
-#include "ea-factory.h"
-#include "widgets/ea-calendar-item.h"
-#include "ea-widgets.h"
-
-EA_FACTORY_GOBJECT (EA_TYPE_CALENDAR_ITEM, ea_calendar_item, ea_calendar_item_new)
-
-void e_calendar_item_a11y_init (void)
-{
- EA_SET_FACTORY (e_calendar_item_get_type (), ea_calendar_item);
-}
diff --git a/a11y/widgets/ea-widgets.h b/a11y/widgets/ea-widgets.h
deleted file mode 100644
index e9ec9b3ad9..0000000000
--- a/a11y/widgets/ea-widgets.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* vim:expandtab:shiftwidth=8:tabstop=8:
- */
-/* Evolution Accessibility: ea-widgets.h
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Bolian Yin <bolian.yin@sun.com> Sun Microsystem Inc., 2003
- *
- */
-
-/* Evolution Accessibility
-*/
-
-#ifndef _EA_WIDGETS_H__
-#define _EA_WIDGETS_H__
-
-void e_calendar_item_a11y_init (void);
-
-#endif /* _EA_WIDGETS_H__ */
diff --git a/acinclude.m4 b/acinclude.m4
deleted file mode 100644
index 63008b790d..0000000000
--- a/acinclude.m4
+++ /dev/null
@@ -1,182 +0,0 @@
-# evolution/acinclude.m4
-# shared configure.in hacks between Evolution and Connector
-
-# EVO_CHECK_LIB(dispname, pkgname, minvers[, maxvers])
-# Checks if the package with human-readable name @dispname, known
-# to gnome-config as @pkgname exists and has an appropriate version.
-# The version must be >= @minvers. If @maxvers is equal to @minvers,
-# it must be exactly that version. Otherwise, if @maxvers is set,
-# the version must be LESS THAN @maxvers (not less than or equal).
-AC_DEFUN(EVO_CHECK_LIB, [
- dispname="$1"
- pkgname="$2"
- minvers="$3"
- maxvers="$4"
-
- AC_MSG_CHECKING(for $dispname)
-
- if gnome-config --libs $pkgname > /dev/null 2>&1; then
- pkgvers=`gnome-config --modversion $pkgname | sed -e 's/^[[^0-9]]*//'`
- else
- pkgvers=not
- fi
- AC_MSG_RESULT($pkgvers found)
-
- pkgvers=`echo $pkgvers | awk -F. '{ print $[]1 * 1000000 + $[]2 * 10000 + $[]3 * 100 + $[]4;}'`
- cmpminvers=`echo $minvers | awk -F. '{ print $[]1 * 1000000 + $[]2 * 10000 + $[]3 * 100 + $[]4;}'`
- cmpmaxvers=`echo $maxvers | awk -F. '{ print $[]1 * 1000000 + $[]2 * 10000 + $[]3 * 100 + $[]4;}'`
- ok=yes
- if test "$pkgvers" -lt $cmpminvers; then
- ok=no
- elif test -n "$maxvers"; then
- if test "$pkgvers" -gt $cmpmaxvers; then
- ok=no
- elif test "$maxvers" != "$minvers" -a "$cmpmaxvers" -eq "$pkgvers"; then
- ok=no
- fi
- fi
- if test $ok = no; then
- case $maxvers in
- "")
- dispvers="$minvers or higher"
- ;;
- $minvers)
- dispvers="$minvers (exactly)"
- ;;
- *)
- dispvers="$minvers or higher, but less than $maxvers,"
- ;;
- esac
-
- AC_MSG_ERROR([
-""
-"You need $dispname $dispvers to build $PACKAGE"
-"If you think you already have this installed, consult the README."])
- fi
-])
-
-
-# EVO_PURIFY_SUPPORT
-# Add --enable-purify. If the user turns it on, subst PURIFY and set
-# the automake conditional ENABLE_PURIFY
-AC_DEFUN(EVO_PURIFY_SUPPORT, [
- AC_ARG_ENABLE(purify,
- [ --enable-purify=[no/yes] Enable support for building executables with Purify.],,enable_purify=no)
- AC_PATH_PROG(PURIFY, purify, impure)
- AC_ARG_WITH(purify-options, [ --with-purify-options=OPTIONS Options passed to the purify command line (defaults to PURIFYOPTIONS variable).])
- if test "x$with_purify_options" = "xno"; then
- with_purify_options="-always-use-cache-dir=yes -cache-dir=/gnome/lib/purify"
- fi
- if test "x$PURIFYOPTIONS" = "x"; then
- PURIFYOPTIONS=$with_purify_options
- fi
- AC_SUBST(PURIFY)
- AM_CONDITIONAL(ENABLE_PURIFY, test "x$enable_purify" = "xyes" -a "x$PURIFY" != "ximpure")
- PURIFY="$PURIFY $PURIFYOPTIONS"
-])
-
-
-# EVO_LDAP_CHECK(default)
-# Add --with-openldap and --with-static-ldap options. --with-openldap
-# defaults to the given value if not specified. If LDAP support is
-# configured, HAVE_LDAP will be defined and the automake conditional
-# ENABLE_LDAP will be set. LDAP_CFLAGS and LDAP_LIBS will be set
-# appropriately.
-AC_DEFUN(EVO_LDAP_CHECK, [
- default="$1"
-
- AC_ARG_WITH(openldap, [ --with-openldap=[no/yes/PREFIX] Enable LDAP support in evolution])
- AC_ARG_WITH(static-ldap, [ --with-static-ldap=[no/yes] Link LDAP support statically into evolution ])
- AC_CACHE_CHECK([for OpenLDAP], ac_cv_with_openldap, ac_cv_with_openldap="${with_openldap:=$default}")
- case $ac_cv_with_openldap in
- no|"")
- with_openldap=no
- ;;
- yes)
- with_openldap=/usr
- ;;
- *)
- with_openldap=$ac_cv_with_openldap
- LDAP_CFLAGS="-I$ac_cv_with_openldap/include"
- LDAP_LDFLAGS="-L$ac_cv_with_openldap/lib"
- ;;
- esac
-
- if test "$with_openldap" != no; then
- AC_DEFINE(HAVE_LDAP,1,[Define if you have LDAP support])
-
- case $with_static_ldap in
- no|"")
- with_static_ldap=no
- ;;
- *)
- with_static_ldap=yes
- ;;
- esac
-
- AC_CACHE_CHECK(if OpenLDAP is version 2.x, ac_cv_openldap_version2, [
- CPPFLAGS_save="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS $LDAP_CFLAGS"
- AC_EGREP_CPP(yes, [
- #include "ldap.h"
- #if LDAP_VENDOR_VERSION > 20000
- yes
- #endif
- ], ac_cv_openldap_version2=yes, ac_cv_openldap_version2=no)
- CPPFLAGS="$CPPFLAGS_save"
- ])
- if test "$ac_cv_openldap_version2" = no; then
- AC_MSG_ERROR(evolution requires OpenLDAP version >= 2)
- fi
-
- AC_CHECK_LIB(resolv, res_query, LDAP_LIBS="-lresolv")
- AC_CHECK_LIB(socket, bind, LDAP_LIBS="$LDAP_LIBS -lsocket")
- AC_CHECK_LIB(nsl, gethostbyaddr, LDAP_LIBS="$LDAP_LIBS -lnsl")
- AC_CHECK_LIB(lber, ber_get_tag, [
- if test "$with_static_ldap" = "yes"; then
- LDAP_LIBS="$with_openldap/lib/liblber.a $LDAP_LIBS"
-
- # libldap might depend on OpenSSL... We need to pull
- # in the dependency libs explicitly here since we're
- # not using libtool for the configure test.
- if test -f $with_openldap/lib/libldap.la; then
- LDAP_LIBS="`. $with_openldap/lib/libldap.la; echo $dependency_libs` $LDAP_LIBS"
- fi
- else
- LDAP_LIBS="-llber $LDAP_LIBS"
- fi
- AC_CHECK_LIB(ldap, ldap_open, [
- if test $with_static_ldap = "yes"; then
- LDAP_LIBS="$with_openldap/lib/libldap.a $LDAP_LIBS"
- else
- LDAP_LIBS="-lldap $LDAP_LIBS"
- fi],
- LDAP_LIBS="", $LDAP_LDFLAGS $LDAP_LIBS)
- LDAP_LIBS="$LDAP_LDFLAGS $LDAP_LIBS"
- ], LDAP_LIBS="", $LDAP_LDFLAGS $LDAP_LIBS)
-
- if test -z "$LDAP_LIBS"; then
- AC_MSG_ERROR(could not find OpenLDAP libraries)
- fi
-
- AC_SUBST(LDAP_CFLAGS)
- AC_SUBST(LDAP_LIBS)
- fi
- AM_CONDITIONAL(ENABLE_LDAP, test $with_openldap != no)
-])
-
-# EVO_PTHREAD_CHECK
-AC_DEFUN([EVO_PTHREAD_CHECK],[
- PTHREAD_LIB=""
- AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
- [AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
- [AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
- [AC_CHECK_LIB(pthread, __pthread_attr_init_system, PTHREAD_LIB="-lpthread",
- [AC_CHECK_FUNC(pthread_create)]
- )]
- )]
- )]
- )
- AC_SUBST(PTHREAD_LIB)
- AC_PROVIDE([EVO_PTHREAD_CHECK])
-])
diff --git a/addressbook/.cvsignore b/addressbook/.cvsignore
deleted file mode 100644
index 09980ae6ba..0000000000
--- a/addressbook/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-.deps
-.libs
-Makefile
-Makefile.in
-*.lo
-*.la
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
deleted file mode 100644
index a68d11b86c..0000000000
--- a/addressbook/ChangeLog
+++ /dev/null
@@ -1,2951 +0,0 @@
-2003-12-06 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-manager.c
- (open_book_cb): change prototype to fix warning, and change the
- comment to read load_source instead of load_uri (which isn't what
- we use anymore.)
- (update_completion_books): just use our source list for this.
- check the "completion" source property.
- (source_list_changed): recreate the completion books.
- (e_select_names_manager_init): connect to the source_list's
- changed signal.
- (e_select_names_manager_dispose): don't need to free the
- completion_uids list anymore.
-
- * gui/component/select-names/e-select-names-config.c
- (e_select_names_config_get_completion_books,
- e_select_names_config_set_completion_books,
- e_select_names_config_add_notification_completion_books): remove.
-
- * gui/component/select-names/e-select-names-config.h: remove the
- completion books calls, since we can just use the source list.
-
- * gui/component/component-factory.c (factory): create the
- autocompletion control.
-
- * gui/component/autocompletion-config.[ch]: new config control for
- selecting completion folders. Uses e-source-selector. Could
- probably be beautified a bit.
-
- * gui/component/Makefile.am (libevolution_addressbook_la_SOURCES):
- add autocompletion-config.[ch]
-
- * gui/component/GNOME_Evolution_Addressbook.server.in.in: remove
- the ldap config control server, and add the autocompletion one.
-
-2003-12-06 JP Rosevear <jpr@ximian.com>
-
- * */Makefile.am: Remove hard coded disable deprecated flags
-
-2003-12-05 JP Rosevear <jpr@ximian.com>
-
- * gui/component/select-names/select-names.glade: no more custom
- widget for the selection of the search source
-
- * gui/component/select-names/e-select-names.h: add member
-
- * gui/component/select-names/e-select-names.etspec: update model
- column
-
- * gui/component/select-names/e-select-names.c (find_first_source):
- find the first source in the list
- (addressbook_model_set_source): we have the source to set directly
- now
- (source_selected): listen for the source item to change
- (e_select_names_init): create a source option menu and hook it up
- (e_select_names_dispose): destroy the source list
- (e_select_names_new): do away with the config setup here
-
- * gui/component/select-names/e-select-names-manager.h: update
- members
-
- * gui/component/select-names/e-select-names-manager.c
- (update_completion_books): add books based on source uid
- (config_completion_books_changed_cb): handle the completion list
- changing
- (config_min_query_length_changed_cb): handle minimum query length
- changing
- (e_select_names_manager_new): we don't do the settings stuff here
- any more
- (e_select_names_manager_init): do the initial set up here for the
- book loaded and listen for changes
- (e_select_names_manager_dispose): destroy the new stuff
-
- * gui/component/select-names/e-select-names-config.[hc]: config
- information
-
- * gui/component/select-names/e-select-names-config-keys.h: the
- config keys
-
- * gui/component/select-names/e-select-names-bonobo.c
- (impl_SelectNames_activate_dialog): do away with the shell client
- stuff
-
- * gui/component/select-names/Makefile.am: build new files
-
-2003-12-05 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-model.c (book_view_loaded): call
- remove_book_view/free_data here as well, to guard against multiple
- book_view's being loaded.
-
-2003-12-05 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/widgets/e-addressbook-view.etspec: Clean up and sync with
- current model columns.
-
-2003-12-03 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook.c
- (retrieve_shell_view_interface_from_control): Remove.
- (set_folder_bar_label): Remove.
- (addressbook_new_control): Don't connect.
-
-2003-12-03 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-config.c: Do not depend on
- e-folder-list.
-
- * gui/component/select-names/e-select-names.c: Remove dependency
- on evolution-folder-selector-button.
- (e_addressbook_create_folder_selector): Just return a FIXME label
- for now.
- (folder_selected): #if 0 out.
- (e_select_names_init): Do not connect.
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_activate_dialog): Don't get a shell_client
- arg anymore.
- (load_completion_books): Stub out.
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_new): Don't get an EvolutionShellClient anymore.
- Don't create the folder selector button for now.
-
- * gui/component/select-names/e-select-names.h: Remove dependency
- on evolution-shell-client.
-
- * gui/component/select-names/e-select-names-bonobo.c: Remove
- dependency on evolution-shell-client.
- (impl_SelectNames_activate_dialog): Stub out.
-
- * gui/widgets/eab-gui-util.c: Remove dependency on
- evolution-shell-client.
- (eab_transfer_contacts): Stub out.
-
-2003-12-02 Rodney Dawes <dobey@ximian.com>
-
- * gui/component/Makefile.am: Version the schemas
- * gui/component/apps_evolution_addressbook.schemas: Removed
- * gui/component/apps_evolution_addressbook.schemas.in.in: Added
-
-2003-12-02 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook.c (set_status_message): Call
- e_activity_handler_operation_finished() on the current activity ID
- when done.
-
-2003-12-01 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook.c (struct AddressbookView): Replace
- activity_client with activity_id.
- (set_status_message): Use the EActivityHandler from the
- AddressbookComponent.
-
- * gui/component/addressbook-component.c (struct
- _AddressbookComponentPrivate): New member activity_handler.
- (addressbook_component_init): Init.
- (impl_dispose): Unref.
- (addressbook_component_peek_activity_handler): New.
- (impl_createControls): Return an ETaskBar as the statusbar control
- and attach it to the activity handler.
-
-2003-12-01 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-component.c (impl_createControls):
- Pass a label for the status bar control for now.
-
-2003-12-01 Larry Ewing <lewing@ximian.com>
-
- * gui/component/Makefile.am (INCLUDES): remove
- GTK_DISABLED_DEPRECATED so that we can build with gtk-2.3.
-
-2003-12-01 Rodney Dawes <dobey@ximian.com>
-
- * gui/component/GNOME_Evolution_Addressbook.server.in.in:
- * gui/component/addressbook-config.c:
- * gui/component/addressbook.c:
- * gui/component/component-factory.c:
- * gui/component/select-names/GNOME_Evolution_Addressbook_SelectNames.server.in.in:
- * gui/component/select-names/e-select-names-bonobo.c:
- * gui/component/select-names/e-select-names-factory.c:
- * gui/widgets/eab-gui-util.c:
- * gui/widgets/eab-vcard-control.c: Use BASE_VERSION for repo_ids and
- OAFIIDs
-
-2003-12-01 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/component/ldap-config.glade: Fix start page text.
-
-2003-12-01 JP Rosevear <jpr@ximian.com>
-
- * conduit/Makefile.am: use privconduitdir
-
- * conduit/e-address.conduit.in: subst right thing
-
-2003-12-01 JP Rosevear <jpr@ximian.com>
-
- * conduit/e-address.conduit.in: specify privlibdir as the location
-
- * conduit/Makefile.am: install the conduit to privlibdir
-
-2003-12-01 JP Rosvear <jpr@ximian.com>
-
- * conduit/Makefile.am: version the .conduit file
-
-2003-12-01 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/component/new-addressbook.glade: Remove this too.
-
- * gui/component/Makefile.am (glade_DATA): Remove new-addressbook.glade.
-
-2003-12-01 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/component/Makefile.am (libevolution_addressbook_la_SOURCES):
- Remove addressbook-storage.[ch] and new-addressbook.[ch].
-
- * gui/component/addressbook-storage.[ch]: Removed from repository.
-
- * gui/component/new-addressbook.[ch]: Removed from repository.
-
- * gui/component/addressbook-component.c (load_uri_for_selection):
- Set source_uid property on view control, not folder_uri.
- (new_addressbook_cb): Call addressbook_config_create_new_source ().
- (edit_addressbook_cb): Implement.
- (fill_popup_menu_callback): Hook up edit_addressbook_cb ().
- (addressbook_component_init): Create the LDAP source group.
-
- * gui/component/addressbook-config.c (AddressbookSourceDialog):
- Take out the NEW_ADVANCED_UI stuff and add ESource related vars.
- (ldap_unparse_auth)
- (ldap_parse_auth)
- (ldap_unparse_scope)
- (ldap_unparse_ssl)
- (ldap_parse_ssl): Moved here from addressbook-storage.c.
- (addressbook_dialog_get_source)
- (addressbook_dialog_set_source)
- (objectclasses_create_server_table)
- (objectclasses_create_evolution_table)
- (objectclasses_add_foreach)
- (objectclasses_add)
- (objectclasses_sever_double_click)
- (objectclasses_remove_foreach)
- (objectclasses_remove)
- (objectclasses_evolution_double_click)
- (objectclasses_restore_default)
- (server_selection_model_changed)
- (evolution_selection_model_changed)
- (setup_objectclasses_tab): Nuke aging, unfinished NEW_ADVANCED_UI.
- (add_source_clicked)
- (edit_source_clicked)
- (delete_server)
- (delete_source_clicked)
- (ldap_config_control_destroy_callback)
- (ldap_config_control_apply_callback)
- (sources_selection_changed)
- (sources_table_row_activated)
- (ldap_dialog_new)
- (addressbook_dialog_create_sources_table)
- (ldap_config_control_new)
- (addressbook_config_control_new): Nuke config control.
- (create_source_dir)
- (dialog_to_source)
- (dialog_to_temp_source)
- (source_to_uri_parts)
- (source_to_dialog)
- (source_group_changed_cb)
- (source_group_menu_add_groups)
- (folder_page_forward)
- (finish_page_back): Implement.
- (addressbook_ldap_init): Take ESource instead of AddressbookSource.
- (addressbook_ldap_auth): Don't take a source, not needed.
- (addressbook_root_dse_query): Ditto.
- (addressbook_source_dialog_destroy): Clean up destroy function.
- (addressbook_add_server_druid_finish): Clean up, create ESource.
- (general_tab_check): If it's not LDAP, these options don't matter.
- (do_ldap_root_dse_query): Source no longer needed here.
- (query_for_supported_bases): Use a temp source generated from
- current dialog settings.
- (display_name_page_prepare): Renamed to folder_page_prepare ().
- (druid_display_name_page_modify_cb): Renamed to
- druid_folder_page_modify_cb ().
- (addressbook_add_server_druid): Set up source list, group selector.
- Make LDAP pages optional, dependent on selected group. Use ESource.
- (edit_dialog_store_change): Remove config control list stuff,
- export settings to ESource.
- (addressbook_edit_server_dialog): Renamed to
- addressbook_config_edit_source (), which takes an ESource. Remove
- config control list stuff, make LDAP pages show up only if we have
- an LDAP source. Remove NEW_ADVANCED_UI cruft.
- (addressbook_config_create_new_source): Just call
- addressbook_add_server_druid ().
-
- * gui/component/addressbook-config.h: Move LDAP enums here, from
- addressbook-storage.h.
-
- * gui/component/addressbook.c (control_activate_cb): uri -> source
- (addressbook_view_clear): Unref source list.
- (book_open_cb): Use ESource.
- (load_uri_auth_cb): Renamed to load_source_auth_cb (), manipulate
- ESource instead of URI.
- (get_remember_password): Implement.
- (set_remember_password): Implement.
- (addressbook_authenticate): Use ESource properties.
- (load_uri_cb): Renamed to load_source_cb (), ESource adaptation.
- (addressbook_load_uri): Renamed to addressbook_load_source (), takes
- ESource.
- (addressbook_load_default_book): ESource adaptation.
- (get_prop): folder_uri property -> source_uid property.
- (set_prop): folder_uri property -> source_uid property. Find ESource
- by UID.
- (addressbook_new_control): Set up source_uid property and ESourceList.
-
- * gui/component/component-factory.c (factory): Disable config control.
-
- * gui/component/ldap-config.glade: Druid and notebook dialogs
- generalized to deal with local sources as well as LDAP. This file
- should probably be renamed...
-
- * gui/component/select-names/e-select-names-manager.c
- (load_completion_books): Use addressbook_load_source (). However, this
- needs a bit more work to get source UIDs instead of URIs.
-
- * gui/component/select-names/e-select-names.c
- (addressbook_model_set_uri): Use addressbook_load_source (). However,
- this needs a bit more work to get source UIDs instead of URIs.
-
-2003-11-26 JP Rosevear <jpr@ximian.com>
-
- * gui/widgets/Makefile.am: turn on deprecated gtk and libgnomeui
- stuff
-
- * gui/component/select-names/Makefile.am: turn on deprecated gtk
- stuff
-
- * gui/contact-editor/Makefile.am: ditto
-
-2003-11-17 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/component/addressbook-component.c (impl_createControls): Store
- a ref to the source selector.
- (impl_requestCreateItem): Implement.
- (impl_dispose): Unref the source selector.
- (addressbook_component_init): Set up default sources.
-
- * gui/widgets/e-addressbook-model.c (eab_model_set_property): If
- the 'book' property is set, and editability changes, emit a signal
- to that effect.
-
-2003-11-14 JP Rosevear <jpr@ximian.com>
-
- * gui/component/new-addressbook.c: include e-source from e-d-s
-
-2003-11-13 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/contact-list-editor/e-contact-list-model.c
- (contact_list_is_cell_editable): Return TRUE for all cells, for now.
-
- * gui/widgets/e-addressbook-table-adapter.c (card_modified_cb):
- Renamed to contact_modified_cb ().
- (addressbook_set_value_at): Port to use EContact instead of ECard.
- (addressbook_is_cell_editable): Ditto.
- (addressbook_append_row): Ditto.
-
- * gui/widgets/e-minicard-label.c (e_minicard_label_set_property):
- Make not editable, ever, and add a comment to this effect.
- (e_minicard_label_realize): Ditto.
-
- * gui/widgets/e-minicard.c (e_minicard_set_property): Ditto.
- (add_field): Ditto.
-
-2003-11-13 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-component.c
- (impl__get_userCreatableItems): New, implementation for the
- userCreatableItems property.
- (impl_requestCreateItem): New, implementation for the
- requestCreateItem method.
- (addressbook_component_class_init): Install.
-
-2003-11-12 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/GNOME_Evolution_Addressbook.server.in.in: Add
- component_alias of "contacts".
-
-2003-11-08 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/component/Makefile.am (libevolution_addressbook_la_SOURCES):
- Add new-addressbook.[ch].
- (glade_DATA): Add new-addressbook.glade.
-
- * gui/component/addressbook-component.c (add_popup_menu_item):
- Implement.
- (new_addressbook_cb): Implement.
- (delete_addressbook_cb): Implement (skeletal).
- (fill_popup_menu_callback): Implement.
- (impl_createControls): Hook up fill_popup_menu_callback().
-
- * gui/component/new-addressbook.[ch]: New files.
-
- * gui/component/new-addressbook.glade: New file.
-
-2003-11-07 Dan Winship <danw@ximian.com>
-
- * util/Makefile.am (INCLUDES): Remove some includes of directories
- that don't exist any more
-
-2003-11-07 JP Rosevear <jpr@ximian.com>
-
- * gui/contact-editor/Makefile.am: don't include the c marshaller
- file twice
-
- * gui/widgets/Makefile.am: ditto
-
-2003-11-07 JP Rosevear <jpr@ximian.com>
-
- * gui/widgets/Makefile.am: make sure the marshal header is in the
- source list
-
- * gui/component/select-names/Makefile.am: ditto
-
- * gui/contact-editor/Makefile.am: ditto
-
- * gui/contact-list-editor/Makefile.am: ditto
-
-2003-11-07 JP Rosevear <jpr@ximian.com>
-
- * util/Makefile.am: dist the marshal list
-
-2003-11-07 JP Rosevear <jpr@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (change_view_type): don't
- destroy the widget here - its dead when removed from the paned
- container
-
-2003-11-07 JP Rosevear <jpr@ximian.com>
-
- * In the gui this is a search and replace commit for moving the
- addressbook to evolution-data-server; it also deletes the old
- backend files
-
-2003-11-05 Larry Ewing <lewing@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (create_minicard_view): fix cast.
-
-2003-11-03 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/select-names/e-select-names-factory.c: Update
- factory ID.
-
- * gui/component/select-names/GNOME_Evolution_Addressbook_SelectNames.server.in.in:
- Version the SelectNames server IDs by appending a "_2".
-
-2003-11-03 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/GNOME_Evolution_Addressbook.server.in.in: Change
- "evolution:config_item" into "evolution2:config_item".
-
-2003-10-29 Chris Toshok <toshok@ximian.com>
-
- * gui/component/GNOME_Evolution_Addressbook.server.in.in: add the
- S/MIME config control here.
-
-2003-10-29 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book-listener.c (e_book_listener_new): change
- the poa hint to PER_REQUEST. fixes a couple of deadlocks.
-
-2003-10-29 Chris Toshok <toshok@ximian.com>
-
- * gui/component/component-factory.c (factory): ifdef the smime
- code with HAVE_NSS.
-
- * gui/component/Makefile.am (libevolution_addressbook_la_LIBADD):
- conditionally include libevolution-smime.la.
-
-2003-10-24 Dan Winship <danw@ximian.com>
-
- * backend/pas/Makefile.am (libpas_la_LIBADD): libpas should depend
- on libebook, but NOT on libpasfile, etc, since it needs to be
- linked into all backends, not just the wombat.
- (libpasfile_la_LIBADD): depend on libpas.la and libedb3util.la
- (libpasvcf_la_LIBADD): depend on libpas.la
- (libpasldap_la_LIBADD): depend on libpas.la and $(LDAP_LIBS)
-
-2003-10-23 Dan Winship <danw@ximian.com>
-
- * backend/ebook/e-contact.c (e_contact_date_equal): new util func
-
- * backend/pas/pas-backend-ldap.c (anniversary_compare,
- birthday_compare): Use it
-
- * backend/pas/pas-backend-summary.c
- (pas_backend_summary_check_contact): Check if an ID exists in the
- summary.
-
-2003-10-23 Chris Toshok <toshok@ximian.com>
-
- * tools/Makefile.am: convert 8 spaces to a tab.
-
- * tools/.cvsignore: ignore evolution-addressbook-abuse and
- evolution-addressbook-clean.
-
- * gui/component/Makefile.am (libevolution_addressbook_la_LIBADD):
- add libevolution-smime.la.
-
- * gui/component/component-factory.c (factory): add the certificate
- manager config control stuff here, at least for now.
-
- * gui/component/GNOME_Evolution_Addressbook.server.in.in: same.
-
-2003-10-23 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/component/addressbook-config.c
- (addressbook_dialog_create_source_table): fixed typo in variable name.
-
-2003-10-22 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/GNOME_Evolution_Addressbook.server.in.in: Add an
- "evolution:button_icon" attribute.
-
-2003-10-22 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/GNOME_Evolution_Addressbook.server.in.in: Add an
- "evolution:button_sort_order" property.
-
-2003-10-22 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-component.c (impl_createControls):
- Make the the scrolled window have an "in" shadow.
- * gui/component/addressbook-config.c
- (addressbook_dialog_create_sources_table): Likewise.
- * gui/widgets/e-addressbook-view.c (create_minicard_view): Likewise.
- (create_treeview_view): Likewise.
-
-2003-10-22 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-component.c (impl_createControls): Set
- the GtkScrolledWindow scrollbar policy to "automatic" for both the
- horizontal and the vertical scrollbar.
-
-2003-10-22 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/GNOME_Evolution_Addressbook.server.in.in: Add an
- "evolution:button_label" property on the component for use in the
- shell.
-
-2003-10-21 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c: make it work with the new ebook api
-
- * backend/pas/pas-book.c (pas_book_respond_get_changes): put the
- vcard in for every change
-
- * backend/pas/pas-backend.c (pas_backend_change_add_new): just use
- the vcard field
- (pas_backend_change_modify_new): ditto
- (pas_backend_change_delete_new): ditto
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_changes_foreach_key): create a fake contact with
- the uid
- (pas_backend_file_get_changes): add the card to the changes
-
- * backend/ebook/tests/ebook/test-changes.c (main): just print the
- uid
-
- * backend/ebook/e-book.c (e_book_free_change_list): unref the
- contact
-
- * backend/ebook/e-book-types.h: the change struct contains an
- EContact now
-
- * backend/ebook/e-book-listener.c
- (impl_BookListener_respond_get_changes): create the contact from
- the vcard string
-
- * backend/idl/addressbook.idl: Book change item is no longer a
- union, it always gives back a card
-
-2003-10-21 Chris Toshok <toshok@ximian.com>
-
- * tools/evolution-addressbook-abuse.c: use the synchronous api for
- this. simplifies it a bunch.
-
-2003-10-21 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-book.c
- (impl_GNOME_Evolution_Addressbook_Book_remove): we can ill afford
- bad debug spew.
- (view_listener_died_cb): implement.
- (impl_GNOME_Evolution_Addressbook_Book_getBookView): hook up an
- ORBit_small connection listener on the view's listener.
- (pas_book_respond_create): use e_contact_get_const instead of
- e_contact_get here. fixes a leak.
-
- * backend/pas/pas-book-view.c
- (impl_GNOME_Evolution_Addressbook_BookView_stop): implement, call
- pas_backend_stop_book_view.
- (pas_book_view_get_listener): return the book view's listener.
- (pas_book_view_class_init): fill in epv->stop.
- (pas_book_view_init): use a #define for THRESHOLD_MAX instead of
- the constant.
-
- * backend/pas/pas-book-view.h: add prototype for
- pas_book_view_get_listener.
-
- * backend/pas/pas-backend.c (pas_backend_stop_book_view):
- implement.
- (pas_backend_remove_book_view): implement.
-
- * backend/pas/pas-backend.h: add prototype for stop_book_view and
- remove_book_view.
-
- * backend/pas/pas-backend-vcf.c (load_file): pass in the fd and
- use fdopen here.
- (foreach_build_list): don't creat EContacts here, because we'll
- just be converting them back to vcards anyway.
- (save_file): use char*'s instead of EContacts, and split entries
- with 2 blank lines. Also, hold the lock over the entire function.
- (do_create): hold the lock around uid generation and touching the
- hash table.
- (pas_backend_vcf_process_remove_contacts): same.
- (pas_backend_vcf_process_modify_contact): same.
- (pas_backend_vcf_stop_book_view): new function, but leave
- unimplemented for now.
- (pas_backend_vcf_load_uri): the uri contains the directory name,
- not the filename.
- (pas_backend_vcf_dispose): grab the lock here just for sanity's
- sake. Also reorder things a bit, and free the hashtable and
- mutex.
- (pas_backend_vcf_init): init the mutex.
-
- * backend/pas/pas-backend-summary.c
- (pas_backend_summary_add_contact): don't unref the contact here.
-
- * backend/pas/pas-backend-ldap.c
- (pas_backend_ldap_process_stop_book_view): new function, but leave
- unimplemented for now.
-
- * backend/pas/pas-backend-file.c (build_summary): use an EContact
- for this call.
- (do_summary_query): nuke, the contents of this has been moved to
- start_book_view.
- (pas_backend_file_search_timeout): same.
- (pas_backend_file_search): same.
- (pas_backend_file_start_book_view): glom everything into here
- involving searching. This function could (and should) be renamed
- and reused from both this function and _get_contact_list.
- (pas_backend_file_stop_book_view): new function.
- (pas_backend_file_class_init): fill in backend->stop_book_view.
-
- * backend/pas/Makefile.am (LDAP_BACKEND): libpasldap.a ->
- libpasldap.la
- (noinst_LTLIBRARIES): *.a -> *.la.
- (libpas_la_SOURCES): same.
- (libpasfile_la_SOURCES): same.
- (libpasvcf_la_SOURCES): same.
- (libpasldap_la_SOURCES): same.
-
- * backend/idl/addressbook.idl: add BookView::stop.
-
- * backend/ebook/e-vcard.c (read_attribute_value): fix GString
- related leaks.
- (read_attribute_params): same.
- (parse): don't leak the EVCardAttributes corresponding to
- BEGIN/END:vCard.
- (free_gstring): new function
- (e_vcard_attribute_remove_values): free the decoded_values list,
- using free_gstring.
-
- * backend/ebook/e-book.c (e_book_response_get_book_view): ref the
- listener here.
-
- * backend/ebook/e-book-view.h: add prototype for e_book_view_stop.
-
- * backend/ebook/e-book-view.c (e_book_view_stop): new function.
-
- * backend/ebook/e-book-async.c (_get_book_view_response_dtor):
- unref the book view.
-
-2003-10-20 Dan Winship <danw@ximian.com>
-
- * backend/pas/pas-book-view.c: Queue up removes and modifies as
- well as adds, and remove the calls that took a list of changes
- rather than a single change, since no one was really using the
- list versions. Keep a list of IDs currently in the view so we can
- more easily figure out what changes count as adds, modifies, and
- removes.
- (send_pending_adds): Don't reset next_threshold if it's being
- called from notify_add.
- (send_pending_changes, send_pending_removes): New
- (pas_book_view_notify_update): Simplified add/change interface.
- Takes an EContact and figures out if it's new, modified, or
- removed relative to this view.
- (pas_book_view_notify_change, pas_book_view_notify_change_1,
- pas_book_view_notify_add, pas_book_view_notify_add_1): Gone.
- (pas_book_view_notify_remove): Now does what remove_1 used to do.
- (pas_book_view_vcard_matches): Remove this; no longer used.
-
- * backend/pas/pas-backend.c (pas_backend_notify_update): New.
- Calls pas_book_view_notify_update() on each of the backend's views.
- (pas_backend_notify_remove): Likewise for notify_remove().
- (pas_backend_notify_complete): And notify_complete().
-
- * backend/pas/pas-book.c (pas_book_respond_create): Take an
- EContact instead of an id and a vcard. Use
- pas_backend_notify_update.
- (pas_book_respond_remove_contacts): Use pas_backend_notify_remove.
- (pas_book_respond_modify): Take a single EContact instead of two
- vcards. Use pas_backend_notify_update.
-
- * backend/pas/pas-backend-sync.c
- (pas_backend_sync_create_contact): Return an EContact rather than
- an id.
- (pas_backend_sync_modify_contact): Return an EContact rather than
- the old_vcard.
- (_pas_backend_create_contact, _pas_backend_modify_contact): Update
-
- * backend/pas/pas-backend-file.c (do_summary_query): Use
- pas_book_view_notify_update.
- (pas_backend_file_search_timeout): Likewise
- (pas_backend_file_create_contact): Update for API changes
- (pas_backend_file_modify_contact): Likewise.
-
- * backend/pas/pas-backend-ldap.c (create_contact_handler,
- pas_backend_ldap_process_create_contact): Update for API changes
- (modify_contact_modify_handler, modify_contact_search_handler,
- pas_backend_ldap_process_modify_contact): Likewise
- (ldap_search_handler): Use pas_book_view_notify_update
-
- * backend/pas/pas-backend-vcf.c (foreach_search_compare): Use
- pas_book_view_notify_update.
- (pas_backend_vcf_process_create_contact): Update for API changes
- (pas_backend_vcf_process_modify_contact): Likewise
-
- * backend/pas/pas-backend-summary.c
- (pas_backend_summary_add_contact): Take an EContact instead of a
- const char *vcard.
-
- * backend/ebook/e-contact.c (photo_getter): s/malloc/g_malloc/
-
-2003-10-20 JP Rosevear <jpr@ximian.com>
-
- * backend/pas/pas-backend-vcf.c (pas_backend_vcf_search): compiler
- with non-c99 compilers
-
-2003-10-17 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-contact.c (fn_getter): new function, just return
- the full name value.
- (fn_setter): rather distasteful hack. set the N attribute if it's
- not already present.
- (n_setter): set the X-EVOLUTION-FILE-AS attribute if it's not
- already set.
-
- * backend/pas/pas-backend-ldap.c (prop_info): add PROP_WRITE_ONLY
- flag for properties (right now just 'sn') that we don't want to
- use when building the EContact - we only use it when storing the
- contact out to the ldap server.
- (build_contact_from_entry): skip WRITE_ONLY properties.
-
-2003-10-17 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (init_collection): add the
- minicard factory back in.
- (display_view): add the minicard case back in.
- (get_selection_model): same.
- (minicard_right_click): resurrect.
- (create_minicard_view): same.
- (change_view_type): add the minicard case back in.
- (eab_view_print): same.
- (eab_view_print_preview): same.
-
- * gui/widgets/e-addressbook-view.h (EABViewType): add MINICARD
- back in.
-
- * gui/widgets/e-addressbook-model.c (eab_model_new):
- E_TYPE_AB_MODEL -> EAB_TYPE_MODEL.
-
- * gui/widgets/e-addressbook-model.h: rename E_TYPE_AB_MODEL to
- EAB_TYPE_MODEL.
-
- * gui/widgets/Makefile.am (libeabwidgets_la_SOURCES): add the
- minicard stuff back into the build.
-
- * gui/widgets/e-addressbook-reflow-adapter.[ch],
- gui/widgets/e-minicard-label.[ch],
- gui/widgets/e-minicard-view-widget.[ch],
- gui/widgets/e-minicard-view.[ch], gui/widgets/e-minicard.[ch],
- gui/widgets/gal-view-factory-minicard.[ch], gal-view-minicard.h:
- resurrect the minicard stuff, in a new uneditable,
- EContact-friendly state. no in-place editing anymore.
-
-
-2003-10-10 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c (fill_in_info): un-ifdef
- the date handling code.
- (extract_info): same.
-
- * backend/pas/pas-backend-ldap.c (prop_info): add the address
- labels and dates to the build.
- (anniversary_populate): un-ifdef and get this working.
- (anniversary_ber): same.
- (anniversary_compare): same.
- (birthday_populate): same.
- (birthday_ber): same.
- (birthday_compare): same.
-
- * backend/ebook/tests/ebook/.cvsignore,
- backend/ebook/tests/ebook/Makefile.am
- backend/ebook/tests/ebook/test-date.c: add a test for EContactDate
- getting/setting.
-
- * backend/ebook/e-vcard.h: add EVC_BDAY.
-
- * backend/ebook/e-contact.h: add prototypes for the
- e_contact_date_* functions.
-
- * backend/ebook/e-contact.c (field_info): add
- BIRTH_DATE/ANNIVERSARY fields.
- (date_getter): new
- (date_setter): new
- (e_contact_date_new): new
- (e_contact_date_from_string): new
- (e_contact_date_to_string): new
- (e_contact_date_free): new
-
-2003-10-10 Not Zed <NotZed@Ximian.com>
-
- *
- gui/component/select-names/GNOME_Evolution_Addressbook_SelectNames.server.in.in:
- Use the main factory on the .so file, so it can be found.
-
-2003-10-08 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names.c (contact_key): add a
- descriptive comment about this "#if notyet".
-
- * gui/component/select-names/e-select-names-model.h
- (e_select_names_model_thaw): add prorotype for
- e_select_names_model_cancel_all_contact_load.
-
- * gui/component/select-names/e-select-names-bonobo.c
- (_EntryPropertyID): remove the SIMPLE_CARD_LIST property.
- (entry_get_property_fn): same.
- (impl_SelectNames_get_entry_for_section): same.
-
- * backend/ebook/e-contact.h: add prototype for
- e_contact_name_to_string.
-
-2003-10-07 Chris Toshok <toshok@ximian.com>
-
- * util/eab-book-util.c: remove a bunch of ifdef'ed code (that's
- going to be living in e-book.c)
-
- * backend/pas/pas-backend-summary.c
- (pas_backend_summary_add_contact): un-ifdef some code.
- (pas_backend_summary_get_summary_vcard): same.
-
- * backend/pas/pas-backend-ldap.c (prop_info): remove the
- query_prop field since we can get it from e_contact_field_name.
- also remove it from all the macros and their uses.
- (homephone_populate): un-ifdef.
- (homephone_ber): same.
- (homephone_compare): same.
- (business_populate): same.
- (business_ber): same.
- (business_compare): same.
- (query_prop_to_ldap): use e_contact_field_name to get the query
- prop for a given attribute.
- (add_oc_attributes_to_supported_fields): same.
-
- * backend/pas/pas-backend-card-sexp.c (compare_phone): use the new
- EContactField constants to iterate over the phone list.
-
- * backend/ebook/e-contact.h (EContactField): add some useful
- constants for those pieces of code that iterate over
- email/phones/addresses.
-
-2003-10-07 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/eab-vcard-control.c (book_open_cb): un-ifdef this.
- (eab_vcard_control_new): put the buttons above the vcard so they
- don't move when it's expanded.
-
- * gui/widgets/eab-popup-control.h: remove prototypes for
- eab_popup_control_set_name and eab_popup_control_set_email.
-
- * gui/widgets/eab-popup-control.c (email_table_ok_cb): remove the
- stupid idle function and do the work here.
- (eab_popup_control_set_name): make this static - noone uses it.
- (eab_popup_control_set_email): same.
-
- * gui/widgets/eab-gui-util.c (eab_show_contact_editor):
- e_contact_editor_new is what we use for the time being.
-
- * gui/widgets/eab-contact-display.c (render_string): abstract this
- code out.
- (render_url): same.
- (eab_contact_display_render_normal): make use of render_string and
- render_url.
-
- * gui/widgets/e-addressbook-view.c (delete): un-ifdef this and get
- it working.
- (selection_received): same.
-
- * gui/widgets/e-addressbook-model.c (get_view): nuke some code
- that was moved to another function.
- (eab_model_set_property): get the writable state when we set the
- book - don't rely on the timing of signals.
-
- * gui/contact/editor/contact-editor.glade: add the blog field
- below the homepage url field.
-
- * gui/contact/editor/e-contact-editor-address.[ch]: get this
- building with the new stuff.
-
- * gui/contact/editor/e-contact-editor-fullname.[ch]: get this
- building with the new stuff.
-
- * gui/contact-editor/e-contact-editor.[ch]: get this most of the
- way there.
-
- * gui/contact-editor/e-contact-quick-add.[ch]: get this building
- with the new stuff.
-
- * gui/contact-editor/Makefile.am (libecontacteditor_la_SOURCES):
- remove e-contact-save-as.[ch]. They're in
- addressbook/widgets/eab-gui-util.[ch] now.
-
- * gui/merging/Makefile.am: track all the naming changes.
-
- * gui/merging/*.glade: gratuitous renaming.
-
- * gui/merging/eab-contact-compare.[ch]: gratuitous renaming, and
- move this from the old ebook/
-
- * gui/merging/eab-contact-merging.[ch]: gratuitous renaming.
-
- * backend/ebook/e-contact.[ch]: lots of overly complicated changes
- for an overly complicated piece of code.
-
- * backend/ebook/e-book-view.c (e_book_view_do_added_event): remove
- some ifdef'ed code.
- (e_book_view_do_modified_event): same.
-
- * backend/ebook/e-vcard.c (parse): plug a memory leak.
- (escape_string): deal with @s being NULL.
- (e_vcard_remove_attribute): new function.
- (e_vcard_attribute_remove_params): same.
- (e_vcard_attribute_param_free): same.
- (e_vcard_attribute_param_remove_values): same.
-
- * backend/ebook/e-vcard.h: add prototypes for
- e_vcard_remove_attribute, e_vcard_attribute_remove_params, and
- e_vcard_attribute_param_remove_values.
-
- * backend/ebook/e-book.c (e_book_handle_response): cache the
- writable state of the ebook before generating the signal.
- (e_book_unload_uri): initialize cap to NULL and writable to FALSE.
-
- * backend/ebook/e-book.h: add prototype for e_book_is_writable.
-
- * backend/ebook/e-book-async.c (_get_fields_response_handler):
- don't call the callback if it's NULL.
- (_get_methods_response_handler): same.
- (_auth_user_response_handler): same.
- (_get_contact_response_handler): same.
- (_remove_contacts_response_handler): same.
- (_add_contact_response_handler): same.
- (_commit_contact_response_handler): same.
- (_get_book_view_response_handler): same.
- (_get_contacts_response_handler): same.
- (_remove_contacts_dtor): free the list.
- (e_book_async_remove_contacts): duplicate the list.
-
- * backend/pas/pas-backend.c (pas_backend_open): if we successfully
- load the uri, report the writable status back.
-
- * backend/pas/pas-backend-sync.c (_pas_backend_remove_contacts):
- free the list of ids.
-
- * backend/pas/pas-backend-file.c (do_create): return the contact
- we create here.
- (pas_backend_file_create_contact): format the newly created
- contact as a string to add to the summary.
- (pas_backend_file_remove_contacts): don't free the list of removed
- cards here - it happens in pas-backend-sync.
- (pas_backend_file_load_uri): pass NULL for @contact to do_create.
-
-2003-10-01 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/eab-contact-display.c (render_address): move the :'s
- inside the <b>'s. Thanks for pointing this out, guenther. :)
- (eab_contact_display_render_normal): same.
- (eab_contact_display_render_compact): same.
-
- * gui/widgets/eab-vcard-control.c (save_in_addressbook): track
- change to address_load_default_book.
-
-2003-10-01 Chris Toshok <toshok@ximian.com>
-
- * gui/component/Makefile.am: remove some commented out crap about
- e-address-popup.[ch].
-
- * gui/component/component-factory.c (factory): use
- eab_popup_control_new for the AddressPopup iid.
-
- * gui/widgets/Makefile.am (libeabwidgets_la_SOURCES): add
- eab-popup-control.[ch].
-
- * backend/ebook/e-book.c (e_book_get_default_addressbook): hack
- this so it at least sorta works - hardcode the
- ~/evolution/local/Contacts uri for now.
-
- * gui/component/addressbook.[ch] (addressbook_load_default_book):
- remove the EBook argument, and call
- e_book_async_get_default_addressbook.
-
- * gui/component/e-address-popup.[ch]: nuke.
-
- * gui/widgets/eab-popup-control.c: rename
- gui/component/e-address-popup.c to this.
-
- * gui/widgets/eab-popup-control.h: rename
- gui/component/e-address-popup.h to this.
-
- * backend/ebook/e-book-async.h: add prototype for
- e_book_async_get_default_addressbook.
-
- * backend/ebook/e-book-async.c
- (e_book_async_get_default_addressbook): new function.
-
-2003-10-01 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (eab_view_new): create the
- scrolled window to embed the EABContactDisplay widget inside of.
-
- * gui/widgets/e-addressbook-view.h (struct _EABView): add scrolled;
-
- * gui/widgets/eab-contact-display.h: add
- EABContactDisplayRenderMode enum, and add @render_mode arg to
- eab_contact_display_render.
-
- * gui/widgets/eab-contact-display.c
- (eab_contact_display_render_compact): new function, render a
- compact format suitable for inclusion in the mail display.
- (eab_contact_display_render_normal): move the previouw contents of
- eab_contact_display_render here.
- (eab_contact_display_render): render in either compact or normal
- mode depending on @mode.
- (eab_contact_display_new): remove the scrolled window stuff from
- here, as in the compact mode we don't want it present. push it up
- into the e-addressbook-view.c code.
-
- * gui/widgets/eab-vcard-control.[ch]: bonobo control that wraps up
- the EABContactDisplay stuff and lets us display vcards in a pretty
- format in mail messages.
-
- * gui/component/component-factory.c (factory): replace the #if
- notyet'ed minicard control code with the new vcard control.
-
- * gui/component/Makefile.am (INCLUDES): remove gui/minicard.
-
- * gui/component/GNOME_Evolution_Addressbook.server.in.in: remove
- the MiniCard_Control iid, and replace it with VCard_Control.
-
-2003-10-01 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-component.c
- (destination_folder_handle_drop): use
- eab_contact_list_from_string, and un-"#if notyet" this.
-
- * gui/component/addressbook.c: remove #include
- "e-contact-save-as.h"
-
- * gui/contact-list-editor/e-contact-list-editor.c
- (file_save_as_cb): use eab_contact_save.
- (file_send_as_cb): use eab_send_contact, un-"#if notyet" this.
- (file_send_to_cb): same.
- (table_drag_data_received_cb): use eab_contact_list_from_string.
-
- * gui/widgets/e-addressbook-reflow-adapter.[ch]: nuke. last
- vestiges of the minicard view.
-
- * gui/widgets/e-addressbook-view.c (eab_view_init):
- s/clipboard_cards/cliboard_contacts.
- (eab_view_dispose): same.
- (get_contact_list_1): s/card/contact
- (get_contact_list): same.
- (save_as): same, and use eab_contact_list_save.
- (send_as): reenable this code, s/card/contact, and use
- eab_send_contact_list.
- (send_to): same.
- (print): s/card/contact.
- (delete): same.
- (new_card): same, and un-"#if notyet" some code.
- (selection_get): use eab_contact_list_to_string.
- (selection_clear_event): s/card/contact
- (selection_received): same.
- (get_selected_contacts): same.
- (eab_view_save_as): same, and use eab_contact_list_save.
- (eab_view_view): same, and use eab_show_multiple_contacts.
- (eab_view_send): reenable this code, s/card/contact, and use
- eab_send_contact_list.
- (eab_view_send_to): same.
- (eab_view_copy): s/card/contact.
- (view_transfer_contacts): same.
- (eab_view_copy_to_folder): same.
- (eab_view_move_to_folder): same.
-
- * gui/widgets/e-addressbook-view.h (struct _EABView): rename
- clipboard_cards to clipboard_contacts.
-
- * gui/widgets/eab-gui-util.c (view_contacts): un-"#if notyet"
- (file_exists): moved from e-contact-save-as.c
- (save_it): same.
- (close_it): same.
- (destroy_it): same.
- (make_safe_filename): same.
- (eab_contact_save): same, and renamed from e_contact_save_as.
- (eab_contact_list_save): same, and renamed from
- e_contact_list_save_as.
- (contact_deleted_cb): s/card/contact.
- (do_delete): same, and use e_book_async.
- (delete_contacts): s/card/contact.
- (process_unref): same.
- (contact_added_cb): same.
- (do_copy): same, and use e_book_async.
- (got_book_cb): same.
- (eab_transfer_contacts): same, and use e_book_async.
- (eab_send_contact_list): s/card/contact
- (eab_send_contact): same.
-
- * gui/widgets/eab-gui-util.h: some random s/card/contact work, and
- move the contents of e-contact-save-as.h here.
-
- * util/eab-book-util.c (eab_contact_list_from_string): rename
- eab_load_contacts_from_string to this.
- (eab_contact_list_to_string): new function.
-
- * util/eab-book-util.h: add prototype for
- eab_contact_list_to_string, and rename
- eab_load_contacts_from_string to eab_contact_list_from_string.
-
- * gui/contact-editor/e-contact-save-as.[ch]: nuke. the contents
- of these files has been wrapped up in
- gui/widgets/eab-gui-util.[ch].
-
-2003-09-30 Chris Toshok <toshok@ximian.com>
-
- * gui/component/Makefile.am (libevolution_addressbook_la_LIBADD):
- add libecontactlisteditor.la back into the build.
-
- * gui/component/addressbook-component.c (new_item_cb): enable the
- contact list editor portion.
-
- * util/eab-book-util.c (eab_load_contacts_from_string): new
- function, return a GList of EContact*'s parsed from the string.
-
- * util/eab-book-util.h: add prototype for
- eab_load_contacts_from_string.
-
- * gui/contact-list-editor/contact-list-editor.glade: set the id of
- the list-image widget.
-
- * gui/contact-list-editor/e-contact-list-editor.c
- (e_contact_list_editor_class_init): PROP_CARD -> PROP_CONTACT.
- (e_contact_list_editor_init): initialize image_buf to null and
- card -> contact. also, hook up the dnd signals on the list_image
- widget so we can drop images.
- (e_contact_list_editor_dispose): free the image_buf.
- (list_added_cb): card -> contact.
- (list_modified_cb): same.
- (save_contact): same, and use the ebook-async api.
- (prompt_to_save_changes): card -> contact.
- (file_save_cb): same.
- (file_save_as_cb): same.
- (file_send_as_cb): #if notyet for now.
- (file_send_to_cb): same.
- (tb_save_and_close_cb): card -> contact.
- (list_deleted_cb): same.
- (delete_cb): same.
- (delete_cb): same, and use ebook-async.
- (e_contact_list_editor_new): card -> contact.
- (e_contact_list_editor_set_property): same.
- (table_drag_motion_cb): use GDK_POINTER_TO_ATOM instead of
- casting.
- (table_drag_data_received_cb): use eab_load_contacts_from_string,
- and card -> contact.
- (set_image_from_data): new function. create a pixbuf from the
- image data and composite it in an image that's the same size as
- the initial list_image widget.
- (image_drag_motion_cb): new function.
- (image_drag_drop_cb): new function.
- (image_drag_data_received_cb): new function.
- (extract_info): port to EContact, and add support for the image.
- (fill_in_info): same.
-
- * gui/contact-list-editor/e-contact-list-editor.h (struct
- _EContactListEditor): add image stuff, and ECard -> EContact.
-
- * gui/contact-list-editor/e-contact-list-model.c
- (contact_list_value_at): e_destination -> eab_destination.
- (e_contact_list_model_init): same.
- (e_contact_list_model_add_destination): same.
- (e_contact_list_model_add_email): same.
- (e_contact_list_model_add_contact): same, and card -> contact.
- (e_contact_list_model_remove_row): e_destination ->
- eab_destination.
- (e_contact_list_model_get_destination): same.
-
- * gui/contact-list-editor/e-contact-list-model.h: card -> contact,
- and e-destination -> eab-destination.
-
- * gui/widgets/e-addressbook-view.etspec: fix a couple of
- fields.. this needs a completely once-over at some point soon.
-
- * gui/widgets/e-addressbook-view.c (table_double_click): reenable
- all of this.
-
- * gui/widgets/eab-contact-display.c (render_address): use
- e_text_to_html to convert the \n's to <br>'s.
- (on_url_requested): get PHOTO if there is one, otherwise LOGO.
- (eab_contact_display_render): escape all the text we're sending to
- gtkhtml with e_text_to_html. also, if it's a contact list, output
- _("List Members") with the contents of _EMAIL.
-
- * gui/widgets/eab-gui-util.h: rename eab_send_card{_list} to
- eab_send_contact{_list}.
-
-2003-09-30 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/tests/ebook/Makefile.am (noinst_PROGRAMS): add
- test-string.
-
- * backend/ebook/tests/ebook/test-string.c: test setting/getting a
- string attribute.
-
- * backend/ebook/e-contact.c (photo_setter): do gnome-vfs mime type
- sniffing before we set the attribute value.
- (e_contact_set_property): implement setting of MULTI list
- attributes (like MAIL).
- (e_contact_get_property): rework the ATTR_TYPE attribute handling
- so we aren't calling g_value_set_pointer on a value that holds a
- string (and vice versa).
-
- * backend/ebook/e-vcard.c (e_vcard_remove_attributes): implement.
- (e_vcard_attribute_add_param): use g_ascii_strcasecmp.
-
- * backend/ebook/e-vcard.h: rename e_vcard_remove_attribute to
- e_vcard_remove_attributes, since it removes all matching
- attributes.
-
- * backend/ebook/e-book.c (e_book_response_add_contact): we need to
- strdup the id here since the listener frees it.
- (e_book_handle_response): implement the WritableStatusEvent part
- of the switch.
-
- * backend/ebook/e-book-listener.c
- (impl_BookListener_report_writable): un-"#if notyet" this.
-
- * backend/ebook/e-book-async.c (_add_contact_handler): fill in
- response->id.
-
-2003-09-29 Chris Toshok <toshok@ximian.com>
-
- * printing/e-contact-print-envelope.c: card -> contact.
-
- * printing/e-contact-print-envelope.h: card -> contact.
-
- * printing/e-contact-print.c: card -> contact.
-
- * printing/e-contact-print.h: card -> contact.
-
- * printing/Makefile.am (contact_print_test_LDADD): add
- libeabutil.la and reorder things so it links.
- (contact_print_style_editor_test_LDADD): same.
-
-2003-09-29 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-text-model.c:
- e-addressbook-util.h -> eab-gui-util.h.
-
- * gui/component/select-names/e-select-names-popup.c:
- e-addressbook-util.h -> eab-gui-util.h.
-
- * gui/component/e-address-popup.c: e-addressbook-util.h ->
- eab-gui-util.h.
-
- * gui/component/component-factory.c: #if notyet the minicard
- control stuff, since it's been completely nuked from the tree.
-
- * gui/component/addressbook.c: e-addressbook-util.h ->
- eab-gui-util.h.
-
- * gui/component/addressbook-component.c: e-addressbook-util.h ->
- eab-gui-util.h.
-
- * gui/component/Makefile.am (libevolution_addressbook_la_LIBADD):
- rename libeminicard to libeabwidgets.
-
- * Makefile.am (SUBDIRS): add util/ to the build.
-
-2003-09-29 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-treeview-adapter.c:
- e-addressbook-util.h -> eab-gui-util.h, and convert some
- EDestination code to EABDestination.
-
- * gui/widgets/e-addressbook-table-adapter.c: e-addressbook-util.h
- -> eab-gui-util.h, and include util/eab-destination.h.
- (addressbook_value_at): un-#if 0 some code.
-
- * gui/widgets/e-addressbook-model.c: e-addressbook-util.h ->
- eab-gui-util.h
-
- * gui/widgets/e-addressbook-view.c: e-addressbook-util.h ->
- eab-gui-util.h
-
- * gui/widgets/e-minicard-control.c,
- gui/widgets/e-minicard-control.h, gui/widgets/e-minicard-label.c,
- gui/widgets/e-minicard-label.h,
- gui/widgets/e-minicard-view-widget.c,
- gui/widgets/e-minicard-view-widget.h,
- gui/widgets/e-minicard-view.c, gui/widgets/e-minicard-view.h,
- gui/widgets/e-minicard-widget-test.c,
- gui/widgets/e-minicard-widget.c, gui/widgets/e-minicard-widget.h,
- gui/widgets/e-minicard.c, gui/widgets/e-minicard.h,
- test-minicard-label.c, test-minicard-view.c, test-minicard.c: nuke
- all of the old minicard stuff.
-
- * gui/widgets/eab-gui-util.[ch]: rename e-addressbook-util.[ch] to
- this and nuke e-addressbook-util.[ch].
-
- * gui/widgets/Makefile.am (INCLUDES): change G_LOG_DOMAIN to
- eab-widgets, and add -I$(top_srcdir)/addressbook.
- (noinst_LTLIBRARIES): rename to libeabwidgets.la
- (libeabwidgets_la_SOURCES): rename e-addressbook-util.[ch] to
- eab-gui-util.[ch].
-
-2003-09-29 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/eab-contact-display.c (eab_contact_display_new):
- track change from E_TYPE_AB_CONTACT_DISPLAY to
- EAB_TYPE_CONTACT_DISPLAY.
-
- * gui/widgets/eab-contact-display.h: change from E_* type foo to
- EAB_* type foo.
-
-2003-09-29 Chris Toshok <toshok@ximian.com>
-
- * gui/search/e-addressbook-search-dialog.[ch]: convert everything
- from e_addressbook_search_dialog to eab_search_dialog, and
- EAddressbookSearchDialog to EABSearchDialog.
-
- * gui/component/addressbook.c (search_cb):
- e_addressbook_search_dialog -> eab_search_dialog.
- (addressbook_search_activated): same.
- (addressbook_query_changed): same.
-
-2003-09-29 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-book.c (pas_book_respond_get_supported_fields):
- don't free the fields here - the backends hold onto them.
- (pas_book_respond_get_supported_auth_methods): don't free the
- auth_methods here - the backends hold onto them.
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_get_supported_fields): fields go from 1 to
- E_CONTACT_FIELD_LAST, not 0.
-
-2003-09-29 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c: e-book-util.h -> eab-book-util.h
-
- * gui/component/addressbook-component.c: e-book-util.h ->
- eab-book-util.h.
- (new_item_cb): enable the contact editor portion of this.
- (user_create_new_item_cb): convert to async_load_uri api, and
- ifdef the _use_default_book crap.
- (ensure_completion_uris_exist): e_book_get_config_database ->
- eab_get_config_database.
-
- * gui/component/e-address-widget.h: e-book-util.h ->
- eab-book-util.h.
-
- * gui/component/Makefile.am (libevolution_addressbook_la_LIBADD):
- add selectnames back in, and add util/libeabutil.la.
-
-2003-09-29 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-contact.c: my head explodes from so many
- changes.
-
- * backend/ebook/e-contact.h: reorder fields such that all the
- string fields are first in the enum (and add a
- E_CONTACT_LAST_SIMPLE_STRING value, ala the old e-card-simple
- stuff.) Also, add E_CONTACT_LOGO, WANTS_HTML, IS_LIST, and
- LIST_SHOW_ADDRESSES. remove E_CONTACT_PHOTO_URI.
-
- * backend/ebook/e-vcard.c (e_vcard_remove_attribute): rename from
- e_card_remove_attribute, and add a g_assert_not_reached.
- (_evc_base64_encode_simple): make this not static (we need it for
- a test.)
- (_evc_base64_decode_simple): same.
-
- * backend/ebook/e-vcard.h: add LOGO, X-MOZILLA-HTML,
- X-EVOLUTION-LIST, and X-EVOLUTION-LIST-SHOW_ADDRESSES #defines.
-
- * backend/ebook/e-book.c (EBookLoadState): change from
- UriNotLoaded to E_BOOK_URI_NOT_LOADED, etc.
- (e_book_add_contact): track _URI_ change.
- (e_book_get_supported_fields): same.
- (e_book_get_supported_auth_methods): same.
- (e_book_authenticate_user): same.
- (e_book_get_contact): same.
- (e_book_response_get_contact): remove the ifdefed call to
- e_contact_set_book.
- (e_book_remove_contacts): track _URI_ change.
- (e_book_get_book_view): same.
- (e_book_get_contacts): same.
- (e_book_get_changes): same.
- (e_book_remove): same.
- (e_book_unload_uri): same.
- (e_book_load_uri): same.
- (e_book_load_uri): same.
- (e_book_get_self): start the implementation of this.
- (e_book_get_default_addressbook): ifdef out a possible
- implementation of this (it's broken.)
- (e_book_init): track _URI_ change.
- (e_book_dispose): same.
-
- * backend/ebook/e-book.h: move get_default_addressbook out of the
- ifdef, and change get_default_addressbook/get_addressbooks to be
- more like the rest of the api.
-
- * backend/ebook/e-book-util.[ch]: nuke.
-
- * backend/ebook/e-card-compare.[ch]: nuke.
-
- * backend/ebook/e-destination.[ch]: nuke.
-
- * backend/ebook/e-book-query.c (func_and): fix valgrind error.
- (func_or): same.
-
- * backend/ebook/e-book-listener.h: drop #include of e-list.h
-
- * backend/ebook/e-book-async.c (_get_contacts_response_handler)
- (_get_contacts_response_dtor, _get_contacts_handler)
- (_get_contacts_dtor, e_book_async_get_contacts): new functions,
- implementing e_book_async_get_contacts.
-
- * backend/ebook/e-book-async.h: add e_book_async_get_contacts.
-
-2003-09-29 Chris Toshok <toshok@ximian.com>
-
- * util/eab-marshal.list: new file.
-
- * util/eab-destination.[ch]: rename
- backend/ebook/e-destination.[ch] to this, and change all the entry
- point names too.
-
- * util/eab-book-util.[ch]: rename backend/ebook/e-book-util.[ch]
- to this, and change all the entry point names too.
-
- * util/Makefile.am: new file, build libeabutil.la
-
-2003-09-29 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (addressbook_model_set_uri): e_addressbook_model -> eab_model.
- (contact_key): e-contactify this, and remove the call to
- e_contact_get_book since we don't have it.
- (sync_one_model): card -> contact.
- (real_add_address_cb): track various name changes.
- (esn_get_key_fn): same.
- (e_addressbook_create_ebook_table): same.
- (folder_selected): same.
- (select_entry_changed): same.
- (e_select_names_new): same.
-
- * gui/component/select-names/e-select-names-text-model.c
- (dump_model): s/card/contact.
- (e_select_names_text_model_insert_length): e-destination ->
- eab-destination.
- (e_select_names_text_model_delete): same.
- (e_select_names_text_model_obj_count): same.
- (nth_obj_index): same.
- (e_select_names_text_model_activate_obj): ifdef this out since we
- don't have e_contact_get_book in the new api.
-
- * gui/component/select-names/e-select-names-table-model.c
- (fill_in_info): convert to e_contact/eab_destination.
-
- * gui/component/select-names/e-select-names-popup.c
- (change_email_num_cb): e_destination -> eab_destination.
- (populate_popup_contact): same, and ECard -> EContact. Also, the
- email attribute is a GList, not an EList. lastly, rename from
- populate_popup_card.
- (populate_popup_nocontact): same, and rename from
- populate_popup_nocard.
- (e_select_names_populate_popup): same.
-
- * gui/component/select-names/e-select-names-model.h: track changes
- to e_destination, and rename the cardify methods to something mode
- descriptive.
-
- * gui/component/select-names/e-select-names-model.c
- (e_select_names_model_duplicate): e_destination ->
- eab_destination.
- (e_select_names_model_get_textification): same.
- (e_select_names_model_get_address_text): same.
- (e_select_names_model_get_destination): same.
- (e_select_names_model_export_destinationv): same.
- (send_changed): same.
- (e_select_names_model_import_destinationv): same.
- (e_select_names_model_get_contact): same, and rename from
- _get_card
- (e_select_names_model_get_string): same.
- (connect_destination): same.
- (disconnect_destination): same.
- (e_select_names_model_contains): same.
- (e_select_names_model_insert): same.
- (e_select_names_model_append): same.
- (e_select_names_model_replace): same.
- (e_select_names_model_delete): same.
- (e_select_names_model_clean): same.
- (delete_all_iter): same.
- (e_select_names_model_overwrite_copy): same.
- (e_select_names_model_merge): same.
- (e_select_names_model_name_pos): same.
- (e_select_names_model_text_pos): same.
- (e_select_names_model_cardify): nuke.
- (e_select_names_model_uncardify): nuke.
- (e_select_names_model_cancel_cardify): nuke.
- (e_select_names_model_load_all_contacts): rename _cardify_all to
- this.
- (e_select_names_model_cancel_all_contact_load): rename
- _cancel_cardify to this.
-
- * gui/component/select-names/e-select-names-manager.c
- (focus_in_cb): cancel_cardify_all -> cancel_all_contact_load
- (focus_out_cb): cardify_all -> load_all_contacts.
- (completion_popup_cb): same.
- (load_completion_books): no e_book_expand_uri anymore.
- (e_select_names_manager_new): e_book_get_config_database ->
- eab_get_config_database.
- (e_select_names_manager_dispose): same.
-
- * gui/component/select-names/e-select-names-completion.h: e-book.h
- -> e-book-async.h
-
- * gui/component/select-names/e-select-names-completion.c:
- EContactify this.
-
- * gui/component/select-names/e-select-names-bonobo.c
- (entry_get_property_fn): ifdef out the SIMPLE_CARD_LIST getter,
- and cardify_all -> load_all_contacts.
-
- * gui/component/select-names/Evolution-Addressbook-SelectNames.idl:
- nuke all the SimpleCard stuff. It's a horribly inefficient way to
- deal with vcards, and since ebook is platform level now, we can
- (and should) promote just linking to ebook to do this.
-
-2003-09-19 Gilbert Fang <gilbert.fang@sun.com>
-
- * addressbook/gui/component/addressbook-component.c (xfer_folder):
- remove the "addressbook.db.summary" correctly. #48538
-
-2003-09-11 Dan Winship <danw@ximian.com>
-
- * backend/ebook/Makefile.am (privlib_LTLIBRARIES): Remove
- libebook-static.la
-
- * conduit/Makefile.am (libeaddress_conduit_la_LIBADD): Use
- non-static versions of libraries: the static ones were only needed
- for libtool 1.3.
-
-2003-09-07 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-contact.c (e_contact_get_property): implement
- getters for the address labels. they aren't really synthetic, but
- we can't handle them as normal strings because they switch off the
- TYPE parameter, not the attribute name (go go vcard.) Also add
- getters for the structured address fields (ADR). Also fix a spot
- where we were using strcmp instead of strcasecmp.
- (e_contact_address_free): new function.
-
- * backend/ebook/e-contact.h: Add EContactAddress structure, which
- will probably go away once i merge in my cool spiffy address
- editor. Add LABEL fields for the address labels, and add
- prototype for e_contact_address_free.
-
- * backend/ebook/e-vcard.h: add EVC_LABEL and EVC_X_BLOG_URL.
-
- * backend/ebook/e-vcard.c (read_attribute_value): step to the next
- character after unescaping \-escaped characters. keeps commas
- from multiplying.
-
- * gui/widgets/eab-contact-display.c (render_address): new function
- (eab_contact_display_render): display email, delivery addresses,
- and the blog url.
-
-2003-09-06 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-contact.c (e_contact_set_property): implement
- E_CONTACT_EMAIL_*.
-
- * backend/pas/pas-backend-ldap.c (email_ber): EContact-ify and
- re-enable this code.
- (email_compare): same.
- (email_populate): same.
-
- * backend/pas/pas-backend-vcf.c (pas_backend_vcf_load_uri): use
- XIMIAN_VCARD.
-
- * backend/pas/pas-backend-file.c (pas_backend_file_load_uri): use
- XIMIAN_VCARD, and don't fail if the directory already exists.
- just try to create the db anyway.
-
- * backend/pas/Makefile.am (libpas_a_SOURCES): add ximian-vcard.h
-
- * backend/pas/ximian-vcard.h (XIMIAN_VCARD): put the initial vcard
- here, so we can share 1 #define between file/vcf backends. Also,
- add a jpeg photo.
-
-2003-09-06 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/Makefile.am (libeminicard_la_SOURCES): add
- eab-contact-display.[ch]
-
- * gui/widgets/e-addressbook-view.c (eab_view_init): just init
- everything to NULL.
- (eab_view_new): move a bunch of stuff that was in eab_view_init
- here. create a vpaned to hold the contact display, and create the
- contact display.
- (render_contact): render the selected contact to the
- contact_display.
- (selection_changed): add logic to display the currently selected
- contact in the preview pane.
- (create_table_view): add the table to the paned.
- (create_treeview_view): add the scrolled to the paned.
- (change_view_type): remove view->widget from the paned.
-
- * gui/widgets/e-addressbook-view.h: switch from using a GtkTable
- to a GtkEventBox - we don't need the table logic anymore.
-
- * gui/widgets/e-addressbook-model.c (create_contact): indent
- (eab_model_get_contact): same.
-
- * gui/widgets/eab-contact-display.[ch]: new files - this
- implements the preview pane.
-
-2003-09-06 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (BINARY_PROP): new type of
- property, for specifying data coming back from the ldap server
- with both data/length (like photos).
- (photo_populate): set the contact's photo.
- (build_contact_from_entry): add PROP_TYPE_BINARY handling.
-
- * backend/ebook/e-vcard.c (EVCardEncoding): new enum for use with
- the ENCODING attribute parameter. Right now, just "raw",
- "base64", and "quoted-printable".
- (struct _EVCardAttribute): add a "decoded_values" list of
- GString*'s, as well as fields to hold encoding/encoding_set.
- (e_vcard_class_init): call _evc_base64_init.
- (e_vcard_attribute_add_value_decoded): based on what encoding the
- attribute uses, add the value properly.
- (e_vcard_attribute_add_param): if the parameter is ENCODING, work
- our magic.
- (e_vcard_attribute_get_values_decoded): spit out properly decoded
- values depending on the decoding type.
- (_evc_base64*): copy the camel base64 routines here.
-
- * backend/ebook/e-vcard.h: add prototypes for
- e_vcard_attribute_add_value_decoded and
- e_vcard_attribute_get_values_decoded.
-
- * backend/ebook/e-contact.c (e_contact_get_first_attr): move this
- to above _set_property so we can make use of it there.
- (e_contact_set_property): fix up the generic STRING field handler,
- and implement E_CONTACT_PHOTO setting.
- (e_contact_get_property): add handling for
- E_CONTACT_PHOTO/E_CONTACT_PHOTO_URI.
- (e_contact_photo_free): new function.
-
- * backend/ebook/e-contact.h: add EContactPhoto struct, a prototype
- for e_contact_photo_free, and two new EContactField elements (PHOTO and
- PHOTO_URI).
-
- * backend/ebook/tests/ebook/.cvsignore: ignore test-photo
-
- * backend/ebook/tests/ebook/Makefile.am (noinst_PROGRAMS): add test-photo
-
- * backend/ebook/tests/ebook/test-photo.c: test for the photo
- set/get routines (which do base64 encoding/decoding).
-
-2003-09-02 Chris Toshok <toshok@ximian.com>
-
- * gui/component/Makefile.am: comment out a buncha stuff just to
- get this building.
-
- * gui/component/select-names/e-select-names.c: #include
- e-book-async.h
- (search_result): EAddressbookModel -> EABModel.
- (addressbook_model_set_uri): same, and don't use
- e_book_expand_uri, as it's dead.
- (esn_get_key_fn): EAddressbookModel -> EABModel.
- (e_addressbook_create_ebook_table): same.
- (status_message): same.
-
- * gui/component/select-names/e-select-names.h (struct
- _ESelectNames): EAddressbookModel -> EABModel.
-
- * gui/component/addressbook-component.c (new_item_cb): ifdef out
- for now.
- (dnd_drop_book_open_cb): s/card/contact.
- (destination_folder_handle_drop): ifdef out.
- (request_quit): same.
-
- * gui/component/addressbook.c: track api changes - e_addressbook_
- -> eab_, and e_book_* becomes e_book_async_*.
-
- * gui/component/addressbook.h: #include e-book-async.h
-
- * gui/component/e-address-widget.c (query_results_cb):
- e/EBookSimpleQueryStatus/EBookStatus
-
- * gui/component/e-address-widget.h: s/ECard/EContact.
-
- * gui/component/e-cardlist-model.[ch]: nuke.
-
- * gui/component/e-address-popup.c: s/e-book.h/e-book-async.h
-
- * gui/component/e-address-popup.h: s/ECard/EContact
-
-2003-09-02 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/Makefile.am (libebook_la_SOURCES): remove
- e-card.c,e-card.simple.c
-
- * backend/ebook/tests/ebook/test-ebook.c: remove #include of
- e-card-simple.h
-
- * backend/ebook/tests/ebook/test-changes.c: remove #include of
- e-card-simple.h
-
- * backend/ebook/e-card.[ch], backend/ebook/e-card-simple.[ch]:
- nuke.
-
- * backend/ebook/e-book-util.h: s/card/contact.
-
- * backend/ebook/e-book-util.c: ifdef out an #include.
-
- * backend/ebook/e-book-async.[ch]: stop doing the stupid #define
- renaming trick, and just rename all the prototypes from e_book_*
- to e_book_async_*. Also, get rid of the *_vcard variants.
-
-2003-09-02 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-card-sexp.[ch]
- (pas_backend_card_sexp_match_contact): rename
- pas_backend_card_sexp_match_card, and it takes an EContact now.
- Also, port this file to use EContact instead of ECard, and ifdef
- out lots of stuff.
-
- * backend/pas/pas-backend-ldap.c: convert this to use EContact
- instead of ECard, and ifdef great swaths of code to make it
- compile.
-
- * backend/pas/pas-book.c (pas_book_respond_modify): convert this
- from ECard to EContact.
-
-2003-09-02 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/Makefile.am (libeminicard_la_SOURCES): remove all
- the reflow/minicard stuff from the build.
- (e-addressbook-marshal.[ch]): change the prefix on the marshallers to
- eab_marshal.
-
- * gui/widgets/e-addressbook-view.etspec: bring this more in line
- with the field ids for EContact, and comment out a ton of them
- that aren't there yet.
-
- * gui/widgets/e-addressbook-view.[ch]: big renaming - rename
- e_addressbook_view to eab_view, and EAddressbookView to EABView.
-
- * gui/widgets/e-addressbook-util.c (eab_error_dialog): rename, and
- change a few of the error strings s/Card/Contact.
- (added_cb): E_BOOK_STATUS_SUCCESS => E_BOOK_ERROR_OK.
- (modified_cb): same.
- (e_addressbook_show_contact_editor): this takes an EContact now,
- and track the change to the contact editor signal names.
- (e_addressbook_show_contact_list_editor): this takes an EContact
- now.
- (view_contacts): rename view_cards to this, and ifdef the body.
- (e_addressbook_show_multiple_contacts): rename
- e_addressbook_show_multiple_cards to this, and s/card/contact.
-
- * gui/widgets/e-addressbook-util.h: ifdef some things out, and
- rename e_addressbook_error_dialog to eab_error_dialog.
-
- * gui/widgets/e-addressbook-table-adapter.[ch]: big renaming -
- rename e_addressbook_table_adapter to eab_table_adapter, and
- EAddressbookTableAdapter to EABTableAdapter. Also, remove the
- simple mapping - we can do ECardSimple-like operations directly on
- the EContacts from the EABModel.
-
- * gui/widgets/e-addressbook-model.[ch]: big renaming - rename
- e_addressbook_model to eab_model, and EAddressbookModel to
- EABModel. Also, convert everything from ECard to EContact.
-
-2003-09-01 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-vcard.c (e_vcard_new_from_string): omg i'm dumb.
- don't call e_vcard_new here since it just turns around and calls
- e_vcard_new_from_string again.
-
-2003-09-01 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-book-view.c (pas_book_view_notify_change): guard
- pending adds foo.
- (pas_book_view_notify_remove): same.
- (pas_book_view_notify_add): same.
- (pas_book_view_notify_complete): same.
- (pas_book_view_construct): init mutex
- (pas_book_view_dispose): free mutex
-
- * backend/pas/pas-backend-ldap.c (func_exists): new function.
- (send_pending_adds): remove
- (ldap_search_handler): let the BookView stuff handle the pending
- adds for us.
- (ldap_search_dtor): remove pending adds stuff.
- (pas_backend_ldap_search): same
-
- * backend/pas/pas-backend-card-sexp.c (func_exists): new function.
-
- * backend/ebook/tests/ebook/test-ebook.c (print_all_emails): use
- an exists query.
-
-2003-08-31 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book-query.c (func_and, func_or, func_not)
- (func_contains, func_is, func_beginswith, func_endswith)
- (e_book_query_from_string): adapt the pas ldap backend sexp
- parsing code to this, build up an EBookQuery that represents the
- sexp.
-
- * backend/ebook/e-contact.h (e_contact_field_id): add prototype.
-
- * backend/ebook/e-contact.c (e_contact_field_id): new function.
-
- * backend/ebook/Makefile.am (libebook_la_SOURCES): add
- e-book-util.c back into the build, if only for the config_database
- thingy.
-
-2003-08-31 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-contact.c (e_contact_duplicate): new function.
-
- * backend/ebook/e-contact.h: add prototype for
- e_contact_duplicate.
-
- * backend/ebook/e-book-util.[ch]: massive ifdeffing. most of this
- is either gone or will be unnecessary soon.
-
- * backend/ebook/e-book-query.c (e_book_query_from_string): hack
- this so it'll at least generate a query.
-
- * backend/ebook/e-book-listener.c
- (impl_BookListener_respond_get_view): add some debug spew and
- remove a c&p'ed comment.
-
- * backend/ebook/e-book-async.h: add prototype for
- e_book_async_unload_uri.
-
- * backend/ebook/e-book-async.c (e_book_async_unload_uri): new
- function.
-
- * backend/pas/pas-book-view.c (pas_book_view_construct): switch to
- CORBA_Object_duplicate, ala pas_book.
-
- * backend/pas/pas-backend-sync.c (pas_backend_sync_class_init):
- fix typo and the build.
-
-2003-08-29 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (ldap_error_to_response):
- s/card/contact.
- (pas_backend_ldap_process_create_contact): same.
- (remove_contact_handler): same.
- (remove_contact_dtor): same.
- (pas_backend_ldap_process_remove_contacts): same.
- (modify_contact_modify_handler): same.
- (modify_contact_dtor): same.
- (pas_backend_ldap_process_modify_contact): same.
- (get_contact_handler): same.
- (get_contact_dtor): same.
- (pas_backend_ldap_process_get_contact): same.
- (pas_backend_ldap_class_init): same.
-
- * backend/pas/pas-backend-summary.c
- (pas_backend_summary_add_contact): s/card/contact, and mostly
- switch from ECard{Simple} to EContact.
- (pas_backend_summary_get_summary_vcard): same.
- (pas_backend_summary_remove_contact): s/card/contact
-
- * backend/pas/pas-backend-summary.h: s/card/contact.
-
- * backend/pas/pas-backend-file.c (build_summary): fix g_warning,
- and return immediately if the db->cursor call fails.
- (pas_backend_file_create_contact): s/card/contact
- (pas_backend_file_remove_contacts): same.
- (pas_backend_file_modify_contact): same.
- (pas_backend_file_get_contact): same.
- (pas_backend_file_get_contact_list): same.
- (pas_backend_file_class_init): same.
-
- * backend/pas/pas-backend-vcf.c
- (pas_backend_vcf_process_create_contact): s/card/contact.
- (pas_backend_vcf_process_remove_contacts): same.
- (pas_backend_vcf_process_modify_contact): same.
- (pas_backend_vcf_process_get_contact): same.
- (pas_backend_vcf_process_get_contact_list): same.
- (pas_backend_vcf_class_init): same.
-
- * backend/pas/pas-backend-sync.c (pas_backend_sync_create_contact): s/card/contact.
- (pas_backend_sync_remove_contacts): same.
- (pas_backend_sync_modify_contact): same.
- (pas_backend_sync_get_contact): same.
- (pas_backend_sync_get_contact_list): same.
- (_pas_backend_create_contact): same.
- (_pas_backend_remove_contacts): same.
- (_pas_backend_modify_contact): same.
- (_pas_backend_get_contact): same.
- (_pas_backend_get_contact_list): same.
- (pas_backend_sync_class_init): same.
-
- * backend/pas/pas-backend-sync.h: s/card/contact.
-
- * backend/pas/pas-backend.c (pas_backend_create_contact): s/card/contact.
- (pas_backend_remove_contacts): same.
- (pas_backend_modify_contact): same.
- (pas_backend_get_contact): same.
- (pas_backend_get_contact_list): same.
- (pas_backend_change_add_new): same.
- (pas_backend_change_modify_new): same.
- (pas_backend_change_delete_new): same.
-
- * backend/pas/pas-backend.h: s/card/contact.
-
- * backend/pas/pas-book-view.c (send_pending_adds): s/card/contact
- (pas_book_view_notify_change): same.
- (pas_book_view_notify_remove): same.
-
- * backend/pas/pas-book.c
- (impl_GNOME_Evolution_Addressbook_Book_getContact): s/card/contact
- (impl_GNOME_Evolution_Addressbook_Book_getContactList): same.
- (impl_GNOME_Evolution_Addressbook_Book_addContact): same.
- (impl_GNOME_Evolution_Addressbook_Book_removeContacts): same.
- (impl_GNOME_Evolution_Addressbook_Book_modifyContact): same.
- (pas_book_respond_create): same.
- (pas_book_respond_remove_contacts): same.
- (pas_book_respond_modify): same.
- (pas_book_respond_get_contact): same.
- (pas_book_respond_get_contact_list): same.
- (pas_book_respond_get_changes): same.
- (pas_book_class_init): same.
-
- * backend/pas/pas-book.h: s/card/contact
-
- * backend/ebook/tests/vcard/dump-vcard.c: #include
- "ebook/e-vcard.h"
-
- * backend/ebook/tests/vcard/Makefile.am (TEST_LIBS): use
- top_builddir.
- (CFLAGS): same.
-
- * backend/ebook/tests/ebook/Makefile.am (TEST_LIBS): use
- top_builddir.
- (CFLAGS): use srcdir
-
- * backend/ebook/test-card.c, backend/ebook/test-client-list.c,
- backend/ebook/test-client.c, backend/ebook/test-ebook.c: remove.
-
- * backend/ebook/e-card-cursor.[ch]: remove.
-
- * backend/ebook/e-card-pairs.h: remove.
-
- * backend/ebook/e-book.c (e_book_add_contact): s/Card/Contact.
- (e_book_commit_contact): same
- (e_book_get_contact): same.
- (e_book_remove_contacts): same.
- (e_book_get_contacts): same.
- (e_book_handle_response): same.
-
- * backend/ebook/e-book-view.c (e_book_view_do_added_event):
- s/card/contact
- (e_book_view_do_modified_event): same.
- (e_book_view_do_removed_event): same.
- (e_book_view_handle_response): same.
- (e_book_view_class_init): same.
-
- * backend/ebook/e-book-view.h: s/card/contact and pad the class
- struct.
-
- * backend/ebook/e-book-view-listener.c
- (e_book_view_listener_queue_response): s/Card/Contact.
- (e_book_view_listener_queue_status_event): no need to assign
- things to NULL, we g_new0.
- (e_book_view_listener_queue_idlist_event): s/Card/Contact, and no
- need to assign things to NULL, we g_new0.
- (e_book_view_listener_queue_sequence_event): same.
- (e_book_view_listener_queue_message_event): same.
- (impl_BookViewListener_notify_contacts_added): s/Card/Contact.
- (impl_BookViewListener_notify_contacts_removed): same.
- (impl_BookViewListener_notify_contacts_changed): same.
- (e_book_view_listener_class_init): same.
-
- * backend/ebook/e-book-view-listener.h: s/Card/Contact
-
- * backend/ebook/e-book-types.h: s/CARD/CONTACT
-
- * backend/ebook/e-book-listener.c
- (e_book_listener_convert_status): s/Card/Contact
- (impl_BookListener_respond_create_contact): same.
- (impl_BookListener_respond_remove_contacts): same.
- (impl_BookListener_respond_modify_contact): same.
- (impl_BookListener_respond_get_contact): same.
- (impl_BookListener_respond_get_contact_list): same.
- (impl_BookListener_respond_get_changes): same.
- (e_book_listener_class_init): same.
-
- * backend/ebook/e-book-listener.h: pad the class struct, and
- s/Card/Contact.
-
- * backend/ebook/e-book-async.c (_load_uri_handler): GError
- changes.
- (_get_fields_handler): same.
- (_get_methods_handler): same.
- (_auth_user_handler): same.
- (_get_card_handler): same.
- (_remove_cards_handler): same.
- (_add_vcard_handler): same.
- (_commit_vcard_handler): same.
- (_get_book_view_handler): same.
- (e_book_async_get_book_view): use an EBookQuery instead of a char*.
-
- * backend/ebook/Makefile.am: remove the test handling.
- (SUBDIRS): set to ". tests"
- (libebook_la_SOURCES): add e-book-async.c
-
- * backend/idl/addressbook.idl: possibly gratuitous renaming, but i
- was sick of seeing "Card" being used everywhere. "Contact" is the
- new "Card".
-
-2003-08-28 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book.c (e_book_op_free): rename from
- e_book_free_op.
- (e_book_op_remove): rename from e_book_remove_op.
- (e_book_clear_op): new function, remove the op, unlock its mutex,
- and free it.
- (e_book_add_contact): use e_book_clear_op.
- (e_book_commit_contact): same.
- (e_book_get_supported_fields): same.
- (e_book_get_supported_auth_methods): same.
- (e_book_authenticate_user): same.
- (e_book_get_contact): same.
- (e_book_remove_contacts): same.
- (e_book_get_book_view): same.
- (e_book_get_contacts): same.
- (e_book_get_changes): same.
- (e_book_load_uri): same.
- (e_book_remove): new function.
- (e_book_response_remove): new function.
- (e_book_handle_response): add handling for RemoveBookResponse.
- (e_book_load_local_addressbook): pass TRUE for e_book_load_uri
- @only_if_exists.
-
- * backend/ebook/e-book.h: add @only_if_exists arg to
- e_book_load_uri so we can support folder creation at load_uri
- time, and add prototype for e_book_remove.
-
- * backend/ebook/e-book-types.h: add an "id" slot in EBookChange.
-
- * backend/ebook/e-book-listener.c
- (impl_BookListener_respond_get_changes): handle union in idl.
- (impl_BookListener_respond_open_book): remove unnecessary
- exception check.
- (impl_BookListener_respond_remove_book): new function.
- (impl_BookListener_respond_get_supported_fields): rename this from
- _response_.
- (impl_BookListener_respond_get_supported_auth_methods): same.
- (e_book_listener_class_init): add _remove_book and track change to
- get_supported_fields/get_supported_auth_methods names.
-
- * backend/ebook/e-book-listener.h: add RemoveBookResponse to
- EBookListenerOperation enum.
-
- * backend/idl/addressbook.idl: make BookChangeItem a union that
- switches over BookChangeType.
-
- * backend/pas/pas-backend.c (pas_backend_change_add_new): new
- function, create a BookChangeItem representing the addition of a
- contact.
- (pas_backend_change_modify_new): same, but for modifications.
- (pas_backend_change_delete_new): same, but for deletions.
-
- * backend/pas/pas-backend.h: add prototypes for
- pas_backend_change_{add,modify,delete}_new
-
- * backend/pas/pas-backend-file.c (pas_backend_file_changes): nuke.
- (do_create): fix memory corruption.
- (pas_backend_file_get_changes): copy the body of
- pas_backend_file_changes here, and rework so that it's synchronous
- and return a list instead of the book view hack.
- (pas_backend_file_load_uri): mkdir the directory (we need a mkdir
- -p here).
- (select_changes): new function, scandir helper.
- (pas_backend_file_remove): NULL out bf->priv->summary to quiet
- valgrind, and call scandir to accumulate the .changes.db files
- then unlink them.
-
- * backend/pas/pas-book.c (pas_book_respond_remove): new function.
- (pas_book_respond_get_supported_fields): unifdef this, and make it
- use a glist.
- (pas_book_respond_get_supported_auth_methods): same.
- (pas_book_respond_get_changes): this code is kinda gross... lots
- of copying going on, there's got to be a better way. but it
- works.
-
-2003-08-26 Chris Toshok <toshok@ximian.com>
-
- * backend/idl/addressbook.idl: add oneway void Book::remove() and
- oneway void notifyBookRemoved()
-
-2003-08-26 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend.c (pas_backend_remove): new function.
- (pas_backend_add_book_view): new function.
- (pas_backend_add_client): move the "real_add_client" code here.
- (pas_backend_remove_client): move the "real_remove_client" code
- here.
- (pas_backend_class_init): remove assignments of add_client and
- remove_client vtable entries.
- (pas_backend_is_removed): new function.
- (pas_backend_set_is_removed): new function.
- (pas_backend_init): init clients_mutex and views_mutex.
-
- * backend/pas/pas-backend.h: remove the vtable entries for
- add/remove_client, since these are fully handled in PASBackend.
- Add prototypes for
- pas_backend_is_removed/pas_backend_add_book_view/pas_backend_set_is_removed.
-
- * backend/pas/pas-book.c
- (impl_GNOME_Evolution_Addressbook_Book_remove): new function.
- (impl_GNOME_Evolution_Addressbook_Book_getBookView): clean things
- up a bit, and don't use pas_backend_get_book_views as it can't
- lock the list of views.
- (pas_book_respond_get_supported_auth_methods): remove the extra
- unnecessary arg from the corba call.
- (pas_book_respond_get_changes): same.
- (pas_book_class_init): fill in epv "remove" slot.
-
- * backend/pas/pas-book.h: rename pas_book_respond_remove to
- pas_book_respond_remove_cards, and add a new
- pas_book_respond_remove for use with removing books.
-
- * backend/pas/pas-backend-sync.c (pas_backend_sync_remove): new
- function.
- (_pas_backend_remove): new function.
- (pas_backend_sync_class_init): fill in the "remove" vtable entry.
- (_pas_backend_remove_cards): track change to
- pas_book_respond_remove_cards (pas_book_respond_remove is used for
- removing the book, not the cards.)
-
- * backend/pas/pas-backend-sync.h: add pas_backend_sync_remove
- prototype and add remove_sync virtual function.
-
-2003-08-26 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-file.c (pas_backend_file_create_card,
- pas_backend_file_remove_cards, pas_backend_file_modify_card,
- pas_backend_file_get_vcard, pas_backend_file_get_card_list,
- pas_backend_file_start_book_view, pas_backend_file_get_changes,
- pas_backend_file_authenticate_user,
- pas_backend_file_get_supported_fields): rename from
- pas_backend_file_process_*
- (pas_backend_file_load_uri): save off the dirname/summary
- filename.
- (pas_backend_file_remove): new function, unlink all the files we
- know about.
- (pas_backend_file_class_init): track changes to functions, and add
- pas_backend_file_remove.
-
-2003-08-26 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (ecard_from_remote_record): duplicate
- the extra address lines
-
-2003-08-22 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-book.[ch]: switch from using the PASRequest
- union and a central PASBackend dispatch function. just call the
- pas_backend methods directly and expand the args out.
-
- * backend/pas/pas-backend.[ch]: same.
-
- * backend/pas/pas-backend-sync.[ch]: same.
-
- * backend/pas/pas-backend-vcf.c, backend/pas/pas-backend-file.c,
- backend/pas/pas-backend-ldap.c: same, and get these all compiling
- against the rest of the current pas/ebook code.
-
-2003-08-21 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/test-ebook.c: track GError case.
-
- * backend/ebook/e-book.[ch]: GError-ify the api, and clean up some
- cases where we weren't removing the current op.
-
- * backend/ebook/e-book-view-listener.c
- (e_book_view_listener_convert_status): track change from
- E_BOOK_VIEW_STATUS_* to E_BOOK_VIEW_ERROR_*.
-
- * backend/ebook/e-book-types.h: track change from E_BOOK_STATUS_*
- to E_BOOK_ERROR_*, and some E_BOOK_VIEW_STATUS_* to
- E_BOOK_VIEW_ERROR_*.
-
- * backend/ebook/e-book-listener.c
- (e_book_listener_convert_status): track change from
- E_BOOK_STATUS_* to E_BOOK_ERROR_*.
-
- * backend/ebook/e-book-query.c (e_book_query_any_field_contains):
- new function.
- (e_book_query_unref): handle the any_field_contains case.
- (e_book_query_to_string): same.
-
- * backend/ebook/e-book-query.h: add prototype for
- e_book_query_any_field_contains.
-
- * backend/ebook/e-card.c (e_card_load_uri): ifdef this out for
- now.
-
- * backend/ebook/e-contact.[ch] (e_contact_get_const): new
- function/prototype.
-
-2003-08-20 Gilbert Fang <gilbert.fang@sun.com>
-
- * gui/widgets/e-addressbook-util.c
- (e_addressbook_send_card_list): use memcpy to assign
- CORBA_char_sequence instead of strcpy. (#46706)
-
-2003-08-18 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/component-factory.c: Update OAFIIDs.
-
- * gui/widgets/e-addressbook-util.c (e_addressbook_transfer_cards):
- Removed extern declaration for global_shell_client [yuck].
- (e_addressbook_transfer_cards): #if 0 the invocation for
- evolution_shell_client_user_select_folder(), we need to
- reimplement this component-side now.
-
- * gui/component/component-factory.c (factory): Call
- addressbook_component_peek() here instead of
- addressbook_component_init() [since the latter is no more].
-
- * gui/component/addressbook.c (set_status_message): Don't create
- the activity client for now.
-
- * gui/component/addressbook-config.c: Removed member shell from
- struct AddressbookDialog.
- (ldap_dialog_new): Do not take a shell arg anymore.
- (ldap_config_control_new): Likewise.
- (addressbook_config_control_new): No need to get the global shell
- pointer here anymore.
-
- * gui/component/addressbook-component.c: Rewritten to support the
- new ::Component interface.
- * gui/component/addressbook-component.h: Likewise.
-
- * gui/component/GNOME_Evolution_Addressbook.server.in.in: Version
- factory's OAFIID. Remove ShellComponent server, add Component
- server.
-
-2003-08-12 Rodrigo Moya <rodrigo@ximian.com>
-
- * backend/ebook/e-book.c (e_book_dispose): unref the
- EComponentListener before unloading the CORBA object.
-
-2003-08-12 Hans Petter Jansson <hpj@ximian.com>
-
- * backend/ebook/e-destination.c (e_destination_dispose): Chain.
-
- * gui/component/e-address-widget.c (e_address_widget_destroy): Chain.
- Prevent double frees. Prevent double GSource removal.
-
- * gui/component/e-cardlist-model.c (e_cardlist_model_class_init):
- Store parent class.
- (e_cardlist_model_dispose): Chain. Prevent double frees and unrefs.
-
- * gui/contact-editor/e-contact-editor-address.c
- (e_contact_editor_address_dispose): Chain.
-
- * gui/contact-editor/e-contact-editor-fullname.c
- (e_contact_editor_fullname_dispose): Chain.
-
- * gui/contact-list-editor/e-contact-list-editor.c
- (e_contact_list_editor_dispose): Chain.
-
- * gui/contact-list-editor/e-contact-list-model.c
- (contact_list_model_destroy): Chain. Prevent double frees and unrefs.
-
- * gui/widgets/e-addressbook-reflow-adapter.c (addressbook_dispose):
- Chain.
- (addressbook_finalize): Chain.
-
- * gui/widgets/e-addressbook-table-adapter.c (addressbook_dispose):
- Chain.
-
- * gui/widgets/e-addressbook-treeview-adapter.c (addressbook_destroy):
- Chain. Prevent double free.
-
- * gui/widgets/gal-view-minicard.c (gal_view_minicard_dispose):
- Chain. Prevent double free and detach.
-
- * gui/widgts/gal-view-treeview.c (gal_view_treeview_dispose):
- Chain. Prevent double free and detach.
-
- * printins/e-contact-print-style-editor.c
- (e_contact_print_stule_editor_destroy): Chain. Prevent double unref.
-
-2003-08-07 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-vcard.c (e_vcard_to_string_vcard_21): new,
- unimplemented, function.
- (e_vcard_to_string_vcard_30): move the 3.0 vcard export code here.
- (e_vcard_to_string): call e_vcard_to_string_vcard_21 or
- e_vcard_to_string_vcard_30 based on @format.
- (e_vcard_attribute_remove_values): new function.
-
- * backend/ebook/e-vcard.h: add @format to e_vcard_to_string, and
- add prototype for e_vcard_attribute_remove_values. also, add
- prototype for e_vcard_decode_b_encoding.
-
-2003-08-07 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book-listener.c
- (impl_BookListener_respond_open_book): remove the book arg.
-
- * backend/ebook/e-book-listener.h (struct _EBookListenerResponse):
- remove the corba book.
-
- * backend/ebook/e-book-async.c (_get_book_view_dtor): free the
- query string.
- (e_book_async_get_book_view): dup the query string.
-
- * backend/ebook/e-book.h: change e_book_get_book_view and
- e_book_get_contacts to take a const char * query string instead of
- an EBookQuery.
-
- * backend/ebook/e-book.c (e_book_add_contact): pass
- EVC_FORMAT_VCARD_30 to e_vcard_to_string.
- (e_book_commit_contact): same.
- (e_book_get_book_view): take a const char* query string instead of
- an EBookQuery.
- (e_book_get_contacts): same.
- (e_book_response_open): track change - the Book is no longer
- communicated back here.
- (listener_cb): nuke.
- (e_book_handle_response): track change to e_book_response_open.
- (e_book_load_uri): rework this from using BookFactory::openBook to
- BookFactory::getBook + Book::open.
- (e_book_get_uri): new function, reimplement from old api.
- (e_book_get_static_capabilities): same.
- (e_book_check_static_capability): same.
- (startup_mainloop): new function, run bonobo_main.
- (e_book_activate): start up a thread with startup_mainloop as the
- start func.
- (e_book_new): call e_book_activate.
-
- * backend/idl/addressbook.idl: Add Book::open, remove the Book
- from notifyBookOpened's args, and change BookFactory::openBook to
- BookFactory::getBook.
-
- * backend/pas/pas-backend-file.c (pas_backend_file_load_uri): add
- only_if_exists - stop using the "create-initial" special file.
-
- * backend/pas/pas-backend-vcf.c (pas_backend_vcf_load_uri): add
- only_if_exists - stop using the "create-initial" special file.
-
- * backend/pas/pas-backend.c (pas_backend_load_uri): add
- @only_if_exists, and pass it along to the virtual method.
- (pas_backend_open): new function, lock the mutex so only one
- PASBook can actually call load_uri. call load_uri with
- pas_book_get_uri, and req->only_if_exists.
- (pas_backend_handle_request): rename process_client_request to
- this, and expose it publicly. Also add a case statement for
- "Open".
- (real_add_client): gut this function, we don't need to create the
- book anymore, just add the client to the list and do the weak
- ref/ORBit small stuff.
- (pas_backend_add_client): track change to signature - BookListener
- -> PASBook.
- (pas_backend_init): init open_mutex.
- (pas_backend_dispose): free open_mutex.
-
- * backend/pas/pas-backend.h (PASBackendClass): add @only_if_exists
- to the load_uri virtual method, and change the add_client virtual
- method to take a PASBook instead of a BookListener. add the same
- args to _load_uri and add_client. Also, add prototypes for
- pas_backend_handle_request and pas_backend_open.
-
- * backend/pas/pas-book-factory.c
- (_pas_book_factory_send_open_book_response): nuke.
- (pas_book_factory_launch_backend): just return NULL, don't call
- _pas_book_factory_send_open_book_response, in the error case.
- (start_backend): nuke
- (impl_GNOME_Evolution_Addressbook_BookFactory_getBook): rename
- _openBook to this. clean up the code a bit. Create the PASBook
- here, and always track change to pas_backend_add_client's type (we
- pass the book now, not the listener).
- (pas_book_factory_class_init): openBook -> getBook.
-
- * backend/pas/pas-book.c
- (impl_GNOME_Evolution_Addressbook_Book_open): new function, call
- pas_backend_open.
- (impl_GNOME_Evolution_Addressbook_Book_getVCard): get rid of the
- signal crap, just call pas_backend_handle_request.
- (impl_GNOME_Evolution_Addressbook_Book_getCardList): same.
- (impl_GNOME_Evolution_Addressbook_Book_authenticateUser): same.
- (impl_GNOME_Evolution_Addressbook_Book_addCard): same.
- (impl_GNOME_Evolution_Addressbook_Book_removeCards): same.
- (impl_GNOME_Evolution_Addressbook_Book_modifyCard): same.
- (impl_GNOME_Evolution_Addressbook_Book_getChanges): same.
- (impl_GNOME_Evolution_Addressbook_Book_getSupportedFields): same.
- (impl_GNOME_Evolution_Addressbook_Book_getSupportedAuthMethods):
- same.
- (impl_GNOME_Evolution_Addressbook_Book_cancelOperation): same.
- (pas_book_get_backend): aggregate some g_return_if_fail's.
- (pas_book_get_listener): new function.
- (pas_book_get_uri): new function.
- (pas_book_respond_open): just call BookListener::notifyBookOpened.
- (pas_book_construct): add @uri, and g_strdup it.
- (pas_book_new): add @uri, and pass it to pas_book_construct.
- (pas_book_class_init): remove the "request" signal stuff, and fill
- in epv->open.
-
- * backend/pas/pas-book.h: add PASOpenRequest struct/enum entry.
- Also, add @uri to the pas_book_new args, and add a prototype for
- pas_book_get_uri. Also, remove the "request" signal.
-
-2003-08-07 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-book-factory.c
- (pas_book_factory_get_n_backends): lock map_mutex around hash
- table work.
- (pas_book_factory_dump_active_backends): same.
- (backend_last_client_gone_cb): same.
- (_pas_book_factory_send_open_book_response): track CallStatus idl
- change.
- (start_backend): simplify this greatly, since the factory is
- tagged with HINT_PER_THREAD.
- (impl_GNOME_Evolution_Addressbook_BookFactory_openBook): lock
- around hash table.
- (pas_book_factory_init): initialize map_mutex.
- (pas_book_factory_dispose): free map_mutex.
-
-2003-08-06 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_book_view_copy): nuke.
- (pas_backend_file_book_view_free): same.
- (view_destroy): same.
- (pas_backend_file_changes): #if notyet
- (do_create): e-card -> e-contact.
- (pas_backend_file_process_create_card): remove view handling from
- here.
- (pas_backend_file_process_remove_cards): same.
- (pas_backend_file_process_modify_card): convert to e-contact, and
- remove view handling.
- (pas_backend_file_get_book_view): nuke.
- (pas_backend_file_process_get_supported_fields): e-card-simple ->
- e-contact.
- (pas_backend_file_upgrade_db): e-card -> e-contact.
- (pas_backend_file_cancel_operation): implement, just return
- CouldNotCancel.
- (pas_backend_file_class_init): assign cancel_operation, and remove
- get_book_view assignment.
- (pas_backend_file_init): remove book_views assignment.
-
-2003-08-06 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-vcf.c (pas_backend_vcf_book_view_copy):
- nuke.
- (pas_backend_vcf_book_view_free): same.
- (view_destroy): same.
- (insert_contact): new function, insert the contact into our hash
- table.
- (load_file): reimplement without the e_card stuff.
- (foreach_build_list): e_card -> e_contact.
- (save_file): mostly reimplement in terms of e-contact. more error
- case work needs doing.
- (do_create): e-card -> e-contact.
- (pas_backend_vcf_process_create_card): remove the view handling
- from here.
- (pas_backend_vcf_process_remove_cards): implement this, just
- remove it from the hash table and set ourselves to dirty.
- (pas_backend_vcf_process_modify_card): remove the view handling
- from here.
- (pas_backend_vcf_process_get_book_view): nuke.
- (pas_backend_vcf_process_get_supported_fields): reimplement in
- terms of e-contact.
- (INITIAL_VCARD): add in a FN attribute, and remove the quoted
- printable encoding.
- (pas_backend_vcf_cancel_operation): implement, just always return
- CouldNotCancel.
- (pas_backend_vcf_class_init): fill in cancel_operation, and remove
- get_book_view_sync.
- (pas_backend_vcf_init): remove book_views handling.
-
- * backend/pas/pas-backend-vcf.h: update copyright.
-
-2003-08-06 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-sync.c (pas_backend_sync_remove_cards):
- add out param @ids, so we can call pas_book_respond_remove
- properly.
- (_pas_backend_remove_cards): the other half of the change - pass
- the ids on to pas_book_response_remove.
- (pas_backend_sync_modify_card): add out param @old_vcard so we can
- call pas_book_respond_modify properly.
- (_pas_backend_modify_card): the other half of the change, pass the
- old_vcard on to pas_book_respond_modify.
- (pas_backend_sync_get_book_view): nuke.
- (pas_backend_sync_get_changes): track change (book view -> GList)
- (_pas_backend_is_threaded): nuke.
- (_pas_backend_create_card): indent.
- (_pas_backend_remove_cards): same.
- (_pas_backend_modify_card): same.
- (_pas_backend_get_card_list): same.
- (_pas_backend_get_changes): same.
- (_pas_backend_authenticate_user): same.
- (_pas_backend_get_supported_fields): same.
- (_pas_backend_get_supported_auth_methods): same.
- (_pas_backend_get_book_view): nuke.
- (pas_backend_sync_class_init): remove assignment to is_threaded
- and get_book_view.
-
- * backend/pas/pas-backend-sync.h: add out-params @ids to
- remove_cards_sync, @old_vcard to modify_card_sync.
- get_changes_sync's out-param is a GList instead of a book view,
- and remove get_book_view_sync.
-
- * backend/pas/pas-backend.c (pas_backend_get_book_view): nuke.
- (pas_backend_is_threaded): nuke.
- (pas_backend_start_threaded): nuke.
- (pas_backend_init): initialize priv->views.
- (pas_backend_dispose): free priv->views.
- (pas_backend_get_book_views): new function, return priv->views.
-
- * backend/pas/pas-backend.h: remove the get_book_view virtual
- method, and the pas_backend_get_book_view prototype. Also, track
- the CallStatus change, and add a cancel_operation virtual method
- and prototype, and add pas_backend_get_book_views function, so the
- PASBook's can get ahold of the list.
-
- * backend/pas/pas-book-view.h: track collapsing of
- Addressbook::BookListenerCallStatus and
- Addressbook::BookView::CallStatus enums into
- Addressbook::CallStatus.
-
- * backend/pas/pas-book-view.c: same.
-
- * backend/pas/pas-card-cursor.[ch]: nuke
-
- * backend/pas/pas-book.c: track collapsing of
- Addressbook::BookListenerCallStatus and
- Addressbook::BookView::CallStatus enums into
- Addressbook::CallStatus.
- (impl_GNOME_Evolution_Addressbook_Book_getBookView): implement
- this all here, instead of farming it out to the backends.
- (impl_GNOME_Evolution_Addressbook_Book_getChanges): track change
- to signature. this is no longer a book view, it'll return an
- actual list.
- (impl_GNOME_Evolution_Addressbook_Book_cancelOperation): new
- function, implement.
- (pas_book_respond_create): iterate over the views, notifying them
- if the new card matches their query.
- (pas_book_respond_remove): iterate over the views, telling them to
- delete the card matching the id.
- (pas_book_respond_modify): iterate over the views, notifying them
- if they need to change/add/remove that card.
- (view_destroy): move this here from the backends.
- (pas_book_respond_get_book_view): weak-ref the book view.
- (pas_book_new): remove the is_threaded switch on POA hints, and
- always use PER_REQUEST.
- (pas_book_class_init): fill in cancelOperation.
-
- * backend/pas/pas-book.h: track collapsing of
- Addressbook::BookListenerCallStatus and
- Addressbook::BookView::CallStatus enums into
- Addressbook::CallStatus.
-
-2003-08-01 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book-async.c: mostly finished.
-
-2003-08-01 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book-async.[ch]: new files, create async methods
- similar to the old ebook api that use GThread/GAsyncQueue to
- simulate the old async behavior.
-
-2003-07-29 Chris Toshok <toshok@ximian.com>
-
- * backend/idl/addressbook.idl: collapse
- Addressbook::BookListenerCallStatus and
- Addressbook::BookView::CallStatus enums into
- Addressbook::CallStatus.
-
-2003-07-29 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book-types.h: add EBookChangeType/EBookChange.
-
-2003-07-29 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book-view-listener.c: track collapsing of
- Addressbook::BookListenerCallStatus and
- Addressbook::BookView::CallStatus enums into
- Addressbook::CallStatus.
-
- * backend/ebook/e-book-listener.c track collapsing of
- Addressbook::BookListenerCallStatus and
- Addressbook::BookView::CallStatus enums into
- Addressbook::CallStatus.
- (response_free): nuked
- (e_book_listener_check_queue): nuked
- (e_book_listener_queue_response): nuked
- (e_book_listener_queue_progress): nuked
- (e_book_listener_queue_get_view_response): nuked
- (e_book_listener_queue_get_changes_response): nuked
- (e_book_listener_queue_writable_status): nuked
- (e_book_listener_queue_authentication_response): nuked
- (e_book_listener_queue_get_supported_fields_response): nuked
- (e_book_listener_queue_get_supported_auth_methods_response): nuked
- (e_book_listener_dispose): nuked
-
- * backend/ebook/e-book-listener.h: remove prototypes for
- check_pending and pop_response.
-
- * backend/ebook/e-book.c (e_book_get_changes): new function.
- implement this as more of a getCardList type function, instead of
- getBookView.
- (e_book_response_get_changes): new function.
- (e_book_free_change_list): new function.
-
- * backend/ebook/e-book.h: add prototype for
- e_book_free_change_list.
-
-2003-07-23 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book.c (e_book_get_book_view): new function,
- implement this.
- (e_book_response_get_book_view): same.
- (e_book_get_contacts): remove the op so we don't see BUSY after
- this request.
- (e_book_handle_response): unifdef a few things.
- (e_book_unload_uri): fix the assertion about URI_NOT_LOADED, and
- unifdef some code.
- (e_book_dispose): fix a typo.
-
- * backend/ebook/e-book-view.c (e_book_view_handle_response):
- rename _check_listener_queue to this. we don't need to pop the
- response either, it's passed as an arg.
- (e_book_view_construct): "response_queued" -> "response"
- (e_book_view_start): new function, call BookView.start.
- (e_book_view_dispose): track the signal id change.
-
- * backend/ebook/e-book-view.h: add prototype for
- e_book_view_start.
-
- * backend/ebook/e-book-view-listener.c
- (e_book_view_listener_check_queue): remove.
- (e_book_view_listener_queue_response): just emit the signal.
- (impl_BookViewListener_notify_card_added): spew.
- (impl_BookViewListener_notify_card_changed): spew.
- (impl_BookViewListener_notify_sequence_complete): spew.
- (impl_BookViewListener_notify_progress): spew.
- (e_book_view_listener_check_pending): remove
- (e_book_view_listener_check_pop_response): remove
- (e_book_view_listener_new): use the ALL_AT_IDLE poa policy.
- (e_book_view_listener_init): remove the queue/timeout stuff.
- (e_book_view_listener_dispose): remove the queue/timeout stuff.
-
- * backend/ebook/e-book-view-listener.h: remove _check_pending and
- _pop_response.
-
-2003-07-23 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-file.c (do_summary_query): remove the
- completion_search argument, and remove the aggregating stuff.
- just call pas_book_view_notify_add_1.
- (pas_backend_file_book_view_copy): remove card_sexp crap.
- (pas_backend_file_book_view_free): same.
- (get_length): remove
- (get_nth): remove
- (cursor_destroy): remove
- (vcard_matches_search): remove
- (ecard_matches_search): remove
- (pas_backend_file_search_timeout): remove the aggregating stuff.
- just call pas_book_view_notify_add_1.
- (pas_backend_file_search): simplify this a bunch.
- (do_create): use pas_book_view_vcard_matches.
- (pas_backend_file_process_get_card_list): add some more error
- checks.
- (pas_backend_file_process_get_book_view): unifdef this, and
- implement it.
- (pas_backend_file_start_book_view): kick off the search.
- (pas_backend_file_get_uri): remove.
- (pas_backend_file_class_init): remove get_uri, add
- start_book_view.
-
- * backend/pas/pas-backend-ldap.c (view_destroy): don't need to
- unref the card_sexp, as the PASBookView owns it now.
- (create_card_handler): use pas_book_view_vcard_matches.
- (modify_card_modify_handler): same.
- (ldap_get_view): initialize the view properly.
- (pas_backend_ldap_get_uri): remove.
- (pas_backend_ldap_class_init): remove the get_uri assignment.
-
- * backend/pas/pas-backend-sync.c (_pas_backend_get_card_list):
- don't free this, it's freed in the pas_book code.
-
- * backend/pas/pas-backend-sync.h: make use of pas-types.h and
- remove some typedefs.
-
- * backend/pas/pas-backend-summary.h: same.
-
- * backend/pas/pas-backend-card-sexp.h: same.
-
-2003-07-23 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-book.c
- (impl_GNOME_Evolution_Addressbook_Book_getBookView): spew.
- (pas_book_respond_create): unifdef this.
- (pas_book_respond_remove): same.
- (pas_book_respond_modify): same.
- (pas_book_respond_authenticate_user): same.
- (pas_book_respond_get_supported_fields): unref the iterator.
- (pas_book_respond_get_book_view): unifdef, and add spew.
-
- * backend/pas/pas-book.h: make use of pas-types.h and remove some
- typedefs.
-
-2003-07-23 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-types.h: new file, all the typedefs shared
- between files here.
-
-2003-07-23 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-book-view.c (send_pending_adds): abstract all
- the aggregating code to the book view. backends just call
- notify_card_added and the superclass does all the aggregating.
- (pas_book_view_notify_change): if there are pending adds, send
- them before we send the change.
- (pas_book_view_notify_remove): same.
- (pas_book_view_notify_add): the other part of the aggregating
- code.
- (pas_book_view_notify_complete): send pending adds if there are
- any.
- (impl_GNOME_Evolution_Addressbook_BookView_start): new function,
- call pas_backend_start_book_view.
- (pas_book_view_get_card_query): new function.
- (pas_book_view_get_card_sexp): new function.
- (pas_book_view_get_backend): new function.
-
- * backend/pas/pas-book-view.h: add a PASBackend arg to the
- constructor, as well as the char* query and PASBackendCardSExp
- form. also add accessors for card_query, card_sexp, and backend.
-
- * backend/idl/addressbook.idl
- (GNOME::Evolution::Addressbook::BookView): add start() method.
- (GNOME::Evolution::Addressbook::BookListener): remove the oneway
- tag from notifyBookOpened, notifyViewRequested, and
- notifyChangesRequested so the call doesn't return until the remote
- object has gotten the method call.
-
- * backend/pas/pas-backend.c (pas_backend_load_uri): fill in the
- uri slot if the load was successful.
- (pas_backend_get_uri): return the uri, remove the virtual method
- call.
- (pas_backend_start_book_view): new function.
- (process_client_request): ifdef out the threaded foo, since i'm
- not certain it's at all necessary.
- (real_add_client): remove the bonobo_object_unref of the book,
- since it's immortal.
- (pas_backend_dispose): free the uri.
-
- * backend/pas/pas-backend.h: remove the get_uri virtual method,
- and add the start_book_view virtual method and
- pas_backend_start_book_view prototype.
-
-2003-07-23 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/Makefile.am (libpasvcf_a_SOURCES): new.
- (noinst_LIBRARIES): add libpasvcf.a
-
- * backend/pas/pas-backend-vcf.[ch]: new files, implement a vcard
- file backend. the backend api still needs a little work, but it's
- getting easier to write backends.
-
-2003-07-23 Chris Toshok <toshok@ximian.com>
-
- * printing/e-contact-print.c (e_contact_print_response): deal with
- "uses_list". Fixes #30839.
- (e_contact_print_dialog_new): use GINT_TO_POINTER instead of
- casting to void*, and set "uses_list" to FALSE.
- (e_contact_print_card_dialog_new): same.
- (e_contact_print_card_list_dialog_new): same, but set "uses_list"
- to TRUE.
-
-2003-07-23 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book.c (e_book_dispose): fix a typo.
-
-2003-07-22 Akira TAGOH <tagoh@redhat.com>
-
- * printing/e-contact-print-envelope.c (ecpe_print): Use 'Sans'
- instead of 'Helvetica' for the font name.
- * printing/e-contact-print.c (e_contact_build_style): Likewise.
-
-2003-07-23 Dan Winship <danw@ximian.com>
-
- * backend/ebook/Makefile.am: use EVO_MARSHAL_RULE
- * backend/pas/Makefile.am: Likewise
- * gui/component/select-names/Makefile.am: Likewise
- * gui/contact-editor/Makefile.am: Likewise
- * gui/contact-list-editor/Makefile.am: Likewise
- * gui/widgets/Makefile.am: Likewise
-
- * gui/contact-editor/e-contact-editor.c
- (e_contact_editor_class_init):
- s/ece_marshal/e_contact_editor_marshal/
-
- * gui/contact-list-editor/e-contact-list-editor.c
- (e_contact_list_editor_class_init): Likewise for ecle_marshal
-
- * gui/search/e-addressbook-search-dialog.c
- (e_addressbook_search_dialog_init): Remove gtk_window_set_policy
- call since that function is deprecated and it was just setting
- everything to the default values anyway.
-
- * gui/widgets/e-addressbook-util.c: #include gal/util/e-util.h for
- e_free_object_list.
-
-2003-07-22 Dan Winship <danw@ximian.com>
-
- * backend/ebook/e-card.c: (e_card_new,
- e_card_new_with_default_charset): Make the "vcard" arg const.
- ...: add lots and lots of other consts as a side effect
-
-2003-06-30 Dan Winship <danw@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (e_addressbook_view_dispose):
- disconnect from model signals to prevent a race condition at
- shutdown where the view gets destroyed and then the model notices
- the backend dying before being destroyed itself.
-
- * gui/widgets/e-addressbook-reflow-adapter.c
- (addressbook_finalize): add, to free priv.
- (e_addressbook_reflow_adapter_class_init): set it up
-
- * gui/component/e-address-popup.c (e_address_popup_set_free_form):
- Don't leak strings
-
- * gui/component/addressbook-storage.c (load_source_data): don't
- leak xml data.
-
- * gui/component/addressbook-component.c (new_item_cb): don't leak
- the new card.
-
-2003-06-25 Gilbert Fang <gilbert.fang@sun.com>
-
- * gui/widgets/e-minicard-view-widget.c
- (e_minicard_view_widget_real_focus_in_event): new function,
- override the event handler for focus_in_event, set the first item
- be focused if no focused item at all. Fixes bug 41826.
-
-2003-06-18 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c (fill_in_field): in the
- EUrlEntry case just reassign widget. it'll be handled by the
- GtkEditable code below. Fixes #43841.
-
-2003-06-14 Larry Ewing <lewing@ximian.com>
-
- * gui/backend/ebook/e-card-simple.c:
- * gui/backend/ebook/e-card.c:
- * gui/backend/ebook/evolution-ldif-importer.c:
- * gui/backend/ebook/load-pine-addressbook.c:
- * gui/backend/ebook/test-card.c:
- * gui/backend/pas/pas-backend-card-sexp.c:
- * gui/backend/pas/pas-backend-ldap.c: Fix lots of leaks, update
- for correct use of g_object_get. Some cleanups.
-
-2003-06-13 Larry Ewing <lewing@ximian.com>
-
- * gui/component/addressbook.c:
- * gui/component/e-cardlist-model.c:
- * gui/component/select-names/e-select-names-text-model.c:
- * gui/contact-editor/e-contact-editor.c:
- * gui/contact-editor/e-contact-save-as.c:
- * gui/contact-list-editor/e-contact-list-editor.c:
- * gui/widgets/e-addressbook-table-adapter.c:
- * gui/widgets/e-addressbook-util.c:
- * gui/widgets/e-addressbook-view.c:
- * gui/widgets/e-minicard-view.c:
- * gui/widgets/e-minicard.c: Fix lots of leaks, update for correct
- use of g_object_get. Some misc cleanups.
-
- * printing/e-contact-print.c: update for correct use of
- g_object_get.
-
-2003-06-05 Not Zed <NotZed@Ximian.com>
-
- ** For #42691.
-
- * gui/component/select-names/Makefile.am (%.server.in): implicit
- rule for .in file.
- (BUILT_SOURCES): added server_DATA.
-
- * gui/component/Makefile.am (%.server.in): use implicit rule for
- .in file.
- (BUILT_SOURCES): added, just server_DATA.
- (CLEANFILES): added
-
- * backend/ebook/Makefile.am (BUILT_SOURCES): add server_DATA.
-
-2003-06-04 Rodrigo Moya <rodrigo@ximian.com>
-
- * backend/ebook/ebook.c (e_book_do_response_open): adapted to
- changes in EComponentListener API.
-
-** See ChangeLog.pre-1-4 for older changes
-
diff --git a/addressbook/ChangeLog.pre-1-4 b/addressbook/ChangeLog.pre-1-4
deleted file mode 100644
index b1c12cb82f..0000000000
--- a/addressbook/ChangeLog.pre-1-4
+++ /dev/null
@@ -1,16758 +0,0 @@
-2003-05-19 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (func_beginswith): use the more
- convoluted (but more correct) query if evolutionPerson is
- supported. Fixes #42825.
-
-2003-05-19 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-destination.c (use_default_book_cb): handle the
- case where @book == NULL, which can happen if there was a problem
- opening the default book. Should fix #43005.
-
-2003-05-19 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-component.c
- (ensure_completion_uris_exist): fix the initial run case. the
- config upgrade code creates all elements so we can't just check
- for NULL - we have to check if the string is empty. Fixes #43213.
-
-2003-05-19 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-minicard-label.c (set_colors): if we've got focus,
- set the background of the rect to bg[NORMAL], and the fill color
- of the text and label to text[NORMAL]. This will make the
- background a different color than the canvas, but won't make it
- use the selected background. fixes #42472
-
-2003-05-19 Chris Toshok <toshok@ximian.com>
-
- * gui/merging/e-card-merging.c (e_card_merging_book_commit_card):
- add a g_object_ref(card), to match the one in
- e_card_merging_book_add_card. Fixes #43175.
-
-2003-05-19 Anna Marie Dirks <anna@ximian.com>
-
- * gui/contact-editor/e-contact-quick-add.c: Added HIG-appropriate
- HIG-appropriate spacing, padding, accelerators. Fixes bug #41210
-
- * gui/component/ldap-config.glade: HIG-ified the various dialogs
- (including the settings pages, the config druid, and the edit dialog)
- in this glade file. This fixes bugs #41140, #41137, #41130
-
- * gui/merging/e-card-merging-book-commit-duplicate-detected.glade:
- Changed button order, and added HIG-appropriate spacing/padding.
- Fixes bug #41232.
-
- * gui/merging/e-card-duplicate-detected.glade: Changed button
- order, and added HIG-appropriate spacing/padding. Fixes bug
- #41229 and #41231.
-
-2003-05-19 Sean Gao <sean.gao@sun.com>
-
- * gui/component/addressbook-component.c (xfer_folder): remove the
- summary if @remove_source is TRUE. Fixes 38084.
-
-2003-05-16 Anna Marie Dirks <anna@ximian.com>
-
- * gui/contact-list-editor/contact-list-editor.glade: Added
- HIG-appropriate spacing, padding, capitalization and accelerators.
- Fixes bug #41254
-
-2003-05-16 Anna Marie Dirks <anna@ximian.com>
-
- * gui/contact-editor/fulladdr.glade: Added HIG-appropriate
- spacing, padding, capitalization and accelerators. Fixes bug #41251
-2003-05-14 Anna Marie Dirks <anna@ximian.com>
-
- * gui/contact-editor/fullname.glade: Added HIG-appropriate
- spacing, padding, caps, title and accelerators. Fixes bug #41249,
- and also bug #41250..
-
-2003-05-16 Anna Marie Dirks <anna@ximian.com>
-
- * gui/contact-editor/contact-editor.glade: Added HIG-appropriate
- spacing, padding, capitalization and accelerators. Fixes bug #41248.
-
-
-2003-05-16 Rodney Dawes <dobey@ximian.com>
-
- * addressbook/backend/ebook/Makefile.am: Move the tools to a
- more appropriate directory, privlibexecdir
-
-2003-05-15 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c (book_open_cb): backing out a tiny
- porting of jpr's fix - we need to set the book on the
- EAddressbookView, or else it won't do queries, and it won't show
- any cards. Fixes #43023, #43090.
-
-2003-05-15 Chris Toshok <toshok@ximian.com>
-
- * gui/merging/e-card-merging.c (free_lookup): new function, split
- out the duplicated teardown code from final_cb and final_id_cb.
- also, unref the card.
- (final_id_cb): call free_lookup.
- (final_cb): same.
- (e_card_merging_book_add_card): ref the card. fixes bug #43016.
-
-2003-05-14 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c (full_addr_clicked):
- replace the text_buffer_delete/text_buffer_insert with
- set_buffer_set_text. call widget_changed if they clicked OK, so
- we actually mark the dialog changed.
- (fill_in_field): make this handle GtkTextViews, because for some
- reason that escapes rational thought GtkTextView's don't implement
- GtkEditable. fixes #42606.
- (extract_field): same.
-
-2003-05-14 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-minicard-label.c (e_minicard_label_reflow): set
- the clip_height on reflow so the name of the field is as high as
- the field's value. makes it possible to click anywhere to the
- left of a tall field (like an address) and have it select the
- field. Fixes #42625.
-
-2003-05-14 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c (address_mailing_changed):
- handle the case where we haven't filled in the address yet. fixes
- #42620.
-
-2003-05-14 JP Rosevear <jpr@ximian.com>
-
- * gui/component/addressbook.c (addressbook_view_unref): clear the
- view
- (book_open_cb): track the book in the view, don't unref the book
- (set_prop): set the book
- (retrieve_shell_view_interface_from_control): get the shell view
- every time
- (set_folder_bar_label): release and unref the shell view
-
- * gui/component/addressbook-storage.h: add proto
-
- * gui/component/addressbook-storage.c
- (addressbook_storage_cleanup): unref the storage
-
- * gui/component/addressbook-component.c (owner_unset_cb): clean up
- storage
-
- * backend/ebook/e-book.c (e_book_load_uri): track the listener
- signal
- (e_book_dispose): unref the listener and disconnect the signal
-
-2003-05-13 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-text-model.c
- (e_select_names_text_model_set_separator): strlen ->
- g_utf8_strlen.
- (e_select_names_text_model_insert): same.
- (e_select_names_text_model_insert_length): big change, make this
- work with multibyte utf8.
- (e_select_names_text_model_delete): same. this could possibly use
- a tighter loop + a memmove, but this works.
-
- * gui/component/select-names/e-select-names-model.c
- (e_select_names_model_get_textification): make sure our truncation
- to MAX_LENGTH characters uses utf8 characters, not bytes.
- (e_select_names_model_name_pos): track e-text-model change.
- pos/length are now in utf8 character terms, so use g_utf8_strlen
- instead of strlen.
- (e_select_names_model_text_pos): same.
-
-2003-05-13 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-table-adapter.c (addressbook_dispose):
- rename addressbook_destroy to this, and guard against multiple
- calls.
- (e_addressbook_table_adapter_class_init): GtkObject -> GObject,
- and destroy -> dispose.
- (e_addressbook_table_adapter_init): GtkObject -> GObject.
-
-2003-05-12 Sean Gao <sean.gao@sun.com>
-
- * gui/contact-list-editor/e-contact-list-editor.c
- (e_contact_list_editor_init): terminate g_build_filename with
- NULL.
-
-2003-05-11 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #42048 ]
- * gui/widgets/e-addressbook-view.c (e_contact_print_button):
- button => response.
- (e_addressbook_view_print): connect to "response", not "clicked".
-
-2003-05-11 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #41245 ]
- * gui/component/select-names/select-names.glade: fix
- spacing/border widths as per HIG.
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_init): set the border width/spacing on widgets we
- create here.
-
-2003-05-09 Jeremy Katz <katzj@redhat.com>
-
- * printing/e-contact-print.c (e_contact_print_response): Use glib
- macro to case from pointer to int.
-
- * printing/e-contact-print-envelope.c: Add missing #include.
-
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_start_query): Use
- E_SELECT_NAMES_COMPLETION to avoid warning
-
-2003-05-06 Chris Toshok <toshok@ximian.com>
-
- [ really commit this, fixes bug #41910 ]
- * gui/contact-list-editor/e-contact-list-model.c
- (e_contact_list_model_remove_row): change from model_changed to
- row_deleted here. model_changed causes the table to free its
- ETableSelection, which is what we iterate over when deleting
- contacts.
- (e_contact_list_model_add_destination): no need to be calling
- model_changed here either.
-
-2003-04-29 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #41255 ]
- * gui/contact-list-editor/contact-list-editor.glade: use stock
- buttons for Add/Remove.
-
-2003-04-29 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #41144 ]
- * gui/component/ldap-config.glade: use stock buttons for the
- Add/Delete buttons. Switch from "Delete" to "Remove", though, as
- "Remove" fits much better with the one for "Add". Also, add our
- stock-edit-24.png icon for "Edit".
-
-2003-04-29 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #41211 ]
- * gui/component/e-address-popup.c (e_address_popup_no_matches):
- call e_button_new_with_stock_icon to create our button and give it
- the right icon.
-
-2003-04-29 Gilbert Fang <gilbert.fang@sun.com>
-
- * tools/evolution-addressbook-export-list-cards.c
- (set_pre_defined_field): remove duplicate HOME_COUNTRY field add.
-
-2003-04-28 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #41843]
- * tools/evolution-addressbook-export-list-cards.c
- (e_card_simple_csv_get_name): use e_card_simple_get_ecard_field
- instead of e_card_simple_get_name, so the return value won't be
- localized.
-
-2003-04-28 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #41779 ]
- * gui/component/e-address-popup.c (mini_wizard_container_add): we
- don't need to call gtk_widget_destroy on the old child, since
- gtk_container_remove will unref it for us.
-
-2003-04-23 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #37351 ]
- * gui/widgets/e-addressbook-view.c (table_drag_data_get): the row
- the signal is called with is already the model row, not the view
- row, so don't call e_table_view_to_model_row on it.
-
-2003-04-23 Chris Toshok <toshok@ximian.com>
-
- [ either mostly or entirely fixes #33708 ]
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_done): new function, factor it out of
- _seq_complete_cb because we need to run the same code in a couple
- of places.
- (e_select_names_completion_got_book_view_cb): treat an error from
- a book as getting a "sequence_complete", and decrement the count
- of pending complete signals.
- (e_select_names_completion_got_book_view_cb): remove the increment
- of pending_completion_seq from here.
- (e_select_names_completion_seq_complete_cb): factor out the body
- of e_select_names_completion_done from here, and call it.
- (e_select_names_completion_start_query): increment
- pending_completion_seq here. remove the async variable, as we can
- now use pending_completion_seq for that purpose (it's > 0 iff
- async would have been TRUE).
-
-2003-04-19 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #40954 ]
- * backend/pas/pas-backend-file.c (pas_backend_file_dispose): guard
- against NULL bf->priv->summary (happens if the initial load_uri
- failed).
- (pas_backend_file_load_uri): always set bf->priv->uri, since it's
- used in _get_uri, which is called when the backend goes away.
- This only happened before if you tried to load a folder that
- didn't exist.
-
-2003-04-19 Chris Toshok <toshok@ximian.com>
-
- [ fixes #40694 ]
- * gui/component/select-names/e-select-names-bonobo.c
- (control_activate_cb): just grab focus if @activate == TRUE.
- we'll do all merging/unmerging in the focus handler.
- (widget_focus_cb): handle the merging here.
- (e_bonobo_control_automerge_ui): store off the widget (so we can
- grab focus on it) and connect to "activate".
-
-2003-04-18 Rodney Dawes <dobey@ximian.com>
-
- * gui/component/select-names/Makefile.am: Add missing -DPREFIX
-
-2003-04-18 Rodney Dawes <dobey@ximian.com>
-
- [ fixes #21499 ]
- * gui/component/Makefile.am:
- * gui/component/addressbook.c:
- * gui/component/select-names/e-select-names-bonobo.c:
- * gui/contact-editor/Makefile.am:
- * gui/contact-editor/e-contact-editor.c:
- * gui/contact-list-editor/Makefile.am:
- * gui/contact-list-editor/e-contact-list-editor.c:
- Use PREFIX instead of EVOLUTION_DATADIR for bonobo_ui_util_set_ui ()
-
-2003-04-15 Chris Toshok <toshok@ximian.com>
-
- [ fixes #41252 ]
- * gui/contact-editor/fulladdr.glade: change title from "Check
- Address" to "Full Address".
-
-2003-04-09 Chris Toshok <toshok@ximian.com>
-
- [ fixes #40727 ]
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_start_query): if the query text is
- either shorter than the cached query_text or they don't match,
- don't just set can_reuse_cached_cards to FALSE. we also need to
- invalidate the cache.
-
-2003-04-08 Ettore Perazzoli <ettore@ximian.com>
-
- * backend/ebook/e-destination.c (d): Remove all debugging
- messages.
-
-2003-04-08 Dan Winship <danw@ximian.com>
-
- * gui/component/ldap-config.glade: Remove color specifications
- from the druid so it will use theme colors.
-
- * gui/component/addressbook-config.c
- (addressbook_add_server_druid): Use g_signal_connect_after for
- "prepare" signal (to work around b.g.o 81869)
-
-2003-04-07 Chris Toshok <toshok@ximian.com>
-
- [ fixes #7103 ]
- * gui/widgets/e-minicard-label.c (e_minicard_label_class_init):
- init style_set. and add the signal.
- (e_minicard_label_realize): include e_minicard_label_construct's
- code here, and call set_colors after we create the sub-items.
- (e_minicard_label_unrealize): indent, and remove dead code.
- (e_minicard_label_event): indent, and call set_colors instead of
- setting the colors manually.
- (set_colors): new function, set our colors based on the current
- style.
- (e_minicard_label_style_set): new function, just call set_colors.
- (e_minicard_label_new): e_minicard_label_construct doesn't exist
- anymore.
-
- * gui/widgets/e-minicard-label.h (struct _EMinicardLabelClass):
- add style_set signal.
-
- * gui/widgets/e-minicard.c (set_selected): little tweaks in the
- coloring.
- (e_minicard_unrealize): reindent, and remove some unused code.
-
- * gui/widgets/e-minicard-view-widget.h (struct
- _EMinicardViewWidget): add background.
-
- * gui/widgets/e-minicard-view-widget.c
- (e_minicard_view_widget_class_init): init
- widget_class->style_class.
- (e_minicard_view_widget_style_set): new function, just set the
- background's fill_color_gdk to base[GTK_STATE_NORMAL].
- (e_minicard_view_widget_realize): store off the background canvas
- item so we can set the color later.
-
-2003-04-07 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #40901 ]
- * gui/component/ldap-config.glade: HIG-ify the ldap server edit
- dialog's button layout.
-
-2003-04-07 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #39763 ]
- * gui/component/select-names/e-select-names-bonobo.c (copy_cb):
- verb callback for EditCopy
- (cut_cb): verb callback for EditCut.
- (paste_cb): verb callback for EditPaste.
- (select_all_cb): verb callback for SelectAll.
- (free_closure): new function
- (merge_menu_items): same
- (unmerge_menu_items): same
- (control_set_frame_cb): same
- (control_activate_cb): same
- (widget_focus_cb): same
- (e_bonobo_control_automerge_ui): new function, sets up focus
- signals on the widget passed in to merge/unmerge the passed in
- ui/verbs.
- (impl_SelectNames_get_entry_for_section): call
- e_bonobo_control_automerge_ui for this entry.
-
-2003-04-07 Chris Toshok <toshok@ximian.com>
-
- * gui/component/e-address-popup.c (mini_wizard_new): change the
- ok/cancel button layout to be higified.
-
-2003-04-07 Chris Toshok <toshok@ximian.com>
-
- [ last portion of #40046 fix ]
- * gui/component/select-names/e-select-names-popup.c
- (remove_recipient_cb): ifdef this out to quiet the compiler.
- (remove_all_recipients_cb): same.
- (toggle_html_mail_cb): same.
- (populate_popup_card): change the #if 0 to #if
- TOO_MANY_MENU_ITEMS.
- (popup_menu_list): nuke, as it's handled by populate_popup_card.
- (populate_popup_nocard): rename popup_menu_nocard to this, and
- implement it as in populate_popup_card.
- (e_select_names_populate_popup): we don't need the card, since we
- don't check if it's a list here anymore. also, remove the #if 0
- surrounding the nocard case.
-
-2003-04-07 Not Zed <NotZed@Ximian.com>
-
- Fixes #40252.
-
- * conduit/address-conduit.c: Change the LOG macro to a
- single arg macro which copies its arg. Fix all callers. Change
- WARN and INFO to simply g_warning/g_message. Init G_LOG_DOMAIN
- before including anything.
-
-2003-04-07 Chris Toshok <toshok@ximian.com>
-
- * Makefile.am (SUBDIRS): add tools.
-
-2003-04-07 Gilbert Fang <gilbert.fang@sun.com>
-
- [ fixes bug #23036 ]
- * tools/evolution-addressbook-export.c,
- tools/evolution-addressbook-export-list-cards.c,
- tools/evolution-addressbook-export-list-folders.c: : new and
- improved export utility.
-
-2003-04-07 Dan Winship <danw@ximian.com>
-
- * gui/component/GNOME_Evolution_Addressbook.server.in.in: Clean up
- server names.
-
- * gui/component/select-names/GNOME_Evolution_Addressbook_SelectNames.server.in.in:
- Likewise
-
- * backend/ebook/GNOME_Evolution_Addressbook_LDIF_Importer.server.in.in:
- Likewise. Also mark the evolution:menu_name for i18n.
-
- * backend/ebook/GNOME_Evolution_Addressbook_VCard_Importer.server.in.in:
- Likewise
-
-2003-04-03 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-minicard-label.c (e_minicard_label_event): set
- "handle_popup" on the field to be TRUE if it's got focus, FALSE if
- not.
-
-2003-04-03 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-minicard-label.c (e_minicard_label_construct):
- doh, set the im_context on the field name too so we get the Input
- Method submenu in the contxt menu.
-
-2003-04-03 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-minicard-label.c (e_minicard_label_construct): set
- the im_context on the field's EText.
- (e_minicard_label_event): remove a huge swath of #if 0'd code.
-
-2003-04-03 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #40715 ]
- * gui/merging/e-card-merging.c (final_id_cb): add this callback,
- to unref the book/free the closure after calling the user's
- callback.
- (final_cb): same.
- (doit): use final{_id}_cb
- (cancelit): same.
- (response): don't free the lookup struct here.
- (match_query_callback): same.
- (e_card_merging_book_add_card): ref the book.
- (e_card_merging_book_commit_card): same.
-
- * gui/component/e-address-popup.c (card_picker_init): make sure to
- set the "text" attribute on the cell renderer so the text actually
- shows up. also, g_object_connect -> g_signal_connect *sigh*.
- Lastly, get rid of the scrolled window and just make the window
- size to show the text.
-
- * gui/widgets/e-minicard.c (e_minicard_style_set): only call
- set_selected if we're realized (we create all the canvas objects
- that set_selected manipulates in our realize method.)
-
-2003-04-03 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/Makefile.am (INCLUDES): add
- EVOLUTION_IMAGESDIR
-
-2003-04-02 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-popup.c: change all
- this around so that we populate the existing popup. This means we
- get the select names popup stuff on top of the normal EEntry popup
- foo.
-
- * gui/component/select-names/e-select-names-popup.h
- (e_select_names_populate_popup): rename e_select_names_popup to
- this.
-
- * gui/component/select-names/e-select-names-manager.c
- (populate_popup_cb): rename popup_cb here, and
- e_select_names_popup -> e_select_names_populate_popup.
- (e_select_names_manager_entry_new): popup -> populate_popup.
-
-2003-04-02 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-marshal.list: add NONE:OBJECT
-
- * gui/widgets/e-minicard.c (e_minicard_class_init): add style_set
- signal.
- (e_minicard_style_set): just call set_selected with the currently
- selected flag, so we recolor properly.
-
- * gui/widgets/e-minicard.h (struct _EMinicardClass): add style_set
- signal.
-
-2003-04-01 Rodrigo Moya <rodrigo@ximian.com>
-
- * backend/ebook/evolution-ldif-importer.c (load_file_fn):
- * backend/ebook/evolution-vcard-importer.c (load_file_fn): added
- "folder_type" parameter to EvolutionImporterLoadFileFn.
-
-2003-03-31 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book-util.c (get_local_book_uri): new function,
- just return the local uri.
- (set_default_book_uri_local): use get_local_book_uri.
- (e_book_default_book_open): only try and reload the default book
- if it's not already the local book.
-
-2003-03-31 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (card_removed): it emits a list now
-
-2003-03-31 Dan Winship <danw@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_init): Remove folder-selector button
- initialization.
- (e_select_names_new): Initialize folder-selector button here,
- using the passed-in EvolutionShellClient rather than depending on
- a global variable.
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_activate_dialog): take an
- EvolutionShellClient and pass it to e_select_names_new().
-
- * gui/component/select-names/e-select-names-bonobo.c
- (impl_SelectNames_activate_dialog): get a pointer to the shell
- from bonobo-activation, create a shell_client, and pass it to
- e_select_names_manager_activate_dialog.
-
- * backend/ebook/e-book-util.c (e_book_get_default_book_uri):
- constify return value
-
-2003-03-30 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-vcard.[ch]: braindead, and *extremely* forgiving
- vcard parser. not for public consumption yet.
-
-2003-03-30 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #39381 (again) ]
- * gui/component/e-address-popup.c (edit_contact_info_cb): add
- "GtkWidget *button" first arg, so we don't crash.
-
-2003-03-28 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #40403 ]
- * backend/ebook/e-card.c (e_card_get_vobject): revert the fix for
- 28945, as was done on the 1.2 branch. this is because the "fix"
- actually breaks internal use of contact lists. We need to make
- the exporting of contacts DTRT, instead of fixing it here.
-
-2003-03-28 Chris Toshok <toshok@ximian.com>
-
- [ fix the contact editor so that the only time the address is
- parsed is when the user types in the address GtkTextView. ]
- * gui/contact-editor/e-contact-editor.c (address_mailing_changed):
- make this use delivery addresses instead of labels.
- (full_addr_clicked): same.
- (find_address_mailing): same.
-
- * backend/ebook/e-card-simple.c
- (e_card_simple_set_delivery_address): make this operate similar to
- e_card_simple_set_address: it sets both the delivery address and
- the label for the address.
-
-2003-03-26 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #19178 ]
- * backend/ebook/evolution-ldif-importer.c (ebook_open): use
- e_book_load_address_book_by_uri on the passed in uri.
- (load_file_fn): pass the uri.
-
- * backend/ebook/evolution-vcard-importer.c (ebook_open): use
- e_book_load_address_book_by_uri on the passed in uri.
- (load_file_fn): pass the uri.
-
-2003-03-26 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #34651 ]
- * gui/component/select-names/e-select-names.c
- (select_entry_changed): strcmp -> g_utf8_collate.
- (update_query): encode the string we pass for the query.
-
-2003-03-26 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #34085 ]
- * gui/contact-list-editor/e-contact-list-editor.c
- (table_drag_data_received_cb): only successfully complete the drag
- if they dropped a valid vcard (or vcard list). Call
- gtk_drag_finish.
-
-2003-03-26 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-list-editor/Makefile.am (INCLUDES): $evolution_uidir
- -> $evolutionuidir
-
-2003-03-26 Philip Zhao <philip.zhao@sun.com>
-
- [ fixes bug #39170 ]
- * backend/pas/pas-backend.c (pas_backend_create_card): remove
- 'return'.
- (pas_backend_remove_cards): same.
- (pas_backend_modify_card): same.
- (pas_backend_check_connection): same.
- (pas_backend_get_vcard): same.
- (pas_backend_get_cursor): same.
- (pas_backend_get_book_view): same.
- (pas_backend_get_completion_view): same.
- (pas_backend_get_changes): same.
- (pas_backend_authenticate_user): same.
- (pas_backend_get_supported_fields): same.
- (pas_backend_get_supported_auth_methods): same.
-
-2003-03-26 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (local_record_from_ecard): append the
- second line to the address if necessary
- (ecard_from_remote_record): split the address line in two if
- necessary
-
-2003-03-23 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-list-editor/contact-list-editor.glade: set the
- dialog to "Visible: No" so it doesn't flash when we bring it up.
-
-2003-03-23 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #40026 ]
- * gui/contact-editor/e-contact-editor.c (set_field): add
- EContactEditor arg, and block/unblock signals around the
- gtk_entry_set_text, since that generates a "changed" signal which
- causes problems.
- (set_phone_field): take and pass along an EContactEditor arg.
- (set_fields): pass editor to set_field.
-
-2003-03-23 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/arrow.png: nuke.
-
- * gui/contact-editor/Makefile.am (EXTRA_DIST): remove images_DATA
- (images_DATA): nuke, don't need it anymore.
-
- * gui/contact-editor/e-contact-editor.c
- (connect_arrow_button_signal): rename _replace_button to this. we
- no longer create an image, as it's a GtkArrow in the .glade file
- now.
- (connect_arrow_button_signals): rename _replace_buttons to this.
- no longer pass the arrow.png's to _replace_button.
- (e_contact_editor_init): _replace_buttons ->
- connect_arrow_button_signals.
- (_arrow_pressed): remove some dead code, and some args that aren't
- used.
- (_phone_arrow_pressed): track change to _arrow_pressed.
- (_email_arrow_pressed): same.
- (_address_arrow_pressed): same.
-
-2003-03-23 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #31786 ]
- * gui/component/addressbook-config.c
- (addressbook_source_dialog_set_source): fix some gtk warnings.
- (set_advanced_button_state): the advanced dialog isn't present in
- the glade file anymore, so ifdef everything dealing with it.
- (addressbook_edit_server_dialog): same.
-
- * gui/component/ldap-config.glade: remove all the unused Advanced
- UI stuff to lessen the amount of strings needing translation.
-
-2003-03-23 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #32113 ]
- * backend/ebook/e-destination.h: add include_email arg to
- e_destination_get_textrep.
-
- * backend/ebook/e-destination.c (e_destination_get_textrep): add
- include_email arg. if it's TRUE, and if there's an email address to
- add
-
- * gui/contact-list-editor/e-contact-list-model.c
- (contact_list_value_at): use e_destination_get_textrep so we don't
- display QP text, and pass TRUE for include_email.
-
- * gui/widgets/e-minicard.c (add_field): same.
- (remodel): same.
-
- * gui/widgets/e-addressbook-treeview-adapter.c (adapter_get_value): same.
-
- * gui/widgets/e-addressbook-table-adapter.c (addressbook_value_at): same.
-
- * gui/component/select-names/e-select-names-text-model.c
- (e_select_names_text_model_insert_length): pass FALSE for
- include_email.
-
- * gui/component/select-names/e-select-names-model.c
- (e_select_names_model_get_textification): pass FALSE for
- include_email.
- (e_select_names_model_get_string): same.
- (e_select_names_model_replace): same.
- (e_select_names_model_name_pos): same.
- (e_select_names_model_text_pos): same.
-
-2003-03-19 Ettore Perazzoli <ettore@ximian.com>
-
- * backend/ebook/GNOME_Evolution_Addressbook_VCard_Importer.server.in.in:
- Replace "evolution:menu-name" prop with "evolution:menu_name". [#39692]
- * backend/ebook/GNOME_Evolution_Addressbook_LDIF_Importer.server.in.in: Likewise.
-
-2003-03-18 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-table-model.c
- (e_select_names_table_model_col_count): up the column count by one
- for the underline.
- (e_select_names_table_model_value_at): add handling for underline.
-
-2003-03-18 Chris Toshok <toshok@ximian.com>
-
- * gui/component/e-address-popup.c (email_menu_add_option): fix use
- of deprecated gtk_menu_append.
- (card_picker_selection_changed): change this to be used with the
- "changed" signal on GtkTreeSelection.
- (free_str): yeah, gross. i know.
- (card_picker_init): this needed some fixing, so the strings don't
- go away after we insert them into the model. also, connect to the
- "changed" GtkTreeSelection signal instead of using the nonexistant
- gtk_tree_selection_set_func.
- (e_address_popup_construct): gtk_style_unref -> g_object_unref.
- (popup_size_allocate_cb): nuke.
- (e_address_popup_ambiguous_email_add): use gtk_window_set_position
- and let the window manager place the window instead of doing it
- ourself.
-
-2003-03-18 Chris Toshok <toshok@ximian.com>
-
- [ Fixes addressbook bug #39730 ]
- * gui/component/ldap-config.glade: add response ids to the search
- base dialog.
-
- * gui/component/addressbook-config.c
- (addressbook_source_dialog_destroy): use g_object_unref, not
- gtk_widget_destroy, on the GladeXML.
- (addressbook_add_server_druid): call gtk_window_set_type_hint
- GDK_WINDOW_TYPE_HINT_DIALOG so this window looks like a dialog.
- (editor_modify_cb): no more apply button.
- (edit_dialog_apply_clicked): nuked.
- (edit_dialog_close_clicked): rename to _cancal_clicked.
- (edit_dialog_ok_clicked): call gtk_widget_destroy here instead of
- calling _cancel_clicked.
- (addressbook_edit_server_dialog): no more apply button, and
- close_button -> cancel_button. Also, set the hint to
- GDK_WINDOW_TYPE_HINT_DIALOG.
- (ldap_dialog_new): fix compiler warning.
- (addressbook_dialog_create_sources_table): same.
-
-2003-03-18 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-section.etspec: use
- alternating-row-colors="false"
-
- * gui/component/select-names/e-select-names.h: nuke prototypes for
- e_select_names_get_source/section.
-
- * gui/component/select-names/e-select-names.c (set_book): remove
- the signal disconnect from here.
- (addressbook_model_set_uri): same.
- (e_select_names_init): connect to the search_result signal on the
- addressbook model.
- (e_select_names_child_free): disconnect the changed_id signal.
- (e_select_names_add_section): set the underline column so the
- recipient tables look like they did when they were EEntry.
- (e_select_names_add_section): store off the changed_id.
- (e_select_names_get_section): nuke.
- (e_select_names_get_source): nuke.
-
-2003-03-18 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (addrconduit_load_configuration): kill
- warning by sinking objects
-
-2003-03-18 Not Zed <NotZed@Ximian.com>
-
- * gui/component/select-names/e-select-names.c (set_book,
- addressbook_model_set_uri): disconnect/keep track of search result
- signal id.
- (e_select_names_init): Keep track of various signals, particularly
- status signal.
- (e_select_names_dispose): disconnect from any signals that are
- still active. Fixes crash for #38202.
-
-2003-03-13 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c
- (set_entry_changed_signals): use set_entry_changed_signal_email
- for the email entry so the email gets saved out.
- (set_entry_changed_signal_email): new function, analogous to
- set_entry_changed_signal_phone, but for email.
-
-2003-03-12 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #20210 ]
- * gui/component/select-names/e-select-names-popup.c
- (popup_menu_card): change "Edit Contact Info" to "View Contact
- Info", as you can't always edit the contact (if the book is read
- only).
- (popup_menu_list): same, but for a contact list.
-
-2003-03-11 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #39507 ]
- * gui/component/select-names/e-select-names.c (search_result): new
- function, sync the models after we do a search.
- (addressbook_model_set_uri): connect to search_result.
-
-2003-03-11 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_init): fix compiler warnings about deprecated
- functions.
- (e_select_names_child_free): unref the table model.
- (remove_address): re-enable.
- (section_right_click_cb): this is an ETable callback now.
- (e_select_names_add_section): remove a gross gross awful hack, and
- make the recipient tables ETables instead EEntry's. We lose the
- nice underlining, but we can add that back in as another ETable
- style (like strikeout and bold), and we also fix the longstanding
- scrolling problems (like bug #25148) and can finally remove
- addresses by double clicking on them (which is also a bug
- someplace I think.. dunno the # offhand.)
-
- * gui/component/select-names/e-select-names-table-model.c
- (clear_info): always set the count to -1, regardless of what
- model->data is.
-
- * gui/component/select-names/e-select-names-model.c: remove some
- unused enums.
-
- * gui/component/select-names/Makefile.am (etspec_DATA): add
- e-select-names-section.etspec
-
- * gui/component/select-names/e-select-names-section.etspec: new
- file, spec for the To:/Cc:/Bcc: etable's in the select-names
- dialog.
-
-2003-03-11 Not Zed <NotZed@Ximian.com>
-
- * backend/pas/pas-backend-file.c (INITIAL_VCARD): Updated phone
- number. Bug #37204.
-
- * gui/widgets/e-addressbook-util.c (e_addressbook_send_card_list):
- re-enable in build, include e-destination.h. For #39256.
-
-2003-03-06 Ettore Perazzoli <ettore@ximian.com>
-
- * backend/ebook/load-pine-addressbook.c (ebook_create): Likewise.
- * backend/ebook/load-gnomecard-addressbook.c (ebook_create): Likewise.
- * backend/ebook/evolution-vcard-importer.c (ebook_create): Likewise.
- * backend/ebook/evolution-ldif-importer.c (ebook_create): Likewise.
- * backend/ebook/test-client.c (get_cursor_cb): Likewise.
- (ebook_create): Likewise.
- * gui/widgets/e-minicard.c (e_minicard_set_property): Likewise.
- (card_modified_cb): Likewise.
- (e_minicard_event): Likewise.
- * gui/widgets/gal-view-minicard.c (column_width_changed): Likewise.
- * gui/widgets/test-minicard-view.c (ebook_create): Likewise.
- * gui/widgets/gal-view-treeview.c (column_width_changed): Likewise.
-
-2003-03-05 Not Zed <NotZed@Ximian.com>
-
- * gui/component/addressbook-component.c (bonobo_main_quit_cb):
- removed.
- (owner_unset_cb): Basically a noop, the shell does the quit, we
- just note we have no owner anymore.
-
-2003-03-04 JP Rosevear <jpr@ximian.com>
-
- Fixes #37881
-
- * gui/component/select-names/e-simple-card-bonobo.c
- (impl_SimpleCard_get): if we get a null value, send back the empty
- string
-
-2003-03-04 JP Rosevear <jpr@ximian.com>
-
- * gui/component/select-names/e-select-names.etspec: reflect prior column addition
-
- * gui/component/select-names/e-select-names-bonobo.c
- (entry_get_property_fn): set the arg properly
-
- * gui/component/select-names/Evolution-Addressbook-SelectNames.idl:
- add Icscalendar to field list
-
- * backend/pas/pas-backend-ldap.c: add icscalendar to prop list
-
- * backend/ebook/e-card.h: add icscalendar data member
-
- * backend/ebook/e-card.c: add icscalendar to list and its parse
- routine
- (e_card_get_vobject): add icscalendar prop value
- (parse_icscalendar): parse routine
- (e_card_class_init): add icscalendar arg
- (e_card_destroy): destroy icscalendar member
- (e_card_set_arg): set icscalendar
- (e_card_init): init icscalendar
- (e_card_get_arg): return icscalendar
-
- * backend/ebook/e-card-simple.c (field_data): add icscalendar
-
- * backend/ebook/e-card-simple.h: ditto
-
-2003-03-03 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_new): Don't set the "modal" property through
- g_object_new().
- (e_select_names_init): Explictly make the dialog modal here.
-
-2003-03-03 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (create_minicard_view): No need
- to do any reparenting here; the widget is created with no parent.
-
-2003-03-03 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_init): Instead of using gtk_widget_unparent(),
- remove the widget from the container using gtk_container_remove().
- This fixes a bunch of crashers in all the places using the
- ESelectNames widget/control.
-
-2003-02-28 Dan Winship <danw@ximian.com>
-
- * gui/contact-editor/Makefile.am: Build libecontacteditor as an
- uninstalled shared library.
-
- * gui/contact-list-editor/Makefile.am: Likewise for
- libecontactlisteditor
-
- * gui/merging/Makefile.am: and libecardmerging
-
- * gui/search/Makefile.am: and libeaddressbooksearch
-
- * gui/widgets/Makefile.am: and libeminicard
-
- * printing/Makefile.am: and libecontactprint
-
- * gui/component/Makefile.am (libevolution_addressbook_la_LIBADD):
- Update for new library names (and get rid of libtool portability
- warnings).
-
-2003-02-28 Dan Winship <danw@ximian.com>
-
- * backend/ebook/e-card.c (e_card_list_send, e_card_send): Remove
- these from here; talking to the mailer doesn't really belong at
- the libebook level anyway.
-
- * backend/ebook/Makefile.am: Remove Evolution-Composer CORBA
- stuff, which fixes some linking problems on OS X.
-
- * gui/widgets/e-addressbook-util.c (e_addressbook_send_card_list,
- e_addressbook_send_card): Move from e-card.c and rename.
-
- * gui/widgets/Makefile.am: move Evolution-Composer CORBA stuff
- here
-
- * gui/widgets/e-addressbook-view.c (send_as, send_to,
- e_addressbook_view_send, e_addressbook_view_send_to): Update for
- new function names.
-
- * gui/contact-list-editor/e-contact-list-editor.c (file_send_as_cb,
- file_send_to_cb): Likewise
-
- * gui/contact-editor/e-contact-editor.c (file_send_as_cb,
- file_send_to_cb): Likewise
-
-2003-02-27 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c (book_open_cb): use g_signal_connect
- here, not swapped... although since we pass the widget as the
- closure it really doesn't matter.
- (load_uri_auth_cb): use a GtkDialog here.
- (search_result): same.
-
- * gui/component/select-names/e-simple-card-bonobo.h: add prototype
- for e_simple_card_bonobo_construct to fix warning.
-
- * gui/widgets/e-addressbook-view.c (create_alphabet): remove call
- to gtk_widget_set_usize.
-
- * gui/contact-editor/e-contact-editor-address.c
- (e_contact_editor_address_init): gtk_window_set_policy =>
- gtk_window_set_resizable.
-
- * gui/contact-editor/e-contact-editor-fullname.c
- (e_contact_editor_fullname_init): same.
-
-2003-02-27 JP Rosevear <jpr@ximian.com>
-
- * conduit/Makefile.am: link to libversit libtool object
-
-2003-02-27 Rodney Dawes <dobey@ximian.com>
-
- * backend/ebook/Makefile.am: Fix for server files from Antonio Xu
-
-2003-02-26 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book.c (e_book_load_uri): if we fail to activate
- factories for a given protocol, return.
-
- * gui/component/ldap-config.glade: remove the two unused custom
- widgets to cut down on gtk warning spam.
-
-2003-02-21 Dan Winship <danw@ximian.com>
-
- * backend/ebook/Makefile.am (libebook_la_LIBADD): depend on
- libversit.la, libcamel.la, libename.la, and libeutil.la.
- (test_client_LDADD, test_client_list_LDADD, test_card_LDADD,
- evolution_vcard_importer_LDADD, evolution_ldif_importer_LDADD,
- load_pine_addressbook_LDADD, load_gnomecard_addressbook_LDADD):
- Remove those dependencies from here, since they're pulled in by
- libebook.
-
- * gui/component/Makefile.am (libevolution_addressbook_la_LIBADD):
- Remove libebook's dependencies
-
- * gui/component/select-names/Makefile.am
- (libeselectnames_la_LIBADD): add this
-
- * gui/widgets/Makefile.am (various disabled *_test_LDADD): cleanup
-
- * printing/Makefile.am (contact_print_test_LDADD,
- contact_print_style_editor_test_LDADD): cleanup
-
-2003-02-20 Dan Winship <danw@ximian.com>
-
- * gui/component/Makefile.am (libevolution_addressbook_la_LIBADD):
- s/libemiscwidgets.a/libemiscwidgets.la/
-
- * gui/widgets/Makefile.am: Likewise (in a bunch of commented-out
- test programs)
-
-2003-02-19 Dan Winship <danw@ximian.com>
-
- * gui/widgets/e-addressbook-model.c: Make parent_class static.
-
- * gui/widgets/e-addressbook-reflow-adapter.c: Likewise
-
- * gui/widgets/e-addressbook-table-adapter.c: Likewise
-
-2003-02-19 Chris Toshok <toshok@ximian.com>
-
- [ fix #38074 ]
- * gui/component/e-address-popup.c (add_contacts_cb): first arg is
- a GtkWidget. duh.
-
-2003-02-19 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/contact-editor/Makefile.am (INCLUDES): Use $(evolutionuidir)
- instead of $(evolution_uidir). [Pointed out by Grzegorz Goawski.]
-
-2003-02-17 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_start_query): if we can complete solely
- from our cached cards, call e_completion_end_search from here when
- we're done.
-
-2003-02-17 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-component.c
- (ensure_completion_uris_exist): plug memory leak (always free
- val).
-
-2003-02-16 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_search_timeout): move the bulk of the
- non-summary searching stuff here. we aggregate up to our
- threshold, then send them to the front end and register a timeout
- to do another batch. This keeps us from totally spamming the UI,
- making things a bit more responsive.
- (pas_backend_file_search): set up the closure and call the timeout
- in an idle func.
-
-2003-02-16 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_entry_new): indent properly.
-
-2003-02-16 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-reflow-adapter.c (unlink_model):
- disconnect search_started and search_result.
- (addressbook_compare): if we're loading, just compare model
- positions (so we just append while loading).
- (remove_card): use e_reflow_model_item_removed.
- (search_started): new function, set loading = TRUE.
- (search_result): new function, set loading = FALSE and emit
- "comparison_changed".
- (e_addressbook_reflow_adapter_init): init loading and the new
- signal ids.
- (e_addressbook_reflow_adapter_construct): connect "search_started"
- and "search_result".
-
- * gui/widgets/e-addressbook-model.h (struct
- _EAddressbookModelClass): add search_started signal.
-
- * gui/widgets/e-addressbook-model.c
- (e_addressbook_model_class_init): new signal "search_started".
- (book_view_loaded): emit "search_started" after "model_changed".
- (remove_card): simplify this, and use CARD_REMOVED all the time,
- instead of just in the single card case.
-
-2003-02-10 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_search_timeout): split out the bulk of the
- non-summary searching logic to here. we do 1 "card_threshold"
- sized lump per timeout.
- (pas_backend_file_search): use pas_backend_file_search_timeout.
-
-2003-02-10 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #33066 ]
- * gui/contact-editor/e-contact-editor.c
- (set_urlentry_changed_signal_field): new function
- (set_entry_changed_signals): call
- set_urlentry_changed_signal_field for entry-web, entry-caluri, and
- entry-fburl.
- (fill_in_field): add handling for EUrlEntry's.
- (extract_field): same.
- (enable_widget): same.
- (e_contact_editor_create_date): show the widget.
- (e_contact_editor_create_web): same, create a url entry.
- (set_urlentry_changed_signal_field): new function
-
- * gui/contact-editor/contact-editor.glade: entry-web,
- entry-caluri, and entry-fburl are all custom widgets now.
-
-2003-02-10 Ettore Perazzoli <ettore@ximian.com>
-
- * backend/ebook/Makefile.am: Install load-pine-addressbook and
- load-gnomecard-addressbook into ${privdatadir}/tools. Install
- evolution-vcard-importer and evolution-ldif-importer into
- ${privlibexecdir}.
-
- * backend/ebook/GNOME_Evolution_Addressbook_VCard_Importer.server.in:
- Removed.
-
- * backend/ebook/GNOME_Evolution_Addressbook_LDIF_Importer.server.in:
- Removed.
-
- * backend/ebook/GNOME_Evolution_Addressbook_VCard_Importer.server.in.in:
- New. Specify an absolute path for the executable, using
- @LIBEXECDIR@.
- * backend/ebook/GNOME_Evolution_Addressbook_LDIF_Importer.server.in.in:
- Likewise.
-
-2003-02-09 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (sexp_initials): gone.
- (match_initials): gone.
- (book_query_sexp): remove the primary handling.
- (book_query_score): same.
-
- * backend/ebook/e-card.c (e_card_set_property):
- g_value_get_pointer => g_value_get_object for "category_list".
-
- * backend/ebook/e-book.c (struct _EBookPrivate): add a comment.
-
- * backend/pas/pas-backend-ldap.c (func_beginswith): performance at
- the cost of a tiny bit of correctness. If the ldap server doesn't
- support evolutionPerson don't query on fileAs, use sn (since
- that's effectively what gets used in the display when fileAs isn't
- supported.)
-
-2003-02-09 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c: lots of
- changes here. should be a big performance gain. god i hope this
- is finally right.
-
-2003-02-08 Chris Toshok <toshok@ximian.com>
-
- [ huge change, all for 1 little performance problem :) fixes #18207 ]
- * gui/widgets/e-addressbook-model.c (get_view): use
- e_book_check_static_capability here to make things a little
- prettier.
- (remove_card): complain about my life, and add code to use one
- "model_changed" signal if we get back a list of cards instead of
- multiple "card_removed" signals.
-
- * gui/widgets/e-addressbook-model.h: little clean up.
-
- * gui/widgets/e-addressbook-view.c (delete): write a bulk-remove
- case for this. if the backend supports it, send all the ids at
- once. otherwise loop over the ids.
- (e_addressbook_view_delete_selection): fake a CardAndBook
- structure and call delete, instead of duplicating the code in 2
- places.
-
- * gui/component/addressbook.c (delete_contact_cb): don't call
- e_contact_editor_confirm_delete here, it's handled by the
- EAddressbookView.
-
- * backend/pas/pas-card-cursor.c (pas_card_cursor_construct): fix a
- compiler warning about a stupid crash.
-
- * backend/pas/pas-book.h (PASOperation): RemoveCard ->
- RemoveCards.
- (PASRemoveCardsReques): char *id -> GList *ids.
- (PASRequest): PASRemoveCardRequest -> PASRemoveCardsRequest.
-
- * backend/pas/pas-book.c (pas_book_queue_remove_cards): build up a
- GList from the id sequence.
- (pas_book_respond_remove): notifyCardRemoved ->
- notifyCardsRemoved.
- (impl_GNOME_Evolution_Addressbook_Book_removeCards): rename.
- (pas_book_free_request): free the idlist for RemoveCards.
- (pas_book_class_init): removeCard -> removeCards.
-
- * backend/pas/pas-book-view.h: change prototype for
- pas_book_view_notify_remove, and add prototype for
- pas_book_view_notify_remove_1.
-
- * backend/pas/pas-book-view.c (pas_book_view_notify_remove_1):
- build up a list and call pas_book_view_notify_remove.
- (pas_book_view_notify_remove): build up the corba id sequence and
- call BookViewListener::notifyCardsRemoved.
-
- * backend/pas/pas-backend.h: remove_card -> remove_cards.
-
- * backend/pas/pas-backend.c (pas_backend_remove_cards): rename
- from _remove_card.
- (process_client_requests): RemoveCard -> RemoveCards and
- _remove_card -> _remove_cards.
-
- * backend/pas/pas-backend-ldap.c (check_schema_support):
- g_strcasecmp -> g_ascii_strcasecmp.
- (remove_card_handler): _remove => _remove_1.
- (modify_card_modify_handler): same.
- (pas_backend_ldap_process_remove_cards): rename from _remove_card.
- (pas_backend_ldap_class_init): _remove_card -> _remove_cards.
-
- * backend/pas/pas-backend-file.c (pas_backend_file_class_init):
- remove_card -> remove_cards.
- (pas_backend_file_get_static_capabilities): add "bulk-removes".
- (pas_backend_file_process_remove_cards): rewrite this function
- largely, so that it handles lists of ids. first we loop through
- and for every successful deletion we build a list of deleted
- ECards. Then for each view we build a list (a subset of the
- deleted ECard list) and pass back that list to the view.
- (pas_backend_file_process_modify_card): use _remove_1 instead of
- _remove.
- (ecard_matches_search): new function.
-
- * backend/pas/pas-backend-card-sexp.c
- (pas_backend_card_sexp_match_vcard): rewrite in terms of
- _match_ecard.
- (pas_backend_card_sexp_match_ecard): new function, the guts from
- _match_vcard.
-
- * backend/pas/pas-backend-card-sexp.h: add prototype for
- pas_backend_card_sexp_match_ecard.
-
- * backend/idl/addressbook.idl: the card removal stuff now takes
- CardIdList.
-
- * backend/ebook/e-book.c (e_book_get_static_capabilities): cache
- successful capability queries (since they're static).
- (e_book_check_static_capability): new, convenience function to
- check if a particular capability is supported.
- (e_book_remove_card_by_id): build a single element GList and call
- e_book_remove_cards.
- (e_book_remove_cards): build up a CORBA sequence from the GList
- and call Book::removeCards.
- (e_book_dispose): free the cached capabilities string.
-
- * backend/ebook/e-book.h: add new prototypes for
- e_book_check_static_capability and e_book_remove_cards.
-
- * backend/ebook/e-book-view.h (struct _EBookViewClass): rename
- "card_removed" signal to "cards_removed".
-
- * backend/ebook/e-book-view.c (e_book_view_do_removed_event): id
- -> ids, and free the id list.
- (e_book_view_check_listener_queue): CardRemovedEvent ->
- CardsRemovedEvent.
-
- * backend/ebook/e-book-view-listener.c
- (e_book_view_listener_queue_response): free the id list.
- (e_book_view_listener_queue_idlist_event): new function, used for
- cards_removed.
- (e_book_view_listener_queue_status_event): id -> ids.
- (e_book_view_listener_queue_sequence_event): same.
- (e_book_view_listener_queue_message_event): same.
- (impl_BookViewListener_notify_cards_removed): call
- queue_idlist_event.
- (e_book_view_listener_dispose): free the id list.
- (e_book_view_listener_class_init): track change to idl call.
-
- * backend/ebook/e-book-view-listener.h
- (EBookViewListenerOperation): CardRemovedEvent ->
- CardsRemovedEvent.
- (EBookViewListenerResponse): char *id -> GList *ids.
-
- * backend/ebook/e-book-listener.c
- (impl_BookListener_respond_remove_cards): rename from remove_card.
-
-2003-02-06 Chris Toshok <toshok@ximian.com>
-
- * gui/component/e-address-popup.c (email_table_save_card_cb):
- check the status, not the book, and unref the book here.
- (contact_editor_cb): same.
- (start_query): unref the book in the failure case.
- (add_card_idle_cb): addressbook_load_default_book returns void
- now.
- (edit_contact_info_cb): same.
- (e_address_popup_query): same.
-
- * gui/component/addressbook.c (control_activate_cb): track change
- to addressbook_load_uri return type.
- (set_prop): same.
- (addressbook_load_uri): return type is void now.
- (addressbook_load_default_book): same.
-
- * gui/component/addressbook.h:
- addressbook_load_uri/addressbook_load_default_book return void
- now.
-
- * conduit/address-conduit.c (start_addressbook_server):
- e_book_load_default_book returns void now.
-
- * backend/ebook/e-book-util.h: track changes to return types.
-
- * backend/ebook/e-book-util.c (e_book_load_address_book_by_uri):
- fallout from change to e_book_load_uri. return type for this
- function is void now too.
- (e_book_use_address_book_by_uri): same.
- (e_book_use_default_book): same.
- (e_book_load_default_book): same.
- (got_uri_book_cb): if unsuccessful and book is non-NULL, unref it
- here.
- (got_default_book_cb): same.
-
- * backend/ebook/e-book.c (e_book_load_uri): no longer return a
- gboolean. any error is communicated to the callback.
-
- * backend/ebook/e-book.h: e_book_load_uri no longer returns a
- gboolean (it's void.)
-
- * backend/ebook/evolution-ldif-importer.c (ebook_create): track
- change to the e_book_load_uri family of functions.
-
- * backend/ebook/test-client-list.c (ebook_create): same.
-
- * backend/ebook/test-client.c (ebook_create): same.
-
- * backend/ebook/load-pine-addressbook.c (ebook_create): same.
-
- * backend/ebook/evolution-vcard-importer.c (ebook_create): same.
-
-2003-02-06 Ettore Perazzoli <ettore@ximian.com>
-
- * backend/ebook/Makefile.am (e-book-marshal.c, e-book-marshal.h):
- Use different tmp file names so these rules can be executed in
- parallel without interfering with each otehr.
-
- * backend/pas/Makefile.am: Make the ORBit compilation work
- properly with parallel makes (i.e. make sure it does not spawn
- multiple orbit-idl processes on the same IDL file at the same
- time).
- * gui/component/select-names/Makefile.am: Likewise.
- * backend/ebook/Makefile.am: Likewise.
-
-2003-02-06 Dan Winship <danw@ximian.com>
-
- * gui/component/addressbook-config.c (main):
- s/PACKAGE/GETTEXT_PACKAGE/ in gettext setup.
-
-2003-02-05 Dan Winship <danw@ximian.com>
-
- * backend/ebook/Makefile.am (INCLUDES): Remove cruft.
- (libebookincludedir): Use privincludedir.
-
- * backend/ebook/e-book-util.c: #include <string.h>
- * backend/ebook/e-card-compare.c: Likewise
- * backend/ebook/load-pine-addressbook.c: Likewise
- * backend/ebook/test-client.c: Likewise
-
- * backend/ebook/evolution-vcard-importer.c: #include
- <e-book-util.h>
- (factory_fn): Fix this to actually return the importer.
-
- * backend/ebook/evolution-ldif-importer.c (parseLine): #include
- <e-book-util.h> and <bonobo/bonobo-main.h>. Use g_ascii_strcmp.
-
- * backend/ebook/e-card.c (e_card_email_match_single_string):
- (e_card_email_find_number): s/g_str/g_ascii_str/
- * backend/ebook/e-destination.c (e_destination_equal): Likewise.
- Also, add an "else return FALSE;"
-
-
- * backend/pas/Makefile.am (INCLUDES): Remove cruft
- (ldapschemadir): Use privdatadir
- (pasincludedir): Use privincludedir.
-
- * backend/pas/pas-book-factory.c (pas_book_factory_activate):
- Remove unused variable.
- * backend/pas/pas-book-view.c (pas_book_view_new): Likewise
-
-
- * printing/Makefile.am (ecpsdir): Define in terms of privdatadir.
- (gladedir): Defined in configure.in now.
-
- * printing/e-contact-print.c: #include <string.h>
-
- * printing/test-print.c: #include <bonobo/bonobo-main.h>
- * printing/test-contact-print-style-editor.c: Likewise
-
-
- * gui/contact-editor/Makefile.am (INCLUDES): Remove some cruft.
- rename ICONSDIR to IMAGESDIR.
- (images_DATA): Install arrow.png in imagesdir instead of
- privdatadir.
-
- * gui/contact-editor/e-contact-quick-add.c: #include <string.h>
-
- * gui/contact-editor/e-contact-editor.c: #include <string.h>
- (e_contact_editor_init): s/EVOLUTION_ICONSDIR/EVOLUTION_IMAGESDIR/
- (e_contact_editor_new): s/gtk_object_ref/g_object_ref/
- (_replace_button): Look in imagesdir, not privdatadir
- (_phone_arrow_pressed): Remove call to deprecated
- gtk_check_menu_item_set_show_toggle.
- (_email_arrow_pressed): Likewise
- (_address_arrow_pressed): Likewise
- (set_address_field): Remove unused variable
- (enable_widget):
- s/gtk_entry_set_editable/gtk_editable_set_editable/
-
- * gui/contact-editor/e-contact-editor-address.c
- (e_contact_editor_address_init):
- s/EVOLUTION_ICONSDIR/EVOLUTION_IMAGESDIR
- (e_contact_editor_address_set_property):
- s/gtk_entry_set_editable/gtk_editable_set_editable/
-
- * gui/contact-editor/e-contact-editor-fullname.c
- (e_contact_editor_fullname_init):
- s/EVOLUTION_ICONSDIR/EVOLUTION_IMAGESDIR
- (e_contact_editor_fullname_set_property): Likewise.
-
-
- * gui/contact-list-editor/Makefile.am (INCLUDES): Remove cruft,
- s/ICONSDIR/IMAGESDIR/
- (gladedir, etspecdir): Remove definitions.
-
- * gui/contact-list-editor/e-contact-list-editor.c: #include
- <string.h>
- (e_contact_list_editor_init): s/ICONSDIR/IMAGESDIR/
- (e_contact_list_editor_new): s/gtk_object_ref/g_object_ref/
-
- * gui/contact-list-editor/e-contact-list-model.c: #include <string.h>
-
-
- * gui/merging/Makefile.am (INCLUDES): Remove cruft.
- * gui/search/Makefile.am (ruledir): Define in terms of privdatadir
-
-
- * gui/widgets/Makefile.am (INCLUDES): Remove cruft.
- (gladedir, etspecdir): Remove definitions.
- (glade_DATA): Empty, so remove it.
-
- * gui/widgets/e-addressbook-reflow-adapter.c: #include <string.h>
- (addressbook_get_property): Remove unused variable
-
- * gui/widgets/e-addressbook-view.c: #include <string.h>
- (get_selection_model): Add a g_return_val_if_reached.
-
- * gui/widgets/e-minicard.c: #include string.h, gtkmain.h,
- gnome-canvas-pixbuf.h
- (field_changed): s/gtk_object_unref/g_object_unref/
- (get_left_width): Remove unused variable
-
- * gui/widgets/e-minicard-control.c: #include <string.h>
- (pstream_load, pstream_save): Use g_ascii_strcasecmp
-
- * gui/widgets/e-minicard-view.c: #include <string.h>
-
- * gui/widgets/e-minicard-view-widget.c
- (e_minicard_view_widget_new): s/gtk_type_new/g_object_new/
-
-
- * gui/component/select-names/Makefile.am (INCLUDES): Remove cruft.
- (serverdir, gladedir, etspecdir): Remove definitions
-
- * gui/component/select-names/e-select-names.c: #include <string.h>
-
- * gui/component/select-names/e-select-names-popup.c
- (init_html_mail): Remove deprecated
- gtk_check_menu_item_set_show_toggle call.
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_entry_free):
- s/gtk_timeout_remove/g_source_remove/
-
-
- * gui/component/Makefile.am (INCLUDES): Remove cruft, rename
- ICONSDIR to IMAGESDIR.
- (serverdir, gladedir): Remove defintions.
-
- * gui/component/addressbook-component.c (IS_CONTACT_TYPE): use
- g_ascii_strcasecmp
- (add_creatable_item): s/ICONSDIR/IMAGESDIR/
-
- * gui/component/component-factory.c: #include <string.h>
-
- * gui/component/e-address-widget.c: Likewise.
- (e_address_widget_destroy): s/gtk_idle_remove/g_source_remove/
- (e_address_widget_schedule_query): s/gtk_idle_add/g_idle_add/
-
-
- * conduit/Makefile.am (INCLUDES): Remove cruft
-
-2003-02-05 Dan Winship <danw@ximian.com>
-
- * gui/component/addressbook-config.c (main): Replace deprecated
- glade_gnome_init() with glade_init().
-
- * gui/contact-editor/test-editor.c (main): Likewise.
-
- * printing/test-contact-print-style-editor.c (main): Likewise.
-
- * printing/test-print.c (main): Likewise.
-
-2003-02-03 Chris Toshok <toshok@ximian.com>
-
- [ pull forward Jack Jia's fix for #34900 ]
- * gui/contact-editor/e-contact-save-as.c (e_contact_save_as): use
- a weak ref for the file selector.
- (e_contact_list_save_as): same.
- (destroy_it): rewrite this as a weak ref notify function.
- (close_it): remove frees of the info (it's freed in the weak ref
- function).
- (save_it): same.
-
-2003-02-03 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-component.c (remove_folder): pull
- forward Jack Jia's fix for #33672, but convert it to use unlink
- instead of the gnome-vfs stuff.
-
-2003-01-27 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/contact-editor.glade: add a scrolled window
- (SHADOW_IN) around the address textview.
-
-2003-01-26 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/contact-editor.glade: rename the category
- entry to entry-categories.
-
- * gui/contact-editor/e-contact-editor.c
- (set_entry_changed_signals): use the specialized "changed" signal
- handlers for entry-company and entry-fullname.
-
-2003-01-26 Chris Toshok <toshok@ximian.com>
-
- * gui/component/Makefile.am: i need to sleep more.
-
-2003-01-26 Chris Toshok <toshok@ximian.com>
-
- * gui/component/Makefile.am (componentdir): need to assign this
- here or else the lib doesn't get built.
-
-2003-01-26 Chris Toshok <toshok@ximian.com>
-
- * printing/e-contact-print.c (e_contact_start_new_page): begin the
- new page after showing the last one.
- (complete_sequence): beginpage before we start printing.
- (e_contact_print_response): GtkDialog-ify this.
- (e_contact_print_dialog_new): "clicked" -> "response".
- (e_contact_print_card_dialog_new): same.
- (e_contact_print_card_list_dialog_new): same.
-
-2003-01-26 Chris Toshok <toshok@ximian.com>
-
- * Makefile.am (CONDUIT_SUBDIR): enable this, as building the
- conduit works if you have gnome-pilot2.
-
-2003-01-25 Chris Toshok <toshok@ximian.com>
-
- * conduit/address-conduit.c: GObjectify the stuff in here that
- refers to addressbook objects. the gnome-pilot stuff is still
- GtkObject for the moment.
-
-2003-01-24 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/Makefile.am (iconsdir): Remove definition; this is
- now in configure.in.
- * gui/contact-editor/Makefile.am (iconsdir): Likewise.
- * gui/contact-list-editor/Makefile.am (iconsdir): Likewise.
-
-2003-01-23 Sean Gao <Sean.Gao@Sun.COM>
-
- [ fixes bug #34898 ]
- * gui/widgets/e-minicard.c (field_changed): handle modifications
- to email addresses in contact lists.
-
-2003-01-23 Sean Gao <Sean.Gao@Sun.COM>
-
- [ fixes bug #36375 ]
- * backend/pas/pas-backend-ldap.c: use PHONE_OTHER_FAX instead of
- PHONE_OTHER for "other_fax".
-
-2003-01-23 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #31014, roll this in from the 1.2 branch ]
- * backend/pas/pas-backend-ldap.c: use "categories" instead of
- "category" for the ECard field so the UI/get_supported_fields stuff
- actually thinks its usable in the contact editor..
-
-2003-01-23 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_connect): fix
- for bug 34883 broke ssl transactions (at least those where we were
- connecting to port 636). Move it to after the SSL stanza.
-
-2003-01-23 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/select-names/Makefile.am (componentdir): Remove
- definition; no need to set it here since it's now defined in
- configure.in
- * gui/component/Makefile.am (componentdir): Likewise.
-
-2003-01-22 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/select-names/Makefile.am (gladedir): Version using
- $(BASE_VERSION).
- (etspecdir): Likewise.
- (iconsdir): Likewise.
-
- * gui/contact-list-editor/Makefile.am (iconsdir): Version using
- $(BASE_VERSION).
- (gladedir): Likewise.
-
- * gui/merging/Makefile.am (gladedir): Version using $(BASE_VERSION).
-
- * gui/search/Makefile.am (ruledir): Version using $(BASE_VERSION).
-
- * gui/component/Makefile.am (INCLUDES): Update EVOLUTION_IMAGESDIR
- to be versioned through $(BASE_VERSION).
-
- * gui/widgets/e-addressbook-view.c (init_collection): Use
- EVOLUTION_GALVIEWSDIR.
-
- * gui/widgets/Makefile.am (INCLUDES): Define EVOLUTION_GALVIEWSDIR
- and update EVOLUTION_IMAGESDIR.
-
-2003-01-21 Radek Doulik <rodo@ximian.com>
-
- * printing/e-contact-print.c (e_contact_print_button): don't use
- gnome_print_multipage_new_from_sizes and add warning
-
-2003-01-14 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/widgets/e-addressbook-util.c
- (e_addressbook_prompt_save_dialog): Change dialog from
- Yes/No/Cancel to Discard/Cancel/Save to match the HIG.
-
- * gui/search/e-addressbook-search-dialog.c
- (e_addressbook_search_dialog_init): Change dialog from OK/Cancel
- to Cancel/OK to match the HIG.
-
- * gui/contact-editor/e-contact-save-as.c (file_exists): Change
- dialog from Overwrite/Cancel to Cancel/Overwrite to match the HIG.
-
- * gui/contact-editor/e-contact-quick-add.c
- (build_quick_add_dialog): Fix typo s/reponse/response/. Also
- change the dialog to be Edit/Cancel/OK instead of OK/Edit/Cancel
- to match the HIG.
-
- * gui/contact-editor/e-contact-editor.c
- (e_contact_editor_confirm_delete): Make alert cancel/delete
- instead of delete/cancel to match the HIG.
-
- * gui/contact-editor/e-contact-editor-fullname.c
- (e_contact_editor_fullname_init): Make dialog Cancel/OK instead of
- OK/Cancel to match the HIG.
-
- * gui/contact-editor/e-contact-editor-address.c
- (e_contact_editor_address_init): Make dialog Cancel/OK instead of
- OK/Cancel to match the HIG.
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_init): Make dialog Cancel/OK instead of OK/Cancel
- to match the HIG.
-
-2003-01-14 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/Makefile.am (EXTRA_DIST): Add $(schema_DATA).
-
-2003-01-09 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c (control_activate_cb): try to load
- the uri again if it failed previously.
- (book_open_cb): set failed_to_load based on the response.
- (set_prop): initialize failed_to_load to FALSE before we kick off
- the first load.
-
- * backend/pas/pas-book-factory.c
- (pas_book_factory_process_request): if the load_uri fails, remove
- it from the hashtable and free it, so we'll try to load it again
- from scratch the next time it's requested instead of serving up a
- backend that doesn't function.
-
- * backend/pas/pas-backend.c (pas_backend_get_uri): we need to be
- able to get the uri from backends that aren't loaded (so we can
- remove them from the hashtable.)
-
-2003-01-09 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (query_ldap_root_dse): doh, fix
- build error.
-
-2003-01-09 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-popup.c: #include
- gtklabel.h, fixes an unresolved symbol.
-
-2003-01-09 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (query_ldap_root_dse): build up
- the list of supported auth_methods.
- (pas_backend_ldap_process_get_supported_auth_methods): respond
- with the list of auth methods we've built up.
- (pas_backend_ldap_dispose): unref the auth_method list.
- (pas_backend_ldap_class_init): hook up
- pas_backend_ldap_process_get_supported_auth_methods.
-
- * backend/pas/pas-backend.c
- (pas_backend_get_supported_auth_methods): new function.
- (process_client_requests): add clause for GetSupportedAuthMethods.
-
- * backend/pas/pas-backend.h: add prototype for
- pas_backend_get_supported_auth_methods, and add it to the class
- vtable.
-
- * backend/pas/pas-book.h: add GetSupportedAuthMethods enum member
- and PASGetSupportedAuthMethodsRequest. and add prototype for
- pas_book_respond_get_supported_auth_methods.
-
- * backend/pas/pas-book.c
- (pas_book_queue_get_supported_auth_methods): new function.
- (impl_GNOME_Evolution_Addressbook_Book_getSupportedAuthMethods):
- new function.
- (pas_book_respond_get_supported_auth_methods): new function.
- (pas_book_free_request): add clause for GetSupportedAuthMethods.
- (pas_book_class_init): hook up getSupportedAuthMethods.
-
- * backend/ebook/e-book-listener.c
- (e_book_listener_queue_get_supported_fields_response): fields ->
- list.
- (e_book_listener_queue_get_supported_auth_methods_response): new
- function.
- (impl_BookListener_response_get_supported_auth_methods): new
- function.
- (e_book_listener_class_init): hook up
- epv->notifySupportedAuthMethods.
-
- * backend/ebook/e-book-listener.h: add
- GetSupportedAuthMethodsResponse enum member, and change the field
- name from "fields" to list (and use it for both GetSupportedFields
- and GetSupportedAuthMethods)
-
- * backend/ebook/e-book.c (e_book_get_supported_auth_methods): new
- function.
- (e_book_do_response_get_supported_auth_methods): new function.
-
- * backend/ebook/e-book.h: add prototype for
- e_book_get_supported_auth_methods.
-
- * backend/idl/addressbook.idl: add getSupportedAuthMethods IDL
- call.
-
-2003-01-09 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-book-factory.c (backend_last_client_gone_cb):
- deal with backends that might not have loaded successfully
- (they'll have a NULL uri).
-
-2003-01-09 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-bonobo.c
- (e_select_names_bonobo_new): call e_select_names_bonobo_construct
- on the newly created object.
-
-2003-01-09 Chris Toshok <toshok@ximian.com>
-
- * gui/component/Makefile.am: addressbook-config.etspec is gone.
-
- * gui/component/addressbook-config.c: make the sources table be a
- gtktreeview instead of an etable.
-
- * gui/component/ldap-config.glade: remove all references to
- gnome-hint.png
-
-2003-01-09 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/gal-view-minicard.c (column_width_changed): fix
- parameter types here (this signal isn't generated from an ETable.)
-
- * gui/widgets/gal-view-factory-minicard.c: include e-util.h
-
- * gui/widgets/e-minicard.h: include gnome-canvas.h here.
-
- * gui/widgets/e-addressbook-table-adapter.c: #include
- e-destination.h here.
-
- * gui/widgets/e-minicard.c: same.
-
-2003-01-09 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-editor.[ch]: remove the select
- names stuff (the Related Contacts button/entry.)
-
- * gui/contact-editor/contact-editor.glade: same.
-
-2003-01-09 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/GNOME_Evolution_Addressbook_SelectNames.server.in.in:
- comment out the factory oaf_server, and change the location of the
- SelectNames controls to be
- OAFIID:GNOME_Evolution_Addressbook_Factory so the normal
- addressbook.so will create them.
-
- * gui/component/select-names/Makefile.am
- (libeselectnames_la_SOURCES): remove the
- e-select-names-factory.[ch] stuff for the time being.
-
- * gui/component/component-factory.c (factory): we're now (for the
- time being) the factory for the select names control.
-
-2003-01-08 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-view.c: oops, don't include
- e-treeview-selection-model.h unless we're building the treeview.
-
-2003-01-08 Jeffrey Stedfast <fejj@ximian.com>
-
- * backend/pas/pas-backend-ldap.c
- (pas_backend_ldap_process_authenticate_user): Fix to build.
-
-2003-01-08 Chris Toshok <toshok@ximian.com>
-
- * gui/component/apps_evolution_addressbook.schemas: add in the
- schema entry for minimum_query_length.
-
-2003-01-08 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-view.h: add
- E_ADDRESSBOOK_VIEW_TREEVIEW to the enum, ifdef'ed out.
-
- * gui/widgets/e-addressbook-view.c
- (e_addressbook_view_class_init): add ifdefed treeview code.
- (init_collection): same.
- (display_view): same.
- (get_selection_model): same.
- (treeview_row_activated): same.
- (create_treeview_view): same.
- (change_view_type): same.xo
- (e_addressbook_view_print): same.
- (e_addressbook_view_print_preview): same.
-
- * gui/widgets/Makefile.am: add in the treeview sources (commented
- out).
-
-2003-01-08 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/gal-view-minicard.c (gal_view_minicard_edit): add
- parent arg.
-
- * gui/widgets/e-addressbook-treeview-adapter.[ch]: new files, for
- a GtkTreeView view of contacts.
-
- * gui/widgets/gal-view-treeview.[ch]: same
-
- * gui/widgets/gal-view-favroty-treeview.[ch]: same
-
-2003-01-08 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/Makefile.am: $(datadir)/evolution/images instead
- of $(datadir)/images/evolution.
- * gui/contact-editor/Makefile.am: Likewise.
- * gui/contact-list-editor/Makefile.am (iconsdir): Likewise.
- * gui/widgets/Makefile.am: Likewise.
-
-2002-01-08 Dan Winship <danw@ximian.com>
-
- Move PASBook request handling into PASBackend itself since all
- existing backends do it exactly the same way. (Part of 32866).
-
- * backend/pas/pas-backend.h (PASBackendClass): add new methods for
- the various pas book requests.
-
- * backend/pas/pas-backend.c: Add a clients list to
- PASBackendPrivate.
- (pas_backend_create_card, etc): Add these to invoke the new
- methods.
- (process_client_requests, book_destroy_cb): Moved here and
- slightly rewritten from pas-backend-file.
- (last_client_gone): Now static.
- (add_client, remove_client): Default implementations, based on
- pas-backend-file, that add the client to/remove it from the
- backend's clients list and connect to its requests_queued signal.
- (pas_backend_init, pas_backend_dispose): Deal with the clients
- list.
-
- * backend/pas/pas-backend-file.c (struct _PASBackendFilePrivate):
- Remove GList *clients.
- (pas_backend_file_process_client_requests,
- pas_backend_file_book_destroy_db, pas_backend_file_add_client,
- pas_backend_file_remove_client): Gone.
- (pas_backend_file_class_init): Remove add_client/remove_client
- method initializations, add initializations for processing the
- various book requests.
-
- * backend/pas/pas-backend-ldap.c (struct _PASBackendLDAPPrivate):
- Remove GList *clients.
- (pas_backend_ldap_process_create_card, etc): Make these take the
- specific PAS*Request types rather than a generic PASRequest.
- (pas_backend_ldap_process_client_requests,
- pas_backend_ldap_book_destroy_db, pas_backend_ldap_add_client,
- pas_backend_ldap_remove_client): Gone.
- (pas_backend_ldap_class_init): Remove add_client/remove_client
- method initializations, add initializations for processing the
- various book requests.
-
-2003-01-07 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/evolutionperson.schema: fix the SYNTAX for the
- telephone attributes, and make the fax attributes more closely
- mirror those from core.schema. Fixes the schema for openldap-2.1.
-
-2003-01-06 Dan Winship <danw@ximian.com>
-
- * backend/idl/Makefile.am: remove idldir def (defined by
- configure.in now)
-
- * gui/component/select-names/Makefile.am: Likewise
-
-2003-01-01 Chris Toshok <toshok@ximian.com>
-
- [ fixes the non-ui portion of #36183 ]
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_start_query): use the entry's
- minimum_query_length instead of a constant here.
- (e_select_names_completion_set_minimum_query_length): new
- function, set the entry's minimum_query_length.
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_entry_new): set the minimum_query length
- after setting the completion books.
- (read_completion_settings_from_db): rename
- read_completion_books_from_db to this, and read the
- minimum_query_length too.
- (db_listener): rename uris_listener to this, and listen for
- changes on both the uris and minimum_query_length settings.
-
- * gui/component/select-names/e-select-names-completion.h: add
- prototype for e_select_names_completion_set_minimum_query_length.
-
- * gui/component/select-names/e-select-names-manager.h: add
- minimum_query_length to struct _ESelectNamesManager.
-
-2002-12-19 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-config.c
- (addressbook_config_control_new): Made it return an
- EvolutionConfigControl instead of a BonoboControl (and removed a
- bogus EvolutionConfigControl -> BonoboControl cast).
-
-2002-12-17 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #34897 ]
- * gui/widgets/e-addressbook-table-adapter.c
- (addressbook_value_at): don't free the return of
- e_card_simple_get_const, as this causes a double free later on.
-
-2002-12-18 Chris Toshok <toshok@ximian.com>
-
- * gui/component/e-address-popup.c: convert the clist in here to a
- GtkTreeView. your guess is as good as mine if it works (i can't
- test it at present) but it compiles.
-
-2002-12-18 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (jump_to_letters):
- g_string_sprintfa -> g_string_append_printf.
- (create_alphabet): same.
- (create_minicard_view): remove gtk_widget_{push,pop}_visual.
-
- * gui/widgets/Makefile.am (INCLUDES): add -D*_DISABLE_DEPRECATED.
-
-2002-12-18 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-minicard.c (e_minicard_realize): drop use of
- "font" arg.
- (get_left_width): use pango to calculate this instead of a GdkFont.
-
- * gui/widgets/e-minicard-view.c: drop include of e-unicode.h.
-
- * gui/widgets/e-minicard-label.c (e_minicard_label_construct):
- don't need to create the font anymore.
-
- * gui/search/Makefile.am (INCLUDES): add -D*_DISABLE_DEPRECATED.
-
- * gui/search/e-addressbook-search-dialog.c
- (e_addressbook_search_dialog_new): use g_object_new instead of
- gtk_type_new.
-
- * gui/merging/Makefile.am (INCLUDES): add -D*_DISABLE_DEPRECATED.
-
- * gui/contact-list-editor/Makefile.am (INCLUDES): add
- -D*_DISABLE_DEPRECATED.
-
- * gui/contact-list-editor/e-contact-list-editor.c (is_named):
- strdup (or not, if we don't need to save the value) instead of
- using the e_utf8 functions.
- (fill_in_info): same.
-
- * gui/contact-editor/Makefile.am (INCLUDES): add
- -D*_DISABLE_DEPRECATED.
-
- * gui/contact-editor/e-contact-save-as.c (e_contact_save_as):
- strdup (or not, if we don't need to save the value) instead of
- using the e_utf8 functions.
- (e_contact_list_save_as): same.
-
- * gui/contact-editor/e-contact-quick-add.c (clicked_cb): strdup
- (or not, if we don't need to save the value) instead of using the
- e_utf8 functions.
- (build_quick_add_dialog): same.
-
- * gui/contact-editor/e-contact-editor.c (phone_entry_changed):
- strdup (or not, if we don't need to save the value) instead of
- using the e_utf8 functions.
- (file_as_set_style): same.
- (name_entry_changed): same.
- (full_name_clicked): same.
- (categories_clicked): same.
- (set_field): same.
- (fill_in_field): same.
- (fill_in_single_field): same.
- (extract_field): same.
- (extract_single_field): same.
-
- * gui/contact-editor/e-contact-editor-fullname.c (extract_field):
- just strdup, it's already utf8.
-
- * gui/contact-editor/e-contact-editor-address.c (extract_field):
- they're all entries, use GTK_ENTRY foo here.
-
- * gui/component/select-names/Makefile.am (INCLUDES): add
- -D*_DISABLE_DEPRECATED.
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_add_section): remove the extra
- utf8_from_locale_string stuff.
-
- * gui/component/select-names/e-select-names-popup.c
- (set_uiinfo_label): gtk_container_children ->
- gtk_container_get_children, and remove the extra utf8 stuff.
-
- * gui/component/Makefile.am (INCLUDES): add
- -D*_DISABLE_DEPRECATED.
-
- * gui/component/addressbook-storage.c
- (addressbook_storage_init_source_uri): g_string_sprintfa ->
- g_string_append_printf.
-
- * gui/component/addressbook-config.c (focus_help):
- gtk_notebook_set_page -> gtk_notebook_set_current_page.
- (addressbook_source_dialog_set_source): same.
- (auth_optionmenu_activated): gtk_container_children ->
- gtk_container_get_children.
- (ssl_optionmenu_activated): same.
- (ssl_optionmenu_selected): same, and gtk_notebook_set_page ->
- gtk_notebook_set_current_page.
- (scope_optionmenu_activated): same.
- (set_advanced_button_state): same.
- (addressbook_ldap_init): hook "response" to gtk_widget_destroy to
- make the dialog go away when clicked.
- (addressbook_ldap_auth): same.
- (addressbook_root_dse_query): same.
- (do_ldap_root_dse_query): same.
- (addressbook_config_control_new): fix return type and cast.
- (main): remove call to gtk_widget_push_visual.
-
- * gui/component/addressbook-config.h:
- addressbook_config_control_new returns a BonoboObject, not a
- BonoboControl.
-
- * gui/component/addressbook.c: remove e-unicode.h include.
-
- * backend/pas/Makefile.am (INCLUDES): Add
- -DLIBGNOME_DISABLE_DEPRECATED.
-
- * backend/ebook/Makefile.am (INCLUDES): Add
- -DLIBGNOME_DISABLE_DEPRECATED.
-
- * backend/ebook/e-card.c (e_card_get_property): remove misleading
- comment.
-
-2002-12-17 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (build_card_from_entry):
- g_strcasecmp -> g_ascii_strcasecmp.
- (FIND_INSERT): same.
-
- * backend/pas/pas-backend-file.c (pas_backend_file_load_uri):
- g_dirname -> g_path_get_dirname.
-
- * backend/pas/Makefile.am (INCLUDES): add
- -DG_DISABLE_DEPRECATED.
-
- * backend/ebook/Makefile.am (INCLUDES): add
- -DG_DISABLE_DEPRECATED.
-
-2002-12-17 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-manager.c
- (uris_listener): oops, use strcmp, not !strcmp here.
-
-2002-12-17 Chris Toshok <toshok@ximian.com>
-
- [ Fixes bug #35135 ]
- * backend/ebook/e-book-util.c (set_default_book_uri_local): don't
- free the default_book_uri here, it's done in set_default_book_uri.
- (set_default_book_uri): break some stuff out from
- set_default_book_uri_from_bonobo_conf to here so it can be used
- both from that function and the bonobo listener.
- (default_folder_listener): set the new default book uri.
- (set_default_book_uri_from_bonobo_conf): install the bonobo conf
- listener so we'll get updates.
-
-2002-12-16 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-config.c
- (addressbook_config_control_new): Use
- evolution_shell_client_corba_objref() instead of BONOBO_OBJREF()
- to get the Shell CORBA object.
-
-2002-12-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * gui/component/addressbook-config.c: Don't #include
- <e-util/e-html-utils.h>
-
-2002-12-09 Chris Toshok <toshok@ximian.com>
-
- * gui/search/e-addressbook-search-dialog.[ch]: GObject-ize this.
-
-2002-12-09 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c (load_uri_auth_cb): pass
- "Addressbook" to e_passwords*.
- (addressbook_authenticate): same.
-
-2002-12-09 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c (search_cb): remove
- PENDING_PORT_WORK.
- (addressbook_search_activated): same.
- (addressbook_query_changed): same.
-
- * gui/component/Makefile.am (libevolution_addressbook_la_LIBADD):
- add libfilter.la back in.
-
-2002-12-09 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/widgets/e-minicard-control.c: #define MINICARD_CONTROL_ID.
-
-2002-12-08 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-util.c (e_addressbook_error_dialog):
- connect ::response to gtk_widget_destroy so the dialog goes away.
-
- * gui/widgets/e-minicard-label.c (e_minicard_label_construct):
- don't use font_gdk anymore on EText. it doesn't exist.
-
-2002-12-08 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-reflow-adapter.c (text_height): this
- uses pango now.
- (addressbook_height): same.
-
-2002-12-06 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book.c (e_book_commit_card): use e_card_set_book
- instead of basically duplicating its code here.
- (e_book_add_card): same.
-
-2002-12-06 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/e-cardlist-model.c: #include <string.h>.
-
- * gui/component/addressbook-storage.c: #include <string.h>,
- <ctype.h>, <unistd.h>.
-
- * gui/component/addressbook-factory.c: Removed.
-
- * gui/component/addressbook-component.c: #include
- <bonobo/bonobo-main.h>, <unistd.h> and <string.h>.
- (create_view): addressbook_new_control() instead of
- addressbook_factory_new_control().
-
- * gui/component/select-names/e-select-names.c
- (e_addressbook_create_ebook_table): Removed unused variable.
- (e_select_names_add_section): Removed unused variable.
-
- * gui/component/select-names/e-select-names-manager.c
- (focus_in_cb): Use g_source_remove() here instead of
- gtk_timeout_remove().
-
- * gui/component/component-factory.c: New.
-
- * gui/widgets/e-minicard-control.c
- (e_minicard_control_factory_init): Removed.
- (e_minicard_control_control_factory): Removed.
- (e_minicard_control_new): New.
-
- * gui/component/e-address-widget.c
- (e_address_widget_factory_init): Removed.
- (e_address_widget_new_control): Renamed from
- e_address_widget_factory_new_control(), made public.
- (e_address_widget_factory): Removed.
-
- * gui/component/e-address-popup.c (e_address_popup_new_control):
- New.
- (e_address_popup_factory_new_control): Removed.
- (e_address_popup_factory): Removed.
- (e_address_popup_factory_init): Removed.
-
- * gui/component/addressbook-config.c
- (addressbook_config_register_factory): Removed.
- (addressbook_config_create_control): New.
-
- * gui/component/addressbook-component.c
- (addressbook_component_factory_init): Removed.
- (addressbook_component_get_object): New.
- (owner_set_cb): Do not call addressbok_config_register_factory().
-
- * gui/component/addressbook.c (addressbook_factory_init): Removed.
- (addressbook_new_control): Renamed from
- addressbook_factory_new_control().
-
-2002-12-05 Jeffrey Stedfast <fejj@ximian.com>
-
- * gui/component/select-names/e-select-names.etspec: Use collate
- for sorting rather than the normal string sort. This fixes bug
- #26335 without causing bug #33933 :-)
-
-2002-11-30 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_connect): only
- enable the LDAPv3 stuff if TLS is being used. Also, deal with
- naming errors returned from query_ldap_root_dse, as some servers
- (older openldap servers among others i'm sure) don't have a root
- dse at all.
-
-2002-12-02 Not Zed <NotZed@Ximian.com>
-
- * gui/widgets/e-addressbook-view.c (e_contact_print_button):
- gnomedialog -> gtkdialog stuff. print dialog is a gtkdialog now.
-
- * gui/contact-editor/e-contact-editor.c: include gtkstock.h
-
-
-2002-11-27 Not Zed <NotZed@Ximian.com>
-
- * gui/contact-editor/e-contact-editor-address.c: #include gtkstock.h
-
-2002-11-29 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-minicard-view-widget.c (column_width_changed): the
- detail is supposed to go after the signal id, not at the end of
- the parameter list.
-
-2002-11-28 Chris Toshok <toshok@ximian.com>
- [ roll forward from 1.2 branch, partial fix for #31763 ]
- * gui/component/select-names/select-names.glade: add the Find
- button back in.
-
-2002-11-28 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (create_minicard_view): remove
- the button_press_event handler (that did nothing). this makes it
- so button presses actually get to the canvas (and therefore we can
- now drag the lines in the reflow widget).
-
-2002-11-26 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-quick-add.c: add include for
- gtkstock.h.
-
- * gui/contact-list-editor/e-contact-list-model.c
- (e_contact_list_model_add_destination): add pre_change call.
- (e_contact_list_model_remove_row): same.
- (e_contact_list_model_remove_all): same.
-
- * gui/contact-list-editor/e-contact-list-editor.c
- (e_contact_list_editor_new): ref/sink the contact list editor so
- we don't get the floating unref warning from gtk.
-
- * gui/contact-editor/e-contact-editor.c (e_contact_editor_new):
- ref/sink the contact editor so we don't get the floating unref
- warning from gtk.
- (e_contact_editor_init): use g_build_filename instead of
- g_concat_dir_and_file.
-
- * gui/widgets/e-minicard-label.c
- (e_minicard_label_resize_children): use MAX (value, 0) to make
- sure we aren't passing negative values for clip-widths.
-
- * gui/widgets/e-minicard.c (e_minicard_realize): use MAX (value,
- 0) to make sure we aren't passing negative values for widths.
-
- * gui/contact-editor/e-contact-editor.c (e_contact_editor_init):
- use g_build_filename.
-
-2002-11-26 Chris Toshok <toshok@ximian.com>
-
- [ roll forward from 1.2 branch ]
- * backend/pas/pas-backend-file.c
- (pas_backend_file_process_get_vcard): never pass NULL as the vcard
- to the corba call, it causes a crash. This particular bug bit us
- when we opened a card that contained an unresolvable related
- contact.
-
-2002-11-26 Chris Toshok <toshok@ximian.com>
-
- [ roll forward from 1.2 branch, Fixes addressbook bug #28945 ]
- * backend/ebook/e-card.c (e_card_get_vobject): if the email
- property is xml, get the real address from the e-destination.
- Fixes saving contact lists.
-
-2002-11-26 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-minicard.c (e_minicard_reflow): remove redundant
- setting of y2.
-
- * gui/contact-list-editor/e-contact-list-editor.c
- (e_contact_list_editor_init): show the table.
-
- * gui/component/select-names/e-select-names-completion.c: remove
- an unnecessary #include.
-
- * gui/component/addressbook-storage.c (addressbook_storage_setup):
- use g_build_filename.
-
- * gui/component/addressbook-component.c (remove_folder): use
- g_build_filename.
- (add_creatable_item): same.
- (ensure_completion_uris_exist): same, and use the right gconf
- paths for completion uris.
-
-2002-11-26 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-manager.c
- (read_completion_books_from_db): use new schema for
- completion/uris.
- (uris_listener): same.
-
- * gui/component/select-names/e-select-names.h: Convert to
- GtkDialog from GnomeDialog.
-
- * gui/component/select-names/e-select-names.c: Convert to
- GtkDialog from GnomeDialog.
- (folder_selected): use new schema for last_used_uri.
- (e_select_names_init): same.
- (e_select_names_set_default): use pango markup to set
- bold/not-bold.
- (e_select_names_add_section): don't bother creating an EEntry, we
- can use pango and a normal label. This also keeps us from
- wrapping "contacts ->" at the '-'.
-
- * gui/component/apps_evolution_addressbook.schemas: new file.
-
- * gui/component/Makefile.am: add the schema stuff.
-
-2002-11-24 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-config.c (query_for_supported_bases):
- show the etable.
- (addressbook_add_server_druid): show_all before returning the
- dialog, so the druid shows up.
-
-2002-11-23 Chris Toshok <toshok@ximian.com>
-
- [ roll forward from the 1.2 branch. fixes #25540, part of #29630,
- as well as other selection issues in the contact editor and ACL
- issues in the ldap backend ]
- * backend/pas/pas-backend-ldap.c (check_schema_support): reset the
- schema check state to FALSE if the read returned nothing (and the
- user had not authenticated). we'll requery if/when they auth.
- (query_ldap_root_dse): free the schema dn before assigning over
- it.
- (pas_backend_ldap_connect): added a diagnostic warning about the
- root dse query failing in anonymous mode (if it in fact did fail.)
- (pas_backend_ldap_process_authenticate_user): if we successfully
- authed, requery the root dse to pick up any attributes that might
- be protected, and retry the schema query if that failed before.
-
- * gui/contact-editor/e-contact-editor.c (full_name_clicked): set
- the dialog's editable state based on the new field
- "fullname_editable", and only do the Ok button handling if this
- flag is TRUE.
- (full_addr_clicked): set the dialog's editable state based on the
- editable state for the particular address (from
- editor->address_editable[]). also, only do the Ok button handling
- if this flag is TRUE.
- (_address_arrow_pressed): use the address_editable array to
- determine whether the address text and the mailing address
- checkbutton are sensitive.
- (enable_writable_fields): figure out if fullname_editable is
- TRUE/FALSE, also, init the address_editable flags based on the
- field list, and handle the address checkbutton.
-
- * gui/contact-editor/fulladdr.glade: change the label names to
- label-<name> to match {entry,combo}-<name>.
-
- * gui/contact-editor/fullname.glade: same.
-
- * gui/contact-editor/e-contact-editor-fullname.c
- (e_contact_editor_fullname_class_init): rename ARG_IS_READ_ONLY to
- ARG_EDITABLE, to reflect the correct sense of the flag.
- (e_contact_editor_fullname_set_arg): same, and make the labels
- sensitive/insensitive depending on the editable state of the
- dialog.
-
- * gui/contact-editor/e-contact-editor-address.c
- (e_contact_editor_address_class_init): rename ARG_IS_READ_ONLY to
- ARG_EDITABLE, to reflect the correct sense of the flag.
- (e_contact_editor_address_set_arg): same, and make the labels
- sensitive/insensitive depending on the editable state of the
- dialog.
-
-2002-11-22 Chris Toshok <toshok@ximian.com>
-
- [ roll forward Sean.Gao@sun.com's fix for #16870 from the 1.2
- branch ]
- * backend/ebook/evolution-ldif-importer.c (getNextLDIFEntry):
- check for both LR and CRLF as empty line markers.
-
-2002-11-22 Chris Toshok <toshok@ximian.com>
-
- [ rolling forward fix for #34254 from 1.2 branch ]
- * backend/ebook/evolution-vcard-importer.c (check_file_is_vcard):
- use g-ascii_strncasecmp instead of strncmp.
- (support_format_fn): use g_ascii_strcasecmp instead of strcmp.
-
-2002-11-20 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-storage.h: roll forward the scope fix.
-
-2002-11-20 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c: roll forward the fix for
- the contact editor.
-
-2002-11-21 Not Zed <NotZed@Ximian.com>
-
- * gui/component/select-names/e-select-names-bonobo.c
- (entry_changed): Pass type to bonobo_ctonrol_set_property, and
- also NULL terminate the valist.
-
- * gui/component/select-names/e-select-names-text-model.c
- (changed_cb): Fix signature for signal.
-
-2002-11-19 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/select-names/GNOME_Evolution_Addressbook_SelectNames.server.in.in,
- * gui/component/select-names/Makefile.am: Same changes as below
- for the SelectNames component.
-
-2002-11-18 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_init): show the custom table.
-
-2002-11-18 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/gal-view-minicard.c (gal_view_minicard_attach):
- remove the cast to (int) - column_width is a double.
-
- * gui/widgets/e-minicard.c (e_minicard_class_init): the height
- property is only readable, not readwrite.
-
- * gui/widgets/e-minicard-view-widget.c
- (e_minicard_view_widget_class_init): make column_width a double
- property.
- (e_minicard_view_widget_set_property): don't cast to (int).
- column_width is double in the e-minicard-view.
- (e_minicard_view_widget_realize): same.
- (e_minicard_view_widget_get_property): use g_value_set_double for
- column_width.
-
-2002-11-17 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/Makefile.am (servers_DATA): oops,
- missed some "oaf"'s.
-
-2002-11-16 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c
- (e_contact_editor_build_phone_ui): sink the popup.
- (e_contact_editor_build_email_ui): same.
- (e_contact_editor_build_address_ui): same.
-
- * gui/component/addressbook-config.c (ldap_dialog_new): show
- everything from dialog->page down, so custom widgets show up.
-
-2002-11-15 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/Makefile.am: Added rule to generate
- GNOME_Evolution_Addressbook.server.in from
- GNOME_Evolution_Addressbook.server.in.in, substituting
- @LIBEXECDIR@.
-
- * GNOME_Evolution_Addressbook.server.in.in: Renamed from
- GNOME_Evolution_Addressbook.server.in. Added @LIBEXECDIR@ before
- the location of the executable.
-
- * gui/component/select-names/select-names.glade: Ported to Glade
- 2.
-
- * gui/component/select-names/recipient.glade: Ported to Glade 2.
-
-2002-11-15 Rodney Dawes <dobey@ximian.com>
-
- * gui/component/addressbook-component.c: Use bonobo_main_quit.
-
-2002-11-14 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/gal-view-factory-minicard.c: clean this up a tad.
-
- * gui/widgets/e-addressbook-view.c (init_collection): re-enable
- this.
- (setup_menus): same.
-
- * gui/widgets/gal-view-minicard.[ch]: more GObject work.
-
-2002-11-12 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c (_popup_position): push_in
- = FALSE, no clue why... :)
- (_arrow_pressed): call g_signal_stop_emission here, seems to fix
- things.
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_init): fix warnings.
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_activate_dialog): fix warning.
-
- * gui/component/addressbook.c (forget_passwords_cb): remove the
- PENDING_PORT ifdef.
- (load_uri_auth_cb): same.
- (addressbook_authenticate): same.
-
- * gui/component/addressbook-factory.c (main): same.
-
- * gui/component/addressbook-storage.c (load_source_data): be
- silent about text nodes if they contain nothing but whitespace.
-
-2002-11-11 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-card-cursor.c (pas_card_cursor_dispose): guard
- against multiple invocations.
-
- * backend/pas/pas-backend-ldap.c (view_destroy): change signature
- to that of a weak ref notify function.
- (cursor_destroy): same.
- (pas_backend_ldap_book_destroy_cb): same.
- (get_cursor_handler): ::destroy -> weak_ref.
- (pas_backend_ldap_process_get_book_view): same.
- (pas_backend_ldap_add_client): same.
-
- * backend/pas/pas-backend-file.c (cursor_destroy): change
- signature to that of a weak ref notify function.
- (view_destroy): same.
- (pas_backend_file_book_destroy_cb): same.
- (pas_backend_file_process_get_cursor): ::destroy -> weak_ref.
- (pas_backend_file_process_get_book_view): same.
- (pas_backend_file_process_get_completion_view): same.
- (pas_backend_file_process_get_changes): same.
- (pas_backend_file_add_client): same.
-
- * backend/ebook/test-client.c (get_cursor_cb): unref the book and
- exit here.
- (get_card_cb): pass a query string to get_cursor.
-
- * backend/ebook/e-book-view.c (e_book_view_class_init): correct
- marshaller for "card_added".
-
-2002-11-11 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/test-reflow.c (destroy_callback): change signature
- to that of a weak ref notify function.
- (main): ::destroy -> weak_ref.
-
- * gui/widgets/test-minicard.c (destroy_callback): change signature
- to that of a weak ref notify function.
- (main): ::destroy -> weak_ref.
-
- * gui/widgets/test-minicard-view.c (destroy_callback): change
- signature to that of a weak ref notify function.
- (main): ::destroy -> weak_ref.
-
- * gui/widgets/test-minicard-label.c (destroy_callback): change
- signature to that of a weak ref notify function.
- (main): ::destroy -> weak_ref.
-
- * gui/widgets/e-minicard-widget.c (e_minicard_widget_init): ifdef
- out the call to gnome_canvas_set_scroll_region. It doesn't seem
- necessary judging from the rest of the code, and it also crashes
- the addressbook if it's in.
-
- * gui/widgets/e-minicard-widget-test.c (destroy_callback): change
- signature to that of a weak ref notify function.
- (main): ::destroy -> weak_ref.
-
- * gui/widgets/e-minicard-control.c (free_struct): change signature
- to that of a weak ref notify function.
- (e_minicard_control_factory): ::destroy -> weak_ref.
-
- * gui/widgets/e-addressbook-view.c (e_addressbook_view_init):
- ::destroy -> weak_ref.
- (e_addressbook_view_print): same.
- (free_closure): change signature to that of a weak ref notify
- function.
- (e_contact_print_destroy): same.
- (invisible_destroyed): same.
-
- * gui/widgets/e-addressbook-util.c
- (e_addressbook_prompt_save_dialog): convert from GnomeDialog to
- GtkDialog.
- (e_addressbook_show_multiple_cards): same.
-
- * gui/contact-list-editor/e-contact-list-editor.c
- (prompt_to_save_changes): change response ids to use
- GTK_RESPONSE_.
-
- * gui/component/select-names/e-select-names-manager.c
- (clear_widget): new function.
- (e_select_names_manager_activate_dialog): ::destroy -> weak_ref.
-
- * gui/component/select-names/e-select-names.c (clear_widget):
- change signature to that of a weak ref notify function.
- (e_select_names_init): ::destroy -> weak_ref.
-
- * gui/component/e-address-popup.c (mini_wizard_destroy_cb): change
- signature to that of a weak ref notify function.
- (mini_wizard_new): ::destroy -> weak_ref.
-
- * gui/component/addressbook-config.c
- (addressbook_source_dialog_destroy): change signature to that of a
- weak ref notify function.
- (ldap_config_control_destroy_callback): same.
- (addressbook_add_server_druid): ::destroy -> weak_ref.
- (addressbook_edit_server_dialog): same.
- (ldap_config_control_new): same.
-
- * gui/component/addressbook.c (destroy_callback): change signature
- to that of a a weak ref notify function.
- (addressbook_factory_new_control): ::destroy -> weak_ref.
-
- * gui/merging/e-card-merging.c (response): rename clicked to this,
- and destroy the dialog here.
- (match_query_callback): ::clicked -> ::response
-
- * gui/merging/e-card-merging-book-commit-duplicate-detected.glade:
- convert.
-
- * gui/merging/e-card-duplicate-detected.glade: same.
-
-2002-11-11 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c (_arrow_pressed): change
- around a little, still ifdefed though.
-
- * gui/contact-editor/e-contact-save-as.c (file_exists): same.
- (save_it): deal with the GtkDialog response ids.
-
- * gui/contact-editor/e-contact-editor.c
- (e_contact_editor_confirm_delete): just build the dialog here
- (using gtk_message_dialog*).
-
- * gui/contact-editor/Makefile.am (glade_DATA): remove
- file-exists.glade and e-contact-editor-confirm-delete.glade.
-
-2002-11-11 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-card-cursor.c (pas_card_cursor_dispose): guard
- against multiple invocations.
-
- * backend/pas/pas-backend-ldap.c (view_destroy): change signature
- to that of weak ref's notify function - also, don't use the type
- check macros on the freed GObject.
- (cursor_destroy): same.
- (pas_backend_ldap_book_destroy_cb): same.
- (pas_backend_ldap_add_client): use weak_ref insteead of ::destroy.
- (get_cursor_handler): same.
- (pas_backend_ldap_process_get_book_view): same.
-
- * backend/pas/pas-backend-file.c (cursor_destroy): change
- signature to that of weak ref's notify function - also, don't use
- the type check macros on the freed GObject.
- (pas_backend_file_book_destroy_cb): same.
- (view_destroy): same.
- (pas_backend_file_process_get_cursor): use weak_ref instead of
- ::destroy.
- (pas_backend_file_process_get_book_view): same.
- (pas_backend_file_process_get_completion_view): same.
- (pas_backend_file_process_get_changes): same.
- (pas_backend_file_add_client): same.
-
-2002-11-10 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-card-sexp.c
- (pas_backend_card_sexp_dispose): guard against multiple
- invocations.
-
- * backend/pas/pas-card-cursor.c (pas_card_cursor_dispose): same.
-
- * backend/pas/pas-book.c (pas_book_dispose): same.
-
- * backend/pas/pas-book-view.c (pas_book_view_dispose): same.
-
- * backend/pas/pas-book-factory.c (pas_book_factory_dispose): same.
-
- * backend/pas/pas-backend-summary.c (pas_backend_summary_dispose): same.
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_dispose): same.
-
- * backend/pas/pas-backend-file.c (pas_backend_file_dispose): same.
-
- * backend/ebook/e-book-listener.c (e_book_listener_dispose): guard
- against multiple invocations.
-
- * backend/ebook/e-card.c (e_card_dispose): same.
-
- * backend/ebook/e-card-simple.c (e_card_simple_dispose): same.
-
- * backend/ebook/e-card-cursor.c (e_card_cursor_dispose): same.
-
- * backend/ebook/e-book.c (e_book_dispose): same.
-
- * backend/ebook/e-book-view-listener.c (e_book_view_listener_dispose): same.
-
-2002-11-08 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-model.c (free_data): guard against
- multiple invocations.
- (remove_book_view): same.
- (addressbook_dispose): same.
-
- * gui/widgets/e-addressbook-view.c (e_addressbook_view_dispose):
- same.
-
- * gui/widgets/e-minicard-view-widget.c
- (e_minicard_view_widget_dispose): same.
-
- * gui/widgets/e-minicard-view.c (e_minicard_view_dispose): same.
-
- * gui/widgets/e-minicard-widget.c (e_minicard_widget_dispose):
- same.
-
-2002-11-08 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-reflow-adapter.c
- (addressbook_get_property): oops, missed these casts.
-
- * gui/component/addressbook.c (get_master_list): remove the
- PENDING_PORT_WORK ifdef, just ported ECategoriesMasterList.
- (make_suboptions): same.
-
- * gui/contact-editor/e-contact-editor.c (categories_clicked):
- same.
-
-2002-11-08 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/test-reflow.c: port work.
-
- * gui/widgets/test-minicard-view.c: port work.
-
- * gui/widgets/e-minicard.[ch]: port work.
-
- * gui/widgets/e-minicard-widget.c: port work.
-
- * gui/widgets/e-minicard-view.c: port work.
-
- * gui/widgets/e-minicard-view-widget.c
- (e_minicard_view_widget_size_allocate): gtk_->g_ change i missed.
- (e_minicard_view_widget_reflow): same.
-
- * gui/widgets/e-minicard-label.c: port work.
-
- * gui/widgets/e-minicard-control.c (get_prop): gtk_->g_ change i
- missed.
-
- * gui/widgets/e-addressbook-view.c (setup_menus): ifdef this
- PENDING_PORT_WORK for now.
- (has_email_address_1): gtk_->g_ change i missed.
- (print): remove the PENDING_PORT_WORK from here, as the print_*
- symbols now resolve.
- (delete): gtk_->g_ changes.
- (new_card): same.
- (new_list): same.
- (sources): same.
- (create_minicard_view): same.
- (table_double_click): same.
- (create_table_view): same.
- (e_contact_print_destroy): same.
- (e_contact_print_button): same.
- (e_addressbook_view_print): same, and remove the PENDING_PORT_WORK
- ifdef.
- (e_addressbook_view_print_preview): same.
- (do_remove): gtk_->g_ changes.
- (e_addressbook_view_save_state): same.
- (view_transfer_cards): same.
-
- * gui/widgets/e-addressbook-view.h (struct _EAddressbookView):
- GtkObject -> GObject.
-
- * gui/widgets/e-addressbook-util.c (e_addressbook_error_dialog):
- GnomeDialog -> GtkDialog.
-
- * gui/widgets/e-addressbook-table-adapter.c
- (addressbook_set_value_at): a gtk_->g_ change i missed.
- (e_addressbook_table_adapter_class_init): gtk_type_class ->
- g_type_class_peek_parent.
-
- * gui/widgets/e-addressbook-reflow-adapter.c
- (addressbook_get_property): use g_object_get_property for
- aggregated properties.
- (e_addressbook_reflow_adapter_class_init): gtk_type_class ->
- g_type_class_peek_parent.
-
- * gui/merging/e-card-merging.c (match_query_callback): some misc
- gtk_->g_ changes i missed.
-
-2002-11-08 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-model.h: parent class
- is GObjectClass.
-
- * gui/component/select-names/e-simple-card-bonobo.c
- (impl_dispose): guard against multiple invocations, and chain
- dispose.
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_dispose): guard against multiple invocations.
-
- * gui/component/select-names/e-select-names-text-model.c
- (e_select_names_text_model_dispose): guard against multiple
- invocations.
- (e_select_names_text_model_set_source): fix casts.
-
- * gui/component/select-names/e-select-names-table-model.c
- (e_select_names_table_model_add_source): remove the GTK_OBJECT
- cast, fixes a warning.
- (clear_info): guard against multiple invocations from ::dispose.
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_dispose): same.
-
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_dispose): same.
-
- * gui/component/select-names/e-select-names-bonobo.c
- (impl_dispose): guard against multiple invocations.
-
-2002-11-08 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-list-editor/contact-list-editor.glade: convert to glade-2
-
- * gui/contact-list-editor/e-contact-list-editor.c: port work.
-
- * gui/contact-list-editor/e-contact-list-model.[ch]: port work.
-
-2002-11-08 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-editor-address.[ch]: port work.
-
- * gui/contact-editor/e-contact-editor-fullname.[ch]: port work.
-
- * gui/contact-editor/e-contact-editor.[ch]: port work.
-
- * gui/contact-editor/e-contact-quick-add.c: port work.
-
- * gui/contact-editor/e-contact-save-as.c: port work.
-
-2002-11-08 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book-util.c
- (set_default_book_uri_from_config_db): prepend /apps/Evolution to
- config db paths.
-
- * gui/component/select-names/e-select-names-manager.c (read_completion_books_from_db): same.
- (uris_listener): same.
-
-2002-11-08 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c: more porting work.
-
- * e-contact-editor-fullname.[ch]: more porting work.
-
- * e-contact-editor.c: more porting work.
-
- * e-contact-quick-add.c: more porting work.
-
- * e-contact-save-as.c: more porting work.
-
- * test-editor.c: more porting work.
-
- * e-contact-editor-confirm-delete.glade, file-exists.glade,
- fulladdr.glade, fullname.glade: run these through
- libglade-convert.
-
-2002-11-07 Chris Toshok <toshok@ximian.com>
-
- * gui/component/Makefile.am (evolution_addressbook_LDADD): add
- lots of libs back in since they're building now.
-
- * gui/component/addressbook-config.c: more porting work.
-
- * gui/component/addressbook.c: more porting work.
-
- * gui/component/e-address-popup.[ch]: more porting work.
-
- * gui/component/e-address-widget.[ch]: more porting work.
-
- * gui/component/e-cardlist-model.[ch]: more porting work.
-
-2002-11-07 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-bonobo.[ch]: more
- porting work.
-
- * gui/component/select-names/e-select-names-completion.[ch]: more
- porting work.
-
- * gui/component/select-names/e-select-names-manager.[ch]: more
- porting work.
-
- * gui/component/select-names/e-select-names-model.[ch]: more
- porting work.
-
- * gui/component/select-names/e-select-names-popup.c: more
- porting work.
-
- * gui/component/select-names/e-select-names-table-model.[ch]: more
- porting work.
-
- * gui/component/select-names/e-select-names-text-model.[ch]: more
- porting work.
-
- * gui/component/select-names/e-select-names.[ch]: more
- porting work.
-
-2002-11-07 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/Makefile.am: tests are linking now, and link in
- libcamel.la.
-
- * backend/ebook/e-destination.c (e_destination_get_name): un-ifdef
- since camel is compiling.
- (e_destination_get_email): same.
- (e_destination_get_address): same.
- (e_destination_get_textrep): same.
-
- * backend/ebook/e-card-compare.c (name_fragment_match): use e_utf8_casefold_*.
- (name_fragment_match_with_synonyms): same.
- (e_card_compare_name_to_string_full): same.
- (e_card_compare_name): same.
-
-2002-11-07 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book-util.h: add prototypes for e_utf8_casefold_collate{_len}
-
- * backend/ebook/e-book-util.c (e_utf8_casefold_collate_len): move
- utf8_casefold_collate_len here.
- (e_utf8_casefold_collate): move utf8_casefold_collate here.
-
-2002-11-06 Chris Toshok <toshok@ximian.com>
-
- * printing/e-contact-print-envelope.c: port this to
- gnome2/gnomeprint2.
-
- * printing/e-contact-print-style-editor.c: same.
-
- * printing/e-contact-print.c: same.
-
- * printing/test-contact-print-style-editor.c: same.
-
- * printing/test-print.c: same.
-
- * printing/e-contact-print.glade: libglade-convert to libglade-2.
-
- * printing/Makefile.am (contact_print_test_LDADD)
- (contact_print_style_editor_test_LDADD): remove libcamel.la from
- these for the time being to get things linking.
-
-2002-11-06 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/gal-view-minicard.[ch]: gobjectify this.
-
- * gui/widgets/e-minicard.[ch]: gobjectify this.
- (e_minicard_class_init): change the
- min/max values of the width/height paramspecs so that they can
- actually be set to something other than 0.0.
-
- * gui/widgets/e-minicard-widget.[ch]: gobjectify this.
-
- * gui/widgets/e-minicard-view.[ch]: gobjectify this.
- (set_empty_message): don't need e_utf8_from_locale_string anymore.
-
- * gui/widgets/e-minicard-view-widget.[ch]: gobjectify this.
-
- * gui/widgets/e-minicard-label.[ch]: gobjectify this.
-
- * gui/widgets/e-addressbook-view.[ch]: gobjectify this.
-
- * gui/widgets/e-addressbook-table-adapter.[ch]: gobjectify this.
-
- * gui/widgets/e-addressbook-reflow-adapter.[ch]: gobjectify this.
-
- * gui/widgets/e-addressbook-model.[ch]: gobjectify this.
-
- * gui/widgets/e-minicard-control.c (e_minicard_control_factory):
- fix bonobo_persist_stream_new api change.
-
- * gui/contact-list-editor/e-contact-list-model.c
- (e_contact_list_model_add_destination): get rid of the
- gtk_object_sink here.
-
- * gui/component/ldap-config.glade: glade-2 version of this file.
-
- * gui/component/e-address-popup.c (e_address_popup_refresh_names):
- don't need e_utf8_to_gtk_string anymore.
-
- * gui/component/addressbook.c (make_suboptions): don't need
- e_utf8_to_locale_string anymore.
-
- * gui/component/addressbook-config.c
- (addressbook_dialog_get_source): get rid of the e_utf8 gtk_entry
- functions.
- (addressbook_source_dialog_set_source): same.
- (general_tab_check): same.
- (port_changed_func): same.
- (connecting_tab_check): same.
- (query_for_supported_bases): same.
- (display_name_check): same.
- (display_name_page_prepare): same.
- (edit_source_clicked): same.
- (addressbook_config_create_new_source): same.
-
-2002-11-06 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-card-sexp.c
- (pas_backend_card_sexp_class_init): use g_type_class_peek_parent.
-
- * backend/pas/pas-card-cursor.c (pas_card_cursor_class_init): same.
-
- * backend/pas/pas-book-view.c (pas_book_view_class_init): same.
-
- * backend/pas/pas-book-factory.c (pas_book_factory_class_init): same.
-
- * backend/pas/pas-backend-summary.c (pas_backend_summary_class_init): same.
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_class_init): same.
-
- * backend/pas/pas-backend-file.c (pas_backend_file_class_init): same.
-
- * backend/ebook/e-book-marshal.list: ENUM -> INT.
-
- * backend/ebook/e-book-view.c (e_book_view_dispose): guard against
- this being called multiple times.
- (e_book_view_class_init): ENUM -> INT in the sequence_complete
- signal.
-
- * backend/ebook/e-book.c (e_book_do_response_open): un-ifdef the
- component_died signal stuff.
-
-2002-11-06 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book-util.c (e_book_expand_uri): call
- g_build_filename, not g_build_path.
-
-2002-11-06 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-destination.[ch]: fix the gnome-xml headers.
-
-2002-11-06 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/gal-view-minicard.c: fix the gnome-xml headers.
-
- * gui/widgets/e-addressbook-view.c
- (e_addressbook_view_class_init): convert from gtk signals and args
- to GSignal and GObject properties.
- (e_addressbook_view_dispose): rename _destroy to this.
- (e_addressbook_view_set_property): rework _set_arg to this.
- (e_addressbook_view_get_property): rework _get_arg to this.
- (display_view): if we're here we need to choose a view, regardless
- of whether or not the GAL_IS_VIEW_* macros tell us which type it
- is.
-
- * gui/widgets/e-addressbook-table-adapter.c: fix the gnome-xml
- headers.
-
- * gui/widgets/e-addressbook-model.c
- (e_addressbook_model_class_init): use INT, not ENUM in the signal here.
-
- * gui/component/addressbook-config.c: another big gtk_* -> g_*
- renaming.
-
- * gui/component/addressbook.c: same.
-
- * gui/component/e-address-popup.c: same.
-
- * gui/component/e-address-widget.c: same.
-
- * gui/component/e-cardlist-model.c: fix the gnome-xml headers, and
- more gtk_* -> g_* renaming.
-
- * gui/component/addressbook-component.c (owner_set_cb): use
- evolution_shell_client_corba_objref as per ettore's change to
- EvolutionShellClient..
- (create_view): fix the call to bonobo_control_set_property.
- (create_component): gtk_signal_connect -> g_signal_connect.
-
- * gui/component/addressbook-storage.c: fix the gnome-xml
- headers.
- (addressbook_storage_setup): use
- evolution_shell_client_corba_objref as per ettore's change to
- EvolutionShellClient..
- (addressbook_get_other_contact_storage): gtk_signal_connect ->
- g_signal_connect.
- (load_source_data): root->childs -> root->childrens.
-
-2002-11-06 Chris Toshok <toshok@ximian.com>
-
- * gui/search/e-addressbook-search-dialog.c: fix some #include's.
-
-2002-11-06 Chris Toshok <toshok@ximian.com>
-
- * Makefile.am (SUBDIRS): only build the backend and gui dirs for
- now. printing and conduits are no-man's land at present.
-
- * addressbook/gui/merging/e-card-merging.[ch]: Port to
- GObject/gnome2.
-
-2002-11-05 Chris Toshok <toshok@ximian.com>
-
- * gui/component/.cvsignore: ignore the new .server file.
-
- * gui/component/Makefile.am: typical port stuff. switch the .oaf
- to .server, and leave out a lot of libs so we can actually get
- things linking.
-
- * gui/component/GNOME_Evolution_Addressbook.server.in: rename
- .oaf.in here.
-
- * gui/component/addressbook-component.c: Port to GObject/gnome2.
-
- * gui/component/addressbook-config.c: Port to GObject/gnome2.
-
- * gui/component/addressbook-factory.c: Port to GObject/gnome2.
-
- * gui/component/addressbook-storage.c: Port to GObject/gnome2.
-
- * gui/component/addressbook.[ch]: Port to GObject/gnome2.
-
- * gui/component/e-address-popup.[ch]: Port to GObject/gnome2.
-
- * gui/component/e-address-widget.[ch]: Port to GObject/gnome2.
-
- * gui/component/e-cardlist-model.h: Port to GObject/gnome2.
-
-2002-11-05 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-list-editor/.cvsignore: ignore the marshal generated
- stuff.
-
- * gui/contact-list-editor/Makefile.am: typical port stuff. add
- marshaller generation foo, dist it...
-
- * gui/contact-list-editor/e-contact-list-editor.[ch]: Port to
- GObject/gnome2.
-
- * gui/contact-list-editor/e-contact-list-model.[ch]: Port to
- GObject/gnome2.
-
-2002-11-05 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/.cvsignore: ignore the marshal generated
- stuff.
-
- * gui/contact-editor/Makefile.am: typical port stuff. add
- marshaller generation foo, dist it...
-
- * gui/contact-editor/e-contact-editor-address.[ch]: Port to GObject/gnome2.
-
- * gui/contact-editor/e-contact-editor-fullname.c: Port to GObject/gnome2.
-
- * gui/contact-editor/e-contact-editor.c: Port to GObject/gnome2.
-
- * gui/contact-editor/e-contact-quick-add.c: Port to GObject/gnome2.
-
- * gui/contact-editor/e-contact-save-as.[ch]: Port to GObject/gnome2.
-
- * gui/contact-editor/test-editor.c: Port to GObject/gnome2.
-
-2002-11-05 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-model.[ch]: Port to GObject/gnome2.
-
- * gui/widgets/e-addressbook-reflow-adapter.c: Port to
- GObject/gnome2.
-
- * gui/widgets/e-addressbook-table-adapter.c: Port to
- GObject/gnome2.
-
- * gui/widgets/e-addressbook-util.c: Port to GObject/gnome2.
-
- * gui/widgets/e-addressbook-view.[ch]: Port to GObject/gnome2.
-
- * gui/widgets/e-minicard-control.c: Port to GObject/gnome2.
-
- * gui/widgets/e-minicard-label.[ch]: Port to GObject/gnome2.
-
- * gui/widgets/e-minicard-view-widget.[ch]: Port to GObject/gnome2.
-
- * gui/widgets/e-minicard-view.[ch]: Port to GObject/gnome2.
-
- * gui/widgets/e-minicard-widget-test.c: Port to GObject/gnome2.
-
- * gui/widgets/e-minicard-widget.c: Port to GObject/gnome2.
-
- * gui/widgets/e-minicard.[ch]: Port to GObject/gnome2.
-
- * gui/widgets/gal-view-factory-minicard.c: Port to GObject/gnome2.
-
- * gui/widgets/gal-view-minicard.c: Port to GObject/gnome2.
-
- * gui/widgets/test-minicard-label.c: Port to GObject/gnome2.
-
- * gui/widgets/test-minicard-view.c: Port to GObject/gnome2.
-
- * gui/widgets/test-minicard.c: Port to GObject/gnome2.
-
- * gui/widgets/test-reflow.c: Port to GObject/gnome2.
-
- * gui/widgets/Makefile.am: typical port stuff. add marshaller
- generation foo, dist it...
-
- * gui/widgets/.cvsignore: ignore the marshaller stuff.
-
-2002-11-05 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-simple-card-bonobo.[ch]: Port to
- GObject/gnome2.
-
- * gui/component/select-names/e-select-names.[ch]: Port to
- GObject/gnome2.
-
- * gui/component/select-names/e-select-names-text-model.c: Port to
- GObject/gnome2.
-
- * gui/component/select-names/e-select-names-table-model.c: Port to
- GObject/gnome2.
-
- * gui/component/select-names/e-select-names-popup.[ch]: Port to
- GObject/gnome2.
-
- * gui/component/select-names/e-select-names-model.c: Port to
- GObject/gnome2.
-
- * gui/component/select-names/e-select-names-manager.[ch]: Port to
- GObject/gnome2.
-
- * gui/component/select-names/e-select-names-factory.c: Port to
- GObject/gnome2.
-
- * gui/component/select-names/e-select-names-completion.[ch]: Port
- to GObject/gnome2.
-
- * gui/component/select-names/e-select-names-bonobo.[ch]: Port to
- GObject/gnome2.
-
- * gui/component/select-names/Makefile.am: typical port stuff. add
- marshaller generation foo, dist it, and switch the .oaf to .server
-
- * gui/component/select-names/.cvsignore: ignore the marshaller
- stuff.
-
-2002-11-05 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/.cvsignore: ignore the generated marshaller files.
-
- * backend/ebook/e-destination.c (e_destination_dispose): rename
- e_destination_destroy.
- (e_destination_equal): ifdef this out for now, PENDING_PORT_WORK.
- (e_destination_get_name): same.
- (e_destination_get_email): same.
- (e_destination_get_address): same.
- (e_destination_get_textrep): same.
-
- * backend/ebook/Makefile.am: don't build the executables
- (importers and loaders) for now. Also, s/oaf/server, and use
- INTLTOOL_SERVER_RULE.
-
- * backend/ebook/e-book-util.c (e_book_get_config_database):
- un-#ifdef this.
- (e_book_default_book_open): un-#ifdef ths code in here that relies
- on the e_config_listener.
-
-2002-11-05 Dan Winship <danw@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (send_pending_adds): copy a
- memleak fix from pas-backend-ad.
-
-2002-11-05 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-card.c: g_date_* => g_date_get_*, fixes
- G_DISABLE_DEPRECATED build.
-
- * backend/ebook/e-book-listener.[ch]: remove the servant crap i'd
- c&p'ed and put in here.
-
- * backend/ebook/e-book-view-listener.[ch]: remove the servant crap
- i'd c&p'ed and put in here.
-
- * backend/pas/pas-book-factory.[ch]: subclass from BonoboObject,
- and remove the servant crap from here too. whee.
-
- * backend/pas/pas-card-cursor.[ch]: remove the servant crap i'd
- c&p'ed and put in here.
-
- * backend/pas/pas-book.[ch]: remove the servant crap i'd c&p'ed
- and put in here.
-
- * backend/pas/pas-book-view.[ch]: remove the servant crap i'd
- c&p'ed and put in here.
-
-2002-11-05 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-card-sexp.[ch]: port to gnome 2.
-
- * backend/pas/pas-backend-file.[ch]: same.
-
- * backend/pas/pas-backend-file.[ch]: same.
-
- * backend/pas/pas-backend-ldap.[ch]: same.
-
- * backend/pas/pas-backend-summary.[ch]: same.
-
- * backend/pas/pas-backend.[ch]: same.
-
- * backend/pas/pas-book-factory.[ch]: same.
-
- * backend/pas/pas-book-view.[ch]: same.
-
- * backend/pas/pas-book.[ch]: same.
-
- * backend/pas/pas-card-cursor.[ch]: same.
-
- * backend/pas/pas-marshal.list: list of marshallers.
-
- * backend/pas/Makefile.am (libpas_a_SOURCES): add pas-marshal.c
- also add the marshal building foo.
-
- * backend/pas/.cvsignore: ignore pas-marshal.[ch]
-
-2002-11-05 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/test-client-list.c (main): don't call
- bonobo_activation_init directly.
-
- * backend/ebook/test-client.c (get_card_cb): don't unref the card
- here since we never reffed it.
- (main): no need to call bonobo_activation_init, as
- gnome_program_init did it for us.
-
- * backend/ebook/e-card-simple.c (e_card_simple_get_property):
- s/g_value_{set,get}_pointer/g_value_{set,get}_object
-
- * backend/ebook/e-book-util.c (set_default_book_uri_local): make
- sure to terminate args with NULL for g_build_filename.
-
- * backend/ebook/e-book-listener.c: nuke e_book_listener_get_type
- and use the BONOBO_TYPE_FUNC_FULL macro.
-
- * backend/ebook/e-book-listener.h: add the epv to
- EBookListenerClass so BONOBO_TYPE_FUNC_FULL works.
-
- * backend/ebook/e-book-view-listener.c: nuke
- e_book_view_listener_get_type and use the BONOBO_TYPE_FUNC_FULL
- macro.
-
- * backend/ebook/e-book-view-listener.h: add the epv to
- EBookViewListenerClass so BONOBO_TYPE_FUNC_FULL works.
-
-2002-11-02 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book-types.h: just include glib.h instead of the
- gtk stuff.
-
- * backend/ebook/e-book-listener.[ch]: convert to
- GObject/bonobo-activation/etc/etc.
- * e-book-util.[ch]: same.
- * e-book-view-listener.[ch]: same.
- * e-book-view.[ch]: same.
- * e-book.[ch]: same.
- * e-card-compare.[ch]: same.
- * e-card-cursor.[ch]: same.
- * e-card-simple.[ch]: same.
- * e-card.[ch]: same.
- * e-destination.[ch]: same.
- * evolution-ldif-importer.c: same.
- * evolution-vcard-importer.c: same.
- * load-gnomecard-addressbook.c: same.
- * load-pine-addressbok.c: same.
- * test-card.c: same.
- * test-client-list.c: same.
- * test-client.c: same.
-
- * backend/ebook/Makefile.am: add e-book-marshal.c to SOURCES, add
- e-book-marshal.[ch] to CLEANFILES, and add e-book-marshal.list to
- EXTRA_DIST. Also, remove the camel libs from the test LDADD's,
- and leave e-destination.[ch] out of the build.
-
- * backend/ebook/.cvsignore: ignore e-book-marshal.[ch]
-
- * backend/ebook/e-book-marshal.list: marshallers for e-book.
-
-2002-10-28 Larry Ewing <lewing@ximian.com>
-
- * backend/ebook/e-card.c (addPropValueUTF8): never set the charset
- on an item without also encoding it. Mime messages don't like
- parts with multiple charsets.
-
-2002-10-25 Dan Winship <danw@ximian.com>
-
- * gui/widgets/e-addressbook-model.c (addressbook_destroy):
- Disconnect from the book's backend_died signal.
-
-2002-10-24 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/Makefile.am: install evolutionperson.schema to
- $(datadir)/evolution.
-
-2002-10-24 Chris Toshok <toshok@ximian.com>
-
- [ fixes #29144 ]
- * gui/component/addressbook-config.c (edit_dialog_store_change):
- use e_table_memory_storage_change instead of remove/insert, so the
- selection is maintained.
-
-2002-10-22 Dan Winship <danw@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (folder_selected): Set /Addressbook/select_names_uri in the
- configdb to the selected folder.
- (e_select_names_init): Look for /Addressbook/select_names_uri
- before /DefaultFolders/contacts_uri for the initial folder. So the
- select names dialog now starts up using the same folder you used
- last time, which is useful when you have an LDAP company directory
- (which can't be your default contacts folder because it's
- read-only).
-
-2002-10-21 Dan Winship <danw@ximian.com>
-
- * gui/component/addressbook-component.c (IS_CONTACT_TYPE): fix the
- sense of a strcmp
-
-2002-10-20 Chris Toshok <toshok@ximian.com>
-
- [ fix for #23764 ]
- * gui/widgets/e-addressbook-view.c (jump_to_letters): handle
- multiple letters associated with a single button.
- (button_toggled): closure->letter -> closure->letters.
- (free_closure): free closure->letters.
- (create_alphabet): init closure->letters.
-
-2002-10-20 Chris Toshok <toshok@ximian.com>
-
- [ fixes #29067 ]
- * backend/pas/pas-backend-file.c (pas_backend_file_search): we
- need to create a card_sexp even when doing summary queries since
- it's used to check modifications of cards in the view.
-
-2002-10-20 Chris Toshok <toshok@ximian.com>
-
- [ fixes #32144 ]
- * gui/contact-editor/e-contact-save-as.c (e_contact_save_as):
- convert the name to the gtk locale before saving.
- (e_contact_list_save_as): same.
-
-2002-10-19 Chris Toshok <toshok@ximian.com>
-
- [ probable fix for #25477, and memory leak fix ]
- * gui/contact-editor/e-contact-editor.c (supported_fields_cb): if
- the dialog isn't in the list of all dialogs it's been destroyed so
- just return here.
-
- * backend/ebook/e-book.c
- (e_book_do_response_get_supported_fields): plug leak of
- resp->fields.
-
-2002-10-15 Dan Winship <danw@ximian.com>
-
- * backend/ebook/e-card.c (e_card_email_match_string): Return right
- away rather than crashing if card->email is NULL.
- (e_card_email_find_number): Likewise.
-
-2002-10-10 Kjartan Maraas <kmaraas@gnome.org>
-
- [Fix #7094, #7064, #7095, #31944, #31945 ]
- * gui/component/Makefile.am: Hook up new etspec file.
- * gui/component/addressbook-config.c: Remove ETable spec.
- * gui/component/addressbook-config.etspec: New file.
- * gui/component/ldap-config.glade: Fix typo.
- * gui/component/select-names/e-select-names.c: Remove inline spec.
- * gui/component/select-names/e-select-names.etspec: New file.
- * gui/contact-list-editor/Makefile.am: Hook up etspec.
- * gui/contact-list-editor/e-contact-list-editor.c: Remove inline spec.
- * gui/contact-list-editor/e-contact-list-editor.etspec: New file.
- * gui/widgets/Makefile.am: Hook up new spec.
- * gui/widgets/e-addressbook-view.c: Remove inline spec.
- * gui/widgets/e-addressbook-view.etspec: New file.
-
-2002-10-02 Chris Toshok <toshok@ximian.com>
-
- [ Fix #28392 ]
- * gui/widgets/e-addressbook-view.c (do_popup_menu): #if 0 out the
- gal_view submenu, since it's not spec'ed to be there anyway (as
- per bug #16250).
-
-2002-09-30 Chris Toshok <toshok@ximian.com>
-
- [ Fixes #31321 ]
- * backend/ebook/e-card.c (e_card_get_vobject): add VERSION:2.1 to
- exported vCards.
-
-2002-09-30 Chris Toshok <toshok@ximian.com>
-
- [ Fixes #31434 ]
- * backend/pas/pas-backend-file.c (do_summary_query): always
- retrieve the card from the db. use the summary strictly for
- matching, not for storing all information. This fixes completion
- of contact lists, since only 3 addresses were being stored and
- contact lists can have more.
-
-2002-09-30 Aaron Weber <aaron@ximian.com>
-
- * gui/widgets/e-addressbook-util.c (e_addressbook_show_multiple_cards): rephrase string on l. 213
-
-2002-09-30 Dan Winship <danw@ximian.com>
-
- * backend/ebook/e-card.c (e_card_list_send): update for
- Composer_setHeaders change.
-
-2002-09-27 Chris Toshok <toshok@ximian.com>
-
- [ fixes #27521 ]
- * gui/contact-editor/e-contact-quick-add.c (editor_closed_cb):
- always unref the contact editor when we get the editor_closed
- signal.
-
-2002-09-27 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (check_schema_support): set the
- timeout to 30 seconds.
- (query_ldap_root_dse): same, and also return the ldap_error since
- this function is the one that actually causes openldap to
- connect() to the ldap host.
- (pas_backend_ldap_connect): check the return value of
- query_ldap_root_dse, and error out if it's not SUCCESS.
-
-2002-09-26 Dan Winship <danw@ximian.com>
-
- * gui/component/addressbook-storage.c (load_source_data): Change
- folder type to "contacts/ldap".
- (addressbook_storage_add_source): Likewise.
- (create_ldap_folder): Check for type being "contacts" not
- ldap contacts, since the ldap-specific type doesn't appear in the
- menu.
-
-2002-09-25 Dan Winship <danw@ximian.com>
-
- * gui/component/addressbook-component.c (folder_types): Rename
- "ldap-contacts" to "contacts/ldap" and add "contacts/public".
- (IS_CONTACT_TYPE): update for new types.
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_init): Use "contacts/*" for selector_types.
-
- * gui/widgets/e-addressbook-util.c (e_addressbook_transfer_cards):
- Likewise.
-
- * gui/component/GNOME_Evolution_Addressbook.oaf.in: add
- "evolution:config_item:type" = "contacts/ldap" to the LDAP sources
- control so it comes up by default when you open Preferences in an
- LDAP folder.
-
-2002-09-23 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-table-adapter.c (addressbook_destroy):
- free adapter->priv.
-
- * gui/widgets/e-addressbook-model.c (addressbook_destroy): free
- model->query.
-
- * gui/component/select-names/e-select-names-manager.c
- (load_completion_books): use e_book_expand_uri here, and free the
- expanded uri after calling addressbook_load_uri, plugging a leak.
-
- * gui/component/select-names/e-select-names.c (set_book): unref
- esn->model before we unref esn. fixes an edge case memory
- corruption bug.
- (clear_widget): utility function to set a widget's ref to NULL
- when it's destroyed.
- (e_select_names_init): hook the status_message, categories option
- menu, and select_entry to clear_widget.
- (addressbook_model_set_uri): use e_book_expand_uri.
-
-2002-09-23 JP Rosevear <jpr@ximian.com>
-
- * conduit/Makefile.am: add libeutil to the link and link with
- libcamel instead of libcamel-static.la
-
-2002-09-22 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-manager.h: oops, add
- cached_folder_list to struct _ESelectNamesManager.
-
-2002-09-22 Chris Toshok <toshok@ximian.com>
-
- [ Fixes #30481 ]
- * gui/component/select-names/e-select-names.c
- (e_select_names_init): initialize the select names dialog with the
- default contacts folder.
-
-2002-09-22 Chris Toshok <toshok@ximian.com>
-
- [ Fixes #28165, 29171 ]
- * gui/component/select-names/e-select-names-manager.c
- (uris_listener): check to see if the value has really changed.
- the way the preferences dialog works is such that we'll get called
- when any of the Folder Options are changed (default folders,
- offline stuff, etc.) we really only want to tear down and build
- back up the completion books if the autocomplete folder setting
- changed.
- (read_completion_books_from_db): cache the folder list, and call
- load_completion_books.
- (load_completion_books): new function, loads from the
- cached_folder_list.
- (e_select_names_manager_init): init cached_folder_list to NULL.
- (e_select_names_manager_destroy): g_free (cached_folder_list).
-
-2002-09-20 Chris Toshok <toshok@ximian.com>
-
- [ Fixes #30483 ]
- * gui/component/select-names/e-select-names-completion.c
- (name_style_query): argh, contains => beginswith.
-
-2002-09-17 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-component.c (add_creatable_item):
- don't add the user creatable item for ldap-contact folders atm,
- since it results in their being duplicate New Contact and New
- Contact List menu items.
-
-2002-09-17 Kjartan Maraas <kmaraas@gnome.org>
-
- * gui/component/ldap-config.glade: Fix a typo.
-
-2002-09-13 Chris Toshok <toshok@ximian.com>
-
- [ Fixes bug #30250 ]
- * backend/ebook/e-destination.c (e_destination_get_name): handle
- "Unnamed Lists" here by setting their name to _("Unnamed List').
-
- * backend/ebook/e-card-simple.c (e_card_simple_get): same.
-
- * gui/contact-list-editor/e-contact-list-editor.c (is_named): new
- function, return TRUE if the name field is filled in.
- (prompt_to_save_changes): return TRUE if the list isn't named
- (meaning it's not saveable.)
- (command_state_changed): saving requires a name.
- (add_email_cb): always call command_state_changed.
- (remove_entry_cb): same.
- (list_name_changed_cb): same.
- (visible_addrs_toggled_cb): same.
- (table_drag_data_received_cb): same.
-
-2002-09-12 Dan Winship <danw@ximian.com>
-
- * backend/ebook/e-card-simple.c (e_card_simple_get): return
- g_strdup("true"), not "true".
-
-2002-09-11 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_start_query): institute an arbitrary
- minimum limit on the number of characters before we actually try
- to autocomplete. It's 3, btw.
-
-2002-09-11 Chris Toshok <toshok@ximian.com>
-
- [ fixes the other half of #17336 ]
- * gui/contact-editor/e-contact-quick-add.c (quick_add_set_name):
- parse the name when we're asked to set it, so the full name
- doesn't get stored as (potentially) "Last, First" in the card.
-
-2002-09-11 Chris Toshok <toshok@ximian.com>
-
- [ fixes part of #17336 ]
- * gui/contact-editor/e-contact-editor-fullname.c
- (e_contact_editor_fullname_init): get the window title from the
- .glade file, and supply a suitable wm icon.
-
- * gui/contact-editor/e-contact-editor-address.c
- (e_contact_editor_address_init): same.
-
-2002-09-11 Chris Toshok <toshok@ximian.com>
-
- [ fixes #30208 ]
- * gui/component/addressbook.c (load_uri_auth_cb): if the user
- clicked cancel in the password dialog, let them off the hook and
- bind anonymously. Otherwise (if they failed to auth), prompt them
- for the password again.
- (addressbook_authenticate): new function, split out 99% of the
- auth machinery here so it can be called multiple times. Also,
- call the callback with E_BOOK_STATUS_CANCELLED if the user clicked
- the cancel button in the dialog.
- (load_uri_cb): call addressbook_authenticate if the book has auth
- enabled.
- (addressbook_load_uri): use g_new0.
-
-2002-09-05 Anna Dirks <anna@ximian.com>
- * gui/component/GNOME_Evolution_Addressbook.oaf.in : Changed the
- description of the Directory Servers page of the settings dialog
- to be a little less wordy {This page can be used to configure blah-->
- Configure blah.}
-
-
-2002-09-04 Chris Toshok <toshok@ximian.com>
-
- [ Fixes #29904 ]
- * gui/component/select-names/e-select-names-text-model.c
- (e_select_names_text_model_activate_obj): we need to activate
- either a contact list editor or contact editor depending on if
- it's a list (this screams for a utility function.)
-
-2002-09-04 Dan Winship <danw@ximian.com>
-
- * gui/component/addressbook-storage.c
- (addressbook_get_other_contact_storage): Pass FALSE to
- evolution_storage_new: the Other Contacts storage doesn't support
- shared folders.
-
-2002-09-04 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-component.c (create_component): Pass
- NULL as @unpopulate_folder_context_menu_fn to
- evolution_shell_component_new().
-
-2002-09-03 Mike Kestner <mkestner@ximian.com>
-
- * gui/component/select-names/e-select-names.c (e_select_names_destroy):
- unref the "without", adapter, and model, then chain up the GnomeDialog
- destroy function.
-
-2002-09-03 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/GNOME_Evolution_Addressbook.oaf.in: Use
- ldap-settings.png instead of evolution-contacts.png.
-
-2002-09-03 Chris Toshok <toshok@ximian.com>
-
- [ fixes #29699 ]
- * gui/component/addressbook-config.c
- (addressbook_add_server_druid): call _set_source with a NULL
- source to fill in dialog settings that are set from the option
- menus (like the SSL setting).
-
-2002-09-03 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook.c (delete_contact_cb): Fix typo
- [`view>view' instead of `view->view']. Also, cast to
- GTK_WINDOW instead of GTK_WIDGET as it should be.
-
-2002-08-30 Dan Winship <danw@ximian.com>
-
- * backend/idl/addressbook.idl (CallStatus): add QueryRefused, for
- when the backend refuses to perform a query. (part of #25782)
-
- * backend/ebook/e-book-view-listener.c
- (e_book_view_listener_convert_status): translate
- GNOME_Evolution_Addressbook_BookViewListener_QueryRefused.
-
- * gui/component/addressbook.c (search_result): Handle
- E_BOOK_VIEW_STATUS_QUERY_REFUSED.
-
-2002-08-30 Chris Toshok <toshok@ximian.com>
-
- [ fixes #27923]
- * backend/pas/pas-backend-summary.c: up the version to 4_0 (4000).
- (pas_backend_summary_load_item): handle wants_html{_set}, list,
- and list_show_addresses.
- (pas_backend_summary_save_item): same.
- (pas_backend_summary_add_card): same.
- (pas_backend_summary_get_summary_vcard): same.
-
-2002-08-29 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-component.c (add_creatable_item): call
- evolution_shell_component_add_user_creatable_item twice here, once
- for the "contacts" folder type, and once for "ldap-contacts".
-
-2002-08-29 Chris Toshok <toshok@ximian.com>
-
- [ fixes #20347 ]
- * gui/widgets/e-addressbook-view.c (e_addressbook_view_init): hook
- up the backend_died signal.
- (backend_died): new function, pop up an error dialog saying the
- backend died.
-
- * gui/widgets/e-addressbook-model.c (backend_died): new function,
- emit the backend_died signal.
- (e_addressbook_model_class_init): create the backend_died signal.
- (e_addressbook_model_init): init backend_died_id
- (e_addressbook_model_set_arg): disconnect the backend_died signal
- from the old book and hook it up to the new book.
-
- * gui/widgets/e-addressbook-model.h: add the backend_died signal.
-
- * backend/ebook/e-book.c (backend_died_cb): new function, emit the
- backend_died signal.
- (e_book_do_response_open): create the component listener and hook
- up the backend_died signal.
- (e_book_destroy): disconnect the component listener and unref it.
-
- * backend/ebook/e-book.h: add backend_died signal.
-
-2002-08-29 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-card-sexp.c (is_helper): use strcasecmp
- here, since all the other helpers use case insensitive
- comparisons.
-
- * backend/pas/pas-backend-summary.c (is_helper): same.
-
-2002-08-29 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (category_ber): return NULL if
- the list is empty.
- (pas_backend_ldap_connect): always try to use ldapv3, not just
- when we want to use tls.
-
-2002-08-29 Chris Toshok <toshok@ximian.com>
-
- [ fixes #25038 ]
- * gui/contact-editor/Makefile.am (INCLUDES): need to have
- EVOLUTION_ICONSDIR defined.
-
- * gui/contact-list-editor/Makefile.am (INCLUDES): same.
-
- * gui/contact-editor/e-contact-editor.c (e_contact_editor_init):
- set the window icon to the contact mini icon.
-
- * gui/contact-list-editor/e-contact-list-editor.c
- (e_contact_list_editor_init): set the window icon to the new
- contact list icon.
-
- * gui/widgets/e-minicard.c (LIST_ICON_FILENAME): change to (the
- prettier, imo) "contact-list-16.png"
-
-2002-08-28 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_search): spew
- the filter we're using for the search.
-
-2002-08-28 Mike Kestner <mkestner@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c : stop the
- EBookViews before unreffing.
-
-2002-08-28 Dan Winship <danw@ximian.com>
-
- * gui/component/GNOME_Evolution_Addressbook.oaf.in: Add an
- evolution:shell_component_launch_order and rename
- evolution:shell_component_icon.
-
-2002-08-28 Chris Toshok <toshok@ximian.com>
-
- [ oops, merged the .h and .glade file back to the HEAD from the
- 1-0 branch, but missed the .c file. ]
- * gui/component/select-names/e-select-names.c (status_message): set
- the status label's text.
- (e_select_names_init): get the status message widget from the
- glade ui.
-
-2002-08-28 Chris Toshok <toshok@ximian.com>
-
- [ fixes #19286 ]
- * gui/component/addressbook.c (delete_contact_cb): confirm
- deletion of contacts when using the menubar or toolbar.
-
-2002-08-28 Chris Toshok <toshok@ximian.com>
-
- [ fixes #28897 ]
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_clear_book_data): set book_data to NULL
- after clearing/freeing the list. fixes a crash.
-
-2002-08-28 Chris Toshok <toshok@ximian.com>
-
- [ fixes #20348 ]
- * backend/pas/evolutionperson.schema: deprecate "categories" in
- favor of "category". evolution no longer uses "categories".
-
- * backend/pas/pas-backend-ldap.c (category_populate): new
- function, "category" is the new name, and it's multivalued so we
- need the complex-prop stuff..
- (category_ber): new function, same.
- (category_compare): new function, same.
-
- * gui/component/addressbook.c (addressbook_search_activated): the
- text is "Category is" so we should use "is" instead of "contains"
- for the query.
-
-2002-08-27 Chris Toshok <toshok@ximian.com>
-
- [ Fixes #14835 ]
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_search):
- notify_complete with InvalidQuery if the parse fails.
-
-2002-08-27 Chris Toshok <toshok@ximian.com>
-
- [ fixes #26907 ]
- * gui/component/addressbook.c (addressbook_search_activated): use
- beginswith for email.
-
-2002-08-26 Chris Toshok <toshok@ximian.com>
-
- * printing/e-contact-print.c (complete_sequence): change prototype
- for complete_sequence to match sequence_complete.
- (e_contact_print_button): same.
-
-2002-08-26 Chris Toshok <toshok@ximian.com>
-
- [ fixes #29446 ]
- * gui/component/addressbook-config.c (scope_optionmenu_activated):
- searching_modify_func can be NULL (since we don't require changes
- to enable the "Next" button on this page when you create a
- directory server.)
-
-2002-08-26 Chris Toshok <toshok@ximian.com>
-
- [ Fixes (almost certainly) #24649, #25494, #27351, and other LDAP search crashes ]
- * backend/pas/pas-backend-ldap.c (view_destroy): use an EList
- instead of a GList to store the book_view's so we don't have weird
- issues with modifying the list while it's being traversed.
- (find_book_view): same.
- (create_card_handler): same.
- (remove_card_handler): same.
- (modify_card_modify_handler): same.
- (poll_ldap): same, and also ref the book_view before calling
- ldap_search_op_timeout (and therefore send_pending_adds).
- (ldap_search_handler): same.
- (ldap_op_add): warn about conflicting ldap msgid's (shouldn't ever
- happen..)
- (homephone_populate): make this a bit more robust (if values[0] ==
- NULL, values[1] won't be valid).
- (business_populate): same.
- (build_card_from_entry): break out of the prop_info loop when we
- get a match, and only set the simple field if the value != NULL.
- (ldap_search_dtor): free all the pending adds stuff.
- (pas_backend_ldap_process_get_book_view): g_list_prepend =>
- e_list_append.
- (pas_backend_ldap_remove_client): simplify the removing of the
- book (use g_list_remove instead of searching and then using
- g_list_remove_link.)
- (pas_backend_ldap_destroy): unref the book_views list.
- (pas_backend_ldap_init): initialize the EList for book_views.
-
-2002-08-25 Mike Kestner <mkestner@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (remove_book_view): stop the
- view before unref, in case the listener has pending events.
-
-2002-08-20 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c (book_open_cb): not sure what i was
- thinking here... the EBook isn't valid if we couldn't open it, so
- we can't turn around and query it for its capabilities.
-
-2002-08-19 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-manager.h: add the
- listener_id slot.
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_new): store off the listener_id.
- (e_select_names_manager_destroy): remove the bonobo listener -
- fixes a crash when modifying the completion folders after you
- bring up a compose window.
- (e_select_names_manager_entry_new): another random timeout change
- - make the completion at 100ms.
-
-2002-08-19 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-book-view.c (pas_book_view_notify_complete):
- take and pass the CallStatus to our listener.
-
- * backend/pas/pas-book-view.h: change the prototype for
- notify_complete to include the CallStatus.
-
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_seq_complete_cb): add the status arg.
-
- * gui/widgets/e-addressbook-view.c
- (e_addressbook_view_class_init): init the search_result signal.
- (e_addressbook_view_init): connect to the model's search_result
- signal.
- (emit_search_result): emit our search_result signal.
- (search_result): call emit_search_result.
-
- * gui/widgets/e-addressbook-view.h (struct
- _EAddressbookViewClass): add the search_result signal.
-
- * gui/widgets/e-addressbook-model.c (sequence_complete): emit both
- a "search_result" as well as the "stop_state_changed" signal.
- (e_addressbook_model_class_init): init the search_result signal.
-
- * gui/widgets/e-addressbook-model.h: add search_result signal.
-
- * gui/component/addressbook.c (search_result): pop up a dialog
- telling the user why the search failed or was truncated.
- (addressbook_factory_new_control): connect to the "search_result"
- signal on the view.
-
- * conduit/address-conduit.c (sequence_complete): add the status
- parameter to sequence_complete.
-
- * backend/idl/addressbook.idl: add BookViewListener_CallStatus,
- and change notifySequenceComplete to take a CallStatus.
-
- * backend/pas/pas-backend-ldap.c (create_card_handler): pass
- status back in the notify_complete call.
- (remove_card_handler): same.
- (modify_card_modify_handler): same
- (ldap_search_handler): same, and parse out the ldap return code so
- we can report limits being properly.
-
- * backend/pas/pas-backend-file.c (do_summary_query): pass status
- back in the notify_complete call.
- (pas_backend_file_search): same, and get rid of the
- status_message, as the status is passed back properly.
- (pas_backend_file_search): pass status
- back in the notify_complete call.
- (pas_backend_file_changes): same.
- (pas_backend_file_process_create_card): same.
- (pas_backend_file_process_remove_card): same.
- (pas_backend_file_process_modify_card): same.
-
- * backend/ebook/e-book-util.c (simple_query_sequence_complete_cb):
- add status parameter.
-
- * backend/ebook/e-book-view-listener.c
- (e_book_view_listener_queue_status_event): change name from
- _queue_empty_event, and take a status arg.
- (e_book_view_listener_queue_id_event): init resp->status (to
- SUCCESS).
- (e_book_view_listener_queue_sequence_event): same.
- (e_book_view_listener_queue_message_event): same.
- (impl_BookViewListener_notify_sequence_complete): call
- queue_status_event, and convert the corba status to
- EBookViewStatus.
- (e_book_view_listener_convert_status): new function, conver the
- corba status to EBookViewStatus.
-
- * backend/ebook/e-book-view-listener.h: add a "status" slot to
- EBookViewListenerResponse.
-
- * backend/ebook/e-book-view.h: change prototype for
- sequence_complete signal.
-
- * backend/ebook/e-book-view.c (e_book_view_do_complete_event):
- sequence_complete takes a parameter now (EBookViewStatus).
- (e_book_view_class_init): add the enum arg to the signal.
-
- * backend/ebook/e-book-types.h: add EBookViewStatus enum.
-
-2002-08-19 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_get_static_capabilities): add
- "cache-completions" here, since file completion results are
- blanket cached (as they're generated from a summary).
-
- * backend/pas/pas-backend-ldap.c
- (pas_backend_ldap_process_get_cursor): there should be no search
- limit on the get_cursor_request, as it's meant to match every card
- it can.
- (ldap_search_handler): parse the ldap result in the
- RES_SEARCH_RESULT case. we'll want more here soon, so we can
- notify the front end if the result was truncated due to either the
- size or time limit being exceeded.
- (pas_backend_ldap_process_get_book_view): in the case of a
- completion view, we hardcode (yeah yeah, i know, but really) the
- search limit to MIN (100, user-specified-limit).
- (pas_backend_ldap_search): each view has its own limit now,
- defaulting from the user specified one for normal searches but
- possibly different for completion views. use the view's limit
- here.
-
-2002-08-19 Dan Winship <danw@ximian.com>
-
- * gui/component/select-names/e-select-names-bonobo.c
- (entry_get_property_fn): add an "addresses" property, to get the
- "Dan Winship <danw@ximian.com>" form, as opposed to "text", which
- gets you what's displayed, which might be just "Dan Winship".
- (entry_set_property_fn): When setting, just reuse the "text" code,
- since it should properly cardify everything for us anyway.
- (impl_SelectNames_get_entry_for_section): Add the property.
-
-2002-08-16 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-config.c
- (addressbook_source_dialog_set_source): fix c&p error that was
- losing the ssl setting.
-
-2002-08-16 Iain <iain@ximian.com>
-
- * backends/e-book/evolution-ldif-importer.c (ebook_create): Use the
- default EBook instead of the local one.
-
- * backends/e-book/evolution-vcard-importer.c (ebook_create): Ditto.
-
-2002-08-16 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (book_view_notify_status): new
- function to save a little typing.
- (find_book_view): same.
- (pas_backend_ldap_connect): reorder things a bit - set the version
- to VERSION3 *before* doing TLS, as tls requires v3, and if we're
- doing ldaps://, do tls a little differently (not sure if this is
- strictly necessary, but the openldap source did it.. *shrug*).
- also, guard the schema check as this function can be called
- multiple times for the same server (if the server goes down or
- times us out.)
- (pas_backend_ldap_reconnect): new function, reconnect and if
- necessary reauth the user.
- (pas_backend_ldap_process_create_card): use
- find_book_view/book_view_notify_status/pas_backend_ldap_reconnect.
- (pas_backend_ldap_process_remove_card): same.
- (pas_backend_ldap_process_modify_card): same.
- (pas_backend_ldap_process_get_vcard): same.
- (pas_backend_ldap_process_get_cursor): same.
- (pas_backend_ldap_search): same.
- (poll_ldap): reconnect if ldap_result returns -1.
- (pas_backend_ldap_process_authenticate_user): ick ick ick save off
- the dn/passwd we auth with so we can use them to reauthenticate.
-
-2002-08-16 Chris Toshok <toshok@ximian.com>
-
- [ fix 27333 ]
- * gui/widgets/e-addressbook-model.c (get_view): "local" ->
- "do-initial-query".
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_get_static_capabilities): "local" ->
- "local,do-initial-query".
-
- * gui/widgets/e-addressbook-model.c (get_view): "local" ->
- "do-initial-query".
-
- * gui/component/addressbook.c (book_open_cb): Only assume the
- addressbook is local if "local" appears in its static
- capabilities. We still use the ldap special case, but be nicer to
- other networked backends.
-
-2002-08-12 Dan Winship <danw@ximian.com>
-
- * gui/component/addressbook-component.c (user_create_new_item_cb):
- If invoked from a non-contact folder, add the contact to the
- default contact folder, not the local one. If invoked from a
- contact folder, don't append "addressbook.db" to the URI, let
- ebook do the right thing. Fixes #28327 and #28325.
-
- * backend/idl/addressbook.idl (CallStatus): Add NoSuchBook.
- (Initially intended as part of a fix for #28327, but the other
- changes make it so the error code never ends up getting used any
- more, but it's still good to have.)
-
- * gui/widgets/e-addressbook-util.c (e_addressbook_error_dialog):
- Handle NO_SUCH_BOOK.
-
- * backend/ebook/e-book-types.h (EBookStatus): Add
- E_BOOK_STATUS_NO_SUCH_BOOK.
-
- * backend/ebook/e-book-listener.c
- (e_book_listener_convert_status): add case for NoSuchBook.
-
- * backend/ebook/e-book-util.c (e_book_load_local_address_book):
- Kill this. Nothing should ever explicitly load the local
- addressbook.
- (e_book_use_default_book): Replaces e_book_use_local_address_book,
- using the default book instead.
- (e_book_default_book_open): Fall back to local contact folder on
- E_BOOK_STATUS_NO_SUCH_BOOK too.
- (e_book_query_address_default): Use default book, not local.
-
- * gui/component/e-address-widget.c (query_idle_fn): Use the
- default book, not the local book.
-
- * gui/component/select-names/e-select-names-popup.c
- (edit_contact_info_cb): Use the default book, not the local book.
-
- * backend/ebook/e-destination.c (e_destination_cardify): Use the
- default book, not the local book.
- (e_destination_touch): Query the default book, not the local book.
-
- * backend/ebook/e-card-compare.c (e_card_locate_match,
- e_card_locate_match_full): Use the default book, not the local
- book.
-
-2002-08-08 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-summary.c (pas_backend_summary_init):
- initialize summary->upgraded to quiet valgrind.
-
-2002-08-06 Dan Winship <danw@ximian.com>
-
- * backend/ebook/test-client.c (TEST_VCARD): Use "\r" rather than
- including literal CRs in the string, which confuses gcc on OS X.
-
- * backend/ebook/test-card.c (TEST_VCARD): Likewise.
-
-2002-08-01 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #25958 ]
- * gui/component/addressbook.c (alphabet_state_changed): use
- FULL_NAME in the case where we're untoggling a letter, and... well
- use FULL_NAME in the other case too - we should never pop up the
- advanced dialog.
-
-2002-08-01 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names.h (struct
- _ESelectNames): no more search_entry.
-
- * gui/component/select-names/e-select-names.c (update_query): no
- more search_entry, search_entry => select_entry, and add file_as
- to the query since some entries don't have names (like the Ximian,
- Inc. default card.)
- (e_select_names_init): no more search_entry, and add an "activate"
- handler on select_entry that updates the query.
-
-2002-08-01 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names.h (struct
- _ESelectNames): remove folders and folders_by_uri, and the 2
- listeners.
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_destroy): remove the hash_table_destroys of
- folders and folders_by_uri, since they no longer exist. same for
- other_contacts_listener and local_listener.
-
-2002-08-01 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-component.c (create_component): Use
- "contact-list-16.png" for the "New Contact List" item.
-
-2002-07-31 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-component.c (create_component): Change
- the order so that "New Contact" is first and "New Contact List" is
- next.
-
-2002-07-31 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-component.c (add_creatable_item): Pass
- "contacts" as the @folder_type to
- evolution_shell_component_add_user_creatable_item().
-
-2002-07-31 Chris Toshok <toshok@ximian.com>
-
- [ roll in the following change from the 1.0 branch.]
- * backend/pas/pas-backend-ldap.c:
- (prop_info): change the CALURI and FBURL ecard attributes to map to the
- RFC 2739 specified attributes.
- (check_schema_support): check to see if calEntry is supported.
- (add_objectclass_mod): insert calEntry if it's supported.
- * backend/pas/evolutionperson.schema: deprecate freeBusyURI
- and calendarURI.
-
-2002-07-31 Ettore Perazzoli <ettore@ximian.com>
-
- [Patch by Jacob Berkman <jacob@ximian.com>, fixes #25968]
-
- * backend/ebook/e-book.c (activate_factories_for_uri): Don't
- double free protocol and query.
-
-2002-07-27 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-summary.c (save_string): don't save
- empty strings.
- (pas_backend_summary_save): print out the errno when we fail.
-
-2002-07-26 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook.c: Don't set up the ContactNew and
- ContactNewList verbs.
- (update_command_state): Don't set the sensitivity of
- /commands/ContactNew and /commands/ContactNewList anymore.
- (new_contact_cb): Removed.
- (new_contact_list_cb): Removed.
-
-2002-07-24 Peter Williams <peterw@ximian.com>
-
- * conduit/Makefile.am (libeaddress_conduit_la_LIBADD): Change
- libversit.la -> libversit.a for danw's changes.
-
-2002-07-24 Dan Winship <danw@ximian.com>
-
- * conduit/Makefile.am (libeaddress_conduit_la_LIBADD):
- s/libversit_lt/libversit/
-
-2002-07-22 Dan Winship <danw@ximian.com>
-
- * backend/pas/Makefile.am: Split pas-backend-file and
- pas-backend-ldap out of libpas and build them as separate (noinst)
- libraries libpasfile.a and libpasldap.a. This gets the db3 and
- LDAP dependencies out of libpas, and people trying to create an
- addressbook backend shouldn't be calling functions from the
- existing backends anyway so there's no reason to install them.
-
-2002-07-16 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/select-names.glade: remove the option
- menu and browse button, and add a custom widget placeholder for
- the folder-selector.
-
- * gui/component/select-names/e-select-names.c
- (addressbook_model_set_uri): move the "append /addressbook.db"
- stuff here.
- (e_addressbook_create_ebook_table): remove the code setting
- initial uri from here.
- (e_select_names_folder_free): gone.
- (e_select_names_option_activated): gone.
- (add_menu_item): gone.
- (update_option_menu): gone.
- (new_folder): gone.
- (removed_folder): gone.
- (folder_browse): gone.
- (hookup_listner): gone.
- (add_additional_select_names_uris): gone.
- (e_select_names_hookup_listners): gone.
- (e_addressbook_create_folder_selector): new function, create the
- folder selector button.
- (folder_selected): new function, callback for the folder selector.
- just calls addresbook_model_set_uri.
- (e_select_names_init): get the folder selector and initialize it
- to show /local/Contacts. also, set the model's uri here to the
- same folder. nuke the code involving the old option menu and
- browse button.
-
-2002-07-08 Peter Williams <peterw@ximian.com>
-
- * backend/ebook/Makefile.am: Install libebook-static.la.
- Also change --all-static to -all-static, which is the right flag.
-
- * backend/pas/Makefile.am: Install the PAS headers in
- $(includedir)/evolution/pas. Install libpas.a
-
-2002-07-08 Peter Williams <peterw@ximian.com>
-
- * gui/component/select-names/Makefile.am (idl_DATA): Install the
- SelectNames IDL and ancillary changes.
-
-2002-07-12 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-summary.c (free_summary_item): free the
- full_name (as well as given_name. oops.)
- (pas_backend_summary_new): new summaries are version 3.0 now.
- (pas_backend_summary_load_item): all loaded summaries should be
- 3.0+, as we fail to load versions lower than that.
- (pas_backend_summary_load_header): if the summary isn't version
- 3.0 fail out, as we need to rebuild the entire file to cache the
- full_name fields.
- (pas_backend_summary_save_item): save out the full_name.
- (pas_backend_summary_add_card): put the item's full_name in the
- card.
-
-2002-07-12 Dan Winship <danw@ximian.com>
-
- * gui/component/select-names/e-select-names-bonobo.c
- (entry_get_property_fn): Make the
- ENTRY_PROPERTY_ID_SIMPLE_CARD_LIST case not crash, although
- there's still something wrong.
-
-2002-07-10 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_start_query): e_book_get_book_view =>
- e_book_get_completion_view, so the backends have the option of
- using a pregenerated summary.
-
-2002-07-10 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-summary.c (clear_items): actually remove
- the items from the pointer array too, so an error while loading
- doesn't leave the memory summary corrupted.
- (pas_backend_summary_load_header): bleah, load the num_items and
- summary_mtime in the right order :) Also, set upgraded to TRUE if
- we loaded a v1.0 summary.
- (pas_backend_summary_open): make this return a gboolean, return
- TRUE if the summary is already open (priv->fp != NULL). return
- FALSE in error conditions.
- (pas_backend_summary_load): if summary_open returns FALSE, return
- FALSE, also set the dirty flag to FALSE after we load, and if the
- summary was upgraded write it out.
- (pas_backend_summary_save): update the in memory mtime to that of
- the file when we save.
- (summary_flush_func): if we're not dirty, do nothing and return.
- (pas_backend_summary_is_up_to_date): make sure we've opened the
- summary.
- (pas_backend_summary_get_summary_vcard): fix compiler warning.
-
-2002-07-10 Peter Williams <peterw@ximian.com>
-
- * backend/ebook/e-book-view-listener.h: Oops, missed this one.
-
- * backend/ebook/Makefile.am (libebookinclude_HEADERS): Also
- put addressbook.h here because several headers reference it.
-
-2002-07-08 Peter Williams <peterw@ximian.com>
-
- * backend/ebook/e-book.h: Normalize includes to <ebook/foo.h>, so
- that the installed headers will work sanely.
-
- * backend/ebook/e-card-cursor.h:
- * backend/ebook/e-book-view.h:
- * backend/ebook/e-card-simple.h:
- * backend/ebook/e-card.h:
- * backend/ebook/e-destination.h: Same.
-
- * printing/Makefile.am (INCLUDES): add -Iaddressbook/backend
- to access the ebook headers. Also the builddir version to get
- the generated addressbook.h
-
- * conduit/Makefile.am (INCLUDES): Same.
-
- * gui/widgets/Makefile.am (INCLUDES): Same builddir fix.
-
- * gui/merging/e-card-merging.c: Fix an ebook #include.
-
- * gui/merging/Makefile.am (INCLUDES): Same idea.
-
- * gui/contact-list-editor/Makefile.am (INCLUDES): Same.
-
- * gui/contact-editor/Makefile.am (INCLUDES): Same builddir
- change.
-
-2002-07-10 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-storage.c (load_source_data): Pass
- zero as the @sorting_priority to evolution_storage_new_folder().
- (addressbook_storage_add_source): Likewise.
-
-2002-07-10 Chris Toshok <toshok@ximian.com>
-
- * backend/idl/addressbook.idl: add Book.getCompletionView.
-
- * backend/ebook/e-book.c (e_book_get_completion_view): new
- function, basically c&p of e_book_get_book_view, but call
- getCompletionView.
-
- * backend/ebook/e-book.h: add prototype for
- e_book_get_completion_view.
-
- * backend/pas/pas-backend-ldap.c
- (pas_backend_ldap_process_client_requests): add a
- GetCompletionView case here that just calls the same code as
- GetBookView (since we don't build summaries for the ldap backend.)
-
- * backend/pas/pas-backend-file.c (do_summary_query): add
- @completion_search. If it's TRUE, just create the vcards from the
- summary using pas_backend_summary_get_summary_vcard instead of
- looking them up from the db.
- (pas_backend_file_search): add @completion_search and pass it on
- to do_summary_query.
- (pas_backend_file_process_get_book_view): pass FALSE to
- pas_backend_file_search.
- (pas_backend_file_process_get_completion_view): new function,
- basically c&p pas_backend_file_process_get_book_view, but pass
- TRUE to pas_backend_file_search.
- (pas_backend_file_process_client_requests): add a case for
- GetCompletionView.
- (pas_backend_file_load_uri): track the change to the summary api -
- create the summary filename
-
- * backend/pas/pas-book.c (pas_book_queue_get_completion_view): new
- function, queue a GetCompletionView request to our queue.
- (impl_GNOME_Evolution_Addressbook_Book_getCompletionView): new
- function, call pas_book_queue_get_completion_view.
- (pas_book_respond_get_completion_view): new function, just call
- notifyViewRequested.
- (pas_book_free_request): add a case for GetCompletionView.
- (pas_book_get_epv): fill in epv->getCompletionView.
-
- * backend/pas/pas-book.h: add a GetCompletionView PASOperation,
- and a new structure (PASGetCompletionViewRequest). Also, add
- get_completion_view to PASRequest.
-
- * backend/pas/pas-backend-summary.c (clear_items): remove the
- items from the hash table.
- (pas_backend_summary_new): db_path -> summary_path.
- (pas_backend_summary_destroy): db_.path -> summary_path, and
- destroy the hash table.
- (pas_backend_summary_init): db_path = summary_path, and initialize
- the id_to_item hashtable.
- (pas_backend_summary_load_header): handle the upgrading from
- version 1.0 to version 2.0 (the addition of an mtime field in the
- header)
- (pas_backend_summary_load_item): version 1.0 and 2.0 have the same
- format for items.
- (pas_backend_summary_open): new function. open the summary so we
- can load the header (and get the mtime).
- (pas_backend_summary_load): rework this a bit since the header has
- already been loaded, and also add the items to the hashtable.
- (pas_backend_summary_add_card): add the new item to the hashtable.
- (pas_backend_summary_remove_card): remove the item from the hash
- table.
- (pas_backend_summary_is_up_to_date): new function, chekc @t
- against the summary's mtime.
- (pas_backend_summary_get_summary_vcard): create a vcard from the
- fields we have in the summary.
-
- * backend/pas/pas-backend-summary.h: add prorotypes for
- pas_backend_summary_is_up_to_date and
- pas_backend_summary_get_summary_vcard.
-
-2002-07-09 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-storage.c (load_source_data): Pass
- NULL @custom_icon_name to evolution_storage_new_folder().
- (addressbook_storage_add_source): Likewise. [Note we could be
- passing a nice custom here. ;-)]
-
-2002-07-02 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-component.c (add_creatable_item): New
- arg @tooltip; pass it to
- evolution_shell_component_add_user_creatable_item() [which now has
- a @tooltip arg].
-
-2002-06-29 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/Makefile.am (libpas_a_SOURCES): add
- pas-backend-summary.[ch].
-
- * backend/pas/pas-backend-file.c (string_to_dbt): move this to the
- top of the file so it can be used in..
- (build_summary): loop over the db, adding cards ot the summary.
- (do_summary_query): call pas_backend_summary_search and loop over
- the returned id's looking them up in the db.
- (pas_backend_file_search): call
- pas_backend_summary_is_summary_query, and either call
- do_summary_query if it's a query over just the set of attributes
- in the summary or use the old, slow method if not.
- (pas_backend_file_process_create_card): call
- pas_backend_summary_add_card.
- (pas_backend_file_process_remove_card): call
- pas_backend_summary_remove_card.
- (pas_backend_file_process_modify_card): call remove_card/add_card.
- (pas_backend_file_load_uri): try to load the summary file, and if
- it doesn't exist create it.
- (pas_backend_file_destroy): unref the summary.
-
- * backend/pas/pas-backend-summary.[ch]: new files, reading and
- writing (and querying) summaries.
-
-2002-06-27 Sean Atkinson <sean@cantab.net>
-
- * gui/component/addressbook-config.c (query_for_supported_bases):
- don't unref selection_model (otherwise 3 clicks of
- "Show Supported Bases" crashes if LDAP server isn't running).
-
-2002-06-25 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-component.c (create_component):
- reorder the adding of creatable items so the default is a new
- contact, not a new contact list.
-
-2002-06-21 Sean Atkinson <sean@cantab.net>
-
- * gui/component/addressbook-config.c (addressbook_edit_server_dialog):
- remove source argument (get it from the dialog).
- (edit_source_clicked): same.
- (sources_table_double_click): added to edit server by double-clicking.
- (ldap_dialog_new): use sources_table_double_click.
-
-2002-06-17 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (e_addressbook_view_save_as):
- pass NULL to e_contact_list_save_as. modality sucks. fixes
- broken build.
- (save_as): same.
-
-2002-06-15 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #26130 ]
- * gui/contact-editor/e-contact-editor.c (file_save_as_cb): pass
- ce->app as parent_window.
-
- * gui/contact-list-editor/e-contact-list-editor.c
- (file_save_as_cb): same .
-
- * gui/contact-editor/e-contact-save-as.c (e_contact_list_save_as):
- if a parent_window is specified, the file selector should be
- modal/transient for that window.
- (e_contact_save_as): same.
-
- * gui/contact-editor/e-contact-save-as.h: track prototype changes
- (addition of GtkWindow *parent_window to both calls.)
-
-2002-06-15 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_connect): use
- ldap_unbind_ext.
- (create_card_handler): don't leak the new vcard.
- (pas_backend_ldap_process_authenticate_user): don't leak the dn.
-
-2002-06-14 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-file.c (pas_backend_file_search): up the
- max threshold to 3000 cards from 1000 cards.. seems to improve
- performance a bit. also remove the g_list_reverse since it
- doesn't matter what order the cards arrive to the gui.
- (pas_backend_file_changes): plug memory leaks.
-
-2002-06-14 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card-compare.c (compare_email_addresses): Made
- "" compare as not equal to "" for addresses.
- (use_common_book_cb): Don't bother checking for nickname here
- since we don't use it as a match later. Don't add "" as an
- address to the list of query parts.
-
-2002-06-13 Christopher James Lahey <clahey@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c (enable_writable_fields):
- Don't enable fields if the editor isn't editable and the
- widget_field_mappings lists this field as being desensitize for
- read only.
-
-2002-06-11 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #17332 ]
- * backend/ebook/e-book.c (e_book_get_static_capabilities): we
- shouldn't ever return NULL here. in error cases we need to return
- g_strdup("");
-
-2002-06-11 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-minicard-view.c (e_minicard_view_event): Made
- double clicking on read only folders not do anything.
-
-2002-06-10 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-book-util.c (e_book_expand_uri): Made expand_uri
- a bit more robust and readable.
- (e_book_get_default_book_uri): Made e_book_get_default_book_uri
- use e_book_expand_uri if using the bonobo_config value.
-
- * gui/component/e-address-popup.c (start_query): Handle the
- failure state here by acting as if there are no matches.
-
-2002-06-05 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-minicard.c (e_minicard_event): Call
- e_minicard_selected in the GDK_BUTTON_RELEASE case here.
- (e_minicard_drag_begin): Set E_REFLOW (parent)->maybe_in_drag =
- FALSE if it's an EReflow.
-
-2002-06-04 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_book_ready): Commented out this unused
- function.
-
- * gui/component/select-names/e-select-names-manager.c
- (open_book_cb): Ref if we're keeping the book. Don't unref if
- we're not keeping the book.
- (clean_cb): Commented out this unused function.
-
-2002-06-04 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (init_collection): Set the
- title of our GalVIewCollection.
-
-2002-05-29 Anna Marie Dirks <anna@ximian.com>
-
- * gui/component/select-names/select-names.glade: Changed some spacing
- and expanding behavior to make this dialog behave more like I intended
- to.
-
-2002-05-24 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-config.c (CONFIG_CONTROL_FACTORY_ID):
- put this back in, accidentally got snipped with the hacking going
- on in here.
-
-2002-05-24 Chris Toshok <toshok@ximian.com>
-
- [ part of #25047 ]
- * gui/component/addressbook-config.c: remove the autocompletion
- config control from here, as it lives in the shell now.
-
- * gui/component/GNOME_Evolution_Addressbook.oaf.in: same.
-
-2002-05-24 Chris Toshok <toshok@ximian.com>
-
- [ #24189 ]
- * gui/component/select-names/e-select-names-manager.c
- (focus_out_cb): ifdef out the body of this because it only works
- with a single completion book. not sure what to do here, but it
- doesn't impact most usage scenarios.
- (completion_popup_cb): same.
- (e_select_names_manager_entry_new): add the books that have been
- loaded successfully by the time this entry is created.
- (open_book_cb): add the opened book to the entries that have
- already been created, and store it in our list so that entries
- that are created in the future can catch up.
- (read_completion_books_from_db): slurp in the folder list from the
- config db and load all the uris.
- (uris_listener): listener function - when there's a change it
- calls _clear_books on all the created entries, and clears our
- list. It then re-reads the books from the db.
- (e_select_names_manager_new): create our bonobo listener and call
- read_completion_books_from_db.
- (e_select_names_manager_init): init completion_books.
- (e_select_names_manager_destroy): free our list of
- completion_books.
-
- * gui/component/select-names/e-select-names-manager.h: switch from
- a single EBook to a GList of completion_books here.
-
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_add_book): deal with the case where
- there's an active query (by effectively restarting it.) This is
- quite a contrived edge case.
- (e_select_names_completion_clear_books): stop the current query
- and clear our list of books.
- (e_select_names_completion_new): track change to prototype, and
- axe the majority of this method since an EBook* isn't passed
- anymore.
- (e_select_names_completion_clear_book_data): split this code out
- from the destroy method so it can be called from _clear_books.
-
- * gui/component/select-names/e-select-names-completion.h: the
- constructor no longer takes an EBook -- pass in as many as you
- want using _add_book. Also, add prototype for _clear_books.
-
- * gui/component/addressbook.c (load_uri_cb): when
- storing/retrieving passwords, use the cleaned (without params)
- version of the uri, so changing things like download limit don't
- cause the user to be prompted for a password again.
-
- * gui/component/addressbook-component.c
- (ensure_completion_uris_exist): new function - probably doesn't
- belong in this file. Make sure the basic local Contacts folder
- exists in the completion uris.
- (addressbook_component_factory_init): call
- ensure_completion_uris_exist.
-
- * backend/ebook/e-book-util.h: add prototype for
- e_book_get_default_book_uri.
-
- * backend/ebook/e-book-util.c (e_book_get_default_book_uri): new
- function, just return the default contacts uri.
- (e_book_load_default_book): change
- to use e_book_get_default_book_uri.
-
-2002-05-23 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-config.c (addressbook_root_dse_query):
- fix parameter/local variable overloading.
-
-2002-05-21 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook.c (load_uri_cb): Don't try to invoke
- e_book_get_uri() on NULL. Fixes #25069.
-
-2002-05-17 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-util.c (e_addressbook_error_dialog):
- make sure we map status -> string correctly (add missing strings).
-
- * backend/ebook/e-book-types.h (EBookStatus): add the missing
- AUTHENTICATION_REQUIRED status code, to map to the idl response.
-
- * backend/ebook/e-book-listener.c
- (e_book_listener_convert_status): make sure we map all idl status
- codes to EBookStatus statuses.
-
-2002-05-20 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-storage.c (load_source_data): Pass
- FALSE for @sync_offline to evolution_storage_new_folder().
- (addressbook_storage_add_source): Pass FALSE for @sync_offline to
- evolution_storage_new_folder().
-
-2002-05-16 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-component.c (request_quit): New, quit
- handler for the EvolutionShellComponent.
- (add_creatable_item): Set it up.
-
- * gui/contact-editor/e-contact-list-editor.c
- (e_contact_list_editor_request_close_all): New.
- (e_contact_list_editor_new): Put the contact editor in a static
- list and gtk_object_weakref() it.
- (contact_list_editor_destroy_notify): New, GtkDestroyNotify
- function for the contact editors.
-
- * gui/contact-editor/e-contact-editor.c
- (e_contact_editor_request_close_all): New.
- (e_contact_editor_new): Put the contact editor in a static list
- and gtk_object_weakref() it.
- (contact_editor_destroy_notify): New, GtkDestroyNotify function
- for the contact editors.
-
-2002-05-15 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-component.c (create_component): Pass
- NULL as @request_quit_fn.
-
-2002-05-13 Christopher James Lahey <clahey@ximian.com>
-
- * backend/idl/addressbook.idl: Removed an incorrect comment here.
-
-2002-05-13 Christopher James Lahey <clahey@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c (enable_writable_fields):
- Enable the dropdown widgets even if the contact is not editable so
- that you can view any email address, phone number, or postal
- address on read only contacts.
-
-2002-05-10 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/Evolution-Addressbook-SelectNames.idl:
- Added SimpleCard interface.
-
- * gui/component/select-names/Makefile.am: Added
- e-simple-card-bonobo.c and e-simple-card-bonobo.h.
-
- * gui/component/select-names/e-select-names-bonobo.c
- (entry_get_property_fn): Added SIMPLE_CARD_LIST arg.
-
- * gui/component/select-names/e-simple-card-bonobo.c,
- gui/component/select-names/e-simple-card-bonobo.h: New class to
- represent an ECardSimple across Bonobo.
-
-2002-05-09 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names-bonobo.c
- (entry_get_property_fn): Added "first_email" property.
-
-2002-05-09 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-storage.c
- (addressbook_get_other_contact_storage): Pass %FALSE as
- @has_shared_folders to evolution_storage_new().
-
-2002-05-08 JP Rosevear <jpr@ximian.com>
-
- * conduit/Makefile.am: link against the libtool version of
- libversit
-
-2002-05-07 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-config.c
- (addressbook_config_control_new): oops, add the NULL back at the
- end of possible_types.
-
-2002-05-07 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-config.c (addressbook_ldap_init):
- bleah, need to pass the GtkWindow here so we can pop up the a
- modal parented dialog (gtk modal dialogs suck?).
- (addressbook_ldap_auth): same.
- (addressbook_root_dse_query): same.
- (do_ldap_root_dse_query): same.
- (addressbook_config_control_new): add "ldap-contacts" to the list
- of possible types.
-
-2002-05-07 Dan Winship <danw@ximian.com>
-
- * gui/component/addressbook-storage.c (create_ldap_folder):
- s/ldap_config/addressbook_config/
-
-2002-05-03 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book.c (activate_factories_for_uri): finally
- remove the #if 0's and use the oaf query stuff to get backends
- that handle specific protocols.
-
-2002-05-03 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/addressbook-config.c
- (addressbook_folder_list_changed_callback): Call
- evolution_config_control_changed when the EFolderList changes.
-
-2002-05-03 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/GNOME_Evolution_Addressbook.oaf.in: Updated this
- to have the ConfigControlFactory have an addressbookwide generic
- name and added OAFIID:GNOME_Evolution_Addressbook_ConfigControl.
-
- * gui/component/Makefile.am (evolution_addressbook_SOURCES),
- gui/component/addressbook-component.c,
- gui/component/addressbook-storage.c, gui/component/addressbook.c:
- Replaced ldap-config.c and ldap-config.h with addressbook-config.c
- andaddressbook-config.h.
-
- * gui/component/addressbook-config.c,
- gui/component/addressbook-config.h: Based on ldap-config.c and
- ldap-config.h. Added a folder list control. Made this a multi
- factory.
-
- * gui/component/ldap-config.c, gui/component/ldap-config.h:
- Replaced these with addressbook-config.c and addressbook-config.h.
-
-2002-05-02 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names.c (selection_change):
- Desensitize the to, cc, and bcc buttons if there's no selection
- here. Fixes Ximian bug #21482.
-
-2002-05-01 Christopher James Lahey <clahey@ximian.com>
-
- * gui/contact-list-editor/e-contact-list-editor.c (verbs): Changed
- some of these to bind to the ContactListEditor verbs since they're
- marked as that in the ui file. Fixes Ximian bug #13034.
-
-2002-04-30 JP Rosevear <jpr@ximian.com>
-
- * gui/component/Makefile.am (EXTRA_DIST): fix
-
-2002-04-30 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-model.c,
- gui/widgets/e-addressbook-model.h
- (e_addressbook_model_peek_card): Added this function so that there
- would be less duplication of cards during run time when
- duplication is unnecessary.
-
- * gui/widgets/e-addressbook-view.c: Cleaned up get_card_list and a
- number of associated functions to be much more uniform and
- simpler.
- (get_has_email_address): Don't show the "Send Message to Contact"
- menu item if there are no email addresses in the listed contacts.
- Fixes bug #1298.
-
-2002-04-30 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card.c (e_card_list_send): Changed this to set a
- subject when sending a contact. This makes the signature be set
- properly also.
-
-2002-04-26 Jeffrey Stedfast <fejj@ximian.com>
-
- * printing/Makefile.am: Don't link to libibex anymore.
-
- * conduit/Makefile.am: Same.
-
- * backend/ebook/Makefile.am: Again here.
-
- * gui/component/Makefile.am: And finally here.
-
-2002-04-26 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_child_free): Unref the text_model here instead of
- the model, since the model never gets set. Removed the model
- field since it's no longer used.
-
-2002-04-24 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/ldap-config.c: Updated this for the new
- e_table_memory_store_insert function prototype.
-
-2002-04-24 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names.c,
- gui/component/select-names/e-select-names.h,
- gui/component/select-names/select-names.glade (folder_browse):
- Added a "Browse..." button to switch to a different addressbook
- folder.
-
- * gui/widgets/e-addressbook-util.c (e_addressbook_transfer_cards):
- Moved extern EvolutionShellClient out of this function so that
- it'd be more readable.
-
-2002-04-23 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names.c,
- gui/component/select-names/e-select-names.h: Coded handling of the
- select_entry to search within the displayed contacts.
-
- * gui/component/select-names/select-names.glade: Updated this
- dialog to have an entry-select instead of an entry-find.
-
-2002-04-23 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/select-names.glade: Updated this
- dialog to match the redesign.
-
-2002-04-23 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (do_popup_menu): Make unused
- menu items disappear instead of graying out.
-
-2002-04-23 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-reflow-adapter.c,
- gui/widgets/e-addressbook-reflow-adapter.h: Removed
- e_addressbook_reflow_adapter_right_click and
- e_addressbook_reflow_adapter_base_right_click.
-
- * gui/widgets/e-addressbook-view.c: Handle right click menu for
- both types of view. Merged right click on white space with right
- click on main area. General clean up.
-
- * gui/widgets/e-minicard-view-widget.c,
- gui/widgets/e-minicard-view-widget.h: Removed a couple unnecessary
- functions. Added e_minicard_view_widget_get_view. Added
- right_click signal.
-
- * gui/widgets/e-minicard-view.c, gui/widgets/e-minicard-view.h:
- Added the right_click signal and the e_minicard_view_get_card_list
- function.
-
-2002-04-22 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names.h: Removed an unused
- variable here.
-
- * gui/widgets/e-addressbook-view.c (table_right_click,
- table_white_space_event): Added a current view submenu to the
- popup menu here.
-
-2002-04-22 Jeffrey Stedfast <fejj@ximian.com>
-
- * gui/widgets/e-minicard-view.c (e_minicard_view_drag_begin):
- Allow GDK_ACTION_COPY also, since the composer for example does
- not accept MOVE's. Completes bug #8448.
-
-2002-04-18 Chris Toshok <toshok@ximian.com>
-
- * gui/component/ldap-config.glade: change order of scope option
- menu to match how it's stored.
-
-2002-04-18 Chris Toshok <toshok@ximian.com>
-
- * gui/component/GNOME_Evolution_Addressbook.oaf.in: change ldap
- config control text so it fits in the config dialog.
-
- * gui/component/ldap-config.c: #ifdef lots of stuff HAVE_LDAP so
- it'll build/run in either case.
- (addressbook_source_dialog_destroy): rename
- addressbook_add_server_druid_destroy to this, and free lots more
- stuff.
- (addressbook_add_server_druid):
- addressbook_add_server_druid_destroy ->
- addressbook_source_dialog_destroy.
- (do_schema_query): add 3 second timeout to schema query.
- (addressbook_edit_server_dialog): hook up destroy signal.
- (config_control_new): if HAVE_LDAP isn't defined, put up a label
- saying so.
-
-2002-04-18 Chris Toshok <toshok@ximian.com>
-
- * gui/component/Makefile.am (INCLUDES): add LDAP_CFLAGS to INCLUDES
-
-2002-04-18 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c (book_open_cb): no more
- source->type.
-
-2002-04-18 Chris Toshok <toshok@ximian.com>
-
- * gui/component/ldap-config.c (addressbook_dialog_get_source):
- fill in source->ssl.
- (addressbook_source_dialog_set_source): set up auth/scope/ssl
- option menus properly.
-
- * gui/component/addressbook-storage.c
- (addressbook_storage_init_source_uri): always include the
- limit/ssl in the uri so we don't need to rely on defaults
- everywhere.
- (ldap_source_foreach): store the ssl option.
-
- * gui/component/addressbook-storage.h: reorder SSLType to match
- the UI.
-
- * backend/pas/pas-backend-ldap.c: (struct _PASBackendLDAPPrivate)
- add field for ldap_timeout.
- (pas_backend_ldap_connect): reorder things a bit - we need to
- start tls before the root dse query, if we can.
- (pas_backend_ldap_load_uri): track the way ssl parameters are
- given in the uri, and parse out the timeout.
-
- * gui/component/ldap-config.c (port_changed_func): use the
- symbolic SSL name instead of an integer constant.
-
-2002-04-18 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (get_ldap_library_info): fix
- memory leaks.
-
- * gui/component/GNOME_Evolution_Addressbook.oaf.in: remove the
- Addressbook_ConfigControl stuff to LDAP_ConfigControl.
-
- * gui/component/Makefile.am (evolution_addressbook_SOURCES):
- remove addressbook-config.* and add ldap-config.*
- (glade_DATA): same.
- (evolution_addressbook_LDADD): add LDAP_LIBS.
-
- * gui/component/addressbook-component.c (owner_set_cb):
- addressbook_config_register_factory =>
- ldap_config_register_factory.
-
- * gui/component/addressbook.c (book_open_cb): remove source->type
- check - they're always LDAP.
- (load_uri_cb): same.
-
- * gui/component/addressbook-storage.c (ldap_unparse_ssl): new
- function.
- (ldap_parse_ssl): new function.
- (addressbook_storage_init_source_uri): use a more flexible scheme
- to build up the uri's, and add in the ssl parameter.
- (load_source_data): fill in source->ssl, and remove source->type
- assignment.
- (addressbook_source_copy): copy source->ssl, and remove
- source->type copy.
- (create_ldap_folder): addressbook_create_new_source =>
- ldap_config_create_new_source.
-
- * gui/component/addressbook-storage.h: remove
- AddressbookSourceType (it was always LDAP), and add
- AddressbookLDAPSSLType.
-
-2002-04-18 Dan Winship <danw@ximian.com>
-
- * backend/ebook/e-book-util.c (e_book_load_default_book): Append
- /addressbook.db to the end of the default URI if it starts with
- file:
-
- * backend/ebook/e-book.c (e_book_load_uri_step): Fix this to not
- loop forever if you have more than one backend.
-
-2002-04-17 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_create_categories): Changed this to use
- ECategoriesMasterListOptionMenu.
-
- * gui/component/select-names/e-select-names.c
- (section_right_click_cb),
- gui/widgets/e-addressbook-reflow-adapter.c,
- gui/widgets/e-addressbook-view.c: Updated these to match the new
- EPopupMenu.
-
-2002-04-11 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/addressbook-component.c: Include
- addressbook-config.h here as this file uses it.
-
- * gui/component/select-names/e-select-names.c (SPEC, SPEC2): Made
- this dialog searchable by typing in the ETable.
-
- * gui/widgets/e-addressbook-model.c: Include e-addressbook-util.h
- here.
-
- * gui/widgets/e-addressbook-reflow-adapter.c
- (e_addressbook_reflow_adapter_right_click),
- gui/widgets/e-addressbook-view.c (table_right_click): Fixed a
- memory leak here by using "selection-done" signal.
-
- * gui/widgets/e-addressbook-reflow-adapter.c,
- gui/widgets/e-addressbook-reflow-adapter.h,
- gui/widgets/e-addressbook-view.c, gui/widgets/e-minicard-view.c:
- Added a right click menu for areas that aren't cards.
-
-2002-04-09 Dan Winship <danw@ximian.com>
-
- * backend/ebook/e-book-util.c (e_book_load_default_book): Update
- for new-and-improved consistent default folder uri.
-
- * gui/component/addressbook.c (addressbook_load_default_book): Use
- e_book_load_default_book rather than duplicating most of its logic
- here.
- (load_uri_cb): Modify to work as a callback for
- addressbook_load_default_book as well as addressbook_load_uri.
-
-2002-04-08 Dan Winship <danw@ximian.com>
-
- * gui/component/addressbook-component.c (create_view): Add
- view_info arg, but don't do anything with it.
-
-2002-04-06 JP Rosevear <jpr@ximian.com>
-
- * gui/component/GNOME_Evolution_Addressbook.oaf.in: add
- config_item:type
-
-2002-04-04 JP Rosevear <jpr@ximian.com>
-
- * conduit/Makefile.am: link to the static libversit
-
-2002-04-04 Dan Winship <danw@ximian.com>
-
- * gui/widgets/e-addressbook-util.c (e_addressbook_transfer_cards):
- Update for evolution_shell_client_user_select_folder API change.
-
-2002-04-04 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook.c: Remove AddressbookConfig,
- ContactNew, ContactNewList EPixmap entries.
-
- * gui/component/addressbook-factory.c (main): Print out a
- debugging message just before the main loop starts, for debugging
- purposes.
-
-2002-04-02 Dan Winship <danw@ximian.com>
-
- * backend/ebook/e-card-simple.h: Fix spelling of
- E_CARD_SIMPLE_PHONE_ID_TTYTDD and E_CARD_SIMPLE_FIELD_PHONE_TTYTDD
- (they previously ended with "TTD" instead of "TDD")
-
- * backend/ebook/e-card-simple.c: Update for spelling fix.
-
- * backend/pas/pas-backend-ldap.c: Likewise
-
-2002-04-01 Dan Winship <danw@ximian.com>
-
- * gui/component/select-names/e-select-names-text-model.c:
- parent_class should be static. (From Max Horn <max@quendi.de>)
-
-2002-03-29 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/GNOME_Evolution_Addressbook.oaf.in: Add priority
- for the config page. Renamed to "Directory Servers".
-
-2002-03-27 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_process_create_card): don't free req->vcard.
- it's freed in pas_book_free_request.
- (pas_backend_file_process_remove_card): don't free req->id for the
- same reason.
- (pas_backend_file_process_modify_card): don't free req->vcard for
- the same reason.
- (pas_backend_file_process_get_changes): don't free req->change_id
- or release_unref the listener for the same reason.
-
-2002-03-27 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (check_schema_support): make sure
- to call ldap_value_free (values);, and ldap_msgfree (resp).
- (get_ldap_library_info): don't ask me why, but it appears we have
- to free each extension char*.
- (query_ldap_root_dse): make sure to free values in the
- subschemaSubentry code before overwriting it, and call
- ldap_msgfree(resp) when we're all done.
- (build_card_from_entry): don't leak the DN, ldap attributes, or
- the berval the ldap_*_attribute calls use to step through the
- attributes. the docs say this berval is freed when
- ldap_next_attribute returns NULL, but if we don't free it it leaks
- a substantial amount of memory.
- (pas_backend_ldap_search): make sure to only allocate *op once,
- and fix the g_warning since op isn't valid in its scope anymore.
-
-2002-03-19 Dan Winship <danw@ximian.com>
-
- * backend/ebook/Makefile.am: Update for libversit change: Use .a
- rather than .la now.
-
- * printing/Makefile.am: Likewise
-
- * gui/component/Makefile.am: Likewise
-
-2002-03-18 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook.c (addressbook_menu_activated):
- Removed.
- (addressbook_factory_new_control): Don't connect anymore, as this
- signal has been removed from the ESearchBar.
- (addressbook_factory_new_control): No more custom menu items here.
-
-2002-03-15 Jeffrey Stedfast <fejj@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (table_right_click): Update to
- use new EPopupMenu API.
-
- * gui/widgets/e-addressbook-reflow-adapter.c
- (e_addressbook_reflow_adapter_right_click): Update to use new
- EPopupMenu API.
-
- * gui/component/select-names/e-select-names.c
- (section_right_click_cb): Update to match new EPopupMenu api.
-
-2002-03-15 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook.c: Remove the
- `addressbook_search_menu_items'.
- (addressbook_menu_activated): Removed.
- (addressbook_factory_new_control): Don't connect. No menu items.
-
-2002-03-15 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook.c (control_activate): Call
- `e_search_bar_set_ui_component()' to set the BonoboUIComponent for
- the search bar.
-
- * gui/component/GNOME_Evolution_Addressbook.oaf.in: Add an icon
- for the LDAP sources configuration control.
-
-2002-03-12 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook.c: Remove verb "AddressbookConfig".
- (config_cb): Removed.
-
- * gui/component/addressbook-config.c: Remove `dialog' member from
- `AddresbookDialog'. Instead, add a `config_control' member.
- (config_control_new): New.
- (addressbook_config): Removed.
- (addressbook_config_register_factory): New.
- (config_control_factory_fn): New, factory function for the
- ConfigControl page.
- (addressbook_source_edit_changed): Don't change the sensitivity of
- the dialog. Rather, invoke ::changed on the ConfigPage.
- (auth_checkbutton_changed): No need to manually change the
- sensitiviness of the buttons here either.
- (add_source_clicked): Likewise, just invoke
- evolution_config_control_changed().
- (edit_source_clicked): Likewise.
- (addressbook_dialog_close): Removed.
- (config_control_destroy_callback): New, callback for when the
- config control gets destroyed.
- (addressbook_dialog_apply): Removed.
- (config_control_apply_callback): New callback for
- EvolutionConfigControl::apply.
- (addressbook_dialog_ok): Removed.
- (addressbook_config_control_new): Set up ->config_control and
- connect the signals.
-
- * gui/component/addressbook-config.glade: Call the main hbox in
- the addressbook_sources dialog `addressbook_sources_main_hbox'.
-
- * gui/component/addressbook-component.c (owner_set_cb): Call
- `addresbook_config_register_factory'.
-
- * gui/component/GNOME_Evolution_Addressbook.oaf.in: Add items for
- OAFIID:GNOME_Evolution_Addresbook_ConfigControl and
- OAFIID:GNOME_Evolution_Addressbook_ConfigControlFactory.
-
-2002-03-11 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names.c (update_query):
- change contains x-evolution-any-field to beginswith on email,
- full_name, and nickname. faster, and more applicable to this
- dialog.
-
-2002-03-09 Chris Toshok <toshok@ximian.com>
-
- * backend/idl/addressbook.idl: add TLSNotAvailable to
- BookLister_CallStatus.
-
- * backend/ebook/e-book-types.h: add TLS_NOT_AVAILABLE to the EBookStatus enum.
-
- * backend/ebook/e-book-listener.c
- (e_book_listener_convert_status): add TLS_NOT_AVAILABLE to the
- switch.
-
- * backend/pas/pas-backend-ldap.c
- (pas_backend_ldap_get_static_capabilities): fix name.
- (pas_backend_ldap_class_init): fix name.
- (pas_backend_ldap_connect): change return type to CallStatus so we
- can return different errors from here. Also, do STARTTLS if the
- user has asked for it and the connection supports it, returning
- TLSNotAvailable (and close the connection) if they chose to
- require it.
- (pas_backend_ldap_load_uri): return pas_backend_ldap_connect.
- (func_beginswith): pull in change from evolution-1-0-branch to
- make full_name beginswith search both cn and sn.
-
-2002-03-09 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (jump_to_letter): since I've
- gone ahead and made the file backend (by way of
- pas-backend-card-sexp.c) use case insensitive searches for
- beginswith, there's no need to list upper and lower case here.
-
- * gui/component/addressbook.c (addressbook_search_option_items):
- reorder things to put "Any field contains" at the end, since it's
- the least efficient search. Also reorder the enum to the same
- ordering. Change "Name contains" to "Name begins with" and change
- "Email contains" to "Email is".
- (addressbook_search_activated): change FULL_NAME to beginswith,
- and change EMAIL to is to match the labels.
-
- * backend/pas/pas-backend-card-sexp.c (compare_name): new
- function, so we can compare both full and family names (so
- beginswith can operate on them both.)
- (endswith_helper): use e_utf8_strstrcase here, since all the
- backends backends use case insensitive searching.
- (func_endswith): same.
-
-2002-03-06 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-book.c (pas_book_queue_create_card): track
- union/struct change.
- (pas_book_queue_remove_card): same.
- (pas_book_queue_modify_card): same.
- (pas_book_queue_get_cursor): same.
- (pas_book_queue_get_vcard): same.
- (pas_book_queue_authenticate_user): same.
- (pas_book_queue_get_book_view): same.
- (pas_book_queue_get_changes): same.
- (pas_book_free_request): new function - free everything we need to
- for each type of request.
- (pas_book_destroy): call pas_book_free_request here instead of
- just freeing 3 elements of the old struct. yay plugging memleaks.
-
- * backend/pas/pas-book.h: make PASRequest a union and split out
- members into structs, so it's a little clearer which fields are
- used by which requests. Also, add prototype for
- pas_book_free_request so backends can just free everything at once
- (usually in their requests_queued signal func.)
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_process_create_card): track struct/union change.
- (pas_backend_file_process_remove_card): same.
- (pas_backend_file_process_modify_card): same.
- (pas_backend_file_build_cards_list): same.
- (pas_backend_file_process_get_vcard): same.
- (pas_backend_file_process_get_cursor): same.
- (pas_backend_file_process_get_book_view): same.
- (pas_backend_file_process_get_changes): same.
- (pas_backend_file_process_check_connection): same.
- (pas_backend_file_process_authenticate_user): same.
- (pas_backend_file_process_get_supported_fields): same.
- (pas_backend_file_process_client_requests): case the union to the
- specific struct and pass it to the process_* functions. also,
- call pas_book_free_request here, instead of relying on each of the
- functions to free their stuff.
-
-2002-03-07 Dan Winship <danw@ximian.com>
-
- * gui/component/addressbook-storage.c
- (addressbook_get_other_contact_storage): Update for
- evolution_storage_new() change.
-
-2002-03-05 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-minicard-view-widget.c
- (e_minicard_view_widget_realize): don't set "editable" here, as
- the way things work the backend isn't able to override a setting
- from the UI, so writable books never show up as writable.
-
-2002-03-04 Chris Toshok <toshok@ximian.com>
-
- [fixes bug #20871]
- * gui/component/select-names/select-names.glade: add the
- status-message label.
-
- * gui/component/select-names/e-select-names.h (struct
- _ESelectNames): add status_message field.
-
- * gui/component/select-names/e-select-names.c (status_message):
- new function, set the label's text from the message.
- (e_select_names_init): get the status-message label, and if it's
- valid, connect to the status_message signal of the
- EAddressbookModel.
-
-2002-02-28 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_search): don't
- ref the view here, since it keeps the view alive until the search
- is over, which we don't want. we want the view's death to cancel
- the search. This speeds up starting new searches after one is
- already active (since switching searches actually creates a new
- book view and destroys the old one.)
- (ldap_search_dtor): remove the matching unref here. The unref as
- it was was incorrect anyway, and caused a crash (we needed
- search_op->view, not op->view.)
-
-2002-02-27 Chris Toshok <toshok@ximian.com>
-
- [fixes bug #20690]
- * backend/pas/pas-backend-ldap.c (func_and): the data arg is not
- GList** anymore, it's PASBackendLDAPSExpData*, so use
- ldap_data->list instead of *list.
- (func_or): same.
- (func_not): same.
- (func_contains): same.
- (func_is): same.
- (func_endswith): same.
- (func_beginswith): same, but also special case the beginswith
- "fileAs" query type (the one used by the alphabet buttons on the
- right hand side, so we can deal with entries that don't have
- fileAs attributes, and return meaningful responses.)
- (pas_backend_ldap_build_query): initialize the
- PASBackendLDAPSExpData struct and pass that instead of &list.
- Also, take the PASBackendLDAP arg to add to the struct in case we
- need it at some point in the future.
- (ldap_search_handler): pass in the PASBackendLDAP.
-
-2002-02-26 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-file.c (pas_backend_file_search): move
- card_count++ inside the if that checks to see if a card matches
- (and adds the card to the list).
-
-2002-02-24 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c (addressbook_query_changed): only
- handle the ESB_ADVANCED case here now. the actual query work is
- done in addressbook_search_activated.
- (addressbook_search_activated): split out all the searching
- functionality here.
- (addressbook_factory_new_control): hook up "search_activated" to
- addressbook_search_activated.
-
-2002-02-24 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-config.c
- (addressbook_source_dialog_set_source): make the right auth page
- start up open.
-
- * gui/component/addressbook-storage.c (addressbook_source_free):
- free the binddn.
- (addressbook_source_copy): copy the binddn;
-
-2002-02-22 Chris Toshok <toshok@ximian.com>
-
- [ Fixes bugs 20740, 16680, and god knows what else :) ]
- * gui/widgets/e-addressbook-model.c (create_card): double the
- allocated size every time we need more space instead of using a
- fixed size increment. this helps huge queries. Also, remove the
- gtk_object_get of "file_as", as it was dead code.
- (book_view_loaded): handle errors here (by popping up a dialog).
-
- * backend/pas/pas-backend-ldap.c (view_destroy): search_idle ->
- search_timeout.
- (build_card_from_entry): comment out some spew, and unref ecard
- when we're done to plug a memory leak.
- (send_pending_adds): send along to the client all the cards we've
- been saving up.
- (poll_ldap): use a timeout for ldap_result to keep the backend
- from blocking (and it turns out keep the frontend from hanging
- waiting on a ref to complete) on large db's with few matches.
-
- Also, add some fairly smart, self-tuning aggregating of cards.
- Keep track of the number of cards we've sent the last time through
- as well as this time, and estimate the number we want to aggregate
- the next time based on them (we average them at the moment),
- subject to maximum/minimum number of cards. also, we have a
- maximum aggregation time, after which we force a flush if there
- are pending cards and recalculate our target pending number.
- there's a minimum wait time to possibly keep outselves from
- spamming the ui, although it's 0 at the moment.
-
- Lastly, make sure to only notify the GUI of status messages when
- we need to. this results in a *huge* savings.
- (ldap_search_handler): initialize all the pending card stuff, and
- use a timeout instead of an idle function for poll_ldap.
-
- * backend/ebook/e-book-view-listener.c
- (e_book_view_listener_queue_response): performance optimization
- for large adds. If we're a CardAddedEvent and there's an existing
- CardAddedEvent at the end of the queue, just concat the lists of
- cards together. This is to keep the gui from falling further and
- further behind the ldap backend, which is merrily spewing updates
- at the gui.
-
-2002-02-21 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/Makefile.am: Define $(iconsdir).
-
- * gui/component/addressbook-component.c (add_creatable_item): New
- helper function.
- (create_component): Add the icons for the user creatable items as
- well.
-
-2002-02-20 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-file.c (pas_backend_file_load_uri):
- track change to signature, and (for now) just change all the
- return FALSE's to _RepositoryOffline (what FALSE used to map to in
- pas_book_factory_process_request), and change TRUE to _Success.
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_load_uri):
- track change to signature, and differentiate between
- pas_backend_ldap_connect failing (RepositoryOffline), and
- ldap_url_parse failing (OtherError).
-
- * backend/pas/pas-book-factory.c
- (pas_book_factory_process_request): since pas_backend_load_uri
- returns status now, use it to nodify the BookListener if there's a
- failure.
-
- * backend/pas/pas-backend.c (pas_backend_load_uri): track change
- to signature.
-
- * backend/pas/pas-backend.h: change return type of
- pas_backend_load_uri to
- GNOME_Evolution_Addressbook_BookListener_CallStatus to allow
- differentiation between failure types.
-
- * backend/ebook/e-book-listener.c
- (e_book_listener_convert_status): handle _AUTHENTICATION_FAILED.
-
- * backend/ebook/e-book-types.h (EBookStatus): add
- _AUTHENTICATION_FAILED.
-
-2002-02-18 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-book-factory.c
- (pas_book_factory_process_request): if the load_uri fails, notify
- the listener that the repository is offline. (partial fix for bug
- 20347)
-
-2002-02-18 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (create_dn_from_ecard): escape
- commas in the dn, since they're used by ldap to specify the node's
- placement in the tree. (fixes bug 20089)
- (rfc2254_escape): just use sprintf and %02X instead.
-
-2002-02-13 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names.c (set_book): Keep a
- ref of the model in this case as well.
-
-2002-02-13 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names.c (set_book): Make
- sure to only set the query once when creating a new book and not
- at all on addressbook model creation. This prevents an accidental
- pair of changes from making the addressbook model load a remote
- addressbook.
-
- * gui/widgets/e-addressbook-model.c (get_view): If this is the
- first_get_view and the addressbook is remote, empty the view
- instead of leaving it in the state it used to be in. This only
- occurs if you set the book after the model has existed for a
- while.
- (e_addressbook_model_set_arg): When setting the book, set
- first_get_view to TRUE.
-
-2002-02-13 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (display_view): Attach to the
- emvw instead of the emv here.
-
- * gui/widgets/e-minicard-view-widget.c, e-minicard-view-widget.h:
- Made this object have a "column_width" argument and a
- "column_width_changed" signal which are a simple layer down to the
- EMinicardView contained within.
-
- * gui/widgets/gal-view-minicard.c, gui/widgets/gal-view-minicard.h
- (gal_view_minicard_attach): Made this attach to an
- EMinicardViewWidget instead of a EMinicardView.
-
-2002-02-13 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-book-util.c, backend/ebook/e-book-util.h
- (e_book_expand_uri, e_book_load_address_book_by_uri,
- e_book_use_address_book_by_uri): New functions that take a file://
- url ending in the directory name and automatically append the
- addressbook.db and do the appropriate thing.
-
- * backend/pas/pas-backend-card-sexp.c,
- backend/pas/pas-backend-card-sexp.h: Added copyright notice here.
-
- * gui/component/addressbook-component.c
- (destination_folder_handle_drop), gui/component/addressbook.c
- (set_prop): Use e_book_expand_uri instead of
- addressbook_expand_uri.
-
- * gui/component/addressbook-storage.c: Fixed the fcntl include
- here.
-
- * gui/component/addressbook.c (ContactsCopyToFolder,
- ContactsMoveToFolder): Added handlers for these two verbs.
-
- * gui/component/addressbook.h: Removed addressbook_expand_uri in
- favor of e_book_expand_uri.
-
- * gui/widgets/e-addressbook-reflow-adapter.c (transfer_cards):
- Added code to handle Move to and Copy to right click menu items.
-
- * gui/widgets/e-addressbook-util.c,
- gui/widgets/e-addressbook-util.h (e_addressbook_transfer_cards):
- New function to pop up a dialog and transfer a set of cards to the
- given folder.
-
- * gui/widgets/e-addressbook-view.c,
- gui/widgets/e-addressbook-view.h (display_view): Don't attach to
- the view if it doesn't exist yet. We have to make this then
- attach later.
- (e_addressbook_view_copy_to_folder,
- e_addressbook_view_move_to_folder): New functions utilizing
- e_addressbook_transfer_cards.
- (table_right_click): Add copy_to_folder and move_to_folder to the
- right click menu for tables here.
- (e_addressbook_view_discard_menus): Handle menu unmerging here.
-
- * gui/widgets/e-minicard-view-widget.h (struct
- _EMinicardViewWidget): Removed unused field.
-
-2002-02-13 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (display_view): Attach the
- GalViewMinicard to the EMinicardView here.
-
- * gui/widgets/gal-view-minicard.c, gui/widgets/gal-view-minicard.h
- (gal_view_minicard_load, gal_view_minicard_save): Made these save
- the column width of the view.
- (gal_view_minicard_attach, gal_view_minicard_detach): Added these
- functions to allow the GalViewMinicard to set the column width of
- a EMinicardView and to monitor its changes.
-
-2002-02-12 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-reflow-adapter.c
- (addressbook_get_arg): Added an argument to get the model.
-
- * gui/widgets/e-addressbook-view.c (writable_status): Don't bother
- connecting to the writable_status callback on the book, simply
- rely on the writable_status callback on the addressbook model.
-
- * gui/widgets/e-minicard-view.c, gui/widgets/e-minicard-view.h
- (set_empty_message): Handle the case of a read only view here.
-
-2002-02-07 JP Rosevear <jpr@ximian.com>
-
- * gui/component/addressbook-component.c (create_component): remove
- "New" from user creatable menu items
-
-2002-02-07 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-view.c,
- gui/widgets/e-addressbook-view.h
- (e_addressbook_view_setup_menus): Changed this function to use the
- new GalViewMenus which takes a GalViewInstance, instead of a
- GalViewCollection.
-
-2002-02-04 JP Rosevear <jpr@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c (find_address_mailing): tidy
-
- * conduit/address-conduit.c (addrconduit_load_configuration): load
- default address setting
- (addrconduit_save_configuration): save default address setting
- (e_addr_gui_new): new gui routine for conduit settings
- (e_addr_gui_fill_widgets): ditto
- (e_addr_gui_fill_config): ditto
- (e_addr_gui_destroy): ditto
- (e_addr_context_destroy): destroy the gui and new_cfg
- (local_record_from_ecard): reinstate commented out bits, determine
- which address to sync to pilot
- (ecard_from_remote_record): determine which address to sync from
- pilot
- (fill_widgets): put the gui widgets in
- (create_settings_window): create gui
- (save_settings): fill gui
-
-2002-02-04 JP Rosevear <jpr@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c (address_text_changed): if
- the shown address in the mailing address or there is no mailing
- address, set the default flag and make sure the button is checked
- (address_mailing_changed): set the flags properly when the mailing
- address changes
- (e_contact_editor_init): listen for the check button being toggled
- (find_address_mailing): find the address (if any) with the default
- flag
- (set_address_field): set the mailing address button appropriately
- (fill_in_info): find the mailing address
-
- * gui/contact-editor/e-contact-editor.h: add new class data member
-
- * gui/contact-editor/contact-editor.glade: show mailing address
- check button
-
-2002-02-01 Jeffrey Stedfast <fejj@ximian.com>
-
- * backend/ebook/e-destination.c (e_destination_is_auto_recipient):
- New function to find out if a destination was one which was
- auto-matically set by Evolution.
- (e_destination_set_auto_recipient): Set whether or not the dest is
- an auto-recipient.
- (e_destination_touch): Don't touch the address if it is an
- auto_recipient.
- (e_destination_list_to_vector_sized): New function to avoid having
- to calculate the length of the list ourselves. Allows for a bit of
- optimization if our caller knows the length of the list.
- (e_destination_xml_encode): Encode the auto_recipient bit.
- (e_destination_xml_decode): Decode the auto_recipient bit.
-
-2002-02-01 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card-simple.c (e_card_simple_sync_card): Made
- this preserve addressbook flags other than the first three.
-
- * backend/ebook/e-card-types.h: Added E_CARD_ADDR_MASK and
- E_CARD_ADDR_DEFAULT.
-
- * backend/ebook/e-card.c (get_address_flags): Added "PREF" to
- E_CARD_ADDR_DEFAULT mapping.
-
- * backend/ebook/test-client.c: Added #include "e-book-util.h".
-
-2002-01-30 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-file.c (pas_backend_file_changes):
- compute the change db filename based on our contact db filename.
- (pas_backend_file_load_uri): store the filename in
- bf->priv->filename.
- (pas_backend_file_destroy): free the filename, and (!) free
- bf->priv too.
-
-2002-01-28 Jeffrey Stedfast <fejj@ximian.com>
-
- * backend/ebook/e-destination.c (e_destination_is_valid): Revert
- my previous change as trow says this will break auto-completion
- stuff.
-
-2002-01-27 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/contact-editor/Makefile.am: Use EVOLUTION_ADDRESSBOOK_CFLAGS.
- * gui/contact-list-editor/Makefile.am: Likewise.
- * gui/merging/Makefile.am: Likewise.
- * gui/search/Makefile.am: Likewise.
- * gui/component/select-names/Makefile.am: Likewise.
-
-2002-01-25 Jeffrey Stedfast <fejj@ximian.com>
-
- * backend/ebook/e-destination.c (e_destination_is_valid): Don't
- check for an @ in the email address. This is to fix bug #10960.
-
-2002-01-24 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug 16097 ]
- * gui/component/addressbook-config.glade: gui love for the new
- auth stuff.
-
- * gui/component/addressbook.c (load_uri_cb): track change to auth,
- and offer up different prompt strings depending on which method
- (binddn or email) we're using.
-
- * gui/component/addressbook-storage.c (ldap_unparse_auth): use the
- new auth types for ldap.
- (ldap_parse_auth): same.
- (addressbook_storage_auth_type_to_string): new function.
- (load_source_data): get the binddn too.
- (ldap_source_foreach): store out binddn or emailaddr, depending on
- the auth type chosen.
-
- * gui/component/addressbook-storage.h: add the more detailed auth
- types, add "binddn" to the source structure, and add a prototype
- for addressbook_storage_auth_type_to_string.
-
- * gui/component/addressbook-config.c (auth_checkbutton_changed):
- set the auth stuff (in)sensitive.
- (auth_optionmenu_activated): new function.
- (addressbook_source_dialog_set_source): track UI change.
- (addressbook_source_dialog_get_source): same.
- (add_scope_activate_cb): rename add_activate_cb to this to
- distinguish it from the auth stuff.
- (add_auth_activate_cb): new function.
- (addressbook_source_dialog): track change to auth UI stuff.
- (addressbook_storage_auth_type_to_string): new function.
-
- * backend/ebook/e-book.h: add auth_method arg to
- e_book_authenticate_user.
-
- * backend/ebook/e-book.c (e_book_authenticate_user): track change
- to prototype - add auth_method arg, and pass it along to the CORBA
- call.
-
- * backend/ebook/test-client.c (book_open_cb): track api change -
- keep this building.
-
- * backend/pas/pas-book.h: add auth_method slot in PASRequest.
-
- * backend/pas/pas-book.c (pas_book_queue_authenticate_user): add
- auth_method arg and add it to the PASRequest.
- (impl_GNOME_Evolution_Addressbook_Book_authenticateUser): track
- idl change, add auth_method and pass it along to
- pas_book_queue_authenticate_user.
-
- * backend/pas/pas-backend-ldap.c
- (pas_backend_ldap_process_authenticate_user): support both
- "ldap/simple-email" and "ldap/simple-binddn" auth methods.
-
- * backend/idl/addressbook.idl: add "in string authMethod" to
- authenticateUser.
-
-2002-01-24 Ettore Perazzoli <ettore@ximian.com>
-
- * conduit/Makefile.am: Use EVOLUTION_ADDRESSBOOK_CONDUIT_CFLAGS
- and EVOLUTION_ADDRESSBOOK_CONDUIT_LIBS and remove unused flags
-
- * gui/component/Makefile.am: Use EVOLUTION_ADDRESSBOOK_CFLAGS and
- EVOLUTION_ADDRESSBOOK_LIBS and remove unused flags.
- * backend/pas/Makefile.am: Likewise.
- * backend/ebook/Makefile.am: Likewise.
- * printing/Makefile.am: Likewise.
- * backend/ebook/Makefile.am: Likewise.
- * gui/widgets/Makefile.am (INCLUDES): Likewise.
-
-2002-01-23 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-component.c (create_component): Pass a
- NULL @icon to
- `evolution_shell_component_add_user_creatable_item()'.
-
-2002-01-23 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/contact-editor/e-contact-editor-address.c: #include
- <locale.h>.
-
-2002-01-22 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug # 16864 ]
- * backend/ebook/evolution-ldif-importer.c (getValue): create and
- return a GString here, instead of writing to a fixed size buffer.
- (parseLine): use a GString here instead of a fixed size buffer.
-
-2002-01-21 Christopher James Lahey <clahey@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (ldap_search_handler): Set the
- number of cards to return to the value specified in the ldap uri,
- leaving the default at 100. Fixes Ximian bug #13953.
-
- * gui/component/addressbook-config.c (addressbook_source_dialog),
- gui/component/addressbook-config.glade: Added a limit entry here
- to edit the limit field of the source.
-
- * gui/component/addressbook-storage.c,
- gui/component/addressbook-storage.h
- (addressbook_storage_init_source_uri): Added a limit field to this
- class and pass that value through in the uri that's generated.
-
-2002-01-18 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card-compare.c: Made username match with no
- domain match be vague instead of partial. Fixes Ximian bug
- #13612.
-
-2002-01-18 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/addressbook.c (view_contact_cb): New verb to open
- a bunch of cards.
-
- * gui/widgets/e-addressbook-reflow-adapter.c (open_card): Call
- e_addressbook_show_multiple_cards instead of doing this ourselves.
-
- * gui/widgets/e-addressbook-util.c,
- gui/widgets/e-addressbook-util.h
- (e_addressbook_show_multiple_cards): Added this function to show a
- bunch of cards, including a dialog if lots of windows are going to
- appear.
-
- * gui/widgets/e-addressbook-view.c (e_addressbook_view_view,
- e_addressbook_view_can_view): e_addressbook_view_view calls
- e_addressbook_show_multiple_cards on the appropriate list of
- cards.
-
-2002-01-18 Christopher James Lahey <clahey@ximian.com>
-
- * gui/contact-editor/e-contact-editor-address.c
- (fill_in_countries), gui/contact-editor/fulladdr.glade: Sort
- country list. Country list moves from fulladdr.glade to
- e-contact-editor-address.c, but only a few country names have
- actually changed. Fixes Ximian bug #16545.
-
-2001-12-20 Zbigniew Chyla <cyba@gnome.pl>
-
- Fixes #17725
-
- * evolution/addressbook/printing/e-contact-print.c (complete_sequence):
- Do not assume that the first byte of file_as is the first letter, use
- utf8 functions instead.
-
-2002-01-16 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c: move all functions here, get rid of
- header files, use e-pilot-settings to display gui
-
-2002-01-15 JP Rosevear <jpr@ximian.com>
-
- * gui/component/select-names/select-names.glade: remove misleading
- title and fix spacing
-
-2002-01-11 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/addressbook.c (alphabet_state_changed): Handle
- setting the search bar to "Advanced..." when the alphabet buttons
- are pushed and back when they're cleared. Fixes Ximian bug
- #12904.
- (addressbook_menu_activated): When the user calls Search->clear,
- set the search to ESB_ANY and "", don't just set the text. This
- is especially useful when it's set to ESB_ADVANCED.
-
- * gui/widgets/e-addressbook-view.c,
- gui/widgets/e-addressbook-view.h (alphabet_state_change): Added
- this signal which gets emitted when the alphabet buttons are
- pushed.
- (command_state_change): Removed the ref pair here. It's not
- necessary. gtk_signal_emit refs the object itself.
-
-2002-01-11 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card-compare.c (name_synonyms): Added a couple
- of names here.
-
- * gui/component/select-names/e-select-names-text-model.c
- (e_select_names_text_model_get_nth_obj): Removed an unused
- variable.
-
-2002-01-11 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-view.c,
- gui/widgets/e-addressbook-view.h (create_alphabet): Use toggle
- buttons here. Fixes Ximian bug #10734.
-
-2002-01-09 Christopher James Lahey <clahey@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c (set_fields): Choose the
- first filled in address field here. Fixes Ximian bug #2222.
-
-2002-01-03 Joe Shaw <joe@ximian.com>
-
- * backend/ebook/test-card.c: Add a test for getting arbitrary
- fields.
-
- * backend/pas/pas-backend-card-sexp.c (compare_arbitrary): Added.
- (prop_info_table): Add a LIST_PROP for arbitrary fields.
-
-2002-01-03 Nat Friedman <nat@ximian.com>
-
- * backend/ebook/e-book.c (activate_factories_for_uri): Free the
- query if the oaf response is of zero length.
-
-2001-12-27 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (real_add_address_cb): When we clean, don't clean the model's last
- element. This helps keep things working properly when we have
- signal-character separators.
- (section_right_click_cb): Changed to work properly with our
- EText-emitted popup signal.
- (e_select_names_add_section): Use ETexts for the recipient
- sections, rather than tables. This lets us make them directly
- editable. (Bug #1721)
-
- * gui/component/select-names/e-select-names-popup.c
- (popup_info_new): Pass in a ESelectNamesTextModel, not a
- ESelectNamesModel.
- (e_select_names_popup): Adjust for the new signature for
- e_select_names_model_text_pos.
-
- * gui/component/select-names/e-select-names-manager.c
- (focus_out_cb): Schedule a cleaning when we focus out.
- (focus_in_cb): Cancel pending cleaning when we get focus. This
- helps us avoid bad things happening during the fast focus out/ins
- that happen when the completion dropdown appears.
- (completion_handler): Adjust for new signatures of
- e_select_names_model_text_pos and e_select_names_model_name_pos.
- (e_select_names_manager_entry_new): Pass in our
- ESelectNamesTextModel when constructing the
- ESelectNamesCompletion.
- (e_select_names_manager_entry_free): Cancel any pending clean-ups.
-
- * gui/component/select-names/e-select-names-bonobo.c
- (entry_get_property_fn): Get the text off of the text model.
- Which is the only way that really makes sense when you think about
- it.
-
- * gui/component/select-names/e-select-names-completion.c: Added a
- copy of the associated ESelectNamesTextModel to
- ESelectNamesCompletionPrivate. This replaces the
- ESelectNamesModel.
- (e_select_names_completion_destroy): Unref ->text_model.
- (e_select_names_completion_handle_request): Pass in our text
- model's separator info when calling e_select_names_model_text_pos.
- (e_select_names_completion_new): Pass in the text model as an arg
- instead of the model, and ref it as needed.
-
- * gui/component/select-names/e-select-names-text-model.c
- (e_select_names_text_model_init): Set separator as either ", " or
- ",", depending on the value of the EVOLUTION_DISABLE_MAGIC_COMMA
- environment variable.
- (e_select_names_text_model_destroy): Free the separator.
- (changed_cb): Flush our cached text on changed.
- (e_select_names_text_model_set_source): Use our own changed_cb
- callback on changed, rather than just connecting up
- e_text_model_changed.
- (e_select_names_text_model_set_separator): Added. Lets the
- separator between recipients be specified.
- (e_select_names_text_model_get_text): Cache the text we get from
- calling e_select_names_model_get_textification.
- (e_select_names_text_model_insert_length): A bunch of small
- changes to properly support generic separators, rather than
- (implicit and explicitly) assuming ", ".
- (e_select_names_text_model_delete): More small tweaks to handle
- generic separators.
- (e_select_names_text_model_get_nth_obj): Use new signature when
- calling e_select_names_model_name_pos, and use our cached text.
-
- * gui/component/select-names/e-select-names-model.c
- (e_select_names_model_destroy): We don't cache the text or
- addr_text anymore, so no need to free them here.
- (e_select_names_model_changed): ...and no need to reset our text
- and addr_text caches here.
- (e_select_names_model_get_textification): Take a separator as an
- arg, rather than just using ", ". Also, no caching.
- (e_select_names_model_get_address_text): Take a separator as an
- arg, rather than just using ", ". And no caching here either.
- (e_select_names_model_clean): Add arg that give us control over
- whether or not the last entry should get cleaned. We need this
- when using a one-character separator, so that new destinations
- that get tacked onto the end don't get immediately cleaned away
- for being empty.
- (e_select_names_model_name_pos): Take the separator length as an
- argument, remove implicit assumption of length 2.
- (e_select_names_model_text_pos): Take the separator length as an
- argument, remove implicit assumption of length 2.
-
-2001-12-20 Ettore Perazzoli <ettore@ximian.com>
-
- [Fix #17377, Evolution doesn't work on multi-depth displays.]
-
- * gui/component/addressbook-factory.c (main): Push GdkRGB visual
- and colormap.
-
-2001-12-19 Jon Trowbridge <trow@ximian.com>
-
- * gui/widgets/e-addressbook-reflow-adapter.c
- (e_addressbook_reflow_adapter_right_click): Add cut/copy/paste to
- right-click menu.
-
- * gui/widgets/e-addressbook-view.c (table_right_click): Add
- cut/copy/paste to right-click menu. (Fixes bug #14528.) Also,
- disable some right-click options if our addressbook isn't
- editable.
-
-2001-12-18 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (check_for_slow_setting): go slow and
- clear the map if the last uri and the current uri do not match
- (post_sync): save the last uri
-
- * conduits/address-conduit-config.h: handle a last uri config
- option
-
-2001-12-18 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c (addressbook_default_book_open):
- change this to match its e-book counterpart, and only failover to
- the local addressbook if the protocol wasn't supported. that way
- errors like "failure to connect" are still reported to the user.
-
- * backend/ebook/e-book-util.h: add prototypes for
- e_book_load_default_book and e_book_get_config_database.
-
- * backend/ebook/e-book-util.c (e_book_default_book_open): new
- function, basically cut and paste addressbook_default_book_open
- from addressbook.c here.
- (e_book_load_default_book): cut and past
- addressbook_load_default_book here, pretty much, except leave off
- the auth stuff.
- (e_book_get_config_database): new function, returns the
- Bonobo_ConfigDatabase for e_book_load_default_book to use.
-
- * conduit/address-conduit.c (start_addressbook_server): use
- e_book_load_default_book here.
-
-2001-12-17 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug 17355 ]
- * gui/component/select-names/e-select-names.c (new_folder): if
- we're dealing with an LDAP folder, prepend [LDAP] to it. Now that
- we have 3 different places where folders are coming from, it helps
- to be able to differentiate "Contacts" in ~/evolution and a
- "Contacts" ldap server and a "Contacts" exchange folder.
- (add_additional_select_names_uris): loop through the bonobo conf
- settings for additional folders, adding them to the option menu.
- (e_select_names_hookup_shell_listeners): call
- add_additional_select_names_uris.
-
-2001-11-28 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-minicard-view-widget.c
- (e_minicard_view_widget_realize): Use an #ECanvasBackground here
- instead of a #GnomeCanvasRect.
-
-2001-12-16 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c: Added
- 'cache_complete' flag to ESelectNamesCompletionPrivate.
- (e_select_names_completion_seq_complete_cb): Set cache_complete
- to TRUE if our query wasn't interrupted.
- (e_select_names_completion_start_query): Set cache_complete to
- FALSE at the beginning of a potentially-cached query.
- (e_select_names_completion_do_query): Only reuse cached cards
- if cache_complete is TRUE. (Fixes bug #10241)
-
-2001-12-15 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (e_addr_context_destroy): don't free
- the hash table keys, we didn't allocate them and free the change
- objects and unref the associated cards
- (local_record_from_uid): unref the temp card we create
- (replace_record): ref the new card associated with the card change
- and unref the old one
-
-2001-12-13 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (local_record_from_ecard): Make sure
- to copy the custom fields so they are not overwritten
-
-2001-12-13 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-book-util.c (simple_query_new): Used
- g_strdup_printf to dup a string. Doh! Changed to g_strdup.
- (Bug #17126)
-
-2001-12-07 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_entry_new): Remove a reference to code
- I don't want to commit yet. :-)
-
- * gui/component/select-names/e-select-names-manager.c: Extensively
- refactored -- this code had gotten _really_ ugly. Untangle things
- to the point where our reference counting problems are fixable.
-
- * gui/component/select-names/e-select-names-bonobo.c
- (impl_destroy): Remove all of the ugly hacks to work around our
- memory management problems, and just unref the manager.
- (Fixes #14412)
-
-2001-12-05 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c
- (search_for_dn_with_objectclasses): move search_for_dn's contents
- here, and add an "existing_objectclasses" parameter that we pass
- on to build_card_from_entry.
- (search_for_dn): call search_for_dn_with_objectclasses with NULL
- for existing_objectclasses.
- (build_card_from_entry): if existing_objectclasses is non-NULL,
- fill it in with the list of existing objectclass values for this
- entry.
- (add_objectclass_mod): if existing_objectclasses is non-NULL,
- meaning we're modifying an entry, search in the existing
- objectclasses for the ones we want to be there, and only add
- what's missing. If none are missing, don't add objectclass_mod to
- the list of mods.
- (create_card_handler): track change to add_objectclass_mod (pass
- NULL).
- (modify_card_handler): use search_for_dn_with_objectclasses
- instead of search_for_dn, and pass the existing objectclasses to
- add_objectclass_mod. also, free the list when we're done.
- (poll_ldap): track change to build_card_from_entry (pass NULL).
-
-2001-12-05 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c (enable_writable_fields):
- we need to be able to disable non-labels here as well. since
- we're using enable_widget and not gtk_widget_set_sensitive, it's
- okay to handle entries/text's, etc, here.
- (widget_field_mappings): add label-caluri and label-fburl here.
-
- * gui/contact-editor/contact-editor.glade: change the label names
- for the freebusy/calendar urls to have more descriptive names,
- since we use them in e-contact-editor.c now.
-
- * backend/pas/pas-backend-ldap.c: add support for
- caluri/calendarURI, fburl/freeBusyURI.
-
- * backend/pas/evolutionperson.schema: add calendarURI and
- freeBusyURI.
-
-2001-12-04 Christopher James Lahey <clahey@ximian.com>
-
- * gui/contact-editor/contact-editor.glade: Fixed up the
- accelerators and such here.
-
- * gui/contact-editor/e-contact-editor.c (file_save_as_cb):
- Translate this string.
- (pixmaps): Added a pixmap for the ContactEditorSaveClose command.
- (setup_tab_order): Fixed up the tab order here.
-
- * gui/contact-editor/fulladdr.glade: Made the country combo
- focusable here.
-
-2001-12-03 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-destination.c (e_destination_equal): Make address
- comparisons case-insensitive. (Fixes 11776)
-
- * backend/ebook/e-card.c (e_card_email_match_single_string): Make address
- host comparisons case-insensitive. (Fixes 11776)
-
- * gui/component/select-names/e-select-names-manager.c (focus_out_cb): Clean
- ESelectNamesModel on focus-out. (Half of a fix for 15656)
-
- * backend/ebook/e-destination.c (nonempty): Fix this function
- and make it utf8-safe. (The other half of the fix for 15656)
-
-2001-11-28 Christopher James Lahey <clahey@ximian.com>
-
- * gui/contact-list-editor/e-contact-list-editor.c: Consistency
- fixes with standard contact editor. Added Save As, Send As, and
- Send To. Replaced Save toolbar with Save and Close and added Save
- and Close menu item. Added a trash icon.
-
-2001-11-28 Christopher James Lahey <clahey@ximian.com>
-
- * gui/contact-editor/e-contact-editor-address.c (setup_tab_order):
- Setup the tab order here. Fixes Ximian bug #13751.
-
-2001-11-28 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/addressbook.c (connect_master_list_changed,
- make_suboptions): Changed how this list of categories gets
- computed. Fixes Ximian bugs #7707 and #7708.
-
-2001-11-15 Zbigniew Chyla <cyba@gnome.pl>
-
- * printing/e-contact-print-envelope.c (ecpe_linelist_dimensions),
- printing/e-contact-print.c (e_contact_divide_text, e_contact_output,
- e_contact_rectangle, e_contact_print_letter_tab,
- e_contact_print_letter_heading, e_contact_get_card_size,
- e_contact_print_card, e_contact_print_phone_list):
- s/gnome_font_get_width_string/gnome_font_get_width_utf8/
- s/gnome_font_get_width_string_n/gnome_font_get_width_utf8_sized/
-
-2001-11-14 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (search_for_dn): check against
- LDAP_SUCCESS as the return value, not -1.
- (pas_backend_ldap_build_all_cards_list): same.
- (pas_backend_ldap_process_authenticate_user): same.
-
-2001-11-12 Chris Toshok <toshok@ximian.com>
-
- [ Fixes Ximian bug #14843 ]
- * backend/pas/pas-backend-ldap.c (func_and): don't crash if a
- subexpression wasn't filled in.
-
- * backend/pas/pas-backend-ldap.c (func_or): same.
-
-2001-11-12 Jon Trowbridge <trow@ximian.com>
-
- * gui/contact-list-editor/e-contact-list-editor.c (list_added_cb):
- Release callback's reference to EContactListEditor.
- (list_modified_cb): Release callback's reference to
- EContactListEditor.
- (save_card): Ref the EContactListEditor on behalf of the
- e_book_foo callback. (Fixes bug #14743)
- (save_card): Set changed to false once we've saved.
- (list_deleted_cb): Release callback's reference.
- (delete_cb): Hold reference for the callback.
-
-2001-11-12 Jon Trowbridge <trow@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c (categories_clicked): If
- our call to e_categories_new returns NULL, put up an error dialog
- and return. (Fixed #14780)
-
-2001-11-09 Chris Toshok <toshok@ximian.com>
-
- [ Fixes Ximian bug #14687 ]
- * backend/pas/pas-backend-file.c
-
- * backend/pas/pas-book-factory.c
- (pas_book_factory_process_request): do load_uri before add_client,
- so we know if the load actually worked (add_client uses this
- information to respond to the new client.) before this change,
- the client would still think the book was in a useful state even
- if the load_uri failed.
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_add_client): if
- the we're not connected, say so.
-
- * backend/pas/pas-backend-file.c (pas_backend_file_add_client):
- same.
- (pas_backend_file_load_uri): don't report_writable here,
- add_client does it. was only needed before because of the
- improper ordering in pas-book-factory.c above.
-
-2001-11-09 Chris Toshok <toshok@ximian.com>
-
- [ Fixes Ximian bug #14646 ]
- * gui/component/addressbook.c (addressbook_default_book_open): new
- function. if the default_book failed to load, load the local
- addressbook in its place.
- addressbook_load_default_book): if we're loading the default_book
- uri, use addressbook_default_book_open as the open_response.
-
- * backend/ebook/e-book.c (e_book_load_uri_step): reset the
- load_state to NotLoaded so we can attempt another load_uri on
- the book if it fails.
-
-2001-11-08 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-bonobo.c
- (impl_destroy): Explicitly destroy entries. Part of the fix for
- the lingering completion window bug.
-
-2001-11-04 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c: Use ordering of the pilot's phone
- label list to find fields we sync in order to avoid strcmp'ing the
- pilot's labels rendering phone syncing usable only for english
- language pilots
-
-2001-11-03 Chris Toshok <toshok@ximian.com>
-
- [ Fixes Ximian bug #14410 ]
- * gui/contact-editor/e-contact-editor.c (e_contact_editor_init):
- init in_async_call to FALSE.
- (card_added_cb): turn the UI back on and set in_async_call to
- FALSE.
- (card_modified_cb): same.
- (card_deleted_cb): same.
- (save_card): turn off the UI by setting the dialog insensitive,
- and set in_async_call to TRUE.
- (delete_cb): same.
- (app_delete_event_cb): if we're in an async call don't let the
- window get deleted.
-
- * gui/contact-editor/e-contact-editor.h (struct _EContactEditor):
- add in_async_call flag for when we make a wombat call and need to
- disable the UI.
-
- * gui/contact-list-editor/e-contact-list-editor.c
- (e_contact_list_editor_init): init in_async_call to FALSE.
- (list_added_cb): turn the UI back on and set in_async_call to
- FALSE.
- (list_modified_cb): same.
- (list_deleted_cb): same.
- (save_card): turn off the UI by setting the dialog insensitive,
- and set in_async_call to TRUE.
- (delete_cb): same.
- (app_delete_event_cb): if we're in an async call don't let the
- window get deleted.
-
- * gui/contact-list-editor/e-contact-list-editor.h (struct
- _EContactListEditor): add in_async_call flag for when we make a
- wombat call and need to disable the UI.
-
-2001-11-02 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card-simple.c (e_card_simple_get): Check for
- NULL dates before converting them to strings. Fixes Ximian bug
- #14394.
-
-2001-11-02 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-bonobo.c
- (impl_destroy): Leak select-names related data structures until
- the memory management issues get sorted out. Fixed bug #14086.
-
-2001-10-31 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/e-cardlist-model.c,
- gui/component/select-names/e-select-names-table-model.c,
- gui/widgets/e-addressbook-table-adapter.c: Make the pre_changes
- and changes match here.
-
-2001-10-31 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_destroy): Check that local_listener and
- other_contacts_listener are non-NULL before
- disconnecting/unrefing.
-
- * gui/component/select-names/e-select-names-manager.c
- (entry_destroyed): The entry shouldn't unref the manager.
- (e_select_names_manager_create_entry): The entry shouldn't hold a
- ref to the manager. It becomes circular.
- (e_select_names_manager_create_entry): On the other hand, we
- should hold a ref to the entry we create.
-
- * gui/component/select-names/e-select-names-bonobo.c
- (impl_destroy): Remove the explicit dialog destroy hack.
-
-2001-10-30 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-bonobo.c
- (impl_destroy): Force the select names dialog to be destroyed.
- This is a hack to fix bug #14002 -- I'll clean up the refcounting
- issues post-freeze. At least now it won't crash.
-
-2001-10-30 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (ecard_from_remote_record): make sure
- to translate the character sets of the names
-
-2001-10-30 JP Rosevear <jpr@ximian.com>
-
- * gui/component/select-names/e-select-names-bonobo.c
- (manager_ok_cb): send a null bonobo arg to prevent explosion
-
-2001-10-30 JP Rosevear <jpr@ximian.com>
-
- * gui/widgets/e-addressbook-view.c: correct include typo
-
-2001-10-29 Jon Trowbridge <trow@ximian.com.
-
- * gui/widgets/e-minicard.c (add_field): Five characters, not four!
-
- * gui/widgets/e-addressbook-table-adapter.c
- (addressbook_value_at): Convert xml-ified destinations into proper
- addresses.
-
-2001-10-29 Jon Trowbridge <trow@ximian.com.
-
- * gui/component/select-names/e-select-names-bonobo.c (init):
- Connect to manager's "ok" signal.
- (manager_ok_cb): Emit "ok" bonobo-signal.
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_class_init): Added "ok" signal.
- (e_select_names_clicked): Emit 'ok' signal.
-
-2001-10-29 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-util.c
- (e_addressbook_prompt_save_dialog): new function, a "Do you want
- to save changes?" dialog.
-
- * gui/widgets/e-addressbook-util.h: add prototype for
- e_addressbook_prompt_save_dialog.
-
- * gui/contact-editor/e-contact-editor.c (prompt_to_save_changes):
- call e_addressbook_prompt_save_dialog and save the card if they
- select save. return TRUE if the dialog should be closed, FALSE
- otherwise.
- (file_close_cb): check prompt_to_save_changes before closing the
- dialog.
- (app_delete_event_cb): same.
-
- * gui/contact-list-editor/e-contact-list-editor.c
- (prompt_to_save_changes): call e_addressbook_prompt_save_dialog
- and save the card if they select save. return TRUE if the dialog
- should be closed, FALSE otherwise.
- (file_close_cb): check prompt_to_save_changes before closing the
- dialog.
- (app_delete_event_cb): same.
-
-2001-10-29 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (add_objectclass_mod): overload
- this function for modifying objectclasses too, so we can make sure
- evolutionPerson shows up in the objectclasses of an entry if it
- shows up in the schema for the server.
- (create_card_handler): add @replace = FALSE in the call to
- add_objectclass_mod.
- (modify_card_handler): call add_objectclass_mod with @replace =
- TRUE.
- (anniversary_compare): fix typo - return "equal", not "TRUE".
- (birthday_compare): same.
-
-2001-10-29 Jon Trowbridge <trow@ximian.com>
-
- * conduit/address-conduit.c (pre_sync): Comment out spew.
-
- * gui/contact-list-editor/e-contact-list-editor.c (fill_in_info):
- Comment out spew.
-
- * gui/component/addressbook-component.c
- (destination_folder_handle_drop): Comment out spew.
- (get_dnd_selection): Comment out spew.
-
- * gui/widgets/e-addressbook-table-adapter.c
- (addressbook_set_value_at): Comment out spew.
-
-2001-10-29 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/addressbook.c (update_command_state): Check that
- our BonoboUIComponent has a container so we don't get a lot of
- annoying debug spew.
-
- * printing/smallbook.ecps: Fixed fonts.
-
- * printing/phonelist.ecps: Fixed fonts.
-
- * printing/medbook.ecps: Fixed fonts.
-
- * printing/e-contact-print.c (e_contact_get_card_size): Commented
- out spew.
-
- * gui/widgets/e-minicard.c (remodel): Check that e_minicard->card
- != NULL.
-
-2001-10-29 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_destroy): We were using
- book_data->book_view immediately after unrefing it. Reordered the
- code a bit to avoid this.
-
-2001-10-29 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-book-factory.h: add prototype for
- pas_book_factory_dump_active_backends.
-
- * backend/pas/pas-book-factory.c
- (pas_book_factory_dump_active_backends): new function.
- (dump_active_server_map_entry): new function.
-
-2001-10-29 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (make_match): Drop a match if either of the text fields is NULL.
- This could happen if any of the utf-8 involved is invalid, for
- example. (Bug #13757)
-
-2001-10-29 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (is_syncable): fix bug that allowed
- for phone's not to be in priority order and the item to still be
- syncable
-
- * conduit/address-conduit-config.h
- (addrconduit_load_configuration): get management by id
-
-2001-10-29 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (is_syncable): a card also needs to
- have its phone nums in priority order to be "syncable"
-
-2001-10-29 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (is_syncable): move the syncable
- checking code to a different function
- (ecard_from_remote_record): set the name parts individually
- (local_record_from_ecard): use is_syncable
-
-2001-10-29 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card-simple.c (file_as_get_style,
- file_as_set_style): Use the actual ECardName in the ECard instead
- of parsing the full_name here.
-
-2001-10-29 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card-simple.c, backend/ebook/e-card-simple.h
- (e_card_simple_set_name): New function to set the ECardName on
- this card and fix the file_as if necessary.
-
-2001-10-29 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card-simple.c, backend/ebook/e-card-simple.h
- (e_card_simple_get): Handle returning dates here.
- (e_card_simple_get_allow_newlines): New function. Returns whether
- it makes much sense to have newlines in this string.
-
- * gui/component/addressbook-config.c,
- gui/component/addressbook-config.h
- (addressbook_create_new_source): The first argument here should
- be const.
-
- * gui/component/addressbook-storage.c: Added #include
- "addressbook-config.h".
-
- * gui/widgets/e-minicard-label.c (e_minicard_label_event): On an
- escape here, cancel editing and remove the focus from the text.
-
- * gui/widgets/e-minicard.c (add_field): Set allow_newlines here.
- (field_activated): Stop editing on the activate signal and remove
- the focus from the text. Fixes Ximian bug #12286.
-
-2001-10-28 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.h: tidy
-
- * conduit/address-conduit-config.h: ditto
-
- * conduit/address-conduit.c (add_record): unref ecard when done
-
-2001-10-28 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-card.c (e_card_date_from_string): Expose this
- function.
- (e_card_date_to_string): ...and this one. Fixes build problem in
- pas-backend-ldap.c.
-
-2001-10-28 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_hookup_shell_listeners): Change "this should never
- happen" dialog to not give my name/e-mail. Sorry translators.
- But this really should never happen, thanks to my fix below.
-
- * gui/component/addressbook-component.c: Initialize
- global_shell_client to NULL. (Bug #6625)
-
-2001-10-27 Chris Toshok <toshok@ximian.com>
-
- [ bug #12979 ]
- * backend/pas/pas-backend-ldap.c (anniversary_populate): new
- function.
- (anniversary_ber): new function.
- (anniversary_compare): new function.
- (birthday_populate): new function.
- (birthday_ber): new function.
- (birthday_compare): new function.
-
-2001-10-27 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_destroy): free up all the book_data
- list stuff.
- (e_select_names_completion_got_book_view_cb): deal with book_data
- being passed as the closure, and increment the
- pending_completion_seq counter.
- (e_select_names_completion_card_added_cb): deal with book_data
- being passwd as the closure.
- (e_select_names_completion_seq_complete_cb): same, and decrement
- the pending_completion_seq if we haven't gotten one for this book
- view before.
- (e_select_names_completion_stop_query): cancel all the
- book_data's.
- (e_select_names_completion_start_query): use the books_not_ready
- counter instead of book_ready. also, do e_book_get_book_view on
- each of the book's in our list.
- (e_select_names_completion_do_query): change to deal with our
- list.
- (e_select_names_completion_book_ready): decrement the
- book_not_ready counter.
- (e_select_names_completion_new): add the book we're created with
- to our list.
- (e_select_names_completion_add_book): implement.
-
- * gui/component/select-names/e-select-names-completion.h: add
- prototype for e_select_names_completion_add_book.
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_new): use addressbook_config_data, and
- don't unref the db.
- (e_select_names_manager_create_entry): always add NULL for a book
- (which corresponds to the local book), and if the completion_book
- is present, add it to the list of books to complete again.
-
-2001-10-27 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-quick-add.c (merge_cb): change to
- EBookCallback signature, and unref the book.
- (quick_add_merge_card): use addressbook_load_default_book.
- (ce_have_book): change to EBookCallback signature, and unref the
- book.
- (edit_card): use addressbook_load_default_book.
-
- * gui/component/e-address-popup.c (email_table_save_card_cb):
- change to EBookCallback signature, and unref the book.
- (add_card_idle_cb): use addressbook_load_default_book, and call
- the cb if it fails.
- (e_address_popup_cleanup): fix type -- should be "pop->card =
- NULL", not "pop = NULL".
- (contact_editor_cb): change to EBookCallback signature.
- (edit_contact_info_cb): use addressbook_load_default_book.
- (start_query): change to EBookCallback signature.
- (e_address_popup_query): use addressbook_load_default_book.
-
- * gui/widgets/e-minicard-control.c (book_open_cb): change to
- EBookCallback signature, and unref the book.
- (save_in_addressbook): use addressbook_load_default_book instead
- of e_book_use_local_address_book.
-
- * gui/widgets/Makefile.am (INCLUDES): change includes since we're
- including addressbook.h which has it's own set of funky include
- path requirements.
-
-2001-10-27 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-book.c (activate_factories_for_uri): Don't leak
- stuff. (Bug #13709)
-
-2001-10-27 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-destination.c (name_and_email_simple_query_cb,
- nickname_simple_query_cb): Set book_uri when cardification occurs.
-
-2001-10-27 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_add_section): Turned off use_ellipsis (it breaks
- emulate_label_resize) and on emulate_label_resize. Fixes Ximian
- bug #13693.
-
-2001-10-27 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (make_match): Doh! We should be sorting our contacts so that the
- most frequently used ones are at the top of the list, not the
- bottom.
-
- * backend/pas/pas-book.c (pas_book_check_queue): That should be a
- bonobo_object_unref, not a gtk_object_unref.
- (pas_book_queue_request): Likewise, we need to bonobo_object_ref
- here.
- (pas_book_destroy): If our pas_book_check_queue timeout is still
- active, disable it. This should never happen, but it never hurts
- to be careful.
- (pas_book_destroy): Set book->priv to NULL after we free it.
-
-2001-10-27 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (local_record_from_ecard): copy phone
- labels and show phone as well, clear correct entry text and
- correctly detect unsyncable cases
-
-2001-10-27 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (local_record_from_ecard): touch the
- record on lookup
- (check_for_slow_setting): write touched only if we are doing a
- slow sync
- (card_removed): don't touch on lookup
- (match): touch on lookup
-
-2001-10-27 Jon Trowbridge <trow@ximian.com>
-
- * backend/pas/pas-book.c (pas_book_check_queue): Added paranoid
- reentrancy guards.
- (pas_book_queue_request): Changed our idle handler into a timeout,
- so as to work w/ reentrancy guards.
- (pas_book_init): Explicit initialization.
-
-2001-10-26 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.h: add prototypes for
- addressbook_config_database, and addressbook_load_default_book.
-
- * gui/component/addressbook.c (addressbook_config_database): new
- function, so we aren't activating the db everywhere we need to use
- it.
- (addressbook_load_default_book): load the default book, after
- getting the uri from bonobo-config.
-
-2001-10-26 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-book-util.c (simple_query_card_added_cb): Return
- on cancellation.
- (simple_query_sequence_complete_cb): Act if not cancelled.
- (simple_query_book_view_cb): Free & return on cancellation.
- (e_book_simple_query_cancel): Set cancellation flag.
-
- * gui/component/e-address-popup.c (e_address_popup_query): Hold a
- reference to ourselves for the duration of our addressbook fetch.
- (start_query): Release when we've fetched our addressbook.
- (e_address_popup_cleanup): Break out most of what we do in
- _destroy into a separate function.
- (e_address_popup_destroy): Class cleanup.
- (contact_editor_cb): Paranoid clean-up.
- (add_contacts_cb): Paranoid clean-up.
- (e_address_popup_ambiguous_email_add): Paranoid clean-up.
-
-2001-10-26 JP Rosevear <jpr@ximian.com>
-
- * conduit/e-address.conduit.in: remove the merges as valid sync
- types
-
- * conduit/address-conduit.c (pre_sync): write out only the touched
- records if we are doing copies
-
- * conduit/address-conduit-config.h
- (addrconduit_load_configuration): get the sync type
-
-2001-10-26 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/e-address-popup.c (e_address_popup_destroy):
- Cancel any pending queries.
-
- * gui/contact-editor/e-contact-editor.c (close_dialog): Don't
- assert, but check if ce->app != NULL, since this function can
- (apparently) get called multiple times.
-
- * gui/contact-editor/e-contact-save-as.c (file_exists): Remove bad
- dialog ref-counting crap.
-
- * gui/contact-editor/e-contact-editor.c (save_card): Ref our
- EContactEditor, since we are holding a pointer to it in
- EditorCloseStruct.
- (card_modified_cb): Unref our EContactEditor when we free our
- EditorCloseStruct.
- (card_added_cb): Unref our EContactEditor when we free our
- EditorCloseStruct.
-
-2001-10-26 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (check_for_slow_setting): make debug
- info more accurate
-
-2001-10-26 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (e_addr_context_destroy): prevent
- double unref
- (cursor_cb): correct typo
- (card_removed): remove the card from the map if was archived and
- is now deleted
-
-2001-10-26 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.h: new member
-
- * conduit/address-conduit.c (print_remote): free the struct after
- using it
- (e_addr_context_new): make consistent with other conduits
- (e_addr_context_destroy): properly destroy the context
- (cursor_cb): no need to ref the card, its done for us
- (clear_entry_text): util function to free a field
- (free_local): free a local record
- (local_record_to_pilot_record): use a static buffer so we don't
- have to free it later
- (local_record_from_ecard): only fill in the fields we might not
- sync, clear a field before replacing the contents
- (for_each): track locals
- (for_each_modified): ditto
- (free_match): use free_local
-
-2001-10-26 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-minicard.c, gui/widgets/e-minicard.h
- (set_has_cursor): Added has_cursor argument. Setting the argument
- to TRUE if the minicard doesn't have focus will grab the focus.
- Fixes Ximian bug #3024.
-
-2001-10-24 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/addressbook-factory.c (main): Initialize
- gnome-vfs.
-
- * gui/component/addressbook-component.c (xfer_file): Added.
- (Copied from the calendar.)
- (xfer_folder): Fixed to allow renaming of contact folders.
-
-2001-10-24 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-view.c
- (e_addressbook_view_class_init): Removed key_press handler here
- since delete and backspace are now handled by keybindings.
-
-2001-10-23 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/addressbook.c: Fix command paths when we specify
- our pixmaps, so we don't get a lot of totally useless & very ugly
- bonobo-ui spew.
-
- * backend/ebook/e-book-util.c (e_book_nickname_query): The empty
- string as an arg shouldn't generate a warning.
-
- * gui/component/select-names/e-select-names-completion.c: Removed
- our cancelled flag and e_select_names_completion_cancel function,
- since we were just duplicating stuff that had ended up in
- ECompletion.
- (match_name): Form our menu_text properly on an additional-name
- match.
- (e_select_names_completion_got_book_view_cb): Store handles for
- our signals, disconnect them properly when we switch book views.
- (e_select_names_completion_stop_query): Disconnect signals when we
- stop our query.
- (check_capabilities): Spew if we are using LDAP for completion.
- (e_select_names_completion_destroy): Disconnect our signals when
- we destroy.
- This all should fix bug #10241.
-
-2001-10-23 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_add_section): Set "draw_button" argument to TRUE
- on this EEntry.
-
-2001-10-22 Christopher James Lahey <clahey@ximian.com>
-
- * gui/contact-editor/e-contact-save-as.c (save_it): Put up an
- error dialog if there's an error while saving. If the person hits
- cancel on the "file exists" dialog, don't close the file selection
- dialog. Fixes Ximian bug #7055.
-
-2001-10-21 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-reflow-adapter.c
- (model_and_selection_free): right_click_up here when we let go of
- the popup.
-
- * gui/widgets/e-minicard-view.c (e_minicard_view_selection_event):
- right_click_up here.
-
-2001-10-21 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_add_section, e_select_names_set_default): Use an
- EEntry here instead of a GtkLabel. Fixes Ximian bug #7067.
-
-2001-10-21 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/addressbook.c (control_activate_cb): Call
- e_addressbook_model_force_folder_bar_message when we activate the
- component. (Fixes bug #11749)
-
- * gui/widgets/e-addressbook-model.c
- (e_addressbook_model_force_folder_bar_message): Added. Forces
- emission of a folder_bar_message.
-
-2001-10-20 Larry Ewing <lewing@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_set_default): stick with the style font if the
- efont bold font does not exist.
- (e_select_names_set_default): don't forget to unref the oldstyle.
-
-2001-10-20 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (name_style_query): Fix memory leak.
-
- * gui/widgets/e-addressbook-view.c (jump_to_letter): Free our
- string vector letter_v when we are done with it.
-
- * gui/contact-editor/e-contact-quick-add.c (edit_card): Unref our
- QuickAdd structure.
-
- * gui/component/e-address-popup.c (e_address_popup_construct):
- Unref our style after we are done with it.
-
-2001-10-20 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-book.c (activate_factories_for_uri): We
- shouldn't leak the info returned by oaf_query.
-
- * gui/contact-editor/e-contact-quick-add.c (card_added_cb): Remove
- superfluous call to quick_add_unref.
- (editor_closed_cb): Remove superfluous call to quick_add_unref.
-
- * gui/component/select-names/e-select-names.c (esn_get_key_fn): We
- need to unref the card returned by e_addressbook_model_get_card.
-
-2001-10-20 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-component.c: Make LDAP servers
- non-user-creatable.
-
-2001-10-20 Jon Trowbridge <trow@ximian.com>
-
- * printing/e-contact-print.c (e_contact_print_card): Check that the
- string we are checking for xml-ness is non-NULL.
-
- * backend/ebook/e-destination.c (e_destination_importv): Filter
- out empty destinations. (also Bug #13036)
-
- * printing/e-contact-print.c (e_contact_build_style): Use
- gnome_font_new_closest; if gnome_font_new fails and returns NULL,
- our spacing gets all messed up. (Bug #10785)
-
- * gui/widgets/e-addressbook-view.c (e_addressbook_view_can_print):
- Allow printing if there are any cards in our view. The selection
- has nothing to do with it.
-
- * backend/ebook/e-destination.c (e_destination_is_empty): Check
- for strings that contain non-whitespace, rather than just looking
- for a non-zero first character. (Bug #13036)
-
-2001-10-20 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-minicard-view.c (e_minicard_view_selection_event):
- Handle focus_change in event by selecting that contact. Fixes
- Ximian bug #3024.
-
- * gui/component/addressbook-component.c (owner_unset_cb):
- Repeatedly call gtk_main_quit here as long as there is a main loop
- around. This is an ugly hack around Ximian bug #11760.
-
-2001-10-20 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names.c: Added #include
- <gal/widgets/e-unicode.h>.
-
- * gui/widgets/e-minicard-control.c: Made this display the number
- of extra cards in the attachment as well as made it save them all
- to the local addressbook if the person selects the button. Fixes
- Ximian bug #9507.
-
-2001-10-20 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-minicard.c (e_minicard_event): Changed this to not
- grab on a right click. Fixes Ximian bug #12660.
-
-2001-10-19 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-component.c
- (destination_folder_handle_motion): Get @folder_type here too [to
- match the changes in the EvolutionShellComponentDnd interface].
- Also, remove a debugging message.
- (destination_folder_handle_drop): Likewise.
-
-2001-10-18 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names.c (add_menu_item):
- Translate labels in select-names option menu. (Bug #9604)
-
- * gui/search/e-addressbook-search-dialog.c
- (e_addressbook_search_dialog_init): Made the default window size
- slightly wider. (Bug #7516)
-
-2001-10-18 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card.c, backend/ebook/e-card.h
- (e_card_list_get_vcard): Made this take a const GList.
-
-2001-10-18 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (check_capabilities): Added. Check if our book is local or
- networked.
- (e_select_names_completion_book_ready): Call check_capabilities.
- (e_select_names_completion_new): Call check_capabilities.
- (e_select_names_completion_do_query): If we have a networked book,
- keep trying if we haven't been able to cache any cards --- our
- earlier attempts could have failed due to too many matches. (Bug
- #12932)
-
- * gui/component/select-names/e-select-names-manager.c
- (focus_out_cb): Lag our cardification on focus-out. This seems to
- help with the unintended cardifications that can result from the
- weird focus-out/focus-in events that get generated when the popup
- disappears.
-
- * backend/ebook/e-card-compare.c: Removed some debug spew.
-
-2001-10-17 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-config.c (addressbook_source_dialog):
- grab focus in the Account entry when preparing the dialog, fixes
- #10406.
-
-2001-10-17 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names.c (new_folder): make
- sure to also add "ldap-contacts" folders to the option menu.
-
-2001-10-17 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (ecard_from_remote_record): sync all
- the fields we can, with out overwriting
- (local_record_from_ecard): write the fields to the pilot in
- priority order unless there are fields on the pilot we can't
- store, then fill in the fields as they are on the pilot
-
-2001-10-17 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card.c (e_card_get_vobject): Did a bit of clean
- up here. Might fix some crashes, specifically Ximian bug #10164.
-
- * gui/widgets/e-addressbook-view.c (SPEC): Updated the model
- column numbers here. Fixes Ximian bug #12308.
-
-2001-10-17 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-file.c (pas_backend_file_upgrade_db):
- add upgrade from 0.1 to 0.2, where we make sure id dbt's match
- vcard id's, fixes longstanding bug (#7406) where cards were not
- modifiable or removable after having been created during a 1-2
- week long window in early betas.
- (PAS_BACKEND_FILE_VERSION): change to 0.2
- (PAS_ID_PREFIX): #define this here.
- (pas_backend_file_create_unique_id): use PAS_ID_PREFIX instead of
- the string.
-
-2001-10-16 Iain Holmes <iain@ximian.com>
-
- * backend/ebook/evolution-ldif-importer.c (support_format_fn): Return
- FALSE if no extension.
-
-2001-10-16 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-card.c (e_card_get_id): If card->id is NULL,
- return an empty string.
- (e_card_set_id): Don't allow the card id to be set to NULL; use
- the empty string instead.
- (e_card_get_vobject): When building our vcard, pass in the empty
- string as the id if card->id is NULL. (Bug #10164)
-
-2001-10-16 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (local_record_from_ecard): don't set
- the phone info if it is blank
- (ecard_from_remote_record): save up to 3 fax numbers
-
-2001-10-15 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_add_client):
- unref the book after we pass it off to evolution-addressbook.
-
-2001-10-15 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (create_card_dtor): unref
- op->view.
- (pas_backend_ldap_process_create_card): ref op->view.
- (remove_card_dtor): unref op->view.
- (pas_backend_ldap_process_remove_card): ref op->view.
- (modify_card_dtor): unref op->view.
- (pas_backend_ldap_process_modify_card): ref op->view.
- (ldap_search_dtor): unref op->view.
- (pas_backend_ldap_search): ref op->view.
-
-2001-10-15 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c
- (pas_backend_ldap_process_get_book_view): make sure to unref the
- book_view here so we don't leak them.
-
-2001-10-12 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-factory.c (main): call
- e_passwords_init and e_passwords_shutdown.
-
-2001-10-15 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card.c (addPropValueQP, addPropValueSets,
- e_card_get_vobject): Properly decide whether a property needs to
- be marked as QP by searching for '\n'. Fixes Ximian bug #3021.
-
-2001-10-15 Christopher James Lahey <clahey@ximian.com>
-
- * gui/contact-editor/e-contact-save-as.c (e_contact_save_as,
- e_contact_list_save_as): Set the default file name here. Fixes
- Ximian bug #7053.
-
-2001-10-14 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_hookup_shell_listeners): Added linebreaks to our
- "this shouldn't happen" dialog message. (Bug #12498)
-
-2001-10-12 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/addressbook-factory.c (main): Add a component name
- to the e_passwords_init() call.
-
-2001-10-12 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/evolution-ldif-importer.c: commit the importer
- originally from Michael M. Morrison, with fixups by toshok.
-
- * backend/ebook/Makefile.am (bin_PROGRAMS): add
- evolution-ldif-importer.
- (oaf_in_files): add
- GNOME_Evolution_Addressbook_LDIF_Importer.oaf.in.
-
- * backend/ebook/e-card-simple.h: add WANTS_HTML and IS_LIST.
-
- * backend/ebook/e-card-simple.c (field_data): add WANTS_HTML and
- IS_LIST.
- (e_card_simple_set): fix typo.
-
- * backend/ebook/.cvsignore: ignore
- GNOME_Evolution_Addressbook_LDIF_Importer.oaf and
- evolution-ldif-importer.
-
- * backend/ebook/GNOME_Evolution_Addressbook_LDIF_Importer.oaf.in:
- ldif importer oafinfo.
-
-2001-10-12 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card-simple.c, backend/ebook/e-card-simple.h:
- Added a boolean type here.
-
-2001-10-12 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (addressbook_model_set_uri): Check to see if the uri we are
- setting is the same as the current uri. If so, do nothing.
- (Bug #11324)
-
-2001-10-11 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-destination.c
- (e_destination_reverting_is_a_good_idea): Added. Heuristic for
- whether or not we want to revert to an earlier cardified state.
- (e_destination_cardify): Don't be quite as aggressive about
- reverting to previous cardified states. (Bug #11890)
-
-2001-10-11 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card-simple.c (e_card_simple_destroy,
- fill_in_info, e_card_simple_sync_card, e_card_simple_set_phone,
- e_card_simple_set_address, e_card_simple_set_delivery_address,
- file_as_get_style, file_as_set_style, e_card_simple_set,
- e_card_simple_set_arbitrary),
- gui/contact-editor/e-contact-editor-address.c
- (e_contact_editor_address_destroy,
- e_contact_editor_address_set_arg,
- e_contact_editor_address_get_arg),
- gui/contact-editor/e-contact-editor-fullname.c
- (e_contact_editor_fullname_destroy,
- e_contact_editor_fullname_set_arg,
- e_contact_editor_fullname_get_arg),
- gui/contact-editor/e-contact-editor.c (phone_entry_changed,
- address_text_changed, name_entry_changed, full_name_clicked,
- full_addr_clicked, fill_in_info): Changed these to use the new ref
- and unref functions for ECard auxillary types.
-
- * backend/ebook/e-card-simple.h: Added a comment.
-
- * backend/ebook/e-card-types.h: Added ref_count field to all the
- types.
-
- * backend/ebook/e-card.c, backend/ebook/e-card.h: Added ref and
- unref functions here for all the ECard auxillary types. Removed
- the corresponding free functions. Switched to using these
- functions where appropriate.
-
- * gui/component/addressbook-factory.c: #include
- <e-util/e-passwords.h>
-
- * gui/component/addressbook.c (load_uri_cb): const correctify.
-
- * gui/component/select-names/e-select-names-manager.c,
- gui/component/select-names/e-select-names.c: #include
- <addressbook/gui/component/addressbook.h>
-
- * gui/widgets/e-addressbook-model.c (modify_card): Removed an
- unnecessary ref here.
-
-2001-10-11 Dan Winship <danw@ximian.com>
-
- * gui/component/select-names/e-select-names.c (update_folder):
- Don't need this any more.
-
-2001-10-11 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/addressbook.c (new_contact_cb): Check that
- view->view != NULL.
- (save_contact_cb): Check that view->view != NULL.
- (search_cb): Check that view->view != NULL.
- (delete_contact_cb): Check that view->view != NULL.
- (print_cb): Check that view->view != NULL.
- (print_preview_cb): Check that view->view != NULL.
- (stop_loading_cb): Check that view->view != NULL.
- (cut_contacts_cb): Check that view->view != NULL.
- (copy_contacts_cb): Check that view->view != NULL.
- (paste_contacts_cb): Check that view->view != NULL.
- (select_all_contacts_cb): Check that view->view != NULL.
- (send_contact_cb): Check that view->view != NULL.
- (send_contact_to_cb): Check that view->view != NULL.
- (update_command_state): Check that view->view != NULL. Hold a
- reference to the AddressbookView for the duration of the function,
- in case we exit during bonobo-reentrancy.
- (addressbook_view_ref): Added.
- (addressbook_view_unref): Added. Simple ref counting for
- AddressbookView objects.
- (addressbook_view_clear): Zero out an AddressbookView. This is
- now separated from the deallocation of the AddressbookView object,
- so that we don't leave a dangling pointer if we exit during
- bonobo-reentrancy in update_command_state. (Which often seems to
- happen if we exit while addressbook operations are going on.)
- (destroy_callback): Replace previous call to addressbook_view_free
- with addressbook_view_clear/addressbook_view_unref calls.
- (addressbook_factory_new_control): Initialize the reference count
- in the AddressbookView object.
-
- * gui/widgets/e-addressbook-view.c (e_addressbook_view_destroy):
- Carefully zero out our destroyed object.
- (command_state_change): Hold a reference to ourselves during the
- signal emission.
- (get_selected_cards): Ref cards as we add them to the list.
- (e_addressbook_view_stop): Check for view != NULL.
- (e_addressbook_view_can_create): Check for view != NULL.
- (e_addressbook_view_can_print): Check for view != NULL.
- (e_addressbook_view_can_save_as): Check for view != NULL.
- (e_addressbook_view_can_send): Check for view != NULL.
- (e_addressbook_view_can_send_to): Check for view != NULL.
- (e_addressbook_view_can_delete): Check for view != NULL.
- (e_addressbook_view_can_cut): Check for view != NULL.
- (e_addressbook_view_can_copy): Check for view != NULL.
- (e_addressbook_view_can_paste): Check for view != NULL.
- (e_addressbook_view_can_select_all): Check for view != NULL.
- (e_addressbook_view_can_stop): Check for view != NULL.
-
- * gui/widgets/e-addressbook-model.c (addressbook_destroy): Be
- careful about zeroing out our destroyed object.
-
- * backend/ebook/e-book-view.c (e_book_view_stop): Added. Stops
- event processing in the underlying listener.
-
-2001-10-10 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_destroy): If our select names dialog is
- still around, destroy it. Otherwise, the dialog will hang around
- after our composer goes away.
-
-2001-10-06 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-config.glade: add an Email Address
- field/label/help text.
-
- * gui/component/addressbook-config.c
- (addressbook_source_dialog_set_source): fill in the email entry
- from the source. also, set the initial state of the email
- label/entry.
- (auth_checkbutton_changed): set the email label/entry
- sensitive/editable if auth is turned on, and
- insensitive/uneditable if it's off.
- (addressbook_source_dialog_get_source): get the email address from
- the email entry.
- (addressbook_source_dialog): hook up the email entry to the
- changed signal foo, as well as the focus handler for displaying
- help text.
-
-2001-10-06 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_new): db isn't a BonoboObject, so don't
- bonobo_object_unref it!
-
-2001-10-05 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (addressbook_model_set_uri): e_book_load_uri ->
- addressbook_load_uri.
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_new): e_book_load_uri ->
- addressbook_load_uri.
-
- * gui/component/addressbook.c (forget_passwords_cb): new function,
- call e_passwords_forget_passwords.
- (verbs): Add ContactsForgetPasswords.
- (load_uri_auth_cb): new function, call the callback and free up
- our closure stuff.
- (load_uri_cb): once the uri is loaded, check if we're configured
- to authenticate for it, and do so, using the e_passwords stuff.
- (addressbook_load_uri): wrapper around e_book_load_uri. save off
- the parameters and start the load-with-auth machinery.
- (book_open_cb): remove all the auth stuff from here, as it's
- handled elsewhere now.
-
- * gui/component/addressbook-factory.c (main): call
- e_passwords_init.
-
- * gui/component/addressbook-component.c (user_create_new_item_cb):
- e_book_load_uri -> addressbook_load_uri.
- (destination_folder_handle_drop): same.
-
- * gui/component/addressbook.h: add prototype for
- addressbook_load_uri (a wrapper around e_book_load_uri that also
- handles authentication if the user selects it.)
-
-2001-10-05 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (real_add_address_cb): Check to make sure our call to
- e_addressbook_model_get_card doesn't return NULL.
-
- * gui/widgets/e-addressbook-model.c
- (e_addressbook_model_get_card): Chek that we aren't requesting a
- negative row.
-
- * gui/contact-list-editor/e-contact-list-editor.c (add_email_cb):
- Move to the bottom of the scrolled window, so we can see the
- address we just added.
- (table_drag_data_received_cb): Move to the bottom of the scrolled
- window, so we can see the contact we just dropped.
-
- * gui/component/addressbook.c (addressbook_factory_new_control):
- We don't own the string returned by e_categories_master_list_nth,
- so terrible things will happen if we free it. (Bug 10916)
-
-2001-10-05 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (e_addressbook_view_set_arg):
- don't set the editable field on the model - let the book do that.
- (book_writable_cb): call writable_status to propagate a ui-change
- event up (and sensitize the write-only toolbar buttons after you
- authenticate with ldap.)
-
-2001-10-04 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book.c (activate_factories_for_uri): for some
- reason, matching on protocol is causing problems for me.
- disabling it for now.
-
-2001-10-04 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-component.c: use ldap.png for ldap
- contacts.
-
-2001-10-03 Iain Holmes <iain@ximian.com>
-
- * addressbook/gui/component/addressbook-storage.c
- (addressbook_storage_setup): Only load_storages if you have LDAP.
- (load_source_data): Only do stuff if you have LDAP.
-
-2001-10-03 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-reflow-adapter.c (addressbook_height),
- gui/widgets/e-minicard.c (remodel): Fixed these to determine the
- fields to use properly.
-
-2001-10-02 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (name_style_query): Strip out commas before forming our query.
- (match_name): Use e_card_compare_name_to_string_full, rather
- than our crufty old matching code. Not only is this cleaner,
- but that crufty old code was very broken when it came to
- handling strings with whitespace. (Bug 8988)
- (match_nickname): utf8 and bug fixes.
-
- * backend/ebook/e-card-compare.c
- (e_card_compare_name_to_string_full): Added. This is basically
- e_card_compare_name_to_string with a bunch of extra options, so
- that it can more readily be reused in other contexts.
- (e_card_compare_name_to_string): This is now just a call to
- e_card_compare_name_to_string_full with the extra args filled in
- to defaults that simulate the old behavior.
-
-2001-10-02 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book.c (e_book_construct): remove most of the
- oaf stuff from here. we do it in load_uri, where we'll have more
- information (namely, the protocol we're using.)
- (activate_factories_for_uri): do an oaf query to get a list of all
- objects implementing our BookFactory interface and also supporting
- the protocol used in the uri.
- (e_book_load_uri): try activating book factories to handle this
- uri, and start the iteration over the list.
- (e_book_load_uri_from_factory): try and load the uri.
- (e_book_load_uri_open_cb): callback function for the
- BookFactory_openBook call - if it succeeds, call the user's
- callback. otherwise step to the next factory.
- (e_book_load_uri_step): go to the next factory in our list, and
- error out if there are no more.
-
-2001-10-02 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names-model.c
- (e_select_names_model_get_textification): Made the max length of
- the textification be 2047 characters. Fixes Ximian bug #3021.
-
-2001-10-01 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (ecard_from_remote_record): if there
- was no first name or last name, file as the company.
-
-2001-10-01 JP Rosevear <jpr@ximian.com>
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_changes_foreach_key): if there is a db error,
- assume deletion
- (pas_backend_file_changes): write after all is done for efficiency
-
-2001-09-28 JP Rosevear <jpr@ximian.com>
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_changes_foreach_key): g_strdup
- (pas_backend_file_changes): ditto, make sure to free all data and
- do a hash write after each add/remove
-
- * conduit/address-conduit.c (local_record_to_pilot_record): use
- the local record category
- (local_record_from_ecard): ndle the fields and category we don't
- sync by making sure we don't overwrite them
-
-2001-09-27 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book.c (e_book_construct): do an oaf query to
- get a list of all objects implementing our BookFactory interface,
- instead of just activating the one IID. this should really be a
- global list, not a per EBook.
- (e_book_load_uri): start the iteration over our list of
- BookFactory's.
- (e_book_load_uri_from_factory): try and load the uri.
- (e_book_load_uri_open_cb): callback function for the
- BookFactory_openBook call - if it succeeds, call the user's
- callback. otherwise step to the next factory.
- (e_book_load_uri_step): go to the next factory in our list, and
- error out if there are no more.
-
-2001-09-27 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (local_record_from_ecard): use the old
- record (if there was one) so as not to overwrite fields we don't
- sync
- (pre_sync): store the dbi in the context and don't make it object
- data
-
-2001-09-26 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-book-factory.c (pas_book_factory_destroy): use
- priv->iid instead of the hardcoded string here.
- (pas_book_factory_activate): parameterize the factory's iid, as in
- the calendar server, and provide a default if iid == NULL.
-
- * backend/pas/pas-book-factory.h: add iid parameter for
- pas_book_factory_activate.
-
-2001-09-26 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-destination.c (e_destination_get_textrep): Use
- camel_address_format, not camel_address_encode.
-
-2001-09-26 Anna Marie Dirks <anna@ximian.com>
-
- * gui/contact-editor/contact-editor.glade: Added help text (thanks
- to Aaron) and re-worded the labels, and fixed the shortcuts on the
- brand-spanking-new Collaboration tab.
-
-
-2001-09-26 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-manager.h: add
- completion_book.
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_new): get /Addressbook/Completion/uri, and
- if it's present, use the corresponding EBook for completing
- addresses.
- (focus_out_cb): use manager->completion_book here instead of NULL,
- which corresponds to the local addressbook.
- (completion_popup_cb): same.
- (e_select_names_manager_create_entry): same.
-
-2001-09-26 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-card-compare.c (e_card_compare_name_to_string):
- Properly handle names when the individual elements (given,
- addition, family) contain whitespace. (Bug #10502)
-
- * backend/ebook/e-destination.c (e_destination_set_name): Reset
- textrep when we change the name.
- (e_destination_set_email): Reset textrep when we change the email.
- (e_destination_get_textrep): Make sure that the textrep version of
- the address is properly quoted if it contains unsafe characters.
- (All related to bug #10796)
-
- * gui/component/select-names/e-select-names-completion.c
- (match_nickname): Fix nickname matching. (bug #9698)
- (make_match): Use e_completion_match_new when building our match,
- rather than ad hoc manipulation of the struct.
-
-2001-09-26 JP Rosevear <jpr@ximian.com>
-
- * backend/pas/pas-backend-file.c (pas_backend_file_changes): set
- the last_use and use_score fields of the card to known values so
- the card doesn't register as changed when only they have changed
-
-2001-09-26 Peter Williams <peterw@ximian.com>
-
- * conduit/address-conduit.c (ecard_from_remote_record): Fix this function
- to set email addresses properly, and handle multiple occurrences of
- email addresses, home phone numbers, and business phone numbers.
-
-2001-09-25 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/addressbook-component.c (user_create_new_item_cb):
- Handle creating the new contact in the current folder if it's a
- contacts folder. Fixes Ximian bug #7814.
-
-2001-09-24 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/Makefile.am (LDAP_SCHEMA): add
- evolutionperson.schema
- (EXTRA_DIST): add LDAP_SCHEMA to the dist (but don't install it).
-
-2001-09-23 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (ecard_from_remote_record): sync the
- note the to pilot and make sure to blank fields when appropriate
- (local_record_from_ecard): sync the note to the desktop
-
-2001-09-22 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-file.c (do_create): g_free (id) in the
- error case to plug a memory leak.
-
-2001-09-22 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-minicard.c (remodel): when creating the cards,
- don't display any of the subname fields (surname, given, middle,
- suffix, etc.)
-
-2001-09-22 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-card-simple.c
- (e_card_simple_get): add getters for the additional name fields.
- (field_data): move FAMILY_NAME to the end of the list, and add
- GIVEN_NAME, ADDITIONAL_NAME (middle name), and NAME_SUFFIX.
-
- * backend/ebook/e-card-simple.h: same.
-
-2001-09-21 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/addressbook.c (print_preview_cb): Hooked up print
- preview button.
-
- * gui/widgets/e-addressbook-view.c,
- gui/widgets/e-addressbook-view.h
- (e_addressbook_view_print_preview): Added this function.
-
- * printing/e-contact-print.c, printing/e-contact-print.h
- (e_contact_print_preview): Added this function.
-
-2001-09-19 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-destination.c (name_and_email_simple_query_cb):
- Use the default e-mail address if we have nothing else to go on.
- Previously we just failed, which basically meant that name-only
- searches would never work properly.
- (nickname_simple_query_cb): The logic was a bit tangled here; if
- our query status isn't SUCCESS, always give up but don't leak the
- destination. And if our nickname query fails and we try the
- name-and-email query, use the textrep for a name-only search. The
- only reason we are doing a nickname query in the first place is if
- we have an obviously invalid e-mail.
- (launch_cardify_query): Use e_destination_is_valid to determine
- if we should try a nickname query first.
- These changes basically fix bug 7728, and generally make the
- auto-cardification of addresses a lot more clever and robust.
-
- * backend/ebook/e-book-util.c (name_and_email_cb): Use
- e_card_compare_name_to_string instead of e_card_name_match_string.
- (e_book_name_and_email_query): The arguments to g_strsplit were
- in the wrong order. Doh!
-
- * backend/ebook/e-card-compare.c (e_card_compare_name_to_string):
- Added. Replaces e_card_name_match_string, and actually works.
-
- * backend/ebook/e-card.c: Removed e_card_name_match_string
- function, which didn't work particularly well.
-
-2001-09-19 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (cursor_cb): don't add to the complete
- list of cards if the card is a list
- (card_added): don't add to the list of changes if the card is a
- list
- (card_changed): ditto
- (card_removed): ditto
-
-2001-09-19 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_hookup_shell_listeners): Change the "this should
- never happen" message into a request for people to e-mail me
- directly with info if they encounter that error.
-
- * backend/ebook/e-book-util.c (e_book_name_and_email_query):
- Freeing name[i] instead of namev[i] is a bad idea. (bug #10270)
-
- * gui/component/select-names/e-select-names-popup.c
- (popup_menu_card): Properly handle our GnomeUIInfo labels so that
- they won't be leaked if they are dynamic strings, so that they
- will be i18n-correct, and so that underscores won't be interpreted
- as key accelerators. What a PITA. Also, don't leak our
- iterators. (Bug #10200.)
- (popup_menu_list): The same GnomeUIInfo tweaking as in
- popup_menu_card.
- (popup_menu_nocard): Ditto.
-
-2001-09-18 JP Rosevear <jpr@ximian.com>
-
- * backend/ebook/e-card-simple.c (field_data): add caluri field data
-
- * backend/ebook/e-card.c (e_card_get_vobject): add the caluri
- property when appropriate
- (parse_caluri): handle read caluri
- (e_card_class_init): add caluri arg
- (e_card_destroy): free the caluri
- (e_card_get_arg): return caluri arg
- (e_card_set_arg): set caluri from arg
- (e_card_init): init caluri to null
-
- * backend/ebook/e-card-simple.h: new simple field
-
- * backend/ebook/e-card.h: new member
-
- * gui/contact-editor/e-contact-editor.c (field_changed): util
- callback to change the command state
- (set_entry_changed_signal_field): hook up a change signal to above
- (set_entry_changed_signals): use above function
-
- * gui/contact-editor/e-contact-editor.glade: Add collaboration
- page and fields
-
-2001-09-18 JP Rosevear <jpr@ximian.com>
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_build_cards_list): create a sexp and check if
- the cards match before adding them to the list
- (pas_backend_file_process_get_cursor): send extra param
-
-2001-09-18 Larry Ewing <lewing@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (book_query_process_card_list): unref the destination regardless
- of whether we get an email addresss.
-
-2001-09-17 Larry Ewing <lewing@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (name_style_query): use g_strfreev.
- (match_name): s/g_free/g_strfreev.
- (match_file_as): s/g_free/g_strfreev.
-
- * backend/ebook/e-book-util.c (e_book_name_and_email_query): fix
- the memory handling here. All there members of the vector need to
- be freed all the time.
-
- * backend/ebook/load-pine-addressbook.c (parse_line): free the
- string outside of the test that makes sure there are three
- entries.
-
- * gui/component/select-names/e-select-names-completion.c
- (match_nickname): don't malloc a match we will never use.
-
- * gui/widgets/e-addressbook-model.c (get_view): free the dup'd
- capabilities.
-
-2001-09-17 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-destination.c (e_destination_is_valid): We want
- to assume that a destination that comes from a card is
- automatically valid, but the right way to check that is by calling
- e_destination_from_card, not by checking if dest->priv->card !=
- NULL. (Fixed bug #10017)
-
- * gui/component/select-names/e-select-names-completion.c
- (match_name): Fixed a stupid bug was causing completion to fail
- for contacts who have only one name. (The classic example we all
- know and love is 'George <jirka@5z.com>') (bug #8353)
-
- * backend/ebook/e-card.c (e_card_list_send): Do the right thing if
- the card we are trying to send to has no valid e-mail addresses.
- (bug #10137)
-
- * gui/widgets/e-minicard.c (e_minicard_event): Code implicitly
- assumed that event->button.button is 1, 2, or 3, causing disaster
- when using a wheel-mouse. Fixed. (bug #9400)
-
-2001-09-16 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c (_phone_arrow_pressed):
- use enable_widget instead of gtk_widget_set_sensitive.
- (_email_arrow_pressed): same.
- (_address_arrow_pressed): same.
- (disable_widget_foreach): same.
- (enable_writable_fields): same.
- (set_editable): same.
- (enable_widget): new function, using both gtk_widget_set_sensitive
- and *_set_editable to allow the user to select text in GtkEntry's
- and GtkText's.
-
- * gui/contact-editor/e-contact-editor-fullname.c
- (e_contact_editor_fullname_set_arg): use set_editable as well as
- set_sensitive, to allow the user to select text in GtkEntry's.
-
- * gui/contact-editor/e-contact-editor-address.c
- (e_contact_editor_address_set_arg): same.
-
-2001-09-16 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/evolutionperson.schema: fix syntax errors (which are
- broken, imo...)
-
-2001-09-16 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-storage.h: reorder the LDAP scopes so
- that they match the order of the option menus in the glade file.
-
- * gui/component/addressbook-config.c (auth_checkbutton_changed):
- new function, mostly there to house some #ifdef'ed out code.
- (option_menuitem_activated): new function, to keep track of
- changes to the ldap scope optionmenu.
- (addressbook_source_dialog_set_source): set the menu history as
- well as the dialog's copy of the scope.
- (addressbook_source_dialog_get_source): fill in the source's scope
- from the dialog's copy, and add more #if the_ui_gods_smile_on_me
- code.
- (add_activate_cb): new function, add an activate callback for the
- optionmenu's items.
- (addressbook_source_dialog): more #if the_ui_gods_smile_on_me
- code, always start the dialog on page 0, and hook up the
- scope optionmenu's items.
-
-2001-09-15 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-card-compare.c (e_card_compare_name): No
- loose name matches on family names. (#8802)
-
- * gui/component/select-names/e-select-names-text-model.c
- (e_select_names_text_model_activate_obj): We can't use NULL as the
- first arg for e_addressbook_show_contact_editor anymore. Damn.
- (#8535)
-
- * backend/ebook/e-book-listener.c (e_book_listener_stop): Make
- "stop" do nothing but set the stopped flag, as in
- e-book-view-listener.c.
- (e_book_listener_destroy): Clean up our queue here, rather than in
- e_book_listener_stop.
- (response_free): Added. Move the rather lengthy bit of code
- needed to free a EBookListenerResponse into one place.
- (e_book_listener_check_queue): Properly deal with the stopped
- flag.
- (e_book_listener_queue_response): If the stopped flag is set, just
- drop the incoming response.
-
- * backend/ebook/e-book-view-listener.c
- (e_book_view_listener_stop): Make "stop" do nothing but set the
- stopped flag.
- (e_book_view_listener_destroy): Move all of the clean-up that used
- to be in e_book_view_listener_stop here. This considerably simplifies
- the logic required to avoid various race conditions.
- (e_book_view_listener_check_queue): Properly deal with the stopped flag.
- (e_book_view_listener_queue_response): Drop all incoming responses if
- we are stopped.
-
-2001-09-14 Jon Trowbridge <trow@ximian.com>
-
- * backend/pas/pas-book.c (pas_book_queue_request): Hold a
- reference to the book on behalf of our idle function.
- (pas_book_check_queue): When we are finished, drop the reference
- we've been holding on behalf of the idle function.
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_process_create_card): Hold a reference to the
- book_view while sending our notifications.
- (pas_backend_file_process_remove_card): Hold a reference to the
- book_view while sending our notifications.
-
- * gui/contact-editor/e-contact-quick-add.c (quick_add_unref): Remove
- debugging spew.
-
- * backend/ebook/e-book-util.c: Remove a lot of unused code that
- worked around bugs that have long since been fixed.
- (simple_query_disconnect): Added. Breaks out the part of
- simple_query_free that disconnect signals.
- (simple_query_free): Replace code w/ a call to
- simple_query_disconnect.
- (simple_query_sequence_complete_cb): Call simple_query_disconnect
- before executing the callback, so that our callbacks don't get
- triggered by any book changes that might occur during that
- callback.
-
- * backend/ebook/e-book-view-listener.c
- (e_book_view_listener_check_queue): Changed to be consistent with
- e_book_listener_check_queue.
- (e_book_view_listener_queue_response): Also changed to use a
- high-frequency timeout.
-
- * backend/ebook/e-book-listener.c (e_book_listener_check_queue):
- OK, I've agonized over this stupid little function, and it should
- now be race-free.
- (e_book_listener_queue_response): We process our response queue in
- a high-frequency timeout rather than an idle. Using an idle
- function leads to some tricky race conditions and bad interactions
- with bonobo's semi-broken attempts to take over event processing.
- (e_book_view_listener_stop): Manually disable our timeout and
- clean up.
-
-2001-09-14 Ettore Perazzoli <ettore@ximian.com>
-
- [Automake 1.5 fixes pointed out by Richard Boulton
- <richard@tartarus.org>, as per #9258.]
-
- * gui/component/select-names/Makefile.am: Set CLEANFILES directly
- instead of using `+='.
-
- * backend/pas/Makefile.am: Rename `LDAP_BACKEND_SOURCES' to
- `LDAP_BACKEND_FILES'.
-
- * backend/ebook/Makefile.am: Set CLEANFILES directly instead of
- using `+='.
-
-2001-09-13 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_connect): use
- ldap_init. ldap_open is deprecated in openldap 2.x.
-
-2001-09-12 Iain Holmes <iain@ximian.com>
-
- * backends/ebook/evolution-vcard-importer.c (check_file_is_vcard):
- Fix the check.
-
-2001-09-12 Larry Ewing <lewing@ximian.com>
-
- * backend/ebook/e-destination.c: free the values that are being
- leaked here.
-
-2001-09-12 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c (match_email):
- printf arguments were reversed by mistake. Fixed bug #9693.
-
-2001-09-09 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-popup.c
- (popup_menu_list): Added. Treat right-clicks on a contact list as
- a special case.
- (e_select_names_popup): Check if we are dealing with a contact
- list.
-
- * backend/ebook/e-book-view-listener.c
- (e_book_view_listener_check_queue): See
- e_book_listener_check_queue below.
- (e_book_view_listener_queue_response): See
- e_book_listener_queue_response below.
-
- * backend/ebook/e-book-listener.c (e_book_listener_check_queue):
- Explicitly prohibit reentrancy. Use gtk-unref rather than
- bobobo-unref.
- (e_book_listener_queue_response): Hold a gtk-ref to the listener
- while the idle function runs, not a bonobo-ref. As far as I can
- tell, it is impossible to avoid a race condition here when we have
- to worry about bonobo reentrancy.
-
- * gui/component/select-names/e-select-names-text-model.c
- (e_select_names_text_model_insert_length): Alter a copy of the
- original EDestination, rather than just using a new one. We need
- to do this to preserve prior-card information for possible
- reversion later.
- (e_select_names_text_model_delete): Ditto.
-
- * backend/ebook/e-destination.c (e_destination_clear_card): When
- clearing a destination where ->card != NULL, store it for possible
- reversion later.
- (e_destination_revert): If we have an old card stored, go back to
- using it for the destination.
- (e_destination_is_valid): Tries to detect obviously broken
- addresses.
- (e_destination_cardify): If our destination is invalid, first try
- to cardify simply by reverting to an older card.
- (e_destination_destroy): Unref any cached old card.
- (e_destination_copy): Copy the old card information.
-
-2001-09-07 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (sync_table_and_models): Show all rows in the table, and then
- remove the rows that correspond to entries in the
- ESelectNamesModels in the children.
- (real_add_address): Freeze/thaw our ESelectNamesModel, so that we
- don't change our table while we are in the middle of iterating
- over the selection.
- (remove_address): Just delete the address from the
- ESelectNamesModel, the signal handler will do the rest.
- (selected_rows_foreach_cb): Call remove_address to do our dirty
- work.
- (e_select_names_add_section): Connect to the 'changed' signal from
- the ESelectNamesModel, and call sync_table_and_models explicitly to
- get our initial state correct.
-
- * gui/component/select-names/e-select-names-table-model.c
- (fill_in_info): Deal with EDestinations in our table that don't
- come from cards.
-
- * gui/component/select-names/e-select-names-manager.c: Added
- another ESelectNamesModel* to the ESelectNamesManagerSection
- struct. Called 'original_model', this contains a copy of the
- model as it is when we begin using the SelectNames dialog.
- (section_copy): Copy the original model.
- (section_free): Free the original model.
- (e_select_names_manager_add_section_with_limit): Initialize the
- original model.
- (e_select_names_clicked): I've changed the semantics of this
- dialog quite a bit... no UI freeze can stop me! If OK is clicked,
- we do nothing. If Cancel is clicked, we revert to the
- 'original_model' copy of our address entry state before we started
- editting. Finally, we close the dialog before any of thing. Doing
- it last caused problems, because signals were being triggered
- which had dangling pointers as their closures.
- (e_select_names_manager_activate_dialog): Copy our current state
- to the original model, and share the same ESelectNamesModel
- between the dialog and the address entry in the composer..
- (e_select_names_manager_get_cards): Removed. It had been
- #if 0/#endif-ed out for a while.
-
- * gui/component/select-names/e-select-names-model.c
- (e_select_names_model_freeze): Added.
- (e_select_names_model_thaw): Added.
- (e_select_names_model_uncardify): Added. If possible,
- "uncardifies" a specific model entry.
- (e_select_names_model_changed): Changed to pay attention
- to the freeze count.
-
- * gui/component/select-names/e-select-names-completion.c
- (clean_query_text): Strip leading/trailing whitespace from
- queries.
-
- * backend/ebook/e-destination.c (e_destination_uncardify): Added.
- Converts a card-associated destination into a text-associated
- destination w/ the e-mail address.
- (e_destination_list_to_vector): Added. A convenience routine.
- (e_destination_freev): Added. A convenience routine.
- (e_destination_touchv): Added. I'm lazy.
-
-2001-09-08 Chris Toshok <toshok@ximian.com>
-
- (make_contact_editor_cb): show the right contact editor (the list
- editor for list cards).
-
-2001-09-08 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-popup.c
- (popup_menu_card): do the EDestination xml magic on email
- addresses we put in the popup.
-
-2001-08-27 Zbigniew Chyla <cyba@gnome.pl>
-
- * gui/component/addressbook.c (addressbook_factory_new_control):
- For every category:
- - set .translate to FALSE (e_categories_master_list_nth returns
- translated category name)
- - convert category name in UTF-8 to locale's encoding
-
-2001-08-23 Zbigniew Chyla <cyba@gnome.pl>
-
- * gui/component/select-names/e-select-names-popup.c
- (popup_menu_card): Fixed two bugs:
- - missing coversion of contact name to GTK+ locale,
- - passing dynamically created string (contact name) inside uiinfo struct
- to gnome-app-helper functions.
- Remember: these functions may change strings, trying to translate them!
- (popup_menu_nocard): Ditto
-
-2001-09-07 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/addressbook-component.c: Removed unused factory
- variable.
-
-2001-09-06 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-storage.c (notify_listener): new
- function, notify the bonobo listener.
- (remove_ldap_folder): track change to EvolutionStorage signal.
- (create_ldap_folder): same, and make sure the type is
- "ldap-contacts".
- (load_source_data): folders that we create should have
- "ldap-contacts" as their type.
- (addressbook_storage_add_source): same.
-
- * gui/component/addressbook-component.c: (folder_types): add
- "ldap-contacts", for display of ldap servers (they get their own
- icon, and their own name in the Create New Folder dialog.
- (create_view): use IS_CONTACT_TYPE since we support two folder
- types now.
- (create_folder): same.
- (remove_folder): same.
- (xfer_folder): same.
-
-2001-09-06 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c: (pixmaps): change
- /Toolbar/ContactEditorSave to /Toolbar/ContactEditorSaveClose.
-
-2001-09-06 Chris Toshok <toshok@ximian.com>
-
- * gui/component/Makefile.am (INCLUDES): add -DEVOLUTION_IMAGESDIR.
-
- * gui/widgets/e-addressbook-view.c (card_deleted_cb): remove
- status messages from here.
- (e_addressbook_view_delete_selection): same.
-
- * gui/widgets/e-addressbook-model.c (sequence_complete): emit a
- NULL status message along with the stop_state_changed. The null
- status message will clear the status bar for this view.
-
- * gui/component/addressbook.c (set_status_message): use the
- EvolutionActivityClient stuff.
-
- * backend/pas/pas-backend-ldap.c (view_destroy): remove status
- message for abandoning a search.
- (ldap_op_process_current): wrap status messages in _().
- (ldap_op_process): same.
- (create_card_handler): same, and remove the notify_status for ""
- and add a notify_complete call after the card is added.
- (remove_card_handler): same.
- (modify_card_handler): same.
- (poll_ldap): wrap status messages with _(), and remove the "Search
- Complete" message.
- (ldap_search_handler): wrap status message.
-
- * backend/pas/pas-backend-file.c (pas_backend_file_search): use
- _() on status messages, and make sure the last notify_* called is
- notify_complete.
-
-2001-09-05 Ettore Perazzoli <ettore@ximian.com>
-
- [Fix #958, ShellComponents should not be created by factories, for
- the addressbook.]
-
- * gui/component/addressbook-component.c
- (GNOME_EVOLUTION_ADDRESSBOOK_COMPONENT_FACTORY_ID): Removed.
- (GNOME_EVOLUTION_ADDRESSBOOK_COMPONENT_ID): New.
- (create_component): Renamed from `factory_fn'. Just register the
- thing on OAF.
- (addressbook_component_factory_init): Just call it.
-
- * gui/component/GNOME_Evolution_Addressbook.oaf.in: Remove the
- ShellComponentFactory.
-
-2001-09-04 Iain Holmes <iain@ximian.com>
-
- * backend/ebook/evolution-vcard-importer.c (load_file_fn): Return FALSE
- if the file isn't a valid VCard file.
-
-2001-08-05 Zbigniew Chyla <cyba@gnome.pl>
-
- I18n fixes (mainly making buttons on the right side less Anglocentric :-)
-
- * backend/ebook/e-card-simple.c
- (field_data): Marked "name" and "short_name" fields for translation.
- (e_card_simple_get_name, e_card_simple_get_short_name): Return
- localized version of the name (using U_() macro).
-
- * gui/contact-editor/e-contact-editor.c (set_entry_changed_signals):
- Connect "changed" signal from "entry-web" entry to widget_changed.
- (changing this field wasn't making "Save and Close" button sensitive)
-
- * gui/widgets/Makefile.am (glade_DATA): Removed alphabet.glade.
-
- * gui/widgets/e-addressbook-view.c
- (button_labels, button_letters): New strings containing a list of
- labels and "values" of all buttons placed on the right side of the
- addressbook view (intended for localization).
- (struct LetterClosure): Changed the type of letter field to gunichar.
- (e_utf8_split): New function, similar to g_strsplit, but operates on
- UTF-8 strings.
- (jump_to_letter): Don't hardcode letters, build queries dynamically
- using UTF-8 and localized letters stored in button_letters.
- (connect_button): Removed.
- (create_alphabet): Don't use glade file, build buttons manually using
- (localized) labels from button_labels. Use (localized) values from
- button_letters when creating LetterClosure.
-
- * gui/widgets/e-minicard-view-widget.[ch]
- (e_minicard_view_widget_jump_to_letter): Changed the type of the
- second argument from char to gunichar.
-
- * gui/widgets/e-minicard-view.c
- (compare_to_utf_str): Renamed from compare_to_letter, now operates on
- UTF-8 string.
- (e_minicard_view_jump_to_letter): Changed the type of the second
- argument from char to gunichar + conversion to UTF-8 string.
-
- * gui/widgets/e-minicard-view.h
- (e_minicard_view_jump_to_letter): Changed the type of the second
- argument from char to gunichar.
-
-2001-09-02 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-book.c (e_book_add_card, e_book_commit_card),
- backend/pas/pas-backend-file.c (do_create),
- backend/pas/pas-backend-ldap.c
- (create_card_handler, remove_card_handler, modify_card_handler,
- pas_backend_ldap_process_get_vcard, poll_ldap): Use
- e_card_get_vcard_assume_utf8 instead of e_card_get_vcard here
- since all internal communications and database storage are assumed
- to be utf8.
-
- * backend/ebook/e-card-simple.c, backend/ebook/e-card-simple.h
- (e_card_simple_duplicate): Simplified this function considerably.
- (e_card_simple_get_vcard_assume_utf8): Added this function.
-
- * backend/ebook/e-card.c, backend/ebook/e-card.h (e_card_new,
- e_card_load_cards_from_file, e_card_load_cards_from_string): Made
- these functions pay attention to charset attributes.
- (e_card_new_with_default_charset,
- e_card_load_cards_from_file_with_default_charset,
- e_card_load_cards_from_string_with_default_charset): New functions
- that let you change the default charset from UTF-8.
- (e_card_get_vcard): Made this write out charset attributes when
- necessary.
- (e_card_get_vcard_assume_utf8): New function that writes out a
- card without writing out charset attributes.
-
- * backend/ebook/evolution-vcard-importer.c (book_open_cb),
- backend/ebook/load-gnomecard-addressbook.c (book_open_cb),
- backend/ebook/test-card.c (main),
- gui/component/addressbook-component.c
- (destination_folder_handle_drop), gui/contact-editor/test-editor.c
- (main), gui/contact-list-editor/e-contact-list-editor.c
- (table_drag_data_received_cb), gui/widgets/e-addressbook-view.c
- (selection_received), gui/widgets/e-minicard-control.c
- (pstream_load): Changed the default charset to be used here to
- ISO-8859-1.
-
- * backend/ebook/load-gnomecard-addressbook.c (add_card_cb),
- backend/ebook/load-pine-addressbook.c (add_card_cb),
- backend/ebook/test-client-list.c (get_cursor_cb),
- backend/ebook/test-client.c (get_cursor_cb, get_card_cb): Use
- e_card_get_vcard_assume_utf8 to print out testing strings.
-
- * gui/component/select-names/e-select-names-model.c,
- gui/component/select-names/e-select-names-model.h
- (e_select_names_model_contains): Changed this to be const
- EDestination *dest to fix a warning.
-
- * gui/contact-editor/e-contact-editor.c (e_contact_editor_init):
- Translate window title here.
-
-2001-08-31 Zbigniew Chyla <cyba@gnome.pl>
-
- * gui/component/addressbook-storage.c
- (addressbook_get_other_contact_storage): s/_/U_/
-
- * gui/widgets/e-addressbook-reflow-adapter.c (addressbook_compare):
- Use g_utf8_collate.
-
- * gui/widgets/e-minicard.c (e_minicard_compare):
- Ditto.
-
- * printing/e-contact-print.c (card_compare):
- Ditto.
-
-2001-08-29 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_clicked): Use e_select_names_model_merge to
- combine the selected names with any existing ones. This causes
- you to not lose addresses typed directly into the entry while the
- SelectNames dialog is up. (Bug #8058)
-
- * gui/component/select-names/e-select-names-model.c
- (e_select_names_model_merge): Merge the contents of one
- ESelectNamesModel into another, avoiding duplicates.
-
- * backend/ebook/e-destination.c (e_destination_equal): Added.
- Determines if two destinations appear to refer to the same
- recipient.
-
- * backend/ebook/e-card.c (e_card_list_send): Added cast to
- g_free args to silence compiler warnings.
-
- * gui/contact-editor/e-contact-quick-add.c (quick_add_set_name):
- Paranoia. Check that name != qa->name.
- (quick_add_set_email): Check that email != qa->email.
- (ce_have_book): Store the QuickAdd data structure in object data,
- so that we can be extra-careful and avoid having a dangling
- pointer floating around out somewhere as the closure for a signal.
- Fixes bug #8155, I think.
- (card_added_cb): Clear object data to ensure single unref.
- (editor_closed_cb): Clear object data to ensure single unref.
-
- * gui/component/select-names/e-select-names-completion.c
- (book_query_score): Make sure that comp->priv->query_text isn't
- NULL. (Fixes bug #8195)
-
- * backend/ebook/e-book-listener.c (e_book_listener_check_queue):
- This function can be re-entrant during the signal emission; Added
- extra ref/unrefs and checks to avoid problems if this happens.
- This is similar to my recent changes to
- e_book_view_listener_check_queue. (Fixes bug #7400)
-
-2001-08-27 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-component.c: Get rid of a warning by
- initializing the closing NULL element in folder_types correctly.
-
- * gui/component/select-names/e-select-names.c: Updated to match
- the studlyCapsification of attributes in shell/Evolution*.idl.
-
-2001-08-27 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (sexp_file_as): Added. Generated queries against file_as.
- (match_file_as): Added. Match results of queries against
- file_as. (Bug #8152)
-
- * backend/ebook/e-book-view-listener.c
- (e_book_view_listener_check_queue): Added ref/unref pair to make
- sure that our listener doesn't get finalized during the signal
- emission and leave us with a dangling pointer. (Bug #7661)
-
- * backend/ebook/e-card.c (e_card_list_send): Removed some debugging
- spew that I left in by mistake.
-
- * gui/widgets/e-addressbook-model.c (create_card): Removed debugging
- spew.
-
- * backend/ebook/e-card.c (e_card_list_send): Do the right thing if
- the card we are trying to send to is a contact list. (Bug #6580)
-
-2001-08-27 Zbigniew Chyla <cyba@gnome.pl>
-
- * gui/widgets/e-addressbook-util.c (e_addressbook_error_dialog):
- Display localized status string (added missing _()).
-
-2001-08-24 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-destination.c (e_destination_set_card): Put a
- freeze/thaw around our the set of operations that changes the
- internal state of our card, so 'changed' signal callbacks won't be
- invoked on a card in an intermediary state. This fixes the bug
- that was causing the e-mail addresses in cards to be blank when
- replying to a message. (An unexpected side-effect of toshok's
- change on 8/22 to make sure that priv->email != NULL).
- (e_destination_get_name): Code slightly rearranged for (IMO)
- clarity.
-
-2001-08-23 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-minicard.c (e_minicard_event): add
- BUTTON_PRESS_MASK so double clicks still work.
-
-2001-08-23 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c (addressbook_query_changed): switch
- "full_name" to "x-evolution-any-field" in all the queries where we
- want to match all cards, since the backends universally handle
- this special case more efficiently.
-
-2001-08-22 Jon Trowbridge <trow@ximian.com>
-
- * gui/contact-list-editor/e-contact-list-editor.c (extract_info):
- In the GUI, the toggle is labelled "hide addresses", not "show
- addresses" -- so we have to reverse the boolean value we read in.
- (fill_in_info): Same bug as before: since the GUI reads "hide", we
- have to initialize the toggle to '!show_addresses', not
- 'show_addresses'.
-
- * backend/ebook/e-destination.c
- (e_destination_list_show_addresses): Added.
- (e_destination_xml_encode): Encode the value of
- e_destination_list_show_addresses into the XML.
- (e_destination_xml_decode): Read and store the "show_addresses"
- flag.
-
-2001-08-22 jacob berkman <jacob@ximian.com>
-
- * gui/component/e-address-popup.c (emit_event): emit an event from
- our event source
- (contact_editor_cb): emit a destroy event so our control frame can
- be destroyed.
- (edit_contact_info_cb): emit a hide event so our control frame can
- be hidden
- (e_address_popup_cardify):
- (add_contacts_cb): emit the destroy event
- (e_address_popup_factory_new_control): don't unref our object at
- widget destroy time as that was really really broken
- (e_address_popup_factory_new_control): create an event source and
- aggregate ourself with it
-
- * gui/contact-editor/e-contact-editor.c (enable_writable_fields):
- display a nicer warning when we can't find a widget for a given
- field
- (e_contact_editor_raise): only raise if there is a window
-
- * gui/contact-editor/contact-editor.glade: name some widgets that
- got unnamed, and set the first entry as defaultable
-
- * gui/contact-editor/e-contact-editor.c: envelope printing is
- disabled in 1.0
-
-2001-08-22 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-destination.c (e_destination_get_email): make
- sure we don't get into a situation where priv->email == NULL.
-
-2001-08-21 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-minicard.c (e_minicard_event): if we're dragging,
- drag_button_down won't be true in the BUTTON_RELEASE case, since
- we set it to false in MOTION_NOTIFY once the threshold is reached.
- (e_minicard_drag_end): remove this function, since it was needed
- to work around a bug in gnome-canvas.
-
-2001-08-20 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_addressbook_create_ebook_table): Wrap our addressbook table
- adapter in an ETableWithout, so that we can make addresses appear
- and disappear when we remove/add them to the section lists
- (To/Cc/Bcc) on the right of the dialog.
- (real_add_address_cb): When we add an address, hide it in the main
- list.
- (e_select_names_init): Get pointer to our without table from the
- table's object data, and store it.
- (remove_address): When we remove an address, show it in the main
- list.
- (card_key): Added. Allocate a unique key from an ECard.
- (esn_get_key_fn): Added. Callback for ETableWithout.
- (esn_dup_key_fn): Added. Callback for ETableWithout.
- (esn_free_gotten_key_fn): Added. Callback for ETableWithout.
- (esn_free_duped_key_fn): Added. Callback for ETableWithout.
-
- * backend/ebook/e-card-simple.c (e_card_simple_get): Changed
- E_CARD_SIMPLE_FIELD_NAME_OR_ORG to first try the FILE_AS
- type. This allows the cards in the ESelectName dialog to
- appear in proper sort order (i.e. as 'Doe, John' rather than
- 'John Doe'). Fixes ximian #6002.
-
-2001-08-20 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-reflow-adapter.c
- (e_addressbook_reflow_adapter_class_init): fix arg info - we're
- only passing 1 GTK_TYPE_POINTER arg, not 2.
-
- * gui/widgets/e-minicard.c (e_minicard_event): lots of fixes for
- DnD. For GDK_BUTTON_PRESS, we grab immediately. For
- GDK_BUTTON_MOTION, we start the drag after a certain threshold,
- and connect to the "drag_end" signal on our canvas so we'll know
- when the drag is complete. For GDK_BUTTON_RELEASE, we release the
- grab if we were dragging and get the event.
- (e_minicard_drag_end): new function, just remove the pointer/gtk
- grabs and disconnect.
-
- * gui/widgets/e-minicard.h (struct _EMinicard): add "gint
- drag_button"
-
-2001-08-20 JP Rosevear <jpr@ximian.com>
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_changes_foreach_key): use DB_NOTFOUND const
-
-2001-08-20 JP Rosevear <jpr@ximian.com>
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_process_get_changes): null out card_sexp so that
- we don't crash when copying
-
-2001-08-20 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c: fix warnings, get compiling again
-
- * conduit/address-conduit-config.h: remove c/p typos
-
- * conduit/address-conduit.h: ditto
-
- * conduit/Makefile.am: link against the static camel
-
-2001-08-20 Damon Chaplin <damon@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c: use bigger Save icon for
- toolbar. Used Delete icon in menu.
-
- * gui/component/addressbook.c: use 'Save As' icon rather than 'Save'
- as it seems more appropriate. Also added delete icon for menu.
-
-2001-08-19 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-component.c: Update the folder list to
- include a display name and a description.
-
-2001-08-19 Damon Chaplin <damon@ximian.com>
-
- * gui/component/addressbook.c: use new Cut/Copy/Paste/Save/Search
- icons.
-
-2001-08-19 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/addressbook.c (set_folder_bar_label),
- gui/widgets/e-addressbook-model.c,
- gui/widgets/e-addressbook-model.h (update_folder_bar_message),
- gui/widgets/e-addressbook-view.c, gui/widgets/e-addressbook-view.h
- (folder_bar_message): Set the folder bar message here. Fixes
- Ximian bug #4670.
-
- * gui/component/select-names/e-select-names-model.c (SEPLEN): Use
- strlen(SEPARATOR) here so that if the separator changes the length
- will work properly.
-
-2001-08-19 Christopher James Lahey <clahey@ximian.com>
-
- * gui/contact-editor/fulladdr.glade: Added full country list.
- Fixes Ximian bug #5123.
-
-2001-08-18 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook.c: Hook up `delete-message.png' as the
- icon for "ContactDelete".
- * gui/contact-editor/e-contact-editor.c: Likewise.
-
-2001-08-17 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-storage.h: add prototype for
- addressbook_get_other_contact_storage.
-
- * gui/component/addressbook-storage.c
- (addressbook_get_other_contact_storage): rename register_storage
- to this, and return the EvolutionStorage.
- (load_source_data): register_storage =>
- addressbook_get_other_contact_storage.
- (addressbook_storage_add_source): register_storage =>
- addressbook_get_other_contact_storage.
-
-2001-08-17 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c
- (set_entry_changed_signals): connect to the "changed" signal on
- "entry-web" to update command state.
-
-2001-08-17 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-list-editor/e-contact-list-editor.c (list_added_cb):
- call e_card_set_id on the list's card so we can continue to use
- this dialog. also, call command_state_changed if we aren't
- closing the dialog so the toolbar is properly sensitized.
- (list_deleted_cb): always close the dialog after we successfully
- delete a list.
-
- * gui/contact-editor/e-contact-editor.c (card_added_cb): call
- e_card_set_id on the card so we can continue to use this dialog
- (to modify or delete the card.)
- (card_deleted_cb): always close the dialog after we successfully
- delete a card.
-
-2001-08-17 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c (addressbook_query_changed): call
- e_sexp_encode_string on the search string the user types in so it
- doesn't break sexp parsing in the wombat.
-
-2001-08-17 Damon Chaplin <damon@ximian.com>
-
- * gui/component/addressbook.c: changed to new print icon.
-
-2001-08-17 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names.c: (struct
- ESelectNamesFolder): rename physical_uri to uri, since it includes
- the addressbook.db for file: uris.
- (e_select_names_folder_free): physical_uri => uri.
- (e_select_names_option_activated): physical_uri => uri, and we
- don't need to strdup_printf "addressbook.db" onto the end anymore.
- (new_folder): if the physical_uri is a file: uri, append
- /addressbook.db onto it.
- (hookup_listener): new function, split out lots of code from
- e_select_names_hookup_shell_listener.
- (e_select_names_hookup_shell_listeners): rename
- e_select_names_hookup_shell_listener to this, and hookup both the
- local and "Other Contacts" listener, using hookup_listener.
- (e_select_names_destroy): disconnect from the
- other_contacts_listener and unref it.
-
- * gui/component/select-names/e-select-names.h (struct
- _ESelectNames): add a listener for Other Contacts, and rename
- "listener" to "local_listener."
-
-2001-08-17 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_seq_complete_cb): If we get the
- "sequence_complete" signal when we aren't searching, it means the
- addressbook changed out from under us. Clear the search cache, so
- that future completion requests won't use the out-of-date cached
- data. Also, don't unref book_view... we leave the EBookView open
- so that we can catch these addressbook changes.
- (e_select_names_completion_do_query): Don't use the book_view
- being non-NULL as a sign that another query is still running.
- (e_select_names_completion_got_book_view_cb): Properly unref any
- previous value in book_view.
-
-2001-08-17 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-reflow-adapter.c
- (e_addressbook_reflow_adapter_right_click),
- gui/widgets/e-addressbook-view.c (table_right_click): Changed the
- messages here in the right click menus.
-
-2001-08-17 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (view_destroy): unref our
- card_sexp.
- (create_card_handler): make sure to set the id of the vcard so it
- gets properly transmitted back to the BookView, and notify all
- matching BookViews to add the created card.
- (remove_card_handler): notify all matching BookViews to remove the
- card.
- (modify_card_handler): notify all matching BookViews to modify the
- card.
- (pas_backend_ldap_process_get_book_view): init card_sexp based on
- the view's search.
-
-2001-08-17 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_book_view_copy): use card_sexp.
- (pas_backend_file_book_view_free): same.
- (vcard_matches_search): use the new pas_backend_card_sexp_match_vcard call.
- (pas_backend_file_search): use card_sexp.
- (pas_backend_file_process_get_book_view): same.
-
- * backend/pas/Makefile.am (libpas_a_SOURCES): add
- pas-backend-card-sexp.[ch].
-
-2001-08-17 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/addressbook-component.c (factory_fn): Added code
- so the user can create a new contact or contact list from anywhere
- in evolution.
-
-2001-08-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * backend/pas/evolutionperson.schema: Added a closing paren.
-
-2001-08-16 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_handle_request): Renamed from _begin to
- match changes in gal 0.10.99.3.
-
- * gui/contact-editor/e-contact-quick-add.c (e_contact_quick_add):
- Check that name != NULL before we start messing with it.
- (Fixes bug #7329)
-
-2001-08-16 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (match_nickname): Boost scoring on an exact nickname match.
- Manually addressify match.
- (match_name): Manually addressify matches.
- (book_query_score): Remove automatic addressification.
-
- * gui/component/addressbook.c (addressbook_query_changed): Minor
- tweak to avoid a crash if we have a negative subid with id
- ESB_CATEGORY. This should never happen.
- (addressbook_menu_activated): Reset the entry/option when we
- select "Clear".
- Some changes to reflect renaming in ESearchBar.
-
- * gui/component/select-names/e-select-names-bonobo.c
- (entry_set_property_fn): Cardify after importing destinations.
- This might fix a problem that Damon is having.
-
-2001-08-15 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-config.glade: set title of initial
- dialog to Addressbook Sources (bug #6704).
-
-2001-08-15 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-storage.c (create_ldap_folder): don't
- let people add subdirs in the ldap server storage - everything is
- toplevel there.
-
-2001-08-14 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c
- (pas_backend_ldap_process_get_vcard): implement using
- search_for_dn.
-
-2001-08-14 Federico Mena Quintero <federico@ximian.com>
-
- * gui/component/addressbook.c (addressbook_factory_new_control):
- Tell the search bar to translate the subitem texts.
-
-2001-08-14 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/addressbook.c (addressbook_factory_new_control):
- Add "Any Category" option for category searches.
- (addressbook_query_changed): Do the right thing on an
- "Any Category" search.
-
-2001-08-14 Dan Winship <danw@ximian.com>
-
- * backend/pas/pas-backend-ldap.c: Fix up to match the
- pas_book_new/get_vcard changes.
-
-2001-08-14 Christopher James Lahey <clahey@ximian.com>
-
- * gui/merging/e-card-merging-book-commit-duplicate-detected.glade:
- Got rid of an extraneous _ here.
-
- * gui/widgets/e-addressbook-util.c (e_addressbook_error_dialog):
- Changed Canceled to Cancelled here. Fixes Ximian bug #2465.
-
-2001-08-14 Christopher James Lahey <clahey@ximian.com>
-
- * backend/pas/pas-book.c (pas_book_respond_get_vcard): Oops,
- forgot to write this function.
-
-2001-08-14 Christopher James Lahey <clahey@ximian.com>
-
- * gui/contact-editor/contact-editor.glade: Added focus targets
- here. Fixes part of Ximian bug #5843.
-
-2001-08-14 Christopher James Lahey <clahey@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c (e_contact_editor_init):
- Grab focus here. Fixes Ximian bug #2265.
-
-2001-08-14 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/addressbook.c (addressbook_factory_new_control):
- (addressbook_query_changed): Fixed two const warnings here.
-
- * printing/e-contact-print-envelope.c,
- printing/e-contact-print-envelope.h: Fixed some missing includes
- here.
-
-2001-08-14 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-book-view.c (add_book_iterator): Call
- e_card_set_book here.
-
- * backend/ebook/e-book.c (e_book_do_response_get_vcard): Call
- e_card_set_book here.
-
- * backend/ebook/e-card.c, backend/ebook/e-card.h: Pulled out the
- part where the uri is made part of the uid. Made uri a separate
- field. Fixes Ximian bug #6490.
-
- * backend/ebook/e-destination.c, backend/ebook/e-destination.h:
- Change this to use ECard's split uids and uris.
-
-2001-08-13 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (add_to_supported_fields): don't
- g_strdup the stuff we're passing into e_list_append, since it does
- the copy for us.
- (check_schema_support): don't initialize supported_fields list
- here, since there's a gross case where the programmer/user can
- bring up the contact editor before the connection stuff is
- finished, and we don't want to crash.
- (pas_backend_ldap_init): move it here to we can guarantee it's
- there. (bug #6546).
-
-2001-08-13 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-config.c
- (addressbook_source_dialog_set_source): don't access source->auth
- if source == NULL (bug #7086).
-
-2001-08-13 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-book-listener.c,
- backend/ebook/e-book-listener.h, backend/ebook/e-book.c,
- backend/ebook/e-book.h, backend/idl/addressbook.idl,
- backend/pas/pas-backend-file.c, backend/pas/pas-book.c,
- backend/pas/pas-book.h: Changed get_card to be asyncronous.
-
- * backend/ebook/e-card.c, backend/ebook/test-client.c: Changed
- these to deal with the new get_card functionality.
-
-2001-08-11 Kjartan Maraas <kmaraas@gnome.org>
-
- * gui/component/select-names/e-select-names.c: Mark a string for translation.
- * This fixes bug #7052
- * printing/e-contact-print.h: Add headers to make it stand on itw own.
- * printing/e-contact-print.c: Marked some strings for translation.
- * printing/e-contact-print-envelope.c: Same here.
-
-2001-08-10 Jon Trowbridge <trow@ximian.com>
-
- * gui/contact-editor/e-contact-quick-add.c (e_contact_quick_add):
- Remove single- or double-quotes from names before sticking them
- into the addressbook. (Bug #6499)
-
- * gui/component/addressbook.c (addressbook_query_changed):
- Properly handle "Category is" queries by checking the search bar
- suboption.
- (addressbook_factory_new_control): Attach subitems corresponding
- to all wombat categories to the "Category is" ESearchBarItem.
-
- * gui/component/addressbook.c: Set the ESearchBarItem
- subitems explicitly to NULL.
-
-2001-08-10 Anna Marie Dirks <anna@ximian.com>
- * gui/component/select-names/select-names.glade: did a little
- packing-magic to get the two tables at bottom of this dialog
- to seem to line up.
-
- *gui/component/select-names/e-select-names.c: changed the title
- of this dialog to "Select Contacts from Addressbook".
-
-2001-08-09 Anna Marie Dirks <anna@ximian.com>
- * gui/component/select-names/select-names.glade: redesigned
- this dialog to fix bug #6815.
-
- *gui/component/select-names/e-select-names.c: connected the
- widgets (or one of them anyway. clahey did the rest) for my
- new and lovely glade file.
-
-2001-08-09 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c: remove passwd_cb.
-
-2001-08-09 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-text-model.c
- This change is dedicated to Jacob Berkman.
- (e_select_names_text_model_insert_length): If the last character
- we inserted was a "magic comma", remember its position.
- (e_select_names_text_model_delete): If the last character we
- inserted was a "magic comma", and if the next thing we do is to
- hit backspace, delete both the comma and the extra whitespace we
- added.
- (e_select_names_text_model_init): Initialize our last magic comma
- position.
-
-2001-08-09 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_create_entry): Hook up some magic to
- (basically) cardify an entry on focus-out. (What we do is actually
- more complicated than that.)
-
- * gui/component/select-names/e-select-names-bonobo.c
- (entry_set_property_fn): After we set an entry's text, try to
- cardify it. We need to do this so that (for example) reply
- e-mails get properly cardified.
-
- * gui/component/select-names/e-select-names-model.c
- (e_select_names_model_duplicate): Use e_select_names_model_append,
- rather than manipulating lists directly.
- (e_select_names_model_insert): Connect "changed" signal proxy for
- added EDestination.
- (e_select_names_model_append): Ditto.
- (e_select_names_model_replace): Ditto, and disconnect signals for
- replaced EDestination.
- (e_select_names_model_delete): Ditto on the disconnection.
- (e_select_names_model_delete_all): Ditto.
- (e_select_names_model_cardify): Added. Try to cardify a specified
- EDestination.
- (e_select_names_model_cancel_cardify): Added. Cancel the pending
- cardification of a single EDestination.
- (e_select_names_model_cardify_all): Added. Cardify all of the
- EDestinations in the model.
- (e_select_names_model_cancel_cardify_all): Added. Cancel's any
- and all pending cardifications.
-
- * backend/ebook/e-destination.c (e_destination_class_init): Added
- "changed" and "cardified" signals.
- (e_destination_freeze): Added (static).
- (e_destination_thaw): Added (static).
- (e_destination_clear_card): Reset allow_cardify and
- cannot_cardify, cancel any pending cardifications, and emit the
- "changed" signal.
- (e_destination_clear_strings): Emit the "changed" signal.
- (e_destination_clear): Do freeze/thaw to prevent multiple signal
- emissions.
- (e_destination_set_card): Check that the card we are setting is
- not equal to the current card, and emit the "changed" signal if we
- are actually changing.
- (e_destination_set_card_uri): Emit "changed" signal, if necessary.
- (e_destination_set_name): Emit "changed" signal, if necessary.
- (e_destination_set_email): Emit "changed" signal, if necessary.
- (e_destination_set_html_mail_pref): Emit "changed" signal, if
- necessary.
- (use_card_cb): If we've just loaded/set the ECard, emit the
- "changed" signal.
- (e_destination_set_raw): Emit "changed" signal, if necessary.
- (e_destination_allow_cardification): Added.
- (e_destination_set_allow_cardification): Added.
- (e_destination_cardify): Added. Tries to automatically convert
- a string-based EDestination to one based on an ECard.
- (e_destination_cardify_delayed): Added. Cardifies in a timeout.
- (e_destination_cancel_cardify): Added. Cancels any pending
- cardifications.
- (e_destination_xml_decode): Added freeze/thaw.
-
- * backend/ebook/e-book-util.c (e_book_nickname_query): Added. A
- canned simple query for nicknames.
-
- * backend/ebook/e-card.c (e_card_email_find_number): Added. Given
- a card and an string containing an email address, return the index
- number of the address inside of the card, or -1 if the address is
- not found.
-
-2001-08-09 Chris Toshok <toshok@ximian.com>
-
- [ Fixes ximian bugs #5080, #6021, #6704, #6705 ]
-
- * gui/component/addressbook.c (book_open_cb): create our own
- dialog that prompts for both the email address and the password.
- the email address is stored in the source and filled in for the
- user after the first time they enter one and press OK.
-
- * gui/component/addressbook-storage.c (create_ldap_folder): has a
- return value, not a int* parameter.
- (create_ldap_folder): new function, we can create ldap servers
- from the File->New->Folder menu item now.
- (register_storage): hook up the "create_folder" signal.
- (addressbook_storage_init_source_uri): remove the file case, we
- only build ldap uris here.
- (load_source_data): remove the file source stuff, and handle
- "emailaddr".
- (save_source_data): call ldap_source_foreach directly.
- (addressbook_source_free): remove file source stuff.
- (addressbook_source_copy): same.
-
- * gui/component/addressbook-storage.h: get rid of all the file
- source stuff from AddressbookSource, since this is only being used
- for ldap servers.
-
- * backend/pas/pas-backend-ldap.c
- (pas_backend_ldap_process_authenticate_user): look up the ldap
- entry based on the provided email address and use the resulting
- DN/passwd to authenticate.
-
- * gui/component/addressbook-config.c: pretty much gutted to make
- it work with the new UI.
-
- * gui/component/addressbook-config.glade: new version from anna.
-
-2001-08-09 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (SPEC): Upped the minimum width
- on all addressbook columns to 75. Fixes Ximian bug #2773.
-
-2001-08-08 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-quick-add.c (ce_have_book): mark
- the dialog as changed so the save button is immediately available.
-
- * gui/contact-editor/e-contact-editor.c (card_modified_cb): once
- we save reset the change flag to false if we aren't closing the
- dialog.
- (card_added_cb): same.
- (e_contact_editor_class_init): add a "changed" arg.
- (e_contact_editor_set_arg): add setter for "changed".
- (e_contact_editor_get_arg): add getter for "changed".
-
-2001-08-08 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-quick-add.c (ce_have_book): better
- to assume that we can write to the local addressbook than that we
- can't write to it :)
-
-2001-08-08 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-list-editor/e-contact-list-editor.c (create_ui):
- call e_pixmap_update so we can use the same save/save-as pixmaps
- as the contact editor.
-
-2001-08-08 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-reflow-adapter.c (open_card): new
- function, used by the context menu.
- (e_addressbook_reflow_adapter_right_click): put "Open" at the top
- of the menu. also, disable "Delete" if the addressbook isn't
- writable.
-
-2001-08-08 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (rfc2254_escape): escape *, \, (,
- and ), as per rfc2254.
- (func_contains): escape the string.
- (func_is): same.
- (func_beginswith): same.
- (func_endswith): same.
-
-2001-08-08 Nat Friedman <nat@ximian.com>
-
- * gui/widgets/e-addressbook-reflow-adapter.c (print_envelope): If 0'd out
- since Envelope printing is disabled for 1.0.
- * gui/widgets/e-addressbook-view.c (print_envelope): Likewise.
- * gui/contact-editor/e-contact-editor.c (print_envelope_cb): Likewise.
-
- * gui/widgets/e-addressbook-reflow-adapter.c
- (e_addressbook_reflow_adapter_right_click): Removed "Print
- Envelope" menu item.
- * gui/widgets/e-addressbook-view.c (table_right_click): Likewise.
- * gui/contact-editor/e-contact-editor.c (verbs): Likewise.
-
-2001-08-07 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-storage.c (remove_ldap_folder): ifdef
- this HAVE_LDAP.
-
-2001-08-07 Chris Toshok <toshok@ximian.com>
-
- * gui/search/e-addressbook-search-dialog.c
- (e_addressbook_search_dialog_init): set the title of the window to
- "Advanced Search".
-
-2001-08-07 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c (search_cb): pass view->view instead
- of the EBook.
- (addressbook_search_menu_items): remove E_FILTERBAR_ADVANCED.
- (addressbook_menu_activated): remove E_FILTERBAR_ADVANCED.
- (addressbook_search_option_items): add "Advanced..." here.
- (addressbook_query_changed): add special handling for Advanced...
-
- * gui/search/e-addressbook-search-dialog.h (struct
- _EAddressbookSearchDialog): add EAddressbookView and remove the
- model/adapter fields. Also fix prototype of
- e_addressbook_search_dialog_new.
-
- * gui/search/e-addressbook-search-dialog.c
- (e_addressbook_search_dialog_class_init): get rid of
- set_arg/get_arg.
- (button_press): set the query on the EAddressbookView, and always
- close the dialog.
- (e_addressbook_search_dialog_init): get rid of the minicard view,
- and pack the other widgets accordingly.
- (e_addressbook_search_dialog_new): pass EAddressbookView instead
- of EBook.
- (e_addressbook_search_dialog_destroy): remove model/adapter stuff.
-
-2001-08-07 Chris Toshok <toshok@ximian.com>
-
- [ Fixes bug #5066 ]
- * gui/component/addressbook-storage.c (remove_ldap_folder): new
- function, remove the source.
- (register_storage): connect to the "remove_folder" signal so we
- know when to remove the folder.
-
-2001-08-07 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (build_card_from_entry): use
- g_strcasecmp since ldap attribute names are not case sensitive.
-
-2001-08-07 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-list-editor/e-contact-list-editor.c
- (table_drag_data_received_cb): make sure we update the changed
- state if a successful drop happens.
-
-2001-08-07 Jason Leach <jleach@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_init): Make the OK button the keyboard default
- instead of Cancel. Bug #4942.
-
-2001-08-06 Radek Doulik <rodo@ximian.com>
-
- * backend/ebook/e-book.c (e_book_op_free): new EBookOp destructor
- (e_book_unqueue_op): use e_book_op_free
- (e_book_do_response_create_card): ditto
- (e_book_do_response_generic): ditto
- (e_book_do_response_get_cursor): ditto
- (e_book_do_response_get_view): ditto
- (e_book_do_response_get_changes): ditto
- (e_book_do_response_open): ditto
- (e_book_do_response_get_supported_fields): ditto
-
-2001-08-05 Radek Doulik <rodo@ximian.com>
-
- * backend/ebook/e-book.c (e_book_do_response_get_view): set
- op->listener to NULL to catch possible use of freed op
- (e_book_do_response_get_changes): ditto
-
- * backend/ebook/e-book-view-listener.c
- (e_book_view_listener_check_queue): this callback could be (and
- indeed is) called from signal emited above,
- signal handler could call e_book_view_listener_stop, so we need to check
- if idle is still set and if not we don't want to unref again
-
-2001-08-04 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card-compare.c (e_card_compare_name): Made it so
- that if there's one less match than possible compares are
- considered more VAGUE. Fixes Ximian bug #3400.
-
-2001-08-03 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_hookup_shell_listener): Check for storage != NULL
- here. This shouldn't come up unless addressbook has crashed
- previously within this session of evolution, but this is just a
- bit of insurance. Fixes Ximian bug #3699.
-
-2001-08-03 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card.c (e_card_name_match_string): Changed the
- criteria of whether the first part of each iteration matched or
- the second one did. Before it got it wrong sometimes and caused
- the pointer to jump off the end of the array. Fixes Ximian bug
- #4674.
-
-2001-08-03 Jason Leach <jleach@ximian.com>
-
- * gui/component/addressbook-storage.c (load_source_data): Update
- for EvolutionStorage API changes.
- (addressbook_storage_add_source): Ditto.
-
-2001-08-03 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (jump_to_letter): Made this
- change the query based on which letter is clicked. Fixes Ximian
- bug #2202.
-
-2001-08-03 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/addressbook.c (addressbook_factory_new_control):
- Fixed warnings here.
-
- * gui/component/select-names/e-select-names-completion.c
- (hash_cleanup_fn): Removed this unused function.
-
-2001-08-03 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card-simple.c (e_card_simple_sync_card,
- fill_in_info): Made the list of E_CARD_PHONE types in
- phone_correspondences more complete by adding the new 5
- E_CARD_PHONE types. Also, made it a bit less restrictive for some
- types (E_CARD_PHONE_HOME will actually match
- E_CARD_SIMPLE_PHONE_ID_HOME now.) Made e_card_simple_sync_card
- and fill_in_info search for an exact match in the list of
- phone_correspondences and then look for a partial match. Got rid
- of not going forward when doing a remove from an EList since EList
- handles this case automatically.
-
- * backend/ebook/e-card-types.h: Added E_CARD_PHONE types for
- assistant, callback, radio, telex, and ttytdd.
-
- * backend/ebook/e-card.c (get_phone_flags, set_phone_flags):
- Handle the new E_CARD_PHONE types.
-
-2001-08-02 Jon Trowbridge <trow@ximian.com>
-
- * printing/Makefile.am (ecpsdir): Add camel dependency.
-
- * gui/component/Makefile.am: Add camel dependency.
-
- * backend/ebook/Makefile.am: Add camel dependency.
-
- * gui/component/addressbook-factory.c (main): Properly init camel.
-
- * backend/ebook/e-destination.c (e_destination_clear_strings):
- Clear ->raw.
- (e_destination_is_empty): We aren't empty if ->raw is set..
- (e_destination_set_raw): Replaces e_destination_set_string.
- (e_destination_get_name): Use camel's parser to extract the name
- from ->raw.
- (e_destination_get_email): Use camel's parser to extract the email
- address from ->raw.
- (e_destination_get_address): Use camel to produce properly quoted,
- RFC-compliant addresses. Thanks camel! (Bug #5860)
-
- * gui/component/select-names/e-select-names-completion.c
- (emailify_match): Always append an e-mail address, as long as it
- doesn't have one already at it's beginning or end. Don't limit
- self to just emailifying entries tied to cards with multiple
- addresses. (I didn't really want to do this, but people seem to
- like keeping multiple cards for the same person, and other
- solutions (like scanning all matches for duplicate names, and only
- emailifying those) just seemed like way too much work for such a
- limited payoff.)
-
- * gui/component/select-names/e-select-names-text-model.c:
- s/e_destination_set_string/e_destination_set_raw/.
-
- * gui/component/select-names/e-select-names-popup.c
- (popup_menu_card): Quote _'s in our popup menus, so that "foo_bar"
- doesn't get displayed as "foobar" w/ the 'b' underlined. (Bug
- #5558)
- (popup_menu_nocard): Ditto.
-
-2001-08-02 Jason Leach <jleach@ximian.com>
-
- * gui/component/addressbook.c (addressbook_factory_new_control):
- Removed some extra padding and pack the addressbook view into a
- frame with inward shadowing, just because it looks prettier.
-
- * gui/contact-editor/e-contact-editor.c: Use the updated Save,
- Save As, and Print icons for the menus and toolbar.
-
-2001-08-02 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/addressbook.c: Added ContactsSaveAsVCard,
- ContactsSendContactToOther, and ContactsSendMessageToContact verbs
- here.
-
- * gui/widgets/e-addressbook-view.c,
- gui/widgets/e-addressbook-view.h (e_addressbook_view_save_as,
- e_addressbook_view_send, e_addressbook_view_send_to): New
- functions to allow outside users to cause the addressbook to save,
- send, or send a message to its selection.
-
-2001-08-01 Christopher James Lahey <clahey@ximian.com>
-
- * contact-editor/.cvsignore: Removed this file from this unused
- directory.
-
-2001-08-01 Christopher James Lahey <clahey@ximian.com>
-
- * gui/contact-editor/Makefile.am: Added file-exists.glade.
-
- * gui/contact-editor/e-contact-save-as.c (file_exists),
- gui/contact-editor/file-exists.glade: Added a dialog to ask the
- user whether to replace an already existing file. Mostly from a
- patch by Jos Dehaes. Fixes Ximian bug #2231.
-
-2001-08-01 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-book-view-listener.c
- (e_book_view_listener_check_queue): Removed thrash checking code
- here since thrashing shouldn't happen now that we've cleaned this
- up some.
-
- * backend/ebook/e-book.c (e_book_do_response_get_view): Properly
- handle cases where construction fails.
-
-2001-07-30 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/evolution-vcard-importer.c: Added #include
- <e-util/e-path.h>.
-
-2001-07-23 Zbigniew Chyla <cyba@gnome.pl>
-
- * gui/component/addressbook-config.c (addressbook_source_dialog):
- Convert translated string to UTF8 before calling put_html.
-
-2001-07-30 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_do_query): Properly handle the case
- where our "cleaned" completion is the empty string. This happens,
- for example, if the query text is the string "\"". (Bug #5610).
-
- * backend/ebook/e-destination.c (e_destination_get_address_textv):
- Reassure fejj that I'm not doing something stupid here.
- (e_destination_get_address): Fix address quoting. This is a
- stop-gap measure until I can change this code to use Camel's
- superior address-handling routines. (Also Bug #5610)
-
-2001-07-30 Jason Leach <jleach@ximian.com>
-
- * gui/component/addressbook-storage.c (load_source_data): Fix a
- return value bug, to make it so if it fails to load an
- addressbook-sources.xml file (either a parse error or it doesn't
- exist for example), it deregisters the storage.
- (register_storage): Don't make a storage for users who don't have
- LDAP support built in. Bug #1950.
-
-2001-07-30 Frederic Crozat <fcrozat@mandrakesoft.com>
-
- * addressbook/gui/component/addressbook-factory.c: Fix crashes
- when gtkhtml is compiled with gconf support
-
-2001-07-27 JP Rosevear <jpr@ximian.com>
-
- * conduit/Makefile.am: Tidy ldadds
-
-2001-07-26 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-bonobo.c: Fixing a
- small, stupid mistake; use e_select_names_model_get_textification
- for the getter for "text".
-
- * backend/ebook/e-card.c: Removed some debugging chatter.
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_create_entry): Store the completion
- handler in the entry's object data.
-
- * gui/component/select-names/e-select-names-bonobo.c
- (entry_get_property_fn): Added support for getting "destinations"
- and "allow_contact_lists" properties.
- (entry_set_property_fn): Added support for setting "destinations"
- and "allow_contact_lists" properties.
- (impl_SelectNames_get_entry_for_section): Added definitions for
- "destinations" and "allow_contact_lists" properties.
-
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_get_match_contact_lists): Added.
- (e_select_names_completion_set_match_contact_lists): Added.
- Controls whether contact lists are offered as options during
- completion.
- (book_query_process_card_list): Check if match_contact_lists
- is set before (duh!) matching on a contact list.
- (e_select_names_completion_init): Set match_contact_lists
- to TRUE by default.
-
-2001-07-25 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (func_contains): change the way
- x-evolution-any-field is converted to an ldap query. it used to
- be we'd nest queries like: (|(|(|(foo=*x*))(bar=*x*))(baz=*x*)).
- now we build it like: (|(foo=*x*)(bar=*x*)(baz=*x*)). much more
- efficient (both in the building, and on the server side no doubt).
-
-2001-07-25 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-destination.c (e_destination_get_name): Properly dup
- the results of e_destination_get_email.
-
- * gui/component/select-names/e-select-names-popup.c
- (e_select_names_popup): Check that our destination isn't empty
- before building our popup. (Bug #5250)
-
- * backend/ebook/e-destination.c (e_destination_is_empty): Made
- argument const.
-
-2001-07-24 Jon Trowbridge <trow@ximian.com>
-
- * gui/contact-list-editor/e-contact-list-model.c: Added checks
- for all of the args of the exposed functions, so that
- we won't crash on bad inputs. (Related to bug #4856.)
-
-2001-07-24 Jason Leach <jleach@ximian.com>
-
- * gui/merging/e-card-duplicate-detected.glade: "_Add Anyway" to
- "Add Anyway".
-
-2001-07-24 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-destination.c (e_destination_get_name): Added
- fallbacks for the name in the case of an e-card, to avoid the
- "nameless contact" bug.
-
-2001-07-24 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-minicard.c (remodel): need the EDestination magic
- here too for when we modify an already shown card.
-
- * gui/contact-list-editor/e-contact-list-model.c: make
- parent_class static, just to be anal.
-
- * gui/contact-list-editor/e-contact-list-editor.c
- (remove_entry_cb): removing entries changes the list, so flag it.
- (table_drag_data_received_cb): restrict cards we add to lists to
- be non-list cards.
- (extract_info): clear out the email list in the card before we
- repopulate it from the contact list model.
- (fill_in_info): set the checkbox to active/inactive based on
- thecard.
-
-2001-07-24 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c (wants_html_changed): call
- widget_changed.
- (phone_entry_changed): same.
- (email_entry_changed): same.
- (address_text_changed): same.
- (name_entry_changed): same.
- (company_entry_changed): same.
- (widget_changed): new function that we can either call or set as a
- signal to change the "changed" flag on the dialog.
- (set_entry_changed_signals): connect lots of "changed" signals on
- widgets to widget_changed.
- (add_lists): connect "changed" to widget_changed.
-
-2001-07-24 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_hookup_shell_listener): Check if
- evolution_shell_client_get_local_storage returns CORBA_OBJECT_NIL,
- which it should never do. If it does, print a warning in a dialog
- and try to recover w/o crashing. (Bug #5193)
-
-2001-07-24 Dan Winship <danw@ximian.com>
-
- * backend/ebook/e-book-listener.c (e_book_listener_stop): Don't
- stop the idle_queue and unref from here, since this might be
- called from inside e_book_listener_check_queue, and we don't want
- to return to that function with the listener having been
- destroyed.
- (e_book_listener_check_queue): Don't exit early if the queue is
- stopped. Proceed through the check if the queue is NULL (which is
- must be if the queue is stopped), and then reach the existing code
- to remove the idle handler. Combined with the above, this fixes
- ximian #4485 (again). This is not a plot to boost my
- showstopper-bugfixing count by fixing the same bug over and over
- again.
-
-2001-07-23 Dan Winship <danw@ximian.com>
-
- Re-fix for my 07-18 not-quite-fix.
-
- * backend/ebook/e-book-listener.c: Add a "stopped" flag like
- EBookViewListener.
- (e_book_listener_check_queue): Don't emit signals if the listener
- is stopped.
- (e_book_listener_queue_generic_response, etc): Don't queue
- responses if the listener is stopped.
- (e_book_listener_stop): Flush the queue and stop queue/emitting
- further responses.
-
- * backend/ebook/e-book.c (e_book_unload_uri): Revert the previous
- change and call e_book_listener_stop() instead.
-
- * backend/ebook/e-book-view-listener.c
- (e_book_view_listener_stop): When removing an idle handler, unref
- the listener as well, since e_book_view_listener_queue_response
- will have ref'ed it.
-
-2001-07-22 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-component.c (remove_folder): Add a
- @type arg. If the type is not "contacts", report an
- `UNSUPPORTED_TYPE' error through the listener. Also, remove
- `g_print()' debugging messages.
- (xfer_folder): Likewise.
-
-2001-07-21 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-component.c: Make the "contacts"
- folders user-creatable by setting `user_creatable' to %TRUE in the
- `EvolutionShellComponentFolderType's.
-
-2001-07-18 Chris Toshok <toshok@ximian.com>
-
- [ patch contributed by Jos Dehaes <jos.dehaes@bigfoot.com> ]
-
- * gui/component/addressbook-storage.c (register_storage): new
- function, register our evolution_storage.
- (addressbook_storage_setup): remove storage registration from
- here.
- (load_source_data): register the storage here before we load
- addressbook-sources.xml, and deregister it if there are no sources
- listed.
- (addressbook_storage_remove_source): unregister the storage if the
- list of sources hits 0 length.
-
-2001-07-18 Dan Winship <danw@ximian.com>
-
- * backend/ebook/e-book.c (e_book_unload_uri): Flush the listener's
- queue before unreffing it to ensure that it doesn't emit any more
- "responses_queued" signals after the EBook is destroyed.
-
- * backend/ebook/e-book-listener.c (e_book_listener_check_queue,
- e_book_listener_queue_response, e_book_listener_new): Use
- bonobo_object_ref/unref rather than gtk_object_ref/unref.
-
- * backend/ebook/e-book-view-listener.c
- (e_book_view_listener_queue_response, e_book_view_listener_new):
- Likewise.
-
-2001-07-18 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-card-compare.c (simple_query_cb): prune the list
- of cards that match our query using the avoid list here, instead
- of using the avoid list in the query itself, since ldap can't
- handle that.
- (use_common_book_cb): remove the block of code including the avoid
- list in the query sent to wombat.
-
-2001-07-17 Chris Toshok <toshok@ximian.com>
-
- [ Fixes bugs #4611 - crash searching in the name field at Bigfoot for "\"
- and #4554 - general ldap search crash ]
-
- * backend/pas/pas-backend-ldap.c (func_contains): the length of
- the big query string needs to take into account the length of the
- footer as well as the header - fix random memory corruption here.
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_build_query):
- list can be NULL, specifically if there's a parsing error in the
- sexp, so deal with it.
-
-2001-07-17 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-book-view-listener.c
- (e_book_view_listener_queue_response): Hold a reference to our
- listener while the idle function is active.
- (e_book_view_listener_check_queue): Only unref the listener when
- the idle function is finished.
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_clicked): Instead of replacing section->model with
- source, copy source onto section->model with
- e_select_names_model_overwrite_copy. #if 0/#endif out all of the
- stuff related to ETextModels, because it doesn't make any sense to
- me, and everything appears to work without it.
- (Die bug #2059. Die! Die! Die!)
-
- * gui/component/select-names/e-select-names-model.c
- (e_select_names_model_overwrite_copy): Added. Copies the contents
- of one ESelectNamesModel onto another.
-
- * backend/ebook/e-destination.c (e_destination_copy): Made the argument
- const.
-
- * backend/ebook/e-destination.c (e_destination_set_string): Removed
- old, broken code and annoying g_messages.
-
- * backend/ebook/e-book-listener.c
- (e_book_listener_queue_response): Hold a reference to the listener
- while the idle function is active.
- (e_book_listener_check_queue): Only release our reference to the
- listener when the queue is empty. These two changes fix a race
- condition, since the listener could be unrefed while the listener
- was still active. (Seems to fix bug #4485)
-
-2001-07-17 Christopher James Lahey <clahey@ximian.com>
-
- * gui/contact-editor/contact-editor.glade,
- gui/merging/e-card-duplicate-detected.glade,
- gui/merging/e-card-merging-book-commit-duplicate-detected.glade,
- printing/e-contact-print.glade: Patch from Taylor Hayward
- <thayward@gjpc.com>. Added accelerators to a few dialogs.
-
-2001-07-16 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/Evolution-Addressbook-SelectNames.idl:
- Added addSectionWithLimit to the SelectNames interface.
-
- * gui/component/select-names/e-select-names-bonobo.c
- (impl_SelectNames_add_section_with_limit): Added. Implements
- addSectionWithLimit.
- (e_select_names_bonobo_construct): Set up as a BonoboEventSource.
- (init): Listen for "changed" signals from our manager.
- (manager_changed_cb): Notify our listeners if we get a changed
- signal from our manager.
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_class_init): Added a "changed" signal".
- (section_copy): Propogate the signal connection.
- (section_free): Disconnect the changed handler.
- (e_select_names_manager_add_section_with_limit): Connect to the
- new section's model, listening for changes.
- (e_select_names_manager_activate_dialog): Connect to the "working
- copy" model, listening for changes.
- (e_select_names_manager_add_section_with_limit): Added.
- (e_select_names_manager_add_section): Changed to just be a special
- case of e_select_names_manager_add_section_with_limit.
-
- * gui/component/select-names/e-select-names-model.c
- (e_select_names_model_set_limit): Added. Allows a max number of
- names allowed in the model.
- (e_select_names_model_get_limit): Added. Returns the limit.
- (e_select_names_model_at_limit): Added. Returns TRUE if the
- model is "full".
- (e_select_names_model_insert): Check that we aren't at the
- limit before inserting. Silently return if we are.
- (e_select_names_model_append): Check that we aren't at the
- limit before appending. Silently return if we are.
-
-2001-07-16 Chris Toshok <toshok@ximian.com>
-
- [ Fix bug #4705 - LDAP storage gets saved with corrupted binddn]
-
- * gui/component/addressbook-config.c (addressbook_dialog_apply):
- call addressbook_storage_write_sources here after we're done
- rebuilding them.
-
- * gui/component/addressbook-storage.c
- (addressbook_storage_clear_sources): don't write the source file
- here.
- (addressbook_storage_add_source): same.
- (addressbook_storage_remove_source): same.
- (addressbook_storage_write_sources): new function, write the
- source file out.
- (addressbook_source_copy): g_strdup the binddn so we don't end up
- free'ing it multiple times thanks to copies freeing theirs.
-
- * gui/component/addressbook-storage.h: add prototype for
- address_storage_write_sources.
-
-2001-07-16 Iain Holmes <iain@ximian.com>
-
- * backend/pas/evolution-vcard-importer.c (ebook_create): Don't just
- use the default directory. Use the directory that is passed into the
- load file function.
-
-2001-07-15 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-destination.c (e_destination_set_string):
- Commented out some unused variables and labels.
- (e_destination_importv): Check for the xml not parsing correctly
- and just return NULL here.
-
- * gui/component/select-names/e-select-names-model.c
- (e_select_names_model_import_destinationv): Handle a NULL destv
- here.
-
-2001-07-15 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (table_drag_data_get): Added a
- call to e_table_view_to_model_row here.
- (e_addressbook_view_can_print, e_addressbook_view_can_delete,
- e_addressbook_view_can_copy): If the selection model is NULL here,
- return NULL (this was done before in a g_return_val_if_fail which
- is only conditionally included.)
-
-2001-07-13 Christopher James Lahey <clahey@ximian.com>
-
- * gui/contact-editor/contact-editor.glade: Changed Company to
- Organization here.
-
-2001-07-12 JP Rosevear <jpr@ximian.com>
-
- * backend/pas/Makefile.am: add ldap cflags
-
-2001-07-12 Jeffrey Stedfast <fejj@ximian.com>
-
- * backend/ebook/e-destination.c (e_destination_xml_decode):
- Oops. I introduced my own bug, accidently set `email' to a
- g_free'd pointer - eek!
-
-2001-07-12 Jeffrey Stedfast <fejj@ximian.com>
-
- * backend/ebook/e-destination.c (e_destination_importv): Optimized
- the same way I optimized g_strsplit. If you use a GPtrArray
- instead of a linked list, you save yourself from having to iterate
- through the list an extra 3 times.
- (e_destination_xml_decode): Do NOT, I repeat: do NOT!
- e_utf8_xml1_decode something which is already in UTF-8 or you'll
- corrupt it!! I smack thee who hath done this evil deed!
-
-2001-07-12 Iain Holmes <iain@ximian.com>
-
- * backend/e-book/evolution-vcard-importer.c (support_format_fn):
- Check for no extension. Actually same as Jason's fix below :) but
- also check the file contents.
-
-2001-07-12 JP Rosevear <jpr@ximian.com>
-
- * gui/component/addressbook-config.glade: add accelerators,
- taylor's patch
-
-2001-07-12 Jason Leach <jleach@ximian.com>
-
- * backend/ebook/evolution-vcard-importer.c (support_format_fn):
- Crash fix because strcmp() hates NULL arguments. Bug #3777.
-
-2001-07-11 Jason Leach <jleach@ximian.com>
-
- * gui/component/select-names/e-select-names.c (remove_cb): Added
- some comments for clarity and fixed a pretty noticable bug with
- how right click "Remove" was deleting more than it should with
- consecutive runs.
-
-2001-07-10 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/evolutionperson.schema: assign OID's to the schema
- entries, and add schema support for contact lists.
-
-2001-07-10 Christopher James Lahey <clahey@ximian.com>
-
- * backend/pas/pas-backend-file.c (pas_backend_file_load_uri): Set
- bf->priv->file_db before calling do_create.
-
-2001-07-06 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/addressbook-component.c (factory_fn): Fixed order
- of arguments to evolution_shell_component_new.
-
-2001-07-08 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-text-model.c
- (e_select_names_text_model_insert_length): Check that str isn't
- the empty string before doing an insert.
-
- * backend/ebook/e-destination.c (e_destination_set_string): We were
- being too smart for our own good here, and causing problems for
- the completion code... (bug #4253, bug #4255, bug #4280)
- (e_destination_set_name): Clear any cached address.
- (e_destination_set_email): Clear any cached address.
- (e_destination_get_address): Handle the cases where the name
- contains some e-mail information.
-
-2001-07-09 Kjartan Maraas <kmaraas@gnome.org>
-
- * gui/contact-list-editor/e-contact-list-editor.c: Marked a
- string for translation. Also add the neccesary includes to make
- _() macros work.
-
-2001-07-07 Jon Trowbridge <trow@ximian.com>
-
- * gui/widgets/e-minicard.c (add_field): Detect the embedded
- EDestination XML, and convert it to a nice-looking e-mail address.
-
- * gui/contact-list-editor/e-contact-list-editor.c: Adjusted to
- reflect changes to EContactListModel. (Yeah, this is vague,
- but the changes are _really_ obvious and boring.)
-
- * gui/contact-list-editor/e-contact-list-model.c: Revamped
- to make everything an EDestination, rather than storing either
- cards or strings.
-
- * gui/component/select-names/e-select-names-text-model.c
- (e_select_names_text_model_insert_length): Use
- e_destination_get_textrep.
-
- * gui/component/select-names/e-select-names-table-model.c
- (fill_in_info): Use e_destination_get_name and
- e_destination_get_email.
-
- * gui/component/select-names/e-select-names-popup.c
- (popup_menu_card): Use e_destination_get_name instead of
- e_card_name_to_string.
- (quick_add_cb): Use e_destination_get_address.
- (popup_menu_nocard): Use e_destination_get_name.
-
- * gui/component/select-names/e-select-names-model.c
- (e_select_names_model_changed): Removed obsolete debugging code.
- (e_select_names_model_get_textification): Use e_destination_get_textrep.
- (e_select_names_model_get_address_text): Use e_destination_get_address.
- (e_select_names_model_get_string): Use e_destination_get_textrep.
- (e_select_names_model_replace): Use e_destination_get_textrep.
- (e_select_names_model_name_pos): Use e_destination_get_textrep.
-
- * gui/component/select-names/e-select-names-completion.c
- (emailify_match): Match only if this isn't a contact list.
- (match_email): Match only if this isn't a contact list.
- (match_name): Do the right thing in the case of a contact list.
- (book_query_process_card_list): Don't construct a match for
- each possible e-mail address if this is a contact list.
-
- * backend/ebook/e-destination.c: Major-league de-crufting and
- rationalization, combined with lots of hacks to make things work
- properly with contact lists.
- (e_destination_copy): Copy contact list info.
- (e_destination_clear_card): Clear contact list info.
- (e_destination_is_empty): If we contain a contact list, we aren't
- empty.
- (e_destination_set_card_uri): Added. Allows us to set a
- destination by card URI.
- (e_destination_set_name): Allows the contact's name only ("Jane
- Smith") to be set.
- (e_destination_set_email): Allows the contact's e-mail only
- ("jane@assbarn.com") to be set.
- (e_destination_set_string): Takes a free-form string containing a
- contact's name and/or e-mail, and tries to do the right thing with
- it.
- (e_destination_contains_card): Renamed. Used to be
- e_destination_has_card.
- (e_destination_from_card): Added. Returns TRUE if the
- EDestination comes from either a ECard (which we presently hold)
- or is specified by an ECard URI.
- (e_destination_use_card): Allows an EDestination's ECard to be
- accessed, via a callback. If we only are holding the URI, the
- card will be loaded and stored in the EDestination.
- (e_destination_get_name): Returns the name only ("Jane Smith"), or
- NULL.
- (e_destination_get_email): Returns the email only
- ("jane@assbarn.com"), or NULL.
- (e_destination_get_address): Added. Returns a "full address" if
- both the name & e-mail are available ("Jane Smith
- <jane@assbarn.com>"), or just the e-mail if the name is unknown
- ("jane@assbarn.com>"). If the destination is a contact list,
- returns a comma-separated list of addresses.
- (e_destination_get_textrep): Added. Returns a "text
- representation" of the EDestination. This is what is now
- displayed for completed, "cardified" destinations in addressbook
- entries.
- (e_destination_is_evolution_list): Check to see if this
- destination is for a contact list.
- (e_destination_xml_encode): Added. Build an XML data structure
- representing an EDestination.
- (e_destination_xml_decode): Added. Parse an XML data structure,
- constructing an EDestination.
- (e_destination_export): Added. Returns a null-terminated string
- containing an XML representation of the EDestination, with
- newlines and excess whitespace removed.
- (e_destination_import): Added. Parses a string containing an XML
- representation of an EDestination.
- (e_destination_exportv): Added. Returns a null-terminated string
- containing an XML representation of a collection of EDestinations,
- with newlines and excess whitespace removed.
- (e_destination_importv): Added. Takes an XML representation of a
- collection of destinations, parses it, and returns a vector of
- EDestinations.
-
- * backend/ebook/e-card.c (e_card_duplicate): Copy the ->book
- pointer.
- (e_card_get_id): Check that the argument is valid.
- (e_card_set_id): Check that the argument is valid.
- (e_card_get_book): Added. Return the EBook the ECard came from.
- (e_card_get_uri): Added. Tries to returns a URI for the ECard,
- which is of the form (EBook URI)/(ECard unique ID). Returns NULL
- if the EBook URI or the ID are unknown/not set.
- (e_card_get_vobject): If we have the URI, use it as the
- VCUniqueStringProp, rather than just the ID. This is a hack to
- make DnD work properly.
- (parse_id): Detect if the unique ID we've been passed is a URI or
- just a plain card ID, and do the right thing in either case.
- (e_card_uri_extract_book_uri): Added. Convenience function for
- parsing card URIs.
- (e_card_uri_extract_card_id): Added. Convenience function for
- parsing card URIs.
- (e_card_load_uri): Added. Allows an ECard to be loaded by its
- URI.
-
- * backend/ebook/e-book-view.c: Added a EBook * to the
- _EBookViewPrivate struct. This is meant to contain the EBook the
- EBookView is associated with.
- (add_book_iterator): Added. A convenience function for attaching
- the EBook to a GList of cards (if no EBook is already stored).
- (e_book_view_do_added_event): Record the EBook in the added
- ECards.
- (e_book_view_do_modified_event): Record the EBook in the modified
- ECards.
- (e_book_view_set_book): Added. Stores a pointer to the
- EBookView's "parent" EBook.
- (e_book_view_init): Init book_view->priv->book to NULL.
- (e_book_view_destroy): Unref book_view->priv->book.
-
- * backend/ebook/e-book.c: Added a uri field to _EBookPrivate.
- (e_book_unqueue_op): Removed debugging spew.
- (e_book_do_response_get_view): Attach the current EBook to the
- created EBookView.
- (e_book_do_response_get_changes): Attach the current EBook to the
- created EBookView.
- (e_book_load_uri): Save a copy of the uri in the EBook.
- (e_book_get_uri): Added. Just returns book->priv->uri.
- (e_book_get_card): Attach a pointer to the Ebook to the
- newly-loaded ECard.
- (e_book_add_card): Attach a pointer to the EBook to the
- newly-added ECard.
- (e_book_commit_card): Attach a pointer to the EBook to the
- committed ECard.
- (e_book_init): Initialize the uri to NULL.
- (e_book_destroy): Free the uri string on destruction.
-
-2001-07-06 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-component.c (populate_context_menu):
- Removed. [It was just bogus testing code for the right-click menu
- populating interface in the shell].
- (factory_fn): Pass NULL as the PopulateContextMenuFn.
-
-2001-07-05 Anna Marie Dirks <anna@ximian.com>
-
- * gui/contact-list-editor/contact-list-editor.glade:
- Added some accelerators, padding, and a "memebers" frame;
- also fixed spacing and growth behaviour of this dialog.
-
-2001-07-05 Christopher James Lahey <clahey@ximian.com>
-
- * backend/pas/pas-backend-file.c (compare_category): Fix a memory
- leak here.
-
-2001-07-05 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card-compare.c (match_search_info_free): Set
- info->avoid = NULL. This shouldn't make a difference, but it
- can't hurt.
-
-2001-07-05 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-table-adapter.c
- (addressbook_is_cell_editable): Check if the row is within our
- table and return from this function as if the card is a standard
- card, not a list.
-
-2001-07-03 Damon Chaplin <damon@ximian.com>
-
- * backend/ebook/Makefile.am (evolution_vcard_importer_LDADD):
- added $(BONOBO_CONF_LIBS) to get it to compile.
-
-2001-07-02 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/Makefile.am (evolution_addressbook_LDADD): Added
- $(BONOBO_CONF_LIBS).
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_create_categories),
- gui/contact-editor/e-contact-editor.c (categories_clicked):
- Switched to an ECategoriesMasterListWombat instead of an
- ECategoriesMasterListArray here.
-
-2001-07-02 Peter Williams <peterw@ximian.com>
-
- * gui/contact-editor/Makefile.am (INCLUDES): srcdir !=
- builddir compile fix.
-
- * gui/contact-list-editor/Makefile.am (INCLUDES): Same.
-
- * gui/widgets/Makefile.am (INCLUDES): Same.
-
- * gui/search/Makefile.am (INCLUDES): Same.
-
-2001-07-02 Christopher James Lahey <clahey@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c (categories_clicked):
- Turned off wombatification of the categories master list here.
-
-2001-07-01 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-list-editor/e-contact-list-editor.c (fill_in_info):
- use ECARD_UID_LINK_PREFIX.
-
- * gui/contact-list-editor/e-contact-list-model.c
- (e_contact_list_model_get_email): use ECARD_UID_LINK_PREFIX.
-
- * backend/ebook/e-destination.h: add prototype for
- e_destination_importv_list.
-
- * backend/ebook/e-destination.c (e_destination_importv_list): new
- function, take an ECard corresponding to an address list and
- resolve any linked cards, returning an EDestination vector.
-
- * backend/ebook/e-card.h (ECARD_UID_LINK_PREFIX): #define this here,
- since we need to use it in a few places.
-
-2001-07-02 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card.c, backend/ebook/e-card.h: Added
- related_contacts field.
-
- * gui/component/select-names/e-select-names-model.c,
- gui/component/select-names/e-select-names-model.h
- (e_select_names_model_import_destinationv): Added this function.
-
- * gui/contact-editor/contact-editor.glade: Replaced the entry here
- for related contacts with a table which is filled in in the C code.
-
- * gui/contact-editor/e-contact-editor.c,
- gui/contact-editor/e-contact-editor.h (add_lists): Added a select
- names entry here for the related contacts field.
-
- * gui/widgets/Makefile.am: Removed all the test programs here
- since there are circular dependencies now.
-
-2001-07-01 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-destination.c (e_destination_get_string): Fall
- back to use the name field if all else fails (which can happen
- with imported EDestinations).
-
- * backend/ebook/e-destination.c (e_destination_is_empty): Fix for the
- "recipient not specified" bug --- we were not correctly checking
- for whether or not an EDestination was actually empty.
-
-2001-06-30 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-card.c (e_card_evolution_list): Check args.
- Somewhere in the code (somewhere in the minicard stuff) this can
- be called with a NULL arg, which was causing crashes.
- (e_card_evolution_list_show_addresses): Check args.
-
- * backend/ebook/e-destination.c (build_field): I was accidentally
- comparing characters and strings here, and didn't see the compiler
- warning. Fixed.
- (e_destination_exportv): Don't export any empty destinations.
- (bug#3825).
-
-2001-06-30 Zbigniew Chyla <cyba@gnome.pl>
-
- * gui/component/e-address-popup.c (e_address_popup_construct): Marked
- strings for translation.
-
-2001-06-30 Jon Trowbridge <trow@ximian.com>
-
- * gui/merging/e-card-merging.c (match_query_callback): Make the
- standard for considering two cards to be match stricter.
-
- * gui/component/select-names/e-select-names-completion.c
- (make_match): Use the card's use-score to set the match's
- sort_major value.
- (match_name): Removed obsolete code.
- (e_select_names_completion_begin): Added (double) cast to make
- match->score calculation come out properly.
-
- * backend/ebook/e-card.c: Added X-EVOLUTION-LAST-USE and
- X-EVOLUTION-USE-SCORE to attribute_jump_array.
- (e_card_get_today): Added. A convenience routine for getting
- today's date and putting it in a GDate.
- (e_card_get_use_score): Added. Compute the current, time-decayed,
- use-score for the card.
- (e_card_touch): Increment the use-score by one; update the last
- used date.
- (e_card_date_to_string): Added as a convenience routine, getting
- rid of some code duplication.
- (e_card_get_vobject): Add handlers for X-EVOLUTION-USE-SCORE and
- X-EVOLUTION-LAST-USE.
- (parse_last_use): Added.
- (parse_use_score): Added.
- (e_card_class_init): Added args for last-use and use-score.
- (e_card_get_arg): Added handlers for last-use and use-score.
- o
- (e_card_set_arg): Added handlers for last-use and use-score.
-
- * backend/ebook/e-destination.c: Added pending_card_id to
- EDestinationPrivate struct.
- (e_destination_copy): Copy the pending_card_id.
- (e_destination_is_empty): Check for a pending_card_id. We are
- non-empty if we have one.
- (e_destination_clear_card): Clear pending_card_id.
- (e_destination_set_card): Clear pending_card_id.
- (e_destination_has_pending_card): Added.
- (e_destination_use_card): Added. An asynchronous way to load a
- pending card and then apply a callback to it.
- (build_field): Be paranoid, map our special characters to '_'.
- (e_destination_export): Use EXPORT_MAX_FIELDS symbol rather than a
- hard-wired array size. Added the "card" entry.
- (e_destination_import): Fix bug in handling of the "name" field.
- Process the "card" field.
- (e_destination_touch): "Touch" and commit the ECard corresponding
- to the e-mail address in the destination. (A query against the
- local addressbook is actually performed, in case the destination
- isn't cardified.
-
- * backend/ebook/e-card-compare.c (e_card_compare_name): Revamp the
- way E_CARD_MATCH_FOO results are mapped to comparison results.
- Report better matches when the family name is matched.
-
-2001-06-29 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names.c (update_query):
- Added a search field to the query here.
- (e_select_names_init): Update the query on a number of signals here.
-
- * gui/component/select-names/e-select-names.h: Added search_entry
- here.
-
- * gui/component/select-names/select-names.glade: Added the search
- entry here. Added some labels. Removed the update button.
-
-2001-06-29 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_option_activated): Change the uri here to have
- addressbook.db at the end.
-
- * gui/component/select-names/select-names.glade: Changed the name
- of the folder option menu here to match the name used in the code.
-
-2001-06-29 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names.c (update_query):
- Change the query when the "Update List" button is pushed.
-
- * gui/component/select-names/e-select-names.h: Removed
- currently_selected field. Added categories_entry field.
-
- * gui/component/select-names/select-names.glade: Added "Update
- List" button.
-
-2001-06-29 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/Makefile.am (INCLUDES): add EVOLUTION_IMAGESDIR
- define.
-
- * gui/widgets/e-minicard.h (struct _EMinicard): add our pixbuf and
- pixbuf size.
-
- * gui/widgets/e-minicard.c (e_minicard_init): init the icon pixbuf
- and its size.
- (e_minicard_destroy): unref the list_icon_pixbuf.
- (e_minicard_realize): create the list_icon GnomeCanvasPixbuf.
- (e_minicard_resize_children): clip the header_text by the
- list_icon, and place the list_icon in the right spot.
- (remodel): show the list_icon if we're a list, and hide it
- otherwise.
-
-2001-06-28 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (table_double_click): pop up
- list editor for lists, contact editor otherwise.
-
- * gui/widgets/e-minicard.c (e_minicard_event): same.
-
- * gui/widgets/e-minicard.h (struct _EMinicard): change "editor" to
- GtkOjbect, since it can be either a contact editor or contact list
- editor.
-
- * gui/widgets/e-addressbook-table-adapter.c
- (addressbook_is_cell_editable): don't allow editting of any fields
- except the name and file_as for lists.
-
-2001-06-28 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-list-editor/Makefile.am (INCLUDES): remove ancient
- e-table include, and add include for contact-editor so we can
- reuse the confirm_delete dialog.
-
- * gui/contact-list-editor/e-contact-list-editor.h (struct
- _EContactListEditor): remove prototype for
- e_contact_list_editor_close, since the function no longer exists.
-
- * gui/contact-list-editor/e-contact-list-editor.c
- (list_deleted_cb): new function, emit our "list_deleted" signal.
- (delete_cb): new function, called from the Delete toolbar item.
- (e_contact_list_editor_raise): flesh out function.
- (extract_info): "evolution_list" => "list".
- (fill_in_info): same.
-
-2001-06-28 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-card.c (e_card_get_vobject): add support for
- X-EVOLUTION-LIST and X-EVOLUTION-LIST-SHOW-ADDRESSES.
- (parse_list): new function, parse the boolean X-EVOLUTION-LIST.
- (parse_list_show_addresses): new function, parse the boolean
- X-EVOLUTION-LIST-SHOW-ADDRESSES.
- (e_card_class_init): add args for "list" and
- "list_show_addresses".
- (e_card_set_arg): add support for list and list_show_addresses.
- (e_card_get_arg): same.
- (e_card_init): init list and list_show_addresses.
-
-2001-06-27 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-component.c (factory_fn): Pass NULL as
- the @external_uri_schemas argument to
- `evolution_shell_component_new()'.
-
-2001-06-27 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-list-editor/e-contact-list-model.c
- (contact_list_row_count): track storage change - we're only using
- 1 array now.
- (contact_list_value_at): same.
- (contact_list_model_destroy): same.
- (e_contact_list_model_init): same.
- (e_contact_list_model_add_email): same.
- (e_contact_list_model_add_card): same.
- (e_contact_list_model_remove_row): same.
- (e_contact_list_model_remove_all): new function - just free/unref
- all existing rows.
- (e_contact_list_model_get_email): new function, returns the
- alloc'ed string containing either an email address or an encoded
- ECardId.
-
- * gui/contact-list-editor/e-contact-list-model.h: remove the 2
- separate arrays for email and cards, and store them in the same
- array.
-
- * gui/contact-list-editor/e-contact-list-editor.h (struct
- _EContactListEditor): add the visible_addr_checkbutton widget.
-
- * gui/contact-list-editor/e-contact-list-editor.c
- (visible_addrs_toggled_cb): new function.
- (e_contact_list_editor_init): connect to "toggled" on
- visible_addrs_checkbutton.
- (file_save_cb): new function.
- (tb_save_and_close_cb): new function.
- (verbs): add Save and Save & Close.
- (list_added_cb): new function.
- (list_modified_cb): new function.
- (save_card): new function - we do *not* use e_card_merging_* calls
- here.
- (e_contact_list_editor_get_arg): un-#if 0 code in the "card"
- getter.
- (e_contact_list_editor_set_arg): same for the "card" setter.
- (extract_info): new function.
- (fill_in_info): new function.
-
- * gui/contact-list-editor/contact-list-editor.glade: add a
- checkbutton at the bottom to determine whether to visibly include
- mail addresses in mail sent to this list.
-
-2001-06-26 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_create_categories): Oops. Can't use the wombat
- version of the master categories list yet.
-
-2001-06-26 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-table-adapter.c (create_card): memmove
- counts were off in this function.
- (remove_card, modify_card): Moved the table notifications around a
- bit here.
-
-2001-06-26 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names.c,
- gui/component/select-names/e-select-names.h,
- gui/component/select-names/select-names.glade
- (e_select_names_create_categories): Added a categories combo here.
- It's not used yet.
-
-2001-06-26 Christopher James Lahey <clahey@ximian.com>
-
- * gui/search/addresstypes.xml: Added category searching to the
- advanced search dialog here.
-
-2001-06-26 Christopher James Lahey <clahey@ximian.com>
-
- * backend/pas/pas-backend-file.c (compare_category): Added
- category searching to the file backend.
-
- * gui/component/addressbook.c (addressbook_query_changed): Added
- category searching to the search bar.
-
-2001-06-25 Peter Williams <peterw@ximian.com>
-
- * conduit/Makefile.am (INCLUDES): Fix for srcdir != builddir.
-
-2001-06-25 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-list-editor/contact-list-editor.glade: change layout
- slightly, the icon no longer pushes everything to the left, and
- make the buttons on the right smaller and more in line with the
- other widgets.
-
- * gui/contact-list-editor/e-contact-list-model.c
- (contact_list_value_at): return the SimpleAndString->string
- instead of querying the ecardsimple.
- (e_contact_list_model_init): initially allocate 10 of each type
- (email and simple).
- (e_contact_list_model_add_email): realloc if need be.
- (e_contact_list_model_add_card): same, and initialize the string
- displayed to be "[Name] [<email>]".
- (e_contact_list_model_remove_row): change for SimpleAndString.
- (contact_list_model_destroy): free our 2 arrays.
-
- * gui/contact-list-editor/e-contact-list-model.h: add alloc counts
- and the SimpleAndString struct.
-
- * gui/contact-list-editor/e-contact-list-editor.c: Helix Code =>
- Ximian.
- (e_contact_list_editor_init): hook up d&d destination signals, and
- un-#if 0 the delete_event signal.
- (table_drag_motion_cb): new function.
- (table_drag_drop_cb): new function.
- (table_drag_data_received_cb): new function.
- (file_close_cb): new function.
- (verbs) uncomment the close verb.
- (close_dialog): new function.
- (app_delete_event_cb): new function.
-
- * gui/contact-list-editor/e-contact-list-editor.h: Helix Code =>
- Ximian.
-
-2001-06-25 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/e-address-popup.c: Add a huge steaming pile of
- code to handle the case of single-address merging. In other
- words, if you go to "harvest" an address by right-clicking on it
- in the mail viewer, and you already have a closely-matching
- contact (w/ a different e-mail address), this gives you the
- option of editting that contact's e-mail addresses to add the
- one you just clicked on.
-
- * backend/ebook/e-card-compare.c (match_search_info_free): It is
- amazing how much better things work when you don't try to
- dereference the pointer you just freed.
-
-2001-06-24 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/Makefile.am (minicard_test_LDADD): correct path to
- libecontacteditor.a.
- (minicard_widget_test_LDADD): same.
- (INCLUDES): same, for the includes.
-
- * gui/widgets/e-minicard.h: correct e-contact-editor.h path.
-
- * gui/widgets/e-addressbook-util.h: correct path to
- e-contact-editor.h, and add e-contact-list-editor.h. Add
- prototype for e_addressbook_show_contact_list_editor.
-
- * gui/widgets/e-addressbook-util.c: remove #include
- "e-contact-editor.h" (our header includes it.)
- (added_cb): rename card_added_cb to this, and make it so it can be
- reused in both the list and card cases. remove the g_print too.
- (modified_cb): same for modified case.
- (deleted_cb): same for deleted case.
- (editor_closed_cb): change first arg to GtkObject* so we can reuse
- this for both list and card.
- (e_addressbook_show_contact_editor): use added_cb, modified_cb,
- deleted_cb, and pass FALSE as user_data.
- (e_addressbook_show_contact_list_editor): new function, same as
- above but creating a contact-list-editor, and pass TRUE as
- user_data.
-
- * gui/component/e-address-popup.c: correct path to contact-editor.
-
- * gui/component/e-address-widget.c: same.
-
- * gui/component/select-names/e-select-names-popup.c: same.
-
- * gui/component/select-names/e-select-names-text-model.c: same.
-
- * gui/component/addressbook.c (new_contact_list_cb): new function.
- (update_command_state): update ContactNewList command.
- (verbs): remove ViewAll from the toolbar from the verb list. Add
- ContactNewList.
- (pixmaps): same for pixmaps.
-
- * gui/component/Makefile.am (evolution_addressbook_LDADD): new
- path for contact-editor.
- (INCLUDES): same.
-
- * gui/contact-list-editor/e-contact-list-model.h:
- * gui/contact-list-editor/e-contact-list-model.c:
- * gui/contact-list-editor/e-contact-list-editor.h:
- * gui/contact-list-editor/e-contact-list-editor.c:
- * gui/contact-list-editor/Makefile.am: Initial contact-list editor
- commit.
-
- * gui/Makefile.am (SUBDIRS): add contact-editor.
-
- * Makefile.am: (SUBDIRS): remove contact-editor.
-
-2001-06-21 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-popup.c
- (make_contact_editor_cb): Renamed. (The old name,
- edit_contact_info_have_book_cb was a hold-over from before, when
- we weren't using e_book_use_local_address_book.)
-
- * gui/component/e-address-popup.c
- (e_address_popup_schedule_refresh): A Added. We now do the name
- refreshes in an idle function, rather than in the setters.
- (e_address_popup_set_free_form): Added. Properly handle inputs of
- the form "Foo <bar@zar.com>", extracting the name and e-mail
- address.
- (e_address_popup_set_name): Check to make sure that the free-form
- handler shouldn't be used to handle the input. Schedule a refresh
- after making any changes.
- (e_address_popup_set_email): Check to make sure that the free-form
- handler shouldn't be used to handle the input. Schedule a refresh
- after making any changes.
- (e_address_popup_name_only_matches): Temporary place-holder for
- handling name-only matches.
- (query_cb): If our initial query fails (and included e-mail
- information), do a name-only query. This is to handle the case of
- adding new e-mail addresses to existing contacts.
- (e_address_popup_query): Eliminated the "common_book" crap; using
- e_book_use_local_address_book instead.
-
- * backend/ebook/e-card-compare.c (match_search_info_free): Make
- sure that the ->avoid list gets properly freed.
-
-2001-06-20 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_process_get_supported_fields): fix a refcounting
- memleak.
-
-2001-06-20 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book-listener.c
- (e_book_listener_queue_get_supported_fields_response): fix memory
- leak.
-
-2001-06-20 Chris Toshok <toshok@ximian.com>
-
- * contact-editor/e-contact-editor.c: add prototype for
- close_dialog to remove warnings.
-
-2001-06-20 Dave Camp <dave@ximian.com>
-
- * backend/ebook/e-card.c (e_card_list_send): Changed attach_data
- to be a GNOME_Evolution_Composer_AttachmentData rather than a
- CORBA_char*.
-
-2001-06-19 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (table_double_click): track
- change to e_addressbook_show_contact_editor signature.
-
- * gui/widgets/e-minicard-view.c (e_minicard_view_event): same.
-
- * gui/widgets/e-minicard.c (e_minicard_event): same.
-
- * gui/widgets/e-addressbook-util.c (e_addressbook_error_dialog):
- add an entry for "Card ID already exists".
- (e_addressbook_show_contact_editor): track the change to signal
- names and e_contact_editor_new signature here.
-
- * gui/widgets/e-addressbook-util.h: change
- e_addressbook_show_contact_editor's signature to match
- e_contact_editor_new more closely.
-
- * gui/widgets/e-addressbook-table-adapter.c (unlink_model): free
- up the simple mapping to plug a potentially sizeable memory leak.
-
- * gui/component/select-names/e-select-names-text-model.c
- (e_select_names_text_model_activate_obj): call
- e_addressbook_show_contact_editor here.
-
- * gui/component/select-names/e-select-names-popup.c
- (edit_contact_info_have_book_cb): remove the get_supported_fields
- stuff, since the contact editor handles it for us now, and call
- e_addressbook_show_contact_editor.
-
- * gui/component/e-address-popup.c (edit_contact_info_cb): same.
-
- * gui/component/addressbook.c (new_contact_cb): track change to
- e_addressbook_show_contact_editor.
-
-2001-06-19 Chris Toshok <toshok@ximian.com>
-
- * contact-editor/e-contact-quick-add.c (ce_have_book): rename
- ce_book_found_fields to this, remove the fetching of fields (the
- contact editor code handles that now.), and change the add_card
- signal to card_added.
- (card_added_cb): copied somewhat from merge_cb above. we don't
- need to do the merge here, just call the callback.
-
- * contact-editor/e-contact-editor.c (e_contact_editor_class_init):
- track signal change. add book arg, and is_read_only -> editable.
- (wants_html_changed): if the card isn't already changed, flag it
- as such (and update the commands.)
- (phone_entry_changed): same.
- (email_entry_changed): same.
- (address_text_changed): same.
- (name_entry_changed): same.
- (company_entry_changed): same.
- (full_name_clicked): is_read_only -> editable.
- (full_addr_clicked): same.
- (card_added_cb): new function, emit our card_added signal, and
- close the dialog if we're supposed to. properly deal with error
- status here.
- (card_modified_cb): same, modulo card_added -> card_modified.
- (save_card): actually call e_card_merging_book_{add/commit}_card
- instead of using a signal. Also, add a gboolean arg to tell
- whether or not to close the dialog after saving the card.
- (card_deleted_cb): new function, just emit our "card_deleted"
- signal.
- (delete_cb): actually call e_book_remove_card here, instead of
- using a signal.
- (tb_save_and_close_cb): call save_card with TRUE for should_close.
- (e_contact_editor_init): init changed = FALSE;
- (e_contact_editor_destroy): unref our book if we have one.
- (e_contact_editor_new): new signature, set the "book" arg, and
- call e_book_get_supported_fields here.
- (supported_fields_cb): new function, show the contact editor.
- (e_contact_editor_set_arg): initialize changed to FALSE when
- setting the card (but *after*, since the changed callbacks will
- set it to TRUE.) also, call command_state_changed if editable
- changes. also handle setting "book". oh, and is_read_only ->
- editable.
- (command_state_changed): new function - set the state of the
- commands we care about.
- (e_contact_editor_get_arg): add "book" handling, and is_read_only
- -> editable.
- (_phone_arrow_pressed): is_read_only -> editable.
- (_email_arrow_pressed): same.
- (_address_arrow_pressed): same.
- (enable_writable_fields): same.
- (set_editable): rename set_read_only to this, and is_read_only ->
- editable.
-
- * contact-editor/e-contact-editor.h (struct _EContactEditor):
- is_read_only -> editable, add a "changed" flag so we can sensitize
- commands correctly, and add an EBook* arg to e_contact_editor_new
- and to the EContactEditor struct. Also, change all the signals to
- past tense, and send the EBookStatus in them.
-
- * contact-editor/e-contact-editor-address.c
- (e_contact_editor_address_class_init): is_read_only -> editable.
- (e_contact_editor_address_set_arg): same.
- (e_contact_editor_address_get_arg): same.
-
- * contact-editor/e-contact-editor-address.h (struct
- _EContactEditorAddress): same.
-
- * contact-editor/e-contact-editor-fullname.c
- (e_contact_editor_fullname_class_init): same.
- (e_contact_editor_fullname_set_arg): same.
- (e_contact_editor_fullname_get_arg): same.
-
- * contact-editor/e-contact-editor-fullname.h (struct
- _EContactEditorFullname): same.
-
- * contact-editor/Makefile.am: don't build contact-editor-test now,
- until contact-editor gets moved to gui/ and we can more easily
- depend on the e_card_merging_* calls.
-
- * backend/pas/pas-backend-ldap.c (ldap_error_to_response): return
- CardIdAlreadyExists for LDAP_ALREADY_EXISTS.
-
- * backend/idl/addressbook.idl: Add CardIdAlreadyExists to the
- BookListener status enum.
-
- * backend/ebook/e-book-types.h: add
- E_BOOK_STATUS_CARD_ID_ALREADY_EXISTS.
-
- * backend/ebook/e-book-listener.c
- (e_book_listener_convert_status): add support for
- CardIdAlreadyExists.
-
-2001-06-19 Jon Trowbridge <trow@ximian.com>
-
- * contact-editor/e-contact-quick-add.c: Serious de-crufting,
- removal of gtk_object_set_data() hacks, simplified by using
- some of the newer ebook convenience routines, etc.
- (ce_book_found_fields):
- s/e_contact_editor_raise/e_contact_editor_show/, to accomodate the
- small changes in the contact editor API.
-
-2001-06-18 Eskil Heyn Olsen <eskil@eskil.dk>
-
- * conduit/address-conduit.c: (check_for_slow_setting),
- (conduit_get_gpilot_conduit):
- Tweaked for some gnome-pilot api changes
-
-2001-06-15 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (search_for_dn): implement this
- properly, using base and (objectclass=*).
-
-2001-06-14 Chris Toshok <toshok@ximian.com>
-
- * contact-editor/e-contact-editor.c (delete_cb): save ourselves a
- function call - call close_dialog instead of file_close_cb.
-
-2001-06-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * gui/component/addressbook-component.c: Set the
- "expoted_dnd_types" to NULL in the folder_types.
-
-2001-06-11 Dan Winship <danw@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (search_override_check): Add a workaround for an EText bug.
- (e_select_names_completion_begin): Fix up the match scoring in the
- search_override case so the lines are offered in the correct
- order.
-
-2001-06-11 Christopher James Lahey <clahey@ximian.com>
-
- * gui/merging/Makefile.am (glade_DATA): Added
- e-card-merging-book-commit-duplicate-detected.glade here.
-
- * gui/merging/e-card-merging-book-commit-duplicate-detected.glade:
- Added this file. The GUI for asking whether to commit a modified
- card.
-
- * gui/merging/e-card-merging.c, gui/merging/e-card-merging.h
- (e_card_merging_book_commit_card): Added this function.
-
- * gui/widgets/e-addressbook-table-adapter.c
- (addressbook_set_value_at), gui/widgets/e-addressbook-util.c
- (commit_card_cb), gui/widgets/e-minicard.c (e_minicard_event): Use
- e_card_merging_book_commit_card instead of e_book_commit_card here.
-
-2001-06-11 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card-simple.c, backend/ebook/e-card-simple.h:
- Made e_card_simple_get_id return const char *.
-
- * backend/ebook/e-card.c, backend/ebook/e-card.h: Made
- e_card_get_id return const char *.
-
- * gui/component/e-cardlist-model.c (e_cardlist_model_add): Made id
- variable const here. Added a break to make it slightly more
- efficient.
-
- * gui/widgets/e-minicard.c, gui/widgets/e-minicard.h: Made
- e_minicard_get_card_id return const char *.
-
-2001-06-11 Christopher James Lahey <clahey@ximian.com>
-
- * backend/pas/pas-backend-file.c (entry_compare): Made this handle
- the "id" property in searches.
- (pas_backend_file_process_modify_card): Made id variable const
- here.
-
- * backend/pas/pas-backend-ldap.c (modify_card_handler): Made id
- variable const here.
-
-2001-06-11 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-book-listener.c,
- backend/ebook/e-book-listener.h, backend/ebook/e-book.c: Rolled
- back the change 2 ago, dated 06/11/2001 01:51 in CVS, involving
- e-book-listener.[ch] and e-book.c.
-
-2001-06-11 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-book.c (e_book_load_uri,
- e_book_get_supported_fields, e_book_authenticate_user,
- e_book_remove_card_by_id, e_book_add_vcard, e_book_commit_vcard,
- e_book_get_cursor, e_book_get_book_view, e_book_get_changes): Made
- it so that all of these functions queue their ops before calling
- their CORBA functions. This way, if the response is sent back
- before the CORBA function returns there's no problem. Added
- e_book_unqueue_op so that the op could be unqueued if the CORBA
- call fails.
-
-2001-06-11 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-book-listener.c, backend/ebook/e-book-listener.h
- (e_book_listener_unpop_response): Added this function to put a
- response back into the queue.
-
- * backend/ebook/e-book.c (e_book_check_listener_queue,
- e_book_queue_op): Handle the case where the op hasn't been queued
- yet when we get the response. In this case we unpop the response.
- Also, when queueing an op, we check to see if there are any
- responses waiting.
-
- * This change has been reverted.
-
-2001-06-11 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card-compare.c, backend/ebook/e-card-compare.h
- (e_card_locate_match_full): Added this function to let you do
- slightly more complicated searches.
-
- * gui/merging/e-card-merging.c (e_card_merging_book_add_card): Use
- e_card_locate_match_full to check if the card exists in the book
- it's being added to instead of in the default book.
-
-2001-06-09 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (match_name): Removed unused email variable.
-
-2001-06-09 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card-compare.c (use_common_book_cb): Null
- terminate the strv here.
- (e_card_locate_match): ref here instead of unref.
-
- * backend/ebook/e-card-simple.c (e_card_simple_get): Handle a NULL
- card here.
-
- * contact-editor/Makefile.am (INCLUDES), gui/widgets/Makefile.am
- (INCLUDES): Added addressbook/gui/merging here.
-
- * contact-editor/e-contact-quick-add.c (book_ready_cb),
- gui/component/addressbook-component.c (dnd_drop_book_open_cb),
- gui/widgets/e-addressbook-table-adapter.c
- (addressbook_append_row), gui/widgets/e-addressbook-util.c
- (add_card_cb), gui/widgets/e-addressbook-view.c
- (selection_received), gui/widgets/e-minicard-control.c
- (book_open_cb): Use e_card_merging_book_add_card instead of
- e_book_add_card here.
-
- * gui/Makefile.am (SUBDIRS): Added merging.
-
- * gui/component/Makefile.am (evolution_addressbook_LDADD),
- gui/widgets/Makefile.am (minicard_test_LDADD,
- minicard_widget_test_LDADD): Added libecardmerging.a here.
-
- * gui/merging/, gui/merging/.cvsignore, gui/merging/Makefile.am:
- New addressbook library.
-
- * gui/merging/e-card-duplicate-detected.glade: Glade file for
- duplicate detected dialog.
-
- * gui/merging/e-card-merging.c, gui/merging/e-card-merging.h: New
- files for detecting duplicates before adding and putting up a
- dialog if duplicates are found.
-
- * gui/widgets/e-minicard-view.c: Include e-addressbook-util.h
- here.
-
-2001-06-08 Chris Toshok <toshok@ximian.com>
-
- * contact-editor/e-contact-editor.c (e_contact_editor_new): remove
- the gtk_widget_show call...
- (e_contact_editor_show): and put it here.
-
- * contact-editor/e-contact-editor.h: add prototype for
- e_contact_editor_show.
-
- * gui/widgets/e-minicard.c (e_minicard_event): call
- e_addressbook_show_contact_editor.
- (card_modified_cb): call e_addressbook_error_dialog if status !=
- SUCCESS.
-
- * gui/widgets/e-minicard-view.c (e_minicard_view_event): call
- e_addressbook_show_contact_editor. also, use card_modified_cb as
- the commit_card callback.
-
- * gui/widgets/e-addressbook-view.c (table_double_click): clean
- this area up alot, call e_addressbook_show_contact_editor.
- (card_deleted_cb): call e_addressbook_error_dialog.
-
- * gui/widgets/e-addressbook-table-adapter.c
- (card_modified_cb): new function, call e_addressbook_error_dialog
- if the status != SUCCESS.
- (addressbook_set_value_at): use card_modified_cb as the callback
- for e_book_commit_card.
-
- * gui/widgets/Makefile.am (libeminicard_a_SOURCES): add
- e-addressbook-util.[ch].
-
- * gui/component/addressbook.c (new_contact_cb): use
- e_addressbook_show_contact_editor here.
-
-2001-06-05 Christopher James Lahey <clahey@ximian.com>
-
- * contact-editor/e-contact-editor.c (categories_clicked): Remove
- references to ECategoryMasterListWombat.
-
-2001-06-05 Jason Leach <jleach@ximian.com>
-
- * gui/component/select-names/e-select-names.c (remove_cb): Make
- this work when multiple names are selected then right
- click->Remove.
-
-2001-06-05 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card.c (e_card_set_arg): Copy dates as they come
- in.
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_changes_foreach_key, pas_backend_file_changes,
- pas_backend_file_process_remove_card,
- pas_backend_file_process_modify_card,
- pas_backend_file_build_all_cards_list, pas_backend_file_get_vcard,
- pas_backend_file_maybe_upgrade_db): memset DBTs to 0 before using
- them.
- (pas_backend_file_build_all_cards_list): Reindented.
-
- * contact-editor/contact-editor.glade: Replaced GnomeDateEdits
- with a custom widget that creates an EDateEdit.
-
- * contact-editor/e-contact-editor.c: Use an EDateEdit here instead
- of a GnomeDateEdit.
-
-2001-06-05 Jason Leach <jleach@ximian.com>
-
- (Fix bug #655: SelectNames doesn't let you remove addresses after
- you add them)
-
- * gui/component/select-names/e-select-names.c
- (section_right_click_cb): New function, provides a popup menu with
- just "Remove" in it.
- (remove_cb): New callback to do the remove.
- (e_select_names_add_section): Attach the "right_click" signal to
- the section_right_click_cb above.
-
-2001-06-05 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-manager.c
- (completion_handler): Change the completion handler to use the
- ECompletionMatch.
-
- * gui/component/select-names/e-select-names-completion.c
- General changes to convert for ECompletionMatch use.
- (emailify_match): Use extra sort keys in ECompletionMatch to let
- us ensure that the primary email address is always the first
- option, the secondary comes second, etc. There was no nice way to
- do this previously.
- (match_name): Removed code that adjusted score based on
- similarities between the "real name" and the e-mail address. It
- seemed like a good idea at the time, but produced unexpected and
- confusing results.
-
-2001-06-04 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-card-compare.c: Added. Code for testing
- if two ECards appear to pertain to the same contact (using loose
- matching rules, as opposed to requiring exact equality) and to
- query the addressbook for the "best match" to ECard.
-
-2001-06-03 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c (set_status_message): remove spew,
- and don't call the ShellView CORBA method if the interface doesn't
- exist (for whatever reason.)
-
- * gui/widgets/e-addressbook-view.c (e_addressbook_view_destroy):
- unref the EAddressbookModel.
- (create_minicard_view): unref the adapter.
- (card_added_cb): call e_book_error_dialog if status != SUCCESS.
- (card_modified_cb): same.
- (card_removed_cb): new function, and same.
- (delete_card_cb): pass card_removed_cb as the callback.
- (emit_status_message): new function, just emit status_message.
- (status_message): change to call emit_status_message.
- (card_deleted_cb): emit_status_message ("Done."), and call
- e_book_error_dialog if status != SUCCESS.
- (do_remove): pass view in the closure arg.
- (e_addressbook_view_delete_selection): emit status "Removing
- cards..." before starting the removal.
- (e_book_error_dialog): new function - pop up a (possibly) helpful
- message about why an operation failed.
-
- * gui/widgets/e-minicard-view-widget.c
- (e_minicard_view_widget_new): ref the EAddressbookReflowAdapter.
- (e_minicard_view_widget_destroy): unref the adapter.
- (e_minicard_view_widget_get_selection_model): if there isn't a
- minicard view return NULL.
-
- * gui/widgets/e-addressbook-table-adapter.c
- (e_addressbook_table_adapter_construct): ref the
- EAddressbookModel.
-
- * gui/widgets/e-addressbook-reflow-adapter.c
- (addressbook_finalize): rename this from addressbook_destroy, to
- reflect the method change.
- (e_addressbook_reflow_adapter_class_init): same.
- (e_addressbook_reflow_adapter_construct): ref the
- EAddressbookModel.
-
- * gui/widgets/e-addressbook-model.h: add editable_set flag.
-
- * gui/widgets/e-addressbook-model.c (writable_status): only record
- the writable state of the addressbook if the user hasn't set it.
- (e_addressbook_model_init): init editable_set to FALSE.
- (e_addressbook_model_set_arg): set editable_set to TRUE.
-
-2001-06-03 Ettore Perazzoli <ettore@ximian.com>
-
- * backend/ebook/Makefile.am (evolution_vcard_importer_LDADD): Move
- `$(DB3_LDADD)' before libeutil.
-
-2001-06-01 Ettore Perazzoli <ettore@ximian.com>
-
- * backend/ebook/Makefile.am (evolution_vcard_importer_LDADD): Add
- $(DB3_LDADD)'.
-
-2001-05-31 Christopher James Lahey <clahey@ximian.com>
-
- * backend/pas/Makefile.am (INCLUDES): Added db3 cflags.
-
- * backend/pas/pas-backend-file.c: Updated this to use db3.
-
-2001-05-31 Federico Mena Quintero <federico@ximian.com>
-
- * gui/widgets/e-addressbook-view.h (EAddressbookView): Added
- fields for the GalViewMenus and GalViewCollection; we need to keep
- them around while the component is active.
-
- * gui/widgets/e-addressbook-view.c
- (e_addressbook_view_setup_menus): Plug leak; unref the spec.
- Unref the factories. Do not unref the collection, since we need
- it for the signal emission (okay, so the views object adds a
- reference to it, but if we are interested in it we should keep a
- reference anyways).
- (e_addressbook_view_setup_menus): Create the collection and views
- on the EAddressbookView's fields so that we can keep them around.
- (e_addressbook_view_discard_menus): New function; gets rid of the
- collection and views objects.
-
- * gui/component/addressbook.c (control_activate_cb): Call
- e_addressbook_view_discard_menus().
-
-2001-05-31 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names.h (struct
- _ESelectNames): add the EAddressbookModel* and change the
- ETableModel's name to "adapter".
-
- * gui/component/select-names/e-select-names.c (set_book),
- (addressbook_model_set_uri): these two things take an
- EAddressbookModel* instead of an ETableModel now.
- (e_addressbook_create_ebook_table): don't case the
- EAddressbookModel* to ETableModel*, create an EAddressbookTableAdapter
- on the EAddressbookModel instead.
- (e_select_names_init): set e_select_names->adapter.
-
-2001-05-31 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-model.c (remove_card): decrement
- data_count before emitting the card_removed signal, and break
- after we've removed the matching card.
- (e_addressbook_model_class_init): change signature of
- "card_removed" signal to match what we emit (and what is
- expected.)
-
- * gui/widgets/e-addressbook-view.c (e_addressbook_view_init): the
- signal name is "destroy", not "destroyed".
- (do_remove): new function, actually remove the card.
- (e_addressbook_view_delete_selection): get this working for both
- view types.
-
-2001-05-31 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c: Print Preview =>
- ContactsPrintPreview. Changed peter's change so that the node
- name is more in line with "Print.."'s
-
-2001-05-30 Peter Williams <peterw@ximian.com>
-
- * gui/component/addressbook.c: Use the correct path to the print
- preview menu item.
-
-2001-05-30 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c (cut_contacts_cb): new function, for
- the Cut verb.
- (copy_contacts_cb): new function, for the Copy verb.
- (paste_contacts_cb): new function, for the Paste verb.
- (select_all_contacts_cb): new function, for the Select All verb.
- (update_command_state): add handling for sensitivity of
- Cut/Copy/Paste/Select All.
-
- * gui/widgets/e-addressbook-view.c (e_addressbook_view_init): init
- the invisible and set up selection/destroy signals.
- (get_selection_model): new function, so we can get the
- ETableSelectionModel from either view type. makes lots of the
- other functions easier, since we can get the list of selected
- cards using the same code regardless of view type.
- (invisible_destroyed): new function.
- (selection_get): new function. convert the clipboard list to
- string.
- (selection_clear_event): new function - free up the list of
- ECards.
- (selection_received): if the selection data is valid and
- well-formed, add the corresponding cards to the ebook.
- (add_to_list): new function.
- (get_selected_cards): new function.
- (e_addressbook_view_cut): new function, implement in terms of
- _copy and _delete_selection.
- (e_addressbook_view_copy): claim ownership of the CLIPBOARD
- selection after saving the list of selected ECards.
- (e_addressbook_view_paste): call gtk_selection_convert.
- (e_addressbook_view_select_all): new function, using
- e_selection_model_select_all.
- (e_addressbook_view_can_print): re-implement in terms of
- get_selection_model.
- (e_addressbook_view_can_delete): same.
- (e_addressbook_view_can_cut): new function.
- (e_addressbook_view_can_copy): new function.
- (e_addressbook_view_can_paste): new function. hmm, always return
- TRUE here.
- (e_addressbook_view_can_select_all): new function.
-
- * gui/widgets/e-addressbook-view.h (struct _EAddressbookView): add
- selection stuff - the list of selected cards, and the GtkInvisible
- selection owner, and add prototypes for
- e_addressbook_view_[can]_{cut,copy,paste,select_all}.
-
- * gui/widgets/e-minicard-view-widget.h: add a prototype for
- e_minicard_view_widget_get_selection_model.
-
- * gui/widgets/e-minicard-view-widget.c
- (e_minicard_view_widget_get_selection_model): new function.
-
-2001-05-27 Dan Winship <danw@ximian.com>
-
- * gui/component/addressbook.c: #include
- "evolution-shell-component-utils.h" rather than "e-gui-utils.h"
- for e_pixmaps_update.
-
-2001-05-25 Peter Williams <peterw@ximian.com>
-
- * gui/component/Makefile.am: Reference libeshell.la instead of
- libeshell.a.
-
-2001-05-25 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-reflow-adapter.c (addressbook_height):
- Correct the height calculation here to not include the
- E_CARD_SIMPLE_FIELD_FAMILY_NAME since it won't be displayed.
-
- * gui/widgets/e-minicard.c (remodel): Changed this to continue to
- be more consistent and simpler.
-
-2001-05-23 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (view_destroy): fix strings such
- that ones that happening at the beginning or during an operation
- are followed by "..." and those that stop the operation are
- followed by "."
- (create_card_handler): same.
- (ldap_op_process_current): same, and also call _notify_complete if
- we can't connect to ldap server.
- (poll_ldap): same, and change "Polling for LDAP search result" to
- "Receiving LDAP search results"
-
- * backend/pas/pas-backend-file.c (pas_backend_file_search): call
- notify_status_message at the beginning of this function, and
- whenever we call _notify_complete.
-
-2001-05-23 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-model.h: add sequence_complete_id to
- EAddressbookModel and stop_state_changed to
- EAddressbookModelClass. also, add prototype for
- e_addressbook_model_can_stop.
-
- * gui/widgets/e-addressbook-model.c (remove_book_view): disconnect
- from "sequence_complete", and set search_in_progress to FALSE.
- (sequence_complete): set search_in_progress to FALSE and emit
- "stop_state_changed."
- (e_addressbook_model_class_init): create the "stop_state_changed"
- signal.
- (e_addressbook_model_init): init stuff.
- (book_view_loaded): connect to "sequence_complete" signal.
- (book_view_loaded): set search_in_progress to TRUE and emit
- "stop_state_changed"
- (e_addressbook_model_stop): set search_in_progress to false, emit
- "stop_state_changed", and set our status to "Search Interrupted."
- (e_addressbook_model_can_stop): return search_in_progress.
-
- * gui/widgets/e-addressbook-view.c (e_addressbook_view_init):
- connect to the stop_state_changed signal on EAddressbookModel.
- (stop_state_changed): new function.
- (e_addressbook_view_can_stop): call e_addressbook_model_can_stop.
-
- * gui/component/addressbook.c (update_command_state): use
- e_addressbook_view_can_stop to set the sensitivity of the stop
- button.
-
-2001-05-22 Dan Winship <danw@ximian.com>
-
- * backend/ebook/e-book-listener.c (e_book_listener_check_queue):
- ref the listener for the duration of this function, since emitting
- "responses_queued" may cause it to be unreffed by its EBook in
- some cases, which could cause the second response_queue check to
- look at garbage data if it got destroyed.
- (e_book_listener_destroy): Call g_source_remove if idle_id is set.
-
-2001-05-22 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c: track the change in
- evolution-addressbook.xml's bonobo ui path's.
-
-2001-05-21 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c (change_view_type): update_view_type
- is gone, since the menu item is gone.
-
- * gui/widgets/e-addressbook-table-adapter.c (create_card): use
- e_table_model_rows_inserted here.
-
-2001-05-20 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/addressbook-config.c
- (addressbook_source_item_new): Removed an unused variable.
-
- * gui/component/select-names/e-select-names-bonobo.c
- (entry_get_property_fn): Made text here non-const.
-
- * gui/component/select-names/e-select-names-popup.c
- (edit_contact_info_cb): Cast to a gpointer here.
-
- * gui/component/select-names/e-select-names.c
- (e_addressbook_create_ebook_table): Cast to E_TABLE_MODEL here.
-
-2001-05-18 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (match_name): Do a better job constructing match strings, so we
- never try to use a segment of the name that isn't there (resulting
- in ugly (null)'s in the string). Boost our score if some part of
- the name also matches the front part of the e-mail address, so the
- name match will always trump the e-mail match.
-
- * gui/component/select-names/e-select-names-bonobo.c
- (entry_get_property_fn): Return the serialized EDestinations
- (rather than just a string w/ e-mail addresses) through the bonobo
- component's property bag.
-
- * gui/component/select-names/e-select-names-model.c
- (e_select_names_model_export_destinationv): Added. A convenience routine
- for serializing the model's EDestinations into a string.
-
- * gui/component/select-names/e-select-names-popup.c
- (add_html_mail): Added. Puts in a check menu item for whether or
- not the recipient wants HTML mail.
- (popup_menu_card): Add menu item for HTML mail. Enable edit
- contact info item.
- (popup_menu_nocard): Add menu item for HTML mail. Enable edit
- contact info item.
-
- * backend/ebook/e-book-util.c (e_book_use_local_address_book):
- Added. Fetches the local addressbook and caches it on the first
- call. This is meant to be an easy and efficient way to get at the
- local addressbook with the minimum of code.
- (e_book_query_address_locally): Added. Convenience code that
- does an e-mail only e_book_name_and_email_query against the
- local address book.
-
- * backend/ebook/e-destination.c
- (e_destination_set_html_mail_pref): Added. Allows the intended
- recipient's HTML mail preference to be manipulated.
- (e_destination_get_email_verbose): Added. Cleaned up to use
- e_destination_get_name.
- (e_destination_get_html_mail_pref): Added. Read the recipient's HTML mail
- preference. If the destination is linked to a card, the
- preference is taken from the card (unless it has been explicitly
- overridden by a called to e_destination_set_html_mail_pref).
- (e_destination_get_address_textv): Added. Form a unified address string
- from a NULL-terminated vector of EDestinations.
- (e_destination_export): Added. Serialize an EDestination to a string.
- (e_destination_import): Added. Unserialize a string to build an
- EDestination.
- (e_destination_exportv): Added. Serialize a NULL-terminated vector of
- EDestinations to a string.
- (e_destination_importv): Added. Unserialize a string to build a
- NULL-terminated vector of EDestinations.
-
- * gui/component/select-names/e-select-names-completion.c:
- Implemented local versions of g_strcasecmp and g_strncasecmp
- (which should really be in glib, I think...) for utf8, and used
- them to make this code utf8-safe.
-
-2001-05-17 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c (update_command_state): no more
- ContactFind command.
-
-2001-05-17 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-minicard-view-widget.c
- (e_minicard_view_widget_class_init): add our selection_change
- signal.
- (e_minicard_view_widget_realize): connect to the ESelectionModel's
- selection_changed signal.
- (e_minicard_view_widget_selected_count): new function.
- (selection_change): new function - emit our "selection_change"
- signal.
-
- * gui/widgets/e-minicard-view-widget.h (struct
- _EMinicardViewWidgetClass): add selection_change signal. also,
- add prototype for e_minicard_view_widget_selected_count.
-
- * gui/widgets/e-addressbook-view.c
- (e_addressbook_view_class_init): add our command_state_change
- signal.
- (e_addressbook_view_init): connect to the writable_status signal
- on the EAddressbookModel.
- (minicard_selection_change): new function - calls
- command_state_change.
- (create_minicard_view): connect to selection_change on the
- minicard_view so we know when to update command state.
- (table_selection_change): new function - calls
- command_state_change.
- (writable_status): new function - calls command_state_change.
- (command_state_change): new function - emits our
- "command_state_change" signal.
- (create_table_view): connect to the selection_change signal so we
- know to update the command state.
- (change_view_type): update the command state every time we change
- view types.
- (e_addressbook_view_can_create): new function.
- (e_addressbook_view_can_print): new function.
- (e_addressbook_view_can_delete): new function.
- (e_addressbook_view_can_stop): new function.
-
- * gui/widgets/e-addressbook-view.h (struct
- _EAddressbookViewClass): add command_state_change signal, and
- prototypes of functions the component can use to test the state of
- commands.
-
- * gui/widgets/e-addressbook-model.c (addressbook_destroy): unlink
- the writable_status signal on the EBook.
- (writable_status): new function.
- (e_addressbook_model_class_init): add our writable_status signal.
- (e_addressbook_model_init): init writable_status_id.
- (e_addressbook_model_set_arg): unlink the writable_status signal
- on the old EBook, and connect it on the new one.
-
- * gui/widgets/e-addressbook-model.h: add writable_status signal.
-
- * gui/component/addressbook.c (update_command_state): new
- function, set the sensitivity of the bonobo commands.
- (control_activate): update our command state immediately upon
- activating the control.
- (addressbook_factory_new_control): register command_state_change
- to update the commands.
-
-2001-05-15 Chris Toshok <toshok@ximian.com>
-
- * gui/search/e-addressbook-search-dialog.c
- (e_addressbook_search_dialog_init): initialize the model and
- adapter.
- (button_press): set on the model.
- (e_addressbook_search_dialog_new): same.
- (e_addressbook_search_dialog_set_arg): same.
- (e_addressbook_search_dialog_destroy): unref the model and
- adapter.
-
- * gui/search/e-addressbook-search-dialog.h (struct
- _EAddressbookSearchDialog): add our model and reflow adapter.
-
-2001-05-16 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-minicard-view.c: (e_minicard_view_destroy): Fixed
- up the lifetime of the drag_data_get signal a bit.
-
-2001-05-15 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-minicard-view.c (add_to_list): MinicardViewModel
- -> ReflowAdapter name change.
- (get_card_list): same.
- (e_minicard_view_drag_begin): same.
- (supported_fields_cb): model -> adapter.
- (adapter_changed): hook up signals and set the empty message on
- our adapter.
- (e_minicard_view_set_arg): add support for "adapter", and set
- model -> adapter.
- (e_minicard_view_get_arg): same.
- (disconnect_signals): no more status_message.
- (do_remove): track to use adapter.
- (e_minicard_view_class_init): add adapter arg, and remove
- status_message.
- (e_minicard_view_init): all the code here is in adapter_changed
- now.
-
- * gui/widgets/e-minicard-view.h (struct _EMinicardView):
- EMinicardViewModel -> EAddressbookReflowAdapter.
- (struct _EMinicardViewClass): get rid of status_message.
-
- * gui/widgets/e-minicard-view-widget.c
- (e_minicard_view_widget_class_init): remove the status_message
- signal.
- (e_minicard_view_widget_new): take the adapter as our argument,
- and store it away for when we create the view.
- (e_minicard_view_widget_realize): when we create the view just set
- the adapter field on it. also, don't connect to status_message.
-
- * gui/widgets/e-minicard-view-widget.h (struct
- _EMinicardViewWidget): add our adapter here, so we can pass it
- into the view when we create it.
- (struct _EMinicardViewWidgetClass): remove status_message.
-
- * gui/widgets/e-addressbook-view.c (status_message): new function,
- no more propagating status messages!
- (e_addressbook_view_init): create our model and conenct to its
- status_message signal.
- (book_writable_cb): set "editable" on the model, not our object.
- (e_addressbook_view_set_arg): same, but with "book" and "query" as
- well.
- (create_minicard_view): create our reflow adapter and pass it to
- the minicard view widget. also, call e_reflow_model_changed so
- it'll pick up any already present cards.
- (table_double_click): ADDRESSBOOK_MODEL -> TABLE_ADAPTER.
- (get_card_list_1): remove the cast, since we don't need it any
- longer.
- (table_right_click): ADDRESSBOOK_MODEL -> TABLE_ADAPTER.
- (table_drag_data_get): same.
- (create_table_view): create the table adapter, and use it as our
- ETableModel.
- (change_view_type): remove the status_message hook up and setting
- of query/book/editable.
- (e_addressbook_view_stop): just call e_addressbook_model_stop here
- instead of switching on the view type.
-
- * gui/widgets/e-addressbook-view.h (struct _EAddressbookView): add
- our EAddressbookModel.
-
- * gui/widgets/Makefile.am (libeminicard_a_SOURCES): add the
- adapter files, and remove e-minicard-view-model.[ch].
-
- * gui/widgets/e-minicard-view-model.[ch]: removed.
-
- * gui/widgets/e-addressbook-table-adapter.c: new file.
-
- * gui/widgets/e-addressbook-table-adapter.h: new file.
-
- * gui/widgets/e-addressbook-reflow-adapter.c: new file.
-
- * gui/widgets/e-addressbook-reflow-adapter.h: new file.
-
- * gui/widgets/e-addressbook-model.c: rework this class to now
- subclass from ETableModel anymore. It not subclasses from
- GtkObject, and we use table and reflow adapters to get at the
- data.
-
- * gui/widgets/e-addressbook-model.h: same.
-
-2001-05-14 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-minicard-view-model.c (remove_card): Fix a small
- error not decreasing the data_count here.
-
-2001-05-13 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.h: add prototype for
- addressbook_expand_uri.
-
- * gui/component/addressbook-component.c
- (destination_folder_handle_drop): create an EBook for
- @physical_uri.
- (dnd_drop_book_open_cb): actually add the dropped cards.
-
- * gui/component/addressbook.c (addressbook_expand_uri): abstract
- this code out from the set_prop method so we can use it in the
- component.
- (set_prop): call addressbook_expand_uri.
-
- * backend/ebook/e-card.c (e_card_load_cards_from_string): new
- function.
-
- * backend/ebook/e-card.h: add prototype for
- e_card_load_cards_from_string.
-
-2001-05-12 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-component.c
- (destination_folder_handle_drop): spew the data passed to us.
- (destination_folder_handle_motion): the suggested_action is not an
- ActionSet, but an Action, so don't or together multiple actions.
-
-2001-05-11 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-config.c (addressbook_source_dialog):
- correct bug causing the Ok button to never be enabled.
-
-2001-05-11 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-component.c (populate_context_menu):
- example.
-
-2001-05-11 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-minicard-view.c (e_minicard_view_drag_data_get):
- use e_card_list_get_vcard to build up the data to send.
- (e_minicard_view_init): connect to the model's drag_begin signal.
- (e_minicard_view_drag_begin): gather the list of cards being
- dragged and call gtk_drag_begin.
- (add_to_list): new function.
- (get_card_list): same.
- (disconnect_signals): disconnect the drag_data_get signal.
- (e_minicard_view_init): connect to the drag_begin signal on our
- model.
-
- * gui/widgets/e-minicard-view.h (struct _EMinicardView): change
- drag_card to drag_list.
-
- * gui/widgets/e-minicard-view-model.c (minicard_drag_begin): new
- function, emit our drag_begin signal.
- (addressbook_incarnate): connect to the item's drag_begin signal.
- (e_minicard_view_model_class_init): init our drag_begin signal.
-
- * gui/widgets/e-minicard-view-model.h: add drag_begin signal.
-
- * gui/component/addressbook-config.c (addressbook_source_dialog):
- always loop through all source types here, making LDAP first so
- it's forces as the first notebook item.
- (addressbook_config_auth_label): remove SASL case.
- (addressbook_source_edit_changed): same.
- (addressbook_source_item_new): flag the area of code that needs to
- go into the advanced dialog (if we add one before someone
- graciously redesigns the entire addressbook gui :)
-
-
- * gui/component/addressbook-storage.c (ldap_unparse_auth): remove
- SASL case.
- (ldap_parse_auth): same.
-
- * gui/component/addressbook-storage.h: make LDAP come first in our
- source type enumeration, and remove the SASL auth type.
-
-2001-05-11 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card.c (e_card_set_arg): If the name is set and
- the full_name or file_as haven't been yet, set them.
-
-2001-05-11 Christopher James Lahey <clahey@ximian.com>
-
- * backend/pas/pas-backend-file.c: Reordered the includes here.
- (string_to_dbt): The sleepycat libdb documentation suggests
- memseting the DBT to 0 so we do that here.
-
- * gui/widgets/e-minicard-view-model.c (addressbook_height): Skip
- the E_CARD_SIMPLE_FIELD_FAMILY_NAME field.
-
- * gui/widgets/e-minicard.c (remodel): Skip the
- E_CARD_SIMPLE_FIELD_FAMILY_NAME field.
-
-2001-05-11 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_connect): only
- check schema support if we've connected.
-
-2001-05-11 Chris Toshok <toshok@ximian.com>
-
- * contact-editor/e-contact-editor.c (enable_writable_fields):
- don't leak the ECard or ECardSimple.
-
-2001-05-08 Iain Holmes <iain@ximian.com>
-
- * backend/ebook/GNOME_Evolution_Addressbook_VCard_Importer.oaf.in:
- Renamed the GnomeCard_Importer.oaf.in to this, and change the IID.
-
- * Makefile.am: Rename all the GnomeCard to VCard.
-
- * evolution-vcard-importer.c: Make the GnomeCard a generic
- vcard importer.
-
-2001-05-08 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/Makefile.am (libebookinclude_HEADERS): Removed
- e-card-pairs.h since we're not using it.
-
- * backend/ebook/e-book-view.c (e_book_view_check_listener_queue):
- Added break; to default: case here.
-
- * backend/ebook/e-card-simple.c, backend/ebook/e-card-simple.h:
- Added changed variable so as to avoid sync_card when possible.
- (e_card_simple_destroy): Free all the data here properly.
- (e_card_simple_get_arg): Slight simplification here.
- (fill_in_info, e_card_simple_arbitrary_foreach,
- e_card_simple_get_arbitrary): Call e_card_free_empty_lists here to
- save a bit of memory.
-
- * backend/ebook/e-card.c, backend/ebook/e-card.h: Fixed up
- includes a bit.
- (e_card_list_get_vcard, e_card_list_send): Added these functions
- for acting on a group of cards.
- (parse_org): Cleaned up this function a bit.
- (e_card_free_empty_lists): Added this function to delete
- unnecessary ELists and save a bit of memory.
- (e_v_object_get_child_value): Made this return NULL if not found
- instead of g_strdup("").
-
- * contact-editor/e-contact-save-as.c,
- contact-editor/e-contact-save-as.h (e_contact_list_save_as): Added
- this function to save multiple contacts.
-
- * gui/widgets/Makefile.am: Commented out reflow test.
- (libeminicard_a_SOURCES): Added e-minicard-view-model.c and
- e-minicard-view-model.h.
-
- * gui/widgets/e-minicard-view-model.c,
- gui/widgets/e-minicard-view-model.h: Model for use in
- EMinicardView.
-
- * gui/widgets/e-minicard-view.c, gui/widgets/e-minicard-view.h:
- Reworked this to use the new EReflow stuff.
-
- * gui/widgets/e-minicard.c (e_minicard_event): Doesn't handle
- right click menus now. Emits a signal on the parent canvas item
- instead.
-
- * printing/e-contact-print-envelope.c,
- printing/e-contact-print-envelope.h
- (e_contact_print_envelope_list_dialog_new): Added this function to
- print multiple envelopes (only prints first for now.)
-
- * printing/e-contact-print.c, printing/e-contact-print.h
- (e_contact_print_card_list_dialog_new): Added this function to
- print multiple cards. Only prints the first for now.
-
-2001-05-07 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-component.c (remove_folder): flesh out
- the function more. It should work now, but there's no way to
- invoke this method from the ui at the moment, heh.
-
-2001-05-07 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c (book_open_cb): Use a different
- error message in the ldap support/no ldap support/file cases.
-
-2001-05-07 Gediminas Paulauskas <menesis@delfi.lt>
-
- * gui/component/addressbook.c: use define from
- widgets/misc/e-filter-bar.h instead of own enumeration and search menu
- names.
-
- * gui/component/Makefile.am, gui/component/select-names/Makefile.am:
- removed EVOLUTION_VERSION.
-
-2001-05-04 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-component.c (remove_folder): un-#if 0
- this.
- (xfer_folder): add skeleton code to validate xfer request. always
- notifies with PERMISSION_DENIED at present.
- (populate_context_menu): un-#if 0 this.
- (get_dnd_selection): same.
- (destination_folder_handle_motion): new function.
- (destination_folder_handle_drop): new function.
- (factory_fn): create a EvolutionShellComponentDndDestinationFolder
- interface, and add it to our shell component.
-
-2001-05-04 JP Rosevear <jpr@ximian.com>
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_process_get_book_view): init change_id to NULL
-
-2001-05-02 JP Rosevear <jpr@ximian.com>
-
- * gui/component/addressbook.c (addressbook_view_free): unref the
- book if the view is being destroyed
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_process_get_book_view): unref the book_view when
- we are finished, it is only interesting if someone else has reffed
- it now (weak reference)
- (pas_backend_file_add_client): unref the book for the same reason
- as above
-
- * Fixes bug #2255
-
-2001-04-30 JP Rosevear <jpr@ximian.com>
-
- * backend/pas/pas-backend-file.c (vcard_matches_search): if the
- view does not contain a search context, the result is by default
- false fixes #2470
-
-2001-04-25 Dan Winship <danw@ximian.com>
-
- * gui/component/addressbook-factory.c (main): Remove call to
- unicode_init.
-
-2001-04-23 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/e-address-popup.c: Lots of code has been
- simplified here.
- (e_address_popup_factory_new_control): Rather than directly pop
- our control up in a window (via the e_address_popup_popup
- function, which is now gone), just return the widget and let the
- caller do the popping. This works better, since it means we don't
- have to work around the vagaries of bonobo focus & event handling.
- (e_address_popup_set_name): Refresh when both name & email have
- been set, rather than checking a stupid counter.
- (e_address_popup_set_email): Ditto.
-
-2001-04-22 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/addressbook-storage.c
- (addressbook_storage_clear_sources): Added save_source_data here.
-
-2001-04-21 Jon Trowbridge <trow@ximian.com>
-
- * contact-editor/e-contact-quick-add.c (clicked_cb): Properly
- convert to utf8. (Bug #2256)
- (build_quick_add_dialog): Properly convert from utf8. (Bug #2256)
-
-2001-04-16 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-destination.c (e_destination_get_name): Added.
-
- * gui/component/select-names/e-select-names.c
- (real_add_address_cb): Use e_select_names_model_append. It's
- nicer.
-
- * gui/component/select-names/e-select-names-model.c
- (e_select_names_model_append): Added.
-
- * gui/component/select-names/e-select-names-completion.c
- (book_query_process_card_list): Filter out completion matches that
- don't have an associated e-mail address.
- (book_query_score): Give a bonus to the primary address, so that
- it always comes up first in the completion results.
-
- * gui/component/e-address-popup.c (e_address_popup_refresh_names):
- Convert utf8 strings into gtk strings before displaying.
-
-2001-04-14 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-book-view-listener.c,
- backend/ebook/e-book-view-listener.h: Added the function
- e_book_view_listener_stop to tell the book view listener to stop
- sending signals.
-
- * backend/ebook/e-book-view.c (e_book_view_destroy): Tell the
- EBookViewListener to stop when we're destroyed.
-
- * backend/pas/pas-backend-file.c (view_destroy,
- pas_backend_file_process_get_book_view,
- pas_backend_file_process_get_changes): Cleaned these up a bit
- using bonobo_object_ref and bonobo_object_unref.
- (pas_backend_file_process_get_book_view,
- pas_backend_file_process_get_changes): bonobo_object_release_unref
- the EBookListener here.
-
- * backend/pas/pas-backend-ldap.c
- (pas_backend_ldap_process_get_book_view): Cleaned this up a bit
- using bonobo_object_ref. Make sure to unref the listener when
- we're done with it. Put the new book_view in the list before
- telling the book_listener that it's ready.
-
- * backend/pas/pas-book-view.c (pas_book_view_construct): Cleaned
- this up a bit using bonobo_object_dup_ref.
- (pas_book_view_destroy): Cleaned this up a bit using
- bonobo_object_release_unref.
-
- * backend/pas/pas-book.c (pas_book_queue_get_book_view,
- pas_book_queue_get_changes): bonobo_object_dup_ref here instead of
- just duplicating.
-
-2001-04-14 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-book-listener.c
- (impl_BookListener_respond_get_cursor): Ref the cursor here when
- we receive it.
- (impl_BookListener_respond_get_view,
- impl_BookListener_respond_get_changes): Ref the book_view here
- when we receive it.
- (impl_BookListener_respond_open_book): Ref the book here when we
- receive it.
- (e_book_listener_destroy): Unref the objects in our queue here.
-
- * backend/ebook/e-book-view.c (e_book_view_construct): Cleaned
- this up using bonobo_object_dup_ref.
- (e_book_view_destroy): Cleaned this up using
- bonobo_object_release_unref.
-
- * backend/ebook/e-book.c (e_book_do_response_get_cursor,
- e_book_do_response_get_view, e_book_do_response_get_changes,
- e_book_unload_uri): Cleaned this up using
- bonobo_object_release_unref.
-
-2001-04-13 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names-bonobo.c
- (entry_get_property_fn): Get the ESelectNamesModel from the
- widget's text model instead of storing it as a gtk_object_set_data
- since it may change.
-
-2001-04-12 Jason Leach <jasonleach@usa.net>
-
- * backend/pas/pas-backend-file.c (INITIAL_VCARD): Update the Voice
- and Fax phone numbers too, finishing off bug #1667.
-
-2001-04-11 Christopher James Lahey <clahey@ximian.com>
-
- * backend/pas/pas-backend-file.c (INITIAL_VCARD): Update the built
- in VCard.
-
-2001-04-12 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (local_record_from_ecard): put the
- business address into the pilot record as that is what we put into
- the desktop record
- (ecard_from_remote_record): set both the address label and
- delivery address to avoid bad parser guessing, fixes #2143
-
- * backend/ebook/e-card-types.h: remove deprecated pilot code
-
- * backend/ebook/e-card.c: ditto
-
- * backend/ebook/e-card.h: ditto
-
-2001-04-11 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (local_record_from_ecard): Don't add
- more than five phone numbers and set the remaining blank entries
- to some reasonable defaults
-
-2001-04-11 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card-simple.h: Added
- E_CARD_SIMPLE_FIELD_LAST_SIMPLE_STRING.
-
- * gui/component/addressbook-component.c (accepted_dnd_types):
- Fixed a warning here.
-
- * gui/widgets/e-addressbook-model.c: Modified this to have more
- columns, but not let them be edited if they're not a simple
- string.
-
- * gui/widgets/e-minicard-view.c (e_minicard_view_init): Fixed a
- warning and a memory leak here.
-
-2001-04-10 Gediminas Paulauskas <menesis@delfi.lt>
-
- * backend/ebook/evolution-gnomecard-importer.c: added missing #include.
- * contact-editor/e-contact-editor.c (_arrow_pressed): popup menu items were
- not translated after selecting one of them.
- * gui/widgets/e-addressbook-view.c: mark popup menu items with N_().
- Updated list[] for translators.
- * gui/widgets/e-minicard.c: same.
- * gui/widgets/e-minicard-view-widget.c (e_minicard_view_widget_set_arg): fix warning
- for "editable" arg.
- * gui/widgets/e-minicard-view.c: convert "empty_message" to utf8.
-
-2001-04-09 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-component.c (remove_folder): stubbed,
- #if 0'ed
- (xfer_folder): same.
- (populate_context_menu): same.
- (get_dnd_selection): same.
- (factory_fn): add the accepted drag types ("text/x-vard") to
- folder_types.
-
-2001-04-09 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-minicard.c (e_minicard_event): on BUTTON_PRESS: if
- it's button 1, store the button x, y, and set drag_button_down to
- TRUE. on BUTTON_RELEASE: always set drag_button_down to FALSE.
- for MOTION_NOTIFY: initiate drag if the pointer has moved 3
- pixels.
-
- * gui/widgets/e-minicard.h (struct _EMinicard): add fields for
- button x, y, and a bit for if the button has been pressed so we
- can tell whether a motion should be a drag.
- (struct _EMinicardClass): add drag_begin signal.
-
- * gui/widgets/e-minicard-view.c (e_minicard_view_drag_begin): new
- function, starts the drag.
- (book_view_loaded): connect the "drag_data_get" signal.
- (e_minicard_view_drag_data_get): new function.
-
- * gui/widgets/e-minicard-view.h (struct _EMinicardView): add
- drag_card and id for canvas_drag_data_get_id.
-
- * gui/widgets/e-addressbook-view.c (table_drag_data_get): new
- function.
- (create_table_view): add d&d stuff.
-
-2001-04-08 Chris Toshok <toshok@ximian.com>
-
- * printing/e-contact-print.c: add #include <sys/types.h> since
- gnome-print.h uses time_t without including it. this really
- should be fixed in gnome-print.
-
-2001-04-08 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_add_client):
- make sure to notify new clients to the writable status of an
- already open (and authenticated) book.
-
-2001-04-04 Kjartan Maraas <kmaraas@gnome.org>
-
- * contact-editor/e-contact-editor.[ch]: Fix headers.
- * component/addressbook-storage.c: Same here.
- * gui/search/e-addressbook-search-dialog.c: Same here.
- * gui/widgets/e-addressbook-view.c: Same here.
- * gui/widgets/e-minicard-label.c: Same here.
- * gui/widgets/e-minicard-view-widget.c: Same here.
- * gui/widgets/e-minicard-view.c: Same here.
- * gui/widgets/e-minicard-widget-test.c: Same here.
- * gui/widgets/e-minicard-widget.c: Same here.
- * gui/widgets/e-minicard.c: Same here.
- * gui/widgets/test-minicard-label.c: Same here.
-
-2001-04-03 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (table_double_click): Fixed a
- crash here.
-
-2001-04-03 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-model.c (COLS): Made this table model
- more consistent in the number of columns it has.
- (addressbook_append_row): Fixed this function. We removed the col
- offset.
-
-2001-04-02 Iain Holmes <iain@ximian.com>
-
- * backend/ebook/evolution-gnomecard-importer.c (importer_init): Shut
- down and unregister the factory on exit.
-
-2001-04-01 Gediminas Paulauskas <menesis@delfi.lt>
-
- * contact-editor/contact-editor.glade: changed icon to
- evolution-contacts-plain.png.
- * gui/component/addressbook.c: use new pixmap cache. Added icon for new
- contact, print, print preview, changed filenames of renamed icons.
-
-2001-03-31 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (real_add_address_cb): Call e_select_names_model_clean after
- adding address. This should deal with the bug reports related
- to stray commas.
-
- * gui/component/select-names/e-select-names-model.c
- (e_select_names_model_clean): Added. Remove all empty destinations.
-
- * backend/ebook/e-destination.c (e_destination_is_empty): Added. Check
- if an EDestination is in essentially a null state.
-
-2001-03-30 Christopher James Lahey <clahey@ximian.com>
-
- * backend/pas/pas-backend-file.c (pas_backend_file_add_client):
- Tell new clients that are added whether they're writable.
-
-2001-03-29 Jon Trowbridge <trow@ximian.com>
-
- * printing/e-contact-print.c: Added #include <libgnome/gnome-paper.h>
-
- * printing/e-contact-print-envelope.c: Added #include <time.h>
- and #include <libgnome/gnome-paper.h>
-
-2001-04-03 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (match_email): Better handle matching of "nameless" contacts.
-
- * backend/ebook/e-destination.c (e_destination_get_string): Better
- handle the case of a "nameless" contact.
-
-2001-03-29 Kjartan Maraas <kmaraas@gnome.org>
-
- * *.*: Clean up #includes. Replace <gnome.h>, <bonobo.h> and
- <gtk/gtk.h> with more finegrained headers where needed.
-
-2001-03-28 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card.c (e_card_set_arg): Fixed some crashes.
-
-2001-03-28 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names-table-model.c
- (fill_in_info): Use E_CARD_SIMPLE_FIELD_NAME_OR_ORG instead of
- getting the NAME and then the ORG. That way if we expand
- NAME_OR_ORG, this will use it.
-
- * gui/component/select-names/e-select-names.c
- (e_addressbook_create_ebook_table, SPEC): Use the correct column
- in the SPEC.
-
-2001-03-25 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_seq_complete_cb): Rather than starting
- the pending query by directly calling
- e_select_names_completion_do_query, call
- e_completion_begin_search. Circumventing the ECompletion API was
- causing it to get confused in some cases.
-
-2001-03-23 Jon Trowbridge <trow@ximian.com>
-
- * gui/widgets/e-minicard-widget.c (e_minicard_widget_set_card):
- Added. Call me old-fashioned, but I just prefer to have a real
- API rather than doing everything via gtk_object_get/set-type
- calls.
- (e_minicard_widget_set_arg): Changed to call
- e_minicard_widget_set_card.
-
- * backend/ebook/e-book-util.c: Small changes to get rid of
- compiler warnings. (Casting out const, removed unused variables,
- etc.) Removed some debugging messages.
-
- * gui/component/addressbook-factory.c (main): Added call
- to e_address_popup_factory_init.
-
- * gui/component/e-address-popup.c: Added. A popup gadget that is
- invoked (as a bonobo control) when an address is left-clicked in
- the mailer. The addressbook is queries, and the address is either
- displayed as a minicard (if it already exists) or in a "generic
- format". A button is provided for editting/adding the contact.
- Some of the semantics of this widget are a bit... non-standard,
- because of bonobo issues. I can't really seem to replicate
- popup-menu behavior because of how bonobo propogates events, etc.
- so I've tried to produce something that I think is non-annoying.
- YMMV.
-
-2001-03-22 Iain Holmes <iain@ximian.com>
-
- * backend/ebook/evolution-gnomecard-importer.c: Update to the new
- IDL.
-
-2001-03-20 Miguel de Icaza <miguel@ximian.com>
-
- * gui/component/addressbook.c (update_pixmaps): Added artwork from
- Jakub.
-
-2001-03-19 Christopher James Lahey <clahey@ximian.com>
-
- * Merged branch:
-
-2001-03-14 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-minicard-view.c: Call
- e_selection_model_simple_insert_rows and
- e_selection_model_simple_delete_rows instead of
- e_selection_model_simple_insert_row and
- e_selection_model_simple_delete_row.
-
-End of branch
-
-2001-03-17 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c: Brutally
- refactored to boost performance in large-addressbook situations.
- These fixes give accepable performance (even with the suboptimal
- pas-backend-file searching) using tigert's addressbook-of-death.
-
- * backend/pas/pas-backend-file.c (pas_backend_file_search):
- Start feeding query matches back to the caller before the
- entire search is complete; this gives us some "instant feedback"
- rather than causing evolution to totally lock up...
-
- * backend/ebook/e-book.c (e_book_queue_op): Tag all queued ops.
- (e_book_cancel_op): Added. Search for a pending op with a given
- tag, and mark it as inactive.
- (e_book_do_response_get_cursor): Don't execute callback if this
- operations has been cancelled.
- (e_book_do_response_get_view): Ditto.
- (e_book_do_response_get_changes): Ditto.
- (e_book_do_response_get_supported_fields): Ditto.
- (e_book_get_supported_fields): Return an operation tag (that can
- be used to cancel the operation) rather than just TRUE/FALSE.
- Zero is always an invalid tag and is returned in the case of an
- error, so this shouldn't break any code that looked at the return
- value (unless it did so in a particularly stupid way, of course).
- (e_book_get_cursor): Ditto.
- (e_book_get_book_view): Ditto.
- (e_book_get_changes): Ditto.
- (e_book_cancel): Added. Cancel a pending operation. (Basically
- a call to e_book_cancel_op with error checking, etc.)
-
- * backend/ebook/e-book-types.h: Added E_BOOK_STATUS_CANCELLED.
-
-2001-03-17 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book-listener.c
- (e_book_listener_queue_writable_status): new function.
- (impl_BookListener_report_writable): new function.
- (e_book_listener_get_epv): fill in epv->notifyWritable.
-
- * backend/ebook/e-book-listener.h: add writable status entries.
-
- * backend/ebook/e-book.c (e_book_do_writable_event): new function.
- (e_book_check_listener_queue): add WritableStatusEvent to the
- switch.
- (e_book_class_init): register writable_status signal.
-
- * backend/ebook/e-book.h: add writable_status signal.
-
- * backend/idl/addressbook.idl: add notifyWritable method to
- BookListener.
-
- * gui/widgets/e-minicard.c (e_minicard_class_init): add "editable"
- arg.
- (e_minicard_init): init editable.
- (e_minicard_set_arg): loop over the minicard fields setting their
- "editable".
- (e_minicard_get_arg): add editable.
- (supported_fields_cb): use editable when creating the
- contact_editor.
- (add_field): set "editable" when creatin the e_minicard.
-
- * gui/widgets/e-minicard.h (struct _EMinicard): add "editable".
-
- * gui/widgets/e-minicard-view.c (e_minicard_view_class_init): add
- editable arg.
- (e_minicard_view_init): init editable.
- (create_card): pass editable to e_minicard canvas item.
- (e_minicard_view_set_arg): bit of a hack - loop over all the
- canvas items setting their "editable."
- (e_minicard_view_get_arg): add editable.
- (supported_fields_cb): use editable when creating the contact
- editor.
-
- * gui/widgets/e-minicard-view.h (struct _EMinicardView): add
- "editable."
-
- * gui/widgets/e-minicard-view-widget.c
- (e_minicard_view_widget_class_init): add "editable" field.
- (e_minicard_view_widget_init): init editable to FALSE.
- (e_minicard_view_widget_set_arg): save editable, and pass it along
- the e-minicard-view.
- (e_minicard_view_widget_realize): same.
- (e_minicard_view_widget_get_arg): add editable.
-
- * gui/widgets/e-minicard-view-widget.h (struct
- _EMinicardViewWidget): add "editable" field.
-
- * gui/widgets/e-minicard-label.h (struct _EMinicardLabel): add
- "editable" field.
-
- * gui/widgets/e-minicard-label.c (e_minicard_label_class_init):
- add "editable" arg.
- (e_minicard_label_set_arg): editable, set it on the e_text too.
- (e_minicard_label_get_arg): editable.
- (e_minicard_label_construct): set the "editable" field when we
- create the e_text cavas item
-
- * gui/widgets/e-addressbook-view.c (e_addressbook_view_init):
- default editable to FALSE.
- (book_writable_cb): new function, set our editable field and
- gtk_object_set it on the active view.
- (e_addressbook_view_set_arg): set the active view's editable when
- we set the view's book, and connect the "writable_status" signal
- to book_writable_cb.
- (change_view_type): same.
- (supported_fields_cb): use our "editable" when creating the
- contact editor.
-
- * gui/widgets/e-addressbook-view.h (struct _EAddressbookView): add
- editable field.
-
- * gui/widgets/e-addressbook-model.c (e_addressbook_model_init):
- change the default of editable to FALSE.
-
- * backend/pas/pas-book.c (pas_book_report_writable): new function.
-
- * backend/pas/pas-book.h: prototype for pas_book_report_writable.
-
- * backend/pas/pas-backend-file.c (pas_backend_file_load_uri): if
- we open the file O_RDWR (or create it) report it as writable. if
- we can't open it as O_RDWR, try opening it read-only before we
- attempt to create it.
-
- * backend/pas/pas-backend-ldap.c
- (pas_backend_ldap_process_authenticate_user): if we authenticate
- successfully, grant write permissions (this is lacking but there's
- really nothing we can do to determine the extent of the access
- afforded a user.)
-
-
-2001-03-15 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/e-address-widget.c: Added addressbook querying and
- "cardification" functions, which are turned off by default for now
- because of addressbook bugs. Added a popup menu option to turn
- queries on, so that others can enjoy the thrill of massive flaming
- death.
-
- * gui/component/addressbook-factory.c (main): Made warnings always
- be fatal.
-
- * backend/pas/pas-book-view.c: Added some debugging spew.
-
- * backend/pas/pas-backend-file.c (pas_backend_file_search): Added
- a little experimental code to try to make file searches scale
- better. #if 0/#endif-ed out for now.
-
- * contact-editor/e-contact-quick-add.c: #included e-book-util.h.
-
- * backend/ebook/e-card.c (e_card_name_match_string): Added.
- Looser name-matching function.
- (e_card_email_match_string): Added. Loose e-mail matching.
-
- * backend/ebook/e-book-view-listener.c
- (e_book_view_listener_check_queue): Added code to cause us to
- abort rather than get trapped in a 100%-CPU-consuming loop in
- certain situations. Now we just need to figure out how to avoid
- these situations altogether.
-
- * backend/ebook/e-book-util.c: Added. Now contains the simple
- query stuff and the open local addressbook functions.
-
- * backend/ebook/e-book.c: Moved simple query stuff and open local
- addressbook functions into e-book-util.c.
-
-2001-03-15 Dan Winship <danw@ximian.com>
-
- * gui/widgets/e-minicard-label.c (e_minicard_label_set_arg):
- * gui/widgets/e-minicard.c (e_minicard_set_arg, e_minicard_event):
- Update arguments to e_canvas_item_grab_focus.
-
-2001-03-13 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/addressbook.c (update_pixmaps): Fix a warning
- here.
-
-2001-03-13 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/Makefile.am (minicard_label_test_LDADD): Change to
- ld order from Greg Williams.
-
-2001-03-13 Christopher James Lahey <clahey@ximian.com>
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_process_get_book_view): Moved where we call
- pas_book_respond_get_book_view.
-
-2001-03-12 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c: add E_STRING_PROP for
- categories.
-
- * backend/pas/evolutionperson.schema: add categories attribute.
-
- * backend/ebook/e-card-simple.c (field_data): add
- E_CARD_SIMPLE_FIELD_CATEGORIES.
-
- * backend/ebook/e-card-simple.h: add
- E_CARD_SIMPLE_FIELD_CATEGORIES.
-
-2001-03-12 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-minicard.c (supported_fields_cb): add is_read_only
- param.
-
- * gui/widgets/e-minicard-view.c (supported_fields_cb): add
- is_read_only param.
-
- * gui/widgets/e-addressbook-view.c (supported_fields_cb): add
- is_read_only param.
-
- * gui/component/select-names/e-select-names-text-model.c
- (e_select_names_text_model_activate_obj): add is_read_only param.
- also, include a little policy here and make it TRUE, as the user
- shouldn't be editting in this context anyway (imo).
-
- * gui/component/addressbook.c (supported_fields_cb): add
- is_read_only param.
-
- * contact-editor/test-editor.c (main): add is_read_only param.
-
- * contact-editor/e-contact-editor.c (set_read_only): new function,
- that either enables or disables all the text fields, combo boxes,
- and some buttons, depending on the state of is_read_only.
- (e_contact_editor_class_init): add read/write arg "is_read_only".
- (full_name_clicked): set the is_read_only of the fullname dialog
- to the editor's.
- (full_addr_clicked): same.
- (e_contact_editor_new): add is_read_only param, that gets set
- along with the other params.
- (e_contact_editor_set_arg): add setter for is_read_only.
- (e_contact_editor_get_arg): add getter for is_read_only.
- (_phone_arrow_pressed): change TRUE to !editor->is_read_only for
- entry.
- (_email_arrow_pressed): same.
- (_address_arrow_pressed): same.
- (enable_writable_fields): same.
-
- * contact-editor/e-contact-editor-fullname.c
- (e_contact_editor_fullname_class_init): add read/write arg
- "is_read_only".
- (e_contact_editor_fullname_set_arg): add setter for is_read_only
- that enables/disables all the entries/combos.
- (e_contact_editor_fullname_get_arg): add getter for is_read_only.
-
- * contact-editor/e-contact-editor-fullname.h (struct
- _EContactEditorFullname): add is_read_only flag.
-
- * contact-editor/e-contact-editor-address.c
- (e_contact_editor_address_class_init): add read/write arg
- "is_read_only".
- (e_contact_editor_address_set_arg): add setter for is_read_only
- that disables/enables all the entries/combos.
- (e_contact_editor_address_get_arg): add getter for is_read_only.
-
- * contact-editor/e-contact-editor-address.h (struct
- _EContactEditorAddress): add is_read_only flag.
-
-2001-03-13 Iain Holmes <iain@ximian.com>
-
- * backend/ebook/Makefile.am: Change the importer includes around a bit.
-
- * backend/ebook/evolution-gnomecard-importer.c: Correctly add the includes.
-
-2001-03-09 JP Rosevear <jpr@ximian.com>
-
- * conduit/Makefile.am: PISOCK_INCLUDEDIR has become
- PISOCK_CFLAGS in gnome-pilot.m4 and remove capplet foo
-
-2001-03-11 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-book.c (e_book_simple_query): Added. A
- simplified, cancellable query mechanism that lets you avoid
- dealing with EBookView.
- (e_book_simple_query_cancel): Added. Cancels a running query.
-
- * backend/ebook/e-book-types.h: Add enum EBookSimpleQueryStatus.
-
-2001-03-08 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-popup.c
- (quick_add_cb): Switched to use e_contact_quick_add_free_form.
- Removed debugging code, hopefully without introducing any bugs
- in the process.
-
- * gui/component/select-names/e-select-names-text-model.c
- (e_select_names_text_model_insert_length): Fix bug with commas
- inside of name/address combos. As long as the comma is inside of
- quotes, it will be treated as part of the name rather than as a
- break between addresses.
-
- * gui/component/select-names/e-select-names-completion.c
- (match_nickname): Use e_card_name_to_string for nickname match
- strings.
- (match_email): Use e_card_name_to_string for email match strings.
- (e_select_names_completion_begin): Strip quotes out of query text,
- so we don't produce malformed sexps.
- Added William Blake quote easter egg.
-
- * contact-editor/e-contact-quick-add.c: Further attempts to fix...
- mostly unsuccessful.
- (e_contact_quick_add_free_form): Added. Takes a single string
- and tries to parse out (using some simple, loose rules) the
- name and e-mail -- then calls e_contact_quick_add. An attempt to
- get the computer to automatically Do The Right Thing.
-
- * backend/ebook/e-book.c: Fixed some broken indentation. Yes, I'm
- anal.
-
- * gui/component/GNOME_Evolution_Addressbook.oafinfo: Added oaf_server
- info for EAddressWidget.
-
- * gui/component/GNOME_Evolution_Addressbook.oaf.in: Added oaf_server
- info for EAddressWidget.
-
- * gui/component/addressbook-factory.c (main): Add call to
- e_address_widget_factory_init.
-
- * gui/component/e-address-widget.h:
- * gui/component/e-address-widget.c: Added. A little widget (and a
- Bonobo control, BTW) for displaying addresses, with a left-click
- menu. Used to display addresses in the mail viewer (as embedded
- GtkHTML objects, replacing the text previously used). Still quite
- incomplete.
-
-2001-03-08 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-component.c (factory_fn): Specify a
- NULL `EvolutionShellComponentGetDndSelectionFn'.
-
-2001-03-06 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-text-model.c
- (e_select_names_text_model_insert_length): Fix glitch with
- inserting comma-delimited stuff when length > 1.
-
-2001-03-06 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-book.c (e_book_load_local_address_book): Added.
- Just encapsulates opening
- file://~username/evolution/local/Contactes/addressbook.db, so that
- path doesn't need to be hardwired in throughout the code.
-
-2001-03-06 Benjamin Kahn <xkahn@cybersites.com>
-
- * contact-editor/e-contact-quick-add.c (clicked_cb):
- Added the third argument to e_contact_editor_new. (Cheated
- and send NULL for the field argument, which is probably
- troublesome. It will be fixed soon by either clahey or
- toshok.)
-
-2001-03-06 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-model.c
- (e_select_names_model_replace): Fix a reference counting bug.
-
- * gui/component/select-names/e-select-names-manager.c (popup_cb):
- A callback for creating the appropriate popup by calling
- e_select_names_popup.
- (e_select_names_manager_create_entry): Connect popup_cb to the
- entry's popup signal
-
- * gui/component/select-names/e-select-names-popup.c: Added. Code
- for popup right-click menus for recipient entries. Still a bit
- incomplete.
-
- * backend/ebook/e-destination.c (e_destination_get_email_num):
- Added.
-
- * contact-editor/e-contact-quick-add.c: Added. Some code and a
- dialog for very quickly adding entries to the address book.
- Still not fully working.
-
-2001-03-04 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card-simple.c: Cleaned up the formatting in this
- file a bit.
-
- * contact-editor/e-contact-editor.c (e_contact_editor_set_arg):
- Made it so that passing in NULL to the writable_fields arg sets
- the set of writable fields to the empty set.
-
- * gui/component/select-names/e-select-names-text-model.c
- (e_select_names_text_model_activate_obj): Pass NULL as the
- writable_fields argument here.
-
- * gui/widgets/e-addressbook-model.c: Don't offset by one here.
- This way we will get the file_as field as one of our
- ETableColumns.
-
- * gui/widgets/e-addressbook-view.c (SPEC): Updated this for the
- changes in ECardSimple.
-
- * gui/widgets/e-minicard.c (remodel): Don't remodel if the item
- isn't realized.
-
-2001-03-02 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c: doh, track renaming of
- objectclass from evolvePerson to evolutionPerson.
-
-2001-03-02 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/evolutionperson.schema: rename evolveperson.schema
- to this, and add remaining attributes.
-
- * backend/pas/pas-backend-ldap.c: add remaining fields, and fix up
- ones that were incorrent (either the ldap_attr or the query prop).
-
-2001-03-02 JP Rosevear <jpr@ximian.com>
-
- * conduit/Makefile.am: update sed script
-
- * conduit/e-address.conduit.in: update for new pilot foo
-
-2001-03-02 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-text-model.c
- (e_select_names_text_model_activate_obj): track change to
- e_contact_editor_new.
-
-2001-03-02 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (add_objectclass_mod): add
- objectclasses for "person", "organizationalPerson", and "top" as
- well, just to be complete.
- (check_schema_support): rename check_for_evolve_person to this, to
- reflect that we're doing more than just checking for that
- objectClass.
- (add_oc_attributes_to_supported_fields): new function.
- (add_to_supported_fields): new function.
- (pas_backend_ldap_destroy): unref supported_fields.
-
-2001-03-02 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-minicard-view.c (supported_fields_cb): new
- function.
- (e_minicard_view_event): split out the creation of the contact
- editor to the supported_fields callback.
-
- * gui/widgets/e-minicard.c (supported_fields_cb): new function.
- (e_minicard_event): split out the creation of the contact editor
- to the supported_fields callback.
-
- * gui/widgets/e-addressbook-view.c (table_double_click): split
- function into two functions, since e_book_get_supported_fields
- requires a callback now.
- (supported_fields_cb): new function.
-
- * gui/component/addressbook.c (new_contact_cb): split this into
- two functions, since e_book_get_supported_fields requires a
- callback now.
- (supported_fields_cb): new function.
-
- * contact-editor/test-editor.c (main): track change to
- e_contact_editor_new (pass NULL for the writable_fields arg.)
-
- * contact-editor/contact-editor.glade: fix several labels so they
- make better sense (since we look them up in e-contact-editor.c.)
-
- * contact-editor/e-contact-editor.h (struct _EContactEditor): add
- writable_fields. also, add it to e_contact_editor_new.
-
- * contact-editor/e-contact-editor.c (e_contact_editor_class_init):
- add writable_fields arg.
- (e_contact_editor_destroy): unref the writable_fields list.
- (e_contact_editor_new): pass @fields as the writable_fields arg.
- (e_contact_editor_set_arg): add writable_fields support.
- (enable_writable_fields): new (very hairy) function, to disable
- everything and reenable just the fields listed in the
- writable_fields list.
- (_email_arrow_pressed): set label-email1, entry-email1, and
- checkbutton-htmlmail to be sensitive since the only way to get
- here is to activate a writable field in the menu.
- (_address_arrow_pressed): set label-address, button-fulladdr, and
- text-address to be sensitive for the same reason.
- (_phone_arrow_pressed): sensitize the label and entry for the same
- reason.
-
-2001-03-02 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-card-simple.c (field_data): add new entries for
- phone enums, and fill in the ecard_field with (bogus in all but a
- few cases) strings. these are the strings sent from wombat to
- evolution-addressbook for supported_fields.
- (e_card_simple_get_ecard_field): new function.
- (e_card_simple_map_phone_to_field): new function.
- (e_card_simple_map_email_to_field): new function.
- (e_card_simple_map_address_to_field): new function.
-
- * backend/ebook/e-card-simple.h: add a few phone entries to the
- ECardSimpleField enum, and add prototypes for mapping the list
- types (phone, email, address) to ECardSimpleField. Also, add
- prototype for e_card_simple_get_ecard_field.
-
- * backend/ebook/e-book.c
- (e_book_do_response_get_supported_fields): don't build the EList
- here, it's already built.
-
- * backend/ebook/e-book-listener.h: change fields from the CORBA
- sequence to the EList in our reponse struct.
-
- * backend/ebook/e-book-listener.c
- (e_book_listener_queue_get_supported_fields_response): we make the
- EList here, since after we return the CORBA list is freed up.
-
-2001-03-02 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_process_get_supported_fields): implement
- properly, we support everything.
-
-2001-03-01 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-bonobo.c
- (entry_set_property_fn): Oops, we do need to be able to write to
- "text" after all (for things like Reply-to: to work properly).
- Fixed.
- (impl_SelectNames_get_entry_for_section): Made "text" a writeable
- property again.
-
- * gui/component/select-names/e-select-names-text-model.c
- (e_select_names_text_model_insert_length): Increment pos so that
- we don't reverse strings when length > 1 (a particularly amusing
- bug).
-
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_destroy): Check for NULL before calling
- gtk_object_unref (GTK_OBJECT (---)), to get rid of annoying error
- messages.
-
-2001-03-01 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c: I am an
- idiot.
-
-2001-03-01 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-table-model.c
- (fill_in_info): Change for new EDestination/ESelectNamesModel API.
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_get_source): Added. A function for
- looking up the ESelectNamesModel by id. (I didn't end up using
- this function, but it might come in handy later.)
- (e_select_names_manager_get_cards): #if 0/#endif out this
- function.
- (e_select_names_manager_create_entry): Modified to attach an
- ESelectNamesCompletion to the entry we create.
- (completion_handler): A post-completion handler for our EEntry, to
- take the completion's extra data (an EDestination) and properly
- stick it into our ESelectNamesModel.
-
- * gui/component/select-names/e-select-names.c
- (real_add_address_cb): Changed to operate on EDestinations rather
- than ECards and to use the new ESelectNamesModel API. This leads
- to a rather nice code simplication.
- (remove_address): Changed for new ESelectNamesModel API.
-
- * gui/component/select-names/e-select-names-bonobo.c
- (entry_get_property_fn): Rather than just passing the entry's text
- through the property bag, get the "address text" from the model.
- This returns a nice, verbose string of addresses with names
- expanded when the address is tied to an ECard (i.e. "Jon
- Trowbridge <trow@ximian.com>").
- (impl_SelectNames_get_entry_for_section): Make the text property
- read-only.
- (entry_set_property_fn): ...and since it is read-only now, chop
- out the setter code.
-
- * gui/component/select-names/e-select-names-text-model.h:
- * gui/component/select-names/e-select-names-text-model.c: Again,
- this code has been (pretty much) totally rewritten to convert all
- text operations into changes on the ESelectNamesModel. This lets
- us give the associated EEntry some (IMHO) nice semantics regarding
- whitespace, etc. Includes object activation, so destinations tied
- to ECards are underlined and can be double-clicked to bring up a
- contact editor.
-
- * gui/component/select-names/e-select-names-model.h:
- * gui/component/select-names/e-select-names-model.c: I've heavily
- modified this object to both hide all implementation details
- (which the old version exposed a bit too much for my peculiar
- tastes) and to act as an EDestination container. The old code put
- the text model operations here. I've moved them all to
- ESelectNamesTextModel --- so the text model actions (insert,
- delete, etc.) are all done through the API rather than operating on
- ESelectNamesModel internals.
-
- * gui/component/select-names/e-select-names-completion.c: Added. A
- fairly complicated object derived from ECompletion that searches
- our local addressbook in various and sundry ways.
-
- * gui/component/select-names/e-select-names-completion.h:
-
- * backend/ebook/e-destination.h:
- * backend/ebook/e-destination.c: Added. This object encapsulates
- a place to sent an email to, which can either be just a address as
- a string ("trow@ximian.com"), a fancier string ("Jon Trowbridge
- <trow@ximian.com>"), or an ECard and a specific address within
- that ECard.
-
-2001-03-01 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-minicard-view.c, gui/widgets/e-minicard-view.h,
- gui/widgets/e-minicard.c, gui/widgets/e-minicard.h: Used
- ESelectionModelSimple and the changes to EReflow and EReflowSorted
- to get multiple selection in the minicard view.
-
- * gui/widgets/test-reflow.c: Changed this to get it to compile
- with the changes to EReflow.
-
-2001-02-21 Christopher James Lahey <clahey@ximian.com>
-
- * backend/pas/pas-backend-file.c (pas_backend_file_search): Made
- this pay attention to the return value of e_sexp_parse.
-
- * gui/component/select-names/e-select-names-text-model.c
- (e_select_names_text_model_activate_obj): Fixed a const
- inconsistency here.
-
-2001-02-21 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-book.c (pas_book_queue_get_supported_fields):
- new function.
- (impl_GNOME_Evolution_Addressbook_Book_getSupportedFields): track
- change to idl.
- (pas_book_respond_get_supported_fields): new function.
-
- * backend/pas/pas-book.h: add GetSupportedFields to the
- PASOperation enum. Also, add a stringlist field to the PASRequest
- struct. lastly, add a prototype for
- pas_book_respond_get_supported_fields.
-
- * backend/pas/pas-backend.h: remove prototype for
- pas_backend_get_supported_fields, and remove it from the vtable.
-
- * backend/pas/pas-backend.c (pas_backend_get_supported_fields):
- remove.
- (pas_backend_class_init): no vtable entry for get_supported_fields
- anymore.
-
- * backend/pas/pas-backend-ldap.c
- (pas_backend_ldap_process_get_supported_fields): new function.
- (pas_backend_ldap_process_client_requests): add case for
- GetSupportedFields.
- (pas_backend_ldap_class_init): get_supported_fields isn't in
- vtable anymore.
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_process_get_supported_fields): new function.
- (pas_backend_file_process_client_requests): add case for
- GetSupportedFields.
- (pas_backend_file_class_init): get_supported_fields isn't in
- vtable anymore.
-
- * backend/idl/addressbook.idl: Book::getSupportedFields now
- returns void and add BookListener::notifySupportedFields.
-
- * backend/ebook/test-client.c (get_fields_cb): new function.
- (auth_user_cb): track change to e_book_get_supported_fields.
-
- * backend/ebook/e-book.c
- (e_book_do_response_get_supported_fields): new function.
- (e_book_check_listener_queue): add case
- GetSupportedFieldsResponse.
- (e_book_get_supported_fields): switch to async model.
-
- * backend/ebook/e-book.h: switch e_book_get_supported_fields to an
- async model.
-
- * backend/ebook/e-book-listener.c
- (e_book_listener_queue_get_supported_fields_response): new
- function.
- (impl_BookListener_response_get_supported_fields): new function.
- (e_book_listener_get_epv): fill in epv's "notifySupportedFields"
-
- * backend/ebook/e-book-listener.h: add an async response for
- GetSupportedFields and add a stringlist member to the
- EBookListenerResponse struct.
-
-2001-02-20 Federico Mena Quintero <federico@ximian.com>
-
- * backend/pas/pas-book-factory.c (pas_book_factory_activate):
- Moved the register_factory() code to here, since it was the only
- thing being called anyways.
- (PasBookFactoryPrivate): Added a "registered" flag.
- (pas_book_factory_activate): Set the registered flag.
- (pas_book_factory_destroy): Deactivate the factory when we go away.
-
-2001-02-20 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book.c (e_book_get_supported_fields): new function.
-
- * backend/ebook/e-book.h: add e-book interface to getting
- supported fields.
-
- * backend/ebook/test-client.c (auth_user_cb): shoe-horn in some
- spew about supported fields.
-
-2001-02-19 JP Rosevear <jpr@ximian.com>
-
- * conduit/Makefile.am: Remove PISOCK_LIBDIR
-
-2001-02-19 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_create_entry): When creating the entry,
- open up an ebook (corresponding to the local addressbook) and make
- the entry use an EAddressCompletion.
- (completion_handler): Added; this is the actual completion
- handler, which manipulates the entry when the user selects
- something from the drop-down.
-
- * gui/component/select-names/e-select-names-model.c: Various hacks
- by clahey to unbreak e_select_names_model_add_item,
- e_select_names_model_replace_item (which I added) and
- e_select_names_model_remove_item.
-
- * gui/component/select-names/e-select-names-text-model.c
- (e_select_names_text_model_obj_count,
- e_select_names_text_model_get_nth_obj): Make chunks of text that
- correspond to ECards in the ESelectNamesModel be embedded objects.
- (e_select_names_text_model_activate_obj): On activation, pop up a
- contact editor for the embedded object's card.
- (e_select_names_text_model_model_changed): Fixed to work with
- ETextModel API changes.
- (e_select_names_text_model_set_text): Make const correct.
- (e_select_names_text_model_insert): Make const correct.
- (e_select_names_text_model_insert_length): Make const correct.
-
- * backend/ebook/e-address-completion.h,
- backend/ebook/e-address-completion.c: Added. EAddressCompletion
- is a derived class of ECompletion that does asynchronous address
- lookups for completions.
-
-2001-02-17 Chris Toshok <toshok@ximian.com>
-
- * backend/idl/addressbook.idl: add sequence<string> typedef, and
- add getSupportedFields method.
-
- * backend/pas/pas-book.c
- (impl_GNOME_Evolution_Addressbook_Book_getSupportedFields): new
- function.
-
- * backend/pas/pas-backend.c (pas_backend_class_init): init
- get_supported_fields = NULL.
- (pas_backend_get_supported_fields): new function.
-
- * backend/pas/pas-backend.h: add prototype for
- pas_backend_get_supported_fields.
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_get_supported_fields): new function.
- (pas_backend_file_class_init): fill in get_supported_fields.
-
- * backend/pas/pas-backend-ldap.c
- (pas_backend_ldap_get_supported_fields): new function.
- (pas_backend_ldap_class_init): fill in get_supported_fields.
-
-2001-02-14 Christopher James Lahey <clahey@ximian.com>
-
- * backend/pas/pas-backend-ldap.c: Undefine E_STRING_PROP and
- E_LIST_PROP here.
-
- * contact-editor/e-contact-editor.c,
- contact-editor/e-contact-editor.h (e_contact_editor_raise): Added
- this function.
-
- * gui/widgets/e-minicard.c, gui/widgets/e-minicard.h
- (e_minicard_event): Added an editor field to the EMinicard object.
- Made it so that if you double click on the same card twice, it
- doesn't open a new window, but instead raises the old.
-
-2001-02-08 Iain Holmes <iain@ximian.com>
-
- * gui/component/addressbook-storage.c (addressbook_source_free):
- Free the ldap.binddn.
-
- * gui/widgets/e-addressbook-view.c
- (e_addressbook_view_setup_menus): Free the dir strings.
-
-2001-02-08 Christopher James Lahey <clahey@ximian.com>
-
- * contact-editor/e-contact-editor.c (categories_clicked): Set the
- header on the category dialog we pop up.
-
-2001-02-12 Kjartan Maraas <kmaraas@gnome.org>
-
- * backend/ebook/GNOME_Evolution_Addressbook_GnomeCard_Importer.oaf.in: Translations.
- * gui/component/select-names/GNOME_Evolution_Addressbook_SelectNames.oaf.in:
- Marked strings for translation in this newly created file.
- * gui/component/select-names/Makefile.am: Hook up the .oaf.in files in the
- xml-i18n-tools framework.
- * gui/component/Makefile.am: Same as above.
- * gui/component/GNOME_Evolution_Addressbook.oaf.in: Marked stuff for translation here
- too.
-
-2001-02-11 Jason Leach <jasonleach@usa.net>
-
- * gui/component/addressbook.c: Removed an ancient #include
- <libgnorba/gnorba.h>
-
-2001-02-11 Gediminas Paulauskas <menesis@delfi.lt>
-
- Really use xml-i18n-tools.
-
- * conduit/e-address-conduit-control-applet.desktop: removed.
- * conduit/e-address-conduit-control-applet.desktop.in: added empty.
- * conduit/Makefile.am: reflect above changes, merge translations.
-
- * contact-editor/e-contact-editor-strings.h,
- contact-editor/fulladdr.glade.h, contact-editor/fullname-strings.h,
- contact-editor/e-contact-editor-confirm-delete.glade.h,
- gui/component/select-names/select-names.glade.h:
- removed these files, xml-i18n-extract takes care of strings itself.
-
- * contact-editor/*.glade,
- gui/component/select-names/select-names.glade,
- gui/widgets/alphabet.glade, printing/e-contact-print.glade:
- changed project options to not output_translatable_strings.
-
- * contact-editor/Makefile.am, gui/widgets/Makefile.am,
- gui/component/select-names/Makefile.am, printing/Makefile.am:
- do not include removed files in EXTRA_DIST.
-
-2001-02-07 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (check_for_evolve_person): flesh
- out this check. #ifdef the entire thing OPENLDAP2, as it only
- works with the new schema stuff in openldap 2.x (both on server
- and client, so upgrade your server.)
-
-2001-02-07 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-view.c: Added N_("* Click here to add
- a contact *").
-
-2001-02-07 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_connect): only
- set the DEBUG_LEVEL if we're OPENLDAP2.
-
-2001-02-06 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (email_compare): return TRUE if
- equal, FALSE otherwise.
- (business_compare): same.
- (homephone_compare): same.
- (email_ber): return NULL if there are no elements in our list.
- (homephone_ber): same.
- (business_ber): same.
- (build_mods_from_ecards): add smarts to handle list elements
- properly (like email, business_phone, home_phone.) now we'll
- properly send updates if any element in the list changes.
-
-2001-02-06 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/Makefile.am (INCLUDES): Added
- -DEVOLUTION_DATADIR=\""$(datadir)"\".
-
- * gui/widgets/e-addressbook-view.c
- (e_addressbook_view_setup_menus): Changed the local and system
- directories.
-
-2001-02-06 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (create_card_handler): doh,
- didn't mean to commit this.
-
-2001-02-06 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/evolveperson.schema: new file. this will eventually
- form the suggested additions to an existing openldap server that,
- along with support for inetorgperson, will allow people to store
- all evolution attributes in ldap.
-
-2001-02-06 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_init): don't
- need the = NULL's since we g_new0.
- (check_for_evolve_person): new function.
- (pas_backend_ldap_connect): check to see if the evolvePerson
- objectclass is there.
- (build_mods_from_ecards): right now, just silently skip the extra
- attributes if we don't support evolvePerson.
- (add_objectclass_mod): new function, add both inetOrgPerson and
- (if it's available) evolvePerson as objectclasses.
- (pas_backend_ldap_process_authenticate_user): also check to see if
- evolvePerson is there, if we couldn't do it (due to auth reasons)
- in the connect method.
- (prop_info): change the telephoneNumber LDAP attribute to be used
- for evolution's business phone numbers. the primary phone number
- will be a single valued attribute on evolvePerson.
- (business_populate): new function.
- (business_ber): new function.
- (business_compare): new function.
-
-2001-02-05 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (create_card_handler): err,
- allocate 2 char*s when i assign 2 char*s.
-
-2001-02-05 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (modify_card_handler): switch to
- ldap_modify_ext_s if OPENLDAP2, as ldap_modify_s is deprecated.
- (build_mods_from_ecards): don't include the mod if the value is ""
- - this isn't valid on schema checking ldap servers.
- (homephone_populate): new function.
- (homephone_ber): new function.
- (homephone_compare): new function.
- (create_card_handler): add spew when adding cards so I can see
- what's going on.
-2001-02-05 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook-config.c (table_add_elem): Save the
- help_text in the closure.
-
-2001-02-05 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/widgets/Makefile.am (libeminicard_a_SOURCES): Added
- gal-view-factory-minicard.c, gal-view-factory-minicard.h,
- gal-view-minicard.c, and gal-view-minicard.h.
-
- * gui/widgets/gal-view-factory-minicard.c,
- gui/widgets/gal-view-factory-minicard.h,
- gui/widgets/gal-view-minicard.c, and
- gui/widgets/gal-view-minicard.h: New classes for minicard view
- type.
-
- * gui/widgets/e-addressbook-view.c: Deploy gal-view stuff
- properly.
-
-2001-02-05 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card.c (e_card_get_vcard): Make the Note field
- be quoted printable.
-
-2001-01-27 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/search/e-addressbook-search-dialog.c
- (e_addressbook_search_dialog_init): This should be a close button,
- not a cancel button.
-
-2001-02-04 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_activate_dialog): Call
- e_select_names_set_default when appropriate.
-
- * gui/component/select-names/e-select-names.c,
- gui/component/select-names/e-select-names.h: Added support for
- double clicking sending the selected contacts to the default
- section. Added a set_default function. Made multiple selection
- work.
-
-2001-01-29 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-config.c
- (addressbook_config_source_label): #ifdef INCLUDE_FILE_SOURCE.
- (table_add_elem): add help_text parameter and set up focus_in
- events to display the help in the dialog's html area.
- (focus_help): new function, calls put_html on the help text.
- (addressbook_ldap_auth_item_new): add help texts.
- (addressbook_source_item_new): add help texts.
- (addressbook_source_dialog): add help texts.
-
-2001-01-27 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_add_section): Remove the butt-ugly arrow icon and
- replace it with a less invasive "->" icon.
-
-2001-01-25 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (build_mods_from_ecards): add
- comment about the else block here.
- (prop_info): add home_address, business_address, business_fax,
- assistant, and isdn.
-
-2001-01-25 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/pas/pas-backend-file.c (pas_backend_file_load_uri): Made
- this only add the initial VCard if it finds a file
- "create-initial" in the directory it's creating the database in.
-
- * gui/component/addressbook-component.c (factory_fn): Added a
- create_folder function.
-
- * gui/search/e-addressbook-search-dialog.c
- (e_addressbook_search_dialog_init): Fixed an unused variable
- warning.
-
-2001-01-25 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/widgets/e-addressbook-view.c
- (e_addressbook_view_setup_menus): Setup the view collection
- properly and handle the "display_view" signal.
-
-2001-01-25 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook.c (update_pixmaps): Consider the
- placeholder in the path for the "Print" item.
-
-2001-01-25 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook.c (update_pixmaps): Set the icon for
- "/Toolbar/Find" to "24_find_contact.xpm".
-
-2001-01-25 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook.c (set_pixmap): New.
- (update_pixmaps): New function, setting the pixmaps for the items
- of type "pixbuf", using `set_pixmap'.
- (control_activate): Call it.
-
-2001-01-25 Not Zed <NotZed@Ximian.com>
-
- * backend/pas/pas-backend-ldap.c: esexp api change fixes.
-
- * backend/pas/pas-backend-file.c (entry_compare): Fix for e_sexp api changes.
- (vcard_matches_search): esexp api fixes.
- (pas_backend_file_search): Ouch, unref the e-sexp properly (not gtk object).
-
-2001-01-24 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (email_ber_func): make sure to
- add the lengths here (include the \0? anyone?).
- (build_mods_from_ecards): if we're filling in mod->mod_bvalues,
- set mod_op |= LDAP_MOD_BVALUES.
-
-2001-01-23 Jason Leach <jasonleach@usa.net>
-
- (Fix #1225: advanced search cancel/close)
-
- * gui/search/e-addressbook-search-dialog.c
- (e_addressbook_search_dialog_init): Set it up with Search and a
- Cancel button, Search is still the default.
-
-2001-01-23 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (local_record_from_ecard): properly ref
- the ecard. still need to kill some memory leaks.
-
-2001-01-22 JP Rosevear <jpr@ximian.com>
-
- * conduit/Makefile.am: remove vfs dependency
-
-2001-01-21 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (delete_record): Remove
- deleted records from the pilot map so we don't have dupes in the future
-
-2001-01-19 Dan Winship <danw@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (table_right_click):
- * gui/widgets/e-minicard.c (e_minicard_event): Update for
- e_popup_menu_run prototype change.
-
-2001-01-19 Jason Leach <jasonleach@usa.net>
-
- (Adding a boolean "entry_changed" BonoboPropertyBag arg)
-
- * gui/component/select-names/e-select-names-bonobo.c
- (entry_set_property_fn): Use a gtk_object_set_data to set the
- property to TRUE here.
-
- (entry_changed): New function, calls bonobo_control_set_property
- if entry_changed hasn't been set to TRUE yet.
-
- (impl_SelectNames_get_entry_for_section): Connect "changed" on
- each entry_widget to the new entry_changed() func.
-
-2001-01-19 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (ecard_from_remote_record): always free
- the delivery elements and correct embarrassingly stupid memory error
- that was causing the addressbook conduit problems.
-
- * backend/ebook/e-book-view-listener.c
- (e_book_view_listener_check_queue): ref/unref ourself when processing
- in case someone we signal unrefs us.
-
- * conduit/address-conduit.c (sequence_complete): disconnect signals
- when complete
-
-2001-01-17 Federico Mena Quintero <federico@ximian.com>
-
- * backend/pas/pas-book-factory.c (pas_book_factory_activate): Made
- it return a gboolean; it was completely ignoring the return value
- from register_factory().
-
-2001-01-17 Larry Ewing <lewing@helixcode.com>
-
- * backend/ebook/.cvsignore: add evolution-gnomecard-importer.
-
- * backend/ebook/Makefile.am (oaf_DATA): don't require the pine
- oainfo file until it is actually added to the repository. We need
- to keep the build working for nightlies to work.
-
-2001-01-16 Jason Leach <jasonleach@usa.net>
-
- * backend/pas/pas-backend-file.c (INITIAL_VCARD): s/Helix
- Code/Ximian/ for the initial contact card.
-
-2001-01-15 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (print_local): prevent segfaults and
- buffer overflows
- (print_remote): ditto
-
-2001-01-14 JP Rosevear <jpr@ximian.com>
-
- * conduit/Makefile.am: pass -module and -avoid-version to conduit
- linker
-
-2001-01-12 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/addressbook-component.c (factory_fn): Pass NULL as
- the @copy_folder_fn arg to `evolution_shell_component_new'.
-
-2001-01-12 Miguel de Icaza <miguel@ximian.com>
-
- * gui/widgets/e-addressbook-view.c: added i18n for etable.
-
-2001-01-11 Chris Toshok <toshok@helixcode.com>
-
- * backend/pas/pas-backend-ldap.c
- (pas_backend_ldap_process_create_card): get a book view from
- somewhere so we can give status messages - choose the first one in
- the list.
- (pas_backend_ldap_process_modify_card): same.
- (pas_backend_ldap_process_remove_card): same.
- (prop_info): add more properties, like home_phone, mobile, pager,
- uri, org_unit, office, title, and manager.
-
-2001-01-09 Miguel de Icaza <miguel@gnu.org>
-
- * gui/widgets/Makefile.am (minicard_widget_test_LDADD): Put GNOME
- libraries at the end to make the thing compile.
-
- * printing/Makefile.am: Order LDADD flags correctly so it compiles.
-
-2001-01-09 Chris Toshok <toshok@helixcode.com>
-
- * gui/component/addressbook.c (addressbook_factory_new_control):
- connect with the EAddressbookView's status_message signal.
- (set_status_message): set the status message on the ShellView
- Interface associated with our control.
- (retrieve_shell_view_interface_from_control): new function. get
- the shell view inteface associated with a control.
-
- * gui/widgets/e-addressbook-view.c
- (e_addressbook_view_class_init): register status_message signal.
- (status_message): new function, emit our status_message signal.
- (change_view_type): connect with the view->object's
- "status_message" signal.
-
- * gui/widgets/e-addressbook-view.h (struct
- _EAddressbookViewClass): add status_message signal.
-
-2001-01-09 Chris Toshok <toshok@helixcode.com>
-
- * gui/widgets/e-minicard-view-widget.c
- (e_minicard_view_widget_class_init): register our status_message
- signal.
- (status_message): new function, emit our status_message signal.
- (e_minicard_view_widget_realize): connect to the EMinicardView's
- status_message signal.
-
- * gui/widgets/e-minicard-view-widget.h: add status_message signal.
-
- * gui/widgets/e-minicard-view.c (e_minicard_view_class_init):
- register our status_message signal.
- (e_minicard_view_init): init status_message_id.
- (status_message): new function, emit our status_message signal.
- (book_view_loaded): connect to the EBookView's status_message
- signal.
- (disconnect_signals): disconnect status_message_id.
-
- * gui/widgets/e-minicard-view.h: add status_mesage_id, and
- status_message signal.
-
- * gui/widgets/e-addressbook-model.c (status_message): new
- function, emit our status_message.
- (e_addressbook_model_class_init): register our "status_message"
- signal.
- (book_view_loaded): connect to the EBookView's status_message
- signal, so we can chain it to our parent.
- (e_addressbook_model_init): init status_message_id.
- (remove_book_view): disconnect status_message_id.
-
- * gui/widgets/e-addressbook-model.h: add status_message_id, and
- status_message signal.
-
- * backend/pas/pas-backend-ldap.c change the objectclass we create
- objects with to "inetOrgPerson" as it encompasses the fields we
- use.
- (create_dn_from_ecard): remove the mail/org handling from
- here. we just prepend cn=$cn onto the base dn.
- (create_card_handler): remove the NULL that build_mods_from_ecards
- adds at the end, and insert our objectClass.
- (modify_card_handler): call search_for_dn to get the ECardSimple
- of the old card, since it might (and does in the current code)
- doing a brute force search.
- (search_for_dn): new function, to search for an entry by its dn.
- right now we brute force (objectclass=*) under the base dn and
- compare dn's. going to add a first pass that explodes the dn and
- searches that way, using (objectclass=*) as a last resort. also,
- here's where we'd put the extensibleMatch code if we want to go
- that route.
-
- * backend/ebook/e-card.c (e_card_set_arg): if we're setting the
- full name regenerate ecard->name.
-
-2001-01-04 Chris Toshok <toshok@helixcode.com>
-
- * backend/ebook/e-book-listener.c
- (e_book_listener_queue_authentication_response): new function.
- (impl_BookListener_respond_authentication_result): new function.
- (e_book_listener_get_epv): fill in
- epv->notifyAuthenticationResult.
-
- * backend/ebook/e-book-listener.h: add AuthenticationResponse to
- EBookListenerOperation.
-
- * backend/ebook/e-book.c (e_book_authenticate_user): new function.
-
- * backend/ebook/e-book.h: add prototype for
- e_book_authenticate_user.
-
- * backend/idl/addressbook.idl (GNOME:Evolution:Addressbook:Book):
- add authenticateUser method.
- (GNOME:Evolution:Addressbook:BookListener): add
- AuthenticationFailed and AuthenticationRequired to CallStatus.
- also add notifyAuthenticationResult method.
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_process_authenticate_user): dummy
- authenticate_user function that always succeeds.
- (pas_backend_file_process_client_requests): respond to the
- AuthenticateUser request.
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_build_query):
- gtk_object_unref(sexp) => s_exp_unref(sexp).
- (pas_backend_ldap_process_authenticate_user): fill in to use
- ldap_simple_bind_s.
- (pas_backend_ldap_process_client_requests): respond to the
- AuthenticateUser request.
-
- * backend/pas/pas-book.c (pas_book_queue_authenticate_user): new
- function.
- (impl_GNOME_Evolution_Addressbook_Book_authenticateUser): new
- function.
- (pas_book_respond_authenticate_user): new function.
- (pas_book_get_epv): fill in epv->authenticateUser.
-
- * backend/pas/pas-book.h: add AuthenticateUser operation type, and
- add user/passwd to the PASRequest struct.
-
- * gui/component/addressbook-storage.c
- (addressbook_storage_get_source_by_uri): new function. should use
- a hashtable, perhaps, but the lists will generally be small
- anyway.
-
- * gui/component/addressbook-storage.h: add prototype for
- addressbook_storage_get_source_by_uri.
-
- * gui/component/addressbook-config.c
- (addressbook_source_dialog_set_source): fill in the binddn if the
- auth page is shown.
-
- * gui/component/addressbook.c (book_open_cb): shoe-horn
- authentication in here. if the source was configured to use
- authentication, authenticate the user after opening the ebook.
- also, be paranoid and clear out the password after authenticating.
- (book_auth_cb): callback for auth. set the "book" arg on the
- view->view here.
- (passwd_cb): set the view's passwd that'll be used in
- book_open_cb.
- (addressbook_view_free): g_free view->passwd.
-
-2001-01-04 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook-component.c,
- gui/component/addressbook-component.h
- (addressbook_component_get_shell_client): Added this function.
-
- * gui/component/select-names/e-select-names.c,
- gui/component/select-names/e-select-names.h: Added code for the
- ability to switch between different folders. This doesn't work
- yet.
-
- * gui/component/select-names/select-names.glade,
- gui/component/select-names/select-names.glade.h: Added an option
- menu to this dialog.
-
-2001-01-04 JP Rosevear <jpr@helixcode.com>
-
- * conduit/Makefile.am: Fix hard coded library names that were
- accidentally committed (i'm looking at you miggie)
-
- * contact-editor/e-contact-editor.c (categories_clicked): Reflect
- renaming.
-
- * contact-editor/e-contact-editor-categories.[hc]: These are
- living in gal now
-
-2001-01-04 JP Rosevear <jpr@helixcode.com>
-
- * backend/pas/pas-backend-file.c (pas_backend_file_book_view_free):
- Need to e_sexp_unref the the sexp, not gtk_object_unref it.
-
-2001-01-03 Michael Meeks <michael@helixcode.com>
-
- * gui/widgets/e-addressbook-model.c (get_view): check
- capabilities is valid before doing a strstr.
-
-2001-01-03 Michael Meeks <michael@helixcode.com>
-
- * backend/pas/pas-backend-file.c (pas_backend_file_search):
- g_strdup things we g_free.
-
-2001-01-02 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor.c (delete_cb): Make sure this
- won't crash if the given contact is removed from the database
- while this function is being called.
-
- * gui/widgets/e-minicard.c: Made sure this won't crash if the
- given contact is removed from the database while the right click
- menu is being displayed.
-
-2000-12-30 Chris Toshok <toshok@helixcode.com>
-
- * gui/component/addressbook-config.c (edit_source_clicked): copy
- the dialog's source, destroy the dialog after we're done, and make
- sure to update both columns in the clist.
- (add_source_clicked): copy the dialog's source, and destroy the
- dialog when we're done.
- (addressbook_source_dialog_destroy): free up all the dialog's
- memory.
-
- * gui/component/addressbook.c (set_prop): allow file: uri's that
- point to files, not just dirs that contain addressbook.db. The
- rule is the addressbook file has to end in .db.
-
- * gui/component/addressbook-storage.c (file_source_foreach):
- contactserver => contactfile. cut and paste error.
- (addressbook_storage_init_source_uri): use file://%s to build the
- uri.
-
- * gui/component/e-ldap-server-dialog.[ch]: forgot to remove these
- in my last commit.
-
-2000-12-29 Chris Toshok <toshok@helixcode.com>
-
- * gui/component/addressbook.c (config_cb): new function, calling
- our new config ui code.
- (control_activate): no longer load evolution-addressbook-ldap.xml,
- as it's not there.
-
- * gui/component/addressbook-component.c (owner_set_cb):
- setup_ldap_storage => addressbook_storage_setup.
-
- * gui/component/Makefile.am (evolution_addressbook_SOURCES):
- remove e-ldap-storage.[ch] and add addressbook-storage.[ch].
- (glade_DATA): remove ldap-server-dialog.glade and add
- addressbook-config.glade.
- (EXTRA_DIST): same.
-
- * gui/component/addressbook-config.[ch]: add another dialog to
- give a list of our sources and offer the Add/Delete/Edit
- interface. This plugs into the previous dialog work (the source
- editor.)
-
- * gui/component/addressbook-storage.[ch]: new files, containing
- the remains of e-ldap-storage.[ch] and adding the new
- AddressbookSource type and it's subordinates. Also, the xml
- format has changed slightly and the file name is no longer
- ~/evolution/ldap-servers.xml - it's
- ~/evolution/addressbook-sources.xml.
-
- * gui/component/addressbook-config.glade: new file, new config
- interface.
-
- * gui/component/ldap-server-dialog.glade: removed.
-
- * gui/component/e-ldap-storage.[ch]: removed.
-
-2000-12-28 Chris Toshok <toshok@helixcode.com>
-
- * gui/component/Makefile.am (evolution_addressbook_SOURCES): add
- addressbook-config.[ch].
-
- * gui/component/addressbook-config.c,
- gui/component/addressbook-config.h: new files, containing at the
- moment a beautiful "new/edit source dialog" inspired by the
- mail-config-gui code. It'll be ready for prime time after rev'ing
- the .xml file the addressbook uses to store it's "other sources"
- to include files, and the addition of the ldap auth stuff.
-
-2000-12-25 Miguel de Icaza <miguel@helixcode.com>
-
- * gui/widgets/e-minicard.c (e_minicard_realize): Set draw
- background to FALSE.
-
- * gui/widgets/e-minicard-label.c (e_minicard_label_construct): ditto.
- (e_minicard_label_construct): ditto
-
-2000-12-23 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/fullname-strings.h,
- contact-editor/fullname.glade: Added Ms. and Miss to the prefix
- drop down box. Patch submitted by Martin Hicks <mort@bork.org>.
-
-2000-12-21 JP Rosevear <jpr@helixcode.com>
-
- * conduit/address-conduit.c (cursor_cb): Ref the cards that get put
- in the change list
- (next_changed_item): util function to get the real next changed item
- (compute_status): really compute the status of the record
- (local_record_from_uid): Set the id of the temporary card
- (check_for_slow_setting): Make this check a little saner
- (card_added): Only record the CardObjectChange if the card is not
- archived
- (card_changed): ditto
- (card_removed): ditto
- (set_status_cleared): actually clear the status
- (for_each_modified): Clean out cruft and use next_changed_item
- (add_record): Set the new id properly in our local card copy
- (replace_record): handle the case where the record has been deleted
- and we need to call add. need to update the changed_hash entry
- (delete_record): Don't panic if the card is not found, its already
- been deleted.
-
- * backend/pas/pas-backend-file.c (pas_backend_file_book_view_copy):
- The change_context no longer has a del_cards member
- (pas_backend_file_book_view_free): ditto
- (pas_backend_file_process_get_changes): ditto
- (pas_backend_file_changes_foreach_key): just record the id
- (pas_backend_file_changes): notify_remove needs an id not a vcard
-
-2000-12-20 JP Rosevear <jpr@helixcode.com>
-
- * conduit/address-conduit.c (match): Use my own wrapper
- functions instead of trying to *directly* access the the data
- structures my self
- (post_sync): Put in hack to prevent syncing the same records twice
- (local_record_from_uid): set the card id when creating a blank one
- (add_record): Set the id of the card we have and don't go to the
- server to get the latest version
-
-2000-12-19 JP Rosevear <jpr@helixcode.com>
-
- * conduit/address-conduit.c (ecard_from_remote_record): Convert
- pilot strings to utf for the e-cards.
-
-2000-12-19 JP Rosevear <jpr@helixcode.com>
-
- * conduit/address-conduit.c (local_record_from_ecard): Convert ecard
- strings to pilot encodings
-
-2000-12-19 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/widgets/e-addressbook-view.c (delete): Made it so that if
- you select multiple contacts, the right click menu to delete
- deletes them all.
-
-2000-12-18 Chris Toshok <toshok@helixcode.com>
-
- * backend/pas/pas-backend-ldap.c (ldap_error_to_response): always
- use LDAP_NAME_ERROR (in the openldap1 case it's #defined to
- NAME_ERROR).
- (build_card_from_entry): ldap_get_values can return NULL. also,
- openldap2 keeps us from getting at ldap->ld_errno, so we can't
- tell if there was a decoding error like we used to. the double
- free problem where ldap would free the ber if there was a decoding
- problem might be fixed now.. further investigation is needed.
- for now we leak in openldap2.
- (ldap_search_handler): the ldap structure is opaque, so use
- ldap_search_ext to give the extra information (the max responses,
- timeout, etc.) in the openldap2 case.
-
-2000-12-13 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/pas/pas-backend-ldap.c (ldap_error_to_response): Test
- for the existance of LDAP_NAME_ERROR and if it exists as a macro,
- use it instead of NAME_ERROR.
-
-2000-12-14 Michael Meeks <michael@helixcode.com>
-
- * gui/component/GNOME_Evolution_Addressbook.oafinfo: update cut
- and paste description error.
-
-2000-12-13 Dan Winship <danw@helixcode.com>
-
- * gui/widgets/e-minicard-control.c (stream_read): NULL-terminate
- the returned vcard so we don't sometimes end up with trailing
- junk that makes libversit unhappy.
-
-2000-12-13 Iain Holmes <iain@helixcode.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_add_section): Make the -> into a GNOME stock image.
-
-2000-12-09 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_init): Connect to the "cursor_change" signal on
- the ETable here instead of the ETableScrolled.
- (remove_address): Added the col and event parameters to this
- callback to match the added parameters to the double click signal.
- (e_select_names_add_section): Connect to the "double_click" signal
- on the ETable here instead of the ETableScrolled.
-
-2000-12-09 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card.c (e_card_set_arg): When setting the "name"
- argument, copy the incoming name. This fixes a crash.
-
-2000-12-09 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor.c: Made editing the name using
- the full name button set the file as entry properly. Made it
- so that the address parse that the user chooses after
- clicking on the Full Address... button gets saved.
-
-2000-12-08 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor.c (full_name_clicked): Made it
- so that the editor->name is set after the entry is changed. This
- means that the reparse that the person chose is saved.
-
-2000-12-07 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/e-ldap-storage.c (setup_ldap_storage): Pass NULL
- as the @toplevel_node_handler_id argument to
- `evolution_storage_new'.
-
-2000-12-08 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card.c: Fixed some formatting.
-
- * contact-editor/e-contact-editor-categories.h: Removed an
- unneeded #include.
-
- * gui/widgets/e-addressbook-view.c: Connect to the signals on the
- ETable instead of the ETableScrolled.
-
-2000-12-07 JP Rosevear <jpr@helixcode.com>
-
- * conduit/address-conduit.c (local_record_from_uid): Pass "" rather
- than NULL to e_card_new.
- (local_record_from_ecard): Make sure ecard->name is valid
- (check_for_slow_setting): Remove hard coded test value
- (card_added): g_strdup the resul of e_card_get_id
- (card_changed): ditto
-
-2000-12-07 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/widgets/e-addressbook-view.c: Got rid of code referencing
- the ETableScrolled proxy functions.
-
-2000-12-06 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook.c: Moved the gal view menu stuff from
- here to EAddressbookView.
-
- * gui/widgets/e-addressbook-view.c,
- gui/widgets/e-addressbook-view.h: New function to set up the menus
- for the EAddressbookView.
-
-2000-12-06 JP Rosevear <jpr@helixcode.com>
-
- * conduit/Makefile.am: Another conduit build fix
-
-2000-12-05 JP Rosevear <jpr@helixcode.com>
-
- * backend/pas/pas-backend-file.c (pas_backend_file_changes_foreach_key):
- Create an empty vcard with the appropriate id for deleted cards
-
- * conduit/address-conduit.c (ecard_from_remote_record): Ensure the
- address fields are added sensibly
-
-2000-12-05 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/e-ldap-storage.c (setup_ldap_storage): Updated the
- call to `evolution_storage_new()': pass NULL for
- @toplevel_node_uri.
-
-2000-11-28 JP Rosevear <jpr@helixcode.com>
-
- * conduit/address-conduit.c (local_record_to_pilot_record): Return
- a struct rather than a pointer to a struct
- (view_cb): kill warning
- (compare): local_record_to_pilot_record now returns a struct
- (prepare): ditto
- (free_prepare): remove as per gnome-pilot changes
- (conduit_get_gpilot_conduit): don't listen for free_prepare signal
-
-2000-11-27 JP Rosevear <jpr@helixcode.com>
-
- * conduit/address-conduit.h: Remove "complete" field
-
- * conduit/address-conduit.c (print_local): Make it print useful debug
- info
- (print_remote): ditto
- (local_record_from_ecard): Make sure phone numbers get out to the pilot
- (ecard_from_remote_record): Set phone strings to "" if they are null
- (sequence_complete): unref the book view
- (view_cb): ref the book view
- (free_prepare): do nothing
-
- * backend/pas/pas-backend-file.c (pas_backend_file_book_view_free):
- Destroy the card lists with the rest of the view.
- (pas_backend_file_changes): Don't destroy the card lists here
- (pas_backend_file_book_view_free): Free the card/id lists in the
- change context here, the correct place.
- (pas_backend_file_changes): instead of here...
-
-2000-11-22 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/pas/pas-backend-file.c: Set view.change_context to NULL
- in pas_backend_file_process_get_book_view. Changed
- pas_backend_file_book_view_copy a bit.
-
- * backend/pas/pas-backend-ldap.c: Got rid of a warning.
-
-2000-11-18 Matt Bissiri <matt@bissiri.org>
-
- * gui/component/Makefile.am:
- Add widgets/menus/libmenus.la to evolution_addressbook_LDADD
- so that it will link properly now that gal-view-menus.[ch]
- was moved from gal into evolution.
-
-2000-11-15 JP Rosevear <jpr@helixcode.com>
-
- * backend/pas/pas-backend-file.c (pas_backend_file_book_view_copy):
- Initialize destination struct with '0's.
-
-2000-11-12 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card.c: Changed the mime type from "text/vcard"
- to "text/x-vcard".
-
-2000-11-11 Matt Bissiri <bissiri@eecs.umich.edu>
-
- * backend/ebook/.cvsignore: Add idl-generated files.
- * backend/ebook/e-book.c: (e_book_do_response_get_changes):
- * backend/ebook/e-card.c: (e_card_send):
- s/Evolution_/GNOME_Evolution_/g;
-
-2000-11-11 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/Makefile.am: Link in composer bonobo code.
-
- * backend/ebook/e-card.c, backend/ebook/e-card.h: Added code to
- send mail to an ECard or send an ECard as a VCard attachment.
-
- * contact-editor/e-contact-editor.c: Add verbs to send the contact
- as a VCard or send mail to the contact.
-
- * gui/search/e-addressbook-search-dialog.c: Removed some unused
- variables.
-
- * gui/widgets/e-addressbook-view.c, gui/widgets/e-minicard.c:
- Added menu items to send the contact as a VCard or send mail to
- the contact.
-
-2000-11-11 Matt Bissiri <bissiri@eecs.umich.edu>
-
- * gui/component/addressbook.oafinfo:
- * gui/component/select-names/evolution-addressbook-select-names.oafinfo:
- Update the remaining "IDL:Evolution*" to "IDL:GNOME/Evolution*"
- to sync up with yesterday's IDL re-scoping.
-
-2000-11-09 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/pas/pas-backend-ldap.c: Fixed a warning.
-
- * gui/component/addressbook.c: Put in gal view menus for testing
- purposes.
-
- * printing/e-contact-print-envelope.c: Fixed up envelope printing
- a bit. Added code for printing return addresses.
-
-2000-11-09 JP Rosevear <jpr@helixcode.com>
-
- * conduit/address-conduit.h: Add changed_hash, change list and complete bool
-
- * conduit/address-conduit.c (local_record_from_ecard): Add empty field checks
- (card_added): callback for book view
- (card_changed): ditto
- (card_removed): ditto
- (sequence_complete): ditto
- (view_cb): callback for the get changes call
- (pre_sync): force synchronous loading of book view
- (for_each): we already have the card so create the local record directly
- (for_each_modified): Uncomment and fix
- (delete_record): ditto
-
- * conduit/Makefile.am: link against gal for ebook - needs fixing
-
- * backend/ebook/e-book.c (e_book_do_response_get_changes): Properly respond
- to a get_changes call
- (e_book_check_listener_queue): define the get changes response operation
-
- * backend/ebook/e-book-listener.c (e_book_listener_queue_get_changes_response):
- Queue up a get changes response
- (impl_BookListener_respond_get_changes): Implement the get_changes method
- (e_book_listener_get_epv): add get_changes implementation to epv
-
- * backend/pas/pas-backend-file.c (pas_backend_file_book_view_copy): Only
- copy the search_context and change_context elements if they actually exist
- (pas_backend_file_changes): Hard code a path for now, only notify if
- there is something to notify about
-
-2000-11-07 JP Rosevear <jpr@helixcode.com>
-
- * backend/pas/pas-book.h: Update PASRequest structure
-
- * backend/pas/pas-book.c (impl_Evolution_Book_get_changes): update param name
- (pas_book_queue_get_changes): Use PASRequest change_id slot
-
- * backend/pas/pas-backend-file.c (pas_backend_file_book_view_copy):
- Properly copy change_id and change_context
- (pas_backend_file_book_view_free): Free change_id/change_context
- (pas_backend_file_changes_foreach_key): Callback to figure out the
- deleted cards
- (pas_backend_file_changes): Use new e-dbhash stuff to implement.
- Write out updated hash
-
- * backend/idl/addressbook.idl: Rename get_changes param
-
-2000-11-06 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook.c: Switched from EAddressbookSearch to
- ESearchBar.
-
- * gui/widgets/Makefile.am, gui/widgets/e-addressbook-search.c,
- gui/widgets/e-addressbook-search.h: Removed EAddressbookSearch.
- This has been moved to filter/ and renamed ESearchBar.
-
- * printing/e-contact-print-envelope.c: Forgot to set the font.
- This works for me now.
-
-2000-11-06 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/select-names/e-select-names-bonobo.c
- (impl_SelectNames_get_entry_for_section): Duplicate the object
- reference before returning.
-
-2000-11-05 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor.c,
- gui/widgets/e-addressbook-view.c, gui/widgets/e-minicard.c: Add
- menus items to the envelope printing stuff.
-
- * gui/component/addressbook.c: Hook up the search menu.
-
- * gui/widgets/e-addressbook-search.c,
- gui/widgets/e-addressbook-search.h: Add the search menu.
-
- * printing/Makefile.am: Add e-contact-print-envelope.c and
- e-contact-print-envelope.h.
-
- * printing/e-contact-print-envelope.c,
- printing/e-contact-print-envelope.h: Added envelope printing.
-
-2000-11-03 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/component/select-names/Makefile.am: Clean the idl-generated
- files properly.
-
-2000-11-02 Christopher James Lahey <clahey@helixcode.com>
-
- * ename/.cvsignore, gui/minicard/.cvsignore: Removed these
- unnecessary .cvsignores.
-
- * gui/component/addressbook.c: Switch to using EAddressbookSearch
- instead of custom quick search widget.
-
- * gui/component/select-names/e-select-names.c: Made this do a
- slightly better job of rendering names.
-
- * gui/widgets/Makefile.am: Added e-addressbook-search.c and
- e-addressbook-search.h.
-
- * gui/widgets/e-addressbook-search.c,
- gui/widgets/e-addressbook-search.h: New class that puts up an
- entry and a combo box.
-
-2000-11-01 Dan Winship <danw@helixcode.com>
-
- * gui/component/e-ldap-storage.c (load_ldap_data):
- (e_ldap_storage_add_server): Add "highlighted" flag to
- evolution_storage_new_folder
-
-2000-10-31 JP Rosevear <jpr@helixcode.com>
-
- * conduit/address-conduit.c (cursor_cb): Let the warning make sense
- (compute_pid): remove
- (local_record_from_ecard): Create local record from ecard - not finished
- (local_record_from_uid): Obtain local_record from uid with the proper
- e-book way
- (set_status_cleared): Add empty callback
- (add_archive_record): kill
- (delete_archive_record): kill
- (archive_record): Add empty callback
- (conduit_get_gpilot_conduit): Update signal connects
-
- * backend/pas/pas-backend-file.c (vcard_change_type): Function to determine
- the type of change - not finished
- (pas_backend_file_search_changes): Create a view and callback based on
- how the cards have changed
- (pas_backend_file_process_get_changes): Implement the get changes operation
- for files
- (pas_backend_file_process_client_requests): Add GetChanges method for
- processing
-
- * backend/pas/pas-book.c (pas_book_queue_get_changes): Add changes to
- the list
- (impl_Evolution_Book_get_changes): implement object method
- (pas_book_get_epv): Add get changes to epv
- (pas_book_respond_get_changes): Respond to the get changes operation
-
- * backend/pas/pas-book.h: Add GetChanges PASOperation
-
- * backend/idl/addressbook.idl: add get_changes and respond_get_changes
- methods
-
- * backend/ebook/e-book.c (e_book_get_changes): Client function
- to a view of the changed objects
-
- * backend/ebook/e-book.h: New prototype
-
-2000-10-30 Kjartan Maraas <kmaraas@gnome.org>
-
- * backend/e-book/e-card.c: Fixed marking of strings
- for translation. Use "_(" instead of "_ (".
- * gui/component/addressbook-factory.c: Add missing
- calls to bindtextdomain() and textdomain noticed by
- Dan Winship.
- * gui/component/addressbook.c: Marked string for translation.
-
-2000-10-27 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/pas/Makefile.am, gui/search/Makefile.am,
- printing/Makefile.am: Fixed these to include EXTRA_GNOME_CFLAGS.
-
- * gui/component/select-names/e-select-names-manager.c: Turned off
- newlines in header fields.
-
-2000-10-26 Michael Meeks <michael@helixcode.com>
-
- * printing/e-contact-print.c (e_contact_print_letter_tab),
- (complete_sequence, e_contact_do_print_phone_list, lowify):
- unsigned charness.
-
-2000-10-25 Chris Toshok <toshok@helixcode.com>
-
- * backend/pas/pas-backend-ldap.c (ldap_op_process_current): only
- call the handler if the if we're connected, and if we fail to
- connect finish the op and post a message.
- (pas_backend_ldap_connect): add debug spew if DEBUG is defined.
- (modify_card_handler): LDAP_RES_SEARCH_ENTRY => LDAP_SUCCESS.
- (modify_card_handler): only perform the ldap_modify_s if we have a
- list of modifications.
- (get_cursor_handler): use ldap_error_to_response here.
- (pas_backend_ldap_load_uri): use LDAP_PORT instead of the constant
- 389.
-
-2000-10-23 Dan Winship <danw@helixcode.com>
-
- * gui/component/select-names/Makefile.am (INCLUDES):
- * gui/component/Makefile.am (INCLUDES): Update EVOLUTION_LOCALEDIR
-
- * backend/pas/Makefile.am (INCLUDES):
- * backend/ebook/Makefile.am (INCLUDES): Update GNOMELOCALEDIR.
-
-2000-10-23 JP Rosevear <jpr@helixcode.com>
-
- * conduit/address-conduit.h: Use new libeconduit calls and
- abstraction
-
- * conduit/address-conduit.c: ditto
-
-2000-10-23 JP Rosevear <jpr@helixcode.com>
-
- * conduit/address-conduit.c (pre_sync): Use e_pilot_map_read
- (post_sync): Use e_pilot_map_write
-
- * conduit/Makefile.am: Link libeconduit and not libical
-
-2000-10-20 Michael Meeks <michael@helixcode.com>
-
- * contact-editor/e-contact-editor.c (tb_save_and_close_cb):
-
- * gui/component/addressbook.c (toggle_view_as_cb):
-
-2000-10-20 JP Rosevear <jpr@helixcode.com>
-
- * conduit/address-conduit.h: New structure of file - similar
- to calendar/todo conduits
-
- * conduit/address-conduit.c: ditto
-
- * conduit/address-conduit-config.h: Config stuff for conduit
-
- * conduit/.cvsignore: Update
-
- * conduit/Makefile.am: Build fixes
-
- * conduit/address-conduit-control-applet.desktop: Renamed
- to e-address-conduit-control-applet.desktop
-
- * conduit/address.conduit.in: Renamed to e-address.conduit.in
-
-2000-10-19 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/widgets/e-addressbook-view.c (SPEC): Remove Family name
- column since it's a bit weird. This also fixes the initial state
- since all of the column choices were off by one.
-
-2000-10-19 Ettore Perazzoli <ettore@helixcode.com>
-
- * printing/Makefile.am (glade_DATA): Remove
- `e-contact-print.glade.h'.
- (EXTRA_DIST): Move here.
-
- * gui/component/Makefile.am (glade_DATA): Remove
- `ldap-server-dialog.glade.h'.
- (EXTRA_DIST): Move here.
-
-2000-10-19 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card.c: Change how the extension field acts when
- converting delivery addresses to labels.
-
-2000-10-18 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card.c, backend/ebook/e-card.h: Added the
- function e_card_delivery_address_to_label.
-
- * contact-editor/e-contact-editor-address.c: Fixed a potential
- crash.
-
- * contact-editor/e-contact-editor.c: Made this save the changed
- data to the string version of the address.
-
-2000-10-19 Michael Meeks <michael@helixcode.com>
-
- * gui/component/addressbook.c (change_view_type): update to new
- UI handler.
- (update_view_type): split from (change_view_type).
- (control_activate): add an update_view_type.
-
-2000-10-18 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card-simple.c: Change NAME_OR_ORG to return the
- email address if both name and organization are taken.
-
- * gui/component/select-names/e-select-names.c: Fixed up the spec
- strings in this class. Removed the "cursor_mode" argument to
- ETable since it's part of the spec now.
-
-2000-10-17 Iain Holmes <iain@helixcode.com>
-
- * contact-editor/contact-editor.glade: Change the initial dialog
- visibility to FALSE
- so the contact editor doesn't flash when it appears.
-
-2000-10-16 Iain Holmes <iain@helixcode.com>
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_activate_dialog): Only allow one dialog
- per manager.
-
-2000-10-16 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/fulladdr.glade: Fixed a typo. Made this look a
- bit better.
-
-2000-10-15 Dan Winship <danw@helixcode.com>
-
- * gui/component/select-names/Makefile.am:
- * gui/component/Makefile.am: Remove CPPFLAGS since they just
- duplicate flags that were already in INCLUDES.
-
- * printing/Makefile.am (ecpsdir):
- * gui/widgets/Makefile.am:
- * contact-editor/Makefile.am: Move -D flags from CPPFLAGS to
- INCLUDES so they don't override any CPPFLAGS set at configure
- time.
-
-2000-10-14 Michael Meeks <michael@helixcode.com>
-
- * gui/component/addressbook.c (control_activate): if we are in
- LDAP mode then merge in the extra few items, otherwise just merge
- the standard thing; saves duplication.
-
-2000-10-14 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/addressbook.oafinfo: Added
- "evolution:shell-component-icon" property.
-
-2000-10-14 Iain Holmes <iain@helixcode.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_manager_activate_dialog): Only allow one dialog
- per id.
- (e_select_names_manager_destroy): Destroy the hashtable.
- (e_select_names_manager_init): Init the hashtable.
-
-2000-10-13 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/fulladdr.glade, contact-editor/fulladdr.glade.h:
- Rearranged these fields a bit more.
-
-2000-10-13 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor-categories.c,
- gui/component/select-names/e-select-names.c,
- gui/widgets/e-addressbook-view.c: Changed these for boolean
- ascending attribute instead of int ascending attribute. Fixed
- e-select-names to not use a column past the end of its array.
-
- * contact-editor/e-contact-editor-address.c,
- contact-editor/fulladdr.glade, contact-editor/fulladdr.glade.h:
- Rearranged the address editor dialog.
-
-2000-10-11 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor-categories.c: Fixed the column
- elements, the no-headers attribute and added a cursor-mode=line
- attribute.
-
- * gui/component/select-names/e-select-names.c,
- gui/widgets/e-addressbook-view.c: Fixed the column elements here.
-
-2000-10-11 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor-categories.c,
- gui/component/select-names/e-select-names.c,
- gui/widgets/e-addressbook-view.c: Updated these to the new style
- ETables.
-
-2000-10-06 Not Zed <NotZed@HelixCode.com>
-
- * gui/search/e-addressbook-search-dialog.c (get_widget): Removed
- ondemand callback nonsense from rule_context_load().
-
-2000-10-05 Michael Meeks <michael@helixcode.com>
-
- * contact-editor/e-contact-editor.c (create_ui): upd.
- (e_contact_editor_init): upd.
-
- * gui/component/addressbook.c (control_activate_cb): upd.
- (control_deactivate): kill.
- (control_activate): upd.
-
-2000-09-22 Michael Meeks <michael@helixcode.com>
-
- * gui/component/addressbook.c (control_activate): update.
-
- * contact-editor/e-contact-editor.c (create_ui): upd.
-
-Fri Sep 29 07:33:54 2000 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/widgets/e-minicard.c, gui/widgets/e-minicard.h: Made it so
- that minicard doesn't write out changes to the backend unless
- something's actually changed.
-
-Tue Sep 26 16:28:47 2000 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card.c: Make sure that card->name and
- card->full_name are always valid.
-
- * contact-editor/e-contact-editor.c: Removed some unused
- variables.
-
-2000-09-22 Matt Bissiri <bissiri@eecs.umich.edu>
-
- * contact-editor/e-contact-editor-fullname.c (extract_info): If
- (editor->name == NULL), store ptr to newly allocated ECardName in
- editor->name, not just in a stack variable. This fixes a crash
- which happened when you click "New", then click "Full Name...",
- then enter name, then click "OK".
-
- * backend/ebook/e-card.c (e_card_name_to_string): Add
- g_return_val_if_fail.
-
-2000-09-25 Jeffrey Stedfast <fejj@helixcode.com>
-
- * gui/widgets/Makefile.am:
- * gui/component/Makefile.am:
- * contact-editor/Makefile.am:
- * printing/Makefile.am: Look for ename in /e-util/ename instead of
- /addressbook/ename
-
- * backend/ebook/e-card.c: Updated to include e-util/ename/*.h
-
- * ename: Moved to /e-util so it could be shared
-
- * Makefile.am (SUBDIRS): took out ename
-
-2000-09-25 Nat Friedman <nat@helixcode.com>
-
- * ename/e-name-western-tables.h: Added a ton of new prefixes and
- suffixes.
-
-2000-09-22 Michael Meeks <michael@helixcode.com>
-
- * gui/component/addressbook.c (control_activate): update.
-
- * contact-editor/e-contact-editor.c (create_ui): upd.
-
-2000-09-22 Chris Toshok <toshok@helixcode.com>
-
- * backend/pas/pas-backend-ldap.c: lots of changes. flesh out the
- remove/modify/create functions. add another flag for the property
- table, PROP_DN, which makes it easy for us to determine when we
- need to create a new DN for a record when we're modifying. also
- add a ber_func to the table for PROP_TYPE_LIST fields, which fills
- in the list of bvalues that we send to the ldap server. The
- add/modify/delete stuff hasn't been tested yet, and it hopelessly
- complex (yay ldap).
- (ldap_search_handler): act synchronous when ldap_search responds
- with -1.
- (view_destroy): use pas_book_view_notify_status_message.
- (ldap_op_process_current): same
- (ldap_op_process): same
- (poll_ldap): same
- (ldap_search_handler): same
-
-2000-09-22 Chris Toshok <toshok@helixcode.com>
-
- * backend/ebook/e-card-simple.h: add
- E_CARD_SIMPLE_FIELD_FAMILY_NAME to the enum.
-
- * backend/ebook/e-card-simple.c (field_data): add
- E_CARD_SIMPLE_FIELD_FAMILY_NAME.
- (e_card_simple_get): add getter for FAMILY_NAME.
-
-2000-09-22 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card.c: Made addresses be quoted printable again
- so that they will encode properly if they have carriage returns in
- them. This is possible now because of a fix in libversit.
-
-2000-09-22 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-book-view-listener.c,
- backend/ebook/e-book-view-listener.h, backend/ebook/e-book-view.c,
- backend/ebook/e-book-view.h, backend/idl/addressbook.idl,
- backend/pas/pas-book-view.c, backend/pas/pas-book-view.h: Added a
- function to set the status message associated with a given view.
- This is not yet implemented in the gui.
-
-2000-09-22 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-book.c, backend/ebook/e-book.h,
- backend/idl/addressbook.idl, backend/pas/pas-backend-file.c,
- backend/pas/pas-backend-ldap.c, backend/pas-backend.c,
- backend/pas/pas-backend.h, backend/pas/pas-book.c,
- backend/pas/pas-book.h: Added a function to query static
- capabilities (capabilities that can be reported immediately) and
- implemented them in the 2 servers.
-
- * gui/component/addressbook.c: Added a View All button and a Stop
- button. Sorted out the new directory server stuff a bit.
-
- * gui/widgets/e-addressbook-model.c,
- gui/widgets/e-addressbook-model.h: Cleaned up a bit. Added a stop
- function. Check for capabilities before deciding whether to load
- all cards when initially viewed.
-
- * gui/widgets/e-addressbook-view.c,
- gui/widgets/e-addressbook-view.h: Added stop and view all
- functions.
-
- * gui/widgets/e-minicard-view-widget.c,
- gui/widgets/e-minicard-view-widget.h,
- gui/widgets/e-minicard-view.c, gui/widgets/e-minicard-view.h:
- Added a stop function. Check for capabilities before deciding
- whether to load all cards when initially viewed.
-
-2000-09-21 Michael Meeks <michael@helixcode.com>
-
- * gui/component/addressbook.c (control_activate): remove _UIHandler
-
-2000-09-21 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/load-pine-addressbook.c: Added a missing include
- of ctype.h.
-
- * backend/pas/pas-backend-file.c: Fixed a problem where using a
- GList was causing us to not be reentrant. We now use an EList
- here and so now this is reentrant. This should fix the "wombat
- crashes every time you run evolution" bug.
-
- * contact-editor/e-contact-editor.c: Fixed a type mismatch.
-
-2000-09-21 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/load-pine-addressbook.c: Make this work when a
- field is spread across multiple lines.
-
-2000-09-20 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card.c, backend/ebook/e-card.h: Added a
- wants_html field to cards. Uses "x-mozilla-html".
-
- * contact-editor/Makefile.am: Added definition of
- EVOLUTION_DATADIR.
-
- * contact-editor/contact-editor.glade: Make Wants HTML check
- button visible.
-
- * contact-editor/e-contact-editor.c,
- contact-editor/e-contact-editor.h: Make Wants HTML check button
- active. Fix UI stuff to use XML. Set parent window of
- confirm_delete dialog.
-
- * gui/widgets/e-addressbook-view.c, gui/widgets/e-minicard.c: Set
- the parent window of the confirm_delete dialog.
-
-2000-09-20 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/widgets/e-addressbook-view.c: Fixed display of the minicards
- when the addressbook was first loading. (It was overwriting a
- string with NULL during init.)
-
-2000-09-19 Dan Winship <danw@helixcode.com>
-
- * gui/search/Makefile.am (ruledir): Use $(datadir), not
- $(prefix)/share
-
-2000-09-18 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/Makefile.am, contact-editor/Makefile.am,
- ename/Makefile.am, gui/component/Makefile.am,
- gui/widgets/Makefile.am: Added $(EXTRA_GNOME_CFLAGS) and
- $(EXTRA_GNOME_LIBS). Removed unneeded libraries.
-
- * backend/ebook/e-card.c, backend/pas/pas-backend-file.c,
- contact-editor/e-contact-editor-address.c,
- contact-editor/e-contact-editor-categories.c,
- contact-editor/e-contact-editor-categories.h,
- contact-editor/e-contact-editor-fullname.c,
- contact-editor/e-contact-editor.c,
- contact-editor/e-contact-save-as.c, ename/e-address-western.c,
- ename/test-ename-western-gtk.c,
- gui/component/addressbook-factory.c, gui/component/addressbook.c,
- gui/component/e-cardlist-model.h, gui/component/e-ldap-storage.c,
- gui/component/select-names/e-select-names-bonobo.c,
- gui/component/select-names/e-select-names-manager.c,
- gui/component/select-names/e-select-names-model.c,
- gui/component/select-names/e-select-names-table-model.c,
- gui/component/select-names/e-select-names-table-model.h,
- gui/component/select-names/e-select-names-text-model.h,
- gui/component/select-names/e-select-names.c,
- gui/component/select-names/e-select-names.h,
- gui/search/e-addressbook-search-dialog.c,
- gui/widgets/e-addressbook-model.h,
- gui/widgets/e-addressbook-view.c, gui/widgets/e-minicard-label.c,
- gui/widgets/e-minicard-view-widget.c,
- gui/widgets/e-minicard-view-widget.h,
- gui/widgets/e-minicard-view.c, gui/widgets/e-minicard-view.h,
- gui/widgets/e-minicard-widget.h, gui/widgets/e-minicard.c,
- gui/widgets/test-minicard-label.c, gui/widgets/test-reflow.c,
- printing/e-contact-print.c: Fixed the #include lines to deal
- properly with gal.
-
-2000-09-15 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor.h,
- contact-editor/e-contact-save-as.h,
- gui/widgets/e-addressbook-model.h,
- gui/widgets/e-minicard-view-widget.h,
- gui/widgets/e-minicard-view.h, gui/widgets/e-minicard.c,
- gui/widgets/e-minicard.h: Fixed the paths of some .h #includes.
-
- * gui/component/addressbook.c: Removed all of the code to actually
- create and display the correct view of the addressbook and moved
- it to the new class gui/widgets/e-addressbook-view.c.
-
- * gui/widgets/Makefile.am: Added everything necessary for
- e-addressbook-view.c and e-addressbook-view.h.
-
- * gui/widgets/e-addressbook-view.c,
- gui/widgets/e-addressbook-view.h: New class to deal with actual
- display of addresses and switching between card view and table
- view.
-
- * gui/widgets/e-minicard-view-widget.c: Made this deal more
- gracefully with having the book set to NULL.
-
-2000-09-16 Michael Meeks <michael@helixcode.com>
-
- * gui/component/select-names/e-select-names.c: fix broken include.
-
- * gui/component/Makefile.am (INCLUDES): define datadir.
- (evolution_addressbook_SOURCES): remove e-addressbook-model.[ch]
-
- * gui/component/addressbook.c (control_activate): use datadir.
-
-2000-09-16 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/widgets/Makefile.am (gladedir): Define.
- (glade_DATA): Install `alphabet.glade'.
- (EXTRA_DIST): Define.
-
- * gui/component/Makefile.am (glade_DATA): Remove `alphabet.glade'.
- (EXTRA_DIST): Remove `alphabet.glade.h'.
-
- * gui/widgets/Makefile.am (libeminicard_a_SOURCES): Add
- `e-addressbook-model.c' and `e-addressbook-model.h'. I hope this
- is what Chris meant to do.
-
- * gui/component/Makefile.am (INCLUDES): Add
- `-I$(top_srcdir)/addressbook/gui/widgets'.
- (evolution_addressbook_SOURCES): Remove `e-addressbook-model.c'
- and `e-addressbook-model.h'.
-
- * gui/component/select-names/e-select-names.c: #include
- "e-addressbook-model.h" from "addressbook/gui/widgets" instead of
- "addressbook/gui/component", as it has been moved there.
-
-2000-09-15 Chris Toshok <toshok@helixcode.com>
-
- * backend/pas/pas-backend-ldap.c: split all the ldap operations
- into 2 halves, a handler, and destructor, and create a structure
- containing two function pointers and any data they need. this
- allows us queue up pending operations (since the LDAP*'s are no
- longer view specific. there's one per backend.) also, add
- support for restarting async operations if the SERVER DOWN error
- isn't communicated until sometime after the handler is called (as
- is the case with the async search stuff.)
-
-2000-09-14 Dan Winship <danw@helixcode.com>
-
- * gui/component/addressbook-factory.c (main): Call unicode_init
- for e-font stuff.
-
-2000-09-14 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/Makefile.am, gui/widgets/Makefile.am: Added
- $(GNOME_PRINT_LIBS) to all of the test files in these directories.
-
-2000-09-14 Michael Meeks <michael@helixcode.com>
-
- * gui/component/Makefile.am (evolution_addressbook_LDADD): fix path.
-
- * gui/component/addressbook.c: update include.
-
- * gui/component/addressbook-factory.c: update include.
-
- * gui/widgets/e-minicard-view.h: update include.
-
- * gui/search/e-addressbook-search-dialog.c: update include path.
-
-2000-09-13 Michael Meeks <michael@helixcode.com>
-
- * contact-editor/e-contact-editor.c (e_contact_editor_init): hack.
- (create_toolbar): ditto.
-
-2000-09-07 Michael Meeks <michael@helixcode.com>
-
- * gui/component/addressbook.c: Radicaly update UI handler code.
-
-2000-09-13 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/widgets/*, gui/minicard/*: Moved gui/minicard to
- gui/widgets, except for e-reflow.c, e-reflow.h, e-reflow-sorted.c,
- and e-reflow-sorted.h.
-
- * gui/widgets/Makefile.am: Added e-reflow to the INCLUDES list and
- libereflow.a to a bunch of LDADD lines.
-
- * gui/component/Makefile.am (evolution_addressbook_LDADD): Added
- libereflow.a here.
-
- * gui/Makefile.am (SUBDIRS): Replaced minicard with widgets.
-
-2000-09-12 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/select-names/Makefile.am: Add space after `-I'
- when invoking `orbit-idl'.
-
-2000-09-12 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/Makefile.am (EXTRA_DIST): Remove `ui.xml'.
-
-2000-09-11 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor.c: Fixed a crash error.
-
-2000-09-11 Christopher James Lahey <clahey@helixcode.com>
-
- * ename/e-address-western.c: Fixed some warnings.
-
-2000-09-11 Jesse Pavel <jpavel@helixcode.com>
-
- * ename/e-address-western.c: fixed certain address parsing
- problems.
-
-2000-09-11 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/fulladdr.glade: Made this a bit better balanced.
-
- * gui/component/addressbook.c: Make the toolbar button for find do
- the same thing that the menu item for search does.
-
- * gui/search/e-addressbook-search-dialog.c: Made the top half of
- this not expand.
-
-2000-09-11 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card-simple.c, backend/ebook/e-card-simple.h:
- Removed a bunch of redundant code. Made it so that when you set
- an address label, it sets the delivery address as well. Added
- functions to set and get the delivery address.
-
- * backend/ebook/e-card.c, backend/ebook/e-card.h: Added code to
- convert and address label to a delivery address.
-
- * contact-editor/Makefile.am: Added e-contact-editor-address.[ch],
- fulladdr.glade, fulladdr.glade.h.
-
- * contact-editor/contact-editor.glade,
- contact-editor/e-contact-editor-strings.h: Switched from a label
- to a button to show the parsed address.
-
- * contact-editor/e-contact-editor-address.c,
- contact-editor/e-contact-editor-address.h: New class to implement
- the parsed address dialog.
-
- * contact-editor/e-contact-editor-fullname.c,
- contact-editor/e-contact-editor-fullname.h: Added const to the
- _new function.
-
- * contact-editor/e-contact-editor.c: Implemented clicking on the
- address button.
-
- * contact-editor/fulladdr.glade, contact-editor/fulladdr.glade.h:
- New glade files for the parsed address dialog.
-
- * contact-editor/fullname-strings.h, fullname.glade: Changed these
- accellabels to labels.
-
- * ename/Makefile.am: Added e-address-western.c.
-
- * ename/e-address-western.c: Fixed some warnings.
-
-2000-09-10 Christopher James Lahey <clahey@helixcode.com>
-
- * ename/e-address-western.c: Added by Jesse.
-
-2000-09-08 Lauris Kaplinski <lauris@helixcode.com>
-
- * gui/minicard/e-minicard-label.c (e_minicard_label_construct):
- Use canvas default font
-
- * gui/minicard/e-minicard.c (e_minicard_realize): Ditto
- (get_left_width): Ditto
-
-2000-09-08 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor-categories.c: Fixed a few warnings.
-
-2000-09-02 Lauris kaplinski <lauris@helixcode.com>
-
- * contact-editor/e-contact-editor-categories.c: e_utf8 wrappers
-
- * contact-editor/e-contact-editor.c: e_utf8 wrappers
-
-2000-09-01 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/e-ldap-storage.c (load_ldap_data): Updated for the
- extra arg now needed by `evolution_storage_new_folder()'.
- (e_ldap_storage_add_server): Likewise.
-
-2000-08-31 Ettore Perazzoli <ettore@helixcode.com>
-
- * conduit/Makefile.am (INCLUDES): Add `BONOBO_GNOME_CFLAGS' and
- `-I$(top_srcdir)'.
-
-2000-08-31 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/Makefile.am: Install load-gnomecard-addressbook
- and load-pine-addressbook.
-
-2000-08-30 Lauris Kaplinski <lauris@helixcode.com>
-
- * printing/e-contact-print.c: Countless small changes for gnome-print 0.21+
-
-2000-08-30 Dan Winship <danw@helixcode.com>
-
- * gui/component/addressbook.oafinfo: Add a name to the minicard
- viewer.
-
-2000-08-29 Dan Winship <danw@helixcode.com>
-
- * backend/ebook/e-book.c:
- * backend/ebook/test-client.c:
- * backend/ebook/test-client-list.c:
- * backend/ebook/load-gnomecard-addressbook.c:
- * backend/ebook/load-pine-addressbook.c:
- * backend/pas/pas-book-factory.c:
- * conduit/address-conduit.h: Remove USING_OAF checks
-
-2000-08-28 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook.c: Use the right argument name to turn
- on grid lines.
-
-2000-08-26 JP Rosevear <jpr@helixcode.com>
-
- * gui/minicard/Makefile.am: Comment out minicard-view-test
- since its gnorba dependent
-
-2000-08-26 JP Rosevear <jpr@helixcode.com>
-
- * gui/component/addressbook-component.c: Remove gnorba stuff
-
- * gui/minicard/e-minicard-control.c (e_minicard_control_factory_init):
- ditto
-
- * gui/component/addressbook.c: ditto
-
- * gui/component/addressbook-factory.c: ditto
-
-2000-08-25 Christopher James Lahey <clahey@helixcode.com>
-
- * demo/* Removed the demo directory since it's no longer used.
-
-2000-08-26 JP Rosevear <jpr@helixcode.com>
-
- * gui/minicard/Makefile.am: Remove gnorba stuff
-
- * gui/minicard/e-minicard-control.gnorba: Kill
-
-2000-08-26 JP Rosevear <jpr@helixcode.com>
-
- * gui/component/addressbook.gnorba: Kill
-
- * gui/component/Makefile.am: Remove gnorba stuff
-
-2000-08-25 Dan Winship <danw@helixcode.com>
-
- * gui/component/Makefile.am (evolution_addressbook_LDFLAGS): Add
- -export-dynamic so libglade will be able to resolve custom widget
- callbacks.
-
-2000-08-23 Lauris Kaplinski <lauris@helixcode.com>
-
- * backend/pas/pas-backend-file.c (func_contains): Use e_utf8_strstrcase
-
- * contact-editor/e-contact-editor-fullname.c (fill_in_field): Use e_utf8 wrapper
- (extract_field): Same
-
- * contact-editor/e-contact-editor.c (full_name_clicked): Don't crash
-
- * ename/Makefile.am: Link demo with libeutil.la
-
- * ename/test-ename-western-gtk.c (full_changed_cb): Use e_utf8 wrapper
-
- * gui/component/addressbook.c (find_contact_cb): Use e_utf8 wrapper
- (search_entry_activated): Same
-
-2000-08-22 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/search/e-addressbook-search-dialog.c: Fix an error in the
- arguments to rule_context_load.
-
- * backend/ebook/e-card.c: Fix this to not mess up if the person
- passes a VCard with a carriage return in the mailing address.
-
-2000-08-14 Not Zed <NotZed@HelixCode.com>
-
- * gui/search/addresstypes.xml: Fixed fullname->full_name for
- search field.
-
- * gui/search/e-addressbook-search-dialog.c (get_widget): Check we
- actually got any parts to build the dialogue with.
-
-2000-08-13 Not Zed <NotZed@HelixCode.com>
-
- * gui/component/addressbook-component.c (owner_set_cb): Set the
- global_shell_client nastyhack when we know it.
- This is only required to link with the filter code ...
-
- * gui/component/Makefile.am (evolution_addressbook_LDADD): Added
- libfilter.a to the link line.
-
- * gui/search/Makefile.am (noinst_LIBRARIES): Change library name
- from libaddressbooksearchdialog to libaddressbooksearch, as used
- elsewhere.
-
- * gui/search/e-addressbook-search-dialog.c (get_widget):
- Implement.
- (get_query): Likewise.
- (e_addressbook_search_dialog_destroy): Unref filter stuff when
- done.
-
- * gui/component/addressbook.c (control_deactivate): Added chris's
- patch to put the meny in
-
-2000-08-22 Lauris Kaplinski <lauris@helixcode.com>
-
- * contact-editor/e-contact-editor.c: Use e_utf8 wrappers everywhere
-
-2000-08-22 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/e-card.h: Started adding a time zone field to ECard.
-
- * gui/component/e-addressbook-model.c: Added
- e_table_model_pre_change where appropriate.
-
- * gui/minicard/e-minicard-control.c: Added a ref and unref pair.
-
-2000-08-22 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook.c: Linked in the search dialog again.
- It looks like some changes in the shell made this not work.
-
-2000-08-19 Christopher James Lahey <clahey@helixcode.com>
-
- * conduit/address-conduit.c, conduit/address-conduit.h: Changed
- this to use ECardSimple.
-
- * contact-editor/e-contact-editor.c: Fixed a memory leak.
-
- * gui/component/addressbook.c: Added stuff to the right click
- menu. Activated the new search dialog that doesn't quite work
- yet.
-
- * gui/minicard/e-minicard-view.c: Fixed some run time warnings.
-
-2000-08-15 Larry Ewing <lewing@helixcode.com>
-
- * gui/minicard/e-minicard.c (e_minicard_event): use style colors
- for the selected state. This doesn't properly redraw the minicard
- when there is a style_change event, that is next.
- (e_minicard_realize): use style colors.
-
-2000-08-14 Peter Williams <peterw@helixcode.com>
-
- * backend/pas/pas-backend-file.c: Include the proper db1/db.h
- as in RedHat 7.0 -- patch from Kenny Graunke <kwg@teleport.com>
-
-2000-08-13 Chris Toshok <toshok@helixcode.com>
-
- * conduit/Makefile.am (libaddress_conduit_la_SOURCES): add
- address-conduit.h
-
- * Makefile.am (CONDUIT_SUBDIR): only set subdir if
- ENABLE_PILOT_CONDUITS is set.
-
-2000-08-13 Chris Toshok <toshok@helixcode.com>
-
- * Makefile.am (SUBDIRS): add conduit subdir.
-
-2000-08-13 Chris Toshok <toshok@helixcode.com>
-
- * conduit/address-conduit.c (conduit_get_gpilot_conduit): add
- special oaf initialization hack so conduit can find wombat, and
- accept all cookies so that we can actually talk to oaf.
-
-2000-08-13 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/pas/pas-backend-file.c: Fixed a typo that cause the
- wrong field to be searched.
-
- * gui/component/select-names/e-select-names.c: Made the select
- names dialog only display entries with email addresses.
-
-2000-08-12 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/contact-editor.glade: Fixed a typo in the name of
- the first phone entry.
-
-2000-08-12 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/search/Makefile.am,
- gui/search/e-addressbook-search-dialog.c,
- gui/search/e-addressbook-search-dialog.h: A few small interface
- fixes.
-
- * gui/component/Makefile.am: Link in the addressbook search
- dialog.
-
-2000-08-12 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/Makefile.am: Added the search directory.
-
- * backend/ebook/e-book.c: Fixed a potential crash.
-
- * gui/minicard/e-reflow-sorted.h: Fixed an include line.
-
- * gui/search/.cvsignore, gui/search/Makefile.am: New files.
-
- * gui/search/e-addressbook-search-dialog.c: Fixed compilation.
-
-2000-08-12 Christopher James Lahey <clahey@helixcode.com>
-
- * printing/Makefile.am: Ettore fixed compilation.
-
-2000-08-12 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/.cvsignore: Added load-gnomecard-addressbook.
-
-2000-08-12 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/search/e-addressbook-search-dialog.c,
- gui/search/e-addressbook-search-dialog.h: Made this into a Gtk
- object.
-
-2000-08-12 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/pas/pas-book-view.c: Ref our book view listener.
-
- * gui/component/addressbook.c: Updated to use new minicard view
- widget.
-
- * gui/minicard/Makefile.am: Added e-minicard-view-widget.c and
- e-minicard-view-widget.h.
-
- * gui/minicard/e-minicard-view-widget.c,
- gui/minicard/e-minicard-view-widget.h: New class that's just a
- minicard view in an ECanvas.
-
- * gui/search/e-addressbook-search-dialog.c: New file for
- implementing a search dialog.
-
-2000-08-11 Chris Toshok <toshok@helixcode.com>
-
- * conduit/address-conduit.c (transmit): implement code to encode
- the first email address and send to the pilot.
- (get_phone_label_by_flag): rename find_phone_label_for_flags to
- this, and implement by calling get_phone_label_by_name.
-
-2000-08-11 Chris Toshok <toshok@helixcode.com>
-
- * conduit/address-conduit.c (ecard_from_remote_record): add code
- for handling email addresses from pilot (which stores it as a
- phone number entry. go figure.)
- (check_for_slow_setting): #if 0 out, since we don't use it (yet).
- (update_record): un #if 0 the code to handle the case where the
- pilot info has changed for a local record.
- (merge_ecard_with_remote_record): implement function, but for now
- just return the existing (desktop) record - we still don't allow
- merge from the pilot.
-
-
-2000-08-10 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/search/addresstypes.xml: Changed a couple of input field
- names.
-
-2000-08-10 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/addressbook-component.c: Remove prototype for
- `setup_ldap_storage()', which shouldn't be here anyway.
-
-2000-08-10 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/search/, gui/search/addresstypes.xml: New search dialog for
- addressbook.
-
-2000-08-10 Dan Winship <danw@helixcode.com>
-
- * gui/component/addressbook-component.c (owner_set_cb): Update for
- changed prototype, pass evolution_homedir arg to
- setup_ldap_storage.
-
- * gui/component/e-ldap-storage.c (setup_ldap_storage): Now takes
- an evolution_homedir arg, uses that to generate the path to the
- ldapservers.xml file, and stores the result in a static variable.
- (e_ldap_storage_add_server, e_ldap_storage_remove_server): Use that
- static variable rather than hardcoding the path to the file.
-
-2000-08-10 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/pas/pas-backend-file.c: Fixed any search to not crash on
- missing phone numbers or email addresses.
-
-2000-08-09 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/minicard/e-minicard-control.c: Added a button to save to
- your addressbook.
-
-2000-08-09 Cody Russell <bratsche@gnome.org>
-
- * gui/component/addressbook.c: Make the toolbar honor the user's
- gnomecc settings for detachable toolbars.
-
-2000-08-09 Nat Friedman <nat@helixcode.com>
-
- * ename/e-name-western-tables.h: Added some military prefixes.
-
-2000-08-09 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook.c: Fixed a warning.
-
-2000-08-09 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/addressbook.c (control_activate): Add the stock
- print icon to the print item.
-
-2000-08-09 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/addressbook.c (control_activate): Put the print
- item in the right placeholder so that it gets the right position
- in the "File" menu.
- (control_deactivate): Updated accordingly.
-
-2000-08-09 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook.c, gui/minicard/e-minicard.c: Changed
- e_popup_menu_run call to match the new arguments.
-
- * gui/component/addressbook.oafinfo: Fixed this file to work
- properly.
-
- * gui/minicard/e-minicard-control.c: Use the correct oafinfo ID
- here. Also cleaned up the code a bit with the help of Michael
- Meeks.
-
-2000-08-08 Chris Toshok <toshok@helixcode.com>
-
- * gui/component/e-addressbook-model.c (e_addressbook_model_init):
- use x-evolution-any-field.
-
- * gui/component/addressbook.c (search_entry_activated): use
- x-evolution-any-field.
- (change_view_type): same.
-
- * gui/minicard/e-minicard-view.c (e_minicard_view_init): set query
- to x-evolution-any-field.
-
- * backend/pas/pas-backend-ldap.c (func_contains): support
- x-evolution-any-field for matching any evolution supported field.
-
- * backend/pas/pas-backend-file.c (compare_email): switch to using
- ECardSimple calls.
- (compare_phone): same.
- (compare_address): same.
- (entry_compare): switch to using ECardSimple calls, and support a
- 'x-evolution-any-field' wildcard field.
- (vcard_matches_search): use an ECardSimple.
-
-2000-08-07 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor.c: Removed the next and prev
- toolbar buttons since they don't do anything.
-
-2000-08-07 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/contact-editor.glade,
- contact-editor/e-contact-editor.c: Fixed the tab order to not
- repeat the web page address field.
-
-2000-08-07 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor.c: Fixed the tab order for this
- dialog.
-
-2000-08-05 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card-simple.c: Fixed a warning.
-
- * backend/ebook/e-card.c: Cast to (char *) in
- e_card_load_cards_from_file since libversit isn't const correct.
-
- * backend/pas/pas-backend-file.c: Fixed a warning.
-
-2000-08-04 Michael Meeks <michael@helixcode.com>
-
- * gui/component/addressbook.c (control_activate): unref.
-
- * demo/addressbook.c (control_activate): unref.
-
-2000-08-02 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor-categories.c,
- gui/component/e-addressbook-model.c: Emit "model_pre_change"
- signal as appropriate.
-
-2000-08-02 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/e-addressbook-model.c: Adapted this to supply the
- new append_row API of ETableModel.
-
-2000-07-31 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook.c: Changed the default set of columns.
-
-2000-07-29 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/Makefile.am: Added load-gnomecard-addressbook
- compilation.
-
- * backend/ebook/e-card.c, backend/ebook/e-card.h: Added
- e_card_load_cards_from_file helper function to load multiple cards
- from a single file.
-
- * backend/ebook/load-gnomecard-addressbook.c: New file to load
- vcard files. I think this is the format that gnomecard uses so if
- you copy your gnomecard file to gnomecard.vcf and then run this
- program in the same directory, it'll copy all your gnome contacts
- into evolution. It needs to be changed to take a filename as a
- parameter. Some fields (phone and address information, for
- example) aren't displayed properly, but are saved. This is new
- code, so some other than phone and address may be lost.
-
-2000-07-28 Ettore Perazzoli <ettore@helixcode.com>
-
- * backend/pas/Makefile.am: Add `pas-backend-ldap.c' and
- `pas-backend-ldap.h' to `EXTRA_DIST' so they get distributed even
- if the OpenLDAP support is not enabled.
-
-2000-07-27 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/load-pine-addressbook.c: Changed the URI to load
- to.
-
-2000-07-26 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/minicard/e-minicard-widget-test.c: Fixed a warning.
-
-2000-07-26 Chris Toshok <toshok@helixcode.com>
-
- * backend/pas/pas-backend-ldap.c (view_destroy): wait to free the
- view until we've taken care of freeing its internals. also, close
- the ldap connection here.
- (pas_backend_ldap_connect): rename p_b_l_ensure_connected to this,
- since it's always called when we create a view.
- (pas_backend_ldap_build_all_cards_list): open an ldap connection
- in this function and close it at the end.
- (poll_ldap): make sure to call ldap_unbind to close the view's
- connection here.
- (pas_backend_ldap_search): call pas_backend_ldap_connect here -
- ldap_unbind will either be called from poll_ldap or from
- view_destroy.
- (pas_backend_ldap_get_vcard): the PASBackendLDAP no longer has an
- LDAP*.
-
-2000-07-26 Chris Toshok <toshok@helixcode.com>
-
- * backend/pas/pas-backend-ldap.c
- (pas_backend_ldap_build_all_cards_list): add support for user settable scope.
- (pas_backend_ldap_search): same.
- (pas_backend_ldap_load_uri): same.
-
-2000-07-26 Dan Winship <danw@helixcode.com>
-
- * gui/component/addressbook.oafinfo: lowercasify the
- supported_mime_types
-
-2000-07-25 Chris Toshok <toshok@helixcode.com>
-
- * backend/ebook/e-card-types.h: add enum for e-card pilot status.
-
- * conduit/address-conduit.c: #ifdef out all the archiving code with SUPPORT_ARCHIVING.
- (purge): implement correctly - deleting ecards whose pilot status is DELETED.
- (set_status): implement.
- (set_pilot_id): add gtk_main call here to change commit_card into a synchronous
- (delete_all): implement correctly - don't delete the records, just set their status to DELETED.
- (local_record_from_ecard): get the current status from the ecard.
-
- * backend/ebook/e-card.c (e_card_get_vcard): add vcard support for pilot status.
- (parse_pilot_status): new function.
- (e_card_class_init): add pilot status object arg.
- (e_card_set_arg): add pilot status support.
- (e_card_get_arg): same.
- (e_card_init): initialize pilot_status to 0.
-
-2000-07-25 Chris Toshok <toshok@helixcode.com>
-
- * conduit/address-conduit.c: add comment headers to signals that
- didn't have any.
-
-2000-07-25 Chris Toshok <toshok@helixcode.com>
-
- * conduit/address-conduit.c (start_address_server): use the user's
- Contact db. not toshok's.
-
-2000-07-25 Michael Meeks <michael@helixcode.com>
-
- * backend/ebook/load-pine-addressbook.c (book_open_cb): check we
- opened ok.
-
-2000-07-25 Seth Alves <alves@hungry.com>
-
- * ename/Makefile.am (libename_static_la_LDFLAGS): build static
- version of the library for address conduit to use
-
- * backend/ebook/Makefile.am: build a static version of the library
- to link into the conduit
-
-2000-07-25 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card.c: Added a #define for
- "X-EVOLUTION-PILOTID". Added a parse_pilot_id to read pilot id's
- in properly from VCards. Rearranged some field orders. Added a
- get_arg case for ARG_PILOTID. Initialize pilot_id field to 0.
-
-2000-07-24 Chris Toshok <toshok@helixcode.com>
-
- * backend/ebook/e-card.h: add pilot_id.
-
- * backend/ebook/e-card.c (e_card_get_vcard): add support for
- X-EVOLUTION-PILOTD vcard field.
- (e_card_class_init): add pilot_id arg.
- (e_card_set_arg): handle pilot_id arg.
-
-2000-07-23 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-book-view-listener.c: Remove the idle handler
- when we're destroyed.
-
- * printing/e-contact-print.c: Fixed the spacing on the card
- header.
-
-2000-07-20 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook.oafinfo: Fixed the oaf info.
-
- * gui/minicard/.cvsignore, gui/minicard/Makefile.am,
- gui/minicard/e-minicard-widget-test.c: Added a test for the
- minicard widget.
-
- * gui/minicard/e-minicard-control.c: Fixed the mime type.
-
- * gui/minicard/e-minicard.c: Fixed some crashes if your parent
- isn't a minicard view.
-
- * gui/minicard/e-minicard-control.oafinfo: Removed.
-
-2000-07-20 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/addressbook-component.c (factory_fn): Update for
- the new `evolution_shell_component_new()'.
-
-2000-07-19 Fatih Demir <kabalak@gmx.net>
-
- * conduit/address-conduit-control-applet.desktop:
- Added the Turkish desktop entry.
-
-2000-07-18 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/minicard/e-minicard-control.c: Added "text/vCard" to the
- list of mime types we support.
-
-2000-07-18 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/minicard/Makefile.am: Added
- gui/minicard/e-minicard-control.c,
- gui/minicard/e-minicard-control.h,
- gui/minicard/e-minicard-widget.c, and
- gui/minicard/e-minicard-widget.h.
-
- * gui/minicard/e-minicard-control.c,
- gui/minicard/e-minicard-control.h,
- gui/minicard/e-minicard-widget.c,
- gui/minicard/e-minicard-widget.h: Got these to compile.
-
- * gui/minicard/e-minicard-control.gnorba,
- gui/minicard/e-minicard-control.oafinfo: Copied directly from
- bonobo-clock-control. These aren't done yet.
-
-2000-07-18 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/minicard/e-minicard-control.c,
- gui/minicard/e-minicard-control.h,
- gui/minicard/e-minicard-widget.c,
- gui/minicard/e-minicard-widget.h: New files for using a minicard
- as a widget or a bonobo control.
-
-2000-07-14 Chris Toshok <toshok@helixcode.com>
-
- * gui/component/e-ldap-storage.c (ldap_server_foreach): duh.
- don't save the port in the host slot either.
-
-2000-07-13 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor-confirm-delete.glade,
- contact-editor/e-contact-editor-confirm-delete.glade.h: Added
- these.
-
-2000-07-13 Christopher James Lahey <clahey@helixcode.com>
-
- * Makefile.am: Switched the order of compilation of printing and
- contact-editor.
-
- * contact-editor/Makefile.am: Added printing libraries and a
- confirm delete dialog glade file.
-
- * contact-editor/e-contact-editor.c,
- contact-editor/e-contact-editor.h: Enabled the delete and print
- functions as well as providing a confirm delete dialog to the
- outside world.
-
- * gui/component/addressbook.c: Made the delete button on new cards
- active.
-
- * gui/minicard/Makefile.am: Added printing libraries to a number
- of test programs.
-
- * gui/minicard/e-minicard.c: Added print and delete to the right
- click menu. Made the delete button on the card editor active.
-
- * printing/e-contact-print.c, printing/e-contact-print.h: Added a
- function to print a single card.
-
-2000-07-12 Chris Toshok <toshok@helixcode.com>
-
- * gui/component/e-ldap-storage.c (ldap_server_foreach): oops. fix
- typo that was saving the port in the rootdn spot.
- (save_ldap_data): make this a bit safer - writing to a new file
- and renaming it.
- (load_ldap_data): make this a bit smarter - if parsing the
- ldapservers.xml file fails and there's a .new file there,
- rename it.
-
-2000-07-12 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/pas/pas-backend-file.c: Do case insensitive compares.
-
- * addressbook/gui/component/addressbook.c: Make quick search
- search both name and company name.
-
-2000-07-12 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor.c: Add icons to the toolbars.
-
-2000-07-12 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/Makefile.am: Added installation of arrow.png.
-
- * contact-editor/e-contact-editor.c: Use EVOLUTIONDIR #define.
-
-2000-07-11 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook.c: Removed an unused function
-
-2000-07-10 Dan Winship <danw@helixcode.com>
-
- * gui/component/select-names/Makefile.am (EXTRA_DIST): add idl
- file to EXTRA_DIST
-
-2000-07-10 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/addressbook.c (control_activate): Remove the
- SelectNames test.
-
-2000-07-10 Peter Williams <peterw@curious-george.helixcode.com>
-
- * gui/component/select-names/e-select-names-model.c: (Clahey's fix)
- Make multiple addresses be concatenated correctly.
-
-2000-07-09 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook.c,
- gui/component/select-names/e-select-names.c,
- gui/component/select-names/e-select-names.h: Switched from ETable
- to ETableScrolled.
-
- * addressbook/gui/minicard/e-minicard.c: Don't display mailer or
- "name or org" fields.
-
-2000-07-09 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card-simple.c, backend/ebook/e-card-simple.h:
- Added a field that gives the name if it exists and the company
- name otherwise.
-
- * gui/component/e-addressbook-model.c: Formatting changes.
-
- * gui/component/select-names/e-select-names-table-model.c: Added
- stripping of names and display of company name if name doesn't
- exist.
-
- * gui/component/select-names/e-select-names.c: Fixed up the
- display so that we display both name and email address.
-
-2000-07-09 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/select-names/e-select-names-model.c: Fixed a small
- off by one error that was causing an extra character to get
- deleted sometimes.
-
-2000-07-09 Anders Carlsson <andersca@gnu.org>
-
- * gui/minicard/test-reflow.c (allocate_callback): Fix off by one bug with
- scroll region setting.
- (resize): Likewise.
- (main): Put the contacts list in an EScrolledFrame instead of using a
- separate GtkScrollbar.
-
- * gui/minicard/e-reflow.c (e_reflow_event): Don't change mouse cursor and
- don't allow drags on dividers that aren't visible.
-
- * gui/component/addressbook.c (allocate_callback): Fix off by one bug with
- scroll region setting.
- (resize): Likewise.
- (create_minicard_view): Put the contacts list in an EScrolledFrame instead of
- using a separate GtkScrollbar.
-
-2000-07-09 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook.c: Removed unused do_nothing_cb
- function.
-
- * gui/component/select-names/e-select-names-manager.c,
- gui/component/select-names/e-select-names-manager.h: Made the OK
- and Cancel buttons in the ESelectNames dialog we create work
- properly.
-
- * gui/component/select-names/e-select-names-model.c,
- gui/component/select-names/e-select-names-model.h: Added
- e_select_names_model_duplicate.
-
- * gui/component/select-names/e-select-names-text-model.c: Made the
- text be set correctly if there's already data in the source when
- the text model is created.
-
- * gui/component/select-names/e-select-names.c,
- gui/component/select-names/e-select-names.h: Removed handling of
- the buttons (the user of this dialog will have to handle them.)
- Added e_select_names_get_source. Fixed some typos.
-
-2000-07-09 Not Zed <NotZed@HelixCode.com>
-
- * gui/component/addressbook.c: Link the toolbar print button to
- the print callback.
-
-2000-07-08 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_clicked): Hitting OK or Cancel at least closes the
- dialog now.
-
-2000-07-08 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_create_entry): Set the returned entry to
- use the ellipsis.
-
-2000-07-08 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook-factory.c: Include
- e-select-names-factory.h.
-
- * gui/component/select-names/e-select-names-model.c: Handle a NULL
- iterator properly in the replace function.
-
- * gui/component/select-names/e-select-names-table-model.c: Fill in
- info properly in the value_at function.
-
- * gui/component/select-names/e-select-names-text-model.c: Don't
- strlen a NULL text object.
-
- * gui/component/select-names/e-select-names.c: Close if the person
- hits ok or cancel (doesn't yet actually undo changes if Cancel is
- hit.) Handle removing addresses when they're double clicked on.
-
- * gui/component/select-names/select-names.glade,
- gui/component/select-names/select-names.glade.h: Hid some unused
- fields and changed the text at the top of the dialog.
-
-2000-07-08 Jeffrey Stedfast <fejj@helixcode.com>
-
- * gui/component/select-names/.cvsignore: Ignore dynamically
- created source files
-
-2000-07-08 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/select-names/e-select-names-bonobo.c
- (entry_get_property_fn): New function to set the properties.
-
-2000-07-08 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/addressbook-factory.c (main): Start up the factory
- for `Evolution::Addressbook::SelectNames'.
-
- * gui/component/select-names/evolution-addressbook-select-names.oafinfo:
- New.
-
- * gui/component/select-names/e-select-names-factory.c: New.
- * gui/component/select-names/e-select-names-factory.h: New.
-
- * gui/component/select-names/e-select-names-bonobo.c: New.
- * gui/component/select-names/e-select-names-bonobo.h: New.
-
- * gui/component/addressbook-factory.c (main): Call
- `e_select_names_factory_init()'.
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_add_section): Made const-aware.
- (e_select_names_manager_create_entry): Made const-aware.
- (e_select_names_manager_activate_dialog): Made const-aware.
-
- * gui/component/select-names/Evolution-Addressbook-SelectNames.idl:
- New.
-
-2000-07-08 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/e-addressbook-model.c,
- gui/component/e-addressbook-model.h: Added an "editable" argument.
-
- * gui/component/select-names/e-select-names.c: Set our
- EAddressModel to not be editable.
-
-2000-07-07 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/select-names/e-select-names.c: Changed to line
- mode.
-
-2000-07-07 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/select-names/e-select-names-manager.c,
- gui/component/select-names/e-select-names-model.c: Implemented the
- get_cards function.
-
- * gui/component/select-names/e-select-names.c: Implemented adding
- cards through the interface.
-
-2000-07-07 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/select-names/e-select-names-manager.c: Make the
- entry widgets we create editable.
-
- * gui/component/select-names/e-select-names-model.c: Use
- e_strsplit instead of g_strsplit. Fixed an off by 1 error.
-
- * gui/component/select-names/e-select-names-table-model.c: When
- the model changes, send a model changed signal.
-
- * gui/component/select-names/e-select-names-text-model.c: Made
- changing this work correctly if it's empty. Made change signals
- propagate properly. Is a bit better about freeing iterators when
- done.
-
- * gui/component/select-names/e-select-names.c: Made the finished
- lists be in order instead of being sorted.
-
-2000-07-07 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook.c (new_server_cb): Since
- ELDAPServer->port is a char *, allocate a string with the number
- 389 contained.
-
- * gui/component/addressbook.c: Make the select names test test the
- new code instead of the old way of getting to an ESelectNames
- dialog.
-
- * gui/component/select-names/e-select-names-manager.c: Coded
- storing the model for each section, creating an entry and
- returning it, and for activating the dialog. Wrote a bit of the
- get_cards code, but not all of it.
-
- * gui/component/select-names/e-select-names-model.c,
- gui/component/select-names/e-select-names-model.h: Coded all of
- the code needed to make ESelectNamesTextModel work (it doesn't
- yet, but all the code should be there.) Removed
- E_SELECT_NAMES_MODEL_DATA_TYPE_SEPARATION_MATERIAL.
-
- * gui/component/select-names/e-select-names-table-model.c,
- gui/component/select-names/e-select-names-text-model.c: Changed
- these to compensate for removal of
- E_SELECT_NAMES_MODEL_DATA_TYPE_SEPARATION_MATERIAL.
-
- * gui/component/select-names/e-select-names-table-model.h,
- gui/component/select-names/e-select-names-text-model.h: Fixed some
- silly typos.
-
- * gui/component/select-names/e-select-names.c,
- gui/component/select-names/e-select-names.h: Added a parameter to
- add_section that lets you specify the source ESelectNamesModel.
-
-2000-07-06 Chris Toshok <toshok@helixcode.com>
-
- * gui/component/e-ldap-storage.h: add scope to ELDAPServer, and
- make port a string.
-
- * gui/component/e-ldap-storage.c (load_ldap_data): don't load a
- uri, load all the bits and pieces and build up the uri when
- creating the folder, according to the openldap url format.
- (ldap_server_foreach): store out each of the individual uri
- pieces.
- (e_ldap_storage_remove_server): free the new fields.
- (get_string_value): if the text is empty, return the empty string
- instead of NULL.
-
- * gui/component/e-ldap-server-dialog.c (extract_server_info): port is a string now.
- (fill_in_server_info): port is a string now.
-
-2000-07-06 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor.c: Changed "FIXME: Save and
- Close" to "Save and Close". Removed some toolbar items that will
- never be used.
-
- * gui/component/select-names/e-select-names-model.c,
- gui/component/select-names/e-select-names-model.h: Added functions
- to allow you to modify the model (not implemented yet.)
-
- * gui/component/select-names/e-select-names-table-model.c,
- gui/component/select-names/e-select-names-table-model.h: Finished
- this. Doesn't support changing the model at all.
-
- * gui/component/select-names/e-select-names-text-model.c: Finished
- this. Changing the model by typing is done, but doesn't work
- since none of the functions in the base model are implemented.
-
-2000-07-05 Chris Toshok <toshok@helixcode.com>
-
- * gui/component/addressbook.c (new_server_cb): call
- e_ldap_storage_add_server call.
-
- * gui/component/ldap-server-dialog.glade: add name row.
-
- * gui/component/e-ldap-server-dialog.h: remove the ELDAPServer type.
-
- * gui/component/e-ldap-server-dialog.c (extract_server_info): add
- support for the name-entry.
-
- * gui/component/e-ldap-server-dialog.c (fill_in_server_info): same.
-
- * gui/component/e-ldap-storage.h: add ELDAPServer type, and add
- prototypes for e_ldap_storage_add_server and
- e_ldap_storage_remove_server.
-
- * gui/component/e-ldap-storage.c (e_ldap_storage_add_server): new
- function, add it to our hash table, add a shell folder, and save
- out the metadata.
- (ldap_server_foreach): add the ldap server info under a
- "contactserver" node.
- (setup_ldap_storage): create our hashtable.
-
-2000-07-05 Chris Toshok <toshok@helixcode.com>
-
- * gui/component/addressbook.c (set_prop): remove hack to read
- "uri" file from local directory.
-
- * gui/component/Makefile.am (evolution_addressbook_SOURCES): add
- e-ldap-storage.{c,h}
-
- * gui/component/addressbook-component.c (owner_set_cb): call
- setup_ldap_storage.
-
- * gui/component/e-ldap-storage.c (setup_ldap_storage): Register
- the LDAP storage and load the .xml file.
- (load_ldap_data): function to load our xml file.
- (save_ldap_data): function to save our xml file.
-
- * gui/component/e-ldap-storage.h: new file.
-
-2000-07-03 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/select-names/e-select-names-manager.c,
- gui/component/select-names/e-select-names-text-model.c,
- gui/component/select-names/e-select-names.c: Fixed more compile
- errors.
-
-2000-07-03 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/select-names/Makefile.am: Fixed compile error.
-
-2000-07-03 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/Makefile.am: Removed e-card-iterator.c,
- e-card-iterator.h, e-card-list-iterator.c, e-card-list-iterator.h,
- e-card-list.c, e-card-list.h.
-
- * backend/ebook/e-card-iterator.c,
- backend/ebook/e-card-iterator.h,
- backend/ebook/e-card-list-iterator.c,
- backend/ebook/e-card-list-iterator.h, backend/ebook/e-card-list.c,
- backend/ebook/e-card-list.h: Removed in favor or versions without
- the -card in the e-util directory since these classes are not
- specific to cards at all.
-
- * backend/ebook/e-card-simple.c, backend/ebook/e-card-simple.h,
- backend/ebook/e-card.c, backend/ebook/e-card.h,
- backend/ebook/load-pine-addressbook.c, backend/ebook/test-card.c,
- backend/pas/pas-backend-file.c: Changed the references to
- e-card-list.c and friends to e-list.c and friends.
-
- * contact-editor/e-contact-editor.c: Added #include
- <e-contact-save-as.h> to fix a warning.
-
- * gui/component/Makefile.am: Moved a number of classes associated
- with the select-names object to the new select-names directory.
-
- * gui/component/addressbook.c: Changed the reference to
- e-select-names.h.
-
- * gui/component/e-select-names.c, gui/component/e-select-names.h,
- gui/component/select-names.glade,
- gui/component/select-names.glade.h: Moved these files into
- select-names/.
-
- * gui/component/select-names/.cvsignore,
- gui/component/select-names/Makefile.am,
- gui/component/select-names/e-select-names-manager.c,
- gui/component/select-names/e-select-names-manager.h,
- gui/component/select-names/e-select-names-model.c,
- gui/component/select-names/e-select-names-model.h,
- gui/component/select-names/e-select-names-table-model.c,
- gui/component/select-names/e-select-names-table-model.h,
- gui/component/select-names/e-select-names-text-model.c,
- gui/component/select-names/e-select-names-text-model.h,
- gui/component/select-names/e-select-names.c,
- gui/component/select-names/e-select-names.h,
- gui/component/select-names/recipient.glade,
- gui/component/select-names/select-names.glade,
- gui/component/select-names/select-names.glade.h: New files for
- select names dialog (e-select-names.c, e-select-names.h,
- select-names.glade, select-names.glade.h and recipient.glade moved
- from gui/component/.)
-
-2000-06-29 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/addressbook-component.c (owner_set_cb): Get an
- EvolutionShellClient instead of an Evolution_Shell to match the
- changes in libeshell.
-
-2000-06-28 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/select-names/,
- gui/component/select-names/e-select-names-manager.c,
- gui/component/select-names/e-select-names-manager.h: New select
- names manager interface (Not complete.)
-
-2000-06-26 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor-categories.c,
- addressbook/gui/component/e-cardlist-model.c: Added
- value_to_string handlers.
-
- * demo/addressbook-widget.c, demo/demo.c: Removed usage of "x" and
- "y" arguments.
-
- * addressbook/gui/component/addressbook.c: Activated Click To Add
- and set the click to add message.
-
- * addressbook/gui/component/e-addressbook-model.c: Added
- value_to_string and append_row handlers.
-
- * addressbook/gui/component/e-select-names.c: Added a column.
-
-2000-06-26 Chris Toshok <toshok@helixcode.com>
-
- * backend/pas/pas-backend-ldap.c (poll_ldap): remove spew.
- (pas_backend_ldap_ensure_connected): duh, don't access a pointer
- we know to be NULL.
- (query_prop_to_ldap): rename map_e_card_prop_to_ldap to this.
- easier to type.
-
-2000-06-21 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/minicard/test-minicard-label.c,
- gui/minicard/test-minicard.c, gui/minicard/test-reflow.c: Remove
- usage of "x" and "y" arguments.
-
-2000-06-18 <ettore@helixcode.com>
-
- * contact-editor/Makefile.am (INCLUDES): Use
- `$(BONOBO_GNOME_CFLAGS)' so that we compile when Bonobo is not in
- the default GNOME prefix.
-
-2000-06-17 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/minicard/e-minicard-label.c,
- gui/minicard/e-minicard-label.h, gui/minicard/e-minicard.c: Made
- the left column of minicards not get any wider than the widest
- possible name.
-
-2000-06-13 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/Makefile.am (SHELL_OBJS): Removed.
- (evolution_addressbook_LDADD): Link with
- `$(top_builddir)/shell/libeshell.a'.
-
-2000-06-12 Federico Mena Quintero <federico@helixcode.com>
-
- * contact-editor/e-contact-editor-categories.c: Removed the
- ETableModel thaw handler.
- * gui/component/e-cardlist-model.c: Likewise.
-
-2000-06-11 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/e-select-names.c: Fixed the widget reparenting.
-
-2000-06-11 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/Makefile.am: Added glade files.
-
- * gui/component/addressbook.c: Added a test of the Select Names
- functionality.
-
- * gui/component/e-addressbook-model.c: Made this class_init
- function a bit cleaner.
-
- * gui/component/e-select-names.c: Tested this and fixed some
- obvious errors.
-
- * gui/component/select-names.glade: The main window shouldn't be
- visible by default.
-
-2000-06-11 Ettore Perazzoli <ettore@helixcode.com>
-
- * contact-editor/Makefile.am (contact_editor_test_LDADD): Link
- with libemiscwidgets.a.
- * gui/component/Makefile.am (evolution_addressbook_LDADD): Likewise.
- * gui/minicard/Makefile.am (minicard_test_LDADD): Likewise.
- (reflow_test_LDADD): Likewise.
- (minicard_view_test_LDADD): Likewise.
-
-2000-06-10 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/e-cardlist-model.c: Renamed a bunch of functions
- for better readability.
-
- * gui/component/e-select-names.c, gui/component/e-select-names.h:
- This should be a working dialog now.
-
- * gui/component/select-names.glade: Changed the name & creation
- function of the ETable here.
-
-2000-06-10 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/select-names.glade,
- gui/component/select-names.glade.h: Glade files for Select Names
- dialog.
-
-2000-06-10 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor.c: Do e_card_simple_sync and
- extract_info more often.
-
- * gui/component/addressbook.c: Added table printing code.
-
-2000-06-09 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/addressbook-component.c (factory_fn): Pass NULL
- for the new args @create_folder_fn and @remove_folder_fn.
-
-2000-06-08 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/addressbook-component.c (create_view): Updated for
- the new `EvolutionShellComponentCreateViewFn'. Return
- `EVOLUTION_SHELL_COMPONENT_UNSUPPORTEDTYPE' if @type is not
- "contacts".
-
-2000-06-08 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor.c: Bind Save As to save the
- current view of the contact as a vcard.
-
-2000-06-08 Federico Mena Quintero <federico@helixcode.com>
-
- * contact-editor/e-contact-editor.c (save_card): Doh, sync the
- card simple and extract the card info.
-
-2000-06-08 Federico Mena Quintero <federico@helixcode.com>
-
- * contact-editor/e-contact-editor.h (EContactEditor): Now this
- derives from GtkObject. It follows the same strategy as the
- EventEditor in the calendar.
- (EContactEditor): Added an is_new_card field so that we can know
- whether to add() or commit() the card.
-
- * contact-editor/e-contact-editor.c (e_contact_editor_get_type):
- Derive from GtkObject.
- (e_contact_editor_class_init): Likewise.
- (e_contact_editor_class_init): Added an "is_new_card" argument.
- (e_contact_editor_set_arg): Handle ARG_IS_NEW_CARD.
- (e_contact_editor_get_arg): Likewise.
- (e_contact_editor_new): Take in an is_new_arg argument and set it
- on the object.
- (e_contact_editor_init): Load the app widget into the app field of
- the EContactEditor structure. Create its UIHandler as well.
- (e_contact_editor_class_init): New "add_card", "commit_card", and
- "editor_closed" signals.
-
- * contact-editor/test-editor.c (main): Modified for the new API.
- (editor_closed_cb): Tweaked for the new API.
- Since this test program does not use Bonobo, it doesn't work,
- though.
-
- * gui/component/addressbook.c (new_contact_cb): Use the new
- contact editor API.
- (table_double_click): Ditto.
-
- * gui/minicard/e-minicard-view.c (e_minicard_view_event): Use the
- new contact editor API.
-
- * gui/minicard/e-minicard.c (e_minicard_event): Use the new
- contact editor API.
-
-2000-06-08 Ettore Perazzoli <ettore@helixcode.com>
-
- * contact-editor/Makefile.am (contact_editor_test_LDADD): Remove
- the `$(srcdir)/' prefix from `libecontacteditor.a' because [of
- course] the library is built in the build directory, not in the
- source directory.
- * gui/minicard/Makefile.am (minicard_test_LDADD): Likewise with
- `libeminicard.a'.
- (minicard_label_test_LDADD): Likewise.
- (reflow_test_LDADD): Likewise.
- (minicard_view_test_LDADD): Likewise.
-
-2000-06-06 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook.c: Bind right click on the ETable to
- "Save to VCard."
-
-2000-06-02 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor.c: Made phone/email/address
- labels change correctly again.
-
-2000-06-02 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook-component.c: Made
- evolution-addressbook shut down when the shell is done with it.
-
-2000-06-02 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/minicard/e-minicard-view.c, gui/minicard/e-minicard.c: Made
- double click only work on the first button.
-
-2000-06-01 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/minicard/e-minicard.c: return TRUE if opening a contact
- editor so that we don't get a "new dialog" contact editor.
-
-2000-06-01 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/addressbook.c (new_contact_cb): Use the stock
- cancel button for the dialog.
- (table_double_click): Likewise.
- (find_contact_cb): Likewise.
-
-2000-05-31 Miguel de Icaza <miguel@helixcode.com>
-
- * contact-editor/contact-editor.glade: Added accelerators for
- the remaining items.
-
- Add spacing, beautify the dialogs.
-
-2000-06-01 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/addressbook.c (control_activate): Put the toolbar
- into a frame to make it look like standard GNOME toolbars. Also,
- set `GNOME_DOCK_ITEM_BEH_NEVER_VERTICAL' so that it does not do
- evil things when its moved to the left or the right of the window.
-
-2000-05-30 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/e-cardlist-model.c,
- gui/component/e-cardlist-model.h: New files for card list.
-
-2000-05-30 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook.c: Fixed a memory leak.
-
-2000-05-30 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/alphabet.glade: Made the alphabet buttons not
- focusable.
-
- * gui/minicard/e-minicard-view.c: Made the "123" button work.
-
- * gui/minicard/e-reflow-sorted.c: Made all buttons past the last
- letter available work.
-
-2000-05-30 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/alphabet.glade: Added a bit of space around the
- alphabet bar.
-
-2000-05-30 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/Makefile.am: Added alphabet.glade and
- alphabet.glade.h.
-
- * gui/component/addressbook.c, gui/component/alphabet.glade,
- gui/component/alphabet.glade.h: Added an alphabet bar.
-
- * gui/minicard/e-minicard-view.c, gui/minicard/e-minicard-view.h,
- gui/minicard/e-reflow-sorted.c, gui/minicard/e-reflow-sorted.h:
- Added the ability to just to a particular spot in the reflow.
-
-2000-05-30 Christopher James Lahey <clahey@helixcode.com>
-
- * printing/Makefile.am: Added BONOBO_GNOME_CFLAGS to CPPFLAGS.
-
-2000-05-30 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/minicard/e-minicard-view.c: Made double clicking create a
- new card. Set the empty message.
-
- * gui/minicard/e-minicard.c: Made sorting be case insensitive.
-
- * gui/minicard/e-reflow-sorted.c, e-reflow.c, e-reflow.h: Added a
- message for when the reflow is empty.
-
- * printing/e-contact-print.c, printing/medbook.ecps: Made the
- default printout be full page. Made sorting case insensitive.
-
-2000-05-30 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-book-view-listener.c,
- backend/ebook/e-book-view-listener.h, backend/ebook/e-book-view.c,
- backend/ebook/e-book-view.h, backend/idl/addressbook.idl,
- backend/pas/pas-backend-file.c, backend/pas/pas-backend-ldap.c,
- backend/pas/pas-book-factory.c, backend/pas/pas-book-view.c,
- backend/pas/pas-book-view.h: Added "sequence_complete" signal.
-
- * printing/e-contact-print.c: Made printing wait for
- "sequence_complete" signal and made it sort.
-
-2000-05-25 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook.c,
- gui/component/e-addressbook-model.c,
- gui/component/e-addressbook-model.h: Added double click to open
- contact editor.
-
-2000-05-25 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook.c: Removed some columns.
-
-2000-05-25 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/addressbook.c (addressbook_factory_new_control):
- New function.
- (addressbook_factory): Use it.
-
- * Makefile.am (evolution_addressbook_LDADD): Link with
- `evolution-shell-component.o' from the shell directory.
-
- * gui/component/addressbook-component.c: New.
- * gui/component/addressbook-component.h: New.
-
-2000-05-23 Christopher James Lahey <clahey@helixcode.com>
-
- * Makefile.am: Switched printing and gui.
-
- * backend/ebook/e-book-view-listener.h,
- backend/ebook/e-book-view.h, backend/ebook/e-book.h,
- backend/ebook/e-card-cursor.h, backend/ebook/e-card-list.h,
- backend/ebook/e-card-simple.h, backend/ebook/e-card.h: Fixed the
- #defines to work elsewhere in evolution.
-
- * gui/component/Makefile.am: Added linking to libecontactprint.
-
- * gui/component/addressbook.c: Added a menu item to print the
- current query.
-
- * printing/Makefile.am: Add linking to libebook and requirements.
- Add installation of ecps files.
-
- * printing/e-contact-print.c, printing/e-contact-print.h: Changed
- this to use real data from an EBook.
-
- * printing/test-print.c: Made this pass NULL, NULL to
- e_contact_print_dialog_new so that it will compile.
-
-2000-05-23 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-save-as.c: Fixed some memory leaks.
-
-2000-05-23 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/Makefile.am: Added e-contact-editor-save-as.c and
- e-contact-editor-save-as.h.
-
- * contact-editor/e-contact-save-as.c,
- contact-editor/e-contact-save-as.h: New files that display a save
- as dialog and then save the given card to that file.
-
- * gui/minicard/e-minicard.c: Call e_contact_save_as in a right
- click menu.
-
-2000-05-19 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor-categories.c,
- gui/component/e-addressbook-model.c: Added initialize_value and
- value_is_empty callbacks.
-
-2000-05-19 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor.c: Fixed a bug that broke
- address field support.
-
-2000-05-19 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor.c,
- contact-editor/e-contact-editor.h: Added support for arbitrary
- fields in the contact editor.
-
-2000-05-18 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card.c: Fixed e_card_name_copy and
- e_card_arbitrary_copy to deal correctly with a passed NULL.
-
- * contact-editor/Makefile.am: Removed imagesdir stuff.
-
- * contact-editor/arrow.png: Made this transparent.
-
- * contact-editor/contact-editor.glade,
- contact-editor/e-contact-editor-strings.h: Renamed some widgets
- and added custom widgets for all of the images.
-
- * contact-editor/e-contact-editor.c: Worked on making this work
- decently well with messed up glade files. Cleaned up a lot of code.
-
-2000-05-18 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card.c: Fixed the code to write out and read in
- arbitrary fields.
-
-2000-05-18 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card-simple.c, backend/ebook/e-card-simple.h,
- backend/ebook/e-card-types.h, backend/ebook/e-card.c,
- backend/ebook/e-card.h: Implemented "MAILER" field. Added
- arbitrary field support.
-
- * contact-editor/e-contact-editor-categories.c: Fixed a warning.
-
-2000-05-16 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card-simple.c, backend/ebook/e-card-simple.h:
- Added E_CARD_SIMPLE_FIELD_MAILER. Not implemented yet.
-
-2000-05-16 Chris Toshok <toshok@helixcode.com>
-
- * backend/pas/pas-backend-ldap.c (construct_email_list): convert to use ECardSimple.
- (poll_ldap): same.
-
-2000-05-16 Chris Toshok <toshok@helixcode.com>
-
- * backend/pas/pas-book.h: add typedefs for the can_write
- functions, and add parameters to pas_book_new.
-
- * backend/pas/pas-book.c (pas_book_construct): add can_write/can_write_card params.
- (pas_book_new): same.
- (impl_Evolution_Book_can_write): new function.
- (impl_Evolution_Book_can_write_card): same.
- (pas_book_get_epv): assign the can_write/can_write_card slots in the epv.
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_can_write): new function.
- (pas_backend_ldap_can_write_card): same.
- (pas_backend_ldap_add_client): add can_write/can_write_card to pas_book_new call.
-
- * backend/pas/pas-backend-file.c (pas_backend_file_can_write_card): new function, calls can_write.
- (pas_backend_file_can_write): same.
- (can_write): return TRUE if we can write to the addressbook file.
- (pas_backend_file_add_client): add can_write/can_write_card to pas_book_new call.
-
- * backend/idl/addressbook.idl (Evolution): add can_write and
- can_write_card permission requests.
-
-2000-05-16 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card.c (e_card_get_vcard): Fixed a large memory leak.
-
-2000-05-16 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card.c (add_list_unique): Fixed another memory
- leak.
-
-2000-05-16 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card-simple.c, backend/pas/pas-backend-file.c,
- contact-editor/e-contact-editor.c, ename/e-name-western.c,
- gui/component/addressbook.c, gui/minicard/e-minicard-view.c: Fixed
- some memory leaks.
-
- * backend/ebook/e-card.c: Rearranged some code.
-
-2000-05-16 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor-categories.c: Fixed a reference
- leak.
-
-2000-05-16 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor-categories.c: Fixed a compile
- error.
-
-2000-05-16 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor-categories.c: Got rid of a
- memory leak. Rearranged a couple functions.
-
- * gui/minicard/e-minicard-view.c, gui/minicard/e-minicard-view.h:
- Added some code to stop watching the EBook when the canvas is
- destroyed (apparently the canvas is destroyed before our widget is
- destroyed.)
-
-2000-05-14 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor-categories.c: Use the correct
- policy for resize.
-
-2000-05-14 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/Makefile.am: Added libeutil for e-card's support
- for categories.
-
- * backend/ebook/e-card-list.c, backend/ebook/e-card-list.h: Added
- a function to get the length.
-
- * backend/ebook/e-card.c, backend/ebook/e-card.h: Added categories
- support (accessible either as "categories" or "category_list".)
-
- * contact-editor/Makefile.am: Added e-table and all of the
- categories files.
-
- * contact-editor/categories.glade,
- contact-editor/categories-strings.h,
- contact-editor/e-contact-editor-categories.c,
- contact-editor/e-contact-editor-categories.h:
-
- * contact-editor/contact-editor.glade,
- contact-editor/e-contact-editor-strings.h: Rearranged this dialog.
-
- * contact-editor/e-contact-editor.c: Rearranged dialog a bit.
- Added opening of categories dialog.
-
- * gui/component/Makefile.am: Rearranged libraries so that
- libetable would be available for the contact editor categories
- dialog.
-
- * gui/component/addressbook.c: Fix for new ETable resizing. Make
- contact editor dialog resizable.
-
- * gui/minicard/Makefile.am: Added libetable contact editor
- categories dialog.
-
- * gui/minicard/e-minicard.c: Make contact editor dialog resizable.
-
-2000-05-12 Miguel de Icaza <miguel@gnu.org>
-
- * contact-editor/fulname.glade: Use accelerators here.
-
-2000-05-13 Valek Filippov <frob@df.ru>
-
- * gui/component/ldap-server-dialog.glade: save translatable strings
- * gui/component/ldap-server-dialog.glade.h: file with strings
- * printing/e-contact-print.glade: save translatable strings
- * printing/e-contact-print.glade.h: file with strings
-
-2000-05-11 Dan Winship <danw@helixcode.com>
-
- * gui/component/addressbook.c (control_activate): Now that we
- depend on recent gnome-libs we can make the toolbar detachable
- again.
-
-2000-05-10 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook.c: Make the table view be sorted by
- name initially.
-
-2000-05-10 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/pas/pas-book-factory.c: Send a proper response when you
- can't find the ldap URI.
-
- * gui/component/addressbook.c: Cleaned up the open error dialog a
- bit.
-
-2000-05-10 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook.c: Added a dialog for when you can't
- open an addressbook.
-
-2000-05-10 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/Makefile.am: Added e-book-types.h, e-card-pairs.h,
- e-card-types.h.
-
- * backend/pas/Makefile.am: Added pas-backend-ldap.h.
-
- * contact-editor/Makefile.am: Added a proper EXTRA_DIST section.
- Removed some old defines.
-
- * ename/Makefile.am: Added e-name-western-tables.h.
-
- * gui/component/Makefile.am: Added e-ldap-server-dialog.h. Added
- a proper EXTRA_DIST section.
-
- * gui/minicard/e-reflow.c: Added a missed cast.
-
- * printing/Makefile.am: Added a proper EXTRA_DIST section.
-
-2000-05-09 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor.c: Make sure that the canvas
- doesn't intercept keyboard focus.
-
-2000-05-09 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor.c: Use new art.
-
-2000-05-09 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/contact-editor.glade,
- contact-editor/e-contact-editor-strings.h: Replaced the Address
- button with a label and rearranged the address area a bit.
-
-2000-05-09 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/minicard/e-minicard.c: Reenable editting.
-
- * gui/minicard/e-reflow-sorted.c: Make reflow flow on deletion.
-
-2000-05-09 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook.c: Destroy the view object when
- leaving the minicard view.
-
-2000-05-09 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/minicard/e-reflow-sorted.c: Fixed reflow sorting to call
- reflow_request when sorting on an item changes.
-
-2000-05-09 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card-simple.c: Make File As change if name or
- company are changed pretty much anywhere.
-
- * gui/minicard/e-minicard.c: Turned off having minicard editing
- effect anything since it's so crashy.
-
-2000-05-09 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/pas/pas-backend-ldap.c: Enabled a couple more fields
-
-2000-05-09 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/pas/pas-backend-file.c: Added a default card to all new
- file backends.
-
-2000-05-09 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/e-addressbook-model.c: Rearranged order of things
- getting destroyed.
-
- * gui/minicard/e-minicard-view.c: Rearranged order of things
- getting destroyed. Don't set attributes of non-null or destroyed
- items. Destroy parent object when destroyed. Maintain ref_count
- of items in list.
-
- * gui/minicard/e-minicard.c: Don't set attributes of non-null
- items.
-
- * gui/minicard/e-reflow-sorted.c: Maintain ref_count of items in
- list.
-
- * gui/minicard/e-reflow.c: Maintain ref_count of items in list.
- Destroy parent object when destroyed.
-
-2000-05-09 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card-simple.c: Fixed some indentation.
-
- * contact-editor/contact-editor.glade,
- contact-editor/e-contact-editor-strings.h: Changed Email to
- Primary Email.
-
- * contact-editor/e-contact-editor.c: Added checkmarks to indicate
- if data exists in the pull down menus for the phone, address, and
- email fields.
-
-2000-05-09 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card-simple.c: Fixed the string duplication
- problem. Fixed the business/home address string mix up.
-
- * gui/component/addressbook.c: Made the minicard view the default
- view.
-
-2000-05-08 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card-simple.c: Fixed this up a bit. Syncing
- should work better now.
-
-2000-05-08 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/minicard/e-minicard-view.c, gui/minicard/e-minicard.c,
- gui/minicard/e-minicard.h, gui/minicard/e-reflow-sorted.c,
- gui/minicard/e-reflow-sorted.h: Made a minimal number of things be
- destroyed and recreated when updating a field.
-
-2000-05-07 <toshok@the-dot-in.helixcode.com>
-
- * gui/minicard/e-minicard.c (remodel): make sure to free the
- return value of e_card_simple_get.
-
- * gui/component/addressbook.c (teardown_table_view): destroy the
- ECardSimple here, plug memory leak.
- (create_table_view): use view->simple so we can destroy the
- ECardSimple later on.
-
-2000-05-07 Chris Toshok <toshok@helixcode.com>
-
- * ename/e-name-western.c (e_name_western_extract_middle): comment
- function, and fix an ABR.
-
-2000-05-07 Chris Toshok <toshok@helixcode.com>
-
- * ename/e-name-western.c (e_name_western_cleanup_string): comment
- function, and fix an ABR.
-
-2000-05-08 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/minicard/e-minicard.c: Added saving in minicard view.
-
-2000-05-07 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/pas/pas-backend-file.c: Fixed an off by 2 error.
-
-2000-05-07 Chris Toshok <toshok@helixcode.com>
-
- * gui/component/addressbook.c (set_prop): don't create a new
- ebook. instead, unload the current uri (if there is one) and load
- the new one.
- (addressbook_factory): create the ebook once.
-
-2000-05-07 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/e-addressbook-model.c: Replaced some model_changed
- calls with row_inserted calls.
-
-2000-05-07 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/pas/pas-backend-file.c, backend/pas/pas-backend-ldap.c:
- Removed some code that was notifying too many clients at the wrong
- times.
-
- * gui/component/addressbook.c: Set view->book. Unreffed
- view->book. Unreffed the model instead of destroying it. Removed
- the /tmp/test.db stuff.
-
-2000-05-07 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook.c: Make the addressbook create the
- correct file uri. Added a default query. Initialize view->model
- and view->view to NULL.
-
- * gui/component/e-addressbook-model.c,
- gui/minicard/e-minicard-view.c: Only call get_book_view if both
- book and query and non-null.
-
-2000-05-06 Chris Toshok <toshok@helixcode.com>
-
- * gui/component/addressbook.c (control_deactivate): remove the
- separator and toggle view items as well.
- (toggle_view_as_cb): callback for the "/View/Toggle View" menu
- item.
- (get_query): getter for the query string that takes into account
- the two view types.
- (set_query): setter for the query string that takes into account
- the two view types.
- (set_book): setter for the EBook type - not really a setter, since
- the book is kept in the AddressbookView, but this method actually
- sets the "book" property on the current view.
- (find_contact_cb): make use of get/set_query
- (search_entry_activated): make use of set_query.
- (control_activate): add a menu separator and an item to toggle
- between view types.
- (book_open_cb): make use of set_book.
- (ebook_create): no longer needs to return the EBook, since we set
- the book field in our view.
- (teardown_minicard_view): destructor function for the minicard
- specific ui.
- (create_minicard_view): constructor function for the minicard
- specific ui.
- (teardown_table_view): destructor function for the e-table
- specific ui.
- (create_table_view): constructor function for the e-table specific
- ui.
- (change_view_type): destroy the old and create the new view ui,
- change the label of the Toggle View menu item, and reset the book
- and query on the new view type.
- (addressbook_factory): create an all-encompassing vbox that the
- view uses to create the bonobo control, which contains 1 widget
- per ui specific view (the e-table in the table case, and another
- vbox in the minicard case.) use change_view_type to create the
- initial view.
-
-2000-05-07 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-book.c: Made a NULL callback just mean to not
- call back.
-
- * backend/ebook/e-card-simple.c, backend/ebook/e-card-simple.h:
- Reordered fields. Added a get_const function to get a constant
- string that persists until the simple is destroyed.
-
- * gui/component/Makefile.am: Added e-addressbook-model.c and
- e-addressbook-model.h and all of the libraries and includes that
- they are dependent on.
-
- * gui/component/addressbook-factory.c: Initialize e cursors.
-
- * gui/component/addressbook.c: Added inactive code to display an
- ETable view of the addressbook.
-
- * gui/component/e-addressbook-model.c,
- gui/component/e-addressbook-model.h: New files to implement an
- ETable model with a EBook back end.
-
-2000-05-06 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card-simple.c, backend/ebook/e-card-simple.h:
- Mostly finished ECardSimple.
-
- * contact-editor/e-contact-editor.c: Changed this to match with
- some of the changes to ECardSimple.
-
- * gui/component/addressbook.c: Changed this to look for
- "addressbook.db" in the given directory if it doesn't find the
- file "uri".
-
- * gui/minicard/e-minicard.c, gui/minicard/e-minicard.h: Changed
- this to use ECardSimple.
-
-2000-05-06 Chris Toshok <toshok@helixcode.com>
-
- * gui/component/.cvsignore: ignore evolution-addressbook.pure
-
- * gui/component/Makefile.am: add support for generating
- evolution-addressbook.pure.
-
-2000-05-06 Chris Toshok <toshok@helixcode.com>
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_load_uri): if a
- port isn't specified in the uri default to 389.
-
-2000-05-06 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook.c: Made this take a uri through its
- property bag.
-
-2000-05-05 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/Makefile.am: Added e-card-simple.c and
- e-card-simple.h.
-
- * backend/ebook/e-card-simple.c, backend/ebook/e-card-simple.h:
- New card wrapper class to simplify things.
-
- * contact-editor/e-contact-editor.c,
- contact-editor/e-contact-editor.h: Changed e-contact-editor to use
- ECardSimple a bit.
-
-2000-05-03 Chris Toshok <toshok@helixcode.com>
-
- * gui/component/addressbook.c (control_deactivate): #ifdef
- HAVE_LDAP the ldap specific stuff.
- (null_cb): same.
- (control_activate): same.
-
-2000-05-02 Ettore Perazzoli <ettore@helixcode.com>
-
- * backend/ebook/Makefile.am (INCLUDES): Add
- `-I$(top_srcdir)/addressbook/ename'.
-
-2000-05-02 Matt Loper <matt@helixcode.com>
-
- * demo/Makefile.am: set G_LOG_DOMAIN.
- * printing/Makefile.am: same.
-
-2000-05-01 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/pas/pas-book-factory.c: Add back in the
- CORBA_Object_release.
-
- * backend/pas/pas-book.c: Properly duplicate and release the
- listener passed to us.
-
-2000-05-01 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/pas/pas-backend-file.c, backend/pas/pas-backend-ldap.c:
- Made uri slightly better managed.
-
- * backend/pas/pas-book-factory.c
- (pas_book_factory_process_request): Remove this
- CORBA_Object_release that causes things not to work. This is just
- a temporary fix until we figure out what's actually wrong.
-
- * backend/pas/pas-book.c: Fixed a copy and paste error in a warning.
-
-2000-05-01 Christopher James Lahey <clahey@helixcode.com>
-
- * Makefile.am: Switched the subdirs order since backend depends on
- ename.
-
-2000-05-01 Larry Ewing <lewing@helixcode.com>
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_remove_client):
- fix a typo in the for loop.
-
-2000-05-01 Michael Meeks <michael@helixcode.com>
-
- * backend/pas/pas-book-factory.c: include gtk.
-
-2000-04-30 Federico Mena Quintero <federico@helixcode.com>
-
- * backend/ebook/e-book-types.h (EBookStatus): Added new status
- values for the IDL stuff.
-
- * backend/pas/pas-book-factory.h (PASBookFactoryClass): New
- "last_book_gone" signal.
-
- * backend/pas/pas-book-factory.c
- (pas_book_factory_launch_backend): Better error handling.
- (pas_book_factory_process_queue): Let
- pas_book_factory_process_request() free the request.
- (pas_book_factory_process_request): Free the request here.
- Perform better error handling.
- (free_active_server_map_entry): Free an active server map entry;
- free the URI key and unref the backend value. This function was
- renamed; the old one was trying to CORBA_Object_unref() a GTK+
- object!
- (remove_backends_entry): Free a backend table entry; free the URI
- key.
- (backend_last_client_gone_cb): Remove the backend from the active
- server map and emit the "last_book_gone" signal if appropriate.
- (pas_book_factory_get_n_backends): New function to query the
- number of running backends in an addressbook factory.
-
- * backend/idl/addressbook.idl (BookListener::CallStatus): Added a
- ProtocolNotSupported code. This is for when the addressbook
- factory cannot find a provider for the requested URI.
-
- * backend/pas/pas-backend.h (PASBackendClass): New
- "last_client_gone" signal.
- (PASBackendClass): New get_uri virtual method.
-
- * backend/pas/pas-backend.c (pas_backend_load_uri): Return a
- gboolean success code.
- (pas_backend_add_client): Return a gboolean success code.
- (pas_backend_last_client_gone): New function used by backend
- implementations to notify upwards when the backend's last client
- is destroyed.
- (pas_backend_get_uri): New function to get the URI of a backend.
-
- * backend/pas/pas-backend-file.c (pas_backend_file_add_client):
- Pass the backend as the closure data to the "destroy" handler of
- the book. We cannot call pas_book_get_backend() in the callback
- since the book's private data has already been destroyed when the
- callback is invoked. Alternatively, we could move the private
- data destruction step to the book's ::finalize() method.
- (pas_backend_file_book_destroy_cb): Get the backend from the
- callback's data, not from the book.
- (pas_backend_file_remove_client): Remove the book from the list of
- clients. When all clients go away, call
- pas_backend_last_client_gone().
- (PASBackendFilePrivate): Added an uri field.
- (pas_backend_file_get_uri): Implement the get_uri method.
- (pas_backend_file_load_uri): Return a gboolean success code.
- Also, store the URI in the private structure.
- (pas_backend_file_add_client): Return a gboolean success code.
- Also, call pas_backend_last_client_gone() if appropriate.
- (pas_backend_file_destroy): Free the bf->priv->uri.
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_add_client):
- Pass the backend as the closure data to the "destroy" handler of
- the book. See above for rationale.
- (pas_backend_ldap_book_destroy_cb): Get the backend from the
- callback's data.
- (pas_backend_ldap_remove_client): Remove the book from the list of
- clients. When all clients go away, call
- pas_backend_last_client_gone().
- (pas_backend_ldap_load_uri): Return a gboolean success code.
- (pas_backend_ldap_add_client): Return a gboolean success code.
- Also, call pas_backend_last_client_gone() if appropriate.
- (PASBackendLDAPPrivate): New uri field.
- (pas_backend_ldap_get_uri): Implement the get_uri method.
- (pas_backend_ldap_load_uri): Store the uri in the private
- structure.
- (pas_backend_ldap_destroy): Free the bl->priv->uri.
-
-2000-04-30 Chris Toshok <toshok@helixcode.com>
-
- * gui/component/Makefile.am (evolution_addressbook_SOURCES): added
- e-ldap-server-dialog.c
- (glade_DATA): added ldap-server-dialog.glade
-
- * gui/component/ldap-server-dialog.glade: new file.
-
- * gui/component/e-ldap-server-dialog.h: new file.
-
- * gui/component/e-ldap-server-dialog.c: new file, contains logic
- associated with ldap server dialog.
-
- * gui/component/addressbook.c (control_deactivate): remove the
- directory server menu item.
- (null_cb): do nothing callback for e_book_load_uri call. should
- change to (at the very least) pop up a dialog if there was an
- error.
- (new_server_cb): new function - really just switches to a
- particular ldap server, since the information isn't saved
- anywhere.
- (control_activate): add directory server menu item.
-
-2000-04-30 Chris Toshok <toshok@helixcode.com>
-
- * backend/ebook/e-book.c (e_book_load_uri): create the book
- listener here, since it's destroyed in unload_uri.
- (e_book_construct): remove the book listener construction here.
-
-2000-04-30 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/.cvsignore: Added load-pine-addressbook.
-
-2000-04-30 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/contact-editor.glade,
- contact-editor/e-contact-editor.c, gui/minicard/e-minicard.c: Made
- some fields invisible that were visible before.
-
-2000-04-30 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card.c: Make file as not have the : after it if
- it's empty. If there's no name, or file_as, fill in these fields
- with defaults based on full_name or name respectively.
-
- * backend/ebook/load-pine-addressbook.c: New file to do import of
- pine .addressbook files.
-
- * backend/pas/pas-backend-file.c: Made empty fields act as the
- empty string for searches.
-
- * contact-editor/e-contact-editor.c,
- contact-editor/e-contact-editor.h: Made the File As field update
- properly as you edit the name and company fields. Added the pull
- down list of File As choices. Made sure that all fields will
- be set to NULL if they are deleted to the empty string.
-
- * gui/minicard/e-minicard.c: Use the File As field instead of the
- Full Name field for the header. Make identical compares on the
- File As field do a compare on the uid.
-
-2000-04-30 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor-fullname.c,
- contact-editor/fullname.glade: Fixed a string mismatch.
-
-2000-04-30 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/Makefile.am: Added ename includes and libs.
-
- * backend/ebook/e-card.c, backend/ebook/e-card.h: Added
- e_card_name_from_string. Added header for
- e_card_delivery_address_from_string, even though it's not
- implemented yet.
-
- * contact-editor/Makefile.am: Removed the ename includes since we
- no longer use ename directly here.
-
- * contact-editor/e-contact-editor.c: Fixed this to properly save
- the address labels displayed. Updated this to use the function
- e_card_name_from_string instead of doing it by hand.
-
- * contact-editor/fullname-strings.h,
- contact-editor/fullname.glade: Deleted an unused field. Changed
- the set of prefixes and suffixes.
-
-2000-04-30 Chris Toshok <toshok@helixcode.com>
-
- * backend/pas/pas-backend-ldap.c
- (pas_backend_ldap_ensure_connected): add support for a rootdn in
- the uri.
- (pas_backend_ldap_build_all_cards_list): make use of the rootdn in
- the call to ldap_search_s.
- (pas_backend_ldap_search): same.
- (pas_backend_ldap_load_uri): get the rootdn out of the passed in uri.
-
-2000-04-29 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card.c, backend/ebook/e-card.h: Added
- e_card_phone_new e_card_delivery_address_new,
- e_card_delivery_address_to_string, e_card_name_copy,
- e_card_name_new, e_card_name_to_string, and made e_card_name_free
- public. Removed some unused code.
-
- * backend/pas/pas-backend-file.c: Fixed a warning.
-
- * contact-editor/Makefile.am: Added e-contact-editor-fullname.[ch]
- and fullname.glade. Added e-name libs and includes.
-
- * contact-editor/e-contact-editor-fullname.c,
- contact-editor/e-contact-editor-fullname.h,
- contact-editor/fullname-strings.h, contact-editor/fullname.glade:
- New dialog for editing the fields of a name separately.
-
- * contact-editor/e-contact-editor.c,
- contact-editor/e-contact-editor.h: Create an
- EContactEditorFullname when you click on the Full Name button.
- Maintain a parsed name at all times.
-
- * gui/component/Makefile.am, gui/minicard/Makefile.am: Added
- e-name libs.
-
-2000-04-28 Larry Ewing <lewing@helixcode.com>
-
- * backend/pas/pas-book-factory.c (register_factory): fix the
- `USING_OAF' changes so that they work for when we are not using
- oaf.
-
-2000-04-27 Ettore Perazzoli <ettore@helixcode.com>
-
- * ename/Makefile.am
- (gnome_libs): Use `BONOBO_GNOME_LIBS'.
- (INCLUDES): Add `-I$(srcdir)/..'.
-
- * backend/pas/pas-book-factory.c
- (register_factory): New function to register the factory.
- Implementation different according to `USING_OAF'.
- (pas_book_factory_activate): Use `register_factory()'.
-
- * gui/component/addressbook.c: New #define `CONTROL_FACTORY_ID',
- varying depending on whether we are `USING_OAF'.
- (addressbook_factory_init): Use `CONTROL_FACTORY_ID'.
-
- * backend/ebook/test-client.c (init_corba): New function,
- implemented differently according to the `USING_OAF' #define.
-
- * backend/ebook/e-book.c: New #define `CARDSERVER_OAF_ID'.
- (e_book_construct): Work with OAF #if `USING_OAF'.
-
- * backend/ebook/Makefile.am (gnome_libs): Removed.
- (corbadir): Removed.
- (ebook_libs): Removed.
- (test_client_LDADD): Just add `libebook.la'.
- (test_card_LDADD): Likewise.
- (test_client_list_LDADD): Likewise.
-
- * gui/component/addressbook-factory.c
- (init_corba): New helper function, implemented differently
- according to `USING_OAF'.
- (main): Call `init_corba()'.
-
-2000-04-27 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card.c, backend/ebook/e-card.h: Added file as,
- office, manager, assistant, spouse, and anniversary fields. These
- all use "X-EVOLUTION-" fields in the VCards.
-
- * backend/pas/pas-backend-file.c: Added all the new fields (except
- anniversary) to the list of fields.
-
- * contact-editor/contact-editor.glade,
- contact-editor/e-contact-editor-strings.h: Fixed some misnamed
- fields and fixed the placement of the comments field.
-
- * contact-editor/e-contact-editor.c: Made the newly added fields
- display properly.
-
- * Makefile.am: Added ename.
-
- * ename/e-name-western.h, ename/test-ename-western-gtk.c,
- ename/test-ename-western.c: Fixed up some #includes.
-
- * ename/.cvsignore: Added .cvsignore.
-
-2000-04-26 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card-types.h, backend/ebook/e-card.c,
- backend/ebook/e-card.h: Added an address label field.
-
- * contact-editor/contact-editor.glade,
- contact-editor/e-contact-editor-strings.h: Got rid of some unused
- fields.
-
- * contact-editor/e-contact-editor.c,
- contact-editor/e-contact-editor.h: Added the address label field.
- Load only. Editing these fields seems to mess things up.
-
-2000-04-26 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor.c: Added proper handling of the
- email field.
-
-2000-04-26 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card-types.h, backend/ebook/e-card.c,
- gui/minicard/e-minicard.c: Prefixed the ADDR_ flags.
-
- * contact-editor/contact-editor.glade,
- contact-editor/e-contact-editor-strings.h: Edited the glade file.
- Removed all the fields that we don't use.
-
- * contact-editor/e-contact-editor.c,
- contact-editor/e-contact-editor.h: Made the phone fields work
- properly. The address and email fields are temporarily turned off
- until they can be made to work as the phone fields do.
-
-2000-04-25 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/minicard/Makefile.am (INCLUDES): Use
- `$(BONOBO_GNOME_CFLAGS)'.
-
- * backend/pas/Makefile.am (idl_flags): Add `-I $(datadir)/idl' to
- pick up IDL files in the installation prefix as well.
- (INCLUDES): Use `$(BONOBO_GNOME_CFLAGS)'.
-
- * backend/ebook/Makefile.am (ORBIT_IDL): Use `-I $(datadir)/idl'
- to get the IDLs from the installation prefix as well.
- (INCLUDES): Add `$(BONOBO_GNOME_CFLAGS)'.
- (test_client_LDADD): Use `$(BONOBO_GNOME_LIBS)' instead of
- hardcoding `-lbonobo'! Also get rid of some other useless flags,
- as `$(BONOBO_GNOME_LIBS)' really has all what we need.
- (test_client_list_LDADD): Likewise.
- (test_card_LDADD): Likewise.
-
-2000-04-18 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/minicard/Makefile.am (INCLUDES): Use "e-minicard" as the log
- domain.
-
- * gui/component/Makefile.am (INCLUDES): Use
- "evolution-addressbook" as the log domain.
-
- * backend/pas/Makefile.am: Build libpas.a, not a shared library.
- Do not install any header files.
- (INCLUDES): Remove spurious include paths.
-
- * backend/pas/*.[ch]: Fix includes.
-
- * backend/ebook/Makefile.am: Do not install the test programs.
- Fixed some include weirdness.
-
- * backend/ebook/*.[ch]: Fix includes.
-
- * contact-editor/Makefile.am (INCLUDES): Set the log domain to
- "contact-editor".
- (INCLUDES): Fix.
-
- * contact-editor/*.[ch]: Fix includes.
-
- * gui/minicard/*.[ch]: Fix includes.
-
- * ChangeLog: Started a ChangeLog here.
diff --git a/addressbook/E-CARD-NEEDED-FIELDS b/addressbook/E-CARD-NEEDED-FIELDS
deleted file mode 100644
index e227d1b130..0000000000
--- a/addressbook/E-CARD-NEEDED-FIELDS
+++ /dev/null
@@ -1,9 +0,0 @@
-I will add these fields as I get a chance to.
-
-Thanks,
- Chris Lahey
-
-X-EVOLUTION-LIST boolean if this is a mailing list.
-X-EVOLUTION-LIST-SHOW-ADDRESSES boolean whether to list all email addresses in the To: line or to treat the list kind of like a BCC.
-X-EVOLUTION-RELATED-CONTACTS EDestionationList of related contacts.
-REV last changed date. \ No newline at end of file
diff --git a/addressbook/Makefile.am b/addressbook/Makefile.am
deleted file mode 100644
index d472f0033b..0000000000
--- a/addressbook/Makefile.am
+++ /dev/null
@@ -1,11 +0,0 @@
-if ENABLE_PILOT_CONDUITS
-CONDUIT_SUBDIR=conduit
-endif
-
-SUBDIRS = \
- util printing gui $(CONDUIT_SUBDIR)
-
-EXTRA_DIST = \
- ChangeLog.pre-1-4
-
-# XXX tools \ No newline at end of file
diff --git a/addressbook/conduit/.cvsignore b/addressbook/conduit/.cvsignore
deleted file mode 100644
index 87b35d3be5..0000000000
--- a/addressbook/conduit/.cvsignore
+++ /dev/null
@@ -1,9 +0,0 @@
-.deps
-.libs
-*.lo
-Makefile.in
-Makefile
-libeaddress_conduit.la
-e-address-conduit-control-applet
-e-address-conduit-control-applet.desktop
-e-address.conduit
diff --git a/addressbook/conduit/Makefile.am b/addressbook/conduit/Makefile.am
deleted file mode 100644
index 3c6b0f2314..0000000000
--- a/addressbook/conduit/Makefile.am
+++ /dev/null
@@ -1,39 +0,0 @@
-INCLUDES = \
- -I$(top_srcdir) \
- -I$(top_srcdir)/addressbook \
- -I$(top_srcdir)/addressbook/backend \
- -I$(top_builddir)/addressbook/backend \
- -I$(top_srcdir)/e-util \
- -I$(top_builddir)/e-util \
- $(EVOLUTION_ADDRESSBOOK_CONDUIT_CFLAGS)
-
-# Address Conduit
-privconduit_LTLIBRARIES = libeaddress_conduit.la
-
-libeaddress_conduit_la_SOURCES = \
- address-conduit.c
-
-libeaddress_conduit_la_LDFLAGS = -module -avoid-version
-libeaddress_conduit_la_LIBADD = \
- $(top_builddir)/e-util/libeutil.la \
- $(top_builddir)/e-util/libeconduit.la \
- $(top_builddir)/camel/libcamel.la \
- $(EVOLUTION_ADDRESSBOOK_CONDUIT_LIBS)
-
-e-address-$(BASE_VERSION).conduit: e-address.conduit.in
- sed -e 's^\@privconduitdir\@^$(privconduitdir)^g' \
- -e 's^\@datadir\@^$(datadir)^g' \
- -e 's^\@BASE_VERSION\@^$(BASE_VERSION)^g' \
- $< > $@
-
-conduitdir = $(datadir)/gnome-pilot/conduits/
-conduit_DATA = e-address-$(BASE_VERSION).conduit
-
-BUILT_SOURCES = $(conduit_DATA)
-CLEANFILES = $(BUILT_SOURCES)
-
-EXTRA_DIST = \
- e-address.conduit.in
-
-dist-hook:
- cd $(distdir); rm -f $(BUILT_SOURCES)
diff --git a/addressbook/conduit/address-conduit.c b/addressbook/conduit/address-conduit.c
deleted file mode 100644
index 5d6530fd85..0000000000
--- a/addressbook/conduit/address-conduit.c
+++ /dev/null
@@ -1,1713 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* Evolution addressbook - Address Conduit
- *
- * Copyright (C) 1998 Free Software Foundation
- * Copyright (C) 2000 Ximian, Inc.
- *
- * Authors: Eskil Heyn Olsen <deity@eskil.dk>
- * JP Rosevear <jpr@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-
-#define G_LOG_DOMAIN "eaddrconduit"
-
-#include <bonobo.h>
-#include <libxml/parser.h>
-#include <pi-source.h>
-#include <pi-socket.h>
-#include <pi-dlp.h>
-#include <pi-address.h>
-#include <libebook/e-book.h>
-#include <gpilotd/gnome-pilot-conduit.h>
-#include <gpilotd/gnome-pilot-conduit-sync-abs.h>
-#include <libgpilotdCM/gnome-pilot-conduit-management.h>
-#include <libgpilotdCM/gnome-pilot-conduit-config.h>
-#include <e-dialog-widgets.h>
-#include <e-pilot-map.h>
-#include <e-pilot-settings.h>
-#include <e-pilot-util.h>
-
-GnomePilotConduit * conduit_get_gpilot_conduit (guint32);
-void conduit_destroy_gpilot_conduit (GnomePilotConduit*);
-
-#define CONDUIT_VERSION "0.1.2"
-
-#define DEBUG_CONDUIT 1
-/* #undef DEBUG_CONDUIT */
-
-#ifdef DEBUG_CONDUIT
-#define LOG(x) x
-#else
-#define LOG(x)
-#endif
-
-#define WARN g_warning
-#define INFO g_message
-
-enum {
- LABEL_WORK,
- LABEL_HOME,
- LABEL_FAX,
- LABEL_OTHER,
- LABEL_EMAIL,
- LABEL_MAIN,
- LABEL_PAGER,
- LABEL_MOBILE
-};
-
-static EContactField priority [] = {
- E_CONTACT_PHONE_BUSINESS,
- E_CONTACT_PHONE_HOME,
- E_CONTACT_PHONE_BUSINESS_FAX,
- E_CONTACT_EMAIL,
- E_CONTACT_PHONE_PAGER,
- E_CONTACT_PHONE_MOBILE,
- E_CONTACT_PHONE_BUSINESS_2,
- E_CONTACT_PHONE_HOME_2,
- E_CONTACT_PHONE_HOME_FAX,
- E_CONTACT_EMAIL_2,
- E_CONTACT_PHONE_OTHER,
- E_CONTACT_PHONE_PRIMARY,
- E_CONTACT_PHONE_OTHER_FAX,
- E_CONTACT_EMAIL_3,
- E_CONTACT_FIELD_LAST
-};
-
-static int priority_label [] = {
- LABEL_WORK,
- LABEL_HOME,
- LABEL_FAX,
- LABEL_EMAIL,
- LABEL_PAGER,
- LABEL_MOBILE,
- LABEL_WORK,
- LABEL_HOME,
- LABEL_FAX,
- LABEL_EMAIL,
- LABEL_OTHER,
- LABEL_MAIN,
- LABEL_FAX,
- LABEL_EMAIL,
- -1
-};
-
-typedef struct _EAddrLocalRecord EAddrLocalRecord;
-typedef struct _EAddrConduitCfg EAddrConduitCfg;
-typedef struct _EAddrConduitGui EAddrConduitGui;
-typedef struct _EAddrConduitContext EAddrConduitContext;
-
-/* Local Record */
-struct _EAddrLocalRecord {
- /* The stuff from gnome-pilot-conduit-standard-abs.h
- Must be first in the structure, or instances of this
- structure cannot be used by gnome-pilot-conduit-standard-abs.
- */
- GnomePilotDesktopRecord local;
-
- /* The corresponding ECard object */
- EContact *contact;
-
- /* pilot-link address structure, used for implementing Transmit. */
- struct Address *addr;
-};
-
-
-static void
-addrconduit_destroy_record (EAddrLocalRecord *local)
-{
- g_object_unref (local->contact);
- free_Address (local->addr);
- g_free (local->addr);
- g_free (local);
-}
-
-/* Configuration */
-struct _EAddrConduitCfg {
- guint32 pilot_id;
- GnomePilotConduitSyncType sync_type;
-
- gboolean secret;
- EContactField default_address;
-
- gchar *last_uri;
-};
-
-static EAddrConduitCfg *
-addrconduit_load_configuration (guint32 pilot_id)
-{
- EAddrConduitCfg *c;
- GnomePilotConduitManagement *management;
- GnomePilotConduitConfig *config;
- gchar *address, prefix[256];
- g_snprintf (prefix, 255, "/gnome-pilot.d/e-address-conduit/Pilot_%u/",
- pilot_id);
-
- c = g_new0 (EAddrConduitCfg,1);
- g_assert (c != NULL);
-
- c->pilot_id = pilot_id;
- management = gnome_pilot_conduit_management_new ("e_address_conduit", GNOME_PILOT_CONDUIT_MGMT_ID);
- gtk_object_ref (GTK_OBJECT (management));
- gtk_object_sink (GTK_OBJECT (management));
- config = gnome_pilot_conduit_config_new (management, pilot_id);
- gtk_object_ref (GTK_OBJECT (config));
- gtk_object_sink (GTK_OBJECT (config));
- if (!gnome_pilot_conduit_config_is_enabled (config, &c->sync_type))
- c->sync_type = GnomePilotConduitSyncTypeNotSet;
- gtk_object_unref (GTK_OBJECT (config));
- gtk_object_unref (GTK_OBJECT (management));
-
- /* Custom settings */
- gnome_config_push_prefix (prefix);
-
- c->secret = gnome_config_get_bool ("secret=FALSE");
- address = gnome_config_get_string ("default_address=business");
- if (!strcmp (address, "business"))
- c->default_address = E_CONTACT_ADDRESS_WORK;
- else if (!strcmp (address, "home"))
- c->default_address = E_CONTACT_ADDRESS_HOME;
- else if (!strcmp (address, "other"))
- c->default_address = E_CONTACT_ADDRESS_OTHER;
- g_free (address);
- c->last_uri = gnome_config_get_string ("last_uri");
-
- gnome_config_pop_prefix ();
-
- return c;
-}
-
-static void
-addrconduit_save_configuration (EAddrConduitCfg *c)
-{
- gchar prefix[256];
-
- g_snprintf (prefix, 255, "/gnome-pilot.d/e-address-conduit/Pilot_%u/",
- c->pilot_id);
-
- gnome_config_push_prefix (prefix);
- gnome_config_set_bool ("secret", c->secret);
- switch (c->default_address) {
- case E_CONTACT_ADDRESS_WORK:
- gnome_config_set_string ("default_address", "business");
- break;
- case E_CONTACT_ADDRESS_HOME:
- gnome_config_set_string ("default_address", "home");
- break;
- case E_CONTACT_ADDRESS_OTHER:
- gnome_config_set_string ("default_address", "other");
- break;
- default:
- g_warning ("Unknown default_address value");
- }
- gnome_config_set_string ("last_uri", c->last_uri);
- gnome_config_pop_prefix ();
-
- gnome_config_sync ();
- gnome_config_drop_all ();
-}
-
-static EAddrConduitCfg*
-addrconduit_dupe_configuration (EAddrConduitCfg *c)
-{
- EAddrConduitCfg *retval;
-
- g_return_val_if_fail (c != NULL, NULL);
-
- retval = g_new0 (EAddrConduitCfg, 1);
- retval->sync_type = c->sync_type;
- retval->pilot_id = c->pilot_id;
-
- retval->secret = c->secret;
- retval->default_address = c->default_address;
- retval->last_uri = g_strdup (c->last_uri);
-
- return retval;
-}
-
-static void
-addrconduit_destroy_configuration (EAddrConduitCfg *c)
-{
- g_return_if_fail (c != NULL);
-
- g_free (c->last_uri);
- g_free (c);
-}
-
-/* Gui */
-struct _EAddrConduitGui {
- GtkWidget *default_address;
-};
-
-static EAddrConduitGui *
-e_addr_gui_new (EPilotSettings *ps)
-{
- EAddrConduitGui *gui;
- GtkWidget *lbl, *menu;
- gint rows, i;
- static const char *items[] = {"Business", "Home", "Other", NULL};
-
- g_return_val_if_fail (ps != NULL, NULL);
- g_return_val_if_fail (E_IS_PILOT_SETTINGS (ps), NULL);
-
- gtk_table_resize (GTK_TABLE (ps), E_PILOT_SETTINGS_TABLE_ROWS + 1,
- E_PILOT_SETTINGS_TABLE_COLS);
-
- gui = g_new0 (EAddrConduitGui, 1);
-
- rows = E_PILOT_SETTINGS_TABLE_ROWS;
- lbl = gtk_label_new (_("Default Sync Address:"));
- gtk_misc_set_alignment (GTK_MISC (lbl), 0.0, 0.5);
- gui->default_address = gtk_option_menu_new ();
- menu = gtk_menu_new ();
- for (i = 0; items[i] != NULL; i++) {
- GtkWidget *item;
-
- item = gtk_menu_item_new_with_label (items[i]);
- gtk_widget_show (item);
-
- gtk_menu_append (GTK_MENU (menu), item);
- }
- gtk_widget_show (menu);
- gtk_option_menu_set_menu (GTK_OPTION_MENU (gui->default_address), menu);
- gtk_table_attach_defaults (GTK_TABLE (ps), lbl, 0, 1, rows, rows + 1);
- gtk_table_attach_defaults (GTK_TABLE (ps), gui->default_address, 1, 2, rows, rows + 1);
- gtk_widget_show (lbl);
- gtk_widget_show (gui->default_address);
-
- return gui;
-}
-
-static const int default_address_map[] = {
- E_CONTACT_ADDRESS_WORK,
- E_CONTACT_ADDRESS_HOME,
- E_CONTACT_ADDRESS_OTHER,
- -1
-};
-
-static void
-e_addr_gui_fill_widgets (EAddrConduitGui *gui, EAddrConduitCfg *cfg)
-{
- g_return_if_fail (gui != NULL);
- g_return_if_fail (cfg != NULL);
-
- e_dialog_option_menu_set (gui->default_address,
- cfg->default_address,
- default_address_map);
-}
-
-static void
-e_addr_gui_fill_config (EAddrConduitGui *gui, EAddrConduitCfg *cfg)
-{
- g_return_if_fail (gui != NULL);
- g_return_if_fail (cfg != NULL);
-
- cfg->default_address = e_dialog_option_menu_get (gui->default_address,
- default_address_map);
-}
-
-static void
-e_addr_gui_destroy (EAddrConduitGui *gui)
-{
- g_free (gui);
-}
-
-/* Context */
-struct _EAddrConduitContext {
- GnomePilotDBInfo *dbi;
-
- EAddrConduitCfg *cfg;
- EAddrConduitCfg *new_cfg;
- EAddrConduitGui *gui;
- GtkWidget *ps;
-
- struct AddressAppInfo ai;
-
- EBook *ebook;
- GList *cards;
- GList *changed;
- GHashTable *changed_hash;
- GList *locals;
-
- EPilotMap *map;
-};
-
-static EAddrConduitContext *
-e_addr_context_new (guint32 pilot_id)
-{
- EAddrConduitContext *ctxt = g_new0 (EAddrConduitContext, 1);
-
- ctxt->cfg = addrconduit_load_configuration (pilot_id);
- ctxt->new_cfg = addrconduit_dupe_configuration (ctxt->cfg);
- ctxt->gui = NULL;
- ctxt->ps = NULL;
- ctxt->ebook = NULL;
- ctxt->cards = NULL;
- ctxt->changed_hash = NULL;
- ctxt->changed = NULL;
- ctxt->locals = NULL;
- ctxt->map = NULL;
-
- return ctxt;
-}
-
-static void
-e_addr_context_destroy (EAddrConduitContext *ctxt)
-{
- GList *l;
-
- g_return_if_fail (ctxt != NULL);
-
- if (ctxt->cfg != NULL)
- addrconduit_destroy_configuration (ctxt->cfg);
- if (ctxt->new_cfg != NULL)
- addrconduit_destroy_configuration (ctxt->new_cfg);
- if (ctxt->gui != NULL)
- e_addr_gui_destroy (ctxt->gui);
-
- if (ctxt->ebook != NULL)
- g_object_unref (ctxt->ebook);
-
- if (ctxt->cards != NULL) {
- for (l = ctxt->cards; l != NULL; l = l->next)
- g_object_unref (l->data);
- g_list_free (ctxt->cards);
- }
-
- if (ctxt->changed_hash != NULL)
- g_hash_table_destroy (ctxt->changed_hash);
-
- if (ctxt->changed != NULL)
- e_book_free_change_list (ctxt->changed);
-
- if (ctxt->locals != NULL) {
- for (l = ctxt->locals; l != NULL; l = l->next)
- addrconduit_destroy_record (l->data);
- g_list_free (ctxt->locals);
- }
-
- if (ctxt->map != NULL)
- e_pilot_map_destroy (ctxt->map);
-
- g_free (ctxt);
-}
-
-/* Debug routines */
-static char *
-print_local (EAddrLocalRecord *local)
-{
- static char buff[ 4096 ];
-
- if (local == NULL) {
- sprintf (buff, "[NULL]");
- return buff;
- }
-
- if (local->addr) {
- g_snprintf (buff, 4096, "['%s' '%s' '%s']",
- local->addr->entry[entryLastname] ?
- local->addr->entry[entryLastname] : "",
- local->addr->entry[entryFirstname] ?
- local->addr->entry[entryFirstname] : "",
- local->addr->entry[entryCompany] ?
- local->addr->entry[entryCompany] : "");
- return buff;
- }
-
- return "";
-}
-
-static char *print_remote (GnomePilotRecord *remote)
-{
- static char buff[ 4096 ];
- struct Address addr;
-
- if (remote == NULL) {
- sprintf (buff, "[NULL]");
- return buff;
- }
-
- memset (&addr, 0, sizeof (struct Address));
- unpack_Address (&addr, remote->record, remote->length);
-
- g_snprintf (buff, 4096, "['%s' '%s' '%s']",
- addr.entry[entryLastname] ?
- addr.entry[entryLastname] : "",
- addr.entry[entryFirstname] ?
- addr.entry[entryFirstname] : "",
- addr.entry[entryCompany] ?
- addr.entry[entryCompany] : "");
-
- free_Address (&addr);
-
- return buff;
-}
-
-/* Utility routines */
-static char *
-map_name (EAddrConduitContext *ctxt)
-{
- char *filename = NULL;
-
- filename = g_strdup_printf ("%s/evolution/local/Contacts/pilot-map-%d.xml", g_get_home_dir (), ctxt->cfg->pilot_id);
-
- return filename;
-}
-
-static GList *
-next_changed_item (EAddrConduitContext *ctxt, GList *changes)
-{
- EBookChange *ebc;
- GList *l;
-
- for (l = changes; l != NULL; l = l->next) {
- ebc = l->data;
-
- if (g_hash_table_lookup (ctxt->changed_hash, e_contact_get_const (ebc->contact, E_CONTACT_UID)))
- return l;
- }
-
- return NULL;
-}
-
-static EContactField
-get_next_mail (EContactField *field)
-{
- if (field == NULL)
- return E_CONTACT_EMAIL;
-
- switch (*field) {
- case E_CONTACT_EMAIL:
- return E_CONTACT_EMAIL_2;
- case E_CONTACT_EMAIL_2:
- return E_CONTACT_EMAIL_3;
- default:
- }
-
- return E_CONTACT_FIELD_LAST;
-}
-
-static EContactField
-get_next_home (EContactField *field)
-{
- if (field == NULL)
- return E_CONTACT_PHONE_HOME;
-
- switch (*field) {
- case E_CONTACT_PHONE_HOME:
- return E_CONTACT_PHONE_HOME_2;
- default:
- }
-
- return E_CONTACT_FIELD_LAST;
-}
-
-static EContactField
-get_next_work (EContactField *field)
-{
- if (field == NULL)
- return E_CONTACT_PHONE_BUSINESS;
-
- switch (*field) {
- case E_CONTACT_PHONE_BUSINESS:
- return E_CONTACT_PHONE_BUSINESS_2;
- default:
- }
-
- return E_CONTACT_FIELD_LAST;
-}
-
-static EContactField
-get_next_fax (EContactField *field)
-{
- if (field == NULL)
- return E_CONTACT_PHONE_BUSINESS_FAX;
-
- switch (*field) {
- case E_CONTACT_PHONE_BUSINESS_FAX:
- return E_CONTACT_PHONE_HOME_FAX;
- case E_CONTACT_PHONE_HOME_FAX:
- return E_CONTACT_PHONE_OTHER_FAX;
- default:
- }
-
- return E_CONTACT_FIELD_LAST;
-}
-
-static EContactField
-get_next_other (EContactField *field)
-{
- if (field == NULL)
- return E_CONTACT_PHONE_OTHER;
-
- return E_CONTACT_FIELD_LAST;
-}
-
-static EContactField
-get_next_main (EContactField *field)
-{
- if (field == NULL)
- return E_CONTACT_PHONE_PRIMARY;
-
- return E_CONTACT_FIELD_LAST;
-}
-
-static EContactField
-get_next_pager (EContactField *field)
-{
- if (field == NULL)
- return E_CONTACT_PHONE_PAGER;
-
- return E_CONTACT_FIELD_LAST;
-}
-
-static EContactField
-get_next_mobile (EContactField *field)
-{
- if (field == NULL)
- return E_CONTACT_PHONE_MOBILE;
-
- return E_CONTACT_FIELD_LAST;
-}
-
-static void
-get_next_init (EContactField *next_mail,
- EContactField *next_home,
- EContactField *next_work,
- EContactField *next_fax,
- EContactField *next_other,
- EContactField *next_main,
- EContactField *next_pager,
- EContactField *next_mobile)
-{
- *next_mail = get_next_mail (NULL);
- *next_home = get_next_home (NULL);
- *next_work = get_next_work (NULL);
- *next_fax = get_next_fax (NULL);
- *next_other = get_next_other (NULL);
- *next_main = get_next_main (NULL);
- *next_pager = get_next_pager (NULL);
- *next_mobile = get_next_mobile (NULL);
-}
-
-static gboolean
-is_next_done (EContactField field)
-{
- if (field == E_CONTACT_FIELD_LAST)
- return TRUE;
-
- return FALSE;
-}
-
-static gboolean
-is_syncable (EAddrConduitContext *ctxt, EAddrLocalRecord *local)
-{
- EContactField next_mail, next_home, next_work, next_fax;
- EContactField next_other, next_main, next_pager, next_mobile;
- gboolean syncable = TRUE;
- int i, l = 0;
-
- /* See if there are fields we can't sync or not in priority order */
- get_next_init (&next_mail, &next_home, &next_work, &next_fax,
- &next_other, &next_main, &next_pager, &next_mobile);
-
- for (i = entryPhone1; i <= entryPhone5 && syncable; i++) {
- int phonelabel = local->addr->phoneLabel[i - entryPhone1];
- const char *phone_str = local->addr->entry[i];
- gboolean empty = !(phone_str && *phone_str);
-
- if (empty)
- continue;
-
- for ( ; priority_label[l] != -1; l++)
- if (phonelabel == priority_label[l])
- break;
-
- if (priority_label[l] == -1) {
- syncable = FALSE;
- continue;
- }
-
- if (phonelabel == LABEL_EMAIL) {
- if (is_next_done (next_mail) || next_mail != priority[l]) {
- syncable = FALSE;
- break;
- }
- next_mail = get_next_mail (&next_mail);
- } else if (phonelabel == LABEL_HOME) {
- if (is_next_done (next_home) || next_home != priority[l]) {
- syncable = FALSE;
- break;
- }
- next_home = get_next_home (&next_home);
- } else if (phonelabel == LABEL_WORK) {
- if (is_next_done (next_work) || next_work != priority[l]) {
- syncable = FALSE;
- break;
- }
- next_work = get_next_work (&next_work);
- } else if (phonelabel == LABEL_FAX) {
- if (is_next_done (next_fax) || next_fax != priority[l]) {
- syncable = FALSE;
- break;
- }
- next_fax = get_next_fax (&next_fax);
- } else if (phonelabel == LABEL_OTHER) {
- if (is_next_done (next_other) || next_other != priority[l]) {
- syncable = FALSE;
- break;
- }
- next_other = get_next_other (&next_other);
- } else if (phonelabel == LABEL_MAIN) {
- if (is_next_done (next_main) || next_main != priority[l]) {
- syncable = FALSE;
- break;
- }
- next_main = get_next_main (&next_main);
- } else if (phonelabel == LABEL_PAGER) {
- if (is_next_done (next_pager) || next_pager != priority[l]) {
- syncable = FALSE;
- break;
- }
- next_pager = get_next_pager (&next_pager);
- } else if (phonelabel == LABEL_MOBILE) {
- if (is_next_done (next_mobile) || next_mobile != priority[l]) {
- syncable = FALSE;
- break;
- }
- next_mobile = get_next_mobile (&next_mobile);
- }
- }
-
- return syncable;
-}
-
-static void
-set_contact_text (EContact *contact, EContactField field, struct Address address, int entry)
-{
- char *text = NULL;
-
- if (address.entry[entry])
- text = e_pilot_utf8_from_pchar (address.entry[entry]);
-
- e_contact_set (contact, field, text);
-
- g_free (text);
-}
-
-static char *
-get_entry_text (struct Address address, int entry)
-{
- if (address.entry[entry])
- return e_pilot_utf8_from_pchar (address.entry[entry]);
-
- return NULL;
-}
-
-static void
-clear_entry_text (struct Address address, int field)
-{
- if (address.entry[field]) {
- free (address.entry[field]);
- address.entry[field] = NULL;
- }
-}
-
-static void
-compute_status (EAddrConduitContext *ctxt, EAddrLocalRecord *local, const char *uid)
-{
- EBookChange *ebc;
-
- local->local.archived = FALSE;
- local->local.secret = FALSE;
-
- ebc = g_hash_table_lookup (ctxt->changed_hash, uid);
-
- if (ebc == NULL) {
- local->local.attr = GnomePilotRecordNothing;
- return;
- }
-
- switch (ebc->change_type) {
- case E_BOOK_CHANGE_CARD_ADDED:
- local->local.attr = GnomePilotRecordNew;
- break;
- case E_BOOK_CHANGE_CARD_MODIFIED:
- local->local.attr = GnomePilotRecordModified;
- break;
- case E_BOOK_CHANGE_CARD_DELETED:
- local->local.attr = GnomePilotRecordDeleted;
- break;
- }
-}
-
-static GnomePilotRecord
-local_record_to_pilot_record (EAddrLocalRecord *local,
- EAddrConduitContext *ctxt)
-{
- GnomePilotRecord p;
- static char record[0xffff];
-
- g_assert (local->addr != NULL );
-
- LOG (g_message ( "local_record_to_pilot_record\n" ));
-
- p.ID = local->local.ID;
- p.category = local->local.category;
- p.attr = local->local.attr;
- p.archived = local->local.archived;
- p.secret = local->local.secret;
-
- /* Generate pilot record structure */
- p.record = record;
- p.length = pack_Address (local->addr, p.record, 0xffff);
-
- return p;
-}
-
-static void
-local_record_from_ecard (EAddrLocalRecord *local, EContact *contact, EAddrConduitContext *ctxt)
-{
- const EContactAddress *address;
- EContactField mailing_address;
- int phone = entryPhone1;
-
- gboolean syncable;
- int i;
-
- g_return_if_fail (local != NULL);
- g_return_if_fail (contact != NULL);
-
- local->contact = g_object_ref (contact);
- local->local.ID = e_pilot_map_lookup_pid (ctxt->map, e_contact_get_const (contact, E_CONTACT_UID), TRUE);
-
- compute_status (ctxt, local, e_contact_get_const (contact, E_CONTACT_UID));
-
- local->addr = g_new0 (struct Address, 1);
-
- /* Handle the fields and category we don't sync by making sure
- * we don't overwrite them
- */
- if (local->local.ID != 0) {
- struct Address addr;
- char record[0xffff];
- int cat = 0;
-
- if (dlp_ReadRecordById (ctxt->dbi->pilot_socket,
- ctxt->dbi->db_handle,
- local->local.ID, &record,
- NULL, NULL, NULL, &cat) > 0) {
- local->local.category = cat;
- memset (&addr, 0, sizeof (struct Address));
- unpack_Address (&addr, record, 0xffff);
- for (i = 0; i < 5; i++) {
- if (addr.entry[entryPhone1 + i])
- local->addr->entry[entryPhone1 + i] =
- strdup (addr.entry[entryPhone1 + i]);
- local->addr->phoneLabel[i] = addr.phoneLabel[i];
- }
- local->addr->showPhone = addr.showPhone;
- for (i = 0; i < 4; i++) {
- if (addr.entry[entryCustom1 + i])
- local->addr->entry[entryCustom1 + i] =
- strdup (addr.entry[entryCustom1 + i]);
- }
- free_Address (&addr);
- }
- }
-
- local->addr->entry[entryFirstname] = e_pilot_utf8_to_pchar (e_contact_get_const (contact, E_CONTACT_GIVEN_NAME));
- local->addr->entry[entryLastname] = e_pilot_utf8_to_pchar (e_contact_get_const (contact, E_CONTACT_FAMILY_NAME));
- local->addr->entry[entryCompany] = e_pilot_utf8_to_pchar (e_contact_get_const (contact, E_CONTACT_ORG));
- local->addr->entry[entryTitle] = e_pilot_utf8_to_pchar (e_contact_get_const (contact, E_CONTACT_TITLE));
-
- /* See if the default has something in it */
- mailing_address = -1;
- if (e_contact_get_const (contact, ctxt->cfg->default_address))
- mailing_address = ctxt->cfg->default_address;
-
- /* If it doesn't, look for any address */
- if (mailing_address == -1) {
- for (i = E_CONTACT_FIRST_LABEL_ID; i < E_CONTACT_LAST_LABEL_ID; i++) {
- if (e_contact_get_const (contact, i)) {
- mailing_address = i;
- break;
- }
- }
- }
-
- /* If all else fails, use the default */
- if (mailing_address == -1)
- mailing_address = ctxt->cfg->default_address;
-
- address = e_contact_get_const (contact, mailing_address);
- if (address) {
- char *add;
-
- /* If the address has 2 lines, make sure both get added */
- if (address->ext != NULL)
- add = g_strconcat (address->street, "\n", address->ext, NULL);
- else
- add = g_strdup (address->street);
- local->addr->entry[entryAddress] = e_pilot_utf8_to_pchar (add);
- g_free (add);
-
- local->addr->entry[entryCity] = e_pilot_utf8_to_pchar (address->locality);
- local->addr->entry[entryState] = e_pilot_utf8_to_pchar (address->region);
- local->addr->entry[entryZip] = e_pilot_utf8_to_pchar (address->code);
- local->addr->entry[entryCountry] = e_pilot_utf8_to_pchar (address->country);
- }
-
- /* Phone numbers */
-
- /* See if everything is syncable */
- syncable = is_syncable (ctxt, local);
-
- if (syncable) {
- INFO ("Syncable");
-
- /* Sync by priority */
- for (i = 0, phone = entryPhone1;
- priority[i] != E_CONTACT_FIELD_LAST && phone <= entryPhone5; i++) {
- const char *phone_str;
-
- phone_str = e_contact_get_const (contact, priority[i]);
- if (phone_str && *phone_str) {
- clear_entry_text (*local->addr, phone);
- local->addr->entry[phone] = e_pilot_utf8_to_pchar (phone_str);
- local->addr->phoneLabel[phone - entryPhone1] = priority_label[i];
- phone++;
- }
- }
- for ( ; phone <= entryPhone5; phone++)
- local->addr->phoneLabel[phone - entryPhone1] = phone - entryPhone1;
- local->addr->showPhone = 0;
- } else {
- EContactField next_mail, next_home, next_work, next_fax;
- EContactField next_other, next_main, next_pager, next_mobile;
-
- INFO ("Not Syncable");
- get_next_init (&next_mail, &next_home, &next_work, &next_fax,
- &next_other, &next_main, &next_pager, &next_mobile);
-
- /* Not completely syncable, so do the best we can */
- for (i = entryPhone1; i <= entryPhone5; i++) {
- int phonelabel = local->addr->phoneLabel[i - entryPhone1];
- const char *phone_str = NULL;
-
- if (phonelabel == LABEL_EMAIL && !is_next_done (next_mail)) {
- phone_str = e_contact_get_const (contact, next_mail);
- next_mail = get_next_mail (&next_mail);
- } else if (phonelabel == LABEL_HOME && !is_next_done (next_home)) {
- phone_str = e_contact_get_const (contact, next_home);
- next_home = get_next_home (&next_home);
- } else if (phonelabel == LABEL_WORK && !is_next_done (next_work)) {
- phone_str = e_contact_get_const (contact, next_work);
- next_work = get_next_work (&next_work);
- } else if (phonelabel == LABEL_FAX && !is_next_done (next_fax)) {
- phone_str = e_contact_get_const (contact, next_fax);
- next_fax = get_next_fax (&next_fax);
- } else if (phonelabel == LABEL_OTHER && !is_next_done (next_other)) {
- phone_str = e_contact_get_const (contact, next_other);
- next_other = get_next_other (&next_other);
- } else if (phonelabel == LABEL_MAIN && !is_next_done (next_main)) {
- phone_str = e_contact_get_const (contact, next_main);
- next_main = get_next_main (&next_main);
- } else if (phonelabel == LABEL_PAGER && !is_next_done (next_pager)) {
- phone_str = e_contact_get_const (contact, next_pager);
- next_pager = get_next_pager (&next_pager);
- } else if (phonelabel == LABEL_MOBILE && !is_next_done (next_mobile)) {
- phone_str = e_contact_get_const (contact, next_mobile);
- next_mobile = get_next_mobile (&next_mobile);
- }
-
- if (phone_str && *phone_str) {
- clear_entry_text (*local->addr, i);
- local->addr->entry[i] = e_pilot_utf8_to_pchar (phone_str);
- }
- }
- }
-
- /* Note */
- local->addr->entry[entryNote] = e_pilot_utf8_to_pchar (e_contact_get_const (contact, E_CONTACT_NOTE));
-}
-
-static void
-local_record_from_uid (EAddrLocalRecord *local,
- const char *uid,
- EAddrConduitContext *ctxt)
-{
- EContact *contact = NULL;
- GList *l;
-
- g_assert (local != NULL);
-
- for (l = ctxt->cards; l != NULL; l = l->next) {
- contact = l->data;
-
- /* FIXME Do we need to check for the empty string? */
- if (e_contact_get_const (contact, E_CONTACT_UID));
- break;
-
- contact = NULL;
- }
-
- if (contact != NULL) {
- local_record_from_ecard (local, contact, ctxt);
- } else {
- contact = e_contact_new ();
- e_contact_set (contact, E_CONTACT_UID, (gpointer) uid);
- local_record_from_ecard (local, contact, ctxt);
- g_object_unref (contact);
- }
-}
-
-static EContact *
-ecard_from_remote_record(EAddrConduitContext *ctxt,
- GnomePilotRecord *remote,
- EContact *in_contact)
-{
- struct Address address;
- EContact *contact;
- EContactName *name;
- EContactAddress *eaddress;
- EContactField mailing_address;
- char *txt, *find;
- EContactField next_mail, next_home, next_work, next_fax;
- EContactField next_other, next_main, next_pager, next_mobile;
- int i;
-
- g_return_val_if_fail(remote!=NULL,NULL);
- memset (&address, 0, sizeof (struct Address));
- unpack_Address (&address, remote->record, remote->length);
-
- if (in_contact == NULL)
- contact = e_contact_new ();
- else
- contact = e_contact_duplicate (in_contact);
-
- /* Name */
- name = e_contact_name_new ();
- name->given = get_entry_text (address, entryFirstname);
- name->family = get_entry_text (address, entryLastname);
-
- e_contact_set (contact, E_CONTACT_NAME, name);
- e_contact_name_free (name);
-
- /* File as */
- if (!e_contact_get_const (contact, E_CONTACT_FULL_NAME))
- set_contact_text (contact, E_CONTACT_FILE_AS, address, entryCompany);
-
- /* Title and Company */
- set_contact_text (contact, E_CONTACT_TITLE, address, entryTitle);
- set_contact_text (contact, E_CONTACT_ORG, address, entryCompany);
-
- /* Address */
- mailing_address = -1;
- if (e_contact_get_const (contact, ctxt->cfg->default_address))
- mailing_address = ctxt->cfg->default_address;
-
- if (mailing_address == -1) {
- for (i = E_CONTACT_FIRST_LABEL_ID; i < E_CONTACT_LAST_LABEL_ID; i++) {
- if (e_contact_get_const (contact, i)) {
- mailing_address = i;
- break;
- }
- }
- }
-
- if (mailing_address == -1)
- mailing_address = ctxt->cfg->default_address;
-
- eaddress = g_new0 (EContactAddress, 1);
-
- txt = get_entry_text (address, entryAddress);
- if ((find = strchr (txt, '\n')) != NULL) {
- *find = '\0';
- find++;
- }
- eaddress->street = txt;
- eaddress->ext = find != NULL ? g_strdup (find) : g_strdup ("");
- eaddress->locality = get_entry_text (address, entryCity);
- eaddress->region = get_entry_text (address, entryState);
- eaddress->country = get_entry_text (address, entryCountry);
- eaddress->code = get_entry_text (address, entryZip);
-
- e_contact_set (contact, mailing_address, eaddress);
- e_contact_address_free (eaddress);
-
- /* Phone numbers */
- get_next_init (&next_mail, &next_home, &next_work, &next_fax,
- &next_other, &next_main, &next_pager, &next_mobile);
-
- for (i = entryPhone1; i <= entryPhone5; i++) {
- int phonelabel = address.phoneLabel[i - entryPhone1];
- char *phonenum = get_entry_text (address, i);
-
- if (phonelabel == LABEL_EMAIL && !is_next_done (next_mail)) {
- e_contact_set (contact, next_mail, phonenum);
- next_mail = get_next_mail (&next_mail);
- } else if (phonelabel == LABEL_HOME && !is_next_done (next_home)) {
- e_contact_set (contact, next_home, phonenum);
- next_home = get_next_home (&next_home);
- } else if (phonelabel == LABEL_WORK && !is_next_done (next_work)) {
- e_contact_set (contact, next_work, phonenum);
- next_work = get_next_work (&next_work);
- } else if (phonelabel == LABEL_FAX && !is_next_done (next_fax)) {
- e_contact_set (contact, next_fax, phonenum);
- next_fax = get_next_fax (&next_fax);
- } else if (phonelabel == LABEL_OTHER && !is_next_done (next_other)) {
- e_contact_set (contact, next_other, phonenum);
- next_other = get_next_other (&next_other);
- } else if (phonelabel == LABEL_MAIN && !is_next_done (next_main)) {
- e_contact_set (contact, next_main, phonenum);
- next_main = get_next_main (&next_main);
- } else if (phonelabel == LABEL_PAGER && !is_next_done (next_pager)) {
- e_contact_set (contact, next_pager, phonenum);
- next_pager = get_next_pager (&next_pager);
- } else if (phonelabel == LABEL_MOBILE && !is_next_done (next_mobile)) {
- e_contact_set (contact, next_mobile, phonenum);
- next_mobile = get_next_mobile (&next_mobile);
- }
-
- g_free (phonenum);
- }
-
- /* Note */
- set_contact_text (contact, E_CONTACT_NOTE, address, entryNote);
-
- free_Address(&address);
-
- return contact;
-}
-
-static void
-check_for_slow_setting (GnomePilotConduit *c, EAddrConduitContext *ctxt)
-{
- GnomePilotConduitStandard *conduit = GNOME_PILOT_CONDUIT_STANDARD (c);
- int map_count;
- const char *uri;
-
- map_count = g_hash_table_size (ctxt->map->pid_map);
- if (map_count == 0)
- gnome_pilot_conduit_standard_set_slow (conduit, TRUE);
-
- /* Or if the URI's don't match */
- uri = e_book_get_uri (ctxt->ebook);
- LOG (g_message (" Current URI %s (%s)\n", uri, ctxt->cfg->last_uri ? ctxt->cfg->last_uri : "<NONE>"));
- if (ctxt->cfg->last_uri != NULL && strcmp (ctxt->cfg->last_uri, uri)) {
- gnome_pilot_conduit_standard_set_slow (conduit, TRUE);
- e_pilot_map_clear (ctxt->map);
- }
-
- if (gnome_pilot_conduit_standard_get_slow (conduit)) {
- ctxt->map->write_touched_only = TRUE;
- LOG (g_message ( " doing slow sync\n" ));
- } else {
- LOG (g_message ( " doing fast sync\n" ));
- }
-}
-
-/* Pilot syncing callbacks */
-static gint
-pre_sync (GnomePilotConduit *conduit,
- GnomePilotDBInfo *dbi,
- EAddrConduitContext *ctxt)
-{
- GnomePilotConduitSyncAbs *abs_conduit;
- EBookQuery *query;
- GList *l;
- int len;
- unsigned char *buf;
- char *filename;
- char *change_id;
- gint num_records, add_records = 0, mod_records = 0, del_records = 0;
-
- abs_conduit = GNOME_PILOT_CONDUIT_SYNC_ABS (conduit);
-
- LOG (g_message ( "---------------------------------------------------------\n" ));
- LOG (g_message ( "pre_sync: Addressbook Conduit v.%s", CONDUIT_VERSION ));
- /* g_message ("Addressbook Conduit v.%s", CONDUIT_VERSION); */
-
- ctxt->dbi = dbi;
-
- /* FIXME Need to allow our own concept of "local" */
- ctxt->ebook = e_book_new ();
- if (!e_book_load_local_addressbook (ctxt->ebook, NULL)) {
- WARN(_("Could not load addressbook"));
- gnome_pilot_conduit_error (conduit, _("Could not load addressbook"));
-
- return -1;
- }
-
- /* Load the uid <--> pilot id mappings */
- filename = map_name (ctxt);
- e_pilot_map_read (filename, &ctxt->map);
- g_free (filename);
-
- /* Get a list of all contacts */
- query = e_book_query_from_string ("#t");
- if (!e_book_get_contacts (ctxt->ebook, query, &ctxt->cards, NULL)) {
- g_object_unref (query);
-
- return -1;
- }
- g_object_unref (query);
-
- /* Count and hash the changes */
- change_id = g_strdup_printf ("pilot-sync-evolution-addressbook-%d", ctxt->cfg->pilot_id);
- if (!e_book_get_changes (ctxt->ebook, change_id, &ctxt->changed, NULL))
- return -1;
- ctxt->changed_hash = g_hash_table_new (g_str_hash, g_str_equal);
- g_free (change_id);
-
- for (l = ctxt->changed; l != NULL; l = l->next) {
- EBookChange *ebc = l->data;
- const char *uid;
-
- uid = e_contact_get_const (ebc->contact, E_CONTACT_UID);
- if (!e_pilot_map_uid_is_archived (ctxt->map, uid)) {
-
- g_hash_table_insert (ctxt->changed_hash, g_strdup (uid), ebc);
-
- switch (ebc->change_type) {
- case E_BOOK_CHANGE_CARD_ADDED:
- add_records++;
- break;
- case E_BOOK_CHANGE_CARD_MODIFIED:
- mod_records++;
- break;
- case E_BOOK_CHANGE_CARD_DELETED:
- del_records++;
- break;
- }
- } else if (ebc->change_type == E_BOOK_CHANGE_CARD_DELETED) {
- e_pilot_map_remove_by_uid (ctxt->map, uid);
- }
- }
-
- /* Set the count information */
- num_records = g_list_length (ctxt->cards);
- gnome_pilot_conduit_sync_abs_set_num_local_records(abs_conduit, num_records);
- gnome_pilot_conduit_sync_abs_set_num_new_local_records (abs_conduit, add_records);
- gnome_pilot_conduit_sync_abs_set_num_updated_local_records (abs_conduit, mod_records);
- gnome_pilot_conduit_sync_abs_set_num_deleted_local_records(abs_conduit, del_records);
-
- buf = (unsigned char*)g_malloc (0xffff);
- len = dlp_ReadAppBlock (dbi->pilot_socket, dbi->db_handle, 0,
- (unsigned char *)buf, 0xffff);
-
- if (len < 0) {
- WARN (_("Could not read pilot's Address application block"));
- WARN ("dlp_ReadAppBlock(...) = %d", len);
- gnome_pilot_conduit_error (conduit,
- _("Could not read pilot's Address application block"));
- return -1;
- }
- unpack_AddressAppInfo (&(ctxt->ai), buf, len);
- g_free (buf);
-
- check_for_slow_setting (conduit, ctxt);
- if (ctxt->cfg->sync_type == GnomePilotConduitSyncTypeCopyToPilot
- || ctxt->cfg->sync_type == GnomePilotConduitSyncTypeCopyFromPilot)
- ctxt->map->write_touched_only = TRUE;
-
- return 0;
-}
-
-static gint
-post_sync (GnomePilotConduit *conduit,
- GnomePilotDBInfo *dbi,
- EAddrConduitContext *ctxt)
-{
- GList *changed;
- gchar *filename, *change_id;
-
- LOG (g_message ( "post_sync: Address Conduit v.%s", CONDUIT_VERSION ));
-
- g_free (ctxt->cfg->last_uri);
- ctxt->cfg->last_uri = g_strdup (e_book_get_uri (ctxt->ebook));
- addrconduit_save_configuration (ctxt->cfg);
-
- filename = map_name (ctxt);
- e_pilot_map_write (filename, ctxt->map);
- g_free (filename);
-
- /* FIX ME ugly hack - our changes musn't count, this does introduce
- * a race condition if anyone changes a record elsewhere during sycnc
- */
- change_id = g_strdup_printf ("pilot-sync-evolution-addressbook-%d", ctxt->cfg->pilot_id);
- if (e_book_get_changes (ctxt->ebook, change_id, &changed, NULL))
- e_book_free_change_list (changed);
- g_free (change_id);
-
- LOG (g_message ( "---------------------------------------------------------\n" ));
-
- return 0;
-}
-
-static gint
-set_pilot_id (GnomePilotConduitSyncAbs *conduit,
- EAddrLocalRecord *local,
- guint32 ID,
- EAddrConduitContext *ctxt)
-{
- LOG (g_message ( "set_pilot_id: setting to %d\n", ID ));
-
- e_pilot_map_insert (ctxt->map, ID, e_contact_get_const (local->contact, E_CONTACT_UID), FALSE);
-
- return 0;
-}
-
-static gint
-set_status_cleared (GnomePilotConduitSyncAbs *conduit,
- EAddrLocalRecord *local,
- EAddrConduitContext *ctxt)
-{
- LOG (g_message ( "set_status_cleared: clearing status\n" ));
-
- g_hash_table_remove (ctxt->changed_hash, e_contact_get_const (local->contact, E_CONTACT_UID));
-
- return 0;
-}
-
-static gint
-for_each (GnomePilotConduitSyncAbs *conduit,
- EAddrLocalRecord **local,
- EAddrConduitContext *ctxt)
-{
- static GList *cards, *iterator;
- static int count;
-
- g_return_val_if_fail (local != NULL, -1);
-
- if (*local == NULL) {
- LOG (g_message ( "beginning for_each" ));
-
- cards = ctxt->cards;
- count = 0;
-
- if (cards != NULL) {
- LOG (g_message ( "iterating over %d records", g_list_length (cards) ));
-
- *local = g_new0 (EAddrLocalRecord, 1);
- local_record_from_ecard (*local, cards->data, ctxt);
- g_list_prepend (ctxt->locals, *local);
-
- iterator = cards;
- } else {
- LOG (g_message ( "no events" ));
- (*local) = NULL;
- return 0;
- }
- } else {
- count++;
- if (g_list_next (iterator)) {
- iterator = g_list_next (iterator);
-
- *local = g_new0 (EAddrLocalRecord, 1);
- local_record_from_ecard (*local, iterator->data, ctxt);
- g_list_prepend (ctxt->locals, *local);
- } else {
- LOG (g_message ( "for_each ending" ));
-
- /* Tell the pilot the iteration is over */
- *local = NULL;
-
- return 0;
- }
- }
-
- return 0;
-}
-
-static gint
-for_each_modified (GnomePilotConduitSyncAbs *conduit,
- EAddrLocalRecord **local,
- EAddrConduitContext *ctxt)
-{
- static GList *iterator;
- static int count;
-
- g_return_val_if_fail (local != NULL, 0);
-
- if (*local == NULL) {
- LOG (g_message ( "for_each_modified beginning\n" ));
-
- iterator = ctxt->changed;
-
- count = 0;
-
- iterator = next_changed_item (ctxt, iterator);
- if (iterator != NULL) {
- EBookChange *ebc = iterator->data;
-
- LOG (g_message ( "iterating over %d records", g_hash_table_size (ctxt->changed_hash)));
-
- *local = g_new0 (EAddrLocalRecord, 1);
- local_record_from_ecard (*local, ebc->contact, ctxt);
- g_list_prepend (ctxt->locals, *local);
- } else {
- LOG (g_message ( "no events" ));
-
- *local = NULL;
- }
- } else {
- count++;
- iterator = g_list_next (iterator);
- if (iterator && (iterator = next_changed_item (ctxt, iterator))) {
- EBookChange *ebc = iterator->data;
-
- *local = g_new0 (EAddrLocalRecord, 1);
- local_record_from_ecard (*local, ebc->contact, ctxt);
- g_list_prepend (ctxt->locals, *local);
- } else {
- LOG (g_message ( "for_each_modified ending" ));
-
- /* Signal the iteration is over */
- *local = NULL;
-
- return 0;
- }
- }
-
- return 0;
-}
-
-static gint
-compare (GnomePilotConduitSyncAbs *conduit,
- EAddrLocalRecord *local,
- GnomePilotRecord *remote,
- EAddrConduitContext *ctxt)
-{
- GnomePilotRecord local_pilot;
- int retval = 0;
-
- LOG (g_message ("compare: local=%s remote=%s...\n",
- print_local (local), print_remote (remote)));
-
- g_return_val_if_fail (local != NULL, -1);
- g_return_val_if_fail (remote != NULL, -1);
-
- local_pilot = local_record_to_pilot_record (local, ctxt);
-
- if (remote->length != local_pilot.length
- || memcmp (local_pilot.record, remote->record, remote->length))
- retval = 1;
-
- if (retval == 0)
- LOG (g_message ( " equal" ));
- else
- LOG (g_message ( " not equal" ));
-
- return retval;
-}
-
-static gint
-add_record (GnomePilotConduitSyncAbs *conduit,
- GnomePilotRecord *remote,
- EAddrConduitContext *ctxt)
-{
- EContact *contact;
- int retval = 0;
-
- g_return_val_if_fail (remote != NULL, -1);
-
- LOG (g_message ( "add_record: adding %s to desktop\n", print_remote (remote) ));
-
- contact = ecard_from_remote_record (ctxt, remote, NULL);
-
- /* add the ecard to the server */
- if (!e_book_add_contact (ctxt->ebook, contact, NULL)) {
- WARN ("add_record: failed to add card to ebook\n");
- g_object_unref (contact);
-
- return -1;
- }
-
- e_pilot_map_insert (ctxt->map, remote->ID, e_contact_get (contact, E_CONTACT_UID), FALSE);
-
- g_object_unref (contact);
-
- return retval;
-}
-
-static gint
-replace_record (GnomePilotConduitSyncAbs *conduit,
- EAddrLocalRecord *local,
- GnomePilotRecord *remote,
- EAddrConduitContext *ctxt)
-{
- EContact *new_contact;
- EBookChange *ebc;
- char *old_id;
- int retval = 0;
-
- g_return_val_if_fail (remote != NULL, -1);
-
- LOG (g_message ("replace_record: replace %s with %s\n",
- print_local (local), print_remote (remote)));
-
- old_id = e_contact_get (local->contact, E_CONTACT_UID);
- ebc = g_hash_table_lookup (ctxt->changed_hash, old_id);
-
- new_contact = ecard_from_remote_record (ctxt, remote, local->contact);
- g_object_unref (local->contact);
- local->contact = new_contact;
-
- if (ebc && ebc->change_type == E_BOOK_CHANGE_CARD_DELETED) {
- if (!e_book_add_contact (ctxt->ebook, local->contact, NULL)) {
- WARN (G_STRLOC ": failed to add card\n");
-
- return -1;
- }
-
- } else {
- if (!e_book_commit_contact (ctxt->ebook, local->contact, NULL)) {
- WARN (G_STRLOC ": failed to commit card\n");
-
- return -1;
- }
- }
-
- /* Adding a record causes wombat to assign a new uid so we must tidy */
- if (ebc && ebc->change_type == E_BOOK_CHANGE_CARD_DELETED) {
- const char *uid = e_contact_get_const (local->contact, E_CONTACT_UID);
- gboolean arch;
-
- arch = e_pilot_map_uid_is_archived (ctxt->map, uid);
- e_pilot_map_insert (ctxt->map, remote->ID, uid, arch);
-
- ebc = g_hash_table_lookup (ctxt->changed_hash, old_id);
- if (ebc) {
- g_hash_table_remove (ctxt->changed_hash, old_id);
- g_object_unref (ebc->contact);
- g_object_ref (local->contact);
- ebc->contact = local->contact;
- /* FIXME We should possibly be duplicating the uid */
- g_hash_table_insert (ctxt->changed_hash, (gpointer) uid, ebc);
- }
- }
-
- return retval;
-}
-
-static gint
-delete_record (GnomePilotConduitSyncAbs *conduit,
- EAddrLocalRecord *local,
- EAddrConduitContext *ctxt)
-{
- int retval = 0;
-
- g_return_val_if_fail (local != NULL, -1);
- g_return_val_if_fail (local->contact != NULL, -1);
-
- LOG (g_message ( "delete_record: delete %s\n", print_local (local) ));
-
- e_pilot_map_remove_by_uid (ctxt->map, e_contact_get_const (local->contact, E_CONTACT_UID));
- if (!e_book_remove_contact (ctxt->ebook, e_contact_get_const (local->contact, E_CONTACT_UID), NULL)) {
- WARN ("delete_record: failed to delete card in ebook\n");
-
- retval = -1;
- }
-
- return retval;
-}
-
-static gint
-archive_record (GnomePilotConduitSyncAbs *conduit,
- EAddrLocalRecord *local,
- gboolean archive,
- EAddrConduitContext *ctxt)
-{
- int retval = 0;
-
- g_return_val_if_fail (local != NULL, -1);
-
- LOG (g_message ( "archive_record: %s\n", archive ? "yes" : "no" ));
-
- e_pilot_map_insert (ctxt->map, local->local.ID, e_contact_get_const (local->contact, E_CONTACT_UID), archive);
-
- return retval;
-}
-
-static gint
-match (GnomePilotConduitSyncAbs *conduit,
- GnomePilotRecord *remote,
- EAddrLocalRecord **local,
- EAddrConduitContext *ctxt)
-{
- const char *uid;
-
- LOG (g_message ("match: looking for local copy of %s\n",
- print_remote (remote)));
-
- g_return_val_if_fail (local != NULL, -1);
- g_return_val_if_fail (remote != NULL, -1);
-
- *local = NULL;
- uid = e_pilot_map_lookup_uid (ctxt->map, remote->ID, TRUE);
-
- if (!uid)
- return 0;
-
- LOG (g_message ( " matched\n" ));
-
- *local = g_new0 (EAddrLocalRecord, 1);
- local_record_from_uid (*local, uid, ctxt);
-
- return 0;
-}
-
-static gint
-free_match (GnomePilotConduitSyncAbs *conduit,
- EAddrLocalRecord *local,
- EAddrConduitContext *ctxt)
-{
- LOG (g_message ( "free_match: freeing\n" ));
-
- g_return_val_if_fail (local != NULL, -1);
-
- addrconduit_destroy_record (local);
-
- return 0;
-}
-
-static gint
-prepare (GnomePilotConduitSyncAbs *conduit,
- EAddrLocalRecord *local,
- GnomePilotRecord *remote,
- EAddrConduitContext *ctxt)
-{
- LOG (g_message ( "prepare: encoding local %s\n", print_local (local) ));
-
- *remote = local_record_to_pilot_record (local, ctxt);
-
- return 0;
-}
-
-/* Pilot Settings Callbacks */
-static void
-fill_widgets (EAddrConduitContext *ctxt)
-{
- e_pilot_settings_set_secret (E_PILOT_SETTINGS (ctxt->ps),
- ctxt->cfg->secret);
-
- e_addr_gui_fill_widgets (ctxt->gui, ctxt->cfg);
-}
-
-static gint
-create_settings_window (GnomePilotConduit *conduit,
- GtkWidget *parent,
- EAddrConduitContext *ctxt)
-{
- LOG (g_message ( "create_settings_window" ));
-
- ctxt->ps = e_pilot_settings_new ();
- ctxt->gui = e_addr_gui_new (E_PILOT_SETTINGS (ctxt->ps));
-
- gtk_container_add (GTK_CONTAINER (parent), ctxt->ps);
- gtk_widget_show (ctxt->ps);
-
- fill_widgets (ctxt);
-
- return 0;
-}
-static void
-display_settings (GnomePilotConduit *conduit, EAddrConduitContext *ctxt)
-{
- LOG (g_message ( "display_settings" ));
-
- fill_widgets (ctxt);
-}
-
-static void
-save_settings (GnomePilotConduit *conduit, EAddrConduitContext *ctxt)
-{
- LOG (g_message ( "save_settings" ));
-
- ctxt->new_cfg->secret =
- e_pilot_settings_get_secret (E_PILOT_SETTINGS (ctxt->ps));
- e_addr_gui_fill_config (ctxt->gui, ctxt->new_cfg);
-
- addrconduit_save_configuration (ctxt->new_cfg);
-}
-
-static void
-revert_settings (GnomePilotConduit *conduit, EAddrConduitContext *ctxt)
-{
- LOG (g_message ( "revert_settings" ));
-
- addrconduit_save_configuration (ctxt->cfg);
- addrconduit_destroy_configuration (ctxt->new_cfg);
- ctxt->new_cfg = addrconduit_dupe_configuration (ctxt->cfg);
-}
-
-GnomePilotConduit *
-conduit_get_gpilot_conduit (guint32 pilot_id)
-{
- GtkObject *retval;
- EAddrConduitContext *ctxt;
-
- LOG (g_message ( "in address's conduit_get_gpilot_conduit\n" ));
-
- retval = gnome_pilot_conduit_sync_abs_new ("AddressDB", 0x61646472);
- g_assert (retval != NULL);
-
- ctxt = e_addr_context_new (pilot_id);
- gtk_object_set_data (GTK_OBJECT (retval), "addrconduit_context", ctxt);
-
- gtk_signal_connect (retval, "pre_sync", (GtkSignalFunc) pre_sync, ctxt);
- gtk_signal_connect (retval, "post_sync", (GtkSignalFunc) post_sync, ctxt);
-
- gtk_signal_connect (retval, "set_pilot_id", (GtkSignalFunc) set_pilot_id, ctxt);
- gtk_signal_connect (retval, "set_status_cleared", (GtkSignalFunc) set_status_cleared, ctxt);
-
- gtk_signal_connect (retval, "for_each", (GtkSignalFunc) for_each, ctxt);
- gtk_signal_connect (retval, "for_each_modified", (GtkSignalFunc) for_each_modified, ctxt);
- gtk_signal_connect (retval, "compare", (GtkSignalFunc) compare, ctxt);
-
- gtk_signal_connect (retval, "add_record", (GtkSignalFunc) add_record, ctxt);
- gtk_signal_connect (retval, "replace_record", (GtkSignalFunc) replace_record, ctxt);
- gtk_signal_connect (retval, "delete_record", (GtkSignalFunc) delete_record, ctxt);
- gtk_signal_connect (retval, "archive_record", (GtkSignalFunc) archive_record, ctxt);
-
- gtk_signal_connect (retval, "match", (GtkSignalFunc) match, ctxt);
- gtk_signal_connect (retval, "free_match", (GtkSignalFunc) free_match, ctxt);
-
- gtk_signal_connect (retval, "prepare", (GtkSignalFunc) prepare, ctxt);
-
- /* Gui Settings */
- gtk_signal_connect (retval, "create_settings_window", (GtkSignalFunc) create_settings_window, ctxt);
- gtk_signal_connect (retval, "display_settings", (GtkSignalFunc) display_settings, ctxt);
- gtk_signal_connect (retval, "save_settings", (GtkSignalFunc) save_settings, ctxt);
- gtk_signal_connect (retval, "revert_settings", (GtkSignalFunc) revert_settings, ctxt);
-
- return GNOME_PILOT_CONDUIT (retval);
-}
-
-void
-conduit_destroy_gpilot_conduit (GnomePilotConduit *conduit)
-{
- EAddrConduitContext *ctxt;
-
- ctxt = gtk_object_get_data (GTK_OBJECT (conduit),
- "addrconduit_context");
-
- e_addr_context_destroy (ctxt);
-
- gtk_object_destroy (GTK_OBJECT (conduit));
-}
diff --git a/addressbook/conduit/e-address.conduit.in b/addressbook/conduit/e-address.conduit.in
deleted file mode 100644
index 669a506001..0000000000
--- a/addressbook/conduit/e-address.conduit.in
+++ /dev/null
@@ -1,9 +0,0 @@
-<gnome-pilot-conduit version="1.0">
- <conduit id="e_address_conduit" type="shlib" location="@privconduitdir@/libeaddress_conduit.so"/>
- <name value="EAddress"/>
- <conduit-attribute name="description" value="Synchronizes Addressbook with Evolution"/>
- <conduit-attribute name="default-synctype" value="synchronize"/>
- <conduit-attribute name="valid-synctypes" value="synchronize copy_from_pilot copy_to_pilot"/>
- <conduit-attribute name="settings" value="TRUE"/>
- <conduit-attribute name="icon" value="@datadir@/images/evolution/conduits/48_evo-address-conduit.png"/>
-</gnome-pilot-conduit>
diff --git a/addressbook/gui/.cvsignore b/addressbook/gui/.cvsignore
deleted file mode 100644
index 09980ae6ba..0000000000
--- a/addressbook/gui/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-.deps
-.libs
-Makefile
-Makefile.in
-*.lo
-*.la
diff --git a/addressbook/gui/Makefile.am b/addressbook/gui/Makefile.am
deleted file mode 100644
index 6b0850da5d..0000000000
--- a/addressbook/gui/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = contact-editor contact-list-editor merging widgets search component
diff --git a/addressbook/gui/component/.cvsignore b/addressbook/gui/component/.cvsignore
deleted file mode 100644
index 5639d4fc22..0000000000
--- a/addressbook/gui/component/.cvsignore
+++ /dev/null
@@ -1,14 +0,0 @@
-.deps
-.libs
-.pure
-Makefile
-Makefile.in
-*.lo
-*.la
-evolution-addressbook
-evolution-addressbook.pure
-test-addressbook
-GNOME_Evolution_Addressbook*.server
-GNOME_Evolution_Addressbook*.server.in
-addressbook-marshal.c
-addressbook-marshal.h
diff --git a/addressbook/gui/component/GNOME_Evolution_Addressbook.server.in.in b/addressbook/gui/component/GNOME_Evolution_Addressbook.server.in.in
deleted file mode 100644
index fb55b0df58..0000000000
--- a/addressbook/gui/component/GNOME_Evolution_Addressbook.server.in.in
+++ /dev/null
@@ -1,143 +0,0 @@
-<oaf_info>
-
-<oaf_server iid="OAFIID:GNOME_Evolution_Addressbook_Factory:@VERSION@"
- type="shlib"
- location="@COMPONENTDIR@/libevolution-addressbook.so">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/ObjectFactory:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="name" type="string"
- _value="Evolution Addressbook"/>
-
-</oaf_server>
-
-<oaf_server iid="OAFIID:GNOME_Evolution_Addressbook_VCard_Control:@VERSION@"
- type="factory"
- location="OAFIID:GNOME_Evolution_Addressbook_Factory:@VERSION@">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:Bonobo/Control:1.0"/>
- <item value="IDL:Bonobo/PersistStream:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="bonobo:supported_mime_types" type="stringv">
- <item value="text/vcard"/>
- <item value="text/x-vcard"/>
- </oaf_attribute>
-
- <oaf_attribute name="name" type="string"
- _value="Evolution Addressbook card viewer"/>
-
-</oaf_server>
-
-<oaf_server iid="OAFIID:GNOME_Evolution_Addressbook_Control:@VERSION@"
- type="factory"
- location="OAFIID:GNOME_Evolution_Addressbook_Factory:@VERSION@">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:BonoboControl/addressbook-control:@VERSION@"/>
- <item value="IDL:GNOME/Control:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="name" type="string"
- _value="Evolution Addressbook folder viewer"/>
-
-</oaf_server>
-
-<oaf_server iid="OAFIID:GNOME_Evolution_Addressbook_Component:@VERSION@"
- type="factory"
- location="OAFIID:GNOME_Evolution_Addressbook_Factory:@VERSION@">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/Evolution/Component:@VERSION@"/>
- </oaf_attribute>
-
- <oaf_attribute name="name" type="string"
- _value="Evolution Addressbook component"/>
-
- <oaf_attribute name="evolution:component_alias" type="string" value="contacts"/>
-
- <oaf_attribute name="evolution:button_label" type="string" _value="Contacts"/>
- <oaf_attribute name="evolution:button_sort_order" type="string" value="-9"/>
- <oaf_attribute name="evolution:button_icon" type="string" value="evolution-contacts.png"/>
-
-</oaf_server>
-
-<oaf_server iid="OAFIID:GNOME_Evolution_Addressbook_AddressWidget:@VERSION@"
- type="factory"
- location="OAFIID:GNOME_Evolution_Addressbook_Factory:@VERSION@">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:BonoboControl/address-widget:@VERSION@"/>
- <item value="IDL:GNOME/Control:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="name" type="string"
- _value="Evolution Addressbook address viewer"/>
-
-</oaf_server>
-
-<oaf_server iid="OAFIID:GNOME_Evolution_Addressbook_AddressPopup:@VERSION@"
- type="factory"
- location="OAFIID:GNOME_Evolution_Addressbook_Factory:@VERSION@">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:BonoboControl/address-widget:@VERSION@"/>
- <item value="IDL:GNOME/Control:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="name" type="string"
- _value="Evolution Addressbook address pop-up"/>
-
-</oaf_server>
-
-<oaf_server iid="OAFIID:GNOME_Evolution_SMime_CertificateManager_ConfigControl:@VERSION@"
- type="factory"
- location="OAFIID:GNOME_Evolution_Addressbook_Factory:@VERSION@">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/Evolution/ConfigControl:@VERSION@"/>
- </oaf_attribute>
-
- <oaf_attribute name="evolution2:config_item:title" type="string"
- _value="Certificates"/>
-
- <oaf_attribute name="evolution2:config_item:description" type="string"
- _value="Manager your S/Mime certificates here"/>
-
- <oaf_attribute name="evolution2:config_item:icon_name" type="string"
- value="pgp-signature-ok.png"/>
-
- <oaf_attribute name="evolution2:config_item:priority" type="string" value="-6"/>
-
- <oaf_attribute name="name" type="string"
- _value="Evolution S/Mime Certificate Management Control"/>
-
-</oaf_server>
-
-<oaf_server iid="OAFIID:GNOME_Evolution_Addressbook_Autocompletion_ConfigControl:@VERSION@"
- type="factory"
- location="OAFIID:GNOME_Evolution_Addressbook_Factory:@VERSION@">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/Evolution/ConfigControl:@VERSION@"/>
- </oaf_attribute>
-
- <oaf_attribute name="evolution2:config_item:title" type="string"
- _value="Autocompletion"/>
-
- <oaf_attribute name="evolution2:config_item:description" type="string"
- _value="Configure autocomple here"/>
-
- <oaf_attribute name="evolution2:config_item:icon_name" type="string"
- value="folder-settings.png"/>
-
- <oaf_attribute name="evolution2:config_item:priority" type="string" value="-9"/>
-
- <oaf_attribute name="name" type="string"
- _value="Evolution folder settings configuration control"/>
-</oaf_server>
-
-</oaf_info>
diff --git a/addressbook/gui/component/Makefile.am b/addressbook/gui/component/Makefile.am
deleted file mode 100644
index 09dcb8e537..0000000000
--- a/addressbook/gui/component/Makefile.am
+++ /dev/null
@@ -1,108 +0,0 @@
-SUBDIRS = select-names
-
-INCLUDES = \
- -DG_LOG_DOMAIN=\"evolution-addressbook\" \
- -I$(top_srcdir) \
- -I$(top_builddir) \
- -I$(top_srcdir)/shell \
- -I$(top_builddir)/shell \
- -I$(top_srcdir)/widgets/misc \
- -I$(top_srcdir)/addressbook/gui/contact-editor \
- -I$(top_srcdir)/addressbook/gui/contact-list-editor \
- -I$(top_srcdir)/addressbook/gui/widgets \
- -I$(top_srcdir)/addressbook/backend \
- -I$(top_builddir)/addressbook/backend \
- -DEVOLUTION_DATADIR=\""$(datadir)"\" \
- -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \
- -DEVOLUTION_ETSPECDIR=\""$(etspecdir)"\" \
- -DEVOLUTION_IMAGESDIR=\""$(imagesdir)"\" \
- -DEVOLUTION_LOCALEDIR=\""$(localedir)"\" \
- -DEVOLUTION_UIDIR=\""$(evolutionuidir)"\" \
- -DPREFIX=\""$(prefix)"\" \
- $(LDAP_CFLAGS) \
- $(EVOLUTION_ADDRESSBOOK_CFLAGS)
-
-component_LTLIBRARIES = libevolution-addressbook.la
-
-libevolution_addressbook_la_SOURCES = \
- addressbook-component.c \
- addressbook-component.h \
- addressbook-config.c \
- addressbook-config.h \
- autocompletion-config.c \
- autocompletion-config.h \
- addressbook.c \
- addressbook.h \
- component-factory.c
-
-# $(top_builddir)/addressbook/printing/libecontactprint.la
-
-if ENABLE_SMIME
-SMIME_LIB=$(top_builddir)/smime/gui/libevolution-smime.la
-endif
-
-libevolution_addressbook_la_LIBADD = \
- $(SMIME_LIB) \
- $(top_builddir)/addressbook/gui/component/select-names/libeselectnames.la \
- $(top_builddir)/shell/libeshell.la \
- $(top_builddir)/addressbook/gui/merging/libeabbookmerging.la \
- $(top_builddir)/addressbook/gui/widgets/libeabwidgets.la \
- $(top_builddir)/addressbook/gui/search/libeaddressbooksearch.la \
- $(top_builddir)/filter/libfilter.la \
- $(top_builddir)/addressbook/util/libeabutil.la \
- $(top_builddir)/addressbook/gui/contact-editor/libecontacteditor.la \
- $(top_builddir)/addressbook/gui/contact-list-editor/libecontactlisteditor.la \
- $(top_builddir)/widgets/misc/libemiscwidgets.la \
- $(top_builddir)/widgets/menus/libmenus.la \
- $(EVOLUTION_ADDRESSBOOK_LIBS) $(LDAP_LIBS)
-
-
-
-libevolution_addressbook_la_LDFLAGS = -module -avoid-version
-
-# GConf schemas
-
-schemadir = $(GCONF_SCHEMA_FILE_DIR)
-schema_in_files = apps_evolution_addressbook.schemas.in.in
-schema_DATA = $(schema_in_files:.schemas.in.in=-$(BASE_VERSION).schemas)
-%-$(BASE_VERSION).schemas.in: %.schemas.in.in
- cp $< $@
-
-@INTLTOOL_SCHEMAS_RULE@
-
-install-data-local:
- if test -z "$(DESTDIR)" ; then \
- for p in $(schema_DATA) ; do \
- GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(srcdir)/$$p; \
- done \
- fi
-
-server_in_files = GNOME_Evolution_Addressbook.server.in.in
-server_DATA = $(server_in_files:.server.in.in=_$(BASE_VERSION).server)
-@EVO_SERVER_RULE@
-@INTLTOOL_SERVER_RULE@
-
-glade_DATA = \
- ldap-config.glade
-
-BUILT_SOURCES = $(server_DATA)
-CLEANFILES = $(BUILT_SOURCES)
-
-EXTRA_DIST = \
- $(glade_DATA) \
- $(schema_DATA) \
- $(server_in_files)
-
-dist-hook:
- cd $(distdir); rm -f $(BUILT_SOURCES)
-
-if ENABLE_PURIFY
-PLINK = $(LIBTOOL) --mode=link $(PURIFY) $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
-
-all-local: evolution-addressbook.pure
-
-evolution-addressbook.pure: evolution-addressbook
- @rm -f evolution-addressbook.pure
- $(PLINK) $(evolution_addressbook_LDFLAGS) $(evolution_addressbook_OBJECTS) $(evolution_addressbook_LDADD) $(LIBS)
-
-endif
diff --git a/addressbook/gui/component/addressbook-component.c b/addressbook/gui/component/addressbook-component.c
deleted file mode 100644
index 803ed82d55..0000000000
--- a/addressbook/gui/component/addressbook-component.c
+++ /dev/null
@@ -1,431 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* addressbook-component.c
- *
- * Copyright (C) 2003 Ettore Perazzoli
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Ettore Perazzoli <ettore@ximian.com>
- */
-
-/* EPFIXME: Add autocompletion setting. */
-
-
-#include <config.h>
-
-#include "addressbook-component.h"
-
-#include "addressbook.h"
-#include "addressbook-config.h"
-
-#include "widgets/misc/e-source-selector.h"
-#include "addressbook/gui/widgets/eab-gui-util.h"
-
-#include "e-task-bar.h"
-
-#include <string.h>
-#include <bonobo/bonobo-i18n.h>
-#include <gtk/gtkscrolledwindow.h>
-#include <gtk/gtkmenu.h>
-#include <gtk/gtkimage.h>
-#include <gtk/gtkimagemenuitem.h>
-#include <gtk/gtklabel.h> /* FIXME */
-#include <gtk/gtkmessagedialog.h>
-#include <gtk/gtkstock.h>
-#include <gconf/gconf-client.h>
-#include <gal/util/e-util.h>
-
-
-#define PARENT_TYPE bonobo_object_get_type ()
-static BonoboObjectClass *parent_class = NULL;
-
-struct _AddressbookComponentPrivate {
- GConfClient *gconf_client;
- ESourceList *source_list;
- GtkWidget *source_selector;
-
- EActivityHandler *activity_handler;
-};
-
-
-/* Utility functions. */
-
-static void
-load_uri_for_selection (ESourceSelector *selector,
- BonoboControl *view_control)
-{
- ESource *selected_source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (selector));
-
- if (selected_source != NULL) {
- bonobo_control_set_property (view_control, NULL, "source_uid", TC_CORBA_string,
- e_source_peek_uid (selected_source), NULL);
- }
-}
-
-static void
-add_popup_menu_item (GtkMenu *menu, const char *label, const char *pixmap,
- GCallback callback, gpointer user_data)
-{
- GtkWidget *item, *image;
-
- if (pixmap) {
- item = gtk_image_menu_item_new_with_label (label);
-
- /* load the image */
- image = gtk_image_new_from_file (pixmap);
- if (!image)
- image = gtk_image_new_from_stock (pixmap, GTK_ICON_SIZE_MENU);
-
- if (image)
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
- } else {
- item = gtk_menu_item_new_with_label (label);
- }
-
- if (callback)
- g_signal_connect (G_OBJECT (item), "activate", callback, user_data);
-
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
- gtk_widget_show (item);
-}
-
-/* Folder popup menu callbacks */
-
-static void
-new_addressbook_cb (GtkWidget *widget, AddressbookComponent *comp)
-{
- addressbook_config_create_new_source (gtk_widget_get_toplevel (widget));
-}
-
-static void
-edit_addressbook_cb (GtkWidget *widget, AddressbookComponent *comp)
-{
- AddressbookComponentPrivate *priv;
- ESource *selected_source;
-
- priv = comp->priv;
-
- selected_source =
- e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (priv->source_selector));
- if (!selected_source)
- return;
-
- addressbook_config_edit_source (gtk_widget_get_toplevel (widget), selected_source);
-}
-
-static void
-delete_addressbook_cb (GtkWidget *widget, AddressbookComponent *comp)
-{
-}
-
-/* Callbacks. */
-
-static void
-primary_source_selection_changed_callback (ESourceSelector *selector,
- BonoboControl *view_control)
-{
- load_uri_for_selection (selector, view_control);
-}
-
-static void
-fill_popup_menu_callback (ESourceSelector *selector, GtkMenu *menu, AddressbookComponent *comp)
-{
- add_popup_menu_item (menu, _("New Addressbook"), NULL, G_CALLBACK (new_addressbook_cb), comp);
- add_popup_menu_item (menu, _("Properties..."), NULL, G_CALLBACK (edit_addressbook_cb), comp);
- add_popup_menu_item (menu, _("Delete"), GTK_STOCK_DELETE, G_CALLBACK (delete_addressbook_cb), comp);
- add_popup_menu_item (menu, _("Rename"), NULL, NULL, NULL);
-}
-
-/* Evolution::Component CORBA methods. */
-
-static void
-impl_createControls (PortableServer_Servant servant,
- Bonobo_Control *corba_sidebar_control,
- Bonobo_Control *corba_view_control,
- Bonobo_Control *corba_statusbar_control,
- CORBA_Environment *ev)
-{
- AddressbookComponent *addressbook_component = ADDRESSBOOK_COMPONENT (bonobo_object_from_servant (servant));
- GtkWidget *selector;
- GtkWidget *selector_scrolled_window;
- GtkWidget *statusbar_widget;
- BonoboControl *sidebar_control;
- BonoboControl *view_control;
- BonoboControl *statusbar_control;
-
- selector = e_source_selector_new (addressbook_component->priv->source_list);
- e_source_selector_show_selection (E_SOURCE_SELECTOR (selector), FALSE);
- gtk_widget_show (selector);
-
- addressbook_component->priv->source_selector = selector;
-
- selector_scrolled_window = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (selector_scrolled_window), GTK_SHADOW_IN);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (selector_scrolled_window),
- GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
- gtk_container_add (GTK_CONTAINER (selector_scrolled_window), selector);
- gtk_widget_show (selector_scrolled_window);
-
- sidebar_control = bonobo_control_new (selector_scrolled_window);
-
- view_control = addressbook_new_control ();
- g_signal_connect_object (selector, "primary_selection_changed",
- G_CALLBACK (primary_source_selection_changed_callback),
- G_OBJECT (view_control), 0);
- g_signal_connect_object (selector, "fill_popup_menu",
- G_CALLBACK (fill_popup_menu_callback),
- G_OBJECT (addressbook_component), 0);
- load_uri_for_selection (E_SOURCE_SELECTOR (selector), view_control);
-
- statusbar_widget = e_task_bar_new ();
- gtk_widget_show (statusbar_widget);
- statusbar_control = bonobo_control_new (statusbar_widget);
-
- e_activity_handler_attach_task_bar (addressbook_component->priv->activity_handler,
- E_TASK_BAR (statusbar_widget));
-
- *corba_sidebar_control = CORBA_Object_duplicate (BONOBO_OBJREF (sidebar_control), ev);
- *corba_view_control = CORBA_Object_duplicate (BONOBO_OBJREF (view_control), ev);
- *corba_statusbar_control = CORBA_Object_duplicate (BONOBO_OBJREF (statusbar_control), ev);
-}
-
-static GNOME_Evolution_CreatableItemTypeList *
-impl__get_userCreatableItems (PortableServer_Servant servant,
- CORBA_Environment *ev)
-{
- GNOME_Evolution_CreatableItemTypeList *list = GNOME_Evolution_CreatableItemTypeList__alloc ();
-
- list->_length = 2;
- list->_maximum = list->_length;
- list->_buffer = GNOME_Evolution_CreatableItemTypeList_allocbuf (list->_length);
-
- CORBA_sequence_set_release (list, FALSE);
-
- list->_buffer[0].id = "contact";
- list->_buffer[0].description = _("New Contact");
- list->_buffer[0].menuDescription = _("_Contact");
- list->_buffer[0].tooltip = _("Create a new contact");
- list->_buffer[0].menuShortcut = 'c';
- list->_buffer[0].iconName = "evolution-contacts-mini.png";
-
- list->_buffer[1].id = "contact_list";
- list->_buffer[1].description = _("New Contact List");
- list->_buffer[1].menuDescription = _("Contact _List");
- list->_buffer[1].tooltip = _("Create a new contact list");
- list->_buffer[1].menuShortcut = 'l';
- list->_buffer[1].iconName = "contact-list-16.png";
-
- return list;
-}
-
-static void
-impl_requestCreateItem (PortableServer_Servant servant,
- const CORBA_char *item_type_name,
- CORBA_Environment *ev)
-{
- AddressbookComponent *addressbook_component = ADDRESSBOOK_COMPONENT (bonobo_object_from_servant (servant));
- AddressbookComponentPrivate *priv;
- EBook *book;
- EContact *contact = e_contact_new ();
- ESource *selected_source;
- gchar *uri;
-
- priv = addressbook_component->priv;
-
- selected_source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (priv->source_selector));
- if (!selected_source) {
- CORBA_exception_set (ev, CORBA_USER_EXCEPTION, ex_GNOME_Evolution_Component_Failed, NULL);
- return;
- }
-
- uri = e_source_get_uri (selected_source);
- if (!uri) {
- CORBA_exception_set (ev, CORBA_USER_EXCEPTION, ex_GNOME_Evolution_Component_Failed, NULL);
- return;
- }
-
- book = e_book_new ();
- if (!e_book_load_uri (book, uri, TRUE, NULL)) {
- CORBA_exception_set (ev, CORBA_USER_EXCEPTION, ex_GNOME_Evolution_Component_Failed, NULL);
- g_object_unref (book);
- g_free (uri);
- return;
- }
-
- contact = e_contact_new ();
-
- if (!item_type_name) {
- CORBA_exception_set (ev, CORBA_USER_EXCEPTION, ex_GNOME_Evolution_Component_UnknownType, NULL);
- } else if (!strcmp (item_type_name, "contact")) {
- eab_show_contact_editor (book, contact, TRUE, TRUE);
- } else if (!strcmp (item_type_name, "contact_list")) {
- eab_show_contact_list_editor (book, contact, TRUE, TRUE);
- } else {
- CORBA_exception_set (ev, CORBA_USER_EXCEPTION, ex_GNOME_Evolution_Component_UnknownType, NULL);
- }
-
- g_object_unref (book);
- g_object_unref (contact);
- g_free (uri);
-}
-
-
-/* GObject methods. */
-
-static void
-impl_dispose (GObject *object)
-{
- AddressbookComponentPrivate *priv = ADDRESSBOOK_COMPONENT (object)->priv;
-
- if (priv->source_selector != NULL) {
- g_object_unref (priv->source_selector);
- priv->source_selector = NULL;
- }
-
- if (priv->source_list != NULL) {
- g_object_unref (priv->source_list);
- priv->source_list = NULL;
- }
-
- if (priv->gconf_client != NULL) {
- g_object_unref (priv->gconf_client);
- priv->gconf_client = NULL;
- }
-
- if (priv->activity_handler != NULL) {
- g_object_unref (priv->activity_handler);
- priv->activity_handler = NULL;
- }
-
- (* G_OBJECT_CLASS (parent_class)->dispose) (object);
-}
-
-static void
-impl_finalize (GObject *object)
-{
- AddressbookComponentPrivate *priv = ADDRESSBOOK_COMPONENT (object)->priv;
-
- g_free (priv);
-
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
-}
-
-
-/* Initialization. */
-
-static void
-addressbook_component_class_init (AddressbookComponentClass *class)
-{
- POA_GNOME_Evolution_Component__epv *epv = &class->epv;
- GObjectClass *object_class = G_OBJECT_CLASS (class);
-
- epv->createControls = impl_createControls;
- epv->_get_userCreatableItems = impl__get_userCreatableItems;
- epv->requestCreateItem = impl_requestCreateItem;
-
- object_class->dispose = impl_dispose;
- object_class->finalize = impl_finalize;
-
- parent_class = g_type_class_peek_parent (class);
-}
-
-static void
-addressbook_component_init (AddressbookComponent *component)
-{
- AddressbookComponentPrivate *priv;
- GSList *groups;
-
- priv = g_new0 (AddressbookComponentPrivate, 1);
-
- /* EPFIXME: Should use a custom one instead? Also we should add
- addressbook_component_peek_gconf_client(). */
- priv->gconf_client = gconf_client_get_default ();
-
- priv->source_list = e_source_list_new_for_gconf (priv->gconf_client,
- "/apps/evolution/addressbook/sources");
-
- priv->activity_handler = e_activity_handler_new ();
-
- /* Create default addressbooks if there are no groups */
- groups = e_source_list_peek_groups (priv->source_list);
- if (!groups) {
- ESourceGroup *group;
- ESource *source;
- char *base_uri, *base_uri_proto, *new_dir;
-
- /* create the local source group */
- base_uri = g_build_filename (g_get_home_dir (),
- "/.evolution/addressbook/local/OnThisComputer/",
- NULL);
-
- base_uri_proto = g_strconcat ("file://", base_uri, NULL);
-
- group = e_source_group_new (_("On This Computer"), base_uri_proto);
- e_source_list_add_group (priv->source_list, group, -1);
-
- g_free (base_uri_proto);
-
- /* FIXME: Migrate addressbooks from older setup? */
-
- /* Create default addressbooks */
- new_dir = g_build_filename (base_uri, "Personal/", NULL);
- if (!e_mkdir_hier (new_dir, 0700)) {
- source = e_source_new (_("Personal"), "Personal");
- e_source_group_add_source (group, source, -1);
- }
- g_free (new_dir);
-
- new_dir = g_build_filename (base_uri, "Work/", NULL);
- if (!e_mkdir_hier (new_dir, 0700)) {
- source = e_source_new (_("Work"), "Work");
- e_source_group_add_source (group, source, -1);
- }
- g_free (new_dir);
-
- g_free (base_uri);
-
- /* Create the LDAP source group */
- group = e_source_group_new (_("On LDAP Servers"), "ldap://");
- e_source_list_add_group (priv->source_list, group, -1);
- }
-
- component->priv = priv;
-}
-
-
-/* Public API. */
-
-AddressbookComponent *
-addressbook_component_peek (void)
-{
- static AddressbookComponent *component = NULL;
-
- if (component == NULL)
- component = g_object_new (addressbook_component_get_type (), NULL);
-
- return component;
-}
-
-
-EActivityHandler *
-addressbook_component_peek_activity_handler (AddressbookComponent *component)
-{
- g_return_val_if_fail (ADDRESSBOOK_IS_COMPONENT (component), NULL);
-
- return component->priv->activity_handler;
-}
-
-
-BONOBO_TYPE_FUNC_FULL (AddressbookComponent, GNOME_Evolution_Component, PARENT_TYPE, addressbook_component)
diff --git a/addressbook/gui/component/addressbook-component.h b/addressbook/gui/component/addressbook-component.h
deleted file mode 100644
index f08f54aaaf..0000000000
--- a/addressbook/gui/component/addressbook-component.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* addressbook-component.h
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Ettore Perazzoli <ettore@ximian.com>
- */
-
-#ifndef _ADDRESSBOOK_COMPONENT_H_
-#define _ADDRESSBOOK_COMPONENT_H_
-
-#include <bonobo/bonobo-object.h>
-
-#include "Evolution.h"
-#include "e-activity-handler.h"
-
-#define ADDRESSBOOK_TYPE_COMPONENT (addressbook_component_get_type ())
-#define ADDRESSBOOK_COMPONENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ADDRESSBOOK_TYPE_COMPONENT, AddressbookComponent))
-#define ADDRESSBOOK_COMPONENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ADDRESSBOOK_TYPE_COMPONENT, AddressbookComponentClass))
-#define ADDRESSBOOK_IS_COMPONENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ADDRESSBOOK_TYPE_COMPONENT))
-#define ADDRESSBOOK_IS_COMPONENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), ADDRESSBOOK_TYPE_COMPONENT))
-
-
-typedef struct _AddressbookComponent AddressbookComponent;
-typedef struct _AddressbookComponentPrivate AddressbookComponentPrivate;
-typedef struct _AddressbookComponentClass AddressbookComponentClass;
-
-struct _AddressbookComponent {
- BonoboObject parent;
-
- AddressbookComponentPrivate *priv;
-};
-
-struct _AddressbookComponentClass {
- BonoboObjectClass parent_class;
-
- POA_GNOME_Evolution_Component__epv epv;
-};
-
-
-GType addressbook_component_get_type (void);
-
-AddressbookComponent *addressbook_component_peek (void);
-
-EActivityHandler *addressbook_component_peek_activity_handler (AddressbookComponent *component);
-
-
-#endif /* _ADDRESSBOOK_COMPONENT_H_ */
diff --git a/addressbook/gui/component/addressbook-config.c b/addressbook/gui/component/addressbook-config.c
deleted file mode 100644
index 371539562a..0000000000
--- a/addressbook/gui/component/addressbook-config.c
+++ /dev/null
@@ -1,1439 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Chris Toshok <toshok@ximian.com>
- * Chris Lahey <clahey@ximian.com>
- **/
-
-/*#define STANDALONE*/
-
-#include <config.h>
-
-#include <string.h>
-#include <stdlib.h>
-#include <sys/time.h>
-
-#include <gtk/gtkcombo.h>
-#include <gtk/gtkdialog.h>
-#include <gtk/gtkentry.h>
-#include <gtk/gtkmessagedialog.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnomeui/gnome-druid.h>
-#include <libgnomeui/gnome-druid-page.h>
-
-#include <bonobo/bonobo-generic-factory.h>
-
-#include <glade/glade.h>
-
-#include "addressbook.h"
-#include "addressbook-component.h"
-#include "addressbook-config.h"
-
-#include "evolution-config-control.h"
-
-#include <gal/e-table/e-table-memory-store.h>
-#include <gal/e-table/e-table-scrolled.h>
-
-
-#ifdef HAVE_LDAP
-#include "ldap.h"
-#include "ldap_schema.h"
-#endif
-
-#define LDAP_PORT_STRING "389"
-#define LDAPS_PORT_STRING "636"
-
-#define GLADE_FILE_NAME "ldap-config.glade"
-#define CONFIG_CONTROL_FACTORY_ID "OAFIID:GNOME_Evolution_Addressbook_ConfigControlFactory:" BASE_VERSION
-#define LDAP_CONFIG_CONTROL_ID "OAFIID:GNOME_Evolution_LDAPStorage_ConfigControl:" BASE_VERSION
-
-GtkWidget* supported_bases_create_table (char *name, char *string1, char *string2,
- int num1, int num2);
-
-/* default objectclasses */
-#define TOP "top"
-#define PERSON "person"
-#define ORGANIZATIONALPERSON "organizationalPerson"
-#define INETORGPERSON "inetOrgPerson"
-#define EVOLUTIONPERSON "evolutionPerson"
-#define CALENTRY "calEntry"
-
-
-typedef struct {
- GtkWidget *notebook;
- int page_num;
-} FocusHelpClosure;
-
-static void
-focus_help (GtkWidget *w, GdkEventFocus *event, FocusHelpClosure *closure)
-{
- gtk_notebook_set_current_page (GTK_NOTEBOOK(closure->notebook), closure->page_num);
-}
-
-static void
-add_focus_handler (GtkWidget *widget, GtkWidget *notebook, int page_num)
-{
- FocusHelpClosure *focus_closure = g_new0 (FocusHelpClosure, 1);
- focus_closure->notebook = notebook;
- focus_closure->page_num = page_num;
-
- g_signal_connect_data (G_OBJECT (widget),
- "focus_in_event" /* XXX */,
- G_CALLBACK (focus_help),
- focus_closure,
- (GClosureNotify) g_free,
- (GConnectFlags)0);
-}
-
-typedef struct _AddressbookSourceDialog AddressbookSourceDialog;
-typedef void (*ModifyFunc)(GtkWidget *item, AddressbookSourceDialog *dialog);
-
-struct _AddressbookSourceDialog {
- GladeXML *gui;
-
- GtkWidget *window;
- GtkWidget *druid; /* only used (obviously) in the druid */
-
- /* Source selection (druid only) */
- ESourceList *source_list;
- GtkWidget *group_optionmenu;
-
- /* ESource we're currently editing (editor only) */
- ESource *source;
-
- /* Source group we're creating/editing a source in */
- ESourceGroup *source_group;
-
- /* info page fields */
- ModifyFunc general_modify_func;
- GtkWidget *host;
- GtkWidget *auth_optionmenu;
- AddressbookLDAPAuthType auth;
- GtkWidget *auth_label_notebook;
- GtkWidget *auth_entry_notebook;
- GtkWidget *email;
- GtkWidget *binddn;
-
- /* connecting page fields */
- ModifyFunc connecting_modify_func;
- GtkWidget *port_combo;
- GtkWidget *ssl_optionmenu;
- AddressbookLDAPSSLType ssl;
-
- /* searching page fields */
- ModifyFunc searching_modify_func;
- GtkWidget *rootdn;
- AddressbookLDAPScopeType scope;
- GtkWidget *scope_optionmenu;
- GtkWidget *timeout_scale;
- GtkWidget *limit_spinbutton;
-
- /* display name page fields */
- GtkWidget *display_name;
- gboolean display_name_changed; /* only used in the druid */
-
- gboolean schema_query_successful;
-
- /* stuff for the account editor window */
- GtkWidget *ok_button;
- GtkWidget *cancel_button;
- GtkWidget *advanced_button_notebook;
- GtkWidget *notebook; /* the toplevel notebook */
-
- gboolean advanced;
-};
-
-
-
-#ifdef HAVE_LDAP
-
-static char *
-ldap_unparse_auth (AddressbookLDAPAuthType auth_type)
-{
- switch (auth_type) {
- case ADDRESSBOOK_LDAP_AUTH_NONE:
- return "none";
- case ADDRESSBOOK_LDAP_AUTH_SIMPLE_EMAIL:
- return "ldap/simple-email";
- case ADDRESSBOOK_LDAP_AUTH_SIMPLE_BINDDN:
- return "ldap/simple-binddn";
- default:
- g_assert(0);
- return "none";
- }
-}
-
-static AddressbookLDAPAuthType
-ldap_parse_auth (const char *auth)
-{
- if (!auth)
- return ADDRESSBOOK_LDAP_AUTH_NONE;
-
- if (!strcmp (auth, "ldap/simple-email") || !strcmp (auth, "simple"))
- return ADDRESSBOOK_LDAP_AUTH_SIMPLE_EMAIL;
- else if (!strcmp (auth, "ldap/simple-binddn"))
- return ADDRESSBOOK_LDAP_AUTH_SIMPLE_BINDDN;
- else
- return ADDRESSBOOK_LDAP_AUTH_NONE;
-}
-
-static char *
-ldap_unparse_scope (AddressbookLDAPScopeType scope_type)
-{
- switch (scope_type) {
- case ADDRESSBOOK_LDAP_SCOPE_BASE:
- return "base";
- case ADDRESSBOOK_LDAP_SCOPE_ONELEVEL:
- return "one";
- case ADDRESSBOOK_LDAP_SCOPE_SUBTREE:
- return "sub";
- default:
- g_assert(0);
- return "";
- }
-}
-
-static char *
-ldap_unparse_ssl (AddressbookLDAPSSLType ssl_type)
-{
- switch (ssl_type) {
- case ADDRESSBOOK_LDAP_SSL_NEVER:
- return "never";
- case ADDRESSBOOK_LDAP_SSL_WHENEVER_POSSIBLE:
- return "whenever_possible";
- case ADDRESSBOOK_LDAP_SSL_ALWAYS:
- return "always";
- default:
- g_assert(0);
- return "";
- }
-}
-
-static AddressbookLDAPSSLType
-ldap_parse_ssl (const char *ssl)
-{
- if (!ssl)
- return ADDRESSBOOK_LDAP_SSL_WHENEVER_POSSIBLE; /* XXX good default? */
-
- if (!strcmp (ssl, "always"))
- return ADDRESSBOOK_LDAP_SSL_ALWAYS;
- else if (!strcmp (ssl, "never"))
- return ADDRESSBOOK_LDAP_SSL_NEVER;
- else
- return ADDRESSBOOK_LDAP_SSL_WHENEVER_POSSIBLE;
-}
-
-#endif
-
-
-
-static gboolean
-create_source_dir (AddressbookSourceDialog *dialog, ESource *source)
-{
- gchar *new_dir;
- gint result;
-
- new_dir = g_build_filename (e_source_group_peek_base_uri (dialog->source_group),
- e_source_peek_name (source), NULL);
- g_print ("Making %s\n", new_dir);
- result = e_mkdir_hier (new_dir + sizeof ("file://") - 1, 0700);
- g_free (new_dir);
-
- if (result) {
- e_notice (NULL /* FIXME: parent */, GTK_MESSAGE_ERROR,
- _("Could not create a directory for the new addressbook."));
- return FALSE;
- }
-
- return TRUE;
-}
-
-static void
-dialog_to_source (AddressbookSourceDialog *dialog, ESource *source, gboolean temporary)
-{
- gchar *str;
-
- g_assert (source);
-
- e_source_set_name (source, gtk_entry_get_text (GTK_ENTRY (dialog->display_name)));
-
- if (!strcmp ("ldap://", e_source_group_peek_base_uri (dialog->source_group))) {
-#ifdef HAVE_LDAP
- e_source_set_property (source, "email_addr", gtk_entry_get_text (GTK_ENTRY (dialog->email)));
- e_source_set_property (source, "binddn", gtk_entry_get_text (GTK_ENTRY (dialog->binddn)));
- e_source_set_property (source, "limit", gtk_entry_get_text (GTK_ENTRY (dialog->limit_spinbutton)));
- e_source_set_property (source, "ssl", ldap_unparse_ssl (dialog->ssl));
- e_source_set_property (source, "auth", ldap_unparse_auth (dialog->auth));
-
- str = g_strdup_printf ("%s:%s/%s?" /* trigraph prevention */ "?%s",
- gtk_entry_get_text (GTK_ENTRY (dialog->host)),
- gtk_entry_get_text (GTK_ENTRY (GTK_COMBO (dialog->port_combo)->entry)),
- gtk_entry_get_text (GTK_ENTRY (dialog->rootdn)),
- ldap_unparse_scope (dialog->scope));
- e_source_set_relative_uri (source, str);
- g_free (str);
-#endif
- } else {
- const gchar *relative_uri;
-
- relative_uri = e_source_peek_relative_uri (source);
- if (!relative_uri || !strlen (relative_uri)) {
- e_source_set_relative_uri (source, e_source_peek_name (source));
-
- if (!temporary && !create_source_dir (dialog, source))
- return;
- }
- }
-
- if (!temporary && !e_source_peek_group (source))
- e_source_group_add_source (dialog->source_group, source, -1);
-}
-
-static ESource *
-dialog_to_temp_source (AddressbookSourceDialog *dialog)
-{
- ESource *source;
-
- source = e_source_new ("", "");
- dialog_to_source (dialog, source, TRUE);
-
- return source;
-}
-
-#ifdef HAVE_LDAP
-static gboolean
-source_to_uri_parts (ESource *source, gchar **host, gchar **rootdn,
- AddressbookLDAPScopeType *scope, gint *port)
-{
- gchar *uri;
- LDAPURLDesc *lud;
- gint ldap_error;
-
- g_assert (source);
-
- uri = e_source_get_uri (source);
- ldap_error = ldap_url_parse ((gchar *) uri, &lud);
- g_free (uri);
-
- if (ldap_error != LDAP_SUCCESS)
- return FALSE;
-
- if (host)
- *host = g_strdup (lud->lud_host ? lud->lud_host : "");
- if (rootdn)
- *rootdn = g_strdup (lud->lud_dn ? lud->lud_dn : "");
- if (port)
- *port = lud->lud_port ? lud->lud_port : LDAP_PORT;
- if (scope)
- *scope = lud->lud_scope == LDAP_SCOPE_BASE ? ADDRESSBOOK_LDAP_SCOPE_BASE :
- lud->lud_scope == LDAP_SCOPE_ONELEVEL ? ADDRESSBOOK_LDAP_SCOPE_ONELEVEL :
- lud->lud_scope == LDAP_SCOPE_SUBTREE ? ADDRESSBOOK_LDAP_SCOPE_SUBTREE :
- ADDRESSBOOK_LDAP_SCOPE_ONELEVEL;
-
- ldap_free_urldesc (lud);
- return TRUE;
-}
-#endif
-
-#define SOURCE_PROP_STRING(source, prop) \
- (source && e_source_get_property (source, prop) ? e_source_get_property (source, prop) : "")
-
-static void
-source_to_dialog (AddressbookSourceDialog *dialog)
-{
- ESource *source = dialog->source;
-
- gtk_entry_set_text (GTK_ENTRY (dialog->display_name), source ? e_source_peek_name (source) : "");
-
-#ifdef HAVE_LDAP
- gtk_entry_set_text (GTK_ENTRY (dialog->email), SOURCE_PROP_STRING (source, "email_addr"));
- gtk_entry_set_text (GTK_ENTRY (dialog->binddn), SOURCE_PROP_STRING (source, "binddn"));
- gtk_entry_set_text (GTK_ENTRY (dialog->limit_spinbutton),
- source && e_source_get_property (source, "limit") ?
- e_source_get_property (source, "limit") : "100");
-
- dialog->auth = source && e_source_get_property (source, "auth") ?
- ldap_parse_auth (e_source_get_property (source, "auth")) : ADDRESSBOOK_LDAP_AUTH_NONE;
- dialog->ssl = source && e_source_get_property (source, "ssl") ?
- ldap_parse_ssl (e_source_get_property (source, "ssl")) : ADDRESSBOOK_LDAP_SSL_WHENEVER_POSSIBLE;
-
- if (source && !strcmp ("ldap://", e_source_group_peek_base_uri (dialog->source_group))) {
- gchar *host;
- gchar *rootdn;
- AddressbookLDAPScopeType scope;
- gint port;
-
- if (source_to_uri_parts (source, &host, &rootdn, &scope, &port)) {
- gchar *port_str;
-
- gtk_entry_set_text (GTK_ENTRY (dialog->host), host);
- gtk_entry_set_text (GTK_ENTRY (dialog->rootdn), rootdn);
-
- dialog->scope = scope;
-
- port_str = g_strdup_printf ("%d", port);
- gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (dialog->port_combo)->entry), port_str);
- g_free (port_str);
-
- g_free (host);
- g_free (rootdn);
- }
- }
-
- gtk_option_menu_set_history (GTK_OPTION_MENU(dialog->auth_optionmenu), dialog->auth);
- if (dialog->auth != ADDRESSBOOK_LDAP_AUTH_NONE) {
- gtk_notebook_set_current_page (GTK_NOTEBOOK(dialog->auth_label_notebook), dialog->auth - 1);
- gtk_notebook_set_current_page (GTK_NOTEBOOK(dialog->auth_entry_notebook), dialog->auth - 1);
- }
- gtk_widget_set_sensitive (dialog->auth_label_notebook, dialog->auth != ADDRESSBOOK_LDAP_AUTH_NONE);
- gtk_widget_set_sensitive (dialog->auth_entry_notebook, dialog->auth != ADDRESSBOOK_LDAP_AUTH_NONE);
-
- gtk_option_menu_set_history (GTK_OPTION_MENU(dialog->scope_optionmenu), dialog->scope);
- gtk_option_menu_set_history (GTK_OPTION_MENU(dialog->ssl_optionmenu), dialog->ssl);
-#endif
-}
-
-#ifdef HAVE_LDAP
-
-/* ldap api foo */
-static LDAP *
-addressbook_ldap_init (GtkWidget *window, ESource *source)
-{
- LDAP *ldap;
- gchar *host;
- gint port;
-
- if (!source_to_uri_parts (source, &host, NULL, NULL, &port))
- return NULL;
-
- ldap = ldap_init (host, port);
- if (!ldap) {
- GtkWidget *dialog;
- dialog = gtk_message_dialog_new (GTK_WINDOW(window),
- GTK_DIALOG_MODAL,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("Failed to connect to LDAP server"));
- g_signal_connect (dialog, "response", G_CALLBACK(gtk_widget_destroy), NULL);
- gtk_widget_show (dialog);
- }
-
- /* XXX do TLS if it's configured in */
-
- g_free (host);
- return ldap;
-}
-
-static gint
-addressbook_ldap_auth (GtkWidget *window, LDAP *ldap)
-{
- gint ldap_error;
-
- /* XXX use auth info from source */
- ldap_error = ldap_simple_bind_s (ldap, NULL, NULL);
- if (LDAP_SUCCESS != ldap_error) {
- GtkWidget *dialog;
- dialog = gtk_message_dialog_new (GTK_WINDOW (window),
- GTK_DIALOG_MODAL,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("Failed to authenticate with LDAP server"));
- g_signal_connect (dialog, "response", G_CALLBACK(gtk_widget_destroy), NULL);
- gtk_widget_show (dialog);
- }
-
- return ldap_error;
-}
-
-static int
-addressbook_root_dse_query (GtkWindow *window, LDAP *ldap, char **attrs, LDAPMessage **resp)
-{
- int ldap_error;
- struct timeval timeout;
-
- /* 3 second timeout */
- timeout.tv_sec = 3;
- timeout.tv_usec = 0;
-
- ldap_error = ldap_search_ext_s (ldap,
- LDAP_ROOT_DSE, LDAP_SCOPE_BASE,
- "(objectclass=*)",
- attrs, 0, NULL, NULL, &timeout, LDAP_NO_LIMIT, resp);
- if (LDAP_SUCCESS != ldap_error) {
- GtkWidget *dialog;
- dialog = gtk_message_dialog_new (window,
- GTK_DIALOG_MODAL,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("Could not perform query on Root DSE"));
- g_signal_connect (dialog, "response", G_CALLBACK(gtk_widget_destroy), NULL);
- gtk_widget_show (dialog);
- }
-
- return ldap_error;
-}
-
-#endif
-
-static void
-addressbook_source_dialog_destroy (gpointer data, GObject *where_object_was)
-{
- AddressbookSourceDialog *dialog = data;
-
- g_object_unref (dialog->gui);
- g_free (dialog);
-}
-
-static void
-addressbook_add_server_druid_cancel (GtkWidget *widget, AddressbookSourceDialog *dialog)
-{
- gtk_widget_destroy (dialog->window);
-}
-
-static void
-addressbook_add_server_druid_finish (GnomeDruidPage *druid_page, GtkWidget *gnome_druid, AddressbookSourceDialog *sdialog)
-{
- sdialog->source = e_source_new ("", "");
- dialog_to_source (sdialog, sdialog->source, FALSE);
-
- /* tear down the widgets */
- gtk_widget_destroy (sdialog->window);
-}
-
-static void
-reparent_to_vbox (AddressbookSourceDialog *dialog, char *vbox_name, char *widget_name)
-{
- GtkWidget *vbox, *widget;
-
- vbox = glade_xml_get_widget (dialog->gui, vbox_name);
- widget = glade_xml_get_widget (dialog->gui, widget_name);
-
- gtk_widget_reparent (widget, vbox);
- gtk_box_set_child_packing (GTK_BOX (vbox), widget, TRUE, TRUE, 0, GTK_PACK_START);
-}
-
-static void
-auth_optionmenu_activated (GtkWidget *item, AddressbookSourceDialog *dialog)
-{
- dialog->auth = g_list_index (gtk_container_get_children (GTK_CONTAINER (item->parent)),
- item);
-
- dialog->general_modify_func (item, dialog);
-
- if (dialog->auth == 0) {
- gtk_widget_set_sensitive (dialog->auth_label_notebook, FALSE);
- gtk_widget_set_sensitive (dialog->auth_entry_notebook, FALSE);
- }
- else {
- gtk_widget_set_sensitive (dialog->auth_label_notebook, TRUE);
- gtk_widget_set_sensitive (dialog->auth_entry_notebook, TRUE);
- gtk_notebook_set_current_page (GTK_NOTEBOOK(dialog->auth_label_notebook), dialog->auth - 1);
- gtk_notebook_set_current_page (GTK_NOTEBOOK(dialog->auth_entry_notebook), dialog->auth - 1);
- }
-}
-
-static void
-add_auth_activate_cb (GtkWidget *item, AddressbookSourceDialog *dialog)
-{
- g_signal_connect (item, "activate",
- G_CALLBACK (auth_optionmenu_activated), dialog);
-}
-
-static void
-setup_general_tab (AddressbookSourceDialog *dialog, ModifyFunc modify_func)
-{
- GtkWidget *general_tab_help;
- GtkWidget *menu;
-
- general_tab_help = glade_xml_get_widget (dialog->gui, "general-tab-help");
-
- dialog->general_modify_func = modify_func;
- dialog->host = glade_xml_get_widget (dialog->gui, "server-name-entry");
- g_signal_connect (dialog->host, "changed",
- G_CALLBACK (modify_func), dialog);
- add_focus_handler (dialog->host, general_tab_help, 0);
-
- dialog->auth_label_notebook = glade_xml_get_widget (dialog->gui, "auth-label-notebook");
- dialog->auth_entry_notebook = glade_xml_get_widget (dialog->gui, "auth-entry-notebook");
- dialog->email = glade_xml_get_widget (dialog->gui, "email-entry");
- g_signal_connect (dialog->email, "changed",
- G_CALLBACK (modify_func), dialog);
- add_focus_handler (dialog->email, general_tab_help, 1);
- dialog->binddn = glade_xml_get_widget (dialog->gui, "dn-entry");
- g_signal_connect (dialog->binddn, "changed",
- G_CALLBACK (modify_func), dialog);
- add_focus_handler (dialog->binddn, general_tab_help, 2);
-
- dialog->auth_optionmenu = glade_xml_get_widget (dialog->gui, "auth-optionmenu");
- menu = gtk_option_menu_get_menu (GTK_OPTION_MENU(dialog->auth_optionmenu));
- gtk_container_foreach (GTK_CONTAINER (menu), (GtkCallback)add_auth_activate_cb, dialog);
- add_focus_handler (dialog->auth_optionmenu, general_tab_help, 3);
-}
-
-static gboolean
-general_tab_check (AddressbookSourceDialog *dialog)
-{
- gboolean valid = TRUE;
- const char *string;
-
- if (strcmp ("ldap://", e_source_group_peek_base_uri (dialog->source_group)))
- return TRUE;
-
- string = gtk_entry_get_text (GTK_ENTRY (dialog->host));
- if (!string || !string[0])
- valid = FALSE;
-
- if (valid) {
- if (dialog->auth != ADDRESSBOOK_LDAP_AUTH_NONE) {
- if (dialog->auth == ADDRESSBOOK_LDAP_AUTH_SIMPLE_BINDDN)
- string = gtk_entry_get_text (GTK_ENTRY (dialog->binddn));
- else
- string = gtk_entry_get_text (GTK_ENTRY (dialog->email));
-
- if (!string || !string[0])
- valid = FALSE;
- }
- }
-
- return valid;
-}
-
-static void
-druid_info_page_modify_cb (GtkWidget *item, AddressbookSourceDialog *dialog)
-{
- gnome_druid_set_buttons_sensitive (GNOME_DRUID(dialog->druid),
- TRUE, /* back */
- general_tab_check (dialog), /* next */
- TRUE, /* cancel */
- FALSE /* help */);
-}
-
-static void
-druid_info_page_prepare (GnomeDruidPage *dpage, GtkWidget *gdruid, AddressbookSourceDialog *dialog)
-{
- druid_info_page_modify_cb (NULL, dialog);
- /* stick the focus in the hostname field */
- gtk_widget_grab_focus (dialog->host);
-}
-
-
-/* connecting page */
-static void
-ssl_optionmenu_activated (GtkWidget *item, AddressbookSourceDialog *dialog)
-{
- dialog->ssl = g_list_index (gtk_container_get_children (GTK_CONTAINER (item->parent)),
- item);
-
- dialog->connecting_modify_func (item, dialog);
-}
-
-static void
-ssl_optionmenu_selected (GtkWidget *item, AddressbookSourceDialog *dialog)
-{
- GtkWidget *connecting_tab_help;
- int ssl_type = g_list_index (gtk_container_get_children (GTK_CONTAINER (item->parent)),
- item);
-
- connecting_tab_help = glade_xml_get_widget (dialog->gui, "connecting-tab-help");
-
- gtk_notebook_set_current_page (GTK_NOTEBOOK(connecting_tab_help), ssl_type + 1);
-}
-
-static void
-add_ssl_activate_cb (GtkWidget *item, AddressbookSourceDialog *dialog)
-{
- g_signal_connect (item, "activate",
- G_CALLBACK (ssl_optionmenu_activated), dialog);
- g_signal_connect (item, "select",
- G_CALLBACK (ssl_optionmenu_selected), dialog);
-}
-
-static void
-port_changed_func (GtkWidget *item, AddressbookSourceDialog *dialog)
-{
- /* if the port value is ldaps, set the SSL/TLS option menu to
- Always and desensitize it */
- const char *string = gtk_entry_get_text (GTK_ENTRY (item));
-
- dialog->connecting_modify_func (item, dialog);
-
- if (!strcmp (string, LDAPS_PORT_STRING)) {
- dialog->ssl = ADDRESSBOOK_LDAP_SSL_ALWAYS;
- gtk_option_menu_set_history (GTK_OPTION_MENU(dialog->ssl_optionmenu),
- dialog->ssl);
-
- gtk_widget_set_sensitive (dialog->ssl_optionmenu, FALSE);
- }
- else {
- gtk_widget_set_sensitive (dialog->ssl_optionmenu, TRUE);
- }
-
-}
-
-static void
-setup_connecting_tab (AddressbookSourceDialog *dialog, ModifyFunc modify_func)
-{
- GtkWidget *menu;
- GtkWidget *connecting_tab_help;
-
- dialog->connecting_modify_func = modify_func;
-
- connecting_tab_help = glade_xml_get_widget (dialog->gui, "connecting-tab-help");
-
- dialog->port_combo = glade_xml_get_widget (dialog->gui, "port-combo");
- add_focus_handler (dialog->port_combo, connecting_tab_help, 0);
- add_focus_handler (GTK_COMBO(dialog->port_combo)->entry, connecting_tab_help, 0);
- g_signal_connect (GTK_COMBO(dialog->port_combo)->entry, "changed",
- G_CALLBACK (modify_func), dialog);
- g_signal_connect (GTK_COMBO(dialog->port_combo)->entry, "changed",
- G_CALLBACK (port_changed_func), dialog);
- dialog->ssl_optionmenu = glade_xml_get_widget (dialog->gui, "ssl-optionmenu");
- menu = gtk_option_menu_get_menu (GTK_OPTION_MENU(dialog->ssl_optionmenu));
- gtk_container_foreach (GTK_CONTAINER (menu), (GtkCallback)add_ssl_activate_cb, dialog);
-}
-
-static gboolean
-connecting_tab_check (AddressbookSourceDialog *dialog)
-{
- gboolean valid = TRUE;
- const char *string;
-
- string = gtk_entry_get_text (GTK_ENTRY (GTK_COMBO(dialog->port_combo)->entry));
- if (!string || !string[0])
- valid = FALSE;
-
- return valid;
-}
-
-static void
-druid_connecting_page_modify_cb (GtkWidget *item, AddressbookSourceDialog *dialog)
-{
- gnome_druid_set_buttons_sensitive (GNOME_DRUID(dialog->druid),
- TRUE, /* back */
- connecting_tab_check (dialog), /* next */
- TRUE, /* cancel */
- FALSE /* help */);
-}
-
-static void
-druid_connecting_page_prepare (GnomeDruidPage *dpage, GtkWidget *gdruid, AddressbookSourceDialog *dialog)
-{
- druid_connecting_page_modify_cb (NULL, dialog);
- /* stick the focus in the port combo */
- gtk_widget_grab_focus (GTK_COMBO(dialog->port_combo)->entry);
-}
-
-
-
-#ifdef HAVE_LDAP
-
-/* searching page */
-static ETableMemoryStoreColumnInfo bases_table_columns[] = {
- E_TABLE_MEMORY_STORE_STRING,
- E_TABLE_MEMORY_STORE_TERMINATOR
-};
-
-#define BASES_TABLE_SPEC \
-"<ETableSpecification cursor-mode=\"line\" no-headers=\"true\"> \
- <ETableColumn model_col= \"0\" _title=\"Base\" expansion=\"1.0\" minimum_width=\"20\" resizable=\"true\" cell=\"string\" compare=\"string\"/> \
- <ETableState> \
- <column source=\"0\"/> \
- <grouping></grouping> \
- </ETableState> \
-</ETableSpecification>"
-
-GtkWidget*
-supported_bases_create_table (char *name, char *string1, char *string2, int num1, int num2)
-{
- GtkWidget *table;
- ETableModel *model;
-
- model = e_table_memory_store_new (bases_table_columns);
-
- table = e_table_scrolled_new (model, NULL, BASES_TABLE_SPEC, NULL);
-
- g_object_set_data (G_OBJECT (table), "model", model);
-
- return table;
-}
-
-static gboolean
-do_ldap_root_dse_query (GtkWidget *dialog, ETableModel *model, ESource *source, char ***rvalues)
-{
- LDAP *ldap;
- char *attrs[2];
- int ldap_error;
- char **values;
- LDAPMessage *resp;
- int i;
-
- ldap = addressbook_ldap_init (dialog, source);
- if (!ldap)
- return FALSE;
-
- if (LDAP_SUCCESS != addressbook_ldap_auth (dialog, ldap))
- goto fail;
-
- attrs[0] = "namingContexts";
- attrs[1] = NULL;
-
- ldap_error = addressbook_root_dse_query (GTK_WINDOW (dialog), ldap, attrs, &resp);
-
- if (ldap_error != LDAP_SUCCESS)
- goto fail;
-
- values = ldap_get_values (ldap, resp, "namingContexts");
- if (!values || values[0] == NULL) {
- GtkWidget *error_dialog;
- error_dialog = gtk_message_dialog_new (GTK_WINDOW (dialog),
- GTK_DIALOG_MODAL,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("The server responded with no supported search bases"));
- g_signal_connect (error_dialog, "response", G_CALLBACK(gtk_widget_destroy), NULL);
- gtk_widget_show (error_dialog);
- goto fail;
- }
-
- for (i = 0; values[i]; i++)
- e_table_memory_store_insert (E_TABLE_MEMORY_STORE (model),
- -1, GINT_TO_POINTER(i), values[i]);
-
- *rvalues = values;
-
- ldap_unbind_s (ldap);
- return TRUE;
-
- fail:
- ldap_unbind_s (ldap);
- return FALSE;
-}
-
-static void
-search_base_selection_model_changed (ESelectionModel *selection_model, GtkWidget *dialog)
-{
- gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog),
- GTK_RESPONSE_OK,
- e_selection_model_selected_count (selection_model) == 1);
-}
-
-static void
-query_for_supported_bases (GtkWidget *button, AddressbookSourceDialog *sdialog)
-{
- ESelectionModel *selection_model;
- ESource *source;
- GtkWidget *dialog;
- GtkWidget *supported_bases_table;
- ETableModel *model;
- int id;
- char **values;
-
- source = dialog_to_temp_source (sdialog);
-
- dialog = glade_xml_get_widget (sdialog->gui, "supported-bases-dialog");
-
- supported_bases_table = glade_xml_get_widget (sdialog->gui, "supported-bases-table");
- gtk_widget_show (supported_bases_table);
- selection_model = e_table_get_selection_model (e_table_scrolled_get_table (E_TABLE_SCROLLED(supported_bases_table)));
- model = g_object_get_data (G_OBJECT (supported_bases_table), "model");
-
- g_signal_connect (selection_model, "selection_changed",
- G_CALLBACK (search_base_selection_model_changed), dialog);
-
- search_base_selection_model_changed (selection_model, dialog);
-
- if (do_ldap_root_dse_query (dialog, model, source, &values)) {
- id = gtk_dialog_run (GTK_DIALOG (dialog));
-
- gtk_widget_hide (dialog);
-
- if (id == GTK_RESPONSE_OK) {
- int i;
- /* OK was clicked */
-
- /* ugh. */
- for (i = 0; values[i]; i ++) {
- if (e_selection_model_is_row_selected (selection_model, i)) {
- gtk_entry_set_text (GTK_ENTRY (sdialog->rootdn), values[i]);
- break; /* single selection, so we can quit when we've found it. */
- }
- }
- }
-
- ldap_value_free (values);
-
- e_table_memory_store_clear (E_TABLE_MEMORY_STORE (model));
- }
-
- g_object_unref (source);
-}
-
-static void
-scope_optionmenu_activated (GtkWidget *item, AddressbookSourceDialog *dialog)
-{
- dialog->scope = g_list_index (gtk_container_get_children (GTK_CONTAINER (item->parent)),
- item);
-
- if (dialog->searching_modify_func)
- dialog->searching_modify_func (item, dialog);
-}
-
-static void
-add_scope_activate_cb (GtkWidget *item, AddressbookSourceDialog *dialog)
-{
- g_signal_connect (item, "activate",
- G_CALLBACK (scope_optionmenu_activated), dialog);
-}
-
-static void
-setup_searching_tab (AddressbookSourceDialog *dialog, ModifyFunc modify_func)
-{
- GtkWidget *menu;
- GtkWidget *rootdn_button;
- GtkWidget *searching_tab_help;
-
- dialog->searching_modify_func = modify_func;
-
- searching_tab_help = glade_xml_get_widget (dialog->gui, "searching-tab-help");
-
- dialog->rootdn = glade_xml_get_widget (dialog->gui, "rootdn-entry");
- add_focus_handler (dialog->rootdn, searching_tab_help, 0);
- if (modify_func)
- g_signal_connect (dialog->rootdn, "changed",
- G_CALLBACK (modify_func), dialog);
-
- dialog->scope_optionmenu = glade_xml_get_widget (dialog->gui, "scope-optionmenu");
- add_focus_handler (dialog->scope_optionmenu, searching_tab_help, 1);
- menu = gtk_option_menu_get_menu (GTK_OPTION_MENU(dialog->scope_optionmenu));
- gtk_container_foreach (GTK_CONTAINER (menu), (GtkCallback)add_scope_activate_cb, dialog);
-
- dialog->timeout_scale = glade_xml_get_widget (dialog->gui, "timeout-scale");
- add_focus_handler (dialog->timeout_scale, searching_tab_help, 2);
- if (modify_func)
- g_signal_connect (GTK_RANGE(dialog->timeout_scale)->adjustment,
- "value_changed",
- G_CALLBACK (modify_func), dialog);
-
- dialog->limit_spinbutton = glade_xml_get_widget (dialog->gui, "download-limit-spinbutton");
- if (modify_func)
- g_signal_connect (dialog->limit_spinbutton, "changed",
- G_CALLBACK (modify_func), dialog);
-
- /* special handling for the "Show Supported Bases button" */
- rootdn_button = glade_xml_get_widget (dialog->gui, "rootdn-button");
- g_signal_connect (rootdn_button, "clicked",
- G_CALLBACK(query_for_supported_bases), dialog);
-}
-
-static void
-druid_searching_page_prepare (GnomeDruidPage *dpage, GtkWidget *gdruid, AddressbookSourceDialog *dialog)
-{
- gnome_druid_set_buttons_sensitive (GNOME_DRUID(dialog->druid),
- TRUE, /* back */
- TRUE, /* next */
- TRUE, /* cancel */
- FALSE /* help */);
-}
-
-#endif
-
-
-/* display name page */
-static gboolean
-display_name_check (AddressbookSourceDialog *dialog)
-{
- gboolean valid = TRUE;
- const char *string;
-
- string = gtk_entry_get_text (GTK_ENTRY (dialog->display_name));
- if (!string || !string[0])
- valid = FALSE;
-
- return valid;
-}
-
-static void
-folder_page_prepare (GtkWidget *page, GtkWidget *gnome_druid, AddressbookSourceDialog *dialog)
-{
- if (!dialog->display_name_changed) {
- const char *server_name = gtk_entry_get_text (GTK_ENTRY (dialog->host));
- gtk_entry_set_text (GTK_ENTRY (dialog->display_name), server_name);
- }
-
- gnome_druid_set_buttons_sensitive (GNOME_DRUID(dialog->druid),
- TRUE, /* back */
- display_name_check (dialog), /* next */
- TRUE, /* cancel */
- FALSE /* help */);
-}
-
-static void
-druid_folder_page_modify_cb (GtkWidget *item, AddressbookSourceDialog *dialog)
-{
- dialog->display_name_changed = TRUE;
- folder_page_prepare (NULL, NULL, dialog);
-}
-
-
-
-static void
-source_group_changed_cb (GtkWidget *widget, AddressbookSourceDialog *sdialog)
-{
- sdialog->source_group = g_slist_nth (e_source_list_peek_groups (sdialog->source_list),
- gtk_option_menu_get_history (GTK_OPTION_MENU (sdialog->group_optionmenu)))->data;
-}
-
-static void
-source_group_menu_add_groups (GtkMenuShell *menu_shell, ESourceList *source_list)
-{
- GSList *groups, *sl;
-
- groups = e_source_list_peek_groups (source_list);
- for (sl = groups; sl; sl = g_slist_next (sl)) {
- GtkWidget *menu_item;
- ESourceGroup *group = sl->data;
-
-#ifndef HAVE_LDAP
- /* If LDAP isn't configured, skip LDAP groups */
- if (!strcmp ("ldap://", e_source_group_peek_base_uri (group)))
- continue;
-#endif
-
- menu_item = gtk_menu_item_new_with_label (e_source_group_peek_name (group));
- gtk_widget_show (menu_item);
- gtk_menu_shell_append (menu_shell, menu_item);
- }
-}
-
-static gboolean
-folder_page_forward (GtkWidget *page, GtkWidget *widget, AddressbookSourceDialog *sdialog)
-{
- GtkWidget *finish_page = glade_xml_get_widget (sdialog->gui, "add-server-druid-finish-page");
-
- if (strcmp ("ldap://", e_source_group_peek_base_uri (sdialog->source_group))) {
- gnome_druid_set_page (GNOME_DRUID (sdialog->druid), GNOME_DRUID_PAGE (finish_page));
- return TRUE;
- }
-
- return FALSE;
-}
-
-static gboolean
-finish_page_back (GtkWidget *page, GtkWidget *widget, AddressbookSourceDialog *sdialog)
-{
- GtkWidget *folder_page = glade_xml_get_widget (sdialog->gui, "add-server-druid-folder-page");
-
- if (strcmp ("ldap://", e_source_group_peek_base_uri (sdialog->source_group))) {
- gnome_druid_set_page (GNOME_DRUID (sdialog->druid), GNOME_DRUID_PAGE (folder_page));
- return TRUE;
- }
-
- return FALSE;
-}
-
-static AddressbookSourceDialog *
-addressbook_add_server_druid (void)
-{
- AddressbookSourceDialog *sdialog = g_new0 (AddressbookSourceDialog, 1);
- GtkWidget *page;
- GConfClient *gconf_client;
-
- sdialog->gui = glade_xml_new (EVOLUTION_GLADEDIR "/" GLADE_FILE_NAME, NULL, NULL);
-
- sdialog->window = glade_xml_get_widget (sdialog->gui, "account-druid-window");
- sdialog->druid = glade_xml_get_widget (sdialog->gui, "account-druid");
-
- /* general page */
- page = glade_xml_get_widget (sdialog->gui, "add-server-druid-folder-page");
- sdialog->display_name = glade_xml_get_widget (sdialog->gui, "druid-display-name-entry");
- g_signal_connect (sdialog->display_name, "changed",
- G_CALLBACK (druid_folder_page_modify_cb), sdialog);
- g_signal_connect_after (page, "prepare",
- G_CALLBACK (folder_page_prepare), sdialog);
- g_signal_connect_after (page, "next",
- G_CALLBACK (folder_page_forward), sdialog);
-
- gconf_client = gconf_client_get_default ();
- sdialog->source_list = e_source_list_new_for_gconf (gconf_client, "/apps/evolution/addressbook/sources");
- sdialog->group_optionmenu = glade_xml_get_widget (sdialog->gui, "druid-group-option-menu");
- if (!GTK_IS_MENU (gtk_option_menu_get_menu (GTK_OPTION_MENU (sdialog->group_optionmenu)))) {
- GtkWidget *menu = gtk_menu_new ();
- gtk_option_menu_set_menu (GTK_OPTION_MENU (sdialog->group_optionmenu), menu);
- gtk_widget_show (menu);
- }
-
- /* NOTE: This assumes that we have sources. If they don't exist, they're set up
- * on startup of the Addressbook component. */
- source_group_menu_add_groups (GTK_MENU_SHELL (gtk_option_menu_get_menu (
- GTK_OPTION_MENU (sdialog->group_optionmenu))), sdialog->source_list);
- gtk_option_menu_set_history (GTK_OPTION_MENU (sdialog->group_optionmenu), 0);
- sdialog->source_group = e_source_list_peek_groups (sdialog->source_list)->data;
- g_signal_connect (sdialog->group_optionmenu, "changed",
- G_CALLBACK (source_group_changed_cb), sdialog);
-
-#ifdef HAVE_LDAP
-
- /* info page */
- page = glade_xml_get_widget (sdialog->gui, "add-server-druid-info-page");
- reparent_to_vbox (sdialog, "account-druid-general-vbox", "general-tab");
- setup_general_tab (sdialog, druid_info_page_modify_cb);
- g_signal_connect_after (page, "prepare",
- G_CALLBACK(druid_info_page_prepare), sdialog);
-
- /* connecting page */
- page = glade_xml_get_widget (sdialog->gui, "add-server-druid-connecting-page");
- reparent_to_vbox (sdialog, "account-druid-connecting-vbox", "connecting-tab");
- setup_connecting_tab (sdialog, druid_connecting_page_modify_cb);
- g_signal_connect_after (page, "prepare",
- G_CALLBACK(druid_connecting_page_prepare), sdialog);
-
- /* searching page */
- page = glade_xml_get_widget (sdialog->gui, "add-server-druid-searching-page");
- reparent_to_vbox (sdialog, "account-druid-searching-vbox", "searching-tab");
- setup_searching_tab (sdialog, NULL);
- g_signal_connect_after (page, "prepare",
- G_CALLBACK(druid_searching_page_prepare), sdialog);
-
-#endif
-
- /* finish page */
- page = glade_xml_get_widget (sdialog->gui, "add-server-druid-finish-page");
- g_signal_connect (page, "finish",
- G_CALLBACK(addressbook_add_server_druid_finish), sdialog);
- g_signal_connect_after (page, "back",
- G_CALLBACK (finish_page_back), sdialog);
- g_signal_connect (sdialog->druid, "cancel",
- G_CALLBACK(addressbook_add_server_druid_cancel), sdialog);
- g_object_weak_ref (G_OBJECT (sdialog->window),
- addressbook_source_dialog_destroy, sdialog);
-
- /* make sure we fill in the default values */
- source_to_dialog (sdialog);
-
- gtk_window_set_type_hint (GTK_WINDOW (sdialog->window), GDK_WINDOW_TYPE_HINT_DIALOG);
- gtk_window_set_modal (GTK_WINDOW (sdialog->window), TRUE);
-
- gtk_widget_show_all (sdialog->window);
-
- return sdialog;
-}
-
-static void
-editor_modify_cb (GtkWidget *item, AddressbookSourceDialog *dialog)
-{
- gboolean valid = TRUE;
-
- valid = display_name_check (dialog);
-#ifdef HAVE_LDAP
- if (valid)
- valid = general_tab_check (dialog);
- if (valid)
- valid = connecting_tab_check (dialog);
-#if 0
- if (valid)
- valid = searching_tab_check (dialog);
-#endif
-#endif
-
- gtk_widget_set_sensitive (dialog->ok_button, valid);
-}
-
-static void
-set_advanced_button_state (AddressbookSourceDialog *dialog)
-{
- if (dialog->advanced) {
- gtk_notebook_set_current_page (GTK_NOTEBOOK(dialog->advanced_button_notebook), 0);
-#ifdef NEW_ADVANCED_UI
- gtk_notebook_append_page (GTK_NOTEBOOK(dialog->notebook), dialog->objectclasses_tab, dialog->objectclasses_label);
- gtk_notebook_append_page (GTK_NOTEBOOK(dialog->notebook), dialog->mappings_tab, dialog->mappings_label);
- gtk_notebook_append_page (GTK_NOTEBOOK(dialog->notebook), dialog->dn_customization_tab, dialog->dn_customization_label);
-#endif
- }
- else {
-#ifdef NEW_ADVANCED_UI
- gtk_notebook_set_current_page (GTK_NOTEBOOK(dialog->advanced_button_notebook), 1);
-
- /* hide the advanced tabs of the main notebook */
- gtk_notebook_remove_page (GTK_NOTEBOOK(dialog->notebook), 5);
- gtk_notebook_remove_page (GTK_NOTEBOOK(dialog->notebook), 4);
- gtk_notebook_remove_page (GTK_NOTEBOOK(dialog->notebook), 3);
-#endif
- }
-}
-
-#ifdef NEW_ADVANCED_UI
-static void
-advanced_button_clicked (GtkWidget *button, AddressbookSourceDialog *dialog)
-{
- dialog->advanced = !dialog->advanced;
- set_advanced_button_state (dialog);
-}
-
-static gboolean
-do_schema_query (AddressbookSourceDialog *sdialog)
-{
- LDAP *ldap;
- int ldap_error;
- char *schema_dn;
- char *attrs[3];
- char **values;
- int i;
- AddressbookSource *source = addressbook_dialog_get_source (sdialog);
- LDAPMessage *resp;
- struct timeval timeout;
-
- ldap = addressbook_ldap_init (sdialog->window, source);
- if (!ldap)
- goto fail;
-
- if (LDAP_SUCCESS != addressbook_ldap_auth (sdialog->window, source, ldap))
- goto fail;
-
- attrs[0] = "subschemaSubentry";
- attrs[1] = NULL;
-
- ldap_error = addressbook_root_dse_query (sdialog->window, source, ldap, attrs, &resp);
-
- if (ldap_error != LDAP_SUCCESS)
- goto fail;
-
- values = ldap_get_values (ldap, resp, "subschemaSubentry");
- if (!values || values[0] == NULL) {
- GtkWidget *dialog;
- dialog = gnome_ok_dialog_parented (_("This server does not support LDAPv3 schema information"), GTK_WINDOW (sdialog->window));
- gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
- goto fail;
- }
-
- schema_dn = g_strdup (values[0]);
-
- ldap_value_free (values);
- ldap_msgfree (resp);
-
- attrs[0] = "objectClasses";
- attrs[1] = NULL;
-
- /* 3 second timeout */
- timeout.tv_sec = 3;
- timeout.tv_usec = 0;
-
- ldap_error = ldap_search_ext_s (ldap, schema_dn, LDAP_SCOPE_BASE,
- "(objectClass=subschema)", attrs, 0,
- NULL, NULL, &timeout, LDAP_NO_LIMIT, &resp);
- if (LDAP_SUCCESS != ldap_error) {
- GtkWidget *dialog;
- dialog = gnome_error_dialog_parented (_("Error retrieving schema information"), GTK_WINDOW (sdialog->window));
- gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
- goto fail;
- }
-
- values = ldap_get_values (ldap, resp, "objectClasses");
- if (!values) {
- GtkWidget *dialog;
- dialog = gnome_error_dialog_parented (_("Server did not respond with valid schema information"), GTK_WINDOW (sdialog->window));
- gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
- goto fail;
- }
-
- for (i = 0; values[i]; i ++) {
- int j;
- int code;
- const char *err;
- LDAPObjectClass *oc = ldap_str2objectclass (values[i], &code, &err, 0);
-
- if (!oc)
- continue;
-
- /* we fill in the default list of classes here */
- for (j = 0; oc->oc_names[j]; j ++) {
- if (!g_strcasecmp (oc->oc_names[j], EVOLUTIONPERSON) ||
- !g_strcasecmp (oc->oc_names[j], INETORGPERSON) ||
- !g_strcasecmp (oc->oc_names[j], ORGANIZATIONALPERSON) ||
- !g_strcasecmp (oc->oc_names[j], PERSON) ||
- !g_strcasecmp (oc->oc_names[j], CALENTRY) ||
- !g_strcasecmp (oc->oc_names[j], TOP))
- g_ptr_array_add (sdialog->default_objectclasses, oc);
- }
-
- g_ptr_array_add (sdialog->server_objectclasses, oc);
- }
-
- addressbook_source_free (source);
- ldap_unbind_s (ldap);
- return TRUE;
-
- fail:
- addressbook_source_free (source);
- if (ldap)
- ldap_unbind_s (ldap);
- return FALSE;
-}
-
-static void
-edit_dialog_switch_page (GtkNotebook *notebook,
- GtkNotebookPage *page, guint page_num,
- AddressbookSourceDialog *sdialog)
-{
- if (page_num >= 3 && !sdialog->schema_query_successful) {
- int i;
-
- gtk_widget_set_sensitive (GTK_WIDGET (notebook), FALSE);
-
- sdialog->schema_query_successful = do_schema_query (sdialog);
-
- if (sdialog->schema_query_successful) {
- /* fill in the objectclasses model */
- for (i = 0; i < sdialog->server_objectclasses->len; i ++) {
- LDAPObjectClass *oc = g_ptr_array_index (sdialog->server_objectclasses, i);
- e_table_memory_store_insert (E_TABLE_MEMORY_STORE (sdialog->objectclasses_server_model),
- -1, oc, oc->oc_names[0]);
- }
- gtk_widget_set_sensitive (page->child, TRUE);
- }
- else {
- gtk_widget_set_sensitive (page->child, FALSE);
- }
-
- gtk_widget_set_sensitive (GTK_WIDGET (notebook), TRUE);
- }
-}
-#endif
-
-static gboolean
-edit_dialog_store_change (AddressbookSourceDialog *sdialog)
-{
- dialog_to_source (sdialog, sdialog->source, FALSE);
-
- /* check the display name for uniqueness */
- if (FALSE /* XXX */) {
- return FALSE;
- }
-
- return TRUE;
-}
-
-static void
-edit_dialog_cancel_clicked (GtkWidget *item, AddressbookSourceDialog *sdialog)
-{
- gtk_widget_destroy (sdialog->window);
-}
-
-static void
-edit_dialog_ok_clicked (GtkWidget *item, AddressbookSourceDialog *sdialog)
-{
- if (edit_dialog_store_change (sdialog)) {
- gtk_widget_destroy (sdialog->window);
- }
-}
-
-void
-addressbook_config_edit_source (GtkWidget *parent, ESource *source)
-{
- AddressbookSourceDialog *sdialog = g_new0 (AddressbookSourceDialog, 1);
- GtkWidget *general_tab_help;
-
- sdialog->gui = glade_xml_new (EVOLUTION_GLADEDIR "/" GLADE_FILE_NAME, NULL, NULL);
- sdialog->window = glade_xml_get_widget (sdialog->gui, "account-editor-window");
-
- sdialog->source = source;
- sdialog->source_group = e_source_peek_group (source);
-
- sdialog->display_name = glade_xml_get_widget (sdialog->gui, "account-editor-display-name-entry");
- g_signal_connect (sdialog->display_name, "changed",
- G_CALLBACK (editor_modify_cb), sdialog);
-
-#ifdef HAVE_LDAP
-
- /* general tab */
- general_tab_help = glade_xml_get_widget (sdialog->gui, "general-tab-help");
- reparent_to_vbox (sdialog, "account-editor-general-ldap-vbox", "general-tab");
- setup_general_tab (sdialog, editor_modify_cb);
-
- /* connecting tab */
- reparent_to_vbox (sdialog, "account-editor-connecting-vbox", "connecting-tab");
- setup_connecting_tab (sdialog, editor_modify_cb);
-
- /* searching tab */
- reparent_to_vbox (sdialog, "account-editor-searching-vbox", "searching-tab");
- setup_searching_tab (sdialog, editor_modify_cb);
-
-#endif
-
- sdialog->notebook = glade_xml_get_widget (sdialog->gui, "account-editor-notebook");
-
- sdialog->ok_button = glade_xml_get_widget (sdialog->gui, "account-editor-ok-button");
- sdialog->cancel_button = glade_xml_get_widget (sdialog->gui, "account-editor-cancel-button");
-
-#ifdef HAVE_LDAP
- if (strcmp ("ldap://", e_source_group_peek_base_uri (sdialog->source_group))) {
- gtk_widget_hide (glade_xml_get_widget (sdialog->gui, "account-editor-general-ldap-vbox"));
- gtk_widget_hide (glade_xml_get_widget (sdialog->gui, "account-editor-connecting-vbox"));
- gtk_widget_hide (glade_xml_get_widget (sdialog->gui, "account-editor-searching-vbox"));
- } else {
- add_focus_handler (sdialog->display_name, general_tab_help, 4);
- }
-#else
- gtk_widget_hide (glade_xml_get_widget (sdialog->gui, "account-editor-general-ldap-vbox"));
- gtk_widget_hide (glade_xml_get_widget (sdialog->gui, "account-editor-connecting-vbox"));
- gtk_widget_hide (glade_xml_get_widget (sdialog->gui, "account-editor-searching-vbox"));
-#endif
-
- source_to_dialog (sdialog);
-
- set_advanced_button_state (sdialog);
-
- g_signal_connect (sdialog->ok_button,
- "clicked", G_CALLBACK(edit_dialog_ok_clicked), sdialog);
- g_signal_connect (sdialog->cancel_button,
- "clicked", G_CALLBACK(edit_dialog_cancel_clicked), sdialog);
- g_object_weak_ref (G_OBJECT (sdialog->window),
- addressbook_source_dialog_destroy, sdialog);
-
- gtk_widget_set_sensitive (sdialog->ok_button, FALSE);
-
- gtk_window_set_type_hint (GTK_WINDOW (sdialog->window), GDK_WINDOW_TYPE_HINT_DIALOG);
- gtk_window_set_modal (GTK_WINDOW (sdialog->window), TRUE);
-
- gtk_widget_show (sdialog->window);
-}
-
-void
-addressbook_config_create_new_source (GtkWidget *parent)
-{
- AddressbookSourceDialog *dialog;
-
- dialog = addressbook_add_server_druid ();
-}
-
-#if 0
-#ifdef STANDALONE
-int
-main(int argc, char **argv)
-{
- AddressbookDialog *dialog;
-
- gnome_init_with_popt_table ("evolution-addressbook", "0.0",
- argc, argv, oaf_popt_options, 0, NULL);
-
- glade_init ();
-
- bindtextdomain (GETTEXT_PACKAGE, EVOLUTION_LOCALEDIR);
- textdomain (GETTEXT_PACKAGE);
-
-#if 0
- g_log_set_always_fatal (G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING);
-#endif
-
- gtk_widget_push_colormap (gdk_rgb_get_cmap ());
-
- dialog = ldap_dialog_new (NULL);
-
- gtk_widget_show (glade_xml_get_widget (dialog->gui, "addressbook-sources-window"));
-
- gtk_main();
-
- return 0;
-}
-#endif
-
-#endif
diff --git a/addressbook/gui/component/addressbook-config.h b/addressbook/gui/component/addressbook-config.h
deleted file mode 100644
index b5800bc123..0000000000
--- a/addressbook/gui/component/addressbook-config.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* addressbook-storage.h
- *
- * Copyright (C) 2000 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors:
- * Chris Toshok <toshok@ximian.com>
- * Chris Lahey <clahey@ximian.com>
- **/
-
-#ifndef __ADDRESSBOOK_CONFIG_H__
-#define __ADDRESSBOOK_CONFIG_H__
-
-#include "evolution-config-control.h"
-
-typedef enum {
- ADDRESSBOOK_LDAP_AUTH_NONE,
- ADDRESSBOOK_LDAP_AUTH_SIMPLE_EMAIL,
- ADDRESSBOOK_LDAP_AUTH_SIMPLE_BINDDN,
-} AddressbookLDAPAuthType;
-
-typedef enum {
- ADDRESSBOOK_LDAP_SCOPE_ONELEVEL,
- ADDRESSBOOK_LDAP_SCOPE_SUBTREE,
- ADDRESSBOOK_LDAP_SCOPE_BASE,
- ADDRESSBOOK_LDAP_SCOPE_LAST
-} AddressbookLDAPScopeType;
-
-typedef enum {
- ADDRESSBOOK_LDAP_SSL_ALWAYS,
- ADDRESSBOOK_LDAP_SSL_WHENEVER_POSSIBLE,
- ADDRESSBOOK_LDAP_SSL_NEVER
-} AddressbookLDAPSSLType;
-
-void addressbook_config_edit_source (GtkWidget *parent, ESource *source);
-void addressbook_config_create_new_source (GtkWidget *parent);
-
-#endif /* __ADDRESSBOOK_CONFIG_H__ */
diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c
deleted file mode 100644
index f415c903e9..0000000000
--- a/addressbook/gui/component/addressbook.c
+++ /dev/null
@@ -1,1087 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* addressbook.c
- *
- * Copyright (C) 2000, 2001, 2002 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Chris Lahey (clahey@ximian.com)
- */
-
-#include <config.h>
-
-#include <string.h>
-#include <glib.h>
-#include <gtk/gtkvbox.h>
-#include <gtk/gtkwidget.h>
-#include <gtk/gtkmessagedialog.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnomeui/gnome-app.h>
-#include <libgnomeui/gnome-href.h>
-#include <libgnomeui/gnome-uidefs.h>
-#include <bonobo/bonobo-generic-factory.h>
-#include <bonobo/bonobo-ui-util.h>
-#include <bonobo/bonobo-exception.h>
-#include <bonobo/bonobo-property-bag.h>
-#include <gal/util/e-util.h>
-
-#include "e-util/e-categories-master-list-wombat.h"
-#include "e-util/e-sexp.h"
-#include "e-util/e-passwords.h"
-
-#include "evolution-shell-component-utils.h"
-#include "e-activity-handler.h"
-#include "e-contact-editor.h"
-#include "addressbook-config.h"
-#include "addressbook.h"
-#include "addressbook-component.h"
-#include "addressbook/gui/search/e-addressbook-search-dialog.h"
-#include "addressbook/gui/widgets/e-addressbook-view.h"
-#include "addressbook/gui/widgets/eab-gui-util.h"
-#include "addressbook/printing/e-contact-print.h"
-#include "addressbook/util/eab-book-util.h"
-
-#include <libebook/e-book-async.h>
-#include <widgets/misc/e-search-bar.h>
-#include <widgets/misc/e-filter-bar.h>
-
-/* This is used for the addressbook status bar */
-#define EVOLUTION_CONTACTS_PROGRESS_IMAGE "evolution-contacts-mini.png"
-static GdkPixbuf *progress_icon = NULL;
-
-#define d(x)
-
-#define PROPERTY_SOURCE_UID "source_uid"
-
-#define PROPERTY_SOURCE_UID_IDX 1
-
-typedef struct {
- gint refs;
- EABView *view;
- ESearchBar *search;
- gint ecml_changed_id;
- GtkWidget *vbox;
- EBook *book;
- guint activity_id;
- BonoboControl *control;
- BonoboPropertyBag *properties;
- GConfClient *gconf_client;
- ESourceList *source_list;
- ESource *source;
- char *passwd;
- gboolean ignore_search_changes;
- gboolean failed_to_load;
-} AddressbookView;
-
-static void addressbook_view_ref (AddressbookView *);
-static void addressbook_view_unref (AddressbookView *);
-
-static void addressbook_authenticate (EBook *book, gboolean previous_failure,
- ESource *source, EBookCallback cb, gpointer closure);
-
-static void book_open_cb (EBook *book, EBookStatus status, gpointer closure);
-
-static void
-save_contact_cb (BonoboUIComponent *uih, void *user_data, const char *path)
-{
- AddressbookView *view = (AddressbookView *) user_data;
- if (view->view)
- eab_view_save_as(view->view);
-}
-
-static void
-view_contact_cb (BonoboUIComponent *uih, void *user_data, const char *path)
-{
- AddressbookView *view = (AddressbookView *) user_data;
- if (view->view)
- eab_view_view(view->view);
-}
-
-static void
-search_cb (BonoboUIComponent *uih, void *user_data, const char *path)
-{
- AddressbookView *view = (AddressbookView *) user_data;
-
- if (view->view)
- gtk_widget_show(eab_search_dialog_new(view->view));
-}
-
-static void
-delete_contact_cb (BonoboUIComponent *uih, void *user_data, const char *path)
-{
- AddressbookView *view = (AddressbookView *) user_data;
- if (view->view) {
- eab_view_delete_selection(view->view);
- }
-}
-
-static void
-print_cb (BonoboUIComponent *uih, void *user_data, const char *path)
-{
- AddressbookView *view = (AddressbookView *) user_data;
- if (view->view)
- eab_view_print(view->view);
-}
-
-static void
-print_preview_cb (BonoboUIComponent *uih, void *user_data, const char *path)
-{
- AddressbookView *view = (AddressbookView *) user_data;
- if (view->view)
- eab_view_print_preview(view->view);
-}
-
-static void
-stop_loading_cb (BonoboUIComponent *uih, void *user_data, const char *path)
-{
- AddressbookView *view = (AddressbookView *) user_data;
- if (view->view)
- eab_view_stop(view->view);
-}
-
-static void
-cut_contacts_cb (BonoboUIComponent *uih, void *user_data, const char *path)
-{
- AddressbookView *view = (AddressbookView *) user_data;
- if (view->view)
- eab_view_cut(view->view);
-}
-
-static void
-copy_contacts_cb (BonoboUIComponent *uih, void *user_data, const char *path)
-{
- AddressbookView *view = (AddressbookView *) user_data;
- if (view->view)
- eab_view_copy(view->view);
-}
-
-static void
-paste_contacts_cb (BonoboUIComponent *uih, void *user_data, const char *path)
-{
- AddressbookView *view = (AddressbookView *) user_data;
- if (view->view)
- eab_view_paste(view->view);
-}
-
-static void
-select_all_contacts_cb (BonoboUIComponent *uih, void *user_data, const char *path)
-{
- AddressbookView *view = (AddressbookView *) user_data;
- if (view->view)
- eab_view_select_all (view->view);
-}
-
-static void
-send_contact_cb (BonoboUIComponent *uih, void *user_data, const char *path)
-{
- AddressbookView *view = (AddressbookView *) user_data;
- if (view->view)
- eab_view_send (view->view);
-}
-
-static void
-send_contact_to_cb (BonoboUIComponent *uih, void *user_data, const char *path)
-{
- AddressbookView *view = (AddressbookView *) user_data;
- if (view->view)
- eab_view_send_to (view->view);
-}
-
-static void
-copy_contact_to_cb (BonoboUIComponent *uih, void *user_data, const char *path)
-{
- AddressbookView *view = (AddressbookView *) user_data;
- if (view->view)
- eab_view_copy_to_folder (view->view);
-}
-
-static void
-move_contact_to_cb (BonoboUIComponent *uih, void *user_data, const char *path)
-{
- AddressbookView *view = (AddressbookView *) user_data;
- if (view->view)
- eab_view_move_to_folder (view->view);
-}
-
-static void
-forget_passwords_cb (BonoboUIComponent *uih, void *user_data, const char *path)
-{
- e_passwords_forget_passwords();
-}
-
-static void
-update_command_state (EABView *eav, AddressbookView *view)
-{
- BonoboUIComponent *uic;
-
- if (view->view == NULL)
- return;
-
- addressbook_view_ref (view);
-
- uic = bonobo_control_get_ui_component (view->control);
-
- if (bonobo_ui_component_get_container (uic) != CORBA_OBJECT_NIL) {
- bonobo_ui_component_set_prop (uic,
- "/commands/ContactsSaveAsVCard",
- "sensitive",
- eab_view_can_save_as (view->view) ? "1" : "0", NULL);
- bonobo_ui_component_set_prop (uic,
- "/commands/ContactsView",
- "sensitive",
- eab_view_can_view (view->view) ? "1" : "0", NULL);
-
- /* Print Contact */
- bonobo_ui_component_set_prop (uic,
- "/commands/ContactsPrint",
- "sensitive",
- eab_view_can_print (view->view) ? "1" : "0", NULL);
-
- /* Print Contact */
- bonobo_ui_component_set_prop (uic,
- "/commands/ContactsPrintPreview",
- "sensitive",
- eab_view_can_print (view->view) ? "1" : "0", NULL);
-
- /* Delete Contact */
- bonobo_ui_component_set_prop (uic,
- "/commands/ContactDelete",
- "sensitive",
- eab_view_can_delete (view->view) ? "1" : "0", NULL);
-
- bonobo_ui_component_set_prop (uic,
- "/commands/ContactsCut",
- "sensitive",
- eab_view_can_cut (view->view) ? "1" : "0", NULL);
- bonobo_ui_component_set_prop (uic,
- "/commands/ContactsCopy",
- "sensitive",
- eab_view_can_copy (view->view) ? "1" : "0", NULL);
- bonobo_ui_component_set_prop (uic,
- "/commands/ContactsPaste",
- "sensitive",
- eab_view_can_paste (view->view) ? "1" : "0", NULL);
- bonobo_ui_component_set_prop (uic,
- "/commands/ContactsSelectAll",
- "sensitive",
- eab_view_can_select_all (view->view) ? "1" : "0", NULL);
-
- bonobo_ui_component_set_prop (uic,
- "/commands/ContactsSendContactToOther",
- "sensitive",
- eab_view_can_send (view->view) ? "1" : "0", NULL);
-
- bonobo_ui_component_set_prop (uic,
- "/commands/ContactsSendMessageToContact",
- "sensitive",
- eab_view_can_send_to (view->view) ? "1" : "0", NULL);
-
- bonobo_ui_component_set_prop (uic,
- "/commands/ContactsMoveToFolder",
- "sensitive",
- eab_view_can_move_to_folder (view->view) ? "1" : "0", NULL);
- bonobo_ui_component_set_prop (uic,
- "/commands/ContactsCopyToFolder",
- "sensitive",
- eab_view_can_copy_to_folder (view->view) ? "1" : "0", NULL);
-
- /* Stop */
- bonobo_ui_component_set_prop (uic,
- "/commands/ContactStop",
- "sensitive",
- eab_view_can_stop (view->view) ? "1" : "0", NULL);
- }
-
- addressbook_view_unref (view);
-}
-
-static void
-change_view_type (AddressbookView *view, EABViewType view_type)
-{
- g_object_set (view->view, "type", view_type, NULL);
-}
-
-static BonoboUIVerb verbs [] = {
- BONOBO_UI_UNSAFE_VERB ("ContactsPrint", print_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactsPrintPreview", print_preview_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactsSaveAsVCard", save_contact_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactsView", view_contact_cb),
- BONOBO_UI_UNSAFE_VERB ("ToolSearch", search_cb),
-
- BONOBO_UI_UNSAFE_VERB ("ContactDelete", delete_contact_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactStop", stop_loading_cb),
-
- BONOBO_UI_UNSAFE_VERB ("ContactsCut", cut_contacts_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactsCopy", copy_contacts_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactsPaste", paste_contacts_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactsSelectAll", select_all_contacts_cb),
-
- BONOBO_UI_UNSAFE_VERB ("ContactsSendContactToOther", send_contact_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactsSendMessageToContact", send_contact_to_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactsMoveToFolder", move_contact_to_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactsCopyToFolder", copy_contact_to_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactsForgetPasswords", forget_passwords_cb),
-
- BONOBO_UI_VERB_END
-};
-
-static EPixmap pixmaps [] = {
- E_PIXMAP ("/menu/File/FileOps/ContactsSaveAsVCard", "save-as-16.png"),
- E_PIXMAP ("/menu/File/Print/ContactsPrint", "print.xpm"),
- E_PIXMAP ("/menu/File/Print/ContactsPrintPreview", "print-preview.xpm"),
-
- E_PIXMAP ("/menu/EditPlaceholder/Edit/ContactsCut", "16_cut.png"),
- E_PIXMAP ("/menu/EditPlaceholder/Edit/ContactsCopy", "16_copy.png"),
- E_PIXMAP ("/menu/EditPlaceholder/Edit/ContactsPaste", "16_paste.png"),
- E_PIXMAP ("/menu/EditPlaceholder/Edit/ContactDelete", "evolution-trash-mini.png"),
-
- E_PIXMAP ("/menu/Tools/ComponentPlaceholder/ToolSearch", "search-16.png"),
-
- E_PIXMAP ("/Toolbar/ContactsPrint", "buttons/print.png"),
- E_PIXMAP ("/Toolbar/ContactDelete", "buttons/delete-message.png"),
-
- E_PIXMAP_END
-};
-
-static void
-control_activate (BonoboControl *control,
- BonoboUIComponent *uic,
- AddressbookView *view)
-{
- Bonobo_UIContainer remote_ui_container;
-
- remote_ui_container = bonobo_control_get_remote_ui_container (control, NULL);
- bonobo_ui_component_set_container (uic, remote_ui_container, NULL);
- bonobo_object_release_unref (remote_ui_container, NULL);
-
- e_search_bar_set_ui_component (view->search, uic);
-
- bonobo_ui_component_add_verb_list_with_data (
- uic, verbs, view);
-
- bonobo_ui_component_freeze (uic, NULL);
-
- bonobo_ui_util_set_ui (uic, PREFIX,
- EVOLUTION_UIDIR "/evolution-addressbook.xml",
- "evolution-addressbook", NULL);
-
- eab_view_setup_menus (view->view, uic);
-
- e_pixmaps_update (uic, pixmaps);
-
- bonobo_ui_component_thaw (uic, NULL);
-
- update_command_state (view->view, view);
-}
-
-static void
-control_activate_cb (BonoboControl *control,
- gboolean activate,
- AddressbookView *view)
-{
- BonoboUIComponent *uic;
-
- uic = bonobo_control_get_ui_component (control);
- g_assert (uic != NULL);
-
- if (activate) {
- control_activate (control, uic, view);
- if (activate && view->view && view->view->model)
- eab_model_force_folder_bar_message (view->view->model);
-
- /* if the book failed to load, we kick off another
- load here */
-
- if (view->failed_to_load && view->source) {
- EBook *book;
-
- book = e_book_new ();
-
- addressbook_load_source (book, view->source, book_open_cb, view);
- }
- } else {
- bonobo_ui_component_unset_container (uic, NULL);
- eab_view_discard_menus (view->view);
- }
-}
-
-static ECategoriesMasterList *
-get_master_list (void)
-{
- static ECategoriesMasterList *category_list = NULL;
-
- if (category_list == NULL)
- category_list = e_categories_master_list_wombat_new ();
- return category_list;
-}
-
-static void
-addressbook_view_clear (AddressbookView *view)
-{
- if (view->book) {
- g_object_unref (view->book);
- view->book = NULL;
- }
-
- if (view->properties) {
- bonobo_object_unref (BONOBO_OBJECT(view->properties));
- view->properties = NULL;
- }
-
- g_free(view->passwd);
- view->passwd = NULL;
-
- if (view->source_list) {
- g_object_unref (view->source_list);
- view->source_list = NULL;
- }
-
- if (view->ecml_changed_id != 0) {
- g_signal_handler_disconnect (get_master_list(),
- view->ecml_changed_id);
- view->ecml_changed_id = 0;
- }
-}
-
-static void
-addressbook_view_ref (AddressbookView *view)
-{
- g_assert (view->refs > 0);
- ++view->refs;
-}
-
-static void
-addressbook_view_unref (AddressbookView *view)
-{
- g_assert (view->refs > 0);
- --view->refs;
- if (view->refs == 0) {
- addressbook_view_clear (view);
- g_free (view);
- }
-}
-
-static void
-book_open_cb (EBook *book, EBookStatus status, gpointer closure)
-{
- AddressbookView *view = closure;
-
- if (status == E_BOOK_ERROR_OK) {
- view->failed_to_load = FALSE;
- g_object_set(view->view,
- "book", book,
- NULL);
- view->book = book;
- }
- else {
- char *label_string;
- GtkWidget *warning_dialog;
- GtkWidget *href = NULL;
- gchar *uri;
-
- view->failed_to_load = TRUE;
-
- uri = e_source_get_uri (view->source);
-
- if (!strncmp (uri, "file:", 5)) {
- label_string =
- _("We were unable to open this addressbook. Please check that the\n"
- "path exists and that you have permission to access it.");
- }
- else if (!strncmp (uri, "ldap:", 5)) {
- /* special case for ldap: contact folders so we can tell the user about openldap */
-#if HAVE_LDAP
- label_string =
- _("We were unable to open this addressbook. This either\n"
- "means you have entered an incorrect URI, or the LDAP server\n"
- "is unreachable.");
-#else
- label_string =
- _("This version of Evolution does not have LDAP support\n"
- "compiled in to it. If you want to use LDAP in Evolution\n"
- "you must compile the program from the CVS sources after\n"
- "retrieving OpenLDAP from the link below.\n");
- href = gnome_href_new ("http://www.openldap.org/", "OpenLDAP at http://www.openldap.org/");
-#endif
- } else {
- /* other network folders */
- label_string =
- _("We were unable to open this addressbook. This either\n"
- "means you have entered an incorrect URI, or the server\n"
- "is unreachable.");
- }
-
- warning_dialog = gtk_message_dialog_new (
- NULL /* XXX */,
- 0,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_CLOSE,
- label_string,
- NULL);
-
- g_signal_connect (warning_dialog,
- "response",
- G_CALLBACK (gtk_widget_destroy),
- warning_dialog);
-
- gtk_window_set_title (GTK_WINDOW (warning_dialog), _("Unable to open addressbook"));
-
- if (href)
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (warning_dialog)->vbox),
- href, FALSE, FALSE, 0);
-
- gtk_widget_show_all (warning_dialog);
-
- g_free (uri);
- }
-}
-
-static void
-destroy_callback(gpointer data, GObject *where_object_was)
-{
- AddressbookView *view = data;
- addressbook_view_unref (view);
-}
-
-static void
-get_prop (BonoboPropertyBag *bag,
- BonoboArg *arg,
- guint arg_id,
- CORBA_Environment *ev,
- gpointer user_data)
-{
- AddressbookView *view = user_data;
-
- switch (arg_id) {
-
- case PROPERTY_SOURCE_UID_IDX:
- if (view && view->source)
- BONOBO_ARG_SET_STRING (arg, e_source_peek_uid (view->source));
- else
- BONOBO_ARG_SET_STRING (arg, "");
- break;
-
- default:
- g_warning ("Unhandled arg %d\n", arg_id);
- }
-}
-
-typedef struct {
- EBookCallback cb;
- ESource *source;
- gpointer closure;
-} LoadSourceData;
-
-static void
-load_source_auth_cb (EBook *book, EBookStatus status, gpointer closure)
-{
- LoadSourceData *data = closure;
-
- if (status != E_BOOK_ERROR_OK) {
- if (status == E_BOOK_ERROR_CANCELLED) {
- /* the user clicked cancel in the password dialog */
- GtkWidget *dialog;
- dialog = gtk_message_dialog_new (NULL,
- 0,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_OK,
- _("Accessing LDAP Server anonymously"));
- g_signal_connect (dialog, "response", G_CALLBACK(gtk_widget_destroy), NULL);
- gtk_widget_show (dialog);
- data->cb (book, E_BOOK_ERROR_OK, data->closure);
- g_free (data);
- return;
- }
- else {
- gchar *uri = e_source_get_uri (data->source);
-
- e_passwords_forget_password ("Addressbook", uri);
- addressbook_authenticate (book, TRUE, data->source, load_source_auth_cb, closure);
-
- g_free (uri);
- return;
- }
- }
-
- data->cb (book, status, data->closure);
-
- g_object_unref (data->source);
- g_free (data);
-}
-
-static gboolean
-get_remember_password (ESource *source)
-{
- const gchar *value;
-
- value = e_source_get_property (source, "remember_password");
- if (value && !strcasecmp (value, "true"))
- return TRUE;
-
- return FALSE;
-}
-
-static void
-set_remember_password (ESource *source, gboolean value)
-{
- e_source_set_property (source, "remember_password",
- value ? "true" : "false");
-}
-
-static void
-addressbook_authenticate (EBook *book, gboolean previous_failure, ESource *source,
- EBookCallback cb, gpointer closure)
-{
- const char *password = NULL;
- char *pass_dup = NULL;
- const gchar *auth;
- const gchar *user;
- gchar *uri = e_source_get_uri (source);
-
- password = e_passwords_get_password ("Addressbook", uri);
-
- auth = e_source_get_property (source, "auth");
-
- if (auth && !strcmp ("ldap/simple-binddn", auth))
- user = e_source_get_property (source, "binddn");
- else
- user = e_source_get_property (source, "email_addr");
- if (!user)
- user = "";
-
- if (!password) {
- char *prompt;
- gboolean remember;
- char *failed_auth;
-
- if (previous_failure) {
- failed_auth = _("Failed to authenticate.\n");
- }
- else {
- failed_auth = "";
- }
-
- prompt = g_strdup_printf (_("%sEnter password for %s (user %s)"),
- failed_auth, e_source_peek_name (source), user);
-
- remember = get_remember_password (source);
- pass_dup = e_passwords_ask_password (prompt, "Addressbook", uri, prompt, TRUE,
- E_PASSWORDS_REMEMBER_FOREVER, &remember,
- NULL);
- if (remember != get_remember_password (source))
- set_remember_password (source, remember);
-
- g_free (prompt);
- }
-
- if (password || pass_dup) {
- e_book_async_authenticate_user (book, user, password ? password : pass_dup,
- e_source_get_property (source, "auth"),
- cb, closure);
- g_free (pass_dup);
- }
- else {
- /* they hit cancel */
- cb (book, E_BOOK_ERROR_CANCELLED, closure);
- }
-
- g_free (uri);
-}
-
-static void
-load_source_cb (EBook *book, EBookStatus status, gpointer closure)
-{
- LoadSourceData *load_source_data = closure;
-
- if (status == E_BOOK_ERROR_OK && book != NULL) {
- const gchar *auth;
-
- auth = e_source_get_property (load_source_data->source, "auth");
-
- /* check if the addressbook needs authentication */
-
- if (auth && strcmp (auth, "none")) {
- addressbook_authenticate (book, FALSE, load_source_data->source,
- load_source_auth_cb, closure);
-
- return;
- }
- }
-
- load_source_data->cb (book, status, load_source_data->closure);
- g_object_unref (load_source_data->source);
- g_free (load_source_data);
-}
-
-void
-addressbook_load_source (EBook *book, ESource *source,
- EBookCallback cb, gpointer closure)
-{
- LoadSourceData *load_source_data = g_new0 (LoadSourceData, 1);
-
- load_source_data->cb = cb;
- load_source_data->closure = closure;
- load_source_data->source = g_object_ref (source);
-
- e_book_async_load_source (book, source, load_source_cb, load_source_data);
-}
-
-void
-addressbook_load_default_book (EBookCallback cb, gpointer closure)
-{
- LoadSourceData *load_source_data = g_new (LoadSourceData, 1);
-
- /* FIXME: We need to get the source for the default book */
-
- load_source_data->cb = cb;
- load_source_data->closure = closure;
-
- e_book_async_get_default_addressbook (load_source_cb, load_source_data);
-}
-
-static void
-set_prop (BonoboPropertyBag *bag,
- const BonoboArg *arg,
- guint arg_id,
- CORBA_Environment *ev,
- gpointer user_data)
-{
- AddressbookView *view = user_data;
- const gchar *uid;
-
- switch (arg_id) {
-
- case PROPERTY_SOURCE_UID_IDX:
- if (view->book) {
- /* we've already had a uri set on this view, so unload it */
- e_book_async_unload_uri (view->book);
- view->source = NULL;
- } else {
- view->book = e_book_new ();
- }
-
- view->failed_to_load = FALSE;
-
- uid = BONOBO_ARG_GET_STRING (arg);
- view->source = e_source_list_peek_source_by_uid (view->source_list, uid);
-
- if (view->source)
- addressbook_load_source (view->book, view->source, book_open_cb, view);
- else
- g_warning ("Could not find source by UID '%s'!", uid);
-
- break;
-
- default:
- g_warning ("Unhandled arg %d\n", arg_id);
- break;
- }
-}
-
-enum {
- ESB_FULL_NAME,
- ESB_EMAIL,
- ESB_CATEGORY,
- ESB_ANY,
- ESB_ADVANCED
-};
-
-static ESearchBarItem addressbook_search_option_items[] = {
- { N_("Name begins with"), ESB_FULL_NAME, NULL },
- { N_("Email begins with"), ESB_EMAIL, NULL },
- { N_("Category is"), ESB_CATEGORY, NULL }, /* We attach subitems below */
- { N_("Any field contains"), ESB_ANY, NULL },
- { N_("Advanced..."), ESB_ADVANCED, NULL },
- { NULL, -1, NULL }
-};
-
-static void
-addressbook_search_activated (ESearchBar *esb, AddressbookView *view)
-{
- ECategoriesMasterList *master_list;
- char *search_word, *search_query;
- const char *category_name;
- int search_type, subid;
-
- if (view->ignore_search_changes) {
- return;
- }
-
- g_object_get(esb,
- "text", &search_word,
- "item_id", &search_type,
- NULL);
-
- if (search_type == ESB_ADVANCED) {
- gtk_widget_show(eab_search_dialog_new(view->view));
- }
- else {
- if ((search_word && strlen (search_word)) || search_type == ESB_CATEGORY) {
- GString *s = g_string_new ("");
- e_sexp_encode_string (s, search_word);
- switch (search_type) {
- case ESB_ANY:
- search_query = g_strdup_printf ("(contains \"x-evolution-any-field\" %s)",
- s->str);
- break;
- case ESB_FULL_NAME:
- search_query = g_strdup_printf ("(beginswith \"full_name\" %s)",
- s->str);
- break;
- case ESB_EMAIL:
- search_query = g_strdup_printf ("(beginswith \"email\" %s)",
- s->str);
- break;
- case ESB_CATEGORY:
- subid = e_search_bar_get_subitem_id (esb);
-
- if (subid < 0 || subid == G_MAXINT) {
- /* match everything */
- search_query = g_strdup ("(contains \"x-evolution-any-field\" \"\")");
- } else {
- master_list = get_master_list ();
- category_name = e_categories_master_list_nth (master_list, subid);
- search_query = g_strdup_printf ("(is \"category\" \"%s\")", category_name);
- }
- break;
- default:
- search_query = g_strdup ("(contains \"x-evolution-any-field\" \"\")");
- break;
- }
- g_string_free (s, TRUE);
- } else
- search_query = g_strdup ("(contains \"x-evolution-any-field\" \"\")");
-
- if (search_query)
- g_object_set (view->view,
- "query", search_query,
- NULL);
-
- g_free (search_query);
- }
-
- g_free (search_word);
-}
-
-static void
-addressbook_query_changed (ESearchBar *esb, AddressbookView *view)
-{
- int search_type;
-
- g_object_get(esb,
- "item_id", &search_type,
- NULL);
-
- if (search_type == ESB_ADVANCED) {
- gtk_widget_show(eab_search_dialog_new(view->view));
- }
-}
-
-static void
-set_status_message (EABView *eav, const char *message, AddressbookView *view)
-{
- EActivityHandler *activity_handler = addressbook_component_peek_activity_handler (addressbook_component_peek ());
-
- if (!message || !*message) {
- if (view->activity_id != 0) {
- e_activity_handler_operation_finished (activity_handler, view->activity_id);
- view->activity_id = 0;
- }
- } else if (view->activity_id == 0) {
- char *clientid = g_strdup_printf ("%p", view);
-
- if (progress_icon == NULL)
- progress_icon = gdk_pixbuf_new_from_file (EVOLUTION_IMAGESDIR "/" EVOLUTION_CONTACTS_PROGRESS_IMAGE, NULL);
-
- view->activity_id = e_activity_handler_operation_started (activity_handler, clientid,
- progress_icon, message, TRUE);
-
- g_free (clientid);
- } else {
- e_activity_handler_operation_progressing (activity_handler, view->activity_id, message, -1.0);
- }
-
-}
-
-static void
-search_result (EABView *eav, EBookViewStatus status, AddressbookView *view)
-{
- char *str = NULL;
-
- switch (status) {
- case E_BOOK_VIEW_STATUS_OK:
- return;
- case E_BOOK_VIEW_STATUS_SIZE_LIMIT_EXCEEDED:
- str = _("More cards matched this query than either the server is \n"
- "configured to return or Evolution is configured to display.\n"
- "Please make your search more specific or raise the result limit in\n"
- "the directory server preferences for this addressbook.");
- break;
- case E_BOOK_VIEW_STATUS_TIME_LIMIT_EXCEEDED:
- str = _("The time to execute this query exceeded the server limit or the limit\n"
- "you have configured for this addressbook. Please make your search\n"
- "more specific or raise the time limit in the directory server\n"
- "preferences for this addressbook.");
- break;
- case E_BOOK_VIEW_ERROR_INVALID_QUERY:
- str = _("The backend for this addressbook was unable to parse this query.");
- break;
- case E_BOOK_VIEW_ERROR_QUERY_REFUSED:
- str = _("The backend for this addressbook refused to perform this query.");
- break;
- case E_BOOK_VIEW_ERROR_OTHER_ERROR:
- str = _("This query did not complete successfully.");
- break;
- }
-
- if (str) {
- GtkWidget *dialog;
- dialog = gtk_message_dialog_new (NULL,
- 0,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_OK,
- str);
- g_signal_connect (dialog, "response", G_CALLBACK(gtk_widget_destroy), NULL);
- gtk_widget_show (dialog);
- }
-}
-
-static int
-compare_subitems (const void *a, const void *b)
-{
- const ESearchBarSubitem *subitem_a = a;
- const ESearchBarSubitem *subitem_b = b;
-
- return strcoll (subitem_a->text, subitem_b->text);
-}
-
-static void
-make_suboptions (AddressbookView *view)
-{
- ESearchBarSubitem *subitems, *s;
- ECategoriesMasterList *master_list;
- gint i, N;
-
- master_list = get_master_list ();
- N = e_categories_master_list_count (master_list);
- subitems = g_new (ESearchBarSubitem, N+2);
-
- subitems[0].id = G_MAXINT;
- subitems[0].text = g_strdup (_("Any Category"));
- subitems[0].translate = FALSE;
-
- for (i=0; i<N; ++i) {
- const char *category = e_categories_master_list_nth (master_list, i);
-
- subitems[i+1].id = i;
- subitems[i+1].text = g_strdup (category);
- subitems[i+1].translate = FALSE;
- }
- subitems[N+1].id = -1;
- subitems[N+1].text = NULL;
-
- qsort (subitems + 1, N, sizeof (subitems[0]), compare_subitems);
-
- e_search_bar_set_suboption (view->search, ESB_CATEGORY, subitems);
-
- for (s = subitems; s->id != -1; s++) {
- if (s->text)
- g_free (s->text);
- }
- g_free (subitems);
-}
-
-static void
-ecml_changed (ECategoriesMasterList *ecml, AddressbookView *view)
-{
- make_suboptions (view);
-}
-
-static void
-connect_master_list_changed (AddressbookView *view)
-{
- view->ecml_changed_id =
- g_signal_connect (get_master_list(), "changed",
- G_CALLBACK (ecml_changed), view);
-}
-
-BonoboControl *
-addressbook_new_control (void)
-{
- AddressbookView *view;
-
- view = g_new0 (AddressbookView, 1);
- view->refs = 1;
- view->ignore_search_changes = FALSE;
-
- view->vbox = gtk_vbox_new (FALSE, 0);
-
- g_object_weak_ref (G_OBJECT (view->vbox), destroy_callback, view);
-
- /* Create the control. */
- view->control = bonobo_control_new (view->vbox);
-
- view->search = E_SEARCH_BAR (e_search_bar_new (NULL, addressbook_search_option_items));
- make_suboptions (view);
- connect_master_list_changed (view);
-
- gtk_box_pack_start (GTK_BOX (view->vbox), GTK_WIDGET (view->search),
- FALSE, FALSE, 0);
- g_signal_connect (view->search, "query_changed",
- G_CALLBACK (addressbook_query_changed), view);
- g_signal_connect (view->search, "search_activated",
- G_CALLBACK (addressbook_search_activated), view);
-
- view->view = EAB_VIEW(eab_view_new());
- gtk_box_pack_start (GTK_BOX (view->vbox), GTK_WIDGET (view->view),
- TRUE, TRUE, 0);
-
- /* create the initial view */
- change_view_type (view, EAB_VIEW_TABLE);
-
- gtk_widget_show (view->vbox);
- gtk_widget_show (GTK_WIDGET(view->view));
- gtk_widget_show (GTK_WIDGET(view->search));
-
- view->properties = bonobo_property_bag_new (get_prop, set_prop, view);
-
- bonobo_property_bag_add (view->properties,
- PROPERTY_SOURCE_UID, PROPERTY_SOURCE_UID_IDX,
- BONOBO_ARG_STRING, NULL,
- _("UID of the contacts source that the view will display"), 0);
-
- bonobo_control_set_properties (view->control,
- bonobo_object_corba_objref (BONOBO_OBJECT (view->properties)),
- NULL);
-
- g_signal_connect (view->view, "status_message",
- G_CALLBACK(set_status_message), view);
-
- g_signal_connect (view->view, "search_result",
- G_CALLBACK(search_result), view);
-
- g_signal_connect (view->view, "command_state_change",
- G_CALLBACK(update_command_state), view);
-
- view->gconf_client = gconf_client_get_default ();
- view->source_list = e_source_list_new_for_gconf (view->gconf_client,
- "/apps/evolution/addressbook/sources");
- view->source = NULL;
-
- g_signal_connect (view->control, "activate",
- G_CALLBACK (control_activate_cb), view);
-
- return view->control;
-}
diff --git a/addressbook/gui/component/addressbook.h b/addressbook/gui/component/addressbook.h
deleted file mode 100644
index fb05287133..0000000000
--- a/addressbook/gui/component/addressbook.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef __ADDRESSBOOK_H__
-#define __ADDRESSBOOK_H__
-
-#include <bonobo/bonobo-control.h>
-#include <e-util/e-config-listener.h>
-#include <bonobo/bonobo-object.h>
-#include <bonobo/bonobo-moniker-util.h>
-#include <libebook/e-book-async.h>
-
-/* use this instead of e_book_load_uri everywhere where you want the
- authentication to be handled for you. */
-#if 0
-void addressbook_load_uri (EBook *book, const char *uri, EBookCallback cb, gpointer closure);
-#endif
-void addressbook_load_source (EBook *book, ESource *source, EBookCallback cb, gpointer closure);
-void addressbook_load_default_book (EBookCallback open_response, gpointer closure);
-
-BonoboControl *addressbook_new_control (void);
-
-#endif /* __ADDRESSBOOK_H__ */
diff --git a/addressbook/gui/component/apps_evolution_addressbook.schemas.in.in b/addressbook/gui/component/apps_evolution_addressbook.schemas.in.in
deleted file mode 100644
index 82af9d0843..0000000000
--- a/addressbook/gui/component/apps_evolution_addressbook.schemas.in.in
+++ /dev/null
@@ -1,42 +0,0 @@
-<gconfschemafile>
- <schemalist>
-
- <!-- Completion uris -->
-
- <schema>
- <key>/schemas/apps/evolution/addressbook/completion/uris</key>
- <applyto>/apps/evolution/addressbook/completion/uris</applyto>
- <owner>evolution-addressbook</owner>
- <type>string</type>
- <default></default>
- <locale name="C">
- <short>EFolderList xml for the list of completion uris</short>
- </locale>
- </schema>
-
- <schema>
- <key>/schemas/apps/evolution/addressbook/completion/minimum_query_length</key>
- <applyto>/apps/evolution/addressbook/completion/minimum_query_length</applyto>
- <owner>evolution-addressbook</owner>
- <type>int</type>
- <default>3</default>
- <locale name="C">
- <short>The number of characters that must be typed before evolution will attempt to autocomplete</short>
- </locale>
- </schema>
-
- <!-- Select names last used uri -->
-
- <schema>
- <key>/schemas/apps/evolution/addressbook/select_names/last_used_uri</key>
- <applyto>/apps/evolution/addressbook/select_names/last_used_uri</applyto>
- <owner>evolution-addressbook</owner>
- <type>string</type>
- <default></default>
- <locale name="C">
- <short>URI for the folder last used in the select names dialog</short>
- </locale>
- </schema>
-
- </schemalist>
-</gconfschemafile> \ No newline at end of file
diff --git a/addressbook/gui/component/autocompletion-config.c b/addressbook/gui/component/autocompletion-config.c
deleted file mode 100644
index 05898f6688..0000000000
--- a/addressbook/gui/component/autocompletion-config.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* e-shell-config-autocompletion.h - Configuration page for addressbook autocompletion.
- *
- * Copyright (C) 2003 Novell, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Chris Toshok <toshok@ximian.com>
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-
-#include "autocompletion-config.h"
-
-#include "Evolution.h"
-
-#include <bonobo/bonobo-exception.h>
-
-#include "e-source-selector.h"
-#include <libedataserver/e-source-list.h>
-#include <libgnome/gnome-i18n.h>
-#include <gtk/gtkwidget.h>
-#include <gtk/gtksignal.h>
-
-
-typedef struct {
- EvolutionConfigControl *config_control;
-
- GtkWidget *control_widget;
-
- ESourceList *source_list;
-} AutocompletionConfig;
-
-static void
-source_selection_changed (ESourceSelector *selector,
- AutocompletionConfig *ac)
-{
- evolution_config_control_changed (ac->config_control);
-}
-
-static void
-config_control_destroy_notify (void *data,
- GObject *where_the_config_control_was)
-{
- AutocompletionConfig *ac = (AutocompletionConfig *) data;
-
- g_object_unref (ac->source_list);
-
- g_free (ac);
-}
-
-
-static void
-config_control_apply_callback (EvolutionConfigControl *config_control,
- AutocompletionConfig *ac)
-{
- GSList *selection;
- GSList *l;
- GSList *groups;
-
- /* first we clear all the completion flags from all sources */
- for (groups = e_source_list_peek_groups (ac->source_list); groups; groups = groups->next) {
- ESourceGroup *group = E_SOURCE_GROUP (groups->data);
- GSList *sources;
- for (sources = e_source_group_peek_sources (group); sources; sources = sources->next) {
- ESource *source = E_SOURCE (sources->data);
-
- e_source_set_property (source, "completion", NULL);
- }
- }
-
- /* then we loop over the selector's selection, setting the
- property on those sources */
- selection = e_source_selector_get_selection (E_SOURCE_SELECTOR (ac->control_widget));
- for (l = selection; l; l = l->next) {
- e_source_set_property (E_SOURCE (l->data), "completion", "true");
- }
- e_source_selector_free_selection (selection);
-
- e_source_list_sync (ac->source_list, NULL); /* XXX we should pop up a dialog if this fails */
-}
-
-static void
-initialize_selection (AutocompletionConfig *ac)
-{
- GSList *groups;
-
- for (groups = e_source_list_peek_groups (ac->source_list); groups; groups = groups->next) {
- ESourceGroup *group = E_SOURCE_GROUP (groups->data);
- GSList *sources;
- for (sources = e_source_group_peek_sources (group); sources; sources = sources->next) {
- ESource *source = E_SOURCE (sources->data);
- const char *completion = e_source_get_property (source, "completion");
- if (completion && !g_ascii_strcasecmp (completion, "true"))
- e_source_selector_select_source (E_SOURCE_SELECTOR (ac->control_widget),
- source);
- }
- }
-}
-
-EvolutionConfigControl*
-autocompletion_config_control_new (void)
-{
- AutocompletionConfig *ac;
- CORBA_Environment ev;
-
- ac = g_new0 (AutocompletionConfig, 1);
-
- CORBA_exception_init (&ev);
-
- ac->source_list = e_source_list_new_for_gconf_default ("/apps/evolution/addressbook/sources");
- /* XXX should we watch for the source list to change and
- update it in the control? what about our local changes? */
- /* g_signal_connect (ac->source_list, "changed", G_CALLBACK (source_list_changed), ac); */
-
- ac->control_widget = e_source_selector_new (ac->source_list);
-
- initialize_selection (ac);
-
- gtk_widget_show (ac->control_widget);
-
- ac->config_control = evolution_config_control_new (ac->control_widget);
-
- g_signal_connect (ac->control_widget, "selection_changed",
- G_CALLBACK (source_selection_changed), ac);
- g_signal_connect (ac->config_control, "apply",
- G_CALLBACK (config_control_apply_callback), ac);
-
- g_object_weak_ref (G_OBJECT (ac->config_control), config_control_destroy_notify, ac);
-
- CORBA_exception_free (&ev);
-
- return ac->config_control;
-}
-
diff --git a/addressbook/gui/component/autocompletion-config.h b/addressbook/gui/component/autocompletion-config.h
deleted file mode 100644
index 86f056477e..0000000000
--- a/addressbook/gui/component/autocompletion-config.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* e-shell-config-autocompletion.h - Configuration page for addressbook autocompletion.
- *
- * Copyright (C) 2003 Novell, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Chris Toshok <toshok@ximian.com>
- */
-
-#ifndef _AUTOCOMPLETION_CONFIG_H
-#define _AUTOCOMPLETION_CONFIG_H
-
-#include "evolution-config-control.h"
-
-EvolutionConfigControl* autocompletion_config_control_new (void);
-
-#endif /* _AUTOCOMPLETION_CONFIG_H */
diff --git a/addressbook/gui/component/component-factory.c b/addressbook/gui/component/component-factory.c
deleted file mode 100644
index 08bf146691..0000000000
--- a/addressbook/gui/component/component-factory.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* component-factory.c - Factory for Evolution's Addressbook component.
- *
- * Copyright (C) 2002 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Ettore Perazzoli <ettore@ximian.com>
- */
-
-#include <config.h>
-
-#include <string.h>
-#include "addressbook.h"
-#include "addressbook-component.h"
-#include "addressbook-config.h"
-#include "autocompletion-config.h"
-#include "eab-popup-control.h"
-#include "eab-vcard-control.h"
-#include "select-names/e-select-names-bonobo.h"
-#if HAVE_NSS
-#include "smime/gui/certificate-manager.h"
-#endif
-#include <bonobo/bonobo-shlib-factory.h>
-
-
-#define FACTORY_ID "OAFIID:GNOME_Evolution_Addressbook_Factory:" BASE_VERSION
-
-#define VCARD_CONTROL_ID "OAFIID:GNOME_Evolution_Addressbook_VCard_Control:" BASE_VERSION
-#define ADDRESSBOOK_CONTROL_ID "OAFIID:GNOME_Evolution_Addressbook_Control:" BASE_VERSION
-#define COMPONENT_ID "OAFIID:GNOME_Evolution_Addressbook_Component:" BASE_VERSION
-#define ADDRESS_POPUP_ID "OAFIID:GNOME_Evolution_Addressbook_AddressPopup:" BASE_VERSION
-#define SELECT_NAMES_ID "OAFIID:GNOME_Evolution_Addressbook_SelectNames:" BASE_VERSION
-#define LDAP_STORAGE_CONFIG_CONTROL_ID "OAFIID:GNOME_Evolution_LDAPStorage_ConfigControl:" BASE_VERSION
-#define COMPLETION_CONFIG_CONTROL_ID "OAFIID:GNOME_Evolution_Addressbook_Autocompletion_ConfigControl:" BASE_VERSION
-#define CERTIFICATE_MANAGER_CONFIG_CONTROL_ID "OAFIID:GNOME_Evolution_SMime_CertificateManager_ConfigControl:" BASE_VERSION
-
-
-static BonoboObject *
-factory (BonoboGenericFactory *factory,
- const char *component_id,
- void *closure)
-{
- printf ("asked to activate component_id `%s'\n", component_id);
-
- if (strcmp (component_id, VCARD_CONTROL_ID) == 0)
- return BONOBO_OBJECT (eab_vcard_control_new ());
- if (strcmp (component_id, ADDRESSBOOK_CONTROL_ID) == 0)
- return BONOBO_OBJECT (addressbook_new_control ());
- if (strcmp (component_id, COMPONENT_ID) == 0) {
- BonoboObject *object = BONOBO_OBJECT (addressbook_component_peek ());
- bonobo_object_ref (object);
- return object;
- }
- if (strcmp (component_id, ADDRESS_POPUP_ID) == 0)
- return BONOBO_OBJECT (eab_popup_control_new ());
- if (strcmp (component_id, COMPLETION_CONFIG_CONTROL_ID) == 0)
- return BONOBO_OBJECT (autocompletion_config_control_new ());
-#if 0
- /* Config control is dead */
- if (strcmp (component_id, LDAP_STORAGE_CONFIG_CONTROL_ID) == 0)
- return BONOBO_OBJECT (addressbook_config_control_new ());
-#endif
- if (strcmp (component_id, SELECT_NAMES_ID) == 0)
- return BONOBO_OBJECT (e_select_names_bonobo_new ());
-#if HAVE_NSS
- if (strcmp (component_id, CERTIFICATE_MANAGER_CONFIG_CONTROL_ID) == 0)
- return BONOBO_OBJECT (certificate_manager_config_control_new ());
-#endif
-
- g_warning (FACTORY_ID ": Don't know what to do with %s", component_id);
- return NULL;
-}
-
-BONOBO_ACTIVATION_SHLIB_FACTORY (FACTORY_ID, "Evolution Addressbook component factory", factory, NULL)
diff --git a/addressbook/gui/component/ldap-config.glade b/addressbook/gui/component/ldap-config.glade
deleted file mode 100644
index 0683fe1f66..0000000000
--- a/addressbook/gui/component/ldap-config.glade
+++ /dev/null
@@ -1,2722 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-<requires lib="gnome"/>
-
-<widget class="GtkWindow" id="account-editor-window">
- <property name="title" translatable="yes">Edit LDAP Server</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
-
- <child>
- <widget class="GtkVBox" id="vbox37">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkNotebook" id="account-editor-notebook">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="show_tabs">True</property>
- <property name="show_border">True</property>
- <property name="tab_pos">GTK_POS_TOP</property>
- <property name="scrollable">False</property>
- <property name="enable_popup">False</property>
-
- <child>
- <widget class="GtkVBox" id="account-editor-general-vbox">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkHBox" id="hbox100">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="GtkLabel" id="label431">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Display name:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment45">
- <property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0.9</property>
- <property name="yscale">1</property>
-
- <child>
- <widget class="GtkEntry" id="account-editor-display-name-entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="account-editor-general-ldap-vbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label331">
- <property name="visible">True</property>
- <property name="label" translatable="yes">General</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="account-editor-connecting-vbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label334">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Connecting</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="account-editor-searching-vbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label344">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Searching</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHSeparator" id="hseparator10">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox120">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkHButtonBox" id="hbuttonbox20">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkButton" id="account-editor-cancel-button">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="account-editor-ok-button">
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-<widget class="GtkWindow" id="account-druid-window">
- <property name="title" translatable="yes">New Addressbook</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
-
- <child>
- <widget class="GnomeDruid" id="account-druid">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="show_help">False</property>
-
- <child>
- <widget class="GnomeDruidPageEdge" id="druidpagestart1">
- <property name="visible">True</property>
- <property name="position">GNOME_EDGE_START</property>
- <property name="title" translatable="yes">Addressbook Creation Assistant</property>
- <property name="text" translatable="yes">This assistant will help you create a new addressbook.
-
-Depending on the type of addressbook you create, additional
-parameters may be required. Please contact your system
-administrator if you need help finding this information.</property>
- </widget>
- </child>
-
- <child>
- <widget class="GnomeDruidPageStandard" id="add-server-druid-folder-page">
- <property name="visible">True</property>
- <property name="title" translatable="yes">Step 1: Folder Characteristics</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="druid-vbox6">
- <property name="border_width">16</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkVBox" id="vbox21">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label198">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Specifying a display name and group is the first step in setting up an addressbook.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xpad">3</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHSeparator" id="hseparator5">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="table15">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">3</property>
-
- <child>
- <widget class="GtkEntry" id="druid-display-name-entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="has_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label199">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Display name:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">druid-display-name-entry</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label555">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Group:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkOptionMenu" id="druid-group-option-menu">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">-1</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkNotebook" id="notebook15">
- <property name="visible">True</property>
- <property name="show_tabs">False</property>
- <property name="show_border">False</property>
- <property name="tab_pos">GTK_POS_TOP</property>
- <property name="scrollable">False</property>
- <property name="enable_popup">False</property>
-
- <child>
- <widget class="GtkLabel" id="label207">
- <property name="visible">True</property>
- <property name="label" translatable="yes">This is the name that will appear in your Evolution folder list. It is for display purposes only. </property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label208">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label163</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label215">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Selecting this option will let you change Evolution's default settings for LDAP
-searches, and for creating and editing contacts. </property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label210">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label164</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GnomeDruidPageStandard" id="add-server-druid-info-page">
- <property name="visible">True</property>
- <property name="title" translatable="yes">Step 2: Server Information</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="druid-vbox1">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
-
- <child>
- <widget class="GtkVBox" id="account-druid-general-vbox">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label158">
- <property name="visible">True</property>
- <property name="label" translatable="yes">You have decided to configure an LDAP server. The first step in doing this is to provide its name and your
-log in information. Please ask your system administrator if you are unsure of this information.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xpad">3</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHSeparator" id="hseparator2">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GnomeDruidPageStandard" id="add-server-druid-connecting-page">
- <property name="visible">True</property>
- <property name="title" translatable="yes">Step 3: Connecting to Server</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="druid-vbox2">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
-
- <child>
- <widget class="GtkVBox" id="account-druid-connecting-vbox">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label174">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Now, you must specify how you want to connect to the LDAP server. The SSL (Secure Sockets Layer)
-and TLS (Transport Layer Security) protocols are used by some servers to cryptographically protect
-your connection. Ask your system administrator if your LDAP server uses these protocols.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xpad">3</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHSeparator" id="hseparator3">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GnomeDruidPageStandard" id="add-server-druid-searching-page">
- <property name="visible">True</property>
- <property name="title" translatable="yes">Step 4: Searching the Directory</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="vbox23">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
-
- <child>
- <widget class="GtkVBox" id="account-druid-searching-vbox">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label254">
- <property name="visible">True</property>
- <property name="label" translatable="yes">The options on this page control how many entries should be included in your
-searches, and how long a search should take. Ask your system administrator if you
-need to change these options.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHSeparator" id="hseparator7">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GnomeDruidPageEdge" id="add-server-druid-finish-page">
- <property name="visible">True</property>
- <property name="position">GNOME_EDGE_FINISH</property>
- <property name="title" translatable="yes">Finished</property>
- <property name="text" translatable="yes">Congratulations, you are finished setting up this addressbook.
-
-Please click the &quot;Finish&quot; button to save the settings you have entered here.</property>
- </widget>
- </child>
- </widget>
- </child>
-</widget>
-
-<widget class="GtkDialog" id="addressbook-sources-window">
- <property name="title" translatable="yes">Addressbook Sources</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="default_width">355</property>
- <property name="default_height">285</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="has_separator">True</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="addressbook-sources-vbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="hbuttonbox27">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="button104">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button105">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-apply</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button106">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-close</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="addressbook-sources">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="Custom" id="sourcesTable">
- <property name="visible">True</property>
- <property name="creation_function">addressbook_dialog_create_sources_table</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Thu, 11 Apr 2002 00:31:02 GMT</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox73">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="label529">
- <property name="visible">True</property>
- <property name="label" translatable="yes">
-</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVButtonBox" id="vbuttonbox18">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_START</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkButton" id="addSource">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-add</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="editSource">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
-
- <child>
- <widget class="GtkAlignment" id="alignment64">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
-
- <child>
- <widget class="GtkHBox" id="hbox121">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</property>
-
- <child>
- <widget class="Custom" id="custom1">
- <property name="visible">True</property>
- <property name="creation_function">e_create_image_widget</property>
- <property name="string1">stock-edit-24.png</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Fri, 25 Apr 2003 20:27:48 GMT</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label554">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Edit</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="deleteSource">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-remove</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-<widget class="GtkWindow" id="general-tab-window">
- <property name="title" translatable="yes">general-tab</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
-
- <child>
- <widget class="GtkVBox" id="general-tab">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkTable" id="table36">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="n_rows">4</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label534">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Server name:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">server-name-entry</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label535">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Log in method:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="server-name-entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="has_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment63">
- <property name="visible">True</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">1</property>
-
- <child>
- <widget class="GtkOptionMenu" id="auth-optionmenu">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget28">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget29">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Anonymously</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget30">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Using email address</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget31">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Using distinguished name (DN)</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkNotebook" id="auth-label-notebook">
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="show_tabs">False</property>
- <property name="show_border">False</property>
- <property name="tab_pos">GTK_POS_TOP</property>
- <property name="scrollable">False</property>
- <property name="enable_popup">False</property>
-
- <child>
- <widget class="GtkLabel" id="label553">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Email address:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label546">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label546</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label536">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Distinguished _name:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label547">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label547</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkNotebook" id="auth-entry-notebook">
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="show_tabs">False</property>
- <property name="show_border">False</property>
- <property name="tab_pos">GTK_POS_TOP</property>
- <property name="scrollable">False</property>
- <property name="enable_popup">False</property>
-
- <child>
- <widget class="GtkEntry" id="email-entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label549">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label549</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="dn-entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label550">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label550</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHSeparator" id="hseparator12">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkNotebook" id="general-tab-help">
- <property name="visible">True</property>
- <property name="show_tabs">False</property>
- <property name="show_border">False</property>
- <property name="tab_pos">GTK_POS_TOP</property>
- <property name="scrollable">False</property>
- <property name="enable_popup">False</property>
-
- <child>
- <widget class="GtkLabel" id="label537">
- <property name="visible">True</property>
- <property name="label" translatable="yes">This is the full name of your ldap server. For example, &quot;ldap.mycompany.com&quot;.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label538">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label163</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label539">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Evolution will use this email address to authenticate you with the server</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label540">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label164</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label541">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Evolution will use this DN to authenticate you with the server</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label542">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label165</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label552">
- <property name="visible">True</property>
- <property name="label" translatable="yes">This is the method evolution will use to authenticate you. Note that setting this to &quot;Email Address&quot; requires anonymous access to your ldap server.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">True</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label551">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label551</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label544">
- <property name="visible">True</property>
- <property name="label" translatable="yes">This is the name for this server that will appear in your Evolution folder list.
-It is for display purposes only. </property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label545">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label452</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-<widget class="GtkWindow" id="connecting-tab-window">
- <property name="title" translatable="yes">connecting-tab</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
-
- <child>
- <widget class="GtkVBox" id="connecting-tab">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkTable" id="table14">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label175">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Port number:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment21">
- <property name="visible">True</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">1</property>
-
- <child>
- <widget class="GtkCombo" id="port-combo">
- <property name="visible">True</property>
- <property name="value_in_list">False</property>
- <property name="allow_empty">True</property>
- <property name="case_sensitive">False</property>
- <property name="enable_arrow_keys">True</property>
- <property name="enable_arrows_always">False</property>
-
- <child internal-child="entry">
- <widget class="GtkEntry" id="entry27">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="has_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- </child>
-
- <child internal-child="list">
- <widget class="GtkList" id="convertwidget32">
- <property name="visible">True</property>
- <property name="selection_mode">GTK_SELECTION_BROWSE</property>
-
- <child>
- <widget class="GtkListItem" id="convertwidget33">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget34">
- <property name="visible">True</property>
- <property name="label" translatable="yes">389</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget35">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget36">
- <property name="visible">True</property>
- <property name="label" translatable="yes">636</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget37">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget38">
- <property name="visible">True</property>
- <property name="label" translatable="yes">3268</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget39">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget40">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label176">
- <property name="visible">True</property>
- <property name="label" translatable="yes">U_se SSL/TLS:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment60">
- <property name="visible">True</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">1</property>
-
- <child>
- <widget class="GtkOptionMenu" id="ssl-optionmenu">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget41">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget42">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Always</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget43">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Whenever Possible</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget44">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Never</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkNotebook" id="connecting-tab-help">
- <property name="visible">True</property>
- <property name="show_tabs">False</property>
- <property name="show_border">False</property>
- <property name="tab_pos">GTK_POS_TOP</property>
- <property name="scrollable">False</property>
- <property name="enable_popup">False</property>
-
- <child>
- <widget class="GtkLabel" id="label178">
- <property name="visible">True</property>
- <property name="label" translatable="yes">This is the port on the LDAP server that Evolution will try to connect to. A
-list of standard ports has been provided. Ask your system administrator
-what port you should specify.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label179">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label163</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label395">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Selecting this option means that Evolution will only connect to your LDAP server if
-your LDAP server supports SSL or TLS.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label398">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label398</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label399">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Selecting this option means that Evolution will only try to use SSL/TLS if you are in a
-insecure environment. For example, if you and your LDAP server are behind a firewall
-at work, then Evolution doesn't need to use SSL/TLS because your connection is already
-secure.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label396">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label396</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label400">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Selecting this option means that your server does not support either SSL or TLS. This
-means that your connection will be insecure, and that you will be vulnerable to security
-exploits. </property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label397">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label397</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-<widget class="GtkWindow" id="searching-tab-window">
- <property name="title" translatable="yes">searching-tab</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
-
- <child>
- <widget class="GtkVBox" id="searching-tab">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkTable" id="table30">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="n_rows">4</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label455">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Search base:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label456">
- <property name="visible">True</property>
- <property name="label" translatable="yes">S_earch scope: </property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment49">
- <property name="visible">True</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">7.45058e-09</property>
- <property name="xscale">0</property>
- <property name="yscale">1</property>
-
- <child>
- <widget class="GtkOptionMenu" id="scope-optionmenu">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget45">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget46">
- <property name="visible">True</property>
- <property name="label" translatable="yes">One</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget47">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Sub</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox109">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
-
- <child>
- <widget class="GtkEntry" id="rootdn-entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="has_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="rootdn-button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes"> S_how Supported Bases </property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label457">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Timeout (minutes):</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">1</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment50">
- <property name="visible">True</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xscale">1</property>
- <property name="yscale">1</property>
-
- <child>
- <widget class="GtkHBox" id="hbox110">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
-
- <child>
- <widget class="GtkLabel" id="label458">
- <property name="visible">True</property>
- <property name="label" translatable="yes">1:00</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHScale" id="timeout-scale">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="draw_value">False</property>
- <property name="value_pos">GTK_POS_LEFT</property>
- <property name="digits">0</property>
- <property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
- <property name="inverted">False</property>
- <property name="adjustment">3 1 5 0.5 1 0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label459">
- <property name="visible">True</property>
- <property name="label" translatable="yes">5:00</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">3</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label460">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Selected:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label461">
- <property name="visible">True</property>
- <property name="label" translatable="yes">2:30</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label462">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Download limit:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment51">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">1</property>
-
- <child>
- <widget class="GtkHBox" id="hbox111">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
-
- <child>
- <widget class="GtkSpinButton" id="download-limit-spinbutton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">False</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">100 0 10000 1 10 10</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label463">
- <property name="visible">True</property>
- <property name="label" translatable="yes">cards</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkNotebook" id="searching-tab-help">
- <property name="visible">True</property>
- <property name="show_tabs">False</property>
- <property name="show_border">False</property>
- <property name="tab_pos">GTK_POS_TOP</property>
- <property name="scrollable">False</property>
- <property name="enable_popup">False</property>
-
- <child>
- <widget class="GtkLabel" id="label464">
- <property name="visible">True</property>
- <property name="label" translatable="yes">The search base is the distinguished name (DN) of the entry where your searches will
-begin. If you leave this blank, the search will begin at the root of the directory tree.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label465">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label163</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label466">
- <property name="visible">True</property>
- <property name="label" translatable="yes">The search scope defines how deep you would like the search to extend down the
-directory tree. A search scope of &quot;sub&quot; will include all entries below your search base.
-A search scope of &quot;one&quot; will only include the entries one level beneath your base.
-</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label467">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label164</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label468">
- <property name="visible">True</property>
- <property name="label" translatable="yes">This option controls how long a search will be run.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label469">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label165</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label470">
- <property name="visible">True</property>
- <property name="label" translatable="yes">This is the maximum number of entries to download. Setting this number to be
-too large will slow down your addressbook.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label471">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label166</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-<widget class="GtkDialog" id="supported-bases-dialog">
- <property name="title" translatable="yes">Supported Search Bases</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="default_width">300</property>
- <property name="default_height">200</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="has_separator">True</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox5">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area5">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="button107">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">-5</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button109">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">-6</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="supported-bases-table">
- <property name="visible">True</property>
- <property name="creation_function">supported_bases_create_table</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Fri, 12 Apr 2002 20:06:45 GMT</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/addressbook/gui/component/select-names/.cvsignore b/addressbook/gui/component/select-names/.cvsignore
deleted file mode 100644
index 1520453f86..0000000000
--- a/addressbook/gui/component/select-names/.cvsignore
+++ /dev/null
@@ -1,15 +0,0 @@
-.deps
-.libs
-.pure
-Makefile
-Makefile.in
-*.lo
-*.la
-Evolution-Addressbook-SelectNames-stubs.c
-Evolution-Addressbook-SelectNames-skels.c
-Evolution-Addressbook-SelectNames-common.c
-Evolution-Addressbook-SelectNames.h
-GNOME_Evolution_Addressbook_SelectNames*.server
-GNOME_Evolution_Addressbook_SelectNames*.server.in
-e-select-names-marshal.c
-e-select-names-marshal.h
diff --git a/addressbook/gui/component/select-names/Evolution-Addressbook-SelectNames.idl b/addressbook/gui/component/select-names/Evolution-Addressbook-SelectNames.idl
deleted file mode 100644
index 6feb6b54bb..0000000000
--- a/addressbook/gui/component/select-names/Evolution-Addressbook-SelectNames.idl
+++ /dev/null
@@ -1,42 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * CORBA interface for the SelectNames dialog.
- *
- * Authors:
- * Ettore Perazzoli <ettore@ximian.com>
- *
- * Copyright (C) 2000 Ximian, Inc.
- */
-
-#include <Bonobo.idl>
-
-module GNOME {
-module Evolution {
-module Addressbook {
-
- interface SelectNames : Bonobo::Unknown {
- struct Section {
- string id;
- string title;
- };
-
- typedef sequence<Section> SectionList;
-
- exception DuplicateID {};
- exception SectionNotFound {};
-
- void addSection (in string id, in string title)
- raises (DuplicateID);
- void addSectionWithLimit (in string id, in string title, in short limit)
- raises (DuplicateID);
-
- Bonobo::Control getEntryBySection (in string section_id)
- raises (SectionNotFound);
-
- void activateDialog (in string section_id);
- };
-
-
-};
-};
-};
diff --git a/addressbook/gui/component/select-names/GNOME_Evolution_Addressbook_SelectNames.server.in.in b/addressbook/gui/component/select-names/GNOME_Evolution_Addressbook_SelectNames.server.in.in
deleted file mode 100644
index 0a9f975463..0000000000
--- a/addressbook/gui/component/select-names/GNOME_Evolution_Addressbook_SelectNames.server.in.in
+++ /dev/null
@@ -1,31 +0,0 @@
-<oaf_info>
-
-<!--
-<oaf_server iid="OAFIID:GNOME_Evolution_Addressbook_SelectNamesFactory:@VERSION@"
- type="shlib"
- location="@COMPONENTDIR@/libevolution-addressbook.so">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/ObjectFactory:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="name" type="string"
- _value="Evolution Addressbook name selection interface"/>
-
-</oaf_server>
--->
-
-<oaf_server iid="OAFIID:GNOME_Evolution_Addressbook_SelectNames:@VERSION@"
- type="factory"
- location="OAFIID:GNOME_Evolution_Addressbook_Factory:@VERSION@">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/Evolution/Addressbook/SelectNames:@VERSION@"/>
- </oaf_attribute>
-
- <oaf_attribute name="name" type="string"
- _value="Evolution Addressbook name selection interface"/>
-
-</oaf_server>
-
-</oaf_info>
diff --git a/addressbook/gui/component/select-names/Makefile.am b/addressbook/gui/component/select-names/Makefile.am
deleted file mode 100644
index b64cf31689..0000000000
--- a/addressbook/gui/component/select-names/Makefile.am
+++ /dev/null
@@ -1,96 +0,0 @@
-# CORBA stuff
-
-idl_DATA = \
- Evolution-Addressbook-SelectNames.idl
-
-IDL_GENERATED_H = \
- Evolution-Addressbook-SelectNames.h
-IDL_GENERATED_C = \
- Evolution-Addressbook-SelectNames-common.c \
- Evolution-Addressbook-SelectNames-skels.c \
- Evolution-Addressbook-SelectNames-stubs.c
-IDL_GENERATED = $(IDL_GENERATED_C) $(IDL_GENERATED_H)
-
-$(IDL_GENERATED_H): $(idl_DATA)
- $(ORBIT_IDL) -I $(srcdir) $(IDL_INCLUDES) \
- $(srcdir)/Evolution-Addressbook-SelectNames.idl
-$(IDL_GENERATED_C): $(IDL_GENERATED_H)
-
-server_in_files = GNOME_Evolution_Addressbook_SelectNames.server.in.in
-server_DATA = $(server_in_files:.server.in.in=_$(BASE_VERSION).server)
-@EVO_SERVER_RULE@
-@INTLTOOL_SERVER_RULE@
-
-INCLUDES = \
- -DG_LOG_DOMAIN=\"evolution-addressbook\" \
- -I$(top_srcdir) \
- -I$(top_builddir) \
- -I$(top_srcdir)/shell \
- -I$(top_builddir)/shell \
- -I$(top_srcdir)/widgets/e-text \
- -I$(top_srcdir)/widgets/e-table \
- -I$(top_srcdir)/addressbook/gui/minicard \
- -I$(top_srcdir)/addressbook/gui/widgets \
- -I$(top_srcdir)/addressbook/contact-editor \
- -I$(top_srcdir)/addressbook/backend \
- -I$(top_builddir)/addressbook/backend \
- -DEVOLUTION_IMAGESDIR=\""$(imagesdir)"\" \
- -DEVOLUTION_DATADIR=\""$(datadir)"\" \
- -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \
- -DEVOLUTION_ETSPECDIR=\""$(etspecdir)"\" \
- -DEVOLUTION_UIDIR=\""$(evolutionuidir)"\" \
- -DPREFIX=\""$(prefix)"\" \
- $(EVOLUTION_ADDRESSBOOK_CFLAGS)
-
-privlib_LTLIBRARIES = libeselectnames.la
-
-libeselectnames_la_SOURCES = \
- $(IDL_GENERATED) \
- $(MARSHAL_GENERATED) \
- e-select-names-bonobo.c \
- e-select-names-bonobo.h \
- e-select-names-completion.c \
- e-select-names-completion.h \
- e-select-names-config.c \
- e-select-names-config.h \
- e-select-names-config-keys.h \
- e-select-names-manager.c \
- e-select-names-manager.h \
- e-select-names-model.c \
- e-select-names-model.h \
- e-select-names-popup.c \
- e-select-names-popup.h \
- e-select-names-table-model.c \
- e-select-names-table-model.h \
- e-select-names-text-model.c \
- e-select-names-text-model.h \
- e-select-names.c \
- e-select-names.h
-
-libeselectnames_la_LIBADD = \
- $(EVOLUTION_ADDRESSBOOK_LIBS)
-
-# We'll need these again when we split out the select names control
-# into its own shlib factory, but for now they're redundant.
-#
-# e-select-names-factory.c
-# e-select-names-factory.h
-
-MARSHAL_GENERATED = e-select-names-marshal.c e-select-names-marshal.h
-@EVO_MARSHAL_RULE@
-
-glade_DATA = select-names.glade
-etspec_DATA = e-select-names.etspec e-select-names-section.etspec
-
-EXTRA_DIST = \
- $(glade_DATA) \
- $(server_in_files) \
- $(idl_DATA) \
- $(etspec_DATA) \
- e-select-names-marshal.list
-
-BUILT_SOURCES = $(IDL_GENERATED) $(MARSHAL_GENERATED) $(server_DATA)
-CLEANFILES = $(BUILT_SOURCES)
-
-dist-hook:
- cd $(distdir); rm -f $(BUILT_SOURCES)
diff --git a/addressbook/gui/component/select-names/e-select-names-bonobo.c b/addressbook/gui/component/select-names/e-select-names-bonobo.c
deleted file mode 100644
index 1977abe95f..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-bonobo.c
+++ /dev/null
@@ -1,600 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* e-select-names-bonobo.c
- *
- * Copyright (C) 2000 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Ettore Perazzoli
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "e-select-names-bonobo.h"
-
-#include <bonobo-activation/bonobo-activation-activate.h>
-
-#include <bonobo/bonobo-property-bag.h>
-#include <bonobo/bonobo-control.h>
-#include <bonobo/bonobo-exception.h>
-#include <bonobo/bonobo-event-source.h>
-#include <bonobo/bonobo-ui-util.h>
-
-#include <gal/util/e-util.h>
-#include <gal/e-text/e-entry.h>
-#include <gal/util/e-text-event-processor.h>
-
-#include "Evolution-Addressbook-SelectNames.h"
-
-#include "e-select-names-manager.h"
-#include "e-select-names-model.h"
-#include "e-select-names-text-model.h"
-#include "e-select-names-completion.h"
-
-#include <string.h>
-
-
-#define PARENT_TYPE BONOBO_TYPE_OBJECT
-static BonoboObjectClass *parent_class = NULL;
-
-struct _ESelectNamesBonoboPrivate {
- ESelectNamesManager *manager;
- BonoboEventSource *event_source;
-};
-
-enum _EntryPropertyID {
- ENTRY_PROPERTY_ID_TEXT,
- ENTRY_PROPERTY_ID_ADDRESSES,
- ENTRY_PROPERTY_ID_DESTINATIONS,
- ENTRY_PROPERTY_ID_ALLOW_CONTACT_LISTS,
- ENTRY_PROPERTY_ID_ENTRY_CHANGED
-};
-typedef enum _EntryPropertyID EntryPropertyID;
-
-
-/* PropertyBag implementation for the entry widgets. */
-
-static void
-entry_get_property_fn (BonoboPropertyBag *bag,
- BonoboArg *arg,
- unsigned int arg_id,
- CORBA_Environment *ev,
- void *user_data)
-{
- GtkWidget *w;
-
- w = GTK_WIDGET (user_data);
-
- switch (arg_id) {
- case ENTRY_PROPERTY_ID_TEXT:
- {
- ETextModel *text_model;
- text_model = E_TEXT_MODEL (g_object_get_data (G_OBJECT (w), "select_names_text_model"));
- g_assert (text_model != NULL);
-
- BONOBO_ARG_SET_STRING (arg, e_text_model_get_text (text_model));
- break;
- }
-
- case ENTRY_PROPERTY_ID_ADDRESSES:
- {
- ESelectNamesModel *model;
- char *text;
-
- model = E_SELECT_NAMES_MODEL (g_object_get_data (G_OBJECT (w), "select_names_model"));
- g_assert (model != NULL);
-
- text = e_select_names_model_get_address_text (model, ", ");
- BONOBO_ARG_SET_STRING (arg, text);
- g_free (text);
- }
- break;
-
- case ENTRY_PROPERTY_ID_DESTINATIONS:
- {
- ESelectNamesModel *model;
- char *text;
-
- model = E_SELECT_NAMES_MODEL (g_object_get_data (G_OBJECT (w), "select_names_model"));
- g_assert (model != NULL);
-
- text = e_select_names_model_export_destinationv (model);
- BONOBO_ARG_SET_STRING (arg, text);
- g_free (text);
- }
- break;
-
- case ENTRY_PROPERTY_ID_ALLOW_CONTACT_LISTS:
- {
- ESelectNamesCompletion *comp;
- comp = E_SELECT_NAMES_COMPLETION (g_object_get_data (G_OBJECT (w), "completion_handler"));
- g_assert (comp != NULL);
-
- BONOBO_ARG_SET_BOOLEAN (arg, e_select_names_completion_get_match_contact_lists (comp));
- break;
- }
-
- case ENTRY_PROPERTY_ID_ENTRY_CHANGED:
- /* This is a read-only property. */
- g_assert_not_reached ();
- break;
-
- default:
- break;
- }
-}
-
-static void
-entry_set_property_fn (BonoboPropertyBag *bag,
- const BonoboArg *arg,
- guint arg_id,
- CORBA_Environment *ev,
- gpointer user_data)
-{
- GtkWidget *w;
-
- w = GTK_WIDGET (user_data);
-
- switch (arg_id) {
-
- case ENTRY_PROPERTY_ID_TEXT:
- case ENTRY_PROPERTY_ID_ADDRESSES:
- {
- ESelectNamesModel *model;
- model = E_SELECT_NAMES_MODEL (g_object_get_data (G_OBJECT (w), "select_names_model"));
- g_assert (model != NULL);
-
- e_entry_set_text (E_ENTRY (w), BONOBO_ARG_GET_STRING (arg));
- e_select_names_model_load_all_contacts (model, NULL);
- break;
- }
-
- case ENTRY_PROPERTY_ID_DESTINATIONS:
- {
- ESelectNamesModel *model;
- model = E_SELECT_NAMES_MODEL (g_object_get_data (G_OBJECT (w), "select_names_model"));
- g_assert (model != NULL);
-
- e_select_names_model_import_destinationv (model, BONOBO_ARG_GET_STRING (arg));
- e_select_names_model_load_all_contacts (model, NULL);
- break;
- }
-
- case ENTRY_PROPERTY_ID_ALLOW_CONTACT_LISTS:
- {
- ESelectNamesCompletion *comp;
- comp = E_SELECT_NAMES_COMPLETION (g_object_get_data (G_OBJECT (w), "completion_handler"));
- g_assert (comp != NULL);
-
- e_select_names_completion_set_match_contact_lists (comp, BONOBO_ARG_GET_BOOLEAN (arg));
- break;
- }
-
- case ENTRY_PROPERTY_ID_ENTRY_CHANGED:
- g_object_set_data (G_OBJECT (w), "entry_property_id_changed", GUINT_TO_POINTER (1));
- break;
-
- default:
- break;
- }
-}
-
-static void
-impl_SelectNames_add_section (PortableServer_Servant servant,
- const CORBA_char *id,
- const CORBA_char *title,
- CORBA_Environment *ev)
-{
- ESelectNamesBonobo *select_names;
- ESelectNamesBonoboPrivate *priv;
-
- select_names = E_SELECT_NAMES_BONOBO (bonobo_object (servant));
- priv = select_names->priv;
-
- e_select_names_manager_add_section (priv->manager, id, title);
-}
-
-static void
-impl_SelectNames_add_section_with_limit (PortableServer_Servant servant,
- const CORBA_char *id,
- const CORBA_char *title,
- CORBA_short limit,
- CORBA_Environment *ev)
-{
- ESelectNamesBonobo *select_names;
- ESelectNamesBonoboPrivate *priv;
-
- select_names = E_SELECT_NAMES_BONOBO (bonobo_object (servant));
- priv = select_names->priv;
-
- e_select_names_manager_add_section_with_limit (priv->manager, id, title, limit);
-}
-
-static void
-entry_changed (GtkWidget *widget, BonoboControl *control)
-{
- gboolean changed = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (widget), "entry_property_id_changed"));
-
- if (!changed)
- bonobo_control_set_property (control, NULL, "entry_changed", TC_CORBA_boolean, TRUE, NULL);
-}
-
-static void
-manager_changed_cb (ESelectNamesManager *manager, const gchar *section_id, gint changed_working_copy, gpointer closure)
-{
- ESelectNamesBonobo *select_names = E_SELECT_NAMES_BONOBO (closure);
- BonoboArg *arg;
-
- arg = bonobo_arg_new (BONOBO_ARG_STRING);
- BONOBO_ARG_SET_STRING (arg, section_id);
-
- bonobo_event_source_notify_listeners_full (select_names->priv->event_source,
- "GNOME/Evolution",
- "changed",
- changed_working_copy ? "working_copy" : "model",
- arg, NULL);
-
- bonobo_arg_release (arg);
-}
-
-static void
-manager_ok_cb (ESelectNamesManager *manager, gpointer closure)
-{
- ESelectNamesBonobo *select_names = E_SELECT_NAMES_BONOBO (closure);
- BonoboArg *arg;
-
- arg = bonobo_arg_new (BONOBO_ARG_NULL);
-
- bonobo_event_source_notify_listeners_full (select_names->priv->event_source,
- "GNOME/Evolution",
- "ok",
- "dialog",
- arg,
- NULL);
-
- bonobo_arg_release (arg);
-}
-
-static void
-copy_cb (BonoboUIComponent *ui, gpointer user_data, const char *command)
-{
- EEntry *entry = E_ENTRY (user_data);
-
- e_text_copy_clipboard (entry->item);
-}
-
-static void
-cut_cb (BonoboUIComponent *ui, gpointer user_data, const char *command)
-{
- EEntry *entry = E_ENTRY (user_data);
-
- e_text_cut_clipboard (entry->item);
-}
-
-static void
-paste_cb (BonoboUIComponent *ui, gpointer user_data, const char *command)
-{
- EEntry *entry = E_ENTRY (user_data);
-
- e_text_paste_clipboard (entry->item);
-}
-
-static void
-select_all_cb (BonoboUIComponent *ui, gpointer user_data, const char *command)
-{
- EEntry *entry = E_ENTRY (user_data);
-
- e_text_select_all (entry->item);
-}
-
-static BonoboUIVerb verbs [] = {
- BONOBO_UI_VERB ("EditCut", cut_cb),
- BONOBO_UI_VERB ("EditCopy", copy_cb),
- BONOBO_UI_VERB ("EditPaste", paste_cb),
- BONOBO_UI_VERB ("EditSelectAll", select_all_cb),
- BONOBO_UI_VERB_END
-};
-
-typedef struct {
- GtkWidget *widget;
- BonoboControl *control;
- Bonobo_UIContainer remote_ui_container;
- char *ui_xml_path;
- char *app_name;
- BonoboUIVerb *verbs;
- gpointer user_data;
-} ControlUIClosure;
-
-static void
-free_closure (ControlUIClosure *closure,
- GtkObject *where_object_was)
-{
- bonobo_object_release_unref (closure->remote_ui_container, NULL);
- g_free (closure->ui_xml_path);
- g_free (closure->app_name);
- g_free (closure);
-}
-
-static void
-merge_menu_items (BonoboControl *control, BonoboUIComponent *uic, ControlUIClosure *closure)
-{
- if (closure->remote_ui_container) {
- bonobo_ui_component_set_container (uic, closure->remote_ui_container, NULL);
-
- bonobo_ui_component_add_verb_list_with_data (uic, closure->verbs, closure->user_data);
-
- bonobo_ui_component_freeze (uic, NULL);
-
- bonobo_ui_util_set_ui (uic, PREFIX,
- closure->ui_xml_path,
- closure->app_name, NULL);
-
- bonobo_ui_component_thaw (uic, NULL);
- }
-}
-
-static void
-unmerge_menu_items (BonoboControl *control, BonoboUIComponent *uic, ControlUIClosure *closure)
-{
- bonobo_ui_component_unset_container (uic, NULL);
-}
-
-static void
-control_set_frame_cb (BonoboControl *control,
- ControlUIClosure *closure)
-{
- Bonobo_ControlFrame frame = bonobo_control_get_control_frame (control,
- NULL);
- if (!frame)
- return;
- closure->remote_ui_container = bonobo_control_get_remote_ui_container (control, NULL);
-}
-
-static void
-control_activate_cb (BonoboControl *control,
- gboolean activate,
- ControlUIClosure *closure)
-{
- if (activate)
- gtk_widget_grab_focus (closure->widget); /* the ECanvas */
-}
-
-static gboolean
-widget_focus_cb (GtkWidget *w, GdkEventFocus *focus, ControlUIClosure *closure)
-{
- BonoboUIComponent *uic;
-
- uic = bonobo_control_get_ui_component (closure->control);
-
- if (GTK_WIDGET_HAS_FOCUS (w)) {
- merge_menu_items (closure->control, uic, closure);
- } else {
- unmerge_menu_items (closure->control, uic, closure);
- }
-
- return FALSE;
-}
-
-static void
-e_bonobo_control_automerge_ui (GtkWidget *w,
- BonoboControl *control,
- const char *ui_xml_path,
- const char *app_name,
- BonoboUIVerb *verbs,
- gpointer data)
-{
- ControlUIClosure *closure;
-
- g_return_if_fail (GTK_IS_WIDGET (w));
- g_return_if_fail (BONOBO_IS_CONTROL (control));
- g_return_if_fail (ui_xml_path != NULL);
- g_return_if_fail (app_name != NULL);
- g_return_if_fail (verbs != NULL);
-
- closure = g_new (ControlUIClosure, 1);
-
- closure->widget = w;
- closure->control = control;
- closure->ui_xml_path = g_strdup (ui_xml_path);
- closure->app_name = g_strdup (app_name);
- closure->verbs = verbs;
- closure->user_data = data;
-
- g_signal_connect (w, "focus_in_event",
- G_CALLBACK (widget_focus_cb), closure);
- g_signal_connect (w, "focus_out_event",
- G_CALLBACK (widget_focus_cb), closure);
- g_signal_connect (control, "activate",
- G_CALLBACK (control_activate_cb), closure);
- g_signal_connect (control, "set_frame",
- G_CALLBACK (control_set_frame_cb), closure);
-
- g_object_weak_ref (G_OBJECT (control), (GWeakNotify)free_closure, closure);
-}
-
-static Bonobo_Control
-impl_SelectNames_get_entry_for_section (PortableServer_Servant servant,
- const CORBA_char *section_id,
- CORBA_Environment *ev)
-{
- ESelectNamesBonobo *select_names;
- ESelectNamesBonoboPrivate *priv;
- GtkWidget *entry_widget;
- BonoboControl *control;
- BonoboPropertyBag *property_bag;
-
- select_names = E_SELECT_NAMES_BONOBO (bonobo_object (servant));
- priv = select_names->priv;
-
- entry_widget = e_select_names_manager_create_entry (priv->manager, section_id);
- gtk_widget_show (entry_widget);
-
- if (entry_widget == NULL) {
- CORBA_exception_set (ev,
- CORBA_USER_EXCEPTION,
- ex_GNOME_Evolution_Addressbook_SelectNames_SectionNotFound,
- NULL);
- return CORBA_OBJECT_NIL;
- }
-
- control = bonobo_control_new (entry_widget);
-
- property_bag = bonobo_property_bag_new (entry_get_property_fn, entry_set_property_fn, entry_widget);
- bonobo_property_bag_add (property_bag, "text", ENTRY_PROPERTY_ID_TEXT,
- BONOBO_ARG_STRING, NULL, NULL,
- BONOBO_PROPERTY_READABLE | BONOBO_PROPERTY_WRITEABLE);
- bonobo_property_bag_add (property_bag, "addresses", ENTRY_PROPERTY_ID_ADDRESSES,
- BONOBO_ARG_STRING, NULL, NULL,
- BONOBO_PROPERTY_READABLE | BONOBO_PROPERTY_WRITEABLE);
- bonobo_property_bag_add (property_bag, "destinations", ENTRY_PROPERTY_ID_DESTINATIONS,
- BONOBO_ARG_STRING, NULL, NULL,
- BONOBO_PROPERTY_READABLE | BONOBO_PROPERTY_WRITEABLE);
- bonobo_property_bag_add (property_bag, "allow_contact_lists", ENTRY_PROPERTY_ID_ALLOW_CONTACT_LISTS,
- BONOBO_ARG_BOOLEAN, NULL, NULL,
- BONOBO_PROPERTY_READABLE | BONOBO_PROPERTY_WRITEABLE);
- bonobo_property_bag_add (property_bag, "entry_changed", ENTRY_PROPERTY_ID_ENTRY_CHANGED,
- BONOBO_ARG_BOOLEAN, NULL, NULL,
- BONOBO_PROPERTY_WRITEABLE);
-
- bonobo_control_set_properties (control, bonobo_object_corba_objref (BONOBO_OBJECT (property_bag)), NULL);
- bonobo_object_unref (BONOBO_OBJECT (property_bag));
-
- g_signal_connect (entry_widget, "changed", G_CALLBACK (entry_changed), control);
-
- e_bonobo_control_automerge_ui (GTK_WIDGET (E_ENTRY (entry_widget)->canvas),
- control,
- EVOLUTION_UIDIR "/evolution-composer-entries.xml",
- "evolution-addressbook",
- verbs, entry_widget);
-
- return CORBA_Object_duplicate (bonobo_object_corba_objref (BONOBO_OBJECT (control)), ev);
-}
-
-static void
-impl_SelectNames_activate_dialog (PortableServer_Servant servant,
- const CORBA_char *section_id,
- CORBA_Environment *ev)
-{
- ESelectNamesBonobo *select_names;
- ESelectNamesBonoboPrivate *priv;
-
- select_names = E_SELECT_NAMES_BONOBO (bonobo_object (servant));
- priv = select_names->priv;
-
- e_select_names_manager_activate_dialog (priv->manager, section_id);
-}
-
-
-/* GtkObject methods. */
-
-static void
-impl_dispose (GObject *object)
-{
- ESelectNamesBonobo *select_names;
- ESelectNamesBonoboPrivate *priv;
-
- select_names = E_SELECT_NAMES_BONOBO (object);
- priv = select_names->priv;
-
- if (priv) {
- if (priv->manager->names) {
- gtk_widget_destroy (GTK_WIDGET (priv->manager->names));
- priv->manager->names = NULL;
- }
-
- g_object_unref (priv->manager);
-
- g_free (priv);
- select_names->priv = NULL;
- }
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-
-static void
-e_select_names_bonobo_class_init (ESelectNamesBonoboClass *klass)
-{
- GObjectClass *object_class;
- POA_GNOME_Evolution_Addressbook_SelectNames__epv *epv;
-
- object_class = G_OBJECT_CLASS (klass);
- parent_class = g_type_class_peek_parent (klass);
-
- object_class->dispose = impl_dispose;
-
- epv = &klass->epv;
- epv->addSection = impl_SelectNames_add_section;
- epv->addSectionWithLimit = impl_SelectNames_add_section_with_limit;
- epv->getEntryBySection = impl_SelectNames_get_entry_for_section;
- epv->activateDialog = impl_SelectNames_activate_dialog;
-}
-
-static void
-e_select_names_bonobo_init (ESelectNamesBonobo *select_names)
-{
- ESelectNamesBonoboPrivate *priv;
-
- priv = g_new (ESelectNamesBonoboPrivate, 1);
-
- priv->manager = e_select_names_manager_new ();
- priv->event_source = NULL;
-
- g_signal_connect (priv->manager,
- "changed",
- G_CALLBACK (manager_changed_cb),
- select_names);
-
- g_signal_connect (priv->manager,
- "ok",
- G_CALLBACK (manager_ok_cb),
- select_names);
-
- select_names->priv = priv;
-}
-
-
-static void
-e_select_names_bonobo_construct (ESelectNamesBonobo *select_names)
-{
- g_return_if_fail (select_names != NULL);
- g_return_if_fail (E_IS_SELECT_NAMES_BONOBO (select_names));
-
- g_assert (select_names->priv->event_source == NULL);
- select_names->priv->event_source = bonobo_event_source_new ();
- bonobo_object_add_interface (BONOBO_OBJECT (select_names), BONOBO_OBJECT (select_names->priv->event_source));
-}
-
-ESelectNamesBonobo *
-e_select_names_bonobo_new (void)
-{
- ESelectNamesBonobo *select_names;
-
- select_names = g_object_new (E_TYPE_SELECT_NAMES_BONOBO, NULL);
-
- e_select_names_bonobo_construct (select_names);
-
- return select_names;
-}
-
-
-BONOBO_TYPE_FUNC_FULL (
- ESelectNamesBonobo,
- GNOME_Evolution_Addressbook_SelectNames,
- PARENT_TYPE,
- e_select_names_bonobo);
diff --git a/addressbook/gui/component/select-names/e-select-names-bonobo.h b/addressbook/gui/component/select-names/e-select-names-bonobo.h
deleted file mode 100644
index 5b04ed5b2e..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-bonobo.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* e-select-names-bonobo.h
- *
- * Copyright (C) 2000 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Ettore Perazzoli
- */
-
-#ifndef __E_SELECT_NAMES_BONOBO_H__
-#define __E_SELECT_NAMES_BONOBO_H__
-
-#include <bonobo/bonobo-object.h>
-
-#include "Evolution-Addressbook-SelectNames.h"
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#define E_TYPE_SELECT_NAMES_BONOBO (e_select_names_bonobo_get_type ())
-#define E_SELECT_NAMES_BONOBO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_SELECT_NAMES_BONOBO, ESelectNamesBonobo))
-#define E_SELECT_NAMES_BONOBO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_SELECT_NAMES_BONOBO, ESelectNamesBonoboClass))
-#define E_IS_SELECT_NAMES_BONOBO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_SELECT_NAMES_BONOBO))
-#define E_IS_SELECT_NAMES_BONOBO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_SELECT_NAMES_BONOBO))
-
-
-typedef struct _ESelectNamesBonobo ESelectNamesBonobo;
-typedef struct _ESelectNamesBonoboPrivate ESelectNamesBonoboPrivate;
-typedef struct _ESelectNamesBonoboClass ESelectNamesBonoboClass;
-
-struct _ESelectNamesBonobo {
- BonoboObject parent;
-
- ESelectNamesBonoboPrivate *priv;
-};
-
-struct _ESelectNamesBonoboClass {
- BonoboObjectClass parent_class;
-
- POA_GNOME_Evolution_Addressbook_SelectNames__epv epv;
-};
-
-
-GType e_select_names_bonobo_get_type (void);
-ESelectNamesBonobo *e_select_names_bonobo_new (void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __E_SELECT_NAMES_BONOBO_H__ */
diff --git a/addressbook/gui/component/select-names/e-select-names-completion.c b/addressbook/gui/component/select-names/e-select-names-completion.c
deleted file mode 100644
index 39b5f7a008..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-completion.c
+++ /dev/null
@@ -1,1231 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * e-select-names-completion.c
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Developed by Jon Trowbridge <trow@ximian.com>
- */
-
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA.
- */
-
-#include <config.h>
-#include "e-select-names-completion.h"
-
-#include <ctype.h>
-#include <stdio.h>
-#include <string.h>
-#include <math.h>
-
-#include <gtk/gtksignal.h>
-
-#include <libebook/e-contact.h>
-#include <addressbook/util/eab-book-util.h>
-#include <addressbook/util/eab-destination.h>
-#include <addressbook/gui/merging/eab-contact-compare.h>
-
-typedef struct {
- EBook *book;
- guint book_view_tag;
- EBookView *book_view;
- ESelectNamesCompletion *comp;
- guint contacts_added_tag;
- guint seq_complete_tag;
- gboolean sequence_complete_received;
-
- gchar *cached_query_text;
- GList *cached_cards;
- gboolean cache_complete;
-
-} ESelectNamesCompletionBookData;
-
-struct _ESelectNamesCompletionPrivate {
-
- ESelectNamesTextModel *text_model;
-
- GList *book_data;
- gint books_not_ready;
- gint pending_completion_seq;
-
- gchar *waiting_query;
- gint waiting_pos, waiting_limit;
- gchar *query_text;
-
- gboolean match_contact_lists;
-
- gint minimum_query_length;
-};
-
-static void e_select_names_completion_class_init (ESelectNamesCompletionClass *);
-static void e_select_names_completion_init (ESelectNamesCompletion *);
-static void e_select_names_completion_dispose (GObject *object);
-
-static void e_select_names_completion_got_book_view_cb (EBook *book, EBookStatus status, EBookView *view, gpointer user_data);
-static void e_select_names_completion_contacts_added_cb (EBookView *, const GList *cards, gpointer user_data);
-static void e_select_names_completion_seq_complete_cb (EBookView *, EBookViewStatus status, gpointer user_data);
-
-static void e_select_names_completion_do_query (ESelectNamesCompletion *, const gchar *query_text, gint pos, gint limit);
-
-static void e_select_names_completion_handle_request (ECompletion *, const gchar *txt, gint pos, gint limit);
-static void e_select_names_completion_end (ECompletion *);
-
-static GObjectClass *parent_class;
-
-static FILE *out;
-
-/*
- *
- * Query builders
- *
- */
-
-typedef gchar *(*BookQuerySExp) (ESelectNamesCompletion *);
-typedef ECompletionMatch *(*BookQueryMatchTester) (ESelectNamesCompletion *, EABDestination *);
-
-static int
-utf8_casefold_collate_len (const gchar *str1, const gchar *str2, int len)
-{
- gchar *s1 = g_utf8_casefold(str1, len);
- gchar *s2 = g_utf8_casefold(str2, len);
- int rv;
-
- rv = g_utf8_collate (s1, s2);
-
- g_free (s1);
- g_free (s2);
-
- return rv;
-}
-
-static int
-utf8_casefold_collate (const gchar *str1, const gchar *str2)
-{
- return utf8_casefold_collate_len (str1, str2, -1);
-}
-
-static void
-our_match_destroy (ECompletionMatch *match)
-{
- g_object_unref (match->user_data);
-}
-
-static ECompletionMatch *
-make_match (EABDestination *dest, const gchar *menu_form, double score)
-{
- ECompletionMatch *match;
-#if notyet
- EContact *contact = eab_destination_get_contact (dest);
-#endif
-
- match = e_completion_match_new (eab_destination_get_name (dest), menu_form, score);
-
- e_completion_match_set_text (match, eab_destination_get_name (dest), menu_form);
-
- /* Reject any match that has null text fields. */
- if (! (e_completion_match_get_match_text (match) && e_completion_match_get_menu_text (match))) {
- g_object_unref (match);
- return NULL;
- }
-
-#if notyet
- /* XXX toshok - EContact doesn't have the use_score stuff */
- /* Since we sort low to high, we negate so that larger use scores will come first */
- match->sort_major = contact ? -floor (e_contact_get_use_score (contact)) : 0;
-#else
- match->sort_major = 0;
-#endif
-
- match->sort_minor = eab_destination_get_email_num (dest);
-
- match->user_data = dest;
- g_object_ref (dest);
-
- match->destroy = our_match_destroy;
-
- return match;
-}
-
-/*
- * Nickname query
- */
-
-static gchar *
-sexp_nickname (ESelectNamesCompletion *comp)
-{
- gchar *query = g_strdup_printf ("(beginswith \"nickname\" \"%s\")", comp->priv->query_text);
-
- return query;
-}
-
-static ECompletionMatch *
-match_nickname (ESelectNamesCompletion *comp, EABDestination *dest)
-{
- ECompletionMatch *match = NULL;
- gint len;
- EContact *contact = eab_destination_get_contact (dest);
- double score;
- const char *nickname;
-
- nickname = e_contact_get_const (contact, E_CONTACT_NICKNAME);
- if (nickname == NULL)
- return NULL;
-
- len = g_utf8_strlen (comp->priv->query_text, -1);
- if (nickname && !utf8_casefold_collate_len (comp->priv->query_text, nickname, len)) {
- const gchar *name;
- gchar *str;
-
- score = len * 2; /* nickname gives 2 points per matching character */
-
- if (len == g_utf8_strlen (nickname, -1)) /* boost score on an exact match */
- score *= 10;
-
- name = eab_destination_get_name (dest);
- if (name && *name)
- str = g_strdup_printf ("'%s' %s <%s>", nickname, name, eab_destination_get_email (dest));
- else
- str = g_strdup_printf ("'%s' <%s>", nickname, eab_destination_get_email (dest));
-
- match = make_match (dest, str, score);
- g_free (str);
- }
-
- return match;
-}
-
-/*
- * E-Mail Query
- */
-
-static gchar *
-sexp_email (ESelectNamesCompletion *comp)
-{
- return g_strdup_printf ("(beginswith \"email\" \"%s\")", comp->priv->query_text);
-}
-
-static ECompletionMatch *
-match_email (ESelectNamesCompletion *comp, EABDestination *dest)
-{
- ECompletionMatch *match;
- gint len = strlen (comp->priv->query_text);
- const gchar *name = eab_destination_get_name (dest);
- const gchar *email = eab_destination_get_email (dest);
- double score;
-
- if (email
- && !utf8_casefold_collate_len (comp->priv->query_text, email, len)
- && !eab_destination_is_evolution_list (dest)) {
-
- gchar *str;
-
- score = len * 2; /* 2 points for each matching character */
-
- if (name && *name)
- str = g_strdup_printf ("<%s> %s", email, name);
- else
- str = g_strdup (email);
-
- match = make_match (dest, str, score);
-
- g_free (str);
-
- return match;
- }
-
- return NULL;
-}
-
-/*
- * Name Query
- */
-
-static gchar *
-name_style_query (ESelectNamesCompletion *comp, const gchar *field)
-{
- if (comp && comp->priv->query_text && *comp->priv->query_text) {
- gchar *cpy = g_strdup (comp->priv->query_text), *c;
- gchar **strv;
- gchar *query;
- gint i, count=0;
-
- for (c = cpy; *c; ++c) {
- if (*c == ',')
- *c = ' ';
- }
-
- strv = g_strsplit (cpy, " ", 0);
- for (i=0; strv[i]; ++i) {
- gchar *old;
- ++count;
- g_strstrip (strv[i]);
- old = strv[i];
- strv[i] = g_strdup_printf ("(beginswith \"%s\" \"%s\")", field, old);
- g_free (old);
- }
-
- if (count == 1) {
- query = strv[0];
- strv[0] = NULL;
- } else {
- gchar *joined = g_strjoinv (" ", strv);
- query = g_strdup_printf ("(and %s)", joined);
- g_free (joined);
- }
-
- g_free (cpy);
- g_strfreev (strv);
-
- return query;
- }
-
- return NULL;
-}
-
-static gchar *
-sexp_name (ESelectNamesCompletion *comp)
-{
- return name_style_query (comp, "full_name");
-}
-
-static ECompletionMatch *
-match_name (ESelectNamesCompletion *comp, EABDestination *dest)
-{
- ECompletionMatch *final_match = NULL;
- gchar *menu_text = NULL;
- EContact *contact;
- const gchar *email;
- gint match_len = 0;
- EABContactMatchType match;
- EABContactMatchPart first_match;
- double score = 0;
- gboolean have_given, have_additional, have_family;
- EContactName *contact_name;
-
- contact = eab_destination_get_contact (dest);
-
- contact_name = e_contact_get (contact, E_CONTACT_NAME);
- if (!contact_name)
- return NULL;
-
- email = eab_destination_get_email (dest);
-
- match = eab_contact_compare_name_to_string_full (contact, comp->priv->query_text, TRUE /* yes, allow partial matches */,
- NULL, &first_match, &match_len);
-
- if (match <= EAB_CONTACT_MATCH_NONE) {
- e_contact_name_free (contact_name);
- return NULL;
- }
-
- score = match_len * 3; /* three points per match character */
-
- have_given = contact_name->given && *contact_name->given;
- have_additional = contact_name->additional && *contact_name->additional;
- have_family = contact_name->family && *contact_name->family;
-
- if (e_contact_get (contact, E_CONTACT_IS_LIST)) {
-
- menu_text = e_contact_name_to_string (contact_name);
-
- } else if (first_match == EAB_CONTACT_MATCH_PART_GIVEN_NAME) {
-
- if (have_family)
- menu_text = g_strdup_printf ("%s %s <%s>", contact_name->given, contact_name->family, email);
- else
- menu_text = g_strdup_printf ("%s <%s>", contact_name->given, email);
-
- } else if (first_match == EAB_CONTACT_MATCH_PART_ADDITIONAL_NAME) {
-
- if (have_given) {
-
- menu_text = g_strdup_printf ("%s%s%s, %s <%s>",
- contact_name->additional,
- have_family ? " " : "",
- have_family ? contact_name->family : "",
- contact_name->given,
- email);
- } else {
-
- menu_text = g_strdup_printf ("%s%s%s <%s>",
- contact_name->additional,
- have_family ? " " : "",
- have_family ? contact_name->family : "",
- email);
- }
-
- } else if (first_match == EAB_CONTACT_MATCH_PART_FAMILY_NAME) {
-
- if (have_given)
- menu_text = g_strdup_printf ("%s, %s%s%s <%s>",
- contact_name->family,
- contact_name->given,
- have_additional ? " " : "",
- have_additional ? contact_name->additional : "",
- email);
- else
- menu_text = g_strdup_printf ("%s <%s>", contact_name->family, email);
-
- } else { /* something funny happened */
-
- menu_text = g_strdup_printf ("<%s> ???", email);
-
- }
-
- if (menu_text) {
- g_strstrip (menu_text);
- final_match = make_match (dest, menu_text, score);
- g_free (menu_text);
- }
-
- e_contact_name_free (contact_name);
-
- return final_match;
-}
-
-/*
- * File As Query
- */
-
-static gchar *
-sexp_file_as (ESelectNamesCompletion *comp)
-{
- return name_style_query (comp, "file_as");
-}
-
-static ECompletionMatch *
-match_file_as (ESelectNamesCompletion *comp, EABDestination *dest)
-{
- const gchar *name;
- const gchar *email;
- gchar *cpy, **strv, *menu_text;
- gint i, len;
- double score = 0.00001;
- ECompletionMatch *match;
-
- name = eab_destination_get_name (dest);
- email = eab_destination_get_email (dest);
-
- if (!(name && *name))
- return NULL;
-
- cpy = g_strdup (comp->priv->query_text);
- strv = g_strsplit (cpy, " ", 0);
-
- for (i=0; strv[i] && score > 0; ++i) {
- len = g_utf8_strlen (strv[i], -1);
- if (!utf8_casefold_collate_len (name, strv[i], len))
- score += len; /* one point per character of the match */
- else
- score = 0;
- }
-
- g_free (cpy);
- g_strfreev (strv);
-
- if (score <= 0)
- return NULL;
-
- menu_text = g_strdup_printf ("%s <%s>", name, email);
- g_strstrip (menu_text);
- match = make_match (dest, menu_text, score);
- g_free (menu_text);
-
- return match;
-}
-
-typedef struct _BookQuery BookQuery;
-struct _BookQuery {
- BookQuerySExp builder;
- BookQueryMatchTester tester;
-};
-
-static BookQuery book_queries[] = {
- { sexp_nickname, match_nickname},
- { sexp_email, match_email },
- { sexp_name, match_name },
- { sexp_file_as, match_file_as },
-};
-static gint book_query_count = sizeof (book_queries) / sizeof (BookQuery);
-
-/*
- * Build up a big compound sexp corresponding to all of our queries.
- */
-static gchar *
-book_query_sexp (ESelectNamesCompletion *comp)
-{
- gint i, j;
- gchar **queryv, *query;
-
- g_return_val_if_fail (comp && E_IS_SELECT_NAMES_COMPLETION (comp), NULL);
-
- if (! (comp->priv->query_text && *comp->priv->query_text))
- return NULL;
-
- queryv = g_new0 (gchar *, book_query_count+1);
- for (i=0, j=0; i<book_query_count; ++i) {
- queryv[j] = book_queries[i].builder (comp);
- if (queryv[j])
- ++j;
- }
-
- if (j == 0) {
- query = NULL;
- } else if (j == 1) {
- query = queryv[0];
- queryv[0] = NULL;
- } else {
- gchar *tmp = g_strjoinv (" ", queryv);
- query = g_strdup_printf ("(or %s)", tmp);
- g_free (tmp);
- }
-
- for (i=0; i<book_query_count; ++i)
- g_free (queryv[i]);
- g_free (queryv);
-
- return query;
-}
-
-/*
- * Sweep across all of our query rules and find the best score/match
- * string that applies to a given destination.
- */
-static ECompletionMatch *
-book_query_score (ESelectNamesCompletion *comp, EABDestination *dest)
-{
- ECompletionMatch *best_match = NULL;
- gint i;
-
- g_return_val_if_fail (E_IS_SELECT_NAMES_COMPLETION (comp), NULL);
- g_return_val_if_fail (EAB_IS_DESTINATION (dest), NULL);
-
- if (! (comp->priv->query_text && *comp->priv->query_text))
- return NULL;
-
- for (i=0; i<book_query_count; ++i) {
-
- ECompletionMatch *this_match = NULL;
-
- if (book_queries[i].tester && eab_destination_get_contact (dest)) {
- this_match = book_queries[i].tester (comp, dest);
- }
-
- if (this_match) {
- if (best_match == NULL || this_match->score > best_match->score) {
- e_completion_match_unref (best_match);
- best_match = this_match;
- } else {
- e_completion_match_unref (this_match);
- }
- }
- }
-
- return best_match;
-}
-
-static void
-book_query_process_card_list (ESelectNamesCompletion *comp, const GList *contacts)
-{
- while (contacts) {
- EContact *contact = E_CONTACT (contacts->data);
-
- if (e_contact_get (contact, E_CONTACT_IS_LIST)) {
-
- if (comp->priv->match_contact_lists) {
-
- EABDestination *dest = eab_destination_new ();
- ECompletionMatch *match;
- eab_destination_set_contact (dest, contact, 0);
- match = book_query_score (comp, dest);
- if (match && match->score > 0) {
- e_completion_found_match (E_COMPLETION (comp), match);
- } else {
- e_completion_match_unref (match);
- }
- g_object_unref (dest);
-
- }
-
- }
- else {
- GList *email = e_contact_get (contact, E_CONTACT_EMAIL);
- if (email) {
- GList *iter;
- gint i;
- for (i=0, iter = email; iter; ++i, iter = iter->next) {
- EABDestination *dest = eab_destination_new ();
- gchar *e;
- ECompletionMatch *match;
-
- eab_destination_set_contact (dest, contact, i);
- e = iter->data;
-
- if (e && *e) {
-
- match = book_query_score (comp, dest);
- if (match && match->score > 0) {
- e_completion_found_match (E_COMPLETION (comp), match);
- } else {
- e_completion_match_unref (match);
- }
- }
-
- g_object_unref (dest);
- }
- }
- g_list_foreach (email, (GFunc)g_free, NULL);
- g_list_free (email);
- }
-
- contacts = contacts->next;
- }
-}
-
-/*
- *
- * ESelectNamesCompletion code
- *
- */
-
-
-GType
-e_select_names_completion_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (ESelectNamesCompletionClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_select_names_completion_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (ESelectNamesCompletion),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_select_names_completion_init,
- };
-
- type = g_type_register_static (e_completion_get_type (), "ESelectNamesCompletion", &info, 0);
- }
-
- return type;
-}
-
-static void
-e_select_names_completion_class_init (ESelectNamesCompletionClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- ECompletionClass *completion_class = E_COMPLETION_CLASS (klass);
-
- parent_class = g_type_class_peek_parent (klass);
-
- object_class->dispose = e_select_names_completion_dispose;
-
- completion_class->request_completion = e_select_names_completion_handle_request;
- completion_class->end_completion = e_select_names_completion_end;
-
- if (getenv ("EVO_DEBUG_SELECT_NAMES_COMPLETION")) {
- out = fopen ("/tmp/evo-debug-select-names-completion", "w");
- if (out)
- setvbuf (out, NULL, _IONBF, 0);
- }
-}
-
-static void
-e_select_names_completion_init (ESelectNamesCompletion *comp)
-{
- comp->priv = g_new0 (struct _ESelectNamesCompletionPrivate, 1);
- comp->priv->match_contact_lists = TRUE;
-}
-
-static void
-e_select_names_completion_clear_book_data (ESelectNamesCompletion *comp)
-{
- GList *l;
-
- for (l = comp->priv->book_data; l; l = l->next) {
- ESelectNamesCompletionBookData *book_data = l->data;
-
- if (book_data->contacts_added_tag) {
- g_signal_handler_disconnect (book_data->book_view, book_data->contacts_added_tag);
- book_data->contacts_added_tag = 0;
- }
-
- if (book_data->seq_complete_tag) {
- g_signal_handler_disconnect (book_data->book_view, book_data->seq_complete_tag);
- book_data->seq_complete_tag = 0;
- }
-
- g_object_unref (book_data->book);
-
- if (book_data->book_view) {
- e_book_view_stop (book_data->book_view);
- g_object_unref (book_data->book_view);
- }
-
- g_free (book_data->cached_query_text);
- g_list_foreach (book_data->cached_cards, (GFunc)g_object_unref, NULL);
- g_list_free (book_data->cached_cards);
-
- g_free (book_data);
- }
- g_list_free (comp->priv->book_data);
- comp->priv->book_data = NULL;
-}
-
-static void
-e_select_names_completion_dispose (GObject *object)
-{
- ESelectNamesCompletion *comp = E_SELECT_NAMES_COMPLETION (object);
-
- if (comp->priv) {
- if (comp->priv->text_model)
- g_object_unref (comp->priv->text_model);
-
- e_select_names_completion_clear_book_data (comp);
-
- g_free (comp->priv->waiting_query);
- g_free (comp->priv->query_text);
-
- g_free (comp->priv);
- comp->priv = NULL;
- }
-
- if (parent_class->dispose)
- parent_class->dispose (object);
-}
-
-
-/*
- *
- * EBook/EBookView Callbacks & Query Stuff
- *
- */
-
-static gchar *
-clean_query_text (const gchar *s)
-{
- gchar *q = g_new (gchar, strlen(s)+1), *t;
-
- t = q;
- while (*s) {
- if (*s != ',' && *s != '"') {
- *t = *s;
- ++t;
- }
- ++s;
- }
- *t = '\0';
-
- g_strstrip (q);
-
- return q;
-}
-
-static void
-e_select_names_completion_clear_cache (ESelectNamesCompletionBookData *book_data)
-{
- if (out)
- fprintf (out, "** clearing cache on book %s\n", e_book_get_uri (book_data->book));
-
- g_free (book_data->cached_query_text);
- g_list_foreach (book_data->cached_cards, (GFunc)g_object_unref, NULL);
- g_list_free (book_data->cached_cards);
-
- book_data->cached_query_text = NULL;
- book_data->cached_cards = NULL;
-}
-
-static void
-e_select_names_completion_done (ESelectNamesCompletion *comp)
-{
- g_free (comp->priv->query_text);
- comp->priv->query_text = NULL;
-
- e_completion_end_search (E_COMPLETION (comp)); /* That's all folks! */
-
- /* Need to launch a new completion if another one is pending. */
- if (comp->priv->waiting_query) {
- gchar *s = comp->priv->waiting_query;
- comp->priv->waiting_query = NULL;
- e_completion_begin_search (E_COMPLETION (comp), s, comp->priv->waiting_pos, comp->priv->waiting_limit);
- g_free (s);
- }
-}
-
-static void
-e_select_names_completion_got_book_view_cb (EBook *book, EBookStatus status, EBookView *view, gpointer user_data)
-{
- ESelectNamesCompletion *comp;
- ESelectNamesCompletionBookData *book_data;
-
- book_data = (ESelectNamesCompletionBookData*)user_data;
- comp = book_data->comp;
-
- if (status != E_BOOK_ERROR_OK) {
- comp->priv->pending_completion_seq--;
- if (!comp->priv->pending_completion_seq)
- e_select_names_completion_done (comp);
- return;
- }
-
- book_data->book_view_tag = 0;
-
- if (book_data->contacts_added_tag) {
- g_signal_handler_disconnect (book_data->book_view, book_data->contacts_added_tag);
- book_data->contacts_added_tag = 0;
- }
- if (book_data->seq_complete_tag) {
- g_signal_handler_disconnect (book_data->book_view, book_data->seq_complete_tag);
- book_data->seq_complete_tag = 0;
- }
-
- g_object_ref (view);
- if (book_data->book_view) {
- e_book_view_stop (book_data->book_view);
- g_object_unref (book_data->book_view);
- }
- book_data->book_view = view;
-
- book_data->contacts_added_tag =
- g_signal_connect (view,
- "contacts_added",
- G_CALLBACK (e_select_names_completion_contacts_added_cb),
- book_data);
-
- book_data->seq_complete_tag =
- g_signal_connect (view,
- "sequence_complete",
- G_CALLBACK (e_select_names_completion_seq_complete_cb),
- book_data);
-
- e_book_view_start (view);
-
- book_data->sequence_complete_received = FALSE;
-}
-
-static void
-e_select_names_completion_contacts_added_cb (EBookView *book_view, const GList *cards, gpointer user_data)
-{
- ESelectNamesCompletionBookData *book_data = user_data;
- ESelectNamesCompletion *comp = book_data->comp;
-
- if (e_completion_searching (E_COMPLETION (comp))) {
- book_query_process_card_list (comp, cards);
-
- /* Save the list of matching cards. */
- while (cards) {
- book_data->cached_cards = g_list_prepend (book_data->cached_cards, cards->data);
- g_object_ref (cards->data);
- cards = g_list_next (cards);
- }
- }
-}
-
-static void
-e_select_names_completion_seq_complete_cb (EBookView *book_view, EBookViewStatus status, gpointer user_data)
-{
- ESelectNamesCompletionBookData *book_data = user_data;
- ESelectNamesCompletion *comp = book_data->comp;
-
- if (out)
- fprintf (out, "** got sequence_complete (status = %d) on book %s\n", status, e_book_get_uri (book_data->book));
-
- /*
- * We aren't searching, but the addressbook has changed -- clear our card cache so that
- * future completion requests will take the changes into account.
- */
- if (! e_completion_searching (E_COMPLETION (comp))) {
- if (out)
- fprintf (out, "\t we weren't searching, clearing the cache\n");
- e_select_names_completion_clear_cache (book_data);
- return;
- }
-
- if (book_data->cached_query_text
- && status == E_BOOK_ERROR_OK
- && !book_data->cache_complete
- && !strcmp (book_data->cached_query_text, comp->priv->query_text))
- book_data->cache_complete = TRUE;
-
- if (out)
- fprintf (out, "\tending search, book_data->cache_complete == %d\n", book_data->cache_complete);
-
- if (!book_data->sequence_complete_received) {
- book_data->sequence_complete_received = TRUE;
-
- if (book_data->contacts_added_tag) {
- g_signal_handler_disconnect (book_data->book_view, book_data->contacts_added_tag);
- book_data->contacts_added_tag = 0;
- }
- if (book_data->seq_complete_tag) {
- g_signal_handler_disconnect (book_data->book_view, book_data->seq_complete_tag);
- book_data->seq_complete_tag = 0;
- }
-
- if (out)
- fprintf (out, "\t %d remaining book view's\n", comp->priv->pending_completion_seq - 1);
-
- comp->priv->pending_completion_seq --;
- if (comp->priv->pending_completion_seq > 0)
- return;
- }
-
- e_select_names_completion_done (comp);
-}
-
-static void
-e_select_names_completion_stop_query (ESelectNamesCompletion *comp)
-{
- GList *l;
-
- g_return_if_fail (comp && E_IS_SELECT_NAMES_COMPLETION (comp));
-
- if (out)
- fprintf (out, "stopping query\n");
-
- if (comp->priv->waiting_query) {
- if (out)
- fprintf (out, "stopped waiting query\n");
- g_free (comp->priv->waiting_query);
- comp->priv->waiting_query = NULL;
- }
-
- g_free (comp->priv->query_text);
- comp->priv->query_text = NULL;
-
- for (l = comp->priv->book_data; l; l = l->next) {
- ESelectNamesCompletionBookData *book_data = l->data;
- if (book_data->book_view_tag) {
-#if notyet
- e_book_cancel (book_data->book, book_data->book_view_tag);
-#endif
- book_data->book_view_tag = 0;
- }
- if (book_data->book_view) {
- if (book_data->contacts_added_tag) {
- g_signal_handler_disconnect (book_data->book_view, book_data->contacts_added_tag);
- book_data->contacts_added_tag = 0;
- }
- if (book_data->seq_complete_tag) {
- g_signal_handler_disconnect (book_data->book_view, book_data->seq_complete_tag);
- book_data->seq_complete_tag = 0;
- }
-
- e_book_view_stop (book_data->book_view);
- g_object_unref (book_data->book_view);
- book_data->book_view = NULL;
- }
- }
-
- comp->priv->pending_completion_seq = 0;
-}
-
-static void
-e_select_names_completion_start_query (ESelectNamesCompletion *comp, const gchar *query_text)
-{
- g_return_if_fail (comp && E_IS_SELECT_NAMES_COMPLETION (comp));
- g_return_if_fail (query_text);
-
- e_select_names_completion_stop_query (comp); /* Stop any prior queries. */
-
- if (comp->priv->books_not_ready == 0) {
- gchar *sexp;
-
- if (strlen (query_text) < comp->priv->minimum_query_length) {
- e_completion_end_search (E_COMPLETION (comp));
- return;
- }
-
- g_free (comp->priv->query_text);
- comp->priv->query_text = g_strdup (query_text);
-
- sexp = book_query_sexp (comp);
- if (sexp && *sexp) {
- GList *l;
-
- if (out)
- fprintf (out, "\n\n**** starting query: \"%s\"\n", comp->priv->query_text);
-
- for (l = comp->priv->book_data; l; l = l->next) {
- ESelectNamesCompletionBookData *book_data = l->data;
- gboolean can_reuse_cached_cards;
-
- if (out) {
- fprintf (out,
- "book == %s[\n"
- "\tbook_data->cached_query_text == `%s'\n"
- "\tbook_data->cache_complete == %d\n"
- "\tbook_data->cached_cards == %p\n",
- e_book_get_uri (book_data->book),
- book_data->cached_query_text,
- book_data->cache_complete,
- book_data->cached_cards);
- }
-
- /* for lack of a better place, we invalidate the cache here if we
- notice that the text is different. */
- if (book_data->cached_query_text
- && (strlen (book_data->cached_query_text) > strlen (query_text)
- || utf8_casefold_collate_len (book_data->cached_query_text, query_text,
- strlen (book_data->cached_query_text))))
- book_data->cache_complete = FALSE;
-
- can_reuse_cached_cards = (book_data->cached_query_text
- && book_data->cache_complete
- && book_data->cached_cards != NULL);
-
- if (can_reuse_cached_cards) {
-
- if (out)
- fprintf (out, "\t*** can reuse cached cards (%d cards cached)!\n", g_list_length (book_data->cached_cards));
-
- if (out)
- fprintf (out, "\tusing existing query info: %s (vs %s)\n", query_text, book_data->cached_query_text);
- book_query_process_card_list (comp, book_data->cached_cards);
- }
- else {
- e_select_names_completion_clear_cache (book_data);
- book_data->cached_query_text = g_strdup (query_text);
-
- book_data->book_view_tag = e_book_async_get_book_view (book_data->book,
- sexp,
- e_select_names_completion_got_book_view_cb, book_data);
- comp->priv->pending_completion_seq++;
- }
-
- if (out)
- fprintf (out, "]\n");
- }
-
- /* if we looped through all the books
- and were able to complete based
- solely on our cached cards, signal
- that the search is over. */
- if (!comp->priv->pending_completion_seq)
- e_select_names_completion_done (E_SELECT_NAMES_COMPLETION (comp));
- } else {
- g_free (comp->priv->query_text);
- comp->priv->query_text = NULL;
- }
- g_free (sexp);
-
- } else {
-
- comp->priv->waiting_query = g_strdup (query_text);
-
- }
-}
-
-static void
-e_select_names_completion_do_query (ESelectNamesCompletion *comp, const gchar *query_text, gint pos, gint limit)
-{
- gchar *clean;
-
- g_return_if_fail (comp != NULL);
- g_return_if_fail (E_IS_SELECT_NAMES_COMPLETION (comp));
-
- clean = clean_query_text (query_text);
- if (! (clean && *clean)) {
- g_free (clean);
- e_completion_end_search (E_COMPLETION (comp));
- return;
- }
-
- if (out)
- fprintf (out, "do_query: %s => %s\n", query_text, clean);
-
- e_select_names_completion_start_query (comp, clean);
- g_free (clean);
-}
-
-
-/*
- *
- * Completion Search Override - a Framework for Christian-Resurrection-Holiday Edible-Chicken-Ova
- *
- */
-
-typedef struct _SearchOverride SearchOverride;
-struct _SearchOverride {
- const gchar *trigger;
- const gchar *text[4];
-};
-static SearchOverride override[] = {
- { "why?", { "\"I must create a system, or be enslaved by another man's.\"",
- " -- Wiliam Blake, \"Jerusalem\"",
- NULL } },
- { "easter-egg?", { "What were you expecting, a flight simulator?", NULL } },
- { NULL, { NULL } } };
-
-static gboolean
-search_override_check (SearchOverride *over, const gchar *text)
-{
- /* The g_utf8_validate is needed because as of 2001-06-11,
- * EText doesn't translate from locale->UTF8 when you paste
- * into it.
- */
- if (over == NULL || text == NULL || !g_utf8_validate (text, -1, NULL))
- return FALSE;
-
- return !utf8_casefold_collate (over->trigger, text);
-}
-
-
-/*
- *
- * Completion Callbacks
- *
- */
-
-static void
-e_select_names_completion_handle_request (ECompletion *comp, const gchar *text, gint pos, gint limit)
-{
- ESelectNamesCompletion *selcomp = E_SELECT_NAMES_COMPLETION (comp);
- const gchar *str;
- gint index, j;
-
- g_return_if_fail (comp != NULL);
- g_return_if_fail (E_IS_SELECT_NAMES_COMPLETION (comp));
- g_return_if_fail (text != NULL);
-
- if (out) {
- fprintf (out, "\n\n**** requesting completion\n");
- fprintf (out, "text=\"%s\" pos=%d limit=%d\n", text, pos, limit);
- }
-
- e_select_names_model_text_pos (selcomp->priv->text_model->source,
- selcomp->priv->text_model->seplen,
- pos, &index, NULL, NULL);
- str = index >= 0 ? e_select_names_model_get_string (selcomp->priv->text_model->source, index) : NULL;
-
- if (out)
- fprintf (out, "index=%d str=\"%s\"\n", index, str);
-
- if (str == NULL || *str == '\0') {
- if (out)
- fprintf (out, "aborting empty query\n");
- e_completion_end_search (comp);
- return;
- }
-
- for (j=0; override[j].trigger; ++j) {
- if (search_override_check (&(override[j]), str)) {
- gint k;
-
- for (k=0; override[j].text[k]; ++k) {
- ECompletionMatch *match = g_new (ECompletionMatch, 1);
- e_completion_match_construct (match);
- e_completion_match_set_text (match, text, override[j].text[k]);
- match->score = 1 / (double) (k + 1);
- e_completion_found_match (comp, match);
- }
-
- e_completion_end_search (comp);
- return;
- }
- }
-
- e_select_names_completion_do_query (selcomp, str, pos, limit);
-}
-
-static void
-e_select_names_completion_end (ECompletion *comp)
-{
- g_return_if_fail (comp != NULL);
- g_return_if_fail (E_IS_COMPLETION (comp));
-
- if (out)
- fprintf (out, "completion ended\n");
-}
-
-/*
- *
- * Our Pseudo-Constructor
- *
- */
-
-ECompletion *
-e_select_names_completion_new (ESelectNamesTextModel *text_model)
-{
- ESelectNamesCompletion *comp;
-
- g_return_val_if_fail (E_IS_SELECT_NAMES_TEXT_MODEL (text_model), NULL);
-
- comp = g_object_new (E_TYPE_SELECT_NAMES_COMPLETION, NULL);
-
- comp->priv->text_model = text_model;
- g_object_ref (text_model);
-
- return E_COMPLETION (comp);
-}
-
-void
-e_select_names_completion_add_book (ESelectNamesCompletion *comp, EBook *book)
-{
- ESelectNamesCompletionBookData *book_data;
-
- g_return_if_fail (book != NULL);
-
- book_data = g_new0 (ESelectNamesCompletionBookData, 1);
- book_data->book = book;
- book_data->comp = comp;
- g_object_ref (book_data->book);
- comp->priv->book_data = g_list_append (comp->priv->book_data, book_data);
-
- /* XXX toshok - this doesn't work properly. need to rethink this next bit. */
- /* if the user is typing as we're adding books, restart the
- query after the new book has been added */
- if (comp->priv->query_text && *comp->priv->query_text) {
- char *query_text = g_strdup (comp->priv->query_text);
- e_select_names_completion_stop_query (comp);
- e_select_names_completion_start_query (comp, query_text);
- g_free (query_text);
- }
-}
-
-void
-e_select_names_completion_clear_books (ESelectNamesCompletion *comp)
-{
- e_select_names_completion_stop_query (comp);
- e_select_names_completion_clear_book_data (comp);
-}
-
-void
-e_select_names_completion_set_minimum_query_length (ESelectNamesCompletion *comp, int query_length)
-{
- g_return_if_fail (E_IS_SELECT_NAMES_COMPLETION (comp));
- comp->priv->minimum_query_length = query_length;
-}
-
-gboolean
-e_select_names_completion_get_match_contact_lists (ESelectNamesCompletion *comp)
-{
- g_return_val_if_fail (E_IS_SELECT_NAMES_COMPLETION (comp), FALSE);
- return comp->priv->match_contact_lists;
-}
-
-
-void
-e_select_names_completion_set_match_contact_lists (ESelectNamesCompletion *comp, gboolean x)
-{
- g_return_if_fail (E_IS_SELECT_NAMES_COMPLETION (comp));
- comp->priv->match_contact_lists = x;
-}
-
diff --git a/addressbook/gui/component/select-names/e-select-names-completion.h b/addressbook/gui/component/select-names/e-select-names-completion.h
deleted file mode 100644
index 4ad1f4fd52..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-completion.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * e-select-names-completion.h
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Developed by Jon Trowbridge <trow@ximian.com>
- */
-
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA.
- */
-
-#ifndef E_SELECT_NAMES_COMPLETION_H
-#define E_SELECT_NAMES_COMPLETION_H
-
-#include <gal/e-text/e-completion.h>
-#include <libebook/e-book-async.h>
-#include "e-select-names-text-model.h"
-
-G_BEGIN_DECLS
-
-#define E_TYPE_SELECT_NAMES_COMPLETION (e_select_names_completion_get_type ())
-#define E_SELECT_NAMES_COMPLETION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_SELECT_NAMES_COMPLETION, ESelectNamesCompletion))
-#define E_SELECT_NAMES_COMPLETION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), E_TYPE_SELECT_NAMES_COMPLETION, ESelectNamesCompletionClass))
-#define E_IS_SELECT_NAMES_COMPLETION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_SELECT_NAMES_COMPLETION))
-#define E_IS_SELECT_NAMES_COMPLETION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_SELECT_NAMES_COMPLETION))
-
-typedef struct _ESelectNamesCompletion ESelectNamesCompletion;
-typedef struct _ESelectNamesCompletionClass ESelectNamesCompletionClass;
-struct _ESelectNamesCompletionPrivate;
-
-struct _ESelectNamesCompletion {
- ECompletion parent;
-
- struct _ESelectNamesCompletionPrivate *priv;
-};
-
-struct _ESelectNamesCompletionClass {
- ECompletionClass parent_class;
-
-};
-
-GType e_select_names_completion_get_type (void);
-
-ECompletion *e_select_names_completion_new (ESelectNamesTextModel *);
-void e_select_names_completion_add_book (ESelectNamesCompletion *, EBook *);
-void e_select_names_completion_clear_books (ESelectNamesCompletion *);
-void e_select_names_completion_set_minimum_query_length (ESelectNamesCompletion *, int);
-gboolean e_select_names_completion_get_match_contact_lists (ESelectNamesCompletion *);
-void e_select_names_completion_set_match_contact_lists (ESelectNamesCompletion *, gboolean);
-
-G_END_DECLS
-
-#endif /* E_SELECT_NAMES_COMPLETION_H */
diff --git a/addressbook/gui/component/select-names/e-select-names-config-keys.h b/addressbook/gui/component/select-names/e-select-names-config-keys.h
deleted file mode 100644
index e0f08c3019..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-config-keys.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors :
- * JP Rosevear <jpr@ximian.com>
- *
- * Copyright 2003, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifndef _E_SELECT_NAMES_CONFIG_KEYS_H_
-#define _E_SELECT_NAMES_CONFIG_KEYS_H_
-
-#include <glib.h>
-
-G_BEGIN_DECLS
-
-#define SELECT_NAMES_CONFIG_PREFIX "/apps/evolution/addressbook/completion"
-
-/* Display settings */
-#define SELECT_NAMES_CONFIG_COMPLETION_BOOKS SELECT_NAMES_CONFIG_PREFIX "/books"
-#define SELECT_NAMES_CONFIG_LAST_COMPLETION_BOOK SELECT_NAMES_CONFIG_PREFIX "/last_book"
-#define SELECT_NAMES_CONFIG_MIN_QUERY_LENGTH SELECT_NAMES_CONFIG_PREFIX "/minimum_query_length"
-
-G_END_DECLS
-
-#endif
diff --git a/addressbook/gui/component/select-names/e-select-names-config.c b/addressbook/gui/component/select-names/e-select-names-config.c
deleted file mode 100644
index 8335ed7c3b..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-config.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Authors :
- * Damon Chaplin <damon@ximian.com>
- * Rodrigo Moya <rodrigo@ximian.com>
- *
- * Copyright 2000, Ximian, Inc.
- * Copyright 2000, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-
-#include "e-select-names-config-keys.h"
-#include "e-select-names-config.h"
-
-static GConfClient *config = NULL;
-
-static void
-do_cleanup (void)
-{
- g_object_unref (config);
- config = NULL;
-}
-
-static void
-e_select_names_config_init (void)
-{
- if (config)
- return;
-
- config = gconf_client_get_default ();
- g_atexit ((GVoidFunc) do_cleanup);
-
- gconf_client_add_dir (config, SELECT_NAMES_CONFIG_PREFIX, GCONF_CLIENT_PRELOAD_RECURSIVE, NULL);
-}
-
-void
-e_select_names_config_remove_notification (guint id)
-{
- gconf_client_notify_remove (config, id);
-}
-
-char *
-e_select_names_config_get_last_completion_book (void)
-{
- e_select_names_config_init ();
-
- return gconf_client_get_string (config, SELECT_NAMES_CONFIG_LAST_COMPLETION_BOOK, NULL);
-}
-
-void
-e_select_names_config_set_last_completion_book (const char *last_completion_book)
-{
- e_select_names_config_init ();
-
- gconf_client_set_string (config, SELECT_NAMES_CONFIG_LAST_COMPLETION_BOOK, last_completion_book, NULL);
-}
-
-guint
-e_select_names_config_add_notification_last_completion_book (GConfClientNotifyFunc func, gpointer data)
-{
- guint id;
-
- e_select_names_config_init ();
-
- id = gconf_client_notify_add (config, SELECT_NAMES_CONFIG_LAST_COMPLETION_BOOK, func, data, NULL, NULL);
-
- return id;
-}
-
-gint
-e_select_names_config_get_min_query_length (void)
-{
- e_select_names_config_init ();
-
- return gconf_client_get_int (config, SELECT_NAMES_CONFIG_MIN_QUERY_LENGTH, NULL);
-}
-
-
-void
-e_select_names_config_set_min_query_length (gint day_end_hour)
-{
- e_select_names_config_init ();
-
- gconf_client_set_int (config, SELECT_NAMES_CONFIG_MIN_QUERY_LENGTH, day_end_hour, NULL);
-}
-
-guint
-e_select_names_config_add_notification_min_query_length (GConfClientNotifyFunc func, gpointer data)
-{
- guint id;
-
- e_select_names_config_init ();
-
- id = gconf_client_notify_add (config, SELECT_NAMES_CONFIG_MIN_QUERY_LENGTH, func, data, NULL, NULL);
-
- return id;
-}
diff --git a/addressbook/gui/component/select-names/e-select-names-config.h b/addressbook/gui/component/select-names/e-select-names-config.h
deleted file mode 100644
index 12d2c1314d..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-config.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors :
- * Damon Chaplin <damon@ximian.com>
- * Rodrigo Moya <rodrigo@ximian.com>
- *
- * Copyright 2000, Ximian, Inc.
- * Copyright 2000, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifndef _E_SELECT_NAMES_CONFIG_H_
-#define _E_SELECT_NAMES_CONFIG_H_
-
-#include <gconf/gconf-client.h>
-
-void e_select_names_config_remove_notification (guint id);
-
-/* The last completion book */
-char *e_select_names_config_get_last_completion_book (void);
-void e_select_names_config_set_last_completion_book (const char *last_completion_book);
-guint e_select_names_config_add_notification_last_completion_book (GConfClientNotifyFunc func, gpointer data);
-
-
-/* The minimum query length */
-gint e_select_names_config_get_min_query_length (void);
-void e_select_names_config_set_min_query_length (gint day_end_hour);
-guint e_select_names_config_add_notification_min_query_length (GConfClientNotifyFunc func, gpointer data);
-
-#endif /* _E_SELECT_NAMES_CONFIG_H_ */
diff --git a/addressbook/gui/component/select-names/e-select-names-factory.c b/addressbook/gui/component/select-names/e-select-names-factory.c
deleted file mode 100644
index 9e427513e0..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-factory.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* e-select-names-factory.c
- *
- * Copyright (C) 2000 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Ettore Perazzoli
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <bonobo/bonobo-generic-factory.h>
-
-#include "e-select-names-bonobo.h"
-#include "e-select-names-factory.h"
-
-
-#define COMPONENT_FACTORY_ID "OAFIID:GNOME_Evolution_Addressbook_SelectNamesFactory:" BASE_VERSION
-
-static BonoboGenericFactory *factory = NULL;
-
-
-static BonoboObject *
-factory_fn (BonoboGenericFactory *factory,
- const char *component_id,
- void *closure)
-{
- return BONOBO_OBJECT (e_select_names_bonobo_new ());
-}
-
-
-gboolean
-e_select_names_factory_init (void)
-{
- if (factory != NULL)
- return TRUE;
-
- factory = bonobo_generic_factory_new (COMPONENT_FACTORY_ID, factory_fn, NULL);
-
- if (factory == NULL)
- return FALSE;
-
- return TRUE;
-}
diff --git a/addressbook/gui/component/select-names/e-select-names-factory.h b/addressbook/gui/component/select-names/e-select-names-factory.h
deleted file mode 100644
index 0fe85c8361..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-factory.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* e-select-names-factory.h
- *
- * Copyright (C) 2000 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Ettore Perazzoli
- */
-
-#ifndef _E_SECELT_NAMES_FACTORY_H
-#define _E_SECELT_NAMES_FACTORY_H
-
-#include <glib.h>
-
-gboolean e_select_names_factory_init (void);
-
-#endif
diff --git a/addressbook/gui/component/select-names/e-select-names-manager.c b/addressbook/gui/component/select-names/e-select-names-manager.c
deleted file mode 100644
index 1b7cbbb38e..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-manager.c
+++ /dev/null
@@ -1,755 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- * Jon Trowbridge <trow@ximian.com.
- *
- * Copyright (C) 2000, 2001 Ximian, Inc.
- */
-
-#include <config.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <gal/e-text/e-entry.h>
-
-#include <libgnome/gnome-i18n.h>
-#include "e-select-names-config.h"
-#include "e-select-names-manager.h"
-#include "e-select-names-marshal.h"
-#include "e-select-names-model.h"
-#include "e-select-names-text-model.h"
-#include "e-select-names.h"
-#include "e-select-names-completion.h"
-#include "e-select-names-popup.h"
-#include <addressbook/util/eab-book-util.h>
-#include <addressbook/util/eab-destination.h>
-#include "addressbook/gui/component/addressbook.h"
-#include <bonobo/bonobo-object.h>
-
-#define DEFAULT_MINIMUM_QUERY_LENGTH 3
-
-enum {
- CHANGED,
- OK,
- CANCEL,
- LAST_SIGNAL
-};
-
-static guint e_select_names_manager_signals[LAST_SIGNAL] = { 0 };
-
-static GObjectClass *parent_class = NULL;
-
-typedef struct {
- char *id;
- char *title;
- ESelectNamesModel *model;
- ESelectNamesModel *original_model;
- ESelectNamesManager *manager;
- guint changed_tag;
-} ESelectNamesManagerSection;
-
-typedef struct {
- char *id;
- EEntry *entry;
- ESelectNamesManager *manager;
- ESelectNamesModel *model;
- ECompletion *comp;
- guint cleaning_tag;
-} ESelectNamesManagerEntry;
-
-static void e_select_names_manager_init (ESelectNamesManager *manager);
-static void e_select_names_manager_class_init (ESelectNamesManagerClass *klass);
-
-static void e_select_names_manager_dispose (GObject *object);
-
-/* ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** */
-
-/* ESelectNamesManagerSection routines */
-
-static void
-section_model_changed_cb (ESelectNamesModel *model, gpointer closure)
-{
- ESelectNamesManagerSection *section = closure;
- g_signal_emit (section->manager,
- e_select_names_manager_signals[CHANGED], 0,
- section->id,
- FALSE);
-}
-
-static ESelectNamesManagerSection *
-e_select_names_manager_section_new (ESelectNamesManager *manager,
- const gchar *id,
- const gchar *title,
- ESelectNamesModel *model)
-{
- ESelectNamesManagerSection *section;
-
- g_return_val_if_fail (E_IS_SELECT_NAMES_MANAGER (manager), NULL);
- g_return_val_if_fail (E_IS_SELECT_NAMES_MODEL (model), NULL);
-
- section = g_new0 (ESelectNamesManagerSection, 1);
-
- section->id = g_strdup (id);
- section->title = g_strdup (title);
-
- section->manager = manager;
-
- section->model = model;
- g_object_ref (section->model);
- section->changed_tag =
- g_signal_connect (section->model,
- "changed",
- G_CALLBACK (section_model_changed_cb),
- section);
-
- return section;
-}
-
-static void
-e_select_names_manager_section_free (ESelectNamesManagerSection *section)
-{
- if (section == NULL)
- return;
-
- g_free (section->id);
- g_free (section->title);
-
- if (section->model) {
- g_signal_handler_disconnect (section->model, section->changed_tag);
- g_object_unref (section->model);
- }
-
- if (section->original_model) {
- g_object_unref (section->original_model);
- }
-
- g_free (section);
-}
-
-/* ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** */
-
-/* ESelectNamesManagerEntry routines */
-
-static ESelectNamesManagerEntry *
-get_entry_info (EEntry *entry)
-{
- g_return_val_if_fail (E_IS_ENTRY (entry), NULL);
- return (ESelectNamesManagerEntry *) g_object_get_data (G_OBJECT (entry), "entry_info");
-}
-
-static void
-populate_popup_cb (EEntry *eentry, GdkEventButton *ev, gint pos, GtkWidget *menu, gpointer user_data)
-{
- ESelectNamesTextModel *text_model;
-
- g_object_get (eentry,
- "model", &text_model,
- NULL);
- g_assert (E_IS_SELECT_NAMES_TEXT_MODEL (text_model));
-
- e_select_names_populate_popup (menu, text_model, ev, pos, GTK_WIDGET (eentry));
-}
-
-#if 0
-static gboolean
-clean_cb (gpointer ptr)
-{
- ESelectNamesManagerEntry *entry = ptr;
-
- e_select_names_model_clean (entry->model, TRUE);
- entry->cleaning_tag = 0;
- return FALSE;
-}
-#endif
-
-static gint
-focus_in_cb (GtkWidget *w, GdkEventFocus *ev, gpointer user_data)
-{
- ESelectNamesManagerEntry *entry = user_data;
-
- if (entry->cleaning_tag) {
- g_source_remove (entry->cleaning_tag);
- entry->cleaning_tag = 0;
- }
-
- e_select_names_model_cancel_all_contact_load (entry->model);
-
- return FALSE;
-}
-
-static gint
-focus_out_cb (GtkWidget *w, GdkEventFocus *ev, gpointer user_data)
-{
-#if 0
- /* XXX fix me */
- ESelectNamesManagerEntry *entry = user_data;
- gboolean visible = e_entry_completion_popup_is_visible (entry->entry);
-
- if (! visible) {
- e_select_names_model_load_all_contacts (entry->model, entry->manager->completion_book, 100);
- if (entry->cleaning_tag == 0)
- entry->cleaning_tag = gtk_timeout_add (100, clean_cb, entry);
- }
-#endif
- return FALSE;
-}
-
-static void
-completion_popup_cb (EEntry *w, gint visible, gpointer user_data)
-{
-#if 0
- /* XXX fix me */
- ESelectNamesManagerEntry *entry = user_data;
-
- if (!visible && !GTK_WIDGET_HAS_FOCUS (GTK_WIDGET (entry->entry->canvas)))
- e_select_names_model_load_all_contacts (entry->model, entry->manager->completion_book, 0);
-#endif
-}
-
-static void
-completion_handler (EEntry *entry, ECompletionMatch *match)
-{
- ESelectNamesManagerEntry *mgr_entry;
- ESelectNamesTextModel *text_model;
- EABDestination *dest;
- gint i, pos, start_pos, len;
-
- if (match == NULL || match->user_data == NULL)
- return;
-
- mgr_entry = get_entry_info (entry);
- dest = EAB_DESTINATION (match->user_data);
-
- /* Sometimes I really long for garbage collection. Reference
- counting makes you feel 31337, but sometimes it is just a
- bitch. */
- g_object_ref (dest);
-
- g_object_get (entry,
- "model", &text_model,
- NULL);
- g_assert (E_IS_SELECT_NAMES_TEXT_MODEL (text_model));
-
- pos = e_entry_get_position (entry);
- e_select_names_model_text_pos (mgr_entry->model, text_model->seplen, pos, &i, NULL, NULL);
- e_select_names_model_replace (mgr_entry->model, i, dest);
- e_select_names_model_name_pos (mgr_entry->model, text_model->seplen, i, &start_pos, &len);
- e_entry_set_position (entry, start_pos+len);
-}
-
-static ESelectNamesManagerEntry *
-e_select_names_manager_entry_new (ESelectNamesManager *manager, ESelectNamesModel *model, const gchar *id)
-{
- ESelectNamesManagerEntry *entry;
- ETextModel *text_model;
- GList *l;
-
- g_return_val_if_fail (E_IS_SELECT_NAMES_MANAGER (manager), NULL);
- g_return_val_if_fail (E_IS_SELECT_NAMES_MODEL (model), NULL);
-
- entry = g_new0 (ESelectNamesManagerEntry, 1);
-
- entry->id = g_strdup (id);
-
- entry->entry = E_ENTRY (e_entry_new ());
- text_model = e_select_names_text_model_new (model);
- g_object_set(entry->entry,
- "model", text_model, /* The entry takes ownership of the text model */
- "editable", TRUE,
- "use_ellipsis", TRUE,
- "allow_newlines", FALSE,
- NULL);
-
- g_object_ref (entry->entry);
-
- entry->comp = e_select_names_completion_new (E_SELECT_NAMES_TEXT_MODEL (text_model));
-
- for (l = manager->completion_books; l; l = l->next) {
- EBook *book = l->data;
- e_select_names_completion_add_book (E_SELECT_NAMES_COMPLETION(entry->comp), book);
- }
-
- e_select_names_completion_set_minimum_query_length (E_SELECT_NAMES_COMPLETION(entry->comp),
- manager->minimum_query_length);
-
- e_entry_enable_completion_full (entry->entry, entry->comp, 100, completion_handler);
-
- entry->manager = manager;
-
- entry->model = model;
- g_object_ref (model);
-
- g_signal_connect (entry->entry,
- "populate_popup",
- G_CALLBACK (populate_popup_cb),
- entry);
-
- g_signal_connect (entry->entry->canvas,
- "focus_in_event",
- G_CALLBACK (focus_in_cb),
- entry);
-
- g_signal_connect (entry->entry->canvas,
- "focus_out_event",
- G_CALLBACK (focus_out_cb),
- entry);
-
- g_signal_connect (entry->entry,
- "completion_popup",
- G_CALLBACK (completion_popup_cb),
- entry);
-
- g_object_set_data (G_OBJECT (entry->entry), "entry_info", entry);
- g_object_set_data (G_OBJECT (entry->entry), "select_names_model", model);
- g_object_set_data (G_OBJECT (entry->entry), "select_names_text_model", text_model);
- g_object_set_data (G_OBJECT (entry->entry), "completion_handler", entry->comp);
-
- return entry;
-}
-
-static void
-e_select_names_manager_entry_free (ESelectNamesManagerEntry *entry)
-{
- if (entry == NULL)
- return;
-
- g_free (entry->id);
- g_object_unref (entry->model);
- g_object_unref (entry->entry);
-
- if (entry->cleaning_tag)
- g_source_remove (entry->cleaning_tag);
-
- g_free (entry);
-}
-
-/* ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** */
-
-static void
-e_select_names_manager_save_models (ESelectNamesManager *manager)
-{
- GList *iter;
-
- for (iter = manager->sections; iter != NULL; iter = g_list_next (iter)) {
- ESelectNamesManagerSection *section = iter->data;
-
- if (section->original_model == NULL && section->model != NULL)
- section->original_model = e_select_names_model_duplicate (section->model);
-
- }
-}
-
-static void
-e_select_names_manager_revert_to_saved_models (ESelectNamesManager *manager)
-{
- GList *iter;
-
- for (iter = manager->sections; iter != NULL; iter = g_list_next (iter)) {
- ESelectNamesManagerSection *section = iter->data;
- if (section->model && section->original_model) {
- e_select_names_model_overwrite_copy (section->model, section->original_model);
- g_object_unref (section->original_model);
- section->original_model = NULL;
- }
- }
-}
-
-static void
-e_select_names_manager_discard_saved_models (ESelectNamesManager *manager)
-{
- GList *iter;
-
- for (iter = manager->sections; iter != NULL; iter = g_list_next (iter)) {
- ESelectNamesManagerSection *section = iter->data;
- if (section->original_model) {
- g_object_unref (section->original_model);
- section->original_model = NULL;
- }
- }
-}
-
-/* ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** */
-
-static void
-open_book_cb (EBook *book, EBookStatus status, gpointer user_data)
-{
- ESelectNamesManager *manager = E_SELECT_NAMES_MANAGER (user_data);
-
- if (status == E_BOOK_ERROR_OK) {
- GList *l;
- for (l = manager->entries; l; l = l->next) {
- ESelectNamesManagerEntry *entry = l->data;
- e_select_names_completion_add_book (E_SELECT_NAMES_COMPLETION(entry->comp), book);
- }
-
- manager->completion_books = g_list_append (manager->completion_books, book);
- g_object_ref (book);
- }
-
- g_object_unref (manager); /* unref ourself (matches ref before the load_source call below) */
-}
-
-static void
-update_completion_books (ESelectNamesManager *manager)
-{
- GSList *groups;
-
- /* Add all the completion books */
- for (groups = e_source_list_peek_groups (manager->source_list); groups; groups = groups->next) {
- ESourceGroup *group = E_SOURCE_GROUP (groups->data);
- GSList *sources;
-
- for (sources = e_source_group_peek_sources (group); sources; sources = sources->next) {
- ESource *source = E_SOURCE (sources->data);
- const char *completion = e_source_get_property (source, "completion");
- if (completion && !g_ascii_strcasecmp (completion, "true")) {
- EBook *book = e_book_new ();
- g_object_ref (manager);
- addressbook_load_source (book, source, open_book_cb, manager);
- }
- }
- }
-}
-
-static void
-source_list_changed (ESourceList *source_list, ESelectNamesManager *manager)
-{
- GList *l;
-
- for (l = manager->entries; l; l = l->next) {
- ESelectNamesManagerEntry *entry = l->data;
- e_select_names_completion_clear_books (E_SELECT_NAMES_COMPLETION (entry->comp));
- }
-
- g_list_foreach (manager->completion_books, (GFunc)g_object_unref, NULL);
- g_list_free (manager->completion_books);
- manager->completion_books = NULL;
-
- update_completion_books (manager);
-}
-
-static void
-config_min_query_length_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
-{
- ESelectNamesManager *manager = data;
- GList *l;
-
- manager->minimum_query_length = e_select_names_config_get_min_query_length ();
- if (manager->minimum_query_length <= 0)
- manager->minimum_query_length = DEFAULT_MINIMUM_QUERY_LENGTH;
-
- for (l = manager->entries; l; l = l->next) {
- ESelectNamesManagerEntry *entry = l->data;
- e_select_names_completion_set_minimum_query_length (E_SELECT_NAMES_COMPLETION(entry->comp),
- manager->minimum_query_length);
- }
-}
-
-/**
- * e_select_names_manager_new:
- *
- * Returns: a new #ESelectNamesManager
- */
-ESelectNamesManager *
-e_select_names_manager_new (void)
-{
- ESelectNamesManager *manager = g_object_new (E_TYPE_SELECT_NAMES_MANAGER, NULL);
-
- return manager;
-}
-
-
-/*
- * ESelectNamesManager lifecycle management and vcard loading/saving.
- */
-
-
-void
-e_select_names_manager_add_section (ESelectNamesManager *manager,
- const char *id,
- const char *title)
-{
- g_return_if_fail (E_IS_SELECT_NAMES_MANAGER (manager));
- g_return_if_fail (id != NULL);
- g_return_if_fail (title != NULL);
-
- e_select_names_manager_add_section_with_limit (manager, id, title, -1);
-}
-
-void
-e_select_names_manager_add_section_with_limit (ESelectNamesManager *manager,
- const char *id,
- const char *title,
- gint limit)
-{
- ESelectNamesManagerSection *section;
- ESelectNamesModel *model;
-
- g_return_if_fail (E_IS_SELECT_NAMES_MANAGER (manager));
- g_return_if_fail (id != NULL);
- g_return_if_fail (title != NULL);
-
- model = e_select_names_model_new ();
- e_select_names_model_set_limit (model, limit);
-
- section = e_select_names_manager_section_new (manager, id, title, model);
-
- manager->sections = g_list_append (manager->sections, section);
-
- g_object_unref (model);
-}
-
-ESelectNamesModel *
-e_select_names_manager_get_source (ESelectNamesManager *manager,
- const char *id)
-{
- GList *iter;
-
- g_return_val_if_fail (E_IS_SELECT_NAMES_MANAGER (manager), NULL);
- g_return_val_if_fail (id != NULL, NULL);
-
- for (iter = manager->sections; iter != NULL; iter = g_list_next (iter)) {
- ESelectNamesManagerSection *section = iter->data;
- if (!strcmp (section->id, id))
- return section->model;
- }
- return NULL;
-}
-
-GtkWidget *
-e_select_names_manager_create_entry (ESelectNamesManager *manager, const char *id)
-{
- GList *iter;
-
- g_return_val_if_fail (E_IS_SELECT_NAMES_MANAGER (manager), NULL);
- g_return_val_if_fail (id != NULL, NULL);
-
- for (iter = manager->sections; iter != NULL; iter = g_list_next (iter)) {
- ESelectNamesManagerSection *section = iter->data;
- if (!strcmp(section->id, id)) {
- ESelectNamesManagerEntry *entry;
-
- entry = e_select_names_manager_entry_new (manager, section->model, section->id);
- manager->entries = g_list_append (manager->entries, entry);
-
- return GTK_WIDGET(entry->entry);
- }
- }
-
- return NULL;
-}
-
-static void
-e_select_names_response(ESelectNames *dialog, gint response_id, ESelectNamesManager *manager)
-{
- gtk_widget_destroy (GTK_WIDGET (dialog));
-
- switch(response_id) {
- case GTK_RESPONSE_OK:
- e_select_names_manager_discard_saved_models (manager);
- g_signal_emit (manager, e_select_names_manager_signals[OK], 0);
- break;
-
- case GTK_RESPONSE_CANCEL:
- e_select_names_manager_revert_to_saved_models (manager);
- g_signal_emit (manager, e_select_names_manager_signals[CANCEL], 0);
- break;
- }
-}
-
-static void
-clear_widget (gpointer data, GObject *where_object_was)
-{
- GtkWidget **widget_ref = data;
- *widget_ref = NULL;
-}
-
-void
-e_select_names_manager_activate_dialog (ESelectNamesManager *manager,
- const char *id)
-{
- g_return_if_fail (E_IS_SELECT_NAMES_MANAGER (manager));
- g_return_if_fail (id != NULL);
-
- if (manager->names) {
-
- g_assert (GTK_WIDGET_REALIZED (GTK_WIDGET (manager->names)));
- e_select_names_set_default (manager->names, id);
- gdk_window_show (GTK_WIDGET (manager->names)->window);
- gdk_window_raise (GTK_WIDGET (manager->names)->window);
-
- } else {
-
- GList *iter;
-
- manager->names = E_SELECT_NAMES (e_select_names_new ());
-
- for (iter = manager->sections; iter != NULL; iter = g_list_next (iter)) {
- ESelectNamesManagerSection *section = iter->data;
- e_select_names_add_section (manager->names, section->id, section->title, section->model);
- }
-
- e_select_names_set_default (manager->names, id);
-
- g_signal_connect(manager->names,
- "response",
- G_CALLBACK(e_select_names_response),
- manager);
-
- g_object_weak_ref (G_OBJECT (manager->names), clear_widget, &manager->names);
-
- gtk_widget_show(GTK_WIDGET(manager->names));
- }
-
- e_select_names_manager_save_models (manager);
-}
-
-/* ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** */
-
-static void
-e_select_names_manager_init (ESelectNamesManager *manager)
-{
- guint not;
-
- manager->sections = NULL;
- manager->entries = NULL;
-
- manager->source_list = e_source_list_new_for_gconf_default ("/apps/evolution/addressbook/sources");
- g_signal_connect (manager->source_list, "changed", G_CALLBACK (source_list_changed), manager);
-
- manager->completion_books = NULL;
-
- manager->minimum_query_length = e_select_names_config_get_min_query_length ();
-
- update_completion_books (manager);
-
- not = e_select_names_config_add_notification_min_query_length (config_min_query_length_changed_cb, manager);
- manager->notifications = g_list_append (manager->notifications, GUINT_TO_POINTER (not));
-}
-
-static void
-e_select_names_manager_dispose (GObject *object)
-{
- ESelectNamesManager *manager;
-
- manager = E_SELECT_NAMES_MANAGER (object);
-
- if (manager->names) {
- gtk_widget_destroy (GTK_WIDGET (manager->names));
- manager->names = NULL;
- }
-
- if (manager->sections) {
- g_list_foreach (manager->sections, (GFunc) e_select_names_manager_section_free, NULL);
- g_list_free (manager->sections);
- manager->sections = NULL;
- }
-
- if (manager->entries) {
- g_list_foreach (manager->entries, (GFunc) e_select_names_manager_entry_free, NULL);
- g_list_free (manager->entries);
- manager->entries = NULL;
- }
-
- if (manager->source_list) {
- g_object_unref (manager->source_list);
- manager->source_list = NULL;
- }
-
- if (manager->completion_books) {
- g_list_foreach (manager->completion_books, (GFunc) g_object_unref, NULL);
- g_list_free (manager->completion_books);
- manager->completion_books = NULL;
- }
-
- if (manager->notifications) {
- GList *l;
-
- for (l = manager->notifications; l; l = l->next)
- e_select_names_config_remove_notification (GPOINTER_TO_UINT (l->data));
- g_list_free (manager->notifications);
- manager->notifications = NULL;
- }
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-static void
-e_select_names_manager_class_init (ESelectNamesManagerClass *klass)
-{
- GObjectClass *object_class;
-
- object_class = G_OBJECT_CLASS(klass);
- parent_class = g_type_class_peek_parent (klass);
-
- object_class->dispose = e_select_names_manager_dispose;
-
- e_select_names_manager_signals[CHANGED] =
- g_signal_new ("changed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ESelectNamesManagerClass, changed),
- NULL, NULL,
- e_select_names_marshal_NONE__POINTER_INT,
- G_TYPE_NONE, 2,
- G_TYPE_POINTER,
- G_TYPE_INT);
-
- e_select_names_manager_signals[OK] =
- g_signal_new ("ok",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ESelectNamesManagerClass, ok),
- NULL, NULL,
- e_select_names_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-
- e_select_names_manager_signals[CANCEL] =
- g_signal_new ("cancel",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ESelectNamesManagerClass, cancel),
- NULL, NULL,
- e_select_names_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-}
-
-/**
- * e_select_names_manager_get_type:
- * @void:
- *
- * Registers the &ESelectNamesManager class if necessary, and returns the type ID
- * associated to it.
- *
- * Return value: The type ID of the &ESelectNamesManager class.
- **/
-GType
-e_select_names_manager_get_type (void)
-{
- static GType manager_type = 0;
-
- if (!manager_type) {
- static const GTypeInfo manager_info = {
- sizeof (ESelectNamesManagerClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_select_names_manager_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (ESelectNamesManager),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_select_names_manager_init,
- };
-
- manager_type = g_type_register_static (G_TYPE_OBJECT, "ESelectNamesManager", &manager_info, 0);
- }
-
- return manager_type;
-}
-
-
-
diff --git a/addressbook/gui/component/select-names/e-select-names-manager.h b/addressbook/gui/component/select-names/e-select-names-manager.h
deleted file mode 100644
index 0830d299d5..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-manager.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * Copyright (C) 2000 Ximian, Inc.
- */
-
-#ifndef __E_SELECT_NAMES_MANAGER_H__
-#define __E_SELECT_NAMES_MANAGER_H__
-
-#include <stdio.h>
-#include <time.h>
-#include <gtk/gtkobject.h>
-#include <e-util/e-list.h>
-#include "e-select-names.h"
-
-#define E_TYPE_SELECT_NAMES_MANAGER (e_select_names_manager_get_type ())
-#define E_SELECT_NAMES_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_SELECT_NAMES_MANAGER, ESelectNamesManager))
-#define E_SELECT_NAMES_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_SELECT_NAMES_MANAGER, ESelectNamesManagerClass))
-#define E_IS_SELECT_NAMES_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_SELECT_NAMES_MANAGER))
-#define E_IS_SELECT_NAMES_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_SELECT_NAMES_MANAGER))
-
-typedef struct _ESelectNamesManager ESelectNamesManager;
-typedef struct _ESelectNamesManagerClass ESelectNamesManagerClass;
-
-struct _ESelectNamesManager {
- GObject object;
-
- GList *sections;
- GList *entries;
-
- ESelectNames *names;
-
- ESourceList *source_list;
- GList *completion_books;
-
- int minimum_query_length;
-
- GList *notifications;
-};
-
-struct _ESelectNamesManagerClass {
- GObjectClass parent_class;
-
- void (*changed) (ESelectNamesManager *, const gchar *section_id, gint changed_working_copy);
- void (*ok) (ESelectNamesManager *);
- void (*cancel) (ESelectNamesManager *);
-};
-
-ESelectNamesManager *e_select_names_manager_new (void);
-void e_select_names_manager_add_section (ESelectNamesManager *manager,
- const char *id,
- const char *title);
-void e_select_names_manager_add_section_with_limit (ESelectNamesManager *manager,
- const char *id,
- const char *title,
- gint limit);
-ESelectNamesModel *e_select_names_manager_get_source (ESelectNamesManager *manager,
- const char *id);
-GtkWidget *e_select_names_manager_create_entry (ESelectNamesManager *manager,
- const char *id);
-void e_select_names_manager_activate_dialog (ESelectNamesManager *manager,
- const char *id);
-/* Standard Gtk function */
-GType e_select_names_manager_get_type (void);
-
-#endif /* ! __E_SELECT_NAMES_MANAGER_H__ */
diff --git a/addressbook/gui/component/select-names/e-select-names-marshal.list b/addressbook/gui/component/select-names/e-select-names-marshal.list
deleted file mode 100644
index 8e751dc27d..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-marshal.list
+++ /dev/null
@@ -1,3 +0,0 @@
-NONE:POINTER,INT
-NONE:NONE
-NONE:INT,INT,INT
diff --git a/addressbook/gui/component/select-names/e-select-names-model.c b/addressbook/gui/component/select-names/e-select-names-model.c
deleted file mode 100644
index 74bda7a74b..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-model.c
+++ /dev/null
@@ -1,769 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- * Jon Trowbidge <trow@ximian.com>
- *
- * Copyright (C) 2000, 2001 Ximian, Inc.
- */
-
-#include <config.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <gtk/gtkmarshal.h>
-#include <gtk/gtksignal.h>
-
-#include <gal/util/e-util.h>
-#include <libebook/e-contact.h>
-#include "e-select-names-model.h"
-#include "e-select-names-marshal.h"
-
-#define MAX_LENGTH 2047
-
-
-enum {
- E_SELECT_NAMES_MODEL_CHANGED,
- E_SELECT_NAMES_MODEL_RESIZED,
- E_SELECT_NAMES_MODEL_LAST_SIGNAL
-};
-
-static guint e_select_names_model_signals[E_SELECT_NAMES_MODEL_LAST_SIGNAL] = { 0 };
-
-/* Object argument IDs */
-enum {
- ARG_0,
- ARG_CONTACT,
-};
-
-struct _ESelectNamesModelPrivate {
- gchar *id;
- gchar *title;
-
- GList *data; /* of EABDestination */
-
- gint limit;
-
- gint freeze_count;
- gboolean pending_changed;
-};
-
-static GObjectClass *parent_class = NULL;
-
-static void e_select_names_model_init (ESelectNamesModel *model);
-static void e_select_names_model_class_init (ESelectNamesModelClass *klass);
-
-static void e_select_names_model_dispose (GObject *object);
-
-GType
-e_select_names_model_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (ESelectNamesModelClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_select_names_model_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (ESelectNamesModel),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_select_names_model_init,
- };
-
- type = g_type_register_static (G_TYPE_OBJECT, "ESelectNamesModel", &info, 0);
- }
-
- return type;
-}
-
-static void
-e_select_names_model_class_init (ESelectNamesModelClass *klass)
-{
- GObjectClass *object_class;
-
- object_class = G_OBJECT_CLASS(klass);
- parent_class = g_type_class_peek_parent (klass);
-
- e_select_names_model_signals[E_SELECT_NAMES_MODEL_CHANGED] =
- g_signal_new ("changed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ESelectNamesModelClass, changed),
- NULL, NULL,
- e_select_names_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-
- e_select_names_model_signals[E_SELECT_NAMES_MODEL_RESIZED] =
- g_signal_new ("resized",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ESelectNamesModelClass, resized),
- NULL, NULL,
- e_select_names_marshal_NONE__INT_INT_INT,
- G_TYPE_NONE, 3,
- G_TYPE_INT,
- G_TYPE_INT,
- G_TYPE_INT);
-
- klass->changed = NULL;
-
- object_class->dispose = e_select_names_model_dispose;
-}
-
-/**
- * e_select_names_model_init:
- */
-static void
-e_select_names_model_init (ESelectNamesModel *model)
-{
- model->priv = g_new0 (struct _ESelectNamesModelPrivate, 1);
-
- model->priv->limit = -1;
-}
-
-static void
-e_select_names_model_dispose (GObject *object)
-{
- ESelectNamesModel *model = E_SELECT_NAMES_MODEL (object);
-
- if (model->priv) {
- g_free (model->priv->title);
- g_free (model->priv->id);
-
- g_list_foreach (model->priv->data, (GFunc) g_object_unref, NULL);
- g_list_free (model->priv->data);
-
- g_free (model->priv);
- model->priv = NULL;
- }
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-
-static void
-e_select_names_model_changed (ESelectNamesModel *model)
-{
- if (model->priv->freeze_count > 0) {
- model->priv->pending_changed = TRUE;
- } else {
- g_signal_emit (model, e_select_names_model_signals[E_SELECT_NAMES_MODEL_CHANGED], 0);
- model->priv->pending_changed = FALSE;
- }
-}
-
-static void
-destination_changed_proxy (EABDestination *dest, gpointer closure)
-{
- e_select_names_model_changed (E_SELECT_NAMES_MODEL (closure));
-}
-
-/** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **/
-
-ESelectNamesModel *
-e_select_names_model_new (void)
-{
- ESelectNamesModel *model;
- model = g_object_new (E_TYPE_SELECT_NAMES_MODEL, NULL);
- return model;
-}
-
-ESelectNamesModel *
-e_select_names_model_duplicate (ESelectNamesModel *old)
-{
- ESelectNamesModel *model = e_select_names_model_new ();
- GList *iter;
-
- model->priv->id = g_strdup (old->priv->id);
- model->priv->title = g_strdup (old->priv->title);
-
- for (iter = old->priv->data; iter != NULL; iter = g_list_next (iter)) {
- EABDestination *dup = eab_destination_copy (EAB_DESTINATION (iter->data));
- e_select_names_model_append (model, dup);
- }
-
- model->priv->limit = old->priv->limit;
-
- return model;
-}
-
-gchar *
-e_select_names_model_get_textification (ESelectNamesModel *model, const char *separator)
-{
- gchar *text;
-
- g_return_val_if_fail (model != NULL, NULL);
- g_return_val_if_fail (E_IS_SELECT_NAMES_MODEL (model), NULL);
- g_return_val_if_fail (separator && *separator, NULL);
-
- if (model->priv->data == NULL) {
-
- text = g_strdup ("");
-
- } else {
- gchar **strv = g_new0 (gchar *, g_list_length (model->priv->data)+1);
- gint i = 0;
- GList *iter = model->priv->data;
-
- while (iter) {
- EABDestination *dest = EAB_DESTINATION (iter->data);
- strv[i] = (gchar *) eab_destination_get_textrep (dest, FALSE);
- ++i;
- iter = g_list_next (iter);
- }
-
- text = g_strjoinv (separator, strv);
-
- if (g_utf8_strlen(text, -1) > MAX_LENGTH) {
- char *p = g_utf8_offset_to_pointer (text, MAX_LENGTH);
- *p = '\0';
- text = g_realloc (text, p - text + 1);
- }
-
- g_free (strv);
-
- }
-
- return text;
-}
-
-gchar *
-e_select_names_model_get_address_text (ESelectNamesModel *model, const char *separator)
-{
- gchar *addr_text;
-
- g_return_val_if_fail (model != NULL, NULL);
- g_return_val_if_fail (E_IS_SELECT_NAMES_MODEL (model), NULL);
- g_return_val_if_fail (separator && *separator, NULL);
-
- if (model->priv->data == NULL) {
-
- addr_text = g_strdup ("");
-
- } else {
- gchar **strv = g_new0 (gchar *, g_list_length (model->priv->data)+1);
- gint i = 0;
- GList *iter = model->priv->data;
-
- while (iter) {
- EABDestination *dest = EAB_DESTINATION (iter->data);
- strv[i] = (gchar *) eab_destination_get_address (dest);
- if (strv[i])
- ++i;
- iter = g_list_next (iter);
- }
-
- addr_text = g_strjoinv (separator, strv);
-
- g_free (strv);
-
- }
-
- return addr_text;
-}
-
-gint
-e_select_names_model_count (ESelectNamesModel *model)
-{
- g_return_val_if_fail (model != NULL, 0);
- g_return_val_if_fail (E_IS_SELECT_NAMES_MODEL (model), 0);
-
- return g_list_length (model->priv->data);
-}
-
-gint
-e_select_names_model_get_limit (ESelectNamesModel *model)
-{
- g_return_val_if_fail (model != NULL, 0);
- g_return_val_if_fail (E_IS_SELECT_NAMES_MODEL (model), 0);
-
- return model->priv->limit;
-}
-
-void
-e_select_names_model_set_limit (ESelectNamesModel *model, gint limit)
-{
- g_return_if_fail (model != NULL);
- g_return_if_fail (E_IS_SELECT_NAMES_MODEL (model));
-
- model->priv->limit = MAX (limit, -1);
-}
-
-gboolean
-e_select_names_model_at_limit (ESelectNamesModel *model)
-{
- g_return_val_if_fail (model != NULL, TRUE);
- g_return_val_if_fail (E_IS_SELECT_NAMES_MODEL (model), TRUE);
-
- return model->priv->limit >= 0 && g_list_length (model->priv->data) >= model->priv->limit;
-}
-
-const EABDestination *
-e_select_names_model_get_destination (ESelectNamesModel *model, gint index)
-{
- g_return_val_if_fail (model && E_IS_SELECT_NAMES_MODEL (model), NULL);
- g_return_val_if_fail (0 <= index, NULL);
- g_return_val_if_fail (index < g_list_length (model->priv->data), NULL);
-
- return EAB_DESTINATION (g_list_nth_data (model->priv->data, index));
-}
-
-gchar *
-e_select_names_model_export_destinationv (ESelectNamesModel *model)
-{
- EABDestination **destv;
- gchar *str;
- gint i, len = 0;
- GList *j;
- g_return_val_if_fail (model && E_IS_SELECT_NAMES_MODEL (model), NULL);
-
- len = g_list_length (model->priv->data);
- destv = g_new0 (EABDestination *, len+1);
-
- for (i=0, j = model->priv->data; j != NULL; j = g_list_next (j)) {
- EABDestination *dest = EAB_DESTINATION (j->data);
-
- if (dest)
- destv[i++] = dest;
- }
-
- str = eab_destination_exportv (destv);
- g_free (destv);
-
- return str;
-}
-
-static void send_changed (EABDestination *dest, EContact *contact, gpointer closure)
-{
- ESelectNamesModel *model = closure;
- e_select_names_model_changed (model);
-}
-
-void
-e_select_names_model_import_destinationv (ESelectNamesModel *model,
- gchar *destinationv)
-{
- EABDestination **destv;
- gint i;
-
- g_return_if_fail (model && E_IS_SELECT_NAMES_MODEL (model));
-
- destv = eab_destination_importv (destinationv);
-
- e_select_names_model_delete_all (model);
-
- if (destv == NULL)
- return;
-
- for (i = 0; destv[i]; i++) {
- eab_destination_use_contact (destv[i], send_changed, model);
- e_select_names_model_append (model, destv[i]);
- }
- g_free (destv);
-}
-
-EContact *
-e_select_names_model_get_contact (ESelectNamesModel *model, gint index)
-{
- const EABDestination *dest;
-
- g_return_val_if_fail (model && E_IS_SELECT_NAMES_MODEL (model), NULL);
- g_return_val_if_fail (0 <= index, NULL);
- g_return_val_if_fail (index < g_list_length (model->priv->data), NULL);
-
- dest = e_select_names_model_get_destination (model, index);
- return dest ? eab_destination_get_contact (dest) : NULL;
-
-}
-
-const gchar *
-e_select_names_model_get_string (ESelectNamesModel *model, gint index)
-{
- const EABDestination *dest;
-
- g_return_val_if_fail (model && E_IS_SELECT_NAMES_MODEL (model), NULL);
- g_return_val_if_fail (0 <= index, NULL);
- g_return_val_if_fail (index < g_list_length (model->priv->data), NULL);
-
- dest = e_select_names_model_get_destination (model, index);
-
- return dest ? eab_destination_get_textrep (dest, FALSE) : "";
-}
-
-static void
-connect_destination (ESelectNamesModel *model, EABDestination *dest)
-{
- g_signal_connect (dest,
- "changed",
- G_CALLBACK (destination_changed_proxy),
- model);
-}
-
-static void
-disconnect_destination (ESelectNamesModel *model, EABDestination *dest)
-{
- g_signal_handlers_disconnect_by_func (dest, destination_changed_proxy, model);
-}
-
-gboolean
-e_select_names_model_contains (ESelectNamesModel *model, const EABDestination *dest)
-{
- GList *iter;
-
- g_return_val_if_fail (E_IS_SELECT_NAMES_MODEL (model), FALSE);
- g_return_val_if_fail (EAB_IS_DESTINATION (dest), FALSE);
-
- for (iter = model->priv->data; iter != NULL; iter = g_list_next (iter)) {
- if (iter->data != NULL && eab_destination_equal (dest, EAB_DESTINATION (iter->data)))
- return TRUE;
- }
-
- return FALSE;
-}
-
-void
-e_select_names_model_insert (ESelectNamesModel *model, gint index, EABDestination *dest)
-{
- g_return_if_fail (model != NULL);
- g_return_if_fail (E_IS_SELECT_NAMES_MODEL (model));
- g_return_if_fail (0 <= index && index <= g_list_length (model->priv->data));
- g_return_if_fail (dest && EAB_IS_DESTINATION (dest));
-
- if (e_select_names_model_at_limit (model)) {
- /* FIXME: This is bad. */
- g_object_unref (dest);
- return;
- }
-
- connect_destination (model, dest);
-
- model->priv->data = g_list_insert (model->priv->data, dest, index);
-
- g_object_ref (dest);
-
- e_select_names_model_changed (model);
-}
-
-void
-e_select_names_model_append (ESelectNamesModel *model, EABDestination *dest)
-{
- g_return_if_fail (model && E_IS_SELECT_NAMES_MODEL (model));
- g_return_if_fail (dest && EAB_IS_DESTINATION (dest));
-
- if (e_select_names_model_at_limit (model)) {
- /* FIXME: This is bad. */
- g_object_unref (dest);
- return;
- }
-
- connect_destination (model, dest);
-
- model->priv->data = g_list_append (model->priv->data, dest);
-
- g_object_ref (dest);
-
- e_select_names_model_changed (model);
-}
-
-void
-e_select_names_model_replace (ESelectNamesModel *model, gint index, EABDestination *dest)
-{
- GList *node;
- const gchar *new_str, *old_str;
- gint old_strlen=0, new_strlen=0;
-
- g_return_if_fail (model != NULL);
- g_return_if_fail (E_IS_SELECT_NAMES_MODEL (model));
- g_return_if_fail (model->priv->data == NULL || (0 <= index && index < g_list_length (model->priv->data)));
- g_return_if_fail (dest && EAB_IS_DESTINATION (dest));
-
- new_str = eab_destination_get_textrep (dest, FALSE);
- new_strlen = new_str ? strlen (new_str) : 0;
-
- if (model->priv->data == NULL) {
-
- connect_destination (model, dest);
-
- model->priv->data = g_list_append (model->priv->data, dest);
- g_object_ref (dest);
-
- } else {
-
- node = g_list_nth (model->priv->data, index);
-
- if (node->data != dest) {
-
- disconnect_destination (model, EAB_DESTINATION (node->data));
- connect_destination (model, dest);
-
- old_str = eab_destination_get_textrep (EAB_DESTINATION (node->data), FALSE);
- old_strlen = old_str ? strlen (old_str) : 0;
-
- g_object_unref (node->data);
-
- node->data = dest;
- g_object_ref (dest);
- }
- }
-
- e_select_names_model_changed (model);
-
- g_signal_emit (model, e_select_names_model_signals[E_SELECT_NAMES_MODEL_RESIZED], 0,
- index, old_strlen, new_strlen);
-}
-
-void
-e_select_names_model_delete (ESelectNamesModel *model, gint index)
-{
- GList *node;
- EABDestination *dest;
-
- g_return_if_fail (model != NULL);
- g_return_if_fail (E_IS_SELECT_NAMES_MODEL (model));
- g_return_if_fail (0 <= index && index < g_list_length (model->priv->data));
-
- node = g_list_nth (model->priv->data, index);
- dest = EAB_DESTINATION (node->data);
-
- disconnect_destination (model, dest);
- g_object_unref (dest);
-
- model->priv->data = g_list_remove_link (model->priv->data, node);
- g_list_free_1 (node);
-
- e_select_names_model_changed (model);
-}
-
-void
-e_select_names_model_clean (ESelectNamesModel *model, gboolean clean_last_entry)
-{
- GList *iter, *next;
- gboolean changed = FALSE;
-
- g_return_if_fail (model != NULL && E_IS_SELECT_NAMES_MODEL (model));
-
- iter = model->priv->data;
-
- while (iter) {
- EABDestination *dest;
-
- next = g_list_next (iter);
-
- if (next == NULL && !clean_last_entry)
- break;
-
- dest = iter->data ? EAB_DESTINATION (iter->data) : NULL;
-
- if (dest == NULL || eab_destination_is_empty (dest)) {
- if (dest) {
- disconnect_destination (model, dest);
- g_object_unref (dest);
- }
- model->priv->data = g_list_remove_link (model->priv->data, iter);
- g_list_free_1 (iter);
- changed = TRUE;
- }
-
- iter = next;
- }
-
- if (changed)
- e_select_names_model_changed (model);
-}
-
-static void
-delete_all_iter (gpointer data, gpointer closure)
-{
- disconnect_destination (E_SELECT_NAMES_MODEL (closure), EAB_DESTINATION (data));
- g_object_unref (data);
-}
-
-void
-e_select_names_model_delete_all (ESelectNamesModel *model)
-{
- g_return_if_fail (model != NULL && E_IS_SELECT_NAMES_MODEL (model));
-
- g_list_foreach (model->priv->data, delete_all_iter, model);
- g_list_free (model->priv->data);
- model->priv->data = NULL;
-
- e_select_names_model_changed (model);
-}
-
-void
-e_select_names_model_overwrite_copy (ESelectNamesModel *dest, ESelectNamesModel *src)
-{
- gint i, len;
-
- g_return_if_fail (dest && E_IS_SELECT_NAMES_MODEL (dest));
- g_return_if_fail (src && E_IS_SELECT_NAMES_MODEL (src));
-
- if (src == dest)
- return;
-
- e_select_names_model_delete_all (dest);
- len = e_select_names_model_count (src);
- for (i = 0; i < len; ++i) {
- const EABDestination *d = e_select_names_model_get_destination (src, i);
- if (d)
- e_select_names_model_append (dest, eab_destination_copy (d));
- }
-}
-
-void
-e_select_names_model_merge (ESelectNamesModel *dest, ESelectNamesModel *src)
-{
- gint i, len;
-
- g_return_if_fail (E_IS_SELECT_NAMES_MODEL (dest));
- g_return_if_fail (E_IS_SELECT_NAMES_MODEL (src));
-
- if (src == dest)
- return;
-
- len = e_select_names_model_count (src);
- for (i = 0; i < len; ++i) {
- const EABDestination *d = e_select_names_model_get_destination (src, i);
- if (d && !e_select_names_model_contains (dest, d))
- e_select_names_model_append (dest, eab_destination_copy (d));
- }
-}
-
-void
-e_select_names_model_name_pos (ESelectNamesModel *model, gint seplen, gint index, gint *pos, gint *length)
-{
- gint rp = 0, i, len = 0;
- GList *iter;
- const gchar *str;
-
- g_return_if_fail (E_IS_SELECT_NAMES_MODEL (model));
- g_return_if_fail (seplen > 0);
-
- i = 0;
- iter = model->priv->data;
- while (iter && i <= index) {
- rp += len + (i > 0 ? seplen : 0);
- str = eab_destination_get_textrep (EAB_DESTINATION (iter->data), FALSE);
- len = str ? g_utf8_strlen (str, -1) : 0;
- ++i;
- iter = g_list_next (iter);
- }
-
- if (i <= index) {
- rp = -1;
- len = 0;
- }
-
- if (pos)
- *pos = rp;
- if (length)
- *length = len;
-}
-
-void
-e_select_names_model_text_pos (ESelectNamesModel *model, gint seplen, gint pos, gint *index, gint *start_pos, gint *length)
-{
- GList *iter;
- const gchar *str;
- gint len = 0, i = 0, sp = 0, adj = 0;
-
- g_return_if_fail (E_IS_SELECT_NAMES_MODEL (model));
- g_return_if_fail (seplen > 0);
-
- iter = model->priv->data;
-
- while (iter != NULL) {
- str = eab_destination_get_textrep (EAB_DESTINATION (iter->data), FALSE);
- len = str ? g_utf8_strlen (str, -1) : 0;
-
- if (sp <= pos && pos <= sp + len + adj) {
- break;
- }
-
- sp += len + adj + 1;
- adj = seplen-1;
- ++i;
-
- iter = g_list_next (iter);
- }
-
- if (i != 0)
- sp += seplen-1; /* skip past "magic space" */
-
- if (iter == NULL) {
-#if 0
- g_print ("text_pos ended NULL\n");
-#endif
- i = -1;
- sp = -1;
- len = 0;
- } else {
-#if 0
- g_print ("text_pos got index %d\n", i);
-#endif
- }
-
- if (index)
- *index = i;
- if (start_pos)
- *start_pos = sp;
- if (length)
- *length = len;
-}
-
-void
-e_select_names_model_load_all_contacts (ESelectNamesModel *model, EBook *book)
-{
- GList *iter;
-
- g_return_if_fail (E_IS_SELECT_NAMES_MODEL (model));
- g_return_if_fail (book == NULL || E_IS_BOOK (book));
-
- for (iter = model->priv->data; iter != NULL; iter = g_list_next (iter)) {
- EABDestination *dest = EAB_DESTINATION (iter->data);
- if (!eab_destination_is_empty (dest)) {
-
- eab_destination_load_contact (dest, book);
- }
- }
-}
-
-void
-e_select_names_model_cancel_all_contact_load (ESelectNamesModel *model)
-{
- GList *iter;
-
- g_return_if_fail (E_IS_SELECT_NAMES_MODEL (model));
-
- for (iter = model->priv->data; iter != NULL; iter = g_list_next (iter)) {
- EABDestination *dest = EAB_DESTINATION (iter->data);
- if (!eab_destination_is_empty (dest)) {
-
- eab_destination_cancel_contact_load (dest);
- }
- }
-}
-
-void
-e_select_names_model_freeze (ESelectNamesModel *model)
-{
- g_return_if_fail (E_IS_SELECT_NAMES_MODEL (model));
-
- ++model->priv->freeze_count;
-}
-
-void
-e_select_names_model_thaw (ESelectNamesModel *model)
-{
- g_return_if_fail (E_IS_SELECT_NAMES_MODEL (model));
- g_return_if_fail (model->priv->freeze_count > 0);
-
- --model->priv->freeze_count;
- if (model->priv->pending_changed)
- e_select_names_model_changed (model);
-}
diff --git a/addressbook/gui/component/select-names/e-select-names-model.h b/addressbook/gui/component/select-names/e-select-names-model.h
deleted file mode 100644
index 0d21ee86b3..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-model.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- * Jon Trowbridge <trow@ximian.com>
- *
- * Copyright (C) 2000, 2001 Ximian, Inc.
- */
-
-#ifndef __E_SELECT_NAMES_MODEL_H__
-#define __E_SELECT_NAMES_MODEL_H__
-
-#include <time.h>
-#include <gtk/gtkobject.h>
-#include <stdio.h>
-#include <e-util/e-list.h>
-#include <libebook/e-contact.h>
-#include <addressbook/util/eab-destination.h>
-
-#define E_TYPE_SELECT_NAMES_MODEL (e_select_names_model_get_type ())
-#define E_SELECT_NAMES_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_SELECT_NAMES_MODEL, ESelectNamesModel))
-#define E_SELECT_NAMES_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_SELECT_NAMES_MODEL, ESelectNamesModelClass))
-#define E_IS_SELECT_NAMES_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_SELECT_NAMES_MODEL))
-#define E_IS_SELECT_NAMES_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_SELECT_NAMES_MODEL))
-
-typedef struct _ESelectNamesModel ESelectNamesModel;
-typedef struct _ESelectNamesModelClass ESelectNamesModelClass;
-struct _ESelectNamesModelPrivate;
-
-struct _ESelectNamesModel {
- GObject object;
-
- struct _ESelectNamesModelPrivate *priv;
-};
-
-struct _ESelectNamesModelClass {
- GObjectClass parent_class;
-
- void (*changed) (ESelectNamesModel *model);
- void (*resized) (ESelectNamesModel *model, gint index, gint old_len, gint new_len);
-};
-
-GType e_select_names_model_get_type (void);
-
-ESelectNamesModel *e_select_names_model_new (void);
-ESelectNamesModel *e_select_names_model_duplicate (ESelectNamesModel *old);
-
-gchar *e_select_names_model_get_textification (ESelectNamesModel *model, const char *separator);
-gchar *e_select_names_model_get_address_text (ESelectNamesModel *model, const char *separator);
-
-gint e_select_names_model_count (ESelectNamesModel *model);
-gint e_select_names_model_get_limit (ESelectNamesModel *model);
-void e_select_names_model_set_limit (ESelectNamesModel *model, gint limit);
-gboolean e_select_names_model_at_limit (ESelectNamesModel *model);
-
-const EABDestination *e_select_names_model_get_destination (ESelectNamesModel *model, gint index);
-gchar *e_select_names_model_export_destinationv (ESelectNamesModel *model);
-void e_select_names_model_import_destinationv (ESelectNamesModel *model,
- gchar *destinationv);
-EContact *e_select_names_model_get_contact (ESelectNamesModel *model, gint index);
-const gchar *e_select_names_model_get_string (ESelectNamesModel *model, gint index);
-
-gboolean e_select_names_model_contains (ESelectNamesModel *model, const EABDestination *dest);
-
-void e_select_names_model_insert (ESelectNamesModel *model, gint index, EABDestination *dest);
-void e_select_names_model_append (ESelectNamesModel *model, EABDestination *dest);
-void e_select_names_model_replace (ESelectNamesModel *model, gint index, EABDestination *dest);
-void e_select_names_model_delete (ESelectNamesModel *model, gint index);
-void e_select_names_model_delete_all (ESelectNamesModel *model);
-void e_select_names_model_overwrite_copy (ESelectNamesModel *dest, ESelectNamesModel *src);
-void e_select_names_model_merge (ESelectNamesModel *dest, ESelectNamesModel *src);
-
-void e_select_names_model_clean (ESelectNamesModel *model, gboolean clean_last_entry);
-
-void e_select_names_model_name_pos (ESelectNamesModel *model, gint seplen, gint index, gint *pos, gint *length);
-void e_select_names_model_text_pos (ESelectNamesModel *model, gint seplen, gint pos, gint *index, gint *start_pos, gint *length);
-
-void e_select_names_model_load_all_contacts (ESelectNamesModel *model, EBook *book);
-void e_select_names_model_cancel_all_contact_load (ESelectNamesModel *model);
-
-/* This is a mildly annoying freeze/thaw pair, in that it only applies to the 'changed'
- signal and not to 'resized'. This could cause unexpected results in some cases. */
-void e_select_names_model_freeze (ESelectNamesModel *model);
-void e_select_names_model_thaw (ESelectNamesModel *model);
-
-
-#endif /* ! __E_SELECT_NAMES_MODEL_H__ */
diff --git a/addressbook/gui/component/select-names/e-select-names-popup.c b/addressbook/gui/component/select-names/e-select-names-popup.c
deleted file mode 100644
index bb0f331516..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-popup.c
+++ /dev/null
@@ -1,399 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * e-select-names-popup.c
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Developed by Jon Trowbridge <trow@ximian.com>
- */
-
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA.
- */
-
-#include <config.h>
-
-#include <stdio.h>
-#include <string.h>
-
-#include <glib.h>
-#include <gtk/gtkimage.h>
-#include <gtk/gtkmenuitem.h>
-#include <gtk/gtkimagemenuitem.h>
-#include <gtk/gtkcheckmenuitem.h>
-#include <gtk/gtkradiomenuitem.h>
-#include <gtk/gtkseparatormenuitem.h>
-#include <gtk/gtklabel.h>
-#include <libgnome/gnome-i18n.h>
-
-#include <addressbook/util/eab-book-util.h>
-#include <addressbook/gui/contact-editor/e-contact-editor.h>
-#include <addressbook/gui/contact-list-editor/e-contact-list-editor.h>
-#include <addressbook/gui/contact-editor/e-contact-quick-add.h>
-#include "eab-gui-util.h"
-#include "e-select-names-popup.h"
-
-#define LIST_ICON_FILENAME "contact-list-16.png"
-#define CONTACT_ICON_FILENAME "evolution-contacts-mini.png"
-
-typedef struct _PopupInfo PopupInfo;
-struct _PopupInfo {
- ESelectNamesTextModel *text_model;
- EABDestination *dest;
- gint pos;
- gint index;
-};
-
-static PopupInfo *
-popup_info_new (ESelectNamesTextModel *text_model, EABDestination *dest, gint pos, gint index)
-{
- PopupInfo *info = g_new0 (PopupInfo, 1);
- info->text_model = text_model;
- info->dest = dest;
- info->pos = pos;
- info->index = index;
-
- if (text_model)
- g_object_ref (text_model);
-
- if (dest)
- g_object_ref (dest);
-
- return info;
-}
-
-static void
-popup_info_free (PopupInfo *info)
-{
- if (info) {
-
- if (info->text_model)
- g_object_unref (info->text_model);
-
- if (info->dest)
- g_object_unref (info->dest);
-
- g_free (info);
- }
-}
-
-static void
-popup_info_cleanup (GtkWidget *w, gpointer info)
-{
- popup_info_free ((PopupInfo *) info);
-}
-
-/* You are in a maze of twisty little callbacks, all alike... */
-
-#if TOO_MANY_MENU_ITEMS
-static void
-make_contact_editor_cb (EBook *book, gpointer user_data)
-{
- if (book) {
- EABDestination *dest = EAB_DESTINATION (user_data);
- EContact *contact;
-
- contact = (EContact *) eab_destination_get_contact (dest);
- if (e_contact_get (contact, E_CONTACT_IS_LIST)) {
- EContactListEditor *ce;
- ce = e_addressbook_show_contact_list_editor (book, contact, FALSE, TRUE);
- e_contact_list_editor_raise (ce);
- }
- else {
- EContactEditor *ce;
- ce = e_addressbook_show_contact_editor (book, contact, FALSE, TRUE);
- e_contact_editor_raise (ce);
- }
- g_object_unref (dest);
- }
-}
-
-static void
-edit_contact_info_cb (GtkWidget *w, gpointer user_data)
-{
- PopupInfo *info = (PopupInfo *) user_data;
- if (info == NULL)
- return;
-
- g_object_ref (info->dest);
- e_book_use_default_book (make_contact_editor_cb, (gpointer) info->dest);
-}
-#endif
-
-static void
-change_email_num_cb (GtkWidget *w, gpointer user_data)
-{
- PopupInfo *info = (PopupInfo *) user_data;
- gint n;
- EABDestination *dest;
-
- if (info == NULL)
- return;
-
- if (! GTK_CHECK_MENU_ITEM (w)->active)
- return;
-
- n = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (w), "number"));
-
- if (n != eab_destination_get_email_num (info->dest)) {
- dest = eab_destination_new ();
- eab_destination_set_contact (dest, eab_destination_get_contact (info->dest), n);
- e_select_names_model_replace (info->text_model->source, info->index, dest);
- }
-}
-
-#if TOO_MANY_MENU_ITEMS
-static void
-remove_recipient_cb (GtkWidget *w, gpointer user_data)
-{
- PopupInfo *info = (PopupInfo *) user_data;
- e_select_names_model_delete (info->text_model->source, info->index);
-}
-
-static void
-remove_all_recipients_cb (GtkWidget *w, gpointer user_data)
-{
- PopupInfo *info = (PopupInfo *) user_data;
- e_select_names_model_delete_all (info->text_model->source);
-}
-
-static void
-toggle_html_mail_cb (GtkWidget *w, gpointer user_data)
-{
- PopupInfo *info = (PopupInfo *) user_data;
- GtkCheckMenuItem *item = GTK_CHECK_MENU_ITEM (w);
- const EABDestination *dest;
-
- if (info == NULL)
- return;
-
- dest = info->dest;
-
- item = GTK_CHECK_MENU_ITEM (item);
- eab_destination_set_html_mail_pref ((EABDestination *) dest, item->active);
-}
-#endif
-
-static void
-populate_popup_contact (GtkWidget *pop, gboolean list, PopupInfo *info)
-{
- GtkWidget *image;
- EContact *contact;
- GtkWidget *menuitem;
- GList *email_list;
-
- contact = eab_destination_get_contact (info->dest);
-
-#if TOO_MANY_MENU_ITEMS
- menuitem = gtk_separator_menu_item_new();
- gtk_widget_show (menuitem);
- gtk_menu_shell_prepend (GTK_MENU_SHELL (pop), menuitem);
-
- menuitem = gtk_menu_item_new_with_label (_("Remove All"));
- g_signal_connect (menuitem, "activate",
- G_CALLBACK (remove_all_recipients_cb),
- info);
- gtk_widget_show (menuitem);
- gtk_menu_shell_prepend (GTK_MENU_SHELL (pop), menuitem);
-
- menuitem = gtk_menu_item_new_with_label (_("Remove"));
- g_signal_connect (menuitem, "activate",
- G_CALLBACK (remove_recipient_cb),
- info);
- gtk_widget_show (menuitem);
- gtk_menu_shell_prepend (GTK_MENU_SHELL (pop), menuitem);
-
- menuitem = gtk_menu_item_new_with_label (list ? _("View Contact List") : _("View Contact Info"));
- g_signal_connect (menuitem, "activate",
- G_CALLBACK (edit_contact_info_cb),
- info);
- gtk_widget_show (menuitem);
- gtk_menu_shell_prepend (GTK_MENU_SHELL (pop), menuitem);
-
- menuitem = gtk_check_menu_item_new_with_label (_("Send HTML Mail?"));
- gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menuitem),
- eab_destination_get_html_mail_pref (info->dest));
- g_signal_connect (menuitem, "toggled",
- G_CALLBACK (toggle_html_mail_cb),
- info);
- gtk_widget_show (menuitem);
- gtk_menu_shell_prepend (GTK_MENU_SHELL (pop), menuitem);
-#endif
-
- email_list = e_contact_get (contact, E_CONTACT_EMAIL);
-
- if (email_list) {
- menuitem = gtk_separator_menu_item_new();
- gtk_widget_show (menuitem);
- gtk_menu_shell_prepend (GTK_MENU_SHELL (pop), menuitem);
-
- if (g_list_length (email_list) > 1) {
- GList *l;
- GSList *radiogroup = NULL;
- gint n = eab_destination_get_email_num (info->dest);
- gint j = g_list_length (email_list) - 1;
-
- for (l = g_list_last (email_list); l; l = l->prev) {
- char *email = l->data;
- char *label = NULL;
-
- if (!strncmp (email, "<?xml", 5)) {
- EABDestination *dest = eab_destination_import (email);
- if (dest) {
- label = g_strdup (eab_destination_get_textrep (dest, TRUE));
- g_object_unref (dest);
- }
- }
- else {
- label = g_strdup (email);
- }
-
- if (list) {
- menuitem = gtk_menu_item_new_with_label (label);
- }
- else {
- menuitem = gtk_radio_menu_item_new_with_label (radiogroup, label);
- g_signal_connect (menuitem, "toggled",
- G_CALLBACK (change_email_num_cb),
- info);
- if (j == n)
- gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menuitem), TRUE);
-
- g_object_set_data (G_OBJECT (menuitem), "number", GINT_TO_POINTER (j));
- radiogroup = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menuitem));
- }
-
- gtk_widget_show (menuitem);
- gtk_menu_shell_prepend (GTK_MENU_SHELL (pop), menuitem);
-
- j--;
-
- g_free (label);
- }
- } else {
- menuitem = gtk_menu_item_new_with_label (eab_destination_get_email (info->dest));
- gtk_widget_show (menuitem);
- gtk_menu_shell_prepend (GTK_MENU_SHELL (pop), menuitem);
- }
-
- g_list_foreach (email_list, (GFunc)g_free, NULL);
- g_list_free (email_list);
- }
-
- menuitem = gtk_separator_menu_item_new ();
- gtk_widget_show (menuitem);
- gtk_menu_shell_prepend (GTK_MENU_SHELL (pop), menuitem);
-
- image = gtk_image_new_from_file (list
- ? EVOLUTION_IMAGESDIR "/" LIST_ICON_FILENAME
- : EVOLUTION_IMAGESDIR "/" CONTACT_ICON_FILENAME);
- gtk_widget_show (image);
- menuitem = gtk_image_menu_item_new_with_label (eab_destination_get_name (info->dest));
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem),
- image);
- gtk_widget_show (menuitem);
- gtk_menu_shell_prepend (GTK_MENU_SHELL (pop), menuitem);
-}
-
-static void
-quick_add_cb (GtkWidget *w, gpointer user_data)
-{
- PopupInfo *info = (PopupInfo *) user_data;
- e_contact_quick_add_free_form (eab_destination_get_address (info->dest), NULL, NULL);
-}
-
-static void
-populate_popup_nocontact (GtkWidget *pop, PopupInfo *info)
-{
- const gchar *str;
- GtkWidget *menuitem;
-
- menuitem = gtk_separator_menu_item_new ();
- gtk_widget_show (menuitem);
- gtk_menu_shell_prepend (GTK_MENU_SHELL (pop), menuitem);
-
- menuitem = gtk_menu_item_new_with_label (_("Add to Contacts"));
- gtk_widget_show (menuitem);
- gtk_menu_shell_prepend (GTK_MENU_SHELL (pop), menuitem);
- g_signal_connect (menuitem, "activate",
- G_CALLBACK (quick_add_cb),
- info);
-
-#if TOO_MANY_MENU_ITEMS
- menuitem = gtk_check_menu_item_new_with_label (_("Send HTML Mail?"));
- gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menuitem),
- eab_destination_get_html_mail_pref (info->dest));
- g_signal_connect (menuitem, "toggled",
- G_CALLBACK (toggle_html_mail_cb),
- info);
- gtk_widget_show (menuitem);
- gtk_menu_shell_prepend (GTK_MENU_SHELL (pop), menuitem);
-#endif
-
- menuitem = gtk_separator_menu_item_new ();
- gtk_widget_show (menuitem);
- gtk_menu_shell_prepend (GTK_MENU_SHELL (pop), menuitem);
-
- str = eab_destination_get_name (info->dest);
- if (! (str && *str))
- str = eab_destination_get_email (info->dest);
- if (! (str && *str))
- str = _("Unnamed Contact");
-
- menuitem = gtk_menu_item_new_with_label (str);
- gtk_widget_show (menuitem);
- gtk_menu_shell_prepend (GTK_MENU_SHELL (pop), menuitem);
-}
-
-void
-e_select_names_populate_popup (GtkWidget *menu, ESelectNamesTextModel *text_model,
- GdkEventButton *ev, gint pos, GtkWidget *for_widget)
-{
- ESelectNamesModel *model;
- PopupInfo *info;
- EABDestination *dest;
- gint index;
-
- g_return_if_fail (GTK_IS_MENU_SHELL (menu));
- g_return_if_fail (E_IS_SELECT_NAMES_TEXT_MODEL (text_model));
- g_return_if_fail (ev);
- g_return_if_fail (0 <= pos);
-
- model = text_model->source;
-
- e_select_names_model_text_pos (model, text_model->seplen, pos, &index, NULL, NULL);
- if (index < 0 || index >= e_select_names_model_count (model))
- return;
-
- /* XXX yuck, why does this return a const? */
- dest = (EABDestination *)e_select_names_model_get_destination (model, index);
- if (eab_destination_is_empty (dest))
- return;
-
- info = popup_info_new (text_model, dest, pos, index);
-
- if (eab_destination_get_contact (dest)) {
- populate_popup_contact (menu, eab_destination_is_evolution_list (dest), info);
- } else {
- populate_popup_nocontact (menu, info);
- }
-
- /* Clean up our info item after we've made our selection. */
- g_signal_connect (menu,
- "selection-done",
- G_CALLBACK (popup_info_cleanup),
- info);
-}
diff --git a/addressbook/gui/component/select-names/e-select-names-popup.h b/addressbook/gui/component/select-names/e-select-names-popup.h
deleted file mode 100644
index 531275190b..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-popup.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * e-select-names-popup.h
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Developed by Jon Trowbridge <trow@ximian.com>
- */
-
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA.
- */
-
-#ifndef __E_SELECT_NAMES_POPUP_H__
-#define __E_SELECT_NAMES_POPUP_H__
-
-#include "e-select-names-text-model.h"
-
-void e_select_names_populate_popup (GtkWidget *menu, ESelectNamesTextModel *text_model,
- GdkEventButton *ev, gint pos, GtkWidget *for_widget);
-
-#endif /* __E_SELECT_NAMES_POPUP_H__ */
-
diff --git a/addressbook/gui/component/select-names/e-select-names-section.etspec b/addressbook/gui/component/select-names/e-select-names-section.etspec
deleted file mode 100644
index 9d7b038892..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-section.etspec
+++ /dev/null
@@ -1,7 +0,0 @@
-<ETableSpecification no-headers="true" cursor-mode="line" alternating-row-colors="false">
- <ETableColumn model_col= "0" _title="Name" expansion="1.0" minimum_width="20" resizable="true" cell="string" compare="collate" search="string"/>
- <ETableState>
- <column source="0"/>
- <grouping> <leaf column="0" ascending="true"/> </grouping>
- </ETableState>
-</ETableSpecification>
diff --git a/addressbook/gui/component/select-names/e-select-names-table-model.c b/addressbook/gui/component/select-names/e-select-names-table-model.c
deleted file mode 100644
index aaa6936c8d..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-table-model.c
+++ /dev/null
@@ -1,366 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * Copyright (C) 2000 Ximian, Inc.
- */
-
-#include <config.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <gtk/gtksignal.h>
-#include <gal/util/e-util.h>
-#include <libgnome/gnome-i18n.h>
-#include <libebook/e-contact.h>
-#include "e-select-names-table-model.h"
-
-/* Object argument IDs */
-enum {
- PROP_0,
- PROP_SOURCE,
-};
-
-static void e_select_names_table_model_init (ESelectNamesTableModel *model);
-static void e_select_names_table_model_class_init (ESelectNamesTableModelClass *klass);
-
-static void e_select_names_table_model_dispose (GObject *object);
-static void e_select_names_table_model_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static void e_select_names_table_model_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
-static void e_select_names_table_model_model_changed (ESelectNamesModel *source,
- ESelectNamesTableModel *model);
-
-static ETableModelClass *parent_class = NULL;
-
-static void
-e_select_names_table_model_add_source (ESelectNamesTableModel *model,
- ESelectNamesModel *source)
-{
- model->source = source;
- if (model->source)
- g_object_ref(model->source);
- model->source_changed_id = g_signal_connect(model->source, "changed",
- G_CALLBACK(e_select_names_table_model_model_changed),
- model);
-}
-
-static void
-e_select_names_table_model_drop_source (ESelectNamesTableModel *model)
-{
- if (model->source_changed_id)
- g_signal_handler_disconnect(model->source, model->source_changed_id);
- if (model->source)
- g_object_unref(model->source);
- model->source = NULL;
- model->source_changed_id = 0;
-}
-
-/**
- * e_select_names_table_model_get_type:
- * @void:
- *
- * Registers the &ESelectNamesTableModel class if necessary, and returns the type ID
- * associated to it.
- *
- * Return value: The type ID of the &ESelectNamesTableModel class.
- **/
-GType
-e_select_names_table_model_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (ESelectNamesTableModelClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_select_names_table_model_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (ESelectNamesTableModel),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_select_names_table_model_init,
- };
-
- type = g_type_register_static (e_table_model_get_type (), "ESelectNamesTableModel", &info, 0);
- }
-
- return type;
-}
-
-/**
- * e_select_names_table_model_new:
- * @VCard: a string in vCard format
- *
- * Returns: a new #ESelectNamesTableModel that wraps the @VCard.
- */
-ETableModel *
-e_select_names_table_model_new (ESelectNamesModel *source)
-{
- ETableModel *model = g_object_new (E_TYPE_SELECT_NAMES_TABLE_MODEL, NULL);
- g_object_set(model,
- "source", source,
- NULL);
- return model;
-}
-
-static void
-fill_in_info (ESelectNamesTableModel *model)
-{
- if (model->source) {
- int count = e_select_names_model_count (model->source);
- gint i;
-
- model->count = count;
- model->data = g_new(ESelectNamesTableModelData, count);
-
- for (i = 0; i < count; ++i) {
- const EABDestination *dest = e_select_names_model_get_destination (model->source, i);
- EContact *contact = dest ? eab_destination_get_contact (dest) : NULL;
-
- if (contact) {
- model->data[i].name = e_contact_get(contact, E_CONTACT_FULL_NAME);
- if (model->data[i].name == 0)
- model->data[i].name = g_strdup("");
- model->data[i].email = e_contact_get(contact, E_CONTACT_EMAIL_1);
- if (model->data[i].email == 0)
- model->data[i].email = g_strdup("");
- } else {
- const gchar *name = eab_destination_get_name (dest);
- const gchar *email = eab_destination_get_email (dest);
-
- model->data[i].name = g_strdup (name && *name ? name : email);
- model->data[i].email = g_strdup (email);
- }
- }
- } else {
- model->count = 0;
- }
-}
-
-static void
-clear_info (ESelectNamesTableModel *model)
-{
- if (model->data) {
- int i;
- for (i = 0; i < model->count; i++) {
- g_free(model->data[i].name);
- g_free(model->data[i].email);
- }
- g_free(model->data);
- model->data = NULL;
- }
-
- model->count = -1;
-}
-
-/*
- * ESelectNamesTableModel lifecycle management and vcard loading/saving.
- */
-
-static void
-e_select_names_table_model_dispose (GObject *object)
-{
- ESelectNamesTableModel *model;
-
- model = E_SELECT_NAMES_TABLE_MODEL (object);
-
- e_select_names_table_model_drop_source (model);
- clear_info(model);
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-/* This function returns the number of columns in our ETableModel. */
-static int
-e_select_names_table_model_col_count (ETableModel *etc)
-{
- return 3;
-}
-
-/* This function returns the number of rows in our ETableModel. */
-static int
-e_select_names_table_model_row_count (ETableModel *etc)
-{
- ESelectNamesTableModel *e_select_names_table_model = E_SELECT_NAMES_TABLE_MODEL(etc);
- if (e_select_names_table_model->count == -1) {
- if (e_select_names_table_model->source) {
- fill_in_info(e_select_names_table_model);
- } else {
- return 0;
- }
- }
- return e_select_names_table_model->count;
-}
-
-/* This function returns the value at a particular point in our ETableModel. */
-static void *
-e_select_names_table_model_value_at (ETableModel *etc, int col, int row)
-{
- ESelectNamesTableModel *e_select_names_table_model = E_SELECT_NAMES_TABLE_MODEL(etc);
- if (e_select_names_table_model->data == NULL) {
- fill_in_info(e_select_names_table_model);
- }
- switch (col) {
- case 0:
- if (e_select_names_table_model->data[row].name == NULL) {
- fill_in_info(e_select_names_table_model);
- }
- return e_select_names_table_model->data[row].name;
- break;
- case 1:
- if (e_select_names_table_model->data[row].email == NULL) {
- fill_in_info(e_select_names_table_model);
- }
- return e_select_names_table_model->data[row].email;
- break;
- case 2:
- /* underline column*/
- return (void*)TRUE;
- break;
- }
- return "";
-}
-
-/* This function sets the value at a particular point in our ETableModel. */
-static void
-e_select_names_table_model_set_value_at (ETableModel *etc, int col, int row, const void *val)
-{
-}
-
-/* This function returns whether a particular cell is editable. */
-static gboolean
-e_select_names_table_model_is_cell_editable (ETableModel *etc, int col, int row)
-{
- return FALSE;
-}
-
-/* This function duplicates the value passed to it. */
-static void *
-e_select_names_table_model_duplicate_value (ETableModel *etc, int col, const void *value)
-{
- return g_strdup(value);
-}
-
-/* This function frees the value passed to it. */
-static void
-e_select_names_table_model_free_value (ETableModel *etc, int col, void *value)
-{
- g_free(value);
-}
-
-static void *
-e_select_names_table_model_initialize_value (ETableModel *etc, int col)
-{
- return g_strdup("");
-}
-
-static gboolean
-e_select_names_table_model_value_is_empty (ETableModel *etc, int col, const void *value)
-{
- return !(value && *(char *)value);
-}
-
-static char *
-e_select_names_table_model_value_to_string (ETableModel *etc, int col, const void *value)
-{
- return g_strdup(value);
-}
-
-static void
-e_select_names_table_model_model_changed (ESelectNamesModel *source,
- ESelectNamesTableModel *model)
-{
- e_table_model_pre_change(E_TABLE_MODEL(model));
- clear_info(model);
- e_table_model_changed(E_TABLE_MODEL(model));
-}
-
-/* Set_arg handler for the model */
-static void
-e_select_names_table_model_set_property (GObject *object, guint prop_id,
- const GValue *value, GParamSpec *pspec)
-{
- ESelectNamesTableModel *model;
-
- model = E_SELECT_NAMES_TABLE_MODEL (object);
-
- switch (prop_id) {
- case PROP_SOURCE:
- e_select_names_table_model_drop_source (model);
- e_select_names_table_model_add_source (model, E_SELECT_NAMES_MODEL(g_value_get_object (value)));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-/* Get_arg handler for the model */
-static void
-e_select_names_table_model_get_property (GObject *object, guint prop_id,
- GValue *value, GParamSpec *pspec)
-{
- ESelectNamesTableModel *model;
-
- model = E_SELECT_NAMES_TABLE_MODEL (object);
-
- switch (prop_id) {
- case PROP_SOURCE:
- g_value_set_object (value, model->source);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-/**
- * e_select_names_table_model_init:
- */
-static void
-e_select_names_table_model_init (ESelectNamesTableModel *model)
-{
- model->source = NULL;
- model->source_changed_id = 0;
-
- model->count = -1;
- model->data = NULL;
-}
-
-static void
-e_select_names_table_model_class_init (ESelectNamesTableModelClass *klass)
-{
- GObjectClass *object_class;
- ETableModelClass *table_model_class;
-
- object_class = G_OBJECT_CLASS(klass);
- table_model_class = E_TABLE_MODEL_CLASS(klass);
-
- parent_class = g_type_class_peek_parent (klass);
-
- object_class->dispose = e_select_names_table_model_dispose;
- object_class->get_property = e_select_names_table_model_get_property;
- object_class->set_property = e_select_names_table_model_set_property;
-
- g_object_class_install_property (object_class, PROP_SOURCE,
- g_param_spec_object ("source",
- _("Source"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_SELECT_NAMES_MODEL,
- G_PARAM_READWRITE));
-
- table_model_class->column_count = e_select_names_table_model_col_count;
- table_model_class->row_count = e_select_names_table_model_row_count;
- table_model_class->value_at = e_select_names_table_model_value_at;
- table_model_class->set_value_at = e_select_names_table_model_set_value_at;
- table_model_class->is_cell_editable = e_select_names_table_model_is_cell_editable;
- table_model_class->duplicate_value = e_select_names_table_model_duplicate_value;
- table_model_class->free_value = e_select_names_table_model_free_value;
- table_model_class->initialize_value = e_select_names_table_model_initialize_value;
- table_model_class->value_is_empty = e_select_names_table_model_value_is_empty;
- table_model_class->value_to_string = e_select_names_table_model_value_to_string;
-}
diff --git a/addressbook/gui/component/select-names/e-select-names-table-model.h b/addressbook/gui/component/select-names/e-select-names-table-model.h
deleted file mode 100644
index 1fd1026f19..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-table-model.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * Copyright (C) 2000 Ximian, Inc.
- */
-
-#ifndef __E_SELECT_NAMES_TABLE_MODEL_H__
-#define __E_SELECT_NAMES_TABLE_MODEL_H__
-
-#include <time.h>
-#include <stdio.h>
-#include <gtk/gtkobject.h>
-#include <gal/e-table/e-table-model.h>
-#include "e-select-names-model.h"
-
-#define E_TYPE_SELECT_NAMES_TABLE_MODEL (e_select_names_table_model_get_type ())
-#define E_SELECT_NAMES_TABLE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_SELECT_NAMES_TABLE_MODEL, ESelectNamesTableModel))
-#define E_SELECT_NAMES_TABLE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_SELECT_NAMES_TABLE_MODEL, ESelectNamesTableModelClass))
-#define E_IS_SELECT_NAMES_TABLE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_SELECT_NAMES_TABLE_MODEL))
-#define E_IS_SELECT_NAMES_TABLE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_SELECT_NAMES_TABLE_MODEL))
-
-typedef struct {
- char *name;
- char *email;
-} ESelectNamesTableModelData;
-
-typedef struct _ESelectNamesTableModel ESelectNamesTableModel;
-typedef struct _ESelectNamesTableModelClass ESelectNamesTableModelClass;
-
-struct _ESelectNamesTableModel {
- ETableModel parent;
-
- ESelectNamesModel *source;
- int source_changed_id;
-
- int count;
- ESelectNamesTableModelData *data; /* This is used as an array. */
-};
-
-struct _ESelectNamesTableModelClass {
- ETableModelClass parent_class;
-};
-
-ETableModel *e_select_names_table_model_new (ESelectNamesModel *source);
-
-/* Standard Gtk function */
-GType e_select_names_table_model_get_type (void);
-
-#endif /* ! __E_SELECT_NAMES_TABLE_MODEL_H__ */
diff --git a/addressbook/gui/component/select-names/e-select-names-text-model.c b/addressbook/gui/component/select-names/e-select-names-text-model.c
deleted file mode 100644
index e885de5bf6..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-text-model.c
+++ /dev/null
@@ -1,852 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- * Jon Trowbridge <trow@ximian.com>
- *
- * Copyright (C) 2000, 2001 Ximian, Inc.
- */
-
-#include <config.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-
-#include <gal/e-text/e-text-model-repos.h>
-#include <libgnome/gnome-i18n.h>
-
-#include <addressbook/gui/contact-editor/e-contact-editor.h>
-#include "e-select-names-text-model.h"
-#include "eab-gui-util.h"
-
-static FILE *out = NULL; /* stream for debugging spew */
-
-/* Object argument IDs */
-enum {
- PROP_0,
- PROP_SOURCE,
-};
-
-static void e_select_names_text_model_class_init (ESelectNamesTextModelClass *klass);
-static void e_select_names_text_model_init (ESelectNamesTextModel *model);
-static void e_select_names_text_model_dispose (GObject *object);
-static void e_select_names_text_model_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static void e_select_names_text_model_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
-
-static void e_select_names_text_model_set_source (ESelectNamesTextModel *model, ESelectNamesModel *source);
-
-static const gchar *e_select_names_text_model_get_text (ETextModel *model);
-static void e_select_names_text_model_set_text (ETextModel *model, const gchar *text);
-static void e_select_names_text_model_insert (ETextModel *model, gint position, const gchar *text);
-static void e_select_names_text_model_insert_length (ETextModel *model, gint position, const gchar *text, gint length);
-static void e_select_names_text_model_delete (ETextModel *model, gint position, gint length);
-
-static gint e_select_names_text_model_obj_count (ETextModel *model);
-static const gchar *e_select_names_text_model_get_nth_obj (ETextModel *model, gint n, gint *len);
-static void e_select_names_text_model_activate_obj (ETextModel *model, gint n);
-
-
-static ETextModelClass *parent_class;
-#define PARENT_TYPE e_text_model_get_type()
-
-/**
- * e_select_names_text_model_get_type:
- * @void:
- *
- * Registers the &ESelectNamesTextModel class if necessary, and returns the type ID
- * associated to it.
- *
- * Return value: The type ID of the &ESelectNamesTextModel class.
- **/
-GtkType
-e_select_names_text_model_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (ESelectNamesTextModelClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_select_names_text_model_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (ESelectNamesTextModel),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_select_names_text_model_init,
- };
-
- type = g_type_register_static (PARENT_TYPE, "ESelectNamesTextModel", &info, 0);
- }
-
- return type;
-}
-
-static void
-e_select_names_text_model_class_init (ESelectNamesTextModelClass *klass)
-{
- GObjectClass *object_class;
- ETextModelClass *text_model_class;
-
- object_class = G_OBJECT_CLASS(klass);
- text_model_class = E_TEXT_MODEL_CLASS(klass);
-
- parent_class = g_type_class_peek_parent (klass);
-
- object_class->dispose = e_select_names_text_model_dispose;
- object_class->get_property = e_select_names_text_model_get_property;
- object_class->set_property = e_select_names_text_model_set_property;
-
- g_object_class_install_property (object_class, PROP_SOURCE,
- g_param_spec_object ("source",
- _("Source"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_SELECT_NAMES_MODEL,
- G_PARAM_READWRITE));
-
- text_model_class->get_text = e_select_names_text_model_get_text;
- text_model_class->set_text = e_select_names_text_model_set_text;
- text_model_class->insert = e_select_names_text_model_insert;
- text_model_class->insert_length = e_select_names_text_model_insert_length;
- text_model_class->delete = e_select_names_text_model_delete;
-
- text_model_class->obj_count = e_select_names_text_model_obj_count;
- text_model_class->get_nth_obj = e_select_names_text_model_get_nth_obj;
- text_model_class->object_activated = e_select_names_text_model_activate_obj;
-
- if (getenv ("EVO_DEBUG_SELECT_NAMES_TEXT_MODEL")) {
- out = fopen ("/tmp/evo-debug-select-names-text-model", "w");
- if (out)
- setvbuf (out, NULL, _IONBF, 0);
- }
-}
-
-static void
-dump_model (ESelectNamesTextModel *text_model)
-{
- ESelectNamesModel *model = text_model->source;
- gint i;
-
- if (out == NULL)
- return;
-
- fprintf (out, "\n*** Model State: count=%d\n", e_select_names_model_count (model));
-
- for (i=0; i<e_select_names_model_count (model); ++i)
- fprintf (out, "[%d] \"%s\" %s\n", i,
- e_select_names_model_get_string (model, i),
- e_select_names_model_get_contact (model, i) ? "<contact>" : "");
- fprintf (out, "\n");
-}
-
-static void
-e_select_names_text_model_init (ESelectNamesTextModel *model)
-{
- const gchar *default_sep;
-
- model->last_magic_comma_pos = -1;
-
- if (getenv ("EVOLUTION_DISABLE_MAGIC_COMMA"))
- default_sep = ",";
- else
- default_sep = ", ";
-
- e_select_names_text_model_set_separator (model, default_sep);
-}
-
-static void
-e_select_names_text_model_dispose (GObject *object)
-{
- ESelectNamesTextModel *model;
-
- model = E_SELECT_NAMES_TEXT_MODEL (object);
-
- if (model->text) {
- g_free (model->text);
- model->text = NULL;
- }
- if (model->sep) {
- g_free (model->sep);
- model->sep = NULL;
- }
-
- e_select_names_text_model_set_source (model, NULL);
-
- if (G_OBJECT_CLASS(parent_class)->dispose)
- G_OBJECT_CLASS(parent_class)->dispose(object);
-}
-
-static void
-e_select_names_text_model_set_property (GObject *object, guint prop_id,
- const GValue *value, GParamSpec *pspec)
-{
- ESelectNamesTextModel *model;
-
- model = E_SELECT_NAMES_TEXT_MODEL (object);
-
- switch (prop_id) {
- case PROP_SOURCE:
- e_select_names_text_model_set_source(model, E_SELECT_NAMES_MODEL (g_value_get_object(value)));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-e_select_names_text_model_get_property (GObject *object, guint prop_id,
- GValue *value, GParamSpec *pspec)
-{
- ESelectNamesTextModel *model;
-
- model = E_SELECT_NAMES_TEXT_MODEL (object);
-
- switch (prop_id) {
- case PROP_SOURCE:
- g_value_set_object (value, model->source);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-resize_cb (ESelectNamesModel *source, gint index, gint old_len, gint new_len, ETextModel *model)
-{
- EReposDeleteShift repos_del;
- EReposInsertShift repos_ins;
- gint pos;
- gint seplen = E_SELECT_NAMES_TEXT_MODEL (model)->seplen;
-
- e_select_names_model_name_pos (source, seplen, index, &pos, NULL);
-
- if (new_len < old_len) {
-
- repos_del.model = model;
- repos_del.pos = pos;
- repos_del.len = old_len - new_len;
- e_text_model_reposition (model, e_repos_delete_shift, &repos_del);
-
- } else if (old_len < new_len) {
-
- repos_ins.model = model;
- repos_ins.pos = pos;
- repos_ins.len = new_len - old_len;
- e_text_model_reposition (model, e_repos_insert_shift, &repos_ins);
-
- }
-}
-
-static void
-changed_cb (ESelectNamesModel *source, ETextModel *model)
-{
- ESelectNamesTextModel *text_model = E_SELECT_NAMES_TEXT_MODEL (model);
-
- g_free (text_model->text);
- text_model->text = NULL;
-
- e_text_model_changed (model);
-}
-
-
-static void
-e_select_names_text_model_set_source (ESelectNamesTextModel *model,
- ESelectNamesModel *source)
-{
- if (source == model->source)
- return;
-
- if (model->source) {
- g_signal_handler_disconnect (model->source, model->source_changed_id);
- g_signal_handler_disconnect (model->source, model->source_resize_id);
- g_object_unref (model->source);
- }
-
- model->source = source;
-
- if (model->source) {
- g_object_ref (model->source);
- model->source_changed_id = g_signal_connect (model->source,
- "changed",
- G_CALLBACK (changed_cb),
- model);
- model->source_resize_id = g_signal_connect (model->source,
- "resized",
- G_CALLBACK (resize_cb),
- model);
- }
-}
-
-ETextModel *
-e_select_names_text_model_new (ESelectNamesModel *source)
-{
- ETextModel *model = g_object_new (E_TYPE_SELECT_NAMES_TEXT_MODEL, NULL);
- e_select_names_text_model_set_source (E_SELECT_NAMES_TEXT_MODEL (model), source);
- return model;
-}
-
-void
-e_select_names_text_model_set_separator (ESelectNamesTextModel *model, const char *sep)
-{
- g_return_if_fail (E_IS_SELECT_NAMES_TEXT_MODEL (model));
- g_return_if_fail (sep && *sep);
-
- g_free (model->sep);
- model->sep = g_strdup (sep);
- model->seplen = g_utf8_strlen (sep, -1);
-}
-
-static const gchar *
-e_select_names_text_model_get_text (ETextModel *model)
-{
- ESelectNamesTextModel *snm = E_SELECT_NAMES_TEXT_MODEL(model);
-
- if (snm == NULL)
- return "";
- else if (snm->text == NULL)
- snm->text = e_select_names_model_get_textification (snm->source, snm->sep);
-
- return snm->text;
-}
-
-static void
-e_select_names_text_model_set_text (ETextModel *model, const gchar *text)
-{
- ESelectNamesTextModel *snm = E_SELECT_NAMES_TEXT_MODEL(model);
-
- e_select_names_model_delete_all (snm->source);
- e_select_names_text_model_insert (model, 0, text);
-}
-
-static void
-e_select_names_text_model_insert (ETextModel *model, gint position, const gchar *text)
-{
- e_select_names_text_model_insert_length (model, position, text, g_utf8_strlen (text, -1));
-}
-
-static void
-e_select_names_text_model_insert_length (ETextModel *model, gint pos, const gchar *text, gint length)
-{
- ESelectNamesTextModel *text_model = E_SELECT_NAMES_TEXT_MODEL (model);
- ESelectNamesModel *source = text_model->source;
- const char *t;
- gchar *tmp;
-
- if (out) {
- tmp = g_strndup (text, length);
- fprintf (out, ">> insert \"%s\" (len=%d) at %d\n", tmp, length, pos);
- g_free (tmp);
- }
-
- tmp = e_select_names_model_get_textification (source, text_model->sep);
- pos = CLAMP (pos, 0, g_utf8_strlen (tmp, -1));
- g_free (tmp);
-
- /* We want to control all cursor motions ourselves, rather than taking hints
- from the ESelectNamesModel. */
- g_signal_handler_block (source, text_model->source_resize_id);
-
- /* We handle this one character at a time. */
-
- for (t = text; length >= 0; t = g_utf8_next_char (t), length--) {
- gint index, start_pos, text_len;
- gboolean inside_quote = FALSE;
- gunichar ut = g_utf8_get_char (t);
-
- if (ut == 0)
- break;
-
- text_model->last_magic_comma_pos = -1;
-
- if (out)
- fprintf (out, "processing [%d]\n", ut);
-
- e_select_names_model_text_pos (source, text_model->seplen, pos, &index, &start_pos, &text_len);
-
- if (out)
- fprintf (out, "index=%d start_pos=%d text_len=%d\n", index, start_pos, text_len);
-
- /* Is this a quoted or an unquoted separator we are dealing with? */
- if (ut == g_utf8_get_char(text_model->sep) && index >= 0) {
- const EABDestination *dest = e_select_names_model_get_destination (source, index);
- if (dest) {
- const gchar *str = eab_destination_get_textrep (dest, FALSE);
- int j;
- const char *jp;
-
- if (out)
- fprintf (out, "str=%s pos=%d\n", str, pos);
-
- for (jp = str, j = 0; j<pos-start_pos && *jp; jp = g_utf8_next_char (jp), ++j) {
- if (*jp == '"') {
- inside_quote = !inside_quote;
- if (out)
- fprintf (out, "flip to %d at %d\n", start_pos+j, inside_quote);
- }
- }
- }
- if (out)
- fprintf (out, inside_quote ? "inside quote\n" : "not inside quote\n");
- }
-
-
- if (ut == g_utf8_get_char (text_model->sep) && !inside_quote) {
-
- /* This is the case of hitting , first thing in an empty entry */
- if (index == -1) {
- EReposAbsolute repos;
-
- e_select_names_model_insert (source, 0, eab_destination_new ());
- e_select_names_model_insert (source, 0, eab_destination_new ());
-
- repos.model = model;
- repos.pos = -1; /* At end */
- e_text_model_reposition (model, e_repos_absolute, &repos);
-
-
- } else if (pos <= start_pos || pos == start_pos + text_len) {
- EReposInsertShift repos;
- gint ins_point = index;
-
- if (text_len != 0 && pos == start_pos + text_len)
- ++ins_point;
-
- /* Block adjacent blank cards. */
- if (! ((ins_point < e_select_names_model_count (source) &&
- (e_select_names_model_get_string (source, ins_point) == NULL))
- || (ins_point > 0 && (e_select_names_model_get_string (source, ins_point-1) == NULL)))) {
-
- e_select_names_model_insert (source, ins_point, eab_destination_new ());
-
- repos.model = model;
- repos.pos = pos;
- repos.len = text_model->seplen;
- e_text_model_reposition (model, e_repos_insert_shift, &repos);
- pos += text_model->seplen;
- }
-
- } else {
- EReposInsertShift repos;
- gint offset = MAX (pos - start_pos, 0);
- const gchar *str = e_select_names_model_get_string (source, index);
- gchar *str1 = g_strndup (str, offset);
- gchar *str2 = g_strdup (str+offset);
- EABDestination *d1 = eab_destination_new (), *d2 = eab_destination_new ();
-
- eab_destination_set_raw (d1, str1);
- eab_destination_set_raw (d2, str2);
-
- e_select_names_model_replace (source, index, d1);
- e_select_names_model_insert (source, index+1, d2);
-
- g_free (str1);
- g_free (str2);
-
- repos.model = model;
- repos.pos = pos;
- repos.len = text_model->seplen;
- e_text_model_reposition (model, e_repos_insert_shift, &repos);
- pos += text_model->seplen;
- }
-
- if (text_model->seplen > 1)
- text_model->last_magic_comma_pos = pos;
-
- } else {
- EReposInsertShift repos;
- gint offset = MAX (pos - start_pos, 0);
- const gchar *str;
- GString *new_str = g_string_new (NULL);
- gint this_length = 1;
- gboolean whitespace = g_unichar_isspace (ut);
-
- str = index >= 0 ? e_select_names_model_get_string (source, index) : NULL;
- if (str && *str) {
- if (pos <= start_pos) {
- if (whitespace) {
- /* swallow leading whitespace */
- this_length = 0;
- } else {
- /* Adjust for our "magic white space" */
- /* FIXME: This code does the wrong thing if seplen > 2 */
- g_string_append_unichar (new_str, ut);
- g_string_append (new_str, pos < start_pos ? " " : "");
- g_string_append (new_str, str);
- if (pos < start_pos)
- ++this_length;
- }
- } else {
- const char *u;
- int n;
- for (u = str, n = 0; n < offset; u = g_utf8_next_char (u), n++)
- g_string_append_unichar (new_str, g_utf8_get_char (u));
- g_string_append_unichar (new_str, ut);
- g_string_append (new_str, u);
- }
- } else {
- if (whitespace) {
- /* swallow leading whitespace */
- this_length = 0;
- } else {
- g_string_append_unichar (new_str, ut);
- }
- }
-
- if (new_str->len) {
-
- EABDestination *dest;
- dest = index >= 0 ? eab_destination_copy (e_select_names_model_get_destination (source, index)) : eab_destination_new ();
- eab_destination_set_raw (dest, new_str->str);
- e_select_names_model_replace (source, index, dest);
-
- /* e_select_names_model_replace (source, index, dest); */
-
- if (this_length > 0) {
- repos.model = model;
- repos.pos = pos;
- repos.len = this_length;
- e_text_model_reposition (model, e_repos_insert_shift, &repos);
-
- pos += this_length;
- }
- }
- g_string_free (new_str, TRUE);
- }
- }
-
- dump_model (text_model);
-
- g_signal_handler_unblock (source, text_model->source_resize_id);
-}
-
-
-static void
-e_select_names_text_model_delete (ETextModel *model, gint pos, gint length)
-{
- ESelectNamesTextModel *text_model = E_SELECT_NAMES_TEXT_MODEL (model);
- ESelectNamesModel *source = text_model->source;
- gint index, start_pos, text_len, offset;
-
- if (out) {
- const gchar *str = e_select_names_model_get_textification (source, text_model->sep);
- gint i, len;
-
- fprintf (out, ">> delete %d at pos %d\n", length, pos);
-
- len = strlen (str);
- for (i=0; i<pos && i<len; ++i)
- fprintf (out, "%c", str[i]);
- fprintf (out, "[");
- for (i=pos; i<pos+length && i<len; ++i)
- fprintf (out, "%c", str[i]);
- fprintf (out, "]");
- for (i=pos+length; i<len; ++i)
- fprintf (out, "%c", str[i]);
- fprintf (out, "\n");
- }
-
- if (length < 0)
- return;
-
- if (text_model->last_magic_comma_pos == pos+1 && length == 1) {
- pos -= text_model->seplen-1;
- if (pos >= 0)
- length = text_model->seplen;
- text_model->last_magic_comma_pos = -1;
- }
-
- e_select_names_model_text_pos (source, text_model->seplen, pos, &index, &start_pos, &text_len);
-
- if (out)
- fprintf (out, "index=%d, start_pos=%d, text_len=%d\n", index, start_pos, text_len);
-
- /* We want to control all cursor motions ourselves, rather than taking hints
- from the ESelectNamesModel. */
- g_signal_handler_block (source, E_SELECT_NAMES_TEXT_MODEL (model)->source_resize_id);
-
- /* First, we handle a few tricky cases. */
-
- if (pos < start_pos) {
- EReposAbsolute repos;
-
- repos.model = model;
- repos.pos = pos;
- e_text_model_reposition (model, e_repos_absolute, &repos);
-
- length -= start_pos - pos;
-
- if (length > 0)
- e_select_names_text_model_delete (model, start_pos, length);
- goto finished;
- }
-
- if (pos == start_pos + text_len) {
- /* We are positioned right at the end of an entry, possibly right in front of a comma. */
-
- if (index+1 < e_select_names_model_count (source)) {
- EReposDeleteShift repos;
- EABDestination *new_dest;
- const gchar *str1 = e_select_names_model_get_string (source, index);
- const gchar *str2 = e_select_names_model_get_string (source, index+1);
- gchar *new_str;
-
- while (str1 && *str1 && isspace ((gint) *str1))
- ++str1;
- while (str2 && *str2 && isspace ((gint) *str2))
- ++str2;
-
- if (str1 && str2)
- new_str = g_strdup_printf ("%s%s%s", str1, text_model->sep+1, str2);
- else if (str1)
- new_str = g_strdup (str1);
- else if (str2)
- new_str = g_strdup (str2);
- else
- new_str = g_strdup ("");
-
- if (out)
- fprintf (out, "joining \"%s\" and \"%s\" to \"%s\"\n", str1, str2, new_str);
-
- e_select_names_model_delete (source, index+1);
-
- new_dest = eab_destination_new ();
- eab_destination_set_raw (new_dest, new_str);
- e_select_names_model_replace (source, index, new_dest);
- g_free (new_str);
-
- repos.model = model;
- repos.pos = pos;
- repos.len = text_model->seplen;
-
- e_text_model_reposition (model, e_repos_delete_shift, &repos);
-
- if (length > 1)
- e_select_names_text_model_delete (model, pos, length-1);
- } else {
- /* If we are at the end of the last entry (which we must be if we end up in this block),
- we can just do nothing. So this else-block is here just to give us a place to
- put this comment. */
- }
-
- goto finished;
- }
-
- if (pos + length > start_pos + text_len) {
- /* Uh oh... our changes straddle two objects. */
-
- if (pos == start_pos) { /* Delete the whole thing */
- EReposDeleteShift repos;
-
- e_select_names_model_delete (source, index);
-
- if (out)
- fprintf (out, "deleted all of %d\n", index);
-
- repos.model = model;
- repos.pos = pos;
- repos.len = text_len + text_model->seplen;
-
- e_text_model_reposition (model, e_repos_delete_shift, &repos);
-
- length -= text_len + text_model->seplen;
- if (length > 0)
- e_select_names_text_model_delete (model, pos, length);
-
- } else {
- /* Delete right up to the end, and then call e_select_names_text_model_delete again
- to finish the job. */
- gint len1, len2;
-
- len1 = text_len - (pos - start_pos);
- len2 = length - len1;
-
- if (out)
- fprintf (out, "two-stage delete: %d, %d\n", len1, len2);
-
-
- e_select_names_text_model_delete (model, pos, len1);
- e_select_names_text_model_delete (model, pos, len2);
- }
-
- goto finished;
- }
-
- /* Our changes are confined to just one entry. */
- if (length > 0) {
- const gchar *str;
- gchar *new_str;
-
- offset = pos - start_pos;
-
- str = e_select_names_model_get_string (source, index);
-
- if (str) {
- const char *p;
- char *np;
- int i;
- EReposDeleteShift repos;
- EABDestination *dest;
-
- new_str = g_new0 (char, strlen (str) * 6 + 1); /* worse case it can't be any longer than this */
-
- /* copy the region before the deletion */
- for (p = str, i = 0, np = new_str; i < offset; i++) {
- gunichar ch;
-
- ch = g_utf8_get_char (p);
- g_unichar_to_utf8 (ch, np);
-
- np = g_utf8_next_char (np);
- p = g_utf8_next_char (p);
- }
-
- /* skip the deleted segment */
- for (i = 0; i < length; i++)
- p = g_utf8_next_char (p);
-
- /* copy the region after the deletion */
- for (; *p; p = g_utf8_next_char (p)) {
- gunichar ch;
-
- ch = g_utf8_get_char (p);
- g_unichar_to_utf8 (ch, np);
-
- np = g_utf8_next_char (np);
- }
-
- dest = index >= 0 ? eab_destination_copy (e_select_names_model_get_destination (source, index)) : eab_destination_new ();
- eab_destination_set_raw (dest, new_str);
- e_select_names_model_replace (source, index, dest);
-
- if (out)
- fprintf (out, "new_str: \"%s\"\n", new_str);
-
- g_free (new_str);
-
- repos.model = model;
- repos.pos = pos;
- repos.len = length;
-
- e_text_model_reposition (model, e_repos_delete_shift, &repos);
-
- } else {
- EReposDeleteShift repos;
-
- e_select_names_model_delete (source, index);
-
- if (out)
- fprintf (out, "deleted %d\n", index);
-
-
- repos.model = model;
- repos.pos = pos;
- repos.len = text_model->seplen;
-
- e_text_model_reposition (model, e_repos_delete_shift, &repos);
- }
- }
-
- finished:
- E_SELECT_NAMES_TEXT_MODEL (model)->last_magic_comma_pos = -1;
- g_signal_handler_unblock (source, E_SELECT_NAMES_TEXT_MODEL (model)->source_resize_id);
- dump_model (E_SELECT_NAMES_TEXT_MODEL (model));
-}
-
-static gint
-e_select_names_text_model_obj_count (ETextModel *model)
-{
- ESelectNamesModel *source = E_SELECT_NAMES_TEXT_MODEL (model)->source;
- gint i, count;
-
- count = i = e_select_names_model_count (source);
- while (i > 0) {
- const EABDestination *dest;
- --i;
- dest = e_select_names_model_get_destination (source, i);
- if (eab_destination_get_contact (dest) == NULL)
- --count;
- }
-
- return count;
-}
-
-static gint
-nth_obj_index (ESelectNamesModel *source, gint n)
-{
- gint i, N;
-
- i = 0;
- N = e_select_names_model_count (source);
-
- do {
- const EABDestination *dest = e_select_names_model_get_destination (source, i);
- if (eab_destination_get_contact (dest))
- --n;
- ++i;
- } while (n >= 0 && i < N);
-
- if (i <= N)
- --i;
- else
- i = -1;
-
- return i;
-}
-
-static const gchar *
-e_select_names_text_model_get_nth_obj (ETextModel *model, gint n, gint *len)
-{
- ESelectNamesTextModel *text_model = E_SELECT_NAMES_TEXT_MODEL (model);
- ESelectNamesModel *source = text_model->source;
- gint i, pos;
-
- i = nth_obj_index (source, n);
- if (i < 0)
- return NULL;
-
- e_select_names_model_name_pos (source, text_model->seplen, i, &pos, len);
- if (pos < 0)
- return NULL;
-
- if (text_model->text == NULL)
- text_model->text = e_select_names_model_get_textification (source, text_model->sep);
- return g_utf8_offset_to_pointer (text_model->text, pos);
-}
-
-static void
-e_select_names_text_model_activate_obj (ETextModel *model, gint n)
-{
-#if notyet
- /* XXX the new ebook doesn't have e_contact_get_book, and we
- don't really want to add it, so this can't be implemented
- this simply anymore */
- ESelectNamesModel *source = E_SELECT_NAMES_TEXT_MODEL (model)->source;
- EContact *contact;
- gint i;
-
- i = nth_obj_index (source, n);
- g_return_if_fail (i >= 0);
-
- contact = e_select_names_model_get_contact (source, i);
- g_return_if_fail (contact != NULL);
-
- /* present read-only contact editor when someone double clicks from here */
- if (e_contact_get (contact, E_CONTACT_IS_LIST)) {
- EContactListEditor *ce;
- ce = e_addressbook_show_contact_list_editor (e_contact_get_book(contact), contact, FALSE, FALSE);
- e_contact_list_editor_raise (ce);
- }
- else {
- EABContactEditor *ce;
- ce = e_addressbook_show_contact_editor (e_contact_get_book(contact), contact, FALSE, FALSE);
- e_contact_editor_raise (ce);
- }
-#endif
-}
-
-
-
diff --git a/addressbook/gui/component/select-names/e-select-names-text-model.h b/addressbook/gui/component/select-names/e-select-names-text-model.h
deleted file mode 100644
index eec062aee6..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-text-model.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- * Jon Trowbridge <trow@ximian.com>
- *
- * Copyright (C) 2000, 2001 Ximian, Inc.
- */
-
-#ifndef __E_SELECT_NAMES_TEXT_MODEL_H__
-#define __E_SELECT_NAMES_TEXT_MODEL_H__
-
-#include <time.h>
-#include <stdio.h>
-#include <gtk/gtkobject.h>
-#include <gal/e-text/e-text-model.h>
-#include "e-select-names-model.h"
-
-#define E_TYPE_SELECT_NAMES_TEXT_MODEL (e_select_names_text_model_get_type ())
-#define E_SELECT_NAMES_TEXT_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_SELECT_NAMES_TEXT_MODEL, ESelectNamesTextModel))
-#define E_SELECT_NAMES_TEXT_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_SELECT_NAMES_TEXT_MODEL, ESelectNamesTextModelClass))
-#define E_IS_SELECT_NAMES_TEXT_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_SELECT_NAMES_TEXT_MODEL))
-#define E_IS_SELECT_NAMES_TEXT_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_SELECT_NAMES_TEXT_MODEL))
-
-typedef struct _ESelectNamesTextModel ESelectNamesTextModel;
-typedef struct _ESelectNamesTextModelClass ESelectNamesTextModelClass;
-
-struct _ESelectNamesTextModel {
- ETextModel parent;
-
- ESelectNamesModel *source;
- gint source_changed_id;
- gint source_resize_id;
-
- gchar *text;
-
- gchar *sep;
- gint seplen;
-
- gint last_magic_comma_pos;
-};
-
-struct _ESelectNamesTextModelClass {
- ETextModelClass parent_class;
-};
-
-ETextModel *e_select_names_text_model_new (ESelectNamesModel *source);
-void e_select_names_text_model_set_separator (ESelectNamesTextModel *model, const char *sep);
-
-/* Standard Gtk function */
-GType e_select_names_text_model_get_type (void);
-
-#endif /* ! __E_SELECT_NAMES_TEXT_MODEL_H__ */
diff --git a/addressbook/gui/component/select-names/e-select-names.c b/addressbook/gui/component/select-names/e-select-names.c
deleted file mode 100644
index 3925857447..0000000000
--- a/addressbook/gui/component/select-names/e-select-names.c
+++ /dev/null
@@ -1,845 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* e-select-names.c
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-#include <string.h>
-#include <glib.h>
-#include <gtk/gtk.h>
-#include <libgnome/gnome-i18n.h>
-
-#include <gal/e-table/e-table-simple.h>
-#include <gal/e-table/e-table-without.h>
-#include <gal/widgets/e-popup-menu.h>
-
-#include <libebook/e-book-async.h>
-#include <libebook/e-contact.h>
-#include <addressbook/gui/widgets/e-addressbook-model.h>
-#include <addressbook/gui/widgets/e-addressbook-table-adapter.h>
-#include <addressbook/util/eab-book-util.h>
-#include <addressbook/gui/component/addressbook-component.h>
-#include <addressbook/gui/component/addressbook.h>
-
-#include "e-select-names-config.h"
-#include "e-select-names.h"
-#include "e-select-names-table-model.h"
-#include <gal/widgets/e-categories-master-list-option-menu.h>
-#include <gal/e-text/e-entry.h>
-#include <e-util/e-categories-master-list-wombat.h>
-#include "e-util/e-sexp.h"
-
-static void e_select_names_init (ESelectNames *names);
-static void e_select_names_class_init (ESelectNamesClass *klass);
-static void e_select_names_dispose (GObject *object);
-static void update_query (GtkWidget *widget, ESelectNames *e_select_names);
-
-static void sync_table_and_models (ESelectNamesModel *triggering_model, ESelectNames *esl);
-
-static GtkDialogClass *parent_class = NULL;
-#define PARENT_TYPE gtk_dialog_get_type()
-
-/* The arguments we take */
-enum {
- ARG_0,
-};
-
-typedef struct {
- char *title;
- ESelectNamesModel *source;
- ESelectNamesTableModel *table_model;
- ESelectNames *names;
- GtkWidget *label;
- GtkWidget *button;
- GtkWidget *recipient_table;
- gulong changed_id;
-} ESelectNamesChild;
-
-GType
-e_select_names_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (ESelectNamesClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_select_names_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (ESelectNames),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_select_names_init,
- };
-
- type = g_type_register_static (PARENT_TYPE, "ESelectNames", &info, 0);
- }
-
- return type;
-}
-
-static void
-e_select_names_class_init (ESelectNamesClass *klass)
-{
- GObjectClass *object_class;
-
- object_class = G_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_peek_parent (klass);
-
- object_class->dispose = e_select_names_dispose;
-}
-
-GtkWidget *e_addressbook_create_ebook_table(char *name, char *string1, char *string2, int num1, int num2);
-
-static void
-search_result (EABModel *model, EBookViewStatus status, ESelectNames *esn)
-{
- sync_table_and_models (NULL, esn);
-}
-
-static void
-set_book(EBook *book, EBookStatus status, ESelectNames *esn)
-{
- g_object_set(esn->model,
- "book", book,
- NULL);
- update_query (NULL, esn);
- g_object_unref(book);
- g_object_unref(esn->model);
- g_object_unref(esn);
-}
-
-static ESource *
-find_first_source (ESourceList *source_list)
-{
- GSList *groups, *sources, *l, *m;
-
- groups = e_source_list_peek_groups (source_list);
- for (l = groups; l; l = l->next) {
- ESourceGroup *group = l->data;
-
- sources = e_source_group_peek_sources (group);
- for (m = sources; m; m = m->next) {
- ESource *source = m->data;
-
- return source;
- }
- }
-
- return NULL;
-}
-
-static void
-addressbook_model_set_source (ESelectNames *e_select_names, EABModel *model, ESource *source)
-{
- EBook *book;
-
- book = e_book_new();
-
- g_object_ref(e_select_names);
- g_object_ref(model);
-
- addressbook_load_source (book, source, (EBookCallback) set_book, e_select_names);
-}
-
-static void *
-contact_key (const EContact *contact)
-{
- EBook *book = NULL;
- const gchar *book_uri;
-
- if (contact == NULL)
- return NULL;
-
- g_assert (E_IS_CONTACT (contact));
-
-#if notyet
- /* XXX we need a way to reproduce this here somehow.. or at
- least make sure we never collide between two contacts in
- different books. */
- book = e_contact_get_book (contact);
-#endif
- book_uri = book ? e_book_get_uri (book) : "NoBook";
- return g_strdup_printf ("%s|%s", book_uri ? book_uri : "NoURI", (char*)e_contact_get_const ((EContact*)contact, E_CONTACT_UID));
-}
-
-static void
-sync_one_model (gpointer k, gpointer val, gpointer closure)
-{
- ETableWithout *etw = E_TABLE_WITHOUT (closure);
- ESelectNamesChild *child = val;
- ESelectNamesModel *model = child->source;
- gint i, count;
- EContact *contact;
- void *key;
-
- count = e_select_names_model_count (model);
- for (i = 0; i < count; ++i) {
- contact = e_select_names_model_get_contact (model, i);
- if (contact) {
- key = contact_key (contact);
- e_table_without_hide (etw, key);
- g_free (key);
- }
- }
-}
-
-static void
-sync_table_and_models (ESelectNamesModel *triggering_model, ESelectNames *esl)
-{
- e_table_without_show_all (E_TABLE_WITHOUT (esl->without));
- g_hash_table_foreach (esl->children, sync_one_model, esl->without);
-}
-
-static void
-real_add_address_cb (int model_row, gpointer closure)
-{
- ESelectNamesChild *child = closure;
- ESelectNames *names = child->names;
- const EContact *contact;
- EABDestination *dest = eab_destination_new ();
- gint mapped_row;
-
- mapped_row = e_table_subset_view_to_model_row (E_TABLE_SUBSET (names->without), model_row);
-
- contact = eab_model_contact_at (EAB_MODEL(names->model), mapped_row);
-
- if (contact != NULL) {
- eab_destination_set_contact (dest, (EContact*)contact, 0);
-
- e_select_names_model_append (child->source, dest);
- e_select_names_model_clean (child->source, FALSE);
- }
-}
-
-static void
-real_add_address(ESelectNames *names, ESelectNamesChild *child)
-{
- e_select_names_model_freeze (child->source);
- e_table_selected_row_foreach(e_table_scrolled_get_table(names->table),
- real_add_address_cb, child);
- e_select_names_model_thaw (child->source);
-}
-
-static void
-add_address(ETable *table, int row, int col, GdkEvent *event, ESelectNames *names)
-{
- ESelectNamesChild *child;
-
- child = g_hash_table_lookup(names->children, names->def);
- if (child) {
- real_add_address(names, child);
- }
-}
-
-static void
-sensitize_button (gpointer key, gpointer data, gpointer user_data)
-{
- gboolean *sensitive = user_data;
- ESelectNamesChild *child = data;
-
- gtk_widget_set_sensitive (child->button, *sensitive);
-}
-
-static void
-selection_change (ETable *table, ESelectNames *names)
-{
- gboolean sensitive;
-
- sensitive = e_table_selected_count (table) > 0;
-
- g_hash_table_foreach (names->children, sensitize_button, &sensitive);
-}
-
-static void *
-esn_get_key_fn (ETableModel *source, int row, void *closure)
-{
- EABModel *model = EAB_MODEL (closure);
- const EContact *contact = eab_model_contact_at (model, row);
- void *key = contact_key (contact);
- return key;
-}
-
-static void *
-esn_dup_key_fn (const void *key, void *closure)
-{
- void *dup = (void *) g_strdup ((const gchar *) key);
- return dup;
-}
-
-static void
-esn_free_gotten_key_fn (void *key, void *closure)
-{
- g_free (key);
-}
-
-static void
-esn_free_duped_key_fn (void *key, void *closure)
-{
- g_free (key);
-}
-
-GtkWidget *
-e_addressbook_create_ebook_table(char *name, char *string1, char *string2, int num1, int num2)
-{
- ETableModel *adapter;
- ETableModel *without;
- EABModel *model;
- GtkWidget *table;
-
- model = eab_model_new ();
- adapter = E_TABLE_MODEL (eab_table_adapter_new (model));
-
- g_object_set(model,
- "editable", FALSE,
- NULL);
-
- without = e_table_without_new (adapter,
- g_str_hash,
- g_str_equal,
- esn_get_key_fn,
- esn_dup_key_fn,
- esn_free_gotten_key_fn,
- esn_free_duped_key_fn,
- model);
-
- table = e_table_scrolled_new_from_spec_file (without,
- NULL,
- EVOLUTION_ETSPECDIR "/e-select-names.etspec",
- NULL);
-
- g_object_set_data(G_OBJECT(table), "adapter", adapter);
- g_object_set_data(G_OBJECT(table), "without", without);
- g_object_set_data(G_OBJECT(table), "model", model);
-
- return table;
-}
-
-static void
-source_selected (ESourceOptionMenu *menu, ESource *source, ESelectNames *e_select_names)
-{
- addressbook_model_set_source (e_select_names, e_select_names->model, source);
- e_select_names_config_set_last_completion_book (e_source_peek_uid (source));
-}
-
-static void
-update_query (GtkWidget *widget, ESelectNames *e_select_names)
-{
- char *category = "";
- const char *search = "";
- char *query;
- char *q_array[4];
- int i;
- GString *s = g_string_new ("");
-
- if (e_select_names->categories) {
- category = e_categories_master_list_option_menu_get_category (E_CATEGORIES_MASTER_LIST_OPTION_MENU (e_select_names->categories));
- }
- if (e_select_names->select_entry) {
- search = gtk_entry_get_text (GTK_ENTRY (e_select_names->select_entry));
- }
-
- e_sexp_encode_string (s, search);
-
- i = 0;
- q_array[i++] = "(contains \"email\" \"\")";
- if (category && *category)
- q_array[i++] = g_strdup_printf ("(is \"category\" \"%s\")", category);
- if (search && *search)
- q_array[i++] = g_strdup_printf ("(or (beginswith \"email\" %s) "
- " (beginswith \"full_name\" %s) "
- " (beginswith \"nickname\" %s)"
- " (beginswith \"file_as\" %s))",
- s->str, s->str, s->str, s->str);
- q_array[i++] = NULL;
- if (i > 2) {
- char *temp = g_strjoinv (" ", q_array);
- query = g_strdup_printf ("(and %s)", temp);
- g_free (temp);
- } else {
- query = g_strdup (q_array[0]);
- }
- g_object_set (e_select_names->model,
- "query", query,
- NULL);
- for (i = 1; q_array[i]; i++) {
- g_free (q_array[i]);
- }
- g_free (query);
- g_string_free (s, TRUE);
-}
-
-static void
-status_message (EABModel *model, const gchar *message, ESelectNames *e_select_names)
-{
- if (message == NULL)
- gtk_label_set_text (GTK_LABEL (e_select_names->status_message), "");
- else
- gtk_label_set_text (GTK_LABEL (e_select_names->status_message), message);
-}
-
-static void
-categories_changed (GtkWidget *widget, ESelectNames *e_select_names)
-{
- update_query (widget, e_select_names);
-}
-
-static void
-select_entry_changed (GtkWidget *widget, ESelectNames *e_select_names)
-{
- if (e_select_names->select_entry) {
- const char *select_string = gtk_entry_get_text (GTK_ENTRY (e_select_names->select_entry));
- char *select_strcoll_string = g_utf8_collate_key (select_string, -1);
- int count;
- ETable *table;
- int i;
-
- table = e_table_scrolled_get_table (e_select_names->table);
-
- count = e_table_model_row_count (e_select_names->without);
-
- for (i = 0; i < count; i++) {
- int model_row = e_table_view_to_model_row (table, i);
- char *row_strcoll_string =
- g_utf8_collate_key (e_table_model_value_at (e_select_names->without,
- E_CONTACT_FULL_NAME,
- model_row),
- -1);
- if (g_utf8_collate (select_strcoll_string, row_strcoll_string) <= 0) {
- g_free (row_strcoll_string);
- break;
- }
- g_free (row_strcoll_string);
- }
- g_free (select_strcoll_string);
- if (i == count)
- i --;
-
- if (count > 0) {
- i = e_table_view_to_model_row (table, i);
- e_table_set_cursor_row (table, i);
- }
- }
-}
-
-GtkWidget *e_select_names_create_categories (gchar *name,
- gchar *string1, gchar *string2,
- gint int1, gint int2);
-
-GtkWidget *
-e_select_names_create_categories (gchar *name,
- gchar *string1, gchar *string2,
- gint int1, gint int2)
-{
- ECategoriesMasterList *ecml;
- GtkWidget *option_menu;
-
- ecml = e_categories_master_list_wombat_new ();
- option_menu = e_categories_master_list_option_menu_new (ecml);
- g_object_unref (ecml);
-
- return option_menu;
-}
-
-static void
-clear_widget (gpointer data, GObject *where_object_was)
-{
- GtkWidget **widget_ref = data;
- *widget_ref = NULL;
-}
-
-static void
-e_select_names_init (ESelectNames *e_select_names)
-{
- GladeXML *gui;
- GtkWidget *widget, *button, *table, *esom;
- ESource *source = NULL;
- char *uid;
-
- /* FIXME What to do on error/NULL ? */
- e_select_names->source_list = e_source_list_new_for_gconf_default ("/apps/evolution/addressbook/sources");
-
- gui = glade_xml_new (EVOLUTION_GLADEDIR "/select-names.glade", NULL, NULL);
- e_select_names->gui = gui;
-
- /* Add the source menu */
- esom = e_source_option_menu_new (e_select_names->source_list);
- g_signal_connect (esom, "source_selected", G_CALLBACK (source_selected), e_select_names);
- gtk_widget_show (esom);
-
- table = glade_xml_get_widget (gui, "show_contacts_table");
- gtk_table_attach (GTK_TABLE (table), esom, 1, 2, 0, 1, GTK_FILL, GTK_FILL, 0, 0);
-
- /* Set up the rest of the widgets */
- e_select_names->children = g_hash_table_new(g_str_hash, g_str_equal);
- e_select_names->child_count = 0;
- e_select_names->def = NULL;
-
- widget = glade_xml_get_widget(gui, "table-top");
- if (!widget) {
- return;
- }
- gtk_widget_ref(widget);
- gtk_container_remove(GTK_CONTAINER(widget->parent), widget);
- gtk_box_pack_start(GTK_BOX(GTK_DIALOG(e_select_names)->vbox), widget, TRUE, TRUE, 0);
- gtk_widget_unref(widget);
-
- gtk_dialog_add_buttons (GTK_DIALOG (e_select_names),
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OK, GTK_RESPONSE_OK,
- NULL);
-
- gtk_dialog_set_default_response (GTK_DIALOG (e_select_names),
- GTK_RESPONSE_OK);
-
- gtk_container_set_border_width (GTK_CONTAINER (e_select_names), 12);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (e_select_names)->vbox), 6);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (e_select_names)->action_area), 12);
-
- gtk_window_set_modal (GTK_WINDOW (e_select_names), TRUE);
-
- gtk_window_set_title(GTK_WINDOW(e_select_names), _("Select Contacts from Addressbook"));
- gtk_window_set_resizable(GTK_WINDOW(e_select_names), TRUE);
-
- e_select_names->table = E_TABLE_SCROLLED(glade_xml_get_widget(gui, "table-source"));
- e_select_names->model = g_object_get_data(G_OBJECT(e_select_names->table), "model");
- e_select_names->adapter = g_object_get_data(G_OBJECT(e_select_names->table), "adapter");
- e_select_names->without = g_object_get_data(G_OBJECT(e_select_names->table), "without");
- gtk_widget_show (GTK_WIDGET (e_select_names->table));
-
- e_select_names->status_message = glade_xml_get_widget (gui, "status-message");
- if (e_select_names->status_message && !GTK_IS_LABEL (e_select_names->status_message))
- e_select_names->status_message = NULL;
- if (e_select_names->status_message) {
- e_select_names->status_id = g_signal_connect (e_select_names->model, "status_message",
- G_CALLBACK (status_message), e_select_names);
- g_object_weak_ref (G_OBJECT (e_select_names->status_message), clear_widget, &e_select_names->status_message);
- }
-
- e_select_names->search_id = g_signal_connect (e_select_names->model,
- "search_result", G_CALLBACK (search_result),
- e_select_names);
-
- e_select_names->categories = glade_xml_get_widget (gui, "custom-categories");
- if (e_select_names->categories && !E_IS_CATEGORIES_MASTER_LIST_OPTION_MENU (e_select_names->categories))
- e_select_names->categories = NULL;
- if (e_select_names->categories) {
- g_signal_connect(e_select_names->categories, "changed",
- G_CALLBACK(categories_changed), e_select_names);
- g_object_weak_ref (G_OBJECT (e_select_names->categories), clear_widget, &e_select_names->categories);
- }
- gtk_widget_show (e_select_names->categories);
-
- e_select_names->select_entry = glade_xml_get_widget (gui, "entry-select");
- if (e_select_names->select_entry && !GTK_IS_ENTRY (e_select_names->select_entry))
- e_select_names->select_entry = NULL;
- if (e_select_names->select_entry) {
- g_signal_connect(e_select_names->select_entry, "changed",
- G_CALLBACK(select_entry_changed), e_select_names);
- g_signal_connect(e_select_names->select_entry, "activate",
- G_CALLBACK(update_query), e_select_names);
- g_object_weak_ref (G_OBJECT (e_select_names->select_entry), clear_widget, &e_select_names->select_entry);
- }
-
- button = glade_xml_get_widget (gui, "button-find");
- if (button && GTK_IS_BUTTON (button))
- g_signal_connect(button, "clicked",
- G_CALLBACK(update_query), e_select_names);
-
- g_signal_connect (e_table_scrolled_get_table (e_select_names->table), "double_click",
- G_CALLBACK (add_address), e_select_names);
- g_signal_connect (e_table_scrolled_get_table (e_select_names->table), "selection_change",
- G_CALLBACK (selection_change), e_select_names);
- selection_change (e_table_scrolled_get_table (e_select_names->table), e_select_names);
-
- /* Select a source for to display initially */
- uid = e_select_names_config_get_last_completion_book ();
- if (uid) {
- source = e_source_list_peek_source_by_uid (e_select_names->source_list, uid);
- g_free (uid);
- }
-
- if (!source)
- source = find_first_source (e_select_names->source_list);
-
- /* FIXME What if we still can't find a source? */
- e_source_option_menu_select (E_SOURCE_OPTION_MENU (esom), source);
-
-}
-
-static void e_select_names_child_free(char *key, ESelectNamesChild *child, ESelectNames *e_select_names)
-{
- g_signal_handler_disconnect(child->source, child->changed_id);
-
- g_free(child->title);
- g_object_unref(child->table_model);
- g_object_unref(child->source);
- g_free(key);
- g_free(child);
-}
-
-static void
-e_select_names_dispose (GObject *object)
-{
- ESelectNames *e_select_names = E_SELECT_NAMES(object);
-
- if (e_select_names->source_list) {
- g_object_unref (e_select_names->source_list);
- e_select_names->source_list = NULL;
- }
-
- if (e_select_names->status_id) {
- g_signal_handler_disconnect(e_select_names->model, e_select_names->status_id);
- e_select_names->status_id = 0;
- }
-
- if (e_select_names->search_id) {
- g_signal_handler_disconnect(e_select_names->model, e_select_names->search_id);
- e_select_names->search_id = 0;
- }
-
- if (e_select_names->gui) {
- g_object_unref(e_select_names->gui);
- e_select_names->gui = NULL;
- }
-
- if (e_select_names->children) {
- g_hash_table_foreach(e_select_names->children, (GHFunc) e_select_names_child_free, e_select_names);
- g_hash_table_destroy(e_select_names->children);
- e_select_names->children = NULL;
- }
-
- if (e_select_names->without) {
- g_object_unref(e_select_names->without);
- e_select_names->without = NULL;
- }
- if (e_select_names->adapter) {
- g_object_unref(e_select_names->adapter);
- e_select_names->adapter = NULL;
- }
- if (e_select_names->model) {
- g_object_unref(e_select_names->model);
- e_select_names->model = NULL;
- }
-
- if (e_select_names->def) {
- g_free(e_select_names->def);
- e_select_names->def = NULL;
- }
-
- if (G_OBJECT_CLASS(parent_class)->dispose)
- G_OBJECT_CLASS(parent_class)->dispose(object);
-}
-
-GtkWidget*
-e_select_names_new (void)
-{
- ESelectNames *e_select_names;
-
- e_select_names = g_object_new (E_TYPE_SELECT_NAMES, NULL);
-
- return GTK_WIDGET (e_select_names);
-}
-
-static void
-button_clicked(GtkWidget *button, ESelectNamesChild *child)
-{
- real_add_address(child->names, child);
-}
-
-static void
-remove_address(ETable *table, int row, int col, GdkEvent *event, ESelectNamesChild *child)
-{
- e_select_names_model_delete (child->source, row);
-}
-
-struct _RightClickData {
- ESelectNamesChild *child;
- int row;
-};
-typedef struct _RightClickData RightClickData;
-
-static void
-remove_cb (GtkWidget *widget, void *data)
-{
- RightClickData *rcdata = (RightClickData *)data;
-
- e_select_names_model_delete (rcdata->child->source, rcdata->row);
-
- /* Free everything we've created */
- g_free (rcdata);
-}
-
-static void
-section_right_click_cb (ETable *et, int row, int col, GdkEvent *ev, ESelectNamesChild *child)
-{
- static EPopupMenu right_click_menu[] = {
- E_POPUP_ITEM (N_("Remove"), G_CALLBACK (remove_cb), 0),
- E_POPUP_TERMINATOR
- };
- RightClickData *rcdata = g_new0 (RightClickData, 1);
-
- rcdata->row = row;
- rcdata->child = child;
-
- e_popup_menu_run (right_click_menu, (GdkEvent *)ev, 0, 0, rcdata);
-}
-
-void
-e_select_names_add_section (ESelectNames *e_select_names,
- const char *name, const char *id,
- ESelectNamesModel *source)
-{
- ESelectNamesChild *child;
- GtkWidget *button;
- GtkWidget *label;
- GtkWidget *alignment;
- GtkTable *table;
- char *label_text;
- ETable *etable;
- ETableExtras *extras;
- ECell *string_cell;
-
- GtkWidget *sw;
-
- if (g_hash_table_lookup(e_select_names->children, id)) {
- return;
- }
-
- table = GTK_TABLE(glade_xml_get_widget (e_select_names->gui, "table-recipients"));
-
- child = g_new(ESelectNamesChild, 1);
-
- child->names = e_select_names;
- child->title = g_strdup (_(name));
-
- child->table_model = (ESelectNamesTableModel*)e_select_names_table_model_new (source);
-
- child->source = source;
- g_object_ref(child->source);
-
- e_select_names->child_count++;
-
- alignment = gtk_alignment_new(0, 0, 1, 0);
-
- label_text = g_strconcat (child->title, " ->", NULL);
-
- label = gtk_label_new ("");
-
- gtk_label_set_markup (GTK_LABEL(label), label_text);
-
- g_free (label_text);
-
- button = gtk_button_new ();
- gtk_container_add (GTK_CONTAINER (button), label);
- child->label = label;
- child->button = button;
-
- gtk_container_add(GTK_CONTAINER(alignment), button);
- gtk_widget_show_all(alignment);
- g_signal_connect(button, "clicked",
- G_CALLBACK(button_clicked), child);
- gtk_table_attach(table, alignment,
- 0, 1,
- e_select_names->child_count,
- e_select_names->child_count + 1,
- GTK_FILL, GTK_FILL,
- 0, 0);
-
- etable = e_table_scrolled_get_table (e_select_names->table);
- gtk_widget_set_sensitive (button, e_table_selected_count (etable) > 0);
-
- extras = e_table_extras_new ();
- string_cell = e_table_extras_get_cell (extras, "string");
-
- g_object_set (string_cell,
- "underline_column", 2,
- NULL);
-
- sw = e_table_scrolled_new_from_spec_file (E_TABLE_MODEL (child->table_model),
- extras,
- EVOLUTION_ETSPECDIR "/e-select-names-section.etspec",
- NULL);
- g_object_unref (extras);
-
- child->recipient_table = GTK_WIDGET (e_table_scrolled_get_table (E_TABLE_SCROLLED (sw)));
-
- g_signal_connect (child->recipient_table,
- "right_click",
- G_CALLBACK (section_right_click_cb),
- child);
-
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
- GTK_POLICY_AUTOMATIC,
- GTK_POLICY_AUTOMATIC);
-
- g_signal_connect(child->recipient_table, "double_click",
- G_CALLBACK(remove_address), child);
-
- child->changed_id = g_signal_connect (child->source,
- "changed",
- G_CALLBACK (sync_table_and_models),
- e_select_names);
-
- gtk_widget_show_all (sw);
-
- gtk_table_attach(table, sw,
- 1, 2,
- e_select_names->child_count,
- e_select_names->child_count + 1,
- GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND,
- 0, 0);
-
- g_hash_table_insert(e_select_names->children, g_strdup(id), child);
-
- sync_table_and_models (child->source, e_select_names);
-}
-
-void
-e_select_names_set_default (ESelectNames *e_select_names,
- const char *id)
-{
- ESelectNamesChild *child;
-
- if (e_select_names->def) {
- child = g_hash_table_lookup(e_select_names->children, e_select_names->def);
- if (child) {
- GtkWidget *label = child->label;
-
- /* set the previous default to non-bold */
- gtk_label_set_markup (GTK_LABEL (label), child->title);
- }
- }
-
- g_free(e_select_names->def);
- e_select_names->def = g_strdup(id);
-
- if (e_select_names->def) {
- child = g_hash_table_lookup(e_select_names->children, e_select_names->def);
- if (child) {
- GtkWidget *label = child->label;
- char *markup = g_strconcat ("<b>", child->title, "</b>", NULL);
-
- /* set the new default to bold */
- gtk_label_set_markup (GTK_LABEL (label), markup);
- g_free (markup);
- }
- }
-}
diff --git a/addressbook/gui/component/select-names/e-select-names.etspec b/addressbook/gui/component/select-names/e-select-names.etspec
deleted file mode 100644
index 7a260887ff..0000000000
--- a/addressbook/gui/component/select-names/e-select-names.etspec
+++ /dev/null
@@ -1,7 +0,0 @@
-<ETableSpecification no-headers="true" cursor-mode="line">
- <ETableColumn model_col= "69" _title="Name" expansion="1.0" minimum_width="20" resizable="true" cell="string" compare="collate" search="string"/>
- <ETableState>
- <column source="0"/>
- <grouping> <leaf column="0" ascending="true"/> </grouping>
- </ETableState>
-</ETableSpecification>
diff --git a/addressbook/gui/component/select-names/e-select-names.h b/addressbook/gui/component/select-names/e-select-names.h
deleted file mode 100644
index e927932d13..0000000000
--- a/addressbook/gui/component/select-names/e-select-names.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* e-select-names.h
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-#ifndef __E_SELECT_NAMES_H__
-#define __E_SELECT_NAMES_H__
-
-#include <glib.h>
-#include <gtk/gtkwidget.h>
-#include <gtk/gtkdialog.h>
-#include <glade/glade.h>
-#include <gal/e-table/e-table.h>
-#include <gal/e-table/e-table-scrolled.h>
-#include <libedataserver/e-source-list.h>
-#include <widgets/misc/e-source-option-menu.h>
-
-#include "e-addressbook-model.h"
-
-#include "e-select-names-model.h"
-
-G_BEGIN_DECLS
-
-/* ESelectNames - A dialog displaying information about a contact.
- *
- * The following arguments are available:
- *
- * name type read/write description
- * --------------------------------------------------------------------------------
- */
-
-#define E_TYPE_SELECT_NAMES (e_select_names_get_type ())
-#define E_SELECT_NAMES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_SELECT_NAMES, ESelectNames))
-#define E_SELECT_NAMES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_SELECT_NAMES, ESelectNamesClass))
-#define E_IS_SELECT_NAMES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_SELECT_NAMES))
-#define E_IS_SELECT_NAMES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_SELECT_NAMES))
-
-typedef struct _ESelectNames ESelectNames;
-typedef struct _ESelectNamesClass ESelectNamesClass;
-typedef struct _ESelectNamesFolder ESelectNamesFolder;
-
-struct _ESelectNames
-{
- GtkDialog parent;
-
- ESourceList *source_list;
-
- /* item specific fields */
- GladeXML *gui;
-
- GHashTable *children; /* Of type char * to ESelectNamesChild */
- int child_count;
- ETableScrolled *table;
- ETableModel *adapter;
- ETableModel *without;
- EABModel *model;
- GtkWidget *categories;
- GtkWidget *select_entry;
- GtkWidget *status_message;
- char *def;
- ESelectNamesFolder *current_folder;
-
- /* signal handlers */
- gulong status_id;
- gulong search_id;
-};
-
-struct _ESelectNamesClass
-{
- GtkDialogClass parent_class;
-};
-
-
-GType e_select_names_get_type (void);
-
-GtkWidget *e_select_names_new (void);
-
-void e_select_names_add_section (ESelectNames *e_select_names,
- const char *name,
- const char *id,
- ESelectNamesModel *source);
-void e_select_names_set_default (ESelectNames *e_select_names,
- const char *id);
-
-G_END_DECLS
-
-#endif /* __E_SELECT_NAMES_H__ */
diff --git a/addressbook/gui/component/select-names/recipient.glade b/addressbook/gui/component/select-names/recipient.glade
deleted file mode 100644
index edcf6bbab0..0000000000
--- a/addressbook/gui/component/select-names/recipient.glade
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd" >
-
-<glade-interface>
- <widget class="GtkWindow" id="window1">
- <property name="visible">no</property>
- <property name="title" translatable="yes">window1</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="modal">no</property>
- <property name="allow_shrink">no</property>
- <property name="allow_grow">yes</property>
- <property name="window-position">GTK_WIN_POS_NONE</property>
-
- <child>
- <widget class="GtkHBox" id="hbox-top">
- <property name="homogeneous">no</property>
- <property name="spacing">4</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkAlignment" id="alignment1">
- <property name="xalign">1.08033e-07</property>
- <property name="yalign">0</property>
- <property name="xscale">1</property>
- <property name="yscale">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkButton" id="text-button">
- <property name="can_focus">yes</property>
- <property name="label" translatable="yes">-&gt;</property>
- <property name="visible">yes</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
-</glade-interface>
diff --git a/addressbook/gui/component/select-names/select-names.glade b/addressbook/gui/component/select-names/select-names.glade
deleted file mode 100644
index bf63b9dfa4..0000000000
--- a/addressbook/gui/component/select-names/select-names.glade
+++ /dev/null
@@ -1,435 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-<requires lib="gnome"/>
-
-<widget class="GtkDialog" id="dialog-top">
- <property name="border_width">12</property>
- <property name="title" translatable="yes">Select Names</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="default_width">417</property>
- <property name="default_height">332</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="has_separator">True</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox1">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area1">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="button4">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button5">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="table-top">
- <property name="visible">True</property>
- <property name="n_rows">3</property>
- <property name="n_columns">1</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkHSeparator" id="hseparator1">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options"></property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox5">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkTable" id="table4">
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">3</property>
-
- <child>
- <widget class="GtkLabel" id="label32">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Type a name into the entry, or
-select one from the list below:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="table-recipients">
- <property name="visible">True</property>
- <property name="n_rows">1</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label20">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Selected Contacts:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">True</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment4">
- <property name="visible">True</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xscale">1</property>
- <property name="yscale">1</property>
-
- <child>
- <widget class="GtkVBox" id="vbox6">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkHBox" id="hbox1">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkEntry" id="entry-select">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="button-find">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Find</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment3">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">1</property>
- <property name="yscale">1</property>
-
- <child>
- <widget class="Custom" id="table-source">
- <property name="visible">True</property>
- <property name="creation_function">e_addressbook_create_ebook_table</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Sat, 10 Jun 2000 22:02:57 GMT</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="status-message">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">3</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFrame" id="frame1">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkTable" id="show_contacts_table">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label30">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Folder:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label31">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Category:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment5">
- <property name="visible">True</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">1</property>
-
- <child>
- <widget class="Custom" id="custom-categories">
- <property name="visible">True</property>
- <property name="creation_function">e_select_names_create_categories</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Tue, 19 Feb 2002 23:06:24 GMT</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Show Contacts</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/addressbook/gui/contact-editor/.cvsignore b/addressbook/gui/contact-editor/.cvsignore
deleted file mode 100644
index ddbd38bb6e..0000000000
--- a/addressbook/gui/contact-editor/.cvsignore
+++ /dev/null
@@ -1,11 +0,0 @@
-.deps
-.libs
-.pure
-Makefile
-Makefile.in
-*.lo
-*.la
-contact-editor-test
-contact-editor.gladep
-e-contact-editor-marshal.c
-e-contact-editor-marshal.h
diff --git a/addressbook/gui/contact-editor/Makefile.am b/addressbook/gui/contact-editor/Makefile.am
deleted file mode 100644
index 685004dabb..0000000000
--- a/addressbook/gui/contact-editor/Makefile.am
+++ /dev/null
@@ -1,43 +0,0 @@
-INCLUDES = \
- -I$(top_srcdir) \
- -I$(top_srcdir)/addressbook/ \
- -I$(top_srcdir)/addressbook/backend \
- -I$(top_builddir)/addressbook/backend \
- -I$(top_srcdir)/addressbook/gui/merging \
- -I$(top_srcdir)/widgets/e-table \
- -I$(top_builddir)/shell \
- -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \
- -DEVOLUTION_DATADIR=\""$(datadir)"\" \
- -DEVOLUTION_IMAGESDIR=\""$(imagesdir)"\" \
- -DEVOLUTION_UIDIR=\""$(evolutionuidir)\"" \
- -DPREFIX=\""$(prefix)"\" \
- -DG_LOG_DOMAIN=\"contact-editor\" \
- $(EVOLUTION_ADDRESSBOOK_CFLAGS)
-
-noinst_LTLIBRARIES = \
- libecontacteditor.la
-
-libecontacteditor_la_SOURCES = \
- $(MARSHAL_GENERATED) \
- e-contact-editor-address.c \
- e-contact-editor-address.h \
- e-contact-editor-fullname.c \
- e-contact-editor-fullname.h \
- e-contact-editor.c \
- e-contact-editor.h \
- e-contact-quick-add.c \
- e-contact-quick-add.h
-
-MARSHAL_GENERATED = e-contact-editor-marshal.c e-contact-editor-marshal.h
-@EVO_MARSHAL_RULE@
-
-glade_DATA = \
- contact-editor.glade \
- fulladdr.glade \
- fullname.glade
-
-BUILT_SOURCES = $(MARSHAL_GENERATED)
-CLEANFILES = $(BUILT_SOURCES)
-
-EXTRA_DIST= $(glade_DATA) \
- e-contact-editor-marshal.list
diff --git a/addressbook/gui/contact-editor/contact-editor.glade b/addressbook/gui/contact-editor/contact-editor.glade
deleted file mode 100644
index 10b05c27b4..0000000000
--- a/addressbook/gui/contact-editor/contact-editor.glade
+++ /dev/null
@@ -1,2360 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-<requires lib="gnome"/>
-<requires lib="bonobo"/>
-
-<widget class="GtkDialog" id="dialog2">
- <property name="border_width">2</property>
- <property name="title" translatable="yes"></property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="has_separator">True</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox2">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area2">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="button28">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button29">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-apply</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button30">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="table2">
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">0</property>
- <property name="column_spacing">2</property>
-
- <child>
- <widget class="GtkEntry" id="entry2">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox1">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</property>
-
- <child>
- <widget class="GtkButton" id="button31">
- <property name="border_width">2</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Add</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="button32">
- <property name="border_width">2</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Delete</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow1">
- <property name="visible">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property>
- <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
- <property name="shadow_type">GTK_SHADOW_NONE</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <widget class="GtkTreeView" id="clist1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="headers_visible">True</property>
- <property name="rules_hint">False</property>
- <property name="reorderable">False</property>
- <property name="enable_search">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-<widget class="GtkDialog" id="dialog-add-phone">
- <property name="title" translatable="yes">New phone type</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="has_separator">True</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="vbox2">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">8</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="hbuttonbox1">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="button43">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Add</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button44">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFrame" id="frame-add-phone">
- <property name="border_width">4</property>
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkAlignment" id="alignment9">
- <property name="border_width">9</property>
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">1</property>
- <property name="yscale">1</property>
-
- <child>
- <widget class="GtkEntry" id="entry-add-phone">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="has_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label21">
- <property name="visible">True</property>
- <property name="label" translatable="yes">New phone type</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-<widget class="GnomeApp" id="contact editor">
- <property name="title" translatable="yes">Contact Editor</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="enable_layout_config">True</property>
-
- <child internal-child="dock">
- <widget class="BonoboDock" id="dock1">
- <property name="visible">True</property>
- <property name="allow_floating">True</property>
-
- <child>
- <widget class="GtkNotebook" id="notebook-contact-editor">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="show_tabs">True</property>
- <property name="show_border">True</property>
- <property name="tab_pos">GTK_POS_TOP</property>
- <property name="scrollable">False</property>
- <property name="enable_popup">False</property>
-
- <child>
- <widget class="GtkTable" id="table-contact-editor-general">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="n_rows">14</property>
- <property name="n_columns">8</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkEntry" id="entry-phone1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">7</property>
- <property name="right_attach">8</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-phone2">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">7</property>
- <property name="right_attach">8</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-phone3">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">7</property>
- <property name="right_attach">8</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-phone4">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">7</property>
- <property name="right_attach">8</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="button-fullname">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Full _Name...</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">3</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment3">
- <property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">1</property>
-
- <child>
- <widget class="GtkButton" id="button-email1">
- <property name="visible">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
-
- <child>
- <widget class="GtkArrow" id="arrow1">
- <property name="visible">True</property>
- <property name="arrow_type">GTK_ARROW_DOWN</property>
- <property name="shadow_type">GTK_SHADOW_OUT</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment5">
- <property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
-
- <child>
- <widget class="GtkButton" id="button-phone4">
- <property name="visible">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
-
- <child>
- <widget class="GtkArrow" id="arrow5">
- <property name="visible">True</property>
- <property name="arrow_type">GTK_ARROW_DOWN</property>
- <property name="shadow_type">GTK_SHADOW_OUT</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">6</property>
- <property name="right_attach">7</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment7">
- <property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
-
- <child>
- <widget class="GtkButton" id="button-phone2">
- <property name="visible">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
-
- <child>
- <widget class="GtkArrow" id="arrow3">
- <property name="visible">True</property>
- <property name="arrow_type">GTK_ARROW_DOWN</property>
- <property name="shadow_type">GTK_SHADOW_OUT</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">6</property>
- <property name="right_attach">7</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment8">
- <property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
-
- <child>
- <widget class="GtkButton" id="button-phone1">
- <property name="visible">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
-
- <child>
- <widget class="GtkArrow" id="arrow2">
- <property name="visible">True</property>
- <property name="arrow_type">GTK_ARROW_DOWN</property>
- <property name="shadow_type">GTK_SHADOW_OUT</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">6</property>
- <property name="right_attach">7</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHSeparator" id="hseparator4">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="left_attach">4</property>
- <property name="right_attach">8</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="y_padding">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment6">
- <property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
-
- <child>
- <widget class="GtkButton" id="button-phone3">
- <property name="visible">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
-
- <child>
- <widget class="GtkArrow" id="arrow4">
- <property name="visible">True</property>
- <property name="arrow_type">GTK_ARROW_DOWN</property>
- <property name="shadow_type">GTK_SHADOW_OUT</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">6</property>
- <property name="right_attach">7</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-fullname">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="can_focus">True</property>
- <property name="has_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-jobtitle">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-company">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-email1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHSeparator" id="hseparator5">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">4</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="y_padding">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCombo" id="combo-file-as">
- <property name="visible">True</property>
- <property name="value_in_list">False</property>
- <property name="allow_empty">True</property>
- <property name="case_sensitive">True</property>
- <property name="enable_arrow_keys">True</property>
- <property name="enable_arrows_always">False</property>
-
- <child internal-child="entry">
- <widget class="GtkEntry" id="entry-file-as">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- </child>
-
- <child internal-child="list">
- <widget class="GtkList" id="convertwidget3">
- <property name="visible">True</property>
- <property name="selection_mode">GTK_SELECTION_BROWSE</property>
-
- <child>
- <widget class="GtkListItem" id="convertwidget4">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget5">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHSeparator" id="hseparator6">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">4</property>
- <property name="top_attach">7</property>
- <property name="bottom_attach">8</property>
- <property name="y_padding">2</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment-htmlmail">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0</property>
- <property name="xscale">1</property>
- <property name="yscale">1</property>
-
- <child>
- <widget class="GtkCheckButton" id="checkbutton-htmlmail">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Wants to receive _HTML mail</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">6</property>
- <property name="bottom_attach">7</property>
- <property name="x_options">expand|shrink|fill</property>
- <property name="y_options">shrink|fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment4">
- <property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
-
- <child>
- <widget class="GtkButton" id="button-address">
- <property name="visible">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
-
- <child>
- <widget class="GtkArrow" id="arrow6">
- <property name="visible">True</property>
- <property name="arrow_type">GTK_ARROW_DOWN</property>
- <property name="shadow_type">GTK_SHADOW_OUT</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">6</property>
- <property name="right_attach">7</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEventBox" id="eventbox1">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="label-phone1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Business:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-phone1</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">5</property>
- <property name="right_attach">6</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEventBox" id="eventbox2">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="label-phone2">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Home:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-phone2</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">5</property>
- <property name="right_attach">6</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEventBox" id="eventbox3">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="label-phone3">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Business fa_x:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-phone3</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">5</property>
- <property name="right_attach">6</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEventBox" id="eventbox4">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="label-phone4">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Mobile:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-phone4</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">5</property>
- <property name="right_attach">6</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEventBox" id="eventbox5">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="label-email1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Primary _email:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-email1</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEventBox" id="eventbox-business">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="label-address">
- <property name="visible">True</property>
- <property name="label" translatable="yes"> B_usiness:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">text-address</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">5</property>
- <property name="right_attach">6</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment2">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
-
- <child>
- <widget class="GtkCheckButton" id="checkbutton-mailingaddress">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_This is the mailing address</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">7</property>
- <property name="right_attach">8</property>
- <property name="top_attach">9</property>
- <property name="bottom_attach">10</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHSeparator" id="hseparator9">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">4</property>
- <property name="top_attach">11</property>
- <property name="bottom_attach">12</property>
- <property name="y_padding">2</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHSeparator" id="hseparator10">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="left_attach">4</property>
- <property name="right_attach">8</property>
- <property name="top_attach">11</property>
- <property name="bottom_attach">12</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEventBox" id="eventbox7">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="label-jobtitle">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Job title:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-jobtitle</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="custom1">
- <property name="visible">True</property>
- <property name="creation_function">e_create_image_widget</property>
- <property name="string1">malehead.png</property>
- <property name="string2"></property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Thu, 18 May 2000 12:19:47 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="custom2">
- <property name="visible">True</property>
- <property name="creation_function">e_create_image_widget</property>
- <property name="string1">cellphone.png</property>
- <property name="string2"></property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Thu, 18 May 2000 12:20:02 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">4</property>
- <property name="right_attach">5</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="custom3">
- <property name="visible">True</property>
- <property name="creation_function">e_create_image_widget</property>
- <property name="string1">envelope.png</property>
- <property name="string2"></property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Thu, 18 May 2000 12:19:51 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">7</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="custom4">
- <property name="visible">True</property>
- <property name="creation_function">e_create_image_widget</property>
- <property name="string1">house.png</property>
- <property name="string2"></property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Thu, 18 May 2000 12:20:06 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">4</property>
- <property name="right_attach">5</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">10</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="custom10">
- <property name="visible">True</property>
- <property name="creation_function">e_create_image_widget</property>
- <property name="string1">globe.png</property>
- <property name="string2"></property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Thu, 18 May 2000 12:19:56 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">8</property>
- <property name="bottom_attach">10</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-company">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Organi_zation:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-company</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">3</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="button-fulladdr">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">A_ddress...</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- <packing>
- <property name="left_attach">5</property>
- <property name="right_attach">7</property>
- <property name="top_attach">6</property>
- <property name="bottom_attach">7</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="accellabel-fileas">
- <property name="visible">True</property>
- <property name="label" translatable="yes">File a_s:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-file-as</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">3</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="accellabel-web">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Web page address:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-web</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">3</property>
- <property name="top_attach">8</property>
- <property name="bottom_attach">9</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment16">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">1</property>
- <property name="yscale">0</property>
-
- <child>
- <widget class="GtkButton" id="button-categories">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Categories...</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">3</property>
- <property name="top_attach">12</property>
- <property name="bottom_attach">13</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="custom6">
- <property name="visible">True</property>
- <property name="creation_function">e_create_image_widget</property>
- <property name="string1">briefcase.png</property>
- <property name="string2"></property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Thu, 18 May 2000 12:20:09 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">12</property>
- <property name="bottom_attach">14</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment19">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">1</property>
- <property name="yscale">0</property>
-
- <child>
- <widget class="GtkEntry" id="entry-categories">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">12</property>
- <property name="bottom_attach">13</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow3">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <widget class="GtkTextView" id="text-address">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="justification">GTK_JUSTIFY_LEFT</property>
- <property name="wrap_mode">GTK_WRAP_WORD</property>
- <property name="cursor_visible">True</property>
- <property name="pixels_above_lines">0</property>
- <property name="pixels_below_lines">0</property>
- <property name="pixels_inside_wrap">0</property>
- <property name="left_margin">0</property>
- <property name="right_margin">0</property>
- <property name="indent">0</property>
- <property name="text" translatable="yes"></property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">7</property>
- <property name="right_attach">8</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">9</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="entry-web">
- <property name="visible">True</property>
- <property name="creation_function">e_contact_editor_create_web</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Sat, 08 Feb 2003 09:14:46 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">8</property>
- <property name="bottom_attach">9</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="accellabel-blog">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Blog address:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-web</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">3</property>
- <property name="top_attach">9</property>
- <property name="bottom_attach">10</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="entry-blog">
- <property name="visible">True</property>
- <property name="creation_function">e_contact_editor_create_web</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Sat, 08 Feb 2003 09:14:46 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">9</property>
- <property name="bottom_attach">10</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label15">
- <property name="visible">True</property>
- <property name="label" translatable="yes">General</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="table-contact-editor-details">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="n_rows">9</property>
- <property name="n_columns">6</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label-department">
- <property name="visible">True</property>
- <property name="label" translatable="yes">D_epartment:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-department</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-office">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Office:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-office</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-profession">
- <property name="visible">True</property>
- <property name="label" translatable="yes">P_rofession:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-profession</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-nickname">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Nickname:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-nickname</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-spouse">
- <property name="visible">True</property>
- <property name="label" translatable="yes">S_pouse:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-spouse</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-birthday">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Birthda_y:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">dateedit-birthday</property>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-assistant">
- <property name="visible">True</property>
- <property name="label" translatable="yes">A_ssistant's name:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-assistant</property>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-manager">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Manager's name:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-manager</property>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-anniversary">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Anni_versary:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">dateedit-anniversary</property>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-spouse">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-department">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-office">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-profession">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-nickname">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-assistant">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">4</property>
- <property name="right_attach">6</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-manager">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">4</property>
- <property name="right_attach">6</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHSeparator" id="hseparator7">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">6</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="y_padding">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-comments">
- <property name="visible">True</property>
- <property name="label" translatable="yes">No_tes:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">text-comments</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">7</property>
- <property name="bottom_attach">8</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHSeparator" id="hseparator8">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">6</property>
- <property name="top_attach">6</property>
- <property name="bottom_attach">7</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="custom7">
- <property name="visible">True</property>
- <property name="creation_function">e_create_image_widget</property>
- <property name="string1">briefcase.png</property>
- <property name="string2"></property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Thu, 18 May 2000 12:20:13 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="custom8">
- <property name="visible">True</property>
- <property name="creation_function">e_create_image_widget</property>
- <property name="string1">malehead.png</property>
- <property name="string2"></property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Thu, 18 May 2000 12:20:16 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">6</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow2">
- <property name="visible">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <widget class="GtkTextView" id="text-comments">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="justification">GTK_JUSTIFY_LEFT</property>
- <property name="wrap_mode">GTK_WRAP_WORD</property>
- <property name="cursor_visible">True</property>
- <property name="pixels_above_lines">0</property>
- <property name="pixels_below_lines">0</property>
- <property name="pixels_inside_wrap">0</property>
- <property name="left_margin">0</property>
- <property name="right_margin">0</property>
- <property name="indent">0</property>
- <property name="text" translatable="yes"></property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">6</property>
- <property name="top_attach">8</property>
- <property name="bottom_attach">9</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="custom9">
- <property name="visible">True</property>
- <property name="creation_function">e_create_image_widget</property>
- <property name="string1">globe.png</property>
- <property name="string2"></property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Thu, 18 May 2000 12:20:19 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">7</property>
- <property name="bottom_attach">9</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="dateedit-birthday">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="creation_function">e_contact_editor_create_date</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Tue, 05 Jun 2001 02:36:27 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">4</property>
- <property name="right_attach">6</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="dateedit-anniversary">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="creation_function">e_contact_editor_create_date</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Tue, 05 Jun 2001 02:36:32 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">4</property>
- <property name="right_attach">6</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label16">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Details</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox3">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkHBox" id="hbox1">
- <property name="border_width">7</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="Custom" id="custom12">
- <property name="visible">True</property>
- <property name="creation_function">e_create_image_widget</property>
- <property name="string1">globe.png</property>
- <property name="string2"></property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Thu, 18 May 2000 12:20:13 GMT</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label24">
- <property name="visible">True</property>
- <property name="label" translatable="yes">If this person publishes free/busy or other calendar information on the Internet, enter the address
-of that information here.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment18">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0.75</property>
- <property name="yscale">1</property>
-
- <child>
- <widget class="GtkTable" id="table-contact-editor-collaboration">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label-caluri">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Public Calendar URL:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-caluri</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-fburl">
- <property name="visible">True</property>
- <property name="label" translatable="yes">F_ree/Busy URL:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-fburl</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="entry-caluri">
- <property name="visible">True</property>
- <property name="creation_function">e_contact_editor_create_web</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Mon, 10 Feb 2003 20:37:57 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="entry-fburl">
- <property name="visible">True</property>
- <property name="creation_function">e_contact_editor_create_web</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Mon, 10 Feb 2003 20:38:00 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label21">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Collaboration</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child internal-child="appbar">
- <widget class="GnomeAppBar" id="appbar1">
- <property name="visible">True</property>
- <property name="has_progress">True</property>
- <property name="has_status">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/addressbook/gui/contact-editor/e-contact-editor-address.c b/addressbook/gui/contact-editor/e-contact-editor-address.c
deleted file mode 100644
index 34977e3fb7..0000000000
--- a/addressbook/gui/contact-editor/e-contact-editor-address.c
+++ /dev/null
@@ -1,620 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-contact-editor-address.c
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-
-#include <e-contact-editor-address.h>
-
-#include <glib.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnomeui/gnome-window-icon.h>
-#include <libgnome/gnome-util.h>
-#include <gal/widgets/e-gui-utils.h>
-#include <gtk/gtkcombo.h>
-#include <gtk/gtkentry.h>
-#include <gtk/gtkstock.h>
-#include <gtk/gtklabel.h>
-#include <string.h>
-#include <stdlib.h>
-#include <locale.h>
-
-static void e_contact_editor_address_init (EContactEditorAddress *card);
-static void e_contact_editor_address_class_init (EContactEditorAddressClass *klass);
-static void e_contact_editor_address_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static void e_contact_editor_address_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
-static void e_contact_editor_address_dispose (GObject *object);
-
-static void fill_in_info(EContactEditorAddress *editor);
-static void extract_info(EContactEditorAddress *editor);
-
-static GtkDialogClass *parent_class = NULL;
-
-/* The arguments we take */
-enum {
- PROP_0,
- PROP_ADDRESS,
- PROP_EDITABLE
-};
-
-GType
-e_contact_editor_address_get_type (void)
-{
- static GType contact_editor_address_type = 0;
-
- if (!contact_editor_address_type) {
- static const GTypeInfo contact_editor_address_info = {
- sizeof (EContactEditorAddressClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_contact_editor_address_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EContactEditorAddress),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_contact_editor_address_init,
- };
-
- contact_editor_address_type = g_type_register_static (GTK_TYPE_DIALOG, "EContactEditorAddress", &contact_editor_address_info, 0);
- }
-
- return contact_editor_address_type;
-}
-
-static void
-e_contact_editor_address_class_init (EContactEditorAddressClass *klass)
-{
- GObjectClass *object_class;
-
- object_class = G_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_ref (GTK_TYPE_DIALOG);
-
- object_class->set_property = e_contact_editor_address_set_property;
- object_class->get_property = e_contact_editor_address_get_property;
- object_class->dispose = e_contact_editor_address_dispose;
-
- g_object_class_install_property (object_class, PROP_ADDRESS,
- g_param_spec_pointer ("address",
- _("Address"),
- /*_( */"XXX blurb" /*)*/,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_EDITABLE,
- g_param_spec_boolean ("editable",
- _("Editable"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-}
-
-static GList *
-add_to_tab_order(GList *list, GladeXML *gui, char *name)
-{
- GtkWidget *widget = glade_xml_get_widget(gui, name);
- return g_list_prepend(list, widget);
-}
-
-static void
-setup_tab_order(GladeXML *gui)
-{
- GtkWidget *container;
- GList *list = NULL;
-
- container = glade_xml_get_widget(gui, "table-checkaddress");
-
- if (container) {
- list = add_to_tab_order(list, gui, "entry-city");
- list = add_to_tab_order(list, gui, "entry-region");
- list = add_to_tab_order(list, gui, "entry-code");
- list = add_to_tab_order(list, gui, "combo-country");
- list = g_list_reverse(list);
- e_container_change_tab_order(GTK_CONTAINER(container), list);
- g_list_free(list);
- }
-}
-
-static char * countries [] = {
- N_("United States"),
- N_("Afghanistan"),
- N_("Albania"),
- N_("Algeria"),
- N_("American Samoa"),
- N_("Andorra"),
- N_("Angola"),
- N_("Anguilla"),
- N_("Antarctica"),
- N_("Antigua And Barbuda"),
- N_("Argentina"),
- N_("Armenia"),
- N_("Aruba"),
- N_("Australia"),
- N_("Austria"),
- N_("Azerbaijan"),
- N_("Bahamas"),
- N_("Bahrain"),
- N_("Bangladesh"),
- N_("Barbados"),
- N_("Belarus"),
- N_("Belgium"),
- N_("Belize"),
- N_("Benin"),
- N_("Bermuda"),
- N_("Bhutan"),
- N_("Bolivia"),
- N_("Bosnia And Herzegowina"),
- N_("Botswana"),
- N_("Bouvet Island"),
- N_("Brazil"),
- N_("British Indian Ocean Territory"),
- N_("Brunei Darussalam"),
- N_("Bulgaria"),
- N_("Burkina Faso"),
- N_("Burundi"),
- N_("Cambodia"),
- N_("Cameroon"),
- N_("Canada"),
- N_("Cape Verde"),
- N_("Cayman Islands"),
- N_("Central African Republic"),
- N_("Chad"),
- N_("Chile"),
- N_("China"),
- N_("Christmas Island"),
- N_("Cocos (Keeling) Islands"),
- N_("Colombia"),
- N_("Comoros"),
- N_("Congo"),
- N_("Congo"),
- N_("Cook Islands"),
- N_("Costa Rica"),
- N_("Cote d'Ivoire"),
- N_("Croatia"),
- N_("Cuba"),
- N_("Cyprus"),
- N_("Czech Republic"),
- N_("Denmark"),
- N_("Djibouti"),
- N_("Dominica"),
- N_("Dominican Republic"),
- N_("East Timor"),
- N_("Ecuador"),
- N_("Egypt"),
- N_("El Salvador"),
- N_("Equatorial Guinea"),
- N_("Eritrea"),
- N_("Estonia"),
- N_("Ethiopia"),
- N_("Falkland Islands"),
- N_("Faroe Islands"),
- N_("Fiji"),
- N_("Finland"),
- N_("France"),
- N_("French Guiana"),
- N_("French Polynesia"),
- N_("French Southern Territories"),
- N_("Gabon"),
- N_("Gambia"),
- N_("Georgia"),
- N_("Germany"),
- N_("Ghana"),
- N_("Gibraltar"),
- N_("Greece"),
- N_("Greenland"),
- N_("Grenada"),
- N_("Guadeloupe"),
- N_("Guam"),
- N_("Guatemala"),
- N_("Guinea"),
- N_("Guinea-bissau"),
- N_("Guyana"),
- N_("Haiti"),
- N_("Heard And McDonald Islands"),
- N_("Holy See"),
- N_("Honduras"),
- N_("Hong Kong"),
- N_("Hungary"),
- N_("Iceland"),
- N_("India"),
- N_("Indonesia"),
- N_("Ireland"),
- N_("Israel"),
- N_("Italy"),
- N_("Jamaica"),
- N_("Japan"),
- N_("Jordan"),
- N_("Kazakhstan"),
- N_("Kenya"),
- N_("Kiribati"),
- N_("Korea, Republic Of"),
- N_("Kuwait"),
- N_("Kyrgyzstan"),
- N_("Laos"),
- N_("Latvia"),
- N_("Lebanon"),
- N_("Lesotho"),
- N_("Liberia"),
- N_("Liechtenstein"),
- N_("Lithuania"),
- N_("Luxembourg"),
- N_("Macau"),
- N_("Macedonia"),
- N_("Madagascar"),
- N_("Malawi"),
- N_("Malaysia"),
- N_("Maldives"),
- N_("Mali"),
- N_("Malta"),
- N_("Marshall Islands"),
- N_("Martinique"),
- N_("Mauritania"),
- N_("Mauritius"),
- N_("Mayotte"),
- N_("Mexico"),
- N_("Micronesia"),
- N_("Moldova, Republic Of"),
- N_("Monaco"),
- N_("Mongolia"),
- N_("Montserrat"),
- N_("Morocco"),
- N_("Mozambique"),
- N_("Myanmar"),
- N_("Namibia"),
- N_("Nauru"),
- N_("Nepal"),
- N_("Netherlands"),
- N_("Netherlands Antilles"),
- N_("New Caledonia"),
- N_("New Zealand"),
- N_("Nicaragua"),
- N_("Niger"),
- N_("Nigeria"),
- N_("Niue"),
- N_("Norfolk Island"),
- N_("Northern Mariana Islands"),
- N_("Norway"),
- N_("Oman"),
- N_("Pakistan"),
- N_("Palau"),
- N_("Palestinian Territory"),
- N_("Panama"),
- N_("Papua New Guinea"),
- N_("Paraguay"),
- N_("Peru"),
- N_("Philippines"),
- N_("Pitcairn"),
- N_("Poland"),
- N_("Portugal"),
- N_("Puerto Rico"),
- N_("Qatar"),
- N_("Reunion"),
- N_("Romania"),
- N_("Russian Federation"),
- N_("Rwanda"),
- N_("Saint Kitts And Nevis"),
- N_("Saint Lucia"),
- N_("Saint Vincent And The Grena-dines"),
- N_("Samoa"),
- N_("San Marino"),
- N_("Sao Tome And Principe"),
- N_("Saudi Arabia"),
- N_("Senegal"),
- N_("Seychelles"),
- N_("Sierra Leone"),
- N_("Singapore"),
- N_("Slovakia"),
- N_("Slovenia"),
- N_("Solomon Islands"),
- N_("Somalia"),
- N_("South Africa"),
- N_("South Georgia And The South Sandwich Islands"),
- N_("Spain"),
- N_("Sri Lanka"),
- N_("St. Helena"),
- N_("St. Pierre And Miquelon"),
- N_("Sudan"),
- N_("Suriname"),
- N_("Svalbard And Jan Mayen Islands"),
- N_("Swaziland"),
- N_("Sweden"),
- N_("Switzerland"),
- N_("Taiwan"),
- N_("Tajikistan"),
- N_("Tanzania, United Republic Of"),
- N_("Thailand"),
- N_("Togo"),
- N_("Tokelau"),
- N_("Tonga"),
- N_("Trinidad And Tobago"),
- N_("Tunisia"),
- N_("Turkey"),
- N_("Turkmenistan"),
- N_("Turks And Caicos Islands"),
- N_("Tuvalu"),
- N_("Uganda"),
- N_("Ukraine"),
- N_("United Arab Emirates"),
- N_("United Kingdom"),
- N_("United States Minor Outlying Islands"),
- N_("Uruguay"),
- N_("Uzbekistan"),
- N_("Vanuatu"),
- N_("Venezuela"),
- N_("Viet Nam"),
- N_("Virgin Islands, British"),
- N_("Virgin Islands, U.S."),
- N_("Wallis And Futuna Islands"),
- N_("Western Sahara"),
- N_("Yemen"),
- N_("Yugoslavia"),
- N_("Zambia"),
- N_("Zimbabwe"),
- NULL
-};
-
-static int
-compare_func (const void *voida, const void *voidb)
-{
- char * const *stringa = voida, * const *stringb = voidb;
-
- return strcoll (*stringa, *stringb);
-}
-
-static void
-fill_in_countries (GladeXML *gui)
-{
- GtkCombo *combo;
- combo = (GtkCombo *) glade_xml_get_widget(gui, "combo-country");
- if (combo && GTK_IS_COMBO (combo)) {
- static gboolean sorted = FALSE;
- static GList *country_list;
- if (!sorted) {
- int i;
- char *locale;
-
- for (i = 0; countries[i]; i++) {
- countries[i] = _(countries[i]);
- }
-
- locale = setlocale (LC_COLLATE, NULL);
- qsort (countries + 1, i - 1, sizeof (countries[0]), compare_func);
- country_list = NULL;
- for (i = 0; countries[i]; i++) {
- country_list = g_list_prepend (country_list, countries[i]);
- }
- country_list = g_list_reverse (country_list);
- sorted = TRUE;
- }
- gtk_combo_set_popdown_strings (combo, country_list);
- }
-}
-
-static void
-e_contact_editor_address_init (EContactEditorAddress *e_contact_editor_address)
-{
- GladeXML *gui;
- GtkWidget *widget;
- char *icon_path;
-
- gtk_dialog_add_buttons (GTK_DIALOG (e_contact_editor_address),
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OK, GTK_RESPONSE_OK,
- NULL);
-
- gtk_window_set_resizable(GTK_WINDOW(e_contact_editor_address), TRUE);
-
-#if notyet
- e_contact_editor_address->address = NULL;
-#endif
-
- gui = glade_xml_new (EVOLUTION_GLADEDIR "/fulladdr.glade", NULL, NULL);
- e_contact_editor_address->gui = gui;
-
- setup_tab_order (gui);
- fill_in_countries (gui);
-
- widget = glade_xml_get_widget(gui, "dialog-checkaddress");
- gtk_window_set_title (GTK_WINDOW (e_contact_editor_address),
- GTK_WINDOW (widget)->title);
-
- widget = glade_xml_get_widget(gui, "table-checkaddress");
- g_object_ref(widget);
- gtk_container_remove(GTK_CONTAINER(widget->parent), widget);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (e_contact_editor_address)->vbox), widget, TRUE, TRUE, 0);
- g_object_unref(widget);
-
- icon_path = g_concat_dir_and_file (EVOLUTION_IMAGESDIR, "evolution-contacts-mini.png");
- gnome_window_icon_set_from_file (GTK_WINDOW (e_contact_editor_address), icon_path);
- g_free (icon_path);
-}
-
-void
-e_contact_editor_address_dispose (GObject *object)
-{
- EContactEditorAddress *e_contact_editor_address = E_CONTACT_EDITOR_ADDRESS(object);
-
- if (e_contact_editor_address->gui) {
- g_object_unref(e_contact_editor_address->gui);
- e_contact_editor_address->gui = NULL;
- }
-
-#if notyet
- if (e_contact_editor_address->address) {
- e_card_delivery_address_unref(e_contact_editor_address->address);
- e_contact_editor_address->address = NULL;
- }
-#endif
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- (* G_OBJECT_CLASS (parent_class)->dispose) (object);
-}
-
-GtkWidget*
-e_contact_editor_address_new (/* XXX notyet const ECardDeliveryAddress *address*/)
-{
- GtkWidget *widget = g_object_new (E_TYPE_CONTACT_EDITOR_ADDRESS, NULL);
-#if notyet
- g_object_set (widget,
- "address", address,
- NULL);
-#endif
- return widget;
-}
-
-static void
-e_contact_editor_address_set_property (GObject *object, guint prop_id,
- const GValue *value, GParamSpec *pspec)
-{
- EContactEditorAddress *e_contact_editor_address;
-
- e_contact_editor_address = E_CONTACT_EDITOR_ADDRESS (object);
-
- switch (prop_id){
- case PROP_ADDRESS:
-#if notyet
- e_card_delivery_address_unref(e_contact_editor_address->address);
- e_contact_editor_address->address = e_card_delivery_address_copy(g_value_get_pointer (value));
- fill_in_info(e_contact_editor_address);
-#endif
- break;
- case PROP_EDITABLE: {
- int i;
- char *widget_names[] = {
- "entry-street",
- "entry-city",
- "entry-ext",
- "entry-po",
- "entry-region",
- "combo-country",
- "entry-code",
- "label-street",
- "label-city",
- "label-ext",
- "label-po",
- "label-region",
- "label-country",
- "label-code",
- NULL
- };
- e_contact_editor_address->editable = g_value_get_boolean (value) ? TRUE : FALSE;
- for (i = 0; widget_names[i] != NULL; i ++) {
- GtkWidget *w = glade_xml_get_widget(e_contact_editor_address->gui, widget_names[i]);
- if (GTK_IS_ENTRY (w)) {
- gtk_editable_set_editable (GTK_EDITABLE (w),
- e_contact_editor_address->editable);
- }
- else if (GTK_IS_COMBO (w)) {
- gtk_editable_set_editable (GTK_EDITABLE (GTK_COMBO (w)->entry),
- e_contact_editor_address->editable);
- gtk_widget_set_sensitive (GTK_COMBO (w)->button, e_contact_editor_address->editable);
- }
- else if (GTK_IS_LABEL (w)) {
- gtk_widget_set_sensitive (w, e_contact_editor_address->editable);
- }
- }
- break;
- }
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-e_contact_editor_address_get_property (GObject *object, guint prop_id,
- GValue *value, GParamSpec *pspec)
-{
- EContactEditorAddress *e_contact_editor_address;
-
- e_contact_editor_address = E_CONTACT_EDITOR_ADDRESS (object);
-
- switch (prop_id) {
- case PROP_ADDRESS:
- extract_info(e_contact_editor_address);
-#if notyet
- g_value_set_pointer (value, e_card_delivery_address_ref(e_contact_editor_address->address));
-#endif
- break;
- case PROP_EDITABLE:
- g_value_set_boolean (value, e_contact_editor_address->editable ? TRUE : FALSE);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-fill_in_field(EContactEditorAddress *editor, char *field, char *string)
-{
- GtkEntry *entry = GTK_ENTRY(glade_xml_get_widget(editor->gui, field));
- if (entry) {
- if (string)
- gtk_entry_set_text(entry, string);
- else
- gtk_entry_set_text(entry, "");
- }
-}
-
-static void
-fill_in_info(EContactEditorAddress *editor)
-{
-#if notyet
- ECardDeliveryAddress *address = editor->address;
- if (address) {
- fill_in_field(editor, "entry-street" , address->street );
- fill_in_field(editor, "entry-po" , address->po );
- fill_in_field(editor, "entry-ext" , address->ext );
- fill_in_field(editor, "entry-city" , address->city );
- fill_in_field(editor, "entry-region" , address->region );
- fill_in_field(editor, "entry-code" , address->code );
- fill_in_field(editor, "entry-country", address->country);
- }
-#endif
-}
-
-static char *
-extract_field(EContactEditorAddress *editor, char *field)
-{
- GtkEntry *entry = GTK_ENTRY(glade_xml_get_widget(editor->gui, field));
- if (entry)
- return g_strdup (gtk_entry_get_text(entry));
- else
- return NULL;
-}
-
-static void
-extract_info(EContactEditorAddress *editor)
-{
-#if notyet
- ECardDeliveryAddress *address = editor->address;
- if (!address) {
- address = e_card_delivery_address_new();
- editor->address = address;
- }
- address->street = extract_field(editor, "entry-street" );
- address->po = extract_field(editor, "entry-po" );
- address->ext = extract_field(editor, "entry-ext" );
- address->city = extract_field(editor, "entry-city" );
- address->region = extract_field(editor, "entry-region" );
- address->code = extract_field(editor, "entry-code" );
- address->country = extract_field(editor, "entry-country");
-#endif
-}
diff --git a/addressbook/gui/contact-editor/e-contact-editor-address.h b/addressbook/gui/contact-editor/e-contact-editor-address.h
deleted file mode 100644
index 893a2ea2f7..0000000000
--- a/addressbook/gui/contact-editor/e-contact-editor-address.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* e-contact-editor-address.h
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-#ifndef __E_CONTACT_EDITOR_ADDRESS_H__
-#define __E_CONTACT_EDITOR_ADDRESS_H__
-
-#include <gtk/gtkdialog.h>
-#include <glade/glade.h>
-#include <libebook/e-contact.h>
-
-G_BEGIN_DECLS
-
-/* EContactEditorAddress - A dialog displaying information about a contact.
- *
- * The following arguments are available:
- *
- * name type read/write description
- * --------------------------------------------------------------------------------
- * name ECardName * RW The card currently being edited. Returns a copy.
- */
-
-#define E_TYPE_CONTACT_EDITOR_ADDRESS (e_contact_editor_address_get_type ())
-#define E_CONTACT_EDITOR_ADDRESS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_CONTACT_EDITOR_ADDRESS, EContactEditorAddress))
-#define E_CONTACT_EDITOR_ADDRESS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_CONTACT_EDITOR_ADDRESS, EContactEditorAddressClass))
-#define E_IS_CONTACT_EDITOR_ADDRESS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_CONTACT_EDITOR_ADDRESS))
-#define E_IS_CONTACT_EDITOR_ADDRESS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_CONTACT_EDITOR_ADDRESS))
-
-
-typedef struct _EContactEditorAddress EContactEditorAddress;
-typedef struct _EContactEditorAddressClass EContactEditorAddressClass;
-
-struct _EContactEditorAddress
-{
- GtkDialog parent;
-
-#if notyet
- /* item specific fields */
- ECardDeliveryAddress *address;
-#endif
-
- guint editable : 1;
-
- GladeXML *gui;
-};
-
-struct _EContactEditorAddressClass
-{
- GtkDialogClass parent_class;
-};
-
-
-GtkWidget *e_contact_editor_address_new(/* XXX not yet const ECardDeliveryAddress *name*/);
-GType e_contact_editor_address_get_type (void);
-
-G_END_DECLS
-
-#endif /* __E_CONTACT_EDITOR_ADDRESS_H__ */
diff --git a/addressbook/gui/contact-editor/e-contact-editor-fullname.c b/addressbook/gui/contact-editor/e-contact-editor-fullname.c
deleted file mode 100644
index c37f4cc8b7..0000000000
--- a/addressbook/gui/contact-editor/e-contact-editor-fullname.c
+++ /dev/null
@@ -1,287 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * eab-contact-editor-phones.c
- * Copyright (C) 2003 Ximian, Inc.
- * Author: Chris Toshok <toshok@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-#include "e-contact-editor-fullname.h"
-#include <libgnomeui/gnome-window-icon.h>
-#include <libgnome/gnome-util.h>
-#include <libgnome/gnome-i18n.h>
-#include <gtk/gtkcombo.h>
-#include <gtk/gtkstock.h>
-#include <gtk/gtkentry.h>
-#include <gtk/gtklabel.h>
-
-static void e_contact_editor_fullname_init (EContactEditorFullname *card);
-static void e_contact_editor_fullname_class_init (EContactEditorFullnameClass *klass);
-static void e_contact_editor_fullname_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static void e_contact_editor_fullname_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
-static void e_contact_editor_fullname_dispose (GObject *object);
-
-static void fill_in_info(EContactEditorFullname *editor);
-static void extract_info(EContactEditorFullname *editor);
-
-static GtkDialogClass *parent_class = NULL;
-
-/* The arguments we take */
-enum {
- PROP_0,
- PROP_NAME,
- PROP_EDITABLE
-};
-
-GType
-e_contact_editor_fullname_get_type (void)
-{
- static GType contact_editor_fullname_type = 0;
-
- if (!contact_editor_fullname_type) {
- static const GTypeInfo contact_editor_fullname_info = {
- sizeof (EContactEditorFullnameClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_contact_editor_fullname_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EContactEditorFullname),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_contact_editor_fullname_init,
- };
-
- contact_editor_fullname_type = g_type_register_static (GTK_TYPE_DIALOG, "EContactEditorFullname", &contact_editor_fullname_info, 0);
- }
-
- return contact_editor_fullname_type;
-}
-
-static void
-e_contact_editor_fullname_class_init (EContactEditorFullnameClass *klass)
-{
- GObjectClass *object_class;
-
- object_class = G_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_ref (GTK_TYPE_DIALOG);
-
- object_class->set_property = e_contact_editor_fullname_set_property;
- object_class->get_property = e_contact_editor_fullname_get_property;
- object_class->dispose = e_contact_editor_fullname_dispose;
-
- g_object_class_install_property (object_class, PROP_NAME,
- g_param_spec_pointer ("name",
- _("Name"),
- /*_( */"XXX blurb" /*)*/,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_EDITABLE,
- g_param_spec_boolean ("editable",
- _("Editable"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-}
-
-static void
-e_contact_editor_fullname_init (EContactEditorFullname *e_contact_editor_fullname)
-{
- GladeXML *gui;
- GtkWidget *widget;
- char *icon_path;
-
- gtk_dialog_add_buttons (GTK_DIALOG (e_contact_editor_fullname),
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OK, GTK_RESPONSE_OK,
- NULL);
-
- gtk_window_set_resizable(GTK_WINDOW(e_contact_editor_fullname), TRUE);
-
- e_contact_editor_fullname->name = NULL;
- gui = glade_xml_new (EVOLUTION_GLADEDIR "/fullname.glade", NULL, NULL);
- e_contact_editor_fullname->gui = gui;
-
- widget = glade_xml_get_widget(gui, "dialog-checkfullname");
- gtk_window_set_title (GTK_WINDOW (e_contact_editor_fullname),
- GTK_WINDOW (widget)->title);
-
- widget = glade_xml_get_widget(gui, "table-checkfullname");
- g_object_ref(widget);
- gtk_container_remove(GTK_CONTAINER(widget->parent), widget);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (e_contact_editor_fullname)->vbox), widget, TRUE, TRUE, 0);
- g_object_unref(widget);
-
- icon_path = g_concat_dir_and_file (EVOLUTION_IMAGESDIR, "evolution-contacts-mini.png");
- gnome_window_icon_set_from_file (GTK_WINDOW (e_contact_editor_fullname), icon_path);
- g_free (icon_path);
-}
-
-void
-e_contact_editor_fullname_dispose (GObject *object)
-{
- EContactEditorFullname *e_contact_editor_fullname = E_CONTACT_EDITOR_FULLNAME(object);
-
- if (e_contact_editor_fullname->gui) {
- g_object_unref(e_contact_editor_fullname->gui);
- e_contact_editor_fullname->gui = NULL;
- }
-
- if (e_contact_editor_fullname->name) {
- e_contact_name_free(e_contact_editor_fullname->name);
- e_contact_editor_fullname->name = NULL;
- }
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- (* G_OBJECT_CLASS (parent_class)->dispose) (object);
-}
-
-GtkWidget*
-e_contact_editor_fullname_new (const EContactName *name)
-{
- GtkWidget *widget = g_object_new (E_TYPE_CONTACT_EDITOR_FULLNAME, NULL);
- g_object_set (widget,
- "name", name,
- NULL);
- return widget;
-}
-
-static void
-e_contact_editor_fullname_set_property (GObject *object, guint prop_id,
- const GValue *value, GParamSpec *pspec)
-{
- EContactEditorFullname *e_contact_editor_fullname;
-
- e_contact_editor_fullname = E_CONTACT_EDITOR_FULLNAME (object);
-
- switch (prop_id){
- case PROP_NAME:
- e_contact_name_free(e_contact_editor_fullname->name);
- e_contact_editor_fullname->name = e_contact_name_copy(g_value_get_pointer (value));
- fill_in_info(e_contact_editor_fullname);
- break;
- case PROP_EDITABLE: {
- int i;
- char *widget_names[] = {
- "combo-title",
- "combo-suffix",
- "entry-first",
- "entry-middle",
- "entry-last",
- "label-title",
- "label-suffix",
- "label-first",
- "label-middle",
- "label-last",
- NULL
- };
- e_contact_editor_fullname->editable = g_value_get_boolean (value) ? TRUE : FALSE;
- for (i = 0; widget_names[i] != NULL; i ++) {
- GtkWidget *w = glade_xml_get_widget(e_contact_editor_fullname->gui, widget_names[i]);
- if (GTK_IS_ENTRY (w)) {
- gtk_editable_set_editable (GTK_EDITABLE (w),
- e_contact_editor_fullname->editable);
- }
- else if (GTK_IS_COMBO (w)) {
- gtk_editable_set_editable (GTK_EDITABLE (GTK_COMBO (w)->entry),
- e_contact_editor_fullname->editable);
- gtk_widget_set_sensitive (GTK_COMBO (w)->button, e_contact_editor_fullname->editable);
- }
- else if (GTK_IS_LABEL (w)) {
- gtk_widget_set_sensitive (w, e_contact_editor_fullname->editable);
- }
- }
- break;
- }
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-e_contact_editor_fullname_get_property (GObject *object, guint prop_id,
- GValue *value, GParamSpec *pspec)
-{
- EContactEditorFullname *e_contact_editor_fullname;
-
- e_contact_editor_fullname = E_CONTACT_EDITOR_FULLNAME (object);
-
- switch (prop_id) {
- case PROP_NAME:
- extract_info(e_contact_editor_fullname);
- g_value_set_pointer (value, e_contact_name_copy(e_contact_editor_fullname->name));
- break;
- case PROP_EDITABLE:
- g_value_set_boolean (value, e_contact_editor_fullname->editable ? TRUE : FALSE);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-fill_in_field(EContactEditorFullname *editor, char *field, char *string)
-{
- GtkEntry *entry = GTK_ENTRY(glade_xml_get_widget(editor->gui, field));
- if (entry) {
- if (string)
- gtk_entry_set_text(entry, string);
- else
- gtk_entry_set_text(entry, "");
- }
-}
-
-static void
-fill_in_info(EContactEditorFullname *editor)
-{
- EContactName *name = editor->name;
- if (name) {
- fill_in_field(editor, "entry-title", name->prefixes);
- fill_in_field(editor, "entry-first", name->given);
- fill_in_field(editor, "entry-middle", name->additional);
- fill_in_field(editor, "entry-last", name->family);
- fill_in_field(editor, "entry-suffix", name->suffixes);
- }
-}
-
-static char *
-extract_field(EContactEditorFullname *editor, char *field)
-{
- GtkEntry *entry = GTK_ENTRY(glade_xml_get_widget(editor->gui, field));
- if (entry)
- return g_strdup (gtk_entry_get_text(entry));
- else
- return NULL;
-}
-
-static void
-extract_info(EContactEditorFullname *editor)
-{
- EContactName *name = editor->name;
- if (!name) {
- name = e_contact_name_new();
- editor->name = name;
- }
-
- name->prefixes = extract_field(editor, "entry-title" );
- name->given = extract_field(editor, "entry-first" );
- name->additional = extract_field(editor, "entry-middle");
- name->family = extract_field(editor, "entry-last" );
- name->suffixes = extract_field(editor, "entry-suffix");
-}
diff --git a/addressbook/gui/contact-editor/e-contact-editor-fullname.h b/addressbook/gui/contact-editor/e-contact-editor-fullname.h
deleted file mode 100644
index 0b254c789c..0000000000
--- a/addressbook/gui/contact-editor/e-contact-editor-fullname.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* e-contact-editor-fullname.h
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-#ifndef __E_CONTACT_EDITOR_FULLNAME_H__
-#define __E_CONTACT_EDITOR_FULLNAME_H__
-
-#include <gtk/gtkdialog.h>
-#include <glade/glade.h>
-#include <libebook/e-contact.h>
-
-G_BEGIN_DECLS
-
-/* EContactEditorFullname - A dialog displaying information about a contact.
- *
- * The following arguments are available:
- *
- * name type read/write description
- * --------------------------------------------------------------------------------
- * name ECardName * RW The card currently being edited. Returns a copy.
- */
-
-#define E_TYPE_CONTACT_EDITOR_FULLNAME (e_contact_editor_fullname_get_type ())
-#define E_CONTACT_EDITOR_FULLNAME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_CONTACT_EDITOR_FULLNAME, EContactEditorFullname))
-#define E_CONTACT_EDITOR_FULLNAME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_CONTACT_EDITOR_FULLNAME, EContactEditorFullnameClass))
-#define E_IS_CONTACT_EDITOR_FULLNAME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_CONTACT_EDITOR_FULLNAME))
-#define E_IS_CONTACT_EDITOR_FULLNAME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_CONTACT_EDITOR_FULLNAME))
-
-
-typedef struct _EContactEditorFullname EContactEditorFullname;
-typedef struct _EContactEditorFullnameClass EContactEditorFullnameClass;
-
-struct _EContactEditorFullname
-{
- GtkDialog parent;
-
- /* item specific fields */
- EContactName *name;
- GladeXML *gui;
-
- /* Whether the dialog will accept modifications */
- guint editable : 1;
-};
-
-struct _EContactEditorFullnameClass
-{
- GtkDialogClass parent_class;
-};
-
-
-GtkWidget *e_contact_editor_fullname_new(const EContactName *name);
-GType e_contact_editor_fullname_get_type (void);
-
-G_END_DECLS
-
-#endif /* __E_CONTACT_EDITOR_FULLNAME_H__ */
diff --git a/addressbook/gui/contact-editor/e-contact-editor-marshal.list b/addressbook/gui/contact-editor/e-contact-editor-marshal.list
deleted file mode 100644
index 58b2640de5..0000000000
--- a/addressbook/gui/contact-editor/e-contact-editor-marshal.list
+++ /dev/null
@@ -1,2 +0,0 @@
-NONE:INT,OBJECT
-NONE:NONE
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c
deleted file mode 100644
index 1391ccf1b0..0000000000
--- a/addressbook/gui/contact-editor/e-contact-editor.c
+++ /dev/null
@@ -1,2612 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-contact-editor.c
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-
-#include "e-contact-editor.h"
-
-#include <string.h>
-#include <time.h>
-#include <gtk/gtkcheckbutton.h>
-#include <gtk/gtkcheckmenuitem.h>
-#include <gtk/gtkcombo.h>
-#include <gtk/gtktextview.h>
-#include <gtk/gtkmessagedialog.h>
-#include <gtk/gtkstock.h>
-#include <gtk/gtkentry.h>
-#include <gtk/gtklabel.h>
-#include <libgnomeui/gnome-popup-menu.h>
-#include <libgnomeui/gnome-window-icon.h>
-#include <libgnome/gnome-i18n.h>
-
-#include <bonobo/bonobo-ui-container.h>
-#include <bonobo/bonobo-ui-util.h>
-#include <bonobo/bonobo-window.h>
-#include <gdk-pixbuf/gdk-pixbuf.h>
-#include <gal/widgets/e-categories.h>
-#include <gal/widgets/e-gui-utils.h>
-#include <gal/e-text/e-entry.h>
-
-#include <e-util/e-categories-master-list-wombat.h>
-
-#include "addressbook/printing/e-contact-print.h"
-#include "addressbook/printing/e-contact-print-envelope.h"
-#include "addressbook/gui/widgets/eab-gui-util.h"
-#include "e-util/e-gui-utils.h"
-#include "widgets/misc/e-dateedit.h"
-#include "widgets/misc/e-url-entry.h"
-#include "shell/evolution-shell-component-utils.h"
-
-#include "eab-contact-merging.h"
-
-#include "e-contact-editor-address.h"
-#include "e-contact-editor-fullname.h"
-#include "e-contact-editor-marshal.h"
-
-/* Signal IDs */
-enum {
- CONTACT_ADDED,
- CONTACT_MODIFIED,
- CONTACT_DELETED,
- EDITOR_CLOSED,
- LAST_SIGNAL
-};
-
-static void e_contact_editor_init (EContactEditor *editor);
-static void e_contact_editor_class_init (EContactEditorClass *klass);
-static void e_contact_editor_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static void e_contact_editor_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
-static void e_contact_editor_dispose (GObject *object);
-
-static void _email_arrow_pressed (GtkWidget *widget, GdkEventButton *button, EContactEditor *editor);
-static void _phone_arrow_pressed (GtkWidget *widget, GdkEventButton *button, EContactEditor *editor);
-static void _address_arrow_pressed (GtkWidget *widget, GdkEventButton *button, EContactEditor *editor);
-static void find_address_mailing (EContactEditor *editor);
-static void enable_writable_fields(EContactEditor *editor);
-static void set_editable(EContactEditor *editor);
-static void fill_in_info(EContactEditor *editor);
-static void extract_info(EContactEditor *editor);
-static void set_field(EContactEditor *editor, GtkEntry *entry, const char *string);
-static void set_address_field(EContactEditor *editor, int result);
-static void set_phone_field(EContactEditor *editor, GtkWidget *entry, const char *phone_number);
-static void set_fields(EContactEditor *editor);
-static void command_state_changed (EContactEditor *ce);
-static void widget_changed (GtkWidget *widget, EContactEditor *editor);
-static void close_dialog (EContactEditor *ce);
-static void enable_widget (GtkWidget *widget, gboolean enabled);
-
-static GtkObjectClass *parent_class = NULL;
-
-static guint contact_editor_signals[LAST_SIGNAL];
-
-/* The arguments we take */
-enum {
- PROP_0,
- PROP_BOOK,
- PROP_CONTACT,
- PROP_IS_NEW_CONTACT,
- PROP_EDITABLE,
- PROP_CHANGED,
- PROP_WRITABLE_FIELDS
-};
-
-enum {
- DYNAMIC_LIST_EMAIL,
- DYNAMIC_LIST_PHONE,
- DYNAMIC_LIST_ADDRESS
-};
-
-static EContactField phones[] = {
- E_CONTACT_PHONE_ASSISTANT,
- E_CONTACT_PHONE_BUSINESS,
- E_CONTACT_PHONE_BUSINESS_2,
- E_CONTACT_PHONE_BUSINESS_FAX,
- E_CONTACT_PHONE_CALLBACK,
- E_CONTACT_PHONE_CAR,
- E_CONTACT_PHONE_COMPANY,
- E_CONTACT_PHONE_HOME,
- E_CONTACT_PHONE_HOME_2,
- E_CONTACT_PHONE_HOME_FAX,
- E_CONTACT_PHONE_ISDN,
- E_CONTACT_PHONE_MOBILE,
- E_CONTACT_PHONE_OTHER,
- E_CONTACT_PHONE_OTHER_FAX,
- E_CONTACT_PHONE_PAGER,
- E_CONTACT_PHONE_PRIMARY,
- E_CONTACT_PHONE_RADIO,
- E_CONTACT_PHONE_TELEX,
- E_CONTACT_PHONE_TTYTDD,
-};
-
-static EContactField emails[] = {
- E_CONTACT_EMAIL_1,
- E_CONTACT_EMAIL_2,
- E_CONTACT_EMAIL_3
-};
-
-static GSList *all_contact_editors = NULL;
-
-GType
-e_contact_editor_get_type (void)
-{
- static GType contact_editor_type = 0;
-
- if (!contact_editor_type) {
- static const GTypeInfo contact_editor_info = {
- sizeof (EContactEditorClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_contact_editor_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EContactEditor),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_contact_editor_init,
- };
-
- contact_editor_type = g_type_register_static (GTK_TYPE_OBJECT, "EContactEditor", &contact_editor_info, 0);
- }
-
- return contact_editor_type;
-}
-
-static void
-e_contact_editor_class_init (EContactEditorClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_ref (GTK_TYPE_OBJECT);
-
- object_class->set_property = e_contact_editor_set_property;
- object_class->get_property = e_contact_editor_get_property;
- object_class->dispose = e_contact_editor_dispose;
-
- g_object_class_install_property (object_class, PROP_BOOK,
- g_param_spec_object ("book",
- _("Book"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_BOOK,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_CONTACT,
- g_param_spec_object ("contact",
- _("Contact"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_CONTACT,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_IS_NEW_CONTACT,
- g_param_spec_boolean ("is_new_contact",
- _("Is New Contact"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_WRITABLE_FIELDS,
- g_param_spec_object ("writable_fields",
- _("Writable Fields"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_LIST,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_EDITABLE,
- g_param_spec_boolean ("editable",
- _("Editable"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_CHANGED,
- g_param_spec_boolean ("changed",
- _("Changed"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- contact_editor_signals[CONTACT_ADDED] =
- g_signal_new ("contact_added",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EContactEditorClass, contact_added),
- NULL, NULL,
- e_contact_editor_marshal_NONE__INT_OBJECT,
- G_TYPE_NONE, 2,
- G_TYPE_INT, G_TYPE_OBJECT);
-
- contact_editor_signals[CONTACT_MODIFIED] =
- g_signal_new ("contact_modified",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EContactEditorClass, contact_modified),
- NULL, NULL,
- e_contact_editor_marshal_NONE__INT_OBJECT,
- G_TYPE_NONE, 2,
- G_TYPE_INT, G_TYPE_OBJECT);
-
- contact_editor_signals[CONTACT_DELETED] =
- g_signal_new ("contact_deleted",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EContactEditorClass, contact_deleted),
- NULL, NULL,
- e_contact_editor_marshal_NONE__INT_OBJECT,
- G_TYPE_NONE, 2,
- G_TYPE_INT, G_TYPE_OBJECT);
-
- contact_editor_signals[EDITOR_CLOSED] =
- g_signal_new ("editor_closed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EContactEditorClass, editor_closed),
- NULL, NULL,
- e_contact_editor_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-}
-
-static void
-connect_arrow_button_signal (EContactEditor *editor, gchar *button_xml, GCallback func)
-{
- GladeXML *gui = editor->gui;
- GtkWidget *button = glade_xml_get_widget(gui, button_xml);
- if (button && GTK_IS_BUTTON(button)) {
- g_signal_connect(button, "button_press_event", func, editor);
- }
-}
-
-static void
-connect_arrow_button_signals (EContactEditor *editor)
-{
- connect_arrow_button_signal(editor, "button-phone1", G_CALLBACK (_phone_arrow_pressed));
- connect_arrow_button_signal(editor, "button-phone2", G_CALLBACK (_phone_arrow_pressed));
- connect_arrow_button_signal(editor, "button-phone3", G_CALLBACK (_phone_arrow_pressed));
- connect_arrow_button_signal(editor, "button-phone4", G_CALLBACK (_phone_arrow_pressed));
- connect_arrow_button_signal(editor, "button-address", G_CALLBACK (_address_arrow_pressed));
- connect_arrow_button_signal(editor, "button-email1", G_CALLBACK (_email_arrow_pressed));
-}
-
-static void
-wants_html_changed (GtkWidget *widget, EContactEditor *editor)
-{
- gboolean wants_html;
- g_object_get (widget,
- "active", &wants_html,
- NULL);
-
- e_contact_set (editor->contact, E_CONTACT_WANTS_HTML, GINT_TO_POINTER (wants_html));
-
- widget_changed (widget, editor);
-}
-
-static void
-phone_entry_changed (GtkWidget *widget, EContactEditor *editor)
-{
- int which;
- GtkEntry *entry = GTK_ENTRY(widget);
-
- if ( widget == glade_xml_get_widget(editor->gui, "entry-phone1") )
- which = 1;
- else if ( widget == glade_xml_get_widget(editor->gui, "entry-phone2") )
- which = 2;
- else if ( widget == glade_xml_get_widget(editor->gui, "entry-phone3") )
- which = 3;
- else if ( widget == glade_xml_get_widget(editor->gui, "entry-phone4") )
- which = 4;
- else
- return;
-
- printf ("gtk_entry_get_text(entry) == %s\n", (char*)gtk_entry_get_text(entry));
- e_contact_set(editor->contact, editor->phone_choice[which - 1], (char*)gtk_entry_get_text(entry));
-
- widget_changed (widget, editor);
-}
-
-static void
-email_entry_changed (GtkWidget *widget, EContactEditor *editor)
-{
- GtkEntry *entry = GTK_ENTRY(widget);
-
- e_contact_set (editor->contact, editor->email_choice, (char*)gtk_entry_get_text(entry));
-
- widget_changed (widget, editor);
-}
-
-static void
-address_text_changed (GtkTextBuffer *buffer, EContactEditor *editor)
-{
-#if notyet
- ECardAddrLabel *address;
- GtkTextIter start_iter, end_iter;
-
- if (editor->address_choice == -1)
- return;
-
- address = e_card_address_label_new();
-
- if (editor->address_mailing == editor->address_choice || editor->address_mailing == -1) {
- GtkWidget *check;
-
- address->flags |= E_CARD_ADDR_DEFAULT;
-
- check = glade_xml_get_widget(editor->gui, "checkbutton-mailingaddress");
- if (check && GTK_IS_CHECK_BUTTON (check)) {
- g_signal_handlers_block_matched (check,
- G_SIGNAL_MATCH_DATA,
- 0, 0,
- NULL, NULL, editor);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), TRUE);
- g_signal_handlers_unblock_matched (check,
- G_SIGNAL_MATCH_DATA,
- 0, 0,
- NULL, NULL, editor);
- }
- }
-
- gtk_text_buffer_get_start_iter (GTK_TEXT_BUFFER (buffer), &start_iter);
- gtk_text_buffer_get_end_iter (GTK_TEXT_BUFFER (buffer), &end_iter);
-
- address->data = gtk_text_buffer_get_text (GTK_TEXT_BUFFER (buffer), &start_iter, &end_iter, FALSE);
-
- e_card_simple_set_address(editor->simple, editor->address_choice, address);
- e_card_address_label_unref(address);
-
- widget_changed (NULL, editor);
-#endif
-}
-
-
-static void
-address_mailing_changed (GtkWidget *widget, EContactEditor *editor)
-{
-#if notyet
- const ECardDeliveryAddress *curr;
- ECardDeliveryAddress *address;
- gboolean mailing_address;
-
- if (editor->address_choice == -1)
- return;
-
- mailing_address = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
-
- /* Mark the current address as the mailing address */
- curr = e_card_simple_get_delivery_address (editor->simple,
- editor->address_choice);
-
- address = e_card_delivery_address_copy (curr);
-
- if (!address)
- address = e_card_delivery_address_new ();
-
- if (mailing_address)
- address->flags |= E_CARD_ADDR_DEFAULT;
- else
- address->flags &= ~E_CARD_ADDR_DEFAULT;
-
- e_card_simple_set_delivery_address(editor->simple, editor->address_choice, address);
- e_card_delivery_address_unref (address);
-
- /* Unset the previous mailing address flag */
- if (mailing_address && editor->address_mailing != -1) {
- const ECardDeliveryAddress *curr;
-
- curr = e_card_simple_get_delivery_address(editor->simple,
- editor->address_mailing);
- address = e_card_delivery_address_copy (curr);
- address->flags &= ~E_CARD_ADDR_DEFAULT;
- e_card_simple_set_delivery_address(editor->simple,
- editor->address_mailing,
- address);
- e_card_delivery_address_unref (address);
- }
-
- /* Remember the new mailing address */
- if (mailing_address)
- editor->address_mailing = editor->address_choice;
- else
- editor->address_mailing = -1;
-
- widget_changed (widget, editor);
-#endif
-}
-
-
-/* This function tells you whether name_to_style will make sense. */
-static gboolean
-style_makes_sense(const EContactName *name, char *company, int style)
-{
- switch (style) {
- case 0: /* Fall Through */
- case 1:
- return TRUE;
- case 2:
- if (company && *company)
- return TRUE;
- else
- return FALSE;
- case 3: /* Fall Through */
- case 4:
- if (company && *company && name && ((name->given && *name->given) || (name->family && *name->family)))
- return TRUE;
- else
- return FALSE;
- default:
- return FALSE;
- }
-}
-
-static char *
-name_to_style(const EContactName *name, char *company, int style)
-{
- char *string;
- char *strings[4], **stringptr;
- char *substring;
- switch (style) {
- case 0:
- stringptr = strings;
- if (name) {
- if (name->family && *name->family)
- *(stringptr++) = name->family;
- if (name->given && *name->given)
- *(stringptr++) = name->given;
- }
- *stringptr = NULL;
- string = g_strjoinv(", ", strings);
- break;
- case 1:
- stringptr = strings;
- if (name) {
- if (name->given && *name->given)
- *(stringptr++) = name->given;
- if (name->family && *name->family)
- *(stringptr++) = name->family;
- }
- *stringptr = NULL;
- string = g_strjoinv(" ", strings);
- break;
- case 2:
- string = g_strdup(company);
- break;
- case 3: /* Fall Through */
- case 4:
- stringptr = strings;
- if (name) {
- if (name->family && *name->family)
- *(stringptr++) = name->family;
- if (name->given && *name->given)
- *(stringptr++) = name->given;
- }
- *stringptr = NULL;
- substring = g_strjoinv(", ", strings);
- if (!(company && *company))
- company = "";
- if (style == 3)
- string = g_strdup_printf("%s (%s)", substring, company);
- else
- string = g_strdup_printf("%s (%s)", company, substring);
- g_free(substring);
- break;
- default:
- string = g_strdup("");
- }
- return string;
-}
-
-static int
-file_as_get_style (EContactEditor *editor)
-{
- GtkEntry *file_as = GTK_ENTRY(glade_xml_get_widget(editor->gui, "entry-file-as"));
- char *filestring;
- char *trystring;
- EContactName *name = editor->name;
- int i;
- int style;
-
- if (!(file_as && GTK_IS_ENTRY(file_as)))
- return -1;
-
- filestring = g_strdup (gtk_entry_get_text(file_as));
-
- style = -1;
- for (i = 0; i < 5; i++) {
- trystring = name_to_style(name, editor->company, i);
- if (!strcmp(trystring, filestring)) {
- g_free(trystring);
- g_free(filestring);
- return i;
- }
- g_free(trystring);
- }
- g_free (filestring);
- return -1;
-}
-
-static void
-file_as_set_style(EContactEditor *editor, int style)
-{
- char *string;
- int i;
- GList *strings = NULL;
- GtkEntry *file_as = GTK_ENTRY(glade_xml_get_widget(editor->gui, "entry-file-as"));
- GtkWidget *widget;
-
-
- if (!(file_as && GTK_IS_ENTRY(file_as)))
- return;
-
- if (style == -1) {
- string = g_strdup (gtk_entry_get_text(file_as));
- strings = g_list_append(strings, string);
- }
-
- widget = glade_xml_get_widget(editor->gui, "combo-file-as");
-
- for (i = 0; i < 5; i++) {
- if (style_makes_sense(editor->name, editor->company, i)) {
- char *u;
- u = name_to_style(editor->name, editor->company, i);
- if (u) strings = g_list_append(strings, u);
- }
- }
-
- if (widget && GTK_IS_COMBO(widget)) {
- GtkCombo *combo = GTK_COMBO(widget);
- gtk_combo_set_popdown_strings(combo, strings);
- g_list_foreach(strings, (GFunc) g_free, NULL);
- g_list_free(strings);
- }
-
- if (style != -1) {
- string = name_to_style(editor->name, editor->company, style);
- gtk_entry_set_text(file_as, string);
- g_free(string);
- }
-}
-
-static void
-name_entry_changed (GtkWidget *widget, EContactEditor *editor)
-{
- int style = 0;
- const char *string;
-
- style = file_as_get_style(editor);
-
- e_contact_name_free (editor->name);
-
- string = gtk_entry_get_text (GTK_ENTRY(widget));
-
- editor->name = e_contact_name_from_string(string);
-
- file_as_set_style(editor, style);
-
- widget_changed (widget, editor);
-}
-
-static void
-company_entry_changed (GtkWidget *widget, EContactEditor *editor)
-{
- int style = 0;
-
- style = file_as_get_style(editor);
-
- g_free(editor->company);
-
- editor->company = g_strdup (gtk_entry_get_text(GTK_ENTRY(widget)));
-
- file_as_set_style(editor, style);
-
- widget_changed (widget, editor);
-}
-
-static void
-field_changed (GtkWidget *widget, EContactEditor *editor)
-{
- if (!editor->changed) {
- editor->changed = TRUE;
- command_state_changed (editor);
- }
-}
-
-static void
-set_entry_changed_signal_phone(EContactEditor *editor, char *id)
-{
- GtkWidget *widget = glade_xml_get_widget(editor->gui, id);
- if (widget && GTK_IS_ENTRY(widget))
- g_signal_connect(widget, "changed",
- G_CALLBACK (phone_entry_changed), editor);
-}
-
-static void
-set_entry_changed_signal_email(EContactEditor *editor, char *id)
-{
- GtkWidget *widget = glade_xml_get_widget(editor->gui, id);
- if (widget && GTK_IS_ENTRY(widget))
- g_signal_connect(widget, "changed",
- G_CALLBACK (email_entry_changed), editor);
-}
-
-static void
-widget_changed (GtkWidget *widget, EContactEditor *editor)
-{
- if (!editor->editable) {
- g_warning ("non-editable contact editor has an editable field in it.");
- return;
- }
-
- if (!editor->changed) {
- editor->changed = TRUE;
- command_state_changed (editor);
- }
-}
-
-static void
-set_entry_changed_signal_field(EContactEditor *editor, char *id)
-{
- GtkWidget *widget = glade_xml_get_widget(editor->gui, id);
- if (widget && GTK_IS_ENTRY(widget))
- g_signal_connect(widget, "changed",
- G_CALLBACK (field_changed), editor);
-}
-
-static void
-set_urlentry_changed_signal_field (EContactEditor *editor, char *id)
-{
- GtkWidget *widget = glade_xml_get_widget(editor->gui, id);
- if (widget && E_IS_URL_ENTRY(widget)) {
- GtkWidget *entry = e_url_entry_get_entry (E_URL_ENTRY (widget));
- g_signal_connect (entry, "changed",
- G_CALLBACK (field_changed), editor);
- }
-}
-
-static void
-set_entry_changed_signals(EContactEditor *editor)
-{
- GtkWidget *widget;
- set_entry_changed_signal_phone(editor, "entry-phone1");
- set_entry_changed_signal_phone(editor, "entry-phone2");
- set_entry_changed_signal_phone(editor, "entry-phone3");
- set_entry_changed_signal_phone(editor, "entry-phone4");
-
- set_entry_changed_signal_email(editor, "entry-email1");
-
- widget = glade_xml_get_widget(editor->gui, "text-address");
- if (widget && GTK_IS_TEXT_VIEW(widget)) {
- GtkTextBuffer *buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (widget));
- g_signal_connect(buffer, "changed",
- G_CALLBACK (address_text_changed), editor);
- }
-
- widget = glade_xml_get_widget(editor->gui, "entry-fullname");
- if (widget && GTK_IS_ENTRY(widget)) {
- g_signal_connect (widget, "changed",
- G_CALLBACK (name_entry_changed), editor);
- }
-
- widget = glade_xml_get_widget(editor->gui, "entry-company");
- if (widget && GTK_IS_ENTRY(widget)) {
- g_signal_connect (widget, "changed",
- G_CALLBACK (company_entry_changed), editor);
- }
-
- set_urlentry_changed_signal_field (editor, "entry-web");
- set_urlentry_changed_signal_field (editor, "entry-blog");
- set_urlentry_changed_signal_field (editor, "entry-caluri");
- set_urlentry_changed_signal_field (editor, "entry-fburl");
-
- set_entry_changed_signal_field(editor, "entry-categories");
- set_entry_changed_signal_field(editor, "entry-jobtitle");
- set_entry_changed_signal_field(editor, "entry-file-as");
- set_entry_changed_signal_field(editor, "entry-manager");
- set_entry_changed_signal_field(editor, "entry-assistant");
- set_entry_changed_signal_field(editor, "entry-office");
- set_entry_changed_signal_field(editor, "entry-department");
- set_entry_changed_signal_field(editor, "entry-profession");
- set_entry_changed_signal_field(editor, "entry-nickname");
- set_entry_changed_signal_field(editor, "entry-spouse");
-
- widget = glade_xml_get_widget(editor->gui, "text-comments");
- if (widget && GTK_IS_TEXT_VIEW(widget)) {
- GtkTextBuffer *buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (widget));
- g_signal_connect (buffer, "changed",
- G_CALLBACK (widget_changed), editor);
- }
- widget = glade_xml_get_widget(editor->gui, "dateedit-birthday");
- if (widget && E_IS_DATE_EDIT(widget)) {
- g_signal_connect (widget, "changed",
- G_CALLBACK (widget_changed), editor);
- }
- widget = glade_xml_get_widget(editor->gui, "dateedit-anniversary");
- if (widget && E_IS_DATE_EDIT(widget)) {
- g_signal_connect (widget, "changed",
- G_CALLBACK (widget_changed), editor);
- }
-}
-
-static void
-full_name_clicked(GtkWidget *button, EContactEditor *editor)
-{
- GtkDialog *dialog = GTK_DIALOG(e_contact_editor_fullname_new(editor->name));
- int result;
-
- g_object_set (dialog,
- "editable", editor->fullname_editable,
- NULL);
- gtk_widget_show(GTK_WIDGET(dialog));
- result = gtk_dialog_run (dialog);
- gtk_widget_hide (GTK_WIDGET (dialog));
-
- if (editor->fullname_editable && result == GTK_RESPONSE_OK) {
- EContactName *name;
- GtkWidget *fname_widget;
- int style = 0;
-
- g_object_get (dialog,
- "name", &name,
- NULL);
-
- style = file_as_get_style(editor);
-
- fname_widget = glade_xml_get_widget(editor->gui, "entry-fullname");
- if (fname_widget && GTK_IS_ENTRY(fname_widget)) {
- char *full_name = e_contact_name_to_string(name);
- gtk_entry_set_text(GTK_ENTRY(fname_widget), full_name);
- g_free(full_name);
- }
-
- e_contact_name_free(editor->name);
- editor->name = name;
-
- file_as_set_style(editor, style);
- }
- gtk_widget_destroy (GTK_WIDGET (dialog));
-}
-
-static void
-full_addr_clicked(GtkWidget *button, EContactEditor *editor)
-{
-#if notyet
- GtkDialog *dialog;
- int result;
- const ECardDeliveryAddress *address;
-
- address = e_card_simple_get_delivery_address(editor->simple, editor->address_choice);
-
- dialog = GTK_DIALOG(e_contact_editor_address_new(address));
- g_object_set (dialog,
- "editable", editor->address_editable[editor->address_choice],
- NULL);
- gtk_widget_show(GTK_WIDGET(dialog));
-
- result = gtk_dialog_run (dialog);
-
- gtk_widget_hide (GTK_WIDGET (dialog));
-
- if (editor->address_editable[editor->address_choice] && result == GTK_RESPONSE_OK) {
- ECardDeliveryAddress *new_address;
- GtkWidget *address_widget;
- int saved_choice = editor->address_choice;
-
- editor->address_choice = -1;
-
- g_object_get (dialog,
- "address", &new_address,
- NULL);
-
- address_widget = glade_xml_get_widget(editor->gui, "text-address");
- if (address_widget && GTK_IS_TEXT_VIEW(address_widget)) {
- GtkTextBuffer *buffer;
- char *string = e_card_delivery_address_to_string(new_address);
-
- buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (address_widget));
-
- gtk_text_buffer_set_text (buffer, string, strlen (string));
-
- g_free(string);
- }
-
- editor->address_choice = saved_choice;
-
- e_card_simple_set_delivery_address(editor->simple, editor->address_choice, new_address);
-
- e_card_delivery_address_unref(new_address);
-
- widget_changed (NULL, editor);
- }
- gtk_widget_destroy (GTK_WIDGET (dialog));
-#endif
-}
-
-static void
-categories_clicked(GtkWidget *button, EContactEditor *editor)
-{
- char *categories = NULL;
- GtkDialog *dialog;
- int result;
- GtkWidget *entry = glade_xml_get_widget(editor->gui, "entry-categories");
- ECategoriesMasterList *ecml;
- if (entry && GTK_IS_ENTRY(entry))
- categories = g_strdup (gtk_entry_get_text(GTK_ENTRY(entry)));
- else if (editor->contact)
- categories = e_contact_get (editor->contact, E_CONTACT_CATEGORIES);
-
- dialog = GTK_DIALOG(e_categories_new(categories));
-
- if (dialog == NULL) {
- GtkWidget *uh_oh = gtk_message_dialog_new (NULL,
- 0, GTK_MESSAGE_ERROR,
- GTK_RESPONSE_OK,
- _("Category editor not available."));
- g_free (categories);
- gtk_widget_show (uh_oh);
- return;
- }
-
- ecml = e_categories_master_list_wombat_new ();
- g_object_set (dialog,
- "header", _("This contact belongs to these categories:"),
- "ecml", ecml,
- NULL);
- g_object_unref (ecml);
- gtk_widget_show(GTK_WIDGET(dialog));
- result = gtk_dialog_run (dialog);
- g_free (categories);
- if (result == GTK_RESPONSE_OK) {
- g_object_get (dialog,
- "categories", &categories,
- NULL);
- if (entry && GTK_IS_ENTRY(entry))
- gtk_entry_set_text(GTK_ENTRY(entry), categories);
- else
- e_contact_set (editor->contact, E_CONTACT_CATEGORIES, categories);
-
- g_free(categories);
- }
- gtk_widget_destroy(GTK_WIDGET(dialog));
-}
-
-typedef struct {
- EContactEditor *ce;
- gboolean should_close;
-} EditorCloseStruct;
-
-static void
-contact_added_cb (EBook *book, EBookStatus status, const char *id, EditorCloseStruct *ecs)
-{
- EContactEditor *ce = ecs->ce;
- gboolean should_close = ecs->should_close;
-
- gtk_widget_set_sensitive (ce->app, TRUE);
- ce->in_async_call = FALSE;
-
- e_contact_set (ce->contact, E_CONTACT_UID, (char*)id);
-
- g_signal_emit (ce, contact_editor_signals[CONTACT_ADDED], 0,
- status, ce->contact);
-
- if (status == E_BOOK_ERROR_OK) {
- ce->is_new_contact = FALSE;
-
- if (should_close) {
- close_dialog (ce);
- }
- else {
- ce->changed = FALSE;
- command_state_changed (ce);
- }
- }
-
- g_object_unref (ce);
- g_free (ecs);
-}
-
-static void
-contact_modified_cb (EBook *book, EBookStatus status, EditorCloseStruct *ecs)
-{
- EContactEditor *ce = ecs->ce;
- gboolean should_close = ecs->should_close;
-
- gtk_widget_set_sensitive (ce->app, TRUE);
- ce->in_async_call = FALSE;
-
- g_signal_emit (ce, contact_editor_signals[CONTACT_MODIFIED], 0,
- status, ce->contact);
-
- if (status == E_BOOK_ERROR_OK) {
- if (should_close) {
- close_dialog (ce);
- }
- else {
- ce->changed = FALSE;
- command_state_changed (ce);
- }
- }
-
- g_object_unref (ce);
- g_free (ecs);
-}
-
-/* Emits the signal to request saving a contact */
-static void
-save_contact (EContactEditor *ce, gboolean should_close)
-{
- extract_info (ce);
-
- if (ce->book) {
- EditorCloseStruct *ecs = g_new(EditorCloseStruct, 1);
-
- ecs->ce = ce;
- g_object_ref (ecs->ce);
-
- ecs->should_close = should_close;
-
- gtk_widget_set_sensitive (ce->app, FALSE);
- ce->in_async_call = TRUE;
-
- if (ce->is_new_contact)
- eab_merging_book_add_contact (ce->book, ce->contact, (EBookIdCallback)contact_added_cb, ecs);
- else
- eab_merging_book_commit_contact (ce->book, ce->contact, (EBookCallback)contact_modified_cb, ecs);
- }
-}
-
-/* Closes the dialog box and emits the appropriate signals */
-static void
-close_dialog (EContactEditor *ce)
-{
- if (ce->app != NULL) {
- gtk_widget_destroy (ce->app);
- ce->app = NULL;
- g_signal_emit (ce, contact_editor_signals[EDITOR_CLOSED], 0);
- }
-}
-
-static gboolean
-prompt_to_save_changes (EContactEditor *editor)
-{
- if (!editor->changed)
- return TRUE;
-
- switch (eab_prompt_save_dialog (GTK_WINDOW(editor->app))) {
- case GTK_RESPONSE_YES:
- save_contact (editor, FALSE);
- return TRUE;
- case GTK_RESPONSE_NO:
- return TRUE;
- case GTK_RESPONSE_CANCEL:
- default:
- return FALSE;
- }
-}
-
-/* Menu callbacks */
-
-/* File/Save callback */
-static void
-file_save_cb (GtkWidget *widget, gpointer data)
-{
- EContactEditor *ce;
-
- ce = E_CONTACT_EDITOR (data);
- save_contact (ce, FALSE);
-}
-
-/* File/Close callback */
-static void
-file_close_cb (GtkWidget *widget, gpointer data)
-{
- EContactEditor *ce;
-
- ce = E_CONTACT_EDITOR (data);
- if (!prompt_to_save_changes (ce))
- return;
-
- close_dialog (ce);
-}
-
-static void
-file_save_as_cb (GtkWidget *widget, gpointer data)
-{
- EContactEditor *ce;
- EContact *contact;
-
- ce = E_CONTACT_EDITOR (data);
-
- extract_info (ce);
-
- contact = ce->contact;
- eab_contact_save(_("Save Contact as VCard"), contact, GTK_WINDOW (ce->app));
-}
-
-static void
-file_send_as_cb (GtkWidget *widget, gpointer data)
-{
- EContactEditor *ce;
-
- ce = E_CONTACT_EDITOR (data);
-
- extract_info (ce);
-
- eab_send_contact(ce->contact, EAB_DISPOSITION_AS_ATTACHMENT);
-}
-
-static void
-file_send_to_cb (GtkWidget *widget, gpointer data)
-{
- EContactEditor *ce;
-
- ce = E_CONTACT_EDITOR (data);
-
- extract_info (ce);
-
- eab_send_contact(ce->contact, EAB_DISPOSITION_AS_TO);
-}
-
-gboolean
-e_contact_editor_confirm_delete (GtkWindow *parent)
-{
- GtkWidget *dialog;
- gint result;
-
- dialog = gtk_message_dialog_new (parent,
- 0,
- GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_NONE,
-#if notyet
- /* XXX we really need to handle the plural case here.. */
- (plural
- ? _("Are you sure you want\n"
- "to delete these contacts?"))
-#endif
- _("Are you sure you want\n"
- "to delete this contact?"));
-
- gtk_dialog_add_buttons (GTK_DIALOG (dialog),
- GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
- GTK_STOCK_DELETE, GTK_RESPONSE_ACCEPT,
- NULL);
-
- result = gtk_dialog_run(GTK_DIALOG (dialog));
-
- gtk_widget_destroy (dialog);
-
- return (result == GTK_RESPONSE_ACCEPT);
-}
-
-static void
-contact_deleted_cb (EBook *book, EBookStatus status, EContactEditor *ce)
-{
- gtk_widget_set_sensitive (ce->app, TRUE);
- ce->in_async_call = FALSE;
-
- g_signal_emit (ce, contact_editor_signals[CONTACT_DELETED], 0,
- status, ce->contact);
-
- /* always close the dialog after we successfully delete a card */
- if (status == E_BOOK_ERROR_OK)
- close_dialog (ce);
-}
-
-static void
-delete_cb (GtkWidget *widget, gpointer data)
-{
- EContactEditor *ce = E_CONTACT_EDITOR (data);
- EContact *contact = ce->contact;
-
- g_object_ref(contact);
-
- if (e_contact_editor_confirm_delete(GTK_WINDOW(ce->app))) {
-
- extract_info (ce);
-
- if (!ce->is_new_contact && ce->book) {
- gtk_widget_set_sensitive (ce->app, FALSE);
- ce->in_async_call = TRUE;
-
- e_book_async_remove_contact (ce->book, contact, (EBookCallback)contact_deleted_cb, ce);
- }
- }
-
- g_object_unref(contact);
-}
-
-/* Emits the signal to request printing a card */
-static void
-print_cb (BonoboUIComponent *uih, void *data, const char *path)
-{
- EContactEditor *ce;
-
- ce = E_CONTACT_EDITOR (data);
-
- extract_info (ce);
-
- gtk_widget_show(e_contact_print_contact_dialog_new(ce->contact));
-}
-
-#if 0 /* Envelope printing is disabled for Evolution 1.0. */
-/* Emits the signal to request printing a card */
-static void
-print_envelope_cb (BonoboUIComponent *uih, void *data, const char *path)
-{
- EContactEditor *ce;
-
- ce = E_CONTACT_EDITOR (data);
-
- extract_info (ce);
- e_card_simple_sync_card (ce->simple);
-
- gtk_widget_show(e_contact_print_envelope_dialog_new(ce->card));
-}
-#endif
-
-/* Toolbar/Save and Close callback */
-static void
-tb_save_and_close_cb (BonoboUIComponent *uih, void *data, const char *path)
-{
- EContactEditor *ce;
-
- ce = E_CONTACT_EDITOR (data);
- save_contact (ce, TRUE);
-}
-
-static
-BonoboUIVerb verbs [] = {
- BONOBO_UI_UNSAFE_VERB ("ContactEditorSave", file_save_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactEditorSaveAs", file_save_as_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactEditorSaveClose", tb_save_and_close_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactEditorSendAs", file_send_as_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactEditorSendTo", file_send_to_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactEditorDelete", delete_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactEditorPrint", print_cb),
-#if 0 /* Envelope printing is disabled for Evolution 1.0. */
- BONOBO_UI_UNSAFE_VERB ("ContactEditorPrintEnvelope", print_envelope_cb),
-#endif
- /* BONOBO_UI_UNSAFE_VERB ("ContactEditorPageSetup", file_page_setup_menu), */
- BONOBO_UI_UNSAFE_VERB ("ContactEditorClose", file_close_cb),
-
- BONOBO_UI_VERB_END
-};
-
-EPixmap pixmaps[] = {
- E_PIXMAP ("/commands/ContactEditorSave", "save-16.png"),
- E_PIXMAP ("/commands/ContactEditorSaveClose", "save-16.png"),
- E_PIXMAP ("/commands/ContactEditorSaveAs", "save-as-16.png"),
- E_PIXMAP ("/commands/ContactEditorDelete", "evolution-trash-mini.png"),
- E_PIXMAP ("/commands/ContactEditorPrint", "print.xpm"),
-#if 0 /* Envelope printing is disabled for Evolution 1.0. */
- E_PIXMAP ("/commands/ContactEditorPrintEnvelope", "print.xpm"),
-#endif
- E_PIXMAP ("/Toolbar/ContactEditorSaveClose", "buttons/save-24.png"),
- E_PIXMAP ("/Toolbar/ContactEditorDelete", "buttons/delete-message.png"),
- E_PIXMAP ("/Toolbar/ContactEditorPrint", "buttons/print.png"),
-
- E_PIXMAP_END
-};
-
-static void
-create_ui (EContactEditor *ce)
-{
- bonobo_ui_component_add_verb_list_with_data (ce->uic, verbs, ce);
-
- bonobo_ui_util_set_ui (ce->uic, PREFIX,
- EVOLUTION_UIDIR "/evolution-contact-editor.xml",
- "evolution-contact-editor", NULL);
-
- e_pixmaps_update (ce->uic, pixmaps);
-}
-
-/* Callback used when the dialog box is destroyed */
-static gint
-app_delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer data)
-{
- EContactEditor *ce;
-
- ce = E_CONTACT_EDITOR (data);
-
- /* if we're saving, don't allow the dialog to close */
- if (ce->in_async_call)
- return TRUE;
-
- if (!prompt_to_save_changes (ce))
- return TRUE;
-
- close_dialog (ce);
- return TRUE;
-}
-
-static GList *
-add_to_tab_order(GList *list, GladeXML *gui, char *name)
-{
- GtkWidget *widget = glade_xml_get_widget(gui, name);
- return g_list_prepend(list, widget);
-}
-
-static void
-setup_tab_order(GladeXML *gui)
-{
- GtkWidget *container;
- GList *list = NULL;
-
- container = glade_xml_get_widget(gui, "table-contact-editor-general");
-
- if (container) {
- list = add_to_tab_order(list, gui, "entry-fullname");
- list = add_to_tab_order(list, gui, "entry-jobtitle");
- list = add_to_tab_order(list, gui, "entry-company");
- list = add_to_tab_order(list, gui, "combo-file-as");
- list = add_to_tab_order(list, gui, "entry-phone1");
- list = add_to_tab_order(list, gui, "entry-phone2");
- list = add_to_tab_order(list, gui, "entry-phone3");
- list = add_to_tab_order(list, gui, "entry-phone4");
-
- list = add_to_tab_order(list, gui, "entry-email1");
- list = add_to_tab_order(list, gui, "alignment-htmlmail");
- list = add_to_tab_order(list, gui, "entry-web");
- list = add_to_tab_order(list, gui, "entry-blog");
- list = add_to_tab_order(list, gui, "button-fulladdr");
- list = add_to_tab_order(list, gui, "text-address");
- list = g_list_reverse(list);
- e_container_change_tab_order(GTK_CONTAINER(container), list);
- g_list_free(list);
- }
-}
-
-static void
-e_contact_editor_init (EContactEditor *e_contact_editor)
-{
- GladeXML *gui;
- GtkWidget *widget;
- GtkWidget *bonobo_win;
- GtkWidget *wants_html;
- BonoboUIContainer *container;
- char *icon_path;
-
- e_contact_editor->email_info = NULL;
- e_contact_editor->phone_info = NULL;
- e_contact_editor->address_info = NULL;
- e_contact_editor->email_popup = NULL;
- e_contact_editor->phone_popup = NULL;
- e_contact_editor->address_popup = NULL;
- e_contact_editor->email_list = NULL;
- e_contact_editor->phone_list = NULL;
- e_contact_editor->address_list = NULL;
- e_contact_editor->name = e_contact_name_new();
- e_contact_editor->company = g_strdup("");
-
- e_contact_editor->email_choice = E_CONTACT_EMAIL_1;
- e_contact_editor->phone_choice[0] = E_CONTACT_PHONE_BUSINESS;
- e_contact_editor->phone_choice[1] = E_CONTACT_PHONE_HOME;
- e_contact_editor->phone_choice[2] = E_CONTACT_PHONE_BUSINESS_FAX;
- e_contact_editor->phone_choice[3] = E_CONTACT_PHONE_MOBILE;
-#if 0
- e_contact_editor->address_choice = 0;
- e_contact_editor->address_mailing = -1;
-#endif
-
- e_contact_editor->contact = NULL;
- e_contact_editor->changed = FALSE;
- e_contact_editor->in_async_call = FALSE;
- e_contact_editor->editable = TRUE;
-
- gui = glade_xml_new (EVOLUTION_GLADEDIR "/contact-editor.glade", NULL, NULL);
- e_contact_editor->gui = gui;
-
- setup_tab_order(gui);
-
- e_contact_editor->app = glade_xml_get_widget (gui, "contact editor");
-
- connect_arrow_button_signals(e_contact_editor);
- set_entry_changed_signals(e_contact_editor);
-
- wants_html = glade_xml_get_widget(e_contact_editor->gui, "checkbutton-htmlmail");
- if (wants_html && GTK_IS_TOGGLE_BUTTON(wants_html))
- g_signal_connect (wants_html, "toggled",
- G_CALLBACK (wants_html_changed), e_contact_editor);
-
- widget = glade_xml_get_widget(e_contact_editor->gui, "checkbutton-mailingaddress");
- if (widget && GTK_IS_TOGGLE_BUTTON(widget))
- g_signal_connect (widget, "toggled",
- G_CALLBACK (address_mailing_changed), e_contact_editor);
-
- widget = glade_xml_get_widget(e_contact_editor->gui, "button-fullname");
- if (widget && GTK_IS_BUTTON(widget))
- g_signal_connect (widget, "clicked",
- G_CALLBACK (full_name_clicked), e_contact_editor);
-
- widget = glade_xml_get_widget(e_contact_editor->gui, "button-fulladdr");
- if (widget && GTK_IS_BUTTON(widget))
- g_signal_connect (widget, "clicked",
- G_CALLBACK (full_addr_clicked), e_contact_editor);
-
- widget = glade_xml_get_widget(e_contact_editor->gui, "button-categories");
- if (widget && GTK_IS_BUTTON(widget))
- g_signal_connect (widget, "clicked",
- G_CALLBACK (categories_clicked), e_contact_editor);
-
- /* Construct the app */
- bonobo_win = bonobo_window_new ("contact-editor-dialog", _("Contact Editor"));
-
- /* FIXME: The sucking bit */
- {
- GtkWidget *contents;
-
- contents = bonobo_dock_get_client_area (gnome_app_get_dock (GNOME_APP(e_contact_editor->app)));
-
- if (!contents) {
- g_message ("contact_editor_construct(): Could not get contents");
- return;
- }
- g_object_ref (contents);
- gtk_container_remove (GTK_CONTAINER (contents->parent), contents);
- bonobo_window_set_contents (BONOBO_WINDOW (bonobo_win), contents);
- gtk_widget_destroy (e_contact_editor->app);
- e_contact_editor->app = bonobo_win;
- }
-
- /* Build the menu and toolbar */
- container = bonobo_window_get_ui_container (BONOBO_WINDOW (e_contact_editor->app));
-
- e_contact_editor->uic = bonobo_ui_component_new_default ();
- if (!e_contact_editor->uic) {
- g_message ("e_contact_editor_init(): eeeeek, could not create the UI handler!");
- return;
- }
- bonobo_ui_component_set_container (e_contact_editor->uic,
- bonobo_object_corba_objref (BONOBO_OBJECT (container)),
- NULL);
-
- create_ui (e_contact_editor);
-
- widget = glade_xml_get_widget(e_contact_editor->gui, "entry-fullname");
- if (widget)
- gtk_widget_grab_focus (widget);
-
- /* Connect to the deletion of the dialog */
-
- g_signal_connect (e_contact_editor->app, "delete_event",
- GTK_SIGNAL_FUNC (app_delete_event_cb), e_contact_editor);
-
- /* set the icon */
- icon_path = g_build_filename (EVOLUTION_IMAGESDIR, "evolution-contacts-mini.png", NULL);
- gnome_window_icon_set_from_file (GTK_WINDOW (e_contact_editor->app), icon_path);
- g_free (icon_path);
-}
-
-void
-e_contact_editor_dispose (GObject *object) {
- EContactEditor *e_contact_editor = E_CONTACT_EDITOR(object);
-
- if (e_contact_editor->writable_fields) {
- g_object_unref(e_contact_editor->writable_fields);
- e_contact_editor->writable_fields = NULL;
- }
- if (e_contact_editor->email_list) {
- g_list_foreach(e_contact_editor->email_list, (GFunc) g_free, NULL);
- g_list_free(e_contact_editor->email_list);
- e_contact_editor->email_list = NULL;
- }
- if (e_contact_editor->email_info) {
- g_free(e_contact_editor->email_info);
- e_contact_editor->email_info = NULL;
- }
- if (e_contact_editor->email_popup) {
- g_object_unref(e_contact_editor->email_popup);
- e_contact_editor->email_popup = NULL;
- }
-
- if (e_contact_editor->phone_list) {
- g_list_foreach(e_contact_editor->phone_list, (GFunc) g_free, NULL);
- g_list_free(e_contact_editor->phone_list);
- e_contact_editor->phone_list = NULL;
- }
- if (e_contact_editor->phone_info) {
- g_free(e_contact_editor->phone_info);
- e_contact_editor->phone_info = NULL;
- }
- if (e_contact_editor->phone_popup) {
- g_object_unref(e_contact_editor->phone_popup);
- e_contact_editor->phone_popup = NULL;
- }
-
- if (e_contact_editor->address_list) {
- g_list_foreach(e_contact_editor->address_list, (GFunc) g_free, NULL);
- g_list_free(e_contact_editor->address_list);
- e_contact_editor->address_list = NULL;
- }
- if (e_contact_editor->address_info) {
- g_free(e_contact_editor->address_info);
- e_contact_editor->address_info = NULL;
- }
- if (e_contact_editor->address_popup) {
- g_object_unref(e_contact_editor->address_popup);
- e_contact_editor->address_popup = NULL;
- }
-
- if (e_contact_editor->contact) {
- g_object_unref(e_contact_editor->contact);
- e_contact_editor->contact = NULL;
- }
-
- if (e_contact_editor->book) {
- g_object_unref(e_contact_editor->book);
- e_contact_editor->book = NULL;
- }
-
- if (e_contact_editor->name) {
- e_contact_name_free(e_contact_editor->name);
- e_contact_editor->name = NULL;
- }
-
- if (e_contact_editor->company) {
- g_free (e_contact_editor->company);
- e_contact_editor->company = NULL;
- }
-
- if (e_contact_editor->gui) {
- g_object_unref(e_contact_editor->gui);
- e_contact_editor->gui = NULL;
- }
-}
-
-static void
-command_state_changed (EContactEditor *ce)
-{
- bonobo_ui_component_set_prop (ce->uic,
- "/commands/ContactEditorSaveClose",
- "sensitive",
- ce->changed ? "1" : "0", NULL);
- bonobo_ui_component_set_prop (ce->uic,
- "/commands/ContactEditorSave",
- "sensitive",
- ce->changed ? "1" : "0", NULL);
- bonobo_ui_component_set_prop (ce->uic,
- "/commands/ContactEditorDelete",
- "sensitive",
- (ce->editable && !ce->is_new_contact) ? "1" : "0", NULL);
-}
-
-static void
-supported_fields_cb (EBook *book, EBookStatus status,
- EList *fields, EContactEditor *ce)
-{
- if (!g_slist_find (all_contact_editors, ce)) {
- g_warning ("supported_fields_cb called for book that's still around, but contact editor that's been destroyed.");
- return;
- }
-
- g_object_set (ce,
- "writable_fields", fields,
- NULL);
-
- e_contact_editor_show (ce);
-
- command_state_changed (ce);
-}
-
-static void
-contact_editor_destroy_notify (void *data,
- GObject *where_the_object_was)
-{
- EContactEditor *ce = E_CONTACT_EDITOR (data);
-
- all_contact_editors = g_slist_remove (all_contact_editors, ce);
-}
-
-EContactEditor *
-e_contact_editor_new (EBook *book,
- EContact *contact,
- gboolean is_new_contact,
- gboolean editable)
-{
- EContactEditor *ce;
-
- g_return_val_if_fail (E_IS_BOOK (book), NULL);
- g_return_val_if_fail (E_IS_CONTACT (contact), NULL);
-
- ce = g_object_new (E_TYPE_CONTACT_EDITOR, NULL);
-
- all_contact_editors = g_slist_prepend (all_contact_editors, ce);
- g_object_weak_ref (G_OBJECT (ce), contact_editor_destroy_notify, ce);
-
- g_object_ref (ce);
- gtk_object_sink (GTK_OBJECT (ce));
-
- g_object_set (ce,
- "book", book,
- "contact", contact,
- "is_new_contact", is_new_contact,
- "editable", editable,
- NULL);
-
- if (book)
- e_book_async_get_supported_fields (book, (EBookFieldsCallback)supported_fields_cb, ce);
-
- return ce;
-}
-
-static void
-e_contact_editor_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
-{
- EContactEditor *editor;
-
- editor = E_CONTACT_EDITOR (object);
-
- switch (prop_id){
- case PROP_BOOK:
- if (editor->book)
- g_object_unref(editor->book);
- editor->book = E_BOOK(g_value_get_object (value));
- g_object_ref (editor->book);
- /* XXX more here about editable/etc. */
- break;
- case PROP_CONTACT:
- if (editor->contact)
- g_object_unref(editor->contact);
- editor->contact = e_contact_duplicate(E_CONTACT(g_value_get_object (value)));
- fill_in_info(editor);
- editor->changed = FALSE;
- break;
-
- case PROP_IS_NEW_CONTACT:
- editor->is_new_contact = g_value_get_boolean (value) ? TRUE : FALSE;
- break;
-
- case PROP_EDITABLE: {
- gboolean new_value = g_value_get_boolean (value) ? TRUE : FALSE;
- gboolean changed = (editor->editable != new_value);
-
- editor->editable = new_value;
-
- if (changed) {
- set_editable (editor);
- command_state_changed (editor);
- }
- break;
- }
-
- case PROP_CHANGED: {
- gboolean new_value = g_value_get_boolean (value) ? TRUE : FALSE;
- gboolean changed = (editor->changed != new_value);
-
- editor->changed = new_value;
-
- if (changed)
- command_state_changed (editor);
- break;
- }
- case PROP_WRITABLE_FIELDS:
- if (editor->writable_fields)
- g_object_unref(editor->writable_fields);
- editor->writable_fields = g_value_get_object (value);
- if (editor->writable_fields)
- g_object_ref (editor->writable_fields);
- else
- editor->writable_fields = e_list_new(NULL, NULL, NULL);
- enable_writable_fields (editor);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-e_contact_editor_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
-{
- EContactEditor *e_contact_editor;
-
- e_contact_editor = E_CONTACT_EDITOR (object);
-
- switch (prop_id) {
- case PROP_BOOK:
- g_value_set_object (value, e_contact_editor->book);
- break;
-
- case PROP_CONTACT:
- extract_info(e_contact_editor);
- g_value_set_object (value, e_contact_editor->contact);
- break;
-
- case PROP_IS_NEW_CONTACT:
- g_value_set_boolean (value, e_contact_editor->is_new_contact ? TRUE : FALSE);
- break;
-
- case PROP_EDITABLE:
- g_value_set_boolean (value, e_contact_editor->editable ? TRUE : FALSE);
- break;
-
- case PROP_CHANGED:
- g_value_set_boolean (value, e_contact_editor->changed ? TRUE : FALSE);
- break;
-
- case PROP_WRITABLE_FIELDS:
- if (e_contact_editor->writable_fields)
- g_value_set_object (value, e_list_duplicate (e_contact_editor->writable_fields));
- else
- g_value_set_object (value, NULL);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-_popup_position(GtkMenu *menu,
- gint *x,
- gint *y,
- gboolean *push_in,
- gpointer data)
-{
- GtkWidget *button = GTK_WIDGET(data);
- GtkRequisition request;
- int mh, mw;
- gdk_window_get_origin (button->window, x, y);
- *x += button->allocation.x;
- *y += button->allocation.y;
-
- gtk_widget_size_request(GTK_WIDGET(menu), &request);
-
- mh = request.height;
- mw = request.width;
-
- *x -= mw;
- if (*x < 0)
- *x = 0;
-
- if (*y < 0)
- *y = 0;
-
- if ((*x + mw) > gdk_screen_width ())
- *x = gdk_screen_width () - mw;
-
- if ((*y + mh) > gdk_screen_height ())
- *y = gdk_screen_height () - mh;
-
- *push_in = FALSE;
-}
-
-static gint
-_arrow_pressed (GtkWidget *widget, GdkEventButton *button, EContactEditor *editor, GtkWidget *popup, GList **list, GnomeUIInfo **info, gchar *label)
-{
- gint menu_item;
-
- g_signal_stop_emission_by_name (widget, "button_press_event");
-
- gtk_widget_realize(popup);
- menu_item = gnome_popup_menu_do_popup_modal(popup, _popup_position, widget, button, editor, widget);
- if ( menu_item != -1 ) {
- GtkWidget *label_widget = glade_xml_get_widget(editor->gui, label);
- if (label_widget && GTK_IS_LABEL(label_widget)) {
- g_object_set (label_widget,
- "label", _(g_list_nth_data(*list, menu_item)),
- NULL);
- }
- }
- return menu_item;
-}
-
-static void
-e_contact_editor_build_ui_info(GList *list, GnomeUIInfo **infop)
-{
- GnomeUIInfo *info;
- GnomeUIInfo singleton = { GNOME_APP_UI_TOGGLEITEM, NULL, NULL, NULL, NULL, NULL, GNOME_APP_PIXMAP_NONE, 0, 0, 0, NULL };
- GnomeUIInfo end = GNOMEUIINFO_END;
- int length;
- int i;
-
- info = *infop;
-
- if ( info )
- g_free(info);
- length = g_list_length( list );
- info = g_new(GnomeUIInfo, length + 2);
- for (i = 0; i < length; i++) {
- info[i] = singleton;
- info[i].label = _(list->data);
- list = list->next;
- }
- info[i] = end;
-
- *infop = info;
-}
-
-static void
-e_contact_editor_build_phone_ui (EContactEditor *editor)
-{
- if (editor->phone_list == NULL) {
- int i;
-
- for (i = 0; i < G_N_ELEMENTS (phones); i ++) {
- editor->phone_list = g_list_append(editor->phone_list, g_strdup(e_contact_pretty_name (phones[i])));
- }
- }
- if (editor->phone_info == NULL) {
- e_contact_editor_build_ui_info(editor->phone_list, &editor->phone_info);
-
- if ( editor->phone_popup )
- g_object_unref(editor->phone_popup);
-
- editor->phone_popup = gnome_popup_menu_new(editor->phone_info);
- g_object_ref (editor->phone_popup);
- gtk_object_sink (GTK_OBJECT (editor->phone_popup));
- }
-}
-
-static void
-e_contact_editor_build_email_ui (EContactEditor *editor)
-{
- int i;
-
- if (editor->email_list == NULL) {
- for (i = 0; i < G_N_ELEMENTS (emails); i++)
- editor->email_list = g_list_append(editor->email_list, g_strdup(e_contact_pretty_name (emails[i])));
- }
- if (editor->email_info == NULL) {
- e_contact_editor_build_ui_info(editor->email_list, &editor->email_info);
-
- if ( editor->email_popup )
- g_object_unref(editor->email_popup);
-
- editor->email_popup = gnome_popup_menu_new(editor->email_info);
- g_object_ref (editor->email_popup);
- gtk_object_sink (GTK_OBJECT (editor->email_popup));
- }
-}
-
-static void
-e_contact_editor_build_address_ui (EContactEditor *editor)
-{
- int i;
-
- if (editor->address_list == NULL) {
- static char *info[] = {
- N_("Business"),
- N_("Home"),
- N_("Other")
- };
-
- for (i = 0; i < sizeof(info) / sizeof(info[0]); i++) {
- editor->address_list = g_list_append(editor->address_list, g_strdup(info[i]));
- }
- }
- if (editor->address_info == NULL) {
- e_contact_editor_build_ui_info(editor->address_list, &editor->address_info);
-
- if ( editor->address_popup )
- g_object_unref(editor->address_popup);
-
- editor->address_popup = gnome_popup_menu_new(editor->address_info);
- g_object_ref (editor->address_popup);
- gtk_object_sink (GTK_OBJECT (editor->address_popup));
- }
-}
-
-static void
-_phone_arrow_pressed (GtkWidget *widget, GdkEventButton *button, EContactEditor *editor)
-{
- int which;
- int i;
- gchar *label;
- gchar *entry;
- int result;
- if ( widget == glade_xml_get_widget(editor->gui, "button-phone1") ) {
- which = 1;
- } else if ( widget == glade_xml_get_widget(editor->gui, "button-phone2") ) {
- which = 2;
- } else if ( widget == glade_xml_get_widget(editor->gui, "button-phone3") ) {
- which = 3;
- } else if ( widget == glade_xml_get_widget(editor->gui, "button-phone4") ) {
- which = 4;
- } else
- return;
-
- label = g_strdup_printf("label-phone%d", which);
- entry = g_strdup_printf("entry-phone%d", which);
-
- e_contact_editor_build_phone_ui (editor);
-
- for(i = 0; i < G_N_ELEMENTS (phones); i++) {
- char *phone = e_contact_get (editor->contact, phones[i]);
- gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(editor->phone_info[i].widget),
- phone && *phone);
- g_free (phone);
- }
-
- result = _arrow_pressed (widget, button, editor, editor->phone_popup, &editor->phone_list, &editor->phone_info, label);
-
- if (result != -1) {
- GtkWidget *w = glade_xml_get_widget (editor->gui, entry);
- editor->phone_choice[which - 1] = phones[result];
- set_fields (editor);
- enable_widget (glade_xml_get_widget (editor->gui, label), TRUE);
- enable_widget (w, editor->editable);
- }
-
- g_free(label);
- g_free(entry);
-}
-
-static void
-_email_arrow_pressed (GtkWidget *widget, GdkEventButton *button, EContactEditor *editor)
-{
- int i;
- int result;
-
- e_contact_editor_build_email_ui (editor);
-
- for(i = 0; i < G_N_ELEMENTS (emails); i++) {
- char *string = e_contact_get (editor->contact, emails[i]);
- gboolean checked;
- checked = string && *string;
- gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(editor->email_info[i].widget),
- checked);
- g_free (string);
- }
-
- result = _arrow_pressed (widget, button, editor, editor->email_popup, &editor->email_list, &editor->email_info, "label-email1");
-
- if (result != -1) {
- GtkWidget *entry = glade_xml_get_widget (editor->gui, "entry-email1");
- editor->email_choice = result;
-
- set_fields (editor);
-
- /* make sure the buttons/entry is/are sensitive */
- enable_widget (glade_xml_get_widget (editor->gui, "label-email1"), TRUE);
- enable_widget (entry, editor->editable);
- enable_widget (glade_xml_get_widget (editor->gui, "checkbutton-htmlmail"), editor->editable);
- }
-}
-
-static void
-_address_arrow_pressed (GtkWidget *widget, GdkEventButton *button, EContactEditor *editor)
-{
-#if notyet
- int i;
- int result;
-
- e_contact_editor_build_address_ui (editor);
-
- for(i = 0; i < E_CARD_SIMPLE_ADDRESS_ID_LAST; i++) {
- const ECardAddrLabel *address = e_card_simple_get_address(editor->simple, i);
- gboolean checked;
- checked = address && address->data && *address->data;
- gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(editor->address_info[i].widget),
- checked);
- }
-
- result = _arrow_pressed (widget, button, editor, editor->address_popup, &editor->address_list, &editor->address_info, "label-address");
-
- if (result != -1) {
- set_address_field(editor, result);
-
- /* make sure the buttons/entry is/are sensitive */
- enable_widget (glade_xml_get_widget (editor->gui, "label-address"), TRUE);
- enable_widget (glade_xml_get_widget (editor->gui, "text-address"), editor->address_editable[result]);
- enable_widget (glade_xml_get_widget (editor->gui, "checkbutton-mailingaddress"), editor->address_editable[result]);
- }
-#endif
-}
-
-static void
-find_address_mailing (EContactEditor *editor)
-{
-#if notyet
- const ECardDeliveryAddress *address;
- int i;
-
- editor->address_mailing = -1;
- for (i = 0; i < E_CARD_SIMPLE_ADDRESS_ID_LAST; i++) {
- address = e_card_simple_get_delivery_address(editor->simple, i);
- if (address && (address->flags & E_CARD_ADDR_DEFAULT)) {
- if (editor->address_mailing == -1) {
- editor->address_mailing = i;
- } else {
- ECardDeliveryAddress *new;
-
- new = e_card_delivery_address_copy (address);
- new->flags &= ~E_CARD_ADDR_DEFAULT;
- e_card_simple_set_delivery_address(editor->simple, i, new);
- e_card_delivery_address_unref (new);
- }
- }
- }
-#endif
-}
-
-static void
-set_field(EContactEditor *editor, GtkEntry *entry, const char *string)
-{
- const char *oldstring = gtk_entry_get_text(entry);
- if (!string)
- string = "";
- if (strcmp(string, oldstring)) {
- g_signal_handlers_block_matched (entry,
- G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, editor);
- gtk_entry_set_text(entry, string);
- g_signal_handlers_unblock_matched (entry,
- G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, editor);
- }
-}
-
-static void
-set_phone_field(EContactEditor *editor, GtkWidget *entry, const char *phone_number)
-{
- set_field(editor, GTK_ENTRY(entry), phone_number ? phone_number : "");
-}
-
-static void
-set_fields(EContactEditor *editor)
-{
- GtkWidget *entry;
- GtkWidget *label_widget;
- int i;
-
- entry = glade_xml_get_widget(editor->gui, "entry-phone1");
- if (entry && GTK_IS_ENTRY(entry))
- set_phone_field(editor, entry, e_contact_get_const(editor->contact, editor->phone_choice[0]));
-
- entry = glade_xml_get_widget(editor->gui, "entry-phone2");
- if (entry && GTK_IS_ENTRY(entry))
- set_phone_field(editor, entry, e_contact_get_const(editor->contact, editor->phone_choice[1]));
-
- entry = glade_xml_get_widget(editor->gui, "entry-phone3");
- if (entry && GTK_IS_ENTRY(entry))
- set_phone_field(editor, entry, e_contact_get_const(editor->contact, editor->phone_choice[2]));
-
- entry = glade_xml_get_widget(editor->gui, "entry-phone4");
- if (entry && GTK_IS_ENTRY(entry))
- set_phone_field(editor, entry, e_contact_get_const(editor->contact, editor->phone_choice[3]));
-
- entry = glade_xml_get_widget(editor->gui, "entry-email1");
- if (entry && GTK_IS_ENTRY(entry))
- set_field(editor, GTK_ENTRY(entry), e_contact_get_const(editor->contact, editor->email_choice));
-
-
- e_contact_editor_build_address_ui (editor);
-
-#if notyet
- for (i = 0; i < E_CARD_SIMPLE_ADDRESS_ID_LAST; i++) {
- const ECardAddrLabel *address = e_card_simple_get_address(editor->simple, i);
-
- if (address && address->data && *address->data)
- break;
- }
- if (i == E_CARD_SIMPLE_ADDRESS_ID_LAST)
- i = 0;
-
- label_widget = glade_xml_get_widget(editor->gui, "label-address");
- if (label_widget && GTK_IS_LABEL(label_widget)) {
- g_object_set (label_widget,
- "label", _(g_list_nth_data(editor->address_list, i)),
- NULL);
- }
-
- set_address_field(editor, i);
-#endif
-}
-
-static void
-set_address_field(EContactEditor *editor, int result)
-{
-#if notyet
- GtkWidget *text, *check;
-
- text = glade_xml_get_widget(editor->gui, "text-address");
-
- if (text && GTK_IS_TEXT_VIEW(text)) {
- GtkTextBuffer *buffer;
- GtkTextIter start_iter, end_iter;
- const ECardAddrLabel *address;
-
- if (result == -1)
- result = editor->address_choice;
- editor->address_choice = -1;
-
- buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text));
-
- gtk_text_buffer_get_start_iter (buffer, &start_iter);
- gtk_text_buffer_get_end_iter (buffer, &end_iter);
-
- gtk_text_buffer_delete (buffer, &start_iter, &end_iter);
-
- address = e_card_simple_get_address(editor->simple, result);
- if (address && address->data)
- gtk_text_buffer_insert (buffer, &start_iter, address->data, strlen (address->data));
-
- check = glade_xml_get_widget(editor->gui, "checkbutton-mailingaddress");
- if (check && GTK_IS_CHECK_BUTTON (check)) {
- if (address && address->data)
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check),
- address->flags & E_CARD_ADDR_DEFAULT);
- else
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), FALSE);
- }
-
- editor->address_choice = result;
- }
-#endif
-}
-
-static struct {
- char *id;
- EContactField field;
-} field_mapping [] = {
- { "entry-fullname", E_CONTACT_FULL_NAME },
- { "entry-web", E_CONTACT_HOMEPAGE_URL },
- { "entry-blog", E_CONTACT_BLOG_URL },
- { "entry-company", E_CONTACT_ORG },
- { "entry-department", E_CONTACT_ORG_UNIT },
- { "entry-office", E_CONTACT_OFFICE },
- { "entry-jobtitle", E_CONTACT_TITLE },
- { "entry-profession", E_CONTACT_ROLE },
- { "entry-manager", E_CONTACT_MANAGER },
- { "entry-assistant", E_CONTACT_ASSISTANT },
- { "entry-nickname", E_CONTACT_NICKNAME },
- { "entry-spouse", E_CONTACT_SPOUSE },
- { "text-comments", E_CONTACT_NOTE },
- { "entry-categories", E_CONTACT_CATEGORIES },
- { "entry-caluri", E_CONTACT_CALENDAR_URI },
- { "entry-fburl", E_CONTACT_FREEBUSY_URL },
-};
-
-static void
-fill_in_field(EContactEditor *editor, char *id, char *value)
-{
- GtkWidget *widget = glade_xml_get_widget(editor->gui, id);
-
- if (!widget)
- return;
-
- if (E_IS_URL_ENTRY (widget))
- widget = e_url_entry_get_entry (E_URL_ENTRY (widget));
-
- if (GTK_IS_TEXT_VIEW (widget)) {
- if (value)
- gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (widget)),
- value, strlen (value));
- }
- else if (GTK_IS_EDITABLE(widget)) {
- int position = 0;
- GtkEditable *editable = GTK_EDITABLE(widget);
- gtk_editable_delete_text(editable, 0, -1);
- if (value)
- gtk_editable_insert_text(editable, value, strlen(value), &position);
- }
-}
-
-static void
-disable_widget_foreach (char *key, GtkWidget *widget, gpointer closure)
-{
- enable_widget (widget, FALSE);
-}
-
-static struct {
- char *widget_name;
- EContactField field_id;
- gboolean desensitize_for_read_only;
-} widget_field_mappings[] = {
- { "entry-web", E_CONTACT_HOMEPAGE_URL, TRUE },
- { "accellabel-web", E_CONTACT_HOMEPAGE_URL },
-
- { "entry-blog", E_CONTACT_BLOG_URL, TRUE },
- { "accellabel-blog", E_CONTACT_BLOG_URL },
-
- { "entry-jobtitle", E_CONTACT_TITLE, TRUE },
- { "label-jobtitle", E_CONTACT_TITLE },
-
- { "entry-company", E_CONTACT_ORG, TRUE },
- { "label-company", E_CONTACT_ORG },
-
- { "combo-file-as", E_CONTACT_FILE_AS, TRUE },
- { "entry-file-as", E_CONTACT_FILE_AS, TRUE },
- { "accellabel-fileas", E_CONTACT_FILE_AS },
-
- { "label-department", E_CONTACT_ORG_UNIT },
- { "entry-department", E_CONTACT_ORG_UNIT, TRUE },
-
- { "label-office", E_CONTACT_OFFICE },
- { "entry-office", E_CONTACT_OFFICE, TRUE },
-
- { "label-profession", E_CONTACT_ROLE },
- { "entry-profession", E_CONTACT_ROLE, TRUE },
-
- { "label-manager", E_CONTACT_MANAGER },
- { "entry-manager", E_CONTACT_MANAGER, TRUE },
-
- { "label-assistant", E_CONTACT_ASSISTANT },
- { "entry-assistant", E_CONTACT_ASSISTANT, TRUE },
-
- { "label-nickname", E_CONTACT_NICKNAME },
- { "entry-nickname", E_CONTACT_NICKNAME, TRUE },
-
- { "label-spouse", E_CONTACT_SPOUSE },
- { "entry-spouse", E_CONTACT_SPOUSE, TRUE },
-
- { "label-birthday", E_CONTACT_BIRTH_DATE },
- { "dateedit-birthday", E_CONTACT_BIRTH_DATE, TRUE },
-
- { "label-anniversary", E_CONTACT_ANNIVERSARY },
- { "dateedit-anniversary", E_CONTACT_ANNIVERSARY, TRUE },
-
- { "label-comments", E_CONTACT_NOTE },
- { "text-comments", E_CONTACT_NOTE, TRUE },
-
- { "entry-fullname", E_CONTACT_FULL_NAME, TRUE },
-
- { "button-categories", E_CONTACT_CATEGORIES, TRUE },
- { "entry-categories", E_CONTACT_CATEGORIES, TRUE },
-
- { "label-caluri", E_CONTACT_CALENDAR_URI },
- { "entry-caluri", E_CONTACT_CALENDAR_URI, TRUE },
-
- { "label-fburl", E_CONTACT_FREEBUSY_URL },
- { "entry-fburl", E_CONTACT_FREEBUSY_URL, TRUE }
-};
-static int num_widget_field_mappings = sizeof(widget_field_mappings) / sizeof (widget_field_mappings[0]);
-
-static void
-enable_writable_fields(EContactEditor *editor)
-{
- EList *fields = editor->writable_fields;
- EIterator *iter;
- GHashTable *dropdown_hash, *supported_hash;
- int i;
- char *widget_name;
-
- if (!fields)
- return;
-
- dropdown_hash = g_hash_table_new (g_str_hash, g_str_equal);
- supported_hash = g_hash_table_new (g_str_hash, g_str_equal);
-
- /* build our hashtable of the drop down menu items */
- e_contact_editor_build_phone_ui (editor);
- for (i = 0; i < G_N_ELEMENTS (phones); i ++)
- g_hash_table_insert (dropdown_hash,
- (char*)e_contact_field_name(phones[i]),
- editor->phone_info[i].widget);
- e_contact_editor_build_email_ui (editor);
- for (i = 0; i < G_N_ELEMENTS (emails); i ++)
- g_hash_table_insert (dropdown_hash,
- (char*)e_contact_field_name(phones[i]),
- editor->email_info[i].widget);
-#if notyet
- e_contact_editor_build_address_ui (editor);
- for (i = 0; i < E_CARD_SIMPLE_ADDRESS_ID_LAST; i ++)
- g_hash_table_insert (dropdown_hash,
- (char*)e_card_simple_get_ecard_field(simple, e_card_simple_map_address_to_field (i)),
- editor->address_info[i].widget);
-#endif
-
- /* then disable them all */
- g_hash_table_foreach (dropdown_hash, (GHFunc)disable_widget_foreach, NULL);
-
- /* disable the label widgets for the dropdowns (4 phone, 1
- email and the toggle button, and 1 address and one for
- the full address button */
- for (i = 0; i < 4; i ++) {
- widget_name = g_strdup_printf ("label-phone%d", i+1);
- enable_widget (glade_xml_get_widget (editor->gui, widget_name), FALSE);
- g_free (widget_name);
- widget_name = g_strdup_printf ("entry-phone%d", i+1);
- enable_widget (glade_xml_get_widget (editor->gui, widget_name), FALSE);
- g_free (widget_name);
- }
- enable_widget (glade_xml_get_widget (editor->gui, "label-email1"), FALSE);
- enable_widget (glade_xml_get_widget (editor->gui, "entry-email1"), FALSE);
- enable_widget (glade_xml_get_widget (editor->gui, "checkbutton-htmlmail"), FALSE);
- enable_widget (glade_xml_get_widget (editor->gui, "checkbutton-mailingaddress"), FALSE);
- enable_widget (glade_xml_get_widget (editor->gui, "label-address"), FALSE);
- enable_widget (glade_xml_get_widget (editor->gui, "text-address"), FALSE);
-
- editor->fullname_editable = FALSE;
-
- /* enable widgets that map directly from a field to a widget (the drop down items) */
- iter = e_list_get_iterator (fields);
- for (; e_iterator_is_valid (iter); e_iterator_next (iter)) {
- char *field = (char*)e_iterator_get (iter);
- GtkWidget *widget = g_hash_table_lookup (dropdown_hash, field);
- int i;
-
- if (widget) {
- enable_widget (widget, TRUE);
- }
- else {
- /* if it's not a field that's handled by the
- dropdown items, add it to the has to be
- used in the second step */
- g_hash_table_insert (supported_hash, field, field);
- }
-
-#if notyet
- for (i = 0; i < E_CARD_SIMPLE_ADDRESS_ID_LAST; i ++) {
- if (!strcmp (field, e_card_simple_get_ecard_field (simple, e_card_simple_map_address_to_field(i)))) {
- editor->address_editable [i] = TRUE;
- }
- }
-#endif
-
- /* ugh - this is needed to make sure we don't have a
- disabled label next to a drop down when the item in
- the menu (the one reflected in the label) is
- enabled. */
- if (!strcmp (field, e_contact_field_name (editor->email_choice))) {
- enable_widget (glade_xml_get_widget (editor->gui, "label-email1"), TRUE);
- enable_widget (glade_xml_get_widget (editor->gui, "entry-email1"), editor->editable);
- enable_widget (glade_xml_get_widget (editor->gui, "checkbutton-htmlmail"), editor->editable);
- }
- else if (!strcmp (field, e_contact_field_name (editor->address_choice))) {
- enable_widget (glade_xml_get_widget (editor->gui, "label-address"), TRUE);
- enable_widget (glade_xml_get_widget (editor->gui, "checkbutton-mailingaddress"), editor->editable);
- enable_widget (glade_xml_get_widget (editor->gui, "text-address"), editor->editable);
- }
- else for (i = 0; i < 4; i ++) {
- if (!strcmp (field, e_contact_field_name (editor->phone_choice[i]))) {
- widget_name = g_strdup_printf ("label-phone%d", i+1);
- enable_widget (glade_xml_get_widget (editor->gui, widget_name), TRUE);
- g_free (widget_name);
- widget_name = g_strdup_printf ("entry-phone%d", i+1);
- enable_widget (glade_xml_get_widget (editor->gui, widget_name), editor->editable);
- g_free (widget_name);
- }
- }
- }
-
- /* handle the label next to the dropdown widgets */
-
- for (i = 0; i < num_widget_field_mappings; i ++) {
- gboolean enabled;
- GtkWidget *w;
- const char *field;
-
- w = glade_xml_get_widget(editor->gui, widget_field_mappings[i].widget_name);
- if (!w) {
- g_warning (_("Could not find widget for a field: `%s'"),
- widget_field_mappings[i].widget_name);
- continue;
- }
- field = e_contact_field_name (widget_field_mappings[i].field_id);
-
- enabled = (g_hash_table_lookup (supported_hash, field) != NULL);
-
- if (widget_field_mappings[i].desensitize_for_read_only && !editor->editable) {
- enabled = FALSE;
- }
-
- enable_widget (w, enabled);
- }
-
- editor->fullname_editable = (g_hash_table_lookup (supported_hash, "full_name") != NULL);
-
- g_hash_table_destroy (dropdown_hash);
- g_hash_table_destroy (supported_hash);
-}
-
-static void
-set_editable (EContactEditor *editor)
-{
- int i;
- char *entry;
- /* set the sensitivity of all the non-dropdown entry/texts/dateedits */
- for (i = 0; i < num_widget_field_mappings; i ++) {
- if (widget_field_mappings[i].desensitize_for_read_only) {
- GtkWidget *widget = glade_xml_get_widget(editor->gui, widget_field_mappings[i].widget_name);
- enable_widget (widget, editor->editable);
- }
- }
-
- /* handle the phone dropdown entries */
- for (i = 0; i < 4; i ++) {
- entry = g_strdup_printf ("entry-phone%d", i+1);
-
- enable_widget (glade_xml_get_widget(editor->gui, entry),
- editor->editable);
-
- g_free (entry);
- }
-
- /* handle the email dropdown entry */
- entry = "entry-email1";
- enable_widget (glade_xml_get_widget(editor->gui, entry),
- editor->editable);
- enable_widget (glade_xml_get_widget(editor->gui, "checkbutton-htmlmail"),
- editor->editable);
-
- /* handle the address dropdown entry */
- entry = "text-address";
- enable_widget (glade_xml_get_widget(editor->gui, entry),
- editor->editable);
-}
-
-static void
-fill_in_info(EContactEditor *editor)
-{
- EContact *contact = editor->contact;
- if (contact) {
- char *file_as;
- EContactName *name;
- EContactDate *anniversary;
- EContactDate *bday;
- int i;
- GtkWidget *widget;
- gboolean wants_html;
-
- g_object_get (contact,
- "file_as", &file_as,
- "name", &name,
- "anniversary", &anniversary,
- "birth_date", &bday,
- "wants_html", &wants_html,
- NULL);
-
- for (i = 0; i < sizeof(field_mapping) / sizeof(field_mapping[0]); i++) {
- char *string = e_contact_get (contact, field_mapping[i].field);
- fill_in_field(editor, field_mapping[i].id, string);
- g_free (string);
- }
-
- find_address_mailing (editor);
-
- widget = glade_xml_get_widget(editor->gui, "checkbutton-htmlmail");
- if (widget && GTK_IS_CHECK_BUTTON(widget)) {
- g_object_set (widget,
- "active", wants_html,
- NULL);
- }
-
- /* File as has to come after company and name or else it'll get messed up when setting them. */
- fill_in_field(editor, "entry-file-as", file_as);
-
- g_free (file_as);
- if (editor->name)
- e_contact_name_free(editor->name);
- editor->name = name;
-
- widget = glade_xml_get_widget(editor->gui, "dateedit-anniversary");
- if (widget && E_IS_DATE_EDIT(widget)) {
- EDateEdit *dateedit;
- dateedit = E_DATE_EDIT(widget);
- if (anniversary)
- e_date_edit_set_date (dateedit,
- anniversary->year,
- anniversary->month,
- anniversary->day);
- else
- e_date_edit_set_time (dateedit, -1);
- }
-
- widget = glade_xml_get_widget(editor->gui, "dateedit-birthday");
- if (widget && E_IS_DATE_EDIT(widget)) {
- EDateEdit *dateedit;
- dateedit = E_DATE_EDIT(widget);
- if (bday)
- e_date_edit_set_date (dateedit,
- bday->year,
- bday->month,
- bday->day);
- else
- e_date_edit_set_time (dateedit, -1);
- }
-
- e_contact_date_free (anniversary);
- e_contact_date_free (bday);
-
- set_fields(editor);
- }
-}
-
-static void
-extract_field(EContactEditor *editor, EContact *contact, char *editable_id, EContactField field)
-{
- GtkWidget *widget = glade_xml_get_widget(editor->gui, editable_id);
- char *string = NULL;
-
- if (!widget)
- return;
-
- if (E_IS_URL_ENTRY (widget))
- widget = e_url_entry_get_entry (E_URL_ENTRY (widget));
-
- if (GTK_IS_EDITABLE (widget))
- string = gtk_editable_get_chars(GTK_EDITABLE (widget), 0, -1);
- else if (GTK_IS_TEXT_VIEW (widget)) {
- GtkTextIter start, end;
- GtkTextBuffer *buffer;
-
- buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (widget));
- gtk_text_buffer_get_start_iter (buffer, &start);
- gtk_text_buffer_get_end_iter (buffer, &end);
-
- string = gtk_text_buffer_get_text (buffer, &start, &end, TRUE);
- }
-
- if (string && *string)
- e_contact_set (contact, field, string);
- else
- e_contact_set (contact, field, NULL);
-
- if (string) g_free(string);
-}
-
-static void
-extract_info(EContactEditor *editor)
-{
- EContact *contact = editor->contact;
- if (contact) {
- EContactDate anniversary;
- EContactDate bday;
- int i;
- GtkWidget *widget;
-
- widget = glade_xml_get_widget(editor->gui, "entry-file-as");
- if (widget && GTK_IS_EDITABLE(widget)) {
- GtkEditable *editable = GTK_EDITABLE(widget);
- char *string = gtk_editable_get_chars(editable, 0, -1);
-
- if (string && *string)
- e_contact_set (contact, E_CONTACT_FILE_AS, string);
-
- g_free(string);
- }
-
- for (i = 0; i < sizeof(field_mapping) / sizeof(field_mapping[0]); i++) {
- extract_field(editor, contact, field_mapping[i].id, field_mapping[i].field);
- }
-
- if (editor->name)
- e_contact_set (contact, E_CONTACT_NAME, editor->name);
-
- widget = glade_xml_get_widget(editor->gui, "dateedit-anniversary");
- if (widget && E_IS_DATE_EDIT(widget)) {
- if (e_date_edit_get_date (E_DATE_EDIT (widget),
- &anniversary.year,
- &anniversary.month,
- &anniversary.day)) {
- /* g_print ("%d %d %d\n", anniversary.year, anniversary.month, anniversary.day); */
- e_contact_set (contact, E_CONTACT_ANNIVERSARY, &anniversary);
- } else
- e_contact_set (contact, E_CONTACT_ANNIVERSARY, NULL);
- }
-
- widget = glade_xml_get_widget(editor->gui, "dateedit-birthday");
- if (widget && E_IS_DATE_EDIT(widget)) {
- if (e_date_edit_get_date (E_DATE_EDIT (widget),
- &bday.year,
- &bday.month,
- &bday.day)) {
- /* g_print ("%d %d %d\n", bday.year, bday.month, bday.day); */
- e_contact_set (contact, E_CONTACT_BIRTH_DATE, &bday);
- } else
- e_contact_set (contact, E_CONTACT_BIRTH_DATE, NULL);
- }
- }
-}
-
-/**
- * e_contact_editor_raise:
- * @config: The %EContactEditor object.
- *
- * Raises the dialog associated with this %EContactEditor object.
- */
-void
-e_contact_editor_raise (EContactEditor *editor)
-{
- /* FIXME: perhaps we should raise at realize time */
- if (GTK_WIDGET (editor->app)->window)
- gdk_window_raise (GTK_WIDGET (editor->app)->window);
-}
-
-/**
- * e_contact_editor_show:
- * @ce: The %EContactEditor object.
- *
- * Shows the dialog associated with this %EContactEditor object.
- */
-void
-e_contact_editor_show (EContactEditor *ce)
-{
- gtk_widget_show (ce->app);
-}
-
-GtkWidget *
-e_contact_editor_create_date(gchar *name,
- gchar *string1, gchar *string2,
- gint int1, gint int2);
-
-GtkWidget *
-e_contact_editor_create_date(gchar *name,
- gchar *string1, gchar *string2,
- gint int1, gint int2)
-{
- GtkWidget *widget = e_date_edit_new ();
- e_date_edit_set_allow_no_date_set (E_DATE_EDIT (widget),
- TRUE);
- e_date_edit_set_show_time (E_DATE_EDIT (widget), FALSE);
- e_date_edit_set_time (E_DATE_EDIT (widget), -1);
- gtk_widget_show (widget);
- return widget;
-}
-
-GtkWidget *
-e_contact_editor_create_web(gchar *name,
- gchar *string1, gchar *string2,
- gint int1, gint int2);
-
-GtkWidget *
-e_contact_editor_create_web(gchar *name,
- gchar *string1, gchar *string2,
- gint int1, gint int2)
-{
- GtkWidget *widget = e_url_entry_new ();
- gtk_widget_show (widget);
- return widget;
-}
-
-static void
-enable_widget (GtkWidget *widget, gboolean enabled)
-{
- if (GTK_IS_ENTRY (widget)) {
- gtk_editable_set_editable (GTK_EDITABLE (widget), enabled);
- }
- else if (GTK_IS_TEXT_VIEW (widget)) {
- gtk_text_view_set_editable (GTK_TEXT_VIEW (widget), enabled);
- }
- else if (GTK_IS_COMBO (widget)) {
- gtk_editable_set_editable (GTK_EDITABLE (GTK_COMBO (widget)->entry),
- enabled);
- gtk_widget_set_sensitive (GTK_COMBO (widget)->button, enabled);
- }
- else if (E_IS_URL_ENTRY (widget)) {
- GtkWidget *e = e_url_entry_get_entry (E_URL_ENTRY (widget));
- gtk_editable_set_editable (GTK_EDITABLE (e), enabled);
- }
- else if (E_IS_DATE_EDIT (widget)) {
- e_date_edit_set_editable (E_DATE_EDIT (widget), enabled);
- }
- else
- gtk_widget_set_sensitive (widget, enabled);
-}
-
-
-gboolean
-e_contact_editor_request_close_all (void)
-{
- GSList *p;
- GSList *pnext;
- gboolean retval;
-
- retval = TRUE;
- for (p = all_contact_editors; p != NULL; p = pnext) {
- pnext = p->next;
-
- e_contact_editor_raise (E_CONTACT_EDITOR (p->data));
- if (! prompt_to_save_changes (E_CONTACT_EDITOR (p->data))) {
- retval = FALSE;
- break;
- }
-
- close_dialog (E_CONTACT_EDITOR (p->data));
- }
-
- return retval;
-}
diff --git a/addressbook/gui/contact-editor/e-contact-editor.h b/addressbook/gui/contact-editor/e-contact-editor.h
deleted file mode 100644
index 27baa9f0fc..0000000000
--- a/addressbook/gui/contact-editor/e-contact-editor.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* e-contact-editor.h
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-#ifndef __E_CONTACT_EDITOR_H__
-#define __E_CONTACT_EDITOR_H__
-
-#include <libgnomeui/gnome-app.h>
-#include <libgnomeui/gnome-app-helper.h>
-#include <bonobo/bonobo-ui-component.h>
-#include <glade/glade.h>
-
-#include <libebook/e-book-async.h>
-#include <libebook/e-contact.h>
-
-G_BEGIN_DECLS
-
-/* EContactEditor - A dialog displaying information about a contact.
- *
- * The following arguments are available:
- *
- * name type read/write description
- * --------------------------------------------------------------------------------
- * card ECard * RW The card currently being edited
- */
-
-#define E_TYPE_CONTACT_EDITOR (e_contact_editor_get_type ())
-#define E_CONTACT_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_CONTACT_EDITOR, EContactEditor))
-#define E_CONTACT_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_CONTACT_EDITOR, EContactEditorClass))
-#define E_IS_CONTACT_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_CONTACT_EDITOR))
-#define E_IS_CONTACT_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_CONTACT_EDITOR))
-
-
-typedef struct _EContactEditor EContactEditor;
-typedef struct _EContactEditorClass EContactEditorClass;
-
-struct _EContactEditor
-{
- GtkObject object;
-
- /* item specific fields */
- EBook *book;
- EContact *contact;
-
- /* UI handler */
- BonoboUIComponent *uic;
-
- GladeXML *gui;
- GtkWidget *app;
- GnomeUIInfo *email_info;
- GnomeUIInfo *phone_info;
- GnomeUIInfo *address_info;
- GtkWidget *email_popup;
- GtkWidget *phone_popup;
- GtkWidget *address_popup;
- GList *email_list;
- GList *phone_list;
- GList *address_list;
-
- EContactName *name;
- char *company;
-
- EContactField email_choice;
- EContactField phone_choice[4];
- EContactField address_choice;
- EContactField address_mailing;
-
- /* Whether we are editing a new contact or an existing one */
- guint is_new_contact : 1;
-
- /* Whether the contact has been changed since bringing up the contact editor */
- guint changed : 1;
-
- /* Whether the contact editor will accept modifications */
- guint editable : 1;
-
- /* Whether the fullname will accept modifications */
- guint fullname_editable : 1;
-
-#if notyet
- /* Whether each of the addresses are editable */
- gboolean address_editable[E_CARD_SIMPLE_ADDRESS_ID_LAST];
-#endif
-
- /* Whether an async wombat call is in progress */
- guint in_async_call : 1;
-
- EList *writable_fields;
-};
-
-struct _EContactEditorClass
-{
- GtkObjectClass parent_class;
-
- /* Notification signals */
-
- void (* contact_added) (EContactEditor *ce, EBookStatus status, EContact *contact);
- void (* contact_modified) (EContactEditor *ce, EBookStatus status, EContact *contact);
- void (* contact_deleted) (EContactEditor *ce, EBookStatus status, EContact *contact);
- void (* editor_closed) (EContactEditor *ce);
-};
-
-EContactEditor *e_contact_editor_new (EBook *book,
- EContact *contact,
- gboolean is_new_contact,
- gboolean editable);
-GType e_contact_editor_get_type (void);
-
-void e_contact_editor_show (EContactEditor *editor);
-void e_contact_editor_close (EContactEditor *editor);
-void e_contact_editor_raise (EContactEditor *editor);
-
-gboolean e_contact_editor_confirm_delete (GtkWindow *parent);
-
-gboolean e_contact_editor_request_close_all (void);
-
-G_END_DECLS
-
-#endif /* __E_CONTACT_EDITOR_H__ */
diff --git a/addressbook/gui/contact-editor/e-contact-quick-add.c b/addressbook/gui/contact-editor/e-contact-quick-add.c
deleted file mode 100644
index 0f59c1145f..0000000000
--- a/addressbook/gui/contact-editor/e-contact-quick-add.c
+++ /dev/null
@@ -1,457 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * e-contact-quick-add.c
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Developed by Jon Trowbridge <trow@ximian.com>
- */
-
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA.
- */
-
-#include <config.h>
-#include <ctype.h>
-#include <string.h>
-#include <glib.h>
-#include <gtk/gtkentry.h>
-#include <gtk/gtklabel.h>
-#include <gtk/gtktable.h>
-#include <gtk/gtkdialog.h>
-#include <gtk/gtkstock.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnomeui/gnome-app.h>
-#include <libebook/e-book.h>
-#include <libebook/e-contact.h>
-#include <addressbook/gui/component/addressbook.h>
-#include <addressbook/util/eab-book-util.h>
-#include "e-contact-editor.h"
-#include "e-contact-quick-add.h"
-#include "eab-contact-merging.h"
-
-typedef struct _QuickAdd QuickAdd;
-struct _QuickAdd {
- gchar *name;
- gchar *email;
- EContact *contact;
-
- EContactQuickAddCallback cb;
- gpointer closure;
-
- GtkWidget *name_entry;
- GtkWidget *email_entry;
-
- gint refs;
-
-};
-
-static QuickAdd *
-quick_add_new (void)
-{
- QuickAdd *qa = g_new0 (QuickAdd, 1);
- qa->contact = e_contact_new ();
- qa->refs = 1;
- return qa;
-}
-
-static void
-quick_add_ref (QuickAdd *qa)
-{
- if (qa) {
- ++qa->refs;
- }
-}
-
-static void
-quick_add_unref (QuickAdd *qa)
-{
- if (qa) {
- --qa->refs;
- if (qa->refs == 0) {
- g_free (qa->name);
- g_free (qa->email);
- g_object_unref (qa->contact);
- g_free (qa);
- }
- }
-}
-
-static void
-quick_add_set_name (QuickAdd *qa, const gchar *name)
-{
-#if notyet
- EContactName *card_name;
-
- if (name == qa->name)
- return;
-
- g_free (qa->name);
-
- card_name = e_card_name_from_string (name);
- qa->name = e_card_name_to_string (card_name);
-
- g_object_set (qa->card,
- "full_name", qa->name,
- NULL);
-
- e_card_name_unref (card_name);
-#endif
-}
-
-static void
-quick_add_set_email (QuickAdd *qa, const gchar *email)
-{
- if (email == qa->email)
- return;
-
- g_free (qa->email);
- qa->email = g_strdup (email);
-
- e_contact_set (qa->contact, E_CONTACT_EMAIL_1, (char*)email);
-}
-
-static void
-merge_cb (EBook *book, EBookStatus status, gpointer closure)
-{
- QuickAdd *qa = (QuickAdd *) closure;
-
- if (status == E_BOOK_ERROR_OK) {
- eab_merging_book_add_contact (book, qa->contact, NULL, NULL);
- if (qa->cb)
- qa->cb (qa->contact, qa->closure);
- g_object_unref (book);
- } else {
- /* Something went wrong. */
- if (book)
- g_object_unref (book);
- if (qa->cb)
- qa->cb (NULL, qa->closure);
- }
-
- quick_add_unref (qa);
-}
-
-static void
-quick_add_merge_contact (QuickAdd *qa)
-{
- quick_add_ref (qa);
-
- addressbook_load_default_book (merge_cb, qa);
-}
-
-
-/*
- * Raise a contact editor with all fields editable, and hook up all signals accordingly.
- */
-
-static void
-contact_added_cb (EContactEditor *ce, EBookStatus status, EContact *contact, gpointer closure)
-{
- QuickAdd *qa = (QuickAdd *) g_object_get_data (G_OBJECT (ce), "quick_add");
-
- if (qa) {
-
- if (qa->cb)
- qa->cb (qa->contact, qa->closure);
-
- /* We don't need to unref qa because we set_data_full below */
- g_object_set_data (G_OBJECT (ce), "quick_add", NULL);
- }
-}
-
-static void
-editor_closed_cb (GtkWidget *w, gpointer closure)
-{
- QuickAdd *qa = (QuickAdd *) g_object_get_data (G_OBJECT (w), "quick_add");
-
- if (qa)
- /* We don't need to unref qa because we set_data_full below */
- g_object_set_data (G_OBJECT (w), "quick_add", NULL);
-
- g_object_unref (w);
-}
-
-static void
-ce_have_book (EBook *book, EBookStatus status, gpointer closure)
-{
- QuickAdd *qa = (QuickAdd *) closure;
-
- if (status != E_BOOK_ERROR_OK) {
- if (book)
- g_object_unref (book);
- g_warning ("Couldn't open local address book.");
- quick_add_unref (qa);
- } else {
- EContactEditor *contact_editor = e_contact_editor_new (book, qa->contact, TRUE, TRUE /* XXX */);
-
- /* mark it as changed so the Save buttons are enabled when we bring up the dialog. */
- g_object_set (contact_editor,
- "changed", TRUE,
- NULL);
-
- /* We pass this via object data, so that we don't get a dangling pointer referenced if both
- the "contact_added" and "editor_closed" get emitted. (Which, based on a backtrace in bugzilla,
- I think can happen and cause a crash. */
- g_object_set_data_full (G_OBJECT (contact_editor), "quick_add", qa,
- (GDestroyNotify) quick_add_unref);
-
- g_signal_connect (contact_editor,
- "contact_added",
- G_CALLBACK (contact_added_cb),
- NULL);
- g_signal_connect (contact_editor,
- "editor_closed",
- G_CALLBACK (editor_closed_cb),
- NULL);
-
- g_object_unref (book);
- }
-}
-
-static void
-edit_contact (QuickAdd *qa)
-{
- addressbook_load_default_book (ce_have_book, qa);
-}
-
-#define QUICK_ADD_RESPONSE_EDIT_FULL 2
-
-static void
-clicked_cb (GtkWidget *w, gint button, gpointer closure)
-{
- QuickAdd *qa = (QuickAdd *) closure;
-
- /* Get data out of entries. */
- if (button == GTK_RESPONSE_OK || button == QUICK_ADD_RESPONSE_EDIT_FULL) {
- gchar *name = NULL;
- gchar *email = NULL;
-
- if (qa->name_entry) {
- gchar *tmp;
- tmp = gtk_editable_get_chars (GTK_EDITABLE (qa->name_entry), 0, -1);
- name = tmp;
- }
-
- if (qa->email_entry) {
- gchar *tmp;
- tmp = gtk_editable_get_chars (GTK_EDITABLE (qa->email_entry), 0, -1);
- email = tmp;
- }
-
- quick_add_set_name (qa, name);
- quick_add_set_email (qa, email);
-
- g_free (name);
- g_free (email);
- }
-
- gtk_widget_destroy (w);
-
- if (button == GTK_RESPONSE_OK) {
-
- /* OK */
- quick_add_merge_contact (qa);
-
- } else if (button == QUICK_ADD_RESPONSE_EDIT_FULL) {
-
- /* EDIT FULL */
- edit_contact (qa);
-
- } else {
- /* CANCEL */
- quick_add_unref (qa);
- }
-
-}
-
-static GtkWidget *
-build_quick_add_dialog (QuickAdd *qa)
-{
- GtkWidget *dialog;
- GtkTable *table;
- const gint xpad=6, ypad=6;
-
- g_return_val_if_fail (qa != NULL, NULL);
-
- dialog = gtk_dialog_new_with_buttons (_("Contact Quick-Add"),
- NULL, /* XXX */
- (GtkDialogFlags) 0,
- _("_Edit Full"), QUICK_ADD_RESPONSE_EDIT_FULL,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OK, GTK_RESPONSE_OK,
- NULL);
-
- g_signal_connect (dialog, "response", G_CALLBACK (clicked_cb), qa);
-
- qa->name_entry = gtk_entry_new ();
- if (qa->name)
- gtk_entry_set_text (GTK_ENTRY (qa->name_entry), qa->name);
-
-
- qa->email_entry = gtk_entry_new ();
- if (qa->email)
- gtk_entry_set_text (GTK_ENTRY (qa->email_entry), qa->email);
-
- table = GTK_TABLE (gtk_table_new (2, 2, FALSE));
-
- gtk_table_attach (table, gtk_label_new_with_mnemonic (_("_Full Name:")),
- 0, 1, 0, 1,
- 0, 0, xpad, ypad);
- gtk_table_attach (table, qa->name_entry,
- 1, 2, 0, 1,
- GTK_EXPAND | GTK_FILL, GTK_EXPAND, xpad, ypad);
- gtk_table_attach (table, gtk_label_new_with_mnemonic (_("E-_mail:")),
- 0, 1, 1, 2,
- 0, 0, xpad, ypad);
- gtk_table_attach (table, qa->email_entry,
- 1, 2, 1, 2,
- GTK_EXPAND | GTK_FILL, GTK_EXPAND, xpad, ypad);
- gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox),
- 6);
-
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox),6);
-
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
- GTK_WIDGET (table),
- TRUE, TRUE, 6);
- gtk_widget_show_all (GTK_WIDGET (table));
-
-
- return dialog;
-}
-
-void
-e_contact_quick_add (const gchar *in_name, const gchar *email,
- EContactQuickAddCallback cb, gpointer closure)
-{
- QuickAdd *qa;
- GtkWidget *dialog;
- gchar *name = NULL;
- gint len;
-
- /* We need to have *something* to work with. */
- if (in_name == NULL && email == NULL) {
- if (cb)
- cb (NULL, closure);
- return;
- }
-
- if (in_name) {
- name = g_strdup (in_name);
-
- /* Remove extra whitespace and the quotes some mailers put around names. */
- g_strstrip (name);
- len = strlen (name);
- if ((name[0] == '\'' && name[len-1] == '\'') || (name[0] == '"' && name[len-1] == '"')) {
- name[0] = ' ';
- name[len-1] = ' ';
- }
- g_strstrip (name);
- }
-
- qa = quick_add_new ();
- qa->cb = cb;
- qa->closure = closure;
- if (name)
- quick_add_set_name (qa, name);
- if (email)
- quick_add_set_email (qa, email);
-
- dialog = build_quick_add_dialog (qa);
- gtk_widget_show_all (dialog);
-
- g_free (name);
-}
-
-void
-e_contact_quick_add_free_form (const gchar *text, EContactQuickAddCallback cb, gpointer closure)
-{
- gchar *name=NULL, *email=NULL;
- const gchar *last_at, *s;
- gboolean in_quote;
-
- if (text == NULL) {
- e_contact_quick_add (NULL, NULL, cb, closure);
- return;
- }
-
- /* Look for things that look like e-mail addresses embedded in text */
- in_quote = FALSE;
- last_at = NULL;
- for (s = text; *s; ++s) {
- if (*s == '@' && !in_quote)
- last_at = s;
- else if (*s == '"')
- in_quote = !in_quote;
- }
-
-
- if (last_at == NULL) {
- /* No at sign, so we treat it all as the name */
- name = g_strdup (text);
- } else {
- gboolean bad_char = FALSE;
-
- /* walk backwards to whitespace or a < or a quote... */
- while (last_at >= text && !bad_char
- && !(isspace ((gint) *last_at) || *last_at == '<' || *last_at == '"')) {
- /* Check for some stuff that can't appear in a legal e-mail address. */
- if (*last_at == '['
- || *last_at == ']'
- || *last_at == '('
- || *last_at == ')')
- bad_char = TRUE;
- --last_at;
- }
- if (last_at < text)
- last_at = text;
-
- /* ...and then split the text there */
- if (!bad_char) {
- if (text < last_at)
- name = g_strndup (text, last_at-text);
- email = g_strdup (last_at);
- }
- }
-
- /* If all else has failed, make it the name. */
- if (name == NULL && email == NULL)
- name = g_strdup (text);
-
-
-
- /* Clean up email, remove bracketing <>s */
- if (email && *email) {
- gboolean changed = FALSE;
- g_strstrip (email);
- if (*email == '<') {
- *email = ' ';
- changed = TRUE;
- }
- if (email[strlen (email)-1] == '>') {
- email[strlen (email)-1] = ' ';
- changed = TRUE;
- }
- if (changed)
- g_strstrip (email);
- }
-
-
- e_contact_quick_add (name, email, cb, closure);
- g_free (name);
- g_free (email);
-}
diff --git a/addressbook/gui/contact-editor/e-contact-quick-add.h b/addressbook/gui/contact-editor/e-contact-quick-add.h
deleted file mode 100644
index a969211915..0000000000
--- a/addressbook/gui/contact-editor/e-contact-quick-add.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * e-contact-quick-add.h
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Developed by Jon Trowbridge <trow@ximian.com>
- */
-
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA.
- */
-
-#ifndef __E_CONTACT_QUICK_ADD_H__
-#define __E_CONTACT_QUICK_ADD_H__
-
-#include <libebook/e-contact.h>
-
-typedef void (*EContactQuickAddCallback) (EContact *new_contact, gpointer closure);
-
-void e_contact_quick_add (const gchar *name, const gchar *email,
- EContactQuickAddCallback cb, gpointer closure);
-
-void e_contact_quick_add_free_form (const gchar *text, EContactQuickAddCallback cb, gpointer closure);
-
-#endif /* __E_CONTACT_QUICK_ADD_H__ */
-
diff --git a/addressbook/gui/contact-editor/fulladdr.glade b/addressbook/gui/contact-editor/fulladdr.glade
deleted file mode 100644
index c7767b9751..0000000000
--- a/addressbook/gui/contact-editor/fulladdr.glade
+++ /dev/null
@@ -1,446 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-
-<widget class="GtkDialog" id="dialog-checkaddress">
- <property name="title" translatable="yes">Full Address</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">True</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="has_separator">True</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="vbox-container">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">8</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="hbuttonbox1">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="button1">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button2">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="table-checkaddress">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="n_rows">4</property>
- <property name="n_columns">4</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label-street">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Address:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-street</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-city">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Ci_ty:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-city</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-city">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-ext">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-po">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_PO Box:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-po</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-ext">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Address _2:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-ext</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-po">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-street">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="has_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">4</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-region">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_State/Province:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-region</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-region">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCombo" id="combo-country">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="value_in_list">False</property>
- <property name="allow_empty">True</property>
- <property name="case_sensitive">False</property>
- <property name="enable_arrow_keys">True</property>
- <property name="enable_arrows_always">False</property>
-
- <child internal-child="entry">
- <widget class="GtkEntry" id="entry-country">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- </child>
-
- <child internal-child="list">
- <widget class="GtkList" id="convertwidget1">
- <property name="visible">True</property>
- <property name="selection_mode">GTK_SELECTION_BROWSE</property>
-
- <child>
- <widget class="GtkListItem" id="convertwidget2">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget3">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-code">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-code">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_ZIP Code:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-code</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-country">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Countr_y:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-country</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/addressbook/gui/contact-editor/fullname.glade b/addressbook/gui/contact-editor/fullname.glade
deleted file mode 100644
index 9e170c93d0..0000000000
--- a/addressbook/gui/contact-editor/fullname.glade
+++ /dev/null
@@ -1,674 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-
-<widget class="GtkDialog" id="dialog-checkfullname">
- <property name="title" translatable="yes">Full Name</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">True</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="has_separator">True</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="vbox-container">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">8</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="hbuttonbox1">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="button1">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button2">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="table-checkfullname">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="n_rows">5</property>
- <property name="n_columns">3</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkCombo" id="combo-title">
- <property name="visible">True</property>
- <property name="value_in_list">False</property>
- <property name="allow_empty">True</property>
- <property name="case_sensitive">False</property>
- <property name="enable_arrow_keys">True</property>
- <property name="enable_arrows_always">False</property>
-
- <child internal-child="entry">
- <widget class="GtkEntry" id="entry-title">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- </child>
-
- <child internal-child="list">
- <widget class="GtkList" id="convertwidget1">
- <property name="visible">True</property>
- <property name="selection_mode">GTK_SELECTION_BROWSE</property>
-
- <child>
- <widget class="GtkListItem" id="convertwidget2">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget3">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget4">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget5">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Mr.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget6">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget7">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Mrs.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget8">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget9">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Ms.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget10">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget11">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Miss</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget12">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget13">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Dr.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget14">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget15">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCombo" id="combo-suffix">
- <property name="visible">True</property>
- <property name="value_in_list">False</property>
- <property name="allow_empty">True</property>
- <property name="case_sensitive">False</property>
- <property name="enable_arrow_keys">True</property>
- <property name="enable_arrows_always">False</property>
-
- <child internal-child="entry">
- <widget class="GtkEntry" id="entry-suffix">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- </child>
-
- <child internal-child="list">
- <widget class="GtkList" id="convertwidget16">
- <property name="visible">True</property>
- <property name="selection_mode">GTK_SELECTION_BROWSE</property>
-
- <child>
- <widget class="GtkListItem" id="convertwidget17">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget18">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget19">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget20">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Sr.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget21">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget22">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Jr.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget23">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget24">
- <property name="visible">True</property>
- <property name="label" translatable="yes">I</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget25">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget26">
- <property name="visible">True</property>
- <property name="label" translatable="yes">II</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget27">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget28">
- <property name="visible">True</property>
- <property name="label" translatable="yes">III</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget29">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget30">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Esq.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget31">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget32">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-first">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-middle">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">3</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-last">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">3</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-first">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_First:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-first</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-title">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Title:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-title</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-middle">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Middle:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-middle</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-last">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Last:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-last</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-suffix">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Suffix:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-suffix</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/addressbook/gui/contact-editor/test-editor.c b/addressbook/gui/contact-editor/test-editor.c
deleted file mode 100644
index 4a8c111563..0000000000
--- a/addressbook/gui/contact-editor/test-editor.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * test-editor.c
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include "config.h"
-
-#include <stdlib.h>
-#include <gtk/gtkmain.h>
-#include <libgnomeui/gnome-app.h>
-#include <libgnomeui/gnome-ui-init.h>
-#include <glade/glade.h>
-#include "e-contact-editor.h"
-#include "ebook/e-card.h"
-
-#define TEST_VCARD \
-"BEGIN:VCARD
-" \
-"FN:Nat
-" \
-"N:Friedman;Nat;D;Mr.
-" \
-"BDAY:1977-08-06
-" \
-"TEL;WORK:617 679 1984
-" \
-"TEL;CELL:123 456 7890
-" \
-"EMAIL;INTERNET:nat@nat.org
-" \
-"EMAIL;INTERNET:nat@ximian.com
-" \
-"ADR;WORK;POSTAL:P.O. Box 101;;;Any Town;CA;91921-1234;
-" \
-"ADR;HOME;POSTAL;INTL:P.O. Box 202;;;Any Town 2;MI;12344-4321;USA
-" \
-"END:VCARD
-" \
-"
-"
-
-static char *
-read_file (char *name)
-{
- int len;
- char buff[65536];
- char line[1024];
- FILE *f;
-
- f = fopen (name, "r");
- if (f == NULL)
- g_error ("Unable to open %s!\n", name);
-
- len = 0;
- while (fgets (line, sizeof (line), f) != NULL) {
- strcpy (buff + len, line);
- len += strlen (line);
- }
-
- fclose (f);
-
- return g_strdup (buff);
-}
-
-/* Callback used when a contact editor is closed */
-static void
-editor_closed_cb (EContactEditor *ce, gpointer data)
-{
- static int count = 2;
-
- count--;
- g_object_unref (ce);
-
- if (count == 0)
- exit (0);
-}
-
-#if 0
-static void about_callback( GtkWidget *widget, gpointer data )
-{
-
- const gchar *authors[] =
- {
- "Christopher James Lahey <clahey@umich.edu>",
- NULL
- };
-
- GtkWidget *about =
- gnome_about_new ( _( "Contact Editor Test" ), VERSION,
- _( "Copyright (C) 2000, Ximian, Inc." ),
- authors,
- _( "This should test the contact editor canvas item" ),
- NULL);
- gtk_widget_show (about);
-}
-#endif
-
-int main( int argc, char *argv[] )
-{
- char *cardstr;
- EContactEditor *ce;
-
- gnome_program_init("Contact Editor Test", VERSION, LIBGNOMEUI_MODULE, argc, argv, NULL);
-
- glade_init ();
-
- cardstr = NULL;
- if (argc == 2)
- cardstr = read_file (argv [1]);
-
- if (cardstr == NULL)
- cardstr = TEST_VCARD;
-
- ce = e_contact_editor_new (NULL, e_card_new_with_default_charset (cardstr, "ISO-8859-1"), TRUE, FALSE);
- g_signal_connect (ce, "editor_closed",
- G_CALLBACK (editor_closed_cb), NULL);
-
- ce = e_contact_editor_new (NULL, e_card_new_with_default_charset (cardstr, "ISO-8859-1"), TRUE, FALSE);
- g_signal_connect (ce, "editor_closed",
- G_CALLBACK (editor_closed_cb), NULL);
-
- gtk_main();
-
- /* Not reached. */
- return 0;
-}
diff --git a/addressbook/gui/contact-list-editor/.cvsignore b/addressbook/gui/contact-list-editor/.cvsignore
deleted file mode 100644
index f151930645..0000000000
--- a/addressbook/gui/contact-list-editor/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-Makefile.in
-Makefile
-.deps
-.pure
-e-contact-list-editor-marshal.c
-e-contact-list-editor-marshal.h
diff --git a/addressbook/gui/contact-list-editor/Makefile.am b/addressbook/gui/contact-list-editor/Makefile.am
deleted file mode 100644
index 43abc3ff47..0000000000
--- a/addressbook/gui/contact-list-editor/Makefile.am
+++ /dev/null
@@ -1,39 +0,0 @@
-INCLUDES = \
- -I$(top_srcdir) \
- -I$(top_srcdir)/addressbook/ \
- -I$(top_srcdir)/addressbook/backend \
- -I$(top_builddir)/addressbook/backend \
- -I$(top_srcdir)/addressbook/gui/merging \
- -I$(top_srcdir)/addressbook/gui/contact-editor \
- -I$(top_builddir)/shell \
- -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \
- -DEVOLUTION_ETSPECDIR=\""$(etspecdir)"\" \
- -DEVOLUTION_DATADIR=\""$(datadir)"\" \
- -DEVOLUTION_IMAGESDIR=\""$(imagesdir)"\" \
- -DEVOLUTION_UIDIR=\""$(evolutionuidir)\"" \
- -DPREFIX=\""$(prefix)"\" \
- -DG_LOG_DOMAIN=\"contact-list-editor\" \
- $(EVOLUTION_ADDRESSBOOK_CFLAGS)
-
-noinst_LTLIBRARIES = \
- libecontactlisteditor.la
-
-libecontactlisteditor_la_SOURCES = \
- $(MARSHAL_GENERATED) \
- e-contact-list-editor.c \
- e-contact-list-editor.h \
- e-contact-list-model.c \
- e-contact-list-model.h
-
-MARSHAL_GENERATED = e-contact-list-editor-marshal.c e-contact-list-editor-marshal.h
-@EVO_MARSHAL_RULE@
-
-glade_DATA = contact-list-editor.glade
-etspec_DATA = e-contact-list-editor.etspec
-
-BUILT_SOURCES = $(MARSHAL_GENERATED)
-CLEANFILES = $(BUILT_SOURCES)
-
-EXTRA_DIST = $(glade_DATA) \
- $(etspec_DATA) \
- e-contact-list-editor-marshal.list
diff --git a/addressbook/gui/contact-list-editor/contact-list-editor.glade b/addressbook/gui/contact-list-editor/contact-list-editor.glade
deleted file mode 100644
index 002e697105..0000000000
--- a/addressbook/gui/contact-list-editor/contact-list-editor.glade
+++ /dev/null
@@ -1,313 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-<requires lib="gnome"/>
-<requires lib="bonobo"/>
-
-<widget class="GnomeApp" id="contact list editor">
- <property name="title" translatable="yes">contact-list-editor</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="default_width">426</property>
- <property name="default_height">304</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="enable_layout_config">True</property>
-
- <child internal-child="dock">
- <widget class="BonoboDock" id="dock1">
- <property name="visible">True</property>
- <property name="allow_floating">True</property>
-
- <child>
- <widget class="GtkVBox" id="vbox8">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkHBox" id="hbox6">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label10">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_List name:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">list-name-entry</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="list-name-entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="has_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="list-image">
- <property name="visible">True</property>
- <property name="creation_function">e_create_image_widget</property>
- <property name="string1">evolution-contacts-plain.png</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Sat, 23 Jun 2001 05:59:21 GMT</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFrame" id="frame3">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkHBox" id="hbox7">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkVBox" id="vbox9">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label11">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Type an email address or drag a contact into the list below:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="email-entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="contact-list-table">
- <property name="visible">True</property>
- <property name="creation_function">e_contact_list_editor_create_table</property>
- <property name="string1"></property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Sat, 23 Jun 2001 06:00:16 GMT</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="visible-addrs-checkbutton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Hide addresses when sending mail to this list</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox10">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="label12">
- <property name="visible">True</property>
- <property name="label" translatable="yes">
-</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVButtonBox" id="vbuttonbox4">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_START</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkButton" id="add-email-button">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-add</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="remove-button">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-remove</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label11">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Members</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor-marshal.list b/addressbook/gui/contact-list-editor/e-contact-list-editor-marshal.list
deleted file mode 100644
index 8d94a0bf3b..0000000000
--- a/addressbook/gui/contact-list-editor/e-contact-list-editor-marshal.list
+++ /dev/null
@@ -1,4 +0,0 @@
-INT:OBJECT
-NONE:INT,OBJECT
-NONE:INT,OBJECT
-NONE:NONE
diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.c b/addressbook/gui/contact-list-editor/e-contact-list-editor.c
deleted file mode 100644
index a475d15cd6..0000000000
--- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c
+++ /dev/null
@@ -1,1297 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* e-contact-list-editor.c
- * Copyright (C) 2001 Ximian, Inc.
- * Author: Chris Toshok <toshok@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-
-#include "e-contact-list-editor.h"
-
-#include <string.h>
-#include <glib.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnomeui/gnome-window-icon.h>
-#include <bonobo/bonobo-ui-container.h>
-#include <bonobo/bonobo-ui-util.h>
-#include <bonobo/bonobo-window.h>
-#include <gal/e-table/e-table-scrolled.h>
-#include <libgnomevfs/gnome-vfs-ops.h>
-#include "shell/evolution-shell-component-utils.h"
-
-#include "addressbook/gui/widgets/eab-gui-util.h"
-#include "addressbook/util/eab-book-util.h"
-
-#include "e-contact-editor.h"
-#include "e-contact-list-model.h"
-#include "e-contact-list-editor-marshal.h"
-
-/* Signal IDs */
-enum {
- LIST_ADDED,
- LIST_MODIFIED,
- LIST_DELETED,
- EDITOR_CLOSED,
- LAST_SIGNAL
-};
-
-static void e_contact_list_editor_init (EContactListEditor *editor);
-static void e_contact_list_editor_class_init (EContactListEditorClass *klass);
-static void e_contact_list_editor_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static void e_contact_list_editor_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
-static void e_contact_list_editor_dispose (GObject *object);
-
-static void create_ui (EContactListEditor *ce);
-static void set_editable (EContactListEditor *editor);
-static void command_state_changed (EContactListEditor *editor);
-static void close_dialog (EContactListEditor *cle);
-static void extract_info(EContactListEditor *editor);
-static void fill_in_info(EContactListEditor *editor);
-
-static void add_email_cb (GtkWidget *w, EContactListEditor *editor);
-static void remove_entry_cb (GtkWidget *w, EContactListEditor *editor);
-static void list_name_changed_cb (GtkWidget *w, EContactListEditor *editor);
-static void visible_addrs_toggled_cb (GtkWidget *w, EContactListEditor *editor);
-
-static gint app_delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer data);
-static gboolean table_drag_drop_cb (ETable *table, int row, int col, GdkDragContext *context,
- gint x, gint y, guint time, EContactListEditor *editor);
-static gboolean table_drag_motion_cb (ETable *table, int row, int col, GdkDragContext *context,
- gint x, gint y, guint time, EContactListEditor *editor);
-static void table_drag_data_received_cb (ETable *table, int row, int col,
- GdkDragContext *context,
- gint x, gint y,
- GtkSelectionData *selection_data, guint info, guint time,
- EContactListEditor *editor);
-static gboolean image_drag_motion_cb (GtkWidget *widget,
- GdkDragContext *context,
- gint x, gint y, guint time, EContactListEditor *editor);
-static gboolean image_drag_drop_cb (GtkWidget *widget,
- GdkDragContext *context,
- gint x, gint y, guint time, EContactListEditor *editor);
-static void image_drag_data_received_cb (GtkWidget *widget,
- GdkDragContext *context,
- gint x, gint y,
- GtkSelectionData *selection_data,
- guint info, guint time, EContactListEditor *editor);
-
-static GtkObjectClass *parent_class = NULL;
-
-static guint contact_list_editor_signals[LAST_SIGNAL];
-
-enum DndTargetType {
- DND_TARGET_TYPE_VCARD,
- DND_TARGET_TYPE_URI_LIST
-};
-#define VCARD_TYPE "text/x-vcard"
-#define URI_LIST_TYPE "text/uri-list"
-
-static GtkTargetEntry list_drag_types[] = {
- { VCARD_TYPE, 0, DND_TARGET_TYPE_VCARD },
-};
-static const int num_list_drag_types = sizeof (list_drag_types) / sizeof (list_drag_types[0]);
-
-static GtkTargetEntry image_drag_types[] = {
- { URI_LIST_TYPE, 0, DND_TARGET_TYPE_URI_LIST },
-};
-static const int num_image_drag_types = sizeof (image_drag_types) / sizeof (image_drag_types[0]);
-
-/* The arguments we take */
-enum {
- PROP_0,
- PROP_BOOK,
- PROP_CONTACT,
- PROP_IS_NEW_LIST,
- PROP_EDITABLE
-};
-
-static GSList *all_contact_list_editors = NULL;
-
-GType
-e_contact_list_editor_get_type (void)
-{
- static GType cle_type = 0;
-
- if (!cle_type) {
- static const GTypeInfo cle_info = {
- sizeof (EContactListEditorClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_contact_list_editor_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EContactListEditor),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_contact_list_editor_init,
- };
-
- cle_type = g_type_register_static (GTK_TYPE_OBJECT, "EContactListEditor", &cle_info, 0);
- }
-
- return cle_type;
-}
-
-
-static void
-e_contact_list_editor_class_init (EContactListEditorClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_ref (GTK_TYPE_OBJECT);
-
- object_class->set_property = e_contact_list_editor_set_property;
- object_class->get_property = e_contact_list_editor_get_property;
- /* object_class->dispose = e_contact_list_editor_dispose;*/
-
- g_object_class_install_property (object_class, PROP_BOOK,
- g_param_spec_object ("book",
- _("Book"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_BOOK,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_CONTACT,
- g_param_spec_object ("contact",
- _("Contact"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_CONTACT,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_IS_NEW_LIST,
- g_param_spec_boolean ("is_new_list",
- _("Is New List"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_EDITABLE,
- g_param_spec_boolean ("editable",
- _("Editable"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- contact_list_editor_signals[LIST_ADDED] =
- g_signal_new ("list_added",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EContactListEditorClass, list_added),
- NULL, NULL,
- e_contact_list_editor_marshal_NONE__INT_OBJECT,
- G_TYPE_NONE, 2,
- G_TYPE_INT, G_TYPE_OBJECT);
-
- contact_list_editor_signals[LIST_MODIFIED] =
- g_signal_new ("list_modified",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EContactListEditorClass, list_modified),
- NULL, NULL,
- e_contact_list_editor_marshal_NONE__INT_OBJECT,
- G_TYPE_NONE, 2,
- G_TYPE_INT, G_TYPE_OBJECT);
-
- contact_list_editor_signals[LIST_DELETED] =
- g_signal_new ("list_deleted",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EContactListEditorClass, list_deleted),
- NULL, NULL,
- e_contact_list_editor_marshal_NONE__INT_OBJECT,
- G_TYPE_NONE, 2,
- G_TYPE_INT, G_TYPE_OBJECT);
-
- contact_list_editor_signals[EDITOR_CLOSED] =
- g_signal_new ("editor_closed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EContactListEditorClass, editor_closed),
- NULL, NULL,
- e_contact_list_editor_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-}
-
-static void
-e_contact_list_editor_init (EContactListEditor *editor)
-{
- GladeXML *gui;
- GtkWidget *bonobo_win;
- BonoboUIContainer *container;
- char *icon_path;
- GdkPixbuf *pixbuf;
-
- editor->image_buf = NULL;
- editor->contact = NULL;
- editor->changed = FALSE;
- editor->editable = TRUE;
- editor->in_async_call = FALSE;
- editor->is_new_list = FALSE;
-
- gui = glade_xml_new (EVOLUTION_GLADEDIR "/contact-list-editor.glade", NULL, NULL);
- editor->gui = gui;
-
- editor->app = glade_xml_get_widget (gui, "contact list editor");
-
- editor->table = glade_xml_get_widget (gui, "contact-list-table");
- editor->model = g_object_get_data (G_OBJECT(editor->table), "model");
-
- /* XXX need this for libglade-2 it seems */
- gtk_widget_show (editor->table);
-
- editor->add_button = glade_xml_get_widget (editor->gui, "add-email-button");
- editor->remove_button = glade_xml_get_widget (editor->gui, "remove-button");
-
- editor->email_entry = glade_xml_get_widget (gui, "email-entry");
- editor->list_name_entry = glade_xml_get_widget (gui, "list-name-entry");
- editor->list_image = glade_xml_get_widget (gui, "list-image");
- if (GTK_IS_ALIGNMENT (editor->list_image)) {
- /* deal with the e_create_image_widget code, that wraps the image in an alignment */
- editor->list_image = GTK_BIN (editor->list_image)->child;
- }
- editor->visible_addrs_checkbutton = glade_xml_get_widget (gui, "visible-addrs-checkbutton");
-
- pixbuf = gtk_image_get_pixbuf (GTK_IMAGE (editor->list_image));
- editor->list_image_width = gdk_pixbuf_get_width (pixbuf);
- editor->list_image_height = gdk_pixbuf_get_height (pixbuf);
-
- /* Construct the app */
- bonobo_win = bonobo_window_new ("contact-list-editor", _("Contact List Editor"));
-
- /* FIXME: The sucking bit */
- {
- GtkWidget *contents;
-
- contents = bonobo_dock_get_client_area (gnome_app_get_dock (GNOME_APP (editor->app)));
-
- if (!contents) {
- g_message ("contact_list_editor_construct(): Could not get contents");
- return;
- }
- gtk_widget_ref (contents);
- gtk_container_remove (GTK_CONTAINER (contents->parent), contents);
- bonobo_window_set_contents (BONOBO_WINDOW (bonobo_win), contents);
- gtk_widget_destroy (editor->app);
- editor->app = bonobo_win;
- }
-
- /* Build the menu and toolbar */
-
- container = bonobo_window_get_ui_container (BONOBO_WINDOW (editor->app));
-
- editor->uic = bonobo_ui_component_new_default ();
- if (!editor->uic) {
- g_message ("e_contact_list_editor_init(): eeeeek, could not create the UI handler!");
- return;
- }
- bonobo_ui_component_set_container (editor->uic,
- bonobo_object_corba_objref (
- BONOBO_OBJECT (container)), NULL);
-
- create_ui (editor);
-
- /* connect signals */
- g_signal_connect (editor->add_button,
- "clicked", G_CALLBACK(add_email_cb), editor);
- g_signal_connect (editor->email_entry,
- "activate", G_CALLBACK(add_email_cb), editor);
- g_signal_connect (editor->remove_button,
- "clicked", G_CALLBACK(remove_entry_cb), editor);
- g_signal_connect (editor->list_name_entry,
- "changed", G_CALLBACK(list_name_changed_cb), editor);
- g_signal_connect (editor->visible_addrs_checkbutton,
- "toggled", G_CALLBACK(visible_addrs_toggled_cb), editor);
-
- e_table_drag_dest_set (e_table_scrolled_get_table (E_TABLE_SCROLLED (editor->table)),
- 0, list_drag_types, num_list_drag_types, GDK_ACTION_LINK);
-
- g_signal_connect (e_table_scrolled_get_table (E_TABLE_SCROLLED (editor->table)),
- "table_drag_motion", G_CALLBACK(table_drag_motion_cb), editor);
- g_signal_connect (e_table_scrolled_get_table (E_TABLE_SCROLLED (editor->table)),
- "table_drag_drop", G_CALLBACK (table_drag_drop_cb), editor);
- g_signal_connect (e_table_scrolled_get_table (E_TABLE_SCROLLED (editor->table)),
- "table_drag_data_received", G_CALLBACK(table_drag_data_received_cb), editor);
-
- gtk_drag_dest_set (editor->list_image, 0, image_drag_types, num_image_drag_types, GDK_ACTION_COPY);
- g_signal_connect (editor->list_image,
- "drag_motion", G_CALLBACK (image_drag_motion_cb), editor);
- g_signal_connect (editor->list_image,
- "drag_drop", G_CALLBACK (image_drag_drop_cb), editor);
- g_signal_connect (editor->list_image,
- "drag_data_received", G_CALLBACK (image_drag_data_received_cb), editor);
-
- command_state_changed (editor);
-
- /* Connect to the deletion of the dialog */
-
- g_signal_connect (editor->app, "delete_event",
- G_CALLBACK (app_delete_event_cb), editor);
-
- /* set the icon */
- icon_path = g_build_filename (EVOLUTION_IMAGESDIR, "contact-list-16.png", NULL);
- gnome_window_icon_set_from_file (GTK_WINDOW (editor->app), icon_path);
- g_free (icon_path);
-}
-
-static void
-e_contact_list_editor_dispose (GObject *object)
-{
- EContactListEditor *cle = E_CONTACT_LIST_EDITOR (object);
-
- if (cle->image_buf) {
- g_free (cle->image_buf);
- cle->image_buf = NULL;
- }
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- (* G_OBJECT_CLASS (parent_class)->dispose) (object);
-}
-
-typedef struct {
- EContactListEditor *cle;
- gboolean should_close;
-} EditorCloseStruct;
-
-static void
-list_added_cb (EBook *book, EBookStatus status, const char *id, EditorCloseStruct *ecs)
-{
- EContactListEditor *cle = ecs->cle;
- gboolean should_close = ecs->should_close;
-
- if (cle->app)
- gtk_widget_set_sensitive (cle->app, TRUE);
- cle->in_async_call = FALSE;
-
- e_contact_set (cle->contact, E_CONTACT_UID, (char*)id);
-
- g_signal_emit (cle, contact_list_editor_signals[LIST_ADDED], 0,
- status, cle->contact);
-
- if (status == E_BOOK_ERROR_OK) {
- cle->is_new_list = FALSE;
-
- if (should_close)
- close_dialog (cle);
- else
- command_state_changed (cle);
- }
-
- g_object_unref (cle);
- g_free (ecs);
-}
-
-static void
-list_modified_cb (EBook *book, EBookStatus status, EditorCloseStruct *ecs)
-{
- EContactListEditor *cle = ecs->cle;
- gboolean should_close = ecs->should_close;
-
- if (cle->app)
- gtk_widget_set_sensitive (cle->app, TRUE);
- cle->in_async_call = FALSE;
-
- g_signal_emit (cle, contact_list_editor_signals[LIST_MODIFIED], 0,
- status, cle->contact);
-
- if (status == E_BOOK_ERROR_OK) {
- if (should_close)
- close_dialog (cle);
- }
-
- g_object_unref (cle); /* release ref held for ebook callback */
- g_free (ecs);
-}
-
-static void
-save_contact (EContactListEditor *cle, gboolean should_close)
-{
- extract_info (cle);
-
- if (cle->book) {
- EditorCloseStruct *ecs = g_new(EditorCloseStruct, 1);
-
- ecs->cle = cle;
- g_object_ref (cle);
- ecs->should_close = should_close;
-
- if (cle->app)
- gtk_widget_set_sensitive (cle->app, FALSE);
- cle->in_async_call = TRUE;
-
- if (cle->is_new_list)
- e_book_async_add_contact (cle->book, cle->contact, (EBookIdCallback)list_added_cb, ecs);
- else
- e_book_async_commit_contact (cle->book, cle->contact, (EBookCallback)list_modified_cb, ecs);
-
- cle->changed = FALSE;
- }
-}
-
-static gboolean
-is_named (EContactListEditor *editor)
-{
- char *string = gtk_editable_get_chars(GTK_EDITABLE (editor->list_name_entry), 0, -1);
- gboolean named = FALSE;
-
- if (string && *string) {
- named = TRUE;
- }
-
- g_free (string);
-
- return named;
-}
-
-static gboolean
-prompt_to_save_changes (EContactListEditor *editor)
-{
- if (!editor->changed || !is_named (editor))
- return TRUE;
-
- switch (eab_prompt_save_dialog (GTK_WINDOW(editor->app))) {
- case GTK_RESPONSE_YES:
- save_contact (editor, FALSE);
- return TRUE;
- case GTK_RESPONSE_NO:
- return TRUE;
- case GTK_RESPONSE_CANCEL:
- default:
- return FALSE;
- }
-}
-
-static void
-file_close_cb (GtkWidget *widget, gpointer data)
-{
- EContactListEditor *cle = E_CONTACT_LIST_EDITOR (data);
-
- if (!prompt_to_save_changes (cle))
- return;
-
- close_dialog (cle);
-}
-
-static void
-file_save_cb (GtkWidget *widget, gpointer data)
-{
- EContactListEditor *cle = E_CONTACT_LIST_EDITOR (data);
-
- save_contact (cle, FALSE);
-}
-
-static void
-file_save_as_cb (GtkWidget *widget, gpointer data)
-{
- EContactListEditor *cle = E_CONTACT_LIST_EDITOR (data);
-
- extract_info (cle);
-
- eab_contact_save(_("Save List as VCard"), cle->contact, GTK_WINDOW (cle->app));
-}
-
-static void
-file_send_as_cb (GtkWidget *widget, gpointer data)
-{
- EContactListEditor *cle = E_CONTACT_LIST_EDITOR (data);
-
- extract_info (cle);
-
- eab_send_contact(cle->contact, EAB_DISPOSITION_AS_ATTACHMENT);
-}
-
-static void
-file_send_to_cb (GtkWidget *widget, gpointer data)
-{
- EContactListEditor *cle = E_CONTACT_LIST_EDITOR (data);
-
- extract_info (cle);
-
- eab_send_contact(cle->contact, EAB_DISPOSITION_AS_TO);
-}
-
-static void
-tb_save_and_close_cb (GtkWidget *widget, gpointer data)
-{
- EContactListEditor *cle = E_CONTACT_LIST_EDITOR (data);
- save_contact (cle, TRUE);
-}
-
-static void
-list_deleted_cb (EBook *book, EBookStatus status, EContactListEditor *cle)
-{
- if (cle->app)
- gtk_widget_set_sensitive (cle->app, TRUE);
- cle->in_async_call = FALSE;
-
- g_signal_emit (cle, contact_list_editor_signals[LIST_DELETED], 0,
- status, cle->contact);
-
- /* always close the dialog after we successfully delete a list */
- if (status == E_BOOK_ERROR_OK)
- close_dialog (cle);
-
- g_object_unref (cle); /* release reference held for callback */
-}
-
-static void
-delete_cb (GtkWidget *widget, gpointer data)
-{
- EContactListEditor *cle = E_CONTACT_LIST_EDITOR (data);
- EContact *contact = cle->contact;
-
- g_object_ref (contact);
-
- if (e_contact_editor_confirm_delete(GTK_WINDOW(cle->app))) {
-
- extract_info (cle);
-
- if (!cle->is_new_list) {
- gtk_widget_set_sensitive (cle->app, FALSE);
- cle->in_async_call = TRUE;
-
- g_object_ref (cle); /* hold reference for callback */
- e_book_async_remove_contact (cle->book, contact, (EBookCallback)list_deleted_cb, cle);
- }
- }
-
- g_object_unref (contact);
-}
-
-static
-BonoboUIVerb verbs [] = {
- BONOBO_UI_UNSAFE_VERB ("ContactListEditorSave", file_save_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactListEditorSaveClose", tb_save_and_close_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactListEditorDelete", delete_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactListEditorSaveAs", file_save_as_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactListEditorSendAs", file_send_as_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactListEditorSendTo", file_send_to_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactListEditorClose", file_close_cb),
- BONOBO_UI_VERB_END
-};
-
-static EPixmap pixmaps[] = {
- E_PIXMAP ("/commands/ContactListEditorSave", "save-16.png"),
- E_PIXMAP ("/commands/ContactListEditorSaveClose", "save-16.png"),
- E_PIXMAP ("/commands/ContactListEditorSaveAs", "save-as-16.png"),
-
- E_PIXMAP ("/commands/ContactListEditorDelete", "evolution-trash-mini.png"),
-#if 0 /* Envelope printing is disabled for Evolution 1.0. */
- E_PIXMAP ("/commands/ContactListEditorPrint", "print.xpm"),
- E_PIXMAP ("/commands/ContactListEditorPrintEnvelope", "print.xpm"),
-#endif
- E_PIXMAP ("/Toolbar/ContactListEditorSaveClose", "buttons/save-24.png"),
- E_PIXMAP ("/Toolbar/ContactListEditorDelete", "buttons/delete-message.png"),
- E_PIXMAP ("/Toolbar/ContactListEditorPrint", "buttons/print.png"),
-
- E_PIXMAP_END
-};
-
-static void
-create_ui (EContactListEditor *ce)
-{
- bonobo_ui_component_add_verb_list_with_data (
- ce->uic, verbs, ce);
-
- bonobo_ui_util_set_ui (ce->uic, PREFIX,
- EVOLUTION_UIDIR "/evolution-contact-list-editor.xml",
- "evolution-contact-list-editor", NULL);
-
- e_pixmaps_update (ce->uic, pixmaps);
-}
-
-static void
-contact_list_editor_destroy_notify (gpointer data,
- GObject *where_the_object_was)
-{
- EContactListEditor *ce = E_CONTACT_LIST_EDITOR (data);
-
- all_contact_list_editors = g_slist_remove (all_contact_list_editors, ce);
-}
-
-EContactListEditor *
-e_contact_list_editor_new (EBook *book,
- EContact *list_contact,
- gboolean is_new_list,
- gboolean editable)
-{
- EContactListEditor *ce = g_object_new (E_TYPE_CONTACT_LIST_EDITOR, NULL);
-
- all_contact_list_editors = g_slist_prepend (all_contact_list_editors, ce);
- g_object_weak_ref (G_OBJECT (ce), contact_list_editor_destroy_notify, ce);
-
- g_object_ref (ce);
- gtk_object_sink (GTK_OBJECT (ce));
-
- g_object_set (ce,
- "book", book,
- "contact", list_contact,
- "is_new_list", is_new_list,
- "editable", editable,
- NULL);
-
- return ce;
-}
-
-static void
-e_contact_list_editor_set_property (GObject *object, guint prop_id,
- const GValue *value, GParamSpec *pspec)
-{
- EContactListEditor *editor;
-
- editor = E_CONTACT_LIST_EDITOR (object);
-
- switch (prop_id){
- case PROP_BOOK:
- if (editor->book)
- g_object_unref (editor->book);
- editor->book = E_BOOK(g_value_get_object (value));
- g_object_ref (editor->book);
- /* XXX more here about editable/etc. */
- break;
- case PROP_CONTACT:
- if (editor->contact)
- g_object_unref (editor->contact);
- editor->contact = e_contact_duplicate(E_CONTACT(g_value_get_object (value)));
- fill_in_info(editor);
- editor->changed = FALSE;
- command_state_changed (editor);
- break;
- case PROP_IS_NEW_LIST: {
- gboolean new_value = g_value_get_boolean (value);
- gboolean changed = (editor->is_new_list != new_value);
-
- editor->is_new_list = new_value;
-
- if (changed)
- command_state_changed (editor);
- break;
- }
- case PROP_EDITABLE: {
- gboolean new_value = g_value_get_boolean (value);
- gboolean changed = (editor->editable != new_value);
-
- editor->editable = new_value;
-
- if (changed) {
- set_editable (editor);
- command_state_changed (editor);
- }
- break;
- }
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-e_contact_list_editor_get_property (GObject *object, guint prop_id,
- GValue *value, GParamSpec *pspec)
-{
- EContactListEditor *editor;
-
- editor = E_CONTACT_LIST_EDITOR (object);
-
- switch (prop_id) {
- case PROP_BOOK:
- g_value_set_object (value, editor->book);
- break;
-
- case PROP_CONTACT:
- extract_info(editor);
- g_value_set_object (value, editor->contact);
- break;
-
- case PROP_IS_NEW_LIST:
- g_value_set_boolean (value, editor->is_new_list);
- break;
-
- case PROP_EDITABLE:
- g_value_set_boolean (value, editor->editable);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-void
-e_contact_list_editor_show (EContactListEditor *editor)
-{
- gtk_widget_show (editor->app);
-}
-
-void
-e_contact_list_editor_raise (EContactListEditor *editor)
-{
- gdk_window_raise (GTK_WIDGET (editor->app)->window);
-}
-
-GtkWidget *
-e_contact_list_editor_create_table(gchar *name,
- gchar *string1, gchar *string2,
- gint int1, gint int2);
-
-GtkWidget *
-e_contact_list_editor_create_table(gchar *name,
- gchar *string1, gchar *string2,
- gint int1, gint int2)
-{
-
- ETableModel *model;
- GtkWidget *table;
-
- model = e_contact_list_model_new ();
-
- table = e_table_scrolled_new_from_spec_file (model,
- NULL,
- EVOLUTION_ETSPECDIR "/e-contact-list-editor.etspec",
- NULL);
-
- g_object_set_data(G_OBJECT(table), "model", model);
-
- return table;
-}
-
-static void
-add_email_cb (GtkWidget *w, EContactListEditor *editor)
-{
- GtkAdjustment *adj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (editor->table));
- const char *text = gtk_entry_get_text (GTK_ENTRY(editor->email_entry));
-
- if (text && *text) {
- e_contact_list_model_add_email (E_CONTACT_LIST_MODEL(editor->model), text);
-
- /* Skip to the end of the list */
- if (adj->upper - adj->lower > adj->page_size)
- gtk_adjustment_set_value (adj, adj->upper);
- }
-
- gtk_entry_set_text (GTK_ENTRY(editor->email_entry), "");
-
- editor->changed = TRUE;
-
- command_state_changed (editor);
-}
-
-static void
-remove_row (int model_row, EContactListEditor *editor)
-{
- e_contact_list_model_remove_row (E_CONTACT_LIST_MODEL (editor->model), model_row);
-}
-
-static void
-remove_entry_cb (GtkWidget *w, EContactListEditor *editor)
-{
- e_table_selected_row_foreach (e_table_scrolled_get_table(E_TABLE_SCROLLED(editor->table)),
- (EForeachFunc)remove_row, editor);
- editor->changed = TRUE;
- command_state_changed (editor);
-}
-
-static void
-list_name_changed_cb (GtkWidget *w, EContactListEditor *editor)
-{
- editor->changed = TRUE;
- command_state_changed (editor);
-}
-
-static void
-visible_addrs_toggled_cb (GtkWidget *w, EContactListEditor *editor)
-{
- editor->changed = TRUE;
- command_state_changed (editor);
-}
-
-static void
-set_editable (EContactListEditor *editor)
-{
- gtk_widget_set_sensitive (editor->email_entry, editor->editable);
- gtk_widget_set_sensitive (editor->list_name_entry, editor->editable);
- gtk_widget_set_sensitive (editor->add_button, editor->editable);
- gtk_widget_set_sensitive (editor->remove_button, editor->editable);
- gtk_widget_set_sensitive (editor->table, editor->editable);
-}
-
-/* Closes the dialog box and emits the appropriate signals */
-static void
-close_dialog (EContactListEditor *cle)
-{
- g_assert (cle->app != NULL);
-
- gtk_widget_destroy (cle->app);
- cle->app = NULL;
-
- g_signal_emit (cle, contact_list_editor_signals[EDITOR_CLOSED], 0);
-}
-
-/* Callback used when the editor is destroyed */
-static gint
-app_delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer data)
-{
- EContactListEditor *ce;
-
- ce = E_CONTACT_LIST_EDITOR (data);
-
- /* if we're in an async call, don't allow the dialog to close */
- if (ce->in_async_call)
- return TRUE;
-
- if (!prompt_to_save_changes (ce))
- return TRUE;
-
- close_dialog (ce);
- return TRUE;
-}
-
-static gboolean
-table_drag_motion_cb (ETable *table, int row, int col,
- GdkDragContext *context,
- gint x, gint y, guint time, EContactListEditor *editor)
-{
- GList *p;
-
- for (p = context->targets; p != NULL; p = p->next) {
- char *possible_type;
-
- possible_type = gdk_atom_name (GDK_POINTER_TO_ATOM (p->data));
- if (!strcmp (possible_type, VCARD_TYPE)) {
- g_free (possible_type);
- gdk_drag_status (context, GDK_ACTION_LINK, time);
- return TRUE;
- }
-
- g_free (possible_type);
- }
-
- return FALSE;
-}
-
-static gboolean
-table_drag_drop_cb (ETable *table, int row, int col,
- GdkDragContext *context,
- gint x, gint y, guint time, EContactListEditor *editor)
-{
- if (context->targets == NULL)
- return FALSE;
-
-
- gtk_drag_get_data (GTK_WIDGET (table), context,
- GDK_POINTER_TO_ATOM (context->targets->data),
- time);
- return TRUE;
-}
-
-static void
-table_drag_data_received_cb (ETable *table, int row, int col,
- GdkDragContext *context,
- gint x, gint y,
- GtkSelectionData *selection_data,
- guint info, guint time, EContactListEditor *editor)
-{
- GtkAdjustment *adj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (editor->table));
- char *target_type;
- gboolean changed = FALSE;
- gboolean handled = FALSE;
-
- target_type = gdk_atom_name (selection_data->target);
-
- if (!strcmp (target_type, VCARD_TYPE)) {
-
- GList *contact_list = eab_contact_list_from_string (selection_data->data);
- GList *c;
-
- if (contact_list)
- handled = TRUE;
-
- for (c = contact_list; c; c = c->next) {
- EContact *contact = c->data;
-
- if (!e_contact_get (contact, E_CONTACT_IS_LIST)) {
- e_contact_list_model_add_contact (E_CONTACT_LIST_MODEL (editor->model),
- contact);
-
- changed = TRUE;
- }
- }
- g_list_foreach (contact_list, (GFunc)g_object_unref, NULL);
- g_list_free (contact_list);
-
- /* Skip to the end of the list */
- if (adj->upper - adj->lower > adj->page_size)
- gtk_adjustment_set_value (adj, adj->upper);
-
- if (changed) {
- editor->changed = TRUE;
- command_state_changed (editor);
- }
- }
-
- gtk_drag_finish (context, handled, FALSE, time);
-}
-
-static gboolean
-set_image_from_data (EContactListEditor *editor,
- char *data, int length)
-{
- gboolean rv = FALSE;
- GdkPixbufLoader *loader = gdk_pixbuf_loader_new ();
- GdkPixbuf *pixbuf;
-
- gdk_pixbuf_loader_write (loader, data, length, NULL);
-
- pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
- if (pixbuf)
- gdk_pixbuf_ref (pixbuf);
- gdk_pixbuf_loader_close (loader, NULL);
- g_object_unref (loader);
-
- if (pixbuf) {
- GdkPixbuf *scaled;
- GdkPixbuf *composite;
-
- float scale;
- int new_height, new_width;
-
- new_height = gdk_pixbuf_get_height (pixbuf);
- new_width = gdk_pixbuf_get_width (pixbuf);
-
- printf ("new dimensions = (%d,%d)\n", new_width, new_height);
-
- if (editor->list_image_height < new_height
- || editor->list_image_width < new_width) {
- /* we need to scale down */
- printf ("we need to scale down\n");
- if (new_height > new_width)
- scale = (float)editor->list_image_height / new_height;
- else
- scale = (float)editor->list_image_width / new_width;
- }
- else {
- /* we need to scale up */
- printf ("we need to scale up\n");
- if (new_height > new_width)
- scale = (float)new_height / editor->list_image_height;
- else
- scale = (float)new_width / editor->list_image_width;
- }
-
- printf ("scale = %g\n", scale);
-
- new_width *= scale;
- new_height *= scale;
- new_width = MIN (new_width, editor->list_image_width);
- new_height = MIN (new_height, editor->list_image_height);
-
- printf ("new scaled dimensions = (%d,%d)\n", new_width, new_height);
-
- scaled = gdk_pixbuf_scale_simple (pixbuf,
- new_width, new_height,
- GDK_INTERP_BILINEAR);
-
- composite = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, gdk_pixbuf_get_bits_per_sample (pixbuf),
- editor->list_image_width, editor->list_image_height);
-
- gdk_pixbuf_fill (composite, 0x00000000);
-
- gdk_pixbuf_copy_area (scaled, 0, 0, new_width, new_height,
- composite,
- editor->list_image_width / 2 - new_width / 2,
- editor->list_image_height / 2 - new_height / 2);
-
- gtk_image_set_from_pixbuf (GTK_IMAGE (editor->list_image), composite);
- gdk_pixbuf_unref (pixbuf);
- gdk_pixbuf_unref (scaled);
- gdk_pixbuf_unref (composite);
-
- rv = TRUE;
- }
-
- return rv;
-}
-
-static gboolean
-image_drag_motion_cb (GtkWidget *widget,
- GdkDragContext *context,
- gint x, gint y, guint time, EContactListEditor *editor)
-{
- GList *p;
-
- for (p = context->targets; p != NULL; p = p->next) {
- char *possible_type;
-
- possible_type = gdk_atom_name (GDK_POINTER_TO_ATOM (p->data));
- if (!strcmp (possible_type, URI_LIST_TYPE)) {
- g_free (possible_type);
- gdk_drag_status (context, GDK_ACTION_COPY, time);
- return TRUE;
- }
-
- g_free (possible_type);
- }
-
- return FALSE;
-}
-
-static gboolean
-image_drag_drop_cb (GtkWidget *widget,
- GdkDragContext *context,
- gint x, gint y, guint time, EContactListEditor *editor)
-{
- GList *p;
-
- if (context->targets == NULL)
- return FALSE;
-
-
- for (p = context->targets; p != NULL; p = p->next) {
- char *possible_type;
-
- possible_type = gdk_atom_name (GDK_POINTER_TO_ATOM (p->data));
- if (!strcmp (possible_type, URI_LIST_TYPE)) {
- g_free (possible_type);
- gtk_drag_get_data (widget, context,
- GDK_POINTER_TO_ATOM (p->data),
- time);
- return TRUE;
- }
-
- g_free (possible_type);
- }
-
- return FALSE;
-}
-
-static void
-image_drag_data_received_cb (GtkWidget *widget,
- GdkDragContext *context,
- gint x, gint y,
- GtkSelectionData *selection_data,
- guint info, guint time, EContactListEditor *editor)
-{
- char *target_type;
- gboolean changed = FALSE;
- gboolean handled = FALSE;
-
- target_type = gdk_atom_name (selection_data->target);
-
- printf ("target_type == %s\n", target_type);
-
- if (!strcmp (target_type, URI_LIST_TYPE)) {
- GnomeVFSResult result;
- GnomeVFSHandle *handle;
- char *uri;
- char *nl = strstr (selection_data->data, "\r\n");
- char *buf = NULL;
- GnomeVFSFileInfo info;
-
- if (nl)
- uri = g_strndup (selection_data->data, nl - (char*)selection_data->data);
- else
- uri = g_strdup (selection_data->data);
-
- printf ("uri == %s\n", uri);
-
- result = gnome_vfs_open (&handle, uri, GNOME_VFS_OPEN_READ);
- if (result == GNOME_VFS_OK) {
- result = gnome_vfs_get_file_info_from_handle (handle, &info, GNOME_VFS_FILE_INFO_DEFAULT);
- if (result == GNOME_VFS_OK) {
- GnomeVFSFileSize num_left;
- GnomeVFSFileSize num_read;
- GnomeVFSFileSize total_read;
-
- printf ("file size = %d\n", (int)info.size);
- buf = g_malloc (info.size);
-
- num_left = info.size;
- total_read = 0;
-
- while ((result = gnome_vfs_read (handle, buf + total_read, num_left, &num_read)) == GNOME_VFS_OK) {
- num_left -= num_read;
- total_read += num_read;
- }
-
- printf ("read %d bytes\n", (int)total_read);
- if (set_image_from_data (editor, buf, total_read)) {
- changed = TRUE;
- handled = TRUE;
- g_free (editor->image_buf);
- editor->image_buf = buf;
- editor->image_buf_size = total_read;
- }
- else {
- /* XXX we should pop up a
- warning dialog here */
- g_free (buf);
- }
- }
-
- gnome_vfs_close (handle);
- }
- else {
- printf ("gnome_vfs_open failed (%s)\n", gnome_vfs_result_to_string (result));
- }
-
- g_free (uri);
-
- if (changed) {
- editor->changed = TRUE;
- command_state_changed (editor);
- }
- }
-
- gtk_drag_finish (context, handled, FALSE, time);
-}
-
-static void
-command_state_changed (EContactListEditor *editor)
-{
- gboolean named = is_named (editor);
-
- bonobo_ui_component_set_prop (editor->uic,
- "/commands/ContactListEditorSaveClose",
- "sensitive",
- editor->changed && named && editor->editable ? "1" : "0", NULL);
-
- bonobo_ui_component_set_prop (editor->uic,
- "/commands/ContactListEditorSave",
- "sensitive",
- editor->changed && named && editor->editable ? "1" : "0", NULL);
-
- bonobo_ui_component_set_prop (editor->uic,
- "/commands/ContactListEditorDelete",
- "sensitive",
- editor->editable && !editor->is_new_list ? "1" : "0", NULL);
-}
-
-static void
-extract_info(EContactListEditor *editor)
-{
- EContact *contact = editor->contact;
- if (contact) {
- int i;
- GList *email_list;
- char *string = gtk_editable_get_chars(GTK_EDITABLE (editor->list_name_entry), 0, -1);
-
- if (string && *string) {
- e_contact_set (contact, E_CONTACT_FILE_AS, string);
- e_contact_set (contact, E_CONTACT_FULL_NAME, string);
- }
-
- g_free (string);
-
- e_contact_set (contact, E_CONTACT_IS_LIST, GINT_TO_POINTER (TRUE));
- e_contact_set (contact, E_CONTACT_LIST_SHOW_ADDRESSES,
- GINT_TO_POINTER (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(editor->visible_addrs_checkbutton))));
-
- email_list = NULL;
- /* then refill it from the contact list model */
- for (i = 0; i < e_table_model_row_count (editor->model); i ++) {
- const EABDestination *dest = e_contact_list_model_get_destination (E_CONTACT_LIST_MODEL (editor->model), i);
- gchar *dest_xml = eab_destination_export (dest);
- if (dest_xml)
- email_list = g_list_append (email_list, dest_xml);
- }
-
- e_contact_set (contact, E_CONTACT_EMAIL, email_list);
-
- /* XXX free email_list? */
-
- if (editor->image_buf) {
- EContactPhoto photo;
-
- photo.data = editor->image_buf;
- photo.length = editor->image_buf_size;
-
- e_contact_set (contact, E_CONTACT_LOGO, &photo);
- }
- g_object_unref (email_list);
- }
-}
-
-static void
-fill_in_info(EContactListEditor *editor)
-{
- if (editor->contact) {
- EContactPhoto *photo;
- char *file_as;
- gboolean show_addresses = FALSE;
- gboolean is_evolution_list = FALSE;
- GList *email_list;
- GList *iter;
-
- file_as = e_contact_get_const (editor->contact, E_CONTACT_FILE_AS);
- email_list = e_contact_get (editor->contact, E_CONTACT_EMAIL);
- is_evolution_list = GPOINTER_TO_INT (e_contact_get (editor->contact, E_CONTACT_IS_LIST));
- show_addresses = GPOINTER_TO_INT (e_contact_get (editor->contact, E_CONTACT_LIST_SHOW_ADDRESSES));
-
- gtk_editable_delete_text (GTK_EDITABLE (editor->list_name_entry), 0, -1);
- if (file_as) {
- int position = 0;
- gtk_editable_insert_text (GTK_EDITABLE (editor->list_name_entry), file_as, strlen (file_as), &position);
- g_free (file_as);
- }
-
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(editor->visible_addrs_checkbutton), !show_addresses);
-
- e_contact_list_model_remove_all (E_CONTACT_LIST_MODEL (editor->model));
-
- for (iter = email_list; iter; iter = iter->next) {
- char *dest_xml = iter->data;
- EABDestination *dest;
-
- /* g_message ("incoming xml: [%s]", dest_xml); */
- dest = eab_destination_import (dest_xml);
-
- if (dest != NULL) {
- e_contact_list_model_add_destination (E_CONTACT_LIST_MODEL (editor->model), dest);
- }
- }
-
- /* XXX free email_list */
-
- photo = e_contact_get (editor->contact, E_CONTACT_LOGO);
- if (photo) {
- set_image_from_data (editor, photo->data, photo->length);
- e_contact_photo_free (photo);
- }
- g_object_unref (email_list);
- }
-}
-
-
-gboolean
-e_contact_list_editor_request_close_all (void)
-{
- GSList *p;
- GSList *pnext;
- gboolean retval;
-
- retval = TRUE;
- for (p = all_contact_list_editors; p != NULL; p = pnext) {
- pnext = p->next;
-
- e_contact_list_editor_raise (E_CONTACT_LIST_EDITOR (p->data));
- if (! prompt_to_save_changes (E_CONTACT_LIST_EDITOR (p->data))) {
- retval = FALSE;
- break;
- }
-
- close_dialog (E_CONTACT_LIST_EDITOR (p->data));
- }
-
- return retval;
-}
diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.etspec b/addressbook/gui/contact-list-editor/e-contact-list-editor.etspec
deleted file mode 100644
index 6d5f4f2514..0000000000
--- a/addressbook/gui/contact-list-editor/e-contact-list-editor.etspec
+++ /dev/null
@@ -1,7 +0,0 @@
-<ETableSpecification no-headers="true" cursor-mode="line" selection-mode="single">
-<ETableColumn model_col= "0" _title="Contact" expansion="1.0" minimum_width="20" resizable="true" cell="string" compare="string" />
- <ETableState>
- <column source="0"/>
- <grouping> </grouping>
- </ETableState>
-</ETableSpecification>
diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.h b/addressbook/gui/contact-list-editor/e-contact-list-editor.h
deleted file mode 100644
index 52e78a6a23..0000000000
--- a/addressbook/gui/contact-list-editor/e-contact-list-editor.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* e-contact-list-editor.h
- * Copyright (C) 2001 Ximian, Inc.
- * Author: Chris Toshok <toshok@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-#ifndef __E_CONTACT_LIST_EDITOR_H__
-#define __E_CONTACT_LIST_EDITOR_H__
-
-#include <libgnomeui/gnome-app.h>
-#include <libgnomeui/gnome-app-helper.h>
-#include <bonobo/bonobo-ui-component.h>
-#include <glade/glade.h>
-#include <gal/e-table/e-table-model.h>
-
-#include <libebook/e-book-async.h>
-#include <libebook/e-contact.h>
-
-G_BEGIN_DECLS
-
-#define E_TYPE_CONTACT_LIST_EDITOR (e_contact_list_editor_get_type ())
-#define E_CONTACT_LIST_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_CONTACT_LIST_EDITOR, EContactListEditor))
-#define E_CONTACT_LIST_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_CONTACT_LIST_EDITOR, EContactListEditorClass))
-#define E_IS_CONTACT_LIST_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_CONTACT_LIST_EDITOR))
-#define E_IS_CONTACT_LIST_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_CONTACT_LIST_EDITOR))
-
-
-typedef struct _EContactListEditor EContactListEditor;
-typedef struct _EContactListEditorClass EContactListEditorClass;
-
-struct _EContactListEditor
-{
- GtkObject object;
-
- /* item specific fields */
- EBook *book;
- EContact *contact;
-
- /* UI handler */
- BonoboUIComponent *uic;
-
- GladeXML *gui;
- GtkWidget *app;
-
- GtkWidget *table;
- ETableModel *model;
- GtkWidget *email_entry;
- GtkWidget *list_name_entry;
- GtkWidget *add_button;
- GtkWidget *remove_button;
- GtkWidget *list_image_button;
- GtkWidget *visible_addrs_checkbutton;
- GtkWidget *list_image;
- int list_image_width;
- int list_image_height;
-
- char *image_buf;
- int image_buf_size;
-
- /* Whether we are editing a new contact or an existing one */
- guint is_new_list : 1;
-
- /* Whether the contact has been changed since bringing up the contact editor */
- guint changed : 1;
-
- /* Whether the contact editor will accept modifications */
- guint editable : 1;
-
- /* Whether an async wombat call is in progress */
- guint in_async_call : 1;
-};
-
-struct _EContactListEditorClass
-{
- GtkObjectClass parent_class;
-
- /* Notification signals */
-
- void (* list_added) (EContactListEditor *cle, EBookStatus status, EContact *contact);
- void (* list_modified) (EContactListEditor *cle, EBookStatus status, EContact *contact);
- void (* list_deleted) (EContactListEditor *cle, EBookStatus status, EContact *contact);
- void (* editor_closed) (EContactListEditor *cle);
-};
-
-EContactListEditor *e_contact_list_editor_new (EBook *book,
- EContact *list_contact,
- gboolean is_new_list,
- gboolean editable);
-GType e_contact_list_editor_get_type (void);
-void e_contact_list_editor_show (EContactListEditor *editor);
-void e_contact_list_editor_raise (EContactListEditor *editor);
-
-gboolean e_contact_list_editor_confirm_delete (GtkWindow *parent);
-
-gboolean e_contact_list_editor_request_close_all (void);
-
-G_END_DECLS
-
-
-#endif /* __E_CONTACT_LIST_EDITOR_H__ */
diff --git a/addressbook/gui/contact-list-editor/e-contact-list-model.c b/addressbook/gui/contact-list-editor/e-contact-list-model.c
deleted file mode 100644
index c7fd626372..0000000000
--- a/addressbook/gui/contact-list-editor/e-contact-list-model.c
+++ /dev/null
@@ -1,265 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-#include <config.h>
-#include <string.h>
-#include "e-contact-list-model.h"
-
-#define PARENT_TYPE e_table_model_get_type()
-static ETableModelClass *parent_class;
-
-#define COLS 1
-
-/* This function returns the number of columns in our ETableModel. */
-static int
-contact_list_col_count (ETableModel *etc)
-{
- return COLS;
-}
-
-/* This function returns the number of rows in our ETableModel. */
-static int
-contact_list_row_count (ETableModel *etc)
-{
- EContactListModel *model = E_CONTACT_LIST_MODEL (etc);
- return model->data_count;
-}
-
-/* This function returns the value at a particular point in our ETableModel. */
-static void *
-contact_list_value_at (ETableModel *etc, int col, int row)
-{
- EContactListModel *model = E_CONTACT_LIST_MODEL (etc);
-
- return (void *) eab_destination_get_textrep (model->data[row], TRUE);
-}
-
-/* This function sets the value at a particular point in our ETableModel. */
-static void
-contact_list_set_value_at (ETableModel *etc, int col, int row, const void *val)
-{
- /* nothing */
-}
-
-/* This function returns whether a particular cell is editable. */
-static gboolean
-contact_list_is_cell_editable (ETableModel *etc, int col, int row)
-{
- return TRUE;
-}
-
-/* This function duplicates the value passed to it. */
-static void *
-contact_list_duplicate_value (ETableModel *etc, int col, const void *value)
-{
- return g_strdup(value);
-}
-
-/* This function frees the value passed to it. */
-static void
-contact_list_free_value (ETableModel *etc, int col, void *value)
-{
- g_free(value);
-}
-
-static void *
-contact_list_initialize_value (ETableModel *etc, int col)
-{
- return g_strdup("");
-}
-
-static gboolean
-contact_list_value_is_empty (ETableModel *etc, int col, const void *value)
-{
- return !(value && *(char *)value);
-}
-
-static char *
-contact_list_value_to_string (ETableModel *etc, int col, const void *value)
-{
- return g_strdup(value);
-}
-
-static void
-contact_list_model_destroy (GtkObject *o)
-{
- EContactListModel *model = E_CONTACT_LIST_MODEL (o);
- int i;
-
- if (model->data != NULL) {
- for (i = 0; i < model->data_count; i ++) {
- g_object_unref (model->data[i]);
- }
- g_free (model->data);
- model->data = NULL;
- }
-
- model->data_count = 0;
- model->data_alloc = 0;
-
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (o);
-}
-
-static void
-e_contact_list_model_class_init (GtkObjectClass *object_class)
-{
- ETableModelClass *model_class = (ETableModelClass *) object_class;
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- object_class->destroy = contact_list_model_destroy;
-
- model_class->column_count = contact_list_col_count;
- model_class->row_count = contact_list_row_count;
- model_class->value_at = contact_list_value_at;
- model_class->set_value_at = contact_list_set_value_at;
- model_class->is_cell_editable = contact_list_is_cell_editable;
- model_class->duplicate_value = contact_list_duplicate_value;
- model_class->free_value = contact_list_free_value;
- model_class->initialize_value = contact_list_initialize_value;
- model_class->value_is_empty = contact_list_value_is_empty;
- model_class->value_to_string = contact_list_value_to_string;
-}
-
-static void
-e_contact_list_model_init (GtkObject *object)
-{
- EContactListModel *model = E_CONTACT_LIST_MODEL(object);
-
- model->data_alloc = 10;
- model->data_count = 0;
- model->data = g_new (EABDestination*, model->data_alloc);
-}
-
-GType
-e_contact_list_model_get_type (void)
-{
- static GType cle_type = 0;
-
- if (!cle_type) {
- static const GTypeInfo cle_info = {
- sizeof (EContactListModelClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_contact_list_model_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EContactListModel),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_contact_list_model_init,
- };
-
- cle_type = g_type_register_static (E_TABLE_MODEL_TYPE, "EContactListModel", &cle_info, 0);
- }
-
- return cle_type;
-}
-
-void
-e_contact_list_model_construct (EContactListModel *model)
-{
-}
-
-ETableModel *
-e_contact_list_model_new ()
-{
- EContactListModel *model;
-
- model = g_object_new (E_TYPE_CONTACT_LIST_MODEL, NULL);
-
- e_contact_list_model_construct (model);
-
- return E_TABLE_MODEL(model);
-}
-
-void
-e_contact_list_model_add_destination (EContactListModel *model, EABDestination *dest)
-{
- g_return_if_fail (E_IS_CONTACT_LIST_MODEL (model));
- g_return_if_fail (EAB_IS_DESTINATION (dest));
-
- e_table_model_pre_change (E_TABLE_MODEL (model));
-
- if (model->data_count + 1 >= model->data_alloc) {
- model->data_alloc *= 2;
- model->data = g_renew (EABDestination*, model->data, model->data_alloc);
- }
-
- model->data[model->data_count ++] = dest;
- g_object_ref (dest);
-
- e_table_model_row_inserted (E_TABLE_MODEL (model), model->data_count - 1);
-}
-
-void
-e_contact_list_model_add_email (EContactListModel *model,
- const char *email)
-{
- EABDestination *new_dest;
-
- g_return_if_fail (E_IS_CONTACT_LIST_MODEL (model));
- g_return_if_fail (email != NULL);
-
- new_dest = eab_destination_new ();
- eab_destination_set_email (new_dest, email);
-
- e_contact_list_model_add_destination (model, new_dest);
-}
-
-void
-e_contact_list_model_add_contact (EContactListModel *model,
- EContact *contact)
-{
- EABDestination *new_dest;
-
- g_return_if_fail (E_IS_CONTACT_LIST_MODEL (model));
- g_return_if_fail (E_IS_CONTACT (contact));
-
- new_dest = eab_destination_new ();
- eab_destination_set_contact (new_dest, contact, 0); /* Hard-wired for default e-mail */
-
- e_contact_list_model_add_destination (model, new_dest);
-}
-
-void
-e_contact_list_model_remove_row (EContactListModel *model, int row)
-{
- g_return_if_fail (E_IS_CONTACT_LIST_MODEL (model));
- g_return_if_fail (0 <= row && row < model->data_count);
-
- e_table_model_pre_change (E_TABLE_MODEL (model));
-
- g_object_unref (model->data[row]);
- memmove (model->data + row, model->data + row + 1, sizeof (EABDestination*) * (model->data_count - row - 1));
- model->data_count --;
-
- e_table_model_row_deleted (E_TABLE_MODEL (model), row);
-}
-
-void
-e_contact_list_model_remove_all (EContactListModel *model)
-{
- int i;
-
- g_return_if_fail (E_IS_CONTACT_LIST_MODEL (model));
-
- e_table_model_pre_change (E_TABLE_MODEL (model));
-
- for (i = 0; i < model->data_count; i ++) {
- g_object_unref (model->data[i]);
- model->data[i] = NULL;
- }
-
- model->data_count = 0;
-
- e_table_model_changed (E_TABLE_MODEL (model));
-}
-
-
-const EABDestination *
-e_contact_list_model_get_destination (EContactListModel *model, int row)
-{
- g_return_val_if_fail (E_IS_CONTACT_LIST_MODEL (model), NULL);
- g_return_val_if_fail (0 <= row && row < model->data_count, NULL);
-
- return model->data[row];
-}
diff --git a/addressbook/gui/contact-list-editor/e-contact-list-model.h b/addressbook/gui/contact-list-editor/e-contact-list-model.h
deleted file mode 100644
index 504f31b9d8..0000000000
--- a/addressbook/gui/contact-list-editor/e-contact-list-model.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-#ifndef _E_CONTACT_LIST_MODEL_H_
-#define _E_CONTACT_LIST_MODEL_H_
-
-#include <gtk/gtk.h>
-#include <gal/e-table/e-table-model.h>
-#include <libebook/e-book-async.h>
-#include <libebook/e-contact.h>
-#include "addressbook/util/eab-destination.h"
-
-G_BEGIN_DECLS
-
-#define E_TYPE_CONTACT_LIST_MODEL (e_contact_list_model_get_type ())
-#define E_CONTACT_LIST_MODEL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_CONTACT_LIST_MODEL, EContactListModel))
-#define E_CONTACT_LIST_MODEL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TYPE_CONTACT_LIST_MODEL, EContactListModelClass))
-#define E_IS_CONTACT_LIST_MODEL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_CONTACT_LIST_MODEL))
-#define E_IS_CONTACT_LIST_MODEL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_CONTACT_LIST_MODEL))
-
-typedef struct _EContactListModel EContactListModel;
-typedef struct _EContactListModelClass EContactListModelClass;
-
-struct _EContactListModel {
- ETableModel parent;
-
- EABDestination **data;
- int data_count;
- int data_alloc;
-};
-
-
-struct _EContactListModelClass {
- ETableModelClass parent_class;
-};
-
-
-GType e_contact_list_model_get_type (void);
-void e_contact_list_model_construct (EContactListModel *model);
-ETableModel *e_contact_list_model_new (void);
-
-void e_contact_list_model_add_destination (EContactListModel *model, EABDestination *dest);
-void e_contact_list_model_add_email (EContactListModel *model, const char *email);
-void e_contact_list_model_add_contact (EContactListModel *model, EContact *contact);
-
-void e_contact_list_model_remove_row (EContactListModel *model, int row);
-void e_contact_list_model_remove_all (EContactListModel *model);
-
-const EABDestination *e_contact_list_model_get_destination (EContactListModel *model, int row);
-
-G_END_DECLS
-
-#endif /* _E_CONTACT_LIST_MODEL_H_ */
diff --git a/addressbook/gui/merging/.cvsignore b/addressbook/gui/merging/.cvsignore
deleted file mode 100644
index b6fa83ca4c..0000000000
--- a/addressbook/gui/merging/.cvsignore
+++ /dev/null
@@ -1,8 +0,0 @@
-.deps
-.libs
-.pure
-Makefile
-Makefile.in
-*.lo
-*.la
-*.gladep
diff --git a/addressbook/gui/merging/Makefile.am b/addressbook/gui/merging/Makefile.am
deleted file mode 100644
index f1d589ad00..0000000000
--- a/addressbook/gui/merging/Makefile.am
+++ /dev/null
@@ -1,24 +0,0 @@
-INCLUDES = \
- -DG_LOG_DOMAIN=\"eab-contact-merging\" \
- -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \
- -I$(top_srcdir) \
- -I$(top_srcdir)/addressbook \
- -I$(top_srcdir)/addressbook/backend \
- -I$(top_builddir)/addressbook/backend \
- $(EVOLUTION_ADDRESSBOOK_CFLAGS)
-
-noinst_LTLIBRARIES = \
- libeabbookmerging.la
-
-libeabbookmerging_la_SOURCES = \
- eab-contact-compare.c \
- eab-contact-compare.h \
- eab-contact-merging.c \
- eab-contact-merging.h
-
-
-glade_DATA = eab-contact-duplicate-detected.glade \
- eab-contact-commit-duplicate-detected.glade
-
-EXTRA_DIST = \
- $(glade_DATA)
diff --git a/addressbook/gui/merging/eab-contact-commit-duplicate-detected.glade b/addressbook/gui/merging/eab-contact-commit-duplicate-detected.glade
deleted file mode 100644
index 789c465d92..0000000000
--- a/addressbook/gui/merging/eab-contact-commit-duplicate-detected.glade
+++ /dev/null
@@ -1,212 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-
-<widget class="GtkDialog" id="dialog-duplicate-contact">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="title" translatable="yes">Duplicate Contact Detected</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="has_separator">True</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox1">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area1">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="button3">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">1</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button4">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-add</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="table1">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="n_rows">5</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="Custom" id="custom-old-contact">
- <property name="visible">True</property>
- <property name="creation_function">_eab_contact_merging_create_contact_display</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Sun, 05 Oct 2003 03:54:20 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">The changed email or name of this contact already
-exists in this folder. Would you like to add it anyway?</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label3">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Conflicting Contact:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label4">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Changed Contact:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="custom-new-contact">
- <property name="visible">True</property>
- <property name="creation_function">_eab_contact_merging_create_contact_display</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Sun, 05 Oct 2003 03:53:42 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment1">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0</property>
- <property name="xscale">1</property>
- <property name="yscale">0</property>
-
- <child>
- <widget class="Custom" id="custom2">
- <property name="visible">True</property>
- <property name="creation_function">e_create_image_widget</property>
- <property name="string1">malehead.png</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Fri, 08 Jun 2001 00:18:39 GMT</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">5</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/addressbook/gui/merging/eab-contact-compare.c b/addressbook/gui/merging/eab-contact-compare.c
deleted file mode 100644
index 409b1bce81..0000000000
--- a/addressbook/gui/merging/eab-contact-compare.c
+++ /dev/null
@@ -1,736 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * eab-contact-compare.c
- *
- * Copyright (C) 2001, 2002, 2003 Ximian, Inc.
- *
- * Authors: Jon Trowbridge <trow@ximian.com>
- * Chris Toshok <toshok@ximian.com>
- */
-
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA.
- */
-
-#include <config.h>
-#include <ctype.h>
-#include <string.h>
-#include "util/eab-book-util.h"
-#include "eab-contact-compare.h"
-
-/* This is an "optimistic" combiner: the best of the two outcomes is
- selected. */
-static EABContactMatchType
-combine_comparisons (EABContactMatchType prev,
- EABContactMatchType new_info)
-{
- if (new_info == EAB_CONTACT_MATCH_NOT_APPLICABLE)
- return prev;
- return (EABContactMatchType) MAX ((gint) prev, (gint) new_info);
-}
-
-
-/*** Name comparisons ***/
-
-/* This *so* doesn't belong here... at least not implemented in a
- sucky way like this. But it can be fixed later. */
-
-/* This is very Anglocentric. */
-static gchar *name_synonyms[][2] = {
- { "jon", "john" }, /* Ah, the hacker's perogative */
- { "joseph", "joe" },
- { "robert", "bob" },
- { "gene", "jean" },
- { "jesse", "jessie" },
- { "ian", "iain" },
- { "richard", "dick" },
- { "william", "bill" },
- { "william", "will" },
- { "anthony", "tony" },
- { "michael", "mike" },
- { "eric", "erik" },
- { "elizabeth", "liz" },
- { "jeff", "geoff" },
- { "jeff", "geoffrey" },
- { "tom", "thomas" },
- { "dave", "david" },
- { "jim", "james" },
- { "abigal", "abby" },
- { "amanda", "amy" },
- { "amanda", "manda" },
- { "jennifer", "jenny" },
- { "christopher", "chris" },
- { "rebecca", "becca" },
- { "rebecca", "becky" },
- { "anderson", "andersen" },
- { "johnson", "johnsen" },
- /* We could go on and on... */
- /* We should add soundex here. */
- { NULL, NULL }
-};
-
-static gboolean
-name_fragment_match (const gchar *a, const gchar *b, gboolean strict)
-{
- gint len;
-
- if (!(a && b && *a && *b))
- return FALSE;
-
- /* If we are in 'strict' mode, b must match the beginning of a.
- So "Robert", "Rob" would match, but "Robert", "Robbie" wouldn't.
-
- If strict is FALSE, it is sufficient for the strings to share
- some leading characters. In this case, "Robert" and "Robbie"
- would match, as would "Dave" and "Dan". */
-
- if (strict) {
- len = g_utf8_strlen (b, -1);
- } else {
- len = MIN (g_utf8_strlen (a, -1), g_utf8_strlen (b, -1));
- }
-
- return !e_utf8_casefold_collate_len (a, b, len);
-}
-
-static gboolean
-name_fragment_match_with_synonyms (const gchar *a, const gchar *b, gboolean strict)
-{
- gint i;
-
- if (!(a && b && *a && *b))
- return FALSE;
-
- if (name_fragment_match (a, b, strict))
- return TRUE;
-
- /* Check for nicknames. Yes, the linear search blows. */
- for (i=0; name_synonyms[i][0]; ++i) {
-
- if (!e_utf8_casefold_collate (name_synonyms[i][0], a)
- && !e_utf8_casefold_collate (name_synonyms[i][1], b))
- return TRUE;
-
- if (!e_utf8_casefold_collate (name_synonyms[i][0], b)
- && !e_utf8_casefold_collate (name_synonyms[i][1], a))
- return TRUE;
- }
-
- return FALSE;
-}
-
-EABContactMatchType
-eab_contact_compare_name_to_string (EContact *contact, const gchar *str)
-{
- return eab_contact_compare_name_to_string_full (contact, str, FALSE, NULL, NULL, NULL);
-}
-
-EABContactMatchType
-eab_contact_compare_name_to_string_full (EContact *contact, const gchar *str, gboolean allow_partial_matches,
- gint *matched_parts_out, EABContactMatchPart *first_matched_part_out, gint *matched_character_count_out)
-{
- gchar **namev, **givenv = NULL, **addv = NULL, **familyv = NULL;
-
- gint matched_parts = EAB_CONTACT_MATCH_PART_NONE;
- EABContactMatchPart first_matched_part = EAB_CONTACT_MATCH_PART_NONE;
- EABContactMatchPart this_part_match = EAB_CONTACT_MATCH_PART_NOT_APPLICABLE;
- EABContactMatchType match_type;
- EContactName *contact_name;
-
- gint match_count = 0, matched_character_count = 0, fragment_count;
- gint i, j;
- gchar *str_cpy, *s;
-
- g_return_val_if_fail (E_IS_CONTACT (contact), EAB_CONTACT_MATCH_NOT_APPLICABLE);
-
- if (!e_contact_get_const (contact, E_CONTACT_FULL_NAME))
- return EAB_CONTACT_MATCH_NOT_APPLICABLE;
- if (str == NULL)
- return EAB_CONTACT_MATCH_NOT_APPLICABLE;
-
- str_cpy = s = g_strdup (str);
- while (*s) {
- if (*s == ',' || *s == '"')
- *s = ' ';
- ++s;
- }
- namev = g_strsplit (str_cpy, " ", 0);
- g_free (str_cpy);
-
- contact_name = e_contact_get (contact, E_CONTACT_NAME);
-
- if (contact_name->given)
- givenv = g_strsplit (contact_name->given, " ", 0);
- if (contact_name->additional)
- addv = g_strsplit (contact_name->additional, " ", 0);
- if (contact_name->family)
- familyv = g_strsplit (contact_name->family, " ", 0);
-
- e_contact_name_free (contact_name);
-
- fragment_count = 0;
- for (i = 0; givenv && givenv[i]; ++i)
- ++fragment_count;
- for (i = 0; addv && addv[i]; ++i)
- ++fragment_count;
- for (i = 0; familyv && familyv[i]; ++i)
- ++fragment_count;
-
- for (i = 0; namev[i] && this_part_match != EAB_CONTACT_MATCH_PART_NONE; ++i) {
-
- if (*namev[i]) {
-
- this_part_match = EAB_CONTACT_MATCH_PART_NONE;
-
- /* When we are allowing partials, we are strict about the matches we allow.
- Does this make sense? Not really, but it does the right thing for the purposes
- of completion. */
-
- if (givenv && this_part_match == EAB_CONTACT_MATCH_PART_NONE) {
- for (j = 0; givenv[j]; ++j) {
- if (name_fragment_match_with_synonyms (givenv[j], namev[i], allow_partial_matches)) {
-
- this_part_match = EAB_CONTACT_MATCH_PART_GIVEN_NAME;
-
- /* We remove a piece of a name once it has been matched against, so
- that "john john" won't match "john doe". */
- g_free (givenv[j]);
- givenv[j] = g_strdup ("");
- break;
- }
- }
- }
-
- if (addv && this_part_match == EAB_CONTACT_MATCH_PART_NONE) {
- for (j = 0; addv[j]; ++j) {
- if (name_fragment_match_with_synonyms (addv[j], namev[i], allow_partial_matches)) {
-
- this_part_match = EAB_CONTACT_MATCH_PART_ADDITIONAL_NAME;
-
- g_free (addv[j]);
- addv[j] = g_strdup ("");
- break;
- }
- }
- }
-
- if (familyv && this_part_match == EAB_CONTACT_MATCH_PART_NONE) {
- for (j = 0; familyv[j]; ++j) {
- if (allow_partial_matches ? name_fragment_match_with_synonyms (familyv[j], namev[i], allow_partial_matches)
- : !e_utf8_casefold_collate (familyv[j], namev[i])) {
-
- this_part_match = EAB_CONTACT_MATCH_PART_FAMILY_NAME;
-
- g_free (familyv[j]);
- familyv[j] = g_strdup ("");
- break;
- }
- }
- }
-
- if (this_part_match != EAB_CONTACT_MATCH_PART_NONE) {
- ++match_count;
- matched_character_count += g_utf8_strlen (namev[i], -1);
- matched_parts |= this_part_match;
- if (first_matched_part == EAB_CONTACT_MATCH_PART_NONE)
- first_matched_part = this_part_match;
- }
- }
- }
-
- match_type = EAB_CONTACT_MATCH_NONE;
-
- if (this_part_match != EAB_CONTACT_MATCH_PART_NONE) {
-
- if (match_count > 0)
- match_type = EAB_CONTACT_MATCH_VAGUE;
-
- if (fragment_count == match_count) {
-
- match_type = EAB_CONTACT_MATCH_EXACT;
-
- } else if (fragment_count == match_count + 1) {
-
- match_type = EAB_CONTACT_MATCH_PARTIAL;
-
- }
- }
-
- if (matched_parts_out)
- *matched_parts_out = matched_parts;
- if (first_matched_part_out)
- *first_matched_part_out = first_matched_part;
- if (matched_character_count_out)
- *matched_character_count_out = matched_character_count;
-
- g_strfreev (namev);
- g_strfreev (givenv);
- g_strfreev (addv);
- g_strfreev (familyv);
-
- return match_type;
-}
-
-EABContactMatchType
-eab_contact_compare_name (EContact *contact1, EContact *contact2)
-{
- EContactName *a, *b;
- gint matches=0, possible=0;
- gboolean given_match = FALSE, additional_match = FALSE, family_match = FALSE;
-
- g_return_val_if_fail (E_IS_CONTACT (contact1), EAB_CONTACT_MATCH_NOT_APPLICABLE);
- g_return_val_if_fail (E_IS_CONTACT (contact2), EAB_CONTACT_MATCH_NOT_APPLICABLE);
-
- a = e_contact_get (contact1, E_CONTACT_NAME);
- b = e_contact_get (contact2, E_CONTACT_NAME);
-
- if (a == NULL || b == NULL)
- return EAB_CONTACT_MATCH_NOT_APPLICABLE;
-
- if (a->given && b->given) {
- ++possible;
- if (name_fragment_match_with_synonyms (a->given, b->given, FALSE /* both inputs are complete */)) {
- ++matches;
- given_match = TRUE;
- }
- }
-
- if (a->additional && b->additional) {
- ++possible;
- if (name_fragment_match_with_synonyms (a->additional, b->additional, FALSE /* both inputs are complete */)) {
- ++matches;
- additional_match = TRUE;
- }
- }
-
- if (a->family && b->family) {
- ++possible;
- /* We don't allow "loose matching" (i.e. John vs. Jon) on family names */
- if (! e_utf8_casefold_collate (a->family, b->family)) {
- ++matches;
- family_match = TRUE;
- }
- }
-
- e_contact_name_free (a);
- e_contact_name_free (b);
-
- /* Now look at the # of matches and try to intelligently map
- an EAB_CONTACT_MATCH_* type to it. Special consideration is given
- to family-name matches. */
-
- if (possible == 0)
- return EAB_CONTACT_MATCH_NOT_APPLICABLE;
-
- if (possible == 1)
- return family_match ? EAB_CONTACT_MATCH_VAGUE : EAB_CONTACT_MATCH_NONE;
-
- if (possible == matches)
- return family_match ? EAB_CONTACT_MATCH_EXACT : EAB_CONTACT_MATCH_PARTIAL;
-
- if (possible == matches+1)
- return family_match ? EAB_CONTACT_MATCH_VAGUE : EAB_CONTACT_MATCH_NONE;
-
- return EAB_CONTACT_MATCH_NONE;
-}
-
-
-/*** Nickname Comparisons ***/
-
-EABContactMatchType
-eab_contact_compare_nickname (EContact *contact1, EContact *contact2)
-{
- g_return_val_if_fail (contact1 && E_IS_CONTACT (contact1), EAB_CONTACT_MATCH_NOT_APPLICABLE);
- g_return_val_if_fail (contact2 && E_IS_CONTACT (contact2), EAB_CONTACT_MATCH_NOT_APPLICABLE);
-
- return EAB_CONTACT_MATCH_NOT_APPLICABLE;
-}
-
-
-
-/*** E-mail Comparisons ***/
-
-static gboolean
-match_email_username (const gchar *addr1, const gchar *addr2)
-{
- gint c1, c2;
- if (addr1 == NULL || addr2 == NULL)
- return FALSE;
-
- while (*addr1 && *addr2 && *addr1 != '@' && *addr2 != '@') {
- c1 = isupper (*addr1) ? tolower (*addr1) : *addr1;
- c2 = isupper (*addr2) ? tolower (*addr2) : *addr2;
- if (c1 != c2)
- return FALSE;
- ++addr1;
- ++addr2;
- }
-
- return *addr1 == *addr2;
-}
-
-static gboolean
-match_email_hostname (const gchar *addr1, const gchar *addr2)
-{
- gint c1, c2;
- gboolean seen_at1, seen_at2;
- if (addr1 == NULL || addr2 == NULL)
- return FALSE;
-
- /* Walk to the end of each string. */
- seen_at1 = FALSE;
- if (*addr1) {
- while (*addr1) {
- if (*addr1 == '@')
- seen_at1 = TRUE;
- ++addr1;
- }
- --addr1;
- }
-
- seen_at2 = FALSE;
- if (*addr2) {
- while (*addr2) {
- if (*addr2 == '@')
- seen_at2 = TRUE;
- ++addr2;
- }
- --addr2;
- }
-
- if (!seen_at1 && !seen_at2)
- return TRUE;
- if (!seen_at1 || !seen_at2)
- return FALSE;
-
- while (*addr1 != '@' && *addr2 != '@') {
- c1 = isupper (*addr1) ? tolower (*addr1) : *addr1;
- c2 = isupper (*addr2) ? tolower (*addr2) : *addr2;
- if (c1 != c2)
- return FALSE;
- --addr1;
- --addr2;
- }
-
- /* This will match bob@foo.ximian.com and bob@ximian.com */
- return *addr1 == '.' || *addr2 == '.';
-}
-
-static EABContactMatchType
-compare_email_addresses (const gchar *addr1, const gchar *addr2)
-{
- if (addr1 == NULL || *addr1 == 0 ||
- addr2 == NULL || *addr2 == 0)
- return EAB_CONTACT_MATCH_NOT_APPLICABLE;
-
- if (match_email_username (addr1, addr2))
- return match_email_hostname (addr1, addr2) ? EAB_CONTACT_MATCH_EXACT : EAB_CONTACT_MATCH_VAGUE;
-
- return EAB_CONTACT_MATCH_NONE;
-}
-
-EABContactMatchType
-eab_contact_compare_email (EContact *contact1, EContact *contact2)
-{
- EABContactMatchType match = EAB_CONTACT_MATCH_NOT_APPLICABLE;
- GList *contact1_email, *contact2_email;
- GList *i1, *i2;
-
- g_return_val_if_fail (contact1 && E_IS_CONTACT (contact1), EAB_CONTACT_MATCH_NOT_APPLICABLE);
- g_return_val_if_fail (contact2 && E_IS_CONTACT (contact2), EAB_CONTACT_MATCH_NOT_APPLICABLE);
-
- contact1_email = e_contact_get (contact1, E_CONTACT_EMAIL);
- contact2_email = e_contact_get (contact2, E_CONTACT_EMAIL);
-
- if (contact1_email == NULL || contact2_email == NULL) {
- g_list_foreach (contact1_email, (GFunc)g_free, NULL);
- g_list_free (contact1_email);
-
- g_list_foreach (contact2_email, (GFunc)g_free, NULL);
- g_list_free (contact2_email);
- return EAB_CONTACT_MATCH_NOT_APPLICABLE;
- }
-
- i1 = contact1_email;
-
- /* Do pairwise-comparisons on all of the e-mail addresses. If
- we find an exact match, there is no reason to keep
- checking. */
- while (i1 && match != EAB_CONTACT_MATCH_EXACT) {
- char *addr1 = (char *) i1->data;
-
- i2 = contact2_email;
- while (i2 && match != EAB_CONTACT_MATCH_EXACT) {
- char *addr2 = (char *) i2->data;
-
- match = combine_comparisons (match, compare_email_addresses (addr1, addr2));
-
- i2 = i2->next;
- }
-
- i1 = i1->next;
- }
-
- g_list_foreach (contact1_email, (GFunc)g_free, NULL);
- g_list_free (contact1_email);
-
- g_list_foreach (contact2_email, (GFunc)g_free, NULL);
- g_list_free (contact2_email);
-
- return match;
-}
-
-EABContactMatchType
-eab_contact_compare_address (EContact *contact1, EContact *contact2)
-{
- g_return_val_if_fail (contact1 && E_IS_CONTACT (contact1), EAB_CONTACT_MATCH_NOT_APPLICABLE);
- g_return_val_if_fail (contact2 && E_IS_CONTACT (contact2), EAB_CONTACT_MATCH_NOT_APPLICABLE);
-
- /* Unimplemented */
-
- return EAB_CONTACT_MATCH_NOT_APPLICABLE;
-}
-
-EABContactMatchType
-eab_contact_compare_telephone (EContact *contact1, EContact *contact2)
-{
- g_return_val_if_fail (contact1 && E_IS_CONTACT (contact1), EAB_CONTACT_MATCH_NOT_APPLICABLE);
- g_return_val_if_fail (contact2 && E_IS_CONTACT (contact2), EAB_CONTACT_MATCH_NOT_APPLICABLE);
-
- /* Unimplemented */
-
- return EAB_CONTACT_MATCH_NOT_APPLICABLE;
-}
-
-EABContactMatchType
-eab_contact_compare (EContact *contact1, EContact *contact2)
-{
- EABContactMatchType result;
-
- g_return_val_if_fail (contact1 && E_IS_CONTACT (contact1), EAB_CONTACT_MATCH_NOT_APPLICABLE);
- g_return_val_if_fail (contact2 && E_IS_CONTACT (contact2), EAB_CONTACT_MATCH_NOT_APPLICABLE);
-
- result = EAB_CONTACT_MATCH_NONE;
- result = combine_comparisons (result, eab_contact_compare_name (contact1, contact2));
- result = combine_comparisons (result, eab_contact_compare_nickname (contact1, contact2));
- result = combine_comparisons (result, eab_contact_compare_email (contact1, contact2));
- result = combine_comparisons (result, eab_contact_compare_address (contact1, contact2));
- result = combine_comparisons (result, eab_contact_compare_telephone (contact1, contact2));
-
- return result;
-}
-
-typedef struct _MatchSearchInfo MatchSearchInfo;
-struct _MatchSearchInfo {
- EContact *contact;
- GList *avoid;
- EABContactMatchQueryCallback cb;
- gpointer closure;
-};
-
-static void
-match_search_info_free (MatchSearchInfo *info)
-{
- if (info) {
- g_object_unref (info->contact);
-
- /* This should already have been deallocated, but just in case... */
- if (info->avoid) {
- g_list_foreach (info->avoid, (GFunc) g_object_unref, NULL);
- g_list_free (info->avoid);
- info->avoid = NULL;
- }
-
- g_free (info);
- }
-}
-
-static void
-query_cb (EBook *book, EBookStatus status, GList *contacts, gpointer closure)
-{
- /* XXX we need to free contacts */
- MatchSearchInfo *info = (MatchSearchInfo *) closure;
- EABContactMatchType best_match = EAB_CONTACT_MATCH_NONE;
- EContact *best_contact = NULL;
- GList *remaining_contacts = NULL;
- const GList *i;
-
- if (status != E_BOOK_ERROR_OK) {
- info->cb (info->contact, NULL, EAB_CONTACT_MATCH_NONE, info->closure);
- match_search_info_free (info);
- return;
- }
-
- /* remove the contacts we're to avoid from the list, if they're present */
- for (i = contacts; i != NULL; i = g_list_next (i)) {
- EContact *this_contact = E_CONTACT (i->data);
- GList *iterator;
- gboolean avoid = FALSE;
- for (iterator = info->avoid; iterator; iterator = iterator->next) {
- if (!strcmp (e_contact_get_const (iterator->data, E_CONTACT_UID),
- e_contact_get_const (this_contact, E_CONTACT_UID))) {
- avoid = TRUE;
- break;
- }
- }
- if (!avoid)
- remaining_contacts = g_list_prepend (remaining_contacts, this_contact);
- }
-
- remaining_contacts = g_list_reverse (remaining_contacts);
-
- for (i = remaining_contacts; i != NULL; i = g_list_next (i)) {
- EContact *this_contact = E_CONTACT (i->data);
- EABContactMatchType this_match = eab_contact_compare (info->contact, this_contact);
- if ((gint)this_match > (gint)best_match) {
- best_match = this_match;
- best_contact = this_contact;
- }
- }
-
- g_list_free (remaining_contacts);
-
- info->cb (info->contact, best_contact, best_match, info->closure);
- match_search_info_free (info);
-}
-
-#define MAX_QUERY_PARTS 10
-static void
-use_common_book_cb (EBook *book, gpointer closure)
-{
- MatchSearchInfo *info = (MatchSearchInfo *) closure;
- EContact *contact = info->contact;
- EContactName *contact_name;
- GList *contact_email;
- gchar *query_parts[MAX_QUERY_PARTS];
- gint p=0;
- gchar *query, *qj;
- int i;
-
- if (book == NULL) {
- info->cb (info->contact, NULL, EAB_CONTACT_MATCH_NONE, info->closure);
- match_search_info_free (info);
- return;
- }
-
- contact_name = e_contact_get (contact, E_CONTACT_NAME);
- if (contact_name) {
- if (contact_name->given && *contact_name->given)
- query_parts[p++] = g_strdup_printf ("(contains \"full_name\" \"%s\")", contact_name->given);
-
- if (contact_name->additional && *contact_name->additional)
- query_parts[p++] = g_strdup_printf ("(contains \"full_name\" \"%s\")", contact_name->additional);
-
- if (contact_name->family && *contact_name->family)
- query_parts[p++] = g_strdup_printf ("(contains \"full_name\" \"%s\")", contact_name->family);
-
- e_contact_name_free (contact_name);
- }
-
- contact_email = e_contact_get (contact, E_CONTACT_EMAIL);
- if (contact_email) {
- GList *iter;
- for (iter = contact_email; iter && p < MAX_QUERY_PARTS; iter = iter->next) {
- gchar *addr = g_strdup (iter->data);
- if (addr && *addr) {
- gchar *s = addr;
- while (*s) {
- if (*s == '@') {
- *s = '\0';
- break;
- }
- ++s;
- }
- query_parts[p++] = g_strdup_printf ("(beginswith \"email\" \"%s\")", addr);
- g_free (addr);
- }
- }
- }
- g_list_foreach (contact_email, (GFunc)g_free, NULL);
- g_list_free (contact_email);
-
-
- /* Build up our full query from the parts. */
- query_parts[p] = NULL;
- qj = g_strjoinv (" ", query_parts);
- for(i = 0; query_parts[i] != NULL; i++)
- g_free(query_parts[i]);
- if (p > 0) {
- query = g_strdup_printf ("(or %s)", qj);
- g_free (qj);
- } else {
- query = qj;
- }
-
- if (query && *query)
- e_book_async_get_contacts (book, query, query_cb, info);
- else
- query_cb (book, E_BOOK_ERROR_OK, NULL, info);
-
- g_free (query);
-}
-
-void
-eab_contact_locate_match (EContact *contact, EABContactMatchQueryCallback cb, gpointer closure)
-{
- MatchSearchInfo *info;
-
- g_return_if_fail (contact && E_IS_CONTACT (contact));
- g_return_if_fail (cb != NULL);
-
- info = g_new (MatchSearchInfo, 1);
- info->contact = contact;
- g_object_ref (contact);
- info->cb = cb;
- info->closure = closure;
- info->avoid = NULL;
-
- addressbook_load_default_book (use_common_book_cb, info);
-}
-
-/**
- * e_contact_locate_match_full:
- * @book: The book to look in. If this is NULL, use the default
- * addressbook.
- * @contact: The contact to compare to.
- * @avoid: A list of contacts to not match. These will not show up in the search.
- * @cb: The function to call.
- * @closure: The closure to add to the call.
- *
- * Look for the best match and return it using the EABContactMatchQueryCallback.
- **/
-void
-eab_contact_locate_match_full (EBook *book, EContact *contact, GList *avoid, EABContactMatchQueryCallback cb, gpointer closure)
-{
- MatchSearchInfo *info;
-
- g_return_if_fail (contact && E_IS_CONTACT (contact));
- g_return_if_fail (cb != NULL);
-
- info = g_new (MatchSearchInfo, 1);
- info->contact = contact;
- g_object_ref (contact);
- info->cb = cb;
- info->closure = closure;
- info->avoid = g_list_copy (avoid);
- g_list_foreach (info->avoid, (GFunc) g_object_ref, NULL);
-
- if (book)
- use_common_book_cb (book, info);
- else
- addressbook_load_default_book (use_common_book_cb, info);
-}
-
diff --git a/addressbook/gui/merging/eab-contact-compare.h b/addressbook/gui/merging/eab-contact-compare.h
deleted file mode 100644
index 4b97b3c698..0000000000
--- a/addressbook/gui/merging/eab-contact-compare.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * eab-contact-compare.h
- *
- * Copyright (C) 2001,2002,2003 Ximian, Inc.
- *
- * Authors: Jon Trowbridge <trow@ximian.com>
- * Chris Toshok <toshok@ximian.com>
- */
-
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA.
- */
-
-#ifndef __EAB_CONTACT_COMPARE_H__
-#define __EAB_CONTACT_COMPARE_H__
-
-#include <libebook/e-book.h>
-#include <libebook/e-contact.h>
-
-typedef enum {
- EAB_CONTACT_MATCH_NOT_APPLICABLE = 0,
- EAB_CONTACT_MATCH_NONE = 1,
- EAB_CONTACT_MATCH_VAGUE = 2,
- EAB_CONTACT_MATCH_PARTIAL = 3,
- EAB_CONTACT_MATCH_EXACT = 4
-} EABContactMatchType;
-
-typedef enum {
- EAB_CONTACT_MATCH_PART_NOT_APPLICABLE = -1,
- EAB_CONTACT_MATCH_PART_NONE = 0,
- EAB_CONTACT_MATCH_PART_GIVEN_NAME = 1<<0,
- EAB_CONTACT_MATCH_PART_ADDITIONAL_NAME = 1<<2,
- EAB_CONTACT_MATCH_PART_FAMILY_NAME = 1<<3
-} EABContactMatchPart;
-
-typedef void (*EABContactMatchQueryCallback) (EContact *contact, EContact *match, EABContactMatchType type, gpointer closure);
-
-EABContactMatchType eab_contact_compare_name_to_string (EContact *contact, const gchar *str);
-
-EABContactMatchType eab_contact_compare_name_to_string_full (EContact *contact, const gchar *str,
- gboolean allow_partial_matches,
- gint *matched_parts, EABContactMatchPart *first_matched_part,
- gint *matched_character_count);
-
-EABContactMatchType eab_contact_compare_name (EContact *contact1, EContact *contact2);
-EABContactMatchType eab_contact_compare_nickname (EContact *contact1, EContact *contact2);
-EABContactMatchType eab_contact_compare_email (EContact *contact1, EContact *contact2);
-EABContactMatchType eab_contact_compare_address (EContact *contact1, EContact *contact2);
-EABContactMatchType eab_contact_compare_telephone (EContact *contact1, EContact *contact2);
-
-EABContactMatchType eab_contact_compare (EContact *contact1, EContact *contact2);
-
-void eab_contact_locate_match (EContact *contact, EABContactMatchQueryCallback cb, gpointer closure);
-void eab_contact_locate_match_full (EBook *book, EContact *contact, GList *avoid, EABContactMatchQueryCallback cb, gpointer closure);
-
-
-
-#endif /* __E_CONTACT_COMPARE_H__ */
-
diff --git a/addressbook/gui/merging/eab-contact-duplicate-detected.glade b/addressbook/gui/merging/eab-contact-duplicate-detected.glade
deleted file mode 100644
index c44547fb92..0000000000
--- a/addressbook/gui/merging/eab-contact-duplicate-detected.glade
+++ /dev/null
@@ -1,212 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-
-<widget class="GtkDialog" id="dialog-duplicate-contact">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="title" translatable="yes">Duplicate Contact Detected</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="has_separator">True</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox1">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area1">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="button4">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">1</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button3">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-add</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="table1">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="n_rows">5</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="Custom" id="custom-old-contact">
- <property name="visible">True</property>
- <property name="creation_function">_eab_contact_merging_create_contact_display</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Sun, 05 Oct 2003 03:55:10 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">The name or email address of this contact already exists
-in this folder. Would you like to add it anyway?</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label3">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Original Contact:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label4">
- <property name="visible">True</property>
- <property name="label" translatable="yes">New Contact:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="custom-new-contact">
- <property name="visible">True</property>
- <property name="creation_function">_eab_contact_merging_create_contact_display</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Sun, 05 Oct 2003 03:54:50 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment1">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0</property>
- <property name="xscale">1</property>
- <property name="yscale">0</property>
-
- <child>
- <widget class="Custom" id="custom2">
- <property name="visible">True</property>
- <property name="creation_function">e_create_image_widget</property>
- <property name="string1">malehead.png</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Fri, 08 Jun 2001 00:18:39 GMT</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">5</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/addressbook/gui/merging/eab-contact-merging.c b/addressbook/gui/merging/eab-contact-merging.c
deleted file mode 100644
index 38a3c188b2..0000000000
--- a/addressbook/gui/merging/eab-contact-merging.c
+++ /dev/null
@@ -1,197 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Code for checking for duplicates when doing EContact work.
- *
- * Authors:
- * Christopher James Lahey <clahey@ximian.com>
- * Chris Toshok <toshok@ximian.com>
- *
- * Copyright (C) 2001, 2002, 2003, Ximian, Inc.
- */
-
-#include <config.h>
-
-#include "eab-contact-merging.h"
-#include "eab-contact-compare.h"
-#include <glade/glade.h>
-#include <gtk/gtksignal.h>
-#include "addressbook/gui/widgets/eab-contact-display.h"
-
-typedef enum {
- E_CONTACT_MERGING_ADD,
- E_CONTACT_MERGING_COMMIT
-} EContactMergingOpType;
-
-typedef struct {
- EContactMergingOpType op;
- EBook *book;
- EContact *contact;
- EBookIdCallback id_cb;
- EBookCallback cb;
- gpointer closure;
-} EContactMergingLookup;
-
-static void
-free_lookup (EContactMergingLookup *lookup)
-{
- g_object_unref (lookup->book);
- g_object_unref (lookup->contact);
-
- g_free (lookup);
-}
-
-static void
-final_id_cb (EBook *book, EBookStatus status, const char *id, gpointer closure)
-{
- EContactMergingLookup *lookup = closure;
-
- if (lookup->id_cb)
- lookup->id_cb (lookup->book, status, id, lookup->closure);
-
- free_lookup (lookup);
-}
-
-static void
-final_cb (EBook *book, EBookStatus status, gpointer closure)
-{
- EContactMergingLookup *lookup = closure;
-
- if (lookup->cb)
- lookup->cb (lookup->book, status, lookup->closure);
-
- free_lookup (lookup);
-}
-
-static void
-doit (EContactMergingLookup *lookup)
-{
- if (lookup->op == E_CONTACT_MERGING_ADD)
- e_book_async_add_contact (lookup->book, lookup->contact, final_id_cb, lookup);
- else if (lookup->op == E_CONTACT_MERGING_COMMIT)
- e_book_async_commit_contact (lookup->book, lookup->contact, final_cb, lookup);
-}
-
-static void
-cancelit (EContactMergingLookup *lookup)
-{
- if (lookup->op == E_CONTACT_MERGING_ADD) {
- if (lookup->id_cb)
- final_id_cb (lookup->book, E_BOOK_ERROR_CANCELLED, NULL, lookup);
- } else if (lookup->op == E_CONTACT_MERGING_COMMIT) {
- if (lookup->cb)
- final_cb (lookup->book, E_BOOK_ERROR_CANCELLED, lookup);
- }
-}
-
-static void
-response (GtkWidget *dialog, int response, EContactMergingLookup *lookup)
-{
- gtk_widget_destroy (dialog);
-
- switch (response) {
- case 0:
- doit (lookup);
- break;
- case 1:
- cancelit (lookup);
- break;
- }
-}
-
-static void
-match_query_callback (EContact *contact, EContact *match, EABContactMatchType type, gpointer closure)
-{
- EContactMergingLookup *lookup = closure;
-
- if ((gint) type <= (gint) EAB_CONTACT_MATCH_VAGUE) {
- doit (lookup);
- } else {
- GladeXML *ui;
-
- GtkWidget *widget;
-
- if (lookup->op == E_CONTACT_MERGING_ADD)
- ui = glade_xml_new (EVOLUTION_GLADEDIR "/eab-contact-duplicate-detected.glade", NULL, NULL);
- else if (lookup->op == E_CONTACT_MERGING_COMMIT)
- ui = glade_xml_new (EVOLUTION_GLADEDIR "/eab-contact-merging-commit-duplicate-detected.glade", NULL, NULL);
- else {
- doit (lookup);
- return;
- }
-
- widget = glade_xml_get_widget (ui, "custom-old-contact");
- eab_contact_display_render (EAB_CONTACT_DISPLAY (widget),
- match, EAB_CONTACT_DISPLAY_RENDER_COMPACT);
-
- widget = glade_xml_get_widget (ui, "custom-new-contact");
- eab_contact_display_render (EAB_CONTACT_DISPLAY (widget),
- contact, EAB_CONTACT_DISPLAY_RENDER_COMPACT);
-
- widget = glade_xml_get_widget (ui, "dialog-duplicate-contact");
-
- g_signal_connect (widget, "response",
- G_CALLBACK (response), lookup);
-
- gtk_widget_show_all (widget);
- }
-}
-
-gboolean
-eab_merging_book_add_contact (EBook *book,
- EContact *contact,
- EBookIdCallback cb,
- gpointer closure)
-{
- EContactMergingLookup *lookup;
-
- lookup = g_new (EContactMergingLookup, 1);
-
- lookup->op = E_CONTACT_MERGING_ADD;
- lookup->book = g_object_ref (book);
- lookup->contact = g_object_ref (contact);
- lookup->id_cb = cb;
- lookup->closure = closure;
-
- eab_contact_locate_match_full (book, contact, NULL, match_query_callback, lookup);
-
- return TRUE;
-}
-
-gboolean
-eab_merging_book_commit_contact (EBook *book,
- EContact *contact,
- EBookCallback cb,
- gpointer closure)
-{
- EContactMergingLookup *lookup;
- GList *avoid;
-
- lookup = g_new (EContactMergingLookup, 1);
-
- lookup->op = E_CONTACT_MERGING_COMMIT;
- lookup->book = g_object_ref (book);
- lookup->contact = g_object_ref (contact);
- lookup->cb = cb;
- lookup->closure = closure;
-
- avoid = g_list_append (NULL, contact);
-
- eab_contact_locate_match_full (book, contact, avoid, match_query_callback, lookup);
-
- g_list_free (avoid);
-
- return TRUE;
-}
-
-GtkWidget *
-_eab_contact_merging_create_contact_display(gchar *name,
- gchar *string1, gchar *string2,
- gint int1, gint int2);
-
-GtkWidget *
-_eab_contact_merging_create_contact_display(gchar *name,
- gchar *string1, gchar *string2,
- gint int1, gint int2)
-{
- return eab_contact_display_new();
-}
diff --git a/addressbook/gui/merging/eab-contact-merging.h b/addressbook/gui/merging/eab-contact-merging.h
deleted file mode 100644
index d6d60e57de..0000000000
--- a/addressbook/gui/merging/eab-contact-merging.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * The Evolution addressbook client object.
- *
- * Authors:
- * Christopher James Lahey <clahey@ximian.com>
- * Chris Toshok <toshok@ximian.com>
- *
- * Copyright (C) 2001, 2002, 2003 Ximian, Inc.
- */
-
-#ifndef __E_CONTACT_MERGING_H__
-#define __E_CONTACT_MERGING_H__
-
-#include <libebook/e-book-async.h>
-
-G_BEGIN_DECLS
-
-gboolean eab_merging_book_add_contact (EBook *book,
- EContact *contact,
- EBookIdCallback cb,
- gpointer closure);
-gboolean eab_merging_book_commit_contact (EBook *book,
- EContact *contact,
- EBookCallback cb,
- gpointer closure);
-
-G_END_DECLS
-
-#endif /* ! __EAB_CONTACT_MERGING_H__ */
diff --git a/addressbook/gui/search/.cvsignore b/addressbook/gui/search/.cvsignore
deleted file mode 100644
index d6c55c7345..0000000000
--- a/addressbook/gui/search/.cvsignore
+++ /dev/null
@@ -1,7 +0,0 @@
-.deps
-.libs
-.pure
-Makefile
-Makefile.in
-*.lo
-*.la
diff --git a/addressbook/gui/search/Makefile.am b/addressbook/gui/search/Makefile.am
deleted file mode 100644
index 391039d81f..0000000000
--- a/addressbook/gui/search/Makefile.am
+++ /dev/null
@@ -1,23 +0,0 @@
-ruledir = $(privdatadir)
-rule_DATA = addresstypes.xml
-
-EXTRA_DIST = addresstypes.xml
-
-INCLUDES = \
- -DG_LOG_DOMAIN=\"e-addressbook-search\" \
- -I$(top_srcdir) \
- -I$(top_srcdir)/addressbook/backend \
- -I$(top_builddir)/addressbook/backend \
- -I$(top_srcdir)/addressbook/contact-editor \
- -I$(top_srcdir)/widgets/e-text \
- -I$(top_srcdir)/widgets/misc \
- -I$(top_builddir)/shell \
- -DSEARCH_RULE_DIR=\"$(ruledir)\" \
- $(EVOLUTION_ADDRESSBOOK_CFLAGS)
-
-noinst_LTLIBRARIES = \
- libeaddressbooksearch.la
-
-libeaddressbooksearch_la_SOURCES = \
- e-addressbook-search-dialog.c \
- e-addressbook-search-dialog.h
diff --git a/addressbook/gui/search/addresstypes.xml b/addressbook/gui/search/addresstypes.xml
deleted file mode 100644
index 4ee23af613..0000000000
--- a/addressbook/gui/search/addresstypes.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?xml version="1.0"?>
-<filterdescription>
-<partset>
- <part name="name">
- <title>Name</title>
- <input type="optionlist" name="name-type">
- <option value="contains">
- <title>contains</title>
- <code>(contains "full_name" ${name})</code>
- </option>
- <option value="not contains">
- <title>does not contain</title>
- <code>(not (contains "full_name" ${name}))</code>
- </option>
- <option value="is">
- <title>is</title>
- <code>(is "full_name" ${name})))</code>
- </option>
- <option value="is not">
- <title>is not</title>
- <code>(not (is "full_name" ${name}))</code>
- </option>
- <option value="begin">
- <title>begins with</title>
- <code>(beginswith "full_name" ${name})</code>
- </option>
- <option value="end">
- <title>ends in</title>
- <code>(endswith "full_name" ${name})</code>
- </option>
- </input>
- <input type="string" name="name"/>
- </part>
- <part name="email">
- <title>Email</title>
- <input type="optionlist" name="email-type">
- <option value="contains">
- <title>contains</title>
- <code>(contains "email" ${email})</code>
- </option>
- <option value="not contains">
- <title>does not contain</title>
- <code>(not (contains "email" ${email}))</code>
- </option>
- <option value="is">
- <title>is</title>
- <code>(is "email" ${email})</code>
- </option>
- <option value="is not">
- <title>is not</title>
- <code>(not (is "email" ${email}))</code>
- </option>
- </input>
- <input type="address" name="email"/>
- </part>
- <part name="category">
- <title>Category</title>
- <input type="optionlist" name="category-type">
- <option value="contains">
- <title>contains</title>
- <code>(contains "category" ${category})</code>
- </option>
- <option value="not contains">
- <title>does not contain</title>
- <code>(not (contains "category" ${category}))</code>
- </option>
- <option value="is">
- <title>is</title>
- <code>(is "category" ${category})</code>
- </option>
- <option value="is not">
- <title>is not</title>
- <code>(not (is "category" ${category}))</code>
- </option>
- </input>
- <input type="string" name="category"/>
- </part>
- <part name="sexp">
- <title>Expression</title>
- <input type="code" name="code"/>
- </part>
-</partset>
-</filterdescription>
diff --git a/addressbook/gui/search/e-addressbook-search-dialog.c b/addressbook/gui/search/e-addressbook-search-dialog.c
deleted file mode 100644
index a8621bf5a7..0000000000
--- a/addressbook/gui/search/e-addressbook-search-dialog.c
+++ /dev/null
@@ -1,158 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-addressbook-search-dialog.c
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-
-#include <gtk/gtkbox.h>
-#include <gtk/gtkentry.h>
-#include <gtk/gtkstock.h>
-#include <libgnome/gnome-i18n.h>
-#include "gal/util/e-util.h"
-
-#include "e-addressbook-search-dialog.h"
-
-
-static void eab_search_dialog_init (EABSearchDialog *widget);
-static void eab_search_dialog_class_init (EABSearchDialogClass *klass);
-static void eab_search_dialog_dispose (GObject *object);
-
-static GtkDialog *parent_class = NULL;
-
-#define PARENT_TYPE GTK_TYPE_DIALOG
-
-E_MAKE_TYPE (eab_search_dialog,
- "EABSearchDialog",
- EABSearchDialog,
- eab_search_dialog_class_init,
- eab_search_dialog_init,
- PARENT_TYPE)
-
-static void
-eab_search_dialog_class_init (EABSearchDialogClass *klass)
-{
- GObjectClass *object_class;
-
- object_class = (GObjectClass*) klass;
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- object_class->dispose = eab_search_dialog_dispose;
-}
-
-static GtkWidget *
-get_widget (EABSearchDialog *view)
-{
- FilterPart *part;
-
- view->context = rule_context_new();
- /* FIXME: hide this in a class */
- rule_context_add_part_set(view->context, "partset", filter_part_get_type(),
- rule_context_add_part, rule_context_next_part);
- rule_context_load(view->context, SEARCH_RULE_DIR "/addresstypes.xml", "");
- view->rule = filter_rule_new();
- part = rule_context_next_part(view->context, NULL);
- if (part == NULL) {
- g_warning("Problem loading search for addressbook no parts to load");
- return gtk_entry_new();
- } else {
- filter_rule_add_part(view->rule, filter_part_clone(part));
- return filter_rule_get_widget(view->rule, view->context);
- }
-}
-
-static char *
-get_query (EABSearchDialog *view)
-{
- GString *out = g_string_new("");
- char *ret;
-
- filter_rule_build_code(view->rule, out);
- ret = out->str;
- printf("Searching using %s\n", ret);
- g_string_free(out, FALSE);
- return ret;
-}
-
-static void
-dialog_response (GtkWidget *widget, int response_id, EABSearchDialog *dialog)
-{
- char *query;
-
- if (response_id == GTK_RESPONSE_OK) {
- query = get_query(dialog);
- g_object_set(dialog->view,
- "query", query,
- NULL);
- g_free(query);
- }
-
- gtk_widget_destroy(GTK_WIDGET (dialog));
-}
-
-static void
-eab_search_dialog_init (EABSearchDialog *view)
-{
- GtkDialog *dialog = GTK_DIALOG (view);
-
- gtk_window_set_default_size (GTK_WINDOW (view), 550, 400);
- gtk_window_set_title(GTK_WINDOW(view), _("Advanced Search"));
- view->search = get_widget(view);
- gtk_box_pack_start(GTK_BOX(dialog->vbox), view->search, TRUE, TRUE, 0);
- gtk_widget_show(view->search);
-
- gtk_dialog_add_buttons (dialog,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- /*GTK_STOCK_SAVE, GTK_RESPONSE_APPLY,*/
- GTK_STOCK_OK, GTK_RESPONSE_OK,
- NULL);
-
- gtk_dialog_set_default_response (dialog, GTK_RESPONSE_OK);
-
- g_signal_connect(dialog, "response",
- G_CALLBACK(dialog_response), view);
-}
-
-GtkWidget *
-eab_search_dialog_new (EABView *addr_view)
-{
- EABSearchDialog *view = g_object_new (EAB_SEARCH_DIALOG_TYPE, NULL);
- view->view = addr_view;
- return GTK_WIDGET(view);
-}
-
-static void
-eab_search_dialog_dispose (GObject *object)
-{
- EABSearchDialog *view;
-
- view = EAB_SEARCH_DIALOG (object);
-
- if (view->context) {
- g_object_unref(view->context);
- view->context = NULL;
- }
- if (view->rule) {
- g_object_unref(view->rule);
- view->rule = NULL;
- }
-
- G_OBJECT_CLASS(parent_class)->dispose (object);
-}
diff --git a/addressbook/gui/search/e-addressbook-search-dialog.h b/addressbook/gui/search/e-addressbook-search-dialog.h
deleted file mode 100644
index 8634074f69..0000000000
--- a/addressbook/gui/search/e-addressbook-search-dialog.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* e-minicard-view-widget.h
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef __EAB_SEARCH_DIALOG_H__
-#define __EAB_SEARCH_DIALOG_H__
-
-#include <libebook/e-book.h>
-
-#include "addressbook/gui/widgets/e-addressbook-view.h"
-#include "filter/rule-context.h"
-#include "filter/filter-rule.h"
-#include <gtk/gtkdialog.h>
-
-G_BEGIN_DECLS
-
-#define EAB_SEARCH_DIALOG_TYPE (eab_search_dialog_get_type ())
-#define EAB_SEARCH_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EAB_SEARCH_DIALOG_TYPE, EABSearchDialog))
-#define EAB_SEARCH_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EAB_SEARCH_DIALOG_TYPE, EABSearchDialogClass))
-#define E_IS_ADDRESSBOOK_SEARCH_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EAB_SEARCH_DIALOG_TYPE))
-#define E_IS_ADDRESSBOOK_SEARCH_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), EAB_SEARCH_DIALOG_TYPE))
-
-
-typedef struct _EABSearchDialog EABSearchDialog;
-typedef struct _EABSearchDialogClass EABSearchDialogClass;
-
-struct _EABSearchDialog
-{
- GtkDialog parent;
-
- GtkWidget *search;
-
- EABView *view;
-
- RuleContext *context;
- FilterRule *rule;
-};
-
-struct _EABSearchDialogClass
-{
- GtkDialogClass parent_class;
-};
-
-GType eab_search_dialog_get_type (void);
-
-GtkWidget *eab_search_dialog_new (EABView *view);
-
-G_END_DECLS
-
-#endif /* __EAB_SEARCH_DIALOG_H__ */
diff --git a/addressbook/gui/widgets/.cvsignore b/addressbook/gui/widgets/.cvsignore
deleted file mode 100644
index b67f65e6c3..0000000000
--- a/addressbook/gui/widgets/.cvsignore
+++ /dev/null
@@ -1,19 +0,0 @@
-.deps
-.libs
-.pure
-Makefile
-Makefile.in
-*.lo
-*.la
-minicard-label-test
-minicard-test
-minicard-view-test
-minicard-widget-test
-reflow-test
-eab-marshal.c
-eab-marshal.h
-Evolution-Composer-stubs.c
-Evolution-Composer-skels.c
-Evolution-Composer-common.c
-Evolution-Composer.h
-
diff --git a/addressbook/gui/widgets/Makefile.am b/addressbook/gui/widgets/Makefile.am
deleted file mode 100644
index ce5cc32275..0000000000
--- a/addressbook/gui/widgets/Makefile.am
+++ /dev/null
@@ -1,89 +0,0 @@
-INCLUDES = \
- -DG_LOG_DOMAIN=\"eab-widgets\" \
- -DEVOLUTION_ETSPECDIR=\""$(etspecdir)"\" \
- -DEVOLUTION_IMAGESDIR=\""$(imagesdir)"\" \
- -DEVOLUTION_GALVIEWSDIR=\""$(viewsdir)"\" \
- -I$(top_srcdir) \
- -I$(top_srcdir)/addressbook \
- -I$(top_srcdir)/addressbook/backend \
- -I$(top_builddir)/addressbook/backend \
- -I$(top_srcdir)/addressbook/gui/contact-editor \
- -I$(top_srcdir)/addressbook/gui/merging \
- -I$(top_srcdir)/addressbook/gui/component \
- -I$(top_srcdir)/widgets/misc \
- -I$(top_builddir)/shell \
- $(EVOLUTION_ADDRESSBOOK_CFLAGS)
-
-CORBA_COMPOSER_SOURCE_H = \
- Evolution-Composer.h
-CORBA_COMPOSER_SOURCE_C = \
- Evolution-Composer-common.c \
- Evolution-Composer-skels.c \
- Evolution-Composer-stubs.c
-CORBA_COMPOSER_IDL = $(srcdir)/../../../composer/Evolution-Composer.idl
-
-$(CORBA_COMPOSER_SOURCE_H): $(CORBA_COMPOSER_IDL)
- $(ORBIT_IDL) -I $(srcdir) $(IDL_INCLUDES) $(CORBA_COMPOSER_IDL)
-
-$(CORBA_COMPOSER_SOURCE_C): $(CORBA_COMPOSER_SOURCE_H)
-
-CORBA_SOURCE_H = $(CORBA_COMPOSER_SOURCE_H)
-CORBA_SOURCE_C = $(CORBA_COMPOSER_SOURCE_C)
-CORBA_SOURCE = $(CORBA_SOURCE_H) $(CORBA_SOURCE_C)
-
-noinst_LTLIBRARIES = \
- libeabwidgets.la
-
-libeabwidgets_la_SOURCES = \
- $(CORBA_SOURCE) \
- $(MARSHAL_GENERATED) \
- eab-contact-display.c \
- eab-contact-display.h \
- eab-gui-util.c \
- eab-gui-util.h \
- eab-popup-control.c \
- eab-popup-control.h \
- eab-vcard-control.c \
- eab-vcard-control.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-view.c \
- e-addressbook-view.h \
- gal-view-minicard.c \
- gal-view-minicard.h \
- gal-view-factory-minicard.c \
- gal-view-factory-minicard.h
-
-#TREEVIEW_SOURCES= e-addressbook-treeview-adapter.c \
-# e-addressbook-treeview-adapter.h \
-# gal-view-factory-treeview.c \
-# gal-view-factory-treeview.h \
-# gal-view-treeview.c \
-# gal-view-treeview.h
-
-MARSHAL_GENERATED = eab-marshal.c eab-marshal.h
-@EVO_MARSHAL_RULE@
-
-BUILT_SOURCES = $(CORBA_SOURCE) $(MARSHAL_GENERATED)
-CLEANFILES = $(BUILT_SOURCES)
-
-dist-hook:
- cd $(distdir); rm -f $(BUILT_SOURCES)
-
-etspec_DATA= e-addressbook-view.etspec
-
-EXTRA_DIST = \
- $(etspec_DATA) \
- eab-marshal.list
diff --git a/addressbook/gui/widgets/e-addressbook-model.c b/addressbook/gui/widgets/e-addressbook-model.c
deleted file mode 100644
index 992b42b852..0000000000
--- a/addressbook/gui/widgets/e-addressbook-model.c
+++ /dev/null
@@ -1,693 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- *
- * Author:
- * Christopher James Lahey <clahey@ximian.com>
- *
- * (C) 1999 Ximian, Inc.
- */
-
-#include <config.h>
-#include "eab-marshal.h"
-#include "e-addressbook-model.h"
-#include <libxml/tree.h>
-#include <libxml/parser.h>
-#include <libxml/xmlmemory.h>
-#include <gnome.h>
-#include <gal/widgets/e-gui-utils.h>
-#include "eab-gui-util.h"
-
-#define PARENT_TYPE G_TYPE_OBJECT
-static GObjectClass *parent_class;
-
-/*
- * EABModel callbacks
- * These are the callbacks that define the behavior of our custom model.
- */
-static void eab_model_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static void eab_model_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
-
-
-enum {
- PROP_0,
- PROP_BOOK,
- PROP_QUERY,
- PROP_EDITABLE,
-};
-
-enum {
- WRITABLE_STATUS,
- STATUS_MESSAGE,
- SEARCH_STARTED,
- SEARCH_RESULT,
- FOLDER_BAR_MESSAGE,
- CONTACT_ADDED,
- CONTACT_REMOVED,
- CONTACT_CHANGED,
- MODEL_CHANGED,
- STOP_STATE_CHANGED,
- BACKEND_DIED,
- LAST_SIGNAL
-};
-
-static guint eab_model_signals [LAST_SIGNAL] = {0, };
-
-static void
-free_data (EABModel *model)
-{
- if (model->data) {
- int i;
-
- for ( i = 0; i < model->data_count; i++ ) {
- g_object_unref (model->data[i]);
- }
-
- g_free(model->data);
- model->data = NULL;
- model->data_count = 0;
- model->allocated_count = 0;
- }
-}
-
-static void
-remove_book_view(EABModel *model)
-{
- if (model->book_view && model->create_contact_id)
- g_signal_handler_disconnect (model->book_view,
- model->create_contact_id);
- if (model->book_view && model->remove_contact_id)
- g_signal_handler_disconnect (model->book_view,
- model->remove_contact_id);
- if (model->book_view && model->modify_contact_id)
- g_signal_handler_disconnect (model->book_view,
- model->modify_contact_id);
- if (model->book_view && model->status_message_id)
- g_signal_handler_disconnect (model->book_view,
- model->status_message_id);
- if (model->book_view && model->sequence_complete_id)
- g_signal_handler_disconnect (model->book_view,
- model->sequence_complete_id);
-
- model->create_contact_id = 0;
- model->remove_contact_id = 0;
- model->modify_contact_id = 0;
- model->status_message_id = 0;
- model->sequence_complete_id = 0;
-
- model->search_in_progress = FALSE;
-
- if (model->book_view) {
- e_book_view_stop (model->book_view);
- g_object_unref (model->book_view);
- model->book_view = NULL;
- }
-}
-
-static void
-addressbook_dispose(GObject *object)
-{
- EABModel *model = EAB_MODEL(object);
-
- remove_book_view(model);
- free_data (model);
-
- if (model->book) {
- if (model->writable_status_id)
- g_signal_handler_disconnect (model->book,
- model->writable_status_id);
- model->writable_status_id = 0;
-
- if (model->backend_died_id)
- g_signal_handler_disconnect (model->book,
- model->backend_died_id);
- model->backend_died_id = 0;
-
- g_object_unref (model->book);
- model->book = NULL;
- }
-
- if (model->query) {
- e_book_query_unref (model->query);
- model->query = NULL;
- }
-
- if (G_OBJECT_CLASS(parent_class)->dispose)
- G_OBJECT_CLASS(parent_class)->dispose(object);
-}
-
-static void
-update_folder_bar_message (EABModel *model)
-{
- int count;
- char *message;
-
- count = model->data_count;
-
- switch (count) {
- case 0:
- message = g_strdup (_("No contacts"));
- break;
- case 1:
- message = g_strdup (_("1 contact"));
- break;
- default:
- message = g_strdup_printf (_("%d contacts"), count);
- break;
- }
-
- g_signal_emit (model,
- eab_model_signals [FOLDER_BAR_MESSAGE], 0,
- message);
-
- g_free (message);
-}
-
-static void
-create_contact(EBookView *book_view,
- const GList *contacts,
- EABModel *model)
-{
- int old_count = model->data_count;
- int length = g_list_length ((GList *)contacts);
-
- if (model->data_count + length > model->allocated_count) {
- while (model->data_count + length > model->allocated_count)
- model->allocated_count = model->allocated_count * 2 + 1;
- model->data = g_renew(EContact *, model->data, model->allocated_count);
- }
-
- for ( ; contacts; contacts = contacts->next) {
- model->data[model->data_count++] = contacts->data;
- g_object_ref (contacts->data);
- }
-
- g_signal_emit (model,
- eab_model_signals [CONTACT_ADDED], 0,
- old_count, model->data_count - old_count);
-
- update_folder_bar_message (model);
-}
-
-static void
-remove_contact(EBookView *book_view,
- GList *ids,
- EABModel *model)
-{
- /* XXX we should keep a hash around instead of this O(n*m) loop */
- int i = 0;
- GList *l;
-
- for (l = ids; l; l = l->next) {
- char *id = l->data;
- for ( i = 0; i < model->data_count; i++) {
- if ( !strcmp(e_contact_get_const (model->data[i], E_CONTACT_UID), id) ) {
- g_object_unref (model->data[i]);
- memmove(model->data + i, model->data + i + 1, (model->data_count - i - 1) * sizeof (EContact *));
- model->data_count--;
-
- g_signal_emit (model,
- eab_model_signals [CONTACT_REMOVED], 0,
- i);
-
- break;
- }
- }
- }
-
- update_folder_bar_message (model);
-}
-
-static void
-modify_contact(EBookView *book_view,
- const GList *contacts,
- EABModel *model)
-{
- for ( ; contacts; contacts = contacts->next) {
- int i;
- for ( i = 0; i < model->data_count; i++) {
- if ( !strcmp(e_contact_get_const(model->data[i], E_CONTACT_UID),
- e_contact_get_const(E_CONTACT(contacts->data), E_CONTACT_UID)) ) {
- g_object_unref (model->data[i]);
- model->data[i] = e_contact_duplicate(E_CONTACT(contacts->data));
- g_signal_emit (model,
- eab_model_signals [CONTACT_CHANGED], 0,
- i);
- break;
- }
- }
- }
-}
-
-static void
-status_message (EBookView *book_view,
- char* status,
- EABModel *model)
-{
- g_signal_emit (model,
- eab_model_signals [STATUS_MESSAGE], 0,
- status);
-}
-
-static void
-sequence_complete (EBookView *book_view,
- EBookViewStatus status,
- EABModel *model)
-{
- model->search_in_progress = FALSE;
- status_message (book_view, NULL, model);
- g_signal_emit (model,
- eab_model_signals [SEARCH_RESULT], 0,
- status);
- g_signal_emit (model,
- eab_model_signals [STOP_STATE_CHANGED], 0);
-}
-
-static void
-writable_status (EBook *book,
- gboolean writable,
- EABModel *model)
-{
- if (!model->editable_set) {
- model->editable = writable;
-
- g_signal_emit (model,
- eab_model_signals [WRITABLE_STATUS], 0,
- writable);
- }
-}
-
-static void
-backend_died (EBook *book,
- EABModel *model)
-{
- g_signal_emit (model,
- eab_model_signals [BACKEND_DIED], 0);
-}
-
-static void
-eab_model_class_init (GObjectClass *object_class)
-{
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- object_class->dispose = addressbook_dispose;
- object_class->set_property = eab_model_set_property;
- object_class->get_property = eab_model_get_property;
-
- g_object_class_install_property (object_class, PROP_BOOK,
- g_param_spec_object ("book",
- _("Book"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_BOOK,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_QUERY,
- g_param_spec_string ("query",
- _("Query"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_EDITABLE,
- g_param_spec_boolean ("editable",
- _("Editable"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- eab_model_signals [WRITABLE_STATUS] =
- g_signal_new ("writable_status",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EABModelClass, writable_status),
- NULL, NULL,
- eab_marshal_NONE__BOOL,
- G_TYPE_NONE,
- 1, G_TYPE_BOOLEAN);
-
- eab_model_signals [STATUS_MESSAGE] =
- g_signal_new ("status_message",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EABModelClass, status_message),
- NULL, NULL,
- eab_marshal_NONE__POINTER,
- G_TYPE_NONE,
- 1, G_TYPE_POINTER);
-
- eab_model_signals [SEARCH_STARTED] =
- g_signal_new ("search_started",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EABModelClass, search_started),
- NULL, NULL,
- eab_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-
- eab_model_signals [SEARCH_RESULT] =
- g_signal_new ("search_result",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EABModelClass, search_result),
- NULL, NULL,
- eab_marshal_NONE__INT,
- G_TYPE_NONE, 1, G_TYPE_INT);
-
- eab_model_signals [FOLDER_BAR_MESSAGE] =
- g_signal_new ("folder_bar_message",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EABModelClass, folder_bar_message),
- NULL, NULL,
- eab_marshal_NONE__POINTER,
- G_TYPE_NONE, 1, G_TYPE_POINTER);
-
- eab_model_signals [CONTACT_ADDED] =
- g_signal_new ("contact_added",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EABModelClass, contact_added),
- NULL, NULL,
- eab_marshal_NONE__INT_INT,
- G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT);
-
- eab_model_signals [CONTACT_REMOVED] =
- g_signal_new ("contact_removed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EABModelClass, contact_removed),
- NULL, NULL,
- eab_marshal_NONE__INT,
- G_TYPE_NONE, 1, G_TYPE_INT);
-
- eab_model_signals [CONTACT_CHANGED] =
- g_signal_new ("contact_changed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EABModelClass, contact_changed),
- NULL, NULL,
- eab_marshal_NONE__INT,
- G_TYPE_NONE, 1, G_TYPE_INT);
-
- eab_model_signals [MODEL_CHANGED] =
- g_signal_new ("model_changed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EABModelClass, model_changed),
- NULL, NULL,
- eab_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-
- eab_model_signals [STOP_STATE_CHANGED] =
- g_signal_new ("stop_state_changed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EABModelClass, stop_state_changed),
- NULL, NULL,
- eab_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-
- eab_model_signals [BACKEND_DIED] =
- g_signal_new ("backend_died",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EABModelClass, backend_died),
- NULL, NULL,
- eab_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-}
-
-static void
-eab_model_init (GObject *object)
-{
- EABModel *model = EAB_MODEL(object);
- model->book = NULL;
- model->query = e_book_query_any_field_contains ("");
- model->book_view = NULL;
- model->create_contact_id = 0;
- model->remove_contact_id = 0;
- model->modify_contact_id = 0;
- model->status_message_id = 0;
- model->writable_status_id = 0;
- model->backend_died_id = 0;
- model->sequence_complete_id = 0;
- model->data = NULL;
- model->data_count = 0;
- model->allocated_count = 0;
- model->search_in_progress = FALSE;
- model->editable = FALSE;
- model->editable_set = FALSE;
- model->first_get_view = TRUE;
-}
-
-static void
-book_view_loaded (EBook *book, EBookStatus status, EBookView *book_view, gpointer closure)
-{
- EABModel *model = closure;
-
- if (status != E_BOOK_ERROR_OK) {
- eab_error_dialog (_("Error getting book view"), status);
- return;
- }
-
- remove_book_view (model);
- free_data (model);
-
- model->book_view = book_view;
- if (model->book_view)
- g_object_ref (model->book_view);
- model->create_contact_id = g_signal_connect(model->book_view,
- "contacts_added",
- G_CALLBACK (create_contact),
- model);
- model->remove_contact_id = g_signal_connect(model->book_view,
- "contacts_removed",
- G_CALLBACK (remove_contact),
- model);
- model->modify_contact_id = g_signal_connect(model->book_view,
- "contacts_changed",
- G_CALLBACK(modify_contact),
- model);
- model->status_message_id = g_signal_connect(model->book_view,
- "status_message",
- G_CALLBACK(status_message),
- model);
- model->sequence_complete_id = g_signal_connect(model->book_view,
- "sequence_complete",
- G_CALLBACK(sequence_complete),
- model);
-
- model->search_in_progress = TRUE;
- g_signal_emit (model,
- eab_model_signals [MODEL_CHANGED], 0);
- g_signal_emit (model,
- eab_model_signals [SEARCH_STARTED], 0);
- g_signal_emit (model,
- eab_model_signals [STOP_STATE_CHANGED], 0);
-
- e_book_view_start (model->book_view);
-}
-
-static void
-get_view (EABModel *model)
-{
- gboolean success;
-
- if (model->book && model->query) {
- char *query_string = e_book_query_to_string (model->query);
-
- remove_book_view(model);
- free_data (model);
-
- if (model->first_get_view) {
- model->first_get_view = FALSE;
-
- if (e_book_check_static_capability (model->book, "do-initial-query")) {
- success = e_book_async_get_book_view (model->book, query_string, book_view_loaded, model);
- } else {
- g_signal_emit (model,
- eab_model_signals [MODEL_CHANGED], 0);
- g_signal_emit (model,
- eab_model_signals [STOP_STATE_CHANGED], 0);
- g_free (query_string);
- return;
- }
- }
- else
- success = e_book_async_get_book_view (model->book, query_string, book_view_loaded, model);
-
- g_free (query_string);
- }
-}
-
-EContact *
-eab_model_get_contact(EABModel *model,
- int row)
-{
- if (model->data && 0 <= row && row < model->data_count) {
- return e_contact_duplicate (model->data[row]);
- }
- return NULL;
-}
-
-static void
-eab_model_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
-{
- EABModel *model;
-
- model = EAB_MODEL (object);
-
- switch (prop_id){
- case PROP_BOOK:
- if (model->book) {
- if (model->writable_status_id)
- g_signal_handler_disconnect (model->book,
- model->writable_status_id);
- model->writable_status_id = 0;
-
- if (model->backend_died_id)
- g_signal_handler_disconnect (model->book,
- model->backend_died_id);
- model->backend_died_id = 0;
-
- g_object_unref (model->book);
- }
- model->book = E_BOOK(g_value_get_object (value));
- if (model->book) {
- if (!model->editable_set) {
- model->editable = e_book_is_writable (model->book);
-
- g_signal_emit (model,
- eab_model_signals [WRITABLE_STATUS], 0,
- model->editable);
- }
- model->first_get_view = TRUE;
- g_object_ref (model->book);
- get_view (model);
- g_signal_connect (model->book,
- "writable_status",
- G_CALLBACK (writable_status), model);
- g_signal_connect (model->book,
- "backend_died",
- G_CALLBACK (backend_died), model);
- }
- break;
- case PROP_QUERY:
- if (model->query)
- e_book_query_unref (model->query);
- model->query = e_book_query_from_string (g_value_get_string (value));
- get_view (model);
- break;
- case PROP_EDITABLE:
- model->editable = g_value_get_boolean (value);
- model->editable_set = TRUE;
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-eab_model_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
-{
- EABModel *eab_model;
-
- eab_model = EAB_MODEL (object);
-
- switch (prop_id) {
- case PROP_BOOK:
- g_value_set_object (value, eab_model->book);
- break;
- case PROP_QUERY: {
- char *query_string = e_book_query_to_string (eab_model->query);
- g_value_set_string (value, query_string);
- break;
- }
- case PROP_EDITABLE:
- g_value_set_boolean (value, eab_model->editable);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-GType
-eab_model_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (EABModelClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) eab_model_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EABModel),
- 0, /* n_preallocs */
- (GInstanceInitFunc) eab_model_init,
- };
-
- type = g_type_register_static (PARENT_TYPE, "EABModel", &info, 0);
- }
-
- return type;
-}
-
-EABModel*
-eab_model_new (void)
-{
- EABModel *et;
-
- et = g_object_new (EAB_TYPE_MODEL, NULL);
-
- return et;
-}
-
-void eab_model_stop (EABModel *model)
-{
- remove_book_view(model);
- g_signal_emit (model,
- eab_model_signals [STOP_STATE_CHANGED], 0);
- g_signal_emit (model,
- eab_model_signals [STATUS_MESSAGE], 0,
- "Search Interrupted.");
-}
-
-gboolean
-eab_model_can_stop (EABModel *model)
-{
- return model->search_in_progress;
-}
-
-void
-eab_model_force_folder_bar_message (EABModel *model)
-{
- update_folder_bar_message (model);
-}
-
-int
-eab_model_contact_count (EABModel *model)
-{
- return model->data_count;
-}
-
-const EContact *
-eab_model_contact_at (EABModel *model, int index)
-{
- return model->data[index];
-}
-
-gboolean
-eab_model_editable (EABModel *model)
-{
- return model->editable;
-}
-
-EBook *
-eab_model_get_ebook (EABModel *model)
-{
- return model->book;
-}
diff --git a/addressbook/gui/widgets/e-addressbook-model.h b/addressbook/gui/widgets/e-addressbook-model.h
deleted file mode 100644
index 64ce6c3845..0000000000
--- a/addressbook/gui/widgets/e-addressbook-model.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-#ifndef _EAB_MODEL_H_
-#define _EAB_MODEL_H_
-
-#include <glib.h>
-#include <glib-object.h>
-#include <libebook/e-book-async.h>
-#include <libebook/e-book-view.h>
-
-#define EAB_TYPE_MODEL (eab_model_get_type ())
-#define EAB_MODEL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EAB_TYPE_MODEL, EABModel))
-#define EAB_MODEL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), EAB_TYPE_MODEL, EABModelClass))
-#define E_IS_ADDRESSBOOK_MODEL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), EAB_TYPE_MODEL))
-#define E_IS_ADDRESSBOOK_MODEL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EAB_TYPE_MODEL))
-
-typedef struct _EABModel EABModel;
-typedef struct _EABModelClass EABModelClass;
-
-struct _EABModel {
- GObject parent;
-
- /* item specific fields */
- EBook *book;
- EBookQuery *query;
- EBookView *book_view;
-
- EContact **data;
- int data_count;
- int allocated_count;
-
- int create_contact_id, remove_contact_id, modify_contact_id;
- int status_message_id, writable_status_id, sequence_complete_id;
- int backend_died_id;
-
- guint search_in_progress : 1;
- guint editable : 1;
- guint editable_set : 1;
- guint first_get_view : 1;
-};
-
-
-struct _EABModelClass {
- GObjectClass parent_class;
-
- /*
- * Signals
- */
- void (*writable_status) (EABModel *model, gboolean writable);
- void (*search_started) (EABModel *model);
- void (*search_result) (EABModel *model, EBookViewStatus status);
- void (*status_message) (EABModel *model, const gchar *message);
- void (*folder_bar_message) (EABModel *model, const gchar *message);
- void (*contact_added) (EABModel *model, gint index, gint count);
- void (*contact_removed) (EABModel *model, gint index);
- void (*contact_changed) (EABModel *model, gint index);
- void (*model_changed) (EABModel *model);
- void (*stop_state_changed) (EABModel *model);
- void (*backend_died) (EABModel *model);
-};
-
-
-GType eab_model_get_type (void);
-EABModel *eab_model_new (void);
-
-/* Returns object with ref count of 1. */
-EContact *eab_model_get_contact (EABModel *model,
- int row);
-EBook *eab_model_get_ebook (EABModel *model);
-
-void eab_model_stop (EABModel *model);
-gboolean eab_model_can_stop (EABModel *model);
-
-void eab_model_force_folder_bar_message (EABModel *model);
-
-int eab_model_contact_count (EABModel *model);
-const EContact *eab_model_contact_at (EABModel *model,
- int index);
-gboolean eab_model_editable (EABModel *model);
-
-#endif /* _EAB_MODEL_H_ */
diff --git a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c b/addressbook/gui/widgets/e-addressbook-reflow-adapter.c
deleted file mode 100644
index cf1667fec5..0000000000
--- a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c
+++ /dev/null
@@ -1,517 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-
-#include <config.h>
-#include <string.h>
-
-#include <libgnome/gnome-i18n.h>
-#include "eab-marshal.h"
-#include "e-addressbook-reflow-adapter.h"
-#include "e-addressbook-model.h"
-#include "e-addressbook-view.h"
-#include "eab-gui-util.h"
-
-#include "e-minicard.h"
-#include <gal/widgets/e-popup-menu.h>
-#include <gal/widgets/e-gui-utils.h>
-#include "addressbook/printing/e-contact-print.h"
-#include "addressbook/printing/e-contact-print-envelope.h"
-
-
-struct _EAddressbookReflowAdapterPrivate {
- EABModel *model;
-
- gboolean loading;
-
- int create_contact_id, remove_contact_id, modify_contact_id, model_changed_id;
- int search_started_id, search_result_id;
-};
-
-#define PARENT_TYPE e_reflow_model_get_type()
-static EReflowModel *parent_class;
-
-#define d(x)
-
-enum {
- PROP_0,
- PROP_BOOK,
- PROP_QUERY,
- PROP_EDITABLE,
- PROP_MODEL,
-};
-
-enum {
- DRAG_BEGIN,
- LAST_SIGNAL
-};
-
-static guint e_addressbook_reflow_adapter_signals [LAST_SIGNAL] = {0, };
-
-static void
-unlink_model(EAddressbookReflowAdapter *adapter)
-{
- EAddressbookReflowAdapterPrivate *priv = adapter->priv;
-
- if (priv->model && priv->create_contact_id)
- g_signal_handler_disconnect (priv->model,
- priv->create_contact_id);
- if (priv->model && priv->remove_contact_id)
- g_signal_handler_disconnect (priv->model,
- priv->remove_contact_id);
- if (priv->model && priv->modify_contact_id)
- g_signal_handler_disconnect (priv->model,
- priv->modify_contact_id);
- if (priv->model && priv->model_changed_id)
- g_signal_handler_disconnect (priv->model,
- priv->model_changed_id);
- if (priv->model && priv->search_started_id)
- g_signal_handler_disconnect (priv->model,
- priv->search_started_id);
- if (priv->model && priv->search_result_id)
- g_signal_handler_disconnect (priv->model,
- priv->search_result_id);
-
- priv->create_contact_id = 0;
- priv->remove_contact_id = 0;
- priv->modify_contact_id = 0;
- priv->model_changed_id = 0;
- priv->search_started_id = 0;
- priv->search_result_id = 0;
-
- if (priv->model)
- g_object_unref (priv->model);
-
- priv->model = NULL;
-}
-
-
-static int
-text_height (PangoLayout *layout, const gchar *text)
-{
- int height;
-
- pango_layout_set_text (layout, text, -1);
-
- pango_layout_get_pixel_size (layout, NULL, &height);
-
- return height;
-}
-
-static void
-addressbook_dispose(GObject *object)
-{
- EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(object);
-
- unlink_model (adapter);
-}
-
-static void
-addressbook_set_width (EReflowModel *erm, int width)
-{
-}
-
-/* This function returns the number of items in our EReflowModel. */
-static int
-addressbook_count (EReflowModel *erm)
-{
- EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(erm);
- EAddressbookReflowAdapterPrivate *priv = adapter->priv;
-
- return eab_model_contact_count (priv->model);
-}
-
-/* This function returns the height of the minicontact in question */
-static int
-addressbook_height (EReflowModel *erm, int i, GnomeCanvasGroup *parent)
-{
- EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(erm);
- EAddressbookReflowAdapterPrivate *priv = adapter->priv;
- EContactField field;
- int count = 0;
- char *string;
- EContact *contact = (EContact*)eab_model_contact_at (priv->model, i);
- PangoLayout *layout = gtk_widget_create_pango_layout (GTK_WIDGET (GNOME_CANVAS_ITEM (parent)->canvas), "");
- int height;
-
- string = e_contact_get(contact, E_CONTACT_FILE_AS);
- height = text_height (layout, string ? string : "") + 10.0;
- g_free(string);
-
- for(field = E_CONTACT_FULL_NAME; field != E_CONTACT_LAST_SIMPLE_STRING && count < 5; field++) {
-
- if (field == E_CONTACT_FAMILY_NAME || field == E_CONTACT_GIVEN_NAME)
- continue;
-
- string = e_contact_get(contact, field);
- if (string && *string) {
- int this_height;
- int field_text_height;
-
- this_height = text_height (layout, e_contact_pretty_name(field));
-
- field_text_height = text_height (layout, string);
- if (this_height < field_text_height)
- this_height = field_text_height;
-
- this_height += 3;
-
- height += this_height;
- count ++;
- }
- g_free (string);
- }
- height += 2;
-
- g_object_unref (layout);
-
- return height;
-}
-
-static int
-addressbook_compare (EReflowModel *erm, int n1, int n2)
-{
- EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(erm);
- EAddressbookReflowAdapterPrivate *priv = adapter->priv;
- EContact *contact1, *contact2;
-
- if (priv->loading) {
- return n1-n2;
- }
- else {
- contact1 = (EContact*)eab_model_contact_at (priv->model, n1);
- contact2 = (EContact*)eab_model_contact_at (priv->model, n2);
-
- if (contact1 && contact2) {
- const char *file_as1, *file_as2;
- file_as1 = e_contact_get_const (contact1, E_CONTACT_FILE_AS);
- file_as2 = e_contact_get_const (contact2, E_CONTACT_FILE_AS);
- if (file_as1 && file_as2)
- return g_utf8_collate(file_as1, file_as2);
- if (file_as1)
- return -1;
- if (file_as2)
- return 1;
- return strcmp(e_contact_get_const (contact1, E_CONTACT_UID),
- e_contact_get_const (contact2, E_CONTACT_UID));
- }
- if (contact1)
- return -1;
- if (contact2)
- return 1;
- return 0;
- }
-}
-
-static int
-adapter_drag_begin (EMinicard *card, GdkEvent *event, EAddressbookReflowAdapter *adapter)
-{
- gint ret_val = 0;
-
- g_signal_emit (adapter,
- e_addressbook_reflow_adapter_signals[DRAG_BEGIN], 0,
- event, &ret_val);
-
- return ret_val;
-}
-
-static GnomeCanvasItem *
-addressbook_incarnate (EReflowModel *erm, int i, GnomeCanvasGroup *parent)
-{
- EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(erm);
- EAddressbookReflowAdapterPrivate *priv = adapter->priv;
- GnomeCanvasItem *item;
-
- item = gnome_canvas_item_new(parent,
- e_minicard_get_type(),
- "contact", eab_model_contact_at (priv->model, i),
- "editable", eab_model_editable (priv->model),
- NULL);
-
-#if 0
- g_signal_connect (item, "selected",
- G_CALLBACK(card_selected), 0, emvm);
-#endif
-
- g_signal_connect (item, "drag_begin",
- G_CALLBACK(adapter_drag_begin), adapter);
-
- return item;
-}
-
-static void
-addressbook_reincarnate (EReflowModel *erm, int i, GnomeCanvasItem *item)
-{
- EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(erm);
- EAddressbookReflowAdapterPrivate *priv = adapter->priv;
-
- gnome_canvas_item_set(item,
- "contact", eab_model_contact_at (priv->model, i),
- NULL);
-}
-
-static void
-create_contact (EABModel *model,
- gint index, gint count,
- EAddressbookReflowAdapter *adapter)
-{
- e_reflow_model_items_inserted (E_REFLOW_MODEL (adapter),
- index,
- count);
-}
-
-static void
-remove_contact (EABModel *model,
- gint index,
- EAddressbookReflowAdapter *adapter)
-{
- e_reflow_model_item_removed (E_REFLOW_MODEL (adapter), index);
-}
-
-static void
-modify_contact (EABModel *model,
- gint index,
- EAddressbookReflowAdapter *adapter)
-{
- e_reflow_model_item_changed (E_REFLOW_MODEL (adapter), index);
-}
-
-static void
-model_changed (EABModel *model,
- EAddressbookReflowAdapter *adapter)
-{
- e_reflow_model_changed (E_REFLOW_MODEL (adapter));
-}
-
-static void
-search_started (EABModel *model,
- EAddressbookReflowAdapter *adapter)
-{
- EAddressbookReflowAdapterPrivate *priv = adapter->priv;
-
- priv->loading = TRUE;
-}
-
-static void
-search_result (EABModel *model,
- EBookViewStatus status,
- EAddressbookReflowAdapter *adapter)
-{
- EAddressbookReflowAdapterPrivate *priv = adapter->priv;
-
- priv->loading = FALSE;
-
- e_reflow_model_comparison_changed (E_REFLOW_MODEL (adapter));
-}
-
-static void
-addressbook_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
-{
- EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(object);
- EAddressbookReflowAdapterPrivate *priv = adapter->priv;
-
- switch (prop_id) {
- case PROP_BOOK:
- g_object_set (priv->model,
- "book", g_value_get_object (value),
- NULL);
- break;
- case PROP_QUERY:
- g_object_set (priv->model,
- "query", g_value_get_string (value),
- NULL);
- break;
- case PROP_EDITABLE:
- g_object_set (priv->model,
- "editable", g_value_get_boolean (value),
- NULL);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-addressbook_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
-{
- EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(object);
- EAddressbookReflowAdapterPrivate *priv = adapter->priv;
-
- switch (prop_id) {
- case PROP_BOOK: {
- g_object_get_property (G_OBJECT (priv->model),
- "book", value);
- break;
- }
- case PROP_QUERY: {
- g_object_get_property (G_OBJECT (priv->model),
- "query", value);
- break;
- }
- case PROP_EDITABLE: {
- g_object_get_property (G_OBJECT (priv->model),
- "editable", value);
- break;
- }
- case PROP_MODEL:
- g_value_set_object (value, priv->model);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-e_addressbook_reflow_adapter_class_init (GObjectClass *object_class)
-{
- EReflowModelClass *model_class = (EReflowModelClass *) object_class;
-
- parent_class = g_type_class_peek_parent (object_class);
-
- object_class->set_property = addressbook_set_property;
- object_class->get_property = addressbook_get_property;
- object_class->dispose = addressbook_dispose;
-
- g_object_class_install_property (object_class, PROP_BOOK,
- g_param_spec_object ("book",
- _("Book"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_BOOK,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_QUERY,
- g_param_spec_string ("query",
- _("Query"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_EDITABLE,
- g_param_spec_boolean ("editable",
- _("Editable"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_MODEL,
- g_param_spec_object ("model",
- _("Model"),
- /*_( */"XXX blurb" /*)*/,
- EAB_TYPE_MODEL,
- G_PARAM_READABLE));
-
- e_addressbook_reflow_adapter_signals [DRAG_BEGIN] =
- g_signal_new ("drag_begin",
- G_OBJECT_CLASS_TYPE(object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EAddressbookReflowAdapterClass, drag_begin),
- NULL, NULL,
- eab_marshal_INT__POINTER,
- G_TYPE_INT, 1, G_TYPE_POINTER);
-
- model_class->set_width = addressbook_set_width;
- model_class->count = addressbook_count;
- model_class->height = addressbook_height;
- model_class->compare = addressbook_compare;
- model_class->incarnate = addressbook_incarnate;
- model_class->reincarnate = addressbook_reincarnate;
-}
-
-static void
-e_addressbook_reflow_adapter_init (GtkObject *object)
-{
- EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(object);
- EAddressbookReflowAdapterPrivate *priv;
-
- priv = adapter->priv = g_new0 (EAddressbookReflowAdapterPrivate, 1);
-
- priv->loading = FALSE;
- priv->create_contact_id = 0;
- priv->remove_contact_id = 0;
- priv->modify_contact_id = 0;
- priv->model_changed_id = 0;
- priv->search_started_id = 0;
- priv->search_result_id = 0;
-}
-
-GType
-e_addressbook_reflow_adapter_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (EAddressbookReflowAdapterClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_addressbook_reflow_adapter_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EAddressbookReflowAdapter),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_addressbook_reflow_adapter_init,
- };
-
- type = g_type_register_static (PARENT_TYPE, "EAddressbookReflowAdapter", &info, 0);
- }
-
- return type;
-}
-
-void
-e_addressbook_reflow_adapter_construct (EAddressbookReflowAdapter *adapter,
- EABModel *model)
-{
- EAddressbookReflowAdapterPrivate *priv = adapter->priv;
-
- priv->model = model;
- g_object_ref (priv->model);
-
- priv->create_contact_id = g_signal_connect(priv->model,
- "contact_added",
- G_CALLBACK(create_contact),
- adapter);
- priv->remove_contact_id = g_signal_connect(priv->model,
- "contact_removed",
- G_CALLBACK(remove_contact),
- adapter);
- priv->modify_contact_id = g_signal_connect(priv->model,
- "contact_changed",
- G_CALLBACK(modify_contact),
- adapter);
- priv->model_changed_id = g_signal_connect(priv->model,
- "model_changed",
- G_CALLBACK(model_changed),
- adapter);
- priv->search_started_id = g_signal_connect(priv->model,
- "search_started",
- G_CALLBACK(search_started),
- adapter);
- priv->search_result_id = g_signal_connect(priv->model,
- "search_result",
- G_CALLBACK(search_result),
- adapter);
-}
-
-EReflowModel *
-e_addressbook_reflow_adapter_new (EABModel *model)
-{
- EAddressbookReflowAdapter *et;
-
- et = g_object_new (E_TYPE_ADDRESSBOOK_REFLOW_ADAPTER, NULL);
-
- e_addressbook_reflow_adapter_construct (et, model);
-
- return E_REFLOW_MODEL(et);
-}
-
-
-EContact *
-e_addressbook_reflow_adapter_get_contact (EAddressbookReflowAdapter *adapter,
- int index)
-{
- EAddressbookReflowAdapterPrivate *priv = adapter->priv;
-
- return eab_model_get_contact (priv->model, index);
-}
diff --git a/addressbook/gui/widgets/e-addressbook-reflow-adapter.h b/addressbook/gui/widgets/e-addressbook-reflow-adapter.h
deleted file mode 100644
index 1321b27bb4..0000000000
--- a/addressbook/gui/widgets/e-addressbook-reflow-adapter.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-#ifndef _E_ADDRESSBOOK_REFLOW_ADAPTER_H_
-#define _E_ADDRESSBOOK_REFLOW_ADAPTER_H_
-
-#include <gal/widgets/e-reflow-model.h>
-#include <libebook/e-contact.h>
-#include "e-addressbook-model.h"
-
-#define E_TYPE_ADDRESSBOOK_REFLOW_ADAPTER (e_addressbook_reflow_adapter_get_type ())
-#define E_ADDRESSBOOK_REFLOW_ADAPTER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_ADDRESSBOOK_REFLOW_ADAPTER, EAddressbookReflowAdapter))
-#define E_ADDRESSBOOK_REFLOW_ADAPTER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TYPE_ADDRESSBOOK_REFLOW_ADAPTER, EAddressbookReflowAdapterClass))
-#define E_IS_ADDRESSBOOK_REFLOW_ADAPTER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_ADDRESSBOOK_REFLOW_ADAPTER))
-#define E_IS_ADDRESSBOOK_REFLOW_ADAPTER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_ADDRESSBOOK_REFLOW_ADAPTER))
-
-typedef struct _EAddressbookReflowAdapter EAddressbookReflowAdapter;
-typedef struct _EAddressbookReflowAdapterPrivate EAddressbookReflowAdapterPrivate;
-typedef struct _EAddressbookReflowAdapterClass EAddressbookReflowAdapterClass;
-
-struct _EAddressbookReflowAdapter {
- EReflowModel parent;
-
- EAddressbookReflowAdapterPrivate *priv;
-};
-
-
-struct _EAddressbookReflowAdapterClass {
- EReflowModelClass parent_class;
-
- /*
- * Signals
- */
- gint (* drag_begin) (EAddressbookReflowAdapter *adapter, GdkEvent *event);
-};
-
-
-GType e_addressbook_reflow_adapter_get_type (void);
-void e_addressbook_reflow_adapter_construct (EAddressbookReflowAdapter *adapter,
- EABModel *model);
-EReflowModel *e_addressbook_reflow_adapter_new (EABModel *model);
-
-/* Returns object with ref count of 1. */
-EContact *e_addressbook_reflow_adapter_get_contact (EAddressbookReflowAdapter *adapter,
- int index);
-#endif /* _E_ADDRESSBOOK_REFLOW_ADAPTER_H_ */
diff --git a/addressbook/gui/widgets/e-addressbook-table-adapter.c b/addressbook/gui/widgets/e-addressbook-table-adapter.c
deleted file mode 100644
index 9fa48084ed..0000000000
--- a/addressbook/gui/widgets/e-addressbook-table-adapter.c
+++ /dev/null
@@ -1,356 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-#include <config.h>
-#include "e-addressbook-model.h"
-#include "e-addressbook-table-adapter.h"
-#include "eab-contact-merging.h"
-#include "eab-gui-util.h"
-#include "util/eab-destination.h"
-#include <libxml/tree.h>
-#include <libxml/parser.h>
-#include <libxml/xmlmemory.h>
-#include <gnome.h>
-
-struct _EAddressbookTableAdapterPrivate {
- EABModel *model;
-
- int create_contact_id, remove_contact_id, modify_contact_id, model_changed_id;
-};
-
-#define PARENT_TYPE e_table_model_get_type()
-static ETableModelClass *parent_class;
-
-#define COLS (E_CONTACT_FIELD_LAST)
-
-static void
-unlink_model(EAddressbookTableAdapter *adapter)
-{
- EAddressbookTableAdapterPrivate *priv = adapter->priv;
-
- g_signal_handler_disconnect (priv->model,
- priv->create_contact_id);
- g_signal_handler_disconnect (priv->model,
- priv->remove_contact_id);
- g_signal_handler_disconnect (priv->model,
- priv->modify_contact_id);
- g_signal_handler_disconnect (priv->model,
- priv->model_changed_id);
-
- priv->create_contact_id = 0;
- priv->remove_contact_id = 0;
- priv->modify_contact_id = 0;
- priv->model_changed_id = 0;
-
- g_object_unref (priv->model);
-
- priv->model = NULL;
-}
-
-static void
-addressbook_dispose(GObject *object)
-{
- EAddressbookTableAdapter *adapter = EAB_TABLE_ADAPTER(object);
-
- if (adapter->priv) {
- unlink_model(adapter);
-
- g_free (adapter->priv);
- adapter->priv = NULL;
- }
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- (* G_OBJECT_CLASS (parent_class)->dispose) (object);
-}
-
-/* This function returns the number of columns in our ETableModel. */
-static int
-addressbook_col_count (ETableModel *etc)
-{
- return COLS;
-}
-
-/* This function returns the number of rows in our ETableModel. */
-static int
-addressbook_row_count (ETableModel *etc)
-{
- EAddressbookTableAdapter *adapter = EAB_TABLE_ADAPTER(etc);
- EAddressbookTableAdapterPrivate *priv = adapter->priv;
-
- return eab_model_contact_count (priv->model);
-}
-
-/* This function returns the value at a particular point in our ETableModel. */
-static void *
-addressbook_value_at (ETableModel *etc, int col, int row)
-{
- EAddressbookTableAdapter *adapter = EAB_TABLE_ADAPTER(etc);
- EAddressbookTableAdapterPrivate *priv = adapter->priv;
- const char *value;
-
- if ( col >= COLS || row >= eab_model_contact_count (priv->model) )
- return NULL;
-
- value = e_contact_get_const((EContact*)eab_model_contact_at (priv->model, row), col);
-
- if (value && !strncmp (value, "<?xml", 5)) {
- EABDestination *dest = eab_destination_import (value);
- if (dest) {
- /* XXX blech, we leak this */
- value = g_strdup (eab_destination_get_textrep (dest, TRUE));
- g_object_unref (dest);
- }
- }
-
-
- return (void *)(value ? value : "");
-}
-
-/* This function sets the value at a particular point in our ETableModel. */
-static void
-contact_modified_cb (EBook* book, EBookStatus status,
- gpointer user_data)
-{
- if (status != E_BOOK_ERROR_OK)
- eab_error_dialog (_("Error modifying card"), status);
-}
-
-static void
-addressbook_set_value_at (ETableModel *etc, int col, int row, const void *val)
-{
- EAddressbookTableAdapter *adapter = EAB_TABLE_ADAPTER(etc);
- EAddressbookTableAdapterPrivate *priv = adapter->priv;
-
- if (eab_model_editable (priv->model)) {
- EContact *contact;
-
- if (col >= COLS || row >= eab_model_contact_count (priv->model))
- return;
-
- contact = eab_model_get_contact (priv->model, row);
- if (!contact)
- return;
-
- e_table_model_pre_change(etc);
-
- e_contact_set(contact, col, (void *) val);
- eab_merging_book_commit_contact (eab_model_get_ebook (priv->model),
- contact, contact_modified_cb, NULL);
-
- g_object_unref (contact);
-
- /* XXX do we need this? shouldn't the commit_contact generate a changed signal? */
- e_table_model_cell_changed(etc, col, row);
- }
-}
-
-/* This function returns whether a particular cell is editable. */
-static gboolean
-addressbook_is_cell_editable (ETableModel *etc, int col, int row)
-{
- EAddressbookTableAdapter *adapter = EAB_TABLE_ADAPTER(etc);
- EAddressbookTableAdapterPrivate *priv = adapter->priv;
- const EContact *contact;
-
- if (row >= 0 && row < eab_model_contact_count (priv->model))
- contact = eab_model_contact_at (priv->model, row);
- else
- contact = NULL;
-
- if (!eab_model_editable(priv->model))
- return FALSE;
- else if (contact && e_contact_get ((EContact *) contact, E_CONTACT_IS_LIST))
- /* we only allow editing of the name and file as for
- lists */
- return col == E_CONTACT_FULL_NAME || col == E_CONTACT_FILE_AS;
- else
- return col < E_CONTACT_LAST_SIMPLE_STRING;
-
- return FALSE;
-}
-
-static void
-addressbook_append_row (ETableModel *etm, ETableModel *source, gint row)
-{
- EAddressbookTableAdapter *adapter = EAB_TABLE_ADAPTER(etm);
- EAddressbookTableAdapterPrivate *priv = adapter->priv;
- EContact *contact;
- int col;
-
- contact = e_contact_new ();
-
- for (col = 1; col < E_CONTACT_LAST_SIMPLE_STRING; col++) {
- const void *val = e_table_model_value_at (source, col, row);
- e_contact_set (contact, col, (void *) val);
- }
-
- eab_merging_book_add_contact (eab_model_get_ebook (priv->model), contact, NULL, NULL);
-
- g_object_unref (contact);
-}
-
-/* This function duplicates the value passed to it. */
-static void *
-addressbook_duplicate_value (ETableModel *etc, int col, const void *value)
-{
- return g_strdup(value);
-}
-
-/* This function frees the value passed to it. */
-static void
-addressbook_free_value (ETableModel *etc, int col, void *value)
-{
- g_free(value);
-}
-
-static void *
-addressbook_initialize_value (ETableModel *etc, int col)
-{
- return g_strdup("");
-}
-
-static gboolean
-addressbook_value_is_empty (ETableModel *etc, int col, const void *value)
-{
- return !(value && *(char *)value);
-}
-
-static char *
-addressbook_value_to_string (ETableModel *etc, int col, const void *value)
-{
- return g_strdup(value);
-}
-
-static void
-eab_table_adapter_class_init (GObjectClass *object_class)
-{
- ETableModelClass *model_class = (ETableModelClass *) object_class;
-
- parent_class = g_type_class_peek_parent (object_class);
-
- object_class->dispose = addressbook_dispose;
-
- model_class->column_count = addressbook_col_count;
- model_class->row_count = addressbook_row_count;
- model_class->value_at = addressbook_value_at;
- model_class->set_value_at = addressbook_set_value_at;
- model_class->is_cell_editable = addressbook_is_cell_editable;
- model_class->append_row = addressbook_append_row;
- model_class->duplicate_value = addressbook_duplicate_value;
- model_class->free_value = addressbook_free_value;
- model_class->initialize_value = addressbook_initialize_value;
- model_class->value_is_empty = addressbook_value_is_empty;
- model_class->value_to_string = addressbook_value_to_string;
-}
-
-static void
-eab_table_adapter_init (GObject *object)
-{
- EAddressbookTableAdapter *adapter = EAB_TABLE_ADAPTER(object);
- EAddressbookTableAdapterPrivate *priv;
-
- priv = adapter->priv = g_new0 (EAddressbookTableAdapterPrivate, 1);
-
- priv->create_contact_id = 0;
- priv->remove_contact_id = 0;
- priv->modify_contact_id = 0;
- priv->model_changed_id = 0;
-}
-
-
-static void
-create_contact (EABModel *model,
- gint index, gint count,
- EAddressbookTableAdapter *adapter)
-{
- e_table_model_pre_change (E_TABLE_MODEL (adapter));
- e_table_model_rows_inserted (E_TABLE_MODEL (adapter), index, count);
-}
-
-static void
-remove_contact (EABModel *model,
- gint index,
- EAddressbookTableAdapter *adapter)
-{
- e_table_model_pre_change (E_TABLE_MODEL (adapter));
- e_table_model_rows_deleted (E_TABLE_MODEL (adapter), index, 1);
-}
-
-static void
-modify_contact (EABModel *model,
- gint index,
- EAddressbookTableAdapter *adapter)
-{
- e_table_model_pre_change (E_TABLE_MODEL (adapter));
- e_table_model_row_changed (E_TABLE_MODEL (adapter), index);
-}
-
-static void
-model_changed (EABModel *model,
- EAddressbookTableAdapter *adapter)
-{
- e_table_model_pre_change (E_TABLE_MODEL (adapter));
- e_table_model_changed (E_TABLE_MODEL (adapter));
-}
-
-GType
-eab_table_adapter_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (EAddressbookTableAdapterClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) eab_table_adapter_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EAddressbookTableAdapter),
- 0, /* n_preallocs */
- (GInstanceInitFunc) eab_table_adapter_init,
- };
-
- type = g_type_register_static (PARENT_TYPE, "EAddressbookTableAdapter", &info, 0);
- }
-
- return type;
-}
-
-void
-eab_table_adapter_construct (EAddressbookTableAdapter *adapter,
- EABModel *model)
-{
- EAddressbookTableAdapterPrivate *priv = adapter->priv;
-
- priv->model = model;
- g_object_ref (priv->model);
-
- priv->create_contact_id = g_signal_connect(priv->model,
- "contact_added",
- G_CALLBACK(create_contact),
- adapter);
- priv->remove_contact_id = g_signal_connect(priv->model,
- "contact_removed",
- G_CALLBACK(remove_contact),
- adapter);
- priv->modify_contact_id = g_signal_connect(priv->model,
- "contact_changed",
- G_CALLBACK(modify_contact),
- adapter);
- priv->model_changed_id = g_signal_connect(priv->model,
- "model_changed",
- G_CALLBACK(model_changed),
- adapter);
-}
-
-ETableModel *
-eab_table_adapter_new (EABModel *model)
-{
- EAddressbookTableAdapter *et;
-
- et = g_object_new(E_TYPE_AB_TABLE_ADAPTER, NULL);
-
- eab_table_adapter_construct (et, model);
-
- return E_TABLE_MODEL(et);
-}
diff --git a/addressbook/gui/widgets/e-addressbook-table-adapter.h b/addressbook/gui/widgets/e-addressbook-table-adapter.h
deleted file mode 100644
index cf139e2bee..0000000000
--- a/addressbook/gui/widgets/e-addressbook-table-adapter.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-#ifndef _EAB_TABLE_ADAPTER_H_
-#define _EAB_TABLE_ADAPTER_H_
-
-#include <gal/e-table/e-table-model.h>
-#include <libebook/e-book.h>
-#include <libebook/e-book-view.h>
-
-#define E_TYPE_AB_TABLE_ADAPTER (eab_table_adapter_get_type ())
-#define EAB_TABLE_ADAPTER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_AB_TABLE_ADAPTER, EAddressbookTableAdapter))
-#define EAB_TABLE_ADAPTER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TYPE_AB_TABLE_ADAPTER, EAddressbookTableAdapterClass))
-#define E_IS_ADDRESSBOOK_TABLE_ADAPTER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_AB_TABLE_ADAPTER))
-#define E_IS_ADDRESSBOOK_TABLE_ADAPTER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_AB_TABLE_ADAPTER))
-
-typedef struct _EAddressbookTableAdapter EAddressbookTableAdapter;
-typedef struct _EAddressbookTableAdapterPrivate EAddressbookTableAdapterPrivate;
-typedef struct _EAddressbookTableAdapterClass EAddressbookTableAdapterClass;
-
-struct _EAddressbookTableAdapter {
- ETableModel parent;
-
- EAddressbookTableAdapterPrivate *priv;
-};
-
-
-struct _EAddressbookTableAdapterClass {
- ETableModelClass parent_class;
-};
-
-
-GType eab_table_adapter_get_type (void);
-void eab_table_adapter_construct (EAddressbookTableAdapter *adapter,
- EABModel *model);
-ETableModel *eab_table_adapter_new (EABModel *model);
-
-#endif /* _EAB_TABLE_ADAPTER_H_ */
diff --git a/addressbook/gui/widgets/e-addressbook-treeview-adapter.c b/addressbook/gui/widgets/e-addressbook-treeview-adapter.c
deleted file mode 100644
index 592f9d2b03..0000000000
--- a/addressbook/gui/widgets/e-addressbook-treeview-adapter.c
+++ /dev/null
@@ -1,630 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-#include <config.h>
-#include "e-addressbook-model.h"
-#include "e-addressbook-treeview-adapter.h"
-#include "e-card-merging.h"
-#include "eab-gui-util.h"
-#include <gtk/gtktreednd.h>
-#include <libxml/tree.h>
-#include <libxml/parser.h>
-#include <libxml/xmlmemory.h>
-
-struct _EAddressbookTreeViewAdapterPrivate {
- EAddressbookModel *model;
-
- gint stamp;
-
- ECardSimple **simples;
- int count;
-
- int create_card_id, remove_card_id, modify_card_id, model_changed_id;
-};
-
-#define PARENT_TYPE G_TYPE_OBJECT
-GObjectClass *parent_class;
-
-#define COLS (E_CARD_SIMPLE_FIELD_LAST)
-
-static void
-unlink_model(EAddressbookTreeViewAdapter *adapter)
-{
- EAddressbookTreeViewAdapterPrivate *priv = adapter->priv;
- int i;
-
- g_signal_handler_disconnect (priv->model,
- priv->create_card_id);
- g_signal_handler_disconnect (priv->model,
- priv->remove_card_id);
- g_signal_handler_disconnect (priv->model,
- priv->modify_card_id);
- g_signal_handler_disconnect (priv->model,
- priv->model_changed_id);
-
- priv->create_card_id = 0;
- priv->remove_card_id = 0;
- priv->modify_card_id = 0;
- priv->model_changed_id = 0;
-
- /* free up the existing mapping if there is one */
- if (priv->simples) {
- for (i = 0; i < priv->count; i ++)
- g_object_unref (priv->simples[i]);
- g_free (priv->simples);
- priv->simples = NULL;
- }
-
- g_object_unref (priv->model);
-
- priv->model = NULL;
-}
-
-static void
-build_simple_mapping(EAddressbookTreeViewAdapter *adapter)
-{
- EAddressbookTreeViewAdapterPrivate *priv = adapter->priv;
- int i;
-
- /* free up the existing mapping if there is one */
- if (priv->simples) {
- for (i = 0; i < priv->count; i ++)
- g_object_unref (priv->simples[i]);
- g_free (priv->simples);
- }
-
- /* build up our mapping to ECardSimple*'s */
- priv->count = e_addressbook_model_card_count (priv->model);
- priv->simples = g_new (ECardSimple*, priv->count);
- for (i = 0; i < priv->count; i ++) {
- priv->simples[i] = e_card_simple_new (e_addressbook_model_card_at (priv->model, i));
- g_object_ref (priv->simples[i]);
- }
-}
-
-static void
-addressbook_destroy(GtkObject *object)
-{
- EAddressbookTreeViewAdapter *adapter = E_ADDRESSBOOK_TREEVIEW_ADAPTER(object);
-
- unlink_model(adapter);
-
- g_free (adapter->priv);
- adapter->priv = NULL;
-
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
-}
-
-#if 0
-static void
-addressbook_set_value_at (ETableModel *etc, int col, int row, const void *val)
-{
- EAddressbookTreeViewAdapter *adapter = E_ADDRESSBOOK_TABLE_ADAPTER(etc);
- EAddressbookTableAdapterPrivate *priv = adapter->priv;
- if (e_addressbook_model_editable (priv->model)) {
- ECard *card;
-
- if ( col >= COLS|| row >= e_addressbook_model_card_count (priv->model) )
- return;
-
- e_table_model_pre_change(etc);
-
- e_card_simple_set(priv->simples[row],
- col,
- val);
- g_object_get(priv->simples[row],
- "card", &card,
- NULL);
-
- e_card_merging_book_commit_card(e_addressbook_model_get_ebook(priv->model),
- card, card_modified_cb, NULL);
-
- /* XXX do we need this? shouldn't the commit_card generate a changed signal? */
- e_table_model_cell_changed(etc, col, row);
- }
-}
-
-/* This function returns whether a particular cell is editable. */
-static gboolean
-addressbook_is_cell_editable (ETableModel *etc, int col, int row)
-{
- EAddressbookTableAdapter *adapter = E_ADDRESSBOOK_TABLE_ADAPTER(etc);
- EAddressbookTableAdapterPrivate *priv = adapter->priv;
- ECard *card;
-
- if (row >= 0 && row < e_addressbook_model_card_count (priv->model))
- card = e_addressbook_model_card_at (priv->model, row);
- else
- card = NULL;
-
- if (!e_addressbook_model_editable(priv->model))
- return FALSE;
- else if (card && e_card_evolution_list (card))
- /* we only allow editing of the name and file as for
- lists */
- return col == E_CARD_SIMPLE_FIELD_FULL_NAME || col == E_CARD_SIMPLE_FIELD_FILE_AS;
- else
- return col < E_CARD_SIMPLE_FIELD_LAST_SIMPLE_STRING;
-}
-
-static void
-addressbook_append_row (ETableModel *etm, ETableModel *source, gint row)
-{
- EAddressbookTableAdapter *adapter = E_ADDRESSBOOK_TABLE_ADAPTER(etm);
- EAddressbookTableAdapterPrivate *priv = adapter->priv;
- ECard *card;
- ECardSimple *simple;
- int col;
-
- card = e_card_new("");
- simple = e_card_simple_new(card);
-
- for (col = 0; col < E_CARD_SIMPLE_FIELD_LAST_SIMPLE_STRING; col++) {
- const void *val = e_table_model_value_at(source, col, row);
- e_card_simple_set(simple, col, val);
- }
- e_card_simple_sync_card(simple);
- e_card_merging_book_add_card (e_addressbook_model_get_ebook (priv->model), card, NULL, NULL);
- g_object_unref (simple);
- g_object_unref (card);
-}
-#endif
-
-static void
-e_addressbook_treeview_adapter_class_init (GtkObjectClass *object_class)
-{
- parent_class = g_type_class_peek_parent (object_class);
-
- object_class->destroy = addressbook_destroy;
-}
-
-static void
-e_addressbook_treeview_adapter_init (GtkObject *object)
-{
- EAddressbookTreeViewAdapter *adapter = E_ADDRESSBOOK_TREEVIEW_ADAPTER(object);
- EAddressbookTreeViewAdapterPrivate *priv;
-
- priv = adapter->priv = g_new0 (EAddressbookTreeViewAdapterPrivate, 1);
-
- priv->create_card_id = 0;
- priv->remove_card_id = 0;
- priv->modify_card_id = 0;
- priv->model_changed_id = 0;
- priv->simples = NULL;
- priv->count = 0;
-}
-
-static void
-get_iter (EAddressbookTreeViewAdapter *adapter, gint index, GtkTreeIter *iter)
-{
- EAddressbookTreeViewAdapterPrivate *priv = adapter->priv;
-
- iter->stamp = priv->stamp;
- iter->user_data = GINT_TO_POINTER (index);
-}
-
-static void
-create_card (EAddressbookModel *model,
- gint index, gint count,
- EAddressbookTreeViewAdapter *adapter)
-{
- EAddressbookTreeViewAdapterPrivate *priv = adapter->priv;
- int i;
-
- priv->count += count;
- priv->simples = g_renew(ECardSimple *, priv->simples, priv->count);
- memmove (priv->simples + index + count, priv->simples + index, (priv->count - index - count) * sizeof (ECardSimple *));
-
- for (i = 0; i < count; i ++) {
- GtkTreeIter iter;
- GtkTreePath *path;
-
- priv->simples[index + i] = e_card_simple_new (e_addressbook_model_card_at (priv->model, index + i));
-
- get_iter (adapter, index + i, &iter);
- path = gtk_tree_model_get_path (GTK_TREE_MODEL (adapter), &iter);
-
- gtk_tree_model_row_inserted (GTK_TREE_MODEL (adapter), path, &iter);
- gtk_tree_model_row_changed (GTK_TREE_MODEL (adapter), path, &iter);
-
- gtk_tree_path_free (path);
- }
-}
-
-static void
-remove_card (EAddressbookModel *model,
- gint index,
- EAddressbookTreeViewAdapter *adapter)
-{
- EAddressbookTreeViewAdapterPrivate *priv = adapter->priv;
- GtkTreeIter iter;
- GtkTreePath *path;
-
- g_object_unref (priv->simples[index]);
- memmove (priv->simples + index, priv->simples + index + 1, (priv->count - index - 1) * sizeof (ECardSimple *));
- priv->count --;
- get_iter (adapter, index, &iter);
- path = gtk_tree_model_get_path (GTK_TREE_MODEL (adapter), &iter);
-
- gtk_tree_model_row_deleted (GTK_TREE_MODEL (adapter), path);
-
- gtk_tree_path_free (path);
-}
-
-static void
-modify_card (EAddressbookModel *model,
- gint index,
- EAddressbookTreeViewAdapter *adapter)
-{
- EAddressbookTreeViewAdapterPrivate *priv = adapter->priv;
- GtkTreeIter iter;
- GtkTreePath *path;
-
- g_object_unref (priv->simples[index]);
- priv->simples[index] = e_card_simple_new (e_addressbook_model_card_at (priv->model, index));
-
- get_iter (adapter, index, &iter);
- path = gtk_tree_model_get_path (GTK_TREE_MODEL (adapter), &iter);
-
- gtk_tree_model_row_changed (GTK_TREE_MODEL (adapter), path, &iter);
-
- gtk_tree_path_free (path);
-}
-
-static void
-model_changed (EAddressbookModel *model,
- EAddressbookTreeViewAdapter *adapter)
-{
- int i;
-
- /* there has *got* to be an easier/faster way to do this... */
- for (i = 0; i < adapter->priv->count; i++) {
- remove_card (model, i, adapter);
- }
-
- build_simple_mapping (adapter);
-
- if (adapter->priv->count) {
- printf ("AIIEEEEEE\n");
- }
-
- /* XXX this isn't right either, we need to add the new cards */
-}
-
-static GtkTreeModelFlags
-adapter_get_flags (GtkTreeModel *tree_model)
-{
- g_return_val_if_fail (E_IS_ADDRESSBOOK_TREEVIEW_ADAPTER (tree_model), 0);
-
- return GTK_TREE_MODEL_LIST_ONLY;
-}
-
-static gint
-adapter_get_n_columns (GtkTreeModel *tree_model)
-{
- g_return_val_if_fail (E_IS_ADDRESSBOOK_TREEVIEW_ADAPTER (tree_model), 0);
-
- return COLS;
-}
-
-static GType
-adapter_get_column_type (GtkTreeModel *tree_model,
- gint index)
-{
- g_return_val_if_fail (E_IS_ADDRESSBOOK_TREEVIEW_ADAPTER (tree_model), G_TYPE_INVALID);
- g_return_val_if_fail (index < COLS && index >= 0, G_TYPE_INVALID);
-
- return G_TYPE_STRING;
-}
-
-static gboolean
-adapter_get_iter (GtkTreeModel *tree_model,
- GtkTreeIter *iter,
- GtkTreePath *path)
-{
- EAddressbookTreeViewAdapter *adapter;
- GSList *list;
- gint i;
-
- g_return_val_if_fail (E_IS_ADDRESSBOOK_TREEVIEW_ADAPTER (tree_model), FALSE);
- g_return_val_if_fail (gtk_tree_path_get_depth (path) > 0, FALSE);
-
- adapter = E_ADDRESSBOOK_TREEVIEW_ADAPTER (tree_model);
-
- i = gtk_tree_path_get_indices (path)[0];
-
- if (i >= adapter->priv->count)
- return FALSE;
-
- iter->stamp = adapter->priv->stamp;
- iter->user_data = GINT_TO_POINTER (i);
-
- return TRUE;
-}
-
-static GtkTreePath *
-adapter_get_path (GtkTreeModel *tree_model,
- GtkTreeIter *iter)
-{
- EAddressbookTreeViewAdapter *adapter = E_ADDRESSBOOK_TREEVIEW_ADAPTER (tree_model);
- GtkTreePath *retval;
-
- g_return_val_if_fail (E_IS_ADDRESSBOOK_TREEVIEW_ADAPTER (tree_model), NULL);
- g_return_val_if_fail (iter->stamp == adapter->priv->stamp, NULL);
-
-
- if (GPOINTER_TO_INT (iter->user_data) >= adapter->priv->count)
- return NULL;
-
- retval = gtk_tree_path_new ();
- gtk_tree_path_append_index (retval, GPOINTER_TO_INT (iter->user_data));
- return retval;
-}
-
-static void
-adapter_get_value (GtkTreeModel *tree_model,
- GtkTreeIter *iter,
- gint column,
- GValue *value)
-{
- EAddressbookTreeViewAdapter *adapter = E_ADDRESSBOOK_TREEVIEW_ADAPTER (tree_model);
- ECardSimple *simple;
- gint tmp_column = column;
- const char *v;
-
- g_return_if_fail (E_IS_ADDRESSBOOK_TREEVIEW_ADAPTER (tree_model));
- g_return_if_fail (column < COLS);
- g_return_if_fail (adapter->priv->stamp == iter->stamp);
-
- simple = adapter->priv->simples [ GPOINTER_TO_INT (iter->user_data) ];
-
- v = e_card_simple_get_const(simple, column);
-
- if (v && !strncmp (v, "<?xml", 5)) {
- EABDestination *dest = eab_destination_import (v);
- if (dest) {
- /* XXX blech, we leak this */
- v = g_strdup (eab_destination_get_textrep (dest, TRUE));
- g_object_unref (dest);
- }
- }
-
- g_value_init (value, G_TYPE_STRING);
- g_value_set_string (value, (v ? v : ""));
-}
-
-static gboolean
-adapter_iter_next (GtkTreeModel *tree_model,
- GtkTreeIter *iter)
-{
- EAddressbookTreeViewAdapter *adapter;
-
- g_return_val_if_fail (E_IS_ADDRESSBOOK_TREEVIEW_ADAPTER (tree_model), FALSE);
- g_return_val_if_fail (E_ADDRESSBOOK_TREEVIEW_ADAPTER (tree_model)->priv->stamp == iter->stamp, FALSE);
-
- adapter = E_ADDRESSBOOK_TREEVIEW_ADAPTER (tree_model);
-
- iter->user_data = GINT_TO_POINTER (GPOINTER_TO_INT (iter->user_data) + 1);
-
- return (GPOINTER_TO_INT (iter->user_data) < adapter->priv->count);
-}
-
-static gboolean
-adapter_iter_children (GtkTreeModel *tree_model,
- GtkTreeIter *iter,
- GtkTreeIter *parent)
-{
- EAddressbookTreeViewAdapter *adapter = E_ADDRESSBOOK_TREEVIEW_ADAPTER (tree_model);
-
- /* this is a list, nodes have no children */
- if (parent)
- return FALSE;
-
- /* but if parent == NULL we return the list itself as children of the
- * "root"
- */
- if (adapter->priv->count) {
- iter->stamp = adapter->priv->stamp;
- iter->user_data = GINT_TO_POINTER (0);
- return TRUE;
- }
- else
- return FALSE;
-}
-
-static gboolean
-adapter_iter_has_child (GtkTreeModel *tree_model,
- GtkTreeIter *iter)
-{
- return FALSE;
-}
-
-static gint
-adapter_iter_n_children (GtkTreeModel *tree_model,
- GtkTreeIter *iter)
-{
- EAddressbookTreeViewAdapter *adapter = E_ADDRESSBOOK_TREEVIEW_ADAPTER (tree_model);
-
- g_return_val_if_fail (E_IS_ADDRESSBOOK_TREEVIEW_ADAPTER (tree_model), -1);
- if (iter == NULL)
- return adapter->priv->count;
-
- g_return_val_if_fail (adapter->priv->stamp == iter->stamp, -1);
- return 0;
-}
-
-static gboolean
-adapter_iter_nth_child (GtkTreeModel *tree_model,
- GtkTreeIter *iter,
- GtkTreeIter *parent,
- gint n)
-{
- EAddressbookTreeViewAdapter *adapter = E_ADDRESSBOOK_TREEVIEW_ADAPTER (tree_model);
-
- g_return_val_if_fail (E_IS_ADDRESSBOOK_TREEVIEW_ADAPTER (tree_model), FALSE);
-
- if (parent)
- return FALSE;
-
- if (n < adapter->priv->count) {
- iter->stamp = adapter->priv->stamp;
- iter->user_data = GINT_TO_POINTER (n);
- return TRUE;
- }
- else
- return FALSE;
-}
-
-static gboolean
-adapter_iter_parent (GtkTreeModel *tree_model,
- GtkTreeIter *iter,
- GtkTreeIter *child)
-{
- return FALSE;
-}
-
-static void
-adapter_tree_model_init (GtkTreeModelIface *iface)
-{
- iface->get_flags = adapter_get_flags;
- iface->get_n_columns = adapter_get_n_columns;
- iface->get_column_type = adapter_get_column_type;
- iface->get_iter = adapter_get_iter;
- iface->get_path = adapter_get_path;
- iface->get_value = adapter_get_value;
- iface->iter_next = adapter_iter_next;
- iface->iter_children = adapter_iter_children;
- iface->iter_has_child = adapter_iter_has_child;
- iface->iter_n_children = adapter_iter_n_children;
- iface->iter_nth_child = adapter_iter_nth_child;
- iface->iter_parent = adapter_iter_parent;
-}
-
-static gboolean
-adapter_drag_data_delete (GtkTreeDragSource *drag_source,
- GtkTreePath *path)
-{
- g_return_val_if_fail (E_IS_ADDRESSBOOK_TREEVIEW_ADAPTER (drag_source), FALSE);
-
- return FALSE;
-}
-
-static gboolean
-adapter_drag_data_get (GtkTreeDragSource *drag_source,
- GtkTreePath *path,
- GtkSelectionData *selection_data)
-{
- g_return_val_if_fail (E_IS_ADDRESSBOOK_TREEVIEW_ADAPTER (drag_source), FALSE);
-
- /* Note that we don't need to handle the GTK_TREE_MODEL_ROW
- * target, because the default handler does it for us, but
- * we do anyway for the convenience of someone maybe overriding the
- * default handler.
- */
-
- if (gtk_tree_set_row_drag_data (selection_data,
- GTK_TREE_MODEL (drag_source),
- path)) {
- return TRUE;
- }
- else {
- if (selection_data->target == gdk_atom_intern ("text/x-vcard", FALSE)) {
- printf ("HI THERE\n");
- }
- }
-
- return FALSE;
-}
-
-static void
-adapter_drag_source_init (GtkTreeDragSourceIface *iface)
-{
- iface->drag_data_delete = adapter_drag_data_delete;
- iface->drag_data_get = adapter_drag_data_get;
-}
-
-GType
-e_addressbook_treeview_adapter_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo adapter_info = {
- sizeof (EAddressbookTreeViewAdapterClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_addressbook_treeview_adapter_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EAddressbookTreeViewAdapter),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_addressbook_treeview_adapter_init,
- };
-
- static const GInterfaceInfo tree_model_info = {
- (GInterfaceInitFunc) adapter_tree_model_init,
- NULL,
- NULL
- };
-
- static const GInterfaceInfo drag_source_info = {
- (GInterfaceInitFunc) adapter_drag_source_init,
- NULL,
- NULL
- };
-
- type = g_type_register_static (PARENT_TYPE, "EAddressbookTreeViewAdapter", &adapter_info, 0);
-
- g_type_add_interface_static (type,
- GTK_TYPE_TREE_MODEL,
- &tree_model_info);
-
- g_type_add_interface_static (type,
- GTK_TYPE_TREE_DRAG_SOURCE,
- &drag_source_info);
- }
-
- return type;
-}
-
-void
-e_addressbook_treeview_adapter_construct (EAddressbookTreeViewAdapter *adapter,
- EAddressbookModel *model)
-{
- EAddressbookTreeViewAdapterPrivate *priv = adapter->priv;
-
- priv->model = model;
- g_object_ref (priv->model);
-
- priv->stamp = g_random_int ();
-
- priv->create_card_id = g_signal_connect(priv->model,
- "card_added",
- G_CALLBACK(create_card),
- adapter);
- priv->remove_card_id = g_signal_connect(priv->model,
- "card_removed",
- G_CALLBACK(remove_card),
- adapter);
- priv->modify_card_id = g_signal_connect(priv->model,
- "card_changed",
- G_CALLBACK(modify_card),
- adapter);
- priv->model_changed_id = g_signal_connect(priv->model,
- "model_changed",
- G_CALLBACK(model_changed),
- adapter);
-
- build_simple_mapping (adapter);
-}
-
-GtkTreeModel *
-e_addressbook_treeview_adapter_new (EAddressbookModel *model)
-{
- EAddressbookTreeViewAdapter *et;
-
- et = g_object_new(E_TYPE_ADDRESSBOOK_TREEVIEW_ADAPTER, NULL);
-
- e_addressbook_treeview_adapter_construct (et, model);
-
- return (GtkTreeModel*)et;
-}
diff --git a/addressbook/gui/widgets/e-addressbook-treeview-adapter.h b/addressbook/gui/widgets/e-addressbook-treeview-adapter.h
deleted file mode 100644
index 2c4370dee3..0000000000
--- a/addressbook/gui/widgets/e-addressbook-treeview-adapter.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-#ifndef _E_ADDRESSBOOK_TREEVIEW_ADAPTER_H_
-#define _E_ADDRESSBOOK_TREEVIEW_ADAPTER_H_
-
-#include <gtk/gtktreemodel.h>
-#include "addressbook/backend/ebook/e-book.h"
-#include "addressbook/backend/ebook/e-book-view.h"
-#include "addressbook/backend/ebook/e-card-simple.h"
-
-#define E_TYPE_ADDRESSBOOK_TREEVIEW_ADAPTER (e_addressbook_treeview_adapter_get_type ())
-#define E_ADDRESSBOOK_TREEVIEW_ADAPTER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_ADDRESSBOOK_TREEVIEW_ADAPTER, EAddressbookTreeViewAdapter))
-#define E_ADDRESSBOOK_TREEVIEW_ADAPTER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TYPE_ADDRESSBOOK_TREEVIEW_ADAPTER, EAddressbookTreeViewAdapterClass))
-#define E_IS_ADDRESSBOOK_TREEVIEW_ADAPTER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_ADDRESSBOOK_TREEVIEW_ADAPTER))
-#define E_IS_ADDRESSBOOK_TREEVIEW_ADAPTER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_ADDRESSBOOK_TREEVIEW_ADAPTER))
-
-/* Virtual Column list:
- 0 Email
- 1 Full Name
- 2 Street
- 3 Phone
-*/
-
-typedef struct _EAddressbookTreeViewAdapter EAddressbookTreeViewAdapter;
-typedef struct _EAddressbookTreeViewAdapterPrivate EAddressbookTreeViewAdapterPrivate;
-typedef struct _EAddressbookTreeViewAdapterClass EAddressbookTreeViewAdapterClass;
-
-struct _EAddressbookTreeViewAdapter {
- GObject parent;
-
- EAddressbookTreeViewAdapterPrivate *priv;
-};
-
-
-struct _EAddressbookTreeViewAdapterClass {
- GObjectClass parent_class;
-};
-
-
-GType e_addressbook_treeview_adapter_get_type (void);
-void e_addressbook_treeview_adapter_construct (EAddressbookTreeViewAdapter *adapter,
- EAddressbookModel *model);
-GtkTreeModel *e_addressbook_treeview_adapter_new (EAddressbookModel *model);
-
-#endif /* _E_ADDRESSBOOK_TABLE_ADAPTER_H_ */
diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c
deleted file mode 100644
index 5303b279be..0000000000
--- a/addressbook/gui/widgets/e-addressbook-view.c
+++ /dev/null
@@ -1,1855 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-field-chooser.c
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-
-#include <gtk/gtk.h>
-
-#include <libgnome/gnome-i18n.h>
-#include <libgnome/gnome-util.h>
-#include <gtk/gtkscrolledwindow.h>
-#include <gal/e-table/e-table-scrolled.h>
-#include <gal/e-table/e-table-model.h>
-#include <gal/widgets/e-popup-menu.h>
-#include <gal/widgets/e-gui-utils.h>
-#include <gal/menus/gal-view-factory-etable.h>
-#include <gal/menus/gal-view-etable.h>
-#include <gal/util/e-xml-utils.h>
-#include <libgnomeui/gnome-dialog-util.h>
-
-#include <libgnomeprint/gnome-print.h>
-#include <libgnomeprint/gnome-print-job.h>
-#include <libgnomeprintui/gnome-print-dialog.h>
-#include <libgnomeprintui/gnome-print-job-preview.h>
-
-#include "addressbook/printing/e-contact-print.h"
-#include "addressbook/printing/e-contact-print-envelope.h"
-
-#ifdef WITH_ADDRESSBOOK_VIEW_TREEVIEW
-#include <gal/widgets/e-treeview-selection-model.h>
-#include "gal-view-factory-treeview.h"
-#include "gal-view-treeview.h"
-#endif
-#include "gal-view-minicard.h"
-#include "gal-view-factory-minicard.h"
-
-#include "eab-marshal.h"
-#include "e-addressbook-view.h"
-#include "e-addressbook-model.h"
-#include "eab-gui-util.h"
-#include "util/eab-book-util.h"
-#include "e-addressbook-table-adapter.h"
-#ifdef WITH_ADDRESSBOOK_VIEW_TREEVIEW
-#include "e-addressbook-treeview-adapter.h"
-#endif
-#include "eab-contact-merging.h"
-
-#include "e-contact-editor.h"
-#include <gdk/gdkkeysyms.h>
-#include <ctype.h>
-#include <string.h>
-
-#include <libxml/tree.h>
-#include <libxml/parser.h>
-
-#define SHOW_ALL_SEARCH "(contains \"x-evolution-any-field\" \"\")"
-
-#define d(x)
-
-static void eab_view_init (EABView *card);
-static void eab_view_class_init (EABViewClass *klass);
-
-static void eab_view_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static void eab_view_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
-
-static void eab_view_dispose (GObject *object);
-static void change_view_type (EABView *view, EABViewType view_type);
-
-static void status_message (GtkObject *object, const gchar *status, EABView *eav);
-static void search_result (GtkObject *object, EBookViewStatus status, EABView *eav);
-static void folder_bar_message (GtkObject *object, const gchar *status, EABView *eav);
-static void stop_state_changed (GtkObject *object, EABView *eav);
-static void writable_status (GtkObject *object, gboolean writable, EABView *eav);
-static void backend_died (GtkObject *object, EABView *eav);
-static void command_state_change (EABView *eav);
-
-static void selection_clear_event (GtkWidget *invisible, GdkEventSelection *event,
- EABView *view);
-static void selection_received (GtkWidget *invisible, GtkSelectionData *selection_data,
- guint time, EABView *view);
-static void selection_get (GtkWidget *invisible, GtkSelectionData *selection_data,
- guint info, guint time_stamp, EABView *view);
-static void invisible_destroyed (gpointer data, GObject *where_object_was);
-
-#define PARENT_TYPE GTK_TYPE_EVENT_BOX
-static GtkEventBoxClass *parent_class = NULL;
-
-/* The arguments we take */
-enum {
- PROP_0,
- PROP_BOOK,
- PROP_QUERY,
- PROP_TYPE,
-};
-
-enum {
- STATUS_MESSAGE,
- SEARCH_RESULT,
- FOLDER_BAR_MESSAGE,
- COMMAND_STATE_CHANGE,
- LAST_SIGNAL
-};
-
-enum DndTargetType {
- DND_TARGET_TYPE_VCARD,
-};
-#define VCARD_TYPE "text/x-vcard"
-static GtkTargetEntry drag_types[] = {
- { VCARD_TYPE, 0, DND_TARGET_TYPE_VCARD },
-};
-static const int num_drag_types = sizeof (drag_types) / sizeof (drag_types[0]);
-
-static guint eab_view_signals [LAST_SIGNAL] = {0, };
-
-static GdkAtom clipboard_atom = GDK_NONE;
-
-static GalViewCollection *collection = NULL;
-
-GType
-eab_view_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (EABViewClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) eab_view_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EABView),
- 0, /* n_preallocs */
- (GInstanceInitFunc) eab_view_init,
- };
-
- type = g_type_register_static (PARENT_TYPE, "EABView", &info, 0);
- }
-
- return type;
-}
-
-static void
-eab_view_class_init (EABViewClass *klass)
-{
- GObjectClass *object_class;
- GtkWidgetClass *widget_class;
-
- object_class = G_OBJECT_CLASS(klass);
- widget_class = GTK_WIDGET_CLASS(klass);
-
- parent_class = gtk_type_class (PARENT_TYPE);
-
- object_class->set_property = eab_view_set_property;
- object_class->get_property = eab_view_get_property;
- object_class->dispose = eab_view_dispose;
-
- g_object_class_install_property (object_class, PROP_BOOK,
- g_param_spec_object ("book",
- _("Book"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_BOOK,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_QUERY,
- g_param_spec_string ("query",
- _("Query"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_TYPE,
- g_param_spec_int ("type",
- _("Type"),
- /*_( */"XXX blurb" /*)*/,
- EAB_VIEW_NONE,
- EAB_VIEW_TABLE,
- EAB_VIEW_NONE,
- G_PARAM_READWRITE));
-
- eab_view_signals [STATUS_MESSAGE] =
- g_signal_new ("status_message",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EABViewClass, status_message),
- NULL, NULL,
- eab_marshal_NONE__POINTER,
- G_TYPE_NONE, 1, G_TYPE_POINTER);
-
- eab_view_signals [SEARCH_RESULT] =
- g_signal_new ("search_result",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EABViewClass, search_result),
- NULL, NULL,
- eab_marshal_NONE__INT,
- G_TYPE_NONE, 1, G_TYPE_INT);
-
- eab_view_signals [FOLDER_BAR_MESSAGE] =
- g_signal_new ("folder_bar_message",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EABViewClass, folder_bar_message),
- NULL, NULL,
- eab_marshal_NONE__POINTER,
- G_TYPE_NONE, 1, G_TYPE_POINTER);
-
- eab_view_signals [COMMAND_STATE_CHANGE] =
- g_signal_new ("command_state_change",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EABViewClass, command_state_change),
- NULL, NULL,
- eab_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-
- if (!clipboard_atom)
- clipboard_atom = gdk_atom_intern ("CLIPBOARD", FALSE);
-}
-
-static void
-eab_view_init (EABView *eav)
-{
- eav->view_type = EAB_VIEW_NONE;
-
- eav->model = NULL;
- eav->object = NULL;
- eav->widget = NULL;
- eav->scrolled = NULL;
- eav->contact_display = NULL;
-
- eav->view_instance = NULL;
- eav->view_menus = NULL;
- eav->current_view = NULL;
- eav->uic = NULL;
-
- eav->book = NULL;
- eav->query = NULL;
-
- eav->invisible = NULL;
- eav->clipboard_contacts = NULL;
-}
-
-static void
-eab_view_dispose (GObject *object)
-{
- EABView *eav = EAB_VIEW(object);
-
- if (eav->model) {
- g_signal_handlers_disconnect_matched (eav->model,
- G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL,
- object);
- g_object_unref (eav->model);
- eav->model = NULL;
- }
-
- if (eav->book) {
- g_object_unref (eav->book);
- eav->book = NULL;
- }
-
- if (eav->query) {
- g_free(eav->query);
- eav->query = NULL;
- }
-
- eav->uic = NULL;
-
- if (eav->view_instance) {
- g_object_unref (eav->view_instance);
- eav->view_instance = NULL;
- }
-
- if (eav->view_menus) {
- g_object_unref (eav->view_menus);
- eav->view_menus = NULL;
- }
-
- if (eav->clipboard_contacts) {
- g_list_foreach (eav->clipboard_contacts, (GFunc)g_object_unref, NULL);
- g_list_free (eav->clipboard_contacts);
- eav->clipboard_contacts = NULL;
- }
-
- if (eav->invisible) {
- gtk_widget_destroy (eav->invisible);
- eav->invisible = NULL;
- }
-
- if (G_OBJECT_CLASS(parent_class)->dispose)
- G_OBJECT_CLASS(parent_class)->dispose(object);
-}
-
-GtkWidget*
-eab_view_new (void)
-{
- GtkWidget *widget = GTK_WIDGET (g_object_new (E_TYPE_AB_VIEW, NULL));
- EABView *eav = EAB_VIEW (widget);
-
- /* create our model */
- eav->model = eab_model_new ();
-
- g_signal_connect (eav->model, "status_message",
- G_CALLBACK (status_message), eav);
- g_signal_connect (eav->model, "search_result",
- G_CALLBACK (search_result), eav);
- g_signal_connect (eav->model, "folder_bar_message",
- G_CALLBACK (folder_bar_message), eav);
- g_signal_connect (eav->model, "stop_state_changed",
- G_CALLBACK (stop_state_changed), eav);
- g_signal_connect (eav->model, "writable_status",
- G_CALLBACK (writable_status), eav);
- g_signal_connect (eav->model, "backend_died",
- G_CALLBACK (backend_died), eav);
-
- eav->editable = FALSE;
- eav->query = g_strdup (SHOW_ALL_SEARCH);
-
- /* create the paned window and contact display */
- eav->paned = gtk_vpaned_new ();
- gtk_container_add (GTK_CONTAINER (eav), eav->paned);
-
- eav->widget = gtk_label_new ("empty label here");
- gtk_container_add (GTK_CONTAINER (eav->paned), eav->widget);
- gtk_widget_show (eav->widget);
-
- eav->scrolled = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (eav->scrolled), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (eav->scrolled), GTK_SHADOW_IN);
- eav->contact_display = eab_contact_display_new ();
-
- gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (eav->scrolled), eav->contact_display);
- gtk_widget_show (eav->contact_display);
-
- gtk_container_add (GTK_CONTAINER (eav->paned), eav->scrolled);
- gtk_widget_show (eav->scrolled);
- gtk_widget_show (eav->paned);
-
- /* XXX hack */
- gtk_paned_set_position (GTK_PANED (eav->paned), 144);
-
- /* gtk selection crap */
- eav->invisible = gtk_invisible_new ();
-
- gtk_selection_add_target (eav->invisible,
- clipboard_atom,
- GDK_SELECTION_TYPE_STRING,
- 0);
-
- g_signal_connect (eav->invisible, "selection_get",
- G_CALLBACK (selection_get),
- eav);
- g_signal_connect (eav->invisible, "selection_clear_event",
- G_CALLBACK (selection_clear_event),
- eav);
- g_signal_connect (eav->invisible, "selection_received",
- G_CALLBACK (selection_received),
- eav);
- g_object_weak_ref (G_OBJECT (eav->invisible), invisible_destroyed, eav);
-
- return widget;
-}
-
-static void
-writable_status (GtkObject *object, gboolean writable, EABView *eav)
-{
- eav->editable = writable;
- command_state_change (eav);
-}
-
-static void
-init_collection (void)
-{
- GalViewFactory *factory;
- ETableSpecification *spec;
- char *galview;
-
- if (collection == NULL) {
- collection = gal_view_collection_new();
-
- gal_view_collection_set_title (collection, _("Addressbook"));
-
- galview = gnome_util_prepend_user_home("/evolution/views/addressbook/");
- gal_view_collection_set_storage_directories
- (collection,
- EVOLUTION_GALVIEWSDIR "/addressbook/",
- galview);
- g_free(galview);
-
- spec = e_table_specification_new();
- e_table_specification_load_from_file (spec, EVOLUTION_ETSPECDIR "/e-addressbook-view.etspec");
-
- factory = gal_view_factory_etable_new (spec);
- g_object_unref (spec);
- gal_view_collection_add_factory (collection, factory);
- g_object_unref (factory);
-
- factory = gal_view_factory_minicard_new();
- gal_view_collection_add_factory (collection, factory);
- g_object_unref (factory);
-
-#ifdef WITH_ADDRESSBOOK_VIEW_TREEVIEW
- factory = gal_view_factory_treeview_new ();
- gal_view_collection_add_factory (collection, factory);
- g_object_unref (factory);
-#endif
-
- gal_view_collection_load(collection);
- }
-}
-
-static void
-display_view(GalViewInstance *instance,
- GalView *view,
- gpointer data)
-{
- EABView *address_view = data;
- if (GAL_IS_VIEW_ETABLE(view)) {
- change_view_type (address_view, EAB_VIEW_TABLE);
- gal_view_etable_attach_table (GAL_VIEW_ETABLE(view), e_table_scrolled_get_table(E_TABLE_SCROLLED(address_view->widget)));
- }
- else if (GAL_IS_VIEW_MINICARD(view)) {
- change_view_type (address_view, EAB_VIEW_MINICARD);
- gal_view_minicard_attach (GAL_VIEW_MINICARD (view), E_MINICARD_VIEW_WIDGET (address_view->object));
- }
-#ifdef WITH_ADDRESSBOOK_VIEW_TREEVIEW
- else if (GAL_IS_VIEW_TREEVIEW (view)) {
- change_view_type (address_view, EAB_VIEW_TREEVIEW);
- gal_view_treeview_attach (GAL_VIEW_TREEVIEW(view), GTK_TREE_VIEW (address_view->object));
- }
-#endif
- address_view->current_view = view;
-}
-
-static void
-setup_menus (EABView *view)
-{
- if (view->book && view->view_instance == NULL) {
- init_collection ();
- view->view_instance = gal_view_instance_new (collection, e_book_get_uri (view->book));
- }
-
- if (view->view_instance && view->uic) {
- view->view_menus = gal_view_menus_new(view->view_instance);
- gal_view_menus_apply(view->view_menus, view->uic, NULL);
-
- display_view (view->view_instance, gal_view_instance_get_current_view (view->view_instance), view);
-
- g_signal_connect(view->view_instance, "display_view",
- G_CALLBACK (display_view), view);
- }
-}
-
-static void
-eab_view_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
-{
- EABView *eav = EAB_VIEW(object);
-
- switch (prop_id){
- case PROP_BOOK:
- if (eav->book) {
- g_object_unref (eav->book);
- }
- if (g_value_get_object (value)) {
- eav->book = E_BOOK(g_value_get_object (value));
- g_object_ref (eav->book);
- }
- else
- eav->book = NULL;
-
- if (eav->view_instance) {
- g_object_unref (eav->view_instance);
- eav->view_instance = NULL;
- }
-
- g_object_set(eav->model,
- "book", eav->book,
- NULL);
-
- setup_menus (eav);
-
- break;
- case PROP_QUERY:
-#if 0 /* This code will mess up ldap a bit. We need to think about the ramifications of this more. */
- if ((g_value_get_string (value) == NULL && !strcmp (eav->query, SHOW_ALL_SEARCH)) ||
- (g_value_get_string (value) != NULL && !strcmp (eav->query, g_value_get_string (value))))
- break;
-#endif
- g_free(eav->query);
- eav->query = g_strdup(g_value_get_string (value));
- if (!eav->query)
- eav->query = g_strdup (SHOW_ALL_SEARCH);
- g_object_set(eav->model,
- "query", eav->query,
- NULL);
- break;
- case PROP_TYPE:
- change_view_type(eav, g_value_get_int (value));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-eab_view_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
-{
- EABView *eav = EAB_VIEW(object);
-
- switch (prop_id) {
- case PROP_BOOK:
- if (eav->book)
- g_value_set_object (value, eav->book);
- else
- g_value_set_object (value, NULL);
- break;
- case PROP_QUERY:
- g_value_set_string (value, eav->query);
- break;
- case PROP_TYPE:
- g_value_set_int (value, eav->view_type);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static ESelectionModel*
-get_selection_model (EABView *view)
-{
- if (view->view_type == EAB_VIEW_TABLE)
- return e_table_get_selection_model (e_table_scrolled_get_table (E_TABLE_SCROLLED(view->widget)));
- else if (view->view_type == EAB_VIEW_MINICARD)
- return e_minicard_view_widget_get_selection_model (E_MINICARD_VIEW_WIDGET(view->object));
-#ifdef WITH_ADDRESSBOOK_VIEW_TREEVIEW
- else if (view->view_type == EAB_VIEW_TREEVIEW)
- return e_treeview_get_selection_model (GTK_TREE_VIEW (view->object));
-#endif
- g_return_val_if_reached (NULL);
-}
-
-/* Popup menu stuff */
-typedef struct {
- EABView *view;
- EPopupMenu *submenu;
- gpointer closure;
-} ContactAndBook;
-
-static ESelectionModel*
-contact_and_book_get_selection_model (ContactAndBook *contact_and_book)
-{
- return get_selection_model (contact_and_book->view);
-}
-
-static void
-contact_and_book_free (ContactAndBook *contact_and_book)
-{
- EABView *view = contact_and_book->view;
- ESelectionModel *selection;
-
- if (contact_and_book->submenu)
- gal_view_instance_free_popup_menu (view->view_instance,
- contact_and_book->submenu);
-
- selection = contact_and_book_get_selection_model (contact_and_book);
- if (selection)
- e_selection_model_right_click_up(selection);
-
- g_object_unref (view);
-}
-
-static void
-get_contact_list_1(gint model_row,
- gpointer closure)
-{
- ContactAndBook *contact_and_book;
- GList **list;
- EABView *view;
- EContact *contact;
-
- contact_and_book = closure;
- list = contact_and_book->closure;
- view = contact_and_book->view;
-
- contact = eab_model_get_contact(view->model, model_row);
- *list = g_list_prepend(*list, contact);
-}
-
-static GList *
-get_contact_list (ContactAndBook *contact_and_book)
-{
- GList *list = NULL;
- ESelectionModel *selection;
-
- selection = contact_and_book_get_selection_model (contact_and_book);
-
- if (selection) {
- contact_and_book->closure = &list;
- e_selection_model_foreach (selection, get_contact_list_1, contact_and_book);
- }
-
- return list;
-}
-
-static void
-has_email_address_1(gint model_row,
- gpointer closure)
-{
- ContactAndBook *contact_and_book;
- gboolean *has_email;
- EABView *view;
- const EContact *contact;
- GList *email;
-
- contact_and_book = closure;
- has_email = contact_and_book->closure;
- view = contact_and_book->view;
-
- if (*has_email)
- return;
-
- contact = eab_model_contact_at(view->model, model_row);
-
- email = e_contact_get (E_CONTACT (contact), E_CONTACT_EMAIL);
-
- if (g_list_length (email) > 0)
- *has_email = TRUE;
-
- g_list_foreach (email, (GFunc)g_free, NULL);
- g_list_free (email);
-}
-
-static gboolean
-get_has_email_address (ContactAndBook *contact_and_book)
-{
- ESelectionModel *selection;
- gboolean has_email = FALSE;
-
- selection = contact_and_book_get_selection_model (contact_and_book);
-
- if (selection) {
- contact_and_book->closure = &has_email;
- e_selection_model_foreach (selection, has_email_address_1, contact_and_book);
- }
-
- return has_email;
-}
-
-static void
-save_as (GtkWidget *widget, ContactAndBook *contact_and_book)
-{
- GList *contacts = get_contact_list (contact_and_book);
- if (contacts) {
- eab_contact_list_save(_("Save as VCard"), contacts, NULL);
- e_free_object_list(contacts);
- }
-}
-
-static void
-send_as (GtkWidget *widget, ContactAndBook *contact_and_book)
-{
- GList *contacts = get_contact_list (contact_and_book);
- if (contacts) {
- eab_send_contact_list(contacts, EAB_DISPOSITION_AS_ATTACHMENT);
- e_free_object_list(contacts);
- }
-}
-
-static void
-send_to (GtkWidget *widget, ContactAndBook *contact_and_book)
-
-{
- GList *contacts = get_contact_list (contact_and_book);
-
- if (contacts) {
- eab_send_contact_list(contacts, EAB_DISPOSITION_AS_TO);
- e_free_object_list(contacts);
- }
-}
-
-static void
-print (GtkWidget *widget, ContactAndBook *contact_and_book)
-{
- GList *contacts = get_contact_list (contact_and_book);
- if (contacts) {
- if (contacts->next)
- gtk_widget_show(e_contact_print_contact_list_dialog_new(contacts));
- else
- gtk_widget_show(e_contact_print_contact_dialog_new(contacts->data));
- e_free_object_list(contacts);
- }
-}
-
-#if 0 /* Envelope printing is disabled for Evolution 1.0. */
-static void
-print_envelope (GtkWidget *widget, ContactAndBook *contact_and_book)
-{
- GList *cards = get_card_list (contact_and_book);
- if (cards) {
- gtk_widget_show(e_contact_list_print_envelope_dialog_new(contact_and_book->card));
- e_free_object_list(cards);
- }
-}
-#endif
-
-static void
-copy (GtkWidget *widget, ContactAndBook *contact_and_book)
-{
- eab_view_copy (contact_and_book->view);
-}
-
-static void
-paste (GtkWidget *widget, ContactAndBook *contact_and_book)
-{
- eab_view_paste (contact_and_book->view);
-}
-
-static void
-cut (GtkWidget *widget, ContactAndBook *contact_and_book)
-{
- eab_view_cut (contact_and_book->view);
-}
-
-static void
-delete (GtkWidget *widget, ContactAndBook *contact_and_book)
-{
- if (e_contact_editor_confirm_delete(GTK_WINDOW(gtk_widget_get_toplevel(contact_and_book->view->widget)))) {
- EBook *book;
- GList *list = get_contact_list(contact_and_book);
- GList *iterator;
- gboolean bulk_remove = FALSE;
-
- bulk_remove = e_book_check_static_capability (contact_and_book->view->model->book,
- "bulk-remove");
-
- g_object_get(contact_and_book->view->model,
- "book", &book,
- NULL);
-
- if (bulk_remove) {
- GList *ids = NULL;
-
- for (iterator = list; iterator; iterator = iterator->next) {
- EContact *contact = iterator->data;
- ids = g_list_prepend (ids, (char*)e_contact_get_const (contact, E_CONTACT_UID));
- }
-
- /* Remove the cards all at once. */
- /* XXX no callback specified... ugh */
- e_book_async_remove_contacts (book,
- ids,
- NULL,
- NULL);
-
- g_list_free (ids);
- }
- else {
- for (iterator = list; iterator; iterator = iterator->next) {
- EContact *contact = iterator->data;
- /* Remove the card. */
- /* XXX no callback specified... ugh */
- e_book_async_remove_contact (book,
- e_contact_get_const (contact, E_CONTACT_UID),
- NULL,
- NULL);
- }
- }
- e_free_object_list(list);
- g_object_unref(book);
- }
-}
-
-static void
-copy_to_folder (GtkWidget *widget, ContactAndBook *contact_and_book)
-{
- eab_view_copy_to_folder (contact_and_book->view);
-}
-
-static void
-move_to_folder (GtkWidget *widget, ContactAndBook *contact_and_book)
-{
- eab_view_move_to_folder (contact_and_book->view);
-}
-
-static void
-free_popup_info (GtkWidget *w, ContactAndBook *contact_and_book)
-{
- contact_and_book_free (contact_and_book);
-}
-
-static void
-new_card (GtkWidget *widget, ContactAndBook *contact_and_book)
-{
- EBook *book;
- EContact *contact = e_contact_new();
-
- g_object_get(contact_and_book->view->model,
- "book", &book,
- NULL);
-
- eab_show_contact_editor (book, contact, TRUE, TRUE);
- g_object_unref (book);
- g_object_unref (contact);
-}
-
-static void
-new_list (GtkWidget *widget, ContactAndBook *contact_and_book)
-{
- EBook *book;
- EContact *contact = e_contact_new ();
-
- g_object_get(contact_and_book->view->model,
- "book", &book,
- NULL);
- eab_show_contact_list_editor (book, contact, TRUE, TRUE);
- g_object_unref(book);
- g_object_unref(contact);
-}
-
-#if 0
-static void
-sources (GtkWidget *widget, ContactAndBook *contact_and_book)
-{
- BonoboControl *control;
- GNOME_Evolution_ShellView shell_view;
- CORBA_Environment ev;
-
- control = g_object_get_data (G_OBJECT (gcal), "control");
- if (control == NULL)
- return;
-
- shell_view = get_shell_view_interface (control);
- if (shell_view == CORBA_OBJECT_NIL)
- return;
-
- CORBA_exception_init (&ev);
-
- GNOME_Evolution_ShellView_showSettings (shell_view, &ev);
-
- if (BONOBO_EX (&ev))
- g_message ("control_util_show_settings(): Could not show settings");
-
- CORBA_exception_free (&ev);
-}
-#endif
-
-#define POPUP_READONLY_MASK 0x1
-#define POPUP_NOSELECTION_MASK 0x2
-#define POPUP_NOEMAIL_MASK 0x4
-
-static void
-do_popup_menu(EABView *view, GdkEvent *event)
-{
- ContactAndBook *contact_and_book;
- GtkMenu *popup;
- EPopupMenu *submenu = NULL;
- ESelectionModel *selection_model;
- gboolean selection = FALSE;
-
- EPopupMenu menu[] = {
- E_POPUP_ITEM (N_("New Contact..."), G_CALLBACK(new_card), POPUP_READONLY_MASK),
- E_POPUP_ITEM (N_("New Contact List..."), G_CALLBACK(new_list), POPUP_READONLY_MASK),
- E_POPUP_SEPARATOR,
-#if 0
- E_POPUP_ITEM (N_("Go to Folder..."), G_CALLBACK (goto_folder), 0),
- E_POPUP_ITEM (N_("Import..."), G_CALLBACK (import), POPUP_READONLY_MASK),
- E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("Search for Contacts..."), G_CALLBACK (search), 0),
- E_POPUP_ITEM (N_("Addressbook Sources..."), G_CALLBACK (sources), 0),
- E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("Pilot Settings..."), G_CALLBACK (pilot_settings), 0),
-#endif
- E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("Save as VCard"), G_CALLBACK(save_as), POPUP_NOSELECTION_MASK),
- E_POPUP_ITEM (N_("Forward Contact"), G_CALLBACK(send_as), POPUP_NOSELECTION_MASK),
- E_POPUP_ITEM (N_("Send Message to Contact"), G_CALLBACK(send_to), POPUP_NOSELECTION_MASK | POPUP_NOEMAIL_MASK),
- E_POPUP_ITEM (N_("Print"), G_CALLBACK(print), POPUP_NOSELECTION_MASK),
-#if 0 /* Envelope printing is disabled for Evolution 1.0. */
- E_POPUP_ITEM (N_("Print Envelope"), G_CALLBACK(print_envelope), POPUP_NOSELECTION_MASK),
-#endif
- E_POPUP_SEPARATOR,
-
- E_POPUP_ITEM (N_("Copy to folder..."), G_CALLBACK(copy_to_folder), POPUP_NOSELECTION_MASK),
- E_POPUP_ITEM (N_("Move to folder..."), G_CALLBACK(move_to_folder), POPUP_READONLY_MASK | POPUP_NOSELECTION_MASK),
- E_POPUP_SEPARATOR,
-
- E_POPUP_ITEM (N_("Cut"), G_CALLBACK (cut), POPUP_READONLY_MASK | POPUP_NOSELECTION_MASK),
- E_POPUP_ITEM (N_("Copy"), G_CALLBACK (copy), POPUP_NOSELECTION_MASK),
- E_POPUP_ITEM (N_("Paste"), G_CALLBACK (paste), POPUP_READONLY_MASK),
- E_POPUP_ITEM (N_("Delete"), G_CALLBACK(delete), POPUP_READONLY_MASK | POPUP_NOSELECTION_MASK),
- E_POPUP_SEPARATOR,
-
-#if 0
- E_POPUP_SUBMENU (N_("Current View"), submenu = gal_view_instance_get_popup_menu (view->view_instance), 0),
-#endif
- E_POPUP_TERMINATOR
- };
-
- contact_and_book = g_new(ContactAndBook, 1);
- contact_and_book->view = view;
- contact_and_book->submenu = submenu;
-
- g_object_ref (contact_and_book->view);
-
- selection_model = contact_and_book_get_selection_model (contact_and_book);
- if (selection_model)
- selection = e_selection_model_selected_count (selection_model) > 0;
-
- popup = e_popup_menu_create (menu,
- 0,
- (eab_model_editable (view->model) ? 0 : POPUP_READONLY_MASK) +
- (selection ? 0 : POPUP_NOSELECTION_MASK) +
- (get_has_email_address (contact_and_book) ? 0 : POPUP_NOEMAIL_MASK),
- contact_and_book);
-
- g_signal_connect (popup, "selection-done",
- G_CALLBACK (free_popup_info), contact_and_book);
- e_popup_menu (popup, event);
-
-}
-
-static void
-render_contact (int row, EABView *view)
-{
- EContact *contact = eab_model_get_contact (view->model, row);
-
- eab_contact_display_render (EAB_CONTACT_DISPLAY (view->contact_display), contact,
- EAB_CONTACT_DISPLAY_RENDER_NORMAL);
-}
-
-static void
-selection_changed (GObject *o, EABView *view)
-{
- ESelectionModel *selection_model;
-
- command_state_change (view);
-
- selection_model = get_selection_model (view);
-
- if (e_selection_model_selected_count (selection_model) == 1)
- e_selection_model_foreach (selection_model,
- (EForeachFunc)render_contact, view);
- else
- eab_contact_display_render (EAB_CONTACT_DISPLAY (view->contact_display), NULL,
- EAB_CONTACT_DISPLAY_RENDER_NORMAL);
-
-}
-
-static void
-table_double_click(ETableScrolled *table, gint row, gint col, GdkEvent *event, EABView *view)
-{
- if (E_IS_ADDRESSBOOK_TABLE_ADAPTER(view->object)) {
- EABModel *model = view->model;
- EContact *contact = eab_model_get_contact (model, row);
- EBook *book;
-
- g_object_get(model,
- "book", &book,
- NULL);
-
- g_assert (E_IS_BOOK (book));
-
- if (e_contact_get (contact, E_CONTACT_IS_LIST))
- eab_show_contact_list_editor (book, contact, FALSE, view->editable);
- else
- eab_show_contact_editor (book, contact, FALSE, view->editable);
-
- g_object_unref (book);
- g_object_unref (contact);
- }
-}
-
-static gint
-table_right_click(ETableScrolled *table, gint row, gint col, GdkEvent *event, EABView *view)
-{
- do_popup_menu(view, event);
- return TRUE;
-}
-
-static gint
-table_white_space_event(ETableScrolled *table, GdkEvent *event, EABView *view)
-{
- if (event->type == GDK_BUTTON_PRESS && ((GdkEventButton *)event)->button == 3) {
- do_popup_menu(view, event);
- return TRUE;
- } else {
- return FALSE;
- }
-}
-
-static void
-table_drag_data_get (ETable *table,
- int row,
- int col,
- GdkDragContext *context,
- GtkSelectionData *selection_data,
- guint info,
- guint time,
- gpointer user_data)
-{
- EABView *view = user_data;
-
- if (!E_IS_ADDRESSBOOK_TABLE_ADAPTER(view->object))
- return;
-
- switch (info) {
- case DND_TARGET_TYPE_VCARD: {
- char *value;
-
- value = e_vcard_to_string (E_VCARD (view->model->data[row]), EVC_FORMAT_VCARD_30);
-
- gtk_selection_data_set (selection_data,
- selection_data->target,
- 8,
- value, strlen (value));
- break;
- }
- }
-}
-
-static void
-emit_status_message (EABView *eav, const gchar *status)
-{
- g_signal_emit (eav,
- eab_view_signals [STATUS_MESSAGE], 0,
- status);
-}
-
-static void
-emit_search_result (EABView *eav, EBookViewStatus status)
-{
- g_signal_emit (eav,
- eab_view_signals [SEARCH_RESULT], 0,
- status);
-}
-
-static void
-emit_folder_bar_message (EABView *eav, const gchar *message)
-{
- g_signal_emit (eav,
- eab_view_signals [FOLDER_BAR_MESSAGE], 0,
- message);
-}
-
-static void
-status_message (GtkObject *object, const gchar *status, EABView *eav)
-{
- emit_status_message (eav, status);
-}
-
-static void
-search_result (GtkObject *object, EBookViewStatus status, EABView *eav)
-{
- emit_search_result (eav, status);
-}
-
-static void
-folder_bar_message (GtkObject *object, const gchar *status, EABView *eav)
-{
- emit_folder_bar_message (eav, status);
-}
-
-static void
-stop_state_changed (GtkObject *object, EABView *eav)
-{
- command_state_change (eav);
-}
-
-static void
-command_state_change (EABView *eav)
-{
- /* Reffing during emission is unnecessary. Gtk automatically refs during an emission. */
- g_signal_emit (eav, eab_view_signals [COMMAND_STATE_CHANGE], 0);
-}
-
-static void
-backend_died (GtkObject *object, EABView *eav)
-{
- char *message = g_strdup_printf (_("The addressbook backend for\n%s\nhas crashed. "
- "You will have to restart Evolution in order "
- "to use it again"),
- e_book_get_uri (eav->book));
- gnome_error_dialog_parented (message, GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (eav))));
- g_free (message);
-}
-
-static void
-minicard_right_click (EMinicardView *minicard_view_item, GdkEvent *event, EABView *view)
-{
- do_popup_menu(view, event);
-}
-
-static void
-create_minicard_view (EABView *view)
-{
- GtkWidget *scrolled_window;
- GtkWidget *minicard_view;
- EAddressbookReflowAdapter *adapter;
-
- adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(e_addressbook_reflow_adapter_new (view->model));
- minicard_view = e_minicard_view_widget_new(adapter);
-
- g_signal_connect(minicard_view, "selection_change",
- G_CALLBACK(selection_changed), view);
-
- g_signal_connect(minicard_view, "right_click",
- G_CALLBACK(minicard_right_click), view);
-
- scrolled_window = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window), GTK_SHADOW_IN);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
- GTK_POLICY_AUTOMATIC,
- GTK_POLICY_AUTOMATIC);
-
- view->object = G_OBJECT(minicard_view);
- view->widget = scrolled_window;
-
- gtk_container_add (GTK_CONTAINER (scrolled_window), minicard_view);
- gtk_widget_show (minicard_view);
-
- gtk_widget_show_all( GTK_WIDGET(scrolled_window) );
-
- gtk_paned_add1 (GTK_PANED (view->paned), scrolled_window);
-
- e_reflow_model_changed (E_REFLOW_MODEL (adapter));
-}
-
-static void
-create_table_view (EABView *view)
-{
- ETableModel *adapter;
- GtkWidget *table;
-
- adapter = eab_table_adapter_new(view->model);
-
- /* Here we create the table. We give it the three pieces of
- the table we've created, the header, the model, and the
- initial layout. It does the rest. */
- table = e_table_scrolled_new_from_spec_file (adapter, NULL, EVOLUTION_ETSPECDIR "/e-addressbook-view.etspec", NULL);
-
- view->object = G_OBJECT(adapter);
- view->widget = table;
-
- g_signal_connect(e_table_scrolled_get_table(E_TABLE_SCROLLED(table)), "double_click",
- G_CALLBACK(table_double_click), view);
- g_signal_connect(e_table_scrolled_get_table(E_TABLE_SCROLLED(table)), "right_click",
- G_CALLBACK(table_right_click), view);
- g_signal_connect(e_table_scrolled_get_table(E_TABLE_SCROLLED(table)), "white_space_event",
- G_CALLBACK(table_white_space_event), view);
- g_signal_connect(e_table_scrolled_get_table(E_TABLE_SCROLLED(table)), "selection_change",
- G_CALLBACK(selection_changed), view);
-
- /* drag & drop signals */
- e_table_drag_source_set (E_TABLE(E_TABLE_SCROLLED(table)->table), GDK_BUTTON1_MASK,
- drag_types, num_drag_types, GDK_ACTION_MOVE);
-
- g_signal_connect (E_TABLE_SCROLLED(table)->table,
- "table_drag_data_get",
- G_CALLBACK (table_drag_data_get),
- view);
-
- gtk_paned_add1 (GTK_PANED (view->paned), table);
-
- gtk_widget_show( GTK_WIDGET(table) );
-}
-
-#ifdef WITH_ADDRESSBOOK_VIEW_TREEVIEW
-static void
-treeview_row_activated(GtkTreeView *treeview,
- GtkTreePath *path, GtkTreeViewColumn *column,
- EABView *view)
-{
- EABModel *model = view->model;
- int row = gtk_tree_path_get_indices (path)[0];
- ECard *card = eab_model_get_card(model, row);
- EBook *book;
-
- g_object_get(model,
- "book", &book,
- NULL);
-
- g_assert (E_IS_BOOK (book));
-
- if (e_card_evolution_list (card))
- eab_show_contact_list_editor (book, card, FALSE, view->editable);
- else
- eab_show_contact_editor (book, card, FALSE, view->editable);
-
- g_object_unref (book);
- g_object_unref (card);
-}
-
-static void
-create_treeview_view (EABView *view)
-{
- GtkTreeModel *adapter;
- ECardSimple *simple;
- GtkWidget *treeview;
- GtkWidget *scrolled;
- int i;
-
- simple = e_card_simple_new(NULL);
-
- adapter = eab_treeview_adapter_new(view->model);
-
- scrolled = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_shadow (GTK_SCROLLED_WINDOW (scrolled), GTK_SHADOW_IN);
- treeview = gtk_tree_view_new_with_model (adapter);
-
- gtk_widget_show (treeview);
-
- gtk_container_add (GTK_CONTAINER (scrolled), treeview);
-
- for (i = 0; i < 15; i ++) {
- GtkTreeViewColumn *column =
- gtk_tree_view_column_new_with_attributes (e_card_simple_get_name (simple, i),
- gtk_cell_renderer_text_new (),
- "text", i,
- NULL);
-
- gtk_tree_view_append_column (GTK_TREE_VIEW (treeview), column);
- }
-
- view->object = G_OBJECT(treeview);
- view->widget = scrolled;
-
- gtk_tree_selection_set_mode (gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview)), GTK_SELECTION_MULTIPLE);
- gtk_tree_view_enable_model_drag_source (GTK_TREE_VIEW (treeview),
- GDK_BUTTON1_MASK,
- drag_types,
- num_drag_types,
- GDK_ACTION_MOVE);
-
- g_signal_connect(treeview, "row_activated",
- G_CALLBACK (treeview_row_activated), view);
-#if 0
- g_signal_connect(e_table_scrolled_get_table(E_TABLE_SCROLLED(table)), "right_click",
- G_CALLBACK(table_right_click), view);
-
- /* drag & drop signals */
- e_table_drag_source_set (E_TABLE(E_TABLE_SCROLLED(table)->table), GDK_BUTTON1_MASK,
- drag_types, num_drag_types, GDK_ACTION_MOVE);
-
- g_signal_connect (E_TABLE_SCROLLED(table)->table,
- "table_drag_data_get",
- G_CALLBACK (table_drag_data_get),
- view);
-#endif
-
-
- g_signal_connect(e_treeview_get_selection_model (GTK_TREE_VIEW (treeview)), "selection_changed",
- G_CALLBACK(selection_changed), view);
-
- gtk_paned_add1 (GTK_PANED (view->paned), scrolled);
-
- gtk_widget_show( GTK_WIDGET(scrolled) );
-
- g_object_unref (simple);
-}
-#endif
-
-static void
-change_view_type (EABView *view, EABViewType view_type)
-{
- if (view_type == view->view_type)
- return;
-
- if (view->widget) {
- gtk_container_remove (GTK_CONTAINER (view->paned), view->widget);
- view->widget = NULL;
- }
- view->object = NULL;
-
- switch (view_type) {
- case EAB_VIEW_TABLE:
- create_table_view (view);
- break;
- case EAB_VIEW_MINICARD:
- create_minicard_view (view);
- break;
-#ifdef WITH_ADDRESSBOOK_VIEW_TREEVIEW
- case EAB_VIEW_TREEVIEW:
- create_treeview_view (view);
- break;
-#endif
- default:
- g_warning ("view_type not recognized.");
- return;
- }
-
- view->view_type = view_type;
-
- command_state_change (view);
-}
-
-typedef struct {
- GtkWidget *table;
- GObject *printable;
-} EContactPrintDialogWeakData;
-
-static void
-e_contact_print_destroy(gpointer data, GObject *where_object_was)
-{
- EContactPrintDialogWeakData *weak_data = data;
- g_object_unref (weak_data->printable);
- g_object_unref (weak_data->table);
- g_free (weak_data);
-}
-
-static void
-e_contact_print_button(GtkDialog *dialog, gint response, gpointer data)
-{
- GnomePrintJob *master;
- GnomePrintContext *pc;
- EPrintable *printable = g_object_get_data(G_OBJECT(dialog), "printable");
- GtkWidget *preview;
- switch( response ) {
- case GNOME_PRINT_DIALOG_RESPONSE_PRINT:
- master = gnome_print_job_new(gnome_print_dialog_get_config ( GNOME_PRINT_DIALOG(dialog) ));
- pc = gnome_print_job_get_context( master );
- e_printable_reset(printable);
- while (e_printable_data_left(printable)) {
- if (gnome_print_gsave(pc) == -1)
- /* FIXME */;
- if (gnome_print_translate(pc, 72, 72) == -1)
- /* FIXME */;
- e_printable_print_page(printable,
- pc,
- 6.5 * 72,
- 5 * 72,
- TRUE);
- if (gnome_print_grestore(pc) == -1)
- /* FIXME */;
- if (gnome_print_showpage(pc) == -1)
- /* FIXME */;
- }
- gnome_print_job_close(master);
- gnome_print_job_print(master);
- g_object_unref (master);
- gtk_widget_destroy((GtkWidget *)dialog);
- break;
- case GNOME_PRINT_DIALOG_RESPONSE_PREVIEW:
- master = gnome_print_job_new (gnome_print_dialog_get_config ( GNOME_PRINT_DIALOG(dialog) ));
- pc = gnome_print_job_get_context( master );
- e_printable_reset(printable);
- while (e_printable_data_left(printable)) {
- if (gnome_print_gsave(pc) == -1)
- /* FIXME */;
- if (gnome_print_translate(pc, 72, 72) == -1)
- /* FIXME */;
- e_printable_print_page(printable,
- pc,
- 6.5 * 72,
- 9 * 72,
- TRUE);
- if (gnome_print_grestore(pc) == -1)
- /* FIXME */;
- if (gnome_print_showpage(pc) == -1)
- /* FIXME */;
- }
- gnome_print_job_close(master);
- preview = GTK_WIDGET(gnome_print_job_preview_new(master, "Print Preview"));
- gtk_widget_show_all(preview);
- g_object_unref (master);
- break;
- case GNOME_PRINT_DIALOG_RESPONSE_CANCEL:
- default:
- gtk_widget_destroy((GtkWidget *)dialog);
- break;
- }
-}
-
-void
-eab_view_setup_menus (EABView *view,
- BonoboUIComponent *uic)
-{
-
- g_return_if_fail (view != NULL);
- g_return_if_fail (E_IS_ADDRESSBOOK_VIEW (view));
- g_return_if_fail (uic != NULL);
- g_return_if_fail (BONOBO_IS_UI_COMPONENT (uic));
-
- init_collection ();
-
- view->uic = uic;
-
- setup_menus (view);
-}
-
-/**
- * eab_view_discard_menus:
- * @view: An addressbook view.
- *
- * Makes an addressbook view discard its GAL view menus and its views instance
- * objects. This should be called when the corresponding Bonobo component is
- * deactivated.
- **/
-void
-eab_view_discard_menus (EABView *view)
-{
- g_return_if_fail (view != NULL);
- g_return_if_fail (E_IS_ADDRESSBOOK_VIEW (view));
- g_return_if_fail (view->view_instance);
-
- if (view->view_menus) {
- gal_view_menus_unmerge (view->view_menus, NULL);
-
- g_object_unref (view->view_menus);
- view->view_menus = NULL;
- }
-
- if (view->view_instance) {
- g_object_unref (view->view_instance);
- view->view_instance = NULL;
- }
-
- view->uic = NULL;
-}
-
-void
-eab_view_print(EABView *view)
-{
- if (view->view_type == EAB_VIEW_MINICARD) {
- char *query;
- EBook *book;
- GtkWidget *print;
-
- g_object_get (view->model,
- "query", &query,
- "book", &book,
- NULL);
- print = e_contact_print_dialog_new(book, query);
- g_free(query);
- gtk_widget_show_all(print);
- }
- else if (view->view_type == EAB_VIEW_TABLE) {
- GtkWidget *dialog;
- EPrintable *printable;
- ETable *etable;
- EContactPrintDialogWeakData *weak_data;
-
- dialog = gnome_print_dialog_new(NULL, "Print cards", GNOME_PRINT_DIALOG_RANGE | GNOME_PRINT_DIALOG_COPIES);
- gnome_print_dialog_construct_range_any(GNOME_PRINT_DIALOG(dialog), GNOME_PRINT_RANGE_ALL | GNOME_PRINT_RANGE_SELECTION,
- NULL, NULL, NULL);
-
- g_object_get(view->widget, "table", &etable, NULL);
- printable = e_table_get_printable(etable);
- g_object_unref(etable);
- g_object_ref (view->widget);
-
- g_object_set_data (G_OBJECT (dialog), "table", view->widget);
- g_object_set_data (G_OBJECT (dialog), "printable", printable);
-
- g_signal_connect(dialog,
- "response", G_CALLBACK(e_contact_print_button), NULL);
-
- weak_data = g_new (EContactPrintDialogWeakData, 1);
-
- weak_data->table = view->widget;
- weak_data->printable = G_OBJECT (printable);
-
- g_object_weak_ref (G_OBJECT (dialog), e_contact_print_destroy, weak_data);
-
- gtk_widget_show(dialog);
- }
-#ifdef WITH_ADDRESSBOOK_VIEW_TREEVIEW
- else if (view->view_type == EAB_VIEW_TREEVIEW) {
- /* XXX */
- }
-#endif
-}
-
-void
-eab_view_print_preview(EABView *view)
-{
- if (view->view_type == EAB_VIEW_MINICARD) {
- char *query;
- EBook *book;
-
- g_object_get (view->model,
- "query", &query,
- "book", &book,
- NULL);
- e_contact_print_preview(book, query);
- g_free(query);
- }
- else if (view->view_type == EAB_VIEW_TABLE) {
- EPrintable *printable;
- ETable *etable;
- GnomePrintJob *master;
- GnomePrintContext *pc;
- GnomePrintConfig *config;
- GtkWidget *preview;
-
- g_object_get(view->widget, "table", &etable, NULL);
- printable = e_table_get_printable(etable);
- g_object_unref(etable);
-
- master = gnome_print_job_new(NULL);
- config = gnome_print_job_get_config (master);
- gnome_print_config_set_int (config, GNOME_PRINT_KEY_NUM_COPIES, 1);
- pc = gnome_print_job_get_context( master );
- e_printable_reset(printable);
- while (e_printable_data_left(printable)) {
- if (gnome_print_gsave(pc) == -1)
- /* FIXME */;
- if (gnome_print_translate(pc, 72, 72) == -1)
- /* FIXME */;
- e_printable_print_page(printable,
- pc,
- 6.5 * 72,
- 9 * 72,
- TRUE);
- if (gnome_print_grestore(pc) == -1)
- /* FIXME */;
- if (gnome_print_showpage(pc) == -1)
- /* FIXME */;
- }
- gnome_print_job_close(master);
- preview = GTK_WIDGET(gnome_print_job_preview_new(master, "Print Preview"));
- gtk_widget_show_all(preview);
- g_object_unref (master);
- g_object_unref (printable);
- }
-#ifdef WITH_ADDRESSBOOK_VIEW_TREEVIEW
- else if (view->view_type == EAB_VIEW_TREEVIEW) {
- /* XXX */
- }
-#endif
-}
-
-void
-eab_view_delete_selection(EABView *view)
-{
- ContactAndBook contact_and_book;
-
- memset (&contact_and_book, 0, sizeof (contact_and_book));
- contact_and_book.view = view;
-
- delete (GTK_WIDGET (view), &contact_and_book);
-}
-
-static void
-invisible_destroyed (gpointer data, GObject *where_object_was)
-{
- EABView *view = data;
- view->invisible = NULL;
-}
-
-static void
-selection_get (GtkWidget *invisible,
- GtkSelectionData *selection_data,
- guint info,
- guint time_stamp,
- EABView *view)
-{
- char *value;
-
- value = eab_contact_list_to_string (view->clipboard_contacts);
-
- gtk_selection_data_set (selection_data, GDK_SELECTION_TYPE_STRING,
- 8, value, strlen (value));
-
-}
-
-static void
-selection_clear_event (GtkWidget *invisible,
- GdkEventSelection *event,
- EABView *view)
-{
- if (view->clipboard_contacts) {
- g_list_foreach (view->clipboard_contacts, (GFunc)g_object_unref, NULL);
- g_list_free (view->clipboard_contacts);
- view->clipboard_contacts = NULL;
- }
-}
-
-static void
-selection_received (GtkWidget *invisible,
- GtkSelectionData *selection_data,
- guint time,
- EABView *view)
-{
- if (selection_data->length < 0 || selection_data->type != GDK_SELECTION_TYPE_STRING) {
- return;
- }
- else {
- /* XXX make sure selection_data->data = \0 terminated */
- GList *contact_list = eab_contact_list_from_string (selection_data->data);
- GList *l;
-
- for (l = contact_list; l; l = l->next) {
- EContact *contact = l->data;
-
- /* XXX NULL for a callback /sigh */
- eab_merging_book_add_contact (view->book, contact, NULL /* XXX */, NULL);
- }
-
- g_list_foreach (contact_list, (GFunc)g_object_unref, NULL);
- g_list_free (contact_list);
- }
-}
-
-static void
-add_to_list (int model_row, gpointer closure)
-{
- GList **list = closure;
- *list = g_list_prepend (*list, GINT_TO_POINTER (model_row));
-}
-
-static GList *
-get_selected_contacts (EABView *view)
-{
- GList *list;
- GList *iterator;
- ESelectionModel *selection = get_selection_model (view);
-
- list = NULL;
- e_selection_model_foreach (selection, add_to_list, &list);
-
- for (iterator = list; iterator; iterator = iterator->next) {
- iterator->data = eab_model_get_contact (view->model, GPOINTER_TO_INT (iterator->data));
- }
- list = g_list_reverse (list);
- return list;
-}
-
-void
-eab_view_save_as (EABView *view)
-{
- GList *list = get_selected_contacts (view);
- if (list)
- eab_contact_list_save (_("Save as VCard"), list, NULL);
- e_free_object_list(list);
-}
-
-void
-eab_view_view (EABView *view)
-{
- GList *list = get_selected_contacts (view);
- eab_show_multiple_contacts (view->book, list, view->editable);
- e_free_object_list(list);
-}
-
-void
-eab_view_send (EABView *view)
-{
- GList *list = get_selected_contacts (view);
- if (list)
- eab_send_contact_list (list, EAB_DISPOSITION_AS_ATTACHMENT);
- e_free_object_list(list);
-}
-
-void
-eab_view_send_to (EABView *view)
-{
- GList *list = get_selected_contacts (view);
- if (list)
- eab_send_contact_list (list, EAB_DISPOSITION_AS_TO);
- e_free_object_list(list);
-}
-
-void
-eab_view_cut (EABView *view)
-{
- eab_view_copy (view);
- eab_view_delete_selection (view);
-}
-
-void
-eab_view_copy (EABView *view)
-{
- view->clipboard_contacts = get_selected_contacts (view);
-
- gtk_selection_owner_set (view->invisible, clipboard_atom, GDK_CURRENT_TIME);
-}
-
-void
-eab_view_paste (EABView *view)
-{
- gtk_selection_convert (view->invisible, clipboard_atom,
- GDK_SELECTION_TYPE_STRING,
- GDK_CURRENT_TIME);
-}
-
-void
-eab_view_select_all (EABView *view)
-{
- ESelectionModel *model = get_selection_model (view);
-
- g_return_if_fail (model);
-
- e_selection_model_select_all (model);
-}
-
-void
-eab_view_show_all(EABView *view)
-{
- g_object_set(view,
- "query", NULL,
- NULL);
-}
-
-void
-eab_view_stop(EABView *view)
-{
- if (view)
- eab_model_stop (view->model);
-}
-
-static void
-view_transfer_contacts (EABView *view, gboolean delete_from_source)
-{
- EBook *book;
- GList *contacts;
- GtkWindow *parent_window;
-
- g_object_get(view->model,
- "book", &book,
- NULL);
- contacts = get_selected_contacts (view);
- parent_window = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (view)));
-
- eab_transfer_contacts (book, contacts, delete_from_source, parent_window);
- g_object_unref(book);
-}
-
-void
-eab_view_copy_to_folder (EABView *view)
-{
- view_transfer_contacts (view, FALSE);
-}
-
-void
-eab_view_move_to_folder (EABView *view)
-{
- view_transfer_contacts (view, TRUE);
-}
-
-
-static gboolean
-eab_view_selection_nonempty (EABView *view)
-{
- ESelectionModel *selection_model;
-
- selection_model = get_selection_model (view);
- if (selection_model == NULL)
- return FALSE;
-
- return e_selection_model_selected_count (selection_model) != 0;
-}
-
-gboolean
-eab_view_can_create (EABView *view)
-{
- return view ? eab_model_editable (view->model) : FALSE;
-}
-
-gboolean
-eab_view_can_print (EABView *view)
-{
- return view && view->model ? eab_model_contact_count (view->model) : FALSE;
-}
-
-gboolean
-eab_view_can_save_as (EABView *view)
-{
- return view ? eab_view_selection_nonempty (view) : FALSE;
-}
-
-gboolean
-eab_view_can_view (EABView *view)
-{
- return view ? eab_view_selection_nonempty (view) : FALSE;
-}
-
-gboolean
-eab_view_can_send (EABView *view)
-{
- return view ? eab_view_selection_nonempty (view) : FALSE;
-}
-
-gboolean
-eab_view_can_send_to (EABView *view)
-{
- return view ? eab_view_selection_nonempty (view) : FALSE;
-}
-
-gboolean
-eab_view_can_delete (EABView *view)
-{
- return view ? eab_view_selection_nonempty (view) && eab_model_editable (view->model) : FALSE;
-}
-
-gboolean
-eab_view_can_cut (EABView *view)
-{
- return view ? eab_view_selection_nonempty (view) && eab_model_editable (view->model) : FALSE;
-}
-
-gboolean
-eab_view_can_copy (EABView *view)
-{
- return view ? eab_view_selection_nonempty (view) : FALSE;
-}
-
-gboolean
-eab_view_can_paste (EABView *view)
-{
- return view ? eab_model_editable (view->model) : FALSE;
-}
-
-gboolean
-eab_view_can_select_all (EABView *view)
-{
- return view ? eab_model_contact_count (view->model) != 0 : FALSE;
-}
-
-gboolean
-eab_view_can_stop (EABView *view)
-{
- return view ? eab_model_can_stop (view->model) : FALSE;
-}
-
-gboolean
-eab_view_can_copy_to_folder (EABView *view)
-{
- return view ? eab_view_selection_nonempty (view) : FALSE;
-}
-
-gboolean
-eab_view_can_move_to_folder (EABView *view)
-{
- return view ? eab_view_selection_nonempty (view) && eab_model_editable (view->model) : FALSE;
-}
diff --git a/addressbook/gui/widgets/e-addressbook-view.etspec b/addressbook/gui/widgets/e-addressbook-view.etspec
deleted file mode 100644
index 84f9ad44b8..0000000000
--- a/addressbook/gui/widgets/e-addressbook-view.etspec
+++ /dev/null
@@ -1,58 +0,0 @@
-<ETableSpecification draw-grid="true">
- <ETableColumn model_col= "2" _title="File As" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col= "3" _title="Full Name" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col= "4" _title="Given Name" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col= "5" _title="Family Name" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col= "6" _title="Nickname" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
-
- <ETableColumn model_col= "7" _title="Email" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col= "8" _title="Email 2" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col= "9" _title="Email 3" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
-
- <ETableColumn model_col= "14" _title="Assistant Phone" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col= "15" _title="Business Phone" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col= "16" _title="Business Phone 2" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="17" _title="Business Fax" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="18" _title="Callback Phone" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="19" _title="Car Phone" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="20" _title="Company Phone" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="21" _title="Home Phone" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="22" _title="Home Phone 2" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="23" _title="Home Fax" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="24" _title="ISDN Phone" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="25" _title="Mobile Phone" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="26" _title="Other Phone" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="27" _title="Other Fax" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="28" _title="Pager" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="29" _title="Primary Phone" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="30" _title="Radio" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="31" _title="Telex" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="32" _title="TTYTDD" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
-
- <ETableColumn model_col="33" _title="Organization" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="34" _title="Unit" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="35" _title="Office" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="36" _title="Title" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="37" _title="Role" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="38" _title="Manager" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="39" _title="Assistant" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
-
- <ETableColumn model_col="40" _title="Web Site" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="41" _title="Journal" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
-
- <ETableColumn model_col="42" _title="Categories" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
-
- <ETableColumn model_col="46" _title="Spouse" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="47" _title="Note" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
-
- <ETableState>
- <column source="0"/>
- <column source="1"/>
- <column source="5"/>
- <column source="23"/>
- <column source="36"/>
- <grouping>
- <leaf column="0" ascending="true"/>
- </grouping>
- </ETableState>
-</ETableSpecification>
diff --git a/addressbook/gui/widgets/e-addressbook-view.h b/addressbook/gui/widgets/e-addressbook-view.h
deleted file mode 100644
index f819704550..0000000000
--- a/addressbook/gui/widgets/e-addressbook-view.h
+++ /dev/null
@@ -1,144 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* e-addressbook-view.h
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-#ifndef __EAB_VIEW_H__
-#define __EAB_VIEW_H__
-
-#include <gtk/gtkeventbox.h>
-#include <bonobo/bonobo-ui-component.h>
-#include <gal/menus/gal-view-instance.h>
-#include <libebook/e-book.h>
-#include "e-addressbook-model.h"
-#include "eab-contact-display.h"
-#include "widgets/menus/gal-view-menus.h"
-
-G_BEGIN_DECLS
-
-/* EABView - A card displaying information about a contact.
- *
- * The following arguments are available:
- *
- * name type read/write description
- * --------------------------------------------------------------------------------
- */
-
-#define E_TYPE_AB_VIEW (eab_view_get_type ())
-#define EAB_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_AB_VIEW, EABView))
-#define EAB_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_AB_VIEW, EABViewClass))
-#define E_IS_ADDRESSBOOK_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_AB_VIEW))
-#define E_IS_ADDRESSBOOK_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_AB_VIEW))
-
-typedef enum {
- EAB_VIEW_NONE, /* initialized to this */
- EAB_VIEW_MINICARD,
- EAB_VIEW_TABLE,
-#ifdef WITH_ADDRESSBOOK_VIEW_TREEVIEW
- ,EAB_VIEW_TREEVIEW
-#endif
-} EABViewType;
-
-
-typedef struct _EABView EABView;
-typedef struct _EABViewClass EABViewClass;
-
-struct _EABView
-{
- GtkEventBox parent;
-
- /* item specific fields */
- EABViewType view_type;
-
- EABModel *model;
-
- GtkWidget *invisible;
- GList *clipboard_contacts;
-
- EBook *book;
- char *query;
- guint editable : 1;
-
- GObject *object;
- GtkWidget *widget;
-
- GtkWidget *scrolled;
- GtkWidget *contact_display;
- GtkWidget *paned;
-
- /* Menus handler and the view instance */
- GalViewInstance *view_instance;
- GalViewMenus *view_menus;
- GalView *current_view;
- BonoboUIComponent *uic;
-};
-
-struct _EABViewClass
-{
- GtkEventBoxClass parent_class;
-
- /*
- * Signals
- */
- void (*status_message) (EABView *view, const gchar *message);
- void (*search_result) (EABView *view, EBookViewStatus status);
- void (*folder_bar_message) (EABView *view, const gchar *message);
- void (*command_state_change) (EABView *view);
-};
-
-GtkWidget *eab_view_new (void);
-GType eab_view_get_type (void);
-
-void eab_view_setup_menus (EABView *view,
- BonoboUIComponent *uic);
-
-void eab_view_discard_menus (EABView *view);
-
-void eab_view_save_as (EABView *view);
-void eab_view_view (EABView *view);
-void eab_view_send (EABView *view);
-void eab_view_send_to (EABView *view);
-void eab_view_print (EABView *view);
-void eab_view_print_preview (EABView *view);
-void eab_view_delete_selection (EABView *view);
-void eab_view_cut (EABView *view);
-void eab_view_copy (EABView *view);
-void eab_view_paste (EABView *view);
-void eab_view_select_all (EABView *view);
-void eab_view_show_all (EABView *view);
-void eab_view_stop (EABView *view);
-void eab_view_copy_to_folder (EABView *view);
-void eab_view_move_to_folder (EABView *view);
-
-gboolean eab_view_can_create (EABView *view);
-gboolean eab_view_can_print (EABView *view);
-gboolean eab_view_can_save_as (EABView *view);
-gboolean eab_view_can_view (EABView *view);
-gboolean eab_view_can_send (EABView *view);
-gboolean eab_view_can_send_to (EABView *view);
-gboolean eab_view_can_delete (EABView *view);
-gboolean eab_view_can_cut (EABView *view);
-gboolean eab_view_can_copy (EABView *view);
-gboolean eab_view_can_paste (EABView *view);
-gboolean eab_view_can_select_all (EABView *view);
-gboolean eab_view_can_stop (EABView *view);
-gboolean eab_view_can_copy_to_folder (EABView *view);
-gboolean eab_view_can_move_to_folder (EABView *view);
-
-G_END_DECLS;
-
-#endif /* __EAB_VIEW_H__ */
diff --git a/addressbook/gui/widgets/e-minicard-label.c b/addressbook/gui/widgets/e-minicard-label.c
deleted file mode 100644
index df1465349e..0000000000
--- a/addressbook/gui/widgets/e-minicard-label.c
+++ /dev/null
@@ -1,508 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-minicard-label.c
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-
-#include "e-minicard-label.h"
-#include "eab-marshal.h"
-
-#include <gtk/gtksignal.h>
-#include <libgnomecanvas/gnome-canvas-rect-ellipse.h>
-#include <libgnome/gnome-i18n.h>
-#include <gal/util/e-util.h>
-#include <gal/e-text/e-text.h>
-#include <gal/widgets/e-canvas.h>
-#include <gal/widgets/e-canvas-utils.h>
-#include <gdk/gdkkeysyms.h>
-
-static void e_minicard_label_init (EMinicardLabel *card);
-static void e_minicard_label_class_init (EMinicardLabelClass *klass);
-static void e_minicard_label_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static void e_minicard_label_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
-static gboolean e_minicard_label_event (GnomeCanvasItem *item, GdkEvent *event);
-static void e_minicard_label_realize (GnomeCanvasItem *item);
-static void e_minicard_label_unrealize (GnomeCanvasItem *item);
-static void e_minicard_label_reflow(GnomeCanvasItem *item, int flags);
-static void e_minicard_label_style_set (EMinicardLabel *label, GtkStyle *previous_style);
-
-static void e_minicard_label_resize_children( EMinicardLabel *e_minicard_label );
-
-static void set_colors (EMinicardLabel *label);
-
-static GnomeCanvasGroupClass *parent_class = NULL;
-
-/* The arguments we take */
-enum {
- PROP_0,
- PROP_WIDTH,
- PROP_HEIGHT,
- PROP_HAS_FOCUS,
- PROP_FIELD,
- PROP_FIELDNAME,
- PROP_TEXT_MODEL,
- PROP_MAX_FIELD_NAME_WIDTH,
- PROP_EDITABLE
-};
-
-enum {
- STYLE_SET,
- LAST_SIGNAL
-};
-
-static guint e_minicard_label_signals [LAST_SIGNAL] = {0, };
-
-GType
-e_minicard_label_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (EMinicardLabelClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_minicard_label_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EMinicardLabel),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_minicard_label_init,
- };
-
- type = g_type_register_static (gnome_canvas_group_get_type (), "EMinicardLabel", &info, 0);
- }
-
- return type;
-}
-
-static void
-e_minicard_label_class_init (EMinicardLabelClass *klass)
-{
- GObjectClass *object_class;
- GnomeCanvasItemClass *item_class;
-
- object_class = G_OBJECT_CLASS (klass);
- item_class = (GnomeCanvasItemClass *) klass;
-
- klass->style_set = e_minicard_label_style_set;
-
- parent_class = g_type_class_peek_parent (klass);
-
- object_class->set_property = e_minicard_label_set_property;
- object_class->get_property = e_minicard_label_get_property;
- /* object_class->destroy = e_minicard_label_destroy; */
-
- g_object_class_install_property (object_class, PROP_WIDTH,
- g_param_spec_double ("width",
- _("Width"),
- /*_( */"XXX blurb" /*)*/,
- 0.0, G_MAXDOUBLE, 10.0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_HEIGHT,
- g_param_spec_double ("height",
- _("Height"),
- /*_( */"XXX blurb" /*)*/,
- 0.0, G_MAXDOUBLE, 10.0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_HAS_FOCUS,
- g_param_spec_boolean ("has_focus",
- _("Has Focus"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_FIELD,
- g_param_spec_string ("field",
- _("Field"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_FIELDNAME,
- g_param_spec_string ("fieldname",
- _("Field Name"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_TEXT_MODEL,
- g_param_spec_object ("text_model",
- _("Text Model"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_TEXT_MODEL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_MAX_FIELD_NAME_WIDTH,
- g_param_spec_double ("max_field_name_length",
- _("Max field name length"),
- /*_( */"XXX blurb" /*)*/,
- -1.0, G_MAXDOUBLE, -1.0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_EDITABLE,
- g_param_spec_boolean ("editable",
- _("Editable"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- e_minicard_label_signals [STYLE_SET] =
- g_signal_new ("style_set",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EMinicardLabelClass, style_set),
- NULL, NULL,
- eab_marshal_VOID__OBJECT,
- G_TYPE_NONE, 1,
- GTK_TYPE_STYLE);
-
- /* GnomeCanvasItem method overrides */
- item_class->realize = e_minicard_label_realize;
- item_class->unrealize = e_minicard_label_unrealize;
- item_class->event = e_minicard_label_event;
-}
-
-static void
-e_minicard_label_init (EMinicardLabel *minicard_label)
-{
- minicard_label->width = 10;
- minicard_label->height = 10;
- minicard_label->rect = NULL;
- minicard_label->fieldname = NULL;
- minicard_label->field = NULL;
-
- minicard_label->max_field_name_length = -1;
-
- e_canvas_item_set_reflow_callback(GNOME_CANVAS_ITEM(minicard_label), e_minicard_label_reflow);
-}
-
-static void
-e_minicard_label_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
-{
- EMinicardLabel *e_minicard_label;
- GnomeCanvasItem *item;
-
- e_minicard_label = E_MINICARD_LABEL (object);
- item = GNOME_CANVAS_ITEM (object);
-
- switch (prop_id){
- case PROP_WIDTH:
- e_minicard_label->width = g_value_get_double (value);
- e_minicard_label_resize_children(e_minicard_label);
- e_canvas_item_request_reflow (item);
- break;
- case PROP_HAS_FOCUS:
- if (e_minicard_label->field && (g_value_get_boolean (value) != E_FOCUS_NONE))
- e_canvas_item_grab_focus(e_minicard_label->field, FALSE);
- break;
- case PROP_FIELD:
- gnome_canvas_item_set( e_minicard_label->field, "text", g_value_get_string (value), NULL );
- break;
- case PROP_FIELDNAME:
- gnome_canvas_item_set( e_minicard_label->fieldname, "text", g_value_get_string (value), NULL );
- break;
- case PROP_TEXT_MODEL:
- gnome_canvas_item_set( e_minicard_label->field, "model", g_value_get_object (value), NULL);
- break;
- case PROP_MAX_FIELD_NAME_WIDTH:
- e_minicard_label->max_field_name_length = g_value_get_double (value);
- break;
- case PROP_EDITABLE:
- e_minicard_label->editable = g_value_get_boolean (value);
- g_object_set (e_minicard_label->field, "editable", FALSE /* e_minicard_label->editable */, NULL);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-e_minicard_label_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
-{
- EMinicardLabel *e_minicard_label;
-
- e_minicard_label = E_MINICARD_LABEL (object);
-
- switch (prop_id) {
- case PROP_WIDTH:
- g_value_set_double (value, e_minicard_label->width);
- break;
- case PROP_HEIGHT:
- g_value_set_double (value, e_minicard_label->height);
- break;
- case PROP_HAS_FOCUS:
- g_value_set_boolean (value, e_minicard_label->has_focus ? E_FOCUS_CURRENT : E_FOCUS_NONE);
- break;
- case PROP_FIELD:
- g_object_get_property (G_OBJECT (e_minicard_label->field),
- "text", value);
- break;
- case PROP_FIELDNAME:
- g_object_get_property (G_OBJECT (e_minicard_label->fieldname),
- "text", value);
- break;
- case PROP_TEXT_MODEL:
- g_object_get_property (G_OBJECT (e_minicard_label->field),
- "model", value);
- break;
- case PROP_MAX_FIELD_NAME_WIDTH:
- g_value_set_double (value, e_minicard_label->max_field_name_length);
- break;
- case PROP_EDITABLE:
- g_value_set_boolean (value, e_minicard_label->editable);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-e_minicard_label_realize (GnomeCanvasItem *item)
-{
- EMinicardLabel *e_minicard_label;
- GnomeCanvasGroup *group;
-
- e_minicard_label = E_MINICARD_LABEL (item);
- group = GNOME_CANVAS_GROUP( item );
-
- if (GNOME_CANVAS_ITEM_CLASS( parent_class )->realize)
- (* GNOME_CANVAS_ITEM_CLASS( parent_class )->realize) (item);
-
- e_canvas_item_request_reflow(item);
-
- e_minicard_label->rect =
- gnome_canvas_item_new( group,
- gnome_canvas_rect_get_type(),
- "x1", (double) 0,
- "y1", (double) 0,
- "x2", (double) e_minicard_label->width - 1,
- "y2", (double) e_minicard_label->height - 1,
- "outline_color", NULL,
- NULL );
- e_minicard_label->fieldname =
- gnome_canvas_item_new( group,
- e_text_get_type(),
- "anchor", GTK_ANCHOR_NW,
- "clip_width", (double) ( e_minicard_label->width / 2 - 4 ),
- "clip", TRUE,
- "use_ellipsis", TRUE,
- "fill_color", "black",
- "draw_background", FALSE,
- "im_context", E_CANVAS (item->canvas)->im_context,
- NULL );
- e_canvas_item_move_absolute(e_minicard_label->fieldname, 2, 1);
-
- e_minicard_label->field =
- gnome_canvas_item_new( group,
- e_text_get_type(),
- "anchor", GTK_ANCHOR_NW,
- "clip_width", (double) ( ( e_minicard_label->width + 1 ) / 2 - 4 ),
- "clip", TRUE,
- "use_ellipsis", TRUE,
- "fill_color", "black",
- "editable", FALSE, /* e_minicard_label->editable, */
- "draw_background", FALSE,
- "im_context", E_CANVAS (item->canvas)->im_context,
- NULL );
- e_canvas_item_move_absolute(e_minicard_label->field, ( e_minicard_label->width / 2 + 2), 1);
-
- set_colors (e_minicard_label);
-
- e_canvas_item_request_reflow(item);
-}
-
-static void
-e_minicard_label_unrealize (GnomeCanvasItem *item)
-{
- EMinicardLabel *e_minicard_label;
-
- e_minicard_label = E_MINICARD_LABEL (item);
-
- if (GNOME_CANVAS_ITEM_CLASS( parent_class )->unrealize)
- (* GNOME_CANVAS_ITEM_CLASS( parent_class )->unrealize) (item);
-}
-
-static gboolean
-e_minicard_label_event (GnomeCanvasItem *item, GdkEvent *event)
-{
- EMinicardLabel *e_minicard_label;
-
- e_minicard_label = E_MINICARD_LABEL (item);
-
- switch( event->type ) {
- case GDK_KEY_PRESS:
- if (event->key.keyval == GDK_Escape) {
- GnomeCanvasItem *parent;
-
- e_text_cancel_editing (E_TEXT (e_minicard_label->field));
-
- parent = GNOME_CANVAS_ITEM (e_minicard_label)->parent;
- if (parent)
- e_canvas_item_grab_focus(parent, FALSE);
- }
- break;
- case GDK_FOCUS_CHANGE: {
- GdkEventFocus *focus_event = (GdkEventFocus *) event;
-
- e_minicard_label->has_focus = focus_event->in;
- set_colors (e_minicard_label);
-
- g_object_set (e_minicard_label->field,
- "handle_popup", e_minicard_label->has_focus,
- NULL);
- break;
- }
- case GDK_BUTTON_PRESS:
- case GDK_BUTTON_RELEASE:
- case GDK_MOTION_NOTIFY:
- case GDK_ENTER_NOTIFY:
- case GDK_LEAVE_NOTIFY: {
- gboolean return_val;
- g_signal_emit_by_name(e_minicard_label->field, "event", event, &return_val);
- return return_val;
- }
- default:
- break;
- }
-
- if (GNOME_CANVAS_ITEM_CLASS( parent_class )->event)
- return (* GNOME_CANVAS_ITEM_CLASS( parent_class )->event) (item, event);
- else
- return 0;
-}
-
-static void
-e_minicard_label_resize_children(EMinicardLabel *e_minicard_label)
-{
- double left_width;
- if (e_minicard_label->max_field_name_length != -1 && ((e_minicard_label->width / 2) - 4 > e_minicard_label->max_field_name_length))
- left_width = e_minicard_label->max_field_name_length;
- else
- left_width = e_minicard_label->width / 2 - 4;
-
- gnome_canvas_item_set( e_minicard_label->fieldname,
- "clip_width", (double) MAX ( left_width, 0 ),
- NULL );
- gnome_canvas_item_set( e_minicard_label->field,
- "clip_width", (double) MAX ( e_minicard_label->width - 8 - left_width, 0 ),
- NULL );
-}
-
-static void
-set_colors (EMinicardLabel *label)
-{
- if ( (GTK_OBJECT_FLAGS( label ) & GNOME_CANVAS_ITEM_REALIZED) ) {
- GtkWidget *canvas = GTK_WIDGET (GNOME_CANVAS_ITEM (label)->canvas);
- GtkStyle *style = gtk_widget_get_style (canvas);
- if (label->has_focus) {
- gnome_canvas_item_set (label->rect,
- "outline_color_gdk", &style->mid[GTK_STATE_SELECTED],
- "fill_color_gdk", &style->bg[GTK_STATE_NORMAL],
- NULL);
-
- gnome_canvas_item_set (label->field,
- "fill_color_gdk", &canvas->style->text[GTK_STATE_NORMAL],
- NULL);
-
- gnome_canvas_item_set (label->fieldname,
- "fill_color_gdk", &canvas->style->text[GTK_STATE_NORMAL],
- NULL);
- }
- else {
- gnome_canvas_item_set (label->rect,
- "outline_color_gdk", NULL,
- "fill_color_gdk", NULL,
- NULL);
-
- gnome_canvas_item_set (label->field,
- "fill_color_gdk", &canvas->style->text[GTK_STATE_NORMAL],
- NULL);
-
- gnome_canvas_item_set (label->fieldname,
- "fill_color_gdk", &canvas->style->text[GTK_STATE_NORMAL],
- NULL);
- }
- }
-}
-
-static void
-e_minicard_label_style_set (EMinicardLabel *label, GtkStyle *previous_style)
-{
- set_colors (label);
-}
-
-static void
-e_minicard_label_reflow(GnomeCanvasItem *item, int flags)
-{
- EMinicardLabel *e_minicard_label = E_MINICARD_LABEL(item);
-
- gint old_height;
- gdouble text_height;
- gdouble left_width;
-
- old_height = e_minicard_label->height;
-
- g_object_get(e_minicard_label->fieldname,
- "text_height", &text_height,
- NULL);
-
- e_minicard_label->height = text_height;
-
-
- g_object_get(e_minicard_label->field,
- "text_height", &text_height,
- NULL);
-
- if (e_minicard_label->height < text_height)
- e_minicard_label->height = text_height;
- e_minicard_label->height += 3;
-
- gnome_canvas_item_set( e_minicard_label->rect,
- "x2", (double) e_minicard_label->width - 1,
- "y2", (double) e_minicard_label->height - 1,
- NULL );
-
- gnome_canvas_item_set( e_minicard_label->fieldname,
- "clip_height", (double) e_minicard_label->height - 3,
- NULL );
-
- if (e_minicard_label->max_field_name_length != -1 && ((e_minicard_label->width / 2) - 4 > e_minicard_label->max_field_name_length))
- left_width = e_minicard_label->max_field_name_length;
- else
- left_width = e_minicard_label->width / 2 - 4;
-
- e_canvas_item_move_absolute(e_minicard_label->field, left_width + 6, 1);
-
- if (old_height != e_minicard_label->height)
- e_canvas_item_request_parent_reflow(item);
-}
-
-GnomeCanvasItem *
-e_minicard_label_new(GnomeCanvasGroup *parent)
-{
- GnomeCanvasItem *item = gnome_canvas_item_new(parent, e_minicard_label_get_type(), NULL);
- return item;
-}
-
diff --git a/addressbook/gui/widgets/e-minicard-label.h b/addressbook/gui/widgets/e-minicard-label.h
deleted file mode 100644
index d914cb30bb..0000000000
--- a/addressbook/gui/widgets/e-minicard-label.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* e-minicard-label.h
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-#ifndef __E_MINICARD_LABEL_H__
-#define __E_MINICARD_LABEL_H__
-
-#include <glib.h>
-#include <libgnomecanvas/gnome-canvas.h>
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-/* EMinicardLabel - A label doing focus with non-marching ants.
- *
- * The following arguments are available:
- *
- * name type read/write description
- * --------------------------------------------------------------------------------
- * width double RW width of the label
- * height double R height of the label
- * field string RW text in the field label
- * fieldname string RW text in the fieldname label
- */
-
-#define E_TYPE_MINICARD_LABEL (e_minicard_label_get_type ())
-#define E_MINICARD_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_MINICARD_LABEL, EMinicardLabel))
-#define E_MINICARD_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_MINICARD_LABEL, EMiniCardLabelClass))
-#define E_IS_MINICARD_LABEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_MINICARD_LABEL))
-#define E_IS_MINICARD_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_MINICARD_LABEL))
-
-
-typedef struct _EMinicardLabel EMinicardLabel;
-typedef struct _EMinicardLabelClass EMinicardLabelClass;
-
-struct _EMinicardLabel
-{
- GnomeCanvasGroup parent;
-
- /* item specific fields */
- double width;
- double height;
- double max_field_name_length;
- guint editable : 1;
- GnomeCanvasItem *fieldname;
- GnomeCanvasItem *field;
- GnomeCanvasItem *rect;
-
- gboolean has_focus;
-};
-
-struct _EMinicardLabelClass
-{
- GnomeCanvasGroupClass parent_class;
-
- void (* style_set) (EMinicardLabel *label, GtkStyle *previous_style);
-};
-
-
-GType e_minicard_label_get_type (void);
-GnomeCanvasItem *e_minicard_label_new(GnomeCanvasGroup *parent);
-void e_minicard_label_construct (GnomeCanvasItem *item);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* __E_MINICARD_LABEL_H__ */
diff --git a/addressbook/gui/widgets/e-minicard-view-widget.c b/addressbook/gui/widgets/e-minicard-view-widget.c
deleted file mode 100644
index ff1bdc1f06..0000000000
--- a/addressbook/gui/widgets/e-minicard-view-widget.c
+++ /dev/null
@@ -1,440 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-minicard-view-widget.c
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-
-#include <gtk/gtksignal.h>
-#include <gal/widgets/e-canvas-background.h>
-#include <gal/widgets/e-canvas.h>
-#include <libgnome/gnome-i18n.h>
-
-#include "eab-marshal.h"
-#include "e-minicard-view-widget.h"
-
-static void e_minicard_view_widget_init (EMinicardViewWidget *widget);
-static void e_minicard_view_widget_class_init (EMinicardViewWidgetClass *klass);
-static void e_minicard_view_widget_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static void e_minicard_view_widget_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
-static void e_minicard_view_widget_dispose (GObject *object);
-static void e_minicard_view_widget_reflow (ECanvas *canvas);
-static void e_minicard_view_widget_size_allocate (GtkWidget *widget, GtkAllocation *allocation);
-static void e_minicard_view_widget_style_set (GtkWidget *widget, GtkStyle *previous_style);
-static void e_minicard_view_widget_realize (GtkWidget *widget);
-
-static ECanvasClass *parent_class = NULL;
-
-/* The arguments we take */
-enum {
- PROP_0,
- PROP_BOOK,
- PROP_QUERY,
- PROP_EDITABLE,
- PROP_COLUMN_WIDTH
-};
-
-enum {
- SELECTION_CHANGE,
- COLUMN_WIDTH_CHANGED,
- RIGHT_CLICK,
- LAST_SIGNAL
-};
-
-static guint signals [LAST_SIGNAL] = {0, };
-
-GType
-e_minicard_view_widget_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (EMinicardViewWidgetClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_minicard_view_widget_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EMinicardViewWidget),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_minicard_view_widget_init,
- };
-
- type = g_type_register_static (e_canvas_get_type (), "EMinicardViewWidget", &info, 0);
- }
-
- return type;
-}
-
-static void
-e_minicard_view_widget_class_init (EMinicardViewWidgetClass *klass)
-{
- GObjectClass *object_class;
- GtkWidgetClass *widget_class;
- ECanvasClass *canvas_class;
-
- object_class = (GObjectClass*) klass;
- widget_class = GTK_WIDGET_CLASS (klass);
- canvas_class = E_CANVAS_CLASS (klass);
-
- parent_class = gtk_type_class (e_canvas_get_type ());
-
- object_class->set_property = e_minicard_view_widget_set_property;
- object_class->get_property = e_minicard_view_widget_get_property;
- object_class->dispose = e_minicard_view_widget_dispose;
-
- g_object_class_install_property (object_class, PROP_BOOK,
- g_param_spec_object ("book",
- _("Book"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_BOOK,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_QUERY,
- g_param_spec_string ("query",
- _("Query"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_EDITABLE,
- g_param_spec_boolean ("editable",
- _("Editable"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_COLUMN_WIDTH,
- g_param_spec_double ("column_width",
- _("Column Width"),
- /*_( */"XXX blurb" /*)*/,
- 0.0, G_MAXDOUBLE, 150.0,
- G_PARAM_READWRITE));
-
- signals [SELECTION_CHANGE] =
- g_signal_new ("selection_change",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EMinicardViewWidgetClass, selection_change),
- NULL, NULL,
- eab_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-
- signals [COLUMN_WIDTH_CHANGED] =
- g_signal_new ("column_width_changed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EMinicardViewWidgetClass, column_width_changed),
- NULL, NULL,
- eab_marshal_NONE__DOUBLE,
- G_TYPE_NONE, 1, G_TYPE_DOUBLE);
-
- signals [RIGHT_CLICK] =
- g_signal_new ("right_click",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EMinicardViewWidgetClass, right_click),
- NULL, NULL,
- eab_marshal_INT__POINTER,
- G_TYPE_INT, 1, G_TYPE_POINTER);
-
- widget_class->style_set = e_minicard_view_widget_style_set;
- widget_class->realize = e_minicard_view_widget_realize;
- widget_class->size_allocate = e_minicard_view_widget_size_allocate;
-
- canvas_class->reflow = e_minicard_view_widget_reflow;
-
- klass->selection_change = NULL;
- klass->column_width_changed = NULL;
- klass->right_click = NULL;
-}
-
-static void
-e_minicard_view_widget_init (EMinicardViewWidget *view)
-{
- view->emv = NULL;
-
- view->book = NULL;
- view->query = NULL;
- view->editable = FALSE;
- view->column_width = 150;
-}
-
-GtkWidget *
-e_minicard_view_widget_new (EAddressbookReflowAdapter *adapter)
-{
- EMinicardViewWidget *widget = E_MINICARD_VIEW_WIDGET (g_object_new (e_minicard_view_widget_get_type (), NULL));
-
- widget->adapter = adapter;
- g_object_ref (widget->adapter);
-
- return GTK_WIDGET (widget);
-}
-
-static void
-e_minicard_view_widget_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- EMinicardViewWidget *emvw;
-
- emvw = E_MINICARD_VIEW_WIDGET (object);
-
- switch (prop_id){
- case PROP_BOOK:
- if (emvw->book)
- g_object_unref (emvw->book);
- if (g_value_get_object (value)) {
- emvw->book = E_BOOK(g_value_get_object (value));
- if (emvw->book)
- g_object_ref(emvw->book);
- } else
- emvw->book = NULL;
- if (emvw->emv)
- g_object_set(emvw->emv,
- "book", emvw->book,
- NULL);
- break;
- case PROP_QUERY:
- emvw->query = g_strdup(g_value_get_string (value));
- if (emvw->emv)
- g_object_set(emvw->emv,
- "query", emvw->query,
- NULL);
- break;
- case PROP_EDITABLE:
- emvw->editable = g_value_get_boolean (value);
- if (emvw->emv)
- g_object_set (emvw->emv,
- "editable", emvw->editable,
- NULL);
- break;
- case PROP_COLUMN_WIDTH:
- emvw->column_width = g_value_get_double (value);
- if (emvw->emv) {
- g_object_set (emvw->emv,
- "column_width", emvw->column_width,
- NULL);
- }
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-e_minicard_view_widget_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- EMinicardViewWidget *emvw;
-
- emvw = E_MINICARD_VIEW_WIDGET (object);
-
- switch (prop_id) {
- case PROP_BOOK:
- g_value_set_object (value, emvw->book);
- break;
- case PROP_QUERY:
- g_value_set_string (value, emvw->query);
- break;
- case PROP_EDITABLE:
- g_value_set_boolean (value, emvw->editable);
- break;
- case PROP_COLUMN_WIDTH:
- g_value_set_double (value, emvw->column_width);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-e_minicard_view_widget_dispose (GObject *object)
-{
- EMinicardViewWidget *view = E_MINICARD_VIEW_WIDGET(object);
-
- if (view->book) {
- g_object_unref (view->book);
- view->book = NULL;
- }
- if (view->query) {
- g_free(view->query);
- view->query = NULL;
- }
-
- if (view->adapter) {
- g_object_unref (view->adapter);
- view->adapter = NULL;
- }
-
- if (G_OBJECT_CLASS(parent_class)->dispose)
- G_OBJECT_CLASS(parent_class)->dispose (object);
-}
-
-static void
-selection_change (ESelectionModel *esm, EMinicardViewWidget *widget)
-{
- g_signal_emit (widget,
- signals [SELECTION_CHANGE], 0);
-}
-
-static void
-selection_row_change (ESelectionModel *esm, int row, EMinicardViewWidget *widget)
-{
- gboolean selected = e_selection_model_is_row_selected (esm, row);
-
- /* we only handle the selected case here */
- if (!selected)
- return;
-
- selection_change (esm, widget);
-}
-
-static void
-column_width_changed (ESelectionModel *esm, double width, EMinicardViewWidget *widget)
-{
- g_signal_emit (widget,
- signals [COLUMN_WIDTH_CHANGED], 0, width);
-}
-
-static guint
-right_click (EMinicardView *view, GdkEvent *event, EMinicardViewWidget *widget)
-{
- guint ret_val;
- g_signal_emit (widget,
- signals [RIGHT_CLICK], 0,
- event, &ret_val);
- return ret_val;
-}
-
-static void
-e_minicard_view_widget_style_set (GtkWidget *widget, GtkStyle *previous_style)
-{
- EMinicardViewWidget *view = E_MINICARD_VIEW_WIDGET(widget);
-
- if (view->background)
- gnome_canvas_item_set (view->background,
- "fill_color_gdk", &widget->style->base[GTK_STATE_NORMAL],
- NULL );
-
- if (GTK_WIDGET_CLASS(parent_class)->style_set)
- GTK_WIDGET_CLASS(parent_class)->style_set (widget, previous_style);
-}
-
-
-static void
-e_minicard_view_widget_realize (GtkWidget *widget)
-{
- EMinicardViewWidget *view = E_MINICARD_VIEW_WIDGET(widget);
- GtkStyle *style = gtk_widget_get_style (widget);
-
- view->background = gnome_canvas_item_new(gnome_canvas_root( GNOME_CANVAS(view) ),
- e_canvas_background_get_type(),
- "fill_color_gdk", &style->base[GTK_STATE_NORMAL],
- NULL );
-
- view->emv = gnome_canvas_item_new(
- gnome_canvas_root( GNOME_CANVAS(view) ),
- e_minicard_view_get_type(),
- "height", (double) 100,
- "minimum_width", (double) 100,
- "adapter", view->adapter,
- "column_width", view->column_width,
- NULL );
-
- g_signal_connect (E_REFLOW(view->emv)->selection,
- "selection_changed",
- G_CALLBACK (selection_change), view);
- g_signal_connect (E_REFLOW(view->emv)->selection,
- "selection_row_changed",
- G_CALLBACK (selection_row_change), view);
- g_signal_connect (view->emv,
- "column_width_changed",
- G_CALLBACK (column_width_changed), view);
- g_signal_connect (view->emv,
- "right_click",
- G_CALLBACK (right_click), view);
-
- if (GTK_WIDGET_CLASS(parent_class)->realize)
- GTK_WIDGET_CLASS(parent_class)->realize (widget);
-}
-
-static void
-e_minicard_view_widget_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
-{
- if (GTK_WIDGET_CLASS(parent_class)->size_allocate)
- GTK_WIDGET_CLASS(parent_class)->size_allocate (widget, allocation);
-
- if (GTK_WIDGET_REALIZED(widget)) {
- double width;
- EMinicardViewWidget *view = E_MINICARD_VIEW_WIDGET(widget);
-
- gnome_canvas_item_set( view->emv,
- "height", (double) allocation->height,
- NULL );
- gnome_canvas_item_set( view->emv,
- "minimum_width", (double) allocation->width,
- NULL );
- g_object_get(view->emv,
- "width", &width,
- NULL);
- width = MAX(width, allocation->width);
- gnome_canvas_set_scroll_region (GNOME_CANVAS (view), 0, 0, width - 1, allocation->height - 1);
- }
-}
-
-static void
-e_minicard_view_widget_reflow(ECanvas *canvas)
-{
- double width;
- EMinicardViewWidget *view = E_MINICARD_VIEW_WIDGET(canvas);
-
- if (E_CANVAS_CLASS(parent_class)->reflow)
- E_CANVAS_CLASS(parent_class)->reflow (canvas);
-
- g_object_get(view->emv,
- "width", &width,
- NULL);
- width = MAX(width, GTK_WIDGET(canvas)->allocation.width);
- gnome_canvas_set_scroll_region(GNOME_CANVAS(canvas), 0, 0, width - 1, GTK_WIDGET(canvas)->allocation.height - 1);
-}
-
-ESelectionModel *
-e_minicard_view_widget_get_selection_model (EMinicardViewWidget *view)
-{
- if (view->emv)
- return E_SELECTION_MODEL (E_REFLOW (view->emv)->selection);
- else
- return NULL;
-}
-
-EMinicardView *
-e_minicard_view_widget_get_view (EMinicardViewWidget *view)
-{
- if (view->emv)
- return E_MINICARD_VIEW (view->emv);
- else
- return NULL;
-}
diff --git a/addressbook/gui/widgets/e-minicard-view-widget.h b/addressbook/gui/widgets/e-minicard-view-widget.h
deleted file mode 100644
index ef8401b88c..0000000000
--- a/addressbook/gui/widgets/e-minicard-view-widget.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* e-minicard-view-widget.h
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-#ifndef __E_MINICARD_VIEW_WIDGET_H__
-#define __E_MINICARD_VIEW_WIDGET_H__
-
-#include <gal/widgets/e-canvas.h>
-#include <libebook/e-book.h>
-#include "e-minicard-view.h"
-
-G_BEGIN_DECLS
-
-#define E_TYPE_MINICARD_VIEW_WIDGET (e_minicard_view_widget_get_type ())
-#define E_MINICARD_VIEW_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_MINICARD_VIEW_WIDGET, EMinicardViewWidget))
-#define E_MINICARD_VIEW_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_MINICARD_VIEW_WIDGET, EMinicardViewWidgetClass))
-#define E_IS_MINICARD_VIEW_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_MINICARD_VIEW_WIDGET))
-#define E_IS_MINICARD_VIEW_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_MINICARD_VIEW_WIDGET))
-
-
-typedef struct _EMinicardViewWidget EMinicardViewWidget;
-typedef struct _EMinicardViewWidgetClass EMinicardViewWidgetClass;
-
-struct _EMinicardViewWidget
-{
- ECanvas parent;
-
- GnomeCanvasItem *background;
- GnomeCanvasItem *emv;
-
- EAddressbookReflowAdapter *adapter;
-
- EBook *book;
- char *query;
- guint editable : 1;
-
- double column_width;
-};
-
-struct _EMinicardViewWidgetClass
-{
- ECanvasClass parent_class;
- void (*selection_change) (EMinicardViewWidget *emvw);
- void (*column_width_changed) (EMinicardViewWidget *emvw, double width);
- guint (*right_click) (EMinicardViewWidget *emvw);
-};
-
-
-GType e_minicard_view_widget_get_type (void);
-GtkWidget *e_minicard_view_widget_new (EAddressbookReflowAdapter *adapter);
-
-/* Get parts of the view widget. */
-ESelectionModel *e_minicard_view_widget_get_selection_model (EMinicardViewWidget *view);
-EMinicardView *e_minicard_view_widget_get_view (EMinicardViewWidget *view);
-
-G_END_DECLS
-
-#endif /* __E_MINICARD_VIEW_WIDGET_H__ */
diff --git a/addressbook/gui/widgets/e-minicard-view.c b/addressbook/gui/widgets/e-minicard-view.c
deleted file mode 100644
index 3c588c9ef2..0000000000
--- a/addressbook/gui/widgets/e-minicard-view.c
+++ /dev/null
@@ -1,581 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-minicard-view.c
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-
-#include "e-minicard-view.h"
-
-#include "eab-gui-util.h"
-#include "eab-marshal.h"
-#include "util/eab-book-util.h"
-
-#include <gtk/gtkselection.h>
-#include <gtk/gtkdnd.h>
-#include <gal/widgets/e-canvas.h>
-#include <libgnome/gnome-i18n.h>
-#include <string.h>
-
-static void e_minicard_view_drag_data_get(GtkWidget *widget,
- GdkDragContext *context,
- GtkSelectionData *selection_data,
- guint info,
- guint time,
- EMinicardView *view);
-
-static EReflowClass *parent_class = NULL;
-#define PARENT_TYPE (E_REFLOW_TYPE)
-
-/* The arguments we take */
-enum {
- PROP_0,
- PROP_ADAPTER,
- PROP_BOOK,
- PROP_QUERY,
- PROP_EDITABLE
-};
-
-
-enum {
- RIGHT_CLICK,
- LAST_SIGNAL
-};
-
-static guint signals [LAST_SIGNAL] = {0, };
-
-enum DndTargetType {
- DND_TARGET_TYPE_VCARD_LIST,
-};
-#define VCARD_LIST_TYPE "text/x-vcard"
-static GtkTargetEntry drag_types[] = {
- { VCARD_LIST_TYPE, 0, DND_TARGET_TYPE_VCARD_LIST }
-};
-static gint num_drag_types = sizeof(drag_types) / sizeof(drag_types[0]);
-
-static void
-e_minicard_view_drag_data_get(GtkWidget *widget,
- GdkDragContext *context,
- GtkSelectionData *selection_data,
- guint info,
- guint time,
- EMinicardView *view)
-{
- if (!E_IS_MINICARD_VIEW(view))
- return;
-
- switch (info) {
- case DND_TARGET_TYPE_VCARD_LIST: {
- char *value;
-
- value = eab_contact_list_to_string (view->drag_list);
-
- gtk_selection_data_set (selection_data,
- selection_data->target,
- 8,
- value, strlen (value));
- break;
- }
- }
-
- g_list_foreach (view->drag_list, (GFunc)g_object_unref, NULL);
- g_list_free (view->drag_list);
- view->drag_list = NULL;
-}
-
-static int
-e_minicard_view_drag_begin (EAddressbookReflowAdapter *adapter, GdkEvent *event, EMinicardView *view)
-{
- GdkDragContext *context;
- GtkTargetList *target_list;
- GdkDragAction actions = GDK_ACTION_MOVE | GDK_ACTION_COPY;
-
- view->drag_list = e_minicard_view_get_card_list (view);
-
- g_print ("dragging %d card(s)\n", g_list_length (view->drag_list));
-
- target_list = gtk_target_list_new (drag_types, num_drag_types);
-
- context = gtk_drag_begin (GTK_WIDGET (GNOME_CANVAS_ITEM (view)->canvas),
- target_list, actions, 1/*XXX*/, event);
-
- if (!view->canvas_drag_data_get_id)
- view->canvas_drag_data_get_id = g_signal_connect (GNOME_CANVAS_ITEM (view)->canvas,
- "drag_data_get",
- G_CALLBACK (e_minicard_view_drag_data_get),
- view);
-
- gtk_drag_set_icon_default (context);
-
- return TRUE;
-}
-
-static void
-set_empty_message (EMinicardView *view)
-{
- char *empty_message;
- gboolean editable = FALSE;
-
- if (view->adapter) {
- g_object_get (view->adapter,
- "editable", &editable,
- NULL);
- }
-
- if (editable)
- empty_message = _("\n\nThere are no items to show in this view.\n\n"
- "Double-click here to create a new Contact.");
- else
- empty_message = _("\n\nThere are no items to show in this view.");
-
- g_object_set (view,
- "empty_message", empty_message,
- NULL);
-}
-
-static void
-writable_status_change (EABModel *model, gboolean writable, EMinicardView *view)
-{
- set_empty_message (view);
-}
-
-static void
-adapter_changed (EMinicardView *view)
-{
- set_empty_message (view);
-
- g_signal_connect (view->adapter, "drag_begin",
- G_CALLBACK (e_minicard_view_drag_begin), view);
-}
-
-static void
-e_minicard_view_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- EMinicardView *view;
-
- view = E_MINICARD_VIEW (object);
-
- switch (prop_id){
- case PROP_ADAPTER:
- if (view->adapter) {
- if (view->writable_status_id) {
- EABModel *model;
- g_object_get (view->adapter,
- "model", &model,
- NULL);
- if (model) {
- g_signal_handler_disconnect (model, view->writable_status_id);
- }
- }
-
- g_object_unref (view->adapter);
- }
- view->writable_status_id = 0;
- view->adapter = g_value_get_object (value);
- g_object_ref (view->adapter);
- adapter_changed (view);
- g_object_set (view,
- "model", view->adapter,
- NULL);
- if (view->adapter) {
- EABModel *model;
- g_object_get (view->adapter,
- "model", &model,
- NULL);
- if (model) {
- view->writable_status_id =
- g_signal_connect (model, "writable_status",
- G_CALLBACK (writable_status_change), view);
- }
-
- }
- break;
- case PROP_BOOK:
- g_object_set (view->adapter,
- "book", g_value_get_object (value),
- NULL);
- set_empty_message (view);
- break;
- case PROP_QUERY:
- g_object_set (view->adapter,
- "query", g_value_get_string (value),
- NULL);
- break;
- case PROP_EDITABLE:
- g_object_set (view->adapter,
- "editable", g_value_get_boolean (value),
- NULL);
- set_empty_message (view);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-e_minicard_view_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- EMinicardView *view;
-
- view = E_MINICARD_VIEW (object);
-
- switch (prop_id) {
- case PROP_ADAPTER:
- g_value_set_object (value, view->adapter);
- break;
- case PROP_BOOK:
- g_object_get_property (G_OBJECT (view->adapter),
- "book", value);
- break;
- case PROP_QUERY:
- g_object_get_property (G_OBJECT (view->adapter),
- "query", value);
- break;
- case PROP_EDITABLE:
- g_object_get_property (G_OBJECT (view->adapter),
- "editable", value);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-e_minicard_view_dispose (GObject *object)
-{
- EMinicardView *view = E_MINICARD_VIEW(object);
-
- if (view->canvas_drag_data_get_id) {
- g_signal_handler_disconnect (GNOME_CANVAS_ITEM (view)->canvas,
- view->canvas_drag_data_get_id);
- view->canvas_drag_data_get_id = 0;
- }
-
- if (view->adapter) {
- if (view->writable_status_id) {
- EABModel *model;
- g_object_get (view->adapter,
- "model", &model,
- NULL);
- if (model) {
- g_signal_handler_disconnect (model, view->writable_status_id);
- }
- }
-
- g_object_unref (view->adapter);
- }
- view->writable_status_id = 0;
- view->adapter = NULL;
-
- if (G_OBJECT_CLASS(parent_class)->dispose)
- G_OBJECT_CLASS(parent_class)->dispose (object);
-}
-
-static guint
-e_minicard_view_right_click (EMinicardView *view, GdkEvent *event)
-{
- guint ret_val = 0;
- g_signal_emit (view, signals[RIGHT_CLICK], 0,
- event, &ret_val);
- return ret_val;
-}
-
-static gboolean
-e_minicard_view_event (GnomeCanvasItem *item, GdkEvent *event)
-{
- EMinicardView *view;
-
- view = E_MINICARD_VIEW (item);
-
- switch( event->type ) {
- case GDK_2BUTTON_PRESS:
- if (((GdkEventButton *)event)->button == 1) {
- gboolean editable;
-
- g_object_get(view->adapter, "editable", &editable, NULL);
-
- if (editable) {
- EBook *book;
- g_object_get(view, "book", &book, NULL);
-
- if (book && E_IS_BOOK (book))
- eab_show_contact_editor (book, e_contact_new(), TRUE, editable);
- }
- return TRUE;
- }
- case GDK_BUTTON_PRESS:
- if (event->button.button == 3) {
- e_minicard_view_right_click (view, event);
- }
- break;
- default:
- break;
- }
-
- if (GNOME_CANVAS_ITEM_CLASS(parent_class)->event)
- return GNOME_CANVAS_ITEM_CLASS(parent_class)->event(item, event);
- else
- return FALSE;
-}
-
-static gint
-e_minicard_view_selection_event (EReflow *reflow, GnomeCanvasItem *item, GdkEvent *event)
-{
- EMinicardView *view;
- int return_val = FALSE;
-
- view = E_MINICARD_VIEW (reflow);
- if (parent_class->selection_event) {
- return_val = parent_class->selection_event (reflow, item, event);
- }
-
- switch (event->type) {
- case GDK_FOCUS_CHANGE:
- if (event->focus_change.in) {
- int i;
- for (i = 0; i < reflow->count; i++) {
- if (reflow->items[i] == item) {
- e_selection_model_maybe_do_something(reflow->selection, i, 0, 0);
- break;
- }
- }
- }
- break;
- case GDK_BUTTON_PRESS:
- if (event->button.button == 3) {
- return_val = e_minicard_view_right_click (view, event);
- if (!return_val)
- e_selection_model_right_click_up(reflow->selection);
- }
- break;
- default:
- break;
- }
- return return_val;
-}
-
-typedef struct {
- EMinicardView *view;
- EBookCallback cb;
- gpointer closure;
-} ViewCbClosure;
-
-static void
-do_remove (int i, gpointer user_data)
-{
- EBook *book;
- EContact *contact;
- ViewCbClosure *viewcbclosure = user_data;
- EMinicardView *view = viewcbclosure->view;
- EBookCallback cb = viewcbclosure->cb;
- gpointer closure = viewcbclosure->closure;
-
- g_object_get (view->adapter,
- "book", &book,
- NULL);
-
- contact = e_addressbook_reflow_adapter_get_contact (view->adapter, i);
-
- e_book_async_remove_contact(book, contact, cb, closure);
-
- g_object_unref (contact);
-}
-
-#if 0
-static int
-compare_to_utf_str (EMinicard *card, const char *utf_str)
-{
- g_return_val_if_fail(card != NULL, 0);
- g_return_val_if_fail(E_IS_MINICARD(card), 0);
-
- if (g_unichar_isdigit (g_utf8_get_char (utf_str))) {
- return 1;
- }
-
- if (card->card) {
- char *file_as;
- g_object_get(card->card,
- "file_as", &file_as,
- NULL);
- if (file_as)
- return g_utf8_strcasecmp (file_as, utf_str);
- else
- return 0;
- } else {
- return 0;
- }
-}
-#endif
-
-static void
-e_minicard_view_class_init (EMinicardViewClass *klass)
-{
- GObjectClass *object_class;
- GnomeCanvasItemClass *item_class;
- EReflowClass *reflow_class;
-
- object_class = G_OBJECT_CLASS (klass);
- item_class = (GnomeCanvasItemClass *) klass;
- reflow_class = (EReflowClass *) klass;
-
- parent_class = g_type_class_peek_parent (klass);
-
- object_class->set_property = e_minicard_view_set_property;
- object_class->get_property = e_minicard_view_get_property;
- object_class->dispose = e_minicard_view_dispose;
-
- g_object_class_install_property (object_class, PROP_ADAPTER,
- g_param_spec_object ("adapter",
- _("Adapter"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_ADDRESSBOOK_REFLOW_ADAPTER,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_BOOK,
- g_param_spec_object ("book",
- _("Book"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_BOOK,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_QUERY,
- g_param_spec_string ("query",
- _("Query"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_EDITABLE,
- g_param_spec_boolean ("editable",
- _("Editable"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- signals [RIGHT_CLICK] =
- g_signal_new ("right_click",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EMinicardViewClass, right_click),
- NULL, NULL,
- eab_marshal_INT__POINTER,
- G_TYPE_INT, 1, G_TYPE_POINTER);
-
- item_class->event = e_minicard_view_event;
-
- reflow_class->selection_event = e_minicard_view_selection_event;
- /* GnomeCanvasItem method overrides */
-}
-
-static void
-e_minicard_view_init (EMinicardView *view)
-{
- view->adapter = NULL;
- view->canvas_drag_data_get_id = 0;
- view->writable_status_id = 0;
-
- set_empty_message (view);
-}
-
-GType
-e_minicard_view_get_type (void)
-{
- static GType reflow_type = 0;
-
- if (!reflow_type) {
- static const GTypeInfo reflow_info = {
- sizeof (EMinicardViewClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_minicard_view_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EMinicardView),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_minicard_view_init,
- };
-
- reflow_type = g_type_register_static (PARENT_TYPE, "EMinicardView", &reflow_info, 0);
- }
-
- return reflow_type;
-}
-
-void
-e_minicard_view_remove_selection(EMinicardView *view,
- EBookCallback cb,
- gpointer closure)
-{
- ViewCbClosure viewcbclosure;
- viewcbclosure.view = view;
- viewcbclosure.cb = cb;
- viewcbclosure.closure = closure;
-
- e_selection_model_foreach (E_REFLOW (view)->selection,
- do_remove,
- &viewcbclosure);
-}
-
-void
-e_minicard_view_jump_to_letter (EMinicardView *view,
- gunichar letter)
-{
-#if 0
- char uft_str[6 + 1];
-
- utf_str [g_unichar_to_utf8 (letter, utf_str)] = '\0';
- e_reflow_sorted_jump (E_REFLOW_SORTED (view),
- (GCompareFunc) compare_to_utf_str,
- utf_str);
-#endif
-}
-
-typedef struct {
- GList *list;
- EAddressbookReflowAdapter *adapter;
-} ModelAndList;
-
-static void
-add_to_list (int index, gpointer closure)
-{
- ModelAndList *mal = closure;
- mal->list = g_list_prepend (mal->list, e_addressbook_reflow_adapter_get_contact (mal->adapter, index));
-}
-
-GList *
-e_minicard_view_get_card_list (EMinicardView *view)
-{
- ModelAndList mal;
-
- mal.adapter = view->adapter;
- mal.list = NULL;
-
- e_selection_model_foreach (E_REFLOW (view)->selection, add_to_list, &mal);
-
- mal.list = g_list_reverse (mal.list);
- return mal.list;
-}
diff --git a/addressbook/gui/widgets/e-minicard-view.h b/addressbook/gui/widgets/e-minicard-view.h
deleted file mode 100644
index 2614b7577a..0000000000
--- a/addressbook/gui/widgets/e-minicard-view.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* e-minicard-view.h
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-#ifndef __E_MINICARD_VIEW_H__
-#define __E_MINICARD_VIEW_H__
-
-#include "e-minicard.h"
-
-#include <gal/widgets/e-reflow.h>
-#include <gal/widgets/e-selection-model-simple.h>
-#include <libebook/e-book.h>
-#include "e-addressbook-reflow-adapter.h"
-
-G_BEGIN_DECLS
-
-/* EMinicardView - A canvas item container.
- *
- * The following arguments are available:
- *
- * name type read/write description
- * --------------------------------------------------------------------------------
- * book EBook RW book to query
- * query string RW query string
- *
- * From EReflowSorted: (you should really know what you're doing if you set these.)
- * compare_func GCompareFunc RW compare function
- * string_func EReflowStringFunc RW string function
- *
- * From EReflow:
- * minimum_width double RW minimum width of the reflow. width >= minimum_width
- * width double R width of the reflow
- * height double RW height of the reflow
- */
-
-#define E_TYPE_MINICARD_VIEW (e_minicard_view_get_type ())
-#define E_MINICARD_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_MINICARD_VIEW, EMinicardView))
-#define E_MINICARD_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_MINICARD_VIEW, EMinicardViewClass))
-#define E_IS_MINICARD_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_MINICARD_VIEW))
-#define E_IS_MINICARD_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_MINICARD_VIEW))
-
-
-typedef struct _EMinicardView EMinicardView;
-typedef struct _EMinicardViewClass EMinicardViewClass;
-
-struct _EMinicardView
-{
- EReflow parent;
-
- EAddressbookReflowAdapter *adapter;
-
- /* item specific fields */
-
- GList *drag_list;
-
- guint canvas_drag_data_get_id;
-
- guint writable_status_id;
-};
-
-struct _EMinicardViewClass
-{
- EReflowClass parent_class;
-
- void (*right_click) (EMinicardView *view, GdkEvent *event);
-};
-
-GType e_minicard_view_get_type (void);
-void e_minicard_view_remove_selection (EMinicardView *view,
- EBookCallback cb,
- gpointer closure);
-void e_minicard_view_jump_to_letter (EMinicardView *view,
- gunichar letter);
-GList *e_minicard_view_get_card_list (EMinicardView *view);
-
-
-G_END_DECLS
-
-#endif /* __E_MINICARD_VIEW_H__ */
diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c
deleted file mode 100644
index 259d2b12f0..0000000000
--- a/addressbook/gui/widgets/e-minicard.c
+++ /dev/null
@@ -1,968 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-minicard.c
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-#include <string.h>
-#include <glib.h>
-#include <gtk/gtkdnd.h>
-#include <gtk/gtkmain.h>
-#include <gdk/gdkkeysyms.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnomecanvas/gnome-canvas-rect-ellipse.h>
-#include <libgnomecanvas/gnome-canvas-pixbuf.h>
-#include <gal/e-text/e-text.h>
-#include <gal/util/e-util.h>
-#include <gal/widgets/e-canvas-utils.h>
-#include <gal/widgets/e-canvas.h>
-#include <libebook/e-book.h>
-#include "eab-marshal.h"
-#include "eab-gui-util.h"
-#include "e-minicard.h"
-#include "e-minicard-label.h"
-#include "e-minicard-view.h"
-#include "e-contact-editor.h"
-#include "util/eab-destination.h"
-
-static void e_minicard_init (EMinicard *card);
-static void e_minicard_class_init (EMinicardClass *klass);
-static void e_minicard_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static void e_minicard_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
-static void e_minicard_dispose (GObject *object);
-static void e_minicard_finalize (GObject *object);
-static gboolean e_minicard_event (GnomeCanvasItem *item, GdkEvent *event);
-static void e_minicard_realize (GnomeCanvasItem *item);
-static void e_minicard_unrealize (GnomeCanvasItem *item);
-static void e_minicard_reflow ( GnomeCanvasItem *item, int flags );
-static void e_minicard_style_set (EMinicard *minicard, GtkStyle *previous_style);
-
-static void e_minicard_resize_children( EMinicard *e_minicard );
-static void remodel( EMinicard *e_minicard );
-
-static gint e_minicard_drag_begin (EMinicard *minicard, GdkEvent *event);
-
-static GnomeCanvasGroupClass *parent_class = NULL;
-
-typedef struct _EMinicardField EMinicardField;
-
-struct _EMinicardField {
- EContactField field;
- GnomeCanvasItem *label;
-};
-
-#define d(x)
-
-#define LIST_ICON_FILENAME "contact-list-16.png"
-
-#define E_MINICARD_FIELD(field) ((EMinicardField *)(field))
-
-static void
-e_minicard_field_destroy(EMinicardField *field)
-{
- gtk_object_destroy(GTK_OBJECT(field->label));
- g_free(field);
-}
-
-/* The arguments we take */
-enum {
- PROP_0,
- PROP_WIDTH,
- PROP_HEIGHT,
- PROP_HAS_FOCUS,
- PROP_SELECTED,
- PROP_HAS_CURSOR,
- PROP_EDITABLE,
- PROP_CONTACT
-};
-
-enum {
- SELECTED,
- DRAG_BEGIN,
- STYLE_SET,
- LAST_SIGNAL
-};
-
-static guint e_minicard_signals [LAST_SIGNAL] = {0, };
-
-GType
-e_minicard_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (EMinicardClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_minicard_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EMinicard),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_minicard_init,
- };
-
- type = g_type_register_static (gnome_canvas_group_get_type (), "EMinicard", &info, 0);
- }
-
- return type;
-}
-
-static void
-e_minicard_class_init (EMinicardClass *klass)
-{
- GObjectClass *object_class = (GObjectClass*) klass;
- GnomeCanvasItemClass *item_class = (GnomeCanvasItemClass *) klass;
-
- object_class->set_property = e_minicard_set_property;
- object_class->get_property = e_minicard_get_property;
- object_class->dispose = e_minicard_dispose;
- object_class->finalize = e_minicard_finalize;
-
- klass->style_set = e_minicard_style_set;
-
- parent_class = gtk_type_class (gnome_canvas_group_get_type ());
-
- g_object_class_install_property (object_class, PROP_WIDTH,
- g_param_spec_double ("width",
- _("Width"),
- /*_( */"XXX blurb" /*)*/,
- 0.0, G_MAXDOUBLE, 10.0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_HEIGHT,
- g_param_spec_double ("height",
- _("Height"),
- /*_( */"XXX blurb" /*)*/,
- 0.0, G_MAXDOUBLE, 10.0,
- G_PARAM_READABLE));
-
- g_object_class_install_property (object_class, PROP_HAS_FOCUS,
- /* XXX should be _enum */
- g_param_spec_int ("has_focus",
- _("Has Focus"),
- /*_( */"XXX blurb" /*)*/,
- E_MINICARD_FOCUS_TYPE_START, E_MINICARD_FOCUS_TYPE_END,
- E_MINICARD_FOCUS_TYPE_START,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_SELECTED,
- g_param_spec_boolean ("selected",
- _("Selected"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_HAS_CURSOR,
- g_param_spec_boolean ("has_cursor",
- _("Has Cursor"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_EDITABLE,
- g_param_spec_boolean ("editable",
- _("Editable"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_CONTACT,
- g_param_spec_object ("contact",
- _("Contact"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_CONTACT,
- G_PARAM_READWRITE));
-
- e_minicard_signals [SELECTED] =
- g_signal_new ("selected",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EMinicardClass, selected),
- NULL, NULL,
- eab_marshal_INT__POINTER,
- G_TYPE_INT, 1, G_TYPE_POINTER);
-
- e_minicard_signals [DRAG_BEGIN] =
- g_signal_new ("drag_begin",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EMinicardClass, drag_begin),
- NULL, NULL,
- eab_marshal_INT__POINTER,
- G_TYPE_INT, 1, G_TYPE_POINTER);
-
- e_minicard_signals [STYLE_SET] =
- g_signal_new ("style_set",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EMinicardClass, style_set),
- NULL, NULL,
- eab_marshal_VOID__OBJECT,
- G_TYPE_NONE, 1,
- GTK_TYPE_STYLE);
-
- /* GnomeCanvasItem method overrides */
- item_class->realize = e_minicard_realize;
- item_class->unrealize = e_minicard_unrealize;
- item_class->event = e_minicard_event;
-
- klass->selected = NULL;
-}
-
-static void
-e_minicard_init (EMinicard *minicard)
-{
- minicard->rect = NULL;
- minicard->fields = NULL;
- minicard->width = 10;
- minicard->height = 10;
- minicard->has_focus = FALSE;
- minicard->selected = FALSE;
- minicard->editable = FALSE;
- minicard->has_cursor = FALSE;
-
- minicard->contact = NULL;
-
- minicard->list_icon_pixbuf = gdk_pixbuf_new_from_file (EVOLUTION_IMAGESDIR "/" LIST_ICON_FILENAME, NULL);
- minicard->list_icon_size = gdk_pixbuf_get_height (minicard->list_icon_pixbuf);
-
- minicard->editor = NULL;
-
- minicard->changed = FALSE;
-
- e_canvas_item_set_reflow_callback(GNOME_CANVAS_ITEM(minicard), e_minicard_reflow);
-}
-
-static void
-set_selected (EMinicard *minicard, gboolean selected)
-{
- GtkWidget *canvas = GTK_WIDGET(GNOME_CANVAS_ITEM(minicard)->canvas);
- if (selected) {
- gnome_canvas_item_set (minicard->rect,
- "outline_color_gdk", &canvas->style->bg[GTK_STATE_ACTIVE],
- NULL);
- gnome_canvas_item_set (minicard->header_rect,
- "fill_color_gdk", &canvas->style->bg[GTK_STATE_SELECTED],
- NULL);
- gnome_canvas_item_set (minicard->header_text,
- "fill_color_gdk", &canvas->style->text[GTK_STATE_SELECTED],
- NULL);
- } else {
- gnome_canvas_item_set (minicard->rect,
- "outline_color", NULL,
- NULL);
- gnome_canvas_item_set (minicard->header_rect,
- "fill_color_gdk", &canvas->style->bg[GTK_STATE_NORMAL],
- NULL);
- gnome_canvas_item_set (minicard->header_text,
- "fill_color_gdk", &canvas->style->text[GTK_STATE_NORMAL],
- NULL);
- }
- minicard->selected = selected;
-}
-
-static void
-set_has_cursor (EMinicard *minicard, gboolean has_cursor)
-{
- if (!minicard->has_focus && has_cursor)
- e_canvas_item_grab_focus(GNOME_CANVAS_ITEM (minicard), FALSE);
- minicard->has_cursor = has_cursor;
-}
-
-
-static void
-e_minicard_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
-{
- GnomeCanvasItem *item;
- EMinicard *e_minicard;
- GList *l;
-
- item = GNOME_CANVAS_ITEM (object);
- e_minicard = E_MINICARD (object);
-
- switch (prop_id){
- case PROP_WIDTH:
- if (e_minicard->width != g_value_get_double (value)) {
- e_minicard->width = g_value_get_double (value);
- e_minicard_resize_children(e_minicard);
- if ( GTK_OBJECT_FLAGS( e_minicard ) & GNOME_CANVAS_ITEM_REALIZED )
- e_canvas_item_request_reflow(item);
- }
- break;
- case PROP_HAS_FOCUS:
- if (e_minicard->fields) {
- if ( g_value_get_int(value) == E_FOCUS_START ||
- g_value_get_int(value) == E_FOCUS_CURRENT) {
- gnome_canvas_item_set(E_MINICARD_FIELD(e_minicard->fields->data)->label,
- "has_focus", g_value_get_int (value),
- NULL);
- } else if ( g_value_get_int (value) == E_FOCUS_END ) {
- gnome_canvas_item_set(E_MINICARD_FIELD(g_list_last(e_minicard->fields)->data)->label,
- "has_focus", g_value_get_int (value),
- NULL);
- }
- }
- else {
- if (!e_minicard->has_focus)
- e_canvas_item_grab_focus(item, FALSE);
- }
- break;
- case PROP_SELECTED:
- if (e_minicard->selected != g_value_get_boolean (value))
- set_selected (e_minicard, g_value_get_boolean (value));
- break;
- case PROP_EDITABLE:
- e_minicard->editable = g_value_get_boolean (value);
- for (l = e_minicard->fields; l; l = l->next) {
- g_object_set (E_MINICARD_FIELD (l->data)->label,
- "editable", FALSE /* e_minicard->editable */,
- NULL);
- }
- break;
- case PROP_HAS_CURSOR:
- d(g_print("%s: PROP_HAS_CURSOR\n", G_GNUC_FUNCTION));
- if (e_minicard->has_cursor != g_value_get_boolean (value))
- set_has_cursor (e_minicard, g_value_get_boolean (value));
- break;
- case PROP_CONTACT:
- if (e_minicard->contact)
- g_object_unref (e_minicard->contact);
- e_minicard->contact = E_CONTACT(g_value_get_object (value));
- if (e_minicard->contact)
- g_object_ref (e_minicard->contact);
- remodel(e_minicard);
- e_canvas_item_request_reflow(item);
- e_minicard->changed = FALSE;
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-e_minicard_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
-{
- EMinicard *e_minicard;
-
- e_minicard = E_MINICARD (object);
-
- switch (prop_id) {
- case PROP_WIDTH:
- g_value_set_double (value, e_minicard->width);
- break;
- case PROP_HEIGHT:
- g_value_set_double (value, e_minicard->height);
- break;
- case PROP_HAS_FOCUS:
- g_value_set_int (value, e_minicard->has_focus ? E_FOCUS_CURRENT : E_FOCUS_NONE);
- break;
- case PROP_SELECTED:
- g_value_set_boolean (value, e_minicard->selected);
- break;
- case PROP_HAS_CURSOR:
- g_value_set_boolean (value, e_minicard->has_cursor);
- break;
- case PROP_EDITABLE:
- g_value_set_boolean (value, e_minicard->editable);
- break;
- case PROP_CONTACT:
- g_value_set_object (value, e_minicard->contact);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-e_minicard_dispose (GObject *object)
-{
- EMinicard *e_minicard;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (E_IS_MINICARD (object));
-
- e_minicard = E_MINICARD (object);
-
- if (e_minicard->fields) {
- g_list_foreach(e_minicard->fields, (GFunc) e_minicard_field_destroy, NULL);
- g_list_free(e_minicard->fields);
- e_minicard->fields = NULL;
- }
-
- if (e_minicard->list_icon_pixbuf) {
- gdk_pixbuf_unref (e_minicard->list_icon_pixbuf);
- e_minicard->list_icon_pixbuf = NULL;
- }
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- (* G_OBJECT_CLASS (parent_class)->dispose) (object);
-}
-
-
-
-static void
-e_minicard_finalize (GObject *object)
-{
- EMinicard *e_minicard;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (E_IS_MINICARD (object));
-
- e_minicard = E_MINICARD (object);
-
- if (e_minicard->contact)
- g_object_unref (e_minicard->contact);
-
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
-}
-
-static void
-e_minicard_style_set (EMinicard *minicard, GtkStyle *previous_style)
-{
- if ( (GTK_OBJECT_FLAGS( minicard ) & GNOME_CANVAS_ITEM_REALIZED) )
- set_selected (minicard, minicard->selected);
-}
-
-static void
-e_minicard_realize (GnomeCanvasItem *item)
-{
- EMinicard *e_minicard;
- GnomeCanvasGroup *group;
- GtkWidget *canvas;
-
- e_minicard = E_MINICARD (item);
- group = GNOME_CANVAS_GROUP( item );
- canvas = GTK_WIDGET (GNOME_CANVAS_ITEM (item)->canvas);
-
- if (GNOME_CANVAS_ITEM_CLASS(parent_class)->realize)
- (* GNOME_CANVAS_ITEM_CLASS(parent_class)->realize) (item);
-
- e_minicard->rect =
- gnome_canvas_item_new( group,
- gnome_canvas_rect_get_type(),
- "x1", (double) 0,
- "y1", (double) 0,
- "x2", (double) MAX (e_minicard->width - 1, 0),
- "y2", (double) MAX (e_minicard->height - 1, 0),
- "outline_color", NULL,
- NULL );
-
- e_minicard->header_rect =
- gnome_canvas_item_new( group,
- gnome_canvas_rect_get_type(),
- "x1", (double) 2,
- "y1", (double) 2,
- "x2", (double) MAX (e_minicard->width - 3, 0),
- "y2", (double) MAX (e_minicard->height - 3, 0),
- "fill_color_gdk", &canvas->style->bg[GTK_STATE_NORMAL],
- NULL );
-
- e_minicard->header_text =
- gnome_canvas_item_new( group,
- e_text_get_type(),
- "anchor", GTK_ANCHOR_NW,
- "width", (double) MAX( e_minicard->width - 12, 0 ),
- "clip", TRUE,
- "use_ellipsis", TRUE,
- "fill_color_gdk", &canvas->style->fg[GTK_STATE_NORMAL],
- "text", "",
- "draw_background", FALSE,
- NULL );
-
- e_canvas_item_move_absolute(e_minicard->header_text, 6, 6);
-
- e_minicard->list_icon =
- gnome_canvas_item_new ( group,
- gnome_canvas_pixbuf_get_type(),
- "pixbuf", e_minicard->list_icon_pixbuf,
- NULL);
-
- set_selected (e_minicard, e_minicard->selected);
-
- remodel(e_minicard);
- e_canvas_item_request_reflow(item);
-}
-
-static void
-e_minicard_unrealize (GnomeCanvasItem *item)
-{
- EMinicard *e_minicard;
-
- e_minicard = E_MINICARD (item);
-
- if (GNOME_CANVAS_ITEM_CLASS(parent_class)->unrealize)
- (* GNOME_CANVAS_ITEM_CLASS(parent_class)->unrealize) (item);
-}
-
-/* Callback used when the contact editor is closed */
-static void
-editor_closed_cb (GtkObject *editor, gpointer data)
-{
- EMinicard *minicard = data;
- g_object_unref (editor);
- minicard->editor = NULL;
-}
-
-static gboolean
-e_minicard_event (GnomeCanvasItem *item, GdkEvent *event)
-{
- EMinicard *e_minicard;
- GtkWidget *canvas;
-
- e_minicard = E_MINICARD (item);
- canvas = GTK_WIDGET (GNOME_CANVAS_ITEM (item)->canvas);
-
- switch( event->type ) {
- case GDK_FOCUS_CHANGE:
- {
- GdkEventFocus *focus_event = (GdkEventFocus *) event;
- d(g_print("%s: GDK_FOCUS_CHANGE: %s\n", G_GNUC_FUNCTION, focus_event->in?"in":"out"));
- if (focus_event->in) {
- /* Chris: When EMinicard gets the cursor, if it doesn't have the focus, it should take it. */
- e_minicard->has_focus = TRUE;
- if (!e_minicard->selected) {
- e_minicard_selected(e_minicard, event);
- }
- }
- else {
- e_minicard->has_focus = FALSE;
- }
- }
- break;
- case GDK_BUTTON_PRESS: {
- if (1 <= event->button.button && event->button.button <= 2) {
- int ret_val = e_minicard_selected(e_minicard, event);
- GdkEventMask mask = ((1 << (4 + event->button.button)) |
- GDK_POINTER_MOTION_MASK |
- GDK_BUTTON_PRESS_MASK |
- GDK_BUTTON_RELEASE_MASK);
-
- e_canvas_item_grab_focus(item, TRUE);
-
- if (gnome_canvas_item_grab (GNOME_CANVAS_ITEM (e_minicard),
- mask, NULL, event->button.time)) {
- return FALSE;
- }
- gtk_grab_add (GTK_WIDGET (GNOME_CANVAS_ITEM (e_minicard)->canvas));
- e_minicard->button_x = event->button.x;
- e_minicard->button_y = event->button.y;
- e_minicard->drag_button = event->button.button;
- e_minicard->drag_button_down = TRUE;
- return ret_val;
- } else if (event->button.button == 3) {
- int ret_val = e_minicard_selected(e_minicard, event);
- if (ret_val != 0)
- return ret_val;
- }
- break;
- }
- case GDK_BUTTON_RELEASE:
- e_minicard_selected(e_minicard, event);
- if (e_minicard->drag_button == event->button.button) {
- e_minicard->drag_button = 0;
- e_minicard->drag_button_down = FALSE;
- e_minicard->button_x = -1;
- e_minicard->button_y = -1;
-
- if (GTK_WIDGET_HAS_GRAB (GNOME_CANVAS_ITEM (e_minicard)->canvas)) {
- gtk_grab_remove (GTK_WIDGET (GNOME_CANVAS_ITEM (e_minicard)->canvas));
- gnome_canvas_item_ungrab (GNOME_CANVAS_ITEM (e_minicard), event->button.time);
- }
- }
- break;
- case GDK_MOTION_NOTIFY:
- if (e_minicard->drag_button_down && event->motion.state & GDK_BUTTON1_MASK) {
- if (MAX (abs (e_minicard->button_x - event->motion.x),
- abs (e_minicard->button_y - event->motion.y)) > 3) {
- gint ret_val;
-
- ret_val = e_minicard_drag_begin(e_minicard, event);
-
- e_minicard->drag_button_down = FALSE;
-
- return ret_val;
- }
- }
- break;
- case GDK_2BUTTON_PRESS:
- if (event->button.button == 1 && E_IS_MINICARD_VIEW(item->parent)) {
- if (e_minicard->editor) {
- if (GPOINTER_TO_INT (e_contact_get (e_minicard->contact, E_CONTACT_IS_LIST)))
- e_contact_list_editor_raise (E_CONTACT_LIST_EDITOR(e_minicard->editor));
- else
- e_contact_editor_raise(E_CONTACT_EDITOR(e_minicard->editor));
- } else {
- EBook *book = NULL;
- if (E_IS_MINICARD_VIEW(item->parent)) {
- g_object_get(item->parent,
- "book", &book,
- NULL);
- }
-
- if (book != NULL) {
- if (e_contact_get (e_minicard->contact, E_CONTACT_IS_LIST)) {
- EContactListEditor *editor = eab_show_contact_list_editor (book, e_minicard->contact,
- FALSE, e_minicard->editable);
- e_minicard->editor = G_OBJECT (editor);
- }
- else {
- EContactEditor *editor = eab_show_contact_editor (book, e_minicard->contact,
- FALSE, e_minicard->editable);
- e_minicard->editor = G_OBJECT (editor);
- }
- g_object_ref (e_minicard->editor);
-
- g_signal_connect (e_minicard->editor, "editor_closed",
- G_CALLBACK (editor_closed_cb), e_minicard);
-
- g_object_unref (book);
- }
- }
- return TRUE;
- }
- break;
- default:
- break;
- }
-
- if (GNOME_CANVAS_ITEM_CLASS( parent_class )->event)
- return (* GNOME_CANVAS_ITEM_CLASS( parent_class )->event) (item, event);
- else
- return 0;
-}
-
-static void
-e_minicard_resize_children( EMinicard *e_minicard )
-{
- GList *list;
- gboolean is_list = GPOINTER_TO_INT (e_contact_get (e_minicard->contact, E_CONTACT_IS_LIST));
-
- if (e_minicard->header_text) {
- gnome_canvas_item_set( e_minicard->header_text,
- "width", ((double) e_minicard->width - 12
- - (is_list ? e_minicard->list_icon_size : 0.0)),
- NULL );
- }
- if (e_minicard->list_icon) {
- e_canvas_item_move_absolute(e_minicard->list_icon,
- e_minicard->width - e_minicard->list_icon_size - 3,
- 3);
- }
- for ( list = e_minicard->fields; list; list = g_list_next( list ) ) {
- gnome_canvas_item_set( E_MINICARD_FIELD( list->data )->label,
- "width", (double) e_minicard->width - 4.0,
- NULL );
- }
-}
-
-static void
-add_field (EMinicard *e_minicard, EContactField field, gdouble left_width)
-{
- GnomeCanvasItem *new_item;
- GnomeCanvasGroup *group;
- EMinicardField *minicard_field;
- char *name;
- char *string;
-
- group = GNOME_CANVAS_GROUP( e_minicard );
-
- name = g_strdup_printf("%s:", e_contact_pretty_name (field));
- string = e_contact_get (e_minicard->contact, field);
-
- /* Magically convert embedded XML into an address. */
- if (!strncmp (string, "<?xml", 5)) {
- EABDestination *dest = eab_destination_import (string);
- if (dest != NULL) {
- gchar *new_string = g_strdup (eab_destination_get_textrep (dest, TRUE));
- g_free (string);
- string = new_string;
- g_object_unref (dest);
- }
- }
-
- new_item = e_minicard_label_new(group);
- gnome_canvas_item_set( new_item,
- "width", e_minicard->width - 4.0,
- "fieldname", name,
- "field", string,
- "max_field_name_length", left_width,
- "editable", FALSE /* e_minicard->editable */,
- NULL );
-#if notyet
- g_object_set(E_MINICARD_LABEL(new_item)->field,
- "allow_newlines", e_card_simple_get_allow_newlines (e_minicard->contact, field),
- NULL);
-#endif
- g_object_set_data(G_OBJECT (E_MINICARD_LABEL(new_item)->field),
- "EMinicard:field",
- GINT_TO_POINTER(field));
-
- minicard_field = g_new(EMinicardField, 1);
- minicard_field->field = field;
- minicard_field->label = new_item;
-
- e_minicard->fields = g_list_append( e_minicard->fields, minicard_field);
- e_canvas_item_move_absolute(new_item, 2, e_minicard->height);
- g_free(name);
- g_free(string);
-}
-
-static int
-get_left_width(EMinicard *e_minicard)
-{
- gchar *name;
- EContactField field;
- int width = -1;
- PangoLayout *layout;
-
- layout = gtk_widget_create_pango_layout (GTK_WIDGET (GNOME_CANVAS_ITEM (e_minicard)->canvas), "");
- for(field = E_CONTACT_FULL_NAME; field != E_CONTACT_LAST_SIMPLE_STRING; field++) {
- int this_width;
-
- if (field == E_CONTACT_FAMILY_NAME || field == E_CONTACT_GIVEN_NAME)
- continue;
-
- name = g_strdup_printf("%s:", e_contact_pretty_name (field));
- pango_layout_set_text (layout, name, -1);
- pango_layout_get_pixel_size (layout, &this_width, NULL);
- if (width < this_width)
- width = this_width;
- g_free(name);
- }
- g_object_unref (layout);
- return width;
-}
-
-static void
-remodel( EMinicard *e_minicard )
-{
- int count = 0;
- if ( !(GTK_OBJECT_FLAGS( e_minicard ) & GNOME_CANVAS_ITEM_REALIZED) )
- return;
- if (e_minicard->contact) {
- EContactField field;
- GList *list;
- char *file_as;
- int left_width = -1;
-
- if (e_minicard->header_text) {
- file_as = e_contact_get (e_minicard->contact, E_CONTACT_FILE_AS);
- gnome_canvas_item_set (e_minicard->header_text,
- "text", file_as ? file_as : "",
- NULL );
- g_free(file_as);
- }
-
- if (e_minicard->contact && e_contact_get (e_minicard->contact, E_CONTACT_IS_LIST))
- gnome_canvas_item_show (e_minicard->list_icon);
- else
- gnome_canvas_item_hide (e_minicard->list_icon);
-
- list = e_minicard->fields;
- e_minicard->fields = NULL;
-
- for(field = E_CONTACT_FULL_NAME; field != E_CONTACT_LAST_SIMPLE_STRING && count < 5; field++) {
- EMinicardField *minicard_field = NULL;
-
- if (field == E_CONTACT_FAMILY_NAME || field == E_CONTACT_GIVEN_NAME)
- continue;
-
- if (list)
- minicard_field = list->data;
- if (minicard_field && minicard_field->field == field) {
- GList *this_list = list;
- char *string;
-
- string = e_contact_get(e_minicard->contact, field);
- if (string && *string) {
- /* Magically convert embedded XML into an address. */
- if (!strncmp (string, "<?xml", 4)) {
- EABDestination *dest = eab_destination_import (string);
- if (dest != NULL) {
- gchar *new_string = g_strdup (eab_destination_get_textrep (dest, TRUE));
- g_free (string);
- string = new_string;
- g_object_unref (dest);
- }
- }
-
- e_minicard->fields = g_list_append(e_minicard->fields, minicard_field);
- g_object_set(minicard_field->label,
- "field", string,
- NULL);
- count ++;
- } else {
- e_minicard_field_destroy(minicard_field);
- }
- list = g_list_remove_link(list, this_list);
- g_list_free_1(this_list);
- g_free(string);
- } else {
- char *string;
- if (left_width == -1) {
- left_width = get_left_width(e_minicard);
- }
-
- string = e_contact_get(e_minicard->contact, field);
- if (string && *string) {
- add_field(e_minicard, field, left_width);
- count++;
- }
- g_free(string);
- }
- }
-
- g_list_foreach(list, (GFunc) e_minicard_field_destroy, NULL);
- g_list_free(list);
- }
-}
-
-static void
-e_minicard_reflow( GnomeCanvasItem *item, int flags )
-{
- EMinicard *e_minicard = E_MINICARD(item);
- if ( GTK_OBJECT_FLAGS( e_minicard ) & GNOME_CANVAS_ITEM_REALIZED ) {
- GList *list;
- gdouble text_height;
- gint old_height;
-
- old_height = e_minicard->height;
-
- g_object_get( e_minicard->header_text,
- "text_height", &text_height,
- NULL );
-
- e_minicard->height = text_height + 10.0;
-
- gnome_canvas_item_set( e_minicard->header_rect,
- "y2", text_height + 9.0,
- NULL );
-
- for(list = e_minicard->fields; list; list = g_list_next(list)) {
- EMinicardField *field = E_MINICARD_FIELD(list->data);
- GnomeCanvasItem *item = field->label;
- g_object_get (item,
- "height", &text_height,
- NULL);
- e_canvas_item_move_absolute(item, 2, e_minicard->height);
- e_minicard->height += text_height;
- }
- e_minicard->height += 2;
-
- gnome_canvas_item_set( e_minicard->rect,
- "x2", (double) e_minicard->width - 1.0,
- "y2", (double) e_minicard->height - 1.0,
- NULL );
- gnome_canvas_item_set( e_minicard->header_rect,
- "x2", (double) e_minicard->width - 3.0,
- NULL );
-
- if (old_height != e_minicard->height)
- e_canvas_item_request_parent_reflow(item);
- }
-}
-
-const char *
-e_minicard_get_card_id (EMinicard *minicard)
-{
- g_return_val_if_fail(minicard != NULL, NULL);
- g_return_val_if_fail(E_IS_MINICARD(minicard), NULL);
-
- if (minicard->contact) {
- return e_contact_get_const (minicard->contact, E_CONTACT_UID);
- } else {
- return "";
- }
-}
-
-int
-e_minicard_compare (EMinicard *minicard1, EMinicard *minicard2)
-{
- int cmp = 0;
-
- g_return_val_if_fail(minicard1 != NULL, 0);
- g_return_val_if_fail(E_IS_MINICARD(minicard1), 0);
- g_return_val_if_fail(minicard2 != NULL, 0);
- g_return_val_if_fail(E_IS_MINICARD(minicard2), 0);
-
- if (minicard1->contact && minicard2->contact) {
- char *file_as1, *file_as2;
- g_object_get(minicard1->contact,
- "file_as", &file_as1,
- NULL);
- g_object_get(minicard2->contact,
- "file_as", &file_as2,
- NULL);
-
- if (file_as1 && file_as2)
- cmp = g_utf8_collate(file_as1, file_as2);
- else if (file_as1)
- cmp = -1;
- else if (file_as2)
- cmp = 1;
- else
- cmp = strcmp(e_minicard_get_card_id(minicard1), e_minicard_get_card_id(minicard2));
-
- g_free (file_as1);
- g_free (file_as2);
- }
-
- return cmp;
-}
-
-int
-e_minicard_selected (EMinicard *minicard, GdkEvent *event)
-{
- gint ret_val = 0;
- GnomeCanvasItem *item = GNOME_CANVAS_ITEM (minicard);
- if (item->parent) {
- guint signal_id = g_signal_lookup ("selection_event", G_OBJECT_TYPE (item->parent));
- /* We should probably check the signature here, but I
- * don't think it's worth the time required to code
- * it.
- */
- if (signal_id != 0) {
- g_signal_emit(item->parent,
- signal_id, 0,
- item, event, &ret_val);
- }
- }
- return ret_val;
-}
-
-static gint
-e_minicard_drag_begin (EMinicard *minicard, GdkEvent *event)
-{
- gint ret_val = 0;
- GnomeCanvasItem *parent;
- g_signal_emit (minicard,
- e_minicard_signals[DRAG_BEGIN], 0,
- event, &ret_val);
-
- parent = GNOME_CANVAS_ITEM (minicard)->parent;
- if (parent && E_IS_REFLOW (parent)) {
- E_REFLOW (parent)->maybe_in_drag = FALSE;
- }
- return ret_val;
-}
diff --git a/addressbook/gui/widgets/e-minicard.h b/addressbook/gui/widgets/e-minicard.h
deleted file mode 100644
index 2d0cfd8ed5..0000000000
--- a/addressbook/gui/widgets/e-minicard.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* e-minicard.h
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-#ifndef __E_MINICARD_H__
-#define __E_MINICARD_H__
-
-#include <gdk-pixbuf/gdk-pixbuf.h>
-#include "addressbook/gui/contact-editor/e-contact-editor.h"
-#include <libgnomecanvas/gnome-canvas.h>
-#include <libebook/e-contact.h>
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-/* EMinicard - A small card displaying information about a contact.
- *
- * The following arguments are available:
- *
- * name type read/write description
- * --------------------------------------------------------------------------------
- * width double RW width of the card
- * height double R height of the card
- * card ECard* RW Pointer to the ECard
- */
-
-#define E_TYPE_MINICARD (e_minicard_get_type ())
-#define E_MINICARD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_MINICARD, EMinicard))
-#define E_MINICARD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_MINICARD, EMinicardClass))
-#define E_IS_MINICARD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_MINICARD))
-#define E_IS_MINICARD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_MINICARD))
-
-
-typedef struct _EMinicard EMinicard;
-typedef struct _EMinicardClass EMinicardClass;
-typedef enum _EMinicardFocusType EMinicardFocusType;
-
-enum _EMinicardFocusType {
- E_MINICARD_FOCUS_TYPE_START,
- E_MINICARD_FOCUS_TYPE_END
-};
-
-struct _EMinicard
-{
- GnomeCanvasGroup parent;
-
- /* item specific fields */
- EContact *contact;
-
- GnomeCanvasItem *rect;
- GnomeCanvasItem *header_rect;
- GnomeCanvasItem *header_text;
- GnomeCanvasItem *list_icon;
-
- GdkPixbuf *list_icon_pixbuf;
- double list_icon_size;
-
- GObject *editor;
-
- GList *fields; /* Of type EMinicardField */
- guint needs_remodeling : 1;
-
- guint changed : 1;
-
- guint selected : 1;
- guint has_cursor : 1;
-
- guint has_focus : 1;
-
- guint editable : 1;
-
- guint drag_button_down : 1;
- gint drag_button;
-
- gint button_x;
- gint button_y;
-
- double width;
- double height;
-};
-
-struct _EMinicardClass
-{
- GnomeCanvasGroupClass parent_class;
-
- gint (* selected) (EMinicard *minicard, GdkEvent *event);
- gint (* drag_begin) (EMinicard *minicard, GdkEvent *event);
-
- void (* style_set) (EMinicard *minicard, GtkStyle *previous_style);
-};
-
-
-GType e_minicard_get_type (void);
-const char *e_minicard_get_card_id (EMinicard *minicard);
-int e_minicard_compare (EMinicard *minicard1,
- EMinicard *minicard2);
-
-int e_minicard_selected (EMinicard *minicard,
- GdkEvent *event);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* __E_MINICARD_H__ */
diff --git a/addressbook/gui/widgets/eab-contact-display.c b/addressbook/gui/widgets/eab-contact-display.c
deleted file mode 100644
index 3de6eac380..0000000000
--- a/addressbook/gui/widgets/eab-contact-display.c
+++ /dev/null
@@ -1,486 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Chris Toshok <toshok@ximian.com>
- *
- * Copyright (C) 2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-#include "eab-contact-display.h"
-
-#include "e-util/e-html-utils.h"
-#include "util/eab-destination.h"
-
-#include <string.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnome/gnome-url.h>
-#include <gtkhtml/gtkhtml.h>
-#include <gtkhtml/gtkhtml-stream.h>
-
-#define PARENT_TYPE (gtk_vbox_get_type ())
-
-struct _EABContactDisplayPrivate {
- GtkHTML *html;
- EContact *contact;
-};
-
-
-#define HTML_HEADER "<!doctype html public \"-//W3C//DTD HTML 4.0 TRANSITIONAL//EN\">\n<html>\n" \
- "<head>\n<meta name=\"generator\" content=\"Evolution Addressbook Component\">\n</head>\n"
-
-#define MAX_COMPACT_IMAGE_DIMENSION 48
-
-static void
-on_url_requested (GtkHTML *html, const char *url, GtkHTMLStream *handle,
- EABContactDisplay *display)
-{
- printf ("on_url_requested (%s)\n", url);
- if (!strcmp (url, "internal-contact-photo:")) {
- EContactPhoto *photo;
-
- photo = e_contact_get (display->priv->contact, E_CONTACT_PHOTO);
- if (!photo)
- photo = e_contact_get (display->priv->contact, E_CONTACT_LOGO);
-
- printf ("writing a photo of length %d\n", photo->length);
-
- gtk_html_stream_write (handle, photo->data, photo->length);
-
- gtk_html_end (html, handle, GTK_HTML_STREAM_OK);
- }
-}
-
-static void
-on_link_clicked (GtkHTML *html, const char *url, EABContactDisplay *display)
-{
- GError *err = NULL;
-
- gnome_url_show (url, &err);
-
- if (err) {
- g_warning ("gnome_url_show: %s", err->message);
- g_error_free (err);
- }
-}
-
-static void
-render_address (GtkHTMLStream *html_stream, EContact *contact, const char *html_label, EContactField adr_field, EContactField label_field)
-{
- EContactAddress *adr;
- const char *label;
-
- label = e_contact_get_const (contact, label_field);
- if (label) {
- char *html = e_text_to_html (label, E_TEXT_TO_HTML_CONVERT_NL);
-
- gtk_html_stream_printf (html_stream, "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr valign=\"top\"><td>");
- gtk_html_stream_printf (html_stream, "<b>%s:</b>&nbsp;<td>%s<br>", html_label, html);
-
- gtk_html_stream_printf (html_stream, "<a href=\"http://www.mapquest.com/\">%s</a>", _("Map It"));
- gtk_html_stream_printf (html_stream, "</td></tr></table>");
- g_free (html);
- return;
- }
-
- adr = e_contact_get (contact, adr_field);
- if (adr &&
- (adr->po || adr->ext || adr->street || adr->locality || adr->region || adr->code || adr->country)) {
-
- gtk_html_stream_printf (html_stream, "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr valign=\"top\"><td>");
- gtk_html_stream_printf (html_stream, "<b>%s:</b>&nbsp;<td>", html_label);
-
- if (adr->po && *adr->po) gtk_html_stream_printf (html_stream, "%s<br>", adr->po);
- if (adr->ext && *adr->ext) gtk_html_stream_printf (html_stream, "%s<br>", adr->ext);
- if (adr->street && *adr->street) gtk_html_stream_printf (html_stream, "%s<br>", adr->street);
- if (adr->locality && *adr->locality) gtk_html_stream_printf (html_stream, "%s<br>", adr->locality);
- if (adr->region && *adr->region) gtk_html_stream_printf (html_stream, "%s<br>", adr->region);
- if (adr->code && *adr->code) gtk_html_stream_printf (html_stream, "%s<br>", adr->code);
- if (adr->country && *adr->country) gtk_html_stream_printf (html_stream, "%s<br>", adr->country);
-
- gtk_html_stream_printf (html_stream, "<a href=\"http://www.mapquest.com/\">%s</a>", _("Map It"));
- gtk_html_stream_printf (html_stream, "</td></tr></table>");
- }
- if (adr)
- e_contact_address_free (adr);
-}
-
-static void
-render_string (GtkHTMLStream *html_stream, EContact *contact, const char *html_label, EContactField field)
-{
- const char *str;
-
- str = e_contact_get_const (contact, field);
-
- if (str && *str) {
- char *html = e_text_to_html (str, 0);
- gtk_html_stream_printf (html_stream, "<b>%s:</b> %s<br>", html_label, str);
- g_free (html);
- }
-}
-
-static void
-render_url (GtkHTMLStream *html_stream, EContact *contact, const char *html_label, EContactField field)
-{
- const char *str;
- str = e_contact_get_const (contact, field);
- if (str && *str) {
- char *html = e_text_to_html (str, E_TEXT_TO_HTML_CONVERT_URLS);
- gtk_html_stream_printf (html_stream, "<b>%s:</b> %s<br>",
- html_label, html);
- g_free (html);
- }
-}
-
-static void
-eab_contact_display_render_normal (EABContactDisplay *display, EContact *contact)
-{
- GtkHTMLStream *html_stream;
-
- if (display->priv->contact)
- g_object_unref (display->priv->contact);
- display->priv->contact = contact;
- if (display->priv->contact)
- g_object_ref (display->priv->contact);
-
- html_stream = gtk_html_begin (display->priv->html);
- gtk_html_stream_write (html_stream, HTML_HEADER, sizeof (HTML_HEADER) - 1);
- gtk_html_stream_write (html_stream, "<body>\n", 7);
-
- if (contact) {
- char *str, *html;
- EContactPhoto *photo;
-
- gtk_html_stream_printf (html_stream, "<table border=\"0\" valign=\"top\"><tr valign=\"top\"><td>");
- photo = e_contact_get (contact, E_CONTACT_PHOTO);
- if (!photo)
- photo = e_contact_get (contact, E_CONTACT_LOGO);
- if (photo) {
- gtk_html_stream_printf (html_stream, "<img src=\"internal-contact-photo:\">");
- e_contact_photo_free (photo);
- }
-
- gtk_html_stream_printf (html_stream, "</td><td>\n");
-
- str = e_contact_get_const (contact, E_CONTACT_FILE_AS);
- if (str) {
- html = e_text_to_html (str, 0);
- gtk_html_stream_printf (html_stream, "<h2>%s</h2>", html);
- g_free (html);
- }
- else {
- str = e_contact_get_const (contact, E_CONTACT_FULL_NAME);
- if (str) {
- html = e_text_to_html (str, 0);
- gtk_html_stream_printf (html_stream, "<h2>%s</h2>", html);
- g_free (html);
- }
- }
-
- if (e_contact_get (contact, E_CONTACT_IS_LIST)) {
- GList *email_list;
- GList *l;
-
- gtk_html_stream_printf (html_stream, "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr valign=\"top\"><td>");
- gtk_html_stream_printf (html_stream, "<b>%s:</b>&nbsp;<td>", _("List Members"));
-
- email_list = e_contact_get (contact, E_CONTACT_EMAIL);
- for (l = email_list; l; l = l->next) {
- EABDestination *dest = eab_destination_import (l->data);
- if (dest) {
- const char *textrep = eab_destination_get_textrep (dest, TRUE);
- char *html = e_text_to_html (textrep, 0);
- gtk_html_stream_printf (html_stream, "%s<br>", html);
- g_free (html);
- g_object_unref (dest);
- }
- }
- gtk_html_stream_printf (html_stream, "</td></tr></table>");
- }
- else {
- render_string (html_stream, contact, _("Job Title"), E_CONTACT_TITLE);
-
- render_string (html_stream, contact, _("Email"), E_CONTACT_EMAIL_1);
- render_string (html_stream, contact, _("Email"), E_CONTACT_EMAIL_2);
- render_string (html_stream, contact, _("Email"), E_CONTACT_EMAIL_3);
-
-
- render_address (html_stream, contact, _("Home Address"), E_CONTACT_ADDRESS_HOME, E_CONTACT_ADDRESS_LABEL_HOME);
- render_address (html_stream, contact, _("Work Address"), E_CONTACT_ADDRESS_WORK, E_CONTACT_ADDRESS_LABEL_WORK);
- render_address (html_stream, contact, _("Other Address"), E_CONTACT_ADDRESS_OTHER, E_CONTACT_ADDRESS_LABEL_OTHER);
-
- gtk_html_stream_printf (html_stream, "<hr>");
-
- render_url (html_stream, contact, _("Home page"), E_CONTACT_HOMEPAGE_URL);
- render_url (html_stream, contact, _("Blog"), E_CONTACT_BLOG_URL);
-
- }
-
- gtk_html_stream_printf (html_stream, "</td></tr></table>\n");
- }
-
- gtk_html_stream_write (html_stream, "</body></html>\n", 15);
- gtk_html_end (display->priv->html, html_stream, GTK_HTML_STREAM_OK);
-}
-
-static void
-eab_contact_display_render_compact (EABContactDisplay *display, EContact *contact)
-{
- GtkHTMLStream *html_stream;
-
- if (display->priv->contact)
- g_object_unref (display->priv->contact);
- display->priv->contact = contact;
- if (display->priv->contact)
- g_object_ref (display->priv->contact);
-
- html_stream = gtk_html_begin (display->priv->html);
- gtk_html_stream_write (html_stream, HTML_HEADER, sizeof (HTML_HEADER) - 1);
- gtk_html_stream_write (html_stream, "<body>\n", 7);
-
- if (contact) {
- char *str, *html;
- EContactPhoto *photo;
-
- gtk_html_stream_printf (html_stream,
- "<table width=\"100%%\" cellpadding=1 cellspacing=0 bgcolor=\"#000000\">"
- "<tr><td>"
- "<table width=\"100%%\" cellpadding=0 cellspacing=0 bgcolor=\"#eeeeee\">"
- "<tr><td>"
- "<table>"
- "<tr valign=\"top\"><td>");
-
- photo = e_contact_get (contact, E_CONTACT_PHOTO);
- if (!photo)
- photo = e_contact_get (contact, E_CONTACT_LOGO);
- if (photo) {
- int calced_width = MAX_COMPACT_IMAGE_DIMENSION, calced_height = MAX_COMPACT_IMAGE_DIMENSION;
- GdkPixbufLoader *loader = gdk_pixbuf_loader_new ();
- GdkPixbuf *pixbuf;
-
- /* figure out if we need to downscale the
- image here. we don't scale the pixbuf
- itself, just insert width/height tags in
- the html */
- gdk_pixbuf_loader_write (loader, photo->data, photo->length, NULL);
- pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
- gdk_pixbuf_loader_close (loader, NULL);
- g_object_unref (loader);
- if (pixbuf) {
- int max_dimension = gdk_pixbuf_get_height (pixbuf);
- if (max_dimension < gdk_pixbuf_get_width (pixbuf))
- max_dimension = gdk_pixbuf_get_width (pixbuf);
-
- calced_width = (float)gdk_pixbuf_get_width (pixbuf) / max_dimension * MAX_COMPACT_IMAGE_DIMENSION;
- calced_height = (float)gdk_pixbuf_get_height (pixbuf) / max_dimension * MAX_COMPACT_IMAGE_DIMENSION;
-
- calced_width = MIN (calced_width, MAX_COMPACT_IMAGE_DIMENSION);
- calced_height = MIN (calced_height, MAX_COMPACT_IMAGE_DIMENSION);
- }
-
- gdk_pixbuf_unref (pixbuf);
- gtk_html_stream_printf (html_stream, "<img width=\"%d\" height=\"%d\" src=\"internal-contact-photo:\">",
- calced_width, calced_height);
- e_contact_photo_free (photo);
- }
-
- gtk_html_stream_printf (html_stream, "</td><td>\n");
-
- str = e_contact_get_const (contact, E_CONTACT_FILE_AS);
- if (str) {
- html = e_text_to_html (str, 0);
- gtk_html_stream_printf (html_stream, "<b>%s</b>", html);
- g_free (html);
- }
- else {
- str = e_contact_get_const (contact, E_CONTACT_FULL_NAME);
- if (str) {
- html = e_text_to_html (str, 0);
- gtk_html_stream_printf (html_stream, "<b>%s</b>", html);
- g_free (html);
- }
- }
-
- gtk_html_stream_write (html_stream, "<hr>", 4);
-
- if (e_contact_get (contact, E_CONTACT_IS_LIST)) {
- GList *email_list;
- GList *l;
-
- gtk_html_stream_printf (html_stream, "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr valign=\"top\"><td>");
- gtk_html_stream_printf (html_stream, "<b>%s:</b>&nbsp;<td>", _("List Members"));
-
- email_list = e_contact_get (contact, E_CONTACT_EMAIL);
- for (l = email_list; l; l = l->next) {
- EABDestination *dest = eab_destination_import (l->data);
- if (dest) {
- const char *textrep = eab_destination_get_textrep (dest, TRUE);
- char *html = e_text_to_html (textrep, 0);
- gtk_html_stream_printf (html_stream, "%s, ", html);
- g_free (html);
- g_object_unref (dest);
- }
- }
- gtk_html_stream_printf (html_stream, "</td></tr></table>");
- }
- else {
- gboolean comma = FALSE;
- str = e_contact_get_const (contact, E_CONTACT_TITLE);
- if (str) {
- html = e_text_to_html (str, 0);
- gtk_html_stream_printf (html_stream, "<b>%s:</b> %s<br>", _("Job Title"), str);
- g_free (html);
- }
-
- gtk_html_stream_printf (html_stream, "<b>%s:</b> ", _("Email"));
- str = e_contact_get_const (contact, E_CONTACT_EMAIL_1);
- if (str) {
- html = e_text_to_html (str, 0);
- gtk_html_stream_printf (html_stream, "%s", str);
- g_free (html);
- comma = TRUE;
- }
- str = e_contact_get_const (contact, E_CONTACT_EMAIL_2);
- if (str) {
- html = e_text_to_html (str, 0);
- gtk_html_stream_printf (html_stream, "%s%s", comma ? ", " : "", str);
- g_free (html);
- comma = TRUE;
- }
- str = e_contact_get_const (contact, E_CONTACT_EMAIL_3);
- if (str) {
- html = e_text_to_html (str, 0);
- gtk_html_stream_printf (html_stream, "%s%s", comma ? ", " : "", str);
- g_free (html);
- }
- gtk_html_stream_write (html_stream, "<br>", 4);
-
- str = e_contact_get_const (contact, E_CONTACT_HOMEPAGE_URL);
- if (str) {
- html = e_text_to_html (str, E_TEXT_TO_HTML_CONVERT_URLS);
- gtk_html_stream_printf (html_stream, "<b>%s:</b> %s<br>",
- _("Home page"), html);
- g_free (html);
- }
-
- str = e_contact_get_const (contact, E_CONTACT_BLOG_URL);
- if (str) {
- html = e_text_to_html (str, E_TEXT_TO_HTML_CONVERT_URLS);
- gtk_html_stream_printf (html_stream, "<b>%s:</b> %s<br>",
- _("Blog"), html);
- }
- }
-
- gtk_html_stream_printf (html_stream, "</td></tr></table></td></tr></table></td></tr></table>\n");
- }
-
- gtk_html_stream_write (html_stream, "</body></html>\n", 15);
- gtk_html_end (display->priv->html, html_stream, GTK_HTML_STREAM_OK);
-}
-
-void
-eab_contact_display_render (EABContactDisplay *display, EContact *contact,
- EABContactDisplayRenderMode mode)
-{
- switch (mode) {
- case EAB_CONTACT_DISPLAY_RENDER_NORMAL:
- eab_contact_display_render_normal (display, contact);
- break;
- case EAB_CONTACT_DISPLAY_RENDER_COMPACT:
- eab_contact_display_render_compact (display, contact);
- break;
- }
-}
-
-GtkWidget*
-eab_contact_display_new (void)
-{
- EABContactDisplay *display;
-
- display = g_object_new (EAB_TYPE_CONTACT_DISPLAY, NULL);
-
- display->priv = g_new0 (EABContactDisplayPrivate, 1);
-
- display->priv->html = GTK_HTML (gtk_html_new ());
-
- gtk_html_set_default_content_type (display->priv->html, "text/html; charset=utf-8");
-
- gtk_html_set_editable (display->priv->html, FALSE);
-
-
- g_signal_connect (display->priv->html, "url_requested",
- G_CALLBACK (on_url_requested),
- display);
- g_signal_connect (display->priv->html, "link_clicked",
- G_CALLBACK (on_link_clicked),
- display);
-#if 0
- g_signal_connect (display->priv->html, "object_requested",
- G_CALLBACK (on_object_requested),
- mail_display);
- g_signal_connect (display->priv->html, "button_press_event",
- G_CALLBACK (html_button_press_event), mail_display);
- g_signal_connect (display->priv->html, "motion_notify_event",
- G_CALLBACK (html_motion_notify_event), mail_display);
- g_signal_connect (display->priv->html, "enter_notify_event",
- G_CALLBACK (html_enter_notify_event), mail_display);
- g_signal_connect (display->priv->html, "iframe_created",
- G_CALLBACK (html_iframe_created), mail_display);
- g_signal_connect (display->priv->html, "on_url",
- G_CALLBACK (html_on_url), mail_display);
-#endif
-
- gtk_box_pack_start_defaults (GTK_BOX (display), GTK_WIDGET (display->priv->html));
- gtk_widget_show (GTK_WIDGET (display->priv->html));
-
- return GTK_WIDGET (display);
-}
-
-
-static void
-eab_contact_display_init (GObject *object)
-{
-}
-
-static void
-eab_contact_display_class_init (GtkObjectClass *object_class)
-{
- // object_class->destroy = mail_display_destroy;
-}
-
-GType
-eab_contact_display_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (EABContactDisplayClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) eab_contact_display_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EABContactDisplay),
- 0, /* n_preallocs */
- (GInstanceInitFunc) eab_contact_display_init,
- };
-
- type = g_type_register_static (PARENT_TYPE, "EABContactDisplay", &info, 0);
- }
-
- return type;
-}
diff --git a/addressbook/gui/widgets/eab-contact-display.h b/addressbook/gui/widgets/eab-contact-display.h
deleted file mode 100644
index e7f47031ce..0000000000
--- a/addressbook/gui/widgets/eab-contact-display.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Chris Toshok <toshok@ximian.com>
- *
- * Copyright 2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef _EAB_CONTACT_DISPLAY_H_
-#define _EAB_CONTACT_DISPLAY_H_
-
-#include <gtk/gtkvbox.h>
-#include <gtkhtml/gtkhtml.h>
-#include <libebook/e-contact.h>
-
-#define EAB_TYPE_CONTACT_DISPLAY (eab_contact_display_get_type ())
-#define EAB_CONTACT_DISPLAY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EAB_TYPE_CONTACT_DISPLAY, EABContactDisplay))
-#define EAB_CONTACT_DISPLAY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), EAB_TYPE_CONTACT_DISPLAY, EABContactDisplayClass))
-#define IS_EAB_CONTACT_DISPLAY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), EAB_TYPE_CONTACT_DISPLAY))
-#define IS_EAB_CONTACT_DISPLAY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EAB_TYPE_CONTACT_DISPLAY))
-
-typedef struct _EABContactDisplay EABContactDisplay;
-typedef struct _EABContactDisplayPrivate EABContactDisplayPrivate;
-typedef struct _EABContactDisplayClass EABContactDisplayClass;
-
-typedef enum {
- EAB_CONTACT_DISPLAY_RENDER_NORMAL, /* for use in the preview pane */
- EAB_CONTACT_DISPLAY_RENDER_COMPACT /* for use with embedded vcards (e.g, the EABVCardControl) */
-} EABContactDisplayRenderMode;
-
-struct _EABContactDisplay {
- GtkVBox parent;
-
- EABContactDisplayPrivate *priv;
-};
-
-struct _EABContactDisplayClass {
- GtkVBoxClass parent_class;
-};
-
-GtkType eab_contact_display_get_type (void);
-GtkWidget * eab_contact_display_new (void);
-
-void eab_contact_display_render (EABContactDisplay *display, EContact *contact,
- EABContactDisplayRenderMode render_mode);
-
-#endif /* _EAB_CONTACT_DISPLAY_H_ */
diff --git a/addressbook/gui/widgets/eab-gui-util.c b/addressbook/gui/widgets/eab-gui-util.c
deleted file mode 100644
index bd4ed78463..0000000000
--- a/addressbook/gui/widgets/eab-gui-util.c
+++ /dev/null
@@ -1,819 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-field-chooser.c
- * Copyright (C) 2001 Ximian, Inc.
- * Author: Chris Toshok <toshok@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <string.h>
-
-#include <gal/util/e-util.h>
-#include "eab-gui-util.h"
-#include "util/eab-book-util.h"
-#include "util/eab-destination.h"
-
-#include <gnome.h>
-
-#include "addressbook/gui/contact-editor/e-contact-editor.h"
-#include "addressbook/gui/contact-list-editor/e-contact-list-editor.h"
-
-void
-eab_error_dialog (const gchar *msg, EBookStatus status)
-{
- static char *status_to_string[] = {
- N_("Success"),
- N_("Unknown error"),
- N_("Repository offline"),
- N_("Permission denied"),
- N_("Contact not found"),
- N_("Contact ID already exists"),
- N_("Protocol not supported"),
- N_("Cancelled"),
- N_("Authentication Failed"),
- N_("Authentication Required"),
- N_("TLS not Available"),
- N_("Addressbook does not exist"),
- N_("Other error")
- };
- char *error_msg;
- GtkWidget *dialog;
-
- error_msg = g_strdup_printf ("%s: %s", msg, _(status_to_string [status]));
-
- dialog = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
- error_msg);
-
- g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
-
- gtk_widget_show (dialog);
-
- g_free (error_msg);
-}
-
-gint
-eab_prompt_save_dialog (GtkWindow *parent)
-{
- GtkWidget *dialog;
- gint response;
-
- dialog = gtk_message_dialog_new (parent,
- (GtkDialogFlags)0,
- GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_NONE,
- _("Do you want to save changes?"));
- gtk_dialog_add_buttons (GTK_DIALOG (dialog),
- _("_Discard"), GTK_RESPONSE_NO,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_SAVE, GTK_RESPONSE_YES,
- NULL);
-
- gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_YES);
-
- response = gtk_dialog_run (GTK_DIALOG (dialog));
-
- gtk_widget_destroy (dialog);
-
- return response;
-}
-
-static void
-added_cb (EBook* book, EBookStatus status, const char *id,
- gboolean is_list)
-{
- if (status != E_BOOK_ERROR_OK) {
- eab_error_dialog (is_list ? _("Error adding list") : _("Error adding contact"), status);
- }
-}
-
-static void
-modified_cb (EBook* book, EBookStatus status,
- gboolean is_list)
-{
- if (status != E_BOOK_ERROR_OK) {
- eab_error_dialog (is_list ? _("Error modifying list") : _("Error modifying contact"),
- status);
- }
-}
-
-static void
-deleted_cb (EBook* book, EBookStatus status,
- gboolean is_list)
-{
- if (status != E_BOOK_ERROR_OK) {
- eab_error_dialog (is_list ? _("Error removing list") : _("Error removing contact"),
- status);
- }
-}
-
-static void
-editor_closed_cb (GtkObject *editor, gpointer data)
-{
- g_object_unref (editor);
-}
-
-EContactEditor *
-eab_show_contact_editor (EBook *book, EContact *contact,
- gboolean is_new_contact,
- gboolean editable)
-{
- EContactEditor *ce;
-
- ce = e_contact_editor_new (book, contact, is_new_contact, editable);
-
- g_signal_connect (ce, "contact_added",
- G_CALLBACK (added_cb), GINT_TO_POINTER (FALSE));
- g_signal_connect (ce, "contact_modified",
- G_CALLBACK (modified_cb), GINT_TO_POINTER (FALSE));
- g_signal_connect (ce, "contact_deleted",
- G_CALLBACK (deleted_cb), GINT_TO_POINTER (FALSE));
- g_signal_connect (ce, "editor_closed",
- G_CALLBACK (editor_closed_cb), NULL);
-
- return ce;
-}
-
-EContactListEditor *
-eab_show_contact_list_editor (EBook *book, EContact *contact,
- gboolean is_new_contact,
- gboolean editable)
-{
- EContactListEditor *ce;
-
- ce = e_contact_list_editor_new (book, contact, is_new_contact, editable);
-
- g_signal_connect (ce, "list_added",
- G_CALLBACK (added_cb), GINT_TO_POINTER (TRUE));
- g_signal_connect (ce, "list_modified",
- G_CALLBACK (modified_cb), GINT_TO_POINTER (TRUE));
- g_signal_connect (ce, "list_deleted",
- G_CALLBACK (deleted_cb), GINT_TO_POINTER (TRUE));
- g_signal_connect (ce, "editor_closed",
- G_CALLBACK (editor_closed_cb), GINT_TO_POINTER (TRUE));
-
- e_contact_list_editor_show (ce);
-
- return ce;
-}
-
-static void
-view_contacts (EBook *book, GList *list, gboolean editable)
-{
- for (; list; list = list->next) {
- EContact *contact = list->data;
- if (e_contact_get (contact, E_CONTACT_IS_LIST))
- eab_show_contact_list_editor (book, contact, FALSE, editable);
- else
- eab_show_contact_editor (book, contact, FALSE, editable);
- }
-}
-
-void
-eab_show_multiple_contacts (EBook *book,
- GList *list,
- gboolean editable)
-{
- if (list) {
- int length = g_list_length (list);
- if (length > 5) {
- GtkWidget *dialog;
- gint response;
-
- dialog = gtk_message_dialog_new (NULL,
- 0,
- GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_YES_NO,
- _("Opening %d contacts will open %d new windows as well.\n"
- "Do you really want to display all of these contacts?"),
- length,
- length);
-
- response = gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- if (response == GTK_RESPONSE_YES)
- view_contacts (book, list, editable);
- } else {
- view_contacts (book, list, editable);
- }
- }
-}
-
-
-static gint
-file_exists(GtkFileSelection *filesel, const char *filename)
-{
- GtkWidget *dialog;
- gint response;
-
- dialog = gtk_message_dialog_new (GTK_WINDOW (filesel),
- 0,
- GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_NONE,
- _("%s already exists\nDo you want to overwrite it?"), filename);
-
- gtk_dialog_add_buttons (GTK_DIALOG (dialog),
- GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
- _("Overwrite"), GTK_RESPONSE_ACCEPT,
- NULL);
-
- response = gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- return response;
-}
-
-typedef struct {
- GtkFileSelection *filesel;
- char *vcard;
-} SaveAsInfo;
-
-static void
-save_it(GtkWidget *widget, SaveAsInfo *info)
-{
- gint error = 0;
- gint response = 0;
-
- const char *filename = gtk_file_selection_get_filename (info->filesel);
-
- error = e_write_file (filename, info->vcard, O_WRONLY | O_CREAT | O_EXCL | O_TRUNC);
-
- if (error == EEXIST) {
- response = file_exists(info->filesel, filename);
- switch (response) {
- case GTK_RESPONSE_ACCEPT : /* Overwrite */
- e_write_file(filename, info->vcard, O_WRONLY | O_CREAT | O_TRUNC);
- break;
- case GTK_RESPONSE_REJECT : /* cancel */
- return;
- }
- } else if (error != 0) {
- GtkWidget *dialog;
- char *str;
-
- str = g_strdup_printf (_("Error saving %s: %s"), filename, strerror(errno));
- dialog = gtk_message_dialog_new (GTK_WINDOW (info->filesel),
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- str);
- g_free (str);
-
- gtk_widget_show (dialog);
-
- return;
- }
-
- gtk_widget_destroy(GTK_WIDGET(info->filesel));
-}
-
-static void
-close_it(GtkWidget *widget, SaveAsInfo *info)
-{
- gtk_widget_destroy (GTK_WIDGET (info->filesel));
-}
-
-static void
-destroy_it(void *data, GObject *where_the_object_was)
-{
- SaveAsInfo *info = data;
- g_free (info->vcard);
- g_free (info);
-}
-
-static char *
-make_safe_filename (const char *prefix, char *name)
-{
- char *safe, *p;
-
- if (!name) {
- /* This is a filename. Translators take note. */
- name = _("card.vcf");
- }
-
- p = strrchr (name, '/');
- if (p)
- safe = g_strdup_printf ("%s%s%s", prefix, p, ".vcf");
- else
- safe = g_strdup_printf ("%s/%s%s", prefix, name, ".vcf");
-
- p = strrchr (safe, '/') + 1;
- if (p)
- e_filename_make_safe (p);
-
- return safe;
-}
-
-void
-eab_contact_save (char *title, EContact *contact, GtkWindow *parent_window)
-{
- GtkFileSelection *filesel;
- char *file;
- char *name;
- SaveAsInfo *info = g_new(SaveAsInfo, 1);
-
- filesel = GTK_FILE_SELECTION(gtk_file_selection_new(title));
-
- name = e_contact_get (contact, E_CONTACT_FILE_AS);
- file = make_safe_filename (g_get_home_dir(), name);
- gtk_file_selection_set_filename (filesel, file);
- g_free (file);
-
- info->filesel = filesel;
- info->vcard = e_vcard_to_string (E_VCARD (contact), EVC_FORMAT_VCARD_30);
-
- g_signal_connect(filesel->ok_button, "clicked",
- G_CALLBACK (save_it), info);
- g_signal_connect(filesel->cancel_button, "clicked",
- G_CALLBACK (close_it), info);
- g_object_weak_ref (G_OBJECT (filesel), destroy_it, info);
-
- if (parent_window) {
- gtk_window_set_transient_for (GTK_WINDOW (filesel),
- parent_window);
- gtk_window_set_modal (GTK_WINDOW (filesel), TRUE);
- }
-
- gtk_widget_show(GTK_WIDGET(filesel));
-}
-
-void
-eab_contact_list_save (char *title, GList *list, GtkWindow *parent_window)
-{
- GtkFileSelection *filesel;
- SaveAsInfo *info = g_new(SaveAsInfo, 1);
-
- filesel = GTK_FILE_SELECTION(gtk_file_selection_new(title));
-
- /* This is a filename. Translators take note. */
- if (list && list->data && list->next == NULL) {
- char *name, *file;
- name = e_contact_get (E_CONTACT (list->data), E_CONTACT_FILE_AS);
- if (!name)
- name = e_contact_get (E_CONTACT (list->data), E_CONTACT_FULL_NAME);
-
- file = make_safe_filename (g_get_home_dir(), name);
- gtk_file_selection_set_filename (filesel, file);
- g_free (file);
- } else {
- char *file;
- file = make_safe_filename (g_get_home_dir(), _("list"));
- gtk_file_selection_set_filename (filesel, file);
- g_free (file);
- }
-
- info->filesel = filesel;
- info->vcard = eab_contact_list_to_string (list);
-
- g_signal_connect(filesel->ok_button, "clicked",
- G_CALLBACK (save_it), info);
- g_signal_connect(filesel->cancel_button, "clicked",
- G_CALLBACK (close_it), info);
- g_object_weak_ref (G_OBJECT (filesel), destroy_it, info);
-
- if (parent_window) {
- gtk_window_set_transient_for (GTK_WINDOW (filesel),
- parent_window);
- gtk_window_set_modal (GTK_WINDOW (filesel), TRUE);
- }
-
- gtk_widget_show(GTK_WIDGET(filesel));
-}
-
-typedef struct ContactCopyProcess_ ContactCopyProcess;
-
-typedef void (*ContactCopyDone) (ContactCopyProcess *process);
-
-struct ContactCopyProcess_ {
- int count;
- GList *contacts;
- EBook *source;
- EBook *destination;
- ContactCopyDone done_cb;
-};
-
-static void
-contact_deleted_cb (EBook* book, EBookStatus status, gpointer user_data)
-{
- if (status != E_BOOK_ERROR_OK) {
- eab_error_dialog (_("Error removing contact"), status);
- }
-}
-
-static void
-do_delete (gpointer data, gpointer user_data)
-{
- EBook *book = user_data;
- EContact *contact = data;
-
- e_book_async_remove_contact(book, contact, contact_deleted_cb, NULL);
-}
-
-static void
-delete_contacts (ContactCopyProcess *process)
-{
- g_list_foreach (process->contacts,
- do_delete,
- process->source);
-}
-
-static void
-process_unref (ContactCopyProcess *process)
-{
- process->count --;
- if (process->count == 0) {
- if (process->done_cb) {
- process->done_cb (process);
- }
- e_free_object_list(process->contacts);
- g_object_unref (process->source);
- g_object_unref (process->destination);
- g_free (process);
- }
-}
-
-static void
-contact_added_cb (EBook* book, EBookStatus status, const char *id, gpointer user_data)
-{
- ContactCopyProcess *process = user_data;
-
- if (status != E_BOOK_ERROR_OK) {
- eab_error_dialog (_("Error adding contact"), status);
- } else {
- process_unref (process);
- }
-}
-
-static void
-do_copy (gpointer data, gpointer user_data)
-{
- EBook *book;
- EContact *contact;
- ContactCopyProcess *process;
-
- process = user_data;
- contact = data;
-
- book = process->destination;
-
- process->count ++;
- e_book_async_add_contact(book, contact, contact_added_cb, process);
-}
-
-static void
-got_book_cb (EBook *book, EBookStatus status, gpointer closure)
-{
- ContactCopyProcess *process;
- process = closure;
- if (status == E_BOOK_ERROR_OK) {
- process->destination = book;
- g_object_ref (book);
- g_list_foreach (process->contacts,
- do_copy,
- process);
- }
- process_unref (process);
-}
-
-void
-eab_transfer_contacts (EBook *source, GList *contacts /* adopted */, gboolean delete_from_source, GtkWindow *parent_window)
-{
-#if 0
- EBook *dest;
- const char *allowed_types[] = { "contacts/*", NULL };
- GNOME_Evolution_Folder *folder;
- static char *last_uri = NULL;
- ContactCopyProcess *process;
- char *desc;
-
- if (contacts == NULL)
- return;
-
- if (last_uri == NULL)
- last_uri = g_strdup ("");
-
- if (contacts->next == NULL) {
- if (delete_from_source)
- desc = _("Move contact to");
- else
- desc = _("Copy contact to");
- } else {
- if (delete_from_source)
- desc = _("Move contacts to");
- else
- desc = _("Copy contacts to");
- }
-
- evolution_shell_client_user_select_folder (global_shell_client,
- parent_window,
- desc, last_uri, allowed_types,
- &folder);
-
- if (!folder)
- return;
-
- if (strcmp (last_uri, folder->evolutionUri) != 0) {
- g_free (last_uri);
- last_uri = g_strdup (folder->evolutionUri);
- }
-
- process = g_new (ContactCopyProcess, 1);
- process->count = 1;
- process->source = source;
- g_object_ref (source);
- process->contacts = contacts;
- process->destination = NULL;
-
- if (delete_from_source)
- process->done_cb = delete_contacts;
- else
- process->done_cb = NULL;
-
- dest = e_book_new ();
- e_book_async_load_uri (dest, folder->physicalUri, got_book_cb, process);
-
- CORBA_free (folder);
-#endif
-}
-
-#include <Evolution-Composer.h>
-
-#define COMPOSER_OAFID "OAFIID:GNOME_Evolution_Mail_Composer:" BASE_VERSION
-
-void
-eab_send_contact_list (GList *contacts, EABDisposition disposition)
-{
-#if notyet
- GNOME_Evolution_Composer composer_server;
- CORBA_Environment ev;
-
- if (contacts == NULL)
- return;
-
- CORBA_exception_init (&ev);
-
- composer_server = bonobo_activation_activate_from_id (COMPOSER_OAFID, 0, NULL, &ev);
-
- if (disposition == EAB_DISPOSITION_AS_TO) {
- GNOME_Evolution_Composer_RecipientList *to_list, *cc_list, *bcc_list;
- CORBA_char *subject;
- int to_i, bcc_i;
- GList *iter;
- gint to_length = 0, bcc_length = 0;
-
- /* Figure out how many addresses of each kind we have. */
- for (iter = contacts; iter != NULL; iter = g_list_next (iter)) {
- EContact *contact = E_CONTACT (iter->data);
- if (e_contact_get (contact, E_CONTACT_IS_LIST)) {
- gint len = card->email ? e_list_length (card->email) : 0;
- if (e_card_evolution_list_show_addresses (card))
- to_length += len;
- else
- bcc_length += len;
- } else {
- if (card->email != NULL)
- ++to_length;
- }
- }
-
- /* Now I have to make a CORBA sequences that represents a recipient list with
- the right number of entries, for the cards. */
- to_list = GNOME_Evolution_Composer_RecipientList__alloc ();
- to_list->_maximum = to_length;
- to_list->_length = to_length;
- if (to_length > 0) {
- to_list->_buffer = CORBA_sequence_GNOME_Evolution_Composer_Recipient_allocbuf (to_length);
- }
-
- cc_list = GNOME_Evolution_Composer_RecipientList__alloc ();
- cc_list->_maximum = cc_list->_length = 0;
-
- bcc_list = GNOME_Evolution_Composer_RecipientList__alloc ();
- bcc_list->_maximum = bcc_length;
- bcc_list->_length = bcc_length;
- if (bcc_length > 0) {
- bcc_list->_buffer = CORBA_sequence_GNOME_Evolution_Composer_Recipient_allocbuf (bcc_length);
- }
-
- to_i = 0;
- bcc_i = 0;
- while (cards != NULL) {
- ECard *card = cards->data;
- EIterator *iterator;
- gchar *name, *addr;
- gboolean is_list, is_hidden, free_name_addr;
- GNOME_Evolution_Composer_Recipient *recipient;
-
- if (card->email != NULL) {
-
- is_list = e_card_evolution_list (card);
- is_hidden = is_list && !e_card_evolution_list_show_addresses (card);
-
- for (iterator = e_list_get_iterator (card->email); e_iterator_is_valid (iterator); e_iterator_next (iterator)) {
-
- if (is_hidden) {
- recipient = &(bcc_list->_buffer[bcc_i]);
- ++bcc_i;
- } else {
- recipient = &(to_list->_buffer[to_i]);
- ++to_i;
- }
-
- name = "";
- addr = "";
- free_name_addr = FALSE;
- if (e_iterator_is_valid (iterator)) {
-
- if (is_list) {
- /* We need to decode the list entries, which are XMLified EABDestinations. */
- EABDestination *dest = eab_destination_import (e_iterator_get (iterator));
- if (dest != NULL) {
- name = g_strdup (eab_destination_get_name (dest));
- addr = g_strdup (eab_destination_get_email (dest));
- free_name_addr = TRUE;
- g_object_unref (dest);
- }
-
- } else { /* is just a plain old card */
- if (card->name)
- name = e_card_name_to_string (card->name);
- addr = g_strdup ((char *) e_iterator_get (iterator));
- free_name_addr = TRUE;
- }
- }
-
- recipient->name = CORBA_string_dup (name ? name : "");
- recipient->address = CORBA_string_dup (addr ? addr : "");
-
- if (free_name_addr) {
- g_free ((gchar *) name);
- g_free ((gchar *) addr);
- }
-
- /* If this isn't a list, we quit after the first (i.e. the default) address. */
- if (!is_list)
- break;
-
- }
- g_object_unref (iterator);
- }
-
- cards = g_list_next (cards);
- }
-
- subject = CORBA_string_dup ("");
-
- GNOME_Evolution_Composer_setHeaders (composer_server, "", to_list, cc_list, bcc_list, subject, &ev);
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_printerr ("gui/e-meeting-edit.c: I couldn't set the composer headers via CORBA! Aagh.\n");
- CORBA_exception_free (&ev);
- return;
- }
-
- CORBA_free (to_list);
- CORBA_free (cc_list);
- CORBA_free (bcc_list);
- CORBA_free (subject);
- } else if (disposition == EAB_DISPOSITION_AS_ATTACHMENT) {
- CORBA_char *content_type, *filename, *description;
- GNOME_Evolution_Composer_AttachmentData *attach_data;
- CORBA_boolean show_inline;
- char *tempstr;
-
- GNOME_Evolution_Composer_RecipientList *to_list, *cc_list, *bcc_list;
- CORBA_char *subject;
-
- content_type = CORBA_string_dup ("text/x-vcard");
- filename = CORBA_string_dup ("");
-
- if (cards->next) {
- description = CORBA_string_dup (_("Multiple VCards"));
- } else {
- char *file_as;
-
- g_object_get(cards->data,
- "file_as", &file_as,
- NULL);
-
- tempstr = g_strdup_printf (_("VCard for %s"), file_as);
- description = CORBA_string_dup (tempstr);
- g_free (tempstr);
- }
-
- show_inline = FALSE;
-
- tempstr = eab_contact_list_to_string (cards);
- attach_data = GNOME_Evolution_Composer_AttachmentData__alloc();
- attach_data->_maximum = attach_data->_length = strlen (tempstr);
- attach_data->_buffer = CORBA_sequence_CORBA_char_allocbuf (attach_data->_length);
- strcpy (attach_data->_buffer, tempstr);
- g_free (tempstr);
-
- GNOME_Evolution_Composer_attachData (composer_server,
- content_type, filename, description,
- show_inline, attach_data,
- &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_printerr ("gui/e-meeting-edit.c: I couldn't attach data to the composer via CORBA! Aagh.\n");
- CORBA_exception_free (&ev);
- return;
- }
-
- CORBA_free (content_type);
- CORBA_free (filename);
- CORBA_free (description);
- CORBA_free (attach_data);
-
- to_list = GNOME_Evolution_Composer_RecipientList__alloc ();
- to_list->_maximum = to_list->_length = 0;
-
- cc_list = GNOME_Evolution_Composer_RecipientList__alloc ();
- cc_list->_maximum = cc_list->_length = 0;
-
- bcc_list = GNOME_Evolution_Composer_RecipientList__alloc ();
- bcc_list->_maximum = bcc_list->_length = 0;
-
- if (!cards || cards->next) {
- subject = CORBA_string_dup ("Contact information");
- } else {
- ECard *card = cards->data;
- const gchar *tempstr2;
-
- tempstr2 = NULL;
- g_object_get(card,
- "file_as", &tempstr2,
- NULL);
- if (!tempstr2 || !*tempstr2)
- g_object_get(card,
- "full_name", &tempstr2,
- NULL);
- if (!tempstr2 || !*tempstr2)
- g_object_get(card,
- "org", &tempstr2,
- NULL);
- if (!tempstr2 || !*tempstr2) {
- EList *list;
- EIterator *iterator;
- g_object_get(card,
- "email", &list,
- NULL);
- iterator = e_list_get_iterator (list);
- if (e_iterator_is_valid (iterator)) {
- tempstr2 = e_iterator_get (iterator);
- }
- g_object_unref (iterator);
- }
-
- if (!tempstr2 || !*tempstr2)
- tempstr = g_strdup_printf ("Contact information");
- else
- tempstr = g_strdup_printf ("Contact information for %s", tempstr2);
- subject = CORBA_string_dup (tempstr);
- g_free (tempstr);
- }
-
- GNOME_Evolution_Composer_setHeaders (composer_server, "", to_list, cc_list, bcc_list, subject, &ev);
-
- CORBA_free (to_list);
- CORBA_free (cc_list);
- CORBA_free (bcc_list);
- CORBA_free (subject);
- }
-
- GNOME_Evolution_Composer_show (composer_server, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_printerr ("gui/e-meeting-edit.c: I couldn't show the composer via CORBA! Aagh.\n");
- CORBA_exception_free (&ev);
- return;
- }
-
- CORBA_exception_free (&ev);
-#endif
-}
-
-void
-eab_send_contact (EContact *contact, EABDisposition disposition)
-{
- GList *list;
- list = g_list_prepend (NULL, contact);
- eab_send_contact_list (list, disposition);
- g_list_free (list);
-}
diff --git a/addressbook/gui/widgets/eab-gui-util.h b/addressbook/gui/widgets/eab-gui-util.h
deleted file mode 100644
index 24a0a78577..0000000000
--- a/addressbook/gui/widgets/eab-gui-util.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* eab-gui-util.h
- * Copyright (C) 2001-2003 Ximian, Inc.
- * Author: Chris Toshok <toshok@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-#ifndef __E_ADDRESSBOOK_UTIL_H__
-#define __E_ADDRESSBOOK_UTIL_H__
-
-#include <gtk/gtkwindow.h>
-#include <libebook/e-book.h>
-#include "addressbook/gui/contact-editor/e-contact-editor.h"
-#include "addressbook/gui/contact-list-editor/e-contact-list-editor.h"
-
-G_BEGIN_DECLS
-
-void eab_error_dialog (const gchar *msg,
- EBookStatus status);
-gint eab_prompt_save_dialog (GtkWindow *parent);
-
-EContactEditor *eab_show_contact_editor (EBook *book,
- EContact *contact,
- gboolean is_new_contact,
- gboolean editable);
-EContactListEditor *eab_show_contact_list_editor (EBook *book,
- EContact *contact,
- gboolean is_new_contact,
- gboolean editable);
-void eab_show_multiple_contacts (EBook *book,
- GList *list,
- gboolean editable);
-void eab_transfer_contacts (EBook *source,
- GList *contacts, /* adopted */
- gboolean delete_from_source,
- GtkWindow *parent_window);
-
-void eab_contact_save (char *title,
- EContact *contact,
- GtkWindow *parent_window);
-
-void eab_contact_list_save (char *title,
- GList *list,
- GtkWindow *parent_window);
-
-typedef enum {
- EAB_DISPOSITION_AS_ATTACHMENT,
- EAB_DISPOSITION_AS_TO,
-} EABDisposition;
-
-void eab_send_contact (EContact *contact,
- EABDisposition disposition);
-void eab_send_contact_list (GList *contacts,
- EABDisposition disposition);
-
-G_END_DECLS
-
-#endif /* __E_ADDRESSBOOK_UTIL_H__ */
diff --git a/addressbook/gui/widgets/eab-marshal.list b/addressbook/gui/widgets/eab-marshal.list
deleted file mode 100644
index 2b34707dbb..0000000000
--- a/addressbook/gui/widgets/eab-marshal.list
+++ /dev/null
@@ -1,11 +0,0 @@
-INT:POINTER
-NONE:NONE
-NONE:BOOL
-NONE:POINTER
-NONE:OBJECT
-NONE:ENUM
-NONE:INT,INT
-NONE:INT
-NONE:UINT
-NONE:DOUBLE
-INT:POINTER
diff --git a/addressbook/gui/widgets/eab-popup-control.c b/addressbook/gui/widgets/eab-popup-control.c
deleted file mode 100644
index 6e2ad6a603..0000000000
--- a/addressbook/gui/widgets/eab-popup-control.c
+++ /dev/null
@@ -1,1236 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * eab-popup-control.c
- *
- * Copyright (C) 2001-2003, Ximian, Inc.
- *
- * Authors: Jon Trowbridge <trow@ximian.com>
- * Chris Toshok <toshok@ximian.com>
- */
-
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA.
- */
-
-/*
- * This file is too big and this widget is too complicated. Forgive me.
- */
-
-#include <config.h>
-#include <string.h>
-#include "addressbook.h"
-#include "eab-popup-control.h"
-#include <bonobo/bonobo-control.h>
-#include <bonobo/bonobo-property-bag.h>
-#include <bonobo/bonobo-generic-factory.h>
-#include <gal/widgets/e-popup-menu.h>
-#include <libebook/e-book-async.h>
-#include <addressbook/util/eab-book-util.h>
-#include <addressbook/gui/contact-editor/e-contact-editor.h>
-#include <addressbook/gui/contact-editor/e-contact-quick-add.h>
-#include <addressbook/gui/widgets/eab-contact-display.h>
-#include <addressbook/gui/widgets/eab-gui-util.h>
-#include "e-util/e-gui-utils.h"
-
-static void eab_popup_control_set_name (EABPopupControl *pop, const gchar *name);
-static void eab_popup_control_set_email (EABPopupControl *pop, const gchar *email);
-
-/*
- * Some general scaffolding for our widgets. Think of this as a really, really
- * lame implementation of a wizard (...which is still somewhat more general that
- * we really need it to be).
- */
-
-typedef struct _MiniWizard MiniWizard;
-struct _MiniWizard {
- GtkWidget *body;
-
- GtkWidget *vbox;
- GtkWidget *ok_button;
- GtkWidget *cancel_button;
-
- void (*ok_cb) (MiniWizard *, gpointer);
- void (*cleanup_cb) (gpointer);
- gpointer closure;
-
- void (*destroy_cb) (MiniWizard *, gpointer);
- gpointer destroy_closure;
-};
-
-static void
-mini_wizard_container_add (MiniWizard *wiz, GtkWidget *w)
-{
- GList *iter = gtk_container_get_children (GTK_CONTAINER (wiz->vbox));
- while (iter != NULL) {
- GtkWidget *oldw = (GtkWidget *) iter->data;
- iter = g_list_next (iter);
- gtk_container_remove (GTK_CONTAINER (wiz->vbox), oldw);
- }
- gtk_container_add (GTK_CONTAINER (wiz->vbox), w);
-}
-
-static void
-mini_wizard_destroy (MiniWizard *wiz)
-{
- if (wiz->cleanup_cb)
- wiz->cleanup_cb (wiz->closure);
- wiz->cleanup_cb = NULL;
-
- if (wiz->destroy_cb)
- wiz->destroy_cb (wiz, wiz->destroy_closure);
-}
-
-static void
-mini_wizard_ok_cb (GtkWidget *b, gpointer closure)
-{
- MiniWizard *wiz = (MiniWizard *) closure;
-
- gpointer old_closure = wiz->closure;
- void (*old_cleanup) (gpointer) = wiz->cleanup_cb;
-
- wiz->cleanup_cb = NULL;
-
- if (wiz->ok_cb)
- wiz->ok_cb (wiz, wiz->closure);
-
- if (old_cleanup)
- old_cleanup (old_closure);
-
-}
-
-static void
-mini_wizard_cancel_cb (GtkWidget *b, gpointer closure)
-{
- mini_wizard_destroy ((MiniWizard *) closure);
-}
-
-static void
-mini_wizard_destroy_cb (gpointer closure, GObject *where_object_was)
-{
- MiniWizard *wiz = (MiniWizard *) closure;
- if (wiz->cleanup_cb)
- wiz->cleanup_cb (wiz->closure);
- g_free (wiz);
-}
-
-static MiniWizard *
-mini_wizard_new (void)
-{
- MiniWizard *wiz = g_new (MiniWizard, 1);
- GtkWidget *bbox;
-
- wiz->body = gtk_vbox_new (FALSE, 2);
- wiz->vbox = gtk_vbox_new (FALSE, 2);
- wiz->ok_button = gtk_button_new_from_stock (GTK_STOCK_OK);
- wiz->cancel_button = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
-
- wiz->ok_cb = NULL;
- wiz->cleanup_cb = NULL;
- wiz->closure = NULL;
-
- wiz->destroy_cb = NULL;
- wiz->destroy_closure = NULL;
-
- bbox = gtk_hbutton_box_new ();
- gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox),
- GTK_BUTTONBOX_END);
-
- gtk_box_pack_start (GTK_BOX (bbox), wiz->cancel_button, FALSE, TRUE, 0);
- gtk_box_pack_start (GTK_BOX (bbox), wiz->ok_button, FALSE, TRUE, 0);
-
- gtk_box_set_spacing (GTK_BOX (bbox),
- 10 /* ugh */);
-
- gtk_box_pack_start (GTK_BOX (wiz->body), wiz->vbox, TRUE, TRUE, 2);
- gtk_box_pack_start (GTK_BOX (wiz->body), gtk_hseparator_new (), FALSE, TRUE, 2);
- gtk_box_pack_start (GTK_BOX (wiz->body), bbox, FALSE, TRUE, 2);
-
- gtk_widget_show_all (wiz->body);
-
- g_signal_connect (wiz->ok_button,
- "clicked",
- G_CALLBACK (mini_wizard_ok_cb),
- wiz);
- g_signal_connect (wiz->cancel_button,
- "clicked",
- G_CALLBACK (mini_wizard_cancel_cb),
- wiz);
-
- g_object_weak_ref (G_OBJECT (wiz->body),
- mini_wizard_destroy_cb,
- wiz);
-
- return wiz;
-
-}
-
-
-
-/*
- * This is the code for the UI thingie that lets you manipulate the e-mail
- * addresses (and *only* the e-mail addresses) associated with an existing
- * contact.
- */
-
-#define EMPTY_ENTRY N_("(none)")
-
-typedef struct _EMailMenu EMailMenu;
-struct _EMailMenu {
- GtkWidget *option_menu;
- GList *options;
- gchar *current_selection;
-};
-
-static void
-email_menu_free (EMailMenu *menu)
-{
- if (menu == NULL)
- return;
-
- g_list_foreach (menu->options, (GFunc) g_free, NULL);
- g_list_free (menu->options);
- g_free (menu);
-}
-
-static EMailMenu *
-email_menu_new (void)
-{
- EMailMenu *menu = g_new (EMailMenu, 1);
-
- menu->option_menu = gtk_option_menu_new ();
- menu->options = NULL;
- menu->current_selection = NULL;
-
- gtk_option_menu_set_menu (GTK_OPTION_MENU (menu->option_menu), gtk_menu_new ());
-
- return menu;
-}
-
-static void
-menu_activate_cb (GtkWidget *w, gpointer closure)
-{
- EMailMenu *menu = (EMailMenu *) closure;
- gchar *addr = (gchar *) g_object_get_data (G_OBJECT (w), "addr");
-
- menu->current_selection = addr;
-}
-
-static void
-email_menu_add_option (EMailMenu *menu, char *addr)
-{
- GtkWidget *menu_item;
-
- g_return_if_fail (menu != NULL);
- if (addr == NULL)
- return;
-
- menu->options = g_list_append (menu->options, addr);
-
- menu_item = gtk_menu_item_new_with_label (addr);
- g_object_set_data (G_OBJECT (menu_item), "addr", addr);
- gtk_widget_show_all (menu_item);
- gtk_menu_shell_append (GTK_MENU_SHELL (gtk_option_menu_get_menu (GTK_OPTION_MENU (menu->option_menu))), menu_item);
-
- g_signal_connect (menu_item,
- "activate",
- G_CALLBACK (menu_activate_cb),
- menu);
-}
-
-static void
-email_menu_add_options_from_contact (EMailMenu *menu, EContact *contact, const gchar *extra_addr)
-{
- g_return_if_fail (contact && E_IS_CONTACT (contact));
-
- /* If any of these three e-mail fields are NULL, email_menu_add_option will just
- return without doing anything. */
- email_menu_add_option (menu, e_contact_get (contact, E_CONTACT_EMAIL_1));
- email_menu_add_option (menu, e_contact_get (contact, E_CONTACT_EMAIL_2));
- email_menu_add_option (menu, e_contact_get (contact, E_CONTACT_EMAIL_3));
- email_menu_add_option (menu, g_strdup (extra_addr));
- email_menu_add_option (menu, EMPTY_ENTRY);
-}
-
-static void
-email_menu_set_option (EMailMenu *menu, const gchar *addr)
-{
- guint count = 0;
- GList *iter;
-
- g_return_if_fail (menu != NULL);
-
- if (addr == NULL) {
- email_menu_set_option (menu, EMPTY_ENTRY);
- return;
- }
-
- iter = menu->options;
- while (iter && strcmp (addr, (gchar *) iter->data)) {
- ++count;
- iter = g_list_next (iter);
- }
-
- if (iter) {
- gtk_option_menu_set_history (GTK_OPTION_MENU (menu->option_menu), count);
- menu->current_selection = (gchar *) iter->data;
- }
-}
-
-#ifdef UNDEFINED_FUNCTIONS_SHOULD_PLEASE_BE_INCLUDED
-static void
-email_menu_unset_option (EMailMenu *menu, const gchar *addr)
-{
- GList *iter;
-
- g_return_if_fail (menu != NULL);
- g_return_if_fail (addr != NULL);
-
- if (menu->current_selection == NULL || strcmp (addr, menu->current_selection))
- return;
-
- iter = menu->options;
- while (iter && strcmp (addr, (gchar *) iter->data)) {
- iter = g_list_next (iter);
- }
- if (iter) {
- iter = g_list_next (iter);
- if (iter) {
- email_menu_set_option (menu, (gchar *) iter->data);
- } else {
- email_menu_set_option (menu, EMPTY_ENTRY);
- }
- }
-}
-#endif
-
-
-
-typedef struct _EMailTable EMailTable;
-struct _EMailTable {
- GtkWidget *table;
- EContact *contact;
- EMailMenu *primary;
- EMailMenu *email2;
- EMailMenu *email3;
-};
-
-static void
-email_table_cleanup_cb (gpointer closure)
-{
- EMailTable *et = (EMailTable *) closure;
-
- if (et == NULL)
- return;
-
- g_object_unref (et->contact);
- email_menu_free (et->primary);
- email_menu_free (et->email2);
- email_menu_free (et->email3);
-
- g_free (et);
-}
-
-static void
-email_table_from_contact (EMailTable *et)
-{
- g_return_if_fail (et != NULL);
-
- email_menu_set_option (et->primary, e_contact_get_const (et->contact, E_CONTACT_EMAIL_1));
- email_menu_set_option (et->email2, e_contact_get_const (et->contact, E_CONTACT_EMAIL_2));
- email_menu_set_option (et->email3, e_contact_get_const (et->contact, E_CONTACT_EMAIL_3));
-}
-
-static void
-email_table_to_contact (EMailTable *et)
-{
- gchar *curr;
-
- g_return_if_fail (et != NULL);
-
- curr = et->primary->current_selection;
- if (curr && !strcmp (curr, _(EMPTY_ENTRY)))
- curr = NULL;
- e_contact_set (et->contact, E_CONTACT_EMAIL_1, curr);
-
- curr = et->email2->current_selection;
- if (curr && !strcmp (curr, _(EMPTY_ENTRY)))
- curr = NULL;
- e_contact_set (et->contact, E_CONTACT_EMAIL_2, curr);
-
- curr = et->email3->current_selection;
- if (curr && !strcmp (curr, _(EMPTY_ENTRY)))
- curr = NULL;
- e_contact_set (et->contact, E_CONTACT_EMAIL_3, curr);
-}
-
-static void
-email_table_save_contact_cb (EBook *book, EBookStatus status, gpointer closure)
-{
- EContact *contact = E_CONTACT (closure);
-
- if (status == E_BOOK_ERROR_OK) {
- e_book_async_commit_contact (book, contact, NULL, NULL);
- }
- if (book)
- g_object_unref (book);
- g_object_unref (contact);
-}
-
-static void
-email_table_ok_cb (MiniWizard *wiz, gpointer closure)
-{
- EMailTable *et = (EMailTable *) closure;
-
- email_table_to_contact (et);
-
- g_object_ref (et->contact);
-
- addressbook_load_default_book (email_table_save_contact_cb, et->contact);
-
- mini_wizard_destroy (wiz);
-}
-
-static void
-email_table_init (MiniWizard *wiz, EContact *contact, const gchar *extra_address)
-{
- EMailTable *et;
-
- gchar *name_str;
- gint xpad, ypad;
- GtkAttachOptions label_x_opts, label_y_opts;
- GtkAttachOptions menu_x_opts, menu_y_opts;
-
- g_return_if_fail (contact && E_IS_CONTACT (contact));
-
- et = g_new (EMailTable, 1);
-
- et->contact = contact;
- g_object_ref (et->contact);
-
- et->table = gtk_table_new (4, 2, FALSE);
-
- et->primary = email_menu_new ();
- et->email2 = email_menu_new ();
- et->email3 = email_menu_new ();
-
- email_menu_add_options_from_contact (et->primary, et->contact, extra_address);
- email_menu_add_options_from_contact (et->email2, et->contact, extra_address);
- email_menu_add_options_from_contact (et->email3, et->contact, extra_address);
-
- email_table_from_contact (et);
-
- label_x_opts = GTK_FILL;
- label_y_opts = GTK_FILL;
- menu_x_opts = GTK_EXPAND | GTK_FILL;
- menu_y_opts = GTK_EXPAND | GTK_FILL;
- xpad = 3;
- ypad = 3;
-
- name_str = e_contact_get (et->contact, E_CONTACT_FULL_NAME);
- gtk_table_attach (GTK_TABLE (et->table),
- gtk_label_new (name_str),
- 0, 2, 0, 1,
- label_x_opts, label_y_opts, xpad, ypad);
- g_free (name_str);
-
- gtk_table_attach (GTK_TABLE (et->table),
- gtk_label_new (_("Primary Email")),
- 0, 1, 1, 2,
- label_x_opts, label_y_opts, xpad, ypad);
-
- gtk_table_attach (GTK_TABLE (et->table),
- et->primary->option_menu,
- 1, 2, 1, 2,
- menu_x_opts, menu_y_opts, xpad, ypad);
-
- gtk_table_attach (GTK_TABLE (et->table),
- gtk_label_new (_("Email 2")),
- 0, 1, 2, 3,
- label_x_opts, label_y_opts, xpad, ypad);
-
- gtk_table_attach (GTK_TABLE (et->table),
- et->email2->option_menu,
- 1, 2, 2, 3,
- menu_x_opts, menu_y_opts, xpad, ypad);
-
- gtk_table_attach (GTK_TABLE (et->table),
- gtk_label_new (_("Email 3")),
- 0, 1, 3, 4,
- label_x_opts, label_y_opts, xpad, ypad);
-
- gtk_table_attach (GTK_TABLE (et->table),
- et->email3->option_menu,
- 1, 2, 3, 4,
- menu_x_opts, menu_y_opts, xpad, ypad);
-
- gtk_widget_show_all (et->primary->option_menu);
- gtk_widget_show_all (et->email2->option_menu);
- gtk_widget_show_all (et->email3->option_menu);
-
- gtk_widget_show_all (et->table);
- mini_wizard_container_add (wiz, et->table);
- wiz->ok_cb = email_table_ok_cb;
- wiz->cleanup_cb = email_table_cleanup_cb;
- wiz->closure = et;
-}
-
-/*
- * This code is for the little UI thing that lets you pick from a set of contacts
- * and decide which one you want to add the e-mail address to.
- */
-
-typedef struct _ContactPicker ContactPicker;
-struct _ContactPicker {
- GtkWidget *body;
- GtkWidget *list;
- GtkListStore *model;
- GList *contacts;
- gchar *new_name;
- gchar *new_email;
-
- EContact *current_contact;
-};
-
-enum {
- COLUMN_ACTION,
- COLUMN_CONTACT
-};
-
-static void
-contact_picker_selection_changed (GtkTreeSelection *selection, gpointer closure)
-{
- MiniWizard *wiz = (MiniWizard *) closure;
- ContactPicker *pick = (ContactPicker *) wiz->closure;
- gboolean selected;
- GtkTreeIter iter;
-
- selected = gtk_tree_selection_get_selected (selection, NULL, &iter);
-
- gtk_widget_set_sensitive (wiz->ok_button, selected);
-
- if (selected) {
- gtk_tree_model_get (GTK_TREE_MODEL (pick->model), &iter,
- COLUMN_CONTACT, &pick->current_contact,
- -1);
- }
- else {
- pick->current_contact = NULL;
- }
-}
-
-static void
-contact_picker_ok_cb (MiniWizard *wiz, gpointer closure)
-{
- ContactPicker *pick = (ContactPicker *) closure;
-
- if (pick->current_contact == NULL) {
- e_contact_quick_add (pick->new_name, pick->new_email, NULL, NULL);
- mini_wizard_destroy (wiz);
- } else {
- email_table_init (wiz, pick->current_contact, pick->new_email);
- }
-}
-
-static void
-contact_picker_cleanup_cb (gpointer closure)
-{
- ContactPicker *pick = (ContactPicker *) closure;
-
- g_list_foreach (pick->contacts, (GFunc) g_object_unref, NULL);
- g_list_free (pick->contacts);
-
- g_free (pick->new_name);
- g_free (pick->new_email);
-}
-
-static void
-free_str (gpointer data,
- GObject *where_the_object_was)
-{
- g_free (data);
-}
-
-static void
-contact_picker_init (MiniWizard *wiz, const GList *contacts, const gchar *new_name, const gchar *new_email)
-{
- ContactPicker *pick;
- gchar *str;
- GtkWidget *w;
- GtkTreeIter iter;
-
- pick = g_new (ContactPicker, 1);
-
- pick->body = gtk_vbox_new (FALSE, 2);
-
- pick->model = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER);
-
- pick->list = gtk_tree_view_new_with_model (GTK_TREE_MODEL (pick->model));
-
- gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (pick->list), TRUE);
-
- gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (pick->list),
- COLUMN_ACTION,
- _("Select an Action"),
- gtk_cell_renderer_text_new (),
- "text", COLUMN_ACTION,
- NULL);
-
- gtk_tree_selection_set_mode (gtk_tree_view_get_selection (GTK_TREE_VIEW (pick->list)),
- GTK_SELECTION_SINGLE);
-
- str = g_strdup_printf (_("Create a new contact \"%s\""), new_name);
- gtk_list_store_append (pick->model, &iter);
- gtk_list_store_set (pick->model, &iter,
- COLUMN_ACTION, str,
- COLUMN_CONTACT, NULL,
- -1);
- g_object_weak_ref (G_OBJECT (pick->model), free_str, str);
-
- pick->contacts = NULL;
- while (contacts) {
- EContact *contact = (EContact *) contacts->data;
- gchar *name_str = e_contact_get (contact, E_CONTACT_FULL_NAME);
-
- pick->contacts = g_list_append (pick->contacts, contact);
- g_object_ref (contact);
-
- str = g_strdup_printf (_("Add address to existing contact \"%s\""), name_str);
- gtk_list_store_append (pick->model, &iter);
- gtk_list_store_set (pick->model, &iter,
- COLUMN_ACTION, str,
- COLUMN_CONTACT, contact,
- -1);
- g_free (name_str);
-
- g_object_weak_ref (G_OBJECT (pick->model), free_str, str);
-
- contacts = g_list_next (contacts);
- }
-
- pick->new_name = g_strdup (new_name);
- pick->new_email = g_strdup (new_email);
-
- pick->current_contact = NULL;
- gtk_widget_set_sensitive (wiz->ok_button, FALSE);
-
- /* Connect some signals & callbacks */
-
- wiz->ok_cb = contact_picker_ok_cb;
- wiz->cleanup_cb = contact_picker_cleanup_cb;
-
- g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (pick->list)),
- "changed", G_CALLBACK (contact_picker_selection_changed),
- wiz);
-
- /* Build our widget */
-
- w = gtk_label_new (new_email);
- gtk_box_pack_start (GTK_BOX (pick->body), w, FALSE, TRUE, 3);
-
- gtk_box_pack_start (GTK_BOX (pick->body), pick->list, TRUE, TRUE, 2);
- gtk_widget_show_all (pick->body);
-
-
- /* Put it in our mini-wizard */
-
- wiz->closure = pick;
- mini_wizard_container_add (wiz, pick->body);
-}
-
-/* ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** */
-
-/*
- * The code for the actual EABPopupControl widget begins here.
- */
-
-/* ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** */
-
-
-static GtkObjectClass *parent_class;
-
-static void eab_popup_control_dispose (GObject *);
-static void eab_popup_control_query (EABPopupControl *);
-
-
-static void
-eab_popup_control_class_init (EABPopupControlClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_peek_parent (klass);
-
- object_class->dispose = eab_popup_control_dispose;
-}
-
-static void
-eab_popup_control_init (EABPopupControl *pop)
-{
- pop->transitory = TRUE;
-}
-
-static void
-eab_popup_control_cleanup (EABPopupControl *pop)
-{
- if (pop->contact) {
- g_object_unref (pop->contact);
- pop->contact = NULL;
- }
-
- if (pop->scheduled_refresh) {
- g_source_remove (pop->scheduled_refresh);
- pop->scheduled_refresh = 0;
- }
-
- if (pop->query_tag) {
-#if notyet
- e_book_simple_query_cancel (pop->book, pop->query_tag);
-#endif
- pop->query_tag = 0;
- }
-
- if (pop->book) {
- g_object_unref (pop->book);
- pop->book = NULL;
- }
-
- g_free (pop->name);
- pop->name = NULL;
-
- g_free (pop->email);
- pop->email = NULL;
-}
-
-static void
-eab_popup_control_dispose (GObject *obj)
-{
- EABPopupControl *pop = EAB_POPUP_CONTROL (obj);
-
- eab_popup_control_cleanup (pop);
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- G_OBJECT_CLASS (parent_class)->dispose (obj);
-}
-
-GType
-eab_popup_control_get_type (void)
-{
- static GType pop_type = 0;
-
- if (!pop_type) {
- static const GTypeInfo pop_info = {
- sizeof (EABPopupControlClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) eab_popup_control_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EABPopupControl),
- 0, /* n_preallocs */
- (GInstanceInitFunc) eab_popup_control_init,
- };
-
- pop_type = g_type_register_static (gtk_event_box_get_type (), "EABPopupControl", &pop_info, 0);
- }
-
- return pop_type;
-}
-
-static void
-eab_popup_control_refresh_names (EABPopupControl *pop)
-{
- if (pop->name_widget) {
- if (pop->name && *pop->name) {
- gtk_label_set_text (GTK_LABEL (pop->name_widget), pop->name);
- gtk_widget_show (pop->name_widget);
- } else {
- gtk_widget_hide (pop->name_widget);
- }
- }
-
- if (pop->email_widget) {
- if (pop->email && *pop->email) {
- gtk_label_set_text (GTK_LABEL (pop->email_widget), pop->email);
- gtk_widget_show (pop->email_widget);
- } else {
- gtk_widget_hide (pop->email_widget);
- }
- }
-
- eab_popup_control_query (pop);
-}
-
-static gint
-refresh_timeout_cb (gpointer ptr)
-{
- EABPopupControl *pop = EAB_POPUP_CONTROL (ptr);
- eab_popup_control_refresh_names (pop);
- pop->scheduled_refresh = 0;
- return 0;
-}
-
-static void
-eab_popup_control_schedule_refresh (EABPopupControl *pop)
-{
- if (pop->scheduled_refresh == 0)
- pop->scheduled_refresh = g_timeout_add (20, refresh_timeout_cb, pop);
-}
-
-/* If we are handed something of the form "Foo <bar@bar.com>",
- do the right thing. */
-static gboolean
-eab_popup_control_set_free_form (EABPopupControl *pop, const gchar *txt)
-{
- gchar *lt, *gt = NULL;
-
- g_return_val_if_fail (pop && EAB_IS_POPUP_CONTROL (pop), FALSE);
-
- if (txt == NULL)
- return FALSE;
-
- lt = strchr (txt, '<');
- if (lt)
- gt = strchr (txt, '>');
-
- if (lt && gt && lt+1 < gt) {
- gchar *name = g_strndup (txt, lt-txt);
- gchar *email = g_strndup (lt+1, gt-lt-1);
- eab_popup_control_set_name (pop, name);
- eab_popup_control_set_email (pop, email);
-
- return TRUE;
- }
-
- return FALSE;
-}
-
-static void
-eab_popup_control_set_name (EABPopupControl *pop, const gchar *name)
-{
- g_return_if_fail (pop && EAB_IS_POPUP_CONTROL (pop));
-
- /* We only allow the name to be set once. */
- if (pop->name)
- return;
-
- if (!eab_popup_control_set_free_form (pop, name)) {
- pop->name = g_strdup (name);
- if (pop->name)
- g_strstrip (pop->name);
- }
-
- eab_popup_control_schedule_refresh (pop);
-}
-
-static void
-eab_popup_control_set_email (EABPopupControl *pop, const gchar *email)
-{
- g_return_if_fail (pop && EAB_IS_POPUP_CONTROL (pop));
-
- /* We only allow the e-mail to be set once. */
- if (pop->email)
- return;
-
- if (!eab_popup_control_set_free_form (pop, email)) {
- pop->email = g_strdup (email);
- if (pop->email)
- g_strstrip (pop->email);
- }
-
- eab_popup_control_schedule_refresh (pop);
-}
-
-void
-eab_popup_control_construct (EABPopupControl *pop)
-{
- GtkWidget *vbox, *name_holder;
- GdkColor color = { 0x0, 0xffff, 0xffff, 0xffff };
-
- g_return_if_fail (pop && EAB_IS_POPUP_CONTROL (pop));
-
- pop->main_vbox = gtk_vbox_new (FALSE, 0);
-
- /* Build Generic View */
-
- name_holder = gtk_event_box_new ();
- vbox = gtk_vbox_new (FALSE, 2);
- pop->name_widget = gtk_label_new ("");
- pop->email_widget = gtk_label_new ("");
-
- gtk_box_pack_start (GTK_BOX (vbox), pop->name_widget, TRUE, TRUE, 2);
- gtk_box_pack_start (GTK_BOX (vbox), pop->email_widget, TRUE, TRUE, 2);
- gtk_container_add (GTK_CONTAINER (name_holder), GTK_WIDGET (vbox));
-
- if (gdk_colormap_alloc_color (gtk_widget_get_colormap (GTK_WIDGET (name_holder)), &color, FALSE, TRUE)) {
- GtkStyle *style = gtk_style_copy (gtk_widget_get_style (GTK_WIDGET (name_holder)));
- style->bg[0] = color;
- gtk_widget_set_style (GTK_WIDGET (name_holder), style);
- g_object_unref (style);
- }
-
- pop->generic_view = gtk_frame_new (NULL);
- gtk_container_add (GTK_CONTAINER (pop->generic_view), name_holder);
- gtk_box_pack_start (GTK_BOX (pop->main_vbox), pop->generic_view, TRUE, TRUE, 0);
- gtk_widget_show_all (pop->generic_view);
-
- pop->query_msg = gtk_label_new (_("Querying Addressbook..."));
- gtk_box_pack_start (GTK_BOX (pop->main_vbox), pop->query_msg, TRUE, TRUE, 0);
- gtk_widget_show (pop->query_msg);
-
- /* Build ContactDisplay */
- pop->contact_display = eab_contact_display_new ();
- gtk_box_pack_start (GTK_BOX (pop->main_vbox), pop->contact_display, TRUE, TRUE, 0);
-
-
- /* Final assembly */
-
- gtk_container_add (GTK_CONTAINER (pop), pop->main_vbox);
- gtk_widget_show (pop->main_vbox);
-
- gtk_container_set_border_width (GTK_CONTAINER (vbox), 3);
- gtk_container_set_border_width (GTK_CONTAINER (pop), 2);
-}
-
-static GtkWidget *
-eab_popup_new (void)
-{
- EABPopupControl *pop = g_object_new (EAB_TYPE_POPUP_CONTROL, NULL);
- eab_popup_control_construct (pop);
- return GTK_WIDGET (pop);
-}
-
-static void
-emit_event (EABPopupControl *pop, const char *event)
-{
- if (pop->es) {
- BonoboArg *arg;
-
- arg = bonobo_arg_new (BONOBO_ARG_BOOLEAN);
- BONOBO_ARG_SET_BOOLEAN (arg, TRUE);
- bonobo_event_source_notify_listeners_full (pop->es,
- "GNOME/Evolution/Addressbook/AddressPopup",
- "Event",
- event,
- arg, NULL);
- bonobo_arg_release (arg);
- }
-}
-
-static void
-contact_editor_cb (EBook *book, EBookStatus status, gpointer closure)
-{
- if (status == E_BOOK_ERROR_OK) {
- EABPopupControl *pop = EAB_POPUP_CONTROL (closure);
- EContactEditor *ce = eab_show_contact_editor (book, pop->contact, FALSE, TRUE);
- eab_popup_control_cleanup (pop);
- emit_event (pop, "Destroy");
- e_contact_editor_raise (ce);
- }
-
- if (book)
- g_object_unref (book);
-}
-
-static void
-edit_contact_info_cb (GtkWidget *button, EABPopupControl *pop)
-{
- emit_event (pop, "Hide");
-
- addressbook_load_default_book (contact_editor_cb, pop);
-}
-
-static void
-eab_popup_control_display_contact (EABPopupControl *pop, EContact *contact)
-{
- GtkWidget *b;
-
- g_return_if_fail (pop && EAB_IS_POPUP_CONTROL (pop));
- g_return_if_fail (contact && E_IS_CONTACT (contact));
- g_return_if_fail (pop->contact == NULL);
-
- pop->contact = contact;
- g_object_ref (pop->contact);
-
- eab_contact_display_render (EAB_CONTACT_DISPLAY (pop->contact_display),
- contact,
- EAB_CONTACT_DISPLAY_RENDER_COMPACT);
- gtk_widget_show (pop->contact_display);
- gtk_widget_hide (pop->generic_view);
-
- b = gtk_button_new_with_label (_("Edit Contact Info"));
- gtk_box_pack_start (GTK_BOX (pop->main_vbox), b, TRUE, TRUE, 0);
- g_signal_connect (b,
- "clicked",
- G_CALLBACK (edit_contact_info_cb),
- pop);
- gtk_widget_show (b);
-}
-
-static void
-add_contacts_cb (GtkWidget *button, EABPopupControl *pop)
-{
- if (pop->email && *pop->email) {
- if (pop->name && *pop->name)
- e_contact_quick_add (pop->name, pop->email, NULL, NULL);
- else
- e_contact_quick_add_free_form (pop->email, NULL, NULL);
-
- }
- eab_popup_control_cleanup (pop);
- emit_event (pop, "Destroy");
-}
-
-static void
-eab_popup_control_no_matches (EABPopupControl *pop)
-{
- GtkWidget *b;
-
- g_return_if_fail (pop && EAB_IS_POPUP_CONTROL (pop));
-
- b = e_button_new_with_stock_icon (_("Add to Contacts"), "gtk-add");
-
- gtk_box_pack_start (GTK_BOX (pop->main_vbox), b, TRUE, TRUE, 0);
- g_signal_connect (b,
- "clicked",
- G_CALLBACK (add_contacts_cb),
- pop);
- gtk_widget_show (b);
-}
-
-static void
-wizard_destroy_cb (MiniWizard *wiz, gpointer closure)
-{
- gtk_widget_destroy (GTK_WIDGET (closure));
-}
-
-static void
-eab_popup_control_ambiguous_email_add (EABPopupControl *pop, const GList *contacts)
-{
- MiniWizard *wiz = mini_wizard_new ();
- GtkWidget *win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
-
- wiz->destroy_cb = wizard_destroy_cb;
- wiz->destroy_closure = win;
-
- gtk_window_set_title (GTK_WINDOW (win), _("Merge E-Mail Address"));
- gtk_window_set_position (GTK_WINDOW (win), GTK_WIN_POS_MOUSE);
-
- contact_picker_init (wiz, contacts, pop->name, pop->email);
-
- eab_popup_control_cleanup (pop);
- emit_event (pop, "Destroy");
-
- gtk_container_add (GTK_CONTAINER (win), wiz->body);
- gtk_widget_show_all (win);
-}
-
-static void
-eab_popup_control_multiple_matches (EABPopupControl *pop, const GList *contacts)
-{
- pop->multiple_matches = TRUE;
-
- eab_popup_control_ambiguous_email_add (pop, contacts);
-}
-
-/** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **/
-
-/*
- * Addressbook Query Fun
- */
-
-static void
-name_only_query_cb (EBook *book, EBookStatus status, GList *contacts, gpointer closure)
-{
- EABPopupControl *pop;
-
- if (status != E_BOOK_ERROR_OK)
- return;
-
- pop = EAB_POPUP_CONTROL (closure);
-
- pop->query_tag = 0;
-
- if (contacts == NULL) {
- eab_popup_control_no_matches (pop);
- } else {
- eab_popup_control_ambiguous_email_add (pop, contacts);
- g_list_foreach (contacts, (GFunc)g_object_unref, NULL);
- g_list_free (contacts);
- }
-}
-
-static void
-query_cb (EBook *book, EBookStatus status, GList *contacts, gpointer closure)
-{
- EABPopupControl *pop;
-
- if (status != E_BOOK_ERROR_OK)
- return;
-
- pop = EAB_POPUP_CONTROL (closure);
-
- pop->query_tag = 0;
- gtk_widget_hide (pop->query_msg);
-
- if (contacts == NULL) {
-
- /* Do a name-only query if:
- (1) The name is non-empty.
- (2) The e-mail is also non-empty (so that the query we just did wasn't actually a name-only query.
- */
- if (pop->name && *pop->name && pop->email && *pop->email) {
- pop->query_tag = eab_name_and_email_query (book, pop->name, NULL, name_only_query_cb, pop);
- } else {
- eab_popup_control_no_matches (pop);
- }
-
- } else {
- if (g_list_length ((GList *) contacts) == 1)
- eab_popup_control_display_contact (pop, E_CONTACT (contacts->data));
- else
- eab_popup_control_multiple_matches (pop, contacts);
-
- g_list_foreach (contacts, (GFunc)g_object_unref, NULL);
- g_list_free (contacts);
- }
-}
-
-static void
-start_query (EBook *book, EBookStatus status, gpointer closure)
-{
- EABPopupControl *pop = EAB_POPUP_CONTROL (closure);
-
- if (status != E_BOOK_ERROR_OK) {
- eab_popup_control_no_matches (pop);
- if (book)
- g_object_unref (book);
- return;
- }
-
-#if notyet
- if (pop->query_tag)
- e_book_simple_query_cancel (book, pop->query_tag);
-#endif
-
- if (pop->book != book) {
- g_object_ref (book);
- if (pop->book)
- g_object_unref (pop->book);
- pop->book = book;
- }
-
- pop->query_tag = eab_name_and_email_query (book, pop->name, pop->email, query_cb, pop);
-
- g_object_unref (pop);
-}
-
-static void
-eab_popup_control_query (EABPopupControl *pop)
-{
- g_return_if_fail (pop && EAB_IS_POPUP_CONTROL (pop));
-
- g_object_ref (pop);
-
- addressbook_load_default_book (start_query, pop);
-}
-
-/** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **/
-
-enum {
- PROPERTY_NAME,
- PROPERTY_EMAIL,
- PROPERTY_TRANSITORY
-};
-
-static void
-set_prop (BonoboPropertyBag *bag, const BonoboArg *arg, guint arg_id, CORBA_Environment *ev, gpointer user_data)
-{
- EABPopupControl *pop = EAB_POPUP_CONTROL (user_data);
-
- switch (arg_id) {
-
- case PROPERTY_NAME:
- eab_popup_control_set_name (pop, BONOBO_ARG_GET_STRING (arg));
- break;
-
- case PROPERTY_EMAIL:
- eab_popup_control_set_email (pop, BONOBO_ARG_GET_STRING (arg));
- break;
-
- default:
- g_assert_not_reached ();
- }
-}
-
-static void
-get_prop (BonoboPropertyBag *bag, BonoboArg *arg, guint arg_id, CORBA_Environment *ev, gpointer user_data)
-{
- EABPopupControl *pop = EAB_POPUP_CONTROL (user_data);
-
- switch (arg_id) {
-
- case PROPERTY_NAME:
- BONOBO_ARG_SET_STRING (arg, pop->name);
- break;
-
- case PROPERTY_EMAIL:
- BONOBO_ARG_SET_STRING (arg, pop->email);
- break;
-
- case PROPERTY_TRANSITORY:
- BONOBO_ARG_SET_BOOLEAN (arg, pop->transitory);
- break;
-
- default:
- g_assert_not_reached ();
- }
-}
-
-BonoboControl *
-eab_popup_control_new (void)
-{
- BonoboControl *control;
- BonoboPropertyBag *bag;
- EABPopupControl *addy;
- GtkWidget *w;
-
- w = eab_popup_new ();
- addy = EAB_POPUP_CONTROL (w);
-
- control = bonobo_control_new (w);
- gtk_widget_show (w);
-
- bag = bonobo_property_bag_new (get_prop, set_prop, w);
- bonobo_property_bag_add (bag, "name", PROPERTY_NAME,
- BONOBO_ARG_STRING, NULL, NULL,
- BONOBO_PROPERTY_WRITEABLE | BONOBO_PROPERTY_READABLE);
-
- bonobo_property_bag_add (bag, "email", PROPERTY_EMAIL,
- BONOBO_ARG_STRING, NULL, NULL,
- BONOBO_PROPERTY_WRITEABLE | BONOBO_PROPERTY_READABLE);
-
- bonobo_property_bag_add (bag, "transitory", PROPERTY_TRANSITORY,
- BONOBO_ARG_BOOLEAN, NULL, NULL,
- BONOBO_PROPERTY_READABLE);
-
- bonobo_control_set_properties (control, bonobo_object_corba_objref (BONOBO_OBJECT (bag)), NULL);
- bonobo_object_unref (BONOBO_OBJECT (bag));
-
- addy->es = bonobo_event_source_new ();
- bonobo_object_add_interface (BONOBO_OBJECT (control),
- BONOBO_OBJECT (addy->es));
-
- return control;
-}
diff --git a/addressbook/gui/widgets/eab-popup-control.h b/addressbook/gui/widgets/eab-popup-control.h
deleted file mode 100644
index 2feb3ac7d0..0000000000
--- a/addressbook/gui/widgets/eab-popup-control.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * eab-popup-control.h
- *
- * Copyright (C) 2001-2003, Ximian, Inc.
- *
- * Authors: Jon Trowbridge <trow@ximian.com>
- * Chris Toshok <toshok@ximian.com>
- */
-
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA.
- */
-
-#ifndef __EAB_POPUP_CONTROL_H__
-#define __EAB_POPUP_CONTROL_H__
-
-#include <bonobo/bonobo-event-source.h>
-#include <gtk/gtk.h>
-#include <libebook/e-book-async.h>
-#include <libebook/e-contact.h>
-
-G_BEGIN_DECLS
-
-#define EAB_TYPE_POPUP_CONTROL (eab_popup_control_get_type ())
-#define EAB_POPUP_CONTROL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EAB_TYPE_POPUP_CONTROL, EABPopupControl))
-#define EAB_POPUP_CONTROL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), EAB_TYPE_POPUP_CONTROL, EABPopupControlClass))
-#define EAB_IS_POPUP_CONTROL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), EAB_TYPE_POPUP_CONTROL))
-#define EAB_IS_POPUP_CONTROL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EAB_TYPE_POPUP_CONTROL))
-
-typedef struct _EABPopupControl EABPopupControl;
-typedef struct _EABPopupControlClass EABPopupControlClass;
-
-struct _EABPopupControl {
- GtkEventBox parent;
-
- gchar *name;
- gchar *email;
-
- GtkWidget *name_widget;
- GtkWidget *email_widget;
- GtkWidget *query_msg;
-
- GtkWidget *main_vbox;
- GtkWidget *generic_view;
- GtkWidget *contact_display;
-
- gboolean transitory;
-
- guint scheduled_refresh;
- EBook *book;
- guint query_tag;
- gboolean multiple_matches;
- EContact *contact;
-
- BonoboEventSource *es;
-};
-
-struct _EABPopupControlClass {
- GtkEventBoxClass parent_class;
-};
-
-GType eab_popup_control_get_type (void);
-
-void eab_popup_control_construct (EABPopupControl *);
-
-BonoboControl *eab_popup_control_new (void);
-
-G_END_DECLS
-
-#endif /* __EAB_POPUP_CONTROL_H__ */
-
diff --git a/addressbook/gui/widgets/eab-vcard-control.c b/addressbook/gui/widgets/eab-vcard-control.c
deleted file mode 100644
index c161333f15..0000000000
--- a/addressbook/gui/widgets/eab-vcard-control.c
+++ /dev/null
@@ -1,310 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * eab-vcard-control.c
- *
- * Copyright (C) 1999, 2000, 2001, 2002, 2003, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- * Chris Toshok <toshok@ximian.com>
- */
-
-#include <config.h>
-#include <string.h>
-
-#include <gtk/gtk.h>
-#include <bonobo/bonobo-generic-factory.h>
-#include <bonobo/bonobo-persist.h>
-#include <bonobo/bonobo-persist-stream.h>
-#include <bonobo/bonobo-stream-client.h>
-#include <gal/util/e-util.h>
-
-#include <libebook/e-book-async.h>
-#include <libebook/e-contact.h>
-#include <addressbook/gui/component/addressbook.h>
-#include <addressbook/gui/widgets/eab-contact-display.h>
-#include <addressbook/util/eab-book-util.h>
-
-#include "eab-vcard-control.h"
-#include "eab-contact-merging.h"
-
-typedef struct {
- EABContactDisplay *display;
- GList *card_list;
- GtkWidget *label;
- EABContactDisplayRenderMode render_mode;
-} EABVCardControl;
-
-#define VCARD_CONTROL_ID "OAFIID:GNOME_Evolution_Addressbook_VCard_Control:" BASE_VERSION
-
-/*
- * Bonobo::PersistStream
- *
- * These two functions implement the Bonobo::PersistStream load and
- * save methods which allow data to be loaded into and out of the
- * BonoboObject.
- */
-static char *
-stream_read (Bonobo_Stream stream)
-{
- Bonobo_Stream_iobuf *buffer;
- CORBA_Environment ev;
- char *data = NULL;
- gint length = 0;
-
- CORBA_exception_init (&ev);
- do {
-#define READ_CHUNK_SIZE 65536
- Bonobo_Stream_read (stream, READ_CHUNK_SIZE,
- &buffer, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- CORBA_exception_free (&ev);
- return NULL;
- }
-
- if (buffer->_length <= 0)
- break;
-
- data = g_realloc (data, length + buffer->_length + 1);
-
- memcpy (data + length, buffer->_buffer, buffer->_length);
-
- length += buffer->_length;
-
- CORBA_free (buffer);
- } while (1);
-
- CORBA_free (buffer);
- CORBA_exception_free (&ev);
-
- if (data)
- data[length] = '\0';
- else
- data = g_strdup("");
-
- return data;
-} /* stream_read */
-
-/*
- * This function implements the Bonobo::PersistStream:load method.
- */
-static void
-pstream_load (BonoboPersistStream *ps, const Bonobo_Stream stream,
- Bonobo_Persist_ContentType type, void *data,
- CORBA_Environment *ev)
-{
- GList *list;
- char *vcard;
- EABVCardControl *vcard_control = data;
-
- if (type && g_ascii_strcasecmp (type, "text/vCard") != 0 &&
- g_ascii_strcasecmp (type, "text/x-vCard") != 0) {
- CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
- ex_Bonobo_Persist_WrongDataType, NULL);
- return;
- }
-
- if ((vcard = stream_read (stream)) == NULL) {
- CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
- ex_Bonobo_Persist_FileNotFound, NULL);
- return;
- }
-
- e_free_object_list (vcard_control->card_list);
- list = eab_contact_list_from_string (vcard);
- g_free(vcard);
- vcard_control->card_list = list;
- if (list) {
- eab_contact_display_render (vcard_control->display, E_CONTACT (list->data),
- vcard_control->render_mode);
- }
- if (list && list->next) {
- char *message;
- int length = g_list_length (list) - 1;
- if (length > 1) {
- message = g_strdup_printf (_("and %d other contacts."), length);
- } else {
- message = g_strdup_printf (_("and one other contact."));
- }
- gtk_label_set_text (GTK_LABEL (vcard_control->label), message);
- g_free (message);
- gtk_widget_show (vcard_control->label);
- } else {
- gtk_widget_hide (vcard_control->label);
- }
-} /* pstream_load */
-
-/*
- * This function implements the Bonobo::PersistStream:save method.
- */
-static void
-pstream_save (BonoboPersistStream *ps, const Bonobo_Stream stream,
- Bonobo_Persist_ContentType type, void *data,
- CORBA_Environment *ev)
-{
- EABVCardControl *vcard_control = data;
- char *vcard;
- int length;
-
- if (type && g_ascii_strcasecmp (type, "text/vCard") != 0 &&
- g_ascii_strcasecmp (type, "text/x-vCard") != 0) {
- CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
- ex_Bonobo_Persist_WrongDataType, NULL);
- return;
- }
-
- vcard = eab_contact_list_to_string (vcard_control->card_list);
- length = strlen (vcard);
- bonobo_stream_client_write (stream, vcard, length, ev);
- g_free (vcard);
-} /* pstream_save */
-
-static Bonobo_Persist_ContentTypeList *
-pstream_get_content_types (BonoboPersistStream *ps, void *closure,
- CORBA_Environment *ev)
-{
- return bonobo_persist_generate_content_types (2, "text/vCard", "text/x-vCard");
-}
-
-static void
-book_open_cb (EBook *book, EBookStatus status, gpointer closure)
-{
- GList *list = closure;
- if (status == E_BOOK_ERROR_OK) {
- GList *p;
- for (p = list; p; p = p->next) {
- /* XXX argh, more passing of NULL's for callbacks */
- eab_merging_book_add_contact (book, E_CONTACT (p->data), NULL, NULL);
- }
- }
- if (book)
- g_object_unref (book);
- e_free_object_list (list);
-}
-
-static void
-save_in_addressbook(GtkWidget *button, gpointer data)
-{
- EABVCardControl *vcard_control = data;
- GList *list, *p;
-
- list = g_list_copy (vcard_control->card_list);
-
- for (p = list; p; p = p->next)
- g_object_ref (p->data);
-
- addressbook_load_default_book (book_open_cb, list);
-}
-
-static void
-toggle_full_vcard(GtkWidget *button, gpointer data)
-{
- EABVCardControl *vcard_control = data;
- char *label;
-
- if (!vcard_control->card_list)
- return;
-
- if (vcard_control->render_mode == EAB_CONTACT_DISPLAY_RENDER_NORMAL) {
- vcard_control->render_mode = EAB_CONTACT_DISPLAY_RENDER_COMPACT;
- label = _("Show Full VCard");
- }
- else {
- vcard_control->render_mode = EAB_CONTACT_DISPLAY_RENDER_NORMAL;
- label = _("Show Compact VCard");
- }
-
- gtk_button_set_label (GTK_BUTTON (button), label);
- eab_contact_display_render (vcard_control->display, E_CONTACT (vcard_control->card_list->data),
- vcard_control->render_mode);
-}
-
-static void
-free_struct (gpointer data, GObject *where_object_was)
-{
- EABVCardControl *vcard_control = data;
- e_free_object_list (vcard_control->card_list);
- g_free (vcard_control);
-}
-
-BonoboControl *
-eab_vcard_control_new (void)
-{
- BonoboControl *control;
- BonoboPersistStream *stream;
- GtkWidget *display;
- GtkWidget *button1, *button2;
- GtkWidget *label;
- GtkWidget *table;
-
- EABVCardControl *vcard_control = g_new (EABVCardControl, 1);
-
- printf ("inside eab_vcard_control_new\n");
-
- vcard_control->card_list = NULL;
- vcard_control->display = NULL;
- vcard_control->label = NULL;
-
- vcard_control->render_mode = EAB_CONTACT_DISPLAY_RENDER_COMPACT;
-
- /* Create the control. */
-
- display = eab_contact_display_new ();
- gtk_widget_show (display);
- vcard_control->display = EAB_CONTACT_DISPLAY (display);
-
- /* This is intentionally not shown. */
- label = gtk_label_new ("");
- vcard_control->label = label;
-
- button1 = gtk_button_new_with_label(_("Show Full VCard"));
- g_signal_connect (button1, "clicked",
- G_CALLBACK (toggle_full_vcard), vcard_control);
- gtk_widget_show (button1);
-
- button2 = gtk_button_new_with_label(_("Save in addressbook"));
- g_signal_connect (button2, "clicked",
- G_CALLBACK (save_in_addressbook), vcard_control);
- gtk_widget_show (button2);
-
- table = gtk_table_new (6, 6, FALSE);
- gtk_table_attach (GTK_TABLE (table), display, 0, 6, 3, 6, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
- gtk_table_attach (GTK_TABLE (table), label, 0, 3, 2, 3, GTK_FILL, 0, 0, 0);
- gtk_table_attach (GTK_TABLE (table), button1, 0, 1, 1, 2, 0, 0, 0, 0);
- gtk_table_attach (GTK_TABLE (table), button2, 1, 2, 1, 2, 0, 0, 0, 0);
- gtk_widget_show (table);
-
- control = bonobo_control_new (table);
-
- g_object_weak_ref (G_OBJECT (control), free_struct, vcard_control);
-
- stream = bonobo_persist_stream_new (pstream_load, pstream_save,
- pstream_get_content_types,
- VCARD_CONTROL_ID,
- vcard_control);
-
- if (stream == NULL) {
- bonobo_object_unref (BONOBO_OBJECT (control));
- return NULL;
- }
-
- bonobo_object_add_interface (BONOBO_OBJECT (control),
- BONOBO_OBJECT (stream));
-
- return control;
-}
diff --git a/addressbook/gui/widgets/eab-vcard-control.h b/addressbook/gui/widgets/eab-vcard-control.h
deleted file mode 100644
index 5f6643c1ca..0000000000
--- a/addressbook/gui/widgets/eab-vcard-control.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __EAB_VCARD_CONTROL_H__
-#define __EAB_VCARD_CONTROL_H__
-
-#include <bonobo/bonobo-control.h>
-
-BonoboControl *eab_vcard_control_new (void);
-
-#endif /* __EAB_VCARD_CONTROL_H__ */
diff --git a/addressbook/gui/widgets/gal-view-factory-minicard.c b/addressbook/gui/widgets/gal-view-factory-minicard.c
deleted file mode 100644
index 212ac79b53..0000000000
--- a/addressbook/gui/widgets/gal-view-factory-minicard.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * gal-view-factory-minicard.c: A View Factory
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * (C) 2000, 2001 Ximian, Inc.
- */
-#include <config.h>
-#include <glib.h>
-#include <libgnome/gnome-i18n.h>
-#include "gal-view-factory-minicard.h"
-#include "gal-view-minicard.h"
-#include "gal/util/e-util.h"
-
-#define PARENT_TYPE GAL_VIEW_FACTORY_TYPE
-
-static GalViewFactoryClass *gal_view_factory_minicard_parent_class;
-
-static const char *
-gal_view_factory_minicard_get_title (GalViewFactory *factory)
-{
- return _("Card View");
-}
-
-static GalView *
-gal_view_factory_minicard_new_view (GalViewFactory *factory,
- const char *name)
-{
- return gal_view_minicard_new(name);
-}
-
-static const char *
-gal_view_factory_minicard_get_type_code (GalViewFactory *factory)
-{
- return "minicard";
-}
-
-static void
-gal_view_factory_minicard_class_init (GObjectClass *object_class)
-{
- GalViewFactoryClass *view_factory_class = GAL_VIEW_FACTORY_CLASS(object_class);
- gal_view_factory_minicard_parent_class = g_type_class_ref (PARENT_TYPE);
-
- view_factory_class->get_title = gal_view_factory_minicard_get_title;
- view_factory_class->new_view = gal_view_factory_minicard_new_view;
- view_factory_class->get_type_code = gal_view_factory_minicard_get_type_code;
-}
-
-static void
-gal_view_factory_minicard_init (GalViewFactoryMinicard *factory)
-{
-}
-
-/**
- * gal_view_minicard_new
- *
- * A new GalViewFactory for creating Minicard views. Create one of
- * these and pass it to GalViewCollection for use.
- *
- * Returns: The new GalViewFactoryMinicard.
- */
-GalViewFactory *
-gal_view_factory_minicard_new (void)
-{
- return gal_view_factory_minicard_construct (g_object_new (GAL_TYPE_VIEW_FACTORY_MINICARD, NULL));
-}
-
-/**
- * gal_view_minicard_construct
- * @factory: The factory to construct
- *
- * constructs the GalViewFactoryMinicard. To be used by subclasses and
- * language bindings.
- *
- * Returns: The GalViewFactoryMinicard.
- */
-GalViewFactory *
-gal_view_factory_minicard_construct (GalViewFactoryMinicard *factory)
-{
- return GAL_VIEW_FACTORY(factory);
-}
-
-E_MAKE_TYPE(gal_view_factory_minicard, "GalViewFactoryMinicard", GalViewFactoryMinicard, gal_view_factory_minicard_class_init, gal_view_factory_minicard_init, PARENT_TYPE)
diff --git a/addressbook/gui/widgets/gal-view-factory-minicard.h b/addressbook/gui/widgets/gal-view-factory-minicard.h
deleted file mode 100644
index 02eea99e47..0000000000
--- a/addressbook/gui/widgets/gal-view-factory-minicard.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * gal-view-factory-minicard.c: A View Factory
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * (C) 2000, 2001 Ximian, Inc.
- */
-#ifndef _GAL_VIEW_FACTORY_MINICARD_H_
-#define _GAL_VIEW_FACTORY_MINICARD_H_
-
-#include <gtk/gtkobject.h>
-#include <gal/menus/gal-view-factory.h>
-
-#define GAL_TYPE_VIEW_FACTORY_MINICARD (gal_view_factory_minicard_get_type ())
-#define GAL_VIEW_FACTORY_MINICARD(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GAL_TYPE_VIEW_FACTORY_MINICARD, GalViewFactoryMinicard))
-#define GAL_VIEW_FACTORY_MINICARD_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GAL_TYPE_VIEW_FACTORY_MINICARD, GalViewFactoryMinicardClass))
-#define GAL_IS_VIEW_FACTORY_MINICARD(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GAL_TYPE_VIEW_FACTORY_MINICARD))
-#define GAL_IS_VIEW_FACTORY_MINICARD_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GAL_TYPE_VIEW_FACTORY_MINICARD))
-
-typedef struct {
- GalViewFactory base;
-} GalViewFactoryMinicard;
-
-typedef struct {
- GalViewFactoryClass parent_class;
-} GalViewFactoryMinicardClass;
-
-/* Standard functions */
-GType gal_view_factory_minicard_get_type (void);
-GalViewFactory *gal_view_factory_minicard_new (void);
-GalViewFactory *gal_view_factory_minicard_construct (GalViewFactoryMinicard *factory);
-
-#endif /* _GAL_VIEW_FACTORY_MINICARD_H_ */
diff --git a/addressbook/gui/widgets/gal-view-factory-treeview.c b/addressbook/gui/widgets/gal-view-factory-treeview.c
deleted file mode 100644
index b14c8dec59..0000000000
--- a/addressbook/gui/widgets/gal-view-factory-treeview.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8
- -*- */
-/*
- * gal-view-factory-treeview.c: A View Factory
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * (C) 2000, 2001 Ximian, Inc.
- */
-#include <config.h>
-#include <glib.h>
-#include <libgnome/gnome-i18n.h>
-#include <gal/util/e-util.h>
-#include "gal-view-factory-treeview.h"
-#include "gal-view-treeview.h"
-
-#define PARENT_TYPE GAL_VIEW_FACTORY_TYPE
-
-static GalViewFactoryClass *gal_view_factory_treeview_parent_class;
-
-static const char *
-gal_view_factory_treeview_get_title (GalViewFactory *factory)
-{
- return _("GTK Tree View");
-}
-
-static GalView *
-gal_view_factory_treeview_new_view (GalViewFactory *factory,
- const char *name)
-{
- return gal_view_treeview_new(name);
-}
-
-static const char *
-gal_view_factory_treeview_get_type_code (GalViewFactory *factory)
-{
- return "treeview";
-}
-
-static void
-gal_view_factory_treeview_class_init (GObjectClass *object_class)
-{
- GalViewFactoryClass *view_factory_class = GAL_VIEW_FACTORY_CLASS(object_class);
- gal_view_factory_treeview_parent_class = g_type_class_ref (PARENT_TYPE);
-
- view_factory_class->get_title = gal_view_factory_treeview_get_title;
- view_factory_class->new_view = gal_view_factory_treeview_new_view;
- view_factory_class->get_type_code = gal_view_factory_treeview_get_type_code;
-}
-
-static void
-gal_view_factory_treeview_init (GalViewFactoryTreeView *factory)
-{
-}
-
-/**
- * gal_view_treeview_new
- *
- * A new GalViewFactory for creating TreeView views. Create one of
- * these and pass it to GalViewCollection for use.
- *
- * Returns: The new GalViewFactoryTreeView.
- */
-GalViewFactory *
-gal_view_factory_treeview_new (void)
-{
- return gal_view_factory_treeview_construct (g_object_new (GAL_TYPE_VIEW_FACTORY_TREEVIEW, NULL));
-}
-
-/**
- * gal_view_treeview_construct
- * @factory: The factory to construct
- *
- * constructs the GalViewFactoryTreeView. To be used by subclasses and
- * language bindings.
- *
- * Returns: The GalViewFactoryTreeView.
- */
-GalViewFactory *
-gal_view_factory_treeview_construct (GalViewFactoryTreeView *factory)
-{
- return GAL_VIEW_FACTORY(factory);
-}
-
-E_MAKE_TYPE(gal_view_factory_treeview, "GalViewFactoryTreeView", GalViewFactoryTreeView, gal_view_factory_treeview_class_init, gal_view_factory_treeview_init, PARENT_TYPE)
diff --git a/addressbook/gui/widgets/gal-view-factory-treeview.h b/addressbook/gui/widgets/gal-view-factory-treeview.h
deleted file mode 100644
index 4795c6d3aa..0000000000
--- a/addressbook/gui/widgets/gal-view-factory-treeview.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * gal-view-factory-treeview.c: A View Factory
- *
- * Authors:
- * Chris Toshok <toshok@ximian.com>
- *
- * (C) 2000, 2001 Ximian, Inc.
- */
-#ifndef _GAL_VIEW_FACTORY_TREEVIEW_H_
-#define _GAL_VIEW_FACTORY_TREEVIEW_H_
-
-#include <gtk/gtkobject.h>
-#include <gal/menus/gal-view-factory.h>
-
-#define GAL_TYPE_VIEW_FACTORY_TREEVIEW (gal_view_factory_treeview_get_type ())
-#define GAL_VIEW_FACTORY_TREEVIEW(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GAL_TYPE_VIEW_FACTORY_TREEVIEW, GalViewFactoryTreeView))
-#define GAL_VIEW_FACTORY_TREEVIEW_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GAL_TYPE_VIEW_FACTORY_TREEVIEW, GalViewFactoryTreeViewClass))
-#define GAL_IS_VIEW_FACTORY_TREEVIEW(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GAL_TYPE_VIEW_FACTORY_TREEVIEW))
-#define GAL_IS_VIEW_FACTORY_TREEVIEW_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GAL_TYPE_VIEW_FACTORY_TREEVIEW))
-
-typedef struct {
- GalViewFactory base;
-} GalViewFactoryTreeView;
-
-typedef struct {
- GalViewFactoryClass parent_class;
-} GalViewFactoryTreeViewClass;
-
-/* Standard functions */
-GType gal_view_factory_treeview_get_type (void);
-GalViewFactory *gal_view_factory_treeview_new (void);
-GalViewFactory *gal_view_factory_treeview_construct (GalViewFactoryTreeView *factory);
-
-#endif /* _GAL_VIEW_FACTORY_TREEVIEW_H_ */
diff --git a/addressbook/gui/widgets/gal-view-minicard.c b/addressbook/gui/widgets/gal-view-minicard.c
deleted file mode 100644
index da60497cdb..0000000000
--- a/addressbook/gui/widgets/gal-view-minicard.c
+++ /dev/null
@@ -1,227 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * gal-view-minicard.c: An Minicard View
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * (C) 2000, 2001 Ximian, Inc.
- */
-#include <config.h>
-#include "gal-view-minicard.h"
-#include <libxml/parser.h>
-#include <gal/util/e-xml-utils.h>
-
-#define PARENT_TYPE gal_view_get_type ()
-#define d(x) x
-
-static GalViewClass *gal_view_minicard_parent_class;
-
-static void
-gal_view_minicard_edit (GalView *view, GtkWindow *parent_window)
-{
- /* GalViewMinicard *minicard_view = GAL_VIEW_MINICARD(view); */
-}
-
-static void
-gal_view_minicard_load (GalView *view,
- const char *filename)
-{
- xmlDoc *doc;
- doc = xmlParseFile (filename);
- if (doc) {
- xmlNode *root = xmlDocGetRootElement(doc);
- GAL_VIEW_MINICARD (view)->column_width = e_xml_get_double_prop_by_name_with_default (root, "column_width", 150);
- xmlFreeDoc(doc);
- }
-}
-
-static void
-gal_view_minicard_save (GalView *view,
- const char *filename)
-{
- xmlDoc *doc;
- xmlNode *root;
-
- doc = xmlNewDoc("1.0");
- root = xmlNewNode (NULL, "EMinicardViewState");
- e_xml_set_double_prop_by_name (root, "column_width", GAL_VIEW_MINICARD (view)->column_width);
- xmlDocSetRootElement(doc, root);
- xmlSaveFile(filename, doc);
- xmlFreeDoc(doc);
-}
-
-static const char *
-gal_view_minicard_get_title (GalView *view)
-{
- return GAL_VIEW_MINICARD(view)->title;
-}
-
-static void
-gal_view_minicard_set_title (GalView *view,
- const char *title)
-{
- g_free(GAL_VIEW_MINICARD(view)->title);
- GAL_VIEW_MINICARD(view)->title = g_strdup(title);
-}
-
-static const char *
-gal_view_minicard_get_type_code (GalView *view)
-{
- return "minicard";
-}
-
-static GalView *
-gal_view_minicard_clone (GalView *view)
-{
- GalViewMinicard *gvm, *new;
-
- gvm = GAL_VIEW_MINICARD(view);
-
- new = g_object_new (GAL_TYPE_VIEW_MINICARD, NULL);
- new->title = g_strdup (gvm->title);
- new->column_width = gvm->column_width;
-
- return GAL_VIEW(new);
-}
-
-static void
-gal_view_minicard_dispose (GObject *object)
-{
- GalViewMinicard *view = GAL_VIEW_MINICARD(object);
-
- if (view->title != NULL) {
- gal_view_minicard_detach (view);
- g_free(view->title);
- view->title = NULL;
- }
-
- if (G_OBJECT_CLASS (gal_view_minicard_parent_class)->dispose)
- (* G_OBJECT_CLASS (gal_view_minicard_parent_class)->dispose) (object);
-}
-
-static void
-gal_view_minicard_class_init (GObjectClass *object_class)
-{
- GalViewClass *gal_view_class = GAL_VIEW_CLASS(object_class);
- gal_view_minicard_parent_class = g_type_class_ref (PARENT_TYPE);
-
- gal_view_class->edit = gal_view_minicard_edit ;
- gal_view_class->load = gal_view_minicard_load ;
- gal_view_class->save = gal_view_minicard_save ;
- gal_view_class->get_title = gal_view_minicard_get_title ;
- gal_view_class->set_title = gal_view_minicard_set_title ;
- gal_view_class->get_type_code = gal_view_minicard_get_type_code;
- gal_view_class->clone = gal_view_minicard_clone ;
-
- object_class->dispose = gal_view_minicard_dispose ;
-}
-
-static void
-gal_view_minicard_init (GalViewMinicard *gvm)
-{
- gvm->title = NULL;
- gvm->column_width = 150.0;
-
- gvm->emvw = NULL;
- gvm->emvw_column_width_changed_id = 0;
-}
-
-/**
- * gal_view_minicard_new
- * @title: The name of the new view.
- *
- * Returns a new GalViewMinicard. This is primarily for use by
- * GalViewFactoryMinicard.
- *
- * Returns: The new GalViewMinicard.
- */
-GalView *
-gal_view_minicard_new (const gchar *title)
-{
- return gal_view_minicard_construct (g_object_new (GAL_TYPE_VIEW_MINICARD, NULL), title);
-}
-
-/**
- * gal_view_minicard_construct
- * @view: The view to construct.
- * @title: The name of the new view.
- *
- * constructs the GalViewMinicard. To be used by subclasses and
- * language bindings.
- *
- * Returns: The GalViewMinicard.
- */
-GalView *
-gal_view_minicard_construct (GalViewMinicard *view,
- const gchar *title)
-{
- view->title = g_strdup(title);
- return GAL_VIEW(view);
-}
-
-GType
-gal_view_minicard_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (GalViewMinicardClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) gal_view_minicard_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (GalViewMinicard),
- 0, /* n_preallocs */
- (GInstanceInitFunc) gal_view_minicard_init,
- };
-
- type = g_type_register_static (PARENT_TYPE, "GalViewMinicard", &info, 0);
- }
-
- return type;
-}
-
-static void
-column_width_changed (EMinicardViewWidget *w, double width, GalViewMinicard *view)
-{
- d(g_print("%s: Old width = %f, New width = %f\n", G_GNUC_FUNCTION, view->column_width, width));
- if (view->column_width != width) {
- view->column_width = width;
- gal_view_changed(GAL_VIEW(view));
- }
-}
-
-void
-gal_view_minicard_attach (GalViewMinicard *view, EMinicardViewWidget *emvw)
-{
- gal_view_minicard_detach (view);
-
- view->emvw = emvw;
-
- g_object_ref (view->emvw);
-
- g_object_set (view->emvw,
- "column_width", view->column_width,
- NULL);
-
- view->emvw_column_width_changed_id =
- g_signal_connect(view->emvw, "column_width_changed",
- G_CALLBACK (column_width_changed), view);
-}
-
-void
-gal_view_minicard_detach (GalViewMinicard *view)
-{
- if (view->emvw == NULL)
- return;
- if (view->emvw_column_width_changed_id) {
- g_signal_handler_disconnect (view->emvw,
- view->emvw_column_width_changed_id);
- view->emvw_column_width_changed_id = 0;
- }
- g_object_unref (view->emvw);
- view->emvw = NULL;
-}
diff --git a/addressbook/gui/widgets/gal-view-minicard.h b/addressbook/gui/widgets/gal-view-minicard.h
deleted file mode 100644
index e586012f73..0000000000
--- a/addressbook/gui/widgets/gal-view-minicard.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * gal-view-minicard.h: An Minicard View
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * (C) 2000, 2001 Ximian, Inc.
- */
-#ifndef _GAL_VIEW_MINICARD_H_
-#define _GAL_VIEW_MINICARD_H_
-
-#include <gal/menus/gal-view.h>
-#include <e-minicard-view-widget.h>
-
-#define GAL_TYPE_VIEW_MINICARD (gal_view_minicard_get_type ())
-#define GAL_VIEW_MINICARD(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GAL_TYPE_VIEW_MINICARD, GalViewMinicard))
-#define GAL_VIEW_MINICARD_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GAL_TYPE_VIEW_MINICARD, GalViewMinicardClass))
-#define GAL_IS_VIEW_MINICARD(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GAL_TYPE_VIEW_MINICARD))
-#define GAL_IS_VIEW_MINICARD_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GAL_TYPE_VIEW_MINICARD))
-
-typedef struct {
- GalView base;
-
- char *title;
- double column_width;
-
- EMinicardViewWidget *emvw;
- guint emvw_column_width_changed_id;
-} GalViewMinicard;
-
-typedef struct {
- GalViewClass parent_class;
-} GalViewMinicardClass;
-
-/* Standard functions */
-GType gal_view_minicard_get_type (void);
-GalView *gal_view_minicard_new (const gchar *title);
-GalView *gal_view_minicard_construct (GalViewMinicard *view,
- const gchar *title);
-void gal_view_minicard_attach (GalViewMinicard *view,
- EMinicardViewWidget *emvw);
-void gal_view_minicard_detach (GalViewMinicard *view);
-
-#endif /* _GAL_VIEW_MINICARD_H_ */
diff --git a/addressbook/gui/widgets/gal-view-treeview.c b/addressbook/gui/widgets/gal-view-treeview.c
deleted file mode 100644
index e18ae6341b..0000000000
--- a/addressbook/gui/widgets/gal-view-treeview.c
+++ /dev/null
@@ -1,234 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * gal-view-treeview.c: An TreeView View
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * (C) 2000, 2001 Ximian, Inc.
- */
-#include <config.h>
-#include "gal-view-treeview.h"
-#include <libxml/parser.h>
-#include <gal/util/e-xml-utils.h>
-
-#define PARENT_TYPE gal_view_get_type ()
-#define d(x) x
-
-static GalViewClass *gal_view_treeview_parent_class;
-
-static void
-gal_view_treeview_edit (GalView *view, GtkWindow *parent_window)
-{
- /* GalViewTreeView *treeview_view = GAL_VIEW_TREEVIEW(view); */
-}
-
-static void
-gal_view_treeview_load (GalView *view,
- const char *filename)
-{
-#if 0
- xmlDoc *doc;
- doc = xmlParseFile (filename);
- if (doc) {
- xmlNode *root = xmlDocGetRootElement(doc);
- GAL_VIEW_TREEVIEW (view)->column_width = e_xml_get_double_prop_by_name_with_default (root, "column_width", 150);
- xmlFreeDoc(doc);
- }
-#endif
-}
-
-static void
-gal_view_treeview_save (GalView *view,
- const char *filename)
-{
-#if 0
- xmlDoc *doc;
- xmlNode *root;
-
- doc = xmlNewDoc("1.0");
- root = xmlNewNode (NULL, "ETreeViewViewState");
- e_xml_set_double_prop_by_name (root, "column_width", GAL_VIEW_TREEVIEW (view)->column_width);
- xmlDocSetRootElement(doc, root);
- xmlSaveFile(filename, doc);
- xmlFreeDoc(doc);
-#endif
-}
-
-static const char *
-gal_view_treeview_get_title (GalView *view)
-{
- return GAL_VIEW_TREEVIEW(view)->title;
-}
-
-static void
-gal_view_treeview_set_title (GalView *view,
- const char *title)
-{
- g_free(GAL_VIEW_TREEVIEW(view)->title);
- GAL_VIEW_TREEVIEW(view)->title = g_strdup(title);
-}
-
-static const char *
-gal_view_treeview_get_type_code (GalView *view)
-{
- return "treeview";
-}
-
-static GalView *
-gal_view_treeview_clone (GalView *view)
-{
- GalViewTreeView *gvm, *new;
-
- gvm = GAL_VIEW_TREEVIEW(view);
-
- new = g_object_new (GAL_TYPE_VIEW_TREEVIEW, NULL);
- new->title = g_strdup (gvm->title);
-
- return GAL_VIEW(new);
-}
-
-static void
-gal_view_treeview_dispose (GObject *object)
-{
- GalViewTreeView *view = GAL_VIEW_TREEVIEW(object);
-
- if (view->title != NULL) {
- gal_view_treeview_detach (view);
- g_free(view->title);
- view->title = NULL;
- }
-
- if (G_OBJECT_CLASS (gal_view_treeview_parent_class)->dispose)
- (* G_OBJECT_CLASS (gal_view_treeview_parent_class)->dispose) (object);
-}
-
-static void
-gal_view_treeview_class_init (GObjectClass *object_class)
-{
- GalViewClass *gal_view_class = GAL_VIEW_CLASS(object_class);
- gal_view_treeview_parent_class = g_type_class_ref (PARENT_TYPE);
-
- gal_view_class->edit = gal_view_treeview_edit ;
- gal_view_class->load = gal_view_treeview_load ;
- gal_view_class->save = gal_view_treeview_save ;
- gal_view_class->get_title = gal_view_treeview_get_title ;
- gal_view_class->set_title = gal_view_treeview_set_title ;
- gal_view_class->get_type_code = gal_view_treeview_get_type_code;
- gal_view_class->clone = gal_view_treeview_clone ;
-
- object_class->dispose = gal_view_treeview_dispose ;
-}
-
-static void
-gal_view_treeview_init (GalViewTreeView *gvm)
-{
- gvm->title = NULL;
-
- gvm->tree = NULL;
-}
-
-/**
- * gal_view_treeview_new
- * @title: The name of the new view.
- *
- * Returns a new GalViewTreeView. This is primarily for use by
- * GalViewFactoryTreeView.
- *
- * Returns: The new GalViewTreeView.
- */
-GalView *
-gal_view_treeview_new (const gchar *title)
-{
- return gal_view_treeview_construct (g_object_new (GAL_TYPE_VIEW_TREEVIEW, NULL), title);
-}
-
-/**
- * gal_view_treeview_construct
- * @view: The view to construct.
- * @title: The name of the new view.
- *
- * constructs the GalViewTreeView. To be used by subclasses and
- * language bindings.
- *
- * Returns: The GalViewTreeView.
- */
-GalView *
-gal_view_treeview_construct (GalViewTreeView *view,
- const gchar *title)
-{
- view->title = g_strdup(title);
- return GAL_VIEW(view);
-}
-
-GType
-gal_view_treeview_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (GalViewTreeViewClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) gal_view_treeview_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (GalViewTreeView),
- 0, /* n_preallocs */
- (GInstanceInitFunc) gal_view_treeview_init,
- };
-
- type = g_type_register_static (PARENT_TYPE, "GalViewTreeView", &info, 0);
- }
-
- return type;
-}
-
-#if 0
-static void
-column_width_changed (ETable *table, double width, GalViewMinicard *view)
-{
- d(g_print("%s: Old width = %f, New width = %f\n", G_GNUC_FUNCTION, view->column_width, width));
- if (view->column_width != width) {
- view->column_width = width;
- gal_view_changed(GAL_VIEW(view));
- }
-}
-#endif
-
-void
-gal_view_treeview_attach (GalViewTreeView *view, GtkTreeView *tree)
-{
-#if 0
- gal_view_treeview_detach (view);
-
- view->emvw = emvw;
-
- g_object_ref (view->emvw);
-
- g_object_set (view->emvw,
- "column_width", view->column_width,
- NULL);
-
- view->emvw_column_width_changed_id =
- g_signal_connect(view->emvw, "column_width_changed",
- G_CALLBACK (column_width_changed), view);
-#endif
-}
-
-void
-gal_view_treeview_detach (GalViewTreeView *view)
-{
-#if 0
- if (view->emvw == NULL)
- return;
- if (view->emvw_column_width_changed_id) {
- g_signal_handler_disconnect (view->emvw,
- view->emvw_column_width_changed_id);
- view->emvw_column_width_changed_id = 0;
- }
- g_object_unref (view->emvw);
- view->emvw = NULL;
-#endif
-}
diff --git a/addressbook/gui/widgets/gal-view-treeview.h b/addressbook/gui/widgets/gal-view-treeview.h
deleted file mode 100644
index a0313856a6..0000000000
--- a/addressbook/gui/widgets/gal-view-treeview.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * gal-view-treeview.h: An TreeView View
- *
- * Authors:
- * Chris Toshok <toshok@ximian.com>
- *
- * (C) 2000, 2001 Ximian, Inc.
- */
-#ifndef _GAL_VIEW_TREEVIEW_H_
-#define _GAL_VIEW_TREEVIEW_H_
-
-#include <gal/menus/gal-view.h>
-#include <gtk/gtktreeview.h>
-
-#define GAL_TYPE_VIEW_TREEVIEW (gal_view_treeview_get_type ())
-#define GAL_VIEW_TREEVIEW(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GAL_TYPE_VIEW_TREEVIEW, GalViewTreeView))
-#define GAL_VIEW_TREEVIEW_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GAL_TYPE_VIEW_TREEVIEW, GalViewTreeViewClass))
-#define GAL_IS_VIEW_TREEVIEW(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GAL_TYPE_VIEW_TREEVIEW))
-#define GAL_IS_VIEW_TREEVIEW_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GAL_TYPE_VIEW_TREEVIEW))
-
-typedef struct {
- GalView base;
-
- char *title;
-
- GtkTreeView *tree;
-} GalViewTreeView;
-
-typedef struct {
- GalViewClass parent_class;
-} GalViewTreeViewClass;
-
-/* Standard functions */
-GType gal_view_treeview_get_type (void);
-GalView *gal_view_treeview_new (const gchar *title);
-GalView *gal_view_treeview_construct (GalViewTreeView *view,
- const gchar *title);
-void gal_view_treeview_attach (GalViewTreeView *view,
- GtkTreeView *tree);
-void gal_view_treeview_detach (GalViewTreeView *view);
-
-#endif /* _GAL_VIEW_TREEVIEW_H_ */
diff --git a/addressbook/gui/widgets/test-reflow.c b/addressbook/gui/widgets/test-reflow.c
deleted file mode 100644
index 66f003fe2c..0000000000
--- a/addressbook/gui/widgets/test-reflow.c
+++ /dev/null
@@ -1,199 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* test-reflow.c
- *
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#define TEST_VCARD \
-"BEGIN:VCARD
-" \
-"FN:Nat
-" \
-"N:Friedman;Nat;D;Mr.
-" \
-"TITLE:Head Geek
-" \
-"BDAY:1977-08-06
-" \
-"TEL;WORK:617 679 1984
-" \
-"TEL;CELL:123 456 7890
-" \
-"EMAIL;INTERNET:nat@nat.org
-" \
-"EMAIL;INTERNET:nat@ximian.com
-" \
-"ADR;WORK;POSTAL:P.O. Box 101;;;Any Town;CA;91921-1234;
-" \
-"ADR;HOME;POSTAL;INTL:P.O. Box 202;;;Any Town 2;MI;12344-4321;USA
-" \
-"END:VCARD
-" \
-"
-"
-
-
-#include "config.h"
-
-#include <gtk/gtkmain.h>
-#include <gtk/gtkvbox.h>
-#include <libgnomeui/gnome-canvas-rect-ellipse.h>
-#include <libgnomeui/gnome-init.h>
-#include <gal/widgets/e-canvas.h>
-#include <gal/widgets/e-reflow.h>
-#include <gal/widgets/e-scroll-frame.h>
-
-#include "e-minicard.h"
-
-/* This is a horrible thing to do, but it is just a test. */
-GnomeCanvasItem *reflow;
-GnomeCanvasItem *rect;
-GtkAllocation last_alloc;
-
-static void destroy_callback(gpointer data, GObject *where_object_was)
-{
- exit(0);
-}
-
-static void allocate_callback(GtkWidget *canvas, GtkAllocation *allocation, gpointer data)
-{
- double width;
- last_alloc = *allocation;
- gnome_canvas_item_set( reflow,
- "height", (double) allocation->height,
- NULL );
- gnome_canvas_item_set( reflow,
- "minimum_width", (double) allocation->width,
- NULL );
- g_object_get(reflow,
- "width", &width,
- NULL);
- width = MAX(width, allocation->width);
- gnome_canvas_set_scroll_region(GNOME_CANVAS( canvas ), 0, 0, width - 1, allocation->height - 1);
- gnome_canvas_item_set( rect,
- "x2", (double) width,
- "y2", (double) allocation->height,
- NULL );
-}
-
-static void resize(GnomeCanvas *canvas, gpointer data)
-{
- double width;
- g_object_get(reflow,
- "width", &width,
- NULL);
- width = MAX(width, last_alloc.width);
- gnome_canvas_set_scroll_region(canvas , 0, 0, width - 1, last_alloc.height - 1);
- gnome_canvas_item_set( rect,
- "x2", (double) width,
- "y2", (double) last_alloc.height,
- NULL );
-}
-
-#if 0
-static void about_callback( GtkWidget *widget, gpointer data )
-{
-
- const gchar *authors[] =
- {
- "Christopher James Lahey <clahey@umich.edu>",
- NULL
- };
-
- GtkWidget *about =
- gnome_about_new ( _( "Reflow Test" ), VERSION,
- _( "Copyright (C) 2000, Ximian, Inc." ),
- authors,
- _( "This should test the reflow canvas item" ),
- NULL);
- gtk_widget_show (about);
-}
-#endif
-
-int main( int argc, char *argv[] )
-{
- GtkWidget *app;
- GtkWidget *canvas;
- GtkWidget *vbox;
- GtkWidget *scrollframe;
- int i;
-
- /* bindtextdomain (PACKAGE, GNOMELOCALEDIR);
- textdomain (PACKAGE);*/
-
- gnome_init( "Reflow Test", VERSION, argc, argv);
- app = gnome_app_new("Reflow Test", NULL);
-
- vbox = gtk_vbox_new(FALSE, 0);
-
- canvas = e_canvas_new();
- rect = gnome_canvas_item_new( gnome_canvas_root( GNOME_CANVAS( canvas ) ),
- gnome_canvas_rect_get_type(),
- "x1", (double) 0,
- "y1", (double) 0,
- "x2", (double) 100,
- "y2", (double) 100,
- "fill_color", "white",
- NULL );
- reflow = gnome_canvas_item_new( gnome_canvas_root( GNOME_CANVAS( canvas ) ),
- e_reflow_get_type(),
- "height", (double) 100,
- "minimum_width", (double) 100,
- NULL );
- g_signal_connect( canvas, "reflow",
- G_CALLBACK ( resize ),
- ( gpointer ) app);
- for ( i = 0; i < 200; i++ )
- {
- GnomeCanvasItem *item;
- ECard *card = e_card_new (TEST_VCARD);
- item = gnome_canvas_item_new( GNOME_CANVAS_GROUP(reflow),
- e_minicard_get_type(),
- "card", card,
- NULL);
- e_reflow_add_item(E_REFLOW(reflow), item, NULL);
- }
- gnome_canvas_set_scroll_region ( GNOME_CANVAS( canvas ),
- 0, 0,
- 100, 100 );
-
- scrollframe = e_scroll_frame_new (gtk_layout_get_hadjustment(GTK_LAYOUT(canvas)),
- gtk_layout_get_vadjustment(GTK_LAYOUT(canvas)));
- e_scroll_frame_set_policy (E_SCROLL_FRAME (scrollframe),
- GTK_POLICY_AUTOMATIC,
- GTK_POLICY_NEVER);
-
- gtk_container_add (GTK_CONTAINER (scrollframe), canvas);
-
- gnome_app_set_contents( GNOME_APP( app ), scrollframe );
-
- /* Connect the signals */
- g_object_weak_ref (app, destroy_callback, app);
-
- g_signal_connect( canvas, "size_allocate",
- G_CALLBACK ( allocate_callback ),
- ( gpointer ) app );
-
- gtk_widget_show_all( app );
- gdk_window_set_back_pixmap( GTK_LAYOUT(canvas)->bin_window, NULL, FALSE);
-
- gtk_main();
-
- /* Not reached. */
- return 0;
-}
diff --git a/addressbook/printing/.cvsignore b/addressbook/printing/.cvsignore
deleted file mode 100644
index 96194f7fd7..0000000000
--- a/addressbook/printing/.cvsignore
+++ /dev/null
@@ -1,9 +0,0 @@
-.deps
-.libs
-.pure
-Makefile
-Makefile.in
-*.lo
-*.la
-contact-print-test
-contact-print-style-editor-test
diff --git a/addressbook/printing/Makefile.am b/addressbook/printing/Makefile.am
deleted file mode 100644
index 8da93df0b8..0000000000
--- a/addressbook/printing/Makefile.am
+++ /dev/null
@@ -1,57 +0,0 @@
-ecpsdir = $(privdatadir)/ecps
-ecps_DATA = \
- smallbook.ecps \
- medbook.ecps \
- phonelist.ecps
-
-glade_DATA = \
- e-contact-print.glade
-
-INCLUDES = \
- $(GNOME_INCLUDEDIR) \
- -DG_LOG_DOMAIN=\"addressbook-printing\" \
- -I$(top_srcdir)/addressbook \
- -I$(top_srcdir)/addressbook/backend \
- -I$(top_builddir)/addressbook/backend \
- -I$(top_srcdir) \
- -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \
- -DEVOLUTION_ECPSDIR=\""$(ecpsdir)"\" \
- $(EVOLUTION_ADDRESSBOOK_CFLAGS)
-
-noinst_LTLIBRARIES = \
- libecontactprint.la
-
-libecontactprint_la_SOURCES = \
- e-contact-print-envelope.c \
- e-contact-print-envelope.h \
- e-contact-print-style-editor.c \
- e-contact-print-style-editor.h \
- e-contact-print-types.h \
- e-contact-print.c \
- e-contact-print.h
-
-noinst_PROGRAMS = \
- contact-print-test \
- contact-print-style-editor-test
-
-contact_print_test_SOURCES = \
- test-print.c
-
-contact_print_test_LDADD = \
- libecontactprint.la \
- $(top_builddir)/addressbook/util/libeabutil.la \
- $(EVOLUTION_ADDRESSBOOK_LIBS)
-
-contact_print_style_editor_test_SOURCES = \
- test-contact-print-style-editor.c
-
-contact_print_style_editor_test_LDADD = \
- libecontactprint.la \
- $(top_builddir)/addressbook/util/libeabutil.la \
- $(EVOLUTION_ADDRESSBOOK_LIBS)
-
-
-
-EXTRA_DIST = \
- $(glade_DATA) \
- $(ecps_DATA)
diff --git a/addressbook/printing/e-contact-print-envelope.c b/addressbook/printing/e-contact-print-envelope.c
deleted file mode 100644
index c7bd68163f..0000000000
--- a/addressbook/printing/e-contact-print-envelope.c
+++ /dev/null
@@ -1,242 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-contact-print-envelope.c
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-#include "addressbook/printing/e-contact-print-envelope.h"
-#include <glib.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnomeui/gnome-dialog.h>
-#include <time.h>
-#include <libgnomeprintui/gnome-print-dialog.h>
-#include <libgnomeprint/gnome-print.h>
-#include <libgnomeprint/gnome-print-job.h>
-#include <libgnomeprintui/gnome-print-job-preview.h>
-
-#define ENVELOPE_HEIGHT (72.0 * 4.0)
-#define ENVELOPE_WIDTH (72.0 * 9.5)
-
-typedef struct {
- int start;
- int length;
-} EcpeLine;
-
-static void
-startset(void *pointer, EcpeLine **iterator)
-{
- (*iterator)--;
- (*iterator)->start = GPOINTER_TO_INT(pointer);
-}
-
-static void
-lengthset(void *pointer, EcpeLine **iterator)
-{
- (*iterator)--;
- (*iterator)->length = GPOINTER_TO_INT(pointer);
-}
-
-static EcpeLine *
-ecpe_break(char *address)
-{
- int i;
- int length = 0;
- int laststart = 0;
- GList *startlist = NULL;
- GList *lengthlist = NULL;
- EcpeLine *ret_val;
- EcpeLine *iterator;
-
- for (i = 0; address[i]; i++) {
- if (address[i] == '\n') {
- startlist = g_list_prepend (startlist, GINT_TO_POINTER(laststart));
- lengthlist = g_list_prepend (lengthlist, GINT_TO_POINTER(i - laststart));
- length ++;
- laststart = i + 1;
- }
- }
- startlist = g_list_prepend (startlist, GINT_TO_POINTER(laststart));
- lengthlist = g_list_prepend (lengthlist, GINT_TO_POINTER(i - laststart));
- length ++;
-
- ret_val = g_new(EcpeLine, length + 1);
-
- iterator = ret_val + length;
- g_list_foreach(startlist, (GFunc) startset, &iterator);
- g_list_free(startlist);
-
- iterator = ret_val + length;
- g_list_foreach(lengthlist, (GFunc) lengthset, &iterator);
- g_list_free(lengthlist);
-
- ret_val[length].start = -1;
- ret_val[length].length = -1;
-
- return ret_val;
-}
-
-static void
-ecpe_linelist_dimensions(GnomeFont *font, char *address, EcpeLine *linelist, double *widthp, double *heightp)
-{
- double width = 0;
- int i;
- if (widthp) {
- for (i = 0; linelist[i].length != -1; i++) {
- width = MAX(width, gnome_font_get_width_utf8_sized (font, address + linelist[i].start, linelist[i].length));
- }
- *widthp = width;
- } else {
- for (i = 0; linelist[i].length != -1; i++)
- /* Intentionally empty */;
- }
- if (heightp) {
- *heightp = gnome_font_get_size(font) * i;
- }
-}
-
-static void
-ecpe_linelist_print(GnomePrintContext *pc, GnomeFont *font, char *address, EcpeLine *linelist, double x, double y)
-{
- int i;
- gnome_print_setfont(pc, font);
- for (i = 0; linelist[i].length != -1; i++) {
- gnome_print_moveto(pc, x, y + gnome_font_get_ascender(font));
- gnome_print_show_sized (pc, address + linelist[i].start, linelist[i].length);
- y -= gnome_font_get_size(font);
- }
-}
-
-static gint
-e_contact_print_envelope_close(GnomeDialog *dialog, gpointer data)
-{
- return FALSE;
-}
-
-static void
-ecpe_print(GnomePrintContext *pc, EContact *contact, gboolean as_return)
-{
- char *address;
- EcpeLine *linelist;
- double x;
- double y;
- GnomeFont *font;
-
-
- gnome_print_rotate(pc, 90);
- gnome_print_translate(pc, 72.0 * 11.0 - ENVELOPE_WIDTH, -72.0 * 8.5 + (72.0 * 8.5 - ENVELOPE_HEIGHT) / 2);
-
- address = e_contact_get(contact, E_CONTACT_ADDRESS_LABEL_WORK);
- linelist = ecpe_break(address);
- if (as_return)
- font = gnome_font_find ("Sans", 9);
- else
- font = gnome_font_find ("Sans", 12);
- ecpe_linelist_dimensions(font, address, linelist, NULL, &y);
- if (as_return) {
- x = 36;
- y = ENVELOPE_HEIGHT - 36;
- } else {
- x = ENVELOPE_WIDTH / 2;
- y = (ENVELOPE_HEIGHT - y) / 2;
- }
- ecpe_linelist_print(pc, font, address, linelist, x, y);
- g_object_unref(font);
- g_free(linelist);
-
- g_free(address);
-
- gnome_print_showpage(pc);
- gnome_print_context_close(pc);
-}
-
-static void
-e_contact_print_envelope_button(GnomeDialog *dialog, gint button, gpointer data)
-{
- GnomePrintJob *master;
- GnomePrintContext *pc;
- GnomePrintConfig *config;
- EContact *contact = NULL;
- GtkWidget *preview;
-
- contact = g_object_get_data(G_OBJECT(dialog), "contact");
-
- switch( button ) {
- case GNOME_PRINT_DIALOG_RESPONSE_PRINT:
- config = gnome_print_dialog_get_config (GNOME_PRINT_DIALOG (dialog));
- master = gnome_print_job_new (config);
- pc = gnome_print_job_get_context( master );
-
- ecpe_print(pc, contact, FALSE);
-
- gnome_print_job_print(master);
- gnome_dialog_close(dialog);
- break;
- case GNOME_PRINT_DIALOG_RESPONSE_PREVIEW:
- config = gnome_print_dialog_get_config (GNOME_PRINT_DIALOG (dialog));
- master = gnome_print_job_new (config);
- pc = gnome_print_job_get_context( master );
-
- ecpe_print(pc, contact, FALSE);
-
- preview = GTK_WIDGET(gnome_print_job_preview_new(master, "Print Preview"));
- gtk_widget_show_all(preview);
- break;
- case GNOME_PRINT_DIALOG_RESPONSE_CANCEL:
- g_object_unref(contact);
- gnome_dialog_close(dialog);
- break;
- }
-}
-
-GtkWidget *
-e_contact_print_envelope_dialog_new(EContact *contact)
-{
- GtkWidget *dialog;
-
- dialog = gnome_print_dialog_new(NULL, _("Print envelope"), GNOME_PRINT_DIALOG_COPIES);
-
- contact = e_contact_duplicate(contact);
- g_object_set_data(G_OBJECT(dialog), "contact", contact);
- g_signal_connect(dialog,
- "clicked", G_CALLBACK(e_contact_print_envelope_button), NULL);
- g_signal_connect(dialog,
- "close", G_CALLBACK(e_contact_print_envelope_close), NULL);
- return dialog;
-}
-
-/* FIXME: Print all the contacts selected. */
-GtkWidget *
-e_contact_print_envelope_list_dialog_new(GList *list)
-{
- GtkWidget *dialog;
- EContact *contact;
-
- if (list == NULL)
- return NULL;
-
- dialog = gnome_print_dialog_new(NULL, _("Print envelope"), GNOME_PRINT_DIALOG_COPIES);
-
- contact = e_contact_duplicate(list->data);
- g_object_set_data(G_OBJECT(dialog), "contact", contact);
- g_signal_connect(dialog,
- "clicked", G_CALLBACK(e_contact_print_envelope_button), NULL);
- g_signal_connect(dialog,
- "close", G_CALLBACK(e_contact_print_envelope_close), NULL);
- return dialog;
-}
diff --git a/addressbook/printing/e-contact-print-envelope.h b/addressbook/printing/e-contact-print-envelope.h
deleted file mode 100644
index a7a8492638..0000000000
--- a/addressbook/printing/e-contact-print-envelope.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-contact-print-envelope.h
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef E_CONTACT_PRINT_ENVELOPE_H
-#define E_CONTACT_PRINT_ENVELOPE_H
-
-#include <gtk/gtkwidget.h>
-#include <libebook/e-contact.h>
-#include "e-contact-print-types.h"
-
-GtkWidget *e_contact_print_envelope_dialog_new(EContact *contact);
-GtkWidget *e_contact_print_envelope_list_dialog_new(GList *list);
-
-#endif /* E_CONTACT_PRINT_ENVELOPE_H */
diff --git a/addressbook/printing/e-contact-print-style-editor.c b/addressbook/printing/e-contact-print-style-editor.c
deleted file mode 100644
index 436aaddff0..0000000000
--- a/addressbook/printing/e-contact-print-style-editor.c
+++ /dev/null
@@ -1,155 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-contact-print-style-editor.c
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include "e-contact-print-style-editor.h"
-
-static void e_contact_print_style_editor_init (EContactPrintStyleEditor *card);
-static void e_contact_print_style_editor_class_init (EContactPrintStyleEditorClass *klass);
-static void e_contact_print_style_editor_set_arg (GtkObject *o, GtkArg *arg, guint arg_id);
-static void e_contact_print_style_editor_get_arg (GtkObject *object, GtkArg *arg, guint arg_id);
-static void e_contact_print_style_editor_destroy (GtkObject *object);
-
-static GtkVBoxClass *parent_class = NULL;
-
-
-/* The arguments we take */
-enum {
- ARG_0,
- ARG_CARD
-};
-
-GtkType
-e_contact_print_style_editor_get_type (void)
-{
- static GtkType contact_print_style_editor_type = 0;
-
- if (!contact_print_style_editor_type)
- {
- static const GtkTypeInfo contact_print_style_editor_info =
- {
- "EContactPrintStyleEditor",
- sizeof (EContactPrintStyleEditor),
- sizeof (EContactPrintStyleEditorClass),
- (GtkClassInitFunc) e_contact_print_style_editor_class_init,
- (GtkObjectInitFunc) e_contact_print_style_editor_init,
- /* reserved_1 */ NULL,
- /* reserved_2 */ NULL,
- (GtkClassInitFunc) NULL,
- };
-
- contact_print_style_editor_type = gtk_type_unique (gtk_vbox_get_type (), &contact_print_style_editor_info);
- }
-
- return contact_print_style_editor_type;
-}
-
-static void
-e_contact_print_style_editor_class_init (EContactPrintStyleEditorClass *klass)
-{
- GtkObjectClass *object_class;
- GtkVBoxClass *vbox_class;
-
- object_class = (GtkObjectClass*) klass;
- vbox_class = (GtkVBoxClass *) klass;
-
- parent_class = gtk_type_class (gtk_vbox_get_type ());
-
- object_class->set_arg = e_contact_print_style_editor_set_arg;
- object_class->get_arg = e_contact_print_style_editor_get_arg;
- object_class->destroy = e_contact_print_style_editor_destroy;
-}
-
-#if 0
-static void
-_add_image(GtkTable *table, gchar *image, int left, int right, int top, int bottom)
-{
- gtk_table_attach(table,
- gtk_widget_new(gtk_alignment_get_type(),
- "child", gnome_pixmap_new_from_file(image),
- "xalign", (double) 0,
- "yalign", (double) 0,
- "xscale", (double) 0,
- "yscale", (double) 0,
- NULL),
- left, right, top, bottom,
- GTK_FILL, GTK_FILL,
- 0, 0);
-}
-#endif
-
-static void
-e_contact_print_style_editor_init (EContactPrintStyleEditor *e_contact_print_style_editor)
-{
- GladeXML *gui;
-
- /* e_contact_print_style_editor->card = NULL;*/
- gui = glade_xml_new (EVOLUTION_GLADEDIR "/e-contact-print.glade", NULL, NULL);
- e_contact_print_style_editor->gui = gui;
- gtk_widget_reparent(glade_xml_get_widget(gui, "vbox-contact-print-style-editor"),
- GTK_WIDGET(e_contact_print_style_editor));
-}
-
-void
-e_contact_print_style_editor_destroy (GtkObject *object)
-{
- EContactPrintStyleEditor *e_contact_print_style_editor = E_CONTACT_PRINT_STYLE_EDITOR(object);
-
- if (e_contact_print_style_editor->gui != NULL) {
- g_object_unref(e_contact_print_style_editor->gui);
- e_contact_print_style_editor->gui = NULL;
- }
-
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
-}
-
-GtkWidget*
-e_contact_print_style_editor_new (char *filename)
-{
- GtkWidget *widget = GTK_WIDGET (gtk_type_new (e_contact_print_style_editor_get_type ()));
- return widget;
-}
-
-static void
-e_contact_print_style_editor_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
-{
- EContactPrintStyleEditor *e_contact_print_style_editor;
-
- e_contact_print_style_editor = E_CONTACT_PRINT_STYLE_EDITOR (o);
-
- switch (arg_id){
- default:
- break;
- }
-}
-
-static void
-e_contact_print_style_editor_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
-{
- EContactPrintStyleEditor *e_contact_print_style_editor;
-
- e_contact_print_style_editor = E_CONTACT_PRINT_STYLE_EDITOR (object);
-
- switch (arg_id) {
- default:
- arg->type = GTK_TYPE_INVALID;
- break;
- }
-}
diff --git a/addressbook/printing/e-contact-print-style-editor.h b/addressbook/printing/e-contact-print-style-editor.h
deleted file mode 100644
index e4604d551c..0000000000
--- a/addressbook/printing/e-contact-print-style-editor.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* e-contact-print-style-editor.h
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef __E_CONTACT_PRINT_STYLE_EDITOR_H__
-#define __E_CONTACT_PRINT_STYLE_EDITOR_H__
-
-#include <gtk/gtkvbox.h>
-#include <glade/glade.h>
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-/* EContactPrintStyleEditor - A dialog displaying information about a contact.
- *
- * The following arguments are available:
- *
- * name type read/write description
- * --------------------------------------------------------------------------------
- * card ECard * R The card currently being edited
- */
-
-#define E_CONTACT_PRINT_STYLE_EDITOR_TYPE (e_contact_print_style_editor_get_type ())
-#define E_CONTACT_PRINT_STYLE_EDITOR(obj) (GTK_CHECK_CAST ((obj), E_CONTACT_PRINT_STYLE_EDITOR_TYPE, EContactPrintStyleEditor))
-#define E_CONTACT_PRINT_STYLE_EDITOR_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_CONTACT_PRINT_STYLE_EDITOR_TYPE, EContactPrintStyleEditorClass))
-#define E_IS_MINICARD(obj) (GTK_CHECK_TYPE ((obj), E_CONTACT_PRINT_STYLE_EDITOR_TYPE))
-#define E_IS_MINICARD_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_CONTACT_PRINT_STYLE_EDITOR_TYPE))
-
-
-typedef struct _EContactPrintStyleEditor EContactPrintStyleEditor;
-typedef struct _EContactPrintStyleEditorClass EContactPrintStyleEditorClass;
-
-struct _EContactPrintStyleEditor
-{
- GtkVBox parent;
-
- /* item specific fields */
- GladeXML *gui;
-};
-
-struct _EContactPrintStyleEditorClass
-{
- GtkVBoxClass parent_class;
-};
-
-
-GtkWidget *e_contact_print_style_editor_new(char *filename);
-GtkType e_contact_print_style_editor_get_type (void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* __E_CONTACT_PRINT_STYLE_EDITOR_H__ */
diff --git a/addressbook/printing/e-contact-print-types.h b/addressbook/printing/e-contact-print-types.h
deleted file mode 100644
index b7082b41f6..0000000000
--- a/addressbook/printing/e-contact-print-types.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-contact-print-types.h
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef E_CONTACT_PRINT_TYPES_H
-#define E_CONTACT_PRINT_TYPES_H
-
-#include <glib.h>
-#include <libgnomeprint/gnome-font.h>
-
-typedef struct _EContactPrintStyle EContactPrintStyle;
-typedef enum _EContactPrintType EContactPrintType;
-
-enum _EContactPrintType {
- E_CONTACT_PRINT_TYPE_CARDS,
- E_CONTACT_PRINT_TYPE_MEMO_STYLE,
- E_CONTACT_PRINT_TYPE_PHONE_LIST
-};
-
-struct _EContactPrintStyle
-{
- gchar *title;
- EContactPrintType type;
- gboolean sections_start_new_page;
- guint num_columns;
- guint blank_forms;
- gboolean letter_tabs;
- gboolean letter_headings;
- GnomeFont *headings_font;
- GnomeFont *body_font;
- gboolean print_using_grey;
- gint paper_type;
- gdouble paper_width;
- gdouble paper_height;
- gint paper_source;
- gdouble top_margin;
- gdouble left_margin;
- gdouble bottom_margin;
- gdouble right_margin;
- gint page_size;
- gdouble page_width;
- gdouble page_height;
- gboolean orientation_portrait;
- GnomeFont *header_font;
- gchar *left_header;
- gchar *center_header;
- gchar *right_header;
- GnomeFont *footer_font;
- gchar *left_footer;
- gchar *center_footer;
- gchar *right_footer;
- gboolean reverse_on_even_pages;
-};
-
-#endif /* E_CONTACT_PRINT_TYPES_H */
-
diff --git a/addressbook/printing/e-contact-print.c b/addressbook/printing/e-contact-print.c
deleted file mode 100644
index 1a9b83c62d..0000000000
--- a/addressbook/printing/e-contact-print.c
+++ /dev/null
@@ -1,1106 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-contact-print.c
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-#include "e-contact-print.h"
-
-#include <ctype.h>
-#include <sys/types.h>
-#include <stdlib.h>
-#include <string.h>
-#include <glib.h>
-#include <libxml/tree.h>
-#include <libxml/parser.h>
-#include <libxml/xmlmemory.h>
-#include <libgnome/gnome-util.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnomeui/gnome-dialog.h>
-#include <libgnomeprint/gnome-print.h>
-#include <libgnomeprint/gnome-font.h>
-#include <libgnomeprint/gnome-print-job.h>
-#include <libgnomeprintui/gnome-print-dialog.h>
-#include <libgnomeprintui/gnome-print-job-preview.h>
-#include <libebook/e-book-async.h>
-#include <libebook/e-contact.h>
-#include <addressbook/util/eab-destination.h>
-
-#define SCALE 5
-#define HYPHEN_PIXELS 20
-#define HYPHEN_PENALTY ( (SCALE) * (SCALE) * (HYPHEN_PIXELS) * (HYPHEN_PIXELS) )
-
-typedef struct _EContactPrintContext EContactPrintContext;
-
-struct _EContactPrintContext
-{
- GnomePrintContext *pc;
- GnomePrintJob *master;
- gdouble x;
- gdouble y;
- gint column;
- EContactPrintStyle *style;
- gboolean first_section;
- gchar first_char_on_page;
- gchar last_char_on_page;
- GnomeFont *letter_heading_font;
- GnomeFont *letter_tab_font;
- char *character;
- gboolean first_contact;
-
- gboolean uses_book;
- int type;
- EBook *book;
- gchar *query;
-
- GList *contacts;
-};
-
-static gint
-e_contact_divide_text(GnomePrintContext *pc, GnomeFont *font, double width, const gchar *text, GList **return_val /* Of type char[] */)
-{
- if ( width == -1 || gnome_font_get_width_utf8(font, text) <= width ) {
- if ( return_val ) {
- *return_val = g_list_append(*return_val, g_strdup(text));
- }
- return 1;
- } else {
-#if 1
- int i, l;
- double x = 0;
- int lastend = 0;
- int linestart = 0;
- int firstword = 1;
- int linecount = 0;
- l = strlen(text);
- for ( i = 0; i < l; i++ ) {
- if ( text[i] == ' ' ) {
- if ( (!firstword) && x + gnome_font_get_width_utf8_sized(font, text + lastend, i - lastend) > width ) {
- if (return_val) {
- *return_val = g_list_append(*return_val, g_strndup(text + linestart, lastend - linestart));
- }
- x = gnome_font_get_width_utf8(font, " ");
- linestart = lastend + 1;
- x += gnome_font_get_width_utf8_sized(font, text + linestart, i - linestart);
- lastend = i;
- linecount ++;
- } else {
- x += gnome_font_get_width_utf8_sized(font, text + lastend, i - lastend);
- lastend = i;
- }
- firstword = 0;
- } else if ( text[i] == '\n' ) {
- if ( (!firstword) && x + gnome_font_get_width_utf8_sized(font, text + lastend, i - lastend) > width ) {
- if (return_val) {
- *return_val = g_list_append(*return_val, g_strndup(text + linestart, lastend - linestart));
- }
- linestart = lastend + 1;
- lastend = i;
- linecount ++;
- }
- if (return_val) {
- *return_val = g_list_append(*return_val, g_strndup(text + linestart, i - linestart));
- }
- linestart = i + 1;
- lastend = i + 1;
- linecount ++;
- x = gnome_font_get_width_utf8(font, " ");
-
- firstword = 1;
- }
- }
- if ( (!firstword) && x + gnome_font_get_width_utf8_sized(font, text + lastend, i - lastend) > width ) {
- if (return_val) {
- *return_val = g_list_append(*return_val, g_strndup(text + linestart, lastend - linestart));
- }
- linestart = lastend + 1;
- lastend = i;
- linecount ++;
- }
- if (return_val) {
- *return_val = g_list_append(*return_val, g_strndup(text + linestart, i - linestart));
- }
- linecount ++;
- return(linecount);
-#else
- HnjBreak *breaks;
- gint *result;
- gint *is;
- gint n_breaks = 0, n_actual_breaks = 0;
- gint i;
- gint l;
- gchar *hyphenation;
- double x = - gnome_font_get_width_utf8(font, " ") * SCALE;
- HnjParams hnjparams;
-
- hnjparams.set_width = width * SCALE + x;
- hnjparams.max_neg_space = 0;
- hnjparams.tab_width = 0;
-
- l = strlen(text);
-
- /* find possible line breaks. */
- for (i = 0; i < l; i++) {
- if (text[i] == '-')
- n_breaks++;
- else if (text[i] == ' ')
- n_breaks++;
-#if 0
- else if (hyphenation[i] & 1)
- n_breaks++;
-#endif
- }
-
- breaks = g_new( HnjBreak, n_breaks + 1 );
- result = g_new( gint, n_breaks + 1 );
- is = g_new( gint, n_breaks + 1 );
- n_breaks = 0;
- /* find possible line breaks. */
-
- for (i = 0; i < l; i++) {
- if ( text[i] == '-' ) {
- x += gnome_font_get_width(font, text[i]) * SCALE;
- breaks[n_breaks].x0 = x;
- breaks[n_breaks].x1 = x;
- breaks[n_breaks].penalty = HYPHEN_PENALTY;
- breaks[n_breaks].flags = HNJ_JUST_FLAG_ISHYPHEN;
- is[n_breaks] = i + 1;
- n_breaks++;
- } else if ( text[i] == ' ' ) {
- breaks[ n_breaks ].x0 = x;
- x += gnome_font_get_width(font, text[i]) * SCALE;
- breaks[ n_breaks ].x1 = x;
- breaks[ n_breaks ].penalty = 0;
- breaks[ n_breaks ].flags = HNJ_JUST_FLAG_ISSPACE;
- is[ n_breaks ] = i + 1;
- n_breaks++;
-#if 0
- } else if (word->hyphenation[i] & 1) {
- breaks[n_breaks].x0 = x + gnome_font_get_width(font, '-') * SCALE;
- breaks[n_breaks].x1 = x;
- breaks[n_breaks].penalty = HYPHEN_PENALTY;
- breaks[n_breaks].flags = HNJ_JUST_FLAG_ISHYPHEN;
- is[n_breaks] = i + 1;
- n_breaks++;
-#endif
- } else
- x += gnome_font_get_width(font, text[i]) * SCALE;
-
- }
- is[n_breaks] = i;
- breaks[n_breaks].flags = 0;
- n_breaks++;
-
- /* Calculate optimal line breaks. */
- n_actual_breaks = hnj_hs_just (breaks, n_breaks,
- &hnjparams, result);
-
- if ( return_val ) {
- gchar *next_val;
- if ( breaks[result[0]].flags == HNJ_JUST_FLAG_ISHYPHEN && text[is[result[0]]] != '-' ) {
- next_val = g_new(gchar, is[result[0]] + 2);
- strncpy(next_val, text, is[result[0]]);
- next_val[is[result[0]]] = 0;
- strcat(next_val, "-");
- } else {
- next_val = g_new(gchar, is[result[0]] + 1);
- strncpy(next_val, text, is[result[0]]);
- next_val[is[result[0]]] = 0;
- }
- *return_val = g_list_append(*return_val, next_val);
-
- for ( i = 1; i < n_actual_breaks; i++ ) {
- if ( (breaks[result[i]].flags & HNJ_JUST_FLAG_ISHYPHEN) && (text[is[result[i]]] != '-') ) {
- next_val = g_new(gchar, is[result[i]] - is[result[i - 1]] + 2);
- strncpy(next_val, text + is[result[i - 1]], is[result[i]] - is[result[i - 1]]);
- next_val[is[result[i]] - is[result[i - 1]]] = 0;
- strcat(next_val, "-");
- } else {
- next_val = g_new(gchar, is[result[i]] - is[result[i - 1]] + 1);
- strncpy(next_val, text + is[result[i - 1]], is[result[i]] - is[result[i - 1]]);
- next_val[is[result[i]] - is[result[i - 1]]] = 0;
- }
- *return_val = g_list_append(*return_val, next_val);
- }
- }
-
- g_free (breaks);
- g_free (result);
- g_free (is);
- return n_actual_breaks;
-#endif
- }
-}
-
-static void
-e_contact_output(GnomePrintContext *pc, GnomeFont *font, double x, double y, double width, const gchar *text)
-{
- GList *list = NULL, *list_start;
- int first_line = 1;
- gnome_print_gsave(pc);
- gnome_print_setfont(pc, font);
- e_contact_divide_text(pc, font, width, text, &list);
- for ( list_start = list; list; list = g_list_next(list)) {
- y -= gnome_font_get_ascender(font);
- gnome_print_moveto(pc, x, y);
- gnome_print_show(pc, (char *)list->data);
- y -= gnome_font_get_descender(font);
- y -= .2 * gnome_font_get_size (font);
- if ( first_line ) {
- x += gnome_font_get_width_utf8(font, " ");
- first_line = 0;
- }
- }
- g_list_foreach( list_start, (GFunc) g_free, NULL );
- g_list_free( list_start );
- gnome_print_grestore(pc);
-}
-
-static gdouble
-e_contact_text_height(GnomePrintContext *pc, GnomeFont *font, double width, const gchar *text)
-{
- int line_count = e_contact_divide_text(pc, font, width, text, NULL);
- return line_count * (gnome_font_get_ascender(font) + gnome_font_get_descender(font)) +
- (line_count - 1) * .2 * gnome_font_get_size (font);
-}
-
-#if 0
-static void
-e_contact_output_and_advance(EContactPrintContext *ctxt, GnomeFont *font, double x, double width, gchar *text)
-{
- ctxt->y -= .1 * gnome_font_get_size (font);
- e_contact_output(ctxt->pc, font, x, ctxt->y, width, text);
- ctxt->y -= e_contact_text_height(ctxt->pc, font, width, text);
- ctxt->y -= .1 * gnome_font_get_size (font);
-}
-#endif
-
-static void
-e_contact_rectangle(GnomePrintContext *pc,
- gdouble x0,
- gdouble y0,
- gdouble x1,
- gdouble y1,
- gdouble r,
- gdouble g,
- gdouble b)
-{
- gnome_print_gsave(pc);
- gnome_print_setrgbcolor(pc, r, g, b);
- gnome_print_moveto(pc, x0, y0);
- gnome_print_lineto(pc, x1, y0);
- gnome_print_lineto(pc, x1, y1);
- gnome_print_lineto(pc, x0, y1);
- gnome_print_lineto(pc, x0, y0);
- gnome_print_fill(pc);
- gnome_print_grestore(pc);
-}
-
-static double
-e_contact_get_letter_tab_width (EContactPrintContext *ctxt)
-{
- return gnome_font_get_width_utf8(ctxt->letter_tab_font, "123") + 4 + 18;
-}
-
-static double
-e_contact_print_letter_tab (EContactPrintContext *ctxt)
-{
- unsigned char character;
- gdouble x, y;
- gdouble page_width = 72 * (ctxt->style->page_width - ctxt->style->left_margin - ctxt->style->right_margin);
- gdouble tab_height, tab_width;
- gdouble font_size;
- tab_height = 72 * (ctxt->style->page_height - ctxt->style->top_margin - ctxt->style->bottom_margin) / 27.0;
- font_size = tab_height / 2;
- tab_width = e_contact_get_letter_tab_width(ctxt) - 18;
- x = page_width + 72 * (ctxt->style->left_margin) - tab_width;
- y = 72 * (ctxt->style->page_height - ctxt->style->top_margin);
-
-
- gnome_print_gsave( ctxt->pc );
- if ( ctxt->style->print_using_grey )
- e_contact_rectangle( ctxt->pc, x, 72 * (ctxt->style->page_height - ctxt->style->top_margin), x + tab_width, ctxt->style->bottom_margin * 72, .85, .85, .85 );
- for ( character = 'A' - 1; character <= 'Z'; character ++ ) {
- char string[] = "123";
- if ( character >= 'A' ) {
- string[0] = tolower(character);
- string[1] = 0;
- }
- if ( character >= ctxt->first_char_on_page && character <= ctxt->last_char_on_page ) {
- e_contact_rectangle( ctxt->pc, x + 1, y - 1, x + tab_width - 1, y - (tab_height - 1), 0, 0, 0 );
- gnome_print_setrgbcolor( ctxt->pc, 1, 1, 1 );
- e_contact_output( ctxt->pc, ctxt->letter_tab_font, x + tab_width / 2 - gnome_font_get_width_utf8(ctxt->letter_tab_font, string) / 2, y - (tab_height - font_size) / 2, -1, string );
- } else {
- gnome_print_setrgbcolor( ctxt->pc, 0, 0, 0 );
- e_contact_output( ctxt->pc, ctxt->letter_tab_font, x + tab_width / 2 - gnome_font_get_width_utf8(ctxt->letter_tab_font, string) / 2, y - (tab_height - font_size) / 2, -1, string );
- }
- y -= tab_height;
- }
- gnome_print_grestore( ctxt->pc );
- return gnome_font_get_width_utf8(ctxt->style->body_font, "123") + gnome_font_get_size (ctxt->style->body_font) / 5;
-}
-
-static double
-e_contact_get_letter_heading_height (EContactPrintContext *ctxt)
-{
- gdouble ascender, descender;
- ascender = gnome_font_get_ascender(ctxt->letter_heading_font);
- descender = gnome_font_get_descender(ctxt->letter_heading_font);
- return ascender + descender + 9;
-}
-
-static void
-e_contact_print_letter_heading (EContactPrintContext *ctxt, gchar *character)
-{
- gdouble ascender, descender;
- gdouble width;
-
- width = gnome_font_get_width_utf8(ctxt->letter_heading_font, "m") * 1.7;
- ascender = gnome_font_get_ascender(ctxt->letter_heading_font);
- descender = gnome_font_get_descender(ctxt->letter_heading_font);
- gnome_print_gsave( ctxt->pc );
- e_contact_rectangle( ctxt->pc, ctxt->x, ctxt->y, ctxt->x + width, ctxt->y - (ascender + descender + 6), 0, 0, 0);
- gnome_print_setrgbcolor(ctxt->pc, 1, 1, 1);
- ctxt->y -= 4;
- e_contact_output(ctxt->pc, ctxt->letter_heading_font, ctxt->x + (width - gnome_font_get_width_utf8(ctxt->letter_heading_font, character))/ 2, ctxt->y, -1, character);
- ctxt->y -= ascender + descender;
- ctxt->y -= 2;
- ctxt->y -= 3;
- gnome_print_grestore( ctxt->pc );
-}
-
-static void
-e_contact_start_new_page(EContactPrintContext *ctxt)
-{
- ctxt->x = ctxt->style->left_margin * 72;
- ctxt->y = (ctxt->style->page_height - ctxt->style->top_margin) * 72;
- ctxt->column = 0;
- if ( ctxt->style->letter_tabs )
- e_contact_print_letter_tab(ctxt);
- gnome_print_showpage(ctxt->pc);
-
- gnome_print_beginpage (ctxt->pc, NULL);
-
- ctxt->first_char_on_page = ctxt->last_char_on_page + 1;
-}
-
-static double
-e_contact_get_contact_size(EContact *contact, EContactPrintContext *ctxt)
-{
- gdouble height = 0;
- gdouble page_width = 72 * (ctxt->style->page_width - ctxt->style->left_margin - ctxt->style->right_margin);
- gdouble column_width;
- const char *file_as;
- gint field;
- if ( ctxt->style->letter_tabs )
- page_width -= e_contact_get_letter_tab_width(ctxt);
- column_width = (page_width + 18) / ctxt->style->num_columns - 18;
-
- height += gnome_font_get_size (ctxt->style->headings_font) * .2;
-
- height += gnome_font_get_size (ctxt->style->headings_font) * .2;
-
- file_as = e_contact_get_const (contact, E_CONTACT_FILE_AS);
-
- height += e_contact_text_height(ctxt->pc, ctxt->style->headings_font, column_width - 4, file_as);
-
- height += gnome_font_get_size (ctxt->style->headings_font) * .2;
-
- height += gnome_font_get_size (ctxt->style->headings_font) * .2;
-
- for(field = E_CONTACT_FILE_AS; field != E_CONTACT_LAST_SIMPLE_STRING; field++) {
- char *string;
- string = e_contact_get(contact, field);
- if (string && *string) {
- double xoff = 0;
- xoff += gnome_font_get_width_utf8(ctxt->style->body_font, e_contact_pretty_name (field));
- xoff += gnome_font_get_width_utf8(ctxt->style->body_font, ": ");
- height += e_contact_text_height(ctxt->pc, ctxt->style->body_font, column_width - xoff, string);
- height += .2 * gnome_font_get_size (ctxt->style->body_font);
- }
- g_free(string);
- }
- height += gnome_font_get_size (ctxt->style->headings_font) * .4;
-
- /* g_message ("%s %g", e_card_simple_get (simple, E_CARD_SIMPLE_FIELD_FILE_AS), height); */
- return height;
-}
-
-
-static void
-e_contact_print_contact (EContact *contact, EContactPrintContext *ctxt)
-{
- gdouble page_width = 72 * (ctxt->style->page_width - ctxt->style->left_margin - ctxt->style->right_margin);
- gdouble column_width;
- char *file_as;
- int field;
-
- if ( ctxt->style->letter_tabs )
- page_width -= e_contact_get_letter_tab_width(ctxt);
- column_width = (page_width + 18) / ctxt->style->num_columns - 18;
-
- gnome_print_gsave(ctxt->pc);
-
- ctxt->y -= gnome_font_get_size (ctxt->style->headings_font) * .2;
- ctxt->y -= gnome_font_get_size (ctxt->style->headings_font) * .2;
-
- file_as = e_contact_get (contact, E_CONTACT_FILE_AS);
- if (ctxt->style->print_using_grey)
- e_contact_rectangle(ctxt->pc, ctxt->x, ctxt->y + gnome_font_get_size (ctxt->style->headings_font) * .3, ctxt->x + column_width, ctxt->y - e_contact_text_height(ctxt->pc, ctxt->style->headings_font, column_width - 4, file_as) - gnome_font_get_size (ctxt->style->headings_font) * .3, .85, .85, .85);
- e_contact_output(ctxt->pc, ctxt->style->headings_font, ctxt->x + 2, ctxt->y, column_width - 4, file_as);
- ctxt->y -= e_contact_text_height(ctxt->pc, ctxt->style->headings_font, column_width - 4, file_as);
- g_free (file_as);
-
- ctxt->y -= gnome_font_get_size (ctxt->style->headings_font) * .2;
- ctxt->y -= gnome_font_get_size (ctxt->style->headings_font) * .2;
-
- for(field = E_CONTACT_FILE_AS; field != E_CONTACT_LAST_SIMPLE_STRING; field++) {
- char *string;
- string = e_contact_get(contact, field);
-
- if (string && !strncmp (string, "<?xml", 4)) {
- EABDestination *dest = eab_destination_import (string);
- if (dest != NULL) {
- gchar *new_string = g_strdup (eab_destination_get_address (dest));
- g_free (string);
- string = new_string;
- g_object_unref (dest);
- }
- }
-
- if (string && *string) {
- double xoff = 0;
- e_contact_output(ctxt->pc, ctxt->style->body_font, ctxt->x + xoff, ctxt->y, -1, e_contact_pretty_name (field));
- xoff += gnome_font_get_width_utf8(ctxt->style->body_font, e_contact_pretty_name (field));
- e_contact_output(ctxt->pc, ctxt->style->body_font, ctxt->x + xoff, ctxt->y, -1, ": ");
- xoff += gnome_font_get_width_utf8(ctxt->style->body_font, ": ");
- e_contact_output(ctxt->pc, ctxt->style->body_font, ctxt->x + xoff, ctxt->y, column_width - xoff, string);
- ctxt->y -= e_contact_text_height(ctxt->pc, ctxt->style->body_font, column_width - xoff, string);
- ctxt->y -= .2 * gnome_font_get_size (ctxt->style->body_font);
- }
- g_free(string);
- }
-
- ctxt->y -= gnome_font_get_size (ctxt->style->headings_font) * .4;
- gnome_print_grestore(ctxt->pc);
-}
-
-static void
-e_contact_start_new_column (EContactPrintContext *ctxt)
-{
- gdouble page_width = 72 * (ctxt->style->page_width - ctxt->style->left_margin - ctxt->style->right_margin);
- gdouble column_offset;
- if ( ctxt->style->letter_tabs )
- page_width -= e_contact_get_letter_tab_width(ctxt);
- column_offset = (page_width + 18) / ctxt->style->num_columns;
- ctxt->column ++;
- if (ctxt->column >= ctxt->style->num_columns) {
- e_contact_start_new_page(ctxt);
- ctxt->column = 0;
- }
- ctxt->x = (72 * ctxt->style->left_margin) + column_offset * ctxt->column;
- ctxt->y = 72 * (ctxt->style->page_height - ctxt->style->top_margin);
-}
-
-static void
-complete_sequence(EBookView *book_view, EBookViewStatus status, EContactPrintContext *ctxt)
-{
- GList *contacts = ctxt->contacts;
-
- gdouble page_width = 72 * (ctxt->style->page_width - ctxt->style->left_margin - ctxt->style->right_margin);
-
- ctxt->first_contact = TRUE;
- ctxt->character = NULL;
- ctxt->y = (ctxt->style->page_height - ctxt->style->top_margin) * 72;
- ctxt->x = (ctxt->style->left_margin) * 72;
- if ( ctxt->style->letter_tabs )
- page_width -= e_contact_get_letter_tab_width(ctxt);
-
- ctxt->first_char_on_page = 'A' - 1;
-
- gnome_print_beginpage (ctxt->pc, NULL);
-
- for(; contacts; contacts = contacts->next) {
- EContact *contact = contacts->data;
- guchar *file_as;
- gchar *letter_str = NULL;
-
- file_as = e_contact_get (contact, E_CONTACT_FILE_AS);
-
- if (file_as != NULL) {
- letter_str = g_strndup (file_as, g_utf8_next_char (file_as) - (gchar *) file_as);
- }
- if ( file_as && (!ctxt->character || g_utf8_collate (ctxt->character, letter_str) != 0) ) {
- g_free (ctxt->character);
- ctxt->character = g_strdup (letter_str);
- if (ctxt->style->sections_start_new_page && ! ctxt->first_contact) {
- e_contact_start_new_page(ctxt);
- }
- else if ((!ctxt->first_contact) && (ctxt->y - e_contact_get_letter_heading_height(ctxt) - e_contact_get_contact_size(contact, ctxt) < ctxt->style->bottom_margin * 72))
- e_contact_start_new_column(ctxt);
- if ( ctxt->style->letter_headings )
- e_contact_print_letter_heading(ctxt, ctxt->character);
- ctxt->first_section = FALSE;
- }
- else if ( (!ctxt->first_contact) && (ctxt->y - e_contact_get_contact_size(contact, ctxt) < ctxt->style->bottom_margin * 72)) {
- e_contact_start_new_column(ctxt);
- if ( ctxt->style->letter_headings )
- e_contact_print_letter_heading(ctxt, ctxt->character);
- }
- g_free (letter_str);
- ctxt->last_char_on_page = toupper(*file_as);
- if ( ctxt->last_char_on_page < ctxt->first_char_on_page )
- ctxt->first_char_on_page = ctxt->last_char_on_page;
- e_contact_print_contact(contact, ctxt);
- ctxt->first_contact = FALSE;
- }
- ctxt->last_char_on_page = 'Z';
- if ( ctxt->style->letter_tabs )
- e_contact_print_letter_tab(ctxt);
- gnome_print_showpage(ctxt->pc);
- gnome_print_context_close(ctxt->pc);
- g_free(ctxt->character);
- if (book_view)
- g_object_unref(book_view);
- if (ctxt->type == GNOME_PRINT_DIALOG_RESPONSE_PREVIEW) {
- GtkWidget *preview;
- preview = GTK_WIDGET(gnome_print_job_preview_new(ctxt->master, "Print Preview"));
- gtk_widget_show_all(preview);
- } else {
- gnome_print_job_print(ctxt->master);
- }
- g_object_unref(ctxt->pc);
- g_object_unref(ctxt->master);
- if (ctxt->book)
- g_object_unref(ctxt->book);
- g_free(ctxt->query);
- g_list_foreach(ctxt->contacts, (GFunc) g_object_unref, NULL);
- g_list_free(ctxt->contacts);
- g_object_unref(ctxt->style->headings_font);
- g_object_unref(ctxt->style->body_font);
- g_object_unref(ctxt->style->header_font);
- g_object_unref(ctxt->style->footer_font);
- g_object_unref(ctxt->letter_heading_font);
- g_object_unref(ctxt->letter_tab_font);
- g_free(ctxt->style);
- g_free(ctxt);
-}
-
-static int
-contact_compare (EContact *contact1, EContact *contact2)
-{
- if (contact1 && contact2) {
- const char *file_as1, *file_as2;
- file_as1 = e_contact_get_const (contact1, E_CONTACT_FILE_AS);
- file_as2 = e_contact_get_const (contact2, E_CONTACT_FILE_AS);
-
- if (file_as1 && file_as2)
- return g_utf8_collate(file_as1, file_as2);
- if (file_as1)
- return -1;
- if (file_as2)
- return 1;
- return strcmp(e_contact_get_const(contact1, E_CONTACT_UID), e_contact_get_const(contact2, E_CONTACT_UID));
- } else {
- return 0;
- }
-}
-
-static void
-create_contact(EBookView *book_view, const GList *contacts, EContactPrintContext *ctxt)
-{
- for(; contacts; contacts = contacts->next) {
- EContact *contact = contacts->data;
- g_object_ref(contact);
- ctxt->contacts = g_list_insert_sorted(ctxt->contacts, contact, (GCompareFunc) contact_compare);
- }
-}
-
-static void
-book_view_loaded (EBook *book, EBookStatus status, EBookView *book_view, EContactPrintContext *ctxt)
-{
- g_object_ref(book_view);
-
- g_signal_connect(book_view,
- "contacts_added",
- G_CALLBACK(create_contact),
- ctxt);
-
- g_signal_connect(book_view,
- "sequence_complete",
- G_CALLBACK(complete_sequence),
- ctxt);
-
- e_book_view_start (book_view);
-}
-
-static void
-e_contact_do_print_contacts (EBook *book, char *query, EContactPrintContext *ctxt)
-{
- e_book_async_get_book_view(book, query, (EBookBookViewCallback) book_view_loaded, ctxt);
-}
-
-static void
-e_contact_do_print (EBook *book, char *query, EContactPrintContext *ctxt)
-{
- switch ( ctxt->style->type ) {
- case E_CONTACT_PRINT_TYPE_CARDS:
- e_contact_do_print_contacts( book, query, ctxt);
- break;
- default:
- break;
- }
-}
-
-static void lowify( char *data )
-{
- for ( ; *data; data++ )
- *data = tolower((unsigned char) *data);
-}
-
-static gboolean get_bool( char *data )
-{
- if ( data ) {
- lowify ( data );
- return ! strcmp(data, "true");
- } else
- return FALSE;
-}
-
-static void get_string( char *data, char **variable )
-{
- g_free ( *variable );
- if ( data )
- *variable = g_strdup( data );
- else
- *variable = g_strdup( "" );
-}
-
-static int get_integer( char *data )
-{
- if ( data )
- return atoi(data);
- else
- return 0;
-}
-
-static double get_float( char *data )
-{
- if ( data )
- return atof(data);
- else
- return 0;
-}
-
-static void get_font( char *data, GnomeFont **variable )
-{
- if ( data ) {
- GnomeFont *font = gnome_font_find_from_full_name( data );
- if ( font ) {
- g_object_unref(*variable);
- *variable = font;
- }
- }
-}
-
-
-static void
-e_contact_build_style(EContactPrintStyle *style)
-{
- xmlDocPtr styledoc;
- gchar *filename;
-
- style->title = g_strdup("");
- style->type = E_CONTACT_PRINT_TYPE_CARDS;
- style->sections_start_new_page = TRUE;
- style->num_columns = 2;
- style->blank_forms = 2;
- style->letter_tabs = TRUE;
- style->letter_headings = FALSE;
-
- style->headings_font = gnome_font_find_closest_from_weight_slant ("Sans", GNOME_FONT_BOLD, FALSE, 8);
- style->body_font = gnome_font_find_closest_from_weight_slant ("Sans", GNOME_FONT_BOOK, FALSE, 6);
-
- style->print_using_grey = TRUE;
- style->paper_type = 0;
- style->paper_width = 8.5;
- style->paper_height = 11;
- style->paper_source = 0;
- style->top_margin = .5;
- style->left_margin = .5;
- style->bottom_margin = .5;
- style->right_margin = .5;
- style->page_size = 0;
- style->page_width = 2.75;
- style->page_height = 4.25;
-#if 0
- style->page_width = 4.25;
- style->page_height = 5.5;
-#endif
-#if 0
- style->page_width = 5.5;
- style->page_height = 8.5;
-#endif
- style->orientation_portrait = FALSE;
-
- style->header_font = gnome_font_find_closest_from_weight_slant ("Sans", GNOME_FONT_BOOK, FALSE, 6);
-
- style->left_header = g_strdup("");
- style->center_header = g_strdup("");
- style->right_header = g_strdup("");
-
- style->footer_font = gnome_font_find_closest_from_weight_slant ("Sans", GNOME_FONT_BOOK, FALSE, 6);
-
- style->left_footer = g_strdup("");
- style->center_footer = g_strdup("");
- style->right_footer = g_strdup("");
- style->reverse_on_even_pages = FALSE;
- filename = g_concat_dir_and_file(EVOLUTION_ECPSDIR, "medbook.ecps");
- styledoc = xmlParseFile(filename);
- g_free(filename);
- if (styledoc) {
- xmlNodePtr stylenode = xmlDocGetRootElement(styledoc);
- xmlNodePtr node;
- for (node = stylenode->children; node; node = node->next) {
- char *data = xmlNodeGetContent ( node );
- if ( !strcmp( node->name, "title" ) ) {
- get_string(data, &(style->title));
- } else if ( !strcmp( node->name, "type" ) ) {
- lowify( data );
- if ( !strcmp( data, "cards" ) )
- style->type = E_CONTACT_PRINT_TYPE_CARDS;
- else if ( !strcmp( data, "memo_style" ) )
- style->type = E_CONTACT_PRINT_TYPE_MEMO_STYLE;
- else if ( !strcmp( data, "phone_list" ) )
- style->type = E_CONTACT_PRINT_TYPE_PHONE_LIST;
- } else if ( !strcmp( node->name, "sections_start_new_page" ) ) {
- style->sections_start_new_page = get_bool(data);
- } else if ( !strcmp( node->name, "num_columns" ) ) {
- style->num_columns = get_integer(data);
- } else if ( !strcmp( node->name, "blank_forms" ) ) {
- style->blank_forms = get_integer(data);
- } else if ( !strcmp( node->name, "letter_tabs" ) ) {
- style->letter_tabs = get_bool(data);
- } else if ( !strcmp( node->name, "letter_headings" ) ) {
- style->letter_headings = get_bool(data);
- } else if ( !strcmp( node->name, "headings_font" ) ) {
- get_font( data, &(style->headings_font) );
- } else if ( !strcmp( node->name, "body_font" ) ) {
- get_font( data, &(style->body_font) );
- } else if ( !strcmp( node->name, "print_using_grey" ) ) {
- style->print_using_grey = get_bool(data);
- } else if ( !strcmp( node->name, "paper_width" ) ) {
- style->paper_width = get_float(data);
- } else if ( !strcmp( node->name, "paper_height" ) ) {
- style->paper_height = get_float(data);
- } else if ( !strcmp( node->name, "top_margin" ) ) {
- style->top_margin = get_float(data);
- } else if ( !strcmp( node->name, "left_margin" ) ) {
- style->left_margin = get_float(data);
- } else if ( !strcmp( node->name, "bottom_margin" ) ) {
- style->bottom_margin = get_float(data);
- } else if ( !strcmp( node->name, "right_margin" ) ) {
- style->right_margin = get_float(data);
- } else if ( !strcmp( node->name, "page_width" ) ) {
- style->page_width = get_float(data);
- } else if ( !strcmp( node->name, "page_height" ) ) {
- style->page_height = get_float(data);
- } else if ( !strcmp( node->name, "orientation" ) ) {
- if ( data ) {
- lowify(data);
- style->orientation_portrait = strcmp(data, "landscape");
- } else {
- style->orientation_portrait = TRUE;
- }
- } else if ( !strcmp( node->name, "header_font" ) ) {
- get_font( data, &(style->header_font) );
- } else if ( !strcmp( node->name, "left_header" ) ) {
- get_string(data, &(style->left_header));
- } else if ( !strcmp( node->name, "center_header" ) ) {
- get_string(data, &(style->center_header));
- } else if ( !strcmp( node->name, "right_header" ) ) {
- get_string(data, &(style->right_header));
- } else if ( !strcmp( node->name, "footer_font" ) ) {
- get_font( data, &(style->footer_font) );
- } else if ( !strcmp( node->name, "left_footer" ) ) {
- get_string(data, &(style->left_footer));
- } else if ( !strcmp( node->name, "center_footer" ) ) {
- get_string(data, &(style->center_footer));
- } else if ( !strcmp( node->name, "right_footer" ) ) {
- get_string(data, &(style->right_footer));
- } else if ( !strcmp( node->name, "reverse_on_even_pages" ) ) {
- style->reverse_on_even_pages = get_bool(data);
- }
- if ( data )
- xmlFree (data);
- }
- xmlFreeDoc(styledoc);
- }
-}
-
-static gint
-e_contact_print_close(GnomeDialog *dialog, gpointer data)
-{
- return FALSE;
-}
-
-static void
-e_contact_print_response(GtkWidget *dialog, gint response_id, gpointer data)
-{
- EContactPrintContext *ctxt = g_new(EContactPrintContext, 1);
- EContactPrintStyle *style = g_new(EContactPrintStyle, 1);
- GnomePrintJob *master;
- GnomePrintConfig *config;
- GnomePrintContext *pc;
- gboolean uses_book = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(dialog), "uses_book"));
- gboolean uses_list = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(dialog), "uses_list"));
- EBook *book = NULL;
- char *query = NULL;
- EContact *contact = NULL;
- GList *contact_list = NULL;
- gdouble font_size;
-
-
- if (uses_book) {
- book = g_object_get_data(G_OBJECT(dialog), "book");
- query = g_object_get_data(G_OBJECT(dialog), "query");
- }
- else if (uses_list) {
- contact_list = g_object_get_data(G_OBJECT(dialog), "contact_list");
- }
- else {
- contact = g_object_get_data(G_OBJECT(dialog), "contact");
- }
- switch( response_id ) {
- case GNOME_PRINT_DIALOG_RESPONSE_PRINT:
- config = gnome_print_dialog_get_config (GNOME_PRINT_DIALOG(dialog));
- master = gnome_print_job_new( config );
- pc = gnome_print_job_get_context( master );
- e_contact_build_style(style);
-
- ctxt->x = 0;
- ctxt->y = 0;
- ctxt->column = 0;
- ctxt->style = style;
- ctxt->master = master;
- ctxt->first_section = TRUE;
- ctxt->first_char_on_page = 'A' - 1;
- ctxt->type = GNOME_PRINT_DIALOG_RESPONSE_PRINT;
-
- font_size = 72 * ctxt->style->page_height / 27.0 / 2.0;
- ctxt->letter_heading_font = gnome_font_find (gnome_font_get_name(ctxt->style->headings_font), gnome_font_get_size (ctxt->style->headings_font) * 1.5);
- ctxt->letter_tab_font = gnome_font_find (gnome_font_get_name(ctxt->style->headings_font), font_size);
-
- ctxt->pc = pc;
-#warning FIXME gnome_print_multipage_new_from_sizes
-#if 0
- ctxt->pc = GNOME_PRINT_CONTEXT(gnome_print_multipage_new_from_sizes(pc,
- 72 * style->paper_width,
- 72 * style->paper_height,
- 72 * style->page_width,
- 72 * style->page_height));
-#endif
-
- ctxt->book = book;
- ctxt->query = query;
- if (uses_book) {
- ctxt->contacts = NULL;
- e_contact_do_print(book, ctxt->query, ctxt);
- }
- else if (uses_list) {
- ctxt->contacts = contact_list;
- complete_sequence(NULL, E_BOOK_VIEW_STATUS_OK, ctxt);
- }
- else {
- ctxt->contacts = g_list_append(NULL, contact);
- complete_sequence(NULL, E_BOOK_VIEW_STATUS_OK, ctxt);
- }
- gtk_widget_destroy (dialog);
- break;
- case GNOME_PRINT_DIALOG_RESPONSE_PREVIEW:
- config = gnome_print_dialog_get_config (GNOME_PRINT_DIALOG(dialog));
- master = gnome_print_job_new( config );
- pc = gnome_print_job_get_context( master );
- e_contact_build_style(style);
-
- ctxt->x = 0;
- ctxt->y = 0;
- ctxt->column = 0;
- ctxt->style = style;
- ctxt->master = master;
- ctxt->first_section = TRUE;
- ctxt->first_char_on_page = 'A' - 1;
- ctxt->type = GNOME_PRINT_DIALOG_RESPONSE_PREVIEW;
-
- font_size = 72 * ctxt->style->page_height / 27.0 / 2.0;
- ctxt->letter_heading_font = gnome_font_find (gnome_font_get_name(ctxt->style->headings_font), gnome_font_get_size (ctxt->style->headings_font) * 1.5);
- ctxt->letter_tab_font = gnome_font_find (gnome_font_get_name(ctxt->style->headings_font), font_size);
-
- ctxt->pc = pc;
-#warning FIXME gnome_print_multipage_new_from_sizes
-#if 0
- ctxt->pc = GNOME_PRINT_CONTEXT(gnome_print_multipage_new_from_sizes(pc,
- 72 * style->paper_width,
- 72 * style->paper_height,
- 72 * style->page_width,
- 72 * style->page_height));
-#endif
- ctxt->book = book;
- ctxt->query = g_strdup(query);
- if (uses_book) {
- ctxt->contacts = NULL;
- g_object_ref(book);
- e_contact_do_print(book, ctxt->query, ctxt);
- }
- else if (uses_list) {
- ctxt->contacts = g_list_copy (contact_list);
- g_list_foreach (ctxt->contacts, (GFunc)g_object_ref, NULL);
- complete_sequence(NULL, E_BOOK_VIEW_STATUS_OK, ctxt);
- }
- else {
- ctxt->contacts = g_list_append(NULL, contact);
- g_object_ref(contact);
- complete_sequence(NULL, E_BOOK_VIEW_STATUS_OK, ctxt);
- }
- break;
- case GNOME_PRINT_DIALOG_RESPONSE_CANCEL:
- if (uses_book)
- g_object_unref(book);
- else if (uses_list)
- e_free_object_list (contact_list);
- else
- g_object_unref(contact);
- g_free(query);
- gtk_widget_destroy (dialog);
- g_free(style);
- g_free(ctxt);
- break;
- }
-}
-
-GtkWidget *
-e_contact_print_dialog_new(EBook *book, char *query)
-{
- GtkWidget *dialog;
-
-
- dialog = gnome_print_dialog_new(NULL, _("Print contacts"), GNOME_PRINT_DIALOG_RANGE | GNOME_PRINT_DIALOG_COPIES);
- gnome_print_dialog_construct_range_any(GNOME_PRINT_DIALOG(dialog), GNOME_PRINT_RANGE_ALL | GNOME_PRINT_RANGE_SELECTION,
- NULL, NULL, NULL);
-
- g_object_ref(book);
- g_object_set_data(G_OBJECT(dialog), "uses_book", GINT_TO_POINTER (TRUE));
- g_object_set_data(G_OBJECT(dialog), "uses_list", GINT_TO_POINTER (FALSE));
- g_object_set_data(G_OBJECT(dialog), "book", book);
- g_object_set_data(G_OBJECT(dialog), "query", g_strdup(query));
- g_signal_connect(dialog,
- "response", G_CALLBACK(e_contact_print_response), NULL);
- g_signal_connect(dialog,
- "close", G_CALLBACK(e_contact_print_close), NULL);
- return dialog;
-}
-
-void
-e_contact_print_preview(EBook *book, char *query)
-{
- EContactPrintContext *ctxt = g_new(EContactPrintContext, 1);
- EContactPrintStyle *style = g_new(EContactPrintStyle, 1);
- GnomePrintJob *master;
- GnomePrintContext *pc;
- GnomePrintConfig *config;
- gdouble font_size;
-
- master = gnome_print_job_new(NULL);
- config = gnome_print_job_get_config (master);
- gnome_print_config_set_int (config, GNOME_PRINT_KEY_NUM_COPIES, 1);
- pc = gnome_print_job_get_context (master);
- e_contact_build_style (style);
-
- ctxt->x = 0;
- ctxt->y = 0;
- ctxt->column = 0;
- ctxt->style = style;
- ctxt->master = master;
- ctxt->first_section = TRUE;
- ctxt->first_char_on_page = 'A' - 1;
- ctxt->type = GNOME_PRINT_DIALOG_RESPONSE_PREVIEW;
-
- font_size = 72 * ctxt->style->page_height / 27.0 / 2.0;
- ctxt->letter_heading_font = gnome_font_find (gnome_font_get_name(ctxt->style->headings_font), gnome_font_get_size (ctxt->style->headings_font) * 1.5);
- ctxt->letter_tab_font = gnome_font_find (gnome_font_get_name(ctxt->style->headings_font), font_size);
-
- ctxt->pc = pc;
-#warning FIXME gnome_print_multipage_new_from_sizes
-#if 0
- ctxt->pc = GNOME_PRINT_CONTEXT(gnome_print_multipage_new_from_sizes(pc,
- 72 * style->paper_width,
- 72 * style->paper_height,
- 72 * style->page_width,
- 72 * style->page_height));
-#endif
- ctxt->book = book;
- ctxt->query = g_strdup(query);
- ctxt->contacts = NULL;
- g_object_ref(book);
- e_contact_do_print(book, ctxt->query, ctxt);
-}
-
-GtkWidget *
-e_contact_print_contact_dialog_new(EContact *contact)
-{
- GtkWidget *dialog;
-
- dialog = gnome_print_dialog_new(NULL, _("Print contact"), GNOME_PRINT_DIALOG_COPIES);
-
- contact = e_contact_duplicate(contact);
- g_object_set_data(G_OBJECT(dialog), "contact", contact);
- g_object_set_data(G_OBJECT(dialog), "uses_list", GINT_TO_POINTER (FALSE));
- g_object_set_data(G_OBJECT(dialog), "uses_book", GINT_TO_POINTER (FALSE));
- g_signal_connect(dialog,
- "response", G_CALLBACK(e_contact_print_response), NULL);
- g_signal_connect(dialog,
- "close", G_CALLBACK(e_contact_print_close), NULL);
- return dialog;
-}
-
-GtkWidget *
-e_contact_print_contact_list_dialog_new(GList *list)
-{
- GtkWidget *dialog;
- GList *copied_list;
- GList *l;
-
- if (list == NULL)
- return NULL;
-
- copied_list = g_list_copy (list);
- for (l = copied_list; l; l = l->next)
- l->data = e_contact_duplicate (E_CONTACT (l->data));
-
- dialog = gnome_print_dialog_new(NULL, _("Print contact"), GNOME_PRINT_DIALOG_COPIES);
-
- g_object_set_data(G_OBJECT(dialog), "contact_list", copied_list);
- g_object_set_data(G_OBJECT(dialog), "uses_list", GINT_TO_POINTER (TRUE));
- g_object_set_data(G_OBJECT(dialog), "uses_book", GINT_TO_POINTER (FALSE));
- g_signal_connect(dialog,
- "response", G_CALLBACK(e_contact_print_response), NULL);
- g_signal_connect(dialog,
- "close", G_CALLBACK(e_contact_print_close), NULL);
- return dialog;
-}
diff --git a/addressbook/printing/e-contact-print.glade b/addressbook/printing/e-contact-print.glade
deleted file mode 100644
index d1721e3509..0000000000
--- a/addressbook/printing/e-contact-print.glade
+++ /dev/null
@@ -1,2018 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd" >
-
-<glade-interface>
- <widget class="GtkDialog" id="print-edit-style">
- <property name="visible">no</property>
- <property name="title" translatable="yes">Page Setup:</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="modal">no</property>
- <property name="allow_shrink">no</property>
- <property name="allow_grow">no</property>
- <property name="window-position">GTK_WIN_POS_NONE</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox1">
- <property name="homogeneous">no</property>
- <property name="spacing">8</property>
- <property name="visible">yes</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area1">
- <property name="layout_style">GTK_BUTTONBOX_END</property>
- <property name="spacing">8</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkButton" id="button1">
- <property name="can_default">yes</property>
- <property name="can_focus">yes</property>
- <property name="visible">yes</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">yes</property>
- <property name="use_underline">yes</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button2">
- <property name="can_default">yes</property>
- <property name="can_focus">yes</property>
- <property name="visible">yes</property>
- <property name="label">gtk-apply</property>
- <property name="use_stock">yes</property>
- <property name="use_underline">yes</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button3">
- <property name="can_default">yes</property>
- <property name="can_focus">yes</property>
- <property name="visible">yes</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">yes</property>
- <property name="use_underline">yes</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">yes</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox-contact-print-style-editor">
- <property name="homogeneous">no</property>
- <property name="spacing">5</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkHBox" id="hbox2">
- <property name="border_width">5</property>
- <property name="homogeneous">no</property>
- <property name="spacing">16</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkLabel" id="label8">
- <property name="label" translatable="yes">Style name:</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="label-style-name">
- <property name="can_focus">yes</property>
- <property name="editable">no</property>
- <property name="text" translatable="yes"></property>
- <property name="max-length">0</property>
- <property name="visibility">yes</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkNotebook" id="notebook1">
- <property name="can_focus">yes</property>
- <property name="show_tabs">yes</property>
- <property name="show_border">yes</property>
- <property name="tab_pos">GTK_POS_TOP</property>
- <property name="scrollable">no</property>
- <property name="tab_hborder">2</property>
- <property name="tab_vborder">2</property>
- <property name="enable-popup">no</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkVBox" id="vbox2">
- <property name="border_width">5</property>
- <property name="homogeneous">no</property>
- <property name="spacing">5</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkAlignment" id="alignment1">
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkFrame" id="frame5">
- <property name="label" translatable="yes">Preview:</property>
- <property name="label_xalign">0</property>
- <property name="shadow">GTK_SHADOW_ETCHED_IN</property>
- <property name="visible">yes</property>
-
- <child>
- <placeholder />
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox1">
- <property name="homogeneous">yes</property>
- <property name="spacing">7</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkFrame" id="frame6">
- <property name="label" translatable="yes">Options</property>
- <property name="label_xalign">0</property>
- <property name="shadow">GTK_SHADOW_ETCHED_IN</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkAlignment" id="alignment4">
- <property name="xalign">0</property>
- <property name="yalign">0</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkTable" id="table1">
- <property name="border_width">8</property>
- <property name="homogeneous">no</property>
- <property name="row_spacing">0</property>
- <property name="column_spacing">0</property>
- <property name="n-rows">6</property>
- <property name="n-columns">5</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkLabel" id="label5">
- <property name="label" translatable="yes">Include:</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label4">
- <property name="label" translatable="yes">Sections:</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment2">
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton1">
- <property name="can_focus">yes</property>
- <property name="label" translatable="yes">Immediately follow each other</property>
- <property name="active">yes</property>
- <property name="draw_indicator">yes</property>
- <property name="visible">yes</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">5</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="checkbutton1">
- <property name="can_focus">yes</property>
- <property name="label" translatable="yes">Letter tabs on side</property>
- <property name="active">no</property>
- <property name="draw_indicator">yes</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">5</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="checkbutton2">
- <property name="can_focus">yes</property>
- <property name="label" translatable="yes">Headings for each letter</property>
- <property name="active">no</property>
- <property name="draw_indicator">yes</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">5</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment3">
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton2">
- <property name="can_focus">yes</property>
- <property name="label" translatable="yes">Start on a new page</property>
- <property name="active">no</property>
- <property name="draw_indicator">yes</property>
- <property name="visible">yes</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">5</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label6">
- <property name="label" translatable="yes">Number of columns:</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">3</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_padding">0</property>
- <property name="y_padding">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label7">
- <property name="label" translatable="yes">Blank forms at end:</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">3</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_padding">0</property>
- <property name="y_padding">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment6">
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkSpinButton" id="spinbutton2">
- <property name="can_focus">yes</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">no</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="wrap">no</property>
- <property name="snap_to_ticks">no</property>
- <property name="visible">yes</property>
- <property name="adjustment">2 0 100 1 10 10</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_padding">0</property>
- <property name="y_padding">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment5">
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkSpinButton" id="spinbutton1">
- <property name="can_focus">yes</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">no</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="wrap">no</property>
- <property name="width-request">45</property>
- <property name="snap_to_ticks">no</property>
- <property name="visible">yes</property>
- <property name="adjustment">1 0 100 1 10 10</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_padding">0</property>
- <property name="y_padding">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox3">
- <property name="homogeneous">no</property>
- <property name="spacing">8</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkFrame" id="frame7">
- <property name="label" translatable="yes">Fonts</property>
- <property name="label_xalign">0</property>
- <property name="shadow">GTK_SHADOW_ETCHED_IN</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkTable" id="table2">
- <property name="border_width">8</property>
- <property name="homogeneous">no</property>
- <property name="row_spacing">13</property>
- <property name="column_spacing">8</property>
- <property name="n-rows">2</property>
- <property name="n-columns">2</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkAlignment" id="alignment7">
- <property name="xalign">0.5</property>
- <property name="yalign">1</property>
- <property name="xscale">1</property>
- <property name="yscale">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkButton" id="button6">
- <property name="can_focus">yes</property>
- <property name="label" translatable="yes">F_ont...</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="visible">yes</property>
- <property name="use_underline">yes</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment8">
- <property name="xalign">0.5</property>
- <property name="yalign">1</property>
- <property name="xscale">1</property>
- <property name="yscale">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkButton" id="button5">
- <property name="can_focus">yes</property>
- <property name="label" translatable="yes">_Font...</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="width-request">90</property>
- <property name="visible">yes</property>
- <property name="use_underline">yes</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox4">
- <property name="homogeneous">no</property>
- <property name="spacing">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkLabel" id="label10">
- <property name="label" translatable="yes">Headings</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry3">
- <property name="can_focus">yes</property>
- <property name="editable">yes</property>
- <property name="text" translatable="yes">10 pt. Tahoma</property>
- <property name="width-request">100</property>
- <property name="max-length">0</property>
- <property name="visibility">yes</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">expand|fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox5">
- <property name="homogeneous">no</property>
- <property name="spacing">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkLabel" id="label9">
- <property name="label" translatable="yes">Body</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry2">
- <property name="can_focus">yes</property>
- <property name="editable">yes</property>
- <property name="text" translatable="yes">8 pt. Tahoma</property>
- <property name="width-request">100</property>
- <property name="max-length">0</property>
- <property name="visibility">yes</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">expand|fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFrame" id="frame8">
- <property name="label" translatable="yes">Shading</property>
- <property name="label_xalign">0</property>
- <property name="shadow">GTK_SHADOW_ETCHED_IN</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkCheckButton" id="checkbutton3">
- <property name="can_focus">yes</property>
- <property name="label" translatable="yes">Print using gray shading</property>
- <property name="active">no</property>
- <property name="draw_indicator">yes</property>
- <property name="visible">yes</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label1">
- <property name="label" translatable="yes">Format</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox3">
- <property name="homogeneous">yes</property>
- <property name="spacing">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkVBox" id="vbox6">
- <property name="homogeneous">no</property>
- <property name="spacing">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkFrame" id="frame9">
- <property name="label" translatable="yes">Paper</property>
- <property name="label_xalign">0</property>
- <property name="shadow">GTK_SHADOW_ETCHED_IN</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkVBox" id="vbox16">
- <property name="border_width">10</property>
- <property name="homogeneous">no</property>
- <property name="spacing">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkVBox" id="vbox17">
- <property name="homogeneous">no</property>
- <property name="spacing">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkLabel" id="label21">
- <property name="label" translatable="yes">Type:</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow1">
- <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property>
- <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkTreeView" id="clist1">
- <property name="can_focus">yes</property>
- <property name="headers-visible">no</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkLabel" id="label26">
- <property name="child_name">CList:title</property>
- <property name="label" translatable="yes">label26</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child internal-child="hscrollbar">
- <widget class="GtkHScrollbar" id="convertwidget1">
- <property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
- <property name="visible">yes</property>
- </widget>
- </child>
-
- <child internal-child="vscrollbar">
- <widget class="GtkVScrollbar" id="convertwidget2">
- <property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
- <property name="visible">yes</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox18">
- <property name="homogeneous">no</property>
- <property name="spacing">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkLabel" id="label24">
- <property name="label" translatable="yes">Dimensions:</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox5">
- <property name="homogeneous">yes</property>
- <property name="spacing">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkLabel" id="label27">
- <property name="label" translatable="yes">Width:</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry9">
- <property name="can_focus">yes</property>
- <property name="editable">yes</property>
- <property name="text" translatable="yes"></property>
- <property name="width-request">1</property>
- <property name="max-length">0</property>
- <property name="visibility">yes</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label28">
- <property name="label" translatable="yes">Height:</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry10">
- <property name="can_focus">yes</property>
- <property name="editable">yes</property>
- <property name="text" translatable="yes"></property>
- <property name="width-request">1</property>
- <property name="max-length">0</property>
- <property name="visibility">yes</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox19">
- <property name="homogeneous">no</property>
- <property name="spacing">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkLabel" id="label25">
- <property name="label" translatable="yes">Paper source:</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCombo" id="combo1">
- <property name="value_in_list">no</property>
- <property name="case_sensitive">no</property>
- <property name="enable_arrow_keys">yes</property>
- <property name="enable_arrows_always">no</property>
- <property name="allow_empty">yes</property>
- <property name="visible">yes</property>
-
- <child internal-child="entry">
- <widget class="GtkEntry" id="combo-entry1">
- <property name="can_focus">yes</property>
- <property name="editable">yes</property>
- <property name="text" translatable="yes"></property>
- <property name="max-length">0</property>
- <property name="visibility">yes</property>
- <property name="visible">yes</property>
- </widget>
- </child>
-
- <child internal-child="list">
- <widget class="GtkList" id="convertwidget3">
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkListItem" id="convertwidget4">
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget5">
- <property name="label" translatable="yes"></property>
- <property name="xalign">0.0</property>
- <property name="visible">yes</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFrame" id="frame10">
- <property name="label" translatable="yes">Margins</property>
- <property name="label_xalign">0</property>
- <property name="shadow">GTK_SHADOW_ETCHED_IN</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkTable" id="table4">
- <property name="border_width">15</property>
- <property name="homogeneous">yes</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">9</property>
- <property name="n-rows">2</property>
- <property name="n-columns">4</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkLabel" id="label29">
- <property name="label" translatable="yes">Top:</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">expand|fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label30">
- <property name="label" translatable="yes">Bottom:</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">expand|fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label31">
- <property name="label" translatable="yes">Left:</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">expand|fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry11">
- <property name="can_focus">yes</property>
- <property name="editable">yes</property>
- <property name="text" translatable="yes"></property>
- <property name="width-request">1</property>
- <property name="max-length">0</property>
- <property name="visibility">yes</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">expand|fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry12">
- <property name="can_focus">yes</property>
- <property name="editable">yes</property>
- <property name="text" translatable="yes"></property>
- <property name="width-request">1</property>
- <property name="max-length">0</property>
- <property name="visibility">yes</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">expand|fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry13">
- <property name="can_focus">yes</property>
- <property name="editable">yes</property>
- <property name="text" translatable="yes"></property>
- <property name="width-request">1</property>
- <property name="max-length">0</property>
- <property name="visibility">yes</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">expand|fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry14">
- <property name="can_focus">yes</property>
- <property name="editable">yes</property>
- <property name="text" translatable="yes"></property>
- <property name="width-request">1</property>
- <property name="max-length">0</property>
- <property name="visibility">yes</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">expand|fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label32">
- <property name="label" translatable="yes">Right:</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">expand|fill</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox7">
- <property name="homogeneous">no</property>
- <property name="spacing">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkFrame" id="frame11">
- <property name="label" translatable="yes">Page</property>
- <property name="label_xalign">0</property>
- <property name="shadow">GTK_SHADOW_ETCHED_IN</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkVBox" id="vbox8">
- <property name="border_width">10</property>
- <property name="homogeneous">no</property>
- <property name="spacing">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkVBox" id="vbox20">
- <property name="homogeneous">no</property>
- <property name="spacing">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkLabel" id="label33">
- <property name="label" translatable="yes">Size:</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow2">
- <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property>
- <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkTreeView" id="clist2">
- <property name="can_focus">yes</property>
- <property name="headers-visible">no</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkLabel" id="label35">
- <property name="child_name">CList:title</property>
- <property name="label" translatable="yes">label26</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child internal-child="hscrollbar">
- <widget class="GtkHScrollbar" id="convertwidget6">
- <property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
- <property name="visible">yes</property>
- </widget>
- </child>
-
- <child internal-child="vscrollbar">
- <widget class="GtkVScrollbar" id="convertwidget7">
- <property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
- <property name="visible">yes</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox21">
- <property name="homogeneous">no</property>
- <property name="spacing">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkLabel" id="label34">
- <property name="label" translatable="yes">Dimensions:</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox6">
- <property name="homogeneous">yes</property>
- <property name="spacing">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkLabel" id="label36">
- <property name="label" translatable="yes">Width:</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry15">
- <property name="can_focus">yes</property>
- <property name="editable">yes</property>
- <property name="text" translatable="yes"></property>
- <property name="width-request">1</property>
- <property name="max-length">0</property>
- <property name="visibility">yes</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label37">
- <property name="label" translatable="yes">Height:</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry16">
- <property name="can_focus">yes</property>
- <property name="editable">yes</property>
- <property name="text" translatable="yes"></property>
- <property name="width-request">1</property>
- <property name="max-length">0</property>
- <property name="visibility">yes</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFrame" id="frame12">
- <property name="label" translatable="yes">Orientation</property>
- <property name="label_xalign">0</property>
- <property name="shadow">GTK_SHADOW_ETCHED_IN</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkHBox" id="hbox4">
- <property name="homogeneous">no</property>
- <property name="spacing">10</property>
- <property name="visible">yes</property>
-
- <child>
- <placeholder />
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox9">
- <property name="homogeneous">no</property>
- <property name="spacing">5</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkAlignment" id="alignment9">
- <property name="xalign">0</property>
- <property name="yalign">1</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton3">
- <property name="can_focus">yes</property>
- <property name="label" translatable="yes">Portrait</property>
- <property name="active">no</property>
- <property name="draw_indicator">yes</property>
- <property name="visible">yes</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment10">
- <property name="xalign">0</property>
- <property name="yalign">0</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton4">
- <property name="can_focus">yes</property>
- <property name="label" translatable="yes">Landscape</property>
- <property name="active">no</property>
- <property name="draw_indicator">yes</property>
- <property name="visible">yes</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label2">
- <property name="label" translatable="yes">Paper</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox10">
- <property name="border_width">8</property>
- <property name="homogeneous">no</property>
- <property name="spacing">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkTable" id="table5">
- <property name="homogeneous">yes</property>
- <property name="row_spacing">4</property>
- <property name="column_spacing">4</property>
- <property name="n-rows">4</property>
- <property name="n-columns">3</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkAlignment" id="alignment15">
- <property name="xalign">0</property>
- <property name="yalign">1</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkButton" id="button11">
- <property name="can_focus">yes</property>
- <property name="label" translatable="yes">F_ont...</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="visible">yes</property>
- <property name="use_underline">yes</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTextView" id="text10">
- <property name="can_focus">yes</property>
- <property name="editable">no</property>
- <property name="text" translatable="yes"></property>
- <property name="wrap_mode">GTK_WRAP_WORD</property>
- <property name="height-request">50</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">expand|fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTextView" id="text11">
- <property name="can_focus">yes</property>
- <property name="editable">no</property>
- <property name="text" translatable="yes"></property>
- <property name="wrap_mode">GTK_WRAP_WORD</property>
- <property name="height-request">50</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">expand|fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTextView" id="text12">
- <property name="can_focus">yes</property>
- <property name="editable">no</property>
- <property name="text" translatable="yes"></property>
- <property name="wrap_mode">GTK_WRAP_WORD</property>
- <property name="height-request">50</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTextView" id="text13">
- <property name="can_focus">yes</property>
- <property name="editable">no</property>
- <property name="text" translatable="yes"></property>
- <property name="wrap_mode">GTK_WRAP_WORD</property>
- <property name="height-request">50</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">expand|fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTextView" id="text14">
- <property name="can_focus">yes</property>
- <property name="editable">no</property>
- <property name="text" translatable="yes"></property>
- <property name="wrap_mode">GTK_WRAP_WORD</property>
- <property name="height-request">5</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTextView" id="text15">
- <property name="can_focus">yes</property>
- <property name="editable">no</property>
- <property name="text" translatable="yes"></property>
- <property name="wrap_mode">GTK_WRAP_WORD</property>
- <property name="height-request">50</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment16">
- <property name="xalign">0.5</property>
- <property name="yalign">1</property>
- <property name="xscale">1</property>
- <property name="yscale">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkVBox" id="vbox14">
- <property name="homogeneous">no</property>
- <property name="spacing">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkLabel" id="label14">
- <property name="label" translatable="yes">Header</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry7">
- <property name="can_focus">yes</property>
- <property name="editable">yes</property>
- <property name="text" translatable="yes"></property>
- <property name="max-length">0</property>
- <property name="visibility">yes</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">expand|fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment17">
- <property name="xalign">0.5</property>
- <property name="yalign">1</property>
- <property name="xscale">1</property>
- <property name="yscale">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkVBox" id="vbox15">
- <property name="homogeneous">no</property>
- <property name="spacing">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkLabel" id="label15">
- <property name="label" translatable="yes">Footer:</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry8">
- <property name="can_focus">yes</property>
- <property name="editable">yes</property>
- <property name="text" translatable="yes"></property>
- <property name="max-length">0</property>
- <property name="visibility">yes</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">expand|fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment14">
- <property name="xalign">0</property>
- <property name="yalign">1</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkButton" id="button10">
- <property name="can_focus">yes</property>
- <property name="label" translatable="yes">_Font...</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="visible">yes</property>
- <property name="use_underline">yes</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox7">
- <property name="homogeneous">no</property>
- <property name="spacing">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkToolbar" id="toolbar1">
- <property name="orientation">GTK_ORIENTATION_HORIZONTAL</property>
- <property name="toolbar-style">GTK_TOOLBAR_ICONS</property>
- <property name="visible">yes</property>
-
- <child>
- <placeholder />
- </child>
-
- <child>
- <placeholder />
- </child>
-
- <child>
- <placeholder />
- </child>
-
- <child>
- <placeholder />
- </child>
-
- <child>
- <placeholder />
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">no</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">yes</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="checkbutton4">
- <property name="can_focus">yes</property>
- <property name="label" translatable="yes">Reverse on even pages</property>
- <property name="active">no</property>
- <property name="draw_indicator">yes</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label3">
- <property name="label" translatable="yes">Header/Footer</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">4</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
-</glade-interface>
diff --git a/addressbook/printing/e-contact-print.h b/addressbook/printing/e-contact-print.h
deleted file mode 100644
index 4edc948082..0000000000
--- a/addressbook/printing/e-contact-print.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-contact-print.h
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef E_CONTACT_PRINT_H
-#define E_CONTACT_PRINT_H
-
-#include <glib.h>
-#include <gtk/gtkwidget.h>
-#include <libebook/e-book.h>
-#include <libebook/e-contact.h>
-#include "e-contact-print-types.h"
-
-GtkWidget *e_contact_print_dialog_new(EBook *book, char *query);
-void e_contact_print_preview(EBook *book, char *query);
-GtkWidget *e_contact_print_contact_dialog_new(EContact *card);
-GtkWidget *e_contact_print_contact_list_dialog_new(GList *list);
-
-#endif /* E_CONTACT_PRINT_H */
diff --git a/addressbook/printing/medbook.ecps b/addressbook/printing/medbook.ecps
deleted file mode 100644
index ef76c0b46e..0000000000
--- a/addressbook/printing/medbook.ecps
+++ /dev/null
@@ -1,30 +0,0 @@
-<style>
-<title/>
-<type>cards</type>
-<sections_start_new_page>FALSE</sections_start_new_page>
-<num_columns>2</num_columns>
-<blank_forms>2</blank_forms>
-<letter_tabs>TRUE</letter_tabs>
-<letter_headings>TRUE</letter_headings>
-<headings_font>Helvetica Bold 12</headings_font>
-<body_font>Helvetica 8</body_font>
-<print_using_grey>TRUE</print_using_grey>
-<paper_width>8.5</paper_width>
-<paper_height>11</paper_height>
-<top_margin>0.5</top_margin>
-<left_margin>0.5</left_margin>
-<bottom_margin>0.5</bottom_margin>
-<right_margin>0.5</right_margin>
-<page_width>8.5</page_width>
-<page_height>11</page_height>
-<orientation>portrait</orientation>
-<header_font>Helvetica 8</header_font>
-<left_header/>
-<center_header/>
-<right_header/>
-<footer_font>Helvetica 8</footer_font>
-<left_footer/>
-<center_footer>[Page #]</center_footer>
-<right_footer/>
-<reverse_on_even_pages>FALSE</reverse_on_even_pages>
-</style>
diff --git a/addressbook/printing/phonelist.ecps b/addressbook/printing/phonelist.ecps
deleted file mode 100644
index 980750a6b2..0000000000
--- a/addressbook/printing/phonelist.ecps
+++ /dev/null
@@ -1,29 +0,0 @@
-<style>
-<title/>
-<type>phone_list</type>
-<sections_start_new_page>FALSE</sections_start_new_page>
-<num_columns>2</num_columns>
-<letter_tabs>FALSE</letter_tabs>
-<letter_headings>TRUE</letter_headings>
-<headings_font>Helvetica Bold 10</headings_font>
-<body_font>Helvetica 8</body_font>
-<print_using_grey>TRUE</print_using_grey>
-<paper_width>8.5</paper_width>
-<paper_height>11</paper_height>
-<top_margin>0.5</top_margin>
-<left_margin>0.5</left_margin>
-<bottom_margin>0.5</bottom_margin>
-<right_margin>0.5</right_margin>
-<page_width>8.5</page_width>
-<page_height>11</page_height>
-<orientation>portrait</orientation>
-<header_font>Helvetica 8</header_font>
-<left_header/>
-<center_header/>
-<right_header/>
-<footer_font>Helvetica 8</footer_font>
-<left_footer>[User Name]</left_footer>
-<center_footer>[Page #]</center_footer>
-<right_footer>[Date Printed]</right_footer>
-<reverse_on_even_pages>FALSE</reverse_on_even_pages>
-</style>
diff --git a/addressbook/printing/smallbook.ecps b/addressbook/printing/smallbook.ecps
deleted file mode 100644
index 0bb19aa92e..0000000000
--- a/addressbook/printing/smallbook.ecps
+++ /dev/null
@@ -1,30 +0,0 @@
-<style>
-<title/>
-<type>cards</type>
-<sections_start_new_page>FALSE</sections_start_new_page>
-<num_columns>1</num_columns>
-<blank_forms>2</blank_forms>
-<letter_tabs>TRUE</letter_tabs>
-<letter_headings>TRUE</letter_headings>
-<headings_font>Helvetica Bold 8</headings_font>
-<body_font>Helvetica 6</body_font>
-<print_using_grey>TRUE</print_using_grey>
-<paper_width>8.5</paper_width>
-<paper_height>11</paper_height>
-<top_margin>0.5</top_margin>
-<left_margin>0.5</left_margin>
-<bottom_margin>0.5</bottom_margin>
-<right_margin>0.5</right_margin>
-<page_width>2.75</page_width>
-<page_height>4.25</page_height>
-<orientation>portrait</orientation>
-<header_font>Helvetica 6</header_font>
-<left_header/>
-<center_header/>
-<right_header/>
-<footer_font>Helvetica 6</footer_font>
-<left_footer/>
-<center_footer>[Page #]</center_footer>
-<right_footer/>
-<reverse_on_even_pages>FALSE</reverse_on_even_pages>
-</style>
diff --git a/addressbook/printing/test-contact-print-style-editor.c b/addressbook/printing/test-contact-print-style-editor.c
deleted file mode 100644
index f49625434e..0000000000
--- a/addressbook/printing/test-contact-print-style-editor.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * test-contact-print-style-editor.c
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include "config.h"
-
-#include <stdlib.h>
-#include <gtk/gtkmain.h>
-#include <libgnomeui/gnome-app.h>
-#include <libgnomeui/gnome-ui-init.h>
-#include <bonobo/bonobo-main.h>
-#include "e-contact-print-style-editor.h"
-
-/* This is a horrible thing to do, but it is just a test. */
-GtkWidget *editor;
-
-static void destroy_callback(GtkWidget *app, gpointer data)
-{
- static int count = 2;
- count --;
- if ( count <= 0 )
- exit(0);
-}
-
-#if 0
-static void about_callback( GtkWidget *widget, gpointer data )
-{
-
- const gchar *authors[] =
- {
- "Christopher James Lahey <clahey@umich.edu>",
- NULL
- };
-
- GtkWidget *about =
- gnome_about_new ( _( "Contact Print Style Editor Test" ), VERSION,
- _( "Copyright (C) 2000, Ximian, Inc." ),
- authors,
- _( "This should test the contact print style editor widget" ),
- NULL);
- gtk_widget_show (about);
-}
-#endif
-
-int main( int argc, char *argv[] )
-{
- GtkWidget *app;
-
- /* bindtextdomain (PACKAGE, GNOMELOCALEDIR);
- textdomain (PACKAGE);*/
-
- gnome_program_init ("Contact Print Style Editor Test", VERSION,
- LIBGNOMEUI_MODULE,
- argc, argv,
- NULL);
-
- glade_init ();
-
- app = gnome_app_new("Contact Print Style Editor Test", NULL);
-
- editor = e_contact_print_style_editor_new("");
-
- gnome_app_set_contents( GNOME_APP( app ), editor );
-
- /* Connect the signals */
- g_signal_connect( app, "destroy",
- G_CALLBACK ( destroy_callback ),
- ( gpointer ) app );
-
- gtk_widget_show_all( app );
-
- bonobo_main();
-
- /* Not reached. */
- return 0;
-}
diff --git a/addressbook/printing/test-print.c b/addressbook/printing/test-print.c
deleted file mode 100644
index a1dede7bde..0000000000
--- a/addressbook/printing/test-print.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * test-print.c
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include "config.h"
-
-#include <stdlib.h>
-#include <gtk/gtkmain.h>
-#include <libgnomeui/gnome-dialog.h>
-#include <libgnomeui/gnome-ui-init.h>
-#include <glade/glade.h>
-#include <bonobo/bonobo-main.h>
-#include "e-contact-print.h"
-
-/* This is a horrible thing to do, but it is just a test. */
-GtkWidget *print;
-
-static gint test_close(GnomeDialog *dialog, gpointer data)
-{
- exit(0);
- return 1;
-}
-
-#if 0
-static void about_callback( GtkWidget *widget, gpointer data )
-{
-
- const gchar *authors[] =
- {
- "Christopher James Lahey <clahey@umich.edu>",
- NULL
- };
-
- GtkWidget *about =
- gnome_about_new ( _( "Contact Print Test" ), VERSION,
- _( "Copyright (C) 2000, Ximian, Inc." ),
- authors,
- _( "This should test the contact print code" ),
- NULL);
- gtk_widget_show (about);
-}
-#endif
-
-int main( int argc, char *argv[] )
-{
- GList *shown_fields = NULL;
-
- /* bindtextdomain (PACKAGE, GNOMELOCALEDIR);
- textdomain (PACKAGE);*/
-
- gnome_program_init ("Contact Print Test", VERSION,
- LIBGNOMEUI_MODULE,
- argc, argv,
- NULL);
-
- glade_init ();
-
- shown_fields = g_list_append(shown_fields, "First field");
- shown_fields = g_list_append(shown_fields, "Second field");
- shown_fields = g_list_append(shown_fields, "Third field");
- shown_fields = g_list_append(shown_fields, "Fourth field");
-
- print = e_contact_print_dialog_new(NULL, NULL);
- gtk_widget_show_all(print);
- g_signal_connect(print, "close", G_CALLBACK(test_close), NULL);
-
- bonobo_main();
-
- /* Not reached. */
- return 0;
-}
diff --git a/addressbook/tools/.cvsignore b/addressbook/tools/.cvsignore
deleted file mode 100644
index 25963ae030..0000000000
--- a/addressbook/tools/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-Makefile
-Makefile.in
-evolution-addressbook-export
-evolution-addressbook-abuse
-evolution-addressbook-clean
diff --git a/addressbook/tools/Makefile.am b/addressbook/tools/Makefile.am
deleted file mode 100644
index fe76abcc08..0000000000
--- a/addressbook/tools/Makefile.am
+++ /dev/null
@@ -1,49 +0,0 @@
-privlibexec_SCRIPTS = \
- csv2vcard \
- evolution-addressbook-clean
-
-bin_PROGRAMS = \
- evolution-addressbook-export
-
-noinst_PROGRAMS= evolution-addressbook-abuse
-
-INCLUDES = \
- -DG_LOG_DOMAIN=\"evolution-addressbook-tools\" \
- -I$(top_srcdir) \
- -I$(top_builddir) \
- -DEVOLUTION_LOCALEDIR=\""$(localedir)"\" \
- -DPREFIX=\""$(prefix)"\" \
- -DSYSCONFDIR=\""$(sysconfdir)"\" \
- -DDATADIR=\""$(datadir)"\" \
- -DLIBDIR=\""$(libdir)"\" \
- -I$(top_srcdir)/addressbook \
- -I$(top_srcdir)/addressbook/backend \
- -I$(top_builddir)/addressbook/backend \
- $(GNOME_FULL_CFLAGS)
-
-evolution_addressbook_export_SOURCES = \
- evolution-addressbook-export.c \
- evolution-addressbook-export-list-cards.c \
- evolution-addressbook-export-list-folders.c \
- evolution-addressbook-export.h
-
-evolution_addressbook_export_LDADD = \
- $(top_builddir)/addressbook/backend/ebook/libebook.la \
- $(top_builddir)/e-util/ename/libename.la \
- $(top_builddir)/e-util/libeutil.la
-
-evolution_addressbook_abuse_LDADD = \
- $(top_builddir)/addressbook/backend/ebook/libebook.la \
- $(top_builddir)/e-util/ename/libename.la \
- $(top_builddir)/e-util/libeutil.la
-
-EXTRA_DIST = $(privlibexec_SCRIPTS) \
- evolution-addressbook-clean.in
-
-CLEANFILES= evolution-addressbook-clean
-
-evolution-addressbook-clean: evolution-addressbook-clean.in Makefile
-## Use sed and then mv to avoid problems if the user interrupts.
- sed -e 's?\@EVOLUTION_TOOLSDIR\@?$(privlibexecdir)?g' \
- < $(srcdir)/evolution-addressbook-clean.in > evolution-addressbook-clean.tmp \
- && mv evolution-addressbook-clean.tmp evolution-addressbook-clean
diff --git a/addressbook/tools/csv2vcard b/addressbook/tools/csv2vcard
deleted file mode 100755
index b968fbd9c3..0000000000
--- a/addressbook/tools/csv2vcard
+++ /dev/null
@@ -1,236 +0,0 @@
-#!/usr/bin/perl -w
-#
-# cvs2vcard - Script to convert Outlook CSV files into VCard files
-# suitable to be imported into Evolution.
-#
-# Copyright (C) 2001 Ximian, Inc.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of version 2 of the GNU 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 General Public
-# License along with this program; if not, write to the
-# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-#
-# Author: Michael MacDonald <mjmac@ximian.com>
-#
-
-use strict;
-use diagnostics;
-use Text::ParseWords;
-
-sub usage
-{
- print STDERR << "--EndOfUsage";
-
-Takes a CSV-formatted list of contacts from Outlook and attempts to
-convert it into a list of VCards suitable for import into Evolution.
-
-Usage: $0 [infile outfile]
-
---EndOfUsage
-
- exit;
-}
-
-sub is_recognized_format
-{
- my $line = shift;
-
- # Making some assumptions here... Prolly OK.
- return $line =~ /(First Name|Middle Name|Last Name)/;
-}
-
-sub map_columns
-{
- my $line = shift;
-
- my @names = parse_line(',', 0, $line);
-
- my $ctr = 0;
- my %fieldmap = map { $_ => $ctr++ } @names;
-
- return %fieldmap;
-}
-
-sub build_vcard_attr_from_def
-{
- my ($def, $fields, $map) = @_;
-
- # Valid chars for lookup (from Outlook CSV) are
- # A-Za-z0-9_-'/
- # Valid chars for formatting of attr are
- # \s,|
- my @lookup = map { s/=0A$//; s/[^\w\s\-'\/]//; $_; } split /[\s,]*\|[\s,]*/, $def;
-
- foreach my $el (@lookup) {
- unless (defined($map->{ $el })) {
- print STDERR "$el is undefined\n";
- next;
- }
- if (defined($fields->[$map->{ $el }])) {
- unless ($fields->[$map->{ $el }] =~ /(^$|0\/0\/00)/) {
- $def =~ s/$el/$fields->[$map->{ $el }]/;
- } else {
- $def =~ s/((?<=\|)\s*)?$el(\s*?(?=\|))?(=0A)?,?//;
- }
- } else {
- $def =~ s/((?<=\|)\s*)?$el(\s*?(?=\|))?(=0A)?,?//;
- }
- }
- # Get rid of field delimiters
- $def =~ s/\|//g;
- # Snip off any trailing semicolons or whitespace
- $def =~ s/[\s;]*$//;
-
- return $def;
-}
-
-sub build_vcard_from_line {
- my ($line, %map) = @_;
- my %vcard;
-
- my @fields = parse_line(',', 0, $line);
-
- my %vcard_def = ( FN => 'Title |First Name |Middle Name |Last Name |Suffix',
- N => 'Last Name| Suffix|;First Name|;Middle Name|;Title',
- 'ADR;WORK' => 'PO Box|;Business Street 2|;Business Street|;Business City|;Business State|;Business Postal Code|;Business Country',
- 'LABEL;QUOTED-PRINTABLE;WORK' => 'PO Box |Business Street=0A|Business Street 2=0A|Business City,| Business State| Business Postal Code=0A|Business Country',
- 'TEL;WORK;VOICE' => 'Business Phone',
- 'TEL;WORK;VOICE2' => 'Business Phone 2',
- 'TEL;WORK;FAX' => 'Business Fax',
- 'TEL;WORK;COMPANY' => 'Company Main Phone',
- 'ADR;HOME' => ';Home Street 2|;Home Street|;Home City|;Home State|;Home Postal Code|;Home Country',
- 'LABEL;QUOTED-PRINTABLE;HOME' => 'Home Street=0A|Home Street 2=0A|Home City,| Home State| Home Postal Code=0A|Home Country',
- 'TEL;HOME;VOICE' => 'Home Phone',
- 'TEL;HOME;VOICE2' => 'Home Phone 2',
- 'TEL;HOME;FAX' => 'Home Fax',
- 'ADR;POSTAL' => ';Other Street 2|;Other Street|;Other City|;Other State|;Other Postal Code|;Other Country',
- 'LABEL;QUOTED-PRINTABLE;POSTAL' => 'Other Street=0A|Other Street 2=0A|Other City,| Other State| Other Postal Code=0A|Other Country',
- 'TEL;VOICE' => 'Other Phone',
- 'TEL;FAX' => 'Other Fax',
- 'TEL;CELL' => 'Mobile Phone',
- 'TEL;CAR' => 'Car Phone',
- 'TEL;PAGER' => 'Pager',
- 'TEL;PREF' => 'Primary Phone',
- 'TEL;ISDN' => 'ISDN',
- 'TEL;X-EVOLUTION-CALLBACK' => 'Callback',
- 'TEL;X-EVOLUTION-TTYTDD' => 'TTY/TDD Phone',
- 'TEL;X-EVOLUTION-TELEX' => 'Telex',
- 'TEL;X-EVOLUTION-RADIO' => 'Radio Phone',
- 'EMAIL;INTERNET' => 'E-mail Address',
- 'EMAIL;INTERNET2' => 'E-mail 2 Address',
- 'EMAIL;INTERNET3' => 'E-mail 3 Address',
- ORG => 'Company|;Department',
- TITLE => 'Job Title',
- ROLE => 'Profession',
- 'X-EVOLUTION-ASSISTANT' => "Assistant's Name",
- 'TEL;X-EVOLUTION-ASSISTANT' => "Assistant's Phone",
- 'X-EVOLUTION-SPOUSE' => 'Spouse',
- 'X-EVOLUTION-ANNIVERSARY' => 'Anniversary',
- 'X-EVOLUTION-MANAGER' => "Manager's Name",
- 'X-EVOLUTION-OFFICE' => 'Office Location',
- BDAY => 'Birthday',
- NOTE => 'Notes',
- FBURL => 'Internet Free Busy',
- URL => 'Web Page',
- );
-
- foreach my $key (keys(%vcard_def)) {
- my $attr = build_vcard_attr_from_def($vcard_def{ $key }, \@fields, \%map);
- if (defined($attr)) {
- $vcard{ $key } = $attr unless ($attr =~ /^$/);
- }
- }
-
- return %vcard;
-}
-
-sub print_vcard_to_fh
-{
- my ($fh, %vcard) = @_;
-
- print $fh "BEGIN:VCARD\n";
- foreach my $key (keys(%vcard)) {
- # Dirty hack because Evolution's vcard stores multiple email addrs
- # with same sttribute, hence key collision. Bleah.
- # Ugh! Same deal for multiple phones... (eg. bus. phone)
- #
- # And finally, while we're special-casing... Outlook exports dates
- # differently, so munge 'em if we find 'em.
- if ($key =~ /EMAIL;INTERNET/o) {
- (my $temp = $key) =~ s/\d$//;
- print $fh "$temp:$vcard{ $key }\n";
- } elsif ($key =~ /TEL;(HOME|WORK)/o) {
- (my $temp = $key) =~ s/\d$//;
- print $fh "$temp:$vcard{ $key }\n";
- } elsif ($key =~ /(BDAY|X\-EVOLUTION\-ANNIVERSARY)/o) {
- my $temp = $vcard{ $key };
- if ($temp =~ /(\d\d)\/(\d\d)\/(\d\d)/) {
- # Y2k !! MS Didn't learn anything.
- # Hope no one was born before 1915
- if ((1900 + $3) < 1915) {
- print $fh "$key:20$3-$1-$2\n";
- } else {
- print $fh "$key:19$3-$1-$2\n";
- }
- } else {
- # Something's funky... Just delete the attribute
- print STDERR "Couldn't figure out what to do with $key:$vcard{ $key }\n";
- delete($vcard{ $key });
- }
- } else {
- print $fh "$key:$vcard{ $key }\n";
- }
- }
- print $fh "END:VCARD\n\n";
-}
-
-my $in = $ARGV[0];
-my $out = $ARGV[1];
-
-usage() unless(defined($in) && defined($out));
-
-open (IN, $in)
- or die "Can't open($in): $!\n";
-
-open (OUT, ">$out")
- or die "Can't open($out): $!\n";
-
-my $linectr = 0;
-my %map;
-
-while (my $line = <IN>) {
- $line =~ s/\r//g;
- $line =~ s/\n$//;
- if ($linectr == 0) {
- $linectr++;
- usage() unless is_recognized_format($line);
- %map = map_columns($line);
- #if ($line =~ /\r\n$/) {
- # print STDERR "Apparenlty found DOS-style EOL indicators...\n";
- $/ = "\r\n";
- #}
- } else {
- $linectr++;
- while ($line =~ /^(("([^"]|\n|"")*")?,)*"([^"]|\n|"")*$/) {
- my $temp = $line;
- $line = <IN>;
- $line =~ s/\r//g;
- $line =~ s/\n$//;
- $line = "$temp $line";
- }
- my %vcard = build_vcard_from_line($line, %map);
- print_vcard_to_fh(\*OUT, %vcard);
- }
-}
-
-close(IN);
-close(OUT);
diff --git a/addressbook/tools/evolution-addressbook-abuse.c b/addressbook/tools/evolution-addressbook-abuse.c
deleted file mode 100644
index 3446e15938..0000000000
--- a/addressbook/tools/evolution-addressbook-abuse.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-#include <config.h>
-
-#include <bonobo/bonobo-main.h>
-
-#include <backend/ebook/e-book.h>
-#include <gnome.h>
-
-#define CONTACTS_TO_ADD 2000
-
-static gchar *
-make_random_string (void)
-{
- const gchar *elements = " abcdefghijklmnopqrstuvwxyz1234567890 ABCDEFGHIJKLMNOPQRSTUVWXYZ";
- gint len = strlen (elements);
- gint i, N = 5 + (random () % 10);
- gchar *str = g_malloc (N+1);
-
- for (i = 0; i < N; ++i) {
- str[i] = elements[random () % len];
- }
- str[i] = '\0';
-
- return str;
-}
-
-static gchar *
-make_random_vcard (void)
-{
- gchar *fa = make_random_string ();
- gchar *name = make_random_string ();
- gchar *email = make_random_string ();
- gchar *org = make_random_string ();
-
- gchar *vcard;
-
- vcard = g_strdup_printf ("BEGIN:VCARD\n"
- "X-EVOLUTION-FILE-AS:%s\n"
- "N:%s\n"
- "EMAIL;INTERNET:%s\n"
- "ORG:%s\n"
- "END:VCARD",
- fa, name, email, org);
- g_free (fa);
- g_free (name);
- g_free (email);
- g_free (org);
-
- return vcard;
-}
-
-int
-main (int argc, char *argv[])
-{
- EBook *book;
- int i;
-
- if (getenv ("ABUSE_THE_WOMBAT") == NULL) {
- g_print ("You probably don't want to use this program.\n"
- "It isn't very nice.\n");
- exit(0);
- }
-
- bindtextdomain (GETTEXT_PACKAGE, EVOLUTION_LOCALEDIR);
- textdomain (GETTEXT_PACKAGE);
-
- gnome_program_init ("evolution-addressbook-abuse", VERSION,
- LIBGNOMEUI_MODULE, argc, argv,
- GNOME_PROGRAM_STANDARD_PROPERTIES,
- NULL);
-
- if (!e_book_get_default_addressbook (&book, NULL)) {
- g_warning ("couldn't open addressbook");
- exit (1);
- }
-
- for (i = 0; i < CONTACTS_TO_ADD; ++i) {
- gchar *vcard = make_random_vcard ();
- EContact *contact = e_contact_new_from_vcard (vcard);
- g_message ("adding %d", i);
- if (!e_book_add_contact (book, contact, NULL)) {
- g_warning ("something went wrong...");
- exit (1);
- }
- g_free (vcard);
- g_object_unref (contact);
- }
-
- return 0;
-}
diff --git a/addressbook/tools/evolution-addressbook-clean.in b/addressbook/tools/evolution-addressbook-clean.in
deleted file mode 100644
index b7ee7ba167..0000000000
--- a/addressbook/tools/evolution-addressbook-clean.in
+++ /dev/null
@@ -1,24 +0,0 @@
-#! /usr/bin/perl -w
-
-sub do_system
-{
- my ($command) = @_;
- system ($command);
- if ($? != 0) {
- die "Command failed: $command";
- }
-}
-
-$filename = `@EVOLUTION_TOOLSDIR@/evolution-addressbook-export`;
-if ($? != 0) {
- $! = $?;
- die $!;
-}
-
-$HOME = $ENV{"HOME"};
-
-system ("@EVOLUTION_TOOLSDIR@/killev");
-do_system ("/bin/mv ${HOME}/evolution/local/Contacts/addressbook.db ${HOME}/evolution/local/Contacts/addressbook-backup.db");
-do_system ("@EVOLUTION_TOOLSDIR@/evolution-addressbook-import --input-file $filename");
-do_system ("/bin/rm $filename");
-
diff --git a/addressbook/tools/evolution-addressbook-export-list-cards.c b/addressbook/tools/evolution-addressbook-export-list-cards.c
deleted file mode 100644
index c51393d047..0000000000
--- a/addressbook/tools/evolution-addressbook-export-list-cards.c
+++ /dev/null
@@ -1,780 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* evolution-addressbook-export-list-cards.c
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Gilbert Fang <gilbert.fang@sun.com>
- *
- */
-
-#include <config.h>
-
-#include <sys/types.h>
-#include <unistd.h>
-
-#include <glib.h>
-#include <bonobo-activation/bonobo-activation.h>
-#include <libbonobo.h>
-#include <libgnome/libgnome.h>
-
-#include <ebook/e-book.h>
-#include <ebook/e-card-simple.h>
-#include <ebook/e-book-util.h>
-
-#include "evolution-addressbook-export.h"
-
-#define COMMA_SEPARATOR ","
-
-typedef enum _CARD_FORMAT CARD_FORMAT;
-typedef enum _DeliveryAddressField DeliveryAddressField;
-typedef enum _ECardSimpleFieldCSV ECardSimpleFieldCSV;
-typedef struct _ECardCSVFieldData ECardCSVFieldData;
-
-enum _CARD_FORMAT
-{
- CARD_FORMAT_CSV,
- CARD_FORMAT_VCARD
-};
-
-enum _DeliveryAddressField
-{
- DELIVERY_ADDRESS_STREET,
- DELIVERY_ADDRESS_EXT,
- DELIVERY_ADDRESS_CITY,
- DELIVERY_ADDRESS_REGION,
- DELIVERY_ADDRESS_CODE,
- DELIVERY_ADDRESS_COUNTRY
-};
-
-enum _ECardSimpleFieldCSV
-{
- E_CARD_SIMPLE_FIELD_CSV_FILE_AS,
- E_CARD_SIMPLE_FIELD_CSV_FULL_NAME,
- E_CARD_SIMPLE_FIELD_CSV_EMAIL,
- E_CARD_SIMPLE_FIELD_CSV_PHONE_PRIMARY,
- E_CARD_SIMPLE_FIELD_CSV_PHONE_ASSISTANT,
- E_CARD_SIMPLE_FIELD_CSV_PHONE_BUSINESS,
- E_CARD_SIMPLE_FIELD_CSV_PHONE_CALLBACK,
- E_CARD_SIMPLE_FIELD_CSV_PHONE_COMPANY,
- E_CARD_SIMPLE_FIELD_CSV_PHONE_HOME,
- E_CARD_SIMPLE_FIELD_CSV_ORG,
- /*E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS, */
- E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_STREET,
- E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_EXT,
- E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_CITY,
- E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_REGION,
- E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_POSTCODE,
- E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_COUNTRY,
- /*E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME, */
- E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_STREET,
- E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_EXT,
- E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_CITY,
- E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_REGION,
- E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_POSTCODE,
- E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_COUNTRY,
- E_CARD_SIMPLE_FIELD_CSV_PHONE_MOBILE,
- E_CARD_SIMPLE_FIELD_CSV_PHONE_CAR,
- E_CARD_SIMPLE_FIELD_CSV_PHONE_BUSINESS_FAX,
- E_CARD_SIMPLE_FIELD_CSV_PHONE_HOME_FAX,
- E_CARD_SIMPLE_FIELD_CSV_PHONE_BUSINESS_2,
- E_CARD_SIMPLE_FIELD_CSV_PHONE_HOME_2,
- E_CARD_SIMPLE_FIELD_CSV_PHONE_ISDN,
- E_CARD_SIMPLE_FIELD_CSV_PHONE_OTHER,
- E_CARD_SIMPLE_FIELD_CSV_PHONE_OTHER_FAX,
- E_CARD_SIMPLE_FIELD_CSV_PHONE_PAGER,
- E_CARD_SIMPLE_FIELD_CSV_PHONE_RADIO,
- E_CARD_SIMPLE_FIELD_CSV_PHONE_TELEX,
- E_CARD_SIMPLE_FIELD_CSV_PHONE_TTYTDD,
- /*E_CARD_SIMPLE_FIELD_CSV_ADDRESS_OTHER, */
- E_CARD_SIMPLE_FIELD_CSV_ADDRESS_OTHER_STREET,
- E_CARD_SIMPLE_FIELD_CSV_ADDRESS_OTHER_EXT,
- E_CARD_SIMPLE_FIELD_CSV_ADDRESS_OTHER_CITY,
- E_CARD_SIMPLE_FIELD_CSV_ADDRESS_OTHER_REGION,
- E_CARD_SIMPLE_FIELD_CSV_ADDRESS_OTHER_POSTCODE,
- E_CARD_SIMPLE_FIELD_CSV_ADDRESS_OTHER_COUNTRY,
- E_CARD_SIMPLE_FIELD_CSV_EMAIL_2,
- E_CARD_SIMPLE_FIELD_CSV_EMAIL_3,
- E_CARD_SIMPLE_FIELD_CSV_URL,
- E_CARD_SIMPLE_FIELD_CSV_ORG_UNIT,
- E_CARD_SIMPLE_FIELD_CSV_OFFICE,
- E_CARD_SIMPLE_FIELD_CSV_TITLE,
- E_CARD_SIMPLE_FIELD_CSV_ROLE,
- E_CARD_SIMPLE_FIELD_CSV_MANAGER,
- E_CARD_SIMPLE_FIELD_CSV_ASSISTANT,
- E_CARD_SIMPLE_FIELD_CSV_NICKNAME,
- E_CARD_SIMPLE_FIELD_CSV_SPOUSE,
- E_CARD_SIMPLE_FIELD_CSV_NOTE,
- E_CARD_SIMPLE_FIELD_CSV_CALURI,
- E_CARD_SIMPLE_FIELD_CSV_FBURL,
- /*E_CARD_SIMPLE_FIELD_CSV_ANNIVERSARY, */
- E_CARD_SIMPLE_FIELD_CSV_ANNIVERSARY_YEAR,
- E_CARD_SIMPLE_FIELD_CSV_ANNIVERSARY_MONTH,
- E_CARD_SIMPLE_FIELD_CSV_ANNIVERSARY_DAY,
- /*E_CARD_SIMPLE_FIELD_CSV_BIRTH_DATE, */
- E_CARD_SIMPLE_FIELD_CSV_BIRTH_DATE_YEAR,
- E_CARD_SIMPLE_FIELD_CSV_BIRTH_DATE_MONTH,
- E_CARD_SIMPLE_FIELD_CSV_BIRTH_DATE_DAY,
- E_CARD_SIMPLE_FIELD_CSV_MAILER,
- E_CARD_SIMPLE_FIELD_CSV_NAME_OR_ORG,
- E_CARD_SIMPLE_FIELD_CSV_CATEGORIES,
- E_CARD_SIMPLE_FIELD_CSV_FAMILY_NAME,
- E_CARD_SIMPLE_FIELD_CSV_GIVEN_NAME,
- E_CARD_SIMPLE_FIELD_CSV_ADDITIONAL_NAME,
- E_CARD_SIMPLE_FIELD_CSV_NAME_SUFFIX,
- E_CARD_SIMPLE_FIELD_CSV_WANTS_HTML,
- E_CARD_SIMPLE_FIELD_CSV_IS_LIST,
- E_CARD_SIMPLE_FIELD_CSV_LAST
-};
-
-struct _ECardCSVFieldData
-{
- gint csv_field;
- gint simple_field;
- gchar *csv_name;
-};
-
-#define NOMAP -1
-static ECardCSVFieldData csv_field_data[] = {
- {E_CARD_SIMPLE_FIELD_CSV_FILE_AS, E_CARD_SIMPLE_FIELD_FILE_AS, ""},
- {E_CARD_SIMPLE_FIELD_CSV_FULL_NAME, E_CARD_SIMPLE_FIELD_CSV_FULL_NAME, ""},
- {E_CARD_SIMPLE_FIELD_CSV_EMAIL, E_CARD_SIMPLE_FIELD_EMAIL, ""},
- {E_CARD_SIMPLE_FIELD_CSV_PHONE_PRIMARY, E_CARD_SIMPLE_FIELD_PHONE_PRIMARY,
- ""},
- {E_CARD_SIMPLE_FIELD_CSV_PHONE_ASSISTANT,
- E_CARD_SIMPLE_FIELD_PHONE_ASSISTANT, ""},
- {E_CARD_SIMPLE_FIELD_CSV_PHONE_BUSINESS,
- E_CARD_SIMPLE_FIELD_PHONE_BUSINESS, ""},
- {E_CARD_SIMPLE_FIELD_CSV_PHONE_CALLBACK,
- E_CARD_SIMPLE_FIELD_PHONE_CALLBACK, ""},
- {E_CARD_SIMPLE_FIELD_CSV_PHONE_COMPANY, E_CARD_SIMPLE_FIELD_PHONE_COMPANY,
- ""},
- {E_CARD_SIMPLE_FIELD_CSV_PHONE_HOME, E_CARD_SIMPLE_FIELD_PHONE_HOME, ""},
- {E_CARD_SIMPLE_FIELD_CSV_ORG, E_CARD_SIMPLE_FIELD_ORG, ""},
- /*E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS, */
- {E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_STREET, NOMAP,
- "Business Address"},
- {E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_EXT, NOMAP,
- "Business Address2"},
- {E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_CITY, NOMAP,
- "Business Address City"},
- {E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_REGION, NOMAP,
- "Business Address State"},
- {E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_POSTCODE, NOMAP,
- "Business Address PostCode"},
- {E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_COUNTRY, NOMAP,
- "Business Address Country"},
- /*E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME, */
- {E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_STREET, NOMAP, "Home Address"},
- {E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_EXT, NOMAP, "Home Address2"},
- {E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_CITY, NOMAP, "Home Address City"},
- {E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_REGION, NOMAP,
- "Home Address State"},
- {E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_POSTCODE, NOMAP,
- "Home Address PostCode"},
- {E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_COUNTRY, NOMAP,
- "Home Address Country"},
- {E_CARD_SIMPLE_FIELD_CSV_PHONE_MOBILE, E_CARD_SIMPLE_FIELD_PHONE_MOBILE,
- ""},
- {E_CARD_SIMPLE_FIELD_CSV_PHONE_CAR, E_CARD_SIMPLE_FIELD_PHONE_CAR, ""},
- {E_CARD_SIMPLE_FIELD_CSV_PHONE_BUSINESS_FAX,
- E_CARD_SIMPLE_FIELD_PHONE_BUSINESS_FAX, ""},
- {E_CARD_SIMPLE_FIELD_CSV_PHONE_HOME_FAX,
- E_CARD_SIMPLE_FIELD_PHONE_HOME_FAX, ""},
- {E_CARD_SIMPLE_FIELD_CSV_PHONE_BUSINESS_2,
- E_CARD_SIMPLE_FIELD_PHONE_BUSINESS_2, ""},
- {E_CARD_SIMPLE_FIELD_CSV_PHONE_HOME_2, E_CARD_SIMPLE_FIELD_PHONE_HOME_2,
- ""},
- {E_CARD_SIMPLE_FIELD_CSV_PHONE_ISDN, E_CARD_SIMPLE_FIELD_PHONE_ISDN, ""},
- {E_CARD_SIMPLE_FIELD_CSV_PHONE_OTHER, E_CARD_SIMPLE_FIELD_PHONE_OTHER, ""},
- {E_CARD_SIMPLE_FIELD_CSV_PHONE_OTHER_FAX,
- E_CARD_SIMPLE_FIELD_PHONE_OTHER_FAX, ""},
- {E_CARD_SIMPLE_FIELD_CSV_PHONE_PAGER, E_CARD_SIMPLE_FIELD_PHONE_PAGER, ""},
- {E_CARD_SIMPLE_FIELD_CSV_PHONE_RADIO, E_CARD_SIMPLE_FIELD_PHONE_RADIO, ""},
- {E_CARD_SIMPLE_FIELD_CSV_PHONE_TELEX, E_CARD_SIMPLE_FIELD_PHONE_TELEX, ""},
- {E_CARD_SIMPLE_FIELD_CSV_PHONE_TTYTDD, E_CARD_SIMPLE_FIELD_PHONE_TTYTDD,
- ""},
- /*E_CARD_SIMPLE_FIELD_CSV_ADDRESS_OTHER, */
- {E_CARD_SIMPLE_FIELD_CSV_ADDRESS_OTHER_STREET, NOMAP, "Other Address"},
- {E_CARD_SIMPLE_FIELD_CSV_ADDRESS_OTHER_EXT, NOMAP, "Other Address2"},
- {E_CARD_SIMPLE_FIELD_CSV_ADDRESS_OTHER_CITY, NOMAP,
- "Other Address City"},
- {E_CARD_SIMPLE_FIELD_CSV_ADDRESS_OTHER_REGION, NOMAP,
- "Other Address State"},
- {E_CARD_SIMPLE_FIELD_CSV_ADDRESS_OTHER_POSTCODE, NOMAP,
- "Other Address PostCode"},
- {E_CARD_SIMPLE_FIELD_CSV_ADDRESS_OTHER_COUNTRY, NOMAP,
- "Other Address Country"},
- {E_CARD_SIMPLE_FIELD_CSV_EMAIL_2, E_CARD_SIMPLE_FIELD_EMAIL_2, ""},
- {E_CARD_SIMPLE_FIELD_CSV_EMAIL_3, E_CARD_SIMPLE_FIELD_EMAIL_3, ""},
- {E_CARD_SIMPLE_FIELD_CSV_URL, E_CARD_SIMPLE_FIELD_URL, ""},
- {E_CARD_SIMPLE_FIELD_CSV_ORG_UNIT, E_CARD_SIMPLE_FIELD_ORG_UNIT, ""},
- {E_CARD_SIMPLE_FIELD_CSV_OFFICE, E_CARD_SIMPLE_FIELD_OFFICE, ""},
- {E_CARD_SIMPLE_FIELD_CSV_TITLE, E_CARD_SIMPLE_FIELD_TITLE, ""},
- {E_CARD_SIMPLE_FIELD_CSV_ROLE, E_CARD_SIMPLE_FIELD_ROLE, ""},
- {E_CARD_SIMPLE_FIELD_CSV_MANAGER, E_CARD_SIMPLE_FIELD_MANAGER, ""},
- {E_CARD_SIMPLE_FIELD_CSV_ASSISTANT, E_CARD_SIMPLE_FIELD_ASSISTANT, ""},
- {E_CARD_SIMPLE_FIELD_CSV_NICKNAME, E_CARD_SIMPLE_FIELD_NICKNAME, ""},
- {E_CARD_SIMPLE_FIELD_CSV_SPOUSE, E_CARD_SIMPLE_FIELD_SPOUSE, ""},
- {E_CARD_SIMPLE_FIELD_CSV_NOTE, E_CARD_SIMPLE_FIELD_NOTE, ""},
- {E_CARD_SIMPLE_FIELD_CSV_CALURI, E_CARD_SIMPLE_FIELD_CALURI, ""},
- {E_CARD_SIMPLE_FIELD_CSV_FBURL, E_CARD_SIMPLE_FIELD_FBURL, ""},
- /*E_CARD_SIMPLE_FIELD_ANNIVERSARY, */
- {E_CARD_SIMPLE_FIELD_CSV_ANNIVERSARY_YEAR, NOMAP, "Anniversary Year"},
- {E_CARD_SIMPLE_FIELD_CSV_ANNIVERSARY_MONTH, NOMAP, "Anniversary Month"},
- {E_CARD_SIMPLE_FIELD_CSV_ANNIVERSARY_DAY, NOMAP, "Anniversary Day"},
- /*E_CARD_SIMPLE_FIELD_BIRTH_DATE, */
- {E_CARD_SIMPLE_FIELD_CSV_BIRTH_DATE_YEAR, NOMAP, "Birth Year"},
- {E_CARD_SIMPLE_FIELD_CSV_BIRTH_DATE_MONTH, NOMAP, "Birth Month"},
- {E_CARD_SIMPLE_FIELD_CSV_BIRTH_DATE_DAY, NOMAP, "Birth Day"},
- {E_CARD_SIMPLE_FIELD_CSV_MAILER, E_CARD_SIMPLE_FIELD_MAILER, ""},
- {E_CARD_SIMPLE_FIELD_CSV_NAME_OR_ORG, E_CARD_SIMPLE_FIELD_NAME_OR_ORG, ""},
- {E_CARD_SIMPLE_FIELD_CSV_CATEGORIES, E_CARD_SIMPLE_FIELD_CATEGORIES, ""},
- {E_CARD_SIMPLE_FIELD_CSV_FAMILY_NAME, E_CARD_SIMPLE_FIELD_FAMILY_NAME, ""},
- {E_CARD_SIMPLE_FIELD_CSV_GIVEN_NAME, E_CARD_SIMPLE_FIELD_GIVEN_NAME, ""},
- {E_CARD_SIMPLE_FIELD_CSV_ADDITIONAL_NAME,
- E_CARD_SIMPLE_FIELD_ADDITIONAL_NAME, ""},
- {E_CARD_SIMPLE_FIELD_CSV_NAME_SUFFIX, E_CARD_SIMPLE_FIELD_NAME_SUFFIX, ""},
- {E_CARD_SIMPLE_FIELD_CSV_WANTS_HTML, E_CARD_SIMPLE_FIELD_WANTS_HTML, ""},
- {E_CARD_SIMPLE_FIELD_CSV_IS_LIST, E_CARD_SIMPLE_FIELD_IS_LIST, ""},
- {E_CARD_SIMPLE_FIELD_CSV_LAST, NOMAP, ""}
-
-};
-
-static GSList *pre_defined_fields;
-
-/*function prototypes*/
-gint e_card_simple_csv_get_simple_field (ECardSimpleFieldCSV csv_field);
-gchar *e_card_simple_csv_get_name (ECardSimpleFieldCSV csv_field);
-gchar *e_card_simple_csv_get (ECardSimple * simple, ECardSimpleFieldCSV csv_field);
-gchar *e_card_simple_csv_get_header_line (GSList * csv_all_fields);
-gchar *e_card_simple_to_csv (ECardSimple * simple, GSList * csv_all_fields);
-gchar *e_card_get_csv (ECard * card, GSList * csv_all_fields);
-gchar *delivery_address_get_sub_field (const ECardDeliveryAddress * delivery_address, DeliveryAddressField sub_field);
-gchar *check_null_pointer (gchar * orig);
-gchar *quote_string (gchar * orig);
-int output_n_cards_file (FILE * outputfile, ECardCursor * cursor, int size, int begin_no, CARD_FORMAT format);
-static void fork_to_background (void);
-static void action_list_cards_get_cursor_cb (EBook * book, EBookStatus status, ECardCursor * cursor, ActionContext * p_actctx);
-static void action_list_cards_open_cb (EBook * book, EBookStatus status, ActionContext * p_actctx);
-static guint action_list_cards_run (ActionContext * p_actctx);
-void set_pre_defined_field (GSList ** pre_defined_fields);
-guint action_list_cards_init (ActionContext * p_actctx);
-
-
-/* function declarations*/
-gint
-e_card_simple_csv_get_simple_field (ECardSimpleFieldCSV csv_field)
-{
- return csv_field_data[csv_field].simple_field;
-}
-
-gchar *
-e_card_simple_csv_get_name (ECardSimpleFieldCSV csv_field)
-{
- gint simple_field;
- gchar *name;
- gchar *esc_name;
- gchar *quoted_name;
-
- ECardSimple *a_simple_card;
-
- simple_field = e_card_simple_csv_get_simple_field (csv_field);
-
- if (simple_field != NOMAP) {
- a_simple_card = E_CARD_SIMPLE (g_object_new (E_TYPE_CARD_SIMPLE, NULL));
- name = g_strdup (e_card_simple_get_ecard_field (a_simple_card, simple_field));
- g_object_unref (G_OBJECT (a_simple_card));
- } else {
- name = g_strdup (csv_field_data[csv_field].csv_name);
- }
- esc_name = g_strescape (name, NULL);
- g_free (name);
- quoted_name = quote_string (esc_name);
- g_free (esc_name);
- return quoted_name;
-}
-
-
-gchar *
-e_card_simple_csv_get (ECardSimple * simple, ECardSimpleFieldCSV csv_field)
-{
- gint simple_field;
- gchar *field_value;
- gchar *esc_field_value;
- gchar *quoted_field_value;
-
- const ECardDeliveryAddress *delivery_address = NULL;
-
- simple_field = e_card_simple_csv_get_simple_field (csv_field);
-
- if (simple_field != NOMAP) {
- field_value = e_card_simple_get (simple, simple_field);
- } else {
-
- switch (csv_field) {
- case E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_STREET:
- delivery_address = e_card_simple_get_delivery_address (simple, E_CARD_SIMPLE_ADDRESS_ID_HOME);
- field_value = delivery_address_get_sub_field (delivery_address, DELIVERY_ADDRESS_STREET);
- break;
- case E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_EXT:
- delivery_address = e_card_simple_get_delivery_address (simple, E_CARD_SIMPLE_ADDRESS_ID_HOME);
- field_value = delivery_address_get_sub_field (delivery_address, DELIVERY_ADDRESS_EXT);
- break;
- case E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_CITY:
- delivery_address = e_card_simple_get_delivery_address (simple, E_CARD_SIMPLE_ADDRESS_ID_HOME);
- field_value = delivery_address_get_sub_field (delivery_address, DELIVERY_ADDRESS_CITY);
- break;
- case E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_REGION:
- delivery_address = e_card_simple_get_delivery_address (simple, E_CARD_SIMPLE_ADDRESS_ID_HOME);
- field_value = delivery_address_get_sub_field (delivery_address, DELIVERY_ADDRESS_REGION);
- break;
- case E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_POSTCODE:
- delivery_address = e_card_simple_get_delivery_address (simple, E_CARD_SIMPLE_ADDRESS_ID_HOME);
- field_value = delivery_address_get_sub_field (delivery_address, DELIVERY_ADDRESS_CODE);
- break;
- case E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_COUNTRY:
- delivery_address = e_card_simple_get_delivery_address (simple, E_CARD_SIMPLE_ADDRESS_ID_HOME);
- field_value = delivery_address_get_sub_field (delivery_address, DELIVERY_ADDRESS_COUNTRY);
- break;
- case E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_STREET:
- delivery_address = e_card_simple_get_delivery_address (simple, E_CARD_SIMPLE_ADDRESS_ID_BUSINESS);
- field_value = delivery_address_get_sub_field (delivery_address, DELIVERY_ADDRESS_STREET);
- break;
- case E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_EXT:
- delivery_address = e_card_simple_get_delivery_address (simple, E_CARD_SIMPLE_ADDRESS_ID_BUSINESS);
- field_value = delivery_address_get_sub_field (delivery_address, DELIVERY_ADDRESS_EXT);
- break;
- case E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_CITY:
- delivery_address = e_card_simple_get_delivery_address (simple, E_CARD_SIMPLE_ADDRESS_ID_BUSINESS);
- field_value = delivery_address_get_sub_field (delivery_address, DELIVERY_ADDRESS_CITY);
- break;
- case E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_REGION:
- delivery_address = e_card_simple_get_delivery_address (simple, E_CARD_SIMPLE_ADDRESS_ID_BUSINESS);
- field_value = delivery_address_get_sub_field (delivery_address, DELIVERY_ADDRESS_REGION);
- break;
- case E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_POSTCODE:
- delivery_address = e_card_simple_get_delivery_address (simple, E_CARD_SIMPLE_ADDRESS_ID_BUSINESS);
- field_value = delivery_address_get_sub_field (delivery_address, DELIVERY_ADDRESS_CODE);
- break;
- case E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_COUNTRY:
- delivery_address = e_card_simple_get_delivery_address (simple, E_CARD_SIMPLE_ADDRESS_ID_BUSINESS);
- field_value = delivery_address_get_sub_field (delivery_address, DELIVERY_ADDRESS_COUNTRY);
- break;
- case E_CARD_SIMPLE_FIELD_CSV_BIRTH_DATE_YEAR:
- if (simple->card->bday != NULL) {
- field_value = g_strdup_printf ("%04d", simple->card->bday->year);
- } else {
- field_value = g_strdup ("");
- }
- break;
-
- case E_CARD_SIMPLE_FIELD_CSV_BIRTH_DATE_MONTH:
- if (simple->card->bday != NULL) {
- field_value = g_strdup_printf ("%02d", simple->card->bday->month);
- } else {
- field_value = g_strdup ("");
- }
- break;
-
- case E_CARD_SIMPLE_FIELD_CSV_BIRTH_DATE_DAY:
- if (simple->card->bday != NULL) {
- field_value = g_strdup_printf ("%02d", simple->card->bday->day);
- } else {
- field_value = g_strdup ("");
- }
- break;
-
- default:
- field_value = g_strdup ("");
- }
- }
-
- /*checking to avoid the NULL pointer */
- if (field_value == NULL)
- field_value = g_strdup ("");
-
- esc_field_value = g_strescape (field_value, NULL);
- g_free (field_value);
-
- quoted_field_value = quote_string (esc_field_value);
- g_free (esc_field_value);
-
- return quoted_field_value;
-}
-
-
-gchar *
-e_card_simple_csv_get_header_line (GSList * csv_all_fields)
-{
-
- guint field_number;
- gint csv_field;
- gchar **field_name_array;
- gchar *header_line;
-
- gint loop_counter;
-
- field_number = g_slist_length (csv_all_fields);
- field_name_array = g_new0 (gchar *, field_number + 1);
-
- for (loop_counter = 0; loop_counter < field_number; loop_counter++) {
- csv_field = GPOINTER_TO_INT (g_slist_nth_data (csv_all_fields, loop_counter));
- *(field_name_array + loop_counter) = e_card_simple_csv_get_name (csv_field);
- }
-
- header_line = g_strjoinv (COMMA_SEPARATOR, field_name_array);
-
- for (loop_counter = 0; loop_counter < field_number; loop_counter++) {
- g_free (*(field_name_array + loop_counter));
- }
- g_free (field_name_array);
-
- return header_line;
-
-}
-
-
-gchar *
-e_card_simple_to_csv (ECardSimple * simple, GSList * csv_all_fields)
-{
- guint field_number;
- gint csv_field;
- gchar **field_value_array;
- gchar *aline;
-
- gint loop_counter;
-
- field_number = g_slist_length (csv_all_fields);
- field_value_array = g_new0 (gchar *, field_number + 1);
-
- for (loop_counter = 0; loop_counter < field_number; loop_counter++) {
- csv_field = GPOINTER_TO_INT (g_slist_nth_data (csv_all_fields, loop_counter));
- *(field_value_array + loop_counter) = e_card_simple_csv_get (simple, csv_field);
- }
-
- aline = g_strjoinv (COMMA_SEPARATOR, field_value_array);
-
- for (loop_counter = 0; loop_counter < field_number; loop_counter++) {
- g_free (*(field_value_array + loop_counter));
- }
- g_free (field_value_array);
-
- return aline;
-
-}
-
-
-gchar *
-e_card_get_csv (ECard * card, GSList * csv_all_fields)
-{
- ECardSimple *simple_card;
- gchar *aline;
-
- simple_card = e_card_simple_new (card);
- aline = e_card_simple_to_csv (simple_card, csv_all_fields);
- g_object_unref (G_OBJECT (simple_card));
- return aline;
-}
-
-
-gchar *
-check_null_pointer (gchar * orig)
-{
- gchar *result;
- if (orig == NULL)
- result = g_strdup ("");
- else
- result = g_strdup (orig);
- return result;
-}
-
-gchar *delivery_address_get_sub_field (const ECardDeliveryAddress * address, DeliveryAddressField sub_field)
-{
- gchar *sub_field_value;
- gchar *str_temp, *str_temp_a;
- if (address != NULL) {
- switch (sub_field) {
- case DELIVERY_ADDRESS_STREET:
- str_temp_a = check_null_pointer (address->po);
- str_temp = check_null_pointer (address->street);
- sub_field_value = g_strdup_printf ("%s %s", str_temp_a, str_temp);
- g_free (str_temp);
- g_free (str_temp_a);
- break;
- case DELIVERY_ADDRESS_EXT:
- sub_field_value = check_null_pointer (address->ext);
- break;
- case DELIVERY_ADDRESS_CITY:
- sub_field_value = check_null_pointer (address->city);
- break;
- case DELIVERY_ADDRESS_REGION:
- sub_field_value = check_null_pointer (address->region);
- break;
- case DELIVERY_ADDRESS_CODE:
- sub_field_value = check_null_pointer (address->code);
- break;
- case DELIVERY_ADDRESS_COUNTRY:
- sub_field_value = check_null_pointer (address->country);
- break;
- default:
- sub_field_value = g_strdup ("");
- }
- } else {
- sub_field_value = g_strdup ("");
- }
- return sub_field_value;
-}
-
-gchar *
-quote_string (gchar *orig)
-{
- if (orig == NULL)
- return g_strdup ("\"\"");
- return g_strdup_printf("\"%s\"", orig);
-}
-
-int
-output_n_cards_file (FILE * outputfile, ECardCursor * cursor, int size, int begin_no, CARD_FORMAT format)
-{
- int i;
- if (format == CARD_FORMAT_VCARD) {
- for (i = begin_no; i < size + begin_no; i++) {
- ECard *card = e_card_cursor_get_nth (cursor, i);
- gchar *vcard = e_card_get_vcard_assume_utf8 (card);
- fprintf (outputfile, "%s\n", vcard);
- g_free (vcard);
- g_object_unref (G_OBJECT (card));
- }
- } else if (format == CARD_FORMAT_CSV) {
- gchar *csv_fields_name = e_card_simple_csv_get_header_line (pre_defined_fields);
- fprintf (outputfile, "%s\n", csv_fields_name);
- g_free (csv_fields_name);
-
- for (i = begin_no; i < size + begin_no; i++) {
- ECard *card = e_card_cursor_get_nth (cursor, i);
- gchar *csv = e_card_get_csv (card, pre_defined_fields);
- fprintf (outputfile, "%s\n", csv);
- g_free (csv);
- g_object_unref (G_OBJECT (card));
-
- }
- }
-
- return SUCCESS;
-
-}
-
-static void
-fork_to_background (void)
-{
- pid_t pid;
- pid = fork ();
- if (pid == -1) {
- /* ouch, fork() failed */
- perror ("fork");
- exit (-1);
- } else if (pid == 0) {
- /* child */
- /*contunue */
-
- } else {
- /* parent exit, note the use of _exit() instead of exit() */
- _exit (-1);
- }
-}
-
-
-
-
-static void
-action_list_cards_get_cursor_cb (EBook * book, EBookStatus status, ECardCursor * cursor, ActionContext * p_actctx)
-{
- FILE *outputfile;
- long length;
- int IsFirstOne;
- int series_no;
- gchar *file_series_name;
- CARD_FORMAT format;
- int size;
-
- length = e_card_cursor_get_length (cursor);
-
- if (length <= 0) {
- g_warning ("Couldn't load addressbook correctly!!!! %s####", p_actctx->action_list_cards.addressbook_folder_uri);
- exit (-1);
- }
-
-
- if (p_actctx->action_list_cards.async_mode == FALSE) { /* normal mode */
-
- if (p_actctx->action_list_cards.output_file == NULL) {
- outputfile = stdout;
- } else {
- /* fopen output file */
- if (!(outputfile = fopen (p_actctx->action_list_cards.output_file, "w"))) {
- g_warning (_("Can not open file"));
- exit (-1);
- }
- }
-
- if (p_actctx->action_list_cards.IsVCard == TRUE)
- format = CARD_FORMAT_VCARD;
- else
- format = CARD_FORMAT_CSV;
-
- output_n_cards_file (outputfile, cursor, length, 0, format);
-
-
-
- if (p_actctx->action_list_cards.output_file != NULL) {
- fclose (outputfile);
- }
- }
-
-
- /*async mode */
- else {
-
- size = p_actctx->action_list_cards.file_size;
- IsFirstOne = TRUE;
- series_no = 0;
-
- do {
- /* whether it is the last file */
- if ((series_no + 1) * size >= length) { /*last one */
- file_series_name = g_strdup_printf ("%s.end", p_actctx->action_list_cards.output_file);
-
- } else { /*next one */
- file_series_name =
- g_strdup_printf ("%s.%04d", p_actctx->action_list_cards.output_file, series_no);
- }
-
- if (!(outputfile = fopen (file_series_name, "w"))) {
- g_warning (_("Can not open file"));
- exit (-1);
- }
-
-
- if (p_actctx->action_list_cards.IsVCard == TRUE)
- format = CARD_FORMAT_VCARD;
- else
- format = CARD_FORMAT_CSV;
- output_n_cards_file (outputfile, cursor, size, series_no * size, format);
-
- fclose (outputfile);
-
- series_no++;
-
- if (IsFirstOne == TRUE) {
- fork_to_background ();
- IsFirstOne = FALSE;
- }
-
-
- }
- while (series_no * size < length);
- g_free (file_series_name);
- }
-
- bonobo_main_quit ();
-}
-
-
-
-
-static void
-action_list_cards_open_cb (EBook * book, EBookStatus status, ActionContext * p_actctx)
-{
- if (status != E_BOOK_STATUS_SUCCESS) {
- g_warning ("Couldn't load addressbook %s", p_actctx->action_list_cards.addressbook_folder_uri);
- exit (-1);
- }
- e_book_get_cursor (book, "(contains \"full_name\" \"\")", (EBookCursorCallback)action_list_cards_get_cursor_cb, p_actctx);
-}
-
-
-static guint
-action_list_cards_run (ActionContext * p_actctx)
-{
- EBook *book;
- book = e_book_new ();
-
- if (p_actctx->action_list_cards.addressbook_folder_uri != NULL) {
- e_book_load_uri (book, p_actctx->action_list_cards.addressbook_folder_uri,
- (EBookCallback)action_list_cards_open_cb, p_actctx);
- } else {
- e_book_load_default_book (book, (EBookCallback)action_list_cards_open_cb, p_actctx);
- }
- return SUCCESS;
-}
-
-
-void
-set_pre_defined_field (GSList ** pre_defined_fields)
-{
- *pre_defined_fields = NULL;
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_GIVEN_NAME));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_FAMILY_NAME));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_FULL_NAME));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_NICKNAME));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_EMAIL));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_EMAIL_2));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_WANTS_HTML));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_PHONE_BUSINESS));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_PHONE_HOME));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_PHONE_BUSINESS_FAX));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_PHONE_PAGER));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_PHONE_MOBILE));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_STREET));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_EXT));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_CITY));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_REGION));
- *pre_defined_fields =
- g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_POSTCODE));
- *pre_defined_fields =
- g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_COUNTRY));
- *pre_defined_fields =
- g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_STREET));
- *pre_defined_fields =
- g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_EXT));
- *pre_defined_fields =
- g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_CITY));
- *pre_defined_fields =
- g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_REGION));
- *pre_defined_fields =
- g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_POSTCODE));
- *pre_defined_fields =
- g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_COUNTRY));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_TITLE));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_OFFICE));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_ORG));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_URL));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_CALURI));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_BIRTH_DATE_YEAR));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_BIRTH_DATE_MONTH));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_BIRTH_DATE_DAY));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_NOTE));
-}
-
-guint
-action_list_cards_init (ActionContext * p_actctx)
-{
- g_idle_add ((GSourceFunc) action_list_cards_run, p_actctx);
- set_pre_defined_field (&pre_defined_fields);
-
- return SUCCESS;
-}
diff --git a/addressbook/tools/evolution-addressbook-export-list-folders.c b/addressbook/tools/evolution-addressbook-export-list-folders.c
deleted file mode 100644
index 8922422a8f..0000000000
--- a/addressbook/tools/evolution-addressbook-export-list-folders.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* evolution-addressbook-export-list-folders.c
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Gilbert Fang <gilbert.fang@sun.com>
- *
- */
-
-#include <config.h>
-
-#include <glib.h>
-#include <bonobo-activation/bonobo-activation.h>
-#include <libbonobo.h>
-#include <libgnome/libgnome.h>
-
-#include <ebook/e-book.h>
-#include <ebook/e-book-util.h>
-
-#include "evolution-addressbook-export.h"
-
-static void
-action_list_folders_get_cursor_cb (EBook * book, EBookStatus status, ECardCursor * cursor, ActionContext * p_actctx)
-{
- FILE *outputfile;
- long length;
- const char *uri;
- char *name;
-
- uri = e_book_get_default_book_uri ();
- length = e_card_cursor_get_length (cursor);
-
- /*Fix me *
- can not get name, should be a bug of e-book.Anyway, should set a default name.
- */
- /*name = e_book_get_name (book); */
- name = g_strdup (_("Contacts"));
-
- if (p_actctx->action_list_folders.output_file == NULL) {
- printf ("\"%s\",\"%s\",%d\n", uri, name, (int) length);
- } else {
- /*output to a file */
- if (!(outputfile = fopen (p_actctx->action_list_folders.output_file, "w"))) {
- g_warning (_("Can not open file"));
- exit (-1);
- }
- fprintf (outputfile, "\"%s\",\"%s\",%d\n", uri, name, (int) length);
- fclose (outputfile);
- }
-
- g_free (name);
- g_object_unref (G_OBJECT (book));
- bonobo_main_quit ();
-}
-
-static void
-action_list_folders_open_cb (EBook * book, EBookStatus status, ActionContext * p_actctx)
-{
- if (E_BOOK_STATUS_SUCCESS == status) {
- e_book_get_cursor (book, "(contains \"full_name\" \"\")",
- (EBookCursorCallback)action_list_folders_get_cursor_cb, p_actctx);
- } else {
- g_object_unref (G_OBJECT (book));
- g_warning (_("Can not load URI"));
- exit (-1);
- }
-}
-
-static guint
-action_list_folders_run (ActionContext * p_actctx)
-{
- EBook *book;
- book = e_book_new ();
-
- e_book_load_default_book (book, (EBookCallback)action_list_folders_open_cb, p_actctx);
- return SUCCESS;
-}
-
-guint
-action_list_folders_init (ActionContext * p_actctx)
-{
- g_idle_add ((GSourceFunc) action_list_folders_run, p_actctx);
-
- return SUCCESS;
-}
diff --git a/addressbook/tools/evolution-addressbook-export.c b/addressbook/tools/evolution-addressbook-export.c
deleted file mode 100644
index a61880ed14..0000000000
--- a/addressbook/tools/evolution-addressbook-export.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* evolution-addressbook-export.c
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Gilbert Fang <gilbert.fang@sun.com>
- *
- */
-
-#include <config.h>
-
-#include <glib.h>
-#include <bonobo-activation/bonobo-activation.h>
-#include <bonobo/bonobo-main.h>
-#include <gnome.h>
-
-#include <ebook/e-book.h>
-
-#include "evolution-addressbook-export.h"
-
-int
-main (int argc, char **argv)
-{
- ActionContext actctx;
- GnomeProgram *program;
- poptContext context;
- const gchar **argvn;
-
- int current_action = ACTION_NOTHING;
- int IsCSV = FALSE;
- int IsVCard = FALSE;
-
- /*** popttable */
- char *output_file = NULL;
- int list_folders_mode = FALSE;
- char *output_format = NULL;
- char *addressbook_folder_uri = NULL;
- int async_mode = FALSE;
- int file_size = 0;
-
- struct poptOption options[] = {
- {"output", '\0', POPT_ARG_STRING, &output_file, 0, N_("Specify the output file instead of standard output"),
- N_("OUTPUTFILE")},
- {"list-addressbook-folders", 'l', POPT_ARG_NONE, &list_folders_mode, 0, N_("List local addressbook folders"),
- NULL},
- {"format", '\0', POPT_ARG_STRING, &output_format, 0, N_("Show cards as vcard or csv file"), N_("[vcard|csv]")},
- {"async", 'a', POPT_ARG_NONE, &async_mode, 0, N_("Export in asynchronous mode "), NULL},
- {"size", '\0', POPT_ARG_INT, &file_size, 0,
- N_("The number of cards in one output file in asychronous mode,default size 100."), N_("NUMBER")},
- {NULL, '\0', 0, NULL, 0, NULL, NULL}
- };
- /* popttable end ** */
-
- /*i18n-lize */
- bindtextdomain (GETTEXT_PACKAGE, EVOLUTION_LOCALEDIR);
- bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
- textdomain (GETTEXT_PACKAGE);
-
- program =
- gnome_program_init (PACKAGE, VERSION, GNOME_BONOBO_MODULE, argc, argv, GNOME_PARAM_POPT_TABLE, options,
- GNOME_PARAM_NONE);
-
- /* Parsing Parameter */
- g_object_get (program, "popt-context", &context, NULL);
- argvn = poptGetArgs (context);
- if (!argvn) {
- addressbook_folder_uri = NULL;
- } else { /* there at lease is a one argument, and that should be addressbook folder uri */
- addressbook_folder_uri = g_strdup (*argvn);
- }
- poptFreeContext (context);
-
- if (list_folders_mode != FALSE) {
- current_action = ACTION_LIST_FOLDERS;
- /* check there should not be addressbook-folder-uri , and async and size , output_format */
- if (addressbook_folder_uri != NULL || async_mode != FALSE || output_format != NULL || file_size != 0) {
- g_warning (_("Command line arguments error, please use --help option to see the usage."));
- exit (-1);
- }
- } else {
-
- current_action = ACTION_LIST_CARDS;
-
- /* check the output format */
- if (output_format == NULL) {
- IsVCard = TRUE;
- } else {
- IsCSV = !strcmp (output_format, "csv");
- IsVCard = !strcmp (output_format, "vcard");
- if (IsCSV == FALSE && IsVCard == FALSE) {
- g_warning (_("Only support csv or vcard format."));
- exit (-1);
- }
- }
-
- /*check async and output file */
- if (async_mode == TRUE) {
- /* check have to output file , set default file_size */
- if (output_file == NULL) {
- g_warning (_("In async mode, output must be file."));
- exit (-1);
- }
- if (file_size == 0)
- file_size = DEFAULT_SIZE_NUMBER;
- } else {
- /*check no file_size */
- if (file_size != 0) {
- g_warning (_("In normal mode, there should not need size option."));
- exit (-1);
- }
- }
- }
-
- /* do actions */
- if (current_action == ACTION_LIST_FOLDERS) {
- actctx.action_type = current_action;
- if (output_file == NULL) {
- actctx.action_list_folders.output_file = NULL;
- } else {
- actctx.action_list_folders.output_file = g_strdup (output_file);
- }
- action_list_folders_init (&actctx);
- } else if (current_action == ACTION_LIST_CARDS) {
- actctx.action_type = current_action;
- if (output_file == NULL) {
- actctx.action_list_cards.output_file = NULL;
- } else {
- actctx.action_list_cards.output_file = g_strdup (output_file);
- }
- actctx.action_list_cards.IsCSV = IsCSV;
- actctx.action_list_cards.IsVCard = IsVCard;
- actctx.action_list_cards.addressbook_folder_uri = g_strdup (addressbook_folder_uri);
- actctx.action_list_cards.async_mode = async_mode;
- actctx.action_list_cards.file_size = file_size;
-
- action_list_cards_init (&actctx);
-
- } else {
- g_warning (_("Impossible internal error."));
- exit (-1);
- }
-
- bonobo_main ();
-
- /*FIXME:should free actctx's some char* field, such as output_file! but since the program will end, so that will not cause mem leak. */
-
- return 0;
-}
diff --git a/addressbook/tools/evolution-addressbook-export.h b/addressbook/tools/evolution-addressbook-export.h
deleted file mode 100644
index 13749aed61..0000000000
--- a/addressbook/tools/evolution-addressbook-export.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* evolution-addressbook-export.h
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Gilbert Fang <gilbert.fang@sun.com>
- *
- */
-
-#ifndef _EVOLUTION_ADDRESSBOOK_EXPORT_H_
-#define _EVOLUTION_ADDRESSBOOK_EXPORT_H__
-
-#include <glib.h>
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#define SUCCESS 0
-#define FAILED -1
-
-#define ACTION_NOTHING 0
-#define ACTION_LIST_FOLDERS 1
-#define ACTION_LIST_CARDS 2
-
-#define DEFAULT_SIZE_NUMBER 100
-
-union _ActionContext
-{
-
- guint action_type;
-
- struct
- {
- gint action_type;
- gchar *output_file;
- }
- action_list_folders;
-
- struct
- {
- gint action_type;
- gchar *output_file;
- gint IsCSV;
- gint IsVCard;
- gchar *addressbook_folder_uri;
- gint async_mode;
- gint file_size;
- }
- action_list_cards;
-};
-
-typedef union _ActionContext ActionContext;
-
-
-/* action_list_folders */
-guint action_list_folders_init (ActionContext * p_actctx);
-
-/*action list cards*/
-guint action_list_cards_init (ActionContext * p_actctx);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _EVOLUTION_ADDRESSBOOK_EXPORT_H_ */
diff --git a/addressbook/tools/evolution-addressbook-import.c b/addressbook/tools/evolution-addressbook-import.c
deleted file mode 100644
index 28871efd96..0000000000
--- a/addressbook/tools/evolution-addressbook-import.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-#include <config.h>
-
-#include <bonobo-activation/bonobo-activation.h>
-#include <bonobo/bonobo-main.h>
-#include <backend/ebook/e-book-async.h>
-#include <gnome.h>
-
-static int exec_ref_count = 0;
-
-static void
-ref_executable (void)
-{
- exec_ref_count ++;
-}
-
-static void
-unref_executable (void)
-{
- exec_ref_count --;
- if (exec_ref_count == 0)
- g_main_loop_quit (0);
-}
-
-static void
-add_cb (EBook *book, EBookStatus status, const char *id, gpointer closure)
-{
- switch (status) {
- case E_BOOK_ERROR_OK:
- unref_executable ();
- break;
- default:
- g_main_loop_quit (NULL);
- break;
- }
-}
-
-static void
-use_addressbook (EBook *book, gpointer closure)
-{
- GList *cards, *list;
- char *filename = closure;
-
- if (book == NULL)
- g_error (_("Error loading default addressbook."));
-
- cards = e_card_load_cards_from_file (filename);
-
- ref_executable ();
-
- for (list = cards; list; list = list->next) {
- ref_executable ();
- e_book_add_card (book, list->data, add_cb, closure);
- }
- sync();
-
- unref_executable ();
-}
-
-int
-main (int argc, char *argv[])
-{
- char *filename = NULL;
-
- struct poptOption options[] = {
- { "input-file", '\0', POPT_ARG_STRING, &filename, 0, N_("Input File"), NULL },
- POPT_AUTOHELP
- { NULL, '\0', 0, NULL, 0, NULL, NULL }
- };
-
- bindtextdomain (GETTEXT_PACKAGE, EVOLUTION_LOCALEDIR);
- textdomain (GETTEXT_PACKAGE);
-
- gnome_program_init ("evolution-addressbook-import", VERSION,
- LIBGNOMEUI_MODULE, argc, argv,
- GNOME_PROGRAM_STANDARD_PROPERTIES,
- GNOME_PARAM_POPT_TABLE, options,
- NULL);
-
- if (filename == NULL) {
- g_error (_("No filename provided."));
- }
-
- e_book_async_get_default_addressbook (use_addressbook, filename);
-
- bonobo_main ();
-
- return 0;
-}
diff --git a/addressbook/util/.cvsignore b/addressbook/util/.cvsignore
deleted file mode 100644
index 6205c6f3ab..0000000000
--- a/addressbook/util/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-Makefile
-Makefile.in
-eab-marshal.c
-eab-marshal.h
diff --git a/addressbook/util/Makefile.am b/addressbook/util/Makefile.am
deleted file mode 100644
index 6cb70de06a..0000000000
--- a/addressbook/util/Makefile.am
+++ /dev/null
@@ -1,36 +0,0 @@
-INCLUDES = \
- -DPREFIX=\"$(prefix)\" \
- -DSYSCONFDIR=\"$(sysconfdir)\" \
- -DDATADIR=\"$(datadir)\" \
- -DLIBDIR=\"$(libdir)\" \
- -DG_LOG_DOMAIN=\"EBook\" \
- -I$(top_srcdir) \
- -I$(top_srcdir)/camel \
- -I$(top_builddir)/shell \
- -I$(top_srcdir)/shell \
- $(EVOLUTION_ADDRESSBOOK_CFLAGS)
-
-noinst_LTLIBRARIES = libeabutil.la
-
-libeabutil_la_SOURCES = \
- eab-marshal.c \
- eab-destination.c \
- eab-destination.h \
- eab-book-util.c \
- eab-book-util.h
-
-libeabutil_la_LIBADD = \
- $(top_builddir)/camel/libcamel.la \
- $(top_builddir)/e-util/libeutil.la
-
-MARSHAL_GENERATED = eab-marshal.c eab-marshal.h
-@EVO_MARSHAL_RULE@
-
-BUILT_SOURCES = $(MARSHAL_GENERATED)
-CLEANFILES = $(BUILT_SOURCES)
-
-EXTRA_DIST = \
- eab-marshal.list
-
-dist-hook:
- cd $(distdir); rm -f $(BUILT_SOURCES)
diff --git a/addressbook/util/eab-book-util.c b/addressbook/util/eab-book-util.c
deleted file mode 100644
index 2c80d6f8a1..0000000000
--- a/addressbook/util/eab-book-util.c
+++ /dev/null
@@ -1,293 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * eab-util.c
- *
- * Copyright (C) 2001-2003 Ximian, Inc.
- *
- * Authors: Jon Trowbridge <trow@ximian.com>
- * Chris Toshok <toshok@ximian.com>
- */
-
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA.
- */
-
-#include <config.h>
-#include "eab-book-util.h"
-
-#include <string.h>
-#include <glib.h>
-#include <glib-object.h>
-#include <e-util/e-config-listener.h>
-
-EConfigListener *
-eab_get_config_database ()
-{
- static EConfigListener *config_db;
-
- if (config_db == NULL)
- config_db = e_config_listener_new ();
-
- return config_db;
-}
-
-/*
- *
- * Specialized Queries
- *
- */
-
-guint
-eab_name_and_email_query (EBook *book,
- const gchar *name,
- const gchar *email,
- EBookContactsCallback cb,
- gpointer closure)
-{
- gchar *email_query=NULL, *name_query=NULL, *query;
- guint tag;
-
- g_return_val_if_fail (book && E_IS_BOOK (book), 0);
- g_return_val_if_fail (cb != NULL, 0);
-
- if (name && !*name)
- name = NULL;
- if (email && !*email)
- email = NULL;
-
- if (name == NULL && email == NULL)
- return 0;
-
- /* Build our e-mail query.
- * We only query against the username part of the address, to avoid not matching
- * fred@foo.com and fred@mail.foo.com. While their may be namespace collisions
- * in the usernames of everyone out there, it shouldn't be that bad. (Famous last words.)
- */
- if (email) {
- const gchar *t = email;
- while (*t && *t != '@')
- ++t;
- if (*t == '@') {
- email_query = g_strdup_printf ("(beginswith \"email\" \"%.*s@\")", t-email, email);
-
- } else {
- email_query = g_strdup_printf ("(beginswith \"email\" \"%s\")", email);
- }
- }
-
- /* Build our name query.
- * We only do name-query stuff if we don't have an e-mail address. Our basic assumption
- * is that the username part of the email is good enough to keep the amount of stuff returned
- * in the query relatively small.
- */
- if (name && !email)
- name_query = g_strdup_printf ("(or (beginswith \"file_as\" \"%s\") (beginswith \"full_name\" \"%s\"))", name, name);
-
- /* Assemble our e-mail & name queries */
- if (email_query && name_query) {
- query = g_strdup_printf ("(and %s %s)", email_query, name_query);
- } else if (email_query) {
- query = email_query;
- email_query = NULL;
- } else if (name_query) {
- query = name_query;
- name_query = NULL;
- } else
- return 0;
-
- tag = e_book_async_get_contacts (book, query, cb, closure);
-
- g_free (email_query);
- g_free (name_query);
- g_free (query);
-
- return tag;
-}
-
-/*
- * Simple nickname query
- */
-guint
-eab_nickname_query (EBook *book,
- const char *nickname,
- EBookContactsCallback cb,
- gpointer closure)
-{
- gchar *query;
- guint retval;
-
- g_return_val_if_fail (E_IS_BOOK (book), 0);
- g_return_val_if_fail (nickname != NULL, 0);
-
- /* The empty-string case shouldn't generate a warning. */
- if (! *nickname)
- return 0;
-
- query = g_strdup_printf ("(is \"nickname\" \"%s\")", nickname);
-
- retval = e_book_async_get_contacts (book, query, cb, closure);
-
- g_free (query);
-
- return retval;
-}
-
-GList*
-eab_contact_list_from_string (const char *str)
-{
- GList *contacts = NULL;
- GString *gstr = g_string_new ("");
- char *p = (char*)str;
- char *q;
- char *blank_line;
-
- while (*p) {
- if (*p != '\r') g_string_append_c (gstr, *p);
-
- p++;
- }
-
- p = g_string_free (gstr, FALSE);
- q = p;
- do {
- char *temp;
-
- blank_line = strstr (q, "\n\n");
- if (blank_line) {
- temp = g_strndup (q, blank_line - q);
- }
- else {
- temp = g_strdup (q);
- }
-
- contacts = g_list_append (contacts, e_contact_new_from_vcard (temp));
-
- g_free (temp);
-
- if (blank_line)
- q = blank_line + 2;
- else
- q = NULL;
- } while (blank_line);
-
- g_free (p);
-
- return contacts;
-}
-
-char*
-eab_contact_list_to_string (GList *contacts)
-{
- GString *str = g_string_new ("");
- GList *l;
-
- for (l = contacts; l; l = l->next) {
- EContact *contact = l->data;
- char *vcard_str = e_vcard_to_string (E_VCARD (contact), EVC_FORMAT_VCARD_30);
-
- g_string_append (str, vcard_str);
- if (l->next)
- g_string_append (str, "\r\n");
- }
-
- return g_string_free (str, FALSE);
-}
-
-#if notyet
-/*
- * Convenience routine to check for addresses in the local address book.
- */
-
-typedef struct _HaveAddressInfo HaveAddressInfo;
-struct _HaveAddressInfo {
- gchar *email;
- EBookHaveAddressCallback cb;
- gpointer closure;
-};
-
-static void
-have_address_query_cb (EBook *book, EBookSimpleQueryStatus status, const GList *contacts, gpointer closure)
-{
- HaveAddressInfo *info = (HaveAddressInfo *) closure;
-
- info->cb (book,
- info->email,
- contacts && (status == E_BOOK_ERROR_OK) ? E_CONTACT (contacts->data) : NULL,
- info->closure);
-
- g_free (info->email);
- g_free (info);
-}
-
-static void
-have_address_book_open_cb (EBook *book, gpointer closure)
-{
- HaveAddressInfo *info = (HaveAddressInfo *) closure;
-
- if (book) {
-
- e_book_name_and_email_query (book, NULL, info->email, have_address_query_cb, info);
-
- } else {
-
- info->cb (NULL, info->email, NULL, info->closure);
-
- g_free (info->email);
- g_free (info);
-
- }
-}
-
-void
-eab_query_address_default (const gchar *email,
- EABHaveAddressCallback cb,
- gpointer closure)
-{
- HaveAddressInfo *info;
-
- g_return_if_fail (email != NULL);
- g_return_if_fail (cb != NULL);
-
- info = g_new0 (HaveAddressInfo, 1);
- info->email = g_strdup (email);
- info->cb = cb;
- info->closure = closure;
-
- e_book_use_default_book (have_address_book_open_cb, info);
-}
-#endif
-
-/* bad place for this i know. */
-int
-e_utf8_casefold_collate_len (const gchar *str1, const gchar *str2, int len)
-{
- gchar *s1 = g_utf8_casefold(str1, len);
- gchar *s2 = g_utf8_casefold(str2, len);
- int rv;
-
- rv = g_utf8_collate (s1, s2);
-
- g_free (s1);
- g_free (s2);
-
- return rv;
-}
-
-int
-e_utf8_casefold_collate (const gchar *str1, const gchar *str2)
-{
- return e_utf8_casefold_collate_len (str1, str2, -1);
-}
diff --git a/addressbook/util/eab-book-util.h b/addressbook/util/eab-book-util.h
deleted file mode 100644
index 7fda98adf3..0000000000
--- a/addressbook/util/eab-book-util.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * e-book-util.h
- *
- * Copyright (C) 2001-2003 Ximian, Inc.
- *
- * Authors: Jon Trowbridge <trow@ximian.com>
- * Chris Toshok <toshok@ximian.com>
- */
-
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA.
- */
-
-#ifndef __EAB_UTIL_H__
-#define __EAB_UTIL_H__
-
-#include <bonobo/bonobo-object.h>
-#include <bonobo/bonobo-moniker-util.h>
-#include <libebook/e-book-async.h>
-#include "e-util/e-config-listener.h"
-
-G_BEGIN_DECLS
-
-typedef void (*EABHaveAddressCallback) (EBook *book, const gchar *addr, EContact *contact, gpointer closure);
-
-/* config database interface. */
-EConfigListener *eab_get_config_database (void);
-
-/* Specialized Name/Email Queries */
-guint eab_name_and_email_query (EBook *book,
- const char *name,
- const char *email,
- EBookContactsCallback cb,
- gpointer closure);
-guint eab_nickname_query (EBook *book,
- const char *nickname,
- EBookContactsCallback cb,
- gpointer closure);
-
-GList *eab_contact_list_from_string (const char *str);
-char *eab_contact_list_to_string (GList *contacts);
-
-/* Returns the EContact associated to email in the callback,
- or NULL if no match is found in the default address book. */
-void eab_query_address_default (const gchar *email,
- EABHaveAddressCallback cb,
- gpointer closure);
-
-int e_utf8_casefold_collate_len (const gchar *str1, const gchar *str2, int len);
-int e_utf8_casefold_collate (const gchar *str1, const gchar *str2);
-
-G_END_DECLS
-
-#endif /* __EAB_UTIL_H__ */
-
diff --git a/addressbook/util/eab-destination.c b/addressbook/util/eab-destination.c
deleted file mode 100644
index 07557b1455..0000000000
--- a/addressbook/util/eab-destination.c
+++ /dev/null
@@ -1,1569 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * eab-destination.c
- *
- * Copyright (C) 2001-2003 Ximian, Inc.
- *
- * Authors: Jon Trowbridge <trow@ximian.com>
- * Chris Toshok <toshok@ximian.com>
- */
-
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA.
- */
-
-#include <config.h>
-#include "eab-destination.h"
-
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-#include <libebook/e-book.h>
-#include "eab-marshal.h"
-#include "eab-book-util.h"
-#include <gal/widgets/e-unicode.h>
-
-#include <glib.h>
-#include <libxml/xmlmemory.h>
-#include <camel/camel-internet-address.h>
-
-#define d(x)
-
-enum {
- CHANGED,
- CONTACT_LOADED,
- LAST_SIGNAL
-};
-
-guint eab_destination_signals[LAST_SIGNAL] = { 0 };
-
-struct _EABDestinationPrivate {
- gchar *raw;
-
- gchar *book_uri;
- gchar *uid;
- EContact *contact;
- gint email_num;
-
- gchar *name;
- gchar *email;
- gchar *addr;
- gchar *textrep;
-
- GList *list_dests;
-
- guint html_mail_override : 1;
- guint wants_html_mail : 1;
-
- guint show_addresses : 1;
-
- guint contact_loaded : 1;
- guint cannot_load : 1;
- guint auto_recipient : 1;
- guint pending_contact_load;
-
- guint pending_change : 1;
-
- EBook *book;
-
- gint freeze_count;
-};
-
-static void eab_destination_clear_contact (EABDestination *);
-static void eab_destination_clear_strings (EABDestination *);
-
-/* the following prototypes were in e-destination.h, but weren't used
- by anything in evolution... let's make them private for now. */
-static gboolean eab_destination_is_valid (const EABDestination *);
-static void eab_destination_set_contact_uid (EABDestination *, const gchar *uid, gint email_num);
-static void eab_destination_set_book_uri (EABDestination *, const gchar *uri);
-static gboolean eab_destination_from_contact (const EABDestination *);
-static const gchar *eab_destination_get_book_uri (const EABDestination *);
-static const gchar *eab_destination_get_contact_uid (const EABDestination *);
-static xmlNodePtr eab_destination_xml_encode (const EABDestination *dest);
-static gboolean eab_destination_xml_decode (EABDestination *dest, xmlNodePtr node);
-
-static GObjectClass *parent_class;
-
-static void
-eab_destination_dispose (GObject *obj)
-{
- EABDestination *dest = EAB_DESTINATION (obj);
-
- if (dest->priv) {
- eab_destination_clear (dest);
-
- if (dest->priv->book)
- g_object_unref (dest->priv->book);
-
- g_free (dest->priv);
- dest->priv = NULL;
- }
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- (* G_OBJECT_CLASS (parent_class)->dispose) (obj);
-}
-
-static void
-eab_destination_class_init (EABDestinationClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_ref (G_TYPE_OBJECT);
-
- object_class->dispose = eab_destination_dispose;
-
- eab_destination_signals[CHANGED] =
- g_signal_new ("changed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EABDestinationClass, changed),
- NULL, NULL,
- eab_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-
- eab_destination_signals[CONTACT_LOADED] =
- g_signal_new ("contact_loaded",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EABDestinationClass, contact_loaded),
- NULL, NULL,
- eab_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-}
-
-static void
-eab_destination_init (EABDestination *dest)
-{
- dest->priv = g_new0 (struct _EABDestinationPrivate, 1);
-
- dest->priv->cannot_load = FALSE;
- dest->priv->auto_recipient = FALSE;
- dest->priv->pending_contact_load = 0;
-}
-
-GType
-eab_destination_get_type (void)
-{
- static GType dest_type = 0;
-
- if (!dest_type) {
- GTypeInfo dest_info = {
- sizeof (EABDestinationClass),
- NULL, /* base_class_init */
- NULL, /* base_class_finalize */
- (GClassInitFunc) eab_destination_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EABDestination),
- 0, /* n_preallocs */
- (GInstanceInitFunc) eab_destination_init
- };
-
- dest_type = g_type_register_static (G_TYPE_OBJECT, "EABDestination", &dest_info, 0);
- }
-
- return dest_type;
-}
-
-EABDestination *
-eab_destination_new (void)
-{
- return g_object_new (EAB_TYPE_DESTINATION, NULL);
-}
-
-static void
-eab_destination_freeze (EABDestination *dest)
-{
- g_return_if_fail (EAB_IS_DESTINATION (dest));
- g_return_if_fail (dest->priv->freeze_count >= 0);
-
- dest->priv->freeze_count++;
-}
-
-static void
-eab_destination_thaw (EABDestination *dest)
-{
- g_return_if_fail (EAB_IS_DESTINATION (dest));
- g_return_if_fail (dest->priv->freeze_count > 0);
-
- dest->priv->freeze_count--;
- if (dest->priv->freeze_count == 0 && dest->priv->pending_change)
- eab_destination_changed (dest);
-}
-
-void
-eab_destination_changed (EABDestination *dest)
-{
- if (dest->priv->freeze_count == 0) {
- g_signal_emit (dest, eab_destination_signals[CHANGED], 0);
- dest->priv->pending_change = FALSE;
- dest->priv->cannot_load = FALSE;
-
- } else {
- dest->priv->pending_change = TRUE;
- }
-}
-
-EABDestination *
-eab_destination_copy (const EABDestination *dest)
-{
- EABDestination *new_dest;
- GList *iter;
-
- g_return_val_if_fail (dest && EAB_IS_DESTINATION (dest), NULL);
-
- new_dest = eab_destination_new ();
-
- new_dest->priv->book_uri = g_strdup (dest->priv->book_uri);
- new_dest->priv->uid = g_strdup (dest->priv->uid);
- new_dest->priv->name = g_strdup (dest->priv->name);
- new_dest->priv->email = g_strdup (dest->priv->email);
- new_dest->priv->addr = g_strdup (dest->priv->addr);
- new_dest->priv->email_num = dest->priv->email_num;
-
- new_dest->priv->contact = dest->priv->contact;
- if (new_dest->priv->contact)
- g_object_ref (new_dest->priv->contact);
-
- new_dest->priv->html_mail_override = dest->priv->html_mail_override;
- new_dest->priv->wants_html_mail = dest->priv->wants_html_mail;
-
- for (iter = dest->priv->list_dests; iter != NULL; iter = g_list_next (iter)) {
- new_dest->priv->list_dests = g_list_append (new_dest->priv->list_dests,
- eab_destination_copy (EAB_DESTINATION (iter->data)));
- }
-
- return new_dest;
-}
-
-static void
-eab_destination_clear_contact (EABDestination *dest)
-{
- g_free (dest->priv->book_uri);
- dest->priv->book_uri = NULL;
- g_free (dest->priv->uid);
- dest->priv->uid = NULL;
-
- dest->priv->contact = NULL;
- dest->priv->email_num = -1;
-
- g_list_foreach (dest->priv->list_dests, (GFunc) g_object_unref, NULL);
- g_list_free (dest->priv->list_dests);
- dest->priv->list_dests = NULL;
-
- dest->priv->cannot_load = FALSE;
-
- eab_destination_cancel_contact_load (dest);
-
- eab_destination_changed (dest);
-}
-
-static void
-eab_destination_clear_strings (EABDestination *dest)
-{
- g_free (dest->priv->raw);
- dest->priv->raw = NULL;
-
- g_free (dest->priv->name);
- dest->priv->name = NULL;
-
- g_free (dest->priv->email);
- dest->priv->email = NULL;
-
- g_free (dest->priv->addr);
- dest->priv->addr = NULL;
-
- g_free (dest->priv->textrep);
- dest->priv->textrep = NULL;
-
- eab_destination_changed (dest);
-}
-
-void
-eab_destination_clear (EABDestination *dest)
-{
- g_return_if_fail (dest && EAB_IS_DESTINATION (dest));
-
- eab_destination_freeze (dest);
-
- eab_destination_clear_contact (dest);
- eab_destination_clear_strings (dest);
-
- eab_destination_thaw (dest);
-}
-
-static gboolean
-nonempty (const gchar *s)
-{
- gunichar c;
- while (*s) {
- c = g_utf8_get_char (s);
- if (!g_unichar_isspace (c))
- return TRUE;
- s = g_utf8_next_char (s);
- }
- return FALSE;
-}
-
-gboolean
-eab_destination_is_empty (const EABDestination *dest)
-
-{
- struct _EABDestinationPrivate *p;
-
- g_return_val_if_fail (EAB_IS_DESTINATION (dest), TRUE);
-
- p = dest->priv;
-
- return !(p->contact != NULL
- || (p->book_uri && *p->book_uri)
- || (p->uid && *p->uid)
- || (p->raw && nonempty (p->raw))
- || (p->name && nonempty (p->name))
- || (p->email && nonempty (p->email))
- || (p->addr && nonempty (p->addr))
- || (p->list_dests != NULL));
-}
-
-gboolean
-eab_destination_is_valid (const EABDestination *dest)
-{
- const char *email;
-
- g_return_val_if_fail (EAB_IS_DESTINATION (dest), FALSE);
-
- if (eab_destination_from_contact (dest))
- return TRUE;
-
- email = eab_destination_get_email (dest);
-
- /* FIXME: if we really wanted to get fancy here, we could
- check to make sure that the address was valid according to
- rfc822's addr-spec grammar. */
-
- return email && *email && strchr (email, '@');
-}
-
-gboolean
-eab_destination_equal (const EABDestination *a, const EABDestination *b)
-{
- const struct _EABDestinationPrivate *pa, *pb;
- const char *na, *nb;
-
- g_return_val_if_fail (EAB_IS_DESTINATION (a), FALSE);
- g_return_val_if_fail (EAB_IS_DESTINATION (b), FALSE);
-
- if (a == b)
- return TRUE;
-
- pa = a->priv;
- pb = b->priv;
-
- /* Check equality of contacts. */
- if (pa->contact || pb->contact) {
- if (! (pa->contact && pb->contact))
- return FALSE;
-
- if (pa->contact == pb->contact || !strcmp (e_contact_get_const (pa->contact, E_CONTACT_UID),
- e_contact_get_const (pb->contact, E_CONTACT_UID)))
- return TRUE;
-
- return FALSE;
- }
-
- /* Just in case name returns NULL */
- na = eab_destination_get_name (a);
- nb = eab_destination_get_name (b);
- if ((na || nb) && !(na && nb && ! e_utf8_casefold_collate (na, nb)))
- return FALSE;
-
- if (!g_ascii_strcasecmp (eab_destination_get_email (a), eab_destination_get_email (b)))
- return TRUE;
- else
- return FALSE;
-}
-
-void
-eab_destination_set_contact (EABDestination *dest, EContact *contact, gint email_num)
-{
- g_return_if_fail (dest && EAB_IS_DESTINATION (dest));
- g_return_if_fail (contact && E_IS_CONTACT (contact));
-
- if (dest->priv->contact != contact || dest->priv->email_num != email_num) {
- /* We have to freeze/thaw around these operations so that the 'changed'
- signals don't cause the EABDestination's internal state to be altered
- before we can finish setting ->contact && ->email_num. */
- eab_destination_freeze (dest);
- eab_destination_clear (dest);
-
- dest->priv->contact = contact;
- g_object_ref (dest->priv->contact);
-
- dest->priv->email_num = email_num;
-
- eab_destination_changed (dest);
- eab_destination_thaw (dest);
- }
-}
-
-static void
-eab_destination_set_book_uri (EABDestination *dest, const gchar *uri)
-{
- g_return_if_fail (dest && EAB_IS_DESTINATION (dest));
- g_return_if_fail (uri != NULL);
-
- if (dest->priv->book_uri == NULL || strcmp (dest->priv->book_uri, uri)) {
- g_free (dest->priv->book_uri);
- dest->priv->book_uri = g_strdup (uri);
-
- eab_destination_changed (dest);
- }
-}
-
-void
-eab_destination_set_contact_uid (EABDestination *dest, const gchar *uid, gint email_num)
-{
- g_return_if_fail (dest && EAB_IS_DESTINATION (dest));
- g_return_if_fail (uid != NULL);
-
- if (dest->priv->uid == NULL
- || strcmp (dest->priv->uid, uid)
- || dest->priv->email_num != email_num) {
-
- g_free (dest->priv->uid);
- dest->priv->uid = g_strdup (uid);
- dest->priv->email_num = email_num;
-
- /* If we already have a contact, remove it unless it's uid matches the one
- we just set. */
- if (dest->priv->contact && strcmp (uid,
- e_contact_get_const (dest->priv->contact, E_CONTACT_UID))) {
- g_object_unref (dest->priv->contact);
- dest->priv->contact = NULL;
- }
-
- eab_destination_changed (dest);
- }
-}
-
-void
-eab_destination_set_name (EABDestination *dest, const gchar *name)
-{
- gboolean changed = FALSE;
-
- g_return_if_fail (EAB_IS_DESTINATION (dest));
-
- if (name == NULL) {
- if (dest->priv->name != NULL) {
- g_free (dest->priv->name);
- dest->priv->name = NULL;
- changed = TRUE;
- }
- } else if (dest->priv->name == NULL || strcmp (dest->priv->name, name)) {
- g_free (dest->priv->name);
- dest->priv->name = g_strdup (name);
- changed = TRUE;
- }
-
- if (changed) {
- g_free (dest->priv->addr);
- dest->priv->addr = NULL;
- g_free (dest->priv->textrep);
- dest->priv->textrep = NULL;
- eab_destination_changed (dest);
- }
-}
-
-void
-eab_destination_set_email (EABDestination *dest, const gchar *email)
-{
- gboolean changed = FALSE;
-
- g_return_if_fail (EAB_IS_DESTINATION (dest));
-
- if (email == NULL) {
- if (dest->priv->email != NULL) {
- g_free (dest->priv->addr);
- dest->priv->addr = NULL;
- changed = TRUE;
- }
- } else if (dest->priv->email == NULL || strcmp (dest->priv->email, email)) {
- g_free (dest->priv->email);
- dest->priv->email = g_strdup (email);
- changed = TRUE;
- }
-
- if (changed) {
- g_free (dest->priv->addr);
- dest->priv->addr = NULL;
- g_free (dest->priv->textrep);
- dest->priv->textrep = NULL;
- eab_destination_changed (dest);
- }
-}
-
-void
-eab_destination_set_html_mail_pref (EABDestination *dest, gboolean x)
-{
- g_return_if_fail (dest && EAB_IS_DESTINATION (dest));
-
- dest->priv->html_mail_override = TRUE;
- if (dest->priv->wants_html_mail != x) {
- dest->priv->wants_html_mail = x;
- eab_destination_changed (dest);
- }
-}
-
-gboolean
-eab_destination_contains_contact (const EABDestination *dest)
-{
- g_return_val_if_fail (dest && EAB_IS_DESTINATION (dest), FALSE);
- return dest->priv->contact != NULL;
-}
-
-gboolean
-eab_destination_from_contact (const EABDestination *dest)
-{
- g_return_val_if_fail (dest && EAB_IS_DESTINATION (dest), FALSE);
- return dest->priv->contact != NULL || dest->priv->book_uri != NULL || dest->priv->uid != NULL;
-}
-
-gboolean
-eab_destination_is_auto_recipient (const EABDestination *dest)
-{
- g_return_val_if_fail (dest && EAB_IS_DESTINATION (dest), FALSE);
-
- return dest->priv->auto_recipient;
-}
-
-void
-eab_destination_set_auto_recipient (EABDestination *dest, gboolean value)
-{
- g_return_if_fail (dest && EAB_IS_DESTINATION (dest));
-
- dest->priv->auto_recipient = value;
-}
-
-typedef struct _UseContact UseContact;
-struct _UseContact {
- EABDestination *dest;
- EABDestinationContactCallback cb;
- gpointer closure;
-};
-
-static void
-use_contact_cb (EContact *contact, gpointer closure)
-{
- UseContact *uc = (UseContact *) closure;
-
- if (contact != NULL && uc->dest->priv->contact == NULL) {
- uc->dest->priv->contact = contact;
- g_object_ref (uc->dest->priv->contact);
- eab_destination_changed (uc->dest);
- }
-
- if (uc->cb) {
- uc->cb (uc->dest, uc->dest->priv->contact, uc->closure);
- }
-
- /* We held a copy of the destination during the callback. */
- g_object_unref (uc->dest);
- g_free (uc);
-}
-
-void
-eab_destination_use_contact (EABDestination *dest, EABDestinationContactCallback cb, gpointer closure)
-{
- g_return_if_fail (dest && EAB_IS_DESTINATION (dest));
-
- if (dest->priv->contact != NULL) {
- if (cb)
- cb (dest, dest->priv->contact, closure);
- } else if (dest->priv->book_uri != NULL && dest->priv->uid != NULL) {
- UseContact *uc = g_new (UseContact, 1);
-
- uc->dest = dest;
- /* Hold a reference to the destination during the callback. */
- g_object_ref (uc->dest);
- uc->cb = cb;
- uc->closure = closure;
-#if notyet
- e_contact_load_uri (dest->priv->book_uri, dest->priv->uid, use_contact_cb, uc);
-#endif
- } else {
- if (cb)
- cb (dest, NULL, closure);
- }
-}
-
-EContact *
-eab_destination_get_contact (const EABDestination *dest)
-{
- g_return_val_if_fail (dest && EAB_IS_DESTINATION (dest), NULL);
-
- return dest->priv->contact;
-}
-
-const gchar *
-eab_destination_get_contact_uid (const EABDestination *dest)
-{
- g_return_val_if_fail (dest && EAB_IS_DESTINATION (dest), NULL);
-
- if (dest->priv->uid)
- return dest->priv->uid;
-
- if (dest->priv->contact)
- return e_contact_get_const (dest->priv->contact, E_CONTACT_UID);
-
- return NULL;
-}
-
-const gchar *
-eab_destination_get_book_uri (const EABDestination *dest)
-{
- g_return_val_if_fail (dest && EAB_IS_DESTINATION (dest), NULL);
-
- return dest->priv->book_uri;
-}
-
-gint
-eab_destination_get_email_num (const EABDestination *dest)
-{
- g_return_val_if_fail (dest && EAB_IS_DESTINATION (dest), -1);
-
- if (dest->priv->contact == NULL && (dest->priv->book_uri == NULL || dest->priv->uid == NULL))
- return -1;
-
- return dest->priv->email_num;
-}
-
-const gchar *
-eab_destination_get_name (const EABDestination *dest)
-{
- struct _EABDestinationPrivate *priv;
-
- g_return_val_if_fail (dest && EAB_IS_DESTINATION (dest), NULL);
-
- priv = (struct _EABDestinationPrivate *)dest->priv; /* cast out const */
-
- if (priv->name == NULL) {
- if (priv->contact != NULL) {
- priv->name = e_contact_get (priv->contact, E_CONTACT_FULL_NAME);
-
- if (priv->name == NULL || *priv->name == '\0') {
- g_free (priv->name);
- priv->name = e_contact_get (priv->contact, E_CONTACT_FILE_AS);
- }
-
- if (priv->name == NULL || *priv->name == '\0') {
- g_free (priv->name);
- if (e_contact_get (priv->contact, E_CONTACT_IS_LIST))
- priv->name = g_strdup (_("Unnamed List"));
- else
- priv->name = g_strdup (eab_destination_get_email (dest));
- }
- } else if (priv->raw != NULL) {
- CamelInternetAddress *addr = camel_internet_address_new ();
-
- if (camel_address_unformat (CAMEL_ADDRESS (addr), priv->raw)) {
- const char *camel_name = NULL;
-
- camel_internet_address_get (addr, 0, &camel_name, NULL);
- priv->name = g_strdup (camel_name);
- }
-
- camel_object_unref (CAMEL_OBJECT (addr));
- }
- }
-
- return priv->name;
-}
-
-const gchar *
-eab_destination_get_email (const EABDestination *dest)
-{
- struct _EABDestinationPrivate *priv;
-
- g_return_val_if_fail (dest && EAB_IS_DESTINATION (dest), NULL);
-
- priv = (struct _EABDestinationPrivate *)dest->priv; /* cast out const */
-
- if (priv->email == NULL) {
- if (priv->contact != NULL) {
- /* Pull the address out of the card. */
- GList *email = e_contact_get (priv->contact, E_CONTACT_EMAIL);
- if (email) {
- char *e = g_list_nth_data (email, priv->email_num);
-
- if (e)
- priv->email = g_strdup (e);
- }
- if (email) {
- g_list_foreach (email, (GFunc)g_free, NULL);
- g_list_free (email);
- }
-
- } else if (priv->raw != NULL) {
- CamelInternetAddress *addr = camel_internet_address_new ();
-
- if (camel_address_unformat (CAMEL_ADDRESS (addr), priv->raw)) {
- const gchar *camel_email = NULL;
- camel_internet_address_get (addr, 0, NULL, &camel_email);
- priv->email = g_strdup (camel_email);
- }
-
- camel_object_unref (CAMEL_OBJECT (addr));
- }
-
- /* Force e-mail to be non-null... */
- if (priv->email == NULL) {
- priv->email = g_strdup ("");
- }
- }
-
- return priv->email;
-}
-
-const gchar *
-eab_destination_get_address (const EABDestination *dest)
-{
- struct _EABDestinationPrivate *priv;
-
- g_return_val_if_fail (dest && EAB_IS_DESTINATION (dest), NULL);
-
- priv = (struct _EABDestinationPrivate *)dest->priv; /* cast out const */
-
- if (priv->addr == NULL) {
- CamelInternetAddress *addr = camel_internet_address_new ();
-
- if (eab_destination_is_evolution_list (dest)) {
- GList *iter = dest->priv->list_dests;
-
- while (iter) {
- EABDestination *list_dest = EAB_DESTINATION (iter->data);
-
- if (!eab_destination_is_empty (list_dest)) {
- camel_internet_address_add (addr,
- eab_destination_get_name (list_dest),
- eab_destination_get_email (list_dest));
- }
- iter = g_list_next (iter);
- }
-
- priv->addr = camel_address_encode (CAMEL_ADDRESS (addr));
- } else if (priv->raw) {
-
- if (camel_address_unformat (CAMEL_ADDRESS (addr), priv->raw)) {
- priv->addr = camel_address_encode (CAMEL_ADDRESS (addr));
- }
- } else {
- camel_internet_address_add (addr,
- eab_destination_get_name (dest),
- eab_destination_get_email (dest));
-
- priv->addr = camel_address_encode (CAMEL_ADDRESS (addr));
- }
-
- camel_object_unref (CAMEL_OBJECT (addr));
- }
-
- return priv->addr;
-}
-
-void
-eab_destination_set_raw (EABDestination *dest, const gchar *raw)
-{
- g_return_if_fail (EAB_IS_DESTINATION (dest));
- g_return_if_fail (raw != NULL);
-
- if (dest->priv->raw == NULL || strcmp (dest->priv->raw, raw)) {
- eab_destination_freeze (dest);
-
- eab_destination_clear (dest);
- dest->priv->raw = g_strdup (raw);
- eab_destination_changed (dest);
-
- eab_destination_thaw (dest);
- }
-}
-
-const gchar *
-eab_destination_get_textrep (const EABDestination *dest, gboolean include_email)
-{
- const char *name, *email;
-
- g_return_val_if_fail (dest && EAB_IS_DESTINATION (dest), NULL);
-
- if (dest->priv->raw)
- return dest->priv->raw;
-
- name = eab_destination_get_name (dest);
- email = eab_destination_get_email (dest);
-
- if (eab_destination_from_contact (dest) && name != NULL && (!include_email || !email || !*email))
- return name;
-
- /* Make sure that our address gets quoted properly */
- if (name && email && dest->priv->textrep == NULL) {
- CamelInternetAddress *addr = camel_internet_address_new ();
-
- camel_internet_address_add (addr, name, email);
- g_free (dest->priv->textrep);
- dest->priv->textrep = camel_address_format (CAMEL_ADDRESS (addr));
- camel_object_unref (CAMEL_OBJECT (addr));
- }
-
- if (dest->priv->textrep != NULL)
- return dest->priv->textrep;
-
- if (email)
- return email;
-
- return "";
-}
-
-gboolean
-eab_destination_is_evolution_list (const EABDestination *dest)
-{
- g_return_val_if_fail (dest && EAB_IS_DESTINATION (dest), FALSE);
-
- if (dest->priv->list_dests == NULL
- && dest->priv->contact != NULL
- && e_contact_get (dest->priv->contact, E_CONTACT_IS_LIST)) {
- GList *email = e_contact_get (dest->priv->contact, E_CONTACT_EMAIL);
- if (email) {
- GList *iter;
- for (iter = email; iter; iter = iter->next) {
- EABDestination *list_dest = eab_destination_import ((char *) iter->data);
-
- if (list_dest)
- dest->priv->list_dests = g_list_append (dest->priv->list_dests, list_dest);
- }
- }
- }
-
- return dest->priv->list_dests != NULL;
-}
-
-gboolean
-eab_destination_list_show_addresses (const EABDestination *dest)
-{
- g_return_val_if_fail (EAB_IS_DESTINATION (dest), FALSE);
-
- if (dest->priv->contact != NULL)
- return GPOINTER_TO_UINT (e_contact_get (dest->priv->contact, E_CONTACT_LIST_SHOW_ADDRESSES));
-
- return dest->priv->show_addresses;
-}
-
-gboolean
-eab_destination_get_html_mail_pref (const EABDestination *dest)
-{
- g_return_val_if_fail (dest && EAB_IS_DESTINATION (dest), FALSE);
-
- if (dest->priv->html_mail_override || dest->priv->contact == NULL)
- return dest->priv->wants_html_mail;
-
- return e_contact_get (dest->priv->contact, E_CONTACT_WANTS_HTML) ? TRUE : FALSE;
-}
-
-static void
-set_book (EABDestination *dest, EBook *book)
-{
- if (dest->priv->book && dest->priv->book != book) {
- g_object_unref (dest->priv->book);
- }
-
- dest->priv->book = book;
-
- if (book)
- g_object_ref (book);
-}
-
-static void
-name_and_email_cb (EBook *book, EBookStatus status, GList *contacts, gpointer closure)
-{
- EABDestination *dest = EAB_DESTINATION (closure);
-
- if (status == E_BOOK_ERROR_OK && g_list_length ((GList *) contacts) == 1) {
- EContact *contact = E_CONTACT (contacts->data);
- const char *email = eab_destination_get_email (dest);
- int email_num = 0;
-
-#if notyet
- if (eab_destination_is_valid (dest) && email && *email) {
- email_num = e_contact_email_find_number (contact, eab_destination_get_email (dest));
- }
-#endif
-
- if (email_num >= 0) {
- const char *book_uri;
-
- book_uri = e_book_get_uri (book);
-
- dest->priv->contact_loaded = TRUE;
- eab_destination_set_contact (dest, contact, email_num);
- eab_destination_set_book_uri (dest, book_uri);
- g_signal_emit (dest, eab_destination_signals[CONTACT_LOADED], 0);
- }
- }
-
- if (!dest->priv->contact_loaded)
- dest->priv->cannot_load = TRUE;
-
- g_object_unref (dest); /* drop the reference held by the query */
-}
-
-
-static void
-nickname_cb (EBook *book, EBookStatus status, GList *contacts, gpointer closure)
-{
- EABDestination *dest = EAB_DESTINATION (closure);
-
- if (status == E_BOOK_ERROR_OK) {
- if (g_list_length ((GList *) contacts) == 1) {
- const char *book_uri;
-
- book_uri = e_book_get_uri (book);
-
- dest->priv->contact_loaded = TRUE;
- eab_destination_set_contact (dest, E_CONTACT (contacts->data), 0); /* Uses primary e-mail by default. */
- eab_destination_set_book_uri (dest, book_uri);
- g_signal_emit (dest, eab_destination_signals[CONTACT_LOADED], 0);
-
- g_object_unref (dest); /* drop the reference held by the query */
-
- } else {
- /* We can only end up here if we don't look at all like an e-mail address, so
- we do a name-only query on the textrep */
-
- eab_name_and_email_query (book,
- eab_destination_get_textrep (dest, FALSE),
- NULL,
- name_and_email_cb,
- dest);
- }
- } else {
- /* Something went wrong with the query: drop our ref to the destination and return. */
- g_object_unref (dest);
- }
-}
-
-static void
-launch_load_contact_query (EABDestination *dest)
-{
- if (! eab_destination_is_valid (dest)) {
- /* If it doesn't look like an e-mail address, see if it is a nickname. */
- eab_nickname_query (dest->priv->book,
- eab_destination_get_textrep (dest, FALSE),
- nickname_cb,
- dest);
-
- } else {
- eab_name_and_email_query (dest->priv->book,
- eab_destination_get_name (dest),
- eab_destination_get_email (dest),
- name_and_email_cb,
- dest);
- }
-}
-
-void
-eab_destination_load_contact (EABDestination *dest, EBook *book)
-{
- g_return_if_fail (EAB_IS_DESTINATION (dest));
- g_return_if_fail (book == NULL || E_IS_BOOK (book));
-
- if (eab_destination_is_evolution_list (dest))
- return;
-
- if (eab_destination_contains_contact (dest))
- return;
-
- if (dest->priv->cannot_load)
- return;
-
- eab_destination_cancel_contact_load (dest);
-
- set_book (dest, book);
-
- /* Handle the case of an EABDestination containing a contact URL */
- if (eab_destination_contains_contact (dest)) {
- eab_destination_use_contact (dest, NULL, NULL);
- return;
- }
-
- /* We hold a reference to ourselves until our query is complete. */
- g_object_ref (dest);
- launch_load_contact_query (dest);
-}
-
-static int
-do_load_delayed (gpointer ptr)
-{
- EABDestination *dest = EAB_DESTINATION (ptr);
-
- eab_destination_load_contact (dest, dest->priv->book);
- return FALSE;
-}
-
-void
-eab_destination_load_contact_delayed (EABDestination *dest, EBook *book, gint delay)
-{
- g_return_if_fail (EAB_IS_DESTINATION (dest));
- g_return_if_fail (book == NULL || E_IS_BOOK (book));
-
- if (delay < 0)
- delay = 500;
-
- eab_destination_cancel_contact_load (dest);
-
- set_book (dest, book);
-
- dest->priv->pending_contact_load = g_timeout_add (delay, do_load_delayed, dest);
-}
-
-void
-eab_destination_cancel_contact_load (EABDestination *dest)
-{
- g_return_if_fail (EAB_IS_DESTINATION (dest));
-
- if (dest->priv->pending_contact_load) {
- g_source_remove (dest->priv->pending_contact_load);
- dest->priv->pending_contact_load = 0;
- }
-}
-
-gboolean
-eab_destination_unload_contact (EABDestination *dest)
-{
- char *email;
-
- g_return_val_if_fail (EAB_IS_DESTINATION (dest), FALSE);
-
- if (!eab_destination_contains_contact (dest))
- return FALSE;
-
- email = g_strdup (eab_destination_get_email (dest));
-
- if (email == NULL)
- return FALSE;
-
- eab_destination_freeze (dest);
- eab_destination_clear (dest);
- eab_destination_set_raw (dest, email);
- g_free (email);
- eab_destination_thaw (dest);
-
- return TRUE;
-}
-
-/*
- * Destination import/export
- */
-
-gchar *
-eab_destination_get_address_textv (EABDestination **destv)
-{
- int i, j, len = 0;
- char **strv;
- char *str;
-
- g_return_val_if_fail (destv, NULL);
-
- /* Q: Please tell me this is only for assertion
- reasons. If this is considered to be ok behavior then you
- shouldn't use g_return's. Just a reminder ;-)
-
- A: Yes, this is just an assertion. (Though it does find the
- length of the vector in the process...)
- */
- while (destv[len]) {
- g_return_val_if_fail (EAB_IS_DESTINATION (destv[len]), NULL);
- len++;
- }
-
- strv = g_new0 (char *, len + 1);
- for (i = 0, j = 0; destv[i]; i++) {
- if (!eab_destination_is_empty (destv[i])) {
- const char *addr = eab_destination_get_address (destv[i]);
- strv[j++] = addr ? (char *) addr : "";
- }
- }
-
- str = g_strjoinv (", ", strv);
-
- g_free (strv);
-
- return str;
-}
-
-xmlNodePtr
-eab_destination_xml_encode (const EABDestination *dest)
-{
- xmlNodePtr dest_node;
- const char *str;
-
- g_return_val_if_fail (dest && EAB_IS_DESTINATION (dest), NULL);
-
- dest_node = xmlNewNode (NULL, "destination");
-
- str = eab_destination_get_name (dest);
- if (str)
- xmlNewTextChild (dest_node, NULL, "name", str);
-
- if (!eab_destination_is_evolution_list (dest)) {
- str = eab_destination_get_email (dest);
- if (str)
- xmlNewTextChild (dest_node, NULL, "email", str);
- } else {
- GList *iter = dest->priv->list_dests;
-
- while (iter) {
- EABDestination *list_dest = EAB_DESTINATION (iter->data);
- xmlNodePtr list_node = xmlNewNode (NULL, "list_entry");
-
- str = eab_destination_get_name (list_dest);
- if (str)
- xmlNewTextChild (list_node, NULL, "name", str);
-
- str = eab_destination_get_email (list_dest);
- if (str)
- xmlNewTextChild (list_node, NULL, "email", str);
-
- xmlAddChild (dest_node, list_node);
-
- iter = g_list_next (iter);
- }
-
- xmlNewProp (dest_node, "is_list", "yes");
- xmlNewProp (dest_node, "show_addresses",
- eab_destination_list_show_addresses (dest) ? "yes" : "no");
- }
-
- str = eab_destination_get_book_uri (dest);
- if (str) {
- xmlNewTextChild (dest_node, NULL, "book_uri", str);
- }
-
- str = eab_destination_get_contact_uid (dest);
- if (str) {
- char buf[16];
-
- xmlNodePtr uri_node = xmlNewTextChild (dest_node, NULL, "card_uid", str);
- g_snprintf (buf, 16, "%d", eab_destination_get_email_num (dest));
- xmlNewProp (uri_node, "email_num", buf);
- }
-
- xmlNewProp (dest_node, "html_mail", eab_destination_get_html_mail_pref (dest) ? "yes" : "no");
-
- xmlNewProp (dest_node, "auto_recipient",
- eab_destination_is_auto_recipient (dest) ? "yes" : "no");
-
- return dest_node;
-}
-
-gboolean
-eab_destination_xml_decode (EABDestination *dest, xmlNodePtr node)
-{
- char *name = NULL, *email = NULL, *book_uri = NULL, *card_uid = NULL;
- gboolean is_list = FALSE, show_addr = FALSE, auto_recip = FALSE;
- gboolean html_mail = FALSE;
- GList *list_dests = NULL;
- int email_num = -1;
- char *tmp;
-
- g_return_val_if_fail (dest && EAB_IS_DESTINATION (dest), FALSE);
- g_return_val_if_fail (node != NULL, FALSE);
-
- if (strcmp (node->name, "destination"))
- return FALSE;
-
- tmp = xmlGetProp (node, "html_mail");
- if (tmp) {
- html_mail = !strcmp (tmp, "yes");
- xmlFree (tmp);
- }
-
- tmp = xmlGetProp (node, "is_list");
- if (tmp) {
- is_list = !strcmp (tmp, "yes");
- xmlFree (tmp);
- }
-
- tmp = xmlGetProp (node, "show_addresses");
- if (tmp) {
- show_addr = !strcmp (tmp, "yes");
- xmlFree (tmp);
- }
-
- tmp = xmlGetProp (node, "auto_recipient");
- if (tmp) {
- auto_recip = !strcmp (tmp, "yes");
- xmlFree (tmp);
- }
-
- node = node->xmlChildrenNode;
- while (node) {
- if (!strcmp (node->name, "name")) {
- tmp = xmlNodeGetContent (node);
- g_free (name);
- name = g_strdup (tmp);
- xmlFree (tmp);
- } else if (!is_list && !strcmp (node->name, "email")) {
- tmp = xmlNodeGetContent (node);
- g_free (email);
- email = g_strdup (tmp);
- xmlFree (tmp);
- } else if (is_list && !strcmp (node->name, "list_entry")) {
- xmlNodePtr subnode = node->xmlChildrenNode;
- char *list_name = NULL, *list_email = NULL;
-
- while (subnode) {
- if (!strcmp (subnode->name, "name")) {
- tmp = xmlNodeGetContent (subnode);
- g_free (list_name);
- list_name = g_strdup (tmp);
- xmlFree (tmp);
- } else if (!strcmp (subnode->name, "email")) {
- tmp = xmlNodeGetContent (subnode);
- g_free (list_email);
- list_email = g_strdup (tmp);
- xmlFree (tmp);
- }
-
- subnode = subnode->next;
- }
-
- if (list_name || list_email) {
- EABDestination *list_dest = eab_destination_new ();
-
- if (list_name)
- eab_destination_set_name (list_dest, list_name);
- if (list_email)
- eab_destination_set_email (list_dest, list_email);
-
- g_free (list_name);
- g_free (list_email);
-
- list_dests = g_list_append (list_dests, list_dest);
- }
- } else if (!strcmp (node->name, "book_uri")) {
- tmp = xmlNodeGetContent (node);
- g_free (book_uri);
- book_uri = g_strdup (tmp);
- xmlFree (tmp);
- } else if (!strcmp (node->name, "card_uid")) {
- tmp = xmlNodeGetContent (node);
- g_free (card_uid);
- card_uid = g_strdup (tmp);
- xmlFree (tmp);
-
- tmp = xmlGetProp (node, "email_num");
- email_num = atoi (tmp);
- xmlFree (tmp);
- }
-
- node = node->next;
- }
-
- eab_destination_freeze (dest);
-
- eab_destination_clear (dest);
-
- if (name) {
- eab_destination_set_name (dest, name);
- g_free (name);
- }
- if (email) {
- eab_destination_set_email (dest, email);
- g_free (email);
- }
- if (book_uri) {
- eab_destination_set_book_uri (dest, book_uri);
- g_free (book_uri);
- }
- if (card_uid) {
- eab_destination_set_contact_uid (dest, card_uid, email_num);
- g_free (card_uid);
- }
- if (list_dests)
- dest->priv->list_dests = list_dests;
-
- dest->priv->html_mail_override = TRUE;
- dest->priv->wants_html_mail = html_mail;
-
- dest->priv->show_addresses = show_addr;
-
- dest->priv->auto_recipient = auto_recip;
-
- eab_destination_thaw (dest);
-
- return TRUE;
-}
-
-/* FIXME: Make utf-8 safe */
-static gchar *
-null_terminate_and_remove_extra_whitespace (xmlChar *xml_in, gint size)
-{
- gboolean skip_white = FALSE;
- char *xml, *r, *w;
-
- if (xml_in == NULL || size <= 0)
- return NULL;
-
- xml = g_strndup (xml_in, size);
- r = w = xml;
-
- while (*r) {
- if (*r == '\n' || *r == '\r') {
- skip_white = TRUE;
- } else {
- gboolean is_space = isspace (*r);
-
- *w = *r;
-
- if (!(skip_white && is_space))
- w++;
- if (!is_space)
- skip_white = FALSE;
- }
- r++;
- }
-
- *w = '\0';
-
- return xml;
-}
-
-gchar *
-eab_destination_export (const EABDestination *dest)
-{
- xmlNodePtr dest_node;
- xmlDocPtr dest_doc;
- xmlChar *buffer = NULL;
- int size = -1;
- char *str;
-
- g_return_val_if_fail (dest && EAB_IS_DESTINATION (dest), NULL);
-
- dest_node = eab_destination_xml_encode (dest);
- if (dest_node == NULL)
- return NULL;
-
- dest_doc = xmlNewDoc (XML_DEFAULT_VERSION);
- xmlDocSetRootElement (dest_doc, dest_node);
-
- xmlDocDumpMemory (dest_doc, &buffer, &size);
- xmlFreeDoc (dest_doc);
-
- str = null_terminate_and_remove_extra_whitespace (buffer, size);
- xmlFree (buffer);
-
- return str;
-}
-
-EABDestination *
-eab_destination_import (const gchar *str)
-{
- EABDestination *dest = NULL;
- xmlDocPtr dest_doc;
-
- if (!(str && *str))
- return NULL;
-
- dest_doc = xmlParseMemory ((char *) str, strlen (str));
- if (dest_doc && dest_doc->xmlRootNode) {
- dest = eab_destination_new ();
- if (! eab_destination_xml_decode (dest, dest_doc->xmlRootNode)) {
- g_object_unref (dest);
- dest = NULL;
- }
- }
- xmlFreeDoc (dest_doc);
-
- return dest;
-}
-
-gchar *
-eab_destination_exportv (EABDestination **destv)
-{
- xmlDocPtr destv_doc;
- xmlNodePtr destv_node;
- xmlChar *buffer = NULL;
- int i, size = -1;
- char *str;
-
- if (destv == NULL || *destv == NULL)
- return NULL;
-
- destv_doc = xmlNewDoc (XML_DEFAULT_VERSION);
- destv_node = xmlNewNode (NULL, "destinations");
- xmlDocSetRootElement (destv_doc, destv_node);
-
- for (i = 0; destv[i]; i++) {
- if (! eab_destination_is_empty (destv[i])) {
- xmlNodePtr dest_node = eab_destination_xml_encode (destv[i]);
- if (dest_node)
- xmlAddChild (destv_node, dest_node);
- }
- }
-
- xmlDocDumpMemory (destv_doc, &buffer, &size);
- xmlFreeDoc (destv_doc);
-
- str = null_terminate_and_remove_extra_whitespace (buffer, size);
- xmlFree (buffer);
-
- return str;
-}
-
-EABDestination **
-eab_destination_importv (const gchar *str)
-{
- GPtrArray *dest_array = NULL;
- xmlDocPtr destv_doc;
- xmlNodePtr node;
- EABDestination **destv = NULL;
-
- if (!(str && *str))
- return NULL;
-
- destv_doc = xmlParseMemory ((char *)str, strlen (str));
- if (destv_doc == NULL)
- return NULL;
-
- node = destv_doc->xmlRootNode;
-
- if (strcmp (node->name, "destinations"))
- goto finished;
-
- node = node->xmlChildrenNode;
-
- dest_array = g_ptr_array_new ();
-
- while (node) {
- EABDestination *dest;
-
- dest = eab_destination_new ();
- if (eab_destination_xml_decode (dest, node) && !eab_destination_is_empty (dest)) {
- g_ptr_array_add (dest_array, dest);
- } else {
- g_object_unref (dest);
- }
-
- node = node->next;
- }
-
- /* we need destv to be NULL terminated */
- g_ptr_array_add (dest_array, NULL);
-
- destv = (EABDestination **) dest_array->pdata;
- g_ptr_array_free (dest_array, FALSE);
-
- finished:
- xmlFreeDoc (destv_doc);
-
- return destv;
-}
-
-EABDestination **
-eab_destination_list_to_vector_sized (GList *list, int n)
-{
- EABDestination **destv;
- int i = 0;
-
- if (n == -1)
- n = g_list_length (list);
-
- if (n == 0)
- return NULL;
-
- destv = g_new (EABDestination *, n + 1);
- while (list != NULL && i < n) {
- destv[i] = EAB_DESTINATION (list->data);
- list->data = NULL;
- i++;
- list = g_list_next (list);
- }
- destv[i] = NULL;
-
- return destv;
-}
-
-EABDestination **
-eab_destination_list_to_vector (GList *list)
-{
- return eab_destination_list_to_vector_sized (list, -1);
-}
-
-void
-eab_destination_freev (EABDestination **destv)
-{
- int i;
-
- if (destv) {
- for (i = 0; destv[i] != NULL; ++i) {
- g_object_unref (destv[i]);
- }
- g_free (destv);
- }
-
-}
-
-#if notyet
-static void
-touch_cb (EBook *book, const gchar *addr, ECard *card, gpointer closure)
-{
- if (book != NULL && card != NULL) {
- e_card_touch (card);
- d(g_message ("Use score for \"%s\" is now %f", addr, e_card_get_use_score (card)));
- e_book_commit_card (book, card, NULL, NULL);
- }
-}
-#endif
-
-void
-eab_destination_touch (EABDestination *dest)
-{
-#if notyet
- const char *email;
-
- g_return_if_fail (dest && EAB_IS_DESTINATION (dest));
-
- if (!eab_destination_is_auto_recipient (dest)) {
- email = eab_destination_get_email (dest);
-
- if (email)
- e_book_query_address_default (email, touch_cb, NULL);
- }
-#endif
-}
-
-void
-eab_destination_touchv (EABDestination **destv)
-{
-#if notyet
- int i;
-
- g_return_if_fail (destv != NULL);
-
- for (i = 0; destv[i] != NULL; ++i) {
- eab_destination_touch (destv[i]);
- }
-#endif
-}
diff --git a/addressbook/util/eab-destination.h b/addressbook/util/eab-destination.h
deleted file mode 100644
index 2c8e2abc11..0000000000
--- a/addressbook/util/eab-destination.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * eab-destination.h
- *
- * Copyright (C) 2001-2003 Ximian, Inc.
- *
- * Authors: Jon Trowbridge <trow@ximian.com>
- * Chris Toshok <toshok@ximian.com>
- */
-
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA.
- */
-
-#ifndef __E_DESTINATION_H__
-#define __E_DESTINATION_H__
-
-#include <glib.h>
-#include <glib-object.h>
-#include <libebook/e-contact.h>
-#include <libebook/e-book.h>
-#include <libxml/tree.h>
-
-#define EAB_TYPE_DESTINATION (eab_destination_get_type ())
-#define EAB_DESTINATION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EAB_TYPE_DESTINATION, EABDestination))
-#define EAB_DESTINATION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), EAB_TYPE_DESTINATION, EABDestinationClass))
-#define EAB_IS_DESTINATION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), EAB_TYPE_DESTINATION))
-#define EAB_IS_DESTINATION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EAB_TYPE_DESTINATION))
-#define EAB_DESTINATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EAB_TYPE_DESTINATION, EABDestinationClass))
-
-typedef struct _EABDestination EABDestination;
-typedef struct _EABDestinationClass EABDestinationClass;
-
-typedef void (*EABDestinationContactCallback) (EABDestination *dest, EContact *contact, gpointer closure);
-
-struct _EABDestinationPrivate;
-
-struct _EABDestination {
- GObject object;
-
- struct _EABDestinationPrivate *priv;
-};
-
-struct _EABDestinationClass {
- GObjectClass parent_class;
-
- void (*changed) (EABDestination *dest);
- void (*contact_loaded) (EABDestination *dest);
-};
-
-GType eab_destination_get_type (void);
-
-
-EABDestination *eab_destination_new (void);
-void eab_destination_changed (EABDestination *);
-EABDestination *eab_destination_copy (const EABDestination *);
-void eab_destination_clear (EABDestination *);
-
-gboolean eab_destination_is_empty (const EABDestination *);
-gboolean eab_destination_equal (const EABDestination *a, const EABDestination *b);
-
-void eab_destination_set_contact (EABDestination *, EContact *contact, gint email_num);
-
-void eab_destination_set_name (EABDestination *, const gchar *name);
-void eab_destination_set_email (EABDestination *, const gchar *email);
-
-void eab_destination_set_html_mail_pref (EABDestination *, gboolean);
-
-gboolean eab_destination_contains_contact (const EABDestination *);
-
-gboolean eab_destination_is_auto_recipient (const EABDestination *);
-void eab_destination_set_auto_recipient (EABDestination *, gboolean value);
-
-void eab_destination_use_contact (EABDestination *, EABDestinationContactCallback cb, gpointer closure);
-
-EContact *eab_destination_get_contact (const EABDestination *);
-gint eab_destination_get_email_num (const EABDestination *);
-
-const gchar *eab_destination_get_name (const EABDestination *); /* "Jane Smith" */
-const gchar *eab_destination_get_email (const EABDestination *); /* "jane@assbarn.com" */
-const gchar *eab_destination_get_address (const EABDestination *);; /* "Jane Smith <jane@assbarn.com>" (or a comma-sep set of such for a list) */
-
-void eab_destination_set_raw (EABDestination *, const gchar *free_form_string);
-const gchar *eab_destination_get_textrep (const EABDestination *, gboolean include_email); /* "Jane Smith" or "jane@assbarn.com" */
-
-gboolean eab_destination_is_evolution_list (const EABDestination *);
-gboolean eab_destination_list_show_addresses (const EABDestination *);
-
-/* If true, they want HTML mail. */
-gboolean eab_destination_get_html_mail_pref (const EABDestination *);
-
-void eab_destination_load_contact (EABDestination *, EBook *);
-void eab_destination_load_contact_delayed (EABDestination *, EBook *, gint delay); /* delay < 0: "default" */
-void eab_destination_cancel_contact_load (EABDestination *);
-gboolean eab_destination_unload_contact (EABDestination *);
-
-gchar *eab_destination_get_address_textv (EABDestination **);
-
-gchar *eab_destination_export (const EABDestination *);
-EABDestination *eab_destination_import (const gchar *str);
-
-gchar *eab_destination_exportv (EABDestination **);
-EABDestination **eab_destination_importv (const gchar *str);
-
-EABDestination **eab_destination_list_to_vector_sized (GList *, int n);
-EABDestination **eab_destination_list_to_vector (GList *);
-
-void eab_destination_freev (EABDestination **);
-
-void eab_destination_touch (EABDestination *);
-void eab_destination_touchv (EABDestination **);
-
-
-#endif /* __EAB_DESTINATION_H__ */
-
diff --git a/addressbook/util/eab-marshal.list b/addressbook/util/eab-marshal.list
deleted file mode 100644
index 680ea039a3..0000000000
--- a/addressbook/util/eab-marshal.list
+++ /dev/null
@@ -1,5 +0,0 @@
-NONE:NONE
-NONE:BOOL
-NONE:POINTER
-NONE:STRING
-NONE:INT
diff --git a/art/.cvsignore b/art/.cvsignore
deleted file mode 100644
index c038ed7864..0000000000
--- a/art/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in \ No newline at end of file
diff --git a/art/16_copy.png b/art/16_copy.png
deleted file mode 100644
index 31ede839ea..0000000000
--- a/art/16_copy.png
+++ /dev/null
Binary files differ
diff --git a/art/16_customize.png b/art/16_customize.png
deleted file mode 100644
index 1a0e15ad4e..0000000000
--- a/art/16_customize.png
+++ /dev/null
Binary files differ
diff --git a/art/16_cut.png b/art/16_cut.png
deleted file mode 100644
index 5860a9c56f..0000000000
--- a/art/16_cut.png
+++ /dev/null
Binary files differ
diff --git a/art/16_paste.png b/art/16_paste.png
deleted file mode 100644
index 56f15c5cc3..0000000000
--- a/art/16_paste.png
+++ /dev/null
Binary files differ
diff --git a/art/ChangeLog b/art/ChangeLog
deleted file mode 100644
index e71ea6327d..0000000000
--- a/art/ChangeLog
+++ /dev/null
@@ -1,45 +0,0 @@
-2003-12-04 Radek Doulik <rodo@ximian.com>
-
- * Makefile.am (buttons_DATA): added stock junk button and notjunk
- placeholder (until artists have the right one)
-
-2003-12-02 Rodney Dawes <dobey@ximian.com>
-
- * Makefile.am: Add flag-for-followup-done.xpm to EXTRA_DIST
-
-2003-12-02 Not Zed <NotZed@Ximian.com>
-
- * flag-for-folloup*: Changed the base flag colour to reddish, and
- created a -done set, the original blue-ish colour.
-
-2003-11-12 Jakub Steiner <jimmac@ximian.com>
-
- * about-box.png: replace the foobar file
-
-2003-10-10 Hans Petter Jansson <hpj@ximian.com>
-
- * listview.xpm: Add calendar list view icon.
-
-2003-09-24 Ettore Perazzoli <ettore@ximian.com>
-
- * about-box.png: More artwork from Jakub.
-
-2003-09-24 Ettore Perazzoli <ettore@ximian.com>
-
- * splash.png: New artwork from Jakub.
-
-2003-09-12 Bolian Yin <bolian.yin@sun.com>
-
- * jump.xpm: add icon for the focused jump button.
-
-2003-08-28 Hans Petter Jansson <hpj@ximian.com>
-
- * appointment-reminder.png:
- * appointment-reminder-excl.png: Add icons used by the calendar alarm's
- systray notification. These are also in gnome-icon-theme HEAD, but
- until we have workable stock packages, we use this.
-
-2003-06-23 Jakub Steiner <jimmac@ximian.com>
-
- * splash.png:
- * about-box.png: update Copyright info
diff --git a/art/ChangeLog.pre-1-4 b/art/ChangeLog.pre-1-4
deleted file mode 100644
index 9dec5cedc8..0000000000
--- a/art/ChangeLog.pre-1-4
+++ /dev/null
@@ -1,712 +0,0 @@
-2003-06-02 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am (install-data-local) [DEFAULT_BINARY]: Symlink
- evolution.png to evolution-$(BASE_VERSION).png. [#43596]
-
-2003-05-27 Jakub Steiner <jimmac@ximian.com>
-
- * about-box.png, splash.png: Update copyright info
-
-2003-05-21 Ettore Perazzoli <ettore@ximian.com>
-
- * about-box.png, splash.png: New artwork from Jakub.
-
-2003-05-05 Jakub Steiner <jimmac@ximian.com>
-
- * evolution-contacts-plain.png
- * evolution-contacts.png:
- * globe.png:
- * malehead.png:
- * next-message.png:
- * previous-message.png:
- * receive-24.png:
- * reply-to-all.png:
- * reply.png:
- * send-24-receive.png:
- * send-24.png:
- * send-16.png:
- * send-receive.xpm:
- * send.png: quick fix of the artwork, the rest goes to the
- (future) icon theme
-
-2003-04-29 Chris Toshok <toshok@ximian.com>
-
- * Makefile.am (images_DATA): add stock-edit-{16,24}.png
-
-2003-03-03 Ettore Perazzoli <ettore@ximian.com>
-
- * about-box.png: New artwork from Jakub.
-
-2003-02-06 Dan Winship <danw@ximian.com>
-
- * Makefile.am: remove imagesdir, etc, which are now defined in
- configure.in
-
-2003-01-22 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am (imagesdir): Version using $(BASE_VERSION).
- (buttonsdir): Likewise.
- (conduitsdir): Likewise.
- (install-data-local): New rule to install evolution.png as
- evolution-$(BASE_VERSION).png.
- (EXTRA_DIST): Add evolution.png.
-
-2003-01-08 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am (imagesdir): Install images into
- $(datadir)/evolution/images instead of
- $(datadir)/images/evolution.
- (buttonsdir): Likewise, these go into
- $(datadir)/evolution/images/buttons now.
- (conduits_DATA): Likewise, $(datadir)/evolution/images/conduits.
-
-2002-11-25 Ettore Perazzoli <ettore@ximian.com>
-
- * splash.png: New work-in-progress splash from Jakub.
-
-2002-10-28 Ettore Perazzoli <ettore@ximian.com>
-
- * splash.png: New artwork from Jakub.
- * about-box.png: New artwork from Jakub.
-
-2002-10-28 Ettore Perazzoli <ettore@ximian.com>
-
- * settings.png: New.
- * settings-16.png: New.
-
-2002-10-07 Ettore Perazzoli <ettore@ximian.com>
-
- * splash.png: New artwork from Jakub.
-
-2002-09-27 Dan Winship <danw@ximian.com>
-
- * post-reply-24.png: New icon for "Post a Reply" from Jakub.
-
-2002-02-29 Ettore Perazzoli <ettore@ximian.com>
-
- * about-box.png, splash.png: New artwork from Jakub.
-
-2002-09-03 Ettore Perazzoli <ettore@ximian.com>
-
- * folder-settings.png: New icon from Jakub.
-
-2002-09-03 Jakub Steiner <jimmac@ximian.com>
-
- * ldap-settings.png: use a more gnomeish version
-
-2002-08-01 Ettore Perazzoli <ettore@ximian.com>
-
- * contact-list-16.png: New artwork from Jakub.
- * post-message-16.png: Likewise.
- * meeting-request-16.png: Likewise.
-
- * meeting.xpm: Removed.
-
-2002-07-26 Ettore Perazzoli <ettore@ximian.com>
-
- * mail.png: New icon for mail (gnome-textfile.png from GNOME 2, by
- Tuomas' suggestion).
-
-2002-07-23 Jakub Steiner <jimmac@ximian.com>
-
- * inbox.png,outbox.png: fix the arrows
- * font.png: the former one was vector style - from gorilla
-
-2002-07-22 <jpr@ximian.com>
-
- * Makefile.am: add new image
-
-2002-07-16 Ettore Perazzoli <ettore@ximian.com>
-
- * inbox.png, outbox.png: Added final large versions of the Inbox
- and Outbox icons.
-
-2002-07-09 Dan Winship <danw@ximian.com>
-
- * Makefile.am (images_DATA): add folder.png, folder-mini.png,
- public-folder.png, and public-folder-mini.png
-
- * folder-mini.png: Renamed from local-16.png
-
- * folder.png, public-folder.png, public-folder-mini.png: New, from
- Jakub.
-
-2002-07-09 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am (images_DATA): inbox-mini.png instead of
- inbox-16.png, outbox-mini.png instead of outbox-16.png. Also add
- inbox.png and outbox.png.
- (inbox.png): New.
- (outbox.png): New.
-
-2002-05-20 Ettore Perazzoli <ettore@ximian.com>
-
- * schedule-meeting-24.png: New.
-
-2002-04-25 Larry Ewing <lewing@ximian.com>
-
- * Makefile.am (images_DATA): font.png: Add for the font config
- prefs.
-
-2002-04-17 Dan Winship <danw@ximian.com>
-
- * monkey-16.png: Replace with an antialiased version
-
-2002-04-10 Dan Winship <danw@ximian.com>
-
- * Makefile.am (images_DATA), folder-settings.png: Add. (Copied
- from Unscalable Gorilla because it was handy. Will probably get
- changed to something else...)
-
-2002-03-28 Ettore Perazzoli <ettore@ximian.com>
-
- * calendar-and-tasks-settings.png: New.
- * composer-settings.png: New.
- * ldap-settings.png: New.
- * mail-accounts-settings.png: New.
- * summary-settings.png: New.
-
-2002-03-25 Dan Winship <danw@ximian.com>
-
- * Makefile.am (images_DATA): Add working-16.png (the GNOME2 stock
- "wait" icon, from Jakub)
-
-2002-03-04 Jeffrey Stedfast <fejj@ximian.com>
-
- * forward.xpm, reply.xpm, reply_to_all.xpm: Rename the internal
- structure to coincide with the filenames.
-
-2002-02-29 Ettore Perazzoli <ettore@ximian.com>
-
- * about-box.png, splash.png: New cool artwork from Jakub.
-
-2002-02-22 Jeffrey Stedfast <fejj@ximian.com>
-
- * Makefile.am: Remove meeting_widget.png from the build since it
- doesn't seem to be in cvs?
-
-2002-02-20 Jakub Steiner <jimmac@ximian.com>
-
- * summary_preferences-16.png: menu icon for summary preferences
- * Makefile.am: added the icon
-
-2002-02-13 Jeffrey Stedfast <fejj@ximian.com>
-
- * flag-for-followup.xpm:
- * flag-for-followup-16.png:
- * flag-for-followup-48.png: New icons.
-
- * Makefile.am: Added the new icons...
-
-2002-02-12 Jeffrey Stedfast <fejj@ximian.com>
-
- * Makefile.am: Install mail-new.xpm, mail-read.xpm and
- priority-high.xpm in the same place as other bonobo-ui menu
- pixmaps so we can use these in menus too.
-
-2002-02-08 JP Rosevear <jpr@ximian.com>
-
- * connect_to_url-16.xpm: new icon
-
- * new_all_day_event.png: ditto
-
- * Makefile.am: install and dist new images
-
-2001-12-11 Jon Trowbridge <trow@ximian.com>
-
- * mail-need-reply.xpm: A new icon that sucks less. We still need
- some Tuomas-love.
-
-2001-12-09 Jon Trowbridge <trow@ximian.com>
-
- * mail-need-reply.xpm: Added a really, really ugly and
- awful icon to symbolize "message needs a reply".
-
- * Makefile.am (EXTRA_DIST): Added mail-need-reply.xpm.
-
-2001-11-06 Ettore Perazzoli <ettore@ximian.com>
-
- * evolution.png: New, updated icon from Tuomas.
-
-2001-11-05 JP Rosevear <jpr@ximian.com>
-
- * Makefile.am (EXTRA_DIST): dist the glade data
-
-2001-11-01 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am (gladedir): New.
- (glade_DATA): Pixmap files required to be installed by the glade
- files.
-
-2001-10-31 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am: Install `evolution.png', not `evolution-icon.png'.
-
- * evolution.png: Renamed from `evolution-icon.png', removing the
- old, now unused `evolution.png'.
-
-2001-10-30 Jakub Steiner <jimmac@ximian.com>
-
- * splash-1-0.png: new style splash
-
-2001-10-23 Tuomas Kuosmanen <tigert@ximian.com>
-
- * splash.png: Remove the "1" from "1.0 Release Candidate 1" so it
- looks better.
-
-2001-10-23 Tuomas Kuosmanen <tigert@ximian.com>
-
- * Makefile.am (appicon_DATA): Changed the filename here too
- so the icon gets installed.
-
- * evolution-icon.png: New icon that scales better.
-
-2001-10-22 Jakub Steiner <jimmac@ximian.com>
-
- * about-box.png: update the layout a bit
- * splash.png: update to 0.17
-
-2001-10-16 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am (images_DATA): Add `about-box.png'.
-
- * about-box.png: New image for the about box from Jakub.
-
-2001-10-18 Larry Ewing <lewing@ximian.com>
-
- * Makefile.am (images_DATA): add alarm.png for the new alarm
- notification code.
-
-2001-10-04 Chris Toshok <toshok@ximian.com>
-
- * Makefile.am (images_DATA): change ldap-16.png to ldap-mini.png,
- and add ldap.png.
-
-2001-10-04 Jakub Steiner <jimmac@ximian.com>
-
- * splash.png: bump to 0.16
- * ldap.png: 48x48 version for shortcut bar
-
-2001-09-25 Iain Holmes <iain@ximian.com>
-
- * add task.png
-
-2001-09-21 Iain Holmes <iain@ximian.com>
-
- * remove timezone.png...dunno where it came from.
-
-2001-09-21 Iain Holmes <iain@ximian.com>
-
- * install timezone-16.xpm
-
-2001-09-21 Jakub Steiner <jimmac@ximian.com>
-
- * splash.png: beta4
-
-2001-09-08 Jakub Steiner <jimmac@ximian.com>
-
- * pgp-signature-*: for the pgp signature checking
- * Makefile.am (images_DATA): add the icon files
-
-2001-09-06 Chris Toshok <toshok@ximian.com>
-
- * Makefile.am (images_DATA): add ldap-16.png.
-
-2001-09-05 Jakub Steiner <jimmac@ximian.com>
-
- * meeting-request.png: for the inline .ics stuff
- * Makefile.am (images_DATA): add the icon file
-
-2001-09-04 Jakub Steiner <jimmac@ximian.com>
-
- * timezone-48.png: for the timezone configuration step in the
- first-time-druid
- * Makefile.am (images_DATA): add the icon file
-
-2001-08-20 JP Rosevear <jpr@ximian.com>
-
- * Makefile.am: install new file
-
- * talking-heads.png: new graphic for meeting requests
-
-2001-08-20 Damon Chaplin <damon@ximian.com>
-
- * Makefile.am (images_DATA): added goto-16.png & new_task-16.png.
- (buttons_DATA): added save-24.png.
-
-2001-08-20 Damon Chaplin <damon@ximian.com>
-
- * Makefile.am (buttons_DATA): added cut.png, copy.png & paste.png,
- so we can use them for the tasks toolbar.
-
-2001-08-18 Damon Chaplin <damon@ximian.com>
-
- * Makefile.am (images_DATA): added 16_copy.png, 16_customize.png,
- 16_cut.png & 16_paste.png.
- (buttons_DATA): added new_task.png, which I made from scaling up the
- smaller task.xpm icon.
-
-2001-08-18 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am (buttons_DATA): Added `delete-message.png'.
-
-2001-08-17 Damon Chaplin <damon@ximian.com>
-
- * Makefile.am (images_DATA): moved task.xpm here, so it gets installed,
- so we can use it for the menus. Note that we don't have an icon to
- use in the toolbar for a new task, and we need one. Jakub?
-
-2001-08-17 Jeffrey Stedfast <fejj@ximian.com>
-
- * wax-seal.png: Added.
-
- * wax-seal-broken.png: Added.
-
-2001-08-17 Jakub Steiner <jimmac@ximian.com>
-
- * splash.png: marketing spoils the fun. boring splash again.
-
-2001-08-17 Jakub Steiner <jimmac@ximian.com>
-
- * splash.png: Ruperzilla splash
-
- * splash-1-0.png: 1.0 candidate
-
-2001-08-16 Jakub Steiner <jimmac@ximian.com>
-
- * {next,previous}-message.png: use new document template. maybe
- still a bit dark.
-
-2001-08-15 Jakub Steiner <jimmac@ximian.com>
-
- * add-attachment.png: get rid of the yellow
-
- * compose-message.png: the old one seemed too dark to me. This one
- shares the same document base as the new stuff.
-
-2001-08-15 Jakub Steiner <jimmac@ximian.com>
-
- * all_contacts.xpm, new_contact.xpm: Nat wanted something bigger
- that would match the new button style. The filename of
- all_contacts.xpm is crap, maybe you guys can fix it to be
- "new_list.xpm" or something. Didn't want to break things.
-
-2001-08-15 Jakub Steiner <jimmac@ximian.com>
-
- * save-16.png, save-as-16.png: fix bottom. Tuomas didn't like too
- much detail.
-
-2001-08-15 Tuomas Kuosmanen <tigert@ximian.com>
-
- * goto-24.png: Icon for "Goto date.." -button. Someone could add
- this into the code?
-
-2001-08-14 Tuomas Kuosmanen <tigert@ximian.com>
-
- * arrow-[left,right]-24.png: new arrow icons for calendar
- toolbar..
-
-2001-08-14 Jakub Steiner <jimmac@ximian.com>
-
- * evolution-today-mini.png: new summary tree view icon.
-
-2001-08-10 Rodrigo Moya <rodrigo@ximian.com>
-
- * 16_category_*: removed these files, which are now in gal
-
-2001-08-09 Tuomas Kuosmanen <tigert@ximian.com>
-
- * send-receive.xpm: Updated this to have the yellow/green arrows
- so it matches the style of other icons. Noticed that tasklist
- scales 16x16 icons larger, so they generally look Bad(tm). (fixes
- #6475)
-
-2001-08-07 Damon Chaplin <damon@ximian.com>
-
- * timezone-16.xpm: copied from the international category icon.
- It would be better to have 2 different icons for these, but I had
- to get rid of that square timezone icon!
-
-2001-08-07 Jakub Steiner <jimmac@ximian.com>
-
- * evolution-trash-mini.png: scaled down Tuomas' trash icon.
- tweaked a bit. looks a lot better than the previous one.
-
-2001-08-07 Jakub Steiner <jimmac@ximian.com>
-
- * inbox-*, outbox-*: tree view icons * filters.xpm, edit-16.xpm,
- marlboro_filters.xpm: remove unused * vfolder-16.xpm,
- delete-message.xpm, undelete-message.xpm: let's not use xpms *
- evolution-trash-mini.png: new version for edit>delete message,
- tree view and everything * undelete_message-16.png,
- folder-move-16.png, open-in-new-window-16.png, folder-copy-16.png:
- tree view icons * faq-16.png, mark-as-important-16.png: menu icons
- * Makefile.am (images_DATA): add new icons, change some xpms to
- pngs
-
-
-2001-08-03 Jakub Steiner <jimmac@ximian.com>
-
- * ldap-16.png, imap-16.png, local-16.png: tree view icons for
- imap, ldap and local folders.
-
-2001-08-02 Jakub Steiner <jimmac@ximian.com>
-
- * myevo-mail-summary.png, myevo-post-it.png, *
- myevo-appointments.png: icons for My Evolution -- mail summary,
- tasks, appointments. These are _NOT_TO_ replace the shortcut
- icons, but solely for My Evolution.
-
-2001-08-02 Tuomas Kuosmanen <tigert@ximian.com>
-
- * receive-24.png: Icon for the send/receive dialog at least.
-
-2001-07-31 Jakub Steiner <jimmac@ximian.com>
-
- * splash.png: beta2 splash
-
-2001-07-31 Tuomas Kuosmanen <tigert@ximian.com>
-
- * send-24-receive.png: New version, looks more consistent with the
- other icons.
-
-2001-07-30 Jakub Steiner <jimmac@ximian.com>
-
- * search-16.png, search-and-replace-16.png: menu versions for
- shell and editor. * properties-16.png: properties for shel
- (maybe other places too) * send-16.png, send-later-16.png:
- editor, shell menu. * work_online-16.png: to accompany work
- online menu toggle. * save-16.png, save-as-16.png:
- everywhere. (based on Tuomas new gnome stock panel icon)
-
-2001-07-27 <tigert@ximian.com>
-
- * new_appointment.[xpm,png]: New version, fixes bug #4704
- hopefully.
-
-2001-07-25 Damon Chaplin <damon@ximian.com>
-
- * Makefile.am (images_DATA): added print-preview-24.png.
-
-2001-07-25 Jakub Steiner <jimmac@ximian.com>
-
- * print-preview-24.png: toolbar icon for calendar's appointment
- dialog (now using the menu version)
-
-2001-07-20 JP Rosevear <jpr@ximian.com>
-
- * Pull in new splash screen
-
-2001-07-20 Rodrigo Moya <rodrigo@ximian.com>
-
- * Makefile.am: install 2 new category icons
- (16_category_suppliers.png and 16_category_time-and-expenses.png)
-
-2001-07-20 <tigert@ximian.com>
-
- * 16_category_time-and-expenses.png: Icon for "Time & Expenses"
- category..
-
- * 16_category_suppliers.png: Icon for "Suppliers" category..
-
- * evolution-calendar.png, evolution-contacts.png,
- evolution-inbox.png, evolution-tasks.png, evolution-today.png:
- Took out the colored background circles from the icons, apparently
- people found them confusing rather than useful, especially on
- small icons -mode of the shortcutbar.
-
-2001-07-19 Rodrigo Moya <rodrigo@ximian.com>
-
- * Makefile.am: install the 2 new category icons
-
-2001-07-19 <tigert@ximian.com>
-
- * 16_category_strategies.png, 16_category_status.png: New category
- icons.
-
-2001-07-19 Jakub Steiner <jimmac@ximian.com>
-
- * insert-link-24.png, insert-table-24.png, insert-image-24.png:
- toolbar icons for message editor.
-
-2001-07-17 Rodrigo Moya <rodrigo@ximian.com>
-
- * Makefile.am: install category icons
-
-2001-07-17 Tuomas Kuosmanen <tigert@ximian.com>
-
- * 16_category_holiday-cards.png 16_category_hot-contacts.png
- 16_category_ideas.png: new category icons..
-
-2001-07-16 Tuomas Kuosmanen <tigert@ximian.com>
-
- * 16_category_favorites.png 16_category_gifts.png
- 16_category_goals.png: New additions for the category stuff..
- still more to do..
-
-2001-07-13 Tuomas Kuosmanen <tigert@ximian.com>
-
- * 16_category_*.png: Some category icons for calendar/tasks, to
- match the different category types for events. Still many to do,
- but I wanted to commit them so you people can start hacking on the
- code already. More to follow shortly.
-
- * 16_customize.png: Icon for "Customize toolbars" or whatever menu
- item that deals with customizing stuff (the icon is a wrench)
-
-2001-07-12 JP Rosevear <jpr@ximian.com>
-
- * Makefile.am: extra dist another xpm
-
-2001-07-12 <tigert@ximian.com>
-
- * delete_message.[png,xpm]: New versions for the trashcan icon. I
- am wondering if we should do some filename cleanup here, all menu
- icons should really be 16_foo.png, whereas the toolbar ones should
- be foo.png. Currently we are mixing PNG and XPM here with some
- files having otherwise same names (like this one)..
-
-2001-07-11 <tigert@ximian.com>
-
- * new_appointment.[png,xpm]: New versions
-
-2001-07-10 Tuomas Kuosmanen <tigert@ximian.com>
-
- * new_appointment.png: New appointment icon. *
- new_appointment.xpm: Small version.. (should we change this to
- 16_new_appointment.png btw?
-
-2001-07-09 Iain Holmes <iain@ximian.com>
-
- * Makefile.am: Install the myweather-* icons.
-
-2001-07-07 <tigert@ximian.com>
-
- * 16_[cut,copy,paste].png: New icons for the
- Edit->[Cut,Copy,Paste] entries, the current gnome-stock ones start
- to look bad when scaled down, so these are already 16x16 pixels.
-
-2001-07-05 Jakub Steiner <jimmac@ximian.com>
-
- * myweather-*: weather status icons for My Evolution
-
-2001-07-04 Gediminas Paulauskas <menesis@delfi.lt>
-
- * Makefile.am: install apply-filters-16.xpm
-
-2001-07-03 Tuomas Kuosmanen <tigert@ximian.com>
-
- * cut.png, copy.png, paste.png: icons for cut/copy/paste to fit
- the general style.
-
-2001-07-01 Jakub Steiner <jimmac@ximian.com>
-
- * print.xpm, print-preview.xpm: nat didn't like the jaggy
- version. This one is based on tuomas 48x48 print icon.
-
-2001-06-30 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am (buttons_DATA): Add `print.png', `next-message.png',
- `previous-message.png'.
-
-2001-06-29 Jakub Steiner <jimmac@ximian.com>
-
- * remove-nntp-folder-24.png, add-nntp-folder-24.png,
- refresh-nntp-folders-24.png: manage subscriptions toolbar icons
-
-2001-06-29 Tuomas Kuosmanen <tigert@ximian.com>
-
- * print.png: Icon for print message.
-
- * next-message.png, previous-message.png: New icons to replace the
- < > arrows in the mailer.
-
-2001-06-29 Chris Toshok <toshok@ximian.com>
-
- * Makefile.am (images_DATA): add contact-is-a-list.png
-
-2001-06-29 Tuomas Kuosmanen <tigert@ximian.com>
-
- * contact-is-a-list.png: icon for toshok, for contact lists.
-
-2001-06-27 Jeffrey Stedfast <fejj@ximian.com>
-
- * Makefile.am: Install the add-attachment.png icon.
-
-2001-06-27 Tuomas Kuosmanen <tigert@ximian.com>
-
- * evolution-calendar-mini.png: New version of the folder tree's
- calendar icon. Doesnt look too much like the contacts icon.
-
-2001-06-19 Damon Chaplin <damon@ximian.com>
-
- * world_map-960.png: world map picture used for selecting
- timezones. * Makefile.am (images_DATA): added world_map-960.png
- for timezones.
-
-2001-06-14 Jakub Steiner <jimmac@ximian.com>
-
- * apply-filters-16.xpm: for mailer menu. * vfolder-16.xpm:
- vfolder icon for menu items * hand-16.xpm: originally ment for
- customize toolbars. might not work * edit-16.xpm: edit message
- (message open)
-
-2001-06-13 Jakub Steiner <jimmac@ximian.com>
-
- * rdf.png, ico-rdf.png: ximianize those
-
-2001-06-13 Jakub Steiner <jimmac@ximian.com>
-
- * splash-1-0.png: Initial mockup for the final splash. Didn't
- wan't to overwrite the unstable splash.png.
-
-2001-06-07 Iain Holmes <iain@ximian.com>
-
- * empty.gif: es-weather.png es-appointments.png ico-calendar.png
- ico-mail.png ico-rdf.png ico-weather.png bcg.png rdf.png
- pattern.png: Added all these for the new My Evolution
-
-2001-06-04 Jakub Steiner <jimmac@ximian.com>
-
- * timezone-16.xpm: for events in a diffrent timezone
-
-2001-05-22 Jakub Steiner <jimmac@ximian.com>
-
- * evolution-inbox-mini.png: fixed the shadow
-
-2001-05-17 Dan Winship <danw@ximian.com>
-
- * Makefile.am (images_DATA): Install Jakub's new icons
-
-2001-05-16 Jakub Steiner <jimmac@ximian.com>
-
- * mail-config-druid-48.png, mail-config-druid-identity.png,
- mail-config-druid-account-name.png,
- mail-config-druid-receive.png, mail-config-druid-send.png,
- thankyou.png: config druid icons
-
- thankyou.png can be used for the last step in every evo
- druid (like the import one)
-
-2001-05-16 Jakub Steiner <jimmac@ximian.com>
-
- * evolution-calendar.png, evolution-contacts.png,
- evolution-inbox.png, evolution-today.png, evolution-tasks.png:
- fixed bug #2862. Also changed the envelope icon Oh and we use
- #b39169 for calendar now
-
-2001-05-16 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am (images_DATA): Added `online.png' and `offline.png'.
-
- * online.png: New icon by Tuomas. * offline.png: New icon by
- Tuomas.
-
-2001-05-14 Duncan Mak <duncan@ximian.com>
-
- * Makefile.am (images_DATA): add in the new find_message.xpm
-
-2001-05-14 Jakub Steiner <jimmac@ximian.com>
-
- * find_message.xpm: Duncan requested this
-
diff --git a/art/Makefile.am b/art/Makefile.am
deleted file mode 100644
index 7e23226ed1..0000000000
--- a/art/Makefile.am
+++ /dev/null
@@ -1,272 +0,0 @@
-images_DATA = \
- 16_copy.png \
- 16_customize.png \
- 16_cut.png \
- 16_paste.png \
- about-box.png \
- alarm.png \
- all_contacts.xpm \
- apply-filters-16.xpm \
- appointment-reminder.png \
- appointment-reminder-excl.png \
- bcg.png \
- briefcase.png \
- butterfly.png \
- calendar-and-tasks-settings.png \
- cellphone.png \
- compose-message.png \
- composer-settings.png \
- configure_16_addressbook.xpm \
- configure_16_calendar.xpm \
- configure_16_folder.xpm \
- configure_16_mail.xpm \
- connect_to_url-16.xpm \
- contact-is-a-list.png \
- contact-list-16.png \
- copy_16_message.xpm \
- edit.xpm \
- empty.gif \
- encrypt.xpm \
- envelope.png \
- es-appointments.png \
- es-weather.png \
- evolution-calendar-mini.png \
- evolution-calendar.png \
- evolution-contacts-mini.png \
- evolution-contacts-plain.png \
- evolution-contacts.png \
- evolution-inbox-mini.png \
- evolution-inbox.png \
- evolution-notes-mini.png \
- evolution-notes.png \
- evolution-tasks-mini.png \
- evolution-tasks.png \
- evolution-today-mini.png \
- evolution-today.png \
- evolution-trash-mini.png \
- evolution-trash.png \
- evolution-junk.png \
- evolution-junk-mini.png \
- executive-summary-bg.png \
- executive-summary-curve.png \
- info-bulb.png \
- faq-16.png \
- fetch-mail.png \
- find_contact.xpm \
- find_message.xpm \
- flag-for-followup-16.png \
- folder-copy-16.png \
- folder-move-16.png \
- folder-settings.png \
- folder.png \
- folder-mini.png \
- folder.xpm \
- font.png \
- forward.xpm \
- globe.png \
- goto-16.png \
- hide_deleted_messages.xpm \
- hide_read_messages.xpm \
- hide_selected_messages.xpm \
- house.png \
- ico-calendar.png \
- ico-mail.png \
- ico-rdf.png \
- ico-weather.png \
- import.png \
- import.xpm \
- inbox.png \
- inbox-mini.png \
- ldap-mini.png \
- ldap-settings.png \
- ldap.png \
- mail.png \
- mail-accounts-settings.png \
- mail-config-druid-account-name.png \
- mail-config-druid-identity.png \
- mail-config-druid-receive.png \
- mail-config-druid-send.png \
- mail-config-druid.png \
- mail-new.xpm \
- mail-read.xpm \
- malehead.png \
- mark-as-important-16.png \
- meeting-request.png \
- meeting-request-16.png \
- monkey-16.png \
- move_message.xpm \
- myevo-appointments.png \
- myevo-mail-summary.png \
- myevo-post-it.png \
- myweather-clouds.png \
- myweather-fog.png \
- myweather-rain.png \
- myweather-snow.png \
- myweather-storm.png \
- myweather-sun.png \
- myweather-suncloud.png \
- new-message.xpm \
- new_all_day_event.png \
- new_appointment.xpm \
- new_contact.xpm \
- new_task-16.png \
- offline.png \
- online.png \
- open-in-new-window-16.png \
- outbox.png \
- outbox-mini.png \
- pattern.png \
- pgp-signature-bad.png \
- pgp-signature-nokey.png \
- pgp-signature-ok.png \
- post-message-16.png \
- post-reply-24.png \
- print-preview.xpm \
- print.xpm \
- priority-high.xpm \
- public-folder.png \
- public-folder-mini.png \
- rdf.png \
- reply.xpm \
- reply_to_all.xpm \
- save-16.png \
- save-as-16.png \
- save.xpm \
- schedule-meeting-16.xpm \
- schedule-meeting-24.png \
- search-16.png \
- search-and-replace-16.png \
- send-16.png \
- send-later-16.png \
- send-receive.xpm \
- service-close.png \
- service-configure.png \
- service-down-disabled.png \
- service-down.png \
- service-left-disabled.png \
- service-left.png \
- service-right-disabled.png \
- service-right.png \
- service-up-disabled.png \
- service-up.png \
- settings.png \
- settings-16.png \
- show_all_messages.xpm \
- splash.png \
- stock-edit-16.png \
- stock-edit-24.png \
- stock-junk-24.png \
- stock-notjunk-24.png \
- summary-settings.png \
- summary_preferences-16.png \
- talking-heads.png \
- task.png \
- task.xpm \
- thankyou.png \
- timezone-16.xpm \
- timezone-48.png \
- undelete_message-16.png \
- wax-seal-broken.png \
- wax-seal.png \
- work_offline.xpm \
- work_online-16.png \
- working-16.png \
- world_map-960.png
-
-buttons_DATA = \
- arrow-right-24.png \
- arrow-left-24.png \
- add-attachment.png \
- add-service.png \
- compose-message.png \
- copy-message.png \
- copy.png \
- cut.png \
- dayview.xpm \
- delete-message.png \
- fetch-mail.png \
- forward.png \
- goto-24.png \
- listview.xpm \
- monthview.xpm \
- move-message.png \
- next-message.png \
- new_appointment.png \
- new_task.png \
- paste.png \
- previous-message.png \
- print.png \
- print-preview-24.png \
- reply.png \
- reply-to-all.png \
- receive-24.png \
- save-24.png \
- send-24-receive.png \
- send-24.png \
- weekview.xpm \
- workweekview.xpm \
- yearview.xpm
-
-glade_DATA = \
- evolution.png \
- import.png \
- flag-for-followup-48.png \
- mail-config-druid-account-name.png \
- mail-config-druid-identity.png \
- mail-config-druid.png \
- mail-config-druid-receive.png \
- mail-config-druid-send.png \
- thankyou.png \
- timezone-48.png
-
-conduitsdir = $(imagesdir)/conduits
-conduits_DATA = \
- evo-16-address-conduit.png \
- evo-16-todo-conduit.png \
- evo-16-calendar-conduit.png \
- evo-48-calendar-conduit.png \
- evo-48-address-conduit.png \
- evo-48-todo-conduit.png
-
-install-data-local:
- $(mkinstalldirs) $(DESTDIR)$(datadir)/pixmaps
- $(INSTALL_DATA) $(srcdir)/evolution.png $(DESTDIR)$(datadir)/pixmaps/evolution-$(BASE_VERSION).png
-if DEFAULT_BINARY
- cd $(DESTDIR)$(datadir)/pixmaps && rm -f evolution.png && $(LN_S) evolution-$(BASE_VERSION).png evolution.png
-endif
-
-EXTRA_DIST = \
- ChangeLog.pre-1-4 \
- attachment.xpm \
- bell.xpm \
- check-filled.xpm \
- empty.xpm \
- evolution.png \
- jump.xpm \
- mail-need-reply.xpm \
- mail-new.xpm \
- mail-read.xpm \
- mail-replied.xpm \
- flag-for-followup.xpm \
- flag-for-followup-done.xpm \
- mark.xpm \
- priority-high.xpm \
- priority-low.xpm \
- recur.xpm \
- score-higher.xpm \
- score-highest.xpm \
- score-high.xpm \
- score-lower.xpm \
- score-lowest.xpm \
- score-low.xpm \
- score-normal.xpm \
- task-assigned-to.xpm \
- task-assigned.xpm \
- task-recurring.xpm \
- timezone-16.xpm \
- tree-expanded.xpm \
- tree-unexpanded.xpm \
- $(images_DATA) \
- $(buttons_DATA) \
- $(conduits_DATA) \
- $(glade_DATA)
diff --git a/art/about-box.png b/art/about-box.png
deleted file mode 100644
index c3613fb4bb..0000000000
--- a/art/about-box.png
+++ /dev/null
Binary files differ
diff --git a/art/add-attachment.png b/art/add-attachment.png
deleted file mode 100644
index adbec9900b..0000000000
--- a/art/add-attachment.png
+++ /dev/null
Binary files differ
diff --git a/art/add-nntp-folder-24.png b/art/add-nntp-folder-24.png
deleted file mode 100644
index 4941fe9250..0000000000
--- a/art/add-nntp-folder-24.png
+++ /dev/null
Binary files differ
diff --git a/art/add-service.png b/art/add-service.png
deleted file mode 100644
index eb20f4e068..0000000000
--- a/art/add-service.png
+++ /dev/null
Binary files differ
diff --git a/art/alarm.png b/art/alarm.png
deleted file mode 100644
index 71a9be8a48..0000000000
--- a/art/alarm.png
+++ /dev/null
Binary files differ
diff --git a/art/all_contacts.xpm b/art/all_contacts.xpm
deleted file mode 100644
index 817bff7649..0000000000
--- a/art/all_contacts.xpm
+++ /dev/null
@@ -1,158 +0,0 @@
-/* XPM */
-static char * all_contacts_xpm[] = {
-"24 24 131 2",
-" c None",
-". c #000000",
-"+ c #FDFDFD",
-"@ c #F5F5F5",
-"# c #F6F6F6",
-"$ c #D0D0D0",
-"% c #C1C1C1",
-"& c #C3C3C3",
-"* c #C6C6C6",
-"= c #C8C8C8",
-"- c #8D8D8D",
-"; c #CACACA",
-"> c #919191",
-", c #EFEFEF",
-"' c #878787",
-") c #8A8A8A",
-"! c #5C5C5C",
-"~ c #F8F8F8",
-"{ c #EAEAEA",
-"] c #CCCCCC",
-"^ c #CECECE",
-"/ c #979797",
-"( c #D2D2D2",
-"_ c #9A9A9A",
-": c #646464",
-"< c #939393",
-"[ c #9D9D9D",
-"} c #6B6B6B",
-"| c #BDBDBD",
-"1 c #FFFFFF",
-"2 c #A1A1A1",
-"3 c #D9D9D9",
-"4 c #E3E3E3",
-"5 c #EDEDED",
-"6 c #EEEEEE",
-"7 c #C9B49B",
-"8 c #8E7151",
-"9 c #876E51",
-"0 c #BAB1A5",
-"a c #FBFBFB",
-"b c #FEFEFE",
-"c c #DEDCD7",
-"d c #9E9E9E",
-"e c #BABABA",
-"f c #D1D1D1",
-"g c #A3A3A3",
-"h c #F3F3F3",
-"i c #A88D6E",
-"j c #DFD0BF",
-"k c #5E432B",
-"l c #7E6C5B",
-"m c #313131",
-"n c #575757",
-"o c #FCFCFC",
-"p c #555555",
-"q c #D5D3CF",
-"r c #868686",
-"s c #A6A6A6",
-"t c #CDCDCD",
-"u c #DBDBDB",
-"v c #EEDFCC",
-"w c #F4EEE6",
-"x c #765E45",
-"y c #736251",
-"z c #D9D7D2",
-"A c #606060",
-"B c #7D7D7D",
-"C c #9C9C9C",
-"D c #A5A5A5",
-"E c #7C7C7C",
-"F c #FAFAFA",
-"G c #7590AE",
-"H c #C1665A",
-"I c #445B71",
-"J c #D7D6D3",
-"K c #ADADAD",
-"L c #9B9B9B",
-"M c #B6B6B6",
-"N c #E6E6E6",
-"O c #F1F1F1",
-"P c #A8A8A8",
-"Q c #4B6983",
-"R c #9DB8D2",
-"S c #486481",
-"T c #314E6C",
-"U c #667A8D",
-"V c #D4D3CE",
-"W c #787878",
-"X c #D3D3D3",
-"Y c #E1E1E1",
-"Z c #ABABAB",
-"` c #5F7C96",
-" . c #5D7A95",
-".. c #4D6B87",
-"+. c #3B556D",
-"@. c #344A60",
-"#. c #999999",
-"$. c #C7C7C7",
-"%. c #DDDBD6",
-"&. c #DADADA",
-"*. c #E2E2E2",
-"=. c #898989",
-"-. c #A9A9A9",
-";. c #B0B0B0",
-">. c #5D5D5D",
-",. c #CBC9C2",
-"'. c #BBBBBB",
-"). c #ECECEC",
-"!. c #EAE8E3",
-"~. c #DAD8D3",
-"{. c #D3D2CD",
-"]. c #CECCC8",
-"^. c #CCCAC6",
-"/. c #D1CFCA",
-"(. c #D2D0CB",
-"_. c #C8C5BF",
-":. c #737169",
-"<. c #8F8F8F",
-"[. c #B3B3B3",
-"}. c #DCDCDC",
-"|. c #E8E8E8",
-"1. c #B5B5B5",
-"2. c #565656",
-"3. c #A0A0A0",
-"4. c #C2C2C2",
-"5. c #848484",
-"6. c #838383",
-"7. c #7B7B7B",
-"8. c #8B8B8B",
-"9. c #B2B2B2",
-"0. c #B8B8B8",
-" ",
-" ",
-" . . . . . . . . . . . . . . . . . . . . ",
-" . + @ @ @ @ @ @ @ # # # # # # # # # $ . ",
-" . @ % % % & & & & * * * * * = = = = - . ",
-" . # & & & * * * * = = = = = ; ; ; ; > . ",
-" . , ' ' ' ) ) ) ) - - - - - > > > > ! . ",
-" . ~ { { { { { { { { { { { { { { { { ; . ",
-" . # ; ; ; ] ] ] ] ] ^ ^ ^ ^ $ $ $ $ / . ",
-" . # ] ] ] ^ ^ ^ ^ ^ $ & ^ $ ( ( ( ( _ . ",
-" . . . . . . . . . . . . . . : < / [ [ [ [ } . ",
-". | 1 1 1 1 1 1 1 1 1 1 1 1 2 . 3 4 5 6 6 6 * . ",
-". 1 ~ 7 8 9 0 1 + 1 a 1 1 b c . d e f 3 3 3 g . ",
-". 1 h i j k l 1 m n o p + 1 q . r s t u u u g . ",
-". 1 h v w x y 1 1 1 1 1 1 1 z . A B C D D D E . ",
-". 1 F G H I J 1 K 1 L K 1 1 q . ) M N O O , P . ",
-". 1 Q R S T U 1 1 1 1 1 1 1 V . W D X Y Y Y Z . ",
-". 1 ` ...+.@.1 #.L 5 $.1 1 %.. E K &.*.*.*.K . ",
-". 1 1 1 1 1 1 1 1 1 1 1 1 1 c . A =.-.;.;.;.[ . ",
-". 1 1 >.1 >.1 W 1 L 1 * o F ,.. =.'.).@ @ @ $ . ",
-". g !.!.!.~.~.~.{.].^./.(._.:.. <.[.}.N |.|.1.. ",
-" . . . . . . . . . . . . . . 2.3.% Y N |.|.1.. ",
-" . 4.< - =.' 5.) r 6.7.E 8.2 9.1.0.0.e . ",
-" . . . . . . . . . . . . . . . . . . . . "};
diff --git a/art/apply-filters-16.xpm b/art/apply-filters-16.xpm
deleted file mode 100644
index 28410fe30b..0000000000
--- a/art/apply-filters-16.xpm
+++ /dev/null
@@ -1,48 +0,0 @@
-/* XPM */
-static char * apply_filers_16_xpm[] = {
-"16 16 29 1",
-" c None",
-". c #161616",
-"+ c #EDEAE8",
-"@ c #CDC1BA",
-"# c #6A4E3D",
-"$ c #C6B8AF",
-"% c #333333",
-"& c #F3F1EE",
-"* c #5E4537",
-"= c #D6CCC5",
-"- c #916C56",
-"; c #5A4235",
-"> c #BBA9A0",
-", c #C3B3AC",
-"' c #CEC1BB",
-") c #BBAAA0",
-"! c #A1897A",
-"~ c #664B3B",
-"{ c #383838",
-"] c #856B60",
-"^ c #C2B3A9",
-"/ c #E9E3E0",
-"( c #EEE9E7",
-"_ c #7B5A46",
-": c #F5F4F2",
-"< c #B8A69B",
-"[ c #AE998D",
-"} c #553E32",
-"| c #725442",
-" ",
-" .+. ",
-" .@. .# ",
-" .$. %&* ",
-" .$.......=-; ",
-" .$>$$$$$,'--. ",
-" .$.......)-* ",
-" .$. .!* ",
-" .$. .~ ",
-" .$. {] ",
-" .^. ./~ ",
-" .(.......,-# ",
-" _$:,$$$$$<--. ",
-" ~.......[-} ",
-" .!# ",
-" .| "};
diff --git a/art/appointment-reminder-excl.png b/art/appointment-reminder-excl.png
deleted file mode 100644
index 2bd35ae067..0000000000
--- a/art/appointment-reminder-excl.png
+++ /dev/null
Binary files differ
diff --git a/art/appointment-reminder.png b/art/appointment-reminder.png
deleted file mode 100644
index 7e7caa95ed..0000000000
--- a/art/appointment-reminder.png
+++ /dev/null
Binary files differ
diff --git a/art/arrow-left-24.png b/art/arrow-left-24.png
deleted file mode 100644
index a977b3fb1a..0000000000
--- a/art/arrow-left-24.png
+++ /dev/null
Binary files differ
diff --git a/art/arrow-right-24.png b/art/arrow-right-24.png
deleted file mode 100644
index 393b0dca3e..0000000000
--- a/art/arrow-right-24.png
+++ /dev/null
Binary files differ
diff --git a/art/attachment.xpm b/art/attachment.xpm
deleted file mode 100644
index 21f2ecdb0e..0000000000
--- a/art/attachment.xpm
+++ /dev/null
@@ -1,22 +0,0 @@
-/* XPM */
-static char * attachment_xpm[] = {
-"16 16 3 1",
-" c None",
-". c #FFFFFF",
-"+ c #000000",
-" ",
-" ... ",
-" .+++. . ",
-" .+...+.+. ",
-" .+.+.+.+. ",
-" .+.+.+.+. ",
-" .+.+.+.+. ",
-" .+.+.+.+. ",
-" .+.+.+.+. ",
-" .+.+.+.+. ",
-" .+.+.+.+. ",
-" .+..+..+. ",
-" .+.....+. ",
-" .+...+. ",
-" .+++. ",
-" ... "};
diff --git a/art/bcg.png b/art/bcg.png
deleted file mode 100644
index ec03f8ab6e..0000000000
--- a/art/bcg.png
+++ /dev/null
Binary files differ
diff --git a/art/bell.xpm b/art/bell.xpm
deleted file mode 100644
index b1ab537a17..0000000000
--- a/art/bell.xpm
+++ /dev/null
@@ -1,83 +0,0 @@
-/* XPM */
-static char * bell_xpm[] = {
-"16 16 64 1",
-" c None",
-". c #000000",
-"+ c #E3BB43",
-"@ c #E6C049",
-"# c #EED275",
-"$ c #F4E193",
-"% c #F4DF8C",
-"& c #EAC95C",
-"* c #EFD57A",
-"= c #FAEFBB",
-"- c #FDF6D3",
-"; c #FDF5C6",
-"> c #F4E18F",
-", c #E4BD43",
-"' c #F6E295",
-") c #FEF9D8",
-"! c #FFFFFF",
-"~ c #FFFADA",
-"{ c #FCEEAA",
-"] c #EBCA5A",
-"^ c #E9C550",
-"/ c #FAEA9C",
-"( c #FEF7CB",
-"_ c #FFF8CC",
-": c #FDF1A8",
-"< c #EED060",
-"[ c #D39D12",
-"} c #F2D55D",
-"| c #FCEC91",
-"1 c #FFF4AE",
-"2 c #FFF5B6",
-"3 c #FEEF97",
-"4 c #F3D65E",
-"5 c #D5A216",
-"6 c #FAE05C",
-"7 c #FFED7C",
-"8 c #FFEF8C",
-"9 c #FFF092",
-"0 c #FDEB7A",
-"a c #F4D750",
-"b c #D8A717",
-"c c #EAC01D",
-"d c #F6D83E",
-"e c #FAE255",
-"f c #FAE362",
-"g c #F9E161",
-"h c #F6DE5B",
-"i c #F1D145",
-"j c #E6BE28",
-"k c #D09B09",
-"l c #B67E00",
-"m c #CE9100",
-"n c #D69F04",
-"o c #E0B011",
-"p c #E6BA1D",
-"q c #E3B721",
-"r c #E0B21E",
-"s c #DCAB16",
-"t c #D7A20D",
-"u c #CC9303",
-"v c #BE8400",
-"w c #AC7500",
-"x c #A06B00",
-"y c #FFDD00",
-" ",
-" .. ",
-" .+@. ",
-" .#$%&. ",
-" .*=-;>,. ",
-" .')!~{]. ",
-" .^/(~_:<[. ",
-" .}|121345. ",
-" .678980ab. ",
-" .cdefghijkl. ",
-" .mnopqrstuvwx. ",
-" .............. ",
-" .8y. ",
-" .. ",
-" ",
-" "};
diff --git a/art/briefcase.png b/art/briefcase.png
deleted file mode 100644
index 424ad09632..0000000000
--- a/art/briefcase.png
+++ /dev/null
Binary files differ
diff --git a/art/butterfly.png b/art/butterfly.png
deleted file mode 100644
index 00089774e0..0000000000
--- a/art/butterfly.png
+++ /dev/null
Binary files differ
diff --git a/art/calendar-and-tasks-settings.png b/art/calendar-and-tasks-settings.png
deleted file mode 100644
index a457bb3cc8..0000000000
--- a/art/calendar-and-tasks-settings.png
+++ /dev/null
Binary files differ
diff --git a/art/cellphone.png b/art/cellphone.png
deleted file mode 100644
index c8d70ae663..0000000000
--- a/art/cellphone.png
+++ /dev/null
Binary files differ
diff --git a/art/check-filled.xpm b/art/check-filled.xpm
deleted file mode 100644
index c0468fc25b..0000000000
--- a/art/check-filled.xpm
+++ /dev/null
@@ -1,21 +0,0 @@
-/* XPM */
-static const char * check_filled_xpm[] = {
-"16 16 2 1",
-" c None",
-". c #000000",
-" ",
-" ",
-" ............ ",
-" . . ",
-" . . . ",
-" . .. . ",
-" . ... . ",
-" . . ... . ",
-" . .. ... . ",
-" . ..... . ",
-" . ... . ",
-" . . . ",
-" . . ",
-" ............ ",
-" ",
-" "};
diff --git a/art/compose-message.png b/art/compose-message.png
deleted file mode 100644
index 0be2101b6f..0000000000
--- a/art/compose-message.png
+++ /dev/null
Binary files differ
diff --git a/art/composer-settings.png b/art/composer-settings.png
deleted file mode 100644
index f255c755e7..0000000000
--- a/art/composer-settings.png
+++ /dev/null
Binary files differ
diff --git a/art/configure_16_addressbook.xpm b/art/configure_16_addressbook.xpm
deleted file mode 100644
index 4e037fe7b5..0000000000
--- a/art/configure_16_addressbook.xpm
+++ /dev/null
@@ -1,77 +0,0 @@
-/* XPM */
-static char * 16_configure_addressbook_xpm[] = {
-"16 16 58 1",
-" c None",
-". c #000000",
-"+ c #FFFFFF",
-"@ c #EFEFEF",
-"# c #C3C3C3",
-"$ c #EAEAEA",
-"% c #BDBDBD",
-"& c #CFCFCF",
-"* c #898989",
-"= c #A8A8A8",
-"- c #A3A3A3",
-"; c #F8F8F8",
-"> c #C9B49B",
-", c #8E7151",
-"' c #876E51",
-") c #BAB1A5",
-"! c #9D9D9D",
-"~ c #EAE8E3",
-"{ c #F3F3F3",
-"] c #A88D6E",
-"^ c #DFD0BF",
-"/ c #5E432B",
-"( c #7E6C5B",
-"_ c #A6A6A6",
-": c #EEEEEE",
-"< c #EEDFCC",
-"[ c #F4EEE6",
-"} c #765E45",
-"| c #736251",
-"1 c #C1C1C1",
-"2 c #B4B4B4",
-"3 c #FAFAFA",
-"4 c #7590AE",
-"5 c #C1665A",
-"6 c #445B71",
-"7 c #AEADAB",
-"8 c #E8E8E8",
-"9 c #4B6983",
-"0 c #9DB8D2",
-"a c #486481",
-"b c #314E6C",
-"c c #BDBCB8",
-"d c #5F7C96",
-"e c #5D7A95",
-"f c #4D6B87",
-"g c #3B556D",
-"h c #999794",
-"i c #ADABA8",
-"j c #5D5D5D",
-"k c #9B9B9B",
-"l c #DEDEDE",
-"m c #C3C0BA",
-"n c #DAD8D3",
-"o c #B1AFAB",
-"p c #CBC9C5",
-"q c #A5A3A0",
-"r c #96948F",
-"s c #918E85",
-" .. .. ",
-" .+. .@. ",
-" .+....@. ",
-" .+@@@@#. ",
-" .......$@@#... ",
-".%+++++&.+#.*=-.",
-".+;>,')+.+@.!&~.",
-".+{]^/(+.+#._:~.",
-".+{<[}|1.+@.2&~.",
-".+34567.8@##.2~.",
-".+90ab.&@@@@#.c.",
-".+defg.+....@.h.",
-".+++++.+.!2.@.i.",
-".++j+j+..kl..!m.",
-".-~~~~~noc~pqrs.",
-" .............. "};
diff --git a/art/configure_16_calendar.xpm b/art/configure_16_calendar.xpm
deleted file mode 100644
index 3dd7392a1d..0000000000
--- a/art/configure_16_calendar.xpm
+++ /dev/null
@@ -1,76 +0,0 @@
-/* XPM */
-static char * configure_16_calendar_xpm[] = {
-"16 16 57 1",
-" c None",
-". c #000000",
-"+ c #FFFFFF",
-"@ c #EFEFEF",
-"# c #A8A8A8",
-"$ c #C3C3C3",
-"% c #D4D4D4",
-"& c #939393",
-"* c #F5F5F5",
-"= c #EAEAEA",
-"- c #E05232",
-"; c #DF4623",
-"> c #E78B76",
-", c #868686",
-"' c #4A4A4A",
-") c #DF502F",
-"! c #E87F68",
-"~ c #FDF6F4",
-"{ c #A7A7A7",
-"] c #747474",
-"^ c #CFCFCF",
-"/ c #DF4B29",
-"( c #F1B2A3",
-"_ c #E05231",
-": c #F3BFB4",
-"< c #EEEEEE",
-"[ c #FAE8E4",
-"} c #F9DDD6",
-"| c #E87B62",
-"1 c #8D8D8D",
-"2 c #7B7B7B",
-"3 c #9C9C9C",
-"4 c #989898",
-"5 c #707070",
-"6 c #E2E2E2",
-"7 c #E8E8E8",
-"8 c #B4B4B4",
-"9 c #E1E1E1",
-"0 c #B0B0B0",
-"a c #DEDEDE",
-"b c #E0E0E0",
-"c c #F4F4F4",
-"d c #9D9D9D",
-"e c #979797",
-"f c #BDBDBD",
-"g c #A0A0A0",
-"h c #C1C1C1",
-"i c #DADADA",
-"j c #D9D9D9",
-"k c #CECECE",
-"l c #7C7C7C",
-"m c #EDEDED",
-"n c #9F9F9F",
-"o c #ECECEC",
-"p c #E6E6E6",
-"q c #E7E7E7",
-"r c #808080",
-" .. .. ",
-".+....@........ ",
-".+....@.++++++#.",
-".+@@@@$.++++%&*.",
-" .=@@$.++-+;>,*.",
-" .+$.'#++)!~{*.",
-" .+@.]^+/(_:+*.",
-" .+$.#<+[+}|+<.",
-" .+@.12$3$4$56.",
-" .7@$$.8++++++9.",
-".^@@@@$.^+++0ab.",
-".+....@.{+++c#b.",
-".+.de.@.f+++ghi.",
-" ..jk..da+++++b.",
-" .lm^#n<op96qr.",
-" ............ "};
diff --git a/art/configure_16_folder.xpm b/art/configure_16_folder.xpm
deleted file mode 100644
index 4d016ca91a..0000000000
--- a/art/configure_16_folder.xpm
+++ /dev/null
@@ -1,85 +0,0 @@
-/* XPM */
-static char * 16_configure_folder_xpm[] = {
-"16 16 66 1",
-" c None",
-". c #000000",
-"+ c #FFFFFF",
-"@ c #EFEFEF",
-"# c #C3C3C3",
-"$ c #E4E5DF",
-"% c #D5D6CB",
-"& c #D6D7CA",
-"* c #F5F6F0",
-"= c #ADB198",
-"- c #C2C6A9",
-"; c #C0C3A7",
-"> c #B4B89D",
-", c #EAECDB",
-"' c #F6F6F4",
-") c #EAECDA",
-"! c #AAAB9E",
-"~ c #E5E8D4",
-"{ c #E4E7D2",
-"] c #C7C9B6",
-"^ c #F7F7F7",
-"/ c #DADEBF",
-"( c #DADEBE",
-"_ c #D8DCBC",
-": c #D6DBB9",
-"< c #797D66",
-"[ c #CDD2AD",
-"} c #CBD1AA",
-"| c #95997C",
-"1 c #F3F3EA",
-"2 c #70745E",
-"3 c #A3A889",
-"4 c #F3F4EA",
-"5 c #D5D9B7",
-"6 c #7F8369",
-"7 c #ABB08E",
-"8 c #929778",
-"9 c #F1F3E9",
-"0 c #D3D7B4",
-"a c #7C7F65",
-"b c #8F9474",
-"c c #F0F1E7",
-"d c #D1D6B2",
-"e c #CFD4AF",
-"f c #7A7D61",
-"g c #8D9270",
-"h c #EFF1E5",
-"i c #86896D",
-"j c #909273",
-"k c #707459",
-"l c #EBECDE",
-"m c #CACFA8",
-"n c #C8CDA5",
-"o c #B8BD97",
-"p c #848769",
-"q c #BFC598",
-"r c #60634C",
-"s c #989E79",
-"t c #C9CCB9",
-"u c #919576",
-"v c #848869",
-"w c #686B52",
-"x c #838768",
-"y c #595C46",
-"z c #797D60",
-"A c #666951",
-" .. .. ",
-" .+. .@. ",
-" .+....@. ",
-" ...+@@@@#. ",
-" .$%&.+@@#. ",
-" .*=-;>.+#..... ",
-" .,',,).+@.!~{].",
-" .^/(_:.+#.<[}|.",
-" .1/(_:.+@.23}|.",
-" .4_:5.+@##.678.",
-" .950.+@@@@#.ab.",
-" .cde.+....@.fg.",
-" .h[}.+.ij.@.kg.",
-" .lmno..pq..rsg.",
-" .t8ubvwwgxyzgA.",
-" ............. "};
diff --git a/art/configure_16_mail.xpm b/art/configure_16_mail.xpm
deleted file mode 100644
index b6416735ef..0000000000
--- a/art/configure_16_mail.xpm
+++ /dev/null
@@ -1,61 +0,0 @@
-/* XPM */
-static char * 16_configure_mail_xpm[] = {
-"16 16 42 1",
-" c None",
-". c #000000",
-"+ c #FFFFFF",
-"@ c #EFEFEF",
-"# c #C3C3C3",
-"$ c #010101",
-"% c #2F2F2F",
-"& c #A7A4A0",
-"* c #FCFCFC",
-"= c #F5F5F5",
-"- c #5D5B57",
-"; c #EBEBEB",
-"> c #1B1B1B",
-", c #FBFBF8",
-"' c #716E6B",
-") c #ECECEC",
-"! c #BEBEBE",
-"~ c #EDEDED",
-"{ c #DFDFDF",
-"] c #FBFAF7",
-"^ c #A5A29D",
-"/ c #E9E9E8",
-"( c #797873",
-"_ c #8E8C8A",
-": c #C6C3BD",
-"< c #C9C5C0",
-"[ c #7D7A77",
-"} c #F7F5F1",
-"| c #FAF9F6",
-"1 c #F8F6F2",
-"2 c #DAD8D6",
-"3 c #656360",
-"4 c #E2DFD8",
-"5 c #090808",
-"6 c #D7D4CE",
-"7 c #D8D5CF",
-"8 c #D6D3CD",
-"9 c #D9D6D0",
-"0 c #D3D1CD",
-"a c #BEBCB6",
-"b c #E0DCD5",
-"c c #222221",
-" .. .. ",
-" .+. .@.",
-" .+....@.",
-" .+@@@@#.",
-" .+@@#. ",
-" .+#. ",
-" $%$$$$$$.+@. ",
-" $&******=.+#. ",
-" $+-+++++;>+@. ",
-" $+,'+++).!@##. ",
-" $+,,'+~.{@@@@#.",
-" $+,]^'/.+....@.",
-" $+](,,_.+.:<.@.",
-" $+[,}|12..34.. ",
-" $56777890abc$ ",
-" $$$$$$$$$$$ "};
diff --git a/art/connect_to_url-16.xpm b/art/connect_to_url-16.xpm
deleted file mode 100644
index 5053d252f7..0000000000
--- a/art/connect_to_url-16.xpm
+++ /dev/null
@@ -1,123 +0,0 @@
-/* XPM */
-static char * connect_to_url_16_xpm[] = {
-"16 16 104 2",
-" c None",
-". c #000000",
-"+ c #070808",
-"@ c #677B68",
-"# c #BECFC5",
-"$ c #B4C3C6",
-"% c #8AA0B6",
-"& c #95A1AC",
-"* c #AFB8B8",
-"= c #989D98",
-"- c #373737",
-"; c #AFC1B1",
-"> c #E0E7DE",
-", c #BACFC6",
-"' c #96AFC0",
-") c #728BA4",
-"! c #889BA4",
-"~ c #829176",
-"{ c #879A81",
-"] c #AAA89A",
-"^ c #585A5B",
-"/ c #1D1D1D",
-"( c #748E79",
-"_ c #DEEADF",
-": c #B1D9B3",
-"< c #AAD8B5",
-"[ c #79B7A5",
-"} c #7A9AB5",
-"| c #839DA3",
-"1 c #74876C",
-"2 c #7E8471",
-"3 c #82755A",
-"4 c #8F7F66",
-"5 c #2D2E2D",
-"6 c #CAD7CB",
-"7 c #BCD9C2",
-"8 c #96C69D",
-"9 c #4D8550",
-"0 c #597FA7",
-"a c #418093",
-"b c #637E61",
-"c c #73755B",
-"d c #86765A",
-"e c #949290",
-"f c #CDDACD",
-"g c #518355",
-"h c #989389",
-"i c #807D74",
-"j c #3B7480",
-"k c #449268",
-"l c #819395",
-"m c #797E67",
-"n c #9D907D",
-"o c #73816F",
-"p c #43423C",
-"q c #B7B3AA",
-"r c #C4C2BD",
-"s c #EAE8E3",
-"t c #4D5C5E",
-"u c #887664",
-"v c #000001",
-"w c #010101",
-"x c #E2E1DD",
-"y c #F0EFEC",
-"z c #AAA7A0",
-"A c #C5D2C8",
-"B c #E9EEEA",
-"C c #8B8572",
-"D c #476346",
-"E c #889079",
-"F c #F2F0ED",
-"G c #EBEAE6",
-"H c #8A857B",
-"I c #ECEBE8",
-"J c #4D6C8B",
-"K c #4B6963",
-"L c #53885E",
-"M c #6E7653",
-"N c #747F6C",
-"O c #0C0B0A",
-"P c #78756B",
-"Q c #BEBBB5",
-"R c #B3B1AA",
-"S c #7D786E",
-"T c #E1DFDB",
-"U c #46698F",
-"V c #598860",
-"W c #617853",
-"X c #818667",
-"Y c #030506",
-"Z c #8C8981",
-"` c #A6A29B",
-" . c #726D63",
-".. c #CECAC3",
-"+. c #3D5143",
-"@. c #020203",
-"#. c #0F0F0D",
-"$. c #F0F3F1",
-"%. c #272622",
-"&. c #8B877E",
-"*. c #706C62",
-"=. c #B1ADA4",
-"-. c #6C685E",
-";. c #646056",
-" . . . + . . . . ",
-" . @ # $ % & * = - . ",
-" . ; > , ' ) ! ~ { ] ^ / ",
-" . ( _ : < [ } | 1 2 3 4 5 . ",
-" . 6 7 8 9 . . 0 a b c d e . ",
-" . f g . . h i . j k l m n . ",
-" . o p q r s i . . . . t u v ",
-" w . x y z s i . A A B . C v ",
-". . . i x y z s i . . . . D E v ",
-"s s s s F G H I i . J K L M N O ",
-"i i P P Q R S T P . U V W X Y ",
-". . w P Z ` ...P . . . . +.@. ",
-" #.Z ` ...P . A A $.. ",
-" %.&.*.=.-.. . . . ",
-" #.#.h ;.. ",
-" #.#. "};
diff --git a/art/contact-is-a-list.png b/art/contact-is-a-list.png
deleted file mode 100644
index 3a7bc1c143..0000000000
--- a/art/contact-is-a-list.png
+++ /dev/null
Binary files differ
diff --git a/art/contact-list-16.png b/art/contact-list-16.png
deleted file mode 100644
index 5ebfe92745..0000000000
--- a/art/contact-list-16.png
+++ /dev/null
Binary files differ
diff --git a/art/copy-message.png b/art/copy-message.png
deleted file mode 100644
index 907ec1a85d..0000000000
--- a/art/copy-message.png
+++ /dev/null
Binary files differ
diff --git a/art/copy.png b/art/copy.png
deleted file mode 100644
index 23a6db32e3..0000000000
--- a/art/copy.png
+++ /dev/null
Binary files differ
diff --git a/art/copy_16_message.xpm b/art/copy_16_message.xpm
deleted file mode 100644
index a4f56cfd6e..0000000000
--- a/art/copy_16_message.xpm
+++ /dev/null
@@ -1,58 +0,0 @@
-/* XPM */
-static char * 16_copy_message_xpm[] = {
-"16 16 39 1",
-" c None",
-". c #010101",
-"+ c #2F2F2F",
-"@ c #A7A4A0",
-"# c #FCFCFC",
-"$ c #64625F",
-"% c #95938E",
-"& c #FBFBFB",
-"* c #F9F8F6",
-"= c #FBFAFA",
-"- c #F6F5F1",
-"; c #7D7B78",
-"> c #EAE8E3",
-", c #969491",
-"' c #F6F4F1",
-") c #81807C",
-"! c #E5E3DE",
-"~ c #F7F6F4",
-"{ c #B0ADA7",
-"] c #83817E",
-"^ c #E1DFDA",
-"/ c #928F8B",
-"( c #FBFBFA",
-"_ c #F7F5F2",
-": c #F5F3F0",
-"< c #B5B2AC",
-"[ c #A09C97",
-"} c #F0EFEB",
-"| c #E4E2DD",
-"1 c #AEABA6",
-"2 c #92908B",
-"3 c #E8E6E1",
-"4 c #F7F6F2",
-"5 c #F5F4F0",
-"6 c #6B6A68",
-"7 c #E2DFD9",
-"8 c #E2E0DB",
-"9 c #E3E1DC",
-"0 c #E6E4DF",
-" ",
-" .+......... ",
-".@#########$. ",
-".#%&*#*=*-;>. ",
-".#*,=*=*')'!. ",
-".#**.+......... ",
-".#*.@#########$.",
-".#~.#%&*#*=*-;>.",
-".#{.#*,=*=*')'!.",
-".]^.#**/(*_)*:!.",
-" ...#*~<)#)[-}|.",
-" .#~1**)__23|.",
-" .#{*:45_:>63.",
-" .]^777^8890$.",
-" ........... ",
-" "};
diff --git a/art/cut.png b/art/cut.png
deleted file mode 100644
index 7ffb512043..0000000000
--- a/art/cut.png
+++ /dev/null
Binary files differ
diff --git a/art/dayview.xpm b/art/dayview.xpm
deleted file mode 100644
index dbabb24c5c..0000000000
--- a/art/dayview.xpm
+++ /dev/null
@@ -1,34 +0,0 @@
-/* XPM */
-static char * dayview_xpm[] = {
-"24 24 7 1",
-" c None",
-". c #000000",
-"+ c #D8D8D4",
-"@ c #919191",
-"# c #666666",
-"$ c #FFFFFF",
-"% c #F2F1ED",
-"....................... ",
-".++++++++++++++++++++@. ",
-".+@@@@@@@@@@@@@@@@@@@#. ",
-".+@@@@@@@@@@@@@@@@@@@#. ",
-".+@@@@@@@@@@@@@@@@@@@#. ",
-".@####################. ",
-".$++@%%%%%%%%%%%%%%%%@. ",
-".$++@%%%%%%%%%%%%%%%%@. ",
-".$++@%%%%%%%%%%%%%%%%@. ",
-".@@@@@@@@@@@@@@@@@@@@#. ",
-".$++@%%%%%%%%%%%%%%%%@. ",
-".$++@%%%%%%%%%%%%%%%%@. ",
-".$++@%%%%%%%%%%%%%%%%@. ",
-".@@@@@@@@@@@@@@@@@@@@#. ",
-".$++@%%%%%%%%%%%%%%%%@. ",
-".$++@%%%%%%%%%%%%%%%%@. ",
-".$++@%%%%%%%%%%%%%%%%@. ",
-".@@@@@@@@@@@@@@@@@@@@#. ",
-".$++@%%%%%%%%%%%%%%%%@. ",
-".$++@%%%%%%%%%%%%%%%%@. ",
-".$++@%%%%%%%%%%%%%%%%@. ",
-".+@@#@@@@@@@@@@@@@@@@#. ",
-"....................... ",
-" "};
diff --git a/art/delete-message.png b/art/delete-message.png
deleted file mode 100644
index 1bec6baac7..0000000000
--- a/art/delete-message.png
+++ /dev/null
Binary files differ
diff --git a/art/drafts-16.png b/art/drafts-16.png
deleted file mode 100644
index 285646f60b..0000000000
--- a/art/drafts-16.png
+++ /dev/null
Binary files differ
diff --git a/art/edit.xpm b/art/edit.xpm
deleted file mode 100644
index 28b8f090c4..0000000000
--- a/art/edit.xpm
+++ /dev/null
@@ -1,84 +0,0 @@
-/* XPM */
-static char * 16_edit_xpm[] = {
-"16 16 65 1",
-" c None",
-". c #000000",
-"+ c #FDFDFD",
-"@ c #E2E2E2",
-"# c #BAA88F",
-"$ c #836B4E",
-"% c #FEFEFE",
-"& c #FCFCFC",
-"* c #FBFBFB",
-"= c #E5E5E5",
-"- c #C5A985",
-"; c #DC9E55",
-"> c #9E6233",
-", c #FFFFFF",
-"' c #F2F2F2",
-") c #D9D9D9",
-"! c #E4E4E4",
-"~ c #C3A783",
-"{ c #DD9D53",
-"] c #A76631",
-"^ c #EEEEEE",
-"/ c #D4D4D4",
-"( c #FAFAFA",
-"_ c #7B7B7B",
-": c #C5AA88",
-"< c #A86631",
-"[ c #DCDCDC",
-"} c #F0F0F0",
-"| c #5E5E5E",
-"1 c #C3A47A",
-"2 c #DD9D52",
-"3 c #A66430",
-"4 c #D5D5D5",
-"5 c #6A6A6A",
-"6 c #C2A174",
-"7 c #DC9B4E",
-"8 c #A96630",
-"9 c #6E6E6E",
-"0 c #D8D8D8",
-"a c #D6D6D6",
-"b c #9F9F9F",
-"c c #BEA686",
-"d c #DD9D51",
-"e c #AA682F",
-"f c #F5F5F5",
-"g c #DDDDDD",
-"h c #F9F9F9",
-"i c #7A7A7A",
-"j c #BCAC9B",
-"k c #A86E3F",
-"l c #797979",
-"m c #F4F4F4",
-"n c #F3F3F3",
-"o c #DFDFDF",
-"p c #7C7C7C",
-"q c #4F4F4F",
-"r c #6C6C6C",
-"s c #EAEAEA",
-"t c #F8F8F8",
-"u c #F6F6F6",
-"v c #F7F7F7",
-"w c #EBEBEB",
-"x c #ECECEC",
-"y c #E0E0E0",
-"z c #E8E8E8",
-" .. .. ",
-" ..+@. .#$.",
-" ..%+&*=..-;>.",
-" ..,%+')*!.~{]. ",
-".,%%^/)*(_:{<. ",
-".%%)[**}|123. ",
-" .+'*}456789. ",
-" .&*0abcde.fg. ",
-" .((hijklfmno. ",
-" .(hpq.rfmnsg. ",
-" .tilufm^oo. ",
-" .vuufwoo.. ",
-" .uxyo.. ",
-" .zg.. ",
-" .. ",
-" "};
diff --git a/art/empty.gif b/art/empty.gif
deleted file mode 100644
index 0be4006193..0000000000
--- a/art/empty.gif
+++ /dev/null
Binary files differ
diff --git a/art/empty.xpm b/art/empty.xpm
deleted file mode 100644
index aca06618b1..0000000000
--- a/art/empty.xpm
+++ /dev/null
@@ -1,21 +0,0 @@
-/* XPM */
-static char * empty_xpm[] = {
-"16 16 2 1",
-" c None",
-". c #FFFFFF",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" "};
diff --git a/art/encrypt.xpm b/art/encrypt.xpm
deleted file mode 100644
index 636345ad9d..0000000000
--- a/art/encrypt.xpm
+++ /dev/null
@@ -1,80 +0,0 @@
-/* XPM */
-static char * 16_encrypt_xpm[] = {
-"16 16 61 1",
-" c None",
-". c #000000",
-"+ c #FDFDFD",
-"@ c #808080",
-"# c #FEFEFE",
-"$ c #8F8F8F",
-"% c #313131",
-"& c #CDB86D",
-"* c #EED680",
-"= c #FFFFFF",
-"- c #F2F2F2",
-"; c #343434",
-"> c #EEEEEE",
-", c #D4D4D4",
-"' c #D9D9D9",
-") c #3D3D3D",
-"! c #8D8D8D",
-"~ c #DCDCDC",
-"{ c #FBFBFB",
-"] c #B2B2B2",
-"^ c #3A3A3A",
-"/ c #A9A9A9",
-"( c #F0F0F0",
-"_ c #444444",
-": c #E4E9F1",
-"< c #B3C5D7",
-"[ c #AABDCE",
-"} c #A2B4C5",
-"| c #99ABBD",
-"1 c #8FA3B4",
-"2 c #3C5469",
-"3 c #FCFCFC",
-"4 c #D8D8D8",
-"5 c #D6D6D6",
-"6 c #6A6A6A",
-"7 c #BDCEE0",
-"8 c #8FAAC4",
-"9 c #819DB7",
-"0 c #7490AA",
-"a c #66839D",
-"b c #587690",
-"c c #314456",
-"d c #FAFAFA",
-"e c #F9F9F9",
-"f c #676767",
-"g c #DFDFDF",
-"h c #5F5F5F",
-"i c #F8F8F8",
-"j c #F7F7F7",
-"k c #696969",
-"l c #92A1B0",
-"m c #5E7081",
-"n c #556879",
-"o c #4C5F70",
-"p c #435668",
-"q c #394E5F",
-"r c #23313E",
-"s c #F6F6F6",
-"t c #7E7E7E",
-"u c #E8E8E8",
-"v c #DDDDDD",
-" ",
-" .. ",
-" ..+@... ",
-" ..#+$%&*&. ",
-" ..=#+-;&@. &. ",
-" .=##>,')*!. *. ",
-" .##'~{]^&!/.&..",
-" .+-{(_:<[}|12.",
-" .3{4567890abc.",
-" .ddef7890abc.",
-" .degh7890abc.",
-" .ijklmnopqr.",
-" .jsghkkt....",
-" .sssg.. ",
-" .uv.. ",
-" .. "};
diff --git a/art/envelope.png b/art/envelope.png
deleted file mode 100644
index 3e801181aa..0000000000
--- a/art/envelope.png
+++ /dev/null
Binary files differ
diff --git a/art/es-appointments.png b/art/es-appointments.png
deleted file mode 100644
index e194232051..0000000000
--- a/art/es-appointments.png
+++ /dev/null
Binary files differ
diff --git a/art/es-weather.png b/art/es-weather.png
deleted file mode 100644
index 3d31469e78..0000000000
--- a/art/es-weather.png
+++ /dev/null
Binary files differ
diff --git a/art/evo-16-address-conduit.png b/art/evo-16-address-conduit.png
deleted file mode 100644
index 18a2e5809e..0000000000
--- a/art/evo-16-address-conduit.png
+++ /dev/null
Binary files differ
diff --git a/art/evo-16-calendar-conduit.png b/art/evo-16-calendar-conduit.png
deleted file mode 100644
index dd8e8ab85e..0000000000
--- a/art/evo-16-calendar-conduit.png
+++ /dev/null
Binary files differ
diff --git a/art/evo-16-todo-conduit.png b/art/evo-16-todo-conduit.png
deleted file mode 100644
index d36d2c61fd..0000000000
--- a/art/evo-16-todo-conduit.png
+++ /dev/null
Binary files differ
diff --git a/art/evo-48-address-conduit.png b/art/evo-48-address-conduit.png
deleted file mode 100644
index 342a061088..0000000000
--- a/art/evo-48-address-conduit.png
+++ /dev/null
Binary files differ
diff --git a/art/evo-48-calendar-conduit.png b/art/evo-48-calendar-conduit.png
deleted file mode 100644
index bb0a49791e..0000000000
--- a/art/evo-48-calendar-conduit.png
+++ /dev/null
Binary files differ
diff --git a/art/evo-48-todo-conduit.png b/art/evo-48-todo-conduit.png
deleted file mode 100644
index dd4899e984..0000000000
--- a/art/evo-48-todo-conduit.png
+++ /dev/null
Binary files differ
diff --git a/art/evolution-calendar-mini.png b/art/evolution-calendar-mini.png
deleted file mode 100644
index cddb0396dc..0000000000
--- a/art/evolution-calendar-mini.png
+++ /dev/null
Binary files differ
diff --git a/art/evolution-calendar.png b/art/evolution-calendar.png
deleted file mode 100644
index 76afca6b6f..0000000000
--- a/art/evolution-calendar.png
+++ /dev/null
Binary files differ
diff --git a/art/evolution-contacts-mini.png b/art/evolution-contacts-mini.png
deleted file mode 100644
index 5ddb92c1ce..0000000000
--- a/art/evolution-contacts-mini.png
+++ /dev/null
Binary files differ
diff --git a/art/evolution-contacts-plain.png b/art/evolution-contacts-plain.png
deleted file mode 100644
index 4043413589..0000000000
--- a/art/evolution-contacts-plain.png
+++ /dev/null
Binary files differ
diff --git a/art/evolution-contacts.png b/art/evolution-contacts.png
deleted file mode 100644
index 4043413589..0000000000
--- a/art/evolution-contacts.png
+++ /dev/null
Binary files differ
diff --git a/art/evolution-inbox-mini.png b/art/evolution-inbox-mini.png
deleted file mode 100644
index dbc20fcef1..0000000000
--- a/art/evolution-inbox-mini.png
+++ /dev/null
Binary files differ
diff --git a/art/evolution-inbox.png b/art/evolution-inbox.png
deleted file mode 100644
index 66a4ba89cd..0000000000
--- a/art/evolution-inbox.png
+++ /dev/null
Binary files differ
diff --git a/art/evolution-junk-mini.png b/art/evolution-junk-mini.png
deleted file mode 100644
index 64d488ca1c..0000000000
--- a/art/evolution-junk-mini.png
+++ /dev/null
Binary files differ
diff --git a/art/evolution-junk.png b/art/evolution-junk.png
deleted file mode 100644
index 5fefbefc56..0000000000
--- a/art/evolution-junk.png
+++ /dev/null
Binary files differ
diff --git a/art/evolution-notes-mini.png b/art/evolution-notes-mini.png
deleted file mode 100644
index f5b5d776d0..0000000000
--- a/art/evolution-notes-mini.png
+++ /dev/null
Binary files differ
diff --git a/art/evolution-notes.png b/art/evolution-notes.png
deleted file mode 100644
index f82006b894..0000000000
--- a/art/evolution-notes.png
+++ /dev/null
Binary files differ
diff --git a/art/evolution-tasks-mini.png b/art/evolution-tasks-mini.png
deleted file mode 100644
index d23b5a0be7..0000000000
--- a/art/evolution-tasks-mini.png
+++ /dev/null
Binary files differ
diff --git a/art/evolution-tasks.png b/art/evolution-tasks.png
deleted file mode 100644
index a3771c23eb..0000000000
--- a/art/evolution-tasks.png
+++ /dev/null
Binary files differ
diff --git a/art/evolution-today-mini.png b/art/evolution-today-mini.png
deleted file mode 100644
index 6039b15e82..0000000000
--- a/art/evolution-today-mini.png
+++ /dev/null
Binary files differ
diff --git a/art/evolution-today.png b/art/evolution-today.png
deleted file mode 100644
index 010bcb8cc7..0000000000
--- a/art/evolution-today.png
+++ /dev/null
Binary files differ
diff --git a/art/evolution-trash-mini.png b/art/evolution-trash-mini.png
deleted file mode 100644
index 56a8daa51f..0000000000
--- a/art/evolution-trash-mini.png
+++ /dev/null
Binary files differ
diff --git a/art/evolution-trash.png b/art/evolution-trash.png
deleted file mode 100644
index c2ac8da173..0000000000
--- a/art/evolution-trash.png
+++ /dev/null
Binary files differ
diff --git a/art/evolution.png b/art/evolution.png
deleted file mode 100644
index 412dcfbbc0..0000000000
--- a/art/evolution.png
+++ /dev/null
Binary files differ
diff --git a/art/executive-summary-bg.png b/art/executive-summary-bg.png
deleted file mode 100644
index fdcde6613d..0000000000
--- a/art/executive-summary-bg.png
+++ /dev/null
Binary files differ
diff --git a/art/executive-summary-curve.png b/art/executive-summary-curve.png
deleted file mode 100644
index 3ba42dd02b..0000000000
--- a/art/executive-summary-curve.png
+++ /dev/null
Binary files differ
diff --git a/art/faq-16.png b/art/faq-16.png
deleted file mode 100644
index fcf71658da..0000000000
--- a/art/faq-16.png
+++ /dev/null
Binary files differ
diff --git a/art/fetch-mail.png b/art/fetch-mail.png
deleted file mode 100644
index 30cda0564d..0000000000
--- a/art/fetch-mail.png
+++ /dev/null
Binary files differ
diff --git a/art/find_contact.xpm b/art/find_contact.xpm
deleted file mode 100644
index 37d957b13b..0000000000
--- a/art/find_contact.xpm
+++ /dev/null
@@ -1,127 +0,0 @@
-/* XPM */
-static char * 24_find_contact_xpm[] = {
-"24 24 100 2",
-" c None",
-". c #000000",
-"+ c #BDBDBD",
-"@ c #FFFFFF",
-"# c #A3A3A3",
-"$ c #F8F8F8",
-"% c #C9B49B",
-"& c #8E7151",
-"* c #876E51",
-"= c #BAB1A5",
-"- c #FDFDFD",
-"; c #FBFBFB",
-"> c #EAE8E3",
-", c #F3F3F3",
-"' c #A88D6E",
-") c #DFD0BF",
-"! c #5E432B",
-"~ c #7E6C5B",
-"{ c #313131",
-"] c #575757",
-"^ c #FCFCFC",
-"/ c #555555",
-"( c #EEDFCC",
-"_ c #F4EEE6",
-": c #765E45",
-"< c #736251",
-"[ c #FAFAFA",
-"} c #7590AE",
-"| c #C1665A",
-"1 c #445B71",
-"2 c #D7D6D3",
-"3 c #ADADAD",
-"4 c #9B9B9B",
-"5 c #4B6983",
-"6 c #9DB8D2",
-"7 c #486481",
-"8 c #314E6C",
-"9 c #667A8D",
-"0 c #E0E0E0",
-"a c #BCBCBC",
-"b c #C5C5C5",
-"c c #5F7C96",
-"d c #5D7A95",
-"e c #4D6B87",
-"f c #3B556D",
-"g c #344A60",
-"h c #47473F",
-"i c #0A0A09",
-"j c #4B4B43",
-"k c #999999",
-"l c #34342E",
-"m c #9D9D8D",
-"n c #CFCFB9",
-"o c #C4C4AF",
-"p c #8D8D7F",
-"q c #353530",
-"r c #A2A2A2",
-"s c #D2D2D2",
-"t c #5D5D5D",
-"u c #46463F",
-"v c #9C9C8C",
-"w c #E2E2D0",
-"x c #EDEDE7",
-"y c #C0C0AC",
-"z c #B2B29F",
-"A c #828274",
-"B c #4C4C44",
-"C c #B9B9B9",
-"D c #D1CFC8",
-"E c #090908",
-"F c #D5D5BF",
-"G c #FBFBFA",
-"H c #C3C3AE",
-"I c #B5B5A2",
-"J c #A6A695",
-"K c #959586",
-"L c #080807",
-"M c #72706D",
-"N c #918E85",
-"O c #090909",
-"P c #CACAB5",
-"Q c #DDDDD0",
-"R c #B7B7A4",
-"S c #AAAA98",
-"T c #9B9B8B",
-"U c #8C8C7D",
-"V c #474740",
-"W c #929283",
-"X c #BABAA7",
-"Y c #ADAD9B",
-"Z c #9F9F8E",
-"` c #909081",
-" . c #727266",
-".. c #4C4C45",
-"+. c #34342F",
-"@. c #878779",
-"#. c #A0A090",
-"$. c #737367",
-"%. c #010101",
-"&. c #414141",
-" ",
-" ",
-" ",
-" . . . . . . . . . . . . . . ",
-" . + @ @ @ @ @ @ @ @ @ @ @ @ # . ",
-" . @ $ % & * = @ - @ ; @ @ @ > . ",
-" . @ , ' ) ! ~ @ { ] ^ / - @ > . ",
-" . @ , ( _ : < @ @ @ @ @ @ @ > . ",
-" . @ [ } | 1 2 @ 3 @ 4 3 @ @ > . ",
-" . @ 5 6 7 8 9 0 3 a b 0 @ @ > . ",
-" . @ c d e f g h i i j k b @ > . ",
-" . @ @ @ @ @ l m n o p q r s > . ",
-" . @ @ t @ u v w x y z A B C D . ",
-" . # > > > E F G H I J K L M N . ",
-" . . . . O P Q R S T U i . . ",
-" V W X Y Z ` ... ",
-" +.@.#.W $.%.%. ",
-" j i i &. %.%. ",
-" %.%.%. ",
-" %.%.%. ",
-" %.%.%. ",
-" %.%. ",
-" ",
-" "};
diff --git a/art/find_message.xpm b/art/find_message.xpm
deleted file mode 100644
index 04465b4ff8..0000000000
--- a/art/find_message.xpm
+++ /dev/null
@@ -1,130 +0,0 @@
-/* XPM */
-static char * find_message_xpm[] = {
-"24 24 103 2",
-" c None",
-". c #000000",
-"+ c #E9E9E9",
-"@ c #E2E2E2",
-"# c #D7D7D7",
-"$ c #FDFDFD",
-"% c #FCFCFC",
-"& c #FBFBFB",
-"* c #D8D8D8",
-"= c #FEFEFE",
-"- c #E4E4E4",
-"; c #BABABA",
-"> c #E0E0E0",
-", c #FAFAFA",
-"' c #F9F9F9",
-") c #EAEAEA",
-"! c #F8F8F8",
-"~ c #CECECE",
-"{ c #BDBDBD",
-"] c #E6E6E6",
-"^ c #E7E7E7",
-"/ c #FFFFFF",
-"( c #C2C2C2",
-"_ c #E5E5E5",
-": c #47473F",
-"< c #0A0A09",
-"[ c #4B4B43",
-"} c #8E8E8E",
-"| c #AFAFAF",
-"1 c #34342E",
-"2 c #9D9D8D",
-"3 c #CFCFB9",
-"4 c #C4C4AF",
-"5 c #8D8D7F",
-"6 c #353530",
-"7 c #848484",
-"8 c #BFBFBF",
-"9 c #F7F7F7",
-"0 c #F5F5F5",
-"a c #46463F",
-"b c #9C9C8C",
-"c c #E2E2D0",
-"d c #EDEDE7",
-"e c #C0C0AC",
-"f c #B2B29F",
-"g c #828274",
-"h c #45453D",
-"i c #A7A7A7",
-"j c #D2D2D2",
-"k c #D5D5D5",
-"l c #090908",
-"m c #D5D5BF",
-"n c #FBFBFA",
-"o c #C3C3AE",
-"p c #B5B5A2",
-"q c #A6A695",
-"r c #959586",
-"s c #080807",
-"t c #979797",
-"u c #F4F4F4",
-"v c #090909",
-"w c #CACAB5",
-"x c #DDDDD0",
-"y c #B7B7A4",
-"z c #AAAA98",
-"A c #9B9B8B",
-"B c #8C8C7D",
-"C c #929292",
-"D c #CBCBCB",
-"E c #D3D3D3",
-"F c #474740",
-"G c #929283",
-"H c #BABAA7",
-"I c #ADAD9B",
-"J c #9F9F8E",
-"K c #909081",
-"L c #727266",
-"M c #4C4C45",
-"N c #A6A6A6",
-"O c #DFDFDF",
-"P c #34342F",
-"Q c #878779",
-"R c #A0A090",
-"S c #737367",
-"T c #010101",
-"U c #919191",
-"V c #C1C1C1",
-"W c #D1D1D1",
-"X c #414141",
-"Y c #4B4B4B",
-"Z c #131313",
-"` c #646464",
-" . c #8B8B8B",
-".. c #AEAEAE",
-"+. c #5E5E5E",
-"@. c #6E6E6E",
-"#. c #575757",
-"$. c #595959",
-"%. c #585858",
-"&. c #C4C4C4",
-"*. c #DDDDDD",
-"=. c #797979",
-"-. c #2F2F2F",
-" ",
-" ",
-" . . ",
-" . . + @ . ",
-" . . # $ % & . ",
-" . . * = = = = & - . ",
-" . ; = = = = > > , ' . . . ",
-" . ) = = > > = = = ! . . + @ . ",
-" . $ = = = = ~ . . # $ % & . ",
-" . % & = { . . * = = = = & - . ",
-" . . . , ] . * ^ ^ ^ = > > , ' . ",
-" . / = . ( _ : < < [ } | ^ = = ! - . ",
-" . # = = . 1 2 3 4 5 6 7 8 > > 9 0 . ",
-" . $ = a b c d e f g h i j = = 0 - . ",
-" . k & l m n o p q r s t j > > 0 u . ",
-" . , v w x y z A B < C D = = = = - . ",
-" . E F G H I J K L M N j = = = O O . ",
-" . ! P Q R G S T T U V ^ O O . . ",
-" . W = [ < < X Y Z ` .... . ",
-" . = = > O +.@.#.T $.%. ",
-" . &.*.. . =.. T -. ",
-" . . T T T ",
-" T T ",
-" "};
diff --git a/art/flag-for-followup-16.png b/art/flag-for-followup-16.png
deleted file mode 100644
index 08e5e6dcd4..0000000000
--- a/art/flag-for-followup-16.png
+++ /dev/null
Binary files differ
diff --git a/art/flag-for-followup-48.png b/art/flag-for-followup-48.png
deleted file mode 100644
index a387bd9521..0000000000
--- a/art/flag-for-followup-48.png
+++ /dev/null
Binary files differ
diff --git a/art/flag-for-followup-done-16.png b/art/flag-for-followup-done-16.png
deleted file mode 100644
index c21a388135..0000000000
--- a/art/flag-for-followup-done-16.png
+++ /dev/null
Binary files differ
diff --git a/art/flag-for-followup-done-48.png b/art/flag-for-followup-done-48.png
deleted file mode 100644
index 76f5c0b04e..0000000000
--- a/art/flag-for-followup-done-48.png
+++ /dev/null
Binary files differ
diff --git a/art/flag-for-followup-done.xpm b/art/flag-for-followup-done.xpm
deleted file mode 100644
index 6d93b23457..0000000000
--- a/art/flag-for-followup-done.xpm
+++ /dev/null
@@ -1,78 +0,0 @@
-/* XPM */
-static char * flag_for_followup_done_xpm[] = {
-"16 16 59 1",
-" c None",
-". c #000000",
-"+ c #282E33",
-"@ c #C1D1E0",
-"# c #929EA9",
-"$ c #69737C",
-"% c #32404B",
-"& c #363F47",
-"* c #AEC0D1",
-"= c #DAE3EB",
-"- c #C4D4E4",
-"; c #6F8498",
-"> c #4D5D6C",
-", c #3F4D5B",
-"' c #3F4952",
-") c #AABBCB",
-"! c #C6D3DE",
-"~ c #E4EAF0",
-"{ c #C0D0E0",
-"] c #73889C",
-"^ c #526271",
-"/ c #41505E",
-"( c #56636F",
-"_ c #41484E",
-": c #97A9B8",
-"< c #5D7B95",
-"[ c #6A87A1",
-"} c #B5C4D2",
-"| c #D8E1E9",
-"1 c #CFDBE6",
-"2 c #9DB8D2",
-"3 c #455461",
-"4 c #465665",
-"5 c #45515B",
-"6 c #30363A",
-"7 c #C0B094",
-"8 c #4B6983",
-"9 c #57758F",
-"0 c #64819B",
-"a c #B3C2D0",
-"b c #D2DBE4",
-"c c #DCE4EC",
-"d c #A4BBD1",
-"e c #97A1AB",
-"f c #74797F",
-"g c #727A81",
-"h c #606A74",
-"i c #B39169",
-"j c #516F89",
-"k c #AEBECC",
-"l c #AFBFCE",
-"m c #DCE4EB",
-"n c #7D94A8",
-"o c #BBC8D3",
-"p c #0E0E0E",
-"q c #D7DEE4",
-"r c #040404",
-"s c #9EA4AA",
-"t c #0B0F13",
-" . ",
-" ...+. ",
-" .@#$%&. ",
-" .*=-;>,'.. ",
-" .)!~{]^/(_.. ",
-" .:<[}|12;3456. ",
-".7.890abcdefgh. ",
-" .i.8j<klm.... ",
-" .i.88nop ",
-" .i.88qr ",
-" .i.8s. ",
-" .i.t ",
-" .i. ",
-" .i. ",
-" .i. ",
-" .. "};
diff --git a/art/flag-for-followup.xpm b/art/flag-for-followup.xpm
deleted file mode 100644
index aa646673ad..0000000000
--- a/art/flag-for-followup.xpm
+++ /dev/null
@@ -1,78 +0,0 @@
-/* XPM */
-static char * flag_for_followup_xpm[] = {
-"16 16 59 1",
-" c None",
-". c #000000",
-"+ c #33282B",
-"@ c #DFC0CA",
-"# c #A89199",
-"$ c #7B686E",
-"% c #4B323A",
-"& c #47363B",
-"* c #D0ADB8",
-"= c #EAD9DF",
-"- c #E4C4CD",
-"; c #976E7B",
-"> c #6B4C56",
-", c #5B3F47",
-"' c #523F44",
-") c #CAA9B4",
-"! c #DEC6CD",
-"~ c #EFE3E7",
-"{ c #DFBFC9",
-"] c #9C737F",
-"^ c #70515B",
-"/ c #5E4149",
-"( c #6F565D",
-"_ c #4E4145",
-": c #B796A1",
-"< c #955D6E",
-"[ c #A0697B",
-"} c #D1B4BD",
-"| c #E8D7DD",
-"1 c #E6CFD6",
-"2 c #D19CAD",
-"3 c #60444D",
-"4 c #64454F",
-"5 c #5B454C",
-"6 c #392F33",
-"7 c #BFB093",
-"8 c #824A5C",
-"9 c #8F5768",
-"0 c #9A6375",
-"a c #CFB2BB",
-"b c #E4D2D7",
-"c c #ECDCE0",
-"d c #D0A3B1",
-"e c #AA969C",
-"f c #7F7476",
-"g c #807176",
-"h c #735F65",
-"i c #B29168",
-"j c #885062",
-"k c #CCAEB7",
-"l c #CEAFB8",
-"m c #EADBE0",
-"n c #A77D8A",
-"o c #D2BAC2",
-"p c #0D0D0D",
-"q c #E4D7DB",
-"r c #030303",
-"s c #A99DA1",
-"t c #120B0D",
-" . ",
-" ...+. ",
-" .@#$%&. ",
-" .*=-;>,'.. ",
-" .)!~{]^/(_.. ",
-" .:<[}|12;3456. ",
-".7.890abcdefgh. ",
-" .i.8j<klm.... ",
-" .i.88nop ",
-" .i.88qr ",
-" .i.8s. ",
-" .i.t ",
-" .i. ",
-" .i. ",
-" .i. ",
-" .. "};
diff --git a/art/folder-copy-16.png b/art/folder-copy-16.png
deleted file mode 100644
index 5c0a3c9dbd..0000000000
--- a/art/folder-copy-16.png
+++ /dev/null
Binary files differ
diff --git a/art/folder-mini.png b/art/folder-mini.png
deleted file mode 100644
index 1fc929bbf7..0000000000
--- a/art/folder-mini.png
+++ /dev/null
Binary files differ
diff --git a/art/folder-move-16.png b/art/folder-move-16.png
deleted file mode 100644
index 4a94499f1c..0000000000
--- a/art/folder-move-16.png
+++ /dev/null
Binary files differ
diff --git a/art/folder-settings.png b/art/folder-settings.png
deleted file mode 100644
index 64305acf23..0000000000
--- a/art/folder-settings.png
+++ /dev/null
Binary files differ
diff --git a/art/folder.png b/art/folder.png
deleted file mode 100644
index 30f073ea6b..0000000000
--- a/art/folder.png
+++ /dev/null
Binary files differ
diff --git a/art/folder.xpm b/art/folder.xpm
deleted file mode 100644
index 4ef29bcad7..0000000000
--- a/art/folder.xpm
+++ /dev/null
@@ -1,73 +0,0 @@
-/* XPM */
-static char * folder_xpm[] = {
-"16 16 54 1",
-" c None",
-". c #000000",
-"+ c #E4E5DF",
-"@ c #D5D6CB",
-"# c #D6D7CA",
-"$ c #A3A39D",
-"% c #F5F6F0",
-"& c #ADB198",
-"* c #C2C6A9",
-"= c #C0C3A7",
-"- c #B4B89D",
-"; c #6D705F",
-"> c #EAECDB",
-", c #F6F6F4",
-"' c #EAECDA",
-") c #E8EAD8",
-"! c #E9EBDB",
-"~ c #E7E9D6",
-"{ c #E6E8D5",
-"] c #E5E8D4",
-"^ c #E4E7D2",
-"/ c #C7C9B6",
-"( c #F7F7F7",
-"_ c #DADEBF",
-": c #DADEBE",
-"< c #D8DCBC",
-"[ c #D6DBB9",
-"} c #D5D9B7",
-"| c #D3D7B4",
-"1 c #D1D6B2",
-"2 c #CFD4AF",
-"3 c #CDD2AD",
-"4 c #CBD1AA",
-"5 c #95997C",
-"6 c #F3F3EA",
-"7 c #F3F4EA",
-"8 c #CACFA8",
-"9 c #C8CDA5",
-"0 c #929778",
-"a c #F1F3E9",
-"b c #C6CCA3",
-"c c #C4CAA0",
-"d c #8F9474",
-"e c #F0F1E7",
-"f c #C2C89D",
-"g c #C1C79B",
-"h c #8D9270",
-"i c #EFF1E5",
-"j c #BFC598",
-"k c #EBECDE",
-"l c #C9CCB9",
-"m c #919576",
-"n c #8F9372",
-"o c #666951",
-" ",
-" ",
-" .... ",
-" .+@#$. ",
-" .%&*=-;....... ",
-" .>,>>')!~~{]^/.",
-" .(_:<[}|112345.",
-" .6_:<[}|112345.",
-" .7<[}|12334890.",
-" .a}|1234889bcd.",
-" .e123489bbcfgh.",
-" .i3489bcffgjjh.",
-" .k89bcfgjjjjjh.",
-" .l0mdnhhhhhhho.",
-" ............. ",
-" "};
diff --git a/art/font.png b/art/font.png
deleted file mode 100644
index bd927d3344..0000000000
--- a/art/font.png
+++ /dev/null
Binary files differ
diff --git a/art/forget_passwords.xpm b/art/forget_passwords.xpm
deleted file mode 100644
index a121300716..0000000000
--- a/art/forget_passwords.xpm
+++ /dev/null
@@ -1,125 +0,0 @@
-/* XPM */
-static char * forget_passwords_xpm[] = {
-"16 16 106 2",
-" c None",
-". c #010101",
-"+ c #C0B09D",
-"@ c #FEC6BC",
-"# c #FFCDB4",
-"$ c #C2A887",
-"% c #DCB9A8",
-"& c #AF843A",
-"* c #755C5C",
-"= c #655E37",
-"- c #DBBCAE",
-"; c #FFC4B8",
-"> c #FFCDBC",
-", c #DDBCA3",
-"' c #DBBEB5",
-") c #B9933A",
-"! c #D3AF84",
-"~ c #BE933A",
-"{ c #CDA86F",
-"] c #A3753F",
-"^ c #554F2E",
-"/ c #FFC5A3",
-"( c #FFFFE3",
-"_ c #D4B584",
-": c #DCBEB5",
-"< c #CDAE95",
-"[ c #E6BAA8",
-"} c #BDA897",
-"| c #CCA871",
-"1 c #B9841D",
-"2 c #CCAF95",
-"3 c #A8753F",
-"4 c #C4B29C",
-"5 c #E3B89E",
-"6 c #E6BEA8",
-"7 c #C89E58",
-"8 c #DCB5A0",
-"9 c #B5841D",
-"0 c #E6B593",
-"a c #BA9E58",
-"b c #B4841D",
-"c c #C79E58",
-"d c #3B250B",
-"e c #FFE5BE",
-"f c #F2C7B2",
-"g c #F3BE9E",
-"h c #C7B5A9",
-"i c #F3C8B9",
-"j c #C29E58",
-"k c #E6C2AE",
-"l c #BBAAB1",
-"m c #C7A887",
-"n c #BE9E58",
-"o c #6D572C",
-"p c #CDB6AC",
-"q c #E6BE9E",
-"r c #C7AE95",
-"s c #E6C3B5",
-"t c #DCB593",
-"u c #B9A073",
-"v c #CAA49D",
-"w c #AE841D",
-"x c #A6781B",
-"y c #BA8E51",
-"z c #B1813F",
-"A c #C6A871",
-"B c #DCBEAF",
-"C c #E6BEB5",
-"D c #D4B0AE",
-"E c #BDA058",
-"F c #AC761B",
-"G c #A77D3F",
-"H c #A06422",
-"I c #B59358",
-"J c #BDA187",
-"K c #D3B5A0",
-"L c #BD933A",
-"M c #B09960",
-"N c #BD9D60",
-"O c #AC8131",
-"P c #935511",
-"Q c #753F20",
-"R c #753D1D",
-"S c #D4AE84",
-"T c #B09264",
-"U c #BDA475",
-"V c #B48431",
-"W c #B08431",
-"X c #A86813",
-"Y c #975C16",
-"Z c #A06413",
-"` c #5C3D1D",
-" . c #A46A36",
-".. c #903801",
-"+. c #953D1D",
-"@. c #751801",
-"#. c #681601",
-"$. c #844116",
-"%. c #1D0101",
-"&. c #A0581D",
-"*. c #933A01",
-"=. c #A67531",
-"-. c #87581D",
-";. c #A86F1D",
-">. c #A1713A",
-",. c #B09358",
-" ",
-" . . . . . . ",
-" . . + @ # $ % & * . ",
-" = - ; > , ' ) ! ~ { ] . ",
-" ^ / ( _ : < [ } | 1 2 ) 3 . ",
-". 4 5 6 7 : 8 9 0 a 2 b c ~ d ",
-". e f g h i j k l m $ < n 1 o . ",
-". p q r s t b u v 2 c w c x y . ",
-" . z A B 1 ) C D $ E j F G H . ",
-" . I ~ J K L M 2 ~ N O P Q . ",
-" . . R S T U V W X Y Z . ",
-" ` ...+.@.#.$.. ",
-" . %.&.*.=. ",
-" . -.;.>. ",
-" . ` ,.. ",
-" . . . "};
diff --git a/art/forward.png b/art/forward.png
deleted file mode 100644
index bbce8ad3c7..0000000000
--- a/art/forward.png
+++ /dev/null
Binary files differ
diff --git a/art/forward.xpm b/art/forward.xpm
deleted file mode 100644
index fcb25802a1..0000000000
--- a/art/forward.xpm
+++ /dev/null
@@ -1,51 +0,0 @@
-/* XPM */
-static char * forward_xpm[] = {
-"16 16 32 1",
-" c None",
-". c #010101",
-"+ c #2F2F2F",
-"@ c #A7A4A0",
-"# c #FCFCFC",
-"$ c #64625F",
-"% c #FFFFFF",
-"& c #5D5B57",
-"* c #868580",
-"= c #E5E2DB",
-"- c #FBFBF8",
-"; c #716E6B",
-"> c #62605C",
-", c #F8F7F2",
-"' c #DDDAD4",
-") c #000000",
-"! c #FBFAF7",
-"~ c #A5A29D",
-"{ c #797873",
-"] c #BBC2CC",
-"^ c #576E87",
-"/ c #EFEFEF",
-"( c #CCCCCC",
-"_ c #7D7A77",
-": c #F7F5F1",
-"< c #FAF9F6",
-"[ c #314E6C",
-"} c #090808",
-"| c #D7D4CE",
-"1 c #D8D5CF",
-"2 c #181818",
-"3 c #090909",
-" ",
-" ",
-" ",
-" .+......... ",
-" .@#########$. ",
-" .%&%%%%%%%*=. ",
-" .%-;%%%%%>,'. ",
-" .%--;%)))))))))",
-" .%-!~;)%%%%%%%)",
-" .%!{--)%]^///()",
-" .%_-:<)%^[[/[()",
-" .}|111)%/[[[[()",
-" .....)%//[[[()",
-" )%/[[[[()",
-" )%((((((2",
-" ))3))))))"};
diff --git a/art/globe.png b/art/globe.png
deleted file mode 100644
index 88f22d3020..0000000000
--- a/art/globe.png
+++ /dev/null
Binary files differ
diff --git a/art/goto-16.png b/art/goto-16.png
deleted file mode 100644
index 800db10e41..0000000000
--- a/art/goto-16.png
+++ /dev/null
Binary files differ
diff --git a/art/goto-24.png b/art/goto-24.png
deleted file mode 100644
index b6fc82fd73..0000000000
--- a/art/goto-24.png
+++ /dev/null
Binary files differ
diff --git a/art/hand-16.xpm b/art/hand-16.xpm
deleted file mode 100644
index d925e2d968..0000000000
--- a/art/hand-16.xpm
+++ /dev/null
@@ -1,115 +0,0 @@
-/* XPM */
-static char * hand_16_xpm[] = {
-"16 16 96 2",
-" c None",
-". c #010100",
-"+ c #010000",
-"@ c #090600",
-"# c #030000",
-"$ c #E8E6E1",
-"% c #A3A09C",
-"& c #080000",
-"* c #D6D2CD",
-"= c #8F8A84",
-"- c #FFFAF7",
-"; c #98938D",
-"> c #F1EDE9",
-", c #88827E",
-"' c #181510",
-") c #F8EEE4",
-"! c #F8ECE0",
-"~ c #F8ECDE",
-"{ c #0D0600",
-"] c #F8EBDE",
-"^ c #F6E7D7",
-"/ c #D5C5B6",
-"( c #070000",
-"_ c #F6E5D3",
-": c #F7E9D9",
-"< c #050200",
-"[ c #080300",
-"} c #312722",
-"| c #EFE7E0",
-"1 c #F6F2EF",
-"2 c #F6F1EE",
-"3 c #EDE4DB",
-"4 c #F1E4D6",
-"5 c #9D9790",
-"6 c #12110D",
-"7 c #958E88",
-"8 c #DDCFC2",
-"9 c #F6E8D9",
-"0 c #F6F1EC",
-"a c #F5F1EE",
-"b c #E5D7CB",
-"c c #F7E8D8",
-"d c #EEDFD3",
-"e c #CAC0B6",
-"f c #645951",
-"g c #E7D9CA",
-"h c #F6E6D5",
-"i c #F7EBDE",
-"j c #E9DCD2",
-"k c #040000",
-"l c #F7EFE7",
-"m c #EDDECF",
-"n c #D6C8BA",
-"o c #CBB9AC",
-"p c #D2C8BC",
-"q c #F8EEE3",
-"r c #F5EEE8",
-"s c #EFE3D7",
-"t c #B8A99D",
-"u c #060100",
-"v c #D7CFC7",
-"w c #F9F2E9",
-"x c #F3E3D4",
-"y c #F1DFCF",
-"z c #E6D7C7",
-"A c #F8F2ED",
-"B c #EDE1D4",
-"C c #0A0300",
-"D c #D7CFC9",
-"E c #FAF2EC",
-"F c #F1E0D1",
-"G c #F6EEE8",
-"H c #000000",
-"I c #171111",
-"J c #A79D9D",
-"K c #C8BDBC",
-"L c #A59D9A",
-"M c #ABA8A3",
-"N c #BFB7B5",
-"O c #060000",
-"P c #0E0403",
-"Q c #0A0000",
-"R c #0A0200",
-"S c #080401",
-"T c #FCF4F2",
-"U c #F9F1EF",
-"V c #F8F0EE",
-"W c #F2EDEA",
-"X c #DDD9D6",
-"Y c #E5E4E0",
-"Z c #030400",
-"` c #0B0505",
-" . c #050000",
-".. c #14100F",
-"+. c #090806",
-"@. c #000100",
-" . + ",
-" @ # $ % + + ",
-" & * = - ; > , ' ",
-" & ) ; ! ; ~ ; { ",
-" & ] ; ^ ; ] ; / ( ",
-" & _ ; _ ; : ; / ( ",
-" < [ } | 1 2 3 4 5 / ( ",
-" 6 _ 7 & 8 _ 9 0 a b / ( ",
-" + c d e f g h _ i j / ( ",
-" k l m n o p q r s t ( ",
-" u v w x y z A B _ t ( ",
-" C D E _ F G _ / H ",
-" I J K _ _ L M & ",
-" N O P Q R k S ",
-" k T U V W X Y Z ",
-" k ` ...# +.H @. "};
diff --git a/art/hide_deleted_messages.xpm b/art/hide_deleted_messages.xpm
deleted file mode 100644
index 189d8d350e..0000000000
--- a/art/hide_deleted_messages.xpm
+++ /dev/null
@@ -1,39 +0,0 @@
-/* XPM */
-static char * hide_deleted_messages_xpm[] = {
-"16 16 20 1",
-" c None",
-". c #828282",
-"+ c #A0A0A0",
-"@ c #AAAAAA",
-"# c #898989",
-"$ c #9A9A9A",
-"% c #8F8F8F",
-"& c #A9A9A9",
-"* c #A5A5A5",
-"= c #959595",
-"- c #A8A8A8",
-"; c #AEAEAE",
-"> c #B1B1B1",
-", c #B3B3B3",
-"' c #9B9B9B",
-") c #DF421E",
-"! c #000000",
-"~ c #B7B7B7",
-"{ c #ADADAD",
-"] c #AFAFAF",
-" ",
-" ",
-" ",
-" .. .+.@#$.. ",
-" .. ..%&$*=$ ",
-" .. .@.-;$#> ",
-" ",
-" .%.; .%, '. ) ",
-"!!!!!!!!!!!!! ))",
-" .~$. ... .. ) ",
-" ",
-" .+ .+.'% .+ ",
-" .{ .#%.] '& ",
-" .' .$;.% .. ",
-" ",
-" "};
diff --git a/art/hide_read_messages.xpm b/art/hide_read_messages.xpm
deleted file mode 100644
index 8df1313651..0000000000
--- a/art/hide_read_messages.xpm
+++ /dev/null
@@ -1,23 +0,0 @@
-/* XPM */
-static char * hide_read_messages_xpm[] = {
-"16 16 4 1",
-" c None",
-". c #000000",
-"+ c #DF421E",
-"@ c #828282",
-" ",
-" ",
-" ",
-" .. ....... ",
-" + ",
-" @ @@@ @@ @ ++",
-" + ",
-" ... .. ... ",
-" ",
-" ... . .... ",
-" + ",
-" @@ @@@ @@@ ++",
-" + ",
-" . ... .... ",
-" ",
-" "};
diff --git a/art/hide_selected_messages.xpm b/art/hide_selected_messages.xpm
deleted file mode 100644
index cb1989b84c..0000000000
--- a/art/hide_selected_messages.xpm
+++ /dev/null
@@ -1,33 +0,0 @@
-/* XPM */
-static char * hide_selected_messages_xpm[] = {
-"16 16 14 1",
-" c None",
-". c #4B6983",
-"+ c #DF421E",
-"@ c #FFFFFF",
-"# c #798FA2",
-"$ c #BEC8D0",
-"% c #F1F3F5",
-"& c #CDD5DC",
-"* c #A9B6C2",
-"= c #000000",
-"- c #647E94",
-"; c #A2B1BE",
-"> c #E4E8EC",
-", c #D8DEE4",
-" ",
-" ",
-" ",
-" ............ + ",
-" .@#$%%#@&*%. ++",
-" ............ + ",
-" ",
-" === == === ",
-" ",
-" === = ==== ",
-" ",
-" ............ + ",
-" .@%-@&@;>,%. ++",
-" ............ + ",
-" ",
-" "};
diff --git a/art/house.png b/art/house.png
deleted file mode 100644
index df43ec6181..0000000000
--- a/art/house.png
+++ /dev/null
Binary files differ
diff --git a/art/ico-calendar.png b/art/ico-calendar.png
deleted file mode 100644
index 3010528d7f..0000000000
--- a/art/ico-calendar.png
+++ /dev/null
Binary files differ
diff --git a/art/ico-mail.png b/art/ico-mail.png
deleted file mode 100644
index 66a4ba89cd..0000000000
--- a/art/ico-mail.png
+++ /dev/null
Binary files differ
diff --git a/art/ico-rdf.png b/art/ico-rdf.png
deleted file mode 100644
index 0e39037b95..0000000000
--- a/art/ico-rdf.png
+++ /dev/null
Binary files differ
diff --git a/art/ico-weather.png b/art/ico-weather.png
deleted file mode 100644
index 25eb161f8c..0000000000
--- a/art/ico-weather.png
+++ /dev/null
Binary files differ
diff --git a/art/imap-16.png b/art/imap-16.png
deleted file mode 100644
index 1e2932a728..0000000000
--- a/art/imap-16.png
+++ /dev/null
Binary files differ
diff --git a/art/import.png b/art/import.png
deleted file mode 100644
index 151b60a270..0000000000
--- a/art/import.png
+++ /dev/null
Binary files differ
diff --git a/art/import.xpm b/art/import.xpm
deleted file mode 100644
index a996072772..0000000000
--- a/art/import.xpm
+++ /dev/null
@@ -1,59 +0,0 @@
-/* XPM */
-static char * 16_import_xpm[] = {
-"16 16 40 1",
-" c None",
-". c #000000",
-"+ c #A50B05",
-"@ c #A1A1A1",
-"# c #FFFFFF",
-"$ c #A7A7A7",
-"% c #980000",
-"& c #DBDBDB",
-"* c #9B9B9B",
-"= c #9C9C9C",
-"- c #E4E4E4",
-"; c #9F0502",
-"> c #A90F07",
-", c #D23618",
-"' c #AEAEAE",
-") c #A3A3A3",
-"! c #D83C1B",
-"~ c #E46243",
-"{ c #E87E64",
-"] c #2C2C2C",
-"^ c #9E8754",
-"/ c #6B5B39",
-"( c #826E46",
-"_ c #9E8655",
-": c #BFA367",
-"< c #DCCBA3",
-"[ c #99804F",
-"} c #D8C7A2",
-"| c #F0DBAC",
-"1 c #E4D3AF",
-"2 c #76520D",
-"3 c #865F10",
-"4 c #E1BB65",
-"5 c #D1940C",
-"6 c #906612",
-"7 c #7D5C14",
-"8 c #CF920B",
-"9 c #714F0C",
-"0 c #E2BE6C",
-"a c #7B560E",
-"....... + ",
-".@###$. %+ ",
-".&*#=-.%;>,, ",
-".'-$-). ++ ! ",
-"....... + ~ ",
-" { ",
-" ",
-" ......]. ",
-" .^/(_:<[. ",
-" .}||||123. ",
-" .45555567. ",
-" .45555567. ",
-" .45555567. ",
-" .45585569. ",
-" .055555a. ",
-" ........ "};
diff --git a/art/inbox-16.png b/art/inbox-16.png
deleted file mode 100644
index 88071fa91e..0000000000
--- a/art/inbox-16.png
+++ /dev/null
Binary files differ
diff --git a/art/inbox-full-16.png b/art/inbox-full-16.png
deleted file mode 100644
index 289335eaa2..0000000000
--- a/art/inbox-full-16.png
+++ /dev/null
Binary files differ
diff --git a/art/inbox-mini.png b/art/inbox-mini.png
deleted file mode 100644
index 88071fa91e..0000000000
--- a/art/inbox-mini.png
+++ /dev/null
Binary files differ
diff --git a/art/inbox.png b/art/inbox.png
deleted file mode 100644
index dda0fecbb3..0000000000
--- a/art/inbox.png
+++ /dev/null
Binary files differ
diff --git a/art/info-bulb.png b/art/info-bulb.png
deleted file mode 100644
index 2d2e6be8b1..0000000000
--- a/art/info-bulb.png
+++ /dev/null
Binary files differ
diff --git a/art/insert-image-24.png b/art/insert-image-24.png
deleted file mode 100644
index 4b2fd4ffae..0000000000
--- a/art/insert-image-24.png
+++ /dev/null
Binary files differ
diff --git a/art/insert-link-24.png b/art/insert-link-24.png
deleted file mode 100644
index 9824bc8ae6..0000000000
--- a/art/insert-link-24.png
+++ /dev/null
Binary files differ
diff --git a/art/insert-table-24.png b/art/insert-table-24.png
deleted file mode 100644
index 21344caea6..0000000000
--- a/art/insert-table-24.png
+++ /dev/null
Binary files differ
diff --git a/art/jump.xpm b/art/jump.xpm
deleted file mode 100644
index 7c289e738f..0000000000
--- a/art/jump.xpm
+++ /dev/null
@@ -1,30 +0,0 @@
-/* XPM */
-static char * jump_xpm[] = {
-"16 8 3 1",
-" c None",
-". c #000000",
-"+ c #FFFF00",
-"................",
-".++++++++++++++.",
-".++++++++++++++.",
-".++..++..++..++.",
-".++..++..++..++.",
-".++++++++++++++.",
-".++++++++++++++.",
-"................"};
-
-static char * jump_xpm_focused[] = {
-"16 8 3 1",
-" c None",
-". c #0000FF",
-"+ c #FFFF00",
-"................",
-"................",
-"..++++++++++++..",
-"..+..++..++..+..",
-"..+..++..++..+..",
-"..++++++++++++..",
-"................",
-"................"};
-
-
diff --git a/art/ldap-mini.png b/art/ldap-mini.png
deleted file mode 100644
index 85c4dc0cf7..0000000000
--- a/art/ldap-mini.png
+++ /dev/null
Binary files differ
diff --git a/art/ldap-settings.png b/art/ldap-settings.png
deleted file mode 100644
index dd10f98412..0000000000
--- a/art/ldap-settings.png
+++ /dev/null
Binary files differ
diff --git a/art/ldap.png b/art/ldap.png
deleted file mode 100644
index 5ff8180b35..0000000000
--- a/art/ldap.png
+++ /dev/null
Binary files differ
diff --git a/art/listview.xpm b/art/listview.xpm
deleted file mode 100644
index 56d4a7fd64..0000000000
--- a/art/listview.xpm
+++ /dev/null
@@ -1,34 +0,0 @@
-/* XPM */
-static char * listview_xpm[] = {
-"24 24 7 1",
-" c None",
-". c #000000",
-"+ c #D8D8D4",
-"@ c #919191",
-"# c #666666",
-"$ c #FFFFFF",
-"% c #F2F1ED",
-"....................... ",
-".++++++++++++++++++++@. ",
-".+@@@@@@@@@@@@@@@@@@@#. ",
-".+@@@@@@@@@@@@@@@@@@@#. ",
-".+@@@@@@@@@@@@@@@@@@@#. ",
-".@####################. ",
-".$%%%%%%%%%%%%%%%%%%%@. ",
-".$%%%%%%%%%%%%%%%%%%%@. ",
-".$%%%%%%%%%%%%%%%%%%%@. ",
-".@@@@@@@@@@@@@@@@@@@@#. ",
-".$%%%%%%%%%%%%%%%%%%%@. ",
-".$%%%%%%%%%%%%%%%%%%%@. ",
-".$%%%%%%%%%%%%%%%%%%%@. ",
-".@@@@@@@@@@@@@@@@@@@@#. ",
-".$%%%%%%%%%%%%%%%%%%%@. ",
-".$%%%%%%%%%%%%%%%%%%%@. ",
-".$%%%%%%%%%%%%%%%%%%%@. ",
-".@@@@@@@@@@@@@@@@@@@@#. ",
-".$%%%%%%%%%%%%%%%%%%%@. ",
-".$%%%%%%%%%%%%%%%%%%%@. ",
-".$%%%%%%%%%%%%%%%%%%%@. ",
-".+@@@@@@@@@@@@@@@@@@@#. ",
-"....................... ",
-" "};
diff --git a/art/mail-accounts-settings.png b/art/mail-accounts-settings.png
deleted file mode 100644
index 565b1b300a..0000000000
--- a/art/mail-accounts-settings.png
+++ /dev/null
Binary files differ
diff --git a/art/mail-config-druid-48.png b/art/mail-config-druid-48.png
deleted file mode 100644
index 35b452b4e9..0000000000
--- a/art/mail-config-druid-48.png
+++ /dev/null
Binary files differ
diff --git a/art/mail-config-druid-account-name.png b/art/mail-config-druid-account-name.png
deleted file mode 100644
index 2cad5eb941..0000000000
--- a/art/mail-config-druid-account-name.png
+++ /dev/null
Binary files differ
diff --git a/art/mail-config-druid-identity.png b/art/mail-config-druid-identity.png
deleted file mode 100644
index f895a1e168..0000000000
--- a/art/mail-config-druid-identity.png
+++ /dev/null
Binary files differ
diff --git a/art/mail-config-druid-receive.png b/art/mail-config-druid-receive.png
deleted file mode 100644
index df75812db3..0000000000
--- a/art/mail-config-druid-receive.png
+++ /dev/null
Binary files differ
diff --git a/art/mail-config-druid-send.png b/art/mail-config-druid-send.png
deleted file mode 100644
index 1bf501ddb2..0000000000
--- a/art/mail-config-druid-send.png
+++ /dev/null
Binary files differ
diff --git a/art/mail-config-druid.png b/art/mail-config-druid.png
deleted file mode 100644
index 35b452b4e9..0000000000
--- a/art/mail-config-druid.png
+++ /dev/null
Binary files differ
diff --git a/art/mail-need-reply.xpm b/art/mail-need-reply.xpm
deleted file mode 100644
index 283ef3d83f..0000000000
--- a/art/mail-need-reply.xpm
+++ /dev/null
@@ -1,101 +0,0 @@
-/* XPM */
-static char * mail_need_reply_xpm[] = {
-"16 16 82 1",
-" c None",
-". c #2A2A2A",
-"+ c #AAAAAA",
-"@ c #A2A2A2",
-"# c #949494",
-"$ c #E4E4E4",
-"% c #F6F6F6",
-"& c #F7F7F7",
-"* c #F8F8F8",
-"= c #E5E5E5",
-"- c #898989",
-"; c #7A7A7A",
-"> c #DADADA",
-", c #F5F5F5",
-"' c #818181",
-") c #B1B1B1",
-"! c #858585",
-"~ c #EDEDED",
-"{ c #8E8E8E",
-"] c #E1E1E1",
-"^ c #E2E2E2",
-"/ c #7F7F7F",
-"( c #B7B7B7",
-"_ c #E0E0E0",
-": c #BEBEBE",
-"< c #737373",
-"[ c #848484",
-"} c #E8E8E8",
-"| c #DBDBDB",
-"1 c #363636",
-"2 c #9C9C9C",
-"3 c #C9C9C9",
-"4 c #919191",
-"5 c #B4B4B4",
-"6 c #AFAFAF",
-"7 c #C3C3C3",
-"8 c #6F635C",
-"9 c #372B24",
-"0 c #EBEBEB",
-"a c #F1F1F1",
-"b c #D7D7D7",
-"c c #C7C7C7",
-"d c #E9E9E9",
-"e c #F3F3F3",
-"f c #BDBDBD",
-"g c #CDCDCD",
-"h c #372E28",
-"i c #F6B893",
-"j c #88634D",
-"k c #534339",
-"l c #2C211A",
-"m c #8F8F8F",
-"n c #A8A8A8",
-"o c #6F6F6F",
-"p c #473B34",
-"q c #DBA585",
-"r c #F4A677",
-"s c #F5AD82",
-"t c #F5B189",
-"u c #72503C",
-"v c #3F3F3F",
-"w c #1C1C1C",
-"x c #2B1E15",
-"y c #DC976F",
-"z c #DA8A5B",
-"A c #583725",
-"B c #984816",
-"C c #A75223",
-"D c #43210E",
-"E c #261102",
-"F c #853F12",
-"G c #A55123",
-"H c #9C4C20",
-"I c #984B20",
-"J c #42200E",
-"K c #853E12",
-"L c #4A240E",
-"M c #291408",
-"N c #160A04",
-"O c #200E01",
-"P c #180B01",
-"Q c #000000",
-" ",
-" .++++++++++. ",
-" @#$%&**%&=-; ",
-" +>#,,,,,,')! ",
-" +*~{],,^/(_! ",
-" +*,:<,,;[]}! ",
-" +|1234-567}! ",
-" +890abcdefg! ",
-" hijkklmbbbno ",
-" pqrsttu.vvvvw ",
-" xyzzzzzA ",
-" xBCCCCCD ",
-" EFGHIIJ ",
-" EKLMMN ",
-" OP ",
-" Q "};
diff --git a/art/mail-new.xpm b/art/mail-new.xpm
deleted file mode 100644
index 767ec6366f..0000000000
--- a/art/mail-new.xpm
+++ /dev/null
@@ -1,67 +0,0 @@
-/* XPM */
-static char * mail_new_xpm[] = {
-"16 16 48 1",
-" c None",
-". c #000000",
-"+ c #202020",
-"@ c #817968",
-"# c #F5F5F5",
-"$ c #4D493C",
-"% c #736C5C",
-"& c #F5EEEE",
-"* c #FFEDC7",
-"= c #FAF3EC",
-"- c #FCE6B5",
-"; c #60594D",
-"> c #D3C29E",
-", c #746D5D",
-"' c #F5F1F1",
-") c #FDEECD",
-"! c #F8F4ED",
-"~ c #FAE3B3",
-"{ c #645F4F",
-"] c #C9BA98",
-"^ c #71685A",
-"/ c #FCF5EA",
-"( c #FFE8B7",
-"_ c #F5DEB2",
-": c #FFEABD",
-"< c #90856F",
-"[ c #7C7361",
-"} c #E4D1A9",
-"| c #C9B996",
-"1 c #FFEBC2",
-"2 c #887F6B",
-"3 c #726B59",
-"4 c #D1BF9C",
-"5 c #8B816C",
-"6 c #FFE9BA",
-"7 c #F9E2B2",
-"8 c #FFE8B8",
-"9 c #F6DFB3",
-"0 c #D4C19D",
-"a c #534D42",
-"b c #CFBF9C",
-"c c #645F51",
-"d c #C2B293",
-"e c #C4B393",
-"f c #C4B495",
-"g c #C5B596",
-"h c #CCBC99",
-"i c #4C483D",
-" ",
-" ",
-" ",
-" .+......... ",
-" .@#########$. ",
-" .#%&*#*=*-;>. ",
-" .#*,')!*~{~]. ",
-" .#**^/*({*_]. ",
-" .#*:<{#{[-}|. ",
-" .#12**{((34|. ",
-" .#5*_67890ab. ",
-" .cdeeedffghi. ",
-" ........... ",
-" ",
-" ",
-" "};
diff --git a/art/mail-read.xpm b/art/mail-read.xpm
deleted file mode 100644
index b4e3160ab4..0000000000
--- a/art/mail-read.xpm
+++ /dev/null
@@ -1,70 +0,0 @@
-/* XPM */
-static char * mail_read_xpm[] = {
-"16 16 51 1",
-" c None",
-". c #010101",
-"+ c #D9D6D0",
-"@ c #C3C0B9",
-"# c #EFEDE8",
-"$ c #F7F7F6",
-"% c #FAFAFA",
-"& c #B6B4AE",
-"* c #737373",
-"= c #C2BFB8",
-"- c #F5F4F2",
-"; c #FAFAF9",
-"> c #FFFFFF",
-", c #D2CFC9",
-"' c #707070",
-") c #5D5B57",
-"! c #868580",
-"~ c #E5E2DB",
-"{ c #FBFBF8",
-"] c #716E6B",
-"^ c #62605C",
-"/ c #F8F7F2",
-"( c #DDDAD4",
-"_ c #929191",
-": c #969390",
-"< c #92908A",
-"[ c #A1A0A0",
-"} c #F7F5F1",
-"| c #FBFAF7",
-"1 c #A5A29D",
-"2 c #908D87",
-"3 c #F9F7F3",
-"4 c #F0EEE8",
-"5 c #DDD9D2",
-"6 c #797873",
-"7 c #F9F8F4",
-"8 c #74726E",
-"9 c #E3E0D9",
-"0 c #7D7A77",
-"a c #FAF9F6",
-"b c #F8F6F2",
-"c c #FAF8F5",
-"d c #F7F5F2",
-"e c #E2DFD8",
-"f c #090808",
-"g c #D7D4CE",
-"h c #D8D5CF",
-"i c #D6D3CD",
-"j c #DAD7D1",
-"k c #E0DCD5",
-"l c #222221",
-" ..... ",
-" .+++++. ",
-" .++++++@. ",
-" .+++++#$%&. ",
-" .*==-;>>>>,'. ",
-" .>)>>>>>>>!~. ",
-" .>{]>>>>>^/(. ",
-" .>{{_::<[{}(. ",
-" .>{|1{{{2345. ",
-" .>|6{{{77895. ",
-" .>0{}abcd~8e. ",
-" .fghhhi++jkl. ",
-" ........... ",
-" ",
-" ",
-" "};
diff --git a/art/mail-replied.xpm b/art/mail-replied.xpm
deleted file mode 100644
index 06f4a7420a..0000000000
--- a/art/mail-replied.xpm
+++ /dev/null
@@ -1,52 +0,0 @@
-/* XPM */
-static char * mail_replied_xpm[] = {
-"16 16 33 1",
-" c None",
-". c #010101",
-"+ c #2F2F2F",
-"@ c #A7A4A0",
-"# c #FCFCFC",
-"$ c #64625F",
-"% c #95938E",
-"& c #FBFBFB",
-"* c #F9F8F6",
-"= c #FBFAFA",
-"- c #F6F5F1",
-"; c #7D7B78",
-"> c #EAE8E3",
-", c #969491",
-"' c #000000",
-") c #928F8B",
-"! c #FFFFFF",
-"~ c #F7F6F4",
-"{ c #B5B2AC",
-"] c #003366",
-"^ c #EFEFEF",
-"/ c #CCCCCC",
-"( c #AEABA6",
-"_ c #B0ADA7",
-": c #F5F3F0",
-"< c #83817E",
-"[ c #E1DFDA",
-"} c #E2DFD9",
-"| c #002C59",
-"1 c #002850",
-"2 c #00254A",
-"3 c #181818",
-"4 c #090909",
-" ",
-" ",
-" ",
-" .+......... ",
-" .@#########$. ",
-" .#%&*#*=*-;>. ",
-" .#*,=''''''''' ",
-" .#**)'!!!!!!!' ",
-" .#*~{'!]]]]^/' ",
-" .#~(*'!]]]^^/' ",
-" .#_*:'!]]]]^/' ",
-" .<[}}'!]^]]|/' ",
-" ....'!^^^12/' ",
-" '!//////3 ",
-" ''4'''''' ",
-" "};
diff --git a/art/mail.png b/art/mail.png
deleted file mode 100644
index bfe4bad56c..0000000000
--- a/art/mail.png
+++ /dev/null
Binary files differ
diff --git a/art/malehead.png b/art/malehead.png
deleted file mode 100644
index 2b1328b4e2..0000000000
--- a/art/malehead.png
+++ /dev/null
Binary files differ
diff --git a/art/mark-as-important-16.png b/art/mark-as-important-16.png
deleted file mode 100644
index 393d86e77c..0000000000
--- a/art/mark-as-important-16.png
+++ /dev/null
Binary files differ
diff --git a/art/mark.xpm b/art/mark.xpm
deleted file mode 100644
index 710cd0e872..0000000000
--- a/art/mark.xpm
+++ /dev/null
@@ -1,21 +0,0 @@
-/* XPM */
-static char * mark_xpm[] = {
-"16 16 2 1",
-" c None",
-". c #36592A",
-" ",
-" ",
-" ",
-" ",
-" . ",
-" .. ",
-" .. ",
-" . .. ",
-" .. ... ",
-" .... ",
-" ... ",
-" .. ",
-" . ",
-" ",
-" ",
-" "};
diff --git a/art/meeting-request-16.png b/art/meeting-request-16.png
deleted file mode 100644
index 9874eca084..0000000000
--- a/art/meeting-request-16.png
+++ /dev/null
Binary files differ
diff --git a/art/meeting-request.png b/art/meeting-request.png
deleted file mode 100644
index 0fba577bfe..0000000000
--- a/art/meeting-request.png
+++ /dev/null
Binary files differ
diff --git a/art/monkey-16.png b/art/monkey-16.png
deleted file mode 100644
index 02fb7b6eb5..0000000000
--- a/art/monkey-16.png
+++ /dev/null
Binary files differ
diff --git a/art/monthview.xpm b/art/monthview.xpm
deleted file mode 100644
index 21c76151d5..0000000000
--- a/art/monthview.xpm
+++ /dev/null
@@ -1,34 +0,0 @@
-/* XPM */
-static char * monthview_xpm[] = {
-"24 24 7 1",
-" c None",
-". c #000000",
-"+ c #FFFFFF",
-"@ c #666666",
-"# c #919191",
-"$ c #F2F1ED",
-"% c #D8D8D4",
-"....................... ",
-".+++++++++++++++++++++. ",
-".+@@@@@@@@@@@@@@@@@@@#. ",
-".+@@@@@@@@@@@@@@@@@@@#. ",
-".+$$$#$$$#$$$#$$$#$$$#. ",
-".+$$$#$$$#$$$#$$$#$$$#. ",
-".+$$$#$$$#$$$#$$$#$$$#. ",
-".+####################. ",
-".+$$$#$$$#$$$#$$$#$$$#. ",
-".+$$$#$$$#$$$#$$$#$$$#. ",
-".+$$$#$$$#$$$#$$$#$$$#. ",
-".+$$$#$$$#$$$#$$$#$$$#. ",
-".+####################. ",
-".+$$$#$$$#$$$#$$$#$$$#. ",
-".+$$$#$$$#$$$#$$$#$$$#. ",
-".+$$$#$$$#$$$#$$$#$$$#. ",
-".+$$$#$$$#$$$#$$$#$$$#. ",
-".+####################. ",
-".+$$$#$$$#$$$#$$$#$$$#. ",
-".+$$$#$$$#$$$#$$$#$$$#. ",
-".+$$$#$$$#$$$#$$$#$$$#. ",
-".%###################@. ",
-"....................... ",
-" "};
diff --git a/art/move-message.png b/art/move-message.png
deleted file mode 100644
index 143cea1a93..0000000000
--- a/art/move-message.png
+++ /dev/null
Binary files differ
diff --git a/art/move_message.xpm b/art/move_message.xpm
deleted file mode 100644
index 846febbe49..0000000000
--- a/art/move_message.xpm
+++ /dev/null
@@ -1,59 +0,0 @@
-/* XPM */
-static char * 16_move_message_xpm[] = {
-"16 16 40 1",
-" c None",
-". c #010101",
-"+ c #2F2F2F",
-"@ c #A7A4A0",
-"# c #FCFCFC",
-"$ c #64625F",
-"% c #95938E",
-"& c #FBFBFB",
-"* c #F9F8F6",
-"= c #FBFAFA",
-"- c #F6F5F1",
-"; c #7D7B78",
-"> c #EAE8E3",
-", c #969491",
-"' c #F6F4F1",
-") c #81807C",
-"! c #E5E3DE",
-"~ c #000000",
-"{ c #928F8B",
-"] c #FBFBFA",
-"^ c #F7F5F2",
-"/ c #F5F3F0",
-"( c #F7F6F4",
-"_ c #B5B2AC",
-": c #A09C97",
-"< c #F0EFEB",
-"[ c #E4E2DD",
-"} c #AEABA6",
-"| c #92908B",
-"1 c #E8E6E1",
-"2 c #B0ADA7",
-"3 c #F7F6F2",
-"4 c #F5F4F0",
-"5 c #6B6A68",
-"6 c #83817E",
-"7 c #E1DFDA",
-"8 c #E2DFD9",
-"9 c #E2E0DB",
-"0 c #E3E1DC",
-"a c #E6E4DF",
-" ",
-" . . . . . . ",
-". . ",
-" ",
-". . ",
-" .+......... ",
-". .@#########$.",
-" .#%&*#*=*-;>.",
-". .#*,=*=*')'!.",
-" ~ .#**{]*^)*/!.",
-" .#*(_)#):-<[.",
-" .#(}**)^^|1[.",
-" .#2*/34^/>51.",
-" .678887990a$.",
-" ........... ",
-" "};
diff --git a/art/myevo-appointments.png b/art/myevo-appointments.png
deleted file mode 100644
index 873528a964..0000000000
--- a/art/myevo-appointments.png
+++ /dev/null
Binary files differ
diff --git a/art/myevo-mail-summary.png b/art/myevo-mail-summary.png
deleted file mode 100644
index 453f9938ac..0000000000
--- a/art/myevo-mail-summary.png
+++ /dev/null
Binary files differ
diff --git a/art/myevo-post-it.png b/art/myevo-post-it.png
deleted file mode 100644
index f0ef421549..0000000000
--- a/art/myevo-post-it.png
+++ /dev/null
Binary files differ
diff --git a/art/myweather-clouds.png b/art/myweather-clouds.png
deleted file mode 100644
index fa1fa4b80f..0000000000
--- a/art/myweather-clouds.png
+++ /dev/null
Binary files differ
diff --git a/art/myweather-fog.png b/art/myweather-fog.png
deleted file mode 100644
index 60db197df7..0000000000
--- a/art/myweather-fog.png
+++ /dev/null
Binary files differ
diff --git a/art/myweather-rain.png b/art/myweather-rain.png
deleted file mode 100644
index 3ce291f788..0000000000
--- a/art/myweather-rain.png
+++ /dev/null
Binary files differ
diff --git a/art/myweather-snow.png b/art/myweather-snow.png
deleted file mode 100644
index 8a45248692..0000000000
--- a/art/myweather-snow.png
+++ /dev/null
Binary files differ
diff --git a/art/myweather-storm.png b/art/myweather-storm.png
deleted file mode 100644
index cef334a43c..0000000000
--- a/art/myweather-storm.png
+++ /dev/null
Binary files differ
diff --git a/art/myweather-sun.png b/art/myweather-sun.png
deleted file mode 100644
index 26349305bf..0000000000
--- a/art/myweather-sun.png
+++ /dev/null
Binary files differ
diff --git a/art/myweather-suncloud.png b/art/myweather-suncloud.png
deleted file mode 100644
index a2058e77b0..0000000000
--- a/art/myweather-suncloud.png
+++ /dev/null
Binary files differ
diff --git a/art/new-message.xpm b/art/new-message.xpm
deleted file mode 100644
index add4263a4d..0000000000
--- a/art/new-message.xpm
+++ /dev/null
@@ -1,38 +0,0 @@
-/* XPM */
-static char * new_message_xpm[] = {
-"16 16 19 1",
-" c None",
-". c #000000",
-"+ c #FDFDFD",
-"@ c #E2E2E2",
-"# c #FEFEFE",
-"$ c #FCFCFC",
-"% c #FBFBFB",
-"& c #FFFFFF",
-"* c #E4E4E4",
-"= c #E0E0E0",
-"- c #FAFAFA",
-"; c #F9F9F9",
-"> c #F8F8F8",
-", c #F7F7F7",
-"' c #F5F5F5",
-") c #F4F4F4",
-"! c #DFDFDF",
-"~ c #E8E8E8",
-"{ c #DDDDDD",
-" ",
-" .. ",
-" ..+@. ",
-" ..#+$%. ",
-" ..&####%*. ",
-" .&####==-;. ",
-" .###==###>*. ",
-" .+####==,'. ",
-" .$%#==###'*. ",
-" .--###=='). ",
-" .-;#==####*. ",
-" .>######!!. ",
-" .,####!!.. ",
-" .##=!.. ",
-" .~{.. ",
-" .. "};
diff --git a/art/new_all_day_event.png b/art/new_all_day_event.png
deleted file mode 100644
index ee15651725..0000000000
--- a/art/new_all_day_event.png
+++ /dev/null
Binary files differ
diff --git a/art/new_appointment.png b/art/new_appointment.png
deleted file mode 100644
index 5dc61801da..0000000000
--- a/art/new_appointment.png
+++ /dev/null
Binary files differ
diff --git a/art/new_appointment.xpm b/art/new_appointment.xpm
deleted file mode 100644
index d55eb396e8..0000000000
--- a/art/new_appointment.xpm
+++ /dev/null
@@ -1,126 +0,0 @@
-/* XPM */
-static char * new_appointment_xpm[] = {
-"16 16 107 2",
-" c None",
-". c #000000",
-"+ c #FEFEFE",
-"@ c #FDFDFD",
-"# c #E0E0E0",
-"$ c #C1C1C1",
-"% c #F1F1F1",
-"& c #C3C3C3",
-"* c #FBFBFB",
-"= c #A8A8A8",
-"- c #525252",
-"; c #141414",
-"> c #111111",
-", c #383838",
-"' c #6E6E6E",
-") c #ADADAD",
-"! c #717171",
-"~ c #5D5D5D",
-"{ c #404040",
-"] c #BA8D31",
-"^ c #EAB23D",
-"/ c #403011",
-"( c #E5E5E5",
-"_ c #B4B4B4",
-": c #606060",
-"< c #DADADA",
-"[ c #777777",
-"} c #4B4B49",
-"| c #161616",
-"1 c #EFB63E",
-"2 c #F6D591",
-"3 c #F3B840",
-"4 c #916D26",
-"5 c #F8F8F8",
-"6 c #F3F3F3",
-"7 c #E7E7E7",
-"8 c #B5B5B5",
-"9 c #A1A1A1",
-"0 c #919191",
-"a c #EEB53E",
-"b c #FAE7BC",
-"c c #FCD584",
-"d c #FEC142",
-"e c #FFC243",
-"f c #FFFFFF",
-"g c #CECECE",
-"h c #0B0B0B",
-"i c #B9B9B9",
-"j c #E4E4E4",
-"k c #B88B30",
-"l c #F9E2B2",
-"m c #FDD789",
-"n c #D0D0D0",
-"o c #373737",
-"p c #898989",
-"q c #ABABAB",
-"r c #33332D",
-"s c #CFCFB9",
-"t c #E7AF3C",
-"u c #F9DDA4",
-"v c #FECA5E",
-"w c #D09E36",
-"x c #8B8B8B",
-"y c #F6F6F6",
-"z c #131313",
-"A c #3A2B0F",
-"B c #8F6C25",
-"C c #FDC042",
-"D c #2D220C",
-"E c #6F6F6F",
-"F c #8F8F8F",
-"G c #353535",
-"H c #C3C3AE",
-"I c #DFDFDF",
-"J c #F0F0F0",
-"K c #FCFCFC",
-"L c #363636",
-"M c #AAAAAA",
-"N c #C8C8C8",
-"O c #A9A9A9",
-"P c #E1E1E1",
-"Q c #4A4A4A",
-"R c #FAFAFA",
-"S c #C4C4C4",
-"T c #3C3C36",
-"U c #ADAD9B",
-"V c #CCCCCC",
-"W c #D6D6D6",
-"X c #F4F4F4",
-"Y c #F7F7F7",
-"Z c #BABABA",
-"` c #BFBFBF",
-" . c #C9C9C9",
-".. c #767676",
-"+. c #CBCBCB",
-"@. c #ACACAC",
-"#. c #B3B3B3",
-"$. c #5C5C5C",
-"%. c #C5C5C5",
-"&. c #A0A0A0",
-"*. c #444444",
-"=. c #A7A7A7",
-"-. c #989898",
-";. c #4B4B4B",
-">. c #9C9C9C",
-",. c #A2A2A2",
-"'. c #BBBBBB",
-" . . . . . . . . . ",
-" . + + + + + + @ # $ . ",
-" . + % % % % % % & * = . ",
-" . - ; . > , ' % ) ! ~ { . ",
-" . . ] ^ / ( _ . : < [ } | . ",
-" . . 1 2 3 4 5 6 7 . : 8 9 0 . ",
-" . a b c d e f g h i . 9 j 0 . ",
-". k l m e e e n o p % q r s 0 . ",
-". t u v e e w o x + y < z j 0 . ",
-". A B C e e D E f + F G . H 0 . ",
-". I J K f f n L M @ J N z j 0 . ",
-". O P y + + f n Q R S 9 T U 0 . ",
-" . V W X R K * Y V Z . 9 j 0 . ",
-" . . ` Z ...+.@.#.. $.%.j 0 . ",
-" . . &.@.*.=.-.. ;.>.,.'.&.. ",
-" . . . . . . . . . . . . "};
diff --git a/art/new_contact.xpm b/art/new_contact.xpm
deleted file mode 100644
index 9b7e778102..0000000000
--- a/art/new_contact.xpm
+++ /dev/null
@@ -1,98 +0,0 @@
-/* XPM */
-static char * new_contact_xpm[] = {
-"24 24 71 1",
-" c None",
-". c #000000",
-"+ c #BABABA",
-"@ c #FDFDFD",
-"# c #FCFCFC",
-"$ c #959595",
-"% c #FBFBFB",
-"& c #FAFAFA",
-"* c #F9F9F9",
-"= c #F8F8F8",
-"- c #F7F7F7",
-"; c #E3E3E3",
-"> c #BDBDBD",
-", c #9D9C9A",
-"' c #999896",
-") c #A4A4A3",
-"! c #391414",
-"~ c #B1B1B1",
-"{ c #D4D4D4",
-"] c #E2E2E2",
-"^ c #DCD4C7",
-"/ c #C1B8A6",
-"( c #878682",
-"_ c #BFBFBF",
-": c #7C7C7C",
-"< c #909090",
-"[ c #747474",
-"} c #818181",
-"| c #A8A8A8",
-"1 c #B6B6B6",
-"2 c #F6F6F6",
-"3 c #7F742E",
-"4 c #E1E1E1",
-"5 c #959FA4",
-"6 c #678690",
-"7 c #9A9891",
-"8 c #959490",
-"9 c #F5F5F5",
-"0 c #2B6776",
-"a c #294E70",
-"b c #294770",
-"c c #284D6F",
-"d c #232362",
-"e c #B1B3B4",
-"f c #979797",
-"g c #B0B0B0",
-"h c #AFAFAF",
-"i c #D3D3D3",
-"j c #E0E0E0",
-"k c #27276C",
-"l c #28286D",
-"m c #282A6F",
-"n c #2A5A73",
-"o c #DFDFDF",
-"p c #A2A2A2",
-"q c #B5B5B5",
-"r c #727272",
-"s c #BCBCBC",
-"t c #F4F4F4",
-"u c #DEDEDE",
-"v c #D5D5D5",
-"w c #DDDDDD",
-"x c #BEBEBE",
-"y c #D1D1D1",
-"z c #F3F3F3",
-"A c #DCDCDC",
-"B c #E7E7E7",
-"C c #E6E6E6",
-"D c #E5E5E5",
-"E c #E4E4E4",
-"F c #686868",
-" ",
-" ",
-" ",
-" ",
-" ..................... ",
-" .+@@@@@@@@@@@@@@@@@@#$.",
-" .@%%%%%&&&&*****===--;.",
-" .@%>>,')>&*****==----;.",
-" .@%>>!..,***~={=>----].",
-" .@%>>^/.(**_:<[<}|1-2].",
-" .@%>>^3.'**={=----2224.",
-" .@&>567.8*===----22294.",
-" .@&0abcde==1<f{ghi>99j.",
-" .@&akklmn==----222999o.",
-" .@*****===-pg|qiprs9tu.",
-" .@*vvv=1>----222999ttw.",
-" .@*vxf=p---gi2h$syytzw.",
-" .@*===-----22999tttzzA.",
-" .hBBCDDE;]]]44joouwwAF.",
-" ..................... ",
-" ",
-" ",
-" ",
-" "};
diff --git a/art/new_task-16.png b/art/new_task-16.png
deleted file mode 100644
index 7937d8d53b..0000000000
--- a/art/new_task-16.png
+++ /dev/null
Binary files differ
diff --git a/art/new_task.png b/art/new_task.png
deleted file mode 100644
index 16a1c94b6b..0000000000
--- a/art/new_task.png
+++ /dev/null
Binary files differ
diff --git a/art/next-message.png b/art/next-message.png
deleted file mode 100644
index b040c1f2f2..0000000000
--- a/art/next-message.png
+++ /dev/null
Binary files differ
diff --git a/art/offline.png b/art/offline.png
deleted file mode 100644
index 57bdd27be2..0000000000
--- a/art/offline.png
+++ /dev/null
Binary files differ
diff --git a/art/online.png b/art/online.png
deleted file mode 100644
index 9a6a3980c2..0000000000
--- a/art/online.png
+++ /dev/null
Binary files differ
diff --git a/art/open-in-new-window-16.png b/art/open-in-new-window-16.png
deleted file mode 100644
index 07496e8b81..0000000000
--- a/art/open-in-new-window-16.png
+++ /dev/null
Binary files differ
diff --git a/art/outbox-16.png b/art/outbox-16.png
deleted file mode 100644
index e52e00a7f3..0000000000
--- a/art/outbox-16.png
+++ /dev/null
Binary files differ
diff --git a/art/outbox-full-16.png b/art/outbox-full-16.png
deleted file mode 100644
index cb138fa2b3..0000000000
--- a/art/outbox-full-16.png
+++ /dev/null
Binary files differ
diff --git a/art/outbox-mini.png b/art/outbox-mini.png
deleted file mode 100644
index e52e00a7f3..0000000000
--- a/art/outbox-mini.png
+++ /dev/null
Binary files differ
diff --git a/art/outbox.png b/art/outbox.png
deleted file mode 100644
index 3567691c1f..0000000000
--- a/art/outbox.png
+++ /dev/null
Binary files differ
diff --git a/art/paste.png b/art/paste.png
deleted file mode 100644
index 736900531a..0000000000
--- a/art/paste.png
+++ /dev/null
Binary files differ
diff --git a/art/pattern.png b/art/pattern.png
deleted file mode 100644
index 33abc187ef..0000000000
--- a/art/pattern.png
+++ /dev/null
Binary files differ
diff --git a/art/pgp-signature-bad.png b/art/pgp-signature-bad.png
deleted file mode 100644
index 82318fbb4d..0000000000
--- a/art/pgp-signature-bad.png
+++ /dev/null
Binary files differ
diff --git a/art/pgp-signature-nokey.png b/art/pgp-signature-nokey.png
deleted file mode 100644
index 00250e090c..0000000000
--- a/art/pgp-signature-nokey.png
+++ /dev/null
Binary files differ
diff --git a/art/pgp-signature-ok.png b/art/pgp-signature-ok.png
deleted file mode 100644
index 51782b0e40..0000000000
--- a/art/pgp-signature-ok.png
+++ /dev/null
Binary files differ
diff --git a/art/pin.png b/art/pin.png
deleted file mode 100644
index fff34d7d96..0000000000
--- a/art/pin.png
+++ /dev/null
Binary files differ
diff --git a/art/post-message-16.png b/art/post-message-16.png
deleted file mode 100644
index fbdaa4b2e5..0000000000
--- a/art/post-message-16.png
+++ /dev/null
Binary files differ
diff --git a/art/post-reply-24.png b/art/post-reply-24.png
deleted file mode 100644
index 43b0a229ba..0000000000
--- a/art/post-reply-24.png
+++ /dev/null
Binary files differ
diff --git a/art/previous-message.png b/art/previous-message.png
deleted file mode 100644
index 2163fcbe2a..0000000000
--- a/art/previous-message.png
+++ /dev/null
Binary files differ
diff --git a/art/print-preview-24.png b/art/print-preview-24.png
deleted file mode 100644
index cd6b90e6bd..0000000000
--- a/art/print-preview-24.png
+++ /dev/null
Binary files differ
diff --git a/art/print-preview.xpm b/art/print-preview.xpm
deleted file mode 100644
index a4b36d639d..0000000000
--- a/art/print-preview.xpm
+++ /dev/null
@@ -1,153 +0,0 @@
-/* XPM */
-static char * print_preview_xpm[] = {
-"16 16 134 2",
-" c None",
-". c #000000",
-"+ c #9D9D8D",
-"@ c #CFCFB9",
-"# c #C4C4AF",
-"$ c #8D8D7F",
-"% c #353530",
-"& c #828282",
-"* c #9C9C8C",
-"= c #E2E2D0",
-"- c #EDEDE7",
-"; c #C0C0AC",
-"> c #B2B29F",
-", c #828274",
-"' c #4C4C44",
-") c #FFFFFF",
-"! c #EFEFEF",
-"~ c #ECECEC",
-"{ c #090908",
-"] c #D5D5BF",
-"^ c #FBFBFA",
-"/ c #C3C3AE",
-"( c #B5B5A2",
-"_ c #A6A695",
-": c #959586",
-"< c #080807",
-"[ c #E3E3E3",
-"} c #CDCDCD",
-"| c #D7D7D7",
-"1 c #090909",
-"2 c #CACAB5",
-"3 c #DDDDD0",
-"4 c #B7B7A4",
-"5 c #AAAA98",
-"6 c #9B9B8B",
-"7 c #8C8C7D",
-"8 c #0A0A09",
-"9 c #E9E9E9",
-"0 c #EBEBEB",
-"a c #DBDBDB",
-"b c #929283",
-"c c #BABAA7",
-"d c #ADAD9B",
-"e c #9F9F8E",
-"f c #909081",
-"g c #727266",
-"h c #52524C",
-"i c #A4A4A4",
-"j c #34342F",
-"k c #878779",
-"l c #A0A090",
-"m c #737367",
-"n c #010101",
-"o c #575757",
-"p c #A6A6A6",
-"q c #4B4B43",
-"r c #414141",
-"s c #777777",
-"t c #979797",
-"u c #BCBBBB",
-"v c #D4D4D3",
-"w c #878787",
-"x c #323232",
-"y c #A5A5A5",
-"z c #D0D0CF",
-"A c #B5B5B5",
-"B c #C2C2C2",
-"C c #FBFBFB",
-"D c #FAFAFA",
-"E c #999999",
-"F c #363636",
-"G c #9E9E9E",
-"H c #ECECEB",
-"I c #AEADAB",
-"J c #F7F7F7",
-"K c #E5E5E4",
-"L c #8D8D8D",
-"M c #F1F1F1",
-"N c #A0A0A0",
-"O c #E2E2E2",
-"P c #D9D9D8",
-"Q c #898988",
-"R c #0C0C0C",
-"S c #302F2F",
-"T c #A4A3A1",
-"U c #CCCAC6",
-"V c #1B1B1B",
-"W c #969594",
-"X c #D6D4D2",
-"Y c #DDDBDA",
-"Z c #DCDCDB",
-"` c #DEDDDD",
-" . c #DFDEDD",
-".. c #DDDCDB",
-"+. c #DBDBD9",
-"@. c #7E7E7D",
-"#. c #383838",
-"$. c #555453",
-"%. c #9F9E9A",
-"&. c #A8A7A6",
-"*. c #9E9D9C",
-"=. c #615E59",
-"-. c #54514E",
-";. c #54524E",
-">. c #514F4B",
-",. c #52504C",
-"'. c #504D49",
-"). c #4D4B47",
-"!. c #4F4D49",
-"~. c #514F4C",
-"{. c #535251",
-"]. c #8E8D8A",
-"^. c #B4B3B1",
-"/. c #C0BFBC",
-"(. c #B9B8B5",
-"_. c #B3B1AF",
-":. c #B1B1AE",
-"<. c #AFAEAC",
-"[. c #B0AEAC",
-"}. c #ACACA9",
-"|. c #A6A6A4",
-"1. c #ABAAA7",
-"2. c #AEADAA",
-"3. c #AAA9A6",
-"4. c #201F1E",
-"5. c #403F3D",
-"6. c #444341",
-"7. c #454542",
-"8. c #42423F",
-"9. c #3F3E3C",
-"0. c #3A3936",
-"a. c #393835",
-"b. c #31302D",
-"c. c #1E1D1B",
-" . . . . ",
-" . + @ # $ % & . . . . ",
-" . * = - ; > , ' ) ! ~ . ",
-" { ] ^ / ( _ : < [ } | . ",
-" 1 2 3 4 5 6 7 8 9 0 a . ",
-" . b c d e f g h . i a . ",
-" j k l b m n o p 0 a . ",
-" q 8 8 r s n . t a . . ",
-" . u v ) 9 9 w n x y z A . ",
-" . B C ) D ) D C E n F G H I . ",
-" . D J K L M N O P Q R S T U V ",
-" . W X Y Z ` ...P +.@.#.$.%.. ",
-" . &.*.=.-.;.>.,.'.).!.~.{.].. ",
-" . ^./.(._.:.<.[.}.|.1.2.<.3.. ",
-" . 4.5.6.7.7.7.8.5.9.0.a.b.c.. ",
-" . . . . . . . . . . . . . "};
diff --git a/art/print.png b/art/print.png
deleted file mode 100644
index f223a1146d..0000000000
--- a/art/print.png
+++ /dev/null
Binary files differ
diff --git a/art/print.xpm b/art/print.xpm
deleted file mode 100644
index da46eb0157..0000000000
--- a/art/print.xpm
+++ /dev/null
@@ -1,107 +0,0 @@
-/* XPM */
-static char * print_xpm[] = {
-"16 16 88 1",
-" c None",
-". c #000000",
-"+ c #FFFFFF",
-"@ c #ECECEC",
-"# c #353535",
-"$ c #D3D3D3",
-"% c #131313",
-"& c #C7C7C7",
-"* c #D7D7D7",
-"= c #EBEBEB",
-"- c #E9E9E9",
-"; c #DBDBDB",
-"> c #4D4D4D",
-", c #A4A4A4",
-"' c #414141",
-") c #8C8C8C",
-"! c #979797",
-"~ c #BCBBBB",
-"{ c #D4D4D3",
-"] c #D0D0CF",
-"^ c #B5B5B5",
-"/ c #C2C2C2",
-"( c #FBFBFB",
-"_ c #FAFAFA",
-": c #F8F8F8",
-"< c #F4F4F3",
-"[ c #ECECEB",
-"} c #AEADAB",
-"| c #F7F7F7",
-"1 c #E5E5E4",
-"2 c #8D8D8D",
-"3 c #F1F1F1",
-"4 c #A0A0A0",
-"5 c #E2E2E2",
-"6 c #D9D9D8",
-"7 c #DEDDDC",
-"8 c #DCDCDA",
-"9 c #D8D7D4",
-"0 c #B3B2B0",
-"a c #CCCAC6",
-"b c #1B1B1B",
-"c c #969594",
-"d c #D6D4D2",
-"e c #DDDBDA",
-"f c #DCDCDB",
-"g c #DEDDDD",
-"h c #DFDEDD",
-"i c #DDDCDB",
-"j c #DBDBD9",
-"k c #DAD9D7",
-"l c #D9D8D6",
-"m c #81807E",
-"n c #9F9E9A",
-"o c #A8A7A6",
-"p c #9E9D9C",
-"q c #615E59",
-"r c #54514E",
-"s c #54524E",
-"t c #514F4B",
-"u c #52504C",
-"v c #504D49",
-"w c #4D4B47",
-"x c #4F4D49",
-"y c #514F4C",
-"z c #939291",
-"A c #9B9A97",
-"B c #B4B3B1",
-"C c #C0BFBC",
-"D c #B9B8B5",
-"E c #B3B1AF",
-"F c #B1B1AE",
-"G c #AFAEAC",
-"H c #B0AEAC",
-"I c #ACACA9",
-"J c #A6A6A4",
-"K c #ABAAA7",
-"L c #AEADAA",
-"M c #AAA9A6",
-"N c #201F1E",
-"O c #403F3D",
-"P c #444341",
-"Q c #454542",
-"R c #42423F",
-"S c #3F3E3C",
-"T c #3A3936",
-"U c #393835",
-"V c #31302D",
-"W c #1E1D1B",
-" ",
-" ......... ",
-" .++++++@. ",
-" .+#$.%&*. ",
-" .+=---=;. ",
-" .+>.=.,;. ",
-" .+=====;. ",
-" ..+'=).!;.. ",
-" .~{+------]^. ",
-" ./(+_+_((_:<[}.",
-" ._|1234567890ab",
-" .cdefghi6jklmn.",
-" .opqrstuvwxyzA.",
-" .BCDEFGHIJKLGM.",
-" .NOPQQQROSTUVW.",
-" ............. "};
diff --git a/art/priority-high.xpm b/art/priority-high.xpm
deleted file mode 100644
index 884c8b8236..0000000000
--- a/art/priority-high.xpm
+++ /dev/null
@@ -1,22 +0,0 @@
-/* XPM */
-static char * priority_high_xpm[] = {
-"16 16 3 1",
-" c None",
-". c #FFFFFF",
-"X c #A7453E",
-" ",
-" ",
-" . ",
-" .X. ",
-" .XXX. ",
-" .XXX. ",
-" .XXX. ",
-" .XX. ",
-" .XX. ",
-" .X. ",
-" .. ",
-" .XX. ",
-" .XX. ",
-" .. ",
-" ",
-" "};
diff --git a/art/priority-low.xpm b/art/priority-low.xpm
deleted file mode 100644
index ad53e9e0cc..0000000000
--- a/art/priority-low.xpm
+++ /dev/null
@@ -1,21 +0,0 @@
-/* XPM */
-static char * priority_low_xpm[] = {
-"16 16 2 1",
-" c None",
-". c #21405A",
-" ",
-" ",
-" ",
-" .. ",
-" .. ",
-" .. ",
-" .. ",
-" .. ",
-" ...... ",
-" .... ",
-" .... ",
-" .. ",
-" .. ",
-" ",
-" ",
-" "};
diff --git a/art/properties-16.png b/art/properties-16.png
deleted file mode 100644
index 7586e3ab27..0000000000
--- a/art/properties-16.png
+++ /dev/null
Binary files differ
diff --git a/art/public-folder-mini.png b/art/public-folder-mini.png
deleted file mode 100644
index 087eca4a85..0000000000
--- a/art/public-folder-mini.png
+++ /dev/null
Binary files differ
diff --git a/art/public-folder.png b/art/public-folder.png
deleted file mode 100644
index b23d9f805f..0000000000
--- a/art/public-folder.png
+++ /dev/null
Binary files differ
diff --git a/art/rdf.png b/art/rdf.png
deleted file mode 100644
index b4bdbafa99..0000000000
--- a/art/rdf.png
+++ /dev/null
Binary files differ
diff --git a/art/receive-24.png b/art/receive-24.png
deleted file mode 100644
index a09bf6a596..0000000000
--- a/art/receive-24.png
+++ /dev/null
Binary files differ
diff --git a/art/recur.xpm b/art/recur.xpm
deleted file mode 100644
index bb34fa4568..0000000000
--- a/art/recur.xpm
+++ /dev/null
@@ -1,21 +0,0 @@
-/* XPM */
-static char * recur_xpm[] = {
-"16 16 2 1",
-" c None",
-". c #333366",
-" ",
-" ",
-" .. ..... ",
-" ... .... ",
-" .. .... ",
-" .. ..... ",
-" .. . .. ",
-" .. .. ",
-" .. . .. ",
-" ..... .. ",
-" .... .. ",
-" .... ... ",
-" ..... .. ",
-" ",
-" ",
-" "};
diff --git a/art/refresh-nntp-folders-24.png b/art/refresh-nntp-folders-24.png
deleted file mode 100644
index b1c339a973..0000000000
--- a/art/refresh-nntp-folders-24.png
+++ /dev/null
Binary files differ
diff --git a/art/remove-nntp-folder-24.png b/art/remove-nntp-folder-24.png
deleted file mode 100644
index 5500bdec23..0000000000
--- a/art/remove-nntp-folder-24.png
+++ /dev/null
Binary files differ
diff --git a/art/reply-to-all.png b/art/reply-to-all.png
deleted file mode 100644
index 1a3ccc1740..0000000000
--- a/art/reply-to-all.png
+++ /dev/null
Binary files differ
diff --git a/art/reply.png b/art/reply.png
deleted file mode 100644
index 137beb9e90..0000000000
--- a/art/reply.png
+++ /dev/null
Binary files differ
diff --git a/art/reply.xpm b/art/reply.xpm
deleted file mode 100644
index 681801c7d7..0000000000
--- a/art/reply.xpm
+++ /dev/null
@@ -1,46 +0,0 @@
-/* XPM */
-static char * reply_xpm[] = {
-"16 16 27 1",
-" c None",
-". c #010101",
-"+ c #2F2F2F",
-"@ c #A7A4A0",
-"# c #FCFCFC",
-"$ c #64625F",
-"% c #FFFFFF",
-"& c #5D5B57",
-"* c #868580",
-"= c #E5E2DB",
-"- c #FBFBF8",
-"; c #716E6B",
-"> c #000000",
-", c #FBFAF7",
-"' c #A5A29D",
-") c #990000",
-"! c #EFEFEF",
-"~ c #CCCCCC",
-"{ c #797873",
-"] c #7D7A77",
-"^ c #F7F5F1",
-"/ c #090808",
-"( c #D7D4CE",
-"_ c #D8D5CF",
-": c #7F0000",
-"< c #181818",
-"[ c #090909",
-" ",
-" ",
-" ",
-" .+......... ",
-" .@#########$. ",
-" .%&%%%%%%%*=. ",
-" .%-;%>>>>>>>>> ",
-" .%--;>%%%%%%%> ",
-" .%-,'>%))))!~> ",
-" .%,{->%)))!!~> ",
-" .%]-^>%))))!~> ",
-" ./(__>%)!)):~> ",
-" ....>%!!!::~> ",
-" >%~~~~~~< ",
-" >>[>>>>>> ",
-" "};
diff --git a/art/reply_to_all.xpm b/art/reply_to_all.xpm
deleted file mode 100644
index be5c633f2a..0000000000
--- a/art/reply_to_all.xpm
+++ /dev/null
@@ -1,52 +0,0 @@
-/* XPM */
-static char * reply_to_all_xpm[] = {
-"16 16 33 1",
-" c None",
-". c #010101",
-"+ c #2F2F2F",
-"@ c #A7A4A0",
-"# c #FCFCFC",
-"$ c #64625F",
-"% c #FFFFFF",
-"& c #5D5B57",
-"* c #868580",
-"= c #E5E2DB",
-"- c #FBFBF8",
-"; c #716E6B",
-"> c #62605C",
-", c #F8F7F2",
-"' c #DDDAD4",
-") c #F7F5F1",
-"! c #FBFAF7",
-"~ c #A5A29D",
-"{ c #000000",
-"] c #797873",
-"^ c #7D7A77",
-"/ c #FAF9F6",
-"( c #F8F6F2",
-"_ c #990000",
-": c #EFEFEF",
-"< c #CCCCCC",
-"[ c #090808",
-"} c #D7D4CE",
-"| c #D8D5CF",
-"1 c #D6D3CD",
-"2 c #7F0000",
-"3 c #181818",
-"4 c #090909",
-" ",
-" ",
-" .+......... ",
-".@#########$. ",
-".%&%%%%%%%*=.. ",
-".%-;%%%%%>,'.$. ",
-".%--;%%%;-)'.=. ",
-".%-!~;-{{{{{{{{{",
-".%!]--;{%%%%%%%{",
-".%^-)/({%____:<{",
-".[}|||1{%___::<{",
-" ......{%____:<{",
-" .[}||{%_:__2<{",
-" ....{%:::22<{",
-" {%<<<<<<3",
-" {{4{{{{{{"};
diff --git a/art/save-16.png b/art/save-16.png
deleted file mode 100644
index 20a27ca2a1..0000000000
--- a/art/save-16.png
+++ /dev/null
Binary files differ
diff --git a/art/save-24.png b/art/save-24.png
deleted file mode 100644
index 51375a3f40..0000000000
--- a/art/save-24.png
+++ /dev/null
Binary files differ
diff --git a/art/save-as-16.png b/art/save-as-16.png
deleted file mode 100644
index 3b9612efdf..0000000000
--- a/art/save-as-16.png
+++ /dev/null
Binary files differ
diff --git a/art/save.xpm b/art/save.xpm
deleted file mode 100644
index 7b1812943e..0000000000
--- a/art/save.xpm
+++ /dev/null
@@ -1,45 +0,0 @@
-/* XPM */
-static char * 16_save_xpm[] = {
-"16 16 26 1",
-" c None",
-". c #000000",
-"+ c #B8CADB",
-"@ c #C5D4E3",
-"# c #687B8D",
-"$ c #D8D8D8",
-"% c #CFDBE6",
-"& c #9DB8D2",
-"* c #728699",
-"= c #BCCEDF",
-"- c #FFFFFF",
-"; c #D2DEEA",
-"> c #C0D1E2",
-", c #CFDBE7",
-"' c #798EA3",
-") c #D0DDE9",
-"! c #B7CBDE",
-"~ c #B6CADD",
-"{ c #B7CADD",
-"] c #BACCDF",
-"^ c #9FB9D3",
-"/ c #7E94A9",
-"( c #A4BDD5",
-"_ c #BABABA",
-": c #556474",
-"< c #2A303A",
-" ",
-" ",
-" ............ ",
-" .+@#$$$$$$%&*. ",
-" .=&#------;&*. ",
-" .>&#$$$$$$,&*. ",
-" .>&'------)&*. ",
-" .>&&!~~{{]^&*. ",
-" .>&&&&&&&&&&*. ",
-" .>&&//////&&*. ",
-" .>(/$$_$-$/&*. ",
-" .>&/$_$-/$/&*. ",
-" .>&/$_-$/$/&*. ",
-" .=&/_$-$$$/**. ",
-" .:........<. ",
-" "};
diff --git a/art/schedule-meeting-16.png b/art/schedule-meeting-16.png
deleted file mode 100644
index 7081e2fead..0000000000
--- a/art/schedule-meeting-16.png
+++ /dev/null
Binary files differ
diff --git a/art/schedule-meeting-16.xpm b/art/schedule-meeting-16.xpm
deleted file mode 100644
index 7cc7911439..0000000000
--- a/art/schedule-meeting-16.xpm
+++ /dev/null
@@ -1,178 +0,0 @@
-/* XPM */
-static char * schedule_meeting_16_xpm[] = {
-"16 16 159 2",
-" c None",
-". c #000000",
-"+ c #8A8575",
-"@ c #EEDEA6",
-"# c #F0DD96",
-"$ c #EFDB95",
-"% c #AFA06B",
-"& c #655C38",
-"* c #0B0B0B",
-"= c #A49D83",
-"- c #F1DD97",
-"; c #F2E5B3",
-"> c #F3E9C1",
-", c #EBDEB0",
-"' c #B4A981",
-") c #C6C6C6",
-"! c #535353",
-"~ c #131313",
-"{ c #EFDE9F",
-"] c #F1E1AA",
-"^ c #F8F3D9",
-"/ c #FBF3D5",
-"( c #EAE1BE",
-"_ c #948D73",
-": c #161615",
-"< c #4D4D4D",
-"[ c #B7B7B7",
-"} c #655D53",
-"| c #56493A",
-"1 c #564838",
-"2 c #514433",
-"3 c #D9C993",
-"4 c #F8F1CF",
-"5 c #FDF7DB",
-"6 c #FAF3D3",
-"7 c #E6DCB9",
-"8 c #867F66",
-"9 c #2D2C2A",
-"0 c #978774",
-"a c #D5B792",
-"b c #D2B38D",
-"c c #C7A882",
-"d c #B39672",
-"e c #2B2824",
-"f c #EEE7CF",
-"g c #F4EBC9",
-"h c #FEF6D5",
-"i c #FBF2CD",
-"j c #E7DCB5",
-"k c #857D63",
-"l c #5A544D",
-"m c #B89F80",
-"n c #D8BA94",
-"o c #CAAB84",
-"p c #C2A27B",
-"q c #54493C",
-"r c #C5B887",
-"s c #E9E0BF",
-"t c #FAEFC8",
-"u c #FAEDC0",
-"v c #E5D8A9",
-"w c #887F5F",
-"x c #686158",
-"y c #BFA482",
-"z c #D2B38E",
-"A c #CEAF89",
-"B c #C7A781",
-"C c #C2A17A",
-"D c #726555",
-"E c #B6A977",
-"F c #CAC4AD",
-"G c #B0A47F",
-"H c #AEA277",
-"I c #4B473C",
-"J c #8F8A82",
-"K c #BDA382",
-"L c #CCAD87",
-"M c #C9A983",
-"N c #C4A47D",
-"O c #BE9E77",
-"P c #6E6A64",
-"Q c #495946",
-"R c #3D5146",
-"S c #32483E",
-"T c #0F0F05",
-"U c #77736D",
-"V c #988A79",
-"W c #C9AA86",
-"X c #B29573",
-"Y c #856F55",
-"Z c #69726C",
-"` c #A4D3C5",
-" . c #8DCDBA",
-".. c #7BBDA9",
-"+. c #376052",
-"@. c #15241E",
-"#. c #443C31",
-"$. c #403528",
-"%. c #3C3329",
-"&. c #5A6A63",
-"*. c #85C9B7",
-"=. c #75C1AB",
-"-. c #6AB89F",
-";. c #5FAE93",
-">. c #468A73",
-",. c #173128",
-"'. c #303030",
-"). c #9A9A9A",
-"!. c #C5D2DE",
-"~. c #B7C9DA",
-"{. c #667685",
-"]. c #23292F",
-"^. c #7A998C",
-"/. c #72B7A2",
-"(. c #7EBBA7",
-"_. c #5DB093",
-":. c #53A688",
-"<. c #3A7D65",
-"[. c #2E2E2E",
-"}. c #959799",
-"|. c #B7C9DB",
-"1. c #90ABC5",
-"2. c #89A5BF",
-"3. c #809DB7",
-"4. c #758FA7",
-"5. c #171E24",
-"6. c #749786",
-"7. c #549F85",
-"8. c #85B5A4",
-"9. c #4DA584",
-"0. c #449B7A",
-"a. c #2F745A",
-"b. c #BFCFDD",
-"c. c #7F96AB",
-"d. c #85A0BA",
-"e. c #7B97B1",
-"f. c #728FA9",
-"g. c #69849D",
-"h. c #404E5C",
-"i. c #6B927E",
-"j. c #49967A",
-"k. c #7EB09D",
-"l. c #409A78",
-"m. c #38916F",
-"n. c #277153",
-"o. c #ACBFD0",
-"p. c #687F95",
-"q. c #92A9BD",
-"r. c #6F8BA5",
-"s. c #66839D",
-"t. c #577188",
-"u. c #596774",
-"v. c #A1B5C6",
-"w. c #4F6376",
-"x. c #8FA4B7",
-"y. c #607D97",
-"z. c #57758F",
-"A. c #49657D",
-"B. c #5A6773",
-" . . . . . . ",
-" . + @ # $ % & . * . . . . ",
-". = - ; > , ' . ) ! ~ . . . . ",
-". { ] ^ / ( _ : < [ } | 1 2 . . ",
-". 3 4 5 6 7 8 . 9 0 a b c d e . ",
-". f g h i j k . l m n b o p q . ",
-". r s t u v w . x y z A B C D . ",
-" . E F G H I . J K L M N O P . ",
-" . Q R S T . U V W p X Y . . ",
-" . Z ` ...+.@.. . #.$.%.. ",
-". &.*.=.-.;.>.,.'.).!.~.{.].. ",
-". ^./.(._.:.<.[.}.|.1.2.3.4.5.. ",
-". 6.7.8.9.0.a.. b.c.d.e.f.g.h.. ",
-". i.j.k.l.m.n.. o.p.q.r.s.t.u.. ",
-". . . . . . . . v.w.x.y.z.A.B.. ",
-" . . . . . . . . . "};
diff --git a/art/schedule-meeting-24.png b/art/schedule-meeting-24.png
deleted file mode 100644
index 237bac1f96..0000000000
--- a/art/schedule-meeting-24.png
+++ /dev/null
Binary files differ
diff --git a/art/score-high.xpm b/art/score-high.xpm
deleted file mode 100644
index bb7bd47562..0000000000
--- a/art/score-high.xpm
+++ /dev/null
@@ -1,26 +0,0 @@
-/* XPM */
-static char * score_high_xpm[] = {
-"16 16 7 1",
-" c None",
-". c #BCBCBC",
-"+ c #00FF00",
-"@ c #000000",
-"# c #17D1EA",
-"$ c #FFFFFF",
-"% c #EF9815",
-" ",
-" .+ ",
-" @@@ .++ ",
-" @#@#@ .++ ",
-" @$%$@ .++ ",
-" @$$$@ . + ",
-" @@$@@ . ",
-" @@$$$@@ . ",
-" @@$$$$$@@@@ ",
-" @@$$$$$@@ . ",
-" @@$$$$$@ . ",
-" @@$$$$$@ . ",
-" @$$$$$@ . ",
-" %%$%% . ",
-" %% %% . ",
-" "};
diff --git a/art/score-higher.xpm b/art/score-higher.xpm
deleted file mode 100644
index 696e74bed5..0000000000
--- a/art/score-higher.xpm
+++ /dev/null
@@ -1,26 +0,0 @@
-/* XPM */
-static char * score_higher_xpm[] = {
-"16 16 7 1",
-" c None",
-". c #BCBCBC",
-"+ c #00FF00",
-"@ c #000000",
-"# c #17D1EA",
-"$ c #FFFFFF",
-"% c #EF9815",
-" ",
-" .++ ",
-" @@@ .++++",
-" @#@#@ .++++",
-" @$%$@ .++++",
-" @$$$@ . ++",
-" @@$@@ . ",
-" @@$$$@@ . ",
-" @@$$$$$@@@@ ",
-" @@$$$$$@@ . ",
-" @@$$$$$@ . ",
-" @@$$$$$@ . ",
-" @$$$$$@ . ",
-" %%$%% . ",
-" %% %% . ",
-" "};
diff --git a/art/score-highest.xpm b/art/score-highest.xpm
deleted file mode 100644
index d8dab65079..0000000000
--- a/art/score-highest.xpm
+++ /dev/null
@@ -1,26 +0,0 @@
-/* XPM */
-static char * score_highest_xpm[] = {
-"16 16 7 1",
-" c None",
-". c #BCBCBC",
-"+ c #00FF00",
-"@ c #000000",
-"# c #17D1EA",
-"$ c #FFFFFF",
-"% c #EF9815",
-" ",
-" .++++",
-" @@@ .++++",
-" @#@#@ .++++",
-" @$%$@ .++++",
-" @$$$@ . ",
-" @@$@@ . ",
-" @@$$$@@ . ",
-" @@$$$$$@@@@ ",
-" @@$$$$$@@ . ",
-" @@$$$$$@ . ",
-" @@$$$$$@ . ",
-" @$$$$$@ . ",
-" %%$%% . ",
-" %% %% . ",
-" "};
diff --git a/art/score-low.xpm b/art/score-low.xpm
deleted file mode 100644
index e071741adc..0000000000
--- a/art/score-low.xpm
+++ /dev/null
@@ -1,26 +0,0 @@
-/* XPM */
-static char * score_low_xpm[] = {
-"16 16 7 1",
-" c None",
-". c #BCBCBC",
-"+ c #FF0000",
-"@ c #000000",
-"# c #17D1EA",
-"$ c #FFFFFF",
-"% c #EF9815",
-" ",
-" .+ ",
-" @@@ .++ ",
-" @#@#@ .++ ",
-" @$%$@ .++ ",
-" @$$$@ . + ",
-" @@$@@ . ",
-" @@$$$@@ . ",
-" @@$$$$$@@@@ ",
-" @@$$$$$@@ . ",
-" @@$$$$$@ . ",
-" @@$$$$$@ . ",
-" @$$$$$@ . ",
-" %%$%% . ",
-" %% %% . ",
-" "};
diff --git a/art/score-lower.xpm b/art/score-lower.xpm
deleted file mode 100644
index 74da90d670..0000000000
--- a/art/score-lower.xpm
+++ /dev/null
@@ -1,26 +0,0 @@
-/* XPM */
-static char * score_lower_xpm[] = {
-"16 16 7 1",
-" c None",
-". c #BCBCBC",
-"+ c #FF0000",
-"@ c #000000",
-"# c #17D1EA",
-"$ c #FFFFFF",
-"% c #EF9815",
-" ",
-" .++ ",
-" @@@ .++++",
-" @#@#@ .++++",
-" @$%$@ .++++",
-" @$$$@ . ++",
-" @@$@@ . ",
-" @@$$$@@ . ",
-" @@$$$$$@@@@ ",
-" @@$$$$$@@ . ",
-" @@$$$$$@ . ",
-" @@$$$$$@ . ",
-" @$$$$$@ . ",
-" %%$%% . ",
-" %% %% . ",
-" "};
diff --git a/art/score-lowest.xpm b/art/score-lowest.xpm
deleted file mode 100644
index 9beee1849f..0000000000
--- a/art/score-lowest.xpm
+++ /dev/null
@@ -1,26 +0,0 @@
-/* XPM */
-static char * score_lowest_xpm[] = {
-"16 16 7 1",
-" c None",
-". c #BCBCBC",
-"+ c #FF0000",
-"@ c #000000",
-"# c #17D1EA",
-"$ c #FFFFFF",
-"% c #EF9815",
-" ",
-" .++++",
-" @@@ .++++",
-" @#@#@ .++++",
-" @$%$@ .++++",
-" @$$$@ . ",
-" @@$@@ . ",
-" @@$$$@@ . ",
-" @@$$$$$@@@@ ",
-" @@$$$$$@@ . ",
-" @@$$$$$@ . ",
-" @@$$$$$@ . ",
-" @$$$$$@ . ",
-" %%$%% . ",
-" %% %% . ",
-" "};
diff --git a/art/score-normal.xpm b/art/score-normal.xpm
deleted file mode 100644
index 82b618cb8d..0000000000
--- a/art/score-normal.xpm
+++ /dev/null
@@ -1,24 +0,0 @@
-/* XPM */
-static char * score_normal_xpm[] = {
-"16 16 5 1",
-" c None",
-". c #000000",
-"+ c #17D1EA",
-"@ c #FFFFFF",
-"# c #EF9815",
-" ",
-" ",
-" ... ",
-" .+.+. ",
-" .@#@. ",
-" .@@@. ",
-" ..@.. ",
-" ..@@@.. ",
-" ..@@@@@.. ",
-" ..@@@@@.. ",
-" ..@@@@@.. ",
-" ..@@@@@.. ",
-" .@@@@@. ",
-" ##@## ",
-" ## ## ",
-" "};
diff --git a/art/search-16.png b/art/search-16.png
deleted file mode 100644
index 6e9837d8ee..0000000000
--- a/art/search-16.png
+++ /dev/null
Binary files differ
diff --git a/art/search-and-replace-16.png b/art/search-and-replace-16.png
deleted file mode 100644
index 5daa4c39a0..0000000000
--- a/art/search-and-replace-16.png
+++ /dev/null
Binary files differ
diff --git a/art/send-16.png b/art/send-16.png
deleted file mode 100644
index 1ade9e9b98..0000000000
--- a/art/send-16.png
+++ /dev/null
Binary files differ
diff --git a/art/send-24-receive.png b/art/send-24-receive.png
deleted file mode 100644
index a6e4354ddf..0000000000
--- a/art/send-24-receive.png
+++ /dev/null
Binary files differ
diff --git a/art/send-24.png b/art/send-24.png
deleted file mode 100644
index bc5800ca62..0000000000
--- a/art/send-24.png
+++ /dev/null
Binary files differ
diff --git a/art/send-48-receive.png b/art/send-48-receive.png
deleted file mode 100644
index 53f8b15d9a..0000000000
--- a/art/send-48-receive.png
+++ /dev/null
Binary files differ
diff --git a/art/send-later-16.png b/art/send-later-16.png
deleted file mode 100644
index 3b2bb791d4..0000000000
--- a/art/send-later-16.png
+++ /dev/null
Binary files differ
diff --git a/art/send-receive.xpm b/art/send-receive.xpm
deleted file mode 100644
index 27ad312dee..0000000000
--- a/art/send-receive.xpm
+++ /dev/null
@@ -1,56 +0,0 @@
-/* XPM */
-static char * send_receive_xpm[] = {
-"16 16 37 1",
-" c None",
-". c #000000",
-"+ c #F8D4CD",
-"@ c #F8D6CF",
-"# c #ED9280",
-"$ c #B33118",
-"% c #F7CEC6",
-"& c #C1351A",
-"* c #A92F16",
-"= c #DD3D1E",
-"- c #E86F57",
-"; c #EC8A77",
-"> c #A12D16",
-", c #852512",
-"' c #F3B3A6",
-") c #F3B8AC",
-"! c #F5C4BA",
-"~ c #D2DCE5",
-"{ c #ABBECE",
-"] c #547693",
-"^ c #E66349",
-"/ c #CFDAE4",
-"( c #A2B7C9",
-"_ c #425D73",
-": c #CCD7E1",
-"< c #C9D5E0",
-"[ c #D5DEE6",
-"} c #A9BDCE",
-"| c #B1C3D2",
-"1 c #9BB2C6",
-"2 c #4D6C86",
-"3 c #577A98",
-"4 c #4F6F8A",
-"5 c #456178",
-"6 c #DBE3EA",
-"7 c #496780",
-"8 c #DAE2E9",
-" . ",
-" .+. ",
-" .@#$. ",
-" .%##&*. ",
-".%=-;>,,. ",
-"...'#>... ",
-" .)#>. ..... ",
-" .!#>. .~{]. ",
-" .#^>. ./(_. ",
-" ..... .:(_. ",
-" ...<(_...",
-" .[}|1232.",
-" .[((45. ",
-" .6(7. ",
-" .8. ",
-" . "};
diff --git a/art/send.png b/art/send.png
deleted file mode 100644
index bc5800ca62..0000000000
--- a/art/send.png
+++ /dev/null
Binary files differ
diff --git a/art/service-close.png b/art/service-close.png
deleted file mode 100644
index d8e7cea744..0000000000
--- a/art/service-close.png
+++ /dev/null
Binary files differ
diff --git a/art/service-configure.png b/art/service-configure.png
deleted file mode 100644
index 8c56dc4c7a..0000000000
--- a/art/service-configure.png
+++ /dev/null
Binary files differ
diff --git a/art/service-down-disabled.png b/art/service-down-disabled.png
deleted file mode 100644
index f6742ff105..0000000000
--- a/art/service-down-disabled.png
+++ /dev/null
Binary files differ
diff --git a/art/service-down.png b/art/service-down.png
deleted file mode 100644
index 49f532f527..0000000000
--- a/art/service-down.png
+++ /dev/null
Binary files differ
diff --git a/art/service-left-disabled.png b/art/service-left-disabled.png
deleted file mode 100644
index fc4256346b..0000000000
--- a/art/service-left-disabled.png
+++ /dev/null
Binary files differ
diff --git a/art/service-left.png b/art/service-left.png
deleted file mode 100644
index 38fe293e39..0000000000
--- a/art/service-left.png
+++ /dev/null
Binary files differ
diff --git a/art/service-right-disabled.png b/art/service-right-disabled.png
deleted file mode 100644
index 848c2a499c..0000000000
--- a/art/service-right-disabled.png
+++ /dev/null
Binary files differ
diff --git a/art/service-right.png b/art/service-right.png
deleted file mode 100644
index 7fdabac13d..0000000000
--- a/art/service-right.png
+++ /dev/null
Binary files differ
diff --git a/art/service-up-disabled.png b/art/service-up-disabled.png
deleted file mode 100644
index 6258caa5d9..0000000000
--- a/art/service-up-disabled.png
+++ /dev/null
Binary files differ
diff --git a/art/service-up.png b/art/service-up.png
deleted file mode 100644
index a24b336c6d..0000000000
--- a/art/service-up.png
+++ /dev/null
Binary files differ
diff --git a/art/settings-16.png b/art/settings-16.png
deleted file mode 100644
index b391a0e839..0000000000
--- a/art/settings-16.png
+++ /dev/null
Binary files differ
diff --git a/art/settings.png b/art/settings.png
deleted file mode 100644
index f3e8bfd4fc..0000000000
--- a/art/settings.png
+++ /dev/null
Binary files differ
diff --git a/art/show_all_messages.xpm b/art/show_all_messages.xpm
deleted file mode 100644
index f38a42aebf..0000000000
--- a/art/show_all_messages.xpm
+++ /dev/null
@@ -1,27 +0,0 @@
-/* XPM */
-static char * show_all_messages_xpm[] = {
-"16 16 8 1",
-" c None",
-". c #000000",
-"+ c #9DB8D2",
-"@ c #FFFFFF",
-"# c #89A1B9",
-"$ c #859DB4",
-"% c #CACACA",
-"& c #8199AF",
-" ",
-" ",
-" ",
-" ",
-" . . ",
-" . . . .",
-" . . .",
-" ........... ",
-" .+@+. .+@+. ",
-" .#+$. .%+&. ",
-" ... ... ",
-" ",
-" ",
-" ",
-" ",
-" "};
diff --git a/art/splash-1-0.png b/art/splash-1-0.png
deleted file mode 100644
index 13dabfd980..0000000000
--- a/art/splash-1-0.png
+++ /dev/null
Binary files differ
diff --git a/art/splash.png b/art/splash.png
deleted file mode 100644
index 440f86d8c1..0000000000
--- a/art/splash.png
+++ /dev/null
Binary files differ
diff --git a/art/stock-edit-16.png b/art/stock-edit-16.png
deleted file mode 100644
index 7c7d597da5..0000000000
--- a/art/stock-edit-16.png
+++ /dev/null
Binary files differ
diff --git a/art/stock-edit-24.png b/art/stock-edit-24.png
deleted file mode 100644
index f6b49be992..0000000000
--- a/art/stock-edit-24.png
+++ /dev/null
Binary files differ
diff --git a/art/stock-junk-24.png b/art/stock-junk-24.png
deleted file mode 100644
index 52364ab279..0000000000
--- a/art/stock-junk-24.png
+++ /dev/null
Binary files differ
diff --git a/art/stock-notjunk-24.png b/art/stock-notjunk-24.png
deleted file mode 100644
index a74fecbd66..0000000000
--- a/art/stock-notjunk-24.png
+++ /dev/null
Binary files differ
diff --git a/art/summary-settings.png b/art/summary-settings.png
deleted file mode 100644
index 011d94ac0a..0000000000
--- a/art/summary-settings.png
+++ /dev/null
Binary files differ
diff --git a/art/summary_preferences-16.png b/art/summary_preferences-16.png
deleted file mode 100644
index 4a318c2fd1..0000000000
--- a/art/summary_preferences-16.png
+++ /dev/null
Binary files differ
diff --git a/art/talking-heads.png b/art/talking-heads.png
deleted file mode 100644
index 1c2ba5b040..0000000000
--- a/art/talking-heads.png
+++ /dev/null
Binary files differ
diff --git a/art/task-assigned-to.xpm b/art/task-assigned-to.xpm
deleted file mode 100644
index d60eeafa2d..0000000000
--- a/art/task-assigned-to.xpm
+++ /dev/null
@@ -1,30 +0,0 @@
-/* XPM */
-static char * task_assigned_to_xpm[] = {
-"16 16 11 1",
-" c None",
-". c #000000",
-"+ c #FFFFFF",
-"@ c #F3F3F3",
-"# c #CCCCCC",
-"$ c #B2B2B2",
-"% c #ECECEC",
-"& c #ABCCAB",
-"* c #768E76",
-"= c #5E705E",
-"- c #EEEEEE",
-" . . . . . ",
-" ........... ",
-" .+.+.+.+.+.@. ",
-" .+.#.#.#.#.$. ",
-" .+%%%%%%%%%$. ",
-" .+#######..$. ",
-" .+%%%%%%%.&.. ",
-" .+##......&&. ",
-" .+%%.&&&&&&&&. ",
-" .+##.&*&*&*&*&.",
-" .+%%.========. ",
-" .+##......==. ",
-" .+%%%%%%%.=.. ",
-" .-$$$$$$$..$. ",
-" ........... ",
-" "};
diff --git a/art/task-assigned.xpm b/art/task-assigned.xpm
deleted file mode 100644
index 9b245c0c49..0000000000
--- a/art/task-assigned.xpm
+++ /dev/null
@@ -1,30 +0,0 @@
-/* XPM */
-static char * task_assigned_xpm[] = {
-"16 16 11 1",
-" c None",
-". c #000000",
-"+ c #FFFFFF",
-"@ c #F3F3F3",
-"# c #CCCCCC",
-"$ c #B2B2B2",
-"% c #ECECEC",
-"& c #FFCC66",
-"* c #CC9933",
-"= c #996600",
-"- c #EEEEEE",
-" . . . . . ",
-" ........... ",
-" .+.+.+.+.+.@. ",
-" .+.#.#.#.#.$. ",
-" .+%%%%%%%%%$. ",
-" .+##..#####$. ",
-" .+%%.&.%%%%$. ",
-"......&&.###$. ",
-".&&&&&&&&.%%$. ",
-".&*&*&*&*&.#$. ",
-".========.%%$. ",
-"......==.###$. ",
-" .+%%.=.%%%%$. ",
-" .-$$..$$$$$$. ",
-" ........... ",
-" "};
diff --git a/art/task-recurring.xpm b/art/task-recurring.xpm
deleted file mode 100644
index 634cd87a84..0000000000
--- a/art/task-recurring.xpm
+++ /dev/null
@@ -1,59 +0,0 @@
-/* XPM */
-static char * task_recurring_xpm[] = {
-"16 16 40 1",
-" c None",
-". c #000000",
-"+ c #FFFFFF",
-"@ c #F3F3F3",
-"# c #CCCCCC",
-"$ c #B2B2B2",
-"% c #ECECEC",
-"& c #BFBFC3",
-"* c #A2A2B0",
-"= c #454572",
-"- c #9898A9",
-"; c #85859C",
-"> c #333366",
-", c #4F4F79",
-"' c #B3B3C3",
-") c #A3A3B7",
-"! c #9696AD",
-"~ c #464672",
-"{ c #7F7F99",
-"] c #C9C9CA",
-"^ c #3D3D6D",
-"/ c #3B3B6B",
-"( c #A4A4B8",
-"_ c #B5B5C4",
-": c #D1D1D8",
-"< c #9191A4",
-"[ c #B5B5BD",
-"} c #9F9FAE",
-"| c #4A4A76",
-"1 c #40406F",
-"2 c #E9E9E9",
-"3 c #8F8FA9",
-"4 c #9D9DAC",
-"5 c #9090A4",
-"6 c #55557F",
-"7 c #ADADBE",
-"8 c #484875",
-"9 c #B9B9C7",
-"0 c #DCDCE0",
-"a c #EEEEEE",
-" . . . . . ",
-" ........... ",
-" .+.+.+.+.+.@. ",
-" .+.#.#.#.#.$. ",
-" .+%%%%%%%%%$. ",
-" .+&*=-#;>>,$. ",
-" .+'>)%%!>>'$. ",
-" .+~{]##;^/~$. ",
-" .+>(%%%_:(>$. ",
-" .+><[}###<>$. ",
-" .+|^1!%%23|$. ",
-" .+4>>;##5>4$. ",
-" .+6>>!%7890$. ",
-" .a$$$$$$$$$$. ",
-" ........... ",
-" "};
diff --git a/art/task.png b/art/task.png
deleted file mode 100644
index 5b3c7b7534..0000000000
--- a/art/task.png
+++ /dev/null
Binary files differ
diff --git a/art/task.xpm b/art/task.xpm
deleted file mode 100644
index 4a53c3e9ab..0000000000
--- a/art/task.xpm
+++ /dev/null
@@ -1,27 +0,0 @@
-/* XPM */
-static char * task_xpm[] = {
-"16 16 8 1",
-" c None",
-". c #000000",
-"+ c #FFFFFF",
-"@ c #F3F3F3",
-"# c #CCCCCC",
-"$ c #B2B2B2",
-"% c #ECECEC",
-"& c #EEEEEE",
-" . . . . . ",
-" ........... ",
-" .+.+.+.+.+.@. ",
-" .+.#.#.#.#.$. ",
-" .+%%%%%%%%%$. ",
-" .+#########$. ",
-" .+%%%%%%%%%$. ",
-" .+#########$. ",
-" .+%%%%%%%%%$. ",
-" .+#########$. ",
-" .+%%%%%%%%%$. ",
-" .+#########$. ",
-" .+%%%%%%%%%$. ",
-" .&$$$$$$$$$$. ",
-" ........... ",
-" "};
diff --git a/art/thankyou.png b/art/thankyou.png
deleted file mode 100644
index f08f553cc3..0000000000
--- a/art/thankyou.png
+++ /dev/null
Binary files differ
diff --git a/art/timezone-16.xpm b/art/timezone-16.xpm
deleted file mode 100644
index 6f3094a395..0000000000
--- a/art/timezone-16.xpm
+++ /dev/null
@@ -1,162 +0,0 @@
-/* XPM */
-static char * timezone_16_xpm[] = {
-"16 16 143 2",
-" c None",
-". c #000000",
-"+ c #2A2B2B",
-"@ c #020203",
-"# c #050709",
-"$ c #020202",
-"% c #7490B2",
-"& c #A6BDD4",
-"* c #C0D3E5",
-"= c #E6E7E6",
-"- c #C7CCC5",
-"; c #9BAC9F",
-"> c #030304",
-", c #010101",
-"' c #82848E",
-") c #80846B",
-"! c #7FA59B",
-"~ c #AECFE0",
-"{ c #C0D8EF",
-"] c #B4C4C2",
-"^ c #6A8B6C",
-"/ c #699678",
-"( c #51826F",
-"_ c #2D535E",
-": c #1C492A",
-"< c #5EA66A",
-"[ c #7BC280",
-"} c #67BA7A",
-"| c #7AC7A7",
-"1 c #B1D1EC",
-"2 c #94ADAF",
-"3 c #719177",
-"4 c #609996",
-"5 c #5B9583",
-"6 c #537762",
-"7 c #6E9874",
-"8 c #64A970",
-"9 c #6DBD77",
-"0 c #5FB565",
-"a c #5DAD6B",
-"b c #89BFF1",
-"c c #89BFF5",
-"d c #4C9DAB",
-"e c #459D82",
-"f c #55A395",
-"g c #557A5C",
-"h c #1A304E",
-"i c #74B678",
-"j c #5EB666",
-"k c #49A54F",
-"l c #4CA34F",
-"m c #90C4E4",
-"n c #7BB8F8",
-"o c #7FBCF8",
-"p c #49A09A",
-"q c #389B6F",
-"r c #81ACBF",
-"s c #617B65",
-"t c #5B735E",
-"u c #010202",
-"v c #7AAD6E",
-"w c #438C3D",
-"x c #6AA8A1",
-"y c #92C5F1",
-"z c #77B8F6",
-"A c #77B7F7",
-"B c #7BB7F2",
-"C c #5DA9BA",
-"D c #56A4A1",
-"E c #85B1D9",
-"F c #637679",
-"G c #586D86",
-"H c #040506",
-"I c #6B975F",
-"J c #749486",
-"K c #85BDD9",
-"L c #8FBFEF",
-"M c #82BBF4",
-"N c #82BAF2",
-"O c #84B9EE",
-"P c #71AFEE",
-"Q c #96ABBF",
-"R c #8AB7D4",
-"S c #668B77",
-"T c #557E74",
-"U c #040406",
-"V c #649D69",
-"W c #508B52",
-"X c #508074",
-"Y c #7EAEDD",
-"Z c #81BBF4",
-"` c #81B9F2",
-" . c #83B8EE",
-".. c #80ACD5",
-"+. c #908466",
-"@. c #64825C",
-"#. c #5C7F5A",
-"$. c #627F5C",
-"%. c #5C7677",
-"&. c #5C9D67",
-"*. c #5D9071",
-"=. c #617576",
-"-. c #7DB2E8",
-";. c #7EB4EA",
-">. c #7BB0E6",
-",. c #7698B8",
-"'. c #66855E",
-"). c #53885E",
-"!. c #51845C",
-"~. c #61825D",
-"{. c #3D362D",
-"]. c #0A1C14",
-"^. c #609D73",
-"/. c #68A879",
-"(. c #628E77",
-"_. c #7AAEE4",
-":. c #70A4DB",
-"<. c #72A7DD",
-"[. c #6997C6",
-"}. c #598860",
-"|. c #51835C",
-"1. c #638860",
-"2. c #07090A",
-"3. c #50716C",
-"4. c #6FA779",
-"5. c #5D8976",
-"6. c #7AA7D4",
-"7. c #73A5D7",
-"8. c #6495C7",
-"9. c #557FAB",
-"0. c #65855F",
-"a. c #5A875F",
-"b. c #558462",
-"c. c #778383",
-"d. c #7B98B4",
-"e. c #7CA0C3",
-"f. c #7397BD",
-"g. c #7D8FA0",
-"h. c #809980",
-"i. c #143325",
-"j. c #597658",
-"k. c #030505",
-"l. c #030404",
-" ",
-" . . + @ @ # ",
-" . $ % & * = - ; > , ",
-" . ' ) ! ~ { ] ^ / ( _ , ",
-" : < [ } | 1 2 3 4 5 6 $ ",
-" , 7 8 9 0 a b c d e f g h , ",
-" , i j k l m n o p q r s t u ",
-" , v w x y z A B C D E F G H ",
-" , I J K L M N O P Q R S T U ",
-" , V W X Y Z ` ...+.@.#.$.H ",
-" u %.&.*.=.-.;.>.,.'.).!.~.{. ",
-" ].^./.(._.:.<.[.}.|.1.2. ",
-" @ 3.4.5.6.7.8.9.0.a.b.> ",
-" @ H c.d.e.f.g.h.i.j. ",
-" u u k.> l.> ",
-" "};
diff --git a/art/timezone-48.png b/art/timezone-48.png
deleted file mode 100644
index 2222e6f903..0000000000
--- a/art/timezone-48.png
+++ /dev/null
Binary files differ
diff --git a/art/tree-expanded.xpm b/art/tree-expanded.xpm
deleted file mode 100644
index fc748953eb..0000000000
--- a/art/tree-expanded.xpm
+++ /dev/null
@@ -1,22 +0,0 @@
-/* XPM */
-static char * tree_expanded_xpm[] = {
-"16 16 3 1",
-" c None",
-". c #000000",
-"+ c #FFFFFF",
-" ",
-" ",
-" ",
-" ",
-" ......... ",
-" .+++++++. ",
-" .+++++++. ",
-" .+++++++. ",
-" .+.....+. ",
-" .+++++++. ",
-" .+++++++. ",
-" .+++++++. ",
-" ......... ",
-" ",
-" ",
-" "};
diff --git a/art/tree-unexpanded.xpm b/art/tree-unexpanded.xpm
deleted file mode 100644
index 0dfb12a0a5..0000000000
--- a/art/tree-unexpanded.xpm
+++ /dev/null
@@ -1,22 +0,0 @@
-/* XPM */
-static char * tree_unexpanded_xpm[] = {
-"16 16 3 1",
-" c None",
-". c #000000",
-"+ c #FFFFFF",
-" ",
-" ",
-" ",
-" ",
-" ......... ",
-" .+++++++. ",
-" .+++.+++. ",
-" .+++.+++. ",
-" .+.....+. ",
-" .+++.+++. ",
-" .+++.+++. ",
-" .+++++++. ",
-" ......... ",
-" ",
-" ",
-" "};
diff --git a/art/undelete_message-16.png b/art/undelete_message-16.png
deleted file mode 100644
index 066cbfc99c..0000000000
--- a/art/undelete_message-16.png
+++ /dev/null
Binary files differ
diff --git a/art/wax-seal-broken.png b/art/wax-seal-broken.png
deleted file mode 100644
index 951f062dcc..0000000000
--- a/art/wax-seal-broken.png
+++ /dev/null
Binary files differ
diff --git a/art/wax-seal.png b/art/wax-seal.png
deleted file mode 100644
index 5b0ba63bff..0000000000
--- a/art/wax-seal.png
+++ /dev/null
Binary files differ
diff --git a/art/weekview.xpm b/art/weekview.xpm
deleted file mode 100644
index 869b9e722a..0000000000
--- a/art/weekview.xpm
+++ /dev/null
@@ -1,34 +0,0 @@
-/* XPM */
-static char * weekview_xpm[] = {
-"24 24 7 1",
-" c None",
-". c #000000",
-"+ c #FFFFFF",
-"@ c #D8D8D4",
-"# c #F2F1ED",
-"$ c #919191",
-"% c #666666",
-"....................... ",
-".++++++++++@++++++++++. ",
-".+#..$.$###$#..$.$###$. ",
-".+#########$#########$. ",
-".+#########$#########$. ",
-".+#########$#########$. ",
-".+#########$#########$. ",
-".+$$$$$$$$$$$$$$$$$$$$. ",
-".+#..$.$###$#..$.$###$. ",
-".+#########$#########$. ",
-".+#########$#########$. ",
-".+#########$#########$. ",
-".+#########$#########$. ",
-".+$$$$$$$$$$$$$$$$$$$$. ",
-".+#..$.$###$#..$.$###$. ",
-".+#########$#########$. ",
-".+#########$#########$. ",
-".+#########$$$$$$$$$$$. ",
-".+#########$#..$.$###$. ",
-".+#########$#########$. ",
-".+#########$#########$. ",
-".@$$$$$$$$$%$$$$$$$$$%. ",
-"....................... ",
-" "};
diff --git a/art/work_offline.xpm b/art/work_offline.xpm
deleted file mode 100644
index b4c2cdc17f..0000000000
--- a/art/work_offline.xpm
+++ /dev/null
@@ -1,33 +0,0 @@
-/* XPM */
-static char * 16_work_offline_xpm[] = {
-"16 16 14 1",
-" c None",
-". c #424242",
-"+ c #212121",
-"@ c #737373",
-"# c #EFEFEF",
-"$ c #DEDEDE",
-"% c #CECECE",
-"& c #101010",
-"* c #8C8C8C",
-"= c #636363",
-"- c #ADADAD",
-"; c #9C9C9C",
-"> c #000000",
-", c #BDBDBD",
-" ",
-" ",
-" ",
-" .+++..@ ",
-" . ###$$%& ",
-" @#*=*-*=*%@ ",
-" .#;> %->;%+ ",
-" .$-> %->,%+ ",
-" .$;$#,;$ %+ ",
-" .$$ %+% #%& ",
-" @%-$@>@%-%. ",
-" .,;;;;-,. ",
-" @++++&. ",
-" ",
-" ",
-" "};
diff --git a/art/work_online-16.png b/art/work_online-16.png
deleted file mode 100644
index b11d36d277..0000000000
--- a/art/work_online-16.png
+++ /dev/null
Binary files differ
diff --git a/art/working-16.png b/art/working-16.png
deleted file mode 100644
index 5f12053a84..0000000000
--- a/art/working-16.png
+++ /dev/null
Binary files differ
diff --git a/art/workweekview.xpm b/art/workweekview.xpm
deleted file mode 100644
index 35cceedbdc..0000000000
--- a/art/workweekview.xpm
+++ /dev/null
@@ -1,34 +0,0 @@
-/* XPM */
-static char * workweekview_xpm[] = {
-"24 24 7 1",
-" c None",
-". c #000000",
-"+ c #FFFFFF",
-"@ c #D8D8D4",
-"# c #B5B4AF",
-"$ c #666666",
-"% c #F2F1ED",
-"....................... ",
-".++++@+++@+++@+++@++++. ",
-".+###$###$###$###$###$. ",
-".+###$###$###$###$###$. ",
-".@$$$$$$$$$$$$$$$$$$$$. ",
-".++++#+++#+++#+++#+++#. ",
-".+%%%#%%%#%%%#%%%#%%%#. ",
-".+%%%#%%%#%%%#%%%#%%%#. ",
-".+%%%#%%%#%%%#%%%#%%%#. ",
-".+%%%#%%%#%%%#%%%#%%%#. ",
-".+%%%#%%%#%%%#%%%#%%%#. ",
-".+%%%#%%%#%%%#%%%#%%%#. ",
-".+%%%#%%%#%%%#%%%#%%%#. ",
-".+%%%#%%%#%%%#%%%#%%%#. ",
-".+%%%#%%%#%%%#%%%#%%%#. ",
-".+%%%#%%%#%%%#%%%#%%%#. ",
-".+%%%#%%%#%%%#%%%#%%%#. ",
-".+%%%#%%%#%%%#%%%#%%%#. ",
-".+%%%#%%%#%%%#%%%#%%%#. ",
-".+%%%#%%%#%%%#%%%#%%%#. ",
-".+%%%#%%%#%%%#%%%#%%%#. ",
-".@###$###$###$###$####. ",
-"....................... ",
-" "};
diff --git a/art/world_map-960.png b/art/world_map-960.png
deleted file mode 100644
index 0512d20115..0000000000
--- a/art/world_map-960.png
+++ /dev/null
Binary files differ
diff --git a/art/yearview.xpm b/art/yearview.xpm
deleted file mode 100644
index 0d4fa4135b..0000000000
--- a/art/yearview.xpm
+++ /dev/null
@@ -1,44 +0,0 @@
-/* XPM */
-static char * yearview_xpm[] = {
-"24 24 17 1",
-" c None",
-". c #000000",
-"+ c #FFFFFF",
-"@ c #F2F1ED",
-"# c #AAA9A6",
-"$ c #D7D6D2",
-"% c #92918E",
-"& c #B7B6B3",
-"* c #CBCAC6",
-"= c #919191",
-"- c #888785",
-"; c #B6B6B2",
-"> c #888884",
-", c #C1C1BD",
-"' c #A7A6A3",
-") c #D8D8D4",
-"! c #666666",
-"....................... ",
-".+++++++++++++++++++++. ",
-".+@@@@@@@#$%&*@@@@@@@=. ",
-".+@@@@@@@-;>,'@@@@@@@=. ",
-".+====================. ",
-".+@@@@@@@@@@@@@@@@@@@=. ",
-".+===@===@===@===@====. ",
-".+)=)@)=)@)=)@)=)@)=)=. ",
-".+=)=@=)=@=)=@=)=@=)==. ",
-".+@@@@@@@@@@@@@@@@@@@=. ",
-".+===@===@===@===@====. ",
-".+)=)@)=)@)=)@)=)@)=)=. ",
-".+=)=@=)=@=)=@=)=@=)==. ",
-".+@@@@@@@@@@@@@@@@@@@=. ",
-".+===@===@===@===@====. ",
-".+)=)@)=)@)=)@)=)@)=)=. ",
-".+=)=@=)=@=)=@=)=@=)==. ",
-".+@@@@@@@@@@@@@@@@@@@=. ",
-".+===@===@===@===@====. ",
-".+)=)@)=)@)=)@)=)@)=)=. ",
-".+=)=@=)=@=)=@=)=@=)==. ",
-".)===================!. ",
-"....................... ",
-" "};
diff --git a/autogen.sh b/autogen.sh
deleted file mode 100755
index 8d96b80beb..0000000000
--- a/autogen.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-# Run this to generate all the initial makefiles, etc.
-
-#!/bin/sh
-# Run this to generate all the initial makefiles, etc.
-
-srcdir=`dirname $0`
-test -z "$srcdir" && srcdir=.
-
-PKG_NAME="Evolution"
-
-(test -f $srcdir/configure.in \
- && test -f $srcdir/ChangeLog \
- && test -d $srcdir/shell) || {
- echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
- echo " top-level $PKG_NAME directory"
- exit 1
-}
-
-which gnome-autogen.sh || {
- echo "You need to install gnome-common from the GNOME CVS"
- exit 1
-}
-USE_GNOME2_MACROS=1 . gnome-autogen.sh
diff --git a/calendar/.cvsignore b/calendar/.cvsignore
deleted file mode 100644
index b7f7dea650..0000000000
--- a/calendar/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-Makefile.in
-Makefile
-.deps
-_libs
-.libs
-*.lo
diff --git a/calendar/AUTHORS b/calendar/AUTHORS
deleted file mode 100644
index e4fda3d3bc..0000000000
--- a/calendar/AUTHORS
+++ /dev/null
@@ -1,7 +0,0 @@
-Miguel de Icaza <miguel@kernel.org>
-Federico Mena <federico@helixcode.com>
-Arturo Esponosa <arturo@nuclecu.unam.mx>
-Russell Steinthal <rms39@columbia.edu>
-Rodrigo Moya <rodrigo@ximian.com>
-JP Rosevear <jpr@ximian.com>
-Damon Chaplin <damon@ximian.com>
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
deleted file mode 100644
index 8ad6de67ba..0000000000
--- a/calendar/ChangeLog
+++ /dev/null
@@ -1,4785 +0,0 @@
-2003-12-08 Bolian Yin <bolian.yin@sun.com>
-
- * gui/e-day-view.c (e_day_view_on_editing_started): remove setting property of "handle_popup".
- * gui/e-week-view.c (e_week_view_on_editing_started): remove setting property of "handle_popup".
-
-2003-12-08 Carl Sun <carl.sun@sun.com>
-
- Fixes #46351
-
- * gui/e-timezone-entry.c (e_timezone_entry_mnemonic_activate):
- new function. override the member function of GtkWidget to handle
- nemonic_activate signal of custom class ETimezoneEntry.
-
-
-2003-12-08 Bolian Yin <bolian.yin@sun.com>
-
- * gui/gnome-cal.c (gnome_calendar_class_init): correct argument mismatch in "goto_date" signal definition.
-
-2003-12-05 Yong Sun <Yong.Sun@Sun.com>
-
- Fix for #51337
-
- * gui/dialogs/alarm-page.c
- Change raw string "Action/Trigger" to _("Action/Trigger")
- * gui/dialogs/recurrence-page.c
- Change raw string "Date/Time" to _("Date/Time")
-
-2003-12-04 Harry Lu <harry.lu@sun.com>
-
- Fix for bugzilla bug #51627.
-
- * gui/goto.c: (create_ecal): set calitem's move_selection_when_moving
- to FALSE so that changing month and year won't send out
- a "selection_changed" signal.
-
-2003-12-03 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/tasks-control.c (tasks_control_activate): Do not call
- control_util_set_folder_bar_label().
-
- * gui/e-calendar-table.c (e_calendar_table_set_status_message):
- Use e_activity_handler_operation_progressing(), not
- evolution_activity_client_update().
-
- * gui/e-cal-view.c: Remove settings menu.
- (on_settings): Remove.
-
- * gui/calendar-commands.c (get_shell_view_interface): Remove.
- (control_util_set_folder_bar_label): Remove.
- (calendar_set_folder_bar_label): Remove.
- (control_util_show_settings): Remove.
- (gcal_calendar_dates_change_cb): Remove.
- (calendar_control_activate): Do not connect, do not call
- calendar_set_folder_bar_label().
-
-2003-12-03 JP Rosevear <jpr@ximian.com>
-
- * gui/gnome-cal.c (gnome_calendar_destroy): free the notification
- list
-
- * gui/tasks-component.c (impl_dispose): ditto
-
- * gui/calendar-component.c (impl_dispose): ditto
-
-2003-12-03 JP Rosevear <jpr@ximian.com>
-
- * gui/tasks-component.c (impl_dispose): free up the notifications
- and the ecal
- (config_create_ecal_changed_cb): clear the create_ecal if the
- primary selection changes
- (setup_create_ecal): find a default ecal to do creation with
- (impl_requestCreateItem): use above
-
-2003-12-03 JP Rosevear <jpr@ximian.com>
-
- * gui/tasks-component.c (rename_task_list_cb): cast the parent
- (impl_createControls): add notification for primary tasks
- (config_primary_selection_changed_cb): handle primary selection
- changing in gconf
-
- * gui/calendar-config-keys.h: fix config key for primary tasks
-
-2003-12-03 JP Rosevear <jpr@ximian.com>
-
- * gui/calendar-component.c (rename_calendar_cb): cast the parent
- (config_primary_selection_changed_cb): handle the primary
- selection changing elsewhere
- (impl_dispose): remove the list of notifications
- (impl_createControls): add primary calendar notification
- (config_create_ecal_changed_cb): clear create_ecal if the primary
- key changes
- (setup_create_ecal): find an ecal to use for creation
- (impl_requestCreateItem): use above
-
-2003-12-03 Ettore Perazzoli <ettore@ximian.com>
-
- * importers/icalendar-importer.c: Do not #include shell stuff.
-
- * gui/main.c: Do not #include <evolution-shell-client.h>.
-
- * gui/e-itip-control.c: Do not #include
- <e-folder-selector-button.h> nor <evolution-shell-client.h>.
- (start_default_server): Return FALSE.
- (default_server_started_cb): Do not connect the "selected" signal
- on the button since it's now NULL.
- (button_selected_cb): #if 0 out.
-
- * gui/e-cal-list-view.h: Do not #include
- "evolution-activity-client.h".
-
- * gui/tasks-component.c (impl_createControls): Give an empty label
- for the status bar.
-
- * gui/e-day-view.h: Remove all deps on evolution-activity-client.
-
-2003-12-02 Rodney Dawes <dobey@ximian.com>
-
- * gui/Makefile.am: Version the schemas
- * gui/apps_evolution_calendar.schemas: Removed
- * gui/apps_evolution_calendar.schemas.in.in: Added
-
-2003-12-02 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/dialogs/copy-source-dialog.c (copy_source_dialog): added
- a label to the dialog to make it look less ugly.
-
-2003-12-02 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/dialogs/copy-source-dialog.c: converted to use an
- ESourceOptionMenu instead of the ESourceSelector.
- (primary_selection_changed_cb): removed.
- (copy_source_dialog): create the ESourceOptionMenu here.
- (source_selected_cb): callback for the "source_selected"
- signal on the ESourceOptionMenu widget.
-
-2003-12-02 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/e-calendar-table.h (struct _ECalendarTable): Replace member
- "activity" with an "activity_id".
-
- * gui/e-cal-view.c (struct _ECalendarViewPrivate): Replace member
- "activity" with "activity_id".
- (e_calendar_view_destroy): Don't unref activity here anymore.
- (e_calendar_view_set_status_message): Report progress using the
- EActivityHandler off the CalendarComponent.
-
- * gui/calendar-component.c
- (struct _CalendarComponentPrivate): New member activity_handler.
- (calendar_component_init): Init.
- (calendar_component_peek_activity_handler): New.
- (impl_dispose): Unref.
- (impl_createControls): Return an ETaskBar for the statusbar
- control.
-
-2003-12-01 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/calendar-component.c (impl_createControls): Pass a label for
- the status bar control for now.
-
- * gui/tasks-component.c (impl_createControls): Pass a label for
- the status bar control for now.
-
-2003-12-01 Rodney Dawes <dobey@ximian.com>
-
- * gui/GNOME_Evolution_Calendar.server.in.in:
- * gui/calendar-commands.c:
- * gui/e-meeting-list-view.c:
- * gui/e-meeting-model.c:
- * gui/e-select-names-editable.c:
- * gui/itip-bonobo-control.c:
- * gui/itip-utils.c:
- * gui/main.c:
- * gui/alarm-notify/GNOME_Evolution_Calendar_AlarmNotify.server.in.in:
- * gui/alarm-notify/alarm-queue.c:
- * gui/alarm-notify/notify-main.c:
- * gui/dialogs/alarm-options.c:
- * gui/dialogs/e-delegate-dialog.c:
- * importers/GNOME_Evolution_Calendar_Importer.server.in.in:
- * importers/main.c: Use BASE_VERSION for repo_ids and OAFIIDs
-
-2003-12-01 JP Rosevear <jpr@ximian.com>
-
- * conduits/todo/Makefile.am: put the conduits in their own dir
-
- * conduits/calendar/Makefile.am: ditto
-
- * conduits/todo/e-todo.conduit.in: subst in correct thing
-
- * conduits/calendar/e-calendar.conduit.in: ditto
-
-2003-12-01 JP Rosevear <jpr@ximian.com>
-
- * conduits/todo/Makefile.am: install to privlibdir
-
- * conduits/calendar/Makefile.am: ditto
-
- * conduits/todo/e-todo.conduit.in: subst in correct thing
-
- * conduits/calendar/e-calendar.conduit.in: subst in correct thing
-
-2003-12-01 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/alarm-notify/alarm-notify.c (add_uri_to_load, remove_uri_to_load):
- removed unneeded functions.
- (alarm_notify_add_calendar, alarm_notify_remove_calendar): no need
- anymore to add/remove URIs to load on startup to the configuration.
-
-2003-12-01 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/alarm-notify/save.c (save_calendars_to_load): removed this
- function, since we now use the ESourceList to know what calendars
- to load.
- (get_calendars_to_load): moved to config-data.c.
- (save_notification_time, get_saved_notification_time,
- save_blessed_program, is_blessed_program): use the
- shared GConfClient.
-
- * gui/alarm-notify/config-data.[ch]: use a GConfClient instead of a
- EConfigListener.
- (config_data_get_conf_client): renamed from _get_listener.
- (config_data_get_timezone, config_data_get_24_hour_format): changed
- to use the GConfClient.
- (config_data_get_calendars_to_load): new function.
- (ensure_inited): create the source lists for calendar and tasks here.
- (do_cleanup): cleanup the source lists here.
-
- * gui/alarm-notify/notify-main.c (load_calendars): use
- config_data_get_calendars_to_load().
-
-2003-11-28 JP Rosevear <jpr@ximian.com>
-
- * gui/e-tasks.c (e_tasks_delete_completed): we want to skip if it
- *is* read only
-
-2003-11-28 JP Rosevear <jpr@ximian.com>
-
- * gui/e-meeting-store.c (e_meeting_store_get_type): allocate the
- type information correctly
-
-2003-11-26 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/calendar-offline-handler.c (backend_go_offline): e_cal_new () ->
- e_cal_new_from_uri ().
- (backend_go_online): Ditto.
- (calendar_offline_handler_init): Ditto.
-
- * gui/comp-editor-factory.c (open_client): Ditto.
-
- * gui/e-itip-control.c (start_calendar_server): Ditto.
- (object_requested_cb): Ditto.
-
- * gui/e-tasks.c (e_tasks_add_todo_uri): Ditto.
-
- * gui/gnome-cal.c (gnome_calendar_construct): Ditto.
- (gnome_calendar_add_event_uri): Ditto.
-
- * gui/alarm-notify/alarm-notify.c (alarm_notify_add_calendar): Ditto.
-
- * importers/icalendar-importer.c (load_file_fn): Ditto.
- (vcal_load_file_fn): Ditto.
- (gnome_calendar_import_data_fn): Ditto.
-
- * gui/dialogs/copy-source-dialog.c (copy_source): Pass sources to
- e_cal_new ().
-
-2003-11-24 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/dialogs/copy-source-dialog.c (copy_source): use the correct
- icalcomponent when calling e_cal_create_object.
-
- * gui/tasks-control.c (sensitize_commands): no need to have a
- selection for Paste to work.
-
- * gui/e-calendar-table.c (e_calendar_table_show_popup_menu): disable
- editing items if the selected task list is read only, not if it's not.
-
-2003-11-24 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/dialogs/new-task-list.glade:
- * gui/dialogs/new-task-list.[ch]: new files containing the
- implementation of the 'New Task List' dialog.
-
- * gui/dialogs/Makefile.am: added new files.
-
- * gui/dialogs/new-calendar.c (new_calendar_dialog): use G_STRLOC
- for g_warning messages.
-
- * gui/tasks-component.c (new_task_list_cb): implemented.
-
-2003-11-24 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/dialogs/copy-source-dialog.c (copy_source_dialog): actually
- add the source selector to the dialog's box.
-
-2003-11-23 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/tasks-component.c:
- * gui/dialogs/copy-source-dialog.[ch]: fixed compilation errors.
-
- * gui/dialogs/Makefile.am: added missing header directories.
-
-2003-11-23 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/dialogs/new-calendar.[ch]: fixed copyright notices.
-
- * gui/dialogs/copy-source-dialog.[ch]: implementation of the
- Copy command for sources.
-
- * gui/dialogs/Makefile.am: added new files.
-
- * gui/calendar-component.c (fill_popup_menu_cb, copy_calendar_cb):
- added Copy command.
-
- * gui/tasks-component.c (fill_popup_menu_cb, copy_task_list_cb):
- added Copy command.
-
-2003-11-23 Ross Burton <ross@burtonini.com>
-
- * gui/alarm-notify/GNOME_Evolution_Calendar_AlarmNotify.server.in.in:
- Append "_2" to the OAFIID to avoid conflicting with Evo 1.4.
-
- * gui/main.c:
- * gui/alarm-notify/notify-main.c:
- Updated with new OAFIID.
-
-2003-11-20 JP Rosevear <jpr@ximian.com>
-
- * Remove a bunch of gal includes that are no longer needed
-
-2003-11-19 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #43556
-
- * gui/e-cal-view.c (selection_get, selection_clear_event,
- selection_received): removed this unneeded functions.
- (e_calendar_view_init): don't create a GtkInvisible anymore.
- (e_calendar_view_destroy): no need to destroy the GtkInvisible.
- (e_cal_view_copy_clipboard, e_cal_view_paste_clipboard):
- use GtkClipboard.
-
-2003-11-19 JP Rosevear <jpr@ximian.com>
-
- * gui/e-cal-model-tasks.c (get_due): make sure timezone value is
- sane
- (get_completed): ditto
-
- * gui/e-cal-model.c (get_dtstart): add more guards
-
- * gui/e-cal-model-calendar.c (get_dtend): ditto
-
-2003-11-19 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #51052
-
- * importers/icalendar-importer.c (prepare_events, prepare_tasks):
- call icalcompiter_next to move the pointer to the next before
- removing a component avoid breaking the link.
-
-2003-11-18 JP Rosevear <jpr@ximian.com>
-
- * gui/e-cal-model.c (get_dtstart): make sure the timezone value is
- sane
-
- * gui/e-cal-model-calendar.c (get_dtend): ditto
-
-2003-11-18 JP Rosevear <jpr@ximian.com>
-
- * gui/calendar-config.h: add protos
-
- * gui/calendar-config.c (calendar_config_get_primary_calendar):
- get the primary calendar
- (calendar_config_set_primary_calendar): set it
- (calendar_config_add_notification_primary_calendar): set
- notifications for it
- (calendar_config_get_primary_tasks): get the primary task list
- (calendar_config_set_primary_tasks): set it
- (calendar_config_add_notification_primary_tasks): set
- notifications for it
-
- * gui/calendar-config-keys.h: add primary keys
-
- * gui/calendar-component.c (find_first_source): find any source
- (update_uri_for_primary_selection): set the default uri and save
- the source uid
- (update_primary_selection): set the primary selection
- (primary_source_selection_changed_cb): use above
- (impl_createControls): set the primary selection
-
- * gui/tasks-component.c: as above
-
-2003-11-18 JP Rosevear <jpr@ximian.com>
-
- * gui/Makefile.am: remove db3 include
-
-2003-11-18 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/calendar-commands.c
- (calendar_control_sensitize_calendar_commands,
- sensitize_taskpad_commands): removed the 'New...' menu items
- from the UI, it's now implemented in the shell.
- (file_new_appointment_cb, file_new_event_cb, file_new_meeting_cb,
- file_new_task_cb): removed.
-
-2003-11-18 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/calendar-component.c (add_popup_menu_item): added 'sensitive'
- argument.
- (fill_popup_menu_cb): disable/enable menu items depending on whether
- there is a selection or not.
-
- * gui/tasks-component.c (add_popup_menu_item, fill_popup_menu_cb):
- ditto.
-
-2003-11-17 JP Rosevear <jpr@ximian.com>
-
- * Cleanup some ref/unref calls
-
-2003-11-17 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/calendar-component.c (delete_calendar_cb, rename_calendar_cb):
- * gui/tasks-component.c (delete_task_list_cb, rename_task_list_cb):
- peek the primary selection.
-
-2003-11-17 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/tasks-component.c (fill_popup_menu_cb): added 'Delete' and
- 'Rename' menu items.
- (delete_task_list_cb, rename_task_list_cb): callbacks for new
- menu items.
-
-2003-11-17 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/calendar-component.c (add_popup_menu_item): try first to
- create the icon from the stock, and then from a file.
- (fill_popup_menu_cb): set callback for 'Rename' menu item.
- (rename_calendar_cb): callback for 'Rename' menu item.
- (new_calendar_cb): fixed arguments.
-
- * gui/tasks-component.c (impl_createControls): connect to
- "fill_popup_menu" signal on the source selector.
- (fill_popup_menu_cb): callback to create our menu items.
-
-2003-11-17 Rodrigo Moya <rodrigo@ximian.com>
-
- * idl/evolution-calendar.idl: remove the AlarmNotify service, no
- more need for it, since the alarm daemon will listen for changes
- on the GConf key.
-
- * gui/gnome-cal.c (add_alarms): removed function to talk to the
- alarm daemon.
- (client_cal_opened_cb): don't call add_alarms().
-
- * gui/alarm-notify/alarm-notify.[ch]: made it a basic GObject.
- (AlarmNotify_addCalendar, AlarmNotify_removeCalendar): removed
- AlarmNotify interface implementation.
- (alarm_notify_class_init): no epv to initialize.
- (alarm_notify_remove_calendar): new function, copied from the
- CORBA method implementation.
- (alarm_notify_factory_fn): return NULL, since there is no objects
- that can be created via this factory now.
-
- * gui/alarm-notify/notify-main.c (main): now the factory is the alarm
- notification service itself.
- (load_calendars): no need to use exceptions here.
-
- * gui/alarm-notify/GNOME_Evolution_Calendar_AlarmNotify.server.in.in:
- now the factory is the alarm notification service itself.
-
- * gui/main.c (launch_alarm_daemon_cb): dont use the AlarmNotify CORBA
- types.
-
-2003-11-17 Harry Lu <harry.lu@sun.com>
-
- * gui/dialogs/recurrence-page.c (make_ending_count_special):
- Make ending count of occurrences of Recurrence tab numeric only.
-
-2003-11-16 JP Rosevear <jpr@ximian.com>
-
- * gui/tasks-control.c (tasks_control_set_property): add a uri
-
- * gui/e-tasks.c: kill e_tasks_open
-
- * gui/e-tasks.h: remove proto
-
-2003-11-16 JP Rosevear <jpr@ximian.com>
-
- * gui/e-cal-model.c (e_cal_view_objects_added_cb): emit the added
- signal for the correct rows
-
-2003-11-16 JP Rosevear <jpr@ximian.com>
-
- * gui/tasks-component.c (is_in_uids): copy in here
- (update_uris_for_selection): save the selection
- (update_selection): update the selection when its changed
- somewhere else
- (config_selection_changed_cb): update the selection if the
- configuration changes
- (impl_createControls): store the source selector
-
- * gui/calendar-config.h: add protos
-
- * gui/calendar-config.c (calendar_config_get_tasks_selected): get
- the list of task lists selected
- (calendar_config_set_tasks_selected): save it
- (calendar_config_add_notification_tasks_selected): get notified
- about it
-
-2003-11-16 JP Rosevear <jpr@ximian.com>
-
- * gui/tasks-component.c (add_uri_for_source): add it via e-tasks
- (remove_uri_for_source): remove it via e-tasks
- (get_default_task): provide a default for editing
- (impl_createControls): create the control directly
- (impl_requestCreateItem): implement
-
- * gui/gnome-cal.c (gnome_calendar_purge): don't let the two list
- iterators clobber each other
-
- * gui/e-tasks.h: add protos
-
- * gui/e-tasks.c (e_tasks_destroy): free the client list and the
- hash, disconnect signals
- (e_tasks_new_task): use the default client
- (e_tasks_add_todo_uri): add a uri
- (e_tasks_remove_todo_uri): remove a uri
- (e_tasks_set_default_uri): set default uri
- (e_tasks_get_default_client): get default client
- (e_tasks_delete_completed): expunge from all clients
- (e_tasks_setup_view_menus): use default client uri
-
- * gui/e-tasks.c (set_timezone): set the timezone for all clients
- (e_tasks_init): set up the clients has table
-
- * gui/e-calendar-table.etspec: yank some useless display columns
-
- * gui/e-cal-model.c (remove_client): remove objects in reverse
- order so we don't clobber ourselves
-
- * gui/calendar-component.c: add FIXME
-
-2003-11-16 JP Rosevear <jpr@ximian.com>
-
- * gui/calendar-component.c (get_default_event): set up a event to
- be edited
- (impl_requestCreateItem): implement
-
-2003-11-14 JP Rosevear <jpr@ximian.com>
-
- * gui/*.[hc]: include e-source* from e-d-s
-
-2003-11-14 JP Rosevear <jpr@ximian.com>
-
- * gui/calendar-config.c (calendar_config_get_calendars_selected):
- config accessor
- (calendar_config_set_calendars_selected): ditto
- (calendar_config_add_notification_calendars_selected): config
- notification
-
- * gui/calendar-config.h: add protos
-
- * gui/calendar-config-keys.h: add new key
-
- * gui/calendar-component.c (is_in_uids): util function
- (update_uris_for_selection): save the selection in the
- configuration
- (update_selection): update the selection from the config info
- (source_selection_changed_cb): only pass one param
- (config_selection_changed_cb): listen for config changes
- (impl_dispose): remove config notification
- (impl_createControls): use bonobo_exception_set; add a config
- notification
-
-2003-11-13 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/tasks-component.c (impl__get_userCreatableItems): New.
- (impl_requestCreateItem): New.
- (tasks_component_class_init): Install.
-
- * gui/calendar-component.c (impl__get_userCreatableItems): New.
- (impl_requestCreateItem): New, for now just a stub.
- (calendar_component_class_init): Install into the EPV.
-
-2003-11-13 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/GNOME_Evolution_Calendar.server.in.in: Add a component_alias
- of "calendar" for the calendar and "tasks" for the tasks.
-
-2003-11-12 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/calendar-component.c (add_popup_menu_item): Use non-deprecated
- gtk_menu_shell_append ().
-
-2003-11-11 Bolian Yin <bolian.yin@sun.com>
-
- Fixes #50808
-
- * gui/goto.c (goto_dialog): set initial selection to current day.
-
-2003-11-11 JP Rosevear <jpr@ximian.com>
-
- * gui/calendar-offline-handler.c (backend_cal_opened_offline): use
- a standard calendar status
- (backend_cal_opened_online): ditto
-
- * gui/alarm-notify/alarm-queue.c (cal_opened_cb): ditto
-
- * gui/gnome-cal.c (client_cal_opened_cb): ditto
-
- * gui/e-tasks.c (cal_opened_cb): ditto
-
- * gui/e-itip-control.c (default_server_started_cb): ditto
-
- * gui/e-cal-model.c (cal_opened_cb): ditto
-
- * gui/comp-editor-factory.c (cal_opened_cb): ditto
-
-2003-11-11 JP Rosevear <jpr@ximian.com>
-
- * conduits/todo/todo-conduit.c (start_calendar_server): load the
- calendar synchronously
-
- * conduits/calendar/calendar-conduit.c (start_calendar_server): ditto
-
-2003-11-10 JP Rosevear <jpr@ximian.com>
-
- * importers/icalendar-importer.c (update_single_object): return
- boolean not ECalStatus
- (update_objects): ditto
- (process_item_fn): handle above returns
-
-2003-11-10 JP Rosevear <jpr@ximian.com>
-
- * gui/e-cal-model-tasks.c (get_due_status): just check the boolean
-
-2003-11-10 JP Rosevear <jpr@ximian.com>
-
- * conduits/calendar/calendar-conduit.c
- (e_calendar_context_destroy): use proper change list free function
- name
- (post_sync): ditto
-
- * conduits/todo/todo-conduit.c: same
-
-2003-11-10 Dan Winship <danw@ximian.com>
-
- * gui/e-tasks.c (e_tasks_delete_completed): Remove get-vtype check
- from the completed-tasks query (and don't leak the sexp string).
-
- * gui/e-cal-model.c (update_e_cal_view_for_client): Don't adjust
- the sexp to use get-vtype.
-
- * gui/gnome-cal.c (adjust_e_cal_view_sexp, gnome_calendar_purge):
- Remove get-vtype check from queries
-
-2003-11-07 JP Rosevear <jpr@ximian.com>
-
- * gui/Makefile.am: remove includes for toplevel libical dir
-
- * gui/dialogs/Makefile.am: ditto
-
- * importers/Makefile.am: ditto
-
-2003-11-07 JP Rosevear <jpr@ximian.com>
-
- * In the gui this is a search and replace commit for moving the
- calendar to evolution-data-server; it also deletes the old backend
- files; e-cal-view was rename to e-calendar-view to remove name
- conflict
-
-2003-11-05 JP Rosevear <jpr@ximian.com>
-
- * gui/migration.c: fix typo
-
-2003-11-05 Larry Ewing <lewing@ximian.com>
-
- * gui/migration.c (process_old_dir): add a unimplemented warning
- so we at least avoid relocation errors.
-
-2003-11-04 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/calendar-component.c (fill_popup_menu_callback): added more
- menu items.
- (delete_calendar_cb): callbacks for new popup menu items.
- (impl_createControls): add the source selector widget to the
- CalendarComponentPrivate structure.
-
- * gui/migration.[ch] (migrate_old_tasks): new function to migrate
- old tasks setups.
- (process_old_dir): renamed and added a "filename" argument, so that
- the same function can be used for tasks and calendar directories.
- (migrate_old_calendars): added new argument when calling
- process_old_dir().
-
- * gui/tasks-component.c (tasks_component_init): call
- migrate_old_tasks() if there are no groups defined.
-
-2003-11-04 Bolian Yin <bolian.yin@sun.com>
-
- * gui/e-cal-view.c: add new signal "selected_time_changed"
- * gui/e-day-view-main-item.c (e_day_view_main_item_class_init):
- a11y initialization
- * gui/e-day-view-top-item (e_day_view_top_item_get_day_label):
- new public function.
- * gui/e-day-view.c (e_day_view_ensure_rows_visible,
- e_day_view_update_calendar_selection_time): make static functions public
- (e_day_view_cursor_key_up, e_day_view_cursor_key_down,
- e_day_view_cursor_key_left, e_day_view_cursor_key_right): emit
- "selected_time_changed".
-
-2003-11-03 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/e-meeting-model.c (SELECT_NAMES_OAFID): Append "_2".
- * gui/e-select-names-editable.c (SELECT_NAMES_OAFIID): Likewise.
- * gui/e-meeting-list-view.c (SELECT_NAMES_OAFID): Likewise.
- * gui/dialogs/alarm-options.c (SELECT_NAMES_OAFID): Likewise.
- * gui/dialogs/e-delegate-dialog.c (SELECT_NAMES_OAFID): Likewise
-
-2003-11-03 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/GNOME_Evolution_Calendar.server.in.in: use
- "evolution2:config_item" properties instead of
- "evolution:config_item" ones.
-
-2003-11-03 Harry Lu <harry.lu@sun.com>
-
- Fix for #50387.
-
- * importers/icalendar-importer.c (support_format_fn):
- Call icalcomponent_is_valid() to check whether the returned
- icalcomponent is valid.
-
-2003-10-31 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/calendar-component.c (calendar_component_init): Add the webcal
- source group.
-
- * gui/dialogs/new-calendar.c (print_uri_noproto): Implement.
- (group_is_remote): Implement.
- (create_new_source_with_group): Implement webcal case.
- (new_calendar_dialog): Get optional location from dialog.
-
- * gui/dialogs/new-calendar.glade: Add location entry.
-
- * pcs/Makefile.am: Build http backend.
-
- * pcs/cal-backend-http.[ch]: Add skeleton based on cal-backend-file.
-
-2003-10-31 Dan Winship <danw@ximian.com>
-
- * cal-util/cal-util.h: Add CAL_STATIC_CAPABILITY_NO_THISANDFUTURE
- and CAL_STATIC_CAPABILITY_NO_THISANDPRIOR
-
- * gui/dialogs/recur-comp.c (recur_component_dialog): Add a
- CalClient argument. Use cal_client_get_static_capability to decide
- whether or not to offer THISANDFUTURE and THISANDPRIOR options
-
- * gui/dialogs/comp-editor.c (prompt_to_save_changes, save_cmd,
- save_close_cmd): Pass a CalClient to recur_component_dialog.
-
- * gui/e-day-view.c (e_day_view_finish_long_event_resize,
- e_day_view_finish_resize, e_day_view_on_editing_stopped,
- e_day_view_on_top_canvas_drag_data_received,
- e_day_view_on_main_canvas_drag_data_received): Likewise
-
- * gui/e-week-view.c (e_week_view_on_editing_stopped): Likewise
-
- * gui/calendar-component.c (impl_createControls): set an exception
- if we fail, so evo won't crash.
-
-2003-10-31 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-calendar-table.c (e_calendar_table_show_popup_menu): fixed
- mismatched condition in if/else statement.
-
-2003-10-30 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-tasks.[ch] (e_tasks_get_cal_client): removed.
-
- * gui/tasks-control.c (sensitize_commands): fixed to work correctly
- with the ECalView's model.
- (tasks_control_set_property): don't use e_tasks_get_cal_client.
-
- * gui/alarm-notify/alarm-notify.c (free_client_hash): new function
- to remove items from the CalClient's hash table.
- (alarm_notify_finalize): call free_client_hash() for each item
- in the hash table.
-
-2003-10-30 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/alarm-notify/notify-main.c (client_die_cb): use
- bonobo_main_quit, not gtk_main_quit.
-
- * gui/alarm-notify/alarm-queue.c (free_client_alarms_cb): callback
- for freeing ClientAlarms stored in the hash table.
- (alarm_queue_done): call free_client_alarms_cb() for each opened
- client.
-
-2003-10-30 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/cal-backend-file.c (mark_dirty, save_idle): removed, since
- we dont save the file anymore in idle callbacks.
- (cal_backend_file_dispose): removed all traces of the idle saving.
- (check_dup_uid, create_cal, cal_backend_file_add_timezone,
- cal_backend_file_create_object, cal_backend_file_modify_object,
- cal_backend_file_remove_object, cal_backend_file_receive_objects):
- call save() directly instead of mark_dirty().
-
-2003-10-30 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/cal-backend-file.c (cal_backend_file_modify_object):
- implemented THIS and ALL recurrences cases, blowing away or detaching
- recurrences from the main component as required.
- (get_rid_string): make it return const.
- (get_rid_timetype): new convenience function for getting
- libical's recurrence ID from a CalComponent.
- (cal_backend_file_is_read_only, remove_recurrence_cb,
- remove_component): fixed warnings.
- (remove_object_instance_cb): callback to remove the instances
- from the hash on the THISANDPRIOR and THISANDFUTURE cases.
- (cal_backend_file_remove_object): replaced mismatched if/else
- statement with proper management of each of the recurrence cases.
-
-2003-10-29 JP Rosevear <jpr@ximian.com>
-
- * gui/Makefile.am: build new files
-
- * gui/dialogs/comp-editor-util.c (date_edit_destroy_cb): unref the
- config manager
- (comp_editor_new_date_edit): set up a config manager for the date
- editor
-
- * gui/e-date-edit-config.[hc]: config manager for e-date-edit
-
-2003-10-29 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/cal-prefs-dialog.c (update_config): no need to
- update config settings everywhere explicitly
-
- * gui/tasks-component.c (update_uris_for_selection): cast the
- widget
-
- * gui/gnome-cal.h: remove proto
-
- * gui/gnome-cal.c (setup_widgets): don't update config settings
- explicitly
- (gnome_calendar_update_config_settings): kill
-
- * gui/e-week-view.c: remove null chars
-
- * gui/e-tasks.h: remove proto
-
- * gui/e-tasks.c (set_timezone): set the timezone on the client
- (timezone_changed_cb): changed timezone callback
- (setup_config): setup config stuff
- (e_tasks_init): setup config and widgets here
- (e_tasks_new): construct is dead, no need to track all widgets
- (cal_opened_cb): set the timezone upon opening
- (e_tasks_update_all_config_settings): kill
-
- * gui/control-factory.c (control_factory_new_control): create the
- calendar ourselves
-
- * gui/calendar-config.c (on_timezone_set): don't update the
- settings everywhere here, we have config managers now
-
- * gui/calendar-component.c (impl_createControls): create the
- calendar ourselves
-
- * gui/calendar-commands.h: remove protos
-
- * gui/calendar-commands.c: remove dead functions
-
-2003-10-29 JP Rosevear <jpr@ximian.com>
-
- * gui/e-day-view-config.c (set_twentyfour_hour): set the format on
- the cal view
-
- * gui/e-week-view-config.c (set_twentyfour_hour): ditto
-
- * gui/e-cal-list-view-config.c (set_twentyfour_hour): set the 24
- hour format on the view
- (twentyfour_hour_changed_cb): 24 hour format change callback
- (e_cal_list_view_config_set_view): handle 24 hour format changes
-
-2003-10-29 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/recurrence-page.c (recurrence_page_finalize): unref
- config manager
- (init_widgets): create config manager for the e-calendar
-
- * gui/e-tasks.c (setup_widgets): create config manager for the
- table view
- (e_tasks_destroy): unref config manager
- (e_tasks_open): return FALSE not NULL
- (e_tasks_update_all_config_settings): don't configure the calendar
- table here, we have a manager
-
- * gui/calendar-config.c: remove dead config functions (handled by
- config managers now)
-
-2003-10-29 JP Rosevear <jpr@ximian.com>
-
- * gui/gnome-cal.c (set_timezone): set the timezone for all clients
- (timezone_changed_cb): callback for changes
- (setup_config): setup the configuration
- (setup_widgets): setup up configuration managers for the list
- view, task list and date navigator
- (gnome_calendar_init): setup config
- (gnome_calendar_destroy): destroy configuration managers and
- notifications
- (gnome_calendar_update_config_settings): remove dead bits
-
- * gui/e-mini-calendar-config.[hc]: manage configuration of an
- e-calendar
-
- * gui/e-day-view-config.h: remove extraneous comment, type the
- parent class correctly
-
- * gui/e-week-view-config.h: ditto
-
- * gui/e-day-view-config.c (e_day_view_config_class_init): type the
- class correctly
- (set_timezone): set timezone
- (timezone_changed_cb): timezone changed callback
- (e_day_view_config_set_view): track timezone changes
-
- * gui/e-week-view-config.c: ditto
-
- * gui/e-cell-date-edit-config.[hc]: manage configuration of a date
- edit cell
-
- * gui/e-calendar-table-config.[hc]: manage configuration of a
- e-calendar-table
-
- * gui/e-cal-list-view.c (get_current_time_cb): use the view
- timezone to compute
-
- * gui/e-cal-list-view-config.[hc]: manage configuration of a
- list view
-
- * gui/calendar-config.h: update protos
-
- * gui/calendar-config.c
- (calendar_config_add_notification_timezone): notify of timezone
- change
- (calendar_config_add_notification_dnav_show_week_no): notify of
- show week number setting change
-
- * gui/calendar-component.c (calendar_component_peek): remove bad
- comma
-
- * gui/Makefile.am: build new config classes
-
-2003-10-29 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/calendar-component.c (fill_popup_menu_callback): fixed
- typo in menu item label.
-
- * gui/e-cal-model.[ch] (e_cal_model_get_use_24_hour_format): new
- function.
-
- * gui/e-cal-view.[ch]: no need to keep the 'use_24_hour' setting,
- it's already in the model.
- (e_cal_view_get_use_24_hour_format,
- e_cal_view_set_use_24_hour_format): new functions.
-
- * gui/e-day-view.[ch] (e_day_view_get_24_hour_format,
- (e_day_view_set_24_hour_format): removed.
- (e_day_view_convert_time_to_display, e_day_view_update_event_label,
- e_day_view_get_time_string_width): use the ECalView's function to
- get the 24 hour format.
-
- * gui/e-week-view.[ch] (e_week_view_get_24_hour_format,
- e_week_view_set_24_hour_format): removed.
- (e_week_view_convert_time_to_display,
- e_week_view_get_time_string_width): use the ECalView's function
- to get the 24 hour format.
-
- * gui/e-day-view-top-item.c (e_day_view_top_item_draw_long_event):
- * gui/e-day-view-time-item.c (e_day_view_time_item_draw):
- * gui/e-week-view-event-item.c (e_week_view_draw_time):
- don't use the view's use_24_hour_format, but the ECalView method.
-
-2003-10-28 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/calendar-component.c (impl_createControls): connect to
- "fill_popup_menu" on the ESourceSelector.
- (fill_popup_menu_callback): add popup menu items here.
- (add_popup_menu_item): new function to add items to the
- popup menu.
- (new_calendar_cb): callbacks for the popup menu items.
-
-2003-10-28 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-cal-view.c: no need to keep the timezone here, it is
- already stored in the model.
- (e_cal_view_get_timezone): call e_cal_model_get_timezone().
- (e_cal_view_set_timezone): call e_cal_model_set_timezone().
- (e_cal_view_new_appointment_for): use the model's timezone.
-
-2003-10-27 Dan Winship <danw@ximian.com>
-
- * pcs/cal-backend.c (cal_backend_notify_object_created,
- cal_backend_notify_object_modified,
- cal_backend_notify_object_removed): New; tell each query about a
- created/modified/removed object.
-
- * pcs/cal.c (cal_notify_object_created): Use
- cal_backend_notify_object_created.
- (cal_notify_object_modified, cal_notify_object_removed): Likewise
- for modified/removed
- (cal_notify_objects_received): we need both the before and after
- forms for the modified objects so they can be resolved as
- adds/modifies/removes per-query. But the caller can just call the
- cal_backend_* routines for each object anyway, so just remove the
- created/modified/removed lists.
-
- * pcs/cal-backend-sync.c (cal_backend_sync_receive_objects):
- Remove created/modified/removed list arguments.
- (_cal_backend_receive_objects): Likewise.
-
- * pcs/cal-backend-file.c (cal_backend_file_receive_objects):
- Remove created/modified/removed list arguments. Replace the one
- use of *removed with a call to cal_backend_notify_object_removed.
-
-2003-10-27 JP Rosevear <jpr@ximian.com>
-
- * gui/gnome-cal.c (setup_widgets): store config objects as well
- (gnome_calendar_set_default_uri): return FALSE if the
- pre-condition fails
- (gnome_calendar_update_config_settings): remove settings that are
- now handled by the config objects
-
- * gui/e-week-view.c (e_week_view_set_compress_weekend): queue a
- draw
-
- * gui/e-itip-control.c (start_default_server): comment out
-
- * gui/e-day-view-config.[hc]: a class to track config changes of
- interest to day views
-
- * gui/e-week-view.[hc]: ditto for week views
-
- * gui/calendar-config.h: add protos
-
- * gui/calendar-config.c: use the #defines for the keys and add
- notification routines
-
- * gui/calendar-config-keys.h: a list of defines for gconf keys
-
- * gui/Makefile.am: build new files
-
-2003-10-27 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-cal-model.h: changed fill_component_from_model virtual
- method to get an ETableModel, not an ECalModel.
-
- * gui/e-cal-model.c (ecm_append_row): the source model sent from
- ETable is an ETableModel, not an ECalModel.
-
- * gui/e-cal-model-calendar.c (ecmc_fill_component_from_model):
- get an ETableModel for the 'source_model' argument.
-
- * gui/e-cal-model-tasks.c (ecmt_fill_component_from_model): ditto.
-
-2003-10-27 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/tasks-component.c (add_uri_for_source): pass FALSE as the
- 'only_if_exists' parameter, so that the calendar gets created when
- it still does not exist.
-
-2003-10-24 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/tasks-component.c (tasks_component_init): initialize private
- structure on TasksComponent.
-
-2003-10-24 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/calendar-component.c (calendar_component_class_init): removed
- repeated initialization.
- (calendar_component_peek): use G_STRLOC for g_warning's.
-
- * gui/tsaks-control.[ch] (tasks_control_activate,
- tasks_control_deactivate): made these 2 functions public.
-
- * gui/tasks-component.[ch]: implementation of the tasks component.
-
- * gui/Makefile.am:
- * gui/GNOME_Evolution_Calendar.server.in.in: added tasks component.
-
- * gui/main.c: ditto.
- (factory): added code to create the tasks component when requested.
-
-2003-10-24 Dan Winship <danw@ximian.com>
-
- * cal-client/cal-client.c (cal_client_get_changes): Remove type arg
-
- * conduits/calendar/calendar-conduit.c (pre_sync, post_sync):
- Update for that
-
- * conduits/todo/todo-conduit.c (pre_sync, post_sync): Likewise
-
- * idl/evolution-calendar.idl (getChanges): Remove type arg.
-
- * pcs/cal.c (impl_Cal_getChanges): Likewise
-
- * pcs/cal-backend.c (cal_backend_get_changes): Likewise
-
- * pcs/cal-backend-sync.c (cal_backend_sync_get_changes): Likewise
-
- * pcs/cal-backend-file.c (cal_backend_file_get_changes): Update
- for that
-
- * pcs/Makefile.am: build libpcs.la and libpcsfile.la instead of
- just .a.
- (libpcs_la_LIBADD): depend on libcal-util.la and libeutil.la
- (libpcsfile_la_LIBADD): depend on libpcs.la
-
-2003-10-24 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-util/cal-util.[ch] (cal_util_construct_instance,
- cal_util_remove_instances): new functions for individual
- instances management.
-
- * pcs/cal-backend-file.c (cal_backend_file_get_object): if we
- dont have a recurrence in our hash table, generate one for the
- specified recurrence ID.
- (match_recurrence_sexp): new function to match recurrences on
- regular expresessions.
- (match_object_sexp): call match_recurrence_sexp() for all recurrences.
- (cal_backend_file_modify_object): handle mod_types.
- (cal_backend_file_remove_object): handle mod_types.
-
-2003-10-24 JP Rosevear <jpr@ximian.com>
-
- * gui/gnome-cal.h: update protos
-
- * gui/gnome-cal.c (gnome_calendar_set_default_uri): set the
- default client based on uri
-
- * gui/calendar-component.c (add_uri_for_source): rename from
- load_uri_for_source and take a calendar
- (remove_uri_for_source): utility routine to remove the source's
- uri from the calendar
- (is_in_selection): checks to see if the uid of the given source
- matches any of those in the given selection
- (update_uris_for_selection): remove any uris no longer in the
- selection, add those that still exist
- (source_selection_changed_callback): call above
- (primary_source_selection_changed_callback): we have the calendar
- easily now; set the default by uri
- (control_activate_cb): handle activation and de-activation
- (impl_createControls): create the calendar control ourselves so we
- have access to the calendar
- (impl_dispose): release the source selection
-
-2003-10-23 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/cal-backend-file.c (add_component): if the component received
- is an instance, add it to the recurrences hash table.
- (free_recurrence): callback for g_hash_table_foreach() to free
- the recurrences in the CalBackendFileObject structure.
- (free_object): call free_recurrence for each recurrence.
- (remove_recurrence_cb): g_hash_table_foreach() callback to
- remove recurrences from the calendar.
- (remove_component): remove all recurrences.
- (cal_backend_file_open): check write access on the file, and
- set read_only flag appropriately.
- (cal_backend_file_is_read_only): return the private flag.
- (cal_backend_file_init): initialize read_only flag.
- (cal_backend_file_get_object): deal with recurrences.
-
- * gui/alarm-notify/notify-main.c (main): unref the alarm
- notification service when terminating.
- (client_die_cb): call bonobo_main_quit instead of gtk_main_quit.
-
-2003-10-23 <jpr@ximian.com>
-
- * gui/gnome-cal.c (gnome_calendar_get_current_view_widget): just
- uses the views array and the current view type
- (setup_widgets): ditto
- (set_view): ditto
- (backend_died_cb): ditto
- (gnome_calendar_get_calendar_model): ditto
- (gnome_calendar_update_config_settings): ditto
-
-2003-10-23 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-day-view.c: accept also text/calendar for D&D.
-
-2003-10-23 JP Rosevear <jpr@ximian.com>
-
- * gui/e-day-view.c (e_day_view_on_top_canvas_drag_data_received):
- fix typo
- (e_day_view_on_main_canvas_drag_data_received): fix C99 issue, fix
- typo
-
-2003-10-23 JP Rosevear <jpr@ximian.com>
-
- * gui/gnome-cal.c (update_query): use the internal client list to
- create the queries
- (gnome_calendar_destroy): use the internal client list to
- disconnect signal handlers
- (gnome_calendar_add_event_uri): add the client to the internal
- list
- (gnome_calendar_remove_event_uri): remove the client from the
- internal list and lookup the client
- (gnome_calendar_update_config_settings): use the internal client
- list to update the config settings
-
-2003-10-23 Harry Lu <harry.lu@sun.com>
-
- * cal-client/cal-client.c: (cal_client_get_timezone): remove and free
- op before return.
-
- * gui/e-cal-view.c (e_cal_view_add_event): modified from
- selection_received_add_event() so that it call be called out of
- e-cal-view.c.
- (selection_received): modified to call e_cal_view_add_event().
-
- * gui/e-cal-view.h: add declaration for e_cal_view_add_event().
-
- * gui/e-day-view.c (e_day_view_on_drag_data_get): Provide a
- icalcomponent for both TARGET_CALENDAR_EVENT and TARGET_VCALENDAR.
- (e_day_view_on_top_canvas_drag_data_received): If dragging between
- different windows, make it works like a copy and paste.
- (e_day_view_on_main_canvas_drag_data_received): ditto.
-
-2003-10-23 JP Rosevear <jpr@ximian.com>
-
- * cal-util/cal-recur.c: update g_date calls to non-deprecated
- calls
-
- * cal-util/Makefile.am: turn off deprecated funcs
-
- * cal-client/Makefile.am: turn off deprecated funcs
-
- * cal-client/cal-client.c (cal_client_get_error_message): add OK
- message
-
- * pcs/cal-backend.[hc]: remove dead funcs
-
- * pcs/query.c: tidy headers
-
-2003-10-23 JP Rosevear <jpr@ximian.com>
-
- * pcs/query.c (query_notify_objects_removed_1): Fix c/p typo -
- call removed instead of modify
-
-2003-10-23 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-cal-view.c (e_cal_view_init): connect also to ETableModel's
- "model_cell_changed" signal.
- (e_cal_view_set_model): likewise.
- (model_cell_changed_cb): callback for "model_cell_changed".
- (e_cal_view_destroy): use g_signal_handlers_disconnect_matched instead
- of g_signal_handlers_disconnect_by_func, so that all handlers are
- disconnected.
-
-2003-10-23 JP Rosevear <jpr@ximian.com>
-
- * pcs/cal.c (cal_notify_object_modified): guard against irrelevant
- args (ie if there was an error)
- (cal_notify_object_removed): ditto
- (cal_notify_timezone_added): ditto
-
- * pcs/cal-backend-sync.c (_cal_backend_is_read_only): init value
- to something known
- (_cal_backend_get_cal_address): ditto
- (_cal_backend_get_alarm_email_address): ditto
- (_cal_backend_get_ldap_attribute): ditto
- (_cal_backend_get_static_capabilities): ditto
- (_cal_backend_modify_object): ditto
- (_cal_backend_remove_object): ditto
- (_cal_backend_get_object_list): ditto
-
-2003-10-22 JP Rosevear <jpr@ximian.com>
-
- * gui/e-cal-list-view.c (e_cal_list_view_new): create a model and
- pass it as an arg during creation
-
- * gui/e-day-view.c (e_day_view_new): unref the model
-
- * gui/e-week-view.c (e_week_view_new): ditto
-
-2003-10-22 JP Rosevear <jpr@ximian.com>
-
- * cal-client/cal-client.c (cal_client_get_object): only change to
- invalid object error code if we got the object but couldn't parse
- it, and only check for timezones if we had success
-
- * gui/comp-util.c (cal_comp_is_on_server): don't throw a warning
- if the object simply does not exist
-
-2003-10-22 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/gnome-cal.[ch] (gnome_calendar_remove_event_uri): new
- function to remove calendars from the views.
-
-2003-10-22 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/GNOME_Evolution_Calendar.server.in.in: Add an
- "evolution:button_icon" attribute.
-
-2003-10-22 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/GNOME_Evolution_Calendar.server.in.in: Add an
- "evoution:button_sort_order" attribute.
-
-2003-10-22 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/calendar-component.c (impl_createControls): Make the
- scrolled window have a GTK_SHADOW_IN shadow.
- * gui/dialogs/meeting-page.c (meeting_page_construct): Likewise.
-
-2003-10-22 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/calendar-component.c (impl_createControls): Set the
- scrollbar policy to "automatic" for both the horizontal and
- vertical scrollbars around the source selector.
-
-2003-10-22 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/GNOME_Evolution_Calendar.server.in.in: Add an
- "evolution:button_label" property on the component for use in the
- shell.
-
-2003-10-21 Rodney Dawes <dobey@ximian.com>
-
- * cal-client/Makefile.am: Fix typo in libcal_client_la_SOURCES
-
-2003-10-21 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/calendar-component.c (calendar_component_init): fixed
- a leak caused by only freeing 'base_uri' in some cases.
-
-2003-10-21 JP Rosevear <jpr@ximian.com>
-
- * gui/control-factory.c (get_prop): fix parse error
- (set_prop): gnome_calendar_open was renamed
-
- * conduits/todo/todo-conduit.c (start_calendar_server): adapt to
- the cal_client_new changes and the lack of a default calendar
- routine
- (pre_sync): don't have to pass a type for the default object any
- more
-
- * conduits/calendar/calendar-conduit.c (start_calendar_server):
- adapt to the cal_client_new changes and the lack of a default
- calendar routine
- (pre_sync): don't have to pass a type for the default object any
- more
-
- * cal-client/cal-client.c (cal_client_open_async): add FIXME
- comment
-
-2003-10-21 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/cal-backend-file.c: store recurrences per object.
- (free_object): free correctly the CalBackendFileObject's
- contained in 'priv->comp_uid_hash'.
- (lookup_component, check_dup_uid, add_component, remove_component,
- match_object_sexp):
- adapted to changes in comp_uid_hash.
-
-2003-10-20 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/gnome-cal.[ch] (gnome_calendar_add_event_uri): renamed
- from gnome_calendar_open.
-
- * gui/calendar-component.c (load_uri_for_source): call
- gnome_calendar_add_event_uri instead of setting the URI property on
- the Bonobo control.
-
-2003-10-17 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/migration.c (process_calendar_dir): process subfolders.
-
-2003-10-17 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/migration.[ch] (migrate_old_calendars): new function.
-
- * gui/calendar-component.c (calendar_component_init): call
- the above function to migrate from old setups.
-
- * gui/Makefile.am: added new files.
-
-2003-10-17 Jeffrey Stedfast <fejj@ximian.com>
-
- * conduits/calendar/Makefile.am: Fixed for libical build changes.
-
- * conduits/todo/Makefile.am: Same.
-
-2003-10-17 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-cal-view.c (on_print): call
- e_cal_view_get_visible_time_range, not the gnome_calendar_
- version.
- (e_cal_view_new_appointment_for, e_cal_view_new_appointment,
- e_cal_view_edit_appointment): new functions.
-
- * gui/gnome-cal.[ch] (gnome_calendar_new_appointment_for,
- gnome_calendar_new_appointment, gnome_calendar_edit_object):
- removed these functions, now available in e-cal-view.
-
- * gui/calendar-commands.c:
- * gui/e-day-view.c:
- * gui/e-week-view-event-item.c:
- * gui/e-week-view.c: replaced calls to gnome_calendar_* with
- e_cal_view_* equivalents.
-
-2003-10-17 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-cal-view.[ch] (e_cal_view_get_default_category):
- (e_cal_view_set_default_category): new functions.
- (e_cal_view_destroy): free the default_category field.
-
- * gui/e-day-view.[ch] (e_day_view_set_default_category):
- removed obsolete function.
- (e_day_view_init, e_day_view_destroy, e_day_view_do_key_press):
- use the ECalView's default_category.
-
- * gui/e-week-view.[ch] (e_week_view_set_default_category):
- removed obsolete function.
- (e_week_view_init, e_week_view_destroy, e_week_view_do_key_press):
- use the ECalView's default_category.
-
- * gui/gnome-cal.c (gnome_calendar_set_query): set the query
- also on the list view by using the priv->views array.
- (search_bar_category_changed_cb, gnome_calendar_set_default_client):
- use the priv->views array.
- (gnome_calendar_get_calendar_model): return the model for the
- current view widget.
- (gnome_calendar_open): removed tasks opening code.
-
-2003-10-16 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/dialogs/new-calendar.c (new_calendar_dialog): if the user
- presses Cancel, just terminate.
-
-2003-10-16 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/calendar-component.c (calendar_component_init): create
- directories for the newly-created calendars.
-
- * gui/dialogs/new-calendar.c (create_new_source_with_group): use
- e_mkdir_hier instead of mkdir.
-
-2003-10-16 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/calendar-component.c (calendar_component_init): if no groups
- are present in the configuration, create the "On This Computer"
- group and the "Personal" and "Work" calendars on it.
-
- * gui/dialogs/new-calendar.c (new_calendar_dialog): moved the
- source creation...
- (create_new_source_with_group): ...here, and made the code create
- the directory for the new calendar.
-
-2003-10-15 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/e-select-names-editable.c (e_selct_names_editable_get_address):
- EDestination -> EABDestination.
-
- * gui/gnome-cal.c (setup_widgets): evolution_dir -> ".evolution".
-
-2003-10-15 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-select-names-editable.c (e_select_names_editable_get_address):
- use EABDestination instead of EDestination.
-
- * gui/gnome-cal.c (gnome_calendar_open): disabled tasks opening code.
-
-2003-10-15 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-meeting-list-view.c: adapted to new addressbook API.
-
- * gui/e-meeting-store.c: adapted to new addressbook API.
- (find_zone): fixed usage of icalcomponent where an icalproperty
- is expected.
- (refresh_busy_periods): fixed call to cal_client_get_free_busy().
-
- * gui/e-meeting-time-sel.c (e_meeting_time_selector_construct):
- added missing variable.
-
-2003-10-15 Jeffrey Stedfast <fejj@ximian.com>
-
- * gui/dialogs/meeting-page.c: #include <gal/e-table/e-table.h>
-
-2003-10-15 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-meeting-list-view.c (start_addressbook_server):
- updated to new addressbook API.
- (book_open_cb): removed unneeded function, since we load
- the local addressbook synchronously.
-
-2003-10-15 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/Makefile.am: added missing header directories.
-
- * pcs/cal-factory.h: include <libical/ical.h>, not <ical.h>.
-
- * gui/dialogs/meeting-page.c: added missing headers.
- (meeting_page_construct): free 'backend_address' as returned
- by cal_client_get_cal_address(). Removed code to create the
- meeting model's ETable not removed with the merge.
-
- * gui/e-meeting-list-view.c: updated addressbook headers.
-
- * gui/gnome-cal.h: added missing ',' in the GnomeCalendarViewType
- enum.
-
-2003-10-14 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-day-view.c (e_day_view_update_query): dont set status
- messages here, already set in e_cal_view_update_query.
- (update_query): removed this function.
- (e_day_view_recalc_day_starts): call e_day_view_update_query,
- not update_query.
-
- * gui/e-week-view.c (e_week_view_update_query): dont set status
- messages here, already set in e_cal_view_update_query.
-
- * gui/gnome-cal.c (adjust_query_for_view): new function to adjust
- the query for the visible time range on a given view.
- (gnome_calendar_set_query): call adjust_query_for_view for each
- one of the views.
-
-2003-10-14 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-cal-view.c (e_cal_view_init): connect to signals on the
- model we create here, so that we get notifications for changes.
-
- * gui/gnome-cal.c (gnome_calendar_set_query): set the query
- on all models.
- (gnome_calendar_open): update the date navigator query.
-
-2003-10-14 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/cal.c (cal_notify_timezone_requested): never send NULL
- strings to ORBit.
-
- * gui/e-cal-view.c (e_cal_view_create_popup_menu): removed
- unneeded variables. Also, fixed a typo that was making the
- menu options be disabled when they should be enabled.
-
-2003-10-13 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-cal-model.[ch] (e_cal_model_get_client_for_uri): new function.
-
- * gui/gnome-cal.[ch] (gnome_calendar_set_default_client): new function.
-
- * gui/calendar-component.c (primary_source_selection_changed_callback):
- set the default client on the calendar view to be the primary
- selection on the source list.
-
-2003-10-13 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/dialogs/new-calendar.c (new_calendar_dialog): set a default group
- on the calendar group option menu and create the source if all checks
- are passed.
-
-2003-10-12 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/dialogs/new-calendar.c (new_calendar_dialog): set up widgets
- loaded from the Glade file.
-
-2003-10-10 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/Makefile.am (etspec_DATA): Add e-cal-list-view.etspec.
- (libevolution_calendar_la_SOURCES): Add e-cal-list-view.[ch].
-
- * gui/calendar-commands.c (show_list_view_clicked): Implement.
- (calendar_get_text_for_folder_bar_label): Add case for list view.
- Use month case and tweak it so it doesn't show "%d - %d" if the
- time span contains only one day.
- (verbs): Add list view.
- (pixmaps): Add list view.
-
- * gui/calendar-view-factory.c (calendar_view_factory_get_title):
- Add list view case.
- (calendar_view_factory_get_type_code): Add list view case.
-
- * gui/control-factory.c (get_prop): Add list view case.
-
- * gui/e-cal-model.c (get_classification): Fix to conform to updated
- libical.
- (ecm_set_value_at): Add missing break statements.
- (ecm_get_color_for_component): Add braces for clarity.
-
- * gui/gnome-cal.c (gnome_calendar_get_current_view_widget): Add
- list view case.
- (get_focus_location): Add list view case.
- (connect_list_view_focus): Implement.
- (setup_widgets): Set up list view.
- (gnome_calendar_direction): Add list view case.
- (set_view): Add list view case.
- (gnome_calendar_setup_view_menus): Add list view factory.
- (gnome_calendar_construct): Account for list view.
- (gnome_calendar_update_config_settings): Account for list view.
- (get_days_shown): Implement list view case.
-
- * gui/gnome-cal.h (GnomeCalendarViewType): Add list view.
-
- * gui/e-cal-list-view.[ch]: Implement ECalListView, subclassing
- ECalView.
-
-2003-10-10 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/dialogs/new-calendar.[ch]: added new widget, which implements
- the dialog to create new calendars.
-
- * gui/dialogs/new-calendar.glade: basic mockup of the dialog.
-
- * gui/dialogs/Makefile.am: added new files.
-
- * gui/calendar-commands.c (file_new_calendar_cb): open the new calendar
- dialog to allow user to create a new cal.
-
-2003-10-10 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/control-factory.c (calendar_properties_init): pass the
- BonoboControl to get_prop/set_prop.
- (get_prop): obtain the GnomeCalendar from the control.
- (set_prop): ditto, and when the URI property is changed,
- sensitize the UI as approppriate.
-
- * gui/calendar-commands.c (calendar_control_sensitize_calendar_commands):
- made this function public.
-
- * gui/calendar-commands.h: added new prototype.
-
-2003-10-10 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/calendar-commands.c (file_new_calendar_cb,
- file_new_appointment_cb, file_new_event_cb, file_new_meeting_cb,
- file_new_task_cb): callbacks for "New..." verbs.
- (sensitize_calendar_commands): sensitize new verbs, and made it
- sensitize correctly based on the set of clients currently loaded.
- (sensitize_taskpad_commands): likewise.
-
-2003-10-09 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/e-cal-model.c (get_classification): Adapt to libical API changes.
- (ecm_set_value_at): Break after each case, so we don't set the passed value
- in more than one field.
-
-2003-10-09 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-cal-view.c (e_cal_view_delete_selected_occurrence):
- * cal-client/cal-client.c (cal_client_remove_object): added missing
- argument when calling cal_client_remove_object_with_mod().
-
-2003-10-09 Rodrigo Moya <rodrigo@ximian.com>
-
- * idl/evolution-calendar.idl: added missing 'rid' argument to the
- removeObject method.
-
- * cal-client/cal-client.c (cal_client_remove_object_with_mod):
- * pcs/cal-backend.h:
- * pcs/cal-backend.c (cal_backend_remove_object):
- * pcs/cal-backend-sync.h:
- * pcs/cal-backend-sync.c (cal_backend_sync_remove_object,
- _cal_backend_remove_object):
- * pcs/cal-backend-file.c (cal_backend_file_remove_object):
- * pcs/cal.c (impl_cal_removeObject): adapted to changes in IDL.
-
-2003-10-09 Jeffrey Stedfast <fejj@ximian.com>
-
- * cal-client/Makefile.am: INCLUDE path fixes for changes made to
- libical build.
-
- * cal-util/Makefile.am: INCLUDE path fixes for changes made to
- libical build.
-
- * cal-util/*.[c,h]: #include <libical/ical.h> instead of <ical.h>
-
- * gui/Makefile.am: INCLUDE path fixes for changes made to libical
- build.
-
- * gui/*.[c,h]: #include <libical/ical.h> instead of <ical.h>
-
- * gui/alarm-notify/Makefile.am: INCLUDE path fixes for changes
- made to libical build.
-
- * gui/alarm-notify/config-data.h: #include <libical/ical.h>
- instead of <ical.h>
-
- * gui/dialogs/Makefile.am: INCLUDE path fixes for changes made to
- libical build.
-
- * gui/dialogs/comp-editor-util.c: #include <libical/ical.h>
- instead of <ical.h>
-
- * gui/dialogs/e-delegate-dialog.c: #include <libical/ical.h>
- instead of <ical.h>
-
- * importers/Makefile.am: INCLUDE path fixes for changes made to
- libical build.
-
- * pcs/Makefile.am: INCLUDE path fixes for changes made to libical
- build.
-
- * pcs/cal.c: #include <libical/ical.h> instead of <ical.h>
-
-2003-10-08 Harry Lu <harry.lu@sun.com>
-
- * gui/dialogs/alarm-options.glade: Make repeat-quantity and
- repeat-value of alarm option dialog numeric only.
-
- * gui/dialogs/task-details-page.glade: Make percent-complete of
- task details dialog numeric only.
-
-2003-10-08 Chris Toshok <toshok@ximian.com>
-
- * gui/dialogs/e-delegate-dialog.c (e_delegate_dialog_construct):
- EDestination => EABDestination, and e_destination =>
- eab_destination.
- (e_delegate_dialog_get_delegate): same.
- (e_delegate_dialog_get_delegate_name): same.
-
- * gui/dialogs/comp-editor-util.c: remove unnecessary #include of
- e-destination.h.
-
- * gui/dialogs/alarm-options.c (alarm_to_malarm_widgets):
- EDestination => EABDestination, and e_destination =>
- eab_destination.
- (malarm_widgets_to_alarm): same.
-
- * gui/e-meeting-model.c (book_open_cb): track change to error
- return codes.
- (start_addressbook_server): use
- e_book_async_get_default_addressbook.
- (contacts_cb): rename cursor_cb to this, as we no longer get
- passed a cursur, and we don't need to check the email address
- since the query is now "is" instead of "contains".
- (refresh_busy_periods): use an "is" query, and use
- e_book_async_get_contacts instead of getting a CardCursor.
- (process_section): this takes an EABDestination** instead of a
- SimpleCardList*, which is gone.
- (select_names_ok_cb): get "destinations" instead of
- "simple_card_list".
-
-2003-10-08 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-client/cal-client.c (cal_client_is_read_only): fixed
- documentation comments.
-
- * gui/calendar-commands.c (sensitize_calendar_commands): figure
- out read-only menu items to disable based on the currently
- selected object's CalClient.
-
-2003-10-08 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-client/cal-client.c: set better error m,essages on the
- E_CALENDAR_CHECK_STATUS macro.
- (cal_client_get_error_message): new function.
-
- * cal-client/cal-client.h: added new prototype.
-
- * gui/dialogs/comp-editor.c (save_comp): use the GError argument
- for the cal_client_create/_modify_object calls, and display the
- error message coming from the backend.
-
- * gui/comp-util.c (cal_comp_is_on_server): likewise.
-
-2003-10-07 Dan Winship <danw@ximian.com>
-
- * idl/evolution-calendar.idl (getDefaultObject): Remove the "type"
- arg; the backend knows what type it is
-
- * pcs/cal.c (impl_Cal_getDefaultObject): Likewise
-
- * pcs/cal-backend.c (cal_backend_get_default_object): Likewise
-
- * pcs/cal-backend-sync.c (cal_backend_sync_get_default_object,
- _cal_backend_get_default_object): Likewise
-
- * pcs/cal-backend-file.c (cal_backend_file_get_default_object):
- Likewise. (Use cal_backend_get_kind() instead.)
-
- * cal-client/cal-client.c (cal_client_get_default_object):
- Likewise
-
- * gui/comp-util.c (cal_comp_event_new_with_defaults,
- cal_comp_task_new_with_defaults): Update calls to
- cal_client_get_default_object().
-
- * pcs/cal-backend-sync.c (_cal_backend_get_static_capabilities):
- Use the right cal notification
-
-2003-10-07 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-cal-model.c (e_cal_model_create_component_with_defaults):
- dont clone NULL icalcomponent's.
-
-2003-10-07 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-cal-model.c (e_cal_model_get_default_client): make sure we
- always return a default client, if possible, since we rely on having
- a default client in many places.
-
- * gui/e-day-view.c (e_day_view_do_key_press): dont create event if
- e_cal_model_create_component_with_defaults returns NULL.
-
- * gui/e-week-view.c (e_week_view_do_key_press): dont create event if
- e_cal_model_create_component_with_defaults returns NULL.
-
-2003-10-06 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-cal-model.c (e_cal_model_create_component_with_defaults):
- make sure the component has always an UID.
-
- * gui/e-day-view.c (e_day_view_find_event_from_uid):
- * gui/e-week-view.c (e_week_view_find_event_from_uid): check
- pointers passed to strcmp().
-
-2003-10-06 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/gnome-cal.c (gnome_calendar_open): added missing call to
- cal_client_open().
-
- * cal-client/cal-client.c (cal_client_new): fixed documentation
- comments.
- (cal_client_open): emit CAL_OPENED signal with appropriate status codes.
- (open_sync): dont emit CAL_OPENED signal, it's already emitted in
- cal_client_open().
-
-2003-10-06 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/comp-editor-factory.c (open_client):
- * gui/gnome-cal.c (gnome_calendar_open, gnome_calendar_construct):
- * gui/calendar-offline-handler.c (backend_go_offline, backend_go_online,
- calendar_offline_handler_init): adapted to changes in cal_client and
- manage GError's returned by cal_client_open.
-
- * gui/e-itip-control.c: dont run anymore sub event loops.
- (start_calendar_server): use synchronous interface for opening calendars.
- (start_default_server): renamed it from *_async.
- (start_calendar_server_cb): removed unneeded function.
- (object_requested_cb): use sync interface.
-
- * gui/e-tasks.c (e_tasks_construct): dont create the CalClient here.
- (e_tasks_open): do it here, where we've got all the info needed.
-
- * importers/icalendar-importer.c (update_single_object): killed warning.
- (ical_importer_new, vcal_importer_new): don't create CalClient's here.
- (load_file_fn): create them here.
- (vcal_load_file_fn): and here.
- (gnome_calendar_import_data_fn): fixed usage of cal_client_*.
-
- * */*: integrated JP's changes for synchronous open's in cal_client
- and one model per view instead of one model for all views.
-
-2003-10-02 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-client/cal-client.c (cal_client_modify_object): return FALSE
- if the icalcomponent is NULL.
-
- * gui/e-day-view.c (e_day_view_finish_resize): commit sequence on
- CalComponent after changing start/end dates.
-
-2003-10-01 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-day-view.c (process_component):
- * gui/e-week-view.c (process_component): expand recurrences here.
-
-2003-09-30 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/cal-backend-file.c (match_recurrence_sexp): removed.
- (match_object_sexp): dont expand recurrences here.
-
-2003-09-30 Mike Kestner <mkestner@ximian.com>
-
- * cal-util/cal-util-marshal.list : new VOID:STRING,STRING,STRING
- * gui/Makefile.am : build the new view/store/renderer/editable
- * gui/e-select-names-renderer.* : new completion cell renderer
- * gui/e-select-names-editable.* : new completion cell editable
- * gui/e-meeting-model.* : killed. code reused in list-view/store
- * gui/e-meeting-store.* : port of EMeetingModel to GtkTreeModel
- * gui/e-meeting-list-view.* : GtkTreeView subclass for attendee lists
- * gui/e-meeting-time-sel.c : Use the new store/view
- * gui/e-meeting-time-sel-item.c : Use the new store/view
- * gui/dialogs/Makefile.am : don't install the etspec anymore.
- * gui/dialogs/event-editor.c : Use the new store/view.
- * gui/dialogs/meeting-page.c : Use the new store/view.
- * gui/dialogs/shedule-page.c : Use the new store/view.
- * gui/dialogs/task-editor.c : Use the new store/view.
-
-2003-09-29 JP Rosevear <jpr@ximian.com>
-
- * conduits/todo/Makefile.am: link to libical-evolution
-
- * conduits/calendar/Makefile.am: ditto
-
-2003-09-26 JP Rosevear <jpr@ximian.com>
-
- * pcs/cal-backend.c (cal_backend_class_init): remove cal_added
- signal
-
-2003-09-26 JP Rosevear <jpr@ximian.com>
-
- * pcs/cal.h: add protos
-
- * pcs/cal.c (cal_get_backend): accessor
- (cal_get_listener): ditto
-
- * pcs/cal-factory.c (impl_CalFactory_getCal): update to new
- routine name
-
- * pcs/cal-backend.h: add protos
-
- * pcs/cal-backend.c (cal_backend_init): init client mutex
- (cal_backend_finalize): destroy client mutex
- (cal_destroy_cb): just remove the client
- (listener_died_cb): remove the client, the listener died so it
- can't really do anything
- (last_client_gone): signal the last client gone
- (cal_backend_add_client): add a client with locking and listen for
- the death of the listener
- (cal_backend_remove_client): remove client
-
-2003-09-26 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/cal-backend-sync.c (_cal_backend_create_object): only free the
- returned UID if it's not NULL.
-
- * pcs/cal.c (cal_notify_object_created): dont send NULL strings to
- ORBit code.
-
-2003-09-26 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/comp-util.c (cal_comp_is_on_server): free the icalcomponent
- returned from cal_client_get_object, and return TRUE if we find
- the component on the backend.
-
- * gui/e-day-view.c (process_component):
- * gui/e-week-view.c (process_component): added missing case, so that
- we also display recurrent meetings starting before the time range and
- ending after the time range.
-
- * cal-client/cal-listener.c (impl_notifyReadOnly): pass the
- 'read_only' argument to the signal callback correctly (a gboolean
- not a 'gboolean *').
-
- * gui/comp-editor-factory.c (resolve_pending_requests): removed
- the g_assert on 'oc->pending != NULL', since there are now cases
- (local calendar) where we get to call this function (cal_opened_cb)
- with no pending requests yet.
-
-2003-09-25 JP Rosevear <jpr@ximian.com>
-
- * gui/calendar-commands.c (publish_freebusy_cmd): adapt to new
- get_free_busy api
-
- * conduits/calendar/calendar-conduit.c (post_sync): ditto
- (pre_sync): ditto
-
- * conduits/todo/todo-conduit.c (pre_sync): ditto
- (post_sync): ditto
-
- * gui/e-meeting-model.c (refresh_busy_periods): ditto
-
- * gui/e-itip-control.c (send_freebusy): ditto
-
- * gui/e-cal-view.c (on_publish): ditto
-
- * cal-client/cal-listener.h: add signals
-
- * cal-client/cal-listener.c (build_change_list): move here from
- cal-client.c
- (impl_notifyChanges): implement
- (build_free_busy_list): util to create the GList of free busy
- objects
- (impl_notifyFreeBusy): implement
- (cal_listener_class_init): set free busy and changes epv methods,
- add signals
-
- * cal-client/cal-client.h: update protos
-
- * cal-client/cal-client.c (cal_get_changes_cb): get changes call
- back
- (cal_get_free_busy_cb): get free busy call back
- (cal_client_init): listen for free busy and changes signals
- (cal_client_get_changes): convert to new threaded sync api
- (cal_client_get_free_busy): ditto
-
- * pcs/cal.h: add protos
-
- * pcs/cal.c: remove dead type conversion function
- (impl_Cal_getChanges): implement by just calling, no return stuff
- (impl_Cal_getFreeBusy): ditto
- (cal_notify_changes): do getChanges callback
- (cal_notify_free_busy): do getFreeBusy callback
-
- * pcs/cal-backend.h: update protos, vmethods
-
- * pcs/cal-backend.c (cal_backend_get_free_busy): call through
- (cal_backend_get_changes): ditto
-
- * pcs/cal-backend-sync.h: add vmethods, protos
-
- * pcs/cal-backend-sync.c (cal_backend_sync_get_changes): call
- through
- (cal_backend_sync_get_free_busy): ditto
- (_cal_backend_get_changes): backend implementation, notify
- (_cal_backend_get_free_busy): ditto
- (cal_backend_sync_class_init): set free busy and changes
- implementations
-
- * pcs/cal-backend-file.c (cal_backend_file_get_free_busy): convert
- to sync backend method
- (cal_backend_file_compute_changes_foreach_key): remove from the
- hash here
- (cal_backend_file_compute_changes): no need to build the sequence
- here
- (cal_backend_file_get_changes): convert to sync backend method
- (cal_backend_file_class_init): set sync backend methods for free
- busy and changes
-
- * idl/evolution-calendar.idl: convert getChanges and getFreeBusy
- to new async api
-
-2003-09-25 JP Rosevear <jpr@ximian.com>
-
- * pcs/cal-backend.h: remove dead result enums
-
- * pcs/cal-backend.c: fix comments
-
- * idl/evolution-calendar.idl: remove dead exceptions
-
-2003-09-25 JP Rosevear <jpr@ximian.com>
-
- * pcs/cal.c (cal_notify_default_object): send back the empty
- string if the object is NULL
- (cal_notify_object): ditto
-
-2003-09-25 JP Rosevear <jpr@ximian.com>
-
- * gui/comp-editor-factory.c (edit_existing): convert to api
- changes
-
- * conduits/todo/todo-conduit.c (local_record_from_uid): ditto
- (pre_sync): ditto
-
- * conduits/calendar/calendar-conduit.c (local_record_from_uid):
- ditto
- (pre_sync): ditto
-
- * importers/icalendar-importer.c (update_single_object): ditto
-
- * gui/dialogs/comp-editor.c (obj_updated_cb): ditto
-
- * gui/e-itip-control.c (get_real_item): ditto
- (find_server): ditto
-
- * gui/comp-util.c (cal_comp_is_on_server): ditto
- (cal_comp_event_new_with_defaults): ditto
- (cal_comp_task_new_with_defaults): ditto
-
- * cal-client/cal-listener.h: add signals
-
- * cal-client/cal-listener.c (impl_notifyDefaultObjectRequested):
- implement
- (impl_notifyObjectRequested): ditto
- (cal_listener_class_init): set above epv implementations, add signals
-
- * cal-client/cal-client.h: update protos
-
- * cal-client/cal-client.c (cal_default_object_requested_cb): get
- default object callback
- (cal_object_requested_cb): get object callback
- (cal_client_init): listen for get and get default object signals
- (cal_client_get_default_object): convert to new sync api
- (cal_client_get_object): ditto
-
- * pcs/cal.h: add protos
-
- * pcs/cal.c (impl_Cal_getDefaultObject): just call the backend, it
- does the notification now
- (impl_Cal_getObject): ditto
- (cal_notify_default_object): do getDefaultObject response
- (cal_notify_object): do getObject response
-
- * pcs/cal-backend.h: remove vmethods, protos
-
- * pcs/cal-backend.c: remove a couple of dead functions
- (cal_backend_class_init): get_object_component is no longer a
- vmethod
- (cal_backend_get_default_object): call through
- (cal_backend_get_object): ditto
-
- * pcs/cal-backend-sync.h: add protos, vmethods
-
- * pcs/cal-backend-sync.c (cal_backend_sync_get_default_object):
- call through
- (cal_backend_sync_get_object): ditto
- (_cal_backend_discard_alarm): pass correct params to
- cal_notify_discard_alarm
- (_cal_backend_get_default_object): call through and notify
- (_cal_backend_get_object): ditto
- (cal_backend_sync_class_init): set backend implementations
-
- * pcs/cal-backend-file.c (cal_backend_file_get_default_object):
- convert to sync backend method
- (cal_backend_file_get_object): ditto
- (cal_backend_file_compute_changes_foreach_key): just look up the
- component rather than using the backend vmethod
- (cal_backend_file_remove_object): return valid sync status codes
- (cal_backend_file_class_init): move get_object, get_default_object
- to sync class
-
- * idl/evolution-calendar.idl: convert getObject and
- getDefaultObject to new async idl
-
-2003-09-25 JP Rosevear <jpr@ximian.com>
-
- * pcs/cal.c (impl_Cal_discardAlarm): just call the backend
- function, it does the notification
- (cal_notify_alarm_discarded): notify of discard alarm call
-
- * pcs/cal-backend.h: update proto
-
- * pcs/cal-backend.c (cal_backend_discard_alarm): call through
-
- * pcs/cal-backend-sync.h: add proto, vmethod
-
- * pcs/cal-backend-sync.c (cal_backend_sync_discard_alarm): call
- through
- (_cal_backend_discard_alarm): call through and notify
- (cal_backend_sync_class_init): set discard alarm implementation
-
- * pcs/cal-backend-file.c (cal_backend_file_discard_alarm): match
- sync backend vmethod
- (cal_backend_file_class_init): set alarm vmethod implementation
-
- * idl/evolution-calendar.idl: switch discardAlarm to new api
-
- * gui/alarm-notify/alarm-queue.c (remove_queued_alarm): match new
- api
-
- * cal-client/cal-listener.h: add signal
-
- * cal-client/cal-listener.c (impl_notifyAlarmDiscarded): implement
- (cal_listener_class_init): add alarm, send, receive epv functions,
- alarm signal
-
- * cal-client/cal-client.h: update proto
-
- * cal-client/cal-client.c (cal_alarm_discarded_cb): discardAlarm
- callback
- (cal_client_init): listen to discard alarm signal
- (cal_client_discard_alarm): implement with new threaded sync api
-
-2003-09-25 JP Rosevear <jpr@ximian.com>
-
- * idl/evolution-calendar.idl: remove unused user exceptions
-
-2003-09-24 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/cal-backend-util.[ch] (cal_backend_util_fill_alarm_instances_seq):
- removed unneeded function.
-
-2003-09-24 JP Rosevear <jpr@ximian.com>
-
- * conduits/*/*.c: adjust to new timezone api calls
-
- * gui/*.c: ditto
-
- * gui/dialogs/*.c: ditto
-
- * cal-client/cal-listener.h: add new signals
-
- * cal-client/cal-listener.c (convert_status): convert invalid
- object as well
- (impl_notifyTimezoneRequested): implement
- (impl_notifyDefaultTimezoneSet): ditto
- (cal_listener_class_init): set epv implementations for timezone
- functions
- (cal_listener_class_init): create timezone response signals
-
- * cal-client/cal-client.h: update protos
-
- * cal-client/cal-client.c: fix return values all over the place
- (cal_get_timezone_cb): getTimezone response
- (cal_query_cb): setDefaultTimezone response
- (cal_client_init): listen for new response signals
- (cal_client_get_timezone): implement using new thread sync api
- (cal_client_ensure_timezone_on_server): use add timezone call
- (cal_client_set_default_timezone): oimplement using new thread sync
- api
-
- * cal-client/cal-client-types.h: add invalid object status code
-
- * idl/evolution-calendar.idl: getQuery no longer raises any user
- exceptions, remove dead types and exceptions
-
-2003-09-24 JP Rosevear <jpr@ximian.com>
-
- * pcs/cal.h: new protos
-
- * pcs/cal.c (impl_Cal_getTimezone): call backend implementation
- (impl_Cal_addTimezone): ditto
- (impl_Cal_setDefaultTimezone): ditto
- (cal_class_init): set epv implementations of timezone functions
- (cal_notify_timezone_requested): notify of get timezone response
- (cal_notify_default_timezone_set): notify of default timezone
- being set
-
- * pcs/cal-backend.h: new vmethods, protos
-
- * pcs/cal-backend.c (cal_backend_class_init): init new timezone
- vmethods
- (cal_backend_get_timezone): call through
- (cal_backend_set_default_timezone): ditto
- (cal_backend_add_timezone): ditto
- (cal_backend_internal_get_default_timezone): ditto
- (cal_backend_internal_get_timezone): ditto
-
- * pcs/cal-backend-sync.h: add vmethods, protos
-
- * pcs/cal-backend-sync.c (cal_backend_sync_get_timezone): call
- through
- (cal_backend_sync_set_default_timezone): ditto
- (_cal_backend_set_default_timezone): call through and notify
- (_cal_backend_get_timezone): ditto
- (cal_backend_sync_class_init): set backend implementations for new
- funcs
-
- * pcs/cal-backend-object-sexp.c (func_occur_in_time_range): get
- time_t values based on the zone
-
- * pcs/cal-backend-file.c: reorg so we don't have to prototype
- everything
- (cal_backend_file_get_timezone): implement the sync backend way
- (cal_backend_file_add_timezone): ditto
- (cal_backend_file_set_default_timezone): ditto
- (cal_backend_file_internal_get_default_timezone): internal method,
- for sexp comparison
- (cal_backend_file_internal_get_timezone): ditto
-
- * idl/evolution-calendar.idl: convert timezone routines to async
- api
-
-2003-09-23 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/cal-backend-object-sexp.c (func_occur_in_time_range): dont expand
- recurrences, since they are supposed to be expanded in the backends.
- (instance_occur_cb, resolve_tzid): removed unneeded functions.
-
- * pcs/cal-backend-file.c (cal_backend_file_add_timezone): guard against
- adding the timezone if it's already there.
-
-2003-09-23 JP Rosevear <jpr@ximian.com>
-
- * pcs/cal.c (cal_notify_object_created): notify with the object,
- not the uid
-
- * gui/e-cal-model.c (add_new_client): don't listen for
- non-existent signal
-
-2003-09-23 JP Rosevear <jpr@ximian.com>
-
- * cal-client/cal-client.h: remove dead proto
-
-2003-09-23 JP Rosevear <jpr@ximian.com>
-
- * cal-client/cal-client.h: remove send result enum
-
- * gui/itip-utils.c (comp_server_send): use the new send_objects
- routine
-
-2003-09-23 JP Rosevear <jpr@ximian.com>
-
- * cal-client/cal-client.h: remove send result enum
-
-2003-09-23 JP Rosevear <jpr@ximian.com>
-
- * cal-client/cal-client.h: remove enum, protos
-
- * cal-client/cal-client.c: remove remove status enum typing
-
-2003-09-23 Rodrigo Moya <rodrigo@ximian.com>
-
- * importers/icalendar-importer.c (update_objects): new function
- to manage the update of components, taking into account
- VTIMEZONE components.
- (process_item_fn, gnome_calendar_import_data_fn): use
- update_objects instead of cal_client_update_objects.
-
-2003-09-23 JP Rosevear <jpr@ximian.com>
-
- * pcs/cal.h: update proto
-
- * pcs/cal.c (impl_Cal_addTimezone): just call add_timezone, it
- does the notification
- (cal_notify_object_created): only notify the query if the object
- matches
- (cal_notify_object_removed): ditto
-
- * pcs/cal-backend.h: update proto, vmethod
-
- * pcs/cal-backend.c (cal_backend_add_timezone): returns void
-
- * pcs/cal-backend-sync.h: update proto, vmethod
-
- * pcs/cal-backend-sync.c (cal_backend_sync_remove_object): add the
- object as an out param
- (_cal_backend_remove_object): get the object and pass it in the
- notification
-
- * pcs/cal-backend-file.c (cal_backend_file_create_object): kill
- cal_backend_file_update_objects call, its more efficient to create
- the comp ourselves; stamp the creation time, add the component to
- the toplevel
- (cal_backend_file_modify_object): kill the
- cal_backend_file_update_objects call, add the component to the
- toplevel
- (cal_backend_file_remove_object): pass back the object when
- removing
-
-2003-09-23 JP Rosevear <jpr@ximian.com>
-
- * cal-client/cal-query.c (cal_query_finalize): disconnect the
- signal handlers
-
- * cal-client/cal-client.c (cal_client_get_query): unref the
- listener when done
-
-2003-09-23 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-cal-view.c (selection_received): add VTIMEZONE components
- contained in the clipboard data to the backend.
-
-2003-09-22 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/comp-editor.c (save_comp): modify and create instead
- of update, simplify mod code
-
-2003-09-22 JP Rosevear <jpr@ximian.com>
-
- * gui/e-day-view.c (e_day_view_finish_long_event_resize): modify
- the object instead of update, simplify the instance handling
- (e_day_view_finish_resize): ditto
- (e_day_view_on_top_canvas_drag_data_received): ditto
- (e_day_view_on_main_canvas_drag_data_received): ditto
-
-2003-09-22 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-client/cal-client.c (cal_client_get_alarms_in_range): use
- 'has-alarms' function in the search expression.
-
- * pcs/cal-backend-object-sexp.c (func_has_alarms): new SExp function.
-
-2003-09-22 JP Rosevear <jpr@ximian.com>
-
- * gui/e-day-view.c (e_day_view_on_editing_stopped): create the
- object if its not on the server or modify it if it is
-
- * gui/e-week-view.c (e_week_view_on_editing_stopped): we return if
- there is no text and it *not* on the server
-
-2003-09-22 JP Rosevear <jpr@ximian.com>
-
- * gui/e-week-view.c (e_week_view_on_editing_stopped): create the
- object if its not on the server or modify it if it is
-
-2003-09-22 JP Rosevear <jpr@ximian.com>
-
- * gui/gnome-cal.h: remove proto
-
- * gui/gnome-cal.c: remove gnome_calendar_unrecur_selection
-
- * gui/e-week-view.h: remove proto
-
- * gui/e-week-view.c: remove e_week_view_unrecur_appointment
-
- * gui/e-day-view.h: remove proto
-
- * gui/e-day-view.c: remove e_day_view_unrecur_appointment
-
- * gui/e-cal-view.c: remove on_unrecur_appointment (this is handled
- better via recurrence id's now)
-
-2003-09-22 JP Rosevear <jpr@ximian.com>
-
- * gui/e-itip-control.c (update_attendee_status): ifdef out, leave
- temporarily for reference, but otherwise it shouldn't be needed
- (update_item): switch to using receive objects
- (ok_clicked_cb): update item when receiving a reply
-
- * gui/e-calendar-table.c (selection_received): switch to using
- create object from update_objects
-
- * gui/e-cal-view.c (selection_received_add_event): util routine to
- prevent duplication
- (selection_received): use above
-
- * gui/e-cal-model.c (ecm_set_value_at): switch to using modify
- object from update_objects
- (ecm_append_row): switch to using create object from
- update_objects
-
- * gui/e-cal-model-calendar.c (ecmc_set_value_at): switch to using
- modify object from update_objects
-
- * gui/e-cal-model-tasks.c (ecmt_set_value_at): ditto
-
-2003-09-22 Hans Petter Jansson <hpj@ximian.com>
-
- * cal-util/Makefile.am (libical_util_la_LIBADD):
- libical.la -> libical-evolution.la
-
- * importers/Makefile.am (libevolution_calendar_importers_la_LIBADD):
- libicalvcal.la -> libicalvcal-evolution.la
-
-
-2003-09-19 Rodrigo Moya <rodrigo@ximian.com>
-
- * idl/evolution-calendar.idl: removed getAlarmsInRange and
- getAlarmsForObject methods.
-
- * pcs/cal.c (impl_Cal_getAlarmsInRange, impl_Cal_getAlarmsForObject):
- removed unneeded CORBA methods.
- (cal_class_init): dont set removed methods in the epv.
-
- * pcs/cal-backend.[ch]: removed get_alarms_in_range and
- get_alarms_for_object virtual methods.
- (cal_backend_get_alarms_in_range, cal_backend_get_alarms_for_object):
- removed.
- (cal_backend_class_init): dont set removed virtual methods.
-
- * pcs/cal-backend-file.c (cal_backend_file_get_alarms_in_range,
- cal_backend_file_get_alarms_for_object): removed.
- (cal_backend_file_class_init): dont set removed virtual methods.
-
-2003-09-19 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-client/cal-client.c (cal_client_get_alarms_in_range): changed
- to use queries.
- (build_component_alarms_list): create the alarm list from a list
- of iCalendar strings.
- (build_alarm_instance_list): removed.
- (cal_client_get_alarms_for_object): dont call the CORBA methods,
- just get alarms by itself.
-
-2003-09-18 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-client/cal-listener.[ch]: added "add_timezone" signal.
- (impl_notifyTimezoneAdded): implemented new CalListener method.
- (cal_listener_class_init): create "add_timezone" signal for the class.
-
- * cal-client/cal-client.[ch] (cal_client_add_timezone): new function.
- (cal_client_init): connect to "add_timezone" signal on the
- CalListener.
- (cal_add_timezone_cb): callback for the "add_timezone" signal.
-
-2003-09-18 Rodrigo Moya <rodrigo@ximian.com>
-
- * idl/evolution-calendar.idl: added 'notifyTimezoneAdded' method
- to the Calendar::Listener interface.
-
- * pcs/cal-backend-sync.[ch] (cal_backend_sync_add_timezone):
- (_cal_backend_add_timezone): new functions for the new virtual
- method implementation.
-
- * pcs/cal.[ch] (cal_notify_timezone_added): new function.
-
- * pcs/cal-backend-file.c (cal_backend_add_timezone): converted to
- return a CalBackendSyncStatus.
- (cal_backend_file_class_init): the 'add_timezone' method we implement
- is the one in the CalBackendSync class.
- (cancel_receive_object): added missing 'return'.
- (free_cal_component): removed unused function.
-
-2003-09-17 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/cal-backend-file.c (cal_backend_add_timezone): added new
- virtual method implementation.
-
- * pcs/cal.c (impl_Cal_addTimezone): check return value from
- cal_backend_add_timezone, and set an exception if an error is
- returned.
-
-2003-09-16 Rodrigo Moya <rodrigo@ximian.com>
-
- * idl/evolution-calendar.idl: added addTimezone method.
-
- * pcs/cal.c (impl_Cal_addTimezone): implemented new method.
- (cal_class_init): set new method on the epv.
-
- * pcs/cal-backend.[ch]: added 'add_timezone' virtual method.
- (cal_backend_add_timezone): implemented new virtual method.
-
- * pcs/cal-backend-file.c (cal_backend_file_modify_object): it's
- cal_component_get_as_string, not cal_component_as_string.
-
- * cal-client/cal-client.c (cal_client_ensure_timezone_on_server):
- dont use anymore updateObjects method, use addTimezone instead.
-
-2003-09-16 Rodrigo Moya <rodrigo@ximian.com>
-
- * conduits/todo/Makefile.am: removed libwombat reference.
-
-2003-09-15 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/cal-backend-file.c (cal_backend_file_create_object): return
- the UID of the added object.
- (cal_backend_file_remove_object): ditto for old_object.
-
-2003-09-15 JP Rosevear <jpr@ximian.com>
-
- * conduits/todo/todo-conduit.c (replace_record): switch to modify
- object
- (add_record): switch to using create object
-
- * conduits/calendar/calendar-conduit.c (process_multi_day): switch
- to using create object
- (add_record): switch to using create object
- (replace_record): switch to modify object
-
- * cal-client/cal-listener.h: add signals
-
- * cal-client/cal-listener.c (impl_notifyObjectsReceived):
- implement listener method
- (build_object_list): ditto
- (cal_listener_class_init): create receive_objects and send_objects
- signals
-
- * cal-client/cal-client.h: add, update protos
-
- * cal-client/cal-client.c (cal_objects_received_cb):
- receive_objects callback
- (cal_objects_sent_cb): send_objects callback
- (cal_client_init): listen for above signals
- (cal_client_create_object): pass back uid
- (cal_client_receive_objects): implement
- (cal_client_send_objects): ditto
-
- * idl/evolution-calendar.idl: add receive/send objects methods and
- yank updateObjects
-
- * pcs/cal.h: add protos
-
- * pcs/cal.c (impl_Cal_receiveObjects): implement
- (impl_Cal_sendObjects): ditto
- (cal_class_init): add epv methods
- (cal_notify_objects_received): notify of objects received call,
- updating queries
- (cal_notify_objects_sent): notify of objects sent
-
- * pcs/cal-backend.h: remove proto
-
- * pcs/cal-backend.c (cal_backend_class_init): remove obj_updated
- signal
- (cal_backend_class_init): init vmethods properly
- (cal_backend_receive_objects): call through
- (cal_backend_send_objects): ditto
-
- * pcs/cal-backend-sync.h: add protos, vmethods
-
- * pcs/cal-backend-sync.c (cal_backend_sync_receive_objects): call
- through
- (cal_backend_sync_send_objects): ditto
- (_cal_backend_receive_objects): call backend method and notify
- (_cal_backend_send_objects): ditto
- (cal_backend_sync_class_init): override send/receive object
- vmethods
-
- * pcs/cal-backend-file.c (cal_backend_file_class_init): set
- remove/send objects sync vmethods
- (cal_backend_file_create_object): remove call to dead method
- (cal_backend_file_remove_object): ditto
- (cal_backend_file_modify_object): ditto
- (cancel_received_object): cancel an object
- (check_tzids): check we have all the tzid's for the object
- (cal_backend_file_receive_objects): receive a bunch of objects via
- itip
- (cal_backend_file_send_objects): skeleton implementation
-
-2003-09-15 Rodrigo Moya <rodrigo@ximian.com>
-
- * idl/evolution-calendar.idl: added InvalidObject CallStatus.
-
- * pcs/cal-backend-file.c (cal_backend_file_create_object): implemented.
- (cal_backend_file_modify_object): implemented.
-
-2003-09-15 Harry Lu <harry.lu@sun.com>
-
- * gui/apps_evolution_calendar.schemas: change last_notification_time's
- type from string to int.
-
-2003-09-12 Bolian Yin <bolian.yin@sun.com>
-
- * e-week-view.c (e_week_view_focus): make jump button focusable
- (e_week_view_on_jump_button_event): key_press and focus event for jump button
- (e_week_view_jump_to_button_item): new function, jump to the day view.
- (e_week_view_is_jump_button_visible): new function.
-
-
-2003-09-12 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/cal.c (cal_notify_cal_address, cal_notify_alarm_email_address,
- cal_notify_ldap_attribute, cal_notify_static_capability):
- make sure we always notify listeners, regardless of whether the
- string is empty or not.
-
- * cal-client/cal-client.c (check_capability): guard against using
- NULL strings with strstr.
-
-2003-09-12 JP Rosevear <jpr@ximian.com>
-
- * cal-client/client-test.c (cal_opened_cb): listen for other query
- signals
-
- * cal-client/cal-listener.h: add signals
-
- * cal-client/cal-listener.c (impl_notifyObjectCreated): implement
- (impl_notifyObjectModified): implement
- (cal_listener_class_init): assign epv implementations
- (cal_listener_class_init): add create/modify object signals
-
- * cal-client/cal-client.h: add protos
-
- * cal-client/cal-client.c (cal_object_created_cb): object created
- callback
- (cal_object_modified_cb): object modified callback
- (cal_client_init): listen for create/modify object signals from
- the listener
- (cal_client_create_object): call the create object method
- (cal_client_modify_object): call the modify object method
-
- * cal-client/client-test.c (cal_opened_cb): listen for all the
- query signals, tidy
-
-2003-09-12 JP Rosevear <jpr@ximian.com>
-
- * pcs/cal.c (impl_Cal_createObject): implement
- (impl_Cal_modifyObject): ditto
- (cal_class_init): set epv methods for create/modify
-
- * pcs/cal-backend.h: add protos, vmethod
-
- * pcs/cal-backend.c (cal_backend_class_init): init new vmethods
- (cal_backend_create_object): call through
- (cal_backend_modify_object): ditto
-
- * pcs/cal-backend-sync.h: add protos, vmethods
-
- * pcs/cal-backend-sync.c (cal_backend_sync_create_object): call
- through
- (cal_backend_sync_modify_object): ditto
- (_cal_backend_create_object): create object and notify
- (_cal_backend_modify_object): modify object and notify
-
- * pcs/cal-backend-file.c (cal_backend_file_create_object):
- skeleton routine for creating objects
- (cal_backend_file_modify_object): ditto for modifying
-
- * idl/evolution-calendar.idl: add createObject and modifyObject
- calls
-
-2003-09-12 JP Rosevear <jpr@ximian.com>
-
- * pcs/cal.c (cal_notify_object_removed): its uid, not uids
-
-2003-09-12 JP Rosevear <jpr@ximian.com>
-
- * pcs/query.h: add protos
-
- * pcs/query.c (query_object_matches): use the sexp to check for a
- match
- (query_notify_objects_added_1): notify of one object added to
- query
- (query_notify_objects_modified_1): ditto for modification
- (query_notify_objects_removed_1): ditto for removal
-
- * pcs/cal.h: add protos
-
- * pcs/cal.c (cal_notify_object_created): notify of object creation
- (cal_notify_object_modified): notify of object modification
- (cal_notify_object_removed): use the _1 routines
-
- * pcs/cal-backend-file.c (match_recurrence_sexp): this returns a
- boolean
- (cal_backend_file_update_objects): don't signal removals here now
-
- * idl/evolution-calendar.idl: add object created and modified
- responses
-
-
-2003-09-11 JP Rosevear <jpr@ximian.com>
-
- * pcs/cal.h: update proto
-
- * pcs/cal.c (cal_notify_object_removed): notify relevant queries
- of removal
-
- * pcs/cal-backend.c (cal_backend_get_queries): ref the list before
- passing it back
-
- * pcs/cal-backend-sync.c (_cal_backend_remove_object): pass uid to
- notification
-
-2003-09-11 JP Rosevear <jpr@ximian.com>
-
- * pcs/cal-backend-file.c (match_recurrence_sexp): don't unref the
- component
-
- * cal-client/client-test.c (cal_opened_cb): listen to objects
- added signal
- (objects_added_cb): print the object uid
-
-2003-09-11 JP Rosevear <jpr@ximian.com>
-
- * pcs/cal-backend-object-sexp.c (cal_backend_object_sexp_text):
- return the base text
-
-2003-09-11 JP Rosevear <jpr@ximian.com>
-
- * gui/gnome-cal.c (update_query): fix c/p typo
-
-2003-09-11 JP Rosevear <jpr@ximian.com>
-
- * gui/gnome-cal.c (update_query): start the query
-
- * gui/e-cal-model.c (update_query_for_client): ditto
-
- * cal-client/client-test.c (cal_opened_cb): ditto
-
-2003-09-11 JP Rosevear <jpr@ximian.com>
-
- * cal-client/cal-query.h: add proto
-
- * cal-client/cal-query.c (cal_query_start): start the query
-
-2003-09-11 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/delete-error.c (delete_error_dialog): accept GError
- and base error messages on that
-
- * gui/dialogs/delete-error.h: update proto
-
- * gui/e-tasks.c (e_tasks_delete_completed): pass extra param to
- cal_client_remove_object
-
- * conduits/todo/todo-conduit.c (delete_record): ditto
-
- * conduits/calendar/calendar-conduit.c (process_multi_day): ditto
- (delete_record): ditto
-
- * gui/gnome-cal.c (gnome_calendar_purge): ditto
-
- * gui/dialogs/comp-editor.c (delete_comp): ditto
-
- * gui/e-cal-view.c (e_cal_view_cut_clipboard): pass the error to
- delete_error_dialog
- (delete_event): ditto
- (e_cal_view_delete_selected_occurrence): ditto
-
- * gui/e-itip-control.c (remove_item): ditto
-
- * gui/e-calendar-table.c (delete_selected_components): ditto
-
- * cal-client/cal-listener.h: add signal
-
- * cal-client/cal-listener.c (impl_notifyObjectRemoved): implement
- (cal_listener_class_init): set object removed implementation and
- create signal
-
- * cal-client/cal-client.h: update protos
-
- * cal-client/cal-client.c (cal_object_removed_cb): object removal
- callback
- (cal_client_init): listen for object removal signal
- (cal_client_remove_object_with_mod): make call synchronous
- (cal_client_remove_object): pass new params
-
- * pcs/cal.h: add proto
-
- * pcs/cal.c (impl_Cal_removeObject): just call the backend
- function
- (cal_notify_object_removed): notify of removal
-
- * pcs/cal-backend.h: remove and update protos, remove signal
-
- * pcs/cal-backend.c (cal_backend_class_init): kill obj_removed
- signal
- (cal_backend_remove_object): there is no return value now
-
- * pcs/cal-backend-sync.h: add vmethod, proto
-
- * pcs/cal-backend-sync.c (cal_backend_sync_remove_object): call
- through
- (_cal_backend_remove_object): remove the object and then do the
- notification
-
- * pcs/cal-backend-file.c (cal_backend_file_class_init): remove
- object is not part of the sync class
- (cal_backend_file_update_objects): there is no more removed signal
- (cal_backend_file_remove_object): return sync status codes
-
- * idl/evolution-calendar.idl: make removeObject oneway and and a
- notification method in the listener
-
-2003-09-11 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/query.[ch] (query_get_text): new function.
- (query_get_object_sexp): new function.
-
- * pcs/cal-backend-file.c (cal_backend_file_start_query): implemented.
-
-2003-09-11 Hans Petter Jansson <hpj@ximian.com>
-
- * cal-util/Makefile.am (libcal_util_la_LIBADD):
- libical-evolution.la -> libical.la
-
- * cal-util/cal-component.c (cal_component_get_classification)
- (cal_component_set_classification)
- (get_text_list)
- (get_icaltimetype)
- (get_datetime)
- (get_period_list)
- (get_recur_list)
- (cal_component_get_transparency)
- (cal_component_set_transparency): Adapt to new libical.
-
- * cal-util/cal-util.c (cal_util_event_dates_match): Ditto.
-
- * pcs/cal-backend-file.c (create_user_free_busy): Ditto.
-
- * gui/e-cal-model-tasks.c (get_completed)
- (get_due)
- (get_due_status): Ditto.
-
- * gui/e-cal-model.c (get_dtstart)
- (set_classification): Ditto.
-
- * gui/e-cal-model-calendar.c (get_dtend)
- (get_transparency)
- (set_transparency): Adapt to new libical and fix a comparison bug.
-
- * importers/Makefile.am (libevolution_calendar_importers_la_LIBADD):
- libical-evolution.la -> libical.la
-
-2003-09-11 Dan Winship <danw@ximian.com>
-
- * cal-util/Makefile.am (privlib_LTLIBRARIES): Remove
- libcal-util-static.la
-
- * cal-client/Makefile.am (noinst_LTLIBRARIES): Remove
- libcal-client-static.la
-
- * conduits/calendar/Makefile.am (libecalendar_conduit_la_LIBADD):
- use non-static libraries. The static ones were only needed for
- libtool 1.3.
-
- * conduits/todo/Makefile.am (libetodo_conduit_la_LIBADD): Likewise
-
- * gui/Makefile.am (IDL_GENERATED): Don't compile the calendar idl
- here. It's already in libcal-client.
-
-2003-09-11 Frederic Crozat <fcrozat@mandrakesoft.com>
-
- * conduits/todo/Makefile.am:
- Statically link with wombat. Fix ETodo conduit.
- (Mdk bug #5348)
-
-
-2003-09-10 JP Rosevear <jpr@ximian.com>
-
- * pcs/cal.h: update proto
-
- * pcs/cal.c (impl_Cal_getObjectList): just call the backend, it
- will do the notification now
- (cal_notify_object_list): the list is a list of strings
-
- * pcs/cal-backend.h: update vmethod, proto
-
- * pcs/cal-backend.c (cal_backend_get_object_list): call through
-
- * pcs/cal-backend-sync.h: add proto, vmethod
-
- * pcs/cal-backend-sync.c (cal_backend_sync_get_object_list): call
- through
- (_cal_backend_get_object_list): get the list of objects from the
- sync backend and do the notification
- (cal_backend_sync_class_init): set vmethod implementation
-
- * pcs/cal-backend-file.c (cal_backend_file_class_init): the get
- object list call is now part of the sync backend
- (cal_backend_file_get_object_list): return a status and put the
- object list in the passed in param
-
-2003-09-10 JP Rosevear <jpr@ximian.com>
-
- * pcs/cal-backend.c (cal_backend_finalize): unref the elist
- (cal_backend_init): init the query elist
-
-2003-09-10 JP Rosevear <jpr@ximian.com>
-
- * gui/gnome-cal.c (dn_query_objects_added_cb): match new query
- signals - just tag here
- (dn_query_objects_modified_cb): always retag
- (dn_query_objects_removed_cb): ditto
- (update_query): connect to new signals
- (gnome_calendar_destroy): we don't keep a list of expunging
- queries
- (gnome_calendar_purge): no need to do the
- expunge async, just get the object list immediately
-
- * gui/e-tasks.c (e_tasks_delete_completed): no need to do the
- expunge async, just get the object list immediately
-
- * gui/e-cal-model.c (query_objects_added_cb): callback for objects
- added to the query
- (query_objects_modified_cb): ditto for modifications
- (query_objects_removed_cb): ditto for removed
- (query_progress_cb): progress of the query
- (query_done_cb): query is done
- (update_query_for_client): connect to the new signals
-
- * cal-client/client-test.c (cal_opened_cb): run a query
-
- * cal-client/cal-query.c: we are given the listener now - listen
- for signals from the listener and emit signals matching the api
- changes
-
- * cal-client/query-listener.[hc]: rewrite to match new query
- listener methods and emit signals rather than using function
- callbacks
-
- * cal-client/cal-marshal.list: add to marshallers
-
- * cal-client/cal-listener.h: add query signal
-
- * cal-client/cal-listener.c (impl_notifyQuery): implement
- (cal_listener_class_init): set notifyQuery method
- (cal_listener_class_init): add query signal
-
- * cal-client/cal-client.h: update protos
-
- * cal-client/cal-client.c (cal_query_cb): handle response to
- getQuery
- (cal_client_init): listen for query signal
- (cal_client_get_query): get a query from the calendar
-
- * pcs/query.h: update protos
-
- * pcs/query.c: rewrite to implement the query start method and
- provide notification calls
-
- * pcs/cal.h: add proto
-
- * pcs/cal.c (impl_Cal_getQuery): re-implement so the backend
- doesn't create the query for us
- (cal_notify_query): respond with the query
-
- * pcs/cal-factory.c: re-order includes
-
- * pcs/cal-common.h: add types
-
- * pcs/cal-backend.h: update protos, vmethods
-
- * pcs/cal-backend.c (cal_backend_class_init): init start_query
- vmethod
- (cal_backend_finalize): free mutex
- (cal_backend_start_query): call through
- (cal_backend_add_query): add a query to the list the backend is
- running
- (cal_backend_get_queries): get the query list
-
- * pcs/cal-backend-object-sexp.h: add proto
-
- * pcs/cal-backend-file.c (cal_backend_file_start_query): skeleton
- for new backend implementation
-
- * pcs/Makefile.am: don't build dead files
-
- * idl/evolution-calendar.idl: make the getQuery call async, make
- the query listener calls oneway and match the addressbook
-
-2003-09-09 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/cal-backend-file.c (cal_backend_file_get_object_component):
- added case for getting the individual recurrences if 'rid' is
- not NULL,
-
-2003-09-09 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/cal-backend-file.c (match_object_sexp): expand recurrences
- for recurrent objects.
- (match_recurrence_sexp): add the recurrences that match the query
- expression to the object list.
-
-2003-09-08 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/cal-backend-file.c: don't store all recurrences in the
- private structure.
-
-2003-09-04 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-day-view.c (process_component):
- * gui/e-week-view.c (process_component): dont expand recurrences,
- since they are now expanded by the backends.
-
-2003-09-02 JP Rosevear <jpr@ximian.com>
-
- * gui/tasks-control.c (sensitize_commands): adapt to cal-client
- threaded sync api changes
-
- * gui/itip-utils.c (itip_organizer_is_user): ditto
-
- * gui/gnome-cal.c (gnome_calendar_purge): ditto
-
- * gui/e-meeting-model.c (process_section): ditto
-
- * gui/e-calendar-table.c (e_calendar_table_show_popup_menu): ditto
-
- * gui/e-cal-view.c (e_cal_view_create_popup_menu): ditto
-
- * gui/calendar-commands.c (sensitize_calendar_commands): ditto
- (sensitize_taskpad_commands): ditto
-
- * gui/dialogs/task-editor.c (set_menu_sens): ditto
-
- * gui/dialogs/meeting-page.c (meeting_page_construct): ditto
-
- * gui/dialogs/event-editor.c (set_menu_sens): ditto
-
- * gui/dialogs/alarm-page.c (add_clicked_cb): ditto
-
- * conduits/calendar/calendar-conduit.c (pre_sync): convert to
- cal_client api changes
-
- * conduits/todo/todo-conduit.c (pre_sync): ditto
-
- * cal-client/client-test.c (list_uids): match new error handling
-
- * cal-client/cal-marshal.list: marshallers
-
- * cal-client/cal-listener.[hc]: emit signals for corba listener
- callbacks - start with is_read_only, get_static_capabilities,
- get_cal_address, get_ldap_attribute, open, remove and object_list
-
- * cal-client/cal-client.h: move the status enum away from here,
- update protos to new thread sync api standard
-
- * cal-client/cal-client.c: the listener emits signals instead of
- using callback functions now and we return booleans + GError in
- outs for results
- (e_calendar_error_quark): for GError handling
- (cal_read_only_cb): handle listener op callback
- (cal_cal_address_cb): ditto
- (cal_alarm_address_cb): ditto
- (cal_ldap_attribute_cb): ditto
- (cal_static_capabilities_cb): ditto
- (cal_opened_cb): ditto
- (cal_removed_cb): ditto
- (cal_object_list_cb): ditto
-
- * cal-client/cal-client-types.h: add GError stuff
-
- * cal-client/Makefile.am: build glib marshal stuff
-
- * pcs/query.c (backend_opened_cb): comment out some break
- temporarily
-
- * pcs/cal.h: add protos
-
- * pcs/cal.c (impl_Cal_open): just call the backend method, it will
- handle the notification
- (impl_Cal_remove): ditto
- (impl_Cal_isReadOnly): ditto
- (impl_Cal_getCalAddress): ditto
- (impl_Cal_getAlarmEmailAddress): ditto
- (impl_Cal_getLdapAttribute): ditto
- (impl_Cal_getStaticCapabilities): ditto
- (impl_Cal_getObjectList): simplify
- (cal_new): set poa to be threaded
- (cal_notify_read_only): notification utils
- (cal_notify_cal_address): ditto
- (cal_notify_alarm_email_address): ditto
- (cal_notify_ldap_attribute): ditto
- (cal_notify_static_capabilities): ditto
- (cal_notify_open): ditto
- (cal_notify_remove): ditto
- (cal_notify_object_list): ditto
-
- * pcs/cal-factory.c (impl_CalFactory_getCal): dup the key and the
- object
- (cal_factory_new): set poa to be threaded
-
- * pcs/cal-backend.h: update vmethods and protos
-
- * pcs/cal-backend.c (cal_backend_get_cal_address): we no longer
- return anything - the callee is responsible for notification
- (cal_backend_get_alarm_email_address): ditto
- (cal_backend_get_ldap_attribute): ditto
- (cal_backend_get_static_capabilities): ditto
- (cal_backend_open): ditto
- (cal_backend_remove): ditto
-
- * pcs/cal-backend-file.h: update inheritance
-
- * pcs/cal-backend-file.c: inherit from CalBackendSync and make
- is_read_only, get_static_capabilities, get_cal_address, get_ldap_attribute, open and
- remove match
-
- * pcs/Makefile.am: build new files
-
-2003-09-02 JP Rosevear <jpr@ximian.com>
-
- * idl/evolution-calendar.idl: make all listener callbacks one ways
-
-2003-09-02 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/cal-backend-file.c (match_recurrence_sexp, match_object_sexp):
- new callbacks for g_hash_table_foreach in get_object_list.
- (cal_backend_file_get_object_list): don't use the priv->comp list
- to check the components, use the hash table, which contains all
- the recurrences already expanded.
- (add_component): only expand recurrences for recurrent components.
-
-2003-09-01 Andrew Wu <Yang.Wu@sun.com>
-
- * gui/e-day-view.c:
- (e_day_view_change_event_end_time_up):
- (e_day_view_change_event_end_time_down): Use
- "ctrl+shift+alt+Up/Down" to change the end time of the editing
- event.
-
-2003-08-29 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/cal-backend-file.c (lookup_component): take into account the 'rid'
- argument.
- (get_rid_string): new function to convert the recurrence ID to string.
- (add_recurrence_to_object): callback for cal_recur_generate_instances.
- (add_component): expand recurrences and g_strdup the hash's key.
- (free_cal_component): free also the hash's key.
-
-2003-08-28 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/alarm-notify/alarm-queue.c (tray_icon_blink_cb)
- (display_notification): Use images that come with Evolution instead
- of unreleased stock, for now.
-
-2003-08-28 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/alarm-notify/util.[ch]: Added alarm-notify utils.
-
- * gui/alarm-notify/Makefile.am: Added alarm-notify utils.
-
- * gui/alarm-notify/alarm-notify-dialog.c (timet_to_str_with_zone):
- Move to util.c.
-
- * gui/alarm-notify/alarm-queue.c (notify_dialog_cb)
- (on_dialog_removed_cb)
- (notify_dialog_cb)
- (tray_icon_destroyed_cb)
- (tray_icon_clicked_cb)
- (tray_icon_blink_cb)
- (display_notification): Add Rodrigo Moya's code for tray icon
- notification of appointments, with some fixes and blink code by me.
- Requires HEAD gnome-icon-theme for now.
-
-2003-08-27 Hans Petter Jansson <hpj@ximian.com>
-
- Fixes #29032.
-
- * gui/dialogs/task-details-page.c (status_changed): When task status
- is set to "In Progress", set percent complete to 50% only if it was
- previously set to 0% or 100%.
-
-2003-08-27 Bolian Yin <bolian.yin@sun.com>
-
- * gui/Makefile.am use libevolution-calendar-a11y instead of libevolution-a11y.
-
-2003-08-26 Jack Jia <jack.jia@sun.com>
-
- ** Fixes #47863.
-
- * gui/alarm-notify/alarm-notify.c (AlarmNotify_removeCalendar): set
- the initial value of lc_ptr and orig_str_ptr to NULL to avoid crash.
-
-
-2003-08-26 Rodrigo Moya <rodrigo@ximian.com>
-
- * idl/evolution-calendar.idl: QueryListener::notifyObjUpdated now gets
- a sequence of CalObj's.
-
- * pcs/query.c (add_component): send the whole object to the listener,
- not just the UID. Improved the way the listeners are notified, by allocating
- a CORBA sequence to be used for all listeners, not one for each.
- (match_component): pass the CalComponent to add_component, not only the UID.
- (start_cached_query_cb): send the whole object to the listener.
-
- * cal-client/cal-query.[ch]: changed argument names for "obj_updated"
- signal.
- (obj_updated_cb): pass the calobj's, not uid's.
-
- * gui/e-tasks.c (query_obj_updated_cb):
- * gui/gnome-cal.c (dn_query_obj_updated_cb, purging_obj_updated_cb):
- * gui/e-cal-model.c (query_obj_updated_cb): we now get the object's
- string representation instead of the UID.
-
-2003-08-25 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-client/cal-client.c (cal_client_get_object): added a 'rid' argument
- to match the IDL method.
-
- * conduits/calendar/calendar-conduit.c (local_record_from_uid):
- * conduits/todo/todo-conduit.c (local_record_from_uid):
- * gui/comp-editor-factory.c (edit_existing):
- * gui/comp-util.c (cal_comp_is_on_server):
- * gui/e-cal-model.c (query_obj_updated_cb):
- * gui/e-itip-control.c (find_server, get_real_item, update_attendee_status):
- * gui/gnome-cal.c (dn_query_obj_updated_cb, purging_obj_updated_cb):
- * gui/dialogs/comp-editor.c (obj_updated_cb): adapted to changes in
- cal_client_get_object().
-
-2003-08-23 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/query-backend.c (object_updated_cb):
- * pcs/cal-backend.c (cal_backend_get_type_by_uid): use 'rid' parameter
- where appropriate.
-
- * pcs/cal-backend-file.c (check_dup_uid): removed unused variables.
- (cal_backend_file_compute_changes_foreach_key): pass a NULL 'rid'
- to cal_backend_get_object().
- (lookup_component): get a 'rid' argument also.
- (cal_backend_file_cancel_object, cal_backend_file_remove_object):
- pass correct number of parameters to lookup_component().
-
-2003-08-22 Rodrigo Moya <rodrigo@ximian.com>
-
- * idl/evolution-calendar.idl: use UID/RID pairs to identify objects.
-
- * pcs/cal.c (impl_Cal_getObject): added 'rid' parameter.
-
- * pcs/cal-backend.c (cal_backend_get_object): added 'rid' parameter.
- (cal_backend_get_object_component): ditto.
- (get_object): ditto.
-
- * pcs/cal-backend-file.c (cal_backend_file_get_object_component):
- added 'rid' parameter.
- (lookup_component): added 'rid' parameter and made it search for the
- recurrence when that parameter is not NULL.
- (cal_backend_file_get_alarms_for_object, cal_backend_file_update_object):
- adapted to changes in lookup_component().
-
-2003-08-22 Frederic Crozat <fcrozat@mandrakesoft.com>
-
- * gui/alarm-notify/notify-main.c: (main):
- Ensure we get UTF-8 strings from gettext.
-
-2003-08-22 Bolian Yin <bolian.yin@sun.com>
-
- Fixes #47779
-
- * gnome-cal.c (gnome_calendar_get_visible_time_range): fix the return value bug.
-
-2003-08-21 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-client/cal-client.[ch] (cal_client_send_object): use a 'char **'
- for the 'error_msg' argument, instead of a fixed size string.
-
- * gui/itip-utils.c (comp_server_send): pass the correct parameter to
- cal_client_send_object.
-
-2002-08-20 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/e-itip-control.c (start_defalt_server): Rename to
- start_default_server_async () and don't run a nested main loop. Let
- the caller deal with the client object and signals.
- (default_server_started_cb): Implement. Async signal handler for
- 'cal_opened' signal, does the embedding.
- (object_requested_cb): Rewritten to work asynchronously, and finish
- the embedding when default_server_started_cb() is called.
-
-2003-08-20 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-calendar-table.c (setup_popup_icons): new function to set icons
- on the popup menu items.
- (e_calendar_table_show_popup_menu): call setup_popup_icons.
-
- * gui/e-cal-view.c (setup_popup_icons): set more icons for the
- popup menu.
-
-2003-08-20 Bolian Yin <bolian.yin@sun.com>
-
- * gui/Makefile.am : Add a11y dependency.
- * gui/calendar-commands.c (calendar_get_text_for_folder_bar_label)
- * gui/e-cal-view.c: Add two new events: "event_changed" and "event_added"
- * gui/e-day-view.c (e_day_view_class_init): init a11y.
- (e_day_view_find_event_from_item): make it public from private
- (e_day_view_update_event_cb): emit "event_changed" signal
- (e_day_view_reshape_day_event): emit "event_added" signal
- (e_day_view_reshape_long_event): emit "event_added" signal
- * gui/e-week-view.c (e_week_view_class_init): init a11y.
- (e_week_view_find_event_from_item): make it public from private
- (e_week_view_update_event_cb): emit "event_changed" signal
- (e_week_view_reshape_event_span): emit "event_added" signal
- * gui/gnome-cal.c (gnome_calendar_class_init): init a11y.
- (gnome_calendar_get_e_calendar_widget),
- (gnome_calendar_get_search_bar_widget),
- (gnome_calendar_get_view_notebook_widget): new functions
-
-
-2003-08-20 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/query-backend.c (foreach_uid_cb): use the icalcomponent
- to call icalcomponent_get_uid, not the string.
-
-2003-08-20 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/cal-backend-file.c: store objects by UID and RID.
- (free_object): new function to free the CalBackendFileObject structure.
- (cal_backend_file_dispose): use free_object callback to remove the
- objects in the comp_uid_hash.
- (lookup_component): search correctly the component in the new hash
- table organizarion.
- (check_dup_uid): ditto.
- (add_component): ditto.
- (remove_component): ditto.
-
-2003-08-19 JP Rosevear <jpr@ximian.com>
-
- * gui/gnome-cal.c (setup_widgets): set up models here
- (gnome_calendar_construct): not here
-
- * conduits/calendar/calendar-conduit.c
- (e_calendar_context_destroy): we have a list of calcomponents
- rather than uids now
- (process_multi_day): build a list of components rather than uids
- (pre_sync): use get_object_list instead of getting uids
- (for_each): create local records from calcomponents
-
- * conduits/todo/todo-conduit.c: as above
-
- * gui/print.c (instance_cb): mark as true if we found an instance
- (print_month_small): see if atleast one instance exists in a
- slight different way
-
- * cal-client/client-test.c (list_uids): use get_object_list
-
- * cal-client/cal-listener.h: update protos
-
- * cal-client/cal-listener.c (cal_listener_class_init): set object
- list callback implementation
- (impl_notifyObjectListRequested): implement
- (cal_listener_construct): take object list callback function
- (cal_listener_new): ditto
-
- * cal-client/cal-client.h: update protos, add status
-
- * cal-client/cal-client.c (e_calendar_new_op): create new op
- (e_calendar_get_op): retrieve current op
- (e_calendar_free_op): free the op
- (e_calendar_remove_op): clear current op
- (cal_client_init): create new mutex
- (cal_client_finalize): destroy mutex
- (build_object_list): build list of icalcomponents
- (cal_object_list_cb): handle getObjectList response
- (real_open_calendar): pass extra listener arg
- (cal_client_get_object_list): implement using thread safe mutex
- locking
- (cal_client_get_object_list_as_comp): return calcomponents instead
- of icalcomponents
- (cal_client_generate_instances): just get the object list - no
- need to make it atomic since get_object_list is already atomic
-
- * pcs/query.c (query_finalize): free new sexp class
- (parse_sexp): use new sexp class
- (match_component): ditto
-
- * pcs/query-backend.c (foreach_uid_cb): use icalcomponent to
- extract uid
- (query_backend_new): get all objects using object list call
-
- * pcs/cal.c (impl_Cal_getObjectList): implement
- (cal_class_init): adjust for idl method changes
-
- * pcs/cal-backend.h: update vmethods, add proto
-
- * pcs/cal-backend.c (cal_backend_class_init): remove get_uids and
- get_objects_in_range vmethods, add get_object_list vmethod
- (cal_backend_get_object_list): call through to vmethod implementation
-
- * pcs/cal-backend-object-sexp.[hc]: nice class to represent a sexp
- and search cal components
-
- * pcs/cal-backend-file.c (cal_backend_file_class_init): remove
- get_uids and get_objects_in_range calls and set get_object_list
- call
- (cal_backend_file_get_object_list): implement
- (create_user_free_busy): use sexp ops to implement
- (cal_backend_file_compute_changes): just iterate over the
- component list rather than fetching uids
-
- * pcs/Makefile.am: build new files
-
- * idl/evolution-calendar.idl: make opening a oneway call, add
- getObjectList call, remove getUIDS and getObjectsInRange call -
- both can be done with getObjectList; make listener callbacks
- oneway
-
-2003-08-19 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/gnome-cal.c (gnome_calendar_purge): don't leak the client list.
- (gnome_calendar_destroy): disconnect from all callbacks on all
- loaded clients.
-
-2003-08-19 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-cal-model-tasks.c (ecmt_get_color_for_component): use
- "black" for normal tasks, since the light colors from the palette
- are too light.
-
- * gui/gnome-cal.c (gnome_calendar_purge): don't leak the client list.
- (gnome_calendar_destroy): disconnect from all callbacks on all
- loaded clients.
-
-2003-08-18 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-day-view.c: fixed the problem with a new event being
- created for each keystroke.
- (e_day_view_add_event): don't create a new default component, use
- the one we get as parameter.
- (e_day_view_do_key_press): get the UID from the icalcomponent.
-
- * gui/e-week-view.c (e_week_view_add_event, e_week_view_do_key_press):
- same as e-day-view.c
-
-2003-08-18 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/calendar-component.c (impl_createControls): Oops, pass
- [NULL, NULL] to gtk_scrolled_window_new().
-
-2003-08-18 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/main.c (factory): Ref the object from
- calendar_component_peek() before returning it.
-
-2003-08-17 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/control-factory.h: #include <bonobo/bonobo-control.h>.
-
- * gui/Makefile.am (libevolution_calendar_la_LIBADD): Link to
- libeutil.
-
- * gui/e-calendar-table.c (e_calendar_table_set_status_message):
- Don't use the global_shell_client.
-
- * gui/main.c (factory): Call calendar_component_peek() for the
- GNOME_Evolution_Calendar_Component OAFIID.
-
- * gui/GNOME_Evolution_Calendar.server.in.in: Set up the
- GNOME_Evolution_Calendar_Component server and rename
- GNOME_Evolution_Calendar_Factory to
- GNOME_Evolution_Calendar_Factory_2.
- * gui/main.c: Updated IDs accordingly.
-
- * gui/e-meeting-time-sel.c (e_meeting_time_selector_construct):
- Use calendar_component_peek_config_directory() instead of
- evolution_dir.
- * gui/gnome-cal.c (setup_widgets): Likewise.
- (gnome_calendar_destroy): Likewise.
- * gui/dialogs/meeting-page.c (meeting_page_construct): Likewise.
-
- * gui/gnome-cal.c (gnome_calendar_open): #if 0 some code for
- figuring out where the task list is.
-
- * gui/calendar-component.c: New file.
- * gui/calendar-component.h: New file.
-
- * gui/itip-utils.c (itip_addresses_get): Unref the GConf client
- from gconf_client_get_default.
-
-2003-08-15 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-cal-model.c (ecm_get_color_for_component): use tigert's
- new color palette.
- (cal_removed_cb): when a client is removed, remove it from the model.
- (backend_died_cb): remove it also when the backend dies.
- (add_new_client): connect to new signals for CalClient's.
-
-2003-08-15 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-cal-model.c (e_cal_model_finalize): don't unref the
- 'accounts' field, since it is internal to itip-utils.c.
-
- * gui/alarm-notify/alarm-notify.c (alarm_notify_add_calendar):
- initialize all fields of the LoadedClient struct before calling
- cal_client_open_calendar(), since the "cal_opened_cb" signal is
- now emitted within it.
-
-2003-08-14 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-cal-model.[ch] (e_cal_model_free_component_data): new
- function.
-
- * gui/e-cal-view.h: added 'allocated_comp_data' field to the
- ECalViewEvent structure.
-
- * gui/e-day-view.c (e_day_view_add_event): allocate the event's
- ECalModelComponent if it hasn't been set.
- (e_day_view_update_event_cb, e_day_view_remove_event_cb,
- e_day_view_free_event_array): if the ECalModelComponent has
- been allocated by the view, free it here.
-
- * gui/e-week-event.c (e_week_view_add_event,
- e_week_view_update_event_cb, e_week_view_remove_event_cb,
- e_week_view_free_events): same as EDayView.
-
-2003-08-14 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-cal-model.c (e_cal_model_create_component_with_defaults):
- use the default client to call cal_comp_*_new_with_defaults, and
- if no client is available, just create an empty icalcomponent.
-
- * gui/e-cal-view.c (e_cal_view_init): create an empty model.
-
- * gui/e-week-view.c (e_week_view_add_event): use the event's client.
-
-2003-08-13 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/gnome-cal.c (gnome_calendar_open): unref the client if there
- is an error.
- (update_query): set status bar messages for progress.
- (update_query_timeout): re-enabled.
- (client_cal_opened_cb): install timeout handler for the query updates.
-
- * gui/e-cal-view.c (e_cal_view_set_model): connect to all appropriate
- signals on the model, to be called for every change.
- (model_row_changed_cb, model_rows_changed_cb): new model callbacks.
-
- * gui/e-week-view-event-item.c (e_week_view_event_item_draw): colorize
- the background for multiple days events.
-
-2003-08-13 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-cal-model.c (ecm_append_row, ecm_get_color_for_component):
- * gui/e-cal-model-tasks.c (ecmt_get_color_for_component): merged
- missing bith from calendar-views-with-model branch.
-
-2003-08-13 JP Rosevear <jpr@ximian.com>
-
- * cal-client/cal-client.c (real_open_calendar): set the priv->cal
- pointer in a slightly different spot so we have it in the call
- back
-
- * gui/e-cal-model.c (e_cal_model_get_client_list): merge this in
- properly
-
-2003-08-13 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-cal-model.c (ecm_get_color_for_component): assign the colors
- based on the URI, which is stored in a common place for all models.
- Thus different views will use the same color for the same calendar.
-
- * gui/e-week-view-event-item.c (e_week_view_event_item_draw): draw
- a filled rectangle and a black border around it for one-day events.
-
- * gui/e-day-view-top-item.c (e_day_view_top_item_draw_long_event):
- fill the rectangle for the item with its associated color.
-
-2003-08-13 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/gnome-cal.c (gnome_calendar_open): unref the client if there
- is an error.
- (update_query): set status bar messages for progress.
- (update_query_timeout): re-enabled.
- (client_cal_opened_cb): install timeout handler for the query updates.
-
- * gui/e-cal-view.c (e_cal_view_set_model): connect to all appropriate
- signals on the model, to be called for every change.
- (model_row_changed_cb, model_rows_changed_cb): new model callbacks.
-
- * gui/e-week-view-event-item.c (e_week_view_event_item_draw): colorize
- the background for multiple days events.
-
-2003-08-13 JP Rosevear <jpr@ximian.com>
-
- * cal-client/client-test.c (create_client): there is no more
- object updated signal
-
- * cal-client/cal-listener.c: clean up comment
-
- * cal-client/cal-client.c (cal_client_class_init): remove
- obj_updated and obj_removed signals
-
- * cal-client/cal-client.h: ditto
-
-2003-08-12 JP Rosevear <jpr@ximian.com>
-
- * pcs/cal-backend.h: remove get_uri vmethod
-
- * pcs/cal-backend.c (cal_backend_class_init): remove get_uri
- vmethod init
-
- * pcs/cal-backend-file.c (cal_backend_file_class_init): no longer
- a get uri vmethod
- (cal_backend_file_get_uri): remove implementation of above
-
-2003-08-12 JP Rosevear <jpr@ximian.com>
-
- * cal-client/client-test.c (main): use tmp uris
-
- * cal-client/cal-listener.h: update protos
-
- * cal-client/cal-listener.c (cal_listener_init): init removed
- function
- (cal_listener_finalize): clear removed function
- (impl_notifyCalOpened): take file status
- (impl_notifyCalRemoved): implement
- (cal_listener_construct): take remove function arg
- (cal_listener_new): ditto
-
- * cal-client/cal-client.h: update protos, add remove status
-
- * cal-client/cal-client.c
- (cal_client_remove_status_enum_get_type): add remove status type
- (cal_client_class_init): add removed signal
- (cal_opened_cb): can no longer get unsupported exception here
- (cal_removed_cb): emit removed status
- (real_open_calendar): pass removed callback function to listener
- (get_fall_back_uri): no longer append tasks.ics or calendar.ics
- (cal_client_remove_calendar): new c wrapper for corba function -
- calendar must be open currently
-
- * pcs/query.c (backend_opened_cb): only disconnect the open
- callback
- (backend_removed_cb): handle calendar removal
- (query_construct): listen for remove signal as well
-
- * pcs/cal.h: cal no longer takes uri during construction
-
- * pcs/cal.c (backend_to_listener_status): convert backend to corba
- status code
- (impl_Cal_open): backend open no longer takes uri, use above to
- send back status
- (impl_Cal_remove): implement
- (cal_construct): we no longer track the uri
- (cal_finalize): ditto
- (cal_class_init): set remove epv method
-
- * pcs/cal-factory.c (impl_CalFactory_getCal): instantiate backend
- with uri and kind properties
-
- * pcs/cal-backend.h: list file status enum, add protos
-
- * pcs/cal-backend.c (cal_backend_set_property): implement object
- properties
- (cal_backend_get_property): ditto
- (cal_backend_class_init): add properties vmethods and uri, kind
- properties, removed signal
- (cal_backend_get_uri): don't get the uri from the backend
- (cal_backend_get_kind): get the kind from the backend
- (cal_backend_open): adapt to new open call, no uri passed in
- (cal_backend_remove): call through to remove implementation
- (cal_backend_opened): use new file status
- (cal_backend_removed): emit removed signal
-
- * pcs/cal-backend-file.h: update protos
-
- * pcs/cal-backend-file.c (cal_backend_file_class_init): override
- remove vmethod
- (cal_backend_file_init): default file name to calendar.ics
- (cal_backend_file_set_file_name): accessor for filename tacked on
- to uri
- (cal_backend_file_get_file_name): ditto
- (open_cal): return "file" type status codes
- (create_cal): ditto
- (get_uri_string): construct the full uri string
- (cal_backend_file_open): use above
- (cal_backend_file_remove): implement
-
- * pcs/cal-backend-file-todos.c (cal_backend_file_todos_init): set
- the file name to tasks.ics
-
- * pcs/cal-backend-file-events.c (cal_backend_file_events_init):
- set the file name to calendar.ics
-
- * cal-util/cal-util.c (cal_util_expand_uri): just return a copy of
- the uri now
-
- * idl/evolution-calendar.idl: convert OpenStatus to FileStatus so
- remove() can use it as well
-
- * gui/gnome-cal.c (gnome_calendar_open): just open the default
- folder in all cases
-
-2003-08-12 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-util/cal-util.[ch] (cal_util_component_has_alarms): new function.
-
- * gui/gnome-cal.[ch]:
- * gui/goto.c:
- * gui/itip-bonobo-control.c:
- * gui/print.c:
- * gui/e-week-view.[ch]:
- * gui/e-day-view.[ch]: lots of fixes to make all compile with no
- warnings.
-
-2003-08-12 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-util/cal-util.[ch] (cal_util_component_has_organizer):
- new function.
-
- * gui/e-day-view-main-item.c:
- * gui/e-day-view-top-item.c:
- * gui/e-week-view-event-item.c:
- * gui/e-week-view.c: adaptated to changes in ECalViewEvent.
-
- * gui/e-cal-model.[ch] (e_cal_model_get_client_list): new function.
- (ecm_append_row): fixed usage of icalcomponent variable.
-
- * gui/e-cal-view.c (e_cal_view_class_init): removed unused variable.
- (selection_received): use default client for pasting from clipboard.
- (e_cal_view_cut_clipboard): cut the appointment from its client.
- (e_cal_view_copy_clipboard, delete_event, on_save_as, om_print_event,
- e_cal_view_delete_selected_occurrence, on_meeting, on_forward,
- e_cal_view_create_popup_menu): adapted to changes in ECalViewEvent.
- (e_cal_view_delete_selected_event, e_cal_view_delete_selected_events):
- pass the ECalViewEvent to delete_event, so that it knows which
- CalClient to use.
- (on_edit_appointment): pass CalClient and icalcomponent to
- gnome_calendar_edit_object.
- (on_publish): publish F/B info for all the clients currently loaded
- in the view.
- (setup_popup_icons): added missing argument to gtk_image_new_from_stock.
-
- * gui/calendar-commands.c (publish_freebusy_cmd): publish F/B info
- for all the clients currently loaded in the view.
- (sensitize_calendar_commands): use icalcomponent functions.
-
- * gui/e-day-view.c:
- * gui/comp-editor-factory.c (impl_editExisting):
- * gui/calendar-offline-handler.c (backend_cal_opened_online):
- * gui/e-alarm-list.c (e_alarm_list_finalize):
- * gui/e-cal-model-tasks.c (ecmt_get_color_for_component):
- * gui/e-date-time-list.c (e_date_time_list_finalize):
- * gui/control-factory.c (get_prop): fixed warnings.
-
-2003-08-12 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/calendar-offline-handler.c (impl_dispose): Chain. Prevent
- double unrefs.
- (impl_finalize): Chain.
-
- * gui/e-alarm-list.c (finalize): Chain.
-
- * gui/e-comp-editor-registry.c (destroy): Chain. Prevent double frees.
- (editor_destroy_cb): Don't crash if we get the destroy signal twice.
-
- * gui/e-date-time-list.c (e_date_time_list_finalize): Chain.
-
- * gui/e-meeting-attendee.c (finalize): Chain.
-
- * gui/e-meeting-model.c (finalize): Chain.
-
-2003-08-12 Andrew Wu <Yang.Wu@sun.com>
-
- * gui/e-day-view.c
- (e_day_view_change_duration_to_start_of_work_day):
- In DayView, Shift+Home, Change the duration to the time
- that begins the current work day.
- (e_day_view_change_duration_to_end_of_work_day):
- In DayView, Shift+End, Change the duration to the time
- that ends the current work day
-
-2003-08-12 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/e-itip-control.c (html_destroyed):
- (init):
- (write_html): Add destroy chaining.
-
-2003-08-12 Andrew Wu <Yang.Wu@sun.com>
-
- * gui/e-week-view.c
- (e_week_view_on_key_up):
- (e_week_view_on_key_down):
- (e_week_view_on_key_left):
- (e_week_view_on_key_right):
- In the WeekView, Navigation through days with arrow keys.
-
-2003-08-12 Harry Lu <harry.lu@sun.com>
-
- ** fixes #47464.
-
- * gui/dialogs/meeting-page.c: (get_widgets): The Organizer's value
- need not match one of the values in the list.
-
-2003-08-12 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-day-view.c (e_day_view_update_query):
- * gui/e-week-view.c (e_week_view_update_query): remove the status bar
- messages when the operation is finished.
-
- * gui/e-day-view-main-item.c (e_day_view_main_item_draw_day_event):
- draw a rectangle filled with the color associated with the event's
- calendar.
-
-2003-08-12 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-util/cal-util.[ch] (cal_util_component_has_alarms): new function.
-
- * gui/gnome-cal.[ch]:
- * gui/goto.c:
- * gui/itip-bonobo-control.c:
- * gui/print.c:
- * gui/e-week-view.[ch]:
- * gui/e-day-view.[ch]: lots of fixes to make all compile with no
- warnings.
-
-2003-08-12 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-util/cal-util.[ch] (cal_util_component_has_organizer):
- new function.
-
- * gui/e-day-view-main-item.c:
- * gui/e-day-view-top-item.c:
- * gui/e-week-view-event-item.c:
- * gui/e-week-view.c: adaptated to changes in ECalViewEvent.
-
- * gui/e-cal-model.[ch] (e_cal_model_get_client_list): new function.
- (ecm_append_row): fixed usage of icalcomponent variable.
-
- * gui/e-cal-view.c (e_cal_view_class_init): removed unused variable.
- (selection_received): use default client for pasting from clipboard.
- (e_cal_view_cut_clipboard): cut the appointment from its client.
- (e_cal_view_copy_clipboard, delete_event, on_save_as, om_print_event,
- e_cal_view_delete_selected_occurrence, on_meeting, on_forward,
- e_cal_view_create_popup_menu): adapted to changes in ECalViewEvent.
- (e_cal_view_delete_selected_event, e_cal_view_delete_selected_events):
- pass the ECalViewEvent to delete_event, so that it knows which
- CalClient to use.
- (on_edit_appointment): pass CalClient and icalcomponent to
- gnome_calendar_edit_object.
- (on_publish): publish F/B info for all the clients currently loaded
- in the view.
- (setup_popup_icons): added missing argument to gtk_image_new_from_stock.
-
- * gui/calendar-commands.c (publish_freebusy_cmd): publish F/B info
- for all the clients currently loaded in the view.
- (sensitize_calendar_commands): use icalcomponent functions.
-
- * gui/e-day-view.c:
- * gui/comp-editor-factory.c (impl_editExisting):
- * gui/calendar-offline-handler.c (backend_cal_opened_online):
- * gui/e-alarm-list.c (e_alarm_list_finalize):
- * gui/e-cal-model-tasks.c (ecmt_get_color_for_component):
- * gui/e-date-time-list.c (e_date_time_list_finalize):
- * gui/control-factory.c (get_prop): fixed warnings.
-
-2003-08-11 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-util/cal-util.[ch] (cal_util_component_is_instance,
- cal_util_component_has_recurrences, cal_util_component_has_rdates,
- cal_util_component_has_rrules, cal_util_event_dates_match):
- new functions needed for the CalComponent->icalcomponent
- transition.
-
- * gui/e-day-view.[ch]:
- * gui/e-week-view.[ch]: more adaptation to changes in ECalViewEvent.
-
- * gui/gnome-cal.c (gnome_calendar_edit_object): use icalcomponent's
- instead of CalComponent's.
-
-2003-08-11 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-day-view.c: more adaptation to changes in ECalViewEvent.
- (e_day_view_update_event_cb): use an ECalModelComponent, not a
- CalComponent.
- (process_component): pass an ECalModelComponent to
- e_day_view_update_event_cb().
-
- * gui/e-week-view.c: more adaptation to changes in ECalViewEvent.
- (e_week_view_update_event_cb, e_week_view_reshape_event_span):
- set the background color on the event's summary text.
-
-2003-08-11 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-week-view.c (e_day_view_update_query): no more query
- management here.
- (query_obj_updated_cb, query_obj_removed_cb, query_query_done_cb,
- query_eval_error_cb): removed query signals' callbacks.
- (adjust_query_sexp): removed.
- (process_component): new function to draw all components from
- the model.
-
- * gui/e-day-view.c: adapted to changes in ECalViewEvent structure.
- (e_day_view_update_query): no more query management here.
- (query_obj_updated_cb, query_obj_removed_cb, query_query_done_cb,
- query_eval_error_cb): removed query signals' callbacks.
- (adjust_query_sexp): removed.
- (process_component): new function to draw all components from
- the model.
-
-2003-08-11 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-cal-view.c (e_cal_view_destroy): disconnect from signals
- on the model.
- (e_cal_view_set_model): disconnect from signals on the old model
- and connect on the new one.
- (model_changed_cb): tell the views to redraw when the model changes.
-
- * gui/gnome-cal.c (dn_query_obj_updated_cb, gnome_calendar_destroy,
- client_categories_changed_cb): removed the 'client' field from the
- private structure, so don't use it anymore
- (client_cal_opened_cb): if successful, add the CalClient to the
- views' model.
- (gnome_calendar_construct): don't add the client to the task model,
- add it in client_cal_opened_cb().
- (gnome_calendar_get_cal_client): removed.
- (gnome_calendar_get_calendar_model): new function.
- (gnome_calendar_open): create the CalClient here, to be added to the
- views' model in client_cal_opened_cb().
-
-2003-08-09 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-cal-view.[ch] (e_cal_view_get_cal_client,
- e_cal_view_set_cal_client, e_cal_view_get_query,
- e_cal_view_set_query): removed unneeded functions.
- (e_cal_view_get_model, e_cal_view_set_model): new functions.
- (e_cal_view_destroy): free the model.
- (e_cal_view_init): removed sexp initialization.
-
- * gui/gnome-cal.c (gnome_calendar_set_query): set the
- query on the view's model, not on the view.
- (gnome_calendar_construct): create the calendar model and associate
- it to all the views.
-
-2003-08-08 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-cal-model-calendar.c (ecmc_fill_component_from_model):
- implemented new virtual method.
- (ecmc_class_init): initialize new virtual method.
-
-2003-08-08 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-client/cal-client.c (cal_client_update_object_with_mod):
- cal_client_get_component_as_string_internal expects now a
- icalcomponent, not a CalComponent.
-
- * gui/e-cal-model.h: added fill_component_from_model virtual method.
-
- * gui/e-cal-model.c (e_cal_model_get_default_client): return
- the default URI as per the configuration if we've got that
- client loaded. If not, return the first client.
- (get_dtstart): retrieve the value from the icalproperty.
- (set_summary): implemented correctly.
- (set_categories, set_classification, set_description): changed
- to really get an ECalModelComponent.
- (ecm_append_row): pass the correct arguments to the set_ functions
- and call the class' fill_component_from_model method to fill in the
- created icalcomponent.
-
- * gui/e-cal-model-tasks.c (set_due): added missing function.
- (ecmt_set_value_at): implemented case for DUE field.
- (ecmt_fill_component_from_model): implemented new virtual method.
- (ecmt_append_row): removed.
-
- * gui/e-cal-model-calendar.c (ecmc_append_row): removed.
-
- * gui/e-calendar-table.c (e_calendar_table_init): initialize
- missing fields. Disabled call to g_object_unref on the 'extras'
- object, since it causes GLib warnings. Something is wrong here.
-
-2003-08-08 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-cal-model.c (cal_opened_cb): don't call remove_client,
- since the client, at this point, hasn't been added anywhere.
- (ecm_finalize): don't call e_cal_model_remove_all_clients, since
- that function triggers notifications on the model.
- (query_obj_updated_cb): free all the date fields.
-
-2003-08-07 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-cal-model.c (ecm_value_at): don't convert to an integer
- the return value from get_color.
- (ecm_get_color_for_component): use correct GTK 2.x color values.
-
- * gui/e-calendar-table.c: replace all CAL_COMPONENT_FIELD...
- with the correct E_CAL_MODEL_*_FIELD...
-
-2003-08-07 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-cal-model-tasks.c (get_completed, get_due): added
- missing implementation.
- (ecmt_class_init): initialize missing virtual method.
-
- * gui/gnome-cal.c (gnome_calendar_construct): fixed typo.
-
-2003-08-07 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-client/cal-client.[ch] (cal_client_get_component_as_string):
- * cal-util/cal-util.[ch] (cal_util_add_timezone_from_component):
- use icalcomponent's instead of CalComponent's.
-
- * gui/Makefile.am:
- * gui/calendar-model.[ch]: removed old model class.
-
- * gui/e-calendar-table.[ch]: use ECalModelTasks class instead
- of CalendarModel.
- (e_calendar_table_set_status_message): new function.
- (get_selected_comp): return an ECalModelComponent.
- (get_selected_objects): return a list of ECalModelComponent's.
- (delete_selected_components): use the CalClient associated
- with each component.
- (copy_row_cb): adapted to changes in get_selected_comp.
-
- * gui/e-tasks.c:
- * gui/print.c:
- * gui/dialogs/comp-editor.c (save_as_cmd):
- * gui/e-day-view.c (e_day_view_on_drag_data_get):
- * gui/e-cal-view.c (e_cal_view_copy_clipboard, on_save_as): pass
- an icalcomponent to cal_util_add_timezones_from_component and
- cal_client_get_component_as_string.
-
- * gui/e-cal-model.[ch] (e_cal_model_set_use_24_hour_format):
- (e_cal_model_get_default_client):
- (e_cal_model_set_default_category): new functions.
-
- * gui/e-cal-model-tasks.[ch] (e_cal_model_tasks_mark_task_complete):
- new function.
- (ecmt_get_color_for_component): chain the call to the parent class
- so that it assigns the per-client color to 'normal' tasks.
-
- * gui/calendar-config.c (calendar_config_configure_e_calendar_table):
- call e_cal_model_set_use_24_hour_format.
-
-2003-08-07 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-cal-model.c (ecm_get_color_for_component): use the color
- palette from Tuomas.
-
-2003-08-06 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-cal-model.[ch]: removed 'create_component_with_defaults'
- virtual method.
- (e_cal_component_create_component_with_defaults):
- (e_cal_component_get_color_for_component): new functions.
-
-2003-08-06 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-cal-model.[ch] (e_cal_model_set_query): new function.
- (e_cal_model_remove_all_clients): implemented.
- (remove_client): also remove all objects belonging to the
- client being removed.
-
-2003-08-06 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-cal-model.c (get_dtstart, set_dtstart): implemented.
- (ecm_value_at, ecm_set_value_at, ecm_duplicate_value,
- ecm_free_value, ecm_value_to_string): added case for DTSTART
- field.
- (free_comp_data): free also the other date values in the
- ECalModelComponent struct.
- (e_cal_model_date_value_to_string): new function.
-
- * gui/e-cal-model.h: added new prototypes.
-
- * gui/e-cal-model-calendar.[ch]: new ECalModel-based class for
- containing events.
-
- * gui/e-cal-model-tasks.c (ecmt_value_to_string): implemented
- the case for date fields.
-
-2003-08-05 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-client/cal-client.c (generate_instances_obj_updated_cb): fixed
- parameters in call to cal_client_get_object().
- (get_objects_atomatically): same.
-
- * gui/e-cal-model.[ch]: added "get_color_for_component" virtual method.
- (get_color): new function to return the color. It calls the virtual
- method of the current class.
- (ecm_value_at): return a value for the color and icon columns.
- (e_cal_model_class_init): initialize virtual methods.
-
- * gui/e-cal-model-tasks.c (ecmt_get_color_for_component): implemented
- new class' virtual method.
-
-2003-08-05 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-client_/cal-client.c (cal_client_get_default_object): use
- correctly the pointer to pointer.
-
- * gui/e-week-view.c (query_obj_updated_cb): fixed the call to
- cal_client_get_object().
-
-2003-08-04 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-client/cal-client.[ch] (cal_client_get_default_object):
- (cal_client_get_object): use icalcomponent instead of CalComponent.
-
- * gui/e-cal-model.c (get_dtstart): implemented.
- (query_obj_updated_cb):
- (query_obj_removed_cb):
- (query_done_cb):
- (query_eval_error_cb): implemented missing functions.
-
- * gui/calendar-model.c:
- * gui/comp-editor-factory.c:
- * gui/comp-util.c:
- * gui/e-day-view.c:
- * gui/e-itip-control.c:
- * gui/e-week-view.c:
- * gui/gnome-cal.c:
- * gui/dialogs/comp-editor.c:
- * conduits/todo/todo-conduit.c:
- * conduits/calendar/calendar-conduit.c: adapted to changes
- in CalClient API.
-
-2003-08-04 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-client/cal-query.[ch] (cal_query_new): added a 'CalClient'
- argument to this function.
- (cal_query_get_client): new function.
-
- * cal-client/cal-client.c (cal_client_get_query): added new parameter
- in call to cal_query_new ().
-
-2003-08-01 Lorenzo Gil <lgs@sicem.biz>
-
- * gui/e-alarm-list.c: added the include <config.h> line at the
- beginning to enable gettext.
-
-2003-08-01 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-cal-model.[ch] (e_cal_model_get_component_at): new function.
- (ecm_append_row): use the client from the source model.
- (e_cal_model_get_timezone, e_cal_model_set_timezone): new functions.
-
- * gui/e-cal-model-tasks.[ch]: new class for the tasks model.
-
-2003-07-31 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-cal-model.[ch]: new class, based on CalendarModel to be
- an abstract class for calendar models.
-
- * gui/Makefile.am: added new files to build.
-
-2003-07-30 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-client/cal-client-multi.[ch]:
- * cal-client/Makefile.am: removed obsolete code.
-
-2003-07-30 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/main.c (factory): Do not depend on global_shell_client being
- not NULL for creating the calendar preferences dialog.
-
- * gui/e-itip-control.c (show_current): Don't call get_servers
- anymore [to be fixed].
- (get_servers): #if 0ed out.
- (object_requested_cb): Don't create the folder selector button.
-
- * gui/e-cal-view.c (e_cal_view_set_status_message): Don't create
- an activity client.
-
- * gui/calendar-model.c (calendar_model_set_status_message): Don't
- create an activity client.
-
- * gui/calendar-component.c: Removed global variable
- global_shell_client.
- (owner_set_cb): Don't set global_shell_client.
- (owner_unset_cb): Don't set it here either.
-
-2003-07-29 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes all "alarm daemon doesn't start with session"
-
- * gui/alarm-notify/notify-main.c (main): use LIBGNOMEUI_MODULE
- instead of LIBGNOME_MODULE so that the default session client
- is created in gnome_program_init.
-
-2003-07-29 Harry Lu <harry.lu@sun.com>
-
- Fixes #46769
-
- * gui/dialogs/task-page.c: (task_page_fill_component): Popup a
- error dialog if due date time is before start datetime when saving
- a task.
-
-2003-07-29 Bolian Yin <bolian.yin@sun.com>
-
- Fixes #46847
-
- * gui/e-day-view.c (e_day_view_get_next_tab_event, e_day_view_focus):
- add day view widget in the tab loop of events.
- * gui/e-week-view.c (e_week_view_get_next_tab_event, e_week_view_focus):
- add week view widget in the tab loop of events.
-
- Also: add some comments in gui/e-day-view.c and gui/e-week-view.c
- remove two compile warnings in gui/e-day-view.c
-
-2003-07-24 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-cal-view.[ch] (e_cal_view_delete_selected_occurrence):
- new function.
- (e_cal_view_get_timezone, e_cal_view_set_timezone): new functions.
- (e_cal_view_class_init): added new class' signal.
-
- * gui/e-week-view.[ch] (e_week_view_delete_occurrence,
- e_week_view_delete_occurrence_internal): removed.
- (e_week_view_get_timezone): removed.
- (e_week_view_set_timezone): renamed to timezone_changed_cb, as
- the callback for timezone changes in the parent ECalView.
- (e_week_view_on_button_press): call gnome_calendar_new_appointment
- instead of the non-existant e_week_view_new_appointment.
-
- * gui/e-day-view.[ch] (e_day_view_delete_occurrence,
- e_day_view_delete_occurrence_internal): removed.
- (e_day_view_get_timezone): removed.
- (e_day_view_set_timezone): renamed to timezone_changed_cb, as
- the callback for timezone changes in the parent ECalView.
-
- * gui/gnome-cal.c (gnome_calendar_delete_selected_occurrence):
- made it call e_cal_view_delete_selected_occurrence.
- (gnome_calendar_update_config_settings): call the generic
- e_cal_view_set_timezone on all view widgets.
-
- * gui/e-day-view-top-item.c:
- * gui/e-week-view-main-item.c:
- * gui/e-day-view-main-item.c: removed mentions to non-existant
- structure fields.
-
-2003-07-24 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-cal-view.h: define ECalViewEvent as the base struct for
- the other views.
-
- * gui/e-day-view.[ch]: EDayViewEvent is now based on ECalViewEvent.
- (e_day_view_get_selected_events): made it return a list of
- ECalViewEvent's, not CalComponent's, so that we can get more
- information about the events.
-
- * gui/e-week-view.[ch]: EWeekViewEvent is now based on ECalViewEvent.
- (e_week_view_get_selected_events): same as e_day_view_get_selected_events.
-
- * gui/e-cal-view.c (e_cal_view_cut_clipboard, e_cal_view_copy_clipboard,
- e_cal_view_delete_selected_event, e_cal_view_delete_selected_events,
- on_edit_appointment, on_save_as, on_print_event, on_meeting,
- on_forward, e_cal_view_create_popup_menu):
- * gui/calendar-commands.c (sensitize_calendar_commands): updated
- to read ECalViewEvent's instead of CalComponent's as returned
- by e_cal_view_get_selected_events().
-
-2003-07-24 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-cal-view.c (delete_event): check the uid before using it.
-
-2003-07-24 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-day-view.c (e_day_view_delete_event,
- e_day_view_delete_event_internal):
- * gui/e-week-view.c (e_week_view_delete_event,
- e_week_view_delete_event_internal): removed.
-
- * gui/e-cal-view.[ch] (e_cal_view_delete_selected_event): renamed
- from e_cal_view_delete_event_internal.
- (e_cal_view_delete_selected_events): new function.
-
- * gui/gnome-cal.c (gnome_calendar_delete_selection): call
- e_cal_view_delete_selected_events().
-
- * gui/e-week-view-event-item.c (e_week_view_event_item_get_position,
- e_week_view_event_item_button_press):
- * gui/e-day-view-top-item.c (e_day_view_top_item_draw_long_event):
- * gui/e-day-view-main-item.c (e_day_view_main_item_draw_day_event):
- adapted to changes in E*ViewPosition.
-
-2003-07-24 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-cal-view.c (on_print): added missing cases.
- (setup_popup_icons): new function to set up icons for the popup menu.
- (e_cal_view_create_popup_menu): call setup_popup_icons.
-
-2003-07-23 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-cal-view.[ch]: moved the duplicated popup menu code here.
- (e_cal_view_create_popup_menu): new function to create the popup
- menu for all views.
- (on_new_appointment, on_new_event, on_new_meeting, on_new_task,
- on_goto_today, on_goto_date, on_edit_appointment, on_print,
- on_save_as, on_print_event, on_meeting, on_forward, on_publish,
- on_settings, on_delete_appointment, on_cut, on_copy, on_paste,
- on_unrecur_appointment): callbacks for the popup menu items.
-
- * gui/e-week-view.c (e_week_view_on_new_appointment,
- e_week_view_new_appointment, e_week_view_on_new_event,
- e_week_view_on_new_meeting, e_week_view_on_new_task,
- e_week_view_on_goto_today, e_week_view_on_goto_date,
- e_week_view_on_edit_appointment, e_week_view_on_print,
- e_week_view_on_save_as, e_week_view_on_print_event,
- e_week_view_on_meeting, e_week_view_on_forward,
- e_week_view_on_publish, e_week_view_on_settings,
- e_week_view_on_delete_appointment,
- e_week_view_delete_event_internal, e_week_view_on_cut,
- e_week_view_on_copy, e_week_view_on_paste):
- * gui/e-day-view.c (e_day_view_on_new_appointment,
- e_day_view_on_new_event, e_day_view_on_new_meeting,
- e_day_view_on_new_task, e_day_view_on_goto_today,
- e_day_view_on_goto_date, e_day_view_on_edit_appointment,
- e_day_view_on_print, e_day_view_on_save_as,
- e_day_view_on_print_event, e_day_view_on_meeting,
- e_day_view_on_forward, e_day_view_on_publish,
- e_day_view_on_settings, e_day_view_on_delete_appointment,
- e_day_view_delete_event_internal, e_day_view_on_cut,
- e_day_view_on_copy, e_day_view_on_paste): removed duplicated code.
-
- * gui/gnome-cal.[ch] (gnome_calendar_unrecur_selection): new function.
-
-2003-07-23 Dan Winship <danw@ximian.com>
-
- * cal-util/Makefile.am: Use EVO_MARSHAL_RULE, and add
- MARSHAL_GENERATED to CLEANFILES
-
- * gui/alarm-notify/alarm-queue.c (on_dialog_obj_updated_cb): Fix
- an unused variable
-
- * gui/calendar-commands.c (purge_cmd): Fix warnings.
-
- * gui/calendar-config.h: s/confirm_expunge/confirm_purge/ to match
- the actual functions
-
- * gui/control-factory.c: add some missing #includes
-
- * gui/dialogs/delete-comp.c (delete_component_dialog): Fix a
- warning
-
- * gui/e-itip-control.c (write_label_piece): Remove unused variable.
-
- * gui/print.c (print_calendar): Remove unused variable
- (print_comp): Likewise.
-
- * gui/tasks-control.c (confirm_purge): Fix warnings.
- (print_tasks): Remove unused variable.
-
-2003-07-23 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-day-view.h:
- * gui/e-week-view.h: removed unneeded prototypes.
-
- * gui/e-cal-view.[ch] (e_cal_view_get_visible_time_range): new
- function.
- (selection_received): deal correctly with the selected time range.
-
- * gui/e-week-view.c (e_week_view_get_visible_time_range): made it
- private as the implementation of the 'get_visible_time_range'
- virtual method.
-
- * gui/e-day-view.c (e_day_view_get_visible_time_range): ditto.
-
- * gui/gnome-cal.c (gnome_calendar_direction): merged redundant 'case'.
- (focus_current_view): removed redundant code.
-
-2003-07-22 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-day-view.c (e_day_view_get_selected_events):
- * gui/e-week-view.c (e_week_view_get_selected_events): manage the
- case where the selected events are the popup menu ones.
-
-2003-07-22 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/gnome-cal.c (gnome_calendar_copy_clipboard,
- gnome_calendar_cut_clipboard, gnome_calendar_paste_clipboard):
- removed missing calls to e_day/week_view_*_clipboard.
-
-2003-07-22 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-cal-view.[ch]: added "get_selected_events",
- and "update_query" virtual methods.
- (e_cal_view_class_init): initialize new virtual methods.
- (e_cal_view_destroy): destroy new private members.
- (e_cal_view_get_selected_events, e_cal_view_set_cal_client,
- e_cal_view_get_cal_client): new functions.
- (e_cal_view_cut_clipboard, e_cal_view_copy_clipboard,
- e_cal_view_paste_clipboard): merged clipboard stuff.
-
- * gui/e-day-view.c (e_day_view_cut_clipboard,
- e_day_view_copy_clipboard, e_day_view_paste_clipboard): removed.
- (e_day_view_get_selected_events): made these private as the
- implementation of the 'get_selected_events' base class virtual method.
-
- * gui/e-week-view.c (e_week_view_get_selected_events): ditto.
- (e_week_view_cut_clipboard, e_week_view_copy_clipboard,
- e_week_view_paste_clipboard): removed.
-
- * gui/calendar-commands.c (sensitize_calendar_commands): call
- e_cal_view_get_selected_events.
-
- * gui/gnome-cal.c: removed a lot of redundant code thanks to the
- above changes.
-
-2003-07-21 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-day-view.[ch]: removed e_day_view_set_calendar prototype.
- (e_day_view_set_status_message): removed.
-
- * gui/e-week-view.[ch] (e_week_view_set_status_message): removed.
-
- * gui/e-cal-view.[ch] (e_cal_view_set_status_message): new functions.
- (e_cal_view_destroy): unref activity client.
-
- * gui/gnome-cal.c: updated to e_*_view/e_cal_view.
-
-2003-07-18 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-day-view.[ch]:
- * gui/e-week-view.[ch]: moved duplicated code to...
-
- * gui/e-cal-view.[ch]: ...here.
- (e_cal_view_get_calendar, e_cal_view_set_calendar): new functions.
-
- * gui/e-week-view-event-item.c (e_week_event_item_double_click):
- * gui/gnome-cal.c (setup_widgets): adapted to changes in views.
-
-2003-07-17 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-cal-view.[ch]: new base class for calendar views.
-
- * gui/e-day-view.[ch]:
- * gui/e-week-view.[ch]: base these classes on ECalView.
-
- * gui/Makefile.am: added new files.
-
-2003-07-17 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/calendar-config.[ch]:
- * gui/tasks-control.c: s/expunge/purge.
-
-2003-07-16 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/gnome-cal.[ch] (gnome_calendar_purge): new function,
- which uses a CalQuery to retrieve the objects older than a given date.
- (check_instance_cb): callback for cal_recur_generate_instances.
- (purging_obj_updated_cb): call check_instance_cb on each recurrence
- to double-check the event can be deleted.
- (purging_query_done_cb, purging_eval_error_cb): needed callbacks to
- finish the query.
- (gnome_calendar_destroy): free new members.
-
- * gui/calendar-commands.c (purge_cmd): added implementation for the
- 'Purge' menu item.
-
-2003-07-16 Andrew Wu <Yang.Wu@sun.com>
-
- Fixes #45774
-
- * gui/e-day-view.c (e_day_view_goto_start_of_work_day):
- implemented select the time that begins a work day.
- (e_day_view_goto_end_of_work_day):
- implemented select the time that ends a work day.
-
-2003-07-16 Andrew Wu <Yang.Wu@sun.com>
-
- Fixes #45772
-
- * gui/gnome-cal.c(gnome_calendar_goto_date): implemented Alt+Left/Right
- to go to the same day of the previous/next week.
- * gui/gnome-cal.h:add two element in GnomeCalendarGotoDateType.
-
-2003-07-14 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #41676
-
- * gui/dialogs/alarm-options.c (palarm_options_changed_cb,
- repeat_spin_button_changed_cb, repeat_unit_changed_cb): new callbacks for
- managing modifications in the 'Run a program' alarm case.
- (repeat_toggle_toggled_cb): if the alarm being edited has a procedure
- action, call palarm_options_changed_cb.
- (init_widgets): connect new callbacks.
- (alarm_to_dialog): disable 'OK' button if a procedure alarm.
-
-2003-07-11 Federico Mena Quintero <federico@ximian.com>
-
- * gui/dialogs/task-details-page.glade: Changed the "URL:" label to
- "_Web Page:". Added a widget name to the URL label so that we can
- hook up its mnemonic by hand. Added underlines to the "%
- Complete:" and "Date Completed:" labels. Added a widget name to
- the date completed label, also so that we can hook up its mnemonic.
-
- * gui/dialogs/task-details-page.c (get_widgets): Get the url_label
- and date_completed_label as well.
- (init_widgets): Set the mnemonic widgets of the url_label and the
- date_completed_label by hand, as their respective widgets are
- not created by libglade.
-
- * gui/e-calendar-table.c (tasks_popup_menu): Added an item for
- "Open Web Page".
- (e_calendar_table_show_popup_menu): Disable the aforementioned
- menu item if the selected task doesn't have the URL property set.
- (open_url_cb): New callback.
-
- * gui/e-tasks.c (write_html): Make the HTML say "Web Page:"
- instead of "URL:".
-
-2003-07-10 Harry Lu <harry.lu@sun.com>
-
- Fixes #46075.
-
- * gui/e-date-time-list.c (compare_datetime): new function to compare
- two CalComponentDateTime instances.
- (e_date_time_list_append): check whether the date already exists
- before adding it to the list.
-
-2003-07-07 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #45910
-
- * gui/dialogs/task-editor.c (task_editor_class_init): set up the
- handler for the set_cal_client virtual method.
- (task_editor_set_cal_client): added missing virtual method.
-
-2003-07-07 Jack Jia <jack.jia@sun.com>
-
- * cal-client/cal-client.c (cal_client_get_static_capability): add
- g_return_val_if_fail to check the input param.
-
-2003-07-03 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-tasks.c (setup_widgets): added a paned widget to contain
- the task list and a HTML widget for displaying the task's details.
- Connect to "cursor_change" signal on the ETable.
- (table_cursor_change_cb): update the HTML view every time the selected
- task changes.
- (timet_to_str_with_zone): new function copied from alarm daemon.
- (url_requested_cb): callback for "url_requested" signal on the
- GtkHTML widget.
- (on_link_clicked_cb): respond to clicks linked on the HTML widget.
- (vpaned_resized_cb): set the configuration entry for the task vpane
- position.
- (e_tasks_destroy): free new member.
- (e_tasks_construct): connect to "obj_removed" signal on the CalClient.
- (client_obj_removed_cb): if the updated object is the one being
- displayed in the HTML widget, update it.
-
- * gui/calendar-config.[ch] (calendar_config_get_task_vpane_pos):
- (calendar_config_gset_task_vpane_pos): new functions.
-
- * gui/apps_evolution_calendar.schemas: added task vpane position.
-
-2003-07-03 Antonio Xu <antonio.xu@sun.com>
-
- Fixes #45767
-
- * conduits/todo/Makefile.am: removed libwombat from the build.
-
-2003-07-02 Harry Lu <harry.lu@sun.com>
-
- Fixes #44485
-
- * gui/e-timezone-entry.c (e_timezone_entry_set_entry): pass a
- new allocated string to gtk_entry_set_text instead of the one
- that might come from gettext.
-
-2003-07-02 Dan Winship <danw@ximian.com>
-
- * cal-client/cal-client.c (real_open_calendar): Don't leak
- exceptions
- (load_static_capabilities): free the capability string
-
- * gui/dialogs/task-page.c (task_page_fill_component): Free the
- description text if it *was* set, rather than if it wasn't.
-
- * gui/dialogs/task-editor.c (task_editor_finalize): Free the priv
- struct.
-
-2003-07-02 Bolian Yin <bolian.yin@sun.com>
-
- Fixes #45328, #45329
-
- * gui/e-day-view.c (e_day_view_do_key_press): Do not process
- PageUp/PageDown, .. when the Alt key is pressed (give key binding
- set the chance).
- * gui/gnome-cal.h : define new enum type, GNOME_CAL_GOTO_DATE_TYPE.
- * gui/gnome-cal.c (gnome_calendar_class_init): define new signal
- "goto_date". Add key bindings for "Alt+PageUp/PageDown",
- "Alt+Home/End".
- (gnome_calendar_goto_date): Impl. signal handler for "goto_date".
-
-2003-07-01 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #45524
-
- * gui/calendar-commands.c: use stock icons where approppriate.
-
- * gui/tasks-control.c: removed EPixmaps structure, since we only use
- stock icons now.
- (tasks_control_activate): no need to call e_pixmaps_update.
-
-2003-07-01 Bolian Yin <bolian.yin@sun.com>
-
- Fixes #45274
-
- * gui/e-week-view.c: implemented tabbing though events in week view.
-
-2003-06-30 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-client/cal-client.c: removed usage of WombatClient.
- (client_get_password_cb, client_forget_password_cb): removed.
- (real_open_calendar): don't create the WombatClient object.
- (cal_client_init, cal_client_finalize): removed WombatClient
- related code.
- (cal_client_finalize): re-enabled call to destroy_factories.
-
- * pcs/cal.c: removed usage of WombatClient interface.
- (cal_construct): don't get a reference to the WombatClient.
- (cal_get_password, cal_forget_password): removed unused functions.
-
- * conduits/calendar/Makefile.am:
- * cal-client/Makefile.am: removed references to libwombat.
-
-2003-06-27 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/dialogs/send-comp.[ch] (send_component_dialog):
- * gui/dialogs/cancel-comp.[ch] (cancel_component_dialog): added a
- GtkWindow argument for callers to specify the parent window.
-
- * gui/dialogs/changed-comp.[ch] (changed_component_dialog): added
- 'parent' argument and use GtkMessageDialog instead of
- gnome_question_dialog.
-
- * gui/e-calendar-table.c (e_calendar_table_delete_selected):
- * gui/e-day-view.c (e_day_view_delete_event_internal,
- e_day_view_on_cut, e_day_view_finish_long_event_resize,
- e_day_view_finish_resize, e_day_view_on_editting_stopped,
- e_day_view_on_top_canvas_drag_data_received, selection_received):
- * gui/e-week-view.c (e_week_view_delete_event_internal,
- e_week_view_on_cut, e_week_view_on_editing_stopped,
- selection_received):
- * gui/dialogs/event-editor.c (cancel_meeting_cmd):
- * gui/dialogs/task-editor.c (cancel_task_cmd):
- * gui/dialogs/comp-editor.c (delete_cmd, obj_removed_cb): pass the parent window to
- the *_component_dialog() functions.
-
- * gui/dialogs/delete-comp.c (delete_component_dialog): use the 'widget'
- argument to get the parent window for the dialog.
-
-2003-06-26 Bolian Yin <bolian.yin@sun.com>
-
- Fixes #45276
-
- * gui/e-day-view.c (e_day_view_on_text_item_event): set focus to dayview
- when editing is canceled.
- * gui/e-week-view.c (e_week_view_on_text_item_event): set focus to weekview
- when editing is canceled
-
-2003-06-25 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #44723
-
- * gui/dialogs/alarm-page.c: added a new field to the private structure
- to keep track of the old summary.
- (alarm_page_init): initialize new field.
- (alarm_page_finalize): free new field.
- (alarm_page_set_summary): iterate over the list of alarms to change
- their description if it was the same as the event's summary.
-
-2003-06-25 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #44719
-
- * gui/alarm-notify/alarm-notify-dialog.c (alarm_notify_dialog): use
- gtk_window_set_icon_from_file to set the window's icon and implemented
- the code to make the window sticky with GTK 2.x API.
-
-2003-06-25 Bolian Yin <bolian.yin@sun.com>
-
- Fixes #45275
-
- * gui/e-calendar-table.c (e_calendar_table_show_popup_menu): new function.
- (e_calendar_table_on_right_click_menu): call e_calendar_table_show_popup_menu.
- (e_calendar_table_on_popup_menu): callback for "popup_menu" signal.
- (e_calendar_table_init): connect to ETable's "popup_menu" signal.
-
-2003-06-25 Bolian Yin <bolian.yin@sun.com>
-
- Fixes #45273
-
- * gui/e-day-view.c: implemented tabbing though events in day view.
-
-2003-06-23 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/dialogs/comp-editor.c (make_title_from_string, set_title_from_string):
- new functions.
- (page_summary_changed_cb): change the window title when the object's
- summary changes.
-
-2003-06-22 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-client/cal-client.c (get_factories): don't use a static GList,
- since the value returned is freed in destroy_factories, making several
- clients use a buggy GList if one of them happen to be destroyed.
-
-2003-06-22 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/print.c (get_font_for_size): Remove debug output.
-
- * gui/tasks-control.c (print_tasks): Ref and sink the printable.
- Use fixed (5%) margins instead of what gnome-print gives us.
-
-2003-06-19 Dan Winship <danw@ximian.com>
-
- * pcs/cal-backend.c (cal_backend_finalize): don't leak the
- CalBackendPrivate.
-
-2003-06-18 Dan Winship <danw@ximian.com>
-
- * gui/calendar-config.c (calendar_config_get_hpane_pos)
- (calendar_config_get_vpane_pos)
- (calendar_config_get_month_hpane_pos)
- (calendar_config_get_month_vpane_pos): Plug in the defaults from
- the schemas file here, so that even if something goes wrong with
- the schemas, people will still get reasonable defaults instead of
- "I click on the calendar and it shows me tasks".
-
-2003-06-16 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/dialogs/comp-editor.c (make_title_from_comp): removed unused
- variable.
-
-2003-06-12 Jack Jia <jack.jia@sun.com>
-
- * gui/e-itip-control.c
- (struct _EItipControlPrivate): switch the "view_only" arg to be an
- int.
- (init): ditto.
- (e_itip_control_set_view_only): ditto.
- (e_itip_control_get_view_only): ditto.
-
- * gui/itip-bonobo-control.c
- (get_prop): switch BONOBO_ARG_SET_BOOLEAN to BONOBO_ARG_SET_INT.
- (set_prop): switch BONOBO_ARG_GET_BOOLEAN to BONOBO_ARG_GET_INT.
- (itip_bonobo_control_new): switch BONOBO_ARG_BOOLEAN to
- BONOBO_ARG_INT.
-
- Function "bonobo_property_bag_client_set_value_gboolean" can not
- work on solaris.
-
-2003-06-10 Bolian Yin <bolian.yin@sun.com>
-
- Fixes #44682, Shift+F10 to active popup menu on day/week view
-
- * gui/e-day-view.c (e_day_view_key_press, e_day_view_do_key_press):
- When the key press is not handled, give keybindings the chance.
- (e_day_view_popup_menu, e_day_view_show_popup_menu,
- e_day_view_on_event_right_click ): popup menu will be activated from
- both keyboard and mouse.
-
- * gui/e-week-view.c (e_week_view_key_press, e_week_view_do_key_press):
- When the key press is not handled, give keybindings the chance.
- (e_week_view_popup_menu): popup menu can be activated from keyboard
-
-2003-06-10 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #41582
-
- * gui/gnome-cal.c (gnome_calendar_hpane_resized): killed warnings
- and added code to resize the EDayView's time column on the hpane's
- resizing.
- (gnome_calendar_vpane_resized): killed warnings.
-
-2003-06-05 Not Zed <NotZed@Ximian.com>
-
- ** For #42691.
-
- * gui/Makefile.am (%.server.in): implicit rule for .in file.
- (BUILT_SOURCES): added server_DATA.
-
- * gui/alarm-notify/Makefile.am (%.server.in): added implicit rule
- for .in file.
- (BUILT_SOURCES): added server_DATA.
-
-2003-06-04 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/query.c (start_cached_query_cb): adapted to changes in
- EComponentListener API.
- (query_construct): ditto.
-
- * cal-client/cal-client.c (cal_opened_cb): ditto.
diff --git a/calendar/ChangeLog.pre-1-4 b/calendar/ChangeLog.pre-1-4
deleted file mode 100644
index 912411acd1..0000000000
--- a/calendar/ChangeLog.pre-1-4
+++ /dev/null
@@ -1,21872 +0,0 @@
-2003-06-02 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes part of #43388
-
- * importers/icalendar-importer.c (prepare_events):
- (prepare_tasks): use external iterators for removing components from
- the main component.
-
-2003-05-29 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #43763
-
- * gui/e-week-view.c (e_week_view_init): use g_signal_connect_after
- for "button_press_event" callback.
-
- * gui/e-day-view.c (e_day_view_init): ditto.
-
-2003-05-29 JP Rosevear <jpr@ximian.com>
-
- Fixes #43775
-
- * gui/weekday-picker.c (get_day_text): calculate the characters to
- display correctly
- (configure_items): use it
- (weekday_picker_style_set): ditto
-
- * gui/print.c (format_date): use e_utf8_strftime
- (print_week_view_background): ditto
- (print_month_summary): ditto
- (range_selector_new): ditto
- (print_comp_item): ditto
-
- * gui/itip-utils.c (comp_description): the translation is already
- utf8
-
- * gui/e-itip-control.c (write_label_piece): the string is already
- in utf8
-
- * gui/e-day-view.c (e_day_view_style_set): use e_utf8_strftime
- (e_day_view_recalc_cell_sizes): ditto
-
- * gui/e-day-view-top-item.c (e_day_view_top_item_draw): use
- e_utf8_strftime
-
- * gui/e-cell-date-edit-text.c (ecd_get_text): return the
- duplicated buffer (its already utf8)
- (show_date_warning): use e_utf8_strftime
-
- * gui/calendar-model.c (date_value_to_string): return the
- duplicated buffer (its already utf8)
- (calendar_model_value_to_string): the translations should already
- be in utf8
-
- * gui/calendar-config.c
- (calendar_config_locale_supports_12_hour_format): use
- e_utf8_strftime
-
- * gui/calendar-commands.c (calendar_set_folder_bar_label): use
- e_utf8_strftime
-
-2003-05-28 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #43455
-
- * gui/tasks-control.c (confirm_expunge): converted to a GtkMessageDialog
- and removed object weak's ref code, not needed anymore.
-
-2003-05-20 JP Rosevear <jpr@ximian.com>
-
- Fixes #43308
-
- * gui/e-meeting-time-sel.c (e_meeting_time_selector_style_set):
- adjust row heights to reflect changes in etable row heights and
- set display top to align properly
-
-2003-05-22 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/comp-editor-page.c (comp_editor_page_destroy): unref
- not ref the client
-
-2003-05-22 JP Rosevear <jpr@ximian.com>
-
- Fixes #41329
-
- * gui/e-meeting-time-sel.c
- (e_meeting_time_selector_on_zoomed_out_toggled): make sure the
- meeting time is shown afterwards
- (e_meeting_time_selector_on_working_hours_toggled): ditto
-
-2003-05-21 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #41234
-
- * gui/dialogs/e-delegate-dialog.glade: changed button ordering.
-
-2003-05-20 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/gnome-cal.c (gnome_calendar_setup_view_menus): Removed
- debugging message.
-
-2003-05-20 Anna Marie Dirks <anna@ximian.com>
-
- * gui/dialogs/save-comp.c (save_component_dialog): Change this
- dialog from using a gnome_message_box (which has been deprecated),
- to using a gtk_message_dialog. This HIG-ifies this dialog, and
- fixes bug #42046.
-
-2003-05-20 Hans Petter Jansson <hpj@ximian.com>
-
- Fixes #42056
-
- * gui/e-meeting-time-sel.c (e_meeting_time_selector_construct):
- Don't create accel groups for menuitem mnemonics. Don't use
- deprecated functions where we actually need accel groups.
-
-2003-05-19 Dan Winship <danw@ximian.com>
-
- * pcs/cal-backend.c (cal_backend_finalize): Don't double-free
- newly-added categories that the gui hasn't been told about yet.
- #43321
-
-2003-05-19 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/main.c (factory): set 'initialized' to TRUE when initialization
- is done, or we get the initialization code called over and over.
-
-2003-05-19 Anna Marie Dirks <anna@ximian.com>
-
- * gui/e-meeting-time-sel.c: (e_meeting_time_selector_construct):
- Added HIG-blessed padding to (some of) the widgets in the
- dialog.
-
- * gui/dialogs/meeting-page.glade: Added HIG-blessed border width
- and spacing to the meeting page of the event editor.
-
- * gui/dialogs/schedule-page.glade: Added HIG-blessed border width
- to the schedule page on the event editor.
-
-
-2003-05-19 JP Rosevear <jpr@ximian.com>
-
- * gui/gnome-cal.c (gnome_calendar_destroy): remove the query time
- out if its still alive
- (update_query_timeout): update the query and clear the time out
- (client_cal_opened_cb): add the query update timeout
-
-2003-05-19 JP Rosevear <jpr@ximian.com>
-
- Fixes #43103
-
- * gui/e-day-view.c (e_day_view_init): connect normally instead of
- after so that our boolean return values afffect the action signal
- emmissions properly
- (e_day_view_on_top_canvas_drag_motion): fix proto to be a gboolean
- (e_day_view_on_main_canvas_drag_motion): ditto
-
- * gui/e-week-view.c (e_week_view_init): connect normally instead
- of after so that our boolean return values afffect the action
- signal emmissions properly
-
-2003-05-16 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/comp-editor.c (make_title_from_comp): the title is
- already in UTF-8
-
-2003-05-16 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #42220
-
- * gui/e-day-view.c (e_day_view_finish_resize): hide canvas items and
- update internal fields before updating the object.
-
-2003-05-15 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/comp-editor.c (comp_editor_finalize): unref the
- client and the ui component
-
-2003-05-15 JP Rosevear <jpr@ximian.com>
-
- Fixes #41935
-
- * gui/e-week-view.c (e_week_view_init): listen for scroll events
- on the canvas
- (e_week_view_on_button_press): don't scroll here
- (e_week_view_on_scroll): scroll here
-
- * gui/e-day-view.c (e_day_view_init): listen for scroll events on
- the time and main canvases
- (e_day_view_on_main_canvas_button_press): don't scroll here
- (e_day_view_on_main_canvas_scroll): scroll here
- (e_day_view_on_time_canvas_scroll): and here
-
-2003-05-15 JP Rosevear <jpr@ximian.com>
-
- Fixes #43029
-
- * gui/e-week-view.c (e_week_view_init): don't listen for destroy
- signal
- (e_week_view_destroy): check for NULL and make invisible NULL
- after we destroy it, unref cursors and NULL them out as well,
- guard against freeing events multiple times
-
- * gui/e-day-view.c (e_day_view_destroy): check for NULL and make
- invisible NULL after we destroy it, unref cursors and NULL them
- out as well, guard against freeing events multiple times
- (e_day_view_init): don't listen for destroy signal
-
- * gui/e-calendar-table.c (e_calendar_table_init): don't listen for
- destroy signal
- (e_calendar_table_destroy): check for NULL and make invisible NULL
- after we destroy it
-
-2003-05-15 JP Rosevear <jpr@ximian.com>
-
- Fixes #41930
-
- * idl/evolution-calendar.idl: Make sure everything that can raise
- a NotFound exception lists it
-
-2003-05-15 JP Rosevear <jpr@ximian.com>
-
- * gui/e-meeting-time-sel.c
- (e_meeting_time_selector_refresh_free_busy): ref ourselves the
- number of times we'll get called back
-
-2003-05-14 JP Rosevear <jpr@ximian.com>
-
- * gui/e-tasks.c (e_tasks_destroy): guard against multiple destroys
-
- * cal-client/cal-client.c (cal_client_finalize): unref the
- bonobo listener
-
- * gui/gnome-cal.c (gnome_calendar_destroy): guard against multiple
- destroy calls
-
- * gui/e-week-view.c (e_week_view_init): connect after destroy
- (invisible_destroyed): don't unref, its already destroyed
-
- * gui/e-day-view.c (e_day_view_init): connect after destroy
- (invisible_destroyed): don't unref, its already destroyed
-
- * gui/e-calendar-table.c (e_calendar_table_class_init): make sure
- we set the parent class
- (e_calendar_table_init): connect after the destroy handler runs
- (e_calendar_table_destroy): guard against multiple destroys
- (invisible_destroyed): don't unref the invisible, its already
- being destroyed
-
- * gui/calendar-offline-handler.c (backend_cal_set_mode): unref the
- client, we are done with it now
- (backend_cal_opened_online): ditto
- (impl_dispose): unref our main client
-
- * gui/calendar-commands.c (control_util_set_folder_bar_label):
- release/unref the shell view once we are done with it
- (control_util_show_settings): ditto
-
-2003-05-13 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/alarm-notify/alarm-queue.c (notify_dialog_cb): fixed memory
- leak introduced by previous commit.
-
-2003-05-12 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #41760
-
- * gui/alarm-notify/alarm-queue.c (create_snooze): don't add a new
- alarm, but update the already existing one.
- (notify_dialog_cb): make sure we don't remove the alarm if we are
- snoozing.
-
-2003-05-07 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/task-page.glade: fix button conversion problem
-
- * gui/dialogs/task-details-page.c
- (task_details_page_fill_widgets): only free the percent if its
- non-null
-
-2003-05-07 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-client/cal-client.c (cal_client_discard_alarm): added missing
- assignment.
-
-2003-05-05 JP Rosevear <jpr@ximian.com>
-
- Fixes #41811
-
- * gui/alarm-notify/Makefile.am: don't dist idl generated files
-
-2003-05-01 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/task-editor.c (task_editor_finalize): unref the
- model again
- (task_editor_edit_comp): don't allow editing if the assignee has
- delegated
-
- * gui/dialogs/meeting-page.c (popup_delete_cb): set the new
- non-delegator to be editable
-
- * gui/dialogs/event-editor.c (event_editor_edit_comp): don't allow
- editing if the attendee has delegated
- (event_editor_finalize): unref the model again
-
- * gui/e-meeting-model.c: remove e-table-without related functions
- (finalize): don't create without table
- (e_meeting_model_etable_from_model): build the table with this as
- model
- (e_meeting_model_etable_model_to_view_row): directly use the
- model_to_view call
- (e_meeting_model_etable_view_to_model_row): as above
- (attendee_changed_cb): make sure pre change is alwasy called
-
- * gui/e-meeting-model.h: use DECLS, remove protos for long dead
- functions, don't include config.h
-
-2003-04-30 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/alarm-notify/alarm-notify.c (alarm_notify_add_calendar): removed
- unused code.
-
-2003-04-29 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/task-editor.c (task_editor_finalize): ditto
-
- * gui/dialogs/event-editor.c (event_editor_finalize): don't unref
- the model here
-
- * gui/e-meeting-time-sel.c (e_meeting_time_selector_destroy): null
- up the display_top and display_main for re-entrancy purposes
-
-2003-04-25 JP Rosevear <jpr@ximian.com>
-
- * gui/itip-utils.c (itip_send_comp): kill warnings
-
-2003-04-28 Anna Marie Dirks <anna@ximian.com>
-
- * gui/dialogs/alarm-options.glade: Added HIG-blessed padding
- to the alarm options dialog. Fixes bug #41221.
-
-2003-04-28 Anna Marie Dirks <anna@ximian.com>
-
- * gui/dialogs/cal-prefs-dialog.glade: Added appropriate spacing
- and padding to the calendar/tasks page of the settings dialog.
- Fixes bug #41129
-
-
-2003-04-28 Anna Marie Dirks <anna@ximian.com>
-
- * gui/dialogs/task-page.glade: Finishes up fixing #41256 by
- adding appropriate spacing/padding to the main task page.
-
- * gui/dialogs/task-details-page.glade: Added appropriate
- spacing and padding to the task-details page. Partially
- fixes #41256.
-
-
-2003-04-28 Anna Marie Dirks <anna@ximian.com>
-
- * gui/dialogs/recurrence-page.glade: Added padding/spacing
- to this page as specified by the HIG. Partially fixes #41215.
-
- * gui/dialogs/alarm-page.glade: Added padding/spacing/stock
- buttons to the alarm page. Partially fixes #41215.
-
- * gui/dialogs/event-page.glade: Added padding/spacing to the
- event-page (partially fixes #41215)
-
-
-2003-04-27 Rodney Dawes <dobey@ximian.com>
-
- Fixes #35814
-
- * gui/calendar-component.c: Change mnemonic/keybinding for
- New Meeting to not conflict with other items in the File->New menu
-
-2003-04-24 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #41661
-
- * idl/evolution-calendar.idl: added discardAlarm method to
- GNOME:Evolution:Calendar:Cal interface.
-
- * pcs/cal.c (cal_class_init): set new epv's method.
- (impl_Cal_discardAlarm): implementation of new CORBA method.
-
- * pcs/cal-backend.[ch]: added 'discard_alarm' virtual method, and
- CAL_BACKEND_RESULT_NOT_IMPLEMENTED to CalBackendResult enum.
- (cal_backend_class_init): initialize new class method.
- (cal_backend_discard_alarm): new method.
- (cal_backend_update_objects, cal_backend_remove_object): return
- proper CalBackendResult values.
-
- * pcs/cal-backend-file.c (cal_backend_file_class_init): initialize
- new class method.
- (cal_backend_file_discard_alarm): implementation of new method.
-
- * pcs/cal-client.[ch] (cal_client_discard_alarm): new function.
-
- * gui/alarm-notify/alarm-queue.c (remove_qeueud_alarm): don't remove
- the alarm directly from the component, call cal_client_discard_alarm
- and let the backend deal with it.
-
-2003-04-24 JP Rosevear <jpr@ximian.com>
-
- * gui/apps_evolution_calendar.schemas: set the hpane default to
- 32000 so we never see a pane no matter the start up window size
- unless the user changes it
-
-2003-04-24 JP Rosevear <jpr@ximian.com>
-
- Fixes #37552
-
- * gui/dialogs/Makefile.am: build delete-error.[hc]
-
- * gui/e-tasks.c: wrap calls to cal_client_remove_object with
- delete_error_dialog
-
- * gui/e-itip-control.c: ditto
-
- * gui/e-calendar-table.c: ditto
-
- * gui/e-week-view.c: ditto
-
- * gui/e-day-view.c: ditto
-
- * gui/dialogs/delete-error.[hc]: gemerate an error message based
- on result
-
-2003-04-23 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-day-view.c (e_day_view_on_delete_occurrence): removed
- unused variable..
-
-2003-04-23 Hans Petter Jansson <hpj@ximian.com>
-
- Fixes #41641
-
- * gui/e-day-view.c (e_day_view_focus_in): Remove assert an old
- input method code.
- (e_day_view_focus_out): Ditto.
- (e_day_view_reshape_long_event): Set input method context.
- (e_day_view_reshape_day_event): Ditto.
- (e_day_view_on_editing_started): Let EText handle the context popup.
- (e_day_view_on_editing_stopped): Turn off EText's handling of context
- popup.
-
- * gui/e-week-view.c (e_week_view_reshape_event_span): Set input
- method context.
- (e_week_view_on_text_item_event): Let the EText item handle
- right-click context popup if we're editing it.
- (e_week_view_on_editing_started): Let the EText item handle the
- context popup.
- (e_weeK_view_on_editing_stopped): Turn off EText's handling of
- context popup.
-
-2003-04-23 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #41671
-
- * gui/alarm-notify/notify-main.c (main): added calls to gnome_sound_init
- and gnome_sound_shutdown.
-
- * gui/alarm-notify/alarm-queue.c (audio_notification): check that the
- sound file exists, and gdk_beep if not.
-
-2003-04-22 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes part of #41148, #41216 and #41235
-
- * gui/e-itip-control.c (init):
- * gui/e-meeting-time-sel.c (e_meeting_time_selector_construct,
- e_meeting_time_selector_add_key_color):
- * gui/e-timezone-entry.c (e_timezone_entry_init):
- * gui/gnome-cal.c (setup_widgets):
- * gui/tasks-control.c (confirm_expunge):
- * gui/dialogs/comp-editor.c (setup_widgets):
- * gui/dialogs/e-delegate-dialog.c (e_delegate_dialog_construct):
- * gui/dialogs/meeting-page.c (meeting_page_construct):
- * gui/dialogs/recurrence-page.c (make_weekly_special,
- make_monthly_special, make_ending_count_special):
- * gui/dialogs/schedule-page.c (schedule_page_construct):
- use HIG-suggested spacing.
-
-2003-04-21 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #22444
-
- * gui/calendar-commands.c: added new verbs for occurrence-related
- menu items.
- (delete_occurrence_cmd): added callback for "Delete this occurrence"
- menu item. "Delete all occurrences" is just the same as "Delete".
- (sensitize_calendar_commands): sensitive ocurrence-related menu items.
-
- * gui/gnome-cal.[ch] (gnome_calendar_delete_selected_occurrence): new
- function.
- (gnome_calendar_get_current_view_widget): made this public.
-
- * gui/e-week-view.[ch] (e_week_view_get_selected_event):
- (e_week_view_delete_occurrence): new functions.
- (e_week_view_delete_occurrence_internal): real implementation of the
- 'Delete Occurrence' logic.
- (e_week_view_on_delete_occurrence): call delete_instance_internal.
-
- * gui/e-day-view.[ch] (e_day_view_get_selected_event):
- (e_day_view_delete_occurrence): new functions.
- (e_week_view_delete_occurrence_internal): real implementation of the
- 'Delete Occurrence' logic.
- (e_week_view_on_delete_occurrence): call delete_occurrence_internal.
-
-2003-04-18 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/alarm-notify/alarm-notify.glade: removed 'heading' and
- 'message' labels.
-
- * gui/alarm-notify/alarm-notify-dialog.c: removed deleted widgets.
- (alarm_notify_dialog): don't load the removed widgets.
-
-2003-04-18 Rodney Dawes <dobey@ximian.com>
-
- Fixes #21499
-
- * gui/Makefile.am:
- * gui/calendar-commands.c:
- * gui/tasks-control.c:
- * gui/dialogs/Makefile.am:
- * gui/dialogs/comp-editor.c:
- Use PREFIX instead of EVOLUTION_DATADIR for bonobo_ui_util_set_ui ()
-
-2003-04-17 JP Rosevear <jpr@ximian.com>
-
- Fixes #41459
-
- * gui/dialogs/meeting-page.c: comment out delegation stuff
-
-2003-04-17 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #34498
-
- * gui/alarm-notify/alarm-queue.c: added a 'uid' field to the
- CompQueuedAlarms structure.
- (remove_queued_alarm): free the 'uid' field when freeing the
- structure.
- (add_component_alarms): g_strdup the component's UID and use that as
- the key for the hash table.
-
-2003-04-16 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #41129, #41215, #41221, #41256
-
- * gui/alarm-notify/alarm-notify.glade:
- * gui/dialogs/alarm-options.glade:
- * gui/dialogs/alarm-page.glade:
- * gui/dialogs/cal-prefs-dialog.glade:
- * gui/dialogs/e-delegate-dialog.glade:
- * gui/dialogs/meeting-page.glade:
- * gui/dialogs/recurrence-page.glade:
- * gui/dialogs/schedule-page.glade:
- * gui/dialogs/task-details-dialog.glade:
- * gui/dialogs/task-page.glade:
- * gui/dialogs/event-page.glade: set spacing to 6 pixels
- everywhere.
-
-2003-04-16 JP Rosevear <jpr@ximian.com>
-
- Fixes #41230
-
- * gui/e-itip-control.c (show_current): make sure to pass TRUE for
- tasks
- (start_calendar_server): make sure we don't gtk_main_quit if we
- haven't gtk_main'ed
- (start_calendar_server_cb): ditto
-
-2003-04-15 JP Rosevear <jpr@ximian.com>
-
- Fixes #39735 and 40257
-
- * gui/gnome-cal.c: convert float pane positions to ints
- (setup_widgets): set the initial position after realization and
- track the drags to get the new position, pack the panes slightly
- differently
- (gnome_calendar_set_pane_positions): set purely pixel oriented
- positions
- (gnome_calendar_update_config_settings): no need to update quanta
- setting
- (gnome_calendar_hpane_realized): realization callback
- (gnome_calendar_vpane_realized): ditto
- (gnome_calendar_vpane_resized): resize callback, store new size
- (gnome_calendar_hpane_resized): ditto
-
- * gui/calendar-model.c (get_due_status): handle an error getting
- the timezone
-
- * gui/calendar-config.c (calendar_config_get_hpane_pos): return an int
- (calendar_config_set_hpane_pos): take an int
- (calendar_config_get_vpane_pos): return an int
- (calendar_config_set_vpane_pos): take an int
-
- * gui/calendar-config.h: update protos
-
- * gui/apps_evolution_calendar.schemas: update defaults for pane
- positions
-
-2003-04-15 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/calendar-component.c (owner_set_cb): If we already have an
- evolution_dir, free the old one before setting it anew.
-
- * gui/e-day-view-time-item.c (e_day_view_time_item_draw): Unref the
- metrics.
-
- * gui/e-day-view.c (e_day_view_style_set): Unref the metrics.
- (e_day_view_recalc_cell_sizes): We don't need font metrics here.
- (e_day_view_reshape_long_event): Ditto.
-
- * gui/e-meeting-model.c (init): Don't dup the string passed to
- e_table_without_hide().
-
- * gui/e-meeting-time-sel.c (e_meeting_time_selector_style_set):
- Unref the metrics.
- (e_meeting_time_selector_recalc_date_form): Doesn't need metrics.
-
- * gui/e-week-view-main-item.c (e_week_view_main_item_draw_day):
- Unref the metrics.
-
- * gui/e-week-view.c (e_week_view_style_set): Unref metrics.
- (e_week_view_recalc_cell_sizes): Ditto.
- (e_week_view_reshape_event_span): Move Pango stuff to where it
- can't be leaked due to an early return. Unref metrics.
-
- * gui/weekday-picker.c (weekday_picker_style_set): Unref metrics.
-
- * gui/dialogs/meeting-page.c (meeting_page_finalize): Free default
- address.
-
-2003-04-11 Dan Winship <danw@ximian.com>
-
- * gui/dialogs/Makefile.am (IDL_GENERATED, etc): Oops. Add this
- back. Turns out it's still needed by other parts.
-
-2003-04-11 Dan Winship <danw@ximian.com>
-
- * gui/dialogs/task-page.glade: Remove the "Contacts" button and
- entry from here too. Supposed to have been part of #35926
-
- * gui/dialogs/task-page.c: Remove all code pertaining to the
- contacts button
-
- * gui/dialogs/comp-editor-util.c:
- * gui/dialogs/comp-editor-util.h: Likewise
-
- * gui/dialogs/Makefile.am (IDL_GENERATED, etc): Remove
- select-names stuff, which is no longer used.
-
-2003-04-11 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-util/cal-util.h: added missing capabilities.
-
- * cal-client/cal-client.c (cal_client_get_one_alarm_only,
- cal_client_get_organizer_must_attend,
- cal_client_get_save_schedules):
- * gui/itip-utils.c (itip_organizer_is_user):
- * gui/e-calendar-table.c (e_calendar_table_on_right_click):
- * gui/dialogs/task-editor.c (set_menu_sens):
- * gui/dialogs/event-page.c (event_page_fill_widgets):
- * gui/dialogs/meeting-page.c (meeting_page_fill_widgets):
- * gui/dialogs/alarm-page.c (button_options_clicked_cb): use the macros
- defined in cal-util.h for static capabilities.
-
-2003-04-11 JP Rosevear <jpr@ximian.com>
-
- * gui/e-meeting-model.c (start_addressbook_server): load the
- default book to look for additional free/busy info in
- (init): ugly hack to make sure we get destroyed, set idle id to 0
- (process_callbacks): unref the im because we are now done with it
- (refresh_busy_periods): set idle id to 0, ref the model and handle
- e_book_get_cursor error
-
-2003-04-11 JP Rosevear <jpr@ximian.com>
-
- * gui/e-meeting-time-sel-item.c
- (e_meeting_time_selector_item_destroy): guard against multiple
- destroy calls
-
-2003-04-11 JP Rosevear <jpr@ximian.com>
-
- * cal-client/cal-client.c (cal_client_get_free_busy): only print a
- message if the exception isn't the reasonable NotFound
-
-2003-04-11 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/schedule-page.c (schedule_page_finalize): unref the
- main widget since we ref it when we un-parent it
-
- * gui/dialogs/alarm-page.c (alarm_page_finalize): ditto
-
- * gui/dialogs/task-page.c (task_page_finalize): ditto
-
- * gui/dialogs/event-page.c (event_page_finalize): ditto
-
- * gui/dialogs/task-details-page.c (task_details_page_finalize):
- ditto
-
- * gui/dialogs/recurrence-page.c (recurrence_page_finalize): ditto
-
- * gui/dialogs/meeting-page.c (meeting_page_finalize): ditto
-
-2003-04-10 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-meeting-time-sel.c
- (e_meeting_time_selector_options_menu_position_callback):
- (e_meeting_time_selector_autopick_menu_position_callback): added the
- allocation's X and Y position to the calculated coordinates.
-
-2003-04-10 JP Rosevear <jpr@ximian.com>
-
- Fixes #41127
-
- * gui/e-meeting-time-sel.c (e_meeting_time_selector_refresh_cb):
- unref here, when the callback is done
- (e_meeting_time_selector_refresh_free_busy): don't unref here
-
- * gui/e-meeting-model.c (process_free_busy): if the type is
- unexpected, make sure we cleanup properly
-
-2003-04-10 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/alarm-notify/alarm-queue.c (remove_queued_alarm): only remove
- the alarm for backends that want it (Exchange).
-
-2003-04-10 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-util/cal-util.h: added #define's for static capabilities.
-
- * pcs/cal-backend-file.c (cal_backend_file_get_static_capabilities):
- use the #define's above.
-
-2003-04-09 Chris Toshok <toshok@ximian.com>
-
- Fixes #40133
-
- * pcs/cal-backend.c (cal_backend_class_init): use G_TYPE_INT
- instead of G_TYPE_ENUM as a parameter type for the signal to get
- rid of runtime warning.
-
-2003-04-09 JP Rosevear <jpr@ximian.com>
-
- Fixes #40915
-
- * gui/calendar-model.c (get_due_status): when getting the current
- time for date values, use a timezone aware function
-
-2003-04-09 JP Rosevear <jpr@ximian.com>
-
- Fixes #40952
-
- * pcs/cal-backend-file.c (cal_backend_file_open): check for file
- method instead of is_local
-
-2003-04-08 JP Rosevear <jpr@ximian.com>
-
- Fixes #40894
-
- * gui/gnome-cal.c
- (gnome_calendar_on_date_navigator_selection_changed): update the
- selection for all view types
-
-2003-04-08 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/dialogs/alarm-options.c: Remove button_ok, button_cancel,
- canceled members from struct Dialog.
- (get_widgets): Do not initialize.
- (close_dialog): Destroy the toplevel.
- (toplevel_delete_event_cb): Removed.
- (button_cancel_clicked_cb): Removed.
- (button_ok_clicked_cb): Removed.
- (close_dialog): Removed.
- (alarm_options_dialog_run): Use gtk_dialog_run.
- (init_widgets): Do not init ->canceled, do not connect OK/Cancel
- buttons.
- (alarm_to_dialog): No need to make the file entry modal from here
- anymore.
-
- * gui/dialogs/alarm-options.glade: Turned into a GtkDialog. Set
- the "modal" property to True for the file entry.
-
-2003-04-07 Hans Petter Jansson <hpj@ximian.com>
-
- Fixes #35926.
-
- * gui/dialogs/event-page.glade: Remove contacts entry/chooser.
-
- * gui/dialogs/event-page.c: Remove contacts entry/chooser.
- (event_page_init): Remove references.
- (event_page_finalize): Ditto.
- (event_page_fill_widgets): Ditto.
- (event_page_fill_component): Ditto.
- (get_widgets): Ditto.
- (init_widgets): Ditto.
- (contacts_clicked_cb): Remove wholesale.
- (contacts_changed_cb): Ditto.
-
-2003-04-07 JP Rosevear <jpr@ximian.com>
-
- Fixes #40876
-
- * gui/e-meeting-time-sel.c
- (e_meeting_time_selector_refresh_free_busy): guard against
- callbacks after destruction
- (e_meeting_time_selector_refresh_cb): ditto
-
-2003-04-07 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/event-page.glade: create buttons properly
-
- * gui/itip-utils.c (comp_server_send): for errors other than busy,
- we want to email the results
-
- * pcs/cal-backend.c (cal_backend_ref_categories): insert the new
- category in the category list as well
- (idle_notify_categories_changed): reset idle id
-
-2003-04-07 Not Zed <NotZed@Ximian.com>
-
- Fixes #40252
-
- * conduits/todo/todo-conduit.c: Same as below.
-
- * conduits/calendar/calendar-conduit.c: Change the LOG macro to a
- single arg macro which copies its arg. Fix all callers. Change
- WARN and INFO to simply g_warning/g_message. Init G_LOG_DOMAIN
- before including anything.
-
-2003-04-07 Dan Winship <danw@ximian.com>
-
- * gui/GNOME_Evolution_Calendar.server.in.in: Clean up server names
-
- * gui/alarm-notify/GNOME_Evolution_Calendar_AlarmNotify.server.in.in:
- Likewise
-
- * importers/GNOME_Evolution_Calendar_Importer.server.in.in:
- Likewise. Also mark the evolution:menu_name for i18n
-
-2003-04-07 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/e-meeting-attendee.[ch]: GObjectify. Eliminates ref/sink
- warnings from the meeting editor.
-
-2003-04-06 Hans Petter Jansson <hpj@ximian.com>
-
- Week view part of fix for #39895.
-
- * gui/e-week-view-main-item.c (e_week_view_main_item_draw_day):
- Use the UNFOCUSSED colour if we're not focused, rather than not
- drawing anything.
-
- * gui/e-week-view.c: Set up the UNFOCUSSED colour.
-
- * gui/e-week-view.h: Add the UNFOCUSSED colour.
-
-2003-04-04 JP Rosevear <jpr@ximian.com>
-
- Fixes #40790
-
- * gui/alarm-notify/alarm-queue.c (procedure_notification_dialog):
- return based on the response code (not old button stuff)
-
-2003-04-04 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/dialogs/alarm-options.c (alarm_to_dialog): Make the file
- entry modal. [#40792]
-
-2003-04-04 JP Rosevear <jpr@ximian.com>
-
- Fixes #40789
-
- * gui/dialogs/alarm-options.c (alarm_to_dalarm_widgets):
- description is a text buffer
- (alarm_to_malarm_widgets): ditto
- (dalarm_widgets_to_alarm): ditto
- (malarm_widgets_to_alarm): ditto
- (alarm_to_repeat_widgets): check repeat status correctly
-
-2003-04-04 Dan Winship <danw@ximian.com>
-
- * gui/e-itip-control.c (write_html): Don't free static string.
-
-2003-04-04 JP Rosevear <jpr@ximian.com>
-
- * gui/cal-search-bar.c (cal_search_bar_destroy): guard against
- multiple destroy calls
-
-2003-04-04 JP Rosevear <jpr@ximian.com>
-
- * cal-client/cal-client.c (get_default_uri): guard against empty
- uri as well
-
-2003-04-04 JP Rosevear <jpr@ximian.com>
-
- Fixes #40722
-
- * gui/e-meeting-time-sel.c (e_meeting_time_selector_destroy):
- guard against multiple destroy calls
-
-2003-04-02 Jeffrey Stedfast <fejj@ximian.com>
-
- * gui/control-factory.c (set_prop): Add a check to see if the view
- should be the day-view and change the default to be whatever
- calendar_config_get_default_view() returns. Should fix bug #39735.
-
- * gui/calendar-config.h: calendar_config_write() and
- calendar_config_write_on_exit() no longer exist. Removed
- prototypes.
-
- * gui/control-factory.c (set_prop): g_strcasecmp() is
- deprecated. Since the values can never be anything other than all
- lowercase anyway, just use strcmp.
-
-2003-04-02 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #39262
-
- * importers/icalendar-importer.c (load_file_fn, vcal_load_file_fn):
- use folder_type argument to determine what to import.
-
-2003-04-02 Rodrigo Moya <rodrigo@ximian.com>
-
- * importers/icalendar-importer.c (load_file_fn, vcal_load_file_fn):
- added "folder_type" parameter to EvolutionImporterLoadFileFn.
-
-2003-04-02 JP Rosevear <jpr@ximian.com>
-
- Fixes #39955
-
- * gui/itip-utils.c (comp_sentby): don't unref the the account
-
-2003-04-02 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #40661
-
- * gui/itip-utils.c: added missing header for Forte compilation.
-
-2003-04-01 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/e-day-view-main-item.c (e_day_view_main_item_draw):
- Nuke GdkFont and use Pango's font measuring.
-
- * gui/e-day-view-time-itme.c (e_day_view_time_item_get_column_width)
- (e_day_view_time_item_draw): Ditto.
-
- * gui/e-day-view-top-item.c (e_day_view_top_item_draw)
- (e_day_view_top_item_draw_long_event): Ditto.
-
- * gui/e-day-view.c (e_day_view_style_set)
- (e_day_view_recalc_cell_sizes)
- (e_day_view_reshape_long_event)
- (e_day_view_update_top_canvas_drag)
- (e_day_view_update_main_canvas_drag): Ditto.
-
- * gui/e-meeting-time-sel.c (e_meeting_time_selector_style_set)
- (e_meeting_time_selector_recalc_date_form): Ditto.
-
- * gui/e-week-view-event-item.c (e_week_view_draw_time): Ditto.
-
- * gui/e-week-view-main-item.c (e_week_view_main_item_draw_day):
- Ditto.
-
- * gui/e-week-view-titles-item.c (e_week_view_titles_item_draw):
- Ditto.
-
- * gui/e-week-view.c (e_week_view_style_set)
- (e_week_view_recalc_cell_sizes)
- (e_week_view_reshape_event_span): Ditto.
-
- * gui/weekday-picker.c (weekday_picker_style_set): Ditto.
-
-2003-04-01 JP Rosevear <jpr@ximian.com>
-
- Fix for #17231 (Evo portion)
-
- * conduits/todo/todo-conduit.c (comp_from_remote_record): test for
- secret flag properly
-
- * conduits/calendar/calendar-conduit.c (comp_from_remote_record):
- ditto
-
-2003-04-01 Rodrigo Moya <rodrigo@ximian.com>
-
- * importers/icalendar-importer.c (load_file_fn, vcal_load_file_fn):
- added filename (tasks.ics/calendar.ics) to the URI if it does not
- contain it.
-
-2003-03-31 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #39961
-
- * gui/e-meeting-time-sel.c
- (e_meeting_time_selector_options_menu_position_callback):
- (e_meeting_time_selector_autopick_menu_position_callback): use the
- button's allocation to position the popup menu.
-
-2003-03-29 Not Zed <NotZed@Ximian.com>
-
- Fixes #39895
-
- * gui/e-day-view.h (EDayViewColors): add an unfocussed colour to
- draw the selection in when we're not focussed.
-
- * gui/e-day-view.c (e_day_view_realize): Initialise
- E_DAY_VIEW_COLOR_BG_SELECTED_UNFOCUSSED to be 1/2 saturation of
- the focussed colour.
-
- * gui/e-day-view-main-item.c (e_day_view_main_item_draw): Use the
- UFOCUSSED colour if we aren't focussed, rather than just not
- drawing anything.
-
-2003-03-28 JP Rosevear <jpr@ximian.com>
-
- * gui/e-itip-control.c (get_servers): the shell client is a
- g_object now, ref appropriately
-
-2003-03-28 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/e-day-view.c (comp_destroy_cb)
- (e_day_view_on_long_event_button_press)
- (e_day_view_on_event_button_press)
- (e_day_view_on_long_event_click)
- (e_day_view_on_event_click)
- (e_day_view_on_event_double_click)
- (e_day_view_on_delete_appointment): Hold weak references to the
- CalComponent instead of connecting to the "destroy" signal.
-
- * gui/e-week-view.c (comp_destroy_cb)
- (e_week_view_on_text_item_event): Ditto.
-
-2003-03-28 Hans Petter Jansson <hpj@ximian.com>
-
- Fixes #39954
-
- * gui/dialogs/recurrence-page.c (make_recurrence_special):
- Destroy would-be children of the container before the container.
-
-2003-03-28 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/meeting-page.c (meeting_page_init): init new members
- (get_current_account): get a matching account for the currently
- selected user in the combo
- (meeting_page_finalize): unref the meeting attendee if there is
- one
- (meeting_page_fill_widgets): don't set the combo list here
- (clear_widgets): set the default organizer here and if we don't
- have an organizer, add the default organizer as an attendee
- (meeting_page_fill_component): use get_current_account
- (org_changed_cb): if this is a new meeting and the organizer
- changes, change the attendee
- (change_clicked_cb): no need to set the default here
- (init_widgets): reflect changed callback name
- (meeting_page_construct): set the combo strings here
- (popup_delete_cb): remove the organizer attendee if the user
- explicitly deletes it
-
- * gui/e-meeting-model.c (attendee_changed_cb): set row properly
-
- * gui/itip-utils.c (comp_to_list): skip the user themselves if
- cancelling or requesting
-
-2003-03-26 Rodrigo Moya <rodrigo@ximian.com>
-
- * importers/icalendar-importer.c (gnome_calendar_import_data_fn): use
- g_object_unref for CalClient's.
- (create_checkboxes_control): use g_signal_connect.
-
- * cal-client/cal-client.c (cal_client_get_load_state): return correct
- values in g_return_val_if_fail.
-
-2003-03-26 Jack Jia <jack.jia@sun.com>
-
- * calendar/gui/dialogs/alarm-options.c
- (malarm_widgets_to_alarm): add a parameter(TC_CORBA_string) to
- the bonobo_widget_get_property.
-
-2003-03-25 Dan Winship <danw@ximian.com>
-
- * gui/itip-utils.c: Update for e_notice move
-
- * gui/tasks-control.c (confirm_expunge): Move the code that used
- to be e_gnome_dialog_set_parent here, since it was marked
- deprecated and this was the only place using it.
-
- * gui/dialogs/comp-editor.c: Update for e_notice move
- (page_changed_cb, page_summary_changed_cb, page_dates_changed_cb):
- Pass a parent_window to e_notice.
-
- * gui/dialogs/meeting-page.c: Update for e_notice move.
- (meeting_page_fill_component, meeting_page_fill_component,
- popup_delegate_cb): Pass a parent_window to e_notice
-
-2003-03-25 Dan Winship <danw@ximian.com>
-
- * cal-util/cal-util.c (cal_util_parse_ics_file): Utility wrapper
- around icalparser.
-
- * cal-util/test-recur.c (main): Use it
-
- * pcs/cal-backend-file.c (open_cal): Likewise
-
- * gui/comp-editor-factory.c (open_client): Add the OpenClient to
- the hash before calling cal_client_open_calendar, since in some
- failure cases, that will call cal_opened_cb (which will free the
- oc) with a failure immediately, causing a crash if we then try to
- deref it.
-
-2003-03-21 JP Rosevear <jpr@ximian.com>
-
- Fixes #32248
-
- * conduits/todo/todo-conduit.c (comp_from_remote_record): make
- sure the due date is actually a date
-
-2003-03-21 JP Rosevear <jpr@ximian.com>
-
- Fixes #31660
-
- * conduits/calendar/calendar-conduit.c (rrules_mostly_equal):
- check if the rrules are equal other than until/count
- (find_last_cb): update the data with the start timet
- (local_record_from_comp): handle the case where the recurrence
- rule ends after a certain number occurrences
- (comp_from_remote_record): same
-
-2003-03-20 JP Rosevear <jpr@ximian.com>
-
- * conduits/calendar/calendar-conduit.c
- (e_calendar_context_destroy): calcomponents are gobjects now
- (calconduit_load_configuration): ref and sink to avoid warnings
-
- * conduits/todo/todo-conduit.c (todoconduit_load_configuration):
- ref and sink to avoid warnings
- (e_todo_context_destroy): calcomponents are gobjects now
-
-2003-03-20 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/dialogs/cancel-comp.c (cancel_component_dialog): use a
- GtkMessageDialog and deal correctly with the dialog's reponses.
-
-2003-03-20 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #39770
-
- * gui/itip-utils.c (itip_Send_comp): check the CORBA exception instead
- of the g_return_val_if_fail. Also, use a CORBA_Object for the value
- returned from bonobo_activation_activate_from_id.
-
-2003-03-20 Rodrigo Moya <rodrigo@ximian.com>
-
- * importers/ical-importer.c: removed activation of shell_client.
- (importer_destroy_cb): no need to unref shell_client.
- (connect_to_shell): removed.
- (ical_importer_new, vcal_importer_new): don't call connect_to_shell.
-
-2003-03-20 Rodrigo Moya <rodrigo@ximian.com>
-
- * importers/ical-importer.c (get_uri_from_folder_path): removed.
- (load_file_fn, vcal_load_file_fn): use physical_uri instead of
- folderpath.
-
-2003-03-19 Ettore Perazzoli <ettore@ximian.com>
-
- * importers/GNOME_Evolution_Calendar_Importer.server.in.in:
- Replace "evolution:menu-name" prop with "evolution:menu_name".
- [#39692]
-
-2003-03-18 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/dialogs/send-comp.c (send_component_dialog): use GtkMessageDialog
- instead of gnome_question_dialog, and deal correctly with the dialog's
- response.
-
-2003-03-18 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #34505
-
- * gui/alarm-notify/alarm-queue.c (remove_queued_alarm): added removal
- of the alarm itself in the calendar if the (new) argument says so.
- Also, set expecting_update flag to TRUE.
- (add_component_alarms): initialize expecting_update to FALSE.
- (remove_alarms): don't remove the component if expecting_update is
- TRUE.
- (obj_updated_cb, notify_dialog_cb, procedure_notification): adapted
- to changes in remove_queued_alarm.
-
-2003-03-17 Hans Petter Jansson <hpj@ximian.com>
-
- Fixes #34095
-
- * gui/e-meeting-model.c (append_row): Don't leak meeting attendees;
- unref the attendee after it's assigned to model.
-
- * gui/dialogs/meeting-page.c (meeting_page_destroy): Free the actual
- array of deleted attendees.
-
- * gui/dialogs/event-editor.c (event_editor_destroy): Free the private
- structure.
-
- * gui/itip-utils.c (comp_description): Rework free/busy information
- composer so we can free date/time information after use. Then free it.
- (itip_send_comp): Free the allocated CORBA buffer for attachment data.
-
- * gui/dialogs/comp-editor-util.c (comp_editor_contacts_to_component):
- Free the destination contacts string once we're done with it.
-
- * gui/e-calendar-table.c (invisible_destroyed): Unref the invisible.
-
- * gui/e-day-view.c (invisible_destroyed): Ditto.
-
- * gui/e-week-view.c (invisible_destroyed): Ditto.
-
-2003-03-17 Hans Petter Jansson <hpj@ximian.com>
-
- Fixes #39757
-
- * gui/dialogs/alarm-page.c (sensitize_buttons): Somehow this code
- reverted to thinking it was dealing with a GtkCList, when in reality
- it's a GtkTreeView. Fix that, so the buttons are sensitized correctly.
-
-2003-03-17 Hans Petter Jansson <hpj@ximian.com>
-
- Fixes #39736
-
- * gui/e-day-view.c: Reduce the size of the large-digits font so it's
- en par with the one in 1.2.
-
-2003-03-14 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #39740
-
- * gui/e-meeting-model.c (is_cell_editable): check row number is valid
- before using it as index for the GPtrArray.
-
-2003-03-14 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #39356
-
- * gui/Makefile.am:
- * gui/tasks-migrate.[ch]: removed tasks migration obsolete stuff.
-
- * gui/calendar-component.c (owner_set_cb): don't call tasks_migrate.
-
-2003-03-14 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/cal-factory.c (impl_CalFactory_uriList): set_release
- on the sequence we create.
-
- * cal-client/cal-client.c (cal_client_uri_list): don't leak the
- string sequence returned by CalFactory_uriList.
-
-2003-03-13 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/query-backend.c (query_backend_new): use a weak ref instead
- of connecting to backend's "destroy" signal.
- (backend_destroyed_cb, query_destroyed_cb): changed to be weak
- reference callbacks.
-
-2003-03-12 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/dialogs/save-comp.c (save_component_dialog): don't use
- GNOME_STOCK_* defines, but GTK_STOCK_*.
-
-2003-03-12 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/dialogs/save-comp.[ch] (save_component_dialog): corrected
- button ordering and changed the return type to be a GtkResponseType.
-
- * gui/dialogs/comp-editor.c (prompt_to_save_changes): adapted to
- changes in save_component_dialog.
-
-2003-03-11 Dan Winship <danw@ximian.com>
-
- * gui/calendar-config.c (on_timezone_set): Update for timezone
- dialog API changes.
-
- * gui/e-timezone-entry.c: Likewise
-
-2003-03-11 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/gnome-cal.c (gnome_calendar_open): issue more descriptive
- warnings.
-
-2003-03-09 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/alarm-notify/alarm-notify.c (alarm_notify_add_calendar): if we
- already have the client loaded, don't remove it, just increment its
- reference count.
-
- * gui/alarm-notify/alarm-queue.c (remove_queued_alarm): added new
- argument to specify whether we want the component's structure removed
- if no more alarms exist, and only free the structure if TRUE.
- (remove_alarms): added same new argument and pass it over to
- remove_queued_alarm.
- (remove_comp, obj_updated_cb): passed new argument to remove_alarms.
- (procedure_notification): passed new argument to remove_queued_alarm.
- (obj_removed_cb): set all freed pointers to NULL.
- (notify_dialog_cb): only remove the alarm if the pointers are not NULL.
-
-2003-03-07 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/alarm-notify/save.c (get_calendars_to_load): create the array
- to be returned only once.
-
-2003-03-06 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/alarm-queue.c (display_notification): ref the CalClient.
- (notify_dialog_cb): unref the CalClient.
-
-2003-03-06 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/alarm-notify/alarm-notify-dialog.[ch]
- (alarm_notify_dialog_disable_buttons): new function.
- (alarm_notify_dialog): made it return a pointer to the dialog structure.
-
- * gui/alarm-notify/alarm-queue.c (remove_alarms, remove_comp): splitted
- alarm removal out of remove_comp.
- (obj_updated_cb): remove the component only when needed. In normal
- updates, just update the internal structure.
- (edit_component): don't get a CompQueuedAlarms as argument, since it
- might be removed.
- (on_dialog_obj_updated_cb, on_dialog_obj_removed_cb): callbacks for
- modifications during dialog display.
- (notify_dialog_cb): disconnect from "obj_*ed" signals and call
- edit_component with the new set of arguments.
- (display_notification): added more data to the closure structure.
-
-2003-03-05 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #31382
-
- * gui/e-meeting-model.c (async_read): don't assume the buffer is
- always full, but use GNOME_VFS_ERROR_EOF instead for knowing when
- the read has finished.
-
-2003-03-05 JP Rosevear <jpr@ximian.com>
-
- * gui/apps_evolution_calendar.schemas: fix defaults and
- descriptions to match what calendar-config wants them to be
-
-2003-03-05 JP Rosevear <jpr@ximian.com>
-
- * gui/e-itip-control.c (show_current): g_objectify ref/unref
-
- * gui/itip-bonobo-control.c (set_data_idle_cb): as above
- (pstream_load): ditto
-
- * gui/dialogs/alarm-options.c (alarm_to_malarm_widgets): as above
-
-2003-03-05 JP Rosevear <jpr@ximian.com>
-
- * gui/e-itip-control.c (class_init): override finalize, not
- destroy
- (start_calendar_server): take itip as a param and gtk_main_quit if
- it gets destroyed while we are waiting for the cal client to load
- (start_default_server): ditto
- (get_servers): take itip as a param and don't load if we've been
- destroyed, check for an except when retrieving the folder list
- (init): ref the html control
- (destroy): mark ourselves as destroyed
- (finalize): clean up, unref html control
- (write_html): if the html widget has been destroyed, don't write
- anything out
- (show_current_todo): pass extra param
- (show_current): ref/unref the itip control to avoid finalization while
- we are working, pass extra param
- (button_selected_cb): pass extra param
- (object_requested_cb): ditto
-
-2003-03-05 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/calendar-offline-handler.c (backend_go_offline,
- backend_go_online): cast CalClient's to GObject, not GtkObject.
-
-2003-03-04 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/meeting-page.c (meeting_page_fill_widgets): don't
- let the user change to an email organizer if the back end is not
- an email addres
-
-2003-03-04 JP Rosevear <jpr@ximian.com>
-
- Fixes #37881
-
- * gui/e-meeting-model.c (process_section): if the attendee is the
- empty string, try to get the email
-
-2003-03-04 JP Rosevear <jpr@ximian.com>
-
- * gui/calendar-offline-handler.c (backend_cal_opened_online): set
- the backend to REMOTE mode when it opens
- (backend_go_online): prepare to set calendar mode to REMOTE
- (impl_goOnline): get all the local calendars and set to REMOTE
-
-2003-03-04 JP Rosevear <jpr@ximian.com>
-
- Fixes #37881
-
- * gui/e-meeting-model.c (process_section): if the attendee is the
- empty string, try to get the email
-
-2003-03-04 JP Rosevear <jpr@ximian.com>
-
- Fixes #37883
-
- * idl/evolution-calendar.idl: getLdapAttribute can raise NotFound
-
-2003-03-04 JP Rosevear <jpr@ximian.com>
-
- Fixes #37806, #37697
-
- * gui/e-itip-control.c (e_itip_control_set_data): if the text is
- null or the empty string, just clear the widget
- (init): set the html widget to initially be blank
-
-2003-03-04 JP Rosevear <jpr@ximian.com>
-
- * pcs/cal.c (impl_Cal_get_ldap_attribute): implement
-
- * pcs/cal-backend.h: add virtual method
-
- * pcs/cal-backend.c (cal_backend_get_ldap_attribute): call
- get_ldap_attribute_method
-
- * pcs/cal-backend-file.c (cal_backend_file_class_init): overrid
- get_ldap_attribute method
-
- * idl/evolution-calendar.idl: add getLdapAttribute method
-
- * gui/e-meeting-model.c (process_section): take simple card list
- as arg and try to use the ldap attribute (if any) as the attendee,
- else use the email address
- (select_names_ok_cb): get the simple card list
-
- * cal-client/cal-client.h: add proto
-
- * cal-client/cal-client.c (cal_client_init): init ldap_attribute
- to NULL
- (cal_client_destroy): free ldap_attribute
- (cal_client_get_ldap_attribute): accessor
-
-2003-03-04 JP Rosevear <jpr@ximian.com>
-
- * gui/itip-utils.c (itip_organizer_is_user): call
- cal_client_get_cal_address instead of cal_client_get_email_address
-
- * gui/dialogs/meeting-page.c (meeting_page_construct): ditto
-
- * pcs/cal.c (impl_Cal_get_cal_address): implement updated method
- name
- (cal_class_init): set method implementation
-
- * pcs/cal-backend.c (cal_backend_class_init): init get_cal_address
- virtual function
- (cal_backend_get_cal_address): call proper function
-
- * pcs/cal-backend.h: update proto, rename get_email_address
- virtual function to get_cal_address virtual function
-
- * pcs/cal-backend-file.c (cal_backend_file_class_init): match
- get_cal_address call
- (cal_backend_file_get_cal_address): rename from
- cal_backend_file_get_email_address
-
- * cal-client/cal-client.c: rename email_address private member to
- cal_address
- (cal_client_init): init cal_address
- (cal_client_destroy): free cal_address and properly free
- alarm_email_address
- (cal_client_get_cal_address): rename from
- cal_client_get_email_address and call proper corba function
-
-2003-03-04 JP Rosevear <jpr@ximian.com>
-
- * idl/evolution-calendar.idl: fix comment
-
-2003-03-04 JP Rosevear <jpr@ximian.com>
-
- * gui/calendar-model.c (calendar_model_append_row): update FIXME
- note
-
-2003-03-04 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/recur-comp.h: fix copyright
-
- * gui/dialogs/recur-comp.c: fix copyright
- (recur_component_dialog): say "recurring journal entry" instead of
- just "recurring journal"
-
-2003-03-04 JP Rosevear <jpr@ximian.com>
-
- Partially Fixes #23606 (from Jack Jia <jack.jia@sun.com>)
-
- * gui/dialogs/schedule-page.c (update_time): handle no end date if
- the start is date only
-
- * gui/dialogs/event-page.c (update_time): ditto
-
-2003-03-04 JP Rosevear <jpr@ximian.com>
-
- Merging in 1.2 stuff
-
- Fixes #35598
-
- * gui/dialogs/task-details-page.c
- (task_details_page_fill_widgets): count a status of needs action
- as a status of none (not started)
- (date_changed_cb): set the option menu to a status of none
- (status_changed): no need to handle needs action status now
-
- * gui/dialogs/task-details-page.glade: remove needs-action menu
- item
-
- Fixes #36763
-
- * gui/dialogs/alarm-page.c (add_clicked_cb): if no address was set
- for an email alarm, set the default
- (button_options_clicked_cb): pass the default email address
-
- * gui/dialogs/alarm-options.h (alarm_options_dialog_run): update proto
-
- * gui/dialogs/alarm-options.c (alarm_to_malarm_widgets): if there
- are no email attendees, default to the passed in value
- (alarm_options_dialog_run): take and track an email param
-
- * pcs/cal.c (impl_Cal_get_alarm_email_address): implement by
- calling backend method
- (cal_class_init): set alarm email address method implementation
-
- * pcs/cal-backend.h: add new virtual proto
-
- * pcs/cal-backend.c (cal_backend_class_init): set alarm email
- address virtual method to NULL
- (cal_backend_get_alarm_email_address): call backend method
-
- * pcs/cal-backend-file.c (cal_backend_file_class_init): set alarm
- email address method
- (cal_backend_file_get_alarm_email_address): implement by returning
- NULL
-
- * idl/evolution-calendar.idl: add getAlarmEmailAddress method
-
- Fixes #37102
-
- * gui/dialogs/task-editor.c (set_menu_sens): don't allow task
- assignment if the backend says not to
-
- * gui/dialogs/recurrence-page.c (fill_component): kill warning
- (preview_recur): display the recurrences in the dtstart timezone
- if possible
-
- * gui/gnome-cal.c (dn_query_obj_updated_cb): pass NULL to use
- default tag zone
-
- * gui/tag-calendar.c (tag_calendar_by_comp): allow display zone
- for the tagged calendar to be passed in
- (prepare_tag): use the passed in timezone for display if non-null
-
- * gui/tag-calendar.h (tag_calendar_by_comp): update proto
-
- * gui/dialogs/recurrence-page.c (recurrence_page_set_dates): make
- sure we always update the preview
-
- * conduits/todo/todo-conduit.c (add_record): make sure to create a
- unique uid for the record
-
- * conduits/calendar/calendar-conduit.c (add_record): ditto
-
- * conduits/todo/todo-conduit.c (e_todo_context_new): init default
- comp and timezone to NULL
- (e_todo_context_destroy): unref default comp
- (pre_sync): et the default comp via the client and set the default
- timezone
- (add_record): pass the default comp as the base comp
-
- * conduits/calendar/calendar-conduit.c (e_calendar_context_new):
- init default comp to NULL
- (e_calendar_context_destroy): unref default comp
- (pre_sync): get the default comp via the client
- (add_record): pass the default comp as the base comp
-
- * conduits/calendar/calendar-conduit.c (local_record_from_comp):
- only add the recurrence rule if its not an instance
-
- * gui/itip-control-factory.c (set_data_idle_cb): idle call back to
- set control data
- (pstream_load): set the data in an idle callback to avoid deadlock
- (get_prop): handle view_only
- (set_prop): ditto
- (itip_control_factory): add view_only
-
- * gui/e-itip-control.h: add protos
-
- * gui/e-itip-control.c (write_html): only write out the options if
- we aren't in view_only mode
- (e_itip_control_set_view_only): accessor
- (e_itip_control_get_view_only): ditto
-
- Fixes #36909
-
- * gui/dialogs/alarm-page.c (button_options_clicked_cb): indicate
- whether the options dialog should allow repeating
-
- * gui/dialogs/alarm-options.h: update proto
-
- * gui/dialogs/alarm-options.c (alarm_to_repeat_widgets): if
- repeating is not allowed, sensitize the widgets appropriately
- (alarm_options_dialog_run): store the repeat param
-
- * gui/calendar-model.c (calendar_model_append_row): guard against
- saving before the calendar is open
-
- * gui/e-day-view.c (e_day_view_key_press): ditto
-
- * gui/dialogs/comp-editor.c (page_changed_cb): change warning
- dialog to not mention email
- (page_summary_changed_cb): ditto
- (page_dates_changed_cb): ditto
-
- * gui/itip-utils.c (itip_organizer_is_user): make the compare case
- insensitive
-
- * gui/dialogs/meeting-page.c (meeting_page_fill_widgets): don't
- allow the organizer to be changed if its not an email address
-
- * gui/e-day-view.c, calendar-model.c, e-week-view.c,
- task-editor.c, event-editor.c, comp-editor.c, meeting-page.c: pass
- additional param
-
- * gui/itip-utils.c (itip_organizer_is_user): take client as param,
- and if organizer-not-email-address and email address and organizer
- match, assume the user is the organizer
-
- * gui/itip-utils.h: update proto
-
- * pcs/cal.c (build_fb_seq): set the max
-
- * gui/e-meeting-model.c
- (e_meeting_model_add_attendee_with_defaults): correct typo and set
- rsvp appropriately
-
- * gui/dialogs/send-comp.c (send_component_dialog): if save
- schedules, return FALSE for now
-
- * gui/dialogs/recurrence-page.c (sensitize_recur_widgets):
- de-sensitize the preview widget if we are viewing an instance
- (preview_recur): return if the comp is an instance
-
- * gui/dialogs/event-page.glade: name the show time frame
-
- * gui/dialogs/event-page.c (event_page_fill_widgets)
- (event_page_init): init show time frame
- (event_page_fill_widgets): hide/show frame as needed
- (get_widgets): get the frame
-
- * gui/alarm-notify/alarm-queue.c (mail_notification): kill mail
- notification code
-
- * cal-client/cal-client.c (load_static_capabilities): grab static
- capabilities string
- (check_capability): see if a capability is in the string
- (cal_client_get_one_alarm_only): accessor
- (cal_client_get_organizer_must_attend): use check_capability
- (cal_client_get_static_capability): ditto
-
- * cal-client/cal-client.h: new, changed protos
-
- * idl/evolution-calendar.idl: change over getSchedulingInformation
- to a more general getStaticCapabilities call
-
- * pcs/cal-backend-file.c
- (cal_backend_file_get_static_capabilities): return
- "no-email-alarms"
-
- * pcs/cal-backend.c (cal_backend_get_static_capabilities): ditto
-
- * pcs/cal-backend.h: ditto
-
- * pcs/cal.c (impl_Cal_get_static_capabilities): ditto
-
- * gui/alarm-notify/alarm-queue.c (get_default_address): utility
- routine to snag address info
-
- * gui/alarm-notify/Makefile.am: build composer idl
-
- * *.c: pass client param for send an cancel params
-
- * gui/dialogs/send-comp.c (send_component_dialog): take client as
- a parm and if save schedules return true right away
-
- * gui/dialogs/send-comp.h: update proto
-
- * gui/dialogs/cancel-comp.c (cancel_component_dialog): take client
- as a param and if we are deleting and schedule saves, return true
- right away
-
- * gui/dialogs/cancel-comp.h (cancel_component_dialog): update proto
-
- * gui/dialogs/alarm-options.glade: add Send To: button
-
- * gui/dialogs/alarm-options.c (addressbook_clicked_cb): display
- dialog
- (setup_select_names): attach above to Send To: button clicked
- signal
-
- * gui/dialogs/alarm-options.c (get_widgets): get mail alarm
- widgets
- (setup_select_names): add the select names widget
- (alarm_to_malarm_widgets): show the attendees and description
- (alarm_to_dialog): set the title for mail alarms properly
- (malarm_widgets_to_alarm): save attendees and descriptions in
- alarm
- (alarm_options_dialog_run): call setup_select_names
-
- * gui/dialogs/alarm-page.c: add email to alarm types
-
- * gui/dialogs/alarm-options.glade: add mail alarm widgets
-
- * gui/dialogs/alarm-page.glade: add email to alarm types
-
- * cal-util/cal-component.c (scan_attendee): kill unnecessary
- CalComponent param
- (scan_property): don't pass same
- (set_attendee_list): take an icalcomp instead of a CalComponent
- (cal_component_set_attendee_list): pass same
- (scan_alarm_property): if its an attendee, scan it
- (make_alarm): set attendee_list member to null
- (cal_component_alarm_new): ditto
- (cal_component_alarm_free): free attendee list
- (cal_component_alarm_get_attendee_list): return attendee list
- (cal_component_alarm_set_attendee_list): set attendee list
- (cal_component_alarm_has_attendees): return true if alarm has attendees
-
- * cal-util/cal-component.h: new protos
-
- * gui/calendar-model.c (calendar_model_append_row): use
- cal_comp_task_new_with_defaults
-
- * gui/comp-editor-factory.c (get_default_task): ditto
-
- * gui/e-tasks.c (e_tasks_new_task): ditto
-
- * gui/gnome-cal.c (gnome_calendar_new_task): ditto
-
- * gui/comp-util.h (cal_comp_task_new_with_defaults): new proto
-
- * gui/comp-util.c (cal_comp_task_new_with_defaults): new utility
- routine
-
- * cal-util/cal-util.c (generate_absolute_triggers): skip omitted
- alarm types
- (add_alarm_occurrences_cb): ditto
- (cal_util_generate_alarms_for_list): take/pass omit param
- (cal_util_generate_alarms_for_comp): ditto
-
- * cal-util/cal-util.h: update protos
-
- * pcs/cal-backend-file.c (cal_backend_file_get_alarms_for_object):
- add omit param
- (cal_backend_file_get_alarms_in_range): ditto
-
- * pcs/cal-backend.c (cal_backend_get_scheduling_information):
- remove dead param
-
- * gui/dialogs/meeting-page.h: delete proto
-
- * gui/dialogs/meeting-page.c: remove dead routine
-
- * gui/dialogs/event-editor.c (event_editor_edit_comp): we don't
- need to add the organizer as an attendee ourselves, just set the
- edit level properly
-
- * gui/dialogs/task-editor.c (task_editor_edit_comp): ditto
-
- * gui/comp-util.c (cal_comp_event_new_with_defaults): take client
- as arg so we can obtain the default from the backend
-
- * gui/comp-editor-factory.c (get_default_event): pass
- cal_comp_event_new_with_defaults the new param
-
- * gui/gnome-cal.c (gnome_calendar_new_appointment_for): ditto
-
- * gui/e-week-view.c (e_week_view_key_press): ditto
-
- * gui/e-day-view.c (e_day_view_key_press): ditto
-
- * gui/calendar-model.c (calendar_model_append_row): ditto
-
- * gui/comp-util.h (cal_comp_event_new_with_defaults): update proto
-
- * pcs/cal-backend-file.c (cal_backend_file_get_default_object):
- return appropriate default object
-
- * pcs/cal-backend.c (cal_backend_get_default_object): call
- get_default_backend class method
-
- * pcs/cal-backend.h: add proto
-
- * pcs/cal.c (impl_Cal_get_default_object): implement
- (cal_class_init): set handler for getDefaultObject call
-
- * idl/evolution-calendar.idl: remove always schedule from
- SchedulingInformation and add getDefaultObject call
-
- * cal-client/cal-client.c (cal_client_get_default_object): gets a
- default object from the server
- (cal_client_init): remove always_schedule
- (load_scheduling_info): ditto
-
- * cal-client/cal-client.h: add a proto, delete a proto
-
- * gui/dialogs/meeting-page.c (right_click_cb): if the attendee is
- not fully editable, don't allow deletion
- (meeting_page_construct): keep the default organizer as an itip
- address
- (meeting_page_get_default_organizer): return the default organizer
-
- * gui/dialogs/meeting-page.h: new proto
-
- * gui/dialogs/event-editor.c (event_editor_edit_comp): we set
- appropriate edit levels now for users and if the backend always
- schedules we always show the meeting pages and add the organizer
- as an attendee
-
- * gui/dialogs/task-editor.c (task_editor_edit_comp): same
-
- * gui/e-meeting-model.c (is_cell_editable): use the edit level of
- the attendee to determine if cell is editable
- (init): we no longer keep the attendee list of restricted
-
- * gui/e-meeting-attendee.c (e_meeting_attendee_get_edit_level): accessor
- (e_meeting_attendee_set_edit_level): ditto
-
- * gui/e-meeting-attendee.h: new protos and edit level enum
-
- * cal-client/cal-client.c (load_scheduling_info): load the
- scheduling info
- (cal_client_get_always_schedule): accessor
- (cal_client_get_organizer_must_attend): ditto
- (cal_client_get_save_schedules): ditto
- (cal_client_init): init scheduling data members
-
- * cal-client/cal-client.h: accessors for scheduling information
-
- * pcs/cal-backend-file.c
- (cal_backend_file_get_scheduling_information): implement the new
- virtual method
-
- * pcs/cal-backend.c (cal_backend_get_scheduling_information): call
- the class specific method
-
- * pcs/cal-backend.h: add virtual method
-
- * idl/evolution-calendar.idl: add a getSchedulingInformation call
- which describes how the backend does its scheduling
-
- * pcs/cal.c (impl_Cal_get_scheduling_information): implement above
-
- * gui/e-day-view.c: pass NULL as parent to recur dialog
-
- * gui/e-week-view.c: ditto
-
- * gui/dialogs/comp-editor.c (prompt_to_save_changes): show recur
- dialog after prompting, not before
- (save_cmd): ditto
- (save_close_cmd): ditto
- (real_edit_comp): don't show recur dialog before opening
-
- * gui/dialogs/recur-comp.h (recur_component_dialog): update proto
-
- * gui/dialogs/recur-comp.c (recur_component_dialog): take a parent
- argument and set the dialog parent if non-null
-
- * gui/e-week-view.c (e_day_view_on_editing_stopped): Don't update
- appointment if both the old and the new summary texts are empty.
-
- * gui/e-week-view.c (e_week_view_show_popup_menu): mask out "make
- moveable" if its an instance
-
- * gui/e-day-view.c (e_day_view_on_event_right_click): ditto
-
- * gui/e-week-view.c (e_week_view_on_editing_stopped): if its
- an instance, show the recur comp dialog and modify it based on the
- response (or not if cancel is hit)
-
- * gui/e-day-view.c (e_day_view_finish_long_event_resize): if its
- an instance, show the recur comp dialog and modify it based on the
- response (or not if cancel is hit)
- (e_day_view_finish_resize): ditto
- (e_day_view_on_editing_stopped): ditto
- (e_day_view_on_top_canvas_drag_data_received): ditto
- (e_day_view_on_main_canvas_drag_data_received): ditto
-
- * gui/dialogs/comp-editor.c (real_edit_comp): reflect changes in
- proto of recur_component_dialog
-
- * gui/dialogs/recur-comp.c (recur_component_dialog): use ok/cancel
- instead and radio buttons for the mod type
-
- * gui/dialogs/recur-comp.h: update proto
-
- * gui/e-day-view.c (e_day_view_on_long_event_click): allow
- dragging if its an instance
- (e_day_view_on_event_click): ditto
- (e_day_view_on_top_canvas_motion): ditto
- (e_day_view_on_main_canvas_motion): ditto
-
- * gui/dialogs/comp-editor.c (save_comp): if its an instance,
- update with the mod type
- (real_edit_comp): ask the user what instances they want to change
-
- * gui/dialogs/recur-comp.[hc]: new dialog to ask user what
- recurrences to modify
-
- * gui/dialogs/Makefile.am: Compile new files
-
- * gui/e-day-view.c (e_day_view_on_delete_occurrence): if its an
- instance, just remove with THIS mod
-
- * gui/e-week-view.c (e_week_view_on_delete_occurrence): ditto
-
- * cal-client/cal-client.c (cal_client_remove_object_with_mod):
- send the mod parameter to the backend
- (cal_client_remove_object): implement with above
- (cal_client_update_object_with_mod): send the mod parameter to the
- backend
- (cal_client_update_object): implement with above
-
- * cal-client/cal-client.h: new protos
-
- * cal-client/cal-client.c (cal_client_is_read_only): return
- booleans in the pre conditions
- (cal_client_update_object): pass mod param
- (cal_client_update_objects): ditto
- (cal_client_remove_object): ditto
- (cal_client_ensure_timezone_on_server): ditto
-
- * pcs/cal.c (impl_Cal_update_objects): take mod param
- (impl_Cal_remove_object): ditto
-
- * pcs/cal-backend.h: fix protos
-
- * pcs/cal-backend.c (cal_backend_update_objects): take mod param
- (cal_backend_remove_object): ditto
-
- * pcs/cal-backend-file.c (cal_backend_file_update_objects): take
- mod param
- (cal_backend_file_remove_object): ditto
-
- * cal-util/cal-util.h: add mod enum
-
- * cal-util/cal-recur.c (cal_recur_generate_instances_of_rule): if
- its an instance, just report the instance
-
- * cal-util/cal-component.h: new protos
-
- * cal-util/cal-component.c (cal_component_is_instance): indicate
- whether the component is an instance or not
- (cal_component_free_range): free a range
-
- * idl/evolution-calendar.idl: get remove and update to take mod
- type
-
-2003-03-03 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/dialogs/alarm-page.c
- * gui/dialogs/event-page.c
- * gui/dialogs/meeting-page.c
- * gui/dialogs/recurrence-page.c
- * gui/dialogs/schedule-page.c
- * gui/dialogs/task-details-page.c
- * gui/dialogs/task-page.c (get_widgets): gtk_widget_unparent() ->
- gtk_container_remove(). The former caused crashes in the
- addressbook's name-selector.
-
-2003-03-01 Hans Petter Jansson <hpj@ximian.com>
-
- * Makefile.am: Do importers after the other dirs, as it relies on
- generated files from there. This is still not optimal... Should
- probably introduce dependencies.
-
-2003-02-28 Hans Petter Jansson <hpj@ximian.com>
-
- * importers/Makefile.am: Shlibify.
-
- * importers/GNOME_Evolution_Calendar_Importer.server.in.in:
- Shlibify.
-
- * importers/icalendar-importer.c: Add necessary includes.
- (importer_destroy_cb): This is now a GWeakNotify func. gtk_ -> g_.
- (ical_importer_new)
- (vcal_importer_new)
- (gnome_calendar_importer_destroy_cb): Destroy signal -> weak ref.
-
- * importers/main.c: Add necessary includes. Shlibify.
-
-2003-02-28 Dan Winship <danw@ximian.com>
-
- * gui/dialogs/Makefile.am: build libcal-dialogs as an uninstalled
- shared library
- ($(IDL_GENERATED_H), etc): Only generate
- Evolution-Addressbook-SelectNames.h, not the corresponding .c
- files, or we'll get duplicate symbol errors trying to link this
- into libevolution_calendar.la
-
- * gui/Makefile.am (libevolution_calendar_la_LIBADD): Update for
- that (and eliminate libtool portability warnings)
-
-2003-02-28 Hans Petter Jansson <hpj@ximian.com>
-
- * Makefile.am (SUBDIRS): Add importers/.
-
- * importers/Makefile.am (server_in_files)
- (server_DATA): Insert $(libexecdir).
-
- * importers/icalendar-importer.c (connect_to_shell):
- oaf_activate_from_id() -> bonobo_activation_activate_from_id().
- (load_vcalendar_file): U_() -> _().
-
- * importers/GNOME_Evolution_Calendar_Importer.server.in:
- Renamed to corresponding .in.in.
-
-2003-02-28 Dan Winship <danw@ximian.com>
-
- * gui/Makefile.am (libevolution_calendar_la_LIBADD): Remove
- libalarm.a, which was not being used by the calendar.
-
- * gui/main.c: Remove unneeded alarm.h include.
-
- * gui/alarm-notify/Makefile.am (noinst_LIBRARIES): Stop building
- libalarm.a
- (evolution_alarm_notify_SOURCES): Add alarm.c, alarm.h
- (evolution_alarm_notify_LDADD): Remove libalarm.a
-
-2003-02-27 JP Rosevear <jpr@ximian.com>
-
- * conduits/todo/Makefile.am: link to versist libtool object
-
- * conduits/calendar/Makefile.am: ditto
-
-2003-02-26 Hans Petter Jansson <hpj@ximian.com>
-
- This makes alarm notification work.
-
- * gui/alarm-notify/notify-main.c (main): Initialize GTK. Don't
- initialize bonobo activation - bonobo_init() does that for us.
-
-2003-02-26 Hans Petter Jansson <hpj@ximian.com>
-
- This makes creating appointments and tasks from the "New" button work.
-
- * gui/main.c (comp_editor_factory_fn): Doesn't need to take any args.
- (factory): Add a handler for CompEditorFactory.
-
-2003-02-26 Hans Petter Jansson <hpj@ximian.com>
-
- Fixes Ximian #37895.
-
- * gui/e-day-view.c (e_day_view_destroy): g_object_unref () ->
- pango_font_description_free ().
- (e_day_view_style_set): Ditto.
-
- * gui/e-week-view.c (e_week_view_destroy): Ditto.
-
-2003-02-26 Hans Petter Jansson <hpj@ximian.com>
-
- Fixes Ximian #38306.
-
- * gui/e-itip-control.c (clean_up): Do nothing if the private structure
- has been freed. Don't call non-g_free() freers with NULL pointers.
- (destroy): Do nothing if the private structure has been freed. Clear
- pointers to freed blocks.
-
-2003-02-25 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/print.c (print_calendar): Use fixed margins of 5% of page
- width/height. This is the same cheat as gtkhtml employs to get
- around the fact that GNOME_PRINT_KEY_PAGE_MARGIN_* don't return
- useful values (I think). It sort of sucks, but is better than
- no margins at all.
- (print_comp): Ditto.
-
-2003-02-25 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/calendar-config.c (calendar_config_get_default_view): Get
- default view from correct key.
-
-2003-02-25 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/dialogs/cal-prefs-dialog.c (get_widgets): Show start/end-of-day
- widgets.
-
-2003-02-23 Hans Petter Jansson <hpj@ximian.com>
-
- * cal-client/cal-client.c (cal_client_is_read_only): Don't warn
- if calendar isn't loaded... Doesn't seem to hurt, but this should
- probably be investigated further.
-
- * gui/dialogs/comp-editor-util.c (comp_editor_contacts_to_widget):
- If we have no contacts, don't bother trying to set them in the
- widget. Used to pass a NULL list, which would lead to much anxiety
- in callees.
-
- * gui/dialogs/meeting-page.c (meeting_page_fill_widgets):
- If we have no potential organizers, emit a sensible warning.
-
- * gui/dialogs/task-page.c (init_widgets): Don't try to connect to
- the "changed" signal of the GtkTextView -- we listen to the
- GtkTextBuffer now.
-
-2003-02-20 Not Zed <NotZed@Ximian.com>
-
- * gui/e-itip-control.c (destroy): dont unref accounts anymore.
- (change_status): itipAddress -> EAccount.
-
- * gui/calendar-model.c (calendar_model_destroy): dont unref
- accounts anymore.
- (calendar_model_value_at): simplify logic using account_list_find.
-
- * gui/dialogs/task-editor.c (task_editor_edit_comp): use new
- itip_addresses interfaces.
-
- * gui/dialogs/meeting-page.c (meeting_page_construct): use new
- itip_addresses_* interfaces. Should probably be using e_account
- directly.
- (meeting_page_finalize): dont unref the accounts list.
-
- * gui/dialogs/event-editor.c (event_editor_edit_comp): dont unref
- accounts anymore.
-
- * gui/itip-utils.c (itip_addresses_get_default): Just use
- e_account_list_get_default.
- (itip_addresses_get): dont ref the account object, just keep 1 ref
- to it.
- (find_account): remove.
- (itip_organizer_is_user): use e_account_list_find now.
- (itip_sentby_is_user): "
- (comp_limit_attendees): "
-
-2003-02-19 Not Zed <NotZed@Ximian.com>
-
- * gui/dialogs/meeting-page.c: addresses->accounts
- (meeting_page_finalize): unref accounts.
-
- * gui/dialogs/event-editor.c: Use EAccountList api's
-
- * pcs/cal-backend-util.c (cal_backend_mail_account_get): Removed,
- use a global EAccountList instead.
- (cal_backend_mail_account_get_default): Use the global
- EAccountList directly.
- (cal_backend_mail_account_is_valid): And here too.
-
- * gui/itip-utils.h: Removed ItipAddress structure.
-
- * gui/itip-utils.c (itip_addresses_get): Change it to return a
- global account object, so we dont need to duplicate all account
- info in the calendar.
- (itip_addresses_free, itip_address_free): Removed, use
- g_object_unref.
- (itip_addresses_get_default): Return an EAccount.
- (find_account): helper to lookup accounts based on name/address.
- (itip_organizer_is_user): Use helper to find account.
- (itip_sentby_is_user): "
- (comp_limit_attendees): "
- (comp_sentby): Update to use an EAccount direclty.
- (get_address): Removed, now redundant.
-
- * gui/e-itip-control.c: Changed priv->addresses to be accounts
- EAccountList.
- (destroy): unref accounts.
- (find_my_address): Change to use accounts list directly, also fix
- a small potential memleak.
-
- * gui/calendar-model.c: Change priv->addresses to be a direct
- reference to an EAccountList, renamed priv->accounts.
- (calendar_model_destroy): unref accounts.
- (calendar_model_value_at): Use EAccountList directly to lookup
- members.
-
- * gui/calendar-config.c (calendar_config_get_timezone)
- (calendar_config_set_timezone): Fix timezone key.
- (calendar_config_get_24_hour_format): Same for 24 hour format key.
- (calendar_config_set_24_hour_format): And here.
- (calendar_config_get_week_start_day): "
- (calendar_config_set_week_start_day): "
- (calendar_config_get_day_start_hour): "
- (calendar_config_set_day_start_hour): "
- (calendar_config_get_day_start_minute): "
- (calendar_config_set_day_start_minute): "
- (calendar_config_get_day_end_hour): "
- (calendar_config_set_day_end_hour): "
- (calendar_config_get_day_end_minute)
- (calendar_config_set_day_end_minute)
- (calendar_config_get_time_divisions)
- (calendar_config_set_time_divisions)
- (calendar_config_get_dnav_show_week_no)
- (calendar_config_set_dnav_show_week_no)
- (calendar_config_get_default_view)
- (calendar_config_set_default_view)
- (calendar_config_get_hpane_pos, calendar_config_set_hpane_pos)
- (calendar_config_get_vpane_pos, calendar_config_set_vpane_pos)
- (calendar_config_get_month_hpane_pos)
- (calendar_config_set_month_hpane_pos)
- (calendar_config_get_month_vpane_pos)
- (calendar_config_set_month_vpane_pos)
- (calendar_config_get_compress_weekend)
- (calendar_config_set_compress_weekend)
- (calendar_config_get_show_event_end)
- (calendar_config_set_show_event_end)
- (calendar_config_get_working_days)
- (calendar_config_set_working_days)
- (calendar_config_get_hide_completed_tasks)
- (calendar_config_set_hide_completed_tasks)
- (calendar_config_get_hide_completed_tasks_units)
- (calendar_config_set_hide_completed_tasks_units)
- (calendar_config_get_hide_completed_tasks_value)
- (calendar_config_set_hide_completed_tasks_value)
- (calendar_config_get_confirm_delete)
- (calendar_config_set_confirm_delete)
- (calendar_config_get_confirm_expunge)
- (calendar_config_set_confirm_expunge)
- (calendar_config_get_tasks_due_today_color)
- (calendar_config_set_tasks_due_today_color)
- (calendar_config_get_tasks_overdue_color)
- (calendar_config_set_tasks_overdue_color)
- (calendar_config_get_use_default_reminder)
- (calendar_config_set_use_default_reminder)
- (calendar_config_get_default_reminder_interval)
- (calendar_config_set_default_reminder_interval)
- (calendar_config_get_default_reminder_units)
- (calendar_config_set_default_reminder_units)
- (calendar_config_default_calendar_folder)
- (calendar_config_default_tasks_folder): Update config paths for
- new config convention, etc.
-
- * gui/alarm-notify/save.c (KEY_LAST_NOTIFICATION_TIME, etc):
- Updated keys to lowercase/proper path.
- (save_calendars_to_load): Store the calendars list as a gconf
- list.
- (get_calendars_to_load): Load the calendars list as a gconf list.
- (save_blessed_program): Similar, for the blessed program list.
- (is_blessed_program): Same here.
-
- * gui/alarm-notify/config-data.c (config_data_get_timezone): Update
- the path to the timezone key.
- (config_data_get_24_hour_format): Fix path to config option.
-
- * conduits/todo/todo-conduit.c (get_default_timezone): lower-case
- the timezone key.
-
- * conduits/calendar/calendar-conduit.c (get_default_timezone):
- lower-case the timezone key.
-
- * cal-client/cal-client.c (get_default_uri): Use the proper path
- to get the default folder uri's.
-
-2003-02-23 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/gnome-cal.c (backend_died_cb): Appease the compiler.
- (gnome_calendar_update_paned_quanta): Don't actually try to set
- the quantum properties. The quantum code should probably go away
- entirely now that the panes update during resize, but let's keep
- it around for a bit more.
-
- * gui/dialogs/event-editor.c (event_editor_construct): Ref & sink
- the pages.
-
- * gui/dialogs/task-editor.c (task_editor_construct): Ref & sink
- the pages.
-
-2003-02-23 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/cal-search-bar.c (make_suboptions): Eliminate
- e_utf8_to_gtk_string ().
-
- * gui/e-timezone-entry.c (e_timezone_entry_get_display_name):
- Ditto.
-
- * gui/calendar-model.c (date_value_to_string):
- e_utf8_from_locale_string () -> g_locale_to_utf8 ().
- (calendar_model_value_to_string): Ditto.
-
- * gui/e-cell-date-edit-text.c (ecd_get_text): Ditto.
-
- * gui/e-itip-control.c (write_label_piece): Ditto.
-
- * gui/print.c (format_date): Ditto.
- (print_week_view_background): Ditto.
- (print_month_summary): Ditto.
- (print_date_label): Ditto.
- (print_comp_item): Ditto.
-
- * gui/alarm-notify/alarm-notify-dialog.c (write_html_heading):
- Ditto.
-
-2003-02-22 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/dialogs/task-details-page.c (get_widgets): Show the custom
- widgets, since libglade appears to not want to do that.
-
- * gui/dialogs/task-page.c (clear_widgets): Make the description
- field use a GtkTextView.
- (task_page_fill_widgets): Ditto.
- (task_page_fill_component): Ditto.
- (init_widgets): Ditto.
- (get_widgets): Show the custom widgets, since libglade doesn't do it.
-
-2003-02-22 Hans Petter Jansson <hpj@ximian.com>
-
- * pcs/cal-backend.c (cal_backend_unref_categories): Add an
- iteration statement. Fixes hang in wombat.
-
-2003-02-22 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/apps_evolution_calendar.schemas: Commit fixes from
- Grzegorz Goawski <grzegol@pld.org.pl>.
-
-2003-02-21 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/calendar-model.c (calendar_model_class_init): GObject, not
- GtkObject.
- (calendar_model_destroy): -> calendar_model_finalize ().
-
- * gui/calendar-view.c (calendar_view_class_init): GObject, not
- GtkObject.
- (calendar_view_destroy): -> calendar_view_finalize ().
-
- * gui/comp-editor-factory.c (comp_editor_factory_class_init):
- GObject, not GtkObject.
- (comp_editor_factory_destroy): -> comp_editor_factory_finalize ().
-
- * gui/e-day-view.c (e_day_view_long_event_button_press):
- gtk_signal_disconnect () -> g_signal_handler_disconnect ().
- (e_day_view_on_event_button_press): Ditto.
- (e_day_view_on_long_event_click): Ditto.
- (e_day_view_on_event_click): Ditto.
- (e_day_view_on_event_double_click): Ditto.
- (e_day_view_on_delete_appointment): Ditto.
-
- * gui/e-week-view.c (e_week_view_on_text_item_event):
- gtk_signal_disconnect () -> g_signal_handler_disconnect ().
-
- * gui/alarm-notify/alarm-notify.c (AlarmNotify_RemoveCalendar):
- Don't cast to GtkObject.
-
-2003-02-21 Dan Winship <danw@ximian.com>
-
- * cal-client/Makefile.am (libcal_client_la_LIBADD): depend on
- libcal-util, libwombat, and libeutil
- (client_test_LDADD): Remove those deps from here
-
- * cal-util/Makefile.am (libcal_util_la_LIBADD): depend on
- libical-evolution.la
- (test_recur_LDADD): Remove that dependency here (and an ancient
- libversit dependency).
-
- * gui/alarm-notify/Makefile.am (evolution_alarm_notify_LDADD):
- remove some deps
-
- * gui/Makefile.am (libevolution_calendar_la_LIBADD): Likewise.
-
-2003-02-20 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/apps_evolution_calendar.schemas: Add GConf schemas.
-
- * gui/Makefile.am (EXTRA_DIST): Dist GConf schemas.
- (install-data-local): Install GConf schemas.
-
-2003-02-20 Dan Winship <danw@ximian.com>
-
- * gui/Makefile.am (libevolution_calendar_la_LIBADD):
- s/libemiscwidgets.a/libemiscwidgets.la/ and likewise for
- libetimezonedialog
-
-2003-02-19 Ettore Perazzoli <ettore@ximian.com>
-
- * pcs/Makefile.am: Split $(CORBA_GENERATED_H) rule from the
- $(CORBA_GENERATED_C) rule to that it autogens properly when using
- parallel makes.
- * cal-client/Makefile.am: Likewise.
-
- * gui/gnome-cal.c (gnome_calendar_setup_view_menus): Fix path to
- the calendar's GAL Views directory. [Pointed out by Grzegorz
- Goawski.]
-
-2003-02-11 Hans Petter Jansson <hpj@ximian.com>
-
- Enable printing for calendar and tasks.
-
- * gui/print.c: Set default font to be "Sans". Store the PrintConfig
- globally instead of PaperInfo (which doesn't exist anymore).
- (get_font_for_size): Don't use
- gnome_font_face_find_closest_from_weight_slant() anymore, since
- it's broken. Instead, use gnome_font_face_find() and put bold- and
- italicness in the name to look for. Descenders can now be negative,
- so have to take the absolute value to get font height.
- (print_comp): Use global, persistent print configuration.
- GnomePrintDialog is now a GtkDialog. Remove manual configuration
- parameter shuffling. Set up page using new methods.
- (print_calendar): Like print_comp(). For month view, force landscape
- mode by temporarily setting it in the config, and remove the old hack.
- (print_setup): Port. I'm not sure this works, but at least it
- compiles now. How do I test this code path?
- (print_day_view): Pass NULL for page denominator.
- (print_week_view): Ditto.
- (print_month_view): Ditto.
- (print_year_view): Ditto.
- (print_comp_item): Add missing gnome_print_beginpage(). How did this
- work before?
-
- * gui/tasks-control.c: Store the PrintConfig globally instead of
- passing individual parameters every time. Persistent too.
- (print_title): Look for "Sans Bold" instead of "Times" with
- GNOME_FONT_BOLD property. Don't use find_closest_from_weight_slant().
- (print_tasks): Set up page using new methods. GnomePrintMaster ->
- GnomePrintJob. Get params from global config instead of args.
- (tasks_control_print_cmd): Use global, persistent print configuration.
- Remove manual portrait/landscape hack. GnomePrintDialog is now a
- GtkDialog. Set params in global config instead of passing them to
- print_tasks().
- (tasks_control_print_preview_cmd): print_tasks() now takes fewer
- args.
-
-2003-02-11 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/e-meeting-time-sel.c (e_meeting_time_selector_construct):
- Don't use gtk_scrolled_window_set_scrollbar_spacing() anymore.
-
-2003-02-10 Hans Petter Jansson <hpj@ximian.com>
-
- * pcs/cal-backend-file.c (save): Don't try to make an error string
- from an uninitialized GnomeVFSResult.
-
-2003-02-10 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/Makefile.am: Make the CORBA IDL compilation work with
- parallel makes.
- * gui/dialogs/Makefile.am: Likewise.
- * gui/alarm-notify/Makefile.am: Likewise.
-
-2003-02-07 Rodney Dawes <dobey@ximian.com>
-
- * gui/alarm-notify/GNOME_Evolution_Calendar_AlarmNotify.server.in:
- remove this file, as it's generated now
- * gui/alarm-notify/GNOME_Evolution_Calendar_AlarmNotify.server.in.in:
- Add this file to generate the .server.in from, with hardcoded path
- * gui/alarm-notify/Makefile.am: Hardcode path in server file
-
-2003-02-07 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #37706
-
- * gui/comp-editor-factory.c (cal_opened_cb): added PERMISSION_DENIED
- case for not ending process on g_assert_not_reached.
-
-2003-02-06 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/e-day-view-time-item.c
- (e_day_view_time_item_show_popup_menu): Use
- e_auto_kill_popup_menu_on_selection_done() instead of
- e_auto_kill_popup_menu_on_hide().
- * gui/dialogs/meeting-page.c (right_click_cb): Likewise.
-
-2003-02-06 Dan Winship <danw@ximian.com>
-
- * gui/dialogs/event-page.c (make_timezone_entry): show the widget
- before returning it.
-
- * importers/main.c (main): s/PACKAGE/GETTEXT_PACKAGE/ in gettext
- init
-
-2003-02-05 Dan Winship <danw@ximian.com>
-
- * gui/Makefile.am (INCLUDES): Remove cruft. Rename ICONSDIR to
- IMAGESDIR.
- (gladedir, etspecdir, serverdir): Remove definitions
- (libevolution_calendar_la_LDFLAGS): Remove -export-dynamic, add
- -module.
-
- * gui/calendar-config.c: #include <string.h>
-
- * gui/calendar-component.c (add_creatable_item):
- s/ICONSDIR/IMAGESDIR/
-
- * gui/comp-util.c: #include <string.h>
-
- * gui/e-alarm-list.c: #include e-time-utils.h
- (row_deleted): Remove unused variable.
- (e_alarm_list_append): Likewise.
-
- * gui/e-date-time-list.c: #include e-time-utils.h, timeutil.h,
- calendar-config.h
- (row_deleted): Remove unused variable
- (e_date_time_list_append): Likewise.
-
- * gui/e-day-view.c (e_day_view_unrealize): Remove unused var
- (e_day_view_style_set): Likewise.
- (e_day_view_set_event_font_cb): Likewise.
-
- * gui/e-day-view-time-item.c: #include <string.h>
- (e_day_view_time_item_get_column_width): Remove unused variable.
-
- * gui/e-itip-control.c: #include <unistd.h>
- (url_requested_cb): s/ICONSDIR/IMAGESDIR/
-
- * gui/e-week-view.c (e_week_view_unrealize): Remove unused variable
- (e_week_view_style_set): Likewise
-
- * gui/e-week-view-titles-item.c: #include string.h
- * gui/itip-bonobo-control.c: Likewise
- * gui/print.c: Likewise
-
-
- * gui/alarm-notify/Makefile.am: Use privlibexecdir.
- (INCLUDES): Remove cruft.
- (gladedir, serversdir): Remove definitions
- (evolution_alarm_notify_LDFLAGS): Remove no-longer-needed
- -export-dynamic.
-
- * gui/alarm-notify/alarm-notify-dialog.c (write_html_heading):
- s/ICONSDIR/IMAGESDIR
-
- * gui/alarm-notify/notify-main.c (main): Fix up gettext
- initialization
-
-
- * gui/dialogs/Makefile.am (INCLUDES): Remove cruft. Rename
- ICONSDIR to IMAGESDIR.
- (gladedir, etspecdir): Remove definitions
-
- * gui/dialogs/alarm-page.c: #include gtktreeselection.h and
- gtkcellrenderertext.h
- (append_reminder): Remove unused variable.
- (alarm_page_fill_component): Likewise.
- (alarm_page_set_summary): Likewise.
- (delete_clicked_cb): Likewise.
-
- * gui/dialogs/comp-editor.c (make_icon_from_comp):
- s/ICONSDIR/IMAGESDIR/
-
- * gui/dialogs/event-page.c: #include <string.h>
-
- * gui/dialogs/meeting-page.c (meeting_page_construct): Remove
- unused variable.
- (meeting_page_fill_widgets): Likewise
-
- * gui/dialogs/recurrence-page.c: #include gtktreeselection.h and
- gtkcellrenderertext.h
- (append_exception): Remove unused variable
- (fill_component): Likewise
- (recurrence_page_set_summary): Likewise.
- (exception_delete_cb): Likewise
-
-
- * cal-client/Makefile.am (libcal_clientincludedir): Define in
- terms of privincludedir
-
- * cal-client/client-test.c (main): Fix up gettext initialization
-
- * cal-client/cal-client.c (cal_client_construct): Likewise
-
-
- * cal-util/Makefile.am (INCLUDES): Remove cruft.
- (libcal_utilincludedir): Define in terms of privincludedir
-
-
- * pcs/Makefile.am (INCLUDES): Remove cruft.
- (pcsincludedir): Define in terms of privincludedir
-
- * pcs/cal-backend-file.c (cal_backend_file_finalize): Remove
- unused variable
-
-
- * importers/Makefile.am: Update this some although it's not
- currently being built
-
-2003-02-05 Dan Winship <danw@ximian.com>
-
- * gui/alarm-notify/notify-main.c (main):
- s/glade_gnome_init/glade_init/
-
- * gui/calendar-offline-handler.c: s/BonoboXObject/BonoboObject/
-
- * gui/comp-editor-factory.c: Likewise
-
-2003-02-05 Dan Winship <danw@ximian.com>
-
- * cal-util/cal-recur.c (cal_recur_nth): array of localized month
- day names ("1st" - "31st")
-
- * gui/dialogs/recurrence-page.c (make_recur_month_num_submenu,
- make_recur_month_num_menu, month_num_menu_selection_done_cb): Use
- the new cal_recur_nth[] array. The way this was done before didn't
- localize properly.
-
- From evolution-1-2-branch:
-
- * gui/e-itip-control.c (write_recurrence_piece): Describe
- recurrences, if we can. #30993
- (set_date_label): If the meeting has recurrences, call
- write_recurrence_piece after writing the start and end dates.
- (write_label_piece): Wrap the timezone in <font size=-1> to
- de-emphasize it a bit and try to keep the timestamp on a single
- line even with big Outlook timezone names. Add an option to show
- just the date, for describing the end of recurrences (since the
- time in the UNTIL is the *beginning* of the last instance, which
- would confuse people).
- (update_item): Set the VCALENDAR's METHOD.
- (ok_clicked_cb): Use update_item, not remove_item, to process a
- cancelation. Part of #33875.
-
- * pcs/cal-backend-file.c (cal_backend_file_cancel_object): New,
- handle an ICAL_METHOD_CANCEL update.
- (cal_backend_file_update_objects): Call
- cal_backend_file_update_object or cal_backend_file_cancel_object
- as appropriate.
-
-2003-02-04 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/e-meeting-time-sel.c
- (e_meeting_time_selector_on_invite_others_button_draw):
- Rename to e_meeting_time_selector_on_invite_others_button_expose()
- and handle "expose-event" instead of "draw".
- (e_meeting_time_selector_construct): The "draw" signal doesn't exist
- anymore - connect to "expose-event" instead.
-
- * gui/dialogs/event-page.c (clear_widgets): Clear the GtkTextBuffer
- for the description.
- (event_page_fill_widgets): Use the GtkTextBuffer.
- (event_page_fill_component): Use the GtkTextBuffer.
- (init_widgets): Create a GtkTextBuffer for the GtkTextView. Set word
- wrap. Connect to the "changed" signal of the model instead of the view.
-
-2003-02-04 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/e-meeting-time-sel-item.c
- (e_meeting_time_selector_item_paint_day_top): Use PangoLayout to
- draw text.
-
-2003-02-02 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/e-day-view.c (e_day_view_set_event_font_cb): Skip setting the
- "font_gdk" arg for now.
- (e_day_view_update_main_canvas_drag): Ditto.
-
- * gui/e-week-view.c (e_week_view_style_set): Ditto.
-
- * gui/weekday-picker.c (configure_items): Ditto.
-
- * gui/dialogs/event-page.c (get_widgets): Show custom widgets
- manually, since the visibility specified in the Glade XML appears
- to not have any effect.
-
- * gui/dialogs/recurrence-page.c (get_widgets): Ditto.
-
-2003-01-30 Ronald Kuetemeier <ronald@kuetemeier.com>
-
- Fixes #35572
-
- * gui/alarm-notify/alarm-queue.c: set saved_notification_time to last
- notification time when we update the config to last notification, so
- alarms will not get trigged again if a new calendar window is opened.
-
-2003-01-26 Chris Toshok <toshok@ximian.com>
-
- * conduits/todo/todo-conduit.c: CalClient and CalComponent are
- GObjects.
-
- * conduits/calendar/calendar-conduit.c: same.
-
-2003-01-26 Chris Toshok <toshok@ximian.com>
-
- * conduits/calendar/calendar-conduit.c (start_calendar_server):
- fix warning.
- (get_default_timezone): BonoboConfigDatabase -> e_config_listener.
- (accept_all_cookies): remove.
- (conduit_get_gpilot_conduit): remove the oaf initialization stuff.
-
- * conduits/todo/todo-conduit.c (start_calendar_server):
- fix warning.
- (get_default_timezone): BonoboConfigDatabase -> e_config_listener.
- (accept_all_cookies): remove.
- (conduit_get_gpilot_conduit): remove the oaf initialization stuff.
-
- * Makefile.am (CONDUIT_DIR): uncomment the conduit stuff.
-
-2003-01-26 Hans Petter Jansson <hpj@ximian.com>
-
- Make clicks, drags and resizes work, and pangoize remaining strings.
- Fix EText placement.
-
- * gui/e-day-view-top-item.c (e_day_view_top_item_draw_long_event):
- Use Pango.
-
- * gui/e-day-view.c (e_day_view_on_top_canvas_button_press):
- Don't add scroll offset, it's already factored in.
- (e_day_view_on_main_canvas_button_press): Ditto.
- (e_day_view_on_top_canvas_motion): Ditto.
- (e_day_view_on_main_canvas_motion): Ditto.
- (e_day_view_reshape_long_event): Don't set the "font_gdk" property.
- Its non-existence will prevent the other properties from being set as
- well.
- (e_day_view_reshape_day_event): Ditto.
- (e_day_view_update_top_canvas_drag): Ditto.
- (e_day_view_start_editing_event): ETextEventProcessor is a GObject
- now. So use g_signal_stuff.
- (e_day_view_check_auto_scroll): Factor out scroll offset before
- checking the pointer's position relative to widget.
- (e_day_view_auto_scroll_handler): Don't freeze the canvas when
- scrolling - it will fail to update the canvas. If this is not
- intended behaviour, it's a bug in the canvas, I think.
- (e_day_view_on_main_canvas_drag_motion): Factor in the scroll offset
- before checking for auto-scroll, since the function requires this.
-
- * gui/e-week-view.c (e_week_view_reshape_event_span): Don't set the
- "font_gdk" property. Its non-existence will prevent the other
- properties from being set as well.
- (e_week_view_start_editing_event): ETextEventProcessor is a GObject
- now. So use g_signal_stuff.
-
-2003-01-25 Hans Petter Jansson <hpj@ximian.com>
-
- Mainly making all views use PangoLayouts for text. When drawing a
- PangoLayout, the draw offset is the top left corner of the layout,
- not the text's baseline. Keep this in mind when viewing the
- changes. I'll be brief about the exact changes, since they speak
- better for themselves.
-
- * gui/e-day-view-time-item.c (e_day_view_time_item_get_column_width):
- Use Pango.
- (e_day_view_time_item_draw): Use Pango.
-
- * gui/e-day-view-top-item.c (e_day_view_top_item_draw): Use Pango.
- (e_day_view_top_item_draw_long_event): Add some FIXME text so we can
- see when this is being used. Is it in use at all?
-
- * gui/e-day-view.c: No longer specify an explicit X font string for
- the large font. Use the main font, and change the point size.
- (e_day_view_init): Use Pango.
- (e_day_view_style_set): Use Pango. Comment out the gdk_font setting
- for the drag text items for now.
-
- * gui/e-day-view.h: Use Pango.
-
- * gui/e-week-view-event-item.c (e_week_view_draw_time): Use Pango.
-
- * gui/e-week-view-main-item.c (e_week_view_main_item_draw_day):
- Use Pango.
-
- * gui/e-week-view-titles-item.c (e_week_view_titles_item_draw):
- Use Pango.
-
- * gui/e-week-view.c: No longer specify an explicit X font string for
- the small font. Use the main font, and change the point size.
- (e_week_view_init): Use Pango.
- (e_week_view_destroy): Use Pango.
- (get_string_width): Implemented for convenience.
- (get_digit_width): Implemented for convenience.
- (e_week_view_style_set): Use Pango.
- (e_week_view_recalc_cell_sizes): Use Pango.
- (e_week_view_get_time_string_width): Use Pango.
-
- * gui/e-week-view.h: Use Pango.
-
- Following are some random UTF-8 fixes and a crash fix.
-
- * gui/itip-utils.c (comp_description): Use g_locale_to_utf8 ().
-
- * gui/dialogs/comp-editor.c (make_title_from_comp): Return a
- UTF-8 string.
-
- * gui/dialogs/alarm-page.c (alarm_page_set_summary): Pass UTF-8
- directly to GTK.
-
- * gui/dialogs/delete-comp.c (delete_component_dialog): Ditto.
-
- * gui/dialogs/meeting-page.c (meeting_page_fill_widgets): Ditto.
- (meeting_page_construct): Ditto.
-
- * gui/dialogs/recurrence-page.c (recurrence_page_set_summary): Ditto.
-
- * gui/dialogs/event-editor.c (event_editor_finalize): Fix crash caused
- by gtk_object_destroy()-ing a non-GtkObject.
-
-2003-01-24 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/e-day-view.c (e_day_view_on_editing_stopped): Don't insist
- appointment is updated if both old and new summary are blank.
-
- * gui/e-week-view.c (e_week_view_on_editing_stopped): Ditto.
-
- * gui/e-timezone-entry.c (on_button_clicked): Timezone dialog is now
- a GtkDialog. Treat it as such.
-
- * gui/goto.c (ecal_event): Goto dialog is now a GtkDialog. Treat it
- as such.
- (goto_dialog): Ditto.
-
- * gui/goto-dialog.glade: Set the return IDs from the dialog buttons.
-
- * gui/dialogs/meeting-page.c (popup_delegate_cb): Enable the delegate
- dialog. It's now a GtkDialog, so treat it like one.
- (right_click_cb): Use GTK stock item, not GNOME (that doesn't work
- anymore).
-
- * gui/e-delegate-dialog.glade: Set the return IDs from dialog buttons.
-
- * gui/print.c (print_calendar): Correct the print dialog init. Code
- is still not enabled, though.
-
- * gui/tasks-control.c (print_tasks): Add a warning about printing
- being disabled.
-
-2003-01-24 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/dialogs/Makefile.am (iconsdir): Remove, this is now defined
- in configure.in.
-
- * gui/Makefile.am (iconsdir): Remove; this is now defined in
- configure.in.
-
- * gui/alarm-notify/Makefile.am (iconsdir): Remove; this is now
- defined in configure.in.
-
-2003-01-23 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/dialogs/event-page.c (get_widgets): GTK_OBJECT -> G_OBJECT cast.
-
- * gui/dialogs/alarm-page.c (get_widgets): Ditto.
-
- * gui/dialogs/meeting-page.c (get_widgets): Ditto.
-
- * gui/dialogs/recurrence-page.c (get_widgets): Ditto.
-
- * gui/dialogs/schedule-page.c (get_widget): Ditto.
-
- * gui/dialogs/task-details-page.c (get_widget): Ditto.
-
- * gui/dialogs/task-page.c (get_widget): Ditto.
-
- * gui/e-meeting-time-sel.c (e_meeting_time_selector_construct): Add a
- FIXME comment to think about.
-
- * gui/dialogs/comp-editor.c (comp_editor_merge_ui): Add a terminating
- NULL to the concatenation.
-
-2003-01-23 Hans Petter Jansson <hpj@ximian.com>
-
- Fixes some trivial, but distracting, warnings.
-
- * gui/calendar-config.c (on_timezone_set): Fix constness.
-
- * gui/e-timezone-entry.c (on_button_clicked): Fix constness.
-
- * gui/dialogs/event-page.c (contacts_changed_cb): Fix constness.
-
- * gui/dialogs/task-page.c (contacts_changed_cb): Fix constness.
-
- * gui/e-itip-control.c (start_default_server): Cast callback with
- G_CALLBACK ().
-
- * gui/dialogs/schedule-page.c (init_widgets): Cast callback with
- G_CALLBACK ().
-
- * gui/calendar-offline-handler.c (impl_dispose): Takes GObject,
- not GtkObject.
- (impl_finalize): Ditto.
-
- * gui/calendar-view.c (calendar_view_edit): Now takes parent window
- as second arg.
-
- * gui/e-meeting-model.c (select_names_ok_cb): Fix constness.
- (get_select_name_dialog): Cast callback to BonoboListenerCallbackFn.
-
- * gui/e-meeting-time-sel.c
- (e_meeting_time_selector_options_menu_position_callback): Add the
- push_in arg to arg list. This was crash-prone before.
- (e_meeting_time_selector_autopick_menu_position_callback): Ditto.
-
- * gui/alarm-notify/alarm-notify-dialog.c: Include e-unicode.h.
-
-2003-01-23 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/Makefile.am (componentdir): Removed definition; this is now
- defined in configure.in.
-
-2003-01-22 Ettore Perazzoli <ettore@ximian.com>
-
- * pcs/cal-backend.c (cal_backend_ref_categories): Do not put the
- category in both the changed_categories and the categories hashes;
- fixes a double-free when finalizing the CalBackend.
-
-2003-01-22 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/gnome-cal.c (gnome_calendar_setup_view_menus): Use
- EVOLUTION_GALVIEWSDIR.
-
- * gui/e-tasks.c (e_tasks_setup_view_menus): Use
- EVOLUTION_GALVIEWSDIR.
-
- * cal-util/Makefile.am: Install libcal-util.la in $(privlibdir)
- instead of $(libdir).
-
- * gui/dialogs/comp-editor.c (setup_widgets): Get
- evolution-comp-editor.xml from EVOLUTION_UIDIR.
- (comp_editor_merge_ui): Get the file in EVOLUTION_UIDIR.
-
- * gui/tasks-control.c (tasks_control_activate): Get
- evolution-tasks.xml from EVOLUTION_UI_DIRECTORY.
-
- * gui/calendar-commands.c (calendar_control_activate): Get
- evolution-calendar.xml from EVOLUTION_UI_DIRECTORY.
-
- * pcs/Makefile.am (pcsincludedir): Version using $(BASE_VERSION).
-
- * importers/Makefile.am: Install evolution-calendar-importer in
- $(libexecdir)/evolution/$(BASE_VERSION).
- (sounddir): Remove.
-
- * gui/dialogs/Makefile.am (iconsdir): Version using
- $(BASE_VERSION).
- (gladedir): Likewise.
- (etspecdir): Likewise.
-
- * gui/Makefile.am (help_base): Remove.
- (install-data-local): Do not make the $(help_base)/C directory.
- (etspecdir): Version using $(BASE_VERSION).
- (gladedir): Likewise.
- (iconsdir): Likewise.
- (INCLUDES): Update the EVOLUTION_IMAGESDIR define to be versioned,
- and add a -DEVOLUTION_GALVIEWSDIR.
-
- * cal-util/Makefile.am: Install evolution-alarm-notify in
- $(libexecdir)/evolution/$(BASE_VERSION).
-
- * cal-util/Makefile.am (libcal_utilincludedir): Version using
- $(BASE_VERSION).
- * gui/alarm-notify/Makefile.am (iconsdir): Likewise.
- (gladedir): Likewise.
-
- * cal-client/Makefile.am: Install libcal-client.la in privlibdir
- instead of libdir.
- (libcal_clientincludedir): Version using $(BASE_VERSION).
-
-2003-01-18 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/print.c (print_calendar): Create a GnomePrintDialog,
- not a GnomePrinterDialog. They're different things. Patch from
- Chema.
-
-2003-01-17 Dan Winship <danw@ximian.com>
-
- * pcs/cal-backend.c: Move some non-file-backend-specific stuff
- from cal-backend-file here so it can be shared with other
- backends.
- (CalBackendPrivate): add this, containing the categories hashes
- and the (formerly public) clients list.
- (cal_backend_init, cal_backend_finalize): Handle backend->priv.
- (cal_destroy_cb): Simplify this (and redo it as a weak notify
- func)
- (cal_backend_add_cal): Keep a weak ref on the cal rather than
- connecting to its "destroy" signal. Call notify_categories_changed
- to let the new cal know about them.
- (get_object): Default implementation of cal_backend_get_object.
- that calls cal_component_get_as_string on the return value of
- cal_backend_get_object_component.
- (cal_backend_notify_mode, cal_backend_notify_update,
- cal_backend_notify_remove, cal_backend_notify_error): Notify each
- Cal about something.
- (cal_backend_ref_categories, cal_backend_unref_categories):
- Maintain a list of categories that are used by components in the
- backend, and trigger categories_changed notifications as needed.
-
- * pcs/cal-backend-file.c: Remove stuff that was moved to
- CalBackend (notify funcs, category handling, get_object
- implementation)
-
-2003-01-16 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/e-alarm-list.[ch]: Implement EAlarmList as CalComponentAlarm
- list with a GtkTreeModel interface.
-
- * gui/Makefile.am: Add e-alarm-list.[ch].
-
- * gui/dialogs/alarm-page.[ch]: Use GtkTreeView with the new
- EAlarmList as model for the alarm list. Update copyright.
-
- * gui/dialogs/recurrence-page.[ch]: Update copyright.
- (free_exception_date_time): Removed.
- (fill_exception_widgets): Kill a lingering clist operation.
-
-2003-01-15 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/e-meeting-time-sel.c (e_meeting_time_selector_construct):
- Create accel groups for popup menus. Fixes crash.
-
- * gui/e-date-time-list.[ch]: Implement EDateTimeList as
- CalComponentDateTime list with a GtkTreeModel interface.
-
- * gui/Makefile.am: Add e-date-time-list.[ch].
-
- * gui/dialogs/recurrence-page.c: Use GtkTreeView with the new
- EDateTimeList as model for the exception list.
-
- * gui/e-day-view.c: Silence warnings caused by missing casts.
-
- * gui/e-week-view.c: Silence warnings caused by missing casts.
-
-2003-01-15 Rodney Dawes <dobey@ximian.com>
-
- * gui/Makefile.am: Added libevolution_calendar_la_LDFLAGS, and
- avoid versioning the shlib component
-
-2003-01-14 Ettore Perazzoli <ettore@ximian.com>
-
- * cal-client/Makefile.am (CORBA_SOURCES_GENERATED): Renamed from
- CORBA_GENERATED.
- (CORBA_GENERATED): New, put both $(CORBA_SOURCES_GENERATED) and
- $(CORBA_HEADERS_GENERATED) in it.
- (BUILT_SOURCES): Put $(CORBA_GENERATED) in here.
-
-2003-01-14 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/e-calendar-table.c (tasks_popup_menu): Cast signal handlers
- to GtkSignalFunc, avoid warnings.
-
- * gui/gnome-cal.c (set_view): Only set view ID if we have an instance.
-
-2003-01-14 Ettore Perazzoli <ettore@ximian.com>
-
- * cal-util/Makefile.am (EXTRA_DIST): cal-util-marshal.list.
-
- * Makefile.am: Comment out the CONDUIT_DIR stuff for now.
-
-2003-01-14 Rodney Dawes <dobey@ximian.com>
-
- * gui/gnome-cal.c: Use GtkPaned instead of EPaned
-
-2003-01-14 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/e-day-view.c (e_day_view_init): Work around canvas crashes
- by ensuring rectangles have an initial width.
-
-2003-01-13 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/config-control-factory.h: Removed.
- * gui/config-control-factory.c: Removed.
-
- * gui/itip-bonobo-control.c: Renamed from itip-control-factory.c.
- (itip_bonobo_control_new): New.
- (itip_control_factory_init): Removed.
-
- * gui/itip-bonobo-control.h: Renamed from itip-control-factory.h.
-
- * gui/tasks-control-factory.c: Removed.
- * gui/tasks-control-factory.h: Removed.
-
- * gui/control-factory.c (control_factory_init): Removed.
-
- * gui/Makefile.am: Updated to build everything as
- libevolution-calendar.so and install in the COMPONENTDIR.
-
- * gui/GNOME_Evolution_Calendar.server.in.in: Updated to build the
- component as a shared library.
-
- * gui/main.c (main): Removed.
-
- * gui/calendar-component.c (calendar_component_get_object): New.
- (owner_set_cb): Do not store the shell pointer in shells.
- (owner_unset_cb): Do not remove the shell pointer from shells;
- instead, just set global_shell_client to NULL.
-
- * gui/calendar-component.h: Renamed from component-factory.h.
- * gui/calendar-component.c: Renamed from component-factory.c.
-
-2003-01-10 Ettore Perazzoli <ettore@ximian.com>
-
- * importers/icalendar-importer.c (connect_to_shell):
- CORBA_Object_release() the CORBA shell.
-
-2003-01-09 Dan Winship <danw@ximian.com>
-
- * gui/dialogs/recurrence-page.c (make_recur_month_num_submenu,
- make_recur_month_num_menu, month_num_menu_selection_done_cb): Use
- the new cal_recur_nth[] array. The way this was done before didn't
- localize properly.
-
- * cal-util/cal-recur.c (cal_recur_nth): array of localized month
- day names ("1st" - "31st")
-
- * cal-util/cal-component.c (cal_component_set_recurid): Allow
- recur_id to be NULL to clear the recurrence id. (Based on a story
- by JP on evolution-1-2-recurid-branch)
-
- * gui/print.c: Remove unused gnome-print-copies.h #include
-
- * pcs/query.c (query_new): Use g_object_weak_ref rather than
- connecting to "destroy" (which doesn't actually exist on a
- CalBackend)
- (backend_destroyed_cb): Update prototype.
-
-2003-01-08 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/alarm-notify/Makefile.am: Icons are now in
- $(datadir)/evolution/images instead of
- $(datadir)/images/evolution.
- * gui/Makefile.am: Likewise.
- * gui/dialogs/Makefile.am: Likewise.
-
-2003-01-06 Dan Winship <danw@ximian.com>
-
- * idl/Makefile.am: remove idldir definition. (It's defined in
- configure.in now)
-
-2002-12-19 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/calendar-commands.c (calendar_control_deactivate):
- Replace gtk_signal_disconnect_by_data() with
- g_signal_handlers_disconnect_matched(). Former takes GtkObject,
- latter takes GObject.
-
- * gui/calendar-model.c (calendar_model_destroy): Ditto.
- (update_query): Ditto.
- (calendar_model_set_cal_client): Ditto.
-
- * gui/e-day-view.c (e_day_view_destroy): Ditto.
- (update_query): Ditto.
- (e_day_view_set_cal_client): Ditto.
-
- * gui/e-tasks.c (query_eval_error_cb): Ditto.
- (query_query_done_cb): Ditto.
-
- * gui/e-week-view.c (e_week_view_destroy): Ditto.
- (update_query): Ditto.
- (e_week_view_set_cal_client): Ditto.
-
- * gui/gnome-cal.c (update_query): Ditto.
- (gnome_calendar_destroy): Ditto.
-
- * gui/tasks-control.c (tasks_control_deactivate): Ditto.
-
- * gui/e-comp-editor-registry.c (foreach_close_cb): Replace
- gtk_signal_handler_(un)block_by_data() with
- g_signal_handlers_(un)block_matched(). Former takes GtkObject, latter
- takes GObject.
-
- * gui/dialogs/alarm-page.c (alarm_page_get_type): Replace with
- E_MAKE_TYPE().
- (alarm_page_class_init): Use GObject as base class instead of
- GtkObject, and set up finalization instead of destroy handler.
- (alarm_page_destroy): Change to alarm_page_finalize() and assume
- parent is GObject, not GtkObject.
- (alarm_page_new): Use g_object_new(), not gtk_type_new().
-
- * gui/dialogs/event-page.c: Same general changes as above file.
- (update_time): Replace gtk_signal_handler_(un)block_by_data()
- with g_signal_handlers_(un)block_matched().
- (clear_widgets): Ditto.
- (times_updated): Ditto.
-
- * gui/dialogs/recurrence-page.c: Same general changes as above file.
- (clear_widgets): Replace gtk_signal_handler_(un)block_by_data()
- with g_signal_handlers_(un)block_matched().
- (append_exception): Ditto.
- (fill_ending_date): Ditto.
- (recurrence_page_fill_widgets): Ditto.
-
- * gui/dialogs/comp-editor.c: Same general changes as above file.
- (comp_editor_finalize): Replace gtk_signal_disconnect_by_data()
- with g_signal_handlers_disconnect_matched().
- (comp_editor_remove_page): Ditto.
-
- * gui/dialogs/event-editor.c: Same general changes as above file.
- * gui/dialogs/meeting-page.c: Same general changes as above file.
- * gui/dialogs/schedule-page.c: Same general changes as above file.
- * gui/dialogs/task-details-page.c: Same general changes.
- * gui/dialogs/task-editor.c: Same general changes as above file.
- * gui/dialogs/task-page.c: Same general changes as above file.
- * gui/dialogs/e-delegate-dialog.c: Same general changes.
-
-2002-12-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * gui/e-itip-control.c (write_html): Use camel_text_to_html()
- instead.
-
-2002-12-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * gui/e-itip-control.c (write_html): Correctly convert text.value
- into HTML here (ie, don't pass "<i>None</i>" into e_text_to_html()
- if text.value is NULL).
-
-2002-12-06 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #35003
-
- * gui/misc.[ch] (get_uri_without_password): new function for
- removing the password from the CalClient's uris.
-
- * gui/gnome-cal.c (client_cal_opened_cb): use the URI returned by
- get_uri_without_password for messages.
- (backend_error_cb): likewise.
- (backend_died_cb): likewise.
- (gnome_calendar_open): likewise.
- (open_error, method_error, permission_error): likewise.
-
- * gui/e-tasks.c (e_tasks_open): hide the password from the URI
- being displayed in messages.
- (backend_error_cb): likewise.
-
-2002-12-06 Hans Petter Jansson <hpj@ximian.com>
-
- * cal-client/cal-query.c (cal_query_done_status_enum_get_type):
- Implement GType for this enumeration.
- (cal_query_class_init): Use the enumeration instead of the
- abstract one.
-
- * cal-client/cal-query.h: Add type macro and proto for enum.
-
-2002-12-06 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/component-factory.c (create_view): Pass the env argument to
- bonobo_control_set_property ().
-
- * gui/e-meeting-model.c (class_init): We're no longer derived from
- GtkObject, so use GObject class methods instead. destroy->finalize.
- (destroy): Zapped.
- (finalize): Implement based on old destroy ().
-
-2002-12-06 Hans Petter Jansson <hpj@ximian.com>
-
- * cal-client/cal-client.c (cal_client_open_status_enum_get_type):
- Create a non-abstract enumeration type derived from GEnum.
- (cal_client_set_mode_status_enum_get_type): Ditto.
- (cal_mode_enum_get_type): Ditto.
- (cal_client_class_init): Use our enumerations and not the abstract
- one.
- (cal_client_finalize): Don't destroy factories, since the CalClient
- doesn't own them anymore. They're shared between CalClients now.
- (get_factories): Implement. Move the factory setup code here from
- cal_client_construct (), and cache the factories. This is hopefully
- temporary, until wombat goes away or is fixed.
- (cal_client_construct): Most of the code moved to get_factories ().
-
- * cal-client/cal-client.h: Add enumeration type macros and protos.
-
- * gui/cal-search-bar.c (cal_search_bar_get_type): Removed in favour
- of E_MAKE_TYPE, which uses GObject calls.
- (cal_search_bar_class_init): Use g_type_class_peek_parent ().
-
- * gui/calendar-model.c (calendar_model_get_type):
- (calendar_model_class_init): Ditto, like above file.
- * gui/calendar-view.c (calendar_view_get_type):
- (calendar_view_class_init): Ditto.
- * gui/e-calendar-table.c (e_calendar_table_get_type):
- (e_calendar_table_class_init): Ditto.
- * gui/e-comp-editor-registry.c (e_comp_editor_registry_get_type):
- (class_init): Ditto.
- * gui/e-day-view-main-item.c (e_day_view_main_item_get_type):
- (e_day_view_main_item_class_init): Ditto.
- * gui/e-day-view-time-item.c (e_day_view_time_item_get_type):
- (e_day_view_time_item_class_init): Ditto.
- * gui/e-day-view-top-item.c (e_day_view_top_item_get_type):
- (e_day_view_top_item_class_init): Ditto.
- * gui/e-day-view.c (e_day_view_get_type):
- (e_day_view_class_init): Ditto.
- * gui/e-itip-control.c (e_itip_control_get_type):
- (class_init): Ditto.
- * gui/e-meeting-attendee.c (e_meeting_attendee_get_type):
- (class_init): Ditto.
- * gui/e-meeting-model.c (e_meeting_model_get_type):
- (class_init): Ditto.
- * gui/e-meeting-time-sel-item.c
- (e_meeting_time_selector_item_get_type):
- (e_meeting_time_selector_item_class_init): Ditto.
- * gui/e-meeting-time-sel.c
- (e_meeting_time_selector_get_type):
- (e_meeting_time_selector_class_init): Ditto.
- * gui/e-timezone-entry.c (e_timezone_entry_get_type):
- (e_timezone_entry_class_init): Ditto.
- * gui/e-week-view-event-item.c (e_week_view_event_item_get_type):
- (e_week_view_event_item_class_init): Ditto.
- * gui/e-week-view-main-item.c (e_week_view_main_item_get_type):
- (e_week_view_main_item_class_init): Ditto.
- * gui/e-week-view-titles-item.c (e_week_view_titles_item_get_type):
- (e_week_view_titles_item_class_init): Ditto.
- * gui/gnome-cal.c (gnome_calendar_get_type):
- (gnome_calendar_class_init): Ditto.
- * gui/weekday-picker.c (weekday_picker_get_type):
- (weekday_picker_class_init): Ditto.
-
- * gui/e-week-view.c (e_week_view_get_type):
- (e_week_view_class_init): Ditto, but parent_class init was moved
- from get_type() to class_init().
-
- * gui/calendar-view-factory.c (calendar_view_factory_get_type):
- (calendar_view_factory_class_init): Ditto, and set up finalize
- callback instead of destroy.
- (calendar_view_factory_finalize): It's a GObject, so implement this.
- (celendar_view_factory_destroy): Move code to _finalize() and remove.
-
- * gui/main.c (init_bonobo): Remove extraneous bonobo_activation_init().
-
-2002-11-27 Not Zed <NotZed@Ximian.com>
-
- * gui/itip-utils.[ch]: run fix.sh over this.
-
- * gui/dialogs/*.[ch]: run fix.sh over all of this.
-
-2002-11-26 Richard Li <Richard.Li@Sun.COM>
-
- * cal-client/cal-client.c (cal_client_construct): removed extra call
- to CORBA_exception_init.
-
-2002-11-22 Not Zed <NotZed@Ximian.com>
-
- * gui/dialogs/delete-comp.c (delete_component_dialog): Changed
- e_messagebox -> gtk_messagedialog.
-
-2002-11-21 Not Zed <NotZed@Ximian.com>
-
- * gui/component-factory.c (create_view): pass type to
- bonobo_control_set_property.
-
-2002-11-20 Not Zed <NotZed@Ximian.com>
-
- * gui/Makefile.am (EXTRA_DIST): fix typo, servers_in_files ->
- server_in_files.
-
-2002-11-19 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am: Added rule to generate
- GNOME_Evolution_Calendar.server.in from
- GNOME_Evolution_Calendar.server.in.in, substituting @LIBEXECDIR@.
- Also, install evolution-calendar in $libexecdir instead of
- $bindir.
-
- * gui/GNOME_Evolution_Calendar.server.in.in: Renamed from
- GNOME_Evolution_Calendar.server.in. Prepended the executable name
- with @LIBEXECDIR@.
-
-2002-11-19 Not Zed <NotZed@Ximian.com>
-
- * gui/e-meeting-model.c (get_select_name_dialog): pass type to
- bonobo_widget::set_property.
- (select_names_ok_cb): ", for get_property.
-
- * gui/dialogs/e-delegate-dialog.c (e_delegate_dialog_construct):
- pass type to bonobo_widget::set_property & plug small leak.
- (e_delegate_dialog_get_delegate): ", for get_property.
- (e_delegate_dialog_get_delegate_name): "
-
- * gui/dialogs/comp-editor-util.c (comp_editor_contacts_to_widget):
- pass type to bonobo_widget::set_property.
- (comp_editor_contacts_to_component): ", for get_property
-
-2002-11-16 Chris Toshok <toshok@ximian.com>
-
- * gui/e-meeting-time-sel.c (e_meeting_time_selector_style_set):
- use new e_table_header_compute_height signature.
-
-2002-11-15 Rodney Dawes <dobey@ximian.com>
-
- * gui/component-factory.c: Use bonobo_main_quit instead of gtk
-
-2002-11-13 Federico Mena Quintero <federico@ximian.com>
-
- * cal-client/cal-query.c: #include <string.h>
- (obj_removed_cb): Fixed prototype.
-
- * cal-client/cal-client.c (get_objects_atomically): Fix use of
- g_signal_handler_disconnect().
-
- * cal-client/client-test.c (create_client): Add G_CALLBACK casts.
-
-2002-11-12 Federico Mena Quintero <federico@ximian.com>
-
- * pcs/cal-backend-util.c: #include <string.h>
-
- * pcs/cal.c: Fixed prototypes of the CORBA method implementations.
-
- * pcs/cal-backend-file.c (cal_backend_file_dispose): Added a
- dispose method.
- (cal_backend_file_get_free_busy): Converted to use EConfigListener
- rather than BonoboConfigDatabase.
-
- * gui/alarm-notify/alarm-notify.c: #include <string.h>, fix use of
- g_hash_table_lookup_extended().
-
- * gui/alarm-notify/alarm-notify-dialog.c: Substitute deprecated
- GTK+ functions for new ones.
-
- * gui/alarm-notify/alarm-queue.c: Likewise.
-
- * gui/alarm-notify/notify-main.c: #include <string.h>,
- <gtk/gtkmain.h>.
-
- * gui/alarm-notify/save.c: #include <string.h>.
-
-2002-11-08 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/calendar-commands.c (calendar_control_deactivate): Use
- g_object_set_data(..., NULL) instead of gtk_object_remove_data().
-
- * gui/calendar-commands.c: Use g_object_{set,get}_* functions
- instead of gtk_object_{set,get}_*.
- * gui/calendar-commands.c: Likewise.
- * gui/calendar-config.c: Likewise.
- * gui/control-factory.c: Likewise.
- * gui/e-calendar-table.c: Likewise.
- * gui/e-comp-editor-registry.c: Likewise.
- * gui/e-day-view-main-item.c: Likewise.
- * gui/e-day-view-time-item.c: Likewise.
- * gui/e-day-view-top-item.c: Likewise.
- * gui/e-day-view.c: Likewise.
- * gui/e-meeting-attendee.c: Likewise.
- * gui/e-meeting-model.c: Likewise.
- * gui/e-meeting-time-sel-item.c: Likewise.
- * gui/e-meeting-time-sel.c: Likewise.
- * gui/e-week-view-event-item.c: Likewise.
- * gui/e-week-view-layout.c: Likewise.
- * gui/e-week-view-main-item.c: Likewise.
- * gui/e-week-view-titles-item.c: Likewise.
- * gui/e-week-view.c: Likewise.
- * gui/gnome-cal.c: Likewise.
- * gui/print.c: Likewise.
-
-2002-11-08 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/calendar-commands.c: Use g_object_ref()/g_object_unref()
- instead of gtk_object_ref/gtk_object_unref().
- * gui/calendar-config.c: Likewise.
- * gui/calendar-model.c: Likewise.
- * gui/comp-editor-factory.c: Likewise.
- * gui/comp-util.c: Likewise.
- * gui/e-calendar-table.c: Likewise.
- * gui/e-day-view.c: Likewise.
- * gui/e-itip-control.c: Likewise.
- * gui/e-meeting-model.c: Likewise.
- * gui/e-meeting-time-sel.c: Likewise.
- * gui/e-tasks.c: Likewise.
- * gui/e-timezone-entry.c: Likewise.
- * gui/e-week-view.c: Likewise.
- * gui/gnome-cal.c: Likewise.
- * gui/goto.c: Likewise.
- * gui/itip-utils.c: Likewise.
- * gui/print.c: Likewise.
- * gui/tasks-control.c: Likewise.
- * gui/tasks-migrate.c: Likewise.
-
- * gui/cal-search-bar.c: Use g_object_new() instead of
- gtk_type_new().
- * gui/calendar-model.c: Likewise.
- * gui/calendar-view-factory.c: Likewise.
- * gui/calendar-view.c: Likewise.
- * gui/calendar-view.c: Likewise.
- * gui/comp-editor-factory.c: Likewise.
- * gui/e-calendar-table.c: Likewise.
- * gui/e-cell-date-edit-text.c: Likewise.
- * gui/e-comp-editor-registry.c: Likewise.
- * gui/e-day-view.c: Likewise.
- * gui/e-itip-control.c: Likewise.
- * gui/e-meeting-attendee.c: Likewise.
- * gui/e-meeting-attendee.c: Likewise.
- * gui/e-meeting-model.c: Likewise.
- * gui/e-meeting-time-sel.c: Likewise.
- * gui/e-tasks.c: Likewise.
- * gui/e-timezone-entry.c: Likewise.
- * gui/e-week-view.c: Likewise.
- * gui/gnome-cal.c: Likewise.
- * gui/weekday-picker.c: Likewise.
-
- * gui/e-itip-control.c (get_servers): g_object_unref the
- shell_client instead of using bonobo_object_unref().
-
- * gui/component-factory.c (owner_set_cb): Use
- evolution_shell_client_corba_objref() instead of
- bonobo_object_corba_objref().
-
-2002-11-08 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/calendar-commands.c: Use g_signal_connect() instead of
- gtk_signal_connect().
- * calendar-commands.c: Likewise.
- * calendar-config.c: Likewise.
- * calendar-model.c: Likewise.
- * comp-editor-factory.c: Likewise.
- * component-factory.c: Likewise.
- * control-factory.c: Likewise.
- * e-calendar-table.c: Likewise.
- * e-comp-editor-registry.c: Likewise.
- * e-day-view-time-item.c: Likewise.
- * e-day-view.c: Likewise.
- * e-itip-control.c: Likewise.
- * e-meeting-model.c: Likewise.
- * e-meeting-time-sel.c: Likewise.
- * e-tasks.c: Likewise.
- * e-timezone-entry.c: Likewise.
- * e-week-view.c: Likewise.
- * gnome-cal.c: Likewise.
- * goto.c: Likewise.
- * tasks-control.c: Likewise.
- * tasks-migrate.c: Likewise.
- * weekday-picker.c: Likewise.
-
-2002-11-08 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/calendar-offline-handler.c
- (calendar_offline_handler_class_init): GObjectified.
- (impl_finalize): Finalize impl.
- (impl_dispose): Dispose impl.
- (calendar_offline_handler_new): Use g_object_new().
- (backend_cal_opened): use g_signal_connect() instead of
- gtk_signal_connect().
- (backend_go_offline): Likewise.
- (backend_cal_opened): g_object_unref() instead of
- gtk_object_unref().
- (backend_go_offline): Likewise.
-
-2002-11-08 Rodrigo Moya <rodrigo@ximian.com>
-
- * importers/evolution-calendar-importer.h: use GLib macros.
-
- * importers/main.c (init_importer): use bonobo_generic_factory_new,
- not bonobo_generic_factory_new_multi.
- (main): don't use libgnome functions.
-
-2002-11-07 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-client/client-test.c: don't use GTK, we don't need it.
-
-2002-11-07 JP Rosevear <jpr@ximian.com>
-
- * Initial port of gui/ subdir to GNOME 2
-
-2002-11-07 Rodrigo Moya <rodrigo@ximian.com>
-
- * importers/icalendar-importer.c: removed non-existant headers.
-
- * importers/Makefile.am: changes for BonoboActivation.
-
- * gui/GNOME_Evolution_Calendar.server.in: install to $libdir, not
- $datadir.
-
-2002-11-07 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-client/query-listener.[ch]: converted to BonoboObject.
-
- * gui/dialogs/comp-editor-util.c (parse_contact_string): use glib's
- g_utf8_strchr.
-
- * gui/dialogs/delete-comp.c: removed non-existant headers. Use
- GtkStock instead of GnomeStock.
-
- * gui/dialogs/e-delegate-dialog.c: converted to BonoboActivation.
- (e_delegate_dialog_construct): adapted to changes in glade_xml_new.
-
-2002-11-07 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/cal.[ch]: converted to BonoboObject.
- (impl_Cal_get_query): bonobo_object_unref the query returned by
- cal_backend_get_query if we can't duplicate it.
-
- * pcs/query.[ch]:
- * pcs/cal-factory.[ch]: converted to BonoboObject.
-
- * pcs/query-backend.[ch]:
- * pcs/cal-backend-file.[ch]:
- * pcs/cal-backend.[ch]: GObjectify.
-
-2002-11-06 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/cal-prefs-dialog.c: #include gtkoptionmenu.h.
- (cal_prefs_dialog_new): adapted to changes in glade_xml_new.
-
- * gui/dialogs/event-page.h:
- * gui/dialogs/meeting-page.h:
- * gui/dialogs/recurrence-page.h:
- * gui/dialogs/schedule-page.h:
- * gui/dialogs/task-details-page.h:
- * gui/dialogs/task-page.h:
- * gui/cal-prefs-dialog.h: use correctly the macros.
-
- * gui/dialogs/cancel-comp.c:
- * gui/dialogs/changed-comp.c:
- * gui/dialogs/comp-editor-page.c:
- * gui/gnome-cal.h: removed non-existent headers.
-
- * gui/dialogs/comp-editor.c: remove non-existent headers.
- (close_dialog): gtk_widget_destroy the widget.
- (setup_widgets, comp_editor_merge_ui): use BonoboWindow correctly.
- (comp_editor_set_cal_client, comp_editor_send_comp,
- comp_editor_edit_comp): use G_OBJECT_GET_CLASS for
- getting the class of an object.
-
- * gui/dialogs/comp-editor-page.c (comp_editor_page_class_init):
- use g_signal_* functions.
-
- * gui/dialogs/comp-editor-util.c: converted to BonoboActivation.
-
- * gui/dialogs/comp-editor.h: #include bonobo-window.h, not
- bonobo-win.h.
-
-2002-11-06 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/alarm-notify/GNOME_Evolution_Calendar_AlarmNotify.server.in:
- * gui/GNOME_Evolution_Calendar.server.in: renmaed .oaf.in files.
-
- * gui/alarm-notify/Makefile.am:
- * gui/Makefile.am: fixed rules for .server files.
-
-2002-11-06 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/dialogs/comp-editor-util.[ch]
- (comp_editor_connect_contacts_changed): don't return a
- Bonobo_EventSource_ListenerId, since it does not exist anymore,
- and was not even being used.
-
- * gui/e-timezone-entry.h: use GLib macros.
-
- * gui/dialogs/*.glade:
- * gui/alarm-notify/*.glade:
- * gui/*.glade: converted to Glade2 format.
-
-2002-11-05 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/dialogs/alarm-options.c (alarm_options_dialog_run): adapted to
- to new glade_xml_new signature.
-
- * gui/calendar-model.h:
- * gui/dialogs/comp-editor-page.h:
- * gui/dialogs/alarm-page.[ch]: removed non-existant header files.
-
- * gui/dialogs/comp-editor-util.h: added missing headers.
-
-2002-11-05 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/cal-backend.c: use libxml2 headers.
-
- * gui/alarm-notify/Makefile.am:
- * gui/dialogs/Makefile.am:
- * gui/Makefile.am: s/XML_I18N/INTLTOOL. Fixed execution of
- $(ORBIT_IDL).
-
- * gui/alarm-notify/alarm-notify.[ch]: converted to BonoboObject.
-
- * gui/alarm-notify/alarm-notify-dialog.c: compilation fixes.
- (alarm_notify_dialog): adapted to new glade_xml_new signature.
-
- * gui/alarm-notify/alarm-queue.c: ported to BonoboActivation and
- GtkStock and GtkDialog.
-
- * gui/alarm-notify/notify-main.c: ported to BonoboActivation and
- use GObject functions instead of GtkObject ones.
-
- * gui/alarm-notify/save.h: removed BonoboConfig related functions.
-
- * gui/alarm-notify/config-data.c: use GObject functions instead of
- GtkObject ones.
-
- * TODO.port: added file for keeping track of disabled things while we
- port.
-
-2002-11-04 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-util/cal-util-marshal.list: added new marshallers.
-
- * cal-client/cal-client.c (get_objects_atomically): fixed calls to
- g_signal_handler_disconnect_by_func.
- (cal_client_class_init): fixed typos.
-
- * cal-client/cal-client-multi.[ch]:
- * cal-client/cal-client-types.c:
- * cal-client/cal-query.[ch]: ported to GObject.
-
- * cal-client/cal-listener.[ch]: converted to BonoboObject.
-
- * cal-client/Makefile.am:
- * pcs/Makefile.am: fixed flags for orbit-idl
-
-2002-11-04 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-util/Makefile.am:
- * cal-util/cal-util-marshal.list: added marshallers.
-
- * cal-client/cal-client.[ch]: ported to GObject.
-
-2002-11-04 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-util/cal-component.[ch]: ported to GObject.
-
- * cal-util/cal-util.c (cal_util_generate_alarms_for_comp): use
- g_object_* instead of gtk_object_*.
-
-2002-11-03 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-client/cal-client.c (get_default_uri): use EConfigListener
- instead of BonoboConfig.
-
- * cal-client/cal-client.c:
- * cal-client/cal-listener.[ch]:
- * cal-client/query-listener.c: warning free.
-
-2002-11-03 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/cal-backend-util.[ch]: don't use BonoboConfig, but
- EConfigListener.
-
- * gui/calendar-config.c: use /apps/Evolution prefix for all
- configuration keys.
-
-2002-10-31 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-util/cal-component.[ch]:
- * cal-util/cal-recur.h:
- * cal-util/cal-util.[ch]:
- * cal-client/cal-client.h:
- * cal-client/cal-client-multi.h:
- * cal-client/cal-client-types.[ch]:
- * cal-client/cal-listener.h
- * cal-client/cal-query.[ch]:
- * cal-client/query-listener.h:
- * pcs/cal.h:
- * pcs/cal-backend.[ch]:
- * pcs/cal-backend-file.h:
- * pcs/cal-backend-util.h:
- * pcs/cal-common.h:
- * pcs/cal-factory.h:
- * pcs/query.[ch]:
- * pcs/query-backend.[ch]: started GNOME 2 porting.
- cal-util, cal-client and pcs compiled ok.
-
- * cal-client/cal-client.c (cal_client_construct):
- * pcs/cal-factory.c: use b-a instead of OAF and bonobo-config
- instead of bonobo-conf.
-
-2002-10-29 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/gnome-cal.c (backend_died_cb): cleaned up the status bar
- messages for all widgets.
-
-2002-10-24 JP Rosevear <jpr@ximian.com>
-
- * gui/e-itip-control.c (init): initialize new values
- (clean_up): free new values
- (find_my_address): if we have a delegator address, use it instead
- (write_html): display delegator info to user
- (show_current_event): if we have a calendar uri, use that and
- describe the event differently
- (show_current_todo): ditto
- (show_current): search for delegator X properties
- (e_itip_control_set_delegator_address): accessor
- (e_itip_control_get_delegator_address): ditto
- (e_itip_control_set_delegator_name): ditto
- (e_itip_control_get_delegator_name): ditto
- (e_itip_control_set_calendar_uri): ditto
- (e_itip_control_get_calendar_uri): ditto
-
- * gui/e-itip-control.h: add protos
-
- * gui/itip-utils.c (comp_from): use the first attendee as the from
- address for things other than request, cancel and add (use
- organizer) and publish (use default address)
-
-2002-10-23 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #32613
-
- * gui/component-factory.c (sc_user_create_new_item_cb): use the
- default calendar/tasks folder to activate the component editor.
- (get_data_uri): deal correctly with the URIs being used.
-
-2002-10-23 JP Rosevear <jpr@ximian.com>
-
- * gui/e-itip-control.c (show_current): fix warning
-
-2002-10-22 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #32371
-
- * pcs/query.c (start_cached_query_cb): CORBA_exception_init the
- CORBA_Environment before using it.
-
-2002-10-22 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/cal-factory.c (lookup_backend): use NULL for pointer instead of
- FALSE.
-
-2002-10-22 JP Rosevear <jpr@ximian.com>
-
- * gui/itip-utils.c (get_address): use e_config_listener_* to get
- values
- (itip_addresses_get): ditto
- (itip_addresses_get_default): ditto
-
- * gui/calendar-model.c (calendar_model_value_to_string): don't
- send back a null string (affects if it is the group header)
- (calendar_model_init): pre load config database info so we don't
- do corba calls during draws
-
- Fixes #32276
-
-2002-10-17 JP Rosevear <jpr@ximian.com>
-
- * gui/gnome-cal.c (gnome_calendar_construct): fix c/p type
-
-2002-10-17 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/recurrence-page.c (fill_ending_date): if the value
- is a datetime, convert it to a date
-
- * gui/itip-utils.c (comp_compliant): convert an UNTIL date value
- to a datetime value
-
- * cal-util/cal-component.c (cal_component_has_simple_recurrence):
- check to see if the component recurrences meet our definition of
- "simple"
-
- * cal-util/cal-component.h: new proto
-
-2002-10-17 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/dialogs/recurrence-page.c (fill_component): changed to have a
- gboolean return type, which is what it's supposed to do.
- (recurrence_page_fill_component): return the result from
- fill_component.
-
- * gui/dialogs/comp-editor-page.h: fixed typo in function prototype.
-
-2002-10-11 JP Rosevear <jpr@ximian.com>
-
- * gui/gnome-cal.c
- (gnome_calendar_on_date_navigator_selection_changed): try to
- preserve the work week view setting if it makes sense
- (set_view): don't update the info again based on our view change
- call
-
- Fixes #16036
-
-2002-10-08 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #11434
-
- * gui/dialogs/comp-editor-page.[ch]
- (comp_editor_page_display_validation_error): new function.
-
- * gui/dialogs/event-page.c (event_page_fill_component):
- * gui/dialogs/recurrence-page.c (fill_component):
- * gui/dialogs/task-details-page.c (task_details_page_fill_component):
- * gui/dialogs/task-page.c (task_page_fill_component): added
- checks for all date values, and return FALSE if we find
- some invalid date/times.
-
- * gui/dialogs/comp-editor.c (save_comp): activate the page that
- returns error in fill_component.
-
-2002-10-08 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/cal-prefs-dialog.c
- (cal_prefs_dialog_create_time_edit): set the 24 hour format
- initially
-
- Fixes #31812
-
-2002-10-08 JP Rosevear <jpr@ximian.com>
-
- * gui/e-week-view.c: remove pilot settings from contextual menu
-
- * gui/e-day-view.c: ditto
-
-2002-10-07 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #31774
-
- * gui/dialogs/alarm-options.c (dalarm_widgets_to_alarm,
- palarm_widgets_to_alarm): use correct pointer in loop.
-
-2002-10-07 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/cal-prefs-dialog.c (setup_changes): cast the correct
- item
-
-2002-10-07 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes crash in #19159
-
- * gui/alarm-notify/alarm-queue.c (lookup_queued_alarm): don't crash if
- we don't find the queued alarm in the internal list.
- (alarm_trigger_cb, create_snooze, display_notification,
- audio_notification, procedure_notification, remove_queued_alarm):
- check return value from lookup_queued_alarm.
-
-2002-10-04 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #15892
-
- * idl/evolution-calendar.idl: added notifyErrorOccurred method to
- the Listener interface, so that backends can notify clients of errors
- that can't be reported otherwise.
-
- * pcs/cal.[ch] (cal_notify_error): new function.
-
- * pcs/cal-backend-file.c (save): made to save to temporary file and
- then moved to the correct file, so that we don't lose any data if
- there's a problem while saving.
- (notify_error): new function for notifying error messages to clients.
-
- * cal-client/cal-listener.[ch]: added new callback function for getting
- error messages from backends.
- (impl_notifyErrorOccurred): new method implementation.
- (cal_listener_class_init): initialize new epv member.
- (cal_listener_init, cal_listener_destroy, cal_listener_construct,
- cal_listener_new): initialize new function pointer.
-
- * cal-client/cal-client.[ch]: adapted to changes in CalListener class.
- (cal_client_class_init): added "backend_error" signal to CalClient class.
- (backend_error_cb): callback for "error_occurred" signal on the CalListener,
- which just emits the "backend_error" signal of CalClient.
-
- * gui/gnome-cal.c (gnome_calendar_construct): connect to "backend_error"
- signal on the CalClient's we create.
- (backend_error_cb): display error message on error from backend.
-
- * gui/e-tasks.c: likewise.
-
-2002-10-02 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/alarm-notify/notify-main.c (alarm_notify_factory_fn): removed
- unneeded g_assert which was preventing the alarm daemon to
- start correctly in some cases.
-
-2002-10-02 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #30057
-
- * cal-client/cal-client.c (cal_client_is_read_only): added check
- of the status of the client before trying to make CORBA calls.
-
- * gui/calendar-commands.c (sensitize_calendar_commands,
- sensitize_taskpad_commands):
- * gui/tasks-control.c (sensitize_commands):
- * gui/dialogs/event-editor.c (set_menu_sens):
- * gui/dialogs/task-editor.c (set_menu_sens):
- * gui/e-calendar-table.c (e_calendar_table_on_right_click):
- * gui/e-day-view.c (e_day_view_on_event_right_click):
- * gui/e-week-view.c (e_week_view_show_popup_menu): take into account
- the read-onlyness of clients to disable/enable menu items.
-
-2002-10-01 Rodrigo Moya <rodrigo@ximian.com>
-
- * idl/evolution-calendar.idl: added isReadOnly method to Cal
- interface.
-
- * pcs/cal.c (impl_Cal_is_read_only): new method implementation.
-
- * pcs/cal-backend.[ch]: added is_read_only method to CalBackend class.
- (cal_backend_is_read_only): new function.
-
- * pcs/cal-backend-file.c (cal_backend_file_is_read_only): new method.
- (cal_backend_file_class_init): set new signal's virtual method.
-
- * cal-client/cal-client.[ch] (cal_client_is_read_only): new function.
-
-2002-10-01 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #15710
-
- * gui/dialogs/alarm-page.c (alarm_page_init): added a
- X-EVOLUTION-NEEDS-DESCRIPTION property, so that we later set it
- correctly if it hasn't been set in the meanwhile (editing options for
- the alarm).
-
- * gui/dialogs/alarm-options.c (dalarm_widgets_to_alarm,
- palarm_widgets_to_alarm): removed X-EVOLUTION-NEEDS-DESCRIPTION
- property from alarms every time we set the description of the alarm.
-
-2002-10-01 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #30290
-
- * importers/icalendar-importer.c (process_item_fn): return a status of
- BUSY rather than NOT_READY, to avoid the display of the error message.
-
-2002-09-30 JP Rosevear <jpr@ximian.com>
-
- * conduits/calendar/calendar-conduit.c
- (calconduit_load_configuration): load multi_day_split
- (calconduit_save_configuration): save it
- (calconduit_dupe_configuration): copy it
- (e_cal_gui_new): create gui for it
- (e_cal_gui_fill_widgets): fill gui with value
- (e_cal_gui_fill_config): get value from gui and store in config
- (e_calendar_context_destroy): destroy new_cfg and gui properly
- (process_multi_day): skip item if its multi-day and we don't want
- to split
- (fill_widgets): fill local config widgets
- (create_settings_window): create local config widgets
- (save_settings): fill config from local widgets
-
- Fixes #23763
-
-2002-09-30 Aaron Weber <aaron@ximian.com>
-
- * gui/e-itip-control.c (update_item): adjust string on line 1609
- and 1517.
-
- * gui/dialogs/alarm-options.glade: rephrase string on line 270
-
-2002-09-27 Dan Winship <danw@ximian.com>
-
- * gui/calendar-commands.c (pixmaps): Remove "/Toolbar/New" and
- "/Toolbar/NewTask" since they're not there any more. Kills some
- bonobo-ui spewage.
-
-2002-09-26 Dan Winship <danw@ximian.com>
-
- Non-Connector part of #29334 (meeting created by a delegate in the
- delegator's calendar should have the delegator as Organizer).
-
- * idl/evolution-calendar.idl: add Cal_getEmailAddress, to return
- the email address associated with a backend (if any).
-
- * pcs/cal-backend.c (cal_backend_get_email_address): New.
-
- * pcs/cal-backend-file.c (cal_backend_file_get_email_address):
- Return NULL (for now).
-
- * pcs/cal.c (impl_Cal_get_email_address): Implement this by
- calling cal_backend_get_email_address and returning a NotFound
- exception if it returns NULL.
-
- * cal-client/cal-client.c (cal_client_get_email_address): New.
- (cal_client_init, cal_client_destroy, etc): initialize/free
- email_address
-
- * gui/dialogs/event-editor.c (event_editor_construct): Split this
- out of event_editor_init. Take and set a CalClient.
- (event_editor_new): Take a CalClient.
-
- * gui/dialogs/task-editor.c (task_editor_construct,
- task_editor_new): Likewise.
-
- * gui/dialogs/meeting-page.c (meeting_page_new,
- meeting_page_construct): Take a CalClient and call
- cal_client_get_email_address to find the default organizer
- address. (Also fix a bug if the default account's name has
- non-ASCII characters.)
-
- * gui/itip-utils.c (comp_from): New. When sending a REQUEST or
- CANCEL, use the Organizer as the From address.
- (itip_send_comp): Call comp_from and pass the result to
- Composer_setHeaders.
-
- * gui/comp-editor-factory.c (edit_existing, edit_new): Pass the
- CalClient to event_editor_new/task_editor_new
-
- * gui/e-calendar-table.c (open_task): Likewise.
-
- * gui/e-tasks.c (e_tasks_new_task): Likewise.
-
- * gui/gnome-cal.c (gnome_calendar_edit_object,
- gnome_calendar_new_task): Likewise.
-
-2002-09-26 JP Rosevear <jpr@ximian.com>
-
- * gui/e-meeting-model.c (set_value_at): only change the attendee
- value if it isn't empty
-
-2002-09-26 Rodrigo Moya <rodrigo@ximian.com>
-
- Should fix once for all #24210
-
- * idl/evolution-calendar.idl: changed the notifyObjUpdated method
- of the QueryListener interface accept a list of UIDs.
-
- * cal-client/query-listener.[ch] (impl_notifyObjUpdated): likewise for
- the QueryListener class.
-
- * cal-client/cal-query.c (obj_updated_cb): changed to adapt the
- multiple-id's received in the QueryListener class' signal to the
- one-by-one update notification of the public CalQuery class, thus
- keeping the changes needed for this minimal.
-
- * pcs/query.c (add_component, start_cached_query_cb): changed to
- send sequences of UIDs.
-
-2002-09-25 Dan Winship <danw@ximian.com>
-
- * gui/component-factory.c (folder_types): Add "calendar/public"
- and "tasks/public".
- (type_is_calendar, type_is_tasks): New utility functions
- (create_view, create_folder, remove_folder, xfer_folder,
- sc_user_create_new_item_cb): Use type_is_calendar/type_is_tasks
-
- * importers/icalendar-importer.c (get_uri_from_folder_path): allow
- importing into public calendar/task folders too.
-
- * gui/e-itip-control.c: Note that it's intentional that we use
- "calendar" and "tasks" here instead of "calendar/*" and "tasks/*".
- (31032)
-
-2002-09-25 JP Rosevear <jpr@ximian.com>
-
- * gui/itip-utils.c (itip_send_comp): if the item being sent is not
- a meeting, send it as a mixed item with a description and the
- calendar text in an attachment
-
- Fixes #30638
-
-2002-09-25 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #27961
-
- * pcs/cal-backend-file.c (cal_backend_file_update_object): set the
- LAST-MODIFIED time of the components when we save them.
-
-2002-09-24 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/cal-backend-file.c (cal_backend_file_get_timezone_object,
- cal_backend_file_get_timezone): return a builtin timezone if we
- don't find the timezone in our component.
-
-2002-09-24 JP Rosevear <jpr@ximian.com>
-
- * conduits/calendar/calendar-conduit.c (comp_from_remote_record):
- make sure the start/end for no time palm events are DATE values,
- tidy code slightly
-
- Fixes #21631
-
-2002-09-24 JP Rosevear <jpr@ximian.com>
-
- * conduits/calendar/calendar-conduit.c (process_multi_day):
- convert to date values if the original start and end were both
- dates
-
-2002-09-24 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-client/cal-query.c (cal_query_destroy): unref the query
- since now the query object on the server keeps a copy of it and
- must know when the listener is no longer valid.
-
- * pcs/query.c (listener_died_cb): unref the QueryListener object.
- (query_construct): create an EComponentListener for the non-cached
- queries' listeners also.
-
-2002-09-23 JP Rosevear <jpr@ximian.com>
-
- * conduits/todo/Makefile.am: add libeutil to the link
-
- * conduits/calendar/Makefile.am: ditto
-
-2002-09-23 Dan Winship <danw@ximian.com>
-
- * pcs/cal.c (imple_Cal_update_objects, impl_Cal_remove_object):
- fix non-ANSI switch statements.
-
- * gui/e-meeting-model.c (is_cell_editable, value_is_empty,
- process_free_busy_comp): Likewise
-
- * gui/itip-utils.c (comp_compliant): Likewise.
-
-2002-09-23 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/main.c (launch_alarm_daemon): install an idle callback that will
- start the alarm daemon.
- (launch_alarm_daemon_cb): actually activate the alarm daemon here.
-
- * pcs/query.c (start_cached_query_cb): remove timeout function always
- and re-add it if the query is in progress.
-
-2002-09-23 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/query.c (start_cached_query_cb): move success notification code
- to its own code block, since it was being run for parse errors also.
- Also, remove all traces of the query from the cache if there is an
- error. Also, use GINT_TO_POINTER instead of GPOINTER_TO_INT.
-
-2002-09-23 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #28310
-
- * gui/alarm-notify/save.c (save_notification_time): only save the
- new notification time if it is bigger than the already saved one.
- This should avoid some reminders showing up twice.
-
-2002-09-20 JP Rosevear <jpr@ximian.com>
-
- * gui/comp-util.c (cal_comp_is_on_server): check to see if the
- component is already on the server or not
-
- * gui/comp-util.h: change proto
-
- * gui/e-week-view.c (e_week_view_on_editing_stopped): only delete
- the event if the summary is empty and the component is not already
- on the server
-
- * gui/e-day-view.c (e_day_view_on_editing_stopped): same
-
- Fixes #14111
-
-2002-09-20 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/meeting-page.c (meeting_page_fill_widgets): set the
- deleted attendees array to size 0 after we clean it up
-
- Fixes #30479
-
-2002-09-20 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/query.c (parse_sexp): remove the query from the cache if it
- failed.
- (start_cached_query_cb): notify of errors in the query.
-
-2002-09-19 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/query.c: added a list of EComponentListener's to control the
- lifetime of the listeners.
- (query_init): initialize new member.
- (query_destroy): free new member.
- (start_cached_query_cb): create a EComponentListener for the new
- listener being added.
-
-2002-09-19 Rodrigo Moya <rodrigo@ximian.com>
-
- More fixes for #24210
-
- * pcs/query.c: added list of cached queries and changed the Query
- class to work with several listeners, not only one.
- (query_init): initialize new members.
- (query_destroy): free new members.
- (add_component, remove_component, parse_sexp, match_component,
- process_components_cb): notify all listeners.
- (notify_uid_cb, start_cached_query_cb): implemented integration of
- cached queries.
- (query_new): search the query in the cache before creating a new
- one. And if we create a new one, store it in the cache.
-
-2002-09-19 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/recurrence-page.c (simple_recur_to_comp): bump the
- month_num by 1 because it indexs at 0
- (recurrence_page_fill_widgets): lower the month_num by one as above
-
- Fixes #30381
-
-2002-09-17 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #26362
-
- * gui/e-itip-control.c (show current): add a default reminder if
- default reminders are set in the configuration.
-
-2002-09-11 JP Rosevear <jpr@ximian.com>
-
- * gui/e-day-view.c (e_day_view_on_top_canvas_button_press): keep
- the selection if we right click in it (but not on an appointment)
- (e_day_view_on_main_canvas_button_press): ditto
-
- * gui/e-week-view.c (e_week_view_on_button_press): same
-
-2002-09-11 JP Rosevear <jpr@ximian.com>
-
- * gui/e-week-view.c (e_week_view_new_appointment): create a new
- appointment based on the selection
- (e_week_view_on_button_press): use above
- (e_week_view_on_new_appointment): ditto
- (e_week_view_on_new_meeting): ditto
-
- Fixes #18162
-
-2002-09-10 JP Rosevear <jpr@ximian.com>
-
- * gui/comp-editor-factory.c (get_default_event): duh, don't
- blindly increment the hour without adjusting for the day
- boundaries
-
- Fixes #29983
-
-2002-09-10 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #24032
-
- * gui/e-itip-control.c (init): don't get servers here, since we don't
- know the type of the component(s) to be loaded.
- (show_current): get servers here.
- (destroy): only free stuff that needs to be freed.
-
-2002-09-09 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/gnome-cal.c (client_cal_opened_cb): display status messages for
- all operations we make, so that when using remote slow backends, so
- that users have always indication of what's happening.
-
-2002-09-06 JP Rosevear <jpr@ximian.com>
-
- * gui/gnome-cal.c (gnome_calendar_edit_object): kill warning
-
- * gui/e-week-view.h: new proto
-
- * gui/e-week-view.c (e_week_view_set_selected_time_range_visible):
- select a range of time in the currently visible area, if out side
- the visible area, select as much as possible
- (e_week_view_on_text_item_event): call above
-
- * gui/e-week-view-event-item.c
- (e_week_view_event_item_button_press): call above
-
- * gui/e-day-view.c
- (e_day_view_set_selected_time_range_in_top_visible): select a
- range of time in the currently visible area, if out side the
- visible area, select as much as possible
- (e_day_view_set_selected_time_range_visible): the same for the
- main canvas
- (e_day_view_on_long_event_button_press): call above
- (e_day_view_on_event_button_press): ditto
-
-2002-09-05 JP Rosevear <jpr@ximian.com>
-
- * gui/itip-utils.c (itip_send_comp): don't try to send via the
- server if we are publishing; don't bail out on a 0 length to list
- if we are publishing
-
-2002-09-05 Anna Marie Dirks <anna@ximian.com>
-
- * gui/GNOME_Evolution_Calendar.oaf.in: Changed the description of
- the calendar/tasks page of the settings dialog, to be hopefully
- more descriptive and less awkwardly worded.
-
-
-2002-09-05 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-day-view.c (e_day_view_on_drag_data_get): added support for
- text/x-calendar targets, in which case a VCALENDAR component, with
- full timezone information is returned.
-
-2002-09-04 JP Rosevear <jpr@ximian.com>
-
- * gui/gnome-cal.c (gnome_calendar_destroy): don't listen to client
- signals after we get destroyed
-
- Fixes #17036
-
-2002-09-04 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/event-editor.c (event_editor_send_comp): bail out if
- we couldn't send the cancel
-
- * gui/dialogs/task-editor.c (task_editor_send_comp): ditto
-
- * gui/dialogs/comp-editor.c (save_comp_with_send): indicate send
- status
- (real_send_comp): return success/fail, only resave the component a
- if we successfully sent
- (comp_editor_send_comp): return success/fail
-
- * gui/itip-utils.h: update proto
-
- * gui/itip-utils.c (itip_send_comp): return true if we sent the
- message
-
-2002-09-04 JP Rosevear <jpr@ximian.com>
-
- * gui/itip-utils.c (comp_server_send): provide error message
- param, give a dialog with the message if we get a busy result;
- return TRUE if we succeed
- (itip_send_comp): bail out if we had a problem sending via the
- server
-
- * cal-client/cal-client.c (cal_client_send_object): pass back
- error message if we get the busy exception in the new param
-
- * cal-client/cal-client.h: update proto
-
- * pcs/cal.c (impl_Cal_send_object): dump backend error message
- into Busy exception
-
- * pcs/cal-backend.h: update proto
-
- * pcs/cal-backend.c (cal_backend_send_object): take/pass new error
- message parameter
-
- * pcs/cal-backend-file.c (cal_backend_file_send_object): take new param
-
- * idl/evolution-calendar.idl: add errorMsg to Busy exception
-
-2002-09-04 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component-factory.c (create_object): Pass NULL as
- @unpopulate_folder_context_menu_fn to
- evolution_shell_component_new().
-
-2002-09-03 JP Rosevear <jpr@ximian.com>
-
- * gui/itip-utils.c (comp_compliant): don't make the reply
- component minimal
-
- Fixes #28956
-
-2002-08-30 JP Rosevear <jpr@ximian.com>
-
- * gui/itip-utils.c (itip_send_comp): make the sure to list is 0
- length before sending via imip
-
- Fixes #29624
-
-2002-08-30 Mike Kestner <mkestner@ximian.com>
-
- * gui/dialogs/event-page.c:
- * gui/dialogs/task-page.c: use bonobo_object_release_unref to release
- the remote SelectNames component, not CORBA_Object_release.
-
-2002-08-29 JP Rosevear <jpr@ximian.com>
-
- * gui/e-day-view.c (e_day_view_on_top_canvas_button_press): select
- the top canvas if the user right-clicks on it
- (e_day_view_on_main_canvas_button_press): select the row the user
- is right-clicking on
- (e_day_view_on_long_event_button_press): select the top canvas if
- the user right-clicks on an event there
- (e_day_view_on_event_button_press): select the relevant rows if
- the user right-clicks on an event
- (e_day_view_set_selected_time_range_in_top): select a number of
- days in the top canvas
-
- * gui/e-week-view.c (e_week_view_on_button_press): select the day
- the user is right-clicking on
- (e_week_view_on_text_item_event): select the corresponding time
- range when showing the contextual menu for an event
-
- * gui/e-week-view-event-item.c
- (e_week_view_event_item_button_press): select the corresponding
- time range when showing the contextual menu for an event
-
- Fixes #14660
-
-2002-08-28 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-day-view.c:
- * gui/e-week-view.c: added missing header file.
-
-2002-08-28 Dan Winship <danw@ximian.com>
-
- * gui/GNOME_Evolution_Calendar.oaf.in: Add an
- evolution:shell_component_launch_order and rename
- evolution:shell_component_icon.
-
-2002-08-27 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/calendar-config.c: use EConfigListener instead of direct access
- to the bonobo-conf database.
- (calendar_config_init): create the EConfigListener here, and install
- an atexit function to unref the config listener object.
- (config_read, property_change_cb, calendar_config_write,
- calendar_config_write_on_exit): removed unneeded functions.
- (calendar_config_get_*, calendar_config_set_*): changed to make use of
- EConfigListener directly.
-
- * gui/main.c (main): removed call to calendar_config_write_on_exit.
-
- * gui/dialogs/cal-prefs-dialog.c (update_config): removed call to
- calendar_config_write.
-
-2002-08-26 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #12326
-
- * gui/alarm-notify/config-data.c (ensure_inited): create a
- EConfigListener for configuration access.
- (do_cleanup): g_atexit installed function, to clean up configuration
- database resources.
- (config_data_get_timezone): retrieve the configuration for the
- EConfigListener object.
- (config_data_get_listener): new function.
-
- * gui/alarm-notify/save.c (get_config_db, discard_config_db): removed.
- Use EConfigListener instead.
- (save_notification_time, get_saved_notification_time,
- save_calendars_to_load, get_calendars_to_load, save_blessed_program,
- is_blessed_program): use EConfigListener.
-
- * gui/alarm-notify/notify-main.c (init_alarm_notify_service): removed.
- (alarm_notify_factory_fn): create here the alarm_notify_service if it
- hasn't been created yet.
- (load_calendars): likewise.
- (main): don't call init_alarm_notify_service.
-
-2002-08-22 JP Rosevear <jpr@ximian.com>
-
- * gui/e-meeting-model.c (process_section): if its a
- non-participant, add it as a resource to match dialog label
- (set_value_at): if the type is set to be a resource, switch the
- role to non-participant by default
-
-2002-08-22 JP Rosevear <jpr@ximian.com>
-
- * gui/calendar-model.c (set_completed): if the value given is a
- date, convert to a time in the current zone
-
-2002-08-20 JP Rosevear <jpr@ximian.com>
-
- * gui/tasks-control.c (tasks_control_activate): don't set the
- tasks ui component until the container is set, remove unused
- pixmaps
-
-2002-08-19 JP Rosevear <jpr@ximian.com>
-
- * gui/e-meeting-model.c (destroy): disconnect destroy signal
- callbacks on tables
-
- Fixes #28231
-
-2002-08-19 JP Rosevear <jpr@ximian.com>
-
- * gui/itip-utils.c (comp_toplevel_with_zones): clone the ical
- component before adding it
-
- Fixes #29061
-
-2002-08-19 JP Rosevear <jpr@ximian.com>
-
- * gui/comp-editor-factory.c (get_default_event): make sure to get
- the date in the current zone, not at UTC
-
- Fixes #17692
-
-2002-08-19 JP Rosevear <jpr@ximian.com>
-
- * gui/e-itip-control.c (set_date_label): stop adding redundant
- information for start/end/due/complete times
- (write_html): convert newlines properly and escape characters for
- summary, location, description; put text information on separate
- line from bolded title to make it look nicer when there are line
- breaks
-
- Fixes #26964
-
-2002-08-16 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-client/cal-client.[ch]: added internal EComponentListener
- object, to listen for the activated Cal.
- (cal_client_class_init): added "backend_died" signal.
- (cal_client_destroy): clean up component listener.
- (backend_died_cb): new callback for getting signals from the
- EComponentListener.
- (cal_opened_cb): setup component listener.
-
- * cal-client/Makefile.am: added libetuil to needed LIBS.
-
- * gui/gnome-cal.c (backend_died_cb): new callback.
- (gnome_calendar_construct): connect to "backend_died" signal
- on all CalClient's we create.
-
-2002-08-14 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/cal-prefs-dialog.c (init_widgets): listen for the
- time editors to change
- (cal_prefs_dialog_start_of_day_changed): make sure the start is
- never after the end
- (cal_prefs_dialog_end_of_day_changed): make sure the end is never
- after the start
-
- * gui/e-meeting-time-sel.c
- (e_meeting_time_selector_set_working_hours): make sure to show a
- minimum of 1 hour for work day
-
- * gui/e-day-view-main-item.c (e_day_view_main_item_draw):
- calculate the work/not working color boxes to the nearest pixel,
- rather the the nearest time division
-
- Fixes #10286, #26285
-
-2002-08-13 Dan Winship <danw@ximian.com>
-
- * gui/e-itip-control.c: Remove a bunch of old #if 0 code.
- (update_item): Set X-MICROSOFT-CDO-REPLYTIME here.
-
- * gui/itip-utils.c (comp_toplevel_with_zones): Don't set it here.
-
- * cal-util/cal-component.c (ensure_mandatory_properties): Use
- icaltime_current_time_with_zone rather than rolling our own.
- (cal_component_strip_errors): Remove unused variable.
-
-2002-08-13 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/gnome-cal.c (gnome_calendar_open): set status message on
- ECalendarTable when opening the tasks.
- (client_cal_opened_cb): set ECalendarTable status message to NULL
- when we open the tasks folder. Also, clear up calendar status message
- in all cases, not only if the folder was opened successfully.
-
-2002-08-13 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/gnome-cal.c (gnome_calendar_open): set status message to NULL
- if there is an error opening the calendar.
- (client_cal_opened_cb): set status message to NULL only when we have
- successfully opened the main CalClient.
-
-2002-08-09 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/comp-editor.c (real_send_comp): set the editor to
- changed so the item actually gets saved
-
-2002-08-08 JP Rosevear <jpr@ximian.com>
-
- * gui/itip-utils.c (users_has_attendee): check for an attendee in
- the list
- (comp_to_list): only add the user if they aren't on the list
- (comp_server_send): don't remove the users, pass back the list
- (itip_send_comp): send to server before doing comp_minimal
-
- * gui/dialogs/comp-editor.c (real_send_comp): edit and save the
- updated comp
-
- * pcs/cal.c (impl_Cal_send_object): copy the correct item to pass
- back
-
-2002-08-08 Dan Winship <danw@ximian.com>
-
- * pcs/query-backend.c (query_backend_new): Initialize
- loaded_backends before using it. (Just kills off a harmless
- g_warning.)
-
-2002-08-08 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #15710
-
- * cal-util/cal-component.[ch]
- (cal_component_alarm_get_icalcomponent): new function for getting
- the icalcomponent from a CalComponentAlarm.
-
- * gui/comp-util.c (cal_comp_event_new_with_defaults): added
- X-EVOLUTION-NEEDS-DESCRIPTION property to the default reminder
- alarm, so that we can identify it when saving the component.
-
- * gui/dialogs/alarm-page.c (alarm_page_fill_component): if the
- alarm has the X-EVOLUTION-NEEDS-DESCRIPTION property, set the
- description to be the same as of the component.
-
-2002-08-07 JP Rosevear <jpr@ximian.com>
-
- * pcs/cal-backend-file.c (cal_backend_file_send_object): just
- return the object untouched since we don't send anything
-
- * pcs/cal-backend.c (cal_backend_remove_object): call virtual method
-
- * pcs/cal-backend.h: add send result codes, new proto
-
- * pcs/cal.c (impl_Cal_send_object): implement sendObject corba call
- (cal_class_init): add to epv
-
- * gui/itip-utils.c (comp_toplevel_with_zones): utility function to
- create icalcomponent with necessary timezone info
- (comp_has_attendee): see if attendee is in the attendee list
- (comp_server_send): use above and remove attendees if the server
- sends them
-
- * gui/e-itip-control.c (show_current_todo): remove unused var
-
- * idl/evolution-calendar.idl: add Busy exception and
-
- * cal-client/cal-client.c (cal_client_send_object): send object
- via the server (if the server can)
-
- * cal-client/cal-client.h: add send results and new proto
-
-2002-08-05 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/query-backend.[ch] (query_backend_get_object_component): new
- function.
- (query_backend_get_uids): new function.
- (query_backend_new): create the static GHashTable if it hasn't been
- created yet.
- (query_backend_destroy): destroy the static GHashTable if empty.
- (foreach_uid_cb): call object_updated_cb, which does everything.
-
- * pcs/query.c: make use of the new QueryBackend class.
- (query_init): initialize new private structure member.
- (query_destroy): clean up new member, without freeing it, since it is
- managed internally in query-backend.c.
- (query_construct): create a QueryBackend for the query.
-
-2002-08-04 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes the crash in #19159
-
- * gui/alarm-notify/alarm-queue.c (create_snooze): check for NULL
- pointers before using them.
-
-2002-08-02 JP Rosevear <jpr@ximian.com>
-
- * gui/e-week-view.c (e_week_view_init): don't warn if we can't use
- the small font, just set use_small_font to FALSE
-
-2002-08-02 JP Rosevear <jpr@ximian.com>
-
- * gui/e-itip-control.c (adjust_item): new util function to add
- information to an itip message that might not already be there for
- display purposes (summary, location, etc)
- (show_current_event): use above
- (show_current_todo): ditto
-
-2002-08-02 JP Rosevear <jpr@ximian.com>
-
- * gui/e-meeting-model.c (init): initialize value to corba nil
-
-2002-08-01 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component-factory.c (create_object): Use
- meeting-request-16.png instead of meeting-request.png.
-
- * gui/calendar-commands.c (pixmaps): Remove pixmaps in
- /menu/File/New/NewFirstItem/.
-
-2002-08-01 JP Rosevear <jpr@ximian.com>
-
- * gui/calendar-model.c (is_overdue): use get_due_status
- (get_color): ditto
- (get_due_status): utility function to reduce replicated code,
- handle the case where the due date is just a date
-
-2002-07-31 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/query-backend.[ch]: new class for implementing a backend cache
- for the calendar queries.
-
- * pcs/Makefile.am: added new files.
-
-2002-07-31 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component-factory.c (create_object): Change the order of the
- user creatable items a bit so that "New Appointment" and "New
- Meeting" are at the top when in a calendar folder.
-
-2002-07-31 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component-factory.c (add_creatable_item): New arg
- @folder_type, pass it to
- evolution_shell_component_add_user_creatable_item().
- (create_object): Set the right folder types for the various
- user-creatable items.
-
-2002-07-31 JP Rosevear <jpr@ximian.com>
-
- * gui/e-tasks.c (e_tasks_destroy): we no longer need to manually
- save the state
- (e_tasks_open): we no longer need to manually load the state
- (display_view_cb): attach the gal view to the table
-
- Fixes #27894
-
-2002-07-29 JP Rosevear <jpr@ximian.com>
-
- * gui/e-day-view.c (e_day_view_find_work_week_start): make sure
- that the work week view goes to the current work week if the day
- selected is before the start of the work week
-
- Fixes #20317
-
-2002-07-28 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/dialogs/task-details-page.c: fixed mapping of popdown menu
- to ICAL_STATUS_ values.
- (task_details_page_fill_widgets): when we can't set the status,
- default to ICAL_STATUS_NONE, which maps to 'Not started'. Fixed
- use of 'percent' variable, which was being used after being freed.
- (percent_complete_changed): default to ICAL_STATUS_NONE (Not Started).
-
- * gui/dialogs/task-details-page.glade: added 'Needs Action' to
- popdown menu values.
-
-2002-07-26 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-util/cal-util.[ch] (cal_util_add_timezones_from_component):
- new function for adding VTIMEZONE components to a VCALENDAR
- component.
-
- * gui/e-calendar-table.c (copy_row_cb): added VTIMEZONE components
- to resulting VCALENDAR top-level component.
-
- * gui/e-week-view.c (e_week_view_copy_clipboard): copy to the
- clipboard a top-level VCALENDAR component, with all the needed
- VTIMEZONE components.
- (e_week_view_on_copy): likewise.
-
- * gui/e-day-view.c (e_day_view_copy_clipboard): likewise.
- (e_day_view_on_copy): likewise.
-
-2002-07-26 JP Rosevear <jpr@ximian.com>
-
- * cal-client/cal-client.c (cal_client_construct): remove useless
- debug statement
-
- Probably fixes #19333
-
-2002-07-26 JP Rosevear <jpr@ximian.com>
-
- * gui/comp-editor-factory.c (impl_editExisting): focus the editor
- if it does exist, create a new one if it doesn't (not vice-versa)
-
- Fixes #23468
-
-2002-07-25 JP Rosevear <jpr@ximian.com>
-
- * gui/e-day-view.c (e_day_view_init): set large_font to NULL
- (e_day_view_style_set): calculate large font, fall back to the
- style->font if necessary
-
- Fixes #11773
-
-2002-07-24 JP Rosevear <jpr@ximian.com>
-
- * gui/e-itip-control.c (write_html): display the location in the
- itip information
-
- Fixes #24690
-
-2002-07-24 JP Rosevear <jpr@ximian.com>
-
- * gui/calendar-model.c (set_percent): set status to in progress if
- the percent is between 0 and 100
- (set_status): if the value is set to in process, change the
- percent to 50
-
- Fixes #1590
-
-2002-07-24 JP Rosevear <jpr@ximian.com>
-
- * cal-util/timeutil.c (time_day_of_year): add a day for the leap
- year only if we are currently counting Feb., not if the month
- passed in is Feb. Fixes #23446.
-
-2002-07-23 JP Rosevear <jpr@ximian.com>
-
- * gui/e-day-view.c (e_day_view_realize): use proper meeting icon
-
-2002-07-22 Dan Winship <danw@ximian.com>
-
- * pcs/Makefile.am: Split pcs-backend-file out of libpcs and build
- it as a separate (noinst) library libpcsfile.a. This gets the db3
- dependencies out of libpcs, and people trying to create a calendar
- backend shouldn't be calling functions from the existing backends
- anyway so there's no reason to install them.
-
- * cal-util/timeutil.c: Replace a bunch of old gnomecal functions
- with the functionally identical ones from Connector.
-
-2002-07-18 Rodrigo Moya <rodrigo@ximian.com>
-
- * importers/icalendar-importer.c (get_uri_from_folder_path): if
- there's an exception, continue with the next item.
-
-2002-07-08 Peter Williams <peterw@ximian.com>
-
- * cal-util/Makefile.am: Install libcal-util-static.la
- and fix the -all-static flag to make it install statically.
-
- * pcs/Makefile.am: Install libpcs.a and its headers.
-
- * pcs/cal-backend-util.h: Same sort of include namespacing fix,
- but for pcs.
-
- * pcs/cal.h:
- * pcs/query.h:
- * pcs/cal-factory.h:
- * pcs/cal-backend.h:
- * pcs/cal-backend-file.h: Same.
-
-2002-07-17 <jpr@ximian.com>
-
- * gui/calendar-model.c (calendar_model_value_at): use util
- function to see if the user is the organizer
-
- * gui/dialogs/cancel-comp.c (cancel_component_dialog): add
- deleting proto to indicate whether cancelling or deleting is the
- primary operation
-
- * gui/dialogs/cancel-comp.h: update proto
-
- * gui/dialogs/comp-editor.c (delete_cmd): offer to cancel
-
- * gui/dialogs/task-editor.c (cancel_task_cmd): call
- cancel_component_dialog with new param
-
- * gui/dialogs/event-editor.c (cancel_meeting_cmd): ditto
-
- * gui/e-week-view.c (e_week_view_on_editing_stopped): only update
- request if user is organizer
- (e_week_view_show_popup_menu): disable the meeting and meeting
- organizer mask if appropriate
- (e_week_view_delete_event_internal): offer to cancel the meeting
- (e_week_view_on_cut): ditto
- (selection_received): send request if its a meeting
-
- * gui/e-day-view.h: add meeting icon/mask
-
- * gui/e-day-view.c (e_day_view_on_event_right_click): disable the
- meeting and meeting organizer mask if appropriate
- (e_day_view_delete_event_internal): offer to cancel meeting
- (e_day_view_on_cut): ditto
- (e_day_view_finish_long_event_resize): only update request if user
- is organizer
- (e_day_view_reshape_long_event): add meeting icon to count
- (e_day_view_reshape_day_event): ditto
- (e_day_view_on_top_canvas_drag_data_received): only update request
- if user is organizer
- (e_day_view_on_main_canvas_drag_data_received): ditto
- (selection_received): offer to send meeting info
-
- * gui/e-day-view-main-item.c
- (e_day_view_main_item_draw_day_event): draw meeting icon if
- appropriate (using dummy icon atm)
-
-2002-07-14 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #8001
-
- * importers/icalendar-importer.c (connect_to_shell): new function for
- connecting the importers (both iCal and vCal) to the shell, needed for
- some information retrieval about the folders we're importing to.
- (ical_importer_new, vcal_importer_new): call connect_to_shell.
- (importer_destroy_cb): unref the shell client object.
- (get_uri_from_folder_path): retrieve the uri from the storage
- registry.
- (check_folder_type): removed.
-
- * importers/Makefile.am: included libeshell to LIBS.
-
-2002-07-12 Peter Williams <peterw@ximian.com>
-
- * pcs/cal.c: Sigh, fix for the wombat.idl -> Evolution-Wombat.idl
- rename here too. At least grep indicates that's all that needs to
- be fixed.
-
-2002-07-08 Peter Williams <peterw@ximian.com>
-
- * gui/Makefile.am (INCLUDES): Change the -I flags to get
- it to play nicely with the new Ebook header paradigm.
-
- * gui/dialogs/Makefile.am: Same.
-
- * gui/e-meeting-model.c: More of the same.
-
- * gui/dialogs/e-delegate-dialog.c:
- * gui/dialogs/e-meeting-model.c:
- * gui/dialogs/comp-editor-util.c: Fix include lines to get
- ebook headers.
-
- * pcs/Makefile.am: Same.
-
-2002-07-02 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #16034
-
- * gui/e-day-view.c (e_day_view_reshape_long_event):
- (e_day_view_reshape_day_event):
- * gui/e-day-view-main-item.c (e_day_view_main_item_draw_day_event):
- * gui/e-week-view.c (e_week_view_reshape_event_span):
- * gui/e-week-view-event-item.c (e_week_view_event_item_draw_icons):
- Don't assume all categories have icons when allocating space for
- the icons.
-
-2002-07-02 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component-factory.c (add_creatable_item): New arg @tooltip.
- Pass it to evolution_shell_component_add_user_creatable_item(),
- which now has a @tooltip arg.
- (create_object): Added tooltips.
-
-2002-07-01 JP Rosevear <jpr@ximian.com>
-
- * gui/calendar-config.c (config_read): listen for timezone config
- change
- (property_change_cb): set the timezone if it changed elsewhere
-
- * gui/main.c (init_bonobo): call bonobo_activate because we make
- bonobo related calls before the bonobo_main call
-
-2002-06-25 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #25410
-
- * gui/alarm-notify.c (AlarmNotify_removeCalendar): do proper
- cleanup on removal of clients.
- (alarm_notify_add_calendar): ditto.
-
-2002-06-27 JP Rosevear <jpr@ximian.com>
-
- * gui/itip-utils.c (comp_compliant): plug leak and actually use
- the minimal comp we create
-
-2002-06-25 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/comp-editor-page.h: add back proto
-
- * gui/dialogs/comp-editor-page.c
- (comp_editor_page_notify_needs_send): add page needs_send signal
-
- * gui/e-meeting-time-sel.c
- (e_meeting_time_selector_on_invite_others_button_draw): check to
- see if the button should be sensitive when drawing
- (e_meeting_time_selector_construct): listen for the button draw
- signal
-
- * cal-util/cal-component.c (cal_component_strip_errors): remove
- X-LIC-ERROR x properties
-
- * cal-util/cal-component.h: new proto
-
- * gui/dialogs/meeting-page.c (change_clicked_cb): set needs_send
- to true
- (meeting_page_fill_widgets): set up gui based on if the user or
- someone else is the organizer
- (meeting_page_construct): read the addresses here for the combo
- box
- (get_widgets): explicitly set the value in list values
-
- * gui/dialogs/event-editor.c (set_menu_sens): base this on the
- exist org and user org values of the comp editor
- (event_editor_edit_comp): set up editable row restrictions on the
- meeting model if the user is not an organizer, and don't set needs
- send if we aren't the organizer initially
- (model_row_changed_cb): set needs_send to true
- (row_count_changed_cb): ditto
-
- * gui/dialogs/meeting-page.glade: update gui
-
- * gui/dialogs/comp-editor.c (save_comp_with_send): if the user is
- not the organizer, REPLY rather than REQUEST
- (comp_editor_set_existing_org): accessor
- (comp_editor_get_existing_org): ditto
- (comp_editor_set_user_org): ditto
- (comp_editor_get_user_org): ditto
- (real_edit_comp): determine if there is an existing organizer and
- if the organizers is a user
- (page_changed_cb): warn the user that changes may be discarded
- (page_summary_changed_cb): ditto
- (page_dates_changed_cb): ditto
-
- * gui/dialogs/comp-editor.h: new protos
-
- * gui/itip-utils.c (itip_organizer_is_user): determine if the
- organizer of a component is a user
- (itip_sentby_is_user): same for sentby field of organizer
- (comp_sentby): use above routines instead
- (comp_compliant): strip all X-LIC-ERROR fields generated by
- libical
-
- * gui/e-meeting-model.c (is_cell_editable): if there is a list of
- editable rows, allow only the status column of those rows to be
- edited
- (init): init edit_rows
- (e_meeting_model_restricted_add): add an editable row to the model
- (e_meeting_model_restricted_remove): remove an editable row
- (e_meeting_model_restricted_clear): clear all editable rows
- (e_meeting_model_etable_click_to_add): set the click to add arg on
- all tables
- (e_meeting_model_etable_from_model): track the tables
- (table_destroy_list_cb): remove the table being destroyed from the
- list
- (table_destroy_state_cb): remove the table being destroyed from
- the list
-
- * gui/e-meeting-model.h: new protos
-
- * gui/e-itip-control.c (update_attendee_status): kill warning
-
-2002-06-18 JP Rosevear <jpr@ximian.com>
-
- * zones.h: update for new zones
-
-2002-06-17 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes wombat crash (for JP and myself)
-
- * gui/gnome-cal.c (gnome_calendar_open): don't call add_alarms here,
- since the client is not yet attached to the backend, and the alarm
- daemon does unref the client before creating a new one.
- (client_cal_opened_cb): call add_alarms here.
-
-2002-06-12 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/alarm-notify.c: added timeout_id to LoadedClient structure, to
- keep track of the timeout function.
- (retry_timeout_cb): don't use RetryData, but the LoadedClient.
- (cal_opened_cb): ditto, and assigned lc->timeout_id to the return
- value of g_timeout_add().
- (alarm_notify_add_calendar): destroy the timeout callback when
- destroying the LoadedClient structure.
-
-2002-06-12 Jeffrey Stedfast <fejj@ximian.com>
-
- * pcs/cal-factory.c (open_fn): Free the uri_string once we're done
- with it.
-
-2002-06-12 Kjartan Maraas <kmaraas@gnome.org>
-
- * gui/dialogs/cal-prefs-dialog.glade: Fix a typo.
-
-2002-06-10 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/alarm-notify/alarm-notify.c (alarm_notify_add_calendar): removed
- already loaded client when asked to be opened again, and *really*
- re-open it again.
-
-2002-06-04 Christopher James Lahey <clahey@ximian.com>
-
- * gui/gnome-cal.c (gnome_calendar_setup_view_menus):
- gal_view_menus_set_show_define_views (..., FALSE);
-
-2002-06-04 Christopher James Lahey <clahey@ximian.com>
-
- * gui/e-tasks.c (e_tasks_setup_view_menus), gui/gnome-cal.c
- (gnome_calendar_setup_view_menus): Set the title of our
- GalViewCollection.
-
-2002-06-03 Anna Marie Dirks <anna@ximian.com>
-
- * gui/dialogs/cal-prefs-dialog.glade: In an attempt to clean up the
- config dialog (and to reduce its overall girth), I have re-laid-out the
- calendar preferences dialog. It now conforms to standard Evolution
- spacing and padding guidelines, and exhibits proper alignment, etc.
-
-2002-06-03 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/query.c: keep a reference to the Query object, to avoid
- crashes when the queries are destroyed before finishing processing.
- Fixes #25056.
-
-2002-05-26 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/comp-editor.h: update proto
-
- * gui/dialogs/comp-editor.c (comp_editor_get_comp): new function
- to get base comp
-
- * gui/e-comp-editor-registry.c (e_comp_editor_registry_add): get
- the base comp, not the current comp, don't unref it
- (foreach_close_cb): block the signal, unblock it if the editor
- could not be closed
- (e_comp_editor_registry_close_all): fix preconditions
- (editor_destroy_cb): get the base comp, not the current comp,
- don't unref it
-
-2002-05-26 JP Rosevear <jpr@ximian.com>
-
- * gui/e-comp-editor-registry.c (e_comp_editor_registry_close_all):
- if there are remaining items, return false
- (foreach_close_cb): don't remove the item if it couldn't be closed
-
- * gui/e-comp-editor-registry.h: update proto
-
- * gui/component-factory.c (request_quit): return a boolean
- indicating if everything was closed
-
- * gui/dialogs/comp-editor.h: update proto
-
- * gui/dialogs/comp-editor.c (comp_editor_close): return true if
- the editor was closed, false otherwise
-
-2002-05-26 JP Rosevear <jpr@ximian.com>
-
- * gui/e-comp-editor-registry.[hc]: a registry of comp editors so
- we can close them all centrally
-
- * gui/gnome-cal.c (gnome_calendar_init): there is no editor hash
- now
- (gnome_calendar_destroy): ditto
- (gnome_calendar_edit_object): look for the event editor in the
- registry, if it isn't there, create it and add it to the registry
-
- * gui/e-calendar-table.c (open_task): look for the task editor in
- the registry, if it isn't there, create it and add it to the
- registry
-
- * gui/component-factory.c (request_quit): close all open editors
- (create_object): add a request_quit function to the shell
- component
-
- * gui/comp-editor-factory.c (free_client): there is no
- uid_comp_hash to free any more
- (editor_destroy_cb): we get an OpenClient as callback data now,
- reduce the editor count and destroy it if it is 0
- (edit_existing): don't create the Component, add the new editor to
- the registry, increase the editor count
- (edit_new): ditto
- (open_client): set the editor count to 0
- (impl_editExisting): look in the registry for the editor
-
- * gui/Makefile.am: Build new sources
-
- * gui/main.c (main): create the registry
-
- * gui/dialogs/comp-editor.c (comp_editor_close): prompt to save
- and then close dialog
-
- * gui/dialogs/comp-editor.h: new proto
-
- * gui/GNOME_Evolution_Calendar.oaf.in: remove dead summary stuff
-
-2002-05-24 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/cal-backend-file.c (save): check the value returned by
- gnome_vfs_uri_to_string before using it.
- (cal_backend_file_open): ditto.
-
-2002-05-20 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/dialogs/event-editor.c (event_editor_init): Pass the
- @component_pixmaps in so we give the new "Meeting" button an icon.
-
- * gui/dialogs/comp-editor.c (comp_editor_merge_ui): New arg
- @component_pixmaps to pass in custom pixmaps.
-
-2002-05-20 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/alarm-notify/alarm-notify.c:
- * gui/alarm-notify/notify-main.c: ported changes from evolution-1-0
- to make it work with reminders on remote backends.
-
- * pcs/cal-backend-file.c (cal_backend_file_open): check the string
- returned by gnome_vfs_uri_to_string, which can be empty. If so,
- return an error.
-
-2002-05-17 JP Rosevear <jpr@ximian.com>
-
- * gui/gnome-cal.c (gnome_calendar_setup_view_menus): set the view
- to the current view
-
-2002-05-16 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/gnome-cal.c (client_cal_opened_cb): added support for
- CAL_CLIENT_OPEN_PERMISSION_DENIED error code.
- (permission_error): new function to display 'Permission Denied'
- error message when opening the calendar.
-
- * gui/e-tasks.c: likewise.
-
- * idl/evolution-calendar.idl: added PERMISSION_DENIED to Listener's
- OpenStatus enumeration.
-
- * cal-client/cal-client.c (cal_opened_cb): added code for retrieving
- 'Permission Denied' errors, and convert it to CalClientOpenStatus
- values.
-
- * pcs/cal-factory.c (open_backend): added code for informing of
- 'Permission Denied' errors.
-
-2002-05-16 Rodrigo Moya <rodrigo@ximian.com>
-
- * idl/evolution-calendar.idl: added PermissionDenied exception and
- make it be raised in open, updateObjects and removeObject.
-
- * pcs/cal-backend.h: added CAL_BACKEND_OPEN_PERMISSION_DENIED to
- CalBackendOpenStatus enumeration, added CalBackendResult enumeration.
-
- * pcs/cal.c:
- * pcs/cal-backend.c:
- * pcs/cal-backend-file.c: adapted to changes in update_objects and
- remove_object methods.
-
- * cal-client/cal-client.[ch]: added CalClientResult enumeration.
- (cal_client_update_object, cal_client_update_objects,
- cal_client_remove_object): changed to return a CalClientResult.
-
- * conduits/calendar/calendar-conduit.c:
- * calendar/conduits/todo/todo-conduit.c:
- * importers/icalendar-importer.c:
- * gui/dialogs/comp-editor.c:
- * gui/calendar-model.c:
- * gui/e-calendar-table.c:
- * gui/e-day-view.c:
- * gui/e-itip-control.c:
- * gui/e-week-view.c:
- * gui/comp-util.c:
- * gui/e-tasks.c:
- * gui/tasks-migrate.c: adapted to changes in cal_client_update_object(s)
- and cal_client_remove_object.
-
-2002-05-15 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component-factory.c (create_object): Pass NULL as
- @request_quit_fn.
-
-2002-05-14 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/schedule-page.c (schedule_page_construct): set the
- working hours for the meeting time selector
-
-2002-05-14 JP Rosevear <jpr@ximian.com>
-
- * cal-util/cal-component.h: make the range datetime member a
- struct not a pointer
-
- * cal-util/cal-component.c (cal_component_get_recurid): take a
- pointer to a range
- (cal_component_set_recurid): ditto
-
- * gui/itip-utils.c (comp_minimal): get/set the recurrence id
- properly
-
-2002-05-09 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/e-itip-control.c (get_servers): use
- GNOME_Evolution_Storage__get_folderList instead of
- GNOME_Evolution_Storage_getFolderList since I have now changed
- that to be an attribute instead of a method.
-
-2002-05-07 JP Rosevear <jpr@ximian.com>
-
- * gui/e-itip-control.c (start_calendar_server): start a server a
- uri
- (start_default_server): start a default server
- (get_servers): get all clients for all folders of the given
- type(s)
- (find_server): locate a server for a particular uid
- (init): get_servers, listen for object_requested signal
- (destroy): destroy all clients
- (write_html): put options is there own cell
- (get_publish_options): place selector in if param is true
- (get_request_options): ditto
- (get_real_item): only try and look up the item if we know its in
- the server
- (show_current_event): find the server (if any) for the current
- comp
- (show_current_todo): ditto
- (update_attendee_status): if there is no server for the comp, it
- doesn't exist
- (remove_item): ditto
- (button_selected_cb): get a client for the selected folder
- (object_requested_cb): draw the folder button in
-
- * gui/calendar-config.h: new protos
-
- * gui/calendar-config.c (calendar_config_default_tasks_folder):
- get default tasks uri
- (calendar_config_default_calendar_folder): get default calendar
- uri
-
- * cal-client/cal-client.c (get_default_uri): use
- cal_util_expand_uri
-
- * cal-util/cal-util.h: new proto
-
- * cal-util/cal-util.c (cal_util_expand_uri): tack on the file name
- if its a file uri
-
-2002-05-03 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-tasks.c (e_tasks_delete_selected):
- (e_tasks_complete_selected): show progress messages
- on the status bar.
-
-2002-05-02 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/query.c: #include <gtk/gtkmain.h> to avoid warnings.
-
-2002-05-02 JP Rosevear <jpr@ximian.com>
-
- * gui/e-week-view.c (free_view_popup): only discard the popup if
- we created one
-
-2002-05-02 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/query.c: refactored a bit, to not do things in idle loops.
-
-2002-05-01 JP Rosevear <jpr@ximian.com>
-
- * gui/print.c (print_day_details): modify the start and end hours
- to accomodate all the events in the day
-
- * gui/e-day-view.c (free_view_popup): only discard the popup if we
- created one
-
-2002-04-30 JP Rosevear <jpr@ximian.com>
-
- * gui/gnome-cal.c (gnome_calendar_construct): remove setup_widgets
- from here
- (gnome_calendar_init): move setup_widgets back here
-
-2002-04-26 Jeffrey Stedfast <fejj@ximian.com>
-
- * gui/Makefile.am: Don't link to libibex anymore!!
-
-2002-04-24 JP Rosevear <jpr@ximian.com>
-
- * gui/e-day-view.c (e_day_view_on_pilot_settings): launch pilot
- settings capplet
-
- * gui/e-week-view.c (e_week_view_on_pilot_settings): ditto
-
-2002-04-24 JP Rosevear <jpr@ximian.com>
-
- * gui/e-week-view.c (free_view_popup): free the view popup
- (e_week_view_show_popup_menu): add the view popup to the
- "main_item" menu and listen for destruction
-
- * gui/e-day-view.c (free_view_popup): as above
- (e_day_view_on_event_right_click): as above
-
- * gui/e-week-view.h: add class member
-
- * gui/e-day-view.h: add a class member
-
- * gui/gnome-cal.h: new protos
-
- * gui/gnome-cal.c (set_view): set the instance view id properly
- when switching views
- (gnome_calendar_setup_view_popup): generate a view popup
- (gnome_calendar_discard_view_popup): destroy a view popup
-
-2002-04-22 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/cal.c (impl_Cal_get_alarms_in_range): raise an exception if the
- backend's method returns NULL, since we can't send a NULL pointer to
- ORBit.
-
-2002-04-19 Anna Marie Dirks <anna@ximian.com>
-
- * gui/dialogs/cal-prefs-dialog.glade: Collapsed notebook into two pages
- and added accelerators for everything, as part of my config dialog
- polishing project
-
-2002-04-18 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/recurrence-page.c (simple_recur_to_comp): properly
- handle -ve recurrence values
- (month_num_submenu_selection_done_cb): track the current date in
- use
- (make_recur_month_num_submenu): make a submenu of dates
- (make_recur_month_num_menu): make the date/relation option menu
- (month_num_menu_selection_done_cb): update the date properly and
- keep both option menus consistent
- (month_day_menu_selection_done_cb): keep both option menus
- consistent
- (make_monthly_special): listen for selection done signal
- (make_recurrence_special): destroy old month_num_menu
- (recurrence_page_fill_widgets): properly handle -ve recurrence
- values
-
-2002-04-18 JP Rosevear <jpr@ximian.com>
-
- * gui/e-day-view.c (e_day_view_on_settings): show the settings
-
- * gui/e-week-view.c (e_week_view_on_settings): ditto
-
- * gui/calendar-commands.c (control_util_show_settings): show the
- settings dialog
-
- * gui/calendar-commands.h: new proto
-
- * gui/control-factory.c (control_factory_new_control): set the
- control as object data on the calendar
-
-2002-04-17 Christopher James Lahey <clahey@ximian.com>
-
- * gui/e-calendar-table.c, gui/e-day-view.c, gui/e-week-view.c,
- gui/dialogs/meeting-page.c: Updated these to match the new
- EPopupMenu.
-
-2002-04-05 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/cal-backend.[ch] (cal_backend_get_query): new method.
-
- * pcs/cal-backend-file.c (cal_backend_file_get_query): new method.
-
- * pcs/cal.c (impl_Cal_get_query): call the CalBackend's implementation
- instead of calling query_new directly.
-
- * pcs/query.[ch]: fixed headers.
-
-2002-04-10 Dan Winship <danw@ximian.com>
-
- * gui/gnome-cal.c (gnome_calendar_open): Fix this: Rodrigo's patch
- used one of the functions I just removed. :)
-
-2002-04-10 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/gnome-cal.c (gnome_calendar_open): use the default uri for
- tasks (as stored in the configuration) when the calendar URI is not
- a local one (connector, etc).
-
-2002-04-10 Dan Winship <danw@ximian.com>
-
- * cal-client/cal-client.c (get_default_uri): Use new-and-improved
- default folder URI config paths.
-
- * gui/calendar-config.c (calendar_config_{get,set}_default_uri,
- calendar_config_{get,set}_default_tasks_uri): Remove these. The
- shell owns this information now. (Weren't being used anyway.)
-
- * gui/component-factory.c (get_data_uri): Fix another place that
- hardcoded tacking foo.ics on to the end of URLs.
-
-2002-04-08 Dan Winship <danw@ximian.com>
-
- * gui/component-factory.c (create_view): Add view_info arg. If the
- view_info is non-empty and this is a calendar folder, set the
- "view" property on the control's propertybag.
-
- * gui/control-factory.c (calendar_properties_init): Set up the
- "view" property.
- (get_prop, set_prop): handle the "view" property by
- getting/setting the GnomeCalendar's view. Unfortunately, this
- doesn't actually work. See #23208.
-
- * gui/calendar-commands.c (calendar_control_activate): Set the UI
- component's container before calling
- gnome_calendar_set_ui_component so that the search bar
- initialization will work.
-
-2002-04-06 JP Rosevear <jpr@ximian.com>
-
- * pcs/cal-backend-db.[hc]: Remove dead files.
-
-2002-04-06 JP Rosevear <jpr@ximian.com>
-
- * gui/GNOME_Evolution_Calendar.oaf.in: add config_item:type
-
-2002-04-01 Kjartan Maraas <kmaraas@gnome.org>
-
- * gui/e-itip-control.c: Fix a string.
-
-2002-04-01 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/cal-backend-db.c: simple fix for DB3 header inclusion in
- Mac OS X, by Max Horn <max@quendi.de>
-
-2002-03-31 JP Rosevear <jpr@ximian.com>
-
- * gui/e-itip-control.c (clean_up): free the my_address member
- (find_my_address): fall back on a CN match if possible
- (change_status): handle changing the status of a non-existent
- address by adding a new attendee
- (update_attendee_status): if the attendee response is not from a
- user on the list of attendees, ask the user if they want to add
- the attendee any how (as an optional participant)
- (ok_clicked_cb): if we are suppose to rsvp and the status was ok,
- but the attendee address is not known, find it
-
-2002-03-29 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/GNOME_Evolution_Calendar.oaf.in: Set a priority for the
- config item. Rename to "Calendar and Tasks".
-
-2002-03-29 JP Rosevear <jpr@ximian.com>
-
- * conduits/calendar/Makefile.am: s/libversit.la/libversit.a/
-
- * conduits/todo/Makefile.am: ditto
-
-2002-03-29 JP Rosevear <jpr@ximian.com>
-
- * gui/e-calendar-table.c: implement new pop up menu items for
- "Save as", "Print", "Assign Task", "Forward as iCalendar"
-
- * gui/e-day-view.c: similarly, also "Publish Free/Busy
- Information" and "New Meeting" and "New Task"
-
- * gui/e-week-view.c: ditto
-
- * gui/dialogs/task-editor.c (show_assignment): move the assignment
- page stuff here
- (task_editor_show_assignment): use it
- (assign_task_cmd): ditto
-
- * gui/dialogs/task-editor.h: new proto
-
- * gui/dialogs/comp-editor.c (save_as_cmd): use new e-util file
- selector function
-
- * meeting-mockup.glade: Remove old file
-
- * topic.dat
-
-2002-03-19 Dan Winship <danw@ximian.com>
-
- * cal-util/Makefile.am: s/libversit.la/libversit.a/
-
- * cal-client/Makefile.am: Likewise
-
- * gui/Makefile.am: Likewise
-
-2002-03-18 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/cal-search-bar.c: Removed `search_menu_items'.
- (cal_search_bar_menu_activated): Removed.
- (cal_search_bar_class_init): Don't install.
- (cal_search_bar_construct): No menu items here.
-
-2002-03-15 Jeffrey Stedfast <fejj@ximian.com>
-
- * gui/e-day-view.c: Updated to use new EPopupMenu API.
-
- * gui/e-week-view.c: Updated to use new EPopupMenu API.
-
- * gui/e-calendar-table.c: Updated to use new EPopupMenu API.
-
-2002-03-15 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/tasks-control.c (tasks_control_activate): Call
- `e_tasks_set_ui_component()' here to give it the
- BonoboUIComponent.
- (tasks_control_deactivate): Likewise, call it here to unset the
- BonoboUIComponent.
-
- * gui/e-tasks.c (e_tasks_set_ui_component): New.
-
- * gui/calendar-commands.c (calendar_control_activate): Call
- gnome_calendar_set_ui_component() here.
- (calendar_control_deactivate): ...And here, with a NULL
- BonoboUIComponent.
-
- * gui/gnome-cal.c (gnome_calendar_set_ui_component): New.
-
-2002-03-15 JP Rosevear <jpr@ximian.com>
-
- * gui/main.c: use bonobo exception macros to tidy
-
- * gui/itip-control-factory.c: ditto
-
- * gui/gnome-cal.c: ditto
-
- * gui/comp-editor-factory.c: ditto
-
- * gui/calendar-commands.c: ditto
-
-2002-03-14 JP Rosevear <jpr@ximian.com>
-
- * idl/evolution-calendar.idl: add all day event editor mode
-
- * gui/component-factory.c: clean up exception handling
- (sc_user_create_new_item_cb): support the all day event id
- (create_object): add a user creatable all day appointment item
-
- * gui/comp-editor-factory.c (get_default_event): get a default
- event either all day or starting at the top of the hour
- (get_default_task): get a default task
- (edit_new): support the all day event mode
-
- * gui/calendar-commands.c: remove unused functions/verbs
-
-2002-03-13 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/GNOME_Evolution_Calendar.oaf.in: Add an
- "evolution:config_item:icon_path" attribute so we get an icon for
- the calendar preferences.
-
-2002-03-12 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/dialogs/cal-prefs-dialog.glade: Add <visible>False</visible>
- to cal-prefs-dialog so it doesn't get shown when we load the Glade
- file with libglade.
-
- * gui/component-factory.c (owner_set_cb): Register the
- ConfigControl factory.
-
- * gui/tasks-control.c: Removed verb "TaskSettings".
- (tasks_control_settings_cmd): Removed.
-
- * gui/calendar-commands.c: Removed verb "CalendarSettings".
- (settings_cmd): Removed.
-
- * gui/dialogs/cal-prefs-dialog.c: Renamed `CalPrefsDialogPrivate'
- to `DialogData'. Replace `dialog' member with a `page' member.
- Remove `toplevel_notebook' member.
- (init_widgets): Renamed from `cal_prefs_dialog_init_widgets'.
- Just get a DialogData.
- (get_widgets): Get a DialogData pointer.
- (cal_prefs_dialog_destroy): Removed.
- (config_control_destroy_callback): New, signal handler for
- ::destroy for ConfigControl.
- (cal_prefs_dialog_new): Create a new DialogData, connect all the
- signal handlers.
- (create_time_edit): Renamed from
- `cal_prefs_dialog_create_time_edit'.
- (cal_prefs_dialog_show): Removed.
- (cal_prefs_dialog_button_clicked): Removed.
- (show_task_list_config): Get a DialogData.
- (show_config): Renamed from `cal_prefs_dialog_show_config'.
- Likewise.
- (update_task_list_config): Likewise.
- (update_config): Renamed from
- `cal_prefs_dialog_update_config'. Likewise.
- (color_set_callback): New callback, makes the dialog report
- changes when the setting in any of the color widgets is changed.
- (widget_changed_callback): New callback, makes the dialog report
- changes when any of the widgets changes status.
- (connect_changed): New utility function to connect this callback
- to all the widgets.
- (setup_widgets): Connect all the widgets.
- (cal_prefs_dialog_new): Call `setup_widgets'.
-
- * gui/config-control-factory.c: New.
- * gui/config-control-factory.h: New.
-
- * gui/GNOME_Evolution_Calendar.oaf.in: Add
- OAFIID:GNOME_Evolution_Calendar_ConfigControl and
- OAFIID:GNOME_Evolution_Calendar_ConfigControlFactory.
-
-2002-03-06 Rodrigo Moya <rodrigo@ximian.com>
-
- Should fix #21240
-
- * gui/alarm-notify/alarm-notify.c: replaced use of GnomeVFSURI
- with EUri, to allow non-registered methods.
-
-2002-03-05 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-itip-control.c (e_itip_control_set_data): reverted my last
- change of adding the METHOD property to the incoming request.
-
- * gui/itip-utils.c (comp_string): added extra
- X-MICROSOFT-CDO-REPLYTIME property for broken Outlook. Should fix
- #20783.
-
-2002-03-04 Dan Winship <danw@ximian.com>
-
- * gui/itip-utils.c (comp_compliant): Reset the DTSTAMP of the new
- component. (RFC2245 says DTSTAMP corresponds to the time the
- particular iCalendar representation of the object was created.)
- Fixes #21198.
-
-2002-03-05 JP Rosevear <jpr@ximian.com>
-
- * gui/print.c: remove unneeded parameter from print_text_size
- everywhere
- (get_font_for_size): calculate a font size based on the available
- height
- (print_text): calculate the top of where the font should be drawn
- (print_text_size): use get_font_for_size
- (print_day_background): use get_font_for_size
-
-2002-03-05 JP Rosevear <jpr@ximian.com>
-
- * gui/e-meeting-time-sel-item.c
- (e_meeting_time_selector_item_draw): pass the real table
- to e_meeting_model_etable_view_to_model_row
- (e_meeting_time_selector_item_paint_busy_periods): ditto
-
- * gui/dialogs/meeting-page.c (right_click_cb): ditto
-
- * gui/e-meeting-model.h: update protos
-
- * gui/e-meeting-model.c
- (e_meeting_model_etable_model_to_view_row): take in to account the
- fact the table used the without model
- (e_meeting_model_etable_view_to_model_row): ditto
-
-2002-03-04 Damon Chaplin <damon@ximian.com>
-
- * gui/tasks-control.c: added support for printing the Tasks table.
- I hacked it a bit so the user could choose portrait or landscape mode.
- This is bug #9677. ETable printing has a few issues, though, and it
- isn't very pretty.
-
-2002-03-04 Dan Winship <danw@ximian.com>
-
- * gui/itip-utils.c (comp_subject): Prefix the subject with an
- indicator like "Accepted" or "Cancelled" explaining what the
- action is, since Outlook doesn't display any of that information
- inline like we do. (20780)
-
-2002-02-28 Rodrigo Moya <rodrigo@ximian.com>
-
- * calendar/gui/e-itip-control.c (e_itip_control_set_data): added the
- METHOD property to the top level component we create.
-
-2002-02-26 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/control-factory.c (set_prop):
- * gui/tasks-control.c (tasks_control_set_property): display an error
- message if the call to gnome_calendar_open or e_tasks_open does not
- return TRUE. Fixes #20346.
-
-2002-02-25 Dan Winship <danw@ximian.com>
-
- * gui/itip-utils.c (itip_send_comp): use
- GNOME_Evolution_Composer_setBody rather than _setMultipartType and
- _attachData now, to send a message containing just a text/calendar
- part. Fixes 14705. Mostly.
- (comp_content_type): Include the filename here since we can't add
- a Content-Disposition now.
-
-2002-02-24 Chris Toshok <toshok@ximian.com>
-
- * gui/cal-search-bar.c (cal_search_bar_class_init): change
- query_changed to search_activated.
- (cal_search_bar_search_activated): rename
- cal_search_bar_query_changed to this.
-
-2002-02-21 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component-factory.c (add_creatable_item): New helper
- function.
- (create_object): Add icons for the various user creatable items.
-
-2002-02-19 JP Rosevear <jpr@ximian.com>
-
- * gui/e-itip-control.c (send_item): pass extra itip_send_comp
- params
- (send_freebusy): ditto
- (ok_clicked_cb): ditto, including the timezones culled from the
- component
-
- * gui/e-week-view.c: pass extra itip_send_comp params
-
- * gui/calendar-commands.c: ditto
-
- * gui/e-day-view.c: ditto
-
- * gui/dialogs/task-editor.c: ditto
-
- * gui/dialogs/event-editor.c: ditto
-
- * gui/dialogs/comp-editor.c: ditto
-
- * gui/itip-utils.h (itip_send_comp): update proto
-
- * gui/itip-utils.c (foreach_tzid_callback): check the passed in
- zones, then the builtin time zones then the client
-
-2002-02-19 JP Rosevear <jpr@ximian.com>
-
- * gui/e-itip-control.c (find_my_address): strip the ical value and
- do a case insensitive compare
- (find_attendee): ditto
- (change_status): put the error message here
- (ok_clicked_cb): don't update the item or rsvp unless
- change_status was successful, trip the ical value and do a case
- insensitive compare
-
- * gui/itip-utils.c (get_address): strip the incoming address
- (itip_strip_mailto): use g_strncasecmp
- (comp_limit_attendees): strip the ical value and do a case
- insensitive compare
-
-2002-02-14 JP Rosevear <jpr@ximian.com>
-
- * gui/e-meeting-model.c: use new column enums
- (set_value_at): emit pre-change/cell change signals
- (destroy): destroy refresh_queue and refresh_data
- (init): init new elements
- (refresh_queue_add): if the attendee is being refreshed already,
- possibly update the start/end times to look for and update the
- callback info, otherwise add it to the queue
- (refresh_queue_remove): remove a refreshing attende from the queue
- (process_callbacks): make all the callbacks and remove the
- attendee from the queue
- (process_free_busy): process the callbacks immediately if parsing
- fails or on successful completion of processing
- (async_close): process free busy
- (cursor_cb): we're only looking for one at a time now
- (refresh_busy_periods): idle callback to start processing the queue
- (e_meeting_model_refresh_all_busy_periods): add every row to the queue
- (e_meeting_model_refresh_busy_periods): add a single row to the queue
-
- * gui/e-meeting-model.h: new protos, enum the columns
-
- * gui/e-meeting-time-sel.c: use new compare time function
- (e_meeting_time_selector_construct): listen for a cell changed
- signal and use separate callbacks for rows_inserted and
- rows_deleted
- (e_meeting_time_selector_refresh_free_busy): util function to
- refresh free busy info
- (e_meeting_time_selector_on_update_free_busy): use above
- (rows_inserted_cb): refresh free busy on the new rows
- (cell_changed_cb): refresh free busy on the row when the address
- changes
- (rows_deleted_cb): redraw
-
- * gui/e-meeting-utils.[hc]: a holding spot for a meeting time
- comparison function
-
- * gui/Makefile.am: compile new files
-
-2002-02-13 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/control-factory.c (set_prop): don't append 'calendar.ics'
- to the URI.
- (get_prop): finished.
-
- * gui/tasks-control.c (tasks_control_set_property): don't append
- 'tasks.ics' to the URI.
- (tasks_control_get_property): finished.
-
- * gui/gnome-cal.c (gnome_calendar_open):
- * gui/e-tasks.c (e_tasks_open): append $filename.ics to the uri to be
- opened if the uri is local. Leave intact in other cases.
-
-2002-02-08 Damon Chaplin <damon@ximian.com>
-
- * gui/comp-util.c (cal_comp_util_compare_event_timezones): check if
- the CalComponentDateTime values are set before trying to use them.
- Possibly fixes bug #18529.
-
- * importers/icalendar-importer.c: added vCalendar importer and
- intelligent GnomeCalendar importer code here, as it shares a lot of
- code with the iCalendar importer.
-
- NOTE: check_folder_type() needs to be finished at some point.
- It needs a new shell Corba call so it can decide whether to import
- events or tasks into the folder. Currently it just imports both.
-
- * importers/main.c (importer_factory_fn): create vCalendar importer
- or GnomeCalendar importer if required.
-
- * importers/evolution-calendar-importer.h: added declarations for
- creating a vCalendar importer and intelligent Gnome Calendar importer.
-
- * importers/Makefile.am: added -DEVOLUTION_SOUNDDIR so the importer
- knows what filename to use for audio alarms in vCalendar files.
- Added libicalvcal-evolution to LDADD.
-
- * importers/GNOME_Evolution_Calendar_Importer.oaf.in: added vCalendar
- importer and intelligent Gnome Calendar importer.
-
- * gui/comp-util.c (cal_comp_util_compare_event_timezones): return TRUE
- if the event uses UTC. We don't want to flag all events from Outlook,
- which use UTC.
-
-2002-02-08 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/task-details-page.glade: change custom widget
- creator to e_url_entry_new
-
- * gui/dialogs/task-details-page.c (get_widgets): get the url entry
- and its entry
-
-2002-02-08 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/task-details-page.glade: add a custom widget created
- with e_url_button_new
-
- * gui/dialogs/task-details-page.c (task_details_page_init): init
- url_button member to NULL
- (init_widgets): set the url button entry
- (get_widgets): get the url button
-
- * gui/calendar-commands.c (pixmaps): use new all day event icon
-
-2002-02-07 JP Rosevear <jpr@ximian.com>
-
- * gui/e-day-view.c: pass meeting boolean for
- gnome_calendar_edit_object and gnome_calendar_new_appointment_for
-
- * gui/e-week-view-event-item.c: ditto
-
- * gui/e-week-view.c: ditto
-
- * gui/tasks-control.c (confirm_expunge): kill warning
-
- * gui/calendar-commands.c (new_meeting_cb): show a new meeting
- dialog
- (new_event_cb): pass new param
-
- * gui/gnome-cal.c (gnome_calendar_edit_object): take meeting
- boolean and show meeting page if true
- (gnome_calendar_new_appointment_for): takeing meeting param and
- pass to above
- (gnome_calendar_new_appointment): add new param
-
- * gui/gnome-cal.h: update proto
-
- * gui/component-factory.c (create_component): take a comp editor
- mode, determine vtype
- (sc_user_create_new_item_cb): check for meeting user creatable
- item
- (create_object): add meeting as user creatable item
-
- * gui/comp-editor-factory.c (edit_new): get a comp editor mode
- now, determine vtype and show meeting page if required
- (queue_edit_new): get comp editor mode
- (impl_editNew): ditto, plus queue the mode directly instead of
- determining the vtype
-
- * gui/dialogs/event-editor.c (show_meeting): new internal util
- function to show meeting page
- (event_editor_show_meeting): show the meeting
- (schedule_meeting_cmd): use show_meeting
-
- * gui/dialogs/event-editor.h: new proto
-
- * idl/evolution-calendar.idl: editNew takes a mode rather than a
- type now
-
- * cal-util/Makefile.am: fix includes
-
-2002-02-07 Christopher James Lahey <clahey@ximian.com>
-
- * gui/e-tasks.c (e_tasks_setup_view_menus), gui/gnome-cal.c
- (gnome_calendar_setup_view_menus): Made these use the new
- GalViewMenus stuff.
-
-2002-02-06 Damon Chaplin <damon@ximian.com>
-
- * cal-util/cal-recur.c (cal_recur_from_icalproperty): convert months
- from 1-12 to 0-11. Fixes bug #19235.
-
-2002-02-04 JP Rosevear <jpr@ximian.com>
-
- * conduits/todo/todo-conduit.c (e_todo_gui_new): new gui routines
- for conduit settings
- (e_todo_gui_fill_config): ditto
- (e_todo_gui_fill_widgets): ditto
- (e_todo_gui_destroy): ditto
- (e_todo_context_destroy): destroy new_cfg and gui properly
- (local_record_from_comp): set the priority to the default setting
- if none is set on the icalendar object
- (fill_widgets): fill gui widgets
- (create_settings_window): create gui
-
-2002-01-30 JP Rosevear <jpr@ximian.com>
-
- * gui/e-itip-control.c (write_html): if this is a reply, print the
- attendee status
-
-2002-01-25 Federico Mena Quintero <federico@ximian.com>
-
- * gui/dialogs/alarm-options.glade: Use 1 instead of zero as the
- minimum value for the repetitions spin button as we use a check
- box to specify whether the alarm has repetitions or not. Fixes
- bug #19054.
-
-2002-01-24 Ettore Perazzoli <ettore@ximian.com>
-
- * importers/Makefile.am (evolution_calendar_importer_LDADD):
- Ooops. Forgot to use EVOLUTION_CALENDAR_LIBS here.
-
-2002-01-24 Ettore Perazzoli <ettore@ximian.com>
-
- * conduits/calendar/Makefile.am: Use
- EVOLUTION_CALENDAR_CONDUIT_LIBS and
- EVOLUTION_CALENDAR_CONDUIT_CFLAGS.
- * conduits/todo/Makefile.am: Likewise.
-
- * cal-client/Makefile.am: Use EVOLUTION_CALENDAR_LIBS and
- EVOLUTION_CALENDAR_CFLAGS.
- * cal-util/Makefile.am: Likewise.
- * gui/alarm-notify/Makefile.am: Likewise.
- * gui/Makefile.am: Likewise.
-
-2002-01-23 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component-factory.c (create_object): Pass a NULL @icon to
- `evolution_shell_component_add_user_creatable_item()'.
-
-2002-01-21 JP Rosevear <jpr@ximian.com>
-
- * conduits/todo/todo-conduit.c (todoconduit_load_configuration):
- return a new configuration struct, load default priority setting
- (todoconduit_save_configuration): save default priority setting
- (e_todo_context_new): dupe configuration
-
- * conduits/calendar/calendar-conduit.c (e_calendar_context_new):
- set ps to NULL
-
-2002-01-17 Damon Chaplin <damon@ximian.com>
-
- * gui/dialogs/alarm-page.c (get_alarm_string): save the alarm string
- in the correct variable (str), so it actually gets shown for alarms
- with specific trigger times. Fixes bug #18801.
-
-2002-01-15 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/dialogs/task-page.c (task_page_fill_widgets): default component
- classification to PUBLIC. Fixes internal bug #1066
-
-2002-01-14 JP Rosevear <jpr@ximian.com>
-
- * conduits/calendar/calendar-conduit.c: move all functions here,
- get rid of header files, use e-pilot-settings to display gui
-
- * conduits/todo/todo-conduit.c: as above
-
-2002-01-14 JP Rosevear <jpr@ximian.com>
-
- * gui/gnome-cal.c (get_current_time): use icaltimetype_to_tm
-
-2002-01-14 JP Rosevear <jpr@ximian.com>
-
- * gui/e-week-view-main-item.c (e_week_view_main_item_draw_day):
- figure out when today is and highlight if it is not selected
-
- * gui/e-week-view.h: enum the "today" color
-
- * gui/e-week-view.c (e_week_view_realize): init the "today" color
-
-2002-01-13 JP Rosevear <jpr@ximian.com>
-
- * gui/alarm-notify/save.h: add protos
-
- * gui/alarm-notify/save.c (save_blessed_program): records a
- program as blessed
- (is_blessed_program): checks to see if a program is blessed
-
- * gui/alarm-notify/alarm-queue.c (procedure_notification_dialog):
- popup a dialog notifying the user that is a program and let them
- not see the dialog about this program again
- (procedure_notification): use above
-
-2002-01-11 Damon Chaplin <damon@ximian.com>
-
- * gui/e-timezone-entry.c:
- * gui/e-itip-control.c (write_label_piece):
- * gui/calendar-config.c (on_timezone_set): translate timezone names
- when displayed. Fixes bug #6544.
-
-2002-01-03 JP Rosevear <jpr@ximian.com>
-
- * gui/tasks-control.c (tasks_control_complete_cmd): new verb
- callback
- (sensitize_commands): set sensitivity of mark complete command
-
- * gui/e-tasks.h: new proto
-
- * gui/e-tasks.c (e_tasks_complete_selected): mark selected tasks
- in the table as complete
-
- * gui/e-calendar-table.h: new proto
-
- * gui/e-calendar-table.c (e_calendar_table_complete_selected):
- mark selected rows as complete
-
-2002-01-03 JP Rosevear <jpr@ximian.com>
-
- * gui/tasks-control.c (confirm_expunge): only need one warning
- message now
-
- * gui/e-tasks.c (create_sexp): change the logic to expunge all
- completed tasks not just hidden ones
-
-2002-01-03 JP Rosevear <jpr@ximian.com>
-
- * gui/tasks-control.c (confirm_expunge): confirm expunging of the
- tasks
- (tasks_control_expunge_cmd): verb callback
-
- * gui/calendar-config.c (config_read): read confirm expunge value
- (calendar_config_write): write confirm expunge value
- (calendar_config_write_on_exit): ditto
- (calendar_config_get_confirm_expunge): get value
- (calendar_config_set_confirm_expunge): set value
-
- * gui/calendar-config.h: new proto
-
- * gui/e-itip-control.c (start_calendar_server): kill warning
-
- * gui/e-tasks.c (e_tasks_init): init query member to NULL
- (set_status_message): util function to set status message
- (e_tasks_open): use above
- (cal_opened_cb): ditto
- (create_sexp): create sexp of items to be deleted
- (query_obj_updated_cb): remove any items found
- (query_eval_error_cb): bail out on error
- (query_query_done_cb): tidy when done
- (e_tasks_delete_completed): set up query
-
- * gui/e-tasks.h: new proto
-
- * gui/calendar-model.c (query_query_done_cb): use g_warning
- instead of printing to stderr
- (query_eval_error_cb): ditto
- (update_query): clear the status message if we can't create the
- query
-
- * gui/tag-calendar.c (resolve_tzid_cb): make this static
-
-2001-12-21 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/comp-editor.c: remove needs send signal related
- cruft
- (save_comp_with_send): with send_component_dialog, indicate if the
- meeting info is newly created or not
- (real_edit_comp): remember if the dialog initially needs a send
-
- * gui/dialogs/send-comp.c (send_component_dialog): take a "new"
- parameter indicating whether the dialog should intimate if the
- component to be sent is a new meeting or not
-
- * gui/dialogs/send-comp.h: update proto
-
- * gui/dialogs/comp-editor.c: remove no longer used needs_send
- notification and signal
-
- * gui/dialogs/comp-editor.h: remove proto
-
- * gui/e-day-view.c (e_day_view_on_main_canvas_drag_data_received): add new
- param to send_component_dialog
- (e_day_view_finish_long_event_resize): ditto
- (e_day_view_finish_resize): ditto
- (e_day_view_on_editing_stopped): ditto
- (e_day_view_on_top_canvas_drag_data_received): ditto
-
- * gui/e-week-view.c (e_week_view_on_editing_stopped): add new
- param to send_component_dialog
-
-2001-12-21 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/comp-editor.h: inherit from bonobo window
-
- * gui/dialogs/comp-editor.c: inherit from bonobo window
- (comp_editor_key_press_event): Look for an escape key press and
- close the window if found
-
-2001-12-20 Ettore Perazzoli <ettore@ximian.com>
-
- [Fixes #17377, Evolution doesn't work on multi-depth displays.]
-
- * gui/main.c (main): Push GdkRGB visual and colormap.
-
-2001-12-19 JP Rosevear <jpr@ximian.com>
-
- * conduits/calendar/calendar-conduit.c (check_for_slow_setting):
- go slow and clear the map if the last uri and the current uri do
- not match
- (post_sync): save the last uri
-
- * conduits/calendar/calendar-conduit-config.h: handle a last uri
- config option
-
- * conduits/todo/todo-conduit-config.h: ditto
-
- * conduits/calendar/calendar-conduit.c (start_calendar_server):
- use the open_default_calendar method
-
- * conduits/todo/todo-conduit.c (start_calendar_server): same as above
-
- * cal-client/Makefile.am: link with bonobo conf
-
- * cal-client/cal-client.h: new protos
-
- * idl/evolution-calendar.idl: make sure open method raises
- appropriate exceptions
-
- * gui/e-itip-control.c (start_calendar_server): use
- cal_client_open_default_* calls
-
- * cal-client/cal-client.c (real_open_calendar): do the real work
- of loading
- (cal_client_open_calendar): use above
- (get_fall_back_uri): get the basic local uri
- (get_default_uri): get the default uri from the config db
- (cal_client_open_default_calendar): open the default uri or the
- fallback if the method is unsupported
- (cal_client_open_default_tasks): same for tasks
-
-2001-12-17 JP Rosevear <jpr@ximian.com>
-
- * gui/e-itip-control.c (send_item): use get_real_item
- (get_refresh_options): uncomment out
- (get_real_item): obtain the real object which has the uid of the
- item received
- (show_current_todo): use get_refresh_options for refresh method
- and provide the description and summary from the real component
- since its not in the reply
- (show_current_event): ditto
- (send_item): use get_real_item
-
-2001-12-17 JP Rosevear <jpr@ximian.com>
-
- * gui/itip-utils.c (comp_limit_attendees): can't remove properties
- in an iteration loop, so remove them outside the loop
- (comp_minimal): don't set a recurid if there isn't one, add the x
- properties to the clone
- (comp_compliant): unref the clone for DECLINECOUNTER
-
- * gui/e-itip-control.c (get_refresh_options): make function
- available again
- (show_current_event): use it here
- (ok_clicked_cb): can't remove properties in an iteration loop, so
- remove them outside the loop
-
- * cal-util/cal-component.c (free_icalcomponent): properly free the
- attendee list
- (cal_component_rescan): don't destroy the alarm hash
-
-2001-12-13 Damon Chaplin <damon@ximian.com>
-
- * zones.h: new file to contain all timezone names for translation.
- We won't be using the translations in 1.0.1, but it gives translators
- time before we do use them in 1.0.2.
-
- * Makefile.am: added zones.h to EXTRA_DIST.
-
-2001-12-12 JP Rosevear <jpr@ximian.com>
-
- * gui/e-day-view.c (e_day_view_on_top_canvas_button_release):
- ungrab the pointer before calling
- e_day_view_finish_long_event_resize
- (e_day_view_on_main_canvas_button_release): ditto
- (e_day_view_finish_long_event_resize): ask if the meeting should
- be sent
- (e_day_view_finish_resize): ditto
- (e_day_view_on_editing_stopped): ditto
- (e_day_view_on_top_canvas_drag_data_received): ditto
- (e_day_view_on_main_canvas_drag_data_received): ditto
-
-2001-12-11 JP Rosevear <jpr@ximian.com>
-
- * gui/e-meeting-model.c (process_free_busy_comp): properly convert
- the dtstart and dtend times if they are UTC
- (cursor_cb): if we don't have anybody to get f/b info for, process
- the callbacks immediately
- (e_meeting_model_refresh_busy_periods): take start/end times,
- calculate the timet values with object timezone
- (e_meeting_model_etable_model_to_view_row): proper cast
- (e_meeting_model_etable_view_to_model_row): ditto
- (async_open): bail out if we couldn't open properly
-
- * gui/e-meeting-time-sel.c
- (e_meeting_time_selector_on_update_free_busy): use defines for
- determining the number of days before and after of free busy to
- request
- (e_meeting_time_selector_update_dates_shown): use defines for the
- number of days shown
-
- * gui/e-meeting-model.h: update proto
-
-2001-12-10 Damon Chaplin <damon@ximian.com>
-
- * gui/control-factory.c (control_factory_new_control): removed code
- that connects to GnomeCalendar's "dates_shown_changed" signal.
-
- * gui/calendar-commands.c (gcal_calendar_dates_change_cb):
- (calendar_control_activate): moved it here, so it gets reconnected
- whenever the control is activated. Fixes bug #15798.
-
-2001-12-10 Damon Chaplin <damon@ximian.com>
-
- * importers/GNOME_Evolution_Calendar_Importer.oaf.in: fixed executable
- name. Fixes bug #16880.
-
-2001-12-08 JP Rosevear <jpr@ximian.com>
-
- * conduits/calendar/calendar-conduit.c (local_record_from_comp):
- if we have an alarm that can be represented on the pilot, set the
- appointment fields appropriately, if the duration has values for
- minutes and/or hours and/or days, use the lowest common
- denominator
- (comp_from_remote_record): if the appointment on the pilot has an
- alarm, find the first alarm an item currently had that is relative
- to the start and with a negative duration and update it (or create
- a new one if no valid ones exist)
-
- * cal-util/cal-component.c (cal_component_get_alarm_uids): build
- list in the order they appear in the component so we get
- consisting order for the gui and for the pilot
-
-2001-12-08 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/calendar-config.c (calendar_config_get_default_uri):
- (calendar_config_get_default_tasks_uri): s/%/%s
-
-2001-11-09 Federico Mena Quintero <federico@ximian.com>
-
- (committed by Damon)
-
- Fix bug #14699.
-
- * pcs/query.c (QueryState): Added a state QUERY_WAIT_FOR_BACKEND
- to indicate that the query is not populated as we are waiting for
- the backend to be opened.
- (query_init): Start in the QUERY_WAIT_FOR_BACKEND state.
- (query_destroy): Only disconnect from the backend if we are in a
- state that implies that we are connected to its signals.
- (query_construct): If the backend is already loaded, immediately
- set the state to QUERY_START_PENDING.
- (backend_opened_cb): Disconnect from the backend's "opened"
- signal. Set the state to QUERY_START_PENDING.
- (match_component): We can now only match components if the query
- is in progress or if it is done. Assert to that effect, and do
- not ensure_sexp().
- (match_component): Do not check for a nonexistent component using
- g_return_if_fail(). Also, there is no need to ref/unref the
- component.
- (backend_obj_updated_cb): Assert to the effect of our state.
- (backend_obj_removed_cb): Likewise.
- (parse_sexp): Renamed from ensure_sexp(). Assert that the query
- has not started. Do not disconnect from the backend's signals
- here, since we have no connections.
- (start_query_cb): Set the state to QUERY_IN_PROGRESS here instead
- of in populate_query().
-
-2001-12-07 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/calendar-config.c (calendar_config_get_default_uri):
- (calendar_config_get_default_tasks_uri): if the key in the config
- database does not exist, just return the local URIs, but never
- return NULL
-
-2001-12-06 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/dialogs/event-page.c (event_page_fill_widgets): default
- component classification to PUBLIC
-
-2001-12-06 Jon Trowbridge <trow@ximian.com>
-
- * gui/dialogs/event-editor.c (event_editor_destroy): Explicitly
- destroy the EMeetingModel. This is a hack to work around problems
- with the reference counting; we are still leaking the
- EMeetingModels.
-
- * gui/e-meeting-time-sel.c
- (e_meeting_time_selector_construct): Ref our EMeetingModel.
- (e_meeting_time_selector_destroy): Unref the model.
-
- * gui/e-meeting-model.c (destroy): Properly destroy
- corba_select_names with a call to bonobo_object_release_unref.
- (Fixes 14002)
-
-2001-12-05 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/dialogs/event-page.glade: added entry for the LOCATION field
-
- * gui/dialogs/event-page.c: added support for the new LOCATION entry
- added in the Event editor.
-
-2001-12-05 Zbigniew Chyla <cyba@gnome.pl>
-
- * gui/itip-utils.c (comp_subject, comp_description):
- Marked strings for translation.
-
-2001-12-03 Damon Chaplin <damon@ximian.com>
-
- * gui/e-meeting-model.c:
- * gui/calendar-model.c: make sure we call e_table_model_pre_change()
- before changing the model.
-
- * gui/calendar-config.c (calendar_config_configure_e_calendar_table):
- removed call to e_table_model_changed(). calendar_model_refresh()
- results in that anyway.
-
-2001-12-03 Damon Chaplin <damon@ximian.com>
-
- * gui/e-calendar-table.etspec: disabled 'Alarms', 'End Date' and
- 'Show Time As' fields, as these are not useful for tasks. We may want
- to reenable them later if we add a table view of calendar events.
-
-2001-12-02 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/calendar-offline-handler.c (backend_cal_opened): connect to
- "cal_set_mode" signal before calling cal_client_set_mode. Also,
- s/cal_mode_set/cal_set_mode
- (backend_go_offline): connect to "cal_opened" signal before calling
- cal_client_open_calendar
-
-2001-11-30 Damon Chaplin <damon@ximian.com>
-
- * gui/e-itip-control.c (remove_item): only show the dialog if we
- created it. Hopefully fixes bug #15774.
- Also ifdef'ed out a lot of code that isn't currently used, including
- code to use a label which is never created. The unused code was there
- to support handling multiple iTIP objects in a message, but was never
- updated when we switched to use HTML for the control. Fixes bug #16232.
-
-2001-11-28 Federico Mena Quintero <federico@ximian.com>
-
- * gui/gnome-cal.c (gnome_calendar_new_task): Set the category of
- the new task to that of the search bar. Fixes bug #15533.
-
-2001-11-27 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-itip-control.c (update_attendee_status):
- * gui/itip-utils.c (comp_to_list): fixed typos in translatable
- strings. Fixes Ximian #15456
-
-2001-11-14 Damon Chaplin <damon@ximian.com>
-
- * gui/print.c: Substituted gnome_font_get_width_string() with
- gnome_font_get_width_utf8() and gnome_font_get_width_string_n()
- with gnome_font_get_width_utf8_sized(). Fixes calendar part of #15379.
-
-2001-11-14 Federico Mena Quintero <federico@ximian.com>
-
- * gui/calendar-model.c (date_value_to_string): Convert the buffer
- to UTF8.
- (calendar_model_value_to_string): Do not convert the string fields
- to UTF8 again; they are already in UTF8. Fixes the UTF8-related
- bits of bug #15304.
-
-2001-11-14 Damon Chaplin <damon@ximian.com>
-
- * gui/calendar-model.c:
- * cal-util/cal-component.h: #ifdef'ed out the LOCATION field for now,
- since it wasn't supported everywhere, or in the .etspec file.
-
-2001-11-14 Damon Chaplin <damon@ximian.com>
-
- * gui/e-calendar-table.c: don't abort when e_table_selected_count()
- returns odd values. There seems to be a bug in ETable. This is to
- avoid bug #13843.
-
-2001-11-13 Federico Mena Quintero <federico@ximian.com>
-
- (committed to CVS by Damon)
- Fixes bug #15137.
-
- * gui/e-day-view.c (e_day_view_on_delete_appointment): Do not try
- to operate on the event if it gets deleted while stopping the
- edition.
- (e_day_view_on_event_double_click): Likewise.
- (e_day_view_on_long_event_button_press): Likewise.
- (e_day_view_on_event_button_press): Likewise.
- (e_day_view_on_long_event_click): Likewise.
- (e_day_view_on_event_click): Likewise.
-
- * gui/e-week-view.c (e_week_view_on_text_item_event): Likewise.
-
-2001-11-14 JP Rosevear <jpr@ximian.com>
-
- * conduits/calendar/calendar-conduit.c (pre_sync): remove silly
- debug warning
-
-2001-11-13 Damon Chaplin <damon@ximian.com>
-
- * gui/alarm-notify/config-data.c (ensure_inited):
- * gui/calendar-config.c (config_read):
- * conduits/todo/todo-conduit.c (get_default_timezone):
- * conduits/calendar/calendar-conduit.c (get_default_timezone):
- make the timezone default to UTC. Fixes bug #14362.
-
-2001-11-13 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-week-view.c (selection_received): only change the day,
- month and year for the start date, for not screwing up the start
- time, which was being set to midnight always (Fixes Ximian #5287)
- Also, deal correctly with VCALENDAR components
-
- * gui/e-day-view.c (selection_received): dela correctly with
- VCALENDAR components being pasted
-
-2001-11-11 Federico Mena Quintero <federico@ximian.com>
-
- * gui/alarm-notify/save.c (get_calendars_to_load): The last
- argument to the bonobo_config_get_XXX_with_default() is a gboolean
- *, not a CORBA_Environment *. Fixes bug #14655.
-
-2001-11-11 JP Rosevear <jpr@ximian.com>
-
- * pcs/cal-backend-file.c (free_busy_instance): recurrence
- expansion callback for free/busy
- (create_user_free_busy): expand recurrences and use date/time
- values for dtstart and dtend
-
-2001-11-11 JP Rosevear <jpr@ximian.com>
-
- * gui/e-meeting-model.h: new protos
-
- * gui/e-meeting-model.c (e_meeting_model_get_zone): accessor
- (e_meeting_model_set_zone): ditto
- (init): init to the calendar default zone
- (process_free_busy_comp): take the zone to convert to as a param
- (e_meeting_model_refresh_busy_periods): redraw properly
-
- * gui/dialogs/schedule-page.c (update_time): set the zone of the
- model
-
-2001-11-09 Damon Chaplin <damon@ximian.com>
-
- * gui/e-week-view.c (e_week_view_key_press): don't subtract a day
- from DTEND. For DATE values we don't include the entire day now.
- Fixes bug #14842.
-
-2001-11-09 Damon Chaplin <damon@ximian.com>
-
- * gui/e-week-view-layout.c (e_week_view_layout_events): fix buffer
- overflow. Fixes bug #10285 (the printing of lines & dates in the
- printout of the month view).
-
-2001-11-09 Zbigniew Chyla <cyba@gnome.pl>
-
- * gui/dialogs/meeting-page.c
- (meeting_page_fill_widgets): Convert strings to GTK+ encoding.
- (meeting_page_destroy): Free allocated strings before freeing the list
- itself.
-
-2001-11-08 JP Rosevear <jpr@ximian.com>
-
- * gui/e-meeting-time-sel.c
- (e_meeting_time_selector_timeout_handler): don't let an empty
- event occur for all days when auto scrolling
-
-2001-11-08 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/cal-backend-file.c
- (cal_backend_file_compute_changes_foreach_key): don't leak the
- string returned by cal_component_get_as_string nor the temporary
- CalComponent we create
-
-2001-11-08 JP Rosevear <jpr@ximian.com>
-
- * gui/e-itip-control.c (ok_clicked_cb): don't add the item, remove
- it if declining (in case it was added before)
- (remove_item): Since we can't discern between an item not found
- and another error, always say the removal is complete
-
-2001-11-07 Zbigniew Chyla <cyba@gnome.pl>
-
- * gui/e-cell-date-edit-text.c (ecd_get_text):
- Convert generated string to UTF-8.
-
-2001-11-07 JP Rosevear <jpr@ximian.com>
-
- * gui/e-meeting-time-sel.c
- (e_meeting_time_selector_on_start_time_changed): emit changed
- signal
- (e_meeting_time_selector_on_end_time_changed): emit changed
- signal, if end time is now before start time and all day event,
- make sure a whole day is still selected
- (e_meeting_time_selector_drag_meeting_time): calculate the first
- and last_time's in whole days for all day events
- (e_meeting_time_selector_timeout_handler): calculate the drag time
- to be whole days for all day events and scroll the canvas even if
- we don't update the time so the user can see where they're headed
-
-2001-11-06 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/event-editor.c (event_editor_edit_comp): make sure
- to remove all attendees from the model when we edit a new comp,
- append the pages if they are needed and we weren't showing them
- before
-
- * gui/dialogs/task-editor.c (task_editor_edit_comp): same as above
-
- * gui/dialogs/comp-editor.c (comp_editor_remove_page): check for a
- return value indicating the page was not found and return if so
-
-2001-11-05 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/dialogs/e-delegate-dialog.c: #include
- "Evolution-Addressbook-SelectNames.h", not
- "../Evolution-Addressbook-SelectNames.h". Grrr.
-
-2001-11-05 JP Rosevear <jpr@ximian.com>
-
- * gui/e-meeting-time-sel.c (e_meeting_time_selector_class_init):
- add a changed signal
- (e_meeting_time_selector_construct): emit changed signal
- (e_meeting_time_selector_set_meeting_time): ditto
- (e_meeting_time_selector_set_all_day): set the all day setting
- (e_meeting_time_selector_autopick): emit changed signal
- (e_meeting_time_selector_find_nearest_interval): find proper
- interval when in all day mode
- (e_meeting_time_selector_find_nearest_interval_backward): ditto
- (e_meeting_time_selector_drag_meeting_time): for all day events,
- move the time when past the 12 hour mark, and and always make sure
- 1 full day is selected, emit changed signal when appropriate
- (e_meeting_time_selector_update_start_date_edit): set date and
- time of day together
- (e_meeting_time_selector_update_end_date_edit): ditto, and adjust
- display time if all day event
-
- * gui/e-meeting-time-sel-item.c
- (e_meeting_time_selector_item_draw): remove unused variable
- (e_meeting_time_selector_item_button_press): for all day mode,
- make the interval a whole day
-
- * gui/dialogs/schedule-page.c (update_time): set the meeting time
- selector setting instead of manual mucking with the e-date-edit
- widgets
- (init_widgets): listen to the changed signal of the meeting time
- selector instead of propagating multiple events as it updates
-
- * gui/dialogs/event-page.c (update_time): block time zone change
- signals
-
-2001-11-05 Damon Chaplin <damon@ximian.com>
-
- * gui/calendar-model.c (dup_date_edit_value): removed ';' in the wrong
- place. Fixes bug #14421.
-
-2001-11-05 Dan Winship <danw@ximian.com>
-
- * gui/alarm-notify/Makefile.am (evolution_alarm_notify_LDFLAGS):
- -export-dynamic for libglade custom widget.
-
-2001-11-04 Damon Chaplin <damon@ximian.com>
-
- * gui/comp-editor-factory.c (get_default_component): use TZID from the
- builtin timezone, instead of using the location name.
-
-2001-11-02 Federico Mena Quintero <federico@ximian.com>
-
- * cal-util/cal-util.c (compute_alarm_range): Short-circuit the
- calculation of the repeat time if there are zero repetitions.
- (compute_alarm_range): I'm a moron. De-reference alarm_start when
- subtracting stuff from it! Fixes bug #14209.
-
-2001-10-31 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/dialogs/Makefile.am: Added rules to generate
- `Evolution-Addressbook-SelectNames.h'.
-
- * gui/dialogs/comp-editor-util.h: #include
- "Evolution-Addressbook-SelectNames.h" from this directory.
-
-2001-10-31 Federico Mena Quintero <federico@ximian.com>
-
- * gui/dialogs/alarm-options.c: #include <string.h>
-
-2001-10-31 Federico Mena Quintero <federico@ximian.com>
-
- * gui/gnome-cal.c (dn_query_obj_updated_cb): If a query is not in
- progress, just retag the whole thing. An event may change dates
- and tag_calendar_by_comp() would not know how to untag the old
- dates. Fixes bug #10220.
-
- * pcs/query.c (start_query_cb): Connect to the backend's
- "obj_updated" and "obj_removed" signals here instead of in
- query_construct(). If a query is started while another one is
- notifying of an update, these signal connections would get appened
- to the running signal (the one that triggered the notification
- about an update) and the new signal handlers would also get
- called. We are really not interested in updates before we
- populate the query, because we'll catch the changes anyways.
-
-2001-10-31 Federico Mena Quintero <federico@ximian.com>
-
- Fix bug #13723.
-
- * gui/gnome-cal.h (GnomeCalendarClass): New signals
- "calendar_focus_change", "taskpad_focus_change", and
- "taskpad_selection_changed". Renamed "selection_changed" to
- "calendar_selection_changed".
-
- * gui/gnome-cal.c (gnome_calendar_get_num_tasks_selected): New
- function.
- (setup_widgets): Connect to the focus event signals of the task
- pad and the calendar view widgets.
- (gnome_calendar_delete_selection): Renamed from
- gnome_calendar_delete_event().
- (gnome_calendar_cut_clipboard): Handle the current focus location.
- (gnome_calendar_copy_clipboard): Likewise.
- (gnome_calendar_paste_clipboard): Likewise.
- (gnome_calendar_delete_selection): Likewise.
- (table_selection_change_cb): New callback.
-
- * gui/calendar-commands.c (sensitize_calendar_commands): Take in
- whether we should unconditionally disable everything.
- (sensitize_taskpad_commands): Analogous function to the above.
- (gcal_calendar_focus_change_cb): New callback, used for calendar
- views.
- (gcal_taskpad_focus_change_cb): New callback, used for the
- taskpad.
-
- * gui/e-day-view.c (e_day_view_key_press): Use a better test for
- keys that should start editing. Fixes bug #6447.
-
- * gui/e-week-view.c (e_week_view_key_press): Likewise.
-
-2001-10-31 Christopher James Lahey <clahey@ximian.com>
-
- * gui/calendar-model.c: Make the pre_changes and changes match
- here.
-
-2001-10-31 JP Rosevear <jpr@ximian.com>
-
- * gui/itip-utils.c (itip_send_comp): send as mixed rather than
- alternative
-
-2001-10-31 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/alarm-notify/save.c (KEY_CALENDARS_TO_LOAD):
- Removed.
- (KEY_NUM_CALENDARS_TO_LOAD): New key, containing the number of
- calendars to load.
- (BASE_KEY_CALENDAR_TO_LOAD): New base key name for the URIs of the
- calendars to load.
- (save_calendars_to_load): Rewrote to not use a sequence, to work
- around an ORBit bug that causes bonobo-moniker-xmldb to crash.
- (get_calendars_to_load): Likewise.
-
-2001-10-30 Damon Chaplin <damon@ximian.com>
-
- * gui/dialogs/comp-editor.c (comp_editor_remove_page): disconnect
- signals added in append_page(). Fixes Gtk-Critical warning about
- GtkAccelGroup being added twice to a window.
-
-2001-10-30 JP Rosevear <jpr@ximian.com>
-
- * gui/itip-utils.c (itip_send_comp): set a body for the message
-
-2001-10-30 Dan Winship <danw@ximian.com>
-
- * gui/itip-utils.c (itip_send_comp): call
- GNOME_Evolution_Composer_setMultipartType to get a
- multipart/alternative.
-
-2001-10-30 JP Rosevear <jpr@ximian.com>
-
- * gui/e-meeting-time-sel.c
- (e_meeting_time_selector_on_start_time_changed): don't overwrite
- memory
- (e_meeting_time_selector_on_end_time_changed): ditto
-
-2001-10-30 Damon Chaplin <damon@ximian.com>
-
- * gui/calendar-model.c (dup_date_edit_value): return NULL if passed
- NULL. Should fix bug #14048.
-
-2001-10-30 Federico Mena Quintero <federico@ximian.com>
-
- * gui/calendar-config.c (config_read): Do not ignore the
- exceptions of the cases that do not have defaults.
-
-2001-10-30 JP Rosevear <jpr@ximian.com>
-
- * gui/e-meeting-time-sel.c
- (e_meeting_time_selector_drag_meeting_time): if we are doing all
- day stuff, make the drag increment 1 day at a time
-
-2001-10-30 Federico Mena Quintero <federico@ximian.com>
-
- * gui/dialogs/meeting-page.c (meeting_page_fill_component): Add
- _() to a string that was missing it.
-
-2001-10-30 Federico Mena Quintero <federico@ximian.com>
-
- * gui/dialogs/meeting-page.c (table_canvas_focus_out_cb): Commit
- the ETable click-to-add for if the dialog is being destroyed.
- Should fix bug #13959.
-
-2001-10-30 Federico Mena Quintero <federico@ximian.com>
-
- * gui/itip-utils.c (itip_send_comp): Allocate enough space for the
- string! (was missing the null terminator) Possibly fixes #13924.
- Thanks a *LOT* to Michael Zucchi for running this through Purify.
-
-2001-10-30 JP Rosevear <jpr@ximian.com>
-
- * gui/e-meeting-time-sel-item.c
- (e_meeting_time_selector_item_button_press): move in whole day
- increments if we are in all day mode
-
- * gui/e-meeting-time-sel.c
- (e_meeting_time_selector_on_start_time_changed): get rid of
- localtime call
- (e_meeting_time_selector_on_end_time_changed): ditto
- (e_meeting_time_selector_update_start_date_edit): set the date
- editor using the meeting time fields directly
- (e_meeting_time_selector_update_end_date_edit): ditto
-
- * gui/dialogs/schedule-page.c (update_time): do the set_show_time
- stuff first
-
- * conduits/calendar/calendar-conduit.c (process_multi_day): don't
- adjust the time, set the default timezone for date values
-
-2001-10-30 Dan Winship <danw@ximian.com>
-
- * gui/alarm-notify/Makefile.am (INCLUDES):
- s/BONOBO_HTML_GNOME_LIBS/BONOBO_HTML_GNOME_CFLAGS/
-
-2001-10-30 JP Rosevear <jpr@ximian.com>
-
- * gui/e-meeting-model.c (e_meeting_model_count_actual_attendees):
- count the actual attendees (doesn't include people delegating
-
- * gui/e-meeting-time-sel.c: use
- e_meeting_model_count_actual_attendees (renamed)
-
- * gui/e-meeting-time-sel-item.c: use
- e_meeting_model_etable_view_to_model_row calls instead of calling
- on the model directly, use e_meeting_model_count_actual_attendees
-
- * gui/e-meeting-model.c
- (e_meeting_model_etable_model_to_view_row): get the real mapping
- (e_meeting_model_etable_view_to_model_row): ditto
- (get_key): e-table-without callback
- (duplicate_key): ditto
- (free_gotten_key): ditto
- (free_duplicated_key): ditto
- (init): create without model
- (e_meeting_model_etable_from_model): build etable from without
- model
-
- * gui/e-meeting-model.h: update protos
-
- * gui/dialogs/meeting-page.c (right_click_cb): convert row from
- view to model row
-
-2001-10-30 Damon Chaplin <damon@ximian.com>
-
- * gui/dialogs/task-page.c (task_page_fill_widgets): set to the default
- timezone for DATE values, in case the user switches to a DATE-TIME.
-
-2001-10-30 Damon Chaplin <damon@ximian.com>
-
- * gui/dialogs/task-page.c: handle DATE values for Start and Due dates.
-
-2001-10-30 Damon Chaplin <damon@ximian.com>
-
- * gui/dialogs/schedule-page.c:
- * gui/dialogs/event-page.c:
- * gui/dialogs/comp-editor-util.c: updated code to handle DATE values.
-
- * gui/gnome-cal.c (gnome_calendar_new_appointment_for):
- * gui/e-day-view.c (e_day_view_key_press): updated DATE code.
-
- * gui/e-cell-date-edit-text.c:
- * gui/calendar-model.c: updated to support DATE values.
-
- * cal-util/cal-recur.c (cal_recur_generate_instances_of_rule): updated
- to use DATE values in same way as Outlook - i.e. the DTEND date is
- not included entirely. Though I did make it so that if the DTSTART
- and DTEND used the same DATE value, it includes the entire day.
- So 1-day events should be the same. Long All-Day events will be
- 1 day shorter.
-
- * cal-util/cal-component.c (cal_component_get_start_plus_duration):
- don't subtract a day from the end date.
-
- * gui/tasks-control.c: updated the EPixmap paths for Cut/Copy etc.
- Removed Print & Print Preview paths, since we don't have menu commands
- for these any more.
-
-2001-10-30 Federico Mena Quintero <federico@ximian.com>
-
- Fix bug #10016.
-
- * gui/dialogs/comp-editor.c (comp_editor_merge_ui): Use
- bonobo_ui_util_set_ui() instead of doing things by hand. Hmmm, if
- only that function had a way of telling us whether it failed so
- that we could avoid setting the verb list...
-
- * gui/dialogs/event-editor.c (event_editor_init): Do not pass the
- filename with the full path so that Bonobo can find it in a smart
- way.
-
- * gui/dialogs/task-editor.c (task_editor_init): Likewise.
-
-2001-10-30 Federico Mena Quintero <federico@ximian.com>
-
- * gui/dialogs/delete-comp.c (delete_component_dialog): Use an
- EMessageBox instead of a gnome_dialog_question so that the label
- gets line breaking. Fixes bug #11260.
-
-2001-10-29 Federico Mena Quintero <federico@ximian.com>
-
- Fix bug #13649.
-
- * gui/calendar-config.c
- (calendar_config_get_use_default_reminder): New function.
- (calendar_config_set_use_default_reminder): New function.
- (calendar_config_get_default_reminder_interval): New function.
- (calendar_config_set_default_reminder_interval): New function.
- (calendar_config_get_default_reminder_units): New function.
- (calendar_config_set_default_reminder_units): New function.
- (config_read): Get the options for default reminders.
- (calendar_config_write): Set the options for default reminders.
-
- * gui/dialogs/cal-prefs-dialog.c (cal_prefs_dialog_show_config):
- Set the default reminder widgets from the config values.
- (cal_prefs_dialog_update_config): Set the config values from the
- widgets.
-
- * gui/comp-util.c (cal_comp_event_new_with_defaults): New
- function; creates a VEVENT component with the default alarm.
-
- * gui/e-day-view.c (e_day_view_key_press): Use
- cal_comp_event_new_with_defaults ();
-
- * gui/e-week-view.c (e_week_view_key_press): Likewise.
- * gui/calendar-model.c (calendar_model_append_row): Likewise.
- * gui/comp-editor-factory.c (get_default_component): Likewise.
- * gui/gnome-cal.c (gnome_calendar_new_appointment_for): Likewise.
-
- * cal-util/cal-component.c (ensure_alarm_properties_cb): Ensure we
- have a DESCRIPTION property.
- (cal_component_commit_sequence): Ensure we have the mandatory
- alarm properties.
-
-2001-10-30 JP Rosevear <jpr@ximian.com>
-
- * gui/e-meeting-model.c (process_section): process an individual
- section here
- (select_names_ok_cb): call above
- (get_select_name_dialog): listen for ok:dialog signal
-
-2001-10-29 Damon Chaplin <damon@ximian.com>
-
- * importers/Makefile.am (evolution_calendar_importer_LDADD):
- * gui/Makefile.am (evolution_calendar_LDADD):
- * cal-util/Makefile.am (test_recur_LDADD):
- * cal-client/Makefile.am (client_test_LDADD): use libical-evolution.la
-
- * gui/dialogs/schedule-page.c: save the timezone passed in for the
- start time, so if our times are changed we use this. Also, if the
- end time was passed in in a different timezone, convert it.
- Also hide the time fields for DATE values. Note that DATE values still
- do not work.
-
- * gui/dialogs/meeting-page.glade: changed "Invite Others" to
- "Invite Others..." to be consistent with the other page.
-
- * gui/dialogs/event-page.c (times_updated):
- (all_day_event_toggled_cb): set is_date if appropriate.
-
- * gui/e-itip-control.c (write_label_piece): convert all UTC times to
- the current timezone. Outlook sends simple, non-recurring, events as
- UTC times, which isn't very useful.
-
-2001-10-29 Federico Mena Quintero <federico@ximian.com>
-
- * gui/main.c (launch_alarm_daemon): Launch the alarm daemon as
- soon as the calendar component is started. Fixes bug #13867;
- we can't really do much better than this.
-
-2001-10-29 Federico Mena Quintero <federico@ximian.com>
-
- * gui/tasks-control.c (pixmaps): Fix the verb names for the
- pixmaps in the Edit menu; they were out of synch with the XML
- UI description.
-
-2001-10-29 Chris Toshok <toshok@ximian.com>
-
- * pcs/cal-factory.c (cal_factory_dump_active_backends): new
- function.
- (dump_backend): new function.
-
- * pcs/cal-factory.h: add prototype for
- cal_factory_dump_active_backends.
-
-2001-10-29 Federico Mena Quintero <federico@ximian.com>
-
- Fix bug #12163.
-
- * cal-util/cal-util.c (compute_alarm_range): Take alarm
- repetitions into account.
- (add_alarm_occurrences_cb): Add alarm repetitions.
- (generate_absolute_triggers): Likewise.
- (generate_absolute_triggers): Oops, absolute triggers are in UTC,
- so convert them as such. Also, pay attention to the timezones of
- the dtstart and dtend properties.
-
-2001-10-29 JP Rosevear <jpr@ximian.com>
-
- * importers/Makefile.am: include the header as a source so it gets
- dist'ed.
-
-2001-10-29 Ettore Perazzoli <ettore@ximian.com>
-
- * importers/Makefile.am (INCLUDES):
- s/BONOBO_CFLAGS/BONOBO_GNOME_CFLAGS/.
-
-2001-10-29 Rodrigo Moya <rodrigo@ximian.com>
-
- * importers/icalendar-importer.c (load_file_fn): fixed URI
- construction, which was preventing importing into the root
- calendar (~/evo/local/Calendar/)
-
-2001-10-29 JP Rosevear <jpr@ximian.com>
-
- * conduits/calendar/calendar-conduit.c (is_all_day): handle date
- values
-
-2001-10-29 Rodrigo Moya <rodrigo@ximian.com>
-
- * importers/: added evolution-calendar-importer binary, starting
- with an iCalendar file importer
-
-2001-10-29 JP Rosevear <jpr@ximian.com>
-
- * conduits/todo/todo-conduit-config.h
- (todoconduit_load_configuration): get the management object by id
-
- * conduits/calendar/calendar-conduit-config.h
- (calconduit_load_configuration): ditto
-
-2001-10-29 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/calendar-config.[ch] (calendar_config_get_default_uri):
- (calendar_config_set_default_uri):
- (calendar_config_get_default_tasks_uri):
- (calendar_config_set_default_tasks_uri): new functions for setting
- and retrieving the default calendar URIs
-
- * gui/e-itip-control.c (init): don't use
- hard-coded URI, but use the default calendar URI, as returned
- by calendar_config_get_default_uri
- (start_calendar_server): added a "gboolean tasks" parameter, so
- that the local tasks.ics file is used if the calendar to be
- started is for tasks when no default tasks URI is found in
- the configuration
-
-2001-10-28 JP Rosevear <jpr@ximian.com>
-
- * conduits/calendar/calendar-conduit.c (add_record): unref the
- comp when finished
-
- * conduits/todo/todo-conduit.c (add_record): ditto
-
-2001-10-28 Damon Chaplin <damon@ximian.com>
-
- * gui/dialogs/task-page.c (task_page_fill_widgets): added break
- statements after each case, when setting the classification.
- Fixes bug #13772.
-
-2001-10-28 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-client/cal-client.c (destroy_wombat_client): removed this
- function, as we don't need to unref at all the WombatClient
- object, since it is aggregated to the CalListener object, which
- will take care of unrefing it (Fixes Ximian #12001)
- (cal_client_open_calendar): create the WombatClient here
-
-2001-10-28 Damon Chaplin <damon@ximian.com>
-
- * gui/print.c (print_todo_details): get the tasks directly from the
- CalendarModel, so we get the filtering & sorting for free. Fixes
- bug #10280. Hmm. This seems too easy. It isn't going to work is it...
-
- * gui/gnome-cal.c (gnome_calendar_get_task_pad): new function to get
- the TaskPad ECalendarTable, for printing.
-
- * gui/calendar-model.c:
- * gui/calendar-config.c (calendar_config_get_hide_completed_tasks_sexp):
- split this out from calendar-model.c so we could use it for printing,
- but ended up doing that a different way.
-
- * gui/dialogs/task-page.c (init_widgets): removed a duplicated signal
- connected to field_changed_cb().
-
-2001-10-27 Damon Chaplin <damon@ximian.com>
-
- * gui/print.c (print_week_view):
- (range_selector_new): when the week start day is set to Sunday, we
- have to be careful to make sure we print the correct week, since
- the previous Saturday is actually printed first. Fixes bug #13687.
- (print_week_summary): always set compress_weekend to true if
- multi_week_view is FALSE (i.e. we are printing the week view).
- Fixes bug #13688.
-
- * gui/e-itip-control.c (send_freebusy): use the timezones from the
- DTSTART and DTEND.
- (write_label_piece): output the date-time and the timezone after it.
- Note that we may want to convert it to the current timezone and display
- that as well. Also converted COMPLETED to the current timezone.
- And fixed all uses of old timezone functions.
-
- * gui/dialogs/comp-editor.c (commit_all_fields): added function to
- set the focus in the window to NULL, so all fields lose their focus,
- so they emit "changed" signals and update their values if needed.
- We call this when most menu commands are used, e.g. 'Save and Close',
- 'Print' etc. Fixes bug #11434. In future we should also check fields
- are valid and show dialogs if they are not.
-
- * gui/calendar-model.c (get_completed): use the completed value
- properly. Fixes bug #13694.
-
- * cal-util/timeutil.c (icaltimetype_to_tm_with_zone): don't check
- from_zone and to_zone != NULL. A NULL zone is valid, it is for
- floating times.
-
-2001-10-27 Federico Mena Quintero <federico@ximian.com>
-
- * gui/e-day-view.c (e_day_view_on_text_item_event): Cancel editing
- if the user presses Escape.
-
- * gui/e-week-view.c (e_week_view_on_text_item_event): Likewise.
-
- * gui/cal-search-bar.c: #include <string.h>
-
-2001-10-27 Federico Mena Quintero <federico@ximian.com>
-
- * gui/e-day-view.c (e_day_view_on_editing_stopped): Delete
- appointments with empty summaries. Fixes Ximian bug #780.
-
- * gui/e-week-view.c (e_week_view_on_editing_stopped): Likewise.
-
- * gui/dialogs/delete-comp.c (delete_component_dialog): Added an
- argument to specify whether we unconditionally want single
- components to be considered as not having a summary.
-
- * gui/comp-util.c (cal_comp_confirm_delete_empty_comp): New
- function.
-
- * gui/misc.[ch]: New files with miscellaneous utility functions;
- moved string_is_empty() over from calendar-model.c.
-
- * gui/calendar-model.c: Use the string_is_empty()
- function from misc.c.
-
- * gui/Makefile.am (evolution_calendar_SOURCES): Added misc.[ch] to
- the list of sources.
-
-2001-10-27 JP Rosevear <jpr@ximian.com>
-
- * conduits/todo/todo-conduit.c (local_record_from_comp): touch on
- lookup
- (check_for_slow_setting): write touched only if slow sync
- (match): touch on lookup
-
- * conduits/calendar/calendar-conduit.c (local_record_from_comp):
- touch the record on lookup
- (check_for_slow_setting): write touched only if slow sync
- (pre_sync): don't touch on lookup
- (match): touch on lookup
-
-2001-10-26 JP Rosevear <jpr@ximian.com>
-
- * conduits/calendar/e-calendar.conduit.in: remove the merges as
- valid sync types
-
- * conduits/todo/e-todo.conduit.in: as above
-
- * conduits/calendar/calendar-conduit.c (pre_sync): write out only
- the touched records if we are doing copies
-
- * conduits/todo/todo-conduit.c: as above
-
- * conduits/calendar/calendar-conduit-config.h
- (calconduit_load_configuration): get the sync type
-
- * conduits/todo/todo-conduit-config.h: as above
-
-2001-10-26 Damon Chaplin <damon@ximian.com>
-
- * gui/e-itip-control.c (write_label_piece): convert the formatted
- date to UTF-8.
-
- * cal-util/cal-recur.c (CAL_OBJ_DEBUG): turn off debug functions.
-
- * gui/dialogs/comp-editor-util.c (parse_contact_string): handle UTF8
- correctly. Bug #4450. Good enough for 1.0.
-
- * gui/e-week-view-event-item.c (e_week_view_draw_time): set the gc
- color before drawing. Should fix bug #11469.
-
- * gui/dialogs/task-editor.c (task_editor_edit_comp): show or hide the
- meeting page as appropriate. Note this may be called more than once,
- if the task gets updated somewhere else and the user clicks 'Update
- the object'. Hopefully fixes bug #12930.
-
- * gui/print.c (print_comp_item): printed more fields and made a little
- prettier. Fixes bug #9352.
- (print_date_label): used the correct timezones for each date field.
-
- * *.c: removed several debug messages.
-
-2001-10-26 JP Rosevear <jpr@ximian.com>
-
- * conduits/calendar/calendar-conduit.c (check_for_slow_setting):
- make debug output more accurate
-
- * conduits/todo/todo-conduit.c (check_for_slow_setting): ditto
-
-2001-10-26 JP Rosevear <jpr@ximian.com>
-
- * conduits/todo/todo-conduit.c (pre_sync): remove the uid from the
- map if was archived and is now deleted
-
- * conduits/calendar/calendar-conduit.c: ditto
-
-2001-10-26 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-calendar_table.c (delete_selected_components):
- (selection_received): added status bar messages
-
- * gui/e-day-view.c (e_day_view_cut_clipboard):
- (selection_received): likewise
-
- * gui/e-week-view.c (e_week_view_cut_clipboard):
- (selection_received): likewise
-
-2001-10-26 JP Rosevear <jpr@ximian.com>
-
- * conduits/calendar/calendar-conduit.h: modify fields
-
- * conduits/todo/todo-conduit.h: as above
-
- * conduits/calendar/calendar-conduit.c (print_remote): free the
- struct after use
- (e_calendar_context_new): explicitly init context fields
- (e_calendar_context_destroy): free local records and properly free
- changed hash elements
- (start_calendar_server_cb): tidy
- (start_calendar_server): ditto
- (free_local): free a local record
- (local_record_to_pilot_record): use a static buffer to avoid leaks
- (local_record_from_comp): only copy over alarm stuff from the
- original record, we sync everything else
- (local_record_from_uid): unref the comp when we are done
- (pre_sync): free change_id
- (post_sync): ditto
- (for_each): track locals
- (for_each_modified): ditto
- (free_match): use free_local
-
- * conduits/todo/todo-conduit.c: as above
-
-2001-10-26 Federico Mena Quintero <federico@ximian.com>
-
- * pcs/cal.c (cal_construct): Get a fresh CORBA_Environment for
- every CORBA call. Hopefully will fix #11978, but I'm not sure
- about what else could be happening.
- (cal_get_password): Free the exception.
-
-2001-10-25 Damon Chaplin <damon@ximian.com>
-
- * gui/e-itip-control.c: used functions to get PUBLISH_OPTIONS etc.,
- so we can translate them.
-
-2001-10-25 Damon Chaplin <damon@ximian.com>
-
- * cal-util/cal-recur.c (cal_obj_bysetpos_filter): subtract 1 from
- any positive BYSETPOS value, since our array is 0-based.
-
- * gui/dialogs/recurrence-page.c (simple_recur_to_comp):
- (recurrence_page_fill_widgets): Outlook (2000) will not accept monthly
- recurrences like BYDAY=2TU. Instead it uses BYDAY=TU;BYSETPOS=2.
- So to be compatable with it we now do the same, although we still
- accept and convert the old format.
-
- * cal-client/cal-client.c (cal_client_get_component_as_string): new
- function to return a complete VCALENDAR string containing a VEVENT
- or VTODO with all the VTIMEZONEs it uses.
-
- * gui/dialogs/comp-editor.c (save_as_ok): use above function so we
- save the VTIMEZONE data with the VEVENT/VTODO. Fixes bug #8626.
- Also made sure we output "METHOD:PUBLISH" since Outlook (2000) will
- not import it otherwise.
-
- * gui/dialogs/comp-editor.c (page_mapped_cb):
- (page_unmapped_cb): install/uninstall the GtkAccelGroup for the page.
- (comp_editor_append_page): connect to the map/unmap signals to
- install/uninstall the accelerators. (This is all for bug #11609,
- though of course it doesn't work too well in GTK+ 1.2 anyway.)
-
- * gui/dialogs/task-page.c (get_widgets):
- * gui/dialogs/task-details-page.c (get_widgets):
- * gui/dialogs/schedule-page.c (get_widgets):
- * gui/dialogs/recurrence-page.c (get_widgets):
- * gui/dialogs/meeting-page.c (get_widgets):
- * gui/dialogs/event-page.c (get_widgets):
- * gui/dialogs/alarm-page.c (get_widgets): got the GtkAccelGroup from
- the original window, ref'ed it and placed it in the CompEditorPage
- struct.
-
- * gui/dialogs/comp-editor-page.c (comp_editor_page_destroy): unref
- any GtkAccelGroup for the page.
-
- * gui/dialogs/task-page.glade: changed '_Confidential' to
- 'Con_fidential' as it clashed with '_Contacts'. It now matches the
- event editor as well.
-
- * gui/dialogs/event-page.glade:
- * gui/dialogs/task-page.glade: Set CAN_FOCUS to TRUE for the custom
- EDateEdit widgets, and set them as the accel targets of the labels.
-
-2001-10-25 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/dialogs/comp-editor.c (save_comp): show an error message when
- we can't update the object on the calendar server
-
-2001-10-25 Federico Mena Quintero <federico@ximian.com>
-
- * gui/control-factory.c: Ifdef-ed out the PersistFile bits.
-
- * gui/GNOME_Evolution_Calendar.oaf.in: The tasks folder does not
- support the PersistFile interface; removed it. Removed it as well
- from the calendar folder since it is aggregated but not actually
- implemented.
-
-2001-10-25 Federico Mena Quintero <federico@ximian.com>
-
- * gui/component-factory.c (xfer_folder): Handle tasks folders as
- well; was always using "calendar.ics" as the filename.
-
-2001-10-24 Damon Chaplin <damon@ximian.com>
-
- * gui/GNOME_Evolution_Calendar.oaf.in: added sections for Tasks
- factory and control. I hope someone checks these!
-
-2001-10-24 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component-factory.c (xfer_folder): Fixed to only copy the
- `calendar.ics' and `calendar.ics~' files.
-
-2001-10-24 Damon Chaplin <damon@ximian.com>
-
- * pcs/cal-backend-file.c (cal_backend_file_update_objects): when
- iterating over the subcomponents, use 'subcomp' rather than 'icalcomp'.
- That meant it wasn't working at all well when an entire VCALENDAR
- was passed in.
-
- * cal-util/cal-component.c: handle DURATION property used instead of
- DTEND or DUE. In cal_component_get_dtend/due we will return DTSTART
- + DURATION if necessary. In set_dtend/due we remove any DURATION
- property. Fixes bug #11262.
-
- * gui/e-meeting-model.c (build_etable):
- * gui/e-calendar-table.c (e_calendar_table_init): use U_ for the
- ECellCombo popdown strings, as it expects UTF-8 strings.
-
-2001-10-24 JP Rosevear <jpr@ximian.com>
-
- * gui/e-meeting-time-sel.c (e_meeting_time_selector_construct):
- track the spacer vbox
- (e_meeting_time_selector_style_set): make sure the rows are the
- correct size for the style
-
- * gui/e-meeting-time-sel-item.c
- (e_meeting_time_selector_item_paint_day_top): slight adjustments
- to where the text is drawn
-
- * gui/e-meeting-time-sel.h: new member
-
- * gui/e-meeting-model.c (build_etable): ensure uniform row height
-
- * conduits/todo/todo-conduit.c (comp_from_remote_record): mark
- status as completed in appropriate places and don't overwrite
- legitimate percentages and such
-
-2001-10-24 Federico Mena Quintero <federico@ximian.com>
-
- Fixes bug #5282.
-
- * cal-util/timeutil.c (icaltimetype_to_tm_with_zone): New function
- to avoid copying the same code all over the place.
- (icaltimetype_to_tm): Also set the tm.tm_wday.
-
- * gui/alarm-notify/alarm-queue.c (queue_midnight_refresh): Use
- time_day_end_with_zone().
- (load_alarms_for_today): Likewise. And oops, we were only
- computing the times and not loading the alarms.
- (obj_updated_cb): Likewise.
- (load_alarms): Removed assertion that is no longer valid because
- we may load the alarms for a client in two stages.
-
- * gui/dialogs/alarm-page.c (get_alarm_string): Convert absolute
- trigger times to the local timezone.
-
- * gui/alarm-notify/alarm-notify-dialog.c (write_html_heading):
- Convert the times to the local timezone.
- (alarm_notify_dialog): Likewise, for the window title.
- (alarm_notify_dialog): Set the window layer to WIN_LAYER_ONTOP.
-
- * gui/e-cell-date-edit-text.c (ecd_get_text): Use
- icaltimetype_to_tm_with_zone().
-
- * gui/alarm-notify/save.c (get_config_db): Made public.
- (discard_config_db): Made public.
-
- * gui/alarm-notify/config-data.[ch]: New files with functions to
- fetch the calendar configuration data used by the alarm daemon.
-
-2001-10-23 Damon Chaplin <damon@ximian.com>
-
- * cal-util/cal-component.c (cal_component_event_dates_match): make sure
- we free all the CalComponentDateTime's when we are finished.
-
- * gui/gnome-cal.c (gnome_calendar_notify_dates_shown_changed): just
- return if no time range is set.
-
-2001-10-23 JP Rosevear <jpr@ximian.com>
-
- * gui/e-meeting-time-sel.c
- (e_meeting_time_selector_table_vadjustment_changed): adjust the
- display canvas when the table scrolls
- (e_meeting_time_selector_construct): listen for table scrolling
-
-2001-10-23 JP Rosevear <jpr@ximian.com>
-
- * gui/e-meeting-model.c (build_etable): no longer set the
- scrollbar policy here
-
- * gui/e-meeting-time-sel.c
- (e_meeting_time_selector_update_main_canvas_scroll_region): add an
- extra row to the height so the click to add row can be properly
- seen
- (e_meeting_time_selector_construct): set the scrollbar policy for
- the etable scrolled
-
-2001-10-23 JP Rosevear <jpr@ximian.com>
-
- * cal-util/timeutil.c (icaltimetype_to_tm): convert an
- icaltimetype to a tm
- (tm_to_icaltimetype): vice versa
-
- * cal-util/timeutil.h: new protos
-
- * conduits/calendar/calendar-conduit.c: replace all mktime and
- localtime calls (except for debugging calls)
-
- * conduits/todo/todo-conduit.c: ditto
- (comp_from_remote_record): make sure the completed time is in UTC
-
-2001-10-23 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-client/cal-query.c (cal_query_construct) set priv->corba_query
- to CORBA_OBJECT_NIL if there was an error
-
-2001-10-22 Damon Chaplin <damon@ximian.com>
-
- * idl/evolution-calendar.idl: added setDefaultTimezone() method.
-
- * pcs/cal-backend.c (cal_backend_get_default_timezone):
- (cal_backend_set_default_timezone): new functions to call class
- methods.
-
- * pcs/cal-backend-file.c: lots of changes to handle the default
- timezone and use it.
-
- * pcs/query.c: use the default timezone.
-
- * gui/dialogs/task-details-page.c (date_changed_cb): initialized
- completed_tt.
-
- * gui/dialogs/event-page.c: changed it to handle DATE values. The
- 'All Day Event' checkbox is only set now when the DTSTART and DTEND
- are DATE values.
-
- * gui/dialogs/comp-editor-util.c (comp_editor_free_dates): free the
- CalComponentDateTime structs as well.
-
- * gui/e-tasks.c: set the default timezone on the server.
-
- * gui/tag-calendar.c:
- * gui/gnome-cal.c:
- * gui/e-week-view.c:
- * gui/e-day-view.c: updates to handle DATE values.
-
- * gui/e-calendar-table.c (date_compare_cb): updated to use the new
- ECellDateEditValue values, so it now works.
- (percent_compare_cb): updated to use GPOINTER_TO_INT values.
- (e_calendar_table_init): use an ECellPercent for the percent field
- and an ECellDateEditText for the date fields.
-
- * gui/comp-util.c (cal_comp_util_compare_event_timezones): return TRUE
- if the DTSTART or DTEND is a DATE value. We don't want to show the
- timezone icons for DATE values.
-
- * gui/comp-editor-factory.c (resolve_pending_requests): set the default
- timezone on the server.
-
- * gui/calendar-model.c: major changes to support sorting properly.
- For date and percent fields we now use subclasses of ECellText, so
- we don't use a char* as the model value. For the percent field we now
- use a GINT_TO_POINTER. For the date fields we now use a
- ECellDateEditValue* as the value.
-
- * gui/calendar-config.c (calendar_config_configure_e_cell_date_edit):
- set the timezone and use_24_hour flags of the new ECellDateEditText.
-
- * conduits/todo/todo-conduit.c (pre_sync):
- * conduits/calendar/calendar-conduit.c (pre_sync): set the default
- timezone on the server.
-
- * cal-util/timeutil.c (time_days_in_month): removed debug message.
-
- * cal-util/test-recur.c: try to handle timezones in the iCalendar
- file properly, and updated to pass default timezone.
-
- * cal-util/cal-util.c (cal_util_generate_alarms_for_comp):
- (cal_util_generate_alarms_for_list): added default timezone argument.
-
- * cal-util/cal-recur.c: changed many of the functions to take a default
- timezone, to use to resolve DATE and floating DATE-TIME values.
-
- * cal-client/cal-client.c (cal_client_set_default_timezone): new
- function to set the default timezone.
- (cal_client_ensure_timezone_on_server): new function to ensure that
- a given timezone is on the server.
-
- * gui/e-cell-date-edit-text.c: new subclass of ECellText to display
- and edit a date value.
-
- * cal-util/cal-recur.c (cal_obj_byday_expand_monthly): changed week_num
- to -week_num when calculating the weeks to go back from the end of the
- month for things like BYDAY=-2WE. Fixes bug #11525.
- (cal_recur_generate_instances_of_rule): only go up to MAX_YEAR (2037).
- We can't really handle anything past that anyway.
- (cal_recur_ensure_rule_end_date): initialize cb_date.end_date to 0,
- so if the RULE doesn't generate COUNT instances we save 0 as the
- time_t.
-
-2001-10-22 Federico Mena Quintero <federico@ximian.com>
-
- * gui/tasks-control-factory.c (tasks_control_factory_fn): Put up a
- warning dialog box if we failed to create the tasks control.
- Fixes bug #13033.
-
-2001-10-22 JP Rosevear <jpr@ximian.com>
-
- * gui/e-itip-control.c (set_date_label): write out the correct
- time in the control
-
- * pcs/cal.c (build_fb_seq): utility function to build sequences of
- f/b data
- (impl_Cal_get_free_busy): use above so we never return a NULL
-
- * conduits/calendar/calendar-conduit-config.h
- (calconduit_save_configuration): fix c/p error
- (calconduit_load_configuration): ditto
-
-2001-10-22 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/meeting-page.c (meeting_page_destroy): we don't need
- to save the state
-
- * gui/e-meeting-time-sel.c (e_meeting_time_selector_destroy):
- ditto
-
- * gui/e-meeting-model.c (build_etable): listen for the etable
- being destroyed
- (table_destroy_cb): save the state when the etable is destroyed
-
-2001-10-21 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/schedule-page.c (init_widgets): listen for changes
- in the date editors
- (schedule_page_set_dates): update the times when they change
- elsewhere
- (update_time): set the time in the dialog
- (time_changed_cb): notify of changed times
-
- * gui/dialogs/comp-editor.c (page_dates_changed_cb): don't call
- the set dates function on the page that noted the change
- (page_summary_changed_cb): same for set summary function
-
- * gui/dialogs/event-page.c (update_time): move time setting stuff
- to util function
- (event_page_set_dates): use it
- (event_page_fill_component): ditto
-
- * gui/e-meeting-time-sel.h: fix comment
-
-2001-10-19 Federico Mena Quintero <federico@ximian.com>
-
- * gui/alarm-notify/alarm-notify.c (add_uri_to_load): Do not assert
- if we fail to load the URI list. This would of course have been a
- bonobo-conf activation problem.
- (remove_uri_to_load): Likewise.
-
- * gui/alarm-notify/notify-main.c (load_calendars): Likewise.
-
- * gui/alarm-notify/alarm-queue.c (load_missed_alarms): Make the
- time range half-open so that we do not display the last alarm
- twice.
-
-2001-10-19 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/calendar-model.c (calendar_model_set_status_message): make
- it a public function
-
- * gui/e-tasks.c (e_tasks_open): display progress messages
- (cal_opened_cb): clean up status bar messages
-
- * gui/gnome-cal.c (gnome_calendar_open): display progress messages
- (client_cal_opened_cb): clean up status bar messages
-
-2001-10-19 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/calendar-model.c (set_status_message): new function
- (update_query): call set_status_message
- (query_query_done_cb):
- (query_eval_error_cb): clean up status bar messages
- (get_location, set_location): new functions for setting and
- retrieving the location in the calendar model
-
-2001-10-19 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/component-factory.c (owner_set_cb): keep a reference to the
- EvolutionShellClient component
-
- * gui/e-week-view.c (e_week_view_set_status_message): new function
- (update_query): call e_week_view_set_status_message
- (query_query_done_cb):
- (query_eval_error_cb): clean up status bar messages
-
- * gui/e-day-view.c (e_day_view_set_status_message): new function
- (update_query): call e_day_view_set_status_message
- (query_query_done_cb):
- (query_eval_error_cb): clean up status bar messages
-
- * gui/Makefile.am: added EVOLUTION_IMAGESDIR to CFLAGS
-
-2001-10-18 JP Rosevear <jpr@ximian.com>
-
- * gui/e-meeting-time-sel.c
- (e_meeting_time_selector_on_invite_others_button_clicked): call
- the invite others dialog in the model
-
- * gui/e-meeting-attendee.c (e_meeting_attendee_get_atype): pick
- attendee type based on role and cutype
-
- * gui/e-meeting-attendee.h: remove proto
-
- * gui/Makefile.am: compile select names idl
-
- * gui/e-meeting-model.h: new proto
-
- * gui/dialogs/meeting-page.c: remove invite others dialogs bits
- from here
-
- * gui/e-meeting-model.c (e_meeting_model_invite_others_dialog):
- and put them here
-
- * gui/dialogs/Makefile.am: compile corba bits in parent dir
-
- * gui/dialogs/comp-editor-util.h: reflect above in includes
-
- * gui/dialogs/e-delegate-dialog.c: ditto
-
- * gui/dialogs/schedule-page.c: ditto and clean includes
-
-2001-10-18 Larry Ewing <lewing@ximian.com>
-
- * gui/alarm-notify/alarm-notify-dialog.c: add html widget
- (url_requested_cb): add function to load images from file as they
- are requested.
- (write_html_heading): convert to using html.
- (alarm_notify_dialog): convert to use html display.
- (make_html_display): this is the function the custom widget in the
- galde file uses to create the html widget.
-
- * gui/alarm-notify/alarm-notify.glade: add placeholder for the
- custom html widget.
-
- * gui/alarm-notify/Makefile.am: add flags for gtkhtml and gal.
-
-2001-10-18 Federico Mena Quintero <federico@ximian.com>
-
- Adds session management for the alarm daemon. Also makes it store
- a list of calendars to be monitored. Those calendars will all be
- loaded when the alarm daemon starts up.
-
- * idl/evolution-calendar.idl (AlarmNotify): Removed the ::die()
- method. The alarm daemon now handles termination via the session
- manager's commands.
-
- * gui/alarm-notify/notify-main.c (set_session_parameters): New
- function, sets some parameters so that the session manager can
- restart the daemon via the evolution-alarm-client program. Also,
- sets up the "die" signal so that the daemon can terminate when the
- session ends.
- (load_calendars): New function to load the calendars on startup.
- (main): Set the session parameters. Load the calendars on startup.
-
- * gui/alarm-notify/alarm-notify.c (alarm_notify_add_calendar): New
- function, moved over from the impl_ function. Added a
- load_afterwards argument to indicate whether the calendar should
- just be loaded or if it should also be added to the list of
- calendars to load on startup.
- (AlarmNotify_addCalendar): Use alarm_notify_add_calendar().
- (AlarmNotify_removeCalendar): Remove the calendar from the list of
- calendars to load on startup.
-
- * gui/alarm-notify/save.c (save_calendars_to_load): New function,
- saves a sequence of the URIs to load.
- (get_calendars_to_load): New function, loads a sequence of
- calendars to load.
-
- * gui/alarm-notify/alarm.h: Removed stale prototype for alarm_init().
-
- * gui/component-factory.c (remove_folder): Ask the alarm daemon to
- stop monitoring alarms for the folder that is being deleted.
-
-2001-10-18 JP Rosevear <jpr@ximian.com>
-
- * gui/e-meeting-time-sel.c
-
- * gui/e-meeting-time-sel-item.c
- (e_meeting_time_selector_item_paint_day_top): use 12 or 24 hour
- settings
-
- * gui/e-meeting-time-sel.c: strings for 12 hour setting
- (e_meeting_time_selector_construct): increase width slightly
-
- * gui/e-meeting-time-sel.h: extern the new char array
-
-2001-10-18 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-util/cal-component.[ch] (cal_component_get_location):
- (cal_component_set_location): new functions
-
-2001-10-18 JP Rosevear <jpr@ximian.com>
-
- * gui/e-meeting-model.c (process_callbacks): util routine to
- handle calling back
- (async_close): use above
- (e_meeting_model_refresh_busy_periods): ditto
-
-2001-10-17 JP Rosevear <jpr@ximian.com>
-
- * conduits/todo/todo-conduit.c (local_record_from_comp): translate
- 1-5 priorites to 1-9 priorities better
- (comp_from_remote_record): ditto
-
-2001-10-17 JP Rosevear <jpr@ximian.com>
-
- * idl/evolution-calendar.idl: allow some decent exceptions
-
-2001-10-17 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/query.c (match_component): there may be cases when the backend
- will return an invalid component from a valid UID (an UID returned
- by the get_uids method), so don't abort if that's the case
-
-2001-10-15 Damon Chaplin <damon@ximian.com>
-
- * gui/dialogs/cal-prefs-dialog.glade: removed Help button. Do we have
- any others?
-
-2001-10-15 Larry Ewing <lewing@ximian.com>
-
- * gui/dialogs/comp-editor.c (set_icon_from_comp): remove warnings.
-
-2001-10-15 JP Rosevear <jpr@ximian.com>
-
- * conduits/calendar/calendar-conduit.c (process_multi_day):
- function to break up multi day events into single events for both
- evo and the pilot and create new CalClientChange structures
- (pre_sync): call above function, and adjust changed list if
- necessary
-
-2001-10-15 JP Rosevear <jpr@ximian.com>
-
- * conduits/calendar/calendar-conduit.c (is_all_day): util function
- to determine if event is all day
- (local_record_from_comp): use new util function
- (comp_from_remote_record): kill use of deprecated time functions
-
-2001-10-13 Larry Ewing <lewing@ximian.com>
-
- * gui/dialogs/comp-editor.c (real_edit_comp): call
- set_icon_from_comp.
- (set_icon_from_comp): set the window icon from the comp.
- (make_icon_from_comp): get the icon path based on comp type.
-
- * gui/dialogs/Makefile.am (iconsdir): EVOLUTION_ICONSDIR bits.
-
-2001-10-13 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/task-editor.c (task_editor_send_comp): send
- cancellation comp if necessary
-
-2001-10-12 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/alarm-page.c: return fill_component success
-
- * gui/dialogs/task-page.c: ditto
-
- * gui/dialogs/task-details-page.c: ditto
-
- * gui/dialogs/schedule-page.c: ditto
-
- * gui/dialogs/recurrence-page.c: ditto
-
- * gui/dialogs/event-page.c: ditto
-
- * gui/dialogs/meeting-page.c: use e_notice instead of
- duplicate_error
- (meeting_page_get_cancel_comp): duh, deleted_attendees is an array
- now
- (meeting_page_fill_component): spew gui errors if there is no
- organizer or no attendees, return success
-
- * gui/dialogs/event-editor.c (event_editor_send_comp): always call
- parent method and don't send the cancellation comp if the method
- is publish
- (refresh_meeting_cmd): use the orginal comp to refresh
- (forward_cmd): prompt the user for the version they want to send
- (current, original)
-
- * gui/dialogs/task-editor.c (forward_cmd): as above
- (refresh_task_cmd): ditto
-
- * gui/dialogs/comp-editor-page.c
- (comp_editor_page_fill_component): return boolean of whether the
- component could be filled or not
-
- * gui/dialogs/comp-editor-page.h: update proto
-
- * gui/dialogs/comp-editor.c (prompt_to_save_changes): take a param
- on whether to try and send or not
- (comp_editor_get_current_comp): only fill component if its changed
- (comp_editor_save_comp): prompt user as well
-
- * gui/dialogs/comp-editor.h: change proto
-
- * gui/itip-utils.c: replace error_dialog with e_notice
- (comp_content_type): specify charset
-
-2001-10-11 Larry Ewing <lewing@ximian.com>
-
- * gui/e-itip-control.c: large reworking of i18n tagging and now
- uses gtk_html_stream write and U_ where appropriate. More to
- come.
-
-2001-10-10 Larry Ewing <lewing@ximian.com>
-
- * gui/e-itip-control.c (init): set the default character set to
- utf-8.
-
-2001-10-10 Federico Mena Quintero <federico@ximian.com>
-
- * pcs/cal-factory.c (lookup_backend): Return the original key in
- the hash table if requested.
- (backend_last_client_gone_cb): Use lookup_backend() so that we
- have the URI mangling done for us.
- (impl_CalFactory_open): The type should be GtkType *, not GtkType!
-
-2001-10-10 JP Rosevear <jpr@ximian.com>
-
- * cal-client/cal-client.c (cal_set_mode_cb): remove unneeded
- assertions
-
-2001-10-10 JP Rosevear <jpr@ximian.com>
-
- * pcs/cal-factory.c (add_uri): fix logic checks
-
- * gui/dialogs/event-editor.c (event_editor_init): init the
- exisiting_org boolean
- (set_menu_sens): base sensitivity on existing_org boolean
- (event_editor_edit_comp): set exisiting_org boolean
-
- * gui/dialogs/task-editor.c: same as above
-
- * gui/calendar-offline-handler.c (add_connection): handle the
- protocol or host being unknown
-
- * cal-util/cal-component.c (cal_component_has_organizer):
- implement
-
-2001-10-09 Federico Mena Quintero <federico@ximian.com>
-
- Fixes bug #884.
-
- * gui/alarm-notify/save.[ch]: New files with functions to
- save/load the last notification time.
-
- * gui/alarm-notify/alarm-queue.c (alarm_trigger_cb): Save the last
- notification time.
- (alarm_queue_init): Load the last notification time when the
- daemon is inited.
- (alarm_queue_add_client): Load the alarms that we missed while the
- alarm daemon was not running.
- (cal_opened_cb): Likewise.
-
- * gui/alarm-notify/Makefile.am (evolution_alarm_notify_SOURCES):
- Added save.[ch] to the list of sources.
-
-2001-10-09 JP Rosevear <jpr@ximian.com>
-
- * gui/itip-utils.c (get_address): util function to get address
- (itip_addresses_get_default): get only the default address
- (itip_address_free): free single address
- (itip_addresses_free): use above
- (comp_limit_attendees): limit the number of attendees to one, the
- user
- (comp_sentby): set the sentby parameter if the user is not the
- organizer
- (comp_minimal): remove extraneous info for send (for refresh and
- declinecounter)
- (comp_compliant): remove all alarms, do various things to make the
- components comply with itip spec based on method
- (itip_send_comp): use comp_compliant method
-
- * gui/itip-utils.h: new protos
-
- * gui/e-itip-control.c: rescan the component when necessary
- (get_next): don't get stuck in infinite loop if there are no
- viewable components
- (e_itip_control_set_data): if there are no viewable components,
- spit an error message
-
- * gui/dialogs/meeting-page.h: tidy
-
- * gui/dialogs/meeting-page.c (meeting_page_fill_widgets): use
- organizer's cn if possible
- (other_clicked_cb): no longer doing the sent by stuff directly,
- hide more widgets
-
- * pcs/query.c: use bonobo exception stuff
-
- * cal-util/cal-component.c (cal_component_rescan): have the comp
- rescan its libical component (for when you change things directly)
- (free_icalcomponent): take a param on whether to free the
- component or just clean up the mappings
- (cal_component_has_attendees): util function
-
- * cal-util/cal-component.h: new protos
-
-2001-10-09 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/cal-factory.c (lookup_backend, add_backend): deal correctly with
- URIs to be inserted into the hash table, so that we don't add the same
- backend over and over because the URI strings were different (although
- refering to the same backend)
-
- * pcs/cal-backend-file.c (mail_account_*): moved to a common place
- (cal_backend_file_open): check if "uristr != NULL" and not
- "uri != NULL"
-
- * pcs/cal-backend-util.c: moved to here
-
- * gui/e-day-view.c: add missing header file
-
-2001-10-09 Dan Winship <danw@ximian.com>
-
- * gui/e-meeting-model.c (process_free_busy_comp): Fix incorrect
- variable name check.
-
-2001-10-03 JP Rosevear <jpr@ximian.com>
-
- * gui/itip-utils.c (itip_send_comp): refactor functionality into
- several function
- (comp_string): if we are publishing, empty the attendee list
-
- * gui/dialogs/event-editor.c (schedule_meeting_cmd): when we
- schedule a new meeting, mark the event editor as changed
-
- * pcs/cal.c (cal_class_init): get correct parent class
-
- * gui/dialogs/comp-editor.c (comp_editor_merge_ui): use the
- generated ui component name
-
-2001-10-03 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/component-factory.c:
- * gui/calendar-offline-handler.c:
- * gui/comp-editor-factory.c: replace use of gnome_vfs_uri with e_uri
-
- * gui/e-meeting-model.c (start_addressbook_server): make it return void,
- since the return value does not mind
-
- * pcs/cal.c:
- * pcs/cal-factory.c:
- * pcs/cal-backend.[ch]: don't use GnomeVFS for URI management
-
- * pcs/cal-backend-file.c: ditto, only use GnomeVFS for internal
- operations
-
- * cal-client/cal-client.c (cal_client_open_calendar): don't CORBA_exception_free
- before checking for exceptions
-
-2001-10-03 Christopher James Lahey <clahey@ximian.com>
-
- * gui/e-calendar-table.etspec: Added priorities to a bunch of
- these columns. Fixes Ximian bug #7158.
-
-2001-10-03 Damon Chaplin <damon@ximian.com>
-
- * gui/comp-util.c (cal_comp_util_add_exdate): save the EXDATE as a
- DATE-TIME value, since we know the exact time. Fixes bug #11278.
- (Before we were setting is_date, but icaltime_from_timet_with_zone()
- didn't convert it properly. We need to figure out how to handle DATEs
- when using time_t's.)
-
- * gui/dialogs/recurrence-page.c (get_exception_string): use
- e_time_format_date_and_time() so we show the time as well, if the
- exception is a DATE-TIME value.
-
- * cal-util/timeutil.c: removed time_add_month(), time_year_begin(),
- time_month_begin() & time_week_begin() - old pre-timezone functions
- which we no longer use.
-
- * cal-util/cal-recur.c (cal_recur_from_icalproperty): set
- ir.until.is_date to FALSE before converting to a time_t.
- Hopefully fixes bug #5034.
-
-2001-10-02 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/dialogs/comp-editor.c (setup_widgets): Use
- `bonobo_ui_component_new_default()', not
- `bonobo_ui_component_new()'.
-
-2001-10-02 JP Rosevear <jpr@ximian.com>
-
- * cal-client/cal-query.c: use bonobo-exception to tidy
-
-2001-10-02 JP Rosevear <jpr@ximian.com>
-
- * conduits/calendar/calendar-conduit.c (nth_weekday): handle -1 as
- well
- (comp_from_remote_record): fix monthly by day recurrences and
- handle "last" day type
-
-2001-10-01 Damon Chaplin <damon@ximian.com>
-
- * gui/dialogs/comp-editor.c (comp_editor_destroy): unref the page
- objects here, instead of in close_dialog(). (This was fixed a while
- ago, but accidentally reverted.) Fixes bug #7543.
-
-2001-10-01 Federico Mena Quintero <federico@ximian.com>
-
- * gui/alarm-notify/alarm-notify-dialog.c (alarm_notify_dialog):
- Set the window state to sticky. Thanks to Peter Teichman for the
- suggestion.
-
-2001-10-01 JP Rosevear <jpr@ximian.com>
-
- * conduits/calendar/calendar-conduit.c (local_record_from_comp):
- Convert the comp exceptions to the pilot record
- (comp_from_remote_record): record exceptions on the desktop and
- use time zone stuff on recurrence end date
-
-2001-10-01 JP Rosevear <jpr@ximian.com>
-
- * pcs/cal-backend-file.c (cal_backend_file_compute_changes):
- strdup the uid to avoid double free, write out only after
- everything is done
-
-2001-10-01 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/gnome-cal.c (gnome_calendar_open): don't use
- gnome_vfs_uri_is_local on URIs created with
- gnome_vfs_uri_new_private
-
-2001-09-28 Damon Chaplin <damon@ximian.com>
-
- * gui/print.c (print_comp_item): use bound_text to print the summary,
- so it wraps instead of being clipped to 1 line. Fixes part 3 of bug
- #10285, I think.
-
- * gui/dialogs/alarm-page.glade: left-aligned the Date/Time label.
- Also set the width of the Summary & Date/Time labels to 10, and set
- expand to TRUE, to make sure that the dialog doesn't keep getting
- wider as the summary text on the main page gets longer. Could possibly
- use an EClippedLabel here instead, so we get a '...' at the end if it
- is clipped.
-
- * gui/dialogs/recurrence-page.glade: changed Summary & Date/Time
- widths as above.
-
- * gui/print.c (print_calendar): use landscape mode for the month
- preview.
- (print_border_with_triangles): use EPSILON to account for floating
- point errors. Hopefully fixes part 2b of bug #10285.
-
-2001-09-28 JP Rosevear <jpr@ximian.com>
-
- * conduits/calendar/calendar-conduit.c (local_record_from_comp):
- Handle the fields and category we don't sync by making sure we
- don't overwrite them
- (local_record_to_pilot_record): use local record category
- (pre_sync): track db info
-
- * conduits/calendar/calendar-conduit.h: db info field
-
- * conduits/todo/todo-conduit.[hc]: same as above
-
- * pcs/cal-backend-file.c
- (cal_backend_file_compute_changes_foreach_key): create a dummy
- component of the right type and strdup the uid
- (cal_backend_file_compute_changes): sync the db hash after each
- change and free the uid
-
-2001-09-28 JP Rosevear <jpr@ximian.com>
-
- * cal-client/cal-client.c (cal_client_open_calendar): init the
- execption rather than freeing it
-
-2001-09-28 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-client/cal-client.c (cal_client_construct): use bonobo-exception
- for exceptions
- (cal_client_open_calendar): likewise
-
-2001-09-27 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/calendar-commands.c (pixmaps): Update pixmap menu paths;
- /menu/ComponentToolsPlaceholder/Tools ->
- /menu/Tools/ComponentPlaceholder .
- * gui/tasks-control.c: Likewise.
-
-2001-09-27 Rodrigo Moya <rodrigo@ximian.com>
-
- * idl/evolution-calendar.idl: added InvalidURI and UnsupportedMethod
- exceptions to the CalFactory interface
-
- * pcs/cal-factory.c (impl_CalFactory_open): raise InvalidURI exception on
- URI errors and UnsupportedMethod when we don't support the method for
- a given URI
-
-2001-09-26 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-client/cal-client.c: added support for using multiple calendar
- factories
- (cal_client_uri_list): use the list of factories loaded for this
- CalClient
-
-2001-09-26 Damon Chaplin <damon@ximian.com>
-
- * gui/e-calendar-table.c (date_compare_cb):
- (percent_compare_cb):
- (priority_compare_cb): added comparison functions for these special
- cell types. But the date and percent ones don't work yet due to the
- use of static text buffers for return cell values.
- (e_calendar_table_init): added the comparison functions to the
- ETableExtras. NOTE: task_compare_cb() never seems to be called.
- I'm not sure why it is there.
-
- * gui/e-calendar-table.etspec: set the comparison function names for
- the date/percent/priority fields.
-
- * cal-util/cal-util.c (cal_util_priority_to_string):
- (cal_util_priority_from_string): new utility functions.
-
- * gui/calendar-model.c (get_priority):
- (set_priority): used above utility functions, and removed the warning
- dialog which isn't useful now that the field isn't editable.
-
- * gui/dialogs/event-page.c (times_updated): handle timezones and for
- all-day events make sure it stays an all-day event after adjusting.
- Fixes bugs #5945 and #10222.
-
- * gui/calendar-commands.c (pixmaps): fixed the E_PIXMAP paths - the
- edit items were moved beneath 'EditPlaceholder'. This gets rid of
- those long Bonobo warnings! (and we get the icons back)
-
- * gui/dialogs/comp-editor.c (pixmaps): removed the PrintPreview toolbar
- icon, since it doesn't appear in the xml file. Gets rid of warning.
-
- * gui/dialogs/event-page.c (notify_dates_changed): new function to
- emit the notification signal when the dates are changed. It also
- handles timezones now.
-
- * gui/dialogs/comp-editor-page.h (CompEditorPageDates): used
- CalComponentDateTime for start/end/due so we have the timezone as well
- as the time.
-
- * gui/dialogs/comp-editor-util.c (comp_editor_dates): updated to get
- the timezones as well as the times.
- (comp_editor_free_dates): new function needed to free all the structs.
-
- * gui/dialogs/recurrence-page.c (recurrence_page_set_dates): added call
- to preview_recur() to make sure the preview gets updated.
-
- * gui/dialogs/alarm-page.c (alarm_page_fill_widgets): free the
- CompEditorPageDates struct after use.
-
- * gui/tag-calendar.c (tag_calendar_by_comp): added 'comp_is_on_server'
- argument. If FALSE, we try to use builtin timezones first. This is
- needed for the recurrence page of the event editor, because the
- timezones may not have been added to the server yet. This and the
- changes to the notification stuff should fix bug #5034.
-
- * gui/gnome-cal.c (dn_query_obj_updated_cb): call above
- tag_calendar_by_comp() with TRUE since the events will be on the
- server in this case.
-
- * gui/e-day-view-layout.c:
- * gui/e-day-view.c: made sure an event always takes up at least one
- row, even when the start & end times are the same. Fixes bug #5944.
- I don't know if we should try to also handle events with the end time
- before the start time.
-
- * gui/e-week-view.c (e_week_view_style_set): check that the small font
- is actually smaller than the normal font. If it isn't, don't use it.
- Hopefully fixes bug #6876.
- (e_week_view_on_new_appointment): if only one day is selected, then
- we set the initial time of the event to 1/2-hour from the start of the
- working day, to differentiate 'New Appointment' from 'New All Day
- Event'. Fixes bug #8892.
-
- * gui/e-day-view.c (e_day_view_on_new_appointment): do the same as the
- above.
-
-2001-09-26 Federico Mena Quintero <federico@ximian.com>
-
- Fixes the GUI part of bug #7892.
-
- * gui/dialogs/alarm-page.c (get_alarm_duration_string): Return
- NULL if the duration is zero.
- (get_alarm_string): Handle duration of zero. Also, hopefully
- make the strings be more l10n-friendly.
-
- * gui/alarm-notify/alarm.c (alarm_ready_cb): I am a moron. Fix
- reversed test.
-
-2001-09-26 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/comp-editor.c (comp_editor_destroy): disconnect
- signals first thing
-
-2001-09-26 Dan Winship <danw@ximian.com>
-
- * gui/Makefile.am (evolution_calendar_LDFLAGS): Add
- -export-dynamic to make glade custom widgets work on non-Linux.
-
-2001-09-26 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-util/cal-util.h: added CAL_MODE_INVALID to CalMode enum
-
-2001-09-26 JP Rosevear <jpr@ximian.com>
-
- * pcs/cal.h: new proto
-
- * pcs/cal.c (impl_Cal_set_mode): implement set mode method
- (cal_class_init): set setMode function in epv
- (cal_notify_mode): notify listener of mode change
-
- * pcs/cal-factory.c (add_uri): deal with UriType renaming
-
- * pcs/cal-backend.h: add new virtual methods and protos
-
- * pcs/cal-backend.c (cal_backend_class_init): init new virtual
- methods to null
- (cal_backend_set_mode): sets mode
- (cal_backend_get_mode): gets mode
-
- * pcs/cal-backend-file.c (cal_backend_file_class_init): overide
- get_mode and set_mode methods
- (cal_backend_file_get_mode): return mode
- (notify_mode): have listeners notified of the set mode call
- (cal_backend_file_set_mode): set the mode by indicating not
- supported
-
- * cal-client/cal-listener.h: update proto
-
- * cal-client/cal-listener.c (impl_notifyCalSetMode): implement set
- mode callback
- (cal_listener_construct): take set mode callback
- (cal_listener_new): ditto
-
- * cal-client/cal-client.h: update protos, add signal proto
-
- * cal-client/cal-client.c (cal_client_class_init): add
- cal_set_mode signal
- (cal_set_mode_cb): handle set mode callback from listener
- (cal_client_open_calendar): pass additional param to cal_listener_new
- (cal_client_set_mode): wrapper to set the calendar mode
-
- * idl/evolution-calendar.idl: make UriType into CalMode, add
- SetModeStatus enum and notifyCalSetMode method to the listener
-
- * gui/calendar-offline-handler.c (create_connection_list): fetch
- the uri list ourselves
- (impl_prepareForOffline): reflect param change of
- create_connect_list
- (update_offline): ditto
- (backend_cal_set_mode): set mode call back
- (backend_cal_opened): cal opened call back, set mode to local
- (impl_goOffline): reflect UriType renaming
-
- * cal-util/cal-util.h: rename UriType to CalMode
-
-2001-09-25 Federico Mena Quintero <federico@ximian.com>
-
- Warning fixes courtesy of Chris Lahey <clahey@ximian.com>.
-
- * gui/e-itip-control.c (write_html): Warning fixes. Also, don't
- strdup() more than necessary.
-
- * gui/e-meeting-time-sel.c (e_meeting_time_selector_refresh_cb):
- Warning fixes.
-
- * gui/itip-utils.c (itip_addresses_get): Warning fixes.
-
- * gui/print.c (print_day_background): Warning fixes.
-
- * gui/dialogs/alarm-options.c (alarm_to_aalarm_widgets): Warning
- fixes.
- (alarm_to_palarm_widgets): Likewise.
-
- * gui/dialogs/delete-comp.c: #include "../calendar-config.h"
-
-2001-09-25 Federico Mena Quintero <federico@ximian.com>
-
- * gui/alarm-notify/alarm.c (alarm_ready_cb): Check that the
- timeout is not set up before we create a new one; the alarm_fn
- callback may cause the alarm system to re-enter and add a new
- alarm. Fixes bug #10840.
- (pop_alarm): Assert that there is at least one alarm in the queue.
-
-2001-09-25 JP Rosevear <jpr@ximian.com>
-
- * pcs/cal.c: use bonobo-exception stuff to clean code
-
- * pcs/cal-factory.c (add_uri): add uri to the list if the type
- matches
- (impl_CalFactory_uriList): implement uriList method
-
- * pcs/cal-backend.h: new virtual function member
-
- * pcs/cal-backend.c (cal_backend_is_remote): call virtual function
-
- * pcs/cal-backend-file.c (cal_backend_file_class_init): override
- virtual function
- (cal_backend_file_is_remote): new virtual function, always return
- FALSE
-
- * idl/evolution-calendar.idl: uriList factory call, with flags for
- types to get
-
- * gui/dialogs/comp-editor.c (comp_editor_destroy): cast to remove
- warning
-
- * gui/e-itip-control.c (write_label_piece): kill warnings by take
- const char *
-
- * gui/component-factory.c (create_object): aggregate offline
- interface
-
- * gui/Makefile.am: compile new files
-
- * calobj.[hc]: Remove obsolete files
-
- * cal-util/cal-util.h: enum URI types for uriList call
-
- * cal-client/cal-client.c (build_uri_list): build list from string
- sequence
- (cal_client_uri_list): factory call to get uri list
-
- * cal-client/cal-client.h: new proto
-
- * cal-client/cal-client.c: use bonobo exception stuff to clean
- code
-
- * gui/calendar-offline-handler.[hc]: Start some skeleton routines
- for online/offline handling
-
- * pcs/cal-factory.c (launch_backend_for_uri): use accessor and
- remove FIXME
-
-2001-09-23 JP Rosevear <jpr@ximian.com>
-
- * gui/e-itip-control.c (set_date_label): base text on component
- type
-
-2001-09-20 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/component-factory.c: don't use gnome_vfs_uri_new_private
- (fixes Ximian #10544)
-
-2001-09-20 Federico Mena Quintero <federico@ximian.com>
-
- * gui/component-factory.c: #include a few files we were missing
- from libgnomevfs.
-
-2001-09-20 JP Rosevear <jpr@ximian.com>
-
- * pcs/cal-backend-file.c (load_db): gets a config db
- (cal_backend_file_destroy): release config db
- (cal_backend_file_init): use load_db
- (mail_account_get): gets a mail account by number
- (mail_account_get_default): gets the default mail account
- (mail_account_is_valid): looks to see if any accounts have the
- given address
- (create_user_free_busy): modularize so we can call multiple times
- if necessary, set organizer
- (cal_backend_file_get_free_busy): if the list of users is null,
- use the default account otherwise get the same info for each
- address that is an identity in the mailer
-
- * gui/itip-utils.c (itip_addresses_get): s/gint/glong/ for bonobo
- conf returns
-
- * gui/calendar-commands.c (publish_freebusy_cmd): fix problems
- from a merge so that we publish 6 weeks of free/busy information
- again
-
-2001-09-20 Larry Ewing <lewing@ximian.com>
-
- * gui/dialogs/recurrence-page.c (recurrence_page_destroy): make
- sure to release the ref on priv->comp.
-
- * gui/dialogs/comp-editor.c (real_edit_comp): make sure to release
- the ref on priv->comp.
-
-2001-09-19 Federico Mena Quintero <federico@ximian.com>
-
- * gui/alarm-notify/alarm-queue.c (audio_notification): Display a
- notification message always, in addition to playing the sound.
- (procedure_notification): Present a confirmation dialog before
- actually running the alarm's program.
- (procedure_notification): Use gnome_execute_shell() instead of
- gnome_execute_async() so that we handle multiple arguments
- properly. Plus, it is most likely what the user expects.
- (mail_notification): Display a message about unsupported email
- reminders instead of blindly dropping the alarm.
-
- * gui/dialogs/alarm-options.glade: Added an explanatory message
- about mail alarms not being supported.
-
- * gui/dialogs/alarm-page.glade: Removed the "Send an email"
- option.
-
- * gui/dialogs/alarm-page.c (action_map): Removed CAL_ALARM_EMAIL.
-
-2001-09-19 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/task-editor.c (init_widgets): listen for model
- changes
- (task_editor_edit_comp): add the attendees to the model and notify
- of need send
- (row_count_changed_cb): mark as changed when row added/deleted
- (model_row_changed_cb): mark as changed when row changes
-
- * gui/dialogs/event-editor.c (init_widgets): listen for model
- changes
- (event_editor_init): flip page order
- (event_editor_edit_comp): set needs send value
- (schedule_meeting_cmd): flip page order
- (row_count_changed_cb): mark as changed when row added/deleted
- (model_row_changed_cb): mark as changed when row changes
-
- * gui/dialogs/schedule-page.c: remove model change notification
- stuff
- (schedule_page_fill_widgets): no need to do the needs_send here
- because the editor handles this since it owns the model
-
- * gui/dialogs/event-editor.c (init_widgets): listen for model
- changes
- (event_editor_init): flip page order
- (event_editor_edit_comp): set needs send value
- (schedule_meeting_cmd): flip page order
- (row_count_changed_cb): mark as changed when row added/deleted
- (model_row_changed_cb): mark as changed when row changes
-
- * gui/dialogs/meeting-page.c (meeting_page_fill_widgets): no need
- to do the needs_send here because the editor handles this since it
- owns the model
- (invite_entry_changed): ditto
-
- * gui/dialogs/comp-editor.c (comp_editor_set_changed): new
- accessor
- (comp_editor_get_changed): ditto
- (comp_editor_set_needs_send): ditto
- (comp_editor_get_needs_send): ditto
-
- * gui/dialogs/comp-editor.h: new protos
-
- * gui/itip-utils.c (itip_addresses_get): reflect configuration
- path changes in the mailer
-
- * gui/e-meeting-model.c: remove commented out code, ifdef one
- section for later
-
-2001-09-19 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/cal-factory.c (cal_factory_oaf_register): add a new parameter
- (const char *iid) to specify the OAFIID of the factory being
- registered
-
-2001-09-19 JP Rosevear <jpr@ximian.com>
-
- * gui/e-meeting-model.c (e_meeting_model_refresh_busy_periods):
- remove silly debug #if 0
-
- * gui/calendar-commands.c (publish_freebusy_cmd): g_list_free
- rather than g_free
-
- * gui/e-itip-control.c (write_html): eliminate code path that
- caused double freed memory
-
-2001-09-18 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/schedule-page.*: A page that shows the meeting time
- selector and free/busy data for attendees
-
- * gui/dialogs/meeting-page.c: use the meeting model to track/edit
- attendees, remove table value conversion routines and simple table
- routines
- (set_attendees): take a pointer array
- (meeting_page_destroy): destroy the pointer array, save state
- (meeting_page_init): new pointer array
- (meeting_page_fill_widgets): don't null the deleted attendees
- field
- (popup_delegate_cb): array add
- (popup_delete_cb): array add
- (cleanup_attendees): iterate over the array to unref now
- (meeting_page_fill_widgets): don't null out fields, no need to add
- attendees here
- (invite_entry_changed): use e_meeting_attendee routines
- (popup_delegate_cb): ditto
- (popup_delete_cb): ditto
- (meeting_page_new): take new arg and pass it to construct
- (meeting_page_construct): take new arg, use e-meeting-model
- routines to construct table
-
- * gui/dialogs/task-editor.c (task_editor_init): new meeting model
- (task_editor_destroy): unref the model
-
- * gui/dialogs/event-editor.c (event_editor_init): make new model
- and pass it to meeting and schedule pages
- (event_editor_set_cal_client): virtual function, set meeting model
- client
- (event_editor_edit_comp): add the attendees to the model
- (event_editor_destroy): unref model
-
- * gui/dialogs/comp-editor.h: add virtual function
- * gui/dialogs/comp-editor.c (comp_editor_set_cal_client): make
- set_cal_client a virutal function
-
- * gui/e-meeting-types.h: generally useful type defines
-
- * gui/e-meeting-time-sel*.[hc]: Move here and use an e-table for
- the attendee list and extract display information from the new
- meeting model and attendees
-
- * gui/e-meeting-time-sel.etspec: spec for the table
-
- * gui/e-meeting-attendee.[hc]: meeting attendees for the model,
- with to/from conversions for CalComponentAttendee structure, emits
- changed signal and allows getting and setting of free busy
- periods
-
- * gui/e-meeting-model.[hc]: move the model out on its own
-
- * gui/e-itip-control.c (write_error_html): clean up warnings
-
-2001-09-18 Federico Mena Quintero <federico@ximian.com>
-
- Fixes bug #6350.
-
- * gui/component-factory.c (remove_folder): Use a simplified method
- for removing our folder data; we just need to remove calendar.ics
- or tasks.ics and the corresponding backup files.
-
-2001-09-18 Federico Mena Quintero <federico@ximian.com>
-
- Fixes bug #2830.
-
- * gui/calendar-config.c (calendar_config_get_confirm_delete): New
- function.
- (calendar_config_set_confirm_delete): New function.
- (config_read): Get the default value for the ConfirmDelete option.
- (calendar_config_write): Set the value of ConfirmDelete.
-
- * gui/dialogs/delete-comp.c (delete_component_dialog): Handle the
- configuration option for confirmation.
-
- * gui/dialogs/cal-prefs-dialog.c (CalPrefsDialogPrivate): Added
- the fields for the Other page.
- (get_widgets): Handle the new widgets.
- (cal_prefs_dialog_show_config): Likewise.
- (cal_prefs_dialog_update_config): Likewise.
-
-2001-09-18 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-client/cal-client-multi.[ch]: new class for managing multiple
- calendars, with an API very similar to the CalClient one,
- for ease of transition from one to the other
-
- * gui/component-factory.c (xfer_folder, remove_folder, create_folder):
- reworked to be able to manage folders for any calendar backend, and
- not only the file: one
-
-2001-09-18 Rodrigo Moya <rodrigo@ximian.com>
-
- * idl/evolution-calendar.idl: changed signature for the getFreeBusy
- method, to return a sequence of CalObj's, and added sequence of users
- as a new parameter to that method
-
- * cal-client/cal-client.c (cal_client_get_free_busy): adapted to new
- IDL method signature, by adding a new "GList *users" parameter, for
- callers to be able to specify a list of users
-
- * pcs/cal-backend.[ch] (cal_backend_get_free_busy):
- * pcs/cal-backend-file.c (cal_backend_file_get_free_busy): add the
- "GList *users" parameter. In cal_backend_file_get_free_busy, call
- lookup_component to get the CalComponent for each uid, instead
- of calling cal_backend_get_object, which meant converting the
- component to a string and then parsing it again.
-
- * cal-client/client-test.c (cal_opened_cb):
- * gui/e-itip-control.c (send_freebusy):
- * gui/calendar-commands.c (publish_freebusy_cmd): adapted to
- new getFreeBusy method signature
-
-2001-09-17 Damon Chaplin <damon@ximian.com>
-
- * gui/calendar-model.c: added a timeout to refresh the list every
- 10 minutes. Not ideal, as the user may be editing a task when it gets
- refreshed.
- (adjust_query_sexp): use the 'completed-before?' operator to filter
- out tasks according to the config settings.
-
- * gui/dialogs/task-details-page.c (task_details_page_fill_widgets):
- added support for the 'Completed' date. This code must have got lost
- somewhere, as it used to work.
- (date_changed_cb): set the priv->updating flag while updating the other
- widgets.
-
- * pcs/cal-backend-file.c (cal_backend_file_update_objects): made sure
- we freed the components.
-
- * pcs/query.c (func_completed_before): added 'completed-before?'
- operator.
-
- * gui/calendar-config.c (calendar_config_configure_e_cell_date_edit):
- don't set the lower & upper hour. Use 0-24 like the EDateEdit does.
-
- * gui/dialogs/cal-prefs-dialog.c (cal_prefs_dialog_show_config): set
- the 12/24-hour time format options sensitive only if we support both.
-
- * gui/calendar-config.c (config_read): if the locale doesn't define
- 'am' and 'pm' strings then we must use 24-hour format.
-
- * gui/calendar-commands.c (calendar_set_folder_bar_label): don't
- translate the '%d' as it doesn't make much sense. Resolves bug #8027.
-
-2001-09-17 Federico Mena Quintero <federico@ximian.com>
-
- * gui/component-factory.c (owner_set_cb): Do not call
- calendar_config_init() here.
-
- * gui/main.c (main): Call calendar_config_init() here.
-
-2001-09-17 Federico Mena Quintero <federico@ximian.com>
-
- * gui/alarm-notify/alarm.c (queue_alarm): Duh, only setup the
- timeout if the list was empty.
- (alarm_ready_cb): Notify with the ID of the original alarm.
- (alarm_remove): Likewise.
-
-2001-09-17 Federico Mena Quintero <federico@ximian.com>
-
- Switch the alarm system from using SIGALRM to normal glib timers.
- Also, use a more robust de-queueing mechanism.
-
- * gui/alarm-notify/alarm.c (alarm_init): Removed.
- (alarm_done): Remove the glib timeout instead of closing the pipes
- and the signal handler.
- (alarm_add): Allow adding alarms that happen before right now.
- (queue_alarm): Use a glib timer instead of a signal.
- (alarm_remove): Adjust the timeout as appropriate.
-
- * gui/alarm-notify/notify-main.c (main): There is no need to
- initialize the alarm system now.
-
- * gui/main.c (main): Likewise.
-
-2001-09-17 JP Rosevear <jpr@ximian.com>
-
- * gui/calendar-model.c (calendar_model_init): get itip addresses
- (calendar_model_destroy): destroy same
- (calendar_model_value_at): do more thorough checking on whether to
- use recurring, assigned, assigned to or regular task icons
-
-2001-09-17 JP Rosevear <jpr@ximian.com>
-
- * cal-util/cal-component.c (for_each_remove_all_alarms): for each
- call back, removes the alarms
- (cal_component_remove_all_alarms): remove all alarms from the
- component
-
- * cal-util/cal-component.h: new proto
-
- * gui/e-itip-control.c (write_error_html): writes error messages
- rather than normal html
-
- * gui/itip-utils.c (itip_send_comp): remove all alarms if the
- method warrants it
-
-2001-09-16 Christopher James Lahey <clahey@ximian.com>
-
- * gui/dialogs/meeting-page.c (build_etable): Updated this to match
- the new ETableSimple interface.
-
-2001-09-14 Ettore Perazzoli <ettore@ximian.com>
-
- [Automake 1.5 fixes pointed out by Richard Boulton
- <richard@tartarus.org>, as per #9258.]
-
- * cal-client/Makefile.am: Set CLEANFILES directly instead of using
- `+='.
- * gui/Makefile.am: Likewise.
- * gui/alarm-notify/Makefile.am: Likewise.
- * pcs/Makefile.am: Likewise.
-
-2001-09-14 Damon Chaplin <damon@ximian.com>
-
- * gui/e-itip-control.c (ok_clicked_cb): added space after 'identities'
- in the message. Fixes bug #9896.
-
-2001-09-14 JP Rosevear <jpr@ximian.com>
-
- * conduits/calendar/e-calendar.conduit.in: remove translation
- marker for now
-
-2001-09-13 JP Rosevear <jpr@ximian.com>
-
- * cal-util/cal-component.h: use ical partstat, role, cutypes
- directly
-
- * cal-util/cal-component.c: ditto
-
- * gui/e-itip-control.c (find_my_address): set my addresses if the
- addresses match
- (find_attendee): strstr returns non-null on a match
- (write_html): use new icon, select the name displayed (organizer
- or attendee) based on method,
- (ok_clicked_cb): when rsvp'ing strip off all but the attendee
- being replied for as is specified in the spec
- (find_attendee_partstat): new util function to extract the
- partstat of an attendee
- (update_attendee_status): updates the partstat of a specific
- attendee in the reply message
-
- * gui/dialogs/meeting-page.c: use ical partstat, role, cutypes
- directly
- (popup_delegate_cb): if we delegate, notify of needs send and
- changed
- (popup_delete_cb): notify of needs send and changed for each
- deletion
-
-2001-09-12 JP Rosevear <jpr@ximian.com>
-
- * gui/calendar-commands.c (publish_freebusy_cmd): send 6 weeks of
- free busy info starting with the UTC start of day
-
- * gui/itip-utils.c (get_label): create a text representation of
- the given icaltime
- (itip_send_comp): if the summary is empty, set the subject based
- on the type of component, put the right extension on free/busy
- components and base descriptions on type of component, include
- start/end for free/busy info
-
-2001-09-11 Federico Mena Quintero <federico@ximian.com>
-
- * gui/alarm-notify/alarm-queue.c (display_notification): Added an
- use_description argument so that other alarms can fall back to
- this type.
- (audio_notification): Implemented.
- (remove_comp): Call remove_queued_alarm() here; there is no longer
- a destroy notification function for alarms so must we do this
- manually.
- (alarm_trigger_cb): Do not pass the alarm to the notification
- functions so that we can free it ourselves before all the alarms
- in the component get freed.
- (display_notification): Get the alarm here instead of getting it
- as an argument.
- (procedure_notification): Implemented.
-
-2001-09-11 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/meeting-page.c (invite_entry_changed): free the
- destination vector when we finish with it, if we actually add
- anyone, notify listeners of the needs send and changed info. Fixes
- bug #8632.
-
-2001-09-10 Zbigniew Chyla <cyba@gnome.pl>
-
- * gui/print.c
- (format_date): Convert string generated by strftime to UTF-8.
- (print_week_view_background): Ditto.
- (print_month_summary): Ditto.
- (print_month_small): Use U_() instead of _().
- (print_day_background): Ditto.
- (print_todo_details): Ditto.
- (print_date_label): Convert generated string to UTF-8.
-
-2001-09-10 Federico Mena Quintero <federico@ximian.com>
-
- * cal-util/cal-component.c (cal_component_alarm_get_attach):
- Handle the new icalattach type instead of struct icalattachtype.
- (cal_component_alarm_set_attach): Likewise.
-
- * gui/dialogs/alarm-options.c (alarm_to_aalarm_widgets): Likewise.
- (alarm_to_palarm_widgets): Likewise.
- (aalarm_widgets_to_alarm): Likewise.
- (palarm_widgets_to_alarm): Likewise.
-
-2001-09-05 Ettore Perazzoli <ettore@ximian.com>
-
- [Fix #958, ShellComponents should not be created by factories, for
- the calendar.]
-
- * gui/GNOME_Evolution_Calendar.oaf.in: Remove the
- ShellComponentFactory.
-
- * gui/component-factory.c (create_object): Renamed from
- `component_fn'. Don't get any args.
- (component_factory_init): Create the component using
- `create_object()' and register it into OAF.
- (COMPONENT_FACTORY_ID): Removed.
- (COMPONENT_ID): New.
-
-2001-09-04 Federico Mena Quintero <federico@ximian.com>
-
- * gui/component-factory.c (sc_user_create_new_item_cb):
- Implemented.
-
- * gui/main.c (component_editor_factory_init): New function to
- create the factory for the comp_editor_factory.
-
- * gui/comp-editor-factory.c: Finished implementation.
-
- * gui/alarm-notify/alarm-queue.c (edit_component): Implemented the
- Edit command.
-
- * gui/Makefile.am (evolution_calendar_SOURCES): Added
- comp-editor-factory.[ch] to the list of sources.
-
-2001-09-03 Damon Chaplin <damon@ximian.com>
-
- * gui/calendar-commands.c (calendar_control_activate):
- * gui/tasks-control.c (tasks_control_activate): don't call
- calendar_config_check_timezone_set() now, since the startup wizard
- handles that.
-
- * gui/e-tasks.c (e_tasks_class_init): changed selection_changed signal
- to GTK_RUN_LAST. It has no reason to be GTK_RUN_FIRST.
-
- * gui/gnome-cal.c:
- * gui/e-week-view.c:
- * gui/e-day-view.c: added "selection_changed" signal,
- XX_delete_event() and XX_get_num_events_selected().
-
- * gui/e-day-view-top-item.c (e_day_view_top_item_draw): fix the shadow
- around the dates at the top - it was 1 pixel off.
-
- * gui/calendar-commands.c: added sensitize_commands(), similar to in
- tasks-control.c, so we only make Cut/Copy/Delete sensitive when an
- event is selected. Also added delete_event_cmd().
-
- * gui/dialogs/task-page.c (task_page_set_summary):
- * gui/dialogs/event-page.c (event_page_set_summary): do nothing,
- since the summary only gets changed on the main event/task page now.
- Fixes bug #6939.
-
- * gui/e-day-view.c (e_day_view_on_main_canvas_drag_data_received):
- (e_day_view_on_top_canvas_drag_data_received): check that we are
- dragging an event from the same EDayView. We currently don't support
- DnD from other widgets.
- (e_day_view_update_top_canvas_drag): only get the summary if we
- actually have an event. Fixes bug #5162.
-
- * gui/e-day-view.c (e_day_view_on_editing_stopped): if the text hasn't
- changed we need to call e_day_view_update_event_label() to show the
- times again if necessary. Fixes bug #1813.
-
- * gui/dialogs/comp-editor.c (comp_editor_destroy): destroy the
- CompEditorPage objects here rather than in close_dialog(), after the
- widgets have been destroyed. We do this because the widgets have lots
- of signal handlers connected with the CompEditorPage objects as the
- signal data, so we want to ensure that the data pointer is always
- valid. (Alternatively we could disconnect all the handlers when the
- CompEditorPage objects are destroyed, or use connect_while_alive()).
- Fixes bug #7543.
-
- Note: there is still a small bug in that if you type in a time and
- then hit 'Save and Close', the time won't be saved. I'm not sure
- where this should be fixed - should the actions which close the
- dialog grab the focus to the toplevel, so any widgets currently
- being edited finish the edit and emit 'changed'?
-
- * gui/dialogs/recurrence-page.c (append_exception): use
- gtk_clist_set_row_data_full() so freeing is handled automatically by
- the GtkClist. This helps avoid problems at destroy-time.
- (exception_delete_cb): just call gtk_clist_remove() now. No need to
- free the row data as GtkCList now handles it.
- (recurrence_page_destroy): no need to free the data in the clist.
-
- * gui/dialogs/alarm-page.c: ditto.
-
- * gui/dialogs/meeting-page.c: ditto.
- (etable_destroy_cb): save the ETable state in this new handler cb
- rather than in the destroy method, since the widget will already be
- destroyed by then.
-
-2001-08-31 Damon Chaplin <damon@ximian.com>
-
- * gui/e-itip-control.c: changed 3 occurrences of 'Replyed' to 'replied'
-
-2001-08-31 Zbigniew Chyla <cyba@gnome.pl>
-
- * gui/e-itip-control.c (write_html):
- Marked strings for translation (with U_).
-
- * gui/itip-utils.c (itip_send_comp):
- Ditto.
-
-2001-08-31 Damon Chaplin <damon@ximian.com>
-
- * gui/dialogs/comp-editor-util.c (comp_editor_contacts_to_widget):
- (comp_editor_contacts_to_component): fix debugging messages so they
- use "" rather than NULL. Fixes bug #8559.
-
-2001-08-29 Federico Mena Quintero <federico@ximian.com>
-
- * pcs/cal-backend-file.c (cal_backend_file_remove_object): See if
- the set of categories changed by using the removed_categories hash
- table.
- (cal_backend_file_init): Create a table of removed categories.
- This allows us to notify if and only if the set of category
- changes when an object is updated/removed, instead of
- unconditionally notifying if an object is updated.
- (cal_backend_file_update_objects): Only notify if the set of
- categories really changed.
- (update_categories_from_comp): Shuffle the categories between the
- priv->categories and priv->removed_categories lists.
-
-2001-08-28 Federico Mena Quintero <federico@ximian.com>
-
- Fixes bug #7879, a query may receive an update notification from
- the backend before the query itself gets populated.
-
- * pcs/query.c (ensure_sexp): New function; ensures that the esexp
- is created and notifies of parse errors. It is the bulk of
- start_query_cb() but put in a separate function so that we can
- share it elsewhere.
- (start_query_cb): Use ensure_sexp().
- (process_component_cb): Oops, notify of a successfully finished
- query.
- (match_component): Call ensure_sexp(). This function can be
- called by the backend notification callbacks before the query is
- populated, so we need to make sure the esexp exists here.
-
-2001-08-22 Federico Mena Quintero <federico@ximian.com>
-
- * gui/cal-search-bar.c (cal_search_bar_construct): Set the
- "category is" criterion as the default for the calendar and tasks.
-
-2001-08-22 Federico Mena Quintero <federico@ximian.com>
-
- * gui/dialogs/recurrence-page.c (recurrence_page_fill_widgets):
- Unset the priv->updating flag before returning in the case the
- component has no recurrence information. Fixes bug #6850.
-
-2001-08-22 Federico Mena Quintero <federico@ximian.com>
-
- * gui/alarm-notify/alarm-queue.c (QueuedAlarm): Added a snooze
- flag to differentiate snoozed alarms from real occurrences.
- (add_component_alarms): Do not specify a destroy function for the
- alarm trigger. We handle this in the callbacks now.
- (alarm_trigger_cb): Just remove the alarms for the unimplemented
- notification types.
- (create_snooze): Implemented snooze.
- (notify_dialog_cb): Snooze as appropriate.
-
-2001-08-22 JP Rosevear <jpr@ximian.com>
-
- * gui/itip-utils.c (foreach_tzid_callback): call back to add
- timezones to the top level
- (itip_send_comp): call icalcomponent_foreach_tzid
-
-2001-08-22 Dan Winship <danw@ximian.com>
-
- * gui/gnome-cal.c: #include <libgnomevfs/gnome-vfs-types.h> so
- this will compile against gnome-vfs 1.0.1.
-
-2001-08-22 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/gnome-cal.c (gnome_calendar_open): open the tasks folder
- associated with the calendar being opened, and not always the local
- tasks.ics file
-
- * pcs/cal-factory.c (open_fn): use gnome_vfs_uri_new_private when
- parsing the URI to allow non-registered URIs
-
-2001-08-21 Federico Mena Quintero <federico@ximian.com>
-
- * gui/dialogs/alarm-options.c (alarm_to_palarm_widgets): Handle
- the case where there is no attachment. Fixes bug #7257.
-
-2001-08-21 JP Rosevear <jpr@ximian.com>
-
- * gui/e-itip-control.c (write_html): strip the mailto bit for the
- email address if we display it
-
-2001-08-21 Damon Chaplin <damon@ximian.com>
-
- * pcs/query.c (func_is_completed): added new e-sexp operator. We
- don't currently use it though.
-
- * gui/dialogs/cal-prefs-dialog.glade: Changed '_Overdue' to 'O_verdue'
- since we have an '_Other' notebook tab. Added '_Hide' accel.
-
- * gui/dialogs/cal-prefs-dialog.c: hooked up config options to dialog.
-
- * gui/calendar-config.c: added config options for hiding completed
- tasks.
-
- * gui/e-week-view-event-item.c (e_week_view_event_item_draw):
- * gui/e-day-view-top-item.c (e_day_view_top_item_draw_long_event):
- * gui/e-day-view.c (e_day_view_reshape_long_event): added 2 pixels
- extra space between icons and text for long events, and 1 pixel space
- between icons in all events.
- (e_day_view_realize): changed the background color to match the
- EGrayBar in the shell.
-
-2001-08-21 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/cal-backend-util.[ch]: new files to contain utility functions
- for calendar backends
-
- * pcs/cal-backend.c (cal_backend_add_cal): implement it here, and not in
- the calendar backends. Add a "cal_added" signal, so that backends are
- notified when a new Cal is added, if they need to
- (cal_backend_get_type_by_uid): implement it here
-
- * pcs/cal-backend-file.c (fill_alarm_instances_seq): moved to
- cal-backend-util.c
- (cal_backend_file_add_cal): removed
- (cal_backend_file_init): connect to the "cal_added" signal in the
- CalBackend class so that we can update categories when a new Cal is
- added
- (cal_backend_file_get_type_by_uid): removed
-
- * pcs/cal-backend-db.c (fill_alarm_instances_seq): moved to
- cal-backend-util.c
- (cal_backend_db_add_cal): removed
- (cal_backend_db_get_type_by_uid): removed
-
- * AUTHORS: added JP and Damon to list of authors
-
-2001-08-20 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-util/cal-util.[ch] (cal_util_generate_alarms_for_list):
- (cal_util_generate_alarms_for_comp):
- new functions moved from the CalBackendFile, to allow its use outside
- of it. The signature has changed a little bit, since these functions
- need a way to get the timezones from the callers, so a callback
- function to resolve the timezones has been added to the list of
- parameters
-
- * pcs/cal-backend-file.c (generate_alarms_for_list):
- (generate_alarms_for_comp): moved to cal-util, with all their related
- functions/structures
-
- * pcs/cal-backend-db.c: removed functions that were moved to cal-util
-
-2001-08-20 Damon Chaplin <damon@ximian.com>
-
- * gui/dialogs/comp-editor.c (pixmaps): use Delete icon in menu, and
- change to bigger Save icon in toolbar.
-
- * gui/tasks-control.c:
- * gui/calendar-commands.c (pixmaps): used new_task-16.png and
- goto-16.png.
-
-2001-08-20 Damon Chaplin <damon@ximian.com>
-
- * gui/calendar-commands.c (pixmaps): added delete icons for menu
- and toolbar.
-
-2001-08-20 Damon Chaplin <damon@ximian.com>
-
- * gui/tasks-control.c: added Cut/Copy/Paste icons for toolbar.
-
-2001-08-20 Damon Chaplin <damon@ximian.com>
-
- * gui/tasks-control.c: uses new delete icons in menu & toolbar.
-
-2001-08-19 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component-factory.c: Update the folder list to include a
- display name and a description.
-
-2001-08-20 Damon Chaplin <damon@ximian.com>
-
- * gui/dialogs/comp-editor.c (pixmaps): use new delete icon for toolbar.
-
-2001-08-19 Damon Chaplin <damon@ximian.com>
-
- * gui/e-itip-control.c: fixed typo, 'send' -> 'sent'. Bug #7621.
-
-2001-08-18 Damon Chaplin <damon@ximian.com>
-
- * gui/dialogs/cal-prefs-dialog.glade: added option to hide completed
- tasks after a given number of minutes/hours/days. Unfinished.
-
- * gui/dialogs/event-page.c (event_page_fill_component): initialize
- zone to NULL to avoid a warning.
- (contacts_clicked_cb): work around a bug in SelectNames by notifying
- that the page has changed when you click the 'Contacts' button.
- Otherwise it is easy to lose changes.
-
- * gui/dialogs/task-page.c (contacts_clicked_cb): ditto.
-
-2001-08-18 Damon Chaplin <damon@ximian.com>
-
- * gui/dialogs/comp-editor.c (pixmaps): used new Save/Save As icons.
-
- * gui/tasks-control.c:
- * gui/calendar-commands.c (pixmaps): added new Cut/Copy/Paste icons,
- and changed the 'New Task' icon to use the bigger one I made.
-
-2001-08-05 Zbigniew Chyla <cyba@gnome.pl>
-
- * gui/dialogs/task-page.c (summary_changed_cb):
- Use e_dialog_editable_get instead of gtk_editable_get_chars (we need
- UTF-8 string).
-
-2001-08-18 Zbigniew Chyla <cyba@gnome.pl>
-
- * gui/calendar-config.c (locale_uses_24h_time_format): New.
- (config_read): Use locale's setting as default for
- /Calendar/Display/Use24HourFormat so that Europeans don't have to
- switch to 24-hour format manually.
-
-2001-08-17 JP Rosevear <jpr@ximian.com>
-
- * gui/e-itip-control.c (destroy): destroy the addresses
- (clean_up): don't free the addresses, we need them
-
-2001-08-17 Damon Chaplin <damon@ximian.com>
-
- * gui/gnome-cal.c (gnome_calendar_new_task): new function to open the
- task editor to add a new task.
-
- * gui/calendar-commands.c: added new_task_cb() to create a new task
- in the calendar folder, and added menu commands for it, and a toolbar
- button (I think that is what Ettore wanted. Maybe he just meant menu
- commands. Anyway, it is easy to take out.) Note that we don't have a
- decent icon for 'New Task' for the toolbar.
- Also added the new Goto button (but we don't have a similar one for
- the menu command).
-
-2001-08-16 Iain Holmes <iain@ximian.com>
-
- * gui/Makefile.am: Add the libetimezonedialog.a lib link
-
- * gui/calendar-config.c: Change the #include for the timezone dialog
-
- * gui/e-timezone-entry.c: Ditto.
-
- * gui/dialogs/Makefile.am: Remove the e-timezone-dialog stuff.
-
-2001-08-16 Damon Chaplin <damon@ximian.com>
-
- * gui/dialogs/event-page.c: hide the timezone fields for all-day
- events. We will use DATE values for these eventually, and these
- don't have timezones associated with them. Currently we just use the
- default timezone for all-day events, as a workaround until we have
- DATE values working.
-
- * gui/dialogs/comp-editor-util.c (comp_editor_new_date_edit): added
- make_time_insensitive flag. Though we may not use it.
-
- * gui/dialogs/event-page.glade: made the 'All day event' toggle
- right-aligned, so it doesn't move when the other widgets are shown
- and hidden.
-
- * gui/e-timezone-entry.c (e_timezone_entry_set_default_timezone): new
- function to set the default timezone of the widget. If the current
- timezone setting matches the default then the entry field is hidden.
- Most people won't use timezones so this makes the GUI simpler.
-
- * gui/dialogs/event-page.c (init_widgets):
- * gui/dialogs/task-page.c (init_widgets): set the default timezone
- using the above function.
-
- * gui/dialogs/task-page.c (task_page_fill_widgets): if the start date
- or due date is not set, we use the default timezone, so the user
- doesn't have to set this each time they set the date.
-
-2001-08-16 Federico Mena Quintero <federico@ximian.com>
-
- * gui/dialogs/alarm-page.c (alarm_page_fill_widgets): If the
- component has no alarms remember to set the priv->updating flag to
- FALSE before returning.
-
-2001-08-16 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/e-delegate-dialog.c
- (e_delegate_dialog_get_delegate_name): get the destinations
- property, not the text property
-
-2001-08-16 Federico Mena Quintero <federico@ximian.com>
-
- * gui/dialogs/alarm-page.c (clear_widgets): Set the default-to-add
- notification to be display a message 15 minutes before the start
- of the appointment. Fixes bug #7175.
-
-2001-08-16 Federico Mena Quintero <federico@ximian.com>
-
- * gui/dialogs/comp-editor-util.c (comp_editor_strip_categories):
- New function to strip surrounding whitespace from a string of
- categories entered by the user.
-
- * gui/dialogs/task-page.c (task_page_fill_component): Use
- comp_editor_strip_categories().
-
- * gui/dialogs/event-page.c (event_page_fill_component): Likewise.
-
-2001-08-16 Federico Mena Quintero <federico@ximian.com>
-
- * gui/calendar-config.c (calendar_config_configure_e_date_edit):
- Do not set the time popup range. We also want to be able to
- create appointments that are not within nine-to-five! Think of
- going to the movies! Fixes bug #7436.
-
- * gui/dialogs/cal-prefs-dialog.glade: "am/pm" is now "AM/PM".
- Fixes bug #7367.
-
-2001-08-16 Jon Trowbridge <trow@ximian.com>
-
- * gui/cal-search-bar.c: Changed to reflect my renaming of some of
- the more hideously-named functions in the ESearchBar API.
-
-2001-08-15 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/comp-editor.c (save_comp): only fill the component
- and save it if something has changed
- (save_comp_with_send): only try to send if something has changed
- and the editor needs a send
-
-2001-08-15 Federico Mena Quintero <federico@ximian.com>
-
- * gui/dialogs/cal-prefs-dialog.glade: OK, re-added the default
- alarm options. Way too many people are asking for them.
-
-2001-08-15 Federico Mena Quintero <federico@ximian.com>
-
- * gui/component-factory.c (factory_fn): Add the user creatable
- items. The callback is not actually implemented yet; this is just
- to finalize the GUI.
-
- * gui/dialogs/cal-prefs-dialog.glade: Added an option to ask for
- confirmation when deleting items. Added underlined shortcuts
- (they may not all work currently).
-
-2001-08-14 Damon Chaplin <damon@ximian.com>
-
- * gui/dialogs/task-page.c:
- * gui/dialogs/event-page.c: added support for the Contacts field.
- Note that I'm not sure what we should put in the iCalendar CONTACT
- properties. Currently we put "name <email>", but it isn't recognized
- as a contact when we reopen the dialog, so we may need more info here.
- Also we currently use a simple parser to parse the above format, and
- we should maybe use some camel function.
-
- * gui/dialogs/task-page.glade:
- * gui/dialogs/event-page.glade: replaced the GtkEntry fields for the
- Contacts with a GtkEventBox which we put the BonoboControl in at
- runtime.
-
- * gui/dialogs/meeting-page.c (invite_entry_changed): added FIXMEs
- since it doesn't seem to be freeing the EDestination stuff. JP?
-
- * gui/dialogs/comp-editor-util.c: added bunch of utility functions to
- handle the Contacts field in the main Event and Task pages.
-
- * gui/gnome-cal.c: added visible_start and visible_end fields, so we
- only emit the 'dates-shown-changed' signal when really necessary.
- Currently changing the folder title bar label results in a complete
- redraw of the Evolution window (silly GtkLabel queueing a resize),
- so we want to avoid that as much as possible.
- (gnome_calendar_new_appointment_for): only move the event's end time
- to the end of the day if it is not already 00:00:00.
-
- * gui/e-week-view-event-item.c:
- * gui/e-week-view.c:
- * gui/e-day-view.c: added support for double-clicking on an event to
- open it, and for double-clicking on the background to create a new
- event. There is still a minor problem to sort out, but it basically
- works.
-
- * cal-util/cal-component.c: added support for CONTACT properties,
- mainly by copying the code for COMMENT properties which are exactly
- the same type.
-
- * gui/e-day-view.c (e_day_view_realize): use the same color for the
- top canvas background as the shortcut bar, to make it look a little
- nicer (I think). Although we still have the theme problem with
- hard-coded colors.
-
-2001-08-14 Federico Mena Quintero <federico@ximian.com>
-
- * gui/e-calendar-table.etspec: Made the click-to-add message
- shorter. Fixes bug #7177.
-
-2001-08-14 Federico Mena Quintero <federico@ximian.com>
-
- * gui/calendar-commands.c (pixmaps): Added Tigert's new icons for
- Prev and Next.
-
-2001-08-14 Federico Mena Quintero <federico@ximian.com>
-
- * gui/cal-search-bar.c (make_suboptions): Make the "Any Category"
- item consistent with the one in the addressbook. Also, free the
- items correctly.
-
-2001-08-14 Federico Mena Quintero <federico@ximian.com>
-
- * gui/cal-search-bar.c (get_current_category): Handle an array of
- categories in the CalSearchBar instead of our own menu items.
- (notify_query_contains): Fetch the text from the search bar here
- instead of in regen_query().
- (regen_query): Handle category searches.
- (notify_category_is): New function.
- (cal_search_bar_construct): Do not create an option menu.
- (make_suboptions): New function to create the suboption items from
- the list of categories.
- (notify_query_contains): Do not include a category sexp here.
-
-2001-08-13 JP Rosevear <jpr@ximian.com>
-
- * gui/e-itip-control.c (update_item): add dialog for feedback
- (remove_item): ditto
- (send_item): ditto
- (send_freebusy): ditto
-
-2001-08-13 JP Rosevear <jpr@ximian.com>
-
- * gui/e-itip-control.c: rewrite the gui to use gtkhtml
-
- * gui/Makefile.am: define the icon dir
-
-2001-08-12 Kjartan Maraas <kmaraas@gnome.org>
-
- * gui/e-itip-control.h: Remove #include <config.h> from here.
- * gui/itip-utilss.h: Same here.
-
-2001-08-11 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/tasks-control.c: Update the paths of the Tools menu
- according to the changes in the XML [i.e. things are moved to the
- ComponentToolsPlaceholder].
-
- * gui/calendar-commands.c: Likewise.
-
-2001-08-11 Damon Chaplin <damon@ximian.com>
-
- * gui/dialogs/event-page.c (init_widgets):
- * gui/dialogs/task-page.c (init_widgets): turn on word-wrap for the
- description fields. Fixes bug #6821.
-
-2001-08-10 Jon Trowbridge <trow@ximian.com>
-
- * gui/cal-search-bar.c: Where we have ESearchBarItems, set their
- subitems to NULL.
-
-2001-08-09 Damon Chaplin <damon@ximian.com>
-
- * pcs/cal-backend.c (cal_backend_get_object_component): added new
- backend method to get the component given a UID.
-
- * pcs/cal-backend-file.c (cal_backend_file_get_object_component):
- added implementation of above virtual method.
-
- * pcs/query.c (match_component): use the new backend function to get
- the CalComponent rather than the string. This avoids converting all
- the calendar components to strings and parsing them back into
- components for every query! (That wasn't a good idea, was it ;)
-
- * gui/e-week-view.c:
- * gui/e-day-view.c: use a timeout handler to layout the events,
- to avoid doing a layout for each event we get from a query.
-
- * gui/print.c (print_day_add_event):
- * gui/e-day-view.c (e_day_view_add_event): set start_row_or_col and
- num_columns to 0. They are guint8's.
-
- * gui/e-week-view.c (e_week_view_free_events): hide all the jump
- buttons. Fixes bug #5946.
-
- * gui/calendar-commands.c (calendar_set_folder_bar_label): added the
- day numbers for the month view.
-
- * gui/dialogs/recurrence-page.glade: changed "_Delete" to "_Remove",
- since it clashed with "_Add". Also added underlined accelerators for
- the recurrence radio buttons. Note that none of these accelerators
- actually work at present, due to the way we are using .glade files
- for each notebook page. I need to add a bug about this.
- Also, the "_Action" menu doesn't popup when I press Alt+A, even though
- the "_File" menu does popup when I press Alt+F. Strange.
-
- * pcs/cal-backend-file.c (cal_backend_file_get_timezone_object):
- removed debug msgs.
-
-2001-08-09 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-day-view-top-item.c (e_day_view_top_item_draw_long_event):
- * gui/e-day-view-main-item.c (e_day_view_main_item_draw_day_event):
- * gui/e-week-view-event-item.c (e_week_view_event_item_draw_icons):
- unref the GdkPixmap and GdkBitmap returned by the function
- e_categories_config_get_icon_for ()
-
-2001-08-09 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/task-page.*: Remove progress frame
-
- * gui/dialogs/task-details-page.*: Put in progress frame, remove
- basics frame
-
- * gui/dialogs/task-editor.c (set_menu_sens): util function to set
- menu sensitivity based on state
- (task_editor_init): add meeting page
- (task_editor_edit_comp): show page if necessary
- (task_editor_destroy): unref meeting page
- (assign_task_cmd): bring up meeting page
- (refresh_task_cmd): save before sending
- (forward_cmd): ditto
-
- * gui/dialogs/comp-editor.c (save_cmd): implement new save command
-
-2001-08-09 Federico Mena Quintero <federico@ximian.com>
-
- * gui/e-itip-control.c (destroy): Chain to the destroy handler in
- the parent class!
-
- * gui/dialogs/comp-editor-page.c (comp_editor_page_destroy):
- Likewise. Sigh.
-
- * gui/cal-search-bar.c (cal_search_bar_destroy): Whoops, added a
- destroy handler.
-
-2001-08-08 Damon Chaplin <damon@ximian.com>
-
- * gui/goto-dialog.glade: removed underlined accelerator key from
- "_Go To Today" button. GnomeDialog doesn't actually support underlined
- accelerator keys for buttons. We could hack it, like Glade does, if
- we really need to. Fixes bug #6418.
-
-2001-08-08 Federico Mena Quintero <federico@ximian.com>
-
- * gui/e-day-view.c (update_query): Stop editing any event. Fixes
- bug #5949.
-
-2001-08-08 Federico Mena Quintero <federico@ximian.com>
-
- * gui/dialogs/alarm-page.c (alarm_page_fill_component): Duuuh, set
- the alarm_copy on the component, not the original alarm. Fixes
- bug #5214.
-
-2001-08-08 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/meeting-page.c (set_attendees): set the attendees of
- a component
- (meeting_page_fill_component): use above
- (meeting_page_get_cancel_comp): return a comp with the attendees
- to be cancelled
-
- * gui/dialogs/meeting-page.h: get a component that will be sent as
- a cancellation
-
- * gui/dialogs/event-editor.c (event_editor_class_init): override
- send_comp class method
- (event_editor_send_comp): send cancellation notices to deleted
- attendees
- (refresh_meeting_cmd): save before send
- (forward_cmd): ditto
-
- * gui/dialogs/comp-editor.c (comp_editor_class_init): set default
- send_comp method
- (real_send_comp): do the real work
- (comp_editor_send_comp): call class method
- (save_comp): don't do any sending
- (save_comp_with_send): save and send here
- (prompt_to_save_changes): use above
- (save_close_cmd): ditto
-
- * gui/dialogs/comp-editor.h: add virtual function
-
-2001-08-08 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-week-view-event-item.c
- (e_week_view_event_item_draw_icons): don't use a NULL mask in the
- call to gdk_gc_set_clip_mask
-
- * gui/e-day-view-top-item.c (e_day_view_top_item_draw_long_event):
- ditto
-
- * gui/e-day-view-main-item.c
- (e_day_view_main_item_draw_day_event): ditto
-
-2001-08-08 JP Rosevear <jpr@ximian.com>
-
- * conduits/calendar/calendar-conduit-config.h: fix pre-processor
- macros
-
- * conduits/calendar/calendar-conduit.h: ditto
-
- * conduits/todo/todo-conduit-config.h: fix pre-processor macros
-
- * conduits/todo/todo-conduit.h: ditto
-
-2001-08-07 Federico Mena Quintero <federico@ximian.com>
-
- * cal-client/cal-listener.c (cal_listener_stop_notification): New
- function to stop further notification from happening.
- (impl_notifyCalOpened): Do not notify if requested.
- (impl_notifyObjUpdated): Likewise.
- (impl_notifyObjRemoved): Likewise.
- (impl_notifyCategoriesChanged): Likewise.
- (CalListenerPrivate): Do not keep a reference to the server-side
- Cal. This would create a circular reference since the server
- keeps a reference to the listener.
- (cal_listener_destroy): Likewise.
- (impl_notifyCalOpened): Likewise.
-
- * pcs/cal.c (cal_destroy): bonobo_object_release_unref() the listener.
-
- * cal-client/cal-client.c (cal_client_destroy): Ask the listener
- to stop notifications. Also, do not unref it as the server does
- that itself when we unref the Cal.
-
-2001-08-07 Federico Mena Quintero <federico@ximian.com>
-
- * gui/calendar-model.c (calendar_model_free_value): Only unref the
- FIELD_COMPONENT if it is non-NULL. We return a NULL for that
- field from ::initialize_value(), after all. Fixes bug #6098.
-
-2001-08-07 JP Rosevear <jpr@ximian.com>
-
- * gui/itip-utils.c (itip_send_comp): Make calendar.ics the
- suggested name when attaching the ical object
-
-2001-08-06 Damon Chaplin <damon@ximian.com>
-
- * gui/e-week-view.h:
- * gui/e-day-view.h: added 'different_timezone' fields to EDayViewEvent
- and EWeekViewEvent, to note that the event is in a different timezone.
- We now compute this once when we add the event to the array, rather
- than each time we draw the event. If it is set, we will draw the
- timezone icon next to the event.
-
- * gui/e-day-view-main-item.c: take transparency into account when
- drawing the blue vertical bars to represent busy time.
-
- * gui/tag-calendar.c: take transparency into account when tagging
- the mini calendar.
-
- * gui/e-calendar-table.c (e_calendar_table_init): removed the "None"
- options for transparency and classification, since these properties
- have defaults anyway, so we may as well use those to keep it simple.
- Also use "Free" and "Busy" for transparency, rather than "Transparent"
- and "Opaque".
-
- * gui/calendar-model.c: updated classification & transparency code
- as above.
-
- * gui/e-calendar-table.etspec: changed "Transparency" to "Show Time As"
- since people have a chance of understanding that.
-
- * gui/e-week-view.c:
- * gui/e-day-view.c:
- * gui/gnome-cal.c: added functions to get the visible time range.
-
- * gui/calendar-commands.c: finished stuff to set the folder bar
- label to the dates currently displayed.
-
- * gui/control-factory.c (control_factory_new_control): connected
- signal to update the folder title bar label when the dates shown
- are changed. I had to connect it here since we need the BonoboControl
- in the callback, and I don't know how to get the control from the
- widget.
-
- * gui/tasks-control.c (tasks_control_activate): clear the folder bar
- label. We could display something here at some point.
-
- * gui/dialogs/recurrence-page.glade: changed "_Add" to "A_dd", since
- we have an "_Actions" menu. (These also use Alt+key, right?)
-
- * gui/dialogs/event-page.glade:
- * gui/dialogs/event-page.c: added 'Show Time As' field, which is
- really the TRANSP property but with a better name!
- Also changed one of the "_Confidential" to "Con_fidential" since we
- already have "_Contacts" using the same 'C' key.
-
- * pcs/cal-backend-file.c (cal_backend_file_get_free_busy): skip
- events that are TRANSPARENT. Also added comment as this code looks
- inefficient.
-
- * cal-util/cal-component.c: removed stuff for comparing timezones.
-
- * gui/comp-util.c (cal_comp_util_compare_event_timezones): moved the
- above function here, and updated it to compare the UTC offsets of the
- times as well as the TZIDs.
-
-2001-08-06 Federico Mena Quintero <federico@ximian.com>
-
- * gui/dialogs/cal-prefs-dialog.glade: In process of fixing bug
- #6005. The "Calendar" page is now "Display", and it has no
- frames. The "Task list" page has colons between the labels and
- the color pickers, and it has no frame.
-
-2001-08-06 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-client/cal-client.c (destroy_wombat_client): added check for
- NULL pointers. Maybe fixes #5203 (I can't reproduce it, so I'm not
- sure)
-
-2001-08-03 Federico Mena Quintero <federico@ximian.com>
-
- * cal-client/query-listener.c (query_listener_stop_notification):
- New function; stops further notification from happening. This is
- needed since the listener is destroyed asynchronously from the
- Wombat and the corresponding CalQuery may already have died.
- (impl_notifyObjUpdated): Do not notify if requested.
- (impl_notifyObjRemoved): Likewise.
- (impl_notifyQueryDone): Likewise.
- (impl_notifyEvalError): Likewise.
-
- * cal-client/cal-query.c (cal_query_destroy): Use
- query_listener_stop_notification().
-
- * cal-client/cal-listener.c (cal_listener_destroy): Nullify the
- pointers to the callback functions.
-
- * gui/e-day-view.c (update_query): Commit our state of no longer
- having a query before unrefing it. We may reenter from the ORBit
- main loop and we *really* want this information to be committed.
-
- * gui/e-week-view.c (update_query): Likewise.
-
- * gui/calendar-model.c (update_query): Likewise.
-
- * gui/tag-calendar.c (tag_calendar_by_comp): Added a "clear_first"
- argument that indicates whether the ECalendar should be cleared of
- any marks first.
-
- * gui/calendar-commands.c (calendar_control_activate): Removed
- ifdefed-out view buttons code from the Gnomecal days.
-
- * gui/gnome-cal.c (client_categories_changed_cb): Merge the
- categories of the calendar and tasks clients so that we can
- display the categories in both sets.
- (gnome_calendar_construct): Connect to "categories_changed" on
- both clients.
- (gnome_calendar_on_date_navigator_selection_changed): Removed call
- to gnome_calendar_update_view_buttons().
- (gnome_calendar_update_view_buttons): Removed. We cannot have
- this until Bonobo supports radio toolbar items.
- (gnome_calendar_set_view_buttons): Removed.
- (gnome_calendar_dayjump): Do not use priv->day_button.
- (GnomeCalendarPrivate): Removed the {day,work_week,week,month}_button
- fields.
- (gnome_calendar_set_query): Start a retagging process of the date
- navigator so that it reflects the current query.
- (update_query): New function to restart a query for the date navigator.
- (initial_load): Use update_query() instead of tagging the date
- navigator directly.
- (gnome_calendar_on_date_navigator_date_range_changed): Likewise.
- (client_cal_opened_cb): Use update_query() instead of initial_load().
- (initial_load): Removed.
- (client_obj_updated_cb): Removed.
- (client_obj_removed_cb): Removed.
- (gnome_calendar_new_appointment_for): Set the default category of
- the new component.
- (search_bar_category_changed_cb): Set the default category for the
- calendar views.
-
- * gui/cal-search-bar.c (cal_search_bar_set_categories): Sort the
- categories before creating the menu.
-
- * gui/e-day-view.c (adjust_query_sexp): Return NULL instead of
- "#f" if the time range is not set yet.
- (update_query): Do not start a query if the time range is not set.
- (e_day_view_set_default_category): New function.
- (e_day_view_key_press): Set the default category on the new
- component.
-
- * gui/e-week-view.c (adjust_query_sexp): Analogous to the above.
- (update_query): Analogous to the above.
- (e_week_view_set_default_category): Analogous to the above.
- (e_week_view_key_press): Analogous to the above.
-
-2001-08-03 Federico Mena Quintero <federico@ximian.com>
-
- Fixes bug #1407.
-
- * gui/dialogs/cal-prefs-dialog.glade: Removed the alarm
- preferences page, since we decided it was unnecessary.
-
-2001-08-03 Zbigniew Chyla <cyba@gnome.pl>
-
- I18n fixes.
-
- * gui/dialogs/event-page.c (summary_changed_cb):
- Use e_dialog_editable_get instead of gtk_editable_get_chars (we need
- UTF-8 string).
-
- * gui/itip-utils.c:
- Added missing #include <config.h>
-
-2001-08-02 Jon Trowbridge <trow@ximian.com>
-
- * gui/Makefile.am: Added camel dependency (now needed by ebook).
-
-2001-08-01 Federico Mena Quintero <federico@ximian.com>
-
- * gui/calendar-model.c (calendar_model_value_is_empty): If the
- default category is the same as the value passed in to this
- function, return TRUE. This could be a hack or not, but it
- prevents two items from being added to the table if a category is
- selected.
-
- * gui/e-tasks.c (setup_widgets): Allow the search bar to shrink
- horizontally.
-
- * gui/dialogs/task-page.c (clear_widgets): Pass valid values to
- e_dialog_option_menu_set(); these need to come from the status map.
-
-2001-08-01 Damon Chaplin <damon@ximian.com>
-
- * cal-client/cal-client.c: removed debugging messages.
-
-2001-08-01 Federico Mena Quintero <federico@ximian.com>
-
- The calendar search bar widget now includes a drop-down menu of
- available categories.
-
- * pcs/query.c (func_has_categories): Handle one and only one #f
- value as meaning "unfiled", for components that have no categories
- at all.
-
- * pcs/cal-backend-file.c (open_cal): Duh, do not notify here about
- changed categories since at this point we don't have any clients
- bound to us yet.
- (create_cal): Likewise.
- (cal_backend_file_add_cal): Notify here.
-
- * gui/cal-search-bar.h (CalSearchBarClass): New signal
- "category_changed".
-
- * gui/cal-search-bar.c (cal_search_bar_construct): Add a drop-down
- menu for the list of categories.
- (search_option_items): Removed the "Has category" option, since we
- now have the drop-down menu instad and it would be confusing to
- have both options.
- (regen_query): Likewise. Also, this function is now the old
- cal_search_bar_query_changed() and is shared by that very function
- and by the callback from the drop-down menu.
- (notify_query_contains): Include the sub-sexp for the categories.
- (cal_search_bar_set_categories): New function.
- (cal_search_bar_get_category): New function.
- (categories_selection_done_cb): Emit the "category_changed" signal.
-
- * gui/e-tasks.c (obj_updated_cb): Removed function since it did
- not do anything; all updates are handled by the CalendarModel.
- (obj_removed_cb): Likewise.
- (ETasksPrivate): Removed the fields for the categories option
- menu, since now it is in the ESearchBar.
- (search_bar_sexp_changed_cb): Use calendar_model_set_query()
- directly here, as we do not need to frob the sexp anymore.
- (update_query): Removed.
- (client_categories_changed_cb): New callback.
- (search_bar_category_changed_cb): New callback.
- (e_tasks_new_task): Set the default category on the component to
- the one that is selected in the search bar.
- (e_tasks_on_filter_selected): Removed.
- (e_tasks_on_categories_changed): Removed.
- (e_tasks_rebuild_categories_menu): Removed.
- (e_tasks_add_menu_item): Removed.
- (e_tasks_setup_view_menus): Sanitized not to sink objects wildly.
- (e_tasks_discard_view_menus): New function.
-
- * gui/calendar-model.h (CalendarModelClass): Removed the
- "categories_changed" signal since this is handled in the Wombat
- now.
-
- * gui/calendar-model.c (calendar_model_get_categories): Removed.
- (calendar_model_set_value_at): Do not collect the categories.
- (query_obj_updated_cb): Likewise.
- (calendar_model_collect_categories): Removed.
- (calendar_model_set_default_category): Constify.
-
- * gui/tasks-control.c (tasks_control_deactivate): Call
- e_tasks_discard_view_menus().
-
- * gui/gnome-cal.c (search_bar_category_changed_cb): Set the
- default category for the task pad's model.
-
-2001-07-31 Federico Mena Quintero <federico@ximian.com>
-
- The Wombat now keeps track of which categories are present in the
- objects of a calendar. It will notify the clients of changes in
- this set. This is to make the category drop-down menus in the
- calendar/tasks views be always up to date.
-
- * idl/evolution-calendar.idl (Listener): Added a
- notifyCategoriesChanged() method. The Wombat now keeps track of
- the categories within a calendar.
-
- * cal-client/cal-listener.[ch]: Switched it to use BonoboXObject.
- Also added the notifyCategoriesChanged implementation.
-
- * cal-client/cal-client.[ch]: Added a "categories_changed" signal.
-
- * pcs/cal-backend-file.c: Maintain a list of the live categories.
- (update_categories_from_comp): New function to maintain the set of
- live categories.
- (add_component): Update the set of categories.
- (remove_component): Likewise.
- (open_cal): Notify about changes in the set of categories.
- (create_cal): Likewise.
- (cal_backend_file_update_objects): Likewise.
- (cal_backend_file_remove_object): Likewise.
- (notify_categories_changed): New function to notify the clients
- about the current set of categories.
-
- * pcs/cal.c (cal_notify_categories_changed): New function.
-
-2001-07-31 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-day-view.c (selection_received):
- * gui/e-week-view.c (selection_received): yes, set the end date, but
- correctly calculated, not by using the component's duration, which
- may not exist. Now really fixes #5836
-
-2001-07-31 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-day-view.c (selection_received):
- * gui/e-week-view.c (selection_received): don't set the end date
- for the pasted components, since it will be recalculated when the start
- date is set, thus keeping the same duration than the original
- cut/copied component. Fixes #5836
-
-2001-07-30 Damon Chaplin <damon@ximian.com>
-
- * gui/gnome-cal.c:
- * gui/calendar-commands.c (clear_folder_bar_label): started some code
- to show the currently displayed dates in the folder title bar.
- Unfinished.
-
- * gui/e-itip-control.c (set_date_label):
- * conduits/todo/todo-conduit.c (local_record_from_comp):
- * conduits/calendar/calendar-conduit.c (local_record_from_comp): free
- the CalComponentDateTimes. (Note the iTIP control needs updating for
- timezone support.)
-
- * cal-util/cal-component.c: Changed CalComponentDateTime so that the
- TZID is malloc'ed and freed rather than being a pointer to a static
- string. This was causing problems as sometimes we were freeing the
- string that was being pointed to, so we got corrupted TZIDs.
-
- * gui/comp-util.c (cal_comp_util_add_exdate): set TZID to NULL.
- DATE values do not have timezones.
-
- * gui/e-week-view.c:
- * gui/e-day-view.c: Moved 'Paste' after the New Appointment commands,
- since I think they are more commonly-used. Also added underlined
- accelerator keys.
-
- * gui/e-calendar-table.c: changed 'Edit this task' to 'Open' in the
- popup menu to be consistent with other folders, and separated from the
- clipboard commands. Also changed to use EPopupMenu so the accelerators
- work, and the masks may be useful at some point.
-
- * gui/dialogs/recurrence-page.c: use DATE values for UNTIL, since
- that makes it simpler. Fixes bug #5034.
-
- * gui/calendar-config.c (calendar_config_set_timezone): strdup the
- location string. Fixes bug #4990.
-
- * gui/tag-calendar.c (tag_calendar_cb): take 1 off iend as the times
- don't include the end time.
-
- * gui/e-week-view-layout.c (e_week_view_layout_event): fixed
- days_shown. Fixes bug #5709.
-
- * cal-client/cal-client.c (cal_client_get_timezone): took out some
- debugging messages.
-
-2001-07-30 Damon Chaplin <damon@ximian.com>
-
- * gui/dialogs/cal-prefs-dialog.glade: added Help button. Though of
- course it doesn't do anything yet.
-
-2001-07-30 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/meeting-page.c: Mark strings for translation
-
-2001-07-30 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-client/client-test.c (cal_opened_cb): call
- cal_client_get_free_busy for testing the new method
-
- * pcs/cal-backend-file.c (cal_backend_file_get_free_busy): implemented
-
-2001-07-28 Federico Mena Quintero <federico@ximian.com>
-
- Fixes bug #5352.
-
- * gui/dialogs/cal-prefs-dialog.c (cal_prefs_dialog_show): Added a
- `page' argument so that we can select which page to show when
- popping up the dialog.
- (cal_prefs_dialog_construct): Added the `page' argument as well.
- (cal_prefs_dialog_new): Likewise.
-
- * gui/calendar-commands.c (settings_cmd): Set the page to the main
- calendar settings one.
-
- * gui/tasks-control.c (tasks_control_settings_cmd): Implemented
- callback for the "Task Settings" command.
- (verbs): Added the "TasksSettings" verb.
- (pixmaps): Added an icon for the tasks settings command.
-
-2001-07-27 JP Rosevear <jpr@ximian.com>
-
- * conduits/calendar/calendar-conduit.c (local_record_from_comp):
- recur is always in UTC
-
-2001-07-27 JP Rosevear <jpr@ximian.com>
-
- * conduits/calendar/calendar-conduit.c: handle timezones
- everywhere
- (get_timezone): new function to get a timezone based
- on a tzid
- (get_default_timezone): get default timezone
-
- * conduits/calendar/calendar-conduit.h: time zone field for the
- context
-
- * conduits/calendar/Makefile.am: link to bonobo conf
-
- * conduits/todo/todo-conduit.c: handle timezones
- everywhere
- (get_timezone): new function to get a timezone based
- on a tzid
- (get_default_timezone): get default timezone
-
- * conduits/todo/todo-conduit.h: time zone field for the
- context
-
- * conduits/todo/Makefile.am: link to bonobo conf
-
-2001-07-27 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-day-view-main-item.c (e_day_view_main_item_draw_day_event):
- * gui/e-day-view-top-item.c (e_day_view_top_item_draw_long_event):
- * gui/e-week-view-event-item.c (e_week_view_event_item_draw_icons):
- initialize to NULL some pointers
-
- * e-calendar-table.c (selection_received): deal correctly with
- VCALENDAR objects
- (e_calendar_table_copy_clipboard): g_strdup the value returned by
- icalcomponent_get_as_ical_string
-
-2001-07-27 Federico Mena Quintero <federico@ximian.com>
-
- * gui/gnome-cal.c (gnome_calendar_set_query): Constify and set the
- query sexp on the task pad's model as well.
-
-2001-07-27 Federico Mena Quintero <federico@ximian.com>
-
- * gui/cal-search-bar.[ch]: New files with a derivative of
- ESearchBar that generates sexps for calendar queries directly.
-
- * gui/gnome-cal.c (setup_widgets): Use CalSearchBar instead of
- ESearchBar.
-
- * gui/e-calendar-table.h (ECalendarTable): Removed the ->colors
- array since it is handled by ETableExtras now.
-
- * gui/e-calendar-table.[ch]: Removed the subset_model. Now we use
- the live query facility to filter tasks. Removed the filter
- function stuff as well.
-
- * gui/e-tasks.c (e_tasks_construct): Use
- calendar_model_set_cal_client() directly instead of
- e_calendar_table_set_model().
- (setup_widgets): Create a calendar search bar for the tasks
- component.
- (search_bar_sexp_changed_cb): Set the query sexp on the table model.
- (e_tasks_on_filter_selected): Regenerate the query from the
- selected category and the current sexp.
- (update_query): New convenience function to recompute the real
- query sexp.
-
- * gui/gnome-cal.c (gnome_calendar_construct): Likewise.
-
- * gui/e-calendar-table.c (e_calendar_table_set_cal_client):
- Removed function; people are now supposed to get the model from
- the calendar table and operate on it.
-
- * gui/calendar-commands.c (verbs): Consistency fixes with the XML
- file.
- (pixmaps): Likewise.
-
- * gui/Makefile.am (evolution_calendar_SOURCES): Added
- cal-search-bar.[ch] to the list of sources.
-
-2001-07-20 Federico Mena Quintero <federico@ximian.com>
-
- * idl/evolution-calendar.idl (CompEditorFactory): New interface to
- a centralized factory for calendar component editors. Has
- editExisting() and editNew() methods to edit an existing component
- from a URI/UID pair, and to create a new component in a calendar
- that is in a particular URI, respectively.
-
- * gui/comp-editor-factory.[ch]: Implementation files for the
- component editor factory.
-
- * gui/GNOME_Evolution_Calendar.oaf.in: Added the CompEditorFactory
- stuff.
-
- * gui/Makefile.am (evolution_calendar_SOURCES): Added
- comp-editor-factory.[ch] to the list of sources.
-
-2001-07-26 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/meeting-page.c (invite_entry_changed): when an entry
- has changed, iterate over the elements of the entry and add them
- to the list if need be
- (get_select_name_dialog): add a Chair Persons section
-
- * gui/itip-utils.c (itip_send_comp): send the empty string as
- subject if there is no summary
-
-2001-07-26 JP Rosevear <jpr@ximian.com>
-
- * gui/itip-utils.c (itip_send_comp): send the empty string as
- subject if there is no summary
-
- * gui/dialogs/meeting-page.c (cleanup_attendees): free a list of
- attendees
- (meeting_page_fill_widgets): clean up attendee lists and fix typo
- (find_match): add ability to return pos of match
- (popup_delete_cb): if deletion happens, make sure to tidy up
- delegation chain
-
- * gui/dialogs/e-delegate-dialog.c (e_delegate_dialog_construct):
- use the destination rather than text property
- (e_delegate_dialog_get_delegate): ditto
- (e_delegate_dialog_new): take name/address pair for dialog default
-
- * gui/dialogs/e-delegate-dialog.h: update protos
-
- * gui/e-itip-control.c (clean_up): only unref the object if we
- have one
-
- * gui/itip-control-factory.c (stream_read): make sure we null
- terminate the final buffer
-
- * gui/itip-utils.c (itip_send_comp): strip the mailto: from the
- organizer address if necessary
-
-2001-07-26 Damon Chaplin <damon@ximian.com>
-
- * gui/dialogs/recurrence-page.c (exception_select_row_cb): check that
- the row passed in is valid. Sometimes we get the "row-selected"
- signal for row 0 when there are no rows in the list. Fixes bug #4266.
-
- * cal-client/cal-client.c (cal_client_get_object): prefetch all the
- timezone data needed by the object, to try to avoid making Corba
- calls all over the place. They can cause problems because they call
- the GTK+ main loop recursively. This currently leads to an assertion
- failure in the GnomeCanvas occasionally.
-
-2001-07-25 JP Rosevear <jpr@ximian.com>
-
- * gui/e-itip-control.c (e_itip_control_set_data): gracefully
- handle the lack of a method
-
-2001-07-25 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-day-view.c (selection_received_cb): check type of component
- before actually pasting.
- Deal with VCALENDAR components also (fixes bug #5140)
-
- * gui/e-week-view.c (selection_received_cb): ditto
-
- * cal-client/cal-client.c (cal_client_update_object): check the return
- value from cal_component_get_as_string and don't call
- GNOME_Evolution_Calendar_Cal_updateObjects if NULL
-
-2001-07-25 Damon Chaplin <damon@ximian.com>
-
- * gui/dialogs/comp-editor.c (pixmaps): used the new print preview icon.
-
- * gui/print.c (range_selector_new): changed the 'Current day/week...'
- strings to 'Selected day/week...' to make a little less confusing.
- Fixes bug #5451.
-
-2001-07-25 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/meeting-page.c (is_duplicate): see if the address is
- already in the list of attendees
- (duplicate_error): throw up an error dialog
- (popup_delegate_cb): if the attendee has already delegated, delete
- the old delegatee
- (value_at): cast to kill warnings
- (append_row): don't add the new attendee if they are already in
- the list
-
-2001-07-24 Damon Chaplin <damon@ximian.com>
-
- * gui/dialogs/recurrence-page.c (get_exception_string): calculate
- tmp_tm.tm_wday ourselves. strftime has a habit of crashing if you
- have weird values here. I think this fixes bug #4574.
-
-2001-07-24 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/meeting-page.c (value_at): stip the delto and
- delfrom
- (popup_delegate_cb): show a delegate dialog and add the new
- delegatee and update the delegator
- (add_section): listen for changes in a more direct manner
- (get_select_name_dialog): add_section now takes a limit argument
-
- * gui/dialogs/e-delegate-dialog.[hc]: New dialog to query the user
- for a person to delegate to
-
- * gui/dialogs/Makefile.am: build/install new files
-
- * gui/Makefile.am: add ldadd line for ebook
-
-2001-07-21 Damon Chaplin <damon@ximian.com>
-
- * gui/e-week-view-event-item.c (e_week_view_event_item_draw): fixed
- the test to see whether we should draw the icons.
-
-2001-07-22 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component-factory.c (get_local_file_name_for_folder_type):
- New helper function.
- (remove_folder): Add a @type arg and handle it, by deleting
- "tasks.ics" instead of "calendar.ics" if the type is "tasks". If
- the type is not "tasks" or "calendar", report an
- `UNSUPPORTED_TYPE' error.
- (xfer_folder): Likewise.
-
-2001-07-21 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component-factory.c: Make folders of type "calendar" and
- "tasks" user-creatable by setting `user_creatable' to %TRUE in the
- `EvolutionShellComponentFolderType's.
-
-2001-07-19 Federico Mena Quintero <federico@ximian.com>
-
- * gui/dialogs/event-editor.h (event_editor_update_widgets):
- Removed unused prototype.
-
- * gui/dialogs/task-editor.h (task_editor_update_widgets):
- Likewise.
-
-2001-07-19 JP Rosevear <jpr@ximian.com>
-
- * gui/e-itip-control.c (clean_up): free various data related
- settings
- (destroy): use cleanup and unref the clients
- (e_itip_control_set_data): clean up before setting the data and
- store the timezones in a top level component
- (update_item): use cal_client_update_objects and our top level
- (including the timezones)
-
-2001-07-19 Damon Chaplin <damon@ximian.com>
-
- * gui/dialogs/comp-editor.c (pixmaps):
- * gui/calendar-commands.c (pixmaps): updated to use new print icon.
-
-2001-07-17 Damon Chaplin <damon@ximian.com>
-
- * gui/dialogs/recurrence-page.c (init_widgets): don't show the time
- in the EDateEdit widget for adding EXDATEs.
-
- * cal-util/cal-component.c (cal_component_alarm_set_trigger): don't
- set t.time.is_date to -1. It is a boolean flag, 0 or 1. We probably
- don't want a date value, so we leave it at 0.
-
-2001-07-18 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-day-view-main-item.c (e_day_view_main_item_draw_day_event):
- do not discard drawing icon if mask is NULL
-
- * gui/e-day-view-top-item.c (e_day_view_top_item_draw_long_event):
- ditto
-
-2001-07-17 JP Rosevear <jpr@ximian.com>
-
- * gui/e-itip-control.c (get_next): find the next displayable
- component
- (get_prev): find the previous displayable component
- (e_itip_control_set_data): use above
- (prev_clicked_cb): ditto
- (next_clicked_cb): ditto
-
-2001-07-17 Federico Mena Quintero <federico@ximian.com>
-
- Really fixes #4380. The previous fix was necessary but not
- sufficient; it worked for me because my system timezone happens to
- match the Evolution timezone --- if they don't match, the bug
- would persist. Not matching is *not* an error; it is just a
- matter of Unix sucking a lot and XST not being finished :)
-
- * cal-util/timeutil.c (time_to_gdate_with_zone): New function. We
- cannot use g_date_set_time() anymore because it does not take
- timezones into account.
-
- * gui/gnome-cal.c (get_days_shown): Use the function above.
-
- * gui/e-day-view.c (e_day_view_find_work_week_start): Likewise.
-
- * gui/e-week-view.c (e_week_view_set_selected_time_range): Likewise.
-
-2001-07-17 Jon Trowbridge <trow@ximian.com>
-
- * gui/dialogs/meeting-page.c (invite_entry_changed): Print
- a g_message when the list of invited people changes
- in the SelectNames control.
- (add_section): #if 0/#endif out some (broken?) code.
- (get_select_name_dialog): Listen for changes in the
- SelectNames control.
-
-2001-07-17 Damon Chaplin <damon@ximian.com>
-
- * gui/dialogs/e-timezone-dialog.c (e_timezone_dialog_destroy): destroy
- the dialog widget here. Fixes bug #4198.
-
-2001-07-16 Damon Chaplin <damon@ximian.com>
-
- * gui/dialogs/task-page.c (task_page_fill_widgets):
- * gui/dialogs/event-page.c (event_page_fill_widgets): try to use
- builtin timezones before getting them from the server. When creating
- new events/tasks the timezones may not be on the server.
-
- * gui/dialogs/event-page.c (event_page_fill_widgets): for all-day
- events we subtract a day from the end date rather than add it.
-
- * gui/dialogs/e-timezone-dialog.c (on_map_leave): ignore the event
- if it isn't a GDK_CROSSING_NORMAL event. For some reason we are getting
- leave events when the button is pressed, which meant that selecting
- timezones in the map didn't work.
-
- * gui/dialogs/comp-editor-util.c (comp_editor_dates):
- * gui/print.c (print_date_label): only free icaltimetype if not NULL.
-
-2001-07-12 Taylor Hayward <taylorhayward@yahoo.com>
-
- * gui/goto-dialog.glade:
- * gui/meeting-mockup.glade:
- * gui/alarm-notifylarm-notify.glade:
- * gui/dialogs/alarm-page.glade:
- * gui/dialogs/meeting-page.glade:
- * gui/dialogs/recurrence-page.glade: Added missing underlined
- shortcuts.
-
-2001-07-12 JP Rosevear <jpr@ximian.com>
-
- * cal-util/cal-util.h: new proto
-
- * cal-util/cal-util.c (cal_util_new_top_level): standard place to
- get your top level calendar component
-
- * pcs/cal-backend-file.c (create_cal): use it
-
- * gui/itip-utils.c (itip_send_comp): ditto
-
- * gui/e-calendar-table.c (e_calendar_table_copy_clipboard): ditto
-
-2001-07-12 JP Rosevear <jpr@ximian.com>
-
- * gui/e-calendar-table.c (e_calendar_table_copy_clipboard): fix
- typo breaking compilation
-
- * gui/dialogs/meeting-page.c: fix include
-
- * gui/dialogs/Makefile.am: build select names idl here
-
- * gui/Makefile.am: remove select names compilation from here
-
-2001-07-12 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/task-details-page.c (task_details_page_set_dates):
- guard against infinite loops with the updating boolean, fixes 4270
-
-2001-07-12 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-calendar-table.c: added support for multiple selections in
- cut/copy/paste. Also, it's now ready for the
- s/update_object/update_objects change (I think)
-
-2001-07-11 Damon Chaplin <damon@ximian.com>
-
- * idl/evolution-calendar.idl: renamed updateObject to updateObjects
- and removed the UID argument, since it can add/update multiple objects
- at once. (It can't yet, but it will!)
-
- * pcs/cal.c:
- * pcs/cal-backend.[hc]:
- * pcs/cal-backend-file.c: renamed update_object to update_objects and
- got rid of the UID arg.
-
- * cal-client/cal-client.c (cal_client_update_objects): new function to
- add/update multiple objects in one go, i.e for iTIP and for importing
- calendars.
-
- * gui/print.c (print_date_label): fixed type bug.
-
- * gui/e-week-view.[hc]:
- * gui/e-week-view-event-item.c: draw the timezone icons if the event's
- DTSTART or DTEND is in a different timezone to the current one.
- Note that we may want to change this so it compares the UTC offsets
- rather than the TZIDs, since currently it will draw the icons for all
- events coming from iTIP requests from other clients.
-
-2001-07-11 Federico Mena Quintero <federico@ximian.com>
-
- Fixes bug #4380 as well as some leftovers from the days of struct
- tm and some uninitialized values.
-
- * gui/gnome-cal.c
- (gnome_calendar_on_date_navigator_selection_changed): Initialize
- the icaltimetype structures completely.
- (gnome_calendar_init): Do not reset priv->zone to NULL here, since
- it was set by gnome_calendar_update_config_settings() from
- setup_widgets().
-
- * gui/calendar-model.c (set_completed): Do not set is_daylight.
-
- * gui/e-day-view.c (e_day_view_convert_grid_position_to_time):
- Likewise.
-
- * gui/e-week-view.c (e_week_view_set_timezone): Likewise.
-
- * cal-util/cal-recur.c (generate_instances_for_chunk): Likewise,
- and initialize start_tt and end_tt completely.
-
- * cal-util/timeutil.c (time_year_begin_with_zone): Likewise.
- (time_month_begin_with_zone): Likewise.
- (time_week_begin_with_zone): Likewise.
- (time_day_begin_with_zone): Likewise.
- (time_day_end_with_zone): Likewise.
- (time_from_isodate): Likewise.
-
- * gui/dialogs/task-page.c (task_page_fill_component): Initialize
- icaltime before using it.
-
- * gui/dialogs/event-page.c (event_page_fill_component): Likewise.
-
- * gui/dialogs/recurrence-page.c (simple_recur_to_comp): Removed an
- unused icaltimetype.
-
- * gui/dialogs/task-details-page.c
- (task_details_page_fill_component): Initialize icaltime before
- using it.
-
-2001-07-11 JP Rosevear <jpr@ximian.com>
-
- * gui/component-factory.c: fix the calendar not exiting with a
- gross hack because i don't have time to fix the ref counting right
- now
-
-2001-07-11 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/meeting-page.c: be careful about adding and
- stripping MAILTO:'s properly
-
- * gui/dialogs/meeting-page.etspec: add missing columns
-
- * gui/itip-utils.c (itip_strip_mailto): point to the real start of
- the email address
-
- * gui/itip-utils.h: add proto
-
- * gui/itip-control-factory.c: get rid of the my address property
-
- * gui/e-itip-control.c: use the users real identity to figure out
- which attendee they are
- (find_my_address): figure out who the user is among the attendees
-
- * gui/e-itip-control.h: remove protos
-
- * gui/dialogs/Makefile.am: extra dist etspecs
-
- * gui/Makefile.am: ditto
-
-2001-07-11 Kjartan Maraas <kmaraas@gnome.org>
-
- * gui/e-calendar-table.c: Added a hack to get the last
- string translated since xml-i18n-tools doesn't recognize
- _click-to-add-message="Click here to add a task".
-
-2001-07-10 Peter Williams <peterw@ximian.com>
-
- * gui/Makefile.am (BUILT_SOURCES): Move this higher so that
- Makefile properly depends on us. Fixes distcheck.
-
-2001-07-11 Jason Leach <jleach@ximian.com>
-
- [Fix bug #4389: ETableSpecification still in e-calendar-table.c
- file]
-
- * gui/e-calendar-table.etspec: New file containing the spec that
- was in e-calendar-table.c as a big string.
-
- * gui/e-calendar-table.c (e_calendar_table_init): Use the spec
- file instead of a string.
- (e_calendar_table_get_spec): Removed this function, we don't need
- it anymore.
-
- * gui/e-tasks.c (e_tasks_setup_menus): Don't load from string,
- from file instead.
-
- * gui/Makefile.am: Necessary changes to get the new .etspec file
- installed.
-
-2001-07-10 Jason Leach <jleach@ximian.com>
-
- [Fix bug #4388: ETableSpecification still in meeting-page.c file]
-
- * gui/dialogs/meeting-page.etspec: New file containing the spec
- that was previously in meeting-page.c as a string.
-
- * gui/dialogs/meeting-page.c: One line change to get it to use
- this spec file instead of a string.
-
- * gui/dialogs/Makefile.am: Necessary changes to get the new
- meeting-page.etspec installed.
-
-2001-07-10 Damon Chaplin <damon@ximian.com>
-
- * gui/calendar-model.c:
- * gui/e-calendar-table.c:
- * gui/e-day-view-main-item.c:
- * gui/e-day-view-top-item.c:
- * gui/e-day-view.[hc]:
- * gui/e-week-view.c:
- * gui/gnome-cal.c:
- * gui/print.c:
- * gui/dialogs/cal-prefs-dialog.c:
- * gui/dialogs/comp-editor-util.c:
- * gui/dialogs/event-page.c:
- * pcs/cal-backend-file.c:
- * pcs/query.c:
- * cal-util/cal-component.[hc]:
- * cal-util/cal-recur.c:
- * cal-util/timeutil.[hc]:
- * cal-client/cal-client.[hc]: more timezone updates. I'm pretty much
- done with the calendar code now, except for alarms and conduits,
- which Federico and JP know more about. And there are a couple of
- other minor things to fix. But it is still pretty buggy.
-
-2001-07-10 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/meeting-page.c: Add popup support so you can delete
- users from the list
-
- * gui/dialogs/comp-editor.c (setup_widgets): fix typo
-
-2001-07-10 Federico Mena Quintero <federico@ximian.com>
-
- * gui/alarm-notify/alarm-queue.c (alarm_trigger_cb): Handle the
- different alarm actions.
- (display_notification): Do the alarm notification dialog here.
-
- * gui/alarm-notify/alarm-notify-dialog.c (make_heading): Take in a
- CalComponentVType, not a whole component.
- (alarm_notify_dialog): Take in a CalComponentVType and the final
- message instead of generating it ourselves.
-
-2001-07-09 Federico Mena Quintero <federico@ximian.com>
-
- * pcs/cal-backend-file.c (generate_alarms_for_comp): Pass the
- parent vCalendar component as the timezone closure of
- cal_recur_generate_instances().
-
- * gui/dialogs/alarm-page.c (get_alarm_string): Make the string
- consistent with the option menu text.
- (get_alarm_string): Removed extra spaces from the last part of the
- alarm string.
-
-2001-07-09 Federico Mena Quintero <federico@ximian.com>
-
- * gui/e-day-view.c (e_day_view_key_press): Use
- e_utf8_from_gtk_event_key() so that we can input utf8 text
- properly.
- (e_day_view_cut_clipboard): Constify.
- (e_day_view_on_cut): Constify.
- (e_day_view_reshape_long_event): Remove unused variable.
-
- * gui/e-week-view.c (e_week_view_key_press): Use
- e_utf8_from_gtk_event_key() so that we can input utf8 text
- properly.
- (e_week_view_cut_clipboard): Constify.
- (e_week_view_on_cut): Constify.
-
- * cal-client/cal-client.c (cal_client_resolve_tzid_cb): Fix the
- prototype so that this matches CalRecurResolveTimezoneFn. Also
- renamed it so that it is clear that it is supposed to be a
- callback.
-
-2001-07-06 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/meeting-page.c (init_widgets): connect to the entry
- not the combo
-
- * gui/dialogs/event-editor.c (set_menu_sens): set menu
- sensitivities based on whether or not the meeting page is shown
- (event_editor_init): call above
- (event_editor_edit_comp): ditto
- (schedule_meeting_cmd): ditto
-
- * gui/dialogs/comp-editor.h: new proto
-
- * gui/dialogs/comp-editor.c (comp_editor_set_ui_prop): new
- function to allow for set of ui props (esp. "sensitive")
-
-2001-07-06 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/meeting-page.c (clear_widgets): actually clear some
- widgets and hide/show widgets in the default setup
- (meeting_page_destroy): destroy the address lists
- (meeting_page_fill_widgets): allow the user to select among their
- identities as a new organizer, or show the existing organizer as
- label
- (meeting_page_fill_component): set the "MAILTO:" bit of the
- organizer to match spec, set CN properly if we know it
- (get_widgets): load new widgets
- (other_clicked_cb): handle "Other Organizer" click
- (change_clicked_cb): handle "Change Organizer" click
- (init_widgets): listen for clicks on new buttons
-
- * gui/dialogs/comp-editor.c (comp_editor_remove_page): remove the
- page from our internal list and unref it
-
- * gui/itip-utils.c (itip_addresses_get): get the configure mail
- identities
- (itip_addresses_free): free a list of identities returned by
- itip_addresses_get
-
- * gui/itip-utils.h: remove obsolete protos, and new protos
-
- * gui/gnome-cal.html: Remove ancient file
-
-2001-07-04 Federico Mena Quintero <federico@ximian.com>
-
- Fixes bug #4018 and what would be the analogous bugs for the other
- component editors.
-
- * gui/dialogs/comp-editor-page.h (CompEditorPageClass): New
- virtual method "::focus_main_widget()".
-
- * gui/dialogs/comp-editor-page.c
- (comp_editor_page_focus_main_widget): New function.
-
- * gui/dialogs/comp-editor.c (comp_editor_append_page): If we are
- inserting the main page, ask it to focus its main widget.
-
- * gui/dialogs/alarm-page.c (alarm_page_focus_main_widget):
- Implemented.
-
- * gui/dialogs/event-page.c (event_page_focus_main_widget):
- Implemented.
- #include "e-util/e-categories-config.h".
-
- * gui/dialogs/meeting-page.c (meeting_page_focus_main_widget):
- Implemented.
-
- * gui/dialogs/recurrence-page.c
- (recurrence_page_focus_main_widget): Implemented.
-
- * gui/dialogs/task-details-page.c
- (task_details_page_focus_main_widget): Implemented.
-
- * gui/dialogs/task-page.c (task_page_focus_main_widget):
- Implemented.
-
-2001-07-04 Federico Mena Quintero <federico@ximian.com>
-
- * gui/calendar-commands.c (clear_folder_bar_label): New function.
- (calendar_control_activate): Clear the folder bar label; we really
- don't have anything interesting to display.
-
-2001-07-03 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/meeting-page.c: Add new columns for information
- specification
- (meeting_page_destroy): save the table state
- (build_etable): load new table state
-
- * gui/dialogs/task-editor.c (task_editor_destroy): unref pages
-
- * gui/dialogs/event-editor.c (event_editor_destroy): unref pages
-
- * gui/dialogs/comp-editor.c (setup_widgets): kill warning
- (comp_editor_append_page): ref page passed in
- (close_dialog): unref pages
-
-2001-07-03 Damon Chaplin <damon@ximian.com>
-
- * gui/e-day-view.c (query_obj_updated_cb): fix warning, and added
- some debug messages.
-
- * gui/dialogs/comp-editor-util.c (write_label_piece):
- * gui/e-day-view-top-item.c (e_day_view_top_item_draw): call mktime()
- to set the weekday, though this is a temporary fix.
-
-2001-07-03 Damon Chaplin <damon@ximian.com>
-
- * pcs/cal-backend.[hc]: added virtual method to get a VTIMEZONE
- component given a TZID. We need this to resolve TZIDs when expanding
- an event using cal_recur_generate_instances() in query.c.
-
- * pcs/cal-backend-file.c (cal_backend_file_get_timezone): implemented
- virtual method.
- (cal_backend_file_update_object): fixed bug, kind -> child_kind.
-
- * pcs/query.c (func_occur_in_time_range): use the virtual method for
- resolving TZIDs. The other way didn't work anyway, as we didn't have
- the entire VCALENDAR with VTIMEZONEs in it.
-
- * gui/dialogs/recurrence-page.c (init_widgets):
- (make_ending_until_special): moved the call to
- e_date_edit_set_get_time_callback() from init_widgets to
- make_ending_until_special(), since that is where the widget gets
- created.
-
- * gui/e-timezone-entry.c (e_timezone_entry_set_timezone): handle zone
- being NULL.
-
-2001-07-02 Federico Mena Quintero <federico@ximian.com>
-
- * gui/dialogs/alarm-options.[ch]: New files with the alarm options
- dialog; this configures the repeat/duration properties and the
- options specific to each alarm action type.
-
- * gui/dialogs/alarm-page.c (AlarmPagePrivate): Added the alarm
- options button. Also, keep an alarm structure which we are
- editing and an alarm options dialog.
- (init_widgets): Connect to the options button.
- (add_clicked_cb): Clone the component we are editing instead of
- creating a new one so that we preserve the data from the alarm
- options dialog.
- (button_options_clicked_cb): Pop up the alarm options dialog.
-
- * cal-util/cal-component.c (cal_component_alarm_new): Doh,
- initialize the other fields in the new alarm.
-
-2001-07-03 Damon Chaplin <damon@ximian.com>
-
- * cal-client/cal-client.[hc]
- * cal-util/cal-component.c
- * cal-util/cal-recur.[hc]
- * cal-util/test-recur.c
- * cal-util/timeutil.c
- * gui/calendar-config.c
- * gui/calendar-model.[hc]
- * gui/comp-util.[hc]
- * gui/e-calendar-table.c
- * gui/e-day-view-main-item.c
- * gui/e-day-view-top-item.c
- * gui/e-day-view.[hc]
- * gui/e-itip-control.c
- * gui/e-timezone-entry.[hc]
- * gui/e-week-view.[hc]
- * gui/gnome-cal.[hc]
- * gui/goto.c
- * gui/tag-calendar.[hc]
- * gui/dialogs/cal-prefs-dialog.c
- * gui/dialogs/comp-editor-page.[hc]
- * gui/dialogs/comp-editor-util.[hc]
- * gui/dialogs/comp-editor.c
- * gui/dialogs/e-timezone-dialog.[hc]
- * gui/dialogs/event-page.c
- * gui/dialogs/meeting-page.c
- * gui/dialogs/recurrence-page.c
- * gui/dialogs/task-details-page.c
- * gui/dialogs/task-details-page.glade
- * gui/dialogs/task-page.c
- * idl/evolution-calendar.idl
- * pcs/cal-backend-file.c
- * pcs/cal-backend.c
- * pcs/cal-backend.h
- * pcs/cal.c
- * pcs/query.c: timezone changes everywhere. There's still quite a
- few things to update, and its not working well at present.
-
-2001-07-02 JP Rosevear <jpr@ximian.com>
-
- * gui/calendar-commands.c (publish_freebusy_cmd): publish
- free/busy information for the currently viewed time range
-
-2001-07-02 Christopher James Lahey <clahey@ximian.com>
-
- * gui/Makefile.am (INCLUDES): Added $(BONOBO_CONF_CFLAGS).
- (evolution_calendar_LDADD): Added $(BONOBO_CONF_LIBS).
-
-2001-07-02 Federico Mena Quintero <federico@ximian.com>
-
- Support for ATTACH, DESCRIPTION properties in alarm components.
-
- * cal-util/cal-component.c (scan_alarm_property): Deal with
- ATTACH, DESCRIPTION properties.
- (cal_component_alarm_get_attach): New function. Libical is
- actually bogus; supposedly icalattachtype structures are
- refcounted but the property functions return them by value.
- (cal_copmonent_alarm_set_attach): New function.
- (cal_component_alarm_get_description): New function.
- (cal_component_alarm_set_description): New function.
-
-2001-07-02 Federico Mena Quintero <federico@ximian.com>
-
- Support for repeat/duration properties in alarm components.
-
- * cal-util/cal-component.h (CalAlarmRepeat): New structure that
- pairs the repeat/duration values of an alarm component, which must
- be set both together or not set at all.
-
- * cal-util/cal-component.c (CalComponentAlarm): Added fields for
- the repeat and duration properties.
- (scan_alarm_property): Scan the DURATION and REPEAT properties.
- (make_alarm): Nullify/initialize all the fields in the alarm.
- (cal_component_alarm_get_repeat): New function.
- (cal_component_alarm_set_repeat): New function.
-
- * gui/dialogs/alarm-page.glade: Changed the label of display
- alarms from "Show a dialog" to "Display a message".
-
-2001-07-02 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/task-details-page.c
- (task_details_page_fill_widgets): fill in delegated from field
-
-2001-07-02 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/dialogs/task-page.c (categories_clicked_cb):
- * gui/dialogs/event-page.c (categories_clicked_cb): use the new
- self-contained e_categories_config_open_dialog_for_entry() function
-
- * gui/e-week-view-event-item.c (e_week_view_item_draw_icons):
- * gui/e-day-view-top-item.c (e_day_view_reshape_long_event):
- (e_day_view_reshape_day_event): ditto
- * gui/e-day-view-main-item.c (e_day_view_main_item_draw_day_event):
- use e_categories_config_get_icon_for() to retrieve the icon
- associated with each category
-
-2001-07-02 JP Rosevear <jpr@ximian.com>
-
- * gui/e-itip-control.c (send_freebusy): implement
-
- * cal-util/cal-component.c (set_attendee_list): add the delto
- property rather than the delfrom property twice
-
- * gui/dialogs/task-editor.c (task_editor_edit_comp): show
- delegation info if appropriate
- (delegate_task_cmd): delegate command
- (cancel_task_cmd): cancel command
- (refresh_task_cmd): refresh command
-
- * gui/dialogs/task-details-page.c: Load new widgets
- (task_details_page_show_delegation): show/hide delegation info widgets
-
- * gui/dialogs/task-details-page.h: new proto
-
- * gui/dialogs/event-editor.c (event_editor_edit_comp): free
- attendee list when finished
-
- * gui/dialogs/comp-editor.c (setup_widgets): explicitly show the
- widgets, update pixmaps after the verbs have been added
- (comp_editor_focus): don't do a show all
-
-2001-07-02 Federico Mena Quintero <federico@ximian.com>
-
- Fixes bug #1406.
-
- * gui/calendar-config.c (config_read): Handle the options for the
- task list colors.
- (calendar_config_write): Ditto.
- (calendar_config_get_tasks_due_today_color): New function.
- (calendar_config_set_tasks_due_today_color): New function.
- (calendar_config_get_tasks_overdue_color): New function.
- (calendar_config_set_tasks_overdue_color): New function.
- (calendar_config_configure_e_calendar_table): Use
- e_table_model_changed() for the colors.
-
- * gui/dialogs/cal-prefs-dialog.glade: Updated the options for the
- task list and alarms.
-
- * gui/dialogs/cal-prefs-dialog.c (cal_prefs_dialog_show_config):
- Update the task list settings.
- (cal_prefs_dialog_update_config): Ditto.
-
- * gui/calendar-model.c (get_color): Deal with tasks for today as
- well as overdue tasks. Make it cleaner, even though we have to
- duplicate a chunk of is_overdue().
-
- * gui/calendar-commands.c (preferences_cmd): Renamed from
- properties_cmd().
-
-2001-07-01 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-day-view-main-item.c
- (e_day_view_main_item_draw_day_event): draw icons per category
-
- * gui/e-day-view-top-item.c
- (e_day_view_top_item_draw_long_event): draw icons per category
-
- * gui/e-day-view.c
- (e_day_view_reshape_long_event):
- (e_day_view_reshape_day_event): calculate space for category icons
-
- * gui/e-week-view-event-item.c
- (e_week_view_event_item_draw_icons): draw icons per category
-
- * gui/e-week-view.c
- (e_week_view_reshape_event_span): calculate space for category icons
-
-2001-07-01 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-day-view.c (e_day_view_*_clipboard): fixed clibpoard
- command activation from the menu entries. CTRL-C and CTRL-X don't
- work though, since it seems the key presses are being captured by
- the text item
-
- gui/e-week-view.c (e_week_view_*_clipboard): ditto
-
-2001-06-30 Federico Mena Quintero <federico@ximian.com>
-
- * gui/e-week-view-event-item.c
- (e_week_view_event_item_button_press): Only set the
- pressed_event_num and pressed_span_num if button 1 was pressed.
- Fix up return values a bit. This fixes bug #3780.
-
- * gui/gnome-cal.c
- (gnome_calendar_on_date_navigator_selection_changed): Doh, the
- call for the day view was supposed to be
- gnome_calendar_set_view(), not set_view(). Fixes bug #3779.
-
-2001-06-30 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/tasks-control.c (tasks_control_cut_cmd): call
- e_calendar_table_cut_clipboard with the correct object
-
- (tasks_control_copy_cmd): ditto
-
- (sensitize_commands): sensitize clipboard commands based on the
- number of selected tasks
-
-2001-06-28 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-calendar-table.[ch] (e_calendar_table_cut_clipboard),
- (e_calendar_table_copy_clipboard),
- (e_calendar_table_paste_clipboard): new functions for allowing the
- execution of clipboard-related commands
-
- * gui/tasks-control.c (tasks_control_cut_cmd),
- (tasks_control_copy_cmd), (tasks_control_paste_cmd): added
- callbacks for the new clipboard-related menu entries
-
-2001-06-28 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/component-factory.c: removed not-uses-anymore parameter in
- call to evolution_shell_component_new
-
- * gui/gnome-cal.[ch] (gnome_calendar_cut_clipboard),
- (gnome_calendar_copy_clipboard), (gnome_calendar_paste_clipboard):
- new functions for allowing execution of clipboard-related commands
-
- * gui/e-day-view.[ch] (e_day_view_cut_clipboard),
- (e_day_view_copy_clipboard), (e_day_view_paste_clipboard): ditto
-
- * gui/e-week-view.[ch] (e_week_view_cut_clipboard),
- (e_week_view_copy_clipboard), (e_week_view_paste_clipboard): ditto
-
-2001-06-27 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/calendar-commands.c (cut_event_cmd),
- (copy_event_cmd), (paste_event_cmd): added callbacks for the new
- clipboard-related menu entries
-
-2001-06-27 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component-factory.c (factory_fn): Pass NULL as the
- @external_uri_schemas argument to
- `evolution_shell_component_new()'.
-
-2001-06-27 Peter Williams <peterw@ximian.com>
-
- * conduits/*/Makefile.am (INCLUDES): More srcdir != builddir
- fixes.
-
-2001-06-27 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-calendar-table.c (selection_received): fixed
- (e_calendar_table_on_copy): fixed
-
-2001-06-26 Federico Mena Quintero <federico@ximian.com>
-
- * idl/evolution-calendar.idl (CalAlarmInstance): Renamed the occur
- field to occur_start; added an occur_end field. This way we can
- present the complete times for the occurrence from the server.
-
- * cal-util/cal-component.h (CalAlarmInstance): Likewise.
-
- * pcs/cal-backend-file.c (add_alarm_occurrences_cb): Fill the new
- fields appropriately.
- (generate_absolute_triggers): Likewise; we use -1 in case the
- component has no DTSTART or DTEND because there are no meaningful
- occurrence dates here.
- (fill_alarm_instances_seq): Fill in the new fields.
-
- * cal-client/cal-client.c (build_alarm_instance_list): Likewise.
-
- * gui/alarm-notify/alarm-notify-dialog.c (alarm_notify_dialog):
- Take in both the occur_start and occur_end times.
-
- * gui/goto.c (goto_dialog): Free the dlg structure on the bail-out
- cases.
-
- * gui/dialogs/event-page.c (get_widgets): Do not assert if we
- cannot find the main widget; just return FALSE.
-
- * gui/dialogs/alarm-page.c (get_widgets): Likewise.
-
- * gui/dialogs/task-page.c (get_widgets): Likewise.
-
- * gui/dialogs/task-details-page.c (get_widgets): Likewise.
-
- * gui/dialogs/meeting-page.c (get_widgets): Likewise.
-
-2001-06-25 Peter Williams <peterw@ximian.com>
-
- * conduits/calendar/Makefile.am (INCLUDES): Fixes for
- srcdir != builddir. Link to the static libwombat.
-
- * conduits/todo/Makefile.am (INCLUDES): Here too.
-
-2001-06-24 Federico Mena Quintero <federico@ximian.com>
-
- * gui/alarm-notify/notify-main.c (main): Initialize libglade.
-
- * pcs/cal-backend-file.c (compute_alarm_range):
- icaldurationtype_as_int() will now return a negative value if
- dur->is_neg is true, so we need to flip the sign of some
- operations here.
- (add_alarm_occurrences_cb): Likewise.
-
- * pcs/cal-backend-db.c (compute_alarm_range): Likewise.
- (add_alarm_occurrences_cb): Likewise.
-
-2001-06-24 Federico Mena Quintero <federico@ximian.com>
-
- * gui/alarm-notify/alarm-notify.c: Converted to use BonoboXObject.
-
- * gui/gnome-cal.c (gnome_calendar_open): Ask the alarm
- notification service to add the calendar and tasks URIs.
- (add_alarms): New function.
-
- * gui/alarm-notify/notify-main.c (main): Doh, fixed typo in the
- OAFIID.
- (main): Initialize and shut down gnome-vfs.
-
- * gui/Makefile.am (IDLS): Added evolution-calendar.idl, sigh.
- (evolution_calendar_SOURCES): Added the files generated from the IDL.
-
- * gui/alarm-notify/alarm-queue.c (alarm_trigger_cb): New function
- used when an alarm is triggered.
-
- * gui/dialogs/Makefile.am: Removed the alarm-notify-dialog files;
- they are now in gui/alarm-notify.
-
- * gui/alarm-notify/Makefile.am: Added the alarm-notify-dialog
- files.
-
- * pcs/cal.c (cal_forget_password): This was incorrectly named
- cal_client_forget_password(); renamed it.
-
- * gui/main.c (main): Initialize and shut down gnome-vfs.
-
-2001-06-23 Federico Mena Quintero <federico@ximian.com>
-
- * gui/e-calendar-table.c (task_compare_cb): New function to
- compare tasks like the Pilot task list.
-
- * cal-util/cal-component.h (CalComponentField): Added a
- semi-hackish CAL_COMPONENT_FIELD_COMPONENT. In the ETable model,
- it is intended to return a pointer to the component itself.
-
- * gui/calendar-model.c (calendar_model_value_at): Return the
- component itself for CAL_COMPONENT_FIELD_COMPONENT. Be more
- paranoid about invalid columns.
- (calendar_model_set_value_at): Be more paranoid about invalid
- columns.
- (calendar_model_duplicate_value): Ref the component field.
- (calendar_model_initialize_value): Deal with the component field.
- (calendar_model_value_is_empty): Likewise.
- (calendar_model_value_to_string): Likewise.
-
-2001-06-22 Jeffrey Stedfast <fejj@ximian.com>
-
- * gui/Makefile.am: Added itip-control-factory.* to the build.
-
-2001-06-22 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/cal.[ch] (cal_get_password): new function for the backends to
- be able to call the getPassword method on the associated
- WombatClient
- (cal_forget_password): ditto for the forgetPassword method
-
-2001-06-22 Rodrigo Moya <rodrigo@ximian.com>
-
- * idl/evolution-calendar.idl: changed getFreeBusy method to return
- a CalObj instead of a sequence
-
- * cal-client/cal-client.[ch] (cal_client_get_free_busy): changed it to
- work like the cal_client_get_object function, that is, it does not
- return anymore a list of UIDs, but a CalClientGetStatus code, and
- added a new parameter for the caller to get the component back when
- this function returns
- (cal_client_open): aggregate WombatClient interface to the CalListener
- being used
-
- * pcs/cal-backend-db.c, pcs/cal-backend-file.c (..get_free_busy): set
- return value to "char *" as it will be returning a FreeBusy object,
- and not a list of UIDs
-
- * pcs/cal-backend.[ch] (cal_backend_get_free_busy): ditto
-
- * pcs/cal.c (cal_construct): queryInterface on the listener to obtain
- the WombatClient interface
-
-2001-06-21 JP Rosevear <jpr@ximian.com>
-
- * gui/main.c (main): update to new call
-
- * gui/e-itip-control.[hc]: break the widget bits out on their own
- into a proper object, basic stuff seems to be working again
-
- * gui/itip-control-factory.c: put the control specific bits here
- from e-itip-control.c
-
- * gui/itip-control-factory.h: new header
-
-2001-06-21 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/Makefile.am (gladedir): add include path
-
- * gui/dialogs/comp-editor.c (setup_widgets): remove buttons and
- use evolution's standard ui config
-
- * gui/print.c (print_comp_item): print description text
-
-2001-06-21 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-client/cal-client.[ch]:
- (cal_client_init): create a WombatClient when creating a CalClient
- object, so that we can receive authentication notifications from
- the wombat
- (cal_client_destroy): destroy the WombatClient object when dying
- (cal_client_set_auth_func): new function to set the authentication
- function to be called when a password is required by the calendar
- server (through the WombatClient object)
- (cal_client_get_free_busy): new function for calling the new IDL
- method Cal::getFreeBusy
-
- * gui/alarm-notify/Makefile.am: add libwombat to LDADD
-
- * gui/Makefile.am: add libwombat to LDADD
-
-2001-06-20 Dave Camp <dave@ximian.com>
-
- * gui/itip-utils.c (itip_send_comp): Changed attach_data
- to be a GNOME_Evolution_Composer_AttachmentData rather than a
- CORBA_char*.
-
-2001-06-20 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/comp-editor.c (print_cmd): print menu command
- (print_preview_cmd): ditto for print preview
- (print_setup_cmd): ditto for print setup
- (comp_editor_set_cal_client): listen for updated and removed
- signals
- (obj_updated_cb): if the item changes else where, query the user
- for the course of action
- (obj_removed_cb): ditto for removal
-
- * gui/print.c (print_setup): rudimentary page setup support
- (print_comp): rudimentary individual event/task printing support
-
- * gui/print.h: new protos
-
- * gui/dialogs/changed-comp.[hc]: dialog to query the user about
- what to do when a item is changed elsewhere
-
- * gui/dialogs/Makefile.am: build new files
-
- * gui/dialogs/send-comp.c (send_component_dialog): remove useless
- assignment
-
-2001-06-20 Rodrigo Moya <rodrigo@ximian.com>
-
- * idl/evolution-calendar.idl: added getFreeBusy method
-
- * pcs/cal.c (impl_Cal_get_free_busy): implementation of the new
- getFreeBusy added method
-
- * pcs/cal-backend.[ch]: added new virtual method to the CalBackend
- class (get_free_busy)
-
- * pcs/cal-backend-db.c (cal_backend_db_get_free_busy): new function,
- not implemented yet
-
- * pcs/cal-backend-file.c (cal_backend_file_get_free_busy): new funtion,
- not implemented yet
-
-2001-06-20 Damon Chaplin <damon@ximian.com>
-
- * gui/calendar-config.[hc]:
- * gui/gnome-cal.[hc]:
- * gui/tasks-control.c (tasks_control_activate):
- * gui/calendar-commands.c (calendar_control_activate): moved the
- function to check for a default timezone to calendar-config.c, and
- also used it in the tasks control.
-
- * gui/dialogs/e-timezone-dialog.h: #include <gtk/gtkwidget.h> fix.
-
-2001-06-20 Damon Chaplin <damon@ximian.com>
-
- * gui/calendar-commands.c (calendar_control_activate):
- * gui/gnome-cal.[hc]: added code to show the timezone dialog if the
- user hasn't set a default timezone yet.
-
- * gui/dialogs/e-timezone-dialog.c (e_timezone_dialog_add_timezones):
- set the "None" item string before adding it to the combo, to stop the
- combo putting "None" in the entry initially.
-
-2001-06-19 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-calendar-table.[ch]: added cut/copy/paste support. It works
- with single selections (a single component selected) and with
- multiple ones (several components selected)
-
-2001-06-19 Damon Chaplin <damon@ximian.com>
-
- * gui/dialogs/event-page.c: if the timezones of the start and end of
- the event are the same, then if the start timezone is changed we
- change the end timezone as well, since that is what most users will
- want.
-
-2001-06-19 Damon Chaplin <damon@ximian.com>
-
- * pcs/cal.c:
- * idl/evolution-calendar.idl:
- * cal-client/cal-client.[hc]: removed stuff to get builtin timezone
- info from the server.
-
-2001-06-19 Damon Chaplin <damon@ximian.com>
-
- * gui/dialogs/cal-prefs-dialog.c: added a 'Time zone' setting. Also
- rearranged a little, adding a new 'General' page, since we had too
- many settings on the 'Calendar' page.
-
- * gui/e-timezone-entry.[hc]:
- * gui/dialogs/e-timezone-dialog.[hc]:
- * gui/dialogs/comp-editor.c:
- * gui/dialogs/comp-editor-page.[hc]:
- * gui/dialogs/event-page.c:
- * gui/dialogs/task-details-page.c:
- * gui/dialogs/task-page.c: removed CalClient stuff. The timezone dialog
- now uses the timezone data directly from the client's libical library.
-
-2001-06-19 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/task-editor.c (task_editor_init): add ui
- (forward_cmd): implement forward command
-
- * gui/dialogs/comp-editor.c (save_as_ok): bug fix, seems to work
- now
-
-2001-06-19 JP Rosevear <jpr@ximian.com>
-
- * gui/control-factory.c (control_factory_init): add auto exit unref
-
- * gui/component-factory.c (destroy_cb): destroy our selves if we
- have no more shells
- (component_factory_init): add auto exit unref
-
-2001-06-19 JP Rosevear <jpr@ximian.com>
-
- * gui/Makefile.am: don't compile or install the old meeting edit
- stuff
-
- * gui/e-week-view.c: ditto
-
- * gui/e-day-view.c: Remove scheduling menu option
-
-2001-06-19 JP Rosevear <jpr@ximian.com>
-
- * gui/itip-utils.c: add some needed commas
- (itip_send_comp): if publishing, don't set the to list and show
- the message. unless publishing, just send the email
-
- * gui/Makefile.am: remove typo
-
-2001-06-19 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/send-comp.c: itip/imip send dialog
-
- * gui/dialogs/send-comp.h: new proto
-
- * gui/dialogs/recurrence-page.c (recurrence_page_set_dates): only
- use the weekday picker if visible
-
- * gui/dialogs/meeting-page.c: just show the meeting list
-
- * gui/dialogs/event-editor.c (event_editor_edit_comp): remove the
- meeting page if no attendees
- (schedule_meeting_cmd): schedule a meeting menu item
- (refresh_meeting_cmd): refresh meeting request menu item
- (cancel_meeting_cmd): ditto for cancel
- (forward_cmd): send as attachment
-
- * gui/dialogs/comp-editor.c (comp_editor_remove_page): remove page
- from dialog
- (comp_editor_show_page): show a given page
- (comp_editor_get_current_comp): return a cal component
- representing the current widget state
- (comp_editor_save_comp): save the cal component
- (comp_editor_delete_comp): delete the cal component
- (comp_editor_send_comp): send the cal component
- (comp_editor_merge_ui): merge xml in to the bonobo gui
- (setup_widgets): use a bonobo window instead of a gtk window, add menus again
- (save_as_cmd): save to file on disk - still broken
- (save_close_cmd): close menu command
- (save_close_cmd): save and close menu command
-
- * gui/dialogs/comp-editor.h: new protos
-
- * gui/dialogs/cancel-comp.c (cancel_component_dialog): itip/imip
- cancellation dialog
-
- * gui/dialogs/cancel-comp.h: new proto
-
- * gui/dialogs/Makefile.am: build new files
-
- * gui/dialogs/comp-editor-page.c
- (comp_editor_page_notify_needs_send): emit needs_send signal
-
- * gui/dialogs/comp-editor-page.h: new signal protos
-
- * gui/itip-utils.c (itip_send_comp): new function to send cal
- components
-
- * gui/itip-utils.h: new proto
-
- * gui/e-itip-control.c (pstream_load): trim using cal-component
- wrapper stuff
- (accept_button_clicked_cb): use itip_send_comp
- (tentative_button_clicked_cb): ditto
- (decline_button_clicked_cb): ditto
-
- * gui/Makefile.am: compile select name idl stuff
-
- * cal-util/cal-component.c (cal_component_get_organizer): get the organizer
- (cal_component_set_organizer): set the organizer
- (cal_component_get_recurid): get the recurrence id
- (cal_component_set_recurid): set the recurrence id
- (set_attendee_list): actually set the attendee list
- (get_attendee_list): build the attendee list
-
- * cal-util/cal-component.h: new protos
-
-2001-06-19 Damon Chaplin <damon@ximian.com>
-
- * gui/dialogs/task-details-page.glade:
- * gui/dialogs/task-page.glade:
- * gui/dialogs/event-page.glade: added timezone fields. Also moved the
- 'All Day' flag into an alignment so it doesn't mess up the height of
- the other widgets.
-
- * gui/dialogs/task-details-page.c:
- * gui/dialogs/task-page.c:
- * gui/dialogs/event-page.c: added code to handle the timezone fields.
- This still needs to be hooked up when the libical code is finished.
-
- * gui/dialogs/e-timezone-dialog.c (on_map_leave): new function to
- clear the preview label and turn off the highlighted point on the
- map when you move the mouse outside it.
- (find_selected_point): new function to try to find the point
- corresponding to the text in the combo.
- (on_combo_changed): call the above function to update the selected
- point.
- (on_map_leave): turn off the preview point & label when the mouse
- leaves the map.
- (e_timezone_dialog_set_cal_client): changed it so that selecting "None"
- clears the entry.
-
- * gui/dialogs/comp-editor-page.[hc]: added set_cal_client() virtual
- method since some pages need to access the CalClient to get timezone
- information. Also added comp_editor_page_set_cal_client() to call
- the virtual method.
-
- * gui/dialogs/comp-editor.c (comp_editor_set_cal_client): called
- comp_editor_page_set_cal_client() on each page.
-
- * gui/calendar-config.c: added functions to get & set the timezone.
-
-2001-06-18 Eskil Heyn Olsen <eskil@eskil.dk>
-
- * conduits/calendar/calendar-conduit.c: (comp_from_remote_record),
- (check_for_slow_setting), (conduit_get_gpilot_conduit):
- * conduits/todo/todo-conduit.c: (check_for_slow_setting),
- (conduit_get_gpilot_conduit):
- Tweaked for some gnome-pilot api changes
-
-2001-06-15 Federico Mena Quintero <federico@ximian.com>
-
- * gui/calendar-view.[ch]: New files with the generic calendar view
- object. It sucks that we have to implement at least two classes
- to define a GalView and its factory.
-
- * gui/calendar-view-factory.[ch]: New files; factory for calendar
- views.
-
- * gui/gnome-cal.h (GnomeCalendarViewType): Moved from gnome-cal.c
- and renamed from ViewType. We no longer use strings to identify
- the view types.
-
- * gui/gnome-cal.c (gnome_calendar_get_view_type): New function.
- (set_view): Renamed from gnome_calendar_set_view_internal().
- (gnome_calendar_set_query): Made public; renamed from set_query().
- (gnome_calendar_setup_view_menus): New function to set up the view
- collection and the GalViewMenus.
- (gnome_calendar_discard_view_menus): New function to discard them.
-
- * gui/calendar-commands.c (calendar_control_activate): Set up the
- GalView menus.
- (calendar_control_deactivate): Discard the GalView menus.
-
- * gui/e-day-view.c: #include <gtk/gtkinvisible.h>
-
- * gui/dialogs/comp-editor.c (comp_editor_get_type): The type info
- structure should be static.
-
-2001-06-15 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-day-view.c (selection_received): generate a new UID
- when pasting
-
- * gui/e-week-view.c (selection_received): ditto
-
-2001-06-15 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-day-view.c (selection_received): finished implementation
- of Paste stuff
-
- * gui/e-week-view.c (selection_received): ditto
-
-2001-06-14 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-day-view.[ch]: added popup menu items for cut/copy/paste
-
- * gui/e-week-view.[ch]: ditto
-
-2001-06-14 Damon Chaplin <damon@ximian.com>
-
- * gui/e-timezone-entry.[hc]: new widget to enter a timezone.
-
- * gui/Makefile.am (evolution_calendar_SOURCES): added the above.
- * gui/Makefile.am (evolution_calendar_LDADD): had to move
- libcal-dialogs.a above libmiscwidgets.a to get it to compile.
-
-2001-06-14 Damon Chaplin <damon@ximian.com>
-
- * gui/dialogs/e-timezone-dialog.[hc]:
- * gui/dialogs/e-timezone-dialog.glade: new dialog for setting the
- time zone.
-
- * gui/dialogs/Makefile.am: added timezone dialog files.
-
- * idl/evolution-calendar.idl: added CalTimezoneInfo struct and seq,
- and getBuiltinTimezoneInfo method.
-
- * pcs/cal.c (impl_Cal_get_builtin_timezone_info): implemented method.
- (cal_class_init): added method to epv.
-
- * cal-client/cal-client.c (struct CalClientPrivate): added
- timezone_info array to contain cached info on builtin timezone city
- names and coordinates.
- (cal_client_get_builtin_timezone_info): new function to get the info
- about builtin timezones.
-
- * cal-client/cal-client.h: added CalTimezoneInfo struct, to contain
- the city names and coords of the builtin timezones.
-
-2001-06-13 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/comp-editor-util.c (comp_editor_date_label): remove
- unnecessary space
-
- * gui/dialogs/task-page.c (task_page_set_summary): indicate we are
- updating, Fixes #3307
-
-2001-06-13 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/task-details-page.c (task_details_page_set_dates):
- set the completed time in the date editor if appropriate
-
- * gui/dialogs/task-page.c (task_page_set_dates): if we are
- updating, return
- (complete_date_changed): don't returns if we are updating - the
- guards are done in the calling function
- (status_changed): indicate when we are updating and when we are
- finished, round the completion time to the nearest minute
- (percent_complete_changed): indicate when are updating and when we
- are finished
- (percent_complete_changed): notify of the date change after the
- option menu is updated
-
-2001-06-11 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/e-day-view.[ch]: added cut&paste support, by using a GtkInvisible
- widget to manage the clipboard selections.
-
- * gui/e-week-view.[ch]: ditto
-
-2001-06-08 Iain Holmes <iain@ximian.com>
-
- * gui/component-factory.c: Removed the executive-summary includes.
- (component_factory_init): Don't init the summary factory.
-
- * gui/calendar-summary.[ch]: Removed.
-
- * gui/Makefile.am: Remove executive-summary stuff, move some libs
- around a bit.
-
-2001-06-04 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/recurrence-page.c (recurrence_page_set_dates):
- update the blocked/selected days if the starting day of the
- appointment changes, fixes #2188
-
- * gui/dialogs/task-details-page.h: tidy proto
-
-2001-06-03 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/e-itip-control.c: #include <bonobo/bonobo-context.h> instead
- of <bonobo/bonobo-running-context.h>.
- * gui/tasks-control-factory.c: Likewise.
-
- * gui/Makefile.am (evolution_calendar_LDADD): Move `$(DB3_LDADD)'
- before libeutil.
-
-2001-06-01 JP Rosevear <jpr@ximian.com>
-
- * gui/Makefile.am: no longer build widget-util.*, the code has
- been moved
-
-2001-06-01 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/event-page.c (make_date_edit): use new func
-
- * gui/dialogs/task-details-page.c
- (task_details_page_create_date_edit): ditto
-
- * gui/dialogs/recurrence-page.c (make_ending_until_special): ditto
-
- * gui/dialogs/comp-editor-util.c (comp_editor_new_date_edit):
- rename date_edit_new function
-
- * gui/dialogs/comp-editor-util.h: new proto
-
- * gui/dialogs/task-page.c (task_page_set_summary): no longer any
- need to block/unblock the handler
- (task_page_create_date_edit): use new func
-
-2001-06-01 JP Rosevear <jpr@ximian.com>
-
- * gui/.cvsignore: Update
-
- * gui/evolution-calendar-control.c: Remove dead file
-
- * gui/*.vcf: Remove dead files
-
-2001-06-01 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/comp-editor-page.[hc]: renamed from editor-page for
- consistency, more complete implementation
-
- * gui/dialogs/comp-editor.[hc]: More complete implementation
-
- * gui/dialogs/*-page.*: The various pages needed to construct the
- event and task dialogs
-
- * gui/dialogs/comp-editor-util.[hc]: useful utility functions for the
- component editor pages to use
-
- * gui/dialogs/Makefile.am: Build and install new files
-
- * gui/event-editor*: Remove, obsoleted by the new comp-editor
- stuff
-
- * gui/dialogs/task-editor-dialog.glade: ditto
-
- * gui/e-calendar-table.c (open_task): update to use comp editor
- stuff
-
- * gui/e-tasks.c (e_tasks_new_task): ditto
-
- * gui/gnome-cal.c (gnome_calendar_edit_object): ditto
-
- * gui/Makefile.am: don't build non-existent files nor try to
- install them
-
-2001-06-01 JP Rosevear <jpr@ximian.com>
-
- * gui/e-itip-control.c (e_itip_control_factory_init): ditto
-
- * gui/tasks-control-factory.c (tasks_control_factory_init):
- auto_exit_unref the factory
-
-2001-06-01 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/Makefile.am (evolution_calendar_LDADD): Add `$(DB3_LDADD)'.
-
-2001-05-29 Federico Mena Quintero <federico@ximian.com>
-
- * gui/e-tasks.c (e_tasks_get_calendar_table): New function.
-
- * gui/tasks-control.c (tasks_control_activate): Connect to the
- "selection_changed" signal of the tasks widget here, not in
- tasks_control_new(). Also, update the sensitivity of the commands
- here for the first time.
- (tasks_control_deactivate): Disconnect from the signal here since
- it only makes sense to monitor selection changes while the control
- is active.
- (selection_changed_cb): Removed hack that tested the presence of
- the remote UI container.
- (sensitize_commands): New function.
-
-2001-05-28 Damon Chaplin <damon@ximian.com>
-
- * gui/e-week-view-layout.[hc]:
- * gui/e-day-view-layout.[hc]: new files to contain layout code split
- off from EDayView an EWeekView, so we can use it for printing.
-
- * gui/print.c: rewritten to use the same layout code as the EDayView
- and EWeekView widgets.
-
- * gui/gnome-cal.c (gnome_calendar_get_task_pad_cal_client): added
- function so we can get the CalClient used for the TaskPad for printing.
-
- * gui/Makefile.am (evolution_calendar_SOURCES): added
- e-day-view-layout.[hc] amd e-week-view-layout.[hc].
-
- * cal-util/timeutil.c (time_week_begin):
- (time_week_end): added week_start_day argument.
-
- * cal-util/cal-recur.c: added comments describing problems in it.
-
-2001-05-27 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/component-factory.c (remove_folder): implemented the
- 'remove_folder' function for the calendar shell component
- (xfer_folder): ditto for 'xfer_folder'
-
-2001-05-27 Dan Winship <danw@ximian.com>
-
- * gui/calendar-commands.c: #include
- "evolution-shell-component-utils.h" rather than "e-gui-utils.h"
- for e_pixmaps_update.
-
- * gui/tasks-control.c: Likewise.
-
-2001-05-25 Peter Williams <peterw@ximian.com>
-
- * gui/Makefile.am: Reference libeshell.la instead of libeshell.a.
-
-2001-05-23 Federico Mena Quintero <federico@ximian.com>
-
- * gui/dialogs/recurrence-page.c: Finished porting from the old
- event-editor.c. Made it store a clone of the component for when
- we need to expand the recurrence set.
-
- * gui/dialogs/event-page.c (event_page_get_dates): New function.
-
- * gui/dialogs/editor-page.c (editor_page_set_dates): Renamed from
- editor_page_set_dtstart(); now sets both DTSTART and DTEND.
-
- * gui/dialogs/alarm-page.c (alarm_page_set_dates): Ahem, it is a
- label, not an entry.
-
-2001-05-21 Federico Mena Quintero <federico@ximian.com>
-
- Fix bug #2831; the tasks toolbar and menu now have a button to
- delete the selected tasks.
-
- * gui/e-calendar-table.c (e_calendar_table_delete_selected): New
- function.
- (delete_cb): Use e_calendar_table_delete_selected().
- (e_calendar_table_get_table): New function.
-
- * gui/tasks-control.c (tasks_control_new_task_cmd): Handle the
- delete command.
- (selection_changed_cb): Change the sensitivity of the TasksDelete
- command when the selection in the table changes.
-
- * gui/e-tasks.c (table_selection_change_cb): Notify upstream when
- the ETable selection changes.
-
-2001-05-18 Federico Mena Quintero <federico@ximian.com>
-
- Fix bug #2829.
-
- * gui/dialogs/delete-comp.c (delete_component_dialog): Allow the
- caller to specify whether just one or many components are to be
- deleted.
-
- * gui/e-calendar-table.c (tasks_popup_one): Popup menu definition
- for when one and only one task is selected.
- (tasks_popup_many): Likewise, for more than one task.
- (e_calendar_table_on_right_click): Do not create a structure for
- the closure data; we can simply pass the cal_table. Use a
- different menu depending on the number of selected tasks.
- (mark_as_complete_cb): Renamed; now iterates over the selected
- rows.
- (delete_selected_components): New function to delete all the
- selected components.
- (delete_cb): Adjusted for delete_component_dialog().
- (open_task): New function, simply open a CalComponent in the task
- editor.
- (open_task_by_row): Renamed; use open_task().
-
- * gui/e-week-view.c (e_week_view_on_delete_appointment): Updated
- for delete_component_dialog().
-
- * gui/e-day-view.c (e_day_view_on_delete_appointment): Likewise.
-
-2001-05-16 Duncan Mak <duncan@ximian.com>
-
- * gui/Makefile.am (evolution_calendar_SOURCES): removed
- editor-page.[ch] because they've now moved dialogs.
-
-2001-05-16 Federico Mena Quintero <federico@ximian.com>
-
- Split the event and task editors into different objects for the
- separate pages; this way they can be shared by both editors.
-
- * gui/dialogs/editor-page.[ch]: New abstract class for a page in a
- calendar component editor.
-
- * gui/dialogs/event-page.[ch]: Main page of an event editor.
-
- * gui/dialogs/alarm-page.[ch]: Alarm page of a calendar component
- editor.
-
- * gui/dialogs/recurrence-page.[ch]: Recurrence page of a calendar
- component editor.
-
- * gui/dialogs/event-page.c (event_page_fill_widgets): Eeek, this
- was missing a bunch of break statements.
- (event_page_fill_component): Use a temporary variable rather than
- allocating a struct icaltimetype.
-
- * gui/dialogs/alarm-page.c (get_alarm_string): Do not use
- fixed-size buffers.
- (alarm_page_fill_widgets): Use cal_obj_uid_list_free().
- (append_reminder): Now the list stores the plain CalComponentAlarm
- structures in the row data. We do *NOT* want to be frobbing the
- component's data directly. Rather, we clone the alarms from the
- component and maintain them on our own.
- (alarm_page_fill_component): Clone the alarms before adding them
- to the component so that we maintain the invariant that the alarm
- structures in the list did *not* come from the component.
-
- * cal-util/cal-component.c (cal_component_add_alarm): Added
- documentation.
- (cal_component_remove_alarm): Added documentation.
- (cal_component_remove_alarm): Do a lookup in our hash table of
- alarms instead of scanning the whole component.
- (CalComponentAlarm): Removed the `parent' field, since it was
- unused.
- (cal_component_free_alarm_uids): Removed function, since
- cal_component_get_alarm_uids() is documented so that the user will
- know that he must use cal_obj_uid_list_free().
- (cal_component_alarm_clone): New function.
-
-2001-05-09 Federico Mena Quintero <federico@ximian.com>
-
- * gui/Makefile.am (evolution_calendar_SOURCES): Added
- editor-page.[ch] to the list of sources.
-
-2001-05-09 JP Rosevear <jpr@ximian.com>
-
- * gui/event-editor.c (reminder_add_cb): switch on the correct
- widget and map
-
-2001-05-08 JP Rosevear <jpr@ximian.com>
-
- * gui/e-itip-control.c (e_itip_control_factory): unref the
- property bag when we finish with it
-
- * gui/evolution-calendar-control.c (calendar_properties_init): ditto
-
- * gui/control-factory.c (calendar_properties_init): ditto
-
- * gui/calendar-summary.c (create_summary_view): ditto
-
-2001-05-08 JP Rosevear <jpr@ximian.com>
-
- * cal-util/cal-component.c (cal_component_alarm_free):
- (cal_component_alarm_free): free the alarm component if it doesn't
- have a parent, rather than if it does
-
- * gui/Makefile.am: sanitize LD_ADDS and CFLAGS so the libtool
- lines are shorter (fixes problem on solaries due to sed)
-
-2001-05-07 JP Rosevear <jpr@ximian.com>
-
- * pcs/cal-factory.[hc]: Convert to bonobo xobject
-
- * pcs/cal.[hc]: Convert to bonobo xobject
-
-2001-05-07 Gediminas Paulauskas <menesis@delfi.lt>
-
- * gui/event-editor.c (make_title_from_comp): conversion summary
- from utf8 here, use translated strings as is.
- (set_title_from_comp): reflect this, simplify.
-
- * gui/dialogs/task-editor.c: updated copies of above functions here.
-
- * gui/gnome-cal.c: use defines from widgets/misc/e-filter-bar.h for
- consistency in "Show all".
-
-2001-05-04 JP Rosevear <jpr@ximian.com>
-
- * gui/calendar-model.c (calendar_model_append_row): unref the
- calcomponent when we're done with it
-
- * cal-util/cal-component.c (cal_component_gen_uid): free the iso
- date string when we finish with it
-
-2001-04-27 JP Rosevear <jpr@ximian.com>
-
- * gui/e-meeting-edit.c (put_property_in_list): remove hardcoded
- values
- (edit_attendee): ditto, and there are only 4 roles now
-
- * gui/e-meeting-dialog.glade: tweak
-
- * gui/itip-utils.c: There shouldn't be an "other" role
-
-2001-04-26 JP Rosevear <jpr@ximian.com>
-
- * gui/e-meeting-edit.c (edit_attendee): use enums not hard code
- values
-
-2001-04-26 JP Rosevear <jpr@ximian.com>
-
- * gui/e-meeting-edit.c (add_button_clicked_cb):
- icalparameter_new_rsvp now takes an enum
-
-2001-04-26 JP Rosevear <jpr@ximian.com>
-
- * cal-util/cal-component.c (cal_component_alarm_set_trigger): the
- value type should be inited with ICAL_VALUE_* rather than
- ICAL_*_VALUE because it is a param argument.
-
-2001-04-26 Federico Mena Quintero <federico@ximian.com>
-
- * gui/calendar-model.c (get_is_overdue): Replace "<" by "<=" in
- the comparison for due dates against the current time. This makes
- tasks appear immediately as red when you click Now in the due date
- popup field.
-
- This is not a complete solution to the more general problem of
- tasks staying the same color even if they become overdue while the
- task list remains the same on the screen. This has been logged as
- bug #2399.
-
-2001-04-26 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/dialogs/Makefile.am (INCLUDES): Add `$(EXTRA_GNOME_CFLAGS)'.
-
-2001-04-26 Dan Winship <danw@ximian.com>
-
- * conduits/todo/Makefile.am (libetodo_conduit_la_LIBADD): Remove
- UNICODE_LIBS
-
- * cal-client/Makefile.am (client_test_LDADD): Remove -lunicode
-
-2001-04-24 Duncan Mak <duncan@ximian.com>
-
- * gui/alarm-notify/notify-main.c (funny_trigger_cb): Fixed
- Strftime so it uses the locale prefered way to display date/time.
- ("%x %X" instead of "%Y/%m/%d %H:%M:%S")
-
-2001-04-21 Gediminas Paulauskas <menesis@delfi.lt>
-
- * gui/calendar-summary.c: translate "Things to do" etc. and convert them
- to utf8. Changed some link from helixcode to ximian.
-
-2001-04-18 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/dialogs/Makefile.am (INCLUDES): Add
- `-I$(top_srcdir)/calendar/cal-client',
- `-I$(top_builddir)/calendar/cal-client'.
- * gui/Makefile.am (INCLUDES): Likewise.
-
- * cal-client/cal-query.h: #include "evolution-calendar.h".
-
-2001-04-17 Federico Mena Quintero <federico@ximian.com>
-
- * gui/event-editor.c (init_widgets): Connect to the "changed"
- signal of the categories entry so that they will be applied
- correctly.
- (EventEditorPrivate): Added fields for the contacts button and
- entry.
- (init_widgets): Disable the contacts widgets as we do not support
- them yet.
- (get_widgets): Get the contacts widgets.
-
- * gui/dialogs/task-editor.c (get_widgets): Get the contacts
- button, which was missing.
- (init_widgets): Disable the contacts widgets as we do not support
- them yet.
-
- * pcs/query.c (matches_text_list): Use e_utf8_strstrcasedecomp()
- instead of plain e_utf8_strstrcase().
- (matches_summary): Likewise.
-
-2001-04-17 JP Rosevear <jpr@ximian.com>
-
- * cal-util/cal-component.c (cal_component_alarm_set_action): the
- libical action stuff uses enums rather than strings to enumerate
- the various actions now
- (cal_component_alarm_get_action): ditto
-
-2001-04-17 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/alarm-notify/Makefile.am (evolution_alarm_notify_SOURCES):
- Add `$(CORBA_GENERATED)'.
-
-2001-04-16 Dan Winship <danw@ximian.com>
-
- * pcs/Makefile.am (INCLUDES): Add EXTRA_GNOME_CFLAGS, for gal.
-
-2001-04-15 Federico Mena Quintero <federico@ximian.com>
-
- * gui/gnome-cal.c (setup_widgets): Create the ESearchBar thingy.
- (search_bar_query_changed_cb): Build the different queries based
- on the type and string.
-
- * pcs/query.c (backend_obj_updated_cb): Ref the query while we are
- notifying the listener so that it will not disappear from under us.
- (backend_obj_removed_cb): Likewise.
- (process_component_cb): Likewise.
- (func_contains): New function to match text fields.
- (matches_comment): New function to match comment lists.
- (matches_description): New function to match description lists.
- (matches_summary): New function to match summaries.
- (matches_any): New function to match any text field.
- (func_has_categories): New function to match categories.
-
-2001-04-14 Federico Mena Quintero <federico@ximian.com>
-
- * gui/alarm-notify/notify-main.c (main): Initialize the trigger
- and queue systems.
-
-2001-04-13 Dan Winship <danw@ximian.com>
-
- * cal-util/timeutil.c (time_from_isodate): Fix the syntactic bogon
- here, and attempt to fix the logical bogon too. (tm_gmtoff and
- timezone have opposite signs... I'm assuming Federico tested the
- Linux case, so I'm flipping the sign of the BSD case. But maybe he
- didn't and it's supposed to be the other way...)
-
-2001-04-12 Federico Mena Quintero <federico@ximian.com>
-
- * gui/e-day-view.c (update_query): New function to restart a query
- for the day view.
- (query_obj_updated_cb): Renamed from obj_updated_cb(); updated for
- queries instead of calendar clients.
- (query_obj_removed_cb): Likewise.
- (cal_opened_cb): Just update_query() instead of queueing reloading
- all the events.
- (e_day_view_set_cal_client): Likewise.
- (e_day_view_set_query): Likewise.
- (e_day_view_set_selected_time_range): Likewise.
- (e_day_view_set_days_shown): Likewise.
- (e_day_view_recalc_work_week): Likewise.
- (e_day_view_queue_reload_events): Removed function now that events
- are updated entirely by the query.
- (e_day_view_reload_events_idle_cb): Likewise.
- (e_day_view_reload_events): Likewise.
- (e_day_view_init): Use a pretty arrow instead of GDK_TOP_LEFT_ARROW.
-
- * gui/e-week-view.c: Analogous changes to the ones in e-day-view.c.
- (e_week_view_init): Use a pretty arrow instead of GDK_TOP_LEFT_ARROW.
-
- * cal-util/timeutil.c (isodate_from_time_t): Return a g_strdup()ed
- version of the string instead of a pointer to a static buffer.
- (time_from_isodate): Resurrected function. Polished up to our
- current standards of paranoia.
-
- * pcs/query.c (func_time_now): New function (time-now).
- (func_make_time): New function (make-time ISODATE).
- (func_time_add_day): New function (time-add-day TIME N).
- (func_time_day_begin): New function (time-day-begin TIME).
- (func_time_day_end): New function (time-day-end TIME).
- (func_occur_in_time_range): Use time_t values instead of ints.
- (match_component): Free the stringized component. Free the ESexp
- result value.
-
- * gui/e-day-view.h: Removed a couple of unused prototypes.
-
- * pcs/query.c (query_destroy): Oops, disconnect from the backend.
-
- * pcs/cal.c (Cal_get_query): Duplicate the query reference before
- we return it.
-
- * gui/calendar-commands.c (pixmaps): Fixed paths to image files.
-
-2001-04-11 JP Rosevear <jpr@ximian.com>
-
- * pcs/cal-backend-file.c (cal_backend_file_compute_changes):
- prepend to both changes and change_ids when different and mark as
- modified, not added
-
-2001-04-11 Christopher James Lahey <clahey@ximian.com>
-
- * gui/calendar-model.c (calendar_model_append_row): Fix this to
- just send the data to the wombat instead of inserting it
- ourselves.
-
-2001-04-11 Gediminas Paulauskas <menesis@delfi.lt>
-
- Display fixes, thanks to Kjartan for finding these.
-
- * gui/event-editor.c: use simple (not e_utf8_) gtk_clist_append for
- strings which are never in utf-8.
- * dialogs/delete-comp.c (delete_component_dialog): convert only
- summary from utf-8 to gtk charset. Translated values are in correct
- craset already.
-
-2001-04-04 Kjartan Maraas <kmaraas@gnome.org>
-
- * gui/calendar-commands.c: Fix headers.
- * gui/calendar-config.c: Same here.
- * gui/calendar-model.c: Same here.
- * gui/e-day-view-time-item.c: Same here.
- * gui/e-day-view-top-item.c: Same here.
- * gui/e-day-view.c: Same here.
- * gui/e-meeting-edit.c: Same here.
- * gui/e-week-view-main-item.c: Same here.
- * gui/e-week-view.c: Same here.
- * gui/event-editor.c: Same here.
- * gui/gnome-cal.c: Same here.
- * gui/goto.c: Same here.
- * gui/main.c: Same her.
- * gui/print.c: Same here.
-
-2001-04-02 Federico Mena Quintero <federico@ximian.com>
-
- * gui/e-tasks.c (e_tasks_setup_menus): Plug leak.
-
- * gui/event-editor.c (obj_updated_cb): Do nothing for now until we
- think of something sensible to do.
- (obj_removed_cb): Likewise.
-
- * gui/dialogs/task-editor.c (obj_updated_cb): Likewise.
- (obj_removed_cb): Likewise.
-
- * gui/event-editor.c (dialog_to_comp_object): Plug leak.
-
-2001-04-01 Federico Mena Quintero <federico@ximian.com>
-
- Client-side glue for the live query engine.
-
- * cal-client/query-listener.[ch]: New files with the
- implementation fo the QueryListener interface.
-
- * cal-client/cal-query.[ch]: New files with the client-side
- convenience object for live queries.
-
- * cal-client/cal-listener.h (CalListenerClass): Removed unused
- slots for signal handlers.
-
- * cal-client/Makefile.am (libcal_clientinclude_HEADERS): Now we
- install the evolution-calendar.h header. This sucks a bit.
-
-2001-04-01 Gediminas Paulauskas <menesis@delfi.lt>
-
- * gui/calendar-commands.c: use new pixmap cache. Added some menu icons
- and changed filenames of renamed icons.
- * gui/tasks-control.c: added icons for new task and print in menu.
-
-2001-03-29 Federico Mena Quintero <federico@ximian.com>
-
- Engine for live queries to calendars. A query object watches a
- CalBackend in the PCS and is otherwise completely separate from
- it; backends need to do nothing to support live queries. Right
- now we have the following functions:
-
- (get-vtype)
-
- Returns a string indicating the type of component
- (VEVENT, VTODO, VJOURNAL, VFREEBUSY, VTIMEZONE,
- UNKNOWN).
-
- (occur-in-time-range? START END)
-
- START - int, time_t start of the time range
- END - int, time_t end of the time range
-
- Returns a boolean indicating whether the component
- has any occurrences in the specified time range.
-
- * idl/evolution-calendar.idl (Cal::getQuery): New method that
- initiates a live query.
- (Query): New interface for a handle to a live query.
- (QueryListener): New interface for a listener to changes in a live
- query.
-
- * pcs/query.[ch]: New files with the live query engine.
-
- * pcs/cal-backend.h (CalBackendClass): Added notification signals
- so that the query system can catch them.
- (CalBackendClass): New virtual method ::get_load_state().
-
- * pcs/cal-backend.c (cal_backend_opened):
- (cal_backend_obj_updated):
- (cal_backend_obj_updated): New functions to emit the notification
- signals; to be used only by backend implementations.
- (cal_backend_get_load_state): New function.
-
- * pcs/cal-backend-file.c (notify_update): Call
- cal_backend_obj_updated().
- (notify_remove): Call call_backend_obj_removed().
- (open_cal): Free the icalcomp if it is not of the correct type.
- (cal_backend_file_get_load_state): Implemented new method.
-
- * pcs/cal-backend-db.c (cal_backend_db_update_object): Call
- cal_backend_obj_updated().
- (cal_backend_db_remove_object): Call cal_backend_obj_removed().
- (cal_backend_db_get_load_state): Implemented new method.
-
- * pcs/cal.c (Cal_get_query): Implementation of the ::getQuery()
- method.
-
-2001-03-27 Anna Marie Dirks <anna@ximian.com>
-
- * gui/e-itip-control.c: fixed button placement to comply
- with gnome standards.
-
-2001-03-27 Anna Marie Dirks <anna@ximian.com>
-
- * gui/e-itip-control.glade: fixed spacing and label alignment to
- comply with gnome standards. Also removed shadows from extraneous
- scrolled windows to avoid bevelitous. There are many more changes
- that need to happen to this viewer, but they all require a hacker
- to do some c-coding, so I will avoid committing them until after the
- .10 release.
-
-2001-03-26 Kjartan Maraas <kmaraas@gnome.org>
-
- * cal-client/client-test.c: Replace includes of <gnome.h>, <bonobo.h>
- and <gtk/gtk.h> with the needed headers to speed up compile.
- * cal-util/test-recur.c: Same here for <gtk/gtk.h>
- * gui/calendar-commands.c: Replace <bonobo.h> and remove
- <libgnorba/gnorba.h>
- * gui/calendar-summary.c: Replace <gnome.h> and <bonobo.h>
- * gui/calendar-summary.h: Added <bonobo/bonobo-generic-factory.h>
- * gui/component-factory.c: Remove <bonobo.h>
- * gui/control-factory.c: Replace <bonobo.h>
- * gui/e-calendar-table.c: Remove <gnome.h>
- * gui/e-itip-control.c: Replace <gnome.h> and <bonobo.h>
- * gui/e-meeting-edit.c: Replace <bonobo.h>
- * gui/e-tasks.c: Replace <gnome.h>
- * gui/e-tasks.h: Replace <bonobo.h>
- * gui/gnome-cal.h: Remove <bonobo.h>
- * gui/main.c: Replace <bonobo.h> and <glade/glade.h>
- * gui/tasks-control-factory.c: Replace <bonobo.h>
- * gui/tasks-control.c: Replace <gnome.h> and <bonobo.h>
- * gui/weekday-picker.c: Add <string.h> and <libgnome/gnome-defs.h>
- * gui/alarm-notify/client-main.c: Remove <gnome.h> and <bonobo.h>
- * gui/alarm-notify/notify-main.c: Replace <gnome.h> and <bonobo.h>
- * gui/dialogs/alarm-notify-dialog.c: Replace <gnome.h>
- * pcs/cal-backend.c: Replace <gtk/gtk.h>
-
-2001-03-25 Federico Mena Quintero <federico@ximian.com>
-
- * gui/e-calendar-table.c (e_calendar_table_init): The
- model_rows_{inserted,deleted} signals changed names; deal with it.
- (e_calendar_table_on_rows_inserted): Updated for new ETable API.
- (e_calendar_table_on_rows_deleted): Likewise.
-
- * gui/gnome-cal.h (GnomeCalendarOpenMode): Removed unused enum.
-
- * gui/gnome-cal.c (gnome_calendar_open): Constify.
-
- * gui/calendar-commands.c (calendar_set_uri): Removed function,
- since it was just calling gnome_calendar_open().
-
- * gui/control-factory.c (set_prop): Replace usage of
- calendar_set_uri() with gnome_calendar_open().
- (load_calendar): Likewise.
- (calendar_persist_init): Made static.
-
- * gui/e-tasks.c: #include "calendar-config.h"
- (e_tasks_update_all_config_settings): We are configuring a table,
- not a calendar! Use the appropriate function.
-
-2001-03-17 Miguel de Icaza <miguel@ximian.com>
-
- * gui/e-day-view.c (e_day_view_on_new_event,
- e_day_view_on_new_appointment): Simplifed this function to use the
- shared code.
-
- * gui/e-week-view.c (e_week_view_on_new_event,
- e_week_view_on_new_appointment): ditto.
-
- * gui/gnome-cal.c (gnome_calendar_new_appointment_for): New
- function used to launch editor components with a time range. A
- bunch of functions use this code now instead of duplicating code
- all over the place
-
- * gui/e-week-view.c (e_week_view_new_event): Moved functionality
- here from e_day_view_on_new_appointment. Allows setting for "full
- day" event.
- (e_week_view_on_new_full_day): New function for making a full day
- event.
- (e_week_view_on_goto_date): Go To support.
- (e_week_view_on_goto_today): Goto today support.
-
- * gui/e-day-view.c (e_day_view_new_event): Moved functionality
- here from e_day_view_on_new_appointment. Allows setting for "full
- day" event.
- (e_day_view_on_new_full_day): New function for making a full day
- event.
- (e_day_view_on_goto_date): Go To support.
- (e_day_view_on_goto_today): Goto today support.
-
- * main_items: Add New All Day Event; Go to Today; Go to Date.
-
-2001-03-07 Miguel de Icaza <miguel@ximian.com>
-
- * gui/control-factory.c (calendar_persist_init): New function:
- inits the BonoboPersistFile server.
-
- * gui/GNOME_Evolution_Calendar.oaf.in: Added BonoboPropertyBag to
- the list of supported interfaces that were supported but not
- reported. Add the new PersistFile.
-
- Add text/calendar mime type attribute.
-
-2001-03-15 Dan Winship <danw@ximian.com>
-
- * gui/e-week-view.c (e_week_view_start_editing_event):
- * gui/e-day-view.c (e_day_view_start_editing_event): Update
- arguments to e_canvas_item_grab_focus.
-
-2001-03-15 Gediminas Paulauskas <menesis@delfi.lt>
-
- * gui/*.xpm: moved to ../art.
- * gui/Makefile.am: removed *.xpm and oaf_DATA from EXTRA_DIST.
- * gui/e-calendar-table.c, gui/e-day-view.c, gui/e-week-view.c:
- #include "art/*.xpm".
-
-2001-03-09 JP Rosevear <jpr@ximian.com>
-
- * conduits/todo/Makefile.am: PISOCK_INCLUDEDIR has become
- PISOCK_CFLAGS in gnome-pilot.m4 and remove capplet foo
-
- * conduits/calendar/Makefile.am: ditto
-
-2001-03-08 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component-factory.c (factory_fn): Specify a NULL
- `EvolutionShellComponentGetDndSelectionFn'.
-
-2001-02-27 Miguel de Icaza <miguel@ximian.com>
-
- * gui/e-day-view.c (e_day_view_on_event_right_click): Reorganize
- the menus to have entries always in a consistent fashion, as
- reported to the genepool mailing list.
- (e_day_view_on_event_right_click): Added a FIXME comment to the
- FIXME comment without a FIXME.
-
- Now we use e_popup_menu. This allows us to hide/show items on
- demand, and to sensitize/de-sensitize items depending on their
- state.
-
- This will also let us add icon support (when we get nice icons for
- this)
-
- * gui/e-week-view.c (e_week_view_show_popup_menu): Ditto.
-
- The files popup-menu.c and popup-menu.h can now be removed.
-
-2001-03-05 Damon Chaplin <damon@ximian.com>
-
- * gui/e-tasks.c: keep list of all Tasks folders so we can update the
- preference settings when necessary.
-
- * gui/gnome-cal.c: configure the TaskPad according to the settings.
-
- * gui/e-calendar-table.c: use ECellCombo and ECellDateEdit for fields,
- so the tasks folders is almost usable now.
-
- * gui/calendar-model.c: added support for the Status property.
-
- * gui/calendar-config.[hc]: added convenience functions to setup
- ECalendarTable and ECellDateEdit objects.
-
- * gui/calendar-commands.c: connected to "destroy" signal of calendars
- so we can remove them from all_calendars list.
-
- * gui/dialogs/cal-prefs-dialog.c (cal_prefs_dialog_update_config):
- call e_tasks_update_all_config_settings() to update all the settings
- in the Tasks folders as well.
-
- * cal-util/cal-component.h: added CAL_COMPONENT_FIELD_STATUS.
-
- * cal-util/cal-component.c (cal_component_get_transparency): fixed
- calls to strcasecmp so they check for '== 0'.
-
- Applied patch from Miguel...
-
-2001-02-27 Miguel de Icaza <miguel@ximian.com>
-
- * gui/e-day-view.c (e_day_view_on_event_right_click): Reorganize
- the menus to have entries always in a consistent fashion, as
- reported to the genepool mailing list.
- (e_day_view_on_event_right_click): Added a FIXME comment to the
- FIXME comment without a FIXME.
-
- Now we use e_popup_menu. This allows us to hide/show items on
- demand, and to sensitize/de-sensitize items depending on their
- state.
-
- This will also let us add icon support (when we get nice icons for
- this)
-
- * gui/e-week-view.c (e_week_view_show_popup_menu): Ditto.
-
- The files popup-menu.c and popup-menu.h can now be removed.
-
-2001-03-02 JP Rosevear <jpr@ximian.com>
-
- * conduits/todo/e-todo.conduit.in: update for new pilot foo
-
- * conduits/calendar/e-calendar.conduit.in: ditto
-
- * conduits/todo/Makefile.am: update sed script
-
- * conduits/calendar/Makefile.am: ditto
-
-2001-02-28 Federico Mena Quintero <federico@ximian.com>
-
- * gui/event-editor.c (recurrence_exception_select_row_cb): New
- function to set the EDateEdit's value when a row is selected in
- the exception date list. Fixes bug #1638.
- (append_exception): Set the value as well. Block/unblock signals
- from the clist as appropriate. Gotta love non-model/view widgets.
- (recurrence_exception_delete_cb): Be more paranoid about the
- contents of the list row's data.
- (recur_to_comp_object): Likewise.
- (fill_exception_widgets): Select the first row after we are done
- appending the exception dates.
-
-2001-02-26 Federico Mena Quintero <federico@ximian.com>
-
- * gui/alarm-notify/Makefile.am (libalarm_a_SOURCES): Create a
- little stand-alone library for the low-level alarm trigger
- mechanism. This is so that the GUI parts of the calendar can use
- it in addition to the alarm daemon.
-
- * gui/main.c: #include "alarm-notify/alarm.h".
-
- * gui/calendar-summary.c: Likewise.
- (alarm_fn): Do not remove the previous alarm; it is removed
- automatically when it is triggered.
-
- * gui/Makefile.am (evolution_calendar_SOURCES): Removed alarm.[ch]
- from the sources.
-
- * gui/alarm.[ch]: Removed obsolete files.
-
-2001-02-23 Federico Mena Quintero <federico@ximian.com>
-
- * gui/alarm-notify/alarm-notify.c (AlarmNotify_addCalendar):
- Switched to using our own refcounted structure for loaded clients.
- (AlarmNotify_removeCalendar): Ditto. Also, do the full
- destruction of the client.
- (alarm_notify_destroy): Destroy each element in the hash table.
-
- * cal-client/cal-client.c (cal_client_construct): Test for
- exceptions from OAF when activating the Wombat calendar factory.
-
- * gui/alarm-notify/GNOME_Evolution_Calendar_AlarmNotify.oaf.in:
- New .oaf.in file.
-
- * gui/alarm-notify/Makefile.am (oaf_in_files): Updated.
-
- * gui/GNOME_Evolution_Calendar.oaf.in: Put all the servers here
- instead of in a million files.
-
- * gui/GNOME_Evolution_Calendar_Control.oaf.in: Removed file.
-
- * gui/GNOME_Evolution_Calendar_gnomecal.oaf.in: Removed *REALLY*
- obsolete file.
-
- * gui/Makefile.am (oaf_in_files): Updated.
-
-2001-02-23 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/cal-backend-db.c (add_history): fixed generation of history records
-
-2001-02-16 Federico Mena Quintero <federico@ximian.com>
-
- * pcs/cal-factory.c (CalFactoryPrivate): Added a `registered'
- field.
- (cal_factory_oaf_register): New function; now the factory performs
- its own registration with OAF.
- (cal_factory_destroy): Unregister from OAF if appropriate.
-
-2001-02-19 JP Rosevear <jpr@ximian.com>
-
- * conduits/todo/Makefile.am: Remove PISOCK_LIBDIR
-
- * conduits/calendar/Makefile.am: ditto
-
-2001-02-16 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/calbackend-db.c (cal_backend_db_destroy): close DB environment.
- Some compilation warnings removed
-
-2001-02-13 Christopher James Lahey <clahey@ximian.com>
-
- * gui/Makefile.am (evolution_calendar_LDADD): Added libmenus.la.
-
- * gui/e-calendar-table.c, gui/e-calendar-table.h
- (e_calendar_table_get_spec): Added this function.
-
- * gui/e-tasks.c, gui/e-tasks.h (e_tasks_setup_menus): Added this
- function.
-
- * gui/tasks-control.c (tasks_control_activate): Call
- e_tasks_setup_menus.
-
-2001-02-13 JP Rosevear <jpr@ximian.com>
-
- * gui/e-tasks.c (e_tasks_new_task): call task_editor_focus
-
-2001-02-13 JP Rosevear <jpr@ximian.com>
-
- * gui/calendar-commands.c (update_pixmaps): Set toolbar new
- appointment icon
- (set_pixmap): load files rather than create from xpm file
-
- * gui/*view.xpm: move to the art directory
-
-2001-02-13 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/cal-backend-db.c (cal_backend_db_get_alarms_for_object):
- implemented
-
-2001-02-13 JP Rosevear <jpr@ximian.com>
-
- * gui/calendar-commands.c (update_pixmaps): Set toolbar new command
-
- * gui/e-calendar-table.c: Add titles to pixbuf column for grouping
-
- * gui/calendar-model.c (calendar_model_class_init): override value
- to string virtual method
- (calendar_model_value_to_string): implement value to string for
- etable (necessary for group by)
-
-2001-02-12 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/cal-backend-file.c:
- cal_backend_db_update_object(): manage both updates and additions/add notification
- cal_backend_db_get_object(): don't use DB cursors
- cal_backend_db_get_type_by_uid(): don't use DB cursors
- cal_backend_db_remove_object(): don't use DB cursors/add notification
- cal_backend_db_get_alarms_in_range(): implemented
-
-2001-02-12 Kjartan Maraas <kmaraas@gnome.org>
-
- * gui/Makefile.am: Hook up the xml-i18n-tools + .oaf.in stuff.
- * gui/GNOME_Evolution_Calendar*.oaf.in: Marked strings for translation.
-
-2001-02-11 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/cal-backend-db.c: added DB3 transactions support
- * pcs/cal-backend-db.[ch]: added the new DB3-based backend. This is just
- the beginning, there are some missing things still.
-
-2001-02-11 Gediminas Paulauskas <menesis@delfi.lt>
-
- Really use xml-i18n-tools.
-
- * conduits/calendar/e-calendar-conduit-control-applet.desktop,
- conduits/todo/e-todo-conduit-control-applet.desktop: removed.
-
- * conduits/calendar/e-calendar-conduit-control-applet.desktop.in,
- conduits/todo/e-todo-conduit-control-applet.desktop.in: added empty.
-
- * conduits/calendar/Makefile.am, conduits/todo/Makefile.am:
- reflect above changes, merge translations.
-
- * gui/*.glade.h, gui/dialogs/*.glade.h: removed, xml-i18n-extract
- takes care of strings itself.
-
- * gui/*.glade, gui/dialogs/*.glade: do not output_translatable_strings
-
- * gui/Makefile.am, gui/dialogs/Makefile.am: do not include removed
- files in EXTRA_DIST.
-
-2001-02-08 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/task-editor-dialog.glade: Oops, remove old widget
-
-2001-02-08 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/task-editor.c (fill_widgets): fill in new
- classification stuff properly
- (get_widgets): load new class. widgets
- (init_widgets): if the class. widgets change, mark the dialog
- dirty
- (dialog_to_comp_object): set the comp class. from the new widgets
-
- * gui/dialogs/task-editor-dialog.glade: Make more consistent,
- fixing bugs 1247 and 1249
-
- * gui/dialogs/task-editor.c (fill_widgets):
-
- * gui/event-editor-dialog.glade: Gui tidying
-
- * gui/event-editor.c: Remove old alarm cruft
-
- * cal-util/cal-component.c (cal_component_set_url): Don't try and
- write an empty string as a property
-
-
-2001-02-08 JP Rosevear <jpr@ximian.com>
-
- * pcs/cal-backend-file.c: Move the get_change code here
-
- * pcs/cal-backend.c: Remove get_changes related stuff and
- implement by calling the virtual method instead
-
- * pcs/cal-backend.h: New virtual method.
-
- * pcs/cal-backend-file.c (compute_alarm_range): Use
- icaldurationtype_as_int (replace _as_timet)
- (add_alarm_occurrences_cb): ditto
-
-2001-02-08 JP Rosevear <jpr@ximian.com>
-
- * pcs/cal-backend-file.c (compute_alarm_range): Use
- icaldurationtype_as_int (replace _as_timet)
- (add_alarm_occurrences_cb): ditto
-
- * gui/e-week-view.c (e_week_view_on_schedule_meet): new routine to
- throw up the meeting schedule dialog
- (e_week_view_show_popup_menu): add schedule meeting to the
- contextual menu where appropriate
-
-2001-02-08 JP Rosevear <jpr@ximian.com>
-
- * gui/event-editor.c: Remove assorted menu/bonobo stuff
-
- * gui/dialogs/task-editor.c: Remove assorted menu/bonobo stuff
- (task_editor_construct): no longer suck out the glade contents
- into a bonobo win, listen for apply and close signals
- (tedit_apply_event_cb): listen for apply signal and save object
- (tedit_close_event_cb): listen for close signal and prompt to save
- if need be
- (task_editor_focus): new function to bring the dialog to the front
-
- * gui/dialogs/task-editor.h: new prototype
-
- * gui/e-meeting-edit.c (schedule_button_clicked_cb): no need to
- update widgets in the event editor since the event editor won't be
- open
- (e_meeting_editor_new): don't need the event editor reference any
- more
-
- * gui/e-meeting-edit.h: Change prototype
-
- * gui/e-day-view.c (e_day_view_on_event_right_click): Make
- schedule meeting a new contextual menu item
- (e_day_view_on_schedule_meet): new routine to schedule a meeting
- from the contextual menu
-
- * gui/e-calendar-table.c (e_calendar_table_open_task): Call
- task_editor_focus
-
- * gui/event-editor-dialog.glade: Update to be a property box
-
- * gui/dialogs/task-editor-dialog.glade: Update to be a property
- box
-
-2001-02-07 Iain Holmes <iain@ximian.com>
-
- * gui/calendar-summary.c (create_summary_view): Add a setter to the
- property bag.
- (set_property): The setter.
- (generate_html_summary): Sort the UIDs accodring to time.
-
-2001-02-06 JP Rosevear <jpr@ximian.com>
-
- * gui/event-editor.c (fill_reminder_widgets): Match new
- append_alarm signature
- (reminder_to_comp_object): only add alarms tagged as new, no
- longer delete all alarms first
- (append_reminder): the row data is now of type ReminderData,
- rename from append_alarm
- (reminder_add_cb): math new append_alarm signature
- (reminder_delete_cb): if the alarm existed before the dialog was
- loaded, delete it immediately from the cal component
-
-2001-02-06 JP Rosevear <jpr@ximian.com>
-
- * gui/event-editor-dialog.glade: Gui tweaks for bugs 1248 and 1246
-
- * gui/dialogs/task-editor-dialog.glade: ditto
-
-2001-02-07 JP Rosevear <jpr@ximian.com>
-
- * gui/event-editor-dialog.glade: Fix spacing
-
-2001-02-06 JP Rosevear <jpr@ximian.com>
-
- * gui/event-editor-dialog.glade: Gui tweaks for bugs 1248 and 1246
-
- * gui/dialogs/task-editor-dialog.glade: ditto
-
-2001-02-06 JP Rosevear <jpr@ximian.com>
-
- * gui/e-week-view.c (e_week_view_show_popup_menu): Make the menus more
- consistent
-
- * gui/e-day-view.c (e_day_view_on_event_right_click): ditto
-
- * gui/e-calendar-table.c: ditto
-
-2001-02-06 JP Rosevear <jpr@ximian.com>
-
- * cal-util/cal-component.c (cal_component_set_categories): If the
- categories string is empty, remove the property
- (get_period_list): Fixes from clahey to handle the new rdate
- format in libical
- (set_period_list): ditto
-
-2001-02-05 JP Rosevear <jpr@ximian.com>
-
- * cal-util/cal-component.c (cal_component_alarm_set_trigger): Set
- the time and duration values in the trigger to null by default
- (cal_component_free_alarm_uids): properly free the list of alarm
- uids
-
-2001-02-05 JP Rosevear <jpr@ximian.com>
-
- * gui/event-editor.c (get_widgets): get the new reminder widgets
- (sync_entries): different callback data
- (summary_changed_cb): take different data and handle various cases
- (init_widgets): connect signals for the new widgets
- (get_alarm_duration_string): give a text string of the alarm
- duration
- (get_alarm_string): give a string representing the alarm
- (fill_widgets): make sure we don't loop infinitely and remove old
- alarm cruft
- (reminder_to_comp_object): dump alarm info in the gui into the cal
- component
- (append_alarm): add alarm to the clist
- (reminder_add_cb): create new alarm
- (reminder_delete_cb): remove the alarm from the list
-
- * gui/event-editor-dialog.glade: Update gui
-
- * gui/e-calendar-table.c: include gnome.h for all the menu stuff
-
- * gui/calendar-summary.c: for internationalization
-
- * gui/tasks-control.c: include gnome.h
-
- * gui/e-tasks.c: ditto
-
- * gui/e-itip-control.c: ditto
-
- * cal-util/cal-recur.c (cal_recur_set_rule_end_date): Update for
- libical changes
-
-2001-02-05 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/calendar-model.c: Fixed up these #includes.
-
-2001-02-03 Federico Mena Quintero <federico@ximian.com>
-
- * gui/dialogs/save-comp.c (save_component_dialog):
- gnome_dialog_grab_focus() on the Yes button. Fixes bug #1242.
-
-2001-01-30 Kjartan Maraas <kmaraas@gnome.org>
-
- * gui/e-calendar-table.c: Mark a string for translation.
- * gui/e-itip-control.c: Mark a bunch of strings for translation.
-
-2001-01-30 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/print.c: #include <sys/time.h>.
-
-2001-01-29 Federico Mena Quintero <federico@ximian.com>
-
- * gui/calendar-config.c: <gnome.h> trimming to reduce compilation
- time.
- * gui/calendar-summary.c: Likewise.
- * gui/e-calendar-table.c: Likewise.
- * gui/e-day-view-time-item.c: Likewise.
- * gui/e-day-view.c: Likewise.
- * gui/e-itip-control.c: Likewise.
- * gui/e-meeting-edit.c: Likewise.
- * gui/e-meeting-edit.h: Likewise.
- * gui/e-tasks.c: Likewise.
- * gui/e-week-view.c: Likewise.
- * gui/event-editor.c: Likewise.
- * gui/gnome-cal.c: Likewise.
- * gui/goto.c: Likewise.
- * gui/itip-utils.h: Likewise.
- * gui/main.c: Likewise.
- * gui/popup-menu.c: Likewise.
- * gui/print.c: Likewise.
- * gui/tasks-control-factory.c: Likewise.
- * gui/tasks-control.c: Likewise.
- * gui/tasks-migrate.c: Likewise.
-
-2001-01-25 Federico Mena Quintero <federico@ximian.com>
-
- * cal-util/timeutil.c: <gnome.h> trimming to reduce compilation time.
- * gui/dialogs/task-editor.c: Ditto.
- * gui/dialogs/cal-prefs-dialog.c: Ditto.
- * gui/dialogs/save-comp.c: Ditto.
- * gui/dialogs/delete-comp.c: Ditto.
- * gui/calendar-commands.c: Ditto.
- * gui/calendar-model.c: Ditto.
-
-2001-01-26 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/e-itip-control.c (itip_control_destroy_cb): Don't attempt to
- call `icalcomponent_remove_component()' on a NULL component or a
- NULL subcomponent.
-
-2001-01-25 Damon Chaplin <damon@ximian.com>
-
- * gui/tag-calendar.c: don't tag the calendar if no dates are shown.
- (e_calendar_item_get_date_range() now returns FALSE in this case.)
-
-2001-01-23 Damon Chaplin <damon@helixcode.com>
-
- * gui/calendar-model.c (ensure_task_complete): make sure the status
- is set to "Completed". Fixes bug #1253.
-
- * gui/e-tasks.c (e_tasks_open): load the ETable state after opening
- the tasks folder, since it relies on the folder uri, which isn't set
- now until you open the folder.
-
- * gui/calendar-model.c (obj_updated_cb): add the categories from the
- updated object to our tree, and emit the "categories-changed" signal
- if they have changed. Fixes bug #1255.
-
- * gui/e-tasks.c: removed debug messages.
-
-2001-01-23 JP Rosevear <jpr@ximian.com>
-
- * libical import cleanup
-
-2001-01-23 JP Rosevear <jpr@ximian.com>
-
- * conduits/todo/todo-conduit.c (local_record_from_comp): properly ref
- the cal component when we use it, prevents double free
-
- * conduits/calendar/calendar-conduit.c (local_record_from_comp): ditto
-
-2001-01-22 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/Makefile.am: compile new stuff
-
- * gui/dialogs/task-editor.c (prompt_to_save_changes): use new
- standard dialog
-
- * gui/event-editor.c (prompt_to_save_changes): ditto
-
- * gui/dialogs/save-comp.h: new header
-
- * gui/dialogs/save-comp.c (save_component_dialog): shows the save
- dialog
-
-2001-01-22 JP Rosevear <jpr@ximian.com>
-
- * conduits/todo/todo-conduit.c (for_each_modified): remove duplicate
- message
-
- * conduits/calendar/Makefile.am: Remove vfs lib dependency
-
- * conduits/todo/Makefile.am: ditto
-
- * conduits/calendar/calendar-conduit.c: Remove alarm foo for now
- (for_each_modified): remove duplicate message
-
-2001-01-21 JP Rosevear <jpr@ximian.com>
-
- * conduits/calendar/calendar-conduit.c (delete_record): Remove
- deleted records from the pilot map so we don't have dupes in the future
-
- * conduits/todo/todo-conduit.c (delete_record): ditto
-
-2001-01-21 Federico Mena Quintero <federico@ximian.com>
-
- * gui/dialogs/task-editor.c (file_delete_cb): Fix bug #1250; now
- we present a confirmation dialog before deleting the component.
-
-2001-01-20 Federico Mena Quintero <federico@ximian.com>
-
- * gui/event-editor-dialog.glade: Fix bug #1243. Turn on the Y
- expand/fill options for the date widgets in the General page.
- This makes them be vertically aligned with the "All day event"
- toggle so that they will get the focus in the proper order; the
- toggle would get the focus before them because it was a pixel or
- two above them.
-
-2001-01-19 Federico Mena Quintero <federico@ximian.com>
-
- * gui/weekday-picker.c (weekday_picker_init): Unset the
- GTK_CAN_FOCUS flag on the weekday picker. This will do until it
- supports being used with the keyboard.
-
-2001-01-19 JP Rosevear <jpr@ximian.com>
-
- * cal-util/cal-component.c (cal_component_alarm_new): create a new
- cal component alarm
- (cal_component_add_alarm): add alarm to the cal component
- (cal_component_remove_alarm): remove alarm from the cal component
- (remove_alarm): remove alarm from hash
-
- * cal-util/cal-component.h: new protos
-
- * conduits/calendar/calendar-conduit.c (comp_from_remote_record):
- add alarm information, still needs to be hacked to replace an already
- existing alarm. questions abound about the heuristic for doing this.
-
-2001-01-17 JP Rosevear <jpr@ximian.com>
-
- * gui/event-editor.c (dialog_to_comp_object): Properly set categories
- to NULL if there are none
-
-2001-01-18 Federico Mena Quintero <federico@ximian.com>
-
- * gui/tasks-migrate.[ch]: New files with a simple sequence to
- migrate the task components from the old calendar folder into the
- new tasks folder.
-
- * gui/component-factory.c (owner_set_cb): Call tasks_migrate()
- once evolution_dir is set. It sucks to have to do this here.
-
- * cal-client/cal-client.c (cal_client_get_uids): In the inline
- docs, indicate how to free the return value.
- (cal_opened_cb): Ahem, moved assertion to the right place. Also,
- ref() and unref() around our own signal emission because we are
- not inside a signal handler, rather a simple callback from the
- listener object; we want to have a chance to clean up even if the
- client is unrefed during the emission.
-
- * gui/Makefile.am (evolution_calendar_SOURCES): Added
- tasks-migrate.[ch] to the list of sources.
-
-2001-01-17 Federico Mena Quintero <federico@ximian.com>
-
- * gui/event-editor.c (init_widgets): Use
- e_calendar_item_set_max_days_sel() instead of setting GTK+ object
- arguments.
-
- * gui/e-day-view.c (e_day_view_set_cal_client): Oops, we had a
- reversed test for the client being loaded.
-
- * gui/tag-calendar.c (tag_calendar_by_client): Fixed similarly
- reversed test.
-
-2001-01-17 Damon Chaplin <damon@helixcode.com>
-
- * gui/e-week-view*.c
- * gui/e-day-view*.c: don't use the theme colors at all within
- the graphical parts of the widgets, since they may clash with
- our colors. May make them configurable in future so people can tweak
- them to go with their theme. At least the calendars are usable in any
- theme now, even though the colors may not go well with the theme.
- Also set the font of all the EText items in style_set.
-
- * gui/e-week-view-event-item.c (e_week_view_event_item_draw): don't
- draw the icons if we are editing the event.
-
- * gui/e-day-view.c:
- * gui/e-week-view.c: reinstated the optimizations so we don't do a
- complete relayout if the event's dates haven't been changed.
- (Though we still do a re-layout when recurring events change, since
- comparing all the RDATES/RRULES/EXDATES/EXRULES is too much hassle.)
- A side-effect of this change is that the EWeekView won't crash so
- often - only recurring events will be a problem.
-
- * cal-util/cal-component.[hc]: added function to check if the start
- and end dates of a component match. Used for optimizing the updating
- of the EDayView & EWeekView.
-
-2001-01-17 JP Rosevear <jpr@ximian.com>
-
- * conduits/calendar/calendar-conduit.c (start_calendar_server): Check
- for open error and handled
-
- * conduits/todo/todo-conduit.c (start_calendar_server): ditto
-
-2001-01-17 JP Rosevear <jpr@ximian.com>
-
- * conduits/calendar/calendar-conduit.c (start_calendar_server): Check
- for open error and handled
-
- * pcs/cal-backend.c (cal_backend_compute_changes): Fix transposition
- of sync db location
-
-2001-01-17 Federico Mena Quintero <federico@ximian.com>
-
- * */*: Ximianified email addresses and copyrights.
-
- * idl/evolution-calendar.idl (CalFactory::open): Renamed from
- ::load(), and added an only_if_exists argument.
- (CalFactory::create): Removed method.
- (Listener::OpenStatus): Removed the IN_USE error and replaced it
- with a NOT_FOUND one; renamed the enum from LoadStatus.
- (Listener::notifyCalOpened): Renamed from notifyCalLoaded().
-
- * pcs/cal-backend.h (CalBackend): Removed the uri field.
- (CalBackendOpenStatus): Renamed from CalBackendLoadStatus and
- added a NOT_FOUND value.
- (CalBackendClass::open): Put in a slot for the open method.
-
- * pcs/cal-backend.c (cal_backend_create): Removed function.
-
- * pcs/cal-backend-file.c (cal_backend_file_open): Return the
- appropriate value when only_if_exists is TRUE.
- (create_cal): We are Ximian now, so set the PRODID property to
- the appropriate foo.
-
- * pcs/cal-factory.c (CalFactory_open): implemented, replacing
- CalFactory_load() and CalFactory_create().
- (CalFactory_open): Moved the queue_load_create_job() stuff to
- here, since we now only need to contemplate the open case instead
- of load/create ones.
- (open_backend): Do everything here; replaces load_backend() and
- create_backend().
-
- * cal-client/cal-listener.h (CalListenerClass::cal_opened):
- Renamed from cal_loaded.
- (CalListenerClass): Replaced the silly signals, which are
- gratuitous abstraction, by a set of function pointers in the
- instance structure.
-
- * cal-client/cal-listener.c (cal_listener_get_calendar): Removed
- unused function.
- (cal_listener_construct): Added the listener notification functions.
- (cal_listener_new): Ditto.
- (Listener_notifyCalOpened): Renamed to our new naming convention
- for servant implementations.
- (Listener_notifyObjUpdated): Ditto.
- (Listener_notifyObjRemoved): Ditto.
-
- * cal-client/cal-client.h (CalClientOpenStatus): Renamed from
- CalClientLoadStatus.
- (CalClientClass::cal_opened): Renamed from ::cal_loaded().
- (CalClientLoadState): New enum; basically make LoadState public so
- that users of this code do not have to maintain their own states.
-
- * cal-client/cal-client.c (cal_client_create_calendar): Removed
- function.
- (cal_client_open_calendar): Moved the functionality over from
- load_or_create(); now we do everything here.
- (*): Use the CalClientLoadState enum values instead of the old
- LoadState values.
- (cal_client_get_load_state): Renamed from cal_client_is_loaded(),
- and return the appropriate value.
- (CalClientPrivate): Added an uri field.
- (cal_client_init): Initialize priv->uri.
- (cal_client_destroy): Free the priv->uri.
- (cal_opened_cb): Maintain the priv->uri.
- (cal_client_open_calendar): Fill in the priv->uri.
- (cal_client_get_uri): New function.
-
- * gui/calendar-model.c (calendar_model_set_new_comp_vtype): New
- function to configure the type of calendar components to create
- when doing click-to-add. This makes the model usable for
- something other than task lists.
- (calendar_model_get_new_comp_vtype): New function.
-
- * gui/e-calendar-table.c (e_calendar_table_get_model): New function.
- (e_calendar_table_destroy): Unref the subset_model.
-
- * gui/gnome-cal.h (GnomeCalendarOpenMode): Removed enum.
-
- * gui/gnome-cal.c (LoadState): Removed enum; we now use the
- CalClientLoadState from the client objects.
- (GnomeCalendarPrivate): Removed the loading_uri and
- task_pad_loading_uri fields as well as the load_state and
- task_pad_load_state fields, as we can now query them directly from
- the CalClient.
- (open_error): Renamed from load_error().
- (create_error): Removed function.
- (gnome_calendar_open): Do not take in the mode parameter.
- (cal_opened_cb): Get rid of our beautifully-crafted state machine
- and replace it with simple code; all the loading smarts are in the
- Wombat now.
- (setup_widgets): Set the new component vtype of the table model to
- CAL_COMPONENT_TODO.
-
- * gui/Makefile.am (evolution_calendar_SOURCES): Removed
- gnome-month-item.[ch] from the list of sources.
-
- * gui/calendar-summary.c (CalSummary): Removed unused cal_loaded
- field.
- (create_summary_view): Do not check if the file exists; this is
- the job of the Wombat.
- (generate_html_summary): Fixed prototype.
- (alarm_fn): Fixed prototype.
- (property_dialog): Fixed prototype. Wonder if/how this ever
- worked.
- (create_summary_view): Cast the component and view as
- appropriate. Removed unused html variable.
-
- [Iain dude, are you compiling with -Wall?]
-
- * gui/e-itip-control.c (cal_opened_cb): Sigh, this function
- signature was *very* wrong. It was using CalClientGetStatus
- instead of CalClientOpenStatus.
-
- * gui/e-tasks.h (ETasksOpenMode): Removed enum.
-
- * gui/e-tasks.c (setup_widgets): Set the new component vtype of
- the table model to CAL_COMPONENT_TODO.
- (LoadState): Removed the state machine foo.
- (e_tasks_open): Removed the mode parameter.
- (initial_load): Removed function.
- (create_error): Removed function.
- (ETasksPrivate): Removed folder_uri field.
- (cal_opened_cb): Remove the state machine.
-
- * gui/component-factory.c: #include "tasks-control.h"
-
- * conduits/calendar/calendar-conduit.h (ECalConduitContext):
- Removed calendar_load_tried field.
-
- * conduits/calendar/calendar-conduit.c (start_calendar_server_cb):
- Sigh, fixed function prototype.
-
- * conduits/todo/todo-conduit.h (EToDoConduitContext): Removed
- calendar_load_tried field.
-
- * conduits/todo/todo-conduit.c (start_calendar_server_cb): Fixed
- function prototype.
-
-2001-01-16 JP Rosevear <jpr@ximian.com>
-
- * conduits/todo/todo-conduit.c (print_local): fix debug output
- (print_remote): ditto
-
-2001-01-15 JP Rosevear <jpr@ximian.com>
-
- * pcs/cal-backend.c (cal_backend_compute_changes): accomadate tasks
- in their new dir
-
- * conduits/todo/todo-conduit.c (start_calendar_server): ditto
-
-2001-01-15 JP Rosevear <jpr@ximian.com>
-
- * conduits/todo/todo-conduit.c (print_local): prevent segfaults and
- buffer overflows.
- (print_remote): ditto
-
- * conduits/calendar/calendar-conduit.c: as above
-
-2001-01-14 Damon Chaplin <damon@helixcode.com>
-
- * gui/e-calendar-table.c (E_CALENDAR_TABLE_SPEC): changed the expansion
- values so that small text fields are 1.0, all the date fields and the
- URL field are 2.0, and the Summary is 3.0. Hopefully the user will
- resize the fields as desired, but at least this is a better start.
-
-2001-01-14 JP Rosevear <jpr@ximian.com>
-
- * conduits/calendar/Makefile.am: pass -module and -avoid-version to
- conduit linker
-
- * conduits/todo/Makefile.am: ditto
-
-2001-01-14 Damon Chaplin <damon@helixcode.com>
-
- * gui/dialogs/task-editor.[hc]: moved #include
- <cal-client/cal-client.h> to the .h file.
-
- * gui/e-tasks.c: load & save the Tasks folders' ETable layout.
- Added an option menu to filter tasks by category.
-
- * gui/gnome-cal.c: use the "Tasks" folder for the TaskPad.
- (We may make the actual tasks folder shown a per-calendar option.)
-
- * gui/tasks-control.c (tasks_control_new_task_cmd): added support for
- the New Task icon on the toolbar.
-
- * gui/e-calendar-table.[hc]: we now use an ETableSubsetVariable model
- to filter the tasks by a category. And tidied up a little.
-
- * gui/calendar-model.[hc]: added way to get all the categories used by
- the tasks, so we can show an option menu of them. Also a signal which
- is emitted when they are changed.
- Also allows a default category to be set, which is used to initialize
- the 'click-to-add' row.
- Also made sure the initialize_value()/get_value() functions don't
- return NULL since that can cause a SEGV.
-
- * gui/e-week-view.c:
- * gui/e-day-view.c: set the "fill_color_rgba" arg of the EText items
- to black since it doesn't seem to set up a default color properly.
- Hopefully this fixes the bug on Solaris where the items appear with
- strange colors.
-
- * gui/widget-util.c (date_edit_new): use the calendar_config function
- to set most of the options. It wasn't setting the 12/24 hour option
- before.
-
- * gui/dialogs/task-editor-dialog.glade: added "Undefined" priority.
-
-2001-01-12 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component-factory.c (factory_fn): Pass NULL as the
- @copy_folder_fn arg to `evolution_shell_component_new()'.
-
-2001-01-12 Miguel de Icaza <miguel@ximian.com>
-
- * gui/e-calendar-table.c: Add translation strings.
-
-2001-01-08 Iain Holmes <iain@helixcode.com>
-
- * gui/calendar-summary.c (create_summary_view): Add a PropertyControl
- interface to set whether or not to show tasks and appointments. Add
- a PersistStream to remember this.
-
-2001-01-09 Dave Camp <dave@helixcode.com>
-
- * gui/Makefile.am: Replaced e-meet-dialog.glade.h with
- e-meeting-dialog.glade in glade_messages.
-
- * gui/e-meeting-dialog.glade: Enabled the translatable string option.
-
- * gui/e-itip-control.glade: Likewise.
-
-2001-01-09 Federico Mena Quintero <federico@helixcode.com>
-
- * idl/evolution-calendar.idl (AlarmNotify): New interface for the
- alarm notification system.
-
- * gui/alarm-notify: New directory for the alarm notification
- daemon and its auxiliary stuff.
-
- * gui/alarm-notify/alarm.[ch]: Moved over from gui/alarm.[ch].
-
- * gui/alarm-notify/alarm-queue.[ch]: Moved over from
- gui/alarm-notify.[ch]. Renamed functions from alarm_notify_*() to
- alarm_queue_*().
-
- * gui/alarm-notify/alarm-notify.[ch]: Implementation of the
- GNOME::Evolution::Calendar::AlarmNotify interface.
-
- * gui/Makefile.am (evolution_calendar_LDADD): Removed the
- LINK_FLAGS variable and reordered the libraries to remove some
- duplicated ones.
- (SUBDIRS): Added the alarm-notify directory.
-
-2001-01-08 Iain Holmes <iain@helixcode.com>
-
- * gui/calendar-summary.c (generate_html_summary): Get the tasks
- correctly.
- (generate_html_summary): Mark the tasks as completed if so.
-
-2001-01-08 Damon Chaplin <damon@helixcode.com>
-
- * gui/Makefile.am: added new source files for the Tasks folders.
-
- * gui/e-tasks.[hc]: new widget to encapsulate the Tasks view.
-
- * gui/tasks-control.[hc]: new files to implement the Tasks control.
-
- * gui/tasks-control-factory.[hc]: new files to implement the factory
- for the Tasks controls. (I think the way I've split the code up is a
- lot cleaner than the GnomeCal implementation - the factory file just
- contains the factory functions and the control file contains all the
- control functions. Maybe we should make GnomeCal like this.)
-
- * gui/main.c: initialize the Tasks control factory.
-
- * gui/component-factory.c: added support for the Tasks control.
- Also added a "create_folder" function so we can now create new Tasks
- and Calendar folders within Evolution.
- I'm not a Bonobo expert so someone might want to check these over.
-
- * gui/calendar-config.[hc]: added convenience functions to configure
- the common settings of ECalendar and EDateEdit widgets.
-
- * gui/dialogs/task-editor.c (task_editor_create_date_edit):
- * gui/gnome-cal.c (gnome_calendar_update_config_settings):
- * gui/event-editor.c: used function to configure the ECalendars
- and EDateEdits.
-
- * gui/e-day-view-top-item.c (e_day_view_top_item_draw_long_event):
- fixed minor bug in format strings.
-
-2001-01-06 Iain Holmes <iain@helixcode.com>
-
- * gui/calendar-summary.c (generate_html_summary): Neaten the HTML,
- and fix the time printing stuff. Add stuff the get Tasks.
- (alarm_fn): Set up an alarm for midnight everynight and regenerate
- the HTML for the new day.
-
-2001-01-05 JP Rosevear <jpr@helixcode.com>
-
- * gui/event-editor.c (get_widgets): get categories button
- (init_widgets): listen for button click
- (fill_widgets): fill in the categories area
- (dialog_to_comp_object): set the cal component categories
- (categories_clicked): throw up the categories dialog and update
- when ok is clicked
-
- * gui/event-editor-dialog.glade: Add categories and contacts buttons
- and fields
-
- * gui/dialogs/task-editor-dialog.glade: Rename button
-
-2001-01-05 JP Rosevear <jpr@helixcode.com>
-
- * gui/dialogs/task-editor.c (get_widgets): get categories button
- (init_widgets): listen for button click
- (fill_widgets): fill in the categories area
- (dialog_to_comp_object): set the cal component categories
- (categories_clicked): throw up the categories dialog and update
- when ok is clicked
-
- * gui/dialogs/task-editor-dialog.glade: Tweak to name the categories
- button and make it active
-
- * gui/calendar-model.c (get_categories): We can get the string list of
- categories directly now
-
- * cal-util/cal-component.c (cal_component_get_categories): new function
- to get the categories list as a string
- (cal_component_set_categories): same but for setting
- (free_icalcomponent): init the categories var
- (scan_categories): kill
- (scan_property): assign the prop to the categories var
- (cal_component_get_categories_list): deal with renaming var to categories
- (cal_component_set_categories_list): fix brokeness
-
-2001-01-03 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/calendar-commands.c (new_calendar): Handle the case where
- the calendar view cannot be created; present a warning dialog box.
- (new_calendar): Do not show the widget here, since we already show
- it in control-factory.c.
-
- * gui/control-factory.c (control_factory_new_control): Handle the
- case where the calendar view cannot be created.
-
- * gui/component-factory.c (create_view): Ditto.
-
- * gui/calendar-summary.h: Added prototype for
- calendar_summary_factory_init().
-
-2001-01-02 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/alarm-notify.c (add_component_alarms): If the component has
- no alarms, do not try to queue them.
- (remove_client_alarms): New function to remove all the queued
- alarms for a calendar client.
- (alarm_notify_remove_client): Remove the client's alarms.
-
-2001-01-02 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/dialogs/delete-comp.c (delete_component_dialog): Do not
- compose strings so that they can be localized correctly. Also,
- convert from UTF8 into the font's encoding. Fixes bug #1030.
-
- * gui/e-calendar-table.c (delete_component): Pass the widget
- argument to delete_component_dialog().
-
- * gui/e-day-view.c (e_day_view_on_delete_appointment): Likewise.
-
- * gui/e-week-view.c (e_week_view_on_delete_appointment): Likewise.
-
- * gui/event-editor.c (file_delete_cb): Likewise.
-
- * gui/calendar-commands.c: Use BONOBO_UI_VERB() instead of
- BONOBO_UI_UNSAFE_VERB(). Guess what, all of our handler
- signatures were wrong.
-
- * gui/event-editor.c: Likewise.
-
- * gui/dialogs/task-editor.c: Likewise.
-
- * gui/goto-dialog.glade: Added some spacing between the month/year
- widgets and the calendar widget.
-
-2001-01-01 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/gnome-cal.c (gnome_calendar_destroy): Unconditionally remove
- the client from the alarm notification system.
- Removed all the obsolete alarm code.
-
- * gui/event-editor.c: Removed some crufty externs left over from
- Gnomecal.
-
- * gui/calendar-commands.c: #include "goto.h"
- Removed crufty variables left over from Gnomecal.
- (new_calendar): Do not take a full_name parameter.
- (init_username): Removed function.
- (init_calendar): Wheeeeeeee! Removed crufty function.
- (quit_cmd): Removed function.
-
- * gui/print.c (WEEK_STARTS_ON_MONDAY): Made it unconditionally
- FALSE because we do not use the configuration setting anyways.
- Sigh, all the printing code needs to be revamped.
-
-2000-12-26 Iain Holmes <iain@helixcode.com>
-
- * gui/calendar-summary.c (create_summary_view): Create a shared
- BonoboEventSource object.
-
-2000-12-25 Miguel de Icaza <miguel@helixcode.com>
-
- * gui/e-day-view.c (e_day_view_init): Set draw background to FALSE.
- (e_day_view_reshape_long_event): ditto.
- (e_day_view_reshape_day_event): ditto.
-
-2000-12-22 JP Rosevear <jpr@helixcode.com>
-
- * gui/dialogs/delete-comp.c (delete_component_dialog): Clean up
- translatable strings for translators, fixes bug 993
-
-2000-12-22 JP Rosevear <jpr@helixcode.com>
-
- * gui/goto.c (create_ecal): Make sure the current month is shown
- when the dialog pops up.
-
- * gui/goto-dialog.glade: Remove flicker
-
-2000-12-22 JP Rosevear <jpr@helixcode.com>
-
- * pcs/cal-backend-file.c (cal_backend_file_get_alarms_for_object):
- account for the case where there are no alarms, fixes crash
-
-2000-12-22 JP Rosevear <jpr@helixcode.com>
-
- * gui/goto.c (ecal_date_range_changed): New function to keep the
- ecal marked properly
- (create_ecal): move more creation code here, update marks
- (goto_dialog_init_widgets): listen for date_range_changed signal
- in the ecal
-
- * gui/calendar-commands.c (init_calendar): Remove ancient gnomecal
- cruft
-
- * gui/mark.[hc], gui/prop.c: Remove ancient gnomecal code that is
- no longer needed, last bit of bug 904
-
-2000-12-22 JP Rosevear <jpr@helixcode.com>
-
- * gui/goto-dialog.glade.h: translations
-
- * gui/goto-dialog.glade: new glade file for goto dialog
-
- * gui/gnome-cal.c (setup_widgets): Set date navigator attributes
-
- * gui/calendar-commands.h: remove prototype
-
- * gui/goto.h: Add prototype
-
- * gui/Makefile.am: Add glade file stuff
-
- * gui/gnome-cal.c (setup_widgets): Use accessors to configure the
- calendar item properly
-
-2000-12-21 Federico Mena Quintero <federico@helixcode.com>
-
- Alarm trigger queueing for the GUI part.
-
- * gui/alarm-notify.[ch]: New files with the high-level alarm
- notification system; mostly moved over from gnome-cal.c. The
- low-level timer stuff is still in alarm.[ch].
-
- * gui/alarm-notify.c (alarm_notify_init): New function to
- initialize the alarm notification system.
- (alarm_notify_done): New function to shut down the alarm
- notification system.
- (alarm_notify_add_client): New function to start monitoring a
- calendar client for alarm notification.
- (alarm_notify_remove_client): New function to stop monitoring a
- client.
-
- * gui/alarm.h (AlarmDestroyNotify): Also pass in the alarm ID so
- the callback may know which ID is being destroyed.
-
- * gui/alarm.c (clear_itimer): New function.
- (pop_alarm): Use clear_itimer().
- (alarm_done): New function to shut down the timer system.
- (alarm_add): Add some preconditions. Do not call the destroy
- notification function if we could not create the alarm.
- (alarm_ready): Pass the alarm ID to the destroy notify function.
- (alarm_remove): Likewise. Also, add some preconditions.
-
- * gui/gnome-cal.c: Removed the alarm notification functions from
- here since they are now in alarm-notify.c.
- (gnome_calendar_construct): Register the client with
- alarm_notify_add_client().
- (gnome_calendar_destroy): Use alarm_notify_remove_client() to
- unregister the client.
- (obj_updated_cb): Do not do any alarm-related stuff.
- (obj_removed_cb): Likewise.
-
- * gui/main.c (main): Shut down the alarm timer system.
- (main): Initialize and shut down the alarm notification system.
-
- * gui/Makefile.am (evolution_calendar_SOURCES): Added
- alarm-notify.[ch] to the list of sources.
-
- * gui/calendar-model.c (calendar_model_set_cal_client): Only
- connect to the "cal_loaded" signal if the client is not already
- loaded.
-
- * gui/e-day-view.c (e_day_view_set_cal_client): Likewise.
-
- * gui/e-week-view.c (e_week_view_set_cal_client): Likewise.
-
- * gui/e-itip-control.c (update_calendar): Connect to "cal_loaded"
- before issuing the load request.
-
-2000-12-21 Iain Holmes <iain@helixcode.com>
-
- * gui/calendar-summary.c: Updated for new executive summary.
-
- * gui/component-factory.c: Reenabled the summary.
-
- * gui/GNOME_Evolution_Calendar.oafinfo: Added the summary.
-
-2000-12-20 JP Rosevear <jpr@helixcode.com>
-
- * conduits/todo/todo-conduit.h: Fix erroneous documentation
-
- * conduits/todo/todo-conduit.c (comp_from_remote_record): if
- !is_empty_time rather than is_empty_time
- (e_todo_context_new): Return a pointer rather than fill in
- a parameter
- (e_todo_context_foreach_change): Free just the key
- (e_todo_context_destroy): Plug this enormous leakage. I had assumed
- i had done this earlier, which isn't too bright when anything beyond
- 2 minutes ago is fuzzy.
- (comp_from_remote_record): Kill warnings
- (post_sync): Destroy the map later
- (conduit_get_gpilot_conduit): Fix e_todo_context_new params
-
- * conduits/calendar/calendar-conduit.[hc]: Similar to above
-
-2000-12-19 JP Rosevear <jpr@helixcode.com>
-
- * conduits/calendar/calendar-conduit.c: Remove pointless comment
-
- * conduits/todo/todo-conduit.c (is_empty_time): add utility function
- (comp_from_remote_record): use it
-
-2000-12-19 JP Rosevear <jpr@helixcode.com>
-
- * conduits/calendar/calendar-conduit.c (local_record_from_comp):
- Convert cal component strings to pilot character set
- (comp_from_remote_record): vice versa
-
- * conduits/todo/todo-conduit.c: Same as above
-
-2000-12-19 Federico Mena Quintero <federico@helixcode.com>
-
- * pcs/cal-backend-file.c (compute_alarm_range): Fix confusion in
- the way the range is expanded.
-
- * cal-util/cal-component.c (cal_component_alarms_free): Doh,
- alarms->alarms is a list, not a generic pointer. Free it properly.
- (cal_component_free_pilot_id): Removed unused function.
- (cal_component_free_pilot_status): Likewise.
-
- * gui/main.c (init_bonobo): Use VERSION instead of a hardcoded
- string. Pass argc by value, not by reference. Test the return
- value of gnome_init_with_popt_table().
-
- * cal-client/cal-client.c (cal_client_free_alarms): Oops, missed
- implementing this function.
-
- * cal-util/timeutil.c (print_time_t): Better printing format.
- (isodiff_to_secs): Removed unused function.
- (isodiff_from_secs): Removed unused function.
- (time_day_end): Removed crufty part.
- (time_day_begin): Removed crufty part.
- (time_day_hour): Removed unused function.
- (format_simple_hour): Removed unused function.
- (get_time_t_hour): Removed unused function.
- (time_from_start_duration): Removed unused function.
-
- * cal-util/timeutil.h (parse_date): Removed unimplemented, unused
- function prototype.
-
-2000-12-19 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/gnome-cal.c: Removed prototype for setup_alarm to fix a
- warning.
-
-2000-12-18 Federico Mena Quintero <federico@helixcode.com>
-
- Alarm instance generation support for the Wombat.
-
- * idl/evolution-calendar.idl (Cal::CalAlarmInstance): Changed to
- have an alarm UID, the trigger time, and the actual occurrence
- time.
- (Cal::CalComponentAlarms): New structure to hold a pair of a
- component and its alarms that trigger in a particular range of
- time.
- (Cal::getAlarmsInRange): Changed to return a CalComponentAlarmsSeq.
-
- * cal-util/cal-component.h (CalAlarmInstance): New C-side
- structure to match the one on the IDL.
- (CalComponentAlarms): Ditto.
- (CalAlarmAction): Renamed from CalComponentAlarmAction.
- (CalAlarmTriggerType): Renamed from CalComponentAlarmTriggerType.
- Encoded the START and END parameters for the RELATED parameter in
- this enum, too. Added a NONE value for invalid or missing trigger
- specifications.
- (CalComponentAlarmTriggerRelated): Removed.
- (CalAlarmTrigger): Renamed from CalComponentAlarmTrigger. Renamed
- the duration/time fields to rel_duration/abs_time, respectively.
-
- * cal-util/cal-component.c (cal_component_alarm_get_trigger):
- Changed to use the new trigger structure.
- (cal_component_alarm_set_trigger): Likewise.
- (cal_component_alarm_free_trigger): Removed function.
- (cal_component_has_alarms): Count the elements in the
- alarm_uid_hash instead of trying to fetch the first alarm subcomponent.
- (cal_component_alarms_free): New function to free a
- CalComponentAlarms structure.
- (CalComponentAlarmPrivate): Added an uid property pointer.
- (scan_alarm_property): Scan for the our extension UID property.
- (cal_component_alarm_get_uid): New function.
-
- * pcs/cal-backend.h (CalBackendClass): Changed the signatures of
- the ::get_alarms_in_range() and ::get_alarms_for_object() methods.
-
- * pcs/cal-backend.c (cal_backend_get_alarms_in_range): Changed
- signature; use the new method.
- (cal_backend_get_alarms_for_object): Likewise.
-
- * pcs/cal-backend-file.c (compute_alarm_range): New spiffy
- function to compute a range of time for alarm occurrences.
- (add_alarm_occurrences_cb): New function to add alarms for a
- particular occurrence of the component.
- (generate_absolute_triggers): New function to add the absolute
- alarm triggers.
- (generate_alarms_for_comp): New function to generate all the alarm
- instances for a component.
- (cal_backend_file_get_alarms_in_range): Implemented.
-
- * pcs/cal.c (Cal_get_alarms_in_range): Use the new CalBackend API.
- (Cal_get_alarms_for_object): Likewise.
- (build_alarm_instance_seq): Removed old function.
-
- * cal-util/cal-util.c (cal_alarm_instance_list_free): Removed
- function.
-
- * cal-client/cal-client.c (build_component_alarms_list): New
- function to demarshal the component alarms sequence.
- (build_alarm_instance_list): New function to demarshal the alarm
- instances sequence.
- (cal_client_get_alarms_in_range): Updated for the new API.
- (cal_client_get_alarms_for_object): Updated for the new API.
-
- * gui/gnome-cal.c: Temporary #ifdef-ing out of alarm-related stuff
- to make it build.
-
-2000-12-15 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-util/timeutil.[ch] (time_from_isodate): Removed unused
- function, a relic from Gnomecal.
-
-2000-12-15 Dan Winship <danw@helixcode.com>
-
- * cal-util/timeutil.c (time_from_isodate): Fix the sign in the
- HAVE_TM_GMTOFF case
-
-2000-12-15 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/Makefile.am (evolution_calendar_SOURCES): Removed getdate.y.
- We no longer use it; it is a relic from Gnomecal.
-
- * gui/getdate.y: Removed file.
-
-2000-12-14 Federico Mena Quintero <federico@helixcode.com>
-
- Fixes bug #955.
-
- * gui/weekday-picker.c (WeekdayPickerPrivate): Added a field for
- the week_start_day, to be used in the same way as
- calendar-config.h defines it. Removed the week_starts_on_monday
- flag.
- (day_event_cb): Use the week_start_day.
- (colorize_items): Likewise.
- (configure_items): Likewise.
- (weekday_picker_set_week_start_day): New function.
- (weekday_picker_get_week_start_day): New function.
- (weekday_picker_set_week_starts_on_monday): Removed function.
- (weekday_picker_get_week_starts_on_monday): Removed function.
-
- * gui/widget-util.[ch]: New files with utilities for creating or
- configuring widgets.
-
- * gui/widget-util.c (date_edit_new): New function to create an
- EDateEdit configured with the calendar's preferences; moved over
- from event-editor.c.
-
- * gui/event-editor.c (make_recur_weekly_special): Use
- weekday_picker_set_week_start_day() and the corresponding function
- from calendar-config.h.
- (init_widgets): Likewise.
- (make_date_edit_with_time): Removed function.
- (make_recur_ending_until_special): Use date_edit_new().
- (make_date_edit): Likewise.
-
- * gui/dialogs/task-editor.c (task_editor_create_date_edit): Likewise.
-
- * gui/event-editor-dialog.glade: Removed references to
- make_date_edit_with_time(); replace them with make_date_edit().
-
- * gui/Makefile.am (evolution_calendar_SOURCES): Added
- widget-util.[ch] to the list of sources.
-
-2000-12-14 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/e-calendar-table.c (E_CALENDAR_TABLE_SPEC): Reset the widths
- of the columns with pixbufs to the actual pixbufs' sizes; now
- ETable properly computes its column widths so we do not need to
- add extra padding here.
-
-2000-12-14 Dan Winship <danw@helixcode.com>
-
- * gui/calendar-model.c (_XOPEN_SOURCE): #define this to 500, not
- nothing. Also, move this bit after the other #includes to
- prevent potential messiness.
-
-2000-12-13 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-util/cal-component.c (ensure_mandatory_properties): Even
- though icaltime_from_timet() now properly ignores the is_utc
- argument since time_t values *are* in UTC by definition, we were
- passing FALSE for that argument's value in a bunch of places. So
- although it is ignored, changed them to TRUE for consistency.
- Hopefully newer versions of libical will remove that argument
- entirely since it does not make sense to speak of non-absolute
- time_t values.
-
- * cal-util/cal-recur.c (cal_recur_set_rule_end_date): Likewise.
-
- * conduits/calendar/calendar-conduit.c (comp_from_remote_record): Likewise.
-
- * conduits/todo/todo-conduit.c (comp_from_remote_record): Likewise.
-
- * gui/dialogs/task-editor.c (dialog_to_comp_object): Likewise.
-
- * gui/e-day-view.c (e_day_view_on_new_appointment): Likewise.
- (e_day_view_on_delete_occurrence): Likewise.
- (e_day_view_on_unrecur_appointment): Likewise.
- (e_day_view_on_unrecur_appointment): Likewise.
- (e_day_view_finish_long_event_resize): Likewise.
- (e_day_view_finish_resize): Likewise.
- (e_day_view_key_press): Likewise.
- (e_day_view_on_top_canvas_drag_data_received): Likewise.
- (e_day_view_on_main_canvas_drag_data_received): Likewise.
-
- * gui/e-week-view.c (e_week_view_key_press): Likewise.
- (e_week_view_on_new_appointment): Likewise.
- (e_week_view_on_delete_occurrence): Likewise.
- (e_week_view_on_unrecur_appointment): Likewise.
-
- * gui/event-editor.c (simple_recur_to_comp_object): Likewise.
- (recur_to_comp_object): Likewise.
- (dialog_to_comp_object): Likewise.
-
- * gui/gnome-cal.c (gnome_calendar_new_appointment): Likewise.
-
-2000-12-13 Christopher James Lahey <clahey@helixcode.com>
-
- * cal-util/cal-recur.c: #if 0ed cal_obj_date_only_compare_func.
- (cal_object_get_rdate_end): Changed this function to get rid of a
- possible uninitialized error on the rdate function.
-
- * gui/calendar-model.c: Fixed some warnings involving the #define
- _XOPEN_SOURCE lines here.
-
- * gui/component-factory.c: #ifdef WANT_THE_EXECUTIVE_SUMMARYed out
- the summary_factory object since it's unused if
- WANT_THE_EXCUTIVE_SUMMARY is not defined.
-
- * gui/e-day-view.c: #if 0ed out e_day_view_remove_event_cb.
- (obj_updated_cb): #ifndef NO_WARNINGSed out a #warning.
-
- * gui/e-week-view-event-item.c (e_week_view_event_item_draw): Made
- it so that
-
- * gui/e-week-view.c (obj_updated_cb): #ifndef NO_WARNINGSed out a
- #warning.
-
-2000-12-13 JP Rosevear <jpr@helixcode.com>
-
- * conduits/todo/Makefile.am: Revert federico's change for now
- because of libtool limitations with ldadding shared libtool
- libs
-
- * conduits/calendar/Makefile.am: ditto
-
-2000-12-12 JP Rosevear <jpr@helixcode.com>
-
- * gui/dialogs/task-editor.c (task_editor_set_todo_object): Use
- set_title_from_comp
- (save_todo_object): ditto
- (set_title_from_comp): Make sure the title is encoded properly (as in
- event-editor)
-
-2000-12-12 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-util/cal-component.c (get_text_list): Constify for new
- libical API.
- (set_text_list): Likewise.
-
- * cal-util/cal-recur.c (cal_recur_get_rule_end_date): Likewise.
- (cal_recur_set_rule_end_date): Likewise.
-
- * gui/e-itip-control.c (find_attendee): Likewise.
- (pstream_load): Likewise.
-
- * gui/gnome-cal.c (released_event_object_cb): Removed unused function.
-
- * gui/dialogs/task-editor.c (status_string_map): Removed unused
- variable.
-
-2000-12-11 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-util/Makefile.am (test_recur_LDADD): Link to the libical
- shared library.
-
- * cal-client/Makefile.am (client_test_LDADD): Likewise.
-
- * conduits/calendar/Makefile.am (libecalendar_conduit_la_LIBADD):
- Likewise.
-
- * gui/Makefile.am (LINK_FLAGS): Likewise.
-
-2000-12-11 Federico Mena Quintero <federico@helixcode.com>
-
- This is to make things work with libical 0.21helix1 and later.
- Warnings remain because at last libical was constified; will take
- care of those tomorrow.
-
- * cal-util/timeutil.h: #include <ical.h> instead of <icaltypes.h>
-
- * gui/e-itip-control.c: Likewise.
-
- * gui/e-meeting-edit.c: Likewise.
-
- * gui/itip-utils.h: Likewise.
-
- * cal-util/cal-component.c (alarm_uid_from_prop): constify.
- (cal_component_get_status): Updated for new libical API.
- (cal_component_set_status): Likewise.
-
- * gui/calendar-model.c (ensure_task_complete): Removed unused
- status code.
- (ensure_task_not_complete): Update for new status API.
-
- * gui/dialogs/task-editor.c (status_string_to_value): Removed
- function.
- (status_value_to_string): Removed function.
- (status_string_map): Removed variable.
- (fill_widgets): Update for new status API.
- (dialog_to_comp_object): Likewise.
-
-2000-12-11 Damon Chaplin <damon@helixcode.com>
-
- * cal-util/cal-recur.c (generate_instances_for_chunk): updated the
- tests on the start & end time just before calling the callback. It
- was skipping occurrences that started before the required interval's
- start time, which was wrong. We want all occurrences that intersect
- the interval.
- (cal_obj_time_weekday): removed the CalRecurrence* argument, since it
- isn't needed.
-
-2000-12-11 Damon Chaplin <damon@helixcode.com>
-
- * gui/event-editor.c: added changed flags and added calls to a new
- function event_editor_set_changed() to set & reset this flag.
- Added prompt_to_save_changed() which is called when the user
- selects File/Close or the window's close button.
- Fixed the 'All day event' toggle button.
- Made the 'Alarm' page sensitive as appropriate when filling widgets.
- (Though note that the alarm widgets are not being set yet.)
-
- * gui/dialogs/task-editor.c: added changed flag as above.
-
- * gui/event-editor-dialog.glade: used good names for all the
- classification radio buttons so we can access them in the code.
-
- * gui/event-editor.c (init_widgets): use the "show week numbers" config
- option in the recurrence preview calendar.
-
- * gui/e-day-view.c (e_day_view_update_event_label): use 9:00 instead
- of 09:00 in the main view, as we do everywhere else now. It means the
- times won't line up, but they are easier to read which I think is
- better.
- Added support for Page Up/Down, though I think it should move the
- selection rather than just scroll the canvas.
-
- * cal-util/cal-recur.c (generate_instances_for_chunk): removed the
- end parameter since we should be using the chunk end time now.
- Added single_rule parameter for when we are generating the
- occurrences of a single RRULE, in which case the event's start date is
- not included in the occurrences output (unless it results from the
- RRULE expansion). Both of these fix problems when using COUNT.
-
- * gui/gnome-cal.c (gnome_calendar_on_date_navigator_selection_changed):
- fixed bug when checking if the new start day starts on the week start
- day. If you select a complete week it should now show the Week view.
-
-2000-12-08 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/event-editor.c (dialog_to_comp_object): Free the strings we
- get from the editables.
-
- * gui/dialogs/task-editor.c (dialog_to_comp_object): Likewise.
- This sucks; this code should be shared between the two dialogs.
-
-2000-12-08 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/event-editor.c (fill_widgets): Free the dates we get from
- the component.
-
-2000-12-08 JP Rosevear <jpr@helixcode.com>
-
- * gui/e-calendar-table.c (e_calendar_table_init): Attach signal
- handlers to the e_scrolled_table's etable rather than to the
- e_scrolled_table directly
- (e_calendar_table_on_double_click): This signal provides more
- params now
-
-2000-12-07 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/e-calendar-table.c: Got rid of code referencing the
- ETableScrolled proxy functions.
-
-2000-12-07 JP Rosevear <jpr@helixcode.com>
-
- * conduits/calendar/calendar-conduit.c (post_sync): Ugly hack for syncing
- until pcs can be altered (longer term)
-
- * conduits/todo/todo-conduit.c (post_sync): ditto
-
-2000-12-07 Chris Toshok <toshok@helixcode.com>
-
- * cal-client/Makefile.am (client_test_LDADD): add
- EXTRA_GNOME_LIBS.
-
-2000-12-07 JP Rosevear <jpr@helixcode.com>
-
- * pcs/cal-backend.c (cal_backend_compute_changes_foreach_key): Create
- an empty cal component if the object has been deleted.
-
- * idl/evolution-calendar.idl: Bit shift the change type constants
- properly
-
-2000-12-07 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-client/cal-client.c (cal_client_generate_instances): Unref
- the component from the objects list; it got referenced as many
- times as appropriate for the instances list.
-
-2000-12-06 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/event-editor.c (file_delete_cb): Confirm before deleting the
- event.
-
-2000-12-06 JP Rosevear <jpr@helixcode.com>
-
- * gui/e-week-view.c (e_week_view_init): unref the pixbuf when
- finished with it
-
-2000-12-06 Federico Mena Quintero <federico@helixcode.com>
-
- Fixes bug #920.
-
- * gui/e-calendar-table.c (delete_component): New function.
- (e_calendar_table_on_delete_task): Use delete_component().
- (e_calendar_table_on_key_press): Likewise. Also, mark the event
- as handled.
-
- * gui/calendar-model.c (calendar_model_get_component): Renamed
- function from calendar_model_get_cal_object().
- (calendar_model_delete_task): Removed function.
-
- * gui/dialogs/delete-comp.[ch]: New files with the dialog for
- deleting a calendar component.
-
- * gui/e-day-view.c (e_day_view_on_delete_appointment): Confirm
- before actually deleting the appointment.
-
- * gui/e-week-view.c (e_week_view_on_delete_appointment): Likewise.
-
- * gui/dialogs/Makefile.am (libcal_dialogs_a_SOURCES): Added
- delete-comp.[ch] to the list of sources.
-
- * cal-util/cal-component.c (cal_component_destroy): Free the alarm
- UID hash.
-
-2000-12-06 JP Rosevear <jpr@helixcode.com>
-
- * pcs/cal.c (build_change_seq): kill
- (Cal_get_changes): return the corba sequence directly
-
- * pcs/cal-backend.h: update prototype
-
- * pcs/cal-backend.c (cal_backend_compute_changes_foreach_key): Build
- the corba struct rather than the old calobjchange thing
- (cal_backend_compute_changes): ditto. build and return the actual
- corba sequence rather than the list of calobjchanges
- (cal_backend_get_changes): return the corba sequence
-
- * cal-util/cal-util.h: Remove CalObjChange cruft
-
- * cal-util/cal-util.c (cal_obj_change_list_free): Kill
-
-2000-12-06 JP Rosevear <jpr@helixcode.com>
-
- * cal-util/cal-util.c:
-
- * conduits/calendar/calendar-conduit.c (map_name): Update so as not to conflict
- with calendar
- (next_changed_item): update to use CalClientChange instead of CalObjChange
- (compute_status): ditto
- (pre_sync): ditto
- (for_each_modified): since we now have the cal component we can call
- local_record_from_comp directly
-
- * conduits/todo/todo-conduit.c: same as above
-
- * pcs/cal-backend.c: Remove much logging cruft
- (cal_backend_compute_changes): Calculate the changes based on the
- hashed database
- (cal_backend_get_changes): call cal_backend_compute_changes
- (cal_backend_compute_changes_foreach_key): hash callback for
- calculating deletions
-
- * pcs/cal-backend.h: update protype, remove logging cruft from
- object
-
- * pcs/cal.c (build_change_seq): dup the calobj rather than the uid
- now
- (Cal_get_changes): rename from Cal_get_changed_uids
- (cal_get_epv): reflect name change in epv
-
- * cal-util/cal-util.c (cal_obj_change_list_free): update assertion
-
- * cal-util/cal-util.h: CalObjChange now returns the entire ical
- component, update the change types. This should all go away shortly
-
- * idl/evolution-calendar.idl: getChangedUIds -> getChanges.
- CalObjChange now contains the calobj rather than the uid, update
- the change types
-
- * cal-client/cal-client.c (cal_client_get_changes): rename from
- cal_client_get_changed_uids to make idl and addressbook
-
- * cal-client/cal-client.h: Update prototype
-
- * cal-client/cal-client.c (build_change_list): Build a list of
- CalClientChange instead of CalObjChange
-
- * cal-client/cal-client-types.c (cal_client_change_list_free): Free
- a glist of CalClientChanges
-
- * cal-client/cal-client-types.h: New file. Declarations for
- CalClientChange.
-
- * cal-client/Makefile.am: Build new files
-
-2000-12-06 JP Rosevear <jpr@helixcode.com>
-
- * conduits/todo/Makefile.am: Fix my build stupidty READ THE MACRO
-
- * conduits/calendar/Makefile.am: ditto
-
-2000-12-04 JP Rosevear <jpr@helixcode.com>
-
- * gui/e-day-view-time-item.c (e_day_view_time_item_get_column_width):
- Initialize max_large_digit_width to 0 to prevent crazy sizing issues.
-
-2000-12-04 Dan Winship <danw@helixcode.com>
-
- * gui/e-itip-control.c: Remove mysterious #include inserted by
- mmeeks to break the build.
-
-2000-12-01 Federico Mena Quintero <federico@helixcode.com>
-
- Fixes bug #918.
-
- * gui/weekday-picker.c (WeekdayPickerPrivate): Added a field for a
- set of blocked days.
- (weekday_picker_set_blocked_days): New function to configure a set
- of days that cannot be modified by the user.
- (weekday_picker_get_blocked_days): Query function for the above.
- (day_event_cb): Block the appropriate days from being modified.
-
- * gui/event-editor.c (get_start_weekday_mask): New function to
- compute a day mask for the start day of a calendar component.
- (set_recur_special_defaults): New function to set sane defaults
- for the recurrence special widgets.
- (fill_recurrence_widgets): Use set_recur_special_defaults().
- (make_recur_weekly_special): Block the appropriate days.
-
-2000-12-01 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/control-factory.c (set_prop): Removed debugging message.
- (control_factory_init): Ditto.
-
- * gui/calendar-commands.c (calendar_set_uri): Ditto.
-
- * gui/main.c (main): Ditto.
-
- * gui/event-editor.c (set_title_from_comp): New function to
- generate a title and convert it from UTF8 before setting it on the
- window.
- (save_event_object): Uset set_title_from_comp().
- (event_editor_set_event_object): Likewise.
-
-2000-11-30 JP Rosevear <jpr@helixcode.com>
-
- * conduits/todo/todo-conduit.c: Debug message cleanups
- (comp_from_remote_record): Properly set the ical description field
-
- * conduits/calendar/calendar-conduit.c (is_empty_time): New utility
- functions that look for all 0's in a struct tm
- (comp_from_remote_record): use above
- (local_record_from_comp): Correctly set the repeatForever value so
- that we repeat forever instead of a really long time
- (comp_from_remote_record): Only set the cal component recurrence
- until field when repeatForever is 0
-
-2000-11-30 Jesse Pavel <jpavel@helixcode.com>
-
- * gui/e-itip-control.c: fixed a bug that caused the calendar to
- segfault when the iTip control was destroyed.
-
-2000-11-30 JP Rosevear <jpr@helixcode.com>
-
- * conduits/calendar/calendar-conduit.c (local_record_from_comp): Empty
- by_day entries are no longer indicated by ICAL_RECURRENCE_ARRAY_MAX not
- SHRT_MAX. Calculate weekly and monthly by date recurrences properly
- (get_pilot_day): Convert ical day to corresponding integer for pilot day
-
-2000-11-30 JP Rosevear <jpr@helixcode.com>
-
- * conduits/calendar/calendar-conduit.c: Debug message cleanups
- (get_ical_day): Fix off-by-one error which affected weekly occurences.
- (comp_from_remote_record): Monthly by day and by date were reversed
- (nth_weekday): function taken from event-editor.c that encodes BYDAY
- values - this needs to be in libical really.
- (comp_from_remote_record): Don't set the description if the pilot note
- is null. Rejig so that we don't have to free objects.
-
-2000-11-28 Federico Mena Quintero <federico@helixcode.com>
-
- Upgrade of the alarm framework. We now access alarms by a unique
- identifier. This UID is added as an extension property to alarm
- subcomponents when their parent components are scanned by
- CalComponent.
-
- * cal-util/cal-component.c (CalComponentPrivate): Added a hash
- table of alarm UIDs -> alarm properties.
- (cal_component_init): Initialize priv->alarm_uid_hash.
- (free_icalcomponent): Free the elements in the
- priv->alarm_uid_hash.
- (scan_alarm): New function to add scan an alarm subcomponent and
- ensure that it has an alarm UID extension property so that we can
- add it to our mapping table.
- (cal_component_get_first_alarm): Removed function.
- (cal_component_get_next_alarm): Removed function.
- (cal_component_get_alarm_uids): New function.
- (cal_component_get_alarm): New function.
-
-2000-11-28 JP Rosevear <jpr@helixcode.com>
-
- * conduits/todo/todo-conduit.c (local_record_to_pilot_record): Return
- a struct rather than a pointer to a struct
- (compare): local_record_to_pilot_record now returns a struct
- (prepare): ditto
- (free_prepare): remove as per gnome-pilot changes
- (conduit_get_gpilot_conduit): don't listen for free_prepare signal
-
- * conduits/calendar/calendar-conduit.c: Same as above
-
-2000-11-28 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/e-calendar-table.c (E_CALENDAR_TABLE_SPEC): Reformatted the
- table spec to make it easier to read.
-
- * gui/tag-calendar.c: Oops, Damon wrote this, not me. Fixed the
- Authors line.
-
-2000-11-28 Damon Chaplin <damon@helixcode.com>
-
- * gui/e-day-view*.[hc]:
- * gui/e-week-view*.[hc]: finished 12-hour support and tried to tidy
- up & comment the drawing code in places. Also fixed a couple of bugs I
- spotted. All the options on the 'Calendar' page should now work.
-
-2000-11-28 Jesse Pavel <jpavel@helixcode.com>
-
- * gui/e-meeting-edit.c: removed some debugging code that I had,
- which might have caused problems.
-
-2000-11-27 Jesse Pavel <jpavel@helixcode.com>
-
- * gui/calendar-model.c: added a preliminary change to have
- Assigned To-Do items have a corresponding icon.
-
-2000-11-27 JP Rosevear <jpr@helixcode.com>
-
- * conduits/todo/todo-conduit.c (free_prepare): Ditto
-
- * conduits/calendar/calendar-conduit.c (free_prepare): Adjust
- free_prepare to the correct signal parameters. Don't actually
- do anything - there is a semantic discrepancy that needs to be
- resolved.
-
-2000-11-26 Damon Chaplin <damon@helixcode.com>
-
- * gui/e-day-view.c (e_day_view_set_days_shown): == instead of =.
-
-2000-11-26 Damon Chaplin <damon@helixcode.com>
-
- * gui/gnome-cal.c: added more support for config settings.
-
- * gui/e-week-view.[hc]:
- * gui/e-day-view.[hc]: added support for setting - show event end
- times, week start day and 12-hour format (unfinished).
-
- * gui/e-day-view-time-item.c: started 12-hour support.
-
- * gui/tag-calendar.c (prepare_tag): use end_day + 1 since we want to
- include the last day.
-
- * gui/event-editor.c (set_all_day): minor change when turning all_day
- off - set the event end to one hour after the event start if it is on
- or before the start time. Also added more comments to make it a bit
- clearer.
-
- * cal-util/cal-recur.c (cal_obj_time_add_days): use a gint for day
- rather than a guint since we now support -ve days.
- Also fixed bug with weekly recurrences.
-
- * gui/dialogs/task-editor.c (task_editor_create_date_edit): use
- config settings.
-
- * gui/dialogs/cal-prefs-dialog.c (cal_prefs_dialog_update_config):
- updated EDateEdit calls.
-
-2000-11-24 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/e-calendar-table.c (e_calendar_table_init): Unref the ETable
- extras.
-
-2000-11-24 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-util/cal-component.c (free_icalcomponent): DOH, fixed
- reversed test for the presence of the icalcomp's parent. This was
- causing memory leaks in the Wombat and elsewhere.
-
- * pcs/cal-backend.c (cal_backend_set_node_timet): Plug leak.
-
-2000-11-24 Federico Mena Quintero <federico@helixcode.com>
-
- * pcs/cal-backend-file.c (scan_vcalendar): Use the new libical
- external iterators (icalcomponent_begin_component() and friends);
- the internal iterators are deprecated.
-
- * cal-util/test-recur.c (generate_occurrences): Likewise.
-
- * gui/e-itip-control.c (pstream_load): Likewise.
-
- * gui/e-meeting-edit.c (e_meeting_edit): Likewise.
-
- * pcs/cal-backend.c (cal_backend_log_entry): Plug leak.
- (cal_backend_log_sync): Free the entry->uid.
-
- * util/icalendar-save.[ch]:
- * util/icalendar-test.c:
- * util/icalendar.[ch]: Removed obsolete files.
-
-2000-11-21 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/task.xpm: Remove the check because it makes it look like the
- task is already completed. This fixes bug #819.
-
- * gui/task-recurring.xpm: Make it use a prettier overlaid icon.
-
- * gui/task-*.xpm: Made the things look like little spiral-bound
- notebooks.
-
- * gui/e-calendar-table.c (E_CALENDAR_TABLE_SPEC): Make the default
- column order be icon/completed/summary. You may need to erase
- your ~/evolution/config/TaskPad for this to appear.
-
-2000-11-21 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/calendar-model.c (calendar_model_is_cell_editable): The icon
- column is not editable!
-
- * gui/calendar-commands.c (todo_properties_changed): Removed.
- (time_format_changed): Removed.
- (colors_changed): Removed.
-
- * gui/calendar-commands.h:
- * gui/prop.c (prop_apply):
- * gui/calendar-commands.c (init_calendar): Removed the old to-do
- list crap.
-
- * gui/gncal-todo.[ch]: Removed obsolete files.
-
- * gui/Makefile.am (evolution_calendar_SOURCES): Removed gncal-todo.[ch].
-
- * gui/gnome-cal.c (gnome_calendar_todo_properties_changed): Removed.
- (gnome_calendar_time_format_changed): Removed.
- (gnome_calendar_colors_changed): Removed.
-
-2000-11-21 Jesse Pavel <jpavel@helixcode.com>
-
- * gui/e-itip-control.c: fixed the stupid Bonobo widget size
- allocation bug that had been vexing me.
-
- * gui/e-itip-control.glade: I removed some hacks that were
- necessary for said size bug.
-
-2000-11-16 Jesse Pavel <jpavel@helixcode.com>
-
- * gui/e-itip-control.c, gui/e-meeting-edit.c: added cancellation
- code to our program; people can cancel meetings, which is the best
- thing to do for most meetings.
-
-2000-11-13 Jesse Pavel <jpavel@helixcode.com>
-
- * gui/e-itip-control.c: made the REPLY code actually work.
-
-2000-11-13 Jesse Pavel <jpavel@helixcode.com>
-
- * gui/itip-utils.[ch]: I created this file to store some commonly used enumeration to
- string mappings and functions.
-
- * gui/Makefile.am: this was changed to reflect the addition of the above file.
-
- * gui/e-itip-control.c: added code to take action on a REPLY message.
-
- * gui/e-meeting-edit.c: bug fixes.
-
-2000-11-12 Federico Mena Quintero <federico@helixcode.com>
-
- OK, bugzilla bug #829 is fixed and that does not redeem me from
- extreme procrastination. Wheeeeeeeeeeeeeeee!
-
- * gui/event-editor-dialog.c: Changed the "Rule view" label to
- "Preview"
-
-2000-11-12 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/event-editor.c (make_recur_ending_count_special): Misspelled
- "occurrences".
- (fill_recurrence_widgets): Sensitize the "Custom recurrence" radio
- button as appropriate.
- (sensitize_recur_widgets): Resurrected the recurrence custom
- warning label.
- (get_widgets): Load the recurrence custom warning bin.
-
- * gui/event-editor-dialog.glade: Add an empty alignment for the
- recurrence custom warning label.
-
-2000-11-12 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/event-editor.c (recur_preview_date_range_changed_cb): New
- function; re-tag the calendar when its date range changes.
- (init_widgets): Connect to "date_range_changed" on the recurrence
- preview calendar.
- (make_recur_weekly_special): Connect to "changed" on the weekday
- picker.
- (recur_weekday_picker_changed_cb): New function; re-tag the calendar.
- (month_day_menu_selection_done_cb): Re-tag the calendar.
- (recur_month_index_value_changed_cb): Likewise.
- (recur_ending_until_changed_cb): Likewise.
- (recur_ending_count_value_changed_cb): Likewise.
- (make_recur_monthly_special): Connect to "value_changed" on the
- adjustment of the month index.
- (make_recur_ending_until_special): Connect to "changed" on the
- ending-until date picker.
- (make_recur_ending_count_special): Connect to "value_changed" on
- the ending-count adjustment.
- (init_widgets): Set to zero the maximum number of selectable days
- in the recurrence preview calendar. Set the week_start_day from
- the calendar's configuration.
-
-2000-11-12 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/event-editor.c (clear_widgets): Block the signals as appropriate.
- (fill_ending_date): Ditto.
- (fill_recurrence_widgets): Ditto.
- (recurrence_type_toggled_cb): Only sensitize the widgets and
- preview the recurrence if the toggle button is active.
-
-2000-11-12 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/event-editor.c (recur_to_comp_object): Clear the rdate and
- exrule lists from the component if we are setting a simple
- recurrence.
- (recur_to_comp_object): Set the exdate list here instead of in
- dialog_to_comp_object().
- (preview_recur): New function to tag the recurrence preview
- calendar based on the information from the dialog box.
- (fill_exception_widgets): Fill the exception widgets here; moved
- over from fill_widgets().
- (fill_recurrence_widgets): Call preview_recur(). Also, call
- fill_exception_widgets() first of all.
- (recurrence_type_toggled_cb): Call preview_recur().
- (recur_interval_selection_done_cb): Likewise.
- (recur_ending_selection_done_cb): Likewise.
- (recurrence_exception_add_cb): Likewise.
- (recurrence_exception_modify_cb): Likewise.
- (recurrence_exception_delete_cb): Likewise.
- (date_changed_cb): Likewise.
- (recur_interval_value_changed_cb): Likewise, new function.
-
- * gui/tag-calendar.[ch]: New files with utilities for tagging
- calendars. mark.[ch] should go away some day.
-
- * gui/tag-calendar.c (tag_calendar): Moved over from
- gnome_calendar_tag_calendar(). Take in a CalClient instead of a
- GnomeCalendar. Added API docs.
- (tag_calendar_by_comp): New function to tag a calendar based on a
- single calendar component instead of a whole client.
-
- * gui/gnome-cal.c (initial_load): Use tag_calendar_by_client().
- (obj_updated_cb): Likewise.
- (obj_removed_cb): Likewise.
- (gnome_calendar_on_date_navigator_date_range_changed): Likewise.
- (editor_closed_cb): Free the closure.
- (destroy_editor_cb): Renamed from free_uid(). Do not free the
- UID; just unref the event editor. Our destroy handler to it will
- free things properly. This will also cause the corresponding
- calendar client to be unrefed.
- (editor_closed_cb): Use a flag on the GnomeCalendar to decide
- whether to remove the editor from the hash table. This is sort of
- icky.
-
- * gui/calendar-model.c (obj_updated_cb): If the object is new, we
- have to use e_table_model_row_inserted(), not row_changed().
- Thanks to JP Rosevear for reporting this.
-
- * gui/Makefile.am (evolution_calendar_SOURCES): Added
- tag-calendar.[ch] to the list of sources.
-
-2000-11-11 Matt Bissiri <bissiri@eecs.umich.edu>
-
- * gui/evolution-calendar.oafinfo:
- Update the remaining "IDL:Evolution*" to "IDL:GNOME/Evolution*"
- to sync up with yesterday's IDL re-scoping.
-
-2000-11-10 Michael Meeks <michael@helixcode.com>
-
- * gui/Makefile.am ($(IDL_GENERATED)): sort include order.
-
- * pcs/Makefile.am (idl_flags): ditto.
-
-2000-11-10 JP Rosevear <jpr@helixcode.com>
-
- * conduits/calendar/calendar-conduit.c (for_each_modified): Inc the
- iterator before finding the next changed item.
-
- * conduits/todo/todo-conduit.c (for_each_modified): ditto
-
-2000-11-09 Jesse Pavel <jpavel@helixcode.com>
-
- * gui/e-itip-control.c: I wrote the code so that recipients of meeting requests
- can reply appropriately.
-
-2000-11-09 Jesse Pavel <jpavel@helixcode.com>
-
- * gui/e-meeting-edit.c: fixed a bug that would make the calendar segfault
- if the meeting editor were called up twice without first saving the
- component.
-
-2000-11-08 Jesse Pavel <jpavel@helixcode.com>
-
- * gui/e-itip-control.c, gui/e-itip-control.glade: updated the GUI
- to allow the user to add PUBLISHed events to his calendar, and created
- unworking buttons for meeting requests.
-
-2000-11-08 Federico Mena Quintero <federico@helixcode.com>
-
- These changes fix bugzilla bugs #874 and #875.
-
- * cal-util/cal-component.c (cal_component_get_exdate_list): Return
- a list of CalComponentDateTime instead of simple struct
- icaltimetype objects. Exception date properties *can* contain a
- timezone parameter, so we need to include those if they are
- present.
- (cal_component_set_exdate_list): On the input, handle a list of
- CalComponentDateTime structures. On the internals, handle a list
- of struct datetime instead of plain properties.
- (cal_component_free_exdate_list): Handle a list of
- CalComponentDateTime structures.
- (scan_exdate): Create a list of struct datetime structures.
- (free_icalcomponent): Free the exdate_list properly.
-
- * cal-util/cal-recur.c (generate_instances_for_chunk): Use the
- proper types for exception dates.
-
- * gui/comp-util.h:
- * gui/comp-util.c: New files with utilities for manipulating
- calendar component objects.
- (cal_comp_util_add_exdate): New function.
-
- * gui/Makefile.am (evolution_calendar_SOURCES): Added
- comp-util.[ch] to the list of sources.
-
- * gui/e-day-view.c (add_exdate): New convenience function to add
- an exception date to a calendar component.
- (e_day_view_on_unrecur_appointment): Use cal_comp_util_add_exdate().
- (e_day_view_on_delete_occurrence): Likewise.
-
- * gui/e-week-view.c (e_week_view_on_delete_occurrence): Likewise.
- (e_week_view_on_unrecur_appointment): Likewise.
-
- * gui/event-editor.c (nth_weekday): Be paranoid about valid
- position values.
- (fill_widgets): Use the proper types for exdates.
- (dialog_to_comp_object): Likewise.
-
-2000-11-08 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/event-editor.c (adjust_day_index_spin): Adjust the valid
- range of the month index spin button depending on the selection of
- the day/weekday menu.
-
-2000-11-07 Jesse Pavel <jpavel@helixcode.com>
-
- * gui/e-itip-control.c, gui/e-itip-control.glade: changed the GUI,
- and added some extra feedback for the user.
-
-2000-11-07 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/weekday-picker.h (WeekdayPickerClass): Added a "changed"
- signal to notify of changes to the set of selected days.
-
- * gui/weekday-picker.c (weekday_picker_class_init): Create the
- "changed" signal.
- (weekday_picker_set_days): Emit the "changed" signal.
-
-2000-11-06 Jesse Pavel <jpavel@helixcode.com>
-
- * gui/e-itip-control.c, gui/e-itip-control.glade: changed to GUI to
- accomodate dynamically generated buttons, which will be tailored to
- the type of iTip message that is incoming.
-
- * gui/e-meeting-dialog.glade gui/e-meeting-edit.c: added a new button
- to publish events, in addition to requesting meetings.
-
-2000-11-05 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/event-editor-dialog.glade: Removed the old recurrence page.
- Wheeeeeeeeee!
-
- * gui/event-editor.c (make_recurrence_special): Clear the monthly
- widgets.
- (make_recur_monthly_special): Create the monthly widgets.
- (clear_widgets): Clear the monthly values.
- (simple_recur_to_comp_object): Fill in the monthly values.
- (fill_recurrence_widgets): Fill in the monthly and yearly source
- values.
- (dialog_to_comp_object): Take in a CalComponent instead of using
- the event editor's directly.
- (recur_to_comp_object): Likewise.
- (simple_recur_to_comp_object): Likewise.
- (EventEditorPrivate): Removed the widgets from the old recurrence
- page.
- (get_widgets): Likewise.
- (clear_widgets): Likewise.
- (dialog_to_comp_object): If the description or summary are empty,
- just clear the description list or summary property, respectively,
- instead of saving empty ones.
- (simple_recur_to_comp_object): Set the week_start field.
-
- * gui/main.c: Fix includes, and add calendar-config.h.
-
- * gui/Makefile.am (evolution_calendar_SOURCES): The glade messages
- file should not be in SOURCES.
-
-2000-11-05 Christopher James Lahey <clahey@helixcode.com>
-
- * doc/.cvsignore, doc/C/.cvsignore: Removed unnecessary .cvsignore
- files.
-
-2000-11-03 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/event-editor.c (check_all_day): Block signals from the
- toggle button.
- (date_changed_cb): Merged check_dates() and check_times() into
- this function; provide better behavior as well.
- (check_dates): Removed function.
- (check_times): Removed function.
- (init_widgets): Connect to the "changed" signal on the start_time
- and end_time widgets.
- (check_all_day): Use a better test.
-
- * gui/Makefile.am: Clean the idl-generated sources properly.
- * cal-client/Makefile.am: Likewise.
-
-2000-11-03 Jesse Pavel <jpavel@helixcode.com>
-
- * gui/e-itip-control.c: added some checks for the type of an
- incoming iCal component before passing it off to the CalComponent
- routines.
-
-2000-11-02 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/dialogs/task-editor.c (init_widgets): The date editor's
- signal is now "changed".
- (completed_changed): Renamed callback to reflect the name of the
- signal.
-
-2000-11-01 Gediminas Paulauskas <menesis@delfi.lt>
-
- * gui/main.c: (main): added call to bindtextdomain and textdomain, so
- all calendar gui shows up localized.
-
-2000-10-31 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/event-editor.c (count_by_xxx): Hmmm. SHRT_MAX changed to
- ICAL_RECURRENCE_ARRAY_MAX in libical. Deal with it.
- (fill_recurrence_widgets): Likewise.
- (simple_recur_to_comp_object): Fixed incorrect assertion. The
- weekday picker is not the immediate child of the recurrence
- special container.
- (fill_recurrence_widgets): Call make_recurrence_special() after
- setting the recurrence period type.
- (fill_ending_date): Call make_recurrence_ending_special(). This
- would be so much nicer if GTK+ were model/view all over.
-
-2000-10-31 JP Rosevear <jpr@helixcode.com>
-
- * conduits/todo/todo-conduit.h: Remove add/del/mod hashes and
- add changed_hash.
-
- * conduits/calendar/calendar-conduit.h: ditto
-
- * conduits/todo/todo-conduit.c (next_changed_item): Utility function
- to get the next "really" changed item (changed status can be cleared now)
- (compute_status): Compute status based on changed_hash
- (pre_sync): Fill changed_hash and counts adds/mods/dels
- (set_status_cleared): New callback handler - avoid double syncing
- (for_each_modified): Use next_changed_item to iterate
- (add_archive_record): kill
- (delete_archive_record): kill
- (archive_record): New callback handler - mark/unmark archive status
- (conduit_get_gpilot_conduit): Adjust signal connects
-
- * conduits/calendar/calendar-conduit.c: ditto
-
-2000-10-30 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/event-editor.c (sensitize_recur_widgets): New function. We
- split it from the radio callback so that we can call it explicitly
- from fill_recurrence_widgets().
- (fill_recurrence_widgets): Call sensitize_recur_widgets() as
- appropriate.
-
-2000-10-30 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/calendar-commands.c (new_calendar): Removed the geometry and
- hidden arguments. This code is ancient.
- (all_calendars): Made static. This sucks; configuration should be
- notification-based instead of "let's iterate through all open
- calendars".
- (active_calendars): Removed. Functions can check the length of
- the all_calendars list if they are interested.
-
- * gui/event-editor.c (sync_entries): Do not take in an extra data
- pointer.
- (summary_changed_cb): Use a single call back to sync both entries.
- (sync_date_edits): New function to sync two EDateEdit widgets.
- (init_widgets): Connect the general and recurrence starting date
- widgets.
-
-2000-10-27 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/event-editor.c (sync_entries): New function.
- (general_summary_changed_cb): Sync the general summary to the
- recurrence summary widget.
- (recurrence_summary_changed_cb): Vice-versa.
- (init_widgets): Hook to the summaries.
-
- * event-editor-dialog.glade: Do not expand/fill the start and end
- date so that the "all day event" button is not pushed all the way
- to the right.
- Decrease the spacing between the recurrence sentence widgets.
- Remove a spurious empty label that was lurking around the
- recurrence widgets.
- Make the alarm widgets expand the right way.
- Delete old recurrence widgets.
-
-2000-10-27 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/event-editor.c (init_widgets): Connect to the recurrence
- ending menu.
- (recur_ending_selection_done_cb): Implemented.
- (make_recurrence_ending_special): Implemented.
- (make_recur_ending_until_special): Implemented.
- (fill_ending_date): Implemented.
- (make_recur_ending_count_special): Implemented.
- (simple_recur_to_comp_object): Fill in the ending date.
- (clear_widgets): Clear the recurrence ending widgets.
-
- * gui/event-editor-dialog.glade: Moved the recurrence type radio
- buttons to a single hbox to save space.
- Fixed the lower value of the recurrence interval spin button.
- Removed the stale widgets from the recurrence ending date part.
-
-2000-10-27 Jesse Pavel <jpavel@helixcode.com>
-
- * gui/e-meeting-edit.c: fixed problems in which I allocated CORBA
- strings of 0 length, but then didn't NULL terminate them.
-
-2000-10-27 <jpr@helixcode.com>
-
- * conduits/calendar/calendar-conduit.c (check_for_slow_setting):
- Check boundary case of fast sync
-
- * conduits/todo/todo-conduit.c (check_for_slow_setting): ditto
-
-2000-10-27 <jpr@helixcode.com>
-
- * conduits/calendar/calendar-conduit.c (add_archive_record): Remove
- invalid test.
- (local_record_from_comp): If the event is all day, mark it as timeless
- (comp_from_remote_record): Timeless events take up all day
-
- * conduits/todo/todo-conduit.c (add_archive_record): ditto
-
-2000-10-27 JP Rosevear <jpr@helixcode.com>
-
- * conduits/todo/todo-conduit.c (add_archive_record): Take proper
- number of parameters
-
- * conduits/calendar/calendar-conduit.c (add_archive_record): ditto
-
-2000-10-26 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/event-editor.c (EventEditorPrivate): Integrate Anna's new
- recurrence page. Replace the old widget pointers with the new
- ones. Modified the relevant functions accordingly and added
- plenty of new ones.
- (event_editor_get_cal_client): New function.
- (fill_recurrence_widgets): This is *THE* tricky function for you.
- It has to discriminate whether we get a recurrence we support for
- editing or not. And this is not trivial. Sigh.
- (event_editor_update_widgets): Added preconditions and API docs.
-
- * event-editor-dialog.glade: Fixed all the spacings/
- paddings/packing options so that the widgets will look right if
- the dialog box is resized. Also fixes some misaligned widgets.
-
- * cal-util/cal-component.c (cal_component_set_rdate_list): Removed
- incorrect assertion.
-
-2000-10-26 Michael Meeks <michael@helixcode.com>
-
- * pcs/cal-factory.c (str_tolower): unsigned chars to isalpha
-
- * cal-util/calobj.c (weekdaylist, weekdaynum): ditto.
-
-2000-10-25 Jesse Pavel <jpavel@helixcode.com>
-
- * gui/e-meeting-edit.c: brushed up some code to deal with
- the organizer entry, and solidified the CORBA memory-freeing
- issues.
-
-2000-10-25 Jesse Pavel <jpavel@helixcode.com>
-
- * removed the Evolution-Composer generated files, due
- to a tip on how we do things.
-
-2000-10-25 Jesse Pavel <jpavel@helixcode.com>
-
- * gui/e-meeting-edit.c: I fixed a bunch of memory-deallocation
- bugs, and finished the initial integration with the mailer.
-
- * gui/Makefile.am: made the build us the Evolution-Composer.idl
- from the composer directory.
-
-2000-10-25 Jesse Pavel <jpavel@helixcode.com>
-
- * gui/Evolution-Composer.idl: added this from the composer IDL sources
-
- * gui/Makefile.am: changed to reflect the above IDL and the associated
- orbit-idl generated files.
-
- * gui/Evolution-Composer.h,
- gui/Evolution-Composer-common.c,
- gui/Evolution-Composer-stubs.c,
- gui/Evolution-Composer-skels.c:
- the generated files, as per the above description.
-
- * gui/e-meeting-edit.c: more work towards mailer integration.
-
-2000-10-24 Jesse Pavel <jpavel@helixcode.com>
-
- * gui/e-meeting-edit.c: I've added code to interact with the mailer's
- CORBA interfaces, though it's not yet working.
-
-2000-10-23 JP Rosevear <jpr@helixcode.com>
-
- * conduits/todo/todo-conduit.c (local_record_from_comp): Use
- new e-pilot-map lookup function
- (match): ditto
-
- * conduits/calendar/calendar-conduit.c (local_record_from_comp): Use
- new e-pilot-map lookup function
- (match): ditto
-
-2000-10-23 Dan Winship <danw@helixcode.com>
-
- * pcs/Makefile.am (INCLUDES):
- * gui/dialogs/Makefile.am (INCLUDES):
- * gui/Makefile.am (INCLUDES):
- * cal-util/Makefile.am (INCLUDES):
- * cal-client/Makefile.am (INCLUDES): Update GNOMELOCALEDIR.
-
-2000-10-23 JP Rosevear <jpr@helixcode.com>
-
- * conduits/todo/todo-conduit.h: Use new libeconduit calls and
- abstraction
-
- * conduits/calendar/calendar-conduit.c: ditto
-
- * conduits/calendar/calendar-conduit.h: ditto
-
- * conduits/todo/todo-conduit.c: ditto
-
- * conduits/calendar/Makefile.am: Add libeconduit-static.la
-
- * conduits/calendar/calendar-conduit.c (post_sync): Use e_pilot_map_write
- (pre_sync): Use e_pilot_map_read
-
-2000-10-23 JP Rosevear <jpr@helixcode.com>
-
- * conduits/todo/Makefile.am: Add libeconduit-static.la
-
- * conduits/todo/todo-conduit.c (post_sync): Use e_pilot_map_write
- (pre_sync): Use e_pilot_map_read
-
-2000-10-21 Damon Chaplin <damon@helixcode.com>
-
- * gui/dialogs/cal-prefs-dialog.c
- (cal_prefs_dialog_use_24_hour_toggled): removed debug message.
-
- * gui/e-calendar-table.c (e_calendar_table_save_state): new function
- to save the state of the table to a given file.
-
- * gui/e-calendar-table.h (struct _ECalendarTable): added etable field
- so we can access it to save the state.
-
- * gui/gnome-cal.c (gnome_calendar_destroy): call
- e_calendar_table_save_state() to save the state of the TaskPad.
- (setup_widgets): load the state of the TaskPad.
-
- * gui/calendar-config.c: added support for the default view.
-
- * gui/gnome-cal.c (gnome_calendar_construct):
- (gnome_calendar_set_view_internal): use/set the default view setting.
-
-2000-10-20 Jesse Pavel <jpavel@helixcode.com>
-
- * gui/e-meeting-editor.c: added more (working) integration with the
- meeting schedular.
-
-2000-10-20 Jesse Pavel <jpavel@helixcode.com>
-
- * cal-utils/cal-component.c: in set_datetime(), I put an #if 0'd portion
- of the code back into operation, because the icalproperty_remove_parameter()
- function is now implemented.
-
- * gui/e-meeting-editor.c: added more (unworking) integration with the
- meeting schedular.
-
-2000-10-20 JP Rosevear <jpr@helixcode.com>
-
- * pcs/cal-backend.c (cal_backend_destroy): New destroy
- handler to properly stop the timer, sync the log and unref
- the URI.
- (cal_backend_last_client_gone): Just emit the signal,
- clean up work is done in cal_backend_destroy now.
-
- * pcs/cal-backend-file.c (cal_backend_file_load): Unref the
- uri we are replacing NOT the new uri.
-
-2000-10-20 JP Rosevear <jpr@helixcode.com>
-
- * conduits/todo/Makefile.am: Fix build
-
- * conduits/calendar/Makefile.am: Fix build
-
-2000-10-20 JP Rosevear <jpr@helixcode.com>
-
- * conduits/calendar/calendar-conduit.c (delete_archive_record):
- Don't throw an error
-
- * conduits/todo/todo-conduit.c (delete_archive_record): ditto
-
-2000-10-20 JP Rosevear <jpr@helixcode.com>
-
- * conduits/todo/todo-conduit-control-applet.c: Add defines
-
- * conduits/todo/todo-conduit-config.h: put #ifdefs around functions
- can't make this a public interface in the usual way as then the
- symbols would be exported
-
- * conduits/todo/todo-conduit.c: Kill warnings. clahey will be
- happy! Add some defines to include only the necessary config functions.
- (conduit_get_gpilot_conduit): Hook up archive signals
-
- * conduits/calendar/calendar-conduit.c: Same as above
-
- * conduits/calendar/calendar-conduit-control-applet.c: ditto
-
- * conduits/calendar/calendar-conduit-config.h: ditto
-
-2000-10-20 Michael Meeks <michael@helixcode.com>
-
- * gui/calendar-commands.h: s/BonoboUIHandler/BonoboUIComponent/
-
- * gui/calendar-commands.c (properties_cmd): ditto.
-
-2000-10-20 Damon Chaplin <damon@helixcode.com>
-
- * gui/calendar-model.c (calendar_model_value_at): use
- cal_component_has_alarms().
-
-2000-10-20 Damon Chaplin <damon@helixcode.com>
-
- * gui/e-calendar-table.c (E_CALENDAR_TABLE_SPEC): added
- _click-to-add-message, though I'm not sure if i18n will work.
-
- * cal-util/cal-recur.c (cal_obj_time_add_hours):
- (cal_obj_time_add_minutes):
- (cal_obj_time_add_seconds): updated to handle -ve args.
-
- * cal-util/timeutil.c (time_add_day): set tm_isdst to -1 before calling
- mktime().
-
- * cal-util/cal-recur.c (generate_instances_for_chunk): don't call the
- callback if the event ends exactly on the interval start time.
-
- * gui/e-week-view.c (e_week_view_reshape_event_span):
- * gui/e-week-view-event-item.c (e_week_view_event_item_draw_icons):
- * gui/e-day-view-top-item.c (e_day_view_top_item_draw_long_event):
- * gui/e-day-view-main-item.c (e_day_view_main_item_draw_day_event):
- * gui/e-day-view.c (e_day_view_reshape_long_event):
- (e_day_view_reshape_day_event): use cal_component_has_alarms().
-
- * cal-util/cal-component.[hc]: added cal_component_has_alarms().
-
-2000-10-16 Damon Chaplin <damon@helixcode.com>
-
- * gui/calendar-config.c (config_read): set default MonthVPanePosition
- to 1 rather than 0, so if you move the hpane you'll see the date
- navigator.
-
-2000-10-19 Jesse Pavel <jpavel@helixcode.com>
-
- * gui/event-editor.[ch]: added a public function which causes the
- event editor to reload its widgets to the associated CalComponent.
-
- * gui/e-meeting-edit.c: added rudimentary support for the phat
- e-meeting-time-selector widget, though it has no effect on the
- component yet.
-
- * gui/Makefile.am: the meeting editor depends on the meeting widget
- library, now.
-
- * gui/e-itip-control.glade: I added another toolbar button that summons
- from the hoary deep the meeting time widget.
-
-2000-10-19 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/Makefile.am: Add `event-editor-dialog.glade.h'.
- (EXTRA_DIST): Add `$(glade_messages)'.
-
-2000-10-19 Michael Meeks <michael@helixcode.com>
-
- * gui/calendar-commands.c (tb_print_cb): remove; redundant.
-
- * gui/event-editor.c (create_menu, create_toolbar): kill.
- (event_editor_destroy): upd.
- (event_editor_construct): update to new UI handler, cast
- priv->general_summary to a widget not an object.
-
-2000-10-18 Michael Meeks <michael@helixcode.com>
-
- * gui/dialogs/task-editor.c (create_menu, create_toolbar): die.
- (debug_xml_cb): add debugging hook.
-
- * gui/dialogs/Makefile.am: add EVOLUTION_DATADIR
-
- * gui/dialogs/task-editor.c (task_editor_construct): upd for new UI.
-
-2000-10-17 JP Rosevear <jpr@helixcode.com>
-
- * conduits/todo/todo-conduit-control-applet.c: Add defines
-
- * conduits/todo/todo-conduit-config.h: put #ifdefs around functions
- can't make this a public interface in the usual way as then the
- symbols would be exported
-
- * conduits/todo/todo-conduit.c: Kill warnings. clahey will be
- happy! Add some defines to include only the necessary config functions.
- (conduit_get_gpilot_conduit): Hook up archive signals
-
- * conduits/calendar/calendar-conduit.c: Same as above
-
- * conduits/calendar/calendar-conduit-control-applet.c: ditto
-
- * conduits/calendar/calendar-conduit-config.h: ditto
-
-2000-10-16 Jesse Pavel <jpavel@helixcode.com>
-
- * gui/e-itip-control.c: You can now add incoming iTip
- messages to your calendar store.
-
- * gui/e-itip-control.glade: added a progress bar dialog
- in case the calendar loading takes a long time.
-
-2000-10-16 JP Rosevear <jpr@helixcode.com>
-
- * cal-client/cal-client.h: Remove pilot cruft. All pilot stuff
- is in the conduits now and uses the logging facility.
-
- * pcs/cal-backend-file.c: ditto
-
- * pcs/cal-backend.h: ditto
-
- * pcs/cal-backend.c: ditto
-
- * pcs/cal.c: ditto
-
- * pcs/cal.h: ditto
-
- * idl/evolution-calendar.idl: ditto
-
- * cal-util/cal-component.h: ditto
-
- * cal-util/cal-component.c: ditto
-
- * cal-client/cal-client.c: ditto
-
- * conduits/calendar/calendar-conduit.c (local_record_from_comp):
- Take a stab at storing recurrence stuff on the pilot properly
-
- * pcs/cal-backend.c (cal_backend_update_object): Don't log the
- event until after the update in case its a new item
-
-2000-10-16 Tuomas Kuosmanen <tigert@helixcode.com>
-
- * gui/dayview.xpm, gui/workweekview.xpm, gui/weekview.xpm
- gui/monthview.xpm gui/yearview.xpm: Updated icons, let me know
- if you like these or not, I might work on these some more but
- I wanted to put these versions up anyway to get feedback..
-
-2000-10-15 Dan Winship <danw@helixcode.com>
-
- * gui/Makefile.am: Remove CPPFLAGS def since the -D there was
- already in INCLUDES
-
-2000-10-14 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/evolution-calendar.oafinfo: Added an
- "evolution:shell-component-icon" attribute.
-
-2000-10-12 Jesse Pavel <jpavel@helixcode.com>
-
- * gui/e-itip-control.{c,glade}: Made the control much more
- relavent to the function at hand.
-
-2000-10-12 Damon Chaplin <damon@helixcode.com>
-
- * gui/e-calendar-table.c (E_CALENDAR_TABLE_SPEC): set the 2 icon
- columns to a min width of 18 and resizable to FALSE.
-
-2000-10-12 Damon Chaplin <damon@helixcode.com>
-
- * gui/calendar-commands.c (calendar_control_activate):
- (update_pixmaps):
- (set_pixmap): set the pixmaps of the toolbar buttons for the views,
- and removed a lot of old unused stuff. We'll use plain buttons for
- the view buttons for now, until Bonobo toolbars support radio buttons.
-
- * gui/gnome-cal.c (gnome_calendar_dayjump): check day_button is not
- NULL before using it.
- (gnome_calendar_update_view_buttons): check button is not NULL.
-
-2000-10-11 Damon Chaplin <damon@helixcode.com>
-
- * gui/e-day-view-time-item.c (e_day_view_time_item_draw): got 12/24
- hour format the wrong way round.
-
-2000-10-12 JP Rosevear <jpr@helixcode.com>
-
- * conduits/calendar/calendar-conduit.c (comp_from_remote_record):
- Store recurrence stuff on the desktop properly
- (get_ical_day): Utility function
-
-2000-10-12 Iain Holmes <iain@helixcode.com>
-
- * gui/component-factory.c: Disable the executive summary.
-
-2000-10-11 JP Rosevear <jpr@helixcode.com>
-
- * pcs/cal-backend.c (cal_backend_log_entry): Take CalObjType
- as a param because its impossible to determine after a delete.
- (cal_backend_remove_object): Calculate CalObjType and pass
- it to cal_backend_log_entry
- (cal_backend_update_object): ditto
-
- * conduits/todo/todo-conduit.c (local_record_from_comp): Kill
- unused variables.
- (add_archive_record): Don't kill the sync if this happens
- (update_record): Kill old function
- (replace_record): New function to handle replace_record signal
- (conduit_get_gpilot_conduit): Listen for replace record signal
- (add_record): Always add a new record, never replace
- (replace_record): Always replace an existing record
-
- * conduits/calendar/calendar-conduit.c: Same as above
-
-2000-10-10 Jesse Pavel <jpavel@helixcode.com>
-
- * gui/e-itip-control.c: set a default size for the control.
-
-2000-10-10 Jesse Pavel <jpavel@helixcode.com>
-
- * gui/evolution-calendar.oafinfo: Added information about the
- text/calendar MIME type, so that the evolution-calendar is called
- to deal with iMIP attachments.
-
- * gui/e-itip-control.[ch]: These files implement a Bonobo
- control that will eventually deal with iMIP/iTIP messages from
- the mailer. Right now, it's not working.
-
- * gui/e-itip-control.glade: The Glade GUI for the above-mentioned
- control.
-
- * gui/Makefile.am: added references to the files I created.
-
- * gui/main.c: called the initialization function of the Bonobo
- control factory.
-
-2000-10-11 Tuomas Kuosmanen <tigert@helixcode.com>
-
- * gui/task-assigned-to.xpm gui/task-assigned.xpm
- gui/recur.xpm gui/task-recurring.xpm gui/task.xpm:
- New versions of the icons for the tasklist/pad.
-
-2000-10-11 Damon Chaplin <damon@helixcode.com>
-
- * gui/component-factory.c (owner_unset_cb): don't free evolution_dir
- as we need it to save the config settings.
-
-2000-10-11 Damon Chaplin <damon@helixcode.com>
-
- * gui/main.c (main): call calendar_config_write_on_exit() to write
- out some special config settings (as the mail component does).
-
- * gui/calendar-commands.c (properties_cmd): changed to use the new
- preferences dialog.
- (update_all_config_settings): new function to iterate over all the
- calendars and update the config settings.
-
- * gui/dialogs/cal-prefs-dialog.glade: preferences dialog.
-
- * gui/dialogs/cal-prefs-dialog.[hc]: new files for the preferences
- dialog.
-
- * gui/calendar-config.[hc]: new files to handle loading/saving config
- settings.
-
- * cal-util/cal-recur.c: fixed bug in YEARLY when no filters were set,
- plus minor changes.
-
- * cal-util/test-recur.c: updated.
-
- * gui/e-day-view-time-item.c:
- * gui/popup-menu.c: update to #include <gal/widgets/e-gui-utils.h>
-
- * gui/component-factory.c (owner_set_cb): called calendar_config_init.
- (owner_set_cb):
- (owner_unset_cb): updated the prototypes.
-
- * gui/main.c (main): added call to calendar_config_write_on_exit().
-
- * gui/component-factory.h:
- * gui/component-factory.c (owner_set_cb): added global evolution_dir
- just like the mail component, so we know we to store config stuff.
-
-2000-10-11 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/e-calendar-table.c: Fixed the column elements here.
-
-2000-10-11 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/e-calendar-table.c: Updated to use the new ETable
- specification stuff.
-
-2000-10-11 JP Rosevear <jpr@helixcode.com>
-
- * conduits/todo/todo-conduit.c (map_sax_start_element): The
- element is "pilot_id" not "pilotid". Update both maps
- (compute_pid): Utility function to set a local records pid
- (local_record_from_comp): Compute the pid and status here,
- no longer use the old cal_component pilot interfaces
- (free_match): Its a *local not a **local
-
- * conduits/calendar/calendar-conduit.c: same as above
-
- * conduits/todo/todo-conduit.h: Have both a uid and pid map
-
- * conduits/todo/calendar-conduit.h: same as above
-
-2000-10-09 JP Rosevear <jpr@helixcode.com>
-
- * conduits/*: Adjust to using gnome-pilot-sync-abs conduit which
- is based on the latest pilot link changes.
-
-2000-10-09 Iain Holmes <iain@helixcode.com>
-
- * Makefile.am: Added the executive-summary library and cflags
-
- * gui/evolution-calendar.oafinfo: Added oaf servers for the
- executive summary and executive summary factory.
-
- * gui/calendar-summary.[ch]: New files to create the summary.
-
- * gui/component-factory.c (summary_fn): Create the executive
- summary component.
- (component_factory_init): Start the summary factory as well.
-
-2000-10-06 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/weekday-picker.[ch]: New widget to pick weekdays.
-
-2000-10-05 Michael Meeks <michael@helixcode.com>
-
- * gui/calendar-commands.c: upd.
- (calendar_control_activate): upd.
- (calendar_control_deactivate): upd.
-
-2000-10-05 Damon Chaplin <damon@helixcode.com>
-
- * gui/e-day-view.c:
- * gui/e-week-view.c: when the user types in a new event, don't create
- it until the user hits Return or switches focus. Removed the
- editing_new_event flags.
-
- * cal-util/test-recur.c: rewritten to work on ics files. Now I can
- start testing the recurrence code.
-
- * cal-util/cal-recur.c: a few fixes.
-
- * gui/e-day-view.c (e_day_view_check_if_new_event_fits): fixed to
- return TRUE for long events, not FALSE.
-
-2000-10-04 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/print.c (print_todo_details): As a temporary solution to the
- to-do printing, just print the summaries. We'll use the ETable
- printing stuff later.
-
- * gui/print.c (print_day_summary_cb): Use g_list_append() correctly.
- (print_todo_details_cb): Likewise.
- (print_day_summary): Initialize psi.events. This code was
- obviously never tested.
- (print_todo_details): Likewise.
- (print_day_details): Initialize pdi.slots.
-
- * gui/print.c (range_selector_new): Fix strftime() %a versus %b
- confusion. Fixes bugzilla #644.
- (range_selector_new): Fix the whole localization mess by making
- better use of strftime(). Now we generate whole date strings at a
- time and compose them later. Fixes bugzilla #643.
-
-2000-10-02 Jesse Pavel <jpavel@helixcode.com>
-
- * gui/e-meeting-edit.c: added support for the ROLE and RSVP parameters
- in both the GUI and underlying iCal.
-
-2000-09-29 Jesse Pavel <jpavel@helixcode.com>
-
- * gui/e-meeting-edit.c: added support for organizers in the meeting
- scheduler.
-
-2000-09-29 Jesse Pavel <jpavel@helixcode.com>
-
- * gui/e-meeting-edit.c: added code that makes changes to the underlying
- iCAL structure of an event, when the user changes meeting information.
-
- * gui/e-meeting-dialog.glade: this is the Glade UI for the meeting dialog
- and accoutrements.
-
-2000-09-29 Damon Chaplin <damon@helixcode.com>
-
- * cal-util/cal-recur.c: updated to support RDATE end times or
- durations. Note that if you have two RDATEs with the same start times,
- but with different end dates/durations set, the results are
- unpredictable. So the event editor dialog should check for this.
-
- * gui/e-week-view-main-item.c (e_week_view_main_item_draw_day):
- make strftime() strings translatable, and changed the formats a bit.
-
- * NOTE: someone needs to check print.c to make sure strftime strings
- are OK for i18n.
-
- * gui/e-day-view.h: Changed EDayViewDateFormat enum. We now try to
- include the weekday if possible. Also changed EDayView struct so we
- store the month & weekdays with the longest names rather than the
- actual widths. This helps i18n.
-
- * gui/e-day-view.c (e_day_view_recalc_cell_sizes): used _() for
- strftime strings, tried to see if weekday fits, and rearranged a
- bit to make i18n easier.
-
- * gui/e-day-view-top-item.c (e_day_view_top_item_draw): used _() for
- strftime strings, and updated to use new formats.
-
- * gui/calendar-model.c: added use_24_hour_format boolean to
- CalendarModelPrivate so we can display dates in 12-hour format if
- requested. This meant adding a CalendarModel argument to a few
- functions. Also added get/set functions to set use_24_hour_format.
- I suppose ideally we should have an ECellDate renderer and this option
- should go there.
-
-2000-09-27 Jesse Pavel <jpavel@helixcode.com>
-
- * gui/event-editor.c: changed a menu entry so that it will invoke
- my meeting editor.
-
- * gui/e-meeting-edit.[ch]: added these files to provide preliminary
- support for iTIP meeting scheduling. Currently, only the GUI works;
- there is not yet any backend support.
-
- * gui/Makefile.am: added entries for e-meeting-edit.[ch]
-
-2000-09-24 Damon Chaplin <damon@helixcode.com>
-
- * gui/dialogs/task-editor-dialog.glade: set the height of the scrolled
- window for the description field, since the default window height
- doesn't seem to be working.
-
- * cal-util/cal-component.h: added functions to get the actual
- icalproperty lists for RRULE and EXRULE properties.
-
- * cal-util/cal-recur.[hc]: added support for COUNT, though I need to
- test it a bit. Also fixed the call to generate_instances_for_year() so
- it uses the chunk dates.
-
-2000-09-20 Damon Chaplin <damon@helixcode.com>
-
- * gui/event-editor.c: got rid of 1 '_' in '__Formatting'.
-
-2000-09-22 Michael Meeks <michael@helixcode.com>
-
- * gui/calendar-commands.c (calendar_control_activate): upd.
-
-2000-09-21 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/calendar-commands.c (verbs): Removed the "about calendar"
- command, since we don't want to have both "About Evolution" and
- "About Calendar".
-
-2000-09-21 Michael Meeks <michael@helixcode.com>
-
- * gui/calendar-commands.c (calendar_control_activate): _UIHandler
- update.
-
-2000-09-20 JP Rosevear <jpr@helixcode.com>
-
- * conduits/todo/todo-conduit.c (pre_sync): Don't fail if there
- is no map file.
-
-2000-09-20 JP Rosevear <jpr@helixcode.com>
-
- * conduits/todo/todo-conduit.h: Add since field to context
-
- * conduits/todo/todo-conduit.c (map_set_node_timet): New utility
- function
- (map_sax_start_element): Look for the map timestamp as well
- (map_write): Write the map timestamp
- (pre_sync): Use the map time stamp when looking for changed entries
-
- * pcs/cal-backend.c (cal_backend_log_sax_start_element): Make sure
- we are in a valid timestamp
-
-2000-09-20 JP Rosevear <jpr@helixcode.com>
-
- * pcs/cal-backend.c (cal_backend_log_name): Make the log file
- name relevant to the actual calendar file, rather than just the
- directory.
-
-2000-09-20 JP Rosevear <jpr@helixcode.com>
-
- * pcs/cal-backend.c (cal_backend_get_log_entries): Oops
-
-2000-09-20 JP Rosevear <jpr@helixcode.com>
-
- * pcs/cal-backend.c (cal_backend_get_log_entries): Use a local
- sax handler.
-
- * conduits/todo/todo-conduit.c (pre_sync): Use xmlSAXParseFile
- (map_sax_parse): Delete
-
-2000-09-20 JP Rosevear <jpr@helixcode.com>
-
- * pcs/cal-backend.c (cal_backend_log_sax_start_element): Properly
- assign the CalObjChange type.
- (cal_backend_log_sax_parse): Delete
- (cal_backend_get_log_entries): Use xmlSAXUserParseFile
-
-2000-09-19 JP Rosevear <jpr@helixcode.com>
-
- * pcs/cal-backend.c (cal_backend_set_uri): New utility function
- (cal_backend_load): use above
- (cal_backend_create): use above
- (cal_backend_log_name): Take a uri instead of a backend param
-
- * pcs/cal-backend-file.c: Get rid of useless hash functions
- (cal_backend_file_load): Check to make sure path exists and is
- local
- (cal_backend_file_load): Unref the current uri if there is one
- (cal_backend_file_create): ditto
-
- * pcs/cal-backend.c (cal_backend_last_client_gone): Sync before
- shooting ourselves in the foot
-
- * pcs/cal-backend-file.c (save): Fully implement backing up the
- calendar before writing out the new entry.
-
-2000-09-19 JP Rosevear <jpr@helixcode.com>
-
- * conduits/todo/todo-conduit.c (check_for_slow_setting): Add some
- other cases where a slow sync is in order
- (pre_sync): Pre load the uids, the map and the add/mod/del lists
- (match_record): Use the map hash to match records
- (iterate): Iterate using the pre-loaded uid list
- (iterate_specific): Iterate using the add/mod/del lists
- (purge): Delete all entries in the del list
- (set_status): Set status by adding to an appropriate list
- (set_pilot_id): Set pilot_id by updating map hash
-
- * conduits/todo/todo-conduit.h: Add lists for added, modified and
- deleted objects
-
- * conduits/todo/todo-conduit.c (map_name): Get the pilot_id->uid map
- file name
- (map_sax_start_element): SAX handler to extract a pilot_id->uid
- mapping
- (map_sax_parse): Parse the given file and build a pilot_id->uid hash
- (map_write_foreach): Write out individual mapping elements
- (map_write): Write out the pilot_id->uid mapping
- (start_calendar_server_cb): Rename from gnome_calendar_load_cb
-
- * conduits/todo/todo-conduit-config.h: Rename pilotID to pilot_id
-
- * conduits/todo/e-todo.conduit.in: A little renaming
-
- * conduits/todo/Makefile.am: Fix build slightly
-
- * pcs/cal.c (build_change_seq): Build a corba sequence out of a list
- of CalObjChanges
- (Cal_get_objects_in_range): Implement new corba function
-
- * pcs/cal-backend.c (cal_backend_init): Intiliaze to NULL
- (cal_backend_load): Track the uri so we can write the log file
- to the same place
- (cal_backend_log_name): Figure out the log filename/path based on
- the calendar uri
- (cal_backend_set_node_timet): Set an xml node property value from
- a time_t
- (cal_backend_log_entry): Adds a log entry to list waiting to be written
- out
- (cal_backend_log_sync): Syncs the log entries to disk
- (cal_backend_log_sax_start_element): SAX callback for reading in
- log entries
- (cal_backend_log_sax_end_element): ditto
- (cal_backend_log_sax_parse): Main SAX parser call to parse the log
- file looking for particular log entries and creating a CalObjChange
- hash with the last change for each object
- (cal_backend_get_log_entries): Returns a hash of objects of a given
- type changed since the given time
- (cal_backend_update_object): Add appropriate log entries
- (cal_backend_remove_object): ditto
- (cal_backend_get_changed_uids): Implement new idl interface call
- (cal_backend_foreach_changed): Convert CalObjChange hash into a list
-
- * pcs/cal-backend-imc.[hc]: Remove crufty files
-
- * pcs/cal-backend-file.c (cal_backend_file_get_type_by_uid): New
- function that returns the CalObjType for a uid.
-
- * cal-client/cal-client.h: Update prototypes.
-
- * cal-client/cal-client.c (build_change_list): Build a list
- of CalObjChange items from a corba sequence.
- (cal_client_get_changed_uids): New accessor method for the
- similarly named addition to the idl file.
-
- * cal-util/cal-util.h: Update prototypes and add CalObjChangeType
- enum.
-
- * cal-util/cal-util.c (cal_obj_change_list_free): New utility
- method to free a list of CalObjChange objects.
-
- * idl/evolution-calendar.idl: Add get_changed_uids method
- and associated types.
-
-2000-09-18 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/Makefile.am: Added $(EXTRA_GNOME_CFLAGS) and
- $(EXTRA_GNOME_LIBS). Removed unneeded libraries.
-
- * gui/calendar-model.h, gui/e-calendar-table.c, gui/e-day-view.c,
- gui/e-week-view-event-item.c, gui/e-week-view.c,
- gui/event-editor.c, gui/gncal-todo.c, gui/gnome-cal.c, gui/main.c,
- gui/print.c, gui/dialogs/task-editor.c: Fixed the #include lines
- to deal properly with gal.
-
- * gui/check-filled.xpm: New file since we can't include it from
- e-table anymore.
-
-2000-09-16 Michael Meeks <michael@helixcode.com>
-
- * gui/Makefile.am (INCLUDES): add datadir
-
- * gui/calendar-commands.c (calendar_control_activate): use it.
-
-2000-09-14 JP Rosevear <jpr@helixcode.com>
-
- * conduits/todo/.cvsignore: Shush
-
-2000-09-14 JP Rosevear <jpr@helixcode.com>
-
- * Add headers with GPL notice and credit copyright to those appropriate
-
- * conduits/todo/todo-conduit-control-applet.c (doHelp): Update name,
- authors, copyright for about dialog.
- (activate_sync_type): Tidy
-
- * conduits/todo/Makefile.am: Rename binaries and libs to e-todo*
- to avoid conflicts.
-
- * conduits/todo/e-todo.conduit.in: Reflect binary/lib name changes
-
- * conduits/todo/e-todo-conduit-control-applet.desktop: ditto
-
- * conduits/todo/todo.conduit.in: Removed
-
- * conduits/todo/todo-conduit-control-applet.desktop: Removed
-
- * conduits/todo/todo-conduit-config.h (todoconduit_load_configuration):
- The config file will now be called e-todo-conduit
- (todoconduit_save_configuration): ditto
-
- * conduits/todo/todo-conduit.c: Some renaming to keep consistent.
- (pre_sync): Remove commented out function that does not exist.
-
- * conduits/todo/todo-conduit-control-applet.c: ditto
-
- * conduits/todo/todo-conduit-config.h: ditto
-
- * conduits/todo/todo-conduit.h: ditto
-
-
-2000-09-07 Michael Meeks <michael@helixcode.com>
-
- * gui/calendar-commands.c: Re-write most UI handler code.
-
-2000-09-13 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/calendar-model.c (obj_updated_cb): Removed an unused
- variable.
-
- * gui/calendar-model.c (obj_updated_cb): See if the new object
- matches the type of objects we were told to deal with.
- (load_objects): Likewise.
-
-2000-09-13 JP Rosevear <jpr@helixcode.com>
-
- * pcs/cal-backend-file.c (remove_component): Only remove the pilot
- item from the hash if it exists in the first place.
-
-2000-09-12 JP Rosevear <jpr@helixcode.com>
-
- * pcs/cal-backend-file.c (add_component): plug leakage
-
-2000-09-12 JP Rosevear <jpr@helixcode.com>
-
- * conduits/calendar/calendar-conduit.c: Hack to compile for distcheck.
-
- * conduits/calendar/calendar-conduit.h: Remove calobj.h dependency
-
-2000-09-12 JP Rosevear <jpr@helixcode.com>
-
- * pcs/cal-backend-file.c (cal_backend_file_load): Use g_int_*
- for now
- (cal_backend_file_create): ditto
-
- * conduits/todo/todo-conduit.c (local_record_from_compobject): Make
- this actually fill in the todo record.
- (find_record_in_repository): Add debug stuff
- (iterate_specific): Use the already exisiting utility function
-
- * pcs/cal-backend-file.c (cal_backend_file_update_pilot_id): correct
- the status and id types. g_strdup the uid since this is not a
- constified return
- (cal_backend_file_get_uid_by_pilot_id): correct the id type
-
-2000-09-12 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/Makefile.am: Remove `ui.xml' stuff.
-
- * pcs/cal-backend.c: Dont' #include calobj.h anymore as it's gone.
-
-2000-09-12 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/gnome-cal.c (gnome_calendar_construct): Connect to the
- "cal_loaded" signal of the client here.
- (connect_load): Removed function.
- (disconnect_load): Removed function.
- (cal_loaded_cb): Store the URI we are loading in the GnomeCal
- structure instead of in a weird closure. This gets rid of the
- connect/disconnect mess as well.
- (gnome_calendar_open): Store the URI in the GnomeCal.
-
-2000-09-11 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/e-day-view.c: Fixed a warning (removed unused variable
- gfloat width from e_day_view_get_event_position.)
-
-2000-09-11 JP Rosevear <jpr@helixcode.com>
-
- * conduits/todo/todo-conduit.c: Handle renaming, header cleanup
-
- * conduits/todo/todo-conduit.h: Rename GCalLocalRecord to
- EToDoLocalRecord, header cleanup
-
-2000-09-11 JP Rosevear <jpr@helixcode.com>
-
- * conduits/todo/todo-conduit.c (comp_from_remote_record): Use
- description list instead of comment list for pilot todo note
- (transmit): Check for null cal component properties, set priority
- correctly, use description list instead of comment list. Make
- pilot record private when appropriate.
-
-2000-09-10 JP Rosevear <jpr@helixcode.com>
-
- * conduits/todo/todo-conduit.c (comp_from_remote_record): Only
- set the due date only if it exists
-
-2000-09-10 JP Rosevear <jpr@helixcode.com>
-
- * gui/calendar-model.c (get_is_complete): Relying on the status
- field is somewhat faulty since it is related to group scheduling
-
-2000-09-10 JP Rosevear <jpr@helixcode.com>
-
- * conduits/todo/todo-conduit.c (update_calendar_entry_in_repository):
- Make log output a little more sensible
- (comp_from_remote_record): Minor correction when making a CalComponent
- from scratch.
- (update_record): Use comp_from_remote_record for new items, rather
- than repeating the code here.
-
-2000-09-10 JP Rosevear <jpr@helixcode.com>
-
- * conduits/todo/todo-conduit.c: Remove catch_ret_val function
- since its no longer useful. Fix naming of various fields from
- the header changes. Use GnomePilotRecord* stuff instead of
- ICAL_PILOT_SYNC_*
- (e_todo_context_new): Rename from gcalconduit_new_context. Now takes
- a pilot id and loads the configuration here
- (e_todo_context_destroy): Rename from gcalconduit_destroy_context.
- Unref the client and destroy the configuration if they exist here
- (start_calendar_server): Change the default calendar name
- (local_record_from_comp_uid): Rename from local_record_from_ical_uid
- (local_record_from_compobject): Rename from
- local_record_from_icalobject. Properly do the pilot id and status.
- (comp_from_remote_record): Rename from ical_from_remote_record.
- Handle due, complete, classification and pilot stuff properly
- (pre_sync): Remove some old stuff. We need to figure out how to
- set some of the field values.
- (set_status): Reflect pilot status changes from above
- (conduit_destroy_gpilot_conduit): Remove cleanup stuff that is
- now done by e_todo_context_destroy
- (conduit_get_gpilot_conduit): Only set the context as object
- data of the conduit.
-
- * conduits/todo/todo-conduit.h: Rename GCalConduitContext to
- EToDoConduitContext. Remove some unused struct fields.
- For GCalLocalRecord, rename ical to comp.
-
-2000-09-11 Damon Chaplin <damon@helixcode.com>
-
- * gui/dialogs/task-editor.c: changed to use EDateEdit.
-
- * gui/dialogs/task-editor-dialog.glade: added "None" option to
- Classification option menu, and used custom widgets for the date
- entries so we can use EDateEdit widgets.
-
- * gui/event-editor.c: changed to use EDateEdit. Note that this needs
- to be fixed at some point to handle invalid dates, i.e. when
- e_date_edit_get_time returns -1.
-
- * gui/calendar-model.c (ensure_task_complete):
- (ensure_task_not_complete): new functions to set the related properties
- to make sure a task is marked as complete on not, i.e. "Date Completed"
- "Status" and "Percent" properties.
-
-2000-09-08 Damon Chaplin <damon@helixcode.com>
-
- * gui/calendar-model.c (get_is_complete): use the status field rather
- than the completed date, as it is more reliable.
- (get_is_overdue): use get_is_complete().
- (calendar_model_mark_task_complete): check if it is already complete,
- and if so don't update it.
-
- * cal-util/cal-component.c (cal_component_get_status):
- (cal_component_set_status): added functions to support the STATUS
- property. Also added the property to CalComponentPrivate and set it
- to NULL in free_icalcomponent(). Someone should check my code as I've
- mainly done a Cut & Paste job.
-
-2000-09-10 JP Rosevear <jpr@helixcode.com>
- * conduits/todo/todo-conduit.c: Convert "//" style comments
- (local_record_from_ical_uid): Remove iCalObject cruft
- (ical_from_remote_record): ditto
- (free_match): Properly unref the CalComponent
-
-2000-09-10 JP Rosevear <jpr@helixcode.com>
-
- * conduits/todo/todo-conduit.c (local_record_from_icalobject): Use
- cal component pilot stuff properly
- (find_record_in_repository): Remove cruft
- (ical_from_remote_record): Remove cruft
- (update_record): Set the vtype immediately after creation. Remove cruft
-
- * conduits/todo/todo-conduit.h: Remove iCalObject stuff
-
- * conduits/todo/todo-conduit-config.h: Move all the config stuff
- here, I need to kill the warnings at some point
-
- * conduits/todo/todo-conduit-control-applet.c (doRevertSettings):
- Set all the state variables correctly on a revert
- (doSaveSettings): Update original state
- (doHelp): Rename from about_cb
- (main): Destroy configurations when done
-
- * conduits/todo/Makefile.am: Tidy
-
- * pcs/cal-backend-file.c (cbf_pilot_hash): Function for hashing
- pilot ids
- (cbf_pilot_equal): For hash table of pilot ids
- (cal_backend_file_destroy): Destroy pilot id hash
- (add_component): Insert the uid into the pilot hash
- (remove_component): Remove the uid from the pilot hash
- (cal_backend_file_load): Create the pilot hash
- (cal_backend_file_create): ditto
- (cal_backend_file_get_uid_by_pilot_id): Implement using the pilot hash
- (cal_backend_file_update_pilot_id): ditto
-
- * cal-util/cal-component.h: Update prototypes
-
- * cal-util/cal-component.c (cal_component_get_pilot_id): Implement
- using ical X properties
- (cal_component_set_pilot_id): ditto
- (cal_component_get_pilot_status): ditto
- (cal_component_set_pilot_status): ditto
- (cal_component_free_pilot_id): Free a pilot id
- (cal_component_free_pilot_status): Free a pilot status
-
-2000-09-09 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/dialogs/Makefile.am (INCLUDES): Add
- `-I$(top_builddir)/libical/src/libical' so that we get
- `icalversion.h' from the build directory instead of taking it from
- the installation directory, which is of course Wrong (tm).
- * gui/Makefile.am (INCLUDES): Likewise.
-
-2000-09-08 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/gnome-cal.c (cal_loaded_cb): New function with the
- loading/creation state machine. It is carefully modelled after
- the state machine that started the Universe, so bow before it.
- (gnome_calendar_construct): Do not connect to cal_loaded here.
- (connect_load): The closure for the cal_loaded callback is a bit
- tricky, so provide a function to create it and connect to the
- signal.
- (disconnect_load): Disconnect from the signal and free the
- closure.
- (gnome_calendar_load_cb): Removed obsolete buggy function.
- (gnome_calendar_open): Use the new mechanism.
-
- * gui/control-factory.c (set_prop): The default filename is now
- calendar.ics.
-
-2000-09-08 JP Rosevear <jpr@helixcode.com>
-
- * conduits/calendar/calendar-conduit.c (transmit): Use
- icaltime_as_timet
-
-2000-09-08 Christopher James Lahey <clahey@helixcode.com>
-
- * cal-util/cal-recur.c, gui/e-day-view.c, gui/e-week-view.c,
- gui/event-editor.c, gui/getdate.y, gui/gncal-todo.c,
- gui/gnome-cal.c, gui/dialogs/task-editor.c: Fixed some warnings.
-
-2000-09-08 JP Rosevear <jpr@helixcode.com>
-
- * conduits/calendar/Makefile.am: Tidy
-
- * conduits/todo/Makefile.am: Tidy
-
-2000-09-08 Federico Mena Quintero <federico@helixcode.com>
-
- Fall equinox cleanup!
-
- OK, I know the equinox is not here yet, but weather has changed
- enough to warrant it.
-
- Sigh. This place is definitely not the tropics.
-
- * gui/gnome-cal.c (obj_updated_cb): Renamed from
- gnome_calendar_object_updated_cb(); fixed prototype.
- (obj_removed_cb): Renamed from gnome_calendar_object_removed_cb();
- fixed prototype.
- (GnomeCalendarPrivate): Moved all the GnomeCalendar fields to a
- private structure so I don't have to rebuild the whole calendar
- GUI directory every time something changes in the object.
- (GnomeCalendarPrivate): Removed the property bag and the control
- fields; they are local to the control-factory now.
- (gnome_calendar_update_view_buttons): Remove the
- ignore_view_button_clicks mess and just block the signal.
- (gnome_calendar_set_view): Added a "focus" argument to indicate
- whether we want the main widget in the specified view to grab the
- focus.
- (gnome_calendar_set_view_internal): Handle the focus argument here.
- (gnome_calendar_set_view_buttons): Temporary hack to notify the
- calendar about its buttons.
- (gnome_calendar_get_selected_time_range): New function.
- (gnome_calendar_get_cal_client): New function.
-
- * gui/control-factory.c (calendar_properties_init): Keep the
- property bag local to here; it does not need to be in the calendar
- object yet.
- (control_factory_fn): Renamed from control_factory(). Just use
- control_factory_new_control().
- (control_factory_new_control): Moved the stuff over from
- create_control(), and keep the control local to here. Check the
- return value of bonobo_control_new().
-
- * gui/calendar-commands.c (show_day_view_clicked): Remove the
- ignore_view_button_clicks mess.
- (new_calendar): Removed the useless "page" argument.
- (calendar_control_activate): Use gnome_calendar_set_view_buttons()
- for now.
-
-2000-09-07 Lauris Kaplinski <lauris@helixcode.com>
-
- * cal-client/Makefile.am: Added -lunicode
-
- * gui/dialogs/task-editor.c: More UTF-8 wrappers
- (priority_index_to_value): Kill warning, add assertion
-
-2000-09-06 JP Rosevear <jpr@helixcode.com>
-
- * gui/e-day-view-main-item.c (e_day_view_main_item_draw_day_event):
- Use new cal_component_has_recurrences convenience function
-
- * gui/e-week-view.c (e_week_view_show_popup_menu): ditto
-
- * gui/e-week-view-event-item.c (e_week_view_event_item_draw_icons):
- ditto
-
- * gui/calendar-model.c (calendar_model_value_at): ditto
- (calendar_model_value_at): ditto
-
- * gui/e-day-view.c (e_day_view_on_event_click): ditto
- (e_day_view_on_event_right_click): ditto
- (e_day_view_on_top_canvas_motion): ditto
- (e_day_view_on_top_canvas_motion): ditto
- (e_day_view_on_main_canvas_motion): ditto
- (e_day_view_on_main_canvas_motion): ditto
- (e_day_view_reshape_day_event): ditto
-
- * gui/e-day-view-top-item.c (e_day_view_top_item_draw_long_event):
- ditto
-
- * gui/e-day-view.c (e_day_view_on_long_event_click): ditto
-
-2000-09-06 JP Rosevear <jpr@helixcode.com>
-
- * cal-util/cal-recur.c (cal_recur_generate_instances): Use
- new convenience functions and only get the recurrence
- stuff if needed. Free the recurrence stuff if used.
-
-2000-09-05 JP Rosevear <jpr@helixcode.com>
-
- * cal-util/cal-component.h: Add new prototypes
-
- * cal-util/cal-component.c (cal_component_has_exrules): Utility
- function to determine whether a cal component has any exrules
- (cal_component_has_exdates): Ditto for exdates
- (cal_component_has_exceptions): Utility function to determine
- whether a cal component has any exception rules
- (cal_component_has_recurrences):Utility function to determine
- whether a cal component has any recurrence rules
-
-2000-09-05 JP Rosevear <jpr@helixcode.com>
-
- * gui/event-editor.c (dialog_to_comp_object): Kill all exdates if
- there are no dates in the box
-
- * cal-util/cal-recur.c (generate_instances_for_year): Add a special
- case for when there are exceptions but no rrules or rdates.
- (cal_obj_remove_exceptions): Use date only compare func
- (cal_obj_date_only_compare_func): New compare function that
- compares the date only, not the time.
-
- * gui/event-editor.c (dialog_to_comp_object): Need a break for the
- yearly recurrence type
- (dialog_to_comp_object): We need to allocate icaltimetypes for the
- exdate list
- (fill_widgets): Handle a weekly recurrence with no particular day set
- (dialog_to_comp_object): Kill all rrules if "None" is selected as
- the recurrence type by the user
-
-2000-09-06 Damon Chaplin <damon@helixcode.com>
-
- * gui/e-calendar-table.c (e_calendar_table_open_task): uses the new
- TaskEditor dialog.
-
- * gui/dialogs/task-editor.[hc]:
- * gui/dialogs/task-editor-dialog.glade: updated. Still need to fix the
- 'Status' property (CalComponent doesn't support it yet), and use a
- replacement for GnomeDateEdit, since we need to support setting 'None'
- as the date.
-
-2000-09-04 Damon Chaplin <damon@helixcode.com>
-
- * gui/event-editor.c (obj_updated_cb):
- (obj_removed_cb): compare the updated object's uid with the one we
- are editing, and just return if it doesn't match.
-
-2000-09-01 Damon Chaplin <damon@helixcode.com>
-
- * gui/gnome-cal.c (gnome_calendar_tag_calendar): added check to see
- if the client has loaded successfully. Gets rid of a few warnings.
-
-2000-09-05 JP Rosevear <jpr@helixcode.com>
-
- * cal-util/cal-recur.c (generate_instances_for_year): The exdate
- and rdate lists are a list of icaltimetypes, not CalComponentPeriods
-
- * gui/e-day-view.c (e_day_view_on_delete_occurrence): The exdate list
- is a list of icaltimetypes, not CalComponentDateTimes
-
-2000-09-05 JP Rosevear <jpr@helixcode.com>
-
- * gui/e-day-view.c (e_day_view_on_delete_occurrence): Append
- the exdate to the list AFTER we create the date value.
-
-2000-09-05 JP Rosevear <jpr@helixcode.com>
-
- * cal-util/cal-component.c (cal_component_free_recur_list): Free
- the data, not the list element.
-
-2000-09-05 JP Rosevear <jpr@helixcode.com>
-
- * cal-util/cal-recur.c (cal_recur_generate_instances): Compute
- the event duration using the event start/end times, not the
- interval times.
-
-2000-09-05 JP Rosevear <jpr@helixcode.com>
-
- * cal-util/cal-recur.c (cal_recur_from_icalrecurrencetype): Check
- to see if r->enddate is (time_t)-1 and set to 0 if so
-
-2000-09-02 Ettore Perazzoli <ettore@helixcode.com>
-
- * conduits/calendar/Makefile.am (INCLUDES): Add libical include
- directories and `$(BONOBO_GNOME_CFLAGS)'.
- * conduits/todo/Makefile.am (INCLUDES): Likewise.
-
-2000-09-02 Lauris Kaplinski <lauris@helixcode.com>
-
- * gui/event-editor.c: e_utf8 wrappers
-
- * gui/gncal-todo.c: e_utf8_wrappers
-
-2000-09-02 Christopher James Lahey <clahey@helixcode.com>
-
- * conduits/calendar/calendar-conduit.c,
- conduits/todo/todo-conduit.c, gui/e-week-view.c, gui/gnome-cal.c:
- Fixed some warnings.
-
-2000-09-01 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/gnome-cal.c (gnome_calendar_new): Use
- gnome_calendar_construct() so that we can check for proper
- creation of the client.
- (gnome_calendar_destroy): Check that the client exists before we
- unref it.
- (gnome_calendar_construct): Do the CalClient creation here. Bind
- the views to it here as well instead of in setup_widgets().
- (gnome_calendar_init): Call setup_widgets() here.
-
- * gui/e-calendar-table.c (e_calendar_table_destroy): Unref the
- model.
-
-2000-09-01 JP Rosevear <jpr@helixcode.com>
-
- * conduits/todo/todo-conduit.c: Update for new libical.
- Conduits should atleast compile now.
-
- * conduits/calendar/calendar-conduit.c: ditto
-
- * Makefile.am: Build the conduits only when they've been
- enabled.
-
-2000-09-01 JP Rosevear <jpr@helixcode.com>
-
- * gui/event-editor.c: Make toolbar save and close button.
- We should put a similar menu option in sometime.
-
-2000-08-31 JP Rosevear <jpr@helixcode.com>
-
- * cal-util/cal-recur.c (array_to_list): Use
- ICAL_RECURRENCE_ARRAY_MAX instead of MAX_SHORT
-
-2000-08-31 JP Rosevear <jpr@helixcode.com>
-
- * gui/event-editor.c (file_delete_cb): Implement delete option
- (dialog_to_comp_object): Set the weekday start value and use
- local not UTC time
-
-2000-08-31 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/event-editor.c (file_delete_cb): No need to spit a warning
- if removal fails.
- (event_editor_destroy): Free the exception clist data. Unref the
- calendar client here.
- (close_dialog): Just call gtk_object_destroy() on the event
- editor; the destroy handler will free everything else.
-
- * cal-client/cal-client.c (cal_client_object_exists): Removed
- function; this is not useful because we operate asynchronously.
-
- * gui/e-day-view.c (e_day_view_on_delete_appointment): No need to
- spit a warning if removal fails.
-
- * gui/e-week-view.c (e_week_view_on_delete_appointment): Likewise.
-
- * gui/calendar-model.c (calendar_model_delete_task): Likewise.
-
-2000-08-31 JP Rosevear <jpr@helixcode.com>
-
- * gui/event-editor.c (file_delete_cb): Implement delete option
- (recurrence_toggled): Make an ugly hack to get the recurrence
- pages showing properly since we don't yet implement all of the
- recurrence rule stuff.
-
- * cal-client/cal-client.c (cal_client_object_exists): New function
- to see if an object exists and is obtainable from the backend
-
- * cal-client/cal-client.h: Add prototype
-
-2000-08-31 JP Rosevear <jpr@helixcode.com>
-
- * gui/gnome-cal.c (editor_closed_cb): Event editor destroyed
- callback to do hash cleanup
- (gnome_calendar_edit_object): Set event editor calendar client.
-
- * gui/event-editor.h: Add new prototype
-
- * gui/event-editor.c: Trash signal stuff. We will manipulate
- the client directly. Make the toolbar save and menu save items
- work identically. Add icons to the toolbar.
- (save_event_object): Call cal_client_update_object
- (close_dialog): Unref the client and disconnect signals
- Actually destroy the event editor object.
- (obj_updated_cb): New function. Doesn't really do anything
- yet but it will inform the user the event has changed elsewhere
- in the future.
- (obj_removed_cb): ditto
- (event_editor_set_cal_client): New function to set the calendar
- client
-
- * gui/gnome-cal.c (gnome_calendar_new_appointment): Commit
- the sequence to the cal component and use non UTC times.
-
-2000-08-30 Lauris Kaplinski <lauris@helixcode.com>
-
- * gui/print.c: Countless small changes for gnome-print 0.21+
-
-2000-08-30 Damon Chaplin <damon@helixcode.com>
-
- * gui/e-day-view.[hc]:
- * gui/e-day-view-main-item.c:
- * gui/e-week-view.[hc]:
- * gui/e-week-view-main-item.c:
- * gui/calendar-commands.c:
- * gui/gnome-cal.[hc]: switched to using new ECalendar widget,
- and a few other fixes.
-
-2000-08-30 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/gnome-cal.h (GnomeCal): Removed unused field event_editor.
-
- * gui/e-day-view.c (e_day_view_key_press): Oops, set the
- dtstart/dtend on the component before adding it.
- (e_day_view_on_editing_stopped): No need to check for an UID.
- Update the summary properly.
-
-2000-08-30 JP Rosevear <jpr@helixcode.com>
-
- * gui/e-week-view.c: Make sure the is_utc flag is always
- FALSE for icaltime_from_timet
- (e_week_view_on_unrecur_appointment): Use icaltimetype struct
- from the stack and make sure tzid is always NULL
- (e_week_view_key_press): ditto
-
-2000-08-30 JP Rosevear <jpr@helixcode.com>
-
- * gui/e-day-view.c: Make sure the is_utc flag is always
- FALSE for icaltime_from_timet
- (e_day_view_on_unrecur_appointment): Use icaltimetype struct
- from the stack and make sure tzid is always NULL
- (e_day_view_finish_long_event_resize): ditto
- (e_day_view_finish_resize): ditto
- (e_day_view_on_top_canvas_drag_data_received): ditto
- (e_day_view_on_main_canvas_drag_data_received): ditto
-
-2000-08-30 JP Rosevear <jpr@helixcode.com>
-
- * cal-client/cal-client.c (add_instance): Actually add the
- comp_instance struct to the instances list. We now appear
- to able to keep events and todos between sessions. Yay!
-
-2000-08-29 Federico Mena Quintero <federico@helixcode.com>
-
- Now the views monitor the client by themselves; it does not make
- sense to proxy all notifications through the GnomeCal. The
- GnomeCal should just be a meta-widget that holds all the views.
-
- At some later point we'll want to decouple the views from the
- GnomeCal so that they can be embedded anywhere; they should emit
- signals to request appropriate actions from the toplevel GUI
- instead of calling the GnomeCal directly.
-
- * gui/e-day-view.c (e_day_view_set_cal_client): New function; now
- the day view monitors the client by itself.
- (cal_loaded_cb): New callback; moved over from
- e_day_view_update_all_events().
- (obj_updated_cb): New callback; moved over from
- e_day_view_update_event().
- (obj_removed_cb): New callback; moved over from
- e_day_view_remove_event().
- (e_day_view_update_all_events): Removed function.
- (e_day_view_update_event): Removed function.
- (e_day_view_remove_event): Removed function.
- (*): Use the day_view->client directly instead of fetching it from
- the GnomeCal.
- (e_day_view_destroy): Unref the client.
- (e_day_view_reload_events): Check if the client is loaded.
- (e_day_view_key_press): Set the vtype of the new component.
-
- * gui/e-week-view.c (e_week_view_set_cal_client): New function.
- (cal_loaded_cb): New callback.
- (obj_updated_cb): New callback.
- (obj_removed_cb): New callback.
- (e_week_view_update_all_events): Removed function.
- (e_week_view_update_event): Removed function.
- (e_week_view_remove_event): Removed function.
- (*): Use the week_view->client directly.
- (e_week_view_destroy): Unref the client.
- (e_week_view_reload_events): Check if the client is loaded.
-
- * gui/gnome-cal.c (setup_widgets): Set the cal_client on all the
- views.
- (gnome_calendar_update_all): Do not update the views, since now
- they do it themselves.
- (gnome_calendar_object_updated_cb): Likewise.
- (gnome_calendar_object_removed_cb): Likewise.
- (setup_widgets): Remove all to-do list cruft.
- (gnome_calendar_colors_changed): Likewise.
- (gnome_calendar_todo_properties_changed): Likewise.
-
- * gui/calendar-commands.h (todo_style_changed): Removed variable.
-
- * gui/gncal-todo.c: Removed old clist cruft; just left in the
- temporary dialog box for now.
-
-2000-08-29 Dan Winship <danw@helixcode.com>
-
- * cal-client/client-test.c:
- * cal-client/cal-client.c:
- * conduits/todo/todo-conduit.h:
- * conduits/calendar/calendar-conduit.h: remove USING_OAF checks.
-
-2000-08-29 JP Rosevear <jpr@helixcode.com>
-
- * gui/gnome-cal.c (gnome_calendar_edit_object): Use
- event_editor_set_event_object
-
- * gui/event-editor.c (event_editor_set_event_object): Rename
- from event_editor_set_ical_object
-
- * gui/event-editor.h: Update prototype
-
- * gui/e-week-view.c (e_week_view_on_new_appointment):
- Call cal_component_commit_sequence after event changes. Default
- to these being all day events.
-
-2000-08-29 JP Rosevear <jpr@helixcode.com>
-
- * gui/event-editor.c (dialog_to_comp_object): These are not UTC
- times
-
-2000-08-28 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-client/cal-client.c (cal_client_is_loaded): New function.
- We need this from code that dynamically updates from a client and
- could not have connected to the "cal_loaded" signal right after
- the client was created.
-
- * gui/calendar-model.c (load_objects): Do not try to load the
- objects if the client has not been loaded yet.
- (cal_loaded_cb): Check the status value.
-
- * gui/calendar-model.h (CalendarModel): Declare the private
- structure here so that gdb will give me love.
-
- * pcs/cal-factory.h (CalFactory): Likewise.
-
- * pcs/cal.h (Cal): Likewise.
-
- * cal-client/cal-listener.h (CalListener): Likewise.
-
- * cal-client/cal-client.h (CalClient): Likewise.
-
- * pcs/cal-backend.h (CalBackend): This no longer has a private
- structure, so remove it.
-
- * cal-util/Makefile.am (libcal_util_la_SOURCES): Removed the
- vCalendar and old iCalendar cruft.
- (libcal_utilinclude_HEADERS): Likewise.
- Removed the obsolete iCalendar test program.
-
-2000-08-28 JP Rosevear <jpr@helixcode.com>
-
- * cal-util/timeutil.h: We no longer need time_from_icaltimetype
- as libical has the API for this
-
- * cal-util/timeutil.c: ditto
-
- * cal-util/cal-recur.c: Replace time_from_icaltimetype with
- icaltime_as_timet
-
- * gui/calendar-model.c: ditto
-
- * gui/event-editor.c: ditto
-
- * gui/gnome-cal.c: ditto
-
-2000-08-28 Federico Mena Quintero <federico@helixcode.com>
-
- * pcs/cal-backend-file.c (remove_component): Remove the
- icalcomponent from the toplevel calendar here.
- (cal_backend_file_update_object): Do not remove it here.
- (cal_backend_file_remove_object): Do not remove it here.
- (add_component): Add the icalcomponent to the toplevel calendar if
- asked to.
- (cal_backend_file_update_object): Do not add it here.
-
-2000-08-28 JP Rosevear <jpr@helixcode.com>
-
- * gui/event-editor.c (dialog_to_comp_object): Initiliaze tzid to
- null, only set recurrence rules and exception dates if there
- are any
-
-2000-08-27 JP Rosevear <jpr@helixcode.com>
-
- * pcs/cal-backend-file.c (save): Write out the calendar object
- (cal_backend_file_update_object): Remove/add the icalcomponent
- from our master icalcomponent (the calendar)
- (cal_backend_file_remove_object): Remove the icalcomponent
- from our master icalcomponent
-
-2000-08-26 JP Rosevear <jpr@helixcode.com>
-
- * gui/Makefile.am: Remove gnorba stuff
-
- * gui/main.c: ditto
-
- * gui/component-factory.c: ditto
-
- * gui/control-factory.c: ditto
-
- * gui/*.gnorba: ditto
-
-2000-08-25 JP Rosevear <jpr@helixcode.com>
-
- * gui/e-calendar-table.c (e_calendar_table_init): Uncomment
- debug code.
-
- * gui/calendar-model.c (set_complete): Set the completed
- date to the current date
- (calendar_model_set_value_at): Handle complete field
-
-2000-08-25 JP Rosevear <jpr@helixcode.com>
-
- * gui/calendar-model.c (get_is_complete): Don't attempt to
- free this if its null
- (calendar_model_duplicate_value): Implement for summary field
- value
- (calendar_model_initialize_value): Remove debug code
-
- * gui/e-calendar-table.c: Correct etable init xml
- (create_column): Pass the id to e_table_header_add_column
- rather than a hard coded one
- (e_calendar_table_init): Make sure summary column isn't
- added twice. Add an alarms column, else etable won't
- work with columns who have an ID higher than that
-
-2000-08-24 JP Rosevear <jpr@helixcode.com>
-
- * gui/gncal-todo.c (ok_button): Properly append to list
-
- * gui/event-editor.c (dialog_to_comp_object): ditto
-
- * gui/e-day-view.c (e_day_view_on_new_appointment): The base
- times are not UTC
-
- * gui/e-week-view.c (e_week_view_on_new_appointment): ditto
-
-2000-08-24 JP Rosevear <jpr@helixcode.com>
-
- * Update for libical 0.19
-
-2000-08-24 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/calendar-commands.c, gui/e-day-view.c, gui/e-week-view.c,
- gui/event-editor.c, gui/gncal-todo.c, gui/gnome-cal.c, gui/prop.c:
- Fixed some warnings.
-
-2000-08-24 JP Rosevear <jpr@helixcode.com>
-
- * gui/e-week-view.c (e_week_view_on_new_appointment): Do not alloc
- the struct icaltimetype but point to one on the stack. More
- importantly, set the date.tzid to NULL.
-
-2000-08-24 JP Rosevear <jpr@helixcode.com>
-
- * gui/gnome-cal.c (save_event_object_cb): Make signal
- names saner
- (released_event_object_cb): ditto
- (gnome_calendar_edit_object): ditto
-
- * gui/event-editor.h: Make signal names saner
-
- * gui/event-editor.c (event_editor_class_init): Make signal
- names saner now that we don't use ical object
- (save_event_object): ditto with callback names
- (file_save_cb): ditto
- (tb_save_and_close_cb): ditto
- (event_editor_set_ical_object): ditto
-
- * gui/e-day-view.c (e_day_view_update_event): Umm,
- != CAL_COMPONENT_EVENT (I hope that wasn't me!)
-
-2000-08-24 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/e-day-view.c (e_day_view_on_new_appointment): Do not alloc
- the struct icaltimetype but point to one on the stack. More
- importantly, set the date.tzid to NULL.
-
-2000-08-24 JP Rosevear <jpr@helixcode.com>
-
- * gui/event-editor-dialog.glade: Remove owner field
-
- * gui/event-editor.c (clear_widgets): Forget about owner field
- (get_widgets): ditto
- (fill_widgets): ditto
-
-2000-08-24 JP Rosevear <jpr@helixcode.com>
-
- * gui/calendar-model.c (calendar_model_initialize_value): Handle
- summary field
- (calendar_model_value_is_empty): ditto
- (calendar_model_free_value): ditto
-
-2000-08-23 JP Rosevear <jpr@helixcode.com>
-
- * gui/event-editor-dialog.glade: Remove status bar
-
- * cal-util/cal-component.c (cal_component_set_rrule_list): Allow
- a null list
- (cal_component_set_rdate_list): Allow a null list
-
- * gui/e-day-view.c (e_day_view_on_new_appointment): Commit
- the CalComponent sequence
-
-2000-08-23 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/main.c: #include <e-util/e-cursors.h>
-
- * gui/e-day-view-time-item.c (e_day_view_time_item_draw):
- Initialize time_min_x1 and hour_r to keep gcc happy.
-
- * gui/e-day-view.c (e_day_view_update_event_label): Warning fix.
- (e_day_view_update_main_canvas_drag): Initialize start_row.
-
- * gui/e-week-view-event-item.c (e_week_view_event_item_draw):
- Initialize time_y_small_min, icon_x.
-
- * Makefile.am (SUBDIRS): Re-enable the gui directory.
-
- * gui/prop.c (prop_store_alarm_default_values): Temporarily #if 0
- out.
-
-2000-08-23 JP Rosevear <jpr@helixcode.com>
-
- * gui/e-week-view.c (e_week_view_key_press): Set vtype of new
- CalComponent
- (e_week_view_on_new_appointment): ditto
-
- * gui/e-day-view.c (e_day_view_on_new_appointment): ditto
-
-2000-08-23 JP Rosevear <jpr@helixcode.com>
-
- * gui/e-day-view-time-item.c: Include gnome.h for gettext purposes
-
- * gui/gnome-cal.c: ditto
-
- * gui/prop.c: #if out some alarm stuff
-
-2000-08-23 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/e-calendar-table.c (e_calendar_table_init): Updated
- function.
- (e_calendar_table_open_task): Updated function.
-
-2000-08-21 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/calendar-model.c (calendar_model_duplicate_value): Updated
- function.
- (calendar_model_free_value): Updated function.
- (calendar_model_initialize_value): Updated function.
- (calendar_model_value_is_empty): Updated function.
- (remove_object): Updated function.
- (obj_updated_cb): Updated function.
- (calendar_model_get_cal_client): Added inline docs.
- (calendar_model_delete_task): Updated.
- (calendar_model_mark_task_complete): Updated.
- (calendar_model_get_cal_object): Updated.
-
-2000-08-21 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/calendar-model.c (set_categories): New function.
- (parse_time): Moved over from the old set_time_t(). This just
- parses the time and leaves the warning dialog for the caller.
- (set_datetime): New function.
- (set_geo): Updated old function.
- (set_percent): Updated old function.
- (set_priority): Updated old function.
- (set_summary): New function.
- (set_url): New function.
- (calendar_model_set_value_at): Updated function.
- (calendar_model_is_cell_editable): Updated function.
- (calendar_model_append_row): Updated. Added an ugly hack to
- accomodate ETable's lack of a real API for adding new items.
- Also, don't try to set columns that are not editable.
-
-2000-08-21 JP Rosevear <jpr@helixcode.com>
-
- * gui/e-week-view.c (e_week_view_reload_events):
- Use CalObjType
-
- * gui/e-day-view.c (e_day_view_reload_events): ditto
-
-2000-08-21 JP Rosevear <jpr@helixcode.com>
-
- * gui/e-day-view-main-item.c (e_day_view_main_item_draw_day_event):
- Use CalComponent instead of iCalObject. #if some alarm stuff
-
-2000-08-21 JP Rosevear <jpr@helixcode.com>
-
- * gui/e-day-view-top-item.c (e_day_view_top_draw_long_event):
- Use CalComponent instead of iCalObject. #if some alarm stuff
-
-2000-08-21 JP Rosevear <jpr@helixcode.com>
-
- * gui/e-day-view.h: Update prototypes
-
- * gui/e-day-view.c (e_day_view_on_unrecur_appointment):
- Remove commented out portions.
-
- * gui/e-week-view.c (e_week_view_on_unrecur_appointment):
- Tidy.
-
-2000-08-21 JP Rosevear <jpr@helixcode.com>
-
- * gui/e-day-view.c
- (e_day_view_update_event): Use CalComponent
- instead of iCalObject. Work around not having a compare
- dates routine for two CalComponents.
- (e_day_view_reshape_long_event): Use CalComponent instead
- of iCalObject, #if some alarm stuff
- (e_day_view_reshape_day_event): ditto
- (e_day_view_reload_events): Use revamped CalClient
- (e_day_view_update_event_cb): Use CalComponent
- instead of iCalObject
- (e_day_view_foreach_event_with_uid): ditto
- (e_day_view_remove_event_cb): ditto
- (e_day_view_update_event_label): ditto
- (e_day_view_find_event_from_uid): ditto
- (e_day_view_on_event_click): ditto
- (e_day_view_on_event_right_click): ditto
- (e_day_view_on_new_appointment): ditto
- (e_day_view_on_edit_appointment): ditto
- (e_day_view_on_delete_occurrence): ditto
- (e_day_view_on_delete_appointment): ditto
- (e_day_view_on_unrecur_appointment): ditto
- (e_day_view_on_top_canvas_motion): ditto
- (e_day_view_on_main_canvas_motion): ditto
- (e_day_view_finish_long_event_resize): ditto
- (e_day_view_finish_resize): ditto
- (e_day_view_free_event_array): ditto
- (e_day_view_add_event): ditto
- (e_day_view_key_press): ditto
- (e_day_view_on_editing_stopped): ditto
- (e_day_view_update_top_canvas_drag): ditto
- (e_day_view_update_main_canvas_drag): ditto
- (e_day_view_on_drag_data_get): ditto
- (e_day_view_on_top_canvas_drag_data_received): ditto
- (e_day_view_on_main_canvas_drag_data_received): ditto
-
-2000-08-20 JP Rosevear <jpr@helixcode.com>
-
- * gui/e-week-view-event-item.c (e_week_view_event_item_draw_icons):
- Use CalComponent instead of iCalObject. #if some alarm stuff
-
-2000-08-20 JP Rosevear <jpr@helixcode.com>
-
- * gui/e-week-view.c (e_week_view_update_event): Use CalComponent
- instead of iCalObject. Work around not having a compare
- dates routine for two CalComponents.
- (e_week_view_reload_events): Use revamped CalClient
- (e_week_view_reshape_event_span): Use CalComponent instead
- of iCalObject, #if some alarm stuff
- (e_week_view_update_event_cb): Use CalComponent instead of
- iCalObject
- (e_week_view_foreach_event_with_uid): ditto
- (e_week_view_remove_event_cb): ditto
- (e_week_view_free_events): ditto
- (e_week_view_add_event): ditto
- (e_week_view_on_editing_stopped): ditto
- (e_week_view_find_event_from_uid): ditto
- (e_week_view_key_press): ditto
- (e_week_view_show_popup_menu): ditto
- (e_week_view_on_new_appointment): ditto
- (e_week_view_on_edit_appointment): ditto
- (e_week_view_on_delete_occurrence): ditto
- (e_week_view_on_delete_appointment): ditto
- (e_week_view_on_unrecur_appointment): ditto
-
- * gui/e-week-view.h: Update prototypes.
-
-2000-08-18 JP Rosevear <jpr@helixcode.com>
-
- * gui/event-editor.h: Update prototypes.
-
- * gui/event-editor.c: Need to come back here later to fix the
- alarm stuff. The gui also needs to be completely redone to
- support the fancier CalComponent settings (exrules, rdates, etc)
- There are some warnings that I put in to mark some of these
- spots
- (event_editor_destroy): Use Calcomponent instead
- of iCalObject
- (make_title_from_comp): ditto
- (clear_widgets): ditto
- (fill_widgets): ditto
- (classification_get): ditto
- (dialog_to_comp_object): ditto
- (save_ical_object): ditto
- (close_dialog): ditto
- (event_editor_set_ical_object): ditto
-
-2000-08-17 JP Rosevear <jpr@helixcode.com>
-
- * gui/gncal-todo.c (ok_button): Use CalComponent instead of
- iCalObject
- (cancel_button): ditto
- (gncal_todo_edit): ditto
- (add_todo): ditto
- (edit_todo): ditto
- (delete_todo): ditto
- (insert_in_clist): ditto
- (gncal_todo_update): ditto
-
- * gui/gncal-todo.h: Update prototypes
-
-2000-08-16 JP Rosevear <jpr@helixcode.com>
-
- Rework gnome-cal.c - alarms are a tad broken ATM so this
- will need more cleaning later.
-
- * gui/gnome-cal.c (snooze): Use CalComponent instead of
- iCalObject
- (edit): ditto
- (audio_notification): ditto
- (display_notification_cb): Use CalComponent member of
- alarm_notify_closure rather than iCalObject
- (display_notification): ditto
- (trigger_alarm_cb): ditto. Use CalComponent alarm types
- (gnome_calendar_tag_calendar_cb): New
- cal_client_generate_instances callback to
- mark_gtk_calendar_day's
- (gnome_calendar_tag_calendar): Use above callback
- (save_ical_object_cb): Use CalComponent instead of
- iCalObject
- (gnome_calendar_edit_object): ditto
- (gnome_calendar_new_appointment): ditto
-
-2000-08-15 JP Rosevear <jpr@helixcode.com>
-
- * gui/mark.c (mark_month_item_cb): Callback used to mark every
- event in a month.
- (mark_month_item): Use cal_client_generate_instances with
- above callback
-
-2000-08-15 JP Rosevear <jpr@helixcode.com>
-
- * gui/print.c (print_month_small): Use
- cal_client_get_objects_in_range
- (print_day_details_cb): Callback used to create columns and fill
- events into a day view. Code should be shared with e-day-view
- in reality. Maybe need to go back to layout.[hc] a bit later
- (print_day_details): Use cal_client_generate_instances with
- above callback. Iterate over results to expand events to fit.
- (print_day_summary_cb): Callback to build list of event info
- for a day
- (print_day_summary): Use cal_client_generate_instances with
- above callback to generate the required event info for printing
- (print_todo_details_cb): Callback used create list of todo info
- (print_todo_details): Use cal_client_generate_instances with
- above callback to generate required todo info for printing.
-
- * gui/layout.[hc]: No longer used.
-
-2000-08-12 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/calendar-model.c (get_is_overdue): Finished implementing.
- (calendar_model_value_at): Handle the color field.
-
-2000-08-11 Seth Alves <alves@hungry.com>
-
- * cal-util/cal-component.c (cal_component_get_pilot_id):
- (cal_component_set_pilot_id): stubs for pilot id accessors
- (cal_component_get_pilot_status):
- (cal_component_set_pilot_status): stubs for pilot status accessors
-
- * conduits/calendar/calendar-conduit.c (transmit): start to
- convert to cal-component interface
-
- * conduits/todo/todo-conduit.c (transmit): same
-
-2000-08-11 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/calendar-model.c (get_geo): Generate a prettier string for
- the geographical position.
- (get_classification): New function.
- (get_categories): New function.
- (get_completed): New function.
- (get_dtend): New function.
- (get_dtstart): New function.
- (get_due): New function.
- (get_percent): New function.
- (get_priority): New function.
- (get_summary): New function.
- (get_transparency): New function.
- (get_url): New function.
- (get_has_alarms): New function.
- (get_has_recurrences): New function.
- (get_is_complete): New function.
- (get_is_overdue): New function.
-
- * cal-util/cal-component.c (scan_property): Handle the GEO
- property.
- (free_icalcomponent): Likewise.
- (cal_component_get_geo): Likewise.
- (cal_component_set_geo): Likewise.
- (cal_component_free_geo): Likewise.
- (cal_component_set_exdate_list): Removed incorrect assertion.
- (cal_component_set_exrule_list): Removed incorrect assertion.
- (cal_component_get_next_alarm): Oops, this had not been
- implemented at all.
- (cal_component_has_rdates): New function.
- (cal_component_has_rrules): New function.
-
- * cal-util/cal-component.h (CalComponentField): Added the GEO
- property.
-
-2000-08-11 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-util/cal-component.c (scan_property): Handle the
- PERCENT-COMPLETE property.
- (free_icalcomponent): Likewise.
- (cal_component_get_percent): Likewise.
- (cal_component_set_percent): Likewise.
- (cal_component_free_percent): Likewise.
- (scan_property): Handle the PRIORITY property.
- (free_icalcomponent): Likewise.
- (cal_component_get_priority): Likewise.
- (cal_component_set_priority): Likewise.
- (cal_component_free_priority): Likewise.
-
- * cal-util/cal-component.h (CalComponentField): New enumeration
- with the list of fields we support for ETable.
-
-2000-08-10 Dan Winship <danw@helixcode.com>
-
- * gui/component-factory.c (owner_set_cb): Update prototype.
-
-2000-08-10 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/gnome-cal.c (gnome_calendar_new_appointment): New function.
- Mostly moved over from calendar-commands.c:display_objedit().
-
- * gui/calendar-commands.c (calendar_iterate): Removed. Wheee!
- (display_objedit): Removed.
- (new_appointment_cb): New function. Just call
- gnome_calendar_new_appointment().
- (display_objedit_today): Removed.
- (calendar_control_activate): Removed the "New appointment for
- today" option, since it is pretty useless.
-
-2000-08-10 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-client/cal-client.c (cal_client_generate_instances): There.
- A pretty function to generate recurrence instances atomically so
- that clients don't have to jump through hoops. Now we can get rid
- of the ugly calendar_iterate() function.
-
-2000-08-09 Cody Russell <bratsche@gnome.org>
-
- * gui/calendar-commands.c: Make the toolbar honor the user's
- gnomecc settings for detachable toolbars.
-
-2000-08-09 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/alarm.c (pop_alarm): Oops, subtract the new alarm's trigger
- time from the current time.
-
-2000-08-09 Christopher James Lahey <clahey@helixcode.com>
-
- * cal-client/cal-client.c: Fixed a warning.
-
-2000-08-09 Christopher James Lahey <clahey@helixcode.com>
-
- * cal-client/cal-client.c, gui/e-calendar-table.c, pcs/cal.c:
- Fixed some warnings.
-
-2000-08-08 Federico Mena Quintero <federico@helixcode.com>
-
- * idl/evolution-calendar.idl (Cal): Added a get_objects_in_range()
- method. Takes in a time range and the type of component we are
- interested in; returns a list of UIDs. The idea is that
- ocurrences get computed in the client; we can have multiple
- recurrences in iCalendar and we cannot identify them trivially
- across the wire.
- (Cal): Removed the get_events_in_range() method.
-
- * pcs/cal-backend.c (cal_backend_free_uid_list): New function.
- (cal_backend_get_objects_in_range): New function.
- (cal_backend_get_events_in_range): Removed.
-
- * pcs/cal-backend-file.c (cal_backend_file_get_objects_in_range):
- Implemented new method.
- (cal_backend_file_get_events_in_range): Removed.
-
- * pcs/cal.c (Cal_get_events_in_range): Removed.
- (uncorba_obj_type): New function.
- (Cal_get_uids): Use uncorba_obj_type().
- (Cal_get_n_objects): Likewise.
- (Cal_get_objects_in_range): Implemented new method.
-
- * cal-client/cal-client.c (cal_client_get_events_in_range): Removed.
- (cal_client_get_objects_in_range): Implemented.
- (corba_obj_type): New function.
- (cal_client_get_n_objects): Use corba_obj_type().
- (cal_client_get_uids): Likewise.
-
-2000-08-07 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-util/cal-component.c (cal_component_clone): New function.
- (cal_component_get_icalcomponent): Ensure that the SEQUENCE
- property does not need incrementing.
-
- * gui/dialogs/alarm-notify-dialog.c (alarm_notify_dialog): Use
- CalComponent. Deal with an empty summary property.
-
-2000-08-07 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-util/cal-component.c (cal_component_get_as_string): Doh,
- libical owns the string's memory, so do not free it.
-
- * cal-client/client-test.c (create_client): Connect to the destroy
- signal of the client here.
-
- * cal-client/test.ics: New test file, modified from Eric Busboom's
- test file from RFC 2445.
-
-2000-08-05 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-client/client-test.c (dump_component): This was gone for
- some reason.
- (main): Load a new test file.
-
-2000-08-04 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-util/cal-component.c (cal_component_commit_sequence): New
- function to commit changes to the SEQUENCE property.
- (cal_component_get_as_string): Ensure that the sequence has been
- committed.
-
- * cal-client/cal-client.c (cal_client_get_object): Use
- CalComponent instead of the old iCalObject.
- (cal_client_update_object): Use iCalObject. Commit the SEQUENCE
- property before stringifying the object and piping it over to the
- Wombat.
-
-2000-08-04 Seth Alves <alves@hungry.com>
-
- * conduits/todo/todo-conduit.c (conduit_get_gpilot_conduit): if
- oaf isn't initialized by the time the conduit starts, start it
- up. we do this because we need to start wombat with oaf, and
- gpilotd doesn't currently start oaf.
-
-2000-08-04 Michael Meeks <michael@helixcode.com>
-
- * gui/calendar-commands.c (calendar_control_activate): unref.
-
-2000-08-02 Federico Mena Quintero <federico@helixcode.com>
-
- * pcs/cal-backend-file.c (cal_backend_file_get_uid_by_pilot_id):
- Added stub for now.
- (cal_backend_file_update_pilot_id): Likewise.
-
- * pcs/Makefile.am (libpcs_a_SOURCES): Removed cal-backend-imc.[ch]
- from the list of sources. The idea is to move vCalendar importing
- to the GUI as a convenience function.
-
-2000-08-02 Seth Alves <alves@hungry.com>
-
- * pcs/cal-backend-imc.c (cal_backend_imc_update_pilot_id): call
- save (cbimc) after setting the pilot id and status.
-
-2000-08-02 Joe Shaw <joe@helixcode.com>
-
- * pcs/cal-backend-file.c (cal_backend_file_update_pilot_id):
- Fixed a g_return_if_fail that had two parameters and thus
- wouldn't build.
-
-2000-08-03 Damon Chaplin <damon@helixcode.com>
-
- * gui/calendar-model.c (calendar_model_append_row): updated to match
- the new ETableModel append_row. This meant we could also get rid of
- the row_being_added and idle_id hack.
-
-2000-08-02 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/calendar-model.c: Emit "model_pre_change" signals as
- appropriate.
-
-2000-08-02 Federico Mena Quintero <federico@helixcode.com>
-
- * pcs/cal-backend-file.[ch]: New files for the iCalendar file
- backend.
-
- * pcs/Makefile.am (libpcs_a_SOURCES): Added cal-backend-file.[ch].
-
- * cal-util/cal-component.c (cal_component_set_icalcomponent):
- Return an operation success code for if we are passed a component
- of a type we don't support.
-
-2000-07-31 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-util/cal-recur.c (*): Use CalComponent and the new property
- types instead of the old iCalObject stuff.
- (cal_recur_generate_instances): Renamed from
- cal_object_generate_events(). Ensure that the component has the
- DTSTART property.
- (generate_instances_for_year): Renamed from
- cal_object_generate_events_for_year().
- (cal_obj_expand_recurrence): Made static.
- (cal_recur_from_icalrecurrencetype): New function. We should
- really convert this whole file to use struct icalrecurrencetype
- instead.
- (cal_recur_free): New function.
-
- * cal-util/cal-recur.h (CalRecurType): Renamed from CalObjRecurType.
- (CalRecurrence): Renamed from CalObjRecurrence.
-
- * cal-util/timeutil.c (time_from_icaltimetype): New function.
-
- * cal-util/Makefile.am: Commented out the test-recur program.
-
-2000-08-01 Damon Chaplin <damon@helixcode.com>
-
- * Removed doc directory, since it is the old gnome-pim docs which
- aren't used any more.
-
- * Makefile.am (SUBDIRS): removed doc.
-
-2000-07-26 Peter Williams <peterw@helixcode.com>
-
- * gui/calendar-model.c: compile fix for Solaris
- (works under Linux, too; don't know about others)
-
- * this is a test of whether CVS merge does what I
- think it will do.
-
-2000-07-26 Federico Mena Quintero <federico@helixcode.com>
-
- OK, it seems that we have all the interesting properties for
- single-user calendars now. RFC 2445 can bite me.
-
- * cal-util/cal-component.c (scan_property): Handle the RRULE
- property. Yay!.
- (scan_recur): Likewise, yow!
- (get_recur_list): Likewise, yeehaw!
- (get_recur_list): Likewise, honk honk!
- (set_recur_list): Likewise, booooga booooga!
- (cal_component_get_rrule_list): Likewise, squeek squeek!
- (cal_component_set_rrule_list): That's it, I ran out of sounds.
- (cal_component_free_recur_list): Likewise.
- (scan_property): Handle the EXRULE property.
- (free_icalcomponent): Likewise.
- (cal_component_get_exrule_list): Likewise.
- (cal_component_set_exrule_list): Likewise.
- (set_period_list): Oops, free the old properties as well as
- removing them.
- (set_text_list): Ditto.
- (cal_component_set_exdate_list): Ditto.
-
- * cal-util/cal-component.c: Put all the functions used to free
- returned values all together.
- (cal_component_set_rdate_list): Oops, mark SEQUENCE property to be
- incremented since the RFC requires it.
- (scan_property): Handle the EXDATE property.
- (scan_exdate): Likewise.
- (free_icalcomponent): Likewise.
- (cal_component_get_exdate_list): Likewise.
- (cal_component_set_exdate_list): Likewise.
- (cal_component_free_exdate_list): Likewise.
-
-2000-07-26 Jeffrey Stedfast <fejj@helixcode.com>
-
- * gui/Makefile.am: Fixed a typo
-
-2000-07-26 Jeffrey Stedfast <fejj@helixcode.com>
-
- * gui/Makefile.am: Added a few xpm files to the EXTRA DIST section
-
-2000-07-25 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-util/cal-component.c (cal_component_free_period_list): New function.
- (scan_property): Handle the RDATE property.
- (scan_period): Likewise.
- (free_icalcomponent): Likewise.
- (get_period_list): Likewise.
- (set_period_list): Likewise.
- (cal_component_get_rdate_list): Likewise.
- (cal_component_set_rdate_list): Likewise.
- (scan_text): Simplify a bit since we only handle the ALTREP
- parameter; there is no need to iterate over all parameters.
- (scan_datetime): Simplify; just handle the TZID parameter.
- (scan_summary): Simplify; just handle the ALTREP parameter.
- (cal_component_get_as_string): New function.
-
- * idl/evolution-calendar.idl (CalObjType): Removed the TYPE_OTHER;
- now we only expose the types of objects we know about.
-
- * cal-util/cal-util.h (CalObjType): Likewise.
-
- * cal-client/cal-client.c (cal_client_get_n_objects): Likewise.
- (cal_client_get_uids): Likewise.
-
- * conduits/calendar/calendar-conduit.c (get_calendar_objects): Likewise.
- (check_for_slow_setting): Likewise.
-
- * pcs/cal-backend-imc.c (count_objects): Likewise.
- (build_uids_list): Likewise.
-
- * pcs/cal.c (Cal_get_uids): Likewise.
- (Cal_get_n_objects): Likewise.
-
-2000-07-25 Damon Chaplin <damon@helixcode.com>
-
- * gui/e-calendar-table.[hc]: new ECalendarTable to show an ETable view
- for Todo/Event items.
-
- * gui/task-assigned-to.xpm:
- * gui/task-recurring.xpm:
- * gui/task-assigned.xpm:
- * gui/task.xpm: new pixmaps (all the same at present) to go in the
- icon column of the ETable.
-
- * gui/event-editor.c: hid the silly 'Calendar' labels on the
- GnomeDateEdits and hid the times when you select 'All day event'.
- Also adjusted the time_t's so that when an all day event finishes on
- say midnight 13th May, we show 12th May in the dialog, since it
- implicitly includes all of that day up to midnight.
-
- * gui/dialogs/task-editor-dialog.glade:
- * gui/dialogs/task-editor.[hc]: unfinished dialog to edit tasks.
-
- * gui/gncal-todo.c: temporary hack so that we can use the simple dialog
- with our new ETable.
-
-2000-07-23 Damon Chaplin <damon@helixcode.com>
-
- * cal-util/calobj.h: added a few more fields.
-
- * cal-util/calobj.c (ical_object_create_from_vobject): check for a
- NULL return from vObjectUStringZValue for URL property to avoid SEGV.
- For some reason an empty 'URL:' property appears and causes trouble.
-
-2000-07-20 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component-factory.c (factory_fn): Update for the new
- `evolution_shell_component_new()' arg.
-
-2000-07-19 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-util/cal-component.c (cal_component_alarm_set_trigger):
- Finish filling the trigger. What a pain, again.
- (cal_component_alarm_free_trigger): Implemented.
-
-2000-07-19 Fatih Demir <kabalak@gmx.net>
-
- * conduits/calendar/calendar-conduit-control-applet.desktop:
-
- * conduits/todo/todo-conduit-control-applet.desktop:
- Added the Turkish desktop entries.
-
-2000-07-18 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-util/cal-component.c (cal_component_alarm_free): Free the
- icalcomponent if this is an unattached alarm.
- (scan_alarm_property): Handle the TRIGGER property.
- (cal_component_alarm_get_trigger): Ditto. Royal pain.
- (cal_component_alarm_set_trigger): Ditto. Less pain.
-
-2000-07-17 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-client/cal-client.c (cal_client_get_object): Fixed inline
- docs.
- (cal_client_new): Ditto.
- (cal_client_get_n_objects): Added inline docs.
-
-2000-07-14 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-util/cal-component.c (CalComponentAlarm): New internal
- represntation for alarm components. We really don't map them to a
- CalComponent because it is more convenient to handle them as
- "child" structures.
- (make_alarm): New function to create a CalComponentAlarm from an
- icalcomponent representing a VALARM.
- (scan_alarm_property): New function to scan a property from an
- alarm component. We support ACTION.
- (cal_component_get_first_alarm): New function to start an iterator
- over the alarms in a calendar component.
- (cal_component_alarm_get_action): New function.
- (cal_component_alarm_set_action): New function.
-
-2000-07-13 Seth Alves <alves@hungry.com>
-
- * conduits/todo/todo-conduit.c: conduit based on the calendar conduit.
- this conduit syncs a pilot's ToDoDB database to wombat's list of "todo"
- events.
-
- * gui/gncal-todo.c (simple_todo_editor): set todo's priority control
- based on value from ical object during edit.
-
-2000-07-12 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/print.c: Revert Michael's GnomeFont patch until the
- gnome-print API stabilizes.
-
-2000-07-12 Michael Meeks <michael@helixcode.com>
-
- * gui/print.c (titled_box, print_text, print_month_small),
- (bound_text): GnomeFont update.
-
-2000-07-12 Seth Alves <alves@hungry.com>
-
- * conduits/calendar/calendar-conduit.c: fixed various problems
-
- * cal-client/Makefile.am: build a static version of the library
- to link with the conduits
-
- * cal-util/Makefile.am: same
-
-2000-07-11 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-util/cal-component.c (scan_property): Handle the COMPLETED
- property.
- (free_icalcomponent): Ditto.
- (cal_component_get_completed): Ditto.
- (cal_component_set_completed): Ditto.
- (scan_property): Handle the TRANSPARENCY property.
- (free_icalcomponent): Ditto.
- (cal_component_get_transparency): Ditto.
- (cal_component_set_transparency): Ditto.
- (scan_property): Handle the URL property.
- (free_icalcomponent): Ditto.
- (cal_component_get_url): Ditto.
- (cal_component_set_url): Ditto.
-
- * pcs/cal-factory.c (queue_load_create_job): Removed unneeded
- check for the URI.
- (load_fn): Be more paranoid about the URI and notify the listener
- if we got passed a bad URI. Simplify the termination code a bit.
- (create_fn): Likewise.
- (queue_load_create_job): Be more paranoid about the URI.
-
-2000-07-10 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/Makefile.am: Remove pilot stuff for now.
-
- * Makefile.am (SUBDIRS): Remove `conduits'.
-
-2000-07-10 Dan Winship <danw@helixcode.com>
-
- * gui/Makefile.am (EXTRA_DIST): remove gnomecal.conduit
-
- * conduits/calendar/Makefile.am (EXTRA_DIST): We want
- calendar.conduit.in, not calendar.conduit.
-
-2000-07-10 Seth Alves <alves@hungry.com>
-
- * gui/Makefile.am (SUBDIRS):
- * conduits/calendar/Makefile.am: moved calendar-conduit stuff from
- the gui directory to here.
-
- * Makefile.am (SUBDIRS): added conduits to SIBDIRS
-
-2000-07-08 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/calendar-commands.c (calendar_control_activate): Remove
- "close calendar" command.
-
-2000-07-08 Anders Carlsson <andersca@gnu.org>
-
- * gui/e-week-view.c (e_week_view_on_button_press): Handle mouse wheel scrolling.
-
- * gui/e-day-view.c (e_day_view_on_time_canvas_button_press): New function to handle
- mouse wheel scrolling.
- (e_day_view_on_main_canvas_button_press): Handle mouse wheel scrolling.
-
-2000-07-07 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-util/cal-component.c (scan_property): Handle the SEQUENCE
- property.
- (free_icalcomponent): Ditto.
- (cal_component_get_sequence): Ditto.
- (cal_component_set_sequence): Ditto.
- (cal_component_free_sequence): Ditto.
- (cal_component_set_last_modified): Removed incorrect assertion.
- (CalComponentPrivate): New need_sequence_inc flag. The sequence
- number must be incremented when certain properties change, so we
- store a flag that says if we need to bump it when piping the
- object over the wire.
- (free_icalcomponent): Reset need_sequence_inc.
- (cal_component_set_dtstart): Set need_sequence_inc.
- (cal_component_set_dtend): Ditto.
- (cal_component_set_due): Ditto.
-
-2000-07-06 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-util/cal-component.c (scan_property): Handle the
- LAST-MODIFIED property.
- (free_icalcomponent): Ditto.
- (cal_component_get_last_modified): Ditto.
- (cal_component_set_last_modified): Ditto.
- (get_icaltimetype): New function to get struct icaltimetype
- values.
- (cal_component_get_created): Use get_icaltimetype().
- (set_icaltimetype): New function to set struct icaltimetype
- values.
- (cal_component_set_created): Use set_icaltimetype().
-
- * cal-util/cal-component.c (scan_property): Handle the CREATED
- property.
- (free_icalcomponent): Ditto.
- (cal_component_free_icaltimetype): Ditto.
- (cal_component_get_created): Ditto.
- (cal_component_set_created): Ditto.
- (cal_component_init): Do not create an UID here.
- (ensure_mandatory_properties): New function to ensure that the
- mandatory RFC properties are indeed in the component. If they are
- not, we create them on the fly.
- (cal_component_set_new_vtype): Use ensure_mandatory_properties().
- (cal_component_set_icalcomponent): Ditto.
- (cal_component_get_uid): Return the UID in a parameter, not as a
- function return value, for consistency's sake.
- (scan_property): Handle the DTSTAMP property.
- (free_icalcomponent): Ditto.
- (cal_component_get_dtstamp): Ditto.
- (cal_component_set_dtstamp): Ditto.
-
-2000-07-04 Damon Chaplin <damon@helixcode.com>
-
- * gui/gncal-todo.c (gncal_todo_update): Use &obj instead of &ico in
- the call to cal_client_get_object(). The ToDo list should work now.
-
- * gui/event-editor-dialog.glade: set the toplevel GnomeApp to invisible
- so it doesn't appear and then resize.
-
-2000-07-03 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-util/cal-component.c (cal_component_get_summary): Use
- CalComponentText instead of CalComponentPropSummary. Removed the
- latter typedef.
- (cal_component_set_summary): Likewise.
- (scan_property): Handle the CLASSIFICATION property.
- (cal_component_get_classification): Ditto.
- (cal_component_set_classification): Ditto.
-
- * cal-util/cal-component.c (cal_component_free_text_list): Renamed
- from cal_component_free_description_list(). We can share this
- function since both comments and descriptions have the same form.
- (scan_text): Ditto.
- (get_text_list): New function.
- (set_text_list): New function.
- (cal_component_get_description_list): Use get_text_list().
- (cal_component_set_description_list): Use set_text_list().
- (cal_component_set_uid): Add sanity check.
- (cal_component_get_summary): Ditto.
- (cal_component_get_description_list): Ditto.
- (cal_component_get_dtstart): Ditto.
- (cal_component_get_dtend): Ditto.
- (cal_component_get_due): Ditto.
- (scan_property): Handle the COMMENT property.
- (cal_component_get_comment_list): Ditto.
- (cal_component_set_comment_list): Ditto.
-
-2000-07-02 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-util/cal-component.c (scan_categories): Handle CATEGORIES.
- This can appear multiple times, so we maintain a list. We
- compress them later to a single property with multiple values.
- (cal_component_get_categories_list): Ditto.
- (cal_component_set_categories_list): Ditto.
- (cal_component_free_categories_list): Ditto.
- (free_icalcomponent): Properly free the mappings.
-
-2000-07-02 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-util/cal-component.c (scan_datetime): Handle date/time and
- timezone pairs.
- (scan_property): Handle DTSTART and DTEND.
- (cal_component_free_datetime): Ditto.
- (get_datetime): Ditto.
- (cal_component_get_dtstart): Ditto.
- (set_datetime): Ditto.
- (cal_component_set_dtstart): Ditto.
- (cal_component_get_dtend): Ditto.
- (cal_component_set_dtend): Ditto.
- (scan_property): Handle DUE date.
- (cal_component_get_due): Ditto.
- (cal_component_set_due): Ditto.
-
-2000-07-01 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-util/cal-component.c (cal_component_get_description_list):
- Handle the DESCRIPTION property. There can be multiple
- descriptions with parameters each, so we deal with a list instead
- of a single structure.
- (cal_component_set_description_list): Ditto.
- (cal_component_free_description_list): Ditto.
- (scan_property): Ditto.
- (scan_description): Ditto.
-
-2000-06-30 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-util/cal-component.c (cal_component_get_summary): To avoid
- passing a million parameters to setters/getters for properties
- that support parameters, we now pass client-side structures
- instead. Here we use CalComponentPropSummary.
- (cal_component_set_summary): Ditto.
-
-2000-06-29 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component-factory.c: Make calendar die when evolution quits.
-
-2000-06-30 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-util/cal-component.c: Change of plans. We use an
- icalcomponent from libical as our core representation so that we
- can preserve extension fields and fields that we don't (yet)
- support. CalComponent is just a wrapper with a nice API that
- provides non-iterative, random access to the ical's fields.
- (cal_component_destroy): Free the thing correctly.
- (cal_component_get_vtype): Re-implement in terms of icalcomponent.
- (cal_component_set_icalcomponent): New function to set the
- CalComponent's data from an existing icalcomponent.
- (cal_component_get_icalcomponent): New function.
- (cal_component_set_new_vtype): New convenience function to create
- an empty component.
- (scan_icalcomponent): Core scanning function.
- (scan_property): Another core scanning function.
- (cal_component_get_uid): Use the property directly.
- (cal_component_get_summary): Ditto. Handle the altrep parameter
- as well.
- (cal_component_set_summary): Ditto. Feel the pain, motherfucker.
- It is ridiculous how much code this involves.
- (scan_summary): Ditto.
-
-2000-06-29 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component-factory.c (owner_set_cb): Get an
- EvolutionShellClient instead of an Evolution_Shell to match the
- changes in libeshell.
-
-2000-06-29 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/Makefile.am: Do not link and include the pilot stuff for the
- calendar component, just for the Pilot conduit. Commented out the
- Pilot part so that Evolution can build. Sigh, we'll have to
- modify gnome-pilot to use OAF.
-
-2000-06-29 Peter Williams <peterw@helixcode.com>
-
- * gui/Makefile.am (LINK_FLAGS): Make the calendar-pilot-sync
- program conditional on HAVE_GNOME_PILOT, and add
- GNOME_PILOT_CFLAGS, GNOME_PILOT_LIBS, and PISOCK_LIBS in the
- appropriate places.
-
-2000-06-29 Seth Alves <alves@hungry.com>
-
- * pcs/cal.c (Cal_get_uid_by_pilot_id):
- (Cal_update_pilot_id):
- * pcs/cal-backend-imc.c (cal_backend_imc_update_pilot_id):
- (cal_backend_imc_get_uid_by_pilot_id):
- * pcs/cal-backend.c (cal_backend_get_uid_by_pilot_id):
- (cal_backend_update_pilot_id): server code to service these:
-
- * gui/calendar-pilot-sync.c: updated to make use of cal-client.
- also uses dirty bits on both sides to aid in syncing.
-
- * cal-client/cal-client.c (cal_client_get_uid_by_pilot_id): new
- function -- ask the cal server to return uid given an object's
- pilot id.
- (cal_client_update_pilot_id): new function -- inform the
- cal server of an objects pilot id and pilot dirty-flag.
-
-2000-06-28 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-util/cal-component.[ch]: New files for the new iCalendar
- component object. Today's properties: basic component type, UID,
- SUMMARY.
-
- * cal-util/Makefile.am: Added cal-component.[ch] to the list of
- sources.
-
-2000-06-27 Michael Meeks <michael@helixcode.com>
-
- * pcs/Makefile.am (INCLUDES): use BONOBO_VFS_GNOME_CFLAGS.
-
-2000-06-26 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/calendar-model.c: Added an #ifdefed value_to_string handler
- assignment.
-
-2000-06-26 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/calendar-model.c (calendar_model_duplicate_value):
- Implement.
- (calendar_model_initialize_value): Implement.
- (calendar_model_value_is_empty): Implement.
-
-2000-06-21 Damon Chaplin <damon@helixcode.com>
-
- * gui/e-day-view.c (e_day_view_reshape_long_event): set event before
- using it!
- (e_day_view_init): used new colors from tigert.
-
-2000-06-21 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/e-day-view.c, gui/e-week-view.c: Remove the usage of the "x"
- and "y" arguments.
-
-2000-06-21 Damon Chaplin <damon@helixcode.com>
-
- * gui/gnome-cal.c (gnome_calendar_direction): changed so it keeps the
- selection range. It just moves it on one day/week etc. This makes
- it very handy for the keyboard shortcut code.
-
- * gui/calendar-commands.c (calendar_control_activate): fixed bug
- setting the radio button active.
-
- * gui/e-day-view.[hc]: added support for keyboard navigation and
- selection of the time range.
-
-2000-06-20 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/calendar-model.c (calendar_model_set_value_at): Implemented.
- (calendar_model_is_cell_editable): Implemented.
-
- * cal-client/cal-client.c (cal_client_update_object): Take in an
- iCalObject instead of a stringified version.
-
- * gui/gnome-cal.c (gnome_calendar_update_object): Removed.
- (gnome_calendar_remove_object): Removed.
- (save_ical_object_cb): Use the CalClient function.
-
- * gui/e-day-view.c (e_day_view_on_delete_occurrence): Likewise.
- (e_day_view_on_unrecur_appointment): Likewise.
- (e_day_view_finish_long_event_resize): Likewise.
- (e_day_view_finish_resize): Likewise.
- (e_day_view_key_press): Likewise.
- (e_day_view_on_editing_stopped): Likewise.
- (e_day_view_on_top_canvas_drag_data_received): Likewise.
- (e_day_view_on_main_canvas_drag_data_received): Likewise.
- (e_day_view_on_delete_appointment): Likewise.
-
- * gui/e-week-view.c (e_week_view_on_editing_stopped): Likewise.
- (e_week_view_key_press): Likewise.
- (e_week_view_on_delete_occurrence): Likewise.
- (e_week_view_on_unrecur_appointment): Likewise.
- (e_week_view_on_delete_appointment): Likewise.
-
- * gui/gncal-todo.c (ok_button): Likewise.
- (delete_todo): Likewise.
-
-2000-06-19 Damon Chaplin <damon@helixcode.com>
-
- * gui/event-editor-dialog.glade: tidied up dialog a bit, adding
- space etc.
-
- * gui/e-week-view.c (e_week_view_reshape_events): removed debug msg.
-
-2000-06-18 Ettore Perazzoli <ettore@helixcode.com>
-
- * cal-util/Makefile.am (INCLUDES): Include from
- `$(top_builddir)/libical/src/libical' too. [For the generated
- libical `icalversion.h' header.]
- * cal-client/Makefile.am (INCLUDES): Likewise.
-
-2000-06-18 Damon Chaplin <damon@helixcode.com>
-
- * gui/e-day-view.c (e_day_view_on_top_canvas_drag_data_received):
- fixed a DnD bug.
-
-2000-06-17 Dan Winship <danw@helixcode.com>
-
- * cal-client/Makefile.am (INCLUDES): Fix to not depend on
- installed ical.h
-
-2000-06-17 Damon Chaplin <damon@helixcode.com>
-
- * gui/e-week-view.c: added little buttons which are shown when there
- are more events than will fit in a day. Clicking on the button takes
- the user to the 1-Day view and shows the full day.
-
- * gui/e-day-view.c:
- * gui/e-week-view.c: set the "use_ellipsis" arg to TRUE for the EText
- items so we get tooltips automatically. Though we may want to use our
- own code to show tooltips so we can show the tips when the mouse is
- around the edges of the event box, and we may want to show the start
- and end times of the event in full.
-
- * gui/calendar-commands.c (calendar_control_activate):
- * gui/gnome-cal.h: added view_toolbar_buttons[] so we can access the
- radio buttons in the code easily. We need this if we want to jump to
- another view programmatically.
-
-2000-06-16 Damon Chaplin <damon@helixcode.com>
-
- * gui/jump.xpm: new icon for the EWeekView to jump to the day.
-
- * gui/Makefile.am (EXTRA_DIST): added jump.xpm
-
-2000-06-16 Damon Chaplin <damon@helixcode.com>
-
- * gui/calendar-model.c (calendar_model_class_init): #ifdef'ed out
- references to functions which don't exist yet, so evolution still
- compiles.
-
-2000-06-16 Damon Chaplin <damon@helixcode.com>
-
- * cal-util/test-recur.c: updated.
-
- * cal-util/cal-recur.[hc]: mostly finished, though it depends on the
- iCalObject struct being updated to support more of iCalendar.
-
-2000-06-16 Damon Chaplin <damon@helixcode.com>
-
- * pcs/.cvsignore: added icalendar-test.
-
-2000-06-15 Damon Chaplin <damon@helixcode.com>
-
- * cal-util/Makefile.am (test_recur_LDADD): use libical.a
-
-2000-06-15 Dan Winship <danw@helixcode.com>
-
- * cal-util/Makefile.am (noinst_PROGRAMS): merge the two separate
- noinst_PROGRAMS declarations into one so automake accepts it.
- (INCLUDES): include libical src dir so we don't depend on having
- ical.h already installed
-
-2000-06-14 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/calendar-model.c: GPtrArray cannot insert stuff in the
- middle of the array (!), so use plain GArray everywhere. Sigh.
-
-2000-06-13 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-client/cal-client.c (cal_client_get_object): Use vCalendar
- again.
-
- * cal-util/calobj.c (ical_object_find_in_string): From Seth, make
- it use vCalendar again.
-
-2000-06-13 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/calendar-model.c (obj_updated_cb): Juggle some eggs in
- asynchronous fashion. Finished implementing.
- (obj_removed_cb): Implemented. This one needs no juggling.
- (calendar_model_set_cal_client): Only load the objects if we have
- a client.
- (calendar_model_destroy): Disconnect from the client's signals.
-
- * gui/Makefile.am (evolution_calendar_SOURCES): Added
- calendar-model.[ch] to the list of sources.
-
- * pcs/cal-backend-imc.c (cal_backend_imc_get_n_objects): Doh,
- return the computed value.
-
-2000-06-13 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/calendar-model.c (CalendarModelPrivate): Added the array of
- objects and the hash table of UID->array index.
- (calendar_model_row_count): Return the length directly from the
- array instead of asking the Wombat.
- (calendar_model_value_at): Implemented.
- (calendar_model_new): Create an empty model. We provide a new
- setter function now.
- (calendar_model_construct): Removed function.
- (calendar_model_set_cal_client): New function to set the calendar
- client and object type at any time. This lets us reuse a calendar
- model object.
-
- * cal-util/calobj.h (iCalObjectField): Just report whether the
- object has alarms; not every single alarm.
-
-2000-06-13 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/Makefile.am (SHELL_OBJS): Removed.
- (evolution_calendar_LDADD): Link with
- `$(top_builddir)/shell/libeshell.a'.
-
-2000-06-09 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component-factory.c (factory_fn): Pass NULL for the new args
- @create_folder_fn and @remove_folder_fn.
- (create_view): Updated to match the new
- `EvolutionShellComponentCreateViewFn'. Return
- `EVOLUTION_SHELL_COMPONENT_UNSUPPORTEDTYPE' if type is not
- "calendar".
-
-2000-06-09 Federico Mena Quintero <federico@helixcode.com>
-
- * idl/evolution-calendar.idl (Cal): Added a get_n_objects()
- method.
-
- * pcs/cal-backend.c (cal_backend_get_n_objects): New function.
-
- * pcs/cal-backend-imc.c (cal_backend_imc_get_n_objects):
- Implemented.
-
- * pcs/cal.c (Cal_get_n_objects): Implemented.
-
- * cal-client/cal-client.c (cal_client_get_uids): Free the ev.
- (cal_client_get_n_objects): Implemented.
-
- * cal-util/calobj.h (iCalObjectField): New enumeration to identify
- the fields in an iCalObject.
-
-2000-06-08 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/event-editor.c (event_editor_destroy): Free the private
- structure.
-
-2000-06-08 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-util/calobj.c (ical_object_to_vobject): Allow for NULL
- summaries.
-
-2000-06-07 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/event-editor.c (toolbar): Added missing tooltips. We still
- need icons, though.
-
-2000-06-07 Seth Alves <alves@hungry.com>
-
- * cal-util/calobj.c (ical_object_find_in_string): put this back in,
- it's still used in cal-backend-imc.c:cal_backend_imc_update_object
-
- * cal-client/cal-client.c (cal_client_get_object): instead of
- returning a text representation, decode the text and return an
- iCalObject. Also added CalClientGetStatus which indicates
- success or type of failure.
-
- * cal-util/calobj.c (ical_object_find_in_string): #ifed out
- ical_object_find_in_string since it is unused now.
-
- * cal-client/client-test.c (list_uids): track get_object change
- * gui/calendar-commands.c (calendar_iterate): same
- * gui/e-day-view.c (e_day_view_update_event): same
- * gui/e-week-view.c (e_week_view_update_event): same
- * gui/print.c (print_day_details): same
- (print_day_summary): same
- (print_todo_details): same
- * gui/gnome-cal.c (trigger_alarm_cb): same
- * gui/gncal-todo.c (gncal_todo_update): same
-
-2000-06-06 Seth Alves <alves@hungry.com>
-
- * cal-util/icalendar.c, icalendar-save.c: fixed a bunch of problems
- * cal-util/calobj.c (ical_object_find_in_string): use libical
- instead of libversit
- (ical_object_to_string): same
- (dump_icalobject): prints the contents of an icalobject for debugging
-
- * gui/Makefile.am (LINK_FLAGS): link libical.a instead of libical.la
- so we don't have to modify the build system of the released libical
- * cal-client/Makefile.am (client_test_LDADD): same
- * cal-util/Makefile.am (icalendar_test_LDADD): same
-
-2000-06-06 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-util/calobj.c (ical_object_destroy): Removed from the public
- header; made static. Now everyone should use refcounting.
-
- * pcs/cal-backend-imc.c (free_ical_object): Use
- ical_object_unref().
- (remove_object): Likewise.
-
-2000-06-02 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/calendar-commands.c (print): New function to call the print
- engine.
- (calendar_toolbar): Added the Print button.
- (calendar_control_activate): Added the File/Print item.
-
- * gui/e-day-view.c (e_day_view_get_selected_time_range): Allow
- start_time and end_time to be NULL.
-
- * gui/e-week-view.c (e_week_view_get_selected_time_range):
- Likewise.
-
- * gui/print.c (range_selector_new): Show the range selector
- widgets. Use the correct radio group for all of them!
- (print_calendar): Do the dialog box here. We may want to split
- this function later into smaller chunks.
-
-2000-06-05 Damon Chaplin <damon@helixcode.com>
-
- * gui/e-week-view-event-item.c (e_week_view_event_item_button_press):
- allow the right button to popup the menu, even when the event is
- being edited.
-
- * gui/e-week-view.c:
- * gui/e-day-view.c: Set the keyboard focus to the EDayView/EWeekView
- when the right button is clicked, so that any event being edited is
- saved before any action (e.g. opening the Event Editor dialog) is
- started. Note that this won't work if we switch to asynchronous
- notification.
-
-2000-06-02 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/event-editor.c (tb_save_and_close_cb): Implemented.
- (toolbar): Added an icon for the Save and Close command.
- (save_ical_object): Recompute the title of the window here. Maybe
- it would be better to do it when we actually get the
- "object_changed" signal from the CalClient.
- (file_close_cb): Implemented.
-
-2000-06-02 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/gnome-cal.c (save_ical_object_cb): Implemented.
- (gnome_calendar_add_object): Removed function, since it was
- identical to gnome_calendar_update_object(). Modified the rest
- of the code to use only the latter.
- (gnome_calendar_remove_object): Be more paranoid about the UID.
- (gnome_calendar_update_object): Ditto. Also, renamed this
- function from gnome_calendar_object_changed(), for consistency
- with the lower-level CalClient interface.
-
- * gui/event-editor.c (event_editor_class_init): New
- "save_ical_object" signal to ask that our parent store the
- calendar object to the backend.
- (save_ical_object): New function to save the calendar object,
- actually if just emits the signal.
- (file_save_cb): Implemented.
- (dialog_to_ical_object): We want priv->
- alarm_program_run_program_entry (i.e. the entry inside the
- GnomeFileEntry), not the file entry itself.
- (dialog_to_ical_object): Only insert the recurrence ending date if
- the event is recurrent!
-
-2000-06-02 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/Makefile.am: Fixed EXTRA_DIST.
-
-2000-06-01 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/gnome-cal.c (editor_closed_cb): Handler for the
- "editor_closed" signal of the event editor; we just destroy it
- then.
-
- * gui/event-editor.c (app_delete_event_cb): Callback used when the
- dialog is closed. Release the iCalObject here instead of the
- event editor's destroy handler, and emit the new "editor_closed"
- signal.
-
-2000-06-01 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/event-editor-dialog.glade: Change of plans. The toplevel
- GnomeApp is now generated with Glade instead of being created in
- the program code. Otherwise we can't migrate the accelerators to
- the new toplevel and they won't work.
-
- * gui/event-editor.[ch]: EventEditor now derives from GtkObject.
- This lets us use the GnomeApp created by libglade and still have
- signals and stuff.
-
- * gui/event-editor.c (create_menu): Tell the UI handler that the
- menubar is the GnomeApp's existing one, not to create a new one.
- (create_toolbar): Tell the UI handler to use the GnomeApp's
- existing toolbar.
- (event_editor_focus): New function to raise/focus an event editor.
-
- * gui/gnome-cal.c (gnome_calendar_edit_object): Use
- event_editor_focus().
-
-2000-06-01 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/calendar-commands.c (calendar_control_activate): Put the
- toolbar into a frame to make it look like standard GNOME toolbars.
- Also, set `GNOME_DOCK_ITEM_BEH_NEVER_VERTICAL' so that it does not
- do evil things when its moved to the left or the right of the
- window.
-
-2000-05-31 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/gnome-cal.h (GnomeCalendar): Added a hash table to map
- calendar objects to their respective event editors.
-
- * gui/gnome-cal.c (gnome_calendar_init): Create the
- object_editor_hash.
- (gnome_calendar_destroy): Free the object_editor_hash.
- (gnome_calendar_edit_object): New function to centralize the
- launching of event editors; if one already exists for a particular
- calendar object, we just raise its window.
- (edit): Use gnome_calendar_edit_object().
-
- * gui/calendar-commands.c (display_objedit): Use
- gnome_calendar_edit_object().
- (display_objedit_today): Likewise.
-
- * gui/e-day-view.c (e_day_view_on_new_appointment): Likewise.
- (e_day_view_on_edit_appointment): Likewise.
-
- * gui/e-week-view.c (e_week_view_on_new_appointment): Likewise.
- (e_week_view_on_edit_appointment): Likewise.
-
- * gui/event-editor.c (event_editor_new): Do not take in an
- iCalObject; rather provide an event_editor_set_ical_object()
- function. We need this because a single editor may be switched
- between different calendar objects. Also, do not show the event
- editor; leave it up to the client code.
- (event_editor_construct): Likewise.
- (clear_widgets): New function to clear the widgets to default
- values.
- (fill_widgets): New function to fill in the widgets from the
- iCalObject. We don't do this in init_widgets() anymore.
- (free_exception_clist_data): New function to free the exceptions
- clist data. We were leaking the row data.
- (init_widgets): Hook to the destroy signal of the exceptions
- clist.
- (event_editor_set_ical_object): New function. Now it also makes a
- copy of the calendar object for the event editor; clients do not
- need to copy it anymore.
- (event_editor_destroy): Unref the UI handler as well.
- (event_editor_class_init): New "ical_object_released" signal to
- notify the parent that we are no longer editing the calendar
- object.
- (make_title_from_ico): Handle NULL objects.
-
- * gui/event-editor.h (EventEditor): Removed fields that are no
- longer used.
-
-2000-05-31 Damon Chaplin <damon@helixcode.com>
-
- * cal-util/Makefile.am: added test-recur test program.
-
- * cal-util/test-recur.c: new file to test the recurrence code.
-
- * cal-util/.cvsignore: added test-recur.
-
- * cal-util/cal-recur.c: updated.
-
-2000-05-30 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/event-editor.c (event_editor_construct): Create the UI
- handler after we have constructed the parent GnomeApp.
- (main_menu): Menu template is now in place.
- (toolbar): Tollbar template is now in place.
- (create_toolbar): Turn off labels in the toolbar since it sucks;
- it should support non-homogeneous buttons with horizontal icons
- and text.
-
-2000-05-29 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/gnome-cal.c (gnome_calendar_object_changed): Removed the
- flags argument, since now we just proxy the calendar object to the
- calendar client.
-
- * gui/event-editor.c (alarm_unit_get): Moved over from
- event-editor-utils.c.
-
- * gui/event-editor-utils.[ch]: Removed files, since the two
- functions that were left there (i.e. the ones not present in
- e-dialog-widgets) can simply be moved to event-editor.c.
-
- * gui/Makefile.am (evolution_calendar_SOURCES): Removed
- event-editor-utils.[ch] from the list of sources.
-
-2000-05-27 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/event-editor-utils.c: Moved many functions to
- e-util/e-dialog-widgets.c.
-
-2000-05-25 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/event-editor-dialog.glade: Put the main notebook directly
- under a simple GtkWindow. We are going to pull out the notebook
- and slap it into our custom-built GnomeApp, anwyays.
-
- * gui/event-editor.c: Made the EventEditor derive from GnomeApp.
- Added a BonoboUIHandler for its menu and toolbar.
- (make_title_from_ico): Create a nice title for the window.
- (get_widgets): Fetch the Glade widgets here instead of all over
- the place.
- (event_editor_new): Temporary hack to show the dialog here, just
- so that I can test it.
-
- * gui/Makefile.am (EXTRA_DIST): Added the Glade messages file.
-
-2000-05-25 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/main.c (init_bonobo): Do not initialize libglade twice.
-
- * gui/component-factory.c (create_view): Set the folder_uri
- property, otherwise the calendar will not get loaded into the
- view.
-
-2000-05-25 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/main.c: Make it so that warnings don't crash calendar.
-
-2000-05-25 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/evolution-calendar-control.c: Removed.
-
- * gui/main.c: New.
-
- * gui/control-factory.c: New.
- * gui/control-factory.h: New.
-
- * gui/calendar-component-factory.c: New.
- * gui/calendar-component-factory.c: New.
-
- * gui/evolution-calendar-control.c (calendar_control_factory):
- Renamed from `calendar_factory'.
- (calendar_control_factory_init): Renamed from
- `calendar_factory_init'.
-
- * gui/Makefile.am: Link with the files from `$(builddir)/shell'.
-
- * gui/evolution-calendar.gnorba: New.
- * gui/evolution-calendar.oafinfo: New.
-
-2000-05-24 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/print.c (range_selector_new): New function to create the
- custom range selector.
- (print_dialog): New function to show the print dialog.
- (print_calendar): Use the print dialog.
-
-2000-05-24 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/Makefile.am: Added libepaned.a.
-
- * gui/gnome-cal.c: Switched from GtkPaned to EPaned.
-
-2000-05-22 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/calendar-commands.c (calendar_get_events_in_range): Removed
- function.
-
- * gui/mark.c (mark_month_item): Use
- cal_client_get_events_in_range().
-
- * gui/calendar-commands.c (show_year_view_clicked): Comment out,
- since we don't have a year view.
-
- * gui/gnome-cal.c (setup_widgets): Removed the year view stuff.
- (gnome_calendar_get_current_view_name): Likewise.
- (gnome_calendar_update_view_times): Likewise.
- (gnome_calendar_direction): Likewise.
- (gnome_calendar_set_view): Likewise.
- (gnome_calendar_update_all): Likewise.
- (gnome_calendar_object_updated_cb): Likewise.
- (gnome_calendar_object_removed_cb): Likewise.
- (gnome_calendar_time_format_changed): Likewise.
- (gnome_calendar_get_current_time_range): Likewise.
-
- * gui/gnome-cal.h (GnomeCalendar): Removed the year view stuff.
-
- * gui/Makefile.am (evolution_calendar_SOURCES): Added layout.[ch],
- print.[ch]. Removed quick-view.[ch], year-view.[ch] since they
- are no longer used. Removed all the old Pilot crap.
-
-2000-05-20 Damon Chaplin <damon@helixcode.com>
-
- * cal-util/cal-recur.[hc]: new files to implement iCalendar recurrence
- rules. These are only part finished, but people may like to check that
- the architecture seems OK.
-
-2000-05-17 Damon Chaplin <damon@helixcode.com>
-
- * gui/e-day-view.c (e_day_view_on_delete_occurrence):
- * gui/e-week-view.c (e_week_view_on_delete_occurrence): use a copy of
- the iCalObject so we detect the change in the "update_event" callback.
- Maybe we should just update the view ourselves and then we wouldn't
- need to detect any change in the callback.
-
- * cal-util/calobj.c (ical_object_reset_recurrence): new function to
- get rid of any recurrence rules. Used when we 'unrecur' an event.
-
- * gui/e-day-view.c (e_day_view_key_press): don't add a new event if it
- won't fit, or we end up adding a new event for each key press.
- (e_day_view_update_event_label): don't update it if it doesn't have
- an EText item (i.e. it isn't visible).
-
- * gui/e-day-view-time-item.c: allow selection of times using this
- column.
-
-2000-05-19 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-util/timeutil.c (time_add_minutes): Fixed warning message.
- (time_add_day): Likewise.
- (time_add_month): Likewise.
- (time_add_year): Likewise.
- (time_from_day): Of all functions, *this* one had to have a bug.
- Set the tm.tm_isdst to -1 to specify that we don't know whether
- the time is in DST or not. This fixes *many* bugs upstream.
- (time_week_begin): Likewise. We never noticed this since the week
- functions are never used.
- (time_week_end): Likewise.
-
-2000-05-17 Seth Alves <alves@hungry.com>
-
- * gui/event-editor.c: hooked up more widget signals to callbacks
- to the gladified dialog acts more like the original one.
-
-2000-05-16 Seth Alves <alves@hungry.com>
-
- * gui/event-editor.c (recurrence_toggled): hook the radio buttons
- to the pages of the notebook.
- (append_exception):
- (recurrence_exception_added):
- (recurrence_exception_deleted):
- (recurrence_exception_changed): code to deal with the recurrence
- exception list.
-
-2000-05-15 Seth Alves <alves@hungry.com>
-
- * gui/event-editor.[ch]: gladeified replacement for eventedit.c
-
- * gui/event-editor-utils.[ch]: utilities used by event-editor.c
-
- * gui/event-editor-dialog.glade: glade file used by event-editor.c
-
-2000-05-14 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/gnome-cal.c (display_notification): Use the alarm
- notification dialog.
- (display_notification_cb): New callback for the result of the
- alarm notification dialog.
-
- * gui/dialogs/alarm-notify.glade: New file with the alarm
- notification dialog.
-
- * gui/dialogs/alarm-notify-dialog.[ch]: New file.
-
- * gui/dialogs/Makefile.am: New file.
-
- * gui/Makefile.am (SUBDIRS): Added the dialogs directory.
-
-2000-05-13 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/gnome-cal.c (trigger_alarm_cb): Better error checking, and
- plug leaks of str_ico and ico.
-
- * gui/evolution-calendar-control.c (main): Initialize libglade.
-
-2000-05-13 Ettore Perazzoli <ettore@helixcode.com>
-
- * pcs/Makefile.am (INCLUDES): Add
- `-I$(top_builddir)/libical/src/libical'.
-
-2000-05-12 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-util/calobj.c (generate): Use a (dtend - dtstart) offset to
- compute the ending time of the occurrence. This takes care of
- recurring events that span multiple days. Also, removed the DST
- condition since it did not look right at all: if you have a daily
- appointment at 18:00, it still should happen at 18:00 even during
- daylight savings.
-
- * gui/gnome-cal.c (gnome_calendar_tag_calendar): Use the timeutil
- functions instead of calculating the month's times by hand. Use
- cal_obj_instance_list_free() instead of freeing the list by hand.
- Clip the range we pass to mark_gtk_calendar_day().
- (mark_gtk_calendar_day): Fixed off-by-one error at the end of the
- month by adding real day offsets.
-
-2000-05-11 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/gnome-cal.c (add_alarms_for_object): New function to add
- today's alarms for a single object.
- (gnome_calendar_object_updated_cb): Update the object's alarms.
-
- * idl/evolution-calendar.idl (Cal): Added a
- get_alarms_for_object() method.
-
- * pcs/cal.c (Cal_get_alarms_for_object): Implemented method.
-
- * pcs/cal-backend.c (cal_backend_get_alarms_for_object): New
- function.
-
- * pcs/cal-backend-imc.c (cal_backend_imc_get_alarms_for_object):
- Implemented.
-
- * cal-client/cal-client.c (cal_client_get_alarms_for_object): New
- function.
-
-2000-05-11 Dan Winship <danw@helixcode.com>
-
- * gui/calendar-commands.c (calendar_control_activate): Now that we
- depend on current gnome-libs we can make the toolbar detachable
- again.
-
- * pcs/icalendar-save.c (timet_to_icaltime): remove unused timezone
- variable to make this compile on BSD systems (where timezone is
- the name of a function)
-
-2000-05-11 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/gnome-cal.c (gnome_calendar_update_all): Removed unused
- arguments. Load the initial alarms here.
- (load_alarms): New function to load a day's worth of alarms.
- (gnome_calendar_class_init): Eeeek! This was taking in an
- incorrect argument type.
- (gnome_calendar_init): Now the calendar keeps a hash table of
- UIDs->queued alarms. Create the hash table here.
- (gnome_calendar_destroy): Destroy the alarms hash table.
- (gnome_calendar_object_updated_cb): Remove the alarms for the
- object and regenerate them.
- (gnome_calendar_object_removed_cb): Remove the alarms for the
- object.
-
- * gui/alarm.c (alarm_add): Do not take in a CalendarAlarm, just
- the trigger time, the callback and the closure data. Return an
- opaque identifier for the alarm so that it can be removed by the
- client code if needed. Use the queue_alarm() helper function.
- (queue_alarm): Helper function to actually queue the alarm and set
- up the itimer. Deal with a nonzero return value from
- setitimer().
- (alarm_remove): New function to remove an alarm based on its ID.
- (pop_alarm): New helper function; pops the first alarm of the
- queue and resets the timer as appropriate.
- (alarm_ready): Simplified a lot by using pop_alarm().
-
- * idl/evolution-calendar.idl (Cal): Added get_alarms_in_range().
-
- * pcs/cal.c (build_instance_seq): New function to build a CORBA
- sequence from the internal list of instances.
- (Cal_get_events_in_range): Use build_instance_seq().
- (Cal_get_alarms_in_range): Implemented new method.
-
- * pcs/cal-backend.c (cal_backend_get_alarms_in_range): New
- function with the get_alarms_in_range() engine.
-
- * pcs/cal-backend-imc.c (cal_backend_imc_get_alarms_in_range):
- Implemented the get_alarms_in_range() method.
-
- * cal-client/cal-client.c (cal_client_get_alarms_in_range): New
- client-side function for getting the alarms.
- (build_instance_list): New helper function to build the
- CalObjInstance list from the CORBA sequence.
- (cal_client_get_events_in_range): Use build_instance_list().
-
- * gui/calendar-commands.h: #include <cal-util/calobj.h>. #include
- "gnome-cal.h".
-
- * gui/e-week-view.c: #include "calendar-commands.h" instead of
- main.h; the latter is an obsolete file and will be killed.
-
- * gui/evolution-calendar-control.c (main): Call init_bonobo()
- before anything else. We need the GTK+ object system initialized.
-
- * gui/Makefile.am (evolution_calendar_SOURCES): Do not use main.h.
-
- * cal-util/cal-util.c (cal_alarm_instance_list_free): New function.
-
-2000-05-10 Matt Loper <matt@helixcode.com>
-
- * gui/calendar-commands.c (calendar_control_activate): Move
- "about" menuitem to the help menu.
-
-2000-05-10 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/Makefile.am: Added main.h. Combined the two EXTRA_DIST
- sections.
-
-2000-05-09 Christopher James Lahey <clahey@helixcode.com>
-
- * pcs/cal-backend-imc.c: Set the format when creating a new
- calendar.
-
-2000-05-09 Christopher James Lahey <clahey@helixcode.com>
-
- * pcs/cal-factory.c: Removed double free of method_string in
- uri->method_string.
-
-2000-05-08 Ettore Perazzoli <ettore@helixcode.com>
-
- * pcs/cal.h: Include "calendar/pcs/evolution-calendar.h" instead
- of "evolution-calendar.h".
-
- * pcs/cal-backend.h: Include "calendar/pcs/evolution-calendar.h"
- instead of "evolution-calendar.h".
-
-2000-05-08 Seth Alves <alves@hungry.com>
-
- * gui/e-day-view.c (e_day_view_on_delete_appointment): call
- e_day_view_stop_editing_event here to avoid a divide by zero
- a bit further on. i'm not sure if this is the best fix for this.
-
-2000-05-08 Federico Mena Quintero <federico@helixcode.com>
-
- * pcs/cal-backend.h (CalBackendClass): CalBackendClass now is just
- an interface for calendar backends; this is an abstract class.
- Put in the vtable for the backend methods.
-
- * pcs/cal-backend.c (cal_backend_new): Removed function, since
- CalBackend is not just an abstract class.
- Removed implementation-specific functions and made public
- functions call the virtual methods instead.
-
- * pcs/cal-backend-imc.[ch]: New files with the CalBackendIMC
- implementation; this implements a backend for iCalendar and
- vCalendar files. Moved the implementation-specific stuff from
- cal-backend.[ch] to here.
-
- * pcs/cal-backend-imc.c (CalendarFormat): Moved enumeration to
- here. Added a CAL_UNKNOWN value for when the backend is not
- loaded yet.
- (cal_backend_imc_init): Initialize priv->format as CAL_UNKNOWN.
- (save_to_vcal): Use the same VCProdIdProp value as in
- cal-util/calobj.c. Use "1.0" as the VCVersionProp as per the
- vCalendar spec.
- (ensure_uid): Return nothing, since the result value need not be
- used anymore.
- (add_object): Since we mark the calendar as dirty anyways, we do
- not need to check the result value of ensure_uid() anymore.
- (remove_object): Asssert that we know how to handle the object's
- type. We do this in add_object() anyways.
-
- * pcs/Makefile.am (libpcs_a_SOURCES): Added cal-backend-imc.[ch].
-
- * gui/gnome-cal.c: Replaced debugging printf()s with g_message()
- so that we can see the line number where they occur.
-
- * gui/gnome-cal.c (gnome_calendar_load_cb): Sort of handle the
- LOAD_METHOD_NOT_SUPPORTED result code, and added a default for the
- switch.
-
- * cal-client/cal-listener.h (CalListenerLoadStatus): Removed
- enumeration; it is stupid to translate all values for the
- CalClient when it is going to translate them again.
- (CalListenerClass::cal_loaded): This signal now passes the
- LoadStatus directly from the CORBA side.
-
- * cal-client/cal-listener.c (Listener_cal_loaded): Do not
- translate the status value.
-
- * cal-client/cal-client.h (CalClientLoadStatus): Added the
- CAL_CLIENT_LOAD_METHOD_NOT_SUPPORTED error code.
-
- * cal-client/cal-client.c (cal_loaded_cb): Translate the CORBA
- version of the LoadStatus result code.
-
- * pcs/cal-factory.c (CalFactoryPrivate): New methods field for the
- hash table from method strings to the GtkTypes for backend class
- types.
- (cal_factory_init): Create the priv->methods hash table.
- (cal_factory_destroy): Free the priv->methods hash table.
- (cal_factory_register_method): New function to register a backend
- class for a particular URI method.
- (launch_backend_for_uri): New function to launch a backend for a
- particular URI's method.
- (load_backend): Use launch_backend_for_uri(). Move the error
- notification code from load_fn() to here.
- (create_backend): Use launch_backend_for_uri(). Move the error
- notification code form create_fn() to here; it is #ifdefed out
- since currently cal_backend_create() does not have any error
- reporting capabilities.
-
- * idl/evolution-calendar.idl (Listener::LoadStatus): Added a
- PROTOCOL_NOT_SUPPORTED error code.
-
- * pcs/cal-factory.c (cal_factory_load cal_factory_create): Removed
- functions, since they were supposed to be internal only.
- (CalFactory_load): Call queue_load_create_job() directly.
- (CalFactory_create): Likewise.
-
-2000-05-08 Damon Chaplin <damon@helixcode.com>
-
- * gui/e-week-view.c (e_week_view_remove_event_cb):
- * gui/e-day-view.c (e_day_view_remove_event_cb): don't set the ico->uid
- to NULL or we won't find any other occurrences of the event. Set the
- editing_event_day/num to -1 instead.
-
- * gui/e-week-view-event-item.c (e_week_view_event_item_draw): fixed the
- positioning of the icons for long events.
-
- * cal-util/calobj.c (ical_object_normalize_summary): forgot to
- terminate the string.
-
-2000-05-07 Damon Chaplin <damon@helixcode.com>
-
- * gui/e-day-view.c (e_day_view_on_main_canvas_drag_data_received):
- (e_day_view_on_top_canvas_drag_data_received): show the EText item,
- just in case it hasn't moved, otherwise it won't appear.
-
- * gui/e-day-view.h (E_DAY_VIEW_BAR_WIDTH): increased from 6 to 8 to
- make it easier to drag an event. Also increased E_DAY_VIEW_GAP_WIDTH
- since it must be >= the BAR_WIDTH.
-
-2000-05-07 Matt Loper <matt@helixcode.com>
-
- * gui/evolution-calendar-control.c (PROPERTY_CALENDAR_URI):
- Changed to "folder_uri" from "calendar_uri".
- (set_prop): The uri given to us is a directory, so we append a
- filename onto the end before we use it.
-
-2000-05-06 Damon Chaplin <damon@helixcode.com>
-
- * cal-util/timeutil.c (time_day_begin):
- (time_day_end): changed these so they just do a simple localtime(),
- update the struct tm, then do a mktime(). I don't know why it used to
- look at the tm_isdst flags etc. From a little test program I wrote
- which steps through testing every hour for a year it wasn't working
- correctly, and the new code does.
- (time_add_day): also got rid of the stuff that looked at tm_isdst here.
- My test program now works better.
-
-2000-05-06 Chris Toshok <toshok@helixcode.com>
- * gui/.cvsignore: ignore evolution-calendar.pure
-
- * gui/Makefile.am: add support for building evolution-calendar.pure
-
-2000-05-06 Damon Chaplin <damon@helixcode.com>
-
- * gui/e-day-view.c:
- * gui/e-week-view.c: finish editing event when user hits Return key.
- (e_week_view_on_text_item_event): stop event signals after doing any
- other calls, since otherwise it will also stop any other resulting
- event signals.
-
- * gui/e-week-view-event-item.c (e_week_view_event_item_draw): don't
- draw the start/end times while editing.
-
- * gui/eventedit.c: changed the Summary field to a GtkEntry, since we
- now only want a single line of text.
-
- * cal-util/calobj.c (ical_object_normalize_summary): new function to
- convert the summary field to a single line of text, by converting any
- sequence of CR & LF characters to a single space.
- (ical_object_create_from_vobject): call the above function. I think
- all functions that load iCalObjects go through this.
- (ical_new): called it here as well just in case.
-
-2000-05-06 Damon Chaplin <damon@helixcode.com>
-
- * gui/week-view.[hc]: removed.
-
-2000-05-06 Damon Chaplin <damon@helixcode.com>
-
- * gui/gncal-day-panel.[hc]:
- * gui/gncal-day-view.[hc]:
- * gui/gncal-full-day.[hc]:
- * gui/gncal-week-view.[hc]:
- * gui/layout.[hc]:
- * gui/view-utils.[hc]: removed old calendar view files.
-
-2000-05-06 Damon Chaplin <damon@helixcode.com>
-
- * cal-util/calobj.[hc]: added guint ref_count to iCalObject struct,
- and ical_object_ref/unref() functions. I've updated all the gui/
- stuff to use ref_counts but I haven't touched the pcs/ stuff. Maybe
- just using ical_object_destroy() is OK there.
-
- * gui/gncal-todo.c:
- * gui/calendar-commands.c:
- * gui/eventedit.c:
- * gui/e-week-view.c:
- * gui/e-day-view.c: use refcounting for iCalObjects.
-
- * gui/e-day-view-main-item.c:
- * gui/e-day-view-top-item.c:
- * gui/e-day-view.c: try not to ever draw outside the event, even when
- the event is very small.
-
-2000-05-05 Damon Chaplin <damon@helixcode.com>
-
- * gui/e-day-view.c: don't allow recurring events to be resized or
- dragged, and don't show the resize/drag cursors. Actually it may be
- better to let the user do the resize/drag and then ask them what they
- want to do - change the single occurrence or the entire series.
-
- * gui/e-day-view-time-item.c (e_day_view_time_item_show_popup_menu):
- use e_auto_kill_popup_menu_on_hide() to destroy the popup menu.
-
- * gui/popup-menu.c: include e-gui-utils.h
-
-2000-05-04 Damon Chaplin <damon@helixcode.com>
-
- * gui/e-day-view.c (e_day_view_foreach_event_with_uid): for the long
- events pass E_DAY_VIEW_LONG_EVENT as the day. Fixes SEGV.
-
- * gui/calendar-commands.c: when we switch views, grab the focus.
-
- * gui/gnome-cal.c (gnome_calendar_tag_calendar):
- (gnome_calendar_mark_gtk_calendar_day): changed this so it uses
- cal_client_get_events_in_range(), and doesn't load any objects.
- Also just return if it isn't visible.
-
- * gui/calendar-commands.c (calendar_get_events_in_range): call
- g_list_sort() to sort the list rather than g_list_insert_sorted() for
- each element. It is much more efficient.
- Also changed it so that the co->ev_start/end fields are copied from
- the CalObjInstance rather than the parameters to the function
- (that is right, isn't it?)
- Also freed the list elements, and finally the list.
- (calendar_iterate): changed this to use cal_client_get_events_in_range
- since that is more efficient than getting all the uids and then loading
- and parsing all the events.
-
- * pcs/cal-backend.c (save): output the '... saved' message before
- freeing the string!
-
- * gui/gncal-todo.c (gncal_todo_update):
- * gui/e-week-view.c (e_week_view_update_event):
- * gui/e-day-view.c (e_day_view_update_event):
- * gui/calendar-commands.c (calendar_get_events_in_range):
- (calendar_iterate): free obj_string after it is parsed.
-
-2000-05-02 Damon Chaplin <damon@helixcode.com>
-
- * gui/calendar-commands.c (calendar_control_activate): set the active
- radio button here. Oops - it wasn't a Bonobo problem after all.
-
- * gui/popup-menu.c (popup_menu): added call to
- e_auto_kill_popup_menu_on_hide() to destroy the menu.
-
- * gui/e-week-view.c (e_week_view_show_popup_menu):
- * gui/e-day-view.c (e_day_view_on_event_right_click): ico->user_data
- isn't useful any more, since the event editor keeps its own iCalObject.
- So for now we make the menu commands available even when the event is
- being edited in the event editor.
- Also corrected misspellings of 'occurance' -> 'occurrence'.
-
- * gui/eventedit.c (event_editor_destroy): destroy the iCalObject.
- The event editor now uses its own independent iCalObject.
-
- * gui/e-week-view.c (e_week_view_on_unrecur_appointment):
- * gui/e-day-view.c (e_day_view_on_unrecur_appointment): create a new
- uid for the new single instance. I'm not sure what we should do about
- the creation/last modification times of the objects.
-
- * gui/e-week-view.c (e_week_view_on_edit_appointment):
- * gui/e-day-view.c (e_day_view_on_edit_appointment): duplicate the
- iCalObject before passing it to the event editor, since it will change
- the fields. If we don't duplicate it we won't know what has changed
- when we get the "update_event" callback.
-
- * gui/e-week-view.c (e_week_view_key_press):
- * gui/e-day-view.c (e_day_view_key_press): set the created and last_mod
- times of the new iCalObject. We may want to set the default alarm as
- well.
-
- * cal-util/calobj.c (ical_gen_uid): made this function public so we
- can generate new uids if necessary.
-
-2000-05-01 Damon Chaplin <damon@helixcode.com>
-
- * gui/gnome-cal.[hc] (gnome_calendar_get_current_time_range): new
- function to get the currently seleted time range form the current view.
-
- * gui/calendar-commands.c (display_objedit): use the above function
- to get the time for the new appointment.
-
- * gui/e-week-view.c:
- * gui/e-day-view.c: use a shallow copy of the ico when we update the
- times (when resizing/dragging). Otherwise we won't detect that the
- time has changed in the "update_event" callback.
-
- Also added functions to get the currently selected time range.
-
-2000-04-30 Seth Alves <alves@hungry.com>
-
- * pcs/icalendar-save.c (icalcomponent_create_from_ical_object): set
- attendee and contact address correctly.
-
- * pcs/cal-backend.c (icalendar_calendar_load): init priv->object_hash
- when loading.
- (cal_get_type_from_filename): if file extension is .ical, consider
- the file an ical file.
-
-2000-05-01 Damon Chaplin <damon@helixcode.com>
-
- * cal-util/calobj.c (ical_object_compare_dates): new function to see
- if the event dates have changed (including any recurrence rules).
- It is used for optimization when we get the "object_changed" signal.
- We have to do far less work if the dates are unchanged.
-
- * gui/e-week-view.c:
- * gui/e-day-view.c: only draw the selection when we have the keyboard
- focus, since the user expects to be able to type in a new event when
- the selection is shown. Also keep the selection when we lose focus,
- but just don't show it.
-
- Also quite a few changes to cope with the new client/server
- architecture.
-
- * gui/e-day-view-top-item.c (e_day_view_top_item_draw):
- * gui/e-day-view-main-item.c (e_day_view_main_item_draw):
- * gui/e-week-view-main-item.c (e_week_view_main_item_draw_day):
- only draw the selection if the widget has the keyboard focus.
-
- * gui/gnome-cal.c (mark_gtk_calendar_day): fixed so it works with
- events longer than one day. And changed the code for updating events
- in the new views.
-
-2000-04-27 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/evolution-calendar-control.c
- (init_bonobo): OAFized.
-
- * gui/main.c (main): Initialize with OAF if `USING_OAF'.
-
- * gui/evolution-calendar-control.c: New #define
- `CONTROL_FACTORY_ID', varying according to whether we are
- `USING_OAF'.
- (calendar_factory_init): Use `CONTROL_FACTORY_ID'.
-
- * gui/Makefile.am: Updated for OAF.
-
- * pcs/cal-factory.h: Explicitly #include
- "calendar/pcs/evolution-calendar.h" instead of just
- "evolution-calendar.h".
-
- * cal-client/cal-client.c (cal_client_construct) [USING_OAF]: Use
- OAF.
-
- * cal-client/client-test.c (init_corba): New function, implemented
- differently depending on `USING_OAF'.
-
-2000-04-27 <alves@hungry.com>
-
- * pcs/cal-backend.c (cal_backend_load): fix memory leak
- (save_to_vcal): same
- (save): same
- (cal_backend_load): same
-
-2000-04-26 Christopher James Lahey <clahey@helixcode.com>
-
- * cal-util/.cvsignore: Replaced libcal-util.la with *.la
-
- * pcs/.cvsignore: Added *.la and *.lo.
-
-2000-04-25 Federico Mena Quintero <federico@helixcode.com>
-
- * pcs/cal-factory.c (backend_last_client_gone_cb): Renamed from
- backend_destroy_cb. Now we use it for the "last_client_gone"
- signal from the backend. Also, unref the backend to destroy it.
- (add_backend): Connect to the "last_client_gone" signal of the
- backend.
- (cal_factory_get_n_backends): New function to query the number of
- running backends.
-
- * pcs/cal-backend.c (cal_backend_class_init): Register the new
- "last_client_gone" signal. It is emitted when the last Cal client
- goes away. It is used to notify the factory when a backend may be
- safely destroyed.
- (cal_destroy_cb): Emit the "last_client_gone" signal when the last
- client disconnects from the backend.
-
-2000-04-25 Seth Alves <alves@hungry.com>
-
- * gui/e-day-view.c (e_day_view_find_event_from_ico): compare
- iCalObjects by their UIDs instead of by their pointers.
-
- * pcs/cal-backend.c (cal_backend_destroy): don't save on destroy.
-
-2000-04-25 Ettore Perazzoli <ettore@helixcode.com>
-
- * cal-client/Makefile.am: Add `$(datadir)/idl'.
-
- * pcs/Makefile.am (idl_flags): Add `$(datadir)/idl'.
- (INCLUDES): Use `$(BONOBO_GNOME_CFLAGS)'.
-
-2000-04-25 Seth Alves <alves@hungry.com>
-
- * gui/gnome-cal.c (gnome_calendar_destroy): hook for widget
- destroy -- used to unref the CalClient so wombat knows we are gone.
- (gnome_calendar_class_init): added a class init for this widget.
-
- * gui/e-day-view.c (e_day_view_update_event): allow for null ico
-
- * gui/e-week-view.c (e_week_view_update_event): allow for null ico
-
-2000-04-24 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-client/client-test.c (main): The path to the test calendar
- changed when we moved stuff around. Users will have to tweak this
- for their CVS setup, anyways.
- (create_client): Create or load the calendar as appropriate.
- (client_destroy_cb): Exit the main loop if both clients are gone.
- (main): Connect to the "destroy" signal of the clients so that we
- can terminate the test program.
-
-2000-04-24 Seth Alves <alves@hungry.com>
-
- * pcs/icalendar.c (parse_person): allow for null CN
- (parse_person): allow for null sent_by
-
- * pcs/Makefile.am: build icalendar-test
-
- * pcs/icalendar-test.c: a test which loads an ical file and
- converts it to our internal format, and then saves it back out.
-
-2000-04-24 Damon Chaplin <damon@helixcode.com>
-
- * gui/Makefile.am: added new source files and pixmaps, and removed
- old source files, which can be deleted.
-
- * gui/e-week-view-titles-item.[hc]:
- * gui/e-week-view-main-item.[hc]:
- * gui/e-week-view-event-item.[hc]:
- * gui/e-week-view.[hc]: new files implementing the week/month views.
-
- * gui/yearview.xpm:
- * gui/monthview.xpm:
- * gui/weekview.xpm:
- * gui/workweekview.xpm:
- * gui/dayview.xpm: new pixmaps for the toolbar buttons. These aren't
- intended to be the final pixmaps.
-
- * gui/calendar-commands.c: added radio buttons to the toolbar to
- switch between the calendar views, and moved the am_pm_flag here so we
- can get rid of view-utils.c.
-
- * gui/gnome-cal.[hc]: made it a subclass of GtkVBox, rearranged the
- widgets into 2 notebooks, and added the selection_start_time and
- selection_end_time fields.
-
- * gui/goto.c: updated to use new selection time range.
-
- * gui/quick-view.c: added '#include <gtk/gtkwindow.h>' so it compiles.
-
- * gui/e-day-view.[hc]: changed the interface to support the new
- selection time range, got rid of a few debugging messages and changed
- a few bits.
-
-2000-04-21 Seth Alves <alves@hungry.com>
-
- * pcs/icalendar-save.c: start on code to do the opposite of
- icalendar.c (convert from iCalObjects to libical's icalcomponents).
-
- * gui/calendar-commands.c (calendar_control_activate): moved
- "About Calendar" into the View menu so it shows up.
-
-2000-04-20 Seth Alves <alves@hungry.com>
-
- * gui/gnome-cal.c (gnome_calendar_changed_cb): new function: callback
- for listener's object updated signal.
- (gnome_calendar_object_removed_cb): new function: callback for
- listener's object removed signal.
- (gnome_calendar_new): hook up listener's "obj_updated" and
- "obj_removed" signals so if evolution is running twice,
- they will both see changes right away.
- (gnome_calendar_object_changed): don't call update_all, since
- it will be called by the listener.
- (gnome_calendar_remove_object): don't call update_all
- (gnome_calendar_add_object): don't call update_all
-
- * gui/gncal-full-day.c (child_realize): create fullday's gcs
- even if pixmap_bell has already been created. this was
- causing crashes if the calendar was run twice.
-
-2000-04-19 Seth Alves <alves@hungry.com>
-
- * gui/eventedit.c (ee_rp_init_rule): changed the order around
- a bit to avoid a Gtk-CRITICAL crash
-
- * gui/gncal-todo.c (gncal_todo_update): fixed code to populate
- the todo clist
-
- * cal-client/cal-client.c (cal_client_get_uids): don't check
- type against CALOBJ_TYPE_ANY since it will always match.
- (cal_client_get_uids): same (re: CALOBJ_TYPE_ANY)
-
- * pcs/cal-backend.c (build_uids_list): same (re: CALOBJ_TYPE_ANY)
-
- * pcs/cal.c (Cal_get_uids): same (re: CALOBJ_TYPE_ANY)
-
- * pcs/cal-backend.c (remove_object): don't call save from here
- because in all cases the caller of remove_object calls save
-
- * gui/calendar-commands.c (calendar_set_uri): calls gnome_calendar_open
- instead of checking on disk and calling load or create.
-
- * gui/gnome-cal.c (gnome_calendar_object_changed): fixed to use
- cal_client_update_object -- editing and dragging events works again
- (gnome_calendar_open): collapsed gnome_calendar_load and
- gnome_calendar_create into this function. added new type
- GnomeCalendarOpenMode which has the value CALENDAR_OPEN or
- CALENDAR_OPEN_OR_CREATE.
-
- * gui/evolution-calendar-control.c (calendar_properties_init): create
- a property bag for this control
- (set_prop): callback for property sets
- (get_prop): callback for proprety gets
-
- * gui/calendar-commands.c (calendar_set_uri): new function,
- called when the "calendar_uri" property is set on the calendar-
- control's property bag.
-
-2000-04-18 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-util/Makefile.am (INCLUDES): Fix include path.
-
-2000-04-16 Federico Mena Quintero <federico@helixcode.com>
-
- * pcs/cal-factory.h (CalFactoryClass): We have a new
- "last_calendar_gone" signal that Wombat can use to terminate
- itself properly.
-
- * pcs/cal-factory.c (cal_factory_class_init): Register the
- "last_calendar_gone" signal.
- (backend_destroy_cb): Emit the "last_calendar_gone" signal instead
- of killing the factory.
-
- * pcs/Makefile.am: Added $(CORBA_GENERATED) to BUILT_SOURCES.
- (INCLUDES): Make the log domain be "wombat-pcs".
-
-2000-04-17 Seth Alves <alves@hungry.com>
-
- * pcs/cal-backend.c (add_object): removed implicit save, since
- we don't want to save as we load from disk.
- (cal_backend_update_object): added a call to save, since it
- isn't done by add_object now.
-
-2000-04-16 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-util/Makefile.am: Renamed library from libcalutil to
- libcal-util, to be consistent with libcal-client. Install header
- files in $(includedir)/evolution/cal-util.
- (INCLUDES): Add "cal-util" log domain for glib.
- (libcal_clientincludedir): The header files are now installed in
- $(includedir)/evolution/cal-client.
-
- * cal-util/cal-util.h: Fix includes.
-
- * cal-client/client-test.c: Fix includes.
-
- * pcs/Makefile.am: Create libpcs.a, not a shared library, because
- it is for internal use by Wombat only. The header files should
- not be installed, either. Removed all the old Tlacuache stuff.
-
- * gui/Makefile.am (EXTRA_DIST): We no longer distribute
- gncal.desktop.
- (evolution_calendar_INCLUDES): Add "calendar-gui" for the glib log
- domain.
-
- * gui/*.[ch]: Fix cal-util and cal-client includes.
-
- * pcs/Makefile.am (INCLUDES): Added "pcs" log domain for glib.
-
- * pcs/*.[ch]: Fix cal-util includes.
-
-2000-04-11 Chris Toshok <toshok@helixcode.com>
-
- * pcs/icalendar.c (icaltime_to_timet): use HAVE_TIMEZONE to switch
- between linux's timezone variable and *bsd's method of getting the
- gmt offset.
-
-2000-04-10 Seth Alves <alves@hungry.com>
-
- * pcs/cal-backend.c (save_to_vcal): create and save an actual
- vcalendar instead of a list of vcal objects.
-
-2000-04-10 Damon Chaplin <damon@helixcode.com>
-
- * gui/Makefile.am (INCLUDES): moved srcdir directories to the top so
- we search headers in the evolution tree before installed headers.
- (Otherwise when you do 'make install' lots of files in gui/ get
- rebuilt, since they depend on the installed cal-client.h which has just
- been updated.)
-
-2000-04-09 Seth Alves <alves@hungry.com>
-
- * gui/gnome-cal.c (gnome_calendar_load): catch cal_loaded signal
- on the cal client.
- (gnome_calendar_load_cb): callback for cal_loaded signal. moved
- gnome_calendar_update_all from gnome_calendar_load to here.
-
- * gui/calendar-commands.c: minor cleanups
-
- * pcs/cal-backend.c (save_to_vcal): copied code from gnome-pim
- to write vcal to a file
- (save): filled it with more gnome-pim code
- (add_object): call save () after changing
- (remove_object): same
- (cal_backend_create): same
- (cal_backend_remove_object): same
-
-2000-04-08 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/Makefile.am: Removed linking with libetable and libeminicard
- since they weren't being used.
-
-2000-04-08 Seth Alves <alves@hungry.com>
-
- * gui/gnome-cal.c (gnome_calendar_create): new function:
- friendly wrapper for cal_client_create_calendar
-
- * gui/calendar-commands.c (new_calendar): call gnome_calendar_create
- if no filename is provided
-
- * gui/prop.c (properties): calendar is a frame
-
- * gui/calendar-commands.c (calendar_control_activate): sort out the
- menus a bit, more of them show up now.
-
- * gui/Makefile.am: don't build library or test, just the bonobo control
-
- * gui/gncal-todo.c (simple_todo_editor): calendar is a frame instead
- of a window, now.
-
- * gui/gnome-cal.c (gnome_calendar_new): same
-
- * gui/goto.c (goto_dialog): same
-
-2000-04-06 Seth Alves <alves@hungry.com>
-
- * gui/calendar-commands.c (calendar_control_activate): removed
- uih from the argument list, added cal. use cal as user_data
- in callbacks rather than the control.
- (calendar_control_deactivate): removed uih from argument list
-
-2000-04-05 Seth Alves <alves@hungry.com>
-
- * gui/calendar-commands.c (setup_menu): removed
- (setup_appbar): removed
- (calendar_control_activate): new function -- does the work
- that setup_appbar and setup_menu used to do.
- (calendar_control_deactivate): undoes what calendar_control_activate
- does by removing the toolbar items and menu items.
-
- * gui/Makefile.am: build test-calendar-widget and evolution-calendar,
- common stuff is in a library
-
- * gui/gnome-cal.c (gnome_calendar_get_type): made the calendar widget
- based on a gtk_frame rather than a gnome_app
-
- * gui/calendar-commands.c: split out some of main.c
-
- * gui/evolution-calendar-control.c: bonobo bung so evolution
- can use the calendar widget
-
-2000-04-01 Matt Loper <matt@helixcode.com>
-
- * pcs/.cvsignore: Added *.lo.
-
-2000-03-30 Seth Alves <alves@hungry.com>
-
- * gui/main.c (calendar_get_events_in_range):
- cal_client_get_events_in_range returns a list of CalObjInstance *, not
- a list of (char *) uid.
-
- * Makefile.am (SUBDIRS): readded the gui directory
-
- * gui/main.c: temporarily added alarm_defaults back in,
- since the calendar doesn't link without it
-
-2000-03-29 Matt Loper <matt@helixcode.com>
-
- * Makefile.am: remove the gui directory, which doesn't compile.
-
-2000-03-28 Matt Loper <matt@helixcode.com>
-
- * pcs/Makefile.am: create a libpcs.la library, for use in the
- wombat.
-
-2000-03-28 Seth Alves <alves@hungry.com>
-
- * gui/Makefile.am (LINK_FLAGS): added libeutil.la and libetext.a
-
- * gui/main.c (calendar_iterate): switch from string_to_ical_object to
- ical_object_find_in_string
- (calendar_get_events_in_range): same
- (session_save_state): commented out references
- to gcal->client->filename
-
-2000-03-27 Federico Mena Quintero <federico@helixcode.com>
-
- * pcs/cal-backend.c (cal_backend_get_object): Use
- ical_object_to_string().
-
- * cal-util/calobj.c (ical_object_to_string): Moved over from
- pcs/cal-backend.c (was string_from_ical_object).
- (get_calendar_base_vobject): Likewise, moved over from
- pcs/cal-backend.c.
-
- * cal-util/cal-util.c: Removed string_to_ical_object(); the
- correct function is in calobj.[ch], called
- ical_object_find_in_string(). Removed ical_object_to_string,
- since we now implement it in calobj.c.
-
- * cal-util/calobj.c: Removed ical_object_new_from_string(); see
- above.
-
- * idl/evolution-calendar.idl (CalObjInstance): Calendar object
- instances now contain only the UID for the object, not the whole
- string representation of the object. This allows clients to
- implement caching of objects if they wish.
-
- * pcs/cal.c (Cal_get_events_in_range): Likewise.
-
- * pcs/cal-backend.c (build_event_list): Likewise.
-
- * cal-client/cal-client.c (cal_client_get_events_in_range):
- Likewise.
-
- * cal-util/cal-util.h (CalObjInstance): Likewise.
-
- * cal-util/cal-util.c (cal_obj_instance_list_free): Likewise.
- (cal_obj_uid_list_free): Assert that the UIDs in the list are not
- NULL.
-
- * pcs/tlacuache.gnorba (repo_id): The calendar factory also
- supports the Unknown interface.
-
-2000-03-17 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/e-day-view.c: Fix includes.
- (e_day_view_on_delete_occurance): Do not call save_default_calendar().
- (e_day_view_on_delete_appointment): Likewise.
- (e_day_view_on_unrecur_appointment): Likewise.
- (e_day_view_finish_long_event_resize): Likewise.
- (e_day_view_finish_resize): Likewise.
- (e_day_view_key_press): Likewise.
- (e_day_view_on_editing_stopped): Likewise.
- (e_day_view_on_top_canvas_drag_data_received): Likewise.
- (e_day_view_on_main_canvas_drag_data_received): Likewise.
-
-2000-03-13 Damon Chaplin <damon@helixcode.com>
-
- * gui/e-day-view*.[hc]: new files for the Day/Work-Week views.
-
-2000-03-12 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/main.c (gnome_calendar_locate): Removed function now that it
- is no CORBA server in the GUI.
- (save_default_calendar): Removed function. Now the personal
- calendar server will take care of saving modified calendars when
- appropriate.
- (close_cmd): Do not call unregister_calendar_services().
-
- * gui/eventedit.c (ee_ok): Do not save the calendar.
-
- * gui/gncal-day-panel.c (day_view_range_activated): Likewise.
-
- * gui/gncal-todo.c (ok_button): Likewise.
- (delete_todo): Likewise.
-
- * gui/gncal-full-day.c (delete_occurance): Likewise.
- (delete_appointment): Likewise.
- (unrecur_appointment): Likewise.
- (child_focus_out): Likewise.
- (update_from_drag_info): Likewise.
-
- * gui/gnome-cal.c (gnome_calendar_new): Removed obsolete call to
- create the CORBA server.
-
- * gui/gnome-cal.h (GnomeCalendar): Renamed `calc' field to
- `client'.
-
- * cal-client/cal-client.h (CalClient): Removed filename and
- corba_server fields.
-
-2000-03-10 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/main.c (main): Do not pass the INIT_SERVER flag to
- gnome_CORBA_init_with_popt_table(). Check for exceptions
- properly.
- (main): Initialize Bonobo.
- (main): Call process_dates() to parse the dates from the command
- line before we dump the events or the TODOs.
- (main): Use bonobo_main() instead of gtk_main().
-
- * cal-util/calobj.c (ical_new): Initialize the alarm types here.
- Do not call default_alarm() anymore, since that is a GUI issue.
- (default_alarm): Removed function.
- (alarm_defaults): Removed defaults data.
-
- * pcs/tlacuache.c (calendar_notify): Removed stubs for
- alarm_defaults, calendar_notify(), debug_alarms.
-
-2000-03-09 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/Makefile.am: Removed the corba-cal stuff. Commented out the
- Pilot conduit stuff for now.
-
- * gui/calendar.c: Random #ifdefs to make it build, although this
- file is going away.
-
- * gui/Makefile.am: Removed referenes to calobj.[ch] and timeutil.[ch].
-
- * gui/calendar-conduit.c: Fixup includes.
-
- * gui/calendar-conduit.h: Fixup includes.
-
-2000-03-09 Seth Alves <alves@hungry.com>
-
- * gui/gnome-cal.h: replaced "Calendar *cal" with "CalClient *calc"
- in the GnomeCalendar struct.
-
- * gui/*.c: tracked change from Calendar * to CalClient
-
- * gui/main.c: moved alarm_defaults from here to cal-util/calobj.c
- (calendar_get_events_in_range): pulled this out of calendar.c and
- fixed it up to use cal-client stuff. i'm not sure where to put it yet.
-
- * gui/main.c (calendar_iterate): pulled this one out of calendar.c also
-
-2000-03-07 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-client/Makefile.am: Removed cal-client-alarm.[ch] from the
- list of sources. This was a miscommunication on our part.
-
-2000-03-05 Seth Alves <alves@hungry.com>
-
- * cal-client/cal-client-alarm.c: stubs for client side
- access to alarm structures. this will probably change,
- since i don't know what i'm doing.
-
- * cal-util/alarm-enums.h: enums for alarms needed by
- both the client and the server
-
- * remaining source files in calendar/... have been moved
- to calendar/gui.
-
- * gui/alarm.c: start to decouple the view from the model
- in the alarm editing code
-
-2000-03-03 Seth Alves <alves@hungry.com>
-
- * cal-util/Makefile.am: new file -- things shared between
- the client and server go in this directory
-
- * calobj.c calobj.h icalendar.c icalendar.h
- timeutil.c timeutil.h cal-util.c cal-util.h where moved
- backend stuff went into pcs. shared stuff went into
- cal-util.
-
-2000-03-02 Federico Mena Quintero <federico@helixcode.com>
-
- At this point the calendar client and personal calendar server
- files were moved to the idl/, cal-client/, and pcs/ directories.
-
- * idl/Makefile.am: New file.
-
- * cal-client/Makefile.am: New file. Moved the libcal-client stuff
- from calendar/Makefile.am to here.
-
- * pcs/Makefile.am: New file. Moved the tlacuache stuff from
- calendar/Makefile.am to here.
-
- * Makefile.am (SUBDIRS): Added the idl and cal-client directories.
-
- * calendar.h: Removed the references to cal-backend.h and its
- stuff. This file is going away soon!
-
- * icalendar.c: #include <config.h>. Also, we don't need to
- include cal-backend.h or gnome.h.
-
- * icalendar.h: Protect from multiple inclusions.
-
-2000-03-01 Federico Mena Quintero <federico@helixcode.com>
-
- * Makefile.am: Use the gnome-config flags for orbit-idl.
- Create a libcal-client library with the calendar client object.
-
-2000-02-29 Federico Mena Quintero <federico@helixcode.com>
-
- * Makefile.am: Removed stale rule for the conduit.
-
-2000-02-21 Matt Loper <matt@helixcode.com>
-
- * .cvsignore: Added *.lo.
-
-2000-02-19 Matt Loper <matt@helixcode.com>
-
- * .cvsignore: Added tlacuache and tl-test.
-
-2000-02-18 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * Makefile.am (INCLUDES): Use BONOBO_VFS_GNOME_CFLAGS instead of
- GNOMEUI_INCLUDES, as we use Bonobo and VFS.
-
-2000-02-17 Seth Alves <alves@hungry.com>
-
- * cal-backend.h: moved CalendarFormat type def here
-
- * cal-backend.c (cal_backend_load): if extension suggests
- an ical file, attempt to load an iCal file.
- (cal_get_type_from_filename): returns CAL_ICAL if file
- extension is 'ics' or 'ifb', else returns CAL_VCAL
- (icalendar_calendar_load): moved this here from
- icalendar.c because it needs to call the static function
- add_object.
-
-2000-02-17 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-client.c (cal_client_remove_object): Implemented.
-
- * cal.c (cal_notify_remove): Implemented.
- (Cal_remove_object): Implemented.
- (cal_get_epv): Fill in the remove_object field in the epv.
-
- * cal-backend.c (cal_backend_remove_object): Implemented.
- (notify_remove): New function to notify clients that an object was
- removed.
-
-2000-02-16 Russell Steinthal <rms39@columbia.edu>
-
- * calobj.[ch], eventedit.c, main.c: Change iCalObject.organizer
- from char* to iCalPerson*
-
- * calobj.[ch]: Change iCalObject.related from list of char* to
- list of iCalRelation*; assorted related fixes
-
- * icalendar.c: interface between libical and the gnomecal
- internal representation
-
-2000-02-11 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-client.c (cal_client_update_object): Implemented.
-
- * cal.c (cal_notify_update): New function to notify the listener
- about an updated object.
- (Cal_update_object): Implemented.
- (Cal_get_uids): set_release() the sequence to TRUE.
- (Cal_get_events_in_range): Likewise.
-
- * cal-backend.c (remove_object): New function to remove objects
- from a calendar backend.
- (cal_backend_update_object): New public function to update an
- object and notify clients about it.
-
- * evolution-calendar.idl (Cal): Added update_object() and
- delete_object() methods.
- (Listener): Removed the obj_changed method and renamed obj_added
- to obj_updated. We now only have updated and removed notifiers.
-
- * cal-listener.[ch]: Removed the "changed" notification code.
- Changed the "added" notification code to the "updated"
- notification.
-
- * cal-client.c: Likewise.
-
- * tlacuache.c (create_cal_factory): Connect to "destroy" on the
- factory and exit the main loop when the factory is destroyed.
-
- * cal-factory.c (backend_destroy_cb): New callback used when a
- backend is destroyed. Removes the backend from the factory's hash
- table and unrefs the factory if all backends go away.
- (add_calendar_client): Free the environment.
-
- * cal.c (cal_new): Use bonobo_object_unref() if we fail to
- initialize.
-
- * cal-listener.c (cal_listener_new): Likewise.
-
- * layout.c (layout_events): Plug li.partition memory leak.
-
-2000-02-10 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-backend.c (cal_backend_add_cal): Connect to the Cal's
- destroy signal.
- (cal_backend_remove_cal): Killed function now that removal of Cal
- objects is done in their destroy callback.
- (cal_destroy_cb): New callback to remove a Cal from the backend's
- list of clients. Also, the backend destroys itself when there are
- no more clients connected to it.
- (save): New placeholder function to save a backend.
- (destroy): New function to destroy a backend's data.
- (cal_backend_destroy): Save the calendar and destroy it.
-
- * cal.c (cal_destroy): Reset the priv->backend to NULL.
-
- * cal-factory.c (add_calendar_client): There is no need to call
- cal_backend_remove_cal(); we can now just destroy the Cal object.
- (create_fn): Make sure we always unref the URI.
- (load_fn): Move the URI unref to the end of the function for
- safety.
-
- * cal-factory.c (add_calendar_client): Unref the Cal only if
- notification of the listener was unsuccessful. Otherwise, the
- calendar user agent (Listener side) keeps the reference.
-
- * tl-test.c (list_uids): Free the calobj.
-
- * cal-client.c (cal_loaded_cb): Use bonobo_object_unref() to get
- rid of the listener.
- (load_or_create): Likewise.
- (destroy_factory): New function to get rid of the factory.
- (destroy_listener): New function to get rid of the listener.
- (destroy_cal): New function to get rid of the calendar client
- interface object.
- (cal_client_destroy): Free all resources.
- (cal_client_get_object): CORBA_free() the calobj string. Boy, I
- love memprof.
-
- * cal-listener.c (cal_listener_destroy): Reset the priv->cal to
- CORBA_OBJECT_NIL.
-
- * cal-backend.c (cal_backend_remove_cal): Do not unref the Cal,
- since the calendar user agent owns it.
- (cal_backend_add_cal): Do not ref the Cal, since the calendar user
- agent owns it.
-
- * cal-factory.c (add_calendar_client): Use bonobo_object_unref()
- to get rid of the calendar client interface object.
-
- * calobj.c (ical_object_create_from_vobject): Duplicate the
- default "PUBLIC" string.
-
-2000-02-09 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-factory.c (cal_factory_load): Added documentation comment.
- (load_fn): Do not print a message if the backend could not be
- loaded due to a non-fatal error.
- (queue_load_create_job): Moved the stuff from cal_factory_load()
- to here. Now this function serves to queue load or create
- requests.
- (cal_factory_load): Use queue_load_create_job().
- (cal_factory_create): Implemented; use queue_load_create_job().
- (create_fn): New job handler for creating new calendars.
- (create_backend): New function to create a new backend with a new
- calendar.
- (add_backend): New helper function to add backends to the
- factory's hash table.
- (load_backend): Use add_backend() instead of adding the backend by
- ourselves.
-
- * cal-client.c (load_or_create): Moved the functionality from
- cal_client_load_calendar() to here, and added an option to create
- a new calendar instead of loading an existing one.
- (cal_client_load_calendar): Use load_or_create().
- (cal_client_create_calendar): Implemented.
-
- * cal-backend.c (cal_backend_create): Implemented.
-
- * evolution-calendar.idl (LoadStatus): Added an IN_USE error for
- create requests.
-
- * cal-listener.h (CalListenerLoadStatus): Added CAL_LISTENER_LOAD_IN_USE.
-
- * cal-listener.c (Listener_cal_loaded): Convert the IN_USE error.
-
- * cal-client.h (CalClientLoadStatus): Added CAL_CLIENT_LOAD_IN_USE.
-
- * cal-client.c (cal_loaded_cb): Handle CAL_LISTENER_LOAD_IN_USE.
-
- * tl-test.c: New test program for the calendar client side; it
- also exercises the server side by sending commands to it.
-
- * Makefile.am: Added the tl-test program.
-
- * tlacuache.gnorba: Updated.
-
- * tlacuache.c (create_cal_factory): Use the right GOAD id.
-
- * cal-client.c (cal_client_construct): Use the right GOAD id.
-
-2000-02-08 Federico Mena Quintero <federico@helixcode.com>
-
- * evolution-calendar.idl (Cal): Added get_uids() method to get a
- list of UIDs based on object types.
-
- * cal-backend.c (cal_backend_get_uids): Implemented get_uids() in
- the backend.
-
- * cal.c (Cal_get_uids): Implemented get_uids() method.
-
- * cal-client.c (cal_client_get_uids): Implemented client-side
- function.
-
- * cal-util.c (cal_obj_instance_list_free): Doh. Free the list,
- not the last link.
- (cal_obj_uid_list_free): New function to free a list of UIDs.
-
- * GnomeCal.idl (Repository): Removed unused method
- get_object_by_id_list(). This is just for cleanup purposes and to
- remind me exactly of what needs to be moved over to
- evolution-calendar.idl.
- (Repository): Removed unused get_objects() method.
-
- * corba-cal.c (init_calendar_repo_class): Removed the unused
- get_objects method.
-
- * calobj.h (CalObjFindStatus): New status value enumeration for
- the find function.
-
- * calobj.c (ical_object_find_in_string): New function to parse a
- complete calendar and find a calendar object in it. This should
- be used instead ical_object_new_from_string() in the future.
-
- * evolution-calendar.idl (CalObjInstance): Added an uid field.
- Now the idea is that whenever calendar object strings are passed
- around, their UIDs are passed along with them so that the actual
- object can be pulled from the whole VCAL object using its UID to
- identify it.
-
- * cal-util.h (CalObjInstance): Added uid field.
-
- * cal-util.c (cal_obj_instance_list_free): Free the UIDs.
-
- * cal-backend.c (build_event_list): Store the object's UID in the
- instance structure.
-
- * cal.c (Cal_get_events_in_range): Copy the UID field to the CORBA
- structure.
-
- * cal-client.c (cal_client_get_events_in_range): Copy the UID
- field from the CORBA structure.
-
- * main.c (gnome_cal_file_menu): Removed unfinished html-month stuff.
-
- * Makefile.am (gnomecal_SOURCES): Removed html-month.c.
-
- * gnome-cal.c: #include "alarm.h"
- (mail_notify): Made static.
-
- * alarm.h: #include "calobj.h"
-
- * corba-cal-factory.h (init_corba_server): Fixed prototype.
-
- * quick-view.c (create_items_for_event): Made static.
-
- * gncal-todo.c (column_resized): Made static.
-
- * layout.c (find_index): Made static.
-
-2000-02-08 Federico Mena Quintero <federico@helixcode.com>
-
- * evolution-calendar.idl (CalObjInstance): New struct to wrap
- instances of calendar objects for recurrencies and alarms.
- (Cal::get_events_in_range): New method to get ocurring and
- recurring events by time range.
-
- * cal-backend.c (cal_backend_get_events_in_range): New function to
- get a list of event instances in a time range.
- (string_from_ical_object): New internal function.
- (cal_backend_get_object): Use string_from_ical_object() instead of
- doing everything ourselves.
- (cal_backend_get_events_in_range): New function to get a list of
- the events that occur or recur in a specified time range.
-
- * cal-client.c (cal_client_get_events_in_range): Implemented
- client-side function.
-
- * cal-util.h:
- * cal-util.c: New files with utilities and types common to the
- client and server parts.
- (CalObjInstance): New structure to hold an instance of an actual
- occurrence, recurrence, or alarm trigger of a calendar object.
- (cal_obj_instance_list_free): New function to free a list of
- calendar object instances.
-
- * cal.c (Cal_get_events_in_range): Implemented new method.
-
- * corba-cal.c (cal_repo_get_updated_objects): Free `str' with
- free(), not g_free(), since calendar_get_as_vcal_string() uses
- writeMemVObject(), which uses realloc(). Fixed in gnome-pim as
- well.
-
-2000-02-04 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-backend.c (get_calendar_base_vobject): New function to
- create the base VObject for a calendar.
- (cal_backend_get_object): Create the base calendar and add the
- sought object to it, then stringify it.
-
- * evolution-calendar.idl (Listener::obj_added
- Listener::obj_changed): Now these pass in just the UIDs, not the
- complete objects.
-
- * cal-listener.c (Listener_obj_added): Changed to pass in the uid,
- not the object.
- (Listener_obj_changed): Likewise.
-
- * cal-client.h (CalClientClass): Made the obj_added and
- obj_changed signals take in the UIDs, not the full objects.
-
- * cal-client.c (obj_added_cb): Likewise.
- (obj_changed_cb): Likewise.
-
-2000-02-04 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-backend.c (CalBackendPrivate): Renamed the event_hash field
- to object_hash. Now we hash all the calendar's objects here based
- on their UIDs.
- (ensure_uid): New function to create UIDs for calendar objects
- that don't have them.
- (add_object): Ensure the object has an UID before inserting it in
- the calendar.
- (cal_backend_get_object): New function.
-
-2000-02-03 Federico Mena Quintero <federico@helixcode.com>
-
- * evolution-calendar.idl (Cal): Added the get_object() method.
-
- * cal-client.c (cal_client_get_object): New function to get a
- calendar object by its UID.
-
- * cal.c (Cal_get_object): Implemented.
-
- * cal-backend.c (cal_backend_get_object): New unfinished backend
- function. We need some reorganizing of how the calendar objects
- are stored.
-
-2000-02-02 Federico Mena Quintero <federico@helixcode.com>
-
- * Makefile.am (gnomecal_SOURCES): Added the CORBA generated
- sources.
-
-2000-02-01 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-client.c (cal_loaded): Handle the cal_loaded signal from the
- listener. Store the calendar client interface object, and emit
- our own cal_loaded signal.
- (cal_client_load_calendar): Connect to the listener's signals.
- (cal_client_class_init): Added the "obj_added", "obj_removed",
- bj_changed" signals.
- (obj_added_cb): Handle the signal from the listener.
- (obj_removed_cb): Likewise.
- (obj_changed_cb): Likewise.
-
-2000-01-30 Federico Mena Quintero <federico@helixcode.com>
-
- * Makefile.am (gnomecal_SOURCES): Added cal-client.[ch] and
- cal-listener.[ch].
-
-2000-01-30 Federico Mena Quintero <federico@helixcode.com>
-
- * evolution-calendar.idl: Changed the namespace from
- GNOME::Calendar to Evolution::Calendar.
- (Listener::LoadStatus): Fixed SUCESSS -> SUCCESS typo. And I
- never noticed it in the implementation. Ain't M-/ grand?
-
- * Makefile.am: Changed ocurrences of gnome-calendar.idl to
- evolution-calendar.idl.
-
- * *.[ch]: Changed GNOME_Calendar_foo identifiers to
- Evolution_Calendar_foo.
-
-2000-01-25 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-client.c cal-client.h: New files with the calendar client
- object.
-
-2000-01-25 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-factory.c (CalFactory_load): Check that the listener is not
- nil and emit and exception if it is.
-
- * gnome-calendar.idl (CalFactory::load CalFactory::create): Now
- these raise the NilListener exception.
-
- * tlacuache.c (calendar_notify): Error stub for alarms.
- (alarm_defaults): Stub array.
- (debug_alarms): Stub variable.
- (main): Initialize gnome-vfs.
-
-2000-01-24 Federico Mena Quintero <federico@helixcode.com>
-
- * tlacuache.c: New main module for the Tlacuache personal calendar
- server.
-
- * tlacuache.gnorba: New gnorba file for Tlacuache, the GNOME
- personal calendar server.
-
- * Makefile.am: Added the stuff necessary to build Tlacuache.
-
- * cal.c (Cal_get_uri): Convert the URI to a string before
- returning it.
-
- * cal-factory.c (CalFactory_create): Doh, this function is void.
-
- * job.c (job_add): Use g_idle_add(), not gtk_idle_add().
-
-2000-01-24 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-backend.c (cal_backend_remove_cal): New function to remove a
- calendar client interface object from a backend.
- (cal_backend_load): Convert the URI to string and use
- Parse_MIME_FromFileName(). The conversion is not very smart,
- though.
-
- * cal-factory.c (load_backend): Moved most of the error handling
- upstream to load_fn().
- (load_fn): Handle failure in case the backend could not be loaded.
- (cal_factory_destroy): Free the backends and the backend hash
- table.
- (add_calendar_client): Implemented. We create a Cal client
- interface object and attach it to the backend, and we notify the
- listener.
-
-2000-01-22 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-factory.c (lookup_backend): Renamed from lookup_calendar().
- Also, return a backend instead of a Cal client object.
-
- * cal-backend.c (cal_backend_load): Take in a GnomeVFSURI, not a
- string.
-
- * cal-listener.c (Listener_cal_loaded): Pass the load status to
- the signal.
- (cal_listener_destroy): Better error checking.
- (cal_listener_new): Better error checking.
-
- * cal-listener.h (CalListenerLoadStatus): New enum for the load
- status of a calendar.
- (CalListenerClass): Added the status argument to the cal_loaded
- signal.
-
- * gnome-calendar.idl (cal_loaded): Added a load status code.
-
- * cal-backend.h (CalBackendLoadStatus): Renamed from
- CalBackendLoadResult.
-
-2000-01-18 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-backend.c cal-backend.h: Moved the calendar backend here.
- This is the actual calendar-handling object.
- (load_from_vobject): Moved over from calendar.c. Modified to use
- a CalBackend instead of the old Calendar structure.
- (add_object): Likewise.
-
- * cal.c: Now the Cal object is just a calendar client interface
- object; we use it as a "viewport" onto a CalBackend. This also
- lets us do correct resource management.
-
- * cal-common.h: New file with common forward declarations; we
- can't have circular dependencies between headers.
-
-2000-01-18 Federico Mena Quintero <federico@helixcode.com>
-
- * cal-factory.c (cal_factory_load): Queue a load job.
- (load_fn): Load job handler. Lookup the calendar by URI, load it
- if it is not loaded, or just report it to the new listener if it is.
-
- * job.c job.h: New files with a simple job queue manager.
-
- * gnome-calendar.idl (Listener::cal_loaded): Do not return the
- whole calendar object string. The client will be able to query
- the calendar for the events it needs.
-
- * cal-listener.c (Listener_cal_loaded): Ref the calendar GNOME
- object. We unref it when the listener is destroyed.
-
-2000-01-17 Federico Mena Quintero <federico@helixcode.com>
-
- The files from the gncal directory of the gnome-pim module on CVS
- were moved here, to evolution/calendar, in preparation for the
- Evolution work. The calendar is being split into a model/view
- architecture. The model is a personal calendar server (PAS): it
- provides storage, notification, and event generation; the
- views/controllers are the calendar user agents and things like
- Pilot synchronizers.
-
-2000-01-11 Federico Mena Quintero <federico@helixcode.com>
-
- * cal.c: Removed the CORBA listener methods, adjusted for the new
- IDL.
-
- * cal-listener.c (cal_listener_init): Create the private
- structure. In it we hold a reference to the calendar the listener
- is watching.
- (cal_listener_destroy): Destroy the private structure and unref
- the calendar.
- (Listener_cal_loaded): Stuff the calendar into our private data.
- (Listener_obj_added): Adjusted for new IDL.
- (Listener_obj_removed): Likewise.
-
- * gnome-calendar.idl: New IDL for the personal calendar server.
-
- * cal.h cal.c: New files with the calendar object.
-
- * cal-listener.h cal-listener.c: New files with the calendar
- listener object.
-
- * cal-factory.h cal-factory.c: New files with the calendar factory
- object.
-
-2000-01-09 Eskil Heyn Olsen <deity@eskil.dk>
-
- * Makefile.am: Changes to remove todo capplet stuff from distro.
-
-2000-01-08 Vadim Strizhevsky <vadim@optonline.net>
-
- * calendar-conduit-control-applet.c: Added pilotID argument to
- gpilotd_conduit_mgmt_new.
-
-
-2000-01-05 Eskil Heyn Olsen <deity@eskil.dk>
-
- * GnomeCal.idl: Added an argument to get_number_of_objects, so you
- can choose which state the object should have
- (any/new/modified/...). Will also add one to choose type
- (event/journal etc).
-
- * corba-cal.c (cal_repo_get_number_of_objects): Implemented the
- new version of get_number_of_objects.
-
- * calendar-conduit.c (pre_sync): Calls various
- gnome_pilot_conduit_standard_abs_set_num_yadayda to get progress bars.
-
-2000-01-04 Eskil Heyn Olsen <deity@eskil.dk>
-
- * calendar-conduit.c (start_calendar_server): Let's not call
- g_error, but g_warning instead.
- (pre_sync): Get record numbers info, total, new, deleted etc, and
- tell gpilotd.
-
-1999-12-31 Eskil Heyn Olsen <deity@eskil.dk>
-
- * eventedit.c (ee_store_recur_end_to_ical): Adds 86400 secs (1
- day) to the date chooses by the user. This ensures the recurrence
- also occurs on that date.
- (ee_rp_init_ending_date): And subtracts 86400 secs when about to
- redisplay the box.
-
- * calendar.h: Added an argument to calendar_new, to enable certain
- features, such as initing alarms or nor.
-
- * calendar.c (calendar_new): Implemented support for the
- CALENDAR_INIT_ALARMS option to calendar_new.
-
- * corba-cal.c (cal_repo_get_updated_objects): Added
- CALENDAR_INIT_ALARMS to calendar_new calls.
-
- * main.c: Added CALENDAR_INIT_ALARMS to calendar_new calls. This
- should probably be CALENDAR_INIT_NIL, but I'm not sure, guess
- steintr should check it.
-
- * gnome-cal.c: Added CALENDAR_INIT_ALARMS to calendar_new calls.
-
- * calendar-pilot-sync.c: Added CALENDAR_INIT_NIL to calendar_new calls.
-
-1999-12-10 Russell Steinthal <rms39@columbia.edu>
-
- * eventedit.c (ee_create_ae): Fix sensitivity bug when used to
- create default alarm box (widgets in that box should always be
- sensitive, even if the enabled checkbutton is not set)
-
-1999-12-08 Eskil Heyn Olsen <deity@eskil.dk>
-
- * calendar-conduit-control-applet.c (setSettings): Capplets now
- sets first_sync on enable, this should make the conduit copy old
- entries from the pilot to gnomecal.
-
-1999-12-07 Eskil Heyn Olsen <deity@eskil.dk>
-
- * calendar-conduit.c (pre_sync): Check if local store is
- empty. If, force slow sync.
-
- * GnomeCal.idl (GNOME): Added get_number_of_objects.
-
- * corba-cal.c (cal_repo_get_number_of_objects): implemented the
- get_number_of_objects.
-
- * calendar-conduit-control-applet.c (setStateCfg): Fixed bug that
- caused the capplet to always set the sync action to Disable upon start.
-
-1999-12-05 Eskil Heyn Olsen <deity@eskil.dk>
-
- * Makefile.am (Conduits_second_DATA): Also install .desktop files
- for conduit capplets in the gnome/apps menu dir.
-
-1999-12-04 Eskil Heyn Olsen <deity@eskil.dk>
-
- * Makefile.am (EXTRA_DIST): Added .desktop files to EXTRA_DIST.
-
-1999-10-12 Clifford R. Conover <rusty@zootweb.com>
-
- * gncal-todo.c Todo List improvements.
-
- Cleaned up todo item highlighting, added support for highlighting
- events due today, and events not due yet. Colors are configurable
- on the Colors Tab of the properties window.
-
- Renamed Frame in Properties window to Colors rather then Month
- Colors since we are now asking for Todo item colors.
-
- Added ability to display time until todo item is due in list, it
- automatically selects the best denomination of time (up to weeks)
- and down to seconds to display. This should be made configurable
- in a future version.
-
- Changed Todo dialog to ask for time that event is due. This
- allows more accurate tracking of then the item is due, before the
- dialog was only asking for the date of the todo item.
-
-1999-12-03 Eskil Heyn Olsen <deity@eskil.dk>
-
- * calendar-conduit.c: undef DEBUG_CALCONDUT, suppresses debug output.
-
-1999-12-02 Russell Steinthal <rms39@columbia.edu>
-
- * alarm.c: Enhanced debug support: can be toggled on and off by
- SIGUSR1, reports alarms which could not be added
-
- * gnome-cal.c, main.[ch], prop.c: Add snooze capability for audio
- and display alarms. Snooze interval can be configured in the
- Properties box.
-
-1999-11-30 Eskil Heyn Olsen <deity@eskil.dk>
-
- * calendar-conduit.c (compare): Fixed compare bug. Also neated up
- some of the if's in set_status.
-
-1999-11-22 Russell Steinthal <rms39@columbia.edu>
-
- * Merged todo list coloring patch from stable
- * Added myself to AUTHORS, about box (per Miguel)
-
-1999-11-22 Eskil Heyn Olsen <deity@eskil.dk>
-
- * calendar-conduit.c (pre_sync): Writes some warning
- messages when pre_sync fails.
-
-1999-11-14 Eskil Heyn Olsen <deity@eskil.dk>
-
- * Makefile.am: Stupid misplaced endif cause gncal to depend on an
- install gnome-pilot... fixed... sorry.
-
-1999-11-12 Eskil Heyn Olsen <deity@eskil.dk>
-
- * Makefile.am (extra_pilot_bins): Fixed the if then else problem,
- using solution suggested by James Henstridge, appears to be caused
- by a (by now fixed) bug in my automake.
-
-1999-11-12 Russell Steinthal <rms39@columbia.edu>
-
- * prop.c: Config code for timeout, make Alarms property page use a
- vbox instead of an hbox so that the propbox stays a reasonable width.
-
- * gnome-cal.c, main.[ch]: Add timeout for audio alarms, code to load
- from config file
-
- * eventedit.c: Give some static functions external linkage so they
- can be used elsewhere (make_spin_button); add some prototypes to
- appease gcc.
-
-1999-11-11 Russell Steinthal <rms39@columbia.edu>
-
- * calendar.c (calendar_day_change): Add call to
- calendar_init_alarms() to schedule another day change alarm.
-
-1999-11-09 Eskil Heyn Olsen <deity@eskil.dk>
-
- * calendar-conduit.c: Enabled debug output. Sets a g_log_domain,
- now version 0.8.5. Consistent use of GSList/GList. Implemented
- compare, default uses one that compares the contents of a struct
- Appointment, but also has #ifdeffed code that does a field level
- comparison, not complete, but perhaps educational.
-
- * Makefile.am (#todo_conduit_control_applet_SOURCES): Fixed an
- unwanted conditional on libcalendar_conduit_la_LDFLAGS
-
-1999-11-05 Eskil Heyn Olsen <deity@eskil.dk>
-
- * calendar-conduit-control-applet.c (readStateCfg): Commented the
- code out, thus the capplet works again.
-
-1999-11-04 Eskil Olsen <deity@eskil.dk>
-
- * Makefile.am: Uses the PISOCK_LIBDIR, for people with odd install
- dirs for their pilot-link. Also install a pretty icon for the
- calendar-conduit.
-
- * calendar-conduit-control-applet.c: Modfied the
- try/revert/ok/cancel scheme to be more intuitive, also uses a
- GtkOptionMenu for the possible sync methods.
-
- * calendar-conduit-control-applet.desktop: use the nice icon...
-
- * calendar-conduit.c: Ack, had to define debug_alarms and
- alarm_default, otherwise they are undefined. Is gncal code messy
- or is this considered a way of configuring the cal engine ?
- Implemented delete_all syncabs methods.
-
- * calendar-pilot-sync.c: also had to declare debug_alarms and
- alarm_defaults, just as ugly.
-
-1999-11-02 Russell Steinthal <rms39@columbia.edu>
-
- * prop.c: Add new alarm page to properties box
-
- * prop.c, calobj.c, main.[ch] eventedit.c: New support for default
- alarms, configurable in the properties box.
-
- * gnome-cal.c, prop.c, main.[ch]: add option to beep on Display
- alarms
-
-1999-10-23 Russell Steinthal <rms39@columbia.edu>
-
- * calendar.c (calendar_new): Correctly initialize calendar_day_end
- and calendar_day_begin *before* installing day-change alarm.
-
-1999-10-21 Russell Steinthal <rms39@columbia.edu>
-
- * alarm.c, main.c: Added alarm debugging code
-
- * main.c (open_ok): Show an error box if the user tries to open a
- non-existent file; fixes bug #1818
-
-1999-10-19 Russell Steinthal <rms39@columbia.edu>
-
- * gnome-cal.c (calendar_notify): Fix typos which were causing
- invalid times in audio notification dialogs; fixes Bug #2561
-
-1999-10-18 Russell Steinthal <rms39@columbia.edu>
-
- * gncal-day-panel.c (gncal_day_panel_new): Placed the various
- elements of the day view in paned windows so that the user can
- adjust the relative sizes of the daily schedule, monthly calendar,
- and to-do list.
-
-1999-10-18 Martin Norbck <norpan@bigfoot.com>
-
- * gncal.desktop: Added swedish translation
-
-1999-10-13 Eskil Olsen <deity@eskil.dk>
-
- * Makefile.am: Hopefully the fixes the much-hated
- gnome-pilot dependency.
-
-1999-10-07 Eskil Olsen <deity@eskil.dk>
-
- * calendar.c (calendar_object_changed): moved the pilot_status =
- MOD up, so even a CHANGE_SUMMARY will set the modified flag.
-
- * calendar-conduit.c: more _free calls, vamped the noise on output.
-
-1999-10-06 Eskil Olsen <deity@eskil.dk>
-
- * *conduit*[ch]: checks return values from gpilotd_init/connect.
-
- * calender.c (vcalendar_create_from_calendar): removed a set
- of cleanVObject cleanStrTbl, since the freed memory that the
- function returned.
-
-1999-09-27 Timur Bakeyev <mc@bat.ru>
-
- * timeutil.c (time_from_isodate): Use tm.gmtoff or timezone to get
- correct offset from UTC, according to HAVE_TM_GMTOFF or HAVE_TIMEZONE.
- See also 1999-07-19 Matt Martin <matt@abacusnet.net>
-
-1999-09-27 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * month-view.c (add_event): ditto
- (mark_current_day): ditto
- (month_view_set): ditto
-
- * goto.c (goto_dialog): ditto.
-
- * gnome-month-item.c (gnome_month_item_init): ditto.
-
- * gncal-day-panel.c (gncal_day_panel_new): ditto.
-
- * getdate.c (RelativeDate): ditto.
-
- * eventedit.c (set_all_day): ditto.
- (ee_rp_init_rule): ditto.
-
- * calendar.c (vcalendar_create_from_calendar): ditto.
-
- * calendar-conduit.c (update_record): ditto.
-
- * calobj.c (ical_object_generate_events): Get rid of pointers to
- values returned from localtime, as it uses a static buffer.
-
-1999-09-26 Eskil Olsen <deity@eskil.dk>
-
- * corba-cal.c: the g_free that was commented out since glib said
- was a duplicate free, was supposed to be a free.
-
- * GnomeCal.idl/corba-cal.c: added a get_object_id_list and a
- get_objects_by_id_list. Latter is not done.
-
- * calendar-conduit.c: rewrote the way the conduit iterates over
- records. It no longers fetches all entries (since that didn't work
- with more then 285 entries. It now fetches the id list, and gets
- each record. (will be using get_objects_by_id_list to get records
- in amounts of 10 or so later, to reduce amount of corba calls).
-
- * calendar-conduit.c: now sets alarm parameters when transferring
- from gnomecal to pilot.
-
-1999-09-23 Eskil Olsen <deity@eskil.dk>
-
- * calendar-conduit.c: better merge of summary/description
- when doing ical_from_remote (update_record), also handles
- import from gnomecal to pilot better, and on both ways, repeat
- events are much better now.
-
-1999-09-22 Eskil Olsen <deity@eskil.dk>
-
- * corba-cal.c: commented out a g_free that glib reported
- as being a duplicate free.
- * calendar-conduit.c: got gnomecal->pilot up and runnning.
-
-1999-02-06 Lauris Kaplinski <lauris@ariman.ee>
-
- * gncal.desktop: Added Estonian translations.
-
-1999-09-14 Federico Mena Quintero <federico@redhat.com>
-
- * gncal-full-day.c (child_popup_menu): Set the data pointers for
- all the items.
-
-1999-09-14 Kjartan Maraas <kmaraas@online.no>
-
- * doc/C/gnomecal.sgml: Merge from gnome-pim-1-0. Synced with newest
- user-guide.
-
-1999-09-01 Miguel de Icaza <miguel@gnu.org>
-
- * eventedit.c (ee_create_buttons): Make the OK button the default
- button per Russell's suggestion.
-
-1999-08-30 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * calendar.c (calendar_object_changed): Modify the
- object->last_mod field.
- (calendar_add_object): Ditto.
-
- Closes bug #676
-
- * main.c (save_calendar_cmd): Fix problem in which we warned the
- user about the calendar being modified the first time the calendar
- was used.
-
-1999-08-22 Tomas Ogren <stric@ing.umu.se>
-
- * gnomecal.gnorba: "GenericFactoy" is wrong...
-
-1999-08-15 Miguel de Icaza <miguel@gnu.org>
-
- * calobj.c (ical_gen_uid): Fix the hostname part.
-
-1999-08-07 Peter Teichman <pat4@acpub.duke.edu>
-
- * calendar-pilot-sync.c (sync_pilot): sync correctly for objects
- created on the pilot, but not dirty (because they have been synced
- with some other program in the past)
-
-1999-07-30 Miguel de Icaza <miguel@gnu.org>
-
- * month-view.c (month_view_init): Release points here.
-
-1999-08-02 Peter Teichman <pat4@acpub.duke.edu>
-
- * Makefile.am (libcalendar_conduit_la_LDFLAGS):
- libcalendar_conduit now installs
-
- * calendar-pilot-sync.c (sync_pilot): do deletion of appointments
- correctly, when they are deleted on the pilot
- (conduit_free_Appointment): protect against double-freeing parts
- of the Appointment structure
- (update_record): all-day events from the pilot are handled a bit
- more reasonably
-
-1999-08-01 Peter Teichman <pat4@acpub.duke.edu>
-
- * calendar-pilot-sync.c (sync_object_to_pilot): The multi-day
- appointment corruption bug is dead. Whoo!
-
-1999-07-31 Peter Teichman <pat4@acpub.duke.edu>
-
- * Makefile.am: fixed this up slightly with respect to pilot conduits
-
-1999-07-30 Jonathan Blandford <jrb@redhat.com>
-
- * Makefile.am (libcalendar_conduit_la_LIBADD): More autoconf-stuff
-
-1999-07-29 Jonathan Blandford <jrb@redhat.com>
-
- * gnome-cal.c (setup_widgets): Add scrolling to the yearview.
-
-1999-07-28 Miguel de Icaza <miguel@gnu.org>
-
- * calendar-pilot-sync.c: (sync_object_to_pilot): If the enddate is
- not set, set the repeatForever to 1. This fixes all of the
- birthdays problems I had.
-
- Make the code not take arguments
- (sync_cal_to_pilot): Nice event update information
-
- * calendar.c (calendar_new): Add Event UID hash table.
- (calendar_add_object): Add events to the hash table here.
- (calendar_remove_object): Remove events here.
- (calendar_object_find_event): Use the hash table here.
-
- * main.c (save_calendar_cmd): The object is already destroyed by
- gnome_dialog_run.
-
- * calendar-pilot-sync.c (sync_object_to_pilot): Do not turn
- archived bit on.
-
- * calobj.c (ical_gen_uid): Use the hostname, not the domain name.
- (ical_gen_uid): Add a serial number. Isodates can be small.
-
- * corba-cal.c (cal_repo_update_pilot_id): New method to update the
- pilot status.
- (cal_repo_get_updated_objects): New method. Returns a list of
- modified and not-sycned objects
-
- * calendar-pilot-sync.c (sync_cal_to_pilot): New function to sync
- from the GnomeCalendar to the pilot.
- (sync_object_to_pilot): Sync a single event to the pilot.
- (try_alarm): Alarm syncing code.
-
-1999-07-27 Miguel de Icaza <miguel@gnu.org>
-
- * calendar-pilot-sync.c: New file. Implements PalmPilot
- syncronization with the Gnome Calendar.
-
- * calobj.c (ical_object_new_from_string): New function. Creates
- an iCalObject from a vCalendar string that is supposed to contain
- only one vEvent.
-
- * calendar.c:
- (calendar_save): Split this routine in two.
-
- * gnome-cal.c (gnome_calendar_new): Create the corba server here.
-
- * main.c: Include gnorba.h, and corba-cal-factory.h here
- (close_cmd): Kill the calendar server on shutdown.
-
- * calobj.c (load_recur_yearly_day): Added a fixme comment. WE
- need to handle intervals in the years.
-
- * calendar.c (calendar_object_find_in_list, calendar_object_find,
- calendar_object_find_todo, calendar_object_find_event): New
- functions for looking up information.
-
- * main.c (gnome_calendar_locate): New function.
-
- * corba-cal.c (calendar_create_object): New file. Implements the
- corba server.
-
- * calendar.c (calendar_object_changed): Flag pilot-status as changed.
-
- * calobj.c (ical_object_to_vobject): Save pilot information for syncing.
- (ical_object_create_from_vobject): Load syncing information for
- pilot. Do it in a way compatible with KOrganizer.
-
-1999-07-26 Miguel de Icaza <miguel@gnu.org>
-
- * calobj.c (ical_object_create_from_vobject): Generate unique IDs
- on Vevents we load that lack it. WE need this for the old
- gnome calendar generated files (ie, before now :-).
-
- Required to sync with the Palm
-
-1999-07-26 Miguel de Icaza <miguel@gnu.org>
-
- * calobj.c (ical_object_create_from_vobject): Generate unique IDs
- on Vevents we load that lack it. WE need this for the old
- gnome calendar generated files (ie, before now :-).
-
- Required to sync with the Palm
-
-1999-07-19 Matt Martin <matt@abacusnet.net>
-
- * timeutil.c (time_from_isodate): Handle the 'Z' parameter to the
- ISO date format to convert from GMT time.
-
-1999-07-17 Nat Friedman <nat@gnome-support.com>
-
- * calendar.c (calendar_add_object): Copy the new UID into the
- iCalObject structure.
-
-1999-07-16 Miguel de Icaza <miguel@gnu.org>
-
- * gnome-month-item.c (gnome_month_item_set_arg): Merge fix from
- gnome-pim-1-0: Fixed cut&paste bug for day fontsets.
-
-1999-07-14 Miguel de Icaza <miguel@gnu.org>
-
- * calobj.c (ical_gen_uid): Returns a UID.
- (ical_object_new): Use a UID when creating an event. Should get
- syncing done easier.
-
-1999-07-14 Nicholas J Kreucher <nick@poetic.com>
-
- * calobj.c (skip_numbers): Actually skip over the numbers.
- (ical_object_to_vobject): Test the proper variable for storing the
- proper information.
-
-1999-07-14 Jean-Noel Guiheneuf <jean-noel.guiheneuf@wanadoo.fr>
-
- * timeutil.c (time_add_month): Fixed the problem with next month
- going from a 31-day to a 30-day by adjusting the date to the
- closest day at the end of the month.
-
-1999-06-07 Mike McEwan <mike@lotusland.demon.co.uk>
-
- * timeutil.c (time_add_month): Tell ktime' that we don't know
- about daylight saving time so that it does *not* make adjustments
- when we traverse a DST boundary.
- (time_year_begin): ditto.
- (time_year_end): ditto.
- (time_month_begin): ditto.
- (time_month_end): ditto.
-
-1999-06-16 Anders Carlsson <anders.carlsson@tordata.se>
-
- * main.c (new_calendar): Realize the toplevel widget when
- --hidden is passed to gnomecal. This fixes a segfault.
-
-1999-06-04 Robert Brady <rwb197@ecs.soton.ac.uk>
-
- * gnome-cal.h, gnome-cal.c: Fix abort() problem with the year view.
- (Bug #1367). Thanks to Owen Cliffe <oc197@ecs.soton.ac.uk> for
- helping track it down.
-
-1999-06-03 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * calobj.c (daynumberlist): One line bug fix from Sergey I Panov.
-
-1999-06-02 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * view-utils.c (nicetime): Use %H instead of %k, as %k is a GNU
- extension, not available in other systems.
-
-1999-06-01 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * calobj.c (daynumberlist): Work around broken software that
- writes a broken month-of-day as "zero". Use the dtstart date for
- this on this event.
-
-1999-05-28 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * Makefile.am (install-data-local): help files be gone. They are
- now installed from the Docbook stuff.
-
-1999-05-26 Russell Steinthal <steintr@condor.penguinpowered.com>
-
- * gncal-todo.c main.c main.h prop.c: Added support for priorities
- for todo items. Doesn't do much, but you can set them and sort by
- them. (Use the properties box to enable them; should they be on
- by default?)
-
-1999-05-25 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * main.c (parse_an_arg): Added missing break here. It was causing
- core dumps when invoked with --userfile.
-
- * gnome-cal.c (gnome_calendar_set_view): Add some assertions here,
- to pin point the bug reported on gnome-list.
-
- * calobj.c (load_recurrence): Make intervals always exist. a 0
- interval is wrong.
-
-1999-05-25 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * year-view.c: Removed unused macro CALENDAR_HEIGHT.
-
-1999-05-25 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * year-view.c (idle_handler): Set the canvas scroll region here,
- not in size_allocate(). Also, use the correct width and height
- based on the allocation and the precomputed minimum width/height
- values.
-
- * gnome-cal.c (setup_widgets): Set the scrollbar policy of the
- scrolled window.
-
- * main.c (setup_appbar): Use the correct type for the appbar.
-
- * gncal-day-view.c: Removed unused function switch_to_day().
-
- * gncal-day-panel.c (calendar_day_selected): Removed unused variable.
-
-1999-05-25 Nat Friedman <nat@nat.org>
-
- * doc/C/gnomecal.sgml: Fixed a typo.
-
- * gnome-cal.c (setup_widgets): Added a scrolled window widget into
- which the year view is placed.
-
- * year-view.c (CALENDAR_HEIGHT): The height of the total year view
- inside the scrolled window.
- (idle_handler): Set the height of the year view to
- CALENDAR_HEIGHT.
- (year_view_size_allocate): Set the scroll region of the year view
- canvas to allocation->width, CALENDAR_HEIGHT.
-
-1999-04-25 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * main.c (dump_todo): Add --todo flag to dump the todo contents.
-
-1999-04-19 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * gncal-todo.c (add_activated): Use same hack used in edit_activated
-
-1999-04-16 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * gncal-todo.c (edit_activated): Kill all grabs from the CList
- before running the new dialog box.
-
- This fixes the problem of button-3/Edit on the todo item blocking
- the GUI (actually, the main window responds, but not the todo
- window).
-
-1999-04-08 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * gncal-todo.c (gncal_todo_init): Make sure we can get events for
- button3. The code for the nice popup menu was there but was not
- getting invoked.
-
-1999-04-01 Steve Murphy <murf@e-tools.com>
-
- * calobj.c (weekdaynum): Added this routine so Monthly recurrences
- use the weekday field as a simple integer for a single weekday.
-
- * calobj.c (load_recur_monthly_pos): Call weekdaynum instead of
- weekdaylist. The interface only lets the user input a single value
- anyway.
-
- * calobj.c (ical_object_to_vobject): instead of code to output day
- names from a bit array, use instead the value as an int and output
- a single dayname.
-
- * calobj.c (ical_object_generate_events): first_week_day gets the
- day int instead of the first entry in the bit field. I inserted a
- fair chunk of code to avoid calling generate if the day is out of
- range for a month. It may be unneccessary, because mktime will
- turn the extra days into a valid date the next month. But not all
- mktimes are equal, I fear.
-
- * eventedit.c (ee_store_recur_rule_to_ical): For case 3,
- (Monthly), I added code to set the interval slot of the recur
- struct; without this value, selecting a monthly recursing, by
- date, would lead to an infinite loop broken only by a failure to
- alloc more memory. Also, in the "by position" case, both
- u.month_pos and u.month_day were being assigned values. This is a
- mistake, as they are both part of an union, and the same
- thing. The weekday field should get the recur_rr_month_weekday
- value.
-
- * eventedit.c (ee_rp_init_rule): set default day from the weekday
- field instead of the u.month_day field, which is really the
- month_pos value.
-
- * gnome-cal.c (gnome_calendar_tag_calendar): Month days start with
- 1, not 0; thus, setting tm.tm_mday = 0, and then calling mktime
- will generate a time corresponding to the end of the previous
- month, which may have a mday anywhere from 28 to 31. The end time
- just adds 1 to the month, so your end time may not cover the last
- few days of this month, depending on what the biggest mday of last
- month was. I changed it so tm_mday is set to 1 instead.
-
-1999-03-30 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * gncal-todo.c (convert_time_t_to_char): Made static. Make it use
- the full year format for strftime().
-
-1999-03-27 Nuno Ferreira <nmrf@rnl.ist.utl.pt>
-
- * calobj.c: Include <config.h> So that strings get translated.
-
-1999-03-26 Tomas Ogren <stric@ing.umu.se>
-
- * prop.c (build_hours_menu): Made it respect 12/24h settings..
- Doesn't show until next time you open the dialog.. yet..
-
-1999-03-24 Tomas Ogren <stric@ing.umu.se>
-
- * gncal-week-view.c (gncal_week_view_set): Did some i18n work
- * eventedit.c (get_exception_string): Did some i18n work
-
-1999-03-24 Tomas Ogren <stric@ing.umu.se>
-
- * gncal-todo.c (gncal_todo_init): Made clist titles i18n:able
- * main.c (poptOption): Added which views that are possible for
- --view in the --help text (closes #367)
- * main.c (dump_events): Added (short) month to the strftime and made
- the strings i18n:able
-
-1999-03-23 Tomas Ogren <stric@ing.umu.se>
-
- * gncal/calobj.c: Added 2 paranthesis..
- "foobar = d / 60*60" is _NOT_ the same as "foobar = d / (60*60)"
- which caused heavy alarm-corruption with alarms between 2 hrs and
- 2 days.
-
-1999-03-23 Nat Friedman <nat@nat.org>
-
- * eventedit.c (ee_store_recur_rule_to_ical): Set the
- recur->interval to the value of the recur_rr_month_period spin
- button if the event is being set "by day." This closes bug #675
- as reported by bagfors@hpc2n.umu.se. Thanks for the report!
-
-1999-03-10 Clifford R. Conover <rconover@montana.edu>
-
- * gncal-todo.c (simple_todo_editor): Add support for Due Date when
- adding a TODO item here.
- (column_resized): New function
- (init_column_sorting): New function.
- (todo_click_column): New function.
- (convert_time_t_to_char, make_overdue_todo_style): New functions.
-
- * gnome-cal.c (gnome_calendar_todo_properties_changed): New
- function used to update the TODO when the properties have been
- chagned for it.
-
- * prop.c (prop_apply_todo): Apply TODO properties.
-
- * gncal-day-panel.c (todo_list_properties_changed): Update the
- TODO display here.
-
- * eventedit.c (date_edit_new): Made public
-
-1999-03-10 Craig A Soules (soules+@andrew.cmu.edu)
-
- * timeutil.c, calendar.c, calobj.c, gncal-day-panel.c: Add support
- for daylight time savings.
-
-1999-02-28 Martin Baulig <martin@home-of-linux.org>
-
- * gncal-full-day.c (recompute_motion): For DRAG_MOVE, DRAG_SIZE_TOP
- and DRAG_SIZE_BOTTOM: call child_focus_out () if the child currently
- has the focus.
-
-1999-02-27 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
-
- * quick-view.c (QUICK_VIEW_FONTSET): Added Korean font to the
- fontset string.
- * mark.h (*_FONTSET): Likewise.
-
-1999-02-23 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * calobj.c (ical_object_to_vobject): Save the owner/organizer of
- the event.
- (ical_object_create_from_vobject): Load the owner/organizer of the event.
-
- * gncal-full-day.c (delete_occurance): Assign child to data (fixes
- crash on "delete this occurrance").
-
-1999-02-22 Timur Bakeyev <mc@bat.ru>
-
- * calendar.c: According to configured values, use either tm.tm_zone
- or tzname. In last case, also declare it extern.
-
- * prop.c: langinfo.h not available everywhere. Wrapped. BTW, works
- fine without it.
-
-1999-02-20 Tomas Ogren <stric@ing.umu.se>
-
- * main.c (init_username): Made use of g_get_{user,real}_name() instead
- of our own home-brew...
-
-1999-02-17 Sergey Panov <sipan@mit.edu>
-
- * gnome-month-item.c,gnome-month-item.h,goto.c,mark.h,
- month-view.c,prop.c,quick-view.c,year-view.c: will define
- fonts via fontset. Friendlier to locales that use iso8859-[^1]
- and koi8-r encodings. Does not solve problem for Asian languiges
- --- better solution is needed (e.g. standart GNOME fontstyles
- defined in gtkrc).
-
-1999-02-16 Sergey Panov <sipan@mit.edu>
-
- * main.c: Use N_() macro for color settings labels in
- color_props structure.
-
-1999-02-15 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * goto.c (goto_dialog): Indentation fixes.
-
-1999-02-15 Tomas Ogren <stric@ing.umu.se>
-
- * goto.c: Made a private copy of what localtime() returns, to be able
- to keep the data after more calls to localtime().
-
-1999-02-11 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * main.c (save_default_calendar): New function. Saves the
- calendar if it is the user's default calendar
-
- * gncal-full-day.c (unrecur_appointment):
- * gncal-day-panel.c (day_view_range_activated):
- * eventedit.c (ee_ok):
- * gncal-todo.c (ok_button): Added autosave for the default
- calendar.
-
-1999-02-09 Tomas Ogren <stric@ing.umu.se>
-
- * main.c: Removed the gtk_widget_realize call.
-
-1999-02-06 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
-
- * gncal.desktop: Added Korean translations.
-
-1999-02-04 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * eventedit.c (date_edit_new): New convenience function to create
- a properly-configured date editor widget.
-
-1999-02-03 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * gncal-week-view.c (gncal_week_view_new): Make the calendar start
- weeks on Monday if appropriate.
- (gncal_week_view_time_format_changed): New function to notify the
- week view that the time format has changed.
-
- * gncal-day-panel.c (gncal_day_panel_new): Make the calendar start
- weeks on Monday if appropriate.
- (gncal_day_panel_time_format_changed): New function to notify the
- day panel that the time format has changed.
-
- * gnome-cal.c (gnome_calendar_time_format_changed): Tell the day
- and week views that the time format has changed.
-
-1999-02-01 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * eventedit.c (event_editor_init): Set the title of the event
- editor window.
-
-1999-01-31 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * gncal-day-view.c (gncal_day_view_expose): Do not remove the
- clipping rectangle here.
-
- * view-utils.c (view_utils_draw_events): Remove the clipping
- rectangle here, since the user of this function should not know
- about it.
-
-1999-01-30 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * view-utils.c (view_utils_draw_events): Improve this draw
- routine. Now it can split the text in lines and fit as many
- events as possible.
- (nicetime): Return strings without spaces at the beginning.
-
- * gncal-day-view.c (gncal_day_view_expose): Move clip-clear
- operation here.
-
-1999-01-29 Jason Tackaberry <tack@dok.org>
-
- * gncal-full-day.c (child_popup_menu): if the user clicks on an
- event that is an occurance, the menu will allow the user to delete
- all occurances of this event, or just the selected occurance.
- (delete_occurance): added.
-
- * eventedit.c (append_exception): force the clist to select the
- new exception. (fixes segfault)
- (delete_exception): if the last exception in the clist is deleted,
- move the selection index up. (fixes segfault)
-
-1999-01-28 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * main.c (parse_an_arg): Add --hidden key to hide the calendar at
- startup. Only works with GNOME window managers though :-(
-
- * calendar.c (calendar_day_change): Reschedule alarms for the new day.
-
- (calendar_init_alarms): Schedule an alarm for midnight to change
- the calendar_day_begin/calendar_day_end.
-
- * alarm.c (alarm_ready): If we reschedule, there is no need to
- activate any pending alarms.
-
-1999-01-28 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * gncal-full-day.c (child_new): Insert the summary text here.
- (child_focus_in): No need to raise the window, since we have
- Spiffo(tm) layout code. Boy, this is old code.
- (gncal_full_day_focus_child): Now that GtkText works better, we
- can avoid synthesizing a click which was causing grief, anyway.
- (child_button_press): Grab the focus before popping up the menu.
-
- * layout.c (find_index): Added a sanity check.
-
- * gncal-full-day.c (child_destroy): Unmap and unrealize the child
- before unparenting/destroying it.
- (child_unrealize): Unrealize the widget. What was I thinking?
- (child_new): Save the focus_out_event signal connection id in
- Child structure (in a new field).
- (child_destroy): Disconnect from the focus_out_event signal, since
- we don't want to get such an event when the widget is destroyed.
- (gncal_full_day_destroy): Destroy the children properly; it was
- leaking memory.
-
-1999-01-27 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * main.c (save_calendar_cmd): Warn if the calendar file has
- changed.
-
- * calendar.c (calendar_load, calendar_save): Keep track of the
- modification time for the calendar file.
-
-1999-01-20 Nat Friedman <nat@nat.org>
-
- * gncal-full-day.c (gncal_full_day_key_press): Only trap printable
- characters such that hotkeys work.
- (UNSELECT_TIMEOUT): Changed to 0. Much saner behavior.
-
- * prop.c (properties): Connect gnome_help_pbox_display to the
- GnomePropertyBox help button.
-
-1999-01-19 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * quick-view.c (quick_view_do_popup): Do not grab the mouse here
- (it was being grabbed incorrectly, anyways).
- (quick_view_map_event): Grab the mouse when the window is mapped.
- This avoids the ugly "while (xGrabPointer () != Success)" hack.
- (quick_view_button_release): Handle button releases here.
-
-1999-01-19 Tomas Ogren <stric@ing.umu.se>
-
- * main.c: do gtk_widget_realize on the toplevel window..
-
-1999-01-13 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * gncal-day-panel.c (gncal_day_panel_new): Make the little
- calendar start up with the correct date.
-
- * gncal-week-view.c (gncal_week_view_set): Add the month to the
- date range display label.
-
-1999-01-08 Nat Friedman <nat@nat.org>
-
- * main.c: Converted some more stuff to use the standards.
-
-1999-01-08 Nat Friedman <nat@nat.org>
-
- * main.c (setup_appbar): New function to create the status bar.
- (setup_menu): Install menu hints.
-
- Menu items updated to match the standards. New Settings menu
- created.
-
-1998-12-30 Jeff Garzik <jgarzik@pobox.com>
-
- * gncal/calendar.c, gncal/gnome-cal.c, gncal/main.c,
- gncal/quick-view.c:
- s/g_copy_strings/g_strconcat/
-
-1998-12-16 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- Rewrote the old and broken alarm system. It never actually
- worked properly. Now it works properly, and I figured a nice way
- to get the Audio alarm do something nicer (it is now like an alarm
- clock :-).
-
- * gnome-cal.c (calendar_notify): Now we take a CalendarAlarm to
- actually distinguish which alarm was triggered.
-
- * alarm.c (alarm_ready): The code was only activating the first
- alarm. Reschedule the timer upon delivery of an alarm.
-
-1998-12-14 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * year-view.c (idle_handler): Use the allocation size instead of
- the old fields in the canvas structure.
-
- * goto.c (create_days): Use gtk_widget_set_usize() instead of
- gnome_canvas_set_size().
- * quick-view.c (setup_event_list): Likewise.
-
-1998-12-09 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * gncal-todo.c (simple_todo_editor): Use gnome_dialog_set_parent.
- * goto.c (goto_dialog): ditto
- * prop.c (properties): ditto.
-
-1998-11-23 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * eventedit.c (ee_rp_init_exceptions): Update GtkClist usage.
-
-1998-11-23 Andrew T. Veliath <andrewtv@usa.net>
-
- * gncal-day-panel.c (gncal_day_panel_new): Use
- gtk_scrolled_window_add_with_viewport instead of
- gtk_container_add (gtk changes).
-
-1998-11-23 Herbert V. Riedel <hvr@hvrlab.ml.org>
-
- * eventedit.c: use GPOINTER_TO_INT
-
- * gncal-todo.c: same.
-
-1998-11-22 Matthew Wilson <msw@redhat.com>
-
- * main.c: Fixed the popt event parsing callback to have the
- correct number of arguments. This stops it from segfaulting.
-
-1998-11-16 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * eventedit.c (ee_classification_widgets): Doh. Fixed stupid bug
- where the classification buttons were not being set correctly.
- (ee_store_general_values_to_ical): Take into account the fact that
- radio group lists are stored in reverse order of insertion.
-
- * gncal-todo.c (gncal_todo_init): Use a scrolled window to put the
- clist into.
-
-1998-11-11 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * calendar.c (calendar_save): Backup the old file before saving
- the caledar.
-
-1998-11-06 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * calobj.c: Add ctype.h
-
-1998-10-31 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * gnome-cal.c (gnome_calendar_direction): Add the offset from the
- beginning of the current time unit (day/month/etc), otherwise it
- does not work right, for example, you are on the 31st day of a
- month and the next month is a 30-day one and you jump to the next
- month.
-
-1998-10-16 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * month-view.c: Changed a lot of stuff not to use the layout code
- -- the month view's days are too small to display layout
- usefully. Now they display a little list of the events in each
- day. We also have a popup menu for the days in the month view.
-
- * calendar.c (calendar_get_objects_in_range): Reverse the list so
- that it is returned in increasing order.
-
- * eventedit.c (event_editor_new_whole_day): New public function to
- create an event for the complete span of day_begin to day_end.
-
- * year-view.c (new_appointment): Use event_editor_new_whole_day().
-
- * year-view.c (yv_popup_menu): Mark strings for i18n.
-
-1998-10-12 Ji Lee <g@ucsd.edu>
-
- * eventedit.c (ee_store_recur_rule_to_ical): The interval was
- never being loaded from the spin button.
-
-1998-10-09 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * month-view.c (month_view_update): Create a list of children and
- lay them out nicely. Lots of functions added for this purpose.
- (adjust_segment): Main event segment adjustment routine.
- (adjust_children): Adjusts all the children in the month view.
- (child_create_segments): Creates the segments for a particular event.
- (layout_children): Uses the generic layout engine to organize the children.
-
-1998-10-08 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * gncal-todo.c (clist_row_selected): Set the sensitivity of the
- edit/delete buttons.
- (gncal_todo_update): Likewise. Thanks to Dirk Luetjens for the
- bug report.
-
- * layout.c: Do some cleanup; now we pass a struct with the layout
- algorithm's state instead of passing a trillion parameters around.
-
- * gncal-full-day.c (layout_children): Use the new generic layout
- engine.
- (child_compare): Sort keys are start time then end time, not just
- start time. This produces somewhat nicer results for the layout
- algorithm.
-
- The new layout code uses a partition of the time range occupied by
- the events, rather than using a fixed time granularity. This is
- better since the different parts of the program that use the
- layout module will have different semantics regarding snapping the
- event bounds to a fixed "time grid".
-
-1998-10-07 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * layout.[ch]: New files that abstract the event layout code from
- gncal-full-day.c into something useful for other parts of the
- program. Now all event layout is done here.
-
- * Makefile.am (gnomecal_SOURCES): Added layout.[ch] to the list of
- sources.
-
-1998-10-07 Carsten Schaar <nhadcasc@fs-maphy.uni-hannover.de>
-
- * main.c (main): Replaced the 'gnome_client_new_default' call with
- 'gnome_master_client'.
-
-1998-10-02 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * timeutil.c (time_day_begin): Changed name from
- time_start_of_day() to be consistent with the other begin/end functions.
- (time_day_end): Likewise.
-
- * calobj.c (ical_object_get_first_weekday): New public function to
- get the first toggled day in a weekday mask. Since we do not
- support multiple weekdays in a monthly-by-pos rule, we just fetch
- the first toggled one.
- (ical_object_generate_events): Added a missing break statement.
-
- * timeutil.c (time_month_end): Made it consistent with the rest of
- the time begin/end functions -- now it returns the first second of
- the *next* month.
- (time_week_end): Actually implemented this function. It will be
- used when the week view is rewritten.
-
- * calobj.c (time_in_range): Fix off-by-one in the comparison of
- the time against the end time.
-
- * gncal-full-day.c (expand_space): Fixed bug where the columns not
- were being expanded due to a missing "slot + j".
-
-1998-10-01 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * month-view.c (month_view_init): Use the font #defines.
- (month_view_new): Set the colors of the month view upon creation.
- (mark_current_day): New function to mark the current day in the
- month view.
- (month_view_set): Mark the current day.
- (month_view_colors_changed): Mark the current day and colorify the
- month item appropriately.
-
- * month-view.h: Added year and month fields to the MonthView
- structure.
-
- * main.c: Renamed the Appointments color property, since it will
- be used by the month view as well.
-
- * goto.c (update): Set the current day's font and color.
-
- * year-view.c (year_view_init): Set the fonts of the month items
- when creating them.
-
- * mark.h: Added new #defines for HEADING_FONT and TITLE_FONT.
-
- * year-view.c (year_view_init): Use the new font #defines.
-
- * prop.c (prop_apply_colors): Fixed to work with the
- I-am-paranoid-and-I-need-to-size-my-ints changes to
- GnomeColorPicker.
- (color_spec_from_picker): Likewise.
-
-1998-09-30 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * goto.c (create_days): Colorify the month item and prepare it for
- prelighting here.
-
- * main.c (color_props): Changed the default colors to something
- not dull.
-
- * year-view.c (compute_min_size): New function to compute the
- minimum size of the year view properly.
- (year_view_size_request): Added two new fields to the year view
- structure that contain the minimum size. Return this in the
- size_request method.
- (year_view_new): Call compute_min_size to save the minimum size
- for later use.
- (idle_handler): Make it resize the items correctly.
-
- * gnome-month-item.c (gnome_month_item_set_arg): Reshape when
- necessary. This is needed becaues we now actually calculate a
- minimum size for the month item based on the font sizes and paddings.
- (check_heading_sizes): New function to calculate a minimum size
- based on the headings' dimensions.
- (check_day_sizes): New function to calculate a minimum size based
- on the day number labels' dimensions.
- (check_sizes): New function that computes a minimum size for the
- month item.
- (reshape): Now calls check_sizes() to ensure a minimum size for
- the month item.
-
- * year-view.c (mark_current_day): New function to mark the current
- day in the year view.
-
- * mark.c: Removed mark_current_day from here.
-
-1998-09-29 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * prop.c (fetch_color_spec): Changed name from fetch_prelight_spec
- and made it conform to the new prelighting mechanism.
- (fake_mark_days): Set the proper day attributes.
- (reconfigure_month): Use colorify_month_item().
- (fake_mark_days): Use mark_month_item_index().
-
- * mark.c (colorify_month_item): New public function to reset the
- colors in a month item.
- (get_attributes): New internal function that creates an array of
- attributes for the days in a month item. This is the basis of all
- the new optimizations to month item marking.
- (unmark_month_item): Now it uses the attributes array to unmark
- only the days that need unmarking.
- (mark_event_in_month): Update the day attributes array.
- (month_item_prepare_prelight): Changed the definition of the
- prelight color query function. Use the new function.
- (day_event): Do color changes based on the day attributes array.
- (mark_month_item_index): New public function to mark a single day
- by index.
- (mark_event_in_month): Use mark_month_item_index().
-
- * gnome-month-item.c (gnome_month_item_num2child): Now takes an
- int, not a GnomeMonthItemChild.
- (gnome_month_item_child2num): Now returns an int, not a
- GnomeMonthItemChild.
- (gnome_month_item_num2day): Now takes an int, not a
- GnomeMonthItemChild.
-
- * goto.c (goto_dialog): Create the days before the year spin
- button, because the year_changed callback expects the month item
- to be created. The new semantics of the spin button cause it to
- emit a value_changed signal on the adjustment upon creation -- is
- this the behavior we want from it?
- (goto_dialog): Use gtk_window_set_modal() instead of the
- deprectaed gnome_dialog_set_modal().
-
- * quick-view.c (quick_view_new): Make it look not as crappy by
- putting the title inside the frame.
- (quick_view_do_popup): Fixed the pointer grab and added a cursor.
- (create_items_for_event): Query the text width/height from the
- text item using the new object arguments, so that the size of the
- popup window can be set properly.
-
- * year-view.c (do_quick_view_popup): Calculate a nice date string
- for the popup window.
-
-1998-09-28 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * quick-view.[ch]: New file that presents a quick view of the
- events in a particular day when the mouse is clicked on the year
- view. Work in progress.
-
- * year-view.c (do_quick_view_popup): New function that creates a
- quick view for the events in a day.
-
- * Makefile.am (gnomecal_SOURCES): Added quick-view.[ch] to the
- list of sources.
-
-1998-09-27 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * main.c: Hotkey for File/Exit should be C-q, not C-x.
-
-1998-09-24 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * year-view.c (do_popup_menu): New function to execute the popup
- menu in the year view.
- (day_event): Invoke the popup menu with the context set to days.
- (new_appointment): New function to create a new appointment from
- the year view.
- (do_jump): New function to do the appropriate view/date jumping
- from the popup menu.
-
- * main.c: Fixed two icons in the File menu.
-
-1998-09-21 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * main.c: Added underlined shortcuts and accelerators to the main menu.
-
-1998-09-16 Raja R Harinath <harinath@cs.umn.edu>
-
- * gncal-week-view.c (<gtk/gtklabel.h>): Include.
- * gncal-week-view.h (<gtk/gtkvbox.h>): Include.
-
-1998-09-06 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * gnome-cal.c (mail_notify): Fixed the bug reported about the mail
- notification not beint sent until the program was terminated.
-
-1998-09-03 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * gncal-full-day.c (gncal_full_day_forall): Updated foreach ->
- forall from Gtk changes, bleah.
-
- * year-view.c (day_event): New function to handle events from
- days. Jumps to the day that is clicked.
-
- * main.c: Use a watch cursor while the previous/today/next
- functions are doing their job.
-
- * mark.c (month_item_prepare_prelight): New public utility
- function to prepare a month item for prelighting. It will store
- the proper prelight information and attach the appropriate signals.
- (mark_current_day): Make the current day bold as well (useful for
- color-blind people, I guess).
-
- * prop.c (set_current_day): Reset the date in the sample calendar
- and mark the current day.
- (fake_mark_days): Mark fake events in the sample calendar.
-
- * year-view.c (year_view_set): Use the general prelighting engine.
-
- * goto.c (day_event): Just process button presses, as prelighting
- is done behind the scenes now.
- (update): Use the general prelighting engine.
-
- * prop.c (create_colors_page): We can now configure the colors of
- the monthly calendars! Wheeeeee! There are still some nits to be
- fixed, which are listed in the TODO file.
- (build_color_spec): New function to build color specifications.
- (parse_color_spec): New function to parse color specifications.
-
- * mark.c: Modified all functions to use the configured colors.
- * goto.c: Likewise.
-
- * main.c (colors_changed): New function that notifies all
- calendars that colors have changed.
-
- * gnome-cal.c (gnome_calendar_colors_changed): New function that
- notifies all the views that the colors have changed.
-
- * month-view.c (month_view_colors_changed): New function that
- notifies the month view that colors have changed.
-
- * year-view.c (year_view_colors_changed): New function that
- notifies the year view that colors have changed.
-
- * gnome-month-item.h (struct _GnomeMonthItem): Added fields for
- outline and day box colors.
-
- * gnome-month-item.c (gnome_month_item_set_arg): Added
- outline_color, outline_color_gdk, day_box_color, and
- day_box_color_gdk arguments to month items. These are convenient
- to quickly set the colors of the month item.
- (gnome_month_item_get_arg): Likewise.
-
- * main.[ch]: Added a global array of structures for color preferences.
-
-1998-08-31 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * goto.c: Small code cleanup.
- (day_event): Upon receiving a LeaveNotify event, Reset the day's
- background to the correct color.
-
-1998-08-29 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * mark.[ch]: New files with utility functions to mark calendars
- with their events.
-
- * mark.c (mark_month_item): New public function to mark a month
- item with events.
- (unmark_month_item): New public function to unmark all the days in
- a month item to their default appearance.
-
- * year-view.c (year_view_set): Use the new unmark_month_item() and
- mark_month_item() to mark the months with events.
-
- * goto.c (update): New function that updates the calendar in the
- Go-to dialog by marking the days.
-
- * timeutil.c (time_year_begin): Modified to take a time_t value.
- (time_year_end): Likewise.
- (time_month_begin): Actually implemented this function, which was
- in the header file but not here.
- (time_days_in_month): New public function that returns the number
- of days in a month.
-
- * Makefile.am (gnomecal_SOURCES): Added mark.[ch] to the sources.
-
- * year-view.c (unmark_days): Use unmark_month_item().
-
- * gncal-full-day.c (gncal_full_day_destroy): Fixed crash when
- destroying the full day view. The full day's destroy method is
- unusual in that it destroys the list of child widgets itself, as
- it does not have a remove method, so it needs to reset the list to
- NULL.
-
-1998-08-27 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * gnome-month-item.c (build_month): Now does the correct thing
- when the user wants weeks to start on Monday. Now all the Monday
- special casing, as far as day numbering is concerned, is only in
- this function.
-
- * year-view.c (mark_days): This function marks the days that have
- events in them. It also fixes a memory leak in the old
- implementation (it was leaking the whole list).
- (unmark_days): New function used to unmark all the days in the
- year view.
- (mark_event): New function that marks all the days that are
- spanned by a time range. It also fixes the bug in the old
- implementation where it could possibly mark days past the ends of
- the year (if the event crosses year boundaries, for example).
-
- * timeutil.c (time_year_begin): Take the year parameter since year
- 1, not 1900.
- (time_year_end): Likewise.
-
- * year-view.c (year_view_size_allocate): Now changing the size of
- the calendars is done in the idle loop.
- (idle_handler): This function actually does the resizing of the items.
-
- * year-view.h (struct _YearView): Added idle_id and need_resize
- fields.
-
-1998-08-26 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * year-view.c: Beginning of the new year view. Sizing and event
- marking needs to be finished.
-
- * gnome-cal.c: Updated for year-view.
- (gnome_calendar_time_format_changed): Use year_view_time_format_changed().
-
- * year-view.[ch]: Renamed the gncal-year-view.[ch] files to
- year-view.[ch].
-
- * Makefile.am (gnomecal_SOURCES): Updated year-view.[ch] in the
- list of source files.
-
-1998-08-25 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * goto.c (create_days): Set the heading color of the month item.
-
- * main.c: Use GNOME_STOCK_PIXMAP_JUMP_TO, now that it exists,
- instead of goto.xpm. Also, removed goto.xpm from cvs.
-
- * gnome-month-item.h (struct _GnomeMonthItem): Added fields for
- the heading and day number fonts. Added fields for heading and
- day number label colors.
-
- * gnome-month-item.c (gnome_month_item_class_init): ARG_DAY_NAMES
- should be write-only. Also, added arguments for heading and day
- number fonts. Added arguments for heading and day number colors.
-
-1998-08-24 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * prop.c (build_two_radio_group): Doh. Set the state of the radio
- buttons properly.
-
- * month-view.c (month_view_time_format_changed): New public
- function that notifies the month view of a time format change.
-
- * gnome-cal.c (gnome_calendar_time_format_changed): New public
- function that notifies the calendar of a time format change.
-
- * main.c (time_format_changed): Use gnome_calendar_time_format_changed().
-
- * month-view.c (month_view_update): New public function to update
- the month view when an event changes. This is still unfinished.
- (month_view_set): New public function to set the month in the
- month view.
-
- * gnome-cal.c (gnome_calendar_direction): Add case for month view.
- (gnome_calendar_set_view): Likewise.
- (gnome_calendar_update_all): Likewise.
-
- * timeutil.c (time_add_week): Implemented the time_add_week()
- function, which was on the header file.
- (time_add_month): Added public month-adding routine.
-
- * gnome-cal.c (gnome_calendar_get_current_view_name): Add case for
- month view.
- (gnome_calendar_goto): Likewise, and set the time on the month view.
-
- * month-view.c (month_view_new): Now it takes the calendar plus
- the time_t representing the month.
-
- * gnome-month-item.h: Added documentation on the object arguments
- for the month item.
-
- * month-view.c (month_view_init): Added a month/year heading to
- the month view.
-
- * TODO: Updated the TODO list a bit.
-
- * main.c (gnome_cal_file_menu): The preferences menu option should
- go in the File menu.
- (gnome_cal_edit_menu): Added stock pixmaps to the menu items.
- (gnome_cal_menu): Renamed the Calendar menu to Edit.
- (gnome_cal_help_menu): Use "About Gnomecal", not just "About".
-
- * prop.c (hour_activated): Notify the property box that it has changed.
-
- * main.c: Changed the Properties menu item to Preferences. These
- are global application preferences, not a single calendar's
- properties.
-
- * prop.c (prop_apply): Save the week_starts_on_monday flag to the
- configuration file.
- (properties): Added a check button for weeks starting on Monday.
- (properties): Beautified the Preferences dialog.
-
- * month-view.c (month_view_init):
- * goto.c (create_days): Set the month item to start weeks on
- Monday if appropriate.
-
- * main.c (init_calendar): A boolean is not an hour, so don't
- range_check_hour() on it.
- (init_calendar): Added a global week_starts_on_monday flag.
-
- * main.h: Added global week_starts_on_monday flag.
-
-1998-08-21 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * calobj.c (ical_object_create_from_vobject): If mail alarm or
- program alarm are missing the action, then set an empty default.
-
-1998-08-18 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * gnome-month-item.c (gnome_month_item_day2index): New public
- function to get the displayed day index of the specified date.
-
- * gnome-cal.c (gnome_calendar_goto_today): New public function to
- jump to the current day.
-
- * goto.c (day_event): Jump to the selected day when the user
- clicks the mouse, and prelight days as appropriate.
-
- * timeutil.c (time_from_day): New public function to build a
- time_t from a year/month/day triplet.
-
- * gnome-month-item.c (gnome_month_item_num2child):
- (gnome_month_item_child2num): New public functions to convert an
- index into a child and vice-versa, respectively.
- (gnome_month_item_num2day): New public function to convert a child
- number into a displayed day number.
-
- * goto.c (goto_dialog): Doh, use gnome-dialog properly :-)
-
- * gnome-month-item.c (create_items): Use g_strdup()ed day names
- from the start.
-
-1998-08-17 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * main.c (gnome_toolbar): Made it use goto.xpm.
-
- * Makefile.am (EXTRA_DIST): Added goto.xpm to the list of files.
-
-1998-08-13 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * gnome-month-item.c (gnome_month_item_set_arg): Doh. Actually
- recalculate the days using the month and year.
-
- * main.c: Added "Go to" button to quickly jump to a specific date.
-
- * goto.c: New file that defines the quick go-to date dialog.
-
- * Makefile.am (gnomecal_SOURCES): Added goto.c to the sources.
-
-1998-08-11 Nuno Ferreira <nmrf@rnl.ist.utl.pt>
-
- * main.c (new_calendar): Made title i18n friendly. This was bug
- #215.
-
- * eventedit.c (ee_store_recur_end_to_ical): Set recur->enddate to
- recur->_enddate, not to itself, when adding recurring event and
- supplying an end date. This fixes (at least part of) bug #99.
-
-1998-08-10 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * month-view.[ch]: Start of the month view widget. This will use
- the generic month item and extend it to have the semantics desired
- for the gnomecal month view.
-
- * gnome-month-item.[ch]: New generic canvas item for the month
- view and the "small calendars". This is intended to be a
- high-level display engine for monthly calendars. This is a work
- in progress.
-
- * gnome-cal.h (GnomeCalendar): Added a month_view field.
-
- * gnome-cal.c (setup_widgets): Create the month view and insert it
- into the notebook.
-
- * Makefile.am: Added month-view.[ch] and gnome-month-item.[ch] to
- the sources.
-
-1998-08-03 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * main.c (about_calendar_cmd): Use an array of const strings to
- keep gcc happy.
-
- * alarm.c (alarm_compare_by_time): Use gconstpointer to keep gcc happy.
- * calendar.c (calendar_object_compare_by_start): Likewise.
- * gncal-full-day.c (child_compare_by_start): Likewise.
-
-1998-07-07 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * main.c: Add support for --view flag.
- (session_save_state): Save the view mode;
- (new_calendar): Now takes a view mode flag.
-
- * gnome-cal.c (gnome_calendar_get_current_view_name): New
- function for enhancing the session management support for
- gnomecal.
- (gnome_calendar_set_view): New function that makes a given page
- active.
-
-1998-07-01 Nuno Ferreira <nmrf@rnl.ist.utl.pt>
-
- * gncal.desktop: Added Portuguese translation.
-
-Mon Jun 22 13:01:16 1998 Havoc Pennington <hp@pobox.com>
-
- * main.c (session_save_state): Use gnome_geometry_string to get
- the geometry string.
-
-1998-06-04 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * eventedit.c (ee_rp_init_rule): Do not subtract 1 from
- tm->tm_mday for the default_day.
-
- * gnome-cal.c (gnome_calendar_new):
- (gnome_calendar_goto): Use the start of the day -- things expect
- it to be that way.
-
-1998-05-27 Nuno Ferreira <nmrf@rnl.ist.utl.pt>
-
- * eventedit.c (ee_store_recur_rule_to_ical): Fill in
- ical->recur->interval from value in spin_button. This ixed an
- infinnite loop.
-
-1998-05-30 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * gncal-full-day.c (child_draw): Paint the decorations correctly.
- (child_draw_decor): Paint the recurrence/bell icons correctly.
-
-1998-05-25 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * eventedit.c (ee_rp_init_rule): Use the contents of
- ee->ical->dtstart for computing the predefined values of the recurrence.
-
- * gncal-full-day.c (gncal_full_day_unrealize): Fix the gc
- destruction in the unrealization code and fix the pixmap unrefing.
-
- * main.c (close_cmd): Remove a bad hack that disabled calendar
- widget destruction.
-
- * calobj.c (ical_object_generate_events): Fix for the weekly event
- generation. Was reported on the bug tracking system.
-
-1998-05-18 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * gncal-full-day.c (layout_children): Implemented ultra-cool
- layout for the events that share the same time range. Gals and
- guys you can now drop Outlook on the recycle bin.
-
- Which reminds me. We do not have a recycle bin. How could that
- happen in a project as cool as this one? Someone explain this to
- me.
-
-1998-05-18 Federico Mena <federico@nuclecu.unam.mx>
-
- * gncal-full-day.c (paint_back): Eliminated unnecessary border repainting.
-
-Sun May 17 17:55:03 1998 Havoc Pennington <hp@pobox.com>
-
- * gncal-todo.c (simple_todo_editor): Close dialog when return is pressed.
-
-1998-05-15 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * gnome-cal.c (mark_gtk_calendar_day): Bug free version of the
- range computation in place.
-
- * gncal-year-view.c (year_view_mark_day): Use the same new version
- of the range computation here.
-
- * calobj.c (ical_object_generate_events): Fix the begin/end
- condition.
-
-1998-05-14 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * timeutil.c (isodate_from_time_t): Do not add the spurious
- padding.
-
- * calobj.c (store_date_list): Bug fix: I was using the wrong
- pointer when saving the exception date list.
- (set_date_list): Bug fix: load correctly the complete exception
- date list.
- (set_date_list): Use ',' for the exception date separator as the
- versit people can not get their standard right.
-
- * gncal-full-day.c (unrecur_appointment): Support for making an
- existing recurrent event `movable' for a day.
-
- * calobj.c (ical_object_add_exdate): New routine, used to add
- exception dates.
- (ical_object_duplicate): New routine: used to do the magic
- recur->no-recur event.
-
-1998-05-08 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * gncal-full-day.c (new_appointment): Use gtk_calendar freeze/thaw
-
- * gncal-year-view.c (gncal_year_view_set_year): Use gtkcalendar freeze/thaw.
-
- * eventedit.c (event_editor_init): Use gnome_dialog_set_close to
- avoid the ugly warning.
-
- * main.c (display_objedit): Default to the day the user is looking
- at.
-
-1998-05-05 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * gncal-day-panel.c (full_day_size_allocated): Do not emit a value
- changed signal if the value is the same.
-
-1998-05-04 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * prop.c (prop_apply): Only run the apply code once.
-
-1998-05-03 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * gncal-day-panel.c (update): Draw the day at startup.
- (gncal_day_panel_set): Fix selected-day display.
- (gncal_day_panel_new): Switch day on double clicks, not on single
- clicks.
-
- * calobj.c (ical_object_compute_end): Removed debug messages.
-
-1998-04-30 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * prop.c (prop_apply): Do not call prop_cancel, ths is now using
- GnomePropertyDialog.
-
-1998-04-29 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * gncal-week-view.c (sync_week): Use gnome_calendar_tag_calendar.
-
- * gnome-cal.c (gnome_calendar_tag_calendar): New routine used to
- fill a gtk_calendar with the events on a GnomeCalendar object.
-
- * gncal-week-view.c (gncal_week_view_new): Set the week to the day
- we double clicked.
-
-1998-04-28 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * gnome-cal.c (calendar_notify): Apply black magic to get mail
- notifications to work.
-
- * gncal-full-day.c (child_focus_out): Temporary optimization, the
- child_focus_out is constantly calling the
- gnome_calendar_object_changed when the property editor has been
- invoked. This happens every time the mouse moves crosses the main
- window.
-
- * calendar.c (calendar_object_changed): Reschedule alarms when a
- calendar object has changed its times.
-
-Sat Apr 25 22:20:45 1998 Havoc Pennington <hp@pobox.com>
-
- * eventedit.c, eventedit.h: Descend from GnomeDialog. Took vbox
- out of class structure; use GnomeDialog vbox
- instead. gnome_dialog_set_destroy instead of destroying in button
- callbacks. Don't create buttons, separator, or vbox manually.
- #include <libgnomeui/gnome-dialog.h>.
-
-1998-04-24 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * calobj.c (ical_object_create_from_vobject): Fixed alarm loading;
- Load snooze time and snooze count
-
-1998-04-23 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * calendar.c (calendar_save): Actually save the to-do entries.
-
- * gncal-todo.c (simple_todo_editor): Now you can add and edit
- to-do entries.
-
-1998-04-22 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * gncal-full-day.c: Made it use popup_menu().
-
- * popup-menu.c: New file with utility functions for creating popup
- menus. Maybe such a thing would be useful in libgnomeui, a la
- gnome-app-helper?
-
- * Makefile.am (gnomecal_SOURCES): Added popup-menu.[ch] to the sources.
-
-1998-04-22 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * prop.c (properties): Added Calendar properties editor.
- (properties): Make the code use a propery box.
-
- * main.c: Save/load properties (fix to old commit).
-
-1998-04-21 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * gncal-todo.c: New widget for editing TODO lists. This will be
- worked on a lot.
-
- * Makefile.am (gnomecal_SOURCES): Added gncal-todo.[ch] to the sources.
-
- * gncal-day-panel.c: Make it use the new TODO widget.
-
-1998-04-21 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * timeutil.c (isodate_from_time_t): Do not save with the global
- time flag (Z at the end of the isodate). When we figure out a way
- to load times in GMT time, we will add this back
-
- * view-utils.c (popup_menu): Moved this routine here as there are
- more users of this code.
-
- * gncal-day-view.c (gncal_day_view_class_init): Add button press
- handler.
- (new_appointment): New routine for creating appointments on a day.
-
-
-
- * main.c (save_ok): Added call to gtk_window_set_wmclass.
-
- * gncal-day-panel.c (calendar_day_selected): Fix, years for mktime
- should substract 1900 and gtk_calendar stores years relative to
- year 0.
-
- * gncal-week-view.c (gncal_week_view_new): Make the week view
- descend from VBox so that we can add a label to it.
- (gncal_week_view_set): Display the ending day of the week
- correctly.
-
- Added a label that displays the week range.
-
-1998-04-21 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * gnome-cal.c: Made it use GncalDayPanel.
-
- * gncal-day-panel.c: New widget for the day view in the main
- calendar toplevel. It basically takes care of everything
- gnome-cal did by hand with respect to the day view.
-
- * Makefile.am (gnomecal_SOURCES): Added gncal-day-panel.[ch] to
- the rules.
-
- * main.c: Added a separator between the About menu item and the
- help topics.
-
-1998-04-20 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * eventedit.c (ee_ok): Mark the event as non-new after accepting changes.
-
-1998-04-20 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * gncal-full-day.c (gncal_full_day_get_day_start_yoffset): New
- public function that returns the y offset for the row
- corresponding to the "day begin" time.
-
- * gncal-full-day.c (gncal_full_day_key_press): Now any printable
- keystroke (not just Return) will activate the selected range.
-
- * gncal-full-day.c (paint_back): Made it use the new paint_row
- function instead of painting everything directly. We calculate
- areas in a smarter way so there is even less flicker than before,
- especially when selecting regions.
-
- * eventedit.c: Sensitize recurrence widgets properly.
-
- * calobj.c (duration_callback): Pass the correct pointer type to
- is_date_in_list().
-
-1998-04-20 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * calobj.c (duration_callback): Take exception dates into
- account.
-
- * gncal-full-day.c (new_appointment): Setup the event editor dates
- to those of the currently displayed day.
- (gncal_full_day_selection_range): Use sensible values in the case
- no range is selected.
- (new_appointment): Events now use the current day for event creation.
-
- * view-utils.c: Pretty up the time display.
-
- * calobj.c (ical_object_compute_end): Initialize
- ico->recur->enddate, otherwise we loop forever during final date computation.
-
- * eventedit.c: Now recurrence is toggled by a radio button in the
- recurrence page, as the checkbox is confusing.
-
- * calobj.c (is_date_in_list): Add support for the exclussion
- dates.
-
-1998-04-18 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * gncal-year-view.c (double_click): Fix this routine as well.
-
- * gncal-week-view.c (jump_to_day): Bind the gtkcalendar signals to
- the week.
-
- * gncal-year-view.c (gncal_year_view_set_year): Put things in the
- proper range. Now the year view actually matches this year.
-
- * gnome-cal.html: Added small documentation.
-
- * main.c: Add more icons to the menus; Rename some menubar
- entries; Add `new' icon to the toolbar.
- (dump_events): Added argument handling and dumping of events from
- the command line. Extremely cool.
-
- * getdate.y: Taken from the CVS source code. Used for date
- parsing in the command line.
-
- Internationalized getdate.y. Wee! It even works with spanish.
-
- * calobj.c (ical_object_to_vobject): Add Quoted printable property
- to items containing new lines.
- (duration): Use unsigned integers, to work around buggy calendar
- files generated by korganizer.
-
- * main.c (save_calendar_cmd): Do not ask for file name if we are
- saving.
- (save_as_calendar_cmd): New command.
-
-
-1998-04-17 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * alarm.c (alarm_kill, alarm_init, alarm_add): Implement the alarm
- management framework.
-
-1998-04-17 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * calobj.c (ical_new): Added mandatory status property.
- (ical_object_to_vobject): Only store "related" list if it exists.
- (store_list): Add terminating null char and free the correct data.
-
- * main.c (save_calendar_cmd): Implemented calendar saving.
- (open_calendar_cmd): Implemented calendar loading.
- (new_calendar_cmd): Implemented calendar creation.
- (new_calendar): Don't load our test calendar by default.
-
- * gncal-full-day.c (delete_appointment): Delete appointment implemented.
-
- * eventedit.c (ee_store_recur_values_to_ical): Free/create
- ical's recurrence appropriately.
- (ee_rp_init_rule): Initialize all missing parameters from ical.
- (ee_rp_init_ending_date): Initialize missing fields from ical.
-
-1998-04-17 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * gnome-cal.c (gnome_calendar_remove_object): Add support for
- removing objects.
-
-1998-04-17 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * eventedit.c (ee_init_recurrence_page): New function that creates
- the recurrence page in the toplevel notebook.
- (ee_store_recur_values_to_ical): Now we can also store the recurrences.
-
-1998-04-17 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * calobj.c (ical_object_generate_events): Implement
- RECUR_MONTHLY_BY_POS implemented.
- (ical_object_create_from_vobject): Fix the alarm
- initialization code.
- (save_alarm): Save alarms.
- (ical_object_generate_events): Fixed the recurrent code to take
- into account the recur->endate field (if at all specified).
-
- (ical_object_to_vobject): Implement recurrence rule saving.
-
-1998-04-16 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * eventedit.c (ee_store_alarm): Use menu_shell->children, not
- menu->children. Why does GtkMenu have a children field in the
- object structure?
- (check_dates): New function that insures that start_date < end_date.
- (check_times): In addition to checking whether the event spans the
- whole day, now it insures that start_time < end_time.
-
- * gncal-full-day.c (child_set_size): Now children get bigger
- temporarily while they are focused. This allows the handles not
- to "overlap" the rows used by the child and thus allow editing of
- very thin events.
- (recompute_motion): Fix for new child coordinates.
- (gncal_full_day_expose): Make it use find_child_by_window()
- instead of looking for it by hand.
-
- * bell.xpm recur.xpm: XPM files for events with alarm and
- recurrence, respectively.
-
-1998-04-15 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * gncal-full-day.c (button_1): Preserve the up/down cursor while dragging.
-
- * gncal-full-day.c (child_draw): Now children have a vertical
- handle as well. This can be used to move the child anytime, not
- only when it is focused.
- (recompute_motion): Modified for new drag behavior.
-
- * eventedit.c (ee_init_general_page): The general_owner may be
- null. Do the proper thing when creating the label.
- (ee_ok): Update the gnome calendar appropriately.
-
- * timeutil.h:
- * gncal-year-view.h: Add some missing prototypes.
-
- * gncal-full-day.c (child_popup_menu): Set the sensitivity of menu
- items according to whether the ical object is being edited or not.
-
- * eventedit.c (event_editor_new): Set the "being edited" flag on
- the ical object (stored as the ical object's user data).
- (event_editor_destroy): Release the flag.
-
- * calobj.h: The iCalObject structure now has a generic user_data pointer.
- * calobj.c (ical_object_set_user_data ical_object_get_user_data):
- Functions to set this data.
-
- * gncal-full-day.c (child_button_press): Do child popup menu correctly.
-
- * main.c (about_calendar_cmd): Fixed my address and added Arturo
- to the authors in the about box.
-
- * gncal-full-day.c (find_child_by_window): Compare child's widget
- windows by user_data (which will be the parent widget, that is,
- the text widget). We cannot assume that child->widget->window
- will be *the* window we are interested on because there may be
- child widgets with multiple windows.
-
-1998-04-15 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * calobj.c (ical_foreach): Define iterator routine.
-
-1998-04-15 Arturo Espinosa Aldama <arturo@nuclecu.unam.mx>
-
- * gncal-year-view.[hc]: Now using time_t for new and set.
- Random fixes, as well.
-
-1998-04-15 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * gncal-full-day.c (button_3): New popup menus activated with
- mouse button 3.
- (create_appointment): Create a new appointment from the popup
- menus. See the FIXME.
-
-1998-04-15 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * gncal-full-day.c (layout_kill_rows): Routine to destory rows
- array properly.
-
- * gncal-year-view.c (gncal_year_view_new): Add missing year in
- call to strftime.
-
- * calobj.c (ical_object_create_from_vobject): Fixed memory leaks
- from the return values of versit's fakeCString.
-
-1998-04-14 Arturo Espinosa Aldama <arturo@nuclecu.unam.mx>
-
- * gncal-year-view.[hc]: New widget for the year view.
- * Makefile.am: added required compilation of the new files.
-
-1998-04-14 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * eventedit.c (event_editor_setup_time_frame): Fixed some table
- expansions to make the dialog look nicer when resized.
-
- * calobj.c (ignore_space): Fixed compiler warning about unused
- computed value.
- (ocurrencelist): Replace str by p confusion. Removed unused
- variables value and q.
- (daynumber): Fixed a couple of warnings about unused values.
- (load_recurrence): Removed unused variable c. Added a default
- clause to the switch(type).
-
- * eventedit.c (ee_rp_init_frequency): Removed unused variable content.
- Fixed a compiler warning by adding a missing cast.
-
- * calobj.c (ical_object_create_from_vobject): Make the
- load_recurrence() part work correctly. Eliminated use of
- syntax_error variable.
-
-1998-04-13 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * gncal-full-day.c (child_key_press): Unfocus the child and focus
- the parent fullday widget when the user presses Esc.
-
- * gncal-week-view.c (gncal_week_view_update): Now takes object and
- flags parameters.
- * gncal-day-view.c (gncal_day_view_update): Likewise.
- * gncal-full-day.c (gncal_full_day_update): Likewise.
- (child_focus_in): New function. In conjunction with
- child_focus_out(), these only display the handles in the child
- when it is focused. The result is that the user can see more of
- the child's text when nothing is focused, and we can also display
- fatter and nicer drag handles.
-
- * gnome-cal.c (gnome_calendar_object_changed): Now takes an
- additional flags parameter
- (gnome_calendar_update_all): Made function static. Now takes
- changed object and flags parameters as well.
- (gnome_calendar_object_changed): Now takes additional flags
- parameter to indicate what changed in the specified object.
-
- * calobj.h (CalObjectChange): New enum with flags to describe what
- has been changed in an object.
-
- * gncal-full-day.h:
- * gncal-full-day.c (gncal_full_day_focus_child): New function to
- let the outside world decide which child to focus.
- (gncal_full_day_focus_child): Bleah. We have to synthesize a
- click because GtkText will not set the cursor when you focus it.
-
- * gnome-cal.c (day_view_range_activated): Focus the new child in
- the full day widget.
-
- * eventedit.c (event_editor_setup_time_frame): Re-aligned some
- widgets to make it look prettier.
- (ee_alarm_widgets): Likewise.
- (ee_init_general_page): Likewise.
- (ee_classification_widgets): Likewise.
- (event_editor_init_widgets): Likewise.
-
- * gnome-cal.c (day_view_range_activated): Create new object and
- add it to the calendar. You can now select a range in the
- full-day view, hit Return, and a new event will be added at the
- selected range. I still have to figure out how to focus this new child.
-
- * gncal-full-day.c (paint_back): Rewrote function to avoid
- painting an area more than once -- eliminate flicker.
- (paint_back_rows): New function that calls paint_back() only for
- the area of the specified rows.
- (gncal_full_day_button_press):
- (gncal_full_day_button_release):
- (gncal_full_day_motion): Made these functions use
- paint_back_rows() instead of paint_back(), to eliminate flicker. Wheee!
-
-1998-04-12 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * gnome-cal.c (setup_day_view): We now connect to the
- range_activated signal of the fullday widget instead of catching
- key presses ourselves.
- (day_view_range_activated): New function that creates a new
- iCalObject and inserts it into the calendar, not finished yet.
-
-1998-04-11 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * gncal-full-day.c (get_time_from_rows): New function, calculates
- a pair of time_t values from the specified start and number of rows.
-
- * gncal-full-day.h (GncalFullDayClass): New signal
- "range_activated". It is emitted when a range is selected and the
- user hits Return.
- (gncal_full_day_selection_range): New function, returns the
- selected range.
-
- * gncal-full-day.c (struct drag_info): Moved selection information
- to their own fields instead of sharing the child's drag fields.
- This allows us to keep the selection when a child is moved.
- (recompute_motion): Made the case when (row < di->sel_click_row)
- work correctly.
-
-1998-04-11 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * gnome-cal.c (gnome_calendar_goto): Add support for navigating
- on the day view.
-
- * timeutil.c (time_start_of_day, time_end_of_day, time_day_hour):
- New time manipulation functions.
-
- * eventedit.c (ee_rp_init_frequency): Add the different frequency
- editors to a notebook. Make the notebook startup on the entry
- selected recurrence type;
-
-1998-04-11 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * gncal-full-day.c (recompute_motion): Now we support selecting a
- range in the main window (by clicking+dragging). It flickers
- horribly and is not perfect, but it is a start.
-
-1998-04-09 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * gncal-full-day.c: #include <string.h>
-
- * gncal-full-day.c (child_map): Show instead of just map the child
- widget (otherwise the text widget gets confused and will not focus).
-
- * calobj.c (ical_object_to_vobject): Quote chars as 'x', not "x".
-
- * calobj.h: Added prototype for ical_object_to_vobject().
-
- * gnome-cal.c (gnome_calendar_object_changed): New function. This
- should be called when a calendar object is changed.
-
- * gncal-full-day.c (update_from_drag_info): Call
- gnome_calendar_object_changed() instead of updating manually.
-
- * calendar.c (calendar_add_object):
- (calendar_remove_object): Set the modified flag to true.
-
- * gncal-full-day.c (gncal_full_day_draw): Finished implementing
- this function.
-
-1998-04-08 Raja R Harinath <harinath@cs.umn.edu>
-
- * gncal.c (update_calendar): Say `#if 0', not `#ifdef 0'.
-
-1998-04-07 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * eventedit.c: Removed unused global variable parent_class.
-
- * eventedit.h: Renamed gtk_window field to window.
- Made the parent_class field in the EventEditorClass structure be a
- GtkWindowClass, not a gnome property box class.
- Added prototype for event_editor_get_type().
-
-1998-04-06 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * gncal-week-view.c (gncal_week_view_new): Use the new
- gtk_table_set_homogeneous() instead of setting the variable directly.
-
-1998-04-03 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * eventedit.c (ee_create_ae): Make it return void.
- (ee_alarm_widgets): Remove some unused variables.
- (ee_store_alarm): Make it return void.
- #include <string.h>
-
- * eventedit.h: #include "gnome-cal.h"
-
- * calobj.c (list_free): Don't use g_free in the g_list_foreach.
-
- * calendar.h: Add prototype for calendar_load().
-
- * timeutil.h: Add prototypes for time_add_*().
-
- * calendar.c:
- * calobj.c:
- * eventedit.c:
- * gnome-cal.c: #include "timeutil.h"
-
- * gncal-day-view.c (gncal_day_view_size_request): Make the minimum
- width equal or larger to the title width.
-
- * main.c: #include "eventedit.h"
- (main): Add a return statement.
- (new_calendar): Show stuff *after* the calendar has been loaded.
-
- * gnome-cal.c (gnome_calendar_load): Update the day view.
- (setup_widgets): Hackish setup of a day view widget - will fix later.
- (gnome_calendar_init): Initialize all fields.
-
- * gnome-cal.h: Added day_view field. Maybe this should be changed
- when the a complete day view panel is complete.
-
- * gncal-day-view.c (gncal_day_view_update): Draw after update, not
- before.
-
-1998-04-06 Carsten Schaar <nhadcasc@fs-maphy.uni-hannover.de>
-
- * versit/.cvsignore: New file.
-
-Fri Apr 3 22:31:54 1998 Tom Tromey <tromey@cygnus.com>
-
- * calendar.c: Include <config.h>.
-
-1998-04-03 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * timeutil.c (time_add_year, time_add_year, time_add_week):
- Routines for time manipulation.
-
- * calobj.c (ical_object_destroy): Full destruction of the object.
-
- * eventedit.c: Finished the main event editor form; It still
- lacks the details and the recurrence bits. It now adds events
- and cancels.
-
-1998-04-03 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * view-utils.c (view_utils_draw_events): The "better" format
- string for strftime() wasn't better, after all :-(
-
-1998-04-02 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * gncal-full-day.c: New full-day widget. It is still a work in
- progress. It will be similar to M$ Schedule's nifty full day view
- widget, but with Gtk's elegance :-)
-
- * Makefile.am (gnomecal_SOURCES): Added gncal-full-day.[ch] to the sources.
-
-1998-04-02 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * eventedit.c: Object editor widget. We dropped ObjEdit.
-
- * timeutil.c (time_from_isodate): Fix.
-
- * view-utils.c (view_utils_draw_events): Changed the display
- formats.
-
-1998-04-02 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * view-utils.c (view_utils_draw_events): Use better format
- specifier for strftime().
- (view_utils_draw_textured_frame): Ultra-nifty function to draw
- textured "metal" frames, like Netscape's handles.
-
-1998-04-02 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * gncal-day-view.c (gncal_day_view_update): Day events are now
- cached inside the widget. They get initialized at this time.
-
- * view-utils.c (view_utils_draw_events): Use the list of events.
-
-1998-04-02 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * gncal-day-view.c (gncal_day_view_set_shadow): New customization
- function. We can't decide on a stupid border type :-)
- (gncal_day_view_init): Made GTK_SHADOW_ETCHED_IN be the default
- shadow type. Looks good.
-
-1998-04-02 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * main.c: New main program that uses our new datatypes and
- objects.
-
- * calendar.c (calendar_load_from_vobject, calendar_load):
- Implement loading of vCalendar objects and vCalendar files.
-
- * calobj.c (ical_object_create_from_vobject): Implement loading of
- vCalendar event and todo objects.
-
- * timeutil.c (isodate_from_time_t): New function.
-
- * gnome-cal.c, gnome-cal.h: Implement a toplevel widget, derived
- from GnomeApp. It holds all of the day views and arbitrates the
- display.
-
-1998-04-02 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * gncal-week-view.[ch]: New week view composite widget. This
- provides a full week view (7 day views plus busy time display --
- the latter is currently unimplemented).
-
-1998-04-01 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * gncal-day-view.c: New day view widget. It is intended to be a
- child widget of the week view composite widget.
-
- * calendar.c (calendar_get_objects_in_range):
- (calendar_get_events_in_range):
- (calendar_get_journal_in_range):
- (calendar_get_journal_in_range): These functions now take a
- sort_func parameter, which is of type GCompareFunc. If the
- specified value is non-NULL, it will return a sorted list.
- Otherwise, it will return an unordered list.
- (calendar_compare_by_dtstart): Provide a generic sorting routine
- for calendar objects.
-
-1998-04-01 Miguel de Icaza <miguel@kernel.org>
-
- * Start from scratch
-
-Tue Mar 31 23:46:50 1998 Tom Tromey <tromey@cygnus.com>
-
- * timeutil.c (format_simple_hour): `buf' now static.
-
-1998-03-31 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * gncal.c: Removed #include "gtkcalendar.h", because it now comes
- from libgnomeui.
-
- * Makefile.am (gncal_SOURCES): Added new source files to the rules.
-
- * timeutil.c (format_simple_hour): New function, formats an
- hour/am_pm pair into a string of the form "3am", "12pm", "05h",
- "19h", etc. It is used by the day view widget for its labels.
-
-1998-03-31 Craig Small <csmall@small.dropbear.id.au>
-
- * Now has (non working) session maangement
- * Uses a clist for the dailylist like gtt
-
-Sat Mar 21 15:43:20 1998 Tom Tromey <tromey@cygnus.com>
-
- * gncal.c: Use gnome_message_box_*, not gnome_messagebox_*.
-
-1998-03-12 Craig Small <csmall@small.dropbear.id.au>
-
- * Now linked (in some horrible way) to the gtkcalendar widget.
-
-Sun Mar 8 16:38:10 1998 Tom Tromey <tromey@cygnus.com>
-
- * Makefile.am (INCLUDES): Added GNOME_INCLUDEDIR.
- (gncal_LDADD): Don't include libsupport.a.
-
- * gncal.c (main): Use new gnome_init.
-
-1998-02-19 Federico Mena Quintero <federico@nuclecu.unam.mx>
-
- * gncal.c (main): Added app_id "gncal".
-
-1998-02-19 Carsten Schaar <nhadcasc@fs-maphy.uni-hannover.de>
-
- * Makefile.am (gncal_LDADD): Added '$(INTLLIBS)'
-
-1998-02-18 Raja R Harinath <harinath@cs.umn.edu>
-
- * Makefile.am (gncal_LDADD): Include `libsupport.a'.
-
- * calcs.c (month_atoi): Replace buggy explicit loop string compare
- with strcasecmp.
- (day_atoi): Likewise.
-
-Sun Jan 25 23:38:30 1998 Miguel de Icaza <miguel@nuclecu.unam.mx>
-
- * menus.c: Replace "Quit" with "Exit".
diff --git a/calendar/Makefile.am b/calendar/Makefile.am
deleted file mode 100644
index 76851cc008..0000000000
--- a/calendar/Makefile.am
+++ /dev/null
@@ -1,12 +0,0 @@
-if ENABLE_PILOT_CONDUITS
-CONDUIT_DIR = conduits
-else
-CONDUIT_DIR =
-endif
-
-SUBDIRS = idl gui importers $(CONDUIT_DIR)
-
-EXTRA_DIST = \
- ChangeLog.pre-1-4 \
- zones.h
-
diff --git a/calendar/conduits/.cvsignore b/calendar/conduits/.cvsignore
deleted file mode 100644
index b840c21800..0000000000
--- a/calendar/conduits/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile.in
-Makefile \ No newline at end of file
diff --git a/calendar/conduits/Makefile.am b/calendar/conduits/Makefile.am
deleted file mode 100644
index 906ea61971..0000000000
--- a/calendar/conduits/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = calendar todo
diff --git a/calendar/conduits/calendar/.cvsignore b/calendar/conduits/calendar/.cvsignore
deleted file mode 100644
index e8ba6ad844..0000000000
--- a/calendar/conduits/calendar/.cvsignore
+++ /dev/null
@@ -1,9 +0,0 @@
-Makefile.in
-Makefile
-.deps
-e-calendar.conduit
-*.lo
-.libs
-libecalendar_conduit.la
-e-calendar-conduit-control-applet
-e-calendar-conduit-control-applet.desktop
diff --git a/calendar/conduits/calendar/Makefile.am b/calendar/conduits/calendar/Makefile.am
deleted file mode 100644
index 7bf53a7aed..0000000000
--- a/calendar/conduits/calendar/Makefile.am
+++ /dev/null
@@ -1,34 +0,0 @@
-INCLUDES = \
- -I$(top_srcdir)/e-util \
- -I$(top_builddir)/e-util \
- $(EVOLUTION_CALENDAR_CONDUIT_CFLAGS)
-
-# Calendar Conduit
-privconduit_LTLIBRARIES = libecalendar_conduit.la
-
-libecalendar_conduit_la_SOURCES = \
- calendar-conduit.c
-
-libecalendar_conduit_la_LDFLAGS = -module -avoid-version
-libecalendar_conduit_la_LIBADD = \
- $(top_builddir)/e-util/libeutil.la \
- $(top_builddir)/e-util/libeconduit.la \
- $(EVOLUTION_CALENDAR_CONDUIT_LIBS)
-
-e-calendar-$(BASE_VERSION).conduit: e-calendar.conduit.in
- sed -e 's^\@privconduitdir\@^$(privconduitdir)^g' \
- -e 's^\@datadir\@^$(datadir)^g' \
- -e 's^\@BASE_VERSION\@^$(BASE_VERSION)^g' \
- $< > $@
-
-conduitdir = $(datadir)/gnome-pilot/conduits/
-conduit_DATA = e-calendar-$(BASE_VERSION).conduit
-
-BUILT_SOURCES = $(conduit_DATA)
-CLEANFILES = $(BUILT_SOURCES)
-
-EXTRA_DIST = \
- e-calendar.conduit.in
-
-dist-hook:
- cd $(distdir); rm -f $(BUILT_SOURCES) \ No newline at end of file
diff --git a/calendar/conduits/calendar/calendar-conduit.c b/calendar/conduits/calendar/calendar-conduit.c
deleted file mode 100644
index 47b3755ea5..0000000000
--- a/calendar/conduits/calendar/calendar-conduit.c
+++ /dev/null
@@ -1,1908 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* Evolution calendar - Calendar Conduit
- *
- * Copyright (C) 1998 Free Software Foundation
- * Copyright (C) 2000 Ximian, Inc.
- *
- * Authors: Eskil Heyn Olsen <deity@eskil.dk>
- * JP Rosevear <jpr@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-
-#define G_LOG_DOMAIN "ecalconduit"
-
-#include <libecal/e-cal-types.h>
-#include <libecal/e-cal.h>
-#include <libecal/e-cal-time-util.h>
-#include <pi-source.h>
-#include <pi-socket.h>
-#include <pi-dlp.h>
-#include <pi-datebook.h>
-#include <gpilotd/gnome-pilot-conduit.h>
-#include <gpilotd/gnome-pilot-conduit-sync-abs.h>
-#include <libgpilotdCM/gnome-pilot-conduit-management.h>
-#include <libgpilotdCM/gnome-pilot-conduit-config.h>
-#include <e-pilot-map.h>
-#include <e-pilot-settings.h>
-#include <e-pilot-util.h>
-#include <e-config-listener.h>
-
-GnomePilotConduit * conduit_get_gpilot_conduit (guint32);
-void conduit_destroy_gpilot_conduit (GnomePilotConduit*);
-
-#define CONDUIT_VERSION "0.1.6"
-
-#define DEBUG_CALCONDUIT 1
-/* #undef DEBUG_CALCONDUIT */
-
-#ifdef DEBUG_CALCONDUIT
-#define LOG(x) x
-#else
-#define LOG(x)
-#endif
-
-#define WARN g_warning
-#define INFO g_message
-
-#define PILOT_MAX_ADVANCE 99
-
-typedef struct _ECalLocalRecord ECalLocalRecord;
-typedef struct _ECalConduitCfg ECalConduitCfg;
-typedef struct _ECalConduitGui ECalConduitGui;
-typedef struct _ECalConduitContext ECalConduitContext;
-
-/* Local Record */
-struct _ECalLocalRecord {
- /* The stuff from gnome-pilot-conduit-standard-abs.h
- Must be first in the structure, or instances of this
- structure cannot be used by gnome-pilot-conduit-standard-abs.
- */
- GnomePilotDesktopRecord local;
-
- /* The corresponding Comp object */
- ECalComponent *comp;
-
- /* pilot-link appointment structure */
- struct Appointment *appt;
-};
-
-static void
-calconduit_destroy_record (ECalLocalRecord *local)
-{
- g_object_unref (local->comp);
- free_Appointment (local->appt);
- g_free (local->appt);
- g_free (local);
-}
-
-/* Configuration */
-struct _ECalConduitCfg {
- guint32 pilot_id;
- GnomePilotConduitSyncType sync_type;
-
- gboolean secret;
- gboolean multi_day_split;
-
- gchar *last_uri;
-};
-
-static ECalConduitCfg *
-calconduit_load_configuration (guint32 pilot_id)
-{
- ECalConduitCfg *c;
- GnomePilotConduitManagement *management;
- GnomePilotConduitConfig *config;
- gchar prefix[256];
-
- c = g_new0 (ECalConduitCfg, 1);
- g_assert (c != NULL);
-
- /* Pilot ID */
- c->pilot_id = pilot_id;
-
- /* Sync Type */
- management = gnome_pilot_conduit_management_new ("e_calendar_conduit", GNOME_PILOT_CONDUIT_MGMT_ID);
- gtk_object_ref (GTK_OBJECT (management));
- gtk_object_sink (GTK_OBJECT (management));
- config = gnome_pilot_conduit_config_new (management, pilot_id);
- gtk_object_ref (GTK_OBJECT (config));
- gtk_object_sink (GTK_OBJECT (config));
- if (!gnome_pilot_conduit_config_is_enabled (config, &c->sync_type))
- c->sync_type = GnomePilotConduitSyncTypeNotSet;
- gtk_object_unref (GTK_OBJECT (config));
- gtk_object_unref (GTK_OBJECT (management));
-
- /* Custom settings */
- g_snprintf (prefix, 255, "/gnome-pilot.d/e-calendar-conduit/Pilot_%u/", pilot_id);
- gnome_config_push_prefix (prefix);
-
- c->secret = gnome_config_get_bool ("secret=FALSE");
- c->multi_day_split = gnome_config_get_bool ("multi_day_split=TRUE");
- c->last_uri = gnome_config_get_string ("last_uri");
-
- gnome_config_pop_prefix ();
-
- return c;
-}
-
-static void
-calconduit_save_configuration (ECalConduitCfg *c)
-{
- gchar prefix[256];
-
- g_snprintf (prefix, 255, "/gnome-pilot.d/e-calendar-conduit/Pilot_%u/", c->pilot_id);
- gnome_config_push_prefix (prefix);
-
- gnome_config_set_bool ("secret", c->secret);
- gnome_config_set_bool ("multi_day_split", c->multi_day_split);
- gnome_config_set_string ("last_uri", c->last_uri);
-
- gnome_config_pop_prefix ();
-
- gnome_config_sync ();
- gnome_config_drop_all ();
-}
-
-static ECalConduitCfg*
-calconduit_dupe_configuration (ECalConduitCfg *c)
-{
- ECalConduitCfg *retval;
-
- g_return_val_if_fail (c != NULL, NULL);
-
- retval = g_new0 (ECalConduitCfg, 1);
- retval->pilot_id = c->pilot_id;
- retval->sync_type = c->sync_type;
- retval->secret = c->secret;
- retval->multi_day_split = c->multi_day_split;
- retval->last_uri = g_strdup (c->last_uri);
-
- return retval;
-}
-
-static void
-calconduit_destroy_configuration (ECalConduitCfg *c)
-{
- g_return_if_fail (c != NULL);
-
- g_free (c->last_uri);
- g_free (c);
-}
-
-/* Gui */
-struct _ECalConduitGui {
- GtkWidget *multi_day_split;
-};
-
-static ECalConduitGui *
-e_cal_gui_new (EPilotSettings *ps)
-{
- ECalConduitGui *gui;
- GtkWidget *lbl;
- gint rows;
-
- g_return_val_if_fail (ps != NULL, NULL);
- g_return_val_if_fail (E_IS_PILOT_SETTINGS (ps), NULL);
-
- gtk_table_resize (GTK_TABLE (ps), E_PILOT_SETTINGS_TABLE_ROWS + 1, E_PILOT_SETTINGS_TABLE_COLS);
-
- gui = g_new0 (ECalConduitGui, 1);
-
- rows = E_PILOT_SETTINGS_TABLE_ROWS;
- lbl = gtk_label_new (_("Split Multi-Day Events:"));
- gui->multi_day_split = gtk_check_button_new ();
- gtk_table_attach_defaults (GTK_TABLE (ps), lbl, 0, 1, rows, rows + 1);
- gtk_table_attach_defaults (GTK_TABLE (ps), gui->multi_day_split, 1, 2, rows, rows + 1);
- gtk_widget_show (lbl);
- gtk_widget_show (gui->multi_day_split);
-
- return gui;
-}
-
-static void
-e_cal_gui_fill_widgets (ECalConduitGui *gui, ECalConduitCfg *cfg)
-{
- g_return_if_fail (gui != NULL);
- g_return_if_fail (cfg != NULL);
-
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gui->multi_day_split),
- cfg->multi_day_split);
-}
-
-static void
-e_cal_gui_fill_config (ECalConduitGui *gui, ECalConduitCfg *cfg)
-{
- g_return_if_fail (gui != NULL);
- g_return_if_fail (cfg != NULL);
-
- cfg->multi_day_split = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gui->multi_day_split));
-}
-
-static void
-e_cal_gui_destroy (ECalConduitGui *gui)
-{
- g_free (gui);
-}
-
-/* Context */
-struct _ECalConduitContext {
- GnomePilotDBInfo *dbi;
-
- ECalConduitCfg *cfg;
- ECalConduitCfg *new_cfg;
- ECalConduitGui *gui;
- GtkWidget *ps;
-
- struct AppointmentAppInfo ai;
-
- ECal *client;
-
- icaltimezone *timezone;
- ECalComponent *default_comp;
- GList *comps;
- GList *changed;
- GHashTable *changed_hash;
- GList *locals;
-
- EPilotMap *map;
-};
-
-static ECalConduitContext *
-e_calendar_context_new (guint32 pilot_id)
-{
- ECalConduitContext *ctxt;
-
- ctxt = g_new0 (ECalConduitContext, 1);
- g_assert (ctxt != NULL);
-
- ctxt->cfg = calconduit_load_configuration (pilot_id);
- ctxt->new_cfg = calconduit_dupe_configuration (ctxt->cfg);
- ctxt->ps = NULL;
- ctxt->dbi = NULL;
- ctxt->client = NULL;
- ctxt->timezone = NULL;
- ctxt->default_comp = NULL;
- ctxt->comps = NULL;
- ctxt->changed = NULL;
- ctxt->changed_hash = NULL;
- ctxt->locals = NULL;
- ctxt->map = NULL;
-
- return ctxt;
-}
-
-static gboolean
-e_calendar_context_foreach_change (gpointer key, gpointer value, gpointer data)
-{
- g_free (key);
-
- return TRUE;
-}
-
-static void
-e_calendar_context_destroy (ECalConduitContext *ctxt)
-{
- GList *l;
-
- g_return_if_fail (ctxt != NULL);
-
- if (ctxt->cfg != NULL)
- calconduit_destroy_configuration (ctxt->cfg);
- if (ctxt->new_cfg != NULL)
- calconduit_destroy_configuration (ctxt->new_cfg);
- if (ctxt->gui != NULL)
- e_cal_gui_destroy (ctxt->gui);
-
- if (ctxt->client != NULL)
- g_object_unref (ctxt->client);
- if (ctxt->default_comp != NULL)
- g_object_unref (ctxt->default_comp);
- if (ctxt->comps != NULL) {
- for (l = ctxt->comps; l; l = l->next)
- g_object_unref (l->data);
- g_list_free (ctxt->comps);
- }
-
- if (ctxt->changed != NULL)
- e_cal_free_change_list (ctxt->changed);
-
- if (ctxt->changed_hash != NULL) {
- g_hash_table_foreach_remove (ctxt->changed_hash, e_calendar_context_foreach_change, NULL);
- g_hash_table_destroy (ctxt->changed_hash);
- }
-
- if (ctxt->locals != NULL) {
- for (l = ctxt->locals; l != NULL; l = l->next)
- calconduit_destroy_record (l->data);
- g_list_free (ctxt->locals);
- }
-
- if (ctxt->map != NULL)
- e_pilot_map_destroy (ctxt->map);
-}
-
-/* Debug routines */
-static char *
-print_local (ECalLocalRecord *local)
-{
- static char buff[ 4096 ];
-
- if (local == NULL) {
- sprintf (buff, "[NULL]");
- return buff;
- }
-
- if (local->appt && local->appt->description) {
- g_snprintf (buff, 4096, "[%ld %ld '%s' '%s']",
- mktime (&local->appt->begin),
- mktime (&local->appt->end),
- local->appt->description ?
- local->appt->description : "",
- local->appt->note ?
- local->appt->note : "");
- return buff;
- }
-
- return "";
-}
-
-static char *print_remote (GnomePilotRecord *remote)
-{
- static char buff[ 4096 ];
- struct Appointment appt;
-
- if (remote == NULL) {
- sprintf (buff, "[NULL]");
- return buff;
- }
-
- memset (&appt, 0, sizeof (struct Appointment));
- unpack_Appointment (&appt, remote->record, remote->length);
-
- g_snprintf (buff, 4096, "[%ld %ld '%s' '%s']",
- mktime (&appt.begin),
- mktime (&appt.end),
- appt.description ?
- appt.description : "",
- appt.note ?
- appt.note : "");
-
- free_Appointment (&appt);
-
- return buff;
-}
-
-static int
-start_calendar_server (ECalConduitContext *ctxt)
-{
- char *uri;
-
- g_return_val_if_fail (ctxt != NULL, -2);
-
- /* FIXME Need a mechanism for the user to select uri's */
- /* FIXME Can we use the cal model? */
- uri = g_strdup_printf ("file://%s/local/Calendar/", g_get_home_dir ());
- ctxt->client = e_cal_new (uri, CALOBJ_TYPE_EVENT);
- g_free (uri);
-
- if (!ctxt->client)
- return -1;
-
- if (!e_cal_open (ctxt->client, FALSE, NULL))
- return -1;
-
- return 0;
-}
-
-/* Utility routines */
-static icaltimezone *
-get_timezone (ECal *client, const char *tzid)
-{
- icaltimezone *timezone = NULL;
-
- timezone = icaltimezone_get_builtin_timezone_from_tzid (tzid);
- if (timezone == NULL)
- e_cal_get_timezone (client, tzid, &timezone, NULL);
-
- return timezone;
-}
-
-static icaltimezone *
-get_default_timezone (void)
-{
- EConfigListener *listener;
- icaltimezone *timezone = NULL;
- char *location;
-
- listener = e_config_listener_new ();
-
- location = e_config_listener_get_string_with_default (listener,
- "/apps/evolution/calendar/display/timezone", "UTC", NULL);
- if (!location || !location[0]) {
- g_free (location);
- location = g_strdup ("UTC");
- }
-
- timezone = icaltimezone_get_builtin_timezone (location);
- g_free (location);
-
- g_object_unref (listener);
-
- return timezone;
-}
-
-
-static char *
-map_name (ECalConduitContext *ctxt)
-{
- char *filename;
-
- filename = g_strdup_printf ("%s/evolution/local/Calendar/pilot-map-calendar-%d.xml", g_get_home_dir (), ctxt->cfg->pilot_id);
-
- return filename;
-}
-
-static icalrecurrencetype_weekday
-get_ical_day (int day)
-{
- switch (day) {
- case 0:
- return ICAL_SUNDAY_WEEKDAY;
- case 1:
- return ICAL_MONDAY_WEEKDAY;
- case 2:
- return ICAL_TUESDAY_WEEKDAY;
- case 3:
- return ICAL_WEDNESDAY_WEEKDAY;
- case 4:
- return ICAL_THURSDAY_WEEKDAY;
- case 5:
- return ICAL_FRIDAY_WEEKDAY;
- case 6:
- return ICAL_SATURDAY_WEEKDAY;
- }
-
- return ICAL_NO_WEEKDAY;
-}
-
-static int
-get_pilot_day (icalrecurrencetype_weekday wd)
-{
- switch (wd) {
- case ICAL_SUNDAY_WEEKDAY:
- return 0;
- case ICAL_MONDAY_WEEKDAY:
- return 1;
- case ICAL_TUESDAY_WEEKDAY:
- return 2;
- case ICAL_WEDNESDAY_WEEKDAY:
- return 3;
- case ICAL_THURSDAY_WEEKDAY:
- return 4;
- case ICAL_FRIDAY_WEEKDAY:
- return 5;
- case ICAL_SATURDAY_WEEKDAY:
- return 6;
- default:
- return -1;
- }
-}
-
-static gboolean
-is_empty_time (struct tm time)
-{
- if (time.tm_sec || time.tm_min || time.tm_hour
- || time.tm_mday || time.tm_mon || time.tm_year)
- return FALSE;
-
- return TRUE;
-}
-
-static gboolean
-is_all_day (ECal *client, ECalComponentDateTime *dt_start, ECalComponentDateTime *dt_end)
-{
- time_t dt_start_time, dt_end_time;
- icaltimezone *timezone;
-
- if (dt_start->value->is_date && dt_end->value->is_date)
- return TRUE;
-
- timezone = get_timezone (client, dt_start->tzid);
- dt_start_time = icaltime_as_timet_with_zone (*dt_start->value, timezone);
- dt_end_time = icaltime_as_timet_with_zone (*dt_end->value, get_timezone (client, dt_end->tzid));
-
- if (dt_end_time == time_add_day_with_zone (dt_start_time, 1, timezone))
- return TRUE;
-
- return FALSE;
-}
-
-static gboolean
-process_multi_day (ECalConduitContext *ctxt, ECalChange *ccc, GList **multi_comp, GList **multi_ccc)
-{
- ECalComponentDateTime dt_start, dt_end;
- icaltimezone *tz_start, *tz_end;
- time_t event_start, event_end, day_end;
- struct icaltimetype *old_start_value, *old_end_value;
- const char *uid;
- gboolean is_date = FALSE;
- gboolean last = FALSE;
- gboolean ret = TRUE;
-
- *multi_ccc = NULL;
- *multi_comp = NULL;
-
- if (ccc->type == E_CAL_CHANGE_DELETED)
- return FALSE;
-
- /* Start time */
- e_cal_component_get_dtstart (ccc->comp, &dt_start);
- if (dt_start.value->is_date)
- tz_start = ctxt->timezone;
- else
- tz_start = get_timezone (ctxt->client, dt_start.tzid);
- event_start = icaltime_as_timet_with_zone (*dt_start.value, tz_start);
-
- e_cal_component_get_dtend (ccc->comp, &dt_end);
- if (dt_end.value->is_date)
- tz_end = ctxt->timezone;
- else
- tz_end = get_timezone (ctxt->client, dt_end.tzid);
- event_end = icaltime_as_timet_with_zone (*dt_end.value, tz_end);
-
- day_end = time_day_end_with_zone (event_start, ctxt->timezone);
- if (day_end >= event_end) {
- ret = FALSE;
- goto cleanup;
- } else if (e_cal_component_has_recurrences (ccc->comp) || !ctxt->cfg->multi_day_split) {
- ret = TRUE;
- goto cleanup;
- }
-
- if (dt_start.value->is_date && dt_end.value->is_date)
- is_date = TRUE;
-
- old_start_value = dt_start.value;
- old_end_value = dt_end.value;
- while (!last) {
- ECalComponent *clone = e_cal_component_clone (ccc->comp);
- char *new_uid = e_cal_component_gen_uid ();
- struct icaltimetype start_value, end_value;
- ECalChange *c = g_new0 (ECalChange, 1);
-
- if (day_end >= event_end) {
- day_end = event_end;
- last = TRUE;
- }
-
- e_cal_component_set_uid (clone, new_uid);
-
- start_value = icaltime_from_timet_with_zone (event_start, is_date, tz_start);
- dt_start.value = &start_value;
- e_cal_component_set_dtstart (clone, &dt_start);
-
- end_value = icaltime_from_timet_with_zone (day_end, is_date, tz_end);
- dt_end.value = &end_value;
- e_cal_component_set_dtend (clone, &dt_end);
-
- /* FIXME Error handling */
- e_cal_create_object (ctxt->client, e_cal_component_get_icalcomponent (clone), NULL, NULL);
-
- c->comp = clone;
- c->type = E_CAL_CHANGE_ADDED;
-
- *multi_ccc = g_list_prepend (*multi_ccc, c);
- *multi_comp = g_list_prepend (*multi_comp, g_object_ref (c->comp));
-
- event_start = day_end;
- day_end = time_day_end_with_zone (event_start, ctxt->timezone);
- }
- dt_start.value = old_start_value;
- dt_end.value = old_end_value;
-
- e_cal_component_get_uid (ccc->comp, &uid);
- /* FIXME Error handling */
- e_cal_remove_object (ctxt->client, uid, NULL);
- ccc->type = E_CAL_CHANGE_DELETED;
-
- cleanup:
- e_cal_component_free_datetime (&dt_start);
- e_cal_component_free_datetime (&dt_end);
-
- return ret;
-}
-
-static short
-nth_weekday (int pos, icalrecurrencetype_weekday weekday)
-{
- g_assert ((pos > 0 && pos <= 5) || (pos == -1));
-
- return ((abs (pos) * 8) + weekday) * (pos < 0 ? -1 : 1);
-}
-
-static GList *
-next_changed_item (ECalConduitContext *ctxt, GList *changes)
-{
- ECalChange *ccc;
- GList *l;
-
- for (l = changes; l != NULL; l = l->next) {
- const char *uid;
-
- ccc = l->data;
-
- e_cal_component_get_uid (ccc->comp, &uid);
- if (g_hash_table_lookup (ctxt->changed_hash, uid))
- return l;
- }
-
- return NULL;
-}
-
-static void
-compute_status (ECalConduitContext *ctxt, ECalLocalRecord *local, const char *uid)
-{
- ECalChange *ccc;
-
- local->local.archived = FALSE;
- local->local.secret = FALSE;
-
- ccc = g_hash_table_lookup (ctxt->changed_hash, uid);
-
- if (ccc == NULL) {
- local->local.attr = GnomePilotRecordNothing;
- return;
- }
-
- switch (ccc->type) {
- case E_CAL_CHANGE_ADDED:
- local->local.attr = GnomePilotRecordNew;
- break;
-
- case E_CAL_CHANGE_MODIFIED:
- local->local.attr = GnomePilotRecordModified;
- break;
-
- case E_CAL_CHANGE_DELETED:
- local->local.attr = GnomePilotRecordDeleted;
- break;
- }
-}
-
-static gboolean
-rrules_mostly_equal (struct icalrecurrencetype *a, struct icalrecurrencetype *b)
-{
- struct icalrecurrencetype acopy, bcopy;
-
- acopy = *a;
- bcopy = *b;
-
- acopy.until = bcopy.until = icaltime_null_time ();
- acopy.count = bcopy.count = 0;
-
- if (!memcmp (&acopy, &bcopy, sizeof (struct icalrecurrencetype)))
- return TRUE;
-
- return FALSE;
-}
-
-static gboolean
-find_last_cb (ECalComponent *comp, time_t start, time_t end, gpointer data)
-{
- time_t *last = data;
-
- *last = start;
-
- return TRUE;
-}
-
-static GnomePilotRecord
-local_record_to_pilot_record (ECalLocalRecord *local,
- ECalConduitContext *ctxt)
-{
- GnomePilotRecord p;
- static char record[0xffff];
-
- g_assert (local->comp != NULL);
- g_assert (local->appt != NULL );
-
- p.ID = local->local.ID;
- p.category = local->local.category;
- p.attr = local->local.attr;
- p.archived = local->local.archived;
- p.secret = local->local.secret;
-
- /* Generate pilot record structure */
- p.record = record;
- p.length = pack_Appointment (local->appt, p.record, 0xffff);
-
- return p;
-}
-
-/*
- * converts a ECalComponent object to a ECalLocalRecord
- */
-static void
-local_record_from_comp (ECalLocalRecord *local, ECalComponent *comp, ECalConduitContext *ctxt)
-{
- const char *uid;
- ECalComponentText summary;
- GSList *d_list = NULL, *edl = NULL, *l;
- ECalComponentText *description;
- ECalComponentDateTime dt_start, dt_end;
- ECalComponentClassification classif;
- icaltimezone *default_tz = ctxt->timezone;
- int i;
-
- g_return_if_fail (local != NULL);
- g_return_if_fail (comp != NULL);
-
- local->comp = comp;
- g_object_ref (comp);
-
- e_cal_component_get_uid (local->comp, &uid);
- local->local.ID = e_pilot_map_lookup_pid (ctxt->map, uid, TRUE);
- compute_status (ctxt, local, uid);
-
- local->appt = g_new0 (struct Appointment, 1);
-
- /* Handle the fields and category we don't sync by making sure
- * we don't overwrite them
- */
- if (local->local.ID != 0) {
- struct Appointment appt;
- char record[0xffff];
- int cat = 0;
-
- if (dlp_ReadRecordById (ctxt->dbi->pilot_socket,
- ctxt->dbi->db_handle,
- local->local.ID, &record,
- NULL, NULL, NULL, &cat) > 0) {
- local->local.category = cat;
- memset (&appt, 0, sizeof (struct Appointment));
- unpack_Appointment (&appt, record, 0xffff);
- local->appt->alarm = appt.alarm;
- local->appt->advance = appt.advance;
- local->appt->advanceUnits = appt.advanceUnits;
- free_Appointment (&appt);
- }
- }
-
- /* STOP: don't replace these with g_strdup, since free_Appointment
- uses free to deallocate */
- e_cal_component_get_summary (comp, &summary);
- if (summary.value)
- local->appt->description = e_pilot_utf8_to_pchar (summary.value);
-
- e_cal_component_get_description_list (comp, &d_list);
- if (d_list) {
- description = (ECalComponentText *) d_list->data;
- if (description && description->value)
- local->appt->note = e_pilot_utf8_to_pchar (description->value);
- else
- local->appt->note = NULL;
- } else {
- local->appt->note = NULL;
- }
-
- /* Start/End */
- e_cal_component_get_dtstart (comp, &dt_start);
- e_cal_component_get_dtend (comp, &dt_end);
- if (dt_start.value) {
- icaltimezone_convert_time (dt_start.value,
- get_timezone (ctxt->client, dt_start.tzid),
- default_tz);
- local->appt->begin = icaltimetype_to_tm (dt_start.value);
- }
-
- if (dt_start.value && dt_end.value) {
- if (is_all_day (ctxt->client, &dt_start, &dt_end)) {
- local->appt->event = 1;
- } else {
- icaltimezone_convert_time (dt_end.value,
- get_timezone (ctxt->client, dt_end.tzid),
- default_tz);
- local->appt->end = icaltimetype_to_tm (dt_end.value);
- local->appt->event = 0;
- }
- } else {
- local->appt->event = 1;
- }
- e_cal_component_free_datetime (&dt_start);
- e_cal_component_free_datetime (&dt_end);
-
- /* Recurrence Rules */
- local->appt->repeatType = repeatNone;
-
- if (!e_cal_component_is_instance (comp)) {
- if (e_cal_component_has_rrules (comp)) {
- GSList *list;
- struct icalrecurrencetype *recur;
-
- e_cal_component_get_rrule_list (comp, &list);
- recur = list->data;
-
- switch (recur->freq) {
- case ICAL_DAILY_RECURRENCE:
- local->appt->repeatType = repeatDaily;
- break;
- case ICAL_WEEKLY_RECURRENCE:
- local->appt->repeatType = repeatWeekly;
- for (i = 0; i <= 7 && recur->by_day[i] != ICAL_RECURRENCE_ARRAY_MAX; i++) {
- icalrecurrencetype_weekday wd;
-
- wd = icalrecurrencetype_day_day_of_week (recur->by_day[i]);
- local->appt->repeatDays[get_pilot_day (wd)] = 1;
- }
-
- break;
- case ICAL_MONTHLY_RECURRENCE:
- if (recur->by_month_day[0] != ICAL_RECURRENCE_ARRAY_MAX) {
- local->appt->repeatType = repeatMonthlyByDate;
- break;
- }
-
- /* FIX ME Not going to work with -ve by_day */
- local->appt->repeatType = repeatMonthlyByDay;
- switch (icalrecurrencetype_day_position (recur->by_day[0])) {
- case 1:
- local->appt->repeatDay = dom1stSun;
- break;
- case 2:
- local->appt->repeatDay = dom2ndSun;
- break;
- case 3:
- local->appt->repeatDay = dom3rdSun;
- break;
- case 4:
- local->appt->repeatDay = dom4thSun;
- break;
- case 5:
- local->appt->repeatDay = domLastSun;
- break;
- }
- local->appt->repeatDay += get_pilot_day (icalrecurrencetype_day_day_of_week (recur->by_day[0]));
- break;
- case ICAL_YEARLY_RECURRENCE:
- local->appt->repeatType = repeatYearly;
- break;
- default:
- break;
- }
-
- if (local->appt->repeatType != repeatNone) {
- local->appt->repeatFrequency = recur->interval;
- }
-
- if (!icaltime_is_null_time (recur->until)) {
- local->appt->repeatForever = 0;
- local->appt->repeatEnd = icaltimetype_to_tm_with_zone (&recur->until,
- icaltimezone_get_utc_timezone (),
- default_tz);
- } else if (recur->count > 0) {
- time_t last = -1;
- struct icaltimetype itt;
-
- /* The palm does not support count recurrences */
- local->appt->repeatForever = 0;
- e_cal_recur_generate_instances (comp, -1, -1, find_last_cb, &last,
- e_cal_resolve_tzid_cb, ctxt->client,
- default_tz);
- itt = icaltime_from_timet_with_zone (last, TRUE, default_tz);
- local->appt->repeatEnd = icaltimetype_to_tm (&itt);
- } else {
- local->appt->repeatForever = 1;
- }
-
- e_cal_component_free_recur_list (list);
- }
-
- /* Exceptions */
- e_cal_component_get_exdate_list (comp, &edl);
- local->appt->exceptions = g_slist_length (edl);
- local->appt->exception = g_new0 (struct tm, local->appt->exceptions);
- for (l = edl, i = 0; l != NULL; l = l->next, i++) {
- ECalComponentDateTime *dt = l->data;
-
- icaltimezone_convert_time (dt->value,
- icaltimezone_get_utc_timezone (),
- default_tz);
- *local->appt->exception = icaltimetype_to_tm (dt->value);
- }
- e_cal_component_free_exdate_list (edl);
- }
-
- /* Alarm */
- local->appt->alarm = 0;
- if (e_cal_component_has_alarms (comp)) {
- GList *uids, *l;
- ECalComponentAlarm *alarm;
- ECalComponentAlarmTrigger trigger;
-
- uids = e_cal_component_get_alarm_uids (comp);
- for (l = uids; l != NULL; l = l->next) {
- alarm = e_cal_component_get_alarm (comp, l->data);
- e_cal_component_alarm_get_trigger (alarm, &trigger);
-
- if ((trigger.type == E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START
- && trigger.u.rel_duration.is_neg)) {
- local->appt->advanceUnits = advMinutes;
- local->appt->advance =
- trigger.u.rel_duration.minutes
- + trigger.u.rel_duration.hours * 60
- + trigger.u.rel_duration.days * 60 * 24
- + trigger.u.rel_duration.weeks * 7 * 60 * 24;
-
- if (local->appt->advance > PILOT_MAX_ADVANCE) {
- local->appt->advanceUnits = advHours;
- local->appt->advance =
- trigger.u.rel_duration.minutes / 60
- + trigger.u.rel_duration.hours
- + trigger.u.rel_duration.days * 24
- + trigger.u.rel_duration.weeks * 7 * 24;
- }
- if (local->appt->advance > PILOT_MAX_ADVANCE) {
- local->appt->advanceUnits = advDays;
- local->appt->advance =
- trigger.u.rel_duration.minutes / (60 * 24)
- + trigger.u.rel_duration.hours / 24
- + trigger.u.rel_duration.days
- + trigger.u.rel_duration.weeks * 7;
- }
- if (local->appt->advance > PILOT_MAX_ADVANCE)
- local->appt->advance = PILOT_MAX_ADVANCE;
-
- local->appt->alarm = 1;
- break;
- }
- e_cal_component_alarm_free (alarm);
- }
- cal_obj_uid_list_free (uids);
- }
-
- e_cal_component_get_classification (comp, &classif);
-
- if (classif == E_CAL_COMPONENT_CLASS_PRIVATE)
- local->local.secret = 1;
- else
- local->local.secret = 0;
-
- local->local.archived = 0;
-}
-
-static void
-local_record_from_uid (ECalLocalRecord *local,
- const char *uid,
- ECalConduitContext *ctxt)
-{
- ECalComponent *comp;
- icalcomponent *icalcomp;
- GError *error = NULL;
-
- g_assert(local!=NULL);
-
- if (e_cal_get_object (ctxt->client, uid, NULL, &icalcomp, &error)) {
- comp = e_cal_component_new ();
- if (!e_cal_component_set_icalcomponent (comp, icalcomp)) {
- g_object_unref (comp);
- icalcomponent_free (icalcomp);
- return;
- }
-
- local_record_from_comp (local, comp, ctxt);
- g_object_unref (comp);
- } else if (error->code == E_CALENDAR_STATUS_OBJECT_NOT_FOUND) {
- comp = e_cal_component_new ();
- e_cal_component_set_new_vtype (comp, E_CAL_COMPONENT_EVENT);
- e_cal_component_set_uid (comp, uid);
- local_record_from_comp (local, comp, ctxt);
- g_object_unref (comp);
- } else {
- INFO ("Object did not exist");
- }
-
- g_clear_error (&error);
-}
-
-static ECalComponent *
-comp_from_remote_record (GnomePilotConduitSyncAbs *conduit,
- GnomePilotRecord *remote,
- ECalComponent *in_comp,
- ECal *client,
- icaltimezone *timezone)
-{
- ECalComponent *comp;
- struct Appointment appt;
- struct icaltimetype now = icaltime_from_timet_with_zone (time (NULL), FALSE, timezone), it;
- struct icalrecurrencetype recur;
- ECalComponentText summary = {NULL, NULL};
- ECalComponentDateTime dt = {NULL, NULL};
- GSList *edl = NULL;
- char *txt;
- int pos, i;
-
- g_return_val_if_fail (remote != NULL, NULL);
-
- memset (&appt, 0, sizeof (struct Appointment));
- unpack_Appointment (&appt, remote->record, remote->length);
-
- if (in_comp == NULL) {
- comp = e_cal_component_new ();
- e_cal_component_set_new_vtype (comp, E_CAL_COMPONENT_EVENT);
- e_cal_component_set_created (comp, &now);
- } else {
- comp = e_cal_component_clone (in_comp);
- }
-
- e_cal_component_set_last_modified (comp, &now);
-
- summary.value = txt = e_pilot_utf8_from_pchar (appt.description);
- e_cal_component_set_summary (comp, &summary);
- free (txt);
-
- /* The iCal description field */
- if (!appt.note) {
- e_cal_component_set_description_list (comp, NULL);
- } else {
- GSList l;
- ECalComponentText text;
-
- text.value = txt = e_pilot_utf8_from_pchar (appt.note);
- text.altrep = NULL;
- l.data = &text;
- l.next = NULL;
-
- e_cal_component_set_description_list (comp, &l);
- free (txt);
- }
-
- if (appt.event && !is_empty_time (appt.begin)) {
- it = tm_to_icaltimetype (&appt.begin, TRUE);
- dt.value = &it;
- dt.tzid = NULL;
- e_cal_component_set_dtstart (comp, &dt);
- e_cal_component_set_dtend (comp, &dt);
- } else {
- dt.tzid = icaltimezone_get_tzid (timezone);
-
- if (!is_empty_time (appt.begin)) {
- it = tm_to_icaltimetype (&appt.begin, FALSE);
- dt.value = &it;
- e_cal_component_set_dtstart (comp, &dt);
- }
-
- if (!is_empty_time (appt.end)) {
- it = tm_to_icaltimetype (&appt.end, FALSE);
- dt.value = &it;
- e_cal_component_set_dtend (comp, &dt);
- }
- }
-
- /* Recurrence information */
- icalrecurrencetype_clear (&recur);
-
- switch (appt.repeatType) {
- case repeatNone:
- recur.freq = ICAL_NO_RECURRENCE;
- break;
-
- case repeatDaily:
- recur.freq = ICAL_DAILY_RECURRENCE;
- recur.interval = appt.repeatFrequency;
- break;
-
- case repeatWeekly:
- recur.freq = ICAL_WEEKLY_RECURRENCE;
- recur.interval = appt.repeatFrequency;
-
- pos = 0;
- for (i = 0; i < 7; i++) {
- if (appt.repeatDays[i])
- recur.by_day[pos++] = get_ical_day (i);
- }
-
- break;
-
- case repeatMonthlyByDay:
- recur.freq = ICAL_MONTHLY_RECURRENCE;
- recur.interval = appt.repeatFrequency;
- if (appt.repeatDay < domLastSun)
- recur.by_day[0] = nth_weekday ((appt.repeatDay / 7) + 1,
- get_ical_day (appt.repeatDay % 7));
- else
- recur.by_day[0] = nth_weekday (-1, get_ical_day (appt.repeatDay % 7));
- break;
-
- case repeatMonthlyByDate:
- recur.freq = ICAL_MONTHLY_RECURRENCE;
- recur.interval = appt.repeatFrequency;
- recur.by_month_day[0] = appt.begin.tm_mday;
- break;
-
- case repeatYearly:
- recur.freq = ICAL_YEARLY_RECURRENCE;
- recur.interval = appt.repeatFrequency;
- break;
-
- default:
- g_assert_not_reached ();
- }
-
- if (recur.freq != ICAL_NO_RECURRENCE) {
- GSList *list = NULL, *existing;
- struct icalrecurrencetype *erecur;
-
- /* recurrence start of week */
- recur.week_start = get_ical_day (appt.repeatWeekstart);
-
- if (!appt.repeatForever) {
- recur.until = tm_to_icaltimetype (&appt.repeatEnd, TRUE);
- }
-
- list = g_slist_append (list, &recur);
- e_cal_component_set_rrule_list (comp, list);
-
- /* If the desktop uses count and rrules are
- * equivalent, use count still on the desktop */
- if (!appt.repeatForever && e_cal_component_has_rrules (in_comp)) {
- e_cal_component_get_rrule_list (in_comp, &existing);
- erecur = existing->data;
-
- /* If the rules are otherwise the same and the existing uses count,
- see if they end at the same point */
- if (rrules_mostly_equal (&recur, erecur) &&
- icaltime_is_null_time (erecur->until) && erecur->count > 0) {
- time_t last, elast;
-
- e_cal_recur_generate_instances (comp, -1, -1, find_last_cb, &last,
- e_cal_resolve_tzid_cb, client,
- timezone);
- e_cal_recur_generate_instances (in_comp, -1, -1, find_last_cb, &elast,
- e_cal_resolve_tzid_cb, client,
- timezone);
-
-
- if (last == elast) {
- recur.until = icaltime_null_time ();
- recur.count = erecur->count;
- e_cal_component_set_rrule_list (comp, list);
- }
- }
- }
-
- g_slist_free (list);
- } else {
- e_cal_component_set_rrule_list (comp, NULL);
- }
-
- /* Exceptions */
- for (i = 0; i < appt.exceptions; i++) {
- struct tm ex;
- ECalComponentDateTime *dt = g_new0 (ECalComponentDateTime, 1);
-
- dt->value = g_new0 (struct icaltimetype, 1);
- dt->tzid = NULL;
-
- ex = appt.exception[i];
- *dt->value = tm_to_icaltimetype (&ex, TRUE);
-
- edl = g_slist_prepend (edl, dt);
- }
- e_cal_component_set_exdate_list (comp, edl);
- e_cal_component_free_exdate_list (edl);
-
- /* Alarm */
- if (appt.alarm) {
- ECalComponentAlarm *alarm = NULL;
- ECalComponentAlarmTrigger trigger;
- gboolean found = FALSE;
-
- if (e_cal_component_has_alarms (comp)) {
- GList *uids, *l;
-
- uids = e_cal_component_get_alarm_uids (comp);
- for (l = uids; l != NULL; l = l->next) {
- alarm = e_cal_component_get_alarm (comp, l->data);
- e_cal_component_alarm_get_trigger (alarm, &trigger);
- if ((trigger.type == E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START
- && trigger.u.rel_duration.is_neg)) {
- found = TRUE;
- break;
- }
- e_cal_component_alarm_free (alarm);
- }
- cal_obj_uid_list_free (uids);
- }
- if (!found)
- alarm = e_cal_component_alarm_new ();
-
- memset (&trigger, 0, sizeof (ECalComponentAlarmTrigger));
- trigger.type = E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START;
- trigger.u.rel_duration.is_neg = 1;
- switch (appt.advanceUnits) {
- case advMinutes:
- trigger.u.rel_duration.minutes = appt.advance;
- break;
- case advHours:
- trigger.u.rel_duration.hours = appt.advance;
- break;
- case advDays:
- trigger.u.rel_duration.days = appt.advance;
- break;
- }
- e_cal_component_alarm_set_trigger (alarm, trigger);
- e_cal_component_alarm_set_action (alarm, E_CAL_COMPONENT_ALARM_DISPLAY);
-
- if (!found)
- e_cal_component_add_alarm (comp, alarm);
- e_cal_component_alarm_free (alarm);
- }
-
- e_cal_component_set_transparency (comp, E_CAL_COMPONENT_TRANSP_NONE);
-
- if (remote->secret)
- e_cal_component_set_classification (comp, E_CAL_COMPONENT_CLASS_PRIVATE);
- else
- e_cal_component_set_classification (comp, E_CAL_COMPONENT_CLASS_PUBLIC);
-
- e_cal_component_commit_sequence (comp);
-
- free_Appointment (&appt);
-
- return comp;
-}
-
-static void
-check_for_slow_setting (GnomePilotConduit *c, ECalConduitContext *ctxt)
-{
- GnomePilotConduitStandard *conduit = GNOME_PILOT_CONDUIT_STANDARD (c);
- int map_count;
- const char *uri;
-
- /* If there are objects but no log */
- map_count = g_hash_table_size (ctxt->map->pid_map);
- if (map_count == 0)
- gnome_pilot_conduit_standard_set_slow (conduit, TRUE);
-
- /* Or if the URI's don't match */
- uri = e_cal_get_uri (ctxt->client);
- LOG (g_message ( " Current URI %s (%s)\n", uri, ctxt->cfg->last_uri ? ctxt->cfg->last_uri : "<NONE>" ));
- if (ctxt->cfg->last_uri != NULL && strcmp (ctxt->cfg->last_uri, uri)) {
- gnome_pilot_conduit_standard_set_slow (conduit, TRUE);
- e_pilot_map_clear (ctxt->map);
- }
-
- if (gnome_pilot_conduit_standard_get_slow (conduit)) {
- ctxt->map->write_touched_only = TRUE;
- LOG (g_message ( " doing slow sync\n" ));
- } else {
- LOG (g_message ( " doing fast sync\n" ));
- }
-}
-
-/* Pilot syncing callbacks */
-static gint
-pre_sync (GnomePilotConduit *conduit,
- GnomePilotDBInfo *dbi,
- ECalConduitContext *ctxt)
-{
- GnomePilotConduitSyncAbs *abs_conduit;
- GList *removed = NULL, *added = NULL, *l;
- int len;
- unsigned char *buf;
- char *filename, *change_id;
- icalcomponent *icalcomp;
- gint num_records, add_records = 0, mod_records = 0, del_records = 0;
-
- abs_conduit = GNOME_PILOT_CONDUIT_SYNC_ABS (conduit);
-
- LOG (g_message ( "---------------------------------------------------------\n" ));
- LOG (g_message ( "pre_sync: Calendar Conduit v.%s", CONDUIT_VERSION ));
-
- ctxt->dbi = dbi;
- ctxt->client = NULL;
-
- if (start_calendar_server (ctxt) != 0) {
- WARN(_("Could not start wombat server"));
- gnome_pilot_conduit_error (conduit, _("Could not start wombat"));
- return -1;
- }
-
- /* Get the timezone */
- ctxt->timezone = get_default_timezone ();
- if (ctxt->timezone == NULL)
- return -1;
- LOG (g_message ( " Using timezone: %s", icaltimezone_get_tzid (ctxt->timezone) ));
-
- /* Set the default timezone on the backend. */
- if (ctxt->timezone) {
- if (!e_cal_set_default_timezone (ctxt->client, ctxt->timezone, NULL))
- return -1;
- }
-
- /* Get the default component */
- if (!e_cal_get_default_object (ctxt->client, &icalcomp, NULL))
- return -1;
-
- ctxt->default_comp = e_cal_component_new ();
- if (!e_cal_component_set_icalcomponent (ctxt->default_comp, icalcomp)) {
- g_object_unref (ctxt->default_comp);
- icalcomponent_free (icalcomp);
- return -1;
- }
-
- ctxt->default_comp = e_cal_component_new ();
- if (!e_cal_component_set_icalcomponent (ctxt->default_comp, icalcomp)) {
- g_object_unref (ctxt->default_comp);
- icalcomponent_free (icalcomp);
- return -1;
- }
-
- /* Load the uid <--> pilot id mapping */
- filename = map_name (ctxt);
- e_pilot_map_read (filename, &ctxt->map);
- g_free (filename);
-
- /* Get the local database */
- if (!e_cal_get_object_list_as_comp (ctxt->client, "(#t)", &ctxt->comps, NULL))
- return -1;
-
- /* Find the added, modified and deleted items */
- change_id = g_strdup_printf ("pilot-sync-evolution-calendar-%d", ctxt->cfg->pilot_id);
- if (!e_cal_get_changes (ctxt->client, change_id, &ctxt->changed, NULL))
- return -1;
- ctxt->changed_hash = g_hash_table_new (g_str_hash, g_str_equal);
- g_free (change_id);
-
- /* See if we need to split up any events */
- for (l = ctxt->changed; l != NULL; l = l->next) {
- ECalChange *ccc = l->data;
- GList *multi_comp = NULL, *multi_ccc = NULL;
-
- if (process_multi_day (ctxt, ccc, &multi_comp, &multi_ccc)) {
- ctxt->comps = g_list_concat (ctxt->comps, multi_comp);
-
- added = g_list_concat (added, multi_ccc);
- removed = g_list_prepend (removed, ccc);
- }
- }
-
- /* Remove the events that were split up */
- g_list_concat (ctxt->changed, added);
- for (l = removed; l != NULL; l = l->next) {
- ECalChange *ccc = l->data;
- const char *uid;
-
- e_cal_component_get_uid (ccc->comp, &uid);
- if (e_pilot_map_lookup_pid (ctxt->map, uid, FALSE) == 0) {
- ctxt->changed = g_list_remove (ctxt->changed, ccc);
- g_object_unref (ccc->comp);
- g_free (ccc);
- }
- }
- g_list_free (removed);
-
- for (l = ctxt->changed; l != NULL; l = l->next) {
- ECalChange *ccc = l->data;
- const char *uid;
-
- e_cal_component_get_uid (ccc->comp, &uid);
- if (!e_pilot_map_uid_is_archived (ctxt->map, uid)) {
-
- g_hash_table_insert (ctxt->changed_hash, g_strdup (uid), ccc);
-
- switch (ccc->type) {
- case E_CAL_CHANGE_ADDED:
- add_records++;
- break;
- case E_CAL_CHANGE_MODIFIED:
- mod_records++;
- break;
- case E_CAL_CHANGE_DELETED:
- del_records++;
- break;
- }
- } else if (ccc->type == E_CAL_CHANGE_DELETED) {
- e_pilot_map_remove_by_uid (ctxt->map, uid);
- }
- }
-
- /* Set the count information */
- num_records = g_list_length (ctxt->comps);
- gnome_pilot_conduit_sync_abs_set_num_local_records(abs_conduit, num_records);
- gnome_pilot_conduit_sync_abs_set_num_new_local_records (abs_conduit, add_records);
- gnome_pilot_conduit_sync_abs_set_num_updated_local_records (abs_conduit, mod_records);
- gnome_pilot_conduit_sync_abs_set_num_deleted_local_records(abs_conduit, del_records);
-
- buf = (unsigned char*)g_malloc (0xffff);
- len = dlp_ReadAppBlock (dbi->pilot_socket, dbi->db_handle, 0,
- (unsigned char *)buf, 0xffff);
-
- if (len < 0) {
- WARN (_("Could not read pilot's Calendar application block"));
- WARN ("dlp_ReadAppBlock(...) = %d", len);
- gnome_pilot_conduit_error (conduit,
- _("Could not read pilot's Calendar application block"));
- return -1;
- }
- unpack_AppointmentAppInfo (&(ctxt->ai), buf, len);
- g_free (buf);
-
- check_for_slow_setting (conduit, ctxt);
- if (ctxt->cfg->sync_type == GnomePilotConduitSyncTypeCopyToPilot
- || ctxt->cfg->sync_type == GnomePilotConduitSyncTypeCopyFromPilot)
- ctxt->map->write_touched_only = TRUE;
-
- return 0;
-}
-
-static gint
-post_sync (GnomePilotConduit *conduit,
- GnomePilotDBInfo *dbi,
- ECalConduitContext *ctxt)
-{
- GList *changed;
- gchar *filename, *change_id;
-
- LOG (g_message ( "post_sync: Calendar Conduit v.%s", CONDUIT_VERSION ));
-
- g_free (ctxt->cfg->last_uri);
- ctxt->cfg->last_uri = g_strdup (e_cal_get_uri (ctxt->client));
- calconduit_save_configuration (ctxt->cfg);
-
- filename = map_name (ctxt);
- e_pilot_map_write (filename, ctxt->map);
- g_free (filename);
-
- /* FIX ME ugly hack - our changes musn't count, this does introduce
- * a race condition if anyone changes a record elsewhere during sycnc
- */
- change_id = g_strdup_printf ("pilot-sync-evolution-calendar-%d", ctxt->cfg->pilot_id);
- if (e_cal_get_changes (ctxt->client, change_id, &changed, NULL))
- e_cal_free_change_list (changed);
- g_free (change_id);
-
- LOG (g_message ( "---------------------------------------------------------\n" ));
-
- return 0;
-}
-
-static gint
-set_pilot_id (GnomePilotConduitSyncAbs *conduit,
- ECalLocalRecord *local,
- guint32 ID,
- ECalConduitContext *ctxt)
-{
- const char *uid;
-
- LOG (g_message ( "set_pilot_id: setting to %d\n", ID ));
-
- e_cal_component_get_uid (local->comp, &uid);
- e_pilot_map_insert (ctxt->map, ID, uid, FALSE);
-
- return 0;
-}
-
-static gint
-set_status_cleared (GnomePilotConduitSyncAbs *conduit,
- ECalLocalRecord *local,
- ECalConduitContext *ctxt)
-{
- const char *uid;
-
- LOG (g_message ( "set_status_cleared: clearing status\n" ));
-
- e_cal_component_get_uid (local->comp, &uid);
- g_hash_table_remove (ctxt->changed_hash, uid);
-
- return 0;
-}
-
-static gint
-for_each (GnomePilotConduitSyncAbs *conduit,
- ECalLocalRecord **local,
- ECalConduitContext *ctxt)
-{
- static GList *comps, *iterator;
- static int count;
-
- g_return_val_if_fail (local != NULL, -1);
-
- if (*local == NULL) {
- LOG (g_message ( "beginning for_each" ));
-
- comps = ctxt->comps;
- count = 0;
-
- if (comps != NULL) {
- LOG (g_message ( "iterating over %d records", g_list_length (comps)));
-
- *local = g_new0 (ECalLocalRecord, 1);
- local_record_from_comp (*local, comps->data, ctxt);
- g_list_prepend (ctxt->locals, *local);
-
- iterator = comps;
- } else {
- LOG (g_message ( "no events" ));
- (*local) = NULL;
- return 0;
- }
- } else {
- count++;
- if (g_list_next (iterator)) {
- iterator = g_list_next (iterator);
-
- *local = g_new0 (ECalLocalRecord, 1);
- local_record_from_uid (*local, iterator->data, ctxt);
- g_list_prepend (ctxt->locals, *local);
- } else {
- LOG (g_message ( "for_each ending" ));
-
- /* Tell the pilot the iteration is over */
- *local = NULL;
-
- return 0;
- }
- }
-
- return 0;
-}
-
-static gint
-for_each_modified (GnomePilotConduitSyncAbs *conduit,
- ECalLocalRecord **local,
- ECalConduitContext *ctxt)
-{
- static GList *iterator;
- static int count;
-
- g_return_val_if_fail (local != NULL, -1);
-
- if (*local == NULL) {
- LOG (g_message ( "for_each_modified beginning\n" ));
-
- iterator = ctxt->changed;
-
- count = 0;
-
- LOG (g_message ( "iterating over %d records", g_hash_table_size (ctxt->changed_hash) ));
-
- iterator = next_changed_item (ctxt, iterator);
- if (iterator != NULL) {
- ECalChange *ccc = iterator->data;
-
- *local = g_new0 (ECalLocalRecord, 1);
- local_record_from_comp (*local, ccc->comp, ctxt);
- g_list_prepend (ctxt->locals, *local);
- } else {
- LOG (g_message ( "no events" ));
-
- *local = NULL;
- }
- } else {
- count++;
- iterator = g_list_next (iterator);
- if (iterator && (iterator = next_changed_item (ctxt, iterator))) {
- ECalChange *ccc = iterator->data;
-
- *local = g_new0 (ECalLocalRecord, 1);
- local_record_from_comp (*local, ccc->comp, ctxt);
- g_list_prepend (ctxt->locals, *local);
- } else {
- LOG (g_message ( "for_each_modified ending" ));
-
- /* Signal the iteration is over */
- *local = NULL;
- }
- }
-
- return 0;
-}
-
-static gint
-compare (GnomePilotConduitSyncAbs *conduit,
- ECalLocalRecord *local,
- GnomePilotRecord *remote,
- ECalConduitContext *ctxt)
-{
- /* used by the quick compare */
- GnomePilotRecord local_pilot;
- int retval = 0;
-
- LOG (g_message ("compare: local=%s remote=%s...\n",
- print_local (local), print_remote (remote)));
-
- g_return_val_if_fail (local!=NULL,-1);
- g_return_val_if_fail (remote!=NULL,-1);
-
- local_pilot = local_record_to_pilot_record (local, ctxt);
-
- if (remote->length != local_pilot.length
- || memcmp (local_pilot.record, remote->record, remote->length))
- retval = 1;
-
- if (retval == 0)
- LOG (g_message ( " equal" ));
- else
- LOG (g_message ( " not equal" ));
-
- return retval;
-}
-
-static gint
-add_record (GnomePilotConduitSyncAbs *conduit,
- GnomePilotRecord *remote,
- ECalConduitContext *ctxt)
-{
- ECalComponent *comp;
- char *uid;
- int retval = 0;
-
- g_return_val_if_fail (remote != NULL, -1);
-
- LOG (g_message ( "add_record: adding %s to desktop\n", print_remote (remote) ));
-
- comp = comp_from_remote_record (conduit, remote, ctxt->default_comp, ctxt->client, ctxt->timezone);
-
- /* Give it a new UID otherwise it will be the uid of the default comp */
- uid = e_cal_component_gen_uid ();
- e_cal_component_set_uid (comp, uid);
-
- if (!e_cal_create_object (ctxt->client, e_cal_component_get_icalcomponent (comp), NULL, NULL))
- return -1;
-
- e_pilot_map_insert (ctxt->map, remote->ID, uid, FALSE);
-
- g_free (uid);
-
- g_object_unref (comp);
-
- return retval;
-}
-
-static gint
-replace_record (GnomePilotConduitSyncAbs *conduit,
- ECalLocalRecord *local,
- GnomePilotRecord *remote,
- ECalConduitContext *ctxt)
-{
- ECalComponent *new_comp;
- int retval = 0;
-
- g_return_val_if_fail (remote != NULL, -1);
-
- LOG (g_message ("replace_record: replace %s with %s\n",
- print_local (local), print_remote (remote)));
-
- new_comp = comp_from_remote_record (conduit, remote, local->comp, ctxt->client, ctxt->timezone);
- g_object_unref (local->comp);
- local->comp = new_comp;
-
- if (!e_cal_modify_object (ctxt->client, e_cal_component_get_icalcomponent (new_comp),
- CALOBJ_MOD_ALL, NULL))
- return -1;
-
- return retval;
-}
-
-static gint
-delete_record (GnomePilotConduitSyncAbs *conduit,
- ECalLocalRecord *local,
- ECalConduitContext *ctxt)
-{
- const char *uid;
-
- g_return_val_if_fail (local != NULL, -1);
- g_assert (local->comp != NULL);
-
- e_cal_component_get_uid (local->comp, &uid);
-
- LOG (g_message ( "delete_record: deleting %s\n", uid ));
-
- e_pilot_map_remove_by_uid (ctxt->map, uid);
- /* FIXME Error handling */
- e_cal_remove_object (ctxt->client, uid, NULL);
-
- return 0;
-}
-
-static gint
-archive_record (GnomePilotConduitSyncAbs *conduit,
- ECalLocalRecord *local,
- gboolean archive,
- ECalConduitContext *ctxt)
-{
- const char *uid;
- int retval = 0;
-
- g_return_val_if_fail (local != NULL, -1);
-
- LOG (g_message ( "archive_record: %s\n", archive ? "yes" : "no" ));
-
- e_cal_component_get_uid (local->comp, &uid);
- e_pilot_map_insert (ctxt->map, local->local.ID, uid, archive);
-
- return retval;
-}
-
-static gint
-match (GnomePilotConduitSyncAbs *conduit,
- GnomePilotRecord *remote,
- ECalLocalRecord **local,
- ECalConduitContext *ctxt)
-{
- const char *uid;
-
- LOG (g_message ("match: looking for local copy of %s\n",
- print_remote (remote)));
-
- g_return_val_if_fail (local != NULL, -1);
- g_return_val_if_fail (remote != NULL, -1);
-
- *local = NULL;
- uid = e_pilot_map_lookup_uid (ctxt->map, remote->ID, TRUE);
-
- if (!uid)
- return 0;
-
- LOG (g_message ( " matched\n" ));
-
- *local = g_new0 (ECalLocalRecord, 1);
- local_record_from_uid (*local, uid, ctxt);
-
- return 0;
-}
-
-static gint
-free_match (GnomePilotConduitSyncAbs *conduit,
- ECalLocalRecord *local,
- ECalConduitContext *ctxt)
-{
- LOG (g_message ( "free_match: freeing\n" ));
-
- g_return_val_if_fail (local != NULL, -1);
-
- calconduit_destroy_record (local);
-
- return 0;
-}
-
-static gint
-prepare (GnomePilotConduitSyncAbs *conduit,
- ECalLocalRecord *local,
- GnomePilotRecord *remote,
- ECalConduitContext *ctxt)
-{
- LOG (g_message ( "prepare: encoding local %s\n", print_local (local) ));
-
- *remote = local_record_to_pilot_record (local, ctxt);
-
- return 0;
-}
-
-/* Pilot Settings Callbacks */
-static void
-fill_widgets (ECalConduitContext *ctxt)
-{
- e_pilot_settings_set_secret (E_PILOT_SETTINGS (ctxt->ps),
- ctxt->cfg->secret);
-
- e_cal_gui_fill_widgets (ctxt->gui, ctxt->cfg);
-}
-
-static gint
-create_settings_window (GnomePilotConduit *conduit,
- GtkWidget *parent,
- ECalConduitContext *ctxt)
-{
- LOG (g_message ( "create_settings_window" ));
-
- ctxt->ps = e_pilot_settings_new ();
- ctxt->gui = e_cal_gui_new (E_PILOT_SETTINGS (ctxt->ps));
-
- gtk_container_add (GTK_CONTAINER (parent), ctxt->ps);
- gtk_widget_show (ctxt->ps);
-
- fill_widgets (ctxt);
-
- return 0;
-}
-static void
-display_settings (GnomePilotConduit *conduit, ECalConduitContext *ctxt)
-{
- LOG (g_message ( "display_settings" ));
-
- fill_widgets (ctxt);
-}
-
-static void
-save_settings (GnomePilotConduit *conduit, ECalConduitContext *ctxt)
-{
- LOG (g_message ( "save_settings" ));
-
- ctxt->new_cfg->secret =
- e_pilot_settings_get_secret (E_PILOT_SETTINGS (ctxt->ps));
- e_cal_gui_fill_config (ctxt->gui, ctxt->new_cfg);
-
- calconduit_save_configuration (ctxt->new_cfg);
-}
-
-static void
-revert_settings (GnomePilotConduit *conduit, ECalConduitContext *ctxt)
-{
- LOG (g_message ( "revert_settings" ));
-
- calconduit_save_configuration (ctxt->cfg);
- calconduit_destroy_configuration (ctxt->new_cfg);
- ctxt->new_cfg = calconduit_dupe_configuration (ctxt->cfg);
-}
-
-GnomePilotConduit *
-conduit_get_gpilot_conduit (guint32 pilot_id)
-{
- GtkObject *retval;
- ECalConduitContext *ctxt;
-
- LOG (g_message ( "in calendar's conduit_get_gpilot_conduit\n" ));
-
- retval = gnome_pilot_conduit_sync_abs_new ("DatebookDB", 0x64617465);
- g_assert (retval != NULL);
-
- ctxt = e_calendar_context_new (pilot_id);
- gtk_object_set_data (GTK_OBJECT (retval), "calconduit_context", ctxt);
-
- /* Sync signals */
- gtk_signal_connect (retval, "pre_sync", (GtkSignalFunc) pre_sync, ctxt);
- gtk_signal_connect (retval, "post_sync", (GtkSignalFunc) post_sync, ctxt);
-
- gtk_signal_connect (retval, "set_pilot_id", (GtkSignalFunc) set_pilot_id, ctxt);
- gtk_signal_connect (retval, "set_status_cleared", (GtkSignalFunc) set_status_cleared, ctxt);
-
- gtk_signal_connect (retval, "for_each", (GtkSignalFunc) for_each, ctxt);
- gtk_signal_connect (retval, "for_each_modified", (GtkSignalFunc) for_each_modified, ctxt);
- gtk_signal_connect (retval, "compare", (GtkSignalFunc) compare, ctxt);
-
- gtk_signal_connect (retval, "add_record", (GtkSignalFunc) add_record, ctxt);
- gtk_signal_connect (retval, "replace_record", (GtkSignalFunc) replace_record, ctxt);
- gtk_signal_connect (retval, "delete_record", (GtkSignalFunc) delete_record, ctxt);
- gtk_signal_connect (retval, "archive_record", (GtkSignalFunc) archive_record, ctxt);
-
- gtk_signal_connect (retval, "match", (GtkSignalFunc) match, ctxt);
- gtk_signal_connect (retval, "free_match", (GtkSignalFunc) free_match, ctxt);
-
- gtk_signal_connect (retval, "prepare", (GtkSignalFunc) prepare, ctxt);
-
- /* Gui Settings */
- gtk_signal_connect (retval, "create_settings_window", (GtkSignalFunc) create_settings_window, ctxt);
- gtk_signal_connect (retval, "display_settings", (GtkSignalFunc) display_settings, ctxt);
- gtk_signal_connect (retval, "save_settings", (GtkSignalFunc) save_settings, ctxt);
- gtk_signal_connect (retval, "revert_settings", (GtkSignalFunc) revert_settings, ctxt);
-
- return GNOME_PILOT_CONDUIT (retval);
-}
-
-void
-conduit_destroy_gpilot_conduit (GnomePilotConduit *conduit)
-{
- GtkObject *obj = GTK_OBJECT (conduit);
- ECalConduitContext *ctxt;
-
- ctxt = gtk_object_get_data (obj, "calconduit_context");
- e_calendar_context_destroy (ctxt);
-
- gtk_object_destroy (obj);
-}
diff --git a/calendar/conduits/calendar/e-calendar.conduit.in b/calendar/conduits/calendar/e-calendar.conduit.in
deleted file mode 100644
index 6ddcf5761a..0000000000
--- a/calendar/conduits/calendar/e-calendar.conduit.in
+++ /dev/null
@@ -1,9 +0,0 @@
-<gnome-pilot-conduit version="1.0">
- <conduit id="e_calendar_conduit" type="shlib" location="@privconduitdir@/libecalendar_conduit.so"/>
- <name value="ECalendar"/>
- <conduit-attribute name="description" value="Synchronizes Calendar with Evolution @BASE_VERSION@"/>
- <conduit-attribute name="default-synctype" value="synchronize"/>
- <conduit-attribute name="valid-synctypes" value="synchronize copy_from_pilot copy_to_pilot"/>
- <conduit-attribute name="settings" value="TRUE"/>
- <conduit-attribute name="icon" value="@datadir@/images/evolution/conduits/48_evo-calendar-conduit.png"/>
-</gnome-pilot-conduit>
diff --git a/calendar/conduits/todo/.cvsignore b/calendar/conduits/todo/.cvsignore
deleted file mode 100644
index 3ee063c770..0000000000
--- a/calendar/conduits/todo/.cvsignore
+++ /dev/null
@@ -1,9 +0,0 @@
-Makefile.in
-Makefile
-.deps
-.libs
-*.lo
-*.la
-e-todo-conduit-control-applet
-e-todo-conduit-control-applet.desktop
-e-todo.conduit
diff --git a/calendar/conduits/todo/Makefile.am b/calendar/conduits/todo/Makefile.am
deleted file mode 100644
index 15e7a81f84..0000000000
--- a/calendar/conduits/todo/Makefile.am
+++ /dev/null
@@ -1,34 +0,0 @@
-INCLUDES = \
- -I$(top_srcdir)/e-util \
- -I$(top_builddir)/e-util \
- $(EVOLUTION_CALENDAR_CONDUIT_CFLAGS)
-
-# ToDo Conduit
-privconduit_LTLIBRARIES = libetodo_conduit.la
-
-libetodo_conduit_la_SOURCES = \
- todo-conduit.c
-
-libetodo_conduit_la_LDFLAGS = -module -avoid-version
-libetodo_conduit_la_LIBADD = \
- $(top_builddir)/e-util/libeutil.la \
- $(top_builddir)/e-util/libeconduit.la \
- $(EVOLUTION_CALENDAR_CONDUIT_LIBS)
-
-e-todo-$(BASE_VERSION).conduit: e-todo.conduit.in
- sed -e 's^\@privconduitdir\@^$(privconduitdir)^g' \
- -e 's^\@datadir\@^$(datadir)^g' \
- -e 's^\@BASE_VERSION\@^$(BASE_VERSION)^g' \
- $< > $@
-
-conduitdir = $(datadir)/gnome-pilot/conduits/
-conduit_DATA = e-todo-$(BASE_VERSION).conduit
-
-BUILT_SOURCES = $(conduit_DATA)
-CLEANFILES = $(BUILT_SOURCES)
-
-EXTRA_DIST = \
- e-todo.conduit.in
-
-dist-hook:
- cd $(distdir); rm -f $(BUILT_SOURCES) \ No newline at end of file
diff --git a/calendar/conduits/todo/e-todo.conduit.in b/calendar/conduits/todo/e-todo.conduit.in
deleted file mode 100644
index 3b02058c91..0000000000
--- a/calendar/conduits/todo/e-todo.conduit.in
+++ /dev/null
@@ -1,9 +0,0 @@
-<gnome-pilot-conduit version="1.0">
- <conduit id="e_todo_conduit" type="shlib" location="@privconduitdir@/libetodo_conduit.so"/>
- <name value="EToDo"/>
- <conduit-attribute name="description" value="Synchronizes ToDo List with Evolution @BASE_VERSION@"/>
- <conduit-attribute name="default-synctype" value="synchronize"/>
- <conduit-attribute name="valid-synctypes" value="synchronize copy_from_pilot copy_to_pilot"/>
- <conduit-attribute name="settings" value="TRUE"/>
- <conduit-attribute name="icon" value="@datadir@/images/evolution/conduits/48_evo-todo-conduit.png"/>
-</gnome-pilot-conduit>
diff --git a/calendar/conduits/todo/todo-conduit.c b/calendar/conduits/todo/todo-conduit.c
deleted file mode 100644
index fe5684252b..0000000000
--- a/calendar/conduits/todo/todo-conduit.c
+++ /dev/null
@@ -1,1413 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* Evolution calendar - ToDo Conduit
- *
- * Copyright (C) 1998 Free Software Foundation
- * Copyright (C) 2000 Ximian, Inc.
- *
- * Authors: Eskil Heyn Olsen <deity@eskil.dk>
- * JP Rosevear <jpr@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-
-#define G_LOG_DOMAIN "etodoconduit"
-
-#include <libecal/e-cal-types.h>
-#include <libecal/e-cal.h>
-#include <libecal/e-cal-time-util.h>
-#include <pi-source.h>
-#include <pi-socket.h>
-#include <pi-dlp.h>
-#include <pi-todo.h>
-#include <libical/icaltypes.h>
-#include <gpilotd/gnome-pilot-conduit.h>
-#include <gpilotd/gnome-pilot-conduit-sync-abs.h>
-#include <libgpilotdCM/gnome-pilot-conduit-management.h>
-#include <libgpilotdCM/gnome-pilot-conduit-config.h>
-#include <e-pilot-map.h>
-#include <e-pilot-settings.h>
-#include <e-pilot-util.h>
-#include <e-config-listener.h>
-
-GnomePilotConduit * conduit_get_gpilot_conduit (guint32);
-void conduit_destroy_gpilot_conduit (GnomePilotConduit*);
-
-#define CONDUIT_VERSION "0.1.4"
-
-#define DEBUG_TODOCONDUIT 1
-/* #undef DEBUG_TODOCONDUIT */
-
-#ifdef DEBUG_TODOCONDUIT
-#define LOG(x) x
-#else
-#define LOG(x)
-#endif
-
-#define WARN g_warning
-#define INFO g_message
-
-typedef struct _EToDoLocalRecord EToDoLocalRecord;
-typedef struct _EToDoConduitCfg EToDoConduitCfg;
-typedef struct _EToDoConduitGui EToDoConduitGui;
-typedef struct _EToDoConduitContext EToDoConduitContext;
-
-/* Local Record */
-struct _EToDoLocalRecord {
- /* The stuff from gnome-pilot-conduit-standard-abs.h
- Must be first in the structure, or instances of this
- structure cannot be used by gnome-pilot-conduit-standard-abs.
- */
- GnomePilotDesktopRecord local;
-
- /* The corresponding Comp object */
- ECalComponent *comp;
-
- /* pilot-link todo structure */
- struct ToDo *todo;
-};
-
-static void
-todoconduit_destroy_record (EToDoLocalRecord *local)
-{
- g_object_unref (local->comp);
- free_ToDo (local->todo);
- g_free (local->todo);
- g_free (local);
-}
-
-/* Configuration */
-struct _EToDoConduitCfg {
- guint32 pilot_id;
- GnomePilotConduitSyncType sync_type;
-
- gboolean secret;
- gint priority;
-
- gchar *last_uri;
-};
-
-static EToDoConduitCfg *
-todoconduit_load_configuration (guint32 pilot_id)
-{
- EToDoConduitCfg *c;
- GnomePilotConduitManagement *management;
- GnomePilotConduitConfig *config;
- gchar prefix[256];
- g_snprintf (prefix, 255, "/gnome-pilot.d/e-todo-conduit/Pilot_%u/",
- pilot_id);
-
- c = g_new0 (EToDoConduitCfg,1);
- g_assert (c != NULL);
-
- c->pilot_id = pilot_id;
-
- management = gnome_pilot_conduit_management_new ("e_todo_conduit", GNOME_PILOT_CONDUIT_MGMT_ID);
- gtk_object_ref (GTK_OBJECT (management));
- gtk_object_sink (GTK_OBJECT (management));
- config = gnome_pilot_conduit_config_new (management, pilot_id);
- gtk_object_ref (GTK_OBJECT (config));
- gtk_object_sink (GTK_OBJECT (config));
- if (!gnome_pilot_conduit_config_is_enabled (config, &c->sync_type))
- c->sync_type = GnomePilotConduitSyncTypeNotSet;
- gtk_object_unref (GTK_OBJECT (config));
- gtk_object_unref (GTK_OBJECT (management));
-
- /* Custom settings */
- gnome_config_push_prefix (prefix);
-
- c->secret = gnome_config_get_bool ("secret=FALSE");
- c->priority = gnome_config_get_int ("priority=3");
- c->last_uri = gnome_config_get_string ("last_uri");
-
- gnome_config_pop_prefix ();
-
- return c;
-}
-
-static void
-todoconduit_save_configuration (EToDoConduitCfg *c)
-{
- gchar prefix[256];
-
- g_snprintf (prefix, 255, "/gnome-pilot.d/e-todo-conduit/Pilot_%u/",
- c->pilot_id);
-
- gnome_config_push_prefix (prefix);
- gnome_config_set_bool ("secret", c->secret);
- gnome_config_set_int ("priority", c->priority);
- gnome_config_set_string ("last_uri", c->last_uri);
- gnome_config_pop_prefix ();
-
- gnome_config_sync ();
- gnome_config_drop_all ();
-}
-
-static EToDoConduitCfg*
-todoconduit_dupe_configuration (EToDoConduitCfg *c)
-{
- EToDoConduitCfg *retval;
-
- g_return_val_if_fail (c != NULL, NULL);
-
- retval = g_new0 (EToDoConduitCfg, 1);
- retval->sync_type = c->sync_type;
- retval->pilot_id = c->pilot_id;
-
- retval->secret = c->secret;
- retval->priority = c->priority;
- retval->last_uri = g_strdup (c->last_uri);
-
- return retval;
-}
-
-static void
-todoconduit_destroy_configuration (EToDoConduitCfg *c)
-{
- g_return_if_fail (c != NULL);
-
- g_free (c->last_uri);
- g_free (c);
-}
-
-/* Gui */
-struct _EToDoConduitGui {
- GtkWidget *priority;
-};
-
-static EToDoConduitGui *
-e_todo_gui_new (EPilotSettings *ps)
-{
- EToDoConduitGui *gui;
- GtkWidget *lbl;
- GtkObject *adj;
- gint rows;
-
- g_return_val_if_fail (ps != NULL, NULL);
- g_return_val_if_fail (E_IS_PILOT_SETTINGS (ps), NULL);
-
- gtk_table_resize (GTK_TABLE (ps), E_PILOT_SETTINGS_TABLE_ROWS + 1, E_PILOT_SETTINGS_TABLE_COLS);
-
- gui = g_new0 (EToDoConduitGui, 1);
-
- rows = E_PILOT_SETTINGS_TABLE_ROWS;
- lbl = gtk_label_new (_("Default Priority:"));
- gtk_misc_set_alignment (GTK_MISC (lbl), 0.0, 0.5);
- adj = gtk_adjustment_new (1, 1, 5, 1, 5, 5);
- gui->priority = gtk_spin_button_new (GTK_ADJUSTMENT (adj), 1.0, 0);
- gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (gui->priority), TRUE);
- gtk_table_attach_defaults (GTK_TABLE (ps), lbl, 0, 1, rows, rows + 1);
- gtk_table_attach_defaults (GTK_TABLE (ps), gui->priority, 1, 2, rows, rows + 1);
- gtk_widget_show (lbl);
- gtk_widget_show (gui->priority);
-
- return gui;
-}
-
-static void
-e_todo_gui_fill_widgets (EToDoConduitGui *gui, EToDoConduitCfg *cfg)
-{
- g_return_if_fail (gui != NULL);
- g_return_if_fail (cfg != NULL);
-
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (gui->priority), cfg->priority);
-}
-
-static void
-e_todo_gui_fill_config (EToDoConduitGui *gui, EToDoConduitCfg *cfg)
-{
- g_return_if_fail (gui != NULL);
- g_return_if_fail (cfg != NULL);
-
- cfg->priority = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (gui->priority));
-}
-
-static void
-e_todo_gui_destroy (EToDoConduitGui *gui)
-{
- g_free (gui);
-}
-
-/* Context */
-struct _EToDoConduitContext {
- GnomePilotDBInfo *dbi;
-
- EToDoConduitCfg *cfg;
- EToDoConduitCfg *new_cfg;
- EToDoConduitGui *gui;
- GtkWidget *ps;
-
- struct ToDoAppInfo ai;
-
- ECal *client;
-
- icaltimezone *timezone;
- ECalComponent *default_comp;
- GList *comps;
- GList *changed;
- GHashTable *changed_hash;
- GList *locals;
-
- EPilotMap *map;
-};
-
-static EToDoConduitContext *
-e_todo_context_new (guint32 pilot_id)
-{
- EToDoConduitContext *ctxt = g_new0 (EToDoConduitContext, 1);
-
- ctxt->cfg = todoconduit_load_configuration (pilot_id);
- ctxt->new_cfg = todoconduit_dupe_configuration (ctxt->cfg);
- ctxt->gui = NULL;
- ctxt->ps = NULL;
- ctxt->client = NULL;
- ctxt->timezone = NULL;
- ctxt->default_comp = NULL;
- ctxt->comps = NULL;
- ctxt->changed_hash = NULL;
- ctxt->changed = NULL;
- ctxt->locals = NULL;
- ctxt->map = NULL;
-
- return ctxt;
-}
-
-static gboolean
-e_todo_context_foreach_change (gpointer key, gpointer value, gpointer data)
-{
- g_free (key);
-
- return TRUE;
-}
-
-static void
-e_todo_context_destroy (EToDoConduitContext *ctxt)
-{
- GList *l;
-
- g_return_if_fail (ctxt != NULL);
-
- if (ctxt->cfg != NULL)
- todoconduit_destroy_configuration (ctxt->cfg);
- if (ctxt->new_cfg != NULL)
- todoconduit_destroy_configuration (ctxt->new_cfg);
- if (ctxt->gui != NULL)
- e_todo_gui_destroy (ctxt->gui);
-
- if (ctxt->client != NULL)
- g_object_unref (ctxt->client);
-
- if (ctxt->default_comp != NULL)
- g_object_unref (ctxt->default_comp);
- if (ctxt->comps != NULL) {
- for (l = ctxt->comps; l; l = l->next)
- g_object_unref (l->data);
- g_list_free (ctxt->comps);
- }
-
- if (ctxt->changed_hash != NULL) {
- g_hash_table_foreach_remove (ctxt->changed_hash, e_todo_context_foreach_change, NULL);
- g_hash_table_destroy (ctxt->changed_hash);
- }
-
- if (ctxt->locals != NULL) {
- for (l = ctxt->locals; l != NULL; l = l->next)
- todoconduit_destroy_record (l->data);
- g_list_free (ctxt->locals);
- }
-
- if (ctxt->changed != NULL)
- e_cal_free_change_list (ctxt->changed);
-
- if (ctxt->map != NULL)
- e_pilot_map_destroy (ctxt->map);
-
- g_free (ctxt);
-}
-
-/* Debug routines */
-static char *
-print_local (EToDoLocalRecord *local)
-{
- static char buff[ 4096 ];
-
- if (local == NULL) {
- sprintf (buff, "[NULL]");
- return buff;
- }
-
- if (local->todo && local->todo->description) {
- g_snprintf (buff, 4096, "[%d %ld %d %d '%s' '%s']",
- local->todo->indefinite,
- mktime (& local->todo->due),
- local->todo->priority,
- local->todo->complete,
- local->todo->description ?
- local->todo->description : "",
- local->todo->note ?
- local->todo->note : "");
- return buff;
- }
-
- return "";
-}
-
-static char *print_remote (GnomePilotRecord *remote)
-{
- static char buff[ 4096 ];
- struct ToDo todo;
-
- if (remote == NULL) {
- sprintf (buff, "[NULL]");
- return buff;
- }
-
- memset (&todo, 0, sizeof (struct ToDo));
- unpack_ToDo (&todo, remote->record, remote->length);
-
- g_snprintf (buff, 4096, "[%d %ld %d %d '%s' '%s']",
- todo.indefinite,
- mktime (&todo.due),
- todo.priority,
- todo.complete,
- todo.description ?
- todo.description : "",
- todo.note ?
- todo.note : "");
-
- free_ToDo (&todo);
-
- return buff;
-}
-
-static int
-start_calendar_server (EToDoConduitContext *ctxt)
-{
- char *uri;
-
- g_return_val_if_fail (ctxt != NULL, -2);
-
- /* FIXME Need a mechanism for the user to select uri's */
- /* FIXME Can we use the cal model? */
- uri = g_strdup_printf ("file://%s/local/Tasks/", g_get_home_dir ());
- ctxt->client = e_cal_new (uri, CALOBJ_TYPE_TODO);
- g_free (uri);
-
- if (!ctxt->client)
- return -1;
-
- if (!e_cal_open (ctxt->client, FALSE, NULL))
- return -1;
-
- return 0;
-}
-
-/* Utility routines */
-static icaltimezone *
-get_timezone (ECal *client, const char *tzid)
-{
- icaltimezone *timezone = NULL;
-
- timezone = icaltimezone_get_builtin_timezone_from_tzid (tzid);
- if (timezone == NULL)
- e_cal_get_timezone (client, tzid, &timezone, NULL);
-
- return timezone;
-}
-
-static icaltimezone *
-get_default_timezone (void)
-{
- EConfigListener *listener;
- icaltimezone *timezone = NULL;
- char *location;
-
- listener = e_config_listener_new ();
-
- location = e_config_listener_get_string_with_default (listener,
- "/apps/evolution/calendar/display/timezone", "UTC", NULL);
- if (!location || !location[0]) {
- g_free (location);
- location = g_strdup ("UTC");
- }
-
- timezone = icaltimezone_get_builtin_timezone (location);
- g_free (location);
-
- g_object_unref (listener);
-
- return timezone;
-}
-
-static char *
-map_name (EToDoConduitContext *ctxt)
-{
- char *filename;
-
- filename = g_strdup_printf ("%s/evolution/local/Tasks/pilot-map-todo-%d.xml", g_get_home_dir (), ctxt->cfg->pilot_id);
-
- return filename;
-}
-
-static gboolean
-is_empty_time (struct tm time)
-{
- if (time.tm_sec || time.tm_min || time.tm_hour
- || time.tm_mday || time.tm_mon || time.tm_year)
- return FALSE;
-
- return TRUE;
-}
-
-static GList *
-next_changed_item (EToDoConduitContext *ctxt, GList *changes)
-{
- ECalChange *ccc;
- GList *l;
-
- for (l = changes; l != NULL; l = l->next) {
- const char *uid;
-
- ccc = l->data;
-
- e_cal_component_get_uid (ccc->comp, &uid);
- if (g_hash_table_lookup (ctxt->changed_hash, uid))
- return l;
- }
-
- return NULL;
-}
-
-static void
-compute_status (EToDoConduitContext *ctxt, EToDoLocalRecord *local, const char *uid)
-{
- ECalChange *ccc;
-
- local->local.archived = FALSE;
- local->local.secret = FALSE;
-
- ccc = g_hash_table_lookup (ctxt->changed_hash, uid);
-
- if (ccc == NULL) {
- local->local.attr = GnomePilotRecordNothing;
- return;
- }
-
- switch (ccc->type) {
- case E_CAL_CHANGE_ADDED:
- local->local.attr = GnomePilotRecordNew;
- break;
- case E_CAL_CHANGE_MODIFIED:
- local->local.attr = GnomePilotRecordModified;
- break;
- case E_CAL_CHANGE_DELETED:
- local->local.attr = GnomePilotRecordDeleted;
- break;
- }
-}
-
-static GnomePilotRecord
-local_record_to_pilot_record (EToDoLocalRecord *local,
- EToDoConduitContext *ctxt)
-{
- GnomePilotRecord p;
- static char record[0xffff];
-
- g_assert (local->comp != NULL);
- g_assert (local->todo != NULL );
-
- LOG (g_message ( "local_record_to_pilot_record\n" ));
-
- p.ID = local->local.ID;
- p.category = local->local.category;
- p.attr = local->local.attr;
- p.archived = local->local.archived;
- p.secret = local->local.secret;
-
- /* Generate pilot record structure */
- p.record = record;
- p.length = pack_ToDo (local->todo, p.record, 0xffff);
-
- return p;
-}
-
-/*
- * converts a ECalComponent object to a EToDoLocalRecord
- */
-static void
-local_record_from_comp (EToDoLocalRecord *local, ECalComponent *comp, EToDoConduitContext *ctxt)
-{
- const char *uid;
- int *priority;
- icalproperty_status status;
- ECalComponentText summary;
- GSList *d_list = NULL;
- ECalComponentText *description;
- ECalComponentDateTime due;
- ECalComponentClassification classif;
- icaltimezone *default_tz = get_default_timezone ();
-
- LOG (g_message ( "local_record_from_comp\n" ));
-
- g_return_if_fail (local != NULL);
- g_return_if_fail (comp != NULL);
-
- local->comp = comp;
- g_object_ref (comp);
-
- e_cal_component_get_uid (local->comp, &uid);
- local->local.ID = e_pilot_map_lookup_pid (ctxt->map, uid, TRUE);
-
- compute_status (ctxt, local, uid);
-
- local->todo = g_new0 (struct ToDo,1);
-
- /* Don't overwrite the category */
- if (local->local.ID != 0) {
- char record[0xffff];
- int cat = 0;
-
- if (dlp_ReadRecordById (ctxt->dbi->pilot_socket,
- ctxt->dbi->db_handle,
- local->local.ID, &record,
- NULL, NULL, NULL, &cat) > 0) {
- local->local.category = cat;
- }
- }
-
- /* STOP: don't replace these with g_strdup, since free_ToDo
- uses free to deallocate */
- e_cal_component_get_summary (comp, &summary);
- if (summary.value)
- local->todo->description = e_pilot_utf8_to_pchar (summary.value);
-
- e_cal_component_get_description_list (comp, &d_list);
- if (d_list) {
- description = (ECalComponentText *) d_list->data;
- if (description && description->value)
- local->todo->note = e_pilot_utf8_to_pchar (description->value);
- else
- local->todo->note = NULL;
- } else {
- local->todo->note = NULL;
- }
-
- e_cal_component_get_due (comp, &due);
- if (due.value) {
- icaltimezone_convert_time (due.value,
- get_timezone (ctxt->client, due.tzid),
- default_tz);
- local->todo->due = icaltimetype_to_tm (due.value);
- local->todo->indefinite = 0;
- } else {
- local->todo->indefinite = 1;
- }
- e_cal_component_free_datetime (&due);
-
- e_cal_component_get_status (comp, &status);
- if (status == ICAL_STATUS_COMPLETED)
- local->todo->complete = 1;
- else
- local->todo->complete = 0;
-
- e_cal_component_get_priority (comp, &priority);
- if (priority && *priority != 0) {
- if (*priority <= 3)
- local->todo->priority = 1;
- else if (*priority == 4)
- local->todo->priority = 2;
- else if (*priority == 5)
- local->todo->priority = 3;
- else if (*priority <= 7)
- local->todo->priority = 4;
- else
- local->todo->priority = 5;
-
- e_cal_component_free_priority (priority);
- } else {
- local->todo->priority = ctxt->cfg->priority;
- }
-
- e_cal_component_get_classification (comp, &classif);
-
- if (classif == E_CAL_COMPONENT_CLASS_PRIVATE)
- local->local.secret = 1;
- else
- local->local.secret = 0;
-
- local->local.archived = 0;
-}
-
-static void
-local_record_from_uid (EToDoLocalRecord *local,
- const char *uid,
- EToDoConduitContext *ctxt)
-{
- ECalComponent *comp;
- icalcomponent *icalcomp;
- GError *error = NULL;
-
- g_assert(local!=NULL);
-
- if (e_cal_get_object (ctxt->client, uid, NULL, &icalcomp, &error)) {
- comp = e_cal_component_new ();
- if (!e_cal_component_set_icalcomponent (comp, icalcomp)) {
- g_object_unref (comp);
- icalcomponent_free (icalcomp);
- return;
- }
-
- local_record_from_comp (local, comp, ctxt);
- g_object_unref (comp);
- } else if (error->code == E_CALENDAR_STATUS_OBJECT_NOT_FOUND) {
- comp = e_cal_component_new ();
- e_cal_component_set_new_vtype (comp, E_CAL_COMPONENT_TODO);
- e_cal_component_set_uid (comp, uid);
- local_record_from_comp (local, comp, ctxt);
- g_object_unref (comp);
- } else {
- INFO ("Object did not exist");
- }
-
- g_clear_error (&error);
-}
-
-
-static ECalComponent *
-comp_from_remote_record (GnomePilotConduitSyncAbs *conduit,
- GnomePilotRecord *remote,
- ECalComponent *in_comp,
- icaltimezone *timezone)
-{
- ECalComponent *comp;
- struct ToDo todo;
- ECalComponentText summary = {NULL, NULL};
- ECalComponentDateTime dt = {NULL, icaltimezone_get_tzid (timezone)};
- struct icaltimetype due, now;
- icaltimezone *utc_zone;
- int priority;
- char *txt;
-
- g_return_val_if_fail (remote != NULL, NULL);
-
- memset (&todo, 0, sizeof (struct ToDo));
- unpack_ToDo (&todo, remote->record, remote->length);
-
- utc_zone = icaltimezone_get_utc_timezone ();
- now = icaltime_from_timet_with_zone (time (NULL), FALSE,
- utc_zone);
-
- if (in_comp == NULL) {
- comp = e_cal_component_new ();
- e_cal_component_set_new_vtype (comp, E_CAL_COMPONENT_TODO);
- e_cal_component_set_created (comp, &now);
- } else {
- comp = e_cal_component_clone (in_comp);
- }
-
- e_cal_component_set_last_modified (comp, &now);
-
- summary.value = txt = e_pilot_utf8_from_pchar (todo.description);
- e_cal_component_set_summary (comp, &summary);
- free (txt);
-
- /* The iCal description field */
- if (!todo.note) {
- e_cal_component_set_comment_list (comp, NULL);
- } else {
- GSList l;
- ECalComponentText text;
-
- text.value = txt = e_pilot_utf8_from_pchar (todo.note);
- text.altrep = NULL;
- l.data = &text;
- l.next = NULL;
-
- e_cal_component_set_description_list (comp, &l);
- free (txt);
- }
-
- if (todo.complete) {
- int percent = 100;
-
- e_cal_component_set_completed (comp, &now);
- e_cal_component_set_percent (comp, &percent);
- e_cal_component_set_status (comp, ICAL_STATUS_COMPLETED);
- } else {
- int *percent = NULL;
- icalproperty_status status;
-
- e_cal_component_set_completed (comp, NULL);
-
- e_cal_component_get_percent (comp, &percent);
- if (percent == NULL || *percent == 100) {
- int p = 0;
- e_cal_component_set_percent (comp, &p);
- }
- if (percent != NULL)
- e_cal_component_free_percent (percent);
-
- e_cal_component_get_status (comp, &status);
- if (status == ICAL_STATUS_COMPLETED)
- e_cal_component_set_status (comp, ICAL_STATUS_NEEDSACTION);
- }
-
- if (!is_empty_time (todo.due)) {
- due = tm_to_icaltimetype (&todo.due, TRUE);
- dt.value = &due;
- e_cal_component_set_due (comp, &dt);
- }
-
- switch (todo.priority) {
- case 1:
- priority = 3;
- break;
- case 2:
- priority = 4;
- break;
- case 3:
- priority = 5;
- break;
- case 4:
- priority = 7;
- break;
- default:
- priority = 9;
- }
-
- e_cal_component_set_priority (comp, &priority);
- e_cal_component_set_transparency (comp, E_CAL_COMPONENT_TRANSP_NONE);
-
- if (remote->secret)
- e_cal_component_set_classification (comp, E_CAL_COMPONENT_CLASS_PRIVATE);
- else
- e_cal_component_set_classification (comp, E_CAL_COMPONENT_CLASS_PUBLIC);
-
- e_cal_component_commit_sequence (comp);
-
- free_ToDo(&todo);
-
- return comp;
-}
-
-static void
-check_for_slow_setting (GnomePilotConduit *c, EToDoConduitContext *ctxt)
-{
- GnomePilotConduitStandard *conduit = GNOME_PILOT_CONDUIT_STANDARD (c);
- int map_count;
- const char *uri;
-
- /* If there are no objects or objects but no log */
- map_count = g_hash_table_size (ctxt->map->pid_map);
- if (map_count == 0)
- gnome_pilot_conduit_standard_set_slow (conduit, TRUE);
-
- /* Or if the URI's don't match */
- uri = e_cal_get_uri (ctxt->client);
- LOG (g_message ( " Current URI %s (%s)\n", uri, ctxt->cfg->last_uri ? ctxt->cfg->last_uri : "<NONE>" ));
- if (ctxt->cfg->last_uri != NULL && strcmp (ctxt->cfg->last_uri, uri)) {
- gnome_pilot_conduit_standard_set_slow (conduit, TRUE);
- e_pilot_map_clear (ctxt->map);
- }
-
- if (gnome_pilot_conduit_standard_get_slow (conduit)) {
- ctxt->map->write_touched_only = TRUE;
- LOG (g_message ( " doing slow sync\n" ));
- } else {
- LOG (g_message ( " doing fast sync\n" ));
- }
-}
-
-/* Pilot syncing callbacks */
-static gint
-pre_sync (GnomePilotConduit *conduit,
- GnomePilotDBInfo *dbi,
- EToDoConduitContext *ctxt)
-{
- GnomePilotConduitSyncAbs *abs_conduit;
- GList *l;
- int len;
- unsigned char *buf;
- char *filename, *change_id;
- icalcomponent *icalcomp;
- gint num_records, add_records = 0, mod_records = 0, del_records = 0;
-
- abs_conduit = GNOME_PILOT_CONDUIT_SYNC_ABS (conduit);
-
- LOG (g_message ( "---------------------------------------------------------\n" ));
- LOG (g_message ( "pre_sync: ToDo Conduit v.%s", CONDUIT_VERSION ));
- g_message ("ToDo Conduit v.%s", CONDUIT_VERSION);
-
- ctxt->dbi = dbi;
- ctxt->client = NULL;
-
- if (start_calendar_server (ctxt) != 0) {
- WARN(_("Could not start wombat server"));
- gnome_pilot_conduit_error (conduit, _("Could not start wombat"));
- return -1;
- }
-
- /* Get the timezone */
- ctxt->timezone = get_default_timezone ();
- if (ctxt->timezone == NULL)
- return -1;
- LOG (g_message ( " Using timezone: %s", icaltimezone_get_tzid (ctxt->timezone) ));
-
- /* Set the default timezone on the backend. */
- if (ctxt->timezone) {
- if (!e_cal_set_default_timezone (ctxt->client, ctxt->timezone, NULL))
- return -1;
- }
-
- /* Get the default component */
- if (!e_cal_get_default_object (ctxt->client, &icalcomp, NULL))
- return -1;
-
- ctxt->default_comp = e_cal_component_new ();
- if (!e_cal_component_set_icalcomponent (ctxt->default_comp, icalcomp)) {
- g_object_unref (ctxt->default_comp);
- icalcomponent_free (icalcomp);
- return -1;
- }
-
- ctxt->default_comp = e_cal_component_new ();
- if (!e_cal_component_set_icalcomponent (ctxt->default_comp, icalcomp)) {
- g_object_unref (ctxt->default_comp);
- icalcomponent_free (icalcomp);
- return -1;
- }
-
- /* Load the uid <--> pilot id map */
- filename = map_name (ctxt);
- e_pilot_map_read (filename, &ctxt->map);
- g_free (filename);
-
- /* Get the local database */
- if (!e_cal_get_object_list_as_comp (ctxt->client, "(#t)", &ctxt->comps, NULL))
- return -1;
-
- /* Count and hash the changes */
- change_id = g_strdup_printf ("pilot-sync-evolution-todo-%d", ctxt->cfg->pilot_id);
- if (!e_cal_get_changes (ctxt->client, change_id, &ctxt->changed, NULL))
- return -1;
- ctxt->changed_hash = g_hash_table_new (g_str_hash, g_str_equal);
- g_free (change_id);
-
- for (l = ctxt->changed; l != NULL; l = l->next) {
- ECalChange *ccc = l->data;
- const char *uid;
-
- e_cal_component_get_uid (ccc->comp, &uid);
- if (!e_pilot_map_uid_is_archived (ctxt->map, uid)) {
-
- g_hash_table_insert (ctxt->changed_hash, g_strdup (uid), ccc);
-
- switch (ccc->type) {
- case E_CAL_CHANGE_ADDED:
- add_records++;
- break;
- case E_CAL_CHANGE_MODIFIED:
- mod_records++;
- break;
- case E_CAL_CHANGE_DELETED:
- del_records++;
- break;
- }
- } else if (ccc->type == E_CAL_CHANGE_DELETED) {
- e_pilot_map_remove_by_uid (ctxt->map, uid);
- }
- }
-
- /* Set the count information */
- num_records = g_list_length (ctxt->comps);
- gnome_pilot_conduit_sync_abs_set_num_local_records(abs_conduit, num_records);
- gnome_pilot_conduit_sync_abs_set_num_new_local_records (abs_conduit, add_records);
- gnome_pilot_conduit_sync_abs_set_num_updated_local_records (abs_conduit, mod_records);
- gnome_pilot_conduit_sync_abs_set_num_deleted_local_records(abs_conduit, del_records);
-
- buf = (unsigned char*)g_malloc (0xffff);
- len = dlp_ReadAppBlock (dbi->pilot_socket, dbi->db_handle, 0,
- (unsigned char *)buf, 0xffff);
-
- if (len < 0) {
- WARN (_("Could not read pilot's ToDo application block"));
- WARN ("dlp_ReadAppBlock(...) = %d", len);
- gnome_pilot_conduit_error (conduit,
- _("Could not read pilot's ToDo application block"));
- return -1;
- }
- unpack_ToDoAppInfo (&(ctxt->ai), buf, len);
- g_free (buf);
-
- check_for_slow_setting (conduit, ctxt);
- if (ctxt->cfg->sync_type == GnomePilotConduitSyncTypeCopyToPilot
- || ctxt->cfg->sync_type == GnomePilotConduitSyncTypeCopyFromPilot)
- ctxt->map->write_touched_only = TRUE;
-
- return 0;
-}
-
-static gint
-post_sync (GnomePilotConduit *conduit,
- GnomePilotDBInfo *dbi,
- EToDoConduitContext *ctxt)
-{
- GList *changed;
- gchar *filename, *change_id;
-
- LOG (g_message ( "post_sync: ToDo Conduit v.%s", CONDUIT_VERSION ));
-
- g_free (ctxt->cfg->last_uri);
- ctxt->cfg->last_uri = g_strdup (e_cal_get_uri (ctxt->client));
- todoconduit_save_configuration (ctxt->cfg);
-
- filename = map_name (ctxt);
- e_pilot_map_write (filename, ctxt->map);
- g_free (filename);
-
- /* FIX ME ugly hack - our changes musn't count, this does introduce
- * a race condition if anyone changes a record elsewhere during sycnc
- */
- change_id = g_strdup_printf ("pilot-sync-evolution-todo-%d", ctxt->cfg->pilot_id);
- if (e_cal_get_changes (ctxt->client, change_id, &changed, NULL))
- e_cal_free_change_list (changed);
- g_free (change_id);
-
- LOG (g_message ( "---------------------------------------------------------\n" ));
-
- return 0;
-}
-
-static gint
-set_pilot_id (GnomePilotConduitSyncAbs *conduit,
- EToDoLocalRecord *local,
- guint32 ID,
- EToDoConduitContext *ctxt)
-{
- const char *uid;
-
- LOG (g_message ( "set_pilot_id: setting to %d\n", ID ));
-
- e_cal_component_get_uid (local->comp, &uid);
- e_pilot_map_insert (ctxt->map, ID, uid, FALSE);
-
- return 0;
-}
-
-static gint
-set_status_cleared (GnomePilotConduitSyncAbs *conduit,
- EToDoLocalRecord *local,
- EToDoConduitContext *ctxt)
-{
- const char *uid;
-
- LOG (g_message ( "set_status_cleared: clearing status\n" ));
-
- e_cal_component_get_uid (local->comp, &uid);
- g_hash_table_remove (ctxt->changed_hash, uid);
-
- return 0;
-}
-
-static gint
-for_each (GnomePilotConduitSyncAbs *conduit,
- EToDoLocalRecord **local,
- EToDoConduitContext *ctxt)
-{
- static GList *comps, *iterator;
- static int count;
-
- g_return_val_if_fail (local != NULL, -1);
-
- if (*local == NULL) {
- LOG (g_message ( "beginning for_each" ));
-
- comps = ctxt->comps;
- count = 0;
-
- if (comps != NULL) {
- LOG (g_message ( "iterating over %d records", g_list_length (comps)));
-
- *local = g_new0 (EToDoLocalRecord, 1);
- local_record_from_comp (*local, comps->data, ctxt);
- g_list_prepend (ctxt->locals, *local);
-
- iterator = comps;
- } else {
- LOG (g_message ( "no events" ));
- (*local) = NULL;
- return 0;
- }
- } else {
- count++;
- if (g_list_next (iterator)) {
- iterator = g_list_next (iterator);
-
- *local = g_new0 (EToDoLocalRecord, 1);
- local_record_from_uid (*local, iterator->data, ctxt);
- g_list_prepend (ctxt->locals, *local);
- } else {
- LOG (g_message ( "for_each ending" ));
-
- /* Tell the pilot the iteration is over */
- *local = NULL;
-
- return 0;
- }
- }
-
- return 0;
-}
-
-static gint
-for_each_modified (GnomePilotConduitSyncAbs *conduit,
- EToDoLocalRecord **local,
- EToDoConduitContext *ctxt)
-{
- static GList *iterator;
- static int count;
-
- g_return_val_if_fail (local != NULL, 0);
-
- if (*local == NULL) {
- LOG (g_message ( "for_each_modified beginning\n" ));
-
- iterator = ctxt->changed;
-
- count = 0;
-
- LOG (g_message ( "iterating over %d records", g_hash_table_size (ctxt->changed_hash) ));
-
- iterator = next_changed_item (ctxt, iterator);
- if (iterator != NULL) {
- ECalChange *ccc = iterator->data;
-
- *local = g_new0 (EToDoLocalRecord, 1);
- local_record_from_comp (*local, ccc->comp, ctxt);
- g_list_prepend (ctxt->locals, *local);
- } else {
- LOG (g_message ( "no events" ));
-
- *local = NULL;
- }
- } else {
- count++;
- iterator = g_list_next (iterator);
- if (iterator && (iterator = next_changed_item (ctxt, iterator))) {
- ECalChange *ccc = iterator->data;
-
- *local = g_new0 (EToDoLocalRecord, 1);
- local_record_from_comp (*local, ccc->comp, ctxt);
- g_list_prepend (ctxt->locals, *local);
- } else {
- LOG (g_message ( "for_each_modified ending" ));
-
- /* Signal the iteration is over */
- *local = NULL;
- }
- }
-
- return 0;
-}
-
-static gint
-compare (GnomePilotConduitSyncAbs *conduit,
- EToDoLocalRecord *local,
- GnomePilotRecord *remote,
- EToDoConduitContext *ctxt)
-{
- /* used by the quick compare */
- GnomePilotRecord local_pilot;
- int retval = 0;
-
- LOG (g_message ("compare: local=%s remote=%s...\n",
- print_local (local), print_remote (remote)));
-
- g_return_val_if_fail (local!=NULL,-1);
- g_return_val_if_fail (remote!=NULL,-1);
-
- local_pilot = local_record_to_pilot_record (local, ctxt);
-
- if (remote->length != local_pilot.length
- || memcmp (local_pilot.record, remote->record, remote->length))
- retval = 1;
-
- if (retval == 0)
- LOG (g_message ( " equal" ));
- else
- LOG (g_message ( " not equal" ));
-
- return retval;
-}
-
-static gint
-add_record (GnomePilotConduitSyncAbs *conduit,
- GnomePilotRecord *remote,
- EToDoConduitContext *ctxt)
-{
- ECalComponent *comp;
- char *uid;
- int retval = 0;
-
- g_return_val_if_fail (remote != NULL, -1);
-
- LOG (g_message ( "add_record: adding %s to desktop\n", print_remote (remote) ));
-
- comp = comp_from_remote_record (conduit, remote, ctxt->default_comp, ctxt->timezone);
-
- /* Give it a new UID otherwise it will be the uid of the default comp */
- uid = e_cal_component_gen_uid ();
- e_cal_component_set_uid (comp, uid);
-
- if (!e_cal_create_object (ctxt->client, e_cal_component_get_icalcomponent (comp), NULL, NULL))
- return -1;
-
- e_pilot_map_insert (ctxt->map, remote->ID, uid, FALSE);
-
- g_object_unref (comp);
-
- return retval;
-}
-
-static gint
-replace_record (GnomePilotConduitSyncAbs *conduit,
- EToDoLocalRecord *local,
- GnomePilotRecord *remote,
- EToDoConduitContext *ctxt)
-{
- ECalComponent *new_comp;
- int retval = 0;
-
- g_return_val_if_fail (remote != NULL, -1);
-
- LOG (g_message ("replace_record: replace %s with %s\n",
- print_local (local), print_remote (remote)));
-
- new_comp = comp_from_remote_record (conduit, remote, local->comp, ctxt->timezone);
- g_object_unref (local->comp);
- local->comp = new_comp;
-
- if (!e_cal_modify_object (ctxt->client, e_cal_component_get_icalcomponent (new_comp),
- CALOBJ_MOD_ALL, NULL))
- return -1;
-
- return retval;
-}
-
-static gint
-delete_record (GnomePilotConduitSyncAbs *conduit,
- EToDoLocalRecord *local,
- EToDoConduitContext *ctxt)
-{
- const char *uid;
-
- g_return_val_if_fail (local != NULL, -1);
- g_return_val_if_fail (local->comp != NULL, -1);
-
- e_cal_component_get_uid (local->comp, &uid);
-
- LOG (g_message ( "delete_record: deleting %s\n", uid ));
-
- e_pilot_map_remove_by_uid (ctxt->map, uid);
- /* FIXME Error handling */
- e_cal_remove_object (ctxt->client, uid, NULL);
-
- return 0;
-}
-
-static gint
-archive_record (GnomePilotConduitSyncAbs *conduit,
- EToDoLocalRecord *local,
- gboolean archive,
- EToDoConduitContext *ctxt)
-{
- const char *uid;
- int retval = 0;
-
- g_return_val_if_fail (local != NULL, -1);
-
- LOG (g_message ( "archive_record: %s\n", archive ? "yes" : "no" ));
-
- e_cal_component_get_uid (local->comp, &uid);
- e_pilot_map_insert (ctxt->map, local->local.ID, uid, archive);
-
- return retval;
-}
-
-static gint
-match (GnomePilotConduitSyncAbs *conduit,
- GnomePilotRecord *remote,
- EToDoLocalRecord **local,
- EToDoConduitContext *ctxt)
-{
- const char *uid;
-
- LOG (g_message ("match: looking for local copy of %s\n",
- print_remote (remote)));
-
- g_return_val_if_fail (local != NULL, -1);
- g_return_val_if_fail (remote != NULL, -1);
-
- *local = NULL;
- uid = e_pilot_map_lookup_uid (ctxt->map, remote->ID, TRUE);
-
- if (!uid)
- return 0;
-
- LOG (g_message ( " matched\n" ));
-
- *local = g_new0 (EToDoLocalRecord, 1);
- local_record_from_uid (*local, uid, ctxt);
-
- return 0;
-}
-
-static gint
-free_match (GnomePilotConduitSyncAbs *conduit,
- EToDoLocalRecord *local,
- EToDoConduitContext *ctxt)
-{
- LOG (g_message ( "free_match: freeing\n" ));
-
- g_return_val_if_fail (local != NULL, -1);
-
- todoconduit_destroy_record (local);
-
- return 0;
-}
-
-static gint
-prepare (GnomePilotConduitSyncAbs *conduit,
- EToDoLocalRecord *local,
- GnomePilotRecord *remote,
- EToDoConduitContext *ctxt)
-{
- LOG (g_message ( "prepare: encoding local %s\n", print_local (local) ));
-
- *remote = local_record_to_pilot_record (local, ctxt);
-
- return 0;
-}
-
-/* Pilot Settings Callbacks */
-static void
-fill_widgets (EToDoConduitContext *ctxt)
-{
- e_pilot_settings_set_secret (E_PILOT_SETTINGS (ctxt->ps),
- ctxt->cfg->secret);
-
- e_todo_gui_fill_widgets (ctxt->gui, ctxt->cfg);
-}
-
-static gint
-create_settings_window (GnomePilotConduit *conduit,
- GtkWidget *parent,
- EToDoConduitContext *ctxt)
-{
- LOG (g_message ( "create_settings_window" ));
-
- ctxt->ps = e_pilot_settings_new ();
- ctxt->gui = e_todo_gui_new (E_PILOT_SETTINGS (ctxt->ps));
-
- gtk_container_add (GTK_CONTAINER (parent), ctxt->ps);
- gtk_widget_show (ctxt->ps);
-
- fill_widgets (ctxt);
-
- return 0;
-}
-static void
-display_settings (GnomePilotConduit *conduit, EToDoConduitContext *ctxt)
-{
- LOG (g_message ( "display_settings" ));
-
- fill_widgets (ctxt);
-}
-
-static void
-save_settings (GnomePilotConduit *conduit, EToDoConduitContext *ctxt)
-{
- LOG (g_message ( "save_settings" ));
-
- ctxt->new_cfg->secret = e_pilot_settings_get_secret (E_PILOT_SETTINGS (ctxt->ps));
- e_todo_gui_fill_config (ctxt->gui, ctxt->new_cfg);
-
- todoconduit_save_configuration (ctxt->new_cfg);
-}
-
-static void
-revert_settings (GnomePilotConduit *conduit, EToDoConduitContext *ctxt)
-{
- LOG (g_message ( "revert_settings" ));
-
- todoconduit_save_configuration (ctxt->cfg);
- todoconduit_destroy_configuration (ctxt->new_cfg);
- ctxt->new_cfg = todoconduit_dupe_configuration (ctxt->cfg);
-}
-
-GnomePilotConduit *
-conduit_get_gpilot_conduit (guint32 pilot_id)
-{
- GtkObject *retval;
- EToDoConduitContext *ctxt;
-
- LOG (g_message ( "in todo's conduit_get_gpilot_conduit\n" ));
-
- retval = gnome_pilot_conduit_sync_abs_new ("ToDoDB", 0x746F646F);
- g_assert (retval != NULL);
-
- ctxt = e_todo_context_new (pilot_id);
- gtk_object_set_data (GTK_OBJECT (retval), "todoconduit_context", ctxt);
-
- gtk_signal_connect (retval, "pre_sync", (GtkSignalFunc) pre_sync, ctxt);
- gtk_signal_connect (retval, "post_sync", (GtkSignalFunc) post_sync, ctxt);
-
- gtk_signal_connect (retval, "set_pilot_id", (GtkSignalFunc) set_pilot_id, ctxt);
- gtk_signal_connect (retval, "set_status_cleared", (GtkSignalFunc) set_status_cleared, ctxt);
-
- gtk_signal_connect (retval, "for_each", (GtkSignalFunc) for_each, ctxt);
- gtk_signal_connect (retval, "for_each_modified", (GtkSignalFunc) for_each_modified, ctxt);
- gtk_signal_connect (retval, "compare", (GtkSignalFunc) compare, ctxt);
-
- gtk_signal_connect (retval, "add_record", (GtkSignalFunc) add_record, ctxt);
- gtk_signal_connect (retval, "replace_record", (GtkSignalFunc) replace_record, ctxt);
- gtk_signal_connect (retval, "delete_record", (GtkSignalFunc) delete_record, ctxt);
- gtk_signal_connect (retval, "archive_record", (GtkSignalFunc) archive_record, ctxt);
-
- gtk_signal_connect (retval, "match", (GtkSignalFunc) match, ctxt);
- gtk_signal_connect (retval, "free_match", (GtkSignalFunc) free_match, ctxt);
-
- gtk_signal_connect (retval, "prepare", (GtkSignalFunc) prepare, ctxt);
-
- /* Gui Settings */
- gtk_signal_connect (retval, "create_settings_window", (GtkSignalFunc) create_settings_window, ctxt);
- gtk_signal_connect (retval, "display_settings", (GtkSignalFunc) display_settings, ctxt);
- gtk_signal_connect (retval, "save_settings", (GtkSignalFunc) save_settings, ctxt);
- gtk_signal_connect (retval, "revert_settings", (GtkSignalFunc) revert_settings, ctxt);
-
- return GNOME_PILOT_CONDUIT (retval);
-}
-
-void
-conduit_destroy_gpilot_conduit (GnomePilotConduit *conduit)
-{
- GtkObject *obj = GTK_OBJECT (conduit);
- EToDoConduitContext *ctxt;
-
- ctxt = gtk_object_get_data (obj, "todoconduit_context");
- e_todo_context_destroy (ctxt);
-
- gtk_object_destroy (obj);
-}
diff --git a/calendar/gui/.cvsignore b/calendar/gui/.cvsignore
deleted file mode 100644
index a2cee3711f..0000000000
--- a/calendar/gui/.cvsignore
+++ /dev/null
@@ -1,25 +0,0 @@
-Makefile.in
-Makefile
-.deps
-_libs
-.libs
-.pure
-evolution-calendar
-evolution-calendar.pure
-evolution-calendar.h
-evolution-calendar-common.c
-evolution-calendar-skels.c
-evolution-calendar-stubs.c
-e-calendar-marshal.h
-e-calendar-marshal.c
-*.lo
-Evolution-Addressbook-SelectNames-common.c
-Evolution-Addressbook-SelectNames-skels.c
-Evolution-Addressbook-SelectNames-stubs.c
-Evolution-Addressbook-SelectNames.h
-Evolution-Composer-common.c
-Evolution-Composer-skels.c
-Evolution-Composer-stubs.c
-Evolution-Composer.h
-GNOME_Evolution_Calendar*.server
-GNOME_Evolution_Calendar*.server.in
diff --git a/calendar/gui/GNOME_Evolution_Calendar.server.in.in b/calendar/gui/GNOME_Evolution_Calendar.server.in.in
deleted file mode 100644
index cee3a6a103..0000000000
--- a/calendar/gui/GNOME_Evolution_Calendar.server.in.in
+++ /dev/null
@@ -1,146 +0,0 @@
-<oaf_info>
-
-<oaf_server iid="OAFIID:GNOME_Evolution_Calendar_Factory:@VERSION@"
- type="shlib"
- location="@COMPONENTDIR@/libevolution-calendar.so">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/ObjectFactory:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="name" type="string"
- _value="Evolution Calendar and Tasks"/>
-
-</oaf_server>
-
-<oaf_server iid="OAFIID:GNOME_Evolution_Calendar_iTip_Control:@VERSION@"
- type="factory"
- location="OAFIID:GNOME_Evolution_Calendar_Factory:@VERSION@">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:Bonobo/Control:1.0"/>
- <item value="IDL:Bonobo/PersistStream:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="bonobo:supported_mime_types" type="stringv">
- <item value="text/calendar"/>
- <item value="text/x-calendar"/>
- </oaf_attribute>
-
- <oaf_attribute name="name" type="string"
- _value="Evolution Calendar scheduling message viewer"/>
-</oaf_server>
-
-<oaf_server iid="OAFIID:GNOME_Evolution_Calendar_Component:@VERSION@"
- type="factory"
- location="OAFIID:GNOME_Evolution_Calendar_Factory:@VERSION@">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/Evolution/Component:@VERSION@"/>
- </oaf_attribute>
-
- <oaf_attribute name="evolution:component_alias" type="string" value="calendar"/>
-
- <oaf_attribute name="name" type="string" _value="Evolution's Calendar component"/>
-
- <oaf_attribute name="evolution:button_label" type="string" _value="Calendars"/>
- <oaf_attribute name="evolution:button_icon" type="string" value="evolution-calendar.png"/>
- <oaf_attribute name="evolution:button_sort_order" type="string" value="-8"/>
-</oaf_server>
-
-<oaf_server iid="OAFIID:GNOME_Evolution_Calendar_Control:@VERSION@"
- type="factory"
- location="OAFIID:GNOME_Evolution_Calendar_Factory:@VERSION@">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:BonoboControl/calendar-control:@VERSION@"/>
- <item value="IDL:Bonobo/Control:1.0"/>
- <item value="IDL:Bonobo/PropertyBag:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="bonobo:supported_mime_types" type="stringv">
- <item value="text/calendar"/>
- </oaf_attribute>
-
- <oaf_attribute name="name" type="string"
- _value="Evolution Calendar viewer"/>
-</oaf_server>
-
-<oaf_server iid="OAFIID:GNOME_Evolution_Tasks_Component:@VERSION@"
- type="factory"
- location="OAFIID:GNOME_Evolution_Calendar_Factory:@VERSION@">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/Evolution/Component:@VERSION@"/>
- </oaf_attribute>
-
- <oaf_attribute name="evolution:component_alias" type="string" value="tasks"/>
-
- <oaf_attribute name="name" type="string" _value="Evolution's Tasks component"/>
-
- <oaf_attribute name="evolution:button_label" type="string" _value="Tasks"/>
- <oaf_attribute name="evolution:button_icon" type="string" value="evolution-tasks.png"/>
- <oaf_attribute name="evolution:button_sort_order" type="string" value="-8"/>
-</oaf_server>
-
-<oaf_server iid="OAFIID:GNOME_Evolution_Tasks_Control:@VERSION@"
- type="factory"
- location="OAFIID:GNOME_Evolution_Calendar_Factory:@VERSION@">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:BonoboControl/tasks-control:@VERSION@"/>
- <item value="IDL:Bonobo/Control:1.0"/>
- <item value="IDL:Bonobo/PropertyBag:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="bonobo:supported_mime_types" type="stringv">
- <item value="text/calendar"/>
- </oaf_attribute>
-
- <oaf_attribute name="name" type="string"
- _value="Evolution Tasks viewer"/>
-</oaf_server>
-
-<oaf_server iid="OAFIID:GNOME_Evolution_Calendar_CompEditorFactory:@VERSION@"
- type="factory"
- location="OAFIID:GNOME_Evolution_Calendar_Factory:@VERSION@">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/Evolution/Calendar/CompEditorFactory:@VERSION@"/>
- <item value="IDL:Bonobo/Unknown:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="name" type="string"
- _value="Evolution Calendar/Task editor"/>
-</oaf_server>
-
-<oaf_server iid="OAFIID:GNOME_Evolution_Calendar_ConfigControl:@VERSION@"
- type="factory"
- location="OAFIID:GNOME_Evolution_Calendar_Factory:@VERSION@">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/Evolution/ConfigControl:@VERSION@"/>
- </oaf_attribute>
-
- <oaf_attribute name="evolution2:config_item:title" type="string"
- _value="Calendar and Tasks"/>
-
- <oaf_attribute name="evolution2:config_item:description" type="string"
- _value="Configure your timezone, Calendar and Task List here "/>
-
- <oaf_attribute name="evolution2:config_item:icon_name" type="string"
- value="evolution-calendar.png"/>
-
- <oaf_attribute name="evolution2:config_item:type" type="stringv">
- <item value="calendar"/>
- <item value="tasks"/>
- </oaf_attribute>
-
- <oaf_attribute name="evolution2:config_item:priority" type="string" value="-7"/>
-
- <oaf_attribute name="name" type="string"
- _value="Evolution Calendar configuration control"/>
-
-</oaf_server>
-
-</oaf_info>
diff --git a/calendar/gui/Makefile.am b/calendar/gui/Makefile.am
deleted file mode 100644
index bdb5f454fa..0000000000
--- a/calendar/gui/Makefile.am
+++ /dev/null
@@ -1,261 +0,0 @@
-## CORBA stuff
-
-IDLS = \
- $(top_srcdir)/composer/Evolution-Composer.idl \
- $(top_srcdir)/calendar/idl/evolution-calendar.idl \
- $(top_srcdir)/addressbook/gui/component/select-names/Evolution-Addressbook-SelectNames.idl
-
-CALENDAR_IDL_GENERATED_H = \
- evolution-calendar.h
-CALENDAR_IDL_GENERATED_C = \
- evolution-calendar-common.c \
- evolution-calendar-skels.c \
- evolution-calendar-stubs.c
-CALENDAR_IDL_GENERATED = $(CALENDAR_IDL_GENERATED_C) $(CALENDAR_IDL_GENERATED_H)
-
-$(CALENDAR_IDL_GENERATED_H): $(IDLS)
- $(ORBIT_IDL) -I $(srcdir) $(IDL_INCLUDES) \
- $(top_srcdir)/calendar/idl/evolution-calendar.idl
-$(CALENDAR_IDL_GENERATED_C): $(CALENDAR_IDL_GENERATED_H)
-
-# Message composer IDL files
-
-COMPOSER_IDL_GENERATED_H = \
- Evolution-Composer.h
-COMPOSER_IDL_GENERATED_C = \
- Evolution-Composer-common.c \
- Evolution-Composer-skels.c \
- Evolution-Composer-stubs.c
-COMPOSER_IDL_GENERATED = $(COMPOSER_IDL_GENERATED_C) $(COMPOSER_IDL_GENERATED_H)
-
-$(COMPOSER_IDL_GENERATED_H): $(IDLS)
- $(ORBIT_IDL) -I $(srcdir) $(IDL_INCLUDES) \
- $(srcdir)/../../composer/Evolution-Composer.idl
-$(COMPOSER_IDL_GENERATED_C): $(COMPOSER_IDL_GENERATED_H)
-
-# SelectNames IDL files
-
-SELECT_NAMES_IDL_GENERATED_H = \
- Evolution-Addressbook-SelectNames.h
-SELECT_NAMES_IDL_GENERATED_C = \
- Evolution-Addressbook-SelectNames-common.c \
- Evolution-Addressbook-SelectNames-skels.c \
- Evolution-Addressbook-SelectNames-stubs.c
-SELECT_NAMES_IDL_GENERATED = $(SELECT_NAMES_IDL_GENERATED_C) $(SELECT_NAMES_IDL_GENERATED_H)
-
-$(SELECT_NAMES_IDL_GENERATED_H): $(IDLS)
- $(ORBIT_IDL) -I $(srcdir) $(IDL_INCLUDES) \
- $(top_srcdir)/addressbook/gui/component/select-names/Evolution-Addressbook-SelectNames.idl
-$(SELECT_NAMES_IDL_GENERATED_C): $(SELECT_NAMES_IDL_GENERATED_H)
-
-
-IDL_GENERATED = $(CALENDAR_IDL_GENERATED) $(COMPOSER_IDL_GENERATED) $(SELECT_NAMES_IDL_GENERATED)
-
-# The marshallers
-MARSHAL_GENERATED = e-calendar-marshal.c e-calendar-marshal.h
-@EVO_MARSHAL_RULE@
-
-SUBDIRS = alarm-notify dialogs
-
-component_LTLIBRARIES = libevolution-calendar.la
-
-INCLUDES = \
- -DG_LOG_DOMAIN=\"calendar-gui\" \
- -I$(top_builddir)/shell \
- -I$(top_srcdir)/shell \
- -I$(top_srcdir) \
- -I$(top_srcdir)/calendar \
- -I$(top_srcdir)/calendar/cal-client \
- -I$(top_builddir)/calendar/cal-client \
- -I$(top_srcdir)/widgets \
- -I$(top_srcdir)/a11y/calendar \
- -DEVOLUTION_DATADIR=\""$(datadir)"\" \
- -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \
- -DEVOLUTION_ETSPECDIR=\""$(etspecdir)"\" \
- -DEVOLUTION_IMAGESDIR=\""$(imagesdir)"\" \
- -DEVOLUTION_GALVIEWSDIR=\""$(viewsdir)"\" \
- -DEVOLUTION_UIDIR=\""$(evolutionuidir)"\" \
- -DPREFIX=\""$(prefix)"\" \
- $(EVOLUTION_CALENDAR_CFLAGS)
-
-glade_DATA = \
- e-itip-control.glade \
- goto-dialog.glade
-
-etspec_DATA = \
- e-calendar-table.etspec \
- e-meeting-time-sel.etspec \
- e-cal-list-view.etspec
-
-libevolution_calendar_la_SOURCES = \
- $(IDL_GENERATED) \
- $(MARSHAL_GENERATED) \
- cal-search-bar.c \
- cal-search-bar.h \
- calendar-config.c \
- calendar-config.h \
- calendar-config-keys.h \
- calendar-commands.c \
- calendar-commands.h \
- calendar-component.c \
- calendar-component.h \
- calendar-offline-handler.c \
- calendar-offline-handler.h \
- calendar-view.c \
- calendar-view.h \
- calendar-view-factory.c \
- calendar-view-factory.h \
- comp-editor-factory.c \
- comp-editor-factory.h \
- comp-util.c \
- comp-util.h \
- control-factory.c \
- control-factory.h \
- e-alarm-list.c \
- e-alarm-list.h \
- e-cal-model-calendar.c \
- e-cal-model-calendar.h \
- e-cal-model-tasks.c \
- e-cal-model-tasks.h \
- e-cal-model.c \
- e-cal-model.h \
- e-cal-view.c \
- e-cal-view.h \
- e-cal-list-view.c \
- e-cal-list-view.h \
- e-cal-list-view-config.c \
- e-cal-list-view-config.h \
- e-calendar-table.c \
- e-calendar-table.h \
- e-calendar-table-config.c \
- e-calendar-table-config.h \
- e-cell-date-edit-config.c \
- e-cell-date-edit-config.h \
- e-cell-date-edit-text.h \
- e-cell-date-edit-text.c \
- e-comp-editor-registry.c \
- e-comp-editor-registry.h \
- e-date-edit-config.c \
- e-date-edit-config.h \
- e-date-time-list.c \
- e-date-time-list.h \
- e-day-view-config.c \
- e-day-view-config.h \
- e-day-view-layout.c \
- e-day-view-layout.h \
- e-day-view-main-item.c \
- e-day-view-main-item.h \
- e-day-view-time-item.c \
- e-day-view-time-item.h \
- e-day-view-top-item.c \
- e-day-view-top-item.h \
- e-day-view.c \
- e-day-view.h \
- e-itip-control.h \
- e-itip-control.c \
- e-meeting-attendee.c \
- e-meeting-attendee.h \
- e-meeting-list-view.c \
- e-meeting-list-view.h \
- e-meeting-store.c \
- e-meeting-store.h \
- e-meeting-time-sel.c \
- e-meeting-time-sel.h \
- e-meeting-time-sel-item.c \
- e-meeting-time-sel-item.h \
- e-meeting-types.h \
- e-meeting-utils.c \
- e-meeting-utils.h \
- e-mini-calendar-config.c \
- e-mini-calendar-config.h \
- e-select-names-editable.c \
- e-select-names-editable.h \
- e-select-names-renderer.c \
- e-select-names-renderer.h \
- e-week-view-config.c \
- e-week-view-config.h \
- e-week-view-event-item.c \
- e-week-view-event-item.h \
- e-week-view-layout.c \
- e-week-view-layout.h \
- e-week-view-main-item.c \
- e-week-view-main-item.h \
- e-week-view-titles-item.c \
- e-week-view-titles-item.h \
- e-week-view.c \
- e-week-view.h \
- e-tasks.c \
- e-tasks.h \
- e-timezone-entry.c \
- e-timezone-entry.h \
- gnome-cal.c \
- gnome-cal.h \
- goto.c \
- goto.h \
- itip-bonobo-control.c \
- itip-bonobo-control.h \
- itip-utils.c \
- itip-utils.h \
- main.c \
- migration.c \
- migration.h \
- misc.c \
- misc.h \
- print.c \
- print.h \
- tag-calendar.c \
- tag-calendar.h \
- tasks-component.c \
- tasks-component.h \
- tasks-control.c \
- tasks-control.h \
- weekday-picker.c \
- weekday-picker.h
-
-libevolution_calendar_la_LIBADD = \
- $(top_builddir)/widgets/menus/libmenus.la \
- $(top_builddir)/shell/libeshell.la \
- $(top_builddir)/calendar/gui/dialogs/libcal-dialogs.la \
- $(top_builddir)/widgets/e-timezone-dialog/libetimezonedialog.la \
- $(top_builddir)/widgets/misc/libemiscwidgets.la \
- $(top_builddir)/e-util/libeutil.la \
- $(top_builddir)/a11y/calendar/libevolution-calendar-a11y.la \
- $(EVOLUTION_CALENDAR_LIBS)
-
-libevolution_calendar_la_LDFLAGS = -avoid-version -module
-
-server_in_files = GNOME_Evolution_Calendar.server.in.in
-server_DATA = $(server_in_files:.server.in.in=_$(BASE_VERSION).server)
-@EVO_SERVER_RULE@
-@INTLTOOL_SERVER_RULE@
-
-# GConf schemas
-
-schemadir = $(GCONF_SCHEMA_FILE_DIR)
-schema_in_files = apps_evolution_calendar.schemas.in.in
-schema_DATA = $(schema_in_files:.schemas.in.in=-$(BASE_VERSION).schemas)
-%-$(BASE_VERSION).schemas.in: %.schemas.in.in
- cp $< $@
-
-@INTLTOOL_SCHEMAS_RULE@
-
-EXTRA_DIST = \
- e-calendar-marshal.list \
- $(glade_DATA) \
- $(schema_DATA) \
- $(etspec_DATA) \
- $(server_in_files)
-
-BUILT_SOURCES = $(IDL_GENERATED) $(server_DATA)
-CLEANFILES = $(BUILT_SOURCES)
-
-install-data-local:
- $(mkinstalldirs) $(Conduitsdir); \
- if test -z "$(DESTDIR)"; then \
- for p in $(schema_DATA); do \
- GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(srcdir)/$$p; \
- done; \
- fi
-
-dist-hook:
- cd $(distdir); rm -f $(BUILT_SOURCES)
diff --git a/calendar/gui/alarm-notify/.cvsignore b/calendar/gui/alarm-notify/.cvsignore
deleted file mode 100644
index d940a07146..0000000000
--- a/calendar/gui/alarm-notify/.cvsignore
+++ /dev/null
@@ -1,12 +0,0 @@
-.deps
-.libs
-.pure
-Makefile
-Makefile.in
-evolution-calendar-stubs.c
-evolution-calendar-skels.c
-evolution-calendar-common.c
-evolution-calendar.h
-evolution-alarm-notify
-GNOME_Evolution_Calendar_AlarmNotify*.server
-GNOME_Evolution_Calendar_AlarmNotify*.server.in
diff --git a/calendar/gui/alarm-notify/GNOME_Evolution_Calendar_AlarmNotify.server.in.in b/calendar/gui/alarm-notify/GNOME_Evolution_Calendar_AlarmNotify.server.in.in
deleted file mode 100644
index 3c43c4ca54..0000000000
--- a/calendar/gui/alarm-notify/GNOME_Evolution_Calendar_AlarmNotify.server.in.in
+++ /dev/null
@@ -1,16 +0,0 @@
-<oaf_info>
-
-<oaf_server iid="OAFIID:GNOME_Evolution_Calendar_AlarmNotify:@VERSION@"
- type="exe"
- location="@LIBEXECDIR@/evolution-alarm-notify">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/ObjectFactory:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="name" type="string"
- _value="Evolution Calendar alarm notification service"/>
-
-</oaf_server>
-
-</oaf_info>
diff --git a/calendar/gui/alarm-notify/Makefile.am b/calendar/gui/alarm-notify/Makefile.am
deleted file mode 100644
index e5653e4433..0000000000
--- a/calendar/gui/alarm-notify/Makefile.am
+++ /dev/null
@@ -1,67 +0,0 @@
-CORBA_GENERATED_H = \
- evolution-calendar.h
-CORBA_GENERATED_C = \
- evolution-calendar-common.c \
- evolution-calendar-skels.c \
- evolution-calendar-stubs.c
-CORBA_GENERATED = $(CORBA_GENERATED_C) $(CORBA_GENERATED_H)
-
-idls = $(top_srcdir)/calendar/idl/evolution-calendar.idl
-idl_flags = $(IDL_INCLUDES)
-
-$(CORBA_GENERATED_H): $(idls)
- $(ORBIT_IDL) $(idl_flags) $(top_srcdir)/calendar/idl/evolution-calendar.idl
-$(CORBA_GENERATED_C): $(CORBA_GENERATED_H)
-
-
-privlibexec_PROGRAMS = evolution-alarm-notify
-
-
-INCLUDES = \
- -DG_LOG_DOMAIN=\"evolution-alarm-notify\" \
- -I$(top_srcdir) \
- -I$(top_srcdir)/widgets \
- -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \
- -DEVOLUTION_IMAGESDIR=\""$(imagesdir)"\" \
- -DEVOLUTION_LOCALEDIR=\""$(localedir)"\" \
- $(EVOLUTION_CALENDAR_CFLAGS)
-
-glade_DATA = \
- alarm-notify.glade
-
-evolution_alarm_notify_SOURCES = \
- $(CORBA_GENERATED) \
- 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 \
- save.c \
- save.h \
- util.c \
- util.h
-
-evolution_alarm_notify_LDADD = \
- $(top_builddir)/e-util/libeutil.la \
- $(EVOLUTION_CALENDAR_LIBS)
-
-server_in_files = GNOME_Evolution_Calendar_AlarmNotify.server.in.in
-server_DATA = $(server_in_files:.server.in.in=_$(BASE_VERSION).server)
-@EVO_SERVER_RULE@
-@INTLTOOL_SERVER_RULE@
-
-EXTRA_DIST = \
- $(server_in_files) \
- $(glade_DATA)
-
-BUILT_SOURCES = $(CORBA_GENERATED) $(server_DATA)
-CLEANFILES = $(BUILT_SOURCES)
-
-dist-hook:
- cd $(distdir); rm -f $(BUILT_SOURCES)
diff --git a/calendar/gui/alarm-notify/alarm-notify-dialog.c b/calendar/gui/alarm-notify/alarm-notify-dialog.c
deleted file mode 100644
index e7c87c2156..0000000000
--- a/calendar/gui/alarm-notify/alarm-notify-dialog.c
+++ /dev/null
@@ -1,394 +0,0 @@
-/* Evolution calendar - alarm notification dialog
- *
- * Copyright (C) 2000 Ximian, Inc.
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Author: Federico Mena-Quintero <federico@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-#include <stdio.h>
-#include <string.h>
-#include <gtk/gtklabel.h>
-#include <gtk/gtkspinbutton.h>
-#include <gtk/gtksignal.h>
-#include <gtk/gtkscrolledwindow.h>
-#include <gtk/gtkwindow.h>
-#include <libgnome/gnome-i18n.h>
-#if 0
-# include <libgnomeui/gnome-winhints.h>
-#endif
-#include <libgnomeui/gnome-window-icon.h>
-#include <glade/glade.h>
-#include <e-util/e-time-utils.h>
-#include <gtkhtml/gtkhtml.h>
-#include <gtkhtml/gtkhtml-stream.h>
-#include <libecal/e-cal-time-util.h>
-#include "alarm-notify-dialog.h"
-#include "config-data.h"
-#include "util.h"
-
-
-GtkWidget *make_html_display (gchar *widget_name, char *s1, char *s2, int scroll, int shadow);
-
-/* The useful contents of the alarm notify dialog */
-typedef struct {
- GladeXML *xml;
-
- GtkWidget *dialog;
- GtkWidget *close;
- GtkWidget *snooze;
- GtkWidget *edit;
- GtkWidget *snooze_time;
- GtkWidget *html;
-
- AlarmNotifyFunc func;
- gpointer func_data;
-} AlarmNotify;
-
-
-
-/* Callback used when the notify dialog is destroyed */
-static void
-dialog_destroy_cb (GtkObject *object, gpointer data)
-{
- AlarmNotify *an;
-
- an = data;
- g_object_unref (an->xml);
- g_free (an);
-}
-
-/* Delete_event handler for the alarm notify dialog */
-static gint
-delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer data)
-{
- AlarmNotify *an;
-
- an = data;
- g_assert (an->func != NULL);
-
- (* an->func) (ALARM_NOTIFY_CLOSE, -1, an->func_data);
-
- gtk_widget_destroy (widget);
- return TRUE;
-}
-
-/* Callback for the close button */
-static void
-close_clicked_cb (GtkWidget *widget, gpointer data)
-{
- AlarmNotify *an;
-
- an = data;
- g_assert (an->func != NULL);
-
- (* an->func) (ALARM_NOTIFY_CLOSE, -1, an->func_data);
-
- gtk_widget_destroy (an->dialog);
-}
-
-/* Callback for the snooze button */
-static void
-snooze_clicked_cb (GtkWidget *widget, gpointer data)
-{
- AlarmNotify *an;
- int snooze_time;
-
- an = data;
- g_assert (an->func != NULL);
-
- snooze_time = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (an->snooze_time));
- (* an->func) (ALARM_NOTIFY_SNOOZE, snooze_time, an->func_data);
-
- gtk_widget_destroy (an->dialog);
-}
-
-/* Callback for the edit button */
-static void
-edit_clicked_cb (GtkWidget *widget, gpointer data)
-{
- AlarmNotify *an;
-
- an = data;
- g_assert (an->func != NULL);
-
- (* an->func) (ALARM_NOTIFY_EDIT, -1, an->func_data);
-
- gtk_widget_destroy (an->dialog);
-}
-
-static void
-url_requested_cb (GtkHTML *html, const char *url, GtkHTMLStream *stream, gpointer data)
-{
-
- if (!strncmp ("file:///", url, strlen ("file:///"))) {
- FILE *fp;
- const char *filename = url + strlen ("file://");
- char buf[4096];
- size_t len;
-
- fp = fopen (filename, "r");
-
- if (fp == NULL) {
- g_warning ("Error opening image: %s\n", url);
- gtk_html_stream_close (stream, GTK_HTML_STREAM_ERROR);
- return;
- }
-
- while ((len = fread (buf, 1, sizeof(buf), fp)) > 0)
- gtk_html_stream_write (stream, buf, len);
-
- if (feof (fp)) {
- fclose (fp);
- gtk_html_stream_close (stream, GTK_HTML_STREAM_OK);
- return;
- }
-
- fclose (fp);
- }
-
- g_warning ("Error loading image");
- gtk_html_stream_close (stream, GTK_HTML_STREAM_ERROR);
- return;
-}
-
-GtkWidget *
-make_html_display (gchar *widget_name, char *s1, char *s2, int scroll, int shadow)
-{
- GtkWidget *html, *scrolled_window;
-
- gtk_widget_push_colormap (gdk_rgb_get_colormap ());
-
- html = gtk_html_new();
-
- gtk_html_set_default_content_type (GTK_HTML (html),
- "charset=utf-8");
- gtk_html_load_empty (GTK_HTML (html));
-
- g_signal_connect (html, "url_requested",
- G_CALLBACK (url_requested_cb),
- NULL);
-
- gtk_widget_pop_colormap();
-
- scrolled_window = gtk_scrolled_window_new(NULL, NULL);
-
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled_window),
- GTK_POLICY_AUTOMATIC,
- GTK_POLICY_AUTOMATIC);
-
-
- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window),
- GTK_SHADOW_IN);
-
- gtk_widget_set_size_request (scrolled_window, 300, 200);
-
- gtk_container_add(GTK_CONTAINER (scrolled_window), html);
-
- gtk_widget_show_all(scrolled_window);
-
- g_object_set_data (G_OBJECT (scrolled_window), "html", html);
- return scrolled_window;
-}
-
-static void
-write_times (GtkHTMLStream *stream, char *start, char *end)
-{
- if (start)
- gtk_html_stream_printf (stream, "<b>%s</b> %s<br>", _("Starting:"), start);
- if (end)
- gtk_html_stream_printf (stream, "<b>%s</b> %s<br>", _("Ending:"), end);
-
-}
-
-/* Creates a heading for the alarm notification dialog */
-static void
-write_html_heading (GtkHTMLStream *stream, const char *message,
- ECalComponentVType vtype, time_t occur_start, time_t occur_end)
-{
- char *buf;
- char *start, *end;
- char *bg_path = "file://" EVOLUTION_IMAGESDIR "/bcg.png";
- char *image_path = "file://" EVOLUTION_IMAGESDIR "/alarm.png";
- icaltimezone *current_zone;
-
- /* Stringize the times */
-
- current_zone = config_data_get_timezone ();
-
- buf = timet_to_str_with_zone (occur_start, current_zone);
- start = g_locale_to_utf8 (buf, -1, NULL, NULL, NULL);
- g_free (buf);
-
- buf = timet_to_str_with_zone (occur_end, current_zone);
- end = g_locale_to_utf8 (buf, -1, NULL, NULL, NULL);
- g_free (buf);
-
- /* Write the header */
-
- gtk_html_stream_printf (stream,
- "<HTML><BODY background=\"%s\">"
- "<TABLE WIDTH=\"100%%\">"
- "<TR>"
- "<TD><IMG SRC=\"%s\" ALIGN=\"top\" BORDER=\"0\"></TD>"
- "<TD><H1>%s</H1></TD>"
- "</TR>"
- "</TABLE>",
- bg_path,
- image_path,
- _("Evolution Alarm"));
-
- gtk_html_stream_printf (stream, "<br><br><font size=\"+2\">%s</font><br><br>", message);
-
- /* Write the times */
-
- switch (vtype) {
- case E_CAL_COMPONENT_EVENT:
- write_times (stream, start, end);
- break;
-
- case E_CAL_COMPONENT_TODO:
- write_times (stream, start, end);
- break;
-
- default:
- /* Only VEVENTs and VTODOs can have alarms */
- g_assert_not_reached ();
- break;
- }
-
- g_free (start);
- g_free (end);
-}
-
-/**
- * alarm_notify_dialog:
- * @trigger: Trigger time for the alarm.
- * @occur_start: Start of occurrence time for the event.
- * @occur_end: End of occurrence time for the event.
- * @vtype: Type of the component which corresponds to the alarm.
- * @message; Message to display in the dialog; usually comes from the component.
- * @func: Function to be called when a dialog action is invoked.
- * @func_data: Closure data for @func.
- *
- * Runs the alarm notification dialog. The specified @func will be used to
- * notify the client about result of the actions in the dialog.
- *
- * Return value: a pointer to the dialog structure if successful or NULL if an error occurs.
- **/
-gpointer
-alarm_notify_dialog (time_t trigger, time_t occur_start, time_t occur_end,
- ECalComponentVType vtype, const char *message,
- AlarmNotifyFunc func, gpointer func_data)
-{
- AlarmNotify *an;
- GtkHTMLStream *stream;
- icaltimezone *current_zone;
- char *buf, *title;
-
- g_return_val_if_fail (trigger != -1, NULL);
-
- /* Only VEVENTs or VTODOs can have alarms */
- g_return_val_if_fail (vtype == E_CAL_COMPONENT_EVENT || vtype == E_CAL_COMPONENT_TODO, NULL);
- g_return_val_if_fail (message != NULL, NULL);
- g_return_val_if_fail (func != NULL, NULL);
-
- an = g_new0 (AlarmNotify, 1);
-
- an->func = func;
- an->func_data = func_data;
-
- an->xml = glade_xml_new (EVOLUTION_GLADEDIR "/alarm-notify.glade", NULL, NULL);
- if (!an->xml) {
- g_message ("alarm_notify_dialog(): Could not load the Glade XML file!");
- g_free (an);
- return NULL;
- }
-
- an->dialog = glade_xml_get_widget (an->xml, "alarm-notify");
- an->close = glade_xml_get_widget (an->xml, "close");
- an->snooze = glade_xml_get_widget (an->xml, "snooze");
- an->edit = glade_xml_get_widget (an->xml, "edit");
- an->snooze_time = glade_xml_get_widget (an->xml, "snooze-time");
- an->html = g_object_get_data (G_OBJECT (glade_xml_get_widget (an->xml, "frame")), "html");
-
- if (!(an->dialog && an->close && an->snooze && an->edit
- && an->snooze_time)) {
- g_message ("alarm_notify_dialog(): Could not find all widgets in Glade file!");
- g_object_unref (an->xml);
- g_free (an);
- return NULL;
- }
-
- g_signal_connect (G_OBJECT (an->dialog), "destroy",
- G_CALLBACK (dialog_destroy_cb),
- an);
-
- /* Title */
-
- current_zone = config_data_get_timezone ();
-
- buf = timet_to_str_with_zone (trigger, current_zone);
- title = g_strdup_printf (_("Alarm on %s"), buf);
- g_free (buf);
-
- gtk_window_set_title (GTK_WINDOW (an->dialog), title);
- g_free (title);
-
- /* html heading */
- stream = gtk_html_begin (GTK_HTML (an->html));
- write_html_heading (stream, message, vtype, occur_start, occur_end);
- gtk_html_stream_close (stream, GTK_HTML_STREAM_OK);
-
- /* Connect actions */
-
- g_signal_connect (an->dialog, "delete_event",
- G_CALLBACK (delete_event_cb),
- an);
-
- g_signal_connect (an->close, "clicked",
- G_CALLBACK (close_clicked_cb),
- an);
-
- g_signal_connect (an->snooze, "clicked",
- G_CALLBACK (snooze_clicked_cb),
- an);
-
- g_signal_connect (an->edit, "clicked",
- G_CALLBACK (edit_clicked_cb),
- an);
-
- /* Run! */
-
- if (!GTK_WIDGET_REALIZED (an->dialog))
- gtk_widget_realize (an->dialog);
-
- gtk_window_stick (GTK_WINDOW (an->dialog));
- gtk_window_set_icon_from_file (GTK_WINDOW (an->dialog), EVOLUTION_IMAGESDIR "/alarm.png", NULL);
-
- gtk_widget_show (an->dialog);
- return an;
-}
-
-void
-alarm_notify_dialog_disable_buttons (gpointer dialog)
-{
- AlarmNotify *an = dialog;
-
- gtk_widget_set_sensitive (an->snooze, FALSE);
- gtk_widget_set_sensitive (an->edit, FALSE);
-}
diff --git a/calendar/gui/alarm-notify/alarm-notify-dialog.h b/calendar/gui/alarm-notify/alarm-notify-dialog.h
deleted file mode 100644
index 9bebce0a08..0000000000
--- a/calendar/gui/alarm-notify/alarm-notify-dialog.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Evolution calendar - alarm notification dialog
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Author: Federico Mena-Quintero <federico@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef ALARM_NOTIFY_DIALOG_H
-#define ALARM_NOTIFY_DIALOG_H
-
-#include <time.h>
-#include <glib.h>
-#include <libecal/e-cal-component.h>
-
-
-
-typedef enum {
- ALARM_NOTIFY_CLOSE,
- ALARM_NOTIFY_SNOOZE,
- ALARM_NOTIFY_EDIT
-} AlarmNotifyResult;
-
-typedef void (* AlarmNotifyFunc) (AlarmNotifyResult result, int snooze_mins, gpointer data);
-
-gpointer alarm_notify_dialog (time_t trigger, time_t occur_start, time_t occur_end,
- ECalComponentVType vtype, const char *message,
- AlarmNotifyFunc func, gpointer func_data);
-void alarm_notify_dialog_disable_buttons (gpointer dialog);
-
-
-#endif
diff --git a/calendar/gui/alarm-notify/alarm-notify.c b/calendar/gui/alarm-notify/alarm-notify.c
deleted file mode 100644
index 9e7f1335a8..0000000000
--- a/calendar/gui/alarm-notify/alarm-notify.c
+++ /dev/null
@@ -1,200 +0,0 @@
-/* Evolution calendar - Alarm notification service object
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Author: Federico Mena-Quintero <federico@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <string.h>
-#include <libecal/e-cal.h>
-#include "alarm-notify.h"
-#include "alarm-queue.h"
-#include "save.h"
-#include "e-util/e-url.h"
-
-
-
-/* Private part of the AlarmNotify structure */
-struct _AlarmNotifyPrivate {
- /* Mapping from EUri's to LoadedClient structures */
- GHashTable *uri_client_hash;
-};
-
-
-
-static void alarm_notify_class_init (AlarmNotifyClass *klass);
-static void alarm_notify_init (AlarmNotify *an, AlarmNotifyClass *klass);
-static void alarm_notify_finalize (GObject *object);
-
-
-static BonoboObjectClass *parent_class;
-
-
-
-GType
-alarm_notify_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static GTypeInfo info = {
- sizeof (AlarmNotifyClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) alarm_notify_class_init,
- NULL, NULL,
- sizeof (AlarmNotify),
- 0,
- (GInstanceInitFunc) alarm_notify_init
- };
- type = g_type_register_static (G_TYPE_OBJECT, "AlarmNotify", &info, 0);
- }
-
- return type;
-}
-
-/* Class initialization function for the alarm notify service */
-static void
-alarm_notify_class_init (AlarmNotifyClass *klass)
-{
- GObjectClass *object_class;
-
- object_class = (GObjectClass *) klass;
-
- parent_class = g_type_class_peek_parent (klass);
-
- object_class->finalize = alarm_notify_finalize;
-}
-
-/* Object initialization function for the alarm notify system */
-static void
-alarm_notify_init (AlarmNotify *an, AlarmNotifyClass *klass)
-{
- AlarmNotifyPrivate *priv;
-
- priv = g_new0 (AlarmNotifyPrivate, 1);
- an->priv = priv;
-
- priv->uri_client_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref);
-}
-
-static void
-free_client_hash (gpointer key, gpointer value, gpointer user_data)
-{
- char *uri = key;
- ECal *client = value;
-
- g_free (uri);
- g_object_unref (client);
-}
-
-/* Finalize handler for the alarm notify system */
-static void
-alarm_notify_finalize (GObject *object)
-{
- AlarmNotify *an;
- AlarmNotifyPrivate *priv;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (IS_ALARM_NOTIFY (object));
-
- an = ALARM_NOTIFY (object);
- priv = an->priv;
-
- g_hash_table_foreach (priv->uri_client_hash, (GHFunc) free_client_hash, NULL);
- g_hash_table_destroy (priv->uri_client_hash);
-
- g_free (priv);
-
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
-}
-
-
-
-/**
- * alarm_notify_new:
- *
- * Creates a new #AlarmNotify object.
- *
- * Return value: A newly-created #AlarmNotify, or NULL if its corresponding
- * CORBA object could not be created.
- **/
-AlarmNotify *
-alarm_notify_new (void)
-{
- AlarmNotify *an;
-
- an = g_object_new (TYPE_ALARM_NOTIFY, NULL);
- return an;
-}
-
-/**
- * alarm_notify_add_calendar:
- * @an: An alarm notification service.
- * @uri: URI of the calendar to load.
- * @load_afterwards: Whether this calendar should be loaded in the future
- * when the alarm daemon starts up.
- *
- * Tells the alarm notification service to load a calendar and start monitoring
- * its alarms. It can optionally be made to save the URI of this calendar so
- * that it can be loaded in the future when the alarm daemon starts up.
- **/
-void
-alarm_notify_add_calendar (AlarmNotify *an, const char *str_uri, gboolean load_afterwards)
-{
- AlarmNotifyPrivate *priv;
- ECal *client;
-
- g_return_if_fail (an != NULL);
- g_return_if_fail (IS_ALARM_NOTIFY (an));
- g_return_if_fail (str_uri != NULL);
-
- priv = an->priv;
-
- /* See if we already know about this uri */
- if (g_hash_table_lookup (priv->uri_client_hash, str_uri))
- return;
-
- client = e_cal_new_from_uri (str_uri, CALOBJ_TYPE_EVENT);
-
- if (client) {
- if (e_cal_open (client, FALSE, NULL)) {
- g_hash_table_insert (priv->uri_client_hash,
- g_strdup (str_uri), client);
- }
- }
-}
-
-void
-alarm_notify_remove_calendar (AlarmNotify *an, const char *str_uri)
-{
- AlarmNotifyPrivate *priv;
- ECal *client;
-
- priv = an->priv;
-
- client = g_hash_table_lookup (priv->uri_client_hash, str_uri);
- if (client) {
- alarm_queue_remove_client (client);
-
- g_hash_table_remove (priv->uri_client_hash, str_uri);
- }
-}
diff --git a/calendar/gui/alarm-notify/alarm-notify.glade b/calendar/gui/alarm-notify/alarm-notify.glade
deleted file mode 100644
index bc0da43f22..0000000000
--- a/calendar/gui/alarm-notify/alarm-notify.glade
+++ /dev/null
@@ -1,189 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-
-<widget class="GtkWindow" id="alarm-notify">
- <property name="border_width">12</property>
- <property name="visible">True</property>
- <property name="title" translatable="yes"></property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
-
- <child>
- <widget class="GtkVBox" id="vbox2">
- <property name="border_width">4</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkHBox" id="hbox3">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkVBox" id="vbox5">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="Custom" id="frame">
- <property name="visible">True</property>
- <property name="creation_function">make_html_display</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Thu, 11 Oct 2001 08:19:04 GMT</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox4">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkButton" id="close">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">C_lose</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="snooze">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Snoo_ze</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="edit">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Edit appointment</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHSeparator" id="hseparator1">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox4">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label4">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Snooze time (minutes)</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkSpinButton" id="snooze-time">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">False</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">5 1 1440 1 5 5</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/calendar/gui/alarm-notify/alarm-notify.h b/calendar/gui/alarm-notify/alarm-notify.h
deleted file mode 100644
index 418ae23878..0000000000
--- a/calendar/gui/alarm-notify/alarm-notify.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Evolution calendar - Alarm notification service object
- *
- * Copyright (C) 2000 Ximian, Inc.
- * Copyright (C) 2000 Ximian, Inc.
- *
- * Author: Federico Mena-Quintero <federico@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef ALARM_NOTIFY_H
-#define ALARM_NOTIFY_H
-
-#include <glib-object.h>
-
-
-
-#define TYPE_ALARM_NOTIFY (alarm_notify_get_type ())
-#define ALARM_NOTIFY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ALARM_NOTIFY, AlarmNotify))
-#define ALARM_NOTIFY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ALARM_NOTIFY, \
- AlarmNotifyClass))
-#define IS_ALARM_NOTIFY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ALARM_NOTIFY))
-#define IS_ALARM_NOTIFY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ALARM_NOTIFY))
-
-typedef struct _AlarmNotify AlarmNotify;
-typedef struct _AlarmNotifyClass AlarmNotifyClass;
-
-typedef struct _AlarmNotifyPrivate AlarmNotifyPrivate;
-
-struct _AlarmNotify {
- GObject object;
-
- /* Private data */
- AlarmNotifyPrivate *priv;
-};
-
-struct _AlarmNotifyClass {
- GObjectClass parent_class;
-};
-
-GType alarm_notify_get_type (void);
-
-AlarmNotify *alarm_notify_new (void);
-
-void alarm_notify_add_calendar (AlarmNotify *an, const char *str_uri, gboolean load_afterwards);
-void alarm_notify_remove_calendar (AlarmNotify *an, const char *str_uri);
-
-
-
-
-#endif
diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c
deleted file mode 100644
index 2cf95f47b7..0000000000
--- a/calendar/gui/alarm-notify/alarm-queue.c
+++ /dev/null
@@ -1,1301 +0,0 @@
-/* Evolution calendar - Alarm queueing engine
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Authors: Federico Mena-Quintero <federico@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-#include <glib.h>
-#include <bonobo-activation/bonobo-activation.h>
-#include <bonobo/bonobo-object.h>
-#include <gtk/gtksignal.h>
-#include <gtk/gtkbox.h>
-#include <gtk/gtkdialog.h>
-#include <gtk/gtkeventbox.h>
-#include <gtk/gtkimage.h>
-#include <gtk/gtklabel.h>
-#include <gtk/gtkcheckbutton.h>
-#include <gtk/gtkstock.h>
-#include <gtk/gtktooltips.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnome/gnome-exec.h>
-#include <libgnome/gnome-sound.h>
-#include <libgnomeui/gnome-dialog-util.h>
-#include <libgnomeui/gnome-uidefs.h>
-#include <e-util/eggtrayicon.h>
-#include <libecal/e-cal-time-util.h>
-#include "evolution-calendar.h"
-#include "alarm.h"
-#include "alarm-notify-dialog.h"
-#include "alarm-queue.h"
-#include "config-data.h"
-#include "save.h"
-#include "util.h"
-
-
-
-/* Whether the queueing system has been initialized */
-static gboolean alarm_queue_inited;
-
-/* When the alarm queue system is inited, this gets set to the last time an
- * alarm notification was issued. This lets us present any notifications that
- * should have happened while the alarm daemon was not running.
- */
-static time_t saved_notification_time;
-
-/* Clients we are monitoring for alarms */
-static GHashTable *client_alarms_hash = NULL;
-
-/* Structure that stores a client we are monitoring */
-typedef struct {
- /* Monitored client */
- ECal *client;
-
- /* Number of times this client has been registered */
- int refcount;
-
- /* Hash table of component UID -> CompQueuedAlarms. If an element is
- * present here, then it means its cqa->queued_alarms contains at least
- * one queued alarm. When all the alarms for a component have been
- * dequeued, the CompQueuedAlarms structure is removed from the hash
- * table. Thus a CQA exists <=> it has queued alarms.
- */
- GHashTable *uid_alarms_hash;
-} ClientAlarms;
-
-/* Pair of a ECalComponentAlarms and the mapping from queued alarm IDs to the
- * actual alarm instance structures.
- */
-typedef struct {
- /* The parent client alarms structure */
- ClientAlarms *parent_client;
-
- /* The component's UID */
- char *uid;
-
- /* The actual component and its alarm instances */
- ECalComponentAlarms *alarms;
-
- /* List of QueuedAlarm structures */
- GSList *queued_alarms;
-
- /* Flags */
- gboolean expecting_update;
-} CompQueuedAlarms;
-
-/* Pair of a queued alarm ID and the alarm trigger instance it refers to */
-typedef struct {
- /* Alarm ID from alarm.h */
- gpointer alarm_id;
-
- /* Instance from our parent CompQueuedAlarms->alarms->alarms list */
- ECalComponentAlarmInstance *instance;
-
- /* Whether this is a snoozed queued alarm or a normal one */
- guint snooze : 1;
-} QueuedAlarm;
-
-/* Alarm ID for the midnight refresh function */
-static gpointer midnight_refresh_id = NULL;
-
-static void display_notification (time_t trigger, CompQueuedAlarms *cqa,
- gpointer alarm_id, gboolean use_description);
-static void audio_notification (time_t trigger, CompQueuedAlarms *cqa, gpointer alarm_id);
-static void mail_notification (time_t trigger, CompQueuedAlarms *cqa, gpointer alarm_id);
-static void procedure_notification (time_t trigger, CompQueuedAlarms *cqa, gpointer alarm_id);
-
-
-
-/* Alarm queue engine */
-
-static void load_alarms_for_today (ClientAlarms *ca);
-static void midnight_refresh_cb (gpointer alarm_id, time_t trigger, gpointer data);
-
-/* Queues an alarm trigger for midnight so that we can load the next day's worth
- * of alarms.
- */
-static void
-queue_midnight_refresh (void)
-{
- time_t midnight;
- icaltimezone *zone;
-
- g_assert (midnight_refresh_id == NULL);
-
- zone = config_data_get_timezone ();
-
- midnight = time_day_end_with_zone (time (NULL), zone);
-
- midnight_refresh_id = alarm_add (midnight, midnight_refresh_cb, NULL, NULL);
- if (!midnight_refresh_id) {
- g_message ("queue_midnight_refresh(): Could not set up the midnight refresh alarm!");
- /* FIXME: what to do? */
- }
-}
-
-/* Loads a client's alarms; called from g_hash_table_foreach() */
-static void
-add_client_alarms_cb (gpointer key, gpointer value, gpointer data)
-{
- ClientAlarms *ca;
-
- ca = value;
- load_alarms_for_today (ca);
-}
-
-/* Loads the alarms for the new day every midnight */
-static void
-midnight_refresh_cb (gpointer alarm_id, time_t trigger, gpointer data)
-{
- /* Re-load the alarms for all clients */
-
- g_hash_table_foreach (client_alarms_hash, add_client_alarms_cb, NULL);
-
- /* Re-schedule the midnight update */
-
- midnight_refresh_id = NULL;
- queue_midnight_refresh ();
-}
-
-/* Looks up a client in the client alarms hash table */
-static ClientAlarms *
-lookup_client (ECal *client)
-{
- return g_hash_table_lookup (client_alarms_hash, client);
-}
-
-/* Looks up a queued alarm based on its alarm ID */
-static QueuedAlarm *
-lookup_queued_alarm (CompQueuedAlarms *cqa, gpointer alarm_id)
-{
- GSList *l;
- QueuedAlarm *qa;
-
- qa = NULL;
-
- for (l = cqa->queued_alarms; l; l = l->next) {
- qa = l->data;
- if (qa->alarm_id == alarm_id)
- return qa;
- }
-
- /* not found, might have been updated/removed */
- return NULL;
-}
-
-/* Removes an alarm from the list of alarms of a component. If the alarm was
- * the last one listed for the component, it removes the component itself.
- */
-static void
-remove_queued_alarm (CompQueuedAlarms *cqa, gpointer alarm_id,
- gboolean free_object, gboolean remove_alarm)
-{
- QueuedAlarm *qa;
- GSList *l;
-
- qa = NULL;
-
- for (l = cqa->queued_alarms; l; l = l->next) {
- qa = l->data;
- if (qa->alarm_id == alarm_id)
- break;
- }
-
- if (!l)
- return;
-
- cqa->queued_alarms = g_slist_remove_link (cqa->queued_alarms, l);
- g_slist_free_1 (l);
-
- if (remove_alarm) {
- cqa->expecting_update = TRUE;
- e_cal_discard_alarm (cqa->parent_client->client, cqa->alarms->comp,
- qa->instance->auid, NULL);
- cqa->expecting_update = FALSE;
- }
-
- g_free (qa);
-
- /* If this was the last queued alarm for this component, remove the
- * component itself.
- */
-
- if (cqa->queued_alarms != NULL)
- return;
-
- if (free_object) {
- g_hash_table_remove (cqa->parent_client->uid_alarms_hash, cqa->uid);
- g_free (cqa->uid);
- cqa->uid = NULL;
- cqa->parent_client = NULL;
- e_cal_component_alarms_free (cqa->alarms);
- g_free (cqa);
- } else {
- e_cal_component_alarms_free (cqa->alarms);
- cqa->alarms = NULL;
- }
-}
-
-/* Callback used when an alarm triggers */
-static void
-alarm_trigger_cb (gpointer alarm_id, time_t trigger, gpointer data)
-{
- CompQueuedAlarms *cqa;
- ECalComponent *comp;
- QueuedAlarm *qa;
- ECalComponentAlarm *alarm;
- ECalComponentAlarmAction action;
-
- cqa = data;
- comp = cqa->alarms->comp;
-
- save_notification_time (trigger);
- saved_notification_time = trigger;
-
- qa = lookup_queued_alarm (cqa, alarm_id);
- if (!qa)
- return;
-
- /* Decide what to do based on the alarm action. We use the trigger that
- * is passed to us instead of the one from the instance structure
- * because this may be a snoozed alarm instead of an original
- * occurrence.
- */
-
- alarm = e_cal_component_get_alarm (comp, qa->instance->auid);
- g_assert (alarm != NULL);
-
- e_cal_component_alarm_get_action (alarm, &action);
- e_cal_component_alarm_free (alarm);
-
- switch (action) {
- case E_CAL_COMPONENT_ALARM_AUDIO:
- audio_notification (trigger, cqa, alarm_id);
- break;
-
- case E_CAL_COMPONENT_ALARM_DISPLAY:
- display_notification (trigger, cqa, alarm_id, TRUE);
- break;
-
- case E_CAL_COMPONENT_ALARM_EMAIL:
- mail_notification (trigger, cqa, alarm_id);
- break;
-
- case E_CAL_COMPONENT_ALARM_PROCEDURE:
- procedure_notification (trigger, cqa, alarm_id);
- break;
-
- default:
- g_assert_not_reached ();
- break;
- }
-}
-
-/* Adds the alarms in a ECalComponentAlarms structure to the alarms queued for a
- * particular client. Also puts the triggers in the alarm timer queue.
- */
-static void
-add_component_alarms (ClientAlarms *ca, ECalComponentAlarms *alarms)
-{
- const char *uid;
- CompQueuedAlarms *cqa;
- GSList *l;
-
- /* No alarms? */
- if (alarms->alarms == NULL) {
- e_cal_component_alarms_free (alarms);
- return;
- }
-
- cqa = g_new (CompQueuedAlarms, 1);
- cqa->parent_client = ca;
- cqa->alarms = alarms;
- cqa->expecting_update = FALSE;
-
- cqa->queued_alarms = NULL;
-
- for (l = alarms->alarms; l; l = l->next) {
- ECalComponentAlarmInstance *instance;
- gpointer alarm_id;
- QueuedAlarm *qa;
-
- instance = l->data;
-
- alarm_id = alarm_add (instance->trigger, alarm_trigger_cb, cqa, NULL);
- if (!alarm_id) {
- g_message ("add_component_alarms(): Could not schedule a trigger for "
- "%ld, discarding...", (long) instance->trigger);
- continue;
- }
-
- qa = g_new (QueuedAlarm, 1);
- qa->alarm_id = alarm_id;
- qa->instance = instance;
- qa->snooze = FALSE;
-
- cqa->queued_alarms = g_slist_prepend (cqa->queued_alarms, qa);
- }
-
- e_cal_component_get_uid (alarms->comp, &uid);
-
- /* If we failed to add all the alarms, then we should get rid of the cqa */
- if (cqa->queued_alarms == NULL) {
- g_message ("add_component_alarms(): Could not add any of the alarms "
- "for the component `%s'; discarding it...", uid);
-
- e_cal_component_alarms_free (cqa->alarms);
- cqa->alarms = NULL;
-
- g_free (cqa);
- return;
- }
-
- cqa->queued_alarms = g_slist_reverse (cqa->queued_alarms);
- cqa->uid = g_strdup (uid);
- g_hash_table_insert (ca->uid_alarms_hash, cqa->uid, cqa);
-}
-
-/* Loads the alarms of a client for a given range of time */
-static void
-load_alarms (ClientAlarms *ca, time_t start, time_t end)
-{
- GSList *comp_alarms;
- GSList *l;
-
- comp_alarms = e_cal_get_alarms_in_range (ca->client, start, end);
-
- for (l = comp_alarms; l; l = l->next) {
- ECalComponentAlarms *alarms;
-
- alarms = l->data;
- add_component_alarms (ca, alarms);
- }
-
- g_slist_free (comp_alarms);
-}
-
-/* Loads today's remaining alarms for a client */
-static void
-load_alarms_for_today (ClientAlarms *ca)
-{
- time_t now, day_end;
- icaltimezone *zone;
-
- now = time (NULL);
-
- zone = config_data_get_timezone ();
-
- day_end = time_day_end_with_zone (now, zone);
- load_alarms (ca, now, day_end);
-}
-
-/* Adds any alarms that should have occurred while the alarm daemon was not
- * running.
- */
-static void
-load_missed_alarms (ClientAlarms *ca)
-{
- time_t now;
-
- now = time (NULL);
-
- g_assert (saved_notification_time != -1);
-
- /* We add 1 to the saved_notification_time to make the time ranges
- * half-open; we do not want to display the "last" displayed alarm
- * twice, once when it occurs and once when the alarm daemon restarts.
- */
- load_alarms (ca, saved_notification_time + 1, now);
-}
-
-/* Called when a calendar client finished loading; we load its alarms */
-static void
-cal_opened_cb (ECal *client, ECalendarStatus status, gpointer data)
-{
- ClientAlarms *ca;
-
- ca = data;
-
- if (status != E_CALENDAR_STATUS_OK)
- return;
-
- load_alarms_for_today (ca);
- load_missed_alarms (ca);
-}
-
-/* Looks up a component's queued alarm structure in a client alarms structure */
-static CompQueuedAlarms *
-lookup_comp_queued_alarms (ClientAlarms *ca, const char *uid)
-{
- return g_hash_table_lookup (ca->uid_alarms_hash, uid);
-}
-
-static void
-remove_alarms (CompQueuedAlarms *cqa, gboolean free_object)
-{
- GSList *l;
-
- for (l = cqa->queued_alarms; l;) {
- QueuedAlarm *qa;
-
- qa = l->data;
-
- /* Get the next element here because the list element will go
- * away in remove_queued_alarm(). The qa will be freed there as
- * well.
- */
- l = l->next;
-
- alarm_remove (qa->alarm_id);
- remove_queued_alarm (cqa, qa->alarm_id, free_object, FALSE);
- }
-
-}
-
-/* Removes a component an its alarms */
-static void
-remove_comp (ClientAlarms *ca, const char *uid)
-{
- CompQueuedAlarms *cqa;
-
- cqa = lookup_comp_queued_alarms (ca, uid);
- if (!cqa)
- return;
-
- /* If a component is present, then it means we must have alarms queued
- * for it.
- */
- g_assert (cqa->queued_alarms != NULL);
-
- remove_alarms (cqa, TRUE);
-
- /* The list should be empty now, and thus the queued component alarms
- * structure should have been freed and removed from the hash table.
- */
- g_assert (lookup_comp_queued_alarms (ca, uid) == NULL);
-}
-
-/* Called when a calendar component changes; we must reload its corresponding
- * alarms.
- */
-static void
-obj_updated_cb (ECal *client, const char *uid, gpointer data)
-{
- ClientAlarms *ca;
- time_t now, day_end;
- ECalComponentAlarms *alarms;
- gboolean found;
- icaltimezone *zone;
- CompQueuedAlarms *cqa;
-
- ca = data;
-
- now = time (NULL);
-
- zone = config_data_get_timezone ();
-
- day_end = time_day_end_with_zone (now, zone);
-
- found = e_cal_get_alarms_for_object (ca->client, uid, now, day_end, &alarms);
-
- if (!found) {
- remove_comp (ca, uid);
- return;
- }
-
- cqa = lookup_comp_queued_alarms (ca, uid);
- if (!cqa)
- add_component_alarms (ca, alarms);
- else {
- GSList *l;
-
- /* if already in the list, just update it */
- remove_alarms (cqa, FALSE);
- cqa->alarms = alarms;
- cqa->queued_alarms = NULL;
-
- /* add the new alarms */
- for (l = cqa->alarms->alarms; l; l = l->next) {
- ECalComponentAlarmInstance *instance;
- gpointer alarm_id;
- QueuedAlarm *qa;
-
- instance = l->data;
-
- alarm_id = alarm_add (instance->trigger, alarm_trigger_cb, cqa, NULL);
- if (!alarm_id) {
- g_message ("obj_updated_cb(): Could not schedule a trigger for "
- "%ld, discarding...", (long) instance->trigger);
- continue;
- }
-
- qa = g_new (QueuedAlarm, 1);
- qa->alarm_id = alarm_id;
- qa->instance = instance;
- qa->snooze = FALSE;
-
- cqa->queued_alarms = g_slist_prepend (cqa->queued_alarms, qa);
- }
-
- if (cqa->queued_alarms == NULL) {
- if (!cqa->expecting_update)
- remove_comp (ca, uid);
- } else
- cqa->queued_alarms = g_slist_reverse (cqa->queued_alarms);
- }
-}
-
-/* Called when a calendar component is removed; we must delete its corresponding
- * alarms.
- */
-static void
-obj_removed_cb (ECal *client, const char *uid, gpointer data)
-{
- ClientAlarms *ca;
-
- ca = data;
-
- remove_comp (ca, uid);
-}
-
-
-
-/* Notification functions */
-
-/* Creates a snooze alarm based on an existing one. The snooze offset is
- * compued with respect to the current time.
- */
-static void
-create_snooze (CompQueuedAlarms *cqa, gpointer alarm_id, int snooze_mins)
-{
- QueuedAlarm *orig_qa;
- time_t t;
- gpointer new_id;
-
- orig_qa = lookup_queued_alarm (cqa, alarm_id);
- if (!orig_qa)
- return;
-
- t = time (NULL);
- t += snooze_mins * 60;
-
- new_id = alarm_add (t, alarm_trigger_cb, cqa, NULL);
- if (!new_id) {
- g_message ("create_snooze(): Could not schedule a trigger for "
- "%ld, discarding...", (long) t);
- return;
- }
-
- orig_qa->instance->trigger = t;
- orig_qa->alarm_id = new_id;
- orig_qa->snooze = TRUE;
-}
-
-/* Launches a component editor for a component */
-static void
-edit_component (ECal *client, ECalComponent *comp)
-{
- const char *uid;
- const char *uri;
- CORBA_Environment ev;
- GNOME_Evolution_Calendar_CompEditorFactory factory;
-
- e_cal_component_get_uid (comp, &uid);
-
- uri = e_cal_get_uri (client);
-
- /* Get the factory */
-
- CORBA_exception_init (&ev);
- factory = bonobo_activation_activate_from_id ("OAFIID:GNOME_Evolution_Calendar_CompEditorFactory:" BASE_VERSION,
- 0, NULL, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_message ("edit_component(): Could not activate the component editor factory");
- CORBA_exception_free (&ev);
- return;
- }
- CORBA_exception_free (&ev);
-
- /* Edit the component */
-
- CORBA_exception_init (&ev);
- GNOME_Evolution_Calendar_CompEditorFactory_editExisting (factory, uri, (char *) uid, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION)
- g_message ("edit_component(): Exception while editing the component");
-
- CORBA_exception_free (&ev);
-
- /* Get rid of the factory */
-
- CORBA_exception_init (&ev);
- bonobo_object_release_unref (factory, &ev);
- if (ev._major != CORBA_NO_EXCEPTION)
- g_message ("edit_component(): Could not unref the calendar component factory");
-
- CORBA_exception_free (&ev);
-}
-
-
-/* /\* Callback used from the alarm notify dialog *\/ */
-/* static void */
-/* notify_dialog_cb (AlarmNotifyResult result, int snooze_mins, gpointer data) */
-/* { */
-
-/* switch (result) { */
-/* case ALARM_NOTIFY_SNOOZE: */
-/* create_snooze (c->cqa, c->alarm_id, snooze_mins); */
-
-/* g_object_unref (c->comp); */
-/* g_object_unref (c->client); */
-/* g_free (c); */
-/* return; */
-
-/* case ALARM_NOTIFY_EDIT: */
-/* edit_component (c->client, c->comp); */
-/* break; */
-
-/* case ALARM_NOTIFY_CLOSE: */
-/* /\* Do nothing *\/ */
-/* break; */
-
-/* default: */
-/* g_assert_not_reached (); */
-/* } */
-
-/* if (c->cqa != NULL) */
-/* remove_queued_alarm (c->cqa, c->alarm_id, TRUE, TRUE); */
-/* g_object_unref (c->comp); */
-/* g_object_unref (c->client); */
-/* g_free (c); */
-/* } */
-
-typedef struct {
- char *message;
- gboolean blink_state;
- gint blink_id;
- time_t trigger;
- CompQueuedAlarms *cqa;
- gpointer alarm_id;
- ECalComponent *comp;
- ECal *client;
- GtkWidget *tray_icon;
- GtkWidget *image;
- GtkWidget *alarm_dialog;
-} TrayIconData;
-
-static void
-on_dialog_obj_updated_cb (ECal *client, const char *uid, gpointer data)
-{
-/* commented out so gcc won't complain about the unused variable
- struct notify_dialog_closure *c = data;
-*/
-}
-
-static void
-on_dialog_obj_removed_cb (ECal *client, const char *uid, gpointer data)
-{
- const char *our_uid;
- TrayIconData *tray_data = data;
-
- e_cal_component_get_uid (tray_data->comp, &our_uid);
- g_return_if_fail (our_uid && *our_uid);
-
- if (!strcmp (uid, our_uid)) {
- alarm_notify_dialog_disable_buttons (tray_data->alarm_dialog);
- tray_data->cqa = NULL;
- tray_data->alarm_id = NULL;
- }
-}
-
-/* Callback used from the alarm notify dialog */
-static void
-notify_dialog_cb (AlarmNotifyResult result, int snooze_mins, gpointer data)
-{
- TrayIconData *tray_data = data;
-
- g_signal_handlers_disconnect_matched (tray_data->client, G_SIGNAL_MATCH_FUNC,
- 0, 0, NULL, on_dialog_obj_removed_cb, NULL);
-
- switch (result) {
- case ALARM_NOTIFY_SNOOZE:
- create_snooze (tray_data->cqa, tray_data->alarm_id, snooze_mins);
- tray_data->cqa = NULL;
- return;
-
- case ALARM_NOTIFY_EDIT:
- edit_component (tray_data->client, tray_data->comp);
- break;
-
- case ALARM_NOTIFY_CLOSE:
- /* Do nothing */
- break;
-
- default:
- g_assert_not_reached ();
- }
-
- tray_data->alarm_dialog = NULL;
- gtk_widget_destroy (tray_data->tray_icon);
-}
-
-static gint
-tray_icon_destroyed_cb (GtkWidget *tray, gpointer user_data)
-{
- TrayIconData *tray_data = user_data;
-
- if (tray_data->cqa != NULL)
- remove_queued_alarm (tray_data->cqa, tray_data->alarm_id, TRUE, TRUE);
-
- if (tray_data->message != NULL) {
- g_free (tray_data->message);
- tray_data->message = NULL;
- }
-
- g_source_remove (tray_data->blink_id);
-
- g_object_unref (tray_data->comp);
- g_object_unref (tray_data->client);
- g_free (tray_data);
-
- return TRUE;
-}
-
-static gint
-tray_icon_clicked_cb (GtkWidget *widget, GdkEventButton *event, gpointer user_data)
-{
- TrayIconData *tray_data = user_data;
-
- if (event->type == GDK_BUTTON_PRESS) {
- if (event->button == 1) {
- QueuedAlarm *qa;
-
- if (tray_data->alarm_dialog != NULL)
- return FALSE;
-
- qa = lookup_queued_alarm (tray_data->cqa, tray_data->alarm_id);
- if (qa) {
- gtk_widget_hide (tray_data->tray_icon);
- tray_data->alarm_dialog = alarm_notify_dialog (
- tray_data->trigger,
- qa->instance->occur_start,
- qa->instance->occur_end,
- e_cal_component_get_vtype (tray_data->comp),
- tray_data->message,
- notify_dialog_cb, tray_data);
- if (tray_data->alarm_dialog) {
- g_signal_connect (G_OBJECT (tray_data->client), "obj_removed",
- G_CALLBACK (on_dialog_obj_removed_cb), tray_data);
- }
- }
-
- return TRUE;
- } else if (event->button == 2) {
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
-static gboolean
-tray_icon_blink_cb (gpointer data)
-{
- TrayIconData *tray_data = data;
-
- /* FIXME: Use stock image equivalents when they become available */
-
- tray_data->blink_state = tray_data->blink_state == TRUE ? FALSE : TRUE;
- gtk_image_set_from_file (GTK_IMAGE (tray_data->image),
- tray_data->blink_state == TRUE ?
- EVOLUTION_IMAGESDIR "/appointment-reminder-excl.png" :
- EVOLUTION_IMAGESDIR "/appointment-reminder.png");
-
- return TRUE;
-}
-
-/* Performs notification of a display alarm */
-static void
-display_notification (time_t trigger, CompQueuedAlarms *cqa,
- gpointer alarm_id, gboolean use_description)
-{
- QueuedAlarm *qa;
- ECalComponent *comp;
- ECal *client;
- ECalComponentVType vtype;
- const char *message;
- ECalComponentAlarm *alarm;
- GtkWidget *tray_icon, *image, *ebox;
- GtkTooltips *tooltips;
- TrayIconData *tray_data;
- ECalComponentText text;
- char *str, *start_str, *end_str, *alarm_str;
- icaltimezone *current_zone;
-
- comp = cqa->alarms->comp;
- qa = lookup_queued_alarm (cqa, alarm_id);
- if (!qa)
- return;
-
- vtype = e_cal_component_get_vtype (comp);
-
- /* get a sensible description for the event */
- alarm = e_cal_component_get_alarm (comp, qa->instance->auid);
- g_assert (alarm != NULL);
-
- e_cal_component_alarm_get_description (alarm, &text);
- e_cal_component_alarm_free (alarm);
-
- if (text.value)
- message = text.value;
- else {
- e_cal_component_get_summary (comp, &text);
- if (text.value)
- message = text.value;
- else
- message = _("No description available.");
- }
-
- /* create the tray icon */
- tooltips = gtk_tooltips_new ();
-
- /* FIXME: Use stock image equivalent when it becomes available */
- tray_icon = egg_tray_icon_new (qa->instance->auid);
- image = gtk_image_new_from_file (EVOLUTION_IMAGESDIR "/appointment-reminder.png");
- ebox = gtk_event_box_new ();
-
- gtk_widget_show (image);
- gtk_widget_show (ebox);
-
- current_zone = config_data_get_timezone ();
- alarm_str = timet_to_str_with_zone (trigger, current_zone);
- start_str = timet_to_str_with_zone (qa->instance->occur_start, current_zone);
- end_str = timet_to_str_with_zone (qa->instance->occur_end, current_zone);
- str = g_strdup_printf (_("Alarm on %s\n%s\nStarting at %s\nEnding at %s"),
- alarm_str, message, start_str, end_str);
- gtk_tooltips_set_tip (GTK_TOOLTIPS (tooltips), ebox, str, str);
- g_free (start_str);
- g_free (end_str);
- g_free (alarm_str);
- g_free (str);
-
- g_object_set_data (G_OBJECT (tray_icon), "image", image);
- g_object_set_data (G_OBJECT (tray_icon), "available", GINT_TO_POINTER (1));
-
- gtk_container_add (GTK_CONTAINER (ebox), image);
- gtk_container_add (GTK_CONTAINER (tray_icon), ebox);
-
- /* create the private structure */
- tray_data = g_new0 (TrayIconData, 1);
- tray_data->message = g_strdup (message);
- tray_data->trigger = trigger;
- tray_data->cqa = cqa;
- tray_data->alarm_id = alarm_id;
- tray_data->comp = e_cal_component_clone (comp);
- tray_data->client = cqa->parent_client->client;
- tray_data->image = image;
- tray_data->blink_state = FALSE;
- g_object_ref (tray_data->client);
- tray_data->tray_icon = tray_icon;
-
- g_signal_connect (G_OBJECT (tray_icon), "destroy",
- G_CALLBACK (tray_icon_destroyed_cb), tray_data);
- g_signal_connect (G_OBJECT (ebox), "button_press_event",
- G_CALLBACK (tray_icon_clicked_cb), tray_data);
-
- tray_data->blink_id = g_timeout_add (500, tray_icon_blink_cb, tray_data);
-
- gtk_widget_show (tray_icon);
-}
-
-/* Performs notification of an audio alarm */
-static void
-audio_notification (time_t trigger, CompQueuedAlarms *cqa,
- gpointer alarm_id)
-{
- QueuedAlarm *qa;
- ECalComponent *comp;
- ECalComponentAlarm *alarm;
- icalattach *attach;
-
- comp = cqa->alarms->comp;
- qa = lookup_queued_alarm (cqa, alarm_id);
- if (!qa)
- return;
-
- alarm = e_cal_component_get_alarm (comp, qa->instance->auid);
- g_assert (alarm != NULL);
-
- e_cal_component_alarm_get_attach (alarm, &attach);
- e_cal_component_alarm_free (alarm);
-
- if (attach && icalattach_get_is_url (attach)) {
- const char *url;
-
- url = icalattach_get_url (attach);
-
- if (url && *url && g_file_test (url, G_FILE_TEST_EXISTS))
- gnome_sound_play (url); /* this sucks */
- else
- gdk_beep ();
- }
-
- if (attach)
- icalattach_unref (attach);
-
- /* We present a notification message in addition to playing the sound */
- display_notification (trigger, cqa, alarm_id, FALSE);
-}
-
-/* Performs notification of a mail alarm */
-static void
-mail_notification (time_t trigger, CompQueuedAlarms *cqa, gpointer alarm_id)
-{
- GtkWidget *dialog;
- GtkWidget *label;
-
- /* FIXME */
-
- display_notification (trigger, cqa, alarm_id, FALSE);
-
- dialog = gtk_dialog_new_with_buttons (_("Warning"),
- NULL, 0,
- GTK_STOCK_OK, GTK_RESPONSE_CANCEL,
- NULL);
- label = gtk_label_new (_("Evolution does not support calendar reminders with\n"
- "email notifications yet, but this reminder was\n"
- "configured to send an email. Evolution will display\n"
- "a normal reminder dialog box instead."));
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), label, TRUE, TRUE, 4);
-
- gtk_dialog_run (GTK_DIALOG (dialog));
-}
-
-/* Performs notification of a procedure alarm */
-static gboolean
-procedure_notification_dialog (const char *cmd, const char *url)
-{
- GtkWidget *dialog, *label, *checkbox;
- char *str;
- int btn;
-
- if (is_blessed_program (url))
- return TRUE;
-
- dialog = gtk_dialog_new_with_buttons (_("Warning"),
- NULL, 0,
- GTK_STOCK_NO, GTK_RESPONSE_CANCEL,
- GTK_STOCK_YES, GTK_RESPONSE_OK,
- NULL);
-
- str = g_strdup_printf (_("An Evolution Calendar reminder is about to trigger. "
- "This reminder is configured to run the following program:\n\n"
- " %s\n\n"
- "Are you sure you want to run this program?"),
- cmd);
- label = gtk_label_new (str);
- gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
- gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
- gtk_widget_show (label);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
- label, TRUE, TRUE, 4);
- g_free (str);
-
- checkbox = gtk_check_button_new_with_label
- (_("Do not ask me about this program again."));
- gtk_widget_show (checkbox);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
- checkbox, TRUE, TRUE, 4);
-
- /* Run the dialog */
- btn = gtk_dialog_run (GTK_DIALOG (dialog));
- if (btn == GTK_RESPONSE_OK && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbox)))
- save_blessed_program (url);
- gtk_widget_destroy (dialog);
-
- return (btn == GTK_RESPONSE_OK);
-}
-
-static void
-procedure_notification (time_t trigger, CompQueuedAlarms *cqa, gpointer alarm_id)
-{
- QueuedAlarm *qa;
- ECalComponent *comp;
- ECalComponentAlarm *alarm;
- ECalComponentText description;
- icalattach *attach;
- const char *url;
- char *cmd;
- int result;
-
- comp = cqa->alarms->comp;
- qa = lookup_queued_alarm (cqa, alarm_id);
- if (!qa)
- return;
-
- alarm = e_cal_component_get_alarm (comp, qa->instance->auid);
- g_assert (alarm != NULL);
-
- e_cal_component_alarm_get_attach (alarm, &attach);
- e_cal_component_alarm_get_description (alarm, &description);
- e_cal_component_alarm_free (alarm);
-
- /* If the alarm has no attachment, simply display a notification dialog. */
- if (!attach)
- goto fallback;
-
- if (!icalattach_get_is_url (attach)) {
- icalattach_unref (attach);
- goto fallback;
- }
-
- url = icalattach_get_url (attach);
- g_assert (url != NULL);
-
- /* Ask for confirmation before executing the stuff */
- if (description.value)
- cmd = g_strconcat (url, " ", description.value, NULL);
- else
- cmd = (char *) url;
-
- result = 0;
- if (procedure_notification_dialog (cmd, url))
- result = gnome_execute_shell (NULL, cmd);
-
- if (cmd != (char *) url)
- g_free (cmd);
-
- icalattach_unref (attach);
-
- /* Fall back to display notification if we got an error */
- if (result < 0)
- goto fallback;
-
- remove_queued_alarm (cqa, alarm_id, TRUE, TRUE);
- return;
-
- fallback:
-
- display_notification (trigger, cqa, alarm_id, FALSE);
-}
-
-
-
-/**
- * alarm_queue_init:
- *
- * Initializes the alarm queueing system. This should be called near the
- * beginning of the program.
- **/
-void
-alarm_queue_init (void)
-{
- g_return_if_fail (alarm_queue_inited == FALSE);
-
- client_alarms_hash = g_hash_table_new (g_direct_hash, g_direct_equal);
- queue_midnight_refresh ();
-
- saved_notification_time = get_saved_notification_time ();
- if (saved_notification_time == -1) {
- saved_notification_time = time (NULL);
- save_notification_time (saved_notification_time);
- }
-
- alarm_queue_inited = TRUE;
-}
-
-static void
-free_client_alarms_cb (gpointer key, gpointer value, gpointer user_data)
-{
- ECal *client = key;
- ClientAlarms *ca = value;
-
- if (ca) {
- g_object_unref (ca->client);
- g_free (ca);
- }
-}
-
-/**
- * alarm_queue_done:
- *
- * Shuts down the alarm queueing system. This should be called near the end
- * of the program. All the monitored calendar clients should already have been
- * unregistered with alarm_queue_remove_client().
- **/
-void
-alarm_queue_done (void)
-{
- g_return_if_fail (alarm_queue_inited);
-
- /* All clients must be unregistered by now */
- g_return_if_fail (g_hash_table_size (client_alarms_hash) == 0);
-
- g_hash_table_foreach (client_alarms_hash, (GHFunc) free_client_alarms_cb, NULL);
- g_hash_table_destroy (client_alarms_hash);
- client_alarms_hash = NULL;
-
- g_assert (midnight_refresh_id != NULL);
- alarm_remove (midnight_refresh_id);
- midnight_refresh_id = NULL;
-
- alarm_queue_inited = FALSE;
-}
-
-/**
- * alarm_queue_add_client:
- * @client: A calendar client.
- *
- * Adds a calendar client to the alarm queueing system. Alarm trigger
- * notifications will be presented at the appropriate times. The client should
- * be removed with alarm_queue_remove_client() when receiving notifications
- * from it is no longer desired.
- *
- * A client can be added any number of times to the alarm queueing system,
- * but any single alarm trigger will only be presented once for a particular
- * client. The client must still be removed the same number of times from the
- * queueing system when it is no longer wanted.
- **/
-void
-alarm_queue_add_client (ECal *client)
-{
- ClientAlarms *ca;
-
- g_return_if_fail (alarm_queue_inited);
- g_return_if_fail (client != NULL);
- g_return_if_fail (E_IS_CAL (client));
-
- ca = lookup_client (client);
- if (ca) {
- ca->refcount++;
- return;
- }
-
- ca = g_new (ClientAlarms, 1);
-
- ca->client = client;
- g_object_ref (ca->client);
-
- ca->refcount = 1;
- g_hash_table_insert (client_alarms_hash, client, ca);
-
- ca->uid_alarms_hash = g_hash_table_new (g_str_hash, g_str_equal);
-
- if (e_cal_get_load_state (client) != E_CAL_LOAD_LOADED)
- g_signal_connect (client, "cal_opened",
- G_CALLBACK (cal_opened_cb),
- ca);
-
- g_signal_connect (client, "obj_updated",
- G_CALLBACK (obj_updated_cb),
- ca);
- g_signal_connect (client, "obj_removed",
- G_CALLBACK (obj_removed_cb),
- ca);
-
- if (e_cal_get_load_state (client) == E_CAL_LOAD_LOADED) {
- load_alarms_for_today (ca);
- load_missed_alarms (ca);
- }
-}
-
-/* Called from g_hash_table_foreach(); adds a component UID to a list */
-static void
-add_uid_cb (gpointer key, gpointer value, gpointer data)
-{
- GSList **uids;
- const char *uid;
-
- uids = data;
- uid = key;
-
- *uids = g_slist_prepend (*uids, (char *) uid);
-}
-
-/* Removes all the alarms queued for a particular calendar client */
-static void
-remove_client_alarms (ClientAlarms *ca)
-{
- GSList *uids;
- GSList *l;
-
- /* First we build a list of UIDs so that we can remove them one by one */
-
- uids = NULL;
- g_hash_table_foreach (ca->uid_alarms_hash, add_uid_cb, &uids);
-
- for (l = uids; l; l = l->next) {
- const char *uid;
-
- uid = l->data;
-
- remove_comp (ca, uid);
- }
-
- g_slist_free (uids);
-
- /* The hash table should be empty now */
-
- g_assert (g_hash_table_size (ca->uid_alarms_hash) == 0);
-}
-
-/**
- * alarm_queue_remove_client:
- * @client: A calendar client.
- *
- * Removes a calendar client from the alarm queueing system.
- **/
-void
-alarm_queue_remove_client (ECal *client)
-{
- ClientAlarms *ca;
-
- g_return_if_fail (alarm_queue_inited);
- g_return_if_fail (client != NULL);
- g_return_if_fail (E_IS_CAL (client));
-
- ca = lookup_client (client);
- g_return_if_fail (ca != NULL);
-
- g_assert (ca->refcount > 0);
- ca->refcount--;
-
- if (ca->refcount > 0)
- return;
-
- remove_client_alarms (ca);
-
- /* Clean up */
-
- g_signal_handlers_disconnect_matched (ca->client, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, ca);
-
- g_object_unref (ca->client);
- ca->client = NULL;
-
- g_hash_table_destroy (ca->uid_alarms_hash);
- ca->uid_alarms_hash = NULL;
-
- g_free (ca);
-
- g_hash_table_remove (client_alarms_hash, client);
-}
diff --git a/calendar/gui/alarm-notify/alarm-queue.h b/calendar/gui/alarm-notify/alarm-queue.h
deleted file mode 100644
index 12802750ec..0000000000
--- a/calendar/gui/alarm-notify/alarm-queue.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Evolution calendar - Alarm queueing engine
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Authors: Federico Mena-Quintero <federico@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef ALARM_QUEUE_H
-#define ALARM_QUEUE_H
-
-#include <libecal/e-cal.h>
-
-
-void alarm_queue_init (void);
-void alarm_queue_done (void);
-
-void alarm_queue_add_client (ECal *client);
-void alarm_queue_remove_client (ECal *client);
-
-
-#endif
diff --git a/calendar/gui/alarm-notify/alarm.c b/calendar/gui/alarm-notify/alarm.c
deleted file mode 100644
index 8c6c4c59cd..0000000000
--- a/calendar/gui/alarm-notify/alarm.c
+++ /dev/null
@@ -1,305 +0,0 @@
-/* Evolution calendar - Low-level alarm timer mechanism
- *
- * Copyright (C) 2000 Ximian, Inc.
- * Copyright (C) 2000 Ximian, Inc.
- *
- * Authors: Miguel de Icaza <miguel@ximian.com>
- * Federico Mena-Quintero <federico@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-#include <unistd.h>
-#include <time.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <sys/time.h>
-#include <gdk/gdk.h>
-#include "alarm.h"
-
-
-
-/* Our glib timeout */
-static guint timeout_id;
-
-/* The list of pending alarms */
-static GList *alarms = NULL;
-
-/* A queued alarm structure */
-typedef struct {
- time_t trigger;
- AlarmFunction alarm_fn;
- gpointer data;
- AlarmDestroyNotify destroy_notify_fn;
-} AlarmRecord;
-
-static void setup_timeout (time_t now);
-
-
-
-/* Removes the head alarm from the queue. Does not touch the timeout_id. */
-static void
-pop_alarm (void)
-{
- AlarmRecord *ar;
- GList *l;
-
- g_assert (alarms != NULL);
-
- ar = alarms->data;
-
- l = alarms;
- alarms = g_list_remove_link (alarms, l);
- g_list_free_1 (l);
-
- g_free (ar);
-}
-
-/* Callback from the alarm timeout */
-static gboolean
-alarm_ready_cb (gpointer data)
-{
- time_t now;
-
- g_assert (alarms != NULL);
- timeout_id = 0;
-
- now = time (NULL);
-
- while (alarms) {
- AlarmRecord *notify_id, *ar;
- AlarmRecord ar_copy;
-
- ar = alarms->data;
-
- if (ar->trigger > now)
- break;
-
- notify_id = ar;
-
- ar_copy = *ar;
- ar = &ar_copy;
-
- pop_alarm (); /* This will free the original AlarmRecord; that's why we copy it */
-
- (* ar->alarm_fn) (notify_id, ar->trigger, ar->data);
-
- if (ar->destroy_notify_fn)
- (* ar->destroy_notify_fn) (notify_id, ar->data);
- }
-
- if (alarms) {
- /* We need this check because one of the alarm_fn above may have
- * re-entered and added an alarm of its own, so the timer will
- * already be set up.
- */
- if (timeout_id == 0)
- setup_timeout (now);
- } else
- g_assert (timeout_id == 0);
-
- return FALSE;
-}
-
-/* Sets up a timeout for the next minute. We do not need to be concerned with
- * timezones here, as this is just a periodic check on the alarm queue.
- */
-static void
-setup_timeout (time_t now)
-{
- time_t next, diff;
- struct tm tm;
-
- g_assert (timeout_id == 0);
- g_assert (alarms != NULL);
-
- tm = *localtime (&now);
- tm.tm_sec = 0;
- tm.tm_min++; /* next minute */
-
- next = mktime (&tm);
- g_assert (next != -1);
-
- diff = next - now;
-
- g_assert (diff >= 0);
- timeout_id = g_timeout_add (diff * 1000, alarm_ready_cb, NULL);
-}
-
-/* Used from g_list_insert_sorted(); compares the trigger times of two AlarmRecord structures. */
-static int
-compare_alarm_by_time (gconstpointer a, gconstpointer b)
-{
- const AlarmRecord *ara = a;
- const AlarmRecord *arb = b;
- time_t diff;
-
- diff = ara->trigger - arb->trigger;
- return (diff < 0) ? -1 : (diff > 0) ? 1 : 0;
-}
-
-/* Adds an alarm to the queue and sets up the timer */
-static void
-queue_alarm (AlarmRecord *ar)
-{
- time_t now;
- AlarmRecord *old_head;
-
- if (alarms) {
- g_assert (timeout_id != 0);
-
- old_head = alarms->data;
- } else {
- g_assert (timeout_id == 0);
-
- old_head = NULL;
- }
-
- alarms = g_list_insert_sorted (alarms, ar, compare_alarm_by_time);
-
- if (old_head == alarms->data)
- return;
-
- /* Set the timer for removal upon activation */
-
- if (!old_head) {
- now = time (NULL);
- setup_timeout (now);
- }
-}
-
-
-
-/**
- * alarm_add:
- * @trigger: Time at which alarm will trigger.
- * @alarm_fn: Callback for trigger.
- * @data: Closure data for callback.
- *
- * Adds an alarm to trigger at the specified time. The @alarm_fn will be called
- * with the provided data and the alarm will be removed from the trigger list.
- *
- * Return value: An identifier for this alarm; it can be used to remove the
- * alarm later with alarm_remove(). If the trigger time occurs in the past, then
- * the alarm will not be queued and the function will return NULL.
- **/
-gpointer
-alarm_add (time_t trigger, AlarmFunction alarm_fn, gpointer data,
- AlarmDestroyNotify destroy_notify_fn)
-{
- AlarmRecord *ar;
-
- g_return_val_if_fail (trigger != -1, NULL);
- g_return_val_if_fail (alarm_fn != NULL, NULL);
-
- ar = g_new (AlarmRecord, 1);
- ar->trigger = trigger;
- ar->alarm_fn = alarm_fn;
- ar->data = data;
- ar->destroy_notify_fn = destroy_notify_fn;
-
- queue_alarm (ar);
-
- return ar;
-}
-
-/**
- * alarm_remove:
- * @alarm: A queued alarm identifier.
- *
- * Removes an alarm from the alarm queue.
- **/
-void
-alarm_remove (gpointer alarm)
-{
- AlarmRecord *notify_id, *ar;
- AlarmRecord ar_copy;
- AlarmRecord *old_head;
- GList *l;
-
- g_return_if_fail (alarm != NULL);
-
- ar = alarm;
-
- l = g_list_find (alarms, ar);
- if (!l) {
- g_message ("alarm_remove(): Requested removal of nonexistent alarm!");
- return;
- }
-
- old_head = alarms->data;
-
- notify_id = ar;
-
- if (old_head == ar) {
- ar_copy = *ar;
- ar = &ar_copy;
- pop_alarm (); /* This will free the original AlarmRecord; that's why we copy it */
- } else {
- alarms = g_list_remove_link (alarms, l);
- g_list_free_1 (l);
- }
-
- /* Reset the timeout */
-
- g_assert (timeout_id != 0);
-
- if (!alarms) {
- g_source_remove (timeout_id);
- timeout_id = 0;
- }
-
- /* Notify about destructiono of the alarm */
-
- if (ar->destroy_notify_fn)
- (* ar->destroy_notify_fn) (notify_id, ar->data);
-
-}
-
-/**
- * alarm_done:
- *
- * Terminates the alarm timer mechanism. This should be called at the end of
- * the program.
- **/
-void
-alarm_done (void)
-{
- GList *l;
-
- if (timeout_id == 0) {
- g_assert (alarms == NULL);
- return;
- }
-
- g_assert (alarms != NULL);
-
- g_source_remove (timeout_id);
- timeout_id = 0;
-
- for (l = alarms; l; l = l->next) {
- AlarmRecord *ar;
-
- ar = l->data;
-
- if (ar->destroy_notify_fn)
- (* ar->destroy_notify_fn) (ar, ar->data);
-
- g_free (ar);
- }
-
- g_list_free (alarms);
- alarms = NULL;
-}
diff --git a/calendar/gui/alarm-notify/alarm.h b/calendar/gui/alarm-notify/alarm.h
deleted file mode 100644
index 23fde886c9..0000000000
--- a/calendar/gui/alarm-notify/alarm.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Evolution calendar - Low-level alarm timer mechanism
- *
- * Copyright (C) 2000 Ximian, Inc.
- * Copyright (C) 2000 Ximian, Inc.
- *
- * Authors: Miguel de Icaza <miguel@ximian.com>
- * Federico Mena-Quintero <federico@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef ALARM_H
-#define ALARM_H
-
-#include <time.h>
-#include <glib.h>
-
-
-
-typedef void (* AlarmFunction) (gpointer alarm_id, time_t trigger, gpointer data);
-typedef void (* AlarmDestroyNotify) (gpointer alarm_id, gpointer data);
-
-void alarm_done (void);
-
-gpointer alarm_add (time_t trigger, AlarmFunction alarm_fn, gpointer data,
- AlarmDestroyNotify destroy_notify_fn);
-void alarm_remove (gpointer alarm);
-
-
-
-#endif
diff --git a/calendar/gui/alarm-notify/config-data.c b/calendar/gui/alarm-notify/config-data.c
deleted file mode 100644
index 3cad23d5cd..0000000000
--- a/calendar/gui/alarm-notify/config-data.c
+++ /dev/null
@@ -1,168 +0,0 @@
-/* Evolution calendar - Configuration values for the alarm notification daemon
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Authors: Federico Mena-Quintero <federico@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIOH
-#include <config.h>
-#endif
-
-#include <libedataserver/e-source-list.h>
-#include "config-data.h"
-#include "save.h"
-
-
-
-/* Whether we have initied ourselves by reading the data from the configuration engine */
-static gboolean inited = FALSE;
-static GConfClient *conf_client = NULL;
-static ESourceList *calendar_source_list = NULL, *tasks_source_list = NULL;
-
-
-
-/* Copied from ../calendar-config.c; returns whether the locale has 'am' and
- * 'pm' strings defined.
- */
-static gboolean
-locale_supports_12_hour_format (void)
-{
- char s[16];
- time_t t = 0;
-
- strftime (s, sizeof s, "%p", gmtime (&t));
- return s[0] != '\0';
-}
-
-static void
-do_cleanup (void)
-{
- if (calendar_source_list) {
- g_object_unref (calendar_source_list);
- calendar_source_list = NULL;
- }
-
- if (tasks_source_list) {
- g_object_unref (tasks_source_list);
- tasks_source_list = NULL;
- }
-
- g_object_unref (conf_client);
- conf_client = NULL;
-
- inited = FALSE;
-}
-
-/* Ensures that the configuration values have been read */
-static void
-ensure_inited (void)
-{
- if (inited)
- return;
-
- inited = TRUE;
-
- conf_client = gconf_client_get_default ();
- if (!GCONF_IS_CLIENT (conf_client)) {
- inited = FALSE;
- return;
- }
-
- g_atexit ((GVoidFunc) do_cleanup);
-
- /* load the sources for calendars and tasks */
- calendar_source_list = e_source_list_new_for_gconf (conf_client,
- "/apps/evolution/calendar/sources");
- tasks_source_list = e_source_list_new_for_gconf (conf_client,
- "/apps/evolution/tasks/sources");
-
-}
-
-GConfClient *
-config_data_get_conf_client (void)
-{
- ensure_inited ();
- return conf_client;
-}
-
-icaltimezone *
-config_data_get_timezone (void)
-{
- char *location;
- icaltimezone *local_timezone;
-
- ensure_inited ();
-
- location = gconf_client_get_string (conf_client,
- "/apps/evolution/calendar/display/timezone",
- NULL);
- if (location && location[0]) {
- local_timezone = icaltimezone_get_builtin_timezone (location);
- } else {
- local_timezone = icaltimezone_get_utc_timezone ();
- }
-
- g_free (location);
-
- return local_timezone;
-}
-
-gboolean
-config_data_get_24_hour_format (void)
-{
- ensure_inited ();
-
- if (locale_supports_12_hour_format ()) {
- return gconf_client_get_bool (conf_client,
- "/apps/evolution/calendar/display/use_24hour_format",
- NULL);
- }
-
- return TRUE;
-}
-
-GPtrArray *
-config_data_get_calendars_to_load (void)
-{
- GPtrArray *cals;
- GSList *groups, *gl, *sources, *sl;
-
- ensure_inited ();
-
- /* create the array to be returned */
- cals = g_ptr_array_new ();
-
- /* process calendar sources */
- groups = e_source_list_peek_groups (calendar_source_list);
- for (gl = groups; gl != NULL; gl = gl->next) {
- sources = e_source_group_peek_sources (E_SOURCE_GROUP (gl->data));
- for (sl = sources; sl != NULL; sl = sl->next) {
- g_ptr_array_add (cals, sl->data);
- }
- }
-
- /* process tasks sources */
- groups = e_source_list_peek_groups (tasks_source_list);
- for (gl = groups; gl != NULL; gl = gl->next) {
- sources = e_source_group_peek_sources (E_SOURCE_GROUP (gl->data));
- for (sl = sources; sl != NULL; sl = sl->next) {
- g_ptr_array_add (cals, sl->data);
- }
- }
-
- return cals;
-}
diff --git a/calendar/gui/alarm-notify/config-data.h b/calendar/gui/alarm-notify/config-data.h
deleted file mode 100644
index 26b5dc111f..0000000000
--- a/calendar/gui/alarm-notify/config-data.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Evolution calendar - Configuration values for the alarm notification daemon
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Authors: Federico Mena-Quintero <federico@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef CONFIG_DATA_H
-#define CONFIG_DATA_H
-
-#include <glib.h>
-#include <libical/ical.h>
-#include <gconf/gconf-client.h>
-
-GConfClient *config_data_get_conf_client (void);
-
-icaltimezone *config_data_get_timezone (void);
-gboolean config_data_get_24_hour_format (void);
-GPtrArray *config_data_get_calendars_to_load (void);
-
-#endif
diff --git a/calendar/gui/alarm-notify/notify-main.c b/calendar/gui/alarm-notify/notify-main.c
deleted file mode 100644
index 6897d00857..0000000000
--- a/calendar/gui/alarm-notify/notify-main.c
+++ /dev/null
@@ -1,192 +0,0 @@
-/* Evolution calendar - Alarm notification service main file
- *
- * Copyright (C) 2000 Ximian, Inc.
- * Copyright (C) 2003 Novell, Inc.
- *
- * Authors: Federico Mena-Quintero <federico@ximian.com>
- * Rodrigo Moya <rodrigo@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <string.h>
-#include <glib.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnome/gnome-init.h>
-#include <libgnome/gnome-sound.h>
-#include <libgnomeui/gnome-client.h>
-#include <libgnomeui/gnome-ui-init.h>
-#include <libgnomevfs/gnome-vfs-init.h>
-#include <glade/glade.h>
-#include <bonobo/bonobo-main.h>
-#include <bonobo/bonobo-generic-factory.h>
-#include <bonobo-activation/bonobo-activation.h>
-#include <libedataserver/e-source.h>
-#include "alarm.h"
-#include "alarm-queue.h"
-#include "alarm-notify.h"
-#include "config-data.h"
-#include "save.h"
-
-
-
-static GnomeClient *master_client = NULL;
-
-static BonoboGenericFactory *factory;
-
-static AlarmNotify *alarm_notify_service = NULL;
-
-
-/* Callback for the master client's "die" signal. We must terminate the daemon
- * since the session is ending.
- */
-static void
-client_die_cb (GnomeClient *client)
-{
- bonobo_main_quit ();
-}
-
-/* Sees if a session manager is present. If so, it tells the SM how to restart
- * the daemon when the session starts. It also sets the die callback so that
- * the daemon can terminate properly when the session ends.
- */
-static void
-set_session_parameters (char **argv)
-{
- int flags;
- char *args[2];
-
- master_client = gnome_master_client ();
- flags = gnome_client_get_flags (master_client);
-
- if (!(flags & GNOME_CLIENT_IS_CONNECTED))
- return;
-
- /* The daemon should always be started up by the session manager when
- * the session starts. The daemon will take care of loading whatever
- * calendars it was told to load.
- */
- gnome_client_set_restart_style (master_client, GNOME_RESTART_ANYWAY);
-
- args[0] = argv[0];
- args[1] = NULL;
-
- gnome_client_set_restart_command (master_client, 1, args);
-
- g_signal_connect (G_OBJECT (master_client), "die",
- G_CALLBACK (client_die_cb), NULL);
-}
-
-/* Factory function for the alarm notify service; just creates and references a
- * singleton service object.
- */
-static BonoboObject *
-alarm_notify_factory_fn (BonoboGenericFactory *factory, const char *component_id, void *data)
-{
- if (!alarm_notify_service) {
- alarm_notify_service = alarm_notify_new ();
- g_assert (alarm_notify_service != NULL);
- }
-
- return NULL;
-}
-
-/* Loads the calendars that the alarm daemon has been told to load in the past */
-static gboolean
-load_calendars (gpointer user_data)
-{
- GPtrArray *cals;
- int i;
-
- alarm_queue_init ();
-
- /* create the alarm notification service */
- if (!alarm_notify_service) {
- alarm_notify_service = alarm_notify_new ();
- g_assert (alarm_notify_service != NULL);
- }
-
- cals = config_data_get_calendars_to_load ();
- if (!cals) {
- g_message ("load_calendars(): Could not get the list of calendars to load");
- return TRUE; /* should we continue retrying? */;
- }
-
- for (i = 0; i < cals->len; i++) {
- ESource *source;
- char *uri;
-
- source = cals->pdata[i];
-
- uri = e_source_get_uri (source);
- alarm_notify_add_calendar (alarm_notify_service, uri, FALSE);
- g_free (uri);
- }
-
- g_ptr_array_free (cals, TRUE);
-
- return FALSE;
-}
-
-int
-main (int argc, char **argv)
-{
- bindtextdomain (GETTEXT_PACKAGE, EVOLUTION_LOCALEDIR);
- bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
- textdomain (GETTEXT_PACKAGE);
-
- gnome_program_init ("evolution-alarm-notify", VERSION, LIBGNOMEUI_MODULE, argc, argv, NULL);
- gtk_init (&argc, &argv);
-
- if (bonobo_init (&argc, argv) == FALSE)
- g_error (_("Could not initialize Bonobo"));
-
- if (!gnome_vfs_init ())
- g_error (_("Could not initialize gnome-vfs"));
-
- glade_init ();
-
- gnome_sound_init ("localhost");
-
- factory = bonobo_generic_factory_new ("OAFIID:GNOME_Evolution_Calendar_AlarmNotify:" BASE_VERSION,
- (BonoboFactoryCallback) alarm_notify_factory_fn, NULL);
- if (!factory)
- g_error (_("Could not create the alarm notify service factory"));
-
- set_session_parameters (argv);
-
- g_idle_add ((GSourceFunc) load_calendars, NULL);
-
- bonobo_main ();
-
- bonobo_object_unref (BONOBO_OBJECT (factory));
- factory = NULL;
-
- bonobo_object_unref (BONOBO_OBJECT (alarm_notify_service));
-
- alarm_queue_done ();
- alarm_done ();
-
- if (alarm_notify_service)
- bonobo_object_unref (BONOBO_OBJECT (alarm_notify_service));
-
- gnome_sound_shutdown ();
- gnome_vfs_shutdown ();
-
- return 0;
-}
diff --git a/calendar/gui/alarm-notify/save.c b/calendar/gui/alarm-notify/save.c
deleted file mode 100644
index d0b127fb99..0000000000
--- a/calendar/gui/alarm-notify/save.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/* Evolution calendar - Functions to save alarm notification times
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Authors: Federico Mena-Quintero <federico@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-#include <bonobo/bonobo-arg.h>
-#include <bonobo/bonobo-exception.h>
-#include <bonobo/bonobo-moniker-util.h>
-#include "evolution-calendar.h"
-#include "config-data.h"
-#include "save.h"
-#include <gconf/gconf-client.h>
-
-
-
-/* Key names for the configuration values */
-
-#define KEY_LAST_NOTIFICATION_TIME "/apps/evolution/calendar/notify/last_notification_time"
-#define KEY_CALENDARS "/apps/evolution/calendar/notify/calendars"
-#define KEY_PROGRAMS "/apps/evolution/calendar/notify/programs"
-
-
-
-/**
- * save_notification_time:
- * @t: A time value.
- *
- * Saves the last notification time so that it can be fetched the next time the
- * alarm daemon is run. This way the daemon can show alarms that should have
- * triggered while it was not running.
- **/
-void
-save_notification_time (time_t t)
-{
- GConfClient *conf_client;
- time_t current_t;
-
- g_return_if_fail (t != -1);
-
- if (!(conf_client = config_data_get_conf_client ()))
- return;
-
- /* we only store the new notification time if it is bigger
- than the already stored one */
- current_t = gconf_client_get_int (conf_client, KEY_LAST_NOTIFICATION_TIME, NULL);
- if (t > current_t)
- gconf_client_set_int (conf_client, KEY_LAST_NOTIFICATION_TIME, t, NULL);
-}
-
-/**
- * get_saved_notification_time:
- *
- * Queries the last saved value for alarm notification times.
- *
- * Return value: The last saved value, or -1 if no value had been saved before.
- **/
-time_t
-get_saved_notification_time (void)
-{
- GConfClient *conf_client;
- long t;
-
- if (!(conf_client = config_data_get_conf_client ()))
- return -1;
-
- t = gconf_client_get_int (conf_client, KEY_LAST_NOTIFICATION_TIME, NULL);
-
- return (time_t) t;
-}
-
-/**
- * save_blessed_program:
- * @program: a program name
- *
- * Saves a program name as "blessed"
- **/
-void
-save_blessed_program (const char *program)
-{
- GConfClient *conf_client;
- GSList *l;
-
- if (!(conf_client = config_data_get_conf_client ()))
- return;
-
- l = gconf_client_get_list (conf_client, KEY_PROGRAMS, GCONF_VALUE_STRING, NULL);
- l = g_slist_append (l, g_strdup (program));
- gconf_client_set_list (conf_client, KEY_PROGRAMS, GCONF_VALUE_STRING, l, NULL);
- g_slist_foreach (l, (GFunc) g_free, NULL);
- g_slist_free (l);
-}
-
-/**
- * is_blessed_program:
- * @program: a program name
- *
- * Checks to see if a program is blessed
- *
- * Return value: TRUE if program is blessed, FALSE otherwise
- **/
-gboolean
-is_blessed_program (const char *program)
-{
- GConfClient *conf_client;
- GSList *l, *n;
- gboolean found = FALSE;
-
- if (!(conf_client = config_data_get_conf_client ()))
- return FALSE;
-
- l = gconf_client_get_list (conf_client, KEY_PROGRAMS, GCONF_VALUE_STRING, NULL);
- while (l) {
- n = l->next;
- if (!found)
- found = strcmp ((char *) l->data, program) == 0;
- g_free (l->data);
- g_slist_free_1 (l);
- l = n;
- }
-
- return found;
-}
diff --git a/calendar/gui/alarm-notify/save.h b/calendar/gui/alarm-notify/save.h
deleted file mode 100644
index f7cc75955c..0000000000
--- a/calendar/gui/alarm-notify/save.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Evolution calendar - Functions to save alarm notification times
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Authors: Federico Mena-Quintero <federico@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef SAVE_H
-#define SAVE_H
-
-#include <time.h>
-
-void save_notification_time (time_t t);
-time_t get_saved_notification_time (void);
-
-void save_calendars_to_load (GPtrArray *uris);
-GPtrArray *get_calendars_to_load (void);
-
-void save_blessed_program (const char *program);
-gboolean is_blessed_program (const char *program);
-
-#endif
diff --git a/calendar/gui/alarm-notify/util.c b/calendar/gui/alarm-notify/util.c
deleted file mode 100644
index 4bc91810a5..0000000000
--- a/calendar/gui/alarm-notify/util.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Evolution calendar - utility functions
- *
- * Copyright (C) 2000 Ximian, Inc.
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Author: Federico Mena-Quintero <federico@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <libgnome/gnome-i18n.h>
-#include <e-util/e-time-utils.h>
-#include <libecal/e-cal-time-util.h>
-#include "config-data.h"
-#include "util.h"
-
-/* Converts a time_t to a string, relative to the specified timezone */
-char *
-timet_to_str_with_zone (time_t t, icaltimezone *zone)
-{
- struct icaltimetype itt;
- struct tm tm;
- char buf[256];
-
- if (t == -1)
- return g_strdup (_("invalid time"));
-
- itt = icaltime_from_timet_with_zone (t, FALSE, zone);
- tm = icaltimetype_to_tm (&itt);
-
- e_time_format_date_and_time (&tm, config_data_get_24_hour_format (),
- FALSE, FALSE, buf, sizeof (buf));
- return g_strdup (buf);
-}
diff --git a/calendar/gui/alarm-notify/util.h b/calendar/gui/alarm-notify/util.h
deleted file mode 100644
index 7dae3dd7fe..0000000000
--- a/calendar/gui/alarm-notify/util.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Evolution calendar - utility functions
- *
- * Copyright (C) 2000 Ximian, Inc.
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Author: Federico Mena-Quintero <federico@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef UTIL_H
-#define UTIL_H
-
-#include <libecal/e-cal-component.h>
-
-char *timet_to_str_with_zone (time_t t, icaltimezone *zone);
-
-#endif
diff --git a/calendar/gui/apps_evolution_calendar.schemas.in.in b/calendar/gui/apps_evolution_calendar.schemas.in.in
deleted file mode 100644
index 27e9aa44e2..0000000000
--- a/calendar/gui/apps_evolution_calendar.schemas.in.in
+++ /dev/null
@@ -1,359 +0,0 @@
-<gconfschemafile>
- <schemalist>
-
- <!-- Display -->
-
- <schema>
- <key>/schemas/apps/evolution/calendar/display/timezone</key>
- <applyto>/apps/evolution/calendar/display/timezone</applyto>
- <owner>evolution-calendar</owner>
- <type>string</type>
- <default>UTC</default>
- <locale name="C">
- <short>Default timezone for meetings</short>
- </locale>
- </schema>
-
- <schema>
- <key>/schemas/apps/evolution/calendar/display/use_24hour_format</key>
- <applyto>/apps/evolution/calendar/display/use_24hour_format</applyto>
- <owner>evolution-calendar</owner>
- <type>bool</type>
- <default>false</default>
- <locale name="C">
- <short>Whether to show times in 24h format instead of using am/pm</short>
- </locale>
- </schema>
-
- <schema>
- <key>/schemas/apps/evolution/calendar/display/week_start_day</key>
- <applyto>/apps/evolution/calendar/display/week_start_day</applyto>
- <owner>evolution-calendar</owner>
- <type>int</type>
- <default>1</default>
- <locale name="C">
- <short>Weekday the week starts on</short>
- </locale>
- </schema>
-
- <schema>
- <key>/schemas/apps/evolution/calendar/display/day_start_hour</key>
- <applyto>/apps/evolution/calendar/display/day_start_hour</applyto>
- <owner>evolution-calendar</owner>
- <type>int</type>
- <default>9</default>
- <locale name="C">
- <short>Hour the workday starts on</short>
- </locale>
- </schema>
-
- <schema>
- <key>/schemas/apps/evolution/calendar/display/day_start_minute</key>
- <applyto>/apps/evolution/calendar/display/day_start_minute</applyto>
- <owner>evolution-calendar</owner>
- <type>int</type>
- <default>0</default>
- <locale name="C">
- <short>Minute the workday starts on</short>
- </locale>
- </schema>
-
- <schema>
- <key>/schemas/apps/evolution/calendar/display/day_end_hour</key>
- <applyto>/apps/evolution/calendar/display/day_end_hour</applyto>
- <owner>evolution-calendar</owner>
- <type>int</type>
- <default>17</default>
- <locale name="C">
- <short>Hour the workday ends on</short>
- </locale>
- </schema>
-
- <schema>
- <key>/schemas/apps/evolution/calendar/display/day_end_minute</key>
- <applyto>/apps/evolution/calendar/display/day_end_minute</applyto>
- <owner>evolution-calendar</owner>
- <type>int</type>
- <default>0</default>
- <locale name="C">
- <short>Minute the workday ends on</short>
- </locale>
- </schema>
-
- <schema>
- <key>/schemas/apps/evolution/calendar/display/time_divisions</key>
- <applyto>/apps/evolution/calendar/display/time_divisions</applyto>
- <owner>evolution-calendar</owner>
- <type>int</type>
- <default>30</default>
- <locale name="C">
- <short>Intervals shown in Day and Work Week views</short>
- </locale>
- </schema>
-
- <schema>
- <key>/schemas/apps/evolution/calendar/display/default_view</key>
- <applyto>/apps/evolution/calendar/display/default_view</applyto>
- <owner>evolution-calendar</owner>
- <type>int</type>
- <default>0</default>
- <locale name="C">
- <short>The view showing when the calendar starts</short>
- </locale>
- </schema>
-
- <schema>
- <key>/schemas/apps/evolution/calendar/display/hpane_position</key>
- <applyto>/apps/evolution/calendar/display/hpane_position</applyto>
- <owner>evolution-calendar</owner>
- <type>int</type>
- <default>400</default>
- <locale name="C">
- <short>Position of the horizontal pane</short>
- </locale>
- </schema>
-
- <schema>
- <key>/schemas/apps/evolution/calendar/display/vpane_position</key>
- <applyto>/apps/evolution/calendar/display/vpane_position</applyto>
- <owner>evolution-calendar</owner>
- <type>int</type>
- <default>150</default>
- <locale name="C">
- <short>Position of the vertical pane</short>
- </locale>
- </schema>
-
- <schema>
- <key>/schemas/apps/evolution/calendar/display/month_hpane_position</key>
- <applyto>/apps/evolution/calendar/display/month_hpane_position</applyto>
- <owner>evolution-calendar</owner>
- <type>int</type>
- <default>32000</default>
- <locale name="C">
- <short>Position of the horizontal pane in the month view</short>
- </locale>
- </schema>
-
- <schema>
- <key>/schemas/apps/evolution/calendar/display/month_vpane_position</key>
- <applyto>/apps/evolution/calendar/display/month_vpane_position</applyto>
- <owner>evolution-calendar</owner>
- <type>int</type>
- <default>150</default>
- <locale name="C">
- <short>Position of the vertical pane in the month view</short>
- </locale>
- </schema>
-
- <schema>
- <key>/schemas/apps/evolution/calendar/display/task_vpane_position</key>
- <applyto>/apps/evolution/calendar/display/task_vpane_position</applyto>
- <owner>evolution-calendar</owner>
- <type>int</type>
- <default>400</default>
- <locale name="C">
- <short>Position of the vertical pane in the task view</short>
- </locale>
- </schema>
-
- <schema>
- <key>/schemas/apps/evolution/calendar/display/compress_weekend</key>
- <applyto>/apps/evolution/calendar/display/compress_weekend</applyto>
- <owner>evolution-calendar</owner>
- <type>bool</type>
- <default>true</default>
- <locale name="C">
- <short>Allocate less space to weekend appointments</short>
- </locale>
- </schema>
-
- <schema>
- <key>/schemas/apps/evolution/calendar/display/show_event_end</key>
- <applyto>/apps/evolution/calendar/display/show_event_end</applyto>
- <owner>evolution-calendar</owner>
- <type>bool</type>
- <default>true</default>
- <locale name="C">
- <short>Show where events end in week and month views</short>
- </locale>
- </schema>
-
- <schema>
- <key>/schemas/apps/evolution/calendar/display/working_days</key>
- <applyto>/apps/evolution/calendar/display/working_days</applyto>
- <owner>evolution-calendar</owner>
- <type>int</type>
- <default>62</default>
- <locale name="C">
- <short>Days that are work days</short>
- </locale>
- </schema>
-
- <!-- Tasks -->
-
- <schema>
- <key>/schemas/apps/evolution/calendar/tasks/hide_completed</key>
- <applyto>/apps/evolution/calendar/tasks/hide_completed</applyto>
- <owner>evolution-calendar</owner>
- <type>bool</type>
- <default>false</default>
- <locale name="C">
- <short>Whether to hide completed tasks</short>
- </locale>
- </schema>
-
- <schema>
- <key>/schemas/apps/evolution/calendar/tasks/hide_completed_units</key>
- <applyto>/apps/evolution/calendar/tasks/hide_completed_units</applyto>
- <owner>evolution-calendar</owner>
- <type>string</type>
- <default>days</default>
- <locale name="C">
- <short>Units for determining when to hide tasks</short>
- </locale>
- </schema>
-
- <schema>
- <key>/schemas/apps/evolution/calendar/tasks/hide_completed_value</key>
- <applyto>/apps/evolution/calendar/tasks/hide_completed_value</applyto>
- <owner>evolution-calendar</owner>
- <type>int</type>
- <default>1</default>
- <locale name="C">
- <short>Number of units for determining when to hide tasks</short>
- </locale>
- </schema>
-
- <!-- Tasks: Colors -->
-
- <schema>
- <key>/schemas/apps/evolution/calendar/tasks/colors/due_today</key>
- <applyto>/apps/evolution/calendar/tasks/colors/due_today</applyto>
- <owner>evolution-calendar</owner>
- <type>string</type>
- <default>blue</default>
- <locale name="C">
- <short>Color of tasks that are due today</short>
- </locale>
- </schema>
-
- <schema>
- <key>/schemas/apps/evolution/calendar/tasks/colors/overdue</key>
- <applyto>/apps/evolution/calendar/tasks/colors/overdue</applyto>
- <owner>evolution-calendar</owner>
- <type>string</type>
- <default>red</default>
- <locale name="C">
- <short>Color of tasks that are overdue</short>
- </locale>
- </schema>
-
- <!-- Miscellaneous -->
-
- <schema>
- <key>/schemas/apps/evolution/calendar/prompts/confirm_delete</key>
- <applyto>/apps/evolution/calendar/prompts/confirm_delete</applyto>
- <owner>evolution-calendar</owner>
- <type>bool</type>
- <default>true</default>
- <locale name="C">
- <short>Whether to ask for confirmation on appointment deletion</short>
- </locale>
- </schema>
-
- <schema>
- <key>/schemas/apps/evolution/calendar/prompts/confirm_expunge</key>
- <applyto>/apps/evolution/calendar/prompts/confirm_expunge</applyto>
- <owner>evolution-calendar</owner>
- <type>bool</type>
- <default>true</default>
- <locale name="C">
- <short>Whether to ask for confirmation when folder is expunged</short>
- </locale>
- </schema>
-
- <schema>
- <key>/schemas/apps/evolution/calendar/other/use_default_reminder</key>
- <applyto>/apps/evolution/calendar/other/use_default_reminder</applyto>
- <owner>evolution-calendar</owner>
- <type>bool</type>
- <default>false</default>
- <locale name="C">
- <short>Whether to set a default reminder for events</short>
- </locale>
- </schema>
-
- <schema>
- <key>/schemas/apps/evolution/calendar/other/default_reminder_interval</key>
- <applyto>/apps/evolution/calendar/other/default_reminder_interval</applyto>
- <owner>evolution-calendar</owner>
- <type>int</type>
- <default>15</default>
- <locale name="C">
- <short>Number of units for default reminder</short>
- </locale>
- </schema>
-
- <schema>
- <key>/schemas/apps/evolution/calendar/other/default_reminder_units</key>
- <applyto>/apps/evolution/calendar/other/default_reminder_units</applyto>
- <owner>evolution-calendar</owner>
- <type>string</type>
- <default></default>
- <locale name="C">
- <short>Units of default reminder</short>
- </locale>
- </schema>
-
- <!-- Date navigator -->
-
- <schema>
- <key>/schemas/apps/evolution/calendar/date_navigator/show_week_numbers</key>
- <applyto>/apps/evolution/calendar/date_navigator/show_week_numbers</applyto>
- <owner>evolution-calendar</owner>
- <type>bool</type>
- <default>false</default>
- <locale name="C">
- <short>Whether to show week numbers in date navigator</short>
- </locale>
- </schema>
-
- <!-- Alarm notification -->
-
- <schema>
- <key>/schemas/apps/evolution/calendar/notify/last_notification_time</key>
- <applyto>/apps/evolution/calendar/notify/last_notification_time</applyto>
- <owner>evolution-calendar</owner>
- <type>int</type>
- <default>-1</default>
- <locale name="C">
- <short>Time last alarm ran</short>
- </locale>
- </schema>
-
- <schema>
- <key>/schemas/apps/evolution/calendar/notify/calendars</key>
- <applyto>/apps/evolution/calendar/notify/calendars</applyto>
- <owner>evolution-calendar</owner>
- <type>list</type>
- <list_type>string</list_type>
- <default>[]</default>
- <locale name="C">
- <short>Calendars to run alarms for</short>
- </locale>
- </schema>
-
- <schema>
- <key>/schemas/apps/evolution/calendar/notify/programs</key>
- <applyto>/apps/evolution/calendar/notify/programs</applyto>
- <owner>evolution-calendar</owner>
- <type>list</type>
- <list_type>string</list_type>
- <default>[]</default>
- <locale name="C">
- <short>Programs that can run as part of alarms</short>
- </locale>
- </schema>
- </schemalist>
-</gconfschemafile>
diff --git a/calendar/gui/cal-search-bar.c b/calendar/gui/cal-search-bar.c
deleted file mode 100644
index 477a6d91a7..0000000000
--- a/calendar/gui/cal-search-bar.c
+++ /dev/null
@@ -1,513 +0,0 @@
-/* Evolution calendar - Search bar widget for calendar views
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Author: Federico Mena-Quintero <federico@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-#include <glib.h>
-#include <gtk/gtkmenu.h>
-#include <gtk/gtkmenuitem.h>
-#include <gtk/gtkoptionmenu.h>
-#include <gtk/gtksignal.h>
-#include <libgnome/gnome-i18n.h>
-#include <gal/util/e-util.h>
-#include "cal-search-bar.h"
-
-
-
-/* IDs and option items for the ESearchBar */
-enum {
- SEARCH_ANY_FIELD_CONTAINS,
- SEARCH_SUMMARY_CONTAINS,
- SEARCH_DESCRIPTION_CONTAINS,
- SEARCH_COMMENT_CONTAINS,
- SEARCH_CATEGORY_IS,
-};
-
-static ESearchBarItem search_option_items[] = {
- { N_("Any field contains"), SEARCH_ANY_FIELD_CONTAINS, NULL },
- { N_("Summary contains"), SEARCH_SUMMARY_CONTAINS, NULL },
- { N_("Description contains"), SEARCH_DESCRIPTION_CONTAINS, NULL },
- { N_("Comment contains"), SEARCH_COMMENT_CONTAINS, NULL },
- { N_("Category is"), SEARCH_CATEGORY_IS, NULL },
- { NULL, -1, NULL }
-};
-
-/* IDs for the categories suboptions */
-#define CATEGORIES_ALL 0
-#define CATEGORIES_UNMATCHED 1
-#define CATEGORIES_OFFSET 3
-
-/* Private part of the CalSearchBar structure */
-struct CalSearchBarPrivate {
- /* Array of categories */
- GPtrArray *categories;
-};
-
-
-
-static void cal_search_bar_class_init (CalSearchBarClass *class);
-static void cal_search_bar_init (CalSearchBar *cal_search);
-static void cal_search_bar_destroy (GtkObject *object);
-
-static void cal_search_bar_search_activated (ESearchBar *search);
-
-static ESearchBarClass *parent_class = NULL;
-
-/* Signal IDs */
-enum {
- SEXP_CHANGED,
- CATEGORY_CHANGED,
- LAST_SIGNAL
-};
-
-static guint cal_search_bar_signals[LAST_SIGNAL] = { 0 };
-
-
-
-E_MAKE_TYPE (cal_search_bar, "CalSearchBar", CalSearchBar, cal_search_bar_class_init,
- cal_search_bar_init, E_SEARCH_BAR_TYPE);
-
-/* Class initialization function for the calendar search bar */
-static void
-cal_search_bar_class_init (CalSearchBarClass *class)
-{
- ESearchBarClass *e_search_bar_class;
- GtkObjectClass *object_class;
-
- e_search_bar_class = (ESearchBarClass *) class;
- object_class = (GtkObjectClass *) class;
-
- parent_class = g_type_class_peek_parent (class);
-
- cal_search_bar_signals[SEXP_CHANGED] =
- gtk_signal_new ("sexp_changed",
- GTK_RUN_FIRST,
- G_TYPE_FROM_CLASS (object_class),
- GTK_SIGNAL_OFFSET (CalSearchBarClass, sexp_changed),
- gtk_marshal_NONE__STRING,
- GTK_TYPE_NONE, 1,
- GTK_TYPE_STRING);
-
- cal_search_bar_signals[CATEGORY_CHANGED] =
- gtk_signal_new ("category_changed",
- GTK_RUN_FIRST,
- G_TYPE_FROM_CLASS (object_class),
- GTK_SIGNAL_OFFSET (CalSearchBarClass, category_changed),
- gtk_marshal_NONE__STRING,
- GTK_TYPE_NONE, 1,
- GTK_TYPE_STRING);
-
- class->sexp_changed = NULL;
- class->category_changed = NULL;
-
- e_search_bar_class->search_activated = cal_search_bar_search_activated;
-
- object_class->destroy = cal_search_bar_destroy;
-}
-
-/* Object initialization function for the calendar search bar */
-static void
-cal_search_bar_init (CalSearchBar *cal_search)
-{
- CalSearchBarPrivate *priv;
-
- priv = g_new (CalSearchBarPrivate, 1);
- cal_search->priv = priv;
-
- priv->categories = g_ptr_array_new ();
- g_ptr_array_set_size (priv->categories, 0);
-}
-
-/* Frees an array of categories */
-static void
-free_categories (GPtrArray *categories)
-{
- int i;
-
- for (i = 0; i < categories->len; i++) {
- g_assert (categories->pdata[i] != NULL);
- g_free (categories->pdata[i]);
- }
-
- g_ptr_array_free (categories, TRUE);
-}
-
-/* Destroy handler for the calendar search bar */
-static void
-cal_search_bar_destroy (GtkObject *object)
-{
- CalSearchBar *cal_search;
- CalSearchBarPrivate *priv;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (IS_CAL_SEARCH_BAR (object));
-
- cal_search = CAL_SEARCH_BAR (object);
- priv = cal_search->priv;
-
- if (priv) {
- if (priv->categories) {
- free_categories (priv->categories);
- priv->categories = NULL;
- }
-
- g_free (priv);
- cal_search->priv = NULL;
- }
-
- if (GTK_OBJECT_CLASS (parent_class)->destroy)
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
-}
-
-
-
-/* Emits the "sexp_changed" signal for the calendar search bar */
-static void
-notify_sexp_changed (CalSearchBar *cal_search, const char *sexp)
-{
- gtk_signal_emit (GTK_OBJECT (cal_search), cal_search_bar_signals[SEXP_CHANGED],
- sexp);
-}
-
-/* Returns the string of the currently selected category, NULL for "Unmatched",
- * or (const char *) 1 for "All".
- */
-static const char *
-get_current_category (CalSearchBar *cal_search)
-{
- CalSearchBarPrivate *priv;
- int id, subid;
-
- priv = cal_search->priv;
-
- g_assert (priv->categories != NULL);
-
- id = e_search_bar_get_item_id (E_SEARCH_BAR (cal_search));
- if (id != SEARCH_CATEGORY_IS)
- return NULL;
-
- subid = e_search_bar_get_subitem_id (E_SEARCH_BAR (cal_search));
- if (subid == CATEGORIES_ALL)
- return (const char *) 1;
- else if (subid == CATEGORIES_UNMATCHED)
- return NULL;
- else {
- int i;
-
- i = subid - CATEGORIES_OFFSET;
- g_assert (i >= 0 && i < priv->categories->len);
-
- return priv->categories->pdata[i];
- }
-}
-
-/* Sets the query string to be (contains? "field" "text") */
-static void
-notify_e_cal_view_contains (CalSearchBar *cal_search, const char *field)
-{
- char *text;
- char *sexp;
-
- text = e_search_bar_get_text (E_SEARCH_BAR (cal_search));
- if (!text)
- return; /* This is an error in the UTF8 conversion, not an empty string! */
-
- sexp = g_strdup_printf ("(contains? \"%s\" \"%s\")", field, text);
- g_free (text);
-
- notify_sexp_changed (cal_search, sexp);
- g_free (sexp);
-}
-
-/* Returns a sexp for the selected category in the drop-down menu. The "All"
- * option is returned as (const char *) 1, and the "Unfiled" option is returned
- * as NULL.
- */
-static char *
-get_category_sexp (CalSearchBar *cal_search)
-{
- const char *category;
-
- category = get_current_category (cal_search);
-
- if (category == NULL)
- return g_strdup ("(has-categories? #f)"); /* Unfiled items */
- else if (category == (const char *) 1)
- return NULL; /* All items */
- else
- return g_strdup_printf ("(has-categories? \"%s\")", category); /* Specific category */
-}
-
-/* Sets the query string to the appropriate match for categories */
-static void
-notify_category_is (CalSearchBar *cal_search)
-{
- char *sexp;
-
- sexp = get_category_sexp (cal_search);
- if (!sexp)
- notify_sexp_changed (cal_search, "#t"); /* Match all */
- else
- notify_sexp_changed (cal_search, sexp);
-
- if (sexp)
- g_free (sexp);
-}
-
-/* Creates a new query from the values in the widgets and notifies upstream */
-static void
-regen_query (CalSearchBar *cal_search)
-{
- CalSearchBarPrivate *priv;
- int id;
- const char *category;
-
- priv = cal_search->priv;
-
- /* Fetch the data from the ESearchBar's entry widgets */
-
- id = e_search_bar_get_item_id (E_SEARCH_BAR (cal_search));
-
- /* Generate the different types of queries */
-
- switch (id) {
- case SEARCH_ANY_FIELD_CONTAINS:
- notify_e_cal_view_contains (cal_search, "any");
- break;
-
- case SEARCH_SUMMARY_CONTAINS:
- notify_e_cal_view_contains (cal_search, "summary");
- break;
-
- case SEARCH_DESCRIPTION_CONTAINS:
- notify_e_cal_view_contains (cal_search, "description");
- break;
-
- case SEARCH_COMMENT_CONTAINS:
- notify_e_cal_view_contains (cal_search, "comment");
- break;
-
- case SEARCH_CATEGORY_IS:
- notify_category_is (cal_search);
-
- category = cal_search_bar_get_category (cal_search);
- gtk_signal_emit (GTK_OBJECT (cal_search), cal_search_bar_signals[CATEGORY_CHANGED],
- category);
- break;
-
- default:
- g_assert_not_reached ();
- }
-}
-
-/* search_activated handler for the calendar search bar */
-static void
-cal_search_bar_search_activated (ESearchBar *search)
-{
- CalSearchBar *cal_search;
-
- cal_search = CAL_SEARCH_BAR (search);
- regen_query (cal_search);
-}
-
-
-
-/* Creates the suboptions menu for the ESearchBar with the list of categories */
-static void
-make_suboptions (CalSearchBar *cal_search)
-{
- CalSearchBarPrivate *priv;
- ESearchBarSubitem *subitems;
- int i;
-
- priv = cal_search->priv;
-
- g_assert (priv->categories != NULL);
-
- /* Categories plus "all", "unmatched", separator, terminator */
- subitems = g_new (ESearchBarSubitem, priv->categories->len + 3 + 1);
-
- /* All, unmatched, separator */
-
- subitems[0].text = _("Any Category");
- subitems[0].id = CATEGORIES_ALL;
- subitems[0].translate = FALSE;
-
- subitems[1].text = _("Unmatched");
- subitems[1].id = CATEGORIES_UNMATCHED;
- subitems[1].translate = FALSE;
-
- /* All the other items */
-
- if (priv->categories->len > 0) {
- subitems[2].text = NULL; /* separator */
- subitems[2].id = 0;
-
- for (i = 0; i < priv->categories->len; i++) {
- const char *category;
- char *str;
-
- category = priv->categories->pdata[i];
- str = g_strdup (category ? category : "");
-
- subitems[i + CATEGORIES_OFFSET].text = str;
- subitems[i + CATEGORIES_OFFSET].id = i + CATEGORIES_OFFSET;
- subitems[i + CATEGORIES_OFFSET].translate = FALSE;
- }
-
- subitems[i + CATEGORIES_OFFSET].id = -1; /* terminator */
- } else
- subitems[2].id = -1; /* terminator */
-
- e_search_bar_set_suboption (E_SEARCH_BAR (cal_search), SEARCH_CATEGORY_IS, subitems);
-
- /* Free the strings */
- for (i = 0; i < priv->categories->len; i++)
- g_free (subitems[i + CATEGORIES_OFFSET].text);
-
- g_free (subitems);
-}
-
-/**
- * cal_search_bar_construct:
- * @cal_search: A calendar search bar.
- *
- * Constructs a calendar search bar by binding its menu and option items.
- *
- * Return value: The same value as @cal_search.
- **/
-CalSearchBar *
-cal_search_bar_construct (CalSearchBar *cal_search)
-{
- g_return_val_if_fail (cal_search != NULL, NULL);
- g_return_val_if_fail (IS_CAL_SEARCH_BAR (cal_search), NULL);
-
- e_search_bar_construct (E_SEARCH_BAR (cal_search), NULL, search_option_items);
- make_suboptions (cal_search);
-
- e_search_bar_set_ids (E_SEARCH_BAR (cal_search), SEARCH_CATEGORY_IS, CATEGORIES_ALL);
-
- return cal_search;
-}
-
-/**
- * cal_search_bar_new:
- *
- * Creates a new calendar search bar.
- *
- * Return value: A newly-created calendar search bar. You should connect to the
- * "sexp_changed" signal to monitor changes in the generated sexps.
- **/
-GtkWidget *
-cal_search_bar_new (void)
-{
- CalSearchBar *cal_search;
-
- cal_search = g_object_new (TYPE_CAL_SEARCH_BAR, NULL);
- return GTK_WIDGET (cal_search_bar_construct (cal_search));
-}
-
-/* Used from qsort() */
-static int
-compare_categories_cb (const void *a, const void *b)
-{
- const char **ca, **cb;
-
- ca = (const char **) a;
- cb = (const char **) b;
-
- /* FIXME: should use some utf8 strcoll() thingy */
- return strcmp (*ca, *cb);
-}
-
-/* Creates a sorted array of categories based on the original one; copies the
- * string values.
- */
-static GPtrArray *
-sort_categories (GPtrArray *categories)
-{
- GPtrArray *c;
- int i;
-
- c = g_ptr_array_new ();
- g_ptr_array_set_size (c, categories->len);
-
- for (i = 0; i < categories->len; i++)
- c->pdata[i] = g_strdup (categories->pdata[i]);
-
- qsort (c->pdata, c->len, sizeof (gpointer), compare_categories_cb);
-
- return c;
-}
-
-/**
- * cal_search_bar_set_categories:
- * @cal_search: A calendar search bar.
- * @categories: Array of pointers to strings for the category names.
- *
- * Sets the list of categories that are to be shown in the drop-down list
- * of a calendar search bar. The search bar will automatically add an item
- * for "unfiled" components, that is, those that have no categories assigned
- * to them.
- **/
-void
-cal_search_bar_set_categories (CalSearchBar *cal_search, GPtrArray *categories)
-{
- CalSearchBarPrivate *priv;
-
- g_return_if_fail (cal_search != NULL);
- g_return_if_fail (IS_CAL_SEARCH_BAR (cal_search));
- g_return_if_fail (categories != NULL);
-
- priv = cal_search->priv;
-
- g_assert (priv->categories != NULL);
- free_categories (priv->categories);
-
- priv->categories = sort_categories (categories);
- make_suboptions (cal_search);
-}
-
-/**
- * cal_search_bar_get_category:
- * @cal_search: A calendar search bar.
- *
- * Queries the currently selected category name in a calendar search bar.
- * If "All" or "Unfiled" are selected, this function will return NULL.
- *
- * Return value: Name of the selected category, or NULL if there is no
- * selected category.
- **/
-const char *
-cal_search_bar_get_category (CalSearchBar *cal_search)
-{
- const char *category;
-
- category = get_current_category (cal_search);
-
- if (!category || category == (const char *) 1)
- return NULL;
- else
- return category;
-}
diff --git a/calendar/gui/cal-search-bar.h b/calendar/gui/cal-search-bar.h
deleted file mode 100644
index a8910ba7b4..0000000000
--- a/calendar/gui/cal-search-bar.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Evolution calendar - Search bar widget for calendar views
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Author: Federico Mena-Quintero <federico@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef CAL_SEARCH_BAR_H
-#define CAL_SEARCH_BAR_H
-
-#include "widgets/misc/e-search-bar.h"
-#include "widgets/misc/e-filter-bar.h"
-
-G_BEGIN_DECLS
-
-
-
-#define TYPE_CAL_SEARCH_BAR (cal_search_bar_get_type ())
-#define CAL_SEARCH_BAR(obj) (GTK_CHECK_CAST ((obj), TYPE_CAL_SEARCH_BAR, CalSearchBar))
-#define CAL_SEARCH_BAR_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), TYPE_CAL_SEARCH_BAR, \
- CalSearchBarClass))
-#define IS_CAL_SEARCH_BAR(obj) (GTK_CHECK_TYPE ((obj), TYPE_CAL_SEARCH_BAR))
-#define IS_CAL_SEARCH_BAR_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), TYPE_CAL_SEARCH_BAR))
-
-typedef struct CalSearchBarPrivate CalSearchBarPrivate;
-
-typedef struct {
- ESearchBar search_bar;
-
- /* Private data */
- CalSearchBarPrivate *priv;
-} CalSearchBar;
-
-typedef struct {
- ESearchBarClass parent_class;
-
- /* Notification signals */
-
- void (* sexp_changed) (CalSearchBar *cal_search, const char *sexp);
- void (* category_changed) (CalSearchBar *cal_search, const char *category);
-} CalSearchBarClass;
-
-GtkType cal_search_bar_get_type (void);
-
-CalSearchBar *cal_search_bar_construct (CalSearchBar *cal_search);
-
-GtkWidget *cal_search_bar_new (void);
-
-void cal_search_bar_set_categories (CalSearchBar *cal_search, GPtrArray *categories);
-
-const char *cal_search_bar_get_category (CalSearchBar *cal_search);
-
-
-
-G_END_DECLS
-
-#endif
diff --git a/calendar/gui/calendar-commands.c b/calendar/gui/calendar-commands.c
deleted file mode 100644
index 3ed09c3bc7..0000000000
--- a/calendar/gui/calendar-commands.c
+++ /dev/null
@@ -1,810 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* Evolution calendar - Commands for the calendar GUI control
- *
- * Copyright (C) 1998 The Free Software Foundation
- * Copyright (C) 2000 Ximian, Inc.
- * Copyright (C) 2000 Ximian, Inc.
- *
- * Authors: Miguel de Icaza <miguel@ximian.com>
- * Federico Mena-Quintero <federico@ximian.com>
- * Seth Alves <alves@hungry.com>
- * Rodrigo Moya <rodrigo@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-#include <pwd.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <string.h>
-#include <ctype.h>
-#include <errno.h>
-
-#include <gdk-pixbuf/gdk-pixbuf.h>
-#include <gtk/gtkfilesel.h>
-#include <gtk/gtklabel.h>
-#include <gtk/gtkmain.h>
-#include <gtk/gtksignal.h>
-#include <gtk/gtkspinbutton.h>
-#include <gtk/gtkmessagedialog.h>
-#include <libgnome/gnome-util.h>
-#include <libgnomeui/gnome-dialog-util.h>
-#include <libgnomeui/gnome-messagebox.h>
-#include <libgnomeui/gnome-stock-icons.h>
-#include <libgnome/gnome-util.h>
-#include <libgnome/gnome-i18n.h>
-#include <bonobo/bonobo-ui-util.h>
-#include <bonobo/bonobo-exception.h>
-#include <gal/util/e-util.h>
-#include <libecal/e-cal-time-util.h>
-#include "shell/Evolution.h"
-#include "calendar-commands.h"
-#include "calendar-config.h"
-#include "e-day-view.h"
-#include "e-week-view.h"
-#include "gnome-cal.h"
-#include "goto.h"
-#include "print.h"
-#include "dialogs/cal-prefs-dialog.h"
-#include "dialogs/new-calendar.h"
-#include "itip-utils.h"
-#include "evolution-shell-component-utils.h"
-
-/* Focusing information for the calendar view. We have to keep track of this
- * ourselves because with Bonobo controls, we may get unpaired focus_out events.
- */
-typedef struct {
- guint calendar_focused : 1;
- guint taskpad_focused : 1;
-} FocusData;
-
-static void
-file_new_calendar_cb (BonoboUIComponent *uic, gpointer data, const char *path)
-{
- GnomeCalendar *gcal;
-
- gcal = GNOME_CALENDAR (data);
-
- new_calendar_dialog (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gcal))));
-}
-
-/* Prints the calendar at its current view and time range */
-static void
-print (GnomeCalendar *gcal, gboolean preview)
-{
- time_t start;
- GnomeCalendarViewType view_type;
- PrintView print_view;
-
- gnome_calendar_get_current_time_range (gcal, &start, NULL);
- view_type = gnome_calendar_get_view (gcal);
-
- switch (view_type) {
- case GNOME_CAL_DAY_VIEW:
- print_view = PRINT_VIEW_DAY;
- break;
-
- case GNOME_CAL_WORK_WEEK_VIEW:
- case GNOME_CAL_WEEK_VIEW:
- print_view = PRINT_VIEW_WEEK;
- break;
-
- case GNOME_CAL_MONTH_VIEW:
- print_view = PRINT_VIEW_MONTH;
- break;
-
- default:
- g_assert_not_reached ();
- return;
- }
-
- print_calendar (gcal, preview, start, print_view);
-}
-
-/* File/Print callback */
-static void
-file_print_cb (BonoboUIComponent *uic, gpointer data, const char *path)
-{
- GnomeCalendar *gcal;
-
- gcal = GNOME_CALENDAR (data);
- print (gcal, FALSE);
-}
-
-static void
-file_print_preview_cb (BonoboUIComponent *uic, gpointer data, const char *path)
-{
- GnomeCalendar *gcal;
-
- gcal = GNOME_CALENDAR (data);
- print (gcal, TRUE);
-}
-
-/* Sets a clock cursor for the specified calendar window */
-static void
-set_clock_cursor (GnomeCalendar *gcal)
-{
- GdkCursor *cursor;
-
- cursor = gdk_cursor_new (GDK_WATCH);
- gdk_window_set_cursor (GTK_WIDGET (gcal)->window, cursor);
- gdk_cursor_destroy (cursor);
- gdk_flush ();
-}
-
-/* Resets the normal cursor for the specified calendar window */
-static void
-set_normal_cursor (GnomeCalendar *gcal)
-{
- gdk_window_set_cursor (GTK_WIDGET (gcal)->window, NULL);
- gdk_flush ();
-}
-
-static void
-previous_clicked (BonoboUIComponent *uic, gpointer data, const char *path)
-{
- GnomeCalendar *gcal;
-
- gcal = GNOME_CALENDAR (data);
-
- set_clock_cursor (gcal);
- gnome_calendar_previous (gcal);
- set_normal_cursor (gcal);
-}
-
-static void
-next_clicked (BonoboUIComponent *uic, gpointer data, const char *path)
-{
- GnomeCalendar *gcal;
-
- gcal = GNOME_CALENDAR (data);
-
- set_clock_cursor (gcal);
- gnome_calendar_next (gcal);
- set_normal_cursor (gcal);
-}
-
-void
-calendar_goto_today (GnomeCalendar *gcal)
-{
- set_clock_cursor (gcal);
- gnome_calendar_goto_today (gcal);
- set_normal_cursor (gcal);
-}
-
-static void
-today_clicked (BonoboUIComponent *uic, gpointer data, const char *path)
-{
- GnomeCalendar *gcal;
-
- gcal = GNOME_CALENDAR (data);
-
- calendar_goto_today (gcal);
-}
-
-static void
-goto_clicked (BonoboUIComponent *uic, gpointer data, const char *path)
-{
- GnomeCalendar *gcal;
-
- gcal = GNOME_CALENDAR (data);
-
- goto_dialog (gcal);
-}
-
-static void
-show_day_view_clicked (BonoboUIComponent *uic, gpointer data, const char *path)
-{
- GnomeCalendar *gcal;
-
- gcal = GNOME_CALENDAR (data);
-
- gnome_calendar_set_view (gcal, GNOME_CAL_DAY_VIEW, FALSE, TRUE);
-}
-
-static void
-show_work_week_view_clicked (BonoboUIComponent *uic, gpointer data, const char *path)
-{
- GnomeCalendar *gcal;
-
- gcal = GNOME_CALENDAR (data);
-
- gnome_calendar_set_view (gcal, GNOME_CAL_WORK_WEEK_VIEW, FALSE, TRUE);
-}
-
-static void
-show_week_view_clicked (BonoboUIComponent *uic, gpointer data, const char *path)
-{
- GnomeCalendar *gcal;
-
- gcal = GNOME_CALENDAR (data);
-
- gnome_calendar_set_view (gcal, GNOME_CAL_WEEK_VIEW, FALSE, TRUE);
-}
-
-static void
-show_month_view_clicked (BonoboUIComponent *uic, gpointer data, const char *path)
-{
- GnomeCalendar *gcal;
-
- gcal = GNOME_CALENDAR (data);
-
- gnome_calendar_set_view (gcal, GNOME_CAL_MONTH_VIEW, FALSE, TRUE);
-}
-
-
-static void
-show_list_view_clicked (BonoboUIComponent *uic, gpointer data, const char *path)
-{
- GnomeCalendar *gcal;
-
- gcal = GNOME_CALENDAR (data);
-
- gnome_calendar_set_view (gcal, GNOME_CAL_LIST_VIEW, FALSE, TRUE);
-}
-
-
-static void
-cut_cmd (BonoboUIComponent *uic, gpointer data, const gchar *path)
-{
- GnomeCalendar *gcal;
-
- gcal = GNOME_CALENDAR (data);
- set_clock_cursor (gcal);
- gnome_calendar_cut_clipboard (gcal);
- set_normal_cursor (gcal);
-}
-
-static void
-copy_cmd (BonoboUIComponent *uic, gpointer data, const gchar *path)
-{
- GnomeCalendar *gcal;
-
- gcal = GNOME_CALENDAR (data);
-
- set_clock_cursor (gcal);
- gnome_calendar_copy_clipboard (gcal);
- set_normal_cursor (gcal);
-}
-
-static void
-paste_cmd (BonoboUIComponent *uic, gpointer data, const gchar *path)
-{
- GnomeCalendar *gcal;
-
- gcal = GNOME_CALENDAR (data);
-
- set_clock_cursor (gcal);
- gnome_calendar_paste_clipboard (gcal);
- set_normal_cursor (gcal);
-}
-
-static void
-delete_cmd (BonoboUIComponent *uic, gpointer data, const gchar *path)
-{
- GnomeCalendar *gcal;
-
- gcal = GNOME_CALENDAR (data);
-
- set_clock_cursor (gcal);
- gnome_calendar_delete_selection (gcal);
- set_normal_cursor (gcal);
-}
-
-static void
-delete_occurrence_cmd (BonoboUIComponent *uic, gpointer data, const gchar *path)
-{
- GnomeCalendar *gcal;
-
- gcal = GNOME_CALENDAR (data);
-
- set_clock_cursor (gcal);
- gnome_calendar_delete_selected_occurrence (gcal);
- set_normal_cursor (gcal);
-}
-
-static void
-publish_freebusy_cmd (BonoboUIComponent *uic, gpointer data, const gchar *path)
-{
- GnomeCalendar *gcal;
- GList *client_list, *cl;
- GList *comp_list = NULL;
- icaltimezone *utc;
- time_t start = time (NULL), end;
-
- gcal = GNOME_CALENDAR (data);
-
- utc = icaltimezone_get_utc_timezone ();
- start = time_day_begin_with_zone (start, utc);
- end = time_add_week_with_zone (start, 6, utc);
-
- /* FIXME Should we aggregate the data? */
- client_list = e_cal_model_get_client_list (gnome_calendar_get_calendar_model (gcal));
- for (cl = client_list; cl != NULL; cl = cl->next) {
- if (e_cal_get_free_busy ((ECal *) cl->data, NULL, start, end, &comp_list, NULL)) {
- GList *l;
-
- for (l = comp_list; l; l = l->next) {
- ECalComponent *comp = E_CAL_COMPONENT (l->data);
- itip_send_comp (E_CAL_COMPONENT_METHOD_PUBLISH, comp, (ECal *) cl->data, NULL);
-
- g_object_unref (comp);
- }
-
- g_list_free (comp_list);
- }
- }
-
- g_list_free (client_list);
-}
-
-static void
-purge_cmd (BonoboUIComponent *uic, gpointer data, const gchar *path)
-{
- GnomeCalendar *gcal;
- GtkWidget *dialog, *parent, *box, *label, *spin;
- int response;
-
- gcal = GNOME_CALENDAR (data);
-
- /* create the dialog */
- parent = gtk_widget_get_toplevel (GTK_WIDGET (gcal));
- dialog = gtk_message_dialog_new (
- (GtkWindow *)parent,
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_OK_CANCEL,
- _("This operation will permanently erase all events older than the selected amount of time. If you continue, you will not be able to recover these events."));
- gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CANCEL);
-
- box = gtk_hbox_new (FALSE, 6);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), box, TRUE, FALSE, 6);
-
- label = gtk_label_new (_("Purge events older than"));
- gtk_box_pack_start (GTK_BOX (box), label, TRUE, FALSE, 6);
- spin = gtk_spin_button_new_with_range (0.0, 1000.0, 1.0);
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (spin), 60.0);
- gtk_box_pack_start (GTK_BOX (box), spin, FALSE, FALSE, 6);
- label = gtk_label_new (_("days"));
- gtk_box_pack_start (GTK_BOX (box), label, TRUE, FALSE, 6);
-
- gtk_widget_show_all (box);
-
- /* run the dialog */
- response = gtk_dialog_run (GTK_DIALOG (dialog));
- if (response == GTK_RESPONSE_OK) {
- gint days;
- time_t tt;
-
- days = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (spin));
- tt = time (NULL);
- tt -= (days * (24 * 3600));
-
- gnome_calendar_purge (gcal, tt);
- }
-
- gtk_widget_destroy (dialog);
-}
-
-
-const gchar *
-calendar_get_text_for_folder_bar_label (GnomeCalendar *gcal)
-{
- icaltimezone *zone;
- struct icaltimetype start_tt, end_tt;
- time_t start_time, end_time;
- struct tm start_tm, end_tm;
- static char buffer[512];
- char end_buffer[256];
- GnomeCalendarViewType view;
-
- gnome_calendar_get_visible_time_range (gcal, &start_time, &end_time);
- zone = gnome_calendar_get_timezone (gcal);
-
- start_tt = icaltime_from_timet_with_zone (start_time, FALSE, zone);
- start_tm.tm_year = start_tt.year - 1900;
- start_tm.tm_mon = start_tt.month - 1;
- start_tm.tm_mday = start_tt.day;
- start_tm.tm_hour = start_tt.hour;
- start_tm.tm_min = start_tt.minute;
- start_tm.tm_sec = start_tt.second;
- start_tm.tm_isdst = -1;
- start_tm.tm_wday = time_day_of_week (start_tt.day, start_tt.month - 1,
- start_tt.year);
-
- /* Take one off end_time so we don't get an extra day. */
- end_tt = icaltime_from_timet_with_zone (end_time - 1, FALSE, zone);
- end_tm.tm_year = end_tt.year - 1900;
- end_tm.tm_mon = end_tt.month - 1;
- end_tm.tm_mday = end_tt.day;
- end_tm.tm_hour = end_tt.hour;
- end_tm.tm_min = end_tt.minute;
- end_tm.tm_sec = end_tt.second;
- end_tm.tm_isdst = -1;
- end_tm.tm_wday = time_day_of_week (end_tt.day, end_tt.month - 1,
- end_tt.year);
-
- view = gnome_calendar_get_view (gcal);
-
- switch (view) {
- case GNOME_CAL_DAY_VIEW:
- case GNOME_CAL_WORK_WEEK_VIEW:
- case GNOME_CAL_WEEK_VIEW:
- if (start_tm.tm_year == end_tm.tm_year
- && start_tm.tm_mon == end_tm.tm_mon
- && start_tm.tm_mday == end_tm.tm_mday) {
- e_utf8_strftime (buffer, sizeof (buffer),
- _("%A %d %B %Y"), &start_tm);
- } else if (start_tm.tm_year == end_tm.tm_year) {
- e_utf8_strftime (buffer, sizeof (buffer),
- _("%a %d %b"), &start_tm);
- e_utf8_strftime (end_buffer, sizeof (end_buffer),
- _("%a %d %b %Y"), &end_tm);
- strcat (buffer, " - ");
- strcat (buffer, end_buffer);
- } else {
- e_utf8_strftime (buffer, sizeof (buffer),
- _("%a %d %b %Y"), &start_tm);
- e_utf8_strftime (end_buffer, sizeof (end_buffer),
- _("%a %d %b %Y"), &end_tm);
- strcat (buffer, " - ");
- strcat (buffer, end_buffer);
- }
- break;
- case GNOME_CAL_MONTH_VIEW:
- case GNOME_CAL_LIST_VIEW:
- if (start_tm.tm_year == end_tm.tm_year) {
- if (start_tm.tm_mon == end_tm.tm_mon) {
- if (start_tm.tm_mday == end_tm.tm_mday) {
- buffer [0] = '\0';
- } else {
- e_utf8_strftime (buffer, sizeof (buffer),
- "%d", &start_tm);
- strcat (buffer, " - ");
- }
- e_utf8_strftime (end_buffer, sizeof (end_buffer),
- _("%d %B %Y"), &end_tm);
- strcat (buffer, end_buffer);
- } else {
- e_utf8_strftime (buffer, sizeof (buffer),
- _("%d %B"), &start_tm);
- e_utf8_strftime (end_buffer, sizeof (end_buffer),
- _("%d %B %Y"), &end_tm);
- strcat (buffer, " - ");
- strcat (buffer, end_buffer);
- }
- } else {
- e_utf8_strftime (buffer, sizeof (buffer),
- _("%d %B %Y"), &start_tm);
- e_utf8_strftime (end_buffer, sizeof (end_buffer),
- _("%d %B %Y"), &end_tm);
- strcat (buffer, " - ");
- strcat (buffer, end_buffer);
- }
- break;
- default:
- g_assert_not_reached ();
- return NULL;
- }
- return buffer;
-}
-
-
-/* Sensitizes the UI Component menu/toolbar calendar commands based on the
- * number of selected events. (This will always be 0 or 1 currently.) If enable
- * is FALSE, all will be disabled. Otherwise, the currently-selected number of
- * events will be used.
- */
-void
-calendar_control_sensitize_calendar_commands (BonoboControl *control, GnomeCalendar *gcal, gboolean enable)
-{
- BonoboUIComponent *uic;
- ECalendarViewEvent *event;
- GList *list;
- int n_selected;
- GtkWidget *view;
- ECal *e_cal;
- gboolean read_only = FALSE, has_recurrences;
-
- uic = bonobo_control_get_ui_component (control);
- g_assert (uic != NULL);
-
- view = gnome_calendar_get_current_view_widget (gcal);
- list = e_calendar_view_get_selected_events (E_CALENDAR_VIEW (view));
-
- n_selected = enable ? g_list_length (list) : 0;
-
- event = (ECalendarViewEvent *) list ? list->data : NULL;
- if (event) {
- e_cal_is_read_only (event->comp_data->client, &read_only, NULL);
- } else {
- e_cal = e_cal_model_get_default_client (gnome_calendar_get_calendar_model (gcal));
- if (e_cal)
- e_cal_is_read_only (e_cal, &read_only, NULL);
- else
- read_only = TRUE;
- }
-
- bonobo_ui_component_set_prop (uic, "/commands/Cut", "sensitive",
- n_selected == 0 || read_only ? "0" : "1",
- NULL);
- bonobo_ui_component_set_prop (uic, "/commands/Copy", "sensitive",
- n_selected == 0 ? "0" : "1",
- NULL);
- bonobo_ui_component_set_prop (uic, "/commands/Paste", "sensitive",
- enable && !read_only ? "1" : "0",
- NULL);
- bonobo_ui_component_set_prop (uic, "/commands/Delete", "sensitive",
- n_selected == 0 || read_only ? "0" : "1",
- NULL);
-
- /* occurrence-related menu items */
- has_recurrences = FALSE;
- if (n_selected > 0 && !read_only) {
- if (list) {
- event = (ECalendarViewEvent *) list->data;
- if (e_cal_util_component_has_recurrences (event->comp_data->icalcomp))
- has_recurrences = TRUE;
- }
- }
-
- bonobo_ui_component_set_prop (uic, "/commands/DeleteOccurrence", "sensitive",
- has_recurrences ? "1" : "0",
- NULL);
- bonobo_ui_component_set_prop (uic, "/commands/DeleteAllOccurrences", "sensitive",
- has_recurrences ? "1" : "0",
- NULL);
-
- /* free memory */
- if (list)
- g_list_free (list);
-}
-
-/* Sensitizes the UI Component menu/toolbar tasks commands based on the number
- * of selected tasks. If enable is FALSE, all will be disabled. Otherwise, the
- * currently-selected number of tasks will be used.
- */
-static void
-sensitize_taskpad_commands (GnomeCalendar *gcal, BonoboControl *control, gboolean enable)
-{
- BonoboUIComponent *uic;
- int n_selected;
- ECal *e_cal;
- gboolean read_only = TRUE;
-
- uic = bonobo_control_get_ui_component (control);
- g_assert (uic != NULL);
-
- n_selected = enable ? gnome_calendar_get_num_tasks_selected (gcal) : 0;
- e_cal = gnome_calendar_get_task_pad_e_cal (gcal);
- if (e_cal)
- e_cal_is_read_only (e_cal, &read_only, NULL);
- else
- read_only = TRUE;
-
- bonobo_ui_component_set_prop (uic, "/commands/Cut", "sensitive",
- n_selected == 0 || read_only ? "0" : "1",
- NULL);
- bonobo_ui_component_set_prop (uic, "/commands/Copy", "sensitive",
- n_selected == 0 ? "0" : "1",
- NULL);
- bonobo_ui_component_set_prop (uic, "/commands/Paste", "sensitive",
- enable && !read_only ? "1" : "0",
- NULL);
- bonobo_ui_component_set_prop (uic, "/commands/Delete", "sensitive",
- n_selected == 0 || read_only ? "0" : "1",
- NULL);
-}
-
-/* Callback used when the selection in the calendar views changes */
-static void
-gcal_calendar_selection_changed_cb (GnomeCalendar *gcal, gpointer data)
-{
- BonoboControl *control;
-
- control = BONOBO_CONTROL (data);
-
- calendar_control_sensitize_calendar_commands (control, gcal, TRUE);
-}
-
-/* Callback used when the selection in the taskpad changes */
-static void
-gcal_taskpad_selection_changed_cb (GnomeCalendar *gcal, gpointer data)
-{
- BonoboControl *control;
-
- control = BONOBO_CONTROL (data);
-
- sensitize_taskpad_commands (gcal, control, TRUE);
-}
-
-/* Callback used when the focus changes for a calendar view */
-static void
-gcal_calendar_focus_change_cb (GnomeCalendar *gcal, gboolean in, gpointer data)
-{
- BonoboControl *control;
- FocusData *focus;
-
- control = BONOBO_CONTROL (data);
-
- focus = g_object_get_data (G_OBJECT (control), "focus_data");
- g_assert (focus != NULL);
-
- if (in) {
- g_signal_connect (gcal, "calendar_selection_changed",
- G_CALLBACK (gcal_calendar_selection_changed_cb), control);
- calendar_control_sensitize_calendar_commands (control, gcal, TRUE);
- focus->calendar_focused = TRUE;
- } else if (focus->calendar_focused) {
- gtk_signal_disconnect_by_func (GTK_OBJECT (gcal),
- G_CALLBACK (gcal_calendar_selection_changed_cb),
- control);
- calendar_control_sensitize_calendar_commands (control, gcal, FALSE);
- focus->calendar_focused = FALSE;
- }
-}
-
-/* Callback used when the taskpad focus changes */
-static void
-gcal_taskpad_focus_change_cb (GnomeCalendar *gcal, gboolean in, gpointer data)
-{
- BonoboControl *control;
- FocusData *focus;
-
- control = BONOBO_CONTROL (data);
-
- focus = g_object_get_data (G_OBJECT (control), "focus_data");
- g_assert (focus != NULL);
-
- if (in) {
- g_signal_connect (gcal, "taskpad_selection_changed",
- G_CALLBACK (gcal_taskpad_selection_changed_cb), control);
- sensitize_taskpad_commands (gcal, control, TRUE);
- focus->taskpad_focused = TRUE;
- } else if (focus->taskpad_focused) {
- /* With Bonobo controls, we may get unpaired focus_out events.
- * That is why we have to keep track of this ourselves instead
- * of blindly assumming that we are getting this event because
- * the taskpad was in fact focused.
- */
- gtk_signal_disconnect_by_func (GTK_OBJECT (gcal),
- G_CALLBACK (gcal_taskpad_selection_changed_cb),
- control);
- sensitize_taskpad_commands (gcal, control, FALSE);
- focus->taskpad_focused = FALSE;
- }
-
-}
-
-
-static BonoboUIVerb verbs [] = {
- BONOBO_UI_VERB ("NewCalendar", file_new_calendar_cb),
- BONOBO_UI_VERB ("CalendarPrint", file_print_cb),
- BONOBO_UI_VERB ("CalendarPrintPreview", file_print_preview_cb),
-
- BONOBO_UI_VERB ("Cut", cut_cmd),
- BONOBO_UI_VERB ("Copy", copy_cmd),
- BONOBO_UI_VERB ("Paste", paste_cmd),
- BONOBO_UI_VERB ("Delete", delete_cmd),
- BONOBO_UI_VERB ("DeleteOccurrence", delete_occurrence_cmd),
- BONOBO_UI_VERB ("DeleteAllOccurrences", delete_cmd),
-
- BONOBO_UI_VERB ("CalendarPrev", previous_clicked),
- BONOBO_UI_VERB ("CalendarToday", today_clicked),
- BONOBO_UI_VERB ("CalendarNext", next_clicked),
- BONOBO_UI_VERB ("CalendarGoto", goto_clicked),
-
- BONOBO_UI_VERB ("ShowDayView", show_day_view_clicked),
- BONOBO_UI_VERB ("ShowWorkWeekView", show_work_week_view_clicked),
- BONOBO_UI_VERB ("ShowWeekView", show_week_view_clicked),
- BONOBO_UI_VERB ("ShowMonthView", show_month_view_clicked),
- BONOBO_UI_VERB ("ShowListView", show_list_view_clicked),
-
- BONOBO_UI_VERB ("PublishFreeBusy", publish_freebusy_cmd),
- BONOBO_UI_VERB ("CalendarPurge", purge_cmd),
-
- BONOBO_UI_VERB_END
-};
-
-static EPixmap pixmaps [] =
-{
- E_PIXMAP ("/Toolbar/DayView", "buttons/dayview.xpm"),
- E_PIXMAP ("/Toolbar/WorkWeekView", "buttons/workweekview.xpm"),
- E_PIXMAP ("/Toolbar/WeekView", "buttons/weekview.xpm"),
- E_PIXMAP ("/Toolbar/MonthView", "buttons/monthview.xpm"),
- E_PIXMAP ("/Toolbar/ListView", "buttons/listview.xpm"),
-
- E_PIXMAP_END
-};
-
-void
-calendar_control_activate (BonoboControl *control,
- GnomeCalendar *gcal)
-{
- Bonobo_UIContainer remote_uih;
- BonoboUIComponent *uic;
- FocusData *focus;
-
- uic = bonobo_control_get_ui_component (control);
- g_assert (uic != NULL);
-
- remote_uih = bonobo_control_get_remote_ui_container (control, NULL);
- bonobo_ui_component_set_container (uic, remote_uih, NULL);
- bonobo_object_release_unref (remote_uih, NULL);
-
- gnome_calendar_set_ui_component (gcal, uic);
-
- bonobo_ui_component_add_verb_list_with_data (uic, verbs, gcal);
-
- bonobo_ui_component_freeze (uic, NULL);
-
- bonobo_ui_util_set_ui (uic, PREFIX,
- EVOLUTION_UIDIR "/evolution-calendar.xml",
- "evolution-calendar",
- NULL);
-
- e_pixmaps_update (uic, pixmaps);
-
- gnome_calendar_setup_view_menus (gcal, uic);
-
- g_signal_connect (gcal, "calendar_focus_change",
- G_CALLBACK (gcal_calendar_focus_change_cb), control);
- g_signal_connect (gcal, "taskpad_focus_change",
- G_CALLBACK (gcal_taskpad_focus_change_cb), control);
-
- calendar_control_sensitize_calendar_commands (control, gcal, FALSE);
- sensitize_taskpad_commands (gcal, control, FALSE);
-
- bonobo_ui_component_thaw (uic, NULL);
-
- /* Show the dialog for setting the timezone if the user hasn't chosen
- a default timezone already. This is done in the startup wizard now,
- so we don't do it here. */
-#if 0
- calendar_config_check_timezone_set ();
-#endif
-
- focus = g_new (FocusData, 1);
- focus->calendar_focused = FALSE;
- focus->taskpad_focused = FALSE;
-
- g_object_set_data (G_OBJECT (control), "focus_data", focus);
-}
-
-void
-calendar_control_deactivate (BonoboControl *control, GnomeCalendar *gcal)
-{
- FocusData *focus;
- BonoboUIComponent *uic;
-
- uic = bonobo_control_get_ui_component (control);
- g_assert (uic != NULL);
-
- gnome_calendar_set_ui_component (gcal, uic);
-
- focus = g_object_get_data (G_OBJECT (control), "focus_data");
- g_assert (focus != NULL);
-
- g_object_set_data (G_OBJECT (control), "focus_data", NULL);
- g_free (focus);
-
- gnome_calendar_discard_view_menus (gcal);
-
- g_signal_handlers_disconnect_matched (gcal, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, control);
-
- bonobo_ui_component_rm (uic, "/", NULL);
- bonobo_ui_component_unset_container (uic, NULL);
-}
diff --git a/calendar/gui/calendar-commands.h b/calendar/gui/calendar-commands.h
deleted file mode 100644
index 901d01d845..0000000000
--- a/calendar/gui/calendar-commands.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Evolution calendar - Commands for the calendar GUI control
- *
- * Copyright (C) 1998 The Free Software Foundation
- * Copyright (C) 2000 Ximian, Inc.
- * Copyright (C) 2000 Ximian, Inc.
- *
- * Authors: Miguel de Icaza <miguel@ximian.com>
- * Federico Mena-Quintero <federico@ximian.com>
- * Seth Alves <alves@hungry.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef CALENDAR_COMMANDS_H
-#define CALENDAR_COMMANDS_H
-
-#include "gnome-cal.h"
-
-#include <bonobo/bonobo-control.h>
-#include <bonobo/bonobo-ui-component.h>
-
-void calendar_control_activate (BonoboControl *control, GnomeCalendar *gcal);
-void calendar_control_deactivate (BonoboControl *control, GnomeCalendar *gcal);
-
-void calendar_control_sensitize_calendar_commands (BonoboControl *control, GnomeCalendar *gcal, gboolean enable);
-
-void calendar_goto_today (GnomeCalendar *gcal);
-
-const gchar * calendar_get_text_for_folder_bar_label (GnomeCalendar *gcal);
-
-#endif /* CALENDAR_COMMANDS_H */
diff --git a/calendar/gui/calendar-component.c b/calendar/gui/calendar-component.c
deleted file mode 100644
index 455ede19ba..0000000000
--- a/calendar/gui/calendar-component.c
+++ /dev/null
@@ -1,902 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* calendar-component.c
- *
- * Copyright (C) 2003 Ettore Perazzoli
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Ettore Perazzoli <ettore@ximian.com>
- * Rodrigo Moya <rodrigo@ximian.com>
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-#include <errno.h>
-#include <bonobo/bonobo-control.h>
-#include <bonobo/bonobo-i18n.h>
-#include <bonobo/bonobo-exception.h>
-#include "calendar-config.h"
-#include "calendar-component.h"
-#include "calendar-commands.h"
-#include "gnome-cal.h"
-#include "migration.h"
-#include "e-comp-editor-registry.h"
-#include "comp-util.h"
-#include "dialogs/new-calendar.h"
-#include "dialogs/comp-editor.h"
-#include "dialogs/copy-source-dialog.h"
-#include "dialogs/event-editor.h"
-#include "widgets/misc/e-source-selector.h"
-
-
-/* IDs for user creatable items */
-#define CREATE_EVENT_ID "event"
-#define CREATE_MEETING_ID "meeting"
-#define CREATE_ALLDAY_EVENT_ID "allday-event"
-
-#define PARENT_TYPE bonobo_object_get_type ()
-static BonoboObjectClass *parent_class = NULL;
-
-struct _CalendarComponentPrivate {
- char *config_directory;
-
- GConfClient *gconf_client;
- ESourceList *source_list;
- GSList *source_selection;
-
- GnomeCalendar *calendar;
- GtkWidget *source_selector;
-
- ECal *create_ecal;
-
- GList *notifications;
-
- EActivityHandler *activity_handler;
-};
-
-/* FIXME This should be gnome cal likely */
-extern ECompEditorRegistry *comp_editor_registry;
-
-/* Utility functions. */
-
-static void
-add_uri_for_source (ESource *source, GnomeCalendar *calendar)
-{
- char *uri = e_source_get_uri (source);
-
- gnome_calendar_add_event_uri (calendar, uri);
- g_free (uri);
-}
-
-static void
-remove_uri_for_source (ESource *source, GnomeCalendar *calendar)
-{
- char *uri = e_source_get_uri (source);
-
- gnome_calendar_remove_event_uri (calendar, uri);
- g_free (uri);
-}
-
-static gboolean
-is_in_selection (GSList *selection, ESource *source)
-{
- GSList *l;
-
- for (l = selection; l; l = l->next) {
- ESource *selected_source = l->data;
-
- if (!strcmp (e_source_peek_uid (selected_source), e_source_peek_uid (source)))
- return TRUE;
- }
-
- return FALSE;
-}
-
-static gboolean
-is_in_uids (GSList *uids, ESource *source)
-{
- GSList *l;
-
- for (l = uids; l; l = l->next) {
- const char *uid = l->data;
-
- if (!strcmp (uid, e_source_peek_uid (source)))
- return TRUE;
- }
-
- return FALSE;
-}
-
-static ESource *
-find_first_source (ESourceList *source_list)
-{
- GSList *groups, *sources, *l, *m;
-
- groups = e_source_list_peek_groups (source_list);
- for (l = groups; l; l = l->next) {
- ESourceGroup *group = l->data;
-
- sources = e_source_group_peek_sources (group);
- for (m = sources; m; m = m->next) {
- ESource *source = m->data;
-
- return source;
- }
- }
-
- return NULL;
-}
-
-static void
-update_uris_for_selection (CalendarComponent *calendar_component)
-{
- CalendarComponentPrivate *priv;
- GSList *selection, *l, *uids_selected = NULL;
-
- priv = calendar_component->priv;
-
- selection = e_source_selector_get_selection (E_SOURCE_SELECTOR (priv->source_selector));
-
- for (l = priv->source_selection; l; l = l->next) {
- ESource *old_selected_source = l->data;
-
- if (!is_in_selection (selection, old_selected_source))
- remove_uri_for_source (old_selected_source, priv->calendar);
- }
-
- for (l = selection; l; l = l->next) {
- ESource *selected_source = l->data;
-
- add_uri_for_source (selected_source, priv->calendar);
- uids_selected = g_slist_append (uids_selected, (char *)e_source_peek_uid (selected_source));
- }
-
- e_source_selector_free_selection (priv->source_selection);
- priv->source_selection = selection;
-
- /* Save the selection for next time we start up */
- calendar_config_set_calendars_selected (uids_selected);
- g_slist_free (uids_selected);
-}
-
-static void
-update_uri_for_primary_selection (CalendarComponent *calendar_component)
-{
- CalendarComponentPrivate *priv;
- ESource *source;
- char *uri;
-
- priv = calendar_component->priv;
-
- source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (priv->source_selector));
- if (!source)
- return;
-
- /* Set the default */
- uri = e_source_get_uri (source);
- gnome_calendar_set_default_uri (priv->calendar, uri);
- g_free (uri);
-
- /* Save the selection for next time we start up */
- calendar_config_set_primary_calendar (e_source_peek_uid (source));
-}
-
-static void
-update_selection (CalendarComponent *calendar_component)
-{
- CalendarComponentPrivate *priv;
- GSList *selection, *uids_selected, *l;
-
- priv = calendar_component->priv;
-
- /* Get the selection in gconf */
- uids_selected = calendar_config_get_calendars_selected ();
-
- /* Remove any that aren't there any more */
- selection = e_source_selector_get_selection (E_SOURCE_SELECTOR (priv->source_selector));
-
- for (l = selection; l; l = l->next) {
- ESource *source = l->data;
-
- if (!is_in_uids (uids_selected, source))
- e_source_selector_unselect_source (E_SOURCE_SELECTOR (priv->source_selector), source);
- }
-
- e_source_selector_free_selection (selection);
-
- /* Make sure the whole selection is there */
- for (l = uids_selected; l; l = l->next) {
- char *uid = l->data;
- ESource *source;
-
- source = e_source_list_peek_source_by_uid (priv->source_list, uid);
- if (source)
- e_source_selector_select_source (E_SOURCE_SELECTOR (priv->source_selector), source);
-
- g_free (uid);
- }
- g_slist_free (uids_selected);
-}
-
-static void
-update_primary_selection (CalendarComponent *calendar_component)
-{
- CalendarComponentPrivate *priv;
- ESource *source;
- char *uid;
-
- priv = calendar_component->priv;
-
- uid = calendar_config_get_primary_calendar ();
- if (uid) {
- source = e_source_list_peek_source_by_uid (priv->source_list, uid);
- g_free (uid);
-
- e_source_selector_set_primary_selection (E_SOURCE_SELECTOR (priv->source_selector), source);
- } else {
- ESource *source;
-
- /* Try to create a default if there isn't one */
- source = find_first_source (priv->source_list);
- if (source)
- e_source_selector_set_primary_selection (E_SOURCE_SELECTOR (priv->source_selector), source);
- }
-}
-
-/* FIXME This is duplicated from comp-editor-factory.c, should it go in comp-util? */
-static ECalComponent *
-get_default_event (ECal *client, gboolean all_day)
-{
- ECalComponent *comp;
- struct icaltimetype itt;
- ECalComponentDateTime dt;
- char *location;
- icaltimezone *zone;
-
- comp = cal_comp_event_new_with_defaults (client);
-
- location = calendar_config_get_timezone ();
- zone = icaltimezone_get_builtin_timezone (location);
-
- if (all_day) {
- itt = icaltime_from_timet_with_zone (time (NULL), 1, zone);
-
- dt.value = &itt;
- dt.tzid = icaltimezone_get_tzid (zone);
-
- e_cal_component_set_dtstart (comp, &dt);
- e_cal_component_set_dtend (comp, &dt);
- } else {
- itt = icaltime_current_time_with_zone (zone);
- icaltime_adjust (&itt, 0, 1, -itt.minute, -itt.second);
-
- dt.value = &itt;
- dt.tzid = icaltimezone_get_tzid (zone);
-
- e_cal_component_set_dtstart (comp, &dt);
- icaltime_adjust (&itt, 0, 1, 0, 0);
- e_cal_component_set_dtend (comp, &dt);
- }
-
- e_cal_component_commit_sequence (comp);
-
- return comp;
-}
-
-/* Callbacks. */
-static void
-add_popup_menu_item (GtkMenu *menu, const char *label, const char *pixmap,
- GCallback callback, gpointer user_data, gboolean sensitive)
-{
- GtkWidget *item, *image;
-
- if (pixmap) {
- item = gtk_image_menu_item_new_with_label (label);
-
- /* load the image */
- image = gtk_image_new_from_stock (pixmap, GTK_ICON_SIZE_MENU);
- if (!image)
- image = gtk_image_new_from_file (pixmap);
-
- if (image) {
- gtk_widget_show (image);
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
- }
- } else {
- item = gtk_menu_item_new_with_label (label);
- }
-
- if (callback)
- g_signal_connect (G_OBJECT (item), "activate", callback, user_data);
-
- if (!sensitive)
- gtk_widget_set_sensitive (item, FALSE);
-
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
- gtk_widget_show (item);
-}
-
-static void
-copy_calendar_cb (GtkWidget *widget, CalendarComponent *comp)
-{
- ESource *selected_source;
- CalendarComponentPrivate *priv;
-
- priv = comp->priv;
-
- selected_source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (priv->source_selector));
- if (!selected_source)
- return;
-
- copy_source_dialog (GTK_WINDOW (gtk_widget_get_toplevel (widget)), selected_source, CALOBJ_TYPE_EVENT);
-}
-
-static void
-delete_calendar_cb (GtkWidget *widget, CalendarComponent *comp)
-{
- ESource *selected_source;
- CalendarComponentPrivate *priv;
- GtkWidget *dialog;
-
- priv = comp->priv;
-
- selected_source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (priv->source_selector));
- if (!selected_source)
- return;
-
- /* create the confirmation dialog */
- dialog = gtk_message_dialog_new (
- GTK_WINDOW (gtk_widget_get_toplevel (widget)),
- GTK_DIALOG_MODAL,
- GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_YES_NO,
- _("Calendar '%s' will be removed. Are you sure you want to continue?"),
- e_source_peek_name (selected_source));
- if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_YES) {
- if (e_source_selector_source_is_selected (E_SOURCE_SELECTOR (priv->source_selector),
- selected_source))
- e_source_selector_unselect_source (E_SOURCE_SELECTOR (priv->source_selector),
- selected_source);
-
- e_source_group_remove_source (e_source_peek_group (selected_source), selected_source);
-
- /* FIXME: remove the calendar.ics file and the directory */
- }
-
- gtk_widget_destroy (dialog);
-}
-
-static void
-new_calendar_cb (GtkWidget *widget, CalendarComponent *comp)
-{
- new_calendar_dialog (GTK_WINDOW (gtk_widget_get_toplevel (widget)));
-}
-
-static void
-rename_calendar_cb (GtkWidget *widget, CalendarComponent *comp)
-{
- CalendarComponentPrivate *priv;
- ESource *selected_source;
- GtkWidget *dialog, *entry;
-
- priv = comp->priv;
-
- selected_source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (priv->source_selector));
- if (!selected_source)
- return;
-
- /* create the dialog to prompt the user for the new name */
- dialog = gtk_message_dialog_new (GTK_WINDOW (gtk_widget_get_toplevel (widget)),
- GTK_DIALOG_MODAL,
- GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_OK_CANCEL,
- _("Rename this calendar to"));
- entry = gtk_entry_new ();
- gtk_entry_set_text (GTK_ENTRY (entry), e_source_peek_name (selected_source));
- gtk_widget_show (entry);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), entry, TRUE, FALSE, 6);
-
- if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK)
- e_source_set_name (selected_source, gtk_entry_get_text (GTK_ENTRY (entry)));
-
- gtk_widget_destroy (dialog);
-}
-
-static void
-fill_popup_menu_cb (ESourceSelector *selector, GtkMenu *menu, CalendarComponent *comp)
-{
- gboolean sensitive;
-
- sensitive = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (comp->priv->source_selector)) ?
- TRUE : FALSE;
-
- add_popup_menu_item (menu, _("New Calendar"), GTK_STOCK_NEW, G_CALLBACK (new_calendar_cb), comp, TRUE);
- add_popup_menu_item (menu, _("Copy"), NULL, G_CALLBACK (copy_calendar_cb), comp, sensitive);
- add_popup_menu_item (menu, _("Rename"), NULL, G_CALLBACK (rename_calendar_cb), comp, sensitive);
- add_popup_menu_item (menu, _("Delete"), GTK_STOCK_DELETE, G_CALLBACK (delete_calendar_cb), comp, sensitive);
-}
-
-static void
-source_selection_changed_cb (ESourceSelector *selector,
- CalendarComponent *calendar_component)
-{
- update_uris_for_selection (calendar_component);
-}
-
-static void
-primary_source_selection_changed_cb (ESourceSelector *selector,
- CalendarComponent *calendar_component)
-{
- update_uri_for_primary_selection (calendar_component);
-}
-
-static void
-config_selection_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
-{
- update_selection (data);
-}
-
-
-static void
-config_primary_selection_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
-{
- update_primary_selection (data);
-}
-
-/* GObject methods. */
-
-static void
-impl_dispose (GObject *object)
-{
- CalendarComponentPrivate *priv = CALENDAR_COMPONENT (object)->priv;
- GList *l;
-
- if (priv->source_list != NULL) {
- g_object_unref (priv->source_list);
- priv->source_list = NULL;
- }
-
- if (priv->source_selection != NULL) {
- e_source_selector_free_selection (priv->source_selection);
- priv->source_selection = NULL;
- }
-
- if (priv->gconf_client != NULL) {
- g_object_unref (priv->gconf_client);
- priv->gconf_client = NULL;
- }
-
- if (priv->create_ecal) {
- g_object_unref (priv->create_ecal);
- priv->create_ecal = NULL;
- }
-
- for (l = priv->notifications; l; l = l->next)
- calendar_config_remove_notification (GPOINTER_TO_UINT (l->data));
- g_list_free (priv->notifications);
- priv->notifications = NULL;
-
- if (priv->activity_handler != NULL) {
- g_object_unref (priv->activity_handler);
- priv->activity_handler = NULL;
- }
-
- (* G_OBJECT_CLASS (parent_class)->dispose) (object);
-}
-
-static void
-impl_finalize (GObject *object)
-{
- CalendarComponentPrivate *priv = CALENDAR_COMPONENT (object)->priv;
-
- g_free (priv->config_directory);
-
- g_free (priv);
-
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
-}
-
-
-/* Evolution::Component CORBA methods. */
-
-static void
-control_activate_cb (BonoboControl *control, gboolean activate, gpointer data)
-{
- GnomeCalendar *gcal;
-
- gcal = GNOME_CALENDAR (data);
-
- if (activate)
- calendar_control_activate (control, gcal);
- else
- calendar_control_deactivate (control, gcal);
-}
-
-static void
-impl_createControls (PortableServer_Servant servant,
- Bonobo_Control *corba_sidebar_control,
- Bonobo_Control *corba_view_control,
- Bonobo_Control *corba_statusbar_control,
- CORBA_Environment *ev)
-{
- CalendarComponent *calendar_component = CALENDAR_COMPONENT (bonobo_object_from_servant (servant));
- CalendarComponentPrivate *priv;
- GtkWidget *selector_scrolled_window;
- GtkWidget *statusbar_widget;
- BonoboControl *sidebar_control;
- BonoboControl *view_control;
- BonoboControl *statusbar_control;
- guint not;
-
- priv = calendar_component->priv;
-
- /* Create sidebar selector */
- priv->source_selector = e_source_selector_new (calendar_component->priv->source_list);
- gtk_widget_show (priv->source_selector);
-
- selector_scrolled_window = gtk_scrolled_window_new (NULL, NULL);
- gtk_container_add (GTK_CONTAINER (selector_scrolled_window), priv->source_selector);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (selector_scrolled_window),
- GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (selector_scrolled_window),
- GTK_SHADOW_IN);
- gtk_widget_show (selector_scrolled_window);
-
- sidebar_control = bonobo_control_new (selector_scrolled_window);
-
- /* Create main calendar view */
- /* FIXME Instead of returning, we should make a control with a
- * label describing the problem */
- priv->calendar = GNOME_CALENDAR (gnome_calendar_new ());
- if (!priv->calendar) {
- g_warning (G_STRLOC ": could not create the calendar widget!");
- bonobo_exception_set (ev, ex_GNOME_Evolution_Component_Failed);
- return;
- }
-
- gtk_widget_show (GTK_WIDGET (priv->calendar));
-
- view_control = bonobo_control_new (GTK_WIDGET (priv->calendar));
- if (!view_control) {
- g_warning (G_STRLOC ": could not create the control!");
- bonobo_exception_set (ev, ex_GNOME_Evolution_Component_Failed);
- return;
- }
- g_object_set_data (G_OBJECT (priv->calendar), "control", view_control);
-
- g_signal_connect (view_control, "activate", G_CALLBACK (control_activate_cb), priv->calendar);
-
- g_signal_connect_object (priv->source_selector, "selection_changed",
- G_CALLBACK (source_selection_changed_cb),
- G_OBJECT (calendar_component), 0);
- g_signal_connect_object (priv->source_selector, "primary_selection_changed",
- G_CALLBACK (primary_source_selection_changed_cb),
- G_OBJECT (calendar_component), 0);
- g_signal_connect_object (priv->source_selector, "fill_popup_menu",
- G_CALLBACK (fill_popup_menu_cb),
- G_OBJECT (calendar_component), 0);
-
- statusbar_widget = e_task_bar_new ();
- gtk_widget_show (statusbar_widget);
- e_activity_handler_attach_task_bar (priv->activity_handler, E_TASK_BAR (statusbar_widget));
- statusbar_control = bonobo_control_new (statusbar_widget);
-
- /* Load the selection from the last run */
- update_selection (calendar_component);
- update_primary_selection (calendar_component);
-
- /* If it gets fiddled with update */
- not = calendar_config_add_notification_calendars_selected (config_selection_changed_cb,
- calendar_component);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
-
- not = calendar_config_add_notification_primary_calendar (config_primary_selection_changed_cb,
- calendar_component);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
-
- /* Return the controls */
- *corba_sidebar_control = CORBA_Object_duplicate (BONOBO_OBJREF (sidebar_control), ev);
- *corba_view_control = CORBA_Object_duplicate (BONOBO_OBJREF (view_control), ev);
- *corba_statusbar_control = CORBA_Object_duplicate (BONOBO_OBJREF (statusbar_control), ev);
-}
-
-
-static GNOME_Evolution_CreatableItemTypeList *
-impl__get_userCreatableItems (PortableServer_Servant servant,
- CORBA_Environment *ev)
-{
- GNOME_Evolution_CreatableItemTypeList *list = GNOME_Evolution_CreatableItemTypeList__alloc ();
-
- list->_length = 3;
- list->_maximum = list->_length;
- list->_buffer = GNOME_Evolution_CreatableItemTypeList_allocbuf (list->_length);
-
- CORBA_sequence_set_release (list, FALSE);
-
- list->_buffer[0].id = CREATE_EVENT_ID;
- list->_buffer[0].description = _("New appointment");
- list->_buffer[0].menuDescription = _("_Appointment");
- list->_buffer[0].tooltip = _("Create a new appointment");
- list->_buffer[0].menuShortcut = 'a';
- list->_buffer[0].iconName = "new_appointment.xpm";
-
- list->_buffer[1].id = CREATE_MEETING_ID;
- list->_buffer[1].description = _("New meeting");
- list->_buffer[1].menuDescription = _("M_eeting");
- list->_buffer[1].tooltip = _("Create a new meeting request");
- list->_buffer[1].menuShortcut = 'e';
- list->_buffer[1].iconName = "meeting-request-16.png";
-
- list->_buffer[2].id = CREATE_ALLDAY_EVENT_ID;
- list->_buffer[2].description = _("New all day appointment");
- list->_buffer[2].menuDescription = _("All _Day Appointment");
- list->_buffer[2].tooltip = _("Create a new all-day appointment");
- list->_buffer[2].menuShortcut = 'd';
- list->_buffer[2].iconName = "new_all_day_event.png";
-
- return list;
-}
-
-static void
-config_create_ecal_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
-{
- CalendarComponent *calendar_component = data;
- CalendarComponentPrivate *priv;
-
- priv = calendar_component->priv;
-
- g_object_unref (priv->create_ecal);
- priv->create_ecal = NULL;
-
- priv->notifications = g_list_remove (priv->notifications, GUINT_TO_POINTER (id));
-}
-
-static gboolean
-setup_create_ecal (CalendarComponent *calendar_component)
-{
- CalendarComponentPrivate *priv;
- ESource *source = NULL;
- char *uid;
- guint not;
-
- priv = calendar_component->priv;
-
- if (priv->create_ecal)
- return TRUE;
-
- /* Try to use the client from the calendar first to avoid re-opening things */
- if (priv->calendar) {
- ECal *default_ecal;
-
- default_ecal = gnome_calendar_get_default_client (priv->calendar);
- if (default_ecal) {
- priv->create_ecal = g_object_ref (default_ecal);
- return TRUE;
- }
- }
-
- /* Get the current primary calendar, or try to set one if it doesn't already exist */
- uid = calendar_config_get_primary_calendar ();
- if (uid) {
- source = e_source_list_peek_source_by_uid (priv->source_list, uid);
- g_free (uid);
-
- priv->create_ecal = e_cal_new (source, CALOBJ_TYPE_EVENT);
- }
-
- if (!priv->create_ecal) {
- /* Try to create a default if there isn't one */
- source = find_first_source (priv->source_list);
- if (source)
- priv->create_ecal = e_cal_new (source, CALOBJ_TYPE_EVENT);
- }
-
- if (priv->create_ecal) {
- if (!e_cal_open (priv->create_ecal, FALSE, NULL)) {
- GtkWidget *dialog;
-
- dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
- GTK_MESSAGE_WARNING, GTK_BUTTONS_OK,
- _("Unable to open the calendar '%s' for creating events and meetings"),
- e_source_peek_name (source));
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
-
- return FALSE;
- }
- } else {
- GtkWidget *dialog;
-
- dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
- GTK_MESSAGE_WARNING, GTK_BUTTONS_OK,
- _("There is no calendar available for creating events and meetings"));
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
-
- return FALSE;
- }
-
- /* Handle the fact it may change on us */
- not = calendar_config_add_notification_primary_calendar (config_create_ecal_changed_cb,
- calendar_component);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
-
- /* Save the primary source for use elsewhere */
- calendar_config_set_primary_calendar (e_source_peek_uid (source));
-
- return TRUE;
-}
-
-static void
-impl_requestCreateItem (PortableServer_Servant servant,
- const CORBA_char *item_type_name,
- CORBA_Environment *ev)
-{
- CalendarComponent *calendar_component = CALENDAR_COMPONENT (bonobo_object_from_servant (servant));
- CalendarComponentPrivate *priv;
- ECalComponent *comp;
- EventEditor *editor;
- gboolean is_meeting = FALSE;
-
- priv = calendar_component->priv;
-
- if (!setup_create_ecal (calendar_component))
- return;
-
- editor = event_editor_new (priv->create_ecal);
-
- if (strcmp (item_type_name, CREATE_EVENT_ID) == 0) {
- comp = get_default_event (priv->create_ecal, FALSE);
- } else if (strcmp (item_type_name, CREATE_ALLDAY_EVENT_ID) == 0) {
- comp = get_default_event (priv->create_ecal, TRUE);
- } else if (strcmp (item_type_name, CREATE_MEETING_ID) == 0) {
- comp = get_default_event (priv->create_ecal, FALSE);
- is_meeting = TRUE;
- } else {
- bonobo_exception_set (ev, ex_GNOME_Evolution_Component_UnknownType);
- return;
- }
-
- comp_editor_edit_comp (COMP_EDITOR (editor), comp);
- if (is_meeting)
- event_editor_show_meeting (editor);
- comp_editor_focus (COMP_EDITOR (editor));
-
- e_comp_editor_registry_add (comp_editor_registry, COMP_EDITOR (editor), TRUE);
-}
-
-
-/* Initialization. */
-
-static void
-calendar_component_class_init (CalendarComponentClass *class)
-{
- POA_GNOME_Evolution_Component__epv *epv = &class->epv;
- GObjectClass *object_class = G_OBJECT_CLASS (class);
-
- parent_class = g_type_class_peek_parent (class);
-
- epv->createControls = impl_createControls;
- epv->_get_userCreatableItems = impl__get_userCreatableItems;
- epv->requestCreateItem = impl_requestCreateItem;
-
- object_class->dispose = impl_dispose;
- object_class->finalize = impl_finalize;
-}
-
-static void
-calendar_component_init (CalendarComponent *component)
-{
- CalendarComponentPrivate *priv;
- GSList *groups;
-
- priv = g_new0 (CalendarComponentPrivate, 1);
-
- priv->config_directory = g_build_filename (g_get_home_dir (),
- ".evolution", "calendar", "config",
- NULL);
-
- /* EPFIXME: Should use a custom one instead? Also we should add
- * calendar_component_peek_gconf_client(). */
- priv->gconf_client = gconf_client_get_default ();
-
- priv->source_list = e_source_list_new_for_gconf (priv->gconf_client,
- "/apps/evolution/calendar/sources");
-
- priv->activity_handler = e_activity_handler_new ();
-
- /* create default calendars if there are no groups */
- groups = e_source_list_peek_groups (priv->source_list);
- if (!groups) {
- ESourceGroup *group;
- ESource *source;
- char *base_uri, *new_dir;
-
- /* create the local source group */
- base_uri = g_build_filename (g_get_home_dir (),
- "/.evolution/calendar/local/OnThisComputer/",
- NULL);
- group = e_source_group_new (_("On This Computer"), base_uri);
- e_source_list_add_group (priv->source_list, group, -1);
-
- /* migrate calendars from older setup */
- if (!migrate_old_calendars (group)) {
- /* create default calendars */
- new_dir = g_build_filename (base_uri, "Personal/", NULL);
- if (!e_mkdir_hier (new_dir, 0700)) {
- source = e_source_new (_("Personal"), "Personal");
- e_source_group_add_source (group, source, -1);
- }
- g_free (new_dir);
-
- new_dir = g_build_filename (base_uri, "Work/", NULL);
- if (!e_mkdir_hier (new_dir, 0700)) {
- source = e_source_new (_("Work"), "Work");
- e_source_group_add_source (group, source, -1);
- }
- g_free (new_dir);
- }
-
- g_free (base_uri);
-
- /* create the remote source group */
- group = e_source_group_new (_("On The Web"), "webcal://");
- e_source_list_add_group (priv->source_list, group, -1);
- }
-
- component->priv = priv;
-}
-
-
-/* Public API. */
-
-CalendarComponent *
-calendar_component_peek (void)
-{
- static CalendarComponent *component = NULL;
-
- if (component == NULL) {
- component = g_object_new (calendar_component_get_type (), NULL);
-
- if (e_mkdir_hier (calendar_component_peek_config_directory (component), 0777) != 0) {
- g_warning (G_STRLOC ": Cannot create directory %s: %s",
- calendar_component_peek_config_directory (component),
- g_strerror (errno));
- g_object_unref (component);
- component = NULL;
- }
- }
-
- return component;
-}
-
-const char *
-calendar_component_peek_config_directory (CalendarComponent *component)
-{
- return component->priv->config_directory;
-}
-
-
-EActivityHandler *
-calendar_component_peek_activity_handler (CalendarComponent *component)
-{
- return component->priv->activity_handler;
-}
-
-
-BONOBO_TYPE_FUNC_FULL (CalendarComponent, GNOME_Evolution_Component, PARENT_TYPE, calendar_component)
diff --git a/calendar/gui/calendar-component.h b/calendar/gui/calendar-component.h
deleted file mode 100644
index 77d2fe9879..0000000000
--- a/calendar/gui/calendar-component.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* calendar-component.h
- *
- * Copyright (C) 2003 Ettore Perazzoli
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Ettore Perazzoli <ettore@ximian.com>
- */
-
-#ifndef _CALENDAR_COMPONENT_H_
-#define _CALENDAR_COMPONENT_H_
-
-
-#include <bonobo/bonobo-object.h>
-#include <libedataserver/e-source-list.h>
-
-#include "e-activity-handler.h"
-#include "Evolution.h"
-
-
-#define CALENDAR_TYPE_COMPONENT (calendar_component_get_type ())
-#define CALENDAR_COMPONENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CALENDAR_TYPE_COMPONENT, CalendarComponent))
-#define CALENDAR_COMPONENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CALENDAR_TYPE_COMPONENT, CalendarComponentClass))
-#define CALENDAR_IS_COMPONENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CALENDAR_TYPE_COMPONENT))
-#define CALENDAR_IS_COMPONENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), CALENDAR_TYPE_COMPONENT))
-
-
-typedef struct _CalendarComponent CalendarComponent;
-typedef struct _CalendarComponentPrivate CalendarComponentPrivate;
-typedef struct _CalendarComponentClass CalendarComponentClass;
-
-struct _CalendarComponent {
- BonoboObject parent;
-
- CalendarComponentPrivate *priv;
-};
-
-struct _CalendarComponentClass {
- BonoboObjectClass parent_class;
-
- POA_GNOME_Evolution_Component__epv epv;
-};
-
-
-GType calendar_component_get_type (void);
-
-CalendarComponent *calendar_component_peek (void);
-
-const char *calendar_component_peek_config_directory (CalendarComponent *component);
-ESourceList *calendar_component_peek_source_list (CalendarComponent *component);
-EActivityHandler *calendar_component_peek_activity_handler (CalendarComponent *component);
-
-
-#endif /* _CALENDAR_COMPONENT_H_ */
diff --git a/calendar/gui/calendar-config-keys.h b/calendar/gui/calendar-config-keys.h
deleted file mode 100644
index ebe16b6539..0000000000
--- a/calendar/gui/calendar-config-keys.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors :
- * JP Rosevear <jpr@ximian.com>
- *
- * Copyright 2003, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifndef _CALENDAR_CONFIG_KEYS_H_
-#define _CALENDAR_CONFIG_KEYS_H_
-
-G_BEGIN_DECLS
-
-#define CALENDAR_CONFIG_PREFIX "/apps/evolution/calendar"
-
-/* Display settings */
-#define CALENDAR_CONFIG_TIMEZONE CALENDAR_CONFIG_PREFIX "/display/timezone"
-#define CALENDAR_CONFIG_SELECTED_CALENDARS CALENDAR_CONFIG_PREFIX "/display/selected_calendars"
-#define CALENDAR_CONFIG_PRIMARY_CALENDAR CALENDAR_CONFIG_PREFIX "/display/primary_calendar"
-#define CALENDAR_CONFIG_24HOUR CALENDAR_CONFIG_PREFIX "/display/use_24hour_format"
-#define CALENDAR_CONFIG_WEEK_START CALENDAR_CONFIG_PREFIX "/display/week_start_day"
-#define CALENDAR_CONFIG_DAY_START_HOUR CALENDAR_CONFIG_PREFIX "/display/day_start_hour"
-#define CALENDAR_CONFIG_DAY_START_MINUTE CALENDAR_CONFIG_PREFIX "/display/day_start_minute"
-#define CALENDAR_CONFIG_DAY_END_HOUR CALENDAR_CONFIG_PREFIX "/display/day_end_hour"
-#define CALENDAR_CONFIG_DAY_END_MINUTE CALENDAR_CONFIG_PREFIX "/display/day_end_minute"
-#define CALENDAR_CONFIG_TIME_DIVISIONS CALENDAR_CONFIG_PREFIX "/display/time_divisions"
-#define CALENDAR_CONFIG_TIME_DIVISIONS CALENDAR_CONFIG_PREFIX "/display/time_divisions"
-#define CALENDAR_CONFIG_DEFAULT_VIEW CALENDAR_CONFIG_PREFIX "/display/default_view"
-#define CALENDAR_CONFIG_HPANE_POS CALENDAR_CONFIG_PREFIX "/display/hpane_position"
-#define CALENDAR_CONFIG_VPANE_POS CALENDAR_CONFIG_PREFIX "/display/vpane_position"
-#define CALENDAR_CONFIG_MONTH_HPANE_POS CALENDAR_CONFIG_PREFIX "/display/month_hpane_position"
-#define CALENDAR_CONFIG_MONTH_VPANE_POS CALENDAR_CONFIG_PREFIX "/display/month_vpane_position"
-#define CALENDAR_CONFIG_TASK_VPANE_POS CALENDAR_CONFIG_PREFIX "/display/task_vpane_position"
-#define CALENDAR_CONFIG_COMPRESS_WEEKEND CALENDAR_CONFIG_PREFIX "/display/compress_weekend"
-#define CALENDAR_CONFIG_SHOW_EVENT_END CALENDAR_CONFIG_PREFIX "/display/show_event_end"
-#define CALENDAR_CONFIG_WORKING_DAYS CALENDAR_CONFIG_PREFIX "/display/working_days"
-
-/* Date navigator settings */
-#define CALENDAR_CONFIG_DN_SHOW_WEEK_NUMBERS CALENDAR_CONFIG_PREFIX "/date_navigator/show_week_numbers"
-
-/* Task display settings */
-#define CALENDAR_CONFIG_TASKS_SELECTED_TASKS CALENDAR_CONFIG_PREFIX "/tasks/selected_tasks"
-#define CALENDAR_CONFIG_PRIMARY_TASKS CALENDAR_CONFIG_PREFIX "/tasks/primary_tasks"
-#define CALENDAR_CONFIG_TASKS_HIDE_COMPLETED CALENDAR_CONFIG_PREFIX "/tasks/hide_completed"
-#define CALENDAR_CONFIG_TASKS_HIDE_COMPLETED_UNITS CALENDAR_CONFIG_PREFIX "/tasks/hide_completed_units"
-#define CALENDAR_CONFIG_TASKS_HIDE_COMPLETED_VALUE CALENDAR_CONFIG_PREFIX "/tasks/hide_completed_value"
-#define CALENDAR_CONFIG_TASKS_DUE_TODAY_COLOR CALENDAR_CONFIG_PREFIX "/tasks/colors/due_today"
-#define CALENDAR_CONFIG_TASKS_OVERDUE_COLOR CALENDAR_CONFIG_PREFIX "/tasks/colors/overdue"
-
-/* Prompt settings */
-#define CALENDAR_CONFIG_PROMPT_DELETE CALENDAR_CONFIG_PREFIX "/prompts/confirm_delete"
-#define CALENDAR_CONFIG_PROMPT_PURGE CALENDAR_CONFIG_PREFIX "/prompts/confirm_purge"
-
-/* Default reminder */
-#define CALENDAR_CONFIG_DEFAULT_REMINDER CALENDAR_CONFIG_PREFIX "/other/use_default_reminder"
-#define CALENDAR_CONFIG_DEFAULT_REMINDER_INTERVAL CALENDAR_CONFIG_PREFIX "/other/default_reminder_interval"
-#define CALENDAR_CONFIG_DEFAULT_REMINDER_UNITS CALENDAR_CONFIG_PREFIX "/other/default_reminder_units"
-
-G_END_DECLS
-
-#endif
diff --git a/calendar/gui/calendar-config.c b/calendar/gui/calendar-config.c
deleted file mode 100644
index 3c12c381ac..0000000000
--- a/calendar/gui/calendar-config.c
+++ /dev/null
@@ -1,1027 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Authors :
- * Damon Chaplin <damon@ximian.com>
- * Rodrigo Moya <rodrigo@ximian.com>
- *
- * Copyright 2000, Ximian, Inc.
- * Copyright 2000, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-/*
- * calendar-config.c - functions to load/save/get/set user settings.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-#include <time.h>
-#include <gtk/gtksignal.h>
-#include <libgnome/gnome-config.h>
-#include <libgnomeui/gnome-dialog.h>
-#include <gal/util/e-util.h>
-#include <widgets/e-timezone-dialog/e-timezone-dialog.h>
-#include <libecal/e-cal-time-util.h>
-
-#include "calendar-component.h"
-#include "calendar-commands.h"
-#include "e-tasks.h"
-#include "e-cell-date-edit-text.h"
-#include "calendar-config-keys.h"
-#include "calendar-config.h"
-
-
-
-static GConfClient *config = NULL;
-
-static void on_timezone_set (GnomeDialog *dialog,
- int button,
- ETimezoneDialog *etd);
-static gboolean on_timezone_dialog_delete_event (GnomeDialog *dialog,
- GdkEvent *event,
- ETimezoneDialog *etd);
-
-static void
-do_cleanup (void)
-{
- g_object_unref (config);
- config = NULL;
-}
-
-void
-calendar_config_init (void)
-{
- if (config)
- return;
-
- config = gconf_client_get_default ();
- g_atexit ((GVoidFunc) do_cleanup);
-
- gconf_client_add_dir (config, CALENDAR_CONFIG_PREFIX, GCONF_CLIENT_PRELOAD_RECURSIVE, NULL);
-}
-
-void
-calendar_config_remove_notification (guint id)
-{
- gconf_client_notify_remove (config, id);
-}
-
-/* Returns TRUE if the locale has 'am' and 'pm' strings defined, in which
- case the user can choose between 12 and 24-hour time formats. */
-gboolean
-calendar_config_locale_supports_12_hour_format (void)
-{
- char s[16];
- time_t t = 0;
-
- e_utf8_strftime (s, sizeof s, "%p", gmtime (&t));
- return s[0] != '\0';
-}
-
-/* Returns the string representation of a units value */
-static const char *
-units_to_string (CalUnits units)
-{
- switch (units) {
- case CAL_DAYS:
- return "days";
-
- case CAL_HOURS:
- return "hours";
-
- case CAL_MINUTES:
- return "minutes";
-
- default:
- g_assert_not_reached ();
- return NULL;
- }
-}
-
-/*
- * Calendar Settings.
- */
-
-/* The current list of calendars selected */
-GSList *
-calendar_config_get_calendars_selected (void)
-{
- return gconf_client_get_list (config, CALENDAR_CONFIG_SELECTED_CALENDARS, GCONF_VALUE_STRING, NULL);
-}
-
-void
-calendar_config_set_calendars_selected (GSList *selected)
-{
- gconf_client_set_list (config, CALENDAR_CONFIG_SELECTED_CALENDARS, GCONF_VALUE_STRING, selected, NULL);
-}
-
-guint
-calendar_config_add_notification_calendars_selected (GConfClientNotifyFunc func, gpointer data)
-{
- guint id;
-
- id = gconf_client_notify_add (config, CALENDAR_CONFIG_SELECTED_CALENDARS, func, data, NULL, NULL);
-
- return id;
-}
-
-/* The primary calendar */
-char *
-calendar_config_get_primary_calendar (void)
-{
- return gconf_client_get_string (config, CALENDAR_CONFIG_PRIMARY_CALENDAR, NULL);
-}
-
-void
-calendar_config_set_primary_calendar (const char *primary_uid)
-{
- gconf_client_set_string (config, CALENDAR_CONFIG_PRIMARY_CALENDAR, primary_uid, NULL);
-}
-
-
-guint
-calendar_config_add_notification_primary_calendar (GConfClientNotifyFunc func, gpointer data)
-{
- guint id;
-
- id = gconf_client_notify_add (config, CALENDAR_CONFIG_PRIMARY_CALENDAR, func, data, NULL, NULL);
-
- return id;
-}
-
-
-/* The current timezone, e.g. "Europe/London". It may be NULL, in which case
- you should assume UTC (though Evolution will show the timezone-setting
- dialog the next time a calendar or task folder is selected). */
-gchar *
-calendar_config_get_timezone (void)
-{
- /* FIXME Guard against NULL? */
- return gconf_client_get_string (config, CALENDAR_CONFIG_TIMEZONE, NULL);
-}
-
-
-/* Sets the timezone. If set to NULL it defaults to UTC.
- FIXME: Should check it is being set to a valid timezone. */
-void
-calendar_config_set_timezone (gchar *timezone)
-{
- if (timezone && timezone[0])
- gconf_client_set_string (config, CALENDAR_CONFIG_TIMEZONE, timezone, NULL);
- else
- gconf_client_set_string (config, CALENDAR_CONFIG_TIMEZONE, "UTC", NULL);
-}
-
-guint
-calendar_config_add_notification_timezone (GConfClientNotifyFunc func, gpointer data)
-{
- guint id;
-
- id = gconf_client_notify_add (config, CALENDAR_CONFIG_TIMEZONE, func, data, NULL, NULL);
-
- return id;
-}
-
-/* Whether we use 24-hour format or 12-hour format (AM/PM). */
-gboolean
-calendar_config_get_24_hour_format (void)
-{
- /* If the locale defines 'am' and 'pm' strings then the user has the
- choice of 12-hour or 24-hour time format, with 12-hour as the
- default. If the locale doesn't have 'am' and 'pm' strings we have
- to use 24-hour format, or strftime()/strptime() won't work. */
- if (calendar_config_locale_supports_12_hour_format ())
- return gconf_client_get_bool (config, CALENDAR_CONFIG_24HOUR, NULL);
-
- return TRUE;
-}
-
-
-void
-calendar_config_set_24_hour_format (gboolean use_24_hour)
-{
- gconf_client_set_bool (config, CALENDAR_CONFIG_24HOUR, use_24_hour, NULL);
-}
-
-guint
-calendar_config_add_notification_24_hour_format (GConfClientNotifyFunc func, gpointer data)
-{
- guint id;
-
- id = gconf_client_notify_add (config, CALENDAR_CONFIG_24HOUR, func, data, NULL, NULL);
-
- return id;
-}
-
-/* The start day of the week (0 = Sun to 6 = Mon). */
-gint
-calendar_config_get_week_start_day (void)
-{
- return gconf_client_get_int (config, CALENDAR_CONFIG_WEEK_START, NULL);
-}
-
-
-void
-calendar_config_set_week_start_day (gint week_start_day)
-{
- gconf_client_set_int (config, CALENDAR_CONFIG_WEEK_START, week_start_day, NULL);
-}
-
-guint
-calendar_config_add_notification_week_start_day (GConfClientNotifyFunc func, gpointer data)
-{
- guint id;
-
- id = gconf_client_notify_add (config, CALENDAR_CONFIG_WEEK_START, func, data, NULL, NULL);
-
- return id;
-}
-
-/* The start and end times of the work-day. */
-gint
-calendar_config_get_day_start_hour (void)
-{
- return gconf_client_get_int (config, CALENDAR_CONFIG_DAY_START_HOUR, NULL);
-}
-
-
-void
-calendar_config_set_day_start_hour (gint day_start_hour)
-{
- gconf_client_set_int (config, CALENDAR_CONFIG_DAY_START_HOUR, day_start_hour, NULL);
-}
-
-guint
-calendar_config_add_notification_day_start_hour (GConfClientNotifyFunc func, gpointer data)
-{
- guint id;
-
- id = gconf_client_notify_add (config, CALENDAR_CONFIG_DAY_START_HOUR, func, data, NULL, NULL);
-
- return id;
-}
-
-gint
-calendar_config_get_day_start_minute (void)
-{
- return gconf_client_get_int (config, CALENDAR_CONFIG_DAY_START_MINUTE, NULL);
-}
-
-
-void
-calendar_config_set_day_start_minute (gint day_start_min)
-{
- gconf_client_set_int (config, CALENDAR_CONFIG_DAY_START_MINUTE, day_start_min, NULL);
-}
-
-guint
-calendar_config_add_notification_day_start_minute (GConfClientNotifyFunc func, gpointer data)
-{
- guint id;
-
- id = gconf_client_notify_add (config, CALENDAR_CONFIG_DAY_START_MINUTE, func, data, NULL, NULL);
-
- return id;
-}
-
-gint
-calendar_config_get_day_end_hour (void)
-{
- return gconf_client_get_int (config, CALENDAR_CONFIG_DAY_END_HOUR, NULL);
-}
-
-
-void
-calendar_config_set_day_end_hour (gint day_end_hour)
-{
- gconf_client_set_int (config, CALENDAR_CONFIG_DAY_END_HOUR, day_end_hour, NULL);
-}
-
-guint
-calendar_config_add_notification_day_end_hour (GConfClientNotifyFunc func, gpointer data)
-{
- guint id;
-
- id = gconf_client_notify_add (config, CALENDAR_CONFIG_DAY_END_HOUR, func, data, NULL, NULL);
-
- return id;
-}
-
-gint
-calendar_config_get_day_end_minute (void)
-{
- return gconf_client_get_int (config, CALENDAR_CONFIG_DAY_END_MINUTE, NULL);
-}
-
-
-void
-calendar_config_set_day_end_minute (gint day_end_min)
-{
- gconf_client_set_int (config, CALENDAR_CONFIG_DAY_END_MINUTE, day_end_min, NULL);
-}
-
-guint
-calendar_config_add_notification_day_end_minute (GConfClientNotifyFunc func, gpointer data)
-{
- guint id;
-
- id = gconf_client_notify_add (config, CALENDAR_CONFIG_DAY_END_MINUTE, func, data, NULL, NULL);
-
- return id;
-}
-
-/* The time divisions in the Day/Work-Week view in minutes (5/10/15/30/60). */
-gint
-calendar_config_get_time_divisions (void)
-{
- return gconf_client_get_int (config, CALENDAR_CONFIG_TIME_DIVISIONS, NULL);
-}
-
-
-void
-calendar_config_set_time_divisions (gint divisions)
-{
- gconf_client_set_int (config, CALENDAR_CONFIG_TIME_DIVISIONS, divisions, NULL);
-}
-
-guint
-calendar_config_add_notification_time_divisions (GConfClientNotifyFunc func, gpointer data)
-{
- guint id;
-
- id = gconf_client_notify_add (config, CALENDAR_CONFIG_TIME_DIVISIONS, func, data, NULL, NULL);
-
- return id;
-}
-
-/* Whether we show week numbers in the Date Navigator. */
-gboolean
-calendar_config_get_dnav_show_week_no (void)
-{
- return gconf_client_get_bool (config, CALENDAR_CONFIG_DN_SHOW_WEEK_NUMBERS, NULL);
-}
-
-
-void
-calendar_config_set_dnav_show_week_no (gboolean show_week_no)
-{
- gconf_client_set_bool (config, CALENDAR_CONFIG_DN_SHOW_WEEK_NUMBERS, show_week_no, NULL);
-}
-
-guint
-calendar_config_add_notification_dnav_show_week_no (GConfClientNotifyFunc func, gpointer data)
-{
- guint id;
-
- id = gconf_client_notify_add (config, CALENDAR_CONFIG_DN_SHOW_WEEK_NUMBERS, func, data, NULL, NULL);
-
- return id;
-}
-
-/* The view to show on start-up, 0 = Day, 1 = WorkWeek, 2 = Week, 3 = Month. */
-gint
-calendar_config_get_default_view (void)
-{
- return gconf_client_get_int (config, CALENDAR_CONFIG_DEFAULT_VIEW, NULL);
-}
-
-
-void
-calendar_config_set_default_view (gint view)
-{
- gconf_client_set_int (config, CALENDAR_CONFIG_DEFAULT_VIEW, view, NULL);
-}
-
-
-/* The positions of the panes in the normal and month views. */
-gint
-calendar_config_get_hpane_pos (void)
-{
- return gconf_client_get_int (config, CALENDAR_CONFIG_HPANE_POS, NULL);
-}
-
-
-void
-calendar_config_set_hpane_pos (gint hpane_pos)
-{
- gconf_client_set_int (config, CALENDAR_CONFIG_HPANE_POS, hpane_pos, NULL);
-}
-
-
-gint
-calendar_config_get_vpane_pos (void)
-{
- return gconf_client_get_int (config, CALENDAR_CONFIG_VPANE_POS, NULL);
-}
-
-
-void
-calendar_config_set_vpane_pos (gint vpane_pos)
-{
- gconf_client_set_int (config, CALENDAR_CONFIG_VPANE_POS, vpane_pos, NULL);
-}
-
-
-gint
-calendar_config_get_month_hpane_pos (void)
-{
- return gconf_client_get_int (config, CALENDAR_CONFIG_MONTH_HPANE_POS, NULL);
-}
-
-
-void
-calendar_config_set_month_hpane_pos (gint hpane_pos)
-{
- gconf_client_set_int (config, CALENDAR_CONFIG_MONTH_HPANE_POS, hpane_pos, NULL);
-}
-
-
-gint
-calendar_config_get_month_vpane_pos (void)
-{
- return gconf_client_get_int (config, CALENDAR_CONFIG_MONTH_VPANE_POS, NULL);
-}
-
-
-void
-calendar_config_set_month_vpane_pos (gint vpane_pos)
-{
- gconf_client_set_int (config, CALENDAR_CONFIG_MONTH_VPANE_POS, vpane_pos, NULL);
-}
-
-/* The current list of task lists selected */
-GSList *
-calendar_config_get_tasks_selected (void)
-{
- return gconf_client_get_list (config, CALENDAR_CONFIG_TASKS_SELECTED_TASKS, GCONF_VALUE_STRING, NULL);
-}
-
-void
-calendar_config_set_tasks_selected (GSList *selected)
-{
- gconf_client_set_list (config, CALENDAR_CONFIG_TASKS_SELECTED_TASKS, GCONF_VALUE_STRING, selected, NULL);
-}
-
-guint
-calendar_config_add_notification_tasks_selected (GConfClientNotifyFunc func, gpointer data)
-{
- guint id;
-
- id = gconf_client_notify_add (config, CALENDAR_CONFIG_TASKS_SELECTED_TASKS, func, data, NULL, NULL);
-
- return id;
-}
-
-/* The primary task list */
-char *
-calendar_config_get_primary_tasks (void)
-{
- return gconf_client_get_string (config, CALENDAR_CONFIG_PRIMARY_TASKS, NULL);
-}
-
-void
-calendar_config_set_primary_tasks (const char *primary_uid)
-{
- gconf_client_set_string (config, CALENDAR_CONFIG_PRIMARY_TASKS, primary_uid, NULL);
-}
-
-
-guint
-calendar_config_add_notification_primary_tasks (GConfClientNotifyFunc func, gpointer data)
-{
- guint id;
-
- id = gconf_client_notify_add (config, CALENDAR_CONFIG_PRIMARY_TASKS, func, data, NULL, NULL);
-
- return id;
-}
-
-gint
-calendar_config_get_task_vpane_pos (void)
-{
- return gconf_client_get_int (config, CALENDAR_CONFIG_TASK_VPANE_POS, NULL);
-}
-
-
-void
-calendar_config_set_task_vpane_pos (gint vpane_pos)
-{
- gconf_client_set_int (config, CALENDAR_CONFIG_TASK_VPANE_POS, vpane_pos, NULL);
-}
-
-
-/* Whether we compress the weekend in the week/month views. */
-gboolean
-calendar_config_get_compress_weekend (void)
-{
- return gconf_client_get_bool (config, CALENDAR_CONFIG_COMPRESS_WEEKEND, NULL);
-}
-
-
-void
-calendar_config_set_compress_weekend (gboolean compress)
-{
- gconf_client_set_bool (config, CALENDAR_CONFIG_COMPRESS_WEEKEND, compress, NULL);
-}
-
-guint
-calendar_config_add_notification_compress_weekend (GConfClientNotifyFunc func, gpointer data)
-{
- guint id;
-
- id = gconf_client_notify_add (config, CALENDAR_CONFIG_COMPRESS_WEEKEND, func, data, NULL, NULL);
-
- return id;
-}
-
-/* Whether we show event end times. */
-gboolean
-calendar_config_get_show_event_end (void)
-{
- return gconf_client_get_bool (config, CALENDAR_CONFIG_SHOW_EVENT_END, NULL);
-}
-
-
-void
-calendar_config_set_show_event_end (gboolean show_end)
-{
- gconf_client_set_bool (config, CALENDAR_CONFIG_SHOW_EVENT_END, show_end, NULL);
-}
-
-guint
-calendar_config_add_notification_show_event_end (GConfClientNotifyFunc func, gpointer data)
-{
- guint id;
-
- id = gconf_client_notify_add (config, CALENDAR_CONFIG_SHOW_EVENT_END, func, data, NULL, NULL);
-
- return id;
-}
-
-/* The working days of the week, a bit-wise combination of flags. */
-CalWeekdays
-calendar_config_get_working_days (void)
-{
- return gconf_client_get_int (config, CALENDAR_CONFIG_WORKING_DAYS, NULL);
-}
-
-
-void
-calendar_config_set_working_days (CalWeekdays days)
-{
- gconf_client_set_int (config, CALENDAR_CONFIG_WORKING_DAYS, days, NULL);
-}
-
-guint
-calendar_config_add_notification_working_days (GConfClientNotifyFunc func, gpointer data)
-{
- guint id;
-
- id = gconf_client_notify_add (config, CALENDAR_CONFIG_WORKING_DAYS , func, data, NULL, NULL);
-
- return id;
-}
-
-/* Settings to hide completed tasks. */
-gboolean
-calendar_config_get_hide_completed_tasks (void)
-{
- return gconf_client_get_bool (config, CALENDAR_CONFIG_TASKS_HIDE_COMPLETED, NULL);
-}
-
-
-void
-calendar_config_set_hide_completed_tasks (gboolean hide)
-{
- gconf_client_set_bool (config, CALENDAR_CONFIG_TASKS_HIDE_COMPLETED, hide, NULL);
-}
-
-
-CalUnits
-calendar_config_get_hide_completed_tasks_units (void)
-{
- char *units;
- CalUnits cu;
-
- units = gconf_client_get_string (config, CALENDAR_CONFIG_TASKS_HIDE_COMPLETED_UNITS, NULL);
-
- if (!strcmp (units, "minutes"))
- cu = CAL_MINUTES;
- else if (!strcmp (units, "hours"))
- cu = CAL_HOURS;
- else
- cu = CAL_DAYS;
-
- g_free (units);
-
- return cu;
-}
-
-
-void
-calendar_config_set_hide_completed_tasks_units (CalUnits cu)
-{
- char *units;
-
- switch (cu) {
- case CAL_MINUTES :
- units = g_strdup ("minutes");
- break;
- case CAL_HOURS :
- units = g_strdup ("hours");
- break;
- default :
- units = g_strdup ("days");
- }
-
- gconf_client_set_string (config, CALENDAR_CONFIG_TASKS_HIDE_COMPLETED_UNITS, units, NULL);
-
- g_free (units);
-}
-
-
-gint
-calendar_config_get_hide_completed_tasks_value (void)
-{
- return gconf_client_get_int (config, CALENDAR_CONFIG_TASKS_HIDE_COMPLETED_VALUE, NULL);
-}
-
-
-void
-calendar_config_set_hide_completed_tasks_value (gint value)
-{
- gconf_client_set_int (config, CALENDAR_CONFIG_TASKS_HIDE_COMPLETED_VALUE, value, NULL);
-}
-
-/**
- * calendar_config_get_confirm_delete:
- *
- * Queries the configuration value for whether a confirmation dialog is
- * presented when deleting calendar/tasks items.
- *
- * Return value: Whether confirmation is required when deleting items.
- **/
-gboolean
-calendar_config_get_confirm_delete (void)
-{
- return gconf_client_get_bool (config, CALENDAR_CONFIG_PROMPT_DELETE, NULL);
-}
-
-/**
- * calendar_config_set_confirm_delete:
- * @confirm: Whether confirmation is required when deleting items.
- *
- * Sets the configuration value for whether a confirmation dialog is presented
- * when deleting calendar/tasks items.
- **/
-void
-calendar_config_set_confirm_delete (gboolean confirm)
-{
- gconf_client_set_bool (config, CALENDAR_CONFIG_PROMPT_DELETE, confirm, NULL);
-}
-
-/**
- * calendar_config_get_confirm_purge:
- *
- * Queries the configuration value for whether a confirmation dialog is
- * presented when purging calendar/tasks items.
- *
- * Return value: Whether confirmation is required when purging items.
- **/
-gboolean
-calendar_config_get_confirm_purge (void)
-{
- return gconf_client_get_bool (config, CALENDAR_CONFIG_PROMPT_PURGE, NULL);
-}
-
-/**
- * calendar_config_set_confirm_purge:
- * @confirm: Whether confirmation is required when purging items.
- *
- * Sets the configuration value for whether a confirmation dialog is presented
- * when purging calendar/tasks items.
- **/
-void
-calendar_config_set_confirm_purge (gboolean confirm)
-{
- gconf_client_set_bool (config, CALENDAR_CONFIG_PROMPT_PURGE, confirm, NULL);
-}
-
-/* This sets all the common config settings for an EDateEdit widget.
- These are the week start day, whether we show week numbers, and whether we
- use 24 hour format. */
-void
-calendar_config_configure_e_date_edit (EDateEdit *dedit)
-{
- gboolean dnav_show_week_no, use_24_hour;
- gint week_start_day;
-
- g_return_if_fail (E_IS_DATE_EDIT (dedit));
-
- dnav_show_week_no = calendar_config_get_dnav_show_week_no ();
-
- /* Note that this is 0 (Sun) to 6 (Sat). */
- week_start_day = calendar_config_get_week_start_day ();
-
- /* Convert it to 0 (Mon) to 6 (Sun), which is what we use. */
- week_start_day = (week_start_day + 6) % 7;
-
- use_24_hour = calendar_config_get_24_hour_format ();
-
- e_date_edit_set_week_start_day (dedit, week_start_day);
- e_date_edit_set_show_week_numbers (dedit, dnav_show_week_no);
- e_date_edit_set_use_24_hour_format (dedit, use_24_hour);
-}
-
-void
-calendar_config_check_timezone_set ()
-{
- ETimezoneDialog *timezone_dialog;
- GtkWidget *dialog;
- GList *elem;
- char *zone;
-
- zone = calendar_config_get_timezone ();
- if (zone && zone[0])
- return;
-
- /* Show timezone dialog. */
- timezone_dialog = e_timezone_dialog_new ();
- dialog = e_timezone_dialog_get_toplevel (timezone_dialog);
-
- /* Hide the cancel button, which is the 2nd button. */
- elem = g_list_nth (GNOME_DIALOG (dialog)->buttons, 1);
- gtk_widget_hide (elem->data);
-
- g_signal_connect (dialog, "clicked",
- G_CALLBACK (on_timezone_set), timezone_dialog);
- g_signal_connect (dialog, "delete-event",
- G_CALLBACK (on_timezone_dialog_delete_event), timezone_dialog);
-
- gtk_widget_show (dialog);
-}
-
-
-static void
-on_timezone_set (GnomeDialog *dialog,
- int button,
- ETimezoneDialog *etd)
-{
- icaltimezone *zone;
-
- zone = e_timezone_dialog_get_timezone (etd);
- if (zone)
- calendar_config_set_timezone (icaltimezone_get_location (zone));
-
- g_object_unref (etd);
-}
-
-
-static gboolean
-on_timezone_dialog_delete_event (GnomeDialog *dialog,
- GdkEvent *event,
- ETimezoneDialog *etd)
-{
- g_object_unref (etd);
- return TRUE;
-}
-
-
-/**
- * calendar_config_get_tasks_due_today_color:
- *
- * Queries the color to be used to display tasks that are due today.
- *
- * Return value: An X color specification.
- **/
-const char *
-calendar_config_get_tasks_due_today_color (void)
-{
- static char *color = NULL;
-
- if (color)
- g_free (color);
-
- color = gconf_client_get_string (config, CALENDAR_CONFIG_TASKS_DUE_TODAY_COLOR, NULL);
- return color;
-}
-
-/**
- * calendar_config_set_tasks_due_today_color:
- * @color: X color specification
- *
- * Sets the color to be used to display tasks that are due today.
- **/
-void
-calendar_config_set_tasks_due_today_color (const char *color)
-{
- g_return_if_fail (color != NULL);
-
- gconf_client_set_string (config, CALENDAR_CONFIG_TASKS_DUE_TODAY_COLOR, color, NULL);
-}
-
-/**
- * calendar_config_get_tasks_overdue_color:
- *
- * Queries the color to be used to display overdue tasks.
- *
- * Return value: An X color specification.
- **/
-const char *
-calendar_config_get_tasks_overdue_color (void)
-{
- static char *color = NULL;
-
- if (color)
- g_free (color);
-
- color = gconf_client_get_string (config, CALENDAR_CONFIG_TASKS_OVERDUE_COLOR, NULL);
- return color;
-}
-
-/**
- * calendar_config_set_tasks_overdue_color:
- * @color: X color specification
- *
- * Sets the color to be used to display overdue tasks.
- **/
-void
-calendar_config_set_tasks_overdue_color (const char *color)
-{
- g_return_if_fail (color != NULL);
-
- gconf_client_set_string (config, CALENDAR_CONFIG_TASKS_OVERDUE_COLOR, color, NULL);
-}
-
-/**
- * calendar_config_get_use_default_reminder:
- *
- * Queries whether new appointments should be created with a default reminder.
- *
- * Return value: Boolean value indicating whether new appointments should be
- * created with a default reminder from the values of
- * calendar_config_get_default_reminder_interval() and
- * calendar_config_get_default_reminder_units().
- **/
-gboolean
-calendar_config_get_use_default_reminder (void)
-{
- return gconf_client_get_bool (config, CALENDAR_CONFIG_DEFAULT_REMINDER, NULL);
-}
-
-/**
- * calendar_config_set_use_default_reminder:
- * @value: Whether to create new appointments with a default reminder.
- *
- * Sets whether newly-created appointments should get a default reminder set
- * them.
- **/
-void
-calendar_config_set_use_default_reminder (gboolean value)
-{
- gconf_client_set_bool (config, CALENDAR_CONFIG_DEFAULT_REMINDER, value, NULL);
-}
-
-/**
- * calendar_config_get_default_reminder_interval:
- *
- * Queries the interval for the default reminder of newly-created
- * appointments, i.e. 5 in "5 minutes".
- *
- * Return value: Interval for default reminders.
- **/
-int
-calendar_config_get_default_reminder_interval (void)
-{
- return gconf_client_get_int (config, CALENDAR_CONFIG_DEFAULT_REMINDER_INTERVAL, NULL);
-}
-
-/**
- * calendar_config_set_default_reminder_interval:
- * @interval: Interval value, e.g. 5 for "5 minutes".
- *
- * Sets the interval that should be used for the default reminder in new
- * appointments.
- **/
-void
-calendar_config_set_default_reminder_interval (int interval)
-{
- gconf_client_set_int (config, CALENDAR_CONFIG_DEFAULT_REMINDER_INTERVAL, interval, NULL);
-}
-
-/**
- * calendar_config_get_default_reminder_units:
- *
- * Queries the units of time in which default reminders should be created for
- * new appointments, e.g. CAL_MINUTES for "5 minutes".
- *
- * Return value: Time units for default reminders.
- **/
-CalUnits
-calendar_config_get_default_reminder_units (void)
-{
- char *units;
- CalUnits cu;
-
- units = gconf_client_get_string (config, CALENDAR_CONFIG_DEFAULT_REMINDER_UNITS, NULL);
-
- if (units && !strcmp (units, "days"))
- cu = CAL_DAYS;
- else if (units && !strcmp (units, "hours"))
- cu = CAL_HOURS;
- else
- cu = CAL_MINUTES;
- g_free (units);
-
- return cu;
-}
-
-/**
- * calendar_config_set_default_reminder_units:
- * @units: Time units, e.g. CAL_MINUTES for "5 minutes".
- *
- * Sets the units to be used for default reminders in new appointments.
- **/
-void
-calendar_config_set_default_reminder_units (CalUnits units)
-{
- gconf_client_set_string (config, CALENDAR_CONFIG_DEFAULT_REMINDER_UNITS, units_to_string(units), NULL);
-}
-
-/**
- * calendar_config_get_hide_completed_tasks_sexp:
- *
- * Returns the subexpression to use to filter out completed tasks according
- * to the config settings. The returned sexp should be freed.
- **/
-char*
-calendar_config_get_hide_completed_tasks_sexp (void)
-{
- char *sexp = NULL;
-
- if (calendar_config_get_hide_completed_tasks ()) {
- CalUnits units;
- gint value;
-
- units = calendar_config_get_hide_completed_tasks_units ();
- value = calendar_config_get_hide_completed_tasks_value ();
-
- if (value == 0) {
- /* If the value is 0, we want to hide completed tasks
- immediately, so we filter out all completed tasks.*/
- sexp = g_strdup ("(not is-completed?)");
- } else {
- char *location, *isodate;
- icaltimezone *zone;
- struct icaltimetype tt;
- time_t t;
-
- /* Get the current time, and subtract the appropriate
- number of days/hours/minutes. */
- location = calendar_config_get_timezone ();
- zone = icaltimezone_get_builtin_timezone (location);
- tt = icaltime_current_time_with_zone (zone);
-
- switch (units) {
- case CAL_DAYS:
- icaltime_adjust (&tt, -value, 0, 0, 0);
- break;
- case CAL_HOURS:
- icaltime_adjust (&tt, 0, -value, 0, 0);
- break;
- case CAL_MINUTES:
- icaltime_adjust (&tt, 0, 0, -value, 0);
- break;
- default:
- g_assert_not_reached ();
- }
-
- t = icaltime_as_timet_with_zone (tt, zone);
-
- /* Convert the time to an ISO date string, and build
- the query sub-expression. */
- isodate = isodate_from_time_t (t);
- sexp = g_strdup_printf ("(not (completed-before? (make-time \"%s\")))", isodate);
- }
- }
-
- return sexp;
-}
-
diff --git a/calendar/gui/calendar-config.h b/calendar/gui/calendar-config.h
deleted file mode 100644
index ff34febd91..0000000000
--- a/calendar/gui/calendar-config.h
+++ /dev/null
@@ -1,220 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Authors :
- * Damon Chaplin <damon@ximian.com>
- * Rodrigo Moya <rodrigo@ximian.com>
- *
- * Copyright 2000, Ximian, Inc.
- * Copyright 2000, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-/*
- * calendar-config.h - functions to load/save/get/set user settings.
- */
-
-#ifndef _CALENDAR_CONFIG_H_
-#define _CALENDAR_CONFIG_H_
-
-#include <gconf/gconf-client.h>
-#include <widgets/misc/e-calendar.h>
-#include <widgets/misc/e-dateedit.h>
-#include <widgets/misc/e-cell-date-edit.h>
-#include "e-calendar-table.h"
-
-
-/* These are used to get/set the working days in the week. The bit-flags are
- combined together. The bits must be from 0 (Sun) to 6 (Sat) to match the
- day values used by localtime etc. */
-typedef enum
-{
- CAL_SUNDAY = 1 << 0,
- CAL_MONDAY = 1 << 1,
- CAL_TUESDAY = 1 << 2,
- CAL_WEDNESDAY = 1 << 3,
- CAL_THURSDAY = 1 << 4,
- CAL_FRIDAY = 1 << 5,
- CAL_SATURDAY = 1 << 6
-} CalWeekdays;
-
-
-/* Units for settings. */
-typedef enum
-{
- CAL_DAYS,
- CAL_HOURS,
- CAL_MINUTES
-} CalUnits;
-
-
-void calendar_config_init (void);
-void calendar_config_remove_notification (guint id);
-
-/*
- * Calendar Settings.
- */
-
-/* The current list of calendars selected */
-GSList *calendar_config_get_calendars_selected (void);
-void calendar_config_set_calendars_selected (GSList *selected);
-guint calendar_config_add_notification_calendars_selected (GConfClientNotifyFunc func, gpointer data);
-
-/* The primary calendar */
-char *calendar_config_get_primary_calendar (void);
-void calendar_config_set_primary_calendar (const char *primary_uid);
-guint calendar_config_add_notification_primary_calendar (GConfClientNotifyFunc func, gpointer data);
-
-/* The current timezone, e.g. "Europe/London". */
-gchar* calendar_config_get_timezone (void);
-void calendar_config_set_timezone (gchar *timezone);
-guint calendar_config_add_notification_timezone (GConfClientNotifyFunc func, gpointer data);
-
-/* The working days of the week, a bit-wise combination of flags. */
-CalWeekdays calendar_config_get_working_days (void);
-void calendar_config_set_working_days (CalWeekdays days);
-guint calendar_config_add_notification_working_days (GConfClientNotifyFunc func, gpointer data);
-
-/* The start day of the week (0 = Sun to 6 = Sat). */
-gint calendar_config_get_week_start_day (void);
-void calendar_config_set_week_start_day (gint week_start_day);
-guint calendar_config_add_notification_week_start_day (GConfClientNotifyFunc func, gpointer data);
-
-/* The start and end times of the work-day. */
-gint calendar_config_get_day_start_hour (void);
-void calendar_config_set_day_start_hour (gint day_start_hour);
-guint calendar_config_add_notification_day_start_hour (GConfClientNotifyFunc func, gpointer data);
-
-gint calendar_config_get_day_start_minute (void);
-void calendar_config_set_day_start_minute (gint day_start_min);
-guint calendar_config_add_notification_day_start_minute (GConfClientNotifyFunc func, gpointer data);
-
-gint calendar_config_get_day_end_hour (void);
-void calendar_config_set_day_end_hour (gint day_end_hour);
-guint calendar_config_add_notification_day_end_hour (GConfClientNotifyFunc func, gpointer data);
-
-gint calendar_config_get_day_end_minute (void);
-void calendar_config_set_day_end_minute (gint day_end_min);
-guint calendar_config_add_notification_day_end_minute (GConfClientNotifyFunc func, gpointer data);
-
-/* Whether we use 24-hour format or 12-hour format (AM/PM). */
-gboolean calendar_config_get_24_hour_format (void);
-void calendar_config_set_24_hour_format (gboolean use_24_hour);
-guint calendar_config_add_notification_24_hour_format (GConfClientNotifyFunc func, gpointer data);
-
-/* The time divisions in the Day/Work-Week view in minutes (5/10/15/30/60). */
-gint calendar_config_get_time_divisions (void);
-void calendar_config_set_time_divisions (gint divisions);
-guint calendar_config_add_notification_time_divisions (GConfClientNotifyFunc func, gpointer data);
-
-/* Whether we show event end times. */
-gboolean calendar_config_get_show_event_end (void);
-void calendar_config_set_show_event_end (gboolean show_end);
-guint calendar_config_add_notification_show_event_end (GConfClientNotifyFunc func, gpointer data);
-
-/* Whether we compress the weekend in the week/month views. */
-gboolean calendar_config_get_compress_weekend (void);
-void calendar_config_set_compress_weekend (gboolean compress);
-guint calendar_config_add_notification_compress_weekend (GConfClientNotifyFunc func, gpointer data);
-
-/* Whether we show week numbers in the Date Navigator. */
-gboolean calendar_config_get_dnav_show_week_no (void);
-void calendar_config_set_dnav_show_week_no (gboolean show_week_no);
-guint calendar_config_add_notification_dnav_show_week_no (GConfClientNotifyFunc func, gpointer data);
-
-/* The view to show on start-up, 0 = Day, 1 = WorkWeek, 2 = Week, 3 = Month. */
-gint calendar_config_get_default_view (void);
-void calendar_config_set_default_view (gint view);
-
-/* The positions of the panes in the normal and month views. */
-gint calendar_config_get_hpane_pos (void);
-void calendar_config_set_hpane_pos (gint hpane_pos);
-
-gint calendar_config_get_vpane_pos (void);
-void calendar_config_set_vpane_pos (gint vpane_pos);
-
-gint calendar_config_get_month_hpane_pos (void);
-void calendar_config_set_month_hpane_pos (gint hpane_pos);
-
-gint calendar_config_get_month_vpane_pos (void);
-void calendar_config_set_month_vpane_pos (gint vpane_pos);
-
-/* The current list of task lists selected */
-GSList *calendar_config_get_tasks_selected (void);
-void calendar_config_set_tasks_selected (GSList *selected);
-guint calendar_config_add_notification_tasks_selected (GConfClientNotifyFunc func, gpointer data);
-
-/* The primary calendar */
-char *calendar_config_get_primary_tasks (void);
-void calendar_config_set_primary_tasks (const char *primary_uid);
-guint calendar_config_add_notification_primary_tasks (GConfClientNotifyFunc func, gpointer data);
-
-/* The pane position */
-gint calendar_config_get_task_vpane_pos (void);
-void calendar_config_set_task_vpane_pos (gint vpane_pos);
-
-/* Colors for the task list */
-const char *calendar_config_get_tasks_due_today_color (void);
-void calendar_config_set_tasks_due_today_color (const char *color);
-
-const char *calendar_config_get_tasks_overdue_color (void);
-void calendar_config_set_tasks_overdue_color (const char *color);
-
-/* Settings to hide completed tasks. */
-gboolean calendar_config_get_hide_completed_tasks (void);
-void calendar_config_set_hide_completed_tasks (gboolean hide);
-
-CalUnits calendar_config_get_hide_completed_tasks_units(void);
-void calendar_config_set_hide_completed_tasks_units(CalUnits units);
-
-gint calendar_config_get_hide_completed_tasks_value(void);
-void calendar_config_set_hide_completed_tasks_value(gint value);
-
-char* calendar_config_get_hide_completed_tasks_sexp (void);
-
-/* Confirmation options */
-gboolean calendar_config_get_confirm_delete (void);
-void calendar_config_set_confirm_delete (gboolean confirm);
-
-gboolean calendar_config_get_confirm_purge (void);
-void calendar_config_set_confirm_purge (gboolean confirm);
-
-/* Default reminder options */
-gboolean calendar_config_get_use_default_reminder (void);
-void calendar_config_set_use_default_reminder (gboolean value);
-
-int calendar_config_get_default_reminder_interval (void);
-void calendar_config_set_default_reminder_interval (int interval);
-
-CalUnits calendar_config_get_default_reminder_units (void);
-void calendar_config_set_default_reminder_units (CalUnits units);
-
-
-/* Convenience functions to configure common properties of ECalendar,
- EDateEdit & ECalendarTable widgets, and the ECellDateEdit ETable cell. */
-void calendar_config_configure_e_calendar (ECalendar *cal);
-void calendar_config_configure_e_date_edit (EDateEdit *dedit);
-void calendar_config_configure_e_calendar_table (ECalendarTable *cal_table);
-void calendar_config_configure_e_cell_date_edit (ECellDateEdit *ecde);
-
-/* Shows the timezone dialog if the user hasn't set a default timezone. */
-void calendar_config_check_timezone_set (void);
-
-/* Returns TRUE if the locale has 'am' and 'pm' strings defined, i.e. it
- supports 12-hour time format. */
-gboolean calendar_config_locale_supports_12_hour_format(void);
-
-#endif /* _CALENDAR_CONFIG_H_ */
diff --git a/calendar/gui/calendar-offline-handler.c b/calendar/gui/calendar-offline-handler.c
deleted file mode 100644
index 89a7aab36e..0000000000
--- a/calendar/gui/calendar-offline-handler.c
+++ /dev/null
@@ -1,345 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* calendar-offline-handler.c
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors:
- * Ettore Perazzoli <ettore@ximian.com>
- * Dan Winship <danw@ximian.com>
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <gtk/gtkmain.h>
-#include <gtk/gtksignal.h>
-#include <bonobo/bonobo-exception.h>
-#include <bonobo/bonobo-i18n.h>
-#include <gal/util/e-util.h>
-#include "e-util/e-url.h"
-#include <libecal/e-cal.h>
-#include "calendar-offline-handler.h"
-
-#define PARENT_TYPE bonobo_object_get_type ()
-static BonoboObjectClass *parent_class = NULL;
-
-struct _CalendarOfflineHandlerPrivate {
- ECal *client;
-
- GNOME_Evolution_OfflineProgressListener listener_interface;
-
- gboolean is_offline;
-};
-
-static void
-add_connection (gpointer data, gpointer user_data)
-{
- EUri *uri = e_uri_new (data);
- GNOME_Evolution_ConnectionList *list = user_data;
-
- g_return_if_fail (uri != NULL);
-
- if (uri->host != NULL)
- list->_buffer[list->_length].hostName = CORBA_string_dup (uri->host);
- else
- list->_buffer[list->_length].hostName = CORBA_string_dup ("Unknown");
- if (uri->protocol != NULL)
- list->_buffer[list->_length].type = CORBA_string_dup (uri->protocol);
- else
- list->_buffer[list->_length].type = CORBA_string_dup ("Unknown");
- list->_length++;
-
- e_uri_free (uri);
-}
-
-static GNOME_Evolution_ConnectionList *
-create_connection_list (CalendarOfflineHandler *offline_handler)
-{
- CalendarOfflineHandlerPrivate *priv;
- GNOME_Evolution_ConnectionList *list;
- GList *uris;
-
- priv = offline_handler->priv;
-
- uris = e_cal_uri_list (priv->client, CAL_MODE_REMOTE);
-
- list = GNOME_Evolution_ConnectionList__alloc ();
- list->_length = 0;
- list->_maximum = g_list_length (uris);
- list->_buffer = CORBA_sequence_GNOME_Evolution_Connection_allocbuf (list->_maximum);
-
- g_list_foreach (uris, add_connection, list);
-
- return list;
-}
-
-/* GNOME::Evolution::Offline methods. */
-static CORBA_boolean
-impl__get_isOffline (PortableServer_Servant servant,
- CORBA_Environment *ev)
-{
- CalendarOfflineHandler *offline_handler;
- CalendarOfflineHandlerPrivate *priv;
-
- offline_handler = CALENDAR_OFFLINE_HANDLER (bonobo_object_from_servant (servant));
- priv = offline_handler->priv;
-
- return priv->is_offline;
-}
-
-static void
-impl_prepareForOffline (PortableServer_Servant servant,
- GNOME_Evolution_ConnectionList **active_connection_list,
- CORBA_Environment *ev)
-{
- CalendarOfflineHandler *offline_handler;
- CalendarOfflineHandlerPrivate *priv;
-
- offline_handler = CALENDAR_OFFLINE_HANDLER (bonobo_object_from_servant (servant));
- priv = offline_handler->priv;
-
- *active_connection_list = create_connection_list (offline_handler);
-}
-
-static void
-update_offline (CalendarOfflineHandler *offline_handler)
-{
- CalendarOfflineHandlerPrivate *priv;
- GNOME_Evolution_ConnectionList *connection_list;
- CORBA_Environment ev;
-
- priv = offline_handler->priv;
-
- connection_list = create_connection_list (offline_handler);
-
- CORBA_exception_init (&ev);
-
- GNOME_Evolution_OfflineProgressListener_updateProgress (priv->listener_interface,
- connection_list, &ev);
-
- if (BONOBO_EX (&ev))
- g_warning ("Error updating offline progress");
-
- CORBA_exception_free (&ev);
-}
-
-static void
-backend_cal_set_mode (ECal *client, ECalSetModeStatus status, CalMode mode, gpointer data)
-{
- CalendarOfflineHandler *offline_handler = data;
-
- update_offline (offline_handler);
- g_object_unref (client);
-}
-
-static void
-backend_cal_opened_offline (ECal *client, ECalendarStatus status, gpointer data)
-{
- CalendarOfflineHandler *offline_handler = data;
-
- if (status != E_CALENDAR_STATUS_OK) {
- update_offline (offline_handler);
- g_object_unref (client);
- return;
- }
-
- g_signal_connect (client, "cal_set_mode", G_CALLBACK (backend_cal_set_mode), offline_handler);
- e_cal_set_mode (client, CAL_MODE_LOCAL);
-}
-
-static void
-backend_cal_opened_online (ECal *client, ECalendarStatus status, gpointer data)
-{
- if (status != E_CALENDAR_STATUS_OK) {
- g_object_unref (client);
- return;
- }
-
- e_cal_set_mode (client, CAL_MODE_REMOTE);
- g_object_unref (client);
-}
-
-static void
-backend_go_offline (gpointer data, gpointer user_data)
-{
- CalendarOfflineHandler *offline_handler = user_data;
- char *uri = data;
- ECal *client;
- gboolean success;
- GError *error = NULL;
-
- client = e_cal_new_from_uri (uri, CALOBJ_TYPE_ANY);
- g_signal_connect (client, "cal_opened", G_CALLBACK (backend_cal_opened_offline), offline_handler);
- success = e_cal_open (client, TRUE, &error);
- if (!success) {
- g_warning (_("backend_go_offline(): %s"), error->message);
- update_offline (offline_handler);
- g_object_unref (client);
- g_error_free (error);
- return;
- }
-}
-
-static void
-backend_go_online (gpointer data, gpointer user_data)
-{
- CalendarOfflineHandler *offline_handler = user_data;
- char *uri = data;
- ECal *client;
- gboolean success;
- GError *error = NULL;
-
- client = e_cal_new_from_uri (uri, CALOBJ_TYPE_ANY);
- g_signal_connect (G_OBJECT (client), "cal_opened",
- G_CALLBACK (backend_cal_opened_online), offline_handler);
- success = e_cal_open (client, TRUE, &error);
- if (!success) {
- g_warning (_("backend_go_online(): %s"), error->message);
- g_object_unref (client);
- g_error_free (error);
- return;
- }
-}
-
-static void
-impl_goOffline (PortableServer_Servant servant,
- const GNOME_Evolution_OfflineProgressListener progress_listener,
- CORBA_Environment *ev)
-{
- CalendarOfflineHandler *offline_handler;
- CalendarOfflineHandlerPrivate *priv;
- GList *uris;
-
- offline_handler = CALENDAR_OFFLINE_HANDLER (bonobo_object_from_servant (servant));
- priv = offline_handler->priv;
-
- /* To update the status */
- priv->listener_interface = CORBA_Object_duplicate (progress_listener, ev);
-
- uris = e_cal_uri_list (priv->client, CAL_MODE_REMOTE);
-
- g_list_foreach (uris, backend_go_offline, offline_handler);
-}
-
-static void
-impl_goOnline (PortableServer_Servant servant,
- CORBA_Environment *ev)
-{
- CalendarOfflineHandler *offline_handler;
- CalendarOfflineHandlerPrivate *priv;
- GList *uris;
-
- offline_handler = CALENDAR_OFFLINE_HANDLER (bonobo_object_from_servant (servant));
- priv = offline_handler->priv;
-
- uris = e_cal_uri_list (priv->client, CAL_MODE_LOCAL);
-
- g_list_foreach (uris, backend_go_online, offline_handler);
-}
-
-/* GObject methods. */
-
-static void
-impl_dispose (GObject *object)
-{
- CalendarOfflineHandler *offline_handler;
- CalendarOfflineHandlerPrivate *priv;
-
- offline_handler = CALENDAR_OFFLINE_HANDLER (object);
- priv = offline_handler->priv;
-
- if (priv->client) {
- g_object_unref (priv->client);
- priv->client = NULL;
- }
-
- if (priv->listener_interface != CORBA_OBJECT_NIL) {
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
- CORBA_Object_release (priv->listener_interface, &ev);
- CORBA_exception_free (&ev);
-
- priv->listener_interface = CORBA_OBJECT_NIL;
- }
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- (* G_OBJECT_CLASS (parent_class)->dispose) (object);
-}
-
-static void
-impl_finalize (GObject *object)
-{
- CalendarOfflineHandler *offline_handler;
- CalendarOfflineHandlerPrivate *priv;
-
- offline_handler = CALENDAR_OFFLINE_HANDLER (object);
- priv = offline_handler->priv;
-
- g_free (priv);
-
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
-}
-
-/* GTK+ type initialization. */
-
-static void
-calendar_offline_handler_class_init (CalendarOfflineHandlerClass *klass)
-{
- GObjectClass *object_class;
- POA_GNOME_Evolution_Offline__epv *epv;
-
- object_class = G_OBJECT_CLASS (klass);
- object_class->dispose = impl_dispose;
- object_class->finalize = impl_finalize;
-
- epv = & klass->epv;
- epv->_get_isOffline = impl__get_isOffline;
- epv->prepareForOffline = impl_prepareForOffline;
- epv->goOffline = impl_goOffline;
- epv->goOnline = impl_goOnline;
-
- parent_class = gtk_type_class (PARENT_TYPE);
-}
-
-static void
-calendar_offline_handler_init (CalendarOfflineHandler *offline_handler)
-{
- CalendarOfflineHandlerPrivate *priv;
-
- priv = g_new (CalendarOfflineHandlerPrivate, 1);
- offline_handler->priv = priv;
-
- /* FIXME: what URI to use? */
- priv->client = e_cal_new_from_uri ("", CALOBJ_TYPE_ANY);
- priv->listener_interface = CORBA_OBJECT_NIL;
- priv->is_offline = FALSE;
-}
-
-CalendarOfflineHandler *
-calendar_offline_handler_new (void)
-{
- CalendarOfflineHandler *new;
-
- new = g_object_new (calendar_offline_handler_get_type (), NULL);
-
- return new;
-}
-
-BONOBO_TYPE_FUNC_FULL (CalendarOfflineHandler, GNOME_Evolution_Offline, PARENT_TYPE, calendar_offline_handler);
diff --git a/calendar/gui/calendar-offline-handler.h b/calendar/gui/calendar-offline-handler.h
deleted file mode 100644
index 3cc61b4f25..0000000000
--- a/calendar/gui/calendar-offline-handler.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* calendar-offline-handler.h
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Ettore Perazzoli <ettore@ximian.com>
- */
-
-#ifndef _CALENDAR_OFFLINE_HANDLER_H_
-#define _CALENDAR_OFFLINE_HANDLER_H_
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <bonobo/bonobo-object.h>
-#include "Evolution.h"
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#define CALENDAR_TYPE_OFFLINE_HANDLER (calendar_offline_handler_get_type ())
-#define CALENDAR_OFFLINE_HANDLER(obj) (GTK_CHECK_CAST ((obj), CALENDAR_TYPE_OFFLINE_HANDLER, CalendarOfflineHandler))
-#define CALENDAR_OFFLINE_HANDLER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), CALENDAR_TYPE_OFFLINE_HANDLER, CalendarOfflineHandlerClass))
-#define CALENDAR_IS_OFFLINE_HANDLER(obj) (GTK_CHECK_TYPE ((obj), CALENDAR_TYPE_OFFLINE_HANDLER))
-#define CALENDAR_IS_OFFLINE_HANDLER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), CALENDAR_TYPE_OFFLINE_HANDLER))
-
-
-typedef struct _CalendarOfflineHandler CalendarOfflineHandler;
-typedef struct _CalendarOfflineHandlerPrivate CalendarOfflineHandlerPrivate;
-typedef struct _CalendarOfflineHandlerClass CalendarOfflineHandlerClass;
-
-struct _CalendarOfflineHandler {
- BonoboObject parent;
-
- CalendarOfflineHandlerPrivate *priv;
-};
-
-struct _CalendarOfflineHandlerClass {
- BonoboObjectClass parent_class;
-
- POA_GNOME_Evolution_Offline__epv epv;
-};
-
-
-GtkType calendar_offline_handler_get_type (void);
-CalendarOfflineHandler *calendar_offline_handler_new (void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _CALENDAR_OFFLINE_HANDLER_H_ */
diff --git a/calendar/gui/calendar-view-factory.c b/calendar/gui/calendar-view-factory.c
deleted file mode 100644
index a90e8a46d4..0000000000
--- a/calendar/gui/calendar-view-factory.c
+++ /dev/null
@@ -1,228 +0,0 @@
-/* Evolution calendar - Generic view factory for calendar views
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Author: Federico Mena-Quintero <federico@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <glib.h>
-#include <libgnome/gnome-i18n.h>
-#include "calendar-view-factory.h"
-#include "calendar-view.h"
-
-
-
-/* Private part of the CalendarViewFactory structure */
-struct _CalendarViewFactoryPrivate {
- /* Type of views created by this factory */
- GnomeCalendarViewType view_type;
-};
-
-
-
-static void calendar_view_factory_class_init (CalendarViewFactoryClass *class);
-static void calendar_view_factory_init (CalendarViewFactory *cal_view_factory);
-static void calendar_view_factory_finalize (GObject *object);
-
-static const char *calendar_view_factory_get_title (GalViewFactory *factory);
-static const char *calendar_view_factory_get_type_code (GalViewFactory *factory);
-static GalView *calendar_view_factory_new_view (GalViewFactory *factory, const char *name);
-
-static GalViewFactoryClass *parent_class = NULL;
-
-
-
-E_MAKE_TYPE (calendar_view_factory, "CalendarViewFactory", CalendarViewFactory,
- calendar_view_factory_class_init, calendar_view_factory_init, GAL_VIEW_FACTORY_TYPE);
-
-/* Class initialization function for the calendar view factory */
-static void
-calendar_view_factory_class_init (CalendarViewFactoryClass *class)
-{
- GalViewFactoryClass *gal_view_factory_class;
- GObjectClass *gobject_class;
-
- parent_class = g_type_class_peek_parent (class);
-
- gal_view_factory_class = (GalViewFactoryClass *) class;
- gobject_class = (GObjectClass *) class;
-
- gal_view_factory_class->get_title = calendar_view_factory_get_title;
- gal_view_factory_class->get_type_code = calendar_view_factory_get_type_code;
- gal_view_factory_class->new_view = calendar_view_factory_new_view;
-
- gobject_class->finalize = calendar_view_factory_finalize;
-}
-
-/* Object initialization class for the calendar view factory */
-static void
-calendar_view_factory_init (CalendarViewFactory *cal_view_factory)
-{
- CalendarViewFactoryPrivate *priv;
-
- priv = g_new0 (CalendarViewFactoryPrivate, 1);
- cal_view_factory->priv = priv;
-}
-
-/* Finalize method for the calendar view factory */
-static void
-calendar_view_factory_finalize (GObject *object)
-{
- CalendarViewFactory *cal_view_factory;
- CalendarViewFactoryPrivate *priv;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (IS_CALENDAR_VIEW_FACTORY (object));
-
- cal_view_factory = CALENDAR_VIEW_FACTORY (object);
- priv = cal_view_factory->priv;
-
- g_free (priv);
- cal_view_factory->priv = NULL;
-
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
-}
-
-
-
-/* get_title method for the calendar view factory */
-static const char *
-calendar_view_factory_get_title (GalViewFactory *factory)
-{
- CalendarViewFactory *cal_view_factory;
- CalendarViewFactoryPrivate *priv;
-
- cal_view_factory = CALENDAR_VIEW_FACTORY (factory);
- priv = cal_view_factory->priv;
-
- switch (priv->view_type) {
- case GNOME_CAL_DAY_VIEW:
- return _("Day View");
-
- case GNOME_CAL_WORK_WEEK_VIEW:
- return _("Work Week View");
-
- case GNOME_CAL_WEEK_VIEW:
- return _("Week View");
-
- case GNOME_CAL_MONTH_VIEW:
- return _("Month View");
-
- case GNOME_CAL_LIST_VIEW:
- return _("List View");
-
- default:
- g_assert_not_reached ();
- return NULL;
- }
-}
-
-/* get_type_code method for the calendar view factory */
-static const char *
-calendar_view_factory_get_type_code (GalViewFactory *factory)
-{
- CalendarViewFactory *cal_view_factory;
- CalendarViewFactoryPrivate *priv;
-
- cal_view_factory = CALENDAR_VIEW_FACTORY (factory);
- priv = cal_view_factory->priv;
-
- switch (priv->view_type) {
- case GNOME_CAL_DAY_VIEW:
- return "day_view";
-
- case GNOME_CAL_WORK_WEEK_VIEW:
- return "work_week_view";
-
- case GNOME_CAL_WEEK_VIEW:
- return "week_view";
-
- case GNOME_CAL_MONTH_VIEW:
- return "month_view";
-
- case GNOME_CAL_LIST_VIEW:
- return "list_view";
-
- default:
- g_assert_not_reached ();
- return NULL;
- }
-}
-
-/* new_view method for the calendar view factory */
-static GalView *
-calendar_view_factory_new_view (GalViewFactory *factory, const char *name)
-{
- CalendarViewFactory *cal_view_factory;
- CalendarViewFactoryPrivate *priv;
- CalendarView *cal_view;
-
- cal_view_factory = CALENDAR_VIEW_FACTORY (factory);
- priv = cal_view_factory->priv;
-
- cal_view = calendar_view_new (priv->view_type, name);
- return GAL_VIEW (cal_view);
-}
-
-
-
-/**
- * calendar_view_factory_construct:
- * @cal_view_factory: A calendar view factory.
- * @view_type: Type of calendar views that the factory will create.
- *
- * Constructs a calendar view factory by setting the type of views it will
- * create.
- *
- * Return value: The same value as @cal_view_factory.
- **/
-CalendarViewFactory *
-calendar_view_factory_construct (CalendarViewFactory *cal_view_factory,
- GnomeCalendarViewType view_type)
-{
- CalendarViewFactoryPrivate *priv;
-
- g_return_val_if_fail (cal_view_factory != NULL, NULL);
- g_return_val_if_fail (IS_CALENDAR_VIEW_FACTORY (cal_view_factory), NULL);
-
- priv = cal_view_factory->priv;
-
- priv->view_type = view_type;
-
- return cal_view_factory;
-}
-
-/**
- * calendar_view_factory_new:
- * @view_type: Type of calendar views that the factory will create.
- *
- * Creates a new factory for calendar views.
- *
- * Return value: A newly-created calendar view factory.
- **/
-CalendarViewFactory *
-calendar_view_factory_new (GnomeCalendarViewType view_type)
-{
- CalendarViewFactory *cal_view_factory;
-
- cal_view_factory = g_object_new (TYPE_CALENDAR_VIEW_FACTORY, NULL);
- return calendar_view_factory_construct (cal_view_factory, view_type);
-}
diff --git a/calendar/gui/calendar-view-factory.h b/calendar/gui/calendar-view-factory.h
deleted file mode 100644
index 6d1de25590..0000000000
--- a/calendar/gui/calendar-view-factory.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* Evolution calendar - Generic view factory for calendar views
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Author: Federico Mena-Quintero <federico@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef CALENDAR_VIEW_FACTORY_H
-#define CALENDAR_VIEW_FACTORY_H
-
-#include <gal/menus/gal-view-factory.h>
-#include "gnome-cal.h"
-
-G_BEGIN_DECLS
-
-
-
-#define TYPE_CALENDAR_VIEW_FACTORY (calendar_view_factory_get_type ())
-#define CALENDAR_VIEW_FACTORY(obj) (GTK_CHECK_CAST ((obj), TYPE_CALENDAR_VIEW_FACTORY, \
- CalendarViewFactory))
-#define CALENDAR_VIEW_FACTORY_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), \
- TYPE_CALENDAR_VIEW_FACTORY, CalendarViewClass))
-#define IS_CALENDAR_VIEW_FACTORY(obj) (GTK_CHECK_TYPE ((obj), TYPE_CALENDAR_VIEW_FACTORY))
-#define IS_CALENDAR_VIEW_FACTORY_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), \
- TYPE_CALENDAR_VIEW_FACTORY))
-
-typedef struct _CalendarViewFactoryPrivate CalendarViewFactoryPrivate;
-
-typedef struct {
- GalViewFactory factory;
-
- /* Private data */
- CalendarViewFactoryPrivate *priv;
-} CalendarViewFactory;
-
-typedef struct {
- GalViewFactoryClass parent_class;
-} CalendarViewFactoryClass;
-
-GtkType calendar_view_factory_get_type (void);
-
-CalendarViewFactory *calendar_view_factory_construct (CalendarViewFactory *cal_view_factory,
- GnomeCalendarViewType view_type);
-
-CalendarViewFactory *calendar_view_factory_new (GnomeCalendarViewType view_type);
-
-
-
-G_END_DECLS
-
-#endif
diff --git a/calendar/gui/calendar-view.c b/calendar/gui/calendar-view.c
deleted file mode 100644
index 1aec23ef36..0000000000
--- a/calendar/gui/calendar-view.c
+++ /dev/null
@@ -1,288 +0,0 @@
-/* Evolution calendar - Generic view object for calendar views
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Author: Federico Mena-Quintero <federico@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "calendar-view.h"
-
-
-
-/* Private part of the CalendarView structure */
-struct _CalendarViewPrivate {
- /* Type of the view */
- GnomeCalendarViewType view_type;
-
- /* Title of the view */
- char *title;
-};
-
-
-
-static void calendar_view_class_init (CalendarViewClass *class);
-static void calendar_view_init (CalendarView *cview);
-static void calendar_view_finalize (GObject *object);
-
-static void calendar_view_edit (GalView *view, GtkWindow *parent_window);
-static void calendar_view_load (GalView *view, const char *filename);
-static void calendar_view_save (GalView *view, const char *filename);
-static const char *calendar_view_get_title (GalView *view);
-static void calendar_view_set_title (GalView *view, const char *title);
-static const char *calendar_view_get_type_code (GalView *view);
-static GalView *calendar_view_clone (GalView *view);
-
-static GalViewClass *parent_class = NULL;
-
-
-
-E_MAKE_TYPE (calendar_view, "CalendarView", CalendarView, calendar_view_class_init,
- calendar_view_init, GAL_VIEW_TYPE);
-
-/* Class initialization function for the calendar view */
-static void
-calendar_view_class_init (CalendarViewClass *class)
-{
- GalViewClass *gal_view_class;
- GObjectClass *object_class;
-
- parent_class = g_type_class_peek_parent (class);
-
- gal_view_class = (GalViewClass *) class;
- object_class = (GObjectClass *) class;
-
- gal_view_class->edit = calendar_view_edit;
- gal_view_class->load = calendar_view_load;
- gal_view_class->save = calendar_view_save;
- gal_view_class->get_title = calendar_view_get_title;
- gal_view_class->set_title = calendar_view_set_title;
- gal_view_class->get_type_code = calendar_view_get_type_code;
- gal_view_class->clone = calendar_view_clone;
-
- object_class->finalize = calendar_view_finalize;
-}
-
-/* Object initialization function for the calendar view */
-static void
-calendar_view_init (CalendarView *cal_view)
-{
- CalendarViewPrivate *priv;
-
- priv = g_new0 (CalendarViewPrivate, 1);
- cal_view->priv = priv;
-
- priv->title = NULL;
-}
-
-/* Destroy method for the calendar view */
-static void
-calendar_view_finalize (GObject *object)
-{
- CalendarView *cal_view;
- CalendarViewPrivate *priv;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (IS_CALENDAR_VIEW (object));
-
- cal_view = CALENDAR_VIEW (object);
- priv = cal_view->priv;
-
- if (priv->title) {
- g_free (priv->title);
- priv->title = NULL;
- }
-
- g_free (priv);
- cal_view->priv = NULL;
-
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
-}
-
-
-
-/* edit method of the calendar view */
-static void
-calendar_view_edit (GalView *view, GtkWindow *parent_window)
-{
- /* nothing */
-}
-
-/* load method of the calendar view */
-static void
-calendar_view_load (GalView *view, const char *filename)
-{
- /* nothing */
-}
-
-/* save method of the calendar view */
-static void
-calendar_view_save (GalView *view, const char *filename)
-{
- /* nothing */
-}
-
-/* get_title method of the calendar view */
-static const char *
-calendar_view_get_title (GalView *view)
-{
- CalendarView *cal_view;
- CalendarViewPrivate *priv;
-
- cal_view = CALENDAR_VIEW (view);
- priv = cal_view->priv;
-
- return priv->title;
-}
-
-/* set_title method of the calendar view */
-static void
-calendar_view_set_title (GalView *view, const char *title)
-{
- CalendarView *cal_view;
- CalendarViewPrivate *priv;
-
- cal_view = CALENDAR_VIEW (view);
- priv = cal_view->priv;
-
- if (priv->title)
- g_free (priv->title);
-
- priv->title = g_strdup (title);
-}
-
-/* get_type_code method for the calendar view */
-static const char *
-calendar_view_get_type_code (GalView *view)
-{
- CalendarView *cal_view;
- CalendarViewPrivate *priv;
-
- cal_view = CALENDAR_VIEW (view);
- priv = cal_view->priv;
-
- switch (priv->view_type) {
- case GNOME_CAL_DAY_VIEW:
- return "day_view";
-
- case GNOME_CAL_WORK_WEEK_VIEW:
- return "work_week_view";
-
- case GNOME_CAL_WEEK_VIEW:
- return "week_view";
-
- case GNOME_CAL_MONTH_VIEW:
- return "month_view";
-
- default:
- g_assert_not_reached ();
- return NULL;
- }
-}
-
-/* clone method for the calendar view */
-static GalView *
-calendar_view_clone (GalView *view)
-{
- CalendarView *cal_view;
- CalendarViewPrivate *priv;
- CalendarView *new_view;
- CalendarViewPrivate *new_priv;
-
- cal_view = CALENDAR_VIEW (view);
- priv = cal_view->priv;
-
- new_view = g_object_new (TYPE_CALENDAR_VIEW, NULL);
- new_priv = new_view->priv;
-
- new_priv->view_type = priv->view_type;
- new_priv->title = g_strdup (priv->title);
-
- return GAL_VIEW (new_view);
-}
-
-
-
-/**
- * calendar_view_construct:
- * @cal_view: A calendar view.
- * @view_type: The type of calendar view that this object will represent.
- * @title: Title for the view.
- *
- * Constructs a calendar view by setting its view type and title.
- *
- * Return value: The same value as @cal_view.
- **/
-CalendarView *
-calendar_view_construct (CalendarView *cal_view,
- GnomeCalendarViewType view_type,
- const char *title)
-{
- CalendarViewPrivate *priv;
-
- g_return_val_if_fail (cal_view != NULL, NULL);
- g_return_val_if_fail (IS_CALENDAR_VIEW (cal_view), NULL);
- g_return_val_if_fail (title != NULL, NULL);
-
- priv = cal_view->priv;
-
- priv->view_type = view_type;
- priv->title = g_strdup (title);
-
- return cal_view;
-}
-
-/**
- * calendar_view_new:
- * @view_type: The type of calendar view that this object will represent.
- * @title: Title for the view.
- *
- * Creates a new calendar view object.
- *
- * Return value: A newly-created calendar view.
- **/
-CalendarView *
-calendar_view_new (GnomeCalendarViewType view_type, const char *title)
-{
- CalendarView *cal_view;
-
- cal_view = g_object_new (TYPE_CALENDAR_VIEW, NULL);
- return calendar_view_construct (cal_view, view_type, title);
-}
-
-/**
- * calendar_view_get_view_type:
- * @cal_view: A calendar view.
- *
- * Queries the calendar view type of a calendar view.
- *
- * Return value: Type of calendar view.
- **/
-GnomeCalendarViewType
-calendar_view_get_view_type (CalendarView *cal_view)
-{
- CalendarViewPrivate *priv;
-
- g_return_val_if_fail (cal_view != NULL, GNOME_CAL_DAY_VIEW);
- g_return_val_if_fail (IS_CALENDAR_VIEW (cal_view), GNOME_CAL_DAY_VIEW);
-
- priv = cal_view->priv;
- return priv->view_type;
-}
diff --git a/calendar/gui/calendar-view.h b/calendar/gui/calendar-view.h
deleted file mode 100644
index 8b85966a90..0000000000
--- a/calendar/gui/calendar-view.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* Evolution calendar - Generic view object for calendar views
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Author: Federico Mena-Quintero <federico@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef CALENDAR_VIEW_H
-#define CALENDAR_VIEW_H
-
-#include <gal/menus/gal-view.h>
-#include "gnome-cal.h"
-
-G_BEGIN_DECLS
-
-
-
-#define TYPE_CALENDAR_VIEW (calendar_view_get_type ())
-#define CALENDAR_VIEW(obj) (GTK_CHECK_CAST ((obj), TYPE_CALENDAR_VIEW, CalendarView))
-#define CALENDAR_VIEW_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), TYPE_CALENDAR_VIEW, \
- CalendarViewClass))
-#define IS_CALENDAR_VIEW(obj) (GTK_CHECK_TYPE ((obj), TYPE_CALENDAR_VIEW))
-#define IS_CALENDAR_VIEW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), TYPE_CALENDAR_VIEW))
-
-typedef struct _CalendarViewPrivate CalendarViewPrivate;
-
-typedef struct {
- GalView view;
-
- /* Private data */
- CalendarViewPrivate *priv;
-} CalendarView;
-
-typedef struct {
- GalViewClass parent_class;
-} CalendarViewClass;
-
-GtkType calendar_view_get_type (void);
-
-CalendarView *calendar_view_construct (CalendarView *cal_view,
- GnomeCalendarViewType view_type,
- const char *title);
-
-CalendarView *calendar_view_new (GnomeCalendarViewType view_type,
- const char *title);
-
-GnomeCalendarViewType calendar_view_get_view_type (CalendarView *cal_view);
-
-
-
-G_END_DECLS
-
-#endif
diff --git a/calendar/gui/comp-editor-factory.c b/calendar/gui/comp-editor-factory.c
deleted file mode 100644
index a50b135f90..0000000000
--- a/calendar/gui/comp-editor-factory.c
+++ /dev/null
@@ -1,663 +0,0 @@
-/* Evolution calendar - Component editor factory object
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Authors: Federico Mena-Quintero <federico@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <gtk/gtkmessagedialog.h>
-#include <bonobo/bonobo-exception.h>
-#include <bonobo/bonobo-i18n.h>
-#include <evolution-calendar.h>
-#include <e-util/e-url.h>
-#include <libecal/e-cal.h>
-#include "calendar-config.h"
-#include "e-comp-editor-registry.h"
-#include "comp-editor-factory.h"
-#include "comp-util.h"
-#include "dialogs/event-editor.h"
-#include "dialogs/task-editor.h"
-
-extern ECompEditorRegistry *comp_editor_registry;
-
-
-
-/* A pending request */
-
-typedef enum {
- REQUEST_EXISTING,
- REQUEST_NEW
-} RequestType;
-
-typedef struct {
- RequestType type;
-
- union {
- struct {
- char *uid;
- } existing;
-
- struct {
- GNOME_Evolution_Calendar_CompEditorFactory_CompEditorMode type;
- } new;
- } u;
-} Request;
-
-/* A client we have open */
-typedef struct {
- /* Our parent CompEditorFactory */
- CompEditorFactory *factory;
-
- /* Uri of the calendar, used as key in the clients hash table */
- char *uri;
-
- /* Client of the calendar */
- ECal *client;
-
- /* Count editors using this client */
- int editor_count;
-
- /* Pending requests; they are pending if the client is still being opened */
- GSList *pending;
-
- /* Whether this is open or still waiting */
- guint open : 1;
-} OpenClient;
-
-/* Private part of the CompEditorFactory structure */
-struct CompEditorFactoryPrivate {
- /* Hash table of URI->OpenClient */
- GHashTable *uri_client_hash;
-};
-
-
-
-static void comp_editor_factory_class_init (CompEditorFactoryClass *class);
-static void comp_editor_factory_init (CompEditorFactory *factory);
-static void comp_editor_factory_finalize (GObject *object);
-
-static void impl_editExisting (PortableServer_Servant servant,
- const CORBA_char *str_uri,
- const CORBA_char *uid,
- CORBA_Environment *ev);
-static void impl_editNew (PortableServer_Servant servant,
- const CORBA_char *str_uri,
- const GNOME_Evolution_Calendar_CalObjType type,
- CORBA_Environment *ev);
-
-static BonoboObjectClass *parent_class = NULL;
-
-
-
-BONOBO_TYPE_FUNC_FULL (CompEditorFactory,
- GNOME_Evolution_Calendar_CompEditorFactory,
- BONOBO_OBJECT_TYPE,
- comp_editor_factory);
-
-/* Class initialization function for the component editor factory */
-static void
-comp_editor_factory_class_init (CompEditorFactoryClass *class)
-{
- GObjectClass *object_class;
-
- object_class = (GObjectClass *) class;
-
- parent_class = g_type_class_peek_parent (class);
-
- class->epv.editExisting = impl_editExisting;
- class->epv.editNew = impl_editNew;
-
- object_class->finalize = comp_editor_factory_finalize;
-}
-
-/* Object initialization function for the component editor factory */
-static void
-comp_editor_factory_init (CompEditorFactory *factory)
-{
- CompEditorFactoryPrivate *priv;
-
- priv = g_new (CompEditorFactoryPrivate, 1);
- factory->priv = priv;
-
- priv->uri_client_hash = g_hash_table_new (g_str_hash, g_str_equal);
-}
-
-/* Frees a Request structure */
-static void
-free_request (Request *r)
-{
- if (r->type == REQUEST_EXISTING) {
- g_assert (r->u.existing.uid != NULL);
- g_free (r->u.existing.uid);
- }
-
- g_free (r);
-}
-
-/* Frees an OpenClient structure */
-static void
-free_client (OpenClient *oc)
-{
- GSList *l;
-
- g_free (oc->uri);
- oc->uri = NULL;
-
- g_object_unref (oc->client);
- oc->client = NULL;
-
- for (l = oc->pending; l; l = l->next) {
- Request *r;
-
- r = l->data;
- free_request (r);
- }
- g_slist_free (oc->pending);
- oc->pending = NULL;
-
- g_free (oc);
-}
-
-/* Used from g_hash_table_foreach(); frees a client structure */
-static void
-free_client_cb (gpointer key, gpointer value, gpointer data)
-{
- OpenClient *oc;
-
- oc = value;
- free_client (oc);
-}
-
-/* Destroy handler for the component editor factory */
-static void
-comp_editor_factory_finalize (GObject *object)
-{
- CompEditorFactory *factory;
- CompEditorFactoryPrivate *priv;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (IS_COMP_EDITOR_FACTORY (object));
-
- factory = COMP_EDITOR_FACTORY (object);
- priv = factory->priv;
-
- g_hash_table_foreach (priv->uri_client_hash, free_client_cb, NULL);
- g_hash_table_destroy (priv->uri_client_hash);
- priv->uri_client_hash = NULL;
-
- g_free (priv);
- factory->priv = NULL;
-
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
-}
-
-
-
-/* Callback used when a component editor gets destroyed */
-static void
-editor_destroy_cb (GtkObject *object, gpointer data)
-{
- OpenClient *oc;
- CompEditorFactory *factory;
- CompEditorFactoryPrivate *priv;
-
- oc = data;
- factory = oc->factory;
- priv = factory->priv;
-
- oc->editor_count--;
-
- /* See if we need to free the client */
- g_assert (oc->pending == NULL);
-
- if (oc->editor_count != 0)
- return;
-
- g_hash_table_remove (priv->uri_client_hash, oc->uri);
- free_client (oc);
-}
-
-/* Starts editing an existing component on a client that is already open */
-static void
-edit_existing (OpenClient *oc, const char *uid)
-{
- ECalComponent *comp;
- icalcomponent *icalcomp;
- CompEditor *editor;
- ECalComponentVType vtype;
-
- g_assert (oc->open);
-
- /* Get the object */
- if (!e_cal_get_object (oc->client, uid, NULL, &icalcomp, NULL)) {
- /* FIXME Better error handling */
- g_warning (G_STRLOC ": Syntax error while getting component `%s'", uid);
-
- return;
- }
-
- comp = e_cal_component_new ();
- if (!e_cal_component_set_icalcomponent (comp, icalcomp)) {
- g_object_unref (comp);
- icalcomponent_free (icalcomp);
- return;
- }
-
- /* Create the appropriate type of editor */
-
- vtype = e_cal_component_get_vtype (comp);
-
- switch (vtype) {
- case E_CAL_COMPONENT_EVENT:
- editor = COMP_EDITOR (event_editor_new (oc->client));
- break;
-
- case E_CAL_COMPONENT_TODO:
- editor = COMP_EDITOR (task_editor_new (oc->client));
- break;
-
- default:
- g_message ("edit_exiting(): Unsupported object type %d", (int) vtype);
- g_object_unref (comp);
- return;
- }
-
- /* Set the object on the editor */
- comp_editor_edit_comp (editor, comp);
- comp_editor_focus (editor);
-
- oc->editor_count++;
- g_signal_connect (editor, "destroy", G_CALLBACK (editor_destroy_cb), oc);
-
- e_comp_editor_registry_add (comp_editor_registry, editor, TRUE);
-}
-
-/* Creates a component with the appropriate defaults for the specified component
- * type.
- */
-static ECalComponent *
-get_default_event (ECal *client, gboolean all_day)
-{
- ECalComponent *comp;
- struct icaltimetype itt;
- ECalComponentDateTime dt;
- char *location;
- icaltimezone *zone;
-
- comp = cal_comp_event_new_with_defaults (client);
-
- location = calendar_config_get_timezone ();
- zone = icaltimezone_get_builtin_timezone (location);
-
- if (all_day) {
- itt = icaltime_from_timet_with_zone (time (NULL), 1, zone);
-
- dt.value = &itt;
- dt.tzid = icaltimezone_get_tzid (zone);
-
- e_cal_component_set_dtstart (comp, &dt);
- e_cal_component_set_dtend (comp, &dt);
- } else {
- itt = icaltime_current_time_with_zone (zone);
- icaltime_adjust (&itt, 0, 1, -itt.minute, -itt.second);
-
- dt.value = &itt;
- dt.tzid = icaltimezone_get_tzid (zone);
-
- e_cal_component_set_dtstart (comp, &dt);
- icaltime_adjust (&itt, 0, 1, 0, 0);
- e_cal_component_set_dtend (comp, &dt);
- }
-
- e_cal_component_commit_sequence (comp);
-
- return comp;
-}
-
-static ECalComponent *
-get_default_task (ECal *client)
-{
- ECalComponent *comp;
-
- comp = cal_comp_task_new_with_defaults (client);
-
- return comp;
-}
-
-/* Edits a new object in the context of a client */
-static void
-edit_new (OpenClient *oc, const GNOME_Evolution_Calendar_CompEditorFactory_CompEditorMode type)
-{
- ECalComponent *comp;
- CompEditor *editor;
-
- switch (type) {
- case GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_EVENT:
- case GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_MEETING:
- editor = COMP_EDITOR (event_editor_new (oc->client));
- comp = get_default_event (oc->client, FALSE);
- break;
- case GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_ALLDAY_EVENT:
- editor = COMP_EDITOR (event_editor_new (oc->client));
- comp = get_default_event (oc->client, TRUE);
- break;
- case GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_TODO:
- editor = COMP_EDITOR (task_editor_new (oc->client));
- comp = get_default_task (oc->client);
- break;
- default:
- g_assert_not_reached ();
- return;
- }
-
- comp_editor_edit_comp (editor, comp);
- if (type == GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_MEETING)
- event_editor_show_meeting (EVENT_EDITOR (editor));
- comp_editor_focus (editor);
-
- oc->editor_count++;
- g_signal_connect (editor, "destroy", G_CALLBACK (editor_destroy_cb), oc);
-
- e_comp_editor_registry_add (comp_editor_registry, editor, TRUE);
-}
-
-/* Resolves all the pending requests for a client */
-static void
-resolve_pending_requests (OpenClient *oc)
-{
- CompEditorFactory *factory;
- CompEditorFactoryPrivate *priv;
- GSList *l;
- char *location;
- icaltimezone *zone;
-
- factory = oc->factory;
- priv = factory->priv;
-
- if (!oc->pending)
- return;
-
- /* Set the default timezone in the backend. */
- location = calendar_config_get_timezone ();
- zone = icaltimezone_get_builtin_timezone (location);
- if (zone)
- /* FIXME Error handling? */
- e_cal_set_default_timezone (oc->client, zone, NULL);
-
- for (l = oc->pending; l; l = l->next) {
- Request *request;
-
- request = l->data;
-
- switch (request->type) {
- case REQUEST_EXISTING:
- edit_existing (oc, request->u.existing.uid);
- break;
-
- case REQUEST_NEW:
- edit_new (oc, request->u.new.type);
- break;
- }
-
- free_request (request);
- }
-
- g_slist_free (oc->pending);
- oc->pending = NULL;
-}
-
-/* Callback used when a client is finished opening. We resolve all the pending
- * requests.
- */
-static void
-cal_opened_cb (ECal *client, ECalendarStatus status, gpointer data)
-{
- OpenClient *oc;
- CompEditorFactory *factory;
- CompEditorFactoryPrivate *priv;
- GtkWidget *dialog = NULL;
-
- oc = data;
- factory = oc->factory;
- priv = factory->priv;
-
- switch (status) {
- case E_CALENDAR_STATUS_OK:
- oc->open = TRUE;
- resolve_pending_requests (oc);
- return;
-
- case E_CALENDAR_STATUS_OTHER_ERROR:
- dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
- GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
- _("Error while opening the calendar"));
- break;
-
- case E_CALENDAR_STATUS_NO_SUCH_CALENDAR:
- /* oops - we specified only_if_exists = FALSE */
- g_assert_not_reached ();
- return;
-
- case E_CALENDAR_STATUS_PROTOCOL_NOT_SUPPORTED:
- dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
- GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
- _("Method not supported when opening the calendar"));
- break;
-
- case E_CALENDAR_STATUS_PERMISSION_DENIED :
- dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
- GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
- _("Permission denied to open the calendar"));
- break;
-
- default:
- g_assert_not_reached ();
- return;
- }
-
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
-
- g_hash_table_remove (priv->uri_client_hash, oc->uri);
- free_client (oc);
-}
-
-/* Creates a new OpenClient structure and queues the component editing/creation
- * process until the client is open. Returns NULL if it could not issue the
- * open request.
- */
-static OpenClient *
-open_client (CompEditorFactory *factory, const char *uristr)
-{
- CompEditorFactoryPrivate *priv;
- ECal *client;
- OpenClient *oc;
- GError *error = NULL;
-
- priv = factory->priv;
-
- client = e_cal_new_from_uri (uristr, CALOBJ_TYPE_ANY);
- if (!client)
- return NULL;
-
- oc = g_new (OpenClient, 1);
- oc->factory = factory;
-
- oc->uri = g_strdup (uristr);
-
- oc->client = client;
- oc->editor_count = 0;
- oc->pending = NULL;
- oc->open = FALSE;
-
- g_signal_connect (oc->client, "cal_opened", G_CALLBACK (cal_opened_cb), oc);
-
- g_hash_table_insert (priv->uri_client_hash, oc->uri, oc);
-
- if (!e_cal_open (oc->client, FALSE, &error)) {
- g_warning (_("open_client(): %s"), error->message);
- g_free (oc->uri);
- g_object_unref (oc->client);
- g_free (oc);
- g_error_free (error);
-
- return NULL;
- }
-
- return oc;
-}
-
-/* Looks up an open client or queues it for being opened. Returns the client or
- * NULL on failure; in the latter case it sets the ev exception.
- */
-static OpenClient *
-lookup_open_client (CompEditorFactory *factory, const char *str_uri, CORBA_Environment *ev)
-{
- CompEditorFactoryPrivate *priv;
- OpenClient *oc;
- EUri *uri;
-
- priv = factory->priv;
-
- /* Look up the client */
-
- uri = e_uri_new (str_uri);
- if (!uri) {
- bonobo_exception_set (ev, ex_GNOME_Evolution_Calendar_CompEditorFactory_InvalidURI);
- return NULL;
- }
- e_uri_free (uri);
-
- oc = g_hash_table_lookup (priv->uri_client_hash, str_uri);
- if (!oc) {
- oc = open_client (factory, str_uri);
- if (!oc) {
- bonobo_exception_set (ev, ex_GNOME_Evolution_Calendar_CompEditorFactory_BackendContactError);
- return NULL;
- }
- }
-
- return oc;
-}
-
-/* Queues a request for editing an existing object */
-static void
-queue_edit_existing (OpenClient *oc, const char *uid)
-{
- Request *request;
-
- g_assert (!oc->open);
-
- request = g_new (Request, 1);
- request->type = REQUEST_EXISTING;
- request->u.existing.uid = g_strdup (uid);
-
- oc->pending = g_slist_append (oc->pending, request);
-}
-
-/* ::editExisting() method implementation */
-static void
-impl_editExisting (PortableServer_Servant servant,
- const CORBA_char *str_uri,
- const CORBA_char *uid,
- CORBA_Environment *ev)
-{
- CompEditorFactory *factory;
- CompEditorFactoryPrivate *priv;
- OpenClient *oc;
- CompEditor *editor;
-
- factory = COMP_EDITOR_FACTORY (bonobo_object_from_servant (servant));
- priv = factory->priv;
-
- oc = lookup_open_client (factory, str_uri, ev);
- if (!oc)
- return;
-
- if (!oc->open) {
- queue_edit_existing (oc, uid);
- return;
- }
-
- /* Look up the component */
- editor = e_comp_editor_registry_find (comp_editor_registry, uid);
- if (editor == NULL) {
- edit_existing (oc, uid);
- } else {
- comp_editor_focus (editor);
- }
-}
-
-/* Queues a request for creating a new object */
-static void
-queue_edit_new (OpenClient *oc, const GNOME_Evolution_Calendar_CompEditorFactory_CompEditorMode type)
-{
- Request *request;
-
- g_assert (!oc->open);
-
- request = g_new (Request, 1);
- request->type = REQUEST_NEW;
- request->u.new.type = type;
-
- oc->pending = g_slist_append (oc->pending, request);
-}
-
-/* ::editNew() method implementation */
-static void
-impl_editNew (PortableServer_Servant servant,
- const CORBA_char *str_uri,
- const GNOME_Evolution_Calendar_CompEditorFactory_CompEditorMode corba_type,
- CORBA_Environment *ev)
-{
- CompEditorFactory *factory;
- CompEditorFactoryPrivate *priv;
- OpenClient *oc;
-
- factory = COMP_EDITOR_FACTORY (bonobo_object_from_servant (servant));
- priv = factory->priv;
-
- oc = lookup_open_client (factory, str_uri, ev);
- if (!oc)
- return;
-
- if (!oc->open)
- queue_edit_new (oc, corba_type);
- else
- edit_new (oc, corba_type);
-}
-
-
-
-/**
- * comp_editor_factory_new:
- *
- * Creates a new calendar component editor factory.
- *
- * Return value: A newly-created component editor factory.
- **/
-CompEditorFactory *
-comp_editor_factory_new (void)
-{
- return g_object_new (TYPE_COMP_EDITOR_FACTORY, NULL);
-}
-
-
diff --git a/calendar/gui/comp-editor-factory.h b/calendar/gui/comp-editor-factory.h
deleted file mode 100644
index fca4573497..0000000000
--- a/calendar/gui/comp-editor-factory.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Evolution calendar - Component editor factory object
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Authors: Federico Mena-Quintero <federico@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef COMP_EDITOR_FACTORY_H
-#define COMP_EDITOR_FACTORY_H
-
-#include <bonobo/bonobo-object.h>
-#include "evolution-calendar.h"
-
-
-
-#define TYPE_COMP_EDITOR_FACTORY (comp_editor_factory_get_type ())
-#define COMP_EDITOR_FACTORY(obj) (GTK_CHECK_CAST ((obj), TYPE_COMP_EDITOR_FACTORY, \
- CompEditorFactory))
-#define COMP_EDITOR_FACTORY_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), \
- TYPE_COMP_EDITOR_FACTORY, CompEditorFactoryClass))
-#define IS_COMP_EDITOR_FACTORY(obj) (GTK_CHECK_TYPE ((obj), TYPE_COMP_EDITOR_FACTORY))
-#define IS_COMP_EDITOR_FACTORY_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), TYPE_COMP_EDITOR_FACTORY))
-
-typedef struct CompEditorFactoryPrivate CompEditorFactoryPrivate;
-
-typedef struct {
- BonoboObject object;
-
- /* Private data */
- CompEditorFactoryPrivate *priv;
-} CompEditorFactory;
-
-typedef struct {
- BonoboObjectClass parent_class;
-
- POA_GNOME_Evolution_Calendar_CompEditorFactory__epv epv;
-} CompEditorFactoryClass;
-
-GtkType comp_editor_factory_get_type (void);
-
-CompEditorFactory *comp_editor_factory_new (void);
-
-
-
-#endif
diff --git a/calendar/gui/comp-util.c b/calendar/gui/comp-util.c
deleted file mode 100644
index 170adb0cf5..0000000000
--- a/calendar/gui/comp-util.c
+++ /dev/null
@@ -1,342 +0,0 @@
-/* Evolution calendar - Utilities for manipulating ECalComponent objects
- *
- * Copyright (C) 2000 Ximian, Inc.
- * Copyright (C) 2000 Ximian, Inc.
- *
- * Author: Federico Mena-Quintero <federico@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-#include "calendar-config.h"
-#include "comp-util.h"
-#include "dialogs/delete-comp.h"
-
-
-
-/**
- * cal_comp_util_add_exdate:
- * @comp: A calendar component object.
- * @itt: Time for the exception.
- *
- * Adds an exception date to the current list of EXDATE properties in a calendar
- * component object.
- **/
-void
-cal_comp_util_add_exdate (ECalComponent *comp, time_t t, icaltimezone *zone)
-{
- GSList *list;
- ECalComponentDateTime *cdt;
-
- g_return_if_fail (comp != NULL);
- g_return_if_fail (E_IS_CAL_COMPONENT (comp));
-
- e_cal_component_get_exdate_list (comp, &list);
-
- cdt = g_new (ECalComponentDateTime, 1);
- cdt->value = g_new (struct icaltimetype, 1);
- *cdt->value = icaltime_from_timet_with_zone (t, FALSE, zone);
- cdt->tzid = g_strdup (icaltimezone_get_tzid (zone));
-
- list = g_slist_append (list, cdt);
- e_cal_component_set_exdate_list (comp, list);
- e_cal_component_free_exdate_list (list);
-}
-
-
-
-/* Returns TRUE if the TZIDs are equivalent, i.e. both NULL or the same. */
-static gboolean
-e_cal_component_compare_tzid (const char *tzid1, const char *tzid2)
-{
- gboolean retval = TRUE;
-
- if (tzid1) {
- if (!tzid2 || strcmp (tzid1, tzid2))
- retval = FALSE;
- } else {
- if (tzid2)
- retval = FALSE;
- }
-
- return retval;
-}
-
-/**
- * cal_comp_util_compare_event_timezones:
- * @comp: A calendar component object.
- * @client: A #ECal.
- *
- * Checks if the component uses the given timezone for both the start and
- * the end time, or if the UTC offsets of the start and end times are the same
- * as in the given zone.
- *
- * Returns: TRUE if the component's start and end time are at the same UTC
- * offset in the given timezone.
- **/
-gboolean
-cal_comp_util_compare_event_timezones (ECalComponent *comp,
- ECal *client,
- icaltimezone *zone)
-{
- ECalComponentDateTime start_datetime, end_datetime;
- const char *tzid;
- gboolean retval = FALSE;
- icaltimezone *start_zone, *end_zone;
- int offset1, offset2;
-
- tzid = icaltimezone_get_tzid (zone);
-
- e_cal_component_get_dtstart (comp, &start_datetime);
- e_cal_component_get_dtend (comp, &end_datetime);
-
- /* If either the DTSTART or the DTEND is a DATE value, we return TRUE.
- Maybe if one was a DATE-TIME we should check that, but that should
- not happen often. */
- if ((start_datetime.value && start_datetime.value->is_date)
- || (end_datetime.value && end_datetime.value->is_date)) {
- retval = TRUE;
- goto out;
- }
-
- /* If the event uses UTC for DTSTART & DTEND, return TRUE. Outlook
- will send single events as UTC, so we don't want to mark all of
- these. */
- if ((!start_datetime.value || start_datetime.value->is_utc)
- && (!end_datetime.value || end_datetime.value->is_utc)) {
- retval = TRUE;
- goto out;
- }
-
- /* If the event uses floating time for DTSTART & DTEND, return TRUE.
- Imported vCalendar files will use floating times, so we don't want
- to mark all of these. */
- if (!start_datetime.tzid && !end_datetime.tzid) {
- retval = TRUE;
- goto out;
- }
-
- /* FIXME: DURATION may be used instead. */
- if (e_cal_component_compare_tzid (tzid, start_datetime.tzid)
- && e_cal_component_compare_tzid (tzid, end_datetime.tzid)) {
- /* If both TZIDs are the same as the given zone's TZID, then
- we know the timezones are the same so we return TRUE. */
- retval = TRUE;
- } else {
- /* If the TZIDs differ, we have to compare the UTC offsets
- of the start and end times, using their own timezones and
- the given timezone. */
- if (!e_cal_get_timezone (client, start_datetime.tzid,
- &start_zone, NULL))
- goto out;
-
- if (start_datetime.value) {
- offset1 = icaltimezone_get_utc_offset (start_zone,
- start_datetime.value,
- NULL);
- offset2 = icaltimezone_get_utc_offset (zone,
- start_datetime.value,
- NULL);
- if (offset1 != offset2)
- goto out;
- }
-
- if (!e_cal_get_timezone (client, end_datetime.tzid,
- &end_zone, NULL))
- goto out;
-
- if (end_datetime.value) {
- offset1 = icaltimezone_get_utc_offset (end_zone,
- end_datetime.value,
- NULL);
- offset2 = icaltimezone_get_utc_offset (zone,
- end_datetime.value,
- NULL);
- if (offset1 != offset2)
- goto out;
- }
-
- retval = TRUE;
- }
-
- out:
-
- e_cal_component_free_datetime (&start_datetime);
- e_cal_component_free_datetime (&end_datetime);
-
- return retval;
-}
-
-/**
- * cal_comp_confirm_delete_empty_comp:
- * @comp: A calendar component.
- * @client: Calendar client where the component purportedly lives.
- * @widget: Widget to be used as the basis for UTF8 conversion.
- *
- * Assumming a calendar component with an empty SUMMARY property (as per
- * string_is_empty()), asks whether the user wants to delete it based on
- * whether the appointment is on the calendar server or not. If the
- * component is on the server, this function will present a confirmation
- * dialog and delete the component if the user tells it to. If the component
- * is not on the server it will just return TRUE.
- *
- * Return value: A result code indicating whether the component
- * was not on the server and is to be deleted locally, whether it
- * was on the server and the user deleted it, or whether the
- * user cancelled the deletion.
- **/
-gboolean
-cal_comp_is_on_server (ECalComponent *comp, ECal *client)
-{
- const char *uid;
- icalcomponent *icalcomp;
- GError *error = NULL;
-
- g_return_val_if_fail (comp != NULL, FALSE);
- g_return_val_if_fail (E_IS_CAL_COMPONENT (comp), FALSE);
- g_return_val_if_fail (client != NULL, FALSE);
- g_return_val_if_fail (E_IS_CAL (client), FALSE);
-
- /* See if the component is on the server. If it is not, then it likely
- * means that the appointment is new, only in the day view, and we
- * haven't added it yet to the server. In that case, we don't need to
- * confirm and we can just delete the event. Otherwise, we ask
- * the user.
- */
- e_cal_component_get_uid (comp, &uid);
-
- if (e_cal_get_object (client, uid, NULL, &icalcomp, &error)) {
- icalcomponent_free (icalcomp);
-
- return TRUE;
- }
-
- if (error->code != E_CALENDAR_STATUS_OBJECT_NOT_FOUND)
- g_warning (G_STRLOC ": %s", error->message);
-
- g_clear_error (&error);
-
- return FALSE;
-}
-
-/**
- * cal_comp_event_new_with_defaults:
- *
- * Creates a new VEVENT component and adds any default alarms to it as set in
- * the program's configuration values.
- *
- * Return value: A newly-created calendar component.
- **/
-ECalComponent *
-cal_comp_event_new_with_defaults (ECal *client)
-{
- icalcomponent *icalcomp;
- ECalComponent *comp;
- int interval;
- CalUnits units;
- ECalComponentAlarm *alarm;
- icalproperty *icalprop;
- ECalComponentAlarmTrigger trigger;
-
- if (!e_cal_get_default_object (client, &icalcomp, NULL))
- return NULL;
-
- comp = e_cal_component_new ();
- if (!e_cal_component_set_icalcomponent (comp, icalcomp)) {
- g_object_unref (comp);
- icalcomponent_free (icalcomp);
- return NULL;
- }
-
- if (!calendar_config_get_use_default_reminder ())
- return comp;
-
- interval = calendar_config_get_default_reminder_interval ();
- units = calendar_config_get_default_reminder_units ();
-
- alarm = e_cal_component_alarm_new ();
-
- /* We don't set the description of the alarm; we'll copy it from the
- * summary when it gets committed to the server. For that, we add a
- * X-EVOLUTION-NEEDS-DESCRIPTION property to the alarm's component.
- */
- icalcomp = e_cal_component_alarm_get_icalcomponent (alarm);
- icalprop = icalproperty_new_x ("1");
- icalproperty_set_x_name (icalprop, "X-EVOLUTION-NEEDS-DESCRIPTION");
- icalcomponent_add_property (icalcomp, icalprop);
-
- e_cal_component_alarm_set_action (alarm, E_CAL_COMPONENT_ALARM_DISPLAY);
-
- trigger.type = E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START;
-
- memset (&trigger.u.rel_duration, 0, sizeof (trigger.u.rel_duration));
-
- trigger.u.rel_duration.is_neg = TRUE;
-
- switch (units) {
- case CAL_MINUTES:
- trigger.u.rel_duration.minutes = interval;
- break;
-
- case CAL_HOURS:
- trigger.u.rel_duration.hours = interval;
- break;
-
- case CAL_DAYS:
- trigger.u.rel_duration.days = interval;
- break;
-
- default:
- g_assert_not_reached ();
- }
-
- e_cal_component_alarm_set_trigger (alarm, trigger);
-
- e_cal_component_add_alarm (comp, alarm);
- e_cal_component_alarm_free (alarm);
-
- return comp;
-}
-
-ECalComponent *
-cal_comp_task_new_with_defaults (ECal *client)
-{
- ECalComponent *comp;
- icalcomponent *icalcomp;
-
- if (!e_cal_get_default_object (client, &icalcomp, NULL))
- return NULL;
-
- comp = e_cal_component_new ();
- if (!e_cal_component_set_icalcomponent (comp, icalcomp)) {
- g_object_unref (comp);
- icalcomponent_free (icalcomp);
-
- return NULL;
- }
-
- comp = e_cal_component_new ();
- if (!e_cal_component_set_icalcomponent (comp, icalcomp)) {
- g_object_unref (comp);
- icalcomponent_free (icalcomp);
- return NULL;
- }
-
- return comp;
-}
diff --git a/calendar/gui/comp-util.h b/calendar/gui/comp-util.h
deleted file mode 100644
index 0f4542aba1..0000000000
--- a/calendar/gui/comp-util.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Evolution calendar - Utilities for manipulating ECalComponent objects
- *
- * Copyright (C) 2000 Ximian, Inc.
- * Copyright (C) 2000 Ximian, Inc.
- *
- * Author: Federico Mena-Quintero <federico@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef COMP_UTIL_H
-#define COMP_UTIL_H
-
-#include <gtk/gtkwidget.h>
-#include <libecal/e-cal-component.h>
-#include <libecal/e-cal.h>
-
-void cal_comp_util_add_exdate (ECalComponent *comp, time_t t, icaltimezone *zone);
-
-
-/* Returns TRUE if the component uses the given timezone for both DTSTART
- and DTEND, or if the UTC offsets of the start and end times are the same
- as in the given zone. */
-gboolean cal_comp_util_compare_event_timezones (ECalComponent *comp,
- ECal *client,
- icaltimezone *zone);
-
-gboolean cal_comp_is_on_server (ECalComponent *comp,
- ECal *client);
-
-ECalComponent *cal_comp_event_new_with_defaults (ECal *client);
-ECalComponent *cal_comp_task_new_with_defaults (ECal *client);
-
-#endif
diff --git a/calendar/gui/control-factory.c b/calendar/gui/control-factory.c
deleted file mode 100644
index 58436ec841..0000000000
--- a/calendar/gui/control-factory.c
+++ /dev/null
@@ -1,217 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* control-factory.c
- *
- * Copyright (C) 2000, 2001, 2002, 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Ettore Perazzoli <ettore@ximian.com>
- */
-
-#include <config.h>
-#include <string.h>
-#include <gtk/gtksignal.h>
-#include <glade/glade.h>
-#include <bonobo/bonobo-control.h>
-#include <bonobo/bonobo-generic-factory.h>
-#include <bonobo/bonobo-persist-file.h>
-#include <bonobo/bonobo-context.h>
-#include <bonobo/bonobo-property-bag.h>
-#include <glade/glade.h>
-#include <libgnomeui/gnome-dialog-util.h>
-
-#include <libecal/e-cal-time-util.h>
-#include <gui/gnome-cal.h>
-#include <gui/calendar-commands.h>
-#include <gui/calendar-config.h>
-
-#include "control-factory.h"
-
-#define PROPERTY_CALENDAR_URI "folder_uri"
-#define PROPERTY_CALENDAR_URI_IDX 1
-
-#define PROPERTY_CALENDAR_VIEW "view"
-#define PROPERTY_CALENDAR_VIEW_IDX 2
-
-
-CORBA_Environment ev;
-CORBA_ORB orb;
-
-static void
-control_activate_cb (BonoboControl *control, gboolean activate, gpointer data)
-{
- GnomeCalendar *gcal;
-
- gcal = GNOME_CALENDAR (data);
-
- if (activate)
- calendar_control_activate (control, gcal);
- else
- calendar_control_deactivate (control, gcal);
-}
-
-static void
-get_prop (BonoboPropertyBag *bag,
- BonoboArg *arg,
- guint arg_id,
- CORBA_Environment *ev,
- gpointer user_data)
-{
- GnomeCalendar *gcal;
- const char *uri;
- BonoboControl *control = user_data;
-
- gcal = (GnomeCalendar *) bonobo_control_get_widget (control);
-
- switch (arg_id) {
-
- case PROPERTY_CALENDAR_URI_IDX:
- uri = e_cal_get_uri (e_cal_model_get_default_client (gnome_calendar_get_calendar_model (gcal)));
- BONOBO_ARG_SET_STRING (arg, uri);
- break;
-
- case PROPERTY_CALENDAR_VIEW_IDX:
- switch (gnome_calendar_get_view (gcal)) {
- case GNOME_CAL_DAY_VIEW:
- BONOBO_ARG_SET_STRING (arg, "day");
- break;
- case GNOME_CAL_WEEK_VIEW:
- BONOBO_ARG_SET_STRING (arg, "week");
- break;
- case GNOME_CAL_WORK_WEEK_VIEW:
- BONOBO_ARG_SET_STRING (arg, "workweek");
- break;
- case GNOME_CAL_MONTH_VIEW:
- BONOBO_ARG_SET_STRING (arg, "month");
- break;
- case GNOME_CAL_LIST_VIEW:
- BONOBO_ARG_SET_STRING (arg, "list");
- break;
- default:
- }
- break;
-
- default:
- g_warning ("Unhandled arg %d\n", arg_id);
- }
-}
-
-static void
-set_prop (BonoboPropertyBag *bag,
- const BonoboArg *arg,
- guint arg_id,
- CORBA_Environment *ev,
- gpointer user_data)
-{
- GnomeCalendar *gcal;
- char *string;
- GnomeCalendarViewType view;
- BonoboControl *control = user_data;
-
- gcal = (GnomeCalendar *) bonobo_control_get_widget (control);
-
- switch (arg_id) {
- case PROPERTY_CALENDAR_URI_IDX:
- string = BONOBO_ARG_GET_STRING (arg);
- if (gnome_calendar_add_event_uri (gcal, string)) {
- calendar_control_sensitize_calendar_commands (control, gcal, TRUE);
- } else {
- char *msg;
-
- msg = g_strdup_printf (_("Could not open the folder in '%s'"), string);
- gnome_error_dialog_parented (
- msg,
- GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gcal))));
- g_free (msg);
- }
- break;
-
- case PROPERTY_CALENDAR_VIEW_IDX:
- string = BONOBO_ARG_GET_STRING (arg);
- if (!strcmp (string, "week"))
- view = GNOME_CAL_WEEK_VIEW;
- else if (!strcmp (string, "workweek"))
- view = GNOME_CAL_WORK_WEEK_VIEW;
- else if (!strcmp (string, "month"))
- view = GNOME_CAL_MONTH_VIEW;
- else if (!strcmp (string, "day"))
- view = GNOME_CAL_DAY_VIEW;
- else
- view = calendar_config_get_default_view ();
-
- /* This doesn't actually work, because the GalView
- * comes along and resets the view. FIXME.
- */
- gnome_calendar_set_view (gcal, view, FALSE, TRUE);
- break;
-
- default:
- g_warning ("Unhandled arg %d\n", arg_id);
- break;
- }
-}
-
-
-static void
-calendar_properties_init (GnomeCalendar *gcal, BonoboControl *control)
-{
- BonoboPropertyBag *pbag;
-
- pbag = bonobo_property_bag_new (get_prop, set_prop, control);
-
- bonobo_property_bag_add (pbag,
- PROPERTY_CALENDAR_URI,
- PROPERTY_CALENDAR_URI_IDX,
- BONOBO_ARG_STRING,
- NULL,
- _("The URI that the calendar will display"),
- 0);
- bonobo_property_bag_add (pbag,
- PROPERTY_CALENDAR_VIEW,
- PROPERTY_CALENDAR_VIEW_IDX,
- BONOBO_ARG_STRING,
- NULL,
- _("The type of view to show"),
- 0);
-
- bonobo_control_set_properties (control, bonobo_object_corba_objref (BONOBO_OBJECT (pbag)), NULL);
- bonobo_object_unref (BONOBO_OBJECT (pbag));
-}
-
-BonoboControl *
-control_factory_new_control (void)
-{
- BonoboControl *control;
- GnomeCalendar *gcal;
-
- gcal = GNOME_CALENDAR (gnome_calendar_new ());
- if (!gcal)
- return NULL;
-
- gtk_widget_show (GTK_WIDGET (gcal));
-
- control = bonobo_control_new (GTK_WIDGET (gcal));
- if (!control) {
- g_message ("control_factory_fn(): could not create the control!");
- return NULL;
- }
- g_object_set_data (G_OBJECT (gcal), "control", control);
-
- calendar_properties_init (gcal, control);
-
- g_signal_connect (control, "activate", G_CALLBACK (control_activate_cb), gcal);
-
- return control;
-}
diff --git a/calendar/gui/control-factory.h b/calendar/gui/control-factory.h
deleted file mode 100644
index bab1611c03..0000000000
--- a/calendar/gui/control-factory.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* control-factory.c
- *
- * Copyright (C) 2000, 2001, 2002, 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Ettore Perazzoli <ettore@ximian.com>
- */
-
-#ifndef _CONTROL_FACTORY_H_
-#define _CONTROL_FACTORY_H_
-
-#include <bonobo/bonobo-control.h>
-
-BonoboControl *control_factory_new_control (void);
-
-#endif /* _CONTROL_FACTORY_H_ */
diff --git a/calendar/gui/dialogs/.cvsignore b/calendar/gui/dialogs/.cvsignore
deleted file mode 100644
index 182657d5ac..0000000000
--- a/calendar/gui/dialogs/.cvsignore
+++ /dev/null
@@ -1,8 +0,0 @@
-.deps
-.pure
-Makefile
-Makefile.in
-Evolution-Addressbook-SelectNames-common.c
-Evolution-Addressbook-SelectNames-skels.c
-Evolution-Addressbook-SelectNames-stubs.c
-Evolution-Addressbook-SelectNames.h
diff --git a/calendar/gui/dialogs/Makefile.am b/calendar/gui/dialogs/Makefile.am
deleted file mode 100644
index 7e3b76fd97..0000000000
--- a/calendar/gui/dialogs/Makefile.am
+++ /dev/null
@@ -1,106 +0,0 @@
-IDLS = $(top_srcdir)/addressbook/gui/component/select-names/Evolution-Addressbook-SelectNames.idl
-
-IDL_GENERATED_H = \
- Evolution-Addressbook-SelectNames.h
-IDL_GENERATED = $(IDL_GENERATED_H)
-
-$(IDL_GENERATED_H): $(IDLS)
- $(ORBIT_IDL) -I $(srcdir) $(IDL_INCLUDES) \
- --nostubs --noskels --nocommon \
- $(top_srcdir)/addressbook/gui/component/select-names/Evolution-Addressbook-SelectNames.idl
-
-BUILT_SOURCES = $(IDL_GENERATED)
-
-INCLUDES = \
- -DG_LOG_DOMAIN=\"calendar-gui\" \
- -I$(top_srcdir) \
- -I$(top_builddir) \
- -I$(top_srcdir)/calendar \
- -I$(top_srcdir)/calendar/cal-client \
- -I$(top_builddir)/calendar/cal-client \
- -I$(top_builddir)/shell \
- -I$(top_srcdir)/shell \
- -DEVOLUTION_DATADIR=\""$(datadir)"\" \
- -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \
- -DEVOLUTION_IMAGESDIR=\""$(imagesdir)"\" \
- -DEVOLUTION_UIDIR=\""$(evolutionuidir)"\" \
- -DPREFIX=\""$(prefix)"\" \
- $(EVOLUTION_CALENDAR_CFLAGS)
-
-noinst_LTLIBRARIES = libcal-dialogs.la
-
-libcal_dialogs_la_SOURCES = \
- $(IDL_GENERATED) \
- alarm-options.c \
- alarm-options.h \
- alarm-page.c \
- alarm-page.h \
- cal-prefs-dialog.c \
- cal-prefs-dialog.h \
- cancel-comp.c \
- cancel-comp.h \
- changed-comp.c \
- changed-comp.h \
- comp-editor.c \
- comp-editor.h \
- comp-editor-page.c \
- comp-editor-page.h \
- comp-editor-util.c \
- comp-editor-util.h \
- copy-source-dialog.c \
- copy-source-dialog.h \
- delete-comp.c \
- delete-comp.h \
- delete-error.c \
- delete-error.h \
- e-delegate-dialog.c \
- e-delegate-dialog.h \
- event-editor.c \
- event-editor.h \
- event-page.c \
- event-page.h \
- meeting-page.c \
- meeting-page.h \
- new-calendar.c \
- new-calendar.h \
- new-task-list.c \
- new-task-list.h \
- recurrence-page.c \
- recurrence-page.h \
- recur-comp.c \
- recur-comp.h \
- save-comp.c \
- save-comp.h \
- schedule-page.c \
- schedule-page.h \
- send-comp.c \
- send-comp.h \
- task-editor.c \
- task-editor.h \
- task-details-page.c \
- task-details-page.h \
- task-page.c \
- task-page.h
-
-glade_DATA = \
- alarm-options.glade \
- alarm-page.glade \
- cal-prefs-dialog.glade \
- e-delegate-dialog.glade \
- event-page.glade \
- meeting-page.glade \
- new-calendar.glade \
- new-task-list.glade \
- recurrence-page.glade \
- schedule-page.glade \
- task-details-page.glade \
- task-page.glade
-
-
-CLEANFILES = $(BUILT_SOURCES)
-
-dist-hook:
- cd $(distdir); rm -f $(BUILT_SOURCES)
-
-EXTRA_DIST = \
- $(glade_DATA)
diff --git a/calendar/gui/dialogs/alarm-options.c b/calendar/gui/dialogs/alarm-options.c
deleted file mode 100644
index 512020d4d6..0000000000
--- a/calendar/gui/dialogs/alarm-options.c
+++ /dev/null
@@ -1,811 +0,0 @@
-/* Evolution calendar - Alarm options dialog
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Authors: Federico Mena-Quintero <federico@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-#include <glib.h>
-#include <libgnome/gnome-i18n.h>
-#include <gtk/gtkmain.h>
-#include <gtk/gtkcheckbutton.h>
-#include <gtk/gtkdialog.h>
-#include <gtk/gtkentry.h>
-#include <gtk/gtksignal.h>
-#include <gtk/gtkwindow.h>
-#include <gtk/gtkhbox.h>
-#include <gtk/gtktextbuffer.h>
-#include <gtk/gtktextview.h>
-#include <bonobo/bonobo-control.h>
-#include <bonobo/bonobo-exception.h>
-#include <bonobo/bonobo-widget.h>
-#include <libgnomeui/gnome-file-entry.h>
-#include <glade/glade.h>
-#include <addressbook/util/eab-destination.h>
-#include "Evolution-Addressbook-SelectNames.h"
-#include "e-util/e-dialog-widgets.h"
-#include "alarm-options.h"
-
-
-
-typedef struct {
- /* Glade XML data */
- GladeXML *xml;
-
- /* The alarm action selected */
- ECalComponentAlarmAction action;
-
- /* Toplevel */
- GtkWidget *toplevel;
-
- /* Alarm repeat widgets */
- gboolean repeat;
- GtkWidget *repeat_toggle;
- GtkWidget *repeat_group;
- GtkWidget *repeat_quantity;
- GtkWidget *repeat_value;
- GtkWidget *repeat_unit;
-
- /* Display alarm widgets */
- GtkWidget *dalarm_group;
- GtkWidget *dalarm_description;
-
- /* Audio alarm widgets */
- GtkWidget *aalarm_group;
- GtkWidget *aalarm_attach;
-
- /* Mail alarm widgets */
- const char *email;
- GtkWidget *malarm_group;
- GtkWidget *malarm_address_group;
- GtkWidget *malarm_addresses;
- GtkWidget *malarm_addressbook;
- GtkWidget *malarm_description;
- GNOME_Evolution_Addressbook_SelectNames corba_select_names;
-
- /* Procedure alarm widgets */
- GtkWidget *palarm_group;
- GtkWidget *palarm_program;
- GtkWidget *palarm_args;
-} Dialog;
-
-#define SELECT_NAMES_OAFID "OAFIID:GNOME_Evolution_Addressbook_SelectNames:" BASE_VERSION
-static const char *section_name = "Send To";
-
-
-
-/* Gets the widgets from the XML file and returns if they are all available. */
-static gboolean
-get_widgets (Dialog *dialog)
-{
-#define GW(name) glade_xml_get_widget (dialog->xml, name)
-
- dialog->toplevel = GW ("alarm-options-toplevel");
-
- dialog->repeat_toggle = GW ("repeat-toggle");
- dialog->repeat_group = GW ("repeat-group");
- dialog->repeat_quantity = GW ("repeat-quantity");
- dialog->repeat_value = GW ("repeat-value");
- dialog->repeat_unit = GW ("repeat-unit");
-
- dialog->dalarm_group = GW ("dalarm-group");
- dialog->dalarm_description = GW ("dalarm-description");
-
- dialog->aalarm_group = GW ("aalarm-group");
- dialog->aalarm_attach = GW ("aalarm-attach");
-
- dialog->malarm_group = GW ("malarm-group");
- dialog->malarm_address_group = GW ("malarm-address-group");
- dialog->malarm_addressbook = GW ("malarm-addressbook");
- dialog->malarm_description = GW ("malarm-description");
-
- dialog->palarm_group = GW ("palarm-group");
- dialog->palarm_program = GW ("palarm-program");
- dialog->palarm_args = GW ("palarm-args");
-
- return (dialog->toplevel
- && dialog->repeat_toggle
- && dialog->repeat_group
- && dialog->repeat_quantity
- && dialog->repeat_value
- && dialog->repeat_unit
- && dialog->dalarm_group
- && dialog->dalarm_description
- && dialog->aalarm_group
- && dialog->aalarm_attach
- && dialog->malarm_group
- && dialog->malarm_address_group
- && dialog->malarm_addressbook
- && dialog->malarm_description
- && dialog->palarm_group
- && dialog->palarm_program
- && dialog->palarm_args);
-}
-
-static void
-addressbook_clicked_cb (GtkWidget *widget, gpointer data)
-{
- Dialog *dialog = data;
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
-
- GNOME_Evolution_Addressbook_SelectNames_activateDialog (dialog->corba_select_names,
- section_name, &ev);
-
- CORBA_exception_free (&ev);
-}
-
-static gboolean
-setup_select_names (Dialog *dialog)
-{
- Bonobo_Control corba_control;
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
-
- dialog->corba_select_names = bonobo_activation_activate_from_id (SELECT_NAMES_OAFID, 0, NULL, &ev);
- if (BONOBO_EX (&ev))
- return FALSE;
-
- GNOME_Evolution_Addressbook_SelectNames_addSection (dialog->corba_select_names,
- section_name, section_name, &ev);
- if (BONOBO_EX (&ev))
- return FALSE;
-
- corba_control = GNOME_Evolution_Addressbook_SelectNames_getEntryBySection (dialog->corba_select_names,
- section_name, &ev);
-
- if (BONOBO_EX (&ev))
- return FALSE;
-
- CORBA_exception_free (&ev);
-
- dialog->malarm_addresses = bonobo_widget_new_control_from_objref (corba_control, CORBA_OBJECT_NIL);
- gtk_widget_show (dialog->malarm_addresses);
- gtk_box_pack_end_defaults (GTK_BOX (dialog->malarm_address_group), dialog->malarm_addresses);
-
- gtk_signal_connect (GTK_OBJECT (dialog->malarm_addressbook), "clicked",
- GTK_SIGNAL_FUNC (addressbook_clicked_cb), dialog);
-
- return TRUE;
-}
-
-static void
-palarm_options_changed_cb (GtkEditable *entry, gpointer user_data)
-{
- const gchar *text;
- Dialog *dialog = user_data;
-
- text = gtk_entry_get_text (GTK_ENTRY (dialog->palarm_program));
- if (text && *text)
- gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog->toplevel), GTK_RESPONSE_OK, TRUE);
- else
- gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog->toplevel), GTK_RESPONSE_OK, FALSE);
-}
-
-/* Callback used when the repeat toggle button is toggled. We sensitize the
- * repeat group options as appropriate.
- */
-static void
-repeat_toggle_toggled_cb (GtkToggleButton *toggle, gpointer data)
-{
- Dialog *dialog;
- gboolean active;
-
- dialog = data;
-
- active = gtk_toggle_button_get_active (toggle);
-
- gtk_widget_set_sensitive (dialog->repeat_group, active);
-
- /* activate the 'OK' button */
- if (dialog->action == E_CAL_COMPONENT_ALARM_PROCEDURE)
- palarm_options_changed_cb (GTK_EDITABLE (dialog->palarm_program), dialog);
-}
-
-static void
-repeat_spin_button_changed_cb (GtkWidget *spin, gpointer user_data)
-{
- Dialog *dialog = user_data;
-
- if (dialog->action == E_CAL_COMPONENT_ALARM_PROCEDURE)
- palarm_options_changed_cb (GTK_EDITABLE (dialog->palarm_program), dialog);
-}
-
-
-static void
-repeat_unit_changed_cb (GtkWidget *option_menu, gpointer user_data)
-{
- Dialog *dialog = user_data;
-
- if (dialog->action == E_CAL_COMPONENT_ALARM_PROCEDURE)
- palarm_options_changed_cb (GTK_EDITABLE (dialog->palarm_program), dialog);
-}
-
-/* Hooks the widget signals */
-static void
-init_widgets (Dialog *dialog)
-{
- /* Alarm repeat */
-
- g_signal_connect (G_OBJECT (dialog->repeat_toggle), "toggled",
- G_CALLBACK (repeat_toggle_toggled_cb), dialog);
-
- g_signal_connect (G_OBJECT (dialog->repeat_quantity), "value_changed",
- G_CALLBACK (repeat_spin_button_changed_cb), dialog);
- g_signal_connect (G_OBJECT (dialog->repeat_value), "value_changed",
- G_CALLBACK (repeat_spin_button_changed_cb), dialog);
-
- g_signal_connect (G_OBJECT (dialog->repeat_unit), "changed",
- G_CALLBACK (repeat_unit_changed_cb), dialog);
-}
-
-/* Fills the audio alarm widgets with the values from the alarm component */
-static void
-alarm_to_aalarm_widgets (Dialog *dialog, ECalComponentAlarm *alarm)
-{
- icalattach *attach;
- const char *url;
-
- e_cal_component_alarm_get_attach (alarm, &attach);
-
- if (!attach) {
- e_dialog_editable_set (dialog->aalarm_attach, NULL);
- return;
- }
-
- /* FIXME: this does not support inline data */
-
- url = NULL;
-
- if (icalattach_get_is_url (attach))
- url = icalattach_get_url (attach);
- else
- g_message ("alarm_to_aalarm_widgets(): FIXME: we don't support inline data yet");
-
- e_dialog_editable_set (dialog->aalarm_attach, url);
-
- icalattach_unref (attach);
-}
-
-/* Fills the display alarm widgets with the values from the alarm component */
-static void
-alarm_to_dalarm_widgets (Dialog *dialog, ECalComponentAlarm *alarm)
-{
- ECalComponentText description;
- GtkTextBuffer *text_buffer;
-
- e_cal_component_alarm_get_description (alarm, &description);
-
- text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (dialog->dalarm_description));
- gtk_text_buffer_set_text (text_buffer, description.value ? description.value : "", -1);
-}
-
-/* Fills the mail alarm widgets with the values from the alarm component */
-static void
-alarm_to_malarm_widgets (Dialog *dialog, ECalComponentAlarm *alarm)
-{
- ECalComponentText description;
- GtkTextBuffer *text_buffer;
- GSList *attendee_list, *l;
- EABDestination **destv;
- int len, i;
-
- /* Recipients */
- e_cal_component_alarm_get_attendee_list (alarm, &attendee_list);
- len = g_slist_length (attendee_list);
-
- if (len <= 0) {
- destv = g_new0 (EABDestination *, 2);
- destv[0] = eab_destination_new ();
- eab_destination_set_email (destv[0], dialog->email);
- destv[1] = NULL;
- len = 1;
- } else {
- destv = g_new0 (EABDestination *, len + 1);
- for (l = attendee_list, i = 0; l != NULL; l = l->next, i++) {
- ECalComponentAttendee *a = l->data;
- EABDestination *dest;
-
- dest = eab_destination_new ();
- if (a->cn != NULL && *a->cn)
- eab_destination_set_name (dest, a->cn);
- if (a->value != NULL && *a->value)
- eab_destination_set_email (dest, a->value);
-
- destv[i] = dest;
- }
- destv[i] = NULL;
- }
-
- bonobo_widget_set_property (BONOBO_WIDGET (dialog->malarm_addresses),
- "destinations", eab_destination_exportv (destv), NULL);
-
- for (i = 0; i < len; i++)
- g_object_unref (GTK_OBJECT (destv[i]));
- g_free (destv);
-
- e_cal_component_free_attendee_list (attendee_list);
-
- /* Description */
- e_cal_component_alarm_get_description (alarm, &description);
-
- text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (dialog->malarm_description));
- gtk_text_buffer_set_text (text_buffer, description.value ? description.value : "", -1);
-}
-
-/* Fills the procedure alarm widgets with the values from the alarm component */
-static void
-alarm_to_palarm_widgets (Dialog *dialog, ECalComponentAlarm *alarm)
-{
- icalattach *attach;
- ECalComponentText description;
-
- e_cal_component_alarm_get_attach (alarm, &attach);
- e_cal_component_alarm_get_description (alarm, &description);
-
- if (attach) {
- const char *url;
-
- if (icalattach_get_is_url (attach)) {
- url = icalattach_get_url (attach);
- e_dialog_editable_set (dialog->palarm_program, url);
- } else
- g_message ("alarm_to_palarm_widgets(): Don't know what to do with non-URL "
- "attachments");
-
- icalattach_unref (attach);
- }
-
- e_dialog_editable_set (dialog->palarm_args, description.value);
-}
-
-enum duration_units {
- DUR_MINUTES,
- DUR_HOURS,
- DUR_DAYS
-};
-
-static const int duration_units_map[] = {
- DUR_MINUTES,
- DUR_HOURS,
- DUR_DAYS,
- -1
-};
-
-/* Sigh. Takes an overcomplicated duration value and reduces it to its lowest
- * common denominator.
- */
-static void
-normalize_duration (struct icaldurationtype dur, int *value, enum duration_units *units)
-{
- if (dur.seconds != 0 || dur.minutes != 0) {
- *value = ((((dur.weeks * 7 + dur.days) * 24 + dur.hours) * 60) + dur.minutes
- + dur.seconds / 60 + ((dur.seconds % 60) >= 30 ? 1 : 0));
- *units = DUR_MINUTES;
- } else if (dur.hours) {
- *value = ((dur.weeks * 7) + dur.days) * 24 + dur.hours;
- *units = DUR_HOURS;
- } else if (dur.days != 0 || dur.weeks != 0) {
- *value = dur.weeks * 7 + dur.days;
- *units = DUR_DAYS;
- } else {
- *value = 0;
- *units = DUR_MINUTES;
- }
-}
-
-/* Fills the repeat widgets with the values from the alarm component */
-static void
-alarm_to_repeat_widgets (Dialog *dialog, ECalComponentAlarm *alarm)
-{
- ECalComponentAlarmRepeat repeat;
- int value;
- enum duration_units units;
-
- e_cal_component_alarm_get_repeat (alarm, &repeat);
-
- /* Sensitivity */
-
- if (!dialog->repeat || repeat.repetitions == 0) {
- gtk_widget_set_sensitive (dialog->repeat_toggle, dialog->repeat);
- gtk_widget_set_sensitive (dialog->repeat_group, FALSE);
- e_dialog_toggle_set (dialog->repeat_toggle, FALSE);
- return;
- }
-
- gtk_widget_set_sensitive (dialog->repeat_group, TRUE);
- e_dialog_toggle_set (dialog->repeat_toggle, TRUE);
-
- /* Repetitions */
- e_dialog_spin_set (dialog->repeat_quantity, repeat.repetitions);
-
- /* Duration */
-
- normalize_duration (repeat.duration, &value, &units);
-
- e_dialog_spin_set (dialog->repeat_value, value);
- e_dialog_option_menu_set (dialog->repeat_unit, units, duration_units_map);
-}
-
-/* Fills the widgets with the values from the alarm component */
-static void
-alarm_to_dialog (Dialog *dialog, ECalComponentAlarm *alarm)
-{
- ECalComponentAlarmAction action;
-
- alarm_to_repeat_widgets (dialog, alarm);
-
- e_cal_component_alarm_get_action (alarm, &action);
-
- switch (action) {
- case E_CAL_COMPONENT_ALARM_NONE:
- g_assert_not_reached ();
- return;
-
- case E_CAL_COMPONENT_ALARM_AUDIO:
- gtk_window_set_title (GTK_WINDOW (dialog->toplevel), _("Audio Alarm Options"));
- gtk_widget_show (dialog->aalarm_group);
- gtk_widget_hide (dialog->dalarm_group);
- gtk_widget_hide (dialog->malarm_group);
- gtk_widget_hide (dialog->palarm_group);
- alarm_to_aalarm_widgets (dialog, alarm);
- break;
-
- case E_CAL_COMPONENT_ALARM_DISPLAY:
- gtk_window_set_title (GTK_WINDOW (dialog->toplevel), _("Message Alarm Options"));
- gtk_widget_hide (dialog->aalarm_group);
- gtk_widget_show (dialog->dalarm_group);
- gtk_widget_hide (dialog->malarm_group);
- gtk_widget_hide (dialog->palarm_group);
- alarm_to_dalarm_widgets (dialog, alarm);
- break;
-
- case E_CAL_COMPONENT_ALARM_EMAIL:
- gtk_window_set_title (GTK_WINDOW (dialog->toplevel), _("Email Alarm Options"));
- gtk_widget_hide (dialog->aalarm_group);
- gtk_widget_hide (dialog->dalarm_group);
- gtk_widget_show (dialog->malarm_group);
- gtk_widget_hide (dialog->palarm_group);
- alarm_to_malarm_widgets (dialog, alarm);
- break;
-
- case E_CAL_COMPONENT_ALARM_PROCEDURE:
- gtk_window_set_title (GTK_WINDOW (dialog->toplevel), _("Program Alarm Options"));
- gtk_widget_hide (dialog->aalarm_group);
- gtk_widget_hide (dialog->dalarm_group);
- gtk_widget_hide (dialog->malarm_group);
- gtk_widget_show (dialog->palarm_group);
- alarm_to_palarm_widgets (dialog, alarm);
-
- /* make sure the 'OK' button is disabled while the program entry is empty */
- gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog->toplevel), GTK_RESPONSE_OK, FALSE);
- g_signal_connect (G_OBJECT (dialog->palarm_program), "changed",
- G_CALLBACK (palarm_options_changed_cb), dialog);
- g_signal_connect (G_OBJECT (dialog->palarm_args), "changed",
- G_CALLBACK (palarm_options_changed_cb), dialog);
- break;
-
- case E_CAL_COMPONENT_ALARM_UNKNOWN:
- gtk_window_set_title (GTK_WINDOW (dialog->toplevel), _("Unknown Alarm Options"));
- break;
-
- default:
- g_assert_not_reached ();
- return;
- }
-
- dialog->action = action;
-}
-
-
-
-/* Fills the alarm data with the values from the repeat/duration widgets */
-static void
-repeat_widgets_to_alarm (Dialog *dialog, ECalComponentAlarm *alarm)
-{
- ECalComponentAlarmRepeat repeat;
-
- if (!e_dialog_toggle_get (dialog->repeat_toggle)) {
- repeat.repetitions = 0;
-
- e_cal_component_alarm_set_repeat (alarm, repeat);
- return;
- }
-
- repeat.repetitions = e_dialog_spin_get_int (dialog->repeat_quantity);
-
- memset (&repeat.duration, 0, sizeof (repeat.duration));
- switch (e_dialog_option_menu_get (dialog->repeat_unit, duration_units_map)) {
- case DUR_MINUTES:
- repeat.duration.minutes = e_dialog_spin_get_int (dialog->repeat_value);
- break;
-
- case DUR_HOURS:
- repeat.duration.hours = e_dialog_spin_get_int (dialog->repeat_value);
- break;
-
- case DUR_DAYS:
- repeat.duration.days = e_dialog_spin_get_int (dialog->repeat_value);
- break;
-
- default:
- g_assert_not_reached ();
- }
-
- e_cal_component_alarm_set_repeat (alarm, repeat);
-
-}
-
-/* Fills the audio alarm data with the values from the widgets */
-static void
-aalarm_widgets_to_alarm (Dialog *dialog, ECalComponentAlarm *alarm)
-{
- char *url;
- icalattach *attach;
-
- url = e_dialog_editable_get (dialog->aalarm_attach);
- attach = icalattach_new_from_url (url ? url : "");
- g_free (url);
-
- e_cal_component_alarm_set_attach (alarm, attach);
- icalattach_unref (attach);
-}
-
-/* Fills the display alarm data with the values from the widgets */
-static void
-dalarm_widgets_to_alarm (Dialog *dialog, ECalComponentAlarm *alarm)
-{
- char *str;
- ECalComponentText description;
- GtkTextBuffer *text_buffer;
- GtkTextIter text_iter_start, text_iter_end;
- icalcomponent *icalcomp;
- icalproperty *icalprop;
-
- text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (dialog->dalarm_description));
- gtk_text_buffer_get_start_iter (text_buffer, &text_iter_start);
- gtk_text_buffer_get_end_iter (text_buffer, &text_iter_end);
- str = gtk_text_buffer_get_text (text_buffer, &text_iter_start, &text_iter_end, FALSE);
-
- description.value = str;
- description.altrep = NULL;
-
- e_cal_component_alarm_set_description (alarm, &description);
- g_free (str);
-
- /* remove the X-EVOLUTION-NEEDS-DESCRIPTION property, so that
- * we don't re-set the alarm's description */
- icalcomp = e_cal_component_alarm_get_icalcomponent (alarm);
- icalprop = icalcomponent_get_first_property (icalcomp, ICAL_X_PROPERTY);
- while (icalprop) {
- const char *x_name;
-
- x_name = icalproperty_get_x_name (icalprop);
- if (!strcmp (x_name, "X-EVOLUTION-NEEDS-DESCRIPTION")) {
- icalcomponent_remove_property (icalcomp, icalprop);
- break;
- }
-
- icalprop = icalcomponent_get_next_property (icalcomp, ICAL_X_PROPERTY);
- }
-}
-
-/* Fills the mail alarm data with the values from the widgets */
-static void
-malarm_widgets_to_alarm (Dialog *dialog, ECalComponentAlarm *alarm)
-{
- char *str;
- ECalComponentText description;
- GSList *attendee_list = NULL;
- EABDestination **destv;
- GtkTextBuffer *text_buffer;
- GtkTextIter text_iter_start, text_iter_end;
- icalcomponent *icalcomp;
- icalproperty *icalprop;
- int i;
-
- /* Attendees */
- bonobo_widget_get_property (BONOBO_WIDGET (dialog->malarm_addresses), "destinations",
- TC_CORBA_string, &str, NULL);
- destv = eab_destination_importv (str);
- g_free (str);
-
- for (i = 0; destv[i] != NULL; i++) {
- EABDestination *dest;
- ECalComponentAttendee *a;
-
- dest = destv[i];
-
- a = g_new0 (ECalComponentAttendee, 1);
- a->value = eab_destination_get_email (dest);
- a->cn = eab_destination_get_name (dest);
-
- attendee_list = g_slist_append (attendee_list, a);
- }
-
- e_cal_component_alarm_set_attendee_list (alarm, attendee_list);
-
- e_cal_component_free_attendee_list (attendee_list);
- eab_destination_freev (destv);
-
- /* Description */
- text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (dialog->dalarm_description));
- gtk_text_buffer_get_start_iter (text_buffer, &text_iter_start);
- gtk_text_buffer_get_end_iter (text_buffer, &text_iter_end);
- str = gtk_text_buffer_get_text (text_buffer, &text_iter_start, &text_iter_end, FALSE);
-
- description.value = str;
- description.altrep = NULL;
-
- e_cal_component_alarm_set_description (alarm, &description);
- g_free (str);
-
- /* remove the X-EVOLUTION-NEEDS-DESCRIPTION property, so that
- * we don't re-set the alarm's description */
- icalcomp = e_cal_component_alarm_get_icalcomponent (alarm);
- icalprop = icalcomponent_get_first_property(icalcomp, ICAL_X_PROPERTY);
- while (icalprop) {
- const char *x_name;
-
- x_name = icalproperty_get_x_name (icalprop);
- if (!strcmp (x_name, "X-EVOLUTION-NEEDS-DESCRIPTION")) {
- icalcomponent_remove_property (icalcomp, icalprop);
- break;
- }
-
- icalprop = icalcomponent_get_next_property (icalcomp, ICAL_X_PROPERTY);
- }
-}
-
-/* Fills the procedure alarm data with the values from the widgets */
-static void
-palarm_widgets_to_alarm (Dialog *dialog, ECalComponentAlarm *alarm)
-{
- char *program;
- icalattach *attach;
- char *str;
- ECalComponentText description;
- icalcomponent *icalcomp;
- icalproperty *icalprop;
-
- program = e_dialog_editable_get (dialog->palarm_program);
- attach = icalattach_new_from_url (program ? program : "");
- g_free (program);
-
- e_cal_component_alarm_set_attach (alarm, attach);
- icalattach_unref (attach);
-
- str = e_dialog_editable_get (dialog->palarm_args);
- description.value = str;
- description.altrep = NULL;
-
- e_cal_component_alarm_set_description (alarm, &description);
- g_free (str);
-
- /* remove the X-EVOLUTION-NEEDS-DESCRIPTION property, so that
- * we don't re-set the alarm's description */
- icalcomp = e_cal_component_alarm_get_icalcomponent (alarm);
- icalprop = icalcomponent_get_first_property (icalcomp, ICAL_X_PROPERTY);
- while (icalprop) {
- const char *x_name;
-
- x_name = icalproperty_get_x_name (icalprop);
- if (!strcmp (x_name, "X-EVOLUTION-NEEDS-DESCRIPTION")) {
- icalcomponent_remove_property (icalcomp, icalprop);
- break;
- }
-
- icalprop = icalcomponent_get_next_property (icalcomp, ICAL_X_PROPERTY);
- }
-}
-
-/* Fills the alarm data with the values from the widgets */
-static void
-dialog_to_alarm (Dialog *dialog, ECalComponentAlarm *alarm)
-{
- ECalComponentAlarmAction action;
-
- repeat_widgets_to_alarm (dialog, alarm);
-
- e_cal_component_alarm_get_action (alarm, &action);
-
- switch (action) {
- case E_CAL_COMPONENT_ALARM_NONE:
- g_assert_not_reached ();
- break;
-
- case E_CAL_COMPONENT_ALARM_AUDIO:
- aalarm_widgets_to_alarm (dialog, alarm);
- break;
-
- case E_CAL_COMPONENT_ALARM_DISPLAY:
- dalarm_widgets_to_alarm (dialog, alarm);
- break;
-
- case E_CAL_COMPONENT_ALARM_EMAIL:
- malarm_widgets_to_alarm (dialog, alarm);
- break;
-
- case E_CAL_COMPONENT_ALARM_PROCEDURE:
- palarm_widgets_to_alarm (dialog, alarm);
- break;
-
- case E_CAL_COMPONENT_ALARM_UNKNOWN:
- break;
-
- default:
- g_assert_not_reached ();
- }
-}
-
-
-
-/**
- * alarm_options_dialog_run:
- * @alarm: Alarm that is to be edited.
- *
- * Runs an alarm options dialog modally.
- *
- * Return value: TRUE if the dialog could be created, FALSE otherwise.
- **/
-gboolean
-alarm_options_dialog_run (ECalComponentAlarm *alarm, const char *email, gboolean repeat)
-{
- Dialog dialog;
- int response_id;
-
- g_return_val_if_fail (alarm != NULL, FALSE);
-
- dialog.repeat = repeat;
- dialog.email = email;
- dialog.xml = glade_xml_new (EVOLUTION_GLADEDIR "/alarm-options.glade", NULL, NULL);
- if (!dialog.xml) {
- g_message ("alarm_options_dialog_new(): Could not load the Glade XML file!");
- return FALSE;
- }
-
- if (!get_widgets (&dialog)) {
- g_object_unref(dialog.xml);
- return FALSE;
- }
-
- if (!setup_select_names (&dialog)) {
- g_object_unref (dialog.xml);
- return FALSE;
- }
-
- init_widgets (&dialog);
-
- alarm_to_dialog (&dialog, alarm);
-
- response_id = gtk_dialog_run (GTK_DIALOG (dialog.toplevel));
- gtk_widget_hide (dialog.toplevel);
-
- if (response_id == GTK_RESPONSE_OK)
- dialog_to_alarm (&dialog, alarm);
-
- gtk_widget_destroy (dialog.toplevel);
- g_object_unref(dialog.xml);
-
- return TRUE;
-}
diff --git a/calendar/gui/dialogs/alarm-options.glade b/calendar/gui/dialogs/alarm-options.glade
deleted file mode 100644
index d58e817ba3..0000000000
--- a/calendar/gui/dialogs/alarm-options.glade
+++ /dev/null
@@ -1,573 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-<requires lib="gnome"/>
-
-<widget class="GtkDialog" id="alarm-options-toplevel">
- <property name="border_width">12</property>
- <property name="visible">True</property>
- <property name="title" translatable="yes">dialog1</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">True</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">True</property>
- <property name="has_separator">True</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox1">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area1">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="cancelbutton1">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">-6</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="okbutton1">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">-5</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox1">
- <property name="border_width">4</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkFrame" id="frame1">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkHBox" id="hbox1">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkCheckButton" id="repeat-toggle">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="has_focus">True</property>
- <property name="label" translatable="yes">Repeat the alarm</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="repeat-group">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="GtkSpinButton" id="repeat-quantity">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">True</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">1 1 999 1 10 10</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">extra times every</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkSpinButton" id="repeat-value">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">True</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">1 0 999 1 10 10</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkOptionMenu" id="repeat-unit">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget1">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget2">
- <property name="visible">True</property>
- <property name="label" translatable="yes">minutes</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget3">
- <property name="visible">True</property>
- <property name="label" translatable="yes">hours</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget4">
- <property name="visible">True</property>
- <property name="label" translatable="yes">days</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Alarm Repeat</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="dalarm-group">
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label2">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Message to Display:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow1">
- <property name="visible">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <widget class="GtkTextView" id="dalarm-description">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="justification">GTK_JUSTIFY_LEFT</property>
- <property name="wrap_mode">GTK_WRAP_WORD</property>
- <property name="cursor_visible">True</property>
- <property name="pixels_above_lines">0</property>
- <property name="pixels_below_lines">0</property>
- <property name="pixels_inside_wrap">0</property>
- <property name="left_margin">0</property>
- <property name="right_margin">0</property>
- <property name="indent">0</property>
- <property name="text" translatable="yes"></property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="aalarm-group">
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label3">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Play sound:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GnomeFileEntry" id="file-entry1">
- <property name="visible">True</property>
- <property name="max_saved">10</property>
- <property name="directory_entry">False</property>
- <property name="modal">True</property>
-
- <child internal-child="entry">
- <widget class="GtkEntry" id="aalarm-attach">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="malarm-group">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkHBox" id="malarm-address-group">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkButton" id="malarm-addressbook">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Send To:</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label7">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Message to Send</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow2">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_NONE</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <widget class="GtkTextView" id="malarm-description">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="justification">GTK_JUSTIFY_LEFT</property>
- <property name="wrap_mode">GTK_WRAP_WORD</property>
- <property name="cursor_visible">True</property>
- <property name="pixels_above_lines">0</property>
- <property name="pixels_below_lines">0</property>
- <property name="pixels_inside_wrap">0</property>
- <property name="left_margin">0</property>
- <property name="right_margin">0</property>
- <property name="indent">0</property>
- <property name="text" translatable="yes"></property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="palarm-group">
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label5">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Run program:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="palarm-program">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label6">
- <property name="visible">True</property>
- <property name="label" translatable="yes">With these arguments:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="palarm-args">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/calendar/gui/dialogs/alarm-options.h b/calendar/gui/dialogs/alarm-options.h
deleted file mode 100644
index 5a07935810..0000000000
--- a/calendar/gui/dialogs/alarm-options.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Evolution calendar - Alarm options dialog
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Authors: Federico Mena-Quintero <federico@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef ALARM_OPTIONS_H
-#define ALARM_OPTIONS_H
-
-#include <libecal/e-cal-component.h>
-
-gboolean alarm_options_dialog_run (ECalComponentAlarm *alarm, const char *email, gboolean repeat);
-
-#endif
diff --git a/calendar/gui/dialogs/alarm-page.c b/calendar/gui/dialogs/alarm-page.c
deleted file mode 100644
index 603cd5c8b6..0000000000
--- a/calendar/gui/dialogs/alarm-page.c
+++ /dev/null
@@ -1,869 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/* Evolution calendar - Alarm page of the calendar component dialogs
- *
- * Copyright (C) 2001-2003 Ximian, Inc.
- *
- * Authors: Federico Mena-Quintero <federico@ximian.com>
- * Miguel de Icaza <miguel@ximian.com>
- * Seth Alves <alves@hungry.com>
- * JP Rosevear <jpr@ximian.com>
- * Hans Petter Jansson <hpj@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-#include <gtk/gtklabel.h>
-#include <gtk/gtkcellrenderertext.h>
-#include <gtk/gtksignal.h>
-#include <gtk/gtktreeview.h>
-#include <gtk/gtktreeselection.h>
-#include <gtk/gtkoptionmenu.h>
-#include <libgnome/gnome-i18n.h>
-#include <glade/glade.h>
-#include "e-util/e-dialog-widgets.h"
-#include "e-util/e-time-utils.h"
-#include <libecal/e-cal-util.h>
-#include <libecal/e-cal-time-util.h>
-#include "../calendar-config.h"
-#include "comp-editor-util.h"
-#include "alarm-options.h"
-#include "../e-alarm-list.h"
-#include "alarm-page.h"
-
-
-
-/* Private part of the AlarmPage structure */
-struct _AlarmPagePrivate {
- /* Glade XML data */
- GladeXML *xml;
-
- /* Widgets from the Glade file */
-
- GtkWidget *main;
-
- GtkWidget *summary;
- GtkWidget *date_time;
-
- GtkWidget *list;
- GtkWidget *add;
- GtkWidget *delete;
-
- GtkWidget *action;
- GtkWidget *interval_value;
- GtkWidget *value_units;
- GtkWidget *relative;
- GtkWidget *time;
-
- GtkWidget *button_options;
-
- /* Alarm options dialog and the alarm we maintain */
- ECalComponentAlarm *alarm;
-
- /* Alarm store for the GtkTreeView list widget */
- EAlarmList *list_store;
-
- gboolean updating;
-
- /* Old summary, to detect changes */
- gchar *old_summary;
-};
-
-/* "relative" types */
-enum {
- BEFORE,
- AFTER
-};
-
-/* Time units */
-enum {
- MINUTES,
- HOURS,
- DAYS
-};
-
-/* Option menu maps */
-static const int action_map[] = {
- E_CAL_COMPONENT_ALARM_DISPLAY,
- E_CAL_COMPONENT_ALARM_AUDIO,
- E_CAL_COMPONENT_ALARM_PROCEDURE,
- E_CAL_COMPONENT_ALARM_EMAIL,
- -1
-};
-
-static const char *action_map_cap[] = {
- CAL_STATIC_CAPABILITY_NO_DISPLAY_ALARMS,
- CAL_STATIC_CAPABILITY_NO_AUDIO_ALARMS,
- CAL_STATIC_CAPABILITY_NO_PROCEDURE_ALARMS,
- CAL_STATIC_CAPABILITY_NO_EMAIL_ALARMS
-};
-
-static const int value_map[] = {
- MINUTES,
- HOURS,
- DAYS,
- -1
-};
-
-static const int relative_map[] = {
- BEFORE,
- AFTER,
- -1
-};
-
-static const int time_map[] = {
- E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START,
- E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_END,
- -1
-};
-
-
-
-static void alarm_page_class_init (AlarmPageClass *class);
-static void alarm_page_init (AlarmPage *apage);
-static void alarm_page_finalize (GObject *object);
-
-static GtkWidget *alarm_page_get_widget (CompEditorPage *page);
-static void alarm_page_focus_main_widget (CompEditorPage *page);
-static void alarm_page_fill_widgets (CompEditorPage *page, ECalComponent *comp);
-static gboolean alarm_page_fill_component (CompEditorPage *page, ECalComponent *comp);
-static void alarm_page_set_summary (CompEditorPage *page, const char *summary);
-static void alarm_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates);
-
-static CompEditorPageClass *parent_class = NULL;
-
-
-
-/**
- * alarm_page_get_type:
- *
- * Registers the #AlarmPage class if necessary, and returns the type ID
- * associated to it.
- *
- * Return value: The type ID of the #AlarmPage class.
- **/
-
-E_MAKE_TYPE (alarm_page, "AlarmPage", AlarmPage, alarm_page_class_init,
- alarm_page_init, TYPE_COMP_EDITOR_PAGE);
-
-/* Class initialization function for the alarm page */
-static void
-alarm_page_class_init (AlarmPageClass *class)
-{
- CompEditorPageClass *editor_page_class;
- GObjectClass *gobject_class;
-
- editor_page_class = (CompEditorPageClass *) class;
- gobject_class = (GObjectClass *) class;
-
- parent_class = g_type_class_ref (TYPE_COMP_EDITOR_PAGE);
-
- editor_page_class->get_widget = alarm_page_get_widget;
- editor_page_class->focus_main_widget = alarm_page_focus_main_widget;
- editor_page_class->fill_widgets = alarm_page_fill_widgets;
- editor_page_class->fill_component = alarm_page_fill_component;
- editor_page_class->set_summary = alarm_page_set_summary;
- editor_page_class->set_dates = alarm_page_set_dates;
-
- gobject_class->finalize = alarm_page_finalize;
-}
-
-/* Object initialization function for the alarm page */
-static void
-alarm_page_init (AlarmPage *apage)
-{
- AlarmPagePrivate *priv;
- icalcomponent *icalcomp;
- icalproperty *icalprop;
-
- priv = g_new0 (AlarmPagePrivate, 1);
- apage->priv = priv;
-
- priv->xml = NULL;
-
- priv->main = NULL;
- priv->summary = NULL;
- priv->date_time = NULL;
- priv->list = NULL;
- priv->add = NULL;
- priv->delete = NULL;
- priv->action = NULL;
- priv->interval_value = NULL;
- priv->value_units = NULL;
- priv->relative = NULL;
- priv->time = NULL;
- priv->button_options = NULL;
-
- /* create the default alarm, which will contain the
- * X-EVOLUTION-NEEDS-DESCRIPTION property, so that we
- * set a correct description if none is set */
- priv->alarm = e_cal_component_alarm_new ();
-
- icalcomp = e_cal_component_alarm_get_icalcomponent (priv->alarm);
- icalprop = icalproperty_new_x ("1");
- icalproperty_set_x_name (icalprop, "X-EVOLUTION-NEEDS-DESCRIPTION");
- icalcomponent_add_property (icalcomp, icalprop);
-
- priv->updating = FALSE;
- priv->old_summary = NULL;
-}
-
-/* Destroy handler for the alarm page */
-static void
-alarm_page_finalize (GObject *object)
-{
- AlarmPage *apage;
- AlarmPagePrivate *priv;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (IS_ALARM_PAGE (object));
-
- apage = ALARM_PAGE (object);
- priv = apage->priv;
-
- if (priv->main)
- gtk_widget_unref (priv->main);
-
- if (priv->xml) {
- g_object_unref (priv->xml);
- priv->xml = NULL;
- }
-
- if (priv->alarm) {
- e_cal_component_alarm_free (priv->alarm);
- priv->alarm = NULL;
- }
-
- if (priv->list_store) {
- g_object_unref (priv->list_store);
- priv->list_store = NULL;
- }
-
- if (priv->old_summary) {
- g_free (priv->old_summary);
- priv->old_summary = NULL;
- }
-
- g_free (priv);
- apage->priv = NULL;
-
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
-}
-
-
-
-/* get_widget handler for the alarm page */
-static GtkWidget *
-alarm_page_get_widget (CompEditorPage *page)
-{
- AlarmPage *apage;
- AlarmPagePrivate *priv;
-
- apage = ALARM_PAGE (page);
- priv = apage->priv;
-
- return priv->main;
-}
-
-/* focus_main_widget handler for the alarm page */
-static void
-alarm_page_focus_main_widget (CompEditorPage *page)
-{
- AlarmPage *apage;
- AlarmPagePrivate *priv;
-
- apage = ALARM_PAGE (page);
- priv = apage->priv;
-
- gtk_widget_grab_focus (priv->action);
-}
-
-/* Fills the widgets with default values */
-static void
-clear_widgets (AlarmPage *apage)
-{
- AlarmPagePrivate *priv;
-
- priv = apage->priv;
-
- /* Summary */
- gtk_label_set_text (GTK_LABEL (priv->summary), "");
-
- /* Start date */
- gtk_label_set_text (GTK_LABEL (priv->date_time), "");
-
- /* Sane defaults */
- e_dialog_option_menu_set (priv->action, E_CAL_COMPONENT_ALARM_DISPLAY, action_map);
- e_dialog_spin_set (priv->interval_value, 15);
- e_dialog_option_menu_set (priv->value_units, MINUTES, value_map);
- e_dialog_option_menu_set (priv->relative, BEFORE, relative_map);
- e_dialog_option_menu_set (priv->time, E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START, time_map);
-
- /* List data */
- e_alarm_list_clear (priv->list_store);
-}
-
-static void
-sensitize_buttons (AlarmPage *apage)
-{
- AlarmPagePrivate *priv;
- ECal *client;
- GtkTreeSelection *selection;
- GtkTreeIter iter;
- gboolean have_selected;
-
- priv = apage->priv;
-
- client = COMP_EDITOR_PAGE (apage)->client;
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->list));
- have_selected = gtk_tree_selection_get_selected (selection, NULL, &iter);
-
- gtk_widget_set_sensitive (priv->add,
- e_cal_get_one_alarm_only (client) && have_selected ? FALSE : TRUE);
- gtk_widget_set_sensitive (priv->delete, have_selected);
-}
-
-/* Appends an alarm to the list */
-static void
-append_reminder (AlarmPage *apage, ECalComponentAlarm *alarm)
-{
- AlarmPagePrivate *priv;
- GtkTreeView *view;
- GtkTreeIter iter;
-
- priv = apage->priv;
- view = GTK_TREE_VIEW (priv->list);
-
- e_alarm_list_append (priv->list_store, &iter, alarm);
- gtk_tree_selection_select_iter (gtk_tree_view_get_selection (view), &iter);
-
- sensitize_buttons (apage);
-}
-
-/* fill_widgets handler for the alarm page */
-static void
-alarm_page_fill_widgets (CompEditorPage *page, ECalComponent *comp)
-{
- AlarmPage *apage;
- AlarmPagePrivate *priv;
- GtkWidget *menu;
- ECalComponentText text;
- GList *alarms, *l;
- CompEditorPageDates dates;
- int i;
-
- apage = ALARM_PAGE (page);
- priv = apage->priv;
-
- /* Don't send off changes during this time */
- priv->updating = TRUE;
-
- /* Clean the page */
- clear_widgets (apage);
-
- /* Summary */
- e_cal_component_get_summary (comp, &text);
- alarm_page_set_summary (page, text.value);
-
- /* Dates */
- comp_editor_dates (&dates, comp);
- alarm_page_set_dates (page, &dates);
- comp_editor_free_dates (&dates);
-
- /* List */
- if (!e_cal_component_has_alarms (comp))
- goto out;
-
- alarms = e_cal_component_get_alarm_uids (comp);
-
- for (l = alarms; l != NULL; l = l->next) {
- ECalComponentAlarm *ca, *ca_copy;
- const char *auid;
-
- auid = l->data;
- ca = e_cal_component_get_alarm (comp, auid);
- g_assert (ca != NULL);
-
- ca_copy = e_cal_component_alarm_clone (ca);
- e_cal_component_alarm_free (ca);
-
- append_reminder (apage, ca_copy);
- }
- cal_obj_uid_list_free (alarms);
-
- out:
-
- /* Alarm types */
- menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->action));
- for (i = 0, l = GTK_MENU_SHELL (menu)->children; action_map[i] != -1; i++, l = l->next) {
- if (e_cal_get_static_capability (page->client, action_map_cap[i]))
- gtk_widget_set_sensitive (l->data, FALSE);
- else
- gtk_widget_set_sensitive (l->data, TRUE);
- }
-
- sensitize_buttons (apage);
-
- priv->updating = FALSE;
-}
-
-/* fill_component handler for the alarm page */
-static gboolean
-alarm_page_fill_component (CompEditorPage *page, ECalComponent *comp)
-{
- AlarmPage *apage;
- AlarmPagePrivate *priv;
- GtkTreeView *view;
- GtkTreeModel *model;
- GtkTreeIter iter;
- gboolean valid_iter;
- GList *list, *l;
-
- apage = ALARM_PAGE (page);
- priv = apage->priv;
-
- /* Remove all the alarms from the component */
-
- list = e_cal_component_get_alarm_uids (comp);
- for (l = list; l; l = l->next) {
- const char *auid;
-
- auid = l->data;
- e_cal_component_remove_alarm (comp, auid);
- }
- cal_obj_uid_list_free (list);
-
- /* Add the new alarms */
-
- view = GTK_TREE_VIEW (priv->list);
- model = GTK_TREE_MODEL (priv->list_store);
-
- for (valid_iter = gtk_tree_model_get_iter_first (model, &iter); valid_iter;
- valid_iter = gtk_tree_model_iter_next (model, &iter)) {
- ECalComponentAlarm *alarm, *alarm_copy;
- icalcomponent *icalcomp;
- icalproperty *icalprop;
-
- alarm = (ECalComponentAlarm *) e_alarm_list_get_alarm (priv->list_store, &iter);
- g_assert (alarm != NULL);
-
- /* We set the description of the alarm if it's got
- * the X-EVOLUTION-NEEDS-DESCRIPTION property.
- */
- icalcomp = e_cal_component_alarm_get_icalcomponent (alarm);
- icalprop = icalcomponent_get_first_property (icalcomp, ICAL_X_PROPERTY);
- while (icalprop) {
- const char *x_name;
- ECalComponentText summary;
-
- x_name = icalproperty_get_x_name (icalprop);
- if (!strcmp (x_name, "X-EVOLUTION-NEEDS-DESCRIPTION")) {
- e_cal_component_get_summary (comp, &summary);
- e_cal_component_alarm_set_description (alarm, &summary);
-
- icalcomponent_remove_property (icalcomp, icalprop);
- break;
- }
-
- icalprop = icalcomponent_get_next_property (icalcomp, ICAL_X_PROPERTY);
- }
-
- /* We clone the alarm to maintain the invariant that the alarm
- * structures in the list did *not* come from the component.
- */
-
- alarm_copy = e_cal_component_alarm_clone (alarm);
- e_cal_component_add_alarm (comp, alarm_copy);
- e_cal_component_alarm_free (alarm_copy);
- }
-
- return TRUE;
-}
-
-/* set_summary handler for the alarm page */
-static void
-alarm_page_set_summary (CompEditorPage *page, const char *summary)
-{
- AlarmPage *apage;
- AlarmPagePrivate *priv;
-
- apage = ALARM_PAGE (page);
- priv = apage->priv;
-
- gtk_label_set_text (GTK_LABEL (priv->summary), summary);
-
- /* iterate over all alarms */
- if (priv->old_summary) {
- GtkTreeView *view;
- GtkTreeModel *model;
- GtkTreeIter iter;
- gboolean valid_iter;
-
- view = GTK_TREE_VIEW (priv->list);
- model = GTK_TREE_MODEL (priv->list_store);
-
- for (valid_iter = gtk_tree_model_get_iter_first (model, &iter); valid_iter;
- valid_iter = gtk_tree_model_iter_next (model, &iter)) {
- ECalComponentAlarm *alarm;
- ECalComponentText desc;
-
- alarm = (ECalComponentAlarm *) e_alarm_list_get_alarm (priv->list_store, &iter);
- g_assert (alarm != NULL);
-
- e_cal_component_alarm_get_description (alarm, &desc);
- if (desc.value && *desc.value) {
- if (!strcmp (desc.value, priv->old_summary)) {
- desc.value = summary;
- e_cal_component_alarm_set_description (alarm, &desc);
- }
- }
- }
-
- g_free (priv->old_summary);
- }
-
- /* update old summary */
- priv->old_summary = g_strdup (summary);
-}
-
-/* set_dates handler for the alarm page */
-static void
-alarm_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates)
-{
- AlarmPage *apage;
- AlarmPagePrivate *priv;
-
- apage = ALARM_PAGE (page);
- priv = apage->priv;
-
- comp_editor_date_label (dates, priv->date_time);
-}
-
-
-
-/* Gets the widgets from the XML file and returns TRUE if they are all available. */
-static gboolean
-get_widgets (AlarmPage *apage)
-{
- CompEditorPage *page = COMP_EDITOR_PAGE (apage);
- AlarmPagePrivate *priv;
- GSList *accel_groups;
- GtkWidget *toplevel;
-
- priv = apage->priv;
-
-#define GW(name) glade_xml_get_widget (priv->xml, name)
-
- priv->main = GW ("alarm-page");
- if (!priv->main)
- return FALSE;
-
- /* Get the GtkAccelGroup from the toplevel window, so we can install
- it when the notebook page is mapped. */
- toplevel = gtk_widget_get_toplevel (priv->main);
- accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel));
- if (accel_groups) {
- page->accel_group = accel_groups->data;
- gtk_accel_group_ref (page->accel_group);
- }
-
- gtk_widget_ref (priv->main);
- gtk_container_remove (GTK_CONTAINER (priv->main->parent), priv->main);
-
- priv->summary = GW ("summary");
- priv->date_time = GW ("date-time");
-
- priv->list = GW ("list");
- priv->add = GW ("add");
- priv->delete = GW ("delete");
-
- priv->action = GW ("action");
- priv->interval_value = GW ("interval-value");
- priv->value_units = GW ("value-units");
- priv->relative = GW ("relative");
- priv->time = GW ("time");
-
- priv->button_options = GW ("button-options");
-
-#undef GW
-
- return (priv->summary
- && priv->date_time
- && priv->list
- && priv->add
- && priv->delete
- && priv->action
- && priv->interval_value
- && priv->value_units
- && priv->relative
- && priv->time
- && priv->button_options);
-}
-
-/* This is called when any field is changed; it notifies upstream. */
-static void
-field_changed_cb (GtkWidget *widget, gpointer data)
-{
- AlarmPage *apage;
- AlarmPagePrivate *priv;
-
- apage = ALARM_PAGE (data);
- priv = apage->priv;
-
- if (!priv->updating)
- comp_editor_page_notify_changed (COMP_EDITOR_PAGE (apage));
-}
-
-/* Callback used for the "add reminder" button */
-static void
-add_clicked_cb (GtkButton *button, gpointer data)
-{
- AlarmPage *apage;
- AlarmPagePrivate *priv;
- ECalComponentAlarm *alarm;
- ECalComponentAlarmTrigger trigger;
- ECalComponentAlarmAction action;
-
- apage = ALARM_PAGE (data);
- priv = apage->priv;
-
- alarm = e_cal_component_alarm_clone (priv->alarm);
-
- memset (&trigger, 0, sizeof (ECalComponentAlarmTrigger));
- trigger.type = e_dialog_option_menu_get (priv->time, time_map);
- if (e_dialog_option_menu_get (priv->relative, relative_map) == BEFORE)
- trigger.u.rel_duration.is_neg = 1;
- else
- trigger.u.rel_duration.is_neg = 0;
-
- switch (e_dialog_option_menu_get (priv->value_units, value_map)) {
- case MINUTES:
- trigger.u.rel_duration.minutes =
- e_dialog_spin_get_int (priv->interval_value);
- break;
-
- case HOURS:
- trigger.u.rel_duration.hours =
- e_dialog_spin_get_int (priv->interval_value);
- break;
-
- case DAYS:
- trigger.u.rel_duration.days =
- e_dialog_spin_get_int (priv->interval_value);
- break;
-
- default:
- g_assert_not_reached ();
- }
- e_cal_component_alarm_set_trigger (alarm, trigger);
-
- action = e_dialog_option_menu_get (priv->action, action_map);
- e_cal_component_alarm_set_action (alarm, action);
- if (action == E_CAL_COMPONENT_ALARM_EMAIL && !e_cal_component_alarm_has_attendees (alarm)) {
- char *email;
-
- if (!e_cal_get_alarm_email_address (COMP_EDITOR_PAGE (apage)->client, &email, NULL)) {
- ECalComponentAttendee *a;
- GSList attendee_list;
-
- a = g_new0 (ECalComponentAttendee, 1);
- a->value = email;
- attendee_list.data = a;
- attendee_list.next = NULL;
- e_cal_component_alarm_set_attendee_list (alarm, &attendee_list);
- g_free (email);
- g_free (a);
- }
- }
-
- append_reminder (apage, alarm);
-}
-
-/* Callback used for the "delete reminder" button */
-static void
-delete_clicked_cb (GtkButton *button, gpointer data)
-{
- AlarmPage *apage;
- AlarmPagePrivate *priv;
- GtkTreeSelection *selection;
- GtkTreeIter iter;
- GtkTreePath *path;
- gboolean valid_iter;
-
- apage = ALARM_PAGE (data);
- priv = apage->priv;
-
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->list));
- if (!gtk_tree_selection_get_selected (selection, NULL, &iter)) {
- g_warning ("Could not get a selection to delete.");
- return;
- }
-
- path = gtk_tree_model_get_path (GTK_TREE_MODEL (priv->list_store), &iter);
- e_alarm_list_remove (priv->list_store, &iter);
-
- /* Select closest item after removal */
- valid_iter = gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->list_store), &iter, path);
- if (!valid_iter) {
- gtk_tree_path_prev (path);
- valid_iter = gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->list_store), &iter, path);
- }
-
- if (valid_iter)
- gtk_tree_selection_select_iter (selection, &iter);
-
- sensitize_buttons (apage);
-
- gtk_tree_path_free (path);
-}
-
-/* Callback used when the alarm options button is clicked */
-static void
-button_options_clicked_cb (GtkWidget *widget, gpointer data)
-{
- AlarmPage *apage;
- AlarmPagePrivate *priv;
- gboolean repeat;
- char *email;
-
- apage = ALARM_PAGE (data);
- priv = apage->priv;
-
- e_cal_component_alarm_set_action (priv->alarm,
- e_dialog_option_menu_get (priv->action, action_map));
-
- repeat = !e_cal_get_static_capability (COMP_EDITOR_PAGE (apage)->client,
- CAL_STATIC_CAPABILITY_NO_ALARM_REPEAT);
-
- if (e_cal_get_alarm_email_address (COMP_EDITOR_PAGE (apage)->client, &email, NULL)) {
- if (!alarm_options_dialog_run (priv->alarm, email, repeat))
- g_message ("button_options_clicked_cb(): Could not create the alarm options dialog");
- }
-}
-
-/* Hooks the widget signals */
-static void
-init_widgets (AlarmPage *apage)
-{
- AlarmPagePrivate *priv;
- GtkTreeViewColumn *column;
- GtkCellRenderer *cell_renderer;
-
- priv = apage->priv;
-
- /* Reminder buttons */
- g_signal_connect ((priv->add), "clicked",
- G_CALLBACK (add_clicked_cb), apage);
- g_signal_connect ((priv->delete), "clicked",
- G_CALLBACK (delete_clicked_cb), apage);
-
- /* Connect the default signal handler to use to make sure we notify
- * upstream of changes to the widget values.
- */
- g_signal_connect ((priv->add), "clicked",
- G_CALLBACK (field_changed_cb), apage);
- g_signal_connect ((priv->delete), "clicked",
- G_CALLBACK (field_changed_cb), apage);
-
- /* Options button */
- g_signal_connect ((priv->button_options), "clicked",
- G_CALLBACK (button_options_clicked_cb), apage);
-
- /* Alarm list */
-
- /* Model */
- priv->list_store = e_alarm_list_new ();
- gtk_tree_view_set_model (GTK_TREE_VIEW (priv->list),
- GTK_TREE_MODEL (priv->list_store));
-
- /* View */
- column = gtk_tree_view_column_new ();
- gtk_tree_view_column_set_title (column, _("Action/Trigger"));
- cell_renderer = GTK_CELL_RENDERER (gtk_cell_renderer_text_new ());
- gtk_tree_view_column_pack_start (column, cell_renderer, TRUE);
- gtk_tree_view_column_add_attribute (column, cell_renderer, "text", E_ALARM_LIST_COLUMN_DESCRIPTION);
- gtk_tree_view_append_column (GTK_TREE_VIEW (priv->list), column);
-
-#if 0
- /* If we want the alarm setup widgets to reflect the currently selected alarm, we
- * need to do something like this */
- g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->list)), "changed",
- G_CALLBACK (alarm_selection_changed_cb), apage);
-#endif
-}
-
-
-
-/**
- * alarm_page_construct:
- * @apage: An alarm page.
- *
- * Constructs an alarm page by loading its Glade data.
- *
- * Return value: The same object as @apage, or NULL if the widgets could not be
- * created.
- **/
-AlarmPage *
-alarm_page_construct (AlarmPage *apage)
-{
- AlarmPagePrivate *priv;
-
- priv = apage->priv;
-
- priv->xml = glade_xml_new (EVOLUTION_GLADEDIR "/alarm-page.glade",
- NULL, NULL);
- if (!priv->xml) {
- g_message ("alarm_page_construct(): "
- "Could not load the Glade XML file!");
- return NULL;
- }
-
- if (!get_widgets (apage)) {
- g_message ("alarm_page_construct(): "
- "Could not find all widgets in the XML file!");
- return NULL;
- }
-
- init_widgets (apage);
-
- return apage;
-}
-
-/**
- * alarm_page_new:
- *
- * Creates a new alarm page.
- *
- * Return value: A newly-created alarm page, or NULL if the page could not be
- * created.
- **/
-AlarmPage *
-alarm_page_new (void)
-{
- AlarmPage *apage;
-
- apage = g_object_new (TYPE_ALARM_PAGE, NULL);
- if (!alarm_page_construct (apage)) {
- g_object_unref (apage);
- return NULL;
- }
-
- return apage;
-}
diff --git a/calendar/gui/dialogs/alarm-page.glade b/calendar/gui/dialogs/alarm-page.glade
deleted file mode 100644
index 7c2f06bae3..0000000000
--- a/calendar/gui/dialogs/alarm-page.glade
+++ /dev/null
@@ -1,490 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-
-<widget class="GtkWindow" id="alarm-toplevel">
- <property name="title" translatable="yes">window1</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
-
- <child>
- <widget class="GtkVBox" id="alarm-page">
- <property name="border_width">12</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkFrame" id="frame33">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkTable" id="table13">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label62">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Summary:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label63">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Date/Time:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="summary">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">4</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="date-time">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xpad">4</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Basics</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFrame" id="frame34">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkVBox" id="vbox53">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkHBox" id="hbox54">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkOptionMenu" id="action">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget1">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget2">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Display a message</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget3">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Play a sound</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget4">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Run a program</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="send_an_email1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Send an Email</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkSpinButton" id="interval-value">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">True</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">1 0 999 1 10 10</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkOptionMenu" id="value-units">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget5">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget6">
- <property name="visible">True</property>
- <property name="label" translatable="yes">minute(s)</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget7">
- <property name="visible">True</property>
- <property name="label" translatable="yes">hour(s)</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget8">
- <property name="visible">True</property>
- <property name="label" translatable="yes">day(s)</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkOptionMenu" id="relative">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget9">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget10">
- <property name="visible">True</property>
- <property name="label" translatable="yes">before</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget11">
- <property name="visible">True</property>
- <property name="label" translatable="yes">after</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkOptionMenu" id="time">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget12">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget13">
- <property name="visible">True</property>
- <property name="label" translatable="yes">start of appointment</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget14">
- <property name="visible">True</property>
- <property name="label" translatable="yes">end of appointment</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="button-options">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Options...</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox55">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow13">
- <property name="visible">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <widget class="GtkTreeView" id="list">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="headers_visible">True</property>
- <property name="rules_hint">False</property>
- <property name="reorderable">False</property>
- <property name="enable_search">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVButtonBox" id="vbuttonbox2">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_START</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkButton" id="add">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-add</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="delete">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-remove</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label64">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Reminders</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/calendar/gui/dialogs/alarm-page.h b/calendar/gui/dialogs/alarm-page.h
deleted file mode 100644
index d814e850b3..0000000000
--- a/calendar/gui/dialogs/alarm-page.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Evolution calendar - Alarm page of the calendar component dialogs
- *
- * Copyright (C) 2001-2003 Ximian, Inc.
- *
- * Authors: Federico Mena-Quintero <federico@ximian.com>
- * Miguel de Icaza <miguel@ximian.com>
- * Seth Alves <alves@hungry.com>
- * JP Rosevear <jpr@ximian.com>
- * Hans Petter Jansson <hpj@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef ALARM_PAGE_H
-#define ALARM_PAGE_H
-
-#include "comp-editor-page.h"
-
-G_BEGIN_DECLS
-
-
-
-#define TYPE_ALARM_PAGE (alarm_page_get_type ())
-#define ALARM_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ALARM_PAGE, AlarmPage))
-#define ALARM_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ALARM_PAGE, AlarmPageClass))
-#define IS_ALARM_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ALARM_PAGE))
-#define IS_ALARM_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), TYPE_ALARM_PAGE))
-
-typedef struct _AlarmPagePrivate AlarmPagePrivate;
-
-typedef struct {
- CompEditorPage page;
-
- /* Private data */
- AlarmPagePrivate *priv;
-} AlarmPage;
-
-typedef struct {
- CompEditorPageClass parent_class;
-} AlarmPageClass;
-
-
-GtkType alarm_page_get_type (void);
-AlarmPage *alarm_page_construct (AlarmPage *apage);
-AlarmPage *alarm_page_new (void);
-
-
-
-G_END_DECLS
-
-#endif
diff --git a/calendar/gui/dialogs/cal-prefs-dialog.c b/calendar/gui/dialogs/cal-prefs-dialog.c
deleted file mode 100644
index 83363a3ac0..0000000000
--- a/calendar/gui/dialogs/cal-prefs-dialog.c
+++ /dev/null
@@ -1,686 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Authors :
- * Damon Chaplin <damon@ximian.com>
- * Ettore Perazzoli <ettore@ximian.com>
- *
- * Copyright 2000, 2001, 2002 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-/*
- * CalPrefsDialog - a GtkObject which handles a libglade-loaded dialog
- * to edit the calendar preference settings.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "../e-timezone-entry.h"
-#include "cal-prefs-dialog.h"
-#include "../calendar-config.h"
-
-#include <gtk/gtksignal.h>
-#include <gtk/gtkoptionmenu.h>
-#include <gtk/gtktogglebutton.h>
-#include <libgnomeui/gnome-color-picker.h>
-#include <glade/glade.h>
-#include <gal/util/e-util.h>
-#include <e-util/e-dialog-widgets.h>
-#include <widgets/misc/e-dateedit.h>
-
-
-struct _DialogData {
- /* Glade XML data */
- GladeXML *xml;
-
- GtkWidget *page;
-
- GtkWidget *timezone;
- GtkWidget *working_days[7];
- GtkWidget *week_start_day;
- GtkWidget *start_of_day;
- GtkWidget *end_of_day;
- GtkWidget *use_12_hour;
- GtkWidget *use_24_hour;
- GtkWidget *time_divisions;
- GtkWidget *show_end_times;
- GtkWidget *compress_weekend;
- GtkWidget *dnav_show_week_no;
-
- /* Widgets for the task list options */
- GtkWidget *tasks_due_today_color;
- GtkWidget *tasks_overdue_color;
-
- GtkWidget *tasks_hide_completed_checkbutton;
- GtkWidget *tasks_hide_completed_spinbutton;
- GtkWidget *tasks_hide_completed_optionmenu;
-
- /* Other page options */
- GtkWidget *confirm_delete;
- GtkWidget *default_reminder;
- GtkWidget *default_reminder_interval;
- GtkWidget *default_reminder_units;
-};
-typedef struct _DialogData DialogData;
-
-static const int week_start_day_map[] = {
- 1, 2, 3, 4, 5, 6, 0, -1
-};
-
-static const int time_division_map[] = {
- 60, 30, 15, 10, 5, -1
-};
-
-/* The following two are kept separate in case we need to re-order each menu individually */
-static const int hide_completed_units_map[] = {
- CAL_MINUTES, CAL_HOURS, CAL_DAYS, -1
-};
-
-static const int default_reminder_units_map[] = {
- CAL_MINUTES, CAL_HOURS, CAL_DAYS, -1
-};
-
-
-static gboolean get_widgets (DialogData *data);
-
-static void widget_changed_callback (GtkWidget *, void *data);
-static void connect_changed (GtkWidget *widget, const char *signal_name, EvolutionConfigControl *config_control);
-static void setup_changes (DialogData *data, EvolutionConfigControl *config_control);
-
-static void init_widgets (DialogData *data);
-static void show_config (DialogData *data);
-static void update_config (DialogData *dialog_data);
-
-static void config_control_apply_callback (EvolutionConfigControl *config_control, void *data);
-static void config_control_destroy_callback (GtkObject *object, void *data);
-
-static void cal_prefs_dialog_use_24_hour_toggled(GtkWidget *button, void *data);
-static void cal_prefs_dialog_end_of_day_changed (GtkWidget *button, void *data);
-static void cal_prefs_dialog_start_of_day_changed (GtkWidget *button, void *data);
-static void cal_prefs_dialog_hide_completed_tasks_toggled (GtkWidget *button, void *data);
-
-GtkWidget *cal_prefs_dialog_create_time_edit (void);
-
-
-/**
- * cal_prefs_dialog_new:
- *
- * Creates a new #CalPrefsDialog.
- *
- * Return value: a new #CalPrefsDialog.
- **/
-EvolutionConfigControl *
-cal_prefs_dialog_new (void)
-{
- DialogData *dialog_data;
- EvolutionConfigControl *config_control;
-
- dialog_data = g_new0 (DialogData, 1);
-
- /* Load the content widgets */
-
- dialog_data->xml = glade_xml_new (EVOLUTION_GLADEDIR "/cal-prefs-dialog.glade", NULL, NULL);
- if (!dialog_data->xml) {
- g_message ("cal_prefs_dialog_construct(): Could not load the Glade XML file!");
- return NULL;
- }
-
- if (!get_widgets (dialog_data)) {
- g_message ("cal_prefs_dialog_construct(): Could not find all widgets in the XML file!");
- return NULL;
- }
-
- init_widgets (dialog_data);
- show_config (dialog_data);
-
- gtk_widget_ref (dialog_data->page);
- gtk_container_remove (GTK_CONTAINER (dialog_data->page->parent), dialog_data->page);
- config_control = evolution_config_control_new (dialog_data->page);
- gtk_widget_unref (dialog_data->page);
-
- g_signal_connect((config_control), "apply",
- G_CALLBACK (config_control_apply_callback), dialog_data);
- g_signal_connect((config_control), "destroy",
- G_CALLBACK (config_control_destroy_callback), dialog_data);
-
- setup_changes (dialog_data, config_control);
-
- return config_control;
-}
-
-static void
-widget_changed_callback (GtkWidget *widget,
- void *data)
-{
- EvolutionConfigControl *config_control;
-
- config_control = EVOLUTION_CONFIG_CONTROL (data);
-
- evolution_config_control_changed (config_control);
-}
-
-/* ^*&%!!#! GnomeColorPicker. */
-static void
-color_set_callback (GnomeColorPicker *cp,
- guint r,
- guint g,
- guint b,
- guint a,
- void *data)
-{
- EvolutionConfigControl *config_control;
-
- config_control = EVOLUTION_CONFIG_CONTROL (data);
-
- evolution_config_control_changed (config_control);
-}
-
-static void
-connect_changed (GtkWidget *widget,
- const char *signal_name,
- EvolutionConfigControl *config_control)
-{
- g_signal_connect((widget), signal_name,
- G_CALLBACK (widget_changed_callback), config_control);
-}
-
-static void
-setup_changes (DialogData *dialog_data,
- EvolutionConfigControl *config_control)
-{
- int i;
-
- for (i = 0; i < 7; i ++)
- connect_changed (dialog_data->working_days[i], "toggled", config_control);
-
- connect_changed (dialog_data->timezone, "changed", config_control);
-
- connect_changed (dialog_data->start_of_day, "changed", config_control);
- connect_changed (dialog_data->end_of_day, "changed", config_control);
-
- connect_changed (GTK_OPTION_MENU (dialog_data->week_start_day)->menu, "selection_done", config_control);
-
- connect_changed (dialog_data->use_12_hour, "toggled", config_control);
-
- connect_changed (GTK_OPTION_MENU (dialog_data->time_divisions)->menu, "selection_done", config_control);
-
- connect_changed (dialog_data->show_end_times, "toggled", config_control);
- connect_changed (dialog_data->compress_weekend, "toggled", config_control);
- connect_changed (dialog_data->dnav_show_week_no, "toggled", config_control);
-
- connect_changed (dialog_data->tasks_hide_completed_checkbutton, "toggled", config_control);
- connect_changed (dialog_data->tasks_hide_completed_spinbutton, "changed", config_control);
- connect_changed (GTK_OPTION_MENU (dialog_data->tasks_hide_completed_optionmenu)->menu, "selection_done", config_control);
-
- connect_changed (dialog_data->confirm_delete, "toggled", config_control);
- connect_changed (dialog_data->default_reminder, "toggled", config_control);
- connect_changed (dialog_data->default_reminder_interval, "changed", config_control);
- connect_changed (GTK_OPTION_MENU (dialog_data->default_reminder_units)->menu, "selection_done", config_control);
-
- /* These use GnomeColorPicker so we have to use a different signal. */
- g_signal_connect((dialog_data->tasks_due_today_color), "color_set",
- G_CALLBACK (color_set_callback), config_control);
- g_signal_connect((dialog_data->tasks_overdue_color), "color_set",
- G_CALLBACK (color_set_callback), config_control);
-}
-
-/* Gets the widgets from the XML file and returns if they are all available.
- */
-static gboolean
-get_widgets (DialogData *data)
-{
-#define GW(name) glade_xml_get_widget (data->xml, name)
-
- data->page = GW ("toplevel-notebook");
-
- /* The indices must be 0 (Sun) to 6 (Sat). */
- data->working_days[0] = GW ("sun_button");
- data->working_days[1] = GW ("mon_button");
- data->working_days[2] = GW ("tue_button");
- data->working_days[3] = GW ("wed_button");
- data->working_days[4] = GW ("thu_button");
- data->working_days[5] = GW ("fri_button");
- data->working_days[6] = GW ("sat_button");
-
- data->timezone = GW ("timezone");
- data->week_start_day = GW ("first_day_of_week");
- data->start_of_day = GW ("start_of_day");
- gtk_widget_show (data->start_of_day);
- data->end_of_day = GW ("end_of_day");
- gtk_widget_show (data->end_of_day);
- data->use_12_hour = GW ("use_12_hour");
- data->use_24_hour = GW ("use_24_hour");
- data->time_divisions = GW ("time_divisions");
- data->show_end_times = GW ("show_end_times");
- data->compress_weekend = GW ("compress_weekend");
- data->dnav_show_week_no = GW ("dnav_show_week_no");
-
- data->tasks_due_today_color = GW ("tasks_due_today_color");
- data->tasks_overdue_color = GW ("tasks_overdue_color");
-
- data->tasks_hide_completed_checkbutton = GW ("tasks-hide-completed-checkbutton");
- data->tasks_hide_completed_spinbutton = GW ("tasks-hide-completed-spinbutton");
- data->tasks_hide_completed_optionmenu = GW ("tasks-hide-completed-optionmenu");
-
- data->confirm_delete = GW ("confirm-delete");
- data->default_reminder = GW ("default-reminder");
- data->default_reminder_interval = GW ("default-reminder-interval");
- data->default_reminder_units = GW ("default-reminder-units");
-
-#undef GW
-
- return (data->page
- && data->timezone
- && data->working_days[0]
- && data->working_days[1]
- && data->working_days[2]
- && data->working_days[3]
- && data->working_days[4]
- && data->working_days[5]
- && data->working_days[6]
- && data->week_start_day
- && data->start_of_day
- && data->end_of_day
- && data->use_12_hour
- && data->use_24_hour
- && data->time_divisions
- && data->show_end_times
- && data->compress_weekend
- && data->dnav_show_week_no
- && data->tasks_due_today_color
- && data->tasks_overdue_color
- && data->tasks_hide_completed_checkbutton
- && data->tasks_hide_completed_spinbutton
- && data->tasks_hide_completed_optionmenu
- && data->confirm_delete
- && data->default_reminder
- && data->default_reminder_interval
- && data->default_reminder_units);
-}
-
-
-static void
-config_control_destroy_callback (GtkObject *object,
- void *data)
-{
- DialogData *dialog_data;
-
- dialog_data = (DialogData *) data;
-
- g_object_unref (dialog_data->xml);
-
- g_free (dialog_data);
-}
-
-
-static void
-config_control_apply_callback (EvolutionConfigControl *control,
- void *data)
-{
- DialogData *dialog_data;
-
- dialog_data = (DialogData *) data;
-
- update_config (dialog_data);
-}
-
-
-/* Called by libglade to create our custom EDateEdit widgets. */
-GtkWidget *
-cal_prefs_dialog_create_time_edit (void)
-{
- GtkWidget *dedit;
-
- dedit = e_date_edit_new ();
-
- e_date_edit_set_use_24_hour_format (E_DATE_EDIT (dedit), calendar_config_get_24_hour_format ());
- e_date_edit_set_time_popup_range (E_DATE_EDIT (dedit), 0, 24);
- e_date_edit_set_show_date (E_DATE_EDIT (dedit), FALSE);
-
- return dedit;
-}
-
-
-/* Connects any necessary signal handlers. */
-static void
-init_widgets (DialogData *dialog_data)
-{
- g_signal_connect((dialog_data->use_24_hour), "toggled",
- G_CALLBACK (cal_prefs_dialog_use_24_hour_toggled),
- dialog_data);
-
- g_signal_connect((dialog_data->start_of_day), "changed",
- G_CALLBACK (cal_prefs_dialog_start_of_day_changed),
- dialog_data);
-
- g_signal_connect((dialog_data->end_of_day), "changed",
- G_CALLBACK (cal_prefs_dialog_end_of_day_changed),
- dialog_data);
-
- g_signal_connect((dialog_data->tasks_hide_completed_checkbutton),
- "toggled",
- G_CALLBACK (cal_prefs_dialog_hide_completed_tasks_toggled),
- dialog_data);
-}
-
-
-static void
-cal_prefs_dialog_use_24_hour_toggled (GtkWidget *button,
- void *data)
-{
- DialogData *dialog_data;
- gboolean use_24_hour;
-
- dialog_data = (DialogData *) data;
-
- use_24_hour = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog_data->use_24_hour));
-
- e_date_edit_set_use_24_hour_format (E_DATE_EDIT (dialog_data->start_of_day), use_24_hour);
- e_date_edit_set_use_24_hour_format (E_DATE_EDIT (dialog_data->end_of_day), use_24_hour);
-}
-
-static void
-cal_prefs_dialog_start_of_day_changed (GtkWidget *button, void *data)
-{
- DialogData *dialog_data;
- EDateEdit *start, *end;
- int start_hour, start_minute, end_hour, end_minute;
-
- dialog_data = (DialogData *) data;
-
- start = E_DATE_EDIT (dialog_data->start_of_day);
- end = E_DATE_EDIT (dialog_data->end_of_day);
-
- e_date_edit_get_time_of_day (start, &start_hour, &start_minute);
- e_date_edit_get_time_of_day (end, &end_hour, &end_minute);
-
- if ((start_hour > end_hour)
- || (start_hour == end_hour && start_minute > end_minute)) {
-
- if (start_hour < 23)
- e_date_edit_set_time_of_day (end, start_hour + 1, start_minute);
- else
- e_date_edit_set_time_of_day (end, 23, 59);
- }
-}
-
-static void
-cal_prefs_dialog_end_of_day_changed (GtkWidget *button, void *data)
-{
- DialogData *dialog_data;
- EDateEdit *start, *end;
- int start_hour, start_minute, end_hour, end_minute;
-
- dialog_data = (DialogData *) data;
-
- start = E_DATE_EDIT (dialog_data->start_of_day);
- end = E_DATE_EDIT (dialog_data->end_of_day);
-
- e_date_edit_get_time_of_day (start, &start_hour, &start_minute);
- e_date_edit_get_time_of_day (end, &end_hour, &end_minute);
-
- if ((end_hour < start_hour)
- || (end_hour == start_hour && end_minute < start_minute)) {
- if (end_hour < 1)
- e_date_edit_set_time_of_day (start, 0, 0);
- else
- e_date_edit_set_time_of_day (start, end_hour - 1, end_minute);
- }
-}
-
-static void
-cal_prefs_dialog_hide_completed_tasks_toggled (GtkWidget *button,
- void *data)
-{
- DialogData *dialog_data;
- gboolean hide_completed_tasks;
-
- dialog_data = (DialogData *) data;
-
- hide_completed_tasks = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog_data->tasks_hide_completed_checkbutton));
-
- gtk_widget_set_sensitive (dialog_data->tasks_hide_completed_spinbutton, hide_completed_tasks);
- gtk_widget_set_sensitive (dialog_data->tasks_hide_completed_optionmenu, hide_completed_tasks);
-}
-
-/* Sets the color in a color picker from an X color spec */
-static void
-set_color_picker (GtkWidget *picker, const char *spec)
-{
- GdkColor color;
-
- g_assert (spec != NULL);
-
- if (!gdk_color_parse (spec, &color)) {
- color.red = color.green = color.blue = 0;
- return;
- }
-
- gnome_color_picker_set_i16 (GNOME_COLOR_PICKER (picker),
- color.red,
- color.green,
- color.blue,
- 65535);
-}
-
-/* Shows the current task list settings in the dialog */
-static void
-show_task_list_config (DialogData *dialog_data)
-{
- CalUnits units;
- gboolean hide_completed_tasks;
-
- set_color_picker (dialog_data->tasks_due_today_color, calendar_config_get_tasks_due_today_color ());
- set_color_picker (dialog_data->tasks_overdue_color, calendar_config_get_tasks_overdue_color ());
-
- /* Hide Completed Tasks. */
- hide_completed_tasks = calendar_config_get_hide_completed_tasks ();
- e_dialog_toggle_set (dialog_data->tasks_hide_completed_checkbutton,
- hide_completed_tasks);
-
- /* Hide Completed Tasks Units. */
- units = calendar_config_get_hide_completed_tasks_units ();
- e_dialog_option_menu_set (dialog_data->tasks_hide_completed_optionmenu,
- units, hide_completed_units_map);
-
- /* Hide Completed Tasks Value. */
- e_dialog_spin_set (dialog_data->tasks_hide_completed_spinbutton,
- calendar_config_get_hide_completed_tasks_value ());
-
- gtk_widget_set_sensitive (dialog_data->tasks_hide_completed_spinbutton,
- hide_completed_tasks);
- gtk_widget_set_sensitive (dialog_data->tasks_hide_completed_optionmenu,
- hide_completed_tasks);
-}
-
-/* Shows the current config settings in the dialog. */
-static void
-show_config (DialogData *dialog_data)
-{
- CalWeekdays working_days;
- gint mask, day, week_start_day, time_divisions;
- char *zone_name;
- icaltimezone *zone;
- gboolean sensitive;
-
- /* Timezone. */
- zone_name = calendar_config_get_timezone ();
- zone = icaltimezone_get_builtin_timezone (zone_name);
- e_timezone_entry_set_timezone (E_TIMEZONE_ENTRY (dialog_data->timezone),
- zone);
-
- /* Working Days. */
- working_days = calendar_config_get_working_days ();
- mask = 1 << 0;
- for (day = 0; day < 7; day++) {
- e_dialog_toggle_set (dialog_data->working_days[day], (working_days & mask) ? TRUE : FALSE);
- mask <<= 1;
- }
-
- /* Week Start Day. */
- week_start_day = calendar_config_get_week_start_day ();
- e_dialog_option_menu_set (dialog_data->week_start_day, week_start_day,
- week_start_day_map);
-
- /* Start of Day. */
- e_date_edit_set_time_of_day (E_DATE_EDIT (dialog_data->start_of_day),
- calendar_config_get_day_start_hour (),
- calendar_config_get_day_start_minute ());
-
- /* End of Day. */
- e_date_edit_set_time_of_day (E_DATE_EDIT (dialog_data->end_of_day),
- calendar_config_get_day_end_hour (),
- calendar_config_get_day_end_minute ());
-
- /* 12/24 Hour Format. */
- if (calendar_config_get_24_hour_format ())
- e_dialog_toggle_set (dialog_data->use_24_hour, TRUE);
- else
- e_dialog_toggle_set (dialog_data->use_12_hour, TRUE);
-
- sensitive = calendar_config_locale_supports_12_hour_format ();
- gtk_widget_set_sensitive (dialog_data->use_12_hour, sensitive);
- gtk_widget_set_sensitive (dialog_data->use_24_hour, sensitive);
-
-
- /* Time Divisions. */
- time_divisions = calendar_config_get_time_divisions ();
- e_dialog_option_menu_set (dialog_data->time_divisions, time_divisions,
- time_division_map);
-
- /* Show Appointment End Times. */
- e_dialog_toggle_set (dialog_data->show_end_times, calendar_config_get_show_event_end ());
-
- /* Compress Weekend. */
- e_dialog_toggle_set (dialog_data->compress_weekend, calendar_config_get_compress_weekend ());
-
- /* Date Navigator - Show Week Numbers. */
- e_dialog_toggle_set (dialog_data->dnav_show_week_no, calendar_config_get_dnav_show_week_no ());
-
- /* Task list */
-
- show_task_list_config (dialog_data);
-
- /* Other page */
-
- e_dialog_toggle_set (dialog_data->confirm_delete, calendar_config_get_confirm_delete ());
-
- e_dialog_toggle_set (dialog_data->default_reminder,
- calendar_config_get_use_default_reminder ());
- e_dialog_spin_set (dialog_data->default_reminder_interval,
- calendar_config_get_default_reminder_interval ());
- e_dialog_option_menu_set (dialog_data->default_reminder_units,
- calendar_config_get_default_reminder_units (),
- default_reminder_units_map);
-}
-
-/* Returns a pointer to a static string with an X color spec for the current
- * value of a color picker.
- */
-static const char *
-spec_from_picker (GtkWidget *picker)
-{
- static char spec[8];
- guint8 r, g, b;
-
- gnome_color_picker_get_i8 (GNOME_COLOR_PICKER (picker), &r, &g, &b, NULL);
- g_snprintf (spec, sizeof (spec), "#%02x%02x%02x", r, g, b);
-
- return spec;
-}
-
-/* Updates the task list config values from the settings in the dialog */
-static void
-update_task_list_config (DialogData *dialog_data)
-{
- calendar_config_set_tasks_due_today_color (spec_from_picker (dialog_data->tasks_due_today_color));
- calendar_config_set_tasks_overdue_color (spec_from_picker (dialog_data->tasks_overdue_color));
-
- calendar_config_set_hide_completed_tasks (e_dialog_toggle_get (dialog_data->tasks_hide_completed_checkbutton));
- calendar_config_set_hide_completed_tasks_units (e_dialog_option_menu_get (dialog_data->tasks_hide_completed_optionmenu, hide_completed_units_map));
- calendar_config_set_hide_completed_tasks_value (e_dialog_spin_get_int (dialog_data->tasks_hide_completed_spinbutton));
-}
-
-/* Updates the config values based on the settings in the dialog. */
-static void
-update_config (DialogData *dialog_data)
-{
- CalWeekdays working_days;
- gint mask, day, week_start_day, time_divisions, hour, minute;
- icaltimezone *zone;
-
- /* Timezone. */
- zone = e_timezone_entry_get_timezone (E_TIMEZONE_ENTRY (dialog_data->timezone));
- calendar_config_set_timezone (icaltimezone_get_location (zone));
-
- /* Working Days. */
- working_days = 0;
- mask = 1 << 0;
- for (day = 0; day < 7; day++) {
- if (e_dialog_toggle_get (dialog_data->working_days[day]))
- working_days |= mask;
- mask <<= 1;
- }
- calendar_config_set_working_days (working_days);
-
- /* Week Start Day. */
- week_start_day = e_dialog_option_menu_get (dialog_data->week_start_day, week_start_day_map);
- calendar_config_set_week_start_day (week_start_day);
-
- /* Start of Day. */
- e_date_edit_get_time_of_day (E_DATE_EDIT (dialog_data->start_of_day), &hour, &minute);
- calendar_config_set_day_start_hour (hour);
- calendar_config_set_day_start_minute (minute);
-
- /* End of Day. */
- e_date_edit_get_time_of_day (E_DATE_EDIT (dialog_data->end_of_day), &hour, &minute);
- calendar_config_set_day_end_hour (hour);
- calendar_config_set_day_end_minute (minute);
-
- /* 12/24 Hour Format. */
- calendar_config_set_24_hour_format (e_dialog_toggle_get (dialog_data->use_24_hour));
-
- /* Time Divisions. */
- time_divisions = e_dialog_option_menu_get (dialog_data->time_divisions, time_division_map);
- calendar_config_set_time_divisions (time_divisions);
-
- /* Show Appointment End Times. */
- calendar_config_set_show_event_end (e_dialog_toggle_get (dialog_data->show_end_times));
-
- /* Compress Weekend. */
- calendar_config_set_compress_weekend (e_dialog_toggle_get (dialog_data->compress_weekend));
-
- /* Date Navigator - Show Week Numbers. */
- calendar_config_set_dnav_show_week_no (e_dialog_toggle_get (dialog_data->dnav_show_week_no));
-
- /* Task list */
- update_task_list_config (dialog_data);
-
- /* Other page */
-
- calendar_config_set_confirm_delete (e_dialog_toggle_get (dialog_data->confirm_delete));
-
- calendar_config_set_use_default_reminder (e_dialog_toggle_get (dialog_data->default_reminder));
-
- calendar_config_set_default_reminder_interval (
- e_dialog_spin_get_int (dialog_data->default_reminder_interval));
-
- calendar_config_set_default_reminder_units (
- e_dialog_option_menu_get (dialog_data->default_reminder_units, default_reminder_units_map));
-}
diff --git a/calendar/gui/dialogs/cal-prefs-dialog.glade b/calendar/gui/dialogs/cal-prefs-dialog.glade
deleted file mode 100644
index d566368611..0000000000
--- a/calendar/gui/dialogs/cal-prefs-dialog.glade
+++ /dev/null
@@ -1,1319 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-<requires lib="gnome"/>
-
-<widget class="GtkDialog" id="cal-prefs-dialog">
- <property name="title" translatable="yes">Calendar and Tasks Settings</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="has_separator">True</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="vbox1">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="hbuttonbox1">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="button1">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button2">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-apply</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button3">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-close</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkNotebook" id="toplevel-notebook">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="show_tabs">True</property>
- <property name="show_border">True</property>
- <property name="tab_pos">GTK_POS_TOP</property>
- <property name="scrollable">False</property>
- <property name="enable_popup">False</property>
-
- <child>
- <widget class="GtkVBox" id="vbox10">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkFrame" id="frame12">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkTable" id="table5">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">3</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label22">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Time _zone:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">timezone</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label20">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Time format:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox10">
- <property name="visible">True</property>
- <property name="homogeneous">True</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="GtkAlignment" id="alignment2">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xscale">3.35276e-08</property>
- <property name="yscale">1</property>
-
- <child>
- <widget class="GtkRadioButton" id="use_12_hour">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_12 hour (AM/PM)</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="use_24_hour">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_24 hour</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">use_12_hour</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="timezone">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="creation_function">make_timezone_entry</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Wed, 20 Jun 2001 02:22:46 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">3</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Time</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFrame" id="frame9">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkTable" id="table8">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="n_rows">3</property>
- <property name="n_columns">4</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label33">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Day begins:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox18">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
-
- <child>
- <widget class="Custom" id="start_of_day">
- <property name="visible">True</property>
- <property name="creation_function">cal_prefs_dialog_create_time_edit</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Thu, 30 May 2002 19:26:53 GMT</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label34">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Day _ends:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_RIGHT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="end_of_day">
- <property name="visible">True</property>
- <property name="creation_function">cal_prefs_dialog_create_time_edit</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Thu, 30 May 2002 19:27:35 GMT</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">4</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox17">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkCheckButton" id="mon_button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Mon</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="tue_button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Tue</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="wed_button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Wed</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="thu_button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">T_hu</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="fri_button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Fri</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="sat_button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Sat</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="sun_button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">S_un</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">4</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment3">
- <property name="visible">True</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">1</property>
-
- <child>
- <widget class="GtkOptionMenu" id="first_day_of_week">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget1">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget2">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Monday</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget3">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Tuesday</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget4">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Wednesday</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget5">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Thursday</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget6">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Friday</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget7">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Saturday</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget8">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Sunday</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label32">
- <property name="visible">True</property>
- <property name="label" translatable="yes">W_eek starts:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">first_day_of_week</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label31">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Work days:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label23">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Work Week</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFrame" id="frame14">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkVBox" id="vbox13">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkCheckButton" id="confirm-delete">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Ask for confirmation when deleting items</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox19">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
-
- <child>
- <widget class="GtkCheckButton" id="default-reminder">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Sh_ow a reminder</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkSpinButton" id="default-reminder-interval">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">False</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">0 0 9999 1 10 10</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment4">
- <property name="visible">True</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
-
- <child>
- <widget class="GtkOptionMenu" id="default-reminder-units">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget9">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget10">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Minutes</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget11">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Hours</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget12">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Days</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label35">
- <property name="visible">True</property>
- <property name="label" translatable="yes">before every appointment</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label35">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Alerts</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label21">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_General</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox8">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkHBox" id="hbox12">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label25">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Time divisions:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">time_divisions</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkOptionMenu" id="time_divisions">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget13">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget14">
- <property name="visible">True</property>
- <property name="label" translatable="yes">60 minutes</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget15">
- <property name="visible">True</property>
- <property name="label" translatable="yes">30 minutes</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget16">
- <property name="visible">True</property>
- <property name="label" translatable="yes">15 minutes</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget17">
- <property name="visible">True</property>
- <property name="label" translatable="yes">10 minutes</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget18">
- <property name="visible">True</property>
- <property name="label" translatable="yes">05 minutes</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="show_end_times">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Show appointment end times in week and month views</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="compress_weekend">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Compress weekends in month view</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="dnav_show_week_no">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Show week _numbers in date navigator</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFrame" id="frame13">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkVBox" id="vbox12">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkTable" id="table7">
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label28">
- <property name="visible">True</property>
- <property name="label" translatable="yes">T_asks due today:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">tasks_due_today_color</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label29">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Overdue tasks:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">tasks_overdue_color</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GnomeColorPicker" id="tasks_overdue_color">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="dither">True</property>
- <property name="use_alpha">False</property>
- <property name="title" translatable="yes">Color for overdue tasks</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GnomeColorPicker" id="tasks_due_today_color">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="dither">True</property>
- <property name="use_alpha">False</property>
- <property name="title" translatable="yes">Color for tasks due today</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox15">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkCheckButton" id="tasks-hide-completed-checkbutton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Hide completed tasks after</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkSpinButton" id="tasks-hide-completed-spinbutton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">False</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">1 0 9999 1 10 10</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkOptionMenu" id="tasks-hide-completed-optionmenu">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget19">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget20">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Minutes</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget21">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Hours</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget22">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Days</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label36">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Task List</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label7">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Display</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/calendar/gui/dialogs/cal-prefs-dialog.h b/calendar/gui/dialogs/cal-prefs-dialog.h
deleted file mode 100644
index db6f5a75fa..0000000000
--- a/calendar/gui/dialogs/cal-prefs-dialog.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Author :
- * Damon Chaplin <damon@ximian.com>
- *
- * Copyright 2000, Ximian, Inc.
- * Copyright 2000, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-/*
- * CalPrefsDialog - a GtkObject which handles a libglade-loaded dialog
- * to edit the calendar preference settings.
- */
-
-#ifndef _CAL_PREFS_DIALOG_H_
-#define _CAL_PREFS_DIALOG_H_
-
-#include "evolution-config-control.h"
-
-G_BEGIN_DECLS
-
-EvolutionConfigControl *cal_prefs_dialog_new (void);
-
-G_END_DECLS
-
-#endif /* _CAL_PREFS_DIALOG_H_ */
diff --git a/calendar/gui/dialogs/cancel-comp.c b/calendar/gui/dialogs/cancel-comp.c
deleted file mode 100644
index 27f9b9b91e..0000000000
--- a/calendar/gui/dialogs/cancel-comp.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/* Evolution calendar - Send calendar component dialog
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Author: JP Rosevear <jpr@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <glib.h>
-#include <gtk/gtkmessagedialog.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnomeui/gnome-uidefs.h>
-#include "cancel-comp.h"
-
-
-
-/**
- * cancel_component_dialog:
- *
- * Pops up a dialog box asking the user whether he wants to send a
- * cancel and delete an iTip/iMip message
- *
- * Return value: TRUE if the user clicked Yes, FALSE otherwise.
- **/
-gboolean
-cancel_component_dialog (GtkWindow *parent, ECal *client, ECalComponent *comp, gboolean deleting)
-{
- GtkWidget *dialog;
- ECalComponentVType vtype;
- char *str;
- gint response;
-
- if (deleting && e_cal_get_save_schedules (client))
- return TRUE;
-
- vtype = e_cal_component_get_vtype (comp);
-
- switch (vtype) {
- case E_CAL_COMPONENT_EVENT:
- if (deleting)
- str = g_strdup_printf (_("The event being deleted is a meeting, "
- "would you like to send a cancellation notice?"));
- else
- str = g_strdup_printf (_("Are you sure you want to cancel "
- "and delete this meeting?"));
- break;
-
- case E_CAL_COMPONENT_TODO:
- if (deleting)
- str = g_strdup_printf (_("The task being deleted is assigned, "
- "would you like to send a cancellation notice?"));
- else
- str = g_strdup_printf (_("Are you sure you want to cancel "
- "and delete this task?"));
- break;
-
- case E_CAL_COMPONENT_JOURNAL:
- if (deleting)
- str = g_strdup_printf (_("The journal entry being deleted is published, "
- "would you like to send a cancellation notice?"));
- else
- str = g_strdup_printf (_("Are you sure you want to cancel "
- "and delete this journal entry?"));
- break;
-
- default:
- g_message ("cancel_component_dialog(): "
- "Cannot handle object of type %d", vtype);
- return FALSE;
- }
-
- dialog = gtk_message_dialog_new (parent, GTK_DIALOG_MODAL,
- GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_YES_NO, str);
-
- response = gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
-
- if (response == GTK_RESPONSE_YES)
- return TRUE;
- else
- return FALSE;
-}
diff --git a/calendar/gui/dialogs/cancel-comp.h b/calendar/gui/dialogs/cancel-comp.h
deleted file mode 100644
index a43f24f2fe..0000000000
--- a/calendar/gui/dialogs/cancel-comp.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Evolution calendar - Send calendar component dialog
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Author: JP Rosevear <jpr@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef CANCEL_COMP_H
-#define CANCEL_COMP_H
-
-#include <glib.h>
-#include <libecal/e-cal.h>
-#include <libecal/e-cal-component.h>
-
-gboolean cancel_component_dialog (GtkWindow *parent, ECal *client, ECalComponent *comp, gboolean deleting);
-
-#endif
diff --git a/calendar/gui/dialogs/changed-comp.c b/calendar/gui/dialogs/changed-comp.c
deleted file mode 100644
index af595fe1df..0000000000
--- a/calendar/gui/dialogs/changed-comp.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/* Evolution calendar - Send calendar component dialog
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Author: JP Rosevear <jpr@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <glib.h>
-#include <gtk/gtkmessagedialog.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnomeui/gnome-uidefs.h>
-#include "changed-comp.h"
-
-
-
-/**
- * changed_component_dialog:
- * @parent: Parent window for the dialog.
- * @comp: A calendar component
- * @deleted: Whether the object is being deleted or updated
- * @changed: Whether or not the user has made changes
- *
- * Pops up a dialog box asking the user whether changes made (if any)
- * should be thrown away because the item has been updated elsewhere
- *
- * Return value: TRUE if the user clicked Yes, FALSE otherwise.
- **/
-gboolean
-changed_component_dialog (GtkWindow *parent, ECalComponent *comp, gboolean deleted, gboolean changed)
-{
- GtkWidget *dialog;
- ECalComponentVType vtype;
- char *str;
- gint response;
-
- vtype = e_cal_component_get_vtype (comp);
-
- if (deleted) {
- switch (vtype) {
- case E_CAL_COMPONENT_EVENT:
- str = _("This event has been deleted.");
- break;
-
- case E_CAL_COMPONENT_TODO:
- str = _("This task has been deleted.");
- break;
-
- case E_CAL_COMPONENT_JOURNAL:
- str = _("This journal entry has been deleted.");
- break;
-
- default:
- g_message ("changed_component_dialog(): "
- "Cannot handle object of type %d", vtype);
- return FALSE;
- }
- if (changed)
- str = g_strdup_printf (_("%s You have made changes. Forget those changes and close the editor?"), str);
- else
- str = g_strdup_printf (_("%s You have made no changes, close the editor?"), str);
-
- } else {
- switch (vtype) {
- case E_CAL_COMPONENT_EVENT:
- str = _("This event has been changed.");
- break;
-
- case E_CAL_COMPONENT_TODO:
- str = _("This task has been changed.");
- break;
-
- case E_CAL_COMPONENT_JOURNAL:
- str = _("This journal entry has been changed.");
- break;
-
- default:
- g_message ("changed_component_dialog(): "
- "Cannot handle object of type %d", vtype);
- return FALSE;
- }
- if (changed)
- str = g_strdup_printf (_("%s You have made changes. Forget those changes and update the editor?"), str);
- else
- str = g_strdup_printf (_("%s You have made no changes, update the editor?"), str);
- }
-
- dialog = gtk_message_dialog_new (parent, GTK_DIALOG_MODAL,
- GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_YES_NO, str);
-
- response = gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
-
- if (response == GTK_RESPONSE_YES)
- return TRUE;
- else
- return FALSE;
-}
diff --git a/calendar/gui/dialogs/changed-comp.h b/calendar/gui/dialogs/changed-comp.h
deleted file mode 100644
index f029f3388e..0000000000
--- a/calendar/gui/dialogs/changed-comp.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Evolution calendar - Changed calendar component dialog
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Author: JP Rosevear <jpr@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef CHANGED_COMP_H
-#define CHANGED_COMP_H
-
-#include <glib.h>
-#include <gtk/gtkwindow.h>
-#include <libecal/e-cal-component.h>
-
-gboolean changed_component_dialog (GtkWindow *window, ECalComponent *comp, gboolean deleted, gboolean changed);
-
-#endif
diff --git a/calendar/gui/dialogs/comp-editor-page.c b/calendar/gui/dialogs/comp-editor-page.c
deleted file mode 100644
index 64771bebed..0000000000
--- a/calendar/gui/dialogs/comp-editor-page.c
+++ /dev/null
@@ -1,416 +0,0 @@
-/* Evolution calendar - Base class for calendar component editor pages
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Authors: Federico Mena-Quintero <federico@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <gtk/gtksignal.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnomeui/gnome-dialog.h>
-#include <libgnomeui/gnome-dialog-util.h>
-#include "comp-editor-page.h"
-
-
-
-static void comp_editor_page_class_init (CompEditorPageClass *class);
-static void comp_editor_page_init (CompEditorPage *page);
-static void comp_editor_page_destroy (GtkObject *object);
-
-static GtkObjectClass *parent_class = NULL;
-
-/* Signal IDs */
-
-enum {
- CHANGED,
- NEEDS_SEND,
- SUMMARY_CHANGED,
- DATES_CHANGED,
- LAST_SIGNAL
-};
-
-static guint comp_editor_page_signals[LAST_SIGNAL];
-
-#define CLASS(page) (COMP_EDITOR_PAGE_CLASS (G_OBJECT_GET_CLASS (page)))
-
-
-
-/**
- * comp_editor_page_get_type:
- *
- * Registers the #CompEditorPage class if necessary, and returns the type ID
- * associated to it.
- *
- * Return value: The type ID of the #CompEditorPage class.
- **/
-GtkType
-comp_editor_page_get_type (void)
-{
- static GtkType comp_editor_page_type = 0;
-
- if (!comp_editor_page_type) {
- static const GtkTypeInfo comp_editor_page_info = {
- "CompEditorPage",
- sizeof (CompEditorPage),
- sizeof (CompEditorPageClass),
- (GtkClassInitFunc) comp_editor_page_class_init,
- (GtkObjectInitFunc) comp_editor_page_init,
- NULL, /* reserved_1 */
- NULL, /* reserved_2 */
- (GtkClassInitFunc) NULL
- };
-
- comp_editor_page_type =
- gtk_type_unique (GTK_TYPE_OBJECT,
- &comp_editor_page_info);
- }
-
- return comp_editor_page_type;
-}
-
-/* Class initialization function for the abstract editor page */
-static void
-comp_editor_page_class_init (CompEditorPageClass *class)
-{
- GtkObjectClass *object_class;
-
- object_class = (GtkObjectClass *) class;
-
- parent_class = g_type_class_ref(GTK_TYPE_OBJECT);
-
- comp_editor_page_signals[CHANGED] =
- g_signal_new ("changed",
- G_TYPE_FROM_CLASS (class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (CompEditorPageClass, changed),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- comp_editor_page_signals[NEEDS_SEND] =
- g_signal_new ("needs_send",
- G_TYPE_FROM_CLASS (class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (CompEditorPageClass, needs_send),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- comp_editor_page_signals[SUMMARY_CHANGED] =
- g_signal_new ("summary_changed",
- G_TYPE_FROM_CLASS (class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (CompEditorPageClass, summary_changed),
- NULL, NULL,
- g_cclosure_marshal_VOID__POINTER,
- G_TYPE_NONE, 1, G_TYPE_POINTER);
-
- comp_editor_page_signals[DATES_CHANGED] =
- g_signal_new ("dates_changed",
- G_TYPE_FROM_CLASS (class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (CompEditorPageClass, dates_changed),
- NULL, NULL,
- g_cclosure_marshal_VOID__POINTER,
- G_TYPE_NONE, 1, G_TYPE_POINTER);
-
- class->changed = NULL;
- class->summary_changed = NULL;
- class->dates_changed = NULL;
-
- class->get_widget = NULL;
- class->focus_main_widget = NULL;
- class->fill_widgets = NULL;
- class->fill_component = NULL;
- class->set_summary = NULL;
- class->set_dates = NULL;
-
- object_class->destroy = comp_editor_page_destroy;
-}
-
-
-
-static void
-comp_editor_page_init (CompEditorPage *page)
-{
- page->client = NULL;
- page->accel_group = NULL;
-}
-
-
-static void
-comp_editor_page_destroy (GtkObject *object)
-{
- CompEditorPage *page;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (IS_COMP_EDITOR_PAGE (object));
-
- page = COMP_EDITOR_PAGE (object);
-
- if (page->client) {
- g_object_unref (page->client);
- page->client = NULL;
- }
-
- if (page->accel_group) {
- gtk_accel_group_unref (page->accel_group);
- page->accel_group = NULL;
- }
-
- if (GTK_OBJECT_CLASS (parent_class)->destroy)
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
-}
-
-
-/**
- * comp_editor_page_get_widget:
- * @page: An editor page.
- *
- * Queries the main widget of an editor page.
- *
- * Return value: The widget that is the page's upper container. It should
- * normally be inserted in a notebook widget.
- **/
-GtkWidget *
-comp_editor_page_get_widget (CompEditorPage *page)
-{
- g_return_val_if_fail (page != NULL, NULL);
- g_return_val_if_fail (IS_COMP_EDITOR_PAGE (page), NULL);
-
- g_assert (CLASS (page)->get_widget != NULL);
- return (* CLASS (page)->get_widget) (page);
-}
-
-/**
- * comp_editor_page_focus_main_widget:
- * @page: An editor page.
- *
- * Makes an editor page focus its main widget. This is used by the component
- * editor when it first pops up so that it can focus the main widget in the
- * first page.
- **/
-void
-comp_editor_page_focus_main_widget (CompEditorPage *page)
-{
- g_return_if_fail (page != NULL);
- g_return_if_fail (IS_COMP_EDITOR_PAGE (page));
-
- g_assert (CLASS (page)->focus_main_widget != NULL);
- (* CLASS (page)->focus_main_widget) (page);
-}
-
-/**
- * comp_editor_page_fill_widgets:
- * @page: An editor page.
- * @comp: A calendar component.
- *
- * Fills the widgets of an editor page with the data from a calendar component.
- **/
-void
-comp_editor_page_fill_widgets (CompEditorPage *page, ECalComponent *comp)
-{
- g_return_if_fail (page != NULL);
- g_return_if_fail (IS_COMP_EDITOR_PAGE (page));
- g_return_if_fail (comp != NULL);
-
- g_assert (CLASS (page)->fill_widgets != NULL);
- (* CLASS (page)->fill_widgets) (page, comp);
-}
-
-/**
- * comp_editor_page_fill_component:
- * @page: An editor page.
- * @comp: A calendar component.
- *
- * Takes the data from the widgets of an editor page and sets it on a calendar
- * component, replacing the contents of the properties that the editor page
- * knows how to manipulate.
- *
- * Returns: TRUE if the component could be filled, FALSE otherwise
- **/
-gboolean
-comp_editor_page_fill_component (CompEditorPage *page, ECalComponent *comp)
-{
- g_return_val_if_fail (page != NULL, FALSE);
- g_return_val_if_fail (IS_COMP_EDITOR_PAGE (page), FALSE);
- g_return_val_if_fail (comp != NULL, FALSE);
-
- if (CLASS (page)->fill_component != NULL)
- return (* CLASS (page)->fill_component) (page, comp);
-
- return TRUE;
-}
-
-/**
- * comp_editor_page_set_e_cal:
- * @page: An editor page
- * @client: A #ECal object
- *
- * Sets the #ECal for the dialog page to use.
- **/
-void
-comp_editor_page_set_e_cal (CompEditorPage *page, ECal *client)
-{
- g_return_if_fail (page != NULL);
- g_return_if_fail (IS_COMP_EDITOR_PAGE (page));
-
- if (page->client)
- g_object_unref (client);
-
- page->client = client;
- if (page->client)
- g_object_ref (client);
-}
-
-/**
- * comp_editor_page_set_summary:
- * @page: An editor page
- * @summary: The text of the new summary value
- *
- * Sets the summary value for this group of widgets
- **/
-void
-comp_editor_page_set_summary (CompEditorPage *page, const char *summary)
-{
- g_return_if_fail (page != NULL);
- g_return_if_fail (IS_COMP_EDITOR_PAGE (page));
-
- if (CLASS (page)->set_summary != NULL)
- (* CLASS (page)->set_summary) (page, summary);
-}
-
-/**
- * comp_editor_page_set_dates:
- * @page: An editor page
- * @dates: A collection of various dates in time_t format
- *
- * Sets the date values for this group of widgets
- **/
-void
-comp_editor_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates)
-{
- g_return_if_fail (page != NULL);
- g_return_if_fail (IS_COMP_EDITOR_PAGE (page));
-
- if (CLASS (page)->set_dates != NULL)
- (* CLASS (page)->set_dates) (page, dates);
-}
-
-/**
- * comp_editor_page_notify_changed:
- * @page: An editor page.
- *
- * Makes an editor page emit the "changed" signal. This is meant to be
- * used only by page implementations.
- **/
-void
-comp_editor_page_notify_changed (CompEditorPage *page)
-{
- g_return_if_fail (page != NULL);
- g_return_if_fail (IS_COMP_EDITOR_PAGE (page));
-
- gtk_signal_emit (GTK_OBJECT (page), comp_editor_page_signals[CHANGED]);
-}
-
-/**
- * comp_editor_page_notify_needs_send:
- * @page:
- *
- *
- **/
-void
-comp_editor_page_notify_needs_send (CompEditorPage *page)
-{
- g_return_if_fail (page != NULL);
- g_return_if_fail (IS_COMP_EDITOR_PAGE (page));
-
- gtk_signal_emit (GTK_OBJECT (page), comp_editor_page_signals[NEEDS_SEND]);
-}
-
-/**
- * comp_editor_page_notify_summary_changed:
- * @page: An editor page.
- *
- * Makes an editor page emit the "summary_changed" signal. This is meant to be
- * used only by page implementations.
- **/
-void
-comp_editor_page_notify_summary_changed (CompEditorPage *page,
- const char *summary)
-{
- g_return_if_fail (page != NULL);
- g_return_if_fail (IS_COMP_EDITOR_PAGE (page));
-
-
- gtk_signal_emit (GTK_OBJECT (page),
- comp_editor_page_signals[SUMMARY_CHANGED],
- summary);
-}
-
-/**
- * comp_editor_page_notify_dates_changed:
- * @page: An editor page.
- *
- * Makes an editor page emit the "dates_changed" signal. This is meant to be
- * used only by page implementations.
- **/
-void
-comp_editor_page_notify_dates_changed (CompEditorPage *page,
- CompEditorPageDates *dates)
-{
- g_return_if_fail (page != NULL);
- g_return_if_fail (IS_COMP_EDITOR_PAGE (page));
-
- gtk_signal_emit (GTK_OBJECT (page),
- comp_editor_page_signals[DATES_CHANGED],
- dates);
-}
-
-/**
- * comp_editor_page_display_validation_error:
- * @page: An editor page.
- * @msg: Error message to display.
- * @field: Widget that caused the validation error.
- *
- * Displays an error message about a validation problem in the
- * given field. Once the error message has been displayed, the
- * focus is set to the widget that caused the validation error.
- */
-void
-comp_editor_page_display_validation_error (CompEditorPage *page,
- const char *msg,
- GtkWidget *field)
-{
- GtkWidget *dialog;
- char *real_msg;
-
- g_return_if_fail (IS_COMP_EDITOR_PAGE (page));
- g_return_if_fail (msg != NULL);
- g_return_if_fail (GTK_IS_WIDGET (field));
-
- real_msg = g_strdup_printf (_("Validation error: %s"), msg);
- dialog = gnome_error_dialog (real_msg);
- gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
-
- gtk_widget_grab_focus (field);
-
- g_free (real_msg);
-}
diff --git a/calendar/gui/dialogs/comp-editor-page.h b/calendar/gui/dialogs/comp-editor-page.h
deleted file mode 100644
index 6046a7c039..0000000000
--- a/calendar/gui/dialogs/comp-editor-page.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/* Evolution calendar - Base class for calendar component editor pages
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Authors: Federico Mena-Quintero <federico@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef COMP_EDITOR_PAGE_H
-#define COMP_EDITOR_PAGE_H
-
-#include <time.h>
-#include <gtk/gtkwidget.h>
-#include <libecal/e-cal-component.h>
-#include <libecal/e-cal.h>
-
-G_BEGIN_DECLS
-
-
-
-#define TYPE_COMP_EDITOR_PAGE (comp_editor_page_get_type ())
-#define COMP_EDITOR_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_COMP_EDITOR_PAGE, CompEditorPage))
-#define COMP_EDITOR_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_COMP_EDITOR_PAGE, CompEditorPageClass))
-#define IS_COMP_EDITOR_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_COMP_EDITOR_PAGE))
-#define IS_COMP_EDITOR_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), TYPE_COMP_EDITOR_PAGE))
-
-typedef struct {
- ECalComponentDateTime *start;
- ECalComponentDateTime *end;
- ECalComponentDateTime *due;
- struct icaltimetype *complete;
-} CompEditorPageDates;
-
-typedef struct {
- GtkObject object;
-
- /* Some of the pages need the ECal to access timezone data. */
- ECal *client;
-
- /* The GtkAccelGroup for the page. We install this when the page is
- mapped, and uninstall when it is unmapped. libglade would do this
- normally, but we create our pages individually so have to do it
- ourselves. */
- GtkAccelGroup *accel_group;
-} CompEditorPage;
-
-typedef struct {
- GtkObjectClass parent_class;
-
- /* Notification signals */
-
- void (* changed) (CompEditorPage *page);
- void (* needs_send) (CompEditorPage *page);
-
- void (* summary_changed) (CompEditorPage *page, const char *summary);
- void (* dates_changed) (CompEditorPage *page, const char *dates);
-
- /* Virtual methods */
-
- GtkWidget *(* get_widget) (CompEditorPage *page);
- void (* focus_main_widget) (CompEditorPage *page);
-
- void (* fill_widgets) (CompEditorPage *page, ECalComponent *comp);
- gboolean (* fill_component) (CompEditorPage *page, ECalComponent *comp);
-
- void (* set_summary) (CompEditorPage *page, const char *summary);
- void (* set_dates) (CompEditorPage *page, CompEditorPageDates *dates);
-} CompEditorPageClass;
-
-
-GtkType comp_editor_page_get_type (void);
-GtkWidget *comp_editor_page_get_widget (CompEditorPage *page);
-void comp_editor_page_focus_main_widget (CompEditorPage *page);
-void comp_editor_page_fill_widgets (CompEditorPage *page,
- ECalComponent *comp);
-gboolean comp_editor_page_fill_component (CompEditorPage *page,
- ECalComponent *comp);
-void comp_editor_page_set_e_cal (CompEditorPage *page,
- ECal *client);
-void comp_editor_page_set_summary (CompEditorPage *page,
- const char *summary);
-void comp_editor_page_set_dates (CompEditorPage *page,
- CompEditorPageDates *dates);
-void comp_editor_page_notify_changed (CompEditorPage *page);
-void comp_editor_page_notify_needs_send (CompEditorPage *page);
-void comp_editor_page_notify_summary_changed (CompEditorPage *page,
- const char *summary);
-void comp_editor_page_notify_dates_changed (CompEditorPage *page,
- CompEditorPageDates *dates);
-void comp_editor_page_display_validation_error (CompEditorPage *page,
- const char *msg,
- GtkWidget *field);
-
-
-
-
-G_END_DECLS
-
-#endif
diff --git a/calendar/gui/dialogs/comp-editor-util.c b/calendar/gui/dialogs/comp-editor-util.c
deleted file mode 100644
index bdb66c6c92..0000000000
--- a/calendar/gui/dialogs/comp-editor-util.c
+++ /dev/null
@@ -1,351 +0,0 @@
-/* Evolution calendar - Widget utilities
- *
- * Copyright (C) 2000 Ximian, Inc.
- *
- * Author: Federico Mena-Quintero <federico@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <ctype.h>
-#include <string.h>
-#include <libical/ical.h>
-#include <glib.h>
-#include <gtk/gtklabel.h>
-#include <libgnome/gnome-i18n.h>
-#include <bonobo-activation/bonobo-activation.h>
-#include <bonobo/bonobo-control.h>
-#include <bonobo/bonobo-widget.h>
-#include <e-util/e-time-utils.h>
-#include <libecal/e-cal-time-util.h>
-#include "../calendar-config.h"
-#include "../e-date-edit-config.h"
-#include "comp-editor-util.h"
-
-
-
-/**
- * comp_editor_dates:
- * @dates: A structure to be filled out with dates of a component
- * @comp: The component to extract the dates from
- *
- * Extracts the dates from the calendar component into the
- * CompEditorPageDates structure. Call comp_editor_free_dates() to free the
- * results.
- **/
-void
-comp_editor_dates (CompEditorPageDates *dates, ECalComponent *comp)
-{
- ECalComponentDateTime dt;
-
- dates->start = NULL;
- dates->end = NULL;
- dates->due = NULL;
- dates->complete = NULL;
-
- /* Note that the ECalComponentDateTime's returned contain allocated
- icaltimetype and tzid values, so we just take over ownership of
- those. */
- e_cal_component_get_dtstart (comp, &dt);
- if (dt.value) {
- dates->start = g_new (ECalComponentDateTime, 1);
- *dates->start = dt;
- }
-
- e_cal_component_get_dtend (comp, &dt);
- if (dt.value) {
- dates->end = g_new (ECalComponentDateTime, 1);
- *dates->end = dt;
- }
-
- e_cal_component_get_due (comp, &dt);
- if (dt.value) {
- dates->due = g_new (ECalComponentDateTime, 1);
- *dates->due = dt;
- }
-
- e_cal_component_get_completed (comp, &dates->complete);
-}
-
-
-/* This frees the dates in the CompEditorPageDates struct. But it doesn't free
- * the struct (as that is usually static).
- */
-void
-comp_editor_free_dates (CompEditorPageDates *dates)
-{
- /* Note that e_cal_component_free_datetime() only frees the fields in
- the struct. It doesn't free the struct itself, so we do that. */
- if (dates->start) {
- e_cal_component_free_datetime (dates->start);
- g_free (dates->start);
- }
-
- if (dates->end) {
- e_cal_component_free_datetime (dates->end);
- g_free (dates->end);
- }
-
- if (dates->due) {
- e_cal_component_free_datetime (dates->due);
- g_free (dates->due);
- }
-
- if (dates->complete)
- e_cal_component_free_icaltimetype (dates->complete);
-}
-
-
-/* dtstart is only passed in if tt is the dtend. */
-static void
-write_label_piece (struct icaltimetype *tt, char *buffer, int size,
- char *stext, char *etext, struct icaltimetype *dtstart)
-{
- struct tm tmp_tm = { 0 };
- struct icaltimetype tt_copy = *tt;
- int len;
-
- /* FIXME: May want to convert the time to an appropriate zone. */
-
- if (stext != NULL)
- strcat (buffer, stext);
-
- /* If we are writing the DTEND (i.e. DTSTART is set), and
- DTEND > DTSTART, subtract 1 day. The DTEND date is not inclusive. */
- if (tt_copy.is_date && dtstart
- && icaltime_compare_date_only (tt_copy, *dtstart) > 0) {
- icaltime_adjust (&tt_copy, -1, 0, 0, 0);
- }
-
- tmp_tm.tm_year = tt_copy.year - 1900;
- tmp_tm.tm_mon = tt_copy.month - 1;
- tmp_tm.tm_mday = tt_copy.day;
- tmp_tm.tm_hour = tt_copy.hour;
- tmp_tm.tm_min = tt_copy.minute;
- tmp_tm.tm_sec = tt_copy.second;
- tmp_tm.tm_isdst = -1;
-
- tmp_tm.tm_wday = time_day_of_week (tt_copy.day, tt_copy.month - 1,
- tt_copy.year);
-
- len = strlen (buffer);
- e_time_format_date_and_time (&tmp_tm,
- calendar_config_get_24_hour_format (),
- !tt_copy.is_date, FALSE,
- &buffer[len], size - len);
- if (etext != NULL)
- strcat (buffer, etext);
-}
-
-/**
- * comp_editor_date_label:
- * @dates: The dates to use in constructing a label
- * @label: The label whose text is to be set
- *
- * Set the text of a label based on the dates available and the user's
- * formatting preferences
- **/
-void
-comp_editor_date_label (CompEditorPageDates *dates, GtkWidget *label)
-{
- char buffer[1024];
- gboolean start_set = FALSE, end_set = FALSE;
- gboolean complete_set = FALSE, due_set = FALSE;
-
- buffer[0] = '\0';
-
- if (dates->start && !icaltime_is_null_time (*dates->start->value))
- start_set = TRUE;
- if (dates->end && !icaltime_is_null_time (*dates->end->value))
- end_set = TRUE;
- if (dates->complete && !icaltime_is_null_time (*dates->complete))
- complete_set = TRUE;
- if (dates->due && !icaltime_is_null_time (*dates->due->value))
- due_set = TRUE;
-
- if (start_set)
- write_label_piece (dates->start->value, buffer, 1024,
- NULL, NULL, NULL);
-
- if (start_set && end_set)
- write_label_piece (dates->end->value, buffer, 1024,
- _(" to "), NULL, dates->start->value);
-
- if (complete_set) {
- if (start_set)
- write_label_piece (dates->complete, buffer, 1024, _(" (Completed "), ")", NULL);
- else
- write_label_piece (dates->complete, buffer, 1024, _("Completed "), NULL, NULL);
- }
-
- if (due_set && dates->complete == NULL) {
- if (start_set)
- write_label_piece (dates->due->value, buffer, 1024, _(" (Due "), ")", NULL);
- else
- write_label_piece (dates->due->value, buffer, 1024, _("Due "), NULL, NULL);
- }
-
- gtk_label_set_text (GTK_LABEL (label), buffer);
-}
-
-static void
-date_edit_destroy_cb (EDateEdit *date_edit, gpointer data)
-{
- EDateEditConfig *config = data;
-
- g_object_unref (config);
-}
-
-/**
- * comp_editor_new_date_edit:
- * @show_date: Whether to show a date picker in the widget.
- * @show_time: Whether to show a time picker in the widget.
- * @make_time_insensitive: Whether the time field is made insensitive rather
- * than hiding it. This is useful if you want to preserve the layout of the
- * widgets.
- *
- * Creates a new #EDateEdit widget, configured using the calendar's preferences.
- *
- * Return value: A newly-created #EDateEdit widget.
- **/
-GtkWidget *
-comp_editor_new_date_edit (gboolean show_date, gboolean show_time,
- gboolean make_time_insensitive)
-{
- EDateEdit *dedit;
- EDateEditConfig *config;
-
- dedit = E_DATE_EDIT (e_date_edit_new ());
-
- e_date_edit_set_show_date (dedit, show_date);
- e_date_edit_set_show_time (dedit, show_time);
-#if 0
- e_date_edit_set_make_time_insensitive (dedit, make_time_insensitive);
-#else
- e_date_edit_set_make_time_insensitive (dedit, FALSE);
-#endif
-
- config = e_date_edit_config_new (dedit);
- g_signal_connect (G_OBJECT (dedit), "destroy", G_CALLBACK (date_edit_destroy_cb), config);
-
- return GTK_WIDGET (dedit);
-}
-
-
-/* Returns the current time, for EDateEdit widgets and ECalendar items in the
- dialogs.
- FIXME: Should probably use the timezone from somewhere in the component
- rather than the current timezone. */
-struct tm
-comp_editor_get_current_time (GtkObject *object, gpointer data)
-{
- char *location;
- icaltimezone *zone;
- struct icaltimetype tt;
- struct tm tmp_tm = { 0 };
-
- /* Get the current timezone. */
- location = calendar_config_get_timezone ();
- zone = icaltimezone_get_builtin_timezone (location);
-
- tt = icaltime_from_timet_with_zone (time (NULL), FALSE, zone);
-
- /* Now copy it to the struct tm and return it. */
- tmp_tm.tm_year = tt.year - 1900;
- tmp_tm.tm_mon = tt.month - 1;
- tmp_tm.tm_mday = tt.day;
- tmp_tm.tm_hour = tt.hour;
- tmp_tm.tm_min = tt.minute;
- tmp_tm.tm_sec = tt.second;
- tmp_tm.tm_isdst = -1;
-
- return tmp_tm;
-}
-
-
-
-/**
- * comp_editor_strip_categories:
- * @categories: A string of category names entered by the user.
- *
- * Takes a string of the form "categ, categ, categ, ..." and removes the
- * whitespace between categories to result in "categ,categ,categ,..."
- *
- * Return value: The category names stripped of surrounding whitespace
- * and separated with commas.
- **/
-char *
-comp_editor_strip_categories (const char *categories)
-{
- char *new_categories;
- const char *start, *end;
- const char *p;
- char *new_p;
-
- if (!categories)
- return NULL;
-
- new_categories = g_new (char, strlen (categories) + 1);
-
- start = end = NULL;
- new_p = new_categories;
-
- for (p = categories; *p; p++) {
- int c;
-
- c = *p;
-
- if (isspace (c))
- continue;
- else if (c == ',') {
- int len;
-
- if (!start)
- continue;
-
- g_assert (start <= end);
-
- len = end - start + 1;
- strncpy (new_p, start, len);
- new_p[len] = ',';
- new_p += len + 1;
-
- start = end = NULL;
- } else {
- if (!start) {
- start = p;
- end = p;
- } else
- end = p;
- }
- }
-
- if (start) {
- int len;
-
- g_assert (start <= end);
-
- len = end - start + 1;
- strncpy (new_p, start, len);
- new_p += len;
- }
-
- *new_p = '\0';
-
- return new_categories;
-}
diff --git a/calendar/gui/dialogs/comp-editor-util.h b/calendar/gui/dialogs/comp-editor-util.h
deleted file mode 100644
index 078cd6508c..0000000000
--- a/calendar/gui/dialogs/comp-editor-util.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Evolution calendar - Widget utilities
- *
- * Copyright (C) 2000 Ximian, Inc.
- *
- * Author: JP Rosevear <jpr@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _COMP_EDITOR_UTIL_H_
-#define _COMP_EDITOR_UTIL_H_
-
-#include <gtk/gtkwidget.h>
-#include "comp-editor-page.h"
-
-void comp_editor_dates (CompEditorPageDates *date, ECalComponent *comp);
-void comp_editor_free_dates (CompEditorPageDates *dates);
-
-void comp_editor_date_label (CompEditorPageDates *dates, GtkWidget *label);
-
-GtkWidget *comp_editor_new_date_edit (gboolean show_date, gboolean show_time,
- gboolean make_time_insensitive);
-
-struct tm comp_editor_get_current_time (GtkObject *object, gpointer data);
-
-
-char *comp_editor_strip_categories (const char *categories);
-
-#endif
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c
deleted file mode 100644
index cd270eb423..0000000000
--- a/calendar/gui/dialogs/comp-editor.c
+++ /dev/null
@@ -1,1497 +0,0 @@
-/* Evolution calendar - Framework for a calendar component editor dialog
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Author: Federico Mena-Quintero <federico@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <glib.h>
-#include <gdk/gdkkeysyms.h>
-#include <gtk/gtkstock.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnomeui/gnome-uidefs.h>
-#include <libgnomeui/gnome-dialog.h>
-#include <libgnomeui/gnome-dialog-util.h>
-#include <libgnomeui/gnome-window-icon.h>
-#include <libgnomeui/gnome-messagebox.h>
-#include <bonobo/bonobo-ui-container.h>
-#include <bonobo/bonobo-ui-util.h>
-#include <e-util/e-dialog-utils.h>
-#include <evolution-shell-component-utils.h>
-#include "../print.h"
-#include "../comp-util.h"
-#include "save-comp.h"
-#include "delete-comp.h"
-#include "send-comp.h"
-#include "changed-comp.h"
-#include "cancel-comp.h"
-#include "recur-comp.h"
-#include "comp-editor.h"
-
-
-
-/* Private part of the CompEditor structure */
-struct _CompEditorPrivate {
- /* Client to use */
- ECal *client;
-
- /* Calendar object/uid we are editing; this is an internal copy */
- ECalComponent *comp;
-
- /* The pages we have */
- GList *pages;
-
- /* UI Component for the dialog */
- BonoboUIComponent *uic;
-
- /* Notebook to hold the pages */
- GtkNotebook *notebook;
-
- GtkWidget *filesel;
-
- gboolean changed;
- gboolean needs_send;
-
- CalObjModType mod;
-
- gboolean existing_org;
- gboolean user_org;
-
- gboolean warned;
-
- gboolean updating;
-};
-
-
-
-static void comp_editor_class_init (CompEditorClass *class);
-static void comp_editor_init (CompEditor *editor);
-static gint comp_editor_key_press_event (GtkWidget *d, GdkEventKey *e);
-static void comp_editor_finalize (GObject *object);
-
-static void real_set_e_cal (CompEditor *editor, ECal *client);
-static void real_edit_comp (CompEditor *editor, ECalComponent *comp);
-static gboolean real_send_comp (CompEditor *editor, ECalComponentItipMethod method);
-static gboolean prompt_to_save_changes (CompEditor *editor, gboolean send);
-static void delete_comp (CompEditor *editor);
-static void close_dialog (CompEditor *editor);
-
-static void page_changed_cb (GtkObject *obj, gpointer data);
-static void page_summary_changed_cb (GtkObject *obj, const char *summary, gpointer data);
-static void page_dates_changed_cb (GtkObject *obj, CompEditorPageDates *dates, gpointer data);
-
-static void obj_updated_cb (ECal *client, const char *uid, gpointer data);
-static void obj_removed_cb (ECal *client, const char *uid, gpointer data);
-
-static void save_cmd (GtkWidget *widget, gpointer data);
-static void save_close_cmd (GtkWidget *widget, gpointer data);
-static void save_as_cmd (GtkWidget *widget, gpointer data);
-static void delete_cmd (GtkWidget *widget, gpointer data);
-static void print_cmd (GtkWidget *widget, gpointer data);
-static void print_preview_cmd (GtkWidget *widget, gpointer data);
-static void print_setup_cmd (GtkWidget *widget, gpointer data);
-static void close_cmd (GtkWidget *widget, gpointer data);
-
-static gint delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer data);
-
-static EPixmap pixmaps [] =
-{
- E_PIXMAP ("/menu/File/FileSave", "save-16.png"),
- E_PIXMAP ("/menu/File/FileSaveAndClose", "save-16.png"),
- E_PIXMAP ("/menu/File/FileSaveAs", "save-as-16.png"),
-
- E_PIXMAP ("/menu/File/FileDelete", "evolution-trash-mini.png"),
-
- E_PIXMAP ("/menu/File/FilePrint", "print.xpm"),
- E_PIXMAP ("/menu/File/FilePrintPreview", "print-preview.xpm"),
-
- E_PIXMAP ("/Toolbar/FileSaveAndClose", "buttons/save-24.png"),
- E_PIXMAP ("/Toolbar/FilePrint", "buttons/print.png"),
- E_PIXMAP ("/Toolbar/FileDelete", "buttons/delete-message.png"),
-
- E_PIXMAP_END
-};
-
-static BonoboUIVerb verbs [] = {
- BONOBO_UI_UNSAFE_VERB ("FileSave", save_cmd),
- BONOBO_UI_UNSAFE_VERB ("FileSaveAndClose", save_close_cmd),
- BONOBO_UI_UNSAFE_VERB ("FileSaveAs", save_as_cmd),
- BONOBO_UI_UNSAFE_VERB ("FileDelete", delete_cmd),
- BONOBO_UI_UNSAFE_VERB ("FilePrint", print_cmd),
- BONOBO_UI_UNSAFE_VERB ("FilePrintPreview", print_preview_cmd),
- BONOBO_UI_UNSAFE_VERB ("FilePrintSetup", print_setup_cmd),
- BONOBO_UI_UNSAFE_VERB ("FileClose", close_cmd),
-
- BONOBO_UI_VERB_END
-};
-
-static GtkObjectClass *parent_class;
-
-
-
-E_MAKE_TYPE (comp_editor, "CompEditor", CompEditor, comp_editor_class_init, comp_editor_init,
- BONOBO_TYPE_WINDOW);
-
-/* Class initialization function for the calendar component editor */
-static void
-comp_editor_class_init (CompEditorClass *klass)
-{
- GObjectClass *object_class;
- GtkWidgetClass *widget_class;
-
- object_class = G_OBJECT_CLASS (klass);
- widget_class = GTK_WIDGET_CLASS (klass);
-
- parent_class = g_type_class_ref(BONOBO_TYPE_WINDOW);
-
- klass->set_e_cal = real_set_e_cal;
- klass->edit_comp = real_edit_comp;
- klass->send_comp = real_send_comp;
-
- widget_class->key_press_event = comp_editor_key_press_event;
- object_class->finalize = comp_editor_finalize;
-}
-
-/* Creates the basic in the editor */
-static void
-setup_widgets (CompEditor *editor)
-{
- CompEditorPrivate *priv;
- BonoboUIContainer *container;
- GtkWidget *vbox;
-
- priv = editor->priv;
-
- /* Window and basic vbox */
- container = bonobo_ui_container_new ();
- editor = (CompEditor *) bonobo_window_construct (BONOBO_WINDOW (editor), container,
- "event-editor", "iCalendar Editor");
- g_signal_connect((editor), "delete_event",
- G_CALLBACK (delete_event_cb), editor);
-
- priv->uic = bonobo_ui_component_new_default ();
- bonobo_ui_component_set_container (priv->uic,
- bonobo_object_corba_objref (BONOBO_OBJECT (container)),
- NULL);
- bonobo_ui_engine_config_set_path (bonobo_window_get_ui_engine (BONOBO_WINDOW (editor)),
- "/evolution/UIConf/kvps");
-
- bonobo_ui_component_add_verb_list_with_data (priv->uic, verbs, editor);
- bonobo_ui_util_set_ui (priv->uic, PREFIX,
- EVOLUTION_UIDIR "/evolution-comp-editor.xml",
- "evolution-calendar", NULL);
- e_pixmaps_update (priv->uic, pixmaps);
-
- vbox = gtk_vbox_new (FALSE, GNOME_PAD_SMALL);
- gtk_widget_show (vbox);
- gtk_container_set_border_width (GTK_CONTAINER (vbox), GNOME_PAD_SMALL);
- bonobo_window_set_contents (BONOBO_WINDOW (editor), vbox);
-
- /* Notebook */
- priv->notebook = GTK_NOTEBOOK (gtk_notebook_new ());
- gtk_widget_show (GTK_WIDGET (priv->notebook));
- gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (priv->notebook),
- TRUE, TRUE, 6);
-}
-
-/* Object initialization function for the calendar component editor */
-static void
-comp_editor_init (CompEditor *editor)
-{
- CompEditorPrivate *priv;
-
- priv = g_new0 (CompEditorPrivate, 1);
- editor->priv = priv;
-
- setup_widgets (editor);
-
- priv->pages = NULL;
- priv->changed = FALSE;
- priv->needs_send = FALSE;
- priv->mod = CALOBJ_MOD_ALL;
- priv->existing_org = FALSE;
- priv->user_org = FALSE;
- priv->warned = FALSE;
-}
-
-
-static gint
-comp_editor_key_press_event (GtkWidget *d, GdkEventKey *e)
-{
- if (e->keyval == GDK_Escape) {
- if (prompt_to_save_changes (COMP_EDITOR (d), TRUE))
- close_dialog (COMP_EDITOR (d));
- return TRUE;
- }
-
- if (GTK_WIDGET_CLASS (parent_class)->key_press_event)
- return (* GTK_WIDGET_CLASS (parent_class)->key_press_event) (d, e);
-
- return FALSE;
-}
-
-/* Destroy handler for the calendar component editor */
-static void
-comp_editor_finalize (GObject *object)
-{
- CompEditor *editor;
- CompEditorPrivate *priv;
- GList *l;
-
- editor = COMP_EDITOR (object);
- priv = editor->priv;
-
- if (priv->client) {
- g_signal_handlers_disconnect_matched (priv->client, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, editor);
- g_object_unref (priv->client);
- priv->client = NULL;
- }
-
- /* We want to destroy the pages after the widgets get destroyed,
- since they have lots of signal handlers connected to the widgets
- with the pages as the data. */
- for (l = priv->pages; l != NULL; l = l->next)
- g_object_unref (l->data);
-
- if (priv->comp) {
- g_object_unref (priv->comp);
- priv->comp = NULL;
- }
-
- bonobo_object_unref (priv->uic);
-
- g_free (priv);
- editor->priv = NULL;
-
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
-}
-
-static gboolean
-save_comp (CompEditor *editor)
-{
- CompEditorPrivate *priv;
- ECalComponent *clone;
- GList *l;
- gboolean result;
- GError *error = NULL;
-
- priv = editor->priv;
-
- if (!priv->changed)
- return TRUE;
-
- clone = e_cal_component_clone (priv->comp);
- for (l = priv->pages; l != NULL; l = l->next) {
- if (!comp_editor_page_fill_component (l->data, clone)) {
- g_object_unref (clone);
- comp_editor_show_page (editor, COMP_EDITOR_PAGE (l->data));
- return FALSE;
- }
- }
-
- /* If we are not the organizer, we don't update the sequence number */
- if (!e_cal_component_has_organizer (clone) || itip_organizer_is_user (clone, priv->client))
- e_cal_component_commit_sequence (clone);
- else
- e_cal_component_abort_sequence (clone);
-
- g_object_unref (priv->comp);
- priv->comp = clone;
-
- priv->updating = TRUE;
-
- if (!cal_comp_is_on_server (priv->comp, priv->client)) {
- result = e_cal_create_object (priv->client, e_cal_component_get_icalcomponent (priv->comp), NULL, &error);
- } else {
- result = e_cal_modify_object (priv->client, e_cal_component_get_icalcomponent (priv->comp), priv->mod, &error);
- }
-
- if (!result) {
- GtkWidget *dlg;
- char *msg;
-
- msg = g_strdup (error ? error->message : _("Could not update object"));
-
- dlg = gnome_error_dialog (msg);
- gnome_dialog_run_and_close (GNOME_DIALOG (dlg));
-
- g_free (msg);
- if (error)
- g_error_free (error);
-
- return FALSE;
- } else {
- priv->changed = FALSE;
- }
-
- priv->updating = FALSE;
-
- return TRUE;
-}
-
-static gboolean
-save_comp_with_send (CompEditor *editor)
-{
- CompEditorPrivate *priv;
- gboolean send;
-
- priv = editor->priv;
-
- send = priv->changed && priv->needs_send;
-
- if (!save_comp (editor))
- return FALSE;
-
- if (send && send_component_dialog ((GtkWindow *) editor, priv->client, priv->comp, !priv->existing_org)) {
- if (itip_organizer_is_user (priv->comp, priv->client))
- return comp_editor_send_comp (editor, E_CAL_COMPONENT_METHOD_REQUEST);
- else
- return comp_editor_send_comp (editor, E_CAL_COMPONENT_METHOD_REPLY);
- }
-
- return TRUE;
-}
-
-static void
-delete_comp (CompEditor *editor)
-{
- CompEditorPrivate *priv;
- const char *uid;
-
- priv = editor->priv;
-
- e_cal_component_get_uid (priv->comp, &uid);
- priv->updating = TRUE;
- e_cal_remove_object (priv->client, uid, NULL);
- priv->updating = FALSE;
- close_dialog (editor);
-}
-
-static gboolean
-prompt_to_save_changes (CompEditor *editor, gboolean send)
-{
- CompEditorPrivate *priv;
-
- priv = editor->priv;
-
- if (!priv->changed)
- return TRUE;
-
- switch (save_component_dialog (GTK_WINDOW (editor))) {
- case GTK_RESPONSE_YES: /* Save */
- if (e_cal_component_is_instance (priv->comp))
- if (!recur_component_dialog (priv->client, priv->comp, &priv->mod, GTK_WINDOW (editor)))
- return FALSE;
-
- if (send && save_comp_with_send (editor))
- return TRUE;
- else if (!send && save_comp (editor))
- return TRUE;
- else
- return FALSE;
- case GTK_RESPONSE_NO: /* Discard */
- return TRUE;
- case GTK_RESPONSE_CANCEL: /* Cancel */
- default:
- return FALSE;
- }
-}
-
-/* This sets the focus to the toplevel, so any field being edited is committed.
- FIXME: In future we may also want to check some of the fields are valid,
- e.g. the EDateEdit fields. */
-static void
-commit_all_fields (CompEditor *editor)
-{
- CompEditorPrivate *priv;
-
- priv = editor->priv;
-
- gtk_window_set_focus (GTK_WINDOW (editor), NULL);
-}
-
-/* Closes the dialog box and emits the appropriate signals */
-static void
-close_dialog (CompEditor *editor)
-{
- CompEditorPrivate *priv;
-
- priv = editor->priv;
-
- gtk_widget_destroy (GTK_WIDGET (editor));
-}
-
-
-
-void
-comp_editor_set_existing_org (CompEditor *editor, gboolean existing_org)
-{
- CompEditorPrivate *priv;
-
- g_return_if_fail (editor != NULL);
- g_return_if_fail (IS_COMP_EDITOR (editor));
-
- priv = editor->priv;
-
- priv->existing_org = existing_org;
-}
-
-gboolean
-comp_editor_get_existing_org (CompEditor *editor)
-{
- CompEditorPrivate *priv;
-
- g_return_val_if_fail (editor != NULL, FALSE);
- g_return_val_if_fail (IS_COMP_EDITOR (editor), FALSE);
-
- priv = editor->priv;
-
- return priv->existing_org;
-}
-
-void
-comp_editor_set_user_org (CompEditor *editor, gboolean user_org)
-{
- CompEditorPrivate *priv;
-
- g_return_if_fail (editor != NULL);
- g_return_if_fail (IS_COMP_EDITOR (editor));
-
- priv = editor->priv;
-
- priv->user_org = user_org;
-}
-
-gboolean
-comp_editor_get_user_org (CompEditor *editor)
-{
- CompEditorPrivate *priv;
-
- g_return_val_if_fail (editor != NULL, FALSE);
- g_return_val_if_fail (IS_COMP_EDITOR (editor), FALSE);
-
- priv = editor->priv;
-
- return priv->user_org;
-}
-
-
-/**
- * comp_editor_set_changed:
- * @editor: A component editor
- * @changed: Value to set the changed state to
- *
- * Set the dialog changed state to the given value
- **/
-void
-comp_editor_set_changed (CompEditor *editor, gboolean changed)
-{
- CompEditorPrivate *priv;
-
- priv = editor->priv;
-
- priv->changed = changed;
-}
-
-/**
- * comp_editor_get_changed:
- * @editor: A component editor
- *
- * Gets the changed state of the dialog
- *
- * Return value: A boolean indicating if the dialog is in a changed
- * state
- **/
-gboolean
-comp_editor_get_changed (CompEditor *editor)
-{
- CompEditorPrivate *priv;
-
- priv = editor->priv;
-
- return priv->changed;
-}
-
-/**
- * comp_editor_set_needs_send:
- * @editor: A component editor
- * @needs_send: Value to set the needs send state to
- *
- * Set the dialog needs send state to the given value
- **/
-void
-comp_editor_set_needs_send (CompEditor *editor, gboolean needs_send)
-{
- CompEditorPrivate *priv;
-
- priv = editor->priv;
-
- priv->needs_send = needs_send;
-}
-
-/**
- * comp_editor_get_needs_send:
- * @editor: A component editor
- *
- * Gets the needs send state of the dialog
- *
- * Return value: A boolean indicating if the dialog is in a needs send
- * state
- **/
-gboolean
-comp_editor_get_needs_send (CompEditor *editor)
-{
- CompEditorPrivate *priv;
-
- priv = editor->priv;
-
- return priv->needs_send;
-}
-
-static void page_mapped_cb (GtkWidget *page_widget,
- CompEditorPage *page)
-{
- GtkWidget *toplevel;
-
- toplevel = gtk_widget_get_toplevel (page_widget);
- if (!GTK_IS_WINDOW (toplevel))
- return;
-
- if (page->accel_group) {
- gtk_window_add_accel_group (GTK_WINDOW (toplevel),
- page->accel_group);
- }
-}
-
-static void page_unmapped_cb (GtkWidget *page_widget,
- CompEditorPage *page)
-{
- GtkWidget *toplevel;
-
- toplevel = gtk_widget_get_toplevel (page_widget);
- if (!GTK_IS_WINDOW (toplevel))
- return;
-
- if (page->accel_group) {
- gtk_window_remove_accel_group (GTK_WINDOW (toplevel),
- page->accel_group);
- }
-}
-
-/**
- * comp_editor_append_page:
- * @editor: A component editor
- * @page: A component editor page
- * @label: Label of the page
- *
- * Appends a page to the editor notebook with the given label
- **/
-void
-comp_editor_append_page (CompEditor *editor,
- CompEditorPage *page,
- const char *label)
-{
- CompEditorPrivate *priv;
- GtkWidget *page_widget;
- GtkWidget *label_widget;
- gboolean is_first_page;
-
- g_return_if_fail (editor != NULL);
- g_return_if_fail (IS_COMP_EDITOR (editor));
- g_return_if_fail (page != NULL);
- g_return_if_fail (IS_COMP_EDITOR_PAGE (page));
- g_return_if_fail (label != NULL);
-
- priv = editor->priv;
-
- g_object_ref (page);
-
- /* If we are editing something, fill the widgets with current info */
- if (priv->comp != NULL) {
- ECalComponent *comp;
-
- comp = comp_editor_get_current_comp (editor);
- comp_editor_page_fill_widgets (page, comp);
- g_object_unref (comp);
- }
-
- page_widget = comp_editor_page_get_widget (page);
- g_assert (page_widget != NULL);
-
- label_widget = gtk_label_new (label);
-
- is_first_page = (priv->pages == NULL);
-
- priv->pages = g_list_append (priv->pages, page);
- gtk_notebook_append_page (priv->notebook, page_widget, label_widget);
-
- /* Listen for things happening on the page */
- g_signal_connect(page, "changed",
- G_CALLBACK (page_changed_cb), editor);
- g_signal_connect(page, "summary_changed",
- G_CALLBACK (page_summary_changed_cb), editor);
- g_signal_connect(page, "dates_changed",
- G_CALLBACK (page_dates_changed_cb), editor);
-
- /* Listen for when the page is mapped/unmapped so we can
- install/uninstall the appropriate GtkAccelGroup. */
- g_signal_connect((page_widget), "map",
- G_CALLBACK (page_mapped_cb), page);
- g_signal_connect((page_widget), "unmap",
- G_CALLBACK (page_unmapped_cb), page);
-
- /* The first page is the main page of the editor, so we ask it to focus
- * its main widget.
- */
- if (is_first_page)
- comp_editor_page_focus_main_widget (page);
-}
-
-/**
- * comp_editor_remove_page:
- * @editor: A component editor
- * @page: A component editor page
- *
- * Removes the page from the component editor
- **/
-void
-comp_editor_remove_page (CompEditor *editor, CompEditorPage *page)
-{
- CompEditorPrivate *priv;
- GtkWidget *page_widget;
- gint page_num;
-
- g_return_if_fail (editor != NULL);
- g_return_if_fail (IS_COMP_EDITOR (editor));
- g_return_if_fail (page != NULL);
- g_return_if_fail (IS_COMP_EDITOR_PAGE (page));
-
- priv = editor->priv;
-
- page_widget = comp_editor_page_get_widget (page);
- page_num = gtk_notebook_page_num (priv->notebook, page_widget);
- if (page_num == -1)
- return;
-
- /* Disconnect all the signals added in append_page(). */
- g_signal_handlers_disconnect_matched (page, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, editor);
- g_signal_handlers_disconnect_matched (page_widget, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, page);
-
- gtk_notebook_remove_page (priv->notebook, page_num);
-
- priv->pages = g_list_remove (priv->pages, page);
- g_object_unref (page);
-}
-
-/**
- * comp_editor_show_page:
- * @editor:
- * @page:
- *
- *
- **/
-void
-comp_editor_show_page (CompEditor *editor, CompEditorPage *page)
-{
- CompEditorPrivate *priv;
- GtkWidget *page_widget;
- gint page_num;
-
- g_return_if_fail (editor != NULL);
- g_return_if_fail (IS_COMP_EDITOR (editor));
- g_return_if_fail (page != NULL);
- g_return_if_fail (IS_COMP_EDITOR_PAGE (page));
-
- priv = editor->priv;
-
- page_widget = comp_editor_page_get_widget (page);
- page_num = gtk_notebook_page_num (priv->notebook, page_widget);
- gtk_notebook_set_page (priv->notebook, page_num);
-}
-
-/**
- * comp_editor_set_e_cal:
- * @editor: A component editor
- * @client: The calendar client to use
- *
- * Sets the calendar client used by the editor to update components
- **/
-void
-comp_editor_set_e_cal (CompEditor *editor, ECal *client)
-{
- CompEditorClass *klass;
-
- g_return_if_fail (editor != NULL);
- g_return_if_fail (IS_COMP_EDITOR (editor));
-
- klass = COMP_EDITOR_CLASS (G_OBJECT_GET_CLASS (editor));
-
- if (klass->set_e_cal)
- klass->set_e_cal (editor, client);
-}
-
-/**
- * comp_editor_get_e_cal:
- * @editor: A component editor
- *
- * Returns the calendar client of the editor
- *
- * Return value: The calendar client of the editor
- **/
-ECal *
-comp_editor_get_e_cal (CompEditor *editor)
-{
- CompEditorPrivate *priv;
-
- g_return_val_if_fail (editor != NULL, NULL);
- g_return_val_if_fail (IS_COMP_EDITOR (editor), NULL);
-
- priv = editor->priv;
-
- return priv->client;
-}
-
-/* Creates an appropriate title for the event editor dialog */
-static char *
-make_title_from_comp (ECalComponent *comp)
-{
- char *title;
- const char *type_string;
- ECalComponentVType type;
- ECalComponentText text;
-
- if (!comp)
- return g_strdup (_("Edit Appointment"));
-
- type = e_cal_component_get_vtype (comp);
- switch (type) {
- case E_CAL_COMPONENT_EVENT:
- type_string = _("Appointment - %s");
- break;
- case E_CAL_COMPONENT_TODO:
- type_string = _("Task - %s");
- break;
- case E_CAL_COMPONENT_JOURNAL:
- type_string = _("Journal entry - %s");
- break;
- default:
- g_message ("make_title_from_comp(): Cannot handle object of type %d", type);
- return NULL;
- }
-
- e_cal_component_get_summary (comp, &text);
- if (text.value) {
- title = g_strdup_printf (type_string, text.value);
- } else {
- title = g_strdup_printf (type_string, _("No summary"));
- }
-
- return title;
-}
-
-/* Creates an appropriate title for the event editor dialog */
-static char *
-make_title_from_string (ECalComponent *comp, const char *str)
-{
- char *title;
- const char *type_string;
- ECalComponentVType type;
-
- if (!comp)
- return g_strdup (_("Edit Appointment"));
-
- type = e_cal_component_get_vtype (comp);
- switch (type) {
- case E_CAL_COMPONENT_EVENT:
- type_string = _("Appointment - %s");
- break;
- case E_CAL_COMPONENT_TODO:
- type_string = _("Task - %s");
- break;
- case E_CAL_COMPONENT_JOURNAL:
- type_string = _("Journal entry - %s");
- break;
- default:
- g_message ("make_title_from_string(): Cannot handle object of type %d", type);
- return NULL;
- }
-
- if (str) {
- title = g_strdup_printf (type_string, str);
- } else {
- title = g_strdup_printf (type_string, _("No summary"));
- }
-
- return title;
-}
-
-static const char *
-make_icon_from_comp (ECalComponent *comp)
-{
- ECalComponentVType type;
-
- if (!comp)
- return EVOLUTION_IMAGESDIR "/evolution-calendar-mini.png";
-
- type = e_cal_component_get_vtype (comp);
- switch (type) {
- case E_CAL_COMPONENT_EVENT:
- return EVOLUTION_IMAGESDIR "/buttons/new_appointment.png";
- break;
- case E_CAL_COMPONENT_TODO:
- return EVOLUTION_IMAGESDIR "/buttons/new_task.png";
- break;
- default:
- return EVOLUTION_IMAGESDIR "/evolution-calendar-mini.png";
- }
-}
-
-/* Sets the event editor's window title from a calendar component */
-static void
-set_title_from_comp (CompEditor *editor)
-{
- CompEditorPrivate *priv;
- char *title;
-
- priv = editor->priv;
- title = make_title_from_comp (priv->comp);
- gtk_window_set_title (GTK_WINDOW (editor), title);
- g_free (title);
-}
-
-static void
-set_title_from_string (CompEditor *editor, const char *str)
-{
- CompEditorPrivate *priv;
- char *title;
-
- priv = editor->priv;
- title = make_title_from_string (priv->comp, str);
- gtk_window_set_title (GTK_WINDOW (editor), title);
- g_free (title);
-}
-
-static void
-set_icon_from_comp (CompEditor *editor)
-{
- CompEditorPrivate *priv;
- const char *file;
-
- priv = editor->priv;
- file = make_icon_from_comp (priv->comp);
- gnome_window_icon_set_from_file (GTK_WINDOW (editor), file);
-}
-
-static void
-fill_widgets (CompEditor *editor)
-{
- CompEditorPrivate *priv;
- GList *l;
-
- priv = editor->priv;
-
- for (l = priv->pages; l != NULL; l = l->next)
- comp_editor_page_fill_widgets (l->data, priv->comp);
-}
-
-static void
-real_set_e_cal (CompEditor *editor, ECal *client)
-{
- CompEditorPrivate *priv;
- GList *elem;
-
- g_return_if_fail (editor != NULL);
- g_return_if_fail (IS_COMP_EDITOR (editor));
-
- priv = editor->priv;
-
- if (client == priv->client)
- return;
-
- if (client) {
- g_return_if_fail (E_IS_CAL (client));
- g_return_if_fail (e_cal_get_load_state (client) ==
- E_CAL_LOAD_LOADED);
- g_object_ref (client);
- }
-
- if (priv->client) {
- gtk_signal_disconnect_by_data (GTK_OBJECT (priv->client),
- editor);
- g_object_unref (priv->client);
- }
-
- priv->client = client;
-
- /* Pass the client to any pages that need it. */
- for (elem = priv->pages; elem; elem = elem->next)
- comp_editor_page_set_e_cal (elem->data, client);
-
- g_signal_connect((priv->client), "obj_updated",
- G_CALLBACK (obj_updated_cb), editor);
-
- g_signal_connect((priv->client), "obj_removed",
- G_CALLBACK (obj_removed_cb), editor);
-}
-
-static void
-real_edit_comp (CompEditor *editor, ECalComponent *comp)
-{
- CompEditorPrivate *priv;
-
- g_return_if_fail (editor != NULL);
- g_return_if_fail (IS_COMP_EDITOR (editor));
-
- priv = editor->priv;
-
- if (priv->comp) {
- g_object_unref (priv->comp);
- priv->comp = NULL;
- }
-
- if (comp)
- priv->comp = e_cal_component_clone (comp);
-
- priv->existing_org = e_cal_component_has_organizer (comp);
- priv->user_org = itip_organizer_is_user (comp, priv->client);
- priv->warned = FALSE;
-
- set_title_from_comp (editor);
- set_icon_from_comp (editor);
- fill_widgets (editor);
-}
-
-
-static gboolean
-real_send_comp (CompEditor *editor, ECalComponentItipMethod method)
-{
- CompEditorPrivate *priv;
- ECalComponent *tmp_comp;
-
- g_return_val_if_fail (editor != NULL, FALSE);
- g_return_val_if_fail (IS_COMP_EDITOR (editor), FALSE);
-
- priv = editor->priv;
-
- if (itip_send_comp (method, priv->comp, priv->client, NULL)) {
- tmp_comp = priv->comp;
- g_object_ref (tmp_comp);
- comp_editor_edit_comp (editor, tmp_comp);
- g_object_unref (tmp_comp);
-
- comp_editor_set_changed (editor, TRUE);
- save_comp (editor);
-
- return TRUE;
- }
-
- comp_editor_set_changed (editor, TRUE);
-
- return FALSE;
-}
-
-
-/**
- * comp_editor_edit_comp:
- * @editor: A component editor
- * @comp: A calendar component
- *
- * Starts the editor editing the given component
- **/
-void
-comp_editor_edit_comp (CompEditor *editor, ECalComponent *comp)
-{
- CompEditorClass *klass;
-
- g_return_if_fail (editor != NULL);
- g_return_if_fail (IS_COMP_EDITOR (editor));
- g_return_if_fail (comp != NULL);
- g_return_if_fail (E_IS_CAL_COMPONENT (comp));
-
- klass = COMP_EDITOR_CLASS (G_OBJECT_GET_CLASS (editor));
-
- if (klass->edit_comp)
- klass->edit_comp (editor, comp);
-}
-
-ECalComponent *
-comp_editor_get_comp (CompEditor *editor)
-{
- CompEditorPrivate *priv;
-
- g_return_val_if_fail (editor != NULL, NULL);
- g_return_val_if_fail (IS_COMP_EDITOR (editor), NULL);
-
- priv = editor->priv;
-
- return priv->comp;
-}
-
-ECalComponent *
-comp_editor_get_current_comp (CompEditor *editor)
-{
- CompEditorPrivate *priv;
- ECalComponent *comp;
- GList *l;
-
- g_return_val_if_fail (editor != NULL, NULL);
- g_return_val_if_fail (IS_COMP_EDITOR (editor), NULL);
-
- priv = editor->priv;
-
- comp = e_cal_component_clone (priv->comp);
- if (priv->changed) {
- for (l = priv->pages; l != NULL; l = l->next)
- comp_editor_page_fill_component (l->data, comp);
- }
-
- return comp;
-}
-
-/**
- * comp_editor_save_comp:
- * @editor:
- *
- *
- **/
-gboolean
-comp_editor_save_comp (CompEditor *editor, gboolean send)
-{
- return prompt_to_save_changes (editor, send);
-}
-
-/**
- * comp_editor_delete_comp:
- * @editor:
- *
- *
- **/
-void
-comp_editor_delete_comp (CompEditor *editor)
-{
- delete_comp (editor);
-}
-
-/**
- * comp_editor_send_comp:
- * @editor:
- * @method:
- *
- *
- **/
-gboolean
-comp_editor_send_comp (CompEditor *editor, ECalComponentItipMethod method)
-{
- CompEditorClass *klass;
-
- g_return_val_if_fail (editor != NULL, FALSE);
- g_return_val_if_fail (IS_COMP_EDITOR (editor), FALSE);
-
- klass = COMP_EDITOR_CLASS (G_OBJECT_GET_CLASS (editor));
-
- if (klass->send_comp)
- return klass->send_comp (editor, method);
-
- return FALSE;
-}
-
-gboolean
-comp_editor_close (CompEditor *editor)
-{
- gboolean close;
-
- g_return_val_if_fail (editor != NULL, FALSE);
- g_return_val_if_fail (IS_COMP_EDITOR (editor), FALSE);
-
- commit_all_fields (editor);
-
- close = prompt_to_save_changes (editor, TRUE);
- if (close)
- close_dialog (editor);
-
- return close;
-}
-
-/**
- * comp_editor_merge_ui:
- * @editor:
- * @filename:
- * @verbs:
- *
- *
- **/
-void
-comp_editor_merge_ui (CompEditor *editor,
- const char *filename,
- BonoboUIVerb *verbs,
- EPixmap *component_pixmaps)
-{
- CompEditorPrivate *priv;
- char *path;
-
- g_return_if_fail (editor != NULL);
- g_return_if_fail (IS_COMP_EDITOR (editor));
-
- priv = editor->priv;
-
- path = g_strconcat (EVOLUTION_UIDIR "/", filename, NULL);
-
- bonobo_ui_util_set_ui (priv->uic, EVOLUTION_DATADIR, path, "evolution-calendar", NULL);
- bonobo_ui_component_add_verb_list_with_data (priv->uic, verbs, editor);
-
- g_free (path);
-
- if (component_pixmaps != NULL)
- e_pixmaps_update (priv->uic, component_pixmaps);
-}
-
-/**
- * comp_editor_set_ui_prop:
- * @editor:
- * @path:
- * @attr:
- * @val:
- *
- *
- **/
-void
-comp_editor_set_ui_prop (CompEditor *editor,
- const char *path,
- const char *attr,
- const char *val)
-{
- CompEditorPrivate *priv;
-
- g_return_if_fail (editor != NULL);
- g_return_if_fail (IS_COMP_EDITOR (editor));
-
- priv = editor->priv;
-
- bonobo_ui_component_set_prop (priv->uic, path, attr, val, NULL);
-}
-
-
-/* Brings attention to a window by raising it and giving it focus */
-static void
-raise_and_focus (GtkWidget *widget)
-{
- g_assert (GTK_WIDGET_REALIZED (widget));
- gdk_window_show (widget->window);
- gtk_widget_grab_focus (widget);
-}
-
-/**
- * comp_editor_focus:
- * @editor: A component editor
- *
- * Brings the editor window to the front and gives it focus
- **/
-void
-comp_editor_focus (CompEditor *editor)
-{
- CompEditorPrivate *priv;
-
- g_return_if_fail (editor != NULL);
- g_return_if_fail (IS_COMP_EDITOR (editor));
-
- priv = editor->priv;
-
- gtk_widget_show (GTK_WIDGET (editor));
- raise_and_focus (GTK_WIDGET (editor));
-}
-
-/* Menu Commands */
-static void
-save_cmd (GtkWidget *widget, gpointer data)
-{
- CompEditor *editor = COMP_EDITOR (data);
- CompEditorPrivate *priv;
-
- priv = editor->priv;
-
- commit_all_fields (editor);
-
- if (e_cal_component_is_instance (priv->comp))
- if (!recur_component_dialog (priv->client, priv->comp, &priv->mod, GTK_WINDOW (editor)))
- return;
-
- save_comp_with_send (editor);
-}
-
-static void
-save_close_cmd (GtkWidget *widget, gpointer data)
-{
- CompEditor *editor = COMP_EDITOR (data);
- CompEditorPrivate *priv;
-
- priv = editor->priv;
-
- commit_all_fields (editor);
-
- if (e_cal_component_is_instance (priv->comp))
- if (!recur_component_dialog (priv->client, priv->comp, &priv->mod, GTK_WINDOW (editor)))
- return;
-
- if (save_comp_with_send (editor))
- close_dialog (editor);
-}
-
-static void
-save_as_cmd (GtkWidget *widget, gpointer data)
-{
- CompEditor *editor = COMP_EDITOR (data);
- CompEditorPrivate *priv;
- char *filename;
- char *ical_string;
- FILE *file;
-
- priv = editor->priv;
-
- commit_all_fields (editor);
-
- filename = e_file_dialog_save (_("Save as..."));
- if (filename == NULL)
- return;
-
- ical_string = e_cal_get_component_as_string (priv->client,
- e_cal_component_get_icalcomponent (priv->comp));
- if (ical_string == NULL) {
- g_warning ("Couldn't convert item to a string");
- return;
- }
-
- file = fopen (filename, "w");
- if (file == NULL) {
- g_warning ("Couldn't save item");
- return;
- }
-
- fprintf (file, ical_string);
- g_free (ical_string);
- fclose (file);
-}
-
-static void
-delete_cmd (GtkWidget *widget, gpointer data)
-{
- CompEditor *editor = COMP_EDITOR (data);
- CompEditorPrivate *priv;
- ECalComponentVType vtype;
-
- priv = editor->priv;
-
- vtype = e_cal_component_get_vtype (priv->comp);
-
- if (delete_component_dialog (priv->comp, FALSE, 1, vtype, GTK_WIDGET (editor))) {
- if (itip_organizer_is_user (priv->comp, priv->client)
- && cancel_component_dialog ((GtkWindow *) editor,
- priv->client, priv->comp, TRUE))
- itip_send_comp (E_CAL_COMPONENT_METHOD_CANCEL, priv->comp, priv->client, NULL);
-
- delete_comp (editor);
- }
-}
-
-static void
-print_cmd (GtkWidget *widget, gpointer data)
-{
- CompEditor *editor = COMP_EDITOR (data);
- ECalComponent *comp;
-
- commit_all_fields (editor);
-
- comp = comp_editor_get_current_comp (editor);
- print_comp (comp, editor->priv->client, FALSE);
- g_object_unref (comp);
-}
-
-static void
-print_preview_cmd (GtkWidget *widget, gpointer data)
-{
- CompEditor *editor = COMP_EDITOR (data);
- ECalComponent *comp;
-
- commit_all_fields (editor);
-
- comp = comp_editor_get_current_comp (editor);
- print_comp (comp, editor->priv->client, TRUE);
- g_object_unref (comp);
-}
-
-static void
-print_setup_cmd (GtkWidget *widget, gpointer data)
-{
- CompEditor *editor = COMP_EDITOR (data);
- CompEditorPrivate *priv;
-
- priv = editor->priv;
-
- print_setup ();
-}
-
-static void
-close_cmd (GtkWidget *widget, gpointer data)
-{
- CompEditor *editor = COMP_EDITOR (data);
-
- commit_all_fields (editor);
-
- if (prompt_to_save_changes (editor, TRUE))
- close_dialog (editor);
-}
-
-static void
-page_changed_cb (GtkObject *obj, gpointer data)
-{
- CompEditor *editor = COMP_EDITOR (data);
- CompEditorPrivate *priv;
-
- priv = editor->priv;
-
- priv->changed = TRUE;
-
- if (!priv->warned && priv->existing_org && !priv->user_org) {
- e_notice (editor, GTK_MESSAGE_INFO,
- _("Changes made to this item may be discarded if an update arrives"));
- priv->warned = TRUE;
- }
-
-}
-
-/* Page signal callbacks */
-static void
-page_summary_changed_cb (GtkObject *obj, const char *summary, gpointer data)
-{
- CompEditor *editor = COMP_EDITOR (data);
- CompEditorPrivate *priv;
- GList *l;
-
- priv = editor->priv;
-
- for (l = priv->pages; l != NULL; l = l->next)
- if (obj != l->data)
- comp_editor_page_set_summary (l->data, summary);
-
- priv->changed = TRUE;
-
- if (!priv->warned && priv->existing_org && !priv->user_org) {
- e_notice (editor, GTK_MESSAGE_INFO,
- _("Changes made to this item may be discarded if an update arrives"));
- priv->warned = TRUE;
- }
-
- set_title_from_string (editor, summary);
-}
-
-static void
-page_dates_changed_cb (GtkObject *obj,
- CompEditorPageDates *dates,
- gpointer data)
-{
- CompEditor *editor = COMP_EDITOR (data);
- CompEditorPrivate *priv;
- GList *l;
-
- priv = editor->priv;
-
- for (l = priv->pages; l != NULL; l = l->next)
- if (obj != l->data)
- comp_editor_page_set_dates (l->data, dates);
-
- priv->changed = TRUE;
-
- if (!priv->warned && priv->existing_org && !priv->user_org) {
- e_notice (editor, GTK_MESSAGE_INFO,
- _("Changes made to this item may be discarded if an update arrives"));
- priv->warned = TRUE;
- }
-}
-
-static void
-obj_updated_cb (ECal *client, const char *uid, gpointer data)
-{
- CompEditor *editor = COMP_EDITOR (data);
- CompEditorPrivate *priv;
- ECalComponent *comp = NULL;
- const char *edit_uid;
-
- priv = editor->priv;
-
- e_cal_component_get_uid (priv->comp, &edit_uid);
-
- if (!strcmp (uid, edit_uid) && !priv->updating) {
- if (changed_component_dialog ((GtkWindow *) editor, priv->comp, FALSE, priv->changed)) {
- icalcomponent *icalcomp;
-
- if (!e_cal_get_object (priv->client, uid, NULL, &icalcomp, NULL)) {
- comp = e_cal_component_new ();
- if (e_cal_component_set_icalcomponent (comp, icalcomp))
- comp_editor_edit_comp (editor, comp);
- else {
- GtkWidget *dlg;
-
- dlg = gnome_error_dialog (_("Unable to obtain current version!"));
- gnome_dialog_run_and_close (GNOME_DIALOG (dlg));
- icalcomponent_free (icalcomp);
- }
-
- g_object_unref (comp);
- } else {
- GtkWidget *dlg;
-
- dlg = gnome_error_dialog (_("Unable to obtain current version!"));
- gnome_dialog_run_and_close (GNOME_DIALOG (dlg));
- }
- }
- }
-}
-
-static void
-obj_removed_cb (ECal *client, const char *uid, gpointer data)
-{
- CompEditor *editor = COMP_EDITOR (data);
- CompEditorPrivate *priv;
- const char *edit_uid;
-
- priv = editor->priv;
-
- e_cal_component_get_uid (priv->comp, &edit_uid);
-
- if (!strcmp (uid, edit_uid) && !priv->updating) {
- if (changed_component_dialog ((GtkWindow *) editor, priv->comp, TRUE, priv->changed))
- close_dialog (editor);
- }
-}
-
-static gint
-delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer data)
-{
- CompEditor *editor = COMP_EDITOR (data);
-
- if (prompt_to_save_changes (editor, TRUE))
- close_dialog (editor);
-
- return TRUE;
-}
diff --git a/calendar/gui/dialogs/comp-editor.h b/calendar/gui/dialogs/comp-editor.h
deleted file mode 100644
index 48b332ce4b..0000000000
--- a/calendar/gui/dialogs/comp-editor.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/* Evolution calendar - Framework for a calendar component editor dialog
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Author: Federico Mena-Quintero <federico@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef COMP_EDITOR_H
-#define COMP_EDITOR_H
-
-#include <gtk/gtk.h>
-#include <bonobo/bonobo-window.h>
-#include <bonobo/bonobo-ui-engine.h>
-#include <bonobo/bonobo-ui-component.h>
-#include <libecal/e-cal.h>
-#include "../itip-utils.h"
-#include "comp-editor-page.h"
-#include "evolution-shell-component-utils.h"
-
-G_BEGIN_DECLS
-
-
-
-#define TYPE_COMP_EDITOR (comp_editor_get_type ())
-#define COMP_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_COMP_EDITOR, CompEditor))
-#define COMP_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_COMP_EDITOR, CompEditorClass))
-#define IS_COMP_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_COMP_EDITOR))
-#define IS_COMP_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_COMP_EDITOR))
-
-typedef struct _CompEditorPrivate CompEditorPrivate;
-
-typedef struct {
- BonoboWindow object;
-
- /* Private data */
- CompEditorPrivate *priv;
-} CompEditor;
-
-typedef struct {
- BonoboWindowClass parent_class;
-
- /* Virtual functions */
- void (* set_e_cal) (CompEditor *page, ECal *client);
- void (* edit_comp) (CompEditor *page, ECalComponent *comp);
- gboolean (* send_comp) (CompEditor *page, ECalComponentItipMethod method);
-} CompEditorClass;
-
-GtkType comp_editor_get_type (void);
-void comp_editor_set_changed (CompEditor *editor,
- gboolean changed);
-gboolean comp_editor_get_changed (CompEditor *editor);
-void comp_editor_set_needs_send (CompEditor *editor,
- gboolean needs_send);
-gboolean comp_editor_get_needs_send (CompEditor *editor);
-void comp_editor_set_existing_org (CompEditor *editor,
- gboolean existing_org);
-gboolean comp_editor_get_existing_org (CompEditor *editor);
-void comp_editor_set_user_org (CompEditor *editor,
- gboolean user_org);
-gboolean comp_editor_get_user_org (CompEditor *editor);
-void comp_editor_append_page (CompEditor *editor,
- CompEditorPage *page,
- const char *label);
-void comp_editor_remove_page (CompEditor *editor,
- CompEditorPage *page);
-void comp_editor_show_page (CompEditor *editor,
- CompEditorPage *page);
-void comp_editor_set_e_cal (CompEditor *editor,
- ECal *client);
-ECal *comp_editor_get_e_cal (CompEditor *editor);
-void comp_editor_edit_comp (CompEditor *ee,
- ECalComponent *comp);
-ECalComponent *comp_editor_get_comp (CompEditor *editor);
-ECalComponent *comp_editor_get_current_comp (CompEditor *editor);
-gboolean comp_editor_save_comp (CompEditor *editor,
- gboolean send);
-void comp_editor_delete_comp (CompEditor *editor);
-gboolean comp_editor_send_comp (CompEditor *editor,
- ECalComponentItipMethod method);
-gboolean comp_editor_close (CompEditor *editor);
-void comp_editor_merge_ui (CompEditor *editor,
- const char *filename,
- BonoboUIVerb *verbs,
- EPixmap *pixmaps);
-void comp_editor_set_ui_prop (CompEditor *editor,
- const char *path,
- const char *attr,
- const char *val);
-void comp_editor_focus (CompEditor *editor);
-
-
-
-
-G_END_DECLS
-
-#endif
diff --git a/calendar/gui/dialogs/copy-source-dialog.c b/calendar/gui/dialogs/copy-source-dialog.c
deleted file mode 100644
index 11b523a1f8..0000000000
--- a/calendar/gui/dialogs/copy-source-dialog.c
+++ /dev/null
@@ -1,163 +0,0 @@
-/* Evolution calendar - Copy source dialog
- *
- * Copyright (C) 2003 Novell, Inc.
- *
- * Author: Rodrigo Moya <rodrigo@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <gtk/gtkbox.h>
-#include <gtk/gtkdialog.h>
-#include <gtk/gtklabel.h>
-#include <gtk/gtkstock.h>
-#include <bonobo/bonobo-i18n.h>
-#include <widgets/misc/e-source-option-menu.h>
-#include "copy-source-dialog.h"
-
-typedef struct {
- GtkWidget *dialog;
- GtkWidget *selector;
- ESourceList *source_list;
- GConfClient *conf_client;
- ESource *orig_source;
- CalObjType obj_type;
- ESource *selected_source;
-} CopySourceDialogData;
-
-static void
-source_selected_cb (ESourceOptionMenu *menu, ESource *selected_source, gpointer user_data)
-{
- CopySourceDialogData *csdd = user_data;
-
- csdd->selected_source = selected_source;
- if (selected_source) {
- if (selected_source != csdd->orig_source)
- gtk_dialog_set_response_sensitive (GTK_DIALOG (csdd->dialog), GTK_RESPONSE_OK, TRUE);
- else {
- gtk_dialog_set_response_sensitive (GTK_DIALOG (csdd->dialog), GTK_RESPONSE_OK, FALSE);
- csdd->selected_source = NULL;
- }
- } else
- gtk_dialog_set_response_sensitive (GTK_DIALOG (csdd->dialog), GTK_RESPONSE_OK, FALSE);
-}
-
-static gboolean
-copy_source (CopySourceDialogData *csdd)
-{
- char *uri;
- ECal *source_client, *dest_client;
- GList *obj_list = NULL;
- gboolean result = FALSE;
-
- if (!csdd->selected_source)
- return FALSE;
-
- /* open the source */
- source_client = e_cal_new (csdd->orig_source, csdd->obj_type);
- if (!e_cal_open (source_client, TRUE, NULL)) {
- g_object_unref (source_client);
- g_warning (G_STRLOC ": Could not open source");
- return FALSE;
- }
-
- /* open the destination */
- dest_client = e_cal_new (csdd->selected_source, csdd->obj_type);
- if (!e_cal_open (dest_client, FALSE, NULL)) {
- g_object_unref (dest_client);
- g_object_unref (source_client);
- g_warning (G_STRLOC ": Could not open destination");
- return FALSE;
- }
-
- if (e_cal_get_object_list (source_client, "#t", &obj_list, NULL)) {
- GList *l;
- const char *uid;
- icalcomponent *icalcomp;
-
- for (l = obj_list; l != NULL; l = l->next) {
- /* FIXME: process recurrences */
- /* FIXME: process errors */
- if (e_cal_get_object (dest_client, icalcomponent_get_uid (l->data), NULL,
- &icalcomp, NULL)) {
- e_cal_modify_object (dest_client, icalcomp, CALOBJ_MOD_ALL, NULL);
- } else {
- e_cal_create_object (dest_client, l->data, (char **) &uid, NULL);
- g_free ((gpointer) uid);
- }
- }
-
- e_cal_free_object_list (obj_list);
- }
-
- return result;
-}
-
-/**
- * copy_source_dialog
- *
- * Implements the Copy command for sources, allowing the user to select a target
- * source to copy to.
- */
-gboolean
-copy_source_dialog (GtkWindow *parent, ESource *source, CalObjType obj_type)
-{
- CopySourceDialogData csdd;
- gboolean result = FALSE;
- const char *gconf_key;
- GtkWidget *label;
-
- g_return_val_if_fail (E_IS_SOURCE (source), FALSE);
-
- if (obj_type == CALOBJ_TYPE_EVENT)
- gconf_key = "/apps/evolution/calendar/sources";
- else if (obj_type == CALOBJ_TYPE_TODO)
- gconf_key = "/apps/evolution/tasks/sources";
- else
- return FALSE;
-
- csdd.orig_source = source;
- csdd.selected_source = NULL;
- csdd.obj_type = obj_type;
-
- /* create the dialog */
- csdd.dialog = gtk_dialog_new_with_buttons (_("Copy"), parent, 0,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OK, GTK_RESPONSE_OK,
- NULL);
- gtk_dialog_set_response_sensitive (GTK_DIALOG (csdd.dialog), GTK_RESPONSE_OK, FALSE);
-
- label = gtk_label_new (_("Select destination source"));
- gtk_widget_show (label);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (csdd.dialog)->vbox), label, FALSE, FALSE, 6);
-
- csdd.conf_client = gconf_client_get_default ();
- csdd.source_list = e_source_list_new_for_gconf (csdd.conf_client, gconf_key);
- csdd.selector = e_source_option_menu_new (csdd.source_list);
- g_signal_connect (G_OBJECT (csdd.selector), "source_selected",
- G_CALLBACK (source_selected_cb), &csdd);
- gtk_widget_show (csdd.selector);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (csdd.dialog)->vbox), csdd.selector, FALSE, FALSE, 6);
-
- if (gtk_dialog_run (GTK_DIALOG (csdd.dialog)) == GTK_RESPONSE_OK) {
- result = copy_source (&csdd);
- }
-
- /* free memory */
- g_object_unref (csdd.conf_client);
- g_object_unref (csdd.source_list);
- gtk_widget_destroy (csdd.dialog);
-
- return result;
-}
diff --git a/calendar/gui/dialogs/copy-source-dialog.h b/calendar/gui/dialogs/copy-source-dialog.h
deleted file mode 100644
index e3c750d8a0..0000000000
--- a/calendar/gui/dialogs/copy-source-dialog.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Evolution calendar - Copy source dialog
- *
- * Copyright (C) 2003 Novell, Inc.
- *
- * Author: Rodrigo Moya <rodrigo@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef COPY_SOURCE_DIALOG_H
-#define COPY_SOURCE_DIALOG_H
-
-#include <gtk/gtkwindow.h>
-#include <libedataserver/e-source.h>
-#include <libecal/e-cal.h>
-#include <libecal/e-cal-util.h>
-
-gboolean copy_source_dialog (GtkWindow *parent, ESource *source, CalObjType obj_type);
-
-#endif
diff --git a/calendar/gui/dialogs/delete-comp.c b/calendar/gui/dialogs/delete-comp.c
deleted file mode 100644
index c4f9e5dc3d..0000000000
--- a/calendar/gui/dialogs/delete-comp.c
+++ /dev/null
@@ -1,159 +0,0 @@
-/* Evolution calendar - Delete calendar component dialog
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Author: Federico Mena-Quintero <federico@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <glib.h>
-#include <gtk/gtkstock.h>
-#include <gtk/gtkmessagedialog.h>
-#include <libgnome/gnome-i18n.h>
-#include "../calendar-config.h"
-#include "delete-comp.h"
-
-
-
-/**
- * delete_component_dialog:
- * @comp: A calendar component if a single component is to be deleted, or NULL
- * if more that one component is to be deleted.
- * @consider_as_untitled: If deleting more than one component, this is ignored.
- * Otherwise, whether to consider the component as not having a summary; if
- * FALSE then the component's summary string will be used.
- * @n_comps: Number of components that are to be deleted.
- * @vtype: Type of the components that are to be deleted. This is ignored
- * if only one component is to be deleted, and the vtype is extracted from
- * the component instead.
- * @widget: A widget to use as a basis for conversion from UTF8 into font
- * encoding.
- *
- * Pops up a dialog box asking the user whether he wants to delete a number of
- * calendar components. The dialog will not appear, however, if the
- * configuration option for confirmation is turned off.
- *
- * Return value: TRUE if the user clicked Yes, FALSE otherwise. If the
- * configuration option for confirmation is turned off, this function will
- * unconditionally return TRUE.
- **/
-gboolean
-delete_component_dialog (ECalComponent *comp,
- gboolean consider_as_untitled,
- int n_comps, ECalComponentVType vtype,
- GtkWidget *widget)
-{
- char *str;
- GtkWidget *dialog;
- int ret;
-
- if (comp) {
- g_return_val_if_fail (E_IS_CAL_COMPONENT (comp), FALSE);
- g_return_val_if_fail (n_comps == 1, FALSE);
- } else {
- g_return_val_if_fail (n_comps > 1, FALSE);
- g_return_val_if_fail (vtype != E_CAL_COMPONENT_NO_TYPE, FALSE);
- }
-
- g_return_val_if_fail (widget != NULL, FALSE);
- g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
-
- if (!calendar_config_get_confirm_delete ())
- return TRUE;
-
- if (comp) {
- ECalComponentText summary;
- char *tmp;
-
- vtype = e_cal_component_get_vtype (comp);
-
- if (!consider_as_untitled) {
- e_cal_component_get_summary (comp, &summary);
- tmp = g_strdup (summary.value);
- } else
- tmp = NULL;
-
- switch (vtype) {
- case E_CAL_COMPONENT_EVENT:
- if (tmp)
- str = g_strdup_printf (_("Are you sure you want to delete "
- "the appointment `%s'?"), tmp);
- else
- str = g_strdup (_("Are you sure you want to delete this "
- "untitled appointment?"));
- break;
-
- case E_CAL_COMPONENT_TODO:
- if (tmp)
- str = g_strdup_printf (_("Are you sure you want to delete "
- "the task `%s'?"), tmp);
- else
- str = g_strdup (_("Are you sure you want to delete this "
- "untitled task?"));
- break;
-
- case E_CAL_COMPONENT_JOURNAL:
- if (tmp)
- str = g_strdup_printf (_("Are you sure you want to delete "
- "the journal entry `%s'?"), tmp);
- else
- str = g_strdup (_("Are you sure want to delete this "
- "untitled journal entry?"));
- break;
-
- default:
- g_message ("delete_component_dialog(): Cannot handle object of type %d",
- vtype);
- g_free (tmp);
- return FALSE;
- }
-
- g_free (tmp);
- } else {
- switch (vtype) {
- case E_CAL_COMPONENT_EVENT:
- str = g_strdup_printf (_("Are you sure you want to delete "
- "%d appointments?"), n_comps);
- break;
-
- case E_CAL_COMPONENT_TODO:
- str = g_strdup_printf (_("Are you sure you want to delete "
- "%d tasks?"), n_comps);
- break;
-
- case E_CAL_COMPONENT_JOURNAL:
- str = g_strdup_printf (_("Are you sure you want to delete "
- "%d journal entries?"), n_comps);
- break;
-
- default:
- g_message ("delete_component_dialog(): Cannot handle objects of type %d",
- vtype);
- return FALSE;
- }
- }
-
- dialog = gtk_message_dialog_new ((GtkWindow *)gtk_widget_get_toplevel (widget),
- 0, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, "%s", str);
- g_free (str);
- ret = gtk_dialog_run ((GtkDialog *)dialog) == GTK_RESPONSE_YES;
- gtk_widget_destroy (dialog);
-
- return ret;
-}
diff --git a/calendar/gui/dialogs/delete-comp.h b/calendar/gui/dialogs/delete-comp.h
deleted file mode 100644
index f8773c25d0..0000000000
--- a/calendar/gui/dialogs/delete-comp.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Evolution calendar - Delete calendar component dialog
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Author: Federico Mena-Quintero <federico@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef DELETE_COMP_H
-#define DELETE_COMP_H
-
-#include <gtk/gtkwidget.h>
-#include <libecal/e-cal-component.h>
-
-gboolean delete_component_dialog (ECalComponent *comp,
- gboolean consider_as_untitled,
- int n_comps, ECalComponentVType vtype,
- GtkWidget *widget);
-
-#endif
diff --git a/calendar/gui/dialogs/delete-error.c b/calendar/gui/dialogs/delete-error.c
deleted file mode 100644
index cb076885c1..0000000000
--- a/calendar/gui/dialogs/delete-error.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/* Evolution calendar - Send calendar component dialog
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Author: JP Rosevear <jpr@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <glib.h>
-#include <gtk/gtkmessagedialog.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnomeui/gnome-uidefs.h>
-#include "delete-error.h"
-
-
-
-/**
- * delete_error_dialog:
- *
- * Shows any applicable error messages as the result of deleting and object
- *
- **/
-void
-delete_error_dialog (GError *error, ECalComponentVType vtype)
-{
- GtkWidget *dialog;
- const char *str;
-
- if (!error)
- return;
-
- switch (error->code) {
- case E_CALENDAR_STATUS_CORBA_EXCEPTION:
- switch (vtype) {
- case E_CAL_COMPONENT_EVENT:
- str = _("The event could not be deleted due to a corba error");
- break;
- case E_CAL_COMPONENT_TODO:
- str = _("The task could not be deleted due to a corba error");
- break;
- case E_CAL_COMPONENT_JOURNAL:
- str = _("The journal entry could not be deleted due to a corba error");
- break;
- default:
- str = _("The item could not be deleted due to a corba error");
- break;
- }
- break;
- case E_CALENDAR_STATUS_PERMISSION_DENIED:
- switch (vtype) {
- case E_CAL_COMPONENT_EVENT:
- str = _("The event could not be deleted because permission was denied");
- break;
- case E_CAL_COMPONENT_TODO:
- str = _("The task could not be deleted because permission was denied");
- break;
- case E_CAL_COMPONENT_JOURNAL:
- str = _("The journal entry could not be deleted because permission was denied");
- break;
- default:
- str = _("The item could not be deleted because permission was denied");
- break;
- }
- break;
- case E_CALENDAR_STATUS_OTHER_ERROR:
- switch (vtype) {
- case E_CAL_COMPONENT_EVENT:
- str = _("The event could not be deleted due to an error");
- break;
- case E_CAL_COMPONENT_TODO:
- str = _("The task could not be deleted due to an error");
- break;
- case E_CAL_COMPONENT_JOURNAL:
- str = _("The journal entry could not be deleted due to an error");
- break;
- default:
- str = _("The item could not be deleted due to an error");
- break;
- }
- break;
- case E_CALENDAR_STATUS_OK:
- case E_CALENDAR_STATUS_OBJECT_NOT_FOUND:
- default:
- /* If not found, we don't care - its gone anyhow */
- return;
- }
-
- dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK, str);
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
-}
diff --git a/calendar/gui/dialogs/delete-error.h b/calendar/gui/dialogs/delete-error.h
deleted file mode 100644
index 68c132e479..0000000000
--- a/calendar/gui/dialogs/delete-error.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Evolution calendar - Send calendar component dialog
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Author: JP Rosevear <jpr@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef DELETE_ERROR_H
-#define DELETE_ERROR_H
-
-#include <glib.h>
-#include <libecal/e-cal.h>
-#include <libecal/e-cal-component.h>
-
-void delete_error_dialog (GError *error, ECalComponentVType vtype);
-
-#endif
diff --git a/calendar/gui/dialogs/e-delegate-dialog.c b/calendar/gui/dialogs/e-delegate-dialog.c
deleted file mode 100644
index 1a33ca194d..0000000000
--- a/calendar/gui/dialogs/e-delegate-dialog.c
+++ /dev/null
@@ -1,322 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* Evolution calendar - Delegate selector dialog
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Authors: Damon Chaplin <damon@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-#include <bonobo-activation/bonobo-activation.h>
-#include <bonobo/bonobo-control.h>
-#include <bonobo/bonobo-exception.h>
-#include <bonobo/bonobo-widget.h>
-#include <gtk/gtksignal.h>
-#include <gtk/gtkcombo.h>
-#include <gtk/gtkentry.h>
-#include <gtk/gtklabel.h>
-#include <gnome.h>
-#include <libical/ical.h>
-#include <glade/glade.h>
-#include <gal/util/e-util.h>
-#include <widgets/misc/e-map.h>
-#include <addressbook/util/eab-destination.h>
-#include "Evolution-Addressbook-SelectNames.h"
-#include "e-delegate-dialog.h"
-
-struct _EDelegateDialogPrivate {
- char *name;
- char *address;
-
- /* Glade XML data */
- GladeXML *xml;
-
- /* Widgets from the Glade file */
- GtkWidget *app;
- GtkWidget *hbox;
- GtkWidget *addressbook;
-
- GNOME_Evolution_Addressbook_SelectNames corba_select_names;
- GtkWidget *entry;
-};
-
-#define SELECT_NAMES_OAFID "OAFIID:GNOME_Evolution_Addressbook_SelectNames:" BASE_VERSION
-static const char *section_name = "Delegate To";
-
-static void e_delegate_dialog_class_init (EDelegateDialogClass *class);
-static void e_delegate_dialog_init (EDelegateDialog *edd);
-static void e_delegate_dialog_finalize (GObject *object);
-
-static gboolean get_widgets (EDelegateDialog *edd);
-static void addressbook_clicked_cb (GtkWidget *widget, gpointer data);
-
-static GtkObjectClass *parent_class;
-
-E_MAKE_TYPE (e_delegate_dialog, "EDelegateDialog", EDelegateDialog, e_delegate_dialog_class_init,
- e_delegate_dialog_init, G_TYPE_OBJECT);
-
-/* Class initialization function for the event editor */
-static void
-e_delegate_dialog_class_init (EDelegateDialogClass *class)
-{
- GObjectClass *gobject_class;
-
- gobject_class = (GObjectClass *) class;
-
- parent_class = g_type_class_ref (G_TYPE_OBJECT);
-
- gobject_class->finalize = e_delegate_dialog_finalize;
-}
-
-/* Object initialization function for the event editor */
-static void
-e_delegate_dialog_init (EDelegateDialog *edd)
-{
- EDelegateDialogPrivate *priv;
-
- priv = g_new0 (EDelegateDialogPrivate, 1);
- edd->priv = priv;
-
- priv->address = NULL;
-}
-
-/* Destroy handler for the event editor */
-static void
-e_delegate_dialog_finalize (GObject *object)
-{
- EDelegateDialog *edd;
- EDelegateDialogPrivate *priv;
- GtkWidget *dialog;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (E_IS_DELEGATE_DIALOG (object));
-
- edd = E_DELEGATE_DIALOG (object);
- priv = edd->priv;
-
- /* Destroy the actual dialog. */
- dialog = e_delegate_dialog_get_toplevel (edd);
- gtk_widget_destroy (dialog);
-
- g_free (priv->address);
- priv->address = NULL;
-
- g_free (priv);
- edd->priv = NULL;
-
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
-}
-
-
-EDelegateDialog *
-e_delegate_dialog_construct (EDelegateDialog *edd, const char *name, const char *address)
-{
- EDelegateDialogPrivate *priv;
- EABDestination *dest;
- EABDestination *destv[2] = {NULL, NULL};
- Bonobo_Control corba_control;
- CORBA_Environment ev;
- char *str;
-
- g_return_val_if_fail (edd != NULL, NULL);
- g_return_val_if_fail (E_IS_DELEGATE_DIALOG (edd), NULL);
-
- priv = edd->priv;
-
- /* Load the content widgets */
-
- priv->xml = glade_xml_new (EVOLUTION_GLADEDIR "/e-delegate-dialog.glade",
- NULL, NULL);
- if (!priv->xml) {
- g_message ("e_delegate_dialog_construct(): Could not load the Glade XML file!");
- goto error;
- }
-
- if (!get_widgets (edd)) {
- g_message ("e_delegate_dialog_construct(): Could not find all widgets in the XML file!");
- goto error;
- }
-
- CORBA_exception_init (&ev);
-
- priv->corba_select_names = bonobo_activation_activate_from_id (SELECT_NAMES_OAFID, 0, NULL, &ev);
- GNOME_Evolution_Addressbook_SelectNames_addSectionWithLimit (priv->corba_select_names,
- section_name,
- section_name,
- 1, &ev);
-
- if (BONOBO_EX (&ev)) {
- g_message ("e_delegate_dialog_construct(): Unable to add section!");
- goto error;
- }
-
- corba_control = GNOME_Evolution_Addressbook_SelectNames_getEntryBySection (priv->corba_select_names,
- section_name, &ev);
-
- if (BONOBO_EX (&ev)) {
- g_message ("e_delegate_dialog_construct(): Unable to get addressbook entry!");
- goto error;
- }
-
- CORBA_exception_free (&ev);
-
- priv->entry = bonobo_widget_new_control_from_objref (corba_control, CORBA_OBJECT_NIL);
- gtk_widget_show (priv->entry);
- gtk_box_pack_start (GTK_BOX (priv->hbox), priv->entry, TRUE, TRUE, 6);
-
- dest = eab_destination_new ();
- destv[0] = dest;
- if (name != NULL && *name)
- eab_destination_set_name (dest, name);
- if (address != NULL && *address)
- eab_destination_set_email (dest, address);
- str = eab_destination_exportv(destv);
- bonobo_widget_set_property (BONOBO_WIDGET (priv->entry), "destinations", TC_CORBA_string, str, NULL);
- g_free(str);
- g_object_unref (dest);
-
- g_signal_connect((priv->addressbook), "clicked",
- G_CALLBACK (addressbook_clicked_cb), edd);
-
- return edd;
-
- error:
-
- g_object_unref (edd);
- return NULL;
-}
-
-static gboolean
-get_widgets (EDelegateDialog *edd)
-{
- EDelegateDialogPrivate *priv;
-
- priv = edd->priv;
-
-#define GW(name) glade_xml_get_widget (priv->xml, name)
-
- priv->app = GW ("delegate-dialog");
- priv->hbox = GW ("delegate-hbox");
- priv->addressbook = GW ("addressbook");
-
- return (priv->app
- && priv->hbox
- && priv->addressbook);
-}
-
-static void
-addressbook_clicked_cb (GtkWidget *widget, gpointer data)
-{
- EDelegateDialog *edd = data;
- EDelegateDialogPrivate *priv;
- CORBA_Environment ev;
-
- priv = edd->priv;
-
- CORBA_exception_init (&ev);
-
- GNOME_Evolution_Addressbook_SelectNames_activateDialog (priv->corba_select_names, section_name, &ev);
-
- CORBA_exception_free (&ev);
-}
-
-
-/**
- * e_delegate_dialog_new:
- *
- * Creates a new event editor dialog.
- *
- * Return value: A newly-created event editor dialog, or NULL if the event
- * editor could not be created.
- **/
-EDelegateDialog *
-e_delegate_dialog_new (const char *name, const char *address)
-{
- EDelegateDialog *edd;
-
- edd = E_DELEGATE_DIALOG (g_object_new (E_TYPE_DELEGATE_DIALOG, NULL));
- return e_delegate_dialog_construct (E_DELEGATE_DIALOG (edd), name, address);
-}
-
-char *
-e_delegate_dialog_get_delegate (EDelegateDialog *edd)
-{
- EDelegateDialogPrivate *priv;
- EABDestination **destv;
- char *string = NULL;
-
- g_return_val_if_fail (edd != NULL, NULL);
- g_return_val_if_fail (E_IS_DELEGATE_DIALOG (edd), NULL);
-
- priv = edd->priv;
-
- bonobo_widget_get_property (BONOBO_WIDGET (priv->entry), "destinations", TC_CORBA_string, &string, NULL);
- destv = eab_destination_importv (string);
-
- if (destv && destv[0] != NULL) {
- g_free (priv->address);
- priv->address = g_strdup (eab_destination_get_email (destv[0]));
- g_free (destv);
- }
-
- g_free (string);
-
- return g_strdup (priv->address);
-}
-
-
-char *
-e_delegate_dialog_get_delegate_name (EDelegateDialog *edd)
-{
- EDelegateDialogPrivate *priv;
- EABDestination **destv;
- char *string = NULL;
-
- g_return_val_if_fail (edd != NULL, NULL);
- g_return_val_if_fail (E_IS_DELEGATE_DIALOG (edd), NULL);
-
- priv = edd->priv;
-
- bonobo_widget_get_property (BONOBO_WIDGET (priv->entry), "destinations", TC_CORBA_string, &string, NULL);
- destv = eab_destination_importv (string);
-
- g_message ("importv: [%s]", string);
-
- if (destv && destv[0] != NULL) {
- g_free (priv->name);
- priv->name = g_strdup (eab_destination_get_name (destv[0]));
- g_free (destv);
- }
-
- g_free (string);
-
- return g_strdup (priv->name);
-}
-
-GtkWidget*
-e_delegate_dialog_get_toplevel (EDelegateDialog *edd)
-{
- EDelegateDialogPrivate *priv;
-
- g_return_val_if_fail (edd != NULL, NULL);
- g_return_val_if_fail (E_IS_DELEGATE_DIALOG (edd), NULL);
-
- priv = edd->priv;
-
- return priv->app;
-}
-
diff --git a/calendar/gui/dialogs/e-delegate-dialog.glade b/calendar/gui/dialogs/e-delegate-dialog.glade
deleted file mode 100644
index f08c03ad1d..0000000000
--- a/calendar/gui/dialogs/e-delegate-dialog.glade
+++ /dev/null
@@ -1,113 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-<requires lib="gnome"/>
-
-<widget class="GtkDialog" id="delegate-dialog">
- <property name="title" translatable="yes">Enter Delegate</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="has_separator">True</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox1">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">8</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area1">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="cancel-button">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">-6</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="ok-button">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">-5</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="delegate-hbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label3">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Delegate To:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="addressbook">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Addressbook...</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/calendar/gui/dialogs/e-delegate-dialog.h b/calendar/gui/dialogs/e-delegate-dialog.h
deleted file mode 100644
index 2acc853e0a..0000000000
--- a/calendar/gui/dialogs/e-delegate-dialog.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Evolution calendar - Delegate selector dialog
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Authors: JP Rosevear <jpr@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef __E_DELEGATE_DIALOG_H__
-#define __E_DELEGATE_DIALOG_H__
-
-#include <gtk/gtkwidget.h>
-
-
-
-#define E_TYPE_DELEGATE_DIALOG (e_delegate_dialog_get_type ())
-#define E_DELEGATE_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_DELEGATE_DIALOG, EDelegateDialog))
-#define E_DELEGATE_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_DELEGATE_DIALOG, \
- EDelegateDialogClass))
-#define E_IS_DELEGATE_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_DELEGATE_DIALOG))
-#define E_IS_DELEGATE_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_DELEGATE_DIALOG))
-
-
-typedef struct _EDelegateDialog EDelegateDialog;
-typedef struct _EDelegateDialogClass EDelegateDialogClass;
-typedef struct _EDelegateDialogPrivate EDelegateDialogPrivate;
-
-struct _EDelegateDialog {
- GtkObject object;
-
- /* Private data */
- EDelegateDialogPrivate *priv;
-};
-
-struct _EDelegateDialogClass {
- GtkObjectClass parent_class;
-};
-
-GtkType e_delegate_dialog_get_type (void);
-
-EDelegateDialog* e_delegate_dialog_construct (EDelegateDialog *etd,
- const char *name,
- const char *address);
-
-EDelegateDialog* e_delegate_dialog_new (const char *name,
- const char *address);
-
-char* e_delegate_dialog_get_delegate (EDelegateDialog *etd);
-
-char* e_delegate_dialog_get_delegate_name (EDelegateDialog *etd);
-
-void e_delegate_dialog_set_delegate (EDelegateDialog *etd,
- const char *address);
-
-GtkWidget* e_delegate_dialog_get_toplevel (EDelegateDialog *etd);
-
-
-
-
-#endif /* __E_DELEGATE_DIALOG_H__ */
diff --git a/calendar/gui/dialogs/event-editor.c b/calendar/gui/dialogs/event-editor.c
deleted file mode 100644
index ac117a0039..0000000000
--- a/calendar/gui/dialogs/event-editor.c
+++ /dev/null
@@ -1,522 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/* Evolution calendar - Event editor dialog
- *
- * Copyright (C) 2000 Ximian, Inc.
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Authors: Miguel de Icaza <miguel@ximian.com>
- * Federico Mena-Quintero <federico@ximian.com>
- * Seth Alves <alves@hungry.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-#include <string.h>
-#include <glade/glade.h>
-#include <gal/util/e-util.h>
-#include <libgnome/gnome-i18n.h>
-#include <widgets/misc/e-dateedit.h>
-
-#include "event-page.h"
-#include "alarm-page.h"
-#include "recurrence-page.h"
-#include "meeting-page.h"
-#include "schedule-page.h"
-#include "cancel-comp.h"
-#include "event-editor.h"
-
-struct _EventEditorPrivate {
- EventPage *event_page;
- AlarmPage *alarm_page;
- RecurrencePage *recur_page;
- MeetingPage *meet_page;
- SchedulePage *sched_page;
-
- EMeetingStore *model;
-
- gboolean meeting_shown;
- gboolean updating;
-};
-
-
-
-static void event_editor_class_init (EventEditorClass *class);
-static void event_editor_init (EventEditor *ee);
-static void event_editor_set_e_cal (CompEditor *editor, ECal *client);
-static void event_editor_edit_comp (CompEditor *editor, ECalComponent *comp);
-static gboolean event_editor_send_comp (CompEditor *editor, ECalComponentItipMethod method);
-static void event_editor_finalize (GObject *object);
-
-static void schedule_meeting_cmd (GtkWidget *widget, gpointer data);
-static void refresh_meeting_cmd (GtkWidget *widget, gpointer data);
-static void cancel_meeting_cmd (GtkWidget *widget, gpointer data);
-static void forward_cmd (GtkWidget *widget, gpointer data);
-
-static void model_row_change_insert_cb (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data);
-static void model_row_delete_cb (GtkTreeModel *model, GtkTreePath *path, gpointer data);
-
-static EPixmap pixmaps [] = {
- E_PIXMAP ("/Toolbar/Actions/ActionScheduleMeeting", "schedule-meeting-24.png"),
- E_PIXMAP_END
-};
-
-static BonoboUIVerb verbs [] = {
- BONOBO_UI_UNSAFE_VERB ("ActionScheduleMeeting", schedule_meeting_cmd),
- BONOBO_UI_UNSAFE_VERB ("ActionRefreshMeeting", refresh_meeting_cmd),
- BONOBO_UI_UNSAFE_VERB ("ActionCancelMeeting", cancel_meeting_cmd),
- BONOBO_UI_UNSAFE_VERB ("ActionForward", forward_cmd),
-
- BONOBO_UI_VERB_END
-};
-
-static CompEditorClass *parent_class;
-
-
-
-/**
- * event_editor_get_type:
- *
- * Registers the #EventEditor class if necessary, and returns the type ID
- * associated to it.
- *
- * Return value: The type ID of the #EventEditor class.
- **/
-
-E_MAKE_TYPE (event_editor, "EventEditor", EventEditor, event_editor_class_init,
- event_editor_init, TYPE_COMP_EDITOR);
-
-/* Class initialization function for the event editor */
-static void
-event_editor_class_init (EventEditorClass *klass)
-{
- GObjectClass *gobject_class;
- CompEditorClass *editor_class;
-
- gobject_class = (GObjectClass *) klass;
- editor_class = (CompEditorClass *) klass;
-
- parent_class = g_type_class_ref(TYPE_COMP_EDITOR);
-
- editor_class->set_e_cal = event_editor_set_e_cal;
- editor_class->edit_comp = event_editor_edit_comp;
- editor_class->send_comp = event_editor_send_comp;
-
- gobject_class->finalize = event_editor_finalize;
-}
-
-static void
-set_menu_sens (EventEditor *ee)
-{
- EventEditorPrivate *priv;
- gboolean sens, existing, user, read_only = TRUE;
-
- priv = ee->priv;
-
- existing = comp_editor_get_existing_org (COMP_EDITOR (ee));
- user = comp_editor_get_user_org (COMP_EDITOR (ee));
-
- e_cal_is_read_only (comp_editor_get_e_cal (COMP_EDITOR (ee)), &read_only, NULL);
-
- sens = priv->meeting_shown;
- comp_editor_set_ui_prop (COMP_EDITOR (ee),
- "/commands/ActionScheduleMeeting",
- "sensitive", sens || read_only ? "0" : "1");
-
- sens = priv->meeting_shown && existing && !user && !read_only;
- comp_editor_set_ui_prop (COMP_EDITOR (ee),
- "/commands/ActionRefreshMeeting",
- "sensitive", sens ? "1" : "0");
-
- sens = priv->meeting_shown && existing && user && !read_only;
- comp_editor_set_ui_prop (COMP_EDITOR (ee),
- "/commands/ActionCancelMeeting",
- "sensitive", sens? "1" : "0");
-
- comp_editor_set_ui_prop (COMP_EDITOR (ee),
- "/commands/FileSave",
- "sensitive", read_only ? "0" : "1");
- comp_editor_set_ui_prop (COMP_EDITOR (ee),
- "/commands/FileSaveAndClose",
- "sensitive", read_only ? "0" : "1");
- comp_editor_set_ui_prop (COMP_EDITOR (ee),
- "/commands/FileDelete",
- "sensitive", read_only ? "0" : "1");
-}
-
-static void
-init_widgets (EventEditor *ee)
-{
- EventEditorPrivate *priv;
-
- priv = ee->priv;
-
- g_signal_connect((priv->model), "row_changed",
- G_CALLBACK (model_row_change_insert_cb), ee);
- g_signal_connect((priv->model), "row_inserted",
- G_CALLBACK (model_row_change_insert_cb), ee);
- g_signal_connect((priv->model), "row_deleted",
- G_CALLBACK (model_row_delete_cb), ee);
-}
-
-/* Object initialization function for the event editor */
-static void
-event_editor_init (EventEditor *ee)
-{
- EventEditorPrivate *priv;
-
- priv = g_new0 (EventEditorPrivate, 1);
- ee->priv = priv;
-
- priv->model = E_MEETING_STORE (e_meeting_store_new ());
- priv->meeting_shown = TRUE;
- priv->updating = FALSE;
-}
-
-EventEditor *
-event_editor_construct (EventEditor *ee, ECal *client)
-{
- EventEditorPrivate *priv;
-
- priv = ee->priv;
-
- priv->event_page = event_page_new ();
- g_object_ref (priv->event_page);
- gtk_object_sink (GTK_OBJECT (priv->event_page));
- comp_editor_append_page (COMP_EDITOR (ee),
- COMP_EDITOR_PAGE (priv->event_page),
- _("Appointment"));
-
- priv->alarm_page = alarm_page_new ();
- g_object_ref (priv->alarm_page);
- gtk_object_sink (GTK_OBJECT (priv->alarm_page));
- comp_editor_append_page (COMP_EDITOR (ee),
- COMP_EDITOR_PAGE (priv->alarm_page),
- _("Reminder"));
-
- priv->recur_page = recurrence_page_new ();
- g_object_ref (priv->recur_page);
- gtk_object_sink (GTK_OBJECT (priv->recur_page));
- comp_editor_append_page (COMP_EDITOR (ee),
- COMP_EDITOR_PAGE (priv->recur_page),
- _("Recurrence"));
-
- priv->sched_page = schedule_page_new (priv->model);
- g_object_ref (priv->sched_page);
- gtk_object_sink (GTK_OBJECT (priv->sched_page));
- comp_editor_append_page (COMP_EDITOR (ee),
- COMP_EDITOR_PAGE (priv->sched_page),
- _("Scheduling"));
-
- priv->meet_page = meeting_page_new (priv->model, client);
- g_object_ref (priv->meet_page);
- gtk_object_sink (GTK_OBJECT (priv->meet_page));
- comp_editor_append_page (COMP_EDITOR (ee),
- COMP_EDITOR_PAGE (priv->meet_page),
- _("Meeting"));
-
- comp_editor_set_e_cal (COMP_EDITOR (ee), client);
-
- comp_editor_merge_ui (COMP_EDITOR (ee), "evolution-event-editor.xml", verbs, pixmaps);
-
- init_widgets (ee);
- set_menu_sens (ee);
- gtk_window_set_default_size (GTK_WINDOW (ee), 300, 225);
-
- return ee;
-}
-
-static void
-event_editor_set_e_cal (CompEditor *editor, ECal *client)
-{
- EventEditor *ee;
- EventEditorPrivate *priv;
-
- ee = EVENT_EDITOR (editor);
- priv = ee->priv;
-
- e_meeting_store_set_e_cal (priv->model, client);
-
- if (parent_class->set_e_cal)
- parent_class->set_e_cal (editor, client);
-}
-
-static void
-event_editor_edit_comp (CompEditor *editor, ECalComponent *comp)
-{
- EventEditor *ee;
- EventEditorPrivate *priv;
- ECalComponentOrganizer organizer;
- ECal *client;
- GSList *attendees = NULL;
-
- ee = EVENT_EDITOR (editor);
- priv = ee->priv;
-
- priv->updating = TRUE;
-
- if (parent_class->edit_comp)
- parent_class->edit_comp (editor, comp);
-
- client = comp_editor_get_e_cal (COMP_EDITOR (editor));
-
- /* Get meeting related stuff */
- e_cal_component_get_organizer (comp, &organizer);
- e_cal_component_get_attendee_list (comp, &attendees);
-
- /* Clear things up */
- e_meeting_store_remove_all_attendees (priv->model);
-
- /* Set up the attendees */
- if (attendees == NULL) {
- comp_editor_remove_page (editor, COMP_EDITOR_PAGE (priv->meet_page));
- comp_editor_remove_page (editor, COMP_EDITOR_PAGE (priv->sched_page));
- priv->meeting_shown = FALSE;
- } else {
- GSList *l;
- int row;
-
- if (!priv->meeting_shown) {
- comp_editor_append_page (COMP_EDITOR (ee),
- COMP_EDITOR_PAGE (priv->sched_page),
- _("Scheduling"));
- comp_editor_append_page (COMP_EDITOR (ee),
- COMP_EDITOR_PAGE (priv->meet_page),
- _("Meeting"));
- }
-
- for (l = attendees; l != NULL; l = l->next) {
- ECalComponentAttendee *ca = l->data;
- EMeetingAttendee *ia;
-
- ia = E_MEETING_ATTENDEE (e_meeting_attendee_new_from_e_cal_component_attendee (ca));
-
- /* If we aren't the organizer or the attendee is just delegating, don't allow editing */
- if (!comp_editor_get_user_org (editor) || e_meeting_attendee_is_set_delto (ia))
- e_meeting_attendee_set_edit_level (ia, E_MEETING_ATTENDEE_EDIT_NONE);
- e_meeting_store_add_attendee (priv->model, ia);
-
- g_object_unref(ia);
- }
-
- /* If we aren't the organizer we can still change our own status */
- if (!comp_editor_get_user_org (editor)) {
- EAccountList *accounts;
- EAccount *account;
- EIterator *it;
-
- accounts = itip_addresses_get ();
- for (it = e_list_get_iterator((EList *)accounts);e_iterator_is_valid(it);e_iterator_next(it)) {
- EMeetingAttendee *ia;
-
- account = (EAccount*)e_iterator_get(it);
-
- ia = e_meeting_store_find_attendee (priv->model, account->id->address, &row);
- if (ia != NULL)
- e_meeting_attendee_set_edit_level (ia, E_MEETING_ATTENDEE_EDIT_STATUS);
- }
- g_object_unref(it);
- } else if (e_cal_get_organizer_must_attend (client)) {
- EMeetingAttendee *ia;
-
- ia = e_meeting_store_find_attendee (priv->model, organizer.value, &row);
- if (ia != NULL)
- e_meeting_attendee_set_edit_level (ia, E_MEETING_ATTENDEE_EDIT_NONE);
- }
-
- priv->meeting_shown = TRUE;
- }
- e_cal_component_free_attendee_list (attendees);
-
- set_menu_sens (ee);
- comp_editor_set_needs_send (COMP_EDITOR (ee), priv->meeting_shown && itip_organizer_is_user (comp, client));
-
- priv->updating = FALSE;
-}
-
-static gboolean
-event_editor_send_comp (CompEditor *editor, ECalComponentItipMethod method)
-{
- EventEditor *ee = EVENT_EDITOR (editor);
- EventEditorPrivate *priv;
- ECalComponent *comp = NULL;
-
- priv = ee->priv;
-
- /* Don't cancel more than once or when just publishing */
- if (method == E_CAL_COMPONENT_METHOD_PUBLISH ||
- method == E_CAL_COMPONENT_METHOD_CANCEL)
- goto parent;
-
- comp = meeting_page_get_cancel_comp (priv->meet_page);
- if (comp != NULL) {
- ECal *client;
- gboolean result;
-
- client = e_meeting_store_get_e_cal (priv->model);
- result = itip_send_comp (E_CAL_COMPONENT_METHOD_CANCEL, comp, client, NULL);
- g_object_unref (comp);
-
- if (!result)
- return FALSE;
- }
-
- parent:
- if (parent_class->send_comp)
- return parent_class->send_comp (editor, method);
-
- return FALSE;
-}
-
-/* Destroy handler for the event editor */
-static void
-event_editor_finalize (GObject *object)
-{
- EventEditor *ee;
- EventEditorPrivate *priv;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (IS_EVENT_EDITOR (object));
-
- ee = EVENT_EDITOR (object);
- priv = ee->priv;
-
- g_object_unref (priv->event_page);
- g_object_unref (priv->alarm_page);
- g_object_unref (priv->recur_page);
- g_object_unref (priv->meet_page);
- g_object_unref (priv->sched_page);
-
- g_object_unref (priv->model);
-
- g_free (priv);
-
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
-}
-
-/**
- * event_editor_new:
- * @client: a ECal
- *
- * Creates a new event editor dialog.
- *
- * Return value: A newly-created event editor dialog, or NULL if the event
- * editor could not be created.
- **/
-EventEditor *
-event_editor_new (ECal *client)
-{
- EventEditor *ee;
-
- ee = EVENT_EDITOR (g_object_new (TYPE_EVENT_EDITOR, NULL));
- return event_editor_construct (ee, client);
-}
-
-static void
-show_meeting (EventEditor *ee)
-{
- EventEditorPrivate *priv;
-
- priv = ee->priv;
-
- if (!priv->meeting_shown) {
- comp_editor_append_page (COMP_EDITOR (ee),
- COMP_EDITOR_PAGE (priv->sched_page),
- _("Scheduling"));
- comp_editor_append_page (COMP_EDITOR (ee),
- COMP_EDITOR_PAGE (priv->meet_page),
- _("Meeting"));
- priv->meeting_shown = TRUE;
-
- set_menu_sens (ee);
- comp_editor_set_changed (COMP_EDITOR (ee), priv->meeting_shown);
- comp_editor_set_needs_send (COMP_EDITOR (ee), priv->meeting_shown);
- }
-
- comp_editor_show_page (COMP_EDITOR (ee),
- COMP_EDITOR_PAGE (priv->meet_page));
-}
-
-void
-event_editor_show_meeting (EventEditor *ee)
-{
- g_return_if_fail (ee != NULL);
- g_return_if_fail (IS_EVENT_EDITOR (ee));
-
-
- show_meeting (ee);
-}
-
-static void
-schedule_meeting_cmd (GtkWidget *widget, gpointer data)
-{
- EventEditor *ee = EVENT_EDITOR (data);
-
- show_meeting (ee);
-}
-
-static void
-refresh_meeting_cmd (GtkWidget *widget, gpointer data)
-{
- EventEditor *ee = EVENT_EDITOR (data);
-
- comp_editor_send_comp (COMP_EDITOR (ee), E_CAL_COMPONENT_METHOD_REFRESH);
-}
-
-static void
-cancel_meeting_cmd (GtkWidget *widget, gpointer data)
-{
- EventEditor *ee = EVENT_EDITOR (data);
- ECalComponent *comp;
-
- comp = comp_editor_get_current_comp (COMP_EDITOR (ee));
- if (cancel_component_dialog ((GtkWindow *) ee,
- comp_editor_get_e_cal (COMP_EDITOR (ee)), comp, FALSE)) {
- comp_editor_send_comp (COMP_EDITOR (ee), E_CAL_COMPONENT_METHOD_CANCEL);
- comp_editor_delete_comp (COMP_EDITOR (ee));
- }
-}
-
-static void
-forward_cmd (GtkWidget *widget, gpointer data)
-{
- EventEditor *ee = EVENT_EDITOR (data);
-
- if (comp_editor_save_comp (COMP_EDITOR (ee), TRUE))
- comp_editor_send_comp (COMP_EDITOR (ee), E_CAL_COMPONENT_METHOD_PUBLISH);
-}
-
-static void
-model_changed (EventEditor *ee)
-{
- if (!ee->priv->updating) {
- comp_editor_set_changed (COMP_EDITOR (ee), TRUE);
- comp_editor_set_needs_send (COMP_EDITOR (ee), TRUE);
- }
-}
-
-static void
-model_row_change_insert_cb (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
-{
- model_changed (EVENT_EDITOR (data));
-}
-
-static void
-model_row_delete_cb (GtkTreeModel *model, GtkTreePath *path, gpointer data)
-{
- model_changed (EVENT_EDITOR (data));
-}
-
diff --git a/calendar/gui/dialogs/event-editor.h b/calendar/gui/dialogs/event-editor.h
deleted file mode 100644
index 9234b8310e..0000000000
--- a/calendar/gui/dialogs/event-editor.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* Evolution calendar - Event editor dialog
- *
- * Copyright (C) 2000 Ximian, Inc.
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Authors: Miguel de Icaza <miguel@ximian.com>
- * Federico Mena-Quintero <federico@ximian.com>
- * Seth Alves <alves@hungry.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef __EVENT_EDITOR_H__
-#define __EVENT_EDITOR_H__
-
-#include <gtk/gtkobject.h>
-#include "comp-editor.h"
-
-
-
-#define TYPE_EVENT_EDITOR (event_editor_get_type ())
-#define EVENT_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_EVENT_EDITOR, EventEditor))
-#define EVENT_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_EVENT_EDITOR, EventEditorClass))
-#define IS_EVENT_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_EVENT_EDITOR))
-#define IS_EVENT_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_EVENT_EDITOR))
-
-typedef struct _EventEditor EventEditor;
-typedef struct _EventEditorClass EventEditorClass;
-typedef struct _EventEditorPrivate EventEditorPrivate;
-
-struct _EventEditor {
- CompEditor parent;
-
- /* Private data */
- EventEditorPrivate *priv;
-};
-
-struct _EventEditorClass {
- CompEditorClass parent_class;
-};
-
-GtkType event_editor_get_type (void);
-EventEditor *event_editor_construct (EventEditor *ee,
- ECal *client);
-EventEditor *event_editor_new (ECal *client);
-void event_editor_show_meeting (EventEditor *ee);
-
-
-
-#endif /* __EVENT_EDITOR_H__ */
diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c
deleted file mode 100644
index c943825c84..0000000000
--- a/calendar/gui/dialogs/event-page.c
+++ /dev/null
@@ -1,1371 +0,0 @@
-/* Evolution calendar - Main page of the event editor dialog
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Authors: Federico Mena-Quintero <federico@ximian.com>
- * Miguel de Icaza <miguel@ximian.com>
- * Seth Alves <alves@hungry.com>
- * JP Rosevear <jpr@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-#include <gtk/gtksignal.h>
-#include <gtk/gtktextview.h>
-#include <gtk/gtktogglebutton.h>
-#include <libgnome/gnome-i18n.h>
-#include <glade/glade.h>
-#include <gal/widgets/e-categories.h>
-#include "e-util/e-categories-config.h"
-#include "e-util/e-dialog-widgets.h"
-#include "widgets/misc/e-dateedit.h"
-#include <libecal/e-cal-time-util.h>
-#include "../calendar-config.h"
-#include "../e-timezone-entry.h"
-#include "comp-editor-util.h"
-#include "event-page.h"
-
-
-
-/* Private part of the EventPage structure */
-struct _EventPagePrivate {
- /* Glade XML data */
- GladeXML *xml;
-
- /* Widgets from the Glade file */
-
- GtkWidget *main;
-
- GtkWidget *summary;
- GtkWidget *location;
-
- GtkWidget *start_time;
- GtkWidget *end_time;
- GtkWidget *start_timezone;
- GtkWidget *end_timezone;
- GtkWidget *all_day_event;
-
- GtkWidget *description;
-
- GtkWidget *classification_public;
- GtkWidget *classification_private;
- GtkWidget *classification_confidential;
-
- GtkWidget *show_time_frame;
- GtkWidget *show_time_as_free;
- GtkWidget *show_time_as_busy;
-
- GtkWidget *categories_btn;
- GtkWidget *categories;
-
- gboolean updating;
-
- /* This is TRUE if both the start & end timezone are the same. If the
- start timezone is then changed, we updated the end timezone to the
- same value, since 99% of events start and end in one timezone. */
- gboolean sync_timezones;
-};
-
-
-
-static void event_page_class_init (EventPageClass *class);
-static void event_page_init (EventPage *epage);
-static void event_page_finalize (GObject *object);
-
-static GtkWidget *event_page_get_widget (CompEditorPage *page);
-static void event_page_focus_main_widget (CompEditorPage *page);
-static void event_page_fill_widgets (CompEditorPage *page, ECalComponent *comp);
-static gboolean event_page_fill_component (CompEditorPage *page, ECalComponent *comp);
-static void event_page_set_summary (CompEditorPage *page, const char *summary);
-static void event_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates);
-
-static CompEditorPageClass *parent_class = NULL;
-
-
-
-/**
- * event_page_get_type:
- *
- * Registers the #EventPage class if necessary, and returns the type ID
- * associated to it.
- *
- * Return value: The type ID of the #EventPage class.
- **/
-
-E_MAKE_TYPE (event_page, "EventPage", EventPage, event_page_class_init, event_page_init,
- TYPE_COMP_EDITOR_PAGE);
-
-/* Class initialization function for the event page */
-static void
-event_page_class_init (EventPageClass *class)
-{
- CompEditorPageClass *editor_page_class;
- GObjectClass *object_class;
-
- editor_page_class = (CompEditorPageClass *) class;
- object_class = (GObjectClass *) class;
-
- parent_class = g_type_class_ref (TYPE_COMP_EDITOR_PAGE);
-
- editor_page_class->get_widget = event_page_get_widget;
- editor_page_class->focus_main_widget = event_page_focus_main_widget;
- editor_page_class->fill_widgets = event_page_fill_widgets;
- editor_page_class->fill_component = event_page_fill_component;
- editor_page_class->set_summary = event_page_set_summary;
- editor_page_class->set_dates = event_page_set_dates;
-
- object_class->finalize = event_page_finalize;
-}
-
-/* Object initialization function for the event page */
-static void
-event_page_init (EventPage *epage)
-{
- EventPagePrivate *priv;
-
- priv = g_new0 (EventPagePrivate, 1);
- epage->priv = priv;
-
- priv->xml = NULL;
-
- priv->main = NULL;
- priv->summary = NULL;
- priv->location = NULL;
- priv->start_time = NULL;
- priv->end_time = NULL;
- priv->start_timezone = NULL;
- priv->end_timezone = NULL;
- priv->all_day_event = NULL;
- priv->description = NULL;
- priv->classification_public = NULL;
- priv->classification_private = NULL;
- priv->classification_confidential = NULL;
- priv->show_time_frame = NULL;
- priv->show_time_as_free = NULL;
- priv->show_time_as_busy = NULL;
- priv->categories_btn = NULL;
- priv->categories = NULL;
-
- priv->updating = FALSE;
- priv->sync_timezones = FALSE;
-}
-
-/* Destroy handler for the event page */
-static void
-event_page_finalize (GObject *object)
-{
- EventPage *epage;
- EventPagePrivate *priv;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (IS_EVENT_PAGE (object));
-
- epage = EVENT_PAGE (object);
- priv = epage->priv;
-
- if (priv->main)
- gtk_widget_unref (priv->main);
-
- if (priv->xml) {
- g_object_unref (priv->xml);
- priv->xml = NULL;
- }
-
- g_free (priv);
- epage->priv = NULL;
-
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
-}
-
-
-
-static const int classification_map[] = {
- E_CAL_COMPONENT_CLASS_PUBLIC,
- E_CAL_COMPONENT_CLASS_PRIVATE,
- E_CAL_COMPONENT_CLASS_CONFIDENTIAL,
- -1
-};
-
-static const int transparency_map[] = {
- E_CAL_COMPONENT_TRANSP_TRANSPARENT,
- E_CAL_COMPONENT_TRANSP_OPAQUE,
- -1
-};
-
-/* get_widget handler for the event page */
-static GtkWidget *
-event_page_get_widget (CompEditorPage *page)
-{
- EventPage *epage;
- EventPagePrivate *priv;
-
- epage = EVENT_PAGE (page);
- priv = epage->priv;
-
- return priv->main;
-}
-
-/* focus_main_widget handler for the event page */
-static void
-event_page_focus_main_widget (CompEditorPage *page)
-{
- EventPage *epage;
- EventPagePrivate *priv;
-
- epage = EVENT_PAGE (page);
- priv = epage->priv;
-
- gtk_widget_grab_focus (priv->summary);
-}
-
-/* Sets the 'All Day Event' flag to the given value (without emitting signals),
- * and shows or hides the widgets as appropriate. */
-static void
-set_all_day (EventPage *epage, gboolean all_day)
-{
- EventPagePrivate *priv;
-
- priv = epage->priv;
-
- gtk_signal_handler_block_by_data (GTK_OBJECT (priv->all_day_event),
- epage);
- e_dialog_toggle_set (priv->all_day_event, all_day);
- gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->all_day_event),
- epage);
-
- e_date_edit_set_show_time (E_DATE_EDIT (priv->start_time), !all_day);
- e_date_edit_set_show_time (E_DATE_EDIT (priv->end_time), !all_day);
-
- /* DATE values do not have timezones, so we hide the fields. */
- if (all_day) {
- gtk_widget_hide (priv->start_timezone);
- gtk_widget_hide (priv->end_timezone);
- } else {
- gtk_widget_show (priv->start_timezone);
- gtk_widget_show (priv->end_timezone);
- }
-}
-
-static void
-update_time (EventPage *epage, ECalComponentDateTime *start_date, ECalComponentDateTime *end_date)
-{
- EventPagePrivate *priv;
- struct icaltimetype *start_tt, *end_tt, implied_tt;
- icaltimezone *start_zone = NULL, *end_zone = NULL;
- gboolean all_day_event;
-
- priv = epage->priv;
-
- /* Note that if we are creating a new event, the timezones may not be
- on the server, so we try to get the builtin timezone with the TZID
- first. */
- start_zone = icaltimezone_get_builtin_timezone_from_tzid (start_date->tzid);
- if (!start_zone) {
- /* FIXME: Handle error better. */
- if (!e_cal_get_timezone (COMP_EDITOR_PAGE (epage)->client,
- start_date->tzid, &start_zone, NULL)) {
- g_warning ("Couldn't get timezone from server: %s",
- start_date->tzid ? start_date->tzid : "");
- }
- }
-
- end_zone = icaltimezone_get_builtin_timezone_from_tzid (end_date->tzid);
- if (!end_zone) {
- if (!e_cal_get_timezone (COMP_EDITOR_PAGE (epage)->client,
- end_date->tzid, &end_zone, NULL)) {
- /* FIXME: Handle error better. */
- g_warning ("Couldn't get timezone from server: %s",
- end_date->tzid ? end_date->tzid : "");
- }
- }
-
- /* If both times are DATE values, we set the 'All Day Event' checkbox.
- Also, if DTEND is after DTSTART, we subtract 1 day from it. */
- all_day_event = FALSE;
- start_tt = start_date->value;
- end_tt = end_date->value;
- if (!end_tt && start_tt->is_date) {
- end_tt = &implied_tt;
- *end_tt = *start_tt;
- icaltime_adjust (end_tt, 1, 0, 0, 0);
- }
-
- if (start_tt->is_date && end_tt->is_date) {
- all_day_event = TRUE;
- if (icaltime_compare_date_only (*end_tt, *start_tt) > 0) {
- icaltime_adjust (end_tt, -1, 0, 0, 0);
- }
- }
-
- set_all_day (epage, all_day_event);
-
- /* If it is an all day event, we set both timezones to the current
- timezone, so that if the user toggles the 'All Day Event' checkbox
- the event uses the current timezone rather than none at all. */
- if (all_day_event) {
- char *location = calendar_config_get_timezone ();
- start_zone = end_zone = icaltimezone_get_builtin_timezone (location);
- }
-
-
- gtk_signal_handler_block_by_data (GTK_OBJECT (priv->start_time),
- epage);
- g_signal_handlers_block_matched (priv->end_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage);
-
- e_date_edit_set_date (E_DATE_EDIT (priv->start_time), start_tt->year,
- start_tt->month, start_tt->day);
- e_date_edit_set_time_of_day (E_DATE_EDIT (priv->start_time),
- start_tt->hour, start_tt->minute);
-
- e_date_edit_set_date (E_DATE_EDIT (priv->end_time), end_tt->year,
- end_tt->month, end_tt->day);
- e_date_edit_set_time_of_day (E_DATE_EDIT (priv->end_time),
- end_tt->hour, end_tt->minute);
-
- gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->start_time),
- epage);
- gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->end_time),
- epage);
-
- /* Set the timezones, and set sync_timezones to TRUE if both timezones
- are the same. */
- gtk_signal_handler_block_by_data (GTK_OBJECT (priv->start_timezone),
- epage);
- g_signal_handlers_block_matched (priv->end_timezone, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage);
-
- e_timezone_entry_set_timezone (E_TIMEZONE_ENTRY (priv->start_timezone),
- start_zone);
- e_timezone_entry_set_timezone (E_TIMEZONE_ENTRY (priv->end_timezone),
- end_zone);
-
- gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->start_timezone),
- epage);
- gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->end_timezone),
- epage);
-
- priv->sync_timezones = (start_zone == end_zone) ? TRUE : FALSE;
-
-}
-
-/* Fills the widgets with default values */
-static void
-clear_widgets (EventPage *epage)
-{
- EventPagePrivate *priv;
-
- priv = epage->priv;
-
- /* Summary, description */
- e_dialog_editable_set (priv->summary, NULL);
- e_dialog_editable_set (priv->location, NULL);
- gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->description)), "", 0);
-
- /* Start and end times */
- gtk_signal_handler_block_by_data (GTK_OBJECT (priv->start_time),
- epage);
- g_signal_handlers_block_matched (priv->end_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage);
-
- e_date_edit_set_time (E_DATE_EDIT (priv->start_time), 0);
- e_date_edit_set_time (E_DATE_EDIT (priv->end_time), 0);
-
- gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->start_time),
- epage);
- gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->end_time),
- epage);
-
- set_all_day (epage, FALSE);
-
- /* Classification */
- e_dialog_radio_set (priv->classification_public,
- E_CAL_COMPONENT_CLASS_PRIVATE, classification_map);
-
- /* Show Time As (Transparency) */
- e_dialog_radio_set (priv->show_time_as_free,
- E_CAL_COMPONENT_TRANSP_OPAQUE, transparency_map);
-
- /* Categories */
- e_dialog_editable_set (priv->categories, NULL);
-}
-
-
-/* fill_widgets handler for the event page */
-static void
-event_page_fill_widgets (CompEditorPage *page, ECalComponent *comp)
-{
- EventPage *epage;
- EventPagePrivate *priv;
- ECalComponentText text;
- ECalComponentClassification cl;
- ECalComponentTransparency transparency;
- ECalComponentDateTime start_date, end_date;
- const char *location;
- const char *categories;
- GSList *l;
-
- g_return_if_fail (page->client != NULL);
-
- epage = EVENT_PAGE (page);
- priv = epage->priv;
-
- /* Don't send off changes during this time */
- priv->updating = TRUE;
-
- /* Clean the page */
- clear_widgets (epage);
-
- /* Summary, location, description(s) */
-
- e_cal_component_get_summary (comp, &text);
- e_dialog_editable_set (priv->summary, text.value);
-
- e_cal_component_get_location (comp, &location);
- e_dialog_editable_set (priv->location, location);
-
- e_cal_component_get_description_list (comp, &l);
- if (l) {
- text = *(ECalComponentText *)l->data;
- gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->description)),
- text.value, -1);
- }
- e_cal_component_free_text_list (l);
-
- /* Start and end times */
-
- e_cal_component_get_dtstart (comp, &start_date);
- e_cal_component_get_dtend (comp, &end_date);
-
- update_time (epage, &start_date, &end_date);
-
- e_cal_component_free_datetime (&start_date);
- e_cal_component_free_datetime (&end_date);
-
- /* Classification */
-
- e_cal_component_get_classification (comp, &cl);
-
- switch (cl) {
- case E_CAL_COMPONENT_CLASS_PUBLIC:
- e_dialog_radio_set (priv->classification_public,
- E_CAL_COMPONENT_CLASS_PUBLIC,
- classification_map);
- break;
-
- case E_CAL_COMPONENT_CLASS_PRIVATE:
- e_dialog_radio_set (priv->classification_public,
- E_CAL_COMPONENT_CLASS_PRIVATE,
- classification_map);
- break;
-
- case E_CAL_COMPONENT_CLASS_CONFIDENTIAL:
- e_dialog_radio_set (priv->classification_public,
- E_CAL_COMPONENT_CLASS_CONFIDENTIAL,
- classification_map);
- break;
-
- default:
- /* default to PUBLIC */
- e_dialog_radio_set (priv->classification_public,
- E_CAL_COMPONENT_CLASS_PUBLIC,
- classification_map);
- break;
- }
-
-
- /* Show Time As (Transparency) */
- e_cal_component_get_transparency (comp, &transparency);
- switch (transparency) {
- case E_CAL_COMPONENT_TRANSP_TRANSPARENT:
- e_dialog_radio_set (priv->show_time_as_free,
- E_CAL_COMPONENT_TRANSP_TRANSPARENT,
- transparency_map);
- break;
-
- default:
- e_dialog_radio_set (priv->show_time_as_free,
- E_CAL_COMPONENT_TRANSP_OPAQUE,
- transparency_map);
- break;
- }
- if (e_cal_get_static_capability (page->client, CAL_STATIC_CAPABILITY_NO_TRANSPARENCY))
- gtk_widget_hide (priv->show_time_frame);
- else
- gtk_widget_show (priv->show_time_frame);
-
- /* Categories */
- e_cal_component_get_categories (comp, &categories);
- e_dialog_editable_set (priv->categories, categories);
-
- priv->updating = FALSE;
-}
-
-/* fill_component handler for the event page */
-static gboolean
-event_page_fill_component (CompEditorPage *page, ECalComponent *comp)
-{
- EventPage *epage;
- EventPagePrivate *priv;
- ECalComponentDateTime start_date, end_date;
- struct icaltimetype start_tt, end_tt;
- gboolean all_day_event, start_date_set, end_date_set;
- char *cat, *str;
- ECalComponentClassification classif;
- ECalComponentTransparency transparency;
- GtkTextBuffer *text_buffer;
- GtkTextIter text_iter_start, text_iter_end;
-
- epage = EVENT_PAGE (page);
- priv = epage->priv;
- text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->description));
-
- /* Summary */
-
- str = e_dialog_editable_get (priv->summary);
- if (!str || strlen (str) == 0)
- e_cal_component_set_summary (comp, NULL);
- else {
- ECalComponentText text;
-
- text.value = str;
- text.altrep = NULL;
-
- e_cal_component_set_summary (comp, &text);
- }
-
- if (str)
- g_free (str);
-
- /* Location */
-
- str = e_dialog_editable_get (priv->location);
- if (!str || strlen (str) == 0)
- e_cal_component_set_location (comp, NULL);
- else
- e_cal_component_set_location (comp, str);
-
- if (str)
- g_free (str);
-
- /* Description */
-
- gtk_text_buffer_get_start_iter (text_buffer, &text_iter_start);
- gtk_text_buffer_get_end_iter (text_buffer, &text_iter_end);
- str = gtk_text_buffer_get_text (text_buffer, &text_iter_start, &text_iter_end, FALSE);
-
- if (!str || strlen (str) == 0)
- e_cal_component_set_description_list (comp, NULL);
- else {
- GSList l;
- ECalComponentText text;
-
- text.value = str;
- text.altrep = NULL;
- l.data = &text;
- l.next = NULL;
-
- e_cal_component_set_description_list (comp, &l);
- }
-
- if (str)
- g_free (str);
-
- /* Dates */
-
- start_tt = icaltime_null_time ();
- start_date.value = &start_tt;
- start_date.tzid = NULL;
-
- end_tt = icaltime_null_time ();
- end_date.value = &end_tt;
- end_date.tzid = NULL;
-
- if (!e_date_edit_date_is_valid (E_DATE_EDIT (priv->start_time))) {
- comp_editor_page_display_validation_error (page, _("Start date is wrong"), priv->start_time);
- return FALSE;
- }
- start_date_set = e_date_edit_get_date (E_DATE_EDIT (priv->start_time),
- &start_tt.year,
- &start_tt.month,
- &start_tt.day);
- g_assert (start_date_set);
-
- if (!e_date_edit_date_is_valid (E_DATE_EDIT (priv->end_time))) {
- comp_editor_page_display_validation_error (page, _("End date is wrong"), priv->end_time);
- return FALSE;
- }
- end_date_set = e_date_edit_get_date (E_DATE_EDIT (priv->end_time),
- &end_tt.year,
- &end_tt.month,
- &end_tt.day);
- g_assert (end_date_set);
-
- /* If the all_day toggle is set, we use DATE values for DTSTART and
- DTEND. If not, we fetch the hour & minute from the widgets. */
- all_day_event = e_dialog_toggle_get (priv->all_day_event);
-
- if (all_day_event) {
- start_tt.is_date = TRUE;
- end_tt.is_date = TRUE;
-
- /* We have to add 1 day to DTEND, as it is not inclusive. */
- icaltime_adjust (&end_tt, 1, 0, 0, 0);
- } else {
- icaltimezone *start_zone, *end_zone;
-
- if (!e_date_edit_time_is_valid (E_DATE_EDIT (priv->start_time))) {
- comp_editor_page_display_validation_error (page, _("Start time is wrong"), priv->start_time);
- return FALSE;
- }
- e_date_edit_get_time_of_day (E_DATE_EDIT (priv->start_time),
- &start_tt.hour,
- &start_tt.minute);
- if (!e_date_edit_time_is_valid (E_DATE_EDIT (priv->end_time))) {
- comp_editor_page_display_validation_error (page, _("End time is wrong"), priv->end_time);
- return FALSE;
- }
- e_date_edit_get_time_of_day (E_DATE_EDIT (priv->end_time),
- &end_tt.hour,
- &end_tt.minute);
- start_zone = e_timezone_entry_get_timezone (E_TIMEZONE_ENTRY (priv->start_timezone));
- start_date.tzid = icaltimezone_get_tzid (start_zone);
- end_zone = e_timezone_entry_get_timezone (E_TIMEZONE_ENTRY (priv->end_timezone));
- end_date.tzid = icaltimezone_get_tzid (end_zone);
- }
-
- e_cal_component_set_dtstart (comp, &start_date);
- e_cal_component_set_dtend (comp, &end_date);
-
-
- /* Categories */
-
- cat = e_dialog_editable_get (priv->categories);
- str = comp_editor_strip_categories (cat);
- if (cat)
- g_free (cat);
-
- e_cal_component_set_categories (comp, str);
-
- if (str)
- g_free (str);
-
- /* Classification */
-
- classif = e_dialog_radio_get (priv->classification_public,
- classification_map);
- e_cal_component_set_classification (comp, classif);
-
- /* Show Time As (Transparency) */
-
- transparency = e_dialog_radio_get (priv->show_time_as_free,
- transparency_map);
- e_cal_component_set_transparency (comp, transparency);
-
- return TRUE;
-}
-
-/* set_summary handler for the event page */
-static void
-event_page_set_summary (CompEditorPage *page, const char *summary)
-{
- /* nothing */
-}
-
-static void
-event_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates)
-{
- update_time (EVENT_PAGE (page), dates->start, dates->end);
-}
-
-
-
-/* Gets the widgets from the XML file and returns if they are all available. */
-static gboolean
-get_widgets (EventPage *epage)
-{
- CompEditorPage *page = COMP_EDITOR_PAGE (epage);
- EventPagePrivate *priv;
- GSList *accel_groups;
- GtkWidget *toplevel;
-
- priv = epage->priv;
-
-#define GW(name) glade_xml_get_widget (priv->xml, name)
-
- priv->main = GW ("event-page");
- if (!priv->main)
- return FALSE;
-
- /* Get the GtkAccelGroup from the toplevel window, so we can install
- it when the notebook page is mapped. */
- toplevel = gtk_widget_get_toplevel (priv->main);
- accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel));
- if (accel_groups) {
- page->accel_group = accel_groups->data;
- gtk_accel_group_ref (page->accel_group);
- }
-
- gtk_widget_ref (priv->main);
- gtk_container_remove (GTK_CONTAINER (priv->main->parent), priv->main);
-
- priv->summary = GW ("general-summary");
- priv->location = GW ("location");
-
- /* Glade's visibility flag doesn't seem to work for custom widgets */
- priv->start_time = GW ("start-time");
- gtk_widget_show (priv->start_time);
- priv->end_time = GW ("end-time");
- gtk_widget_show (priv->end_time);
-
- priv->start_timezone = GW ("start-timezone");
- priv->end_timezone = GW ("end-timezone");
- priv->all_day_event = GW ("all-day-event");
-
- priv->description = GW ("description");
-
- priv->classification_public = GW ("classification-public");
- priv->classification_private = GW ("classification-private");
- priv->classification_confidential = GW ("classification-confidential");
-
- priv->show_time_frame = GW ("show-time-frame");
- priv->show_time_as_free = GW ("show-time-as-free");
- priv->show_time_as_busy = GW ("show-time-as-busy");
-
- priv->categories_btn = GW ("categories-button");
- priv->categories = GW ("categories");
-
-#undef GW
-
- return (priv->summary
- && priv->location
- && priv->start_time
- && priv->end_time
- && priv->start_timezone
- && priv->end_timezone
- && priv->all_day_event
- && priv->description
- && priv->classification_public
- && priv->classification_private
- && priv->classification_confidential
- && priv->show_time_frame
- && priv->show_time_as_free
- && priv->show_time_as_busy
- && priv->categories_btn
- && priv->categories);
-}
-
-/* Callback used when the summary changes; we emit the notification signal. */
-static void
-summary_changed_cb (GtkEditable *editable, gpointer data)
-{
- EventPage *epage;
- EventPagePrivate *priv;
- gchar *summary;
-
- epage = EVENT_PAGE (data);
- priv = epage->priv;
-
- if (priv->updating)
- return;
-
- summary = e_dialog_editable_get (GTK_WIDGET (editable));
- comp_editor_page_notify_summary_changed (COMP_EDITOR_PAGE (epage),
- summary);
- g_free (summary);
-}
-
-
-/* Note that this assumes that the start_tt and end_tt passed to it are the
- dates visible to the user. For DATE values, we have to add 1 day to the
- end_tt before emitting the signal. */
-static void
-notify_dates_changed (EventPage *epage, struct icaltimetype *start_tt,
- struct icaltimetype *end_tt)
-{
- EventPagePrivate *priv;
- CompEditorPageDates dates;
- ECalComponentDateTime start_dt, end_dt;
- gboolean all_day_event;
- icaltimezone *start_zone = NULL, *end_zone = NULL;
-
- priv = epage->priv;
-
- all_day_event = e_dialog_toggle_get (priv->all_day_event);
-
- start_dt.value = start_tt;
- end_dt.value = end_tt;
-
- if (all_day_event) {
- /* The actual DTEND is 1 day after the displayed date for
- DATE values. */
- icaltime_adjust (end_tt, 1, 0, 0, 0);
- } else {
- start_zone = e_timezone_entry_get_timezone (E_TIMEZONE_ENTRY (priv->start_timezone));
- end_zone = e_timezone_entry_get_timezone (E_TIMEZONE_ENTRY (priv->end_timezone));
- }
-
- start_dt.tzid = start_zone ? icaltimezone_get_tzid (start_zone) : NULL;
- end_dt.tzid = end_zone ? icaltimezone_get_tzid (end_zone) : NULL;
-
- dates.start = &start_dt;
- dates.end = &end_dt;
-
- dates.due = NULL;
- dates.complete = NULL;
-
- comp_editor_page_notify_dates_changed (COMP_EDITOR_PAGE (epage),
- &dates);
-}
-
-
-static gboolean
-check_start_before_end (struct icaltimetype *start_tt,
- icaltimezone *start_zone,
- struct icaltimetype *end_tt,
- icaltimezone *end_zone,
- gboolean adjust_end_time)
-{
- struct icaltimetype end_tt_copy;
- int cmp;
-
- /* Convert the end time to the same timezone as the start time. */
- end_tt_copy = *end_tt;
- icaltimezone_convert_time (&end_tt_copy, end_zone, start_zone);
-
- /* Now check if the start time is after the end time. If it is,
- we need to modify one of the times. */
- cmp = icaltime_compare (*start_tt, end_tt_copy);
- if (cmp > 0) {
- if (adjust_end_time) {
- /* Modify the end time, to be the start + 1 hour. */
- *end_tt = *start_tt;
- icaltime_adjust (end_tt, 0, 1, 0, 0);
- icaltimezone_convert_time (end_tt, start_zone,
- end_zone);
- } else {
- /* Modify the start time, to be the end - 1 hour. */
- *start_tt = *end_tt;
- icaltime_adjust (start_tt, 0, -1, 0, 0);
- icaltimezone_convert_time (start_tt, end_zone,
- start_zone);
- }
- return TRUE;
- }
-
- return FALSE;
-}
-
-
-/*
- * This is called whenever the start or end dates or timezones is changed.
- * It makes sure that the start date < end date. It also emits the notification
- * signals so the other event editor pages update their labels etc.
- *
- * If adjust_end_time is TRUE, if the start time < end time it will adjust
- * the end time. If FALSE it will adjust the start time. If the user sets the
- * start or end time, the other time is adjusted to make it valid.
- */
-static void
-times_updated (EventPage *epage, gboolean adjust_end_time)
-{
- EventPagePrivate *priv;
- struct icaltimetype start_tt = icaltime_null_time();
- struct icaltimetype end_tt = icaltime_null_time();
- gboolean date_set, all_day_event;
- gboolean set_start_date = FALSE, set_end_date = FALSE;
- icaltimezone *start_zone, *end_zone;
-
- priv = epage->priv;
-
- if (priv->updating)
- return;
-
- /* Fetch the start and end times and timezones from the widgets. */
- all_day_event = e_dialog_toggle_get (priv->all_day_event);
-
- date_set = e_date_edit_get_date (E_DATE_EDIT (priv->start_time),
- &start_tt.year,
- &start_tt.month,
- &start_tt.day);
- g_assert (date_set);
-
- date_set = e_date_edit_get_date (E_DATE_EDIT (priv->end_time),
- &end_tt.year,
- &end_tt.month,
- &end_tt.day);
- g_assert (date_set);
-
- if (all_day_event) {
- /* All Day Events are simple. We just compare the dates and if
- start > end we copy one of them to the other. */
- int cmp = icaltime_compare_date_only (start_tt, end_tt);
- if (cmp > 0) {
- if (adjust_end_time) {
- end_tt = start_tt;
- set_end_date = TRUE;
- } else {
- start_tt = end_tt;
- set_start_date = TRUE;
- }
- }
-
- start_tt.is_date = TRUE;
- end_tt.is_date = TRUE;
- } else {
- /* For DATE-TIME events, we have to convert to the same
- timezone before comparing. */
- e_date_edit_get_time_of_day (E_DATE_EDIT (priv->start_time),
- &start_tt.hour,
- &start_tt.minute);
- e_date_edit_get_time_of_day (E_DATE_EDIT (priv->end_time),
- &end_tt.hour,
- &end_tt.minute);
-
- start_zone = e_timezone_entry_get_timezone (E_TIMEZONE_ENTRY (priv->start_timezone));
- end_zone = e_timezone_entry_get_timezone (E_TIMEZONE_ENTRY (priv->end_timezone));
-
- if (check_start_before_end (&start_tt, start_zone,
- &end_tt, end_zone,
- adjust_end_time)) {
- if (adjust_end_time)
- set_end_date = TRUE;
- else
- set_start_date = TRUE;
- }
- }
-
-
- if (set_start_date) {
- g_signal_handlers_block_matched (priv->start_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage);
- e_date_edit_set_date (E_DATE_EDIT (priv->start_time),
- start_tt.year, start_tt.month,
- start_tt.day);
- e_date_edit_set_time_of_day (E_DATE_EDIT (priv->start_time),
- start_tt.hour, start_tt.minute);
- g_signal_handlers_unblock_matched (priv->start_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage);
- }
-
- if (set_end_date) {
- g_signal_handlers_block_matched (priv->end_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage);
- e_date_edit_set_date (E_DATE_EDIT (priv->end_time),
- end_tt.year, end_tt.month, end_tt.day);
- e_date_edit_set_time_of_day (E_DATE_EDIT (priv->end_time),
- end_tt.hour, end_tt.minute);
- g_signal_handlers_unblock_matched (priv->end_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage);
- }
-
- /* Notify upstream */
- notify_dates_changed (epage, &start_tt, &end_tt);
-}
-
-/* Callback used when the start or end date widgets change. We check that the
- * start date < end date and we set the "all day event" button as appropriate.
- */
-static void
-date_changed_cb (GtkWidget *dedit, gpointer data)
-{
- EventPage *epage;
-
- epage = EVENT_PAGE (data);
-
- times_updated (epage, dedit == epage->priv->start_time);
-}
-
-
-/* Callback used when the start timezone is changed. If sync_timezones is set,
- * we set the end timezone to the same value. It also updates the start time
- * labels on the other notebook pages.
- */
-static void
-start_timezone_changed_cb (GtkWidget *widget, gpointer data)
-{
- EventPage *epage;
- EventPagePrivate *priv;
- icaltimezone *zone;
-
- epage = EVENT_PAGE (data);
- priv = epage->priv;
-
- if (priv->sync_timezones) {
- zone = e_timezone_entry_get_timezone (E_TIMEZONE_ENTRY (priv->start_timezone));
- priv->updating = TRUE;
- e_timezone_entry_set_timezone (E_TIMEZONE_ENTRY (priv->end_timezone), zone);
- priv->updating = FALSE;
- }
-
- times_updated (epage, TRUE);
-}
-
-
-/* Callback used when the end timezone is changed. It checks if the end
- * timezone is the same as the start timezone and sets sync_timezones if so.
- */
-static void
-end_timezone_changed_cb (GtkWidget *widget, gpointer data)
-{
- EventPage *epage;
- EventPagePrivate *priv;
- icaltimezone *start_zone, *end_zone;
-
- epage = EVENT_PAGE (data);
- priv = epage->priv;
-
- start_zone = e_timezone_entry_get_timezone (E_TIMEZONE_ENTRY (priv->start_timezone));
- end_zone = e_timezone_entry_get_timezone (E_TIMEZONE_ENTRY (priv->end_timezone));
-
- priv->sync_timezones = (start_zone == end_zone) ? TRUE : FALSE;
-
- times_updated (epage, TRUE);
-}
-
-/* Callback: all day event button toggled.
- * Note that this should only be called when the user explicitly toggles the
- * button. Be sure to block this handler when the toggle button's state is set
- * within the code.
- */
-static void
-all_day_event_toggled_cb (GtkWidget *toggle, gpointer data)
-{
- EventPage *epage;
- EventPagePrivate *priv;
- gboolean all_day;
- struct icaltimetype start_tt = icaltime_null_time();
- struct icaltimetype end_tt = icaltime_null_time();
- gboolean date_set;
-
- epage = EVENT_PAGE (data);
- priv = epage->priv;
-
- /* When the all_day toggle is turned on, the start date is
- * rounded down to the start of the day, and end date is
- * rounded down to the start of the day on which the event
- * ends. The event is then taken to be inclusive of the days
- * between the start and end days. Note that if the event end
- * is at midnight, we round it down to the previous day, so the
- * event times stay the same.
- *
- * When the all_day_toggle is turned off, then if the event is within
- * one day, we set the event start to the start of the working day,
- * and set the event end to one hour after it. If the event is longer
- * than one day, we set the event end to the end of the day it is on,
- * so that the actual event times remain the same.
- *
- * This may need tweaking to work well with different timezones used
- * in the event start & end.
- */
- all_day = GTK_TOGGLE_BUTTON (toggle)->active;
-
- set_all_day (epage, all_day);
-
- date_set = e_date_edit_get_date (E_DATE_EDIT (priv->start_time),
- &start_tt.year,
- &start_tt.month,
- &start_tt.day);
- e_date_edit_get_time_of_day (E_DATE_EDIT (priv->start_time),
- &start_tt.hour,
- &start_tt.minute);
- g_assert (date_set);
-
- date_set = e_date_edit_get_date (E_DATE_EDIT (priv->end_time),
- &end_tt.year,
- &end_tt.month,
- &end_tt.day);
- e_date_edit_get_time_of_day (E_DATE_EDIT (priv->end_time),
- &end_tt.hour,
- &end_tt.minute);
- g_assert (date_set);
-
- if (all_day) {
- /* Round down to the start of the day. */
- start_tt.hour = 0;
- start_tt.minute = 0;
- start_tt.second = 0;
- start_tt.is_date = TRUE;
-
- /* Round down to the start of the day, or the start of the
- previous day if it is midnight. */
- icaltime_adjust (&end_tt, 0, 0, 0, -1);
- end_tt.hour = 0;
- end_tt.minute = 0;
- end_tt.second = 0;
- end_tt.is_date = TRUE;
- } else {
- icaltimezone *start_zone, *end_zone;
-
- if (end_tt.year == start_tt.year
- && end_tt.month == start_tt.month
- && end_tt.day == start_tt.day) {
- /* The event is within one day, so we set the event
- start to the start of the working day, and the end
- to one hour later. */
- start_tt.hour = calendar_config_get_day_start_hour ();
- start_tt.minute = calendar_config_get_day_start_minute ();
- start_tt.second = 0;
-
- end_tt = start_tt;
- icaltime_adjust (&end_tt, 0, 1, 0, 0);
- } else {
- /* The event is longer than 1 day, so we keep exactly
- the same times, just using DATE-TIME rather than
- DATE. */
- icaltime_adjust (&end_tt, 1, 0, 0, 0);
- }
-
- /* Make sure that end > start using the timezones. */
- start_zone = e_timezone_entry_get_timezone (E_TIMEZONE_ENTRY (priv->start_timezone));
- end_zone = e_timezone_entry_get_timezone (E_TIMEZONE_ENTRY (priv->end_timezone));
- check_start_before_end (&start_tt, start_zone,
- &end_tt, end_zone,
- TRUE);
- }
-
- gtk_signal_handler_block_by_data (GTK_OBJECT (priv->start_time),
- epage);
- gtk_signal_handler_block_by_data (GTK_OBJECT (priv->end_time),
- epage);
-
- e_date_edit_set_date (E_DATE_EDIT (priv->start_time), start_tt.year,
- start_tt.month, start_tt.day);
- e_date_edit_set_time_of_day (E_DATE_EDIT (priv->start_time),
- start_tt.hour, start_tt.minute);
-
- e_date_edit_set_date (E_DATE_EDIT (priv->end_time), end_tt.year,
- end_tt.month, end_tt.day);
- e_date_edit_set_time_of_day (E_DATE_EDIT (priv->end_time),
- end_tt.hour, end_tt.minute);
-
- gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->start_time),
- epage);
- gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->end_time),
- epage);
-
- /* Notify upstream */
- notify_dates_changed (epage, &start_tt, &end_tt);
-}
-
-/* Callback used when the categories button is clicked; we must bring up the
- * category list dialog.
- */
-static void
-categories_clicked_cb (GtkWidget *button, gpointer data)
-{
- EventPage *epage;
- EventPagePrivate *priv;
- GtkWidget *entry;
-
- epage = EVENT_PAGE (data);
- priv = epage->priv;
-
- entry = priv->categories;
- e_categories_config_open_dialog_for_entry (GTK_ENTRY (entry));
-}
-
-/* This is called when any field is changed; it notifies upstream. */
-static void
-field_changed_cb (GtkWidget *widget, gpointer data)
-{
- EventPage *epage;
- EventPagePrivate *priv;
-
- epage = EVENT_PAGE (data);
- priv = epage->priv;
-
- if (!priv->updating)
- comp_editor_page_notify_changed (COMP_EDITOR_PAGE (epage));
-}
-
-/* Hooks the widget signals */
-static gboolean
-init_widgets (EventPage *epage)
-{
- EventPagePrivate *priv;
- GtkTextBuffer *text_buffer;
- char *location;
- icaltimezone *zone;
-
- priv = epage->priv;
-
- /* Make sure the EDateEdit widgets use our timezones to get the
- current time. */
- e_date_edit_set_get_time_callback (E_DATE_EDIT (priv->start_time),
- (EDateEditGetTimeCallback) comp_editor_get_current_time,
- epage, NULL);
- e_date_edit_set_get_time_callback (E_DATE_EDIT (priv->end_time),
- (EDateEditGetTimeCallback) comp_editor_get_current_time,
- epage, NULL);
-
- /* Summary */
- g_signal_connect((priv->summary), "changed",
- G_CALLBACK (summary_changed_cb), epage);
-
- /* Description */
- text_buffer = gtk_text_buffer_new (NULL);
- gtk_text_view_set_buffer (GTK_TEXT_VIEW (priv->description), text_buffer);
- g_object_unref (text_buffer);
-
- gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (priv->description), GTK_WRAP_WORD);
-
- /* Start and end times */
- g_signal_connect((priv->start_time), "changed",
- G_CALLBACK (date_changed_cb), epage);
- g_signal_connect((priv->end_time), "changed",
- G_CALLBACK (date_changed_cb), epage);
-
- g_signal_connect((priv->start_timezone), "changed",
- G_CALLBACK (start_timezone_changed_cb), epage);
- g_signal_connect((priv->end_timezone), "changed",
- G_CALLBACK (end_timezone_changed_cb), epage);
-
- g_signal_connect((priv->all_day_event), "toggled",
- G_CALLBACK (all_day_event_toggled_cb), epage);
-
- /* Categories button */
- g_signal_connect((priv->categories_btn), "clicked",
- G_CALLBACK (categories_clicked_cb), epage);
-
- /* Connect the default signal handler to use to make sure we notify
- * upstream of changes to the widget values.
- */
-
- /* Belongs to priv->description */
- g_signal_connect((text_buffer), "changed",
- G_CALLBACK (field_changed_cb), epage);
-
- g_signal_connect((priv->summary), "changed",
- G_CALLBACK (field_changed_cb), epage);
- g_signal_connect((priv->location), "changed",
- G_CALLBACK (field_changed_cb), epage);
- g_signal_connect((priv->start_time), "changed",
- G_CALLBACK (field_changed_cb), epage);
- g_signal_connect((priv->end_time), "changed",
- G_CALLBACK (field_changed_cb), epage);
- g_signal_connect((priv->start_timezone), "changed",
- G_CALLBACK (field_changed_cb), epage);
- g_signal_connect((priv->end_timezone), "changed",
- G_CALLBACK (field_changed_cb), epage);
- g_signal_connect((priv->all_day_event), "toggled",
- G_CALLBACK (field_changed_cb), epage);
- g_signal_connect((priv->classification_public),
- "toggled", G_CALLBACK (field_changed_cb),
- epage);
- g_signal_connect((priv->classification_private),
- "toggled", G_CALLBACK (field_changed_cb),
- epage);
- g_signal_connect((priv->classification_confidential),
- "toggled", G_CALLBACK (field_changed_cb),
- epage);
- g_signal_connect((priv->show_time_as_free),
- "toggled", G_CALLBACK (field_changed_cb),
- epage);
- g_signal_connect((priv->show_time_as_busy),
- "toggled", G_CALLBACK (field_changed_cb),
- epage);
- g_signal_connect((priv->categories), "changed",
- G_CALLBACK (field_changed_cb), epage);
-
- /* Set the default timezone, so the timezone entry may be hidden. */
- location = calendar_config_get_timezone ();
- zone = icaltimezone_get_builtin_timezone (location);
- e_timezone_entry_set_default_timezone (E_TIMEZONE_ENTRY (priv->start_timezone), zone);
- e_timezone_entry_set_default_timezone (E_TIMEZONE_ENTRY (priv->end_timezone), zone);
-
- return TRUE;
-}
-
-
-
-/**
- * event_page_construct:
- * @epage: An event page.
- *
- * Constructs an event page by loading its Glade data.
- *
- * Return value: The same object as @epage, or NULL if the widgets could not be
- * created.
- **/
-EventPage *
-event_page_construct (EventPage *epage)
-{
- EventPagePrivate *priv;
-
- priv = epage->priv;
-
- priv->xml = glade_xml_new (EVOLUTION_GLADEDIR "/event-page.glade",
- NULL, NULL);
- if (!priv->xml) {
- g_message ("event_page_construct(): "
- "Could not load the Glade XML file!");
- return NULL;
- }
-
- if (!get_widgets (epage)) {
- g_message ("event_page_construct(): "
- "Could not find all widgets in the XML file!");
- return NULL;
- }
-
- if (!init_widgets (epage)) {
- g_message ("event_page_construct(): "
- "Could not initialize the widgets!");
- return NULL;
- }
-
- return epage;
-}
-
-/**
- * event_page_new:
- *
- * Creates a new event page.
- *
- * Return value: A newly-created event page, or NULL if the page could
- * not be created.
- **/
-EventPage *
-event_page_new (void)
-{
- EventPage *epage;
-
- epage = g_object_new (TYPE_EVENT_PAGE, NULL);
- if (!event_page_construct (epage)) {
- g_object_unref (epage);
- return NULL;
- }
-
- return epage;
-}
-
-GtkWidget *make_date_edit (void);
-
-GtkWidget *
-make_date_edit (void)
-{
- return comp_editor_new_date_edit (TRUE, TRUE, TRUE);
-}
-
-GtkWidget *make_timezone_entry (void);
-
-GtkWidget *
-make_timezone_entry (void)
-{
- GtkWidget *w;
-
- w = e_timezone_entry_new ();
- gtk_widget_show (w);
- return w;
-}
diff --git a/calendar/gui/dialogs/event-page.glade b/calendar/gui/dialogs/event-page.glade
deleted file mode 100644
index b59eb61e86..0000000000
--- a/calendar/gui/dialogs/event-page.glade
+++ /dev/null
@@ -1,601 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-
-<widget class="GtkWindow" id="event-toplevel">
- <property name="title" translatable="yes">window1</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
-
- <child>
- <widget class="GtkVBox" id="event-page">
- <property name="border_width">12</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkTable" id="table11">
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label56">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Su_mmary:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">general-summary</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="general-summary">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label61">
- <property name="visible">True</property>
- <property name="label" translatable="yes">L_ocation:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">location</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="location">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFrame" id="frame31">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkTable" id="table12">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">4</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label57">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Start time:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">start-time</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label58">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_End time:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">end-time</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="start-time">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="creation_function">make_date_edit</property>
- <property name="string1"></property>
- <property name="string2"></property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Tue, 16 May 2000 19:11:05 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="end-time">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="creation_function">make_date_edit</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Tue, 16 May 2000 19:11:10 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="end-timezone">
- <property name="visible">True</property>
- <property name="creation_function">make_timezone_entry</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Mon, 18 Jun 2001 23:51:40 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options"></property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="start-timezone">
- <property name="visible">True</property>
- <property name="creation_function">make_timezone_entry</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Mon, 18 Jun 2001 23:51:34 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment1">
- <property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="yalign">7.45058e-09</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
-
- <child>
- <widget class="GtkCheckButton" id="all-day-event">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">A_ll day event</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">2</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label62">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Date &amp; Time</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow12">
- <property name="visible">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <widget class="GtkTextView" id="description">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="justification">GTK_JUSTIFY_LEFT</property>
- <property name="wrap_mode">GTK_WRAP_WORD</property>
- <property name="cursor_visible">True</property>
- <property name="pixels_above_lines">0</property>
- <property name="pixels_below_lines">0</property>
- <property name="pixels_inside_wrap">0</property>
- <property name="left_margin">0</property>
- <property name="right_margin">0</property>
- <property name="indent">0</property>
- <property name="text" translatable="yes"></property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox54">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkFrame" id="frame32">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkHBox" id="hbox52">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkRadioButton" id="classification-public">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Pu_blic</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">True</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="classification-private">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Pri_vate</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">classification-public</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="classification-confidential">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Co_nfidential</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">classification-public</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label63">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Classification</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFrame" id="show-time-frame">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkHBox" id="hbox55">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkRadioButton" id="show-time-as-free">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">F_ree</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="show-time-as-busy">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">B_usy</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">show-time-as-free</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label64">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Show Time As</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox53">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkButton" id="categories-button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Ca_tegories...</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="categories">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/calendar/gui/dialogs/event-page.h b/calendar/gui/dialogs/event-page.h
deleted file mode 100644
index a21f084e01..0000000000
--- a/calendar/gui/dialogs/event-page.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* Evolution calendar - Main page of the event editor dialog
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Authors: Federico Mena-Quintero <federico@ximian.com>
- * Miguel de Icaza <miguel@ximian.com>
- * Seth Alves <alves@hungry.com>
- * JP Rosevear <jpr@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef EVENT_PAGE_H
-#define EVENT_PAGE_H
-
-#include "comp-editor-page.h"
-
-G_BEGIN_DECLS
-
-
-
-#define TYPE_EVENT_PAGE (event_page_get_type ())
-#define EVENT_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_EVENT_PAGE, EventPage))
-#define EVENT_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_EVENT_PAGE, EventPageClass))
-#define IS_EVENT_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_EVENT_PAGE))
-#define IS_EVENT_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), TYPE_EVENT_PAGE))
-
-typedef struct _EventPagePrivate EventPagePrivate;
-
-typedef struct {
- CompEditorPage page;
-
- /* Private data */
- EventPagePrivate *priv;
-} EventPage;
-
-typedef struct {
- CompEditorPageClass parent_class;
-} EventPageClass;
-
-
-GtkType event_page_get_type (void);
-EventPage *event_page_construct (EventPage *epage);
-EventPage *event_page_new (void);
-
-
-
-G_END_DECLS
-
-#endif
diff --git a/calendar/gui/dialogs/meeting-page.c b/calendar/gui/dialogs/meeting-page.c
deleted file mode 100644
index fe4ade9363..0000000000
--- a/calendar/gui/dialogs/meeting-page.c
+++ /dev/null
@@ -1,833 +0,0 @@
-/* Evolution calendar - Main page of the task editor dialog
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Authors: Federico Mena-Quintero <federico@ximian.com>
- * Miguel de Icaza <miguel@ximian.com>
- * Seth Alves <alves@hungry.com>
- * JP Rosevear <jpr@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <glib.h>
-#include <gtk/gtkcombo.h>
-#include <gtk/gtksignal.h>
-#include <gtk/gtktogglebutton.h>
-#include <gtk/gtkvbox.h>
-#include <gtk/gtkwindow.h>
-#include <libgnome/gnome-i18n.h>
-#include <glade/glade.h>
-#include <libgnomeui/gnome-stock-icons.h>
-#include <gal/util/e-util.h>
-#include <gal/widgets/e-popup-menu.h>
-#include <gal/widgets/e-gui-utils.h>
-#include <widgets/misc/e-dateedit.h>
-#include <e-util/e-dialog-utils.h>
-#include <e-util/e-dialog-widgets.h>
-
-#include "../calendar-component.h"
-#include "../e-meeting-attendee.h"
-#include "../e-meeting-store.h"
-#include "../e-meeting-list-view.h"
-#include "../itip-utils.h"
-#include "comp-editor-util.h"
-#include "e-delegate-dialog.h"
-#include "meeting-page.h"
-
-
-/* Private part of the MeetingPage structure */
-struct _MeetingPagePrivate {
- /* Lists of attendees */
- GPtrArray *deleted_attendees;
-
- /* To use in case of cancellation */
- ECalComponent *comp;
-
- /* List of identities */
- EAccountList *accounts;
- EMeetingAttendee *ia;
- char *default_address;
-
- /* Glade XML data */
- GladeXML *xml;
-
- /* Widgets from the Glade file */
- GtkWidget *main;
- GtkWidget *organizer_table;
- GtkWidget *organizer;
- GtkWidget *existing_organizer_table;
- GtkWidget *existing_organizer;
- GtkWidget *existing_organizer_btn;
- GtkWidget *invite;
-
- /* ListView stuff */
- EMeetingStore *model;
- EMeetingListView *list_view;
- gint row;
-
- /* For handling who the organizer is */
- gboolean existing;
-
- gboolean updating;
-};
-
-
-
-static void meeting_page_class_init (MeetingPageClass *class);
-static void meeting_page_init (MeetingPage *mpage);
-static void meeting_page_finalize (GObject *object);
-
-static GtkWidget *meeting_page_get_widget (CompEditorPage *page);
-static void meeting_page_focus_main_widget (CompEditorPage *page);
-static void meeting_page_fill_widgets (CompEditorPage *page, ECalComponent *comp);
-static gboolean meeting_page_fill_component (CompEditorPage *page, ECalComponent *comp);
-
-static CompEditorPageClass *parent_class = NULL;
-
-
-
-/**
- * meeting_page_get_type:
- *
- * Registers the #MeetingPage class if necessary, and returns the type ID
- * associated to it.
- *
- * Return value: The type ID of the #MeetingPage class.
- **/
-
-E_MAKE_TYPE (meeting_page, "MeetingPage", MeetingPage, meeting_page_class_init, meeting_page_init,
- TYPE_COMP_EDITOR_PAGE);
-
-/* Class initialization function for the task page */
-static void
-meeting_page_class_init (MeetingPageClass *class)
-{
- CompEditorPageClass *editor_page_class;
- GObjectClass *object_class;
-
- editor_page_class = (CompEditorPageClass *) class;
- object_class = (GObjectClass *) class;
-
- parent_class = g_type_class_ref (TYPE_COMP_EDITOR_PAGE);
-
- editor_page_class->get_widget = meeting_page_get_widget;
- editor_page_class->focus_main_widget = meeting_page_focus_main_widget;
- editor_page_class->fill_widgets = meeting_page_fill_widgets;
- editor_page_class->fill_component = meeting_page_fill_component;
- editor_page_class->set_summary = NULL;
- editor_page_class->set_dates = NULL;
-
- object_class->finalize = meeting_page_finalize;
-}
-
-/* Object initialization function for the task page */
-static void
-meeting_page_init (MeetingPage *mpage)
-{
- MeetingPagePrivate *priv;
-
- priv = g_new0 (MeetingPagePrivate, 1);
- mpage->priv = priv;
-
- priv->deleted_attendees = g_ptr_array_new ();
-
- priv->comp = NULL;
-
- priv->accounts = NULL;
- priv->ia = NULL;
- priv->default_address = NULL;
-
- priv->xml = NULL;
- priv->main = NULL;
- priv->invite = NULL;
-
- priv->model = NULL;
- priv->list_view = NULL;
-
- priv->updating = FALSE;
-}
-
-static EAccount *
-get_current_account (MeetingPage *mpage)
-{
- MeetingPagePrivate *priv;
- EIterator *it;
- const char *str;
-
- priv = mpage->priv;
-
- str = gtk_entry_get_text (GTK_ENTRY (GTK_COMBO (priv->organizer)->entry));
- if (!str)
- return NULL;
-
- for (it = e_list_get_iterator((EList *)priv->accounts); e_iterator_is_valid(it); e_iterator_next(it)) {
- EAccount *a = (EAccount *)e_iterator_get(it);
- char *full = g_strdup_printf("%s <%s>", a->id->name, a->id->address);
-
- if (!strcmp (full, str)) {
- g_free (full);
- g_object_unref (it);
-
- return a;
- }
-
- g_free (full);
- }
- g_object_unref (it);
-
- return NULL;
-}
-
-static void
-set_attendees (ECalComponent *comp, const GPtrArray *attendees)
-{
- GSList *comp_attendees = NULL, *l;
- int i;
-
- for (i = 0; i < attendees->len; i++) {
- EMeetingAttendee *ia = g_ptr_array_index (attendees, i);
- ECalComponentAttendee *ca;
-
- ca = e_meeting_attendee_as_e_cal_component_attendee (ia);
-
- comp_attendees = g_slist_prepend (comp_attendees, ca);
-
- }
- comp_attendees = g_slist_reverse (comp_attendees);
- e_cal_component_set_attendee_list (comp, comp_attendees);
-
- for (l = comp_attendees; l != NULL; l = l->next)
- g_free (l->data);
- g_slist_free (comp_attendees);
-}
-
-static void
-cleanup_attendees (GPtrArray *attendees)
-{
- int i;
-
- for (i = 0; i < attendees->len; i++)
- g_object_unref (g_ptr_array_index (attendees, i));
-}
-
-/* Destroy handler for the task page */
-static void
-meeting_page_finalize (GObject *object)
-{
- MeetingPage *mpage;
- MeetingPagePrivate *priv;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (IS_MEETING_PAGE (object));
-
- mpage = MEETING_PAGE (object);
- priv = mpage->priv;
-
- if (priv->comp != NULL)
- g_object_unref (priv->comp);
-
- cleanup_attendees (priv->deleted_attendees);
- g_ptr_array_free (priv->deleted_attendees, TRUE);
-
- if (priv->ia != NULL)
- g_object_unref (priv->ia);
-
- g_object_unref (priv->model);
-
- if (priv->main)
- gtk_widget_unref (priv->main);
-
- if (priv->xml) {
- g_object_unref (priv->xml);
- priv->xml = NULL;
- }
-
- if (priv->default_address) {
- g_free (priv->default_address);
- priv->default_address = NULL;
- }
-
- g_free (priv);
- mpage->priv = NULL;
-
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
-}
-
-
-
-/* get_widget handler for the task page */
-static GtkWidget *
-meeting_page_get_widget (CompEditorPage *page)
-{
- MeetingPage *mpage;
- MeetingPagePrivate *priv;
-
- mpage = MEETING_PAGE (page);
- priv = mpage->priv;
-
- return priv->main;
-}
-
-/* focus_main_widget handler for the task page */
-static void
-meeting_page_focus_main_widget (CompEditorPage *page)
-{
- MeetingPage *mpage;
- MeetingPagePrivate *priv;
-
- mpage = MEETING_PAGE (page);
- priv = mpage->priv;
-
- gtk_widget_grab_focus (priv->organizer);
-}
-
-/* Fills the widgets with default values */
-static void
-clear_widgets (MeetingPage *mpage)
-{
- MeetingPagePrivate *priv;
-
- priv = mpage->priv;
-
- gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (priv->organizer)->entry), priv->default_address);
- gtk_label_set_text (GTK_LABEL (priv->existing_organizer), _("None"));
-
- gtk_widget_show (priv->organizer_table);
- gtk_widget_hide (priv->existing_organizer_table);
-
- priv->existing = FALSE;
-}
-
-/* fill_widgets handler for the meeting page */
-static void
-meeting_page_fill_widgets (CompEditorPage *page, ECalComponent *comp)
-{
- MeetingPage *mpage;
- MeetingPagePrivate *priv;
- ECalComponentOrganizer organizer;
-
- mpage = MEETING_PAGE (page);
- priv = mpage->priv;
-
- priv->updating = TRUE;
-
- /* Clean out old data */
- if (priv->comp != NULL)
- g_object_unref (priv->comp);
- priv->comp = NULL;
-
- cleanup_attendees (priv->deleted_attendees);
- g_ptr_array_set_size (priv->deleted_attendees, 0);
-
- /* Clean the screen */
- clear_widgets (mpage);
-
- /* Component for cancellation */
- priv->comp = e_cal_component_clone (comp);
-
- /* If there is an existing organizer show it properly */
- if (e_cal_component_has_organizer (comp)) {
- e_cal_component_get_organizer (comp, &organizer);
- if (organizer.value != NULL) {
- const gchar *strip = itip_strip_mailto (organizer.value);
- gchar *string;
-
- gtk_widget_hide (priv->organizer_table);
- gtk_widget_show (priv->existing_organizer_table);
- if (itip_organizer_is_user (comp, page->client)) {
- gtk_widget_show (priv->invite);
- if (e_cal_get_static_capability (
- page->client,
- CAL_STATIC_CAPABILITY_ORGANIZER_NOT_EMAIL_ADDRESS))
- gtk_widget_hide (priv->existing_organizer_btn);
- } else {
- if (e_cal_get_static_capability (
- page->client,
- CAL_STATIC_CAPABILITY_ORGANIZER_NOT_EMAIL_ADDRESS))
- gtk_widget_hide (priv->existing_organizer_btn);
- gtk_widget_hide (priv->invite);
- }
-
- if (organizer.cn != NULL)
- string = g_strdup_printf ("%s <%s>", organizer.cn, strip);
- else
- string = g_strdup (strip);
- gtk_label_set_text (GTK_LABEL (priv->existing_organizer), string);
- g_free (string);
-
- priv->existing = TRUE;
- }
- } else {
- EAccount *a;
-
- a = get_current_account (mpage);
- if (a != NULL) {
- priv->ia = e_meeting_store_add_attendee_with_defaults (priv->model);
- g_object_ref (priv->ia);
-
- e_meeting_attendee_set_address (priv->ia, g_strdup_printf ("MAILTO:%s", a->id->address));
- e_meeting_attendee_set_cn (priv->ia, g_strdup (a->id->name));
- e_meeting_attendee_set_status (priv->ia, ICAL_PARTSTAT_ACCEPTED);
- }
- }
-
- priv->updating = FALSE;
-}
-
-/* fill_component handler for the meeting page */
-static gboolean
-meeting_page_fill_component (CompEditorPage *page, ECalComponent *comp)
-{
- MeetingPage *mpage;
- MeetingPagePrivate *priv;
- ECalComponentOrganizer organizer = {NULL, NULL, NULL, NULL};
-
- mpage = MEETING_PAGE (page);
- priv = mpage->priv;
-
- if (!priv->existing) {
- EAccount *a;
- gchar *addr = NULL;
-
- /* Find the identity for the organizer or sentby field */
- a = get_current_account (mpage);
-
- /* Sanity Check */
- if (a == NULL) {
- e_notice (page, GTK_MESSAGE_ERROR,
- _("The organizer selected no longer has an account."));
- return FALSE;
- }
-
- if (a->id->address == NULL || strlen (a->id->address) == 0) {
- e_notice (page, GTK_MESSAGE_ERROR,
- _("An organizer is required."));
- return FALSE;
- }
-
- addr = g_strdup_printf ("MAILTO:%s", a->id->address);
-
- organizer.value = addr;
- organizer.cn = a->id->name;
- e_cal_component_set_organizer (comp, &organizer);
-
- g_free (addr);
- }
-
- if (e_meeting_store_count_actual_attendees (priv->model) < 1) {
- e_notice (page, GTK_MESSAGE_ERROR,
- _("At least one attendee is required."));
- return FALSE;
- }
- set_attendees (comp, e_meeting_store_get_attendees (priv->model));
-
- return TRUE;
-}
-
-
-
-/* Gets the widgets from the XML file and returns if they are all available. */
-static gboolean
-get_widgets (MeetingPage *mpage)
-{
- CompEditorPage *page = COMP_EDITOR_PAGE (mpage);
- MeetingPagePrivate *priv;
- GSList *accel_groups;
- GtkWidget *toplevel;
-
- priv = mpage->priv;
-
-#define GW(name) glade_xml_get_widget (priv->xml, name)
-
- priv->main = GW ("meeting-page");
- if (!priv->main)
- return FALSE;
-
- /* Get the GtkAccelGroup from the toplevel window, so we can install
- it when the notebook page is mapped. */
- toplevel = gtk_widget_get_toplevel (priv->main);
- accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel));
- if (accel_groups) {
- page->accel_group = accel_groups->data;
- gtk_accel_group_ref (page->accel_group);
- }
-
- gtk_widget_ref (priv->main);
- gtk_container_remove (GTK_CONTAINER (priv->main->parent), priv->main);
-
- /* For making the user the organizer */
- priv->organizer_table = GW ("organizer-table");
- priv->organizer = GW ("organizer");
- gtk_combo_set_value_in_list (GTK_COMBO (priv->organizer), FALSE, FALSE);
-
- /* For showing existing organizers */
- priv->existing_organizer_table = GW ("existing-organizer-table");
- priv->existing_organizer = GW ("existing-organizer");
- priv->existing_organizer_btn = GW ("existing-organizer-button");
- priv->invite = GW ("invite");
-
-#undef GW
-
- return (priv->invite
- && priv->organizer_table
- && priv->organizer
- && priv->existing_organizer_table
- && priv->existing_organizer
- && priv->existing_organizer_btn);
-}
-
-static void
-org_changed_cb (GtkWidget *widget, gpointer data)
-{
- MeetingPage *mpage;
- MeetingPagePrivate *priv;
-
- mpage = MEETING_PAGE (data);
- priv = mpage->priv;
-
- if (priv->updating)
- return;
-
- if (!priv->existing && priv->ia != NULL) {
- EAccount *a;
-
- a = get_current_account (mpage);
- if (a != NULL) {
- e_meeting_attendee_set_address (priv->ia, g_strdup_printf ("MAILTO:%s", a->id->address));
- e_meeting_attendee_set_cn (priv->ia, g_strdup (a->id->name));
-
- if (!e_meeting_store_find_attendee (priv->model, e_meeting_attendee_get_address (priv->ia), NULL))
- e_meeting_store_add_attendee (priv->model, priv->ia);
- } else {
- e_meeting_store_remove_attendee (priv->model, priv->ia);
- }
- }
-
- comp_editor_page_notify_changed (COMP_EDITOR_PAGE (mpage));
-}
-
-/* Function called to change the organizer */
-static void
-change_clicked_cb (GtkWidget *widget, gpointer data)
-{
- MeetingPage *mpage;
- MeetingPagePrivate *priv;
-
- mpage = MEETING_PAGE (data);
- priv = mpage->priv;
-
- gtk_widget_show (priv->organizer_table);
- gtk_widget_hide (priv->existing_organizer_table);
- gtk_widget_show (priv->invite);
-
- comp_editor_page_notify_needs_send (COMP_EDITOR_PAGE (mpage));
-
- priv->existing = FALSE;
-}
-
-/* Function called to invite more people */
-static void
-invite_cb (GtkWidget *widget, gpointer data)
-{
- MeetingPage *mpage;
- MeetingPagePrivate *priv;
-
- mpage = MEETING_PAGE (data);
- priv = mpage->priv;
-
- e_meeting_list_view_invite_others_dialog (priv->list_view);
-}
-
-/* Hooks the widget signals */
-static void
-init_widgets (MeetingPage *mpage)
-{
- MeetingPagePrivate *priv;
-
- priv = mpage->priv;
-
- /* Organizer */
- g_signal_connect((GTK_COMBO (priv->organizer)->entry), "changed",
- G_CALLBACK (org_changed_cb), mpage);
-
- g_signal_connect((priv->existing_organizer_btn), "clicked",
- G_CALLBACK (change_clicked_cb), mpage);
-
- /* Invite button */
- g_signal_connect((priv->invite), "clicked",
- G_CALLBACK (invite_cb), mpage);
-}
-
-static void
-popup_delete_cb (GtkWidget *widget, gpointer data)
-{
- MeetingPage *mpage = MEETING_PAGE (data);
- MeetingPagePrivate *priv;
- EMeetingAttendee *ia;
- int pos = 0;
-
- priv = mpage->priv;
-
- ia = e_meeting_store_find_attendee_at_row (priv->model, priv->row);
-
- /* If the user deletes the attendee explicitly, assume they no
- longer want the organizer showing up */
- if (ia == priv->ia) {
- g_object_unref (priv->ia);
- priv->ia = NULL;
- }
-
- /* If this was a delegatee, no longer delegate */
- if (e_meeting_attendee_is_set_delfrom (ia)) {
- EMeetingAttendee *ib;
-
- ib = e_meeting_store_find_attendee (priv->model, e_meeting_attendee_get_delfrom (ia), &pos);
- if (ib != NULL) {
- e_meeting_attendee_set_delto (ib, NULL);
- e_meeting_attendee_set_edit_level (ib, E_MEETING_ATTENDEE_EDIT_FULL);
- }
- }
-
- /* Handle deleting all attendees in the delegation chain */
- while (ia != NULL) {
- EMeetingAttendee *ib = NULL;
-
- g_object_ref (ia);
- g_ptr_array_add (priv->deleted_attendees, ia);
- e_meeting_store_remove_attendee (priv->model, ia);
-
- if (e_meeting_attendee_get_delto (ia) != NULL)
- ib = e_meeting_store_find_attendee (priv->model, e_meeting_attendee_get_delto (ia), NULL);
- ia = ib;
- }
-}
-
-enum {
- CAN_DELEGATE = 2,
- CAN_DELETE = 4
-};
-
-static EPopupMenu context_menu[] = {
-#if 0
- E_POPUP_ITEM (N_("_Delegate To..."), G_CALLBACK (popup_delegate_cb), CAN_DELEGATE),
-
- E_POPUP_SEPARATOR,
-#endif
- E_POPUP_ITEM (N_("_Delete"), G_CALLBACK (popup_delete_cb), CAN_DELETE),
-
- E_POPUP_TERMINATOR
-};
-
-#if 0
-/* FIXME: handle context menu for treeview */
-/* handle context menu over message-list */
-static gint
-right_click_cb (ETable *etable, gint row, gint col, GdkEvent *event, gpointer data)
-{
- MeetingPage *mpage = MEETING_PAGE (data);
- MeetingPagePrivate *priv;
- GtkMenu *menu;
- EMeetingAttendee *ia;
- int disable_mask = 0, hide_mask = 0, view_row;
-
- priv = mpage->priv;
-
- view_row = e_table_model_to_view_row (etable, row);
- priv->row = e_meeting_model_etable_view_to_model_row (etable, priv->model, view_row);
-
- ia = e_meeting_model_find_attendee_at_row (priv->model, priv->row);
- if (e_meeting_attendee_get_edit_level (ia) != E_MEETING_ATTENDEE_EDIT_FULL)
- disable_mask = CAN_DELETE;
-
- /* FIXME: if you enable Delegate, then change index to '1'.
- * (This has now been enabled). */
- /* context_menu[1].pixmap_widget = gnome_stock_new_with_icon (GNOME_STOCK_MENU_TRASH); */
- context_menu[1].pixmap_widget =
- gtk_image_new_from_stock (GTK_STOCK_DELETE, GTK_ICON_SIZE_MENU);
-
- menu = e_popup_menu_create (context_menu, disable_mask, hide_mask, data);
- e_auto_kill_popup_menu_on_selection_done (menu);
-
- gtk_menu_popup (menu, NULL, NULL, NULL, NULL,
- event->button.button, event->button.time);
-
- return TRUE;
-}
-#endif
-
-static void
-add_btn_clicked_cb (GtkButton *btn, MeetingPage *mpage)
-{
- e_meeting_store_add_attendee_with_defaults (mpage->priv->model);
-}
-
-/**
- * meeting_page_construct:
- * @mpage: An task details page.
- *
- * Constructs an task page by loading its Glade data.
- *
- * Return value: The same object as @mpage, or NULL if the widgets could not
- * be created.
- **/
-MeetingPage *
-meeting_page_construct (MeetingPage *mpage, EMeetingStore *ems,
- ECal *client)
-{
- MeetingPagePrivate *priv;
- char *backend_address;
- EIterator *it;
- EAccount *def_account;
- GList *address_strings = NULL, *l;
- GtkWidget *sw, *btn;
-
- priv = mpage->priv;
-
- priv->xml = glade_xml_new (EVOLUTION_GLADEDIR
- "/meeting-page.glade", NULL, NULL);
- if (!priv->xml) {
- g_message ("meeting_page_construct(): "
- "Could not load the Glade XML file!");
- return NULL;
- }
-
- if (!get_widgets (mpage)) {
- g_message ("meeting_page_construct(): "
- "Could not find all widgets in the XML file!");
- return NULL;
- }
-
- /* Address information */
- if (!e_cal_get_cal_address (client, &backend_address, NULL))
- return NULL;
-
- priv->accounts = itip_addresses_get ();
- def_account = itip_addresses_get_default();
- for (it = e_list_get_iterator((EList *)priv->accounts);
- e_iterator_is_valid(it);
- e_iterator_next(it)) {
- EAccount *a = (EAccount *)e_iterator_get(it);
- char *full;
-
- full = g_strdup_printf("%s <%s>", a->id->name, a->id->address);
-
- address_strings = g_list_append(address_strings, full);
-
- /* Note that the address specified by the backend gets
- * precedence over the default mail address.
- */
- if (backend_address && !strcmp (backend_address, a->id->address)) {
- if (priv->default_address)
- g_free (priv->default_address);
-
- priv->default_address = g_strdup (full);
- } else if (a == def_account && !priv->default_address) {
- priv->default_address = g_strdup (full);
- }
- }
- g_object_unref(it);
- g_free (backend_address);
-
- if (address_strings)
- gtk_combo_set_popdown_strings (GTK_COMBO (priv->organizer), address_strings);
- else
- g_warning ("No potential organizers!");
-
- for (l = address_strings; l != NULL; l = l->next)
- g_free (l->data);
- g_list_free (address_strings);
-
- /* The etable displaying attendees and their status */
- g_object_ref (ems);
- priv->model = ems;
-
- btn = gtk_button_new_with_label ("Add Attendee");
- g_signal_connect(btn, "clicked", G_CALLBACK (add_btn_clicked_cb), mpage);
- gtk_widget_show (btn);
- gtk_box_pack_start (GTK_BOX (priv->main), btn, FALSE, FALSE, 6);
-
- priv->list_view = e_meeting_list_view_new (priv->model);
-
-#if 0
- /* FIXME: handle context menu for treeview */
- g_signal_connect((real_table),
- "right_click", G_CALLBACK (right_click_cb), mpage);
-#endif
-
- gtk_widget_show (GTK_WIDGET (priv->list_view));
- sw = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), GTK_SHADOW_IN);
- gtk_widget_show (sw);
- gtk_container_add (GTK_CONTAINER (sw), GTK_WIDGET (priv->list_view));
- gtk_box_pack_start (GTK_BOX (priv->main), sw, TRUE, TRUE, 6);
-
- /* Init the widget signals */
- init_widgets (mpage);
-
- return mpage;
-}
-
-/**
- * meeting_page_new:
- *
- * Creates a new task details page.
- *
- * Return value: A newly-created task details page, or NULL if the page could
- * not be created.
- **/
-MeetingPage *
-meeting_page_new (EMeetingStore *ems, ECal *client)
-{
- MeetingPage *mpage;
-
- mpage = g_object_new (TYPE_MEETING_PAGE, NULL);
- if (!meeting_page_construct (mpage, ems, client)) {
- g_object_unref (mpage);
- return NULL;
- }
-
- return mpage;
-}
-
-/**
- * meeting_page_get_cancel_comp:
- * @mpage:
- *
- *
- *
- * Return value:
- **/
-ECalComponent *
-meeting_page_get_cancel_comp (MeetingPage *mpage)
-{
- MeetingPagePrivate *priv;
-
- g_return_val_if_fail (mpage != NULL, NULL);
- g_return_val_if_fail (IS_MEETING_PAGE (mpage), NULL);
-
- priv = mpage->priv;
-
- if (priv->deleted_attendees->len == 0)
- return NULL;
-
- set_attendees (priv->comp, priv->deleted_attendees);
-
- return e_cal_component_clone (priv->comp);
-}
diff --git a/calendar/gui/dialogs/meeting-page.etspec b/calendar/gui/dialogs/meeting-page.etspec
deleted file mode 100644
index 96bc480fe9..0000000000
--- a/calendar/gui/dialogs/meeting-page.etspec
+++ /dev/null
@@ -1,21 +0,0 @@
-<ETableSpecification click-to-add="true" click-to-add-end="true" _click-to-add-message="Click here to add an attendee" draw-grid="true">
- <ETableColumn model_col= "0" _title="Attendee" expansion="2.0" minimum_width="10" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col= "1" _title="Member" expansion="2.0" minimum_width="10" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col= "2" _title="Type" expansion="1.0" minimum_width="10" resizable="true" cell="typeedit" compare="string"/>
- <ETableColumn model_col= "3" _title="Role" expansion="1.0" minimum_width="10" resizable="true" cell="roleedit" compare="string"/>
- <ETableColumn model_col= "4" _title="RSVP" expansion="1.0" minimum_width="10" resizable="true" cell="rsvpedit" compare="string"/>
- <ETableColumn model_col= "5" _title="Delegated To" expansion="2.0" minimum_width="10" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col= "6" _title="Delegated From" expansion="2.0" minimum_width="10" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col= "7" _title="Status" expansion="1.0" minimum_width="10" resizable="true" cell="statusedit" compare="string"/>
- <ETableColumn model_col= "8" _title="Common Name" expansion="2.0" minimum_width="10" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col= "9" _title="Language" expansion="2.0" minimum_width="10" resizable="true" cell="string" compare="string"/>
-
- <ETableState>
- <column source="0"/>
- <column source="2"/>
- <column source="3"/>
- <column source="4"/>
- <column source="7"/>
- <grouping></grouping>
- </ETableState>
-</ETableSpecification>
diff --git a/calendar/gui/dialogs/meeting-page.glade b/calendar/gui/dialogs/meeting-page.glade
deleted file mode 100644
index 3b72c37b47..0000000000
--- a/calendar/gui/dialogs/meeting-page.glade
+++ /dev/null
@@ -1,241 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-
-<widget class="GtkWindow" id="meeting-toplevel">
- <property name="title" translatable="yes">window1</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
-
- <child>
- <widget class="GtkVBox" id="meeting-page">
- <property name="border_width">12</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkVBox" id="vbox1">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkTable" id="organizer-table">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="n_rows">1</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkCombo" id="organizer">
- <property name="visible">True</property>
- <property name="value_in_list">True</property>
- <property name="allow_empty">False</property>
- <property name="case_sensitive">False</property>
- <property name="enable_arrow_keys">True</property>
- <property name="enable_arrows_always">False</property>
-
- <child internal-child="entry">
- <widget class="GtkEntry" id="entry2">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- </child>
-
- <child internal-child="list">
- <widget class="GtkList" id="convertwidget1">
- <property name="visible">True</property>
- <property name="selection_mode">GTK_SELECTION_BROWSE</property>
-
- <child>
- <widget class="GtkListItem" id="convertwidget2">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget3">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="organizer-label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Organizer:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="existing-organizer-table">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="n_rows">1</property>
- <property name="n_columns">3</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Organizer:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options"></property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="existing-organizer-button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Change Organizer</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options"></property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="existing-organizer">
- <property name="visible">True</property>
- <property name="label" translatable="yes">None</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <placeholder/>
- </child>
-
- <child>
- <widget class="GtkButton" id="invite">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Invite Others...</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/calendar/gui/dialogs/meeting-page.h b/calendar/gui/dialogs/meeting-page.h
deleted file mode 100644
index 95533cd771..0000000000
--- a/calendar/gui/dialogs/meeting-page.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Evolution calendar - Main page of the task editor dialog
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Authors: Federico Mena-Quintero <federico@ximian.com>
- * Miguel de Icaza <miguel@ximian.com>
- * Seth Alves <alves@hungry.com>
- * JP Rosevear <jpr@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef MEETING_PAGE_H
-#define MEETING_PAGE_H
-
-#include "../e-meeting-store.h"
-#include "../itip-utils.h"
-#include "comp-editor-page.h"
-
-G_BEGIN_DECLS
-
-
-
-#define TYPE_MEETING_PAGE (meeting_page_get_type ())
-#define MEETING_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MEETING_PAGE, MeetingPage))
-#define MEETING_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MEETING_PAGE, MeetingPageClass))
-#define IS_MEETING_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MEETING_PAGE))
-#define IS_MEETING_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), TYPE_MEETING_PAGE))
-
-typedef struct _MeetingPagePrivate MeetingPagePrivate;
-
-typedef struct {
- CompEditorPage page;
-
- /* Private data */
- MeetingPagePrivate *priv;
-} MeetingPage;
-
-typedef struct {
- CompEditorPageClass parent_class;
-} MeetingPageClass;
-
-
-GtkType meeting_page_get_type (void);
-MeetingPage *meeting_page_construct (MeetingPage *mpage,
- EMeetingStore *ems,
- ECal *client);
-MeetingPage *meeting_page_new (EMeetingStore *ems,
- ECal *client);
-ECalComponent *meeting_page_get_cancel_comp (MeetingPage *mpage);
-
-
-
-G_END_DECLS
-
-#endif
diff --git a/calendar/gui/dialogs/new-calendar.c b/calendar/gui/dialogs/new-calendar.c
deleted file mode 100644
index 5cbbd99516..0000000000
--- a/calendar/gui/dialogs/new-calendar.c
+++ /dev/null
@@ -1,268 +0,0 @@
-/* Evolution calendar - New calendar dialog
- *
- * Copyright (C) 2003 Novell, Inc.
- *
- * Author: Rodrigo Moya <rodrigo@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-#include <bonobo/bonobo-i18n.h>
-#include <gtk/gtkdialog.h>
-#include <gtk/gtkentry.h>
-#include <gtk/gtkmenu.h>
-#include <gtk/gtkmenuitem.h>
-#include <gtk/gtkmessagedialog.h>
-#include <gtk/gtkoptionmenu.h>
-#include <glade/glade.h>
-#include <libedataserver/e-source-list.h>
-#include <e-util/e-dialog-utils.h>
-#include <e-util/e-url.h>
-#include "new-calendar.h"
-
-static gchar *
-print_uri_noproto (EUri *uri)
-{
- gchar *uri_noproto;
-
- if (uri->port != 0)
- uri_noproto = g_strdup_printf (
- "%s%s%s%s%s%s%s:%d%s%s%s",
- uri->user ? uri->user : "",
- uri->authmech ? ";auth=" : "",
- uri->authmech ? uri->authmech : "",
- uri->passwd ? ":" : "",
- uri->passwd ? uri->passwd : "",
- uri->user ? "@" : "",
- uri->host ? uri->host : "",
- uri->port,
- uri->path ? uri->path : "",
- uri->query ? "?" : "",
- uri->query ? uri->query : "");
- else
- uri_noproto = g_strdup_printf (
- "%s%s%s%s%s%s%s%s%s%s",
- uri->user ? uri->user : "",
- uri->authmech ? ";auth=" : "",
- uri->authmech ? uri->authmech : "",
- uri->passwd ? ":" : "",
- uri->passwd ? uri->passwd : "",
- uri->user ? "@" : "",
- uri->host ? uri->host : "",
- uri->path ? uri->path : "",
- uri->query ? "?" : "",
- uri->query ? uri->query : "");
-
- return uri_noproto;
-}
-
-static gboolean
-group_is_remote (ESourceGroup *group)
-{
- EUri *uri;
- gboolean is_remote = FALSE;
-
- uri = e_uri_new (e_source_group_peek_base_uri (group));
- if (!uri)
- return FALSE;
-
- if (uri->protocol && strcmp (uri->protocol, "file"))
- is_remote = TRUE;
-
- e_uri_free (uri);
- return is_remote;
-}
-
-static gboolean
-create_new_source_with_group (GtkWindow *parent,
- ESourceGroup *group,
- const char *source_name,
- const char *source_location)
-{
- ESource *source;
-
- if (e_source_group_peek_source_by_name (group, source_name)) {
- e_notice (parent, GTK_MESSAGE_ERROR,
- _("Source with name '%s' already exists in the selected group"),
- source_name);
- return FALSE;
- }
-
- if (group_is_remote (group)) {
- EUri *uri;
- gchar *relative_uri;
- char *cache_dir;
-
- /* Remote source */
-
- if (!source_location || !strlen (source_location)) {
- e_notice (parent, GTK_MESSAGE_ERROR,
- _("The group '%s' is remote. You must specify a location "
- "to get the calendar from"),
- e_source_group_peek_name (group));
- return FALSE;
- }
-
- uri = e_uri_new (source_location);
- if (!uri) {
- e_notice (parent, GTK_MESSAGE_ERROR,
- _("The source location '%s' is not well-formed."),
- source_location);
- return FALSE;
- }
-
- /* Make sure we're in agreement with the protocol. Note that EUri sets it
- * to 'file' if none was specified in the input URI. We don't want to
- * silently translate an explicit file:// into http:// though. */
- if (uri->protocol &&
- strcmp (uri->protocol, "http") &&
- strcmp (uri->protocol, "webcal")) {
- e_uri_free (uri);
- e_notice (parent, GTK_MESSAGE_ERROR,
- _("The source location '%s' is not a webcal source."),
- source_location);
- return FALSE;
- }
-
- /* Our relative_uri is everything but protocol, which is supplied by parent group */
- relative_uri = print_uri_noproto (uri);
- e_uri_free (uri);
-
- /* Set up cache dir */
- cache_dir = g_build_filename (g_get_home_dir (),
- "/.evolution/calendar/webcal/",
- source_name, NULL);
- if (e_mkdir_hier (cache_dir, 0700)) {
- g_free (relative_uri);
- g_free (cache_dir);
- e_notice (parent, GTK_MESSAGE_ERROR,
- _("Could not create cache for new calendar"));
- return FALSE;
- }
-
- /* Create source */
- source = e_source_new (source_name, relative_uri);
-
- g_free (relative_uri);
- g_free (cache_dir);
- } else {
- char *new_dir;
-
- /* Local source */
-
- new_dir = g_build_filename (e_source_group_peek_base_uri (group),
- source_name, NULL);
- if (e_mkdir_hier (new_dir, 0700)) {
- g_free (new_dir);
- e_notice (parent, GTK_MESSAGE_ERROR,
- _("Could not create directory for new calendar"));
- return FALSE;
- }
-
- source = e_source_new (source_name, source_name);
- g_free (new_dir);
- }
-
- e_source_group_add_source (group, source, -1);
- return TRUE;
-}
-
-/**
- * new_calendar_dialog
- *
- * Displays a dialog that allows the user to create a new calendar.
- */
-gboolean
-new_calendar_dialog (GtkWindow *parent)
-{
- GtkWidget *dialog, *cal_group, *cal_name, *cal_location;
- GladeXML *xml;
- ESourceList *source_list;
- GConfClient *gconf_client;
- GSList *groups, *sl;
- gboolean result = FALSE, retry = TRUE;
-
- /* load the Glade file */
- xml = glade_xml_new (EVOLUTION_GLADEDIR "/new-calendar.glade", "new-calendar-dialog", NULL);
- if (!xml) {
- g_warning (G_STRLOC ": cannot load Glade file");
- return FALSE;
- }
-
- dialog = glade_xml_get_widget (xml, "new-calendar-dialog");
- cal_group = glade_xml_get_widget (xml, "calendar-group");
- cal_name = glade_xml_get_widget (xml, "calendar-name");
- cal_location = glade_xml_get_widget (xml, "calendar-location");
-
- /* set up widgets */
- gconf_client = gconf_client_get_default ();
- source_list = e_source_list_new_for_gconf (gconf_client, "/apps/evolution/calendar/sources");
-
- groups = e_source_list_peek_groups (source_list);
- for (sl = groups; sl != NULL; sl = sl->next) {
- GtkWidget *menu_item, *menu;
- ESourceGroup *group = sl->data;
-
- menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (cal_group));
- if (!GTK_IS_MENU (menu)) {
- menu = gtk_menu_new ();
- gtk_option_menu_set_menu (GTK_OPTION_MENU (cal_group), menu);
- gtk_widget_show (menu);
- }
-
- menu_item = gtk_menu_item_new_with_label (e_source_group_peek_name (group));
- gtk_widget_show (menu_item);
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
- }
-
- if (groups)
- gtk_option_menu_set_history (GTK_OPTION_MENU (cal_group), 0);
-
- /* run the dialog */
- do {
- if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK) {
- const char *name;
- const char *location;
-
- name = gtk_entry_get_text (GTK_ENTRY (cal_name));
- location = gtk_entry_get_text (GTK_ENTRY (cal_location));
- sl = g_slist_nth (groups, gtk_option_menu_get_history (GTK_OPTION_MENU (cal_group)));
- if (sl) {
- if (create_new_source_with_group (GTK_WINDOW (dialog),
- sl->data,
- name,
- location))
- retry = FALSE;
- } else {
- e_notice (dialog, GTK_MESSAGE_ERROR,
- _("A group must be selected"));
- continue;
- }
- } else
- retry = FALSE; /* user pressed Cancel */
- } while (retry);
-
- /* free memory */
- g_object_unref (gconf_client);
- g_object_unref (source_list);
- gtk_widget_destroy (dialog);
- g_object_unref (xml);
-
- return result;
-}
diff --git a/calendar/gui/dialogs/new-calendar.glade b/calendar/gui/dialogs/new-calendar.glade
deleted file mode 100644
index 0a136ed7c8..0000000000
--- a/calendar/gui/dialogs/new-calendar.glade
+++ /dev/null
@@ -1,239 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-
-<widget class="GtkDialog" id="new-calendar-dialog">
- <property name="border_width">12</property>
- <property name="visible">True</property>
- <property name="title" translatable="yes">Add New Calendar</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_CENTER</property>
- <property name="modal">False</property>
- <property name="resizable">False</property>
- <property name="destroy_with_parent">False</property>
- <property name="has_separator">True</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox1">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area1">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="cancelbutton1">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">-6</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="okbutton1">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">-5</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="table1">
- <property name="visible">True</property>
- <property name="n_rows">4</property>
- <property name="n_columns">3</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label2">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Calendar Group</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_padding">6</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkOptionMenu" id="calendar-group">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">-1</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_padding">6</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="calendar-name">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_padding">6</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">&lt;b&gt;Calendar options&lt;/b&gt;</property>
- <property name="use_underline">False</property>
- <property name="use_markup">True</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">3</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_padding">6</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label3">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Calendar Name</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_padding">6</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="calendar-source-label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Calendar Location</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_padding">6</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="calendar-location">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_padding">6</property>
- <property name="y_options"></property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">4</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/calendar/gui/dialogs/new-calendar.h b/calendar/gui/dialogs/new-calendar.h
deleted file mode 100644
index 86c819796e..0000000000
--- a/calendar/gui/dialogs/new-calendar.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Evolution calendar - New calendar dialog
- *
- * Copyright (C) 2003 Novell, Inc.
- *
- * Author: Rodrigo Moya <rodrigo@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef NEW_CALENDAR_H
-#define NEW_CALENDAR_H
-
-#include <gtk/gtkwindow.h>
-
-gboolean new_calendar_dialog (GtkWindow *parent);
-
-#endif
diff --git a/calendar/gui/dialogs/new-task-list.c b/calendar/gui/dialogs/new-task-list.c
deleted file mode 100644
index e77d35d4ad..0000000000
--- a/calendar/gui/dialogs/new-task-list.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/* Evolution calendar - New task list dialog
- *
- * Copyright (C) 2003 Novell, Inc.
- *
- * Author: Rodrigo Moya <rodrigo@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <bonobo/bonobo-i18n.h>
-#include <gtk/gtkentry.h>
-#include <gtk/gtkmenu.h>
-#include <gtk/gtkmenuitem.h>
-#include <gtk/gtkmessagedialog.h>
-#include <gtk/gtkoptionmenu.h>
-#include <glade/glade.h>
-#include <e-util/e-dialog-utils.h>
-#include <libedataserver/e-source-list.h>
-#include "new-task-list.h"
-
-static gboolean
-create_new_source_with_group (GtkWindow *parent,
- ESourceGroup *group,
- const char *source_name)
-{
- ESource *source;
- char *new_dir;
-
- if (e_source_group_peek_source_by_name (group, source_name)) {
- e_notice (parent, GTK_MESSAGE_ERROR,
- _("Source with name '%s' already exists in the selected group"),
- source_name);
- return FALSE;
- }
-
- new_dir = g_build_filename (e_source_group_peek_base_uri (group),
- source_name, NULL);
- if (e_mkdir_hier (new_dir, 0700)) {
- g_free (new_dir);
- e_notice (parent, GTK_MESSAGE_ERROR,
- _("Could not create directory for new task list"));
- return FALSE;
- }
-
- source = e_source_new (source_name, source_name);
- g_free (new_dir);
-
- e_source_group_add_source (group, source, -1);
- return TRUE;
-}
-
-/**
- * new_task_list_dialog
- *
- * Displays a dialog that allows the user to create a new task list.
- */
-gboolean
-new_task_list_dialog (GtkWindow *parent)
-{
- GtkWidget *dialog, *task_group, *task_name;
- GladeXML *xml;
- ESourceList *source_list;
- GConfClient *gconf_client;
- GSList *groups, *sl;
- gboolean result = FALSE, retry = TRUE;
-
- /* load the Glade file */
- xml = glade_xml_new (EVOLUTION_GLADEDIR "/new-task-list.glade", "new-task-list-dialog", NULL);
- if (!xml) {
- g_warning (G_STRLOC ": cannot load Glade file");
- return FALSE;
- }
-
- dialog = glade_xml_get_widget (xml, "new-task-list-dialog");
- task_group = glade_xml_get_widget (xml, "task-list-group");
- task_name = glade_xml_get_widget (xml, "task-list-name");
-
- /* set up widgets */
- gconf_client = gconf_client_get_default ();
- source_list = e_source_list_new_for_gconf (gconf_client, "/apps/evolution/tasks/sources");
-
- groups = e_source_list_peek_groups (source_list);
- for (sl = groups; sl != NULL; sl = sl->next) {
- GtkWidget *menu_item, *menu;
- ESourceGroup *group = sl->data;
-
- menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (task_group));
- if (!GTK_IS_MENU (menu)) {
- menu = gtk_menu_new ();
- gtk_option_menu_set_menu (GTK_OPTION_MENU (task_group), menu);
- gtk_widget_show (menu);
- }
-
- menu_item = gtk_menu_item_new_with_label (e_source_group_peek_name (group));
- gtk_widget_show (menu_item);
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
- }
-
- if (groups)
- gtk_option_menu_set_history (GTK_OPTION_MENU (task_group), 0);
-
- /* run the dialog */
- do {
- if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK) {
- const char *name;
-
- name = gtk_entry_get_text (GTK_ENTRY (task_name));
- sl = g_slist_nth (groups, gtk_option_menu_get_history (GTK_OPTION_MENU (task_group)));
- if (sl) {
- if (create_new_source_with_group (GTK_WINDOW (dialog),
- sl->data,
- name))
- retry = FALSE;
- } else {
- e_notice (dialog, GTK_MESSAGE_ERROR,
- _("A group must be selected"));
- continue;
- }
- } else
- retry = FALSE; /* user pressed Cancel */
- } while (retry);
-
- /* free memory */
- g_object_unref (gconf_client);
- g_object_unref (source_list);
- gtk_widget_destroy (dialog);
- g_object_unref (xml);
-
- return result;
-}
diff --git a/calendar/gui/dialogs/new-task-list.glade b/calendar/gui/dialogs/new-task-list.glade
deleted file mode 100644
index ffc38582c8..0000000000
--- a/calendar/gui/dialogs/new-task-list.glade
+++ /dev/null
@@ -1,193 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-<requires lib="gnome"/>
-
-<widget class="GtkDialog" id="new-task-list-dialog">
- <property name="border_width">12</property>
- <property name="visible">True</property>
- <property name="title" translatable="yes">Add New Task List</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_CENTER</property>
- <property name="modal">False</property>
- <property name="resizable">False</property>
- <property name="destroy_with_parent">False</property>
- <property name="has_separator">True</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox1">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area1">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="cancelbutton1">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">-6</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="okbutton1">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">-5</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="table1">
- <property name="visible">True</property>
- <property name="n_rows">3</property>
- <property name="n_columns">3</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label2">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Task List Group</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_padding">6</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkOptionMenu" id="task-list-group">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">-1</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_padding">6</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="task-list-name">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_padding">6</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">&lt;b&gt;Task List Options&lt;/b&gt;</property>
- <property name="use_underline">False</property>
- <property name="use_markup">True</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">3</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_padding">6</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label3">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Task List Name</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_padding">6</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">4</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/calendar/gui/dialogs/new-task-list.h b/calendar/gui/dialogs/new-task-list.h
deleted file mode 100644
index 3f529f39ad..0000000000
--- a/calendar/gui/dialogs/new-task-list.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Evolution calendar - New task list dialog
- *
- * Copyright (C) 2003 Novell, Inc.
- *
- * Author: Rodrigo Moya <rodrigo@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef NEW_TASK_LIST_H
-#define NEW_TASK_LIST_H
-
-#include <gtk/gtkwindow.h>
-
-gboolean new_task_list_dialog (GtkWindow *parent);
-
-#endif
diff --git a/calendar/gui/dialogs/recur-comp.c b/calendar/gui/dialogs/recur-comp.c
deleted file mode 100644
index f097d542f7..0000000000
--- a/calendar/gui/dialogs/recur-comp.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/* Evolution calendar - Recurring calendar component dialog
- *
- * Copyright (C) 2002 Ximian, Inc.
- *
- * Author: JP Rosevear <jpr@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <glib.h>
-#include <gtk/gtk.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnomeui/gnome-uidefs.h>
-#include "recur-comp.h"
-
-
-
-gboolean
-recur_component_dialog (ECal *client,
- ECalComponent *comp,
- CalObjModType *mod,
- GtkWindow *parent)
-{
- char *str;
- GtkWidget *dialog, *rb_this, *rb_prior, *rb_future, *rb_all, *hbox;
- ECalComponentVType vtype;
- gboolean ret;
-
- g_return_val_if_fail (E_IS_CAL_COMPONENT (comp), CALOBJ_MOD_THIS);
-
- vtype = e_cal_component_get_vtype (comp);
-
- switch (vtype) {
- case E_CAL_COMPONENT_EVENT:
- str = g_strdup_printf (_("You are modifying a recurring event, what would you like to modify?"));
- break;
-
- case E_CAL_COMPONENT_TODO:
- str = g_strdup_printf (_("You are modifying a recurring task, what would you like to modify?"));
- break;
-
- case E_CAL_COMPONENT_JOURNAL:
- str = g_strdup_printf (_("You are modifying a recurring journal entry, what would you like to modify?"));
- break;
-
- default:
- g_message ("recur_component_dialog(): Cannot handle object of type %d", vtype);
- return CALOBJ_MOD_THIS;
- }
-
-
- dialog = gtk_message_dialog_new (parent, 0, GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL, "%s", str);
- g_free (str);
-
- hbox = gtk_hbox_new (FALSE, 2);
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), hbox);
- rb_this = gtk_radio_button_new_with_label (NULL, _("This Instance Only"));
- gtk_container_add (GTK_CONTAINER (hbox), rb_this);
-
- if (!e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_NO_THISANDPRIOR)) {
- rb_prior = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (rb_this), _("This and Prior Instances"));
- gtk_container_add (GTK_CONTAINER (hbox), rb_prior);
- } else
- rb_prior = NULL;
-
- if (!e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_NO_THISANDFUTURE)) {
- rb_future = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (rb_this), _("This and Future Instances"));
- gtk_container_add (GTK_CONTAINER (hbox), rb_future);
- } else
- rb_future = NULL;
-
- rb_all = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (rb_this), _("All Instances"));
- gtk_container_add (GTK_CONTAINER (hbox), rb_all);
-
- gtk_widget_show_all (hbox);
-
- ret = gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK;
-
- if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rb_this)))
- *mod = CALOBJ_MOD_THIS;
- else if (rb_prior && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rb_prior)))
- *mod = CALOBJ_MOD_THISANDPRIOR;
- else if (rb_future && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rb_future)))
- *mod = CALOBJ_MOD_THISANDFUTURE;
- else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rb_all)))
- *mod = CALOBJ_MOD_ALL;
-
- gtk_widget_destroy (dialog);
-
- return ret;
-}
diff --git a/calendar/gui/dialogs/recur-comp.h b/calendar/gui/dialogs/recur-comp.h
deleted file mode 100644
index 94ccbdae87..0000000000
--- a/calendar/gui/dialogs/recur-comp.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Evolution calendar - Recurring calendar component dialog
- *
- * Copyright (C) 2002 Ximian, Inc.
- *
- * Author: JP Rosevear <jpr@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef RECUR_COMP_H
-#define RECUR_COMP_H
-
-#include <gtk/gtkwindow.h>
-#include <libecal/e-cal.h>
-#include <libecal/e-cal-component.h>
-#include <libecal/e-cal-util.h>
-
-gboolean recur_component_dialog (ECal *client,
- ECalComponent *comp,
- CalObjModType *mod,
- GtkWindow *parent);
-
-#endif
diff --git a/calendar/gui/dialogs/recurrence-page.c b/calendar/gui/dialogs/recurrence-page.c
deleted file mode 100644
index cdc820e6d6..0000000000
--- a/calendar/gui/dialogs/recurrence-page.c
+++ /dev/null
@@ -1,2411 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/* Evolution calendar - Recurrence page of the calendar component dialogs
- *
- * Copyright (C) 2001-2003 Ximian, Inc.
- *
- * Authors: Federico Mena-Quintero <federico@ximian.com>
- * Miguel de Icaza <miguel@ximian.com>
- * Seth Alves <alves@hungry.com>
- * JP Rosevear <jpr@ximian.com>
- * Hans Petter Jansson <hpj@ximiman.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <gtk/gtklabel.h>
-#include <gtk/gtkcellrenderertext.h>
-#include <gtk/gtkmenuitem.h>
-#include <gtk/gtkoptionmenu.h>
-#include <gtk/gtktogglebutton.h>
-#include <gtk/gtksignal.h>
-#include <gtk/gtkspinbutton.h>
-#include <gtk/gtktreeview.h>
-#include <gtk/gtktreeselection.h>
-#include <libgnome/gnome-i18n.h>
-#include <glade/glade.h>
-#include <e-util/e-dialog-widgets.h>
-#include <e-util/e-time-utils.h>
-#include <widgets/misc/e-dateedit.h>
-#include <libecal/e-cal-recur.h>
-#include <libecal/e-cal-time-util.h>
-#include "../calendar-config.h"
-#include "../tag-calendar.h"
-#include "../weekday-picker.h"
-#include "comp-editor-util.h"
-#include "../e-date-time-list.h"
-#include "../e-mini-calendar-config.h"
-#include "recurrence-page.h"
-
-
-
-enum month_num_options {
- MONTH_NUM_FIRST,
- MONTH_NUM_SECOND,
- MONTH_NUM_THIRD,
- MONTH_NUM_FOURTH,
- MONTH_NUM_LAST,
- MONTH_NUM_DAY,
- MONTH_NUM_OTHER
-};
-
-static const int month_num_options_map[] = {
- MONTH_NUM_FIRST,
- MONTH_NUM_SECOND,
- MONTH_NUM_THIRD,
- MONTH_NUM_FOURTH,
- MONTH_NUM_LAST,
- MONTH_NUM_DAY,
- MONTH_NUM_OTHER,
- -1
-};
-
-enum month_day_options {
- MONTH_DAY_NTH,
- MONTH_DAY_MON,
- MONTH_DAY_TUE,
- MONTH_DAY_WED,
- MONTH_DAY_THU,
- MONTH_DAY_FRI,
- MONTH_DAY_SAT,
- MONTH_DAY_SUN
-};
-
-static const int month_day_options_map[] = {
- MONTH_DAY_NTH,
- MONTH_DAY_MON,
- MONTH_DAY_TUE,
- MONTH_DAY_WED,
- MONTH_DAY_THU,
- MONTH_DAY_FRI,
- MONTH_DAY_SAT,
- MONTH_DAY_SUN,
- -1
-};
-
-enum recur_type {
- RECUR_NONE,
- RECUR_SIMPLE,
- RECUR_CUSTOM
-};
-
-static const int type_map[] = {
- RECUR_NONE,
- RECUR_SIMPLE,
- RECUR_CUSTOM,
- -1
-};
-
-static const int freq_map[] = {
- ICAL_DAILY_RECURRENCE,
- ICAL_WEEKLY_RECURRENCE,
- ICAL_MONTHLY_RECURRENCE,
- ICAL_YEARLY_RECURRENCE,
- -1
-};
-
-enum ending_type {
- ENDING_FOR,
- ENDING_UNTIL,
- ENDING_FOREVER
-};
-
-static const int ending_types_map[] = {
- ENDING_FOR,
- ENDING_UNTIL,
- ENDING_FOREVER,
- -1
-};
-
-/* Private part of the RecurrencePage structure */
-struct _RecurrencePagePrivate {
- /* Component we use to expand the recurrence rules for the preview */
- ECalComponent *comp;
-
- /* Glade XML data */
- GladeXML *xml;
-
- /* Widgets from the Glade file */
- GtkWidget *main;
-
- GtkWidget *summary;
- GtkWidget *date_time;
-
- GtkWidget *none;
- GtkWidget *simple;
- GtkWidget *custom;
-
- GtkWidget *params;
- GtkWidget *interval_value;
- GtkWidget *interval_unit;
- GtkWidget *special;
- GtkWidget *ending_menu;
- GtkWidget *ending_special;
- GtkWidget *custom_warning_bin;
-
- /* For weekly recurrences, created by hand */
- GtkWidget *weekday_picker;
- guint8 weekday_day_mask;
- guint8 weekday_blocked_day_mask;
-
- /* For monthly recurrences, created by hand */
- int month_index;
-
- GtkWidget *month_day_menu;
- enum month_day_options month_day;
-
- GtkWidget *month_num_menu;
- enum month_num_options month_num;
-
- /* For ending date, created by hand */
- GtkWidget *ending_date_edit;
- struct icaltimetype ending_date_tt;
-
- /* For ending count of occurrences, created by hand */
- GtkWidget *ending_count_spin;
- int ending_count;
-
- /* More widgets from the Glade file */
- GtkWidget *exception_date;
- GtkWidget *exception_list; /* This is a GtkTreeView now */
- GtkWidget *exception_add;
- GtkWidget *exception_modify;
- GtkWidget *exception_delete;
-
- GtkWidget *preview_bin;
-
- /* Store for exception_list */
- EDateTimeList *exception_list_store;
-
- /* For the recurrence preview, the actual widget */
- GtkWidget *preview_calendar;
- EMiniCalendarConfig *preview_calendar_config;
-
- gboolean updating;
-};
-
-
-
-static void recurrence_page_class_init (RecurrencePageClass *class);
-static void recurrence_page_init (RecurrencePage *rpage);
-static void recurrence_page_finalize (GObject *object);
-
-static GtkWidget *recurrence_page_get_widget (CompEditorPage *page);
-static void recurrence_page_focus_main_widget (CompEditorPage *page);
-static void recurrence_page_fill_widgets (CompEditorPage *page, ECalComponent *comp);
-static gboolean recurrence_page_fill_component (CompEditorPage *page, ECalComponent *comp);
-static void recurrence_page_set_summary (CompEditorPage *page, const char *summary);
-static void recurrence_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates);
-
-static void field_changed (RecurrencePage *apage);
-
-static CompEditorPageClass *parent_class = NULL;
-
-
-
-/**
- * recurrence_page_get_type:
- *
- * Registers the #RecurrencePage class if necessary, and returns the type ID
- * associated to it.
- *
- * Return value: The type ID of the #RecurrencePage class.
- **/
-
-E_MAKE_TYPE (recurrence_page, "RecurrencePage", RecurrencePage, recurrence_page_class_init,
- recurrence_page_init, TYPE_COMP_EDITOR_PAGE);
-
-/* Class initialization function for the recurrence page */
-static void
-recurrence_page_class_init (RecurrencePageClass *class)
-{
- CompEditorPageClass *editor_page_class;
- GObjectClass *object_class;
-
- editor_page_class = (CompEditorPageClass *) class;
- object_class = (GObjectClass *) class;
-
- parent_class = g_type_class_ref(TYPE_COMP_EDITOR_PAGE);
-
- editor_page_class->get_widget = recurrence_page_get_widget;
- editor_page_class->focus_main_widget = recurrence_page_focus_main_widget;
- editor_page_class->fill_widgets = recurrence_page_fill_widgets;
- editor_page_class->fill_component = recurrence_page_fill_component;
- editor_page_class->set_summary = recurrence_page_set_summary;
- editor_page_class->set_dates = recurrence_page_set_dates;
-
- object_class->finalize = recurrence_page_finalize;
-}
-
-/* Object initialization function for the recurrence page */
-static void
-recurrence_page_init (RecurrencePage *rpage)
-{
- RecurrencePagePrivate *priv;
-
- priv = g_new0 (RecurrencePagePrivate, 1);
- rpage->priv = priv;
-
- priv->xml = NULL;
-
- priv->main = NULL;
- priv->summary = NULL;
- priv->date_time = NULL;
- priv->none = NULL;
- priv->simple = NULL;
- priv->custom = NULL;
- priv->params = NULL;
- priv->interval_value = NULL;
- priv->interval_unit = NULL;
- priv->special = NULL;
- priv->ending_menu = NULL;
- priv->ending_special = NULL;
- priv->custom_warning_bin = NULL;
- priv->weekday_picker = NULL;
- priv->month_day_menu = NULL;
- priv->month_num_menu = NULL;
- priv->ending_date_edit = NULL;
- priv->ending_count_spin = NULL;
- priv->exception_date = NULL;
- priv->exception_list = NULL;
- priv->exception_add = NULL;
- priv->exception_modify = NULL;
- priv->exception_delete = NULL;
- priv->preview_bin = NULL;
- priv->preview_calendar = NULL;
-
- priv->comp = NULL;
-}
-
-/* Destroy handler for the recurrence page */
-static void
-recurrence_page_finalize (GObject *object)
-{
- RecurrencePage *rpage;
- RecurrencePagePrivate *priv;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (IS_RECURRENCE_PAGE (object));
-
- rpage = RECURRENCE_PAGE (object);
- priv = rpage->priv;
-
- if (priv->main)
- gtk_widget_unref (priv->main);
-
- if (priv->xml) {
- g_object_unref (priv->xml);
- priv->xml = NULL;
- }
-
- if (priv->comp) {
- g_object_unref (priv->comp);
- priv->comp = NULL;
- }
-
- if (priv->exception_list_store) {
- g_object_unref (priv->exception_list_store);
- priv->exception_list_store = NULL;
- }
-
- if (priv->preview_calendar_config) {
- g_object_unref (priv->preview_calendar_config);
- priv->preview_calendar_config = NULL;
- }
-
- g_free (priv);
- rpage->priv = NULL;
-
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
-}
-
-
-
-/* get_widget handler for the recurrence page */
-static GtkWidget *
-recurrence_page_get_widget (CompEditorPage *page)
-{
- RecurrencePage *rpage;
- RecurrencePagePrivate *priv;
-
- rpage = RECURRENCE_PAGE (page);
- priv = rpage->priv;
-
- return priv->main;
-}
-
-/* focus_main_widget handler for the recurrence page */
-static void
-recurrence_page_focus_main_widget (CompEditorPage *page)
-{
- RecurrencePage *rpage;
- RecurrencePagePrivate *priv;
-
- rpage = RECURRENCE_PAGE (page);
- priv = rpage->priv;
-
- if (e_dialog_toggle_get (priv->none))
- gtk_widget_grab_focus (priv->none);
- else if (e_dialog_toggle_get (priv->simple))
- gtk_widget_grab_focus (priv->simple);
- else if (e_dialog_toggle_get (priv->custom))
- gtk_widget_grab_focus (priv->custom);
- else
- g_assert_not_reached ();
-}
-
-/* Fills the widgets with default values */
-static void
-clear_widgets (RecurrencePage *rpage)
-{
- RecurrencePagePrivate *priv;
- GtkAdjustment *adj;
- GtkWidget *menu;
-
- priv = rpage->priv;
-
- priv->weekday_day_mask = 0;
-
- priv->month_index = 1;
- priv->month_num = MONTH_NUM_DAY;
- priv->month_day = MONTH_DAY_NTH;
-
- g_signal_handlers_block_matched (priv->none, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_block_matched (priv->simple, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_block_matched (priv->custom, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- e_dialog_radio_set (priv->none, RECUR_NONE, type_map);
- g_signal_handlers_unblock_matched (priv->none, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_unblock_matched (priv->simple, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_unblock_matched (priv->custom, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
-
- adj = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (priv->interval_value));
- g_signal_handlers_block_matched (adj, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- e_dialog_spin_set (priv->interval_value, 1);
- g_signal_handlers_unblock_matched (adj, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
-
- menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->interval_unit));
- g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- e_dialog_option_menu_set (priv->interval_unit,
- ICAL_DAILY_RECURRENCE,
- freq_map);
- g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
-
- priv->ending_date_tt = icaltime_today ();
- priv->ending_count = 1;
-
- menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->ending_menu));
- g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- e_dialog_option_menu_set (priv->ending_menu,
- ENDING_FOREVER,
- ending_types_map);
- g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
-
- /* Exceptions list */
- e_date_time_list_clear (priv->exception_list_store);
-}
-
-/* Appends an exception date to the list */
-static void
-append_exception (RecurrencePage *rpage, ECalComponentDateTime *datetime)
-{
- RecurrencePagePrivate *priv;
- GtkTreeView *view;
- GtkTreeIter iter;
-
- priv = rpage->priv;
- view = GTK_TREE_VIEW (priv->exception_list);
-
- e_date_time_list_append (priv->exception_list_store, &iter, datetime);
- gtk_tree_selection_select_iter (gtk_tree_view_get_selection (view), &iter);
-}
-
-/* Fills in the exception widgets with the data from the calendar component */
-static void
-fill_exception_widgets (RecurrencePage *rpage, ECalComponent *comp)
-{
- RecurrencePagePrivate *priv;
- GSList *list, *l;
- gboolean added = FALSE;
-
- priv = rpage->priv;
- e_cal_component_get_exdate_list (comp, &list);
-
- for (l = list; l; l = l->next) {
- ECalComponentDateTime *cdt;
-
- added = TRUE;
-
- cdt = l->data;
- append_exception (rpage, cdt);
- }
-
- e_cal_component_free_exdate_list (list);
-}
-
-/* Computes a weekday mask for the start day of a calendar component,
- * for use in a WeekdayPicker widget.
- */
-static guint8
-get_start_weekday_mask (ECalComponent *comp)
-{
- ECalComponentDateTime dt;
- guint8 retval;
-
- e_cal_component_get_dtstart (comp, &dt);
-
- if (dt.value) {
- short weekday;
-
- weekday = icaltime_day_of_week (*dt.value);
- retval = 0x1 << (weekday - 1);
- } else
- retval = 0;
-
- e_cal_component_free_datetime (&dt);
-
- return retval;
-}
-
-/* Sets some sane defaults for the data sources for the recurrence special
- * widgets, even if they will not be used immediately.
- */
-static void
-set_special_defaults (RecurrencePage *rpage)
-{
- RecurrencePagePrivate *priv;
- guint8 mask;
-
- priv = rpage->priv;
-
- mask = get_start_weekday_mask (priv->comp);
-
- priv->weekday_day_mask = mask;
- priv->weekday_blocked_day_mask = mask;
-}
-
-/* Sensitizes the recurrence widgets based on the state of the recurrence type
- * radio group.
- */
-static void
-sensitize_recur_widgets (RecurrencePage *rpage)
-{
- RecurrencePagePrivate *priv;
- enum recur_type type;
- GtkWidget *label;
-
- priv = rpage->priv;
-
- type = e_dialog_radio_get (priv->none, type_map);
-
- /* We can't preview that well for instances right now */
- if (e_cal_component_is_instance (priv->comp))
- gtk_widget_set_sensitive (priv->preview_calendar, FALSE);
- else
- gtk_widget_set_sensitive (priv->preview_calendar, TRUE);
-
- if (GTK_BIN (priv->custom_warning_bin)->child)
- gtk_widget_destroy (GTK_BIN (priv->custom_warning_bin)->child);
-
- switch (type) {
- case RECUR_NONE:
- gtk_widget_set_sensitive (priv->params, FALSE);
- gtk_widget_show (priv->params);
- gtk_widget_hide (priv->custom_warning_bin);
- break;
-
- case RECUR_SIMPLE:
- gtk_widget_set_sensitive (priv->params, TRUE);
- gtk_widget_show (priv->params);
- gtk_widget_hide (priv->custom_warning_bin);
- break;
-
- case RECUR_CUSTOM:
- gtk_widget_set_sensitive (priv->params, FALSE);
- gtk_widget_hide (priv->params);
-
- label = gtk_label_new (_("This appointment contains "
- "recurrences that Evolution "
- "cannot edit."));
- gtk_container_add (GTK_CONTAINER (priv->custom_warning_bin),
- label);
- gtk_widget_show_all (priv->custom_warning_bin);
- break;
-
- default:
- g_assert_not_reached ();
- }
-}
-
-#if 0
-/* Encondes a position/weekday pair into the proper format for
- * icalrecurrencetype.by_day. Not needed at present.
- */
-static short
-nth_weekday (int pos, icalrecurrencetype_weekday weekday)
-{
- g_assert (pos > 0 && pos <= 5);
-
- return (pos << 3) | (int) weekday;
-}
-#endif
-
-/* Gets the simple recurrence data from the recurrence widgets and stores it in
- * the calendar component.
- */
-static void
-simple_recur_to_comp (RecurrencePage *rpage, ECalComponent *comp)
-{
- RecurrencePagePrivate *priv;
- struct icalrecurrencetype r;
- GSList l;
- enum ending_type ending_type;
- gboolean date_set;
-
- priv = rpage->priv;
-
- icalrecurrencetype_clear (&r);
-
- /* Frequency, interval, week start */
-
- r.freq = e_dialog_option_menu_get (priv->interval_unit, freq_map);
- r.interval = e_dialog_spin_get_int (priv->interval_value);
- r.week_start = ICAL_SUNDAY_WEEKDAY
- + calendar_config_get_week_start_day ();
-
- /* Frequency-specific data */
-
- switch (r.freq) {
- case ICAL_DAILY_RECURRENCE:
- /* Nothing else is required */
- break;
-
- case ICAL_WEEKLY_RECURRENCE: {
- guint8 day_mask;
- int i;
-
- g_assert (GTK_BIN (priv->special)->child != NULL);
- g_assert (priv->weekday_picker != NULL);
- g_assert (IS_WEEKDAY_PICKER (priv->weekday_picker));
-
- day_mask = weekday_picker_get_days (WEEKDAY_PICKER (priv->weekday_picker));
-
- i = 0;
-
- if (day_mask & (1 << 0))
- r.by_day[i++] = ICAL_SUNDAY_WEEKDAY;
-
- if (day_mask & (1 << 1))
- r.by_day[i++] = ICAL_MONDAY_WEEKDAY;
-
- if (day_mask & (1 << 2))
- r.by_day[i++] = ICAL_TUESDAY_WEEKDAY;
-
- if (day_mask & (1 << 3))
- r.by_day[i++] = ICAL_WEDNESDAY_WEEKDAY;
-
- if (day_mask & (1 << 4))
- r.by_day[i++] = ICAL_THURSDAY_WEEKDAY;
-
- if (day_mask & (1 << 5))
- r.by_day[i++] = ICAL_FRIDAY_WEEKDAY;
-
- if (day_mask & (1 << 6))
- r.by_day[i++] = ICAL_SATURDAY_WEEKDAY;
-
- break;
- }
-
- case ICAL_MONTHLY_RECURRENCE: {
- enum month_num_options month_num;
- enum month_day_options month_day;
-
- g_assert (GTK_BIN (priv->special)->child != NULL);
- g_assert (priv->month_day_menu != NULL);
- g_assert (GTK_IS_OPTION_MENU (priv->month_day_menu));
- g_assert (priv->month_num_menu != NULL);
- g_assert (GTK_IS_OPTION_MENU (priv->month_num_menu));
-
- month_num = e_dialog_option_menu_get (priv->month_num_menu,
- month_num_options_map );
- month_day = e_dialog_option_menu_get (priv->month_day_menu,
- month_day_options_map);
-
- if (month_num == MONTH_NUM_LAST)
- month_num = -1;
- else
- month_num++;
-
- switch (month_day) {
- case MONTH_DAY_NTH:
- if (month_num == -1)
- r.by_month_day[0] = -1;
- else
- r.by_month_day[0] = priv->month_index;
- break;
-
- /* Outlook 2000 uses BYDAY=TU;BYSETPOS=2, and will not
- accept BYDAY=2TU. So we now use the same as Outlook
- by default. */
- case MONTH_DAY_MON:
- r.by_day[0] = ICAL_MONDAY_WEEKDAY;
- r.by_set_pos[0] = month_num;
- break;
-
- case MONTH_DAY_TUE:
- r.by_day[0] = ICAL_TUESDAY_WEEKDAY;
- r.by_set_pos[0] = month_num;
- break;
-
- case MONTH_DAY_WED:
- r.by_day[0] = ICAL_WEDNESDAY_WEEKDAY;
- r.by_set_pos[0] = month_num;
- break;
-
- case MONTH_DAY_THU:
- r.by_day[0] = ICAL_THURSDAY_WEEKDAY;
- r.by_set_pos[0] = month_num;
- break;
-
- case MONTH_DAY_FRI:
- r.by_day[0] = ICAL_FRIDAY_WEEKDAY;
- r.by_set_pos[0] = month_num;
- break;
-
- case MONTH_DAY_SAT:
- r.by_day[0] = ICAL_SATURDAY_WEEKDAY;
- r.by_set_pos[0] = month_num;
- break;
-
- case MONTH_DAY_SUN:
- r.by_day[0] = ICAL_SUNDAY_WEEKDAY;
- r.by_set_pos[0] = month_num;
- break;
-
- default:
- g_assert_not_reached ();
- }
-
- break;
- }
-
- case ICAL_YEARLY_RECURRENCE:
- /* Nothing else is required */
- break;
-
- default:
- g_assert_not_reached ();
- }
-
- /* Ending date */
-
- ending_type = e_dialog_option_menu_get (priv->ending_menu,
- ending_types_map);
-
- switch (ending_type) {
- case ENDING_FOR:
- g_assert (priv->ending_count_spin != NULL);
- g_assert (GTK_IS_SPIN_BUTTON (priv->ending_count_spin));
-
- r.count = e_dialog_spin_get_int (priv->ending_count_spin);
- break;
-
- case ENDING_UNTIL:
- g_assert (priv->ending_date_edit != NULL);
- g_assert (E_IS_DATE_EDIT (priv->ending_date_edit));
-
- /* We only allow a DATE value to be set for the UNTIL property,
- since we don't support sub-day recurrences. */
- date_set = e_date_edit_get_date (E_DATE_EDIT (priv->ending_date_edit),
- &r.until.year,
- &r.until.month,
- &r.until.day);
- g_assert (date_set);
-
- r.until.is_date = 1;
-
- break;
-
- case ENDING_FOREVER:
- /* Nothing to be done */
- break;
-
- default:
- g_assert_not_reached ();
- }
-
- /* Set the recurrence */
-
- l.data = &r;
- l.next = NULL;
-
- e_cal_component_set_rrule_list (comp, &l);
-}
-
-/* Fills a component with the data from the recurrence page; in the case of a
- * custom recurrence, it leaves it intact.
- */
-static gboolean
-fill_component (RecurrencePage *rpage, ECalComponent *comp)
-{
- RecurrencePagePrivate *priv;
- enum recur_type recur_type;
- GtkTreeModel *model;
- GtkTreeIter iter;
- gboolean valid_iter;
- GSList *list;
-
- priv = rpage->priv;
- model = GTK_TREE_MODEL (priv->exception_list_store);
-
- recur_type = e_dialog_radio_get (priv->none, type_map);
-
- switch (recur_type) {
- case RECUR_NONE:
- e_cal_component_set_rdate_list (comp, NULL);
- e_cal_component_set_rrule_list (comp, NULL);
- e_cal_component_set_exrule_list (comp, NULL);
- break;
-
- case RECUR_SIMPLE:
- e_cal_component_set_rdate_list (comp, NULL);
- e_cal_component_set_exrule_list (comp, NULL);
- simple_recur_to_comp (rpage, comp);
- break;
-
- case RECUR_CUSTOM:
- /* We just keep whatever the component has currently */
- break;
-
- default:
- g_assert_not_reached ();
- }
-
- /* Set exceptions */
-
- list = NULL;
-
- for (valid_iter = gtk_tree_model_get_iter_first (model, &iter); valid_iter;
- valid_iter = gtk_tree_model_iter_next (model, &iter)) {
- const ECalComponentDateTime *dt;
- ECalComponentDateTime *cdt;
-
- cdt = g_new (ECalComponentDateTime, 1);
- cdt->value = g_new (struct icaltimetype, 1);
-
- dt = e_date_time_list_get_date_time (E_DATE_TIME_LIST (model), &iter);
- g_assert (dt != NULL);
-
- if (!icaltime_is_valid_time (*dt->value)) {
- comp_editor_page_display_validation_error (COMP_EDITOR_PAGE (rpage),
- _("Recurrence date is invalid"),
- priv->exception_list);
- return FALSE;
- }
-
- *cdt->value = *dt->value;
- cdt->tzid = g_strdup (dt->tzid);
-
- list = g_slist_prepend (list, cdt);
- }
-
- e_cal_component_set_exdate_list (comp, list);
- e_cal_component_free_exdate_list (list);
-
- return TRUE;
-}
-
-/* Re-tags the recurrence preview calendar based on the current information of
- * the widgets in the recurrence page.
- */
-static void
-preview_recur (RecurrencePage *rpage)
-{
- RecurrencePagePrivate *priv;
- ECalComponent *comp;
- ECalComponentDateTime cdt;
- GSList *l;
- icaltimezone *zone = NULL;
-
- priv = rpage->priv;
-
- /* If our component has not been set yet through ::fill_widgets(), we
- * cannot preview the recurrence.
- */
- if (!priv->comp || e_cal_component_is_instance (priv->comp))
- return;
-
- /* Create a scratch component with the start/end and
- * recurrence/exception information from the one we are editing.
- */
-
- comp = e_cal_component_new ();
- e_cal_component_set_new_vtype (comp, E_CAL_COMPONENT_EVENT);
-
- e_cal_component_get_dtstart (priv->comp, &cdt);
- if (cdt.tzid != NULL) {
- /* FIXME Will e_cal_get_timezone really not return builtin zones? */
- if (!e_cal_get_timezone (COMP_EDITOR_PAGE (rpage)->client, cdt.tzid, &zone, NULL))
- zone = icaltimezone_get_builtin_timezone_from_tzid (cdt.tzid);
- }
- e_cal_component_set_dtstart (comp, &cdt);
- e_cal_component_free_datetime (&cdt);
-
- e_cal_component_get_dtend (priv->comp, &cdt);
- e_cal_component_set_dtend (comp, &cdt);
- e_cal_component_free_datetime (&cdt);
-
- e_cal_component_get_exdate_list (priv->comp, &l);
- e_cal_component_set_exdate_list (comp, l);
- e_cal_component_free_exdate_list (l);
-
- e_cal_component_get_exrule_list (priv->comp, &l);
- e_cal_component_set_exrule_list (comp, l);
- e_cal_component_free_recur_list (l);
-
- e_cal_component_get_rdate_list (priv->comp, &l);
- e_cal_component_set_rdate_list (comp, l);
- e_cal_component_free_period_list (l);
-
- e_cal_component_get_rrule_list (priv->comp, &l);
- e_cal_component_set_rrule_list (comp, l);
- e_cal_component_free_recur_list (l);
-
- fill_component (rpage, comp);
-
- tag_calendar_by_comp (E_CALENDAR (priv->preview_calendar), comp,
- COMP_EDITOR_PAGE (rpage)->client, zone, TRUE, FALSE);
- g_object_unref(comp);
-}
-
-/* Callback used when the recurrence weekday picker changes */
-static void
-weekday_picker_changed_cb (WeekdayPicker *wp, gpointer data)
-{
- RecurrencePage *rpage;
-
- rpage = RECURRENCE_PAGE (data);
-
- field_changed (rpage);
- preview_recur (rpage);
-}
-
-/* Creates the special contents for weekly recurrences */
-static void
-make_weekly_special (RecurrencePage *rpage)
-{
- RecurrencePagePrivate *priv;
- GtkWidget *hbox;
- GtkWidget *label;
- WeekdayPicker *wp;
-
- priv = rpage->priv;
-
- g_assert (GTK_BIN (priv->special)->child == NULL);
- g_assert (priv->weekday_picker == NULL);
-
- /* Create the widgets */
-
- hbox = gtk_hbox_new (FALSE, 2);
- gtk_container_add (GTK_CONTAINER (priv->special), hbox);
-
- label = gtk_label_new (_("on"));
- gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 6);
-
- wp = WEEKDAY_PICKER (weekday_picker_new ());
-
- priv->weekday_picker = GTK_WIDGET (wp);
- gtk_box_pack_start (GTK_BOX (hbox), GTK_WIDGET (wp), FALSE, FALSE, 6);
-
- gtk_widget_show_all (hbox);
-
- /* Set the weekdays */
-
- weekday_picker_set_week_start_day (wp, calendar_config_get_week_start_day ());
- weekday_picker_set_days (wp, priv->weekday_day_mask);
- weekday_picker_set_blocked_days (wp, priv->weekday_blocked_day_mask);
-
- g_signal_connect((wp), "changed",
- G_CALLBACK (weekday_picker_changed_cb),
- rpage);
-}
-
-
-static void
-month_num_submenu_selection_done_cb (GtkMenuShell *menu_shell, gpointer data)
-{
- GtkWidget *item;
- int month_index;
-
- item = gtk_menu_get_active (GTK_MENU (menu_shell));
- item = gtk_menu_get_active (GTK_MENU (gtk_menu_item_get_submenu (GTK_MENU_ITEM (item))));
-
- month_index = GPOINTER_TO_INT (gtk_object_get_user_data (GTK_OBJECT (item)));
- gtk_object_set_user_data (GTK_OBJECT (data), GINT_TO_POINTER (month_index));
-}
-
-/* Creates the option menu for the monthly recurrence number */
-static GtkWidget *
-make_recur_month_num_submenu (const char *title, int start, int end)
-{
- GtkWidget *submenu, *item;
- int i;
-
- submenu = gtk_menu_new ();
- for (i = start; i < end; i++) {
- item = gtk_menu_item_new_with_label (_(e_cal_recur_nth[i]));
- gtk_menu_shell_append(GTK_MENU_SHELL(submenu), item);
- gtk_object_set_user_data (GTK_OBJECT (item), GINT_TO_POINTER (i + 1));
- gtk_widget_show (item);
- }
-
- item = gtk_menu_item_new_with_label (_(title));
- gtk_widget_show (item);
- gtk_menu_item_set_submenu (GTK_MENU_ITEM (item), submenu);
-
- return item;
-}
-
-static GtkWidget *
-make_recur_month_num_menu (int month_index)
-{
- static const char *options[] = {
- N_("first"),
- N_("second"),
- N_("third"),
- N_("fourth"),
- N_("last")
- };
-
- GtkWidget *menu, *submenu, *item, *submenu_item;
- GtkWidget *omenu;
- int i;
-
- menu = gtk_menu_new ();
-
- /* Relation */
- for (i = 0; i < sizeof (options) / sizeof (options[0]); i++) {
- item = gtk_menu_item_new_with_label (_(options[i]));
- gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
- gtk_widget_show (item);
- }
-
- /* Current date */
- item = gtk_menu_item_new_with_label (_(e_cal_recur_nth[month_index - 1]));
- gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
- gtk_widget_show (item);
-
- /* Other Submenu */
- submenu = gtk_menu_new ();
- submenu_item = gtk_menu_item_new_with_label (_("Other Date"));
- gtk_menu_shell_append(GTK_MENU_SHELL(menu), submenu_item);
- gtk_widget_show (submenu_item);
-
- item = make_recur_month_num_submenu ("1st to 10th", 0, 10);
- gtk_menu_shell_append(GTK_MENU_SHELL(submenu), item);
- item = make_recur_month_num_submenu ("11th to 20th", 10, 20);
- gtk_menu_shell_append(GTK_MENU_SHELL(submenu), item);
- item = make_recur_month_num_submenu ("21st to 31st", 20, 31);
- gtk_menu_shell_append(GTK_MENU_SHELL(submenu), item);
-
- gtk_menu_item_set_submenu (GTK_MENU_ITEM (submenu_item), submenu);
- gtk_object_set_user_data (GTK_OBJECT (submenu_item), GINT_TO_POINTER (month_index));
- g_signal_connect((submenu), "selection_done",
- G_CALLBACK (month_num_submenu_selection_done_cb),
- submenu_item);
-
- omenu = gtk_option_menu_new ();
- gtk_option_menu_set_menu (GTK_OPTION_MENU (omenu), menu);
-
- return omenu;
-}
-
-/* Creates the option menu for the monthly recurrence days */
-static GtkWidget *
-make_recur_month_menu (void)
-{
- static const char *options[] = {
- N_("day"),
- N_("Monday"),
- N_("Tuesday"),
- N_("Wednesday"),
- N_("Thursday"),
- N_("Friday"),
- N_("Saturday"),
- N_("Sunday")
- };
-
- GtkWidget *menu;
- GtkWidget *omenu;
- int i;
-
- menu = gtk_menu_new ();
-
- for (i = 0; i < sizeof (options) / sizeof (options[0]); i++) {
- GtkWidget *item;
-
- item = gtk_menu_item_new_with_label (_(options[i]));
- gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
- gtk_widget_show (item);
- }
-
- omenu = gtk_option_menu_new ();
- gtk_option_menu_set_menu (GTK_OPTION_MENU (omenu), menu);
-
- return omenu;
-}
-
-static void
-month_num_menu_selection_done_cb (GtkMenuShell *menu_shell, gpointer data)
-{
- RecurrencePage *rpage;
- RecurrencePagePrivate *priv;
- enum month_num_options month_num;
- enum month_day_options month_day;
-
- rpage = RECURRENCE_PAGE (data);
- priv = rpage->priv;
-
- month_num = e_dialog_option_menu_get (priv->month_num_menu,
- month_num_options_map);
- month_day = e_dialog_option_menu_get (priv->month_day_menu,
- month_day_options_map);
-
- if (month_num == MONTH_NUM_OTHER) {
- GtkWidget *label, *item;
-
- item = gtk_menu_get_active (GTK_MENU (menu_shell));
- priv->month_index = GPOINTER_TO_INT (gtk_object_get_user_data (GTK_OBJECT (item)));
-
- month_num = MONTH_NUM_DAY;
- e_dialog_option_menu_set (priv->month_num_menu, month_num, month_num_options_map);
-
- label = GTK_BIN (priv->month_num_menu)->child;
- gtk_label_set_text (GTK_LABEL (label), _(e_cal_recur_nth[priv->month_index - 1]));
-
- e_dialog_option_menu_set (priv->month_num_menu, 0, month_num_options_map);
- e_dialog_option_menu_set (priv->month_num_menu, month_num, month_num_options_map);
- }
-
- if (month_num == MONTH_NUM_DAY && month_day != MONTH_DAY_NTH)
- e_dialog_option_menu_set (priv->month_day_menu,
- MONTH_DAY_NTH,
- month_day_options_map);
- else if (month_num != MONTH_NUM_DAY && month_num != MONTH_NUM_LAST && month_day == MONTH_DAY_NTH)
- e_dialog_option_menu_set (priv->month_day_menu,
- MONTH_DAY_MON,
- month_num_options_map);
- field_changed (rpage);
- preview_recur (rpage);
-}
-
-/* Callback used when the monthly day selection menu changes. We need
- * to change the valid range of the day index spin button; e.g. days
- * are 1-31 while a Sunday is the 1st through 5th.
- */
-static void
-month_day_menu_selection_done_cb (GtkMenuShell *menu_shell, gpointer data)
-{
- RecurrencePage *rpage;
- RecurrencePagePrivate *priv;
- enum month_num_options month_num;
- enum month_day_options month_day;
-
- rpage = RECURRENCE_PAGE (data);
- priv = rpage->priv;
-
- month_num = e_dialog_option_menu_get (priv->month_num_menu,
- month_num_options_map);
- month_day = e_dialog_option_menu_get (priv->month_day_menu,
- month_day_options_map);
- if (month_day == MONTH_DAY_NTH && month_num != MONTH_NUM_LAST && month_num != MONTH_NUM_DAY)
- e_dialog_option_menu_set (priv->month_num_menu,
- MONTH_NUM_DAY,
- month_num_options_map);
- else if (month_day != MONTH_DAY_NTH && month_num == MONTH_NUM_DAY)
- e_dialog_option_menu_set (priv->month_num_menu,
- MONTH_NUM_FIRST,
- month_num_options_map);
- field_changed (rpage);
- preview_recur (rpage);
-}
-
-/* Callback used when the month index value changes. */
-static void
-month_index_value_changed_cb (GtkAdjustment *adj, gpointer data)
-{
- RecurrencePage *rpage;
-
- rpage = RECURRENCE_PAGE (data);
-
- field_changed (rpage);
- preview_recur (rpage);
-}
-
-/* Creates the special contents for monthly recurrences */
-static void
-make_monthly_special (RecurrencePage *rpage)
-{
- RecurrencePagePrivate *priv;
- GtkWidget *hbox;
- GtkWidget *label;
- GtkAdjustment *adj;
- GtkWidget *menu;
-
- priv = rpage->priv;
-
- g_assert (GTK_BIN (priv->special)->child == NULL);
- g_assert (priv->month_day_menu == NULL);
-
- /* Create the widgets */
-
- hbox = gtk_hbox_new (FALSE, 2);
- gtk_container_add (GTK_CONTAINER (priv->special), hbox);
-
- label = gtk_label_new (_("on the"));
- gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 6);
-
- adj = GTK_ADJUSTMENT (gtk_adjustment_new (1, 1, 31, 1, 10, 10));
-
- priv->month_num_menu = make_recur_month_num_menu (priv->month_index);
- gtk_box_pack_start (GTK_BOX (hbox), priv->month_num_menu,
- FALSE, FALSE, 6);
-
- priv->month_day_menu = make_recur_month_menu ();
- gtk_box_pack_start (GTK_BOX (hbox), priv->month_day_menu,
- FALSE, FALSE, 6);
-
- gtk_widget_show_all (hbox);
-
- /* Set the options */
- e_dialog_option_menu_set (priv->month_num_menu,
- priv->month_num,
- month_num_options_map);
- e_dialog_option_menu_set (priv->month_day_menu,
- priv->month_day,
- month_day_options_map);
-
- g_signal_connect((adj), "value_changed", G_CALLBACK (month_index_value_changed_cb),
- rpage);
-
- menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->month_num_menu));
- g_signal_connect((menu), "selection_done",
- G_CALLBACK (month_num_menu_selection_done_cb),
- rpage);
- menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->month_day_menu));
- g_signal_connect((menu), "selection_done",
- G_CALLBACK (month_day_menu_selection_done_cb),
- rpage);
-}
-
-/* Changes the recurrence-special widget to match the interval units.
- *
- * For daily recurrences: nothing.
- * For weekly recurrences: weekday selector.
- * For monthly recurrences: "on the" <nth> [day, Weekday]
- * For yearly recurrences: nothing.
- */
-static void
-make_recurrence_special (RecurrencePage *rpage)
-{
- RecurrencePagePrivate *priv;
- icalrecurrencetype_frequency frequency;
-
- priv = rpage->priv;
-
- if (priv->month_num_menu != NULL) {
- gtk_widget_destroy (priv->month_num_menu);
- priv->month_num_menu = NULL;
- }
- if (GTK_BIN (priv->special)->child != NULL) {
- gtk_widget_destroy (GTK_BIN (priv->special)->child);
-
- priv->weekday_picker = NULL;
- priv->month_day_menu = NULL;
- }
-
- frequency = e_dialog_option_menu_get (priv->interval_unit, freq_map);
-
- switch (frequency) {
- case ICAL_DAILY_RECURRENCE:
- gtk_widget_hide (priv->special);
- break;
-
- case ICAL_WEEKLY_RECURRENCE:
- make_weekly_special (rpage);
- gtk_widget_show (priv->special);
- break;
-
- case ICAL_MONTHLY_RECURRENCE:
- make_monthly_special (rpage);
- gtk_widget_show (priv->special);
- break;
-
- case ICAL_YEARLY_RECURRENCE:
- gtk_widget_hide (priv->special);
- break;
-
- default:
- g_assert_not_reached ();
- }
-}
-
-/* Counts the elements in the by_xxx fields of an icalrecurrencetype */
-static int
-count_by_xxx (short *field, int max_elements)
-{
- int i;
-
- for (i = 0; i < max_elements; i++)
- if (field[i] == ICAL_RECURRENCE_ARRAY_MAX)
- break;
-
- return i;
-}
-
-/* Callback used when the ending-until date editor changes */
-static void
-ending_until_changed_cb (EDateEdit *de, gpointer data)
-{
- RecurrencePage *rpage;
-
- rpage = RECURRENCE_PAGE (data);
- field_changed (rpage);
- preview_recur (rpage);
-}
-
-/* Creates the special contents for "ending until" (end date) recurrences */
-static void
-make_ending_until_special (RecurrencePage *rpage)
-{
- RecurrencePagePrivate *priv;
- EDateEdit *de;
-
- priv = rpage->priv;
-
- g_assert (GTK_BIN (priv->ending_special)->child == NULL);
- g_assert (priv->ending_date_edit == NULL);
-
- /* Create the widget */
-
- priv->ending_date_edit = comp_editor_new_date_edit (TRUE, FALSE,
- FALSE);
- de = E_DATE_EDIT (priv->ending_date_edit);
-
- gtk_container_add (GTK_CONTAINER (priv->ending_special),
- GTK_WIDGET (de));
- gtk_widget_show_all (GTK_WIDGET (de));
-
- /* Set the value */
-
- e_date_edit_set_date (de, priv->ending_date_tt.year,
- priv->ending_date_tt.month,
- priv->ending_date_tt.day);
-
- g_signal_connect((de), "changed",
- G_CALLBACK (ending_until_changed_cb), rpage);
-
- /* Make sure the EDateEdit widget uses our timezones to get the
- current time. */
- e_date_edit_set_get_time_callback (de,
- (EDateEditGetTimeCallback) comp_editor_get_current_time,
- rpage, NULL);
-}
-
-/* Callback used when the ending-count value changes */
-static void
-ending_count_value_changed_cb (GtkAdjustment *adj, gpointer data)
-{
- RecurrencePage *rpage;
-
- rpage = RECURRENCE_PAGE (data);
- field_changed (rpage);
- preview_recur (rpage);
-}
-
-/* Creates the special contents for the occurrence count case */
-static void
-make_ending_count_special (RecurrencePage *rpage)
-{
- RecurrencePagePrivate *priv;
- GtkWidget *hbox;
- GtkWidget *label;
- GtkAdjustment *adj;
-
- priv = rpage->priv;
-
- g_assert (GTK_BIN (priv->ending_special)->child == NULL);
- g_assert (priv->ending_count_spin == NULL);
-
- /* Create the widgets */
-
- hbox = gtk_hbox_new (FALSE, 2);
- gtk_container_add (GTK_CONTAINER (priv->ending_special), hbox);
-
- adj = GTK_ADJUSTMENT (gtk_adjustment_new (1, 1, 10000, 1, 10, 10));
- priv->ending_count_spin = gtk_spin_button_new (adj, 1, 0);
- gtk_spin_button_set_numeric ((GtkSpinButton *)priv->ending_count_spin, TRUE);
- gtk_box_pack_start (GTK_BOX (hbox), priv->ending_count_spin,
- FALSE, FALSE, 6);
-
- label = gtk_label_new (_("occurrences"));
- gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 6);
-
- gtk_widget_show_all (hbox);
-
- /* Set the values */
-
- e_dialog_spin_set (priv->ending_count_spin, priv->ending_count);
-
- g_signal_connect((adj), "value_changed",
- G_CALLBACK (ending_count_value_changed_cb),
- rpage);
-}
-
-/* Changes the recurrence-ending-special widget to match the ending date option
- *
- * For: <n> [days, weeks, months, years, occurrences]
- * Until: <date selector>
- * Forever: nothing.
- */
-static void
-make_ending_special (RecurrencePage *rpage)
-{
- RecurrencePagePrivate *priv;
- enum ending_type ending_type;
-
- priv = rpage->priv;
-
- if (GTK_BIN (priv->ending_special)->child != NULL) {
- gtk_widget_destroy (GTK_BIN (priv->ending_special)->child);
-
- priv->ending_date_edit = NULL;
- priv->ending_count_spin = NULL;
- }
-
- ending_type = e_dialog_option_menu_get (priv->ending_menu,
- ending_types_map);
-
- switch (ending_type) {
- case ENDING_FOR:
- make_ending_count_special (rpage);
- gtk_widget_show (priv->ending_special);
- break;
-
- case ENDING_UNTIL:
- make_ending_until_special (rpage);
- gtk_widget_show (priv->ending_special);
- break;
-
- case ENDING_FOREVER:
- gtk_widget_hide (priv->ending_special);
- break;
-
- default:
- g_assert_not_reached ();
- }
-}
-
-/* Fills the recurrence ending date widgets with the values from the calendar
- * component.
- */
-static void
-fill_ending_date (RecurrencePage *rpage, struct icalrecurrencetype *r)
-{
- RecurrencePagePrivate *priv;
- GtkWidget *menu;
-
- priv = rpage->priv;
-
- menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->ending_menu));
- g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
-
- if (r->count == 0) {
- if (r->until.year == 0) {
- /* Forever */
-
- e_dialog_option_menu_set (priv->ending_menu,
- ENDING_FOREVER,
- ending_types_map);
- } else {
- /* Ending date */
-
- if (!r->until.is_date) {
- ECal *client = COMP_EDITOR_PAGE (rpage)->client;
- ECalComponentDateTime dt;
- icaltimezone *from_zone, *to_zone;
-
- e_cal_component_get_dtstart (priv->comp, &dt);
-
- if (dt.value->is_date)
- to_zone = icaltimezone_get_builtin_timezone (calendar_config_get_timezone ());
- else if (dt.tzid == NULL)
- to_zone = icaltimezone_get_utc_timezone ();
- else
- /* FIXME Error checking? */
- e_cal_get_timezone (client, dt.tzid, &to_zone, NULL);
- from_zone = icaltimezone_get_utc_timezone ();
-
- icaltimezone_convert_time (&r->until, from_zone, to_zone);
-
- r->until.hour = 0;
- r->until.minute = 0;
- r->until.second = 0;
- r->until.is_date = TRUE;
- r->until.is_utc = FALSE;
- }
-
- priv->ending_date_tt = r->until;
- e_dialog_option_menu_set (priv->ending_menu,
- ENDING_UNTIL,
- ending_types_map);
- }
- } else {
- /* Count of occurrences */
-
- priv->ending_count = r->count;
- e_dialog_option_menu_set (priv->ending_menu,
- ENDING_FOR,
- ending_types_map);
- }
-
- g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
-
- make_ending_special (rpage);
-}
-
-/* fill_widgets handler for the recurrence page. This function is particularly
- * tricky because it has to discriminate between recurrences we support for
- * editing and the ones we don't. We only support at most one recurrence rule;
- * no rdates or exrules (exdates are handled just fine elsewhere).
- */
-static void
-recurrence_page_fill_widgets (CompEditorPage *page, ECalComponent *comp)
-{
- RecurrencePage *rpage;
- RecurrencePagePrivate *priv;
- ECalComponentText text;
- CompEditorPageDates dates;
- GSList *rrule_list;
- int len;
- struct icalrecurrencetype *r;
- int n_by_second, n_by_minute, n_by_hour;
- int n_by_day, n_by_month_day, n_by_year_day;
- int n_by_week_no, n_by_month, n_by_set_pos;
- GtkWidget *menu;
- GtkAdjustment *adj;
-
- rpage = RECURRENCE_PAGE (page);
- priv = rpage->priv;
-
- /* Keep a copy of the component so that we can expand the recurrence
- * set for the preview.
- */
-
- if (priv->comp)
- g_object_unref (priv->comp);
-
- priv->comp = e_cal_component_clone (comp);
-
- /* Don't send off changes during this time */
- priv->updating = TRUE;
-
- /* Clean the page */
- clear_widgets (rpage);
-
- /* Summary */
- e_cal_component_get_summary (comp, &text);
- recurrence_page_set_summary (page, text.value);
-
- /* Dates */
- comp_editor_dates (&dates, comp);
- recurrence_page_set_dates (page, &dates);
- comp_editor_free_dates (&dates);
-
- /* Exceptions */
- fill_exception_widgets (rpage, comp);
-
- /* Set up defaults for the special widgets */
- set_special_defaults (rpage);
-
- /* No recurrences? */
-
- if (!e_cal_component_has_rdates (comp)
- && !e_cal_component_has_rrules (comp)
- && !e_cal_component_has_exrules (comp)) {
- gtk_signal_handler_block_by_data (GTK_OBJECT (priv->none),
- rpage);
- gtk_signal_handler_block_by_data (GTK_OBJECT (priv->simple),
- rpage);
- gtk_signal_handler_block_by_data (GTK_OBJECT (priv->custom),
- rpage);
- e_dialog_radio_set (priv->none, RECUR_NONE, type_map);
- gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->none),
- rpage);
- gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->simple),
- rpage);
- gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->custom),
- rpage);
-
- gtk_widget_set_sensitive (priv->custom, FALSE);
-
- sensitize_recur_widgets (rpage);
- preview_recur (rpage);
-
- priv->updating = FALSE;
- return;
- }
-
- /* See if it is a custom set we don't support */
-
- e_cal_component_get_rrule_list (comp, &rrule_list);
- len = g_slist_length (rrule_list);
- if (len > 1
- || e_cal_component_has_rdates (comp)
- || e_cal_component_has_exrules (comp))
- goto custom;
-
- /* Down to one rule, so test that one */
-
- g_assert (len == 1);
- r = rrule_list->data;
-
- /* Any funky frequency? */
-
- if (r->freq == ICAL_SECONDLY_RECURRENCE
- || r->freq == ICAL_MINUTELY_RECURRENCE
- || r->freq == ICAL_HOURLY_RECURRENCE)
- goto custom;
-
- /* Any funky shit? */
-
-#define N_HAS_BY(field) (count_by_xxx (field, sizeof (field) / sizeof (field[0])))
-
- n_by_second = N_HAS_BY (r->by_second);
- n_by_minute = N_HAS_BY (r->by_minute);
- n_by_hour = N_HAS_BY (r->by_hour);
- n_by_day = N_HAS_BY (r->by_day);
- n_by_month_day = N_HAS_BY (r->by_month_day);
- n_by_year_day = N_HAS_BY (r->by_year_day);
- n_by_week_no = N_HAS_BY (r->by_week_no);
- n_by_month = N_HAS_BY (r->by_month);
- n_by_set_pos = N_HAS_BY (r->by_set_pos);
-
- if (n_by_second != 0
- || n_by_minute != 0
- || n_by_hour != 0)
- goto custom;
-
- /* Filter the funky shit based on the frequency; if there is nothing
- * weird we can actually set the widgets.
- */
-
- switch (r->freq) {
- case ICAL_DAILY_RECURRENCE:
- if (n_by_day != 0
- || n_by_month_day != 0
- || n_by_year_day != 0
- || n_by_week_no != 0
- || n_by_month != 0
- || n_by_set_pos != 0)
- goto custom;
-
- menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->interval_unit));
- g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- e_dialog_option_menu_set (priv->interval_unit,
- ICAL_DAILY_RECURRENCE,
- freq_map);
- g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- break;
-
- case ICAL_WEEKLY_RECURRENCE: {
- int i;
- guint8 day_mask;
-
- if (n_by_month_day != 0
- || n_by_year_day != 0
- || n_by_week_no != 0
- || n_by_month != 0
- || n_by_set_pos != 0)
- goto custom;
-
- day_mask = 0;
-
- for (i = 0; i < 8 && r->by_day[i] != ICAL_RECURRENCE_ARRAY_MAX; i++) {
- enum icalrecurrencetype_weekday weekday;
- int pos;
-
- weekday = icalrecurrencetype_day_day_of_week (r->by_day[i]);
- pos = icalrecurrencetype_day_position (r->by_day[i]);
-
- if (pos != 0)
- goto custom;
-
- switch (weekday) {
- case ICAL_SUNDAY_WEEKDAY:
- day_mask |= 1 << 0;
- break;
-
- case ICAL_MONDAY_WEEKDAY:
- day_mask |= 1 << 1;
- break;
-
- case ICAL_TUESDAY_WEEKDAY:
- day_mask |= 1 << 2;
- break;
-
- case ICAL_WEDNESDAY_WEEKDAY:
- day_mask |= 1 << 3;
- break;
-
- case ICAL_THURSDAY_WEEKDAY:
- day_mask |= 1 << 4;
- break;
-
- case ICAL_FRIDAY_WEEKDAY:
- day_mask |= 1 << 5;
- break;
-
- case ICAL_SATURDAY_WEEKDAY:
- day_mask |= 1 << 6;
- break;
-
- default:
- break;
- }
- }
-
- priv->weekday_day_mask = day_mask;
-
- menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->interval_unit));
- g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- e_dialog_option_menu_set (priv->interval_unit,
- ICAL_WEEKLY_RECURRENCE,
- freq_map);
- g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- break;
- }
-
- case ICAL_MONTHLY_RECURRENCE:
- if (n_by_year_day != 0
- || n_by_week_no != 0
- || n_by_month != 0
- || n_by_set_pos > 1)
- goto custom;
-
- if (n_by_month_day == 1) {
- int nth;
-
- if (n_by_set_pos != 0)
- goto custom;
-
- nth = r->by_month_day[0];
- if (nth < 1 && nth != -1)
- goto custom;
-
- if (nth == -1) {
- ECalComponentDateTime dt;
-
- e_cal_component_get_dtstart (comp, &dt);
- priv->month_index = dt.value->day;
- priv->month_num = MONTH_NUM_LAST;
- } else {
- priv->month_index = nth;
- priv->month_num = MONTH_NUM_DAY;
- }
- priv->month_day = MONTH_DAY_NTH;
-
- } else if (n_by_day == 1) {
- enum icalrecurrencetype_weekday weekday;
- int pos;
- enum month_day_options month_day;
-
- /* Outlook 2000 uses BYDAY=TU;BYSETPOS=2, and will not
- accept BYDAY=2TU. So we now use the same as Outlook
- by default. */
-
- weekday = icalrecurrencetype_day_day_of_week (r->by_day[0]);
- pos = icalrecurrencetype_day_position (r->by_day[0]);
-
- if (pos == 0) {
- if (n_by_set_pos != 1)
- goto custom;
- pos = r->by_set_pos[0];
- } else if (pos < 0) {
- goto custom;
- }
-
- switch (weekday) {
- case ICAL_MONDAY_WEEKDAY:
- month_day = MONTH_DAY_MON;
- break;
-
- case ICAL_TUESDAY_WEEKDAY:
- month_day = MONTH_DAY_TUE;
- break;
-
- case ICAL_WEDNESDAY_WEEKDAY:
- month_day = MONTH_DAY_WED;
- break;
-
- case ICAL_THURSDAY_WEEKDAY:
- month_day = MONTH_DAY_THU;
- break;
-
- case ICAL_FRIDAY_WEEKDAY:
- month_day = MONTH_DAY_FRI;
- break;
-
- case ICAL_SATURDAY_WEEKDAY:
- month_day = MONTH_DAY_SAT;
- break;
-
- case ICAL_SUNDAY_WEEKDAY:
- month_day = MONTH_DAY_SUN;
- break;
-
- default:
- goto custom;
- }
-
- if (pos == -1)
- priv->month_num = MONTH_NUM_LAST;
- else
- priv->month_num = pos - 1;
- priv->month_day = month_day;
- } else
- goto custom;
-
- menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->interval_unit));
- g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- e_dialog_option_menu_set (priv->interval_unit,
- ICAL_MONTHLY_RECURRENCE,
- freq_map);
- g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- break;
-
- case ICAL_YEARLY_RECURRENCE:
- if (n_by_day != 0
- || n_by_month_day != 0
- || n_by_year_day != 0
- || n_by_week_no != 0
- || n_by_month != 0
- || n_by_set_pos != 0)
- goto custom;
-
- menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->interval_unit));
- g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- e_dialog_option_menu_set (priv->interval_unit,
- ICAL_YEARLY_RECURRENCE,
- freq_map);
- g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- break;
-
- default:
- goto custom;
- }
-
- /* If we got here it means it is a simple recurrence */
-
- g_signal_handlers_block_matched (priv->none, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_block_matched (priv->simple, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_block_matched (priv->custom, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- e_dialog_radio_set (priv->simple, RECUR_SIMPLE, type_map);
- g_signal_handlers_unblock_matched (priv->none, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_unblock_matched (priv->simple, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_unblock_matched (priv->custom, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
-
- gtk_widget_set_sensitive (priv->custom, FALSE);
-
- sensitize_recur_widgets (rpage);
- make_recurrence_special (rpage);
-
- adj = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (priv->interval_value));
- g_signal_handlers_block_matched (adj, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- e_dialog_spin_set (priv->interval_value, r->interval);
- g_signal_handlers_unblock_matched (adj, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
-
- fill_ending_date (rpage, r);
-
- goto out;
-
- custom:
-
- g_signal_handlers_block_matched (priv->none, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_block_matched (priv->simple, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_block_matched (priv->custom, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- e_dialog_radio_set (priv->custom, RECUR_CUSTOM, type_map);
- g_signal_handlers_unblock_matched (priv->none, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_unblock_matched (priv->simple, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_unblock_matched (priv->custom, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
-
- gtk_widget_set_sensitive (priv->custom, TRUE);
- sensitize_recur_widgets (rpage);
-
- out:
-
- e_cal_component_free_recur_list (rrule_list);
- preview_recur (rpage);
-
- priv->updating = FALSE;
-}
-
-/* fill_component handler for the recurrence page */
-static gboolean
-recurrence_page_fill_component (CompEditorPage *page, ECalComponent *comp)
-{
- RecurrencePage *rpage;
-
- rpage = RECURRENCE_PAGE (page);
- return fill_component (rpage, comp);
-}
-
-/* set_summary handler for the recurrence page */
-static void
-recurrence_page_set_summary (CompEditorPage *page, const char *summary)
-{
- RecurrencePage *rpage;
- RecurrencePagePrivate *priv;
-
- rpage = RECURRENCE_PAGE (page);
- priv = rpage->priv;
-
- gtk_label_set_text (GTK_LABEL (priv->summary), summary);
-}
-
-/* set_dates handler for the recurrence page */
-static void
-recurrence_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates)
-{
- RecurrencePage *rpage;
- RecurrencePagePrivate *priv;
- ECalComponentDateTime dt;
- struct icaltimetype icaltime;
- guint8 mask;
-
- rpage = RECURRENCE_PAGE (page);
- priv = rpage->priv;
-
- comp_editor_date_label (dates, priv->date_time);
-
- /* Copy the dates to our component */
-
- if (!priv->comp)
- return;
-
- dt.value = &icaltime;
-
- if (dates->start) {
- icaltime = *dates->start->value;
- dt.tzid = dates->start->tzid;
- e_cal_component_set_dtstart (priv->comp, &dt);
- }
-
- if (dates->end) {
- icaltime = *dates->end->value;
- dt.tzid = dates->end->tzid;
- e_cal_component_set_dtend (priv->comp, &dt);
- }
-
- /* Update the weekday picker if necessary */
- mask = get_start_weekday_mask (priv->comp);
- if (mask != priv->weekday_blocked_day_mask) {
- priv->weekday_day_mask = priv->weekday_day_mask | mask;
- priv->weekday_blocked_day_mask = mask;
-
- if (priv->weekday_picker != NULL) {
- weekday_picker_set_days (WEEKDAY_PICKER (priv->weekday_picker),
- priv->weekday_day_mask);
- weekday_picker_set_blocked_days (WEEKDAY_PICKER (priv->weekday_picker),
- priv->weekday_blocked_day_mask);
- }
- }
-
- /* Make sure the preview gets updated. */
- preview_recur (rpage);
-}
-
-
-
-/* Gets the widgets from the XML file and returns if they are all available. */
-static gboolean
-get_widgets (RecurrencePage *rpage)
-{
- CompEditorPage *page = COMP_EDITOR_PAGE (rpage);
- RecurrencePagePrivate *priv;
- GSList *accel_groups;
- GtkWidget *toplevel;
-
- priv = rpage->priv;
-
-#define GW(name) glade_xml_get_widget (priv->xml, name)
-
- priv->main = GW ("recurrence-page");
- if (!priv->main)
- return FALSE;
-
- /* Get the GtkAccelGroup from the toplevel window, so we can install
- it when the notebook page is mapped. */
- toplevel = gtk_widget_get_toplevel (priv->main);
- accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel));
- if (accel_groups) {
- page->accel_group = accel_groups->data;
- gtk_accel_group_ref (page->accel_group);
- }
-
- gtk_widget_ref (priv->main);
- gtk_container_remove (GTK_CONTAINER (priv->main->parent), priv->main);
-
- priv->summary = GW ("summary");
- priv->date_time = GW ("date-time");
-
- priv->none = GW ("none");
- priv->simple = GW ("simple");
- priv->custom = GW ("custom");
- priv->params = GW ("params");
-
- priv->interval_value = GW ("interval-value");
- priv->interval_unit = GW ("interval-unit");
- priv->special = GW ("special");
- priv->ending_menu = GW ("ending-menu");
- priv->ending_special = GW ("ending-special");
- priv->custom_warning_bin = GW ("custom-warning-bin");
-
- priv->exception_date = GW ("exception-date");
- gtk_widget_show (priv->exception_date);
- priv->exception_list = GW ("exception-list");
- priv->exception_add = GW ("exception-add");
- priv->exception_modify = GW ("exception-modify");
- priv->exception_delete = GW ("exception-delete");
-
- priv->preview_bin = GW ("preview-bin");
-
-#undef GW
-
- return (priv->summary
- && priv->date_time
- && priv->none
- && priv->simple
- && priv->custom
- && priv->params
- && priv->interval_value
- && priv->interval_unit
- && priv->special
- && priv->ending_menu
- && priv->ending_special
- && priv->custom_warning_bin
- && priv->exception_date
- && priv->exception_list
- && priv->exception_add
- && priv->exception_modify
- && priv->exception_delete
- && priv->preview_bin);
-}
-
-/* Callback used when the displayed date range in the recurrence preview
- * calendar changes.
- */
-static void
-preview_date_range_changed_cb (ECalendarItem *item, gpointer data)
-{
- RecurrencePage *rpage;
-
- rpage = RECURRENCE_PAGE (data);
- preview_recur (rpage);
-}
-
-/* Callback used when one of the recurrence type radio buttons is toggled. We
- * enable or disable the recurrence parameters.
- */
-static void
-type_toggled_cb (GtkToggleButton *toggle, gpointer data)
-{
- RecurrencePage *rpage;
-
- rpage = RECURRENCE_PAGE (data);
-
- field_changed (rpage);
-
- if (toggle->active) {
- sensitize_recur_widgets (rpage);
- preview_recur (rpage);
- }
-}
-
-/* Callback used when the recurrence interval value spin button changes. */
-static void
-interval_value_changed_cb (GtkAdjustment *adj, gpointer data)
-{
- RecurrencePage *rpage;
-
- rpage = RECURRENCE_PAGE (data);
-
- field_changed (rpage);
- preview_recur (rpage);
-}
-
-/* Callback used when the recurrence interval option menu changes. We need to
- * change the contents of the recurrence special widget.
- */
-static void
-interval_selection_done_cb (GtkMenuShell *menu_shell, gpointer data)
-{
- RecurrencePage *rpage;
-
- rpage = RECURRENCE_PAGE (data);
-
- field_changed (rpage);
- make_recurrence_special (rpage);
- preview_recur (rpage);
-}
-
-/* Callback used when the recurrence ending option menu changes. We need to
- * change the contents of the ending special widget.
- */
-static void
-ending_selection_done_cb (GtkMenuShell *menu_shell, gpointer data)
-{
- RecurrencePage *rpage;
-
- rpage = RECURRENCE_PAGE (data);
-
- field_changed (rpage);
- make_ending_special (rpage);
- preview_recur (rpage);
-}
-
-/* Callback for the "add exception" button */
-static void
-exception_add_cb (GtkWidget *widget, gpointer data)
-{
- RecurrencePage *rpage;
- RecurrencePagePrivate *priv;
- ECalComponentDateTime dt;
- struct icaltimetype icaltime = icaltime_null_time ();
- gboolean date_set;
-
- rpage = RECURRENCE_PAGE (data);
- priv = rpage->priv;
-
- field_changed (rpage);
-
- dt.value = &icaltime;
-
- /* We use DATE values for exceptions, so we don't need a TZID. */
- dt.tzid = NULL;
- icaltime.is_date = 1;
-
- date_set = e_date_edit_get_date (E_DATE_EDIT (priv->exception_date),
- &icaltime.year,
- &icaltime.month,
- &icaltime.day);
- g_assert (date_set);
-
- append_exception (rpage, &dt);
- preview_recur (rpage);
-}
-
-/* Callback for the "modify exception" button */
-static void
-exception_modify_cb (GtkWidget *widget, gpointer data)
-{
- RecurrencePage *rpage;
- RecurrencePagePrivate *priv;
- GtkTreeSelection *selection;
- ECalComponentDateTime dt;
- struct icaltimetype icaltime = icaltime_null_time ();
- struct icaltimetype *tt;
- GtkTreeIter iter;
-
- rpage = RECURRENCE_PAGE (data);
- priv = rpage->priv;
-
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->exception_list));
- if (!gtk_tree_selection_get_selected (selection, NULL, &iter)) {
- g_warning ("Could not get a selection to modify.");
- return;
- }
- field_changed (rpage);
-
- dt.value = &icaltime;
- tt = dt.value;
- e_date_edit_get_date (E_DATE_EDIT (priv->exception_date),
- &tt->year, &tt->month, &tt->day);
- tt->hour = 0;
- tt->minute = 0;
- tt->second = 0;
- tt->is_date = 1;
-
- /* No TZID, since we are using a DATE value now. */
- dt.tzid = NULL;
-
- e_date_time_list_set_date_time (priv->exception_list_store, &iter, &dt);
- preview_recur (rpage);
-}
-
-/* Callback for the "delete exception" button */
-static void
-exception_delete_cb (GtkWidget *widget, gpointer data)
-{
- RecurrencePage *rpage;
- RecurrencePagePrivate *priv;
- GtkTreeSelection *selection;
- GtkTreeIter iter;
- GtkTreePath *path;
- gboolean valid_iter;
-
- rpage = RECURRENCE_PAGE (data);
- priv = rpage->priv;
-
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->exception_list));
- if (!gtk_tree_selection_get_selected (selection, NULL, &iter)) {
- g_warning ("Could not get a selection to delete.");
- return;
- }
-
- field_changed (rpage);
-
- path = gtk_tree_model_get_path (GTK_TREE_MODEL (priv->exception_list_store), &iter);
- e_date_time_list_remove (priv->exception_list_store, &iter);
-
- /* Select closest item after removal */
- valid_iter = gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->exception_list_store), &iter, path);
- if (!valid_iter) {
- gtk_tree_path_prev (path);
- valid_iter = gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->exception_list_store), &iter, path);
- }
-
- if (valid_iter)
- gtk_tree_selection_select_iter (selection, &iter);
-
- gtk_tree_path_free (path);
- preview_recur (rpage);
-}
-
-/* Callback used when a row is selected in the list of exception
- * dates. We must update the date/time widgets to reflect the
- * exception's value.
- */
-static void
-exception_selection_changed_cb (GtkTreeSelection *selection, gpointer data)
-{
- RecurrencePage *rpage;
- RecurrencePagePrivate *priv;
- const ECalComponentDateTime *dt;
- struct icaltimetype *t;
- GtkTreeIter iter;
-
- rpage = RECURRENCE_PAGE (data);
- priv = rpage->priv;
-
- if (!gtk_tree_selection_get_selected (selection, NULL, &iter)) {
- gtk_widget_set_sensitive (priv->exception_modify, FALSE);
- gtk_widget_set_sensitive (priv->exception_delete, FALSE);
- return;
- }
-
- gtk_widget_set_sensitive (priv->exception_modify, TRUE);
- gtk_widget_set_sensitive (priv->exception_delete, TRUE);
-
- dt = e_date_time_list_get_date_time (priv->exception_list_store, &iter);
- g_assert (dt != NULL);
-
- t = dt->value;
-
- e_date_edit_set_date (E_DATE_EDIT (priv->exception_date),
- t->year, t->month, t->day);
- e_date_edit_set_time_of_day (E_DATE_EDIT (priv->exception_date),
- t->hour, t->minute);
-}
-
-/* This is called when any field is changed; it notifies upstream. */
-static void
-field_changed (RecurrencePage *rpage)
-{
- RecurrencePagePrivate *priv;
-
- priv = rpage->priv;
-
- if (!priv->updating)
- comp_editor_page_notify_changed (COMP_EDITOR_PAGE (rpage));
-}
-
-/* Hooks the widget signals */
-static void
-init_widgets (RecurrencePage *rpage)
-{
- RecurrencePagePrivate *priv;
- ECalendar *ecal;
- GtkAdjustment *adj;
- GtkWidget *menu;
- GtkTreeViewColumn *column;
- GtkCellRenderer *cell_renderer;
-
- priv = rpage->priv;
-
- /* Recurrence preview */
-
- priv->preview_calendar = e_calendar_new ();
- ecal = E_CALENDAR (priv->preview_calendar);
- priv->preview_calendar_config = e_mini_calendar_config_new (ecal);
- g_signal_connect((ecal->calitem), "date_range_changed",
- G_CALLBACK (preview_date_range_changed_cb),
- rpage);
- e_calendar_item_set_max_days_sel (ecal->calitem, 0);
- gtk_container_add (GTK_CONTAINER (priv->preview_bin),
- priv->preview_calendar);
- gtk_widget_show (priv->preview_calendar);
-
- /* Make sure the EDateEdit widgets and ECalendarItem use our timezones
- to get the current time. */
- e_date_edit_set_show_time (E_DATE_EDIT (priv->exception_date), FALSE);
- e_date_edit_set_get_time_callback (E_DATE_EDIT (priv->exception_date),
- (EDateEditGetTimeCallback) comp_editor_get_current_time,
- rpage, NULL);
- e_calendar_item_set_get_time_callback (ecal->calitem,
- (ECalendarItemGetTimeCallback) comp_editor_get_current_time,
- rpage, NULL);
-
- /* Recurrence types */
-
- g_signal_connect((priv->none), "toggled",
- G_CALLBACK (type_toggled_cb), rpage);
- g_signal_connect((priv->simple), "toggled",
- G_CALLBACK (type_toggled_cb), rpage);
- g_signal_connect((priv->custom), "toggled",
- G_CALLBACK (type_toggled_cb), rpage);
-
- /* Recurrence interval */
-
- adj = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (priv->interval_value));
- g_signal_connect((adj), "value_changed",
- G_CALLBACK (interval_value_changed_cb),
- rpage);
-
- /* Recurrence units */
-
- menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->interval_unit));
- g_signal_connect((menu), "selection_done",
- G_CALLBACK (interval_selection_done_cb),
- rpage);
-
- /* Recurrence ending */
-
- menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->ending_menu));
- g_signal_connect((menu), "selection_done",
- G_CALLBACK (ending_selection_done_cb), rpage);
-
- /* Exception buttons */
-
- g_signal_connect((priv->exception_add), "clicked",
- G_CALLBACK (exception_add_cb), rpage);
- g_signal_connect((priv->exception_modify), "clicked",
- G_CALLBACK (exception_modify_cb), rpage);
- g_signal_connect((priv->exception_delete), "clicked",
- G_CALLBACK (exception_delete_cb), rpage);
-
- gtk_widget_set_sensitive (priv->exception_modify, FALSE);
- gtk_widget_set_sensitive (priv->exception_delete, FALSE);
-
- /* Exception list */
-
- /* Model */
- priv->exception_list_store = e_date_time_list_new ();
- gtk_tree_view_set_model (GTK_TREE_VIEW (priv->exception_list),
- GTK_TREE_MODEL (priv->exception_list_store));
-
- /* View */
- column = gtk_tree_view_column_new ();
- gtk_tree_view_column_set_title (column, _("Date/Time"));
- cell_renderer = GTK_CELL_RENDERER (gtk_cell_renderer_text_new ());
- gtk_tree_view_column_pack_start (column, cell_renderer, TRUE);
- gtk_tree_view_column_add_attribute (column, cell_renderer, "text", E_DATE_TIME_LIST_COLUMN_DESCRIPTION);
- gtk_tree_view_append_column (GTK_TREE_VIEW (priv->exception_list), column);
-
- g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->exception_list)), "changed",
- G_CALLBACK (exception_selection_changed_cb), rpage);
-}
-
-
-
-/**
- * recurrence_page_construct:
- * @rpage: A recurrence page.
- *
- * Constructs a recurrence page by loading its Glade data.
- *
- * Return value: The same object as @rpage, or NULL if the widgets could not be
- * created.
- **/
-RecurrencePage *
-recurrence_page_construct (RecurrencePage *rpage)
-{
- RecurrencePagePrivate *priv;
-
- priv = rpage->priv;
-
- priv->xml = glade_xml_new (EVOLUTION_GLADEDIR
- "/recurrence-page.glade", NULL, NULL);
- if (!priv->xml) {
- g_message ("recurrence_page_construct(): "
- "Could not load the Glade XML file!");
- return NULL;
- }
-
- if (!get_widgets (rpage)) {
- g_message ("recurrence_page_construct(): "
- "Could not find all widgets in the XML file!");
- return NULL;
- }
-
- init_widgets (rpage);
-
- return rpage;
-}
-
-/**
- * recurrence_page_new:
- *
- * Creates a new recurrence page.
- *
- * Return value: A newly-created recurrence page, or NULL if the page could not
- * be created.
- **/
-RecurrencePage *
-recurrence_page_new (void)
-{
- RecurrencePage *rpage;
-
- rpage = g_object_new (TYPE_RECURRENCE_PAGE, NULL);
- if (!recurrence_page_construct (rpage)) {
- g_object_unref (rpage);
- return NULL;
- }
-
- return rpage;
-}
-
-
-GtkWidget *make_exdate_date_edit (void);
-
-GtkWidget *
-make_exdate_date_edit (void)
-{
- return comp_editor_new_date_edit (TRUE, TRUE, FALSE);
-}
-
diff --git a/calendar/gui/dialogs/recurrence-page.glade b/calendar/gui/dialogs/recurrence-page.glade
deleted file mode 100644
index c5c2158979..0000000000
--- a/calendar/gui/dialogs/recurrence-page.glade
+++ /dev/null
@@ -1,724 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-
-<widget class="GtkWindow" id="recurrence-toplevel">
- <property name="title" translatable="yes">window1</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
-
- <child>
- <widget class="GtkVBox" id="recurrence-page">
- <property name="border_width">12</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkFrame" id="frame35">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkTable" id="table14">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label66">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Summary:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label67">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Date/Time:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="summary">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">4</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="date-time">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">4</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Basics</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox55">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkFrame" id="frame36">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkVBox" id="vbox56">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkHBox" id="hbox56">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkRadioButton" id="none">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_No recurrence</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="simple">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Simple recurrence</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">none</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="custom">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Custom recurrence</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">none</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox57">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkHBox" id="params">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</property>
-
- <child>
- <widget class="GtkLabel" id="label68">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Every</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkSpinButton" id="interval-value">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">True</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">1 1 10000 1 10 10</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkOptionMenu" id="interval-unit">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget1">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget2">
- <property name="visible">True</property>
- <property name="label" translatable="yes">day(s)</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget3">
- <property name="visible">True</property>
- <property name="label" translatable="yes">week(s)</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget4">
- <property name="visible">True</property>
- <property name="label" translatable="yes">month(s)</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget5">
- <property name="visible">True</property>
- <property name="label" translatable="yes">year(s)</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="special">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
-
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkOptionMenu" id="ending-menu">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget6">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget7">
- <property name="visible">True</property>
- <property name="label" translatable="yes">for</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget8">
- <property name="visible">True</property>
- <property name="label" translatable="yes">until</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget9">
- <property name="visible">True</property>
- <property name="label" translatable="yes">forever</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="ending-special">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
-
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="custom-warning-bin">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xscale">1</property>
- <property name="yscale">1</property>
-
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label68">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Recurrence Rule</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox59">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkFrame" id="frame37">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkHBox" id="hbox60">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkVBox" id="vbox57">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="GtkButton" id="exception-add">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">A_dd</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="exception-modify">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Modify</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="exception-delete">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Remove</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox58">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="Custom" id="exception-date">
- <property name="visible">True</property>
- <property name="creation_function">make_exdate_date_edit</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Tue, 16 May 2000 01:42:29 GMT</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow14">
- <property name="visible">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <widget class="GtkTreeView" id="exception-list">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="headers_visible">True</property>
- <property name="rules_hint">False</property>
- <property name="reorderable">False</property>
- <property name="enable_search">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label69">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Exceptions</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox59">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label70">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Preview</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="preview-bin">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
- <property name="xscale">1</property>
- <property name="yscale">1</property>
-
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/calendar/gui/dialogs/recurrence-page.h b/calendar/gui/dialogs/recurrence-page.h
deleted file mode 100644
index 7a10eff069..0000000000
--- a/calendar/gui/dialogs/recurrence-page.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Evolution calendar - Recurrence page of the calendar component dialogs
- *
- * Copyright (C) 2001-2003 Ximian, Inc.
- *
- * Authors: Federico Mena-Quintero <federico@ximian.com>
- * Miguel de Icaza <miguel@ximian.com>
- * Seth Alves <alves@hungry.com>
- * JP Rosevear <jpr@ximian.com>
- * Hans Petter Jansson <hpj@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef RECURRENCE_PAGE_H
-#define RECURRENCE_PAGE_H
-
-#include "comp-editor-page.h"
-
-G_BEGIN_DECLS
-
-
-
-#define TYPE_RECURRENCE_PAGE (recurrence_page_get_type ())
-#define RECURRENCE_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_RECURRENCE_PAGE, RecurrencePage))
-#define RECURRENCE_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_RECURRENCE_PAGE, RecurrencePageClass))
-#define IS_RECURRENCE_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_RECURRENCE_PAGE))
-#define IS_RECURRENCE_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), TYPE_RECURRENCE_PAGE))
-
-typedef struct _RecurrencePagePrivate RecurrencePagePrivate;
-
-typedef struct {
- CompEditorPage page;
-
- /* Private data */
- RecurrencePagePrivate *priv;
-} RecurrencePage;
-
-typedef struct {
- CompEditorPageClass parent_class;
-} RecurrencePageClass;
-
-
-GtkType recurrence_page_get_type (void);
-RecurrencePage *recurrence_page_construct (RecurrencePage *rpage);
-RecurrencePage *recurrence_page_new (void);
-
-
-
-G_END_DECLS
-
-#endif
diff --git a/calendar/gui/dialogs/save-comp.c b/calendar/gui/dialogs/save-comp.c
deleted file mode 100644
index 8041395fb1..0000000000
--- a/calendar/gui/dialogs/save-comp.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Evolution calendar - Delete calendar component dialog
- *
- * Copyright (C) 2000 Ximian, Inc.
- * Copyright (C) 2000 Ximian, Inc.
- *
- * Author: Federico Mena-Quintero <federico@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <glib.h>
-#include <libgnome/gnome-i18n.h>
-#include <gtk/gtkmessagedialog.h>
-#include <gtk/gtkstock.h>
-#include "save-comp.h"
-
-
-
-/**
- * save_component_dialog:
- * @parent: Window to use as the transient dialog's parent.
- *
- * Pops up a dialog box asking the user whether he wants to save changes for
- * a calendar component.
- *
- * Return value: the response_id of the button selected.
- **/
-
-GtkResponseType
-save_component_dialog (GtkWindow *parent)
-{
- GtkWidget *dialog;
- gint r;
-
- dialog = gtk_message_dialog_new (GTK_WINDOW (parent),
- GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE,
- _("This event has been changed, but has not been saved.\n\n"
- "Do you wish to save your changes?"));
-
- gtk_dialog_add_buttons (GTK_DIALOG (dialog),
- _("_Discard Changes"),GTK_RESPONSE_NO,
- GTK_STOCK_CANCEL,GTK_RESPONSE_CANCEL,
- GTK_STOCK_SAVE, GTK_RESPONSE_YES,
- NULL);
-
- gtk_window_set_title (GTK_WINDOW (dialog), _("Save Event"));
- gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_YES);
-
- r = gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
-
- return r;
-
-}
diff --git a/calendar/gui/dialogs/save-comp.h b/calendar/gui/dialogs/save-comp.h
deleted file mode 100644
index a9aedd2bce..0000000000
--- a/calendar/gui/dialogs/save-comp.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Evolution calendar - Delete calendar component dialog
- *
- * Copyright (C) 2000 Ximian, Inc.
- * Copyright (C) 2000 Ximian, Inc.
- *
- * Author: Federico Mena-Quintero <federico@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef SAVE_COMP_H
-#define SAVE_COMP_H
-
-#include <gtk/gtkdialog.h>
-
-GtkResponseType save_component_dialog (GtkWindow *parent);
-
-#endif
diff --git a/calendar/gui/dialogs/schedule-page.c b/calendar/gui/dialogs/schedule-page.c
deleted file mode 100644
index fc91916345..0000000000
--- a/calendar/gui/dialogs/schedule-page.c
+++ /dev/null
@@ -1,517 +0,0 @@
-/* Evolution calendar - Scheduling page
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Authors: Federico Mena-Quintero <federico@ximian.com>
- * Miguel de Icaza <miguel@ximian.com>
- * Seth Alves <alves@hungry.com>
- * JP Rosevear <jpr@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <glib.h>
-#include <gtk/gtksignal.h>
-#include <gtk/gtktogglebutton.h>
-#include <gtk/gtkvbox.h>
-#include <gtk/gtkwindow.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnomeui/gnome-dialog-util.h>
-#include <glade/glade.h>
-#include <gal/widgets/e-popup-menu.h>
-#include <e-util/e-dialog-widgets.h>
-#include "../calendar-config.h"
-#include "../e-meeting-time-sel.h"
-#include "../itip-utils.h"
-#include "comp-editor-util.h"
-#include "e-delegate-dialog.h"
-#include "schedule-page.h"
-
-
-
-/* Private part of the SchedulePage structure */
-struct _SchedulePagePrivate {
- /* Glade XML data */
- GladeXML *xml;
-
- /* Widgets from the Glade file */
- GtkWidget *main;
-
- /* Model */
- EMeetingStore *model;
-
- /* Selector */
- EMeetingTimeSelector *sel;
-
- /* The timezone we use. Note that we use the same timezone for the
- start and end date. We convert the end date if it is passed in in
- another timezone. */
- icaltimezone *zone;
-
- gboolean updating;
-};
-
-
-
-static void schedule_page_class_init (SchedulePageClass *class);
-static void schedule_page_init (SchedulePage *spage);
-static void schedule_page_finalize (GObject *object);
-
-static GtkWidget *schedule_page_get_widget (CompEditorPage *page);
-static void schedule_page_focus_main_widget (CompEditorPage *page);
-static void schedule_page_fill_widgets (CompEditorPage *page, ECalComponent *comp);
-static gboolean schedule_page_fill_component (CompEditorPage *page, ECalComponent *comp);
-static void schedule_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates);
-
-static void times_changed_cb (GtkWidget *widget, gpointer data);
-
-static CompEditorPageClass *parent_class = NULL;
-
-
-
-/**
- * schedule_page_get_type:
- *
- * Registers the #SchedulePage class if necessary, and returns the type ID
- * associated to it.
- *
- * Return value: The type ID of the #SchedulePage class.
- **/
-
-E_MAKE_TYPE (schedule_page, "SchedulePage", SchedulePage, schedule_page_class_init,
- schedule_page_init, TYPE_COMP_EDITOR_PAGE);
-
-/* Class initialization function for the schedule page */
-static void
-schedule_page_class_init (SchedulePageClass *class)
-{
- CompEditorPageClass *editor_page_class;
- GObjectClass *object_class;
-
- editor_page_class = (CompEditorPageClass *) class;
- object_class = (GObjectClass *) class;
-
- parent_class = g_type_class_ref (TYPE_COMP_EDITOR_PAGE);
-
- editor_page_class->get_widget = schedule_page_get_widget;
- editor_page_class->focus_main_widget = schedule_page_focus_main_widget;
- editor_page_class->fill_widgets = schedule_page_fill_widgets;
- editor_page_class->fill_component = schedule_page_fill_component;
- editor_page_class->set_summary = NULL;
- editor_page_class->set_dates = schedule_page_set_dates;
-
- object_class->finalize = schedule_page_finalize;
-}
-
-/* Object initialization function for the schedule page */
-static void
-schedule_page_init (SchedulePage *spage)
-{
- SchedulePagePrivate *priv;
-
- priv = g_new0 (SchedulePagePrivate, 1);
- spage->priv = priv;
-
- priv->xml = NULL;
-
- priv->main = NULL;
-
- priv->zone = NULL;
-
- priv->updating = FALSE;
-}
-
-/* Destroy handler for the schedule page */
-static void
-schedule_page_finalize (GObject *object)
-{
- SchedulePage *spage;
- SchedulePagePrivate *priv;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (IS_SCHEDULE_PAGE (object));
-
- spage = SCHEDULE_PAGE (object);
- priv = spage->priv;
-
- if (priv->main)
- gtk_widget_unref (priv->main);
-
- if (priv->xml) {
- g_object_unref (priv->xml);
- priv->xml = NULL;
- }
-
- g_object_unref(priv->model);
-
- g_free (priv);
- spage->priv = NULL;
-
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
-}
-
-
-
-/* get_widget handler for the schedule page */
-static GtkWidget *
-schedule_page_get_widget (CompEditorPage *page)
-{
- SchedulePage *spage;
- SchedulePagePrivate *priv;
-
- spage = SCHEDULE_PAGE (page);
- priv = spage->priv;
-
- return priv->main;
-}
-
-/* focus_main_widget handler for the schedule page */
-static void
-schedule_page_focus_main_widget (CompEditorPage *page)
-{
- SchedulePage *spage;
- SchedulePagePrivate *priv;
-
- spage = SCHEDULE_PAGE (page);
- priv = spage->priv;
-
- gtk_widget_grab_focus (GTK_WIDGET (priv->sel));
-}
-
-/* Set date/time */
-static void
-update_time (SchedulePage *spage, ECalComponentDateTime *start_date, ECalComponentDateTime *end_date)
-{
- SchedulePagePrivate *priv;
- struct icaltimetype start_tt, end_tt;
- icaltimezone *start_zone = NULL, *end_zone = NULL;
- gboolean all_day;
-
- priv = spage->priv;
-
- /* Note that if we are creating a new event, the timezones may not be
- on the server, so we try to get the builtin timezone with the TZID
- first. */
- start_zone = icaltimezone_get_builtin_timezone_from_tzid (start_date->tzid);
- if (!start_zone) {
- if (!e_cal_get_timezone (COMP_EDITOR_PAGE (spage)->client,
- start_date->tzid, &start_zone, NULL)) {
- /* FIXME: Handle error better. */
- g_warning ("Couldn't get timezone from server: %s",
- start_date->tzid ? start_date->tzid : "");
- }
- }
-
- end_zone = icaltimezone_get_builtin_timezone_from_tzid (end_date->tzid);
- if (!end_zone) {
- if (!e_cal_get_timezone (COMP_EDITOR_PAGE (spage)->client,
- end_date->tzid, &end_zone, NULL)) {
- /* FIXME: Handle error better. */
- g_warning ("Couldn't get timezone from server: %s",
- end_date->tzid ? end_date->tzid : "");
- }
- }
-
- start_tt = *start_date->value;
- if (!end_date->value && start_tt.is_date) {
- end_tt = start_tt;
- icaltime_adjust (&end_tt, 1, 0, 0, 0);
- } else {
- end_tt = *end_date->value;
- }
-
- /* If the end zone is not the same as the start zone, we convert it. */
- priv->zone = start_zone;
- if (start_zone != end_zone) {
- icaltimezone_convert_time (&end_tt, end_zone, start_zone);
- }
- e_meeting_store_set_zone (priv->model, priv->zone);
-
- all_day = (start_tt.is_date && end_tt.is_date) ? TRUE : FALSE;
-
- /* For All Day Events, if DTEND is after DTSTART, we subtract 1 day
- from it. */
- if (all_day) {
- if (icaltime_compare_date_only (end_tt, start_tt) > 0) {
- icaltime_adjust (&end_tt, -1, 0, 0, 0);
- }
- }
-
- e_meeting_time_selector_set_all_day (priv->sel, all_day);
-
- e_date_edit_set_date (E_DATE_EDIT (priv->sel->start_date_edit), start_tt.year,
- start_tt.month, start_tt.day);
- e_date_edit_set_time_of_day (E_DATE_EDIT (priv->sel->start_date_edit),
- start_tt.hour, start_tt.minute);
-
- e_date_edit_set_date (E_DATE_EDIT (priv->sel->end_date_edit), end_tt.year,
- end_tt.month, end_tt.day);
- e_date_edit_set_time_of_day (E_DATE_EDIT (priv->sel->end_date_edit),
- end_tt.hour, end_tt.minute);
-
-}
-
-
-/* Fills the widgets with default values */
-static void
-clear_widgets (SchedulePage *spage)
-{
- SchedulePagePrivate *priv;
-
- priv = spage->priv;
-}
-
-/* fill_widgets handler for the schedule page */
-static void
-schedule_page_fill_widgets (CompEditorPage *page, ECalComponent *comp)
-{
- SchedulePage *spage;
- SchedulePagePrivate *priv;
- ECalComponentDateTime start_date, end_date;
-
- spage = SCHEDULE_PAGE (page);
- priv = spage->priv;
-
- priv->updating = TRUE;
-
- /* Clean the screen */
- clear_widgets (spage);
-
- /* Start and end times */
- e_cal_component_get_dtstart (comp, &start_date);
- e_cal_component_get_dtend (comp, &end_date);
- update_time (spage, &start_date, &end_date);
-
- e_cal_component_free_datetime (&start_date);
- e_cal_component_free_datetime (&end_date);
-
- priv->updating = FALSE;
-}
-
-/* fill_component handler for the schedule page */
-static gboolean
-schedule_page_fill_component (CompEditorPage *page, ECalComponent *comp)
-{
- SchedulePage *spage;
- SchedulePagePrivate *priv;
-
- spage = SCHEDULE_PAGE (page);
- priv = spage->priv;
-
- return TRUE;
-}
-
-static void
-schedule_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates)
-{
- SchedulePage *spage;
- SchedulePagePrivate *priv;
-
- spage = SCHEDULE_PAGE (page);
- priv = spage->priv;
-
- priv->updating = TRUE;
-
- update_time (spage, dates->start, dates->end);
-
- priv->updating = FALSE;
-}
-
-
-
-/* Gets the widgets from the XML file and returns if they are all available. */
-static gboolean
-get_widgets (SchedulePage *spage)
-{
- CompEditorPage *page = COMP_EDITOR_PAGE (spage);
- SchedulePagePrivate *priv;
- GSList *accel_groups;
- GtkWidget *toplevel;
-
- priv = spage->priv;
-
-#define GW(name) glade_xml_get_widget (priv->xml, name)
-
- priv->main = GW ("schedule-page");
- if (!priv->main)
- return FALSE;
-
- /* Get the GtkAccelGroup from the toplevel window, so we can install
- it when the notebook page is mapped. */
- toplevel = gtk_widget_get_toplevel (priv->main);
- accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel));
- if (accel_groups) {
- page->accel_group = accel_groups->data;
- gtk_accel_group_ref (page->accel_group);
- }
-
- gtk_widget_ref (priv->main);
- gtk_container_remove (GTK_CONTAINER (priv->main->parent), priv->main);
-
-#undef GW
-
- return TRUE;
-}
-
-static gboolean
-init_widgets (SchedulePage *spage)
-{
- SchedulePagePrivate *priv;
-
- priv = spage->priv;
-
- g_signal_connect((priv->sel),
- "changed", G_CALLBACK (times_changed_cb), spage);
-
- return TRUE;
-
-}
-
-
-
-/**
- * schedule_page_construct:
- * @spage: An schedule page.
- *
- * Constructs an schedule page by loading its Glade data.
- *
- * Return value: The same object as @spage, or NULL if the widgets could not
- * be created.
- **/
-SchedulePage *
-schedule_page_construct (SchedulePage *spage, EMeetingStore *ems)
-{
- SchedulePagePrivate *priv;
-
- priv = spage->priv;
-
- priv->xml = glade_xml_new (EVOLUTION_GLADEDIR
- "/schedule-page.glade", NULL, NULL);
- if (!priv->xml) {
- g_message ("schedule_page_construct(): "
- "Could not load the Glade XML file!");
- return NULL;
- }
-
- if (!get_widgets (spage)) {
- g_message ("schedule_page_construct(): "
- "Could not find all widgets in the XML file!");
- return NULL;
- }
-
- /* Model */
- g_object_ref (ems);
- priv->model = ems;
-
- /* Selector */
- priv->sel = E_MEETING_TIME_SELECTOR (e_meeting_time_selector_new (ems));
- e_meeting_time_selector_set_working_hours (priv->sel,
- calendar_config_get_day_start_hour (),
- calendar_config_get_day_start_minute (),
- calendar_config_get_day_end_hour (),
- calendar_config_get_day_end_minute ());
- gtk_widget_show (GTK_WIDGET (priv->sel));
- gtk_box_pack_start (GTK_BOX (priv->main), GTK_WIDGET (priv->sel), TRUE, TRUE, 6);
-
- if (!init_widgets (spage)) {
- g_message ("schedule_page_construct(): "
- "Could not initialize the widgets!");
- return NULL;
- }
-
- return spage;
-}
-
-/**
- * schedule_page_new:
- *
- * Creates a new schedule page.
- *
- * Return value: A newly-created schedule page, or NULL if the page could
- * not be created.
- **/
-SchedulePage *
-schedule_page_new (EMeetingStore *ems)
-{
- SchedulePage *spage;
-
- spage = g_object_new (TYPE_SCHEDULE_PAGE, NULL);
- if (!schedule_page_construct (spage, ems)) {
- g_object_unref (spage);
- return NULL;
- }
-
- return spage;
-}
-
-static void
-times_changed_cb (GtkWidget *widget, gpointer data)
-{
- SchedulePage *spage = data;
- SchedulePagePrivate *priv;
- CompEditorPageDates dates;
- ECalComponentDateTime start_dt, end_dt;
- struct icaltimetype start_tt = icaltime_null_time ();
- struct icaltimetype end_tt = icaltime_null_time ();
-
- priv = spage->priv;
-
- if (priv->updating)
- return;
-
- e_date_edit_get_date (E_DATE_EDIT (priv->sel->start_date_edit),
- &start_tt.year,
- &start_tt.month,
- &start_tt.day);
- e_date_edit_get_time_of_day (E_DATE_EDIT (priv->sel->start_date_edit),
- &start_tt.hour,
- &start_tt.minute);
- e_date_edit_get_date (E_DATE_EDIT (priv->sel->end_date_edit),
- &end_tt.year,
- &end_tt.month,
- &end_tt.day);
- e_date_edit_get_time_of_day (E_DATE_EDIT (priv->sel->end_date_edit),
- &end_tt.hour,
- &end_tt.minute);
-
- start_dt.value = &start_tt;
- end_dt.value = &end_tt;
-
- if (e_date_edit_get_show_time (E_DATE_EDIT (priv->sel->start_date_edit))) {
- /* We set the start and end to the same timezone. */
- start_dt.tzid = icaltimezone_get_tzid (priv->zone);
- end_dt.tzid = start_dt.tzid;
- } else {
- /* For All-Day Events, we set the timezone to NULL, and add
- 1 day to DTEND. */
- start_dt.value->is_date = TRUE;
- start_dt.tzid = NULL;
- end_dt.value->is_date = TRUE;
- icaltime_adjust (&end_tt, 1, 0, 0, 0);
- end_dt.tzid = NULL;
- }
-
- dates.start = &start_dt;
- dates.end = &end_dt;
- dates.due = NULL;
- dates.complete = NULL;
-
- comp_editor_page_notify_dates_changed (COMP_EDITOR_PAGE (spage),
- &dates);
-}
diff --git a/calendar/gui/dialogs/schedule-page.glade b/calendar/gui/dialogs/schedule-page.glade
deleted file mode 100644
index 2ef8a1d9f5..0000000000
--- a/calendar/gui/dialogs/schedule-page.glade
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-
-<widget class="GtkWindow" id="schedule-toplevel">
- <property name="title" translatable="yes">window1</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
-
- <child>
- <widget class="GtkVBox" id="schedule-page">
- <property name="border_width">12</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
- </widget>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/calendar/gui/dialogs/schedule-page.h b/calendar/gui/dialogs/schedule-page.h
deleted file mode 100644
index d4c7eafbdd..0000000000
--- a/calendar/gui/dialogs/schedule-page.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Evolution calendar - Scheduling page
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Authors: JP Rosevear <jpr@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef SCHEDULE_PAGE_H
-#define SCHEDULE_PAGE_H
-
-#include "../e-meeting-store.h"
-#include "comp-editor-page.h"
-
-G_BEGIN_DECLS
-
-
-
-#define TYPE_SCHEDULE_PAGE (schedule_page_get_type ())
-#define SCHEDULE_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SCHEDULE_PAGE, SchedulePage))
-#define SCHEDULE_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SCHEDULE_PAGE, SchedulePageClass))
-#define IS_SCHEDULE_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SCHEDULE_PAGE))
-#define IS_SCHEDULE_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), TYPE_SCHEDULE_PAGE))
-
-typedef struct _SchedulePagePrivate SchedulePagePrivate;
-
-typedef struct {
- CompEditorPage page;
-
- /* Private data */
- SchedulePagePrivate *priv;
-} SchedulePage;
-
-typedef struct {
- CompEditorPageClass parent_class;
-} SchedulePageClass;
-
-
-GtkType schedule_page_get_type (void);
-SchedulePage *schedule_page_construct (SchedulePage *mpage, EMeetingStore *ems);
-SchedulePage *schedule_page_new (EMeetingStore *ems);
-
-
-
-G_END_DECLS
-
-#endif
diff --git a/calendar/gui/dialogs/send-comp.c b/calendar/gui/dialogs/send-comp.c
deleted file mode 100644
index 65e4743c04..0000000000
--- a/calendar/gui/dialogs/send-comp.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/* Evolution calendar - Send calendar component dialog
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Author: JP Rosevear <jpr@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <glib.h>
-#include <gtk/gtkmessagedialog.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnomeui/gnome-uidefs.h>
-#include "send-comp.h"
-
-
-
-/**
- * send_component_dialog:
- *
- * Pops up a dialog box asking the user whether he wants to send a
- * iTip/iMip message
- *
- * Return value: TRUE if the user clicked Yes, FALSE otherwise.
- **/
-gboolean
-send_component_dialog (GtkWindow *parent, ECal *client, ECalComponent *comp, gboolean new)
-{
- GtkWidget *dialog;
- ECalComponentVType vtype;
- char *str;
- gint response;
-
- if (e_cal_get_save_schedules (client))
- return FALSE;
-
- vtype = e_cal_component_get_vtype (comp);
-
- switch (vtype) {
- case E_CAL_COMPONENT_EVENT:
- if (new)
- str = g_strdup_printf (_("The meeting information has "
- "been created. Send it?"));
- else
- str = g_strdup_printf (_("The meeting information has "
- "changed. Send an updated "
- "version?"));
- break;
-
- case E_CAL_COMPONENT_TODO:
- if (new)
- str = g_strdup_printf (_("The task assignment "
- "information has been "
- "created. Send it?"));
- else
- str = g_strdup_printf (_("The task information has "
- "changed. Send an updated "
- "version?"));
- break;
-
- default:
- g_message ("send_component_dialog(): "
- "Cannot handle object of type %d", vtype);
- return FALSE;
- }
-
- dialog = gtk_message_dialog_new (parent, GTK_DIALOG_MODAL,
- GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_YES_NO, str);
-
- response = gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
-
- if (response == GTK_RESPONSE_YES)
- return TRUE;
- else
- return FALSE;
-}
diff --git a/calendar/gui/dialogs/send-comp.h b/calendar/gui/dialogs/send-comp.h
deleted file mode 100644
index 86be94ccdb..0000000000
--- a/calendar/gui/dialogs/send-comp.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Evolution calendar - Send calendar component dialog
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Author: JP Rosevear <jpr@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef SEND_COMP_H
-#define SEND_COMP_H
-
-#include <glib.h>
-#include <gtk/gtkwindow.h>
-#include <libecal/e-cal.h>
-#include <libecal/e-cal-component.h>
-
-gboolean send_component_dialog (GtkWindow *parent, ECal *client, ECalComponent *comp, gboolean new);
-
-#endif
diff --git a/calendar/gui/dialogs/task-details-page.c b/calendar/gui/dialogs/task-details-page.c
deleted file mode 100644
index 5d75c9b39a..0000000000
--- a/calendar/gui/dialogs/task-details-page.c
+++ /dev/null
@@ -1,781 +0,0 @@
-/* Evolution calendar - task details page
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Authors: Federico Mena-Quintero <federico@ximian.com>
- * Miguel de Icaza <miguel@ximian.com>
- * Seth Alves <alves@hungry.com>
- * JP Rosevear <jpr@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <gtk/gtksignal.h>
-#include <gtk/gtktogglebutton.h>
-#include <libgnome/gnome-i18n.h>
-#include <glade/glade.h>
-#include <widgets/misc/e-dateedit.h>
-#include <widgets/misc/e-url-entry.h>
-#include "e-util/e-dialog-widgets.h"
-#include "../calendar-config.h"
-#include "../e-timezone-entry.h"
-#include "comp-editor-util.h"
-#include "task-details-page.h"
-
-
-
-/* Private part of the TaskDetailsPage structure */
-struct _TaskDetailsPagePrivate {
- /* Glade XML data */
- GladeXML *xml;
-
- /* Widgets from the Glade file */
- GtkWidget *main;
-
- GtkWidget *status;
- GtkWidget *priority;
- GtkWidget *percent_complete;
-
- GtkWidget *date_completed_label;
- GtkWidget *completed_date;
-
- GtkWidget *url_label;
- GtkWidget *url_entry;
- GtkWidget *url;
-
- gboolean updating;
-};
-
-/* Note that these two arrays must match. */
-static const int status_map[] = {
- ICAL_STATUS_NONE,
- ICAL_STATUS_INPROCESS,
- ICAL_STATUS_COMPLETED,
- ICAL_STATUS_CANCELLED,
- -1
-};
-
-typedef enum {
- PRIORITY_HIGH,
- PRIORITY_NORMAL,
- PRIORITY_LOW,
- PRIORITY_UNDEFINED,
-} TaskEditorPriority;
-
-static const int priority_map[] = {
- PRIORITY_HIGH,
- PRIORITY_NORMAL,
- PRIORITY_LOW,
- PRIORITY_UNDEFINED,
- -1
-};
-
-
-
-static void task_details_page_class_init (TaskDetailsPageClass *class);
-static void task_details_page_init (TaskDetailsPage *tdpage);
-static void task_details_page_finalize (GObject *object);
-
-static GtkWidget *task_details_page_get_widget (CompEditorPage *page);
-static void task_details_page_focus_main_widget (CompEditorPage *page);
-static void task_details_page_fill_widgets (CompEditorPage *page, ECalComponent *comp);
-static gboolean task_details_page_fill_component (CompEditorPage *page, ECalComponent *comp);
-
-static CompEditorPageClass *parent_class = NULL;
-
-
-
-/**
- * task_details_page_get_type:
- *
- * Registers the #TaskDetailsPage class if necessary, and returns the type ID
- * associated to it.
- *
- * Return value: The type ID of the #TaskDetailsPage class.
- **/
-
-E_MAKE_TYPE (task_details_page, "TaskDetailsPage", TaskDetailsPage, task_details_page_class_init,
- task_details_page_init, TYPE_COMP_EDITOR_PAGE);
-
-/* Class initialization function for the task page */
-static void
-task_details_page_class_init (TaskDetailsPageClass *class)
-{
- CompEditorPageClass *editor_page_class;
- GObjectClass *object_class;
-
- editor_page_class = (CompEditorPageClass *) class;
- object_class = (GObjectClass *) class;
-
- parent_class = g_type_class_ref(TYPE_COMP_EDITOR_PAGE);
-
- editor_page_class->get_widget = task_details_page_get_widget;
- editor_page_class->focus_main_widget = task_details_page_focus_main_widget;
- editor_page_class->fill_widgets = task_details_page_fill_widgets;
- editor_page_class->fill_component = task_details_page_fill_component;
-
- object_class->finalize = task_details_page_finalize;
-}
-
-/* Object initialization function for the task page */
-static void
-task_details_page_init (TaskDetailsPage *tdpage)
-{
- TaskDetailsPagePrivate *priv;
-
- priv = g_new0 (TaskDetailsPagePrivate, 1);
- tdpage->priv = priv;
-
- priv->xml = NULL;
-
- priv->main = NULL;
-
- priv->status = NULL;
- priv->priority = NULL;
- priv->percent_complete = NULL;
-
- priv->date_completed_label = NULL;
- priv->completed_date = NULL;
-
- priv->url_label = NULL;
- priv->url_entry = NULL;
- priv->url = NULL;
-
- priv->updating = FALSE;
-}
-
-/* Destroy handler for the task page */
-static void
-task_details_page_finalize (GObject *object)
-{
- TaskDetailsPage *tdpage;
- TaskDetailsPagePrivate *priv;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (IS_TASK_DETAILS_PAGE (object));
-
- tdpage = TASK_DETAILS_PAGE (object);
- priv = tdpage->priv;
-
- if (priv->main)
- gtk_widget_unref (priv->main);
-
- if (priv->xml) {
- g_object_unref (priv->xml);
- priv->xml = NULL;
- }
-
- g_free (priv);
- tdpage->priv = NULL;
-
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
-}
-
-
-
-/* get_widget handler for the task page */
-static GtkWidget *
-task_details_page_get_widget (CompEditorPage *page)
-{
- TaskDetailsPage *tdpage;
- TaskDetailsPagePrivate *priv;
-
- tdpage = TASK_DETAILS_PAGE (page);
- priv = tdpage->priv;
-
- return priv->main;
-}
-
-/* focus_main_widget handler for the task page */
-static void
-task_details_page_focus_main_widget (CompEditorPage *page)
-{
- TaskDetailsPage *tdpage;
- TaskDetailsPagePrivate *priv;
-
- tdpage = TASK_DETAILS_PAGE (page);
- priv = tdpage->priv;
-
- gtk_widget_grab_focus (priv->status);
-}
-
-
-static TaskEditorPriority
-priority_value_to_index (int priority_value)
-{
- TaskEditorPriority retval;
-
- if (priority_value == 0)
- retval = PRIORITY_UNDEFINED;
- else if (priority_value <= 4)
- retval = PRIORITY_HIGH;
- else if (priority_value == 5)
- retval = PRIORITY_NORMAL;
- else
- retval = PRIORITY_LOW;
-
- return retval;
-}
-
-static int
-priority_index_to_value (TaskEditorPriority priority)
-{
- int retval;
-
- switch (priority) {
- case PRIORITY_UNDEFINED:
- retval = 0;
- break;
- case PRIORITY_HIGH:
- retval = 3;
- break;
- case PRIORITY_NORMAL:
- retval = 5;
- break;
- case PRIORITY_LOW:
- retval = 7;
- break;
- default:
- retval = -1;
- g_assert_not_reached ();
- break;
- }
-
- return retval;
-}
-
-/* Fills the widgets with default values */
-static void
-clear_widgets (TaskDetailsPage *tdpage)
-{
- TaskDetailsPagePrivate *priv;
-
- priv = tdpage->priv;
-
- /* Date completed */
- e_date_edit_set_time (E_DATE_EDIT (priv->completed_date), -1);
-
- /* URL */
- e_dialog_editable_set (priv->url, NULL);
-}
-
-/* fill_widgets handler for the task page */
-static void
-task_details_page_fill_widgets (CompEditorPage *page, ECalComponent *comp)
-{
- TaskDetailsPage *tdpage;
- TaskDetailsPagePrivate *priv;
- int *priority_value, *percent = NULL;
- TaskEditorPriority priority;
- icalproperty_status status;
- const char *url;
- struct icaltimetype *completed = NULL;
-
- tdpage = TASK_DETAILS_PAGE (page);
- priv = tdpage->priv;
-
- priv->updating = TRUE;
-
- /* Clean the screen */
- clear_widgets (tdpage);
-
- /* Percent Complete. */
- e_cal_component_get_percent (comp, &percent);
- if (percent) {
- e_dialog_spin_set (priv->percent_complete, *percent);
- } else {
- /* FIXME: Could check if task is completed and set 100%. */
- e_dialog_spin_set (priv->percent_complete, 0);
- }
-
- /* Status. */
- e_cal_component_get_status (comp, &status);
- if (status == ICAL_STATUS_NONE || status == ICAL_STATUS_NEEDSACTION) {
- /* Try to use the percent value. */
- if (percent) {
- if (*percent == 100)
- status = ICAL_STATUS_COMPLETED;
- else if (*percent > 0)
- status = ICAL_STATUS_INPROCESS;
- else
- status = ICAL_STATUS_NONE;
- } else
- status = ICAL_STATUS_NONE;
- }
- e_dialog_option_menu_set (priv->status, status, status_map);
-
- if (percent)
- e_cal_component_free_percent (percent);
-
- /* Completed Date. */
- e_cal_component_get_completed (comp, &completed);
- if (completed) {
- icaltimezone *utc_zone, *zone;
- char *location;
-
- /* Completed is in UTC, but that would confuse the user, so
- we convert it to local time. */
- utc_zone = icaltimezone_get_utc_timezone ();
- location = calendar_config_get_timezone ();
- zone = icaltimezone_get_builtin_timezone (location);
-
- icaltimezone_convert_time (completed, utc_zone, zone);
-
- e_date_edit_set_date (E_DATE_EDIT (priv->completed_date),
- completed->year, completed->month,
- completed->day);
- e_date_edit_set_time_of_day (E_DATE_EDIT (priv->completed_date),
- completed->hour,
- completed->minute);
-
- e_cal_component_free_icaltimetype (completed);
- }
-
- /* Priority. */
- e_cal_component_get_priority (comp, &priority_value);
- if (priority_value) {
- priority = priority_value_to_index (*priority_value);
- e_cal_component_free_priority (priority_value);
- } else {
- priority = PRIORITY_UNDEFINED;
- }
- e_dialog_option_menu_set (priv->priority, priority, priority_map);
-
- /* URL */
- e_cal_component_get_url (comp, &url);
- e_dialog_editable_set (priv->url, url);
-
- priv->updating = FALSE;
-}
-
-/* fill_component handler for the task page */
-static gboolean
-task_details_page_fill_component (CompEditorPage *page, ECalComponent *comp)
-{
- TaskDetailsPage *tdpage;
- TaskDetailsPagePrivate *priv;
- struct icaltimetype icaltime;
- icalproperty_status status;
- TaskEditorPriority priority;
- int priority_value, percent;
- char *url;
- gboolean date_set;
-
- tdpage = TASK_DETAILS_PAGE (page);
- priv = tdpage->priv;
-
- /* Percent Complete. */
- percent = e_dialog_spin_get_int (priv->percent_complete);
- e_cal_component_set_percent (comp, &percent);
-
- /* Status. */
- status = e_dialog_option_menu_get (priv->status, status_map);
- e_cal_component_set_status (comp, status);
-
- /* Priority. */
- priority = e_dialog_option_menu_get (priv->priority, priority_map);
- priority_value = priority_index_to_value (priority);
- e_cal_component_set_priority (comp, &priority_value);
-
- icaltime = icaltime_null_time ();
-
- /* COMPLETED must be in UTC. */
- icaltime.is_utc = 1;
-
- /* Completed Date. */
- if (!e_date_edit_date_is_valid (E_DATE_EDIT (priv->completed_date)) ||
- !e_date_edit_time_is_valid (E_DATE_EDIT (priv->completed_date))) {
- comp_editor_page_display_validation_error (page, _("Completed date is wrong"), priv->completed_date);
- return FALSE;
- }
-
- date_set = e_date_edit_get_date (E_DATE_EDIT (priv->completed_date),
- &icaltime.year,
- &icaltime.month,
- &icaltime.day);
- e_date_edit_get_time_of_day (E_DATE_EDIT (priv->completed_date),
- &icaltime.hour,
- &icaltime.minute);
- if (date_set) {
- /* COMPLETED must be in UTC, so we assume that the date in the
- dialog is in the current timezone, and we now convert it
- to UTC. FIXME: We should really use one timezone for the
- entire time the dialog is shown. Otherwise if the user
- changes the timezone, the COMPLETED date may get changed
- as well. */
- char *location = calendar_config_get_timezone ();
- icaltimezone *zone = icaltimezone_get_builtin_timezone (location);
- icaltimezone_convert_time (&icaltime, zone,
- icaltimezone_get_utc_timezone ());
- e_cal_component_set_completed (comp, &icaltime);
- } else {
- e_cal_component_set_completed (comp, NULL);
- }
-
- /* URL. */
- url = e_dialog_editable_get (priv->url);
- e_cal_component_set_url (comp, url);
- if (url)
- g_free (url);
-
- return TRUE;
-}
-
-
-
-/* Gets the widgets from the XML file and returns if they are all available. */
-static gboolean
-get_widgets (TaskDetailsPage *tdpage)
-{
- CompEditorPage *page = COMP_EDITOR_PAGE (tdpage);
- TaskDetailsPagePrivate *priv;
- GSList *accel_groups;
- GtkWidget *toplevel;
-
- priv = tdpage->priv;
-
-#define GW(name) glade_xml_get_widget (priv->xml, name)
-
- priv->main = GW ("task-details-page");
- if (!priv->main)
- return FALSE;
-
- /* Get the GtkAccelGroup from the toplevel window, so we can install
- it when the notebook page is mapped. */
- toplevel = gtk_widget_get_toplevel (priv->main);
- accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel));
- if (accel_groups) {
- page->accel_group = accel_groups->data;
- gtk_accel_group_ref (page->accel_group);
- }
-
- gtk_widget_ref (priv->main);
- gtk_container_remove (GTK_CONTAINER (priv->main->parent), priv->main);
-
- priv->status = GW ("status");
- priv->priority = GW ("priority");
- priv->percent_complete = GW ("percent-complete");
-
- priv->date_completed_label = GW ("date_completed_label");
-
- priv->completed_date = GW ("completed-date");
- gtk_widget_show (priv->completed_date);
-
- priv->url_label = GW ("url_label");
-
- priv->url_entry = GW ("url_entry");
- gtk_widget_show (priv->url_entry);
- priv->url = e_url_entry_get_entry (E_URL_ENTRY (priv->url_entry));
-
-#undef GW
-
- return (priv->status
- && priv->priority
- && priv->percent_complete
- && priv->date_completed_label
- && priv->completed_date
- && priv->url_label
- && priv->url);
-}
-
-
-static void
-complete_date_changed (TaskDetailsPage *tdpage, time_t ctime, gboolean complete)
-{
- TaskDetailsPagePrivate *priv;
- CompEditorPageDates dates = {NULL, NULL, NULL, NULL};
- icaltimezone *zone;
- struct icaltimetype completed_tt = icaltime_null_time();
-
- priv = tdpage->priv;
-
- /* Get the current time in UTC. */
- zone = icaltimezone_get_utc_timezone ();
- completed_tt = icaltime_from_timet_with_zone (ctime, FALSE, zone);
- completed_tt.is_utc = TRUE;
-
- dates.start = NULL;
- dates.end = NULL;
- dates.due = NULL;
- if (complete)
- dates.complete = &completed_tt;
-
- /* Notify upstream */
- comp_editor_page_notify_dates_changed (COMP_EDITOR_PAGE (tdpage),
- &dates);
-}
-
-static void
-date_changed_cb (EDateEdit *dedit, gpointer data)
-{
- TaskDetailsPage *tdpage;
- TaskDetailsPagePrivate *priv;
- CompEditorPageDates dates = {NULL, NULL, NULL, NULL};
- struct icaltimetype completed_tt = icaltime_null_time ();
- icalproperty_status status;
- gboolean date_set;
-
- tdpage = TASK_DETAILS_PAGE (data);
- priv = tdpage->priv;
-
- if (priv->updating)
- return;
-
- priv->updating = TRUE;
-
- date_set = e_date_edit_get_date (E_DATE_EDIT (priv->completed_date),
- &completed_tt.year,
- &completed_tt.month,
- &completed_tt.day);
- e_date_edit_get_time_of_day (E_DATE_EDIT (priv->completed_date),
- &completed_tt.hour,
- &completed_tt.minute);
-
- status = e_dialog_option_menu_get (priv->status, status_map);
-
- if (!date_set) {
- completed_tt = icaltime_null_time ();
- if (status == ICAL_STATUS_COMPLETED) {
- e_dialog_option_menu_set (priv->status,
- ICAL_STATUS_NONE,
- status_map);
- e_dialog_spin_set (priv->percent_complete, 0);
- }
- } else {
- if (status != ICAL_STATUS_COMPLETED) {
- e_dialog_option_menu_set (priv->status,
- ICAL_STATUS_COMPLETED,
- status_map);
- }
- e_dialog_spin_set (priv->percent_complete, 100);
- }
-
- priv->updating = FALSE;
-
- /* Notify upstream */
- dates.complete = &completed_tt;
- comp_editor_page_notify_dates_changed (COMP_EDITOR_PAGE (tdpage), &dates);
-}
-
-static void
-status_changed (GtkMenu *menu, TaskDetailsPage *tdpage)
-{
- TaskDetailsPagePrivate *priv;
- icalproperty_status status;
- time_t ctime = -1;
-
- priv = tdpage->priv;
-
- if (priv->updating)
- return;
-
- priv->updating = TRUE;
-
- status = e_dialog_option_menu_get (priv->status, status_map);
- if (status == ICAL_STATUS_NONE) {
- e_dialog_spin_set (priv->percent_complete, 0);
- e_date_edit_set_time (E_DATE_EDIT (priv->completed_date), ctime);
- complete_date_changed (tdpage, 0, FALSE);
- } else if (status == ICAL_STATUS_INPROCESS) {
- gint percent_complete = e_dialog_spin_get_int (priv->percent_complete);
- if (percent_complete <= 0 || percent_complete >= 100)
- e_dialog_spin_set (priv->percent_complete, 50);
-
- e_date_edit_set_time (E_DATE_EDIT (priv->completed_date), ctime);
- complete_date_changed (tdpage, 0, FALSE);
- } else if (status == ICAL_STATUS_COMPLETED) {
- e_dialog_spin_set (priv->percent_complete, 100);
- ctime = time (NULL);
- e_date_edit_set_time (E_DATE_EDIT (priv->completed_date), ctime);
- complete_date_changed (tdpage, ctime, TRUE);
- }
-
- priv->updating = FALSE;
-
- comp_editor_page_notify_changed (COMP_EDITOR_PAGE (tdpage));
-}
-
-static void
-percent_complete_changed (GtkAdjustment *adj, TaskDetailsPage *tdpage)
-{
- TaskDetailsPagePrivate *priv;
- gint percent;
- icalproperty_status status;
- gboolean complete;
- time_t ctime = -1;
-
- priv = tdpage->priv;
-
- if (priv->updating)
- return;
-
- priv->updating = TRUE;
-
- percent = e_dialog_spin_get_int (priv->percent_complete);
- if (percent == 100) {
- complete = TRUE;
- ctime = time (NULL);
- status = ICAL_STATUS_COMPLETED;
- } else {
- complete = FALSE;
-
- if (percent == 0)
- status = ICAL_STATUS_NONE;
- else
- status = ICAL_STATUS_INPROCESS;
- }
-
- e_dialog_option_menu_set (priv->status, status, status_map);
- e_date_edit_set_time (E_DATE_EDIT (priv->completed_date), ctime);
- complete_date_changed (tdpage, ctime, complete);
-
- priv->updating = FALSE;
-
- comp_editor_page_notify_changed (COMP_EDITOR_PAGE (tdpage));
-}
-
-/* This is called when any field is changed; it notifies upstream. */
-static void
-field_changed_cb (GtkWidget *widget, gpointer data)
-{
- TaskDetailsPage *tdpage;
- TaskDetailsPagePrivate *priv;
-
- tdpage = TASK_DETAILS_PAGE (data);
- priv = tdpage->priv;
-
- if (!priv->updating)
- comp_editor_page_notify_changed (COMP_EDITOR_PAGE (tdpage));
-}
-
-/* Hooks the widget signals */
-static void
-init_widgets (TaskDetailsPage *tdpage)
-{
- TaskDetailsPagePrivate *priv;
-
- priv = tdpage->priv;
-
- /* Make sure the EDateEdit widgets use our timezones to get the
- current time. */
- e_date_edit_set_get_time_callback (E_DATE_EDIT (priv->completed_date),
- (EDateEditGetTimeCallback) comp_editor_get_current_time,
- tdpage, NULL);
-
- /* These are created by hand, so hook the mnemonics manually */
- gtk_label_set_mnemonic_widget (GTK_LABEL (priv->date_completed_label), priv->completed_date);
- gtk_label_set_mnemonic_widget (GTK_LABEL (priv->url_label), priv->url_entry);
-
- /* Connect signals. The Status, Percent Complete & Date Completed
- properties are closely related so whenever one changes we may need
- to update the other 2. */
- g_signal_connect((GTK_OPTION_MENU (priv->status)->menu),
- "deactivate",
- G_CALLBACK (status_changed), tdpage);
-
- g_signal_connect((GTK_SPIN_BUTTON (priv->percent_complete)->adjustment),
- "value_changed",
- G_CALLBACK (percent_complete_changed), tdpage);
-
- /* Priority */
- g_signal_connect((GTK_OPTION_MENU (priv->priority)->menu),
- "deactivate",
- G_CALLBACK (field_changed_cb), tdpage);
-
- /* Completed Date */
- g_signal_connect((priv->completed_date), "changed",
- G_CALLBACK (date_changed_cb), tdpage);
-
- /* URL */
- g_signal_connect((priv->url), "changed",
- G_CALLBACK (field_changed_cb), tdpage);
-}
-
-
-
-/**
- * task_details_page_construct:
- * @tdpage: An task details page.
- *
- * Constructs an task page by loading its Glade data.
- *
- * Return value: The same object as @tdpage, or NULL if the widgets could not
- * be created.
- **/
-TaskDetailsPage *
-task_details_page_construct (TaskDetailsPage *tdpage)
-{
- TaskDetailsPagePrivate *priv;
-
- priv = tdpage->priv;
-
- priv->xml = glade_xml_new (EVOLUTION_GLADEDIR
- "/task-details-page.glade", NULL, NULL);
- if (!priv->xml) {
- g_message ("task_details_page_construct(): "
- "Could not load the Glade XML file!");
- return NULL;
- }
-
- if (!get_widgets (tdpage)) {
- g_message ("task_details_page_construct(): "
- "Could not find all widgets in the XML file!");
- return NULL;
- }
-
- init_widgets (tdpage);
-
- return tdpage;
-}
-
-/**
- * task_details_page_new:
- *
- * Creates a new task details page.
- *
- * Return value: A newly-created task details page, or NULL if the page could
- * not be created.
- **/
-TaskDetailsPage *
-task_details_page_new (void)
-{
- TaskDetailsPage *tdpage;
-
- tdpage = g_object_new (TYPE_TASK_DETAILS_PAGE, NULL);
- if (!task_details_page_construct (tdpage)) {
- g_object_unref (tdpage);
- return NULL;
- }
-
- return tdpage;
-}
-
-GtkWidget *task_details_page_create_date_edit (void);
-
-GtkWidget *
-task_details_page_create_date_edit (void)
-{
- GtkWidget *dedit;
-
- dedit = comp_editor_new_date_edit (TRUE, TRUE, FALSE);
- e_date_edit_set_allow_no_date_set (E_DATE_EDIT (dedit), TRUE);
-
- return dedit;
-}
-
diff --git a/calendar/gui/dialogs/task-details-page.glade b/calendar/gui/dialogs/task-details-page.glade
deleted file mode 100644
index 23c34c116c..0000000000
--- a/calendar/gui/dialogs/task-details-page.glade
+++ /dev/null
@@ -1,384 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-
-<widget class="GtkWindow" id="task-details-toplevel">
- <property name="title" translatable="yes">window1</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
-
- <child>
- <widget class="GtkVBox" id="task-details-page">
- <property name="border_width">12</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkFrame" id="frame2">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkVBox" id="vbox1">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkHBox" id="hbox1">
- <property name="border_width">4</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label17">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Status:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">status</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkOptionMenu" id="status">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget1">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget2">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Not Started</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget3">
- <property name="visible">True</property>
- <property name="label" translatable="yes">In Progress</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget5">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Completed</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget6">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Cancelled</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label18">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Priority:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">priority</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkOptionMenu" id="priority">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget7">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget8">
- <property name="visible">True</property>
- <property name="label" translatable="yes">High</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget9">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Normal</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget10">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Low</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget11">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Undefined</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label19">
- <property name="visible">True</property>
- <property name="label" translatable="yes">% _Complete</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">percent-complete</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkSpinButton" id="percent-complete">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">True</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">1 0 100 1 10 10</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="table1">
- <property name="border_width">4</property>
- <property name="visible">True</property>
- <property name="n_rows">1</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">2</property>
- <property name="column_spacing">4</property>
-
- <child>
- <widget class="GtkLabel" id="date_completed_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Date Completed:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="completed-date">
- <property name="visible">True</property>
- <property name="creation_function">task_details_page_create_date_edit</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Fri, 01 Jun 2001 18:58:51 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Progress</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="table2">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="n_rows">1</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="url_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Web Page:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="url_entry">
- <property name="visible">True</property>
- <property name="creation_function">e_url_entry_new</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Fri, 08 Feb 2002 21:02:37 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/calendar/gui/dialogs/task-details-page.h b/calendar/gui/dialogs/task-details-page.h
deleted file mode 100644
index 98b6832bbf..0000000000
--- a/calendar/gui/dialogs/task-details-page.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* Evolution calendar - Main page of the task editor dialog
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Authors: Federico Mena-Quintero <federico@ximian.com>
- * Miguel de Icaza <miguel@ximian.com>
- * Seth Alves <alves@hungry.com>
- * JP Rosevear <jpr@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef TASK_DETAILS_PAGE_H
-#define TASK_DETAILS_PAGE_H
-
-#include "comp-editor-page.h"
-
-G_BEGIN_DECLS
-
-
-
-#define TYPE_TASK_DETAILS_PAGE (task_details_page_get_type ())
-#define TASK_DETAILS_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TASK_DETAILS_PAGE, TaskDetailsPage))
-#define TASK_DETAILS_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TASK_DETAILS_PAGE, TaskDetailsPageClass))
-#define IS_TASK_DETAILS_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TASK_DETAILS_PAGE))
-#define IS_TASK_DETAILS_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), TYPE_TASK_DETAILS_PAGE))
-
-typedef struct _TaskDetailsPagePrivate TaskDetailsPagePrivate;
-
-typedef struct {
- CompEditorPage page;
-
- /* Private data */
- TaskDetailsPagePrivate *priv;
-} TaskDetailsPage;
-
-typedef struct {
- CompEditorPageClass parent_class;
-} TaskDetailsPageClass;
-
-
-GtkType task_details_page_get_type (void);
-TaskDetailsPage *task_details_page_construct (TaskDetailsPage *tdpage);
-TaskDetailsPage *task_details_page_new (void);
-
-
-
-G_END_DECLS
-
-#endif
diff --git a/calendar/gui/dialogs/task-editor.c b/calendar/gui/dialogs/task-editor.c
deleted file mode 100644
index 166dc538ba..0000000000
--- a/calendar/gui/dialogs/task-editor.c
+++ /dev/null
@@ -1,486 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* Evolution calendar - Task editor dialog
- *
- * Copyright (C) 2000 Ximian, Inc.
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Authors: Miguel de Icaza <miguel@ximian.com>
- * Federico Mena-Quintero <federico@ximian.com>
- * Seth Alves <alves@hungry.com>
- * JP Rosevear <jpr@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-#include <string.h>
-#include <glade/glade.h>
-#include <gal/util/e-util.h>
-#include <libgnome/gnome-i18n.h>
-
-#include "task-page.h"
-#include "task-details-page.h"
-#include "meeting-page.h"
-#include "cancel-comp.h"
-#include "task-editor.h"
-
-struct _TaskEditorPrivate {
- TaskPage *task_page;
- TaskDetailsPage *task_details_page;
- MeetingPage *meet_page;
-
- EMeetingStore *model;
-
- gboolean assignment_shown;
- gboolean updating;
-};
-
-
-
-static void task_editor_class_init (TaskEditorClass *class);
-static void task_editor_init (TaskEditor *te);
-static void task_editor_set_e_cal (CompEditor *editor, ECal *client);
-static void task_editor_edit_comp (CompEditor *editor, ECalComponent *comp);
-static gboolean task_editor_send_comp (CompEditor *editor, ECalComponentItipMethod method);
-static void task_editor_finalize (GObject *object);
-
-static void assign_task_cmd (GtkWidget *widget, gpointer data);
-static void refresh_task_cmd (GtkWidget *widget, gpointer data);
-static void cancel_task_cmd (GtkWidget *widget, gpointer data);
-static void forward_cmd (GtkWidget *widget, gpointer data);
-
-static void model_row_change_insert_cb (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data);
-static void model_row_delete_cb (GtkTreeModel *model, GtkTreePath *path, gpointer data);
-
-static BonoboUIVerb verbs [] = {
- BONOBO_UI_UNSAFE_VERB ("ActionAssignTask", assign_task_cmd),
- BONOBO_UI_UNSAFE_VERB ("ActionRefreshTask", refresh_task_cmd),
- BONOBO_UI_UNSAFE_VERB ("ActionCancelTask", cancel_task_cmd),
- BONOBO_UI_UNSAFE_VERB ("ActionForward", forward_cmd),
-
- BONOBO_UI_VERB_END
-};
-
-static CompEditorClass *parent_class;
-
-
-
-/**
- * task_editor_get_type:
- *
- * Registers the #TaskEditor class if necessary, and returns the type ID
- * associated to it.
- *
- * Return value: The type ID of the #TaskEditor class.
- **/
-
-E_MAKE_TYPE (task_editor, "TaskEditor", TaskEditor, task_editor_class_init, task_editor_init,
- TYPE_COMP_EDITOR);
-
-/* Class initialization function for the event editor */
-static void
-task_editor_class_init (TaskEditorClass *klass)
-{
- GObjectClass *object_class;
- CompEditorClass *editor_class;
-
- object_class = (GObjectClass *) klass;
- editor_class = (CompEditorClass *) klass;
-
- parent_class = g_type_class_ref(TYPE_COMP_EDITOR);
-
- editor_class->set_e_cal = task_editor_set_e_cal;
- editor_class->edit_comp = task_editor_edit_comp;
- editor_class->send_comp = task_editor_send_comp;
-
- object_class->finalize = task_editor_finalize;
-}
-
-static void
-set_menu_sens (TaskEditor *te)
-{
- TaskEditorPrivate *priv;
- gboolean sens, existing, user, read_only = TRUE;
-
- priv = te->priv;
-
- existing = comp_editor_get_existing_org (COMP_EDITOR (te));
- user = comp_editor_get_user_org (COMP_EDITOR (te));
-
- e_cal_is_read_only (comp_editor_get_e_cal (COMP_EDITOR (te)), &read_only, NULL);
-
- sens = e_cal_get_static_capability (comp_editor_get_e_cal (COMP_EDITOR (te)),
- CAL_STATIC_CAPABILITY_NO_TASK_ASSIGNMENT)
- || priv->assignment_shown || read_only;
- comp_editor_set_ui_prop (COMP_EDITOR (te),
- "/commands/ActionAssignTask",
- "sensitive", sens ? "0" : "1");
-
- sens = priv->assignment_shown && existing && !user && !read_only;
- comp_editor_set_ui_prop (COMP_EDITOR (te),
- "/commands/ActionRefreshTask",
- "sensitive", sens ? "1" : "0");
-
- sens = priv->assignment_shown && existing && user && !read_only;
- comp_editor_set_ui_prop (COMP_EDITOR (te),
- "/commands/ActionCancelTask",
- "sensitive", sens ? "1" : "0");
-
- comp_editor_set_ui_prop (COMP_EDITOR (te),
- "/commands/FileSave",
- "sensitive", read_only ? "0" : "1");
- comp_editor_set_ui_prop (COMP_EDITOR (te),
- "/commands/FileSaveAndClose",
- "sensitive", read_only ? "0" : "1");
- comp_editor_set_ui_prop (COMP_EDITOR (te),
- "/commands/FileDelete",
- "sensitive", read_only ? "0" : "1");
-}
-
-static void
-init_widgets (TaskEditor *te)
-{
- TaskEditorPrivate *priv;
-
- priv = te->priv;
-
- g_signal_connect((priv->model), "row_changed",
- G_CALLBACK (model_row_change_insert_cb), te);
- g_signal_connect((priv->model), "row_inserted",
- G_CALLBACK (model_row_change_insert_cb), te);
- g_signal_connect((priv->model), "row_deleted",
- G_CALLBACK (model_row_delete_cb), te);
-}
-
-/* Object initialization function for the task editor */
-static void
-task_editor_init (TaskEditor *te)
-{
- TaskEditorPrivate *priv;
-
- priv = g_new0 (TaskEditorPrivate, 1);
- te->priv = priv;
-
- priv->model = E_MEETING_STORE (e_meeting_store_new ());
- priv->assignment_shown = TRUE;
- priv->updating = FALSE;
-
-}
-
-TaskEditor *
-task_editor_construct (TaskEditor *te, ECal *client)
-{
- TaskEditorPrivate *priv;
-
- priv = te->priv;
-
- priv->task_page = task_page_new ();
- g_object_ref (priv->task_page);
- gtk_object_sink (GTK_OBJECT (priv->task_page));
- comp_editor_append_page (COMP_EDITOR (te),
- COMP_EDITOR_PAGE (priv->task_page),
- _("Basic"));
-
- priv->task_details_page = task_details_page_new ();
- g_object_ref (priv->task_details_page);
- gtk_object_sink (GTK_OBJECT (priv->task_details_page));
- comp_editor_append_page (COMP_EDITOR (te),
- COMP_EDITOR_PAGE (priv->task_details_page),
- _("Details"));
-
- priv->meet_page = meeting_page_new (priv->model, client);
- g_object_ref (priv->meet_page);
- gtk_object_sink (GTK_OBJECT (priv->meet_page));
- comp_editor_append_page (COMP_EDITOR (te),
- COMP_EDITOR_PAGE (priv->meet_page),
- _("Assignment"));
-
- comp_editor_set_e_cal (COMP_EDITOR (te), client);
-
- comp_editor_merge_ui (COMP_EDITOR (te), "evolution-task-editor.xml", verbs, NULL);
-
- init_widgets (te);
- set_menu_sens (te);
-
- return te;
-}
-
-static void
-task_editor_set_e_cal (CompEditor *editor, ECal *client)
-{
- TaskEditor *te;
- TaskEditorPrivate *priv;
-
- te = TASK_EDITOR (editor);
- priv = te->priv;
-
- e_meeting_store_set_e_cal (priv->model, client);
-
- if (parent_class->set_e_cal)
- parent_class->set_e_cal (editor, client);
-}
-
-static void
-task_editor_edit_comp (CompEditor *editor, ECalComponent *comp)
-{
- TaskEditor *te;
- TaskEditorPrivate *priv;
- ECalComponentOrganizer organizer;
- ECal *client;
- GSList *attendees = NULL;
-
- te = TASK_EDITOR (editor);
- priv = te->priv;
-
- priv->updating = TRUE;
-
- if (parent_class->edit_comp)
- parent_class->edit_comp (editor, comp);
-
- client = comp_editor_get_e_cal (COMP_EDITOR (editor));
-
- /* Get meeting related stuff */
- e_cal_component_get_organizer (comp, &organizer);
- e_cal_component_get_attendee_list (comp, &attendees);
-
- /* Clear things up */
- e_meeting_store_remove_all_attendees (priv->model);
-
- if (attendees == NULL) {
- comp_editor_remove_page (editor, COMP_EDITOR_PAGE (priv->meet_page));
- priv->assignment_shown = FALSE;
- } else {
- GSList *l;
- int row;
-
- if (!priv->assignment_shown)
- comp_editor_append_page (COMP_EDITOR (te),
- COMP_EDITOR_PAGE (priv->meet_page),
- _("Assignment"));
-
- for (l = attendees; l != NULL; l = l->next) {
- ECalComponentAttendee *ca = l->data;
- EMeetingAttendee *ia;
-
- ia = E_MEETING_ATTENDEE (e_meeting_attendee_new_from_e_cal_component_attendee (ca));
- /* If we aren't the organizer or the attendee is just delegating, don't allow editing */
- if (!comp_editor_get_user_org (editor) || e_meeting_attendee_is_set_delto (ia))
- e_meeting_attendee_set_edit_level (ia, E_MEETING_ATTENDEE_EDIT_NONE);
- e_meeting_store_add_attendee (priv->model, ia);
-
- g_object_unref(ia);
- }
-
- /* If we aren't the organizer we can still change our own status */
- if (!comp_editor_get_user_org (editor)) {
- EAccountList *accounts;
- EAccount *account;
- EIterator *it;
-
- accounts = itip_addresses_get ();
- for (it = e_list_get_iterator((EList *)accounts);e_iterator_is_valid(it);e_iterator_next(it)) {
- EMeetingAttendee *ia;
-
- account = (EAccount*)e_iterator_get(it);
-
- ia = e_meeting_store_find_attendee (priv->model, account->id->address, &row);
- if (ia != NULL)
- e_meeting_attendee_set_edit_level (ia, E_MEETING_ATTENDEE_EDIT_STATUS);
- }
- g_object_unref(it);
- } else if (e_cal_get_organizer_must_attend (client)) {
- EMeetingAttendee *ia;
-
- ia = e_meeting_store_find_attendee (priv->model, organizer.value, &row);
- if (ia != NULL)
- e_meeting_attendee_set_edit_level (ia, E_MEETING_ATTENDEE_EDIT_NONE);
- }
-
- priv->assignment_shown = TRUE;
- }
- e_cal_component_free_attendee_list (attendees);
-
- set_menu_sens (te);
- comp_editor_set_needs_send (COMP_EDITOR (te), priv->assignment_shown && itip_organizer_is_user (comp, client));
-
- priv->updating = FALSE;
-}
-
-static gboolean
-task_editor_send_comp (CompEditor *editor, ECalComponentItipMethod method)
-{
- TaskEditor *te = TASK_EDITOR (editor);
- TaskEditorPrivate *priv;
- ECalComponent *comp = NULL;
-
- priv = te->priv;
-
- /* Don't cancel more than once or when just publishing */
- if (method == E_CAL_COMPONENT_METHOD_PUBLISH ||
- method == E_CAL_COMPONENT_METHOD_CANCEL)
- goto parent;
-
- comp = meeting_page_get_cancel_comp (priv->meet_page);
- if (comp != NULL) {
- ECal *client;
- gboolean result;
-
- client = e_meeting_store_get_e_cal (priv->model);
- result = itip_send_comp (E_CAL_COMPONENT_METHOD_CANCEL, comp, client, NULL);
- g_object_unref (comp);
-
- if (!result)
- return FALSE;
- }
-
- parent:
- if (parent_class->send_comp)
- return parent_class->send_comp (editor, method);
-
- return FALSE;
-}
-
-/* Destroy handler for the event editor */
-static void
-task_editor_finalize (GObject *object)
-{
- TaskEditor *te;
- TaskEditorPrivate *priv;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (IS_TASK_EDITOR (object));
-
- te = TASK_EDITOR (object);
- priv = te->priv;
-
- g_object_unref (priv->task_page);
- g_object_unref (priv->task_details_page);
- g_object_unref (priv->meet_page);
-
- g_object_unref (priv->model);
-
- g_free (priv);
-
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
-}
-
-/**
- * task_editor_new:
- * @client: a ECal
- *
- * Creates a new event editor dialog.
- *
- * Return value: A newly-created event editor dialog, or NULL if the event
- * editor could not be created.
- **/
-TaskEditor *
-task_editor_new (ECal *client)
-{
- TaskEditor *te;
-
- te = g_object_new (TYPE_TASK_EDITOR, NULL);
- return task_editor_construct (te, client);
-}
-
-static void
-show_assignment (TaskEditor *te)
-{
- TaskEditorPrivate *priv;
-
- priv = te->priv;
-
- if (!priv->assignment_shown) {
- comp_editor_append_page (COMP_EDITOR (te),
- COMP_EDITOR_PAGE (priv->meet_page),
- _("Assignment"));
- priv->assignment_shown = TRUE;
-
- set_menu_sens (te);
- comp_editor_set_needs_send (COMP_EDITOR (te), priv->assignment_shown);
- comp_editor_set_changed (COMP_EDITOR (te), TRUE);
- }
-
- comp_editor_show_page (COMP_EDITOR (te),
- COMP_EDITOR_PAGE (priv->meet_page));
-}
-
-void
-task_editor_show_assignment (TaskEditor *te)
-{
- g_return_if_fail (te != NULL);
- g_return_if_fail (IS_TASK_EDITOR (te));
-
- show_assignment (te);
-}
-
-static void
-assign_task_cmd (GtkWidget *widget, gpointer data)
-{
- TaskEditor *te = TASK_EDITOR (data);
-
- show_assignment (te);
-}
-
-static void
-refresh_task_cmd (GtkWidget *widget, gpointer data)
-{
- TaskEditor *te = TASK_EDITOR (data);
-
- comp_editor_send_comp (COMP_EDITOR (te), E_CAL_COMPONENT_METHOD_REFRESH);
-}
-
-static void
-cancel_task_cmd (GtkWidget *widget, gpointer data)
-{
- TaskEditor *te = TASK_EDITOR (data);
- ECalComponent *comp;
-
- comp = comp_editor_get_current_comp (COMP_EDITOR (te));
- if (cancel_component_dialog ((GtkWindow *) te,
- comp_editor_get_e_cal (COMP_EDITOR (te)), comp, FALSE)) {
- comp_editor_send_comp (COMP_EDITOR (te), E_CAL_COMPONENT_METHOD_CANCEL);
- comp_editor_delete_comp (COMP_EDITOR (te));
- }
-}
-
-static void
-forward_cmd (GtkWidget *widget, gpointer data)
-{
- TaskEditor *te = TASK_EDITOR (data);
-
- if (comp_editor_save_comp (COMP_EDITOR (te), TRUE))
- comp_editor_send_comp (COMP_EDITOR (te), E_CAL_COMPONENT_METHOD_PUBLISH);
-}
-
-static void
-model_changed (TaskEditor *te)
-{
- if (!te->priv->updating) {
- comp_editor_set_changed (COMP_EDITOR (te), TRUE);
- comp_editor_set_needs_send (COMP_EDITOR (te), TRUE);
- }
-}
-
-static void
-model_row_change_insert_cb (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
-{
- model_changed (TASK_EDITOR (data));
-}
-
-static void
-model_row_delete_cb (GtkTreeModel *model, GtkTreePath *path, gpointer data)
-{
- model_changed (TASK_EDITOR (data));
-}
diff --git a/calendar/gui/dialogs/task-editor.h b/calendar/gui/dialogs/task-editor.h
deleted file mode 100644
index e0e6ac75be..0000000000
--- a/calendar/gui/dialogs/task-editor.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* Evolution calendar - Task editor dialog
- *
- * Copyright (C) 2000 Ximian, Inc.
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Authors: Miguel de Icaza <miguel@ximian.com>
- * Federico Mena-Quintero <federico@ximian.com>
- * Seth Alves <alves@hungry.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef __TASK_EDITOR_H__
-#define __TASK_EDITOR_H__
-
-#include <gtk/gtkobject.h>
-#include "comp-editor.h"
-
-
-
-#define TYPE_TASK_EDITOR (task_editor_get_type ())
-#define TASK_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TASK_EDITOR, TaskEditor))
-#define TASK_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TASK_EDITOR, \
- TaskEditorClass))
-#define IS_TASK_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TASK_EDITOR))
-#define IS_TASK_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TASK_EDITOR))
-
-typedef struct _TaskEditor TaskEditor;
-typedef struct _TaskEditorClass TaskEditorClass;
-typedef struct _TaskEditorPrivate TaskEditorPrivate;
-
-struct _TaskEditor {
- CompEditor parent;
-
- /* Private data */
- TaskEditorPrivate *priv;
-};
-
-struct _TaskEditorClass {
- CompEditorClass parent_class;
-};
-
-GtkType task_editor_get_type (void);
-TaskEditor *task_editor_construct (TaskEditor *te,
- ECal *client);
-TaskEditor *task_editor_new (ECal *client);
-void task_editor_show_assignment(TaskEditor *te);
-
-
-#endif /* __TASK_EDITOR_H__ */
diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c
deleted file mode 100644
index 830e5a0bef..0000000000
--- a/calendar/gui/dialogs/task-page.c
+++ /dev/null
@@ -1,926 +0,0 @@
-/* Evolution calendar - Main page of the task editor dialog
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Authors: Federico Mena-Quintero <federico@ximian.com>
- * Miguel de Icaza <miguel@ximian.com>
- * Seth Alves <alves@hungry.com>
- * JP Rosevear <jpr@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-#include <gtk/gtksignal.h>
-#include <gtk/gtktextview.h>
-#include <gtk/gtktogglebutton.h>
-#include <gtk/gtkspinbutton.h>
-#include <gtk/gtkoptionmenu.h>
-#include <libgnome/gnome-i18n.h>
-#include <glade/glade.h>
-#include <gal/widgets/e-categories.h>
-#include <widgets/misc/e-dateedit.h>
-#include "e-util/e-dialog-widgets.h"
-#include "e-util/e-categories-config.h"
-#include "../e-timezone-entry.h"
-#include "../calendar-config.h"
-#include "comp-editor-util.h"
-#include "task-page.h"
-
-
-
-/* Private part of the TaskPage structure */
-struct _TaskPagePrivate {
- /* Glade XML data */
- GladeXML *xml;
-
- /* Widgets from the Glade file */
- GtkWidget *main;
-
- GtkWidget *summary;
-
- GtkWidget *due_date;
- GtkWidget *start_date;
- GtkWidget *due_timezone;
- GtkWidget *start_timezone;
-
- GtkWidget *description;
-
- GtkWidget *classification_public;
- GtkWidget *classification_private;
- GtkWidget *classification_confidential;
-
- GtkWidget *categories_btn;
- GtkWidget *categories;
-
- gboolean updating;
-};
-
-static const int classification_map[] = {
- E_CAL_COMPONENT_CLASS_PUBLIC,
- E_CAL_COMPONENT_CLASS_PRIVATE,
- E_CAL_COMPONENT_CLASS_CONFIDENTIAL,
- -1
-};
-
-
-
-static void task_page_class_init (TaskPageClass *class);
-static void task_page_init (TaskPage *tpage);
-static void task_page_finalize (GObject *object);
-
-static GtkWidget *task_page_get_widget (CompEditorPage *page);
-static void task_page_focus_main_widget (CompEditorPage *page);
-static void task_page_fill_widgets (CompEditorPage *page, ECalComponent *comp);
-static gboolean task_page_fill_component (CompEditorPage *page, ECalComponent *comp);
-static void task_page_set_summary (CompEditorPage *page, const char *summary);
-static void task_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates);
-
-static CompEditorPageClass *parent_class = NULL;
-
-
-
-/**
- * task_page_get_type:
- *
- * Registers the #TaskPage class if necessary, and returns the type ID
- * associated to it.
- *
- * Return value: The type ID of the #TaskPage class.
- **/
-
-E_MAKE_TYPE (task_page, "TaskPage", TaskPage, task_page_class_init, task_page_init,
- TYPE_COMP_EDITOR_PAGE);
-
-/* Class initialization function for the task page */
-static void
-task_page_class_init (TaskPageClass *class)
-{
- CompEditorPageClass *editor_page_class;
- GObjectClass *object_class;
-
- editor_page_class = (CompEditorPageClass *) class;
- object_class = (GObjectClass *) class;
-
- parent_class = g_type_class_ref(TYPE_COMP_EDITOR_PAGE);
-
- editor_page_class->get_widget = task_page_get_widget;
- editor_page_class->focus_main_widget = task_page_focus_main_widget;
- editor_page_class->fill_widgets = task_page_fill_widgets;
- editor_page_class->fill_component = task_page_fill_component;
- editor_page_class->set_summary = task_page_set_summary;
- editor_page_class->set_dates = task_page_set_dates;
-
- object_class->finalize = task_page_finalize;
-}
-
-/* Object initialization function for the task page */
-static void
-task_page_init (TaskPage *tpage)
-{
- TaskPagePrivate *priv;
-
- priv = g_new0 (TaskPagePrivate, 1);
- tpage->priv = priv;
-
- priv->xml = NULL;
-
- priv->main = NULL;
- priv->summary = NULL;
- priv->due_date = NULL;
- priv->start_date = NULL;
- priv->due_timezone = NULL;
- priv->start_timezone = NULL;
- priv->description = NULL;
- priv->classification_public = NULL;
- priv->classification_private = NULL;
- priv->classification_confidential = NULL;
- priv->categories_btn = NULL;
- priv->categories = NULL;
-
- priv->updating = FALSE;
-}
-
-/* Destroy handler for the task page */
-static void
-task_page_finalize (GObject *object)
-{
- TaskPage *tpage;
- TaskPagePrivate *priv;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (IS_TASK_PAGE (object));
-
- tpage = TASK_PAGE (object);
- priv = tpage->priv;
-
- if (priv->main)
- gtk_widget_unref (priv->main);
-
- if (priv->xml) {
- g_object_unref (priv->xml);
- priv->xml = NULL;
- }
-
- g_free (priv);
- tpage->priv = NULL;
-
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
-}
-
-
-
-/* get_widget handler for the task page */
-static GtkWidget *
-task_page_get_widget (CompEditorPage *page)
-{
- TaskPage *tpage;
- TaskPagePrivate *priv;
-
- tpage = TASK_PAGE (page);
- priv = tpage->priv;
-
- return priv->main;
-}
-
-/* focus_main_widget handler for the task page */
-static void
-task_page_focus_main_widget (CompEditorPage *page)
-{
- TaskPage *tpage;
- TaskPagePrivate *priv;
-
- tpage = TASK_PAGE (page);
- priv = tpage->priv;
-
- gtk_widget_grab_focus (priv->summary);
-}
-
-/* Fills the widgets with default values */
-static void
-clear_widgets (TaskPage *tpage)
-{
- TaskPagePrivate *priv;
-
- priv = tpage->priv;
-
- /* Summary, description */
- e_dialog_editable_set (priv->summary, NULL);
- gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->description)), "", 0);
-
- /* Start, due times */
- e_date_edit_set_time (E_DATE_EDIT (priv->start_date), 0);
- e_date_edit_set_time (E_DATE_EDIT (priv->due_date), 0);
-
- /* Classification */
- e_dialog_radio_set (priv->classification_public,
- E_CAL_COMPONENT_CLASS_PRIVATE, classification_map);
-
- /* Categories */
- e_dialog_editable_set (priv->categories, NULL);
-}
-
-/* Decode the radio button group for classifications */
-static ECalComponentClassification
-classification_get (GtkWidget *widget)
-{
- return e_dialog_radio_get (widget, classification_map);
-}
-
-/* fill_widgets handler for the task page */
-static void
-task_page_fill_widgets (CompEditorPage *page, ECalComponent *comp)
-{
- TaskPage *tpage;
- TaskPagePrivate *priv;
- ECalComponentText text;
- ECalComponentDateTime d;
- ECalComponentClassification cl;
- GSList *l;
- const char *categories;
- icaltimezone *zone, *default_zone;
- char *location;
-
- tpage = TASK_PAGE (page);
- priv = tpage->priv;
-
- priv->updating = TRUE;
-
- /* Clean the screen */
- clear_widgets (tpage);
-
- /* Summary, description(s) */
- e_cal_component_get_summary (comp, &text);
- e_dialog_editable_set (priv->summary, text.value);
-
- e_cal_component_get_description_list (comp, &l);
- if (l) {
- text = *(ECalComponentText *)l->data;
- gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->description)),
- text.value, -1);
- } else {
- gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->description)),
- "", 0);
- }
- e_cal_component_free_text_list (l);
-
- location = calendar_config_get_timezone ();
- default_zone = icaltimezone_get_builtin_timezone (location);
-
- /* Due Date. */
- e_cal_component_get_due (comp, &d);
- zone = NULL;
- if (d.value) {
- struct icaltimetype *due_tt = d.value;
- e_date_edit_set_date (E_DATE_EDIT (priv->due_date),
- due_tt->year, due_tt->month,
- due_tt->day);
- if (due_tt->is_date) {
- e_date_edit_set_time_of_day (E_DATE_EDIT (priv->due_date),
- -1, -1);
- zone = default_zone;
- } else {
- e_date_edit_set_time_of_day (E_DATE_EDIT (priv->due_date),
- due_tt->hour,
- due_tt->minute);
- }
- } else {
- e_date_edit_set_time (E_DATE_EDIT (priv->due_date), -1);
-
- /* If no time is set, we use the default timezone, so the
- user usually doesn't have to set this when they set the
- date. */
- zone = default_zone;
- }
-
- /* Note that if we are creating a new task, the timezones may not be
- on the server, so we try to get the builtin timezone with the TZID
- first. */
- if (!zone)
- zone = icaltimezone_get_builtin_timezone_from_tzid (d.tzid);
- if (!zone) {
- if (!e_cal_get_timezone (page->client, d.tzid, &zone, NULL))
- /* FIXME: Handle error better. */
- g_warning ("Couldn't get timezone from server: %s",
- d.tzid ? d.tzid : "");
- }
- e_timezone_entry_set_timezone (E_TIMEZONE_ENTRY (priv->due_timezone),
- zone);
-
- e_cal_component_free_datetime (&d);
-
-
- /* Start Date. */
- e_cal_component_get_dtstart (comp, &d);
- zone = NULL;
- if (d.value) {
- struct icaltimetype *start_tt = d.value;
- e_date_edit_set_date (E_DATE_EDIT (priv->start_date),
- start_tt->year, start_tt->month,
- start_tt->day);
- if (start_tt->is_date) {
- e_date_edit_set_time_of_day (E_DATE_EDIT (priv->start_date),
- -1, -1);
- zone = default_zone;
- } else {
- e_date_edit_set_time_of_day (E_DATE_EDIT (priv->start_date),
- start_tt->hour,
- start_tt->minute);
- }
- } else {
- e_date_edit_set_time (E_DATE_EDIT (priv->start_date), -1);
-
- /* If no time is set, we use the default timezone, so the
- user usually doesn't have to set this when they set the
- date. */
- zone = default_zone;
- }
-
- if (!zone)
- zone = icaltimezone_get_builtin_timezone_from_tzid (d.tzid);
- if (!zone) {
- if (!e_cal_get_timezone (page->client, d.tzid, &zone, NULL))
- /* FIXME: Handle error better. */
- g_warning ("Couldn't get timezone from server: %s",
- d.tzid ? d.tzid : "");
- }
- e_timezone_entry_set_timezone (E_TIMEZONE_ENTRY (priv->start_timezone),
- zone);
-
- e_cal_component_free_datetime (&d);
-
- /* Classification. */
- e_cal_component_get_classification (comp, &cl);
-
- switch (cl) {
- case E_CAL_COMPONENT_CLASS_PUBLIC:
- e_dialog_radio_set (priv->classification_public,
- E_CAL_COMPONENT_CLASS_PUBLIC,
- classification_map);
- break;
-
- case E_CAL_COMPONENT_CLASS_PRIVATE:
- e_dialog_radio_set (priv->classification_public,
- E_CAL_COMPONENT_CLASS_PRIVATE,
- classification_map);
- break;
-
- case E_CAL_COMPONENT_CLASS_CONFIDENTIAL:
- e_dialog_radio_set (priv->classification_public,
- E_CAL_COMPONENT_CLASS_CONFIDENTIAL,
- classification_map);
- break;
-
- default:
- /* default to PUBLIC */
- e_dialog_radio_set (priv->classification_public,
- E_CAL_COMPONENT_CLASS_PUBLIC,
- classification_map);
- break;
- }
-
- /* Categories */
- e_cal_component_get_categories (comp, &categories);
- e_dialog_editable_set (priv->categories, categories);
-
-
- priv->updating = FALSE;
-}
-
-/* fill_component handler for the task page */
-static gboolean
-task_page_fill_component (CompEditorPage *page, ECalComponent *comp)
-{
- TaskPage *tpage;
- TaskPagePrivate *priv;
- ECalComponentDateTime date;
- struct icaltimetype start_tt, due_tt;
- char *cat, *str;
- gboolean start_date_set, due_date_set, time_set;
- GtkTextBuffer *text_buffer;
- GtkTextIter text_iter_start, text_iter_end;
- struct icaltimetype *due_tt2;
- icaltimezone *start_zone = NULL;
- icaltimezone *due_zone = NULL;
-
- tpage = TASK_PAGE (page);
- priv = tpage->priv;
- text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->description));
-
- /* Summary. */
-
- str = e_dialog_editable_get (priv->summary);
- if (!str || strlen (str) == 0)
- e_cal_component_set_summary (comp, NULL);
- else {
- ECalComponentText text;
-
- text.value = str;
- text.altrep = NULL;
-
- e_cal_component_set_summary (comp, &text);
- }
-
- if (str)
- g_free (str);
-
- /* Description */
-
- gtk_text_buffer_get_start_iter (text_buffer, &text_iter_start);
- gtk_text_buffer_get_end_iter (text_buffer, &text_iter_end);
- str = gtk_text_buffer_get_text (text_buffer, &text_iter_start, &text_iter_end, FALSE);
-
- if (!str || strlen (str) == 0)
- e_cal_component_set_description_list (comp, NULL);
- else {
- GSList l;
- ECalComponentText text;
-
- text.value = str;
- text.altrep = NULL;
- l.data = &text;
- l.next = NULL;
-
- e_cal_component_set_description_list (comp, &l);
- }
-
- if (str)
- g_free (str);
-
- /* Dates */
-
- due_tt = icaltime_null_time ();
-
- date.value = &due_tt;
- date.tzid = NULL;
-
- /* Due Date. */
- if (!e_date_edit_date_is_valid (E_DATE_EDIT (priv->due_date)) ||
- !e_date_edit_time_is_valid (E_DATE_EDIT (priv->due_date))) {
- comp_editor_page_display_validation_error (page, _("Due date is wrong"), priv->due_date);
- return FALSE;
- }
-
- due_date_set = e_date_edit_get_date (E_DATE_EDIT (priv->due_date),
- &due_tt.year,
- &due_tt.month,
- &due_tt.day);
- time_set = e_date_edit_get_time_of_day (E_DATE_EDIT (priv->due_date),
- &due_tt.hour,
- &due_tt.minute);
- if (due_date_set) {
- if (time_set) {
- due_zone = e_timezone_entry_get_timezone (E_TIMEZONE_ENTRY (priv->due_timezone));
- date.tzid = icaltimezone_get_tzid (due_zone);
- } else {
- due_tt.is_date = TRUE;
- date.tzid = NULL;
- }
- e_cal_component_set_due (comp, &date);
- } else {
- e_cal_component_set_due (comp, NULL);
- }
-
- /* Start Date. */
- if (!e_date_edit_date_is_valid (E_DATE_EDIT (priv->start_date)) ||
- !e_date_edit_time_is_valid (E_DATE_EDIT (priv->start_date))) {
- comp_editor_page_display_validation_error (page, _("Start date is wrong"), priv->start_date);
- return FALSE;
- }
-
- start_tt = icaltime_null_time ();
- date.value = &start_tt;
- start_date_set = e_date_edit_get_date (E_DATE_EDIT (priv->start_date),
- &start_tt.year,
- &start_tt.month,
- &start_tt.day);
- time_set = e_date_edit_get_time_of_day (E_DATE_EDIT (priv->start_date),
- &start_tt.hour,
- &start_tt.minute);
- if (start_date_set) {
- if (time_set) {
- start_zone = e_timezone_entry_get_timezone (E_TIMEZONE_ENTRY (priv->start_timezone));
- date.tzid = icaltimezone_get_tzid (start_zone);
- } else {
- start_tt.is_date = TRUE;
- date.tzid = NULL;
- }
- e_cal_component_set_dtstart (comp, &date);
- } else {
- e_cal_component_set_dtstart (comp, NULL);
- }
-
- /* Check whether due datetime is before start datetime */
- if (start_date_set && due_date_set) {
- due_tt2 = g_new (struct icaltimetype, 1);
- memcpy (due_tt2, &due_tt, sizeof(due_tt));
- icaltimezone_convert_time (due_tt2, due_zone, start_zone);
- if (icaltime_compare (start_tt, *due_tt2) > 0) {
- comp_editor_page_display_validation_error (page,
- _("Due date is before start date!"),
- priv->due_date);
- g_free (due_tt2);
- return FALSE;
- }
- g_free (due_tt2);
- }
-
-
- /* Classification. */
- e_cal_component_set_classification (comp, classification_get (priv->classification_public));
-
- /* Categories */
- cat = e_dialog_editable_get (priv->categories);
- str = comp_editor_strip_categories (cat);
- if (cat)
- g_free (cat);
-
- e_cal_component_set_categories (comp, str);
-
- if (str)
- g_free (str);
-
- return TRUE;
-}
-
-/* set_summary handler for the task page */
-static void
-task_page_set_summary (CompEditorPage *page, const char *summary)
-{
- /* nothing */
-}
-
-static void
-task_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates)
-{
- TaskPage *tpage;
- TaskPagePrivate *priv;
-
- tpage = TASK_PAGE (page);
- priv = tpage->priv;
-
- if (priv->updating)
- return;
-
- priv->updating = TRUE;
-
- priv->updating = FALSE;
-}
-
-
-
-/* Gets the widgets from the XML file and returns if they are all available. */
-static gboolean
-get_widgets (TaskPage *tpage)
-{
- CompEditorPage *page = COMP_EDITOR_PAGE (tpage);
- TaskPagePrivate *priv;
- GSList *accel_groups;
- GtkWidget *toplevel;
-
- priv = tpage->priv;
-
-#define GW(name) glade_xml_get_widget (priv->xml, name)
-
- priv->main = GW ("task-page");
- if (!priv->main)
- return FALSE;
-
- /* Get the GtkAccelGroup from the toplevel window, so we can install
- it when the notebook page is mapped. */
- toplevel = gtk_widget_get_toplevel (priv->main);
- accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel));
- if (accel_groups) {
- page->accel_group = accel_groups->data;
- gtk_accel_group_ref (page->accel_group);
- }
-
- gtk_widget_ref (priv->main);
- gtk_container_remove (GTK_CONTAINER (priv->main->parent), priv->main);
-
- priv->summary = GW ("summary");
-
- /* Glade's visibility flag doesn't seem to work for custom widgets */
- priv->due_date = GW ("due-date");
- gtk_widget_show (priv->due_date);
- priv->start_date = GW ("start-date");
- gtk_widget_show (priv->start_date);
-
- priv->due_timezone = GW ("due-timezone");
- priv->start_timezone = GW ("start-timezone");
-
- priv->description = GW ("description");
-
- priv->classification_public = GW ("classification-public");
- priv->classification_private = GW ("classification-private");
- priv->classification_confidential = GW ("classification-confidential");
-
- priv->categories_btn = GW ("categories-button");
- priv->categories = GW ("categories");
-
-#undef GW
-
- return (priv->summary
- && priv->due_date
- && priv->start_date
- && priv->due_timezone
- && priv->start_timezone
- && priv->classification_public
- && priv->classification_private
- && priv->classification_confidential
- && priv->description
- && priv->categories_btn
- && priv->categories);
-}
-
-/* Callback used when the summary changes; we emit the notification signal. */
-static void
-summary_changed_cb (GtkEditable *editable, gpointer data)
-{
- TaskPage *tpage;
- TaskPagePrivate *priv;
- gchar *summary;
-
- tpage = TASK_PAGE (data);
- priv = tpage->priv;
-
- if (priv->updating)
- return;
-
- summary = e_dialog_editable_get (GTK_WIDGET (editable));
- comp_editor_page_notify_summary_changed (COMP_EDITOR_PAGE (tpage),
- summary);
- g_free (summary);
-}
-
-/* Callback used when the start or due date widgets change. We notify the
- * other pages in the task editor, so they can update any labels.
- */
-static void
-date_changed_cb (EDateEdit *dedit, gpointer data)
-{
- TaskPage *tpage;
- TaskPagePrivate *priv;
- CompEditorPageDates dates;
- gboolean date_set, time_set;
- ECalComponentDateTime start_dt, due_dt;
- struct icaltimetype start_tt = icaltime_null_time();
- struct icaltimetype due_tt = icaltime_null_time();
-
- tpage = TASK_PAGE (data);
- priv = tpage->priv;
-
- if (priv->updating)
- return;
-
- date_set = e_date_edit_get_date (E_DATE_EDIT (priv->start_date),
- &start_tt.year,
- &start_tt.month,
- &start_tt.day);
- time_set = e_date_edit_get_time_of_day (E_DATE_EDIT (priv->start_date),
- &start_tt.hour,
- &start_tt.minute);
- if (date_set) {
- if (time_set) {
- icaltimezone *zone = e_timezone_entry_get_timezone (E_TIMEZONE_ENTRY (priv->start_timezone));
- start_dt.tzid = icaltimezone_get_tzid (zone);
- } else {
- start_tt.is_date = TRUE;
- start_dt.tzid = NULL;
- }
- } else {
- start_tt = icaltime_null_time ();
- start_dt.tzid = NULL;
- }
-
- date_set = e_date_edit_get_date (E_DATE_EDIT (priv->due_date),
- &due_tt.year,
- &due_tt.month,
- &due_tt.day);
- time_set = e_date_edit_get_time_of_day (E_DATE_EDIT (priv->due_date),
- &due_tt.hour,
- &due_tt.minute);
- if (date_set) {
- if (time_set) {
- icaltimezone *zone = e_timezone_entry_get_timezone (E_TIMEZONE_ENTRY (priv->due_timezone));
- due_dt.tzid = icaltimezone_get_tzid (zone);
- } else {
- due_tt.is_date = TRUE;
- due_dt.tzid = NULL;
- }
- } else {
- due_tt = icaltime_null_time ();
- due_dt.tzid = NULL;
- }
-
- start_dt.value = &start_tt;
- dates.start = &start_dt;
- dates.end = NULL;
- due_dt.value = &due_tt;
- dates.due = &due_dt;
- dates.complete = NULL;
-
- /* Notify upstream */
- comp_editor_page_notify_dates_changed (COMP_EDITOR_PAGE (tpage),
- &dates);
-}
-
-/* Callback used when the categories button is clicked; we must bring up the
- * category list dialog.
- */
-static void
-categories_clicked_cb (GtkWidget *button, gpointer data)
-{
- TaskPage *tpage;
- TaskPagePrivate *priv;
- GtkWidget *entry;
-
- tpage = TASK_PAGE (data);
- priv = tpage->priv;
-
- entry = priv->categories;
- e_categories_config_open_dialog_for_entry (GTK_ENTRY (entry));
-}
-
-/* This is called when any field is changed; it notifies upstream. */
-static void
-field_changed_cb (GtkWidget *widget, gpointer data)
-{
- TaskPage *tpage;
- TaskPagePrivate *priv;
-
- tpage = TASK_PAGE (data);
- priv = tpage->priv;
-
- if (!priv->updating)
- comp_editor_page_notify_changed (COMP_EDITOR_PAGE (tpage));
-}
-
-/* Hooks the widget signals */
-static gboolean
-init_widgets (TaskPage *tpage)
-{
- TaskPagePrivate *priv;
- GtkTextBuffer *text_buffer;
- char *location;
- icaltimezone *zone;
-
- priv = tpage->priv;
-
- /* Make sure the EDateEdit widgets use our timezones to get the
- current time. */
- e_date_edit_set_get_time_callback (E_DATE_EDIT (priv->start_date),
- (EDateEditGetTimeCallback) comp_editor_get_current_time,
- tpage, NULL);
- e_date_edit_set_get_time_callback (E_DATE_EDIT (priv->due_date),
- (EDateEditGetTimeCallback) comp_editor_get_current_time,
- tpage, NULL);
-
- /* Summary */
- g_signal_connect((priv->summary), "changed",
- G_CALLBACK (summary_changed_cb), tpage);
-
- /* Description */
- text_buffer = gtk_text_buffer_new (NULL);
- gtk_text_view_set_buffer (GTK_TEXT_VIEW (priv->description), text_buffer);
- g_object_unref (text_buffer);
-
- gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (priv->description), GTK_WRAP_WORD);
-
- /* Dates */
- g_signal_connect((priv->start_date), "changed",
- G_CALLBACK (date_changed_cb), tpage);
- g_signal_connect((priv->due_date), "changed",
- G_CALLBACK (date_changed_cb), tpage);
-
- g_signal_connect((priv->due_timezone), "changed",
- G_CALLBACK (field_changed_cb), tpage);
- g_signal_connect((priv->start_timezone), "changed",
- G_CALLBACK (field_changed_cb), tpage);
-
- /* Classification */
- g_signal_connect((priv->classification_public),
- "toggled",
- G_CALLBACK (field_changed_cb), tpage);
- g_signal_connect((priv->classification_private),
- "toggled",
- G_CALLBACK (field_changed_cb), tpage);
- g_signal_connect((priv->classification_confidential),
- "toggled",
- G_CALLBACK (field_changed_cb), tpage);
-
- /* Connect the default signal handler to use to make sure the "changed"
- field gets set whenever a field is changed. */
-
- /* Belongs to priv->description */
- g_signal_connect ((text_buffer), "changed",
- G_CALLBACK (field_changed_cb), tpage);
-
- g_signal_connect((priv->categories), "changed",
- G_CALLBACK (field_changed_cb), tpage);
-
- /* Categories button */
- g_signal_connect((priv->categories_btn), "clicked",
- G_CALLBACK (categories_clicked_cb), tpage);
-
-
- /* Set the default timezone, so the timezone entry may be hidden. */
- location = calendar_config_get_timezone ();
- zone = icaltimezone_get_builtin_timezone (location);
- e_timezone_entry_set_default_timezone (E_TIMEZONE_ENTRY (priv->start_timezone), zone);
- e_timezone_entry_set_default_timezone (E_TIMEZONE_ENTRY (priv->due_timezone), zone);
-
- return TRUE;
-}
-
-
-
-/**
- * task_page_construct:
- * @tpage: An task page.
- *
- * Constructs an task page by loading its Glade data.
- *
- * Return value: The same object as @tpage, or NULL if the widgets could not be
- * created.
- **/
-TaskPage *
-task_page_construct (TaskPage *tpage)
-{
- TaskPagePrivate *priv;
-
- priv = tpage->priv;
-
- priv->xml = glade_xml_new (EVOLUTION_GLADEDIR "/task-page.glade",
- NULL, NULL);
- if (!priv->xml) {
- g_message ("task_page_construct(): "
- "Could not load the Glade XML file!");
- return NULL;
- }
-
- if (!get_widgets (tpage)) {
- g_message ("task_page_construct(): "
- "Could not find all widgets in the XML file!");
- return NULL;
- }
-
- if (!init_widgets (tpage)) {
- g_message ("event_page_construct(): "
- "Could not initialize the widgets!");
- return NULL;
- }
-
- return tpage;
-}
-
-/**
- * task_page_new:
- *
- * Creates a new task page.
- *
- * Return value: A newly-created task page, or NULL if the page could
- * not be created.
- **/
-TaskPage *
-task_page_new (void)
-{
- TaskPage *tpage;
-
- tpage = gtk_type_new (TYPE_TASK_PAGE);
- if (!task_page_construct (tpage)) {
- g_object_unref (tpage);
- return NULL;
- }
-
- return tpage;
-}
-
-GtkWidget *task_page_create_date_edit (void);
-
-GtkWidget *
-task_page_create_date_edit (void)
-{
- GtkWidget *dedit;
-
- dedit = comp_editor_new_date_edit (TRUE, TRUE, TRUE);
- e_date_edit_set_allow_no_date_set (E_DATE_EDIT (dedit), TRUE);
-
- return dedit;
-}
diff --git a/calendar/gui/dialogs/task-page.glade b/calendar/gui/dialogs/task-page.glade
deleted file mode 100644
index 02a8797b45..0000000000
--- a/calendar/gui/dialogs/task-page.glade
+++ /dev/null
@@ -1,477 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-
-<widget class="GtkWindow" id="task-toplevel">
- <property name="title" translatable="yes">window1</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
-
- <child>
- <widget class="GtkVBox" id="task-page">
- <property name="border_width">12</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkTable" id="table3">
- <property name="visible">True</property>
- <property name="n_rows">1</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label3">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Su_mmary:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">summary</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options"></property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="summary">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFrame" id="frame2">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkHBox" id="hbox4">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkTable" id="table1">
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">3</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">2</property>
- <property name="column_spacing">4</property>
-
- <child>
- <widget class="GtkLabel" id="label6">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Sta_rt Date:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">start-date</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label5">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Due Date:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">due-date</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="due-date">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="creation_function">task_page_create_date_edit</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Fri, 01 Jun 2001 18:59:52 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="start-date">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="creation_function">task_page_create_date_edit</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Fri, 01 Jun 2001 18:59:57 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="due-timezone">
- <property name="visible">True</property>
- <property name="creation_function">make_timezone_entry</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Tue, 19 Jun 2001 04:43:54 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="start-timezone">
- <property name="visible">True</property>
- <property name="creation_function">make_timezone_entry</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Tue, 19 Jun 2001 04:43:46 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label4">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Date &amp; Time</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox1">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label18">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Description:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow1">
- <property name="visible">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <widget class="GtkTextView" id="description">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="justification">GTK_JUSTIFY_LEFT</property>
- <property name="wrap_mode">GTK_WRAP_WORD</property>
- <property name="cursor_visible">True</property>
- <property name="pixels_above_lines">0</property>
- <property name="pixels_below_lines">0</property>
- <property name="pixels_inside_wrap">0</property>
- <property name="left_margin">0</property>
- <property name="right_margin">0</property>
- <property name="indent">0</property>
- <property name="text" translatable="yes"></property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFrame" id="frame24">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkHBox" id="hbox6">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkRadioButton" id="classification-public">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Pu_blic</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">True</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="classification-private">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Pri_vate</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">classification-public</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="classification-confidential">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Con_fidential</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">classification-public</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label19">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Classification</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox2">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkButton" id="categories-button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Ca_tegories...</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="categories">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/calendar/gui/dialogs/task-page.h b/calendar/gui/dialogs/task-page.h
deleted file mode 100644
index 16ced619d7..0000000000
--- a/calendar/gui/dialogs/task-page.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* Evolution calendar - Main page of the task editor dialog
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Authors: Federico Mena-Quintero <federico@ximian.com>
- * Miguel de Icaza <miguel@ximian.com>
- * Seth Alves <alves@hungry.com>
- * JP Rosevear <jpr@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef TASK_PAGE_H
-#define TASK_PAGE_H
-
-#include "comp-editor-page.h"
-
-G_BEGIN_DECLS
-
-
-
-#define TYPE_TASK_PAGE (task_page_get_type ())
-#define TASK_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TASK_PAGE, TaskPage))
-#define TASK_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TASK_PAGE, TaskPageClass))
-#define IS_TASK_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TASK_PAGE))
-#define IS_TASK_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), TYPE_TASK_PAGE))
-
-typedef struct _TaskPagePrivate TaskPagePrivate;
-
-typedef struct {
- CompEditorPage page;
-
- /* Private data */
- TaskPagePrivate *priv;
-} TaskPage;
-
-typedef struct {
- CompEditorPageClass parent_class;
-} TaskPageClass;
-
-GtkType task_page_get_type (void);
-TaskPage *task_page_construct (TaskPage *epage);
-TaskPage *task_page_new (void);
-
-
-
-G_END_DECLS
-
-#endif
diff --git a/calendar/gui/e-alarm-list.c b/calendar/gui/e-alarm-list.c
deleted file mode 100644
index c1429f8705..0000000000
--- a/calendar/gui/e-alarm-list.c
+++ /dev/null
@@ -1,690 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/* EAlarmList - list of calendar alarms with GtkTreeModel interface.
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- *
- * Authors: Hans Petter Jansson <hpj@ximian.com>
- */
-
-#include <config.h>
-#include <string.h>
-#include <gtk/gtktreemodel.h>
-#include <gtk/gtksignal.h>
-#include <gtk/gtktreednd.h>
-#include <libgnome/gnome-i18n.h>
-#include <glib.h>
-#include <libecal/e-cal-time-util.h>
-#include <e-util/e-time-utils.h>
-#include "calendar-config.h"
-#include "e-alarm-list.h"
-
-#define G_LIST(x) ((GList *) x)
-#define E_ALARM_LIST_IS_SORTED(list) (E_ALARM_LIST (list)->sort_column_id != -2)
-#define IS_VALID_ITER(dt_list, iter) (iter!= NULL && iter->user_data != NULL && \
- dt_list->stamp == iter->stamp)
-
-static GType column_types [E_ALARM_LIST_NUM_COLUMNS];
-
-static void e_alarm_list_init (EAlarmList *file_list);
-static void e_alarm_list_class_init (EAlarmListClass *class);
-static void e_alarm_list_tree_model_init (GtkTreeModelIface *iface);
-static void e_alarm_list_finalize (GObject *object);
-static guint e_alarm_list_get_flags (GtkTreeModel *tree_model);
-static gint e_alarm_list_get_n_columns (GtkTreeModel *tree_model);
-static GType e_alarm_list_get_column_type (GtkTreeModel *tree_model,
- gint index);
-static gboolean e_alarm_list_get_iter (GtkTreeModel *tree_model,
- GtkTreeIter *iter,
- GtkTreePath *path);
-static GtkTreePath *e_alarm_list_get_path (GtkTreeModel *tree_model,
- GtkTreeIter *iter);
-static void e_alarm_list_get_value (GtkTreeModel *tree_model,
- GtkTreeIter *iter,
- gint column,
- GValue *value);
-static gboolean e_alarm_list_iter_next (GtkTreeModel *tree_model,
- GtkTreeIter *iter);
-static gboolean e_alarm_list_iter_children (GtkTreeModel *tree_model,
- GtkTreeIter *iter,
- GtkTreeIter *parent);
-static gboolean e_alarm_list_iter_has_child (GtkTreeModel *tree_model,
- GtkTreeIter *iter);
-static gint e_alarm_list_iter_n_children (GtkTreeModel *tree_model,
- GtkTreeIter *iter);
-static gboolean e_alarm_list_iter_nth_child (GtkTreeModel *tree_model,
- GtkTreeIter *iter,
- GtkTreeIter *parent,
- gint n);
-static gboolean e_alarm_list_iter_parent (GtkTreeModel *tree_model,
- GtkTreeIter *iter,
- GtkTreeIter *child);
-
-static GObjectClass *parent_class = NULL;
-
-GtkType
-e_alarm_list_get_type (void)
-{
- static GType alarm_list_type = 0;
-
- if (!alarm_list_type) {
- static const GTypeInfo alarm_list_info =
- {
- sizeof (EAlarmListClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_alarm_list_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EAlarmList),
- 0,
- (GInstanceInitFunc) e_alarm_list_init,
- };
-
- static const GInterfaceInfo tree_model_info =
- {
- (GInterfaceInitFunc) e_alarm_list_tree_model_init,
- NULL,
- NULL
- };
-
- column_types [E_ALARM_LIST_COLUMN_DESCRIPTION] = G_TYPE_STRING;
-
- alarm_list_type = g_type_register_static (G_TYPE_OBJECT, "EAlarmList",
- &alarm_list_info, 0);
- g_type_add_interface_static (alarm_list_type,
- GTK_TYPE_TREE_MODEL,
- &tree_model_info);
- }
-
- return alarm_list_type;
-}
-
-static void
-e_alarm_list_class_init (EAlarmListClass *class)
-{
- GObjectClass *object_class;
-
- parent_class = g_type_class_peek_parent (class);
- object_class = (GObjectClass *) class;
-
- object_class->finalize = e_alarm_list_finalize;
-}
-
-static void
-e_alarm_list_tree_model_init (GtkTreeModelIface *iface)
-{
- iface->get_flags = e_alarm_list_get_flags;
- iface->get_n_columns = e_alarm_list_get_n_columns;
- iface->get_column_type = e_alarm_list_get_column_type;
- iface->get_iter = e_alarm_list_get_iter;
- iface->get_path = e_alarm_list_get_path;
- iface->get_value = e_alarm_list_get_value;
- iface->iter_next = e_alarm_list_iter_next;
- iface->iter_children = e_alarm_list_iter_children;
- iface->iter_has_child = e_alarm_list_iter_has_child;
- iface->iter_n_children = e_alarm_list_iter_n_children;
- iface->iter_nth_child = e_alarm_list_iter_nth_child;
- iface->iter_parent = e_alarm_list_iter_parent;
-}
-
-static void
-e_alarm_list_init (EAlarmList *alarm_list)
-{
- alarm_list->stamp = g_random_int ();
- alarm_list->columns_dirty = FALSE;
- alarm_list->list = NULL;
-}
-
-EAlarmList *
-e_alarm_list_new (void)
-{
- EAlarmList *alarm_list;
-
- alarm_list = E_ALARM_LIST (g_object_new (e_alarm_list_get_type (), NULL));
-
- return alarm_list;
-}
-
-static void
-all_rows_deleted (EAlarmList *alarm_list)
-{
- GtkTreePath *path;
- gint i;
-
- if (!alarm_list->list)
- return;
-
- path = gtk_tree_path_new ();
- i = g_list_length (alarm_list->list);
- gtk_tree_path_append_index (path, i);
-
- for ( ; i >= 0; i--) {
- gtk_tree_model_row_deleted (GTK_TREE_MODEL (alarm_list), path);
- gtk_tree_path_prev (path);
- }
-
- gtk_tree_path_free (path);
-}
-
-static void
-row_deleted (EAlarmList *alarm_list, gint n)
-{
- GtkTreePath *path;
-
- path = gtk_tree_path_new ();
- gtk_tree_path_append_index (path, n);
- gtk_tree_model_row_deleted (GTK_TREE_MODEL (alarm_list), path);
- gtk_tree_path_free (path);
-}
-
-static void
-row_added (EAlarmList *alarm_list, gint n)
-{
- GtkTreePath *path;
- GtkTreeIter iter;
-
- path = gtk_tree_path_new ();
- gtk_tree_path_append_index (path, n);
-
- if (gtk_tree_model_get_iter (GTK_TREE_MODEL (alarm_list), &iter, path))
- gtk_tree_model_row_inserted (GTK_TREE_MODEL (alarm_list), path, &iter);
-
- gtk_tree_path_free (path);
-}
-
-static void
-row_updated (EAlarmList *alarm_list, gint n)
-{
- GtkTreePath *path;
- GtkTreeIter iter;
-
- path = gtk_tree_path_new ();
- gtk_tree_path_append_index (path, n);
-
- if (gtk_tree_model_get_iter (GTK_TREE_MODEL (alarm_list), &iter, path))
- gtk_tree_model_row_changed (GTK_TREE_MODEL (alarm_list), path, &iter);
-
- gtk_tree_path_free (path);
-}
-
-static void
-e_alarm_list_finalize (GObject *object)
-{
- EAlarmList *alarm_list = E_ALARM_LIST (object);
-
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
-}
-
-/* Fulfill the GtkTreeModel requirements */
-static guint
-e_alarm_list_get_flags (GtkTreeModel *tree_model)
-{
- g_return_val_if_fail (E_IS_ALARM_LIST (tree_model), 0);
-
- return GTK_TREE_MODEL_LIST_ONLY;
-}
-
-static gint
-e_alarm_list_get_n_columns (GtkTreeModel *tree_model)
-{
- EAlarmList *alarm_list = (EAlarmList *) tree_model;
-
- g_return_val_if_fail (E_IS_ALARM_LIST (tree_model), 0);
-
- alarm_list->columns_dirty = TRUE;
- return E_ALARM_LIST_NUM_COLUMNS;
-}
-
-static GType
-e_alarm_list_get_column_type (GtkTreeModel *tree_model,
- gint index)
-{
- EAlarmList *alarm_list = (EAlarmList *) tree_model;
-
- g_return_val_if_fail (E_IS_ALARM_LIST (tree_model), G_TYPE_INVALID);
- g_return_val_if_fail (index < E_ALARM_LIST_NUM_COLUMNS &&
- index >= 0, G_TYPE_INVALID);
-
- alarm_list->columns_dirty = TRUE;
- return column_types [index];
-}
-
-const ECalComponentAlarm *
-e_alarm_list_get_alarm (EAlarmList *alarm_list, GtkTreeIter *iter)
-{
- g_return_val_if_fail (IS_VALID_ITER (alarm_list, iter), NULL);
-
- return G_LIST (iter->user_data)->data;
-}
-
-static void
-free_alarm (ECalComponentAlarm *alarm)
-{
- e_cal_component_alarm_free (alarm);
-}
-
-static ECalComponentAlarm *
-copy_alarm (const ECalComponentAlarm *alarm)
-{
- return e_cal_component_alarm_clone ((ECalComponentAlarm *) alarm);
-}
-
-void
-e_alarm_list_set_alarm (EAlarmList *alarm_list, GtkTreeIter *iter,
- const ECalComponentAlarm *alarm)
-{
- ECalComponentAlarm *alarm_old;
-
- g_return_if_fail (IS_VALID_ITER (alarm_list, iter));
-
- alarm_old = G_LIST (iter->user_data)->data;
- free_alarm (alarm_old);
- G_LIST (iter->user_data)->data = copy_alarm (alarm);
- row_updated (alarm_list, g_list_position (alarm_list->list, G_LIST (iter->user_data)));
-}
-
-void
-e_alarm_list_append (EAlarmList *alarm_list, GtkTreeIter *iter,
- const ECalComponentAlarm *alarm)
-{
- g_return_if_fail (alarm != NULL);
-
- alarm_list->list = g_list_append (alarm_list->list, copy_alarm (alarm));
- row_added (alarm_list, g_list_length (alarm_list->list) - 1);
-
- if (iter) {
- iter->user_data = g_list_last (alarm_list->list);
- iter->stamp = alarm_list->stamp;
- }
-}
-
-void
-e_alarm_list_remove (EAlarmList *alarm_list, GtkTreeIter *iter)
-{
- gint n;
-
- g_return_if_fail (IS_VALID_ITER (alarm_list, iter));
-
- n = g_list_position (alarm_list->list, G_LIST (iter->user_data));
- free_alarm ((ECalComponentAlarm *) G_LIST (iter->user_data)->data);
- alarm_list->list = g_list_delete_link (alarm_list->list, G_LIST (iter->user_data));
- row_deleted (alarm_list, n);
-}
-
-void
-e_alarm_list_clear (EAlarmList *alarm_list)
-{
- GList *l;
-
- all_rows_deleted (alarm_list);
-
- for (l = alarm_list->list; l; l = g_list_next (l)) {
- free_alarm ((ECalComponentAlarm *) l->data);
- }
-
- g_list_free (alarm_list->list);
- alarm_list->list = NULL;
-}
-
-static gboolean
-e_alarm_list_get_iter (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreePath *path)
-{
- EAlarmList *alarm_list = (EAlarmList *) tree_model;
- GList *l;
- gint i;
-
- g_return_val_if_fail (E_IS_ALARM_LIST (tree_model), FALSE);
- g_return_val_if_fail (gtk_tree_path_get_depth (path) > 0, FALSE);
-
- if (!alarm_list->list)
- return FALSE;
-
- alarm_list->columns_dirty = TRUE;
-
- i = gtk_tree_path_get_indices (path)[0];
- l = g_list_nth (alarm_list->list, i);
- if (!l)
- return FALSE;
-
- iter->user_data = l;
- iter->stamp = alarm_list->stamp;
- return TRUE;
-}
-
-static GtkTreePath *
-e_alarm_list_get_path (GtkTreeModel *tree_model,
- GtkTreeIter *iter)
-{
- EAlarmList *alarm_list = (EAlarmList *) tree_model;
- GtkTreePath *retval;
- GList *l;
-
- g_return_val_if_fail (E_IS_ALARM_LIST (tree_model), NULL);
- g_return_val_if_fail (iter->stamp == E_ALARM_LIST (tree_model)->stamp, NULL);
-
- l = iter->user_data;
- retval = gtk_tree_path_new ();
- gtk_tree_path_append_index (retval, g_list_position (alarm_list->list, l));
- return retval;
-}
-
-/* Builds a string for the duration of the alarm. If the duration is zero, returns NULL. */
-static char *
-get_alarm_duration_string (struct icaldurationtype *duration)
-{
- GString *string = g_string_new (NULL);
- char *ret;
- gboolean have_something;
-
- have_something = FALSE;
-
- if (duration->days > 1) {
- g_string_sprintf (string, _("%d days"), duration->days);
- have_something = TRUE;
- } else if (duration->days == 1) {
- g_string_append (string, _("1 day"));
- have_something = TRUE;
- }
-
- if (duration->weeks > 1) {
- g_string_sprintf (string, _("%d weeks"), duration->weeks);
- have_something = TRUE;
- } else if (duration->weeks == 1) {
- g_string_append (string, _("1 week"));
- have_something = TRUE;
- }
-
- if (duration->hours > 1) {
- g_string_sprintf (string, _("%d hours"), duration->hours);
- have_something = TRUE;
- } else if (duration->hours == 1) {
- g_string_append (string, _("1 hour"));
- have_something = TRUE;
- }
-
- if (duration->minutes > 1) {
- g_string_sprintf (string, _("%d minutes"), duration->minutes);
- have_something = TRUE;
- } else if (duration->minutes == 1) {
- g_string_append (string, _("1 minute"));
- have_something = TRUE;
- }
-
- if (duration->seconds > 1) {
- g_string_sprintf (string, _("%d seconds"), duration->seconds);
- have_something = TRUE;
- } else if (duration->seconds == 1) {
- g_string_append (string, _("1 second"));
- have_something = TRUE;
- }
-
- if (have_something) {
- ret = string->str;
- g_string_free (string, FALSE);
- return ret;
- } else {
- g_string_free (string, TRUE);
- return NULL;
- }
-}
-
-static char *
-get_alarm_string (ECalComponentAlarm *alarm)
-{
- ECalComponentAlarmAction action;
- ECalComponentAlarmTrigger trigger;
- char string[256];
- char *base, *str = NULL, *dur;
-
- string [0] = '\0';
-
- e_cal_component_alarm_get_action (alarm, &action);
- e_cal_component_alarm_get_trigger (alarm, &trigger);
-
- switch (action) {
- case E_CAL_COMPONENT_ALARM_AUDIO:
- base = _("Play a sound");
- break;
-
- case E_CAL_COMPONENT_ALARM_DISPLAY:
- base = _("Display a message");
- break;
-
- case E_CAL_COMPONENT_ALARM_EMAIL:
- base = _("Send an email");
- break;
-
- case E_CAL_COMPONENT_ALARM_PROCEDURE:
- base = _("Run a program");
- break;
-
- case E_CAL_COMPONENT_ALARM_NONE:
- case E_CAL_COMPONENT_ALARM_UNKNOWN:
- default:
- base = _("Unknown action to be performed");
- break;
- }
-
- /* FIXME: This does not look like it will localize correctly. */
-
- switch (trigger.type) {
- case E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START:
- dur = get_alarm_duration_string (&trigger.u.rel_duration);
-
- if (dur) {
- if (trigger.u.rel_duration.is_neg)
- str = g_strdup_printf (_("%s %s before the start of the appointment"),
- base, dur);
- else
- str = g_strdup_printf (_("%s %s after the start of the appointment"),
- base, dur);
-
- g_free (dur);
- } else
- str = g_strdup_printf (_("%s at the start of the appointment"), base);
-
- break;
-
- case E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_END:
- dur = get_alarm_duration_string (&trigger.u.rel_duration);
-
- if (dur) {
- if (trigger.u.rel_duration.is_neg)
- str = g_strdup_printf (_("%s %s before the end of the appointment"),
- base, dur);
- else
- str = g_strdup_printf (_("%s %s after the end of the appointment"),
- base, dur);
-
- g_free (dur);
- } else
- str = g_strdup_printf (_("%s at the end of the appointment"), base);
-
- break;
-
- case E_CAL_COMPONENT_ALARM_TRIGGER_ABSOLUTE: {
- struct icaltimetype itt;
- icaltimezone *utc_zone, *current_zone;
- char *location;
- struct tm tm;
- char buf[256];
-
- /* Absolute triggers come in UTC, so convert them to the local timezone */
-
- itt = trigger.u.abs_time;
-
- utc_zone = icaltimezone_get_utc_timezone ();
- location = calendar_config_get_timezone ();
- current_zone = icaltimezone_get_builtin_timezone (location);
-
- tm = icaltimetype_to_tm_with_zone (&itt, utc_zone, current_zone);
-
- e_time_format_date_and_time (&tm, calendar_config_get_24_hour_format (),
- FALSE, FALSE, buf, sizeof (buf));
-
- str = g_strdup_printf (_("%s at %s"), base, buf);
-
- break; }
-
- case E_CAL_COMPONENT_ALARM_TRIGGER_NONE:
- default:
- str = g_strdup_printf (_("%s for an unknown trigger type"), base);
- break;
- }
-
- return str;
-}
-
-static void
-e_alarm_list_get_value (GtkTreeModel *tree_model,
- GtkTreeIter *iter,
- gint column,
- GValue *value)
-{
- EAlarmList *alarm_list = E_ALARM_LIST (tree_model);
- ECalComponentAlarm *alarm;
- GList *l;
- const gchar *str;
-
- g_return_if_fail (E_IS_ALARM_LIST (tree_model));
- g_return_if_fail (column < E_ALARM_LIST_NUM_COLUMNS);
- g_return_if_fail (E_ALARM_LIST (tree_model)->stamp == iter->stamp);
- g_return_if_fail (IS_VALID_ITER (alarm_list, iter));
-
- g_value_init (value, column_types [column]);
-
- if (!alarm_list->list)
- return;
-
- l = iter->user_data;
- alarm = l->data;
-
- if (!alarm)
- return;
-
- switch (column) {
- case E_ALARM_LIST_COLUMN_DESCRIPTION:
- str = get_alarm_string (alarm);
- g_value_set_string (value, str);
- break;
- }
-}
-
-static gboolean
-e_alarm_list_iter_next (GtkTreeModel *tree_model,
- GtkTreeIter *iter)
-{
- GList *l;
-
- g_return_val_if_fail (E_IS_ALARM_LIST (tree_model), FALSE);
- g_return_val_if_fail (IS_VALID_ITER (E_ALARM_LIST (tree_model), iter), FALSE);
-
- if (!E_ALARM_LIST (tree_model)->list)
- return FALSE;
-
- l = iter->user_data;
- l = g_list_next (l);
- if (l) {
- iter->user_data = l;
- return TRUE;
- }
-
- return FALSE;
-}
-
-static gboolean
-e_alarm_list_iter_children (GtkTreeModel *tree_model,
- GtkTreeIter *iter,
- GtkTreeIter *parent)
-{
- EAlarmList *alarm_list = E_ALARM_LIST (tree_model);
-
- /* this is a list, nodes have no children */
- if (parent)
- return FALSE;
-
- /* but if parent == NULL we return the list itself as children of the
- * "root" */
-
- if (!alarm_list->list)
- return FALSE;
-
- iter->stamp = E_ALARM_LIST (tree_model)->stamp;
- iter->user_data = alarm_list->list;
- return TRUE;
-}
-
-static gboolean
-e_alarm_list_iter_has_child (GtkTreeModel *tree_model,
- GtkTreeIter *iter)
-{
- g_return_val_if_fail (IS_VALID_ITER (E_ALARM_LIST (tree_model), iter), FALSE);
- return FALSE;
-}
-
-static gint
-e_alarm_list_iter_n_children (GtkTreeModel *tree_model,
- GtkTreeIter *iter)
-{
- EAlarmList *alarm_list = E_ALARM_LIST (tree_model);
-
- g_return_val_if_fail (E_IS_ALARM_LIST (tree_model), -1);
- g_return_val_if_fail (IS_VALID_ITER (alarm_list, iter), -1);
-
- if (iter == NULL)
- return g_list_length (alarm_list->list);
-
- g_return_val_if_fail (E_ALARM_LIST (tree_model)->stamp == iter->stamp, -1);
- return 0;
-}
-
-static gboolean
-e_alarm_list_iter_nth_child (GtkTreeModel *tree_model,
- GtkTreeIter *iter,
- GtkTreeIter *parent,
- gint n)
-{
- EAlarmList *alarm_list = E_ALARM_LIST (tree_model);
-
- g_return_val_if_fail (E_IS_ALARM_LIST (tree_model), FALSE);
-
- if (parent)
- return FALSE;
-
- if (alarm_list->list) {
- GList *l;
-
- l = g_list_nth (alarm_list->list, n);
- if (!l)
- return FALSE;
-
- iter->stamp = alarm_list->stamp;
- iter->user_data = l;
- return TRUE;
- }
-
- return FALSE;
-}
-
-static gboolean
-e_alarm_list_iter_parent (GtkTreeModel *tree_model,
- GtkTreeIter *iter,
- GtkTreeIter *child)
-{
- return FALSE;
-}
diff --git a/calendar/gui/e-alarm-list.h b/calendar/gui/e-alarm-list.h
deleted file mode 100644
index 93cc8ac58a..0000000000
--- a/calendar/gui/e-alarm-list.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/* EAlarmList - list of calendar alarms with GtkTreeModel interface.
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- *
- * Authors: Hans Petter Jansson <hpj@ximian.com>
- */
-
-#ifndef E_ALARM_LIST_H
-#define E_ALARM_LIST_H
-
-#include <gtk/gtktreemodel.h>
-#include <libecal/e-cal-component.h>
-
-G_BEGIN_DECLS
-
-#define E_TYPE_ALARM_LIST (e_alarm_list_get_type ())
-#define E_ALARM_LIST(obj) (GTK_CHECK_CAST ((obj), E_TYPE_ALARM_LIST, EAlarmList))
-#define E_ALARM_LIST_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_TYPE_ALARM_LIST, EAlarmListClass))
-#define E_IS_ALARM_LIST(obj) (GTK_CHECK_TYPE ((obj), E_TYPE_ALARM_LIST))
-#define E_IS_ALARM_LIST_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), E_TYPE_ALARM_LIST))
-#define E_ALARM_LIST_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), E_TYPE_ALARM_LIST, EAlarmListClass))
-
-typedef struct _EAlarmList EAlarmList;
-typedef struct _EAlarmListClass EAlarmListClass;
-
-typedef enum
-{
- E_ALARM_LIST_COLUMN_DESCRIPTION,
-
- E_ALARM_LIST_NUM_COLUMNS
-}
-EAlarmListColumnType;
-
-struct _EAlarmList
-{
- GObject parent;
-
- /* Private */
-
- gint stamp;
- GList *list;
-
- guint columns_dirty : 1;
-};
-
-struct _EAlarmListClass
-{
- GObjectClass parent_class;
-};
-
-GtkType e_alarm_list_get_type (void);
-EAlarmList *e_alarm_list_new (void);
-
-const ECalComponentAlarm *e_alarm_list_get_alarm (EAlarmList *alarm_list, GtkTreeIter *iter);
-void e_alarm_list_set_alarm (EAlarmList *alarm_list, GtkTreeIter *iter,
- const ECalComponentAlarm *datetime);
-void e_alarm_list_append (EAlarmList *alarm_list, GtkTreeIter *iter,
- const ECalComponentAlarm *datetime);
-void e_alarm_list_remove (EAlarmList *alarm_list, GtkTreeIter *iter);
-void e_alarm_list_clear (EAlarmList *alarm_list);
-
-G_END_DECLS
-
-#endif /* E_ALARM_LIST_H */
diff --git a/calendar/gui/e-cal-list-view-config.c b/calendar/gui/e-cal-list-view-config.c
deleted file mode 100644
index e7d82230df..0000000000
--- a/calendar/gui/e-cal-list-view-config.c
+++ /dev/null
@@ -1,247 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Author :
- * Rodrigo Moya <rodrigo@ximian.com>
- *
- * Copyright 2003, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#include "calendar-config.h"
-#include "e-cal-list-view-config.h"
-
-struct _ECalListViewConfigPrivate {
- ECalListView *view;
-
- GList *notifications;
-};
-
-static GObjectClass *parent_class = NULL;
-
-/* Property IDs */
-enum props {
- PROP_0,
- PROP_VIEW,
-};
-
-static void
-e_cal_list_view_config_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
-{
- ECalListViewConfig *view_config;
- ECalListViewConfigPrivate *priv;
-
- view_config = E_CAL_LIST_VIEW_CONFIG (object);
- priv = view_config->priv;
-
- switch (property_id) {
- case PROP_VIEW:
- e_cal_list_view_config_set_view (view_config, g_value_get_object (value));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
- break;
- }
-}
-
-static void
-e_cal_list_view_config_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
-{
- ECalListViewConfig *view_config;
- ECalListViewConfigPrivate *priv;
-
- view_config = E_CAL_LIST_VIEW_CONFIG (object);
- priv = view_config->priv;
-
- switch (property_id) {
- case PROP_VIEW:
- g_value_set_object (value, e_cal_list_view_config_get_view (view_config));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
- break;
- }
-}
-
-static void
-e_cal_list_view_config_dispose (GObject *object)
-{
- ECalListViewConfig *view_config = E_CAL_LIST_VIEW_CONFIG (object);
- ECalListViewConfigPrivate *priv;
-
- priv = view_config->priv;
-
- e_cal_list_view_config_set_view (view_config, NULL);
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-static void
-e_cal_list_view_config_finalize (GObject *object)
-{
- ECalListViewConfig *view_config = E_CAL_LIST_VIEW_CONFIG (object);
- ECalListViewConfigPrivate *priv;
-
- priv = view_config->priv;
-
- g_free (priv);
-
- if (G_OBJECT_CLASS (parent_class)->finalize)
- G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-static void
-e_cal_list_view_config_class_init (ECalListViewConfigClass *klass)
-{
- GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- GParamSpec *spec;
-
- parent_class = g_type_class_peek_parent (klass);
-
- /* Method override */
- gobject_class->set_property = e_cal_list_view_config_set_property;
- gobject_class->get_property = e_cal_list_view_config_get_property;
- gobject_class->dispose = e_cal_list_view_config_dispose;
- gobject_class->finalize = e_cal_list_view_config_finalize;
-
- spec = g_param_spec_object ("view", NULL, NULL, e_cal_list_view_get_type (),
- G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT);
- g_object_class_install_property (gobject_class, PROP_VIEW, spec);
-}
-
-static void
-e_cal_list_view_config_init (ECalListViewConfig *view_config, ECalListViewConfigClass *klass)
-{
- view_config->priv = g_new0 (ECalListViewConfigPrivate, 1);
-
-}
-
-E_MAKE_TYPE (e_cal_list_view_config, "ECalListViewConfig", ECalListViewConfig, e_cal_list_view_config_class_init,
- e_cal_list_view_config_init, G_TYPE_OBJECT);
-
-ECalListViewConfig *
-e_cal_list_view_config_new (ECalListView *list_view)
-{
- ECalListViewConfig *view_config;
-
- view_config = g_object_new (e_cal_list_view_config_get_type (), "view", list_view, NULL);
-
- return view_config;
-}
-
-ECalListView *
-e_cal_list_view_config_get_view (ECalListViewConfig *view_config)
-{
- ECalListViewConfigPrivate *priv;
-
- g_return_val_if_fail (view_config != NULL, NULL);
- g_return_val_if_fail (E_IS_CAL_LIST_VIEW_CONFIG (view_config), NULL);
-
- priv = view_config->priv;
-
- return priv->view;
-}
-
-static void
-set_timezone (ECalListView *list_view)
-{
- char *location;
- icaltimezone *zone;
-
- location = calendar_config_get_timezone ();
- zone = icaltimezone_get_builtin_timezone (location);
- if (!zone)
- zone = icaltimezone_get_utc_timezone ();
-
- e_calendar_view_set_timezone (E_CALENDAR_VIEW (list_view), zone);
-
- g_free (location);
-}
-
-static void
-timezone_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
-{
- ECalListViewConfig *view_config = data;
- ECalListViewConfigPrivate *priv;
-
- priv = view_config->priv;
-
- set_timezone (priv->view);
-}
-
-static void
-set_twentyfour_hour (ECalListView *list_view)
-{
- gboolean use_24_hour;
-
- use_24_hour = calendar_config_get_24_hour_format ();
-
- e_calendar_view_set_use_24_hour_format (E_CALENDAR_VIEW (list_view), use_24_hour);
-}
-
-static void
-twentyfour_hour_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
-{
- ECalListViewConfig *view_config = data;
- ECalListViewConfigPrivate *priv;
-
- priv = view_config->priv;
-
- set_twentyfour_hour (priv->view);
-}
-
-void
-e_cal_list_view_config_set_view (ECalListViewConfig *view_config, ECalListView *list_view)
-{
- ECalListViewConfigPrivate *priv;
- guint not;
- GList *l;
-
- g_return_if_fail (view_config != NULL);
- g_return_if_fail (E_IS_CAL_LIST_VIEW_CONFIG (view_config));
-
- priv = view_config->priv;
-
- if (priv->view) {
- g_object_unref (priv->view);
- priv->view = NULL;
- }
-
- for (l = priv->notifications; l; l = l->next)
- calendar_config_remove_notification (GPOINTER_TO_UINT (l->data));
-
- g_list_free (priv->notifications);
- priv->notifications = NULL;
-
- /* If the new view is NULL, return right now */
- if (!list_view)
- return;
-
- priv->view = g_object_ref (list_view);
-
- /* Time zone */
- set_timezone (list_view);
-
- not = calendar_config_add_notification_timezone (timezone_changed_cb, view_config);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
-
- /* 24 Hour format */
- set_twentyfour_hour (list_view);
-
- not = calendar_config_add_notification_24_hour_format (twentyfour_hour_changed_cb, view_config);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
-}
diff --git a/calendar/gui/e-cal-list-view-config.h b/calendar/gui/e-cal-list-view-config.h
deleted file mode 100644
index d2f87c36b3..0000000000
--- a/calendar/gui/e-cal-list-view-config.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Author :
- * JP Rosevear <jpr@ximian.com>
- *
- * Copyright 2003, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifndef _E_CAL_LIST_VIEW_CONFIG_H_
-#define _E_CAL_LIST_VIEW_CONFIG_H_
-
-#include "e-cal-list-view.h"
-
-G_BEGIN_DECLS
-
-#define E_CAL_LIST_VIEW_CONFIG(obj) GTK_CHECK_CAST (obj, e_cal_list_view_config_get_type (), ECalListViewConfig)
-#define E_CAL_LIST_VIEW_CONFIG_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, e_cal_list_view_config_get_type (), ECalListViewConfigClass)
-#define E_IS_CAL_LIST_VIEW_CONFIG(obj) GTK_CHECK_TYPE (obj, e_cal_list_view_config_get_type ())
-
-typedef struct _ECalListViewConfig ECalListViewConfig;
-typedef struct _ECalListViewConfigClass ECalListViewConfigClass;
-typedef struct _ECalListViewConfigPrivate ECalListViewConfigPrivate;
-
-struct _ECalListViewConfig {
- GObject parent;
-
- ECalListViewConfigPrivate *priv;
-};
-
-struct _ECalListViewConfigClass {
- GObjectClass parent_class;
-};
-
-GType e_cal_list_view_config_get_type (void);
-ECalListViewConfig *e_cal_list_view_config_new (ECalListView *list_view);
-ECalListView *e_cal_list_view_config_get_view (ECalListViewConfig *view_config);
-void e_cal_list_view_config_set_view (ECalListViewConfig *view_config, ECalListView *list_view);
-
-G_END_DECLS
-
-#endif
diff --git a/calendar/gui/e-cal-list-view.c b/calendar/gui/e-cal-list-view.c
deleted file mode 100644
index 74973e36f7..0000000000
--- a/calendar/gui/e-cal-list-view.c
+++ /dev/null
@@ -1,525 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Authors:
- * Hans Petter Jansson <hpj@ximian.com>
- *
- * Copyright 2003, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-/*
- * ECalListView - display calendar events in an ETable.
- */
-
-#include <config.h>
-
-#include "e-cal-list-view.h"
-#include "ea-calendar.h"
-
-#include <math.h>
-#include <time.h>
-#include <sys/stat.h>
-#include <gdk/gdkkeysyms.h>
-#include <gdk/gdkx.h>
-#include <gtk/gtkdnd.h>
-#include <gtk/gtkmain.h>
-#include <gtk/gtksignal.h>
-#include <gtk/gtkvscrollbar.h>
-#include <gtk/gtkwindow.h>
-#include <gal/widgets/e-gui-utils.h>
-#include <gal/util/e-util.h>
-#include <gal/e-table/e-table-memory-store.h>
-#include <gal/e-table/e-cell-checkbox.h>
-#include <gal/e-table/e-cell-toggle.h>
-#include <gal/e-table/e-cell-text.h>
-#include <gal/e-table/e-cell-combo.h>
-#include <gal/widgets/e-popup-menu.h>
-#include <widgets/misc/e-cell-date-edit.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnome/gnome-exec.h>
-#include <libgnome/gnome-util.h>
-#include <e-util/e-categories-config.h>
-#include <e-util/e-dialog-utils.h>
-
-#include <libecal/e-cal-time-util.h>
-#include "e-cal-model-calendar.h"
-#include "e-cell-date-edit-text.h"
-#include "dialogs/delete-comp.h"
-#include "dialogs/delete-error.h"
-#include "dialogs/send-comp.h"
-#include "dialogs/cancel-comp.h"
-#include "dialogs/recur-comp.h"
-#include "comp-util.h"
-#include "itip-utils.h"
-#include "calendar-commands.h"
-#include "calendar-config.h"
-#include "goto.h"
-#include "misc.h"
-
-static void e_cal_list_view_class_init (ECalListViewClass *class);
-static void e_cal_list_view_init (ECalListView *cal_list_view);
-static void e_cal_list_view_destroy (GtkObject *object);
-static void e_cal_list_view_update_query (ECalendarView *cal_view);
-
-static GList *e_cal_list_view_get_selected_events (ECalendarView *cal_view);
-static gboolean e_cal_list_view_get_visible_time_range (ECalendarView *cal_view, time_t *start_time,
- time_t *end_time);
-
-static gboolean e_cal_list_view_popup_menu (GtkWidget *widget);
-
-static void e_cal_list_view_show_popup_menu (ECalListView *cal_list_view, gint row,
- GdkEvent *gdk_event);
-static gboolean e_cal_list_view_on_table_right_click (GtkWidget *table, gint row, gint col,
- GdkEvent *event, gpointer data);
-
-static GtkTableClass *parent_class; /* Should be ECalendarViewClass? */
-
-E_MAKE_TYPE (e_cal_list_view, "ECalListView", ECalListView, e_cal_list_view_class_init,
- e_cal_list_view_init, e_calendar_view_get_type ());
-
-static void
-e_cal_list_view_class_init (ECalListViewClass *class)
-{
- GtkObjectClass *object_class;
- GtkWidgetClass *widget_class;
- ECalendarViewClass *view_class;
-
- parent_class = g_type_class_peek_parent (class);
- object_class = (GtkObjectClass *) class;
- widget_class = (GtkWidgetClass *) class;
- view_class = (ECalendarViewClass *) class;
-
- /* Method override */
- object_class->destroy = e_cal_list_view_destroy;
-
- widget_class->popup_menu = e_cal_list_view_popup_menu;
-
- view_class->get_selected_events = e_cal_list_view_get_selected_events;
- view_class->get_visible_time_range = e_cal_list_view_get_visible_time_range;
-
- view_class->update_query = e_cal_list_view_update_query;
-}
-
-static gint
-date_compare_cb (gconstpointer a, gconstpointer b)
-{
- ECellDateEditValue *dv1 = (ECellDateEditValue *) a;
- ECellDateEditValue *dv2 = (ECellDateEditValue *) b;
- struct icaltimetype tt;
-
- /* First check if either is NULL. NULL dates sort last. */
- if (!dv1 || !dv2) {
- if (dv1 == dv2)
- return 0;
- else if (dv1)
- return -1;
- else
- return 1;
- }
-
- /* Copy the 2nd value and convert it to the same timezone as the
- first. */
- tt = dv2->tt;
-
- icaltimezone_convert_time (&tt, dv2->zone, dv1->zone);
-
- /* Now we can compare them. */
-
- return icaltime_compare (dv1->tt, tt);
-}
-
-static void
-e_cal_list_view_init (ECalListView *cal_list_view)
-{
- cal_list_view->query = NULL;
- cal_list_view->table_scrolled = NULL;
- cal_list_view->cursor_event = NULL;
- cal_list_view->set_table_id = 0;
-}
-
-/* Returns the current time, for the ECellDateEdit items. */
-static struct tm
-get_current_time_cb (ECellDateEdit *ecde, gpointer data)
-{
- ECalListView *cal_list_view = data;
- icaltimezone *zone;
- struct tm tmp_tm = { 0 };
- struct icaltimetype tt;
-
- zone = e_calendar_view_get_timezone (E_CALENDAR_VIEW (cal_list_view));
- tt = icaltime_from_timet_with_zone (time (NULL), FALSE, zone);
-
- /* Now copy it to the struct tm and return it. */
- tmp_tm.tm_year = tt.year - 1900;
- tmp_tm.tm_mon = tt.month - 1;
- tmp_tm.tm_mday = tt.day;
- tmp_tm.tm_hour = tt.hour;
- tmp_tm.tm_min = tt.minute;
- tmp_tm.tm_sec = tt.second;
- tmp_tm.tm_isdst = -1;
-
- return tmp_tm;
-}
-
-static void
-load_table_state (ECalListView *cal_list_view)
-{
- struct stat st;
-
- if (!cal_list_view->table_state_path)
- return;
-
- if (stat (cal_list_view->table_state_path, &st) == 0 && st.st_size > 0 && S_ISREG (st.st_mode)) {
- e_table_load_state (e_table_scrolled_get_table (cal_list_view->table_scrolled),
- cal_list_view->table_state_path);
- }
-}
-
-static void
-save_table_state (ECalListView *cal_list_view)
-{
- if (!cal_list_view->table_state_path)
- return;
-
- e_table_save_state (e_table_scrolled_get_table (cal_list_view->table_scrolled),
- cal_list_view->table_state_path);
-}
-
-static void
-setup_e_table (ECalListView *cal_list_view)
-{
- ECalModelCalendar *model;
- ETableExtras *extras;
- GList *strings;
- ECell *cell, *popup_cell;
- GnomeCanvas *canvas;
- GtkStyle *style;
-
- model = E_CAL_MODEL_CALENDAR (e_calendar_view_get_model (E_CALENDAR_VIEW (cal_list_view)));
-
- if (cal_list_view->table_scrolled) {
- save_table_state (cal_list_view);
- gtk_widget_destroy (GTK_WIDGET (cal_list_view->table_scrolled));
- }
-
- /* Create the header columns */
-
- extras = e_table_extras_new();
-
- /* Normal string fields */
-
- cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
- g_object_set (G_OBJECT (cell),
- "bg_color_column", E_CAL_MODEL_FIELD_COLOR,
- NULL);
-
- e_table_extras_add_cell (extras, "calstring", cell);
-
- /* Date fields */
-
- cell = e_cell_date_edit_text_new (NULL, GTK_JUSTIFY_LEFT);
- g_object_set (G_OBJECT (cell),
- "bg_color_column", E_CAL_MODEL_FIELD_COLOR,
- NULL);
-
- popup_cell = e_cell_date_edit_new ();
- e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
- g_object_unref (cell);
- e_table_extras_add_cell (extras, "dateedit", popup_cell);
- cal_list_view->dates_cell = E_CELL_DATE_EDIT (popup_cell);
-
- e_cell_date_edit_set_get_time_callback (E_CELL_DATE_EDIT (popup_cell),
- get_current_time_cb,
- cal_list_view, NULL);
-
- /* Combo fields */
-
- cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
- g_object_set (G_OBJECT (cell),
- "bg_color_column", E_CAL_MODEL_FIELD_COLOR,
- "editable", FALSE,
- NULL);
-
- popup_cell = e_cell_combo_new ();
- e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
- g_object_unref (cell);
-
- strings = NULL;
- strings = g_list_append (strings, (char*) _("Public"));
- strings = g_list_append (strings, (char*) _("Private"));
- strings = g_list_append (strings, (char*) _("Confidential"));
- e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell),
- strings);
-
- e_table_extras_add_cell (extras, "classification", popup_cell);
-
- /* Sorting */
-
- e_table_extras_add_compare (extras, "date-compare",
- date_compare_cb);
-
- /* Create table view */
-
- cal_list_view->table_scrolled = E_TABLE_SCROLLED (
- e_table_scrolled_new_from_spec_file (E_TABLE_MODEL (model),
- extras,
- EVOLUTION_ETSPECDIR "/e-cal-list-view.etspec",
- NULL));
-
- /* Make sure text is readable on top of our color coding */
-
- canvas = GNOME_CANVAS (e_table_scrolled_get_table (cal_list_view->table_scrolled)->table_canvas);
- style = gtk_widget_get_style (GTK_WIDGET (canvas));
-
- style->fg [GTK_STATE_SELECTED] = style->text [GTK_STATE_NORMAL];
- style->fg [GTK_STATE_ACTIVE] = style->text [GTK_STATE_NORMAL];
- gtk_widget_set_style (GTK_WIDGET (canvas), style);
-
- /* Load state, if possible */
-
- load_table_state (cal_list_view);
-
- /* Connect signals */
-
- g_signal_connect (e_table_scrolled_get_table (cal_list_view->table_scrolled),
- "right-click", G_CALLBACK (e_cal_list_view_on_table_right_click), cal_list_view);
-
- /* Attach and show widget */
-
- gtk_table_attach (GTK_TABLE (cal_list_view), GTK_WIDGET (cal_list_view->table_scrolled),
- 0, 2, 0, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 1, 1);
- gtk_widget_show (GTK_WIDGET (cal_list_view->table_scrolled));
-}
-
-GtkWidget *
-e_cal_list_view_construct (ECalListView *cal_list_view, const gchar *table_state_path)
-{
- if (table_state_path)
- cal_list_view->table_state_path = g_strdup (table_state_path);
- else
- cal_list_view->table_state_path = NULL;
-
- setup_e_table (cal_list_view);
-
- return GTK_WIDGET (cal_list_view);
-}
-
-/**
- * e_cal_list_view_new:
- * @Returns: a new #ECalListView.
- *
- * Creates a new #ECalListView.
- **/
-GtkWidget *
-e_cal_list_view_new (const gchar *table_state_path)
-{
- ECalListView *cal_list_view;
- ECalModel *model;
-
- model = E_CAL_MODEL (e_cal_model_calendar_new ());
-
- cal_list_view = g_object_new (e_cal_list_view_get_type (), "model", model, NULL);
- if (!e_cal_list_view_construct (cal_list_view, table_state_path)) {
- g_message (G_STRLOC ": Could not construct the calendar list GUI");
- g_object_unref (cal_list_view);
- return NULL;
- }
-
- g_object_unref (model);
-
- return GTK_WIDGET (cal_list_view);
-}
-
-static void
-e_cal_list_view_destroy (GtkObject *object)
-{
- ECalListView *cal_list_view;
-
- cal_list_view = E_CAL_LIST_VIEW (object);
-
- if (cal_list_view->query) {
- g_signal_handlers_disconnect_matched (cal_list_view->query, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, cal_list_view);
- g_object_unref (cal_list_view->query);
- cal_list_view->query = NULL;
- }
-
- if (cal_list_view->set_table_id) {
- g_source_remove (cal_list_view->set_table_id);
- cal_list_view->set_table_id = 0;
- }
-
- if (cal_list_view->table_state_path) {
- save_table_state (cal_list_view);
- g_free (cal_list_view->table_state_path);
- cal_list_view->table_state_path = NULL;
- }
-
- if (cal_list_view->cursor_event) {
- g_free (cal_list_view->cursor_event);
- cal_list_view->cursor_event = NULL;
- }
-
- if (cal_list_view->table_scrolled) {
- gtk_widget_destroy (GTK_WIDGET (cal_list_view->table_scrolled));
- cal_list_view->table_scrolled = NULL;
- }
-
- GTK_OBJECT_CLASS (parent_class)->destroy (object);
-}
-
-static gboolean
-setup_e_table_cb (gpointer data)
-{
- setup_e_table (E_CAL_LIST_VIEW (data));
- E_CAL_LIST_VIEW (data)->set_table_id = 0;
- return FALSE;
-}
-
-static void
-e_cal_list_view_update_query (ECalendarView *cal_list_view)
-{
- e_calendar_view_set_status_message (E_CALENDAR_VIEW (cal_list_view), _("Searching"));
-
- if (!E_CAL_LIST_VIEW (cal_list_view)->set_table_id)
- E_CAL_LIST_VIEW (cal_list_view)->set_table_id =
- g_idle_add (setup_e_table_cb, cal_list_view);
-
- e_calendar_view_set_status_message (E_CALENDAR_VIEW (cal_list_view), NULL);
-}
-
-static void
-e_cal_list_view_show_popup_menu (ECalListView *cal_list_view, gint row, GdkEvent *gdk_event)
-{
- GtkMenu *popup;
-
- popup = e_calendar_view_create_popup_menu (E_CALENDAR_VIEW (cal_list_view));
- e_popup_menu (popup, gdk_event);
-}
-
-static gboolean
-e_cal_list_view_popup_menu (GtkWidget *widget)
-{
- ECalListView *cal_list_view = E_CAL_LIST_VIEW (widget);
-
- e_cal_list_view_show_popup_menu (cal_list_view, -1, NULL);
- return TRUE;
-}
-
-static gboolean
-e_cal_list_view_on_table_right_click (GtkWidget *table, gint row, gint col, GdkEvent *event,
- gpointer data)
-{
- ECalListView *cal_list_view = E_CAL_LIST_VIEW (data);
-
- e_cal_list_view_show_popup_menu (cal_list_view, row, event);
- return TRUE;
-}
-
-static GList *
-e_cal_list_view_get_selected_events (ECalendarView *cal_view)
-{
- GList *event_list = NULL;
- gint cursor_row;
-
- if (E_CAL_LIST_VIEW (cal_view)->cursor_event) {
- g_free (E_CAL_LIST_VIEW (cal_view)->cursor_event);
- E_CAL_LIST_VIEW (cal_view)->cursor_event = NULL;
- }
-
- cursor_row = e_table_get_cursor_row (e_table_scrolled_get_table (E_CAL_LIST_VIEW (cal_view)->table_scrolled));
-
- if (cursor_row >= 0) {
- ECalendarViewEvent *event;
-
- event = E_CAL_LIST_VIEW (cal_view)->cursor_event = g_new0 (ECalendarViewEvent, 1);
- event->comp_data =
- e_cal_model_get_component_at (e_calendar_view_get_model (cal_view),
- cursor_row);
- event_list = g_list_prepend (event_list, event);
- }
-
- return event_list;
-}
-
-static void
-adjust_range (icaltimetype icaltime, time_t *earliest, time_t *latest, gboolean *set)
-{
- time_t t;
-
- if (!icaltime_is_valid_time (icaltime))
- return;
-
- t = icaltime_as_timet (icaltime);
- *earliest = MIN (*earliest, t);
- *latest = MAX (*latest, t);
-
- *set = TRUE;
-}
-
-/* NOTE: Time use for this function increases linearly with number of events. This is not
- * ideal, since it's used in a couple of places. We could probably be smarter about it,
- * and use do it less frequently... */
-static gboolean
-e_cal_list_view_get_visible_time_range (ECalendarView *cal_view, time_t *start_time, time_t *end_time)
-{
- time_t earliest = G_MAXINT, latest = 0;
- gboolean set = FALSE;
- gint n_rows, i;
-
- n_rows = e_table_model_row_count (E_TABLE_MODEL (e_calendar_view_get_model (cal_view)));
-
- for (i = 0; i < n_rows; i++) {
- ECalModelComponent *comp;
- icalcomponent *icalcomp;
-
- comp = e_cal_model_get_component_at (e_calendar_view_get_model (cal_view), i);
- if (!comp)
- continue;
-
- icalcomp = comp->icalcomp;
- if (!icalcomp)
- continue;
-
- adjust_range (icalcomponent_get_dtstart (icalcomp), &earliest, &latest, &set);
- adjust_range (icalcomponent_get_dtend (icalcomp), &earliest, &latest, &set);
- }
-
- if (set) {
- *start_time = earliest;
- *end_time = latest;
- return TRUE;
- }
-
- return FALSE;
-}
-
-gboolean
-e_cal_list_view_get_range_shown (ECalListView *cal_list_view, GDate *start_date, gint *days_shown)
-{
- time_t first, last;
- GDate end_date;
-
- if (!e_cal_list_view_get_visible_time_range (E_CALENDAR_VIEW (cal_list_view), &first, &last))
- return FALSE;
-
- time_to_gdate_with_zone (start_date, first, e_calendar_view_get_timezone (E_CALENDAR_VIEW (cal_list_view)));
- time_to_gdate_with_zone (&end_date, last, e_calendar_view_get_timezone (E_CALENDAR_VIEW (cal_list_view)));
-
- *days_shown = g_date_days_between (start_date, &end_date);
- return TRUE;
-}
diff --git a/calendar/gui/e-cal-list-view.etspec b/calendar/gui/e-cal-list-view.etspec
deleted file mode 100644
index e5a2cc0b6d..0000000000
--- a/calendar/gui/e-cal-list-view.etspec
+++ /dev/null
@@ -1,17 +0,0 @@
-<ETableSpecification draw-grid="false" alternating-row-colors="true">
- <ETableColumn model_col="0" _title="Categories" expansion="1.0" minimum_width="10" resizable="true" cell="calstring" compare="string"/>
- <ETableColumn model_col="1" _title="Classification" expansion="1.0" minimum_width="10" resizable="true" cell="classification" compare="string" priority="-1"/>
- <ETableColumn model_col="2" _title="color" cell="calcolor" priority="-4"/>
- <ETableColumn model_col="3" _title="component" cell="calcomp" priority="-4"/>
- <ETableColumn model_col="4" _title="Description" expansion="2.0" minimum_width="10" resizable="true" cell="calstring" compare="string" priority="-1"/>
- <ETableColumn model_col="5" _title="Start Date" expansion="2.0" minimum_width="10" resizable="true" cell="dateedit" compare="date-compare" priority="-2"/>
- <ETableColumn model_col="8" _title="Summary" expansion="3.0" minimum_width="10" resizable="true" cell="calstring" compare="string" priority="10"/>
-
- <ETableState>
- <column source="4"/>
- <column source="3"/>
- <column source="1"/>
- <column source="0"/>
- <grouping></grouping>
- </ETableState>
-</ETableSpecification>
diff --git a/calendar/gui/e-cal-list-view.h b/calendar/gui/e-cal-list-view.h
deleted file mode 100644
index 08d5b7c0e8..0000000000
--- a/calendar/gui/e-cal-list-view.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Authors:
- * Hans Petter Jansson <hpj@ximian.com>
- *
- * Copyright 2003, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-#ifndef _E_CAL_LIST_VIEW_H_
-#define _E_CAL_LIST_VIEW_H_
-
-#include <time.h>
-#include <gtk/gtktable.h>
-#include <gtk/gtktooltips.h>
-#include <gal/widgets/e-popup-menu.h>
-
-#include "e-cal-view.h"
-#include "gnome-cal.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-/*
- * ECalListView - displays calendar events in an ETable.
- */
-
-#define E_CAL_LIST_VIEW(obj) GTK_CHECK_CAST (obj, e_cal_list_view_get_type (), ECalListView)
-#define E_CAL_LIST_VIEW_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, e_cal_list_view_get_type (), ECalListViewClass)
-#define E_IS_CAL_LIST_VIEW(obj) GTK_CHECK_TYPE (obj, e_cal_list_view_get_type ())
-
-
-typedef struct _ECalListView ECalListView;
-typedef struct _ECalListViewClass ECalListViewClass;
-
-struct _ECalListView
-{
- ECalendarView cal_view;
-
- /* The main display table */
- ETableScrolled *table_scrolled;
-
- /* The path to the table's state file */
- gchar *table_state_path;
-
- /* S-expression for query and the query object */
- ECalView *query;
-
- /* The default category for new events */
- gchar *default_category;
-
- /* Date editing cell */
- ECellDateEdit *dates_cell;
-
- /* The last ECalendarViewEvent we returned from e_cal_list_view_get_selected_events(), to be freed */
- ECalendarViewEvent *cursor_event;
-
- /* Idle handler ID for setting a new ETableModel */
- gint set_table_id;
-};
-
-struct _ECalListViewClass
-{
- ECalendarViewClass parent_class;
-};
-
-
-GtkType e_cal_list_view_get_type (void);
-GtkWidget *e_cal_list_view_construct (ECalListView *cal_list_view, const gchar *table_state_path);
-
-GtkWidget *e_cal_list_view_new (const gchar *table_state_path);
-
-void e_cal_list_view_set_query (ECalListView *cal_list_view, const gchar *sexp);
-void e_cal_list_view_set_default_category (ECalListView *cal_list_view, const gchar *category);
-gboolean e_cal_list_view_get_range_shown (ECalListView *cal_list_view, GDate *start_date,
- gint *days_shown);
-
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _E_CAL_LIST_VIEW_H_ */
diff --git a/calendar/gui/e-cal-model-calendar.c b/calendar/gui/e-cal-model-calendar.c
deleted file mode 100644
index 9fd2db7544..0000000000
--- a/calendar/gui/e-cal-model-calendar.c
+++ /dev/null
@@ -1,465 +0,0 @@
-/* Evolution calendar - Data model for ETable
- *
- * Copyright (C) 2000 Ximian, Inc.
- * Copyright (C) 2000 Ximian, Inc.
- *
- * Authors: Rodrigo Moya <rodrigo@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-#include <string.h>
-#include <libgnome/gnome-i18n.h>
-#include <gal/util/e-util.h>
-#include "e-cal-model-calendar.h"
-#include "e-cell-date-edit-text.h"
-#include "misc.h"
-
-struct _ECalModelCalendarPrivate {
-};
-
-static void ecmc_class_init (ECalModelCalendarClass *klass);
-static void ecmc_init (ECalModelCalendar *model, ECalModelCalendarClass *klass);
-static void ecmc_finalize (GObject *object);
-static int ecmc_column_count (ETableModel *etm);
-static void *ecmc_value_at (ETableModel *etm, int col, int row);
-static void ecmc_set_value_at (ETableModel *etm, int col, int row, const void *value);
-static gboolean ecmc_is_cell_editable (ETableModel *etm, int col, int row);
-static void *ecmc_duplicate_value (ETableModel *etm, int col, const void *value);
-static void ecmc_free_value (ETableModel *etm, int col, void *value);
-static void *ecmc_initialize_value (ETableModel *etm, int col);
-static gboolean ecmc_value_is_empty (ETableModel *etm, int col, const void *value);
-static char *ecmc_value_to_string (ETableModel *etm, int col, const void *value);
-
-static void ecmc_fill_component_from_model (ECalModel *model, ECalModelComponent *comp_data,
- ETableModel *source_model, gint row);
-
-static GObjectClass *parent_class = NULL;
-
-E_MAKE_TYPE (e_cal_model_calendar, "ECalModelCalendar", ECalModelCalendar, ecmc_class_init,
- ecmc_init, E_TYPE_CAL_MODEL);
-
-static void
-ecmc_class_init (ECalModelCalendarClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- ETableModelClass *etm_class = E_TABLE_MODEL_CLASS (klass);
- ECalModelClass *model_class = E_CAL_MODEL_CLASS (klass);
-
- parent_class = g_type_class_peek_parent (klass);
-
- object_class->finalize = ecmc_finalize;
-
- etm_class->column_count = ecmc_column_count;
- etm_class->value_at = ecmc_value_at;
- etm_class->set_value_at = ecmc_set_value_at;
- etm_class->is_cell_editable = ecmc_is_cell_editable;
- etm_class->duplicate_value = ecmc_duplicate_value;
- etm_class->free_value = ecmc_free_value;
- etm_class->initialize_value = ecmc_initialize_value;
- etm_class->value_is_empty = ecmc_value_is_empty;
- etm_class->value_to_string = ecmc_value_to_string;
-
- model_class->fill_component_from_model = ecmc_fill_component_from_model;
-}
-
-static void
-ecmc_init (ECalModelCalendar *model, ECalModelCalendarClass *klass)
-{
- ECalModelCalendarPrivate *priv;
-
- priv = g_new0 (ECalModelCalendarPrivate, 1);
- model->priv = priv;
-
- e_cal_model_set_component_kind (E_CAL_MODEL (model), ICAL_VEVENT_COMPONENT);
-}
-
-static void
-ecmc_finalize (GObject *object)
-{
- ECalModelCalendarPrivate *priv;
- ECalModelCalendar *model = (ECalModelCalendar *) object;
-
- g_return_if_fail (E_IS_CAL_MODEL_CALENDAR (model));
-
- priv = model->priv;
- if (priv) {
- g_free (priv);
- model->priv = NULL;
- }
-
- if (parent_class->finalize)
- parent_class->finalize (object);
-}
-
-/* ETableModel methods */
-static int
-ecmc_column_count (ETableModel *etm)
-{
- return E_CAL_MODEL_CALENDAR_FIELD_LAST;
-}
-
-static ECellDateEditValue *
-get_dtend (ECalModelComponent *comp_data)
-{
- struct icaltimetype tt_end;
-
- if (!comp_data->dtend) {
- icaltimezone *zone;
-
- tt_end = icalcomponent_get_dtend (comp_data->icalcomp);
- if (!icaltime_is_valid_time (tt_end))
- return NULL;
-
- comp_data->dtend = g_new0 (ECellDateEditValue, 1);
- comp_data->dtend->tt = tt_end;
-
- if (icaltime_get_tzid (tt_end)
- && e_cal_get_timezone (comp_data->client, icaltime_get_tzid (tt_end), &zone, NULL))
- comp_data->dtend->zone = zone;
- else
- comp_data->dtend->zone = NULL;
- }
-
- return comp_data->dtend;
-}
-
-static void *
-get_location (ECalModelComponent *comp_data)
-{
- icalproperty *prop;
-
- prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_LOCATION_PROPERTY);
- if (prop)
- return (void *) icalproperty_get_location (prop);
-
- return NULL;
-}
-
-static void *
-get_transparency (ECalModelComponent *comp_data)
-{
- icalproperty *prop;
-
- prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_TRANSP_PROPERTY);
- if (prop) {
- icalproperty_transp transp;
-
- transp = icalproperty_get_transp (prop);
- if (transp == ICAL_TRANSP_TRANSPARENT ||
- transp == ICAL_TRANSP_TRANSPARENTNOCONFLICT)
- return _("Free");
- else if (transp == ICAL_TRANSP_OPAQUE ||
- transp == ICAL_TRANSP_OPAQUENOCONFLICT)
- return _("Busy");
- }
-
- return NULL;
-}
-
-static void *
-ecmc_value_at (ETableModel *etm, int col, int row)
-{
- ECalModelComponent *comp_data;
- ECalModelCalendarPrivate *priv;
- ECalModelCalendar *model = (ECalModelCalendar *) etm;
-
- g_return_val_if_fail (E_IS_CAL_MODEL_CALENDAR (model), NULL);
-
- priv = model->priv;
-
- g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_CALENDAR_FIELD_LAST, NULL);
- g_return_val_if_fail (row >= 0 && row < e_table_model_row_count (etm), NULL);
-
- if (col < E_CAL_MODEL_FIELD_LAST)
- return E_TABLE_MODEL_CLASS (parent_class)->value_at (etm, col, row);
-
- comp_data = e_cal_model_get_component_at (E_CAL_MODEL (model), row);
- if (!comp_data)
- return "";
-
- switch (col) {
- case E_CAL_MODEL_CALENDAR_FIELD_DTEND :
- return get_dtend (comp_data);
- case E_CAL_MODEL_CALENDAR_FIELD_LOCATION :
- return get_location (comp_data);
- case E_CAL_MODEL_CALENDAR_FIELD_TRANSPARENCY :
- return get_transparency (comp_data);
- }
-
- return "";
-}
-
-static void
-set_dtend (ECalModelComponent *comp_data, const void *value)
-{
- icalproperty *prop;
- ECellDateEditValue *dv = (ECellDateEditValue *) value;
-
- prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_DTEND_PROPERTY);
- if (!dv) {
- if (prop) {
- icalcomponent_remove_property (comp_data->icalcomp, prop);
- icalproperty_free (prop);
- }
- } else
- icalcomponent_set_dtend (comp_data->icalcomp, dv->tt);
-}
-
-static void
-set_location (ECalModelComponent *comp_data, const void *value)
-{
- icalproperty *prop;
-
- prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_LOCATION_PROPERTY);
-
- if (string_is_empty (value)) {
- if (prop) {
- icalcomponent_remove_property (comp_data->icalcomp, prop);
- icalproperty_free (prop);
- }
- } else {
- if (prop)
- icalproperty_set_location (prop, (const char *) value);
- else {
- prop = icalproperty_new_location ((const char *) value);
- icalcomponent_add_property (comp_data->icalcomp, prop);
- }
- }
-}
-
-static void
-set_transparency (ECalModelComponent *comp_data, const void *value)
-{
- icalproperty *prop;
-
- prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_TRANSP_PROPERTY);
-
- if (string_is_empty (value)) {
- if (prop) {
- icalcomponent_remove_property (comp_data->icalcomp, prop);
- icalproperty_free (prop);
- }
- } else {
- icalproperty_transp transp;
-
- if (!strcasecmp (value, "FREE"))
- transp = ICAL_TRANSP_TRANSPARENT;
- else if (!strcasecmp (value, "OPAQUE"))
- transp = ICAL_TRANSP_OPAQUE;
- else {
- if (prop) {
- icalcomponent_remove_property (comp_data->icalcomp, prop);
- icalproperty_free (prop);
- }
-
- return;
- }
-
- if (prop)
- icalproperty_set_transp (prop, transp);
- else {
- prop = icalproperty_new_transp (transp);
- icalcomponent_add_property (comp_data->icalcomp, prop);
- }
- }
-}
-
-static void
-ecmc_set_value_at (ETableModel *etm, int col, int row, const void *value)
-{
- ECalModelComponent *comp_data;
- ECalModelCalendar *model = (ECalModelCalendar *) etm;
-
- g_return_if_fail (E_IS_CAL_MODEL_CALENDAR (model));
- g_return_if_fail (col >= 0 && col < E_CAL_MODEL_CALENDAR_FIELD_LAST);
- g_return_if_fail (row >= 0 && row < e_table_model_row_count (etm));
-
- if (col < E_CAL_MODEL_FIELD_LAST) {
- E_TABLE_MODEL_CLASS (parent_class)->set_value_at (etm, col, row, value);
- return;
- }
-
- comp_data = e_cal_model_get_component_at (E_CAL_MODEL (model), row);
- if (!comp_data)
- return;
-
- switch (col) {
- case E_CAL_MODEL_CALENDAR_FIELD_DTEND :
- set_dtend (comp_data, value);
- break;
- case E_CAL_MODEL_CALENDAR_FIELD_LOCATION :
- set_location (comp_data, value);
- break;
- case E_CAL_MODEL_CALENDAR_FIELD_TRANSPARENCY :
- set_transparency (comp_data, value);
- break;
- }
-
- /* FIXME ask about mod type */
- if (!e_cal_modify_object (comp_data->client, comp_data->icalcomp, CALOBJ_MOD_ALL, NULL)) {
- g_warning (G_STRLOC ": Could not modify the object!");
-
- /* FIXME Show error dialog */
- }
-}
-
-static gboolean
-ecmc_is_cell_editable (ETableModel *etm, int col, int row)
-{
- ECalModelCalendar *model = (ECalModelCalendar *) etm;
-
- g_return_val_if_fail (E_IS_CAL_MODEL_CALENDAR (model), FALSE);
- g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_CALENDAR_FIELD_LAST, FALSE);
-
- /* FIXME: We can't check this as 'click-to-add' passes row 0. */
- /* g_return_val_if_fail (row >= 0 && row < e_table_model_get_row_count (etm), FALSE); */
-
- if (col < E_CAL_MODEL_FIELD_LAST)
- return E_TABLE_MODEL_CLASS (parent_class)->is_cell_editable (etm, col, row);
-
- switch (col) {
- case E_CAL_MODEL_CALENDAR_FIELD_DTEND :
- case E_CAL_MODEL_CALENDAR_FIELD_LOCATION :
- case E_CAL_MODEL_CALENDAR_FIELD_TRANSPARENCY :
- return TRUE;
- }
-
- return FALSE;
-}
-
-static void *
-ecmc_duplicate_value (ETableModel *etm, int col, const void *value)
-{
- g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_CALENDAR_FIELD_LAST, NULL);
-
- if (col < E_CAL_MODEL_FIELD_LAST)
- return E_TABLE_MODEL_CLASS (parent_class)->duplicate_value (etm, col, value);
-
- switch (col) {
- case E_CAL_MODEL_CALENDAR_FIELD_DTEND :
- /* FIXME */
- break;
- case E_CAL_MODEL_CALENDAR_FIELD_LOCATION :
- case E_CAL_MODEL_CALENDAR_FIELD_TRANSPARENCY :
- return g_strdup (value);
- }
-
- return NULL;
-}
-
-static void
-ecmc_free_value (ETableModel *etm, int col, void *value)
-{
- g_return_if_fail (col >= 0 && col < E_CAL_MODEL_CALENDAR_FIELD_LAST);
-
- if (col < E_CAL_MODEL_FIELD_LAST) {
- E_TABLE_MODEL_CLASS (parent_class)->free_value (etm, col, value);
- return;
- }
-
- switch (col) {
- case E_CAL_MODEL_CALENDAR_FIELD_DTEND :
- case E_CAL_MODEL_CALENDAR_FIELD_LOCATION :
- case E_CAL_MODEL_CALENDAR_FIELD_TRANSPARENCY :
- if (value)
- g_free (value);
- break;
- }
-}
-
-static void *
-ecmc_initialize_value (ETableModel *etm, int col)
-{
- g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_CALENDAR_FIELD_LAST, NULL);
-
- if (col < E_CAL_MODEL_FIELD_LAST)
- return E_TABLE_MODEL_CLASS (parent_class)->initialize_value (etm, col);
-
- switch (col) {
- case E_CAL_MODEL_CALENDAR_FIELD_DTEND :
- return NULL;
- case E_CAL_MODEL_CALENDAR_FIELD_LOCATION :
- case E_CAL_MODEL_CALENDAR_FIELD_TRANSPARENCY :
- return g_strdup ("");
- }
-
- return NULL;
-}
-
-static gboolean
-ecmc_value_is_empty (ETableModel *etm, int col, const void *value)
-{
- g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_CALENDAR_FIELD_LAST, TRUE);
-
- if (col < E_CAL_MODEL_FIELD_LAST)
- return E_TABLE_MODEL_CLASS (parent_class)->value_is_empty (etm, col, value);
-
- switch (col) {
- case E_CAL_MODEL_CALENDAR_FIELD_DTEND :
- return value ? FALSE : TRUE;
- case E_CAL_MODEL_CALENDAR_FIELD_LOCATION :
- case E_CAL_MODEL_CALENDAR_FIELD_TRANSPARENCY :
- return string_is_empty (value);
- }
-
- return TRUE;
-}
-
-static char *
-ecmc_value_to_string (ETableModel *etm, int col, const void *value)
-{
- g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_CALENDAR_FIELD_LAST, NULL);
-
- if (col < E_CAL_MODEL_FIELD_LAST)
- return E_TABLE_MODEL_CLASS (parent_class)->value_to_string (etm, col, value);
-
- switch (col) {
- case E_CAL_MODEL_CALENDAR_FIELD_DTEND :
- return e_cal_model_date_value_to_string (E_CAL_MODEL (etm), value);
- case E_CAL_MODEL_CALENDAR_FIELD_LOCATION :
- case E_CAL_MODEL_CALENDAR_FIELD_TRANSPARENCY :
- return g_strdup (value);
- }
-
- return NULL;
-}
-
-/* ECalModel class methods */
-
-static void
-ecmc_fill_component_from_model (ECalModel *model, ECalModelComponent *comp_data,
- ETableModel *source_model, gint row)
-{
- g_return_if_fail (E_IS_CAL_MODEL_CALENDAR (model));
- g_return_if_fail (comp_data != NULL);
- g_return_if_fail (E_IS_TABLE_MODEL (source_model));
-
- set_dtend (comp_data,
- e_table_model_value_at (source_model, E_CAL_MODEL_CALENDAR_FIELD_DTEND, row));
- set_location (comp_data,
- e_table_model_value_at (source_model, E_CAL_MODEL_CALENDAR_FIELD_LOCATION, row));
- set_transparency (comp_data,
- e_table_model_value_at (source_model, E_CAL_MODEL_CALENDAR_FIELD_TRANSPARENCY, row));
-}
-
-/**
- * e_cal_model_calendar_new
- */
-ECalModelCalendar *
-e_cal_model_calendar_new (void)
-{
- return g_object_new (E_TYPE_CAL_MODEL_CALENDAR, NULL);
-}
diff --git a/calendar/gui/e-cal-model-calendar.h b/calendar/gui/e-cal-model-calendar.h
deleted file mode 100644
index 450871c88f..0000000000
--- a/calendar/gui/e-cal-model-calendar.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* Evolution calendar - Data model for ETable
- *
- * Copyright (C) 2000 Ximian, Inc.
- * Copyright (C) 2000 Ximian, Inc.
- *
- * Authors: Rodrigo Moya <rodrigo@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef E_CAL_MODEL_CALENDAR_H
-#define E_CAL_MODEL_CALENDAR_H
-
-#include "e-cal-model.h"
-
-G_BEGIN_DECLS
-
-#define E_TYPE_CAL_MODEL_CALENDAR (e_cal_model_calendar_get_type ())
-#define E_CAL_MODEL_CALENDAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_CAL_MODEL_CALENDAR, ECalModelCalendar))
-#define E_CAL_MODEL_CALENDAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_CAL_MODEL_CALENDAR, ECalModelCalendarClass))
-#define E_IS_CAL_MODEL_CALENDAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_CAL_MODEL_CALENDAR))
-#define E_IS_CAL_MODEL_CALENDAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_CAL_MODEL_CALENDAR))
-
-typedef struct _ECalModelCalendarPrivate ECalModelCalendarPrivate;
-
-typedef enum {
- /* If you add new items here or reorder them, you have to update the
- .etspec files for the tables using this model */
- E_CAL_MODEL_CALENDAR_FIELD_DTEND = E_CAL_MODEL_FIELD_LAST,
- E_CAL_MODEL_CALENDAR_FIELD_LOCATION,
- E_CAL_MODEL_CALENDAR_FIELD_TRANSPARENCY,
- E_CAL_MODEL_CALENDAR_FIELD_LAST
-} ECalModelCalendarField;
-
-typedef struct {
- ECalModel model;
- ECalModelCalendarPrivate *priv;
-} ECalModelCalendar;
-
-typedef struct {
- ECalModelClass parent_class;
-} ECalModelCalendarClass;
-
-GType e_cal_model_calendar_get_type (void);
-ECalModelCalendar *e_cal_model_calendar_new (void);
-
-G_END_DECLS
-
-#endif
diff --git a/calendar/gui/e-cal-model-tasks.c b/calendar/gui/e-cal-model-tasks.c
deleted file mode 100644
index 2251ec7f88..0000000000
--- a/calendar/gui/e-cal-model-tasks.c
+++ /dev/null
@@ -1,1017 +0,0 @@
-/* Evolution calendar - Data model for ETable
- *
- * Copyright (C) 2000 Ximian, Inc.
- * Copyright (C) 2000 Ximian, Inc.
- *
- * Authors: Rodrigo Moya <rodrigo@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-#include <math.h>
-#include <gtk/gtkmessagedialog.h>
-#include <libgnome/gnome-i18n.h>
-#include <gal/util/e-util.h>
-#include "calendar-config.h"
-#include "e-cal-model-tasks.h"
-#include "e-cell-date-edit-text.h"
-#include "misc.h"
-
-struct _ECalModelTasksPrivate {
-};
-
-static void ecmt_class_init (ECalModelTasksClass *klass);
-static void ecmt_init (ECalModelTasks *model, ECalModelTasksClass *klass);
-static void ecmt_finalize (GObject *object);
-
-static int ecmt_column_count (ETableModel *etm);
-static void *ecmt_value_at (ETableModel *etm, int col, int row);
-static void ecmt_set_value_at (ETableModel *etm, int col, int row, const void *value);
-static gboolean ecmt_is_cell_editable (ETableModel *etm, int col, int row);
-static void *ecmt_duplicate_value (ETableModel *etm, int col, const void *value);
-static void ecmt_free_value (ETableModel *etm, int col, void *value);
-static void *ecmt_initialize_value (ETableModel *etm, int col);
-static gboolean ecmt_value_is_empty (ETableModel *etm, int col, const void *value);
-static char *ecmt_value_to_string (ETableModel *etm, int col, const void *value);
-
-static const char *ecmt_get_color_for_component (ECalModel *model, ECalModelComponent *comp_data);
-static void ecmt_fill_component_from_model (ECalModel *model, ECalModelComponent *comp_data,
- ETableModel *source_model, gint row);
-
-static GObjectClass *parent_class = NULL;
-
-E_MAKE_TYPE (e_cal_model_tasks, "ECalModelTasks", ECalModelTasks, ecmt_class_init,
- ecmt_init, E_TYPE_CAL_MODEL);
-
-static void
-ecmt_class_init (ECalModelTasksClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- ETableModelClass *etm_class = E_TABLE_MODEL_CLASS (klass);
- ECalModelClass *model_class = E_CAL_MODEL_CLASS (klass);
-
- parent_class = g_type_class_peek_parent (klass);
-
- object_class->finalize = ecmt_finalize;
-
- etm_class->column_count = ecmt_column_count;
- etm_class->value_at = ecmt_value_at;
- etm_class->set_value_at = ecmt_set_value_at;
- etm_class->is_cell_editable = ecmt_is_cell_editable;
- etm_class->duplicate_value = ecmt_duplicate_value;
- etm_class->free_value = ecmt_free_value;
- etm_class->initialize_value = ecmt_initialize_value;
- etm_class->value_is_empty = ecmt_value_is_empty;
- etm_class->value_to_string = ecmt_value_to_string;
-
- model_class->get_color_for_component = ecmt_get_color_for_component;
- model_class->fill_component_from_model = ecmt_fill_component_from_model;
-}
-
-static void
-ecmt_init (ECalModelTasks *model, ECalModelTasksClass *klass)
-{
- ECalModelTasksPrivate *priv;
-
- priv = g_new0 (ECalModelTasksPrivate, 1);
- model->priv = priv;
-
- e_cal_model_set_component_kind (E_CAL_MODEL (model), ICAL_VTODO_COMPONENT);
-}
-
-static void
-ecmt_finalize (GObject *object)
-{
- ECalModelTasksPrivate *priv;
- ECalModelTasks *model = (ECalModelTasks *) object;
-
- g_return_if_fail (E_IS_CAL_MODEL_TASKS (model));
-
- priv = model->priv;
- if (priv) {
- g_free (priv);
- model->priv = NULL;
- }
-
- if (parent_class->finalize)
- parent_class->finalize (object);
-}
-
-/* ETableModel methods */
-static int
-ecmt_column_count (ETableModel *etm)
-{
- return E_CAL_MODEL_TASKS_FIELD_LAST;
-}
-
-/* This makes sure a task is marked as complete.
- It makes sure the "Date Completed" property is set. If the completed_date
- is not -1, then that is used, otherwise if the "Date Completed" property
- is not already set it is set to the current time.
- It makes sure the percent is set to 100, and that the status is "Completed".
- Note that this doesn't update the component on the server. */
-static void
-ensure_task_complete (ECalModelComponent *comp_data, time_t completed_date)
-{
- icalproperty *prop;
- gboolean set_completed = TRUE;
-
- prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_COMPLETED_PROPERTY);
-
- /* Date Completed. */
- if (completed_date == -1) {
- if (prop)
- set_completed = FALSE;
- else
- completed_date = time (NULL);
- }
-
- if (set_completed) {
- icaltimezone *utc_zone;
- struct icaltimetype new_completed;
-
- /* COMPLETED is stored in UTC. */
- utc_zone = icaltimezone_get_utc_timezone ();
- new_completed = icaltime_from_timet_with_zone (completed_date,
- FALSE,
- utc_zone);
- if (prop)
- icalproperty_set_completed (prop, new_completed);
- else {
- prop = icalproperty_new_completed (new_completed);
- icalcomponent_add_property (comp_data->icalcomp, prop);
- }
- }
-
- /* Percent. */
- prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_PERCENTCOMPLETE_PROPERTY);
- if (!prop)
- icalcomponent_add_property (comp_data->icalcomp, icalproperty_new_percentcomplete (100));
- else
- icalproperty_set_percentcomplete (prop, 100);
-
- /* Status. */
- prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_STATUS_PROPERTY);
- if (prop)
- icalproperty_set_status (prop, ICAL_STATUS_COMPLETED);
- else
- icalcomponent_add_property (comp_data->icalcomp, icalproperty_new_status (ICAL_STATUS_COMPLETED));
-}
-
-
-/* This makes sure a task is marked as incomplete. It clears the
- "Date Completed" property. If the percent is set to 100 it removes it,
- and if the status is "Completed" it sets it to "Needs Action".
- Note that this doesn't update the component on the client. */
-static void
-ensure_task_not_complete (ECalModelComponent *comp_data)
-{
- icalproperty *prop;
-
- /* Date Completed. */
- prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_COMPLETED_PROPERTY);
- if (prop) {
- icalcomponent_remove_property (comp_data->icalcomp, prop);
- icalproperty_free (prop);
- }
-
- /* Percent. */
- prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_PERCENTCOMPLETE_PROPERTY);
- if (prop) {
- icalcomponent_remove_property (comp_data->icalcomp, prop);
- icalproperty_free (prop);
- }
-
- /* Status. */
- prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_PERCENTCOMPLETE_PROPERTY);
- if (prop)
- icalproperty_set_status (prop, ICAL_STATUS_NEEDSACTION);
-}
-
-static ECellDateEditValue *
-get_completed (ECalModelComponent *comp_data)
-{
- struct icaltimetype tt_completed;
-
- if (!comp_data->completed) {
- icaltimezone *zone;
- icalproperty *prop;
-
- prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_COMPLETED_PROPERTY);
- if (!prop)
- return NULL;
-
- tt_completed = icalproperty_get_completed (prop);
- if (!icaltime_is_valid_time (tt_completed))
- return NULL;
-
- comp_data->completed = g_new0 (ECellDateEditValue, 1);
- comp_data->completed->tt = tt_completed;
-
- if (icaltime_get_tzid (tt_completed)
- && e_cal_get_timezone (comp_data->client, icaltime_get_tzid (tt_completed), &zone, NULL))
- comp_data->completed->zone = zone;
- else
- comp_data->completed->zone = NULL;
- }
-
- return comp_data->completed;
-}
-
-static ECellDateEditValue *
-get_due (ECalModelComponent *comp_data)
-{
- struct icaltimetype tt_due;
-
- if (!comp_data->due) {
- icaltimezone *zone;
- icalproperty *prop;
-
- prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_DUE_PROPERTY);
- if (!prop)
- return NULL;
-
- tt_due = icalproperty_get_due (prop);
- if (!icaltime_is_valid_time (tt_due))
- return NULL;
-
- comp_data->due = g_new0 (ECellDateEditValue, 1);
- comp_data->due->tt = tt_due;
-
- if (icaltime_get_tzid (tt_due)
- && e_cal_get_timezone (comp_data->client, icaltime_get_tzid (tt_due), &zone, NULL))
- comp_data->due->zone = zone;
- else
- comp_data->due->zone = NULL;
- }
-
- return comp_data->due;
-}
-
-static char *
-get_geo (ECalModelComponent *comp_data)
-{
- icalproperty *prop;
- struct icalgeotype geo;
- static gchar buf[32];
-
- prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_GEO_PROPERTY);
- if (prop) {
- geo = icalproperty_get_geo (prop);
- g_snprintf (buf, sizeof (buf), "%g %s, %g %s",
- fabs (geo.lat),
- geo.lat >= 0.0 ? _("N") : _("S"),
- fabs (geo.lon),
- geo.lon >= 0.0 ? _("E") : _("W"));
- return buf;
- }
-
- return "";
-}
-
-static int
-get_percent (ECalModelComponent *comp_data)
-{
- icalproperty *prop;
-
- prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_PERCENTCOMPLETE_PROPERTY);
- if (prop)
- return icalproperty_get_percentcomplete (prop);
-
- return 0;
-}
-
-static char *
-get_priority (ECalModelComponent *comp_data)
-{
- icalproperty *prop;
-
- prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_PRIORITY_PROPERTY);
- if (prop)
- return e_cal_util_priority_to_string (icalproperty_get_priority (prop));
-
- return "";
-}
-
-static char *
-get_status (ECalModelComponent *comp_data)
-{
- icalproperty *prop;
-
- prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_STATUS_PROPERTY);
- if (prop) {
- switch (icalproperty_get_status (prop)) {
- case ICAL_STATUS_NONE:
- return "";
- case ICAL_STATUS_NEEDSACTION:
- return _("Not Started");
- case ICAL_STATUS_INPROCESS:
- return _("In Progress");
- case ICAL_STATUS_COMPLETED:
- return _("Completed");
- case ICAL_STATUS_CANCELLED:
- return _("Cancelled");
- default:
- g_assert_not_reached ();
- return NULL;
- }
- }
-
- return "";
-}
-
-static char *
-get_url (ECalModelComponent *comp_data)
-{
- icalproperty *prop;
-
- prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_URL_PROPERTY);
- if (prop)
- return (char *) icalproperty_get_url (prop);
-
- return "";
-}
-
-static gboolean
-is_complete (ECalModelComponent *comp_data)
-{
- icalproperty *prop;
-
- prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_COMPLETED_PROPERTY);
-
- return prop ? TRUE : FALSE;
-}
-
-typedef enum {
- E_CAL_MODEL_TASKS_DUE_NEVER,
- E_CAL_MODEL_TASKS_DUE_FUTURE,
- E_CAL_MODEL_TASKS_DUE_TODAY,
- E_CAL_MODEL_TASKS_DUE_OVERDUE,
- E_CAL_MODEL_TASKS_DUE_COMPLETE
-} ECalModelTasksDueStatus;
-
-
-static ECalModelTasksDueStatus
-get_due_status (ECalModelTasks *model, ECalModelComponent *comp_data)
-{
- icalproperty *prop;
-
- /* First, do we have a due date? */
- prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_DUE_PROPERTY);
- if (!prop)
- return E_CAL_MODEL_TASKS_DUE_NEVER;
- else {
- struct icaltimetype now_tt, due_tt;
- icaltimezone *zone;
-
- /* Second, is it already completed? */
- if (is_complete (comp_data))
- return E_CAL_MODEL_TASKS_DUE_COMPLETE;
-
- /* Third, are we overdue as of right now? */
- due_tt = icalproperty_get_due (prop);
- if (due_tt.is_date) {
- int cmp;
-
- now_tt = icaltime_current_time_with_zone (e_cal_model_get_timezone (E_CAL_MODEL (model)));
- cmp = icaltime_compare_date_only (due_tt, now_tt);
-
- if (cmp < 0)
- return E_CAL_MODEL_TASKS_DUE_OVERDUE;
- else if (cmp == 0)
- return E_CAL_MODEL_TASKS_DUE_TODAY;
- else
- return E_CAL_MODEL_TASKS_DUE_FUTURE;
- } else {
- /* Get the current time in the same timezone as the DUE date.*/
- if (!e_cal_get_timezone (comp_data->client, icaltime_get_tzid (due_tt), &zone, NULL))
- return E_CAL_MODEL_TASKS_DUE_FUTURE;
-
- now_tt = icaltime_current_time_with_zone (zone);
-
- if (icaltime_compare (due_tt, now_tt) <= 0)
- return E_CAL_MODEL_TASKS_DUE_OVERDUE;
- else
- if (icaltime_compare_date_only (due_tt, now_tt) == 0)
- return E_CAL_MODEL_TASKS_DUE_TODAY;
- else
- return E_CAL_MODEL_TASKS_DUE_FUTURE;
- }
- }
-
- return E_CAL_MODEL_TASKS_DUE_NEVER;
-}
-
-static gboolean
-is_overdue (ECalModelTasks *model, ECalModelComponent *comp_data)
-{
- switch (get_due_status (model, comp_data)) {
- case E_CAL_MODEL_TASKS_DUE_NEVER:
- case E_CAL_MODEL_TASKS_DUE_FUTURE:
- case E_CAL_MODEL_TASKS_DUE_COMPLETE:
- return FALSE;
- case E_CAL_MODEL_TASKS_DUE_TODAY:
- case E_CAL_MODEL_TASKS_DUE_OVERDUE:
- return TRUE;
- }
-
- return FALSE;
-}
-
-static void *
-ecmt_value_at (ETableModel *etm, int col, int row)
-{
- ECalModelTasksPrivate *priv;
- ECalModelComponent *comp_data;
- ECalModelTasks *model = (ECalModelTasks *) etm;
-
- g_return_val_if_fail (E_IS_CAL_MODEL_TASKS (model), NULL);
-
- priv = model->priv;
-
- g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_TASKS_FIELD_LAST, NULL);
- g_return_val_if_fail (row >= 0 && row < e_table_model_row_count (etm), NULL);
-
- if (col < E_CAL_MODEL_FIELD_LAST)
- return E_TABLE_MODEL_CLASS (parent_class)->value_at (etm, col, row);
-
- comp_data = e_cal_model_get_component_at (E_CAL_MODEL (model), row);
- if (!comp_data)
- return "";
-
- switch (col) {
- case E_CAL_MODEL_TASKS_FIELD_COMPLETED :
- return get_completed (comp_data);
- case E_CAL_MODEL_TASKS_FIELD_COMPLETE :
- return GINT_TO_POINTER (is_complete (comp_data));
- case E_CAL_MODEL_TASKS_FIELD_DUE :
- return get_due (comp_data);
- case E_CAL_MODEL_TASKS_FIELD_GEO :
- return get_geo (comp_data);
- case E_CAL_MODEL_TASKS_FIELD_OVERDUE :
- return GINT_TO_POINTER (is_overdue (model, comp_data));
- case E_CAL_MODEL_TASKS_FIELD_PERCENT :
- return GINT_TO_POINTER (get_percent (comp_data));
- case E_CAL_MODEL_TASKS_FIELD_PRIORITY :
- return get_priority (comp_data);
- case E_CAL_MODEL_TASKS_FIELD_STATUS :
- return get_status (comp_data);
- case E_CAL_MODEL_TASKS_FIELD_URL :
- return get_url (comp_data);
- }
-
- return "";
-}
-
-static void
-set_completed (ECalModelTasks *model, ECalModelComponent *comp_data, const void *value)
-{
- ECellDateEditValue *dv = (ECellDateEditValue *) value;
-
- if (!dv)
- ensure_task_not_complete (comp_data);
- else {
- time_t t;
-
- if (dv->tt.is_date) {
- /* if it's a date, it will be floating,
- but completed needs a date time value */
- dv->tt.is_date = FALSE;
- t = icaltime_as_timet_with_zone (dv->tt, e_cal_model_get_timezone (E_CAL_MODEL (model)));
- } else {
- /* we assume that COMPLETED is entered in the current timezone,
- even though it gets stored in UTC */
- t = icaltime_as_timet_with_zone (dv->tt, dv->zone);
- }
-
- ensure_task_complete (comp_data, t);
- }
-}
-
-static void
-set_complete (ECalModelComponent *comp_data, const void *value)
-{
- gint state = GPOINTER_TO_INT (value);
-
- if (state)
- ensure_task_complete (comp_data, -1);
- else
- ensure_task_not_complete (comp_data);
-}
-
-static void
-set_due (ECalModelComponent *comp_data, const void *value)
-{
- icalproperty *prop;
- ECellDateEditValue *dv = (ECellDateEditValue *) value;
-
- prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_DUE_PROPERTY);
-
- if (!dv) {
- if (prop) {
- icalcomponent_remove_property (comp_data->icalcomp, prop);
- icalproperty_free (prop);
- }
- } else {
- if (prop)
- icalproperty_set_due (prop, dv->tt);
- else {
- prop = icalproperty_new_due (dv->tt);
- icalcomponent_add_property (comp_data->icalcomp, prop);
- }
- }
-}
-
-/* FIXME: We need to set the "transient_for" property for the dialog, but the
- * model doesn't know anything about the windows.
- */
-static void
-show_geo_warning (void)
-{
- GtkWidget *dialog;
-
- dialog = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
- _("The geographical position must be entered "
- "in the format: \n\n45.436845,125.862501"));
- gtk_widget_show (dialog);
-}
-
-static void
-set_geo (ECalModelComponent *comp_data, const char *value)
-{
- double latitude, longitude;
- int matched;
- struct icalgeotype geo;
- icalproperty *prop;
-
- prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_GEO_PROPERTY);
-
- if (string_is_empty (value)) {
- if (prop) {
- icalcomponent_remove_property (comp_data->icalcomp, prop);
- icalproperty_free (prop);
- }
- } else {
- matched = sscanf (value, "%lg , %lg", &latitude, &longitude);
- if (matched != 2)
- show_geo_warning ();
-
- geo.lat = latitude;
- geo.lon = longitude;
- if (prop)
- icalproperty_set_geo (prop, geo);
- else {
- prop = icalproperty_new_geo (geo);
- icalcomponent_add_property (comp_data->icalcomp, prop);
- }
-
- }
-}
-
-static void
-set_status (ECalModelComponent *comp_data, const char *value)
-{
- icalproperty_status status;
- icalproperty *prop;
-
- prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_STATUS_PROPERTY);
-
- /* an empty string is the same as 'None' */
- if (!value[0] || !g_strcasecmp (value, _("None")))
- status = ICAL_STATUS_NONE;
- else if (!g_strcasecmp (value, _("Not Started")))
- status = ICAL_STATUS_NEEDSACTION;
- else if (!g_strcasecmp (value, _("In Progress")))
- status = ICAL_STATUS_INPROCESS;
- else if (!g_strcasecmp (value, _("Completed")))
- status = ICAL_STATUS_COMPLETED;
- else if (!g_strcasecmp (value, _("Cancelled")))
- status = ICAL_STATUS_CANCELLED;
- else {
- g_warning ("Invalid status: %s\n", value);
- return;
- }
-
- if (prop)
- icalproperty_set_status (prop, status);
- else {
- prop = icalproperty_new_status (status);
- icalcomponent_add_property (comp_data->icalcomp, prop);
- }
-
-/* if (status == ICAL_STATUS_NEEDSACTION) { */
-/* percent = 0; */
-/* e_cal_component_set_percent (comp, &percent); */
-/* e_cal_component_set_completed (comp, NULL); */
-/* } else if (status == ICAL_STATUS_INPROCESS) { */
-/* ensure_task_not_complete (comp); */
-/* percent = 50; */
-/* e_cal_component_set_percent (comp, &percent); */
-/* } else if (status == ICAL_STATUS_COMPLETED) { */
-/* ensure_task_complete (comp, -1); */
-/* } */
-}
-
-static void
-set_percent (ECalModelComponent *comp_data, const void *value)
-{
- icalproperty *prop;
- gint percent = GPOINTER_TO_INT (value);
-
- g_return_if_fail (percent >= -1);
- g_return_if_fail (percent <= 100);
-
- prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_PERCENTCOMPLETE_PROPERTY);
-
- /* A value of -1 means it isn't set */
- if (percent == -1) {
- if (prop) {
- icalcomponent_remove_property (comp_data->icalcomp, prop);
- icalproperty_free (prop);
- }
- ensure_task_not_complete (comp_data);
- } else {
- if (prop)
- icalproperty_set_percentcomplete (prop, percent);
- else {
- prop = icalproperty_new_percentcomplete (percent);
- icalcomponent_add_property (comp_data->icalcomp, prop);
- }
-
- if (percent == 100)
- ensure_task_complete (comp_data, -1);
- else {
- ensure_task_not_complete (comp_data);
- if (percent > 0)
- set_status (comp_data, _("In Progress"));
- }
- }
-
-}
-
-static void
-set_priority (ECalModelComponent *comp_data, const char *value)
-{
- icalproperty *prop;
- int priority;
-
- prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_PRIORITY_PROPERTY);
-
- priority = e_cal_util_priority_from_string (value);
- if (priority == -1) {
- g_warning ("Invalid priority");
- priority = 0;
- }
-
- if (prop)
- icalproperty_set_priority (prop, priority);
- else {
- prop = icalproperty_new_priority (priority);
- icalcomponent_add_property (comp_data->icalcomp, prop);
- }
-}
-
-static void
-set_url (ECalModelComponent *comp_data, const char *value)
-{
- icalproperty *prop;
-
- prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_URL_PROPERTY);
-
- if (string_is_empty (value)) {
- if (prop) {
- icalcomponent_remove_property (comp_data->icalcomp, prop);
- icalproperty_free (prop);
- }
- } else {
- if (prop)
- icalproperty_set_url (prop, value);
- else {
- prop = icalproperty_new_url (value);
- icalcomponent_add_property (comp_data->icalcomp, prop);
- }
- }
-}
-
-static void
-ecmt_set_value_at (ETableModel *etm, int col, int row, const void *value)
-{
- ECalModelTasksPrivate *priv;
- ECalModelComponent *comp_data;
- ECalModelTasks *model = (ECalModelTasks *) etm;
-
- g_return_if_fail (E_IS_CAL_MODEL_TASKS (model));
-
- priv = model->priv;
-
- g_return_if_fail (col >= 0 && col < E_CAL_MODEL_TASKS_FIELD_LAST);
- g_return_if_fail (row >= 0 && row < e_table_model_row_count (etm));
-
- if (col < E_CAL_MODEL_FIELD_LAST) {
- E_TABLE_MODEL_CLASS (parent_class)->set_value_at (etm, col, row, value);
- return;
- }
-
- comp_data = e_cal_model_get_component_at (E_CAL_MODEL (model), row);
- if (!comp_data)
- return;
-
- switch (col) {
- case E_CAL_MODEL_TASKS_FIELD_COMPLETED :
- set_completed (model, comp_data, value);
- break;
- case E_CAL_MODEL_TASKS_FIELD_COMPLETE :
- set_complete (comp_data, value);
- break;
- case E_CAL_MODEL_TASKS_FIELD_DUE :
- set_due (comp_data, value);
- break;
- case E_CAL_MODEL_TASKS_FIELD_GEO :
- set_geo (comp_data, value);
- break;
- case E_CAL_MODEL_TASKS_FIELD_PERCENT :
- set_percent (comp_data, value);
- break;
- case E_CAL_MODEL_TASKS_FIELD_PRIORITY :
- set_priority (comp_data, value);
- break;
- case E_CAL_MODEL_TASKS_FIELD_URL :
- set_url (comp_data, value);
- break;
- }
-
- /* FIXME ask about mod type */
- if (!e_cal_modify_object (comp_data->client, comp_data->icalcomp, CALOBJ_MOD_ALL, NULL)) {
- g_warning (G_STRLOC ": Could not modify the object!");
-
- /* FIXME Show error dialog */
- }
-}
-
-static gboolean
-ecmt_is_cell_editable (ETableModel *etm, int col, int row)
-{
- ECalModelTasksPrivate *priv;
- ECalModelTasks *model = (ECalModelTasks *) etm;
-
- g_return_val_if_fail (E_IS_CAL_MODEL_TASKS (model), FALSE);
-
- priv = model->priv;
-
- g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_TASKS_FIELD_LAST, FALSE);
-
- /* FIXME: We can't check this as 'click-to-add' passes row 0. */
- /* g_return_val_if_fail (row >= 0 && row < e_table_model_get_row_count (etm), FALSE); */
-
- if (col < E_CAL_MODEL_FIELD_LAST)
- return E_TABLE_MODEL_CLASS (parent_class)->is_cell_editable (etm, col, row);
-
- switch (col) {
- case E_CAL_MODEL_TASKS_FIELD_COMPLETED :
- case E_CAL_MODEL_TASKS_FIELD_COMPLETE :
- case E_CAL_MODEL_TASKS_FIELD_DUE :
- case E_CAL_MODEL_TASKS_FIELD_GEO :
- case E_CAL_MODEL_TASKS_FIELD_PERCENT :
- case E_CAL_MODEL_TASKS_FIELD_PRIORITY :
- case E_CAL_MODEL_TASKS_FIELD_URL :
- return TRUE;
- }
-
- return FALSE;
-}
-
-static void *
-ecmt_duplicate_value (ETableModel *etm, int col, const void *value)
-{
- g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_TASKS_FIELD_LAST, NULL);
-
- if (col < E_CAL_MODEL_FIELD_LAST)
- return E_TABLE_MODEL_CLASS (parent_class)->duplicate_value (etm, col, value);
-
- switch (col) {
- case E_CAL_MODEL_TASKS_FIELD_GEO :
- case E_CAL_MODEL_TASKS_FIELD_PRIORITY :
- case E_CAL_MODEL_TASKS_FIELD_STATUS :
- case E_CAL_MODEL_TASKS_FIELD_URL :
- return g_strdup (value);
- case E_CAL_MODEL_TASKS_FIELD_COMPLETED :
- case E_CAL_MODEL_TASKS_FIELD_DUE :
- /* FIXME */
- break;
- case E_CAL_MODEL_TASKS_FIELD_COMPLETE :
- case E_CAL_MODEL_TASKS_FIELD_PERCENT :
- case E_CAL_MODEL_TASKS_FIELD_OVERDUE :
- return (void *) value;
- }
-
- return NULL;
-}
-
-static void
-ecmt_free_value (ETableModel *etm, int col, void *value)
-{
- g_return_if_fail (col >= 0 && col < E_CAL_MODEL_TASKS_FIELD_LAST);
-
- if (col < E_CAL_MODEL_FIELD_LAST) {
- E_TABLE_MODEL_CLASS (parent_class)->free_value (etm, col, value);
- return;
- }
-
- switch (col) {
- case E_CAL_MODEL_TASKS_FIELD_COMPLETED :
- case E_CAL_MODEL_TASKS_FIELD_DUE :
- case E_CAL_MODEL_TASKS_FIELD_GEO :
- case E_CAL_MODEL_TASKS_FIELD_PRIORITY :
- case E_CAL_MODEL_TASKS_FIELD_STATUS :
- case E_CAL_MODEL_TASKS_FIELD_URL :
- if (value)
- g_free (value);
- break;
- case E_CAL_MODEL_TASKS_FIELD_PERCENT :
- case E_CAL_MODEL_TASKS_FIELD_COMPLETE :
- case E_CAL_MODEL_TASKS_FIELD_OVERDUE :
- break;
- }
-}
-
-static void *
-ecmt_initialize_value (ETableModel *etm, int col)
-{
- ECalModelTasks *model = (ECalModelTasks *) etm;
-
- g_return_val_if_fail (E_IS_CAL_MODEL_TASKS (model), NULL);
- g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_TASKS_FIELD_LAST, NULL);
-
- if (col < E_CAL_MODEL_FIELD_LAST)
- return E_TABLE_MODEL_CLASS (parent_class)->initialize_value (etm, col);
-
- switch (col) {
- case E_CAL_MODEL_TASKS_FIELD_GEO :
- case E_CAL_MODEL_TASKS_FIELD_PRIORITY :
- case E_CAL_MODEL_TASKS_FIELD_STATUS :
- case E_CAL_MODEL_TASKS_FIELD_URL :
- return g_strdup ("");
- case E_CAL_MODEL_TASKS_FIELD_COMPLETED :
- case E_CAL_MODEL_TASKS_FIELD_DUE :
- case E_CAL_MODEL_TASKS_FIELD_COMPLETE :
- case E_CAL_MODEL_TASKS_FIELD_OVERDUE :
- return NULL;
- case E_CAL_MODEL_TASKS_FIELD_PERCENT :
- return GINT_TO_POINTER (-1);
- }
-
- return NULL;
-}
-
-static gboolean
-ecmt_value_is_empty (ETableModel *etm, int col, const void *value)
-{
- ECalModelTasksPrivate *priv;
- ECalModelTasks *model = (ECalModelTasks *) etm;
-
- g_return_val_if_fail (E_IS_CAL_MODEL_TASKS (model), TRUE);
- g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_TASKS_FIELD_LAST, TRUE);
-
- priv = model->priv;
-
- if (col < E_CAL_MODEL_FIELD_LAST)
- return E_TABLE_MODEL_CLASS (parent_class)->value_is_empty (etm, col, value);
-
- switch (col) {
- case E_CAL_MODEL_TASKS_FIELD_GEO :
- case E_CAL_MODEL_TASKS_FIELD_PRIORITY :
- case E_CAL_MODEL_TASKS_FIELD_STATUS :
- case E_CAL_MODEL_TASKS_FIELD_URL :
- return string_is_empty (value);
- case E_CAL_MODEL_TASKS_FIELD_COMPLETED :
- case E_CAL_MODEL_TASKS_FIELD_DUE :
- return value ? FALSE : TRUE;
- case E_CAL_MODEL_TASKS_FIELD_PERCENT :
- return (GPOINTER_TO_INT (value) < 0) ? TRUE : FALSE;
- case E_CAL_MODEL_TASKS_FIELD_COMPLETE :
- case E_CAL_MODEL_TASKS_FIELD_OVERDUE :
- return TRUE;
- }
-
- return TRUE;
-}
-
-static char *
-ecmt_value_to_string (ETableModel *etm, int col, const void *value)
-{
- ECalModelTasks *model = (ECalModelTasks *) etm;
-
- g_return_val_if_fail (E_IS_CAL_MODEL_TASKS (model), NULL);
- g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_TASKS_FIELD_LAST, NULL);
-
- if (col < E_CAL_MODEL_FIELD_LAST)
- return E_TABLE_MODEL_CLASS (parent_class)->value_to_string (etm, col, value);
-
- switch (col) {
- case E_CAL_MODEL_TASKS_FIELD_GEO :
- case E_CAL_MODEL_TASKS_FIELD_PRIORITY :
- case E_CAL_MODEL_TASKS_FIELD_STATUS :
- case E_CAL_MODEL_TASKS_FIELD_URL :
- return g_strdup (value);
- case E_CAL_MODEL_TASKS_FIELD_COMPLETED :
- case E_CAL_MODEL_TASKS_FIELD_DUE :
- return e_cal_model_date_value_to_string (E_CAL_MODEL (model), value);
- case E_CAL_MODEL_TASKS_FIELD_COMPLETE :
- case E_CAL_MODEL_TASKS_FIELD_OVERDUE :
- return value ? _("Yes") : _("No");
- case E_CAL_MODEL_TASKS_FIELD_PERCENT :
- if (GPOINTER_TO_INT (value) < 0)
- return g_strdup ("N/A");
- else
- return g_strdup_printf ("%i%%", GPOINTER_TO_INT (value));
- }
-
- return NULL;
-}
-
-/* ECalModel class methods */
-
-static const char *
-ecmt_get_color_for_component (ECalModel *model, ECalModelComponent *comp_data)
-{
- g_return_val_if_fail (E_IS_CAL_MODEL_TASKS (model), NULL);
- g_return_val_if_fail (comp_data != NULL, NULL);
-
- switch (get_due_status ((ECalModelTasks *) model, comp_data)) {
- case E_CAL_MODEL_TASKS_DUE_TODAY:
- return calendar_config_get_tasks_due_today_color ();
- case E_CAL_MODEL_TASKS_DUE_OVERDUE:
- return calendar_config_get_tasks_overdue_color ();
- case E_CAL_MODEL_TASKS_DUE_NEVER:
- case E_CAL_MODEL_TASKS_DUE_FUTURE:
- case E_CAL_MODEL_TASKS_DUE_COMPLETE:
- break;
- }
-
- return "black";
- /* return E_CAL_MODEL_CLASS (parent_class)->get_color_for_component (model, comp_data); */
-}
-
-static void
-ecmt_fill_component_from_model (ECalModel *model, ECalModelComponent *comp_data,
- ETableModel *source_model, gint row)
-{
- g_return_if_fail (E_IS_CAL_MODEL_TASKS (model));
- g_return_if_fail (comp_data != NULL);
- g_return_if_fail (E_IS_TABLE_MODEL (source_model));
-
- set_completed ((ECalModelTasks *) model, comp_data,
- e_table_model_value_at (source_model, E_CAL_MODEL_TASKS_FIELD_COMPLETED, row));
- set_due (comp_data,
- e_table_model_value_at (source_model, E_CAL_MODEL_TASKS_FIELD_DUE, row));
- set_geo (comp_data,
- e_table_model_value_at (source_model, E_CAL_MODEL_TASKS_FIELD_GEO, row));
- set_percent (comp_data,
- e_table_model_value_at (source_model, E_CAL_MODEL_TASKS_FIELD_PERCENT, row));
- set_priority (comp_data,
- e_table_model_value_at (source_model, E_CAL_MODEL_TASKS_FIELD_PRIORITY, row));
- set_status (comp_data,
- e_table_model_value_at (source_model, E_CAL_MODEL_TASKS_FIELD_STATUS, row));
- set_url (comp_data,
- e_table_model_value_at (source_model, E_CAL_MODEL_TASKS_FIELD_URL, row));
-}
-
-/**
- * e_cal_model_tasks_new
- */
-ECalModelTasks *
-e_cal_model_tasks_new (void)
-{
- return g_object_new (E_TYPE_CAL_MODEL_TASKS, NULL);
-}
-
-/**
- * e_cal_model_tasks_mark_task_complete
- */
-void
-e_cal_model_tasks_mark_task_complete (ECalModelTasks *model, gint model_row)
-{
- ECalModelTasksPrivate *priv;
- ECalModelComponent *comp_data;
-
- g_return_if_fail (E_IS_CAL_MODEL_TASKS (model));
- g_return_if_fail (model_row >= 0 && model_row < e_table_model_row_count (E_TABLE_MODEL (model)));
-
- priv = model->priv;
-
- comp_data = e_cal_model_get_component_at (E_CAL_MODEL (model), model_row);
- if (comp_data)
- ensure_task_complete (comp_data, -1);
-}
diff --git a/calendar/gui/e-cal-model-tasks.h b/calendar/gui/e-cal-model-tasks.h
deleted file mode 100644
index b7c5786ab4..0000000000
--- a/calendar/gui/e-cal-model-tasks.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* Evolution calendar - Data model for ETable
- *
- * Copyright (C) 2000 Ximian, Inc.
- * Copyright (C) 2000 Ximian, Inc.
- *
- * Authors: Rodrigo Moya <rodrigo@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef E_CAL_MODEL_TASKS_H
-#define E_CAL_MODEL_TASKS_H
-
-#include "e-cal-model.h"
-
-G_BEGIN_DECLS
-
-#define E_TYPE_CAL_MODEL_TASKS (e_cal_model_tasks_get_type ())
-#define E_CAL_MODEL_TASKS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_CAL_MODEL_TASKS, ECalModelTasks))
-#define E_CAL_MODEL_TASKS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_CAL_MODEL_TASKS, ECalModelTasksClass))
-#define E_IS_CAL_MODEL_TASKS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_CAL_MODEL_TASKS))
-#define E_IS_CAL_MODEL_TASKS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_CAL_MODEL_TASKS))
-
-typedef struct _ECalModelTasksPrivate ECalModelTasksPrivate;
-
-typedef enum {
- /* If you add new items here or reorder them, you have to update the
- .etspec files for the tables using this model */
- E_CAL_MODEL_TASKS_FIELD_COMPLETED = E_CAL_MODEL_FIELD_LAST,
- E_CAL_MODEL_TASKS_FIELD_COMPLETE,
- E_CAL_MODEL_TASKS_FIELD_DUE,
- E_CAL_MODEL_TASKS_FIELD_GEO,
- E_CAL_MODEL_TASKS_FIELD_OVERDUE,
- E_CAL_MODEL_TASKS_FIELD_PERCENT,
- E_CAL_MODEL_TASKS_FIELD_PRIORITY,
- E_CAL_MODEL_TASKS_FIELD_STATUS,
- E_CAL_MODEL_TASKS_FIELD_URL,
- E_CAL_MODEL_TASKS_FIELD_LAST
-} ECalModelTasksField;
-
-typedef struct {
- ECalModel model;
- ECalModelTasksPrivate *priv;
-} ECalModelTasks;
-
-typedef struct {
- ECalModelClass parent_class;
-} ECalModelTasksClass;
-
-GType e_cal_model_tasks_get_type (void);
-ECalModelTasks *e_cal_model_tasks_new (void);
-
-void e_cal_model_tasks_mark_task_complete (ECalModelTasks *model, gint model_row);
-
-G_END_DECLS
-
-#endif
diff --git a/calendar/gui/e-cal-model.c b/calendar/gui/e-cal-model.c
deleted file mode 100644
index 9ac1104380..0000000000
--- a/calendar/gui/e-cal-model.c
+++ /dev/null
@@ -1,1597 +0,0 @@
-/* Evolution calendar - Data model for ETable
- *
- * Copyright (C) 2000 Ximian, Inc.
- * Copyright (C) 2000 Ximian, Inc.
- *
- * Authors: Rodrigo Moya <rodrigo@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <string.h>
-#include <glib/garray.h>
-#include <libgnome/gnome-i18n.h>
-#include <gal/util/e-util.h>
-#include <e-util/e-config-listener.h>
-#include <e-util/e-time-utils.h>
-#include <libecal/e-cal-time-util.h>
-#include "calendar-config.h"
-#include "comp-util.h"
-#include "e-cal-model.h"
-#include "itip-utils.h"
-#include "misc.h"
-
-typedef struct {
- ECal *client;
- ECalView *query;
-} ECalModelClient;
-
-struct _ECalModelPrivate {
- /* The list of clients we are managing. Each element is of type ECalModelClient */
- GList *clients;
-
- /* The default client in the list */
- ECal *default_client;
-
- /* Array for storing the objects. Each element is of type ECalModelComponent */
- GPtrArray *objects;
-
- icalcomponent_kind kind;
- icaltimezone *zone;
-
- /* The search regular expression */
- gchar *sexp;
-
- /* The default category */
- gchar *default_category;
-
- /* Addresses for determining icons */
- EAccountList *accounts;
-
- /* Whether we display dates in 24-hour format. */
- gboolean use_24_hour_format;
-};
-
-static void e_cal_model_class_init (ECalModelClass *klass);
-static void e_cal_model_init (ECalModel *model, ECalModelClass *klass);
-static void e_cal_model_finalize (GObject *object);
-
-static int ecm_column_count (ETableModel *etm);
-static int ecm_row_count (ETableModel *etm);
-static void *ecm_value_at (ETableModel *etm, int col, int row);
-static void ecm_set_value_at (ETableModel *etm, int col, int row, const void *value);
-static gboolean ecm_is_cell_editable (ETableModel *etm, int col, int row);
-static void ecm_append_row (ETableModel *etm, ETableModel *source, int row);
-static void *ecm_duplicate_value (ETableModel *etm, int col, const void *value);
-static void ecm_free_value (ETableModel *etm, int col, void *value);
-static void *ecm_initialize_value (ETableModel *etm, int col);
-static gboolean ecm_value_is_empty (ETableModel *etm, int col, const void *value);
-static char *ecm_value_to_string (ETableModel *etm, int col, const void *value);
-
-static const char *ecm_get_color_for_component (ECalModel *model, ECalModelComponent *comp_data);
-
-static GObjectClass *parent_class = NULL;
-
-E_MAKE_TYPE (e_cal_model, "ECalModel", ECalModel, e_cal_model_class_init,
- e_cal_model_init, E_TABLE_MODEL_TYPE);
-
-static void
-e_cal_model_class_init (ECalModelClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- ETableModelClass *etm_class = E_TABLE_MODEL_CLASS (klass);
-
- parent_class = g_type_class_peek_parent (klass);
-
- object_class->finalize = e_cal_model_finalize;
-
- etm_class->column_count = ecm_column_count;
- etm_class->row_count = ecm_row_count;
- etm_class->value_at = ecm_value_at;
- etm_class->set_value_at = ecm_set_value_at;
- etm_class->is_cell_editable = ecm_is_cell_editable;
- etm_class->append_row = ecm_append_row;
- etm_class->duplicate_value = ecm_duplicate_value;
- etm_class->free_value = ecm_free_value;
- etm_class->initialize_value = ecm_initialize_value;
- etm_class->value_is_empty = ecm_value_is_empty;
- etm_class->value_to_string = ecm_value_to_string;
-
- klass->get_color_for_component = ecm_get_color_for_component;
- klass->fill_component_from_model = NULL;
-}
-
-static void
-e_cal_model_init (ECalModel *model, ECalModelClass *klass)
-{
- ECalModelPrivate *priv;
-
- priv = g_new0 (ECalModelPrivate, 1);
- model->priv = priv;
-
- priv->sexp = g_strdup ("#t"); /* match all by default */
-
- priv->objects = g_ptr_array_new ();
- priv->kind = ICAL_NO_COMPONENT;
-
- priv->accounts = itip_addresses_get ();
-
- priv->use_24_hour_format = TRUE;
-}
-
-static void
-free_comp_data (ECalModelComponent *comp_data)
-{
- g_return_if_fail (comp_data != NULL);
-
- comp_data->client = NULL;
-
- if (comp_data->icalcomp) {
- icalcomponent_free (comp_data->icalcomp);
- comp_data->icalcomp = NULL;
- }
-
- if (comp_data->dtstart) {
- g_free (comp_data->dtstart);
- comp_data->dtstart = NULL;
- }
-
- if (comp_data->dtend) {
- g_free (comp_data->dtend);
- comp_data->dtend = NULL;
- }
-
- if (comp_data->due) {
- g_free (comp_data->due);
- comp_data->due = NULL;
- }
-
- if (comp_data->completed) {
- g_free (comp_data->completed);
- comp_data->completed = NULL;
- }
-
- g_free (comp_data);
-}
-
-static void
-clear_objects_array (ECalModelPrivate *priv)
-{
- gint i;
-
- for (i = 0; i < priv->objects->len; i++) {
- ECalModelComponent *comp_data;
-
- comp_data = g_ptr_array_index (priv->objects, i);
- g_assert (comp_data != NULL);
- free_comp_data (comp_data);
- }
-
-
- g_ptr_array_set_size (priv->objects, 0);
-}
-
-static void
-e_cal_model_finalize (GObject *object)
-{
- ECalModelPrivate *priv;
- ECalModel *model = (ECalModel *) object;
-
- g_return_if_fail (E_IS_CAL_MODEL (model));
-
- priv = model->priv;
- if (priv) {
- if (priv->clients) {
- while (priv->clients != NULL) {
- ECalModelClient *client_data = (ECalModelClient *) priv->clients->data;
-
- g_signal_handlers_disconnect_matched (client_data->client, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, model);
- g_signal_handlers_disconnect_matched (client_data->query, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, model);
-
- priv->clients = g_list_remove (priv->clients, client_data);
- g_object_unref (client_data->client);
- g_object_unref (client_data->query);
- g_free (client_data);
- }
-
- priv->clients = NULL;
- }
-
- if (priv->sexp) {
- g_free (priv->sexp);
- priv->sexp = NULL;
- }
-
- if (priv->default_category) {
- g_free (priv->default_category);
- priv->default_category = NULL;
- }
-
- if (priv->objects) {
- clear_objects_array (priv);
- g_ptr_array_free (priv->objects, FALSE);
- priv->objects = NULL;
- }
-
- if (priv->accounts) {
- priv->accounts = NULL;
- }
-
- g_free (priv);
- model->priv = NULL;
- }
-
- if (parent_class->finalize)
- parent_class->finalize (object);
-}
-
-/* ETableModel methods */
-
-static int
-ecm_column_count (ETableModel *etm)
-{
- return E_CAL_MODEL_FIELD_LAST;
-}
-
-static int
-ecm_row_count (ETableModel *etm)
-{
- ECalModelPrivate *priv;
- ECalModel *model = (ECalModel *) etm;
-
- g_return_val_if_fail (E_IS_CAL_MODEL (model), -1);
-
- priv = model->priv;
-
- return priv->objects->len;
-}
-
-static char *
-get_categories (ECalModelComponent *comp_data)
-{
- icalproperty *prop;
-
- prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_CATEGORIES_PROPERTY);
- if (prop)
- return (char *) icalproperty_get_categories (prop);
-
- return "";
-}
-
-static char *
-get_classification (ECalModelComponent *comp_data)
-{
- icalproperty *prop;
- icalproperty_class class;
-
- prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_CLASS_PROPERTY);
-
- if (!prop)
- return _("Public");
-
- class = icalproperty_get_class (prop);
-
- switch (class)
- {
- case ICAL_CLASS_PUBLIC:
- return _("Public");
- case ICAL_CLASS_PRIVATE:
- return _("Private");
- case ICAL_CLASS_CONFIDENTIAL:
- return _("Confidential");
- default:
- return _("Unknown");
- }
-
- return _("Unknown");
-}
-
-static const char *
-get_color (ECalModel *model, ECalModelComponent *comp_data)
-{
- g_return_val_if_fail (E_IS_CAL_MODEL (model), NULL);
-
- return e_cal_model_get_color_for_component (model, comp_data);
-}
-
-static char *
-get_description (ECalModelComponent *comp_data)
-{
- icalproperty *prop;
- static GString *str = NULL;
-
- if (str)
- g_string_free (str, TRUE);
-
- prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_DESCRIPTION_PROPERTY);
- if (prop) {
- str = g_string_new ("");
- do {
- str = g_string_append (str, icalproperty_get_description (prop));
- } while ((prop = icalcomponent_get_next_property (comp_data->icalcomp, ICAL_DESCRIPTION_PROPERTY)));
-
- return str->str;
- }
-
- return "";
-}
-
-static ECellDateEditValue*
-get_dtstart (ECalModel *model, ECalModelComponent *comp_data)
-{
- ECalModelPrivate *priv;
- struct icaltimetype tt_start;
-
- priv = model->priv;
-
- if (!comp_data->dtstart) {
- icaltimezone *zone;
- icalproperty *prop;
-
- prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_DTSTART_PROPERTY);
- if (!prop)
- return NULL;
-
- tt_start = icalproperty_get_dtstart (prop);
- if (!icaltime_is_valid_time (tt_start))
- return NULL;
-
- comp_data->dtstart = g_new0 (ECellDateEditValue, 1);
- comp_data->dtstart->tt = tt_start;
-
- if (icaltime_get_tzid (tt_start)
- && e_cal_get_timezone (comp_data->client, icaltime_get_tzid (tt_start), &zone, NULL))
- comp_data->dtstart->zone = zone;
- else
- comp_data->dtstart->zone = NULL;
- }
-
- return comp_data->dtstart;
-}
-
-static char *
-get_summary (ECalModelComponent *comp_data)
-{
- icalproperty *prop;
-
- prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_SUMMARY_PROPERTY);
- if (prop)
- return (char *) icalproperty_get_summary (prop);
-
- return "";
-}
-
-static char *
-get_uid (ECalModelComponent *comp_data)
-{
- return (char *) icalcomponent_get_uid (comp_data->icalcomp);
-}
-
-static void *
-ecm_value_at (ETableModel *etm, int col, int row)
-{
- ECalModelPrivate *priv;
- ECalModelComponent *comp_data;
- ECalModel *model = (ECalModel *) etm;
-
- g_return_val_if_fail (E_IS_CAL_MODEL (model), NULL);
-
- priv = model->priv;
-
- g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_FIELD_LAST, NULL);
- g_return_val_if_fail (row >= 0 && row < priv->objects->len, NULL);
-
- comp_data = g_ptr_array_index (priv->objects, row);
- g_assert (comp_data != NULL);
-
- switch (col) {
- case E_CAL_MODEL_FIELD_CATEGORIES :
- return get_categories (comp_data);
- case E_CAL_MODEL_FIELD_CLASSIFICATION :
- return get_classification (comp_data);
- case E_CAL_MODEL_FIELD_COLOR :
- return (void *) get_color (model, comp_data);
- case E_CAL_MODEL_FIELD_COMPONENT :
- return comp_data->icalcomp;
- case E_CAL_MODEL_FIELD_DESCRIPTION :
- return get_description (comp_data);
- case E_CAL_MODEL_FIELD_DTSTART :
- return (void *) get_dtstart (model, comp_data);
- case E_CAL_MODEL_FIELD_HAS_ALARMS :
- return GINT_TO_POINTER ((icalcomponent_get_first_component (comp_data->icalcomp,
- ICAL_VALARM_COMPONENT) != NULL));
- case E_CAL_MODEL_FIELD_ICON :
- {
- ECalComponent *comp;
- icalcomponent *icalcomp;
- gint retval = 0;
-
- comp = e_cal_component_new ();
- icalcomp = icalcomponent_new_clone (comp_data->icalcomp);
- if (e_cal_component_set_icalcomponent (comp, icalcomp)) {
- if (e_cal_component_has_recurrences (comp))
- retval = 1;
- else if (itip_organizer_is_user (comp, comp_data->client))
- retval = 3;
- else {
- GSList *attendees = NULL, *sl;
-
- e_cal_component_get_attendee_list (comp, &attendees);
- for (sl = attendees; sl != NULL; sl = sl->next) {
- ECalComponentAttendee *ca = sl->data;
- const char *text;
-
- text = itip_strip_mailto (ca->value);
- if (e_account_list_find (priv->accounts, E_ACCOUNT_FIND_ID_ADDRESS, text) != NULL) {
- if (ca->delto != NULL)
- retval = 3;
- else
- retval = 2;
- break;
- }
- }
-
- e_cal_component_free_attendee_list (attendees);
- }
- } else
- icalcomponent_free (icalcomp);
-
- g_object_unref (comp);
-
- return GINT_TO_POINTER (retval);
- }
- case E_CAL_MODEL_FIELD_SUMMARY :
- return get_summary (comp_data);
- case E_CAL_MODEL_FIELD_UID :
- return get_uid (comp_data);
- }
-
- return "";
-}
-
-static void
-set_categories (ECalModelComponent *comp_data, const char *value)
-{
- icalproperty *prop;
-
- prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_CATEGORIES_PROPERTY);
- if (!value || !(*value)) {
- if (prop) {
- icalcomponent_remove_property (comp_data->icalcomp, prop);
- icalproperty_free (prop);
- }
- } else {
- if (!prop) {
- prop = icalproperty_new_categories (value);
- icalcomponent_add_property (comp_data->icalcomp, prop);
- } else
- icalproperty_set_categories (prop, value);
- }
-}
-
-static void
-set_classification (ECalModelComponent *comp_data, const char *value)
-{
- icalproperty *prop;
-
- prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_CLASS_PROPERTY);
- if (!value || !(*value)) {
- if (prop) {
- icalcomponent_remove_property (comp_data->icalcomp, prop);
- icalproperty_free (prop);
- }
- } else {
- icalproperty_class ical_class;
-
- if (!strcasecmp (value, "PUBLIC"))
- ical_class = ICAL_CLASS_PUBLIC;
- else if (!strcasecmp (value, "PRIVATE"))
- ical_class = ICAL_CLASS_PRIVATE;
- else if (!strcasecmp (value, "CONFIDENTIAL"))
- ical_class = ICAL_CLASS_CONFIDENTIAL;
- else
- ical_class = ICAL_CLASS_NONE;
-
- if (!prop) {
- prop = icalproperty_new_class (ical_class);
- icalcomponent_add_property (comp_data->icalcomp, prop);
- } else
- icalproperty_set_class (prop, ical_class);
- }
-}
-
-static void
-set_description (ECalModelComponent *comp_data, const char *value)
-{
- icalproperty *prop;
-
- /* remove old description(s) */
- prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_DESCRIPTION_PROPERTY);
- while (prop) {
- icalproperty *next;
-
- next = icalcomponent_get_next_property (comp_data->icalcomp, ICAL_DESCRIPTION_PROPERTY);
-
- icalcomponent_remove_property (comp_data->icalcomp, prop);
- icalproperty_free (prop);
-
- prop = next;
- }
-
- /* now add the new description */
- if (!value || !(*value))
- return;
-
- prop = icalproperty_new_description (value);
- icalcomponent_add_property (comp_data->icalcomp, prop);
-}
-
-static void
-set_dtstart (ECalModel *model, ECalModelComponent *comp_data, const void *value)
-{
- icalproperty *prop;
- ECellDateEditValue *dv = (ECellDateEditValue *) value;
-
- prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_DTSTART_PROPERTY);
- if (!dv) {
- if (prop) {
- icalcomponent_remove_property (comp_data->icalcomp, prop);
- icalproperty_free (prop);
- }
- } else
- icalcomponent_set_dtstart (comp_data->icalcomp, dv->tt);
-}
-
-static void
-set_summary (ECalModelComponent *comp_data, const char *value)
-{
- icalproperty *prop;
-
- prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_SUMMARY_PROPERTY);
-
- if (string_is_empty (value)) {
- if (prop) {
- icalcomponent_remove_property (comp_data->icalcomp, prop);
- icalproperty_free (prop);
- }
- } else {
- if (prop)
- icalproperty_set_summary (prop, value);
- else {
- prop = icalproperty_new_summary (value);
- icalcomponent_add_property (comp_data->icalcomp, prop);
- }
- }
-}
-
-static void
-ecm_set_value_at (ETableModel *etm, int col, int row, const void *value)
-{
- ECalModelPrivate *priv;
- ECalModelComponent *comp_data;
- ECalModel *model = (ECalModel *) etm;
-
- g_return_if_fail (E_IS_CAL_MODEL (model));
-
- priv = model->priv;
-
- g_return_if_fail (col >= 0 && col < E_CAL_MODEL_FIELD_LAST);
- g_return_if_fail (row >= 0 && row < priv->objects->len);
-
- comp_data = g_ptr_array_index (priv->objects, row);
- g_assert (comp_data != NULL);
-
- switch (col) {
- case E_CAL_MODEL_FIELD_CATEGORIES :
- set_categories (comp_data, value);
- break;
- case E_CAL_MODEL_FIELD_CLASSIFICATION :
- set_classification (comp_data, value);
- break;
- case E_CAL_MODEL_FIELD_DESCRIPTION :
- set_description (comp_data, value);
- break;
- case E_CAL_MODEL_FIELD_DTSTART :
- set_dtstart (model, comp_data, value);
- break;
- case E_CAL_MODEL_FIELD_SUMMARY :
- set_summary (comp_data, value);
- break;
- }
-
- /* FIXME ask about mod type */
- if (!e_cal_modify_object (comp_data->client, comp_data->icalcomp, CALOBJ_MOD_ALL, NULL)) {
- g_warning (G_STRLOC ": Could not modify the object!");
-
- /* FIXME Show error dialog */
- }
-}
-
-static gboolean
-ecm_is_cell_editable (ETableModel *etm, int col, int row)
-{
- ECalModelPrivate *priv;
- ECalModel *model = (ECalModel *) etm;
-
- g_return_val_if_fail (E_IS_CAL_MODEL (model), FALSE);
-
- priv = model->priv;
-
- g_return_val_if_fail (col >= 0 && col <= E_CAL_MODEL_FIELD_LAST, FALSE);
-
- /* FIXME: We can't check this as 'click-to-add' passes row 0. */
- /*g_return_val_if_fail (row >= 0 && row < priv->objects->len, FALSE);*/
-
- switch (col) {
- case E_CAL_MODEL_FIELD_CATEGORIES :
- case E_CAL_MODEL_FIELD_CLASSIFICATION :
- case E_CAL_MODEL_FIELD_DESCRIPTION :
- case E_CAL_MODEL_FIELD_DTSTART :
- case E_CAL_MODEL_FIELD_SUMMARY :
- return TRUE;
- }
-
- return FALSE;
-}
-
-static void
-ecm_append_row (ETableModel *etm, ETableModel *source, int row)
-{
- ECalModelClass *model_class;
- ECalModelComponent comp_data;
- ECalModel *model = (ECalModel *) etm;
-
- g_return_if_fail (E_IS_CAL_MODEL (model));
- g_return_if_fail (E_IS_TABLE_MODEL (source));
-
- memset (&comp_data, 0, sizeof (comp_data));
- comp_data.client = e_cal_model_get_default_client (model);
-
- /* guard against saving before the calendar is open */
- if (!(comp_data.client && e_cal_get_load_state (comp_data.client) == E_CAL_LOAD_LOADED))
- return;
-
- comp_data.icalcomp = e_cal_model_create_component_with_defaults (model);
-
- /* set values for our fields */
- set_categories (&comp_data, e_table_model_value_at (source, E_CAL_MODEL_FIELD_CATEGORIES, row));
- set_classification (&comp_data, e_table_model_value_at (source, E_CAL_MODEL_FIELD_CLASSIFICATION, row));
- set_description (&comp_data, e_table_model_value_at (source, E_CAL_MODEL_FIELD_DESCRIPTION, row));
- set_dtstart (model, &comp_data, e_table_model_value_at (source, E_CAL_MODEL_FIELD_DTSTART, row));
- set_summary (&comp_data, e_table_model_value_at (source, E_CAL_MODEL_FIELD_SUMMARY, row));
-
- /* call the class' method for filling the component */
- model_class = (ECalModelClass *) G_OBJECT_GET_CLASS (model);
- if (model_class->fill_component_from_model != NULL) {
- model_class->fill_component_from_model (model, &comp_data, source, row);
- }
-
-
- if (!e_cal_create_object (comp_data.client, comp_data.icalcomp, NULL, NULL)) {
- g_warning (G_STRLOC ": Could not create the object!");
-
- /* FIXME: show error dialog */
- }
-
- icalcomponent_free (comp_data.icalcomp);
-}
-
-static void *
-ecm_duplicate_value (ETableModel *etm, int col, const void *value)
-{
- g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_FIELD_LAST, NULL);
-
- switch (col) {
- case E_CAL_MODEL_FIELD_CATEGORIES :
- case E_CAL_MODEL_FIELD_CLASSIFICATION :
- case E_CAL_MODEL_FIELD_SUMMARY :
- return g_strdup (value);
- case E_CAL_MODEL_FIELD_HAS_ALARMS :
- case E_CAL_MODEL_FIELD_ICON :
- case E_CAL_MODEL_FIELD_COLOR :
- return (void *) value;
- case E_CAL_MODEL_FIELD_COMPONENT :
- return icalcomponent_new_clone ((icalcomponent *) value);
- case E_CAL_MODEL_FIELD_DTSTART :
- if (value) {
- ECellDateEditValue *dv, *orig_dv;
-
- orig_dv = (ECellDateEditValue *) value;
- dv = g_new0 (ECellDateEditValue, 1);
- *dv = *orig_dv;
-
- return dv;
- }
- break;
- }
-
- return NULL;
-}
-
-static void
-ecm_free_value (ETableModel *etm, int col, void *value)
-{
- g_return_if_fail (col >= 0 && col < E_CAL_MODEL_FIELD_LAST);
-
- switch (col) {
- case E_CAL_MODEL_FIELD_CATEGORIES :
- case E_CAL_MODEL_FIELD_DESCRIPTION :
- case E_CAL_MODEL_FIELD_SUMMARY :
- if (value)
- g_free (value);
- break;
- case E_CAL_MODEL_FIELD_CLASSIFICATION :
- case E_CAL_MODEL_FIELD_HAS_ALARMS :
- case E_CAL_MODEL_FIELD_ICON :
- case E_CAL_MODEL_FIELD_COLOR :
- break;
- case E_CAL_MODEL_FIELD_DTSTART :
- if (value)
- g_free (value);
- break;
- case E_CAL_MODEL_FIELD_COMPONENT :
- if (value)
- icalcomponent_free ((icalcomponent *) value);
- break;
- }
-}
-
-static void *
-ecm_initialize_value (ETableModel *etm, int col)
-{
- ECalModelPrivate *priv;
- ECalModel *model = (ECalModel *) etm;
-
- g_return_val_if_fail (E_IS_CAL_MODEL (model), NULL);
- g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_FIELD_LAST, NULL);
-
- priv = model->priv;
-
- switch (col) {
- case E_CAL_MODEL_FIELD_CATEGORIES :
- return g_strdup (priv->default_category);
- case E_CAL_MODEL_FIELD_CLASSIFICATION :
- case E_CAL_MODEL_FIELD_DESCRIPTION :
- case E_CAL_MODEL_FIELD_SUMMARY :
- return g_strdup ("");
- case E_CAL_MODEL_FIELD_DTSTART :
- case E_CAL_MODEL_FIELD_HAS_ALARMS :
- case E_CAL_MODEL_FIELD_ICON :
- case E_CAL_MODEL_FIELD_COLOR :
- case E_CAL_MODEL_FIELD_COMPONENT :
- return NULL;
- }
-
- return NULL;
-}
-
-static gboolean
-ecm_value_is_empty (ETableModel *etm, int col, const void *value)
-{
- ECalModelPrivate *priv;
- ECalModel *model = (ECalModel *) etm;
-
- g_return_val_if_fail (E_IS_CAL_MODEL (model), TRUE);
- g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_FIELD_LAST, TRUE);
-
- priv = model->priv;
-
- switch (col) {
- case E_CAL_MODEL_FIELD_CATEGORIES :
- /* This could be a hack or not. If the categories field only
- * contains the default category, then it possibly means that
- * the user has not entered anything at all in the click-to-add;
- * the category is in the value because we put it there in
- * ecm_initialize_value().
- */
- if (priv->default_category && value && strcmp (priv->default_category, value) == 0)
- return TRUE;
- else
- return string_is_empty (value);
- case E_CAL_MODEL_FIELD_CLASSIFICATION :
- case E_CAL_MODEL_FIELD_DESCRIPTION :
- case E_CAL_MODEL_FIELD_SUMMARY :
- return string_is_empty (value);
- case E_CAL_MODEL_FIELD_DTSTART :
- return value ? FALSE : TRUE;
- case E_CAL_MODEL_FIELD_HAS_ALARMS :
- case E_CAL_MODEL_FIELD_ICON :
- case E_CAL_MODEL_FIELD_COLOR :
- case E_CAL_MODEL_FIELD_COMPONENT :
- return TRUE;
- }
-
- return TRUE;
-}
-
-static char *
-ecm_value_to_string (ETableModel *etm, int col, const void *value)
-{
- g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_FIELD_LAST, NULL);
-
- switch (col) {
- case E_CAL_MODEL_FIELD_CATEGORIES :
- case E_CAL_MODEL_FIELD_CLASSIFICATION :
- case E_CAL_MODEL_FIELD_DESCRIPTION :
- case E_CAL_MODEL_FIELD_SUMMARY :
- return g_strdup (value);
- case E_CAL_MODEL_FIELD_DTSTART :
- return e_cal_model_date_value_to_string (E_CAL_MODEL (etm), value);
- case E_CAL_MODEL_FIELD_ICON :
- if (GPOINTER_TO_INT (value) == 0)
- return _("Normal");
- else if (GPOINTER_TO_INT (value) == 1)
- return _("Recurring");
- else
- return _("Assigned");
- case E_CAL_MODEL_FIELD_HAS_ALARMS :
- return value ? _("Yes") : _("No");
- case E_CAL_MODEL_FIELD_COLOR :
- case E_CAL_MODEL_FIELD_COMPONENT :
- return NULL;
- }
-
- return NULL;
-}
-
-/* ECalModel class methods */
-
-typedef struct {
- const gchar *color;
- GList *uris;
-} AssignedColorData;
-
-static const char *
-ecm_get_color_for_component (ECalModel *model, ECalModelComponent *comp_data)
-{
- ECalModelPrivate *priv;
- gint i, first_empty = 0;
- static AssignedColorData assigned_colors[] = {
- { "#BECEDD", NULL }, /* 190 206 221 Blue */
- { "#E2F0EF", NULL }, /* 226 240 239 Light Blue */
- { "#C6E2B7", NULL }, /* 198 226 183 Green */
- { "#E2F0D3", NULL }, /* 226 240 211 Light Green */
- { "#E2D4B7", NULL }, /* 226 212 183 Khaki */
- { "#EAEAC1", NULL }, /* 234 234 193 Light Khaki */
- { "#F0B8B7", NULL }, /* 240 184 183 Pink */
- { "#FED4D3", NULL }, /* 254 212 211 Light Pink */
- { "#E2C6E1", NULL }, /* 226 198 225 Purple */
- { "#F0E2EF", NULL } /* 240 226 239 Light Purple */
- };
-
- g_return_val_if_fail (E_IS_CAL_MODEL (model), NULL);
-
- priv = model->priv;
-
- for (i = 0; i < G_N_ELEMENTS (assigned_colors); i++) {
- GList *l;
-
- if (assigned_colors[i].uris == NULL) {
- first_empty = i;
- continue;
- }
-
- for (l = assigned_colors[i].uris; l != NULL; l = l->next) {
- if (!strcmp ((const char *) l->data,
- e_cal_get_uri (comp_data->client)))
- {
- return assigned_colors[i].color;
- }
- }
- }
-
- /* return the first unused color */
- assigned_colors[first_empty].uris = g_list_append (assigned_colors[first_empty].uris,
- g_strdup (e_cal_get_uri (comp_data->client)));
-
- return assigned_colors[first_empty].color;
-}
-
-/**
- * e_cal_model_get_component_kind
- */
-icalcomponent_kind
-e_cal_model_get_component_kind (ECalModel *model)
-{
- ECalModelPrivate *priv;
-
- g_return_val_if_fail (E_IS_CAL_MODEL (model), ICAL_NO_COMPONENT);
-
- priv = model->priv;
- return priv->kind;
-}
-
-/**
- * e_cal_model_set_component_kind
- */
-void
-e_cal_model_set_component_kind (ECalModel *model, icalcomponent_kind kind)
-{
- ECalModelPrivate *priv;
-
- g_return_if_fail (E_IS_CAL_MODEL (model));
-
- priv = model->priv;
- priv->kind = kind;
-}
-
-/**
- * e_cal_model_get_timezone
- */
-icaltimezone *
-e_cal_model_get_timezone (ECalModel *model)
-{
- g_return_val_if_fail (E_IS_CAL_MODEL (model), NULL);
- return model->priv->zone;
-}
-
-/**
- * e_cal_model_set_timezone
- */
-void
-e_cal_model_set_timezone (ECalModel *model, icaltimezone *zone)
-{
- ECalModelPrivate *priv;
-
- g_return_if_fail (E_IS_CAL_MODEL (model));
-
- priv = model->priv;
- if (priv->zone != zone) {
- e_table_model_pre_change (E_TABLE_MODEL (model));
- priv->zone = zone;
-
- /* the timezone affects the times shown for date fields,
- so we need to redisplay everything */
- e_table_model_changed (E_TABLE_MODEL (model));
- }
-}
-
-/**
- * e_cal_model_set_default_category
- */
-void
-e_cal_model_set_default_category (ECalModel *model, const gchar *default_cat)
-{
- g_return_if_fail (E_IS_CAL_MODEL (model));
-
- if (model->priv->default_category)
- g_free (model->priv->default_category);
-
- model->priv->default_category = g_strdup (default_cat);
-}
-
-/**
- * e_cal_model_get_use_24_hour_format
- */
-gboolean
-e_cal_model_get_use_24_hour_format (ECalModel *model)
-{
- g_return_val_if_fail (E_IS_CAL_MODEL (model), FALSE);
-
- return model->priv->use_24_hour_format;
-}
-
-/**
- * e_cal_model_set_use_24_hour_format
- */
-void
-e_cal_model_set_use_24_hour_format (ECalModel *model, gboolean use24)
-{
- g_return_if_fail (E_IS_CAL_MODEL (model));
-
- if (model->priv->use_24_hour_format != use24) {
- e_table_model_pre_change (E_TABLE_MODEL (model));
- model->priv->use_24_hour_format = use24;
- /* Get the views to redraw themselves. */
- e_table_model_changed (E_TABLE_MODEL (model));
- }
-}
-
-/**
- * e_cal_model_get_default_client
- */
-ECal *
-e_cal_model_get_default_client (ECalModel *model)
-{
- ECalModelPrivate *priv;
- ECalModelClient *client_data;
-
- g_return_val_if_fail (model != NULL, NULL);
- g_return_val_if_fail (E_IS_CAL_MODEL (model), NULL);
-
- priv = model->priv;
-
- /* we always return a valid ECal, since we rely on it in many places */
- if (priv->default_client)
- return priv->default_client;
-
- if (!priv->clients)
- return NULL;
-
- client_data = (ECalModelClient *) priv->clients->data;
-
- return client_data ? client_data->client : NULL;
-}
-
-void
-e_cal_model_set_default_client (ECalModel *model, ECal *client)
-{
- ECalModelPrivate *priv;
- GList *l;
- gboolean found = FALSE;
-
- g_return_if_fail (model != NULL);
- g_return_if_fail (E_IS_CAL_MODEL (model));
- g_return_if_fail (client != NULL);
- g_return_if_fail (E_IS_CAL (client));
-
- priv = model->priv;
-
- /* See if we already know about the client */
- for (l = priv->clients; l != NULL; l = l->next) {
- ECalModelClient *client_data = l->data;
-
- if (client == client_data->client)
- found = TRUE;
- }
-
- /* If its not found, add it */
- if (!found)
- e_cal_model_add_client (model, client);
-
- /* Store the default client */
- priv->default_client = client;
-}
-
-/**
- * e_cal_model_get_client_list
- */
-GList *
-e_cal_model_get_client_list (ECalModel *model)
-{
- GList *list = NULL, *l;
-
- g_return_val_if_fail (E_IS_CAL_MODEL (model), NULL);
-
- for (l = model->priv->clients; l != NULL; l = l->next) {
- ECalModelClient *client_data = (ECalModelClient *) l->data;
-
- list = g_list_append (list, client_data->client);
- }
-
- return list;
-}
-
-/**
- * e_cal_model_get_client_for_uri
- * @model: A calendar model.
- * @uri: Uri for the client to get.
- */
-ECal *
-e_cal_model_get_client_for_uri (ECalModel *model, const char *uri)
-{
- GList *l;
-
- g_return_val_if_fail (E_IS_CAL_MODEL (model), NULL);
- g_return_val_if_fail (uri != NULL, NULL);
-
- for (l = model->priv->clients; l != NULL; l = l->next) {
- ECalModelClient *client_data = (ECalModelClient *) l->data;
-
- if (!strcmp (uri, e_cal_get_uri (client_data->client)))
- return client_data->client;
- }
-
- return NULL;
-}
-
-static ECalModelComponent *
-search_by_uid_and_client (ECalModelPrivate *priv, ECal *client, const char *uid)
-{
- gint i;
-
- for (i = 0; i < priv->objects->len; i++) {
- ECalModelComponent *comp_data = g_ptr_array_index (priv->objects, i);
-
- if (comp_data) {
- const char *tmp_uid;
-
- tmp_uid = icalcomponent_get_uid (comp_data->icalcomp);
- if (tmp_uid && *tmp_uid) {
- if (comp_data->client == client && !strcmp (uid, tmp_uid))
- return comp_data;
- }
- }
- }
-
- return NULL;
-}
-
-static gint
-get_position_in_array (GPtrArray *objects, gpointer item)
-{
- gint i;
-
- for (i = 0; i < objects->len; i++) {
- if (g_ptr_array_index (objects, i) == item)
- return i;
- }
-
- return -1;
-}
-
-static void
-e_cal_view_objects_added_cb (ECalView *query, GList *objects, gpointer user_data)
-{
- ECalModel *model = (ECalModel *) user_data;
- ECalModelPrivate *priv;
- GList *l;
-
- priv = model->priv;
-
- for (l = objects; l; l = l->next) {
- ECalModelComponent *comp_data;
-
- e_table_model_pre_change (E_TABLE_MODEL (model));
-
- comp_data = g_new0 (ECalModelComponent, 1);
- comp_data->client = e_cal_view_get_client (query);
- comp_data->icalcomp = icalcomponent_new_clone (l->data);
-
- g_ptr_array_add (priv->objects, comp_data);
-
- e_table_model_row_inserted (E_TABLE_MODEL (model), priv->objects->len - 1);
- }
-}
-
-static void
-e_cal_view_objects_modified_cb (ECalView *query, GList *objects, gpointer user_data)
-{
- ECalModelPrivate *priv;
- ECalModel *model = (ECalModel *) user_data;
- GList *l;
-
- priv = model->priv;
-
- for (l = objects; l; l = l->next) {
- ECalModelComponent *comp_data;
-
- e_table_model_pre_change (E_TABLE_MODEL (model));
-
- comp_data = search_by_uid_and_client (priv, e_cal_view_get_client (query), icalcomponent_get_uid (l->data));
- g_assert (comp_data);
-
- if (comp_data->icalcomp)
- icalcomponent_free (comp_data->icalcomp);
- if (comp_data->dtstart) {
- g_free (comp_data->dtstart);
- comp_data->dtstart = NULL;
- }
- if (comp_data->dtend) {
- g_free (comp_data->dtend);
- comp_data->dtend = NULL;
- }
- if (comp_data->due) {
- g_free (comp_data->due);
- comp_data->due = NULL;
- }
- if (comp_data->completed) {
- g_free (comp_data->completed);
- comp_data->completed = NULL;
- }
-
- comp_data->icalcomp = icalcomponent_new_clone (l->data);
-
- e_table_model_row_changed (E_TABLE_MODEL (model), get_position_in_array (priv->objects, comp_data));
- }
-}
-
-static void
-e_cal_view_objects_removed_cb (ECalView *query, GList *uids, gpointer user_data)
-{
- ECalModelPrivate *priv;
- ECalModel *model = (ECalModel *) user_data;
- GList *l;
-
- priv = model->priv;
-
- for (l = uids; l; l = l->next) {
- ECalModelComponent *comp_data;
- int pos;
-
- e_table_model_pre_change (E_TABLE_MODEL (model));
-
- comp_data = search_by_uid_and_client (priv, e_cal_view_get_client (query), l->data);
- g_assert (comp_data);
-
- pos = get_position_in_array (priv->objects, comp_data);
-
- g_ptr_array_remove (priv->objects, comp_data);
- free_comp_data (comp_data);
-
- e_table_model_row_deleted (E_TABLE_MODEL (model), pos);
- }
-}
-
-static void
-e_cal_view_progress_cb (ECalView *query, const char *message, int percent, gpointer user_data)
-{
- ECalModel *model = (ECalModel *) user_data;
-
- g_return_if_fail (E_IS_CAL_MODEL (model));
-
- /* FIXME Update status bar */
-}
-
-static void
-e_cal_view_done_cb (ECalView *query, ECalendarStatus status, gpointer user_data)
-{
- ECalModel *model = (ECalModel *) user_data;
-
- g_return_if_fail (E_IS_CAL_MODEL (model));
-
- /* FIXME Clear status bar */
-}
-
-static void
-update_e_cal_view_for_client (ECalModel *model, ECalModelClient *client_data)
-{
- ECalModelPrivate *priv;
-
- priv = model->priv;
-
- /* free the previous query, if any */
- if (client_data->query) {
- g_signal_handlers_disconnect_matched (client_data->query, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, model);
- g_object_unref (client_data->query);
- client_data->query = NULL;
- }
-
- /* prepare the query */
- g_assert (priv->sexp != NULL);
-
- if (!e_cal_get_query (client_data->client, priv->sexp, &client_data->query, NULL)) {
- g_warning (G_STRLOC ": Unable to get query");
-
- return;
- }
-
- g_signal_connect (client_data->query, "objects_added", G_CALLBACK (e_cal_view_objects_added_cb), model);
- g_signal_connect (client_data->query, "objects_modified", G_CALLBACK (e_cal_view_objects_modified_cb), model);
- g_signal_connect (client_data->query, "objects_removed", G_CALLBACK (e_cal_view_objects_removed_cb), model);
- g_signal_connect (client_data->query, "view_progress", G_CALLBACK (e_cal_view_progress_cb), model);
- g_signal_connect (client_data->query, "view_done", G_CALLBACK (e_cal_view_done_cb), model);
-
- e_cal_view_start (client_data->query);
-}
-
-static void
-backend_died_cb (ECal *client, gpointer user_data)
-{
- ECalModel *model;
-
- model = E_CAL_MODEL (user_data);
-
- e_cal_model_remove_client (model, client);
-}
-
-static void
-add_new_client (ECalModel *model, ECal *client)
-{
- ECalModelPrivate *priv;
- ECalModelClient *client_data;
-
- priv = model->priv;
-
- client_data = g_new0 (ECalModelClient, 1);
- client_data->client = client;
- client_data->query = NULL;
- g_object_ref (client_data->client);
-
- priv->clients = g_list_append (priv->clients, client_data);
-
- g_signal_connect (G_OBJECT (client_data->client), "backend_died",
- G_CALLBACK (backend_died_cb), model);
-
- update_e_cal_view_for_client (model, client_data);
-}
-
-static void
-cal_opened_cb (ECal *client, ECalendarStatus status, gpointer user_data)
-{
- ECalModel *model = (ECalModel *) user_data;
-
- if (status != E_CALENDAR_STATUS_OK)
- return;
-
- add_new_client (model, client);
-}
-
-/**
- * e_cal_model_add_client
- */
-void
-e_cal_model_add_client (ECalModel *model, ECal *client)
-{
- ECalModelPrivate *priv;
-
- g_return_if_fail (E_IS_CAL_MODEL (model));
- g_return_if_fail (E_IS_CAL (client));
-
- priv = model->priv;
-
- if (e_cal_get_load_state (client) == E_CAL_LOAD_LOADED)
- add_new_client (model, client);
- else
- g_signal_connect (client, "cal_opened", G_CALLBACK (cal_opened_cb), model);
-}
-
-static void
-remove_client (ECalModel *model, ECalModelClient *client_data)
-{
- gint i;
-
- g_signal_handlers_disconnect_matched (client_data->client, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, model);
- g_signal_handlers_disconnect_matched (client_data->query, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, model);
-
- model->priv->clients = g_list_remove (model->priv->clients, client_data);
-
- /* remove all objects belonging to this client */
- e_table_model_pre_change (E_TABLE_MODEL (model));
- for (i = model->priv->objects->len; i > 0; i--) {
- ECalModelComponent *comp_data = (ECalModelComponent *) g_ptr_array_index (model->priv->objects, i - 1);
-
- g_assert (comp_data != NULL);
-
- if (comp_data->client == client_data->client) {
- g_ptr_array_remove (model->priv->objects, comp_data);
- free_comp_data (comp_data);
- }
- }
- e_table_model_changed (E_TABLE_MODEL (model));
-
- /* free all remaining memory */
- g_object_unref (client_data->client);
- g_object_unref (client_data->query);
- g_free (client_data);
-
-}
-
-/**
- * e_cal_model_remove_client
- */
-void
-e_cal_model_remove_client (ECalModel *model, ECal *client)
-{
- GList *l;
- ECalModelPrivate *priv;
-
- g_return_if_fail (E_IS_CAL_MODEL (model));
- g_return_if_fail (E_IS_CAL (client));
-
- priv = model->priv;
- for (l = priv->clients; l != NULL; l = l->next) {
- ECalModelClient *client_data = (ECalModelClient *) l->data;
-
- if (client_data->client == client) {
- remove_client (model, client_data);
- break;
- }
- }
-}
-
-/**
- * e_cal_model_remove_all_clients
- */
-void
-e_cal_model_remove_all_clients (ECalModel *model)
-{
- ECalModelPrivate *priv;
-
- g_return_if_fail (E_IS_CAL_MODEL (model));
-
- priv = model->priv;
- while (priv->clients != NULL) {
- ECalModelClient *client_data = (ECalModelClient *) priv->clients->data;
- remove_client (model, client_data);
- }
-}
-
-/**
- * e_cal_model_set_query
- */
-void
-e_cal_model_set_query (ECalModel *model, const char *sexp)
-{
- ECalModelPrivate *priv;
- GList *l;
-
- g_return_if_fail (E_IS_CAL_MODEL (model));
- g_return_if_fail (sexp != NULL);
-
- priv = model->priv;
-
- if (priv->sexp)
- g_free (priv->sexp);
-
- priv->sexp = g_strdup (sexp);
-
- /* clean up the current contents */
- e_table_model_pre_change (E_TABLE_MODEL (model));
- clear_objects_array (priv);
- e_table_model_changed (E_TABLE_MODEL (model));
-
- /* update the query for all clients */
- for (l = priv->clients; l != NULL; l = l->next) {
- ECalModelClient *client_data;
-
- client_data = (ECalModelClient *) l->data;
- update_e_cal_view_for_client (model, client_data);
- }
-}
-
-/**
- * e_cal_model_create_component_with_defaults
- */
-icalcomponent *
-e_cal_model_create_component_with_defaults (ECalModel *model)
-{
- ECalModelPrivate *priv;
- ECalComponent *comp;
- icalcomponent *icalcomp;
- ECal *client;
-
- g_return_val_if_fail (E_IS_CAL_MODEL (model), NULL);
-
- priv = model->priv;
-
- g_return_val_if_fail (priv->clients != NULL, NULL);
-
- client = e_cal_model_get_default_client (model);
- if (!client)
- return icalcomponent_new (priv->kind);
-
- switch (priv->kind) {
- case ICAL_VEVENT_COMPONENT :
- comp = cal_comp_event_new_with_defaults (client);
- break;
- case ICAL_VTODO_COMPONENT :
- comp = cal_comp_task_new_with_defaults (client);
- break;
- default:
- return NULL;
- }
-
- if (!comp)
- return icalcomponent_new (priv->kind);
-
- icalcomp = icalcomponent_new_clone (e_cal_component_get_icalcomponent (comp));
- g_object_unref (comp);
-
- /* make sure the component has an UID */
- if (!icalcomponent_get_uid (icalcomp)) {
- char *uid;
-
- uid = e_cal_component_gen_uid ();
- icalcomponent_set_uid (icalcomp, uid);
-
- g_free (uid);
- }
-
- return icalcomp;
-}
-
-/**
- * e_cal_model_get_color_for_component
- */
-const gchar *
-e_cal_model_get_color_for_component (ECalModel *model, ECalModelComponent *comp_data)
-{
- ECalModelClass *model_class;
- const gchar *color = NULL;
-
- g_return_val_if_fail (E_IS_CAL_MODEL (model), NULL);
- g_return_val_if_fail (comp_data != NULL, NULL);
-
- model_class = (ECalModelClass *) G_OBJECT_GET_CLASS (model);
- if (model_class->get_color_for_component != NULL)
- color = model_class->get_color_for_component (model, comp_data);
-
- if (!color)
- color = ecm_get_color_for_component (model, comp_data);
-
- return color;
-}
-
-/**
- * e_cal_model_get_component_at
- */
-ECalModelComponent *
-e_cal_model_get_component_at (ECalModel *model, gint row)
-{
- ECalModelPrivate *priv;
-
- g_return_val_if_fail (E_IS_CAL_MODEL (model), NULL);
-
- priv = model->priv;
-
- g_return_val_if_fail (row >= 0 && row < priv->objects->len, NULL);
-
- return g_ptr_array_index (priv->objects, row);
-}
-
-/**
- * e_cal_model_date_value_to_string
- */
-gchar*
-e_cal_model_date_value_to_string (ECalModel *model, const void *value)
-{
- ECalModelPrivate *priv;
- ECellDateEditValue *dv = (ECellDateEditValue *) value;
- struct icaltimetype tt;
- struct tm tmp_tm;
- char buffer[64];
-
- g_return_val_if_fail (E_IS_CAL_MODEL (model), NULL);
-
- priv = model->priv;
-
- if (!dv)
- return g_strdup ("");
-
- /* We currently convert all the dates to the current timezone. */
- tt = dv->tt;
- icaltimezone_convert_time (&tt, dv->zone, priv->zone);
-
- tmp_tm.tm_year = tt.year - 1900;
- tmp_tm.tm_mon = tt.month - 1;
- tmp_tm.tm_mday = tt.day;
- tmp_tm.tm_hour = tt.hour;
- tmp_tm.tm_min = tt.minute;
- tmp_tm.tm_sec = tt.second;
- tmp_tm.tm_isdst = -1;
-
- tmp_tm.tm_wday = time_day_of_week (tt.day, tt.month - 1, tt.year);
-
- memset (buffer, 0, sizeof (buffer));
- e_time_format_date_and_time (&tmp_tm, priv->use_24_hour_format,
- TRUE, FALSE,
- buffer, sizeof (buffer));
- return g_strdup (buffer);
-}
-
-/**
- * e_cal_model_free_component_data
- */
-void
-e_cal_model_free_component_data (ECalModelComponent *comp_data)
-{
- g_return_if_fail (comp_data != NULL);
-
- if (comp_data->icalcomp)
- icalcomponent_free (comp_data->icalcomp);
- if (comp_data->dtstart)
- g_free (comp_data->dtstart);
- if (comp_data->dtend)
- g_free (comp_data->dtend);
- if (comp_data->due)
- g_free (comp_data->due);
- if (comp_data->completed)
- g_free (comp_data->completed);
-
- g_free (comp_data);
-}
diff --git a/calendar/gui/e-cal-model.h b/calendar/gui/e-cal-model.h
deleted file mode 100644
index 9f193b4f07..0000000000
--- a/calendar/gui/e-cal-model.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/* Evolution calendar - Data model for ETable
- *
- * Copyright (C) 2000 Ximian, Inc.
- * Copyright (C) 2000 Ximian, Inc.
- *
- * Authors: Rodrigo Moya <rodrigo@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef E_CAL_MODEL_H
-#define E_CAL_MODEL_H
-
-#include <gal/e-table/e-table-model.h>
-#include <libecal/e-cal.h>
-#include "e-cell-date-edit-text.h"
-
-G_BEGIN_DECLS
-
-#define E_TYPE_CAL_MODEL (e_cal_model_get_type ())
-#define E_CAL_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_CAL_MODEL, ECalModel))
-#define E_CAL_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_CAL_MODEL, ECalModelClass))
-#define E_IS_CAL_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_CAL_MODEL))
-#define E_IS_CAL_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_CAL_MODEL))
-
-typedef struct _ECalModelPrivate ECalModelPrivate;
-
-typedef enum {
- /* If you add new items here or reorder them, you have to update the
- .etspec files for the tables using this model */
- E_CAL_MODEL_FIELD_CATEGORIES,
- E_CAL_MODEL_FIELD_CLASSIFICATION,
- E_CAL_MODEL_FIELD_COLOR, /* not a real field */
- E_CAL_MODEL_FIELD_COMPONENT, /* not a real field */
- E_CAL_MODEL_FIELD_DESCRIPTION,
- E_CAL_MODEL_FIELD_DTSTART,
- E_CAL_MODEL_FIELD_HAS_ALARMS, /* not a real field */
- E_CAL_MODEL_FIELD_ICON, /* not a real field */
- E_CAL_MODEL_FIELD_SUMMARY,
- E_CAL_MODEL_FIELD_UID,
- E_CAL_MODEL_FIELD_LAST
-} ECalModelField;
-
-typedef struct {
- ECal *client;
- icalcomponent *icalcomp;
-
- /* private data */
- ECellDateEditValue *dtstart;
- ECellDateEditValue *dtend;
- ECellDateEditValue *due;
- ECellDateEditValue *completed;
-} ECalModelComponent;
-
-typedef struct {
- ETableModel model;
- ECalModelPrivate *priv;
-} ECalModel;
-
-typedef struct {
- ETableModelClass parent_class;
-
- /* virtual methods */
- const gchar * (* get_color_for_component) (ECalModel *model, ECalModelComponent *comp_data);
- void (* fill_component_from_model) (ECalModel *model, ECalModelComponent *comp_data,
- ETableModel *source_model, gint row);
-} ECalModelClass;
-
-GType e_cal_model_get_type (void);
-
-icalcomponent_kind e_cal_model_get_component_kind (ECalModel *model);
-void e_cal_model_set_component_kind (ECalModel *model, icalcomponent_kind kind);
-icaltimezone *e_cal_model_get_timezone (ECalModel *model);
-void e_cal_model_set_timezone (ECalModel *model, icaltimezone *zone);
-
-void e_cal_model_set_default_category (ECalModel *model, const gchar *default_cat);
-gboolean e_cal_model_get_use_24_hour_format (ECalModel *model);
-void e_cal_model_set_use_24_hour_format (ECalModel *model, gboolean use24);
-
-ECal *e_cal_model_get_default_client (ECalModel *model);
-void e_cal_model_set_default_client (ECalModel *model, ECal *client);
-GList *e_cal_model_get_client_list (ECalModel *model);
-ECal *e_cal_model_get_client_for_uri (ECalModel *model, const char *uri);
-void e_cal_model_add_client (ECalModel *model, ECal *client);
-void e_cal_model_remove_client (ECalModel *model, ECal *client);
-void e_cal_model_remove_all_clients (ECalModel *model);
-
-void e_cal_model_set_query (ECalModel *model, const gchar *sexp);
-
-icalcomponent *e_cal_model_create_component_with_defaults (ECalModel *model);
-const gchar *e_cal_model_get_color_for_component (ECalModel *model, ECalModelComponent *comp_data);
-ECalModelComponent *e_cal_model_get_component_at (ECalModel *model, gint row);
-
-gchar *e_cal_model_date_value_to_string (ECalModel *model, const void *value);
-
-void e_cal_model_free_component_data (ECalModelComponent *comp_data);
-
-G_END_DECLS
-
-#endif
diff --git a/calendar/gui/e-cal-view.c b/calendar/gui/e-cal-view.c
deleted file mode 100644
index f93cee6c10..0000000000
--- a/calendar/gui/e-cal-view.c
+++ /dev/null
@@ -1,1492 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Author :
- * Rodrigo Moya <rodrigo@ximian.com>
- *
- * Copyright 2003, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#include <config.h>
-#include <string.h>
-#include <gtk/gtkimage.h>
-#include <gtk/gtkstock.h>
-#include <libgnome/gnome-i18n.h>
-#include <gal/util/e-util.h>
-#include "e-util/e-dialog-utils.h"
-#include "e-calendar-marshal.h"
-#include <libecal/e-cal-time-util.h>
-
-#include "calendar-commands.h"
-#include "calendar-component.h"
-#include "calendar-config.h"
-#include "comp-util.h"
-#include "e-cal-model-calendar.h"
-#include "e-cal-view.h"
-#include "e-comp-editor-registry.h"
-#include "itip-utils.h"
-#include "dialogs/delete-comp.h"
-#include "dialogs/delete-error.h"
-#include "dialogs/event-editor.h"
-#include "dialogs/send-comp.h"
-#include "dialogs/cancel-comp.h"
-#include "dialogs/recur-comp.h"
-#include "print.h"
-#include "goto.h"
-#include "ea-calendar.h"
-
-/* Used for the status bar messages */
-#define EVOLUTION_CALENDAR_PROGRESS_IMAGE "evolution-calendar-mini.png"
-static GdkPixbuf *progress_icon = NULL;
-
-struct _ECalendarViewPrivate {
- /* The GnomeCalendar we are associated to */
- GnomeCalendar *calendar;
-
- /* The calendar model we are monitoring */
- ECalModel *model;
-
- /* Current activity (for the EActivityHandler, i.e. the status bar). */
- guint activity_id;
-
- /* clipboard selections */
- gchar *clipboard_selection;
-
- /* The popup menu */
- EPopupMenu *view_menu;
-
- /* The default category */
- char *default_category;
-};
-
-static void e_calendar_view_class_init (ECalendarViewClass *klass);
-static void e_calendar_view_init (ECalendarView *cal_view, ECalendarViewClass *klass);
-static void e_calendar_view_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
-static void e_calendar_view_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec);
-static void e_calendar_view_destroy (GtkObject *object);
-
-static GObjectClass *parent_class = NULL;
-static GdkAtom clipboard_atom = GDK_NONE;
-extern ECompEditorRegistry *comp_editor_registry;
-
-/* Property IDs */
-enum props {
- PROP_0,
- PROP_MODEL,
-};
-
-/* FIXME Why are we emitting these event signals here? Can't the model just be listened to? */
-/* Signal IDs */
-enum {
- SELECTION_CHANGED,
- SELECTED_TIME_CHANGED,
- TIMEZONE_CHANGED,
- EVENT_CHANGED,
- EVENT_ADDED,
- LAST_SIGNAL
-};
-
-static guint e_calendar_view_signals[LAST_SIGNAL] = { 0 };
-
-static void
-e_calendar_view_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
-{
- ECalendarView *cal_view;
- ECalendarViewPrivate *priv;
-
- cal_view = E_CALENDAR_VIEW (object);
- priv = cal_view->priv;
-
- switch (property_id) {
- case PROP_MODEL:
- e_calendar_view_set_model (cal_view, E_CAL_MODEL (g_value_get_object (value)));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
- break;
- }
-}
-
-static void
-e_calendar_view_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
-{
- ECalendarView *cal_view;
- ECalendarViewPrivate *priv;
-
- cal_view = E_CALENDAR_VIEW (object);
- priv = cal_view->priv;
-
- switch (property_id) {
- case PROP_MODEL:
- g_value_set_object (value, e_calendar_view_get_model (cal_view));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
- break;
- }
-}
-
-static void
-e_calendar_view_class_init (ECalendarViewClass *klass)
-{
- GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_peek_parent (klass);
-
- /* Method override */
- gobject_class->set_property = e_calendar_view_set_property;
- gobject_class->get_property = e_calendar_view_get_property;
- object_class->destroy = e_calendar_view_destroy;
-
- klass->selection_changed = NULL;
- klass->selected_time_changed = NULL;
- klass->event_changed = NULL;
- klass->event_added = NULL;
-
- klass->get_selected_events = NULL;
- klass->get_selected_time_range = NULL;
- klass->set_selected_time_range = NULL;
- klass->get_visible_time_range = NULL;
- klass->update_query = NULL;
-
- g_object_class_install_property (gobject_class, PROP_MODEL,
- g_param_spec_object ("model", NULL, NULL, E_TYPE_CAL_MODEL,
- G_PARAM_READABLE | G_PARAM_WRITABLE
- | G_PARAM_CONSTRUCT));
-
- /* Create class' signals */
- e_calendar_view_signals[SELECTION_CHANGED] =
- g_signal_new ("selection_changed",
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ECalendarViewClass, selection_changed),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
- e_calendar_view_signals[SELECTED_TIME_CHANGED] =
- g_signal_new ("selected_time_changed",
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ECalendarViewClass, selected_time_changed),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
- e_calendar_view_signals[TIMEZONE_CHANGED] =
- g_signal_new ("timezone_changed",
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ECalendarViewClass, timezone_changed),
- NULL, NULL,
- e_calendar_marshal_VOID__POINTER_POINTER,
- G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_POINTER);
-
- e_calendar_view_signals[EVENT_CHANGED] =
- g_signal_new ("event_changed",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
- G_STRUCT_OFFSET (ECalendarViewClass, event_changed),
- NULL, NULL,
- g_cclosure_marshal_VOID__POINTER,
- G_TYPE_NONE, 1,
- G_TYPE_POINTER);
-
- e_calendar_view_signals[EVENT_ADDED] =
- g_signal_new ("event_added",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
- G_STRUCT_OFFSET (ECalendarViewClass, event_added),
- NULL, NULL,
- g_cclosure_marshal_VOID__POINTER,
- G_TYPE_NONE, 1,
- G_TYPE_POINTER);
-
- /* clipboard atom */
- if (!clipboard_atom)
- clipboard_atom = gdk_atom_intern ("CLIPBOARD", FALSE);
-
- /* init the accessibility support for e_day_view */
- e_cal_view_a11y_init ();
-}
-
-static void
-model_changed_cb (ETableModel *etm, gpointer user_data)
-{
- ECalendarView *cal_view = E_CALENDAR_VIEW (user_data);
-
- e_calendar_view_update_query (cal_view);
-}
-
-static void
-model_row_changed_cb (ETableModel *etm, int row, gpointer user_data)
-{
- ECalendarView *cal_view = E_CALENDAR_VIEW (user_data);
-
- e_calendar_view_update_query (cal_view);
-}
-
-static void
-model_cell_changed_cb (ETableModel *etm, int col, int row, gpointer user_data)
-{
- ECalendarView *cal_view = E_CALENDAR_VIEW (user_data);
-
- e_calendar_view_update_query (cal_view);
-}
-
-static void
-model_rows_changed_cb (ETableModel *etm, int row, int count, gpointer user_data)
-{
- ECalendarView *cal_view = E_CALENDAR_VIEW (user_data);
-
- e_calendar_view_update_query (cal_view);
-}
-
-void
-e_calendar_view_add_event (ECalendarView *cal_view, ECal *client, time_t dtstart,
- icaltimezone *default_zone, icalcomponent *icalcomp, gboolean in_top_canvas)
-{
- ECalComponent *comp;
- struct icaltimetype itime, old_dtstart, old_dtend;
- time_t tt_start, tt_end, new_dtstart;
- struct icaldurationtype ic_dur;
- char *uid;
- gint start_offset, end_offset;
- gboolean all_day_event;
-
- start_offset = 0;
- end_offset = 0;
-
- old_dtstart = icalcomponent_get_dtstart (icalcomp);
- tt_start = icaltime_as_timet (old_dtstart);
- old_dtend = icalcomponent_get_dtend (icalcomp);
- tt_end = icaltime_as_timet (old_dtend);
- ic_dur = icaldurationtype_from_int (tt_end - tt_start);
-
- if (icaldurationtype_as_int (ic_dur) > 60*60*24) {
- /* This is a long event */
- start_offset = old_dtstart.hour * 60 + old_dtstart.minute;
- end_offset = old_dtstart.hour * 60 + old_dtend.minute;
- }
-
- if (start_offset == 0 && end_offset == 0 && in_top_canvas)
- all_day_event = TRUE;
- else
- all_day_event = FALSE;
-
- if (in_top_canvas)
- new_dtstart = dtstart + start_offset * 60;
- else
- new_dtstart = dtstart;
-
- itime = icaltime_from_timet_with_zone (new_dtstart, FALSE, default_zone);
- if (all_day_event)
- itime.is_date = TRUE;
- icalcomponent_set_dtstart (icalcomp, itime);
-
- itime = icaltime_add (itime, ic_dur);
- if (all_day_event)
- itime.is_date = TRUE;
- icalcomponent_set_dtend (icalcomp, itime);
-
- /* FIXME The new uid stuff can go away once we actually set it in the backend */
- uid = e_cal_component_gen_uid ();
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (
- comp, icalcomponent_new_clone (icalcomp));
- e_cal_component_set_uid (comp, uid);
-
- /* FIXME Error handling */
- if (e_cal_create_object (client, e_cal_component_get_icalcomponent (comp), NULL, NULL)) {
- if (itip_organizer_is_user (comp, client) &&
- send_component_dialog ((GtkWindow *) gtk_widget_get_toplevel (GTK_WIDGET (cal_view)),
- client, comp, TRUE)) {
- itip_send_comp (E_CAL_COMPONENT_METHOD_REQUEST, comp,
- client, NULL);
- }
- } else {
- g_message (G_STRLOC ": Could not create the object!");
- }
-
- free (uid);
- g_object_unref (comp);
-}
-
-static void
-e_calendar_view_init (ECalendarView *cal_view, ECalendarViewClass *klass)
-{
- cal_view->priv = g_new0 (ECalendarViewPrivate, 1);
-
- cal_view->priv->model = (ECalModel *) e_cal_model_calendar_new ();
- g_signal_connect (G_OBJECT (cal_view->priv->model), "model_changed",
- G_CALLBACK (model_changed_cb), cal_view);
- g_signal_connect (G_OBJECT (cal_view->priv->model), "model_row_changed",
- G_CALLBACK (model_row_changed_cb), cal_view);
- g_signal_connect (G_OBJECT (cal_view->priv->model), "model_cell_changed",
- G_CALLBACK (model_cell_changed_cb), cal_view);
- g_signal_connect (G_OBJECT (cal_view->priv->model), "model_rows_inserted",
- G_CALLBACK (model_rows_changed_cb), cal_view);
- g_signal_connect (G_OBJECT (cal_view->priv->model), "model_rows_deleted",
- G_CALLBACK (model_rows_changed_cb), cal_view);
-
- cal_view->priv->clipboard_selection = NULL;
-}
-
-static void
-e_calendar_view_destroy (GtkObject *object)
-{
- ECalendarView *cal_view = (ECalendarView *) object;
-
- g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
-
- if (cal_view->priv) {
- if (cal_view->priv->model) {
- g_signal_handlers_disconnect_matched (cal_view->priv->model,
- G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, cal_view);
- g_object_unref (cal_view->priv->model);
- cal_view->priv->model = NULL;
- }
-
- if (cal_view->priv->clipboard_selection) {
- g_free (cal_view->priv->clipboard_selection);
- cal_view->priv->clipboard_selection = NULL;
- }
-
- if (cal_view->priv->default_category) {
- g_free (cal_view->priv->default_category);
- cal_view->priv->default_category = NULL;
- }
-
- g_free (cal_view->priv);
- cal_view->priv = NULL;
- }
-
- if (GTK_OBJECT_CLASS (parent_class)->destroy)
- GTK_OBJECT_CLASS (parent_class)->destroy (object);
-}
-
-E_MAKE_TYPE (e_calendar_view, "ECalendarView", ECalendarView, e_calendar_view_class_init,
- e_calendar_view_init, GTK_TYPE_TABLE);
-
-GnomeCalendar *
-e_calendar_view_get_calendar (ECalendarView *cal_view)
-{
- g_return_val_if_fail (E_IS_CALENDAR_VIEW (cal_view), NULL);
-
- return cal_view->priv->calendar;
-}
-
-void
-e_calendar_view_set_calendar (ECalendarView *cal_view, GnomeCalendar *calendar)
-{
- g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
-
- cal_view->priv->calendar = calendar;
-}
-
-ECalModel *
-e_calendar_view_get_model (ECalendarView *cal_view)
-{
- g_return_val_if_fail (E_IS_CALENDAR_VIEW (cal_view), NULL);
-
- return cal_view->priv->model;
-}
-
-void
-e_calendar_view_set_model (ECalendarView *cal_view, ECalModel *model)
-{
- g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
- g_return_if_fail (E_IS_CAL_MODEL (model));
-
- if (cal_view->priv->model) {
- g_signal_handlers_disconnect_matched (cal_view->priv->model, G_SIGNAL_MATCH_DATA,
- 0, 0, 0, NULL, cal_view);
- g_object_unref (cal_view->priv->model);
- }
-
- cal_view->priv->model = model;
- g_object_ref (cal_view->priv->model);
- g_signal_connect (G_OBJECT (cal_view->priv->model), "model_changed", G_CALLBACK (model_changed_cb), cal_view);
- g_signal_connect (G_OBJECT (cal_view->priv->model), "model_row_changed", G_CALLBACK (model_row_changed_cb), cal_view);
- g_signal_connect (G_OBJECT (cal_view->priv->model), "model_cell_changed", G_CALLBACK (model_cell_changed_cb), cal_view);
- g_signal_connect (G_OBJECT (cal_view->priv->model), "model_rows_inserted", G_CALLBACK (model_rows_changed_cb), cal_view);
- g_signal_connect (G_OBJECT (cal_view->priv->model), "model_rows_deleted", G_CALLBACK (model_rows_changed_cb), cal_view);
-
- e_calendar_view_update_query (cal_view);
-}
-
-icaltimezone *
-e_calendar_view_get_timezone (ECalendarView *cal_view)
-{
- g_return_val_if_fail (E_IS_CALENDAR_VIEW (cal_view), NULL);
- return e_cal_model_get_timezone (cal_view->priv->model);
-}
-
-void
-e_calendar_view_set_timezone (ECalendarView *cal_view, icaltimezone *zone)
-{
- icaltimezone *old_zone;
-
- g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
-
- old_zone = e_cal_model_get_timezone (cal_view->priv->model);
- if (old_zone == zone)
- return;
-
- e_cal_model_set_timezone (cal_view->priv->model, zone);
- g_signal_emit (G_OBJECT (cal_view), e_calendar_view_signals[TIMEZONE_CHANGED], 0,
- old_zone, zone);
-}
-
-const char *
-e_calendar_view_get_default_category (ECalendarView *cal_view)
-{
- g_return_val_if_fail (E_IS_CALENDAR_VIEW (cal_view), NULL);
- return (const char *) cal_view->priv->default_category;
-}
-
-/**
- * e_calendar_view_set_default_category
- * @cal_view: A calendar view.
- * @category: Default category name or NULL for no category.
- *
- * Sets the default category that will be used when creating new calendar
- * components from the given calendar view.
- */
-void
-e_calendar_view_set_default_category (ECalendarView *cal_view, const char *category)
-{
- g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
-
- if (cal_view->priv->default_category)
- g_free (cal_view->priv->default_category);
-
- cal_view->priv->default_category = g_strdup (category);
-}
-
-/**
- * e_calendar_view_get_use_24_hour_format:
- * @cal_view: A calendar view.
- *
- * Gets whether the view is using 24 hour times or not.
- *
- * Returns: the 24 hour setting.
- */
-gboolean
-e_calendar_view_get_use_24_hour_format (ECalendarView *cal_view)
-{
- g_return_val_if_fail (E_IS_CALENDAR_VIEW (cal_view), FALSE);
-
- return e_cal_model_get_use_24_hour_format (cal_view->priv->model);
-}
-
-/**
- * e_calendar_view_set_use_24_hour_format
- * @cal_view: A calendar view.
- * @use_24_hour: Whether to use 24 hour times or not.
- *
- * Sets the 12/24 hour times setting for the given view.
- */
-void
-e_calendar_view_set_use_24_hour_format (ECalendarView *cal_view, gboolean use_24_hour)
-{
- g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
-
- e_cal_model_set_use_24_hour_format (cal_view->priv->model, use_24_hour);
-}
-
-void
-e_calendar_view_set_status_message (ECalendarView *cal_view, const gchar *message)
-{
- EActivityHandler *activity_handler = calendar_component_peek_activity_handler (calendar_component_peek ());
-
- g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
-
- if (!message || !*message) {
- if (cal_view->priv->activity_id != 0) {
- e_activity_handler_operation_finished (activity_handler, cal_view->priv->activity_id);
- cal_view->priv->activity_id = 0;
- }
- } else if (cal_view->priv->activity_id == 0) {
- char *client_id = g_strdup_printf ("%p", cal_view);
-
- if (progress_icon == NULL)
- progress_icon = gdk_pixbuf_new_from_file (EVOLUTION_IMAGESDIR "/" EVOLUTION_CALENDAR_PROGRESS_IMAGE, NULL);
-
- cal_view->priv->activity_id = e_activity_handler_operation_started (activity_handler, client_id, progress_icon, message, TRUE);
-
- g_free (client_id);
- } else {
- e_activity_handler_operation_progressing (activity_handler, cal_view->priv->activity_id, message, -1.0);
- }
-}
-
-GList *
-e_calendar_view_get_selected_events (ECalendarView *cal_view)
-{
- g_return_val_if_fail (E_IS_CALENDAR_VIEW (cal_view), NULL);
-
- if (E_CALENDAR_VIEW_CLASS (G_OBJECT_GET_CLASS (cal_view))->get_selected_events)
- return E_CALENDAR_VIEW_CLASS (G_OBJECT_GET_CLASS (cal_view))->get_selected_events (cal_view);
-
- return NULL;
-}
-
-void
-e_calendar_view_get_selected_time_range (ECalendarView *cal_view, time_t *start_time, time_t *end_time)
-{
- g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
-
- if (E_CALENDAR_VIEW_CLASS (G_OBJECT_GET_CLASS (cal_view))->get_selected_time_range) {
- E_CALENDAR_VIEW_CLASS (G_OBJECT_GET_CLASS (cal_view))->get_selected_time_range (
- cal_view, start_time, end_time);
- }
-}
-
-void
-e_calendar_view_set_selected_time_range (ECalendarView *cal_view, time_t start_time, time_t end_time)
-{
- g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
-
- if (E_CALENDAR_VIEW_CLASS (G_OBJECT_GET_CLASS (cal_view))->set_selected_time_range) {
- E_CALENDAR_VIEW_CLASS (G_OBJECT_GET_CLASS (cal_view))->set_selected_time_range (
- cal_view, start_time, end_time);
- }
-}
-
-gboolean
-e_calendar_view_get_visible_time_range (ECalendarView *cal_view, time_t *start_time, time_t *end_time)
-{
- g_return_val_if_fail (E_IS_CALENDAR_VIEW (cal_view), FALSE);
-
- if (E_CALENDAR_VIEW_CLASS (G_OBJECT_GET_CLASS (cal_view))->get_visible_time_range) {
- return E_CALENDAR_VIEW_CLASS (G_OBJECT_GET_CLASS (cal_view))->get_visible_time_range (
- cal_view, start_time, end_time);
- }
-
- return FALSE;
-}
-
-void
-e_calendar_view_update_query (ECalendarView *cal_view)
-{
- g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
-
- e_calendar_view_set_status_message (cal_view, _("Searching"));
-
- if (E_CALENDAR_VIEW_CLASS (G_OBJECT_GET_CLASS (cal_view))->update_query) {
- E_CALENDAR_VIEW_CLASS (G_OBJECT_GET_CLASS (cal_view))->update_query (cal_view);
- }
-
- e_calendar_view_set_status_message (cal_view, NULL);
-}
-
-void
-e_calendar_view_cut_clipboard (ECalendarView *cal_view)
-{
- GList *selected, *l;
- const char *uid;
-
- g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
-
- selected = e_calendar_view_get_selected_events (cal_view);
- if (!selected)
- return;
-
- e_calendar_view_set_status_message (cal_view, _("Deleting selected objects"));
-
- e_calendar_view_copy_clipboard (cal_view);
- for (l = selected; l != NULL; l = l->next) {
- ECalComponent *comp;
- ECalendarViewEvent *event = (ECalendarViewEvent *) l->data;
- GError *error = NULL;
-
- if (!event)
- continue;
-
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
-
- if (itip_organizer_is_user (comp, event->comp_data->client)
- && cancel_component_dialog ((GtkWindow *) gtk_widget_get_toplevel (GTK_WIDGET (cal_view)),
- event->comp_data->client, comp, TRUE))
- itip_send_comp (E_CAL_COMPONENT_METHOD_CANCEL, comp,
- event->comp_data->client, NULL);
-
- e_cal_component_get_uid (comp, &uid);
- e_cal_remove_object (event->comp_data->client, uid, &error);
- delete_error_dialog (error, E_CAL_COMPONENT_EVENT);
-
- g_clear_error (&error);
-
- g_object_unref (comp);
- }
-
- e_calendar_view_set_status_message (cal_view, NULL);
-
- g_list_free (selected);
-}
-
-void
-e_calendar_view_copy_clipboard (ECalendarView *cal_view)
-{
- GList *selected, *l;
- gchar *comp_str;
- icalcomponent *vcal_comp;
- icalcomponent *new_icalcomp;
- ECalendarViewEvent *event;
-
- g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
-
- selected = e_calendar_view_get_selected_events (cal_view);
- if (!selected)
- return;
-
- /* create top-level VCALENDAR component and add VTIMEZONE's */
- vcal_comp = e_cal_util_new_top_level ();
- for (l = selected; l != NULL; l = l->next) {
- event = (ECalendarViewEvent *) l->data;
-
- if (event)
- e_cal_util_add_timezones_from_component (vcal_comp, event->comp_data->icalcomp);
- }
-
- for (l = selected; l != NULL; l = l->next) {
- event = (ECalendarViewEvent *) l->data;
-
- new_icalcomp = icalcomponent_new_clone (event->comp_data->icalcomp);
- icalcomponent_add_component (vcal_comp, new_icalcomp);
- }
-
- /* copy the VCALENDAR to the clipboard */
- comp_str = icalcomponent_as_ical_string (vcal_comp);
- if (cal_view->priv->clipboard_selection != NULL)
- g_free (cal_view->priv->clipboard_selection);
- cal_view->priv->clipboard_selection = g_strdup (comp_str);
- gtk_clipboard_set_text (gtk_widget_get_clipboard (GTK_WIDGET (cal_view), clipboard_atom),
- (const gchar *) comp_str,
- g_utf8_strlen (comp_str, -1));
-
- /* free memory */
- icalcomponent_free (vcal_comp);
- g_list_free (selected);
-}
-
-static void
-clipboard_get_text_cb (GtkClipboard *clipboard, const gchar *text, ECalendarView *cal_view)
-{
- char *default_tzid;
- icalcomponent *icalcomp;
- icalcomponent_kind kind;
- time_t selected_time_start, selected_time_end;
- icaltimezone *default_zone;
- ECal *client;
-
- g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
-
- icalcomp = icalparser_parse_string ((const char *) text);
- if (!icalcomp)
- return;
-
- default_tzid = calendar_config_get_timezone ();
-
- client = e_cal_model_get_default_client (cal_view->priv->model);
- /* FIXME Error checking */
- e_cal_get_timezone (client, default_tzid, &default_zone, NULL);
-
- /* check the type of the component */
- /* FIXME An error dialog if we return? */
- kind = icalcomponent_isa (icalcomp);
- if (kind != ICAL_VCALENDAR_COMPONENT && kind != ICAL_VEVENT_COMPONENT)
- return;
-
- e_calendar_view_set_status_message (cal_view, _("Updating objects"));
- e_calendar_view_get_selected_time_range (cal_view, &selected_time_start, &selected_time_end);
-
- /* FIXME Timezone handling */
- if (kind == ICAL_VCALENDAR_COMPONENT) {
- icalcomponent_kind child_kind;
- icalcomponent *subcomp;
-
- subcomp = icalcomponent_get_first_component (icalcomp, ICAL_ANY_COMPONENT);
- while (subcomp) {
- child_kind = icalcomponent_isa (subcomp);
- if (child_kind == ICAL_VEVENT_COMPONENT)
- e_calendar_view_add_event (cal_view, client, selected_time_start,
- default_zone, subcomp, FALSE);
- else if (child_kind == ICAL_VTIMEZONE_COMPONENT) {
- icaltimezone *zone;
-
- zone = icaltimezone_new ();
- icaltimezone_set_component (zone, subcomp);
- e_cal_add_timezone (client, zone, NULL);
-
- icaltimezone_free (zone, 1);
- }
-
- subcomp = icalcomponent_get_next_component (
- icalcomp, ICAL_ANY_COMPONENT);
- }
-
- icalcomponent_free (icalcomp);
-
- } else {
- e_calendar_view_add_event (cal_view, client, selected_time_start, default_zone, icalcomp, FALSE);
- }
-
- e_calendar_view_set_status_message (cal_view, NULL);
-}
-
-void
-e_calendar_view_paste_clipboard (ECalendarView *cal_view)
-{
- g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
-
- gtk_clipboard_request_text (gtk_widget_get_clipboard (GTK_WIDGET (cal_view), clipboard_atom),
- (GtkClipboardTextReceivedFunc) clipboard_get_text_cb, cal_view);
-}
-
-static void
-delete_event (ECalendarView *cal_view, ECalendarViewEvent *event)
-{
- ECalComponent *comp;
- ECalComponentVType vtype;
-
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
- vtype = e_cal_component_get_vtype (comp);
-
- if (delete_component_dialog (comp, FALSE, 1, vtype, GTK_WIDGET (cal_view))) {
- const char *uid;
- GError *error = NULL;
-
- if (itip_organizer_is_user (comp, event->comp_data->client)
- && cancel_component_dialog ((GtkWindow *) gtk_widget_get_toplevel (GTK_WIDGET (cal_view)),
- event->comp_data->client,
- comp, TRUE))
- itip_send_comp (E_CAL_COMPONENT_METHOD_CANCEL, comp,
- event->comp_data->client, NULL);
-
- e_cal_component_get_uid (comp, &uid);
- if (!uid || !*uid) {
- g_object_unref (comp);
- return;
- }
-
- e_cal_remove_object (event->comp_data->client, uid, &error);
- delete_error_dialog (error, E_CAL_COMPONENT_EVENT);
- g_clear_error (&error);
- }
-
- g_object_unref (comp);
-}
-
-void
-e_calendar_view_delete_selected_event (ECalendarView *cal_view)
-{
- GList *selected;
- ECalendarViewEvent *event;
-
- selected = e_calendar_view_get_selected_events (cal_view);
- if (!selected)
- return;
-
- event = (ECalendarViewEvent *) selected->data;
- if (event)
- delete_event (cal_view, event);
-
- g_list_free (selected);
-}
-
-void
-e_calendar_view_delete_selected_events (ECalendarView *cal_view)
-{
- GList *selected, *l;
- ECalendarViewEvent *event;
-
- selected = e_calendar_view_get_selected_events (cal_view);
- if (!selected)
- return;
-
- for (l = selected; l != NULL; l = l->next) {
- event = (ECalendarViewEvent *) l->data;
- if (event)
- delete_event (cal_view, event);
- }
-
- g_list_free (selected);
-}
-
-void
-e_calendar_view_delete_selected_occurrence (ECalendarView *cal_view)
-{
- ECalendarViewEvent *event;
- GList *selected;
- const char *uid;
- GError *error = NULL;
-
- selected = e_calendar_view_get_selected_events (cal_view);
- if (!selected)
- return;
-
- event = (ECalendarViewEvent *) selected->data;
-
- uid = icalcomponent_get_uid (event->comp_data->icalcomp);
- /* FIXME: use 'rid' argument */
- e_cal_remove_object_with_mod (event->comp_data->client, uid, NULL, CALOBJ_MOD_THIS, &error);
-
- delete_error_dialog (error, E_CAL_COMPONENT_EVENT);
- g_clear_error (&error);
-
- /* free memory */
- g_list_free (selected);
-}
-
-static void
-on_new_appointment (GtkWidget *widget, gpointer user_data)
-{
- ECalendarView *cal_view = (ECalendarView *) user_data;
-
- e_calendar_view_new_appointment (cal_view);
-}
-
-static void
-on_new_event (GtkWidget *widget, gpointer user_data)
-{
- time_t dtstart, dtend;
- ECalendarView *cal_view = (ECalendarView *) user_data;
-
- e_calendar_view_get_selected_time_range (cal_view, &dtstart, &dtend);
- e_calendar_view_new_appointment_for (cal_view, dtstart, dtend, TRUE, FALSE);
-}
-
-static void
-on_new_meeting (GtkWidget *widget, gpointer user_data)
-{
- time_t dtstart, dtend;
- ECalendarView *cal_view = (ECalendarView *) user_data;
-
- e_calendar_view_get_selected_time_range (cal_view, &dtstart, &dtend);
- e_calendar_view_new_appointment_for (cal_view, dtstart, dtend, FALSE, TRUE);
-}
-
-static void
-on_new_task (GtkWidget *widget, gpointer user_data)
-{
- ECalendarView *cal_view = (ECalendarView *) user_data;
- gnome_calendar_new_task (cal_view->priv->calendar);
-}
-
-static void
-on_goto_date (GtkWidget *widget, gpointer user_data)
-{
- ECalendarView *cal_view = E_CALENDAR_VIEW (user_data);
-
- goto_dialog (cal_view->priv->calendar);
-}
-
-static void
-on_goto_today (GtkWidget *widget, gpointer user_data)
-{
- ECalendarView *cal_view = E_CALENDAR_VIEW (user_data);
-
- calendar_goto_today (cal_view->priv->calendar);
-}
-
-static void
-on_edit_appointment (GtkWidget *widget, gpointer user_data)
-{
- GList *selected;
- ECalendarView *cal_view = E_CALENDAR_VIEW (user_data);
-
- selected = e_calendar_view_get_selected_events (cal_view);
- if (selected) {
- ECalendarViewEvent *event = (ECalendarViewEvent *) selected->data;
-
- if (event)
- e_calendar_view_edit_appointment (cal_view, event->comp_data->client,
- event->comp_data->icalcomp, FALSE);
-
- g_list_free (selected);
- }
-}
-
-static void
-on_print (GtkWidget *widget, gpointer user_data)
-{
- ECalendarView *cal_view;
- time_t start;
- GnomeCalendarViewType view_type;
- PrintView print_view;
-
- cal_view = E_CALENDAR_VIEW (user_data);
-
- e_calendar_view_get_visible_time_range (cal_view, &start, NULL);
- view_type = gnome_calendar_get_view (cal_view->priv->calendar);
-
- switch (view_type) {
- case GNOME_CAL_DAY_VIEW :
- print_view = PRINT_VIEW_DAY;
- break;
-
- case GNOME_CAL_WORK_WEEK_VIEW :
- case GNOME_CAL_WEEK_VIEW:
- print_view = PRINT_VIEW_WEEK;
- break;
-
- case GNOME_CAL_MONTH_VIEW:
- print_view = PRINT_VIEW_MONTH;
- break;
-
- default:
- g_assert_not_reached ();
- return;
- }
-
- print_calendar (cal_view->priv->calendar, FALSE, start, print_view);
-}
-
-static void
-on_save_as (GtkWidget *widget, gpointer user_data)
-{
- ECalendarView *cal_view;
- GList *selected;
- char *filename;
- char *ical_string;
- FILE *file;
- ECalendarViewEvent *event;
-
- cal_view = E_CALENDAR_VIEW (user_data);
-
- selected = e_calendar_view_get_selected_events (cal_view);
- if (!selected)
- return;
-
- filename = e_file_dialog_save (_("Save as..."));
- if (filename == NULL)
- return;
-
- event = (ECalendarViewEvent *) selected->data;
- ical_string = e_cal_get_component_as_string (event->comp_data->client, event->comp_data->icalcomp);
- if (ical_string == NULL) {
- g_warning ("Couldn't convert item to a string");
- return;
- }
-
- file = fopen (filename, "w");
- if (file == NULL) {
- g_warning ("Couldn't save item");
- return;
- }
-
- fprintf (file, ical_string);
- g_free (ical_string);
- fclose (file);
-
- g_list_free (selected);
-}
-
-static void
-on_print_event (GtkWidget *widget, gpointer user_data)
-{
- ECalendarView *cal_view;
- GList *selected;
- ECalendarViewEvent *event;
- ECalComponent *comp;
-
- cal_view = E_CALENDAR_VIEW (user_data);
- selected = e_calendar_view_get_selected_events (cal_view);
- if (!selected)
- return;
-
- event = (ECalendarViewEvent *) selected->data;
-
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
- print_comp (comp, event->comp_data->client, FALSE);
-
- g_object_unref (comp);
-}
-
-static void
-on_meeting (GtkWidget *widget, gpointer user_data)
-{
- GList *selected;
- ECalendarView *cal_view = E_CALENDAR_VIEW (user_data);
-
- selected = e_calendar_view_get_selected_events (cal_view);
- if (selected) {
- ECalendarViewEvent *event = (ECalendarViewEvent *) selected->data;
- e_calendar_view_edit_appointment (cal_view, event->comp_data->client, event->comp_data->icalcomp, TRUE);
-
- g_list_free (selected);
- }
-}
-
-static void
-on_forward (GtkWidget *widget, gpointer user_data)
-{
- GList *selected;
- ECalendarView *cal_view = E_CALENDAR_VIEW (user_data);
-
- selected = e_calendar_view_get_selected_events (cal_view);
- if (selected) {
- ECalComponent *comp;
- ECalendarViewEvent *event = (ECalendarViewEvent *) selected->data;
-
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
- itip_send_comp (E_CAL_COMPONENT_METHOD_PUBLISH, comp, event->comp_data->client, NULL);
-
- g_list_free (selected);
- g_object_unref (comp);
- }
-}
-
-static void
-on_publish (GtkWidget *widget, gpointer user_data)
-{
- ECalendarView *cal_view;
- icaltimezone *utc;
- time_t start = time (NULL), end;
- GList *comp_list = NULL, *client_list, *cl;
-
- cal_view = E_CALENDAR_VIEW (user_data);
-
- utc = icaltimezone_get_utc_timezone ();
- start = time_day_begin_with_zone (start, utc);
- end = time_add_week_with_zone (start, 6, utc);
-
- client_list = e_cal_model_get_client_list (cal_view->priv->model);
- for (cl = client_list; cl != NULL; cl = cl->next) {
- if (e_cal_get_free_busy ((ECal *) cl->data, NULL, start, end, &comp_list, NULL)) {
- GList *l;
-
- for (l = comp_list; l; l = l->next) {
- ECalComponent *comp = E_CAL_COMPONENT (l->data);
- itip_send_comp (E_CAL_COMPONENT_METHOD_PUBLISH, comp, (ECal *) cl->data, NULL);
-
- g_object_unref (comp);
- }
-
- g_list_free (comp_list);
- }
- }
-
- g_list_free (client_list);
-}
-
-static void
-on_delete_appointment (GtkWidget *widget, gpointer user_data)
-{
- ECalendarView *cal_view;
-
- cal_view = E_CALENDAR_VIEW (user_data);
- e_calendar_view_delete_selected_event (cal_view);
-}
-
-static void
-on_delete_occurrence (GtkWidget *widget, gpointer user_data)
-{
- ECalendarView *cal_view;
-
- cal_view = E_CALENDAR_VIEW (user_data);
- e_calendar_view_delete_selected_occurrence (cal_view);
-}
-
-static void
-on_cut (GtkWidget *widget, gpointer user_data)
-{
- ECalendarView *cal_view = E_CALENDAR_VIEW (user_data);
-
- e_calendar_view_cut_clipboard (cal_view);
-}
-
-static void
-on_copy (GtkWidget *widget, gpointer user_data)
-{
- ECalendarView *cal_view = E_CALENDAR_VIEW (user_data);
-
- e_calendar_view_copy_clipboard (cal_view);
-}
-
-static void
-on_paste (GtkWidget *widget, gpointer user_data)
-{
- ECalendarView *cal_view = E_CALENDAR_VIEW (user_data);
-
- e_calendar_view_paste_clipboard (cal_view);
-}
-
-enum {
- /*
- * This is used to "flag" events that can not be editted
- */
- MASK_EDITABLE = 1,
-
- /*
- * To disable recurring actions to be displayed
- */
- MASK_RECURRING = 2,
-
- /*
- * To disable actions for non-recurring items to be displayed
- */
- MASK_SINGLE = 4,
-
- /*
- * This is used to when an event is currently being edited
- * in another window and we want to disable the event
- * from being edited twice
- */
- MASK_EDITING = 8,
-
- /*
- * This is used to when an event is already a meeting and
- * we want to disable the schedule meeting command
- */
- MASK_MEETING = 16,
-
- /*
- * To disable cut and copy for meetings the user is not the
- * organizer of
- */
- MASK_MEETING_ORGANIZER = 32,
-
- /*
- * To disable things not valid for instances
- */
- MASK_INSTANCE = 64
-};
-
-static EPopupMenu main_items [] = {
- E_POPUP_ITEM (N_("New _Appointment..."), GTK_SIGNAL_FUNC (on_new_appointment), MASK_EDITABLE),
- E_POPUP_ITEM (N_("New All Day _Event"), GTK_SIGNAL_FUNC (on_new_event), MASK_EDITABLE),
- E_POPUP_ITEM (N_("New Meeting"), GTK_SIGNAL_FUNC (on_new_meeting), MASK_EDITABLE),
- E_POPUP_ITEM (N_("New Task"), GTK_SIGNAL_FUNC (on_new_task), MASK_EDITABLE),
-
- E_POPUP_SEPARATOR,
-
- E_POPUP_ITEM (N_("_Print..."), GTK_SIGNAL_FUNC (on_print), 0),
-
- E_POPUP_SEPARATOR,
-
- E_POPUP_ITEM (N_("_Paste"), GTK_SIGNAL_FUNC (on_paste), MASK_EDITABLE),
-
- E_POPUP_SEPARATOR,
-
- E_POPUP_SUBMENU (N_("Current View"), NULL, 0),
-
- E_POPUP_ITEM (N_("Go to _Today"), GTK_SIGNAL_FUNC (on_goto_today), 0),
- E_POPUP_ITEM (N_("_Go to Date..."), GTK_SIGNAL_FUNC (on_goto_date), 0),
-
- E_POPUP_SEPARATOR,
-
- E_POPUP_ITEM (N_("_Publish Free/Busy Information"), GTK_SIGNAL_FUNC (on_publish), 0),
-
- E_POPUP_TERMINATOR
-};
-
-static EPopupMenu child_items [] = {
- E_POPUP_ITEM (N_("_Open"), GTK_SIGNAL_FUNC (on_edit_appointment), MASK_EDITING),
- E_POPUP_ITEM (N_("_Save As..."), GTK_SIGNAL_FUNC (on_save_as), MASK_EDITING),
- E_POPUP_ITEM (N_("_Print..."), GTK_SIGNAL_FUNC (on_print_event), MASK_EDITING),
-
- /* Only show this separator if one of the above is shown. */
- E_POPUP_SEPARATOR,
-
- E_POPUP_ITEM (N_("C_ut"), GTK_SIGNAL_FUNC (on_cut), MASK_EDITING | MASK_EDITABLE | MASK_MEETING_ORGANIZER),
- E_POPUP_ITEM (N_("_Copy"), GTK_SIGNAL_FUNC (on_copy), MASK_EDITING | MASK_MEETING_ORGANIZER),
- E_POPUP_ITEM (N_("_Paste"), GTK_SIGNAL_FUNC (on_paste), MASK_EDITABLE),
-
- E_POPUP_SEPARATOR,
-
- E_POPUP_ITEM (N_("_Schedule Meeting..."), GTK_SIGNAL_FUNC (on_meeting), MASK_EDITABLE | MASK_EDITING | MASK_MEETING),
- E_POPUP_ITEM (N_("_Forward as iCalendar..."), GTK_SIGNAL_FUNC (on_forward), MASK_EDITING),
-
- E_POPUP_SEPARATOR,
-
- E_POPUP_ITEM (N_("_Delete"), GTK_SIGNAL_FUNC (on_delete_appointment), MASK_EDITABLE | MASK_SINGLE | MASK_EDITING),
- E_POPUP_ITEM (N_("Delete this _Occurrence"), GTK_SIGNAL_FUNC (on_delete_occurrence), MASK_RECURRING | MASK_EDITING | MASK_EDITABLE),
- E_POPUP_ITEM (N_("Delete _All Occurrences"), GTK_SIGNAL_FUNC (on_delete_appointment), MASK_RECURRING | MASK_EDITING | MASK_EDITABLE),
-
- E_POPUP_TERMINATOR
-};
-
-static void
-free_view_popup (GtkWidget *widget, gpointer data)
-{
- ECalendarView *cal_view = E_CALENDAR_VIEW (data);
-
- if (cal_view->priv->view_menu == NULL)
- return;
-
- gnome_calendar_discard_view_popup (cal_view->priv->calendar, cal_view->priv->view_menu);
- cal_view->priv->view_menu = NULL;
-}
-
-static void
-setup_popup_icons (EPopupMenu *context_menu)
-{
- gint i;
-
- for (i = 0; context_menu[i].name; i++) {
- GtkWidget *pixmap_widget = NULL;
-
- if (!strcmp (context_menu[i].name, _("_Copy")))
- pixmap_widget = gtk_image_new_from_stock (GTK_STOCK_COPY, GTK_ICON_SIZE_MENU);
- else if (!strcmp (context_menu[i].name, _("C_ut")))
- pixmap_widget = gtk_image_new_from_stock (GTK_STOCK_CUT, GTK_ICON_SIZE_MENU);
- else if (!strcmp (context_menu[i].name, _("_Delete")) ||
- !strcmp (context_menu[i].name, _("Delete this _Occurrence")) ||
- !strcmp (context_menu[i].name, _("Delete _All Occurrences")))
- pixmap_widget = gtk_image_new_from_stock (GTK_STOCK_DELETE, GTK_ICON_SIZE_MENU);
- else if (!strcmp (context_menu[i].name, _("Go to _Today")))
- pixmap_widget = gtk_image_new_from_stock (GTK_STOCK_HOME, GTK_ICON_SIZE_MENU);
- else if (!strcmp (context_menu[i].name, _("_Go to Date...")))
- pixmap_widget = gtk_image_new_from_stock (GTK_STOCK_JUMP_TO, GTK_ICON_SIZE_MENU);
- else if (!strcmp (context_menu[i].name, _("New _Appointment...")))
- pixmap_widget = gtk_image_new_from_file (EVOLUTION_IMAGESDIR "/new_appointment.xpm");
- else if (!strcmp (context_menu[i].name, _("New All Day _Event")))
- pixmap_widget = gtk_image_new_from_file (EVOLUTION_IMAGESDIR "/new_all_day_event.png");
- else if (!strcmp (context_menu[i].name, _("New Meeting")))
- pixmap_widget = gtk_image_new_from_file (EVOLUTION_IMAGESDIR "/meeting-request-16.png");
- else if (!strcmp (context_menu[i].name, _("New Task")))
- pixmap_widget = gtk_image_new_from_file (EVOLUTION_IMAGESDIR "/new_task-16.png");
- else if (!strcmp (context_menu[i].name, _("_Open")))
- pixmap_widget = gtk_image_new_from_stock (GTK_STOCK_OPEN, GTK_ICON_SIZE_MENU);
- else if (!strcmp (context_menu[i].name, _("_Paste")))
- pixmap_widget = gtk_image_new_from_stock (GTK_STOCK_PASTE, GTK_ICON_SIZE_MENU);
- else if (!strcmp (context_menu[i].name, _("_Print...")))
- pixmap_widget = gtk_image_new_from_stock (GTK_STOCK_PRINT, GTK_ICON_SIZE_MENU);
- else if (!strcmp (context_menu[i].name, _("_Save As...")))
- pixmap_widget = gtk_image_new_from_stock (GTK_STOCK_SAVE_AS, GTK_ICON_SIZE_MENU);
- else if (!strcmp (context_menu[i].name, _("_Settings...")))
- pixmap_widget = gtk_image_new_from_stock (GTK_STOCK_PREFERENCES, GTK_ICON_SIZE_MENU);
-
- if (pixmap_widget)
- gtk_widget_show (pixmap_widget);
- context_menu[i].pixmap_widget = pixmap_widget;
- }
-}
-
-GtkMenu *
-e_calendar_view_create_popup_menu (ECalendarView *cal_view)
-{
- GList *selected;
- EPopupMenu *context_menu;
- guint32 disable_mask = 0, hide_mask = 0;
- GtkMenu *popup;
- ECal *client = NULL;
- gboolean read_only = TRUE;
-
- g_return_val_if_fail (E_IS_CALENDAR_VIEW (cal_view), NULL);
-
- /* get the selection */
- selected = e_calendar_view_get_selected_events (cal_view);
-
- if (selected == NULL) {
- cal_view->priv->view_menu = gnome_calendar_setup_view_popup (cal_view->priv->calendar);
- main_items[9].submenu = cal_view->priv->view_menu;
- context_menu = main_items;
-
- client = e_cal_model_get_default_client (cal_view->priv->model);
- } else {
- ECalendarViewEvent *event;
-
- context_menu = child_items;
-
- event = (ECalendarViewEvent *) selected->data;
- if (e_cal_util_component_has_recurrences (event->comp_data->icalcomp))
- hide_mask |= MASK_SINGLE;
- else
- hide_mask |= MASK_RECURRING;
-
- if (e_cal_util_component_is_instance (event->comp_data->icalcomp))
- hide_mask |= MASK_INSTANCE;
-
- if (e_cal_util_component_has_organizer (event->comp_data->icalcomp)) {
- ECalComponent *comp;
-
- disable_mask |= MASK_MEETING;
-
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
- if (!itip_organizer_is_user (comp, event->comp_data->client))
- disable_mask |= MASK_MEETING_ORGANIZER;
-
- g_object_unref (comp);
- }
-
- client = event->comp_data->client;
- }
-
- e_cal_is_read_only (client, &read_only, NULL);
- if (read_only)
- disable_mask |= MASK_EDITABLE;
-
- setup_popup_icons (context_menu);
- popup = e_popup_menu_create (context_menu, disable_mask, hide_mask, cal_view);
- g_signal_connect (popup, "selection-done", G_CALLBACK (free_view_popup), cal_view);
-
- return popup;
-}
-
-/**
- * e_calendar_view_new_appointment_for
- * @cal_view: A calendar view.
- * @dtstart: A Unix time_t that marks the beginning of the appointment.
- * @dtend: A Unix time_t that marks the end of the appointment.
- * @all_day: If TRUE, the dtstart and dtend are expanded to cover
- * the entire day, and the event is set to TRANSPARENT.
- * @meeting: Whether the appointment is a meeting or not.
- *
- * Opens an event editor dialog for a new appointment.
- */
-void
-e_calendar_view_new_appointment_for (ECalendarView *cal_view,
- time_t dtstart, time_t dtend,
- gboolean all_day,
- gboolean meeting)
-{
- ECalendarViewPrivate *priv;
- struct icaltimetype itt;
- ECalComponentDateTime dt;
- ECalComponent *comp;
- icalcomponent *icalcomp;
- ECalComponentTransparency transparency;
-
- g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
-
- priv = cal_view->priv;
-
- dt.value = &itt;
- if (all_day)
- dt.tzid = NULL;
- else
- dt.tzid = icaltimezone_get_tzid (e_cal_model_get_timezone (cal_view->priv->model));
-
- icalcomp = e_cal_model_create_component_with_defaults (priv->model);
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomp);
-
- /* DTSTART, DTEND */
- itt = icaltime_from_timet_with_zone (dtstart, FALSE, e_cal_model_get_timezone (cal_view->priv->model));
- if (all_day) {
- itt.hour = itt.minute = itt.second = 0;
- itt.is_date = TRUE;
- }
- e_cal_component_set_dtstart (comp, &dt);
-
- itt = icaltime_from_timet_with_zone (dtend, FALSE, e_cal_model_get_timezone (cal_view->priv->model));
- if (all_day) {
- /* We round it up to the end of the day, unless it is
- already set to midnight */
- if (itt.hour != 0 || itt.minute != 0 || itt.second != 0) {
- icaltime_adjust (&itt, 1, 0, 0, 0);
- }
- itt.hour = itt.minute = itt.second = 0;
- itt.is_date = TRUE;
- }
- e_cal_component_set_dtend (comp, &dt);
-
- /* TRANSPARENCY */
- transparency = all_day ? E_CAL_COMPONENT_TRANSP_TRANSPARENT
- : E_CAL_COMPONENT_TRANSP_OPAQUE;
- e_cal_component_set_transparency (comp, transparency);
-
- /* CATEGORY */
- e_cal_component_set_categories (comp, priv->default_category);
-
- /* edit the object */
- e_cal_component_commit_sequence (comp);
-
- e_calendar_view_edit_appointment (cal_view,
- e_cal_model_get_default_client (priv->model),
- icalcomp, meeting);
-
- g_object_unref (comp);
-}
-
-/**
- * e_calendar_view_new_appointment
- * @cal_view: A calendar view.
- *
- * Opens an event editor dialog for a new appointment. The appointment's
- * start and end times are set to the currently selected time range in
- * the calendar view.
- */
-void
-e_calendar_view_new_appointment (ECalendarView *cal_view)
-{
- time_t dtstart, dtend;
-
- g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
-
- e_calendar_view_get_selected_time_range (cal_view, &dtstart, &dtend);
- e_calendar_view_new_appointment_for (cal_view, dtstart, dtend, FALSE, FALSE);
-}
-
-/**
- * e_calendar_view_edit_appointment
- * @cal_view: A calendar view.
- * @client: Calendar client.
- * @icalcomp: The object to be edited.
- * @meeting: Whether the appointment is a meeting or not.
- *
- * Opens an editor window to allow the user to edit the selected
- * object.
- */
-void
-e_calendar_view_edit_appointment (ECalendarView *cal_view,
- ECal *client,
- icalcomponent *icalcomp,
- gboolean meeting)
-{
- ECalendarViewPrivate *priv;
- CompEditor *ce;
- const char *uid;
- ECalComponent *comp;
-
- g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
- g_return_if_fail (E_IS_CAL (client));
- g_return_if_fail (icalcomp != NULL);
-
- priv = cal_view->priv;
-
- uid = icalcomponent_get_uid (icalcomp);
-
- ce = e_comp_editor_registry_find (comp_editor_registry, uid);
- if (!ce) {
- EventEditor *ee;
-
- ee = event_editor_new (client);
- ce = COMP_EDITOR (ee);
-
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (icalcomp));
- comp_editor_edit_comp (ce, comp);
- if (meeting)
- event_editor_show_meeting (ee);
-
- e_comp_editor_registry_add (comp_editor_registry, ce, FALSE);
-
- g_object_unref (comp);
- }
-
- comp_editor_focus (ce);
-}
diff --git a/calendar/gui/e-cal-view.h b/calendar/gui/e-cal-view.h
deleted file mode 100644
index a1b11023b3..0000000000
--- a/calendar/gui/e-cal-view.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Author :
- * Rodrigo Moya <rodrigo@ximian.com>
- *
- * Copyright 2003, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-#ifndef _E_CALENDAR_VIEW_H_
-#define _E_CALENDAR_VIEW_H_
-
-#include <libecal/e-cal.h>
-#include <gtk/gtktable.h>
-#include "e-cal-model.h"
-#include "gnome-cal.h"
-
-G_BEGIN_DECLS
-
-/*
- * EView - base widget class for the calendar views.
- */
-
-#define E_CALENDAR_VIEW(obj) GTK_CHECK_CAST (obj, e_calendar_view_get_type (), ECalendarView)
-#define E_CALENDAR_VIEW_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, e_calendar_view_get_type (), ECalendarViewClass)
-#define E_IS_CALENDAR_VIEW(obj) GTK_CHECK_TYPE (obj, e_calendar_view_get_type ())
-
-typedef enum {
- E_CALENDAR_VIEW_POS_OUTSIDE,
- E_CALENDAR_VIEW_POS_NONE,
- E_CALENDAR_VIEW_POS_EVENT,
- E_CALENDAR_VIEW_POS_LEFT_EDGE,
- E_CALENDAR_VIEW_POS_RIGHT_EDGE,
- E_CALENDAR_VIEW_POS_TOP_EDGE,
- E_CALENDAR_VIEW_POS_BOTTOM_EDGE
-} ECalendarViewPosition;
-
-#define E_CALENDAR_VIEW_EVENT_FIELDS \
- GnomeCanvasItem *canvas_item; \
- ECalModelComponent *comp_data; \
- gboolean allocated_comp_data; \
- time_t start; \
- time_t end; \
- guint16 start_minute; \
- guint16 end_minute; \
- guint different_timezone : 1;
-
-typedef struct {
- E_CALENDAR_VIEW_EVENT_FIELDS
-} ECalendarViewEvent;
-
-typedef struct _ECalendarView ECalendarView;
-typedef struct _ECalendarViewClass ECalendarViewClass;
-typedef struct _ECalendarViewPrivate ECalendarViewPrivate;
-
-struct _ECalendarView {
- GtkTable table;
- ECalendarViewPrivate *priv;
-};
-
-struct _ECalendarViewClass {
- GtkTableClass parent_class;
-
- /* Notification signals */
- void (* selection_changed) (ECalendarView *cal_view);
- void (* selected_time_changed) (ECalendarView *cal_view);
- void (* timezone_changed) (ECalendarView *cal_view, icaltimezone *old_zone, icaltimezone *new_zone);
- void (* event_changed) (ECalendarView *day_view, ECalendarViewEvent *event);
- void (* event_added) (ECalendarView *day_view, ECalendarViewEvent *event);
-
- /* Virtual methods */
- GList * (* get_selected_events) (ECalendarView *cal_view); /* a GList of ECalendarViewEvent's */
- void (* get_selected_time_range) (ECalendarView *cal_view, time_t *start_time, time_t *end_time);
- void (* set_selected_time_range) (ECalendarView *cal_view, time_t start_time, time_t end_time);
- gboolean (* get_visible_time_range) (ECalendarView *cal_view, time_t *start_time, time_t *end_time);
- void (* update_query) (ECalendarView *cal_view);
-};
-
-GType e_calendar_view_get_type (void);
-
-GnomeCalendar *e_calendar_view_get_calendar (ECalendarView *cal_view);
-void e_calendar_view_set_calendar (ECalendarView *cal_view, GnomeCalendar *calendar);
-ECalModel *e_calendar_view_get_model (ECalendarView *cal_view);
-void e_calendar_view_set_model (ECalendarView *cal_view, ECalModel *model);
-icaltimezone *e_calendar_view_get_timezone (ECalendarView *cal_view);
-void e_calendar_view_set_timezone (ECalendarView *cal_view, icaltimezone *zone);
-const char *e_calendar_view_get_default_category (ECalendarView *cal_view);
-void e_calendar_view_set_default_category (ECalendarView *cal_view, const char *category);
-gboolean e_calendar_view_get_use_24_hour_format (ECalendarView *view);
-void e_calendar_view_set_use_24_hour_format (ECalendarView *view, gboolean use_24_hour);
-
-void e_calendar_view_set_status_message (ECalendarView *cal_view, const gchar *message);
-
-GList *e_calendar_view_get_selected_events (ECalendarView *cal_view);
-void e_calendar_view_get_selected_time_range (ECalendarView *cal_view, time_t *start_time, time_t *end_time);
-void e_calendar_view_set_selected_time_range (ECalendarView *cal_view, time_t start_time, time_t end_time);
-gboolean e_calendar_view_get_visible_time_range (ECalendarView *cal_view, time_t *start_time, time_t *end_time);
-void e_calendar_view_update_query (ECalendarView *cal_view);
-
-void e_calendar_view_cut_clipboard (ECalendarView *cal_view);
-void e_calendar_view_copy_clipboard (ECalendarView *cal_view);
-void e_calendar_view_paste_clipboard (ECalendarView *cal_view);
-void e_calendar_view_delete_selected_event (ECalendarView *cal_view);
-void e_calendar_view_delete_selected_events (ECalendarView *cal_view);
-void e_calendar_view_delete_selected_occurrence (ECalendarView *cal_view);
-
-GtkMenu *e_calendar_view_create_popup_menu (ECalendarView *cal_view);
-
-void e_calendar_view_add_event (ECalendarView *cal_view, ECal *client, time_t dtstart,
- icaltimezone *default_zone, icalcomponent *icalcomp, gboolean in_top_canvas);
-void e_calendar_view_new_appointment_for (ECalendarView *cal_view,
- time_t dtstart,
- time_t dtend,
- gboolean all_day,
- gboolean meeting);
-void e_calendar_view_new_appointment (ECalendarView *cal_view);
-void e_calendar_view_edit_appointment (ECalendarView *cal_view,
- ECal *client,
- icalcomponent *icalcomp,
- gboolean meeting);
-
-G_END_DECLS
-
-#endif
diff --git a/calendar/gui/e-calendar-marshal.list b/calendar/gui/e-calendar-marshal.list
deleted file mode 100644
index 86087cf1ae..0000000000
--- a/calendar/gui/e-calendar-marshal.list
+++ /dev/null
@@ -1,15 +0,0 @@
-NONE:INT
-NONE:POINTER
-NONE:INT,STRING
-NONE:INT,BOOL
-NONE:INT,POINTER
-NONE:STRING,INT
-NONE:INT,INT
-NONE:ENUM,ENUM
-NONE:ENUM,STRING
-NONE:STRING,BOOL,INT,INT
-NONE:STRING,STRING
-NONE:STRING,STRING,STRING
-NONE:POINTER,ENUM
-NONE:POINTER,STRING
-NONE:POINTER,POINTER
diff --git a/calendar/gui/e-calendar-table-config.c b/calendar/gui/e-calendar-table-config.c
deleted file mode 100644
index 74be72143f..0000000000
--- a/calendar/gui/e-calendar-table-config.c
+++ /dev/null
@@ -1,263 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Author :
- * JP Rosevear <jpr@ximian.com>
- *
- * Copyright 2003, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#include "calendar-config.h"
-#include "e-cell-date-edit-config.h"
-#include "e-calendar-table-config.h"
-
-struct _ECalendarTableConfigPrivate {
- ECalendarTable *table;
-
- ECellDateEditConfig *cell_config;
-
- GList *notifications;
-};
-
-static GObjectClass *parent_class = NULL;
-
-/* Property IDs */
-enum props {
- PROP_0,
- PROP_TABLE
-};
-
-static void
-e_calendar_table_config_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
-{
- ECalendarTableConfig *table_config;
- ECalendarTableConfigPrivate *priv;
-
- table_config = E_CALENDAR_TABLE_CONFIG (object);
- priv = table_config->priv;
-
- switch (property_id) {
- case PROP_TABLE:
- e_calendar_table_config_set_table (table_config, g_value_get_object (value));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
- break;
- }
-}
-
-static void
-e_calendar_table_config_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
-{
- ECalendarTableConfig *table_config;
- ECalendarTableConfigPrivate *priv;
-
- table_config = E_CALENDAR_TABLE_CONFIG (object);
- priv = table_config->priv;
-
- switch (property_id) {
- case PROP_TABLE:
- g_value_set_object (value, e_calendar_table_config_get_table (table_config));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
- break;
- }
-}
-
-static void
-e_calendar_table_config_dispose (GObject *object)
-{
- ECalendarTableConfig *table_config = E_CALENDAR_TABLE_CONFIG (object);
- ECalendarTableConfigPrivate *priv;
-
- priv = table_config->priv;
-
- e_calendar_table_config_set_table (table_config, NULL);
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-static void
-e_calendar_table_config_finalize (GObject *object)
-{
- ECalendarTableConfig *table_config = E_CALENDAR_TABLE_CONFIG (object);
- ECalendarTableConfigPrivate *priv;
-
- priv = table_config->priv;
-
- g_free (priv);
-
- if (G_OBJECT_CLASS (parent_class)->finalize)
- G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-static void
-e_calendar_table_config_class_init (ECalendarTableConfigClass *klass)
-{
- GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- GParamSpec *spec;
-
- parent_class = g_type_class_peek_parent (klass);
-
- /* Method override */
- gobject_class->set_property = e_calendar_table_config_set_property;
- gobject_class->get_property = e_calendar_table_config_get_property;
- gobject_class->dispose = e_calendar_table_config_dispose;
- gobject_class->finalize = e_calendar_table_config_finalize;
-
- spec = g_param_spec_object ("table", NULL, NULL, e_calendar_table_get_type (),
- G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT);
- g_object_class_install_property (gobject_class, PROP_TABLE, spec);
-}
-
-static void
-e_calendar_table_config_init (ECalendarTableConfig *table_config, ECalendarTableConfigClass *klass)
-{
- table_config->priv = g_new0 (ECalendarTableConfigPrivate, 1);
-
-}
-
-E_MAKE_TYPE (e_calendar_table_config, "ECalendarTableConfig", ECalendarTableConfig, e_calendar_table_config_class_init,
- e_calendar_table_config_init, G_TYPE_OBJECT);
-
-ECalendarTableConfig *
-e_calendar_table_config_new (ECalendarTable *table)
-{
- ECalendarTableConfig *table_config;
-
- table_config = g_object_new (e_calendar_table_config_get_type (), "table", table, NULL);
-
- return table_config;
-}
-
-ECalendarTable *
-e_calendar_table_config_get_table (ECalendarTableConfig *table_config)
-{
- ECalendarTableConfigPrivate *priv;
-
- g_return_val_if_fail (table_config != NULL, NULL);
- g_return_val_if_fail (E_IS_CALENDAR_TABLE_CONFIG (table_config), NULL);
-
- priv = table_config->priv;
-
- return priv->table;
-}
-
-static void
-set_timezone (ECalendarTable *table)
-{
- ECalModel *model;
- char *location;
- icaltimezone *zone;
-
- location = calendar_config_get_timezone ();
- zone = icaltimezone_get_builtin_timezone (location);
- if (!zone)
- zone = icaltimezone_get_utc_timezone ();
-
- model = e_calendar_table_get_model (table);
- if (model)
- e_cal_model_set_timezone (model, zone);
-
- g_free (location);
-}
-
-static void
-timezone_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
-{
- ECalendarTableConfig *table_config = data;
- ECalendarTableConfigPrivate *priv;
-
- priv = table_config->priv;
-
- set_timezone (priv->table);
-}
-
-static void
-set_twentyfour_hour (ECalendarTable *table)
-{
- ECalModel *model;
- gboolean use_24_hour;
-
- use_24_hour = calendar_config_get_24_hour_format ();
-
- model = e_calendar_table_get_model (table);
- if (model)
- e_cal_model_set_use_24_hour_format (model, use_24_hour);
-}
-
-static void
-twentyfour_hour_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
-{
- ECalendarTableConfig *table_config = data;
- ECalendarTableConfigPrivate *priv;
-
- priv = table_config->priv;
-
- set_twentyfour_hour (priv->table);
-}
-
-void
-e_calendar_table_config_set_table (ECalendarTableConfig *table_config, ECalendarTable *table)
-{
- ECalendarTableConfigPrivate *priv;
- guint not;
- GList *l;
-
- g_return_if_fail (table_config != NULL);
- g_return_if_fail (E_IS_CALENDAR_TABLE_CONFIG (table_config));
-
- priv = table_config->priv;
-
- if (priv->table) {
- g_object_unref (priv->table);
- priv->table = NULL;
- }
-
- if (priv->cell_config) {
- g_object_unref (priv->cell_config);
- priv->cell_config = NULL;
- }
-
- for (l = priv->notifications; l; l = l->next)
- calendar_config_remove_notification (GPOINTER_TO_UINT (l->data));
-
- g_list_free (priv->notifications);
- priv->notifications = NULL;
-
- /* If the new view is NULL, return right now */
- if (!table)
- return;
-
- priv->table = g_object_ref (table);
-
- /* Time zone */
- set_timezone (table);
-
- not = calendar_config_add_notification_timezone (timezone_changed_cb, table_config);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
-
- /* 24 Hour format */
- set_twentyfour_hour (table);
-
- not = calendar_config_add_notification_24_hour_format (twentyfour_hour_changed_cb, table_config);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
-
- /* Date cell */
- priv->cell_config = e_cell_date_edit_config_new (table->dates_cell);
-}
diff --git a/calendar/gui/e-calendar-table-config.h b/calendar/gui/e-calendar-table-config.h
deleted file mode 100644
index 399f3254d1..0000000000
--- a/calendar/gui/e-calendar-table-config.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Author :
- * JP Rosevear <jpr@ximian.com>
- *
- * Copyright 2003, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifndef _E_CALENDAR_TABLE_CONFIG_H_
-#define _E_CALENDAR_TABLE_CONFIG_H_
-
-#include "e-calendar-table.h"
-
-G_BEGIN_DECLS
-
-#define E_CALENDAR_TABLE_CONFIG(obj) GTK_CHECK_CAST (obj, e_calendar_table_config_get_type (), ECalendarTableConfig)
-#define E_CALENDAR_TABLE_CONFIG_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, e_calendar_table_config_get_type (), ECalendarTableConfigClass)
-#define E_IS_CALENDAR_TABLE_CONFIG(obj) GTK_CHECK_TYPE (obj, e_calendar_table_config_get_type ())
-
-typedef struct _ECalendarTableConfig ECalendarTableConfig;
-typedef struct _ECalendarTableConfigClass ECalendarTableConfigClass;
-typedef struct _ECalendarTableConfigPrivate ECalendarTableConfigPrivate;
-
-struct _ECalendarTableConfig {
- GObject parent;
-
- ECalendarTableConfigPrivate *priv;
-};
-
-struct _ECalendarTableConfigClass {
- GObjectClass parent_class;
-};
-
-GType e_calendar_table_config_get_type (void);
-ECalendarTableConfig *e_calendar_table_config_new (ECalendarTable *table);
-ECalendarTable *e_calendar_table_config_get_table (ECalendarTableConfig *view_config);
-void e_calendar_table_config_set_table (ECalendarTableConfig *view_config, ECalendarTable *table);
-
-G_END_DECLS
-
-#endif
diff --git a/calendar/gui/e-calendar-table.c b/calendar/gui/e-calendar-table.c
deleted file mode 100644
index d9ea59905b..0000000000
--- a/calendar/gui/e-calendar-table.c
+++ /dev/null
@@ -1,1464 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Authors :
- * Damon Chaplin <damon@ximian.com>
- * Rodrigo Moya <rodrigo@ximian.com>
- *
- * Copyright 2000, 2001, 2002, 2003 Novell, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-/*
- * ECalendarTable - displays the ECalComponent objects in a table (an ETable).
- * Used for calendar events and tasks.
- */
-
-#include <config.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <gnome.h>
-#include <gtk/gtkinvisible.h>
-#include <gal/widgets/e-gui-utils.h>
-#include <gal/e-table/e-cell-checkbox.h>
-#include <gal/e-table/e-cell-toggle.h>
-#include <gal/e-table/e-cell-text.h>
-#include <gal/e-table/e-cell-combo.h>
-#include <gal/widgets/e-popup-menu.h>
-#include <e-util/e-dialog-utils.h>
-#include <widgets/misc/e-cell-date-edit.h>
-#include <widgets/misc/e-cell-percent.h>
-
-#include "calendar-component.h"
-#include "calendar-config.h"
-#include "dialogs/delete-comp.h"
-#include "dialogs/delete-error.h"
-#include "dialogs/task-editor.h"
-#include "e-cal-model-tasks.h"
-#include "e-calendar-table.h"
-#include "e-cell-date-edit-text.h"
-#include "e-comp-editor-registry.h"
-#include "print.h"
-
-/* Pixmaps. */
-#include "art/task.xpm"
-#include "art/task-recurring.xpm"
-#include "art/task-assigned.xpm"
-#include "art/task-assigned-to.xpm"
-
-#include "art/check-filled.xpm"
-
-extern ECompEditorRegistry *comp_editor_registry;
-
-static void e_calendar_table_class_init (ECalendarTableClass *class);
-static void e_calendar_table_init (ECalendarTable *cal_table);
-static void e_calendar_table_destroy (GtkObject *object);
-
-static void e_calendar_table_on_double_click (ETable *table,
- gint row,
- gint col,
- GdkEvent *event,
- ECalendarTable *cal_table);
-static gint e_calendar_table_show_popup_menu (ETable *table,
- GdkEvent *gdk_event,
- ECalendarTable *cal_table);
-
-static gint e_calendar_table_on_right_click (ETable *table,
- gint row,
- gint col,
- GdkEvent *event,
- ECalendarTable *cal_table);
-static gboolean e_calendar_table_on_popup_menu (GtkWidget *widget,
- gpointer data);
-
-static void e_calendar_table_on_open_task (GtkWidget *menuitem,
- gpointer data);
-static void e_calendar_table_on_save_as (GtkWidget *menuitem,
- gpointer data);
-static void e_calendar_table_on_print_task (GtkWidget *menuitem,
- gpointer data);
-static void e_calendar_table_on_cut (GtkWidget *menuitem,
- gpointer data);
-static void e_calendar_table_on_copy (GtkWidget *menuitem,
- gpointer data);
-static void e_calendar_table_on_paste (GtkWidget *menuitem,
- gpointer data);
-static void e_calendar_table_on_assign (GtkWidget *menuitem,
- gpointer data);
-static void e_calendar_table_on_forward (GtkWidget *menuitem,
- gpointer data);
-static gint e_calendar_table_on_key_press (ETable *table,
- gint row,
- gint col,
- GdkEventKey *event,
- ECalendarTable *cal_table);
-
-static void selection_clear_event (GtkWidget *invisible,
- GdkEventSelection *event,
- ECalendarTable *cal_table);
-static void selection_received (GtkWidget *invisible,
- GtkSelectionData *selection_data,
- guint time,
- ECalendarTable *cal_table);
-static void selection_get (GtkWidget *invisible,
- GtkSelectionData *selection_data,
- guint info,
- guint time_stamp,
- ECalendarTable *cal_table);
-static struct tm e_calendar_table_get_current_time (ECellDateEdit *ecde,
- gpointer data);
-static void mark_row_complete_cb (int model_row, gpointer data);
-
-
-/* The icons to represent the task. */
-#define E_CALENDAR_MODEL_NUM_ICONS 4
-static char** icon_xpm_data[E_CALENDAR_MODEL_NUM_ICONS] = {
- task_xpm, task_recurring_xpm, task_assigned_xpm, task_assigned_to_xpm
-};
-static GdkPixbuf* icon_pixbufs[E_CALENDAR_MODEL_NUM_ICONS] = { 0 };
-
-static GtkTableClass *parent_class;
-static GdkAtom clipboard_atom = GDK_NONE;
-
-E_MAKE_TYPE (e_calendar_table, "ECalendarTable", ECalendarTable, e_calendar_table_class_init,
- e_calendar_table_init, GTK_TYPE_TABLE);
-
-static void
-e_calendar_table_class_init (ECalendarTableClass *class)
-{
- GtkObjectClass *object_class;
- GtkWidgetClass *widget_class;
-
- parent_class = g_type_class_peek_parent (class);
- object_class = (GtkObjectClass *) class;
- widget_class = (GtkWidgetClass *) class;
-
- /* Method override */
- object_class->destroy = e_calendar_table_destroy;
-
-#if 0
- widget_class->realize = e_calendar_table_realize;
- widget_class->unrealize = e_calendar_table_unrealize;
- widget_class->style_set = e_calendar_table_style_set;
- widget_class->size_allocate = e_calendar_table_size_allocate;
- widget_class->focus_in_event = e_calendar_table_focus_in;
- widget_class->focus_out_event = e_calendar_table_focus_out;
- widget_class->key_press_event = e_calendar_table_key_press;
-#endif
-
- /* clipboard atom */
- if (!clipboard_atom)
- clipboard_atom = gdk_atom_intern ("CLIPBOARD", FALSE);
-}
-
-/* Compares two priority values, which may not exist */
-static int
-compare_priorities (int *a, int *b)
-{
- if (a && b) {
- if (*a < *b)
- return -1;
- else if (*a > *b)
- return 1;
- else
- return 0;
- } else if (a)
- return -1;
- else if (b)
- return 1;
- else
- return 0;
-}
-
-/* Comparison function for the task-sort column. Sorts by due date and then by
- * priority.
- *
- * FIXME: Does this ever get called?? It doesn't seem to.
- * I specified that the table should be sorted by this column, but it still
- * never calls this function.
- * Also, this assumes it is passed pointers to ECalComponents, but I think it
- * may just be passed pointers to the 2 cell values.
- */
-static gint
-task_compare_cb (gconstpointer a, gconstpointer b)
-{
- ECalComponent *ca, *cb;
- ECalComponentDateTime due_a, due_b;
- int *prio_a, *prio_b;
- int retval;
-
- ca = E_CAL_COMPONENT (a);
- cb = E_CAL_COMPONENT (b);
-
- e_cal_component_get_due (ca, &due_a);
- e_cal_component_get_due (cb, &due_b);
- e_cal_component_get_priority (ca, &prio_a);
- e_cal_component_get_priority (cb, &prio_b);
-
- if (due_a.value && due_b.value) {
- int v;
-
- /* FIXME: TIMEZONES. But currently we have no way to get the
- ECal, so we can't get the timezone. */
- v = icaltime_compare (*due_a.value, *due_b.value);
-
- if (v == 0)
- retval = compare_priorities (prio_a, prio_b);
- else
- retval = v;
- } else if (due_a.value)
- retval = -1;
- else if (due_b.value)
- retval = 1;
- else
- retval = compare_priorities (prio_a, prio_b);
-
- e_cal_component_free_datetime (&due_a);
- e_cal_component_free_datetime (&due_b);
-
- if (prio_a)
- e_cal_component_free_priority (prio_a);
-
- if (prio_b)
- e_cal_component_free_priority (prio_b);
-
- return retval;
-}
-
-static gint
-date_compare_cb (gconstpointer a, gconstpointer b)
-{
- ECellDateEditValue *dv1 = (ECellDateEditValue *) a;
- ECellDateEditValue *dv2 = (ECellDateEditValue *) b;
- struct icaltimetype tt;
-
- /* First check if either is NULL. NULL dates sort last. */
- if (!dv1 || !dv2) {
- if (dv1 == dv2)
- return 0;
- else if (dv1)
- return -1;
- else
- return 1;
- }
-
- /* Copy the 2nd value and convert it to the same timezone as the
- first. */
- tt = dv2->tt;
-
- icaltimezone_convert_time (&tt, dv2->zone, dv1->zone);
-
- /* Now we can compare them. */
-
- return icaltime_compare (dv1->tt, tt);
-}
-
-static gint
-percent_compare_cb (gconstpointer a, gconstpointer b)
-{
- int percent1 = GPOINTER_TO_INT (a);
- int percent2 = GPOINTER_TO_INT (b);
- int retval;
-
- if (percent1 > percent2)
- retval = 1;
- else if (percent1 < percent2)
- retval = -1;
- else
- retval = 0;
-
- return retval;
-}
-
-static gint
-priority_compare_cb (gconstpointer a, gconstpointer b)
-{
- int priority1, priority2;
-
- priority1 = e_cal_util_priority_from_string ((const char*) a);
- priority2 = e_cal_util_priority_from_string ((const char*) b);
-
- /* We change undefined priorities so they appear after 'Low'. */
- if (priority1 <= 0)
- priority1 = 10;
- if (priority2 <= 0)
- priority2 = 10;
-
- /* We'll just use the ordering of the priority values. */
- if (priority1 < priority2)
- return -1;
- else if (priority1 > priority2)
- return 1;
- else
- return 0;
-}
-
-static void
-e_calendar_table_init (ECalendarTable *cal_table)
-{
- GtkWidget *table;
- ETable *e_table;
- ECell *cell, *popup_cell;
- ETableExtras *extras;
- gint i;
- GdkPixbuf *pixbuf;
- GList *strings;
-
- /* Create the model */
-
- cal_table->model = (ECalModel *) e_cal_model_tasks_new ();
-
- /* Create the header columns */
-
- extras = e_table_extras_new();
-
- /*
- * Normal string fields.
- */
- cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
- g_object_set (G_OBJECT (cell),
- "strikeout_column", E_CAL_MODEL_TASKS_FIELD_COMPLETE,
- "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE,
- "color_column", E_CAL_MODEL_FIELD_COLOR,
- NULL);
-
- e_table_extras_add_cell (extras, "calstring", cell);
-
-
- /*
- * Date fields.
- */
- cell = e_cell_date_edit_text_new (NULL, GTK_JUSTIFY_LEFT);
- g_object_set (G_OBJECT (cell),
- "strikeout_column", E_CAL_MODEL_TASKS_FIELD_COMPLETE,
- "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE,
- "color_column", E_CAL_MODEL_FIELD_COLOR,
- NULL);
-
- popup_cell = e_cell_date_edit_new ();
- e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
- g_object_unref (cell);
- e_table_extras_add_cell (extras, "dateedit", popup_cell);
- cal_table->dates_cell = E_CELL_DATE_EDIT (popup_cell);
-
- e_cell_date_edit_set_get_time_callback (E_CELL_DATE_EDIT (popup_cell),
- e_calendar_table_get_current_time,
- cal_table, NULL);
-
-
- /*
- * Combo fields.
- */
-
- /* Classification field. */
- cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
- g_object_set (G_OBJECT (cell),
- "strikeout_column", E_CAL_MODEL_TASKS_FIELD_COMPLETE,
- "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE,
- "color_column", E_CAL_MODEL_FIELD_COLOR,
- "editable", FALSE,
- NULL);
-
- popup_cell = e_cell_combo_new ();
- e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
- g_object_unref (cell);
-
- strings = NULL;
- strings = g_list_append (strings, (char*) _("Public"));
- strings = g_list_append (strings, (char*) _("Private"));
- strings = g_list_append (strings, (char*) _("Confidential"));
- e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell),
- strings);
-
- e_table_extras_add_cell (extras, "classification", popup_cell);
-
- /* Priority field. */
- cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
- g_object_set (G_OBJECT (cell),
- "strikeout_column", E_CAL_MODEL_TASKS_FIELD_COMPLETE,
- "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE,
- "color_column", E_CAL_MODEL_FIELD_COLOR,
- "editable", FALSE,
- NULL);
-
- popup_cell = e_cell_combo_new ();
- e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
- g_object_unref (cell);
-
- strings = NULL;
- strings = g_list_append (strings, (char*) _("High"));
- strings = g_list_append (strings, (char*) _("Normal"));
- strings = g_list_append (strings, (char*) _("Low"));
- strings = g_list_append (strings, (char*) _("Undefined"));
- e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell),
- strings);
-
- e_table_extras_add_cell (extras, "priority", popup_cell);
-
- /* Percent field. */
- cell = e_cell_percent_new (NULL, GTK_JUSTIFY_LEFT);
- g_object_set (G_OBJECT (cell),
- "strikeout_column", E_CAL_MODEL_TASKS_FIELD_COMPLETE,
- "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE,
- "color_column", E_CAL_MODEL_FIELD_COLOR,
- NULL);
-
- popup_cell = e_cell_combo_new ();
- e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
- g_object_unref (cell);
-
- strings = NULL;
- strings = g_list_append (strings, (char*) _("0%"));
- strings = g_list_append (strings, (char*) _("10%"));
- strings = g_list_append (strings, (char*) _("20%"));
- strings = g_list_append (strings, (char*) _("30%"));
- strings = g_list_append (strings, (char*) _("40%"));
- strings = g_list_append (strings, (char*) _("50%"));
- strings = g_list_append (strings, (char*) _("60%"));
- strings = g_list_append (strings, (char*) _("70%"));
- strings = g_list_append (strings, (char*) _("80%"));
- strings = g_list_append (strings, (char*) _("90%"));
- strings = g_list_append (strings, (char*) _("100%"));
- e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell),
- strings);
-
- e_table_extras_add_cell (extras, "percent", popup_cell);
-
- /* Transparency field. */
- cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
- g_object_set (G_OBJECT (cell),
- "strikeout_column", E_CAL_MODEL_TASKS_FIELD_COMPLETE,
- "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE,
- "color_column", E_CAL_MODEL_FIELD_COLOR,
- "editable", FALSE,
- NULL);
-
- popup_cell = e_cell_combo_new ();
- e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
- g_object_unref (cell);
-
- strings = NULL;
- strings = g_list_append (strings, (char*) _("Free"));
- strings = g_list_append (strings, (char*) _("Busy"));
- e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell),
- strings);
-
- e_table_extras_add_cell (extras, "transparency", popup_cell);
-
- /* Status field. */
- cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
- g_object_set (G_OBJECT (cell),
- "strikeout_column", E_CAL_MODEL_TASKS_FIELD_COMPLETE,
- "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE,
- "color_column", E_CAL_MODEL_FIELD_COLOR,
- "editable", FALSE,
- NULL);
-
- popup_cell = e_cell_combo_new ();
- e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
- g_object_unref (cell);
-
- strings = NULL;
- strings = g_list_append (strings, (char*) _("Not Started"));
- strings = g_list_append (strings, (char*) _("In Progress"));
- strings = g_list_append (strings, (char*) _("Completed"));
- strings = g_list_append (strings, (char*) _("Cancelled"));
- e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell),
- strings);
-
- e_table_extras_add_cell (extras, "calstatus", popup_cell);
-
- /* Task sorting field */
- /* FIXME: This column should not be displayed, but ETableExtras requires
- * its shit to be visible columns listed in the XML spec.
- */
- e_table_extras_add_compare (extras, "task-sort", task_compare_cb);
-
- e_table_extras_add_compare (extras, "date-compare",
- date_compare_cb);
- e_table_extras_add_compare (extras, "percent-compare",
- percent_compare_cb);
- e_table_extras_add_compare (extras, "priority-compare",
- priority_compare_cb);
-
- /* Create pixmaps */
-
- if (!icon_pixbufs[0])
- for (i = 0; i < E_CALENDAR_MODEL_NUM_ICONS; i++) {
- icon_pixbufs[i] = gdk_pixbuf_new_from_xpm_data (
- (const char **) icon_xpm_data[i]);
- }
-
- cell = e_cell_toggle_new (0, E_CALENDAR_MODEL_NUM_ICONS, icon_pixbufs);
- e_table_extras_add_cell(extras, "icon", cell);
- e_table_extras_add_pixbuf(extras, "icon", icon_pixbufs[0]);
-
- pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **) check_filled_xpm);
- e_table_extras_add_pixbuf(extras, "complete", pixbuf);
- gdk_pixbuf_unref(pixbuf);
-
- /* Create the table */
-
- table = e_table_scrolled_new_from_spec_file (E_TABLE_MODEL (cal_table->model),
- extras,
- EVOLUTION_ETSPECDIR "/e-calendar-table.etspec",
- NULL);
- /* FIXME: this causes a message from GLib about 'extras' having only a floating
- reference */
- /* g_object_unref (extras); */
-
- cal_table->etable = table;
- gtk_table_attach (GTK_TABLE (cal_table), table, 0, 1, 0, 1,
- GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
- gtk_widget_show (table);
-
-
- e_table = e_table_scrolled_get_table (E_TABLE_SCROLLED (table));
- g_signal_connect (e_table, "double_click", G_CALLBACK (e_calendar_table_on_double_click), cal_table);
- g_signal_connect (e_table, "right_click", G_CALLBACK (e_calendar_table_on_right_click), cal_table);
- g_signal_connect (e_table, "key_press", G_CALLBACK (e_calendar_table_on_key_press), cal_table);
- g_signal_connect (e_table, "popup_menu", G_CALLBACK (e_calendar_table_on_popup_menu), cal_table);
-
- /* Set up the invisible widget for the clipboard selections */
- cal_table->invisible = gtk_invisible_new ();
- gtk_selection_add_target (cal_table->invisible,
- clipboard_atom,
- GDK_SELECTION_TYPE_STRING,
- 0);
- g_signal_connect (cal_table->invisible, "selection_get",
- G_CALLBACK (selection_get), cal_table);
- g_signal_connect (cal_table->invisible, "selection_clear_event",
- G_CALLBACK (selection_clear_event), cal_table);
- g_signal_connect (cal_table->invisible, "selection_received",
- G_CALLBACK (selection_received), cal_table);
-
- cal_table->clipboard_selection = NULL;
-}
-
-
-/**
- * e_calendar_table_new:
- * @Returns: a new #ECalendarTable.
- *
- * Creates a new #ECalendarTable.
- **/
-GtkWidget *
-e_calendar_table_new (void)
-{
- GtkWidget *cal_table;
-
- cal_table = GTK_WIDGET (g_object_new (e_calendar_table_get_type (), NULL));
-
- return cal_table;
-}
-
-
-/**
- * e_calendar_table_get_model:
- * @cal_table: A calendar table.
- *
- * Queries the calendar data model that a calendar table is using.
- *
- * Return value: A calendar model.
- **/
-ECalModel *
-e_calendar_table_get_model (ECalendarTable *cal_table)
-{
- g_return_val_if_fail (cal_table != NULL, NULL);
- g_return_val_if_fail (E_IS_CALENDAR_TABLE (cal_table), NULL);
-
- return cal_table->model;
-}
-
-
-static void
-e_calendar_table_destroy (GtkObject *object)
-{
- ECalendarTable *cal_table;
-
- cal_table = E_CALENDAR_TABLE (object);
-
- if (cal_table->model) {
- g_object_unref (cal_table->model);
- cal_table->model = NULL;
- }
-
- if (cal_table->invisible) {
- gtk_widget_destroy (cal_table->invisible);
- cal_table->invisible = NULL;
- }
- if (cal_table->clipboard_selection) {
- g_free (cal_table->clipboard_selection);
- cal_table->clipboard_selection = NULL;
- }
-
- GTK_OBJECT_CLASS (parent_class)->destroy (object);
-}
-
-/**
- * e_calendar_table_get_table:
- * @cal_table: A calendar table.
- *
- * Queries the #ETable widget that the calendar table is using.
- *
- * Return value: The #ETable widget that the calendar table uses to display its
- * data.
- **/
-ETable *
-e_calendar_table_get_table (ECalendarTable *cal_table)
-{
- g_return_val_if_fail (cal_table != NULL, NULL);
- g_return_val_if_fail (E_IS_CALENDAR_TABLE (cal_table), NULL);
-
- return e_table_scrolled_get_table (E_TABLE_SCROLLED (cal_table->etable));
-}
-
-/**
- * e_calendar_table_complete_selected:
- * @cal_table: A calendar table
- *
- * Marks the selected items as completed
- **/
-void
-e_calendar_table_complete_selected (ECalendarTable *cal_table)
-{
- ETable *etable;
-
- g_return_if_fail (cal_table != NULL);
- g_return_if_fail (E_IS_CALENDAR_TABLE (cal_table));
-
- etable = e_table_scrolled_get_table (E_TABLE_SCROLLED (cal_table->etable));
- e_table_selected_row_foreach (etable, mark_row_complete_cb, cal_table);
-}
-
-/* Used from e_table_selected_row_foreach(); puts the selected row number in an
- * int pointed to by the closure data.
- */
-static void
-get_selected_row_cb (int model_row, gpointer data)
-{
- int *row;
-
- row = data;
- *row = model_row;
-}
-
-/* Returns the component that is selected in the table; only works if there is
- * one and only one selected row.
- */
-static ECalModelComponent *
-get_selected_comp (ECalendarTable *cal_table)
-{
- ETable *etable;
- int row;
-
- etable = e_table_scrolled_get_table (E_TABLE_SCROLLED (cal_table->etable));
- if (e_table_selected_count (etable) != 1)
- return NULL;
-
- row = -1;
- e_table_selected_row_foreach (etable,
- get_selected_row_cb,
- &row);
- g_assert (row != -1);
-
- return e_cal_model_get_component_at (cal_table->model, row);
-}
-
-struct get_selected_uids_closure {
- ECalendarTable *cal_table;
- GSList *objects;
-};
-
-/* Used from e_table_selected_row_foreach(), builds a list of the selected UIDs */
-static void
-add_uid_cb (int model_row, gpointer data)
-{
- struct get_selected_uids_closure *closure;
- ECalModelComponent *comp_data;
-
- closure = data;
-
- comp_data = e_cal_model_get_component_at (closure->cal_table->model, model_row);
-
- closure->objects = g_slist_prepend (closure->objects, comp_data);
-}
-
-static GSList *
-get_selected_objects (ECalendarTable *cal_table)
-{
- struct get_selected_uids_closure closure;
- ETable *etable;
-
- closure.cal_table = cal_table;
- closure.objects = NULL;
-
- etable = e_table_scrolled_get_table (E_TABLE_SCROLLED (cal_table->etable));
- e_table_selected_row_foreach (etable, add_uid_cb, &closure);
-
- return closure.objects;
-}
-
-/* Deletes all of the selected components in the table */
-static void
-delete_selected_components (ECalendarTable *cal_table)
-{
- GSList *objs, *l;
-
- objs = get_selected_objects (cal_table);
-
- e_calendar_table_set_status_message (cal_table, _("Deleting selected objects"));
-
- for (l = objs; l; l = l->next) {
- ECalModelComponent *comp_data = (ECalModelComponent *) l->data;
- GError *error = NULL;
-
- e_cal_remove_object (comp_data->client,
- icalcomponent_get_uid (comp_data->icalcomp), &error);
- delete_error_dialog (error, E_CAL_COMPONENT_TODO);
- g_clear_error (&error);
- }
-
- e_calendar_table_set_status_message (cal_table, NULL);
-
- g_slist_free (objs);
-}
-
-/**
- * e_calendar_table_delete_selected:
- * @cal_table: A calendar table.
- *
- * Deletes the selected components in the table; asks the user first.
- **/
-void
-e_calendar_table_delete_selected (ECalendarTable *cal_table)
-{
- ETable *etable;
- int n_selected;
- ECalModelComponent *comp_data;
- ECalComponent *comp;
-
- g_return_if_fail (cal_table != NULL);
- g_return_if_fail (E_IS_CALENDAR_TABLE (cal_table));
-
- etable = e_table_scrolled_get_table (E_TABLE_SCROLLED (cal_table->etable));
-
- n_selected = e_table_selected_count (etable);
- if (n_selected <= 0)
- return;
-
- if (n_selected == 1)
- comp_data = get_selected_comp (cal_table);
- else
- comp_data = NULL;
-
- /* FIXME: this may be something other than a TODO component */
-
- comp = e_cal_component_new ();
- if (comp_data)
- e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (comp_data->icalcomp));
-
- if (delete_component_dialog (comp, FALSE, n_selected, E_CAL_COMPONENT_TODO,
- GTK_WIDGET (cal_table)))
- delete_selected_components (cal_table);
-
- /* free memory */
- g_object_unref (comp);
-}
-
-/**
- * e_calendar_table_cut_clipboard:
- * @cal_table: A calendar table.
- *
- * Cuts selected tasks in the given calendar table
- */
-void
-e_calendar_table_cut_clipboard (ECalendarTable *cal_table)
-{
- g_return_if_fail (E_IS_CALENDAR_TABLE (cal_table));
-
- e_calendar_table_copy_clipboard (cal_table);
- delete_selected_components (cal_table);
-}
-
-/* callback for e_table_selected_row_foreach */
-static void
-copy_row_cb (int model_row, gpointer data)
-{
- ECalendarTable *cal_table;
- ECalModelComponent *comp_data;
- gchar *comp_str;
- icalcomponent *child;
-
- cal_table = E_CALENDAR_TABLE (data);
-
- g_return_if_fail (cal_table->tmp_vcal != NULL);
-
- comp_data = e_cal_model_get_component_at (cal_table->model, model_row);
- if (!comp_data)
- return;
-
- /* add timezones to the VCALENDAR component */
- e_cal_util_add_timezones_from_component (cal_table->tmp_vcal, comp_data->icalcomp);
-
- /* add the new component to the VCALENDAR component */
- comp_str = icalcomponent_as_ical_string (comp_data->icalcomp);
- child = icalparser_parse_string (comp_str);
- if (child) {
- icalcomponent_add_component (cal_table->tmp_vcal,
- icalcomponent_new_clone (child));
- icalcomponent_free (child);
- }
-}
-
-/**
- * e_calendar_table_copy_clipboard:
- * @cal_table: A calendar table.
- *
- * Copies selected tasks into the clipboard
- */
-void
-e_calendar_table_copy_clipboard (ECalendarTable *cal_table)
-{
- ETable *etable;
- char *comp_str;
-
- g_return_if_fail (E_IS_CALENDAR_TABLE (cal_table));
-
- if (cal_table->clipboard_selection) {
- g_free (cal_table->clipboard_selection);
- cal_table->clipboard_selection = NULL;
- }
-
- /* create temporary VCALENDAR object */
- cal_table->tmp_vcal = e_cal_util_new_top_level ();
-
- etable = e_table_scrolled_get_table (E_TABLE_SCROLLED (cal_table->etable));
- e_table_selected_row_foreach (etable, copy_row_cb, cal_table);
-
- comp_str = icalcomponent_as_ical_string (cal_table->tmp_vcal);
- cal_table->clipboard_selection = g_strdup (comp_str);
- icalcomponent_free (cal_table->tmp_vcal);
- cal_table->tmp_vcal = NULL;
-
- gtk_selection_owner_set (cal_table->invisible, clipboard_atom, GDK_CURRENT_TIME);
-}
-
-/**
- * e_calendar_table_paste_clipboard:
- * @cal_table: A calendar table.
- *
- * Pastes tasks currently in the clipboard into the given calendar table
- */
-void
-e_calendar_table_paste_clipboard (ECalendarTable *cal_table)
-{
- g_return_if_fail (E_IS_CALENDAR_TABLE (cal_table));
-
- gtk_selection_convert (cal_table->invisible,
- clipboard_atom,
- GDK_SELECTION_TYPE_STRING,
- GDK_CURRENT_TIME);
-}
-
-/* Opens a task in the task editor */
-static void
-open_task (ECalendarTable *cal_table, ECalModelComponent *comp_data, gboolean assign)
-{
- CompEditor *tedit;
- const char *uid;
-
- uid = icalcomponent_get_uid (comp_data->icalcomp);
-
- tedit = e_comp_editor_registry_find (comp_editor_registry, uid);
- if (tedit == NULL) {
- ECalComponent *comp;
-
- tedit = COMP_EDITOR (task_editor_new (comp_data->client));
-
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (comp_data->icalcomp));
- comp_editor_edit_comp (tedit, comp);
- if (assign)
- task_editor_show_assignment (TASK_EDITOR (tedit));
-
- e_comp_editor_registry_add (comp_editor_registry, tedit, FALSE);
- }
-
- comp_editor_focus (tedit);
-}
-
-/* Opens the task in the specified row */
-static void
-open_task_by_row (ECalendarTable *cal_table, int row)
-{
- ECalModelComponent *comp_data;
-
- comp_data = e_cal_model_get_component_at (cal_table->model, row);
- open_task (cal_table, comp_data, FALSE);
-}
-
-static void
-e_calendar_table_on_double_click (ETable *table,
- gint row,
- gint col,
- GdkEvent *event,
- ECalendarTable *cal_table)
-{
- open_task_by_row (cal_table, row);
-}
-
-/* Used from e_table_selected_row_foreach() */
-static void
-mark_row_complete_cb (int model_row, gpointer data)
-{
- ECalendarTable *cal_table;
-
- cal_table = E_CALENDAR_TABLE (data);
- e_cal_model_tasks_mark_task_complete (E_CAL_MODEL_TASKS (cal_table->model), model_row);
-}
-
-/* Callback used for the "mark tasks as complete" menu item */
-static void
-mark_as_complete_cb (GtkWidget *menuitem, gpointer data)
-{
- ECalendarTable *cal_table;
- ETable *etable;
-
- cal_table = E_CALENDAR_TABLE (data);
-
- etable = e_table_scrolled_get_table (E_TABLE_SCROLLED (cal_table->etable));
- e_table_selected_row_foreach (etable, mark_row_complete_cb, cal_table);
-}
-
-/* Opens the URL of the task */
-static void
-open_url_cb (GtkWidget *menuitem, gpointer data)
-{
- ECalendarTable *cal_table;
- ECalModelComponent *comp_data;
- icalproperty *prop;
-
- cal_table = E_CALENDAR_TABLE (data);
-
- comp_data = get_selected_comp (cal_table);
- if (!comp_data)
- return;
-
- prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_URL_PROPERTY);
- if (!prop)
- return;
-
- gnome_url_show (icalproperty_get_url (prop), NULL);
-}
-
-/* Callback for the "delete tasks" menu item */
-static void
-delete_cb (GtkWidget *menuitem, gpointer data)
-{
- ECalendarTable *cal_table;
-
- cal_table = E_CALENDAR_TABLE (data);
- e_calendar_table_delete_selected (cal_table);
-}
-
-
-enum {
- MASK_SINGLE = 1 << 0, /* For commands that work on 1 task. */
- MASK_MULTIPLE = 1 << 1, /* For commands for multiple tasks. */
- MASK_EDITABLE = 1 << 2, /* For commands disabled in read-only folders */
- MASK_ASSIGNABLE = 1 << 3, /* For non-task assignable backends */
- MASK_LACKS_URL = 1 << 4 /* For tasks that don't have the URL property set */
-};
-
-
-static EPopupMenu tasks_popup_menu [] = {
- E_POPUP_ITEM (N_("_Open"), GTK_SIGNAL_FUNC (e_calendar_table_on_open_task), MASK_SINGLE),
- E_POPUP_ITEM (N_("Open _Web Page"), GTK_SIGNAL_FUNC (open_url_cb), MASK_SINGLE | MASK_LACKS_URL),
- E_POPUP_ITEM (N_("_Save As..."), GTK_SIGNAL_FUNC (e_calendar_table_on_save_as), MASK_SINGLE),
- E_POPUP_ITEM (N_("_Print..."), GTK_SIGNAL_FUNC (e_calendar_table_on_print_task), MASK_SINGLE),
-
- E_POPUP_SEPARATOR,
-
- E_POPUP_ITEM (N_("C_ut"), GTK_SIGNAL_FUNC (e_calendar_table_on_cut), MASK_EDITABLE),
- E_POPUP_ITEM (N_("_Copy"), GTK_SIGNAL_FUNC (e_calendar_table_on_copy), 0),
- E_POPUP_ITEM (N_("_Paste"), GTK_SIGNAL_FUNC (e_calendar_table_on_paste), MASK_EDITABLE),
-
- E_POPUP_SEPARATOR,
-
- E_POPUP_ITEM (N_("_Assign Task"), GTK_SIGNAL_FUNC (e_calendar_table_on_assign), MASK_SINGLE | MASK_EDITABLE | MASK_ASSIGNABLE),
- E_POPUP_ITEM (N_("_Forward as iCalendar"), GTK_SIGNAL_FUNC (e_calendar_table_on_forward), MASK_SINGLE),
- E_POPUP_ITEM (N_("_Mark as Complete"), GTK_SIGNAL_FUNC (mark_as_complete_cb), MASK_SINGLE | MASK_EDITABLE),
- E_POPUP_ITEM (N_("_Mark Selected Tasks as Complete"), GTK_SIGNAL_FUNC (mark_as_complete_cb), MASK_MULTIPLE | MASK_EDITABLE),
-
- E_POPUP_SEPARATOR,
-
- E_POPUP_ITEM (N_("_Delete"), GTK_SIGNAL_FUNC (delete_cb), MASK_SINGLE | MASK_EDITABLE),
- E_POPUP_ITEM (N_("_Delete Selected Tasks"), GTK_SIGNAL_FUNC (delete_cb), MASK_MULTIPLE | MASK_EDITABLE),
-
- E_POPUP_TERMINATOR
-};
-
-static void
-setup_popup_icons (EPopupMenu *context_menu)
-{
- gint i;
-
- for (i = 0; context_menu[i].name; i++) {
- GtkWidget *pixmap_widget = NULL;
-
- if (!strcmp (context_menu[i].name, _("_Copy")))
- pixmap_widget = gtk_image_new_from_stock (GTK_STOCK_COPY, GTK_ICON_SIZE_MENU);
- else if (!strcmp (context_menu[i].name, _("C_ut")))
- pixmap_widget = gtk_image_new_from_stock (GTK_STOCK_CUT, GTK_ICON_SIZE_MENU);
- else if (!strcmp (context_menu[i].name, _("_Delete")) ||
- !strcmp (context_menu[i].name, _("_Delete Selected Tasks")))
- pixmap_widget = gtk_image_new_from_stock (GTK_STOCK_DELETE, GTK_ICON_SIZE_MENU);
- else if (!strcmp (context_menu[i].name, _("_Open")))
- pixmap_widget = gtk_image_new_from_stock (GTK_STOCK_OPEN, GTK_ICON_SIZE_MENU);
- else if (!strcmp (context_menu[i].name, _("_Paste")))
- pixmap_widget = gtk_image_new_from_stock (GTK_STOCK_PASTE, GTK_ICON_SIZE_MENU);
- else if (!strcmp (context_menu[i].name, _("_Print...")))
- pixmap_widget = gtk_image_new_from_stock (GTK_STOCK_PRINT, GTK_ICON_SIZE_MENU);
- else if (!strcmp (context_menu[i].name, _("_Save As...")))
- pixmap_widget = gtk_image_new_from_stock (GTK_STOCK_SAVE_AS, GTK_ICON_SIZE_MENU);
-
- if (pixmap_widget)
- gtk_widget_show (pixmap_widget);
- context_menu[i].pixmap_widget = pixmap_widget;
- }
-}
-
-static gint
-e_calendar_table_show_popup_menu (ETable *table,
- GdkEvent *gdk_event,
- ECalendarTable *cal_table)
-{
- int n_selected;
- int hide_mask = 0;
- int disable_mask = 0;
- GtkMenu *gtk_menu;
- icalproperty *prop;
- ECalModelComponent *comp_data;
- gboolean read_only = TRUE;
-
- n_selected = e_table_selected_count (table);
- if (n_selected <= 0)
- return TRUE;
-
- comp_data = get_selected_comp (cal_table);
- g_assert (comp_data != NULL);
-
- if (n_selected == 1) {
- hide_mask = MASK_MULTIPLE;
-
- /* See if the task has the URL property set */
-
- prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_URL_PROPERTY);
- if (!prop)
- disable_mask |= MASK_LACKS_URL;
- } else
- hide_mask = MASK_SINGLE;
-
- e_cal_is_read_only (comp_data->client, &read_only, NULL);
- if (read_only)
- disable_mask |= MASK_EDITABLE;
-
- if (e_cal_get_static_capability (comp_data->client, CAL_STATIC_CAPABILITY_NO_TASK_ASSIGNMENT))
- disable_mask |= MASK_ASSIGNABLE;
-
- setup_popup_icons (tasks_popup_menu);
- gtk_menu = e_popup_menu_create (tasks_popup_menu, disable_mask,
- hide_mask, cal_table);
-
- e_popup_menu (gtk_menu, gdk_event);
-
- return TRUE;
-}
-
-static gint
-e_calendar_table_on_right_click (ETable *table,
- gint row,
- gint col,
- GdkEvent *event,
- ECalendarTable *cal_table)
-{
- return e_calendar_table_show_popup_menu (table, event, cal_table);
-}
-
-static gboolean
-e_calendar_table_on_popup_menu (GtkWidget *widget, gpointer data)
-{
- ETable *table = E_TABLE(widget);
- g_return_val_if_fail(table, FALSE);
-
- return e_calendar_table_show_popup_menu (table, NULL,
- E_CALENDAR_TABLE(data));
-}
-
-static void
-e_calendar_table_on_open_task (GtkWidget *menuitem,
- gpointer data)
-{
- ECalendarTable *cal_table;
- ECalModelComponent *comp_data;
-
- cal_table = E_CALENDAR_TABLE (data);
-
- comp_data = get_selected_comp (cal_table);
- if (comp_data)
- open_task (cal_table, comp_data, FALSE);
-}
-
-static void
-e_calendar_table_on_save_as (GtkWidget *widget, gpointer data)
-{
- ECalendarTable *cal_table;
- ECalModelComponent *comp_data;
- char *filename;
- char *ical_string;
- FILE *file;
-
- cal_table = E_CALENDAR_TABLE (data);
-
- comp_data = get_selected_comp (cal_table);
- if (comp_data == NULL)
- return;
-
- filename = e_file_dialog_save (_("Save as..."));
- if (filename == NULL)
- return;
-
- ical_string = e_cal_get_component_as_string (comp_data->client, comp_data->icalcomp);
- if (ical_string == NULL) {
- g_warning ("Couldn't convert item to a string");
- return;
- }
-
- file = fopen (filename, "w");
- if (file == NULL) {
- g_warning ("Couldn't save item");
- return;
- }
-
- fprintf (file, ical_string);
- g_free (ical_string);
- fclose (file);
-}
-
-static void
-e_calendar_table_on_print_task (GtkWidget *widget, gpointer data)
-{
- ECalendarTable *cal_table;
- ECalModelComponent *comp_data;
- ECalComponent *comp;
-
- cal_table = E_CALENDAR_TABLE (data);
-
- comp_data = get_selected_comp (cal_table);
- if (comp_data == NULL)
- return;
-
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (comp_data->icalcomp));
- print_comp (comp, comp_data->client, FALSE);
-
- g_object_unref (comp);
-}
-
-static void
-e_calendar_table_on_cut (GtkWidget *menuitem, gpointer data)
-{
- ECalendarTable *cal_table;
-
- cal_table = E_CALENDAR_TABLE (data);
- e_calendar_table_cut_clipboard (cal_table);
-}
-
-static void
-e_calendar_table_on_copy (GtkWidget *menuitem, gpointer data)
-{
- ECalendarTable *cal_table;
-
- cal_table = E_CALENDAR_TABLE (data);
- e_calendar_table_copy_clipboard (cal_table);
-}
-
-static void
-e_calendar_table_on_paste (GtkWidget *menuitem, gpointer data)
-{
- ECalendarTable *cal_table;
-
- cal_table = E_CALENDAR_TABLE (data);
- e_calendar_table_paste_clipboard (cal_table);
-}
-
-static void
-e_calendar_table_on_assign (GtkWidget *widget, gpointer data)
-{
- ECalendarTable *cal_table;
- ECalModelComponent *comp_data;
-
- cal_table = E_CALENDAR_TABLE (data);
-
- comp_data = get_selected_comp (cal_table);
- if (comp_data)
- open_task (cal_table, comp_data, TRUE);
-}
-
-static void
-e_calendar_table_on_forward (GtkWidget *widget, gpointer data)
-{
- ECalendarTable *cal_table;
- ECalModelComponent *comp_data;
-
- cal_table = E_CALENDAR_TABLE (data);
-
- comp_data = get_selected_comp (cal_table);
- if (comp_data) {
- ECalComponent *comp;
-
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (comp_data->icalcomp));
- itip_send_comp (E_CAL_COMPONENT_METHOD_PUBLISH, comp, comp_data->client, NULL);
-
- g_object_unref (comp);
- }
-}
-
-static gint
-e_calendar_table_on_key_press (ETable *table,
- gint row,
- gint col,
- GdkEventKey *event,
- ECalendarTable *cal_table)
-{
- if (event->keyval == GDK_Delete) {
- delete_cb (NULL, cal_table);
- return TRUE;
- }
-
- return FALSE;
-}
-
-/* Loads the state of the table (headers shown etc.) from the given file. */
-void
-e_calendar_table_load_state (ECalendarTable *cal_table,
- gchar *filename)
-{
- struct stat st;
-
- g_return_if_fail (E_IS_CALENDAR_TABLE (cal_table));
-
- if (stat (filename, &st) == 0 && st.st_size > 0
- && S_ISREG (st.st_mode)) {
- e_table_load_state (e_table_scrolled_get_table (E_TABLE_SCROLLED (cal_table->etable)), filename);
- }
-}
-
-
-/* Saves the state of the table (headers shown etc.) to the given file. */
-void
-e_calendar_table_save_state (ECalendarTable *cal_table,
- gchar *filename)
-{
- g_return_if_fail (E_IS_CALENDAR_TABLE (cal_table));
-
- e_table_save_state (e_table_scrolled_get_table (E_TABLE_SCROLLED (cal_table->etable)),
- filename);
-}
-
-static void
-selection_get (GtkWidget *invisible,
- GtkSelectionData *selection_data,
- guint info,
- guint time_stamp,
- ECalendarTable *cal_table)
-{
- if (cal_table->clipboard_selection != NULL) {
- gtk_selection_data_set (selection_data,
- GDK_SELECTION_TYPE_STRING,
- 8,
- cal_table->clipboard_selection,
- strlen (cal_table->clipboard_selection));
- }
-}
-
-static void
-selection_clear_event (GtkWidget *invisible,
- GdkEventSelection *event,
- ECalendarTable *cal_table)
-{
- if (cal_table->clipboard_selection != NULL) {
- g_free (cal_table->clipboard_selection);
- cal_table->clipboard_selection = NULL;
- }
-}
-
-static void
-selection_received (GtkWidget *invisible,
- GtkSelectionData *selection_data,
- guint time,
- ECalendarTable *cal_table)
-{
- char *comp_str;
- icalcomponent *icalcomp;
- char *uid;
- ECalComponent *comp;
- ECal *client;
- icalcomponent_kind kind;
-
- g_return_if_fail (E_IS_CALENDAR_TABLE (cal_table));
-
- if (selection_data->length < 0 ||
- selection_data->type != GDK_SELECTION_TYPE_STRING) {
- return;
- }
-
- comp_str = (char *) selection_data->data;
- icalcomp = icalparser_parse_string ((const char *) comp_str);
- if (!icalcomp)
- return;
-
- /* check the type of the component */
- kind = icalcomponent_isa (icalcomp);
- if (kind != ICAL_VCALENDAR_COMPONENT &&
- kind != ICAL_VEVENT_COMPONENT &&
- kind != ICAL_VTODO_COMPONENT &&
- kind != ICAL_VJOURNAL_COMPONENT) {
- return;
- }
-
- client = e_cal_model_get_default_client (cal_table->model);
-
- e_calendar_table_set_status_message (cal_table, _("Updating objects"));
-
- if (kind == ICAL_VCALENDAR_COMPONENT) {
- icalcomponent_kind child_kind;
- icalcomponent *subcomp;
- icalcomponent *vcal_comp;
-
- vcal_comp = icalcomp;
- subcomp = icalcomponent_get_first_component (
- vcal_comp, ICAL_ANY_COMPONENT);
- while (subcomp) {
- child_kind = icalcomponent_isa (subcomp);
- if (child_kind == ICAL_VEVENT_COMPONENT ||
- child_kind == ICAL_VTODO_COMPONENT ||
- child_kind == ICAL_VJOURNAL_COMPONENT) {
- ECalComponent *tmp_comp;
-
- uid = e_cal_component_gen_uid ();
- tmp_comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (
- tmp_comp, icalcomponent_new_clone (subcomp));
- e_cal_component_set_uid (tmp_comp, uid);
- free (uid);
-
- /* FIXME should we convert start/due/complete times? */
- /* FIXME Error handling */
- e_cal_create_object (client, e_cal_component_get_icalcomponent (tmp_comp), NULL, NULL);
-
- g_object_unref (tmp_comp);
- }
- subcomp = icalcomponent_get_next_component (
- vcal_comp, ICAL_ANY_COMPONENT);
- }
- }
- else {
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomp);
- uid = e_cal_component_gen_uid ();
- e_cal_component_set_uid (comp, (const char *) uid);
- free (uid);
-
- e_cal_create_object (client, e_cal_component_get_icalcomponent (comp), NULL, NULL);
-
- g_object_unref (comp);
- }
-
- e_calendar_table_set_status_message (cal_table, NULL);
-}
-
-
-/* Returns the current time, for the ECellDateEdit items.
- FIXME: Should probably use the timezone of the item rather than the
- current timezone, though that may be difficult to get from here. */
-static struct tm
-e_calendar_table_get_current_time (ECellDateEdit *ecde, gpointer data)
-{
- char *location;
- icaltimezone *zone;
- struct tm tmp_tm = { 0 };
- struct icaltimetype tt;
-
- /* Get the current timezone. */
- location = calendar_config_get_timezone ();
- zone = icaltimezone_get_builtin_timezone (location);
-
- tt = icaltime_from_timet_with_zone (time (NULL), FALSE, zone);
-
- /* Now copy it to the struct tm and return it. */
- tmp_tm.tm_year = tt.year - 1900;
- tmp_tm.tm_mon = tt.month - 1;
- tmp_tm.tm_mday = tt.day;
- tmp_tm.tm_hour = tt.hour;
- tmp_tm.tm_min = tt.minute;
- tmp_tm.tm_sec = tt.second;
- tmp_tm.tm_isdst = -1;
-
- return tmp_tm;
-}
-
-
-#ifdef TRANSLATORS_ONLY
-
-static char *test[] = {
- N_("Click to add a task")
-};
-
-#endif
-
-/* Displays messages on the status bar */
-#define EVOLUTION_TASKS_PROGRESS_IMAGE "evolution-tasks-mini.png"
-static GdkPixbuf *progress_icon = NULL;
-
-void
-e_calendar_table_set_status_message (ECalendarTable *cal_table, const gchar *message)
-{
- EActivityHandler *activity_handler = calendar_component_peek_activity_handler (calendar_component_peek ());
-
- g_return_if_fail (E_IS_CALENDAR_TABLE (cal_table));
-
- if (!message || !*message) {
- if (cal_table->activity_id != 0) {
- e_activity_handler_operation_finished (activity_handler, cal_table->activity_id);
- cal_table->activity_id = 0;
- }
- } else if (cal_table->activity_id == 0) {
- char *client_id = g_strdup_printf ("%p", cal_table);
-
- if (progress_icon == NULL)
- progress_icon = gdk_pixbuf_new_from_file (EVOLUTION_IMAGESDIR "/" EVOLUTION_TASKS_PROGRESS_IMAGE, NULL);
-
- cal_table->activity_id = e_activity_handler_operation_started (activity_handler, client_id,
- progress_icon, message, TRUE);
-
- g_free (client_id);
- } else {
- e_activity_handler_operation_progressing (activity_handler, cal_table->activity_id, message, -1.0);
- }
-}
diff --git a/calendar/gui/e-calendar-table.etspec b/calendar/gui/e-calendar-table.etspec
deleted file mode 100644
index 2d87771d53..0000000000
--- a/calendar/gui/e-calendar-table.etspec
+++ /dev/null
@@ -1,25 +0,0 @@
-<ETableSpecification click-to-add="true" _click-to-add-message="Click to add a task" draw-grid="true">
- <ETableColumn model_col= "0" _title="Categories" expansion="1.0" minimum_width="10" resizable="true" cell="calstring" compare="string"/>
- <ETableColumn model_col= "1" _title="Classification" expansion="1.0" minimum_width="10" resizable="true" cell="classification" compare="string" priority="-1"/>
- <ETableColumn model_col="4" _title="Description" expansion="2.0" minimum_width="10" resizable="true" cell="calstring" compare="string" priority="-1"/>
- <ETableColumn model_col= "5" _title="Start Date" expansion="2.0" minimum_width="10" resizable="true" cell="dateedit" compare="date-compare" priority="-2"/>
- <ETableColumn model_col="6" _title="Alarms" expansion="1.0" minimum_width="10" resizable="true" cell="calstring" compare="string" disabled="true"/>
- <ETableColumn model_col="7" pixbuf="icon" _title="Type" expansion="1.0" minimum_width="16" resizable="false" cell="icon" compare="integer" priority="-4"/>
- <ETableColumn model_col= "8" _title="Summary" expansion="3.0" minimum_width="10" resizable="true" cell="calstring" compare="string" priority="10"/>
- <ETableColumn model_col= "10" _title="Completion Date" expansion="2.0" minimum_width="10" resizable="true" cell="dateedit" compare="date-compare" priority="-2"/>
- <ETableColumn model_col="11" pixbuf="complete" _title="Complete" expansion="1.0" minimum_width="16" resizable="false" cell="checkbox" compare="integer" priority="-4"/>
- <ETableColumn model_col= "12" _title="Due Date" expansion="2.0" minimum_width="10" resizable="true" cell="dateedit" compare="date-compare" priority="-2"/>
- <ETableColumn model_col= "13" _title="Geographical Position" expansion="1.0" minimum_width="10" resizable="true" cell="calstring" compare="string"/>
- <ETableColumn model_col= "15" _title="% Complete" expansion="1.0" minimum_width="10" resizable="true" cell="percent" compare="percent-compare" priority="-3"/>
- <ETableColumn model_col= "16" _title="Priority" expansion="1.0" minimum_width="10" resizable="true" cell="priority" compare="priority-compare" priority="-3"/>
- <ETableColumn model_col="17" _title="Status" expansion="1.0" minimum_width="10" resizable="true" cell="calstatus" compare="string" priority="-1"/>
- <ETableColumn model_col="18" _title="URL" expansion="2.0" minimum_width="10" resizable="true" cell="calstring" compare="string"/>
- <ETableColumn model_col="19" _title="Task sort" cell="task-sort" compare="task-sort" priority="-4"/>
-
- <ETableState>
- <column source="7"/>
- <column source="11"/>
- <column source= "8"/>
- <grouping></grouping>
- </ETableState>
-</ETableSpecification>
diff --git a/calendar/gui/e-calendar-table.h b/calendar/gui/e-calendar-table.h
deleted file mode 100644
index 810c78254b..0000000000
--- a/calendar/gui/e-calendar-table.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Author :
- * Damon Chaplin <damon@ximian.com>
- *
- * Copyright 2000, Ximian, Inc.
- * Copyright 2000, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-#ifndef _E_CALENDAR_TABLE_H_
-#define _E_CALENDAR_TABLE_H_
-
-#include <gtk/gtktable.h>
-#include <gal/e-table/e-table-scrolled.h>
-#include <widgets/misc/e-cell-date-edit.h>
-#include "e-cal-model.h"
-
-G_BEGIN_DECLS
-
-/*
- * ECalendarTable - displays the iCalendar objects in a table (an ETable).
- * Used for calendar events and tasks.
- */
-
-
-#define E_CALENDAR_TABLE(obj) GTK_CHECK_CAST (obj, e_calendar_table_get_type (), ECalendarTable)
-#define E_CALENDAR_TABLE_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, e_calendar_table_get_type (), ECalendarTableClass)
-#define E_IS_CALENDAR_TABLE(obj) GTK_CHECK_TYPE (obj, e_calendar_table_get_type ())
-
-
-typedef struct _ECalendarTable ECalendarTable;
-typedef struct _ECalendarTableClass ECalendarTableClass;
-
-
-struct _ECalendarTable {
- GtkTable table;
-
- /* The model that we use */
- ECalModel *model;
-
- GtkWidget *etable;
-
- /* The ECell used to view & edit dates. */
- ECellDateEdit *dates_cell;
-
- /* The invisible widget used for cut/copy/paste */
- GtkWidget *invisible;
- gchar *clipboard_selection;
- icalcomponent *tmp_vcal;
-
- /* Activity ID for the EActivityHandler (i.e. the status bar). */
- guint activity_id;
-};
-
-struct _ECalendarTableClass {
- GtkTableClass parent_class;
-};
-
-
-GtkType e_calendar_table_get_type (void);
-GtkWidget* e_calendar_table_new (void);
-
-ECalModel *e_calendar_table_get_model (ECalendarTable *cal_table);
-
-ETable *e_calendar_table_get_table (ECalendarTable *cal_table);
-
-void e_calendar_table_complete_selected (ECalendarTable *cal_table);
-void e_calendar_table_delete_selected (ECalendarTable *cal_table);
-
-/* Clipboard related functions */
-void e_calendar_table_cut_clipboard (ECalendarTable *cal_table);
-void e_calendar_table_copy_clipboard (ECalendarTable *cal_table);
-void e_calendar_table_paste_clipboard (ECalendarTable *cal_table);
-
-/* These load and save the state of the table (headers shown etc.) to/from
- the given file. */
-void e_calendar_table_load_state (ECalendarTable *cal_table,
- gchar *filename);
-void e_calendar_table_save_state (ECalendarTable *cal_table,
- gchar *filename);
-
-void e_calendar_table_set_status_message (ECalendarTable *cal_table,
- const gchar *message);
-
-G_END_DECLS
-
-#endif /* _E_CALENDAR_TABLE_H_ */
diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c
deleted file mode 100644
index f93cee6c10..0000000000
--- a/calendar/gui/e-calendar-view.c
+++ /dev/null
@@ -1,1492 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Author :
- * Rodrigo Moya <rodrigo@ximian.com>
- *
- * Copyright 2003, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#include <config.h>
-#include <string.h>
-#include <gtk/gtkimage.h>
-#include <gtk/gtkstock.h>
-#include <libgnome/gnome-i18n.h>
-#include <gal/util/e-util.h>
-#include "e-util/e-dialog-utils.h"
-#include "e-calendar-marshal.h"
-#include <libecal/e-cal-time-util.h>
-
-#include "calendar-commands.h"
-#include "calendar-component.h"
-#include "calendar-config.h"
-#include "comp-util.h"
-#include "e-cal-model-calendar.h"
-#include "e-cal-view.h"
-#include "e-comp-editor-registry.h"
-#include "itip-utils.h"
-#include "dialogs/delete-comp.h"
-#include "dialogs/delete-error.h"
-#include "dialogs/event-editor.h"
-#include "dialogs/send-comp.h"
-#include "dialogs/cancel-comp.h"
-#include "dialogs/recur-comp.h"
-#include "print.h"
-#include "goto.h"
-#include "ea-calendar.h"
-
-/* Used for the status bar messages */
-#define EVOLUTION_CALENDAR_PROGRESS_IMAGE "evolution-calendar-mini.png"
-static GdkPixbuf *progress_icon = NULL;
-
-struct _ECalendarViewPrivate {
- /* The GnomeCalendar we are associated to */
- GnomeCalendar *calendar;
-
- /* The calendar model we are monitoring */
- ECalModel *model;
-
- /* Current activity (for the EActivityHandler, i.e. the status bar). */
- guint activity_id;
-
- /* clipboard selections */
- gchar *clipboard_selection;
-
- /* The popup menu */
- EPopupMenu *view_menu;
-
- /* The default category */
- char *default_category;
-};
-
-static void e_calendar_view_class_init (ECalendarViewClass *klass);
-static void e_calendar_view_init (ECalendarView *cal_view, ECalendarViewClass *klass);
-static void e_calendar_view_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
-static void e_calendar_view_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec);
-static void e_calendar_view_destroy (GtkObject *object);
-
-static GObjectClass *parent_class = NULL;
-static GdkAtom clipboard_atom = GDK_NONE;
-extern ECompEditorRegistry *comp_editor_registry;
-
-/* Property IDs */
-enum props {
- PROP_0,
- PROP_MODEL,
-};
-
-/* FIXME Why are we emitting these event signals here? Can't the model just be listened to? */
-/* Signal IDs */
-enum {
- SELECTION_CHANGED,
- SELECTED_TIME_CHANGED,
- TIMEZONE_CHANGED,
- EVENT_CHANGED,
- EVENT_ADDED,
- LAST_SIGNAL
-};
-
-static guint e_calendar_view_signals[LAST_SIGNAL] = { 0 };
-
-static void
-e_calendar_view_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
-{
- ECalendarView *cal_view;
- ECalendarViewPrivate *priv;
-
- cal_view = E_CALENDAR_VIEW (object);
- priv = cal_view->priv;
-
- switch (property_id) {
- case PROP_MODEL:
- e_calendar_view_set_model (cal_view, E_CAL_MODEL (g_value_get_object (value)));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
- break;
- }
-}
-
-static void
-e_calendar_view_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
-{
- ECalendarView *cal_view;
- ECalendarViewPrivate *priv;
-
- cal_view = E_CALENDAR_VIEW (object);
- priv = cal_view->priv;
-
- switch (property_id) {
- case PROP_MODEL:
- g_value_set_object (value, e_calendar_view_get_model (cal_view));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
- break;
- }
-}
-
-static void
-e_calendar_view_class_init (ECalendarViewClass *klass)
-{
- GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_peek_parent (klass);
-
- /* Method override */
- gobject_class->set_property = e_calendar_view_set_property;
- gobject_class->get_property = e_calendar_view_get_property;
- object_class->destroy = e_calendar_view_destroy;
-
- klass->selection_changed = NULL;
- klass->selected_time_changed = NULL;
- klass->event_changed = NULL;
- klass->event_added = NULL;
-
- klass->get_selected_events = NULL;
- klass->get_selected_time_range = NULL;
- klass->set_selected_time_range = NULL;
- klass->get_visible_time_range = NULL;
- klass->update_query = NULL;
-
- g_object_class_install_property (gobject_class, PROP_MODEL,
- g_param_spec_object ("model", NULL, NULL, E_TYPE_CAL_MODEL,
- G_PARAM_READABLE | G_PARAM_WRITABLE
- | G_PARAM_CONSTRUCT));
-
- /* Create class' signals */
- e_calendar_view_signals[SELECTION_CHANGED] =
- g_signal_new ("selection_changed",
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ECalendarViewClass, selection_changed),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
- e_calendar_view_signals[SELECTED_TIME_CHANGED] =
- g_signal_new ("selected_time_changed",
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ECalendarViewClass, selected_time_changed),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
- e_calendar_view_signals[TIMEZONE_CHANGED] =
- g_signal_new ("timezone_changed",
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ECalendarViewClass, timezone_changed),
- NULL, NULL,
- e_calendar_marshal_VOID__POINTER_POINTER,
- G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_POINTER);
-
- e_calendar_view_signals[EVENT_CHANGED] =
- g_signal_new ("event_changed",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
- G_STRUCT_OFFSET (ECalendarViewClass, event_changed),
- NULL, NULL,
- g_cclosure_marshal_VOID__POINTER,
- G_TYPE_NONE, 1,
- G_TYPE_POINTER);
-
- e_calendar_view_signals[EVENT_ADDED] =
- g_signal_new ("event_added",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
- G_STRUCT_OFFSET (ECalendarViewClass, event_added),
- NULL, NULL,
- g_cclosure_marshal_VOID__POINTER,
- G_TYPE_NONE, 1,
- G_TYPE_POINTER);
-
- /* clipboard atom */
- if (!clipboard_atom)
- clipboard_atom = gdk_atom_intern ("CLIPBOARD", FALSE);
-
- /* init the accessibility support for e_day_view */
- e_cal_view_a11y_init ();
-}
-
-static void
-model_changed_cb (ETableModel *etm, gpointer user_data)
-{
- ECalendarView *cal_view = E_CALENDAR_VIEW (user_data);
-
- e_calendar_view_update_query (cal_view);
-}
-
-static void
-model_row_changed_cb (ETableModel *etm, int row, gpointer user_data)
-{
- ECalendarView *cal_view = E_CALENDAR_VIEW (user_data);
-
- e_calendar_view_update_query (cal_view);
-}
-
-static void
-model_cell_changed_cb (ETableModel *etm, int col, int row, gpointer user_data)
-{
- ECalendarView *cal_view = E_CALENDAR_VIEW (user_data);
-
- e_calendar_view_update_query (cal_view);
-}
-
-static void
-model_rows_changed_cb (ETableModel *etm, int row, int count, gpointer user_data)
-{
- ECalendarView *cal_view = E_CALENDAR_VIEW (user_data);
-
- e_calendar_view_update_query (cal_view);
-}
-
-void
-e_calendar_view_add_event (ECalendarView *cal_view, ECal *client, time_t dtstart,
- icaltimezone *default_zone, icalcomponent *icalcomp, gboolean in_top_canvas)
-{
- ECalComponent *comp;
- struct icaltimetype itime, old_dtstart, old_dtend;
- time_t tt_start, tt_end, new_dtstart;
- struct icaldurationtype ic_dur;
- char *uid;
- gint start_offset, end_offset;
- gboolean all_day_event;
-
- start_offset = 0;
- end_offset = 0;
-
- old_dtstart = icalcomponent_get_dtstart (icalcomp);
- tt_start = icaltime_as_timet (old_dtstart);
- old_dtend = icalcomponent_get_dtend (icalcomp);
- tt_end = icaltime_as_timet (old_dtend);
- ic_dur = icaldurationtype_from_int (tt_end - tt_start);
-
- if (icaldurationtype_as_int (ic_dur) > 60*60*24) {
- /* This is a long event */
- start_offset = old_dtstart.hour * 60 + old_dtstart.minute;
- end_offset = old_dtstart.hour * 60 + old_dtend.minute;
- }
-
- if (start_offset == 0 && end_offset == 0 && in_top_canvas)
- all_day_event = TRUE;
- else
- all_day_event = FALSE;
-
- if (in_top_canvas)
- new_dtstart = dtstart + start_offset * 60;
- else
- new_dtstart = dtstart;
-
- itime = icaltime_from_timet_with_zone (new_dtstart, FALSE, default_zone);
- if (all_day_event)
- itime.is_date = TRUE;
- icalcomponent_set_dtstart (icalcomp, itime);
-
- itime = icaltime_add (itime, ic_dur);
- if (all_day_event)
- itime.is_date = TRUE;
- icalcomponent_set_dtend (icalcomp, itime);
-
- /* FIXME The new uid stuff can go away once we actually set it in the backend */
- uid = e_cal_component_gen_uid ();
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (
- comp, icalcomponent_new_clone (icalcomp));
- e_cal_component_set_uid (comp, uid);
-
- /* FIXME Error handling */
- if (e_cal_create_object (client, e_cal_component_get_icalcomponent (comp), NULL, NULL)) {
- if (itip_organizer_is_user (comp, client) &&
- send_component_dialog ((GtkWindow *) gtk_widget_get_toplevel (GTK_WIDGET (cal_view)),
- client, comp, TRUE)) {
- itip_send_comp (E_CAL_COMPONENT_METHOD_REQUEST, comp,
- client, NULL);
- }
- } else {
- g_message (G_STRLOC ": Could not create the object!");
- }
-
- free (uid);
- g_object_unref (comp);
-}
-
-static void
-e_calendar_view_init (ECalendarView *cal_view, ECalendarViewClass *klass)
-{
- cal_view->priv = g_new0 (ECalendarViewPrivate, 1);
-
- cal_view->priv->model = (ECalModel *) e_cal_model_calendar_new ();
- g_signal_connect (G_OBJECT (cal_view->priv->model), "model_changed",
- G_CALLBACK (model_changed_cb), cal_view);
- g_signal_connect (G_OBJECT (cal_view->priv->model), "model_row_changed",
- G_CALLBACK (model_row_changed_cb), cal_view);
- g_signal_connect (G_OBJECT (cal_view->priv->model), "model_cell_changed",
- G_CALLBACK (model_cell_changed_cb), cal_view);
- g_signal_connect (G_OBJECT (cal_view->priv->model), "model_rows_inserted",
- G_CALLBACK (model_rows_changed_cb), cal_view);
- g_signal_connect (G_OBJECT (cal_view->priv->model), "model_rows_deleted",
- G_CALLBACK (model_rows_changed_cb), cal_view);
-
- cal_view->priv->clipboard_selection = NULL;
-}
-
-static void
-e_calendar_view_destroy (GtkObject *object)
-{
- ECalendarView *cal_view = (ECalendarView *) object;
-
- g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
-
- if (cal_view->priv) {
- if (cal_view->priv->model) {
- g_signal_handlers_disconnect_matched (cal_view->priv->model,
- G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, cal_view);
- g_object_unref (cal_view->priv->model);
- cal_view->priv->model = NULL;
- }
-
- if (cal_view->priv->clipboard_selection) {
- g_free (cal_view->priv->clipboard_selection);
- cal_view->priv->clipboard_selection = NULL;
- }
-
- if (cal_view->priv->default_category) {
- g_free (cal_view->priv->default_category);
- cal_view->priv->default_category = NULL;
- }
-
- g_free (cal_view->priv);
- cal_view->priv = NULL;
- }
-
- if (GTK_OBJECT_CLASS (parent_class)->destroy)
- GTK_OBJECT_CLASS (parent_class)->destroy (object);
-}
-
-E_MAKE_TYPE (e_calendar_view, "ECalendarView", ECalendarView, e_calendar_view_class_init,
- e_calendar_view_init, GTK_TYPE_TABLE);
-
-GnomeCalendar *
-e_calendar_view_get_calendar (ECalendarView *cal_view)
-{
- g_return_val_if_fail (E_IS_CALENDAR_VIEW (cal_view), NULL);
-
- return cal_view->priv->calendar;
-}
-
-void
-e_calendar_view_set_calendar (ECalendarView *cal_view, GnomeCalendar *calendar)
-{
- g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
-
- cal_view->priv->calendar = calendar;
-}
-
-ECalModel *
-e_calendar_view_get_model (ECalendarView *cal_view)
-{
- g_return_val_if_fail (E_IS_CALENDAR_VIEW (cal_view), NULL);
-
- return cal_view->priv->model;
-}
-
-void
-e_calendar_view_set_model (ECalendarView *cal_view, ECalModel *model)
-{
- g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
- g_return_if_fail (E_IS_CAL_MODEL (model));
-
- if (cal_view->priv->model) {
- g_signal_handlers_disconnect_matched (cal_view->priv->model, G_SIGNAL_MATCH_DATA,
- 0, 0, 0, NULL, cal_view);
- g_object_unref (cal_view->priv->model);
- }
-
- cal_view->priv->model = model;
- g_object_ref (cal_view->priv->model);
- g_signal_connect (G_OBJECT (cal_view->priv->model), "model_changed", G_CALLBACK (model_changed_cb), cal_view);
- g_signal_connect (G_OBJECT (cal_view->priv->model), "model_row_changed", G_CALLBACK (model_row_changed_cb), cal_view);
- g_signal_connect (G_OBJECT (cal_view->priv->model), "model_cell_changed", G_CALLBACK (model_cell_changed_cb), cal_view);
- g_signal_connect (G_OBJECT (cal_view->priv->model), "model_rows_inserted", G_CALLBACK (model_rows_changed_cb), cal_view);
- g_signal_connect (G_OBJECT (cal_view->priv->model), "model_rows_deleted", G_CALLBACK (model_rows_changed_cb), cal_view);
-
- e_calendar_view_update_query (cal_view);
-}
-
-icaltimezone *
-e_calendar_view_get_timezone (ECalendarView *cal_view)
-{
- g_return_val_if_fail (E_IS_CALENDAR_VIEW (cal_view), NULL);
- return e_cal_model_get_timezone (cal_view->priv->model);
-}
-
-void
-e_calendar_view_set_timezone (ECalendarView *cal_view, icaltimezone *zone)
-{
- icaltimezone *old_zone;
-
- g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
-
- old_zone = e_cal_model_get_timezone (cal_view->priv->model);
- if (old_zone == zone)
- return;
-
- e_cal_model_set_timezone (cal_view->priv->model, zone);
- g_signal_emit (G_OBJECT (cal_view), e_calendar_view_signals[TIMEZONE_CHANGED], 0,
- old_zone, zone);
-}
-
-const char *
-e_calendar_view_get_default_category (ECalendarView *cal_view)
-{
- g_return_val_if_fail (E_IS_CALENDAR_VIEW (cal_view), NULL);
- return (const char *) cal_view->priv->default_category;
-}
-
-/**
- * e_calendar_view_set_default_category
- * @cal_view: A calendar view.
- * @category: Default category name or NULL for no category.
- *
- * Sets the default category that will be used when creating new calendar
- * components from the given calendar view.
- */
-void
-e_calendar_view_set_default_category (ECalendarView *cal_view, const char *category)
-{
- g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
-
- if (cal_view->priv->default_category)
- g_free (cal_view->priv->default_category);
-
- cal_view->priv->default_category = g_strdup (category);
-}
-
-/**
- * e_calendar_view_get_use_24_hour_format:
- * @cal_view: A calendar view.
- *
- * Gets whether the view is using 24 hour times or not.
- *
- * Returns: the 24 hour setting.
- */
-gboolean
-e_calendar_view_get_use_24_hour_format (ECalendarView *cal_view)
-{
- g_return_val_if_fail (E_IS_CALENDAR_VIEW (cal_view), FALSE);
-
- return e_cal_model_get_use_24_hour_format (cal_view->priv->model);
-}
-
-/**
- * e_calendar_view_set_use_24_hour_format
- * @cal_view: A calendar view.
- * @use_24_hour: Whether to use 24 hour times or not.
- *
- * Sets the 12/24 hour times setting for the given view.
- */
-void
-e_calendar_view_set_use_24_hour_format (ECalendarView *cal_view, gboolean use_24_hour)
-{
- g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
-
- e_cal_model_set_use_24_hour_format (cal_view->priv->model, use_24_hour);
-}
-
-void
-e_calendar_view_set_status_message (ECalendarView *cal_view, const gchar *message)
-{
- EActivityHandler *activity_handler = calendar_component_peek_activity_handler (calendar_component_peek ());
-
- g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
-
- if (!message || !*message) {
- if (cal_view->priv->activity_id != 0) {
- e_activity_handler_operation_finished (activity_handler, cal_view->priv->activity_id);
- cal_view->priv->activity_id = 0;
- }
- } else if (cal_view->priv->activity_id == 0) {
- char *client_id = g_strdup_printf ("%p", cal_view);
-
- if (progress_icon == NULL)
- progress_icon = gdk_pixbuf_new_from_file (EVOLUTION_IMAGESDIR "/" EVOLUTION_CALENDAR_PROGRESS_IMAGE, NULL);
-
- cal_view->priv->activity_id = e_activity_handler_operation_started (activity_handler, client_id, progress_icon, message, TRUE);
-
- g_free (client_id);
- } else {
- e_activity_handler_operation_progressing (activity_handler, cal_view->priv->activity_id, message, -1.0);
- }
-}
-
-GList *
-e_calendar_view_get_selected_events (ECalendarView *cal_view)
-{
- g_return_val_if_fail (E_IS_CALENDAR_VIEW (cal_view), NULL);
-
- if (E_CALENDAR_VIEW_CLASS (G_OBJECT_GET_CLASS (cal_view))->get_selected_events)
- return E_CALENDAR_VIEW_CLASS (G_OBJECT_GET_CLASS (cal_view))->get_selected_events (cal_view);
-
- return NULL;
-}
-
-void
-e_calendar_view_get_selected_time_range (ECalendarView *cal_view, time_t *start_time, time_t *end_time)
-{
- g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
-
- if (E_CALENDAR_VIEW_CLASS (G_OBJECT_GET_CLASS (cal_view))->get_selected_time_range) {
- E_CALENDAR_VIEW_CLASS (G_OBJECT_GET_CLASS (cal_view))->get_selected_time_range (
- cal_view, start_time, end_time);
- }
-}
-
-void
-e_calendar_view_set_selected_time_range (ECalendarView *cal_view, time_t start_time, time_t end_time)
-{
- g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
-
- if (E_CALENDAR_VIEW_CLASS (G_OBJECT_GET_CLASS (cal_view))->set_selected_time_range) {
- E_CALENDAR_VIEW_CLASS (G_OBJECT_GET_CLASS (cal_view))->set_selected_time_range (
- cal_view, start_time, end_time);
- }
-}
-
-gboolean
-e_calendar_view_get_visible_time_range (ECalendarView *cal_view, time_t *start_time, time_t *end_time)
-{
- g_return_val_if_fail (E_IS_CALENDAR_VIEW (cal_view), FALSE);
-
- if (E_CALENDAR_VIEW_CLASS (G_OBJECT_GET_CLASS (cal_view))->get_visible_time_range) {
- return E_CALENDAR_VIEW_CLASS (G_OBJECT_GET_CLASS (cal_view))->get_visible_time_range (
- cal_view, start_time, end_time);
- }
-
- return FALSE;
-}
-
-void
-e_calendar_view_update_query (ECalendarView *cal_view)
-{
- g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
-
- e_calendar_view_set_status_message (cal_view, _("Searching"));
-
- if (E_CALENDAR_VIEW_CLASS (G_OBJECT_GET_CLASS (cal_view))->update_query) {
- E_CALENDAR_VIEW_CLASS (G_OBJECT_GET_CLASS (cal_view))->update_query (cal_view);
- }
-
- e_calendar_view_set_status_message (cal_view, NULL);
-}
-
-void
-e_calendar_view_cut_clipboard (ECalendarView *cal_view)
-{
- GList *selected, *l;
- const char *uid;
-
- g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
-
- selected = e_calendar_view_get_selected_events (cal_view);
- if (!selected)
- return;
-
- e_calendar_view_set_status_message (cal_view, _("Deleting selected objects"));
-
- e_calendar_view_copy_clipboard (cal_view);
- for (l = selected; l != NULL; l = l->next) {
- ECalComponent *comp;
- ECalendarViewEvent *event = (ECalendarViewEvent *) l->data;
- GError *error = NULL;
-
- if (!event)
- continue;
-
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
-
- if (itip_organizer_is_user (comp, event->comp_data->client)
- && cancel_component_dialog ((GtkWindow *) gtk_widget_get_toplevel (GTK_WIDGET (cal_view)),
- event->comp_data->client, comp, TRUE))
- itip_send_comp (E_CAL_COMPONENT_METHOD_CANCEL, comp,
- event->comp_data->client, NULL);
-
- e_cal_component_get_uid (comp, &uid);
- e_cal_remove_object (event->comp_data->client, uid, &error);
- delete_error_dialog (error, E_CAL_COMPONENT_EVENT);
-
- g_clear_error (&error);
-
- g_object_unref (comp);
- }
-
- e_calendar_view_set_status_message (cal_view, NULL);
-
- g_list_free (selected);
-}
-
-void
-e_calendar_view_copy_clipboard (ECalendarView *cal_view)
-{
- GList *selected, *l;
- gchar *comp_str;
- icalcomponent *vcal_comp;
- icalcomponent *new_icalcomp;
- ECalendarViewEvent *event;
-
- g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
-
- selected = e_calendar_view_get_selected_events (cal_view);
- if (!selected)
- return;
-
- /* create top-level VCALENDAR component and add VTIMEZONE's */
- vcal_comp = e_cal_util_new_top_level ();
- for (l = selected; l != NULL; l = l->next) {
- event = (ECalendarViewEvent *) l->data;
-
- if (event)
- e_cal_util_add_timezones_from_component (vcal_comp, event->comp_data->icalcomp);
- }
-
- for (l = selected; l != NULL; l = l->next) {
- event = (ECalendarViewEvent *) l->data;
-
- new_icalcomp = icalcomponent_new_clone (event->comp_data->icalcomp);
- icalcomponent_add_component (vcal_comp, new_icalcomp);
- }
-
- /* copy the VCALENDAR to the clipboard */
- comp_str = icalcomponent_as_ical_string (vcal_comp);
- if (cal_view->priv->clipboard_selection != NULL)
- g_free (cal_view->priv->clipboard_selection);
- cal_view->priv->clipboard_selection = g_strdup (comp_str);
- gtk_clipboard_set_text (gtk_widget_get_clipboard (GTK_WIDGET (cal_view), clipboard_atom),
- (const gchar *) comp_str,
- g_utf8_strlen (comp_str, -1));
-
- /* free memory */
- icalcomponent_free (vcal_comp);
- g_list_free (selected);
-}
-
-static void
-clipboard_get_text_cb (GtkClipboard *clipboard, const gchar *text, ECalendarView *cal_view)
-{
- char *default_tzid;
- icalcomponent *icalcomp;
- icalcomponent_kind kind;
- time_t selected_time_start, selected_time_end;
- icaltimezone *default_zone;
- ECal *client;
-
- g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
-
- icalcomp = icalparser_parse_string ((const char *) text);
- if (!icalcomp)
- return;
-
- default_tzid = calendar_config_get_timezone ();
-
- client = e_cal_model_get_default_client (cal_view->priv->model);
- /* FIXME Error checking */
- e_cal_get_timezone (client, default_tzid, &default_zone, NULL);
-
- /* check the type of the component */
- /* FIXME An error dialog if we return? */
- kind = icalcomponent_isa (icalcomp);
- if (kind != ICAL_VCALENDAR_COMPONENT && kind != ICAL_VEVENT_COMPONENT)
- return;
-
- e_calendar_view_set_status_message (cal_view, _("Updating objects"));
- e_calendar_view_get_selected_time_range (cal_view, &selected_time_start, &selected_time_end);
-
- /* FIXME Timezone handling */
- if (kind == ICAL_VCALENDAR_COMPONENT) {
- icalcomponent_kind child_kind;
- icalcomponent *subcomp;
-
- subcomp = icalcomponent_get_first_component (icalcomp, ICAL_ANY_COMPONENT);
- while (subcomp) {
- child_kind = icalcomponent_isa (subcomp);
- if (child_kind == ICAL_VEVENT_COMPONENT)
- e_calendar_view_add_event (cal_view, client, selected_time_start,
- default_zone, subcomp, FALSE);
- else if (child_kind == ICAL_VTIMEZONE_COMPONENT) {
- icaltimezone *zone;
-
- zone = icaltimezone_new ();
- icaltimezone_set_component (zone, subcomp);
- e_cal_add_timezone (client, zone, NULL);
-
- icaltimezone_free (zone, 1);
- }
-
- subcomp = icalcomponent_get_next_component (
- icalcomp, ICAL_ANY_COMPONENT);
- }
-
- icalcomponent_free (icalcomp);
-
- } else {
- e_calendar_view_add_event (cal_view, client, selected_time_start, default_zone, icalcomp, FALSE);
- }
-
- e_calendar_view_set_status_message (cal_view, NULL);
-}
-
-void
-e_calendar_view_paste_clipboard (ECalendarView *cal_view)
-{
- g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
-
- gtk_clipboard_request_text (gtk_widget_get_clipboard (GTK_WIDGET (cal_view), clipboard_atom),
- (GtkClipboardTextReceivedFunc) clipboard_get_text_cb, cal_view);
-}
-
-static void
-delete_event (ECalendarView *cal_view, ECalendarViewEvent *event)
-{
- ECalComponent *comp;
- ECalComponentVType vtype;
-
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
- vtype = e_cal_component_get_vtype (comp);
-
- if (delete_component_dialog (comp, FALSE, 1, vtype, GTK_WIDGET (cal_view))) {
- const char *uid;
- GError *error = NULL;
-
- if (itip_organizer_is_user (comp, event->comp_data->client)
- && cancel_component_dialog ((GtkWindow *) gtk_widget_get_toplevel (GTK_WIDGET (cal_view)),
- event->comp_data->client,
- comp, TRUE))
- itip_send_comp (E_CAL_COMPONENT_METHOD_CANCEL, comp,
- event->comp_data->client, NULL);
-
- e_cal_component_get_uid (comp, &uid);
- if (!uid || !*uid) {
- g_object_unref (comp);
- return;
- }
-
- e_cal_remove_object (event->comp_data->client, uid, &error);
- delete_error_dialog (error, E_CAL_COMPONENT_EVENT);
- g_clear_error (&error);
- }
-
- g_object_unref (comp);
-}
-
-void
-e_calendar_view_delete_selected_event (ECalendarView *cal_view)
-{
- GList *selected;
- ECalendarViewEvent *event;
-
- selected = e_calendar_view_get_selected_events (cal_view);
- if (!selected)
- return;
-
- event = (ECalendarViewEvent *) selected->data;
- if (event)
- delete_event (cal_view, event);
-
- g_list_free (selected);
-}
-
-void
-e_calendar_view_delete_selected_events (ECalendarView *cal_view)
-{
- GList *selected, *l;
- ECalendarViewEvent *event;
-
- selected = e_calendar_view_get_selected_events (cal_view);
- if (!selected)
- return;
-
- for (l = selected; l != NULL; l = l->next) {
- event = (ECalendarViewEvent *) l->data;
- if (event)
- delete_event (cal_view, event);
- }
-
- g_list_free (selected);
-}
-
-void
-e_calendar_view_delete_selected_occurrence (ECalendarView *cal_view)
-{
- ECalendarViewEvent *event;
- GList *selected;
- const char *uid;
- GError *error = NULL;
-
- selected = e_calendar_view_get_selected_events (cal_view);
- if (!selected)
- return;
-
- event = (ECalendarViewEvent *) selected->data;
-
- uid = icalcomponent_get_uid (event->comp_data->icalcomp);
- /* FIXME: use 'rid' argument */
- e_cal_remove_object_with_mod (event->comp_data->client, uid, NULL, CALOBJ_MOD_THIS, &error);
-
- delete_error_dialog (error, E_CAL_COMPONENT_EVENT);
- g_clear_error (&error);
-
- /* free memory */
- g_list_free (selected);
-}
-
-static void
-on_new_appointment (GtkWidget *widget, gpointer user_data)
-{
- ECalendarView *cal_view = (ECalendarView *) user_data;
-
- e_calendar_view_new_appointment (cal_view);
-}
-
-static void
-on_new_event (GtkWidget *widget, gpointer user_data)
-{
- time_t dtstart, dtend;
- ECalendarView *cal_view = (ECalendarView *) user_data;
-
- e_calendar_view_get_selected_time_range (cal_view, &dtstart, &dtend);
- e_calendar_view_new_appointment_for (cal_view, dtstart, dtend, TRUE, FALSE);
-}
-
-static void
-on_new_meeting (GtkWidget *widget, gpointer user_data)
-{
- time_t dtstart, dtend;
- ECalendarView *cal_view = (ECalendarView *) user_data;
-
- e_calendar_view_get_selected_time_range (cal_view, &dtstart, &dtend);
- e_calendar_view_new_appointment_for (cal_view, dtstart, dtend, FALSE, TRUE);
-}
-
-static void
-on_new_task (GtkWidget *widget, gpointer user_data)
-{
- ECalendarView *cal_view = (ECalendarView *) user_data;
- gnome_calendar_new_task (cal_view->priv->calendar);
-}
-
-static void
-on_goto_date (GtkWidget *widget, gpointer user_data)
-{
- ECalendarView *cal_view = E_CALENDAR_VIEW (user_data);
-
- goto_dialog (cal_view->priv->calendar);
-}
-
-static void
-on_goto_today (GtkWidget *widget, gpointer user_data)
-{
- ECalendarView *cal_view = E_CALENDAR_VIEW (user_data);
-
- calendar_goto_today (cal_view->priv->calendar);
-}
-
-static void
-on_edit_appointment (GtkWidget *widget, gpointer user_data)
-{
- GList *selected;
- ECalendarView *cal_view = E_CALENDAR_VIEW (user_data);
-
- selected = e_calendar_view_get_selected_events (cal_view);
- if (selected) {
- ECalendarViewEvent *event = (ECalendarViewEvent *) selected->data;
-
- if (event)
- e_calendar_view_edit_appointment (cal_view, event->comp_data->client,
- event->comp_data->icalcomp, FALSE);
-
- g_list_free (selected);
- }
-}
-
-static void
-on_print (GtkWidget *widget, gpointer user_data)
-{
- ECalendarView *cal_view;
- time_t start;
- GnomeCalendarViewType view_type;
- PrintView print_view;
-
- cal_view = E_CALENDAR_VIEW (user_data);
-
- e_calendar_view_get_visible_time_range (cal_view, &start, NULL);
- view_type = gnome_calendar_get_view (cal_view->priv->calendar);
-
- switch (view_type) {
- case GNOME_CAL_DAY_VIEW :
- print_view = PRINT_VIEW_DAY;
- break;
-
- case GNOME_CAL_WORK_WEEK_VIEW :
- case GNOME_CAL_WEEK_VIEW:
- print_view = PRINT_VIEW_WEEK;
- break;
-
- case GNOME_CAL_MONTH_VIEW:
- print_view = PRINT_VIEW_MONTH;
- break;
-
- default:
- g_assert_not_reached ();
- return;
- }
-
- print_calendar (cal_view->priv->calendar, FALSE, start, print_view);
-}
-
-static void
-on_save_as (GtkWidget *widget, gpointer user_data)
-{
- ECalendarView *cal_view;
- GList *selected;
- char *filename;
- char *ical_string;
- FILE *file;
- ECalendarViewEvent *event;
-
- cal_view = E_CALENDAR_VIEW (user_data);
-
- selected = e_calendar_view_get_selected_events (cal_view);
- if (!selected)
- return;
-
- filename = e_file_dialog_save (_("Save as..."));
- if (filename == NULL)
- return;
-
- event = (ECalendarViewEvent *) selected->data;
- ical_string = e_cal_get_component_as_string (event->comp_data->client, event->comp_data->icalcomp);
- if (ical_string == NULL) {
- g_warning ("Couldn't convert item to a string");
- return;
- }
-
- file = fopen (filename, "w");
- if (file == NULL) {
- g_warning ("Couldn't save item");
- return;
- }
-
- fprintf (file, ical_string);
- g_free (ical_string);
- fclose (file);
-
- g_list_free (selected);
-}
-
-static void
-on_print_event (GtkWidget *widget, gpointer user_data)
-{
- ECalendarView *cal_view;
- GList *selected;
- ECalendarViewEvent *event;
- ECalComponent *comp;
-
- cal_view = E_CALENDAR_VIEW (user_data);
- selected = e_calendar_view_get_selected_events (cal_view);
- if (!selected)
- return;
-
- event = (ECalendarViewEvent *) selected->data;
-
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
- print_comp (comp, event->comp_data->client, FALSE);
-
- g_object_unref (comp);
-}
-
-static void
-on_meeting (GtkWidget *widget, gpointer user_data)
-{
- GList *selected;
- ECalendarView *cal_view = E_CALENDAR_VIEW (user_data);
-
- selected = e_calendar_view_get_selected_events (cal_view);
- if (selected) {
- ECalendarViewEvent *event = (ECalendarViewEvent *) selected->data;
- e_calendar_view_edit_appointment (cal_view, event->comp_data->client, event->comp_data->icalcomp, TRUE);
-
- g_list_free (selected);
- }
-}
-
-static void
-on_forward (GtkWidget *widget, gpointer user_data)
-{
- GList *selected;
- ECalendarView *cal_view = E_CALENDAR_VIEW (user_data);
-
- selected = e_calendar_view_get_selected_events (cal_view);
- if (selected) {
- ECalComponent *comp;
- ECalendarViewEvent *event = (ECalendarViewEvent *) selected->data;
-
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
- itip_send_comp (E_CAL_COMPONENT_METHOD_PUBLISH, comp, event->comp_data->client, NULL);
-
- g_list_free (selected);
- g_object_unref (comp);
- }
-}
-
-static void
-on_publish (GtkWidget *widget, gpointer user_data)
-{
- ECalendarView *cal_view;
- icaltimezone *utc;
- time_t start = time (NULL), end;
- GList *comp_list = NULL, *client_list, *cl;
-
- cal_view = E_CALENDAR_VIEW (user_data);
-
- utc = icaltimezone_get_utc_timezone ();
- start = time_day_begin_with_zone (start, utc);
- end = time_add_week_with_zone (start, 6, utc);
-
- client_list = e_cal_model_get_client_list (cal_view->priv->model);
- for (cl = client_list; cl != NULL; cl = cl->next) {
- if (e_cal_get_free_busy ((ECal *) cl->data, NULL, start, end, &comp_list, NULL)) {
- GList *l;
-
- for (l = comp_list; l; l = l->next) {
- ECalComponent *comp = E_CAL_COMPONENT (l->data);
- itip_send_comp (E_CAL_COMPONENT_METHOD_PUBLISH, comp, (ECal *) cl->data, NULL);
-
- g_object_unref (comp);
- }
-
- g_list_free (comp_list);
- }
- }
-
- g_list_free (client_list);
-}
-
-static void
-on_delete_appointment (GtkWidget *widget, gpointer user_data)
-{
- ECalendarView *cal_view;
-
- cal_view = E_CALENDAR_VIEW (user_data);
- e_calendar_view_delete_selected_event (cal_view);
-}
-
-static void
-on_delete_occurrence (GtkWidget *widget, gpointer user_data)
-{
- ECalendarView *cal_view;
-
- cal_view = E_CALENDAR_VIEW (user_data);
- e_calendar_view_delete_selected_occurrence (cal_view);
-}
-
-static void
-on_cut (GtkWidget *widget, gpointer user_data)
-{
- ECalendarView *cal_view = E_CALENDAR_VIEW (user_data);
-
- e_calendar_view_cut_clipboard (cal_view);
-}
-
-static void
-on_copy (GtkWidget *widget, gpointer user_data)
-{
- ECalendarView *cal_view = E_CALENDAR_VIEW (user_data);
-
- e_calendar_view_copy_clipboard (cal_view);
-}
-
-static void
-on_paste (GtkWidget *widget, gpointer user_data)
-{
- ECalendarView *cal_view = E_CALENDAR_VIEW (user_data);
-
- e_calendar_view_paste_clipboard (cal_view);
-}
-
-enum {
- /*
- * This is used to "flag" events that can not be editted
- */
- MASK_EDITABLE = 1,
-
- /*
- * To disable recurring actions to be displayed
- */
- MASK_RECURRING = 2,
-
- /*
- * To disable actions for non-recurring items to be displayed
- */
- MASK_SINGLE = 4,
-
- /*
- * This is used to when an event is currently being edited
- * in another window and we want to disable the event
- * from being edited twice
- */
- MASK_EDITING = 8,
-
- /*
- * This is used to when an event is already a meeting and
- * we want to disable the schedule meeting command
- */
- MASK_MEETING = 16,
-
- /*
- * To disable cut and copy for meetings the user is not the
- * organizer of
- */
- MASK_MEETING_ORGANIZER = 32,
-
- /*
- * To disable things not valid for instances
- */
- MASK_INSTANCE = 64
-};
-
-static EPopupMenu main_items [] = {
- E_POPUP_ITEM (N_("New _Appointment..."), GTK_SIGNAL_FUNC (on_new_appointment), MASK_EDITABLE),
- E_POPUP_ITEM (N_("New All Day _Event"), GTK_SIGNAL_FUNC (on_new_event), MASK_EDITABLE),
- E_POPUP_ITEM (N_("New Meeting"), GTK_SIGNAL_FUNC (on_new_meeting), MASK_EDITABLE),
- E_POPUP_ITEM (N_("New Task"), GTK_SIGNAL_FUNC (on_new_task), MASK_EDITABLE),
-
- E_POPUP_SEPARATOR,
-
- E_POPUP_ITEM (N_("_Print..."), GTK_SIGNAL_FUNC (on_print), 0),
-
- E_POPUP_SEPARATOR,
-
- E_POPUP_ITEM (N_("_Paste"), GTK_SIGNAL_FUNC (on_paste), MASK_EDITABLE),
-
- E_POPUP_SEPARATOR,
-
- E_POPUP_SUBMENU (N_("Current View"), NULL, 0),
-
- E_POPUP_ITEM (N_("Go to _Today"), GTK_SIGNAL_FUNC (on_goto_today), 0),
- E_POPUP_ITEM (N_("_Go to Date..."), GTK_SIGNAL_FUNC (on_goto_date), 0),
-
- E_POPUP_SEPARATOR,
-
- E_POPUP_ITEM (N_("_Publish Free/Busy Information"), GTK_SIGNAL_FUNC (on_publish), 0),
-
- E_POPUP_TERMINATOR
-};
-
-static EPopupMenu child_items [] = {
- E_POPUP_ITEM (N_("_Open"), GTK_SIGNAL_FUNC (on_edit_appointment), MASK_EDITING),
- E_POPUP_ITEM (N_("_Save As..."), GTK_SIGNAL_FUNC (on_save_as), MASK_EDITING),
- E_POPUP_ITEM (N_("_Print..."), GTK_SIGNAL_FUNC (on_print_event), MASK_EDITING),
-
- /* Only show this separator if one of the above is shown. */
- E_POPUP_SEPARATOR,
-
- E_POPUP_ITEM (N_("C_ut"), GTK_SIGNAL_FUNC (on_cut), MASK_EDITING | MASK_EDITABLE | MASK_MEETING_ORGANIZER),
- E_POPUP_ITEM (N_("_Copy"), GTK_SIGNAL_FUNC (on_copy), MASK_EDITING | MASK_MEETING_ORGANIZER),
- E_POPUP_ITEM (N_("_Paste"), GTK_SIGNAL_FUNC (on_paste), MASK_EDITABLE),
-
- E_POPUP_SEPARATOR,
-
- E_POPUP_ITEM (N_("_Schedule Meeting..."), GTK_SIGNAL_FUNC (on_meeting), MASK_EDITABLE | MASK_EDITING | MASK_MEETING),
- E_POPUP_ITEM (N_("_Forward as iCalendar..."), GTK_SIGNAL_FUNC (on_forward), MASK_EDITING),
-
- E_POPUP_SEPARATOR,
-
- E_POPUP_ITEM (N_("_Delete"), GTK_SIGNAL_FUNC (on_delete_appointment), MASK_EDITABLE | MASK_SINGLE | MASK_EDITING),
- E_POPUP_ITEM (N_("Delete this _Occurrence"), GTK_SIGNAL_FUNC (on_delete_occurrence), MASK_RECURRING | MASK_EDITING | MASK_EDITABLE),
- E_POPUP_ITEM (N_("Delete _All Occurrences"), GTK_SIGNAL_FUNC (on_delete_appointment), MASK_RECURRING | MASK_EDITING | MASK_EDITABLE),
-
- E_POPUP_TERMINATOR
-};
-
-static void
-free_view_popup (GtkWidget *widget, gpointer data)
-{
- ECalendarView *cal_view = E_CALENDAR_VIEW (data);
-
- if (cal_view->priv->view_menu == NULL)
- return;
-
- gnome_calendar_discard_view_popup (cal_view->priv->calendar, cal_view->priv->view_menu);
- cal_view->priv->view_menu = NULL;
-}
-
-static void
-setup_popup_icons (EPopupMenu *context_menu)
-{
- gint i;
-
- for (i = 0; context_menu[i].name; i++) {
- GtkWidget *pixmap_widget = NULL;
-
- if (!strcmp (context_menu[i].name, _("_Copy")))
- pixmap_widget = gtk_image_new_from_stock (GTK_STOCK_COPY, GTK_ICON_SIZE_MENU);
- else if (!strcmp (context_menu[i].name, _("C_ut")))
- pixmap_widget = gtk_image_new_from_stock (GTK_STOCK_CUT, GTK_ICON_SIZE_MENU);
- else if (!strcmp (context_menu[i].name, _("_Delete")) ||
- !strcmp (context_menu[i].name, _("Delete this _Occurrence")) ||
- !strcmp (context_menu[i].name, _("Delete _All Occurrences")))
- pixmap_widget = gtk_image_new_from_stock (GTK_STOCK_DELETE, GTK_ICON_SIZE_MENU);
- else if (!strcmp (context_menu[i].name, _("Go to _Today")))
- pixmap_widget = gtk_image_new_from_stock (GTK_STOCK_HOME, GTK_ICON_SIZE_MENU);
- else if (!strcmp (context_menu[i].name, _("_Go to Date...")))
- pixmap_widget = gtk_image_new_from_stock (GTK_STOCK_JUMP_TO, GTK_ICON_SIZE_MENU);
- else if (!strcmp (context_menu[i].name, _("New _Appointment...")))
- pixmap_widget = gtk_image_new_from_file (EVOLUTION_IMAGESDIR "/new_appointment.xpm");
- else if (!strcmp (context_menu[i].name, _("New All Day _Event")))
- pixmap_widget = gtk_image_new_from_file (EVOLUTION_IMAGESDIR "/new_all_day_event.png");
- else if (!strcmp (context_menu[i].name, _("New Meeting")))
- pixmap_widget = gtk_image_new_from_file (EVOLUTION_IMAGESDIR "/meeting-request-16.png");
- else if (!strcmp (context_menu[i].name, _("New Task")))
- pixmap_widget = gtk_image_new_from_file (EVOLUTION_IMAGESDIR "/new_task-16.png");
- else if (!strcmp (context_menu[i].name, _("_Open")))
- pixmap_widget = gtk_image_new_from_stock (GTK_STOCK_OPEN, GTK_ICON_SIZE_MENU);
- else if (!strcmp (context_menu[i].name, _("_Paste")))
- pixmap_widget = gtk_image_new_from_stock (GTK_STOCK_PASTE, GTK_ICON_SIZE_MENU);
- else if (!strcmp (context_menu[i].name, _("_Print...")))
- pixmap_widget = gtk_image_new_from_stock (GTK_STOCK_PRINT, GTK_ICON_SIZE_MENU);
- else if (!strcmp (context_menu[i].name, _("_Save As...")))
- pixmap_widget = gtk_image_new_from_stock (GTK_STOCK_SAVE_AS, GTK_ICON_SIZE_MENU);
- else if (!strcmp (context_menu[i].name, _("_Settings...")))
- pixmap_widget = gtk_image_new_from_stock (GTK_STOCK_PREFERENCES, GTK_ICON_SIZE_MENU);
-
- if (pixmap_widget)
- gtk_widget_show (pixmap_widget);
- context_menu[i].pixmap_widget = pixmap_widget;
- }
-}
-
-GtkMenu *
-e_calendar_view_create_popup_menu (ECalendarView *cal_view)
-{
- GList *selected;
- EPopupMenu *context_menu;
- guint32 disable_mask = 0, hide_mask = 0;
- GtkMenu *popup;
- ECal *client = NULL;
- gboolean read_only = TRUE;
-
- g_return_val_if_fail (E_IS_CALENDAR_VIEW (cal_view), NULL);
-
- /* get the selection */
- selected = e_calendar_view_get_selected_events (cal_view);
-
- if (selected == NULL) {
- cal_view->priv->view_menu = gnome_calendar_setup_view_popup (cal_view->priv->calendar);
- main_items[9].submenu = cal_view->priv->view_menu;
- context_menu = main_items;
-
- client = e_cal_model_get_default_client (cal_view->priv->model);
- } else {
- ECalendarViewEvent *event;
-
- context_menu = child_items;
-
- event = (ECalendarViewEvent *) selected->data;
- if (e_cal_util_component_has_recurrences (event->comp_data->icalcomp))
- hide_mask |= MASK_SINGLE;
- else
- hide_mask |= MASK_RECURRING;
-
- if (e_cal_util_component_is_instance (event->comp_data->icalcomp))
- hide_mask |= MASK_INSTANCE;
-
- if (e_cal_util_component_has_organizer (event->comp_data->icalcomp)) {
- ECalComponent *comp;
-
- disable_mask |= MASK_MEETING;
-
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
- if (!itip_organizer_is_user (comp, event->comp_data->client))
- disable_mask |= MASK_MEETING_ORGANIZER;
-
- g_object_unref (comp);
- }
-
- client = event->comp_data->client;
- }
-
- e_cal_is_read_only (client, &read_only, NULL);
- if (read_only)
- disable_mask |= MASK_EDITABLE;
-
- setup_popup_icons (context_menu);
- popup = e_popup_menu_create (context_menu, disable_mask, hide_mask, cal_view);
- g_signal_connect (popup, "selection-done", G_CALLBACK (free_view_popup), cal_view);
-
- return popup;
-}
-
-/**
- * e_calendar_view_new_appointment_for
- * @cal_view: A calendar view.
- * @dtstart: A Unix time_t that marks the beginning of the appointment.
- * @dtend: A Unix time_t that marks the end of the appointment.
- * @all_day: If TRUE, the dtstart and dtend are expanded to cover
- * the entire day, and the event is set to TRANSPARENT.
- * @meeting: Whether the appointment is a meeting or not.
- *
- * Opens an event editor dialog for a new appointment.
- */
-void
-e_calendar_view_new_appointment_for (ECalendarView *cal_view,
- time_t dtstart, time_t dtend,
- gboolean all_day,
- gboolean meeting)
-{
- ECalendarViewPrivate *priv;
- struct icaltimetype itt;
- ECalComponentDateTime dt;
- ECalComponent *comp;
- icalcomponent *icalcomp;
- ECalComponentTransparency transparency;
-
- g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
-
- priv = cal_view->priv;
-
- dt.value = &itt;
- if (all_day)
- dt.tzid = NULL;
- else
- dt.tzid = icaltimezone_get_tzid (e_cal_model_get_timezone (cal_view->priv->model));
-
- icalcomp = e_cal_model_create_component_with_defaults (priv->model);
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomp);
-
- /* DTSTART, DTEND */
- itt = icaltime_from_timet_with_zone (dtstart, FALSE, e_cal_model_get_timezone (cal_view->priv->model));
- if (all_day) {
- itt.hour = itt.minute = itt.second = 0;
- itt.is_date = TRUE;
- }
- e_cal_component_set_dtstart (comp, &dt);
-
- itt = icaltime_from_timet_with_zone (dtend, FALSE, e_cal_model_get_timezone (cal_view->priv->model));
- if (all_day) {
- /* We round it up to the end of the day, unless it is
- already set to midnight */
- if (itt.hour != 0 || itt.minute != 0 || itt.second != 0) {
- icaltime_adjust (&itt, 1, 0, 0, 0);
- }
- itt.hour = itt.minute = itt.second = 0;
- itt.is_date = TRUE;
- }
- e_cal_component_set_dtend (comp, &dt);
-
- /* TRANSPARENCY */
- transparency = all_day ? E_CAL_COMPONENT_TRANSP_TRANSPARENT
- : E_CAL_COMPONENT_TRANSP_OPAQUE;
- e_cal_component_set_transparency (comp, transparency);
-
- /* CATEGORY */
- e_cal_component_set_categories (comp, priv->default_category);
-
- /* edit the object */
- e_cal_component_commit_sequence (comp);
-
- e_calendar_view_edit_appointment (cal_view,
- e_cal_model_get_default_client (priv->model),
- icalcomp, meeting);
-
- g_object_unref (comp);
-}
-
-/**
- * e_calendar_view_new_appointment
- * @cal_view: A calendar view.
- *
- * Opens an event editor dialog for a new appointment. The appointment's
- * start and end times are set to the currently selected time range in
- * the calendar view.
- */
-void
-e_calendar_view_new_appointment (ECalendarView *cal_view)
-{
- time_t dtstart, dtend;
-
- g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
-
- e_calendar_view_get_selected_time_range (cal_view, &dtstart, &dtend);
- e_calendar_view_new_appointment_for (cal_view, dtstart, dtend, FALSE, FALSE);
-}
-
-/**
- * e_calendar_view_edit_appointment
- * @cal_view: A calendar view.
- * @client: Calendar client.
- * @icalcomp: The object to be edited.
- * @meeting: Whether the appointment is a meeting or not.
- *
- * Opens an editor window to allow the user to edit the selected
- * object.
- */
-void
-e_calendar_view_edit_appointment (ECalendarView *cal_view,
- ECal *client,
- icalcomponent *icalcomp,
- gboolean meeting)
-{
- ECalendarViewPrivate *priv;
- CompEditor *ce;
- const char *uid;
- ECalComponent *comp;
-
- g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
- g_return_if_fail (E_IS_CAL (client));
- g_return_if_fail (icalcomp != NULL);
-
- priv = cal_view->priv;
-
- uid = icalcomponent_get_uid (icalcomp);
-
- ce = e_comp_editor_registry_find (comp_editor_registry, uid);
- if (!ce) {
- EventEditor *ee;
-
- ee = event_editor_new (client);
- ce = COMP_EDITOR (ee);
-
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (icalcomp));
- comp_editor_edit_comp (ce, comp);
- if (meeting)
- event_editor_show_meeting (ee);
-
- e_comp_editor_registry_add (comp_editor_registry, ce, FALSE);
-
- g_object_unref (comp);
- }
-
- comp_editor_focus (ce);
-}
diff --git a/calendar/gui/e-calendar-view.h b/calendar/gui/e-calendar-view.h
deleted file mode 100644
index a1b11023b3..0000000000
--- a/calendar/gui/e-calendar-view.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Author :
- * Rodrigo Moya <rodrigo@ximian.com>
- *
- * Copyright 2003, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-#ifndef _E_CALENDAR_VIEW_H_
-#define _E_CALENDAR_VIEW_H_
-
-#include <libecal/e-cal.h>
-#include <gtk/gtktable.h>
-#include "e-cal-model.h"
-#include "gnome-cal.h"
-
-G_BEGIN_DECLS
-
-/*
- * EView - base widget class for the calendar views.
- */
-
-#define E_CALENDAR_VIEW(obj) GTK_CHECK_CAST (obj, e_calendar_view_get_type (), ECalendarView)
-#define E_CALENDAR_VIEW_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, e_calendar_view_get_type (), ECalendarViewClass)
-#define E_IS_CALENDAR_VIEW(obj) GTK_CHECK_TYPE (obj, e_calendar_view_get_type ())
-
-typedef enum {
- E_CALENDAR_VIEW_POS_OUTSIDE,
- E_CALENDAR_VIEW_POS_NONE,
- E_CALENDAR_VIEW_POS_EVENT,
- E_CALENDAR_VIEW_POS_LEFT_EDGE,
- E_CALENDAR_VIEW_POS_RIGHT_EDGE,
- E_CALENDAR_VIEW_POS_TOP_EDGE,
- E_CALENDAR_VIEW_POS_BOTTOM_EDGE
-} ECalendarViewPosition;
-
-#define E_CALENDAR_VIEW_EVENT_FIELDS \
- GnomeCanvasItem *canvas_item; \
- ECalModelComponent *comp_data; \
- gboolean allocated_comp_data; \
- time_t start; \
- time_t end; \
- guint16 start_minute; \
- guint16 end_minute; \
- guint different_timezone : 1;
-
-typedef struct {
- E_CALENDAR_VIEW_EVENT_FIELDS
-} ECalendarViewEvent;
-
-typedef struct _ECalendarView ECalendarView;
-typedef struct _ECalendarViewClass ECalendarViewClass;
-typedef struct _ECalendarViewPrivate ECalendarViewPrivate;
-
-struct _ECalendarView {
- GtkTable table;
- ECalendarViewPrivate *priv;
-};
-
-struct _ECalendarViewClass {
- GtkTableClass parent_class;
-
- /* Notification signals */
- void (* selection_changed) (ECalendarView *cal_view);
- void (* selected_time_changed) (ECalendarView *cal_view);
- void (* timezone_changed) (ECalendarView *cal_view, icaltimezone *old_zone, icaltimezone *new_zone);
- void (* event_changed) (ECalendarView *day_view, ECalendarViewEvent *event);
- void (* event_added) (ECalendarView *day_view, ECalendarViewEvent *event);
-
- /* Virtual methods */
- GList * (* get_selected_events) (ECalendarView *cal_view); /* a GList of ECalendarViewEvent's */
- void (* get_selected_time_range) (ECalendarView *cal_view, time_t *start_time, time_t *end_time);
- void (* set_selected_time_range) (ECalendarView *cal_view, time_t start_time, time_t end_time);
- gboolean (* get_visible_time_range) (ECalendarView *cal_view, time_t *start_time, time_t *end_time);
- void (* update_query) (ECalendarView *cal_view);
-};
-
-GType e_calendar_view_get_type (void);
-
-GnomeCalendar *e_calendar_view_get_calendar (ECalendarView *cal_view);
-void e_calendar_view_set_calendar (ECalendarView *cal_view, GnomeCalendar *calendar);
-ECalModel *e_calendar_view_get_model (ECalendarView *cal_view);
-void e_calendar_view_set_model (ECalendarView *cal_view, ECalModel *model);
-icaltimezone *e_calendar_view_get_timezone (ECalendarView *cal_view);
-void e_calendar_view_set_timezone (ECalendarView *cal_view, icaltimezone *zone);
-const char *e_calendar_view_get_default_category (ECalendarView *cal_view);
-void e_calendar_view_set_default_category (ECalendarView *cal_view, const char *category);
-gboolean e_calendar_view_get_use_24_hour_format (ECalendarView *view);
-void e_calendar_view_set_use_24_hour_format (ECalendarView *view, gboolean use_24_hour);
-
-void e_calendar_view_set_status_message (ECalendarView *cal_view, const gchar *message);
-
-GList *e_calendar_view_get_selected_events (ECalendarView *cal_view);
-void e_calendar_view_get_selected_time_range (ECalendarView *cal_view, time_t *start_time, time_t *end_time);
-void e_calendar_view_set_selected_time_range (ECalendarView *cal_view, time_t start_time, time_t end_time);
-gboolean e_calendar_view_get_visible_time_range (ECalendarView *cal_view, time_t *start_time, time_t *end_time);
-void e_calendar_view_update_query (ECalendarView *cal_view);
-
-void e_calendar_view_cut_clipboard (ECalendarView *cal_view);
-void e_calendar_view_copy_clipboard (ECalendarView *cal_view);
-void e_calendar_view_paste_clipboard (ECalendarView *cal_view);
-void e_calendar_view_delete_selected_event (ECalendarView *cal_view);
-void e_calendar_view_delete_selected_events (ECalendarView *cal_view);
-void e_calendar_view_delete_selected_occurrence (ECalendarView *cal_view);
-
-GtkMenu *e_calendar_view_create_popup_menu (ECalendarView *cal_view);
-
-void e_calendar_view_add_event (ECalendarView *cal_view, ECal *client, time_t dtstart,
- icaltimezone *default_zone, icalcomponent *icalcomp, gboolean in_top_canvas);
-void e_calendar_view_new_appointment_for (ECalendarView *cal_view,
- time_t dtstart,
- time_t dtend,
- gboolean all_day,
- gboolean meeting);
-void e_calendar_view_new_appointment (ECalendarView *cal_view);
-void e_calendar_view_edit_appointment (ECalendarView *cal_view,
- ECal *client,
- icalcomponent *icalcomp,
- gboolean meeting);
-
-G_END_DECLS
-
-#endif
diff --git a/calendar/gui/e-cell-date-edit-config.c b/calendar/gui/e-cell-date-edit-config.c
deleted file mode 100644
index 8993e53d68..0000000000
--- a/calendar/gui/e-cell-date-edit-config.c
+++ /dev/null
@@ -1,339 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Author :
- * JP Rosevear <jpr@ximian.com>
- *
- * Copyright 2003, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#include "calendar-config.h"
-#include "e-mini-calendar-config.h"
-#include "e-cell-date-edit-config.h"
-
-struct _ECellDateEditConfigPrivate {
- ECellDateEdit *cell;
-
- EMiniCalendarConfig *mini_config;
-
- GList *notifications;
-};
-
-static GObjectClass *parent_class = NULL;
-
-/* Property IDs */
-enum props {
- PROP_0,
- PROP_CELL,
-};
-
-static void
-e_cell_date_edit_config_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
-{
- ECellDateEditConfig *view_config;
- ECellDateEditConfigPrivate *priv;
-
- view_config = E_CELL_DATE_EDIT_CONFIG (object);
- priv = view_config->priv;
-
- switch (property_id) {
- case PROP_CELL:
- e_cell_date_edit_config_set_cell (view_config, g_value_get_object (value));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
- break;
- }
-}
-
-static void
-e_cell_date_edit_config_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
-{
- ECellDateEditConfig *view_config;
- ECellDateEditConfigPrivate *priv;
-
- view_config = E_CELL_DATE_EDIT_CONFIG (object);
- priv = view_config->priv;
-
- switch (property_id) {
- case PROP_CELL:
- g_value_set_object (value, e_cell_date_edit_config_get_cell (view_config));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
- break;
- }
-}
-
-static void
-e_cell_date_edit_config_dispose (GObject *object)
-{
- ECellDateEditConfig *view_config = E_CELL_DATE_EDIT_CONFIG (object);
- ECellDateEditConfigPrivate *priv;
-
- priv = view_config->priv;
-
- e_cell_date_edit_config_set_cell (view_config, NULL);
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-static void
-e_cell_date_edit_config_finalize (GObject *object)
-{
- ECellDateEditConfig *view_config = E_CELL_DATE_EDIT_CONFIG (object);
- ECellDateEditConfigPrivate *priv;
-
- priv = view_config->priv;
-
- g_free (priv);
-
- if (G_OBJECT_CLASS (parent_class)->finalize)
- G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-static void
-e_cell_date_edit_config_class_init (ECellDateEditConfigClass *klass)
-{
- GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- GParamSpec *spec;
-
- parent_class = g_type_class_peek_parent (klass);
-
- /* Method override */
- gobject_class->set_property = e_cell_date_edit_config_set_property;
- gobject_class->get_property = e_cell_date_edit_config_get_property;
- gobject_class->dispose = e_cell_date_edit_config_dispose;
- gobject_class->finalize = e_cell_date_edit_config_finalize;
-
- spec = g_param_spec_object ("cell", NULL, NULL, e_cell_date_edit_get_type (),
- G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT);
- g_object_class_install_property (gobject_class, PROP_CELL, spec);
-}
-
-static void
-e_cell_date_edit_config_init (ECellDateEditConfig *view_config, ECellDateEditConfigClass *klass)
-{
- view_config->priv = g_new0 (ECellDateEditConfigPrivate, 1);
-
-}
-
-E_MAKE_TYPE (e_cell_date_edit_config, "ECellDateEditConfig", ECellDateEditConfig, e_cell_date_edit_config_class_init,
- e_cell_date_edit_config_init, G_TYPE_OBJECT);
-
-ECellDateEditConfig *
-e_cell_date_edit_config_new (ECellDateEdit *cell)
-{
- ECellDateEditConfig *view_config;
-
- view_config = g_object_new (e_cell_date_edit_config_get_type (), "cell", cell, NULL);
-
- return view_config;
-}
-
-ECellDateEdit *
-e_cell_date_edit_config_get_cell (ECellDateEditConfig *view_config)
-{
- ECellDateEditConfigPrivate *priv;
-
- g_return_val_if_fail (view_config != NULL, NULL);
- g_return_val_if_fail (E_IS_CELL_DATE_EDIT_CONFIG (view_config), NULL);
-
- priv = view_config->priv;
-
- return priv->cell;
-}
-
-static void
-set_timezone (ECellDateEdit *cell)
-{
- ECellDateEditText *cell_text;
- ECellPopup *cell_popup;
- char *location;
- icaltimezone *zone;
-
- location = calendar_config_get_timezone ();
- zone = icaltimezone_get_builtin_timezone (location);
- if (!zone)
- zone = icaltimezone_get_utc_timezone ();
-
- cell_popup = E_CELL_POPUP (cell);
- cell_text = E_CELL_DATE_EDIT_TEXT (cell_popup->child);
- e_cell_date_edit_text_set_timezone (cell_text, zone);
-
- g_free (location);
-}
-
-static void
-timezone_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
-{
- ECellDateEditConfig *view_config = data;
- ECellDateEditConfigPrivate *priv;
-
- priv = view_config->priv;
-
- set_timezone (priv->cell);
-}
-
-static void
-set_twentyfour_hour (ECellDateEdit *cell)
-{
- ECellDateEditText *cell_text;
- ECellPopup *cell_popup;
- gboolean use_24_hour;
-
- use_24_hour = calendar_config_get_24_hour_format ();
-
- e_cell_date_edit_freeze (cell);
- g_object_set (G_OBJECT (cell),
- "use_24_hour_format", use_24_hour,
- NULL);
- e_cell_date_edit_thaw (cell);
-
- cell_popup = E_CELL_POPUP (cell);
- cell_text = E_CELL_DATE_EDIT_TEXT (cell_popup->child);
- e_cell_date_edit_text_set_use_24_hour_format (cell_text, use_24_hour);
-}
-
-static void
-twentyfour_hour_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
-{
- ECellDateEditConfig *view_config = data;
- ECellDateEditConfigPrivate *priv;
-
- priv = view_config->priv;
-
- set_twentyfour_hour (priv->cell);
-}
-
-static void
-set_range (ECellDateEdit *cell)
-{
- int start_hour, end_hour;
-
- start_hour = calendar_config_get_day_start_hour ();
- end_hour = calendar_config_get_day_end_hour ();
-
- /* Round up the end hour. */
- if (calendar_config_get_day_end_minute () != 0)
- end_hour++;
-
- /* Make sure the start hour is ok */
- if (start_hour > end_hour)
- start_hour = end_hour;
-
- /* We use the default 0 - 24 now. */
-#if 0
- g_object_set (G_OBJECT (cell),
- "lower_hour", start_hour,
- "upper_hour", end_hour,
- NULL);
-#endif
-}
-
-static void
-day_start_hour_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
-{
- ECellDateEditConfig *view_config = data;
- ECellDateEditConfigPrivate *priv;
-
- priv = view_config->priv;
-
- set_range (priv->cell);
-}
-
-static void
-day_end_hour_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
-{
- ECellDateEditConfig *view_config = data;
- ECellDateEditConfigPrivate *priv;
-
- priv = view_config->priv;
-
- set_range (priv->cell);
-}
-
-static void
-day_end_minute_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
-{
- ECellDateEditConfig *view_config = data;
- ECellDateEditConfigPrivate *priv;
-
- priv = view_config->priv;
-
- set_range (priv->cell);
-}
-
-void
-e_cell_date_edit_config_set_cell (ECellDateEditConfig *view_config, ECellDateEdit *cell)
-{
- ECellDateEditConfigPrivate *priv;
- guint not;
- GList *l;
-
- g_return_if_fail (view_config != NULL);
- g_return_if_fail (E_IS_CELL_DATE_EDIT_CONFIG (view_config));
-
- priv = view_config->priv;
-
- if (priv->cell) {
- g_object_unref (priv->cell);
- priv->cell = NULL;
- }
-
- if (priv->mini_config) {
- g_object_unref (priv->mini_config);
- priv->mini_config = NULL;
- }
-
- for (l = priv->notifications; l; l = l->next)
- calendar_config_remove_notification (GPOINTER_TO_UINT (l->data));
-
- g_list_free (priv->notifications);
- priv->notifications = NULL;
-
- /* If the new view is NULL, return right now */
- if (!cell)
- return;
-
- priv->cell = g_object_ref (cell);
-
- /* Time zone */
- set_timezone (cell);
-
- not = calendar_config_add_notification_timezone (timezone_changed_cb, view_config);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
-
- /* 24 Hour format */
- set_twentyfour_hour (cell);
-
- not = calendar_config_add_notification_24_hour_format (twentyfour_hour_changed_cb, view_config);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
-
- /* Popup time range */
- set_range (cell);
-
- not = calendar_config_add_notification_day_start_hour (day_start_hour_changed_cb, view_config);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
- not = calendar_config_add_notification_day_end_hour (day_end_hour_changed_cb, view_config);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
- not = calendar_config_add_notification_day_end_minute (day_end_minute_changed_cb, view_config);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
-
- /* The mini calendar */
- priv->mini_config = e_mini_calendar_config_new (E_CALENDAR (cell->calendar));
-}
diff --git a/calendar/gui/e-cell-date-edit-config.h b/calendar/gui/e-cell-date-edit-config.h
deleted file mode 100644
index fad1d9e508..0000000000
--- a/calendar/gui/e-cell-date-edit-config.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Author :
- * JP Rosevear <jpr@ximian.com>
- *
- * Copyright 2003, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifndef _E_CELL_DATE_EDIT_CONFIG_H_
-#define _E_CELL_DATE_EDIT_CONFIG_H_
-
-#include <widgets/misc/e-cell-date-edit.h>
-
-G_BEGIN_DECLS
-
-#define E_CELL_DATE_EDIT_CONFIG(obj) GTK_CHECK_CAST (obj, e_cell_date_edit_config_get_type (), ECellDateEditConfig)
-#define E_CELL_DATE_EDIT_CONFIG_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, e_cell_date_edit_config_get_type (), ECellDateEditConfigClass)
-#define E_IS_CELL_DATE_EDIT_CONFIG(obj) GTK_CHECK_TYPE (obj, e_cell_date_edit_config_get_type ())
-
-typedef struct _ECellDateEditConfig ECellDateEditConfig;
-typedef struct _ECellDateEditConfigClass ECellDateEditConfigClass;
-typedef struct _ECellDateEditConfigPrivate ECellDateEditConfigPrivate;
-
-struct _ECellDateEditConfig {
- GObject parent;
-
- ECellDateEditConfigPrivate *priv;
-};
-
-struct _ECellDateEditConfigClass {
- GObjectClass parent_class;
-};
-
-GType e_cell_date_edit_config_get_type (void);
-ECellDateEditConfig *e_cell_date_edit_config_new (ECellDateEdit *cell);
-ECellDateEdit *e_cell_date_edit_config_get_cell (ECellDateEditConfig *cell_config);
-void e_cell_date_edit_config_set_cell (ECellDateEditConfig *view_config, ECellDateEdit *cell);
-
-G_END_DECLS
-
-#endif
diff --git a/calendar/gui/e-cell-date-edit-text.c b/calendar/gui/e-cell-date-edit-text.c
deleted file mode 100644
index d487a78ae4..0000000000
--- a/calendar/gui/e-cell-date-edit-text.c
+++ /dev/null
@@ -1,234 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Author :
- * Damon Chaplin <damon@ximian.com>
- *
- * Copyright 2001, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-/*
- * ECellDateEditText - a subclass of ECellText used to show and edit the text
- * representation of the date, from a ECalComponentDateTime* model value.
- */
-
-#include <config.h>
-
-#include <sys/time.h>
-#include <time.h>
-#include <unistd.h>
-#include <string.h>
-#include <libgnomeui/gnome-messagebox.h>
-#include <libgnomeui/gnome-stock-icons.h>
-#include <libgnome/gnome-i18n.h>
-#include <gal/util/e-util.h>
-#include <e-util/e-time-utils.h>
-#include <libecal/e-cal-time-util.h>
-
-#include "e-cell-date-edit-text.h"
-
-
-#define PARENT_TYPE e_cell_text_get_type ()
-
-static ECellTextClass *parent_class;
-
-
-void
-e_cell_date_edit_text_set_timezone (ECellDateEditText *ecd,
- icaltimezone *zone)
-{
- g_return_if_fail (E_IS_CELL_DATE_EDIT_TEXT (ecd));
-
- ecd->zone = zone;
-}
-
-
-void
-e_cell_date_edit_text_set_use_24_hour_format (ECellDateEditText *ecd,
- gboolean use_24_hour)
-{
- g_return_if_fail (E_IS_CELL_DATE_EDIT_TEXT (ecd));
-
- ecd->use_24_hour_format = use_24_hour;
-}
-
-
-static char *
-ecd_get_text (ECellText *cell, ETableModel *model, int col, int row)
-{
- ECellDateEditText *ecd = E_CELL_DATE_EDIT_TEXT (cell);
- ECellDateEditValue *dv = e_table_model_value_at (model, col, row);
- struct tm tmp_tm;
- char buffer[64];
-
- if (!dv)
- return g_strdup ("");
-
- /* Note that although the property may be in a different
- timezone, we convert it to the current timezone to display
- it in the table. If the user actually edits the value,
- it will be set to the current timezone. See set_value(). */
- tmp_tm = icaltimetype_to_tm_with_zone (&dv->tt, dv->zone, ecd->zone);
-
- e_time_format_date_and_time (&tmp_tm, ecd->use_24_hour_format,
- !dv->tt.is_date, FALSE,
- buffer, sizeof (buffer));
- return g_strdup (buffer);
-}
-
-
-static void
-ecd_free_text (ECellText *cell, char *text)
-{
- g_free (text);
-}
-
-
-/* FIXME: We need to set the "transient_for" property for the dialog. */
-static void
-show_date_warning (ECellDateEditText *ecd)
-{
- GtkWidget *dialog;
- char buffer[64], message[256], *format;
- time_t t;
- struct tm *tmp_tm;
-
- t = time (NULL);
- /* We are only using this as an example, so the timezone doesn't
- matter. */
- tmp_tm = localtime (&t);
-
- if (ecd->use_24_hour_format)
- /* strftime format of a weekday, a date and a time, 24-hour. */
- format = _("%a %m/%d/%Y %H:%M:%S");
- else
- /* strftime format of a weekday, a date and a time, 12-hour. */
- format = _("%a %m/%d/%Y %I:%M:%S %p");
-
- e_utf8_strftime (buffer, sizeof (buffer), format, tmp_tm);
-
- g_snprintf (message, 256,
- _("The date must be entered in the format: \n\n%s"),
- buffer);
-
- dialog = gnome_message_box_new (message,
- GNOME_MESSAGE_BOX_ERROR,
- GNOME_STOCK_BUTTON_OK, NULL);
- gtk_widget_show (dialog);
-}
-
-
-static void
-ecd_set_value (ECellText *cell, ETableModel *model, int col, int row,
- const char *text)
-{
- ECellDateEditText *ecd = E_CELL_DATE_EDIT_TEXT (cell);
- ETimeParseStatus status;
- struct tm tmp_tm;
- ECellDateEditValue *value;
- gboolean is_date = TRUE;
-
- /* Try to parse just a date first. If the value is only a date, we
- use a DATE value. */
- status = e_time_parse_date (text, &tmp_tm);
- if (status == E_TIME_PARSE_INVALID) {
- is_date = FALSE;
- status = e_time_parse_date_and_time (text, &tmp_tm);
-
- if (status == E_TIME_PARSE_INVALID) {
- show_date_warning (ecd);
- return;
- }
- }
-
- if (status == E_TIME_PARSE_NONE) {
- value = NULL;
- } else {
- ECellDateEditValue dv;
-
- dv.tt = icaltime_null_time ();
-
- dv.tt.year = tmp_tm.tm_year + 1900;
- dv.tt.month = tmp_tm.tm_mon + 1;
- dv.tt.day = tmp_tm.tm_mday;
- dv.tt.hour = tmp_tm.tm_hour;
- dv.tt.minute = tmp_tm.tm_min;
- dv.tt.second = tmp_tm.tm_sec;
- dv.tt.is_date = is_date;
-
- /* FIXME: We assume it is being set to the current timezone.
- Is that OK? */
- if (is_date) {
- dv.zone = NULL;
- } else {
- dv.zone = ecd->zone;
- }
-
- value = &dv;
- }
-
- e_table_model_set_value_at (model, col, row, value);
-}
-
-
-static void
-e_cell_date_edit_text_class_init (GtkObjectClass *object_class)
-{
- ECellTextClass *ectc = (ECellTextClass *) object_class;
-
- parent_class = gtk_type_class (PARENT_TYPE);
-
- ectc->get_text = ecd_get_text;
- ectc->free_text = ecd_free_text;
- ectc->set_value = ecd_set_value;
-}
-
-
-static void
-e_cell_date_edit_text_init (GtkObject *object)
-{
- ECellDateEditText *ecd = E_CELL_DATE_EDIT_TEXT (object);
-
- ecd->zone = icaltimezone_get_utc_timezone ();
- ecd->use_24_hour_format = TRUE;
-}
-
-
-/**
- * e_cell_date_edit_text_new:
- *
- * Creates a new ECell renderer that can be used to render and edit dates that
- * that come from the model. The value returned from the model is
- * interpreted as being a ECalComponentDateTime*.
- *
- * Returns: an ECell object that can be used to render dates.
- */
-ECell *
-e_cell_date_edit_text_new (const char *fontname,
- GtkJustification justify)
-{
- ECellDateEditText *ecd = g_object_new (e_cell_date_edit_text_get_type (), NULL);
-
- e_cell_text_construct (E_CELL_TEXT (ecd), fontname, justify);
-
- return (ECell *) ecd;
-}
-
-
-E_MAKE_TYPE (e_cell_date_edit_text, "ECellDateEditText", ECellDateEditText,
- e_cell_date_edit_text_class_init, e_cell_date_edit_text_init,
- PARENT_TYPE);
diff --git a/calendar/gui/e-cell-date-edit-text.h b/calendar/gui/e-cell-date-edit-text.h
deleted file mode 100644
index ab00c0b39c..0000000000
--- a/calendar/gui/e-cell-date-edit-text.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Author :
- * Damon Chaplin <damon@ximian.com>
- *
- * Copyright 2001, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-/*
- * ECellDateEditText - a subclass of ECellText used to show and edit the text
- * representation of the date, from a ECalComponentDateTime* model value.
- */
-
-#ifndef _E_CELL_DATE_EDIT_TEXT_H_
-#define _E_CELL_DATE_EDIT_TEXT_H_
-
-#include <libical/ical.h>
-#include <gal/e-table/e-cell-text.h>
-
-G_BEGIN_DECLS
-
-#define E_CELL_DATE_EDIT_TEXT_TYPE (e_cell_date_edit_text_get_type ())
-#define E_CELL_DATE_EDIT_TEXT(o) (GTK_CHECK_CAST ((o), E_CELL_DATE_EDIT_TEXT_TYPE, ECellDateEditText))
-#define E_CELL_DATE_EDIT_TEXT_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_CELL_DATE_EDIT_TEXT_TYPE, ECellDateEditTextClass))
-#define E_IS_CELL_DATE_EDIT_TEXT(o) (GTK_CHECK_TYPE ((o), E_CELL_DATE_EDIT_TEXT_TYPE))
-#define E_IS_CELL_DATE_EDIT_TEXT_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_CELL_DATE_EDIT_TEXT_TYPE))
-
-typedef struct _ECellDateEditValue ECellDateEditValue;
-struct _ECellDateEditValue {
- struct icaltimetype tt;
- icaltimezone *zone;
-};
-
-typedef struct {
- ECellText base;
-
- /* The timezone to display the date in. */
- icaltimezone *zone;
-
- /* Whether to display in 24-hour format. */
- gboolean use_24_hour_format;
-} ECellDateEditText;
-
-typedef struct {
- ECellTextClass parent_class;
-} ECellDateEditTextClass;
-
-GtkType e_cell_date_edit_text_get_type (void);
-ECell *e_cell_date_edit_text_new (const char *fontname,
- GtkJustification justify);
-
-
-void e_cell_date_edit_text_set_timezone (ECellDateEditText *ecd,
- icaltimezone *zone);
-void e_cell_date_edit_text_set_use_24_hour_format (ECellDateEditText *ecd,
- gboolean use_24_hour);
-G_END_DECLS
-
-#endif /* _E_CELL_DATE_EDIT_TEXT_H_ */
diff --git a/calendar/gui/e-comp-editor-registry.c b/calendar/gui/e-comp-editor-registry.c
deleted file mode 100644
index 9e2a63bd48..0000000000
--- a/calendar/gui/e-comp-editor-registry.c
+++ /dev/null
@@ -1,212 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* e-comp-editor-registry.c
- *
- * Copyright (C) 2002 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: JP Rosevear
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <gnome.h>
-#include <gal/util/e-util.h>
-#include "e-comp-editor-registry.h"
-
-struct _ECompEditorRegistryPrivate {
- GHashTable *editors;
-};
-
-struct _ECompEditorRegistryData
-{
- CompEditor *editor;
- char *uid;
-};
-
-typedef struct _ECompEditorRegistryData ECompEditorRegistryData;
-typedef struct _ECompEditorRegistryForeachData ECompEditorRegistryForeachData;
-
-static GtkObjectClass *parent_class = NULL;
-
-static void editor_destroy_cb (GtkWidget *widget, gpointer data);
-
-static void
-destroy (GtkObject *obj)
-{
- ECompEditorRegistry *reg;
- ECompEditorRegistryPrivate *priv;
-
- reg = E_COMP_EDITOR_REGISTRY (obj);
- priv = reg->priv;
-
- if (priv) {
- if (priv->editors) {
- g_hash_table_destroy (priv->editors);
- priv->editors = NULL;
- }
-
- g_free (priv);
- reg->priv = NULL;
- }
-
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (obj);
-}
-
-static void
-class_init (ECompEditorRegistryClass *klass)
-{
- GtkObjectClass *object_class;
-
- object_class = GTK_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_peek_parent (klass);
-
- object_class->destroy = destroy;
-}
-
-static void
-init (ECompEditorRegistry *reg)
-{
- ECompEditorRegistryPrivate *priv;
-
- priv = g_new0 (ECompEditorRegistryPrivate, 1);
-
- reg->priv = priv;
-
- priv->editors = g_hash_table_new (g_str_hash, g_str_equal);
-}
-
-
-
-E_MAKE_TYPE (e_comp_editor_registry, "ECompEditorRegistry", ECompEditorRegistry,
- class_init, init, gtk_object_get_type ());
-
-GtkObject *
-e_comp_editor_registry_new (void)
-{
- return g_object_new (E_TYPE_COMP_EDITOR_REGISTRY, NULL);
-}
-
-void
-e_comp_editor_registry_add (ECompEditorRegistry *reg, CompEditor *editor, gboolean remote)
-{
- ECompEditorRegistryPrivate *priv;
- ECompEditorRegistryData *rdata;
- ECalComponent *comp;
- const char *uid;
-
- g_return_if_fail (reg != NULL);
- g_return_if_fail (E_IS_COMP_EDITOR_REGISTRY (reg));
- g_return_if_fail (editor != NULL);
- g_return_if_fail (IS_COMP_EDITOR (editor));
-
- priv = reg->priv;
-
- comp = comp_editor_get_comp (editor);
- e_cal_component_get_uid (comp, &uid);
-
- rdata = g_new0 (ECompEditorRegistryData, 1);
-
- rdata->editor = editor;
- rdata->uid = g_strdup (uid);
- g_hash_table_insert (priv->editors, rdata->uid, rdata);
-
- g_signal_connect (editor, "destroy", G_CALLBACK (editor_destroy_cb), reg);
-
-}
-
-CompEditor *
-e_comp_editor_registry_find (ECompEditorRegistry *reg, const char *uid)
-{
- ECompEditorRegistryPrivate *priv;
- ECompEditorRegistryData *rdata;
-
- g_return_val_if_fail (reg != NULL, NULL);
- g_return_val_if_fail (E_IS_COMP_EDITOR_REGISTRY (reg), NULL);
- g_return_val_if_fail (uid != NULL, NULL);
-
- priv = reg->priv;
-
- rdata = g_hash_table_lookup (priv->editors, uid);
- if (rdata != NULL)
- return rdata->editor;
-
- return NULL;
-}
-
-static gboolean
-foreach_close_cb (gpointer key, gpointer value, gpointer data)
-{
- ECompEditorRegistryData *rdata;
-
- rdata = value;
-
- g_signal_handlers_block_matched (rdata->editor, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, data);
-
- comp_editor_focus (rdata->editor);
- if (!comp_editor_close (rdata->editor)) {
- g_signal_handlers_unblock_matched (rdata->editor, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, data);
- return FALSE;
- }
-
- g_free (rdata->uid);
- g_free (rdata);
-
- return TRUE;
-}
-
-gboolean
-e_comp_editor_registry_close_all (ECompEditorRegistry *reg)
-{
- ECompEditorRegistryPrivate *priv;
-
- g_return_val_if_fail (reg != NULL, FALSE);
- g_return_val_if_fail (E_IS_COMP_EDITOR_REGISTRY (reg), FALSE);
-
- priv = reg->priv;
-
- g_hash_table_foreach_remove (priv->editors, foreach_close_cb, reg);
- if (g_hash_table_size (priv->editors) != 0)
- return FALSE;
-
- return TRUE;
-}
-
-static void
-editor_destroy_cb (GtkWidget *widget, gpointer data)
-{
- ECompEditorRegistry *reg;
- ECompEditorRegistryPrivate *priv;
- ECompEditorRegistryData *rdata;
- ECalComponent *comp;
- const char *uid;
-
- reg = E_COMP_EDITOR_REGISTRY (data);
- priv = reg->priv;
-
- comp = comp_editor_get_comp (COMP_EDITOR (widget));
- e_cal_component_get_uid (comp, &uid);
-
- rdata = g_hash_table_lookup (priv->editors, uid);
-
- if (rdata != NULL) {
- g_hash_table_remove (priv->editors, rdata->uid);
- g_free (rdata->uid);
- g_free (rdata);
- }
-}
diff --git a/calendar/gui/e-comp-editor-registry.h b/calendar/gui/e-comp-editor-registry.h
deleted file mode 100644
index dfcc1b21bc..0000000000
--- a/calendar/gui/e-comp-editor-registry.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* e-comp-editor-registry.h
- *
- * Copyright (C) 2002 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: JP Rosevear
- */
-
-#ifndef _E_COMP_EDITOR_REGISTRY_H_
-#define _E_COMP_EDITOR_REGISTRY_H_
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <gtk/gtk.h>
-#include <dialogs/comp-editor.h>
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#define E_TYPE_COMP_EDITOR_REGISTRY (e_comp_editor_registry_get_type ())
-#define E_COMP_EDITOR_REGISTRY(obj) (GTK_CHECK_CAST ((obj), E_TYPE_COMP_EDITOR_REGISTRY, ECompEditorRegistry))
-#define E_COMP_EDITOR_REGISTRY_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_TYPE_COMP_EDITOR_REGISTRY, ECompEditorRegistryClass))
-#define E_IS_COMP_EDITOR_REGISTRY(obj) (GTK_CHECK_TYPE ((obj), E_TYPE_COMP_EDITOR_REGISTRY))
-#define E_IS_COMP_EDITOR_REGISTRY_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_TYPE_COMP_EDITOR_REGISTRY))
-
-
-typedef struct _ECompEditorRegistry ECompEditorRegistry;
-typedef struct _ECompEditorRegistryPrivate ECompEditorRegistryPrivate;
-typedef struct _ECompEditorRegistryClass ECompEditorRegistryClass;
-
-struct _ECompEditorRegistry {
- GtkObject parent;
-
- ECompEditorRegistryPrivate *priv;
-};
-
-struct _ECompEditorRegistryClass {
- GtkObjectClass parent_class;
-};
-
-typedef void (* ECompEditorRegistryForeachFn) (CompEditor *editor, gpointer data);
-
-
-
-
-GtkType e_comp_editor_registry_get_type (void);
-GtkObject *e_comp_editor_registry_new (void);
-void e_comp_editor_registry_add (ECompEditorRegistry *reg,
- CompEditor *editor,
- gboolean remote);
-CompEditor *e_comp_editor_registry_find (ECompEditorRegistry *reg,
- const char *uid);
-gboolean e_comp_editor_registry_close_all (ECompEditorRegistry *reg);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _E_COMP_EDITOR_REGISTRY_H_ */
-
-
diff --git a/calendar/gui/e-date-edit-config.c b/calendar/gui/e-date-edit-config.c
deleted file mode 100644
index f3d88fdd53..0000000000
--- a/calendar/gui/e-date-edit-config.c
+++ /dev/null
@@ -1,269 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Author :
- * JP Rosevear <jpr@ximian.com>
- *
- * Copyright 2003, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#include "calendar-config.h"
-#include "e-date-edit-config.h"
-
-struct _EDateEditConfigPrivate {
- EDateEdit *edit;
-
- GList *notifications;
-};
-
-static GObjectClass *parent_class = NULL;
-
-/* Property IDs */
-enum props {
- PROP_0,
- PROP_EDIT,
-};
-
-static void
-e_date_edit_config_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
-{
- EDateEditConfig *edit_config;
- EDateEditConfigPrivate *priv;
-
- edit_config = E_DATE_EDIT_CONFIG (object);
- priv = edit_config->priv;
-
- switch (property_id) {
- case PROP_EDIT:
- e_date_edit_config_set_edit (edit_config, g_value_get_object (value));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
- break;
- }
-}
-
-static void
-e_date_edit_config_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
-{
- EDateEditConfig *edit_config;
- EDateEditConfigPrivate *priv;
-
- edit_config = E_DATE_EDIT_CONFIG (object);
- priv = edit_config->priv;
-
- switch (property_id) {
- case PROP_EDIT:
- g_value_set_object (value, e_date_edit_config_get_edit (edit_config));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
- break;
- }
-}
-
-static void
-e_date_edit_config_dispose (GObject *object)
-{
- EDateEditConfig *edit_config = E_DATE_EDIT_CONFIG (object);
- EDateEditConfigPrivate *priv;
-
- priv = edit_config->priv;
-
- e_date_edit_config_set_edit (edit_config, NULL);
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-static void
-e_date_edit_config_finalize (GObject *object)
-{
- EDateEditConfig *edit_config = E_DATE_EDIT_CONFIG (object);
- EDateEditConfigPrivate *priv;
-
- priv = edit_config->priv;
-
- g_free (priv);
-
- if (G_OBJECT_CLASS (parent_class)->finalize)
- G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-static void
-e_date_edit_config_class_init (EDateEditConfigClass *klass)
-{
- GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- GParamSpec *spec;
-
- parent_class = g_type_class_peek_parent (klass);
-
- /* Method override */
- gobject_class->set_property = e_date_edit_config_set_property;
- gobject_class->get_property = e_date_edit_config_get_property;
- gobject_class->dispose = e_date_edit_config_dispose;
- gobject_class->finalize = e_date_edit_config_finalize;
-
- spec = g_param_spec_object ("edit", NULL, NULL, e_date_edit_get_type (),
- G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT);
- g_object_class_install_property (gobject_class, PROP_EDIT, spec);
-}
-
-static void
-e_date_edit_config_init (EDateEditConfig *edit_config, EDateEditConfigClass *klass)
-{
- edit_config->priv = g_new0 (EDateEditConfigPrivate, 1);
-
-}
-
-E_MAKE_TYPE (e_date_edit_config, "EDateEditConfig", EDateEditConfig, e_date_edit_config_class_init,
- e_date_edit_config_init, G_TYPE_OBJECT);
-
-EDateEditConfig *
-e_date_edit_config_new (EDateEdit *date_edit)
-{
- EDateEditConfig *edit_config;
-
- edit_config = g_object_new (e_date_edit_config_get_type (), "edit", date_edit, NULL);
-
- return edit_config;
-}
-
-EDateEdit *
-e_date_edit_config_get_edit (EDateEditConfig *edit_config)
-{
- EDateEditConfigPrivate *priv;
-
- g_return_val_if_fail (edit_config != NULL, NULL);
- g_return_val_if_fail (E_IS_DATE_EDIT_CONFIG (edit_config), NULL);
-
- priv = edit_config->priv;
-
- return priv->edit;
-}
-
-static void
-set_week_start (EDateEdit *date_edit)
-{
- int week_start_day;
-
- week_start_day = calendar_config_get_week_start_day ();
-
- /* Convert it to 0 (Mon) to 6 (Sun), which is what we use. */
- week_start_day = (week_start_day + 6) % 7;
-
- e_date_edit_set_week_start_day (date_edit, week_start_day);
-}
-
-static void
-week_start_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
-{
- EDateEditConfig *edit_config = data;
- EDateEditConfigPrivate *priv;
-
- priv = edit_config->priv;
-
- set_week_start (priv->edit);
-}
-
-static void
-set_twentyfour_hour (EDateEdit *date_edit)
-{
- gboolean use_24_hour;
-
- use_24_hour = calendar_config_get_24_hour_format ();
-
- e_date_edit_set_use_24_hour_format (date_edit, use_24_hour);
-}
-
-static void
-twentyfour_hour_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
-{
- EDateEditConfig *edit_config = data;
- EDateEditConfigPrivate *priv;
-
- priv = edit_config->priv;
-
- set_twentyfour_hour (priv->edit);
-}
-
-static void
-set_dnav_show_week_no (EDateEdit *date_edit)
-{
- gboolean show_week_no;
-
- show_week_no = calendar_config_get_dnav_show_week_no ();
-
- e_date_edit_set_show_week_numbers (date_edit, show_week_no);
-}
-
-static void
-dnav_show_week_no_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
-{
- EDateEditConfig *edit_config = data;
- EDateEditConfigPrivate *priv;
-
- priv = edit_config->priv;
-
- set_dnav_show_week_no (priv->edit);
-}
-void
-e_date_edit_config_set_edit (EDateEditConfig *edit_config, EDateEdit *date_edit)
-{
- EDateEditConfigPrivate *priv;
- guint not;
- GList *l;
-
- g_return_if_fail (edit_config != NULL);
- g_return_if_fail (E_IS_DATE_EDIT_CONFIG (edit_config));
-
- priv = edit_config->priv;
-
- if (priv->edit) {
- g_object_unref (priv->edit);
- priv->edit = NULL;
- }
-
- for (l = priv->notifications; l; l = l->next)
- calendar_config_remove_notification (GPOINTER_TO_UINT (l->data));
-
- g_list_free (priv->notifications);
- priv->notifications = NULL;
-
- /* If the new edit is NULL, return right now */
- if (!date_edit)
- return;
-
- priv->edit = g_object_ref (date_edit);
-
- /* Week start */
- set_week_start (date_edit);
-
- not = calendar_config_add_notification_week_start_day (week_start_changed_cb, edit_config);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
-
- /* 24 Hour format */
- set_twentyfour_hour (date_edit);
-
- not = calendar_config_add_notification_24_hour_format (twentyfour_hour_changed_cb, edit_config);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
-
- /* Show week numbers */
- set_dnav_show_week_no (date_edit);
-
- not = calendar_config_add_notification_dnav_show_week_no (dnav_show_week_no_changed_cb, edit_config);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
-}
diff --git a/calendar/gui/e-date-edit-config.h b/calendar/gui/e-date-edit-config.h
deleted file mode 100644
index 0707666bff..0000000000
--- a/calendar/gui/e-date-edit-config.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Author :
- * JP Rosevear <jpr@ximian.com>
- *
- * Copyright 2003, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifndef _E_DATE_EDIT_CONFIG_H_
-#define _E_DATE_EDIT_CONFIG_H_
-
-#include <widgets/misc/e-dateedit.h>
-
-G_BEGIN_DECLS
-
-#define E_DATE_EDIT_CONFIG(obj) GTK_CHECK_CAST (obj, e_date_edit_config_get_type (), EDateEditConfig)
-#define E_DATE_EDIT_CONFIG_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, e_date_edit_config_get_type (), EDateEditConfigClass)
-#define E_IS_DATE_EDIT_CONFIG(obj) GTK_CHECK_TYPE (obj, e_date_edit_config_get_type ())
-
-typedef struct _EDateEditConfig EDateEditConfig;
-typedef struct _EDateEditConfigClass EDateEditConfigClass;
-typedef struct _EDateEditConfigPrivate EDateEditConfigPrivate;
-
-struct _EDateEditConfig {
- GObject parent;
-
- EDateEditConfigPrivate *priv;
-};
-
-struct _EDateEditConfigClass {
- GObjectClass parent_class;
-};
-
-GType e_date_edit_config_get_type (void);
-EDateEditConfig *e_date_edit_config_new (EDateEdit *date_edit);
-EDateEdit *e_date_edit_config_get_edit (EDateEditConfig *edit_config);
-void e_date_edit_config_set_edit (EDateEditConfig *edit_config, EDateEdit *date_edit);
-
-G_END_DECLS
-
-#endif
diff --git a/calendar/gui/e-date-time-list.c b/calendar/gui/e-date-time-list.c
deleted file mode 100644
index 348ccc86a9..0000000000
--- a/calendar/gui/e-date-time-list.c
+++ /dev/null
@@ -1,566 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/* EDateTimeList - list of calendar dates/times with GtkTreeModel interface.
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- *
- * Authors: Hans Petter Jansson <hpj@ximian.com>
- */
-
-#include <string.h>
-#include <gtk/gtktreemodel.h>
-#include <gtk/gtksignal.h>
-#include <gtk/gtktreednd.h>
-#include <glib.h>
-#include <e-util/e-time-utils.h>
-#include "e-date-time-list.h"
-#include <libecal/e-cal-time-util.h>
-#include "calendar-config.h"
-
-#define G_LIST(x) ((GList *) x)
-#define E_DATE_TIME_LIST_IS_SORTED(list) (E_DATE_TIME_LIST (list)->sort_column_id != -2)
-#define IS_VALID_ITER(dt_list, iter) (iter!= NULL && iter->user_data != NULL && \
- dt_list->stamp == iter->stamp)
-
-static GType column_types [E_DATE_TIME_LIST_NUM_COLUMNS];
-
-static void e_date_time_list_init (EDateTimeList *file_list);
-static void e_date_time_list_class_init (EDateTimeListClass *class);
-static void e_date_time_list_tree_model_init (GtkTreeModelIface *iface);
-static void e_date_time_list_finalize (GObject *object);
-static guint e_date_time_list_get_flags (GtkTreeModel *tree_model);
-static gint e_date_time_list_get_n_columns (GtkTreeModel *tree_model);
-static GType e_date_time_list_get_column_type (GtkTreeModel *tree_model,
- gint index);
-static gboolean e_date_time_list_get_iter (GtkTreeModel *tree_model,
- GtkTreeIter *iter,
- GtkTreePath *path);
-static GtkTreePath *e_date_time_list_get_path (GtkTreeModel *tree_model,
- GtkTreeIter *iter);
-static void e_date_time_list_get_value (GtkTreeModel *tree_model,
- GtkTreeIter *iter,
- gint column,
- GValue *value);
-static gboolean e_date_time_list_iter_next (GtkTreeModel *tree_model,
- GtkTreeIter *iter);
-static gboolean e_date_time_list_iter_children (GtkTreeModel *tree_model,
- GtkTreeIter *iter,
- GtkTreeIter *parent);
-static gboolean e_date_time_list_iter_has_child (GtkTreeModel *tree_model,
- GtkTreeIter *iter);
-static gint e_date_time_list_iter_n_children (GtkTreeModel *tree_model,
- GtkTreeIter *iter);
-static gboolean e_date_time_list_iter_nth_child (GtkTreeModel *tree_model,
- GtkTreeIter *iter,
- GtkTreeIter *parent,
- gint n);
-static gboolean e_date_time_list_iter_parent (GtkTreeModel *tree_model,
- GtkTreeIter *iter,
- GtkTreeIter *child);
-
-static GObjectClass *parent_class = NULL;
-
-GtkType
-e_date_time_list_get_type (void)
-{
- static GType date_time_list_type = 0;
-
- if (!date_time_list_type) {
- static const GTypeInfo date_time_list_info =
- {
- sizeof (EDateTimeListClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_date_time_list_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EDateTimeList),
- 0,
- (GInstanceInitFunc) e_date_time_list_init,
- };
-
- static const GInterfaceInfo tree_model_info =
- {
- (GInterfaceInitFunc) e_date_time_list_tree_model_init,
- NULL,
- NULL
- };
-
- column_types [E_DATE_TIME_LIST_COLUMN_DESCRIPTION] = G_TYPE_STRING;
-
- date_time_list_type = g_type_register_static (G_TYPE_OBJECT, "EDateTimeList",
- &date_time_list_info, 0);
- g_type_add_interface_static (date_time_list_type,
- GTK_TYPE_TREE_MODEL,
- &tree_model_info);
- }
-
- return date_time_list_type;
-}
-
-static void
-e_date_time_list_class_init (EDateTimeListClass *class)
-{
- GObjectClass *object_class;
-
- parent_class = g_type_class_peek_parent (class);
- object_class = (GObjectClass*) class;
-
- object_class->finalize = e_date_time_list_finalize;
-}
-
-static void
-e_date_time_list_tree_model_init (GtkTreeModelIface *iface)
-{
- iface->get_flags = e_date_time_list_get_flags;
- iface->get_n_columns = e_date_time_list_get_n_columns;
- iface->get_column_type = e_date_time_list_get_column_type;
- iface->get_iter = e_date_time_list_get_iter;
- iface->get_path = e_date_time_list_get_path;
- iface->get_value = e_date_time_list_get_value;
- iface->iter_next = e_date_time_list_iter_next;
- iface->iter_children = e_date_time_list_iter_children;
- iface->iter_has_child = e_date_time_list_iter_has_child;
- iface->iter_n_children = e_date_time_list_iter_n_children;
- iface->iter_nth_child = e_date_time_list_iter_nth_child;
- iface->iter_parent = e_date_time_list_iter_parent;
-}
-
-static void
-e_date_time_list_init (EDateTimeList *date_time_list)
-{
- date_time_list->stamp = g_random_int ();
- date_time_list->columns_dirty = FALSE;
- date_time_list->list = NULL;
-}
-
-EDateTimeList *
-e_date_time_list_new (void)
-{
- EDateTimeList *date_time_list;
-
- date_time_list = E_DATE_TIME_LIST (g_object_new (e_date_time_list_get_type (), NULL));
-
- return date_time_list;
-}
-
-static void
-all_rows_deleted (EDateTimeList *date_time_list)
-{
- GtkTreePath *path;
- gint i;
-
- if (!date_time_list->list)
- return;
-
- path = gtk_tree_path_new ();
- i = g_list_length (date_time_list->list);
- gtk_tree_path_append_index (path, i);
-
- for ( ; i >= 0; i--) {
- gtk_tree_model_row_deleted (GTK_TREE_MODEL (date_time_list), path);
- gtk_tree_path_prev (path);
- }
-
- gtk_tree_path_free (path);
-}
-
-static void
-row_deleted (EDateTimeList *date_time_list, gint n)
-{
- GtkTreePath *path;
-
- path = gtk_tree_path_new ();
- gtk_tree_path_append_index (path, n);
- gtk_tree_model_row_deleted (GTK_TREE_MODEL (date_time_list), path);
- gtk_tree_path_free (path);
-}
-
-static void
-row_added (EDateTimeList *date_time_list, gint n)
-{
- GtkTreePath *path;
- GtkTreeIter iter;
-
- path = gtk_tree_path_new ();
- gtk_tree_path_append_index (path, n);
-
- if (gtk_tree_model_get_iter (GTK_TREE_MODEL (date_time_list), &iter, path))
- gtk_tree_model_row_inserted (GTK_TREE_MODEL (date_time_list), path, &iter);
-
- gtk_tree_path_free (path);
-}
-
-static void
-row_updated (EDateTimeList *date_time_list, gint n)
-{
- GtkTreePath *path;
- GtkTreeIter iter;
-
- path = gtk_tree_path_new ();
- gtk_tree_path_append_index (path, n);
-
- if (gtk_tree_model_get_iter (GTK_TREE_MODEL (date_time_list), &iter, path))
- gtk_tree_model_row_changed (GTK_TREE_MODEL (date_time_list), path, &iter);
-
- gtk_tree_path_free (path);
-}
-
-static void
-e_date_time_list_finalize (GObject *object)
-{
- EDateTimeList *date_time_list = E_DATE_TIME_LIST (object);
-
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
-}
-
-/* Fulfill the GtkTreeModel requirements */
-static guint
-e_date_time_list_get_flags (GtkTreeModel *tree_model)
-{
- g_return_val_if_fail (E_IS_DATE_TIME_LIST (tree_model), 0);
-
- return GTK_TREE_MODEL_LIST_ONLY;
-}
-
-static gint
-e_date_time_list_get_n_columns (GtkTreeModel *tree_model)
-{
- EDateTimeList *date_time_list = (EDateTimeList *) tree_model;
-
- g_return_val_if_fail (E_IS_DATE_TIME_LIST (tree_model), 0);
-
- date_time_list->columns_dirty = TRUE;
- return E_DATE_TIME_LIST_NUM_COLUMNS;
-}
-
-static GType
-e_date_time_list_get_column_type (GtkTreeModel *tree_model,
- gint index)
-{
- EDateTimeList *date_time_list = (EDateTimeList *) tree_model;
-
- g_return_val_if_fail (E_IS_DATE_TIME_LIST (tree_model), G_TYPE_INVALID);
- g_return_val_if_fail (index < E_DATE_TIME_LIST_NUM_COLUMNS &&
- index >= 0, G_TYPE_INVALID);
-
- date_time_list->columns_dirty = TRUE;
- return column_types [index];
-}
-
-const ECalComponentDateTime *
-e_date_time_list_get_date_time (EDateTimeList *date_time_list, GtkTreeIter *iter)
-{
- g_return_val_if_fail (IS_VALID_ITER (date_time_list, iter), NULL);
-
- return G_LIST (iter->user_data)->data;
-}
-
-static void
-free_datetime (ECalComponentDateTime *datetime)
-{
- g_free (datetime->value);
- if (datetime->tzid)
- g_free ((gchar *) datetime->tzid);
- g_free (datetime);
-}
-
-static ECalComponentDateTime *
-copy_datetime (const ECalComponentDateTime *datetime)
-{
- ECalComponentDateTime *datetime_copy;
-
- datetime_copy = g_new0 (ECalComponentDateTime, 1);
- datetime_copy->value = g_new (struct icaltimetype, 1);
- *datetime_copy->value = *datetime->value;
-
- if (datetime->tzid)
- datetime_copy->tzid = g_strdup (datetime->tzid);
-
- return datetime_copy;
-}
-
-static gint
-compare_datetime (const ECalComponentDateTime *datetime1, const ECalComponentDateTime *datetime2)
-{
- return icaltime_compare (*datetime1->value, *datetime2->value);
-}
-
-void
-e_date_time_list_set_date_time (EDateTimeList *date_time_list, GtkTreeIter *iter,
- const ECalComponentDateTime *datetime)
-{
- ECalComponentDateTime *datetime_old;
-
- g_return_if_fail (IS_VALID_ITER (date_time_list, iter));
-
- datetime_old = G_LIST (iter->user_data)->data;
- free_datetime (datetime_old);
- G_LIST (iter->user_data)->data = copy_datetime (datetime);
- row_updated (date_time_list, g_list_position (date_time_list->list, G_LIST (iter->user_data)));
-}
-
-void
-e_date_time_list_append (EDateTimeList *date_time_list, GtkTreeIter *iter,
- const ECalComponentDateTime *datetime)
-{
- g_return_if_fail (datetime != NULL);
-
- if (g_list_find_custom (date_time_list->list, datetime, (GCompareFunc)compare_datetime) == NULL) {
- date_time_list->list = g_list_append (date_time_list->list, copy_datetime (datetime));
- row_added (date_time_list, g_list_length (date_time_list->list) - 1);
- }
-
- if (iter) {
- iter->user_data = g_list_last (date_time_list->list);
- iter->stamp = date_time_list->stamp;
- }
-}
-
-void
-e_date_time_list_remove (EDateTimeList *date_time_list, GtkTreeIter *iter)
-{
- gint n;
-
- g_return_if_fail (IS_VALID_ITER (date_time_list, iter));
-
- n = g_list_position (date_time_list->list, G_LIST (iter->user_data));
- free_datetime ((ECalComponentDateTime *) G_LIST (iter->user_data)->data);
- date_time_list->list = g_list_delete_link (date_time_list->list, G_LIST (iter->user_data));
- row_deleted (date_time_list, n);
-}
-
-void
-e_date_time_list_clear (EDateTimeList *date_time_list)
-{
- GList *l;
-
- all_rows_deleted (date_time_list);
-
- for (l = date_time_list->list; l; l = g_list_next (l)) {
- free_datetime ((ECalComponentDateTime *) l->data);
- }
-
- g_list_free (date_time_list->list);
- date_time_list->list = NULL;
-}
-
-static gboolean
-e_date_time_list_get_iter (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreePath *path)
-{
- EDateTimeList *date_time_list = (EDateTimeList *) tree_model;
- GList *l;
- gint i;
-
- g_return_val_if_fail (E_IS_DATE_TIME_LIST (tree_model), FALSE);
- g_return_val_if_fail (gtk_tree_path_get_depth (path) > 0, FALSE);
-
- if (!date_time_list->list)
- return FALSE;
-
- date_time_list->columns_dirty = TRUE;
-
- i = gtk_tree_path_get_indices (path)[0];
- l = g_list_nth (date_time_list->list, i);
- if (!l)
- return FALSE;
-
- iter->user_data = l;
- iter->stamp = date_time_list->stamp;
- return TRUE;
-}
-
-static GtkTreePath *
-e_date_time_list_get_path (GtkTreeModel *tree_model,
- GtkTreeIter *iter)
-{
- EDateTimeList *date_time_list = (EDateTimeList *) tree_model;
- GtkTreePath *retval;
- GList *l;
-
- g_return_val_if_fail (E_IS_DATE_TIME_LIST (tree_model), NULL);
- g_return_val_if_fail (iter->stamp == E_DATE_TIME_LIST (tree_model)->stamp, NULL);
-
- l = iter->user_data;
- retval = gtk_tree_path_new ();
- gtk_tree_path_append_index (retval, g_list_position (date_time_list->list, l));
- return retval;
-}
-
-/* Builds a static string out of an exception date */
-static char *
-get_exception_string (ECalComponentDateTime *dt)
-{
- static char buf [256];
- struct tm tmp_tm;
-
- tmp_tm.tm_year = dt->value->year - 1900;
- tmp_tm.tm_mon = dt->value->month - 1;
- tmp_tm.tm_mday = dt->value->day;
- tmp_tm.tm_hour = dt->value->hour;
- tmp_tm.tm_min = dt->value->minute;
- tmp_tm.tm_sec = dt->value->second;
- tmp_tm.tm_isdst = -1;
-
- tmp_tm.tm_wday = time_day_of_week (dt->value->day,
- dt->value->month - 1,
- dt->value->year);
-
- e_time_format_date_and_time (&tmp_tm, calendar_config_get_24_hour_format (),
- FALSE, FALSE, buf, sizeof (buf));
-
- return buf;
-}
-
-static void
-e_date_time_list_get_value (GtkTreeModel *tree_model,
- GtkTreeIter *iter,
- gint column,
- GValue *value)
-{
- EDateTimeList *date_time_list = E_DATE_TIME_LIST (tree_model);
- ECalComponentDateTime *datetime;
- GList *l;
- const gchar *str;
-
- g_return_if_fail (E_IS_DATE_TIME_LIST (tree_model));
- g_return_if_fail (column < E_DATE_TIME_LIST_NUM_COLUMNS);
- g_return_if_fail (E_DATE_TIME_LIST (tree_model)->stamp == iter->stamp);
- g_return_if_fail (IS_VALID_ITER (date_time_list, iter));
-
- g_value_init (value, column_types [column]);
-
- if (!date_time_list->list)
- return;
-
- l = iter->user_data;
- datetime = l->data;
-
- if (!datetime)
- return;
-
- switch (column) {
- case E_DATE_TIME_LIST_COLUMN_DESCRIPTION:
- str = get_exception_string (datetime);
- g_value_set_string (value, str);
- break;
- }
-}
-
-static gboolean
-e_date_time_list_iter_next (GtkTreeModel *tree_model,
- GtkTreeIter *iter)
-{
- GList *l;
-
- g_return_val_if_fail (E_IS_DATE_TIME_LIST (tree_model), FALSE);
- g_return_val_if_fail (IS_VALID_ITER (E_DATE_TIME_LIST (tree_model), iter), FALSE);
-
- if (!E_DATE_TIME_LIST (tree_model)->list)
- return FALSE;
-
- l = iter->user_data;
- l = g_list_next (l);
- if (l) {
- iter->user_data = l;
- return TRUE;
- }
-
- return FALSE;
-}
-
-static gboolean
-e_date_time_list_iter_children (GtkTreeModel *tree_model,
- GtkTreeIter *iter,
- GtkTreeIter *parent)
-{
- EDateTimeList *date_time_list = E_DATE_TIME_LIST (tree_model);
-
- /* this is a list, nodes have no children */
- if (parent)
- return FALSE;
-
- /* but if parent == NULL we return the list itself as children of the
- * "root" */
-
- if (!date_time_list->list)
- return FALSE;
-
- iter->stamp = E_DATE_TIME_LIST (tree_model)->stamp;
- iter->user_data = date_time_list->list;
- return TRUE;
-}
-
-static gboolean
-e_date_time_list_iter_has_child (GtkTreeModel *tree_model,
- GtkTreeIter *iter)
-{
- g_return_val_if_fail (IS_VALID_ITER (E_DATE_TIME_LIST (tree_model), iter), FALSE);
- return FALSE;
-}
-
-static gint
-e_date_time_list_iter_n_children (GtkTreeModel *tree_model,
- GtkTreeIter *iter)
-{
- EDateTimeList *date_time_list = E_DATE_TIME_LIST (tree_model);
-
- g_return_val_if_fail (E_IS_DATE_TIME_LIST (tree_model), -1);
- g_return_val_if_fail (IS_VALID_ITER (date_time_list, iter), -1);
-
- if (iter == NULL)
- return g_list_length (date_time_list->list);
-
- g_return_val_if_fail (E_DATE_TIME_LIST (tree_model)->stamp == iter->stamp, -1);
- return 0;
-}
-
-static gboolean
-e_date_time_list_iter_nth_child (GtkTreeModel *tree_model,
- GtkTreeIter *iter,
- GtkTreeIter *parent,
- gint n)
-{
- EDateTimeList *date_time_list = E_DATE_TIME_LIST (tree_model);
-
- g_return_val_if_fail (E_IS_DATE_TIME_LIST (tree_model), FALSE);
-
- if (parent)
- return FALSE;
-
- if (date_time_list->list) {
- GList *l;
-
- l = g_list_nth (date_time_list->list, n);
- if (!l)
- return FALSE;
-
- iter->stamp = date_time_list->stamp;
- iter->user_data = l;
- return TRUE;
- }
-
- return FALSE;
-}
-
-static gboolean
-e_date_time_list_iter_parent (GtkTreeModel *tree_model,
- GtkTreeIter *iter,
- GtkTreeIter *child)
-{
- return FALSE;
-}
diff --git a/calendar/gui/e-date-time-list.h b/calendar/gui/e-date-time-list.h
deleted file mode 100644
index 83b145c7c6..0000000000
--- a/calendar/gui/e-date-time-list.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/* EDateTimeList - list of calendar dates/times with GtkTreeModel interface.
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- *
- * Authors: Hans Petter Jansson <hpj@ximian.com>
- */
-
-#ifndef E_DATE_TIME_LIST_H
-#define E_DATE_TIME_LIST_H
-
-#include <gtk/gtktreemodel.h>
-#include <libecal/e-cal-component.h>
-
-G_BEGIN_DECLS
-
-#define E_TYPE_DATE_TIME_LIST (e_date_time_list_get_type ())
-#define E_DATE_TIME_LIST(obj) (GTK_CHECK_CAST ((obj), E_TYPE_DATE_TIME_LIST, EDateTimeList))
-#define E_DATE_TIME_LIST_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_TYPE_DATE_TIME_LIST, EDateTimeListClass))
-#define E_IS_DATE_TIME_LIST(obj) (GTK_CHECK_TYPE ((obj), E_TYPE_DATE_TIME_LIST))
-#define E_IS_DATE_TIME_LIST_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), E_TYPE_DATE_TIME_LIST))
-#define E_DATE_TIME_LIST_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), E_TYPE_DATE_TIME_LIST, EDateTimeListClass))
-
-typedef struct _EDateTimeList EDateTimeList;
-typedef struct _EDateTimeListClass EDateTimeListClass;
-
-typedef enum
-{
- E_DATE_TIME_LIST_COLUMN_DESCRIPTION,
-
- E_DATE_TIME_LIST_NUM_COLUMNS
-}
-EDateTimeListColumnType;
-
-struct _EDateTimeList
-{
- GObject parent;
-
- /* Private */
-
- gint stamp;
- GList *list;
-
- guint columns_dirty : 1;
-};
-
-struct _EDateTimeListClass
-{
- GObjectClass parent_class;
-};
-
-GtkType e_date_time_list_get_type (void);
-EDateTimeList *e_date_time_list_new (void);
-
-const ECalComponentDateTime *e_date_time_list_get_date_time (EDateTimeList *date_time_list,
- GtkTreeIter *iter);
-void e_date_time_list_set_date_time (EDateTimeList *date_time_list,
- GtkTreeIter *iter,
- const ECalComponentDateTime *datetime);
-void e_date_time_list_append (EDateTimeList *date_time_list,
- GtkTreeIter *iter,
- const ECalComponentDateTime *datetime);
-void e_date_time_list_remove (EDateTimeList *date_time_list,
- GtkTreeIter *iter);
-void e_date_time_list_clear (EDateTimeList *date_time_list);
-
-G_END_DECLS
-
-#endif /* E_DATE_TIME_LIST_H */
diff --git a/calendar/gui/e-day-view-config.c b/calendar/gui/e-day-view-config.c
deleted file mode 100644
index 4c10451f40..0000000000
--- a/calendar/gui/e-day-view-config.c
+++ /dev/null
@@ -1,475 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Author :
- * Rodrigo Moya <rodrigo@ximian.com>
- *
- * Copyright 2003, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#include "calendar-config.h"
-#include "e-day-view-config.h"
-
-struct _EDayViewConfigPrivate {
- EDayView *view;
-
- GList *notifications;
-};
-
-static GObjectClass *parent_class = NULL;
-
-/* Property IDs */
-enum props {
- PROP_0,
- PROP_VIEW,
-};
-
-static void
-e_day_view_config_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
-{
- EDayViewConfig *view_config;
- EDayViewConfigPrivate *priv;
-
- view_config = E_DAY_VIEW_CONFIG (object);
- priv = view_config->priv;
-
- switch (property_id) {
- case PROP_VIEW:
- e_day_view_config_set_view (view_config, g_value_get_object (value));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
- break;
- }
-}
-
-static void
-e_day_view_config_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
-{
- EDayViewConfig *view_config;
- EDayViewConfigPrivate *priv;
-
- view_config = E_DAY_VIEW_CONFIG (object);
- priv = view_config->priv;
-
- switch (property_id) {
- case PROP_VIEW:
- g_value_set_object (value, e_day_view_config_get_view (view_config));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
- break;
- }
-}
-
-static void
-e_day_view_config_dispose (GObject *object)
-{
- EDayViewConfig *view_config = E_DAY_VIEW_CONFIG (object);
- EDayViewConfigPrivate *priv;
-
- priv = view_config->priv;
-
- e_day_view_config_set_view (view_config, NULL);
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-static void
-e_day_view_config_finalize (GObject *object)
-{
- EDayViewConfig *view_config = E_DAY_VIEW_CONFIG (object);
- EDayViewConfigPrivate *priv;
-
- priv = view_config->priv;
-
- g_free (priv);
-
- if (G_OBJECT_CLASS (parent_class)->finalize)
- G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-static void
-e_day_view_config_class_init (EDayViewConfigClass *klass)
-{
- GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- GParamSpec *spec;
-
- parent_class = g_type_class_peek_parent (klass);
-
- /* Method override */
- gobject_class->set_property = e_day_view_config_set_property;
- gobject_class->get_property = e_day_view_config_get_property;
- gobject_class->dispose = e_day_view_config_dispose;
- gobject_class->finalize = e_day_view_config_finalize;
-
- spec = g_param_spec_object ("view", NULL, NULL, e_day_view_get_type (),
- G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT);
- g_object_class_install_property (gobject_class, PROP_VIEW, spec);
-}
-
-static void
-e_day_view_config_init (EDayViewConfig *view_config, EDayViewConfigClass *klass)
-{
- view_config->priv = g_new0 (EDayViewConfigPrivate, 1);
-
-}
-
-E_MAKE_TYPE (e_day_view_config, "EDayViewConfig", EDayViewConfig, e_day_view_config_class_init,
- e_day_view_config_init, G_TYPE_OBJECT);
-
-EDayViewConfig *
-e_day_view_config_new (EDayView *day_view)
-{
- EDayViewConfig *view_config;
-
- view_config = g_object_new (e_day_view_config_get_type (), "view", day_view, NULL);
-
- return view_config;
-}
-
-EDayView *
-e_day_view_config_get_view (EDayViewConfig *view_config)
-{
- EDayViewConfigPrivate *priv;
-
- g_return_val_if_fail (view_config != NULL, NULL);
- g_return_val_if_fail (E_IS_DAY_VIEW_CONFIG (view_config), NULL);
-
- priv = view_config->priv;
-
- return priv->view;
-}
-
-static void
-set_timezone (EDayView *day_view)
-{
- char *location;
- icaltimezone *zone;
-
- location = calendar_config_get_timezone ();
- zone = icaltimezone_get_builtin_timezone (location);
- if (!zone)
- zone = icaltimezone_get_utc_timezone ();
-
- e_calendar_view_set_timezone (E_CALENDAR_VIEW (day_view), zone);
-
- g_free (location);
-}
-
-static void
-timezone_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
-{
- EDayViewConfig *view_config = data;
- EDayViewConfigPrivate *priv;
-
- priv = view_config->priv;
-
- set_timezone (priv->view);
-}
-
-static void
-set_week_start (EDayView *day_view)
-{
- int week_start_day;
-
- week_start_day = calendar_config_get_week_start_day ();
-
- /* Convert it to 0 (Mon) to 6 (Sun), which is what we use. */
- week_start_day = (week_start_day + 6) % 7;
-
- e_day_view_set_week_start_day (day_view, week_start_day);
-}
-
-static void
-week_start_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
-{
- EDayViewConfig *view_config = data;
- EDayViewConfigPrivate *priv;
-
- priv = view_config->priv;
-
- set_week_start (priv->view);
-}
-
-static void
-set_twentyfour_hour (EDayView *day_view)
-{
- gboolean use_24_hour;
-
- use_24_hour = calendar_config_get_24_hour_format ();
-
- e_calendar_view_set_use_24_hour_format (E_CALENDAR_VIEW (day_view), use_24_hour);
-}
-
-static void
-twentyfour_hour_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
-{
- EDayViewConfig *view_config = data;
- EDayViewConfigPrivate *priv;
-
- priv = view_config->priv;
-
- set_twentyfour_hour (priv->view);
-}
-
-static void
-set_working_days (EDayView *day_view)
-{
- CalWeekdays working_days;
-
- working_days = calendar_config_get_working_days ();
-
- e_day_view_set_working_days (day_view, working_days);
-}
-
-static void
-working_days_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
-{
- EDayViewConfig *view_config = data;
- EDayViewConfigPrivate *priv;
-
- priv = view_config->priv;
-
- set_working_days (priv->view);
-}
-
-static void
-set_day_start_hour (EDayView *day_view)
-{
- int start_hour, start_minute, end_hour, end_minute;
-
- e_day_view_get_working_day (day_view, &start_hour, &start_minute, &end_hour, &end_minute);
-
- start_hour = calendar_config_get_day_start_hour ();
-
- e_day_view_set_working_day (day_view, start_hour, start_minute, end_hour, end_minute);
-}
-
-static void
-day_start_hour_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
-{
- EDayViewConfig *view_config = data;
- EDayViewConfigPrivate *priv;
-
- priv = view_config->priv;
-
- set_day_start_hour (priv->view);
-}
-
-static void
-set_day_start_minute (EDayView *day_view)
-{
- int start_hour, start_minute, end_hour, end_minute;
-
- e_day_view_get_working_day (day_view, &start_hour, &start_minute, &end_hour, &end_minute);
-
- start_minute = calendar_config_get_day_start_minute ();
-
- e_day_view_set_working_day (day_view, start_hour, start_minute, end_hour, end_minute);
-}
-
-static void
-day_start_minute_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
-{
- EDayViewConfig *view_config = data;
- EDayViewConfigPrivate *priv;
-
- priv = view_config->priv;
-
- set_day_start_minute (priv->view);
-}
-
-static void
-set_day_end_hour (EDayView *day_view)
-{
- int start_hour, start_minute, end_hour, end_minute;
-
- e_day_view_get_working_day (day_view, &start_hour, &start_minute, &end_hour, &end_minute);
-
- end_hour = calendar_config_get_day_end_hour ();
-
- e_day_view_set_working_day (day_view, start_hour, start_minute, end_hour, end_minute);
-}
-
-static void
-day_end_hour_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
-{
- EDayViewConfig *view_config = data;
- EDayViewConfigPrivate *priv;
-
- priv = view_config->priv;
-
- set_day_end_hour (priv->view);
-}
-
-
-static void
-set_day_end_minute (EDayView *day_view)
-{
- int start_hour, start_minute, end_hour, end_minute;
-
- e_day_view_get_working_day (day_view, &start_hour, &start_minute, &end_hour, &end_minute);
-
- end_minute = calendar_config_get_day_end_minute ();
-
- e_day_view_set_working_day (day_view, start_hour, start_minute, end_hour, end_minute);
-}
-
-static void
-day_end_minute_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
-{
- EDayViewConfig *view_config = data;
- EDayViewConfigPrivate *priv;
-
- priv = view_config->priv;
-
- set_day_end_minute (priv->view);
-}
-
-static void
-set_time_divisions (EDayView *day_view)
-{
- int time_divisions;
-
- time_divisions = calendar_config_get_time_divisions ();
-
- e_day_view_set_mins_per_row (day_view, time_divisions);
-}
-
-static void
-time_divisions_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
-{
- EDayViewConfig *view_config = data;
- EDayViewConfigPrivate *priv;
-
- priv = view_config->priv;
-
- set_time_divisions (priv->view);
-}
-
-static void
-set_show_event_end (EDayView *day_view)
-{
- gboolean show_event_end;
-
- show_event_end = calendar_config_get_show_event_end ();
-
- e_day_view_set_show_event_end_times (day_view, show_event_end);
-}
-
-static void
-show_event_end_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
-{
- EDayViewConfig *view_config = data;
- EDayViewConfigPrivate *priv;
-
- priv = view_config->priv;
-
- set_show_event_end (priv->view);
-}
-
-void
-e_day_view_config_set_view (EDayViewConfig *view_config, EDayView *day_view)
-{
- EDayViewConfigPrivate *priv;
- guint not;
- GList *l;
-
- g_return_if_fail (view_config != NULL);
- g_return_if_fail (E_IS_DAY_VIEW_CONFIG (view_config));
-
- priv = view_config->priv;
-
- if (priv->view) {
- g_object_unref (priv->view);
- priv->view = NULL;
- }
-
- for (l = priv->notifications; l; l = l->next)
- calendar_config_remove_notification (GPOINTER_TO_UINT (l->data));
-
- g_list_free (priv->notifications);
- priv->notifications = NULL;
-
- /* If the new view is NULL, return right now */
- if (!day_view)
- return;
-
- priv->view = g_object_ref (day_view);
-
- /* Time zone */
- set_timezone (day_view);
-
- not = calendar_config_add_notification_timezone (timezone_changed_cb, view_config);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
-
- /* Week start */
- set_week_start (day_view);
-
- not = calendar_config_add_notification_week_start_day (week_start_changed_cb, view_config);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
-
- /* 24 Hour format */
- set_twentyfour_hour (day_view);
-
- not = calendar_config_add_notification_24_hour_format (twentyfour_hour_changed_cb, view_config);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
-
- /* Working days */
- set_working_days (day_view);
-
- not = calendar_config_add_notification_working_days (working_days_changed_cb, view_config);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
-
- /* Day start hour */
- set_day_start_hour (day_view);
-
- not = calendar_config_add_notification_day_start_hour (day_start_hour_changed_cb, view_config);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
-
- /* Day start minute */
- set_day_start_minute (day_view);
-
- not = calendar_config_add_notification_day_start_minute (day_start_minute_changed_cb, view_config);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
-
- /* Day end hour */
- set_day_end_hour (day_view);
-
- not = calendar_config_add_notification_day_end_hour (day_end_hour_changed_cb, view_config);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
-
- /* Day start minute */
- set_day_end_minute (day_view);
-
- not = calendar_config_add_notification_day_end_minute (day_end_minute_changed_cb, view_config);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
-
- /* Time divisions */
- set_time_divisions (day_view);
-
- not = calendar_config_add_notification_time_divisions (time_divisions_changed_cb, view_config);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
-
- /* Showing event end */
- set_show_event_end (day_view);
-
- not = calendar_config_add_notification_show_event_end (show_event_end_changed_cb, view_config);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
-}
diff --git a/calendar/gui/e-day-view-config.h b/calendar/gui/e-day-view-config.h
deleted file mode 100644
index 105cbb4f07..0000000000
--- a/calendar/gui/e-day-view-config.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Author :
- * JP Rosevear <jpr@ximian.com>
- *
- * Copyright 2003, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifndef _E_DAY_VIEW_CONFIG_H_
-#define _E_DAY_VIEW_CONFIG_H_
-
-#include "e-day-view.h"
-
-G_BEGIN_DECLS
-
-#define E_DAY_VIEW_CONFIG(obj) GTK_CHECK_CAST (obj, e_day_view_config_get_type (), EDayViewConfig)
-#define E_DAY_VIEW_CONFIG_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, e_day_view_config_get_type (), EDayViewConfigClass)
-#define E_IS_DAY_VIEW_CONFIG(obj) GTK_CHECK_TYPE (obj, e_day_view_config_get_type ())
-
-typedef struct _EDayViewConfig EDayViewConfig;
-typedef struct _EDayViewConfigClass EDayViewConfigClass;
-typedef struct _EDayViewConfigPrivate EDayViewConfigPrivate;
-
-struct _EDayViewConfig {
- GObject parent;
-
- EDayViewConfigPrivate *priv;
-};
-
-struct _EDayViewConfigClass {
- GObjectClass parent_class;
-};
-
-GType e_day_view_config_get_type (void);
-EDayViewConfig *e_day_view_config_new (EDayView *day_view);
-EDayView *e_day_view_config_get_view (EDayViewConfig *view_config);
-void e_day_view_config_set_view (EDayViewConfig *view_config, EDayView *day_view);
-
-G_END_DECLS
-
-#endif
diff --git a/calendar/gui/e-day-view-layout.c b/calendar/gui/e-day-view-layout.c
deleted file mode 100644
index ba843b828c..0000000000
--- a/calendar/gui/e-day-view-layout.c
+++ /dev/null
@@ -1,352 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Author :
- * Damon Chaplin <damon@ximian.com>
- *
- * Copyright 2001, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-/*
- * Lays out events for the Day & Work-Week views of the calendar. It is also
- * used for printing.
- */
-
-#include <config.h>
-
-#include "e-day-view-layout.h"
-
-static void e_day_view_layout_long_event (EDayViewEvent *event,
- guint8 *grid,
- gint days_shown,
- time_t *day_starts,
- gint *rows_in_top_display);
-
-static void e_day_view_layout_day_event (EDayViewEvent *event,
- guint8 *grid,
- guint16 *group_starts,
- gint8 *cols_per_row,
- gint rows,
- gint mins_per_row);
-static void e_day_view_expand_day_event (EDayViewEvent *event,
- guint8 *grid,
- gint8 *cols_per_row,
- gint mins_per_row);
-static void e_day_view_recalc_cols_per_row (gint rows,
- gint8 *cols_per_row,
- guint16 *group_starts);
-
-
-void
-e_day_view_layout_long_events (GArray *events,
- gint days_shown,
- time_t *day_starts,
- gint *rows_in_top_display)
-{
- EDayViewEvent *event;
- gint event_num;
- guint8 *grid;
-
- /* This is a temporary 2-d grid which is used to place events.
- Each element is 0 if the position is empty, or 1 if occupied.
- We allocate the maximum size possible here, assuming that each
- event will need its own row. */
- grid = g_new0 (guint8, events->len * E_DAY_VIEW_MAX_DAYS);
-
- /* Reset the number of rows in the top display to 0. It will be
- updated as events are layed out below. */
- *rows_in_top_display = 0;
-
- /* Iterate over the events, finding which days they cover, and putting
- them in the first free row available. */
- for (event_num = 0; event_num < events->len; event_num++) {
- event = &g_array_index (events, EDayViewEvent, event_num);
- e_day_view_layout_long_event (event, grid,
- days_shown, day_starts,
- rows_in_top_display);
- }
-
- /* Free the grid. */
- g_free (grid);
-}
-
-
-static void
-e_day_view_layout_long_event (EDayViewEvent *event,
- guint8 *grid,
- gint days_shown,
- time_t *day_starts,
- gint *rows_in_top_display)
-{
- gint start_day, end_day, free_row, day, row;
-
- event->num_columns = 0;
-
- if (!e_day_view_find_long_event_days (event,
- days_shown, day_starts,
- &start_day, &end_day))
- return;
-
- /* Try each row until we find a free one. */
- row = 0;
- do {
- free_row = row;
- for (day = start_day; day <= end_day; day++) {
- if (grid[row * E_DAY_VIEW_MAX_DAYS + day]) {
- free_row = -1;
- break;
- }
- }
- row++;
- } while (free_row == -1);
-
- event->start_row_or_col = free_row;
- event->num_columns = 1;
-
- /* Mark the cells as full. */
- for (day = start_day; day <= end_day; day++) {
- grid[free_row * E_DAY_VIEW_MAX_DAYS + day] = 1;
- }
-
- /* Update the number of rows in the top canvas if necessary. */
- *rows_in_top_display = MAX (*rows_in_top_display, free_row + 1);
-}
-
-
-void
-e_day_view_layout_day_events (GArray *events,
- gint rows,
- gint mins_per_row,
- gint8 *cols_per_row)
-{
- EDayViewEvent *event;
- gint row, event_num;
- guint8 *grid;
-
- /* This is a temporary array which keeps track of rows which are
- connected. When an appointment spans multiple rows then the number
- of columns in each of these rows must be the same (i.e. the maximum
- of all of them). Each element in the array corresponds to one row
- and contains the index of the first row in the group of connected
- rows. */
- guint16 group_starts[12 * 24];
-
- /* Reset the cols_per_row array, and initialize the connected rows so
- that all rows are not connected - each row is the start of a new
- group. */
- for (row = 0; row < rows; row++) {
- cols_per_row[row] = 0;
- group_starts[row] = row;
- }
-
- /* This is a temporary 2-d grid which is used to place events.
- Each element is 0 if the position is empty, or 1 if occupied. */
- grid = g_new0 (guint8, rows * E_DAY_VIEW_MAX_COLUMNS);
-
-
- /* Iterate over the events, finding which rows they cover, and putting
- them in the first free column available. Increment the number of
- events in each of the rows it covers, and make sure they are all
- in one group. */
- for (event_num = 0; event_num < events->len; event_num++) {
- event = &g_array_index (events, EDayViewEvent, event_num);
-
- e_day_view_layout_day_event (event, grid, group_starts,
- cols_per_row, rows, mins_per_row);
- }
-
- /* Recalculate the number of columns needed in each row. */
- e_day_view_recalc_cols_per_row (rows, cols_per_row, group_starts);
-
- /* Iterate over the events again, trying to expand events horizontally
- if there is enough space. */
- for (event_num = 0; event_num < events->len; event_num++) {
- event = &g_array_index (events, EDayViewEvent, event_num);
- e_day_view_expand_day_event (event, grid, cols_per_row,
- mins_per_row);
- }
-
- /* Free the grid. */
- g_free (grid);
-}
-
-
-/* Finds the first free position to place the event in.
- Increments the number of events in each of the rows it covers, and makes
- sure they are all in one group. */
-static void
-e_day_view_layout_day_event (EDayViewEvent *event,
- guint8 *grid,
- guint16 *group_starts,
- gint8 *cols_per_row,
- gint rows,
- gint mins_per_row)
-{
- gint start_row, end_row, free_col, col, row, group_start;
-
- start_row = event->start_minute / mins_per_row;
- end_row = (event->end_minute - 1) / mins_per_row;
- if (end_row < start_row)
- end_row = start_row;
-
- event->num_columns = 0;
-
- /* If the event can't currently be seen, just return. */
- if (start_row >= rows || end_row < 0)
- return;
-
- /* Make sure we don't go outside the visible times. */
- start_row = CLAMP (start_row, 0, rows - 1);
- end_row = CLAMP (end_row, 0, rows - 1);
-
- /* Try each column until we find a free one. */
- for (col = 0; col < E_DAY_VIEW_MAX_COLUMNS; col++) {
- free_col = col;
- for (row = start_row; row <= end_row; row++) {
- if (grid[row * E_DAY_VIEW_MAX_COLUMNS + col]) {
- free_col = -1;
- break;
- }
- }
-
- if (free_col != -1)
- break;
- }
-
- /* If we can't find space for the event, just return. */
- if (free_col == -1)
- return;
-
- /* The event is assigned 1 col initially, but may be expanded later. */
- event->start_row_or_col = free_col;
- event->num_columns = 1;
-
- /* Determine the start index of the group. */
- group_start = group_starts[start_row];
-
- /* Increment number of events in each of the rows the event covers.
- We use the cols_per_row array for this. It will be sorted out after
- all the events have been layed out. Also make sure all the rows that
- the event covers are in one group. */
- for (row = start_row; row <= end_row; row++) {
- grid[row * E_DAY_VIEW_MAX_COLUMNS + free_col] = 1;
- cols_per_row[row]++;
- group_starts[row] = group_start;
- }
-
- /* If any following rows should be in the same group, add them. */
- for (row = end_row + 1; row < rows; row++) {
- if (group_starts[row] > end_row)
- break;
- group_starts[row] = group_start;
- }
-}
-
-
-/* For each group of rows, find the max number of events in all the
- rows, and set the number of cols in each of the rows to that. */
-static void
-e_day_view_recalc_cols_per_row (gint rows,
- gint8 *cols_per_row,
- guint16 *group_starts)
-{
- gint start_row = 0, row, next_start_row, max_events;
-
- while (start_row < rows) {
- max_events = 0;
- for (row = start_row; row < rows && group_starts[row] == start_row; row++)
- max_events = MAX (max_events, cols_per_row[row]);
-
- next_start_row = row;
-
- for (row = start_row; row < next_start_row; row++)
- cols_per_row[row] = max_events;
-
- start_row = next_start_row;
- }
-}
-
-
-/* Expands the event horizontally to fill any free space. */
-static void
-e_day_view_expand_day_event (EDayViewEvent *event,
- guint8 *grid,
- gint8 *cols_per_row,
- gint mins_per_row)
-{
- gint start_row, end_row, col, row;
- gboolean clashed;
-
- start_row = event->start_minute / mins_per_row;
- end_row = (event->end_minute - 1) / mins_per_row;
- if (end_row < start_row)
- end_row = start_row;
-
- /* Try each column until we find a free one. */
- clashed = FALSE;
- for (col = event->start_row_or_col + 1; col < cols_per_row[start_row]; col++) {
- for (row = start_row; row <= end_row; row++) {
- if (grid[row * E_DAY_VIEW_MAX_COLUMNS + col]) {
- clashed = TRUE;
- break;
- }
- }
-
- if (clashed)
- break;
-
- event->num_columns++;
- }
-}
-
-
-/* Find the start and end days for the event. */
-gboolean
-e_day_view_find_long_event_days (EDayViewEvent *event,
- gint days_shown,
- time_t *day_starts,
- gint *start_day_return,
- gint *end_day_return)
-{
- gint day, start_day, end_day;
-
- start_day = -1;
- end_day = -1;
-
- for (day = 0; day < days_shown; day++) {
- if (start_day == -1
- && event->start < day_starts[day + 1])
- start_day = day;
- if (event->end > day_starts[day])
- end_day = day;
- }
-
- /* Sanity check. */
- if (start_day < 0 || start_day >= days_shown
- || end_day < 0 || end_day >= days_shown
- || end_day < start_day) {
- g_warning ("Invalid date range for event");
- return FALSE;
- }
-
- *start_day_return = start_day;
- *end_day_return = end_day;
-
- return TRUE;
-}
-
-
diff --git a/calendar/gui/e-day-view-layout.h b/calendar/gui/e-day-view-layout.h
deleted file mode 100644
index 70d0dd6394..0000000000
--- a/calendar/gui/e-day-view-layout.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Author :
- * Damon Chaplin <damon@ximian.com>
- *
- * Copyright 2001, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-#ifndef _E_DAY_VIEW_LAYOUT_H_
-#define _E_DAY_VIEW_LAYOUT_H_
-
-#include "e-day-view.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-/* I've split these functions away from EDayView so we can use them for
- printing. */
-
-void e_day_view_layout_long_events (GArray *events,
- gint days_shown,
- time_t *day_starts,
- gint *rows_in_top_display);
-
-
-void e_day_view_layout_day_events (GArray *events,
- gint rows,
- gint mins_per_row,
- gint8 *cols_per_row);
-
-gboolean e_day_view_find_long_event_days (EDayViewEvent *event,
- gint days_shown,
- time_t *day_starts,
- gint *start_day,
- gint *end_day);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _E_DAY_VIEW_LAYOUT_H_ */
diff --git a/calendar/gui/e-day-view-main-item.c b/calendar/gui/e-day-view-main-item.c
deleted file mode 100644
index 2b7787ded4..0000000000
--- a/calendar/gui/e-day-view-main-item.c
+++ /dev/null
@@ -1,796 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Author :
- * Damon Chaplin <damon@ximian.com>
- *
- * Copyright 1999, Ximian, Inc.
- * Copyright 1999, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-/*
- * EDayViewMainItem - canvas item which displays most of the appointment
- * data in the main Day/Work Week display.
- */
-
-#include <config.h>
-#include "e-util/e-categories-config.h"
-#include "e-day-view-layout.h"
-#include "e-day-view-main-item.h"
-#include "ea-calendar.h"
-
-static void e_day_view_main_item_class_init (EDayViewMainItemClass *class);
-static void e_day_view_main_item_init (EDayViewMainItem *dvtitem);
-
-static void e_day_view_main_item_set_arg (GtkObject *o, GtkArg *arg,
- guint arg_id);
-static void e_day_view_main_item_update (GnomeCanvasItem *item,
- double *affine,
- ArtSVP *clip_path, int flags);
-static void e_day_view_main_item_draw (GnomeCanvasItem *item,
- GdkDrawable *drawable,
- int x, int y,
- int width, int height);
-static double e_day_view_main_item_point (GnomeCanvasItem *item,
- double x, double y,
- int cx, int cy,
- GnomeCanvasItem **actual_item);
-static gint e_day_view_main_item_event (GnomeCanvasItem *item,
- GdkEvent *event);
-
-static void e_day_view_main_item_draw_long_events_in_vbars (EDayViewMainItem *dvmitem,
- GdkDrawable *drawable,
- int x,
- int y,
- int width,
- int height);
-static void e_day_view_main_item_draw_events_in_vbars (EDayViewMainItem *dvmitem,
- GdkDrawable *drawable,
- int x, int y,
- int width, int height,
- gint day);
-static void e_day_view_main_item_draw_day_events (EDayViewMainItem *dvmitem,
- GdkDrawable *drawable,
- int x, int y,
- int width, int height,
- gint day);
-static void e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem,
- GdkDrawable *drawable,
- int x, int y,
- int width, int height,
- gint day, gint event_num);
-
-static GnomeCanvasItemClass *parent_class;
-
-/* The arguments we take */
-enum {
- ARG_0,
- ARG_DAY_VIEW
-};
-
-E_MAKE_TYPE (e_day_view_main_item, "EDayViewMainItem", EDayViewMainItem,
- e_day_view_main_item_class_init, e_day_view_main_item_init, GNOME_TYPE_CANVAS_ITEM);
-
-static void
-e_day_view_main_item_class_init (EDayViewMainItemClass *class)
-{
- GtkObjectClass *object_class;
- GnomeCanvasItemClass *item_class;
-
- parent_class = g_type_class_peek_parent (class);
-
- object_class = (GtkObjectClass *) class;
- item_class = (GnomeCanvasItemClass *) class;
-
- gtk_object_add_arg_type ("EDayViewMainItem::day_view",
- GTK_TYPE_POINTER, GTK_ARG_WRITABLE,
- ARG_DAY_VIEW);
-
- object_class->set_arg = e_day_view_main_item_set_arg;
-
- /* GnomeCanvasItem method overrides */
- item_class->update = e_day_view_main_item_update;
- item_class->draw = e_day_view_main_item_draw;
- item_class->point = e_day_view_main_item_point;
- item_class->event = e_day_view_main_item_event;
-
- /* init the accessibility support for e_day_view */
- e_day_view_main_item_a11y_init ();
-}
-
-
-static void
-e_day_view_main_item_init (EDayViewMainItem *dvtitem)
-{
- dvtitem->day_view = NULL;
-}
-
-
-static void
-e_day_view_main_item_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
-{
- GnomeCanvasItem *item;
- EDayViewMainItem *dvmitem;
-
- item = GNOME_CANVAS_ITEM (o);
- dvmitem = E_DAY_VIEW_MAIN_ITEM (o);
-
- switch (arg_id){
- case ARG_DAY_VIEW:
- dvmitem->day_view = GTK_VALUE_POINTER (*arg);
- break;
- }
-}
-
-
-static void
-e_day_view_main_item_update (GnomeCanvasItem *item,
- double *affine,
- ArtSVP *clip_path,
- int flags)
-{
- if (GNOME_CANVAS_ITEM_CLASS (parent_class)->update)
- (* GNOME_CANVAS_ITEM_CLASS (parent_class)->update) (item, affine, clip_path, flags);
-
- /* The item covers the entire canvas area. */
- item->x1 = 0;
- item->y1 = 0;
- item->x2 = INT_MAX;
- item->y2 = INT_MAX;
-}
-
-
-/*
- * DRAWING ROUTINES - functions to paint the canvas item.
- */
-
-static void
-e_day_view_main_item_draw (GnomeCanvasItem *canvas_item, GdkDrawable *drawable,
- int x, int y, int width, int height)
-{
- EDayViewMainItem *dvmitem;
- EDayView *day_view;
- GtkStyle *style;
- GdkGC *gc;
- gint row, row_y, grid_x1, grid_x2;
- gint day, grid_y1, grid_y2;
- gint work_day_start_y, work_day_end_y;
- gint day_x, day_w, work_day;
- gint start_row, end_row, rect_x, rect_y, rect_width, rect_height;
- struct icaltimetype day_start_tt;
- gint weekday;
-
-#if 0
- g_print ("In e_day_view_main_item_draw %i,%i %ix%i\n",
- x, y, width, height);
-#endif
- dvmitem = E_DAY_VIEW_MAIN_ITEM (canvas_item);
- day_view = dvmitem->day_view;
- g_return_if_fail (day_view != NULL);
-
- style = gtk_widget_get_style (GTK_WIDGET (day_view));
-
- /* Paint the background colors. */
- gc = day_view->main_gc;
- work_day_start_y = e_day_view_convert_time_to_position (day_view, day_view->work_day_start_hour, day_view->work_day_start_minute) - y;
- work_day_end_y = e_day_view_convert_time_to_position (day_view, day_view->work_day_end_hour, day_view->work_day_end_minute) - y;
-
- for (day = 0; day < day_view->days_shown; day++) {
- day_start_tt = icaltime_from_timet_with_zone (day_view->day_starts[day], FALSE,
- e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
- weekday = icaltime_day_of_week (day_start_tt) - 1;
-
- work_day = day_view->working_days & (1 << weekday);
-
- day_x = day_view->day_offsets[day] - x;
- day_w = day_view->day_widths[day];
-
- if (work_day) {
- gdk_gc_set_foreground (gc, &day_view->colors[E_DAY_VIEW_COLOR_BG_NOT_WORKING]);
- gdk_draw_rectangle (drawable, gc, TRUE,
- day_x, 0 - y,
- day_w, work_day_start_y - (0 - y));
- gdk_gc_set_foreground (gc, &day_view->colors[E_DAY_VIEW_COLOR_BG_WORKING]);
- gdk_draw_rectangle (drawable, gc, TRUE,
- day_x, work_day_start_y,
- day_w, work_day_end_y - work_day_start_y);
- gdk_gc_set_foreground (gc, &day_view->colors[E_DAY_VIEW_COLOR_BG_NOT_WORKING]);
- gdk_draw_rectangle (drawable, gc, TRUE,
- day_x, work_day_end_y,
- day_w, height - work_day_end_y);
- } else {
- gdk_gc_set_foreground (gc, &day_view->colors[E_DAY_VIEW_COLOR_BG_NOT_WORKING]);
- gdk_draw_rectangle (drawable, gc, TRUE,
- day_x, 0,
- day_w, height);
- }
- }
-
- /* Paint the selection background. */
- if (day_view->selection_start_day != -1
- && !day_view->selection_in_top_canvas) {
- for (day = day_view->selection_start_day;
- day <= day_view->selection_end_day;
- day++) {
- if (day == day_view->selection_start_day
- && day_view->selection_start_row != -1)
- start_row = day_view->selection_start_row;
- else
- start_row = 0;
- if (day == day_view->selection_end_day
- && day_view->selection_end_row != -1)
- end_row = day_view->selection_end_row;
- else
- end_row = day_view->rows - 1;
-
- rect_x = day_view->day_offsets[day] - x;
- rect_width = day_view->day_widths[day];
- rect_y = start_row * day_view->row_height - y;
- rect_height = (end_row - start_row + 1) * day_view->row_height;
-
- if (GTK_WIDGET_HAS_FOCUS(day_view))
- gdk_gc_set_foreground (gc, &day_view->colors[E_DAY_VIEW_COLOR_BG_SELECTED]);
- else
- gdk_gc_set_foreground (gc, &day_view->colors[E_DAY_VIEW_COLOR_BG_SELECTED_UNFOCUSSED]);
- gdk_draw_rectangle (drawable, gc, TRUE,
- rect_x, rect_y,
- rect_width, rect_height);
- }
- }
-
- /* Drawing the horizontal grid lines. */
- grid_x1 = day_view->day_offsets[0] - x;
- grid_x2 = day_view->day_offsets[day_view->days_shown] - x;
-
- gdk_gc_set_foreground (gc, &day_view->colors[E_DAY_VIEW_COLOR_BG_GRID]);
- for (row = 0, row_y = 0 - y;
- row < day_view->rows && row_y < height;
- row++, row_y += day_view->row_height) {
- if (row_y >= 0 && row_y < height)
- gdk_draw_line (drawable, gc,
- grid_x1, row_y, grid_x2, row_y);
- }
-
- /* Draw the vertical bars down the left of each column. */
- grid_y1 = 0;
- grid_y2 = height;
- for (day = 0; day < day_view->days_shown; day++) {
- grid_x1 = day_view->day_offsets[day] - x;
-
- /* Skip if it isn't visible. */
- if (grid_x1 >= width || grid_x1 + E_DAY_VIEW_BAR_WIDTH <= 0)
- continue;
-
- gdk_draw_line (drawable, style->black_gc,
- grid_x1, grid_y1,
- grid_x1, grid_y2);
- gdk_draw_line (drawable, style->black_gc,
- grid_x1 + E_DAY_VIEW_BAR_WIDTH - 1, grid_y1,
- grid_x1 + E_DAY_VIEW_BAR_WIDTH - 1, grid_y2);
- gdk_draw_rectangle (drawable, style->white_gc, TRUE,
- grid_x1 + 1, grid_y1,
- E_DAY_VIEW_BAR_WIDTH - 2, grid_y2 - grid_y1);
-
- /* Fill in the bars when the user is busy. */
- e_day_view_main_item_draw_events_in_vbars (dvmitem, drawable,
- x, y,
- width, height,
- day);
- }
-
- /* Fill in the vertical bars corresponding to the busy times from the
- long events. */
- e_day_view_main_item_draw_long_events_in_vbars (dvmitem, drawable,
- x, y, width, height);
-
- /* Draw the event borders and backgrounds, and the vertical bars
- down the left edges. */
- for (day = 0; day < day_view->days_shown; day++) {
- e_day_view_main_item_draw_day_events (dvmitem, drawable,
- x, y, width, height,
- day);
- }
-}
-
-
-static void
-e_day_view_main_item_draw_events_in_vbars (EDayViewMainItem *dvmitem,
- GdkDrawable *drawable,
- int x, int y,
- int width, int height,
- gint day)
-{
- EDayView *day_view;
- EDayViewEvent *event;
- GdkGC *gc;
- gint grid_x, event_num, bar_y, bar_h;
- ECalComponentTransparency transparency;
-
- day_view = dvmitem->day_view;
-
- gc = day_view->main_gc;
- gdk_gc_set_foreground (gc, &day_view->colors[E_DAY_VIEW_COLOR_EVENT_VBAR]);
-
- grid_x = day_view->day_offsets[day] + 1 - x;
-
- /* Draw the busy times corresponding to the events in the day. */
- for (event_num = 0; event_num < day_view->events[day]->len;
- event_num++) {
- ECalComponent *comp;
-
- event = &g_array_index (day_view->events[day], EDayViewEvent,
- event_num);
-
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
-
- /* If the event is TRANSPARENT, skip it. */
- e_cal_component_get_transparency (comp, &transparency);
- if (transparency == E_CAL_COMPONENT_TRANSP_TRANSPARENT)
- continue;
-
- /* We can skip the events in the first column since they will
- draw over this anyway. */
- if (event->num_columns > 0 && event->start_row_or_col == 0)
- continue;
-
- bar_y = event->start_minute * day_view->row_height / day_view->mins_per_row;
- bar_h = event->end_minute * day_view->row_height / day_view->mins_per_row - bar_y;
- bar_y -= y;
-
- /* Skip it if it isn't visible. */
- if (bar_y >= height || bar_y + bar_h <= 0)
- continue;
-
- gdk_draw_rectangle (drawable, gc, TRUE,
- grid_x, bar_y,
- E_DAY_VIEW_BAR_WIDTH - 2, bar_h);
-
- g_object_unref (comp);
- }
-}
-
-
-static void
-e_day_view_main_item_draw_long_events_in_vbars (EDayViewMainItem *dvmitem,
- GdkDrawable *drawable,
- int x, int y,
- int width, int height)
-{
- EDayView *day_view;
- EDayViewEvent *event;
- gint event_num, start_day, end_day, day, bar_y1, bar_y2, grid_x;
- GdkGC *gc;
- ECalComponentTransparency transparency;
-
- day_view = dvmitem->day_view;
-
- gc = day_view->main_gc;
- gdk_gc_set_foreground (gc, &day_view->colors[E_DAY_VIEW_COLOR_EVENT_VBAR]);
-
- for (event_num = 0; event_num < day_view->long_events->len;
- event_num++) {
- ECalComponent *comp;
-
- event = &g_array_index (day_view->long_events, EDayViewEvent,
- event_num);
-
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
-
- /* If the event is TRANSPARENT, skip it. */
- e_cal_component_get_transparency (comp, &transparency);
- if (transparency == E_CAL_COMPONENT_TRANSP_TRANSPARENT)
- continue;
-
- if (!e_day_view_find_long_event_days (event,
- day_view->days_shown,
- day_view->day_starts,
- &start_day, &end_day))
- continue;
-
- for (day = start_day; day <= end_day; day++) {
- grid_x = day_view->day_offsets[day] + 1 - x;
-
- /* Skip if it isn't visible. */
- if (grid_x >= width
- || grid_x + E_DAY_VIEW_BAR_WIDTH <= 0)
- continue;
-
- if (event->start <= day_view->day_starts[day]) {
- bar_y1 = 0;
- } else {
- bar_y1 = event->start_minute * day_view->row_height / day_view->mins_per_row - y;
- }
-
- if (event->end >= day_view->day_starts[day + 1]) {
- bar_y2 = height;
- } else {
- bar_y2 = event->end_minute * day_view->row_height / day_view->mins_per_row - y;
- }
-
- if (bar_y1 < height && bar_y2 > 0 && bar_y2 > bar_y1) {
- gdk_draw_rectangle (drawable, gc, TRUE,
- grid_x, bar_y1,
- E_DAY_VIEW_BAR_WIDTH - 2,
- bar_y2 - bar_y1);
- }
- }
-
-
- g_object_unref (comp);
- }
-}
-
-
-static void
-e_day_view_main_item_draw_day_events (EDayViewMainItem *dvmitem,
- GdkDrawable *drawable,
- int x, int y, int width, int height,
- gint day)
-{
- EDayView *day_view;
- gint event_num;
-
- day_view = dvmitem->day_view;
-
- for (event_num = 0; event_num < day_view->events[day]->len;
- event_num++) {
- e_day_view_main_item_draw_day_event (dvmitem, drawable,
- x, y, width, height,
- day, event_num);
- }
-}
-
-
-static void
-e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem,
- GdkDrawable *drawable,
- int x, int y, int width, int height,
- gint day, gint event_num)
-{
- EDayView *day_view;
- EDayViewEvent *event;
- gint item_x, item_y, item_w, item_h, bar_y1, bar_y2;
- GtkStyle *style;
- GdkGC *gc;
- GdkColor bg_color;
- ECalComponent *comp;
- gint num_icons, icon_x, icon_y, icon_x_inc, icon_y_inc;
- gint max_icon_w, max_icon_h;
- gboolean draw_reminder_icon, draw_recurrence_icon, draw_timezone_icon, draw_meeting_icon;
- GSList *categories_list, *elem;
- ECalComponentTransparency transparency;
-
- day_view = dvmitem->day_view;
-
- /* If the event is currently being dragged, don't draw it. It will
- be drawn in the special drag items. */
- if (day_view->drag_event_day == day
- && day_view->drag_event_num == event_num)
- return;
-
- style = GTK_WIDGET (day_view)->style;
-
- gc = day_view->main_gc;
-
- /* Get the position of the event. If it is not shown skip it.*/
- if (!e_day_view_get_event_position (day_view, day, event_num,
- &item_x, &item_y,
- &item_w, &item_h))
- return;
-
- item_x -= x;
- item_y -= y;
-
- event = &g_array_index (day_view->events[day], EDayViewEvent,
- event_num);
-
- /* Fill in the event background. Note that for events in the first
- column of the day, we might not want to paint over the vertical bar,
- since that is used for multiple events. But then you can't see
- where the event in the first column finishes. */
-
- if (gdk_color_parse (e_cal_model_get_color_for_component (e_calendar_view_get_model (E_CALENDAR_VIEW (day_view)), event->comp_data),
- &bg_color)) {
- GdkColormap *colormap;
-
- colormap = gtk_widget_get_colormap (GTK_WIDGET (day_view));
- if (gdk_colormap_alloc_color (colormap, &bg_color, TRUE, TRUE))
- gdk_gc_set_foreground (gc, &bg_color);
- }
-
-#if 1
- if (event->start_row_or_col == 0)
- gdk_draw_rectangle (drawable, gc, TRUE,
- item_x + E_DAY_VIEW_BAR_WIDTH, item_y + 1,
- MAX (item_w - E_DAY_VIEW_BAR_WIDTH - 1, 0),
- item_h - 2);
- else
-#endif
- gdk_draw_rectangle (drawable, gc, TRUE,
- item_x + 1, item_y + 1,
- MAX (item_w - 2, 0), item_h - 2);
-
- gdk_gc_set_foreground (gc, &day_view->colors[E_DAY_VIEW_COLOR_EVENT_VBAR]);
-
- /* Draw the right edge of the vertical bar. */
- gdk_draw_line (drawable, style->black_gc,
- item_x + E_DAY_VIEW_BAR_WIDTH - 1,
- item_y + 1,
- item_x + E_DAY_VIEW_BAR_WIDTH - 1,
- item_y + item_h - 2);
-
- /* Draw the vertical colored bar showing when the appointment
- begins & ends. */
- bar_y1 = event->start_minute * day_view->row_height / day_view->mins_per_row - y;
- bar_y2 = event->end_minute * day_view->row_height / day_view->mins_per_row - y;
-
- /* When an item is being resized, we fill the bar up to the new row. */
- if (day_view->resize_drag_pos != E_CALENDAR_VIEW_POS_NONE
- && day_view->resize_event_day == day
- && day_view->resize_event_num == event_num) {
- if (day_view->resize_drag_pos == E_CALENDAR_VIEW_POS_TOP_EDGE)
- bar_y1 = item_y + 1;
- else if (day_view->resize_drag_pos == E_CALENDAR_VIEW_POS_BOTTOM_EDGE)
- bar_y2 = item_y + item_h - 1;
- }
-
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
-
- /* Only fill it in if the event isn't TRANSPARENT. */
- e_cal_component_get_transparency (comp, &transparency);
- if (transparency != E_CAL_COMPONENT_TRANSP_TRANSPARENT) {
- gdk_draw_rectangle (drawable, gc, TRUE,
- item_x + 1, bar_y1,
- E_DAY_VIEW_BAR_WIDTH - 2, bar_y2 - bar_y1);
- }
-
- /* Draw the box around the entire event. Do this after drawing
- the colored bar so we don't have to worry about being 1
- pixel out. */
- gdk_draw_rectangle (drawable, style->black_gc, FALSE,
- item_x, item_y, MAX (item_w - 1, 0), item_h - 1);
-
-#if 0
- /* Draw the horizontal bars above and beneath the event if it
- is currently being edited. */
- if (day_view->editing_event_day == day
- && day_view->editing_event_num == event_num) {
- gdk_draw_rectangle (drawable, gc, TRUE,
- item_x,
- item_y - E_DAY_VIEW_BAR_HEIGHT,
- item_w,
- E_DAY_VIEW_BAR_HEIGHT);
- gdk_draw_rectangle (drawable, gc, TRUE,
- item_x, item_y + item_h,
- item_w, E_DAY_VIEW_BAR_HEIGHT);
- }
-#endif
-
- /* Draw the reminder & recurrence icons, if needed. */
- num_icons = 0;
- draw_reminder_icon = FALSE;
- draw_recurrence_icon = FALSE;
- draw_timezone_icon = FALSE;
- draw_meeting_icon = FALSE;
- icon_x = item_x + E_DAY_VIEW_BAR_WIDTH + E_DAY_VIEW_ICON_X_PAD;
- icon_y = item_y + E_DAY_VIEW_EVENT_BORDER_HEIGHT
- + E_DAY_VIEW_ICON_Y_PAD;
-
- if (e_cal_component_has_alarms (comp)) {
- draw_reminder_icon = TRUE;
- num_icons++;
- }
-
- if (e_cal_component_has_recurrences (comp)) {
- draw_recurrence_icon = TRUE;
- num_icons++;
- }
-
- /* If the DTSTART or DTEND are in a different timezone to our current
- timezone, we display the timezone icon. */
- if (event->different_timezone) {
- draw_timezone_icon = TRUE;
- num_icons++;
- }
-
- if (e_cal_component_has_organizer (comp)) {
- draw_meeting_icon = TRUE;
- num_icons++;
- }
-
- e_cal_component_get_categories_list (comp, &categories_list);
- for (elem = categories_list; elem; elem = elem->next) {
- char *category;
- GdkPixmap *pixmap = NULL;
- GdkBitmap *mask = NULL;
-
- category = (char *) elem->data;
- if (e_categories_config_get_icon_for (category, &pixmap, &mask))
- num_icons++;
- }
-
- if (num_icons != 0) {
- if (item_h >= (E_DAY_VIEW_ICON_HEIGHT + E_DAY_VIEW_ICON_Y_PAD)
- * num_icons) {
- icon_x_inc = 0;
- icon_y_inc = E_DAY_VIEW_ICON_HEIGHT
- + E_DAY_VIEW_ICON_Y_PAD;
- } else {
- icon_x_inc = E_DAY_VIEW_ICON_WIDTH
- + E_DAY_VIEW_ICON_X_PAD;
- icon_y_inc = 0;
- }
-
- if (draw_reminder_icon) {
- max_icon_w = item_x + item_w - icon_x
- - E_DAY_VIEW_EVENT_BORDER_WIDTH;
- max_icon_h = item_y + item_h - icon_y
- - E_DAY_VIEW_EVENT_BORDER_HEIGHT;
-
- gdk_gc_set_clip_origin (gc, icon_x, icon_y);
- gdk_gc_set_clip_mask (gc, day_view->reminder_mask);
- gdk_draw_pixmap (drawable, gc,
- day_view->reminder_icon,
- 0, 0, icon_x, icon_y,
- MIN (E_DAY_VIEW_ICON_WIDTH,
- max_icon_w),
- MIN (E_DAY_VIEW_ICON_HEIGHT,
- max_icon_h));
- icon_x += icon_x_inc;
- icon_y += icon_y_inc;
- }
-
- if (draw_recurrence_icon) {
- max_icon_w = item_x + item_w - icon_x
- - E_DAY_VIEW_EVENT_BORDER_WIDTH;
- max_icon_h = item_y + item_h - icon_y
- - E_DAY_VIEW_EVENT_BORDER_HEIGHT;
-
- gdk_gc_set_clip_origin (gc, icon_x, icon_y);
- gdk_gc_set_clip_mask (gc, day_view->recurrence_mask);
- gdk_draw_pixmap (drawable, gc,
- day_view->recurrence_icon,
- 0, 0, icon_x, icon_y,
- MIN (E_DAY_VIEW_ICON_WIDTH,
- max_icon_w),
- MIN (E_DAY_VIEW_ICON_HEIGHT,
- max_icon_h));
-
- icon_x += icon_x_inc;
- icon_y += icon_y_inc;
- }
-
- if (draw_timezone_icon) {
- max_icon_w = item_x + item_w - icon_x
- - E_DAY_VIEW_EVENT_BORDER_WIDTH;
- max_icon_h = item_y + item_h - icon_y
- - E_DAY_VIEW_EVENT_BORDER_HEIGHT;
-
- gdk_gc_set_clip_origin (gc, icon_x, icon_y);
- gdk_gc_set_clip_mask (gc, day_view->timezone_mask);
- gdk_draw_pixmap (drawable, gc,
- day_view->timezone_icon,
- 0, 0, icon_x, icon_y,
- MIN (E_DAY_VIEW_ICON_WIDTH,
- max_icon_w),
- MIN (E_DAY_VIEW_ICON_HEIGHT,
- max_icon_h));
- icon_x += icon_x_inc;
- icon_y += icon_y_inc;
- }
-
-
- if (draw_meeting_icon) {
- max_icon_w = item_x + item_w - icon_x
- - E_DAY_VIEW_EVENT_BORDER_WIDTH;
- max_icon_h = item_y + item_h - icon_y
- - E_DAY_VIEW_EVENT_BORDER_HEIGHT;
-
- gdk_gc_set_clip_origin (gc, icon_x, icon_y);
- gdk_gc_set_clip_mask (gc, day_view->meeting_mask);
- gdk_draw_pixmap (drawable, gc,
- day_view->meeting_icon,
- 0, 0, icon_x, icon_y,
- MIN (E_DAY_VIEW_ICON_WIDTH,
- max_icon_w),
- MIN (E_DAY_VIEW_ICON_HEIGHT,
- max_icon_h));
- icon_x += icon_x_inc;
- icon_y += icon_y_inc;
- }
-
- /* draw categories icons */
- for (elem = categories_list; elem; elem = elem->next) {
- char *category;
- GdkPixmap *pixmap = NULL;
- GdkBitmap *mask = NULL;
-
- category = (char *) elem->data;
- if (!e_categories_config_get_icon_for (category, &pixmap, &mask))
- continue;
-
- max_icon_w = item_x + item_w - icon_x
- - E_DAY_VIEW_EVENT_BORDER_WIDTH;
- max_icon_h = item_y + item_h - icon_y
- - E_DAY_VIEW_EVENT_BORDER_HEIGHT;
-
- gdk_gc_set_clip_origin (gc, icon_x, icon_y);
- if (mask != NULL)
- gdk_gc_set_clip_mask (gc, mask);
- gdk_draw_pixmap (drawable, gc,
- pixmap,
- 0, 0, icon_x, icon_y,
- MIN (E_DAY_VIEW_ICON_WIDTH,
- max_icon_w),
- MIN (E_DAY_VIEW_ICON_HEIGHT,
- max_icon_h));
-
- gdk_pixmap_unref (pixmap);
- if (mask != NULL)
- gdk_bitmap_unref (mask);
-
- icon_x += icon_x_inc;
- icon_y += icon_y_inc;
- }
-
- gdk_gc_set_clip_mask (gc, NULL);
- }
-
- /* free memory */
- e_cal_component_free_categories_list (categories_list);
- g_object_unref (comp);
-}
-
-
-/* This is supposed to return the nearest item to the point and the distance.
- Since we are the only item we just return ourself and 0 for the distance.
- This is needed so that we get button/motion events. */
-static double
-e_day_view_main_item_point (GnomeCanvasItem *item, double x, double y,
- int cx, int cy,
- GnomeCanvasItem **actual_item)
-{
- *actual_item = item;
- return 0.0;
-}
-
-
-static gint
-e_day_view_main_item_event (GnomeCanvasItem *item, GdkEvent *event)
-{
- EDayViewMainItem *dvtitem;
-
- dvtitem = E_DAY_VIEW_MAIN_ITEM (item);
-
- switch (event->type) {
- case GDK_BUTTON_PRESS:
-
- case GDK_BUTTON_RELEASE:
-
- case GDK_MOTION_NOTIFY:
-
- default:
- break;
- }
-
- return FALSE;
-}
-
-
diff --git a/calendar/gui/e-day-view-main-item.h b/calendar/gui/e-day-view-main-item.h
deleted file mode 100644
index be7f130606..0000000000
--- a/calendar/gui/e-day-view-main-item.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Author :
- * Damon Chaplin <damon@ximian.com>
- *
- * Copyright 1999, Ximian, Inc.
- * Copyright 1999, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-#ifndef _E_DAY_VIEW_MAIN_ITEM_H_
-#define _E_DAY_VIEW_MAIN_ITEM_H_
-
-#include "e-day-view.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-/*
- * EDayViewMainItem - canvas item which displays most of the appointment
- * data in the main Day/Work Week display.
- */
-
-#define E_DAY_VIEW_MAIN_ITEM(obj) (GTK_CHECK_CAST((obj), \
- e_day_view_main_item_get_type (), EDayViewMainItem))
-#define E_DAY_VIEW_MAIN_ITEM_CLASS(k) (GTK_CHECK_CLASS_CAST ((k),\
- e_day_view_main_item_get_type ()))
-#define E_IS_DAY_VIEW_MAIN_ITEM(o) (GTK_CHECK_TYPE((o), \
- e_day_view_main_item_get_type ()))
-
-typedef struct {
- GnomeCanvasItem canvas_item;
-
- /* The parent EDayView widget. */
- EDayView *day_view;
-} EDayViewMainItem;
-
-typedef struct {
- GnomeCanvasItemClass parent_class;
-
-} EDayViewMainItemClass;
-
-
-GtkType e_day_view_main_item_get_type (void);
-
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _E_DAY_VIEW_MAIN_ITEM_H_ */
diff --git a/calendar/gui/e-day-view-time-item.c b/calendar/gui/e-day-view-time-item.c
deleted file mode 100644
index d70b0fd861..0000000000
--- a/calendar/gui/e-day-view-time-item.c
+++ /dev/null
@@ -1,671 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Author :
- * Damon Chaplin <damon@ximian.com>
- *
- * Copyright 1999, Ximian, Inc.
- * Copyright 1999, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-/*
- * EDayViewTimeItem - canvas item which displays the times down the left of
- * the EDayView.
- */
-
-#include <config.h>
-#include <string.h>
-#include <glib.h>
-#include <gtk/gtksignal.h>
-#include <gtk/gtkradiomenuitem.h>
-#include <gtk/gtkcheckmenuitem.h>
-#include <libgnome/gnome-i18n.h>
-#include <gal/widgets/e-gui-utils.h>
-#include "e-day-view-time-item.h"
-#include "calendar-config.h"
-
-
-/* The spacing between items in the time column. GRID_X_PAD is the space down
- either side of the column, i.e. outside the main horizontal grid lines.
- HOUR_L_PAD & HOUR_R_PAD are the spaces on the left & right side of the
- big hour number (this is inside the horizontal grid lines).
- MIN_X_PAD is the spacing either side of the minute number. The smaller
- horizontal grid lines match with this.
- 60_MIN_X_PAD is the space either side of the HH:MM display used when
- we are displaying 60 mins per row (inside the main grid lines).
- LARGE_HOUR_Y_PAD is the offset of the large hour string from the top of the
- row.
- SMALL_FONT_Y_PAD is the offset of the small time/minute string from the top
- of the row. */
-#define E_DVTMI_TIME_GRID_X_PAD 4
-#define E_DVTMI_HOUR_L_PAD 4
-#define E_DVTMI_HOUR_R_PAD 2
-#define E_DVTMI_MIN_X_PAD 2
-#define E_DVTMI_60_MIN_X_PAD 4
-#define E_DVTMI_LARGE_HOUR_Y_PAD 1
-#define E_DVTMI_SMALL_FONT_Y_PAD 1
-
-static void e_day_view_time_item_class_init (EDayViewTimeItemClass *class);
-static void e_day_view_time_item_init (EDayViewTimeItem *dvtmitem);
-static void e_day_view_time_item_set_arg (GtkObject *o,
- GtkArg *arg,
- guint arg_id);
-
-static void e_day_view_time_item_update (GnomeCanvasItem *item,
- double *affine,
- ArtSVP *clip_path, int flags);
-static void e_day_view_time_item_draw (GnomeCanvasItem *item,
- GdkDrawable *drawable,
- int x, int y,
- int width, int height);
-static double e_day_view_time_item_point (GnomeCanvasItem *item,
- double x, double y,
- int cx, int cy,
- GnomeCanvasItem **actual_item);
-static gint e_day_view_time_item_event (GnomeCanvasItem *item,
- GdkEvent *event);
-static void e_day_view_time_item_increment_time (gint *hour,
- gint *minute,
- gint mins_per_row);
-static void e_day_view_time_item_show_popup_menu (EDayViewTimeItem *dvtmitem,
- GdkEvent *event);
-static void e_day_view_time_item_on_set_divisions (GtkWidget *item,
- EDayViewTimeItem *dvtmitem);
-static void e_day_view_time_item_on_button_press (EDayViewTimeItem *dvtmitem,
- GdkEvent *event);
-static void e_day_view_time_item_on_button_release (EDayViewTimeItem *dvtmitem,
- GdkEvent *event);
-static void e_day_view_time_item_on_motion_notify (EDayViewTimeItem *dvtmitem,
- GdkEvent *event);
-static gint e_day_view_time_item_convert_position_to_row (EDayViewTimeItem *dvtmitem,
- gint y);
-
-
-static GnomeCanvasItemClass *parent_class;
-
-
-/* The arguments we take */
-enum {
- ARG_0,
- ARG_DAY_VIEW
-};
-
-E_MAKE_TYPE (e_day_view_time_item, "EDayViewTimeItem", EDayViewTimeItem,
- e_day_view_time_item_class_init, e_day_view_time_item_init, GNOME_TYPE_CANVAS_ITEM);
-
-static void
-e_day_view_time_item_class_init (EDayViewTimeItemClass *class)
-{
- GtkObjectClass *object_class;
- GnomeCanvasItemClass *item_class;
-
- parent_class = g_type_class_peek_parent (class);
-
- object_class = (GtkObjectClass *) class;
- item_class = (GnomeCanvasItemClass *) class;
-
- gtk_object_add_arg_type ("EDayViewTimeItem::day_view",
- GTK_TYPE_POINTER, GTK_ARG_WRITABLE,
- ARG_DAY_VIEW);
-
- object_class->set_arg = e_day_view_time_item_set_arg;
-
- /* GnomeCanvasItem method overrides */
- item_class->update = e_day_view_time_item_update;
- item_class->draw = e_day_view_time_item_draw;
- item_class->point = e_day_view_time_item_point;
- item_class->event = e_day_view_time_item_event;
-}
-
-
-static void
-e_day_view_time_item_init (EDayViewTimeItem *dvtmitem)
-{
- dvtmitem->dragging_selection = FALSE;
-}
-
-
-static void
-e_day_view_time_item_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
-{
- GnomeCanvasItem *item;
- EDayViewTimeItem *dvtmitem;
-
- item = GNOME_CANVAS_ITEM (o);
- dvtmitem = E_DAY_VIEW_TIME_ITEM (o);
-
- switch (arg_id){
- case ARG_DAY_VIEW:
- dvtmitem->day_view = GTK_VALUE_POINTER (*arg);
- break;
- }
-}
-
-
-static void
-e_day_view_time_item_update (GnomeCanvasItem *item,
- double *affine,
- ArtSVP *clip_path,
- int flags)
-{
- if (GNOME_CANVAS_ITEM_CLASS (parent_class)->update)
- (* GNOME_CANVAS_ITEM_CLASS (parent_class)->update) (item, affine, clip_path, flags);
-
- /* The item covers the entire canvas area. */
- item->x1 = 0;
- item->y1 = 0;
- item->x2 = INT_MAX;
- item->y2 = INT_MAX;
-}
-
-
-/* Returns the minimum width needed for the column, by adding up all the
- maximum widths of the strings. The string widths are all calculated in
- the style_set handlers of EDayView and EDayViewTimeCanvas. */
-gint
-e_day_view_time_item_get_column_width (EDayViewTimeItem *dvtmitem)
-{
- EDayView *day_view;
- GtkStyle *style;
- gint digit, large_digit_width, max_large_digit_width = 0;
- gint max_suffix_width, max_minute_or_suffix_width;
- gint column_width_default, column_width_60_min_rows;
- PangoContext *context;
-
- day_view = dvtmitem->day_view;
- g_return_val_if_fail (day_view != NULL, 0);
-
- style = gtk_widget_get_style (GTK_WIDGET (day_view));
- g_return_val_if_fail (style != NULL, 0);
-
- context = gtk_widget_get_pango_context (GTK_WIDGET (day_view));
-
- /* Find the maximum width a digit can have. FIXME: We could use pango's
- * approximation function, but I worry it won't be precise enough. Also
- * it needs a language tag that I don't know where to get. */
- for (digit = '0'; digit <= '9'; digit++) {
- PangoLayout *layout;
- gchar digit_str [2];
-
- digit_str [0] = digit;
- digit_str [1] = '\0';
-
- layout = gtk_widget_create_pango_layout (GTK_WIDGET (day_view), digit_str);
- pango_layout_set_font_description (layout, day_view->large_font_desc);
- pango_layout_get_pixel_size (layout, &large_digit_width, NULL);
- g_object_unref (layout);
-
- max_large_digit_width = MAX (max_large_digit_width,
- large_digit_width);
- }
-
- /* Calculate the width of each time column, using the maximum of the
- default format with large hour numbers, and the 60-min divisions
- format which uses small text. */
- max_suffix_width = MAX (day_view->am_string_width,
- day_view->pm_string_width);
-
- max_minute_or_suffix_width = MAX (max_suffix_width,
- day_view->max_minute_width);
-
- column_width_default = max_large_digit_width * 2
- + max_minute_or_suffix_width
- + E_DVTMI_MIN_X_PAD * 2
- + E_DVTMI_HOUR_L_PAD
- + E_DVTMI_HOUR_R_PAD
- + E_DVTMI_TIME_GRID_X_PAD * 2;
-
- column_width_60_min_rows = day_view->max_small_hour_width
- + day_view->colon_width
- + max_minute_or_suffix_width
- + E_DVTMI_60_MIN_X_PAD * 2
- + E_DVTMI_TIME_GRID_X_PAD * 2;
-
- dvtmitem->column_width = MAX (column_width_default,
- column_width_60_min_rows);
-
- return dvtmitem->column_width;
-}
-
-
-/*
- * DRAWING ROUTINES - functions to paint the canvas item.
- */
-
-static void
-e_day_view_time_item_draw (GnomeCanvasItem *canvas_item,
- GdkDrawable *drawable,
- int x,
- int y,
- int width,
- int height)
-{
- EDayView *day_view;
- EDayViewTimeItem *dvtmitem;
- GtkStyle *style;
- GdkGC *fg_gc, *dark_gc;
- gchar buffer[64], *suffix;
- gint hour, display_hour, minute, row;
- gint row_y, start_y, large_hour_y_offset, small_font_y_offset;
- gint long_line_x1, long_line_x2, short_line_x1;
- gint large_hour_x2, minute_x2;
- gint hour_width, minute_width, suffix_width;
- gint max_suffix_width, max_minute_or_suffix_width;
- PangoLayout *layout;
- PangoContext *context;
- PangoFontDescription *small_font_desc;
- PangoFontMetrics *large_font_metrics, *small_font_metrics;
-
- dvtmitem = E_DAY_VIEW_TIME_ITEM (canvas_item);
- day_view = dvtmitem->day_view;
- g_return_if_fail (day_view != NULL);
-
- style = gtk_widget_get_style (GTK_WIDGET (day_view));
- small_font_desc = style->font_desc;
-
- context = gtk_widget_get_pango_context (GTK_WIDGET (day_view));
- large_font_metrics = pango_context_get_metrics (context, day_view->large_font_desc,
- pango_context_get_language (context));
- small_font_metrics = pango_context_get_metrics (context, small_font_desc,
- pango_context_get_language (context));
-
- fg_gc = style->fg_gc[GTK_STATE_NORMAL];
- dark_gc = style->dark_gc[GTK_STATE_NORMAL];
-
- /* The start and end of the long horizontal line between hours. */
- long_line_x1 = E_DVTMI_TIME_GRID_X_PAD - x;
- long_line_x2 = dvtmitem->column_width - E_DVTMI_TIME_GRID_X_PAD - x;
-
- if (day_view->mins_per_row == 60) {
- /* The right edge of the complete time string in 60-min
- divisions, e.g. "14:00" or "2 pm". */
- minute_x2 = long_line_x2 - E_DVTMI_60_MIN_X_PAD;
-
- /* These aren't used for 60-minute divisions, but we initialize
- them to keep gcc happy. */
- short_line_x1 = 0;
- large_hour_x2 = 0;
- } else {
- max_suffix_width = MAX (day_view->am_string_width,
- day_view->pm_string_width);
-
- max_minute_or_suffix_width = MAX (max_suffix_width,
- day_view->max_minute_width);
-
- /* The start of the short horizontal line between the periods
- within each hour. */
- short_line_x1 = long_line_x2 - E_DVTMI_MIN_X_PAD * 2
- - max_minute_or_suffix_width;
-
- /* The right edge of the large hour string. */
- large_hour_x2 = short_line_x1 - E_DVTMI_HOUR_R_PAD;
-
- /* The right edge of the minute part of the time. */
- minute_x2 = long_line_x2 - E_DVTMI_MIN_X_PAD;
- }
-
- /* Start with the first hour & minute shown in the EDayView. */
- hour = day_view->first_hour_shown;
- minute = day_view->first_minute_shown;
-
- /* The offset of the large hour string from the top of the row. */
- large_hour_y_offset = E_DVTMI_LARGE_HOUR_Y_PAD;
-
- /* The offset of the small time/minute string from top of row. */
- small_font_y_offset = E_DVTMI_SMALL_FONT_Y_PAD;
-
- /* Calculate the minimum y position of the first row we need to draw.
- This is normally one row height above the 0 position, but if we
- are using the large font we may have to go back a bit further. */
- start_y = 0 - MAX (day_view->row_height,
- (pango_font_metrics_get_ascent (large_font_metrics) +
- pango_font_metrics_get_descent (large_font_metrics)) / PANGO_SCALE +
- E_DVTMI_LARGE_HOUR_Y_PAD);
-
- /* Step through each row, drawing the times and the horizontal lines
- between them. */
- for (row = 0, row_y = 0 - y;
- row < day_view->rows && row_y < height;
- row++, row_y += day_view->row_height) {
-
- /* If the row is above the first row we want to draw just
- increment the time and skip to the next row. */
- if (row_y < start_y) {
- e_day_view_time_item_increment_time (&hour, &minute,
- day_view->mins_per_row);
- continue;
- }
-
- /* Calculate the actual hour number to display. For 12-hour
- format we convert 0-23 to 12-11am/12-11pm. */
- e_day_view_convert_time_to_display (day_view, hour,
- &display_hour,
- &suffix, &suffix_width);
-
- if (day_view->mins_per_row == 60) {
- /* 60 minute intervals - draw a long horizontal line
- between hours and display as one long string,
- e.g. "14:00" or "2 pm". */
- gdk_draw_line (drawable, dark_gc,
- long_line_x1, row_y,
- long_line_x2, row_y);
-
- if (e_calendar_view_get_use_24_hour_format (E_CALENDAR_VIEW (day_view))) {
- g_snprintf (buffer, sizeof (buffer), "%i:%02i",
- display_hour, minute);
- } else {
- g_snprintf (buffer, sizeof (buffer), "%i %s",
- display_hour, suffix);
- }
-
- layout = gtk_widget_create_pango_layout (GTK_WIDGET (day_view), buffer);
- pango_layout_get_pixel_size (layout, &minute_width, NULL);
- gdk_draw_layout (drawable, fg_gc,
- minute_x2 - minute_width,
- row_y + small_font_y_offset,
- layout);
- g_object_unref (layout);
- } else {
- /* 5/10/15/30 minute intervals. */
-
- if (minute == 0) {
- /* On the hour - draw a long horizontal line
- before the hour and display the hour in the
- large font. */
- gdk_draw_line (drawable, dark_gc,
- long_line_x1, row_y,
- long_line_x2, row_y);
-
- g_snprintf (buffer, sizeof (buffer), "%i",
- display_hour);
-
- layout = gtk_widget_create_pango_layout (GTK_WIDGET (day_view), buffer);
- pango_layout_set_font_description (layout, day_view->large_font_desc);
- pango_layout_get_pixel_size (layout, &hour_width, NULL);
- gdk_draw_layout (drawable, fg_gc,
- large_hour_x2 - hour_width,
- row_y + large_hour_y_offset,
- layout);
- g_object_unref (layout);
- } else {
- /* Within the hour - draw a short line before
- the time. */
- gdk_draw_line (drawable, dark_gc,
- short_line_x1, row_y,
- long_line_x2, row_y);
- }
-
- /* Normally we display the minute in each
- interval, but when using 30-minute intervals
- we don't display the '30'. */
- if (day_view->mins_per_row != 30 || minute != 30) {
- /* In 12-hour format we display 'am' or 'pm'
- instead of '00'. */
- if (minute == 0
- && !e_calendar_view_get_use_24_hour_format (E_CALENDAR_VIEW (day_view))) {
- strcpy (buffer, suffix);
- } else {
- g_snprintf (buffer, sizeof (buffer),
- "%02i", minute);
- }
-
- layout = gtk_widget_create_pango_layout (GTK_WIDGET (day_view), buffer);
- pango_layout_get_pixel_size (layout, &minute_width, NULL);
- gdk_draw_layout (drawable, fg_gc,
- minute_x2 - minute_width,
- row_y + small_font_y_offset,
- layout);
- g_object_unref (layout);
- }
- }
-
- e_day_view_time_item_increment_time (&hour, &minute,
- day_view->mins_per_row);
- }
-
- pango_font_metrics_unref (large_font_metrics);
- pango_font_metrics_unref (small_font_metrics);
-}
-
-
-/* Increment the time by the 5/10/15/30/60 minute interval.
- Note that mins_per_row is never > 60, so we never have to
- worry about adding more than 60 minutes. */
-static void
-e_day_view_time_item_increment_time (gint *hour,
- gint *minute,
- gint mins_per_row)
-{
- *minute += mins_per_row;
- if (*minute >= 60) {
- *minute -= 60;
- /* Currently we never wrap around to the next day, but
- we may do if we display extra timezones. */
- *hour = (*hour + 1) % 24;
- }
-}
-
-
-static double
-e_day_view_time_item_point (GnomeCanvasItem *item, double x, double y,
- int cx, int cy,
- GnomeCanvasItem **actual_item)
-{
- *actual_item = item;
- return 0.0;
-}
-
-
-static gint
-e_day_view_time_item_event (GnomeCanvasItem *item,
- GdkEvent *event)
-{
- EDayViewTimeItem *dvtmitem;
-
- dvtmitem = E_DAY_VIEW_TIME_ITEM (item);
-
- switch (event->type) {
- case GDK_BUTTON_PRESS:
- if (event->button.button == 1) {
- e_day_view_time_item_on_button_press (dvtmitem, event);
- } else if (event->button.button == 3) {
- e_day_view_time_item_show_popup_menu (dvtmitem, event);
- return TRUE;
- }
- break;
- case GDK_BUTTON_RELEASE:
- if (event->button.button == 1)
- e_day_view_time_item_on_button_release (dvtmitem,
- event);
- break;
-
- case GDK_MOTION_NOTIFY:
- e_day_view_time_item_on_motion_notify (dvtmitem, event);
- break;
-
- default:
- break;
- }
-
- return FALSE;
-}
-
-
-static void
-e_day_view_time_item_show_popup_menu (EDayViewTimeItem *dvtmitem,
- GdkEvent *event)
-{
- static gint divisions[] = { 60, 30, 15, 10, 5 };
- EDayView *day_view;
- gint num_divisions = sizeof (divisions) / sizeof (divisions[0]);
- GtkWidget *menu, *item;
- gchar buffer[256];
- GSList *group = NULL;
- gint current_divisions, i;
-
- day_view = dvtmitem->day_view;
- g_return_if_fail (day_view != NULL);
-
- current_divisions = e_day_view_get_mins_per_row (day_view);
-
- menu = gtk_menu_new ();
-
- /* Make sure the menu is destroyed when it disappears. */
- e_auto_kill_popup_menu_on_selection_done (GTK_MENU (menu));
-
- for (i = 0; i < num_divisions; i++) {
- g_snprintf (buffer, sizeof (buffer),
- _("%02i minute divisions"), divisions[i]);
- item = gtk_radio_menu_item_new_with_label (group, buffer);
- group = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (item));
- gtk_widget_show (item);
- gtk_menu_append (GTK_MENU (menu), item);
-
- if (current_divisions == divisions[i])
- gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE);
-
- g_object_set_data (G_OBJECT (item), "divisions",
- GINT_TO_POINTER (divisions[i]));
-
- g_signal_connect (item, "toggled",
- G_CALLBACK (e_day_view_time_item_on_set_divisions), dvtmitem);
- }
-
- gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL,
- event->button.button, event->button.time);
-}
-
-
-static void
-e_day_view_time_item_on_set_divisions (GtkWidget *item,
- EDayViewTimeItem *dvtmitem)
-{
- EDayView *day_view;
- gint divisions;
-
- day_view = dvtmitem->day_view;
- g_return_if_fail (day_view != NULL);
-
- if (!gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (item)))
- return;
-
- divisions = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "divisions"));
- e_day_view_set_mins_per_row (day_view, divisions);
- calendar_config_set_time_divisions (divisions);
-}
-
-
-static void
-e_day_view_time_item_on_button_press (EDayViewTimeItem *dvtmitem,
- GdkEvent *event)
-{
- EDayView *day_view;
- GnomeCanvas *canvas;
- gint row;
-
- day_view = dvtmitem->day_view;
- g_return_if_fail (day_view != NULL);
-
- canvas = GNOME_CANVAS_ITEM (dvtmitem)->canvas;
-
- row = e_day_view_time_item_convert_position_to_row (dvtmitem,
- event->button.y);
-
- if (row == -1)
- return;
-
- if (!GTK_WIDGET_HAS_FOCUS (day_view))
- gtk_widget_grab_focus (GTK_WIDGET (day_view));
-
- if (gdk_pointer_grab (GTK_LAYOUT (canvas)->bin_window, FALSE,
- GDK_POINTER_MOTION_MASK
- | GDK_BUTTON_RELEASE_MASK,
- FALSE, NULL, event->button.time) == 0) {
- e_day_view_start_selection (day_view, -1, row);
- dvtmitem->dragging_selection = TRUE;
- }
-}
-
-
-static void
-e_day_view_time_item_on_button_release (EDayViewTimeItem *dvtmitem,
- GdkEvent *event)
-{
- EDayView *day_view;
-
- day_view = dvtmitem->day_view;
- g_return_if_fail (day_view != NULL);
-
- if (dvtmitem->dragging_selection) {
- gdk_pointer_ungrab (event->button.time);
- e_day_view_finish_selection (day_view);
- e_day_view_stop_auto_scroll (day_view);
- }
-
- dvtmitem->dragging_selection = FALSE;
-}
-
-
-static void
-e_day_view_time_item_on_motion_notify (EDayViewTimeItem *dvtmitem,
- GdkEvent *event)
-{
- EDayView *day_view;
- GnomeCanvas *canvas;
- gdouble window_y;
- gint y, row;
-
- if (!dvtmitem->dragging_selection)
- return;
-
- day_view = dvtmitem->day_view;
- g_return_if_fail (day_view != NULL);
-
- canvas = GNOME_CANVAS_ITEM (dvtmitem)->canvas;
-
- y = event->motion.y;
- row = e_day_view_time_item_convert_position_to_row (dvtmitem, y);
-
- if (row != -1) {
- gnome_canvas_world_to_window (canvas, 0, event->motion.y,
- NULL, &window_y);
- e_day_view_update_selection (day_view, -1, row);
- e_day_view_check_auto_scroll (day_view, -1, (gint) window_y);
- }
-}
-
-
-/* Returns the row corresponding to the y position, or -1. */
-static gint
-e_day_view_time_item_convert_position_to_row (EDayViewTimeItem *dvtmitem,
- gint y)
-{
- EDayView *day_view;
- gint row;
-
- day_view = dvtmitem->day_view;
- g_return_val_if_fail (day_view != NULL, -1);
-
- if (y < 0)
- return -1;
-
- row = y / day_view->row_height;
- if (row >= day_view->rows)
- return -1;
-
- return row;
-}
diff --git a/calendar/gui/e-day-view-time-item.h b/calendar/gui/e-day-view-time-item.h
deleted file mode 100644
index f425363c98..0000000000
--- a/calendar/gui/e-day-view-time-item.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Author :
- * Damon Chaplin <damon@ximian.com>
- *
- * Copyright 1999, Ximian, Inc.
- * Copyright 1999, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-#ifndef _E_DAY_VIEW_TIME_ITEM_H_
-#define _E_DAY_VIEW_TIME_ITEM_H_
-
-#include "e-day-view.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-/*
- * EDayViewTimeItem - canvas item which displays the times down the left of
- * the EDayView.
- */
-
-#define E_DAY_VIEW_TIME_ITEM(obj) (GTK_CHECK_CAST((obj), \
- e_day_view_time_item_get_type (), EDayViewTimeItem))
-#define E_DAY_VIEW_TIME_ITEM_CLASS(k) (GTK_CHECK_CLASS_CAST ((k),\
- e_day_view_time_item_get_type ()))
-#define E_IS_DAY_VIEW_TIME_ITEM(o) (GTK_CHECK_TYPE((o), \
- e_day_view_time_item_get_type ()))
-
-typedef struct {
- GnomeCanvasItem canvas_item;
-
- /* The parent EDayView widget. */
- EDayView *day_view;
-
- /* The width of the time column. */
- gint column_width;
-
- /* TRUE if we are currently dragging the selection times. */
- gboolean dragging_selection;
-} EDayViewTimeItem;
-
-typedef struct {
- GnomeCanvasItemClass parent_class;
-
-} EDayViewTimeItemClass;
-
-
-GtkType e_day_view_time_item_get_type (void);
-
-
-gint e_day_view_time_item_get_column_width (EDayViewTimeItem *dvtmitem);
-
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _E_DAY_VIEW_TIME_ITEM_H_ */
diff --git a/calendar/gui/e-day-view-top-item.c b/calendar/gui/e-day-view-top-item.c
deleted file mode 100644
index d2f60d7e7d..0000000000
--- a/calendar/gui/e-day-view-top-item.c
+++ /dev/null
@@ -1,701 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Author :
- * Damon Chaplin <damon@ximian.com>
- *
- * Copyright 1999, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-/*
- * EDayViewTopItem - displays the top part of the Day/Work Week calendar view.
- */
-
-#include <config.h>
-#include <glib.h>
-#include <libgnome/gnome-i18n.h>
-#include <gal/util/e-util.h>
-#include "e-util/e-categories-config.h"
-#include <libecal/e-cal-time-util.h>
-#include "e-day-view-top-item.h"
-
-static void e_day_view_top_item_class_init (EDayViewTopItemClass *class);
-static void e_day_view_top_item_init (EDayViewTopItem *dvtitem);
-
-static void e_day_view_top_item_set_arg (GtkObject *o,
- GtkArg *arg,
- guint arg_id);
-static void e_day_view_top_item_update (GnomeCanvasItem *item,
- double *affine,
- ArtSVP *clip_path,
- int flags);
-static void e_day_view_top_item_draw (GnomeCanvasItem *item,
- GdkDrawable *drawable,
- int x,
- int y,
- int width,
- int height);
-static void e_day_view_top_item_draw_long_event (EDayViewTopItem *dvtitem,
- gint event_num,
- GdkDrawable *drawable,
- int x,
- int y,
- int width,
- int height);
-static void e_day_view_top_item_draw_triangle (EDayViewTopItem *dvtitem,
- GdkDrawable *drawable,
- gint x,
- gint y,
- gint w,
- gint h);
-static double e_day_view_top_item_point (GnomeCanvasItem *item,
- double x,
- double y,
- int cx,
- int cy,
- GnomeCanvasItem **actual_item);
-static gint e_day_view_top_item_event (GnomeCanvasItem *item,
- GdkEvent *event);
-
-
-static GnomeCanvasItemClass *parent_class;
-
-/* The arguments we take */
-enum {
- ARG_0,
- ARG_DAY_VIEW
-};
-
-E_MAKE_TYPE (e_day_view_top_item, "EDayViewTopItem", EDayViewTopItem, e_day_view_top_item_class_init,
- e_day_view_top_item_init, GNOME_TYPE_CANVAS_ITEM);
-
-static void
-e_day_view_top_item_class_init (EDayViewTopItemClass *class)
-{
- GtkObjectClass *object_class;
- GnomeCanvasItemClass *item_class;
-
- parent_class = g_type_class_peek_parent (class);
-
- object_class = (GtkObjectClass *) class;
- item_class = (GnomeCanvasItemClass *) class;
-
- gtk_object_add_arg_type ("EDayViewTopItem::day_view",
- GTK_TYPE_POINTER, GTK_ARG_WRITABLE,
- ARG_DAY_VIEW);
-
- object_class->set_arg = e_day_view_top_item_set_arg;
-
- /* GnomeCanvasItem method overrides */
- item_class->update = e_day_view_top_item_update;
- item_class->draw = e_day_view_top_item_draw;
- item_class->point = e_day_view_top_item_point;
- item_class->event = e_day_view_top_item_event;
-}
-
-
-static void
-e_day_view_top_item_init (EDayViewTopItem *dvtitem)
-{
- dvtitem->day_view = NULL;
-}
-
-
-static void
-e_day_view_top_item_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
-{
- GnomeCanvasItem *item;
- EDayViewTopItem *dvtitem;
-
- item = GNOME_CANVAS_ITEM (o);
- dvtitem = E_DAY_VIEW_TOP_ITEM (o);
-
- switch (arg_id){
- case ARG_DAY_VIEW:
- dvtitem->day_view = GTK_VALUE_POINTER (*arg);
- break;
- }
-}
-
-
-static void
-e_day_view_top_item_update (GnomeCanvasItem *item,
- double *affine,
- ArtSVP *clip_path,
- int flags)
-{
- if (GNOME_CANVAS_ITEM_CLASS (parent_class)->update)
- (* GNOME_CANVAS_ITEM_CLASS (parent_class)->update) (item, affine, clip_path, flags);
-
- /* The item covers the entire canvas area. */
- item->x1 = 0;
- item->y1 = 0;
- item->x2 = INT_MAX;
- item->y2 = INT_MAX;
-}
-
-
-/*
- * DRAWING ROUTINES - functions to paint the canvas item.
- */
-
-static void
-e_day_view_top_item_draw (GnomeCanvasItem *canvas_item,
- GdkDrawable *drawable,
- int x,
- int y,
- int width,
- int height)
-{
- EDayViewTopItem *dvtitem;
- EDayView *day_view;
- GtkStyle *style;
- GdkGC *gc, *fg_gc, *bg_gc, *light_gc, *dark_gc;
- gchar buffer[128];
- GdkRectangle clip_rect;
- gint canvas_width, canvas_height, left_edge, day, date_width, date_x;
- gint item_height, event_num;
- PangoLayout *layout;
-
-#if 0
- g_print ("In e_day_view_top_item_draw %i,%i %ix%i\n",
- x, y, width, height);
-#endif
- dvtitem = E_DAY_VIEW_TOP_ITEM (canvas_item);
- day_view = dvtitem->day_view;
- g_return_if_fail (day_view != NULL);
-
- style = gtk_widget_get_style (GTK_WIDGET (day_view));
- gc = day_view->main_gc;
- fg_gc = style->fg_gc[GTK_STATE_NORMAL];
- bg_gc = style->bg_gc[GTK_STATE_NORMAL];
- light_gc = style->light_gc[GTK_STATE_NORMAL];
- dark_gc = style->dark_gc[GTK_STATE_NORMAL];
- canvas_width = GTK_WIDGET (canvas_item->canvas)->allocation.width;
- canvas_height = GTK_WIDGET (canvas_item->canvas)->allocation.height;
- left_edge = 0;
- item_height = day_view->top_row_height - E_DAY_VIEW_TOP_CANVAS_Y_GAP;
-
- /* Draw the shadow around the dates. */
- gdk_draw_line (drawable, light_gc,
- left_edge - x, 1 - y,
- canvas_width - 2 - x, 1 - y);
- gdk_draw_line (drawable, light_gc,
- left_edge - x, 2 - y,
- left_edge - x, item_height - 2 - y);
- gdk_draw_line (drawable, dark_gc,
- left_edge - x, item_height - 1 - y,
- canvas_width - 1 - x, item_height - 1 - y);
- gdk_draw_line (drawable, dark_gc,
- canvas_width - 1 - x, 1 - y,
- canvas_width - 1 - x, item_height - 1 - y);
-
- /* Draw the background for the dates. */
- gdk_draw_rectangle (drawable, bg_gc, TRUE,
- left_edge + 2 - x, 2 - y,
- canvas_width - left_edge - 3,
- item_height - 3);
-
- /* Clear the main area background. */
- gdk_gc_set_foreground (gc, &day_view->colors[E_DAY_VIEW_COLOR_BG_TOP_CANVAS]);
- gdk_draw_rectangle (drawable, gc, TRUE,
- left_edge - x, item_height - y,
- canvas_width - left_edge,
- canvas_height - item_height);
-
- /* Draw the selection background. */
- if (GTK_WIDGET_HAS_FOCUS (day_view)
- && day_view->selection_start_day != -1) {
- gint start_col, end_col, rect_x, rect_y, rect_w, rect_h;
-
- start_col = day_view->selection_start_day;
- end_col = day_view->selection_end_day;
-
- if (end_col > start_col
- || day_view->selection_start_row == -1
- || day_view->selection_end_row == -1) {
- rect_x = day_view->day_offsets[start_col];
- rect_y = item_height;
- rect_w = day_view->day_offsets[end_col + 1] - rect_x;
- rect_h = canvas_height - 1 - rect_y;
-
- gdk_gc_set_foreground (gc, &day_view->colors[E_DAY_VIEW_COLOR_BG_TOP_CANVAS_SELECTED]);
- gdk_draw_rectangle (drawable, gc, TRUE,
- rect_x - x, rect_y - y,
- rect_w, rect_h);
- }
- }
-
- /* Draw the date. Set a clipping rectangle so we don't draw over the
- next day. */
- for (day = 0; day < day_view->days_shown; day++) {
- e_day_view_top_item_get_day_label (day_view, day,
- buffer, sizeof (buffer));
- clip_rect.x = day_view->day_offsets[day] - x;
- clip_rect.y = 2 - y;
- clip_rect.width = day_view->day_widths[day];
- clip_rect.height = item_height - 2;
- gdk_gc_set_clip_rectangle (fg_gc, &clip_rect);
-
- layout = gtk_widget_create_pango_layout (GTK_WIDGET (day_view), buffer);
- pango_layout_get_pixel_size (layout, &date_width, NULL);
- date_x = day_view->day_offsets[day] + (day_view->day_widths[day] - date_width) / 2;
-
- gdk_draw_layout (drawable, fg_gc,
- date_x - x,
- 3 - y,
- layout);
- g_object_unref (layout);
-
- gdk_gc_set_clip_rectangle (fg_gc, NULL);
-
- /* Draw the lines down the left and right of the date cols. */
- if (day != 0) {
- gdk_draw_line (drawable, light_gc,
- day_view->day_offsets[day] - x,
- 4 - y,
- day_view->day_offsets[day] - x,
- item_height - 4 - y);
-
- gdk_draw_line (drawable, dark_gc,
- day_view->day_offsets[day] - 1 - x,
- 4 - y,
- day_view->day_offsets[day] - 1 - x,
- item_height - 4 - y);
- }
-
- /* Draw the lines between each column. */
- if (day != 0) {
- gdk_gc_set_foreground (gc, &day_view->colors[E_DAY_VIEW_COLOR_BG_TOP_CANVAS_GRID]);
- gdk_draw_line (drawable, gc,
- day_view->day_offsets[day] - x,
- item_height - y,
- day_view->day_offsets[day] - x,
- canvas_height - y);
- }
- }
-
- /* Draw the long events. */
- for (event_num = 0; event_num < day_view->long_events->len;
- event_num++) {
- e_day_view_top_item_draw_long_event (dvtitem, event_num,
- drawable,
- x, y, width, height);
- }
-}
-
-
-/* This draws one event in the top canvas. */
-static void
-e_day_view_top_item_draw_long_event (EDayViewTopItem *dvtitem,
- gint event_num,
- GdkDrawable *drawable,
- int x,
- int y,
- int width,
- int height)
-{
- EDayView *day_view;
- EDayViewEvent *event;
- GtkStyle *style;
- GdkGC *gc, *fg_gc, *bg_gc;
- gint start_day, end_day;
- gint item_x, item_y, item_w, item_h;
- gint text_x, icon_x, icon_y, icon_x_inc;
- ECalComponent *comp;
- gchar buffer[16];
- gint hour, display_hour, minute, offset, time_width, time_x;
- gint min_end_time_x, suffix_width, max_icon_x;
- gchar *suffix;
- gboolean draw_start_triangle, draw_end_triangle;
- GdkRectangle clip_rect;
- GSList *categories_list, *elem;
- PangoLayout *layout;
- GdkColor bg_color;
-
- day_view = dvtitem->day_view;
-
- /* If the event is currently being dragged, don't draw it. It will
- be drawn in the special drag items. */
- if (day_view->drag_event_day == E_DAY_VIEW_LONG_EVENT
- && day_view->drag_event_num == event_num)
- return;
-
- if (!e_day_view_get_long_event_position (day_view, event_num,
- &start_day, &end_day,
- &item_x, &item_y,
- &item_w, &item_h))
- return;
-
- event = &g_array_index (day_view->long_events, EDayViewEvent,
- event_num);
-
- style = gtk_widget_get_style (GTK_WIDGET (day_view));
- gc = day_view->main_gc;
- fg_gc = style->fg_gc[GTK_STATE_NORMAL];
- bg_gc = style->bg_gc[GTK_STATE_NORMAL];
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
-
- /* Draw the lines across the top & bottom of the entire event. */
- gdk_gc_set_foreground (gc, &day_view->colors[E_DAY_VIEW_COLOR_LONG_EVENT_BORDER]);
- gdk_draw_line (drawable, gc,
- item_x - x, item_y - y,
- item_x + item_w - 1 - x, item_y - y);
- gdk_draw_line (drawable, gc,
- item_x - x, item_y + item_h - 1 - y,
- item_x + item_w - 1 - x, item_y + item_h - 1 - y);
-
- /* Fill it in. */
- if (gdk_color_parse (e_cal_model_get_color_for_component (e_calendar_view_get_model (E_CALENDAR_VIEW (day_view)),
- event->comp_data),
- &bg_color)) {
- GdkColormap *colormap;
-
- colormap = gtk_widget_get_colormap (GTK_WIDGET (day_view));
- if (gdk_colormap_alloc_color (colormap, &bg_color, TRUE, TRUE))
- gdk_gc_set_foreground (gc, &bg_color);
- else
- gdk_gc_set_foreground (gc, &day_view->colors[E_DAY_VIEW_COLOR_LONG_EVENT_BACKGROUND]);
- } else
- gdk_gc_set_foreground (gc, &day_view->colors[E_DAY_VIEW_COLOR_LONG_EVENT_BACKGROUND]);
- gdk_draw_rectangle (drawable, gc, TRUE,
- item_x - x, item_y + 1 - y,
- item_w, item_h - 2);
-
- /* When resizing we don't draw the triangles.*/
- draw_start_triangle = TRUE;
- draw_end_triangle = TRUE;
- if (day_view->resize_drag_pos != E_CALENDAR_VIEW_POS_NONE
- && day_view->resize_event_day == E_DAY_VIEW_LONG_EVENT
- && day_view->resize_event_num == event_num) {
- if (day_view->resize_drag_pos == E_CALENDAR_VIEW_POS_LEFT_EDGE)
- draw_start_triangle = FALSE;
-
- if (day_view->resize_drag_pos == E_CALENDAR_VIEW_POS_RIGHT_EDGE)
- draw_end_triangle = FALSE;
- }
-
- /* If the event starts before the first day shown, draw a triangle,
- else just draw a vertical line down the left. */
- if (draw_start_triangle
- && event->start < day_view->day_starts[start_day]) {
- e_day_view_top_item_draw_triangle (dvtitem, drawable,
- item_x - x, item_y - y,
- -E_DAY_VIEW_BAR_WIDTH,
- item_h);
- } else {
- gdk_gc_set_foreground (gc, &day_view->colors[E_DAY_VIEW_COLOR_LONG_EVENT_BORDER]);
- gdk_draw_line (drawable, gc,
- item_x - x, item_y - y,
- item_x - x, item_y + item_h - 1 - y);
- }
-
- /* Similar for the event end. */
- if (draw_end_triangle
- && event->end > day_view->day_starts[end_day + 1]) {
- e_day_view_top_item_draw_triangle (dvtitem, drawable,
- item_x + item_w - 1 - x,
- item_y - y,
- E_DAY_VIEW_BAR_WIDTH,
- item_h);
- } else {
- gdk_gc_set_foreground (gc, &day_view->colors[E_DAY_VIEW_COLOR_LONG_EVENT_BORDER]);
- gdk_draw_line (drawable, gc,
- item_x + item_w - 1 - x,
- item_y - y,
- item_x + item_w - 1 - x,
- item_y + item_h - 1 - y);
- }
-
- /* If we are editing the event we don't show the icons or the start
- & end times. */
- if (day_view->editing_event_day == E_DAY_VIEW_LONG_EVENT
- && day_view->editing_event_num == event_num)
- return;
-
- /* Determine the position of the label, so we know where to place the
- icons. Note that since the top canvas never scrolls we don't need
- to take the scroll offset into account. It will always be 0. */
- text_x = event->canvas_item->x1;
-
- /* Draw the start & end times, if necessary. */
- min_end_time_x = item_x + E_DAY_VIEW_LONG_EVENT_X_PAD - x;
-
- time_width = e_day_view_get_time_string_width (day_view);
-
- if (event->start > day_view->day_starts[start_day]) {
- offset = day_view->first_hour_shown * 60
- + day_view->first_minute_shown + event->start_minute;
- hour = offset / 60;
- minute = offset % 60;
- /* Calculate the actual hour number to display. For 12-hour
- format we convert 0-23 to 12-11am/12-11pm. */
- e_day_view_convert_time_to_display (day_view, hour,
- &display_hour,
- &suffix, &suffix_width);
- if (e_calendar_view_get_use_24_hour_format (E_CALENDAR_VIEW (day_view))) {
- g_snprintf (buffer, sizeof (buffer), "%i:%02i",
- display_hour, minute);
- } else {
- g_snprintf (buffer, sizeof (buffer), "%i:%02i%s",
- display_hour, minute, suffix);
- }
-
- clip_rect.x = item_x - x;
- clip_rect.y = item_y - y;
- clip_rect.width = item_w - E_DAY_VIEW_LONG_EVENT_BORDER_WIDTH;
- clip_rect.height = item_h;
- gdk_gc_set_clip_rectangle (fg_gc, &clip_rect);
-
- time_x = item_x + E_DAY_VIEW_LONG_EVENT_X_PAD - x;
- if (display_hour < 10)
- time_x += day_view->digit_width;
-
- layout = gtk_widget_create_pango_layout (GTK_WIDGET (day_view), buffer);
- gdk_draw_layout (drawable, fg_gc,
- time_x,
- item_y + E_DAY_VIEW_LONG_EVENT_BORDER_HEIGHT +
- E_DAY_VIEW_LONG_EVENT_Y_PAD - y,
- layout);
- g_object_unref (layout);
-
- gdk_gc_set_clip_rectangle (fg_gc, NULL);
-
- min_end_time_x += time_width
- + E_DAY_VIEW_LONG_EVENT_TIME_X_PAD;
- }
-
- max_icon_x = item_x + item_w - E_DAY_VIEW_LONG_EVENT_X_PAD
- - E_DAY_VIEW_ICON_WIDTH;
-
- if (event->end < day_view->day_starts[end_day + 1]) {
- offset = day_view->first_hour_shown * 60
- + day_view->first_minute_shown
- + event->end_minute;
- hour = offset / 60;
- minute = offset % 60;
- time_x = item_x + item_w - E_DAY_VIEW_LONG_EVENT_X_PAD - time_width - E_DAY_VIEW_LONG_EVENT_TIME_X_PAD - x;
-
- if (time_x >= min_end_time_x) {
- /* Calculate the actual hour number to display. */
- e_day_view_convert_time_to_display (day_view, hour,
- &display_hour,
- &suffix,
- &suffix_width);
- if (e_calendar_view_get_use_24_hour_format (E_CALENDAR_VIEW (day_view))) {
- g_snprintf (buffer, sizeof (buffer),
- "%i:%02i", display_hour, minute);
- } else {
- g_snprintf (buffer, sizeof (buffer),
- "%i:%02i%s", display_hour, minute,
- suffix);
- }
-
- if (display_hour < 10)
- time_x += day_view->digit_width;
-
- layout = gtk_widget_create_pango_layout (GTK_WIDGET (day_view), buffer);
- gdk_draw_layout (drawable, fg_gc,
- time_x,
- item_y + E_DAY_VIEW_LONG_EVENT_Y_PAD + 1 - y,
- layout);
- g_object_unref (layout);
-
- max_icon_x -= time_width + E_DAY_VIEW_LONG_EVENT_TIME_X_PAD;
- }
- }
-
- /* Draw the icons. */
- icon_x_inc = E_DAY_VIEW_ICON_WIDTH + E_DAY_VIEW_ICON_X_PAD;
- icon_x = text_x - E_DAY_VIEW_LONG_EVENT_ICON_R_PAD
- - icon_x_inc - x;
- icon_y = item_y + E_DAY_VIEW_LONG_EVENT_BORDER_HEIGHT
- + E_DAY_VIEW_ICON_Y_PAD - y;
-
- if (icon_x <= max_icon_x && e_cal_component_has_recurrences (comp)) {
- gdk_gc_set_clip_origin (gc, icon_x, icon_y);
- gdk_gc_set_clip_mask (gc, day_view->recurrence_mask);
- gdk_draw_pixmap (drawable, gc,
- day_view->recurrence_icon,
- 0, 0, icon_x, icon_y,
- E_DAY_VIEW_ICON_WIDTH,
- E_DAY_VIEW_ICON_HEIGHT);
- icon_x -= icon_x_inc;
- }
-
- if (icon_x <= max_icon_x && e_cal_component_has_alarms (comp)) {
- gdk_gc_set_clip_origin (gc, icon_x, icon_y);
- gdk_gc_set_clip_mask (gc, day_view->reminder_mask);
- gdk_draw_pixmap (drawable, gc,
- day_view->reminder_icon,
- 0, 0, icon_x, icon_y,
- E_DAY_VIEW_ICON_WIDTH,
- E_DAY_VIEW_ICON_HEIGHT);
- icon_x -= icon_x_inc;
- }
-
- /* draw categories icons */
- e_cal_component_get_categories_list (comp, &categories_list);
- for (elem = categories_list; elem; elem = elem->next) {
- char *category;
- GdkPixmap *pixmap = NULL;
- GdkBitmap *mask = NULL;
-
- category = (char *) elem->data;
- e_categories_config_get_icon_for (category, &pixmap, &mask);
- if (pixmap == NULL)
- continue;
-
- if (icon_x <= max_icon_x) {
- gdk_gc_set_clip_origin (gc, icon_x, icon_y);
- if (mask != NULL)
- gdk_gc_set_clip_mask (gc, mask);
- gdk_draw_pixmap (drawable, gc,
- pixmap,
- 0, 0, icon_x, icon_y,
- E_DAY_VIEW_ICON_WIDTH,
- E_DAY_VIEW_ICON_HEIGHT);
- icon_x -= icon_x_inc;
- }
-
- gdk_pixmap_unref (pixmap);
- if (mask != NULL)
- gdk_bitmap_unref (mask);
- }
-
- e_cal_component_free_categories_list (categories_list);
- g_object_unref (comp);
-
- gdk_gc_set_clip_mask (gc, NULL);
-}
-
-
-/* This draws a little triangle to indicate that an event extends past
- the days visible on screen. */
-static void
-e_day_view_top_item_draw_triangle (EDayViewTopItem *dvtitem,
- GdkDrawable *drawable,
- gint x,
- gint y,
- gint w,
- gint h)
-{
- EDayView *day_view;
- GtkStyle *style;
- GdkGC *gc;
- GdkPoint points[3];
- gint c1, c2;
-
- day_view = dvtitem->day_view;
-
- style = GTK_WIDGET (day_view)->style;
- gc = day_view->main_gc;
-
- points[0].x = x;
- points[0].y = y;
- points[1].x = x + w;
- points[1].y = y + (h / 2) - 1;
- points[2].x = x;
- points[2].y = y + h - 1;
-
- /* If the height is odd we can use the same central point for both
- lines. If it is even we use different end-points. */
- c1 = c2 = y + (h / 2);
- if (h % 2 == 0)
- c1--;
-
- gdk_gc_set_foreground (gc, &day_view->colors[E_DAY_VIEW_COLOR_LONG_EVENT_BACKGROUND]);
- gdk_draw_polygon (drawable, gc, TRUE, points, 3);
-
- gdk_gc_set_foreground (gc, &day_view->colors[E_DAY_VIEW_COLOR_LONG_EVENT_BORDER]);
- gdk_draw_line (drawable, gc, x, y, x + w, c1);
- gdk_draw_line (drawable, gc, x, y + h - 1, x + w, c2);
-}
-
-
-/* This is supposed to return the nearest item the the point and the distance.
- Since we are the only item we just return ourself and 0 for the distance.
- This is needed so that we get button/motion events. */
-static double
-e_day_view_top_item_point (GnomeCanvasItem *item, double x, double y,
- int cx, int cy,
- GnomeCanvasItem **actual_item)
-{
- *actual_item = item;
- return 0.0;
-}
-
-
-static gint
-e_day_view_top_item_event (GnomeCanvasItem *item, GdkEvent *event)
-{
- EDayViewTopItem *dvtitem;
-
- dvtitem = E_DAY_VIEW_TOP_ITEM (item);
-
- switch (event->type) {
- case GDK_BUTTON_PRESS:
-
- case GDK_BUTTON_RELEASE:
-
- case GDK_MOTION_NOTIFY:
-
- default:
- break;
- }
-
- return FALSE;
-}
-
-void
-e_day_view_top_item_get_day_label (EDayView *day_view, gint day,
- gchar *buffer, gint buffer_len)
-{
- struct icaltimetype day_start_tt;
- struct tm day_start = { 0 };
- gchar *format;
-
- day_start_tt = icaltime_from_timet_with_zone (day_view->day_starts[day],
- FALSE,
- e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
- day_start.tm_year = day_start_tt.year - 1900;
- day_start.tm_mon = day_start_tt.month - 1;
- day_start.tm_mday = day_start_tt.day;
- day_start.tm_isdst = -1;
-
- day_start.tm_wday = time_day_of_week (day_start_tt.day,
- day_start_tt.month - 1,
- day_start_tt.year);
-
- if (day_view->date_format == E_DAY_VIEW_DATE_FULL)
- /* strftime format %A = full weekday name, %d = day of month,
- %B = full month name. Don't use any other specifiers. */
- format = _("%A %d %B");
- else if (day_view->date_format == E_DAY_VIEW_DATE_ABBREVIATED)
- /* strftime format %a = abbreviated weekday name, %d = day of month,
- %b = abbreviated month name. Don't use any other specifiers. */
- format = _("%a %d %b");
- else if (day_view->date_format == E_DAY_VIEW_DATE_NO_WEEKDAY)
- /* strftime format %d = day of month, %b = abbreviated month name.
- Don't use any other specifiers. */
- format = _("%d %b");
- else
- format = "%d";
-
- e_utf8_strftime (buffer, buffer_len, format, &day_start);
-}
diff --git a/calendar/gui/e-day-view-top-item.h b/calendar/gui/e-day-view-top-item.h
deleted file mode 100644
index 9b8342af99..0000000000
--- a/calendar/gui/e-day-view-top-item.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Author :
- * Damon Chaplin <damon@ximian.com>
- *
- * Copyright 1999, Ximian, Inc.
- * Copyright 1999, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-#ifndef _E_DAY_VIEW_TOP_ITEM_H_
-#define _E_DAY_VIEW_TOP_ITEM_H_
-
-#include "e-day-view.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-/*
- * EDayViewTopItem - displays the top part of the Day/Work Week calendar view.
- */
-
-#define E_DAY_VIEW_TOP_ITEM(obj) (GTK_CHECK_CAST((obj), \
- e_day_view_top_item_get_type (), EDayViewTopItem))
-#define E_DAY_VIEW_TOP_ITEM_CLASS(k) (GTK_CHECK_CLASS_CAST ((k),\
- e_day_view_top_item_get_type ()))
-#define E_IS_DAY_VIEW_TOP_ITEM(o) (GTK_CHECK_TYPE((o), \
- e_day_view_top_item_get_type ()))
-
-typedef struct {
- GnomeCanvasItem canvas_item;
-
- /* The parent EDayView widget. */
- EDayView *day_view;
-} EDayViewTopItem;
-
-typedef struct {
- GnomeCanvasItemClass parent_class;
-
-} EDayViewTopItemClass;
-
-
-GtkType e_day_view_top_item_get_type (void);
-void e_day_view_top_item_get_day_label (EDayView *day_view, gint day,
- gchar *buffer, gint buffer_len);
-
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _E_DAY_VIEW_TOP_ITEM_H_ */
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
deleted file mode 100644
index 0c08468a7d..0000000000
--- a/calendar/gui/e-day-view.c
+++ /dev/null
@@ -1,7229 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Authors :
- * Damon Chaplin <damon@ximian.com>
- * Rodrigo Moya <rodrigo@ximian.com>
- *
- * Copyright 1999-2003, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-/*
- * EDayView - displays the Day & Work-Week views of the calendar.
- */
-
-#include <config.h>
-
-#include "e-day-view.h"
-#include "ea-calendar.h"
-
-#include <math.h>
-#include <time.h>
-#include <gdk/gdkkeysyms.h>
-#include <gdk/gdkx.h>
-#include <gtk/gtkdnd.h>
-#include <gtk/gtkmain.h>
-#include <gtk/gtksignal.h>
-#include <gtk/gtkvscrollbar.h>
-#include <gtk/gtkwindow.h>
-#include <gal/e-text/e-text.h>
-#include <gal/widgets/e-canvas-utils.h>
-#include <gal/widgets/e-popup-menu.h>
-#include <gal/widgets/e-gui-utils.h>
-#include <gal/widgets/e-unicode.h>
-#include <gal/util/e-util.h>
-#include <libgnomecanvas/gnome-canvas-rect-ellipse.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnome/gnome-exec.h>
-#include <libgnome/gnome-util.h>
-#include <e-util/e-categories-config.h>
-#include <e-util/e-dialog-utils.h>
-
-#include <libecal/e-cal-time-util.h>
-#include "dialogs/delete-comp.h"
-#include "dialogs/delete-error.h"
-#include "dialogs/send-comp.h"
-#include "dialogs/cancel-comp.h"
-#include "dialogs/recur-comp.h"
-#include "print.h"
-#include "comp-util.h"
-#include "itip-utils.h"
-#include "calendar-commands.h"
-#include "calendar-config.h"
-#include "goto.h"
-#include "e-cal-model-calendar.h"
-#include "e-day-view-time-item.h"
-#include "e-day-view-top-item.h"
-#include "e-day-view-layout.h"
-#include "e-day-view-main-item.h"
-#include "misc.h"
-
-/* Images */
-#include "art/bell.xpm"
-#include "art/recur.xpm"
-#include "art/timezone-16.xpm"
-#include "art/schedule-meeting-16.xpm"
-
-/* The minimum amount of space wanted on each side of the date string. */
-#define E_DAY_VIEW_DATE_X_PAD 4
-
-#define E_DAY_VIEW_LARGE_FONT_PTSIZE 18
-
-/* The offset from the top/bottom of the canvas before auto-scrolling starts.*/
-#define E_DAY_VIEW_AUTO_SCROLL_OFFSET 16
-
-/* The time between each auto-scroll, in milliseconds. */
-#define E_DAY_VIEW_AUTO_SCROLL_TIMEOUT 50
-
-/* The number of timeouts we skip before we start scrolling. */
-#define E_DAY_VIEW_AUTO_SCROLL_DELAY 5
-
-/* The number of pixels the mouse has to be moved with the button down before
- we start a drag. */
-#define E_DAY_VIEW_DRAG_START_OFFSET 4
-
-/* The amount we scroll the main canvas when the Page Up/Down keys are pressed,
- as a fraction of the page size. */
-#define E_DAY_VIEW_PAGE_STEP 0.5
-
-/* The amount we scroll the main canvas when the mouse wheel buttons are
- pressed, as a fraction of the page size. */
-#define E_DAY_VIEW_WHEEL_MOUSE_STEP_SIZE 0.25
-
-/* The timeout before we do a layout, so we don't do a layout for each event
- we get from the server. */
-#define E_DAY_VIEW_LAYOUT_TIMEOUT 100
-
-typedef struct {
- EDayView *day_view;
- ECalModelComponent *comp_data;
-} AddEventData;
-
-/* Drag and Drop stuff. */
-enum {
- TARGET_CALENDAR_EVENT,
- TARGET_VCALENDAR
-};
-static GtkTargetEntry target_table[] = {
- { "application/x-e-calendar-event", 0, TARGET_CALENDAR_EVENT },
- { "text/x-calendar", 0, TARGET_VCALENDAR },
- { "text/calendar", 0, TARGET_VCALENDAR }
-};
-static guint n_targets = sizeof(target_table) / sizeof(target_table[0]);
-
-static void e_day_view_class_init (EDayViewClass *class);
-static void e_day_view_init (EDayView *day_view);
-static void e_day_view_destroy (GtkObject *object);
-static void e_day_view_realize (GtkWidget *widget);
-static void e_day_view_unrealize (GtkWidget *widget);
-static void e_day_view_style_set (GtkWidget *widget,
- GtkStyle *previous_style);
-static void e_day_view_size_allocate (GtkWidget *widget,
- GtkAllocation *allocation);
-static gboolean e_day_view_update_scroll_regions (EDayView *day_view);
-static gint e_day_view_focus_in (GtkWidget *widget,
- GdkEventFocus *event);
-static gint e_day_view_focus_out (GtkWidget *widget,
- GdkEventFocus *event);
-static gboolean e_day_view_key_press (GtkWidget *widget,
- GdkEventKey *event);
-static gboolean e_day_view_focus (GtkWidget *widget,
- GtkDirectionType direction);
-static gboolean e_day_view_get_next_tab_event (EDayView *day_view,
- GtkDirectionType direction,
- gint *day, gint *event_num);
-static gboolean e_day_view_get_extreme_long_event (EDayView *day_view,
- gboolean first,
- gint *day_out,
- gint *event_num_out);
-static gboolean e_day_view_get_extreme_event (EDayView *day_view,
- gint start_day,
- gint end_day,
- gboolean first,
- gint *day_out,
- gint *event_num_out);
-static gboolean e_day_view_do_key_press (GtkWidget *widget,
- GdkEventKey *event);
-static gboolean e_day_view_popup_menu (GtkWidget *widget);
-static GList *e_day_view_get_selected_events (ECalendarView *cal_view);
-static void e_day_view_get_selected_time_range (ECalendarView *cal_view, time_t *start_time, time_t *end_time);
-static void e_day_view_set_selected_time_range (ECalendarView *cal_view, time_t start_time, time_t end_time);
-static gboolean e_day_view_get_visible_time_range (ECalendarView *cal_view, time_t *start_time, time_t *end_time);
-static void e_day_view_update_query (ECalendarView *cal_view);
-static void e_day_view_goto_start_of_work_day (EDayView *day_view);
-static void e_day_view_goto_end_of_work_day (EDayView *day_view);
-static void e_day_view_change_duration_to_start_of_work_day (EDayView *day_view);
-static void e_day_view_change_duration_to_end_of_work_day (EDayView *day_view);
-static void e_day_view_cursor_key_up_shifted (EDayView *day_view,
- GdkEventKey *event);
-static void e_day_view_cursor_key_down_shifted (EDayView *day_view,
- GdkEventKey *event);
-static void e_day_view_cursor_key_left_shifted (EDayView *day_view,
- GdkEventKey *event);
-static void e_day_view_cursor_key_right_shifted (EDayView *day_view,
- GdkEventKey *event);
-static void e_day_view_cursor_key_up (EDayView *day_view,
- GdkEventKey *event);
-static void e_day_view_cursor_key_down (EDayView *day_view,
- GdkEventKey *event);
-static void e_day_view_cursor_key_left (EDayView *day_view,
- GdkEventKey *event);
-static void e_day_view_cursor_key_right (EDayView *day_view,
- GdkEventKey *event);
-static void e_day_view_scroll (EDayView *day_view,
- gfloat pages_to_scroll);
-
-static gboolean e_day_view_check_if_new_event_fits (EDayView *day_view);
-
-static void e_day_view_on_canvas_realized (GtkWidget *widget,
- EDayView *day_view);
-
-static gboolean e_day_view_on_top_canvas_button_press (GtkWidget *widget,
- GdkEventButton *event,
- EDayView *day_view);
-static gboolean e_day_view_on_top_canvas_button_release (GtkWidget *widget,
- GdkEventButton *event,
- EDayView *day_view);
-static gboolean e_day_view_on_top_canvas_motion (GtkWidget *widget,
- GdkEventMotion *event,
- EDayView *day_view);
-
-static gboolean e_day_view_on_main_canvas_button_press (GtkWidget *widget,
- GdkEventButton *event,
- EDayView *day_view);
-static gboolean e_day_view_on_main_canvas_button_release (GtkWidget *widget,
- GdkEventButton *event,
- EDayView *day_view);
-static gboolean e_day_view_on_main_canvas_scroll (GtkWidget *widget,
- GdkEventScroll *scroll,
- EDayView *day_view);
-
-static gboolean e_day_view_on_time_canvas_scroll (GtkWidget *widget,
- GdkEventScroll *scroll,
- EDayView *day_view);
-
-static gboolean e_day_view_on_main_canvas_motion (GtkWidget *widget,
- GdkEventMotion *event,
- EDayView *day_view);
-static gboolean e_day_view_convert_event_coords (EDayView *day_view,
- GdkEvent *event,
- GdkWindow *window,
- gint *x_return,
- gint *y_return);
-static void e_day_view_update_long_event_resize (EDayView *day_view,
- gint day);
-static void e_day_view_update_resize (EDayView *day_view,
- gint row);
-static void e_day_view_finish_long_event_resize (EDayView *day_view);
-static void e_day_view_finish_resize (EDayView *day_view);
-static void e_day_view_abort_resize (EDayView *day_view,
- guint32 time);
-
-
-static gboolean e_day_view_on_long_event_button_press (EDayView *day_view,
- gint event_num,
- GdkEventButton *event,
- ECalendarViewPosition pos,
- gint event_x,
- gint event_y);
-static gboolean e_day_view_on_event_button_press (EDayView *day_view,
- gint day,
- gint event_num,
- GdkEventButton *event,
- ECalendarViewPosition pos,
- gint event_x,
- gint event_y);
-static void e_day_view_on_long_event_click (EDayView *day_view,
- gint event_num,
- GdkEventButton *bevent,
- ECalendarViewPosition pos,
- gint event_x,
- gint event_y);
-static void e_day_view_on_event_click (EDayView *day_view,
- gint day,
- gint event_num,
- GdkEventButton *event,
- ECalendarViewPosition pos,
- gint event_x,
- gint event_y);
-static void e_day_view_on_event_double_click (EDayView *day_view,
- gint day,
- gint event_num);
-static void e_day_view_on_event_right_click (EDayView *day_view,
- GdkEventButton *bevent,
- gint day,
- gint event_num);
-static void e_day_view_show_popup_menu (EDayView *day_view,
- GdkEvent *gdk_event,
- gint day,
- gint event_num);
-
-
-static void e_day_view_recalc_day_starts (EDayView *day_view,
- time_t start_time);
-static void e_day_view_recalc_num_rows (EDayView *day_view);
-static void e_day_view_recalc_cell_sizes (EDayView *day_view);
-
-static ECalendarViewPosition e_day_view_convert_position_in_top_canvas (EDayView *day_view,
- gint x,
- gint y,
- gint *day_return,
- gint *event_num_return);
-static ECalendarViewPosition e_day_view_convert_position_in_main_canvas (EDayView *day_view,
- gint x,
- gint y,
- gint *day_return,
- gint *row_return,
- gint *event_num_return);
-static gboolean e_day_view_find_event_from_uid (EDayView *day_view,
- const gchar *uid,
- gint *day_return,
- gint *event_num_return);
-
-typedef gboolean (* EDayViewForeachEventCallback) (EDayView *day_view,
- gint day,
- gint event_num,
- gpointer data);
-
-static void e_day_view_foreach_event (EDayView *day_view,
- EDayViewForeachEventCallback callback,
- gpointer data);
-static void e_day_view_foreach_event_with_uid (EDayView *day_view,
- const gchar *uid,
- EDayViewForeachEventCallback callback,
- gpointer data);
-
-static void e_day_view_free_events (EDayView *day_view);
-static void e_day_view_free_event_array (EDayView *day_view,
- GArray *array);
-static int e_day_view_add_event (ECalComponent *comp,
- time_t start,
- time_t end,
- gpointer data);
-static void e_day_view_update_event_label (EDayView *day_view,
- gint day,
- gint event_num);
-static void e_day_view_update_long_event_label (EDayView *day_view,
- gint event_num);
-
-static void e_day_view_reshape_long_events (EDayView *day_view);
-static void e_day_view_reshape_long_event (EDayView *day_view,
- gint event_num);
-static void e_day_view_reshape_day_events (EDayView *day_view,
- gint day);
-static void e_day_view_reshape_day_event (EDayView *day_view,
- gint day,
- gint event_num);
-static void e_day_view_reshape_main_canvas_resize_bars (EDayView *day_view);
-static void e_day_view_reshape_resize_long_event_rect_item (EDayView *day_view);
-static void e_day_view_reshape_resize_rect_item (EDayView *day_view);
-
-static void e_day_view_ensure_events_sorted (EDayView *day_view);
-
-static void e_day_view_start_editing_event (EDayView *day_view,
- gint day,
- gint event_num,
- gchar *initial_text);
-static void e_day_view_stop_editing_event (EDayView *day_view);
-static gboolean e_day_view_on_text_item_event (GnomeCanvasItem *item,
- GdkEvent *event,
- EDayView *day_view);
-static void e_day_view_change_event_end_time_up (EDayView *day_view);
-static void e_day_view_change_event_end_time_down (EDayView *day_view);
-static void e_day_view_on_editing_started (EDayView *day_view,
- GnomeCanvasItem *item);
-static void e_day_view_on_editing_stopped (EDayView *day_view,
- GnomeCanvasItem *item);
-
-static time_t e_day_view_convert_grid_position_to_time (EDayView *day_view,
- gint col,
- gint row);
-static gboolean e_day_view_convert_time_to_grid_position (EDayView *day_view,
- time_t time,
- gint *col,
- gint *row);
-
-static void e_day_view_start_auto_scroll (EDayView *day_view,
- gboolean scroll_up);
-static gboolean e_day_view_auto_scroll_handler (gpointer data);
-
-static EDayViewEvent* e_day_view_get_popup_menu_event (EDayView *day_view);
-
-static gboolean e_day_view_on_top_canvas_drag_motion (GtkWidget *widget,
- GdkDragContext *context,
- gint x,
- gint y,
- guint time,
- EDayView *day_view);
-static void e_day_view_update_top_canvas_drag (EDayView *day_view,
- gint day);
-static void e_day_view_reshape_top_canvas_drag_item (EDayView *day_view);
-static gboolean e_day_view_on_main_canvas_drag_motion (GtkWidget *widget,
- GdkDragContext *context,
- gint x,
- gint y,
- guint time,
- EDayView *day_view);
-static void e_day_view_reshape_main_canvas_drag_item (EDayView *day_view);
-static void e_day_view_update_main_canvas_drag (EDayView *day_view,
- gint row,
- gint day);
-static void e_day_view_on_top_canvas_drag_leave (GtkWidget *widget,
- GdkDragContext *context,
- guint time,
- EDayView *day_view);
-static void e_day_view_on_main_canvas_drag_leave (GtkWidget *widget,
- GdkDragContext *context,
- guint time,
- EDayView *day_view);
-static void e_day_view_on_drag_begin (GtkWidget *widget,
- GdkDragContext *context,
- EDayView *day_view);
-static void e_day_view_on_drag_end (GtkWidget *widget,
- GdkDragContext *context,
- EDayView *day_view);
-static void e_day_view_on_drag_data_get (GtkWidget *widget,
- GdkDragContext *context,
- GtkSelectionData *selection_data,
- guint info,
- guint time,
- EDayView *day_view);
-static void e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget,
- GdkDragContext *context,
- gint x,
- gint y,
- GtkSelectionData *data,
- guint info,
- guint time,
- EDayView *day_view);
-static void e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget,
- GdkDragContext *context,
- gint x,
- gint y,
- GtkSelectionData *data,
- guint info,
- guint time,
- EDayView *day_view);
-
-static gboolean e_day_view_update_event_cb (EDayView *day_view,
- gint day,
- gint event_num,
- gpointer data);
-static gboolean e_day_view_remove_event_cb (EDayView *day_view,
- gint day,
- gint event_num,
- gpointer data);
-static void e_day_view_normalize_selection (EDayView *day_view);
-static gboolean e_day_view_set_show_times_cb (EDayView *day_view,
- gint day,
- gint event_num,
- gpointer data);
-static time_t e_day_view_find_work_week_start (EDayView *day_view,
- time_t start_time);
-static void e_day_view_recalc_work_week (EDayView *day_view);
-static void e_day_view_recalc_work_week_days_shown (EDayView *day_view);
-
-static void e_day_view_queue_layout (EDayView *day_view);
-static void e_day_view_cancel_layout (EDayView *day_view);
-static gboolean e_day_view_layout_timeout_cb (gpointer data);
-
-static GtkTableClass *parent_class;
-
-E_MAKE_TYPE (e_day_view, "EDayView", EDayView, e_day_view_class_init,
- e_day_view_init, e_calendar_view_get_type ());
-
-static void
-e_day_view_class_init (EDayViewClass *class)
-{
- GtkObjectClass *object_class;
- GtkWidgetClass *widget_class;
- ECalendarViewClass *view_class;
-
- parent_class = g_type_class_peek_parent (class);
- object_class = (GtkObjectClass *) class;
- widget_class = (GtkWidgetClass *) class;
- view_class = (ECalendarViewClass *) class;
-
- /* Method override */
- object_class->destroy = e_day_view_destroy;
-
- widget_class->realize = e_day_view_realize;
- widget_class->unrealize = e_day_view_unrealize;
- widget_class->style_set = e_day_view_style_set;
- widget_class->size_allocate = e_day_view_size_allocate;
- widget_class->focus_in_event = e_day_view_focus_in;
- widget_class->focus_out_event = e_day_view_focus_out;
- widget_class->key_press_event = e_day_view_key_press;
- widget_class->focus = e_day_view_focus;
- widget_class->popup_menu = e_day_view_popup_menu;
-
- view_class->get_selected_events = e_day_view_get_selected_events;
- view_class->get_selected_time_range = e_day_view_get_selected_time_range;
- view_class->set_selected_time_range = e_day_view_set_selected_time_range;
- view_class->get_visible_time_range = e_day_view_get_visible_time_range;
- view_class->update_query = e_day_view_update_query;
-
- /* init the accessibility support for e_day_view */
- e_day_view_a11y_init ();
-}
-
-static void
-timezone_changed_cb (ECalendarView *cal_view, icaltimezone *old_zone,
- icaltimezone *new_zone, gpointer user_data)
-{
- struct icaltimetype tt;
- time_t lower;
- EDayView *day_view = (EDayView *) cal_view;
-
- g_return_if_fail (E_IS_DAY_VIEW (day_view));
-
- /* If our time hasn't been set yet, just return. */
- if (day_view->lower == 0 && day_view->upper == 0)
- return;
-
- /* Recalculate the new start of the first day. We just use exactly
- the same time, but with the new timezone. */
- tt = icaltime_from_timet_with_zone (day_view->lower, FALSE,
- old_zone);
-
- lower = icaltime_as_timet_with_zone (tt, new_zone);
-
- e_day_view_recalc_day_starts (day_view, lower);
- e_day_view_update_query ((ECalendarView *) day_view);
-}
-
-static void
-e_day_view_init (EDayView *day_view)
-{
- gint day;
- GnomeCanvasGroup *canvas_group;
-
- GTK_WIDGET_SET_FLAGS (day_view, GTK_CAN_FOCUS);
-
- day_view->query = NULL;
-
- day_view->long_events = g_array_new (FALSE, FALSE,
- sizeof (EDayViewEvent));
- day_view->long_events_sorted = TRUE;
- day_view->long_events_need_layout = FALSE;
- day_view->long_events_need_reshape = FALSE;
-
- day_view->layout_timeout_id = 0;
-
- for (day = 0; day < E_DAY_VIEW_MAX_DAYS; day++) {
- day_view->events[day] = g_array_new (FALSE, FALSE,
- sizeof (EDayViewEvent));
- day_view->events_sorted[day] = TRUE;
- day_view->need_layout[day] = FALSE;
- day_view->need_reshape[day] = FALSE;
- }
-
- /* These indicate that the times haven't been set. */
- day_view->lower = 0;
- day_view->upper = 0;
-
- day_view->work_week_view = FALSE;
- day_view->days_shown = 1;
-
- day_view->mins_per_row = 30;
- day_view->date_format = E_DAY_VIEW_DATE_FULL;
- day_view->rows_in_top_display = 0;
-
- /* Note that these don't work yet. It would need a few fixes to the
- way event->start_minute and event->end_minute are used, and there
- may be problems with events that go outside the visible times. */
- day_view->first_hour_shown = 0;
- day_view->first_minute_shown = 0;
- day_view->last_hour_shown = 24;
- day_view->last_minute_shown = 0;
-
- day_view->main_gc = NULL;
- e_day_view_recalc_num_rows (day_view);
-
- day_view->working_days = E_DAY_VIEW_MONDAY | E_DAY_VIEW_TUESDAY
- | E_DAY_VIEW_WEDNESDAY | E_DAY_VIEW_THURSDAY
- | E_DAY_VIEW_FRIDAY;
-
- day_view->work_day_start_hour = 9;
- day_view->work_day_start_minute = 0;
- day_view->work_day_end_hour = 17;
- day_view->work_day_end_minute = 0;
- day_view->show_event_end_times = TRUE;
- day_view->week_start_day = 0;
- day_view->scroll_to_work_day = TRUE;
-
- day_view->editing_event_day = -1;
- day_view->editing_event_num = -1;
-
- day_view->resize_event_num = -1;
- day_view->resize_bars_event_day = -1;
- day_view->resize_bars_event_num = -1;
-
- day_view->selection_start_row = -1;
- day_view->selection_start_day = -1;
- day_view->selection_end_row = -1;
- day_view->selection_end_day = -1;
- day_view->selection_is_being_dragged = FALSE;
- day_view->selection_drag_pos = E_DAY_VIEW_DRAG_END;
- day_view->selection_in_top_canvas = FALSE;
-
- day_view->resize_drag_pos = E_CALENDAR_VIEW_POS_NONE;
-
- day_view->pressed_event_day = -1;
-
- day_view->drag_event_day = -1;
- day_view->drag_last_day = -1;
-
- day_view->auto_scroll_timeout_id = 0;
-
- day_view->large_font_desc = NULL;
-
- /* String to use in 12-hour time format for times in the morning. */
- day_view->am_string = _("am");
-
- /* String to use in 12-hour time format for times in the afternoon. */
- day_view->pm_string = _("pm");
-
-
- /*
- * Top Canvas
- */
- day_view->top_canvas = e_canvas_new ();
- gtk_table_attach (GTK_TABLE (day_view), day_view->top_canvas,
- 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
- gtk_widget_show (day_view->top_canvas);
- g_signal_connect_after (day_view->top_canvas, "button_press_event",
- G_CALLBACK (e_day_view_on_top_canvas_button_press), day_view);
- g_signal_connect (day_view->top_canvas, "button_release_event",
- G_CALLBACK (e_day_view_on_top_canvas_button_release), day_view);
- g_signal_connect (day_view->top_canvas, "motion_notify_event",
- G_CALLBACK (e_day_view_on_top_canvas_motion), day_view);
- g_signal_connect (day_view->top_canvas, "drag_motion",
- G_CALLBACK (e_day_view_on_top_canvas_drag_motion), day_view);
- g_signal_connect (day_view->top_canvas, "drag_leave",
- G_CALLBACK (e_day_view_on_top_canvas_drag_leave), day_view);
-
- g_signal_connect (day_view->top_canvas, "drag_begin",
- G_CALLBACK (e_day_view_on_drag_begin), day_view);
- g_signal_connect (day_view->top_canvas, "drag_end",
- G_CALLBACK (e_day_view_on_drag_end), day_view);
- g_signal_connect (day_view->top_canvas, "drag_data_get",
- G_CALLBACK (e_day_view_on_drag_data_get), day_view);
- g_signal_connect (day_view->top_canvas, "drag_data_received",
- G_CALLBACK (e_day_view_on_top_canvas_drag_data_received), day_view);
-
- canvas_group = GNOME_CANVAS_GROUP (GNOME_CANVAS (day_view->top_canvas)->root);
-
- day_view->top_canvas_item =
- gnome_canvas_item_new (canvas_group,
- e_day_view_top_item_get_type (),
- "EDayViewTopItem::day_view", day_view,
- NULL);
-
- day_view->resize_long_event_rect_item =
- gnome_canvas_item_new (canvas_group,
- gnome_canvas_rect_get_type(),
- "width_pixels", 1,
- NULL);
- gnome_canvas_item_hide (day_view->resize_long_event_rect_item);
-
- day_view->drag_long_event_rect_item =
- gnome_canvas_item_new (canvas_group,
- gnome_canvas_rect_get_type (),
- "width_pixels", 1,
- NULL);
- gnome_canvas_item_hide (day_view->drag_long_event_rect_item);
-
- day_view->drag_long_event_item =
- gnome_canvas_item_new (canvas_group,
- e_text_get_type (),
- "anchor", GTK_ANCHOR_NW,
- "line_wrap", TRUE,
- "clip", TRUE,
- "max_lines", 1,
- "editable", TRUE,
- "draw_background", FALSE,
- "fill_color_rgba", GNOME_CANVAS_COLOR(0, 0, 0),
- NULL);
- gnome_canvas_item_hide (day_view->drag_long_event_item);
-
- /*
- * Main Canvas
- */
- day_view->main_canvas = e_canvas_new ();
- gtk_table_attach (GTK_TABLE (day_view), day_view->main_canvas,
- 1, 2, 1, 2,
- GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
- gtk_widget_show (day_view->main_canvas);
- g_signal_connect (day_view->main_canvas, "realize",
- G_CALLBACK (e_day_view_on_canvas_realized), day_view);
-
- g_signal_connect (day_view->main_canvas,
- "button_press_event",
- G_CALLBACK (e_day_view_on_main_canvas_button_press),
- day_view);
- g_signal_connect (day_view->main_canvas,
- "button_release_event",
- G_CALLBACK (e_day_view_on_main_canvas_button_release),
- day_view);
- g_signal_connect (day_view->main_canvas,
- "scroll_event",
- G_CALLBACK (e_day_view_on_main_canvas_scroll),
- day_view);
- g_signal_connect (day_view->main_canvas,
- "motion_notify_event",
- G_CALLBACK (e_day_view_on_main_canvas_motion),
- day_view);
- g_signal_connect (day_view->main_canvas,
- "drag_motion",
- G_CALLBACK (e_day_view_on_main_canvas_drag_motion),
- day_view);
- g_signal_connect (day_view->main_canvas,
- "drag_leave",
- G_CALLBACK (e_day_view_on_main_canvas_drag_leave),
- day_view);
-
- g_signal_connect (day_view->main_canvas, "drag_begin",
- G_CALLBACK (e_day_view_on_drag_begin), day_view);
- g_signal_connect (day_view->main_canvas, "drag_end",
- G_CALLBACK (e_day_view_on_drag_end), day_view);
- g_signal_connect (day_view->main_canvas, "drag_data_get",
- G_CALLBACK (e_day_view_on_drag_data_get), day_view);
- g_signal_connect (day_view->main_canvas, "drag_data_received",
- G_CALLBACK (e_day_view_on_main_canvas_drag_data_received), day_view);
-
- canvas_group = GNOME_CANVAS_GROUP (GNOME_CANVAS (day_view->main_canvas)->root);
-
- day_view->main_canvas_item =
- gnome_canvas_item_new (canvas_group,
- e_day_view_main_item_get_type (),
- "EDayViewMainItem::day_view", day_view,
- NULL);
-
- day_view->resize_rect_item =
- gnome_canvas_item_new (canvas_group,
- gnome_canvas_rect_get_type(),
- "width_pixels", 1,
- NULL);
- gnome_canvas_item_hide (day_view->resize_rect_item);
-
- day_view->resize_bar_item =
- gnome_canvas_item_new (canvas_group,
- gnome_canvas_rect_get_type(),
- "width_pixels", 1,
- NULL);
- gnome_canvas_item_hide (day_view->resize_bar_item);
-
- day_view->main_canvas_top_resize_bar_item =
- gnome_canvas_item_new (canvas_group,
- gnome_canvas_rect_get_type (),
- "width_pixels", 1,
- NULL);
- gnome_canvas_item_hide (day_view->main_canvas_top_resize_bar_item);
-
- day_view->main_canvas_bottom_resize_bar_item =
- gnome_canvas_item_new (canvas_group,
- gnome_canvas_rect_get_type (),
- "width_pixels", 1,
- NULL);
- gnome_canvas_item_hide (day_view->main_canvas_bottom_resize_bar_item);
-
-
- day_view->drag_rect_item =
- gnome_canvas_item_new (canvas_group,
- gnome_canvas_rect_get_type (),
- "width_pixels", 1,
- NULL);
- gnome_canvas_item_hide (day_view->drag_rect_item);
-
- day_view->drag_bar_item =
- gnome_canvas_item_new (canvas_group,
- gnome_canvas_rect_get_type (),
- "width_pixels", 1,
- NULL);
- gnome_canvas_item_hide (day_view->drag_bar_item);
-
- day_view->drag_item =
- gnome_canvas_item_new (canvas_group,
- e_text_get_type (),
- "anchor", GTK_ANCHOR_NW,
- "line_wrap", TRUE,
- "clip", TRUE,
- "editable", TRUE,
- "draw_background", FALSE,
- "fill_color_rgba", GNOME_CANVAS_COLOR(0, 0, 0),
- NULL);
- gnome_canvas_item_hide (day_view->drag_item);
-
-
- /*
- * Times Canvas
- */
- day_view->time_canvas = e_canvas_new ();
- gtk_layout_set_vadjustment (GTK_LAYOUT (day_view->time_canvas),
- GTK_LAYOUT (day_view->main_canvas)->vadjustment);
- gtk_table_attach (GTK_TABLE (day_view), day_view->time_canvas,
- 0, 1, 1, 2,
- GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
- gtk_widget_show (day_view->time_canvas);
- g_signal_connect_after (day_view->time_canvas, "scroll_event",
- G_CALLBACK (e_day_view_on_time_canvas_scroll), day_view);
-
- canvas_group = GNOME_CANVAS_GROUP (GNOME_CANVAS (day_view->time_canvas)->root);
-
- day_view->time_canvas_item =
- gnome_canvas_item_new (canvas_group,
- e_day_view_time_item_get_type (),
- "EDayViewTimeItem::day_view", day_view,
- NULL);
-
-
- /*
- * Scrollbar.
- */
- day_view->vscrollbar = gtk_vscrollbar_new (GTK_LAYOUT (day_view->main_canvas)->vadjustment);
- gtk_table_attach (GTK_TABLE (day_view), day_view->vscrollbar,
- 2, 3, 1, 2, 0, GTK_EXPAND | GTK_FILL, 0, 0);
- gtk_widget_show (day_view->vscrollbar);
-
-
- /* Create the cursors. */
- day_view->normal_cursor = gdk_cursor_new (GDK_LEFT_PTR);
- day_view->move_cursor = gdk_cursor_new (GDK_FLEUR);
- day_view->resize_width_cursor = gdk_cursor_new (GDK_SB_H_DOUBLE_ARROW);
- day_view->resize_height_cursor = gdk_cursor_new (GDK_SB_V_DOUBLE_ARROW);
- day_view->last_cursor_set_in_top_canvas = NULL;
- day_view->last_cursor_set_in_main_canvas = NULL;
-
- /* Set up the drop sites. */
- gtk_drag_dest_set (day_view->top_canvas,
- GTK_DEST_DEFAULT_ALL,
- target_table, n_targets,
- GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_ASK);
- gtk_drag_dest_set (day_view->main_canvas,
- GTK_DEST_DEFAULT_ALL,
- target_table, n_targets,
- GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_ASK);
-
- /* connect to ECalendarView's signals */
- g_signal_connect (G_OBJECT (day_view), "timezone_changed",
- G_CALLBACK (timezone_changed_cb), NULL);
-}
-
-
-/* Turn off the background of the canvas windows. This reduces flicker
- considerably when scrolling. (Why isn't it in GnomeCanvas?). */
-static void
-e_day_view_on_canvas_realized (GtkWidget *widget,
- EDayView *day_view)
-{
- gdk_window_set_back_pixmap (GTK_LAYOUT (widget)->bin_window,
- NULL, FALSE);
-}
-
-
-/**
- * e_day_view_new:
- * @Returns: a new #EDayView.
- *
- * Creates a new #EDayView.
- **/
-GtkWidget *
-e_day_view_new (void)
-{
- GtkWidget *day_view;
- ECalModel *model;
-
- model = E_CAL_MODEL (e_cal_model_calendar_new ());
-
- day_view = GTK_WIDGET (g_object_new (e_day_view_get_type (), "model", model, NULL));
-
- g_object_unref (model);
-
- return day_view;
-}
-
-
-static void
-e_day_view_destroy (GtkObject *object)
-{
- EDayView *day_view;
- gint day;
-
- day_view = E_DAY_VIEW (object);
-
- e_day_view_cancel_layout (day_view);
-
- e_day_view_stop_auto_scroll (day_view);
-
- if (day_view->query) {
- g_signal_handlers_disconnect_matched (day_view->query, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, day_view);
- g_object_unref (day_view->query);
- day_view->query = NULL;
- }
-
- if (day_view->large_font_desc) {
- pango_font_description_free (day_view->large_font_desc);
- day_view->large_font_desc = NULL;
- }
-
- if (day_view->normal_cursor) {
- gdk_cursor_unref (day_view->normal_cursor);
- day_view->normal_cursor = NULL;
- }
- if (day_view->move_cursor) {
- gdk_cursor_unref (day_view->move_cursor);
- day_view->move_cursor = NULL;
- }
- if (day_view->resize_width_cursor) {
- gdk_cursor_unref (day_view->resize_width_cursor);
- day_view->resize_width_cursor = NULL;
- }
- if (day_view->resize_height_cursor) {
- gdk_cursor_unref (day_view->resize_height_cursor);
- day_view->resize_height_cursor = NULL;
- }
-
- if (day_view->long_events) {
- e_day_view_free_events (day_view);
- g_array_free (day_view->long_events, TRUE);
- day_view->long_events = NULL;
- }
-
- for (day = 0; day < E_DAY_VIEW_MAX_DAYS; day++) {
- if (day_view->events[day]) {
- g_array_free (day_view->events[day], TRUE);
- day_view->events[day] = NULL;
- }
- }
-
- GTK_OBJECT_CLASS (parent_class)->destroy (object);
-}
-
-
-static void
-e_day_view_realize (GtkWidget *widget)
-{
- EDayView *day_view;
- GdkColormap *colormap;
- gboolean success[E_DAY_VIEW_COLOR_LAST];
- gint nfailed;
-
- if (GTK_WIDGET_CLASS (parent_class)->realize)
- (*GTK_WIDGET_CLASS (parent_class)->realize)(widget);
-
- day_view = E_DAY_VIEW (widget);
- day_view->main_gc = gdk_gc_new (widget->window);
-
- colormap = gtk_widget_get_colormap (widget);
-
- /* Allocate the colors. */
- day_view->colors[E_DAY_VIEW_COLOR_BG_WORKING].red = 247 * 257;
- day_view->colors[E_DAY_VIEW_COLOR_BG_WORKING].green = 247 * 257;
- day_view->colors[E_DAY_VIEW_COLOR_BG_WORKING].blue = 244 * 257;
-
- day_view->colors[E_DAY_VIEW_COLOR_BG_NOT_WORKING].red = 216 * 257;
- day_view->colors[E_DAY_VIEW_COLOR_BG_NOT_WORKING].green = 216 * 257;
- day_view->colors[E_DAY_VIEW_COLOR_BG_NOT_WORKING].blue = 214 * 257;
-
- day_view->colors[E_DAY_VIEW_COLOR_BG_SELECTED].red = 0 * 257;
- day_view->colors[E_DAY_VIEW_COLOR_BG_SELECTED].green = 0 * 257;
- day_view->colors[E_DAY_VIEW_COLOR_BG_SELECTED].blue = 156 * 257;
-
- day_view->colors[E_DAY_VIEW_COLOR_BG_SELECTED_UNFOCUSSED].red = 16 * 257;
- day_view->colors[E_DAY_VIEW_COLOR_BG_SELECTED_UNFOCUSSED].green = 78 * 257;
- day_view->colors[E_DAY_VIEW_COLOR_BG_SELECTED_UNFOCUSSED].blue = 139 * 257;
-
- day_view->colors[E_DAY_VIEW_COLOR_BG_GRID].red = 0x8000;
- day_view->colors[E_DAY_VIEW_COLOR_BG_GRID].green = 0x8000;
- day_view->colors[E_DAY_VIEW_COLOR_BG_GRID].blue = 0x8000;
-
- day_view->colors[E_DAY_VIEW_COLOR_BG_TOP_CANVAS].red = 0x8000;
- day_view->colors[E_DAY_VIEW_COLOR_BG_TOP_CANVAS].green = 0x8000;
- day_view->colors[E_DAY_VIEW_COLOR_BG_TOP_CANVAS].blue = 0x8000;
-
- day_view->colors[E_DAY_VIEW_COLOR_BG_TOP_CANVAS_SELECTED].red = 65535;
- day_view->colors[E_DAY_VIEW_COLOR_BG_TOP_CANVAS_SELECTED].green = 65535;
- day_view->colors[E_DAY_VIEW_COLOR_BG_TOP_CANVAS_SELECTED].blue = 65535;
-
- day_view->colors[E_DAY_VIEW_COLOR_BG_TOP_CANVAS_GRID].red = 0;
- day_view->colors[E_DAY_VIEW_COLOR_BG_TOP_CANVAS_GRID].green = 0;
- day_view->colors[E_DAY_VIEW_COLOR_BG_TOP_CANVAS_GRID].blue = 0;
-
- day_view->colors[E_DAY_VIEW_COLOR_EVENT_VBAR].red = 0;
- day_view->colors[E_DAY_VIEW_COLOR_EVENT_VBAR].green = 0;
- day_view->colors[E_DAY_VIEW_COLOR_EVENT_VBAR].blue = 65535;
-
- day_view->colors[E_DAY_VIEW_COLOR_EVENT_BACKGROUND].red = 65535;
- day_view->colors[E_DAY_VIEW_COLOR_EVENT_BACKGROUND].green = 65535;
- day_view->colors[E_DAY_VIEW_COLOR_EVENT_BACKGROUND].blue = 65535;
-
- day_view->colors[E_DAY_VIEW_COLOR_EVENT_BORDER].red = 0;
- day_view->colors[E_DAY_VIEW_COLOR_EVENT_BORDER].green = 0;
- day_view->colors[E_DAY_VIEW_COLOR_EVENT_BORDER].blue = 0;
-
- day_view->colors[E_DAY_VIEW_COLOR_LONG_EVENT_BACKGROUND].red = 213 * 257;
- day_view->colors[E_DAY_VIEW_COLOR_LONG_EVENT_BACKGROUND].green = 213 * 257;
- day_view->colors[E_DAY_VIEW_COLOR_LONG_EVENT_BACKGROUND].blue = 213 * 257;
-
- day_view->colors[E_DAY_VIEW_COLOR_LONG_EVENT_BORDER].red = 0;
- day_view->colors[E_DAY_VIEW_COLOR_LONG_EVENT_BORDER].green = 0;
- day_view->colors[E_DAY_VIEW_COLOR_LONG_EVENT_BORDER].blue = 0;
-
- nfailed = gdk_colormap_alloc_colors (colormap, day_view->colors,
- E_DAY_VIEW_COLOR_LAST, FALSE,
- TRUE, success);
- if (nfailed)
- g_warning ("Failed to allocate all colors");
-
-
- /* Create the pixmaps. */
- day_view->reminder_icon = gdk_pixmap_colormap_create_from_xpm_d (NULL, colormap, &day_view->reminder_mask, NULL, bell_xpm);
- day_view->recurrence_icon = gdk_pixmap_colormap_create_from_xpm_d (NULL, colormap, &day_view->recurrence_mask, NULL, recur_xpm);
- day_view->timezone_icon = gdk_pixmap_colormap_create_from_xpm_d (NULL, colormap, &day_view->timezone_mask, NULL, timezone_16_xpm);
- day_view->meeting_icon = gdk_pixmap_colormap_create_from_xpm_d (NULL, colormap, &day_view->meeting_mask, NULL, schedule_meeting_16_xpm);
-
-
-
- /* Set the canvas item colors. */
- gnome_canvas_item_set (day_view->resize_long_event_rect_item,
- "fill_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_BACKGROUND],
- "outline_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_BORDER],
- NULL);
-
- gnome_canvas_item_set (day_view->drag_long_event_rect_item,
- "fill_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_BACKGROUND],
- "outline_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_BORDER],
- NULL);
-
-
- gnome_canvas_item_set (day_view->resize_rect_item,
- "fill_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_BACKGROUND],
- "outline_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_BORDER],
- NULL);
-
- gnome_canvas_item_set (day_view->resize_bar_item,
- "fill_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_VBAR],
- "outline_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_BORDER],
- NULL);
-
- gnome_canvas_item_set (day_view->main_canvas_top_resize_bar_item,
- "fill_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_VBAR],
- "outline_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_BORDER],
- NULL);
-
- gnome_canvas_item_set (day_view->main_canvas_bottom_resize_bar_item,
- "fill_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_VBAR],
- "outline_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_BORDER],
- NULL);
-
-
- gnome_canvas_item_set (day_view->drag_rect_item,
- "fill_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_BACKGROUND],
- "outline_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_BORDER],
- NULL);
-
- gnome_canvas_item_set (day_view->drag_bar_item,
- "fill_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_VBAR],
- "outline_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_BORDER],
- NULL);
-}
-
-
-static void
-e_day_view_unrealize (GtkWidget *widget)
-{
- EDayView *day_view;
- GdkColormap *colormap;
-
- day_view = E_DAY_VIEW (widget);
-
- gdk_gc_unref (day_view->main_gc);
- day_view->main_gc = NULL;
-
- colormap = gtk_widget_get_colormap (widget);
- gdk_colormap_free_colors (colormap, day_view->colors, E_DAY_VIEW_COLOR_LAST);
-
- gdk_pixmap_unref (day_view->reminder_icon);
- day_view->reminder_icon = NULL;
- gdk_pixmap_unref (day_view->recurrence_icon);
- day_view->recurrence_icon = NULL;
-
- if (GTK_WIDGET_CLASS (parent_class)->unrealize)
- (*GTK_WIDGET_CLASS (parent_class)->unrealize)(widget);
-}
-
-
-static void
-e_day_view_style_set (GtkWidget *widget,
- GtkStyle *previous_style)
-{
- EDayView *day_view;
- gint top_rows, top_canvas_height;
- gint hour, max_large_hour_width;
- gint minute, max_minute_width, i;
- gint month, day, width;
- gint longest_month_width, longest_abbreviated_month_width;
- gint longest_weekday_width, longest_abbreviated_weekday_width;
- struct tm date_tm;
- gchar buffer[128];
- gint times_width;
- PangoFontDescription *font_desc;
- PangoContext *pango_context;
- PangoFontMetrics *font_metrics;
- PangoLayout *layout;
-
- if (GTK_WIDGET_CLASS (parent_class)->style_set)
- (*GTK_WIDGET_CLASS (parent_class)->style_set)(widget, previous_style);
-
- day_view = E_DAY_VIEW (widget);
-
- /* Set up Pango prerequisites */
- font_desc = gtk_widget_get_style (widget)->font_desc;
- pango_context = gtk_widget_get_pango_context (widget);
- font_metrics = pango_context_get_metrics (pango_context, font_desc,
- pango_context_get_language (pango_context));
- layout = pango_layout_new (pango_context);
-
- /* Create the large font. */
- if (day_view->large_font_desc != NULL)
- pango_font_description_free (day_view->large_font_desc);
-
- day_view->large_font_desc = pango_font_description_copy (font_desc);
- pango_font_description_set_size (day_view->large_font_desc,
- E_DAY_VIEW_LARGE_FONT_PTSIZE * PANGO_SCALE);
-
- /* Recalculate the height of each row based on the font size. */
- day_view->row_height =
- PANGO_PIXELS (pango_font_metrics_get_ascent (font_metrics)) +
- PANGO_PIXELS (pango_font_metrics_get_descent (font_metrics)) +
- E_DAY_VIEW_EVENT_BORDER_HEIGHT + E_DAY_VIEW_EVENT_Y_PAD * 2 + 2 /* FIXME */;
- day_view->row_height = MAX (day_view->row_height, E_DAY_VIEW_ICON_HEIGHT + E_DAY_VIEW_ICON_Y_PAD + 2);
- GTK_LAYOUT (day_view->main_canvas)->vadjustment->step_increment = day_view->row_height;
-
- day_view->top_row_height =
- PANGO_PIXELS (pango_font_metrics_get_ascent (font_metrics)) +
- PANGO_PIXELS (pango_font_metrics_get_descent (font_metrics)) +
- E_DAY_VIEW_LONG_EVENT_BORDER_HEIGHT * 2 + E_DAY_VIEW_LONG_EVENT_Y_PAD * 2 +
- E_DAY_VIEW_TOP_CANVAS_Y_GAP;
- day_view->top_row_height = MAX (day_view->top_row_height, E_DAY_VIEW_ICON_HEIGHT + E_DAY_VIEW_ICON_Y_PAD + 2 + E_DAY_VIEW_TOP_CANVAS_Y_GAP);
-
- /* Set the height of the top canvas based on the row height and the
- number of rows needed (min 1 + 1 for the dates + 1 space for DnD).*/
- top_rows = MAX (1, day_view->rows_in_top_display);
- top_canvas_height = (top_rows + 2) * day_view->top_row_height;
- gtk_widget_set_usize (day_view->top_canvas, -1, top_canvas_height);
-
- /* Find the longest full & abbreviated month names. */
- memset (&date_tm, 0, sizeof (date_tm));
- date_tm.tm_year = 100;
- date_tm.tm_mday = 1;
- date_tm.tm_isdst = -1;
-
- longest_month_width = 0;
- longest_abbreviated_month_width = 0;
- for (month = 0; month < 12; month++) {
- date_tm.tm_mon = month;
-
- e_utf8_strftime (buffer, sizeof (buffer), "%B", &date_tm);
- pango_layout_set_text (layout, buffer, -1);
- pango_layout_get_pixel_size (layout, &width, NULL);
-
- if (width > longest_month_width) {
- longest_month_width = width;
- day_view->longest_month_name = month;
- }
-
- e_utf8_strftime (buffer, sizeof (buffer), "%b", &date_tm);
- pango_layout_set_text (layout, buffer, -1);
- pango_layout_get_pixel_size (layout, &width, NULL);
-
- if (width > longest_abbreviated_month_width) {
- longest_abbreviated_month_width = width;
- day_view->longest_abbreviated_month_name = month;
- }
- }
-
- /* Find the longest full & abbreviated weekday names. */
- memset (&date_tm, 0, sizeof (date_tm));
- date_tm.tm_year = 100;
- date_tm.tm_mon = 0;
- date_tm.tm_isdst = -1;
-
- longest_weekday_width = 0;
- longest_abbreviated_weekday_width = 0;
- for (day = 0; day < 7; day++) {
- date_tm.tm_mday = 2 + day;
- date_tm.tm_wday = day;
-
- e_utf8_strftime (buffer, sizeof (buffer), "%A", &date_tm);
- pango_layout_set_text (layout, buffer, -1);
- pango_layout_get_pixel_size (layout, &width, NULL);
-
- if (width > longest_weekday_width) {
- longest_weekday_width = width;
- day_view->longest_weekday_name = day;
- }
-
- e_utf8_strftime (buffer, sizeof (buffer), "%a", &date_tm);
- pango_layout_set_text (layout, buffer, -1);
- pango_layout_get_pixel_size (layout, &width, NULL);
-
- if (width > longest_abbreviated_weekday_width) {
- longest_abbreviated_weekday_width = width;
- day_view->longest_abbreviated_weekday_name = day;
- }
- }
-
-
- /* Calculate the widths of all the time strings necessary. */
- day_view->max_small_hour_width = 0;
- max_large_hour_width = 0;
- for (hour = 0; hour < 24; hour++) {
- g_snprintf (buffer, sizeof (buffer), "%02i", hour);
- pango_layout_set_text (layout, buffer, -1);
- pango_layout_get_pixel_size (layout, &day_view->small_hour_widths [hour], NULL);
-
- day_view->max_small_hour_width = MAX (day_view->max_small_hour_width, day_view->small_hour_widths[hour]);
- }
-
- max_minute_width = 0;
- for (minute = 0, i = 0; minute < 60; minute += 5, i++) {
- gint minute_width;
-
- g_snprintf (buffer, sizeof (buffer), "%02i", minute);
- pango_layout_set_text (layout, buffer, -1);
- pango_layout_get_pixel_size (layout, &minute_width, NULL);
-
- max_minute_width = MAX (max_minute_width, minute_width);
- }
- day_view->max_minute_width = max_minute_width;
-
- pango_layout_set_text (layout, ":", 1);
- pango_layout_get_pixel_size (layout, &day_view->colon_width, NULL);
- pango_layout_set_text (layout, "0", 1);
- pango_layout_get_pixel_size (layout, &day_view->digit_width, NULL);
-
- pango_layout_set_text (layout, day_view->am_string, -1);
- pango_layout_get_pixel_size (layout, &day_view->am_string_width, NULL);
- pango_layout_set_text (layout, day_view->pm_string, -1);
- pango_layout_get_pixel_size (layout, &day_view->pm_string_width, NULL);
-
- /* Calculate the width of the time column. */
- times_width = e_day_view_time_item_get_column_width (E_DAY_VIEW_TIME_ITEM (day_view->time_canvas_item));
- gtk_widget_set_usize (day_view->time_canvas, times_width, -1);
-
- g_object_unref (layout);
- pango_font_metrics_unref (font_metrics);
-}
-
-
-/* This recalculates the sizes of each column. */
-static void
-e_day_view_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
-{
- EDayView *day_view;
- gint day, scroll_y;
- gboolean need_reshape;
- gdouble old_x2, old_y2, new_x2, new_y2;
-
-#if 0
- g_print ("In e_day_view_size_allocate\n");
-#endif
- day_view = E_DAY_VIEW (widget);
-
- (*GTK_WIDGET_CLASS (parent_class)->size_allocate) (widget, allocation);
-
- e_day_view_recalc_cell_sizes (day_view);
-
- /* Set the scroll region of the top canvas to its allocated size. */
- gnome_canvas_get_scroll_region (GNOME_CANVAS (day_view->top_canvas),
- NULL, NULL, &old_x2, &old_y2);
- new_x2 = day_view->top_canvas->allocation.width - 1;
- new_y2 = day_view->top_canvas->allocation.height - 1;
- if (old_x2 != new_x2 || old_y2 != new_y2)
- gnome_canvas_set_scroll_region (GNOME_CANVAS (day_view->top_canvas),
- 0, 0, new_x2, new_y2);
-
- need_reshape = e_day_view_update_scroll_regions (day_view);
-
- /* Scroll to the start of the working day, if this is the initial
- allocation. */
- if (day_view->scroll_to_work_day) {
- scroll_y = e_day_view_convert_time_to_position (day_view, day_view->work_day_start_hour, day_view->work_day_start_minute);
- gnome_canvas_scroll_to (GNOME_CANVAS (day_view->main_canvas),
- 0, scroll_y);
- day_view->scroll_to_work_day = FALSE;
- }
-
- /* Flag that we need to reshape the events. Note that changes in height
- don't matter, since the rows are always the same height. */
- if (need_reshape) {
- day_view->long_events_need_reshape = TRUE;
- for (day = 0; day < E_DAY_VIEW_MAX_DAYS; day++)
- day_view->need_reshape[day] = TRUE;
-
- e_day_view_check_layout (day_view);
- }
-}
-
-
-static void
-e_day_view_recalc_cell_sizes (EDayView *day_view)
-{
- /* An array of dates, one for each month in the year 2000. They must
- all be Sundays. */
- static const int days[12] = { 23, 20, 19, 23, 21, 18,
- 23, 20, 17, 22, 19, 24 };
- gfloat width, offset;
- gint day, max_width;
- struct tm date_tm;
- char buffer[128];
- PangoFontDescription *font_desc;
- PangoContext *pango_context;
- PangoLayout *layout;
- gint pango_width;
-
- g_return_if_fail (((GtkWidget*)day_view)->style != NULL);
-
- /* Set up Pango prerequisites */
- font_desc = gtk_widget_get_style (GTK_WIDGET (day_view))->font_desc;
- pango_context = gtk_widget_get_pango_context (GTK_WIDGET (day_view));
- layout = pango_layout_new (pango_context);
-
- /* Calculate the column sizes, using floating point so that pixels
- get divided evenly. Note that we use one more element than the
- number of columns, to make it easy to get the column widths. */
- width = day_view->main_canvas->allocation.width;
- width /= day_view->days_shown;
- offset = 0;
- for (day = 0; day <= day_view->days_shown; day++) {
- day_view->day_offsets[day] = floor (offset + 0.5);
- offset += width;
- }
-
- /* Calculate the days widths based on the offsets. */
- for (day = 0; day < day_view->days_shown; day++) {
- day_view->day_widths[day] = day_view->day_offsets[day + 1] - day_view->day_offsets[day];
- }
-
- /* Determine which date format to use, based on the column widths.
- We want to check the widths using the longest full or abbreviated
- month name and the longest full or abbreviated weekday name, as
- appropriate. */
- max_width = day_view->day_widths[0];
-
- memset (&date_tm, 0, sizeof (date_tm));
- date_tm.tm_year = 100;
-
- /* Try "Thursday 21 January". */
- date_tm.tm_mon = day_view->longest_month_name;
- date_tm.tm_mday = days[date_tm.tm_mon]
- + day_view->longest_weekday_name;
- date_tm.tm_wday = day_view->longest_weekday_name;
- date_tm.tm_isdst = -1;
- /* strftime format %A = full weekday name, %d = day of month,
- %B = full month name. Don't use any other specifiers. */
- e_utf8_strftime (buffer, sizeof (buffer), _("%A %d %B"), &date_tm);
- pango_layout_set_text (layout, buffer, -1);
- pango_layout_get_pixel_size (layout, &pango_width, NULL);
-
- if (pango_width < max_width) {
- day_view->date_format = E_DAY_VIEW_DATE_FULL;
- return;
- }
-
- /* Try "Thu 21 Jan". */
- date_tm.tm_mon = day_view->longest_abbreviated_month_name;
- date_tm.tm_mday = days[date_tm.tm_mon]
- + day_view->longest_abbreviated_weekday_name;
- date_tm.tm_wday = day_view->longest_abbreviated_weekday_name;
- date_tm.tm_isdst = -1;
- /* strftime format %a = abbreviated weekday name, %d = day of month,
- %b = abbreviated month name. Don't use any other specifiers. */
- e_utf8_strftime (buffer, sizeof (buffer), _("%a %d %b"), &date_tm);
- pango_layout_set_text (layout, buffer, -1);
- pango_layout_get_pixel_size (layout, &pango_width, NULL);
-
- if (pango_width < max_width) {
- day_view->date_format = E_DAY_VIEW_DATE_ABBREVIATED;
- return;
- }
-
- /* Try "23 Jan". */
- date_tm.tm_mon = day_view->longest_abbreviated_month_name;
- date_tm.tm_mday = 23;
- date_tm.tm_wday = 0;
- date_tm.tm_isdst = -1;
- /* strftime format %d = day of month, %b = abbreviated month name.
- Don't use any other specifiers. */
- e_utf8_strftime (buffer, sizeof (buffer), _("%d %b"), &date_tm);
- pango_layout_set_text (layout, buffer, -1);
- pango_layout_get_pixel_size (layout, &pango_width, NULL);
-
- if (pango_width < max_width)
- day_view->date_format = E_DAY_VIEW_DATE_NO_WEEKDAY;
- else
- day_view->date_format = E_DAY_VIEW_DATE_SHORT;
-
- g_object_unref (layout);
-}
-
-
-static gint
-e_day_view_focus_in (GtkWidget *widget, GdkEventFocus *event)
-{
- EDayView *day_view;
-
- g_return_val_if_fail (widget != NULL, FALSE);
- g_return_val_if_fail (E_IS_DAY_VIEW (widget), FALSE);
- g_return_val_if_fail (event != NULL, FALSE);
-
- day_view = E_DAY_VIEW (widget);
-
- GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS);
-
- gtk_widget_queue_draw (day_view->top_canvas);
- gtk_widget_queue_draw (day_view->main_canvas);
-
- return FALSE;
-}
-
-
-static gint
-e_day_view_focus_out (GtkWidget *widget, GdkEventFocus *event)
-{
- EDayView *day_view;
-
- g_return_val_if_fail (widget != NULL, FALSE);
- g_return_val_if_fail (E_IS_DAY_VIEW (widget), FALSE);
- g_return_val_if_fail (event != NULL, FALSE);
-
- day_view = E_DAY_VIEW (widget);
-
- GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS);
-
- gtk_widget_queue_draw (day_view->top_canvas);
- gtk_widget_queue_draw (day_view->main_canvas);
-
- return FALSE;
-}
-
-static gboolean
-e_day_view_update_event_cb (EDayView *day_view,
- gint day,
- gint event_num,
- gpointer data)
-{
- EDayViewEvent *event;
- ECalModelComponent *comp_data;
-
- comp_data = data;
-#if 0
- g_print ("In e_day_view_update_event_cb day:%i event_num:%i\n",
- day, event_num);
-#endif
- if (day == E_DAY_VIEW_LONG_EVENT) {
- event = &g_array_index (day_view->long_events, EDayViewEvent,
- event_num);
- } else {
- event = &g_array_index (day_view->events[day], EDayViewEvent,
- event_num);
- }
-
- if (event->allocated_comp_data)
- e_cal_model_free_component_data (event->comp_data);
- event->comp_data = comp_data;
- event->allocated_comp_data = FALSE;
-
- if (day == E_DAY_VIEW_LONG_EVENT) {
- e_day_view_update_long_event_label (day_view, event_num);
- e_day_view_reshape_long_event (day_view, event_num);
- } else {
- e_day_view_update_event_label (day_view, day, event_num);
- e_day_view_reshape_day_event (day_view, day, event_num);
- }
-
- g_signal_emit_by_name (G_OBJECT(day_view),
- "event_changed", event);
-
- return TRUE;
-}
-
-
-/* This calls a given function for each event instance (in both views).
- If the callback returns FALSE the iteration is stopped.
- Note that it is safe for the callback to remove the event (since we
- step backwards through the arrays). */
-static void
-e_day_view_foreach_event (EDayView *day_view,
- EDayViewForeachEventCallback callback,
- gpointer data)
-{
- EDayViewEvent *event;
- gint day, event_num;
-
- for (day = 0; day < day_view->days_shown; day++) {
- for (event_num = day_view->events[day]->len - 1;
- event_num >= 0;
- event_num--) {
- event = &g_array_index (day_view->events[day],
- EDayViewEvent, event_num);
-
- if (!(*callback) (day_view, day, event_num, data))
- return;
- }
- }
-
- for (event_num = day_view->long_events->len - 1;
- event_num >= 0;
- event_num--) {
- event = &g_array_index (day_view->long_events,
- EDayViewEvent, event_num);
-
- if (!(*callback) (day_view, E_DAY_VIEW_LONG_EVENT, event_num,
- data))
- return;
- }
-}
-
-
-/* This calls a given function for each event instance that matches the given
- uid. If the callback returns FALSE the iteration is stopped.
- Note that it is safe for the callback to remove the event (since we
- step backwards through the arrays). */
-static void
-e_day_view_foreach_event_with_uid (EDayView *day_view,
- const gchar *uid,
- EDayViewForeachEventCallback callback,
- gpointer data)
-{
- EDayViewEvent *event;
- gint day, event_num;
- const char *u;
-
- for (day = 0; day < day_view->days_shown; day++) {
- for (event_num = day_view->events[day]->len - 1;
- event_num >= 0;
- event_num--) {
- event = &g_array_index (day_view->events[day],
- EDayViewEvent, event_num);
-
- u = icalcomponent_get_uid (event->comp_data->icalcomp);
- if (uid && !strcmp (uid, u)) {
- if (!(*callback) (day_view, day, event_num, data))
- return;
- }
- }
- }
-
- for (event_num = day_view->long_events->len - 1;
- event_num >= 0;
- event_num--) {
- event = &g_array_index (day_view->long_events,
- EDayViewEvent, event_num);
-
- u = icalcomponent_get_uid (event->comp_data->icalcomp);
- if (u && !strcmp (uid, u)) {
- if (!(*callback) (day_view, E_DAY_VIEW_LONG_EVENT, event_num, data))
- return;
- }
- }
-}
-
-
-static gboolean
-e_day_view_remove_event_cb (EDayView *day_view,
- gint day,
- gint event_num,
- gpointer data)
-{
- EDayViewEvent *event;
-
-#if 0
- g_print ("In e_day_view_remove_event_cb day:%i event_num:%i\n",
- day, event_num);
-#endif
-
- if (day == E_DAY_VIEW_LONG_EVENT)
- event = &g_array_index (day_view->long_events,
- EDayViewEvent, event_num);
- else
- event = &g_array_index (day_view->events[day],
- EDayViewEvent, event_num);
-
- /* If we were editing this event, set editing_event_day to -1 so
- on_editing_stopped doesn't try to update the event. */
- if (day_view->editing_event_day == day
- && day_view->editing_event_num == event_num)
- day_view->editing_event_day = -1;
-
- if (event->canvas_item)
- gtk_object_destroy (GTK_OBJECT (event->canvas_item));
-
- if (event->allocated_comp_data) {
- e_cal_model_free_component_data (event->comp_data);
- event->allocated_comp_data = FALSE;
- }
-
- if (day == E_DAY_VIEW_LONG_EVENT) {
- g_array_remove_index (day_view->long_events, event_num);
- day_view->long_events_need_layout = TRUE;
- } else {
- g_array_remove_index (day_view->events[day], event_num);
- day_view->need_layout[day] = TRUE;
- }
- return TRUE;
-}
-
-
-/* This updates the text shown for an event. If the event start or end do not
- lie on a row boundary, the time is displayed before the summary. */
-static void
-e_day_view_update_event_label (EDayView *day_view,
- gint day,
- gint event_num)
-{
- EDayViewEvent *event;
- char *text, *start_suffix, *end_suffix;
- gboolean free_text = FALSE, editing_event = FALSE;
- gint offset;
- gint start_hour, start_display_hour, start_minute, start_suffix_width;
- gint end_hour, end_display_hour, end_minute, end_suffix_width;
- const gchar *summary;
-
- event = &g_array_index (day_view->events[day], EDayViewEvent, event_num);
-
- /* If the event isn't visible just return. */
- if (!event->canvas_item)
- return;
-
- summary = icalcomponent_get_summary (event->comp_data->icalcomp);
- text = summary ? (char *) summary : "";
-
- if (day_view->editing_event_day == day
- && day_view->editing_event_num == event_num)
- editing_event = TRUE;
-
- if (!editing_event
- && (event->start_minute % day_view->mins_per_row != 0
- || (day_view->show_event_end_times
- && event->end_minute % day_view->mins_per_row != 0))) {
- offset = day_view->first_hour_shown * 60
- + day_view->first_minute_shown;
- start_minute = offset + event->start_minute;
- end_minute = offset + event->end_minute;
-
- start_hour = start_minute / 60;
- start_minute = start_minute % 60;
-
- end_hour = end_minute / 60;
- end_minute = end_minute % 60;
-
- e_day_view_convert_time_to_display (day_view, start_hour,
- &start_display_hour,
- &start_suffix,
- &start_suffix_width);
- e_day_view_convert_time_to_display (day_view, end_hour,
- &end_display_hour,
- &end_suffix,
- &end_suffix_width);
-
- if (e_calendar_view_get_use_24_hour_format (E_CALENDAR_VIEW (day_view))) {
- if (day_view->show_event_end_times) {
- /* 24 hour format with end time. */
- text = g_strdup_printf
- ("%2i:%02i-%2i:%02i %s",
- start_display_hour, start_minute,
- end_display_hour, end_minute,
- text);
- } else {
- /* 24 hour format without end time. */
- text = g_strdup_printf
- ("%2i:%02i %s",
- start_display_hour, start_minute,
- text);
- }
- } else {
- if (day_view->show_event_end_times) {
- /* 12 hour format with end time. */
- text = g_strdup_printf
- ("%2i:%02i%s-%2i:%02i%s %s",
- start_display_hour, start_minute,
- start_suffix,
- end_display_hour, end_minute,
- end_suffix,
- text);
- } else {
- /* 12 hour format without end time. */
- text = g_strdup_printf
- ("%2i:%02i%s %s",
- start_display_hour, start_minute,
- start_suffix,
- text);
- }
- }
-
- free_text = TRUE;
- }
-
- gnome_canvas_item_set (event->canvas_item,
- "text", text,
- NULL);
-
- if (free_text)
- g_free (text);
-}
-
-
-static void
-e_day_view_update_long_event_label (EDayView *day_view,
- gint event_num)
-{
- EDayViewEvent *event;
- const gchar *summary;
-
- event = &g_array_index (day_view->long_events, EDayViewEvent,
- event_num);
-
- /* If the event isn't visible just return. */
- if (!event->canvas_item)
- return;
-
- summary = icalcomponent_get_summary (event->comp_data->icalcomp);
- gnome_canvas_item_set (event->canvas_item,
- "text", summary ? summary : "",
- NULL);
-}
-
-
-/* Finds the day and index of the event with the given canvas item.
- If is is a long event, -1 is returned as the day.
- Returns TRUE if the event was found. */
-gboolean
-e_day_view_find_event_from_item (EDayView *day_view,
- GnomeCanvasItem *item,
- gint *day_return,
- gint *event_num_return)
-{
- EDayViewEvent *event;
- gint day, event_num;
-
- for (day = 0; day < day_view->days_shown; day++) {
- for (event_num = 0; event_num < day_view->events[day]->len;
- event_num++) {
- event = &g_array_index (day_view->events[day],
- EDayViewEvent, event_num);
- if (event->canvas_item == item) {
- *day_return = day;
- *event_num_return = event_num;
- return TRUE;
- }
- }
- }
-
- for (event_num = 0; event_num < day_view->long_events->len;
- event_num++) {
- event = &g_array_index (day_view->long_events,
- EDayViewEvent, event_num);
- if (event->canvas_item == item) {
- *day_return = E_DAY_VIEW_LONG_EVENT;
- *event_num_return = event_num;
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
-
-/* Finds the day and index of the event with the given uid.
- If is is a long event, E_DAY_VIEW_LONG_EVENT is returned as the day.
- Returns TRUE if an event with the uid was found.
- Note that for recurring events there may be several EDayViewEvents, one
- for each instance, all with the same iCalObject and uid. So only use this
- function if you know the event doesn't recur or you are just checking to
- see if any events with the uid exist. */
-static gboolean
-e_day_view_find_event_from_uid (EDayView *day_view,
- const gchar *uid,
- gint *day_return,
- gint *event_num_return)
-{
- EDayViewEvent *event;
- gint day, event_num;
- const char *u;
-
- if (!uid)
- return FALSE;
-
- for (day = 0; day < day_view->days_shown; day++) {
- for (event_num = 0; event_num < day_view->events[day]->len;
- event_num++) {
- event = &g_array_index (day_view->events[day],
- EDayViewEvent, event_num);
-
- u = icalcomponent_get_uid (event->comp_data->icalcomp);
- if (u && !strcmp (uid, u)) {
- *day_return = day;
- *event_num_return = event_num;
- return TRUE;
- }
- }
- }
-
- for (event_num = 0; event_num < day_view->long_events->len;
- event_num++) {
- event = &g_array_index (day_view->long_events,
- EDayViewEvent, event_num);
-
- u = icalcomponent_get_uid (event->comp_data->icalcomp);
- if (u && !strcmp (uid, u)) {
- *day_return = E_DAY_VIEW_LONG_EVENT;
- *event_num_return = event_num;
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
-
-/* This sets the selected time range. The EDayView will show the day or week
- corresponding to the start time. If the start_time & end_time are not equal
- and are both visible in the view, then the selection is set to those times,
- otherwise it is set to 1 hour from the start of the working day. */
-static void
-e_day_view_set_selected_time_range (ECalendarView *cal_view,
- time_t start_time,
- time_t end_time)
-{
- time_t lower;
- gint start_row, start_col, end_row, end_col;
- gboolean need_redraw = FALSE, start_in_grid, end_in_grid;
- EDayView *day_view = E_DAY_VIEW (cal_view);
-
- g_return_if_fail (E_IS_DAY_VIEW (day_view));
-
- /* Calculate the first day that should be shown, based on start_time
- and the days_shown setting. If we are showing 1 day it is just the
- start of the day given by start_time, otherwise it is the previous
- work-week start day. */
- if (!day_view->work_week_view) {
- lower = time_day_begin_with_zone (start_time, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
- } else {
- lower = e_day_view_find_work_week_start (day_view, start_time);
- }
-
- /* See if we need to change the days shown. */
- if (lower != day_view->lower) {
- e_day_view_recalc_day_starts (day_view, lower);
- e_day_view_update_query ((ECalendarView *) day_view);
- }
-
- /* Set the selection. */
- start_in_grid = e_day_view_convert_time_to_grid_position (day_view,
- start_time,
- &start_col,
- &start_row);
- end_in_grid = e_day_view_convert_time_to_grid_position (day_view,
- end_time - 60,
- &end_col,
- &end_row);
-
- /* If either of the times isn't in the grid, or the selection covers
- an entire day, we set the selection to 1 row from the start of the
- working day, in the day corresponding to the start time. */
- if (!start_in_grid || !end_in_grid
- || (start_row == 0 && end_row == day_view->rows - 1)) {
- end_col = start_col;
-
- start_row = e_day_view_convert_time_to_row (day_view, day_view->work_day_start_hour, day_view->work_day_start_minute);
- start_row = CLAMP (start_row, 0, day_view->rows - 1);
- end_row = start_row;
- }
-
- if (start_row != day_view->selection_start_row
- || start_col != day_view->selection_start_day) {
- need_redraw = TRUE;
- day_view->selection_in_top_canvas = FALSE;
- day_view->selection_start_row = start_row;
- day_view->selection_start_day = start_col;
- }
-
- if (end_row != day_view->selection_end_row
- || end_col != day_view->selection_end_day) {
- need_redraw = TRUE;
- day_view->selection_in_top_canvas = FALSE;
- day_view->selection_end_row = end_row;
- day_view->selection_end_day = end_col;
- }
-
- if (need_redraw) {
- gtk_widget_queue_draw (day_view->top_canvas);
- gtk_widget_queue_draw (day_view->main_canvas);
- }
-}
-
-static void
-e_day_view_set_selected_time_range_in_top_visible (EDayView *day_view,
- time_t start_time,
- time_t end_time)
-{
- gint start_row, start_col, end_row, end_col;
- gboolean need_redraw = FALSE, start_in_grid, end_in_grid;
-
- g_return_if_fail (E_IS_DAY_VIEW (day_view));
-
- /* Set the selection. */
- start_in_grid = e_day_view_convert_time_to_grid_position (day_view,
- start_time,
- &start_col,
- &start_row);
- end_in_grid = e_day_view_convert_time_to_grid_position (day_view,
- end_time - 60,
- &end_col,
- &end_row);
-
- if (!start_in_grid)
- start_col = 0;
- if (!end_in_grid)
- end_col = day_view->days_shown - 1;
-
- if (start_row != day_view->selection_start_row
- || start_col != day_view->selection_start_day) {
- need_redraw = TRUE;
- day_view->selection_in_top_canvas = TRUE;
- day_view->selection_start_row = -1;
- day_view->selection_start_day = start_col;
- }
-
- if (end_row != day_view->selection_end_row
- || end_col != day_view->selection_end_day) {
- need_redraw = TRUE;
- day_view->selection_in_top_canvas = TRUE;
- day_view->selection_end_row = -1;
- day_view->selection_end_day = end_col;
- }
-
- if (need_redraw) {
- gtk_widget_queue_draw (day_view->top_canvas);
- gtk_widget_queue_draw (day_view->main_canvas);
- }
-}
-
-static void
-e_day_view_set_selected_time_range_visible (EDayView *day_view,
- time_t start_time,
- time_t end_time)
-{
- gint start_row, start_col, end_row, end_col;
- gboolean need_redraw = FALSE, start_in_grid, end_in_grid;
-
- g_return_if_fail (E_IS_DAY_VIEW (day_view));
-
- /* Set the selection. */
- start_in_grid = e_day_view_convert_time_to_grid_position (day_view,
- start_time,
- &start_col,
- &start_row);
- end_in_grid = e_day_view_convert_time_to_grid_position (day_view,
- end_time - 60,
- &end_col,
- &end_row);
-
- /* If either of the times isn't in the grid, or the selection covers
- an entire day, we set the selection to 1 row from the start of the
- working day, in the day corresponding to the start time. */
- if (!start_in_grid || !end_in_grid
- || (start_row == 0 && end_row == day_view->rows - 1)) {
- end_col = start_col;
-
- start_row = e_day_view_convert_time_to_row (day_view, day_view->work_day_start_hour, day_view->work_day_start_minute);
- start_row = CLAMP (start_row, 0, day_view->rows - 1);
- end_row = start_row;
- }
-
- if (start_row != day_view->selection_start_row
- || start_col != day_view->selection_start_day) {
- need_redraw = TRUE;
- day_view->selection_in_top_canvas = FALSE;
- day_view->selection_start_row = start_row;
- day_view->selection_start_day = start_col;
- }
-
- if (end_row != day_view->selection_end_row
- || end_col != day_view->selection_end_day) {
- need_redraw = TRUE;
- day_view->selection_in_top_canvas = FALSE;
- day_view->selection_end_row = end_row;
- day_view->selection_end_day = end_col;
- }
-
- if (need_redraw) {
- gtk_widget_queue_draw (day_view->top_canvas);
- gtk_widget_queue_draw (day_view->main_canvas);
- }
-}
-
-
-/* Finds the start of the working week which includes the given time. */
-static time_t
-e_day_view_find_work_week_start (EDayView *day_view,
- time_t start_time)
-{
- GDate date;
- gint weekday, day, i;
- guint offset;
- struct icaltimetype tt = icaltime_null_time ();
-
- time_to_gdate_with_zone (&date, start_time, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
-
- /* The start of the work-week is the first working day after the
- week start day. */
-
- /* Get the weekday corresponding to start_time, 0 (Sun) to 6 (Sat). */
- weekday = g_date_weekday (&date) % 7;
-
- /* Calculate the first working day of the week, 0 (Sun) to 6 (Sat).
- It will automatically default to the week start day if no days
- are set as working days. */
- day = (day_view->week_start_day + 1) % 7;
- for (i = 0; i < 7; i++) {
- if (day_view->working_days & (1 << day))
- break;
- day = (day + 1) % 7;
- }
-
- /* Calculate how many days we need to go back to the first workday. */
- if (weekday < day) {
- offset = (day - weekday) % 7;
- g_date_add_days (&date, offset);
- } else {
- offset = (weekday - day) % 7;
- g_date_subtract_days (&date, offset);
- }
-
- tt.year = g_date_year (&date);
- tt.month = g_date_month (&date);
- tt.day = g_date_day (&date);
-
- return icaltime_as_timet_with_zone (tt, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
-}
-
-/* Returns the selected time range. */
-static void
-e_day_view_get_selected_time_range (ECalendarView *cal_view, time_t *start_time, time_t *end_time)
-{
- gint start_col, start_row, end_col, end_row;
- time_t start, end;
- EDayView *day_view = E_DAY_VIEW (cal_view);
-
- start_col = day_view->selection_start_day;
- start_row = day_view->selection_start_row;
- end_col = day_view->selection_end_day;
- end_row = day_view->selection_end_row;
-
- if (start_col == -1) {
- start_col = 0;
- start_row = 0;
- end_col = 0;
- end_row = 0;
- }
-
- /* Check if the selection is only in the top canvas, in which case
- we can simply use the day_starts array. */
- if (day_view->selection_in_top_canvas) {
- start = day_view->day_starts[start_col];
- end = day_view->day_starts[end_col + 1];
- } else {
- /* Convert the start col + row into a time. */
- start = e_day_view_convert_grid_position_to_time (day_view, start_col, start_row);
- end = e_day_view_convert_grid_position_to_time (day_view, end_col, end_row + 1);
- }
-
- if (start_time)
- *start_time = start;
-
- if (end_time)
- *end_time = end;
-}
-
-/* Gets the visible time range. Returns FALSE if no time range has been set. */
-static gboolean
-e_day_view_get_visible_time_range (ECalendarView *cal_view,
- time_t *start_time,
- time_t *end_time)
-{
- EDayView *day_view = E_DAY_VIEW (cal_view);
-
- /* If the date isn't set, return FALSE. */
- if (day_view->lower == 0 && day_view->upper == 0)
- return FALSE;
-
- *start_time = day_view->day_starts[0];
- *end_time = day_view->day_starts[day_view->days_shown];
-
- return TRUE;
-}
-
-static void
-e_day_view_recalc_day_starts (EDayView *day_view,
- time_t start_time)
-{
- gint day;
-
- day_view->day_starts[0] = start_time;
- for (day = 1; day <= day_view->days_shown; day++) {
- day_view->day_starts[day] = time_add_day_with_zone (day_view->day_starts[day - 1], 1, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
- }
-
-#if 0
- for (day = 0; day <= day_view->days_shown; day++)
- g_print ("Day Starts %i: %s", day, ctime (&day_view->day_starts[day]));
-#endif
-
- day_view->lower = start_time;
- day_view->upper = day_view->day_starts[day_view->days_shown];
-
- e_day_view_update_query (day_view);
-}
-
-
-/* Whether we are displaying a work-week, in which case the display always
- starts on the first day of the working week. */
-gboolean
-e_day_view_get_work_week_view (EDayView *day_view)
-{
- g_return_val_if_fail (E_IS_DAY_VIEW (day_view), FALSE);
-
- return day_view->work_week_view;
-}
-
-
-void
-e_day_view_set_work_week_view (EDayView *day_view,
- gboolean work_week_view)
-{
- g_return_if_fail (E_IS_DAY_VIEW (day_view));
-
- if (day_view->work_week_view == work_week_view)
- return;
-
- day_view->work_week_view = work_week_view;
-
- if (day_view->work_week_view)
- e_day_view_recalc_work_week (day_view);
-}
-
-
-gint
-e_day_view_get_days_shown (EDayView *day_view)
-{
- g_return_val_if_fail (E_IS_DAY_VIEW (day_view), -1);
-
- return day_view->days_shown;
-}
-
-
-void
-e_day_view_set_days_shown (EDayView *day_view,
- gint days_shown)
-{
- g_return_if_fail (E_IS_DAY_VIEW (day_view));
- g_return_if_fail (days_shown >= 1);
- g_return_if_fail (days_shown <= E_DAY_VIEW_MAX_DAYS);
-
- if (day_view->days_shown == days_shown)
- return;
-
- day_view->days_shown = days_shown;
-
- /* If the date isn't set, just return. */
- if (day_view->lower == 0 && day_view->upper == 0)
- return;
-
- e_day_view_recalc_day_starts (day_view, day_view->lower);
- e_day_view_recalc_cell_sizes (day_view);
-
- e_day_view_update_query ((ECalendarView *) day_view);
-}
-
-
-gint
-e_day_view_get_mins_per_row (EDayView *day_view)
-{
- g_return_val_if_fail (E_IS_DAY_VIEW (day_view), -1);
-
- return day_view->mins_per_row;
-}
-
-
-void
-e_day_view_set_mins_per_row (EDayView *day_view,
- gint mins_per_row)
-{
- gint day;
-
- g_return_if_fail (E_IS_DAY_VIEW (day_view));
-
- if (mins_per_row != 5 && mins_per_row != 10 && mins_per_row != 15
- && mins_per_row != 30 && mins_per_row != 60) {
- g_warning ("Invalid minutes per row setting");
- return;
- }
-
- if (day_view->mins_per_row == mins_per_row)
- return;
-
- day_view->mins_per_row = mins_per_row;
- e_day_view_recalc_num_rows (day_view);
-
- /* If we aren't visible, we'll sort it out later. */
- if (!GTK_WIDGET_VISIBLE (day_view))
- return;
-
- for (day = 0; day < E_DAY_VIEW_MAX_DAYS; day++)
- day_view->need_layout[day] = TRUE;
-
- /* We need to update all the day event labels since the start & end
- times may or may not be on row boundaries any more. */
- e_day_view_foreach_event (day_view,
- e_day_view_set_show_times_cb, NULL);
-
- /* We must layout the events before updating the scroll region, since
- that will result in a redraw which would crash otherwise. */
- e_day_view_check_layout (day_view);
- gtk_widget_queue_draw (day_view->time_canvas);
- gtk_widget_queue_draw (day_view->main_canvas);
-
- e_day_view_update_scroll_regions (day_view);
-}
-
-
-/* This specifies the working days in the week. The value is a bitwise
- combination of day flags. Defaults to Mon-Fri. */
-EDayViewDays
-e_day_view_get_working_days (EDayView *day_view)
-{
- g_return_val_if_fail (E_IS_DAY_VIEW (day_view), 0);
-
- return day_view->working_days;
-}
-
-
-void
-e_day_view_set_working_days (EDayView *day_view,
- EDayViewDays days)
-{
- g_return_if_fail (E_IS_DAY_VIEW (day_view));
-
- if (day_view->working_days == days)
- return;
-
- day_view->working_days = days;
-
- if (day_view->work_week_view)
- e_day_view_recalc_work_week (day_view);
-
- /* We have to do this, as the new working days may have no effect on
- the days shown, but we still want the background color to change. */
- gtk_widget_queue_draw (day_view->main_canvas);
-}
-
-
-static void
-e_day_view_recalc_work_week_days_shown (EDayView *day_view)
-{
- gint first_day, last_day, i, days_shown;
- gboolean has_working_days = FALSE;
-
- /* Find the first working day in the week, 0 (Sun) to 6 (Sat). */
- first_day = (day_view->week_start_day + 1) % 7;
- for (i = 0; i < 7; i++) {
- if (day_view->working_days & (1 << first_day)) {
- has_working_days = TRUE;
- break;
- }
- first_day = (first_day + 1) % 7;
- }
-
- if (has_working_days) {
- /* Now find the last working day of the week, backwards. */
- last_day = day_view->week_start_day % 7;
- for (i = 0; i < 7; i++) {
- if (day_view->working_days & (1 << last_day))
- break;
- last_day = (last_day + 6) % 7;
- }
- /* Now calculate the days we need to show to include all the
- working days in the week. Add 1 to make it inclusive. */
- days_shown = (last_day + 7 - first_day) % 7 + 1;
- } else {
- /* If no working days are set, just use 7. */
- days_shown = 7;
- }
-
- e_day_view_set_days_shown (day_view, days_shown);
-}
-
-
-/* The start and end time of the working day. This only affects the background
- colors. */
-void
-e_day_view_get_working_day (EDayView *day_view,
- gint *start_hour,
- gint *start_minute,
- gint *end_hour,
- gint *end_minute)
-{
- g_return_if_fail (E_IS_DAY_VIEW (day_view));
-
- *start_hour = day_view->work_day_start_hour;
- *start_minute = day_view->work_day_start_minute;
- *end_hour = day_view->work_day_end_hour;
- *end_minute = day_view->work_day_end_minute;
-}
-
-
-void
-e_day_view_set_working_day (EDayView *day_view,
- gint start_hour,
- gint start_minute,
- gint end_hour,
- gint end_minute)
-{
- g_return_if_fail (E_IS_DAY_VIEW (day_view));
-
- day_view->work_day_start_hour = start_hour;
- day_view->work_day_start_minute = start_minute;
- day_view->work_day_end_hour = end_hour;
- day_view->work_day_end_minute = end_minute;
-
- gtk_widget_queue_draw (day_view->main_canvas);
-}
-
-/* Whether we display event end times in the main canvas. */
-gboolean
-e_day_view_get_show_event_end_times (EDayView *day_view)
-{
- g_return_val_if_fail (E_IS_DAY_VIEW (day_view), TRUE);
-
- return day_view->show_event_end_times;
-}
-
-
-void
-e_day_view_set_show_event_end_times (EDayView *day_view,
- gboolean show)
-{
- g_return_if_fail (E_IS_DAY_VIEW (day_view));
-
- if (day_view->show_event_end_times != show) {
- day_view->show_event_end_times = show;
- e_day_view_foreach_event (day_view,
- e_day_view_set_show_times_cb, NULL);
- }
-}
-
-/* This is a callback used to update all day event labels. */
-static gboolean
-e_day_view_set_show_times_cb (EDayView *day_view,
- gint day,
- gint event_num,
- gpointer data)
-{
- if (day != E_DAY_VIEW_LONG_EVENT) {
- e_day_view_update_event_label (day_view, day, event_num);
- }
-
- return TRUE;
-}
-
-
-/* The first day of the week, 0 (Monday) to 6 (Sunday). */
-gint
-e_day_view_get_week_start_day (EDayView *day_view)
-{
- g_return_val_if_fail (E_IS_DAY_VIEW (day_view), 0);
-
- return day_view->week_start_day;
-}
-
-
-void
-e_day_view_set_week_start_day (EDayView *day_view,
- gint week_start_day)
-{
- g_return_if_fail (E_IS_DAY_VIEW (day_view));
- g_return_if_fail (week_start_day >= 0);
- g_return_if_fail (week_start_day < 7);
-
- if (day_view->week_start_day == week_start_day)
- return;
-
- day_view->week_start_day = week_start_day;
-
- if (day_view->work_week_view)
- e_day_view_recalc_work_week (day_view);
-}
-
-static void
-e_day_view_recalc_work_week (EDayView *day_view)
-{
- time_t lower;
-
- /* If we aren't showing the work week, just return. */
- if (!day_view->work_week_view)
- return;
-
- e_day_view_recalc_work_week_days_shown (day_view);
-
- /* If the date isn't set, just return. */
- if (day_view->lower == 0 && day_view->upper == 0)
- return;
-
- lower = e_day_view_find_work_week_start (day_view, day_view->lower);
- if (lower != day_view->lower) {
- /* Reset the selection, as it may disappear. */
- day_view->selection_start_day = -1;
-
- e_day_view_recalc_day_starts (day_view, lower);
- e_day_view_update_query ((ECalendarView *) day_view);
-
- /* This updates the date navigator. */
- e_day_view_update_calendar_selection_time (day_view);
- }
-}
-
-
-static gboolean
-e_day_view_update_scroll_regions (EDayView *day_view)
-{
- gdouble old_x2, old_y2, new_x2, new_y2;
- gboolean need_reshape = FALSE;
-
- /* Set the scroll region of the time canvas to its allocated width,
- but with the height the same as the main canvas. */
- gnome_canvas_get_scroll_region (GNOME_CANVAS (day_view->time_canvas),
- NULL, NULL, &old_x2, &old_y2);
- new_x2 = day_view->time_canvas->allocation.width - 1;
- new_y2 = MAX (day_view->rows * day_view->row_height,
- day_view->main_canvas->allocation.height) - 1;
- if (old_x2 != new_x2 || old_y2 != new_y2)
- gnome_canvas_set_scroll_region (GNOME_CANVAS (day_view->time_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 (day_view->main_canvas),
- NULL, NULL, &old_x2, &old_y2);
- new_x2 = day_view->main_canvas->allocation.width - 1;
- if (old_x2 != new_x2 || old_y2 != new_y2) {
- need_reshape = TRUE;
- gnome_canvas_set_scroll_region (GNOME_CANVAS (day_view->main_canvas),
- 0, 0, new_x2, new_y2);
- }
-
- return need_reshape;
-}
-
-
-/* This recalculates the number of rows to display, based on the time range
- shown and the minutes per row. */
-static void
-e_day_view_recalc_num_rows (EDayView *day_view)
-{
- gint hours, minutes, total_minutes;
-
- hours = day_view->last_hour_shown - day_view->first_hour_shown;
- /* This could be negative but it works out OK. */
- minutes = day_view->last_minute_shown - day_view->first_minute_shown;
- total_minutes = hours * 60 + minutes;
- day_view->rows = total_minutes / day_view->mins_per_row;
-}
-
-
-/* Converts an hour and minute to a row in the canvas. Note that if we aren't
- showing all 24 hours of the day, the returned row may be negative or
- greater than day_view->rows. */
-gint
-e_day_view_convert_time_to_row (EDayView *day_view,
- gint hour,
- gint minute)
-{
- gint total_minutes, start_minute, offset;
-
- total_minutes = hour * 60 + minute;
- start_minute = day_view->first_hour_shown * 60
- + day_view->first_minute_shown;
- offset = total_minutes - start_minute;
- if (offset < 0)
- return -1;
- else
- return offset / day_view->mins_per_row;
-}
-
-
-/* Converts an hour and minute to a y coordinate in the canvas. */
-gint
-e_day_view_convert_time_to_position (EDayView *day_view,
- gint hour,
- gint minute)
-{
- gint total_minutes, start_minute, offset;
-
- total_minutes = hour * 60 + minute;
- start_minute = day_view->first_hour_shown * 60
- + day_view->first_minute_shown;
- offset = total_minutes - start_minute;
-
- return offset * day_view->row_height / day_view->mins_per_row;
-}
-
-
-static gboolean
-e_day_view_on_top_canvas_button_press (GtkWidget *widget,
- GdkEventButton *event,
- EDayView *day_view)
-{
- gint event_x, event_y, day, event_num;
- ECalendarViewPosition pos;
-
- /* Convert the coords to the main canvas window, or return if the
- window is not found. */
- if (!e_day_view_convert_event_coords (day_view, (GdkEvent*) event,
- GTK_LAYOUT (widget)->bin_window,
- &event_x, &event_y))
- return FALSE;
-
- pos = e_day_view_convert_position_in_top_canvas (day_view,
- event_x, event_y,
- &day, &event_num);
-
- if (pos == E_CALENDAR_VIEW_POS_OUTSIDE)
- return FALSE;
-
- if (pos != E_CALENDAR_VIEW_POS_NONE)
- return e_day_view_on_long_event_button_press (day_view,
- event_num,
- event, pos,
- event_x,
- event_y);
-
- e_day_view_stop_editing_event (day_view);
-
- if (event->button == 1) {
- if (event->type == GDK_2BUTTON_PRESS) {
- time_t dtstart, dtend;
-
- e_day_view_get_selected_time_range ((ECalendarView *) day_view, &dtstart, &dtend);
- e_calendar_view_new_appointment_for (E_CALENDAR_VIEW (day_view),
- dtstart, dtend,
- TRUE, FALSE);
- return TRUE;
- }
-
- if (!GTK_WIDGET_HAS_FOCUS (day_view))
- gtk_widget_grab_focus (GTK_WIDGET (day_view));
-
- if (gdk_pointer_grab (GTK_LAYOUT (widget)->bin_window, FALSE,
- GDK_POINTER_MOTION_MASK
- | GDK_BUTTON_RELEASE_MASK,
- FALSE, NULL, event->time) == 0) {
- e_day_view_start_selection (day_view, day, -1);
- }
- } else if (event->button == 3) {
- if (!GTK_WIDGET_HAS_FOCUS (day_view))
- gtk_widget_grab_focus (GTK_WIDGET (day_view));
-
- if (day < day_view->selection_start_day || day > day_view->selection_end_day) {
- e_day_view_start_selection (day_view, day, -1);
- e_day_view_finish_selection (day_view);
- }
-
- e_day_view_on_event_right_click (day_view, event, -1, -1);
- }
-
- return TRUE;
-}
-
-
-static gboolean
-e_day_view_convert_event_coords (EDayView *day_view,
- GdkEvent *event,
- GdkWindow *window,
- gint *x_return,
- gint *y_return)
-{
- gint event_x, event_y, win_x, win_y;
- GdkWindow *event_window;;
-
- /* Get the event window, x & y from the appropriate event struct. */
- switch (event->type) {
- case GDK_BUTTON_PRESS:
- case GDK_2BUTTON_PRESS:
- case GDK_3BUTTON_PRESS:
- case GDK_BUTTON_RELEASE:
- event_x = event->button.x;
- event_y = event->button.y;
- event_window = event->button.window;
- break;
- case GDK_MOTION_NOTIFY:
- event_x = event->motion.x;
- event_y = event->motion.y;
- event_window = event->motion.window;
- break;
- default:
- /* Shouldn't get here. */
- g_assert_not_reached ();
- return FALSE;
- }
-
- while (event_window && event_window != window
- && event_window != GDK_ROOT_PARENT()) {
- gdk_window_get_position (event_window, &win_x, &win_y);
- event_x += win_x;
- event_y += win_y;
- event_window = gdk_window_get_parent (event_window);
- }
-
- *x_return = event_x;
- *y_return = event_y;
-
- if (event_window != window)
- g_warning ("Couldn't find event window\n");
-
- return (event_window == window) ? TRUE : FALSE;
-}
-
-
-static gboolean
-e_day_view_on_main_canvas_button_press (GtkWidget *widget,
- GdkEventButton *event,
- EDayView *day_view)
-{
- gint event_x, event_y, row, day, event_num;
- ECalendarViewPosition pos;
-
-#if 0
- g_print ("In e_day_view_on_main_canvas_button_press\n");
-#endif
-
- /* Convert the coords to the main canvas window, or return if the
- window is not found. */
- if (!e_day_view_convert_event_coords (day_view, (GdkEvent*) event,
- GTK_LAYOUT (widget)->bin_window,
- &event_x, &event_y))
- return FALSE;
-
- /* Find out where the mouse is. */
- pos = e_day_view_convert_position_in_main_canvas (day_view,
- event_x, event_y,
- &day, &row,
- &event_num);
-
- if (pos == E_CALENDAR_VIEW_POS_OUTSIDE)
- return FALSE;
-
- if (pos != E_CALENDAR_VIEW_POS_NONE)
- return e_day_view_on_event_button_press (day_view, day,
- event_num, event, pos,
- event_x, event_y);
-
- e_day_view_stop_editing_event (day_view);
-
- /* Start the selection drag. */
- if (event->button == 1) {
- if (event->type == GDK_2BUTTON_PRESS) {
- time_t dtstart, dtend;
-
- e_day_view_get_selected_time_range ((ECalendarView *) day_view, &dtstart, &dtend);
- e_calendar_view_new_appointment_for (E_CALENDAR_VIEW (day_view),
- dtstart, dtend,
- FALSE, FALSE);
- return TRUE;
- }
-
- if (!GTK_WIDGET_HAS_FOCUS (day_view))
- gtk_widget_grab_focus (GTK_WIDGET (day_view));
-
- if (gdk_pointer_grab (GTK_LAYOUT (widget)->bin_window, FALSE,
- GDK_POINTER_MOTION_MASK
- | GDK_BUTTON_RELEASE_MASK,
- FALSE, NULL, event->time) == 0) {
- e_day_view_start_selection (day_view, day, row);
- }
- } else if (event->button == 3) {
- if (!GTK_WIDGET_HAS_FOCUS (day_view))
- gtk_widget_grab_focus (GTK_WIDGET (day_view));
-
-
- if ((day < day_view->selection_start_day || day > day_view->selection_end_day)
- || (day == day_view->selection_start_day && row < day_view->selection_start_row)
- || (day == day_view->selection_end_day && row > day_view->selection_end_row)) {
- e_day_view_start_selection (day_view, day, row);
- e_day_view_finish_selection (day_view);
- }
-
- e_day_view_on_event_right_click (day_view, event, -1, -1);
- }
-
- return TRUE;
-}
-
-static gboolean
-e_day_view_on_main_canvas_scroll (GtkWidget *widget,
- GdkEventScroll *scroll,
- EDayView *day_view)
-{
- switch (scroll->direction) {
- case GDK_SCROLL_UP:
- e_day_view_scroll (day_view, E_DAY_VIEW_WHEEL_MOUSE_STEP_SIZE);
- return TRUE;
- case GDK_SCROLL_DOWN:
- e_day_view_scroll (day_view, -E_DAY_VIEW_WHEEL_MOUSE_STEP_SIZE);
- return TRUE;
- default:
- break;
- }
-
- return FALSE;
-}
-
-
-static gboolean
-e_day_view_on_time_canvas_scroll (GtkWidget *widget,
- GdkEventScroll *scroll,
- EDayView *day_view)
-{
-
- switch (scroll->direction) {
- case GDK_SCROLL_UP:
- e_day_view_scroll (day_view, E_DAY_VIEW_WHEEL_MOUSE_STEP_SIZE);
- return TRUE;
- case GDK_SCROLL_DOWN:
- e_day_view_scroll (day_view, -E_DAY_VIEW_WHEEL_MOUSE_STEP_SIZE);
- return TRUE;
- default:
- break;
- }
-
- return FALSE;
-}
-
-static gboolean
-e_day_view_on_long_event_button_press (EDayView *day_view,
- gint event_num,
- GdkEventButton *event,
- ECalendarViewPosition pos,
- gint event_x,
- gint event_y)
-{
- if (event->button == 1) {
- if (event->type == GDK_BUTTON_PRESS) {
- e_day_view_on_long_event_click (day_view, event_num,
- event, pos,
- event_x, event_y);
- return TRUE;
- } else if (event->type == GDK_2BUTTON_PRESS) {
- e_day_view_on_event_double_click (day_view, -1,
- event_num);
- gtk_signal_emit_stop_by_name (GTK_OBJECT (day_view->top_canvas),
- "button_press_event");
- return TRUE;
- }
- } else if (event->button == 3) {
- EDayViewEvent *e;
-
- e = &g_array_index (day_view->long_events, EDayViewEvent, event_num);
-
- if (!GTK_WIDGET_HAS_FOCUS (day_view))
- gtk_widget_grab_focus (GTK_WIDGET (day_view));
-
- e_day_view_set_selected_time_range_in_top_visible (day_view, e->start, e->end);
-
- e_day_view_on_event_right_click (day_view, event,
- E_DAY_VIEW_LONG_EVENT,
- event_num);
-
- return TRUE;
- }
- return FALSE;
-}
-
-
-static gboolean
-e_day_view_on_event_button_press (EDayView *day_view,
- gint day,
- gint event_num,
- GdkEventButton *event,
- ECalendarViewPosition pos,
- gint event_x,
- gint event_y)
-{
- if (event->button == 1) {
- if (event->type == GDK_BUTTON_PRESS) {
- e_day_view_on_event_click (day_view, day, event_num,
- event, pos,
- event_x, event_y);
- return TRUE;
- } else if (event->type == GDK_2BUTTON_PRESS) {
- e_day_view_on_event_double_click (day_view, day,
- event_num);
- gtk_signal_emit_stop_by_name (GTK_OBJECT (day_view->main_canvas),
- "button_press_event");
- return TRUE;
- }
- } else if (event->button == 3) {
- EDayViewEvent *e;
-
- e = &g_array_index (day_view->events[day], EDayViewEvent, event_num);
-
- if (!GTK_WIDGET_HAS_FOCUS (day_view))
- gtk_widget_grab_focus (GTK_WIDGET (day_view));
-
- e_day_view_set_selected_time_range_visible (day_view, e->start, e->end);
-
- e_day_view_on_event_right_click (day_view, event,
- day, event_num);
-
- return TRUE;
- }
- return FALSE;
-}
-
-
-static void
-e_day_view_on_long_event_click (EDayView *day_view,
- gint event_num,
- GdkEventButton *bevent,
- ECalendarViewPosition pos,
- gint event_x,
- gint event_y)
-{
- EDayViewEvent *event;
- gint start_day, end_day, day;
- gint item_x, item_y, item_w, item_h;
-
- event = &g_array_index (day_view->long_events, EDayViewEvent,
- event_num);
-
- /* Ignore clicks on the EText while editing. */
- if (pos == E_CALENDAR_VIEW_POS_EVENT
- && E_TEXT (event->canvas_item)->editing)
- return;
-
- if ((e_cal_util_component_is_instance (event->comp_data->icalcomp) ||
- !e_cal_util_component_has_recurrences (event->comp_data->icalcomp))
- && (pos == E_CALENDAR_VIEW_POS_LEFT_EDGE
- || pos == E_CALENDAR_VIEW_POS_RIGHT_EDGE)) {
- if (!e_day_view_find_long_event_days (event,
- day_view->days_shown,
- day_view->day_starts,
- &start_day, &end_day))
- return;
-
- /* Grab the keyboard focus, so the event being edited is saved
- and we can use the Escape key to abort the resize. */
- if (!GTK_WIDGET_HAS_FOCUS (day_view))
- gtk_widget_grab_focus (GTK_WIDGET (day_view));
-
- if (gdk_pointer_grab (GTK_LAYOUT (day_view->top_canvas)->bin_window, FALSE,
- GDK_POINTER_MOTION_MASK
- | GDK_BUTTON_RELEASE_MASK,
- FALSE, NULL, bevent->time) == 0) {
-
- day_view->resize_event_day = E_DAY_VIEW_LONG_EVENT;
- day_view->resize_event_num = event_num;
- day_view->resize_drag_pos = pos;
- day_view->resize_start_row = start_day;
- day_view->resize_end_row = end_day;
-
- /* Create the edit rect if necessary. */
- e_day_view_reshape_resize_long_event_rect_item (day_view);
-
- /* Make sure the text item is on top. */
- gnome_canvas_item_raise_to_top (day_view->resize_long_event_rect_item);
-
- /* Raise the event's item, above the rect as well. */
- gnome_canvas_item_raise_to_top (event->canvas_item);
- }
- } else if (e_day_view_get_long_event_position (day_view, event_num,
- &start_day, &end_day,
- &item_x, &item_y,
- &item_w, &item_h)) {
- /* Remember the item clicked and the mouse position,
- so we can start a drag if the mouse moves. */
- day_view->pressed_event_day = E_DAY_VIEW_LONG_EVENT;
- day_view->pressed_event_num = event_num;
-
- day_view->drag_event_x = event_x;
- day_view->drag_event_y = event_y;
-
- e_day_view_convert_position_in_top_canvas (day_view,
- event_x, event_y,
- &day, NULL);
- day_view->drag_event_offset = day - start_day;
- }
-}
-
-
-static void
-e_day_view_on_event_click (EDayView *day_view,
- gint day,
- gint event_num,
- GdkEventButton *bevent,
- ECalendarViewPosition pos,
- gint event_x,
- gint event_y)
-{
- EDayViewEvent *event;
- gint tmp_day, row, start_row;
-
- event = &g_array_index (day_view->events[day], EDayViewEvent,
- event_num);
-
- /* Ignore clicks on the EText while editing. */
- if (pos == E_CALENDAR_VIEW_POS_EVENT
- && E_TEXT (event->canvas_item)->editing)
- return;
-
- if ((e_cal_util_component_is_instance (event->comp_data->icalcomp) ||
- !e_cal_util_component_has_recurrences (event->comp_data->icalcomp))
- && (pos == E_CALENDAR_VIEW_POS_TOP_EDGE
- || pos == E_CALENDAR_VIEW_POS_BOTTOM_EDGE)) {
- /* Grab the keyboard focus, so the event being edited is saved
- and we can use the Escape key to abort the resize. */
- if (!GTK_WIDGET_HAS_FOCUS (day_view))
- gtk_widget_grab_focus (GTK_WIDGET (day_view));
-
- if (gdk_pointer_grab (GTK_LAYOUT (day_view->main_canvas)->bin_window, FALSE,
- GDK_POINTER_MOTION_MASK
- | GDK_BUTTON_RELEASE_MASK,
- FALSE, NULL, bevent->time) == 0) {
-
- day_view->resize_event_day = day;
- day_view->resize_event_num = event_num;
- day_view->resize_drag_pos = pos;
- day_view->resize_start_row = event->start_minute / day_view->mins_per_row;
- day_view->resize_end_row = (event->end_minute - 1) / day_view->mins_per_row;
- if (day_view->resize_end_row < day_view->resize_start_row)
- day_view->resize_end_row = day_view->resize_start_row;
-
- day_view->resize_bars_event_day = day;
- day_view->resize_bars_event_num = event_num;
-
- /* Create the edit rect if necessary. */
- e_day_view_reshape_resize_rect_item (day_view);
-
- e_day_view_reshape_main_canvas_resize_bars (day_view);
-
- /* Make sure the text item is on top. */
- gnome_canvas_item_raise_to_top (day_view->resize_rect_item);
- gnome_canvas_item_raise_to_top (day_view->resize_bar_item);
-
- /* Raise the event's item, above the rect as well. */
- gnome_canvas_item_raise_to_top (event->canvas_item);
- }
-
- } else {
- /* Remember the item clicked and the mouse position,
- so we can start a drag if the mouse moves. */
- day_view->pressed_event_day = day;
- day_view->pressed_event_num = event_num;
-
- day_view->drag_event_x = event_x;
- day_view->drag_event_y = event_y;
-
- e_day_view_convert_position_in_main_canvas (day_view,
- event_x, event_y,
- &tmp_day, &row,
- NULL);
- start_row = event->start_minute / day_view->mins_per_row;
- day_view->drag_event_offset = row - start_row;
- }
-}
-
-
-static void
-e_day_view_reshape_resize_long_event_rect_item (EDayView *day_view)
-{
- gint day, event_num, start_day, end_day;
- gint item_x, item_y, item_w, item_h;
- gdouble x1, y1, x2, y2;
-
- day = day_view->resize_event_day;
- event_num = day_view->resize_event_num;
-
- /* If we're not resizing an event, or the event is not shown,
- hide the resize bars. */
- if (day_view->resize_drag_pos == E_CALENDAR_VIEW_POS_NONE
- || !e_day_view_get_long_event_position (day_view, event_num,
- &start_day, &end_day,
- &item_x, &item_y,
- &item_w, &item_h)) {
- gnome_canvas_item_hide (day_view->resize_long_event_rect_item);
- return;
- }
-
- x1 = item_x;
- y1 = item_y;
- x2 = item_x + item_w - 1;
- y2 = item_y + item_h - 1;
-
- gnome_canvas_item_set (day_view->resize_long_event_rect_item,
- "x1", x1,
- "y1", y1,
- "x2", x2,
- "y2", y2,
- NULL);
- gnome_canvas_item_show (day_view->resize_long_event_rect_item);
-}
-
-
-static void
-e_day_view_reshape_resize_rect_item (EDayView *day_view)
-{
- gint day, event_num;
- gint item_x, item_y, item_w, item_h;
- gdouble x1, y1, x2, y2;
-
- day = day_view->resize_event_day;
- event_num = day_view->resize_event_num;
-
- /* If we're not resizing an event, or the event is not shown,
- hide the resize bars. */
- if (day_view->resize_drag_pos == E_CALENDAR_VIEW_POS_NONE
- || !e_day_view_get_event_position (day_view, day, event_num,
- &item_x, &item_y,
- &item_w, &item_h)) {
- gnome_canvas_item_hide (day_view->resize_rect_item);
- return;
- }
-
- x1 = item_x;
- y1 = item_y;
- x2 = item_x + item_w - 1;
- y2 = item_y + item_h - 1;
-
- gnome_canvas_item_set (day_view->resize_rect_item,
- "x1", x1 + E_DAY_VIEW_BAR_WIDTH - 1,
- "y1", y1,
- "x2", x2,
- "y2", y2,
- NULL);
- gnome_canvas_item_show (day_view->resize_rect_item);
-
- gnome_canvas_item_set (day_view->resize_bar_item,
- "x1", x1,
- "y1", y1,
- "x2", x1 + E_DAY_VIEW_BAR_WIDTH - 1,
- "y2", y2,
- NULL);
- gnome_canvas_item_show (day_view->resize_bar_item);
-}
-
-
-static void
-e_day_view_on_event_double_click (EDayView *day_view,
- gint day,
- gint event_num)
-{
- EDayViewEvent *event;
-
- if (day == -1)
- event = &g_array_index (day_view->long_events, EDayViewEvent,
- event_num);
- else
- event = &g_array_index (day_view->events[day], EDayViewEvent,
- event_num);
-
- e_day_view_stop_editing_event (day_view);
-
- e_calendar_view_edit_appointment (E_CALENDAR_VIEW (day_view),
- event->comp_data->client,
- event->comp_data->icalcomp, FALSE);
-}
-
-static void
-e_day_view_show_popup_menu (EDayView *day_view,
- GdkEvent *gdk_event,
- gint day,
- gint event_num)
-{
- GtkMenu *popup;
-
- day_view->popup_event_day = day;
- day_view->popup_event_num = event_num;
-
- popup = e_calendar_view_create_popup_menu (E_CALENDAR_VIEW (day_view));
- e_popup_menu (popup, gdk_event);
-}
-
-static gboolean
-e_day_view_popup_menu (GtkWidget *widget)
-{
- EDayView *day_view = E_DAY_VIEW (widget);
- e_day_view_show_popup_menu (day_view, NULL,
- day_view->editing_event_day,
- day_view->editing_event_num);
- return TRUE;
-}
-
-/* Returns the currently-selected event, or NULL if none */
-static GList *
-e_day_view_get_selected_events (ECalendarView *cal_view)
-{
- EDayViewEvent *event = NULL;
- GList *list = NULL;
- EDayView *day_view = (EDayView *) cal_view;
-
- g_return_val_if_fail (E_IS_DAY_VIEW (day_view), NULL);
-
- if (day_view->editing_event_num != -1) {
- if (day_view->editing_event_day == E_DAY_VIEW_LONG_EVENT)
- event = &g_array_index (day_view->long_events,
- EDayViewEvent,
- day_view->editing_event_num);
- else
- event = &g_array_index (day_view->events[day_view->editing_event_day],
- EDayViewEvent,
- day_view->editing_event_num);
- } else if (day_view->popup_event_num != -1) {
- if (day_view->popup_event_day == E_DAY_VIEW_LONG_EVENT)
- event = &g_array_index (day_view->long_events,
- EDayViewEvent,
- day_view->popup_event_num);
- else
- event = &g_array_index (day_view->events[day_view->popup_event_day],
- EDayViewEvent,
- day_view->popup_event_num);
- }
-
- if (event)
- list = g_list_append (list, event);
-
- return list;
-}
-
-static void
-process_component (EDayView *day_view, ECalModelComponent *comp_data)
-{
- EDayViewEvent *event;
- gint day, event_num;
- const char *uid;
- ECalComponent *comp;
- AddEventData add_event_data;
-
- /* If our time hasn't been set yet, just return. */
- if (day_view->lower == 0 && day_view->upper == 0)
- return;
-
- /* If the event already exists and the dates didn't change, we can
- update the event fairly easily without changing the events arrays
- or computing a new layout. */
- uid = icalcomponent_get_uid (comp_data->icalcomp);
-
- if (e_day_view_find_event_from_uid (day_view, uid, &day, &event_num)) {
- if (day == E_DAY_VIEW_LONG_EVENT)
- event = &g_array_index (day_view->long_events,
- EDayViewEvent, event_num);
- else
- event = &g_array_index (day_view->events[day],
- EDayViewEvent, event_num);
-
- if (!e_cal_util_component_has_recurrences (comp_data->icalcomp)
- && e_cal_util_event_dates_match (event->comp_data->icalcomp, comp_data->icalcomp)) {
-#if 0
- g_print ("updated object's dates unchanged\n");
-#endif
- e_day_view_foreach_event_with_uid (day_view, uid, e_day_view_update_event_cb, comp_data);
- gtk_widget_queue_draw (day_view->top_canvas);
- gtk_widget_queue_draw (day_view->main_canvas);
- return;
- }
-
- /* The dates have changed, so we need to remove the
- old occurrrences before adding the new ones. */
-#if 0
- g_print ("dates changed - removing occurrences\n");
-#endif
- e_day_view_foreach_event_with_uid (day_view, uid,
- e_day_view_remove_event_cb,
- NULL);
- }
-
- /* Add the occurrences of the event */
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (comp_data->icalcomp));
-
- add_event_data.day_view = day_view;
- add_event_data.comp_data = comp_data;
- e_cal_recur_generate_instances (comp, day_view->lower,
- day_view->upper,
- e_day_view_add_event, &add_event_data,
- e_cal_resolve_tzid_cb, comp_data->client,
- e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
-
- g_object_unref (comp);
-
- e_day_view_queue_layout (day_view);
-}
-
-/* Restarts a query for the day view */
-static void
-e_day_view_update_query (ECalendarView *cal_view)
-{
- gint rows, r;
- EDayView *day_view = E_DAY_VIEW (cal_view);
-
- e_day_view_stop_editing_event (day_view);
-
- gtk_widget_queue_draw (day_view->top_canvas);
- gtk_widget_queue_draw (day_view->main_canvas);
- e_day_view_free_events (day_view);
- e_day_view_queue_layout (day_view);
-
- rows = e_table_model_row_count (E_TABLE_MODEL (e_calendar_view_get_model (E_CALENDAR_VIEW (day_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 (day_view)), r);
- g_assert (comp_data != NULL);
- process_component (day_view, comp_data);
- }
-}
-
-static void
-e_day_view_on_event_right_click (EDayView *day_view,
- GdkEventButton *bevent,
- gint day,
- gint event_num)
-{
- e_day_view_show_popup_menu (day_view, (GdkEvent*)bevent,
- day, event_num);
-}
-
-static EDayViewEvent*
-e_day_view_get_popup_menu_event (EDayView *day_view)
-{
- if (day_view->popup_event_num == -1)
- return NULL;
-
- if (day_view->popup_event_day == E_DAY_VIEW_LONG_EVENT)
- return &g_array_index (day_view->long_events,
- EDayViewEvent,
- day_view->popup_event_num);
- else
- return &g_array_index (day_view->events[day_view->popup_event_day],
- EDayViewEvent,
- day_view->popup_event_num);
-}
-
-
-static gboolean
-e_day_view_on_top_canvas_button_release (GtkWidget *widget,
- GdkEventButton *event,
- EDayView *day_view)
-{
- if (day_view->selection_is_being_dragged) {
- gdk_pointer_ungrab (event->time);
- e_day_view_finish_selection (day_view);
- } else if (day_view->resize_drag_pos != E_CALENDAR_VIEW_POS_NONE) {
- gdk_pointer_ungrab (event->time);
- e_day_view_finish_long_event_resize (day_view);
- } else if (day_view->pressed_event_day != -1) {
- e_day_view_start_editing_event (day_view,
- day_view->pressed_event_day,
- day_view->pressed_event_num,
- NULL);
- }
-
- day_view->pressed_event_day = -1;
-
- return FALSE;
-}
-
-
-static gboolean
-e_day_view_on_main_canvas_button_release (GtkWidget *widget,
- GdkEventButton *event,
- EDayView *day_view)
-{
-#if 0
- g_print ("In e_day_view_on_main_canvas_button_release\n");
-#endif
-
- if (day_view->selection_is_being_dragged) {
- gdk_pointer_ungrab (event->time);
- e_day_view_finish_selection (day_view);
- e_day_view_stop_auto_scroll (day_view);
- } else if (day_view->resize_drag_pos != E_CALENDAR_VIEW_POS_NONE) {
- gdk_pointer_ungrab (event->time);
- e_day_view_finish_resize (day_view);
- e_day_view_stop_auto_scroll (day_view);
- } else if (day_view->pressed_event_day != -1) {
- e_day_view_start_editing_event (day_view,
- day_view->pressed_event_day,
- day_view->pressed_event_num,
- NULL);
- }
-
- day_view->pressed_event_day = -1;
-
- return FALSE;
-}
-
-
-void
-e_day_view_update_calendar_selection_time (EDayView *day_view)
-{
- time_t start, end;
- GnomeCalendar *calendar;
-
- e_day_view_get_selected_time_range ((ECalendarView *) day_view, &start, &end);
-
-#if 0
- g_print ("Start: %s", ctime (&start));
- g_print ("End : %s", ctime (&end));
-#endif
-
- calendar = e_calendar_view_get_calendar (E_CALENDAR_VIEW (day_view));
- if (calendar)
- gnome_calendar_set_selected_time_range (calendar,
- start, end);
-}
-
-
-static gboolean
-e_day_view_on_top_canvas_motion (GtkWidget *widget,
- GdkEventMotion *mevent,
- EDayView *day_view)
-{
- EDayViewEvent *event = NULL;
- ECalendarViewPosition pos;
- gint event_x, event_y, canvas_x, canvas_y;
- gint day, event_num;
- GdkCursor *cursor;
-
-#if 0
- g_print ("In e_day_view_on_top_canvas_motion\n");
-#endif
-
- /* Convert the coords to the main canvas window, or return if the
- window is not found. */
- if (!e_day_view_convert_event_coords (day_view, (GdkEvent*) mevent,
- GTK_LAYOUT (widget)->bin_window,
- &event_x, &event_y))
- return FALSE;
-
- canvas_x = event_x;
- canvas_y = event_y;
-
- pos = e_day_view_convert_position_in_top_canvas (day_view,
- canvas_x, canvas_y,
- &day, &event_num);
- if (event_num != -1)
- event = &g_array_index (day_view->long_events, EDayViewEvent,
- event_num);
-
- if (day_view->selection_is_being_dragged) {
- e_day_view_update_selection (day_view, day, -1);
- return TRUE;
- } else if (day_view->resize_drag_pos != E_CALENDAR_VIEW_POS_NONE) {
- if (pos != E_CALENDAR_VIEW_POS_OUTSIDE) {
- e_day_view_update_long_event_resize (day_view, day);
- return TRUE;
- }
- } else if (day_view->pressed_event_day == E_DAY_VIEW_LONG_EVENT) {
- GtkTargetList *target_list;
-
- event = &g_array_index (day_view->long_events, EDayViewEvent,
- day_view->pressed_event_num);
-
- if ((e_cal_util_component_is_instance (event->comp_data->icalcomp) ||
- !e_cal_util_component_has_recurrences (event->comp_data->icalcomp))
- && (abs (canvas_x - day_view->drag_event_x)
- > E_DAY_VIEW_DRAG_START_OFFSET
- || abs (canvas_y - day_view->drag_event_y)
- > E_DAY_VIEW_DRAG_START_OFFSET)) {
- day_view->drag_event_day = day_view->pressed_event_day;
- day_view->drag_event_num = day_view->pressed_event_num;
- day_view->pressed_event_day = -1;
-
- /* Hide the horizontal bars. */
- if (day_view->resize_bars_event_day != -1) {
- day_view->resize_bars_event_day = -1;
- day_view->resize_bars_event_num = -1;
- gnome_canvas_item_hide (day_view->main_canvas_top_resize_bar_item);
- gnome_canvas_item_hide (day_view->main_canvas_bottom_resize_bar_item);
- }
-
- target_list = gtk_target_list_new (target_table,
- n_targets);
- gtk_drag_begin (widget, target_list,
- GDK_ACTION_COPY | GDK_ACTION_MOVE,
- 1, (GdkEvent*)mevent);
- gtk_target_list_unref (target_list);
- }
- } else {
- cursor = day_view->normal_cursor;
-
- /* Recurring events can't be resized. */
- if (event && (e_cal_util_component_is_instance (event->comp_data->icalcomp) ||
- !e_cal_util_component_has_recurrences (event->comp_data->icalcomp))) {
- switch (pos) {
- case E_CALENDAR_VIEW_POS_LEFT_EDGE:
- case E_CALENDAR_VIEW_POS_RIGHT_EDGE:
- cursor = day_view->resize_width_cursor;
- break;
- default:
- break;
- }
- }
-
- /* Only set the cursor if it is different to last one set. */
- if (day_view->last_cursor_set_in_top_canvas != cursor) {
- day_view->last_cursor_set_in_top_canvas = cursor;
- gdk_window_set_cursor (widget->window, cursor);
- }
-
- }
-
- return FALSE;
-}
-
-
-static gboolean
-e_day_view_on_main_canvas_motion (GtkWidget *widget,
- GdkEventMotion *mevent,
- EDayView *day_view)
-{
- EDayViewEvent *event = NULL;
- ECalendarViewPosition pos;
- gint event_x, event_y, canvas_x, canvas_y;
- gint row, day, event_num;
- GdkCursor *cursor;
-
-#if 0
- g_print ("In e_day_view_on_main_canvas_motion\n");
-#endif
-
- /* Convert the coords to the main canvas window, or return if the
- window is not found. */
- if (!e_day_view_convert_event_coords (day_view, (GdkEvent*) mevent,
- GTK_LAYOUT (widget)->bin_window,
- &event_x, &event_y))
- return FALSE;
-
- canvas_x = event_x;
- canvas_y = event_y;
-
- pos = e_day_view_convert_position_in_main_canvas (day_view,
- canvas_x, canvas_y,
- &day, &row,
- &event_num);
- if (event_num != -1)
- event = &g_array_index (day_view->events[day], EDayViewEvent,
- event_num);
-
- if (day_view->selection_is_being_dragged) {
- if (pos != E_CALENDAR_VIEW_POS_OUTSIDE) {
- e_day_view_update_selection (day_view, day, row);
- e_day_view_check_auto_scroll (day_view,
- event_x, event_y);
- return TRUE;
- }
- } else if (day_view->resize_drag_pos != E_CALENDAR_VIEW_POS_NONE) {
- if (pos != E_CALENDAR_VIEW_POS_OUTSIDE) {
- e_day_view_update_resize (day_view, row);
- e_day_view_check_auto_scroll (day_view,
- event_x, event_y);
- return TRUE;
- }
- } else if (day_view->pressed_event_day != -1
- && day_view->pressed_event_day != E_DAY_VIEW_LONG_EVENT) {
- GtkTargetList *target_list;
-
- event = &g_array_index (day_view->events[day_view->pressed_event_day], EDayViewEvent, day_view->pressed_event_num);
-
- if ((e_cal_util_component_is_instance (event->comp_data->icalcomp) ||
- !e_cal_util_component_has_recurrences (event->comp_data->icalcomp))
- && (abs (canvas_x - day_view->drag_event_x)
- > E_DAY_VIEW_DRAG_START_OFFSET
- || abs (canvas_y - day_view->drag_event_y)
- > E_DAY_VIEW_DRAG_START_OFFSET)) {
- day_view->drag_event_day = day_view->pressed_event_day;
- day_view->drag_event_num = day_view->pressed_event_num;
- day_view->pressed_event_day = -1;
-
- /* Hide the horizontal bars. */
- if (day_view->resize_bars_event_day != -1) {
- day_view->resize_bars_event_day = -1;
- day_view->resize_bars_event_num = -1;
- gnome_canvas_item_hide (day_view->main_canvas_top_resize_bar_item);
- gnome_canvas_item_hide (day_view->main_canvas_bottom_resize_bar_item);
- }
-
- target_list = gtk_target_list_new (target_table,
- n_targets);
- gtk_drag_begin (widget, target_list,
- GDK_ACTION_COPY | GDK_ACTION_MOVE,
- 1, (GdkEvent*)mevent);
- gtk_target_list_unref (target_list);
- }
- } else {
- cursor = day_view->normal_cursor;
-
- /* Recurring events can't be resized. */
- if (event && (e_cal_util_component_is_instance (event->comp_data->icalcomp) ||
- !e_cal_util_component_has_recurrences (event->comp_data->icalcomp))) {
- switch (pos) {
- case E_CALENDAR_VIEW_POS_LEFT_EDGE:
- cursor = day_view->move_cursor;
- break;
- case E_CALENDAR_VIEW_POS_TOP_EDGE:
- case E_CALENDAR_VIEW_POS_BOTTOM_EDGE:
- cursor = day_view->resize_height_cursor;
- break;
- default:
- break;
- }
- }
-
- /* Only set the cursor if it is different to last one set. */
- if (day_view->last_cursor_set_in_main_canvas != cursor) {
- day_view->last_cursor_set_in_main_canvas = cursor;
- gdk_window_set_cursor (widget->window, cursor);
- }
- }
-
- return FALSE;
-}
-
-
-/* This sets the selection to a single cell. If day is -1 then the current
- start day is reused. If row is -1 then the selection is in the top canvas.
-*/
-void
-e_day_view_start_selection (EDayView *day_view,
- gint day,
- gint row)
-{
- if (day == -1) {
- day = day_view->selection_start_day;
- if (day == -1)
- day = 0;
- }
-
- day_view->selection_start_day = day;
- day_view->selection_end_day = day;
-
- day_view->selection_start_row = row;
- day_view->selection_end_row = row;
-
- day_view->selection_is_being_dragged = TRUE;
- day_view->selection_drag_pos = E_DAY_VIEW_DRAG_END;
- day_view->selection_in_top_canvas = (row == -1) ? TRUE : FALSE;
-
- /* FIXME: Optimise? */
- gtk_widget_queue_draw (day_view->top_canvas);
- gtk_widget_queue_draw (day_view->main_canvas);
-}
-
-
-/* Updates the selection during a drag. If day is -1 the selection day is
- unchanged. */
-void
-e_day_view_update_selection (EDayView *day_view,
- gint day,
- gint row)
-{
- gboolean need_redraw = FALSE;
-
-#if 0
- g_print ("Updating selection %i,%i\n", day, row);
-#endif
-
- day_view->selection_in_top_canvas = (row == -1) ? TRUE : FALSE;
-
- if (day == -1)
- day = (day_view->selection_drag_pos == E_DAY_VIEW_DRAG_START)
- ? day_view->selection_start_day
- : day_view->selection_end_day;
-
- if (day_view->selection_drag_pos == E_DAY_VIEW_DRAG_START) {
- if (row != day_view->selection_start_row
- || day != day_view->selection_start_day) {
- need_redraw = TRUE;
- day_view->selection_start_row = row;
- day_view->selection_start_day = day;
- }
- } else {
- if (row != day_view->selection_end_row
- || day != day_view->selection_end_day) {
- need_redraw = TRUE;
- day_view->selection_end_row = row;
- day_view->selection_end_day = day;
- }
- }
-
- e_day_view_normalize_selection (day_view);
-
- /* FIXME: Optimise? */
- if (need_redraw) {
- gtk_widget_queue_draw (day_view->top_canvas);
- gtk_widget_queue_draw (day_view->main_canvas);
- }
-}
-
-
-static void
-e_day_view_normalize_selection (EDayView *day_view)
-{
- gint tmp_row, tmp_day;
-
- /* Switch the drag position if necessary. */
- if (day_view->selection_start_day > day_view->selection_end_day
- || (day_view->selection_start_day == day_view->selection_end_day
- && day_view->selection_start_row > day_view->selection_end_row)) {
- tmp_row = day_view->selection_start_row;
- tmp_day = day_view->selection_start_day;
- day_view->selection_start_day = day_view->selection_end_day;
- day_view->selection_start_row = day_view->selection_end_row;
- day_view->selection_end_day = tmp_day;
- day_view->selection_end_row = tmp_row;
- if (day_view->selection_drag_pos == E_DAY_VIEW_DRAG_START)
- day_view->selection_drag_pos = E_DAY_VIEW_DRAG_END;
- else
- day_view->selection_drag_pos = E_DAY_VIEW_DRAG_START;
- }
-}
-
-
-void
-e_day_view_finish_selection (EDayView *day_view)
-{
- day_view->selection_is_being_dragged = FALSE;
- e_day_view_update_calendar_selection_time (day_view);
-}
-
-static void
-e_day_view_update_long_event_resize (EDayView *day_view,
- gint day)
-{
- EDayViewEvent *event;
- gint event_num;
- gboolean need_reshape = FALSE;
-
-#if 0
- g_print ("Updating resize Day:%i\n", day);
-#endif
-
- event_num = day_view->resize_event_num;
- event = &g_array_index (day_view->long_events, EDayViewEvent,
- event_num);
-
- if (day_view->resize_drag_pos == E_CALENDAR_VIEW_POS_LEFT_EDGE) {
- day = MIN (day, day_view->resize_end_row);
- if (day != day_view->resize_start_row) {
- need_reshape = TRUE;
- day_view->resize_start_row = day;
-
- }
- } else {
- day = MAX (day, day_view->resize_start_row);
- if (day != day_view->resize_end_row) {
- need_reshape = TRUE;
- day_view->resize_end_row = day;
- }
- }
-
- /* FIXME: Optimise? */
- if (need_reshape) {
- e_day_view_reshape_long_event (day_view, event_num);
- e_day_view_reshape_resize_long_event_rect_item (day_view);
- gtk_widget_queue_draw (day_view->top_canvas);
- }
-}
-
-
-static void
-e_day_view_update_resize (EDayView *day_view,
- gint row)
-{
- EDayViewEvent *event;
- gint day, event_num;
- gboolean need_reshape = FALSE;
-
-#if 0
- g_print ("Updating resize Row:%i\n", row);
-#endif
-
- day = day_view->resize_event_day;
- event_num = day_view->resize_event_num;
- event = &g_array_index (day_view->events[day], EDayViewEvent,
- event_num);
-
- if (day_view->resize_drag_pos == E_CALENDAR_VIEW_POS_TOP_EDGE) {
- row = MIN (row, day_view->resize_end_row);
- if (row != day_view->resize_start_row) {
- need_reshape = TRUE;
- day_view->resize_start_row = row;
-
- }
- } else {
- row = MAX (row, day_view->resize_start_row);
- if (row != day_view->resize_end_row) {
- need_reshape = TRUE;
- day_view->resize_end_row = row;
- }
- }
-
- /* FIXME: Optimise? */
- if (need_reshape) {
- e_day_view_reshape_day_event (day_view, day, event_num);
- e_day_view_reshape_resize_rect_item (day_view);
- e_day_view_reshape_main_canvas_resize_bars (day_view);
- gtk_widget_queue_draw (day_view->main_canvas);
- }
-}
-
-
-/* This converts the resize start or end row back to a time and updates the
- event. */
-static void
-e_day_view_finish_long_event_resize (EDayView *day_view)
-{
- EDayViewEvent *event;
- gint event_num;
- ECalComponent *comp;
- ECalComponentDateTime date;
- struct icaltimetype itt;
- time_t dt;
- ECal *client;
- CalObjModType mod = CALOBJ_MOD_ALL;
- GtkWindow *toplevel;
-
- event_num = day_view->resize_event_num;
- event = &g_array_index (day_view->long_events, EDayViewEvent,
- event_num);
-
- client = event->comp_data->client;
-
- /* We use a temporary copy of the comp since we don't want to
- change the original comp here. Otherwise we would not detect that
- the event's time had changed in the "update_event" callback. */
- 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 (day_view)));
-
- if (day_view->resize_drag_pos == E_CALENDAR_VIEW_POS_LEFT_EDGE) {
- dt = day_view->day_starts[day_view->resize_start_row];
- *date.value = icaltime_from_timet_with_zone (dt, FALSE,
- e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
- e_cal_component_set_dtstart (comp, &date);
- } else {
- dt = day_view->day_starts[day_view->resize_end_row + 1];
- *date.value = icaltime_from_timet_with_zone (dt, FALSE,
- e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
- e_cal_component_set_dtend (comp, &date);
- }
-
- if (e_cal_component_has_recurrences (comp)) {
- if (!recur_component_dialog (client, comp, &mod, NULL)) {
- gtk_widget_queue_draw (day_view->top_canvas);
- goto out;
- }
- }
-
- toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (day_view)));
-
- if (e_cal_modify_object (client, e_cal_component_get_icalcomponent (comp), mod, NULL)) {
- if (itip_organizer_is_user (comp, client) &&
- send_component_dialog (toplevel, client, comp, TRUE)) {
- itip_send_comp (E_CAL_COMPONENT_METHOD_REQUEST, comp, client, NULL);
- } else {
- g_message (G_STRLOC ": Could not update the object!");
- }
- }
-
- out:
- gnome_canvas_item_hide (day_view->resize_long_event_rect_item);
-
- day_view->resize_drag_pos = E_CALENDAR_VIEW_POS_NONE;
-
- g_object_unref (comp);
-}
-
-
-/* This converts the resize start or end row back to a time and updates the
- event. */
-static void
-e_day_view_finish_resize (EDayView *day_view)
-{
- EDayViewEvent *event;
- gint day, event_num;
- ECalComponent *comp;
- ECalComponentDateTime date;
- struct icaltimetype itt;
- time_t dt;
- ECal *client;
- CalObjModType mod = CALOBJ_MOD_ALL;
- GtkWindow *toplevel;
-
- day = day_view->resize_event_day;
- event_num = day_view->resize_event_num;
- event = &g_array_index (day_view->events[day], EDayViewEvent,
- event_num);
-
- 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 (day_view)));
-
- if (day_view->resize_drag_pos == E_CALENDAR_VIEW_POS_TOP_EDGE) {
- dt = e_day_view_convert_grid_position_to_time (day_view, day, day_view->resize_start_row);
- *date.value = icaltime_from_timet_with_zone (dt, FALSE,
- e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
- e_cal_component_set_dtstart (comp, &date);
- } else {
- dt = e_day_view_convert_grid_position_to_time (day_view, day, day_view->resize_end_row + 1);
- *date.value = icaltime_from_timet_with_zone (dt, FALSE,
- e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
- e_cal_component_set_dtend (comp, &date);
- }
-
- gnome_canvas_item_hide (day_view->resize_rect_item);
- gnome_canvas_item_hide (day_view->resize_bar_item);
-
- /* Hide the horizontal bars. */
- day_view->resize_bars_event_day = -1;
- day_view->resize_bars_event_num = -1;
- gnome_canvas_item_hide (day_view->main_canvas_top_resize_bar_item);
- gnome_canvas_item_hide (day_view->main_canvas_bottom_resize_bar_item);
-
- day_view->resize_drag_pos = E_CALENDAR_VIEW_POS_NONE;
-
- if (e_cal_component_has_recurrences (comp)) {
- if (!recur_component_dialog (client, comp, &mod, NULL)) {
- gtk_widget_queue_draw (day_view->top_canvas);
- goto out;
- }
- }
-
- toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (day_view)));
-
- e_cal_component_commit_sequence (comp);
- if (e_cal_modify_object (client, e_cal_component_get_icalcomponent (comp), mod, NULL)) {
- if (itip_organizer_is_user (comp, client) &&
- send_component_dialog (toplevel, client, comp, TRUE)) {
- itip_send_comp (E_CAL_COMPONENT_METHOD_REQUEST, comp, client, NULL);
- } else {
- g_message (G_STRLOC ": Could not update the object!");
- }
- }
-
- out:
- g_object_unref (comp);
-}
-
-
-static void
-e_day_view_abort_resize (EDayView *day_view,
- guint32 time)
-{
- gint day, event_num;
-
- if (day_view->resize_drag_pos == E_CALENDAR_VIEW_POS_NONE)
- return;
-
- day_view->resize_drag_pos = E_CALENDAR_VIEW_POS_NONE;
- gdk_pointer_ungrab (time);
-
- day = day_view->resize_event_day;
- event_num = day_view->resize_event_num;
-
- if (day == E_DAY_VIEW_LONG_EVENT) {
- e_day_view_reshape_long_event (day_view, event_num);
- gtk_widget_queue_draw (day_view->top_canvas);
-
- day_view->last_cursor_set_in_top_canvas = day_view->normal_cursor;
- gdk_window_set_cursor (day_view->top_canvas->window,
- day_view->normal_cursor);
- gnome_canvas_item_hide (day_view->resize_long_event_rect_item);
- } else {
- e_day_view_reshape_day_event (day_view, day, event_num);
- e_day_view_reshape_main_canvas_resize_bars (day_view);
- gtk_widget_queue_draw (day_view->main_canvas);
-
- day_view->last_cursor_set_in_main_canvas = day_view->normal_cursor;
- gdk_window_set_cursor (day_view->main_canvas->window,
- day_view->normal_cursor);
- gnome_canvas_item_hide (day_view->resize_rect_item);
- gnome_canvas_item_hide (day_view->resize_bar_item);
- }
-}
-
-
-static void
-e_day_view_free_events (EDayView *day_view)
-{
- gint day;
-
- /* Reset all our indices. */
- day_view->editing_event_day = -1;
- day_view->popup_event_day = -1;
- day_view->resize_bars_event_day = -1;
- day_view->resize_event_day = -1;
- day_view->pressed_event_day = -1;
- day_view->drag_event_day = -1;
-
- e_day_view_free_event_array (day_view, day_view->long_events);
-
- for (day = 0; day < E_DAY_VIEW_MAX_DAYS; day++)
- e_day_view_free_event_array (day_view, day_view->events[day]);
-}
-
-
-static void
-e_day_view_free_event_array (EDayView *day_view,
- 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)
- gtk_object_destroy (GTK_OBJECT (event->canvas_item));
-
- if (event->allocated_comp_data) {
- e_cal_model_free_component_data (event->comp_data);
- event->allocated_comp_data = FALSE;
- }
- }
-
- g_array_set_size (array, 0);
-}
-
-
-/* This adds one event to the view, adding it to the appropriate array. */
-static gboolean
-e_day_view_add_event (ECalComponent *comp,
- time_t start,
- time_t end,
- gpointer data)
-
-{
- EDayViewEvent event;
- gint day, offset;
- struct icaltimetype start_tt, end_tt;
- AddEventData *add_event_data;
-
- add_event_data = data;
-
-#if 0
- g_print ("Day view lower: %s", ctime (&add_event_data->day_view->lower));
- g_print ("Day view upper: %s", ctime (&add_event_data->day_view->upper));
- 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, TRUE);
- g_return_val_if_fail (start < add_event_data->day_view->upper, TRUE);
- g_return_val_if_fail (end > add_event_data->day_view->lower, TRUE);
-
- start_tt = icaltime_from_timet_with_zone (start, FALSE,
- e_calendar_view_get_timezone (E_CALENDAR_VIEW (add_event_data->day_view)));
- end_tt = icaltime_from_timet_with_zone (end, FALSE,
- e_calendar_view_get_timezone (E_CALENDAR_VIEW (add_event_data->day_view)));
-
- if (add_event_data->comp_data) {
- event.comp_data = add_event_data->comp_data;
- event.allocated_comp_data = FALSE;
- } else {
- event.comp_data = g_new0 (ECalModelComponent, 1);
- event.allocated_comp_data = TRUE;
-
- event.comp_data->client = e_cal_model_get_default_client (e_calendar_view_get_model (E_CALENDAR_VIEW (add_event_data->day_view)));
- e_cal_component_commit_sequence (comp);
- event.comp_data->icalcomp = icalcomponent_new_clone (e_cal_component_get_icalcomponent (comp));
- }
-
- event.start = start;
- event.end = end;
- event.canvas_item = NULL;
-
- /* Calculate the start & end minute, relative to the top of the
- display. */
- offset = add_event_data->day_view->first_hour_shown * 60
- + add_event_data->day_view->first_minute_shown;
- event.start_minute = start_tt.hour * 60 + start_tt.minute - offset;
- event.end_minute = end_tt.hour * 60 + end_tt.minute - offset;
-
- event.start_row_or_col = 0;
- event.num_columns = 0;
-
- 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->day_view))))
- event.different_timezone = TRUE;
-
- /* Find out which array to add the event to. */
- for (day = 0; day < add_event_data->day_view->days_shown; day++) {
- if (start >= add_event_data->day_view->day_starts[day]
- && end <= add_event_data->day_view->day_starts[day + 1]) {
-
- /* Special case for when the appointment ends at
- midnight, i.e. the start of the next day. */
- if (end == add_event_data->day_view->day_starts[day + 1]) {
-
- /* If the event last the entire day, then we
- skip it here so it gets added to the top
- canvas. */
- if (start == add_event_data->day_view->day_starts[day])
- break;
-
- event.end_minute = 24 * 60;
- }
-
- g_array_append_val (add_event_data->day_view->events[day], event);
- add_event_data->day_view->events_sorted[day] = FALSE;
- add_event_data->day_view->need_layout[day] = TRUE;
- return TRUE;
- }
- }
-
- /* 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 (add_event_data->day_view->long_events, event);
- add_event_data->day_view->long_events_sorted = FALSE;
- add_event_data->day_view->long_events_need_layout = TRUE;
- return TRUE;
-}
-
-
-/* This lays out the short (less than 1 day) events in the columns.
- Any long events are simply skipped. */
-void
-e_day_view_check_layout (EDayView *day_view)
-{
- gint day, rows_in_top_display, top_canvas_height, top_rows;
-
- /* Don't bother if we aren't visible. */
- if (!GTK_WIDGET_VISIBLE (day_view))
- return;
-
- /* Make sure the events are sorted (by start and size). */
- e_day_view_ensure_events_sorted (day_view);
-
- for (day = 0; day < day_view->days_shown; day++) {
- if (day_view->need_layout[day])
- e_day_view_layout_day_events (day_view->events[day],
- day_view->rows,
- day_view->mins_per_row,
- day_view->cols_per_row[day]);
-
- if (day_view->need_layout[day]
- || day_view->need_reshape[day]) {
- e_day_view_reshape_day_events (day_view, day);
-
- if (day_view->resize_bars_event_day == day)
- e_day_view_reshape_main_canvas_resize_bars (day_view);
- }
-
- day_view->need_layout[day] = FALSE;
- day_view->need_reshape[day] = FALSE;
- }
-
- if (day_view->long_events_need_layout) {
- e_day_view_layout_long_events (day_view->long_events,
- day_view->days_shown,
- day_view->day_starts,
- &rows_in_top_display);
-
- /* Set the height of the top canvas based on the row height
- and the number of rows needed (min 1 + 1 for the dates + 1
- space for DnD).*/
- if (day_view->rows_in_top_display != rows_in_top_display) {
- day_view->rows_in_top_display = rows_in_top_display;
- top_rows = MAX (1, rows_in_top_display);
- top_canvas_height = (top_rows + 2)
- * day_view->top_row_height;
- gtk_widget_set_usize (day_view->top_canvas, -1,
- top_canvas_height);
- }
- }
-
-
- if (day_view->long_events_need_layout
- || day_view->long_events_need_reshape)
- e_day_view_reshape_long_events (day_view);
-
- day_view->long_events_need_layout = FALSE;
- day_view->long_events_need_reshape = FALSE;
-}
-
-
-static void
-e_day_view_reshape_long_events (EDayView *day_view)
-{
- EDayViewEvent *event;
- gint event_num;
-
- for (event_num = 0; event_num < day_view->long_events->len;
- event_num++) {
- event = &g_array_index (day_view->long_events, EDayViewEvent,
- event_num);
-
- if (event->num_columns == 0) {
- if (event->canvas_item) {
- gtk_object_destroy (GTK_OBJECT (event->canvas_item));
- event->canvas_item = NULL;
- }
- } else {
- e_day_view_reshape_long_event (day_view, event_num);
- }
- }
-}
-
-
-static void
-e_day_view_reshape_long_event (EDayView *day_view,
- gint event_num)
-{
- EDayViewEvent *event;
- gint start_day, end_day, item_x, item_y, item_w, item_h;
- gint text_x, text_w, num_icons, icons_width, width, time_width;
- ECalComponent *comp;
- gint min_text_x, max_text_w, text_width, line_len;
- gchar *text, *end_of_line;
- gboolean show_icons = TRUE, use_max_width = FALSE;
- PangoFontDescription *font_desc;
- PangoContext *pango_context;
- PangoLayout *layout;
-
- event = &g_array_index (day_view->long_events, EDayViewEvent,
- event_num);
-
- if (!e_day_view_get_long_event_position (day_view, event_num,
- &start_day, &end_day,
- &item_x, &item_y,
- &item_w, &item_h)) {
- if (event->canvas_item) {
- gtk_object_destroy (GTK_OBJECT (event->canvas_item));
- event->canvas_item = NULL;
- }
- return;
- }
-
- /* Take off the border and padding. */
- item_x += E_DAY_VIEW_LONG_EVENT_BORDER_WIDTH + E_DAY_VIEW_LONG_EVENT_X_PAD;
- item_w -= (E_DAY_VIEW_LONG_EVENT_BORDER_WIDTH + E_DAY_VIEW_LONG_EVENT_X_PAD) * 2;
- item_y += E_DAY_VIEW_LONG_EVENT_BORDER_HEIGHT + E_DAY_VIEW_LONG_EVENT_Y_PAD;
- item_h -= (E_DAY_VIEW_LONG_EVENT_BORDER_HEIGHT + E_DAY_VIEW_LONG_EVENT_Y_PAD) * 2;
-
- /* We don't show the icons while resizing, since we'd have to
- draw them on top of the resize rect. Nor when editing. */
- num_icons = 0;
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
-
- /* Set up Pango prerequisites */
- font_desc = gtk_widget_get_style (GTK_WIDGET (day_view))->font_desc;
- pango_context = gtk_widget_get_pango_context (GTK_WIDGET (day_view));
- layout = pango_layout_new (pango_context);
-
- if (day_view->resize_drag_pos != E_CALENDAR_VIEW_POS_NONE
- && day_view->resize_event_day == E_DAY_VIEW_LONG_EVENT
- && day_view->resize_event_num == event_num)
- show_icons = FALSE;
-
- if (day_view->editing_event_day == E_DAY_VIEW_LONG_EVENT
- && day_view->editing_event_num == event_num) {
- show_icons = FALSE;
- use_max_width = TRUE;
- }
-
- if (show_icons) {
- GSList *categories_list, *elem;
-
- if (e_cal_component_has_alarms (comp))
- num_icons++;
- if (e_cal_component_has_recurrences (comp))
- num_icons++;
- if (event->different_timezone)
- num_icons++;
- if (e_cal_component_has_organizer (comp))
- num_icons++;
-
- e_cal_component_get_categories_list (comp, &categories_list);
- for (elem = categories_list; elem; elem = elem->next) {
- char *category;
- GdkPixmap *pixmap = NULL;
- GdkBitmap *mask = NULL;
-
- category = (char *) elem->data;
- if (e_categories_config_get_icon_for (category, &pixmap, &mask))
- num_icons++;
- }
- e_cal_component_free_categories_list (categories_list);
- }
-
- if (!event->canvas_item) {
- event->canvas_item =
- gnome_canvas_item_new (GNOME_CANVAS_GROUP (GNOME_CANVAS (day_view->top_canvas)->root),
- e_text_get_type (),
- "anchor", GTK_ANCHOR_NW,
- "clip", TRUE,
- "max_lines", 1,
- "editable", TRUE,
- "use_ellipsis", TRUE,
- "draw_background", FALSE,
- "fill_color_rgba", GNOME_CANVAS_COLOR (0, 0, 0),
- "im_context", E_CANVAS (day_view->top_canvas)->im_context,
- NULL);
- g_signal_connect (event->canvas_item, "event",
- G_CALLBACK (e_day_view_on_text_item_event), day_view);
- g_signal_emit_by_name (G_OBJECT(day_view),
- "event_added", event);
-
- e_day_view_update_long_event_label (day_view, event_num);
- }
-
- /* Calculate its position. We first calculate the ideal position which
- is centered with the icons. We then make sure we haven't gone off
- the left edge of the available space. Finally we make sure we don't
- go off the right edge. */
- icons_width = (E_DAY_VIEW_ICON_WIDTH + E_DAY_VIEW_ICON_X_PAD)
- * num_icons + E_DAY_VIEW_LONG_EVENT_ICON_R_PAD;
- time_width = e_day_view_get_time_string_width (day_view);
-
- if (use_max_width) {
- text_x = item_x;
- text_w = item_w;
- } else {
- /* Get the requested size of the label. */
- g_object_get (G_OBJECT (event->canvas_item), "text", &text, NULL);
- text_width = 0;
- if (text) {
- 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);
- }
-
- width = text_width + icons_width;
- text_x = item_x + (item_w - width) / 2;
-
- min_text_x = item_x;
- if (event->start > day_view->day_starts[start_day])
- min_text_x += time_width + E_DAY_VIEW_LONG_EVENT_TIME_X_PAD;
-
- text_x = MAX (text_x, min_text_x);
-
- max_text_w = item_x + item_w - text_x;
- if (event->end < day_view->day_starts[end_day + 1])
- max_text_w -= time_width + E_DAY_VIEW_LONG_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;
- }
-
- text_w = MAX (text_w, 0);
- gnome_canvas_item_set (event->canvas_item,
- "clip_width", (gdouble) text_w,
- "clip_height", (gdouble) item_h,
- NULL);
- e_canvas_item_move_absolute(event->canvas_item,
- text_x, item_y);
-
- g_object_unref (layout);
-}
-
-
-/* This creates or updates the sizes of the canvas items for one day of the
- main canvas. */
-static void
-e_day_view_reshape_day_events (EDayView *day_view,
- gint day)
-{
- gint event_num;
-
- for (event_num = 0; event_num < day_view->events[day]->len;
- event_num++) {
- e_day_view_reshape_day_event (day_view, day, event_num);
- if (event_num == day_view->resize_event_num) {
- EDayViewEvent *event;
- event = &g_array_index (day_view->events[day], EDayViewEvent,
- event_num);
- e_canvas_item_grab_focus (event->canvas_item, TRUE);
- }
- }
-}
-
-
-static void
-e_day_view_reshape_day_event (EDayView *day_view,
- gint day,
- gint event_num)
-{
- EDayViewEvent *event;
- gint item_x, item_y, item_w, item_h;
- gint num_icons, icons_offset;
-
- event = &g_array_index (day_view->events[day], EDayViewEvent,
- event_num);
-
- if (!e_day_view_get_event_position (day_view, day, event_num,
- &item_x, &item_y,
- &item_w, &item_h)) {
- if (event->canvas_item) {
- gtk_object_destroy (GTK_OBJECT (event->canvas_item));
- event->canvas_item = NULL;
- }
- } else {
- /* Skip the border and padding. */
- item_x += E_DAY_VIEW_BAR_WIDTH + E_DAY_VIEW_EVENT_X_PAD;
- item_w -= E_DAY_VIEW_BAR_WIDTH + E_DAY_VIEW_EVENT_X_PAD * 2;
- item_y += E_DAY_VIEW_EVENT_BORDER_HEIGHT + E_DAY_VIEW_EVENT_Y_PAD;
- item_h -= (E_DAY_VIEW_EVENT_BORDER_HEIGHT + E_DAY_VIEW_EVENT_Y_PAD) * 2;
-
- /* We don't show the icons while resizing, since we'd have to
- draw them on top of the resize rect. */
- num_icons = 0;
- if (day_view->resize_drag_pos == E_CALENDAR_VIEW_POS_NONE
- || day_view->resize_event_day != day
- || day_view->resize_event_num != event_num) {
- GSList *categories_list, *elem;
- ECalComponent *comp;
-
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
-
- if (e_cal_component_has_alarms (comp))
- num_icons++;
- if (e_cal_component_has_recurrences (comp))
- num_icons++;
- if (event->different_timezone)
- num_icons++;
- if (e_cal_component_has_organizer (comp))
- num_icons++;
-
- e_cal_component_get_categories_list (comp, &categories_list);
- for (elem = categories_list; elem; elem = elem->next) {
- char *category;
- GdkPixmap *pixmap = NULL;
- GdkBitmap *mask = NULL;
-
- category = (char *) elem->data;
- if (e_categories_config_get_icon_for (category, &pixmap, &mask))
- num_icons++;
- }
- e_cal_component_free_categories_list (categories_list);
- }
-
- if (num_icons > 0) {
- if (item_h >= (E_DAY_VIEW_ICON_HEIGHT + E_DAY_VIEW_ICON_Y_PAD) * num_icons)
- icons_offset = E_DAY_VIEW_ICON_WIDTH + E_DAY_VIEW_ICON_X_PAD * 2;
- else
- icons_offset = (E_DAY_VIEW_ICON_WIDTH + E_DAY_VIEW_ICON_X_PAD) * num_icons + E_DAY_VIEW_ICON_X_PAD;
- item_x += icons_offset;
- item_w -= icons_offset;
- }
-
- if (!event->canvas_item) {
- event->canvas_item =
- gnome_canvas_item_new (GNOME_CANVAS_GROUP (GNOME_CANVAS (day_view->main_canvas)->root),
- e_text_get_type (),
- "anchor", GTK_ANCHOR_NW,
- "line_wrap", TRUE,
- "editable", TRUE,
- "clip", TRUE,
- "use_ellipsis", TRUE,
- "draw_background", FALSE,
- "fill_color_rgba", GNOME_CANVAS_COLOR(0, 0, 0),
- "im_context", E_CANVAS (day_view->main_canvas)->im_context,
- NULL);
- g_signal_connect (event->canvas_item, "event",
- G_CALLBACK (e_day_view_on_text_item_event), day_view);
- g_signal_emit_by_name (G_OBJECT(day_view),
- "event_added", event);
-
- e_day_view_update_event_label (day_view, day, event_num);
- }
-
- item_w = MAX (item_w, 0);
- gnome_canvas_item_set (event->canvas_item,
- "clip_width", (gdouble) item_w,
- "clip_height", (gdouble) item_h,
- NULL);
- e_canvas_item_move_absolute(event->canvas_item,
- item_x, item_y);
- }
-}
-
-
-/* This creates or resizes the horizontal bars used to resize events in the
- main canvas. */
-static void
-e_day_view_reshape_main_canvas_resize_bars (EDayView *day_view)
-{
- gint day, event_num;
- gint item_x, item_y, item_w, item_h;
- gdouble x, y, w, h;
-
- day = day_view->resize_bars_event_day;
- event_num = day_view->resize_bars_event_num;
-
- /* If we're not editing an event, or the event is not shown,
- hide the resize bars. */
- if (day != -1 && day == day_view->drag_event_day
- && event_num == day_view->drag_event_num) {
- g_object_get (G_OBJECT (day_view->drag_rect_item),
- "x1", &x,
- "y1", &y,
- "x2", &w,
- "y2", &h,
- NULL);
- w -= x;
- x++;
- h -= y;
- } else if (day != -1
- && e_day_view_get_event_position (day_view, day, event_num,
- &item_x, &item_y,
- &item_w, &item_h)) {
- x = item_x + E_DAY_VIEW_BAR_WIDTH;
- y = item_y;
- w = item_w - E_DAY_VIEW_BAR_WIDTH;
- h = item_h;
- } else {
- gnome_canvas_item_hide (day_view->main_canvas_top_resize_bar_item);
- gnome_canvas_item_hide (day_view->main_canvas_bottom_resize_bar_item);
- return;
- }
-
- gnome_canvas_item_set (day_view->main_canvas_top_resize_bar_item,
- "x1", x - E_DAY_VIEW_BAR_WIDTH,
- "y1", y - E_DAY_VIEW_BAR_HEIGHT,
- "x2", x + w - 1,
- "y2", y - 1,
- NULL);
- gnome_canvas_item_show (day_view->main_canvas_top_resize_bar_item);
-
- gnome_canvas_item_set (day_view->main_canvas_bottom_resize_bar_item,
- "x1", x - E_DAY_VIEW_BAR_WIDTH,
- "y1", y + h,
- "x2", x + w - 1,
- "y2", y + h + E_DAY_VIEW_BAR_HEIGHT - 1,
- NULL);
- gnome_canvas_item_show (day_view->main_canvas_bottom_resize_bar_item);
-}
-
-
-static void
-e_day_view_ensure_events_sorted (EDayView *day_view)
-{
- gint day;
-
- /* Sort the long events. */
- if (!day_view->long_events_sorted) {
- qsort (day_view->long_events->data,
- day_view->long_events->len,
- sizeof (EDayViewEvent),
- e_day_view_event_sort_func);
- day_view->long_events_sorted = TRUE;
- }
-
- /* Sort the events for each day. */
- for (day = 0; day < day_view->days_shown; day++) {
- if (!day_view->events_sorted[day]) {
- qsort (day_view->events[day]->data,
- day_view->events[day]->len,
- sizeof (EDayViewEvent),
- e_day_view_event_sort_func);
- day_view->events_sorted[day] = TRUE;
- }
- }
-}
-
-
-gint
-e_day_view_event_sort_func (const void *arg1,
- const void *arg2)
-{
- EDayViewEvent *event1, *event2;
-
- event1 = (EDayViewEvent*) arg1;
- event2 = (EDayViewEvent*) 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 gboolean
-e_day_view_do_key_press (GtkWidget *widget, GdkEventKey *event)
-{
- EDayView *day_view;
- icalcomponent *icalcomp;
- ECalComponent *comp;
- gint day, event_num;
- gchar *initial_text;
- guint keyval;
- gboolean stop_emission;
- time_t dtstart, dtend;
- ECalComponentDateTime start_dt, end_dt;
- struct icaltimetype start_tt, end_tt;
- const char *uid;
- AddEventData add_event_data;
-
- g_return_val_if_fail (widget != NULL, FALSE);
- g_return_val_if_fail (E_IS_DAY_VIEW (widget), FALSE);
- g_return_val_if_fail (event != NULL, FALSE);
-
- day_view = E_DAY_VIEW (widget);
- keyval = event->keyval;
-
- /* The Escape key aborts a resize operation. */
- if (day_view->resize_drag_pos != E_CALENDAR_VIEW_POS_NONE) {
- if (keyval == GDK_Escape) {
- e_day_view_abort_resize (day_view, event->time);
- }
- return FALSE;
- }
-
- /*Go to the start/end of a work day*/
- if ((keyval == GDK_Home)
- &&((event->state & GDK_SHIFT_MASK) != GDK_SHIFT_MASK)
- &&((event->state & GDK_CONTROL_MASK) != GDK_CONTROL_MASK)
- &&((event->state & GDK_MOD1_MASK) != GDK_MOD1_MASK)) {
- e_day_view_goto_start_of_work_day (day_view);
- return TRUE;
- }
- if ((keyval == GDK_End)
- &&((event->state & GDK_SHIFT_MASK) != GDK_SHIFT_MASK)
- &&((event->state & GDK_CONTROL_MASK) != GDK_CONTROL_MASK)
- &&((event->state & GDK_MOD1_MASK) != GDK_MOD1_MASK)) {
- e_day_view_goto_end_of_work_day (day_view);
- return TRUE;
- }
-
- /* In DayView, Shift+Home/End, Change the duration to the time that begins/ends the current work day */
- if ((keyval == GDK_Home)
- &&((event->state & GDK_SHIFT_MASK) == GDK_SHIFT_MASK)
- &&((event->state & GDK_CONTROL_MASK) != GDK_CONTROL_MASK)
- &&((event->state & GDK_MOD1_MASK) != GDK_MOD1_MASK)) {
- e_day_view_change_duration_to_start_of_work_day (day_view);
- return TRUE;
- }
- if ((keyval == GDK_End)
- &&((event->state & GDK_SHIFT_MASK) == GDK_SHIFT_MASK)
- &&((event->state & GDK_CONTROL_MASK) != GDK_CONTROL_MASK)
- &&((event->state & GDK_MOD1_MASK) != GDK_MOD1_MASK)) {
- e_day_view_change_duration_to_end_of_work_day (day_view);
- return TRUE;
- }
-
-
- /* Handle the cursor keys for moving & extending the selection. */
- stop_emission = TRUE;
- if (event->state & GDK_SHIFT_MASK) {
- switch (keyval) {
- case GDK_Up:
- e_day_view_cursor_key_up_shifted (day_view, event);
- break;
- case GDK_Down:
- e_day_view_cursor_key_down_shifted (day_view, event);
- break;
- case GDK_Left:
- e_day_view_cursor_key_left_shifted (day_view, event);
- break;
- case GDK_Right:
- e_day_view_cursor_key_right_shifted (day_view, event);
- break;
- default:
- stop_emission = FALSE;
- break;
- }
- } else if (!(event->state & GDK_MOD1_MASK)) {
- switch (keyval) {
- case GDK_Up:
- e_day_view_cursor_key_up (day_view, event);
- break;
- case GDK_Down:
- e_day_view_cursor_key_down (day_view, event);
- break;
- case GDK_Left:
- e_day_view_cursor_key_left (day_view, event);
- break;
- case GDK_Right:
- e_day_view_cursor_key_right (day_view, event);
- break;
- case GDK_Page_Up:
- e_day_view_scroll (day_view, E_DAY_VIEW_PAGE_STEP);
- break;
- case GDK_Page_Down:
- e_day_view_scroll (day_view, -E_DAY_VIEW_PAGE_STEP);
- break;
- default:
- stop_emission = FALSE;
- break;
- }
- }
- else
- stop_emission = FALSE;
- if (stop_emission)
- return TRUE;
-
- if (day_view->selection_start_day == -1)
- return FALSE;
-
- /* Check if there is room for a new event to be typed in. If there
- isn't we don't want to add an event as we will then add a new
- event for every key press. */
- if (!e_day_view_check_if_new_event_fits (day_view)) {
- return FALSE;
- }
-
- /* We only want to start an edit with a return key or a simple
- character. */
- if (keyval == GDK_Return) {
- initial_text = NULL;
- } else if (((keyval >= 0x20) && (keyval <= 0xFF)
- && (event->state & (GDK_CONTROL_MASK | GDK_MOD1_MASK)))
- || (event->length == 0)
- || (keyval == GDK_Tab)) {
- return FALSE;
- } else
- initial_text = e_utf8_from_gtk_event_key (widget, event->keyval, event->string);
-
- /* Add a new event covering the selected range */
-
- icalcomp = e_cal_model_create_component_with_defaults (e_calendar_view_get_model (E_CALENDAR_VIEW (day_view)));
- if (!icalcomp)
- return FALSE;
- uid = icalcomponent_get_uid (icalcomp);
-
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomp);
-
- e_day_view_get_selected_time_range ((ECalendarView *) day_view, &dtstart, &dtend);
-
- start_tt = icaltime_from_timet_with_zone (dtstart, FALSE,
- e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
-
- end_tt = icaltime_from_timet_with_zone (dtend, FALSE,
- e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
-
- if (day_view->selection_in_top_canvas) {
- start_dt.tzid = NULL;
- start_tt.is_date = 1;
- end_tt.is_date = 1;
- } else {
- start_dt.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
- }
-
- start_dt.value = &start_tt;
- end_dt.value = &end_tt;
- end_dt.tzid = start_dt.tzid;
- e_cal_component_set_dtstart (comp, &start_dt);
- e_cal_component_set_dtend (comp, &end_dt);
-
- e_cal_component_set_categories (
- comp, e_calendar_view_get_default_category (E_CALENDAR_VIEW (day_view)));
-
- /* We add the event locally and start editing it. We don't send it
- to the server until the user finishes editing it. */
- add_event_data.day_view = day_view;
- add_event_data.comp_data = NULL;
- e_day_view_add_event (comp, dtstart, dtend, &add_event_data);
- e_day_view_check_layout (day_view);
- gtk_widget_queue_draw (day_view->top_canvas);
- gtk_widget_queue_draw (day_view->main_canvas);
-
- if (e_day_view_find_event_from_uid (day_view, uid, &day, &event_num)) {
- e_day_view_start_editing_event (day_view, day, event_num,
- initial_text);
- } else {
- g_warning ("Couldn't find event to start editing.\n");
- }
-
- if (initial_text)
- g_free (initial_text);
-
- g_object_unref (comp);
-
- return TRUE;
-}
-
-static gboolean
-e_day_view_key_press (GtkWidget *widget, GdkEventKey *event)
-{
- gboolean handled = FALSE;
- handled = e_day_view_do_key_press (widget, event);
-
- /* if not handled, try key bindings */
- if (!handled)
- handled = GTK_WIDGET_CLASS (parent_class)->key_press_event (widget, event);
- return handled;
-}
-
-/* Select the time that begins a work day*/
-static void
-e_day_view_goto_start_of_work_day (EDayView *day_view)
-{
- g_return_if_fail(day_view!=NULL);
-
- if (day_view->selection_in_top_canvas)
- return;
- else
- day_view->selection_start_row =
- e_day_view_convert_time_to_row (day_view,
- day_view->work_day_start_hour,
- day_view->work_day_start_minute);
- day_view->selection_end_row = day_view->selection_start_row;
-
- e_day_view_ensure_rows_visible (day_view,
- day_view->selection_start_row,
- day_view->selection_end_row);
-
- e_day_view_update_calendar_selection_time (day_view);
-
- gtk_widget_queue_draw (day_view->top_canvas);
- gtk_widget_queue_draw (day_view->main_canvas);
-}
-
-
-/* Select the time that ends a work day*/
-static void
-e_day_view_goto_end_of_work_day (EDayView *day_view)
-{
- if (day_view->selection_in_top_canvas)
- return;
- else
- day_view->selection_start_row =
- e_day_view_convert_time_to_row (day_view,
- day_view->work_day_end_hour-1,
- day_view->work_day_end_minute+30);
- day_view->selection_end_row = day_view->selection_start_row;
-
- e_day_view_ensure_rows_visible (day_view,
- day_view->selection_start_row,
- day_view->selection_end_row);
-
- e_day_view_update_calendar_selection_time (day_view);
-
- gtk_widget_queue_draw (day_view->top_canvas);
- gtk_widget_queue_draw (day_view->main_canvas);
-}
-
-/* Change the duration to the time that begins the current work day */
-static void
-e_day_view_change_duration_to_start_of_work_day (EDayView *day_view)
-{
- g_return_if_fail(day_view != NULL);
-
- if (day_view->selection_in_top_canvas)
- return;
- else {
- gint work_start_row,work_end_row,selection_start_row,selection_end_row;
-
- work_start_row =
- e_day_view_convert_time_to_row (day_view,
- day_view->work_day_start_hour,
- day_view->work_day_start_minute);
- work_end_row =
- e_day_view_convert_time_to_row (day_view,
- day_view->work_day_end_hour - 1,
- day_view->work_day_end_minute + 30);
- selection_start_row = day_view->selection_start_row;
- selection_end_row = day_view->selection_end_row;
- if (selection_start_row < work_start_row)
- day_view->selection_end_row = work_start_row - 1;
- else day_view->selection_start_row = work_start_row;
- }
-
- e_day_view_ensure_rows_visible (day_view,
- day_view->selection_start_row,
- day_view->selection_end_row);
-
- e_day_view_update_calendar_selection_time (day_view);
-
- gtk_widget_queue_draw (day_view->top_canvas);
- gtk_widget_queue_draw (day_view->main_canvas);
-}
-
-/* Change the duration to the time that ends the current work day */
-static void
-e_day_view_change_duration_to_end_of_work_day (EDayView *day_view)
-{
- g_return_if_fail(day_view != NULL);
-
- if (day_view->selection_in_top_canvas)
- return;
- else {
- gint work_start_row,work_end_row,selection_start_row,selection_end_row;
- work_start_row =
- e_day_view_convert_time_to_row (day_view,
- day_view->work_day_start_hour,
- day_view->work_day_start_minute);
- work_end_row = e_day_view_convert_time_to_row (day_view,
- day_view->work_day_end_hour-1,
- day_view->work_day_end_minute+30);
- selection_start_row = day_view->selection_start_row;
- selection_end_row = day_view->selection_end_row;
- if (selection_start_row <= work_end_row)
- day_view->selection_end_row = work_end_row;
- else {
- day_view->selection_start_row = work_end_row + 1;
- day_view->selection_end_row = selection_start_row;
- }
- }
-
- e_day_view_ensure_rows_visible (day_view,
- day_view->selection_start_row,
- day_view->selection_end_row);
-
- e_day_view_update_calendar_selection_time (day_view);
-
- gtk_widget_queue_draw (day_view->top_canvas);
- gtk_widget_queue_draw (day_view->main_canvas);
-}
-
-
-static void
-e_day_view_cursor_key_up_shifted (EDayView *day_view, GdkEventKey *event)
-{
- gint *row;
-
- if (day_view->selection_in_top_canvas)
- return;
-
- if (day_view->selection_drag_pos == E_DAY_VIEW_DRAG_START)
- row = &day_view->selection_start_row;
- else
- row = &day_view->selection_end_row;
-
- if (*row == 0)
- return;
-
- *row = *row - 1;
-
- e_day_view_ensure_rows_visible (day_view, *row, *row);
-
- e_day_view_normalize_selection (day_view);
-
- e_day_view_update_calendar_selection_time (day_view);
-
- /* FIXME: Optimise? */
- gtk_widget_queue_draw (day_view->top_canvas);
- gtk_widget_queue_draw (day_view->main_canvas);
-}
-
-static gboolean
-e_day_view_focus (GtkWidget *widget, GtkDirectionType direction)
-{
- EDayView *day_view;
- gint new_day;
- gint new_event_num;
- gint start_row, end_row;
-
- g_return_val_if_fail (widget != NULL, FALSE);
- g_return_val_if_fail (E_IS_DAY_VIEW (widget), FALSE);
- day_view = E_DAY_VIEW (widget);
-
- if (!e_day_view_get_next_tab_event (day_view, direction,
- &new_day, &new_event_num))
- return FALSE;
-
- if ((new_day == -1) && (new_event_num == -1)) {
- /* focus should go to the day view widget itself
- */
- gtk_widget_grab_focus (GTK_WIDGET(day_view));
- return TRUE;
- }
-
- if (new_day != E_DAY_VIEW_LONG_EVENT && new_day != -1) {
- if (e_day_view_get_event_rows (day_view, new_day,
- new_event_num,
- &start_row, &end_row))
- /* ensure the event to be seen */
- e_day_view_ensure_rows_visible (day_view,
- start_row, end_row);
- }
- e_day_view_start_editing_event (day_view, new_day,
- new_event_num, NULL);
-
- return TRUE;
-}
-
-/**
- * e_day_view_get_extreme_event
- * @day_view: the day view widget operates on
- * @start_day, @end_day: range of search, both inclusive
- * @first: %TURE indicate to return the data for the first event in the range,
- * %FALSE to return data for the last event in the range.
- * @day_out: out value, day of the event found. -1 for no event found.
- * @event_num_out: out value, event number of the event found.
- * -1 for no event found.
- *
- * Get day and event_num value for the first or last event found in the day range.
- *
- * Return value: %TRUE, if a event found.
- **/
-static gboolean
-e_day_view_get_extreme_event (EDayView *day_view, gint start_day,
- gint end_day, gboolean first,
- gint *day_out, gint *event_num_out)
-{
- gint loop_day;
-
- g_return_val_if_fail (day_view != NULL, FALSE);
- g_return_val_if_fail (start_day >= 0, FALSE);
- g_return_val_if_fail (end_day <= E_DAY_VIEW_LONG_EVENT, FALSE);
- g_return_val_if_fail (day_out && event_num_out, FALSE);
-
- if (start_day > end_day)
- return FALSE;
- if (first) {
- for (loop_day = start_day; loop_day <= end_day; ++loop_day)
- if (day_view->events[loop_day]->len > 0) {
- *day_out = loop_day;
- *event_num_out = 0;
- return TRUE;
- }
- }
- else {
- for (loop_day = end_day; loop_day >= start_day; --loop_day)
- if (day_view->events[loop_day]->len > 0) {
- *day_out = loop_day;
- *event_num_out =
- day_view->events[loop_day]->len - 1;
- return TRUE;
- }
- }
- *day_out = -1;
- *event_num_out = -1;
- return FALSE;
-}
-
-/**
- * e_day_view_get_extreme_long_event
- * @day_view: the day view widget operates on
- * @first: %TURE indicate to return the data for the first event in the range,
- * %FALSE to return data for the last event in the range.
- * @event_num_out: out value, event number of the event found.
- * -1 for no event found.
- *
- * Similar to e_day_view_get_extreme_event, but run for long events.
- *
- * Return value: %TRUE, if a event found.
- **/
-static gboolean
-e_day_view_get_extreme_long_event (EDayView *day_view, gboolean first,
- gint *day_out, gint *event_num_out)
-{
- g_return_val_if_fail (day_view != NULL, FALSE);
- g_return_val_if_fail (day_out && event_num_out, FALSE);
-
- if (first && (day_view->long_events->len > 0)) {
- *day_out = E_DAY_VIEW_LONG_EVENT;
- *event_num_out = 0;
- return TRUE;
- }
- if ((!first) && (day_view->long_events->len > 0)) {
- *day_out = E_DAY_VIEW_LONG_EVENT;
- *event_num_out = day_view->long_events->len - 1;
- return TRUE;
- }
- *day_out = -1;
- *event_num_out = -1;
- return FALSE;
-}
-
-/**
- * e_day_view_get_next_tab_event
- * @day_view: the day view widget operates on
- * @direction: GTK_DIR_TAB_BACKWARD or GTK_DIR_TAB_FORWARD
- * @day_out: out value, day of the event found. -1 for no event found.
- * @event_num_out: out value, event number of the event found.
- * -1 for no event found.
- *
- * Decide on which event the focus should go next.
- * if ((day_out == -1) && (event_num_out == -1)) is true, focus should go
- * to day_view widget itself.
- *
- * Return value: %TRUE, if a event found.
- **/
-static gboolean
-e_day_view_get_next_tab_event (EDayView *day_view, GtkDirectionType direction,
- gint *day_out, gint *event_num_out)
-{
- gint new_day;
- gint new_event_num;
- gint days_shown;
-
- g_return_val_if_fail (day_view != NULL, FALSE);
- g_return_val_if_fail (day_out != NULL, FALSE);
- g_return_val_if_fail (event_num_out != NULL, FALSE);
-
- days_shown = e_day_view_get_days_shown(day_view);
- *day_out = -1;
- *event_num_out = -1;
-
- g_return_val_if_fail (days_shown > 0, FALSE);
-
- switch (direction) {
- case GTK_DIR_TAB_BACKWARD:
- new_event_num = day_view->editing_event_num - 1;
- break;
- case GTK_DIR_TAB_FORWARD:
- new_event_num = day_view->editing_event_num + 1;
- break;
- default:
- return FALSE;
- }
-
- new_day = day_view->editing_event_day;
-
- /* not current editing event, set to first long event if there is one
- */
- if (new_day == -1) {
- if (direction == GTK_DIR_TAB_FORWARD) {
- if (e_day_view_get_extreme_long_event (day_view, TRUE,
- day_out,
- event_num_out))
- return TRUE;
-
- /* no long event, set to first event if there is
- */
- e_day_view_get_extreme_event (day_view, 0,
- days_shown - 1, TRUE,
- day_out, event_num_out);
- /* go to event if found, or day view widget
- */
- return TRUE;
- }
- else {
- if (e_day_view_get_extreme_event (day_view, 0,
- days_shown - 1, FALSE,
- day_out, event_num_out))
- return TRUE;
-
- /* no event, set to last long event if there is
- */
- e_day_view_get_extreme_long_event (day_view, FALSE,
- day_out,
- event_num_out);
-
- /* go to long event if found, or day view widget
- */
- return TRUE;
- }
- }
- /* go backward from the first long event */
- else if ((new_day == E_DAY_VIEW_LONG_EVENT) && (new_event_num < 0)) {
- /* let focus go to day view widget in this case
- */
- return TRUE;
- }
- /* go forward from the last long event */
- else if ((new_day == E_DAY_VIEW_LONG_EVENT) &&
- (new_event_num >= day_view->long_events->len)) {
- e_day_view_get_extreme_event (day_view, 0,
- days_shown - 1, TRUE,
- day_out, event_num_out);
- /* go to the next main item event if found or day view widget
- */
- return TRUE;
- }
-
- /* go backward from the first event in current editting day */
- else if ((new_day < E_DAY_VIEW_LONG_EVENT) && (new_event_num < 0)) {
- /* try to find a event from the previous day in days shown
- */
- if (e_day_view_get_extreme_event (day_view, 0,
- new_day - 1, FALSE,
- day_out, event_num_out))
- return TRUE;
- /* try to find a long event
- */
- e_day_view_get_extreme_long_event (day_view, FALSE,
- day_out, event_num_out);
- /* go to a long event if found, or day view widget
- */
- return TRUE;
- }
- /* go forward from the last event in current editting day */
- else if ((new_day < E_DAY_VIEW_LONG_EVENT) &&
- (new_event_num >= day_view->events[new_day]->len)) {
- /* try to find a event from the next day in days shown
- */
- e_day_view_get_extreme_event (day_view, (new_day + 1),
- days_shown - 1, TRUE,
- day_out, event_num_out);
- /* go to a event found, or day view widget
- */
- return TRUE;
- }
- /* in the normal case
- */
- *day_out = new_day;
- *event_num_out = new_event_num;
- return TRUE;
-}
-
-static void
-e_day_view_cursor_key_down_shifted (EDayView *day_view, GdkEventKey *event)
-{
- gint *row;
-
- if (day_view->selection_in_top_canvas)
- return;
-
- if (day_view->selection_drag_pos == E_DAY_VIEW_DRAG_START)
- row = &day_view->selection_start_row;
- else
- row = &day_view->selection_end_row;
-
- if (*row >= day_view->rows - 1)
- return;
-
- *row = *row + 1;
-
- e_day_view_ensure_rows_visible (day_view, *row, *row);
-
- e_day_view_normalize_selection (day_view);
-
- e_day_view_update_calendar_selection_time (day_view);
-
- /* FIXME: Optimise? */
- gtk_widget_queue_draw (day_view->top_canvas);
- gtk_widget_queue_draw (day_view->main_canvas);
-}
-
-
-static void
-e_day_view_cursor_key_left_shifted (EDayView *day_view, GdkEventKey *event)
-{
- gint *day;
-
- if (day_view->selection_drag_pos == E_DAY_VIEW_DRAG_START)
- day = &day_view->selection_start_day;
- else
- day = &day_view->selection_end_day;
-
- if (*day == 0)
- return;
-
- *day = *day - 1;
-
- e_day_view_normalize_selection (day_view);
-
- e_day_view_update_calendar_selection_time (day_view);
-
- /* FIXME: Optimise? */
- gtk_widget_queue_draw (day_view->top_canvas);
- gtk_widget_queue_draw (day_view->main_canvas);
-}
-
-
-static void
-e_day_view_cursor_key_right_shifted (EDayView *day_view, GdkEventKey *event)
-{
- gint *day;
-
- if (day_view->selection_drag_pos == E_DAY_VIEW_DRAG_START)
- day = &day_view->selection_start_day;
- else
- day = &day_view->selection_end_day;
-
- if (*day >= day_view->days_shown - 1)
- return;
-
- *day = *day + 1;
-
- e_day_view_normalize_selection (day_view);
-
- e_day_view_update_calendar_selection_time (day_view);
-
- /* FIXME: Optimise? */
- gtk_widget_queue_draw (day_view->top_canvas);
- gtk_widget_queue_draw (day_view->main_canvas);
-}
-
-
-static void
-e_day_view_cursor_key_up (EDayView *day_view, GdkEventKey *event)
-{
- if (day_view->selection_start_day == -1) {
- day_view->selection_start_day = 0;
- day_view->selection_start_row = 0;
- }
- day_view->selection_end_day = day_view->selection_start_day;
-
- if (day_view->selection_in_top_canvas) {
- return;
- } else if (day_view->selection_start_row == 0) {
- day_view->selection_in_top_canvas = TRUE;
- day_view->selection_start_row = -1;
- } else {
- day_view->selection_start_row--;
- }
- day_view->selection_end_row = day_view->selection_start_row;
-
- if (!day_view->selection_in_top_canvas)
- e_day_view_ensure_rows_visible (day_view,
- day_view->selection_start_row,
- day_view->selection_end_row);
-
- g_signal_emit_by_name (day_view, "selected_time_changed");
- e_day_view_update_calendar_selection_time (day_view);
-
- /* FIXME: Optimise? */
- gtk_widget_queue_draw (day_view->top_canvas);
- gtk_widget_queue_draw (day_view->main_canvas);
-}
-
-
-static void
-e_day_view_cursor_key_down (EDayView *day_view, GdkEventKey *event)
-{
- if (day_view->selection_start_day == -1) {
- day_view->selection_start_day = 0;
- day_view->selection_start_row = 0;
- }
- day_view->selection_end_day = day_view->selection_start_day;
-
- if (day_view->selection_in_top_canvas) {
- day_view->selection_in_top_canvas = FALSE;
- day_view->selection_start_row = 0;
- } else if (day_view->selection_start_row >= day_view->rows - 1) {
- return;
- } else {
- day_view->selection_start_row++;
- }
- day_view->selection_end_row = day_view->selection_start_row;
-
- if (!day_view->selection_in_top_canvas)
- e_day_view_ensure_rows_visible (day_view,
- day_view->selection_start_row,
- day_view->selection_end_row);
-
- g_signal_emit_by_name (day_view, "selected_time_changed");
- e_day_view_update_calendar_selection_time (day_view);
-
- /* FIXME: Optimise? */
- gtk_widget_queue_draw (day_view->top_canvas);
- gtk_widget_queue_draw (day_view->main_canvas);
-}
-
-
-static void
-e_day_view_cursor_key_left (EDayView *day_view, GdkEventKey *event)
-{
- if (day_view->selection_start_day == 0) {
- gnome_calendar_previous (e_calendar_view_get_calendar (E_CALENDAR_VIEW (day_view)));
- } else {
- day_view->selection_start_day--;
- day_view->selection_end_day--;
-
- e_day_view_update_calendar_selection_time (day_view);
-
- /* FIXME: Optimise? */
- gtk_widget_queue_draw (day_view->top_canvas);
- gtk_widget_queue_draw (day_view->main_canvas);
- }
- g_signal_emit_by_name (day_view, "selected_time_changed");
-}
-
-
-static void
-e_day_view_cursor_key_right (EDayView *day_view, GdkEventKey *event)
-{
- if (day_view->selection_end_day == day_view->days_shown - 1) {
- gnome_calendar_next (e_calendar_view_get_calendar (E_CALENDAR_VIEW (day_view)));
- } else {
- day_view->selection_start_day++;
- day_view->selection_end_day++;
-
- e_day_view_update_calendar_selection_time (day_view);
-
- /* FIXME: Optimise? */
- gtk_widget_queue_draw (day_view->top_canvas);
- gtk_widget_queue_draw (day_view->main_canvas);
- }
- g_signal_emit_by_name (day_view, "selected_time_changed");
-}
-
-
-/* Scrolls the main canvas up or down. The pages_to_scroll argument
- is multiplied with the adjustment's page size and added to the adjustment's
- value, while ensuring we stay within the bounds. A positive value will
- scroll the canvas down and a negative value will scroll it up. */
-static void
-e_day_view_scroll (EDayView *day_view,
- gfloat pages_to_scroll)
-{
- GtkAdjustment *adj = GTK_LAYOUT (day_view->main_canvas)->vadjustment;
- gfloat new_value;
-
- new_value = adj->value - adj->page_size * pages_to_scroll;
- new_value = CLAMP (new_value, adj->lower, adj->upper - adj->page_size);
- gtk_adjustment_set_value (adj, new_value);
-}
-
-
-static gboolean
-e_day_view_check_if_new_event_fits (EDayView *day_view)
-{
- gint day, start_row, end_row, row;
-
- day = day_view->selection_start_day;
- start_row = day_view->selection_start_row;
- end_row = day_view->selection_end_row;
-
- /* Long events always fit, since we keep adding rows to the top
- canvas. */
- if (day != day_view->selection_end_day)
- return TRUE;
- if (start_row == 0 && end_row == day_view->rows)
- return TRUE;
-
- /* If any of the rows already have E_DAY_VIEW_MAX_COLUMNS columns,
- return FALSE. */
- for (row = start_row; row <= end_row; row++) {
- if (day_view->cols_per_row[day][row] >= E_DAY_VIEW_MAX_COLUMNS)
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-void
-e_day_view_ensure_rows_visible (EDayView *day_view,
- gint start_row,
- gint end_row)
-{
- GtkAdjustment *adj;
- gfloat value, min_value, max_value;
-
- adj = GTK_LAYOUT (day_view->main_canvas)->vadjustment;
-
- value = adj->value;
-
- min_value = (end_row + 1) * day_view->row_height - adj->page_size;
- if (value < min_value)
- value = min_value;
-
- max_value = start_row * day_view->row_height;
- if (value > max_value)
- value = max_value;
-
- if (value != adj->value) {
- adj->value = value;
- gtk_adjustment_value_changed (adj);
- }
-}
-
-
-static void
-e_day_view_start_editing_event (EDayView *day_view,
- gint day,
- gint event_num,
- gchar *initial_text)
-{
- EDayViewEvent *event;
- ETextEventProcessor *event_processor = NULL;
- ETextEventProcessorCommand command;
-
-#if 0
- g_print ("In e_day_view_start_editing_event\n");
-#endif
-
- /* If we are already editing the event, just return. */
- if (day == day_view->editing_event_day
- && event_num == day_view->editing_event_num)
- return;
-
- if (day == E_DAY_VIEW_LONG_EVENT) {
- event = &g_array_index (day_view->long_events, EDayViewEvent,
- event_num);
- } else {
- event = &g_array_index (day_view->events[day], EDayViewEvent,
- event_num);
- }
-
- /* If the event is not shown, don't try to edit it. */
- if (!event->canvas_item)
- return;
-
- /* We must grab the focus before setting the initial text, since
- grabbing the focus will result in a call to
- e_day_view_on_editing_started(), which will reset the text to get
- rid of the start and end times. */
- e_canvas_item_grab_focus (event->canvas_item, TRUE);
-
- if (initial_text) {
- gnome_canvas_item_set (event->canvas_item,
- "text", initial_text,
- NULL);
- }
-
- /* Try to move the cursor to the end of the text. */
- g_object_get (G_OBJECT (event->canvas_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);
- }
-}
-
-
-/* This stops the current edit. If accept is TRUE the event summary is updated,
- else the edit is cancelled. */
-static void
-e_day_view_stop_editing_event (EDayView *day_view)
-{
- GtkWidget *toplevel;
-
- /* Check we are editing an event. */
- if (day_view->editing_event_day == -1)
- return;
-
- /* Set focus to the toplevel so the item loses focus. */
- toplevel = gtk_widget_get_toplevel (GTK_WIDGET (day_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 (EDayView *day_view)
-{
- int day, event_num;
- EDayViewEvent *event;
- const gchar *summary;
-
- day = day_view->editing_event_day;
- event_num = day_view->editing_event_num;
-
- g_assert (day != -1);
-
- if (day == E_DAY_VIEW_LONG_EVENT)
- event = &g_array_index (day_view->long_events, EDayViewEvent, event_num);
- else
- event = &g_array_index (day_view->events[day], EDayViewEvent, event_num);
-
- /* Reset the text to what was in the component */
-
- summary = icalcomponent_get_summary (event->comp_data->icalcomp);
- g_object_set (G_OBJECT (event->canvas_item),
- "text", summary ? summary : "",
- NULL);
-
- /* Stop editing */
- e_day_view_stop_editing_event (day_view);
-}
-
-
-static gboolean
-e_day_view_on_text_item_event (GnomeCanvasItem *item,
- GdkEvent *event,
- EDayView *day_view)
-{
- switch (event->type) {
- case GDK_KEY_PRESS:
- if (event && event->key.keyval == GDK_Return) {
- day_view->resize_event_num = -1;
-
- /* We set the keyboard focus to the EDayView, so the
- EText item loses it and stops the edit. */
- gtk_widget_grab_focus (GTK_WIDGET (day_view));
-
- /* Stop the signal last or we will also stop any
- other events getting to the EText item. */
- gtk_signal_emit_stop_by_name (GTK_OBJECT (item),
- "event");
- return TRUE;
- } else if (event->key.keyval == GDK_Escape) {
- cancel_editing (day_view);
- gtk_signal_emit_stop_by_name (GTK_OBJECT (item), "event");
- /* focus should go to day view when stop editing */
- gtk_widget_grab_focus (GTK_WIDGET (day_view));
- return TRUE;
- } else if ((event->key.keyval == GDK_Up)
- && (event->key.state & GDK_SHIFT_MASK)
- && (event->key.state & GDK_CONTROL_MASK)
- && (event->key.state & GDK_MOD1_MASK)) {
- e_day_view_change_event_end_time_up (day_view);
- return TRUE;
- } else if ((event->key.keyval == GDK_Down)
- && (event->key.state & GDK_SHIFT_MASK)
- && (event->key.state & GDK_CONTROL_MASK)
- && (event->key.state & GDK_MOD1_MASK)) {
- e_day_view_change_event_end_time_down (day_view);
- return TRUE;
- }
- break;
- case GDK_2BUTTON_PRESS:
-#if 0
- g_print ("Item got double-click\n");
-#endif
- break;
-
- case GDK_BUTTON_PRESS:
- case GDK_BUTTON_RELEASE:
- /* Only let the EText handle the event while editing. */
- if (!E_TEXT (item)->editing)
- gtk_signal_emit_stop_by_name (GTK_OBJECT (item),
- "event");
- break;
- case GDK_FOCUS_CHANGE:
- if (event->focus_change.in)
- e_day_view_on_editing_started (day_view, item);
- else
- e_day_view_on_editing_stopped (day_view, item);
-
- return FALSE;
- default:
- break;
- }
-
- return FALSE;
-}
-
-static void
-e_day_view_change_event_end_time_up (EDayView *day_view)
-{
- EDayViewEvent *event;
- gint day, event_num, resize_start_row, resize_end_row;
-
- day = day_view->editing_event_day;
- event_num = day_view->editing_event_num;
- if ((day == -1) || (day == E_DAY_VIEW_LONG_EVENT))
- return;
- event = &g_array_index (day_view->events[day], EDayViewEvent,
- event_num);
- day_view->resize_event_day = day;
- day_view->resize_event_num = event_num;
- day_view->resize_bars_event_day = day;
- day_view->resize_bars_event_num = event_num;
- resize_start_row = event->start_minute / day_view->mins_per_row;
- resize_end_row = (event->end_minute - 1) / day_view->mins_per_row;
- if (resize_end_row < resize_start_row)
- resize_end_row = resize_start_row;
- if (resize_end_row == resize_start_row)
- return;
- day_view->resize_drag_pos = E_CALENDAR_VIEW_POS_BOTTOM_EDGE;
- resize_end_row--;
- day_view->resize_start_row = resize_start_row;
- day_view->resize_end_row = resize_end_row;
- e_day_view_finish_resize (day_view);
- e_day_view_ensure_rows_visible (day_view, resize_start_row, resize_end_row);
-}
-
-
-static void
-e_day_view_change_event_end_time_down (EDayView *day_view)
-{
- EDayViewEvent *event;
- gint day, event_num, resize_start_row, resize_end_row;
-
- day = day_view->editing_event_day;
- event_num = day_view->editing_event_num;
- if ((day == -1) || (day == E_DAY_VIEW_LONG_EVENT))
- return;
- event = &g_array_index (day_view->events[day], EDayViewEvent,
- event_num);
- day_view->resize_event_day = day;
- day_view->resize_event_num = event_num;
- day_view->resize_bars_event_day = day;
- day_view->resize_bars_event_num = event_num;
- resize_start_row = event->start_minute / day_view->mins_per_row;
- resize_end_row = (event->end_minute - 1) / day_view->mins_per_row;
- if (resize_end_row < resize_start_row)
- resize_end_row = resize_start_row;
- if (resize_end_row == day_view->rows -1)
- return;
- day_view->resize_drag_pos = E_CALENDAR_VIEW_POS_BOTTOM_EDGE;
- resize_end_row++;
- day_view->resize_start_row = resize_start_row;
- day_view->resize_end_row = resize_end_row;
- e_day_view_finish_resize (day_view);
- e_day_view_ensure_rows_visible (day_view, resize_start_row, resize_end_row);
-}
-
-
-static void
-e_day_view_on_editing_started (EDayView *day_view,
- GnomeCanvasItem *item)
-{
- gint day, event_num;
-
- if (!e_day_view_find_event_from_item (day_view, item,
- &day, &event_num))
- return;
-
-#if 0
- g_print ("In e_day_view_on_editing_started Day:%i Event:%i\n",
- day, event_num);
-#endif
-
- /* FIXME: This is a temporary workaround for a bug which seems to stop
- us getting focus_out signals. It is not a complete fix since if we
- don't get focus_out signals we don't save the appointment text so
- this may be lost. */
- if (day_view->editing_event_day == day
- && day_view->editing_event_num == event_num)
- return;
-
- day_view->editing_event_day = day;
- day_view->editing_event_num = event_num;
-
- if (day == E_DAY_VIEW_LONG_EVENT) {
- e_day_view_reshape_long_event (day_view, event_num);
- } else {
- day_view->resize_bars_event_day = day;
- day_view->resize_bars_event_num = event_num;
- e_day_view_update_event_label (day_view, day, event_num);
- e_day_view_reshape_main_canvas_resize_bars (day_view);
- }
-
- g_signal_emit_by_name (day_view, "selection_changed");
-}
-
-static void
-e_day_view_on_editing_stopped (EDayView *day_view,
- GnomeCanvasItem *item)
-{
- gint day, event_num;
- gboolean editing_long_event = FALSE;
- EDayViewEvent *event;
- gchar *text = NULL;
- ECalComponentText summary;
- ECalComponent *comp;
- ECal *client;
- 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. */
- day = day_view->editing_event_day;
- event_num = day_view->editing_event_num;
-
-#if 0
- g_print ("In e_day_view_on_editing_stopped Day:%i Event:%i\n",
- day, event_num);
-#endif
-
- /* If no item is being edited, just return. */
- if (day == -1)
- return;
-
- if (day == E_DAY_VIEW_LONG_EVENT) {
- editing_long_event = TRUE;
- event = &g_array_index (day_view->long_events, EDayViewEvent,
- event_num);
- } else {
- event = &g_array_index (day_view->events[day], EDayViewEvent,
- event_num);
-
- /* Hide the horizontal bars. */
- gnome_canvas_item_hide (day_view->main_canvas_top_resize_bar_item);
- gnome_canvas_item_hide (day_view->main_canvas_bottom_resize_bar_item);
- }
-
- /* Reset the edit fields. */
- day_view->editing_event_day = -1;
- day_view->editing_event_num = -1;
-
- day_view->resize_bars_event_day = -1;
- day_view->resize_bars_event_num = -1;
-
- g_object_set (event->canvas_item, "handle_popup", FALSE, NULL);
- g_object_get (G_OBJECT (event->canvas_item),
- "text", &text,
- NULL);
- g_assert (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 = cal_comp_is_on_server (comp, client);
-
- if (string_is_empty (text) && !on_server) {
- const char *uid;
-
- e_cal_component_get_uid (comp, &uid);
-
- e_day_view_foreach_event_with_uid (day_view, uid,
- e_day_view_remove_event_cb, NULL);
- e_day_view_check_layout (day_view);
- gtk_widget_queue_draw (day_view->top_canvas);
- gtk_widget_queue_draw (day_view->main_canvas);
- goto out;
- }
-
- /* Only update the summary if necessary. */
- e_cal_component_get_summary (comp, &summary);
- if (summary.value && !strcmp (text, summary.value)) {
- if (day == E_DAY_VIEW_LONG_EVENT)
- e_day_view_reshape_long_event (day_view, event_num);
- else
- e_day_view_update_event_label (day_view, day,
- event_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);
-
- if (!on_server) {
- if (!e_cal_create_object (client, icalcomp, NULL, NULL))
- g_message (G_STRLOC ": Could not create the object!");
- } else {
- CalObjModType mod = CALOBJ_MOD_ALL;
- GtkWindow *toplevel;
- if (e_cal_component_has_recurrences (comp)) {
- if (!recur_component_dialog (client, comp, &mod, NULL)) {
- goto out;
- }
- }
-
- /* FIXME When sending here, what exactly should we send? */
- toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (day_view)));
- if (e_cal_modify_object (client, icalcomp, mod, NULL)) {
- if (itip_organizer_is_user (comp, client)
- && send_component_dialog (toplevel, client, comp, FALSE))
- itip_send_comp (E_CAL_COMPONENT_METHOD_REQUEST, comp,
- client, NULL);
- }
- }
-
- }
-
- out:
-
- g_object_unref (comp);
- g_free (text);
-
- g_signal_emit_by_name (day_view, "selection_changed");
-}
-
-
-/* FIXME: It is possible that we may produce an invalid time due to daylight
- saving times (i.e. when clocks go forward there is a range of time which
- is not valid). I don't know the best way to handle daylight saving time. */
-static time_t
-e_day_view_convert_grid_position_to_time (EDayView *day_view,
- gint col,
- gint row)
-{
- struct icaltimetype tt;
- time_t val;
- gint minutes;
-
- /* Calulate the number of minutes since the start of the day. */
- minutes = day_view->first_hour_shown * 60
- + day_view->first_minute_shown
- + row * day_view->mins_per_row;
-
- /* A special case for midnight, where we can use the start of the
- next day. */
- if (minutes == 60 * 24)
- return day_view->day_starts[col + 1];
-
- /* Create an icaltimetype and convert to a time_t. */
- tt = icaltime_from_timet_with_zone (day_view->day_starts[col],
- FALSE, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
- tt.hour = minutes / 60;
- tt.minute = minutes % 60;
- tt.second = 0;
-
- val = icaltime_as_timet_with_zone (tt, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
- return val;
-}
-
-
-static gboolean
-e_day_view_convert_time_to_grid_position (EDayView *day_view,
- time_t time,
- gint *col,
- gint *row)
-{
- struct icaltimetype tt;
- gint day, minutes;
-
- *col = *row = 0;
-
- if (time < day_view->lower || time >= day_view->upper)
- return FALSE;
-
- /* We can find the column easily using the day_starts array. */
- for (day = 1; day <= day_view->days_shown; day++) {
- if (time < day_view->day_starts[day]) {
- *col = day - 1;
- break;
- }
- }
-
- /* To find the row we need to convert the time to an icaltimetype,
- calculate the offset in minutes from the top of the display and
- divide it by the mins per row setting. */
- tt = icaltime_from_timet_with_zone (time, FALSE, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
-
- minutes = tt.hour * 60 + tt.minute;
- minutes -= day_view->first_hour_shown * 60 + day_view->first_minute_shown;
-
- *row = minutes / day_view->mins_per_row;
-
- if (*row < 0 || *row >= day_view->rows)
- return FALSE;
-
- return TRUE;
-}
-
-
-/* This starts or stops auto-scrolling when dragging a selection or resizing
- an event. */
-void
-e_day_view_check_auto_scroll (EDayView *day_view,
- gint event_x,
- gint event_y)
-{
- gint scroll_x, scroll_y;
-
- gnome_canvas_get_scroll_offsets (GNOME_CANVAS (day_view->main_canvas),
- &scroll_x, &scroll_y);
-
- event_x -= scroll_x;
- event_y -= scroll_y;
-
- day_view->last_mouse_x = event_x;
- day_view->last_mouse_y = event_y;
-
- if (event_y < E_DAY_VIEW_AUTO_SCROLL_OFFSET)
- e_day_view_start_auto_scroll (day_view, TRUE);
- else if (event_y >= day_view->main_canvas->allocation.height
- - E_DAY_VIEW_AUTO_SCROLL_OFFSET)
- e_day_view_start_auto_scroll (day_view, FALSE);
- else
- e_day_view_stop_auto_scroll (day_view);
-}
-
-
-static void
-e_day_view_start_auto_scroll (EDayView *day_view,
- gboolean scroll_up)
-{
- if (day_view->auto_scroll_timeout_id == 0) {
- day_view->auto_scroll_timeout_id = g_timeout_add (E_DAY_VIEW_AUTO_SCROLL_TIMEOUT, e_day_view_auto_scroll_handler, day_view);
- day_view->auto_scroll_delay = E_DAY_VIEW_AUTO_SCROLL_DELAY;
- }
- day_view->auto_scroll_up = scroll_up;
-}
-
-
-void
-e_day_view_stop_auto_scroll (EDayView *day_view)
-{
- if (day_view->auto_scroll_timeout_id != 0) {
- gtk_timeout_remove (day_view->auto_scroll_timeout_id);
- day_view->auto_scroll_timeout_id = 0;
- }
-}
-
-
-static gboolean
-e_day_view_auto_scroll_handler (gpointer data)
-{
- EDayView *day_view;
- ECalendarViewPosition pos;
- gint scroll_x, scroll_y, new_scroll_y, canvas_x, canvas_y, row, day;
- GtkAdjustment *adj;
-
- g_return_val_if_fail (E_IS_DAY_VIEW (data), FALSE);
-
- day_view = E_DAY_VIEW (data);
-
- GDK_THREADS_ENTER ();
-
- if (day_view->auto_scroll_delay > 0) {
- day_view->auto_scroll_delay--;
- GDK_THREADS_LEAVE ();
- return TRUE;
- }
-
- gnome_canvas_get_scroll_offsets (GNOME_CANVAS (day_view->main_canvas),
- &scroll_x, &scroll_y);
-
- adj = GTK_LAYOUT (day_view->main_canvas)->vadjustment;
-
- if (day_view->auto_scroll_up)
- new_scroll_y = MAX (scroll_y - adj->step_increment, 0);
- else
- new_scroll_y = MIN (scroll_y + adj->step_increment,
- adj->upper - adj->page_size);
-
- if (new_scroll_y != scroll_y) {
- /* NOTE: This reduces flicker, but only works if we don't use
- canvas items which have X windows. */
-
- /* FIXME: Since GNOME 2.0 we can't do this, since the canvas
- * won't update when its's thawed. Is this a bug or should we
- * really be doing something else? Investigate. */
-#if 0
- gtk_layout_freeze (GTK_LAYOUT (day_view->main_canvas));
-#endif
-
- gnome_canvas_scroll_to (GNOME_CANVAS (day_view->main_canvas),
- scroll_x, new_scroll_y);
-#if 0
- gtk_layout_thaw (GTK_LAYOUT (day_view->main_canvas));
-#endif
- }
-
- canvas_x = day_view->last_mouse_x + scroll_x;
- canvas_y = day_view->last_mouse_y + new_scroll_y;
-
- /* The last_mouse_x position is set to -1 when we are selecting using
- the time column. In this case we set canvas_x to 0 and we ignore
- the resulting day. */
- if (day_view->last_mouse_x == -1)
- canvas_x = 0;
-
- /* Update the selection/resize/drag if necessary. */
- pos = e_day_view_convert_position_in_main_canvas (day_view,
- canvas_x, canvas_y,
- &day, &row, NULL);
-
- if (day_view->last_mouse_x == -1)
- day = -1;
-
- if (pos != E_CALENDAR_VIEW_POS_OUTSIDE) {
- if (day_view->selection_is_being_dragged) {
- e_day_view_update_selection (day_view, day, row);
- } else if (day_view->resize_drag_pos != E_CALENDAR_VIEW_POS_NONE) {
- e_day_view_update_resize (day_view, row);
- } else if (day_view->drag_item->object.flags
- & GNOME_CANVAS_ITEM_VISIBLE) {
- e_day_view_update_main_canvas_drag (day_view, row,
- day);
- }
- }
-
- GDK_THREADS_LEAVE ();
- return TRUE;
-}
-
-gboolean
-e_day_view_get_event_rows (EDayView *day_view,
- gint day,
- gint event_num,
- gint *start_row_out,
- gint *end_row_out)
-{
- gint start_row, end_row;
- EDayViewEvent *event;
-
- g_return_val_if_fail (day >= 0, FALSE);
- g_return_val_if_fail (day < E_DAY_VIEW_LONG_EVENT, FALSE);
- g_return_val_if_fail (event_num >= 0, FALSE);
-
- event = &g_array_index (day_view->events[day], EDayViewEvent,
- event_num);
- start_row = event->start_minute / day_view->mins_per_row;
- end_row = (event->end_minute - 1) / day_view->mins_per_row;
- if (end_row < start_row)
- end_row = start_row;
-
- *start_row_out = start_row;
- *end_row_out = end_row;
- return TRUE;
-}
-
-gboolean
-e_day_view_get_event_position (EDayView *day_view,
- gint day,
- gint event_num,
- gint *item_x,
- gint *item_y,
- gint *item_w,
- gint *item_h)
-{
- EDayViewEvent *event;
- gint start_row, end_row, cols_in_row, start_col, num_columns;
-
- event = &g_array_index (day_view->events[day], EDayViewEvent,
- event_num);
-
- /* If the event is flagged as not displayed, return FALSE. */
- if (event->num_columns == 0)
- return FALSE;
-
- e_day_view_get_event_rows(day_view, day, event_num, &start_row, &end_row);
-
- cols_in_row = day_view->cols_per_row[day][start_row];
- start_col = event->start_row_or_col;
- num_columns = event->num_columns;
-
- if (cols_in_row == 0)
- return FALSE;
-
- /* If the event is being resize, use the resize position. */
- if (day_view->resize_drag_pos != E_CALENDAR_VIEW_POS_NONE
- && day_view->resize_event_day == day
- && day_view->resize_event_num == event_num) {
- if (day_view->resize_drag_pos == E_CALENDAR_VIEW_POS_TOP_EDGE)
- start_row = day_view->resize_start_row;
- else if (day_view->resize_drag_pos == E_CALENDAR_VIEW_POS_BOTTOM_EDGE)
- end_row = day_view->resize_end_row;
- }
-
-
- *item_x = day_view->day_offsets[day]
- + day_view->day_widths[day] * start_col / cols_in_row;
- *item_w = day_view->day_widths[day] * num_columns / cols_in_row
- - E_DAY_VIEW_GAP_WIDTH;
- *item_w = MAX (*item_w, 0);
- *item_y = start_row * day_view->row_height;
-#if 0
- *item_h = (end_row - start_row + 1) * day_view->row_height;
-#else
- /* This makes the event end on the grid line of the next row,
- which maybe looks nicer if you have 2 events on consecutive rows. */
- *item_h = (end_row - start_row + 1) * day_view->row_height + 1;
-#endif
- return TRUE;
-}
-
-
-gboolean
-e_day_view_get_long_event_position (EDayView *day_view,
- gint event_num,
- gint *start_day,
- gint *end_day,
- gint *item_x,
- gint *item_y,
- gint *item_w,
- gint *item_h)
-{
- EDayViewEvent *event;
-
- event = &g_array_index (day_view->long_events, EDayViewEvent,
- event_num);
-
- /* If the event is flagged as not displayed, return FALSE. */
- if (event->num_columns == 0)
- return FALSE;
-
- if (!e_day_view_find_long_event_days (event,
- day_view->days_shown,
- day_view->day_starts,
- start_day, end_day))
- return FALSE;
-
- /* If the event is being resize, use the resize position. */
- if (day_view->resize_drag_pos != E_CALENDAR_VIEW_POS_NONE
- && day_view->resize_event_day == E_DAY_VIEW_LONG_EVENT
- && day_view->resize_event_num == event_num) {
- if (day_view->resize_drag_pos == E_CALENDAR_VIEW_POS_LEFT_EDGE)
- *start_day = day_view->resize_start_row;
- else if (day_view->resize_drag_pos == E_CALENDAR_VIEW_POS_RIGHT_EDGE)
- *end_day = day_view->resize_end_row;
- }
-
- *item_x = day_view->day_offsets[*start_day] + E_DAY_VIEW_BAR_WIDTH;
- *item_w = day_view->day_offsets[*end_day + 1] - *item_x
- - E_DAY_VIEW_GAP_WIDTH;
- *item_w = MAX (*item_w, 0);
- *item_y = (event->start_row_or_col + 1) * day_view->top_row_height;
- *item_h = day_view->top_row_height - E_DAY_VIEW_TOP_CANVAS_Y_GAP;
- return TRUE;
-}
-
-
-/* Converts a position within the entire top canvas to a day & event and
- a place within the event if appropriate. If event_num_return is NULL, it
- simply returns the grid position without trying to find the event. */
-static ECalendarViewPosition
-e_day_view_convert_position_in_top_canvas (EDayView *day_view,
- gint x,
- gint y,
- gint *day_return,
- gint *event_num_return)
-{
- EDayViewEvent *event;
- gint day, row, col;
- gint event_num, start_day, end_day, item_x, item_y, item_w, item_h;
-
- *day_return = -1;
- if (event_num_return)
- *event_num_return = -1;
-
- if (x < 0 || y < 0)
- return E_CALENDAR_VIEW_POS_OUTSIDE;
-
- row = y / day_view->top_row_height - 1;
-
- day = -1;
- for (col = 1; col <= day_view->days_shown; col++) {
- if (x < day_view->day_offsets[col]) {
- day = col - 1;
- break;
- }
- }
- if (day == -1)
- return E_CALENDAR_VIEW_POS_OUTSIDE;
-
- *day_return = day;
-
- /* If only the grid position is wanted, return. */
- if (event_num_return == NULL)
- return E_CALENDAR_VIEW_POS_NONE;
-
- for (event_num = 0; event_num < day_view->long_events->len;
- event_num++) {
- event = &g_array_index (day_view->long_events, EDayViewEvent,
- event_num);
-
- if (event->start_row_or_col != row)
- continue;
-
- if (!e_day_view_get_long_event_position (day_view, event_num,
- &start_day, &end_day,
- &item_x, &item_y,
- &item_w, &item_h))
- continue;
-
- if (x < item_x)
- continue;
-
- if (x >= item_x + item_w)
- continue;
-
- *event_num_return = event_num;
-
- if (x < item_x + E_DAY_VIEW_LONG_EVENT_BORDER_WIDTH
- + E_DAY_VIEW_LONG_EVENT_X_PAD)
- return E_CALENDAR_VIEW_POS_LEFT_EDGE;
-
- if (x >= item_x + item_w - E_DAY_VIEW_LONG_EVENT_BORDER_WIDTH
- - E_DAY_VIEW_LONG_EVENT_X_PAD)
- return E_CALENDAR_VIEW_POS_RIGHT_EDGE;
-
- return E_CALENDAR_VIEW_POS_EVENT;
- }
-
- return E_CALENDAR_VIEW_POS_NONE;
-}
-
-
-/* Converts a position within the entire main canvas to a day, row, event and
- a place within the event if appropriate. If event_num_return is NULL, it
- simply returns the grid position without trying to find the event. */
-static ECalendarViewPosition
-e_day_view_convert_position_in_main_canvas (EDayView *day_view,
- gint x,
- gint y,
- gint *day_return,
- gint *row_return,
- gint *event_num_return)
-{
- gint day, row, col, event_num;
- gint item_x, item_y, item_w, item_h;
-
-#if 0
- g_print ("e_day_view_convert_position_in_main_canvas: (%d, %d)\n", x, y);
-#endif
-
- *day_return = -1;
- *row_return = -1;
- if (event_num_return)
- *event_num_return = -1;
-
- /* Check the position is inside the canvas, and determine the day
- and row. */
- if (x < 0 || y < 0)
- return E_CALENDAR_VIEW_POS_OUTSIDE;
-
- row = y / day_view->row_height;
- if (row >= day_view->rows)
- return E_CALENDAR_VIEW_POS_OUTSIDE;
-
- day = -1;
- for (col = 1; col <= day_view->days_shown; col++) {
- if (x < day_view->day_offsets[col]) {
- day = col - 1;
- break;
- }
- }
- if (day == -1)
- return E_CALENDAR_VIEW_POS_OUTSIDE;
-
- *day_return = day;
- *row_return = row;
-
- /* If only the grid position is wanted, return. */
- if (event_num_return == NULL)
- return E_CALENDAR_VIEW_POS_NONE;
-
- /* Check the selected item first, since the horizontal resizing bars
- may be above other events. */
- if (day_view->resize_bars_event_day == day) {
- if (e_day_view_get_event_position (day_view, day,
- day_view->resize_bars_event_num,
- &item_x, &item_y,
- &item_w, &item_h)) {
- if (x >= item_x && x < item_x + item_w) {
- *event_num_return = day_view->resize_bars_event_num;
- if (y >= item_y - E_DAY_VIEW_BAR_HEIGHT
- && y < item_y + E_DAY_VIEW_EVENT_BORDER_HEIGHT)
- return E_CALENDAR_VIEW_POS_TOP_EDGE;
- if (y >= item_y + item_h - E_DAY_VIEW_EVENT_BORDER_HEIGHT
- && y < item_y + item_h + E_DAY_VIEW_BAR_HEIGHT)
- return E_CALENDAR_VIEW_POS_BOTTOM_EDGE;
- }
- }
- }
-
- /* Try to find the event at the found position. */
- *event_num_return = -1;
- for (event_num = 0; event_num < day_view->events[day]->len;
- event_num++) {
- if (!e_day_view_get_event_position (day_view, day, event_num,
- &item_x, &item_y,
- &item_w, &item_h))
- continue;
-
- if (x < item_x || x >= item_x + item_w
- || y < item_y || y >= item_y + item_h)
- continue;
-
- *event_num_return = event_num;
-
- if (x < item_x + E_DAY_VIEW_BAR_WIDTH)
- return E_CALENDAR_VIEW_POS_LEFT_EDGE;
-
- if (y < item_y + E_DAY_VIEW_EVENT_BORDER_HEIGHT
- + E_DAY_VIEW_EVENT_Y_PAD)
- return E_CALENDAR_VIEW_POS_TOP_EDGE;
-
- if (y >= item_y + item_h - E_DAY_VIEW_EVENT_BORDER_HEIGHT
- - E_DAY_VIEW_EVENT_Y_PAD)
- return E_CALENDAR_VIEW_POS_BOTTOM_EDGE;
-
- return E_CALENDAR_VIEW_POS_EVENT;
- }
-
- return E_CALENDAR_VIEW_POS_NONE;
-}
-
-
-static gboolean
-e_day_view_on_top_canvas_drag_motion (GtkWidget *widget,
- GdkDragContext *context,
- gint x,
- gint y,
- guint time,
- EDayView *day_view)
-{
- gint scroll_x, scroll_y;
-
- gnome_canvas_get_scroll_offsets (GNOME_CANVAS (widget),
- &scroll_x, &scroll_y);
- day_view->drag_event_x = x + scroll_x;
- day_view->drag_event_y = y + scroll_y;
-
- e_day_view_reshape_top_canvas_drag_item (day_view);
-
- return TRUE;
-}
-
-
-static void
-e_day_view_reshape_top_canvas_drag_item (EDayView *day_view)
-{
- ECalendarViewPosition pos;
- gint x, y, day;
-
- /* Calculate the day & start row of the event being dragged, using
- the current mouse position. */
- x = day_view->drag_event_x;
- y = day_view->drag_event_y;
- pos = e_day_view_convert_position_in_top_canvas (day_view, x, y,
- &day, NULL);
- /* This shouldn't really happen in a drag. */
- if (pos == E_CALENDAR_VIEW_POS_OUTSIDE)
- return;
-
- if (day_view->drag_event_day == E_DAY_VIEW_LONG_EVENT)
- day -= day_view->drag_event_offset;
- day = MAX (day, 0);
-
- e_day_view_update_top_canvas_drag (day_view, day);
-}
-
-
-static void
-e_day_view_update_top_canvas_drag (EDayView *day_view,
- gint day)
-{
- EDayViewEvent *event = NULL;
- gint row, num_days, start_day, end_day;
- gdouble item_x, item_y, item_w, item_h;
- gchar *text;
-
- /* Calculate the event's position. If the event is in the same
- position we started in, we use the same columns. */
- row = day_view->rows_in_top_display + 1;
- num_days = 1;
-
- if (day_view->drag_event_day == E_DAY_VIEW_LONG_EVENT) {
- event = &g_array_index (day_view->long_events, EDayViewEvent,
- day_view->drag_event_num);
- row = event->start_row_or_col + 1;
-
- if (!e_day_view_find_long_event_days (event,
- day_view->days_shown,
- day_view->day_starts,
- &start_day, &end_day))
- return;
-
- num_days = end_day - start_day + 1;
-
- /* Make sure we don't go off the screen. */
- day = MIN (day, day_view->days_shown - num_days);
-
- } else if (day_view->drag_event_day != -1) {
- event = &g_array_index (day_view->events[day_view->drag_event_day],
- EDayViewEvent,
- day_view->drag_event_num);
- }
-
- /* If the position hasn't changed, just return. */
- if (day_view->drag_last_day == day
- && (day_view->drag_long_event_item->object.flags
- & GNOME_CANVAS_ITEM_VISIBLE))
- return;
-
- day_view->drag_last_day = day;
-
-
- item_x = day_view->day_offsets[day] + E_DAY_VIEW_BAR_WIDTH;
- item_w = day_view->day_offsets[day + num_days] - item_x
- - E_DAY_VIEW_GAP_WIDTH;
- item_y = row * day_view->top_row_height;
- item_h = day_view->top_row_height - E_DAY_VIEW_TOP_CANVAS_Y_GAP;
-
-
- /* Set the positions of the event & associated items. */
- gnome_canvas_item_set (day_view->drag_long_event_rect_item,
- "x1", item_x,
- "y1", item_y,
- "x2", item_x + item_w - 1,
- "y2", item_y + item_h - 1,
- NULL);
-
- gnome_canvas_item_set (day_view->drag_long_event_item,
- "clip_width", item_w - (E_DAY_VIEW_LONG_EVENT_BORDER_WIDTH + E_DAY_VIEW_LONG_EVENT_X_PAD) * 2,
- "clip_height", item_h - (E_DAY_VIEW_LONG_EVENT_BORDER_HEIGHT + E_DAY_VIEW_LONG_EVENT_Y_PAD) * 2,
- NULL);
- e_canvas_item_move_absolute (day_view->drag_long_event_item,
- item_x + E_DAY_VIEW_LONG_EVENT_BORDER_WIDTH + E_DAY_VIEW_LONG_EVENT_X_PAD,
- item_y + E_DAY_VIEW_LONG_EVENT_BORDER_HEIGHT + E_DAY_VIEW_LONG_EVENT_Y_PAD);
-
- if (!(day_view->drag_long_event_rect_item->object.flags & GNOME_CANVAS_ITEM_VISIBLE)) {
- gnome_canvas_item_raise_to_top (day_view->drag_long_event_rect_item);
- gnome_canvas_item_show (day_view->drag_long_event_rect_item);
- }
-
- /* Set the text, if necessary. We don't want to set the text every
- time it moves, so we check if it is currently invisible and only
- set the text then. */
- if (!(day_view->drag_long_event_item->object.flags
- & GNOME_CANVAS_ITEM_VISIBLE)) {
- const gchar *summary;
-
- if (event) {
- summary = icalcomponent_get_summary (event->comp_data->icalcomp);
- text = g_strdup (summary);
- } else {
- text = NULL;
- }
-
- gnome_canvas_item_set (day_view->drag_long_event_item,
- "text", text ? text : "",
- NULL);
- gnome_canvas_item_raise_to_top (day_view->drag_long_event_item);
- gnome_canvas_item_show (day_view->drag_long_event_item);
-
- g_free (text);
- }
-}
-
-
-static gboolean
-e_day_view_on_main_canvas_drag_motion (GtkWidget *widget,
- GdkDragContext *context,
- gint x,
- gint y,
- guint time,
- EDayView *day_view)
-{
- gint scroll_x, scroll_y;
-
- gnome_canvas_get_scroll_offsets (GNOME_CANVAS (widget),
- &scroll_x, &scroll_y);
-
- day_view->drag_event_x = x + scroll_x;
- day_view->drag_event_y = y + scroll_y;
-
- e_day_view_reshape_main_canvas_drag_item (day_view);
- e_day_view_reshape_main_canvas_resize_bars (day_view);
-
- e_day_view_check_auto_scroll (day_view, day_view->drag_event_x, day_view->drag_event_y);
-
- return TRUE;
-}
-
-
-static void
-e_day_view_reshape_main_canvas_drag_item (EDayView *day_view)
-{
- ECalendarViewPosition pos;
- gint x, y, day, row;
-
- /* Calculate the day & start row of the event being dragged, using
- the current mouse position. */
- x = day_view->drag_event_x;
- y = day_view->drag_event_y;
- pos = e_day_view_convert_position_in_main_canvas (day_view, x, y,
- &day, &row, NULL);
- /* This shouldn't really happen in a drag. */
- if (pos == E_CALENDAR_VIEW_POS_OUTSIDE)
- return;
-
- if (day_view->drag_event_day != -1
- && day_view->drag_event_day != E_DAY_VIEW_LONG_EVENT)
- row -= day_view->drag_event_offset;
- row = MAX (row, 0);
-
- e_day_view_update_main_canvas_drag (day_view, row, day);
-}
-
-
-static void
-e_day_view_update_main_canvas_drag (EDayView *day_view,
- gint row,
- gint day)
-{
- EDayViewEvent *event = NULL;
- gint cols_in_row, start_col, num_columns, num_rows, start_row, end_row;
- gdouble item_x, item_y, item_w, item_h;
- gchar *text;
-
- /* If the position hasn't changed, just return. */
- if (day_view->drag_last_day == day
- && day_view->drag_last_row == row
- && (day_view->drag_item->object.flags & GNOME_CANVAS_ITEM_VISIBLE))
- return;
-
- day_view->drag_last_day = day;
- day_view->drag_last_row = row;
-
- /* Calculate the event's position. If the event is in the same
- position we started in, we use the same columns. */
- cols_in_row = 1;
- start_row = 0;
- start_col = 0;
- num_columns = 1;
- num_rows = 1;
-
- if (day_view->drag_event_day == E_DAY_VIEW_LONG_EVENT) {
- event = &g_array_index (day_view->long_events, EDayViewEvent,
- day_view->drag_event_num);
- } else if (day_view->drag_event_day != -1) {
- event = &g_array_index (day_view->events[day_view->drag_event_day],
- EDayViewEvent,
- day_view->drag_event_num);
- start_row = event->start_minute / day_view->mins_per_row;
- end_row = (event->end_minute - 1) / day_view->mins_per_row;
- if (end_row < start_row)
- end_row = start_row;
-
- num_rows = end_row - start_row + 1;
- }
-
- if (day_view->drag_event_day == day && start_row == row) {
- cols_in_row = day_view->cols_per_row[day][row];
- start_col = event->start_row_or_col;
- num_columns = event->num_columns;
- }
-
- item_x = day_view->day_offsets[day]
- + day_view->day_widths[day] * start_col / cols_in_row;
- item_w = day_view->day_widths[day] * num_columns / cols_in_row
- - E_DAY_VIEW_GAP_WIDTH;
- item_y = row * day_view->row_height;
- item_h = num_rows * day_view->row_height;
-
- /* Set the positions of the event & associated items. */
- gnome_canvas_item_set (day_view->drag_rect_item,
- "x1", item_x + E_DAY_VIEW_BAR_WIDTH - 1,
- "y1", item_y,
- "x2", item_x + item_w - 1,
- "y2", item_y + item_h - 1,
- NULL);
-
- gnome_canvas_item_set (day_view->drag_bar_item,
- "x1", item_x,
- "y1", item_y,
- "x2", item_x + E_DAY_VIEW_BAR_WIDTH - 1,
- "y2", item_y + item_h - 1,
- NULL);
-
- gnome_canvas_item_set (day_view->drag_item,
- "clip_width", item_w - E_DAY_VIEW_BAR_WIDTH - E_DAY_VIEW_EVENT_X_PAD * 2,
- "clip_height", item_h - (E_DAY_VIEW_EVENT_BORDER_HEIGHT + E_DAY_VIEW_EVENT_Y_PAD) * 2,
- NULL);
- e_canvas_item_move_absolute (day_view->drag_item,
- item_x + E_DAY_VIEW_BAR_WIDTH + E_DAY_VIEW_EVENT_X_PAD,
- item_y + E_DAY_VIEW_EVENT_BORDER_HEIGHT + E_DAY_VIEW_EVENT_Y_PAD);
-
- if (!(day_view->drag_bar_item->object.flags & GNOME_CANVAS_ITEM_VISIBLE)) {
- gnome_canvas_item_raise_to_top (day_view->drag_bar_item);
- gnome_canvas_item_show (day_view->drag_bar_item);
- }
-
- if (!(day_view->drag_rect_item->object.flags & GNOME_CANVAS_ITEM_VISIBLE)) {
- gnome_canvas_item_raise_to_top (day_view->drag_rect_item);
- gnome_canvas_item_show (day_view->drag_rect_item);
- }
-
- /* Set the text, if necessary. We don't want to set the text every
- time it moves, so we check if it is currently invisible and only
- set the text then. */
- if (!(day_view->drag_item->object.flags & GNOME_CANVAS_ITEM_VISIBLE)) {
- const gchar *summary;
-
- if (event) {
- summary = icalcomponent_get_summary (event->comp_data->icalcomp);
- text = g_strdup (summary);
- } else {
- text = NULL;
- }
-
- gnome_canvas_item_set (day_view->drag_item,
- "text", text ? text : "",
- NULL);
- gnome_canvas_item_raise_to_top (day_view->drag_item);
- gnome_canvas_item_show (day_view->drag_item);
-
- g_free (text);
- }
-}
-
-
-static void
-e_day_view_on_top_canvas_drag_leave (GtkWidget *widget,
- GdkDragContext *context,
- guint time,
- EDayView *day_view)
-{
- day_view->drag_last_day = -1;
-
- gnome_canvas_item_hide (day_view->drag_long_event_rect_item);
- gnome_canvas_item_hide (day_view->drag_long_event_item);
-}
-
-
-static void
-e_day_view_on_main_canvas_drag_leave (GtkWidget *widget,
- GdkDragContext *context,
- guint time,
- EDayView *day_view)
-{
- day_view->drag_last_day = -1;
-
- e_day_view_stop_auto_scroll (day_view);
-
- gnome_canvas_item_hide (day_view->drag_rect_item);
- gnome_canvas_item_hide (day_view->drag_bar_item);
- gnome_canvas_item_hide (day_view->drag_item);
-
- /* Hide the resize bars if they are being used in the drag. */
- if (day_view->drag_event_day == day_view->resize_bars_event_day
- && day_view->drag_event_num == day_view->resize_bars_event_num) {
- gnome_canvas_item_hide (day_view->main_canvas_top_resize_bar_item);
- gnome_canvas_item_hide (day_view->main_canvas_bottom_resize_bar_item);
- }
-}
-
-
-static void
-e_day_view_on_drag_begin (GtkWidget *widget,
- GdkDragContext *context,
- EDayView *day_view)
-{
- EDayViewEvent *event;
- gint day, event_num;
-
- day = day_view->drag_event_day;
- event_num = day_view->drag_event_num;
-
- /* These should both be set. */
- g_return_if_fail (day != -1);
- g_return_if_fail (event_num != -1);
-
- if (day == E_DAY_VIEW_LONG_EVENT)
- event = &g_array_index (day_view->long_events, EDayViewEvent,
- event_num);
- else
- event = &g_array_index (day_view->events[day], EDayViewEvent,
- event_num);
-
- /* Hide the text item, since it will be shown in the special drag
- items. */
- gnome_canvas_item_hide (event->canvas_item);
-}
-
-
-static void
-e_day_view_on_drag_end (GtkWidget *widget,
- GdkDragContext *context,
- EDayView *day_view)
-{
- EDayViewEvent *event;
- gint day, event_num;
-
- day = day_view->drag_event_day;
- event_num = day_view->drag_event_num;
-
- /* If the calendar has already been updated in drag_data_received()
- we just return. */
- if (day == -1 || event_num == -1)
- return;
-
- if (day == E_DAY_VIEW_LONG_EVENT) {
- event = &g_array_index (day_view->long_events, EDayViewEvent,
- event_num);
- gtk_widget_queue_draw (day_view->top_canvas);
- } else {
- event = &g_array_index (day_view->events[day], EDayViewEvent,
- event_num);
- gtk_widget_queue_draw (day_view->main_canvas);
- }
-
- /* Show the text item again. */
- gnome_canvas_item_show (event->canvas_item);
-
- day_view->drag_event_day = -1;
- day_view->drag_event_num = -1;
-}
-
-
-static void
-e_day_view_on_drag_data_get (GtkWidget *widget,
- GdkDragContext *context,
- GtkSelectionData *selection_data,
- guint info,
- guint time,
- EDayView *day_view)
-{
- EDayViewEvent *event;
- gint day, event_num;
-
- day = day_view->drag_event_day;
- event_num = day_view->drag_event_num;
-
- /* These should both be set. */
- g_return_if_fail (day != -1);
- g_return_if_fail (event_num != -1);
-
- if (day == E_DAY_VIEW_LONG_EVENT)
- event = &g_array_index (day_view->long_events,
- EDayViewEvent, event_num);
- else
- event = &g_array_index (day_view->events[day],
- EDayViewEvent, event_num);
-
- if (info == TARGET_CALENDAR_EVENT || info == TARGET_VCALENDAR) {
- /* we will pass an icalcalendar component for both types */
- char *comp_str;
- icalcomponent *vcal;
-
- vcal = e_cal_util_new_top_level ();
- e_cal_util_add_timezones_from_component (vcal, event->comp_data->icalcomp);
- icalcomponent_add_component (
- vcal,
- icalcomponent_new_clone (event->comp_data->icalcomp));
-
- comp_str = icalcomponent_as_ical_string (vcal);
- if (comp_str) {
- gtk_selection_data_set (selection_data, selection_data->target,
- 8, comp_str, strlen (comp_str));
- }
-
- icalcomponent_free (vcal);
- }
-}
-
-
-static void
-e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget,
- GdkDragContext *context,
- gint x,
- gint y,
- GtkSelectionData *data,
- guint info,
- guint time,
- EDayView *day_view)
-{
- EDayViewEvent *event=NULL;
- ECalendarViewPosition pos;
- gint day, start_day, end_day, num_days;
- gint start_offset, end_offset;
- ECalComponent *comp;
- ECalComponentDateTime date;
- struct icaltimetype itt;
- time_t dt;
- gboolean all_day_event;
- ECal *client;
- gboolean drag_from_same_window;
-
- if (day_view->drag_event_day != -1)
- drag_from_same_window = TRUE;
- else
- drag_from_same_window = FALSE;
-
- client = e_cal_model_get_default_client (e_calendar_view_get_model (E_CALENDAR_VIEW (day_view)));
-
- /* Note that we only support DnD within the EDayView at present. */
- if ((data->length >= 0) && (data->format == 8)
- && (day_view->drag_event_day != -1)) {
- /* We are dragging in the same window */
-
- pos = e_day_view_convert_position_in_top_canvas (day_view,
- x, y, &day,
- NULL);
- if (pos != E_CALENDAR_VIEW_POS_OUTSIDE) {
- CalObjModType mod = CALOBJ_MOD_ALL;
- GtkWindow *toplevel;
-
- num_days = 1;
- start_offset = 0;
- end_offset = 0;
-
- if (day_view->drag_event_day == E_DAY_VIEW_LONG_EVENT) {
- event = &g_array_index (day_view->long_events, EDayViewEvent,
- day_view->drag_event_num);
- day -= day_view->drag_event_offset;
- day = MAX (day, 0);
-
- e_day_view_find_long_event_days (event,
- day_view->days_shown,
- day_view->day_starts,
- &start_day,
- &end_day);
- num_days = end_day - start_day + 1;
- /* Make sure we don't go off the screen. */
- day = MIN (day, day_view->days_shown - num_days);
-
- start_offset = event->start_minute;
- end_offset = event->end_minute;
- } else {
- event = &g_array_index (day_view->events[day_view->drag_event_day],
- EDayViewEvent,
- day_view->drag_event_num);
- }
-
- client = event->comp_data->client;
-
- /* We clone the event since we don't want to change
- the original comp here.
- Otherwise we would not detect that the event's time
- had changed in the "update_event" callback. */
-
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
-
- if (start_offset == 0 && end_offset == 0)
- all_day_event = TRUE;
- else
- all_day_event = FALSE;
-
- date.value = &itt;
-
- dt = day_view->day_starts[day] + start_offset * 60;
- itt = icaltime_from_timet_with_zone (dt, FALSE,
- e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
- if (all_day_event) {
- itt.is_date = TRUE;
- date.tzid = NULL;
- } else {
- /* 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 (day_view)));
- }
- e_cal_component_set_dtstart (comp, &date);
-
- if (end_offset == 0)
- dt = day_view->day_starts[day + num_days];
- else
- dt = day_view->day_starts[day + num_days - 1] + end_offset * 60;
- itt = icaltime_from_timet_with_zone (dt, FALSE,
- e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
- if (all_day_event) {
- itt.is_date = TRUE;
- date.tzid = NULL;
- } else {
- /* 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 (day_view)));
- }
- e_cal_component_set_dtend (comp, &date);
-
- gtk_drag_finish (context, TRUE, TRUE, time);
-
- /* Reset this since it will be invalid. */
- day_view->drag_event_day = -1;
-
- /* Show the text item again, just in case it hasn't
- moved. If we don't do this it may not appear. */
- if (event->canvas_item)
- gnome_canvas_item_show (event->canvas_item);
-
- if (e_cal_component_has_recurrences (comp)) {
- if (!recur_component_dialog (client, comp, &mod, NULL))
- return;
- }
-
- toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (day_view)));
- e_cal_component_commit_sequence (comp);
-
- if (e_cal_modify_object (client, e_cal_component_get_icalcomponent (comp), mod, NULL)) {
- if (itip_organizer_is_user (comp, client)
- && send_component_dialog (toplevel, client, comp, FALSE))
- itip_send_comp (E_CAL_COMPONENT_METHOD_REQUEST, comp,
- client, NULL);
- }
-
- g_object_unref (comp);
-
- return;
- }
- }
-
- if ((data->length >= 0) && (data->format == 8)
- && !drag_from_same_window) {
- /* We are dragging between different window */
-
- char *comp_str, *default_tzid;
- icalcomponent *icalcomp;
- icalcomponent_kind kind;
- time_t dtstart;
- icaltimezone *default_zone;
-
- pos = e_day_view_convert_position_in_top_canvas (day_view,
- x, y, &day,
- NULL);
- if (pos == E_CALENDAR_VIEW_POS_OUTSIDE)
- goto error;
-
- comp_str = (char *) data->data;
- icalcomp = icalparser_parse_string ((const char *) comp_str);
- if (!icalcomp)
- goto error;
-
- default_tzid = calendar_config_get_timezone ();
- e_cal_get_timezone (client, default_tzid, &default_zone, NULL);
-
- /* check the type of the component */
- kind = icalcomponent_isa (icalcomp);
- if (kind != ICAL_VCALENDAR_COMPONENT && kind != ICAL_VEVENT_COMPONENT)
- goto error;
-
- dtstart = day_view->day_starts[day];
-
- if (kind == ICAL_VCALENDAR_COMPONENT) {
- icalcomponent_kind child_kind;
- icalcomponent *subcomp;
-
- subcomp = icalcomponent_get_first_component (icalcomp, ICAL_ANY_COMPONENT);
- while (subcomp) {
- child_kind = icalcomponent_isa (subcomp);
- if (child_kind == ICAL_VEVENT_COMPONENT)
- e_calendar_view_add_event (E_CALENDAR_VIEW (day_view), client, dtstart,
- default_zone, subcomp, TRUE);
- else if (child_kind == ICAL_VTIMEZONE_COMPONENT) {
- icaltimezone *zone;
-
- zone = icaltimezone_new ();
- icaltimezone_set_component (zone, subcomp);
- e_cal_add_timezone (client, zone, NULL);
-
- icaltimezone_free (zone, 1);
- }
-
- subcomp = icalcomponent_get_next_component (
- icalcomp, ICAL_ANY_COMPONENT);
- }
-
- icalcomponent_free (icalcomp);
-
- } else {
- e_calendar_view_add_event (E_CALENDAR_VIEW (day_view), client, dtstart, default_zone, icalcomp, TRUE);
- }
-
- gtk_drag_finish (context, TRUE, TRUE, time);
- return;
- }
-
-error:
- gtk_drag_finish (context, FALSE, FALSE, time);
-}
-
-
-static void
-e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget,
- GdkDragContext *context,
- gint x,
- gint y,
- GtkSelectionData *data,
- guint info,
- guint time,
- EDayView *day_view)
-{
- EDayViewEvent *event = NULL;
- ECalendarViewPosition pos;
- gint day, row, start_row, end_row, num_rows, scroll_x, scroll_y;
- gint start_offset, end_offset;
- ECalComponent *comp;
- ECalComponentDateTime date;
- struct icaltimetype itt;
- time_t dt;
- ECal *client;
- gboolean drag_from_same_window;
-
- if (day_view->drag_event_day != -1)
- drag_from_same_window = TRUE;
- else
- drag_from_same_window = FALSE;
-
- client = e_cal_model_get_default_client (e_calendar_view_get_model (E_CALENDAR_VIEW (day_view)));
-
- gnome_canvas_get_scroll_offsets (GNOME_CANVAS (widget),
- &scroll_x, &scroll_y);
- x += scroll_x;
- y += scroll_y;
-
- /* Note that we only support DnD within the EDayView at present. */
- if ((data->length >= 0) && (data->format == 8)
- && (day_view->drag_event_day != -1)) {
- /* We are dragging in the same window */
-
- pos = e_day_view_convert_position_in_main_canvas (day_view,
- x, y, &day,
- &row, NULL);
- if (pos != E_CALENDAR_VIEW_POS_OUTSIDE) {
- CalObjModType mod = CALOBJ_MOD_ALL;
- GtkWindow *toplevel;
-
- num_rows = 1;
- start_offset = 0;
- end_offset = 0;
-
- if (day_view->drag_event_day == E_DAY_VIEW_LONG_EVENT) {
- event = &g_array_index (day_view->long_events, EDayViewEvent,
- day_view->drag_event_num);
- } else {
- event = &g_array_index (day_view->events[day_view->drag_event_day],
- EDayViewEvent,
- day_view->drag_event_num);
- row -= day_view->drag_event_offset;
-
- /* Calculate time offset from start row. */
- start_row = event->start_minute / day_view->mins_per_row;
- end_row = (event->end_minute - 1) / day_view->mins_per_row;
- if (end_row < start_row)
- end_row = start_row;
-
- num_rows = end_row - start_row + 1;
-
- start_offset = event->start_minute % day_view->mins_per_row;
- end_offset = event->end_minute % day_view->mins_per_row;
- if (end_offset != 0)
- end_offset = day_view->mins_per_row - end_offset;
- }
-
- client = event->comp_data->client;
-
- /* We use a temporary shallow copy of comp since we
- don't want to change the original comp here.
- Otherwise we would not detect that the event's time
- had changed in the "update_event" callback. */
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
-
- date.value = &itt;
- date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
-
- dt = e_day_view_convert_grid_position_to_time (day_view, day, row) + start_offset * 60;
- *date.value = icaltime_from_timet_with_zone (dt, FALSE,
- e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
- e_cal_component_set_dtstart (comp, &date);
- dt = e_day_view_convert_grid_position_to_time (day_view, day, row + num_rows) - end_offset * 60;
- *date.value = icaltime_from_timet_with_zone (dt, FALSE,
- e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
- e_cal_component_set_dtend (comp, &date);
-
- gtk_drag_finish (context, TRUE, TRUE, time);
-
- /* Reset this since it will be invalid. */
- day_view->drag_event_day = -1;
-
- /* Show the text item again, just in case it hasn't
- moved. If we don't do this it may not appear. */
- if (event->canvas_item)
- gnome_canvas_item_show (event->canvas_item);
-
- if (e_cal_component_has_recurrences (comp)) {
- if (!recur_component_dialog (client, comp, &mod, NULL)) {
- g_object_unref (comp);
- return;
- }
- }
-
- toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (day_view)));
- e_cal_component_commit_sequence (comp);
-
- if (e_cal_modify_object (client, e_cal_component_get_icalcomponent (comp), mod, NULL)) {
- if (itip_organizer_is_user (comp, client)
- && send_component_dialog (toplevel, client, comp, FALSE))
- itip_send_comp (E_CAL_COMPONENT_METHOD_REQUEST, comp,
- client, NULL);
- }
-
- g_object_unref (comp);
-
- return;
- }
- }
-
- if ((data->length >= 0) && (data->format == 8)
- && !drag_from_same_window) {
- /* We are dragging between different window */
-
- char *comp_str, *default_tzid;
- icalcomponent *icalcomp;
- icalcomponent_kind kind;
- time_t dtstart;
- icaltimezone *default_zone;
-
- pos = e_day_view_convert_position_in_main_canvas (day_view,
- x, y, &day,
- &row, NULL);
- if (pos == E_CALENDAR_VIEW_POS_OUTSIDE)
- goto error;
-
- comp_str = (char *) data->data;
- icalcomp = icalparser_parse_string ((const char *) comp_str);
- if (!icalcomp)
- goto error;
-
- default_tzid = calendar_config_get_timezone ();
- e_cal_get_timezone (client, default_tzid, &default_zone, NULL);
-
- /* check the type of the component */
- kind = icalcomponent_isa (icalcomp);
- if (kind != ICAL_VCALENDAR_COMPONENT && kind != ICAL_VEVENT_COMPONENT)
- goto error;
-
- dtstart = e_day_view_convert_grid_position_to_time (day_view, day, row);
-
- if (kind == ICAL_VCALENDAR_COMPONENT) {
- icalcomponent_kind child_kind;
- icalcomponent *subcomp;
-
- subcomp = icalcomponent_get_first_component (icalcomp, ICAL_ANY_COMPONENT);
- while (subcomp) {
- child_kind = icalcomponent_isa (subcomp);
- if (child_kind == ICAL_VEVENT_COMPONENT)
- e_calendar_view_add_event (E_CALENDAR_VIEW (day_view), client, dtstart,
- default_zone, subcomp, FALSE);
- else if (child_kind == ICAL_VTIMEZONE_COMPONENT) {
- icaltimezone *zone;
-
- zone = icaltimezone_new ();
- icaltimezone_set_component (zone, subcomp);
- e_cal_add_timezone (client, zone, NULL);
-
- icaltimezone_free (zone, 1);
- }
-
- subcomp = icalcomponent_get_next_component (
- icalcomp, ICAL_ANY_COMPONENT);
- }
-
- icalcomponent_free (icalcomp);
-
- } else {
- e_calendar_view_add_event (E_CALENDAR_VIEW (day_view), client, dtstart, default_zone, icalcomp, FALSE);
- }
-
- gtk_drag_finish (context, TRUE, TRUE, time);
- return;
- }
-
-error:
- gtk_drag_finish (context, FALSE, FALSE, time);
-}
-
-
-/* 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_day_view_convert_time_to_display (EDayView *day_view,
- gint hour,
- gint *display_hour,
- gchar **suffix,
- gint *suffix_width)
-{
- /* 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_calendar_view_get_use_24_hour_format (E_CALENDAR_VIEW (day_view))) {
- *suffix = "";
- *suffix_width = 0;
- } else {
- if (hour < 12) {
- *suffix = day_view->am_string;
- *suffix_width = day_view->am_string_width;
- } else {
- *display_hour -= 12;
- *suffix = day_view->pm_string;
- *suffix_width = day_view->pm_string_width;
- }
-
- /* 12-hour uses 12:00 rather than 0:00. */
- if (*display_hour == 0)
- *display_hour = 12;
- }
-}
-
-
-gint
-e_day_view_get_time_string_width (EDayView *day_view)
-{
- gint time_width;
-
- time_width = day_view->digit_width * 4 + day_view->colon_width;
-
- if (!e_calendar_view_get_use_24_hour_format (E_CALENDAR_VIEW (day_view)))
- time_width += MAX (day_view->am_string_width,
- day_view->pm_string_width);
-
- return time_width;
-}
-
-/* Queues a layout, unless one is already queued. */
-static void
-e_day_view_queue_layout (EDayView *day_view)
-{
- if (day_view->layout_timeout_id == 0) {
- day_view->layout_timeout_id = g_timeout_add (E_DAY_VIEW_LAYOUT_TIMEOUT, e_day_view_layout_timeout_cb, day_view);
- }
-}
-
-
-/* Removes any queued layout. */
-static void
-e_day_view_cancel_layout (EDayView *day_view)
-{
- if (day_view->layout_timeout_id != 0) {
- gtk_timeout_remove (day_view->layout_timeout_id);
- day_view->layout_timeout_id = 0;
- }
-}
-
-
-static gboolean
-e_day_view_layout_timeout_cb (gpointer data)
-{
- EDayView *day_view = E_DAY_VIEW (data);
-
- gtk_widget_queue_draw (day_view->top_canvas);
- gtk_widget_queue_draw (day_view->main_canvas);
- e_day_view_check_layout (day_view);
-
- day_view->layout_timeout_id = 0;
- return FALSE;
-}
-
-
-/* Returns the number of selected events (0 or 1 at present). */
-gint
-e_day_view_get_num_events_selected (EDayView *day_view)
-{
- g_return_val_if_fail (E_IS_DAY_VIEW (day_view), 0);
-
- return (day_view->editing_event_day != -1) ? 1 : 0;
-}
-
-
diff --git a/calendar/gui/e-day-view.h b/calendar/gui/e-day-view.h
deleted file mode 100644
index 652efc7399..0000000000
--- a/calendar/gui/e-day-view.h
+++ /dev/null
@@ -1,586 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Author :
- * Damon Chaplin <damon@ximian.com>
- *
- * Copyright 1999, Ximian, Inc.
- * Copyright 1999, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-#ifndef _E_DAY_VIEW_H_
-#define _E_DAY_VIEW_H_
-
-#include <time.h>
-#include <gtk/gtktable.h>
-#include <gtk/gtktooltips.h>
-#include <libgnomecanvas/gnome-canvas.h>
-#include <gal/widgets/e-popup-menu.h>
-
-#include "e-cal-view.h"
-#include "gnome-cal.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-/*
- * EDayView - displays the Day & Work-Week views of the calendar.
- */
-
-/* The maximum number of days shown. We use the week view for anything more
- than about 9 days. */
-#define E_DAY_VIEW_MAX_DAYS 10
-
-/* This is used as a special code to signify a long event instead of the day
- of a normal event. */
-#define E_DAY_VIEW_LONG_EVENT E_DAY_VIEW_MAX_DAYS
-
-/* The maximum number of columns of appointments within a day. */
-#define E_DAY_VIEW_MAX_COLUMNS 6
-
-/* The width of the gap between appointments. This should be at least
- E_DAY_VIEW_BAR_WIDTH, since in the top canvas we use this space to draw
- the triangle to represent continuing events. */
-#define E_DAY_VIEW_GAP_WIDTH 7
-
-/* The width of the bars down the left of each column and appointment.
- This includes the borders on each side of it. */
-#define E_DAY_VIEW_BAR_WIDTH 7
-
-/* The height of the horizontal bar above & beneath the selected event.
- This includes the borders on the top and bottom. */
-#define E_DAY_VIEW_BAR_HEIGHT 6
-
-/* The size of the reminder & recurrence icons, and padding around them. */
-#define E_DAY_VIEW_ICON_WIDTH 16
-#define E_DAY_VIEW_ICON_HEIGHT 16
-#define E_DAY_VIEW_ICON_X_PAD 1
-#define E_DAY_VIEW_ICON_Y_PAD 1
-
-/* The space between the icons and the long event text. */
-#define E_DAY_VIEW_LONG_EVENT_ICON_R_PAD 1
-
-/* The size of the border around the event. */
-#define E_DAY_VIEW_EVENT_BORDER_WIDTH 1
-#define E_DAY_VIEW_EVENT_BORDER_HEIGHT 1
-
-/* The padding on each side of the event text. */
-#define E_DAY_VIEW_EVENT_X_PAD 2
-#define E_DAY_VIEW_EVENT_Y_PAD 1
-
-/* The padding on each side of the event text for events in the top canvas. */
-#define E_DAY_VIEW_LONG_EVENT_X_PAD 2
-#define E_DAY_VIEW_LONG_EVENT_Y_PAD 2
-
-/* The size of the border around the long events in the top canvas. */
-#define E_DAY_VIEW_LONG_EVENT_BORDER_WIDTH 1
-#define E_DAY_VIEW_LONG_EVENT_BORDER_HEIGHT 1
-
-/* The space between the time and the icon/text in the top canvas. */
-#define E_DAY_VIEW_LONG_EVENT_TIME_X_PAD 2
-
-/* The gap between rows in the top canvas. */
-#define E_DAY_VIEW_TOP_CANVAS_Y_GAP 2
-
-
-/* These are used to get/set the working days in the week. The bit-flags are
- combined together. The bits must be from 0 (Sun) to 6 (Sat) to match the
- day values used by localtime etc. */
-typedef enum
-{
- E_DAY_VIEW_SUNDAY = 1 << 0,
- E_DAY_VIEW_MONDAY = 1 << 1,
- E_DAY_VIEW_TUESDAY = 1 << 2,
- E_DAY_VIEW_WEDNESDAY = 1 << 3,
- E_DAY_VIEW_THURSDAY = 1 << 4,
- E_DAY_VIEW_FRIDAY = 1 << 5,
- E_DAY_VIEW_SATURDAY = 1 << 6
-} EDayViewDays;
-
-
-/* These are used to specify the type of an appointment. They match those
- used in EMeetingTimeSelector. */
-typedef enum
-{
- E_DAY_VIEW_BUSY_TENTATIVE = 0,
- E_DAY_VIEW_BUSY_OUT_OF_OFFICE = 1,
- E_DAY_VIEW_BUSY_BUSY = 2,
-
- E_DAY_VIEW_BUSY_LAST = 3
-} EDayViewBusyType;
-
-/* This is used to specify the format used when displaying the dates.
- The full format is like 'Thursday 12 September'. The abbreviated format is
- like 'Thu 12 Sep'. The no weekday format is like '12 Sep'. The short format
- is like '12'. The actual format used is determined in
- e_day_view_recalc_cell_sizes(), once we know the font being used. */
-typedef enum
-{
- E_DAY_VIEW_DATE_FULL,
- E_DAY_VIEW_DATE_ABBREVIATED,
- E_DAY_VIEW_DATE_NO_WEEKDAY,
- E_DAY_VIEW_DATE_SHORT
-} EDayViewDateFormat;
-
-/* These index our colors array. */
-typedef enum
-{
- E_DAY_VIEW_COLOR_BG_WORKING,
- E_DAY_VIEW_COLOR_BG_NOT_WORKING,
- E_DAY_VIEW_COLOR_BG_SELECTED,
- E_DAY_VIEW_COLOR_BG_SELECTED_UNFOCUSSED,
- E_DAY_VIEW_COLOR_BG_GRID,
-
- E_DAY_VIEW_COLOR_BG_TOP_CANVAS,
- E_DAY_VIEW_COLOR_BG_TOP_CANVAS_SELECTED,
- E_DAY_VIEW_COLOR_BG_TOP_CANVAS_GRID,
-
- E_DAY_VIEW_COLOR_EVENT_VBAR,
- E_DAY_VIEW_COLOR_EVENT_BACKGROUND,
- E_DAY_VIEW_COLOR_EVENT_BORDER,
-
- E_DAY_VIEW_COLOR_LONG_EVENT_BACKGROUND,
- E_DAY_VIEW_COLOR_LONG_EVENT_BORDER,
-
- E_DAY_VIEW_COLOR_LAST
-} EDayViewColors;
-
-/* These specify which part of the selection we are dragging, if any. */
-typedef enum
-{
- E_DAY_VIEW_DRAG_START,
- E_DAY_VIEW_DRAG_END
-} EDayViewDragPosition;
-
-typedef struct _EDayViewEvent EDayViewEvent;
-struct _EDayViewEvent {
- E_CALENDAR_VIEW_EVENT_FIELDS
-
- /* For events in the main canvas, this contains the start column.
- For long events in the top canvas, this is its row. */
- guint8 start_row_or_col;
-
- /* For events in the main canvas, this is the number of columns that
- it covers. For long events this is set to 1 if the event is shown.
- For both types of events this is set to 0 if the event is not shown,
- i.e. it couldn't fit into the display. Currently long events are
- always shown as we just increase the height of the top canvas. */
- guint8 num_columns;
-};
-
-
-#define E_DAY_VIEW(obj) GTK_CHECK_CAST (obj, e_day_view_get_type (), EDayView)
-#define E_DAY_VIEW_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, e_day_view_get_type (), EDayViewClass)
-#define E_IS_DAY_VIEW(obj) GTK_CHECK_TYPE (obj, e_day_view_get_type ())
-
-
-typedef struct _EDayView EDayView;
-typedef struct _EDayViewClass EDayViewClass;
-
-struct _EDayView
-{
- ECalendarView cal_view;
-
- /* The top canvas where the dates and long appointments are shown. */
- GtkWidget *top_canvas;
- GnomeCanvasItem *top_canvas_item;
-
- /* The main canvas where the rest of the appointments are shown. */
- GtkWidget *main_canvas;
- GnomeCanvasItem *main_canvas_item;
-
- /* The canvas displaying the times of the day. */
- GtkWidget *time_canvas;
- GnomeCanvasItem *time_canvas_item;
-
- GtkWidget *vscrollbar;
-
- /* S-expression for query and the query object */
- ECalView *query;
-
- /* The start and end of the days shown. */
- time_t lower;
- time_t upper;
-
- /* Whether we are showing the work-week view. */
- gboolean work_week_view;
-
- /* The number of days we are showing. Usually 1 or 5, but can be up
- to E_DAY_VIEW_MAX_DAYS, e.g. when the user selects a range of
- days in the date navigator. */
- gint days_shown;
-
- /* The start of each day & an extra element to hold the last time. */
- time_t day_starts[E_DAY_VIEW_MAX_DAYS + 1];
-
- /* An array of EDayViewEvent elements for the top view and each day. */
- GArray *long_events;
- GArray *events[E_DAY_VIEW_MAX_DAYS];
-
- /* These are set to FALSE whenever an event in the corresponding array
- is changed. Any function that needs the events sorted calls
- e_day_view_ensure_events_sorted(). */
- gboolean long_events_sorted;
- gboolean events_sorted[E_DAY_VIEW_MAX_DAYS];
-
- /* This is TRUE if we need to relayout the events before drawing. */
- gboolean long_events_need_layout;
- gboolean need_layout[E_DAY_VIEW_MAX_DAYS];
-
- /* This is TRUE if we need to reshape the canvas items, but a full
- layout is not necessary. */
- gboolean long_events_need_reshape;
- gboolean need_reshape[E_DAY_VIEW_MAX_DAYS];
-
- /* The ID of the timeout function for doing a new layout. */
- gint layout_timeout_id;
-
- /* The number of minutes per row. 5, 10, 15, 30 or 60. */
- gint mins_per_row;
-
- /* The number of rows needed, depending on the times shown and the
- minutes per row. */
- gint rows;
-
- /* The height of each row. */
- gint row_height;
-
- /* The number of rows in the top display. */
- gint rows_in_top_display;
-
- /* The height of each row in the top canvas. */
- gint top_row_height;
-
- /* The first and last times shown in the display. The last time isn't
- included in the range. Default is 0:00-24:00 */
- gint first_hour_shown;
- gint first_minute_shown;
- gint last_hour_shown;
- gint last_minute_shown;
-
- /* Bitwise combination of working days. Defaults to Mon-Fri. */
- EDayViewDays working_days;
-
- /* The start and end of the work day, rounded to the nearest row. */
- gint work_day_start_hour;
- gint work_day_start_minute;
- gint work_day_end_hour;
- gint work_day_end_minute;
-
- /* Whether we use show event end times in the main canvas. */
- gboolean show_event_end_times;
-
- /* The first day of the week, 0 (Monday) to 6 (Sunday). */
- gint week_start_day;
-
- /* This is set to TRUE when the widget is created, so it scrolls to
- the start of the working day when first shown. */
- gboolean scroll_to_work_day;
-
- /* This is the width & offset of each of the day columns in the
- display. */
- gint day_widths[E_DAY_VIEW_MAX_DAYS];
- gint day_offsets[E_DAY_VIEW_MAX_DAYS + 1];
-
- /* An array holding the number of columns in each row, in each day.
- Note that there are a maximum of 12 * 24 rows (when a row is 5 mins)
- but we don't always have that many rows. */
- guint8 cols_per_row[E_DAY_VIEW_MAX_DAYS][12 * 24];
-
- /* Sizes of the various time strings. */
- gint small_hour_widths[24];
- gint max_small_hour_width;
- gint max_minute_width;
- gint colon_width;
- gint digit_width; /* Size of '0' character. */
-
- /* This specifies how we are displaying the dates at the top. */
- EDayViewDateFormat date_format;
-
- /* These are the longest month & weekday names in the current font.
- Months are 0 to 11. Weekdays are 0 (Sun) to 6 (Sat). */
- gint longest_month_name;
- gint longest_abbreviated_month_name;
- gint longest_weekday_name;
- gint longest_abbreviated_weekday_name;
-
- /* The large font used to display the hours. I don't think we need a
- fontset since we only display numbers. */
- PangoFontDescription *large_font_desc;
-
- /* The GC used for painting in different colors. */
- GdkGC *main_gc;
-
- /* The icons. */
- GdkPixmap *reminder_icon;
- GdkBitmap *reminder_mask;
- GdkPixmap *recurrence_icon;
- GdkBitmap *recurrence_mask;
- GdkPixmap *timezone_icon;
- GdkBitmap *timezone_mask;
- GdkPixmap *meeting_icon;
- GdkBitmap *meeting_mask;
-
- /* Colors for drawing. */
- GdkColor colors[E_DAY_VIEW_COLOR_LAST];
-
- /* The normal & resizing cursors. */
- GdkCursor *normal_cursor;
- GdkCursor *move_cursor;
- GdkCursor *resize_width_cursor;
- GdkCursor *resize_height_cursor;
-
- /* This remembers the last cursor set on the window. */
- GdkCursor *last_cursor_set_in_top_canvas;
- GdkCursor *last_cursor_set_in_main_canvas;
-
- /*
- * Editing, Selection & Dragging data
- */
-
- /* The horizontal bars to resize events in the main canvas. */
- GnomeCanvasItem *main_canvas_top_resize_bar_item;
- GnomeCanvasItem *main_canvas_bottom_resize_bar_item;
-
- /* The event currently being edited. The day is -1 if no event is
- being edited, or E_DAY_VIEW_LONG_EVENT if a long event is edited. */
- gint editing_event_day;
- gint editing_event_num;
-
- /* This is a GnomeCanvasRect which is placed around an item while it
- is being resized, so we can raise it above all other EText items. */
- GnomeCanvasItem *resize_long_event_rect_item;
- GnomeCanvasItem *resize_rect_item;
- GnomeCanvasItem *resize_bar_item;
-
- /* The event for which a popup menu is being displayed, as above. */
- gint popup_event_day;
- gint popup_event_num;
-
- /* The currently selected region. If selection_start_day is -1 there is
- no current selection. If start_row or end_row is -1 then the
- selection is in the top canvas. */
- gint selection_start_day;
- gint selection_end_day;
- gint selection_start_row;
- gint selection_end_row;
-
- /* This is TRUE if the selection is currently being dragged using the
- mouse. */
- gboolean selection_is_being_dragged;
-
- /* This specifies which end of the selection is being dragged. */
- EDayViewDragPosition selection_drag_pos;
-
- /* This is TRUE if the selection is in the top canvas only (i.e. if the
- last motion event was in the top canvas). */
- gboolean selection_in_top_canvas;
-
- /* The last mouse position, relative to the main canvas window.
- Used when auto-scrolling to update the selection. */
- gint last_mouse_x;
- gint last_mouse_y;
-
- /* Auto-scroll info for when selecting an area or dragging an item. */
- gint auto_scroll_timeout_id;
- gint auto_scroll_delay;
- gboolean auto_scroll_up;
-
- /* These are used for the resize bars. */
- gint resize_bars_event_day;
- gint resize_bars_event_num;
-
- /* These are used when resizing events. */
- gint resize_event_day;
- gint resize_event_num;
- ECalendarViewPosition resize_drag_pos;
- gint resize_start_row;
- gint resize_end_row;
-
- /* This is the event the mouse button was pressed on. If the button
- is released we start editing it, but if the mouse is dragged we set
- this to -1. */
- gint pressed_event_day;
- gint pressed_event_num;
-
- /* These are used when dragging events. If drag_event_day is not -1 we
- know that we are dragging one of the EDayView events around. */
- gint drag_event_day;
- gint drag_event_num;
-
- /* The last mouse position when dragging, in the entire canvas. */
- gint drag_event_x;
- gint drag_event_y;
-
- /* The offset of the mouse from the top of the event, in rows.
- In the top canvas this is the offset from the left, in days. */
- gint drag_event_offset;
-
- /* The last day & row dragged to, so we know when we need to update
- the dragged event's position. */
- gint drag_last_day;
- gint drag_last_row;
-
- /* This is a GnomeCanvasRect which is placed around an item while it
- is being resized, so we can raise it above all other EText items. */
- GnomeCanvasItem *drag_long_event_rect_item;
- GnomeCanvasItem *drag_long_event_item;
- GnomeCanvasItem *drag_rect_item;
- GnomeCanvasItem *drag_bar_item;
- GnomeCanvasItem *drag_item;
-
- /* "am" and "pm" in the current locale, and their widths. */
- gchar *am_string;
- gchar *pm_string;
- gint am_string_width;
- gint pm_string_width;
-};
-
-struct _EDayViewClass
-{
- ECalendarViewClass parent_class;
-};
-
-
-GtkType e_day_view_get_type (void);
-GtkWidget* e_day_view_new (void);
-
-void e_day_view_set_query (EDayView *day_view,
- const char *sexp);
-
-/* Whether we are displaying a work-week, in which case the display always
- starts on the first day of the working week. */
-gboolean e_day_view_get_work_week_view (EDayView *day_view);
-void e_day_view_set_work_week_view (EDayView *day_view,
- gboolean work_week_view);
-
-/* The number of days shown in the EDayView, from 1 to 7. This is normally
- either 1 or 5 (for the Work-Week view). */
-gint e_day_view_get_days_shown (EDayView *day_view);
-void e_day_view_set_days_shown (EDayView *day_view,
- gint days_shown);
-
-/* This specifies how many minutes are represented by one row in the display.
- It can be 60, 30, 15, 10 or 5. The default is 30. */
-gint e_day_view_get_mins_per_row (EDayView *day_view);
-void e_day_view_set_mins_per_row (EDayView *day_view,
- gint mins_per_row);
-
-/* This specifies the working days in the week. The value is a bitwise
- combination of day flags. Defaults to Mon-Fri. */
-EDayViewDays e_day_view_get_working_days (EDayView *day_view);
-void e_day_view_set_working_days (EDayView *day_view,
- EDayViewDays days);
-
-/* The start and end time of the working day. This only affects the background
- colors. */
-void e_day_view_get_working_day (EDayView *day_view,
- gint *start_hour,
- gint *start_minute,
- gint *end_hour,
- gint *end_minute);
-void e_day_view_set_working_day (EDayView *day_view,
- gint start_hour,
- gint start_minute,
- gint end_hour,
- gint end_minute);
-
-/* Whether we display event end times in the main canvas. */
-gboolean e_day_view_get_show_event_end_times (EDayView *day_view);
-void e_day_view_set_show_event_end_times (EDayView *day_view,
- gboolean show);
-
-/* The first day of the week, 0 (Monday) to 6 (Sunday). */
-gint e_day_view_get_week_start_day (EDayView *day_view);
-void e_day_view_set_week_start_day (EDayView *day_view,
- gint week_start_day);
-
-void e_day_view_delete_occurrence (EDayView *day_view);
-
-/* Returns the number of selected events (0 or 1 at present). */
-gint e_day_view_get_num_events_selected (EDayView *day_view);
-
-/*
- * Internal functions called by the associated canvas items.
- */
-void e_day_view_check_layout (EDayView *day_view);
-gint e_day_view_convert_time_to_row (EDayView *day_view,
- gint hour,
- gint minute);
-gint e_day_view_convert_time_to_position (EDayView *day_view,
- gint hour,
- gint minute);
-gboolean e_day_view_get_event_rows (EDayView *day_view,
- gint day,
- gint event_num,
- gint *start_row_out,
- gint *end_row_out);
-gboolean e_day_view_get_event_position (EDayView *day_view,
- gint day,
- gint event_num,
- gint *item_x,
- gint *item_y,
- gint *item_w,
- gint *item_h);
-gboolean e_day_view_get_long_event_position (EDayView *day_view,
- gint event_num,
- gint *start_day,
- gint *end_day,
- gint *item_x,
- gint *item_y,
- gint *item_w,
- gint *item_h);
-
-void e_day_view_start_selection (EDayView *day_view,
- gint day,
- gint row);
-void e_day_view_update_selection (EDayView *day_view,
- gint day,
- gint row);
-void e_day_view_finish_selection (EDayView *day_view);
-
-void e_day_view_check_auto_scroll (EDayView *day_view,
- gint event_x,
- gint event_y);
-void e_day_view_stop_auto_scroll (EDayView *day_view);
-
-void e_day_view_convert_time_to_display (EDayView *day_view,
- gint hour,
- gint *display_hour,
- gchar **suffix,
- gint *suffix_width);
-gint e_day_view_get_time_string_width (EDayView *day_view);
-
-
-gint e_day_view_event_sort_func (const void *arg1,
- const void *arg2);
-
-gboolean e_day_view_find_event_from_item (EDayView *day_view,
- GnomeCanvasItem *item,
- gint *day_return,
- gint *event_num_return);
-void e_day_view_update_calendar_selection_time (EDayView *day_view);
-void e_day_view_ensure_rows_visible (EDayView *day_view,
- gint start_row,
- gint end_row);
-
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _E_DAY_VIEW_H_ */
diff --git a/calendar/gui/e-itip-control.c b/calendar/gui/e-itip-control.c
deleted file mode 100644
index 44f0a97c2c..0000000000
--- a/calendar/gui/e-itip-control.c
+++ /dev/null
@@ -1,2373 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* e-itip-control.c
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: JP Rosevear
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <glib.h>
-#include <gtk/gtkmisc.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnome/gnome-util.h>
-#include <libgnomeui/gnome-stock-icons.h>
-#include <libgnomeui/gnome-uidefs.h>
-#include <libgnomeui/gnome-dialog.h>
-#include <libgnomeui/gnome-dialog-util.h>
-#include <bonobo/bonobo-object.h>
-#include <bonobo/bonobo-exception.h>
-#include <gtkhtml/gtkhtml.h>
-#include <gtkhtml/gtkhtml-stream.h>
-#include <libical/ical.h>
-#include <libecal/e-cal-component.h>
-#include <libecal/e-cal-time-util.h>
-#include <libecal/e-cal.h>
-#include <e-util/e-time-utils.h>
-#include <e-util/e-dialog-widgets.h>
-#include <camel/camel-mime-filter-tohtml.h>
-#include "dialogs/delete-error.h"
-#include "calendar-config.h"
-#include "itip-utils.h"
-#include "e-itip-control.h"
-
-struct _EItipControlPrivate {
- GtkWidget *html;
-
- GPtrArray *event_clients;
- ECal *event_client;
- GPtrArray *task_clients;
- ECal *task_client;
-
- char *vcalendar;
- ECalComponent *comp;
- icalcomponent *main_comp;
- icalcomponent *ical_comp;
- icalcomponent *top_level;
- icalcompiter iter;
- icalproperty_method method;
-
- int current;
- int total;
-
- gchar *calendar_uri;
-
- EAccountList *accounts;
-
- gchar *from_address;
- gchar *delegator_address;
- gchar *delegator_name;
- gchar *my_address;
- gint view_only;
-
- gboolean destroyed;
-};
-
-/* HTML Strings */
-#define HTML_BODY_START "<body bgcolor=\"#ffffff\" text=\"#000000\" link=\"#336699\">"
-#define HTML_SEP "<hr color=#336699 align=\"left\" width=450>"
-#define HTML_BODY_END "</body>"
-#define HTML_FOOTER "</html>"
-
-/* We intentionally use "calendar" instead of "calendar / *" here. We
- * don't want public calendars.
- */
-static const char *calendar_types[] = { "calendar", NULL };
-static const char *tasks_types[] = { "tasks", NULL };
-
-static void class_init (EItipControlClass *klass);
-static void init (EItipControl *itip);
-static void destroy (GtkObject *obj);
-static void finalize (GObject *obj);
-
-static void url_requested_cb (GtkHTML *html, const gchar *url, GtkHTMLStream *handle, gpointer data);
-static gboolean object_requested_cb (GtkHTML *html, GtkHTMLEmbedded *eb, gpointer data);
-static void ok_clicked_cb (GtkHTML *html, const gchar *method, const gchar *url, const gchar *encoding, gpointer data);
-
-static GtkVBoxClass *parent_class = NULL;
-
-E_MAKE_TYPE (e_itip_control, "EItipControl", EItipControl, class_init, init,
- GTK_TYPE_VBOX);
-
-static void
-class_init (EItipControlClass *klass)
-{
- GObjectClass *object_class;
- GtkObjectClass *gtkobject_class;
-
- object_class = G_OBJECT_CLASS (klass);
- gtkobject_class = GTK_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_peek_parent (klass);
-
- gtkobject_class->destroy = destroy;
-
- object_class->finalize = finalize;
-}
-
-static ECal *
-start_calendar_server (EItipControl *itip, char *uri)
-{
- ECal *client;
- GError *error = NULL;
-
- client = e_cal_new_from_uri (uri, CALOBJ_TYPE_EVENT);
-
- if (!e_cal_open (client, TRUE, &error)) {
- g_warning (_("start_calendar_server(): %s"), error->message);
- g_error_free (error);
- g_object_unref (client);
- return NULL;
- }
-
- return client;
-}
-
-static gboolean
-start_default_server (EItipControl *itip, ECal *client, gboolean tasks)
-{
-#if 0
- if (tasks)
- return e_cal_open_default_tasks (client, FALSE);
- else
- return e_cal_open_default_calendar (client, FALSE);
-#endif
- return FALSE;
-}
-
-#if 0 /* EPFIXME, rewrite this */
-static GPtrArray *
-get_servers (EItipControl *itip, EvolutionShellClient *shell_client, const char *possible_types[], gboolean tasks)
-{
- GNOME_Evolution_StorageRegistry registry;
- GNOME_Evolution_StorageRegistry_StorageList *storage_list;
- GPtrArray *servers;
- int i, j, k;
- CORBA_Environment ev;
-
- servers = g_ptr_array_new ();
-
- g_object_ref (shell_client);
- registry = evolution_shell_client_get_storage_registry_interface (shell_client);
-
- CORBA_exception_init (&ev);
- storage_list = GNOME_Evolution_StorageRegistry_getStorageList (registry, &ev);
- if (BONOBO_EX (&ev)) {
- CORBA_exception_free (&ev);
- return servers;
- }
-
- for (i = 0; i < storage_list->_length; i++) {
- GNOME_Evolution_Storage storage;
- GNOME_Evolution_FolderList *folder_list;
-
- CORBA_exception_init (&ev);
-
- storage = storage_list->_buffer[i];
- folder_list = GNOME_Evolution_Storage__get_folderList (storage, &ev);
- if (BONOBO_EX (&ev)) {
- CORBA_exception_free (&ev);
- continue;
- }
-
- CORBA_exception_free (&ev);
-
- for (j = 0; j < folder_list->_length; j++) {
- GNOME_Evolution_Folder folder;
-
- folder = folder_list->_buffer[j];
- for (k = 0; possible_types[k] != NULL; k++) {
- ECal *client;
- char *uri;
-
- if (itip->priv->destroyed)
- continue;
-
- if (strcmp (possible_types[k], folder.type))
- continue;
-
- uri = e_cal_util_expand_uri (folder.physicalUri, tasks);
- client = start_calendar_server (itip, uri);
- if (client != NULL)
- g_ptr_array_add (servers, client);
- g_free (uri);
-
- break;
- }
- }
-
- CORBA_free (folder_list);
- }
-
- g_object_unref (shell_client);
-
- return servers;
-}
-#endif
-
-static ECal *
-find_server (GPtrArray *servers, ECalComponent *comp)
-{
- const char *uid;
- int i;
-
- e_cal_component_get_uid (comp, &uid);
- for (i = 0; i < servers->len; i++) {
- ECal *client;
- icalcomponent *icalcomp;
-
- client = g_ptr_array_index (servers, i);
- if (e_cal_get_object (client, uid, NULL, &icalcomp, NULL)) {
- icalcomponent_free (icalcomp);
- g_object_ref (client);
-
- return client;
- }
- }
-
- return NULL;
-}
-
-static void
-html_destroyed (gpointer data)
-{
- EItipControl *itip = data;
- EItipControlPrivate *priv;
-
- priv = itip->priv;
-
- priv->html = NULL;
-}
-
-static void
-init (EItipControl *itip)
-{
- EItipControlPrivate *priv;
- GtkWidget *scrolled_window;
-
- priv = g_new0 (EItipControlPrivate, 1);
-
- itip->priv = priv;
-
- /* Addresses */
- priv->accounts = itip_addresses_get ();
-
- /* Initialize the cal clients */
- priv->event_clients = NULL;
- priv->event_client = NULL;
- priv->task_clients = NULL;
- priv->task_client = NULL;
-
- /* Other fields to init */
- priv->calendar_uri = NULL;
- priv->from_address = NULL;
- priv->delegator_address = NULL;
- priv->delegator_name = NULL;
- priv->my_address = NULL;
- priv->view_only = 0;
-
- /* Html Widget */
- priv->html = gtk_html_new ();
- gtk_html_set_default_content_type (GTK_HTML (priv->html),
- "text/html; charset=utf-8");
- gtk_html_load_from_string (GTK_HTML (priv->html), " ", 1);
- gtk_widget_show (priv->html);
-
- scrolled_window = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
- GTK_POLICY_AUTOMATIC,
- GTK_POLICY_AUTOMATIC);
- gtk_widget_show (scrolled_window);
-
- gtk_container_add (GTK_CONTAINER (scrolled_window), priv->html);
- gtk_object_weakref (GTK_OBJECT (priv->html), html_destroyed, itip);
- gtk_widget_set_usize (scrolled_window, 600, 400);
- gtk_box_pack_start (GTK_BOX (itip), scrolled_window, FALSE, FALSE, 6);
-
- g_signal_connect (priv->html, "url_requested", G_CALLBACK (url_requested_cb), itip);
- g_signal_connect (priv->html, "object_requested", G_CALLBACK (object_requested_cb), itip);
- g_signal_connect (priv->html, "submit", G_CALLBACK (ok_clicked_cb), itip);
-
- priv->destroyed = FALSE;
-}
-
-static void
-clean_up (EItipControl *itip)
-{
- EItipControlPrivate *priv;
-
- priv = itip->priv;
- if (!priv)
- return;
-
- g_free (priv->vcalendar);
- priv->vcalendar = NULL;
-
- if (priv->comp) {
- g_object_unref (priv->comp);
- priv->comp = NULL;
- }
-
- if (priv->top_level) {
- icalcomponent_free (priv->top_level);
- priv->top_level = NULL;
- }
-
- if (priv->main_comp) {
- icalcomponent_free (priv->main_comp);
- priv->main_comp = NULL;
- }
- priv->ical_comp = NULL;
-
- priv->current = 0;
- priv->total = 0;
-
- g_free (priv->calendar_uri);
- priv->calendar_uri = NULL;
-
- g_free (priv->from_address);
- priv->from_address = NULL;
- g_free (priv->delegator_address);
- priv->delegator_address = NULL;
- g_free (priv->delegator_name);
- priv->delegator_name = NULL;
- g_free (priv->my_address);
- priv->my_address = NULL;
-}
-
-static void
-destroy (GtkObject *obj)
-{
- EItipControl *itip = E_ITIP_CONTROL (obj);
- EItipControlPrivate *priv;
-
- priv = itip->priv;
-
- priv->destroyed = TRUE;
-
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (obj);
-}
-
-static void
-finalize (GObject *obj)
-{
- EItipControl *itip = E_ITIP_CONTROL (obj);
- EItipControlPrivate *priv;
- int i;
-
- priv = itip->priv;
-
- clean_up (itip);
-
- if (priv->html)
- gtk_object_weakunref (GTK_OBJECT (priv->html), html_destroyed, itip);
-
- priv->accounts = NULL;
-
- if (priv->event_clients) {
- for (i = 0; i < priv->event_clients->len; i++)
- g_object_unref (g_ptr_array_index (priv->event_clients, i));
- g_ptr_array_free (priv->event_clients, TRUE);
- priv->event_client = NULL;
- priv->event_clients = NULL;
- }
-
- if (priv->task_clients) {
- for (i = 0; i < priv->task_clients->len; i++)
- g_object_unref (g_ptr_array_index (priv->task_clients, i));
- g_ptr_array_free (priv->task_clients, TRUE);
- priv->task_client = NULL;
- priv->task_clients = NULL;
- }
-
- g_free (priv);
- itip->priv = NULL;
-
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (obj);
-}
-
-GtkWidget *
-e_itip_control_new (void)
-{
- return g_object_new (E_TYPE_ITIP_CONTROL, NULL);
-}
-
-static void
-find_my_address (EItipControl *itip, icalcomponent *ical_comp)
-{
- EItipControlPrivate *priv;
- icalproperty *prop;
- char *my_alt_address = NULL;
-
- priv = itip->priv;
-
- /* If the mailer told us the address to use, use that */
- if (priv->delegator_address != NULL) {
- priv->my_address = g_strdup (itip_strip_mailto (priv->delegator_address));
- priv->my_address = g_strstrip (priv->my_address);
- return;
- }
-
- for (prop = icalcomponent_get_first_property (ical_comp, ICAL_ATTENDEE_PROPERTY);
- prop != NULL;
- prop = icalcomponent_get_next_property (ical_comp, ICAL_ATTENDEE_PROPERTY))
- {
- icalvalue *value;
- icalparameter *param;
- const char *attendee, *name;
- char *attendee_clean, *name_clean;
- EIterator *it;
-
- value = icalproperty_get_value (prop);
- if (value != NULL) {
- attendee = icalvalue_get_string (value);
- attendee_clean = g_strdup (itip_strip_mailto (attendee));
- attendee_clean = g_strstrip (attendee_clean);
- } else {
- attendee = NULL;
- attendee_clean = NULL;
- }
-
- param = icalproperty_get_first_parameter (prop, ICAL_CN_PARAMETER);
- if (param != NULL) {
- name = icalparameter_get_cn (param);
- name_clean = g_strdup (name);
- name_clean = g_strstrip (name_clean);
- } else {
- name = NULL;
- name_clean = NULL;
- }
-
- it = e_list_get_iterator((EList *)priv->accounts);
- while (e_iterator_is_valid(it)) {
- const EAccount *account = e_iterator_get(it);
-
- /* Check for a matching address */
- if (attendee_clean != NULL
- && !g_ascii_strcasecmp (account->id->address, attendee_clean)) {
- priv->my_address = g_strdup (account->id->address);
- g_free (attendee_clean);
- g_free (name_clean);
- g_free (my_alt_address);
- g_object_unref(it);
- return;
- }
-
- /* Check for a matching cname to fall back on */
- if (name_clean != NULL
- && !g_ascii_strcasecmp (account->id->name, name_clean))
- my_alt_address = g_strdup (attendee_clean);
-
- e_iterator_next(it);
- }
- g_free (attendee_clean);
- g_free (name_clean);
- g_object_unref(it);
- }
-
- priv->my_address = my_alt_address;
-}
-
-static icalproperty *
-find_attendee (icalcomponent *ical_comp, const char *address)
-{
- icalproperty *prop;
-
- if (address == NULL)
- return NULL;
-
- for (prop = icalcomponent_get_first_property (ical_comp, ICAL_ATTENDEE_PROPERTY);
- prop != NULL;
- prop = icalcomponent_get_next_property (ical_comp, ICAL_ATTENDEE_PROPERTY)) {
- icalvalue *value;
- const char *attendee;
- char *text;
-
- value = icalproperty_get_value (prop);
- if (!value)
- continue;
-
- attendee = icalvalue_get_string (value);
-
- text = g_strdup (itip_strip_mailto (attendee));
- text = g_strstrip (text);
- if (!g_strcasecmp (address, text)) {
- g_free (text);
- break;
- }
- g_free (text);
- }
-
- return prop;
-}
-
-static void
-write_label_piece (EItipControl *itip, ECalComponentDateTime *dt,
- char *buffer, int size,
- const char *stext, const char *etext,
- gboolean just_date)
-{
- EItipControlPrivate *priv;
- struct tm tmp_tm;
- char time_buf[64];
- icaltimezone *zone = NULL;
- char *display_name;
-
- priv = itip->priv;
-
- /* UTC times get converted to the current timezone. This is done for
- the COMPLETED property, which is always in UTC, and also because
- Outlook sends simple events as UTC times. */
- if (dt->value->is_utc) {
- char *location = calendar_config_get_timezone ();
- zone = icaltimezone_get_builtin_timezone (location);
- icaltimezone_convert_time (dt->value, icaltimezone_get_utc_timezone (), zone);
- }
-
- tmp_tm = icaltimetype_to_tm (dt->value);
- if (just_date)
- tmp_tm.tm_hour = tmp_tm.tm_min = tmp_tm.tm_sec = 0;
-
- if (stext != NULL)
- strcat (buffer, stext);
-
- e_time_format_date_and_time (&tmp_tm,
- calendar_config_get_24_hour_format (),
- FALSE, FALSE,
- time_buf, sizeof (time_buf));
- strcat (buffer, time_buf);
-
- if (!dt->value->is_utc && dt->tzid) {
- zone = icalcomponent_get_timezone (priv->top_level, dt->tzid);
- }
-
- /* Output timezone after time, e.g. " America/New_York". */
- if (zone && !just_date) {
- /* Note that this returns UTF-8, since all iCalendar data is
- UTF-8. But it probably is not translated. */
- display_name = icaltimezone_get_display_name (zone);
- if (display_name && *display_name) {
- strcat (buffer, " <font size=-1>[");
-
- /* We check if it is one of our builtin timezone names,
- in which case we call gettext to translate it. */
- if (icaltimezone_get_builtin_timezone (display_name)) {
- strcat (buffer, _(display_name));
- } else {
- strcat (buffer, display_name);
- }
- strcat (buffer, "]</font>");
- }
- }
-
- if (etext != NULL)
- strcat (buffer, etext);
-}
-
-static const char *
-nth (int n)
-{
- if (n == -1)
- return "last";
- else if (n < 1 || n > 31)
- return "?";
- else
- return e_cal_recur_nth[n];
-}
-
-static const char *dayname[] = {
- N_("Sunday"),
- N_("Monday"),
- N_("Tuesday"),
- N_("Wednesday"),
- N_("Thursday"),
- N_("Friday"),
- N_("Saturday")
-};
-
-static inline char *
-get_dayname (struct icalrecurrencetype *r, int i)
-{
- enum icalrecurrencetype_weekday day;
-
- day = icalrecurrencetype_day_day_of_week (r->by_day[i]);
- g_return_val_if_fail (day > 0 && day < 8, "?");
-
- return _(dayname[day - 1]);
-}
-
-static void
-write_recurrence_piece (EItipControl *itip, ECalComponent *comp,
- char *buffer, int size)
-{
- GSList *rrules;
- struct icalrecurrencetype *r;
- int len, i;
-
- strcpy (buffer, "<b>Recurring:</b> ");
- len = strlen (buffer);
- buffer += len;
- size -= len;
-
- if (!e_cal_component_has_simple_recurrence (comp)) {
- strcpy (buffer, _("Yes. (Complex Recurrence)"));
- return;
- }
-
- e_cal_component_get_rrule_list (comp, &rrules);
- g_return_if_fail (rrules && !rrules->next);
-
- r = rrules->data;
-
- switch (r->freq) {
- case ICAL_DAILY_RECURRENCE:
- if (r->interval == 1)
- strcpy (buffer, _("Every day"));
- else
- sprintf (buffer, _("Every %d days"), r->interval);
- break;
-
- case ICAL_WEEKLY_RECURRENCE:
- if (r->by_day[0] == ICAL_RECURRENCE_ARRAY_MAX) {
- if (r->interval == 1)
- strcpy (buffer, _("Every week"));
- else
- sprintf (buffer, _("Every %d weeks"), r->interval);
- } else {
- if (r->interval == 1)
- strcpy (buffer, _("Every week on "));
- else
- sprintf (buffer, _("Every %d weeks on "), r->interval);
-
- for (i = 1; i < 8 && r->by_day[i] != ICAL_RECURRENCE_ARRAY_MAX; i++) {
- if (i > 1)
- strcat (buffer, ", ");
- strcat (buffer, get_dayname (r, i - 1));
- }
- if (i > 1)
- strcat (buffer, _(" and "));
- strcat (buffer, get_dayname (r, i - 1));
- }
- break;
-
- case ICAL_MONTHLY_RECURRENCE:
- if (r->by_month_day[0] != ICAL_RECURRENCE_ARRAY_MAX) {
- sprintf (buffer, _("The %s day of "),
- nth (r->by_month_day[0]));
- } else {
- int pos;
-
- /* Outlook 2000 uses BYDAY=TU;BYSETPOS=2, and will not
- accept BYDAY=2TU. So we now use the same as Outlook
- by default. */
-
- pos = icalrecurrencetype_day_position (r->by_day[0]);
- if (pos == 0)
- pos = r->by_set_pos[0];
-
- sprintf (buffer, _("The %s %s of "),
- nth (pos), get_dayname (r, 0));
- }
-
- if (r->interval == 1)
- strcat (buffer, _("every month"));
- else {
- len = strlen (buffer);
- buffer += len;
- size -= len;
- sprintf (buffer, _("every %d months"), r->interval);
- }
- break;
-
- case ICAL_YEARLY_RECURRENCE:
- if (r->interval == 1)
- strcpy (buffer, _("Every year"));
- else {
- sprintf (buffer, _("Every %d years"), r->interval);
- }
- break;
-
- default:
- g_assert_not_reached ();
- }
-
- len = strlen (buffer);
- buffer += len;
- size -= len;
- if (r->count) {
- sprintf (buffer, _(" a total of %d times"), r->count);
- } else if (!icaltime_is_null_time (r->until)) {
- ECalComponentDateTime dt;
-
- /* FIXME This should get the tzid id, not the whole zone */
- dt.value = &r->until;
- dt.tzid = r->until.zone;
-
- write_label_piece (itip, &dt, buffer, size,
- _(", ending on "), NULL, TRUE);
- }
-
- strcat (buffer, "<br>");
-}
-
-static void
-set_date_label (EItipControl *itip, GtkHTML *html, GtkHTMLStream *html_stream,
- ECalComponent *comp)
-{
- EItipControlPrivate *priv;
- ECalComponentDateTime datetime;
- static char buffer[1024];
- gboolean wrote = FALSE, task_completed = FALSE;
- ECalComponentVType type;
-
- priv = itip->priv;
-
- type = e_cal_component_get_vtype (comp);
-
- buffer[0] = '\0';
- e_cal_component_get_dtstart (comp, &datetime);
- if (datetime.value) {
- write_label_piece (itip, &datetime, buffer, 1024,
- _("<b>Starts:</b> "),
- "<br>", FALSE);
- gtk_html_write (html, html_stream, buffer, strlen(buffer));
- wrote = TRUE;
- }
- e_cal_component_free_datetime (&datetime);
-
- buffer[0] = '\0';
- e_cal_component_get_dtend (comp, &datetime);
- if (datetime.value){
- write_label_piece (itip, &datetime, buffer, 1024, _("<b>Ends:</b> "), "<br>", FALSE);
- gtk_html_write (html, html_stream, buffer, strlen (buffer));
- wrote = TRUE;
- }
- e_cal_component_free_datetime (&datetime);
-
- buffer[0] = '\0';
- if (e_cal_component_has_recurrences (comp)) {
- write_recurrence_piece (itip, comp, buffer, 1024);
- gtk_html_write (html, html_stream, buffer, strlen (buffer));
- wrote = TRUE;
- }
-
- buffer[0] = '\0';
- datetime.tzid = NULL;
- e_cal_component_get_completed (comp, &datetime.value);
- if (type == E_CAL_COMPONENT_TODO && datetime.value) {
- /* Pass TRUE as is_utc, so it gets converted to the current
- timezone. */
- datetime.value->is_utc = TRUE;
- write_label_piece (itip, &datetime, buffer, 1024, _("<b>Completed:</b> "), "<br>", FALSE);
- gtk_html_write (html, html_stream, buffer, strlen (buffer));
- wrote = TRUE;
- task_completed = TRUE;
- }
- e_cal_component_free_datetime (&datetime);
-
- buffer[0] = '\0';
- e_cal_component_get_due (comp, &datetime);
- if (type == E_CAL_COMPONENT_TODO && !task_completed && datetime.value) {
- write_label_piece (itip, &datetime, buffer, 1024, _("<b>Due:</b> "), "<br>", FALSE);
- gtk_html_write (html, html_stream, buffer, strlen (buffer));
- wrote = TRUE;
- }
-
- e_cal_component_free_datetime (&datetime);
-
- if (wrote)
- gtk_html_stream_printf (html_stream, "<br>");
-}
-
-static void
-set_message (GtkHTML *html, GtkHTMLStream *html_stream, const gchar *message, gboolean err)
-{
- if (message == NULL)
- return;
-
-
- if (err) {
- gtk_html_stream_printf (html_stream, "<b><font color=\"#ff0000\">%s</font></b><br><br>", message);
- } else {
- gtk_html_stream_printf (html_stream, "<b>%s</b><br><br>", message);
- }
-}
-
-static void
-write_error_html (EItipControl *itip, const gchar *itip_err)
-{
- EItipControlPrivate *priv;
- GtkHTMLStream *html_stream;
-
- priv = itip->priv;
-
- /* Html widget */
- html_stream = gtk_html_begin (GTK_HTML (priv->html));
- gtk_html_stream_printf (html_stream,
- "<html><head><title>%s</title></head>",
- _("iCalendar Information"));
-
- gtk_html_write (GTK_HTML (priv->html), html_stream,
- HTML_BODY_START, strlen(HTML_BODY_START));
-
- /* The table */
- gtk_html_stream_printf (html_stream, "<table width=450 cellspacing=\"0\" cellpadding=\"4\" border=\"0\">");
- /* The column for the image */
- gtk_html_stream_printf (html_stream, "<tr><td width=48 align=\"center\" valign=\"top\" rowspan=\"8\">");
- /* The image */
- gtk_html_stream_printf (html_stream, "<img src=\"/meeting-request.png\"></td>");
-
- gtk_html_stream_printf (html_stream, "<td align=\"left\" valign=\"top\">");
-
- /* Title */
- set_message (GTK_HTML (priv->html), html_stream, _("iCalendar Error"), TRUE);
-
- /* Error */
- gtk_html_write (GTK_HTML (priv->html), html_stream, itip_err, strlen(itip_err));
-
- /* Clean up */
- gtk_html_stream_printf (html_stream, "</td></tr></table>");
-
- gtk_html_write (GTK_HTML (priv->html), html_stream,
- HTML_BODY_END, strlen(HTML_BODY_END));
- gtk_html_write (GTK_HTML (priv->html), html_stream,
- HTML_FOOTER, strlen(HTML_FOOTER));
-
- gtk_html_end (GTK_HTML (priv->html), html_stream, GTK_HTML_STREAM_OK);
-}
-
-static void
-write_html (EItipControl *itip, const gchar *itip_desc, const gchar *itip_title, const gchar *options)
-{
- EItipControlPrivate *priv;
- GtkHTMLStream *html_stream;
- ECalComponentText text;
- ECalComponentOrganizer organizer;
- ECalComponentAttendee *attendee;
- GSList *attendees, *l = NULL;
- const char *string;
- gchar *html;
- const gchar *const_html;
-
- priv = itip->priv;
-
- if (priv->html == NULL)
- return;
-
- /* Html widget */
- html_stream = gtk_html_begin (GTK_HTML (priv->html));
- gtk_html_stream_printf (html_stream,
- "<html><head><title>%s</title></head>",
- _("iCalendar Information"));
- gtk_html_write (GTK_HTML (priv->html), html_stream,
- HTML_BODY_START, strlen(HTML_BODY_START));
-
- /* The table */
- const_html = "<table width=450 cellspacing=\"0\" cellpadding=\"4\" border=\"0\">";
- gtk_html_write (GTK_HTML (priv->html), html_stream, const_html, strlen(const_html));
-
- /* The column for the image */
- const_html = "<tr><td width=48 align=\"center\" valign=\"top\" rowspan=\"8\">";
- gtk_html_write (GTK_HTML (priv->html), html_stream, const_html, strlen(const_html));
-
- /* The image */
- const_html = "<img src=\"/meeting-request.png\"></td>";
- gtk_html_write (GTK_HTML (priv->html), html_stream, const_html, strlen(const_html));
-
- const_html = "<td align=\"left\" valign=\"top\">";
- gtk_html_write (GTK_HTML (priv->html), html_stream, const_html, strlen(const_html));
-
- switch (priv->method) {
- case ICAL_METHOD_REFRESH:
- case ICAL_METHOD_REPLY:
- /* An attendee sent this */
- e_cal_component_get_attendee_list (priv->comp, &attendees);
- if (attendees != NULL) {
- attendee = attendees->data;
- html = g_strdup_printf (itip_desc,
- attendee->cn ?
- attendee->cn :
- itip_strip_mailto (attendee->value));
- } else {
- html = g_strdup_printf (itip_desc, _("An unknown person"));
- }
- break;
- case ICAL_METHOD_REQUEST:
- /* The organizer sent this */
- e_cal_component_get_organizer (priv->comp, &organizer);
- if (priv->delegator_address != NULL) {
- if (organizer.value != NULL)
- html = g_strdup_printf (itip_desc,
- organizer.cn ?
- organizer.cn :
- itip_strip_mailto (organizer.value),
- priv->delegator_name ?
- priv->delegator_name :
- priv->delegator_address);
- else
- html = g_strdup_printf (itip_desc, _("An unknown person"),
- priv->delegator_name ?
- priv->delegator_name :
- priv->delegator_address);
- } else {
- if (organizer.value != NULL)
- html = g_strdup_printf (itip_desc,
- organizer.cn ?
- organizer.cn :
- itip_strip_mailto (organizer.value));
- else
- html = g_strdup_printf (itip_desc, _("An unknown person"));
- }
-
- break;
-
- case ICAL_METHOD_PUBLISH:
- case ICAL_METHOD_ADD:
- case ICAL_METHOD_CANCEL:
- default:
- /* The organizer sent this */
- e_cal_component_get_organizer (priv->comp, &organizer);
- if (organizer.value != NULL)
- html = g_strdup_printf (itip_desc,
- organizer.cn ?
- organizer.cn :
- itip_strip_mailto (organizer.value));
- else
- html = g_strdup_printf (itip_desc, _("An unknown person"));
- break;
- }
- gtk_html_write (GTK_HTML (priv->html), html_stream, html, strlen(html));
- g_free (html);
-
- /* Describe what the user can do */
- const_html = _("<br> Please review the following information, "
- "and then select an action from the menu below.");
- gtk_html_write (GTK_HTML (priv->html), html_stream, const_html, strlen(const_html));
-
- /* Separator */
- gtk_html_write (GTK_HTML (priv->html), html_stream, HTML_SEP, strlen (HTML_SEP));
-
- /* Title */
- set_message (GTK_HTML (priv->html), html_stream, itip_title, FALSE);
-
- /* Date information */
- set_date_label (itip, GTK_HTML (priv->html), html_stream, priv->comp);
-
- /* Summary */
- e_cal_component_get_summary (priv->comp, &text);
- html = text.value ? camel_text_to_html (text.value, CAMEL_MIME_FILTER_TOHTML_CONVERT_NL, 0) : _("<i>None</i>");
- gtk_html_stream_printf (html_stream, "<b>%s</b><br>%s<br><br>",
- _("Summary:"), html);
- if (text.value)
- g_free (html);
-
- /* Location */
- e_cal_component_get_location (priv->comp, &string);
- if (string != NULL) {
- html = camel_text_to_html (string, CAMEL_MIME_FILTER_TOHTML_CONVERT_NL, 0);
- gtk_html_stream_printf (html_stream, "<b>%s</b><br>%s<br><br>",
- _("Location:"), html);
- g_free (html);
- }
-
- /* Status */
- if (priv->method == ICAL_METHOD_REPLY) {
- GSList *alist;
-
- e_cal_component_get_attendee_list (priv->comp, &alist);
-
- if (alist != NULL) {
- ECalComponentAttendee *a = alist->data;
-
- gtk_html_stream_printf (html_stream, "<b>%s</b><br>",
- _("Status:"));
-
- switch (a->status) {
- case ICAL_PARTSTAT_ACCEPTED:
- gtk_html_stream_printf (html_stream, "%s<br><br>",
- _("Accepted"));
- break;
- case ICAL_PARTSTAT_TENTATIVE:
- gtk_html_stream_printf (html_stream, "%s<br><br>",
- _("Tentatively Accepted"));
- break;
- case ICAL_PARTSTAT_DECLINED:
- gtk_html_stream_printf (html_stream, "%s<br><br>",
- _("Declined"));
- break;
- default:
- gtk_html_stream_printf (html_stream, "%s<br><br>",
- _("Unknown"));
- }
- }
-
- e_cal_component_free_attendee_list (alist);
- }
-
- /* Description */
- e_cal_component_get_description_list (priv->comp, &l);
- if (l)
- text = *((ECalComponentText *)l->data);
-
- if (l && text.value) {
- html = camel_text_to_html (text.value, CAMEL_MIME_FILTER_TOHTML_CONVERT_NL, 0);
- gtk_html_stream_printf (html_stream, "<b>%s</b><br>%s",
- _("Description:"), html);
- g_free (html);
- }
- e_cal_component_free_text_list (l);
-
- /* Separator */
- gtk_html_write (GTK_HTML (priv->html), html_stream, HTML_SEP, strlen (HTML_SEP));
-
- /* Options */
- if (!e_itip_control_get_view_only (itip)) {
- if (options != NULL) {
- const_html = "</td></tr><tr><td valign=\"center\">";
- gtk_html_write (GTK_HTML (priv->html), html_stream, const_html, strlen (const_html));
- gtk_html_write (GTK_HTML (priv->html), html_stream, options, strlen (options));
- }
- }
-
- const_html = "</td></tr></table>";
- gtk_html_write (GTK_HTML (priv->html), html_stream, const_html, strlen(const_html));
-
- gtk_html_write (GTK_HTML (priv->html), html_stream,
- HTML_BODY_END, strlen(HTML_BODY_END));
- gtk_html_write (GTK_HTML (priv->html), html_stream,
- HTML_FOOTER, strlen(HTML_FOOTER));
-
- gtk_html_end (GTK_HTML (priv->html), html_stream, GTK_HTML_STREAM_OK);
-}
-
-
-static char*
-get_publish_options (gboolean selector)
-{
- char *html;
-
- html = g_strdup_printf ("<form><b>%s</b>&nbsp"
- "<select NAME=\"action\" SIZE=\"1\"> "
- "<option VALUE=\"U\">%s</option>"
- "</select>&nbsp &nbsp "
- "<input TYPE=Submit name=\"ok\" value=\"%s\">"
- "</form>",
- _("Choose an action:"),
- _("Update"),
- _("OK"));
-
- if (selector) {
- char *sel;
-
- sel = g_strconcat (html, "<object classid=\"gtk:label\">", NULL);
- g_free (html);
- html = sel;
- }
-
- return html;
-}
-
-static char*
-get_request_options (gboolean selector)
-{
- char *html;
-
- html = g_strdup_printf ("<form><b>%s</b>&nbsp"
- "<select NAME=\"action\" SIZE=\"1\"> "
- "<option VALUE=\"A\">%s</option> "
- "<option VALUE=\"T\">%s</option> "
- "<option VALUE=\"D\">%s</option></select>&nbsp "
- "<input TYPE=\"checkbox\" name=\"rsvp\" value=\"1\" checked>%s&nbsp&nbsp"
- "<input TYPE=\"submit\" name=\"ok\" value=\"%s\"><br> "
- "</form>",
- _("Choose an action:"),
- _("Accept"),
- _("Tentatively accept"),
- _("Decline"),
- _("RSVP"),
- _("OK"));
-
- if (selector) {
- char *sel;
-
- sel = g_strconcat (html, "<object classid=\"gtk:label\">", NULL);
- g_free (html);
- html = sel;
- }
-
- return html;
-}
-
-static char*
-get_request_fb_options ()
-{
- return g_strdup_printf ("<form><b>%s</b>&nbsp"
- "<select NAME=\"action\" SIZE=\"1\"> "
- "<option VALUE=\"F\">%s</option></select>&nbsp &nbsp "
- "<input TYPE=Submit name=\"ok\" value=\"%s\">"
- "</form>",
- _("Choose an action:"),
- _("Send Free/Busy Information"),
- _("OK"));
-}
-
-static char*
-get_reply_options ()
-{
- return g_strdup_printf ("<form><b>%s</b>&nbsp"
- "<select NAME=\"action\" SIZE=\"1\"> "
- "<option VALUE=\"R\">%s</option></select>&nbsp &nbsp "
- "<input TYPE=Submit name=\"ok\" value=\"%s\">"
- "</form>",
- _("Choose an action:"),
- _("Update respondent status"),
- _("OK"));
-}
-
-static char*
-get_refresh_options ()
-{
- return g_strdup_printf ("<form><b>%s</b>&nbsp"
- "<select NAME=\"action\" SIZE=\"1\"> "
- "<option VALUE=\"S\">%s</option></select>&nbsp &nbsp "
- "<input TYPE=Submit name=\"ok\" value=\"%s\">"
- "</form>",
- _("Choose an action:"),
- _("Send Latest Information"),
- _("OK"));
-}
-
-static char*
-get_cancel_options ()
-{
- return g_strdup_printf ("<form><b>%s</b>&nbsp"
- "<select NAME=\"action\" SIZE=\"1\"> "
- "<option VALUE=\"C\">%s</option></select>&nbsp &nbsp "
- "<input TYPE=Submit name=\"ok\" value=\"%s\">"
- "</form>",
- _("Choose an action:"),
- _("Cancel"),
- _("OK"));
-}
-
-
-static ECalComponent *
-get_real_item (EItipControl *itip)
-{
- EItipControlPrivate *priv;
- ECalComponent *comp;
- icalcomponent *icalcomp;
- ECalComponentVType type;
- gboolean found = FALSE;
- const char *uid;
-
- priv = itip->priv;
-
- type = e_cal_component_get_vtype (priv->comp);
- e_cal_component_get_uid (priv->comp, &uid);
-
- switch (type) {
- case E_CAL_COMPONENT_EVENT:
- if (priv->event_client != NULL)
- found = e_cal_get_object (priv->event_client, uid, NULL, &icalcomp, NULL);
- break;
- case E_CAL_COMPONENT_TODO:
- if (priv->task_client != NULL)
- found = e_cal_get_object (priv->task_client, uid, NULL, &icalcomp, NULL);
- break;
- default:
- found = FALSE;
- }
-
- if (!found)
- return NULL;
-
- comp = e_cal_component_new ();
- if (!e_cal_component_set_icalcomponent (comp, icalcomp)) {
- g_object_unref (comp);
- icalcomponent_free (icalcomp);
- return NULL;
- }
-
- return comp;
-}
-
-static void
-adjust_item (EItipControl *itip, ECalComponent *comp)
-{
- ECalComponent *real_comp;
-
- real_comp = get_real_item (itip);
- if (real_comp != NULL) {
- ECalComponentText text;
- const char *string;
- GSList *l;
-
- e_cal_component_get_summary (real_comp, &text);
- e_cal_component_set_summary (comp, &text);
- e_cal_component_get_location (real_comp, &string);
- e_cal_component_set_location (comp, string);
- e_cal_component_get_description_list (real_comp, &l);
- e_cal_component_set_description_list (comp, l);
- e_cal_component_free_text_list (l);
-
- g_object_unref (real_comp);
- } else {
- ECalComponentText text = {_("Unknown"), NULL};
-
- e_cal_component_set_summary (comp, &text);
- }
-}
-
-static void
-show_current_event (EItipControl *itip)
-{
- EItipControlPrivate *priv;
- const gchar *itip_title, *itip_desc;
- char *options;
-
- priv = itip->priv;
-
- if (priv->calendar_uri)
- priv->event_client = start_calendar_server (itip, priv->calendar_uri);
- else
- priv->event_client = find_server (priv->event_clients, priv->comp);
-
- switch (priv->method) {
- case ICAL_METHOD_PUBLISH:
- itip_desc = _("<b>%s</b> has published meeting information.");
- itip_title = _("Meeting Information");
- options = get_publish_options (priv->event_client ? FALSE : TRUE);
- break;
- case ICAL_METHOD_REQUEST:
- if (priv->delegator_address != NULL)
- itip_desc = _("<b>%s</b> requests the presence of %s at a meeting.");
- else
- itip_desc = _("<b>%s</b> requests your presence at a meeting.");
- itip_title = _("Meeting Proposal");
- options = get_request_options (priv->event_client ? FALSE : TRUE);
- break;
- case ICAL_METHOD_ADD:
- itip_desc = _("<b>%s</b> wishes to add to an existing meeting.");
- itip_title = _("Meeting Update");
- options = get_publish_options (priv->event_client ? FALSE : TRUE);
- break;
- case ICAL_METHOD_REFRESH:
- itip_desc = _("<b>%s</b> wishes to receive the latest meeting information.");
- itip_title = _("Meeting Update Request");
- options = get_refresh_options ();
-
- /* Provide extra info, since its not in the component */
- adjust_item (itip, priv->comp);
- break;
- case ICAL_METHOD_REPLY:
- itip_desc = _("<b>%s</b> has replied to a meeting request.");
- itip_title = _("Meeting Reply");
- options = get_reply_options ();
-
- /* Provide extra info, since might not be in the component */
- adjust_item (itip, priv->comp);
- break;
- case ICAL_METHOD_CANCEL:
- itip_desc = _("<b>%s</b> has cancelled a meeting.");
- itip_title = _("Meeting Cancellation");
- options = get_cancel_options ();
-
- /* Provide extra info, since might not be in the component */
- adjust_item (itip, priv->comp);
- break;
- default:
- itip_desc = _("<b>%s</b> has sent an unintelligible message.");
- itip_title = _("Bad Meeting Message");
- options = NULL;
- }
-
- write_html (itip, itip_desc, itip_title, options);
- g_free (options);
-}
-
-static void
-show_current_todo (EItipControl *itip)
-{
- EItipControlPrivate *priv;
- const gchar *itip_title, *itip_desc;
- char *options;
-
- priv = itip->priv;
-
- if (priv->calendar_uri)
- priv->task_client = start_calendar_server (itip, priv->calendar_uri);
- else
- priv->task_client = find_server (priv->task_clients, priv->comp);
-
- switch (priv->method) {
- case ICAL_METHOD_PUBLISH:
- itip_desc = _("<b>%s</b> has published task information.");
- itip_title = _("Task Information");
- options = get_publish_options (priv->task_client ? FALSE : TRUE);
- break;
- case ICAL_METHOD_REQUEST:
- if (priv->delegator_address != NULL)
- itip_desc = _("<b>%s</b> requests %s to perform a task.");
- else
- itip_desc = _("<b>%s</b> requests you perform a task.");
- itip_title = _("Task Proposal");
- options = get_request_options (priv->task_client ? FALSE : TRUE);
- break;
- case ICAL_METHOD_ADD:
- itip_desc = _("<b>%s</b> wishes to add to an existing task.");
- itip_title = _("Task Update");
- options = get_publish_options (priv->task_client ? FALSE : TRUE);
- break;
- case ICAL_METHOD_REFRESH:
- itip_desc = _("<b>%s</b> wishes to receive the latest task information.");
- itip_title = _("Task Update Request");
- options = get_refresh_options ();
-
- /* Provide extra info, since its not in the component */
- adjust_item (itip, priv->comp);
- break;
- case ICAL_METHOD_REPLY:
- itip_desc = _("<b>%s</b> has replied to a task assignment.");
- itip_title = _("Task Reply");
- options = get_reply_options ();
-
- /* Provide extra info, since might not be in the component */
- adjust_item (itip, priv->comp);
- break;
- case ICAL_METHOD_CANCEL:
- itip_desc = _("<b>%s</b> has cancelled a task.");
- itip_title = _("Task Cancellation");
- options = get_cancel_options ();
-
- /* Provide extra info, since might not be in the component */
- adjust_item (itip, priv->comp);
- break;
- default:
- itip_desc = _("<b>%s</b> has sent an unintelligible message.");
- itip_title = _("Bad Task Message");
- options = NULL;
- }
-
- write_html (itip, itip_desc, itip_title, options);
- g_free (options);
-}
-
-static void
-show_current_freebusy (EItipControl *itip)
-{
- EItipControlPrivate *priv;
- const gchar *itip_title, *itip_desc;
- char *options;
-
- priv = itip->priv;
-
- switch (priv->method) {
- case ICAL_METHOD_PUBLISH:
- itip_desc = _("<b>%s</b> has published free/busy information.");
- itip_title = _("Free/Busy Information");
- options = NULL;
- break;
- case ICAL_METHOD_REQUEST:
- itip_desc = _("<b>%s</b> requests your free/busy information.");
- itip_title = _("Free/Busy Request");
- options = get_request_fb_options ();
- break;
- case ICAL_METHOD_REPLY:
- itip_desc = _("<b>%s</b> has replied to a free/busy request.");
- itip_title = _("Free/Busy Reply");
- options = NULL;
- break;
- default:
- itip_desc = _("<b>%s</b> has sent an unintelligible message.");
- itip_title = _("Bad Free/Busy Message");
- options = NULL;
- }
-
- write_html (itip, itip_desc, itip_title, options);
- g_free (options);
-}
-
-static icalcomponent *
-get_next (icalcompiter *iter)
-{
- icalcomponent *ret = NULL;
- icalcomponent_kind kind;
-
- do {
- icalcompiter_next (iter);
- ret = icalcompiter_deref (iter);
- kind = icalcomponent_isa (ret);
- } while (ret != NULL
- && kind != ICAL_VEVENT_COMPONENT
- && kind != ICAL_VTODO_COMPONENT
- && kind != ICAL_VFREEBUSY_COMPONENT);
-
- return ret;
-}
-
-static void
-show_current (EItipControl *itip)
-{
- EItipControlPrivate *priv;
- ECalComponentVType type;
- icalcomponent *alarm_comp;
- icalcompiter alarm_iter;
- icalproperty *prop;
-
- priv = itip->priv;
-
- g_object_ref (itip);
-
- if (priv->comp)
- g_object_unref (priv->comp);
- if (priv->event_client != NULL)
- g_object_unref (priv->event_client);
- priv->event_client = NULL;
- if (priv->task_client != NULL)
- g_object_unref (priv->task_client);
- priv->task_client = NULL;
-
- /* Determine any delegate sections */
- prop = icalcomponent_get_first_property (priv->ical_comp, ICAL_X_PROPERTY);
- while (prop) {
- const char *x_name, *x_val;
-
- x_name = icalproperty_get_x_name (prop);
- x_val = icalproperty_get_x (prop);
-
- if (!strcmp (x_name, "X-EVOLUTION-DELEGATOR-CALENDAR-URI"))
- e_itip_control_set_calendar_uri (itip, x_val);
- else if (!strcmp (x_name, "X-EVOLUTION-DELEGATOR-ADDRESS"))
- e_itip_control_set_delegator_address (itip, x_val);
- else if (!strcmp (x_name, "X-EVOLUTION-DELEGATOR-NAME"))
- e_itip_control_set_delegator_name (itip, x_val);
-
- prop = icalcomponent_get_next_property (priv->ical_comp, ICAL_X_PROPERTY);
- }
-
- /* Strip out alarms for security purposes */
- alarm_iter = icalcomponent_begin_component (priv->ical_comp, ICAL_VALARM_COMPONENT);
- while ((alarm_comp = icalcompiter_deref (&alarm_iter)) != NULL) {
- icalcomponent_remove_component (priv->ical_comp, alarm_comp);
-
- icalcompiter_next (&alarm_iter);
- }
-
- priv->comp = e_cal_component_new ();
- if (!e_cal_component_set_icalcomponent (priv->comp, priv->ical_comp)) {
- write_error_html (itip, _("The message does not appear to be properly formed"));
- g_object_unref (priv->comp);
- priv->comp = NULL;
- g_object_unref (itip);
- return;
- };
-
- /* Add default reminder if the config says so */
- if (calendar_config_get_use_default_reminder ()) {
- ECalComponentAlarm *acomp;
- int interval;
- CalUnits units;
- ECalComponentAlarmTrigger trigger;
-
- interval = calendar_config_get_default_reminder_interval ();
- units = calendar_config_get_default_reminder_units ();
-
- acomp = e_cal_component_alarm_new ();
-
- e_cal_component_alarm_set_action (acomp, E_CAL_COMPONENT_ALARM_DISPLAY);
-
- trigger.type = E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START;
- memset (&trigger.u.rel_duration, 0, sizeof (trigger.u.rel_duration));
-
- trigger.u.rel_duration.is_neg = TRUE;
-
- switch (units) {
- case CAL_MINUTES:
- trigger.u.rel_duration.minutes = interval;
- break;
- case CAL_HOURS:
- trigger.u.rel_duration.hours = interval;
- break;
- case CAL_DAYS:
- trigger.u.rel_duration.days = interval;
- break;
- default:
- g_assert_not_reached ();
- }
-
- e_cal_component_alarm_set_trigger (acomp, trigger);
- e_cal_component_add_alarm (priv->comp, acomp);
-
- e_cal_component_alarm_free (acomp);
- }
-
- type = e_cal_component_get_vtype (priv->comp);
-
- switch (type) {
- case E_CAL_COMPONENT_EVENT:
- if (!priv->event_clients) {
- priv->event_clients = g_ptr_array_new ();
- /* EPFIXME */
- /* priv->event_clients = get_servers (itip, global_shell_client, calendar_types, FALSE); */
- }
- show_current_event (itip);
- break;
- case E_CAL_COMPONENT_TODO:
- if (!priv->task_clients) {
- /* EPFIXME */
- /* priv->task_clients = get_servers (itip, global_shell_client, tasks_types, TRUE); */
- }
- show_current_todo (itip);
- break;
- case E_CAL_COMPONENT_FREEBUSY:
- show_current_freebusy (itip);
- break;
- default:
- write_error_html (itip, _("The message contains only unsupported requests."));
- }
-
- find_my_address (itip, priv->ical_comp);
-
- g_object_unref (itip);
-}
-
-void
-e_itip_control_set_data (EItipControl *itip, const gchar *text)
-{
- EItipControlPrivate *priv;
- icalproperty *prop;
- icalcomponent_kind kind = ICAL_NO_COMPONENT;
- icalcomponent *tz_comp;
- icalcompiter tz_iter;
-
- priv = itip->priv;
-
- clean_up (itip);
-
- if (text == NULL || *text == '\0') {
- gtk_html_load_from_string (GTK_HTML (priv->html), " ", 1);
- return;
- }
-
- priv->vcalendar = g_strdup (text);
- priv->top_level = e_cal_util_new_top_level ();
-
- priv->main_comp = icalparser_parse_string (priv->vcalendar);
- if (priv->main_comp == NULL) {
- write_error_html (itip, _("The attachment does not contain a valid calendar message"));
- return;
- }
-
- prop = icalcomponent_get_first_property (priv->main_comp, ICAL_METHOD_PROPERTY);
- if (prop == NULL) {
- write_error_html (itip, _("The attachment does not contain a valid calendar message"));
- return;
- }
-
- priv->method = icalproperty_get_method (prop);
-
- tz_iter = icalcomponent_begin_component (priv->main_comp, ICAL_VTIMEZONE_COMPONENT);
- while ((tz_comp = icalcompiter_deref (&tz_iter)) != NULL) {
- icalcomponent *clone;
-
- clone = icalcomponent_new_clone (tz_comp);
- icalcomponent_add_component (priv->top_level, clone);
-
- icalcompiter_next (&tz_iter);
- }
-
- priv->iter = icalcomponent_begin_component (priv->main_comp, ICAL_ANY_COMPONENT);
- priv->ical_comp = icalcompiter_deref (&priv->iter);
- kind = icalcomponent_isa (priv->ical_comp);
- if (kind != ICAL_VEVENT_COMPONENT
- && kind != ICAL_VTODO_COMPONENT
- && kind != ICAL_VFREEBUSY_COMPONENT)
- priv->ical_comp = get_next (&priv->iter);
-
- if (priv->ical_comp == NULL) {
- write_error_html (itip, _("The attachment has no viewable calendar items"));
- return;
- }
-
- priv->total = icalcomponent_count_components (priv->main_comp, ICAL_VEVENT_COMPONENT);
- priv->total += icalcomponent_count_components (priv->main_comp, ICAL_VTODO_COMPONENT);
- priv->total += icalcomponent_count_components (priv->main_comp, ICAL_VFREEBUSY_COMPONENT);
-
- if (priv->total > 0)
- priv->current = 1;
- else
- priv->current = 0;
-
- show_current (itip);
-}
-
-gchar *
-e_itip_control_get_data (EItipControl *itip)
-{
- EItipControlPrivate *priv;
-
- priv = itip->priv;
-
- return g_strdup (priv->vcalendar);
-}
-
-gint
-e_itip_control_get_data_size (EItipControl *itip)
-{
- EItipControlPrivate *priv;
-
- priv = itip->priv;
-
- if (priv->vcalendar == NULL)
- return 0;
-
- return strlen (priv->vcalendar);
-}
-
-void
-e_itip_control_set_from_address (EItipControl *itip, const gchar *address)
-{
- EItipControlPrivate *priv;
-
- priv = itip->priv;
-
- if (priv->from_address)
- g_free (priv->from_address);
-
- priv->from_address = g_strdup (address);
-}
-
-const gchar *
-e_itip_control_get_from_address (EItipControl *itip)
-{
- EItipControlPrivate *priv;
-
- priv = itip->priv;
-
- return priv->from_address;
-}
-
-void
-e_itip_control_set_view_only (EItipControl *itip, gint view_only)
-{
- EItipControlPrivate *priv;
-
- priv = itip->priv;
-
- priv->view_only = view_only;
-}
-
-gint
-e_itip_control_get_view_only (EItipControl *itip)
-{
- EItipControlPrivate *priv;
-
- priv = itip->priv;
-
- return priv->view_only;
-}
-
-
-void
-e_itip_control_set_delegator_address (EItipControl *itip, const gchar *address)
-{
- EItipControlPrivate *priv;
-
- priv = itip->priv;
-
- if (priv->delegator_address)
- g_free (priv->delegator_address);
-
- priv->delegator_address = g_strdup (address);
-}
-
-const gchar *
-e_itip_control_get_delegator_address (EItipControl *itip)
-{
- EItipControlPrivate *priv;
-
- priv = itip->priv;
-
- return priv->delegator_address;
-}
-
-
-void
-e_itip_control_set_delegator_name (EItipControl *itip, const gchar *name)
-{
- EItipControlPrivate *priv;
-
- priv = itip->priv;
-
- if (priv->delegator_name)
- g_free (priv->delegator_name);
-
- priv->delegator_name = g_strdup (name);
-}
-
-const gchar *
-e_itip_control_get_delegator_name (EItipControl *itip)
-{
- EItipControlPrivate *priv;
-
- priv = itip->priv;
-
- return priv->delegator_name;
-}
-
-void
-e_itip_control_set_calendar_uri (EItipControl *itip, const gchar *uri)
-{
- EItipControlPrivate *priv;
-
- priv = itip->priv;
-
- if (priv->calendar_uri)
- g_free (priv->calendar_uri);
-
- priv->calendar_uri = g_strdup (uri);
-}
-
-const gchar *
-e_itip_control_get_calendar_uri (EItipControl *itip)
-{
- EItipControlPrivate *priv;
-
- priv = itip->priv;
-
- return priv->calendar_uri;
-}
-
-
-static gboolean
-change_status (icalcomponent *ical_comp, const char *address, icalparameter_partstat status)
-{
- icalproperty *prop;
-
- prop = find_attendee (ical_comp, address);
- if (prop) {
- icalparameter *param;
-
- icalproperty_remove_parameter (prop, ICAL_PARTSTAT_PARAMETER);
- param = icalparameter_new_partstat (status);
- icalproperty_add_parameter (prop, param);
- } else {
- icalparameter *param;
-
- if (address != NULL) {
- prop = icalproperty_new_attendee (address);
- icalcomponent_add_property (ical_comp, prop);
-
- param = icalparameter_new_role (ICAL_ROLE_OPTPARTICIPANT);
- icalproperty_add_parameter (prop, param);
-
- param = icalparameter_new_partstat (status);
- icalproperty_add_parameter (prop, param);
- } else {
- EAccount *a;
-
- a = itip_addresses_get_default ();
-
- prop = icalproperty_new_attendee (a->id->address);
- icalcomponent_add_property (ical_comp, prop);
-
- param = icalparameter_new_cn (a->id->name);
- icalproperty_add_parameter (prop, param);
-
- param = icalparameter_new_role (ICAL_ROLE_REQPARTICIPANT);
- icalproperty_add_parameter (prop, param);
-
- param = icalparameter_new_partstat (status);
- icalproperty_add_parameter (prop, param);
- }
- }
-
- return TRUE;
-}
-
-static void
-update_item (EItipControl *itip)
-{
- EItipControlPrivate *priv;
- struct icaltimetype stamp;
- icalproperty *prop;
- icalcomponent *clone;
- ECal *client;
- ECalComponentVType type;
- GtkWidget *dialog;
-
- priv = itip->priv;
-
- /* Set X-MICROSOFT-CDO-REPLYTIME to record the time at which
- * the user accepted/declined the request. (Outlook ignores
- * SEQUENCE in REPLY reponses and instead requires that each
- * updated response have a later REPLYTIME than the previous
- * one.) This also ends up getting saved in our own copy of
- * the meeting, though there's currently no way to see that
- * information (unless it's being saved to an Exchange folder
- * and you then look at it in Outlook).
- */
- stamp = icaltime_current_time_with_zone (icaltimezone_get_utc_timezone ());
- prop = icalproperty_new_x (icaltime_as_ical_string (stamp));
- icalproperty_set_x_name (prop, "X-MICROSOFT-CDO-REPLYTIME");
- icalcomponent_add_property (priv->ical_comp, prop);
-
- type = e_cal_component_get_vtype (priv->comp);
- if (type == E_CAL_COMPONENT_TODO)
- client = priv->task_client;
- else
- client = priv->event_client;
-
- clone = icalcomponent_new_clone (priv->ical_comp);
- icalcomponent_add_component (priv->top_level, clone);
- icalcomponent_set_method (priv->top_level, priv->method);
-
- /* FIXME Better error dialog */
- if (!e_cal_receive_objects (client, priv->top_level, NULL)) {
- dialog = gnome_warning_dialog (_("Calendar file could not be updated!\n"));
- } else {
- dialog = gnome_ok_dialog (_("Update complete\n"));
- }
- gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
-
- icalcomponent_remove_component (priv->top_level, clone);
-}
-
-#if 0
-static void
-update_attendee_status (EItipControl *itip)
-{
- EItipControlPrivate *priv;
- ECal *client;
- ECalGetStatus status;
- ECalComponent *comp = NULL;
- icalcomponent *icalcomp = NULL;
- ECalComponentVType type;
- const char *uid;
- GtkWidget *dialog;
- ECalResult result;
-
- priv = itip->priv;
-
- type = e_cal_component_get_vtype (priv->comp);
- if (type == E_CAL_COMPONENT_TODO)
- client = priv->task_client;
- else
- client = priv->event_client;
-
- if (client == NULL) {
- dialog = gnome_warning_dialog (_("Attendee status can not be updated "
- "because the item no longer exists"));
- goto cleanup;
- }
-
- /* Obtain our version */
- e_cal_component_get_uid (priv->comp, &uid);
- status = e_cal_get_object (client, uid, NULL, &icalcomp);
-
- if (status == E_CAL_GET_SUCCESS) {
- GSList *attendees;
-
- comp = e_cal_component_new ();
- if (!e_cal_component_set_icalcomponent (comp, icalcomp)) {
- icalcomponent_free (icalcomp);
-
- dialog = gnome_warning_dialog (_("Object is invalid and cannot be updated\n"));
- } else {
- e_cal_component_get_attendee_list (priv->comp, &attendees);
- if (attendees != NULL) {
- ECalComponentAttendee *a = attendees->data;
- icalproperty *prop;
-
- prop = find_attendee (icalcomp, itip_strip_mailto (a->value));
-
- if (prop == NULL) {
- dialog = gnome_question_dialog_modal (_("This response is not from a current "
- "attendee. Add as an attendee?"),
- NULL, NULL);
- if (gnome_dialog_run_and_close (GNOME_DIALOG (dialog)) == GNOME_YES) {
- change_status (icalcomp,
- itip_strip_mailto (a->value),
- a->status);
- e_cal_component_rescan (comp);
- } else {
- goto cleanup;
- }
- } else if (a->status == ICAL_PARTSTAT_NONE || a->status == ICAL_PARTSTAT_X) {
- dialog = gnome_warning_dialog (_("Attendee status could "
- "not be updated because "
- "of an invalid status!\n"));
- goto cleanup;
- } else {
- change_status (icalcomp,
- itip_strip_mailto (a->value),
- a->status);
- e_cal_component_rescan (comp);
- }
- }
- }
-
- result = e_cal_update_object (client, comp);
- switch (result) {
- case E_CAL_RESULT_INVALID_OBJECT :
- dialog = gnome_warning_dialog (_("Object is invalid and cannot be updated\n"));
- break;
- case E_CAL_RESULT_CORBA_ERROR :
- dialog = gnome_warning_dialog (_("There was an error on the CORBA system\n"));
- break;
- case E_CAL_RESULT_NOT_FOUND :
- dialog = gnome_warning_dialog (_("Object could not be found\n"));
- break;
- case E_CAL_RESULT_PERMISSION_DENIED :
- dialog = gnome_warning_dialog (_("You don't have the right permissions to update the calendar\n"));
- break;
- case E_CAL_RESULT_SUCCESS :
- dialog = gnome_ok_dialog (_("Attendee status updated\n"));
- break;
- default :
- dialog = gnome_warning_dialog (_("Attendee status could not be updated!\n"));
- }
- } else {
- dialog = gnome_warning_dialog (_("Attendee status can not be updated "
- "because the item no longer exists"));
- }
-
- cleanup:
- if (comp != NULL)
- g_object_unref (comp);
- gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
-}
-#endif
-
-static void
-remove_item (EItipControl *itip)
-{
- EItipControlPrivate *priv;
- ECal *client;
- ECalComponentVType type;
- const char *uid;
- GtkWidget *dialog;
- GError *error = NULL;
-
- priv = itip->priv;
-
- type = e_cal_component_get_vtype (priv->comp);
- if (type == E_CAL_COMPONENT_TODO)
- client = priv->task_client;
- else
- client = priv->event_client;
-
- if (client == NULL)
- return;
-
- e_cal_component_get_uid (priv->comp, &uid);
- e_cal_remove_object (client, uid, &error);
- if (!error || error->code == E_CALENDAR_STATUS_OBJECT_NOT_FOUND) {
- dialog = gnome_ok_dialog (_("Removal Complete"));
- gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
- } else {
- delete_error_dialog (error, type);
- }
-
- g_clear_error (&error);
-}
-
-static void
-send_item (EItipControl *itip)
-{
- EItipControlPrivate *priv;
- ECalComponent *comp;
- ECalComponentVType vtype;
- GtkWidget *dialog;
-
- priv = itip->priv;
-
- comp = get_real_item (itip);
- vtype = e_cal_component_get_vtype (comp);
-
- if (comp != NULL) {
- switch (vtype) {
- case E_CAL_COMPONENT_EVENT:
- itip_send_comp (E_CAL_COMPONENT_METHOD_REQUEST, comp, priv->event_client, NULL);
- break;
- case E_CAL_COMPONENT_TODO:
- itip_send_comp (E_CAL_COMPONENT_METHOD_REQUEST, comp, priv->task_client, NULL);
- break;
- default:
- itip_send_comp (E_CAL_COMPONENT_METHOD_REQUEST, comp, NULL, NULL);
- }
- g_object_unref (comp);
- dialog = gnome_ok_dialog (_("Item sent!\n"));
- } else {
- dialog = gnome_warning_dialog (_("The item could not be sent!\n"));
- }
- gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
-}
-
-static void
-send_freebusy (EItipControl *itip)
-{
- EItipControlPrivate *priv;
- ECalComponentDateTime datetime;
- time_t start, end;
- GtkWidget *dialog;
- GList *comp_list = NULL;
- icaltimezone *zone;
-
- priv = itip->priv;
-
- e_cal_component_get_dtstart (priv->comp, &datetime);
- if (datetime.tzid) {
- zone = icalcomponent_get_timezone (priv->top_level,
- datetime.tzid);
- } else {
- zone = NULL;
- }
- start = icaltime_as_timet_with_zone (*datetime.value, zone);
- e_cal_component_free_datetime (&datetime);
-
- e_cal_component_get_dtend (priv->comp, &datetime);
- if (datetime.tzid) {
- zone = icalcomponent_get_timezone (priv->top_level,
- datetime.tzid);
- } else {
- zone = NULL;
- }
- end = icaltime_as_timet_with_zone (*datetime.value, zone);
- e_cal_component_free_datetime (&datetime);
-
- if (e_cal_get_free_busy (priv->event_client, NULL, start, end, &comp_list, NULL)) {
- GList *l;
-
- for (l = comp_list; l; l = l->next) {
- ECalComponent *comp = E_CAL_COMPONENT (l->data);
- itip_send_comp (E_CAL_COMPONENT_METHOD_REPLY, comp, priv->event_client, NULL);
-
- g_object_unref (comp);
- }
- dialog = gnome_ok_dialog (_("Item sent!\n"));
-
- g_list_free (comp_list);
- } else {
- dialog = gnome_warning_dialog (_("The item could not be sent!\n"));
- }
- gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
-}
-
-#if 0 /* FIXME */
-static void
-button_selected_cb (EvolutionFolderSelectorButton *button, GNOME_Evolution_Folder *folder, gpointer data)
-{
- EItipControl *itip = E_ITIP_CONTROL (data);
- EItipControlPrivate *priv;
- ECalComponentVType type;
- char *uri;
-
- priv = itip->priv;
-
- type = e_cal_component_get_vtype (priv->comp);
- if (type == E_CAL_COMPONENT_TODO)
- uri = e_cal_util_expand_uri (folder->physicalUri, TRUE);
- else
- uri = e_cal_util_expand_uri (folder->physicalUri, FALSE);
-
- g_object_unref (priv->event_client);
- priv->event_client = start_calendar_server (itip, uri);
-
- g_free (uri);
-}
-#endif
-
-static void
-url_requested_cb (GtkHTML *html, const gchar *url, GtkHTMLStream *handle, gpointer data)
-{ unsigned char buffer[4096];
- int len, fd;
- char *path;
-
- path = g_strdup_printf ("%s/%s", EVOLUTION_IMAGESDIR, url);
-
- if ((fd = open (path, O_RDONLY)) == -1) {
- g_warning ("%s", g_strerror (errno));
- goto cleanup;
- }
-
- while ((len = read (fd, buffer, 4096)) > 0) {
- gtk_html_write (html, handle, buffer, len);
- }
-
- if (len < 0) {
- /* check to see if we stopped because of an error */
- gtk_html_end (html, handle, GTK_HTML_STREAM_ERROR);
- g_warning ("%s", g_strerror (errno));
- goto cleanup;
- }
- /* done with no errors */
- gtk_html_end (html, handle, GTK_HTML_STREAM_OK);
- close (fd);
-
- cleanup:
- g_free (path);
-}
-
-typedef struct
-{
- EItipControl *itip;
- GtkHTMLEmbedded *eb;
- ECal *client;
-}
-ObjectRequestContext;
-
-static void
-default_server_started_cb (ECal *client, ECalendarStatus status, gpointer data)
-{
- ObjectRequestContext *context = data;
- EItipControlPrivate *priv;
- GtkWidget *button;
- ECalComponentVType vtype;
-
- priv = context->itip->priv;
-
- if (status != E_CALENDAR_STATUS_OK ||
- context->itip->priv->destroyed ||
- context->itip->priv->html == NULL) {
- g_object_unref (context->client);
- g_object_unref (context->itip);
- g_free (context);
- return;
- }
-
- priv->event_client = client;
- vtype = e_cal_component_get_vtype (priv->comp);
-
- switch (vtype) {
-#if 0 /* EPFIXME */
- case E_CAL_COMPONENT_EVENT:
- button = evolution_folder_selector_button_new (
- global_shell_client, _("Select Calendar Folder"),
- calendar_config_default_calendar_folder (),
- calendar_types);
- break;
- case E_CAL_COMPONENT_TODO:
- button = evolution_folder_selector_button_new (
- global_shell_client, _("Select Tasks Folder"),
- calendar_config_default_tasks_folder (),
- tasks_types);
- break;
-#endif
- default:
- button = NULL;
- }
-
-#if 0
- g_signal_connect (button, "selected", G_CALLBACK (button_selected_cb), context->itip);
-#endif
-
- gtk_container_add (GTK_CONTAINER (context->eb), button);
- gtk_widget_show (button);
-
- g_object_unref (context->itip);
- g_free (context);
- return;
-}
-
-static gboolean
-object_requested_cb (GtkHTML *html, GtkHTMLEmbedded *eb, gpointer data)
-{
- EItipControl *itip = E_ITIP_CONTROL (data);
- ObjectRequestContext *context;
- EItipControlPrivate *priv;
- ECalComponentVType vtype;
- gboolean success;
-
- priv = itip->priv;
- vtype = e_cal_component_get_vtype (priv->comp);
-
- context = g_new0 (ObjectRequestContext, 1);
- context->itip = itip;
- context->eb = eb;
-
- switch (vtype) {
- case E_CAL_COMPONENT_EVENT:
- context->client = e_cal_new_from_uri ("", CALOBJ_TYPE_EVENT);
- success = start_default_server (itip, context->client, FALSE);
- break;
- case E_CAL_COMPONENT_TODO:
- context->client = e_cal_new_from_uri ("", CALOBJ_TYPE_TODO);
- success = start_default_server (itip, context->client, TRUE);
- break;
- default:
- g_free (context);
- return FALSE;
- }
-
- if (!success) {
- g_object_unref (context->client);
- g_free (context);
- return FALSE;
- }
-
- g_object_ref (itip);
-
- return TRUE;
-}
-
-static void
-ok_clicked_cb (GtkHTML *html, const gchar *method, const gchar *url, const gchar *encoding, gpointer data)
-{
- EItipControl *itip = E_ITIP_CONTROL (data);
- EItipControlPrivate *priv;
- gchar **fields;
- gboolean rsvp = FALSE, status = FALSE;
- int i;
-
- priv = itip->priv;
-
- fields = g_strsplit (encoding, "&", -1);
- for (i = 0; fields[i] != NULL; i++) {
- gchar **key_value;
-
- key_value = g_strsplit (fields[i], "=", 2);
-
- if (key_value[0] != NULL && !strcmp (key_value[0], "action")) {
- if (key_value[1] == NULL)
- break;
-
- switch (key_value[1][0]) {
- case 'U':
- update_item (itip);
- break;
- case 'A':
- status = change_status (priv->ical_comp, priv->my_address,
- ICAL_PARTSTAT_ACCEPTED);
- if (status) {
- e_cal_component_rescan (priv->comp);
- update_item (itip);
- }
- break;
- case 'T':
- status = change_status (priv->ical_comp, priv->my_address,
- ICAL_PARTSTAT_TENTATIVE);
- if (status) {
- e_cal_component_rescan (priv->comp);
- update_item (itip);
- }
- break;
- case 'D':
- status = change_status (priv->ical_comp, priv->my_address,
- ICAL_PARTSTAT_DECLINED);
- if (status) {
- e_cal_component_rescan (priv->comp);
- remove_item (itip);
- }
- break;
- case 'F':
- send_freebusy (itip);
- break;
- case 'R':
- /* FIXME Make sure this does the right thing in the backend */
- update_item (itip);
- break;
- case 'S':
- send_item (itip);
- break;
- case 'C':
- update_item (itip);
- break;
- }
- }
-
- if (key_value[0] != NULL && !strcmp (key_value[0], "rsvp"))
- if (*key_value[1] == '1')
- rsvp = TRUE;
-
- g_strfreev (key_value);
-
- }
- g_strfreev (fields);
-
- if (rsvp && status) {
- ECalComponent *comp = NULL;
- ECalComponentVType vtype;
- icalcomponent *ical_comp;
- icalproperty *prop;
- icalvalue *value;
- const char *attendee;
- GSList *l, *list = NULL;
-
- comp = e_cal_component_clone (priv->comp);
- if (comp == NULL)
- return;
- vtype = e_cal_component_get_vtype (comp);
-
- if (priv->my_address == NULL)
- find_my_address (itip, priv->ical_comp);
- g_assert (priv->my_address != NULL);
-
- ical_comp = e_cal_component_get_icalcomponent (comp);
-
- for (prop = icalcomponent_get_first_property (ical_comp, ICAL_ATTENDEE_PROPERTY);
- prop != NULL;
- prop = icalcomponent_get_next_property (ical_comp, ICAL_ATTENDEE_PROPERTY))
- {
- char *text;
-
- value = icalproperty_get_value (prop);
- if (!value)
- continue;
-
- attendee = icalvalue_get_string (value);
-
- text = g_strdup (itip_strip_mailto (attendee));
- text = g_strstrip (text);
- if (g_strcasecmp (priv->my_address, text))
- list = g_slist_prepend (list, prop);
- g_free (text);
- }
-
- for (l = list; l; l = l->next) {
- prop = l->data;
- icalcomponent_remove_property (ical_comp, prop);
- icalproperty_free (prop);
- }
- g_slist_free (list);
-
- e_cal_component_rescan (comp);
- switch (vtype) {
- case E_CAL_COMPONENT_EVENT:
- itip_send_comp (E_CAL_COMPONENT_METHOD_REPLY, comp,
- priv->event_client, priv->top_level);
- break;
- case E_CAL_COMPONENT_TODO:
- itip_send_comp (E_CAL_COMPONENT_METHOD_REPLY, comp,
- priv->task_client, priv->top_level);
- break;
- default:
- itip_send_comp (E_CAL_COMPONENT_METHOD_REPLY, comp, NULL, NULL);
- }
- g_object_unref (comp);
- }
-}
diff --git a/calendar/gui/e-itip-control.glade b/calendar/gui/e-itip-control.glade
deleted file mode 100644
index 344bcdeced..0000000000
--- a/calendar/gui/e-itip-control.glade
+++ /dev/null
@@ -1,493 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd" >
-
-<glade-interface>
- <widget class="GtkWindow" id="window1">
- <property name="visible">no</property>
- <property name="title" translatable="yes">window1</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="modal">no</property>
- <property name="allow_shrink">no</property>
- <property name="allow_grow">yes</property>
- <property name="window-position">GTK_WIN_POS_NONE</property>
-
- <child>
- <widget class="GtkFrame" id="main_frame">
- <property name="border_width">4</property>
- <property name="label" translatable="yes">Calendar Message</property>
- <property name="label_xalign">0</property>
- <property name="shadow">GTK_SHADOW_ETCHED_IN</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow1">
- <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
- <property name="vscrollbar_policy">GTK_POLICY_NEVER</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkViewport" id="viewport1">
- <property name="shadow_type">GTK_SHADOW_NONE</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkVBox" id="vbox1">
- <property name="homogeneous">no</property>
- <property name="spacing">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkTable" id="table1">
- <property name="border_width">3</property>
- <property name="homogeneous">no</property>
- <property name="row_spacing">3</property>
- <property name="column_spacing">3</property>
- <property name="n-rows">4</property>
- <property name="n-columns">2</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkEntry" id="organizer_entry">
- <property name="can_focus">yes</property>
- <property name="editable">no</property>
- <property name="text" translatable="yes"></property>
- <property name="max-length">0</property>
- <property name="visibility">yes</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">expand|fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="summary_entry">
- <property name="can_focus">yes</property>
- <property name="editable">no</property>
- <property name="text" translatable="yes"></property>
- <property name="max-length">0</property>
- <property name="visibility">yes</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">expand|fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow2">
- <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkTextView" id="description_box">
- <property name="can_focus">yes</property>
- <property name="editable">no</property>
- <property name="text" translatable="yes"></property>
- <property name="wrap_mode">GTK_WRAP_WORD</property>
- <property name="visible">yes</property>
- </widget>
- </child>
-
- <child internal-child="hscrollbar">
- <widget class="GtkHScrollbar" id="convertwidget3">
- <property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
- <property name="visible">yes</property>
- </widget>
- </child>
-
- <child internal-child="vscrollbar">
- <widget class="GtkVScrollbar" id="convertwidget4">
- <property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
- <property name="visible">yes</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment1">
- <property name="xalign">0</property>
- <property name="yalign">0</property>
- <property name="xscale">1</property>
- <property name="yscale">1</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkHBox" id="hbox1">
- <property name="homogeneous">no</property>
- <property name="spacing">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkLabel" id="dtstart_label">
- <property name="label" translatable="yes">date-start</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label3">
- <property name="label" translatable="yes">--to--</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0</property>
- <property name="xpad">19</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="dtend_label">
- <property name="label" translatable="yes">date-end</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">expand|fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label6">
- <property name="label" translatable="yes">Organizer:</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">no</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label7">
- <property name="label" translatable="yes">Date:</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">no</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label8">
- <property name="label" translatable="yes">Summary:</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">no</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label9">
- <property name="label" translatable="yes">Description:</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">no</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">6</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label12">
- <property name="label" translatable="yes">Server Message:</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">no</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xpad">3</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow3">
- <property name="border_width">3</property>
- <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <property name="width-request">365</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkTextView" id="message_text">
- <property name="can_focus">yes</property>
- <property name="editable">no</property>
- <property name="text" translatable="yes"></property>
- <property name="wrap_mode">GTK_WRAP_WORD</property>
- <property name="visible">yes</property>
- </widget>
- </child>
-
- <child internal-child="hscrollbar">
- <widget class="GtkHScrollbar" id="convertwidget5">
- <property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
- <property name="visible">yes</property>
- </widget>
- </child>
-
- <child internal-child="vscrollbar">
- <widget class="GtkVScrollbar" id="convertwidget6">
- <property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
- <property name="visible">yes</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">no</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="button_box">
- <property name="border_width">3</property>
- <property name="homogeneous">no</property>
- <property name="spacing">0</property>
- <property name="height-request">30</property>
- <property name="visible">yes</property>
-
- <child>
- <placeholder />
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
-
- <child internal-child="hscrollbar">
- <widget class="GtkHScrollbar" id="convertwidget1">
- <property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
- <property name="visible">yes</property>
- </widget>
- </child>
-
- <child internal-child="vscrollbar">
- <widget class="GtkVScrollbar" id="convertwidget2">
- <property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
- <property name="visible">yes</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <widget class="GtkWindow" id="loading_window">
- <property name="visible">no</property>
- <property name="title" translatable="yes">Loading Calendar</property>
- <property name="type">GTK_WINDOW_DIALOG</property>
- <property name="modal">no</property>
- <property name="allow_shrink">no</property>
- <property name="allow_grow">yes</property>
- <property name="window-position">GTK_WIN_POS_CENTER</property>
-
- <child>
- <widget class="GtkFrame" id="frame1">
- <property name="border_width">4</property>
- <property name="label" translatable="yes"></property>
- <property name="label_xalign">0</property>
- <property name="shadow">GTK_SHADOW_ETCHED_OUT</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkVBox" id="vbox2">
- <property name="border_width">7</property>
- <property name="homogeneous">no</property>
- <property name="spacing">1</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkHBox" id="hbox2">
- <property name="border_width">6</property>
- <property name="homogeneous">no</property>
- <property name="spacing">9</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkLabel" id="label10">
- <property name="label" translatable="yes">Loading calendar...</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkProgressBar" id="loading_progress">
- <property name="bar_style">GTK_PROGRESS_CONTINUOUS</property>
- <property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property>
- <property name="activity_mode">no</property>
- <property name="show_text">no</property>
- <property name="format" translatable="yes">%P %%</property>
- <property name="text_xalign">0.5</property>
- <property name="text_yalign">0.5</property>
- <property name="visible">yes</property>
- <property name="adjustment">0 0 100 1 10 10</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
-</glade-interface>
diff --git a/calendar/gui/e-itip-control.h b/calendar/gui/e-itip-control.h
deleted file mode 100644
index 12ddf7354e..0000000000
--- a/calendar/gui/e-itip-control.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* e-itip-control.h
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: JP Rosevear
- */
-
-#ifndef _E_ITIP_CONTROL_H_
-#define _E_ITIP_CONTROL_H_
-
-#include <gtk/gtk.h>
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#define E_TYPE_ITIP_CONTROL (e_itip_control_get_type ())
-#define E_ITIP_CONTROL(obj) (GTK_CHECK_CAST ((obj), E_TYPE_ITIP_CONTROL, EItipControl))
-#define E_ITIP_CONTROL_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_TYPE_ITIP_CONTROL, EItipControlClass))
-#define E_IS_ITIP_CONTROL(obj) (GTK_CHECK_TYPE ((obj), E_TYPE_ITIP_CONTROL))
-#define E_IS_ITIP_CONTROL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_TYPE_ITIP_CONTROL))
-
-
-typedef struct _EItipControl EItipControl;
-typedef struct _EItipControlPrivate EItipControlPrivate;
-typedef struct _EItipControlClass EItipControlClass;
-
-struct _EItipControl {
- GtkVBox parent;
-
- EItipControlPrivate *priv;
-};
-
-struct _EItipControlClass {
- GtkVBoxClass parent_class;
-};
-
-
-
-GtkType e_itip_control_get_type (void);
-GtkWidget * e_itip_control_new (void);
-void e_itip_control_set_data (EItipControl *itip,
- const gchar *text);
-gchar * e_itip_control_get_data (EItipControl *itip);
-gint e_itip_control_get_data_size (EItipControl *itip);
-void e_itip_control_set_from_address (EItipControl *itip,
- const gchar *address);
-const gchar *e_itip_control_get_from_address (EItipControl *itip);
-void e_itip_control_set_view_only (EItipControl *itip,
- gboolean view_only);
-gboolean e_itip_control_get_view_only (EItipControl *itip);
-void e_itip_control_set_delegator_address (EItipControl *itip,
- const gchar *address);
-const gchar *e_itip_control_get_delegator_address (EItipControl *itip);
-void e_itip_control_set_delegator_name (EItipControl *itip,
- const gchar *name);
-const gchar *e_itip_control_get_delegator_name (EItipControl *itip);
-void e_itip_control_set_calendar_uri (EItipControl *itip,
- const gchar *uri);
-const gchar *e_itip_control_get_calendar_uri (EItipControl *itip);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _E_ITIP_CONTROL_H_ */
diff --git a/calendar/gui/e-meeting-attendee.c b/calendar/gui/e-meeting-attendee.c
deleted file mode 100644
index 474cf7b1a4..0000000000
--- a/calendar/gui/e-meeting-attendee.c
+++ /dev/null
@@ -1,1000 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* e-attendee.c
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: JP Rosevear
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdlib.h>
-#include <gtk/gtk.h>
-#include <gal/util/e-util.h>
-#include "e-meeting-attendee.h"
-
-struct _EMeetingAttendeePrivate {
- gchar *address;
- gchar *member;
-
- icalparameter_cutype cutype;
- icalparameter_role role;
-
- gboolean rsvp;
-
- gchar *delto;
- gchar *delfrom;
-
- icalparameter_partstat status;
-
- gchar *sentby;
- gchar *cn;
- gchar *language;
-
- EMeetingAttendeeEditLevel edit_level;
-
- gboolean has_calendar_info;
-
- GArray *busy_periods;
- gboolean busy_periods_sorted;
-
- EMeetingTime busy_periods_start;
- EMeetingTime busy_periods_end;
- gboolean start_busy_range_set;
- gboolean end_busy_range_set;
-
- gint longest_period_in_days;
-};
-
-enum {
- CHANGED,
- LAST_SIGNAL
-};
-static guint signals[LAST_SIGNAL];
-
-static void class_init (EMeetingAttendeeClass *klass);
-static void init (EMeetingAttendee *ia);
-static void finalize (GObject *obj);
-
-
-static GObjectClass *parent_class = NULL;
-
-E_MAKE_TYPE (e_meeting_attendee, "EMeetingAttendee", EMeetingAttendee,
- class_init, init, G_TYPE_OBJECT);
-
-static void
-class_init (EMeetingAttendeeClass *klass)
-{
- GObjectClass *object_class;
-
- object_class = G_OBJECT_CLASS (klass);
- parent_class = g_type_class_peek_parent (klass);
-
- signals[CHANGED] =
- g_signal_new ("changed",
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EMeetingAttendeeClass, changed),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- object_class->finalize = finalize;
-}
-
-static gchar *
-string_test (gchar *string)
-{
- return string != NULL ? string : g_strdup ("");
-}
-
-static gboolean
-string_is_set (gchar *string)
-{
- if (string != NULL && *string != '\0')
- return TRUE;
-
- return FALSE;
-}
-
-static void
-notify_changed (EMeetingAttendee *ia)
-{
- g_signal_emit_by_name (G_OBJECT (ia), "changed");
-}
-
-static void
-init (EMeetingAttendee *ia)
-{
- EMeetingAttendeePrivate *priv;
-
- priv = g_new0 (EMeetingAttendeePrivate, 1);
-
- ia->priv = priv;
-
- priv->address = string_test (NULL);
- priv->member = string_test (NULL);
-
- priv->cutype = ICAL_CUTYPE_NONE;
- priv->role = ICAL_ROLE_NONE;
-
- priv->rsvp = FALSE;
-
- priv->delto = string_test (NULL);
- priv->delfrom = string_test (NULL);
-
- priv->status = ICAL_PARTSTAT_NONE;
-
- priv->sentby = string_test (NULL);
- priv->cn = string_test (NULL);
- priv->language = string_test (NULL);
-
- priv->edit_level = E_MEETING_ATTENDEE_EDIT_FULL;
- priv->has_calendar_info = FALSE;
-
- priv->busy_periods = g_array_new (FALSE, FALSE, sizeof (EMeetingFreeBusyPeriod));
- priv->busy_periods_sorted = FALSE;
-
- g_date_clear (&priv->busy_periods_start.date, 1);
- priv->busy_periods_start.hour = 0;
- priv->busy_periods_start.minute = 0;
-
- g_date_clear (&priv->busy_periods_end.date, 1);
- priv->busy_periods_end.hour = 0;
- priv->busy_periods_end.minute = 0;
-
- priv->start_busy_range_set = FALSE;
- priv->end_busy_range_set = FALSE;
-
- priv->longest_period_in_days = 0;
-}
-
-
-static void
-finalize (GObject *obj)
-{
- EMeetingAttendee *ia = E_MEETING_ATTENDEE (obj);
- EMeetingAttendeePrivate *priv;
-
- priv = ia->priv;
-
- g_free (priv->address);
- g_free (priv->member);
-
- g_free (priv->delto);
- g_free (priv->delfrom);
-
- g_free (priv->sentby);
- g_free (priv->cn);
- g_free (priv->language);
-
- g_array_free (priv->busy_periods, TRUE);
-
- g_free (priv);
-
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (obj);
-}
-
-GObject *
-e_meeting_attendee_new (void)
-{
- return g_object_new (E_TYPE_MEETING_ATTENDEE, NULL);
-}
-
-GObject *
-e_meeting_attendee_new_from_e_cal_component_attendee (ECalComponentAttendee *ca)
-{
- EMeetingAttendee *ia;
-
- ia = E_MEETING_ATTENDEE (g_object_new (E_TYPE_MEETING_ATTENDEE, NULL));
-
- e_meeting_attendee_set_address (ia, g_strdup (ca->value));
- e_meeting_attendee_set_member (ia, g_strdup (ca->member));
- e_meeting_attendee_set_cutype (ia, ca->cutype);
- e_meeting_attendee_set_role (ia, ca->role);
- e_meeting_attendee_set_status (ia, ca->status);
- e_meeting_attendee_set_rsvp (ia, ca->rsvp);
- e_meeting_attendee_set_delto (ia, g_strdup (ca->delto));
- e_meeting_attendee_set_delfrom (ia, g_strdup (ca->delfrom));
- e_meeting_attendee_set_sentby (ia, g_strdup (ca->sentby));
- e_meeting_attendee_set_cn (ia, g_strdup (ca->cn));
- e_meeting_attendee_set_language (ia, g_strdup (ca->language));
-
- return G_OBJECT (ia);
-}
-
-ECalComponentAttendee *
-e_meeting_attendee_as_e_cal_component_attendee (EMeetingAttendee *ia)
-{
- EMeetingAttendeePrivate *priv;
- ECalComponentAttendee *ca;
-
- priv = ia->priv;
-
- ca = g_new0 (ECalComponentAttendee, 1);
-
- ca->value = priv->address;
- ca->member = string_is_set (priv->member) ? priv->member : NULL;
- ca->cutype= priv->cutype;
- ca->role = priv->role;
- ca->status = priv->status;
- ca->rsvp = priv->rsvp;
- ca->delto = string_is_set (priv->delto) ? priv->delto : NULL;
- ca->delfrom = string_is_set (priv->delfrom) ? priv->delfrom : NULL;
- ca->sentby = string_is_set (priv->sentby) ? priv->sentby : NULL;
- ca->cn = string_is_set (priv->cn) ? priv->cn : NULL;
- ca->language = string_is_set (priv->language) ? priv->language : NULL;
-
- return ca;
-}
-
-
-const gchar *
-e_meeting_attendee_get_address (EMeetingAttendee *ia)
-{
- EMeetingAttendeePrivate *priv;
-
- priv = ia->priv;
-
- return priv->address;
-}
-
-void
-e_meeting_attendee_set_address (EMeetingAttendee *ia, gchar *address)
-{
- EMeetingAttendeePrivate *priv;
-
- priv = ia->priv;
-
- if (priv->address != NULL)
- g_free (priv->address);
-
- priv->address = string_test (address);
-
- notify_changed (ia);
-}
-
-gboolean
-e_meeting_attendee_is_set_address (EMeetingAttendee *ia)
-{
- EMeetingAttendeePrivate *priv;
-
- priv = ia->priv;
-
- return string_is_set (priv->address);
-}
-
-const gchar *
-e_meeting_attendee_get_member (EMeetingAttendee *ia)
-{
- EMeetingAttendeePrivate *priv;
-
- priv = ia->priv;
-
- return priv->member;
-}
-
-void
-e_meeting_attendee_set_member (EMeetingAttendee *ia, gchar *member)
-{
- EMeetingAttendeePrivate *priv;
-
- priv = ia->priv;
-
- if (priv->member != NULL)
- g_free (priv->member);
-
- priv->member = string_test (member);
-
- notify_changed (ia);
-}
-
-gboolean
-e_meeting_attendee_is_set_member (EMeetingAttendee *ia)
-{
- EMeetingAttendeePrivate *priv;
-
- priv = ia->priv;
-
- return string_is_set (priv->member);
-}
-
-icalparameter_cutype
-e_meeting_attendee_get_cutype (EMeetingAttendee *ia)
-{
- EMeetingAttendeePrivate *priv;
-
- priv = ia->priv;
-
- return priv->cutype;
-}
-
-void
-e_meeting_attendee_set_cutype (EMeetingAttendee *ia, icalparameter_cutype cutype)
-{
- EMeetingAttendeePrivate *priv;
-
- priv = ia->priv;
-
- priv->cutype = cutype;
-
- notify_changed (ia);
-}
-
-icalparameter_role
-e_meeting_attendee_get_role (EMeetingAttendee *ia)
-{
- EMeetingAttendeePrivate *priv;
-
- priv = ia->priv;
-
- return priv->role;
-}
-
-void
-e_meeting_attendee_set_role (EMeetingAttendee *ia, icalparameter_role role)
-{
- EMeetingAttendeePrivate *priv;
-
- priv = ia->priv;
-
- priv->role = role;
-
- notify_changed (ia);
-}
-
-gboolean
-e_meeting_attendee_get_rsvp (EMeetingAttendee *ia)
-{
- EMeetingAttendeePrivate *priv;
-
- priv = ia->priv;
-
- return priv->rsvp;
-}
-
-void
-e_meeting_attendee_set_rsvp (EMeetingAttendee *ia, gboolean rsvp)
-{
- EMeetingAttendeePrivate *priv;
-
- priv = ia->priv;
-
- priv->rsvp = rsvp;
-
- notify_changed (ia);
-}
-
-const gchar *
-e_meeting_attendee_get_delto (EMeetingAttendee *ia)
-{
- EMeetingAttendeePrivate *priv;
-
- priv = ia->priv;
-
- return priv->delto;
-}
-
-void
-e_meeting_attendee_set_delto (EMeetingAttendee *ia, gchar *delto)
-{
- EMeetingAttendeePrivate *priv;
-
- priv = ia->priv;
-
- if (priv->delto != NULL)
- g_free (priv->delto);
-
- priv->delto = string_test (delto);
-
- notify_changed (ia);
-}
-
-gboolean
-e_meeting_attendee_is_set_delto (EMeetingAttendee *ia)
-{
- EMeetingAttendeePrivate *priv;
-
- priv = ia->priv;
-
- return string_is_set (priv->delto);
-}
-
-const gchar *
-e_meeting_attendee_get_delfrom (EMeetingAttendee *ia)
-{
- EMeetingAttendeePrivate *priv;
-
- priv = ia->priv;
-
- return priv->delfrom;
-}
-
-void
-e_meeting_attendee_set_delfrom (EMeetingAttendee *ia, gchar *delfrom)
-{
- EMeetingAttendeePrivate *priv;
-
- priv = ia->priv;
-
- if (priv->delfrom != NULL)
- g_free (priv->delfrom);
-
- priv->delfrom = string_test (delfrom);
-
- notify_changed (ia);
-}
-
-gboolean
-e_meeting_attendee_is_set_delfrom (EMeetingAttendee *ia)
-{
- EMeetingAttendeePrivate *priv;
-
- priv = ia->priv;
-
- return string_is_set (priv->delfrom);
-}
-
-icalparameter_partstat
-e_meeting_attendee_get_status (EMeetingAttendee *ia)
-{
- EMeetingAttendeePrivate *priv;
-
- priv = ia->priv;
-
- return priv->status;
-}
-
-void
-e_meeting_attendee_set_status (EMeetingAttendee *ia, icalparameter_partstat status)
-{
- EMeetingAttendeePrivate *priv;
-
- priv = ia->priv;
-
- priv->status = status;
-
- notify_changed (ia);
-}
-
-const gchar *
-e_meeting_attendee_get_sentby (EMeetingAttendee *ia)
-{
- EMeetingAttendeePrivate *priv;
-
- priv = ia->priv;
-
- return priv->sentby;
-}
-
-void
-e_meeting_attendee_set_sentby (EMeetingAttendee *ia, gchar *sentby)
-{
- EMeetingAttendeePrivate *priv;
-
- priv = ia->priv;
-
- if (priv->sentby != NULL)
- g_free (priv->sentby);
-
- priv->sentby = string_test (sentby);
-
- notify_changed (ia);
-}
-
-gboolean
-e_meeting_attendee_is_set_sentby (EMeetingAttendee *ia)
-{
- EMeetingAttendeePrivate *priv;
-
- priv = ia->priv;
-
- return string_is_set (priv->sentby);
-}
-
-const gchar *
-e_meeting_attendee_get_cn (EMeetingAttendee *ia)
-{
- EMeetingAttendeePrivate *priv;
-
- priv = ia->priv;
-
- return priv->cn;
-}
-
-void
-e_meeting_attendee_set_cn (EMeetingAttendee *ia, gchar *cn)
-{
- EMeetingAttendeePrivate *priv;
-
- priv = ia->priv;
-
- if (priv->cn != NULL)
- g_free (priv->cn);
-
- priv->cn = string_test (cn);
-
- notify_changed (ia);
-}
-
-gboolean
-e_meeting_attendee_is_set_cn (EMeetingAttendee *ia)
-{
- EMeetingAttendeePrivate *priv;
-
- priv = ia->priv;
-
- return string_is_set (priv->cn);
-}
-
-const gchar *
-e_meeting_attendee_get_language (EMeetingAttendee *ia)
-{
- EMeetingAttendeePrivate *priv;
-
- priv = ia->priv;
-
- return priv->language;
-}
-
-void
-e_meeting_attendee_set_language (EMeetingAttendee *ia, gchar *language)
-{
- EMeetingAttendeePrivate *priv;
-
- priv = ia->priv;
-
- if (priv->language != NULL)
- g_free (priv->language);
-
- priv->language = string_test (language);
-
- notify_changed (ia);
-}
-
-gboolean
-e_meeting_attendee_is_set_language (EMeetingAttendee *ia)
-{
- EMeetingAttendeePrivate *priv;
-
- priv = ia->priv;
-
- return string_is_set (priv->language);
-}
-
-EMeetingAttendeeType
-e_meeting_attendee_get_atype (EMeetingAttendee *ia)
-{
- EMeetingAttendeePrivate *priv;
-
- priv = ia->priv;
-
- if (priv->cutype == ICAL_CUTYPE_ROOM
- || priv->cutype == ICAL_CUTYPE_RESOURCE)
- return E_MEETING_ATTENDEE_RESOURCE;
-
- if (priv->role == ICAL_ROLE_CHAIR
- || priv->role == ICAL_ROLE_REQPARTICIPANT)
- return E_MEETING_ATTENDEE_REQUIRED_PERSON;
-
- return E_MEETING_ATTENDEE_OPTIONAL_PERSON;
-}
-
-
-EMeetingAttendeeEditLevel
-e_meeting_attendee_get_edit_level (EMeetingAttendee *ia)
-{
- EMeetingAttendeePrivate *priv;
-
- g_return_val_if_fail (ia != NULL, E_MEETING_ATTENDEE_EDIT_NONE);
- g_return_val_if_fail (E_IS_MEETING_ATTENDEE (ia), E_MEETING_ATTENDEE_EDIT_NONE);
-
- priv = ia->priv;
-
- return priv->edit_level;
-}
-
-void
-e_meeting_attendee_set_edit_level (EMeetingAttendee *ia, EMeetingAttendeeEditLevel level)
-{
- EMeetingAttendeePrivate *priv;
-
- g_return_if_fail (ia != NULL);
- g_return_if_fail (E_IS_MEETING_ATTENDEE (ia));
-
- priv = ia->priv;
-
- priv->edit_level = level;
-}
-
-
-static gint
-compare_times (EMeetingTime *time1,
- EMeetingTime *time2)
-{
- gint day_comparison;
-
- day_comparison = g_date_compare (&time1->date,
- &time2->date);
- if (day_comparison != 0)
- return day_comparison;
-
- if (time1->hour < time2->hour)
- return -1;
- if (time1->hour > time2->hour)
- return 1;
-
- if (time1->minute < time2->minute)
- return -1;
- if (time1->minute > time2->minute)
- return 1;
-
- /* The start times are exactly the same. */
- return 0;
-}
-
-static gint
-compare_period_starts (const void *arg1,
- const void *arg2)
-{
- EMeetingFreeBusyPeriod *period1, *period2;
-
- period1 = (EMeetingFreeBusyPeriod *) arg1;
- period2 = (EMeetingFreeBusyPeriod *) arg2;
-
- return compare_times (&period1->start, &period2->start);
-}
-
-static void
-ensure_periods_sorted (EMeetingAttendee *ia)
-{
- EMeetingAttendeePrivate *priv;
-
- priv = ia->priv;
-
- if (priv->busy_periods_sorted)
- return;
-
- qsort (priv->busy_periods->data, priv->busy_periods->len,
- sizeof (EMeetingFreeBusyPeriod),
- compare_period_starts);
-
- priv->busy_periods_sorted = TRUE;
-}
-
-gboolean
-e_meeting_attendee_get_has_calendar_info (EMeetingAttendee *ia)
-{
- EMeetingAttendeePrivate *priv;
-
- priv = ia->priv;
-
- return priv->has_calendar_info;
-}
-
-void
-e_meeting_attendee_set_has_calendar_info (EMeetingAttendee *ia, gboolean has_calendar_info)
-{
- EMeetingAttendeePrivate *priv;
-
- priv = ia->priv;
-
- priv->has_calendar_info = has_calendar_info;
-}
-
-const GArray *
-e_meeting_attendee_get_busy_periods (EMeetingAttendee *ia)
-{
- EMeetingAttendeePrivate *priv;
-
- priv = ia->priv;
-
- ensure_periods_sorted (ia);
-
- return priv->busy_periods;
-}
-
-gint
-e_meeting_attendee_find_first_busy_period (EMeetingAttendee *ia, GDate *date)
-{
- EMeetingAttendeePrivate *priv;
- EMeetingFreeBusyPeriod *period;
- gint lower, upper, middle = 0, cmp = 0;
- GDate tmp_date;
-
- priv = ia->priv;
-
- /* Make sure the busy periods have been sorted. */
- ensure_periods_sorted (ia);
-
- /* Calculate the first day which could have a busy period which
- continues onto our given date. */
- tmp_date = *date;
- g_date_subtract_days (&tmp_date, priv->longest_period_in_days);
-
- /* We want the first busy period which starts on tmp_date. */
- lower = 0;
- upper = priv->busy_periods->len;
-
- if (upper == 0)
- return -1;
-
- while (lower < upper) {
- middle = (lower + upper) >> 1;
-
- period = &g_array_index (priv->busy_periods,
- EMeetingFreeBusyPeriod, middle);
-
- cmp = g_date_compare (&tmp_date, &period->start.date);
-
- if (cmp == 0)
- break;
- else if (cmp < 0)
- upper = middle;
- else
- lower = middle + 1;
- }
-
- /* There may be several busy periods on the same day so we step
- backwards to the first one. */
- if (cmp == 0) {
- while (middle > 0) {
- period = &g_array_index (priv->busy_periods,
- EMeetingFreeBusyPeriod, middle - 1);
- if (g_date_compare (&tmp_date, &period->start.date) != 0)
- break;
- middle--;
- }
- } else if (cmp > 0) {
- /* This means we couldn't find a period on the given day, and
- the last one we looked at was before it, so if there are
- any more periods after this one we return it. */
- middle++;
- if (priv->busy_periods->len <= middle)
- return -1;
- }
-
- return middle;
-}
-
-gboolean
-e_meeting_attendee_add_busy_period (EMeetingAttendee *ia,
- gint start_year,
- gint start_month,
- gint start_day,
- gint start_hour,
- gint start_minute,
- gint end_year,
- gint end_month,
- gint end_day,
- gint end_hour,
- gint end_minute,
- EMeetingFreeBusyType busy_type)
-{
- EMeetingAttendeePrivate *priv;
- EMeetingFreeBusyPeriod period;
- gint period_in_days;
-
- g_return_val_if_fail (ia != NULL, FALSE);
- g_return_val_if_fail (E_IS_MEETING_ATTENDEE (ia), FALSE);
- g_return_val_if_fail (busy_type >= 0, FALSE);
- g_return_val_if_fail (busy_type < E_MEETING_FREE_BUSY_LAST, FALSE);
-
- priv = ia->priv;
-
- /* Check the dates are valid. */
- if (!g_date_valid_dmy (start_day, start_month, start_year))
- return FALSE;
- if (!g_date_valid_dmy (end_day, end_month, end_year))
- return FALSE;
- if (start_hour < 0 || start_hour > 23)
- return FALSE;
- if (end_hour < 0 || end_hour > 23)
- return FALSE;
- if (start_minute < 0 || start_minute > 59)
- return FALSE;
- if (end_minute < 0 || end_minute > 59)
- return FALSE;
-
- g_date_clear (&period.start.date, 1);
- g_date_clear (&period.end.date, 1);
- g_date_set_dmy (&period.start.date, start_day, start_month, start_year);
- g_date_set_dmy (&period.end.date, end_day, end_month, end_year);
- period.start.hour = start_hour;
- period.start.minute = start_minute;
- period.end.hour = end_hour;
- period.end.minute = end_minute;
- period.busy_type = busy_type;
-
- /* Check that the start time is before or equal to the end time. */
- if (compare_times (&period.start, &period.end) > 0)
- return FALSE;
-
- /* If the busy range is not set elsewhere, track it as best we can */
- if (!priv->start_busy_range_set) {
- if (!g_date_valid (&priv->busy_periods_start.date)) {
- priv->busy_periods_start.date = period.start.date;
- priv->busy_periods_start.hour = period.start.hour;
- priv->busy_periods_start.minute = period.start.minute;
- } else {
- switch (g_date_compare (&period.start.date, &priv->busy_periods_start.date)) {
- case -1:
- priv->busy_periods_start.date = period.start.date;
- priv->busy_periods_start.hour = period.start.hour;
- priv->busy_periods_start.minute = period.start.minute;
- break;
- case 0:
- if (period.start.hour < priv->busy_periods_start.hour
- || (period.start.hour == priv->busy_periods_start.hour
- && period.start.minute < priv->busy_periods_start.minute)) {
- priv->busy_periods_start.date = period.start.date;
- priv->busy_periods_start.hour = period.start.hour;
- priv->busy_periods_start.minute = period.start.minute;
- break;
- }
- break;
- }
- }
- }
- if (!priv->end_busy_range_set) {
- if (!g_date_valid (&priv->busy_periods_end.date)) {
- priv->busy_periods_end.date = period.end.date;
- priv->busy_periods_end.hour = period.end.hour;
- priv->busy_periods_end.minute = period.end.minute;
- } else {
- switch (g_date_compare (&period.end.date, &priv->busy_periods_end.date)) {
- case 0:
- if (period.end.hour > priv->busy_periods_end.hour
- || (period.end.hour == priv->busy_periods_end.hour
- && period.end.minute > priv->busy_periods_end.minute)) {
- priv->busy_periods_end.date = period.end.date;
- priv->busy_periods_end.hour = period.end.hour;
- priv->busy_periods_end.minute = period.end.minute;
- break;
- }
- break;
- case 1:
- priv->busy_periods_end.date = period.end.date;
- priv->busy_periods_end.hour = period.end.hour;
- priv->busy_periods_end.minute = period.end.minute;
- break;
- }
- }
- }
-
- g_array_append_val (priv->busy_periods, period);
- priv->has_calendar_info = TRUE;
- priv->busy_periods_sorted = FALSE;
-
- period_in_days = g_date_julian (&period.end.date) - g_date_julian (&period.start.date) + 1;
- priv->longest_period_in_days = MAX (priv->longest_period_in_days, period_in_days);
-
- return TRUE;
-}
-
-EMeetingTime
-e_meeting_attendee_get_start_busy_range (EMeetingAttendee *ia)
-{
- EMeetingAttendeePrivate *priv;
-
- priv = ia->priv;
-
- return priv->busy_periods_start;
-}
-
-EMeetingTime
-e_meeting_attendee_get_end_busy_range (EMeetingAttendee *ia)
-{
- EMeetingAttendeePrivate *priv;
-
- priv = ia->priv;
-
- return priv->busy_periods_end;
-}
-
-gboolean
-e_meeting_attendee_set_start_busy_range (EMeetingAttendee *ia,
- gint start_year,
- gint start_month,
- gint start_day,
- gint start_hour,
- gint start_minute)
-{
- EMeetingAttendeePrivate *priv;
-
- g_return_val_if_fail (E_IS_MEETING_ATTENDEE (ia), FALSE);
-
- priv = ia->priv;
-
- /* Check the dates are valid. */
- if (!g_date_valid_dmy (start_day, start_month, start_year))
- return FALSE;
- if (start_hour < 0 || start_hour > 23)
- return FALSE;
- if (start_minute < 0 || start_minute > 59)
- return FALSE;
-
- g_date_clear (&priv->busy_periods_start.date, 1);
- g_date_set_dmy (&priv->busy_periods_start.date,
- start_day, start_month, start_year);
- priv->busy_periods_start.hour = start_hour;
- priv->busy_periods_start.minute = start_minute;
-
- priv->start_busy_range_set = TRUE;
-
- return TRUE;
-}
-
-gboolean
-e_meeting_attendee_set_end_busy_range (EMeetingAttendee *ia,
- gint end_year,
- gint end_month,
- gint end_day,
- gint end_hour,
- gint end_minute)
-{
- EMeetingAttendeePrivate *priv;
-
- g_return_val_if_fail (E_IS_MEETING_ATTENDEE (ia), FALSE);
-
- priv = ia->priv;
-
- /* Check the dates are valid. */
- if (!g_date_valid_dmy (end_day, end_month, end_year))
- return FALSE;
- if (end_hour < 0 || end_hour > 23)
- return FALSE;
- if (end_minute < 0 || end_minute > 59)
- return FALSE;
-
- g_date_clear (&priv->busy_periods_end.date, 1);
- g_date_set_dmy (&priv->busy_periods_end.date,
- end_day, end_month, end_year);
- priv->busy_periods_end.hour = end_hour;
- priv->busy_periods_end.minute = end_minute;
-
- priv->end_busy_range_set = TRUE;
-
- return TRUE;
-}
-
-/* Clears all busy times for the given attendee. */
-void
-e_meeting_attendee_clear_busy_periods (EMeetingAttendee *ia)
-{
- EMeetingAttendeePrivate *priv;
-
- g_return_if_fail (E_IS_MEETING_ATTENDEE (ia));
-
- priv = ia->priv;
-
- g_array_set_size (priv->busy_periods, 0);
- priv->busy_periods_sorted = TRUE;
-
- g_date_clear (&priv->busy_periods_start.date, 1);
- priv->busy_periods_start.hour = 0;
- priv->busy_periods_start.minute = 0;
-
- g_date_clear (&priv->busy_periods_end.date, 1);
- priv->busy_periods_end.hour = 0;
- priv->busy_periods_end.minute = 0;
-
- priv->longest_period_in_days = 0;
-}
diff --git a/calendar/gui/e-meeting-attendee.h b/calendar/gui/e-meeting-attendee.h
deleted file mode 100644
index 42c5e13c2e..0000000000
--- a/calendar/gui/e-meeting-attendee.h
+++ /dev/null
@@ -1,172 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* e-meeting_attendee.h
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: JP Rosevear
- */
-
-#ifndef _E_MEETING_ATTENDEE_H_
-#define _E_MEETING_ATTENDEE_H_
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <gtk/gtk.h>
-#include <libecal/e-cal-component.h>
-#include "e-meeting-types.h"
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#define E_TYPE_MEETING_ATTENDEE (e_meeting_attendee_get_type ())
-#define E_MEETING_ATTENDEE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_MEETING_ATTENDEE, EMeetingAttendee))
-#define E_MEETING_ATTENDEE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_MEETING_ATTENDEE, EMeetingAttendeeClass))
-#define E_IS_MEETING_ATTENDEE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_MEETING_ATTENDEE))
-#define E_IS_MEETING_ATTENDEE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_MEETING_ATTENDEE))
-
-
-typedef struct _EMeetingAttendee EMeetingAttendee;
-typedef struct _EMeetingAttendeePrivate EMeetingAttendeePrivate;
-typedef struct _EMeetingAttendeeClass EMeetingAttendeeClass;
-
-/* These specify the type of attendee. Either a person or a resource (e.g. a
- meeting room). These are used for the Autopick options, where the user can
- ask for a time when, for example, all people and one resource are free.
- The default is E_MEETING_ATTENDEE_REQUIRED_PERSON. */
-typedef enum
-{
- E_MEETING_ATTENDEE_REQUIRED_PERSON,
- E_MEETING_ATTENDEE_OPTIONAL_PERSON,
- E_MEETING_ATTENDEE_RESOURCE
-} EMeetingAttendeeType;
-
-typedef enum
-{
- E_MEETING_ATTENDEE_EDIT_FULL,
- E_MEETING_ATTENDEE_EDIT_STATUS,
- E_MEETING_ATTENDEE_EDIT_NONE
-} EMeetingAttendeeEditLevel;
-
-struct _EMeetingAttendee {
- GtkObject parent;
-
- EMeetingAttendeePrivate *priv;
-};
-
-struct _EMeetingAttendeeClass {
- GtkObjectClass parent_class;
-
- void (* changed) (EMeetingAttendee *ia);
-};
-
-
-GType e_meeting_attendee_get_type (void);
-GObject *e_meeting_attendee_new (void);
-GObject *e_meeting_attendee_new_from_e_cal_component_attendee (ECalComponentAttendee *ca);
-
-ECalComponentAttendee *e_meeting_attendee_as_e_cal_component_attendee (EMeetingAttendee *ia);
-
-const gchar *e_meeting_attendee_get_address (EMeetingAttendee *ia);
-void e_meeting_attendee_set_address (EMeetingAttendee *ia, gchar *address);
-gboolean e_meeting_attendee_is_set_address (EMeetingAttendee *ia);
-
-const gchar *e_meeting_attendee_get_member (EMeetingAttendee *ia);
-void e_meeting_attendee_set_member (EMeetingAttendee *ia, gchar *member);
-gboolean e_meeting_attendee_is_set_member (EMeetingAttendee *ia);
-
-icalparameter_cutype e_meeting_attendee_get_cutype (EMeetingAttendee *ia);
-void e_meeting_attendee_set_cutype (EMeetingAttendee *ia, icalparameter_cutype cutype);
-
-icalparameter_role e_meeting_attendee_get_role (EMeetingAttendee *ia);
-void e_meeting_attendee_set_role (EMeetingAttendee *ia, icalparameter_role role);
-
-gboolean e_meeting_attendee_get_rsvp (EMeetingAttendee *ia);
-void e_meeting_attendee_set_rsvp (EMeetingAttendee *ia, gboolean rsvp);
-
-const gchar *e_meeting_attendee_get_delto (EMeetingAttendee *ia);
-void e_meeting_attendee_set_delto (EMeetingAttendee *ia, gchar *delto);
-gboolean e_meeting_attendee_is_set_delto (EMeetingAttendee *ia);
-
-const gchar *e_meeting_attendee_get_delfrom (EMeetingAttendee *ia);
-void e_meeting_attendee_set_delfrom (EMeetingAttendee *ia, gchar *delfrom);
-gboolean e_meeting_attendee_is_set_delfrom (EMeetingAttendee *ia);
-
-icalparameter_partstat e_meeting_attendee_get_status (EMeetingAttendee *ia);
-void e_meeting_attendee_set_status (EMeetingAttendee *ia, icalparameter_partstat status);
-
-const gchar *e_meeting_attendee_get_sentby (EMeetingAttendee *ia);
-void e_meeting_attendee_set_sentby (EMeetingAttendee *ia, gchar *sentby);
-gboolean e_meeting_attendee_is_set_sentby (EMeetingAttendee *ia);
-
-const gchar *e_meeting_attendee_get_cn (EMeetingAttendee *ia);
-void e_meeting_attendee_set_cn (EMeetingAttendee *ia, gchar *cn);
-gboolean e_meeting_attendee_is_set_cn (EMeetingAttendee *ia);
-
-const gchar *e_meeting_attendee_get_language (EMeetingAttendee *ia);
-void e_meeting_attendee_set_language (EMeetingAttendee *ia, gchar *language);
-gboolean e_meeting_attendee_is_set_language (EMeetingAttendee *ia);
-
-EMeetingAttendeeType e_meeting_attendee_get_atype (EMeetingAttendee *ia);
-
-EMeetingAttendeeEditLevel e_meeting_attendee_get_edit_level (EMeetingAttendee *ia);
-void e_meeting_attendee_set_edit_level (EMeetingAttendee *ia, EMeetingAttendeeEditLevel level);
-
-gboolean e_meeting_attendee_get_has_calendar_info (EMeetingAttendee *ia);
-void e_meeting_attendee_set_has_calendar_info (EMeetingAttendee *ia, gboolean has_calendar_info);
-
-const GArray *e_meeting_attendee_get_busy_periods (EMeetingAttendee *ia);
-gint e_meeting_attendee_find_first_busy_period (EMeetingAttendee *ia, GDate *date);
-gboolean e_meeting_attendee_add_busy_period (EMeetingAttendee *ia,
- gint start_year,
- gint start_month,
- gint start_day,
- gint start_hour,
- gint start_minute,
- gint end_year,
- gint end_month,
- gint end_day,
- gint end_hour,
- gint end_minute,
- EMeetingFreeBusyType busy_type);
-
-EMeetingTime e_meeting_attendee_get_start_busy_range (EMeetingAttendee *ia);
-EMeetingTime e_meeting_attendee_get_end_busy_range (EMeetingAttendee *ia);
-
-gboolean e_meeting_attendee_set_start_busy_range (EMeetingAttendee *ia,
- gint start_year,
- gint start_month,
- gint start_day,
- gint start_hour,
- gint start_minute);
-gboolean e_meeting_attendee_set_end_busy_range (EMeetingAttendee *ia,
- gint end_year,
- gint end_month,
- gint end_day,
- gint end_hour,
- gint end_minute);
-
-void e_meeting_attendee_clear_busy_periods (EMeetingAttendee *ia);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _E_MEETING_ATTENDEE_H_ */
diff --git a/calendar/gui/e-meeting-list-view.c b/calendar/gui/e-meeting-list-view.c
deleted file mode 100644
index 5613f6adea..0000000000
--- a/calendar/gui/e-meeting-list-view.c
+++ /dev/null
@@ -1,460 +0,0 @@
-/*
- * e-meeting-list-view.c
- *
- * Authors: Mike Kestner <mkestner@ximian.com>
- * JP Rosevear <jpr@ximian.com>
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-#include <glib.h>
-#include <gtk/gtktreemodel.h>
-#include <bonobo/bonobo-control.h>
-#include <bonobo/bonobo-widget.h>
-#include <bonobo/bonobo-exception.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnome/gnome-util.h>
-#include <libgnomevfs/gnome-vfs.h>
-#include <libebook/e-book.h>
-#include <libebook/e-vcard.h>
-#include <libecal/e-cal-component.h>
-#include <libecal/e-cal-util.h>
-#include <libecal/e-cal-time-util.h>
-#include "Evolution-Addressbook-SelectNames.h"
-#include "calendar-config.h"
-#include "e-meeting-list-view.h"
-#include <misc/e-cell-renderer-combo.h>
-#include <addressbook/util/eab-destination.h>
-#include "e-select-names-renderer.h"
-
-#define SELECT_NAMES_OAFID "OAFIID:GNOME_Evolution_Addressbook_SelectNames:" BASE_VERSION
-
-struct _EMeetingListViewPrivate
-{
- EMeetingStore *store;
-
- EBook *ebook;
-
- GNOME_Evolution_Addressbook_SelectNames corba_select_names;
-};
-
-#define BUF_SIZE 1024
-
-static char *sections[] = {N_("Chair Persons"),
- N_("Required Participants"),
- N_("Optional Participants"),
- N_("Resources"),
- NULL};
-static icalparameter_role roles[] = {ICAL_ROLE_CHAIR,
- ICAL_ROLE_REQPARTICIPANT,
- ICAL_ROLE_OPTPARTICIPANT,
- ICAL_ROLE_NONPARTICIPANT,
- ICAL_ROLE_NONE};
-
-static GtkTreeViewClass *parent_class = NULL;
-
-static void
-start_addressbook_server (EMeetingListView *view)
-{
- GError *error = NULL;
-
- view->priv->ebook = e_book_new ();
- if (!e_book_load_local_addressbook (view->priv->ebook, &error)) {
- g_warning ("start_addressbook_server(): %s", error->message);
- g_error_free (error);
-
- return;
- }
-}
-
-static void
-emlv_finalize (GObject *obj)
-{
- EMeetingListView *view = E_MEETING_LIST_VIEW (obj);
- EMeetingListViewPrivate *priv = view->priv;
-
- if (priv->ebook != NULL)
- g_object_unref (priv->ebook);
-
- if (priv->corba_select_names != CORBA_OBJECT_NIL) {
- CORBA_Environment ev;
- CORBA_exception_init (&ev);
- bonobo_object_release_unref (priv->corba_select_names, &ev);
- CORBA_exception_free (&ev);
- }
-
- g_free (priv);
-
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (obj);
-}
-
-static void
-emlv_class_init (GObjectClass *klass)
-{
- parent_class = g_type_class_peek_parent (klass);
-
- klass->finalize = emlv_finalize;
-}
-
-
-static void
-emlv_init (EMeetingListView *view)
-{
- EMeetingListViewPrivate *priv;
-
- priv = g_new0 (EMeetingListViewPrivate, 1);
-
- view->priv = priv;
-
- priv->corba_select_names = CORBA_OBJECT_NIL;
-
- start_addressbook_server (view);
-}
-
-E_MAKE_TYPE (e_meeting_list_view, "EMeetingListView", EMeetingListView, emlv_class_init, emlv_init, GTK_TYPE_TREE_VIEW);
-static GList *
-get_type_strings ()
-{
- GList *strings = NULL;
-
- strings = g_list_append (strings, (char*) _("Individual"));
- strings = g_list_append (strings, (char*) _("Group"));
- strings = g_list_append (strings, (char*) _("Resource"));
- strings = g_list_append (strings, (char*) _("Room"));
- strings = g_list_append (strings, (char*) _("Unknown"));
-
- return strings;
-}
-
-static GList *
-get_role_strings ()
-{
- GList *strings = NULL;
-
- strings = g_list_append (strings, (char*) _("Chair"));
- strings = g_list_append (strings, (char*) _("Required Participant"));
- strings = g_list_append (strings, (char*) _("Optional Participant"));
- strings = g_list_append (strings, (char*) _("Non-Participant"));
- strings = g_list_append (strings, (char*) _("Unknown"));
-
- return strings;
-}
-
-static GList *
-get_rsvp_strings ()
-{
- GList *strings = NULL;
-
- strings = g_list_append (strings, (char*) _("Yes"));
- strings = g_list_append (strings, (char*) _("No"));
-
- return strings;
-}
-
-static GList *
-get_status_strings ()
-{
- GList *strings = NULL;
-
- strings = g_list_append (strings, (char*) _("Needs Action"));
- strings = g_list_append (strings, (char*) _("Accepted"));
- strings = g_list_append (strings, (char*) _("Declined"));
- strings = g_list_append (strings, (char*) _("Tentative"));
- strings = g_list_append (strings, (char*) _("Delegated"));
-
- return strings;
-}
-
-static void
-value_edited (GtkTreeView *view, gint col, const gchar *path, const gchar *text)
-{
- EMeetingStore *model = E_MEETING_STORE (gtk_tree_view_get_model (view));
- GtkTreePath *treepath = gtk_tree_path_new_from_string (path);
- int row = gtk_tree_path_get_indices (treepath)[0];
-
- e_meeting_store_set_value (model, row, col, text);
- gtk_tree_path_free (treepath);
-}
-
-static void
-attendee_edited_cb (GtkCellRenderer *renderer, const gchar *path, const gchar *address, const gchar *name, GtkTreeView *view)
-{
- value_edited (view, E_MEETING_STORE_ADDRESS_COL, path, address);
- value_edited (view, E_MEETING_STORE_CN_COL, path, name);
-}
-
-static void
-type_edited_cb (GtkCellRenderer *renderer, const gchar *path, const gchar *text, GtkTreeView *view)
-{
- value_edited (view, E_MEETING_STORE_TYPE_COL, path, text);
-}
-
-static void
-role_edited_cb (GtkCellRenderer *renderer, const gchar *path, const gchar *text, GtkTreeView *view)
-{
- value_edited (view, E_MEETING_STORE_ROLE_COL, path, text);
-}
-
-static void
-rsvp_edited_cb (GtkCellRenderer *renderer, const gchar *path, const gchar *text, GtkTreeView *view)
-{
- value_edited (view, E_MEETING_STORE_RSVP_COL, path, text);
-}
-
-static void
-status_edited_cb (GtkCellRenderer *renderer, const gchar *path, const gchar *text, GtkTreeView *view)
-{
- value_edited (view, E_MEETING_STORE_STATUS_COL, path, text);
-}
-
-static void
-build_table (GtkTreeView *view)
-{
- GtkCellRenderer *renderer;
-
- gtk_tree_view_set_headers_visible (view, TRUE);
- gtk_tree_view_set_rules_hint (view, TRUE);
-
- renderer = e_select_names_renderer_new ();
- g_object_set (G_OBJECT (renderer), "editable", TRUE, NULL);
- gtk_tree_view_insert_column_with_attributes (view, -1, _("Attendee"), renderer,
- "text", E_MEETING_STORE_ATTENDEE_COL,
- "address", E_MEETING_STORE_ADDRESS_COL,
- "underline", E_MEETING_STORE_ATTENDEE_UNDERLINE_COL,
- NULL);
- g_signal_connect (renderer, "cell_edited", G_CALLBACK (attendee_edited_cb), view);
-
- renderer = e_cell_renderer_combo_new ();
- g_object_set (G_OBJECT (renderer), "list", get_type_strings (), "editable", TRUE, NULL);
- gtk_tree_view_insert_column_with_attributes (view, -1, _("Type"), renderer,
- "text", E_MEETING_STORE_TYPE_COL,
- NULL);
- g_signal_connect (renderer, "edited", G_CALLBACK (type_edited_cb), view);
-
- renderer = e_cell_renderer_combo_new ();
- g_object_set (G_OBJECT (renderer), "list", get_role_strings (), "editable", TRUE, NULL);
- gtk_tree_view_insert_column_with_attributes (view, -1, _("Role"), renderer,
- "text", E_MEETING_STORE_ROLE_COL,
- NULL);
- g_signal_connect (renderer, "edited", G_CALLBACK (role_edited_cb), view);
-
- renderer = e_cell_renderer_combo_new ();
- g_object_set (G_OBJECT (renderer), "list", get_rsvp_strings (), "editable", TRUE, NULL);
- gtk_tree_view_insert_column_with_attributes (view, -1, _("RSVP"), renderer,
- "text", E_MEETING_STORE_RSVP_COL,
- NULL);
- g_signal_connect (renderer, "edited", G_CALLBACK (rsvp_edited_cb), view);
-
- renderer = e_cell_renderer_combo_new ();
- g_object_set (G_OBJECT (renderer), "list", get_status_strings (), "editable", TRUE, NULL);
- gtk_tree_view_insert_column_with_attributes (view, -1, _("Status"), renderer,
- "text", E_MEETING_STORE_STATUS_COL,
- NULL);
- g_signal_connect (renderer, "edited", G_CALLBACK (status_edited_cb), view);
-}
-
-EMeetingListView *
-e_meeting_list_view_new (EMeetingStore *store)
-{
- EMeetingListView *view = g_object_new (E_TYPE_MEETING_LIST_VIEW, NULL);
-
- if (view) {
- view->priv->store = store;
- gtk_tree_view_set_model (GTK_TREE_VIEW (view), GTK_TREE_MODEL (store));
- build_table (GTK_TREE_VIEW (view));
- }
-
- return view;
-}
-
-void
-e_meeting_list_view_column_set_visible (EMeetingListView *view, const gchar *col_name, gboolean visible)
-{
- GList *cols, *l;
-
- cols = gtk_tree_view_get_columns (GTK_TREE_VIEW (view));
-
- for (l = cols; l; l = l->next) {
- GtkTreeViewColumn *col = (GtkTreeViewColumn *) l->data;
-
- if (strcmp (gtk_tree_view_column_get_title (col), col_name) == 0) {
- gtk_tree_view_column_set_visible (col, visible);
- break;
- }
- }
-}
-
-static void
-process_section (EMeetingListView *view, EABDestination **cards, icalparameter_role role)
-{
- EMeetingListViewPrivate *priv;
- int i;
-
- priv = view->priv;
- for (i = 0; i < G_N_ELEMENTS (cards); i++) {
- const char *name, *attendee = NULL;
- char *attr = NULL;
-
- name = eab_destination_get_name (cards[i]);
-
- /* Get the field as attendee from the backend */
- if (e_cal_get_ldap_attribute (e_meeting_store_get_e_cal (priv->store),
- &attr, NULL)) {
- /* FIXME this should be more general */
- if (!g_ascii_strcasecmp (attr, "icscalendar")) {
- EContact *contact;
-
- /* FIXME: this does not work, have to use first
- eab_destination_use_contact() */
- contact = eab_destination_get_contact (cards[i]);
- if (contact) {
- attendee = e_contact_get (contact, E_CONTACT_FREEBUSY_URL);
- if (!attendee)
- attendee = e_contact_get (contact, E_CONTACT_CALENDAR_URI);
- }
- }
- }
-
- /* If we couldn't get the attendee prior, get the email address as the default */
- if (attendee == NULL || *attendee == '\0') {
- attendee = eab_destination_get_email (cards[i]);
- }
-
- if (attendee == NULL || *attendee == '\0')
- continue;
-
- if (e_meeting_store_find_attendee (priv->store, attendee, NULL) == NULL) {
- EMeetingAttendee *ia = e_meeting_store_add_attendee_with_defaults (priv->store);
-
- e_meeting_attendee_set_address (ia, g_strdup_printf ("MAILTO:%s", attendee));
- e_meeting_attendee_set_role (ia, role);
- if (role == ICAL_ROLE_NONPARTICIPANT)
- e_meeting_attendee_set_cutype (ia, ICAL_CUTYPE_RESOURCE);
- e_meeting_attendee_set_cn (ia, g_strdup (name));
- }
- }
-}
-
-static void
-select_names_ok_cb (BonoboListener *listener, const char *event_name, const CORBA_any *arg, CORBA_Environment *ev, gpointer data)
-{
- EMeetingListView *view = E_MEETING_LIST_VIEW (data);
- int i;
-
- for (i = 0; sections[i] != NULL; i++) {
- EABDestination **destv;
- char *string = NULL;
- Bonobo_Control corba_control = GNOME_Evolution_Addressbook_SelectNames_getEntryBySection
- (view->priv->corba_select_names, sections[i], ev);
- GtkWidget *control_widget = bonobo_widget_new_control_from_objref (corba_control, CORBA_OBJECT_NIL);
-
- bonobo_widget_get_property (BONOBO_WIDGET (control_widget), "destinations",
- TC_CORBA_string, &string, NULL);
- destv = eab_destination_importv (string);
- if (destv) {
- process_section (view, destv, roles[i]);
- g_free (destv);
- }
- }
-}
-
-static void
-add_section (GNOME_Evolution_Addressbook_SelectNames corba_select_names, const char *name)
-{
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
-
- GNOME_Evolution_Addressbook_SelectNames_addSection (
- corba_select_names, name, gettext (name), &ev);
-
- CORBA_exception_free (&ev);
-}
-
-static gboolean
-get_select_name_dialog (EMeetingListView *view)
-{
- EMeetingListViewPrivate *priv;
- CORBA_Environment ev;
- int i;
-
- priv = view->priv;
-
- CORBA_exception_init (&ev);
-
- if (priv->corba_select_names != CORBA_OBJECT_NIL) {
- int i;
-
- for (i = 0; sections[i] != NULL; i++) {
- GtkWidget *control_widget;
- Bonobo_Control corba_control = GNOME_Evolution_Addressbook_SelectNames_getEntryBySection
- (priv->corba_select_names, sections[i], &ev);
- if (BONOBO_EX (&ev)) {
- CORBA_exception_free (&ev);
- return FALSE;
- }
-
- control_widget = bonobo_widget_new_control_from_objref (corba_control, CORBA_OBJECT_NIL);
-
- bonobo_widget_set_property (BONOBO_WIDGET (control_widget), "text", TC_CORBA_string, "", NULL);
- }
- CORBA_exception_free (&ev);
-
- return TRUE;
- }
-
- priv->corba_select_names = bonobo_activation_activate_from_id (SELECT_NAMES_OAFID, 0, NULL, &ev);
-
- for (i = 0; sections[i] != NULL; i++)
- add_section (priv->corba_select_names, sections[i]);
-
- bonobo_event_source_client_add_listener (priv->corba_select_names,
- (BonoboListenerCallbackFn) select_names_ok_cb,
- "GNOME/Evolution:ok:dialog", NULL, view);
-
- if (BONOBO_EX (&ev)) {
- CORBA_exception_free (&ev);
- return FALSE;
- }
-
- CORBA_exception_free (&ev);
-
- return TRUE;
-}
-
-void
-e_meeting_list_view_invite_others_dialog (EMeetingListView *view)
-{
- CORBA_Environment ev;
-
- if (!get_select_name_dialog (view))
- return;
-
- CORBA_exception_init (&ev);
-
- GNOME_Evolution_Addressbook_SelectNames_activateDialog (
- view->priv->corba_select_names, _("Required Participants"), &ev);
-
- CORBA_exception_free (&ev);
-}
-
diff --git a/calendar/gui/e-meeting-list-view.h b/calendar/gui/e-meeting-list-view.h
deleted file mode 100644
index dd539b9652..0000000000
--- a/calendar/gui/e-meeting-list-view.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * e-meeting-list-view.h
- *
- * Author: Mike Kestner <mkestner@ximian.com>
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef _E_MEETING_LIST_VIEW_H_
-#define _E_MEETING_LIST_VIEW_H_
-
-#include <gtk/gtktreeview.h>
-#include "e-meeting-store.h"
-
-G_BEGIN_DECLS
-
-#define E_TYPE_MEETING_LIST_VIEW (e_meeting_list_view_get_type ())
-#define E_MEETING_LIST_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_MEETING_LIST_VIEW, EMeetingListView))
-#define E_MEETING_LIST_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_MEETING_LIST_VIEW, EMeetingListViewClass))
-#define E_IS_MEETING_LIST_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_MEETING_LIST_VIEW))
-#define E_IS_MEETING_LIST_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_MEETING_LIST_VIEW))
-
-
-typedef struct _EMeetingListView EMeetingListView;
-typedef struct _EMeetingListViewPrivate EMeetingListViewPrivate;
-typedef struct _EMeetingListViewClass EMeetingListViewClass;
-
-struct _EMeetingListView {
- GtkTreeView parent;
-
- EMeetingListViewPrivate *priv;
-};
-
-struct _EMeetingListViewClass {
- GtkTreeViewClass parent_class;
-};
-
-GType e_meeting_list_view_get_type (void);
-
-EMeetingListView *e_meeting_list_view_new (EMeetingStore *store);
-
-void e_meeting_list_view_column_set_visible (EMeetingListView *emlv, const gchar *col_name, gboolean visible);
-
-void e_meeting_list_view_invite_others_dialog (EMeetingListView *emlv);
-
-G_END_DECLS
-
-#endif
diff --git a/calendar/gui/e-meeting-model.c b/calendar/gui/e-meeting-model.c
deleted file mode 100644
index 559ede9b6c..0000000000
--- a/calendar/gui/e-meeting-model.c
+++ /dev/null
@@ -1,1780 +0,0 @@
-/* -*- Mod:e C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* itip-model.c
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: JP Rosevear
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <glib.h>
-#include <bonobo/bonobo-control.h>
-#include <bonobo/bonobo-widget.h>
-#include <bonobo/bonobo-exception.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnome/gnome-util.h>
-#include <libgnomevfs/gnome-vfs.h>
-#include <gal/e-table/e-table-without.h>
-#include <gal/e-table/e-cell-text.h>
-#include <gal/e-table/e-cell-popup.h>
-#include <gal/e-table/e-cell-combo.h>
-#include <addressbook/util/eab-destination.h>
-#include <ebook/e-book.h>
-#include <ebook/e-book-async.h>
-#include <ebook/e-contact.h>
-#include <libecal/e-cal-component.h>
-#include <libecal/e-cal-util.h>
-#include <libecal/e-cal-time-util.h>
-#include "Evolution-Addressbook-SelectNames.h"
-#include "calendar-config.h"
-#include "itip-utils.h"
-#include "e-meeting-utils.h"
-#include "e-meeting-attendee.h"
-#include "e-meeting-model.h"
-
-#define SELECT_NAMES_OAFID "OAFIID:GNOME_Evolution_Addressbook_SelectNames:" BASE_VERSION
-
-struct _EMeetingModelPrivate
-{
- GPtrArray *attendees;
-
- GList *tables;
-
- ECal *client;
- icaltimezone *zone;
-
- EBook *ebook;
- gboolean book_loaded;
- gboolean book_load_wait;
-
- GPtrArray *refresh_queue;
- GHashTable *refresh_data;
- guint refresh_idle_id;
-
- /* For invite others dialogs */
- GNOME_Evolution_Addressbook_SelectNames corba_select_names;
-};
-
-#define BUF_SIZE 1024
-
-static char *sections[] = {N_("Chair Persons"),
- N_("Required Participants"),
- N_("Optional Participants"),
- N_("Resources"),
- NULL};
-static icalparameter_role roles[] = {ICAL_ROLE_CHAIR,
- ICAL_ROLE_REQPARTICIPANT,
- ICAL_ROLE_OPTPARTICIPANT,
- ICAL_ROLE_NONPARTICIPANT,
- ICAL_ROLE_NONE};
-
-typedef struct _EMeetingModelQueueData EMeetingModelQueueData;
-struct _EMeetingModelQueueData {
- EMeetingModel *im;
- EMeetingAttendee *ia;
-
- gboolean refreshing;
-
- EMeetingTime start;
- EMeetingTime end;
-
- char buffer[BUF_SIZE];
- GString *string;
-
- GPtrArray *call_backs;
- GPtrArray *data;
-};
-
-
-static void class_init (EMeetingModelClass *klass);
-static void init (EMeetingModel *model);
-static void finalize (GObject *obj);
-
-static void refresh_queue_add (EMeetingModel *im, int row,
- EMeetingTime *start,
- EMeetingTime *end,
- EMeetingModelRefreshCallback call_back,
- gpointer data);
-static void refresh_queue_remove (EMeetingModel *im,
- EMeetingAttendee *ia);
-static gboolean refresh_busy_periods (gpointer data);
-
-static void attendee_changed_cb (EMeetingAttendee *ia, gpointer data);
-static void select_names_ok_cb (BonoboListener *listener,
- const char *event_name,
- const CORBA_any *arg,
- CORBA_Environment *ev,
- gpointer data);
-
-static void table_destroy_state_cb (ETableScrolled *etable, gpointer data);
-static void table_destroy_list_cb (ETableScrolled *etable, gpointer data);
-
-static ETableModelClass *parent_class = NULL;
-
-E_MAKE_TYPE (e_meeting_model, "EMeetingModel", EMeetingModel,
- class_init, init, E_TABLE_MODEL_TYPE);
-
-static void
-book_open_cb (EBook *book, EBookStatus status, gpointer data)
-{
- EMeetingModel *im = E_MEETING_MODEL (data);
- EMeetingModelPrivate *priv;
-
- priv = im->priv;
-
- priv->ebook = book;
-
- if (status == E_BOOK_ERROR_OK)
- priv->book_loaded = TRUE;
- else
- g_warning ("Book not loaded");
-
- if (priv->book_load_wait) {
- priv->book_load_wait = FALSE;
- gtk_main_quit ();
- }
-}
-
-static void
-start_addressbook_server (EMeetingModel *im)
-{
- e_book_async_get_default_addressbook (book_open_cb, im);
-}
-
-static EMeetingAttendee *
-find_match (EMeetingModel *im, const char *address, int *pos)
-{
- EMeetingModelPrivate *priv;
- EMeetingAttendee *ia;
- const gchar *ia_address;
- int i;
-
- priv = im->priv;
-
- if (address == NULL)
- return NULL;
-
- /* Make sure we can add the new delegatee person */
- for (i = 0; i < priv->attendees->len; i++) {
- ia = g_ptr_array_index (priv->attendees, i);
-
- ia_address = e_meeting_attendee_get_address (ia);
- if (ia_address != NULL && !g_strcasecmp (itip_strip_mailto (ia_address), itip_strip_mailto (address))) {
- if (pos != NULL)
- *pos = i;
- return ia;
- }
- }
-
- return NULL;
-}
-
-static icalparameter_cutype
-text_to_type (const char *type)
-{
- if (!g_strcasecmp (type, _("Individual")))
- return ICAL_CUTYPE_INDIVIDUAL;
- else if (!g_strcasecmp (type, _("Group")))
- return ICAL_CUTYPE_GROUP;
- else if (!g_strcasecmp (type, _("Resource")))
- return ICAL_CUTYPE_RESOURCE;
- else if (!g_strcasecmp (type, _("Room")))
- return ICAL_CUTYPE_ROOM;
- else
- return ICAL_CUTYPE_NONE;
-}
-
-static char *
-type_to_text (icalparameter_cutype type)
-{
- switch (type) {
- case ICAL_CUTYPE_INDIVIDUAL:
- return _("Individual");
- case ICAL_CUTYPE_GROUP:
- return _("Group");
- case ICAL_CUTYPE_RESOURCE:
- return _("Resource");
- case ICAL_CUTYPE_ROOM:
- return _("Room");
- default:
- return _("Unknown");
- }
-
- return NULL;
-
-}
-
-static icalparameter_role
-text_to_role (const char *role)
-{
- if (!g_strcasecmp (role, _("Chair")))
- return ICAL_ROLE_CHAIR;
- else if (!g_strcasecmp (role, _("Required Participant")))
- return ICAL_ROLE_REQPARTICIPANT;
- else if (!g_strcasecmp (role, _("Optional Participant")))
- return ICAL_ROLE_OPTPARTICIPANT;
- else if (!g_strcasecmp (role, _("Non-Participant")))
- return ICAL_ROLE_NONPARTICIPANT;
- else
- return ICAL_ROLE_NONE;
-}
-
-static char *
-role_to_text (icalparameter_role role)
-{
- switch (role) {
- case ICAL_ROLE_CHAIR:
- return _("Chair");
- case ICAL_ROLE_REQPARTICIPANT:
- return _("Required Participant");
- case ICAL_ROLE_OPTPARTICIPANT:
- return _("Optional Participant");
- case ICAL_ROLE_NONPARTICIPANT:
- return _("Non-Participant");
- default:
- return _("Unknown");
- }
-
- return NULL;
-}
-
-static gboolean
-text_to_boolean (const char *role)
-{
- if (!g_strcasecmp (role, _("Yes")))
- return TRUE;
- else
- return FALSE;
-}
-
-static char *
-boolean_to_text (gboolean b)
-{
- if (b)
- return _("Yes");
- else
- return _("No");
-}
-
-static icalparameter_partstat
-text_to_partstat (const char *partstat)
-{
- if (!g_strcasecmp (partstat, _("Needs Action")))
- return ICAL_PARTSTAT_NEEDSACTION;
- else if (!g_strcasecmp (partstat, _("Accepted")))
- return ICAL_PARTSTAT_ACCEPTED;
- else if (!g_strcasecmp (partstat, _("Declined")))
- return ICAL_PARTSTAT_DECLINED;
- else if (!g_strcasecmp (partstat, _("Tentative")))
- return ICAL_PARTSTAT_TENTATIVE;
- else if (!g_strcasecmp (partstat, _("Delegated")))
- return ICAL_PARTSTAT_DELEGATED;
- else if (!g_strcasecmp (partstat, _("Completed")))
- return ICAL_PARTSTAT_COMPLETED;
- else if (!g_strcasecmp (partstat, _("In Process")))
- return ICAL_PARTSTAT_INPROCESS;
- else
- return ICAL_PARTSTAT_NONE;
-}
-
-static char *
-partstat_to_text (icalparameter_partstat partstat)
-{
- switch (partstat) {
- case ICAL_PARTSTAT_NEEDSACTION:
- return _("Needs Action");
- case ICAL_PARTSTAT_ACCEPTED:
- return _("Accepted");
- case ICAL_PARTSTAT_DECLINED:
- return _("Declined");
- case ICAL_PARTSTAT_TENTATIVE:
- return _("Tentative");
- case ICAL_PARTSTAT_DELEGATED:
- return _("Delegated");
- case ICAL_PARTSTAT_COMPLETED:
- return _("Completed");
- case ICAL_PARTSTAT_INPROCESS:
- return _("In Process");
- case ICAL_PARTSTAT_NONE:
- default:
- return _("Unknown");
- }
-
- return NULL;
-}
-
-static int
-column_count (ETableModel *etm)
-{
- return E_MEETING_MODEL_COLUMN_COUNT;
-}
-
-static int
-row_count (ETableModel *etm)
-{
- EMeetingModel *im;
- EMeetingModelPrivate *priv;
-
- im = E_MEETING_MODEL (etm);
- priv = im->priv;
-
- return (priv->attendees->len);
-}
-
-static void
-append_row (ETableModel *etm, ETableModel *source, int row)
-{
- EMeetingModel *im;
- EMeetingModelPrivate *priv;
- EMeetingAttendee *ia;
- char *address;
-
- im = E_MEETING_MODEL (etm);
- priv = im->priv;
-
- address = (char *) e_table_model_value_at (source, E_MEETING_MODEL_ADDRESS_COL, row);
- if (find_match (im, address, NULL) != NULL) {
- return;
- }
-
- ia = E_MEETING_ATTENDEE (e_meeting_attendee_new ());
-
- e_meeting_attendee_set_address (ia, g_strdup_printf ("MAILTO:%s", address));
- e_meeting_attendee_set_member (ia, g_strdup (e_table_model_value_at (source, E_MEETING_MODEL_MEMBER_COL, row)));
- e_meeting_attendee_set_cutype (ia, text_to_type (e_table_model_value_at (source, E_MEETING_MODEL_TYPE_COL, row)));
- e_meeting_attendee_set_role (ia, text_to_role (e_table_model_value_at (source, E_MEETING_MODEL_ROLE_COL, row)));
- e_meeting_attendee_set_rsvp (ia, text_to_boolean (e_table_model_value_at (source, E_MEETING_MODEL_RSVP_COL, row)));
- e_meeting_attendee_set_delto (ia, g_strdup (e_table_model_value_at (source, E_MEETING_MODEL_DELTO_COL, row)));
- e_meeting_attendee_set_delfrom (ia, g_strdup (e_table_model_value_at (source, E_MEETING_MODEL_DELFROM_COL, row)));
- e_meeting_attendee_set_status (ia, text_to_partstat (e_table_model_value_at (source, E_MEETING_MODEL_STATUS_COL, row)));
- e_meeting_attendee_set_cn (ia, g_strdup (e_table_model_value_at (source, E_MEETING_MODEL_CN_COL, row)));
- e_meeting_attendee_set_language (ia, g_strdup (e_table_model_value_at (source, E_MEETING_MODEL_LANGUAGE_COL, row)));
-
- e_meeting_model_add_attendee (E_MEETING_MODEL (etm), ia);
- g_object_unref (ia);
-}
-
-static void *
-value_at (ETableModel *etm, int col, int row)
-{
- EMeetingModel *im;
- EMeetingModelPrivate *priv;
- EMeetingAttendee *ia;
-
- im = E_MEETING_MODEL (etm);
- priv = im->priv;
-
- ia = g_ptr_array_index (priv->attendees, row);
-
- switch (col) {
- case E_MEETING_MODEL_ADDRESS_COL:
- return (void *)itip_strip_mailto (e_meeting_attendee_get_address (ia));
- case E_MEETING_MODEL_MEMBER_COL:
- return (void *)e_meeting_attendee_get_member (ia);
- case E_MEETING_MODEL_TYPE_COL:
- return type_to_text (e_meeting_attendee_get_cutype (ia));
- case E_MEETING_MODEL_ROLE_COL:
- return role_to_text (e_meeting_attendee_get_role (ia));
- case E_MEETING_MODEL_RSVP_COL:
- return boolean_to_text (e_meeting_attendee_get_rsvp (ia));
- case E_MEETING_MODEL_DELTO_COL:
- return (void *)itip_strip_mailto (e_meeting_attendee_get_delto (ia));
- case E_MEETING_MODEL_DELFROM_COL:
- return (void *)itip_strip_mailto (e_meeting_attendee_get_delfrom (ia));
- case E_MEETING_MODEL_STATUS_COL:
- return partstat_to_text (e_meeting_attendee_get_status (ia));
- case E_MEETING_MODEL_CN_COL:
- return (void *)e_meeting_attendee_get_cn (ia);
- case E_MEETING_MODEL_LANGUAGE_COL:
- return (void *)e_meeting_attendee_get_language (ia);
- }
-
- return NULL;
-}
-
-static void
-set_value_at (ETableModel *etm, int col, int row, const void *val)
-{
- EMeetingModel *im;
- EMeetingModelPrivate *priv;
- EMeetingAttendee *ia;
- icalparameter_cutype type;
-
- im = E_MEETING_MODEL (etm);
- priv = im->priv;
-
- ia = g_ptr_array_index (priv->attendees, row);
-
- e_table_model_pre_change (etm);
-
- switch (col) {
- case E_MEETING_MODEL_ADDRESS_COL:
- if (val != NULL && *((char *)val))
- e_meeting_attendee_set_address (ia, g_strdup_printf ("MAILTO:%s", (char *) val));
- break;
- case E_MEETING_MODEL_MEMBER_COL:
- e_meeting_attendee_set_member (ia, g_strdup (val));
- break;
- case E_MEETING_MODEL_TYPE_COL:
- type = text_to_type (val);
- e_meeting_attendee_set_cutype (ia, text_to_type (val));
- if (type == ICAL_CUTYPE_RESOURCE) {
- e_meeting_attendee_set_role (ia, ICAL_ROLE_NONPARTICIPANT);
- e_table_model_cell_changed (etm, E_MEETING_MODEL_ROLE_COL, row);
- }
- break;
- case E_MEETING_MODEL_ROLE_COL:
- e_meeting_attendee_set_role (ia, text_to_role (val));
- break;
- case E_MEETING_MODEL_RSVP_COL:
- e_meeting_attendee_set_rsvp (ia, text_to_boolean (val));
- break;
- case E_MEETING_MODEL_DELTO_COL:
- e_meeting_attendee_set_delto (ia, g_strdup (val));
- break;
- case E_MEETING_MODEL_DELFROM_COL:
- e_meeting_attendee_set_delfrom (ia, g_strdup (val));
- break;
- case E_MEETING_MODEL_STATUS_COL:
- e_meeting_attendee_set_status (ia, text_to_partstat (val));
- break;
- case E_MEETING_MODEL_CN_COL:
- e_meeting_attendee_set_cn (ia, g_strdup (val));
- break;
- case E_MEETING_MODEL_LANGUAGE_COL:
- e_meeting_attendee_set_language (ia, g_strdup (val));
- break;
- }
-
- e_table_model_cell_changed (etm, col, row);
-}
-
-static gboolean
-is_cell_editable (ETableModel *etm, int col, int row)
-{
- EMeetingModel *im;
- EMeetingModelPrivate *priv;
- EMeetingAttendee *ia;
- EMeetingAttendeeEditLevel level;
-
- im = E_MEETING_MODEL (etm);
- priv = im->priv;
-
- if (col == E_MEETING_MODEL_DELTO_COL
- || col == E_MEETING_MODEL_DELFROM_COL)
- return FALSE;
-
- if (row == -1)
- return TRUE;
- if (row >= priv->attendees->len)
- return TRUE;
-
- ia = g_ptr_array_index (priv->attendees, row);
- level = e_meeting_attendee_get_edit_level (ia);
-
- switch (level) {
- case E_MEETING_ATTENDEE_EDIT_FULL:
- return TRUE;
- case E_MEETING_ATTENDEE_EDIT_STATUS:
- return col == E_MEETING_MODEL_STATUS_COL;
- case E_MEETING_ATTENDEE_EDIT_NONE:
- return FALSE;
- }
-
- return TRUE;
-}
-
-static void *
-duplicate_value (ETableModel *etm, int col, const void *val)
-{
- return g_strdup (val);
-}
-
-static void
-free_value (ETableModel *etm, int col, void *val)
-{
- g_free (val);
-}
-
-static void *
-init_value (ETableModel *etm, int col)
-{
- switch (col) {
- case E_MEETING_MODEL_ADDRESS_COL:
- return g_strdup ("");
- case E_MEETING_MODEL_MEMBER_COL:
- return g_strdup ("");
- case E_MEETING_MODEL_TYPE_COL:
- return g_strdup (_("Individual"));
- case E_MEETING_MODEL_ROLE_COL:
- return g_strdup (_("Required Participant"));
- case E_MEETING_MODEL_RSVP_COL:
- return g_strdup (_("Yes"));
- case E_MEETING_MODEL_DELTO_COL:
- return g_strdup ("");
- case E_MEETING_MODEL_DELFROM_COL:
- return g_strdup ("");
- case E_MEETING_MODEL_STATUS_COL:
- return g_strdup (_("Needs Action"));
- case E_MEETING_MODEL_CN_COL:
- return g_strdup ("");
- case E_MEETING_MODEL_LANGUAGE_COL:
- return g_strdup ("en");
- }
-
- return g_strdup ("");
-}
-
-static gboolean
-value_is_empty (ETableModel *etm, int col, const void *val)
-{
-
- switch (col) {
- case E_MEETING_MODEL_ADDRESS_COL:
- case E_MEETING_MODEL_MEMBER_COL:
- case E_MEETING_MODEL_DELTO_COL:
- case E_MEETING_MODEL_DELFROM_COL:
- case E_MEETING_MODEL_CN_COL:
- if (val && !g_strcasecmp (val, ""))
- return TRUE;
- else
- return FALSE;
- default:
- ;
- }
-
- return TRUE;
-}
-
-static char *
-value_to_string (ETableModel *etm, int col, const void *val)
-{
- return g_strdup (val);
-}
-
-static void
-class_init (EMeetingModelClass *klass)
-{
- GObjectClass *gobject_class;
- ETableModelClass *etm_class;
-
- gobject_class = G_OBJECT_CLASS (klass);
- etm_class = E_TABLE_MODEL_CLASS (klass);
-
- parent_class = g_type_class_peek_parent (klass);
-
- gobject_class->finalize = finalize;
-
- etm_class->column_count = column_count;
- etm_class->row_count = row_count;
- etm_class->value_at = value_at;
- etm_class->set_value_at = set_value_at;
- etm_class->is_cell_editable = is_cell_editable;
- etm_class->append_row = append_row;
- etm_class->duplicate_value = duplicate_value;
- etm_class->free_value = free_value;
- etm_class->initialize_value = init_value;
- etm_class->value_is_empty = value_is_empty;
- etm_class->value_to_string = value_to_string;
-}
-
-
-static void
-init (EMeetingModel *im)
-{
- EMeetingModelPrivate *priv;
-
- priv = g_new0 (EMeetingModelPrivate, 1);
-
- im->priv = priv;
-
- priv->attendees = g_ptr_array_new ();
-
- priv->tables = NULL;
-
- priv->client = NULL;
- priv->zone = icaltimezone_get_builtin_timezone (calendar_config_get_timezone ());
-
- priv->ebook = NULL;
- priv->book_loaded = FALSE;
- priv->book_load_wait = FALSE;
-
- priv->refresh_queue = g_ptr_array_new ();
- priv->refresh_data = g_hash_table_new (g_direct_hash, g_direct_equal);
- priv->refresh_idle_id = 0;
-
- priv->corba_select_names = CORBA_OBJECT_NIL;
-
- start_addressbook_server (im);
-}
-
-static void
-finalize (GObject *obj)
-{
- EMeetingModel *im = E_MEETING_MODEL (obj);
- EMeetingModelPrivate *priv;
- GList *l;
- int i;
-
- priv = im->priv;
-
- for (i = 0; i < priv->attendees->len; i++)
- g_object_unref (g_ptr_array_index (priv->attendees, i));
- g_ptr_array_free (priv->attendees, TRUE);
-
- for (l = priv->tables; l != NULL; l = l->next)
- g_signal_handlers_disconnect_matched (G_OBJECT (l->data), G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, im);
- g_list_free (priv->tables);
-
- if (priv->client != NULL)
- g_object_unref (priv->client);
-
- if (priv->ebook != NULL)
- g_object_unref (priv->ebook);
-
- if (priv->corba_select_names != CORBA_OBJECT_NIL) {
- CORBA_Environment ev;
- CORBA_exception_init (&ev);
- bonobo_object_release_unref (priv->corba_select_names, &ev);
- CORBA_exception_free (&ev);
- }
-
- while (priv->refresh_queue->len > 0)
- refresh_queue_remove (im, g_ptr_array_index (priv->refresh_queue, 0));
- g_ptr_array_free (priv->refresh_queue, TRUE);
- g_hash_table_destroy (priv->refresh_data);
-
- if (priv->refresh_idle_id)
- g_source_remove (priv->refresh_idle_id);
-
- g_free (priv);
-
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (obj);
-}
-
-GtkObject *
-e_meeting_model_new (void)
-{
- return g_object_new (E_TYPE_MEETING_MODEL, NULL);
-}
-
-
-ECal *
-e_meeting_model_get_e_cal (EMeetingModel *im)
-{
- EMeetingModelPrivate *priv;
-
- priv = im->priv;
-
- return priv->client;
-}
-
-void
-e_meeting_model_set_e_cal (EMeetingModel *im, ECal *client)
-{
- EMeetingModelPrivate *priv;
-
- priv = im->priv;
-
- if (priv->client != NULL)
- g_object_unref (priv->client);
-
- if (client != NULL)
- g_object_ref (client);
- priv->client = client;
-}
-
-icaltimezone *
-e_meeting_model_get_zone (EMeetingModel *im)
-{
- EMeetingModelPrivate *priv;
-
- g_return_val_if_fail (im != NULL, NULL);
- g_return_val_if_fail (E_IS_MEETING_MODEL (im), NULL);
-
- priv = im->priv;
-
- return priv->zone;
-}
-
-void
-e_meeting_model_set_zone (EMeetingModel *im, icaltimezone *zone)
-{
- EMeetingModelPrivate *priv;
-
- g_return_if_fail (im != NULL);
- g_return_if_fail (E_IS_MEETING_MODEL (im));
-
- priv = im->priv;
-
- priv->zone = zone;
-}
-
-static ETableScrolled *
-build_etable (ETableModel *model, const gchar *spec_file, const gchar *state_file)
-{
- GtkWidget *etable;
- ETable *real_table;
- ETableExtras *extras;
- GList *strings;
- ECell *popup_cell, *cell;
-
- extras = e_table_extras_new ();
-
- /* For type */
- cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
- popup_cell = e_cell_combo_new ();
- e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
- g_object_unref (cell);
-
- strings = NULL;
- strings = g_list_append (strings, (char*) _("Individual"));
- strings = g_list_append (strings, (char*) _("Group"));
- strings = g_list_append (strings, (char*) _("Resource"));
- strings = g_list_append (strings, (char*) _("Room"));
- strings = g_list_append (strings, (char*) _("Unknown"));
-
- e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell), strings);
- e_table_extras_add_cell (extras, "typeedit", popup_cell);
-
- /* For role */
- cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
- popup_cell = e_cell_combo_new ();
- e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
- g_object_unref (cell);
-
- strings = NULL;
- strings = g_list_append (strings, (char*) _("Chair"));
- strings = g_list_append (strings, (char*) _("Required Participant"));
- strings = g_list_append (strings, (char*) _("Optional Participant"));
- strings = g_list_append (strings, (char*) _("Non-Participant"));
- strings = g_list_append (strings, (char*) _("Unknown"));
-
- e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell), strings);
- e_table_extras_add_cell (extras, "roleedit", popup_cell);
-
- /* For rsvp */
- cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
- popup_cell = e_cell_combo_new ();
- e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
- g_object_unref (cell);
-
- strings = NULL;
- strings = g_list_append (strings, (char*) _("Yes"));
- strings = g_list_append (strings, (char*) _("No"));
-
- e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell), strings);
- e_table_extras_add_cell (extras, "rsvpedit", popup_cell);
-
- /* For status */
- cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
- popup_cell = e_cell_combo_new ();
- e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
- g_object_unref (cell);
-
- strings = NULL;
- strings = g_list_append (strings, (char*) _("Needs Action"));
- strings = g_list_append (strings, (char*) _("Accepted"));
- strings = g_list_append (strings, (char*) _("Declined"));
- strings = g_list_append (strings, (char*) _("Tentative"));
- strings = g_list_append (strings, (char*) _("Delegated"));
-
- e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell), strings);
- e_table_extras_add_cell (extras, "statusedit", popup_cell);
-
- etable = e_table_scrolled_new_from_spec_file (model, extras, spec_file, NULL);
- real_table = e_table_scrolled_get_table (E_TABLE_SCROLLED (etable));
- g_object_set (G_OBJECT (real_table), "uniform_row_height", TRUE, NULL);
- e_table_load_state (real_table, state_file);
-
-#if 0
- g_signal_connect (real_table, "right_click", G_CALLBACK (right_click_cb), mpage);
-#endif
-
- g_signal_connect (etable, "destroy", G_CALLBACK (table_destroy_state_cb), g_strdup (state_file));
-
- g_object_unref (extras);
-
- return E_TABLE_SCROLLED (etable);
-}
-
-void
-e_meeting_model_add_attendee (EMeetingModel *im, EMeetingAttendee *ia)
-{
- EMeetingModelPrivate *priv;
-
- priv = im->priv;
-
- e_table_model_pre_change (E_TABLE_MODEL (im));
-
- g_object_ref (ia);
- g_ptr_array_add (priv->attendees, ia);
-
- g_signal_connect (ia, "changed", G_CALLBACK (attendee_changed_cb), im);
-
- e_table_model_row_inserted (E_TABLE_MODEL (im), row_count (E_TABLE_MODEL (im)) - 1);
-}
-
-EMeetingAttendee *
-e_meeting_model_add_attendee_with_defaults (EMeetingModel *im)
-{
- EMeetingAttendee *ia;
- char *str;
-
- ia = E_MEETING_ATTENDEE (e_meeting_attendee_new ());
-
- e_meeting_attendee_set_address (ia, init_value (E_TABLE_MODEL (im), E_MEETING_MODEL_ADDRESS_COL));
- e_meeting_attendee_set_member (ia, init_value (E_TABLE_MODEL (im), E_MEETING_MODEL_MEMBER_COL));
-
- str = init_value (E_TABLE_MODEL (im), E_MEETING_MODEL_TYPE_COL);
- e_meeting_attendee_set_cutype (ia, text_to_type (str));
- g_free (str);
- str = init_value (E_TABLE_MODEL (im), E_MEETING_MODEL_ROLE_COL);
- e_meeting_attendee_set_role (ia, text_to_role (str));
- g_free (str);
- str = init_value (E_TABLE_MODEL (im), E_MEETING_MODEL_RSVP_COL);
- e_meeting_attendee_set_rsvp (ia, text_to_boolean (str));
- g_free (str);
-
- e_meeting_attendee_set_delto (ia, init_value (E_TABLE_MODEL (im), E_MEETING_MODEL_DELTO_COL));
- e_meeting_attendee_set_delfrom (ia, init_value (E_TABLE_MODEL (im), E_MEETING_MODEL_DELFROM_COL));
-
- str = init_value (E_TABLE_MODEL (im), E_MEETING_MODEL_STATUS_COL);
- e_meeting_attendee_set_status (ia, text_to_partstat (str));
- g_free (str);
-
- e_meeting_attendee_set_cn (ia, init_value (E_TABLE_MODEL (im), E_MEETING_MODEL_CN_COL));
- e_meeting_attendee_set_language (ia, init_value (E_TABLE_MODEL (im), E_MEETING_MODEL_LANGUAGE_COL));
-
- e_meeting_model_add_attendee (im, ia);
-
- return ia;
-}
-
-void
-e_meeting_model_remove_attendee (EMeetingModel *im, EMeetingAttendee *ia)
-{
- EMeetingModelPrivate *priv;
- gint i, row = -1;
-
- priv = im->priv;
-
- for (i = 0; i < priv->attendees->len; i++) {
- if (ia == g_ptr_array_index (priv->attendees, i)) {
- row = i;
- break;
- }
- }
-
- if (row != -1) {
- e_table_model_pre_change (E_TABLE_MODEL (im));
-
- g_ptr_array_remove_index (priv->attendees, row);
- g_object_unref (ia);
-
- e_table_model_row_deleted (E_TABLE_MODEL (im), row);
- }
-}
-
-void
-e_meeting_model_remove_all_attendees (EMeetingModel *im)
-{
- EMeetingModelPrivate *priv;
- gint i, len;
-
- priv = im->priv;
-
- e_table_model_pre_change (E_TABLE_MODEL (im));
-
- len = priv->attendees->len;
-
- for (i = 0; i < len; i++) {
- EMeetingAttendee *ia = g_ptr_array_index (priv->attendees, i);
- g_object_unref (ia);
- }
- g_ptr_array_set_size (priv->attendees, 0);
-
- e_table_model_rows_deleted (E_TABLE_MODEL (im), 0, len);
-}
-
-EMeetingAttendee *
-e_meeting_model_find_attendee (EMeetingModel *im, const gchar *address, gint *row)
-{
- EMeetingModelPrivate *priv;
- EMeetingAttendee *ia;
- int i;
-
- priv = im->priv;
-
- if (address == NULL)
- return NULL;
-
- for (i = 0; i < priv->attendees->len; i++) {
- const gchar *ia_address;
-
- ia = g_ptr_array_index (priv->attendees, i);
-
- ia_address = e_meeting_attendee_get_address (ia);
- if (ia_address && !g_strcasecmp (itip_strip_mailto (ia_address), itip_strip_mailto (address))) {
- if (row != NULL)
- *row = i;
-
- return ia;
- }
- }
-
- return NULL;
-}
-
-EMeetingAttendee *
-e_meeting_model_find_attendee_at_row (EMeetingModel *im, gint row)
-{
- EMeetingModelPrivate *priv;
-
- g_return_val_if_fail (im != NULL, NULL);
- g_return_val_if_fail (E_IS_MEETING_MODEL (im), NULL);
- g_return_val_if_fail (row >= 0, NULL);
-
- priv = im->priv;
- g_return_val_if_fail (row < priv->attendees->len, NULL);
-
- return g_ptr_array_index (priv->attendees, row);
-}
-
-gint
-e_meeting_model_count_actual_attendees (EMeetingModel *im)
-{
- EMeetingModelPrivate *priv;
-
- priv = im->priv;
-
- return e_table_model_row_count (E_TABLE_MODEL (im));
-}
-
-const GPtrArray *
-e_meeting_model_get_attendees (EMeetingModel *im)
-{
- EMeetingModelPrivate *priv;
-
- priv = im->priv;
-
- return priv->attendees;
-}
-
-static icaltimezone *
-find_zone (icalproperty *ip, icalcomponent *tz_top_level)
-{
- icalparameter *param;
- icalcomponent *sub_comp;
- const char *tzid;
- icalcompiter iter;
-
- if (tz_top_level == NULL)
- return NULL;
-
- param = icalproperty_get_first_parameter (ip, ICAL_TZID_PARAMETER);
- if (param == NULL)
- return NULL;
- tzid = icalparameter_get_tzid (param);
-
- iter = icalcomponent_begin_component (tz_top_level, ICAL_VTIMEZONE_COMPONENT);
- while ((sub_comp = icalcompiter_deref (&iter)) != NULL) {
- icalcomponent *clone;
- const char *tz_tzid;
-
- /* FIXME We aren't passing a property here */
- tz_tzid = icalproperty_get_tzid (sub_comp);
- if (!strcmp (tzid, tz_tzid)) {
- icaltimezone *zone;
-
- zone = icaltimezone_new ();
- clone = icalcomponent_new_clone (sub_comp);
- icaltimezone_set_component (zone, clone);
-
- return zone;
- }
-
- icalcompiter_next (&iter);
- }
-
- return NULL;
-}
-
-
-static void
-refresh_queue_add (EMeetingModel *im, int row,
- EMeetingTime *start,
- EMeetingTime *end,
- EMeetingModelRefreshCallback call_back,
- gpointer data)
-{
- EMeetingModelPrivate *priv;
- EMeetingAttendee *ia;
- EMeetingModelQueueData *qdata;
-
- priv = im->priv;
-
- ia = g_ptr_array_index (priv->attendees, row);
- if (ia == NULL)
- return;
-
- qdata = g_hash_table_lookup (priv->refresh_data, ia);
- if (qdata == NULL) {
- qdata = g_new0 (EMeetingModelQueueData, 1);
-
- qdata->im = im;
- qdata->ia = ia;
- e_meeting_attendee_clear_busy_periods (ia);
- e_meeting_attendee_set_has_calendar_info (ia, FALSE);
-
- qdata->start = *start;
- qdata->end = *end;
- qdata->string = g_string_new (NULL);
- qdata->call_backs = g_ptr_array_new ();
- qdata->data = g_ptr_array_new ();
- g_ptr_array_add (qdata->call_backs, call_back);
- g_ptr_array_add (qdata->data, data);
-
- g_hash_table_insert (priv->refresh_data, ia, qdata);
- } else {
- if (e_meeting_time_compare_times (start, &qdata->start) == -1)
- qdata->start = *start;
- if (e_meeting_time_compare_times (end, &qdata->end) == 1)
- qdata->end = *end;
- g_ptr_array_add (qdata->call_backs, call_back);
- g_ptr_array_add (qdata->data, data);
- }
-
- g_object_ref (ia);
- g_ptr_array_add (priv->refresh_queue, ia);
-
- if (priv->refresh_idle_id == 0)
- priv->refresh_idle_id = g_idle_add (refresh_busy_periods, im);
-}
-
-static void
-refresh_queue_remove (EMeetingModel *im, EMeetingAttendee *ia)
-{
- EMeetingModelPrivate *priv;
- EMeetingModelQueueData *qdata;
-
- priv = im->priv;
-
- /* Free the queue data */
- qdata = g_hash_table_lookup (priv->refresh_data, ia);
- g_assert (qdata != NULL);
-
- g_hash_table_remove (priv->refresh_data, ia);
- g_ptr_array_free (qdata->call_backs, TRUE);
- g_ptr_array_free (qdata->data, TRUE);
- g_free (qdata);
-
- /* Unref the attendee */
- g_ptr_array_remove (priv->refresh_queue, ia);
- g_object_unref (ia);
-}
-
-static void
-process_callbacks (EMeetingModelQueueData *qdata)
-{
- EMeetingModel *im;
- int i;
-
- for (i = 0; i < qdata->call_backs->len; i++) {
- EMeetingModelRefreshCallback call_back;
- gpointer *data;
-
- call_back = g_ptr_array_index (qdata->call_backs, i);
- data = g_ptr_array_index (qdata->data, i);
-
- call_back (data);
- }
-
- im = qdata->im;
- refresh_queue_remove (qdata->im, qdata->ia);
- g_object_unref (im);
-}
-
-static void
-process_free_busy_comp (EMeetingAttendee *ia,
- icalcomponent *fb_comp,
- icaltimezone *zone,
- icalcomponent *tz_top_level)
-{
- icalproperty *ip;
-
- ip = icalcomponent_get_first_property (fb_comp, ICAL_DTSTART_PROPERTY);
- if (ip != NULL) {
- struct icaltimetype dtstart;
- icaltimezone *ds_zone;
-
- dtstart = icalproperty_get_dtstart (ip);
- if (!dtstart.is_utc)
- ds_zone = find_zone (ip, tz_top_level);
- else
- ds_zone = icaltimezone_get_utc_timezone ();
- icaltimezone_convert_time (&dtstart, ds_zone, zone);
- e_meeting_attendee_set_start_busy_range (ia,
- dtstart.year,
- dtstart.month,
- dtstart.day,
- dtstart.hour,
- dtstart.minute);
- }
-
- ip = icalcomponent_get_first_property (fb_comp, ICAL_DTEND_PROPERTY);
- if (ip != NULL) {
- struct icaltimetype dtend;
- icaltimezone *de_zone;
-
- dtend = icalproperty_get_dtend (ip);
- if (!dtend.is_utc)
- de_zone = find_zone (ip, tz_top_level);
- else
- de_zone = icaltimezone_get_utc_timezone ();
- icaltimezone_convert_time (&dtend, de_zone, zone);
- e_meeting_attendee_set_end_busy_range (ia,
- dtend.year,
- dtend.month,
- dtend.day,
- dtend.hour,
- dtend.minute);
- }
-
- ip = icalcomponent_get_first_property (fb_comp, ICAL_FREEBUSY_PROPERTY);
- while (ip != NULL) {
- icalparameter *param;
- struct icalperiodtype fb;
- EMeetingFreeBusyType busy_type = E_MEETING_FREE_BUSY_LAST;
- icalparameter_fbtype fbtype = ICAL_FBTYPE_BUSY;
-
- fb = icalproperty_get_freebusy (ip);
- param = icalproperty_get_first_parameter (ip, ICAL_FBTYPE_PARAMETER);
- if (param != NULL)
- fbtype = icalparameter_get_fbtype (param);
-
- switch (fbtype) {
- case ICAL_FBTYPE_BUSY:
- busy_type = E_MEETING_FREE_BUSY_BUSY;
- break;
-
- case ICAL_FBTYPE_BUSYUNAVAILABLE:
- busy_type = E_MEETING_FREE_BUSY_OUT_OF_OFFICE;
- break;
-
- case ICAL_FBTYPE_BUSYTENTATIVE:
- busy_type = E_MEETING_FREE_BUSY_TENTATIVE;
- break;
-
- default:
- break;
- }
-
- if (busy_type != E_MEETING_FREE_BUSY_LAST) {
- icaltimezone *utc_zone = icaltimezone_get_utc_timezone ();
-
- icaltimezone_convert_time (&fb.start, utc_zone, zone);
- icaltimezone_convert_time (&fb.end, utc_zone, zone);
- e_meeting_attendee_add_busy_period (ia,
- fb.start.year,
- fb.start.month,
- fb.start.day,
- fb.start.hour,
- fb.start.minute,
- fb.end.year,
- fb.end.month,
- fb.end.day,
- fb.end.hour,
- fb.end.minute,
- busy_type);
- }
-
- ip = icalcomponent_get_next_property (fb_comp, ICAL_FREEBUSY_PROPERTY);
- }
-}
-
-static void
-process_free_busy (EMeetingModelQueueData *qdata, char *text)
-{
- EMeetingModel *im = qdata->im;
- EMeetingModelPrivate *priv;
- EMeetingAttendee *ia = qdata->ia;
- icalcomponent *main_comp;
- icalcomponent_kind kind = ICAL_NO_COMPONENT;
-
- priv = im->priv;
-
- main_comp = icalparser_parse_string (text);
- if (main_comp == NULL) {
- process_callbacks (qdata);
- return;
- }
-
- kind = icalcomponent_isa (main_comp);
- if (kind == ICAL_VCALENDAR_COMPONENT) {
- icalcompiter iter;
- icalcomponent *tz_top_level, *sub_comp;
-
- tz_top_level = e_cal_util_new_top_level ();
-
- iter = icalcomponent_begin_component (main_comp, ICAL_VTIMEZONE_COMPONENT);
- while ((sub_comp = icalcompiter_deref (&iter)) != NULL) {
- icalcomponent *clone;
-
- clone = icalcomponent_new_clone (sub_comp);
- icalcomponent_add_component (tz_top_level, clone);
-
- icalcompiter_next (&iter);
- }
-
- iter = icalcomponent_begin_component (main_comp, ICAL_VFREEBUSY_COMPONENT);
- while ((sub_comp = icalcompiter_deref (&iter)) != NULL) {
- process_free_busy_comp (ia, sub_comp, priv->zone, tz_top_level);
-
- icalcompiter_next (&iter);
- }
- icalcomponent_free (tz_top_level);
- } else if (kind == ICAL_VFREEBUSY_COMPONENT) {
- process_free_busy_comp (ia, main_comp, priv->zone, NULL);
- }
-
- icalcomponent_free (main_comp);
-
- process_callbacks (qdata);
-}
-
-static void
-async_close (GnomeVFSAsyncHandle *handle,
- GnomeVFSResult result,
- gpointer data)
-{
- EMeetingModelQueueData *qdata = data;
-
- process_free_busy (qdata, qdata->string->str);
-}
-
-static void
-async_read (GnomeVFSAsyncHandle *handle,
- GnomeVFSResult result,
- gpointer buffer,
- GnomeVFSFileSize requested,
- GnomeVFSFileSize read,
- gpointer data)
-{
- EMeetingModelQueueData *qdata = data;
- GnomeVFSFileSize buf_size = BUF_SIZE - 1;
-
- if (result != GNOME_VFS_OK && result != GNOME_VFS_ERROR_EOF) {
- gnome_vfs_async_close (handle, async_close, qdata);
- return;
- }
-
- ((char *)buffer)[read] = '\0';
- qdata->string = g_string_append (qdata->string, buffer);
-
- if (result == GNOME_VFS_ERROR_EOF) {
- gnome_vfs_async_close (handle, async_close, qdata);
- return;
- }
-
- gnome_vfs_async_read (handle, qdata->buffer, buf_size, async_read, qdata);
-}
-
-static void
-async_open (GnomeVFSAsyncHandle *handle,
- GnomeVFSResult result,
- gpointer data)
-{
- EMeetingModelQueueData *qdata = data;
- GnomeVFSFileSize buf_size = BUF_SIZE - 1;
-
- if (result != GNOME_VFS_OK) {
- gnome_vfs_async_close (handle, async_close, qdata);
- return;
- }
-
- gnome_vfs_async_read (handle, qdata->buffer, buf_size, async_read, qdata);
-}
-
-static void
-contacts_cb (EBook *book, EBookStatus status, GList *contacts, gpointer data)
-{
- EMeetingModelQueueData *qdata = data;
- GList *l;
-
- if (status != E_BOOK_ERROR_OK)
- return;
-
- for (l = contacts; l; l = l->next) {
- GnomeVFSAsyncHandle *handle;
- EContact *contact = E_CONTACT (l->data);
- const char *fburl = e_contact_get_const (contact, E_CONTACT_FREEBUSY_URL);
-
- if (!fburl || !*fburl)
- continue;
-
- /* Read in free/busy data from the url */
- gnome_vfs_async_open (&handle, fburl, GNOME_VFS_OPEN_READ,
- GNOME_VFS_PRIORITY_DEFAULT, async_open, qdata);
-
- e_free_object_list (contacts);
- return;
- }
-
- process_callbacks (qdata);
- e_free_object_list (contacts);
-}
-
-static gboolean
-refresh_busy_periods (gpointer data)
-{
- EMeetingModel *im = E_MEETING_MODEL (data);
- EMeetingModelPrivate *priv;
- EMeetingAttendee *ia = NULL;
- EMeetingModelQueueData *qdata = NULL;
- char *query;
- int i;
-
- priv = im->priv;
-
- /* Check to see if there are any remaining attendees in the queue */
- for (i = 0; i < priv->refresh_queue->len; i++) {
- ia = g_ptr_array_index (priv->refresh_queue, i);
- g_assert (ia != NULL);
-
- qdata = g_hash_table_lookup (priv->refresh_data, ia);
- g_assert (qdata != NULL);
-
- if (!qdata->refreshing)
- break;
- }
-
- /* The everything in the queue is being refreshed */
- if (i >= priv->refresh_queue->len) {
- priv->refresh_idle_id = 0;
- return FALSE;
- }
-
- /* Indicate we are trying to refresh it */
- qdata->refreshing = TRUE;
-
- /* We take a ref in case we get destroyed in the gui during a callback */
- g_object_ref (qdata->im);
-
- /* Check the server for free busy data */
- if (priv->client) {
- GList *fb_data = NULL, *users = NULL;
- struct icaltimetype itt;
- time_t startt, endt;
- const char *user;
-
- itt = icaltime_null_time ();
- itt.year = g_date_year (&qdata->start.date);
- itt.month = g_date_month (&qdata->start.date);
- itt.day = g_date_day (&qdata->start.date);
- itt.hour = qdata->start.hour;
- itt.minute = qdata->start.minute;
- startt = icaltime_as_timet_with_zone (itt, priv->zone);
-
- itt = icaltime_null_time ();
- itt.year = g_date_year (&qdata->end.date);
- itt.month = g_date_month (&qdata->end.date);
- itt.day = g_date_day (&qdata->end.date);
- itt.hour = qdata->end.hour;
- itt.minute = qdata->end.minute;
- endt = icaltime_as_timet_with_zone (itt, priv->zone);
-
- user = itip_strip_mailto (e_meeting_attendee_get_address (ia));
- users = g_list_append (users, g_strdup (user));
-
- /* FIXME Error checking */
- e_cal_get_free_busy (priv->client, users, startt, endt, &fb_data, NULL);
-
- g_list_foreach (users, (GFunc)g_free, NULL);
- g_list_free (users);
-
- if (fb_data != NULL) {
- ECalComponent *comp = fb_data->data;
- char *comp_str;
-
- comp_str = e_cal_component_get_as_string (comp);
- process_free_busy (qdata, comp_str);
- g_free (comp_str);
- return TRUE;
- }
- }
-
- /* Look for fburl's of attendee with no free busy info on server */
- if (!priv->book_loaded) {
- priv->book_load_wait = TRUE;
- gtk_main ();
- }
-
- if (!e_meeting_attendee_is_set_address (ia)) {
- process_callbacks (qdata);
- return TRUE;
- }
-
- query = g_strdup_printf ("(is \"email\" \"%s\")",
- itip_strip_mailto (e_meeting_attendee_get_address (ia)));
- if (!e_book_async_get_contacts (priv->ebook, query, contacts_cb, qdata))
- process_callbacks (qdata);
- g_free (query);
-
- return TRUE;
-}
-
-void
-e_meeting_model_refresh_all_busy_periods (EMeetingModel *im,
- EMeetingTime *start,
- EMeetingTime *end,
- EMeetingModelRefreshCallback call_back,
- gpointer data)
-{
- EMeetingModelPrivate *priv;
- int i;
-
- g_return_if_fail (im != NULL);
- g_return_if_fail (E_IS_MEETING_MODEL (im));
-
- priv = im->priv;
-
- for (i = 0; i < priv->attendees->len; i++)
- refresh_queue_add (im, i, start, end, call_back, data);
-}
-
-void
-e_meeting_model_refresh_busy_periods (EMeetingModel *im,
- int row,
- EMeetingTime *start,
- EMeetingTime *end,
- EMeetingModelRefreshCallback call_back,
- gpointer data)
-{
- EMeetingModelPrivate *priv;
-
- g_return_if_fail (im != NULL);
- g_return_if_fail (E_IS_MEETING_MODEL (im));
-
- priv = im->priv;
-
- refresh_queue_add (im, row, start, end, call_back, data);
-}
-
-ETableScrolled *
-e_meeting_model_etable_from_model (EMeetingModel *im, const gchar *spec_file, const gchar *state_file)
-{
- EMeetingModelPrivate *priv;
- ETableScrolled *ets;
-
- g_return_val_if_fail (im != NULL, NULL);
- g_return_val_if_fail (E_IS_MEETING_MODEL (im), NULL);
-
- priv = im->priv;
-
- ets = build_etable (E_TABLE_MODEL (im), spec_file, state_file);
-
- priv->tables = g_list_prepend (priv->tables, ets);
-
- g_signal_connect (ets, "destroy", G_CALLBACK (table_destroy_list_cb), im);
-
- return ets;
-}
-
-void
-e_meeting_model_etable_click_to_add (EMeetingModel *im, gboolean click_to_add)
-{
- EMeetingModelPrivate *priv;
- GList *l;
-
- g_return_if_fail (im != NULL);
- g_return_if_fail (E_IS_MEETING_MODEL (im));
-
- priv = im->priv;
-
- for (l = priv->tables; l != NULL; l = l->next) {
- ETableScrolled *ets;
- ETable *real_table;
-
- ets = l->data;
- real_table = e_table_scrolled_get_table (ets);
-
- g_object_set (G_OBJECT (real_table), "use_click_to_add", click_to_add, NULL);
- }
-}
-
-int
-e_meeting_model_etable_model_to_view_row (ETable *et, EMeetingModel *im, int model_row)
-{
- EMeetingModelPrivate *priv;
-
- g_return_val_if_fail (im != NULL, -1);
- g_return_val_if_fail (E_IS_MEETING_MODEL (im), -1);
-
- priv = im->priv;
-
- return e_table_model_to_view_row (et, model_row);
-}
-
-int
-e_meeting_model_etable_view_to_model_row (ETable *et, EMeetingModel *im, int view_row)
-{
- EMeetingModelPrivate *priv;
-
- g_return_val_if_fail (im != NULL, -1);
- g_return_val_if_fail (E_IS_MEETING_MODEL (im), -1);
-
- priv = im->priv;
-
- return e_table_view_to_model_row (et, view_row);
-}
-
-
-static void
-add_section (GNOME_Evolution_Addressbook_SelectNames corba_select_names, const char *name)
-{
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
-
- GNOME_Evolution_Addressbook_SelectNames_addSection (corba_select_names,
- name,
- gettext (name),
- &ev);
-
- CORBA_exception_free (&ev);
-}
-
-static gboolean
-get_select_name_dialog (EMeetingModel *im)
-{
- EMeetingModelPrivate *priv;
- CORBA_Environment ev;
- int i;
-
- priv = im->priv;
-
- if (priv->corba_select_names != CORBA_OBJECT_NIL) {
- Bonobo_Control corba_control;
- GtkWidget *control_widget;
- int i;
-
- CORBA_exception_init (&ev);
- for (i = 0; sections[i] != NULL; i++) {
- corba_control = GNOME_Evolution_Addressbook_SelectNames_getEntryBySection
- (priv->corba_select_names, sections[i], &ev);
- if (BONOBO_EX (&ev)) {
- CORBA_exception_free (&ev);
- return FALSE;
- }
-
- control_widget = bonobo_widget_new_control_from_objref (corba_control, CORBA_OBJECT_NIL);
-
- bonobo_widget_set_property (BONOBO_WIDGET (control_widget), "text", TC_CORBA_string, "", NULL);
- }
- CORBA_exception_free (&ev);
-
- return TRUE;
- }
-
- CORBA_exception_init (&ev);
-
- priv->corba_select_names = bonobo_activation_activate_from_id (SELECT_NAMES_OAFID, 0, NULL, &ev);
-
- for (i = 0; sections[i] != NULL; i++)
- add_section (priv->corba_select_names, sections[i]);
-
- bonobo_event_source_client_add_listener (priv->corba_select_names,
- (BonoboListenerCallbackFn) select_names_ok_cb,
- "GNOME/Evolution:ok:dialog",
- NULL, im);
-
- if (BONOBO_EX (&ev)) {
- CORBA_exception_free (&ev);
- return FALSE;
- }
-
- CORBA_exception_free (&ev);
-
- return TRUE;
-}
-
-void
-e_meeting_model_invite_others_dialog (EMeetingModel *im)
-{
- EMeetingModelPrivate *priv;
- CORBA_Environment ev;
-
- priv = im->priv;
-
- if (!get_select_name_dialog (im))
- return;
-
- CORBA_exception_init (&ev);
-
- GNOME_Evolution_Addressbook_SelectNames_activateDialog (
- priv->corba_select_names, _("Required Participants"), &ev);
-
- CORBA_exception_free (&ev);
-}
-
-static void
-process_section (EMeetingModel *im, EABDestination **destv, icalparameter_role role)
-{
- EMeetingModelPrivate *priv;
- int i;
-
- if (!destv)
- return;
-
- priv = im->priv;
- for (i = 0; destv[i]; i++) {
- EMeetingAttendee *ia;
- const char *name, *attendee = NULL;
- char *attr;
- CORBA_Environment ev;
- EABDestination *dest = destv[i];
-
- CORBA_exception_init (&ev);
-
- /* Get the CN */
- name = eab_destination_get_name (dest);
-
- /* Get the field as attendee from the backend */
- if (e_cal_get_ldap_attribute (priv->client, &attr, NULL) && attr) {
- /* FIXME this should be more general */
- if (!strcmp (attr, "icscalendar")) {
- EContact *contact = eab_destination_get_contact (dest);
- if (contact)
- attendee = e_contact_get_const (contact, E_CONTACT_ICS_CALENDAR);
- }
-
- g_free (attr);
- }
-
- CORBA_exception_init (&ev);
-
- /* If we couldn't get the attendee prior, get the email address as the default */
- if (attendee == NULL || *attendee == '\0') {
- attendee = eab_destination_get_email (dest);
- }
-
- CORBA_exception_free (&ev);
-
- if (attendee == NULL || *attendee == '\0')
- continue;
-
- if (e_meeting_model_find_attendee (im, attendee, NULL) == NULL) {
- ia = e_meeting_model_add_attendee_with_defaults (im);
-
- e_meeting_attendee_set_address (ia, g_strdup_printf ("MAILTO:%s", attendee));
- e_meeting_attendee_set_role (ia, role);
- if (role == ICAL_ROLE_NONPARTICIPANT)
- e_meeting_attendee_set_cutype (ia, ICAL_CUTYPE_RESOURCE);
- e_meeting_attendee_set_cn (ia, g_strdup (name));
- }
- }
-}
-
-static void
-select_names_ok_cb (BonoboListener *listener,
- const char *event_name,
- const CORBA_any *arg,
- CORBA_Environment *ev,
- gpointer data)
-{
- EMeetingModel *im = data;
- EMeetingModelPrivate *priv;
- Bonobo_Control corba_control;
- GtkWidget *control_widget;
- BonoboControlFrame *control_frame;
- Bonobo_PropertyBag pb;
- char *dest_str;
- EABDestination **dest;
- int i;
-
- priv = im->priv;
-
- for (i = 0; sections[i] != NULL; i++) {
- corba_control = GNOME_Evolution_Addressbook_SelectNames_getEntryBySection
- (priv->corba_select_names, sections[i], ev);
- control_widget = bonobo_widget_new_control_from_objref
- (corba_control, CORBA_OBJECT_NIL);
-
- control_frame = bonobo_widget_get_control_frame (BONOBO_WIDGET (control_widget));
- pb = bonobo_control_frame_get_control_property_bag (control_frame, NULL);
- dest_str = bonobo_pbclient_get_string (pb, "destinations", NULL);
- dest = eab_destination_importv (dest_str);
- process_section (im, dest, roles[i]);
- eab_destination_freev (dest);
- }
-}
-
-static void
-attendee_changed_cb (EMeetingAttendee *ia, gpointer data)
-{
- EMeetingModel *im = E_MEETING_MODEL (data);
- EMeetingModelPrivate *priv;
- gint row = -1, i;
-
- priv = im->priv;
-
- /* FIXME: Ideally I think you are supposed to call pre_change() before
- the data structures are changed. */
- e_table_model_pre_change (E_TABLE_MODEL (im));
-
- for (i = 0; i < priv->attendees->len; i++) {
- if (ia == g_ptr_array_index (priv->attendees, i)) {
- row = i;
- break;
- }
- }
-
- if (row == -1)
- e_table_model_no_change (E_TABLE_MODEL (im));
- else
- e_table_model_row_changed (E_TABLE_MODEL (im), row);
-}
-
-static void
-table_destroy_state_cb (ETableScrolled *etable, gpointer data)
-{
- ETable *real_table;
- char *filename = data;
-
- real_table = e_table_scrolled_get_table (etable);
- e_table_save_state (real_table, filename);
-
- g_free (data);
-}
-
-static void
-table_destroy_list_cb (ETableScrolled *etable, gpointer data)
-{
- EMeetingModel *im = E_MEETING_MODEL (data);
- EMeetingModelPrivate *priv;
-
- priv = im->priv;
-
- priv->tables = g_list_remove (priv->tables, etable);
-}
-
diff --git a/calendar/gui/e-meeting-model.h b/calendar/gui/e-meeting-model.h
deleted file mode 100644
index e709cd3aa4..0000000000
--- a/calendar/gui/e-meeting-model.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* e-model.h
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: JP Rosevear
- */
-
-#ifndef _E_MEETING_MODEL_H_
-#define _E_MEETING_MODEL_H_
-
-#include <gtk/gtk.h>
-#include <gal/e-table/e-table-scrolled.h>
-#include <gal/e-table/e-table-model.h>
-#include <libecal/e-cal.h>
-#include "e-meeting-attendee.h"
-
-G_BEGIN_DECLS
-
-#define E_TYPE_MEETING_MODEL (e_meeting_model_get_type ())
-#define E_MEETING_MODEL(obj) (GTK_CHECK_CAST ((obj), E_TYPE_MEETING_MODEL, EMeetingModel))
-#define E_MEETING_MODEL_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_TYPE_MEETING_MODEL, EMeetingModelClass))
-#define E_IS_MEETING_MODEL(obj) (GTK_CHECK_TYPE ((obj), E_TYPE_MEETING_MODEL))
-#define E_IS_MEETING_MODEL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_TYPE_MEETING_MODEL))
-
-
-typedef struct _EMeetingModel EMeetingModel;
-typedef struct _EMeetingModelPrivate EMeetingModelPrivate;
-typedef struct _EMeetingModelClass EMeetingModelClass;
-
-typedef enum {
- E_MEETING_MODEL_ADDRESS_COL,
- E_MEETING_MODEL_MEMBER_COL,
- E_MEETING_MODEL_TYPE_COL,
- E_MEETING_MODEL_ROLE_COL,
- E_MEETING_MODEL_RSVP_COL,
- E_MEETING_MODEL_DELTO_COL,
- E_MEETING_MODEL_DELFROM_COL,
- E_MEETING_MODEL_STATUS_COL,
- E_MEETING_MODEL_CN_COL,
- E_MEETING_MODEL_LANGUAGE_COL,
- E_MEETING_MODEL_COLUMN_COUNT
-} EMeetingModelColumns;
-
-struct _EMeetingModel {
- ETableModel parent;
-
- EMeetingModelPrivate *priv;
-};
-
-struct _EMeetingModelClass {
- ETableModelClass parent_class;
-};
-
-typedef void (* EMeetingModelRefreshCallback) (gpointer data);
-
-
-GtkType e_meeting_model_get_type (void);
-GtkObject *e_meeting_model_new (void);
-
-ECal *e_meeting_model_get_e_cal (EMeetingModel *im);
-void e_meeting_model_set_e_cal (EMeetingModel *im, ECal *client);
-
-icaltimezone *e_meeting_model_get_zone (EMeetingModel *im);
-void e_meeting_model_set_zone (EMeetingModel *im, icaltimezone *zone);
-
-void e_meeting_model_add_attendee (EMeetingModel *im, EMeetingAttendee *ia);
-EMeetingAttendee *e_meeting_model_add_attendee_with_defaults (EMeetingModel *im);
-
-void e_meeting_model_remove_attendee (EMeetingModel *im, EMeetingAttendee *ia);
-void e_meeting_model_remove_all_attendees (EMeetingModel *im);
-
-EMeetingAttendee *e_meeting_model_find_attendee (EMeetingModel *im, const gchar *address, gint *row);
-EMeetingAttendee *e_meeting_model_find_attendee_at_row (EMeetingModel *im, gint row);
-
-gint e_meeting_model_count_actual_attendees (EMeetingModel *im);
-const GPtrArray *e_meeting_model_get_attendees (EMeetingModel *im);
-
-void e_meeting_model_refresh_all_busy_periods (EMeetingModel *im,
- EMeetingTime *start,
- EMeetingTime *end,
- EMeetingModelRefreshCallback call_back,
- gpointer data);
-void e_meeting_model_refresh_busy_periods (EMeetingModel *im,
- int row,
- EMeetingTime *start,
- EMeetingTime *end,
- EMeetingModelRefreshCallback call_back,
- gpointer data);
-
-
-/* Helpful functions */
-ETableScrolled *e_meeting_model_etable_from_model (EMeetingModel *im, const gchar *spec_file, const gchar *state_file);
-void e_meeting_model_etable_click_to_add (EMeetingModel *im, gboolean click_to_add);
-int e_meeting_model_etable_model_to_view_row (ETable *et, EMeetingModel *im, int model_row);
-int e_meeting_model_etable_view_to_model_row (ETable *et, EMeetingModel *im, int view_row);
-
-void e_meeting_model_invite_others_dialog (EMeetingModel *im);
-
-G_END_DECLS
-
-#endif
diff --git a/calendar/gui/e-meeting-store.c b/calendar/gui/e-meeting-store.c
deleted file mode 100644
index 01ac267fe1..0000000000
--- a/calendar/gui/e-meeting-store.c
+++ /dev/null
@@ -1,1295 +0,0 @@
-/*
- * e-meeting-store.c
- *
- * Copyright (C) 2001-2003 Ximian, Inc.
- *
- * Authors: JP Rosevear <jpr@ximian.com>
- * Mike Kestner <mkestner@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <glib.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnome/gnome-util.h>
-#include <libgnomevfs/gnome-vfs.h>
-#include <libebook/e-book.h>
-#include <libecal/e-cal-component.h>
-#include <libecal/e-cal-util.h>
-#include <libecal/e-cal-time-util.h>
-#include "calendar-config.h"
-#include "itip-utils.h"
-#include "e-meeting-utils.h"
-#include "e-meeting-attendee.h"
-#include "e-meeting-store.h"
-
-#define ROW_VALID(store, row) (row >= 0 && row < store->priv->attendees->len)
-
-struct _EMeetingStorePrivate {
- GPtrArray *attendees;
- gint stamp;
-
- ECal *client;
- icaltimezone *zone;
-
- EBook *ebook;
-
- GPtrArray *refresh_queue;
- GHashTable *refresh_data;
- guint refresh_idle_id;
-};
-
-#define BUF_SIZE 1024
-
-typedef struct _EMeetingStoreQueueData EMeetingStoreQueueData;
-struct _EMeetingStoreQueueData {
- EMeetingStore *store;
- EMeetingAttendee *attendee;
-
- gboolean refreshing;
-
- EMeetingTime start;
- EMeetingTime end;
-
- char buffer[BUF_SIZE];
- GString *string;
-
- GPtrArray *call_backs;
- GPtrArray *data;
-};
-
-
-static GObjectClass *parent_class = NULL;
-
-static void
-start_addressbook_server (EMeetingStore *store)
-{
- store->priv->ebook = e_book_new ();
- e_book_load_local_addressbook (store->priv->ebook, NULL);
-}
-
-static icalparameter_cutype
-text_to_type (const char *type)
-{
- if (!g_strcasecmp (type, _("Individual")))
- return ICAL_CUTYPE_INDIVIDUAL;
- else if (!g_strcasecmp (type, _("Group")))
- return ICAL_CUTYPE_GROUP;
- else if (!g_strcasecmp (type, _("Resource")))
- return ICAL_CUTYPE_RESOURCE;
- else if (!g_strcasecmp (type, _("Room")))
- return ICAL_CUTYPE_ROOM;
- else
- return ICAL_CUTYPE_NONE;
-}
-
-static char *
-type_to_text (icalparameter_cutype type)
-{
- switch (type) {
- case ICAL_CUTYPE_INDIVIDUAL:
- return _("Individual");
- case ICAL_CUTYPE_GROUP:
- return _("Group");
- case ICAL_CUTYPE_RESOURCE:
- return _("Resource");
- case ICAL_CUTYPE_ROOM:
- return _("Room");
- default:
- return _("Unknown");
- }
-
- return NULL;
-
-}
-
-static icalparameter_role
-text_to_role (const char *role)
-{
- if (!g_strcasecmp (role, _("Chair")))
- return ICAL_ROLE_CHAIR;
- else if (!g_strcasecmp (role, _("Required Participant")))
- return ICAL_ROLE_REQPARTICIPANT;
- else if (!g_strcasecmp (role, _("Optional Participant")))
- return ICAL_ROLE_OPTPARTICIPANT;
- else if (!g_strcasecmp (role, _("Non-Participant")))
- return ICAL_ROLE_NONPARTICIPANT;
- else
- return ICAL_ROLE_NONE;
-}
-
-static char *
-role_to_text (icalparameter_role role)
-{
- switch (role) {
- case ICAL_ROLE_CHAIR:
- return _("Chair");
- case ICAL_ROLE_REQPARTICIPANT:
- return _("Required Participant");
- case ICAL_ROLE_OPTPARTICIPANT:
- return _("Optional Participant");
- case ICAL_ROLE_NONPARTICIPANT:
- return _("Non-Participant");
- default:
- return _("Unknown");
- }
-
- return NULL;
-}
-
-static gboolean
-text_to_boolean (const char *role)
-{
- if (!g_strcasecmp (role, _("Yes")))
- return TRUE;
- else
- return FALSE;
-}
-
-static char *
-boolean_to_text (gboolean b)
-{
- if (b)
- return _("Yes");
- else
- return _("No");
-}
-
-static icalparameter_partstat
-text_to_partstat (const char *partstat)
-{
- if (!g_strcasecmp (partstat, _("Needs Action")))
- return ICAL_PARTSTAT_NEEDSACTION;
- else if (!g_strcasecmp (partstat, _("Accepted")))
- return ICAL_PARTSTAT_ACCEPTED;
- else if (!g_strcasecmp (partstat, _("Declined")))
- return ICAL_PARTSTAT_DECLINED;
- else if (!g_strcasecmp (partstat, _("Tentative")))
- return ICAL_PARTSTAT_TENTATIVE;
- else if (!g_strcasecmp (partstat, _("Delegated")))
- return ICAL_PARTSTAT_DELEGATED;
- else if (!g_strcasecmp (partstat, _("Completed")))
- return ICAL_PARTSTAT_COMPLETED;
- else if (!g_strcasecmp (partstat, _("In Process")))
- return ICAL_PARTSTAT_INPROCESS;
- else
- return ICAL_PARTSTAT_NONE;
-}
-
-static char *
-partstat_to_text (icalparameter_partstat partstat)
-{
- switch (partstat) {
- case ICAL_PARTSTAT_NEEDSACTION:
- return _("Needs Action");
- case ICAL_PARTSTAT_ACCEPTED:
- return _("Accepted");
- case ICAL_PARTSTAT_DECLINED:
- return _("Declined");
- case ICAL_PARTSTAT_TENTATIVE:
- return _("Tentative");
- case ICAL_PARTSTAT_DELEGATED:
- return _("Delegated");
- case ICAL_PARTSTAT_COMPLETED:
- return _("Completed");
- case ICAL_PARTSTAT_INPROCESS:
- return _("In Process");
- case ICAL_PARTSTAT_NONE:
- default:
- return _("Unknown");
- }
-
- return NULL;
-}
-
-static GtkTreeModelFlags
-get_flags (GtkTreeModel *model)
-{
- g_return_val_if_fail (E_IS_MEETING_STORE (model), 0);
-
- return GTK_TREE_MODEL_ITERS_PERSIST | GTK_TREE_MODEL_LIST_ONLY;
-}
-
-static int
-get_n_columns (GtkTreeModel *model)
-{
- g_return_val_if_fail (E_IS_MEETING_STORE (model), 0);
-
- return E_MEETING_STORE_COLUMN_COUNT;
-}
-
-static GType
-get_column_type (GtkTreeModel *model, int col)
-{
- g_return_val_if_fail (E_IS_MEETING_STORE (model), G_TYPE_INVALID);
-
- switch (col) {
- case E_MEETING_STORE_ADDRESS_COL:
- case E_MEETING_STORE_MEMBER_COL:
- case E_MEETING_STORE_TYPE_COL:
- case E_MEETING_STORE_ROLE_COL:
- case E_MEETING_STORE_RSVP_COL:
- case E_MEETING_STORE_DELTO_COL:
- case E_MEETING_STORE_DELFROM_COL:
- case E_MEETING_STORE_STATUS_COL:
- case E_MEETING_STORE_CN_COL:
- case E_MEETING_STORE_LANGUAGE_COL:
- case E_MEETING_STORE_ATTENDEE_COL:
- return G_TYPE_STRING;
- case E_MEETING_STORE_ATTENDEE_UNDERLINE_COL:
- return PANGO_TYPE_UNDERLINE;
- default:
- return G_TYPE_INVALID;
- }
-}
-
-static gboolean
-get_iter (GtkTreeModel *model, GtkTreeIter *iter, GtkTreePath *path)
-{
- int row;
-
- g_return_val_if_fail (E_IS_MEETING_STORE (model), FALSE);
- g_return_val_if_fail (gtk_tree_path_get_depth (path) > 0, FALSE);
-
- row = gtk_tree_path_get_indices (path) [0];
-
- if (!ROW_VALID (E_MEETING_STORE (model), row))
- return FALSE;
-
- iter->stamp = E_MEETING_STORE (model)->priv->stamp;
- iter->user_data = GINT_TO_POINTER (row);
-
- return TRUE;
-}
-
-static GtkTreePath *
-get_path (GtkTreeModel *model, GtkTreeIter *iter)
-{
- int row;
- GtkTreePath *result;
-
- g_return_val_if_fail (E_IS_MEETING_STORE (model), NULL);
- g_return_val_if_fail (iter->stamp == E_MEETING_STORE (model)->priv->stamp, NULL);
-
- row = GPOINTER_TO_INT (iter->user_data);
-
- g_return_val_if_fail (ROW_VALID (E_MEETING_STORE (model), row), NULL);
-
- result = gtk_tree_path_new ();
- gtk_tree_path_append_index (result, row);
- return result;
-}
-
-static void
-get_value (GtkTreeModel *model, GtkTreeIter *iter, int col, GValue *value)
-{
- EMeetingStore *store;
- EMeetingAttendee *attendee;
- const gchar *cn;
- int row;
-
- g_return_if_fail (E_IS_MEETING_STORE (model));
- g_return_if_fail (col >= 0 && col < E_MEETING_STORE_COLUMN_COUNT);
-
- row = GPOINTER_TO_INT (iter->user_data);
- store = E_MEETING_STORE (model);
-
- g_return_if_fail (iter->stamp == store->priv->stamp);
- g_return_if_fail (ROW_VALID (E_MEETING_STORE (model), row));
-
- attendee = g_ptr_array_index (store->priv->attendees, row);
-
- switch (col) {
- case E_MEETING_STORE_ADDRESS_COL:
- g_value_init (value, G_TYPE_STRING);
- g_value_set_string (value, itip_strip_mailto (e_meeting_attendee_get_address (attendee)));
- break;
- case E_MEETING_STORE_MEMBER_COL:
- g_value_init (value, G_TYPE_STRING);
- g_value_set_string (value, e_meeting_attendee_get_member (attendee));
- break;
- case E_MEETING_STORE_TYPE_COL:
- g_value_init (value, G_TYPE_STRING);
- g_value_set_string (value, type_to_text (e_meeting_attendee_get_cutype (attendee)));
- break;
- case E_MEETING_STORE_ROLE_COL:
- g_value_init (value, G_TYPE_STRING);
- g_value_set_string (value, role_to_text (e_meeting_attendee_get_role (attendee)));
- break;
- case E_MEETING_STORE_RSVP_COL:
- g_value_init (value, G_TYPE_STRING);
- g_value_set_string (value, boolean_to_text (e_meeting_attendee_get_rsvp (attendee)));
- break;
- case E_MEETING_STORE_DELTO_COL:
- g_value_init (value, G_TYPE_STRING);
- g_value_set_string (value, itip_strip_mailto (e_meeting_attendee_get_delto (attendee)));
- break;
- case E_MEETING_STORE_DELFROM_COL:
- g_value_init (value, G_TYPE_STRING);
- g_value_set_string (value, itip_strip_mailto (e_meeting_attendee_get_delfrom (attendee)));
- break;
- case E_MEETING_STORE_STATUS_COL:
- g_value_init (value, G_TYPE_STRING);
- g_value_set_string (value, partstat_to_text (e_meeting_attendee_get_status (attendee)));
- break;
- case E_MEETING_STORE_CN_COL:
- g_value_init (value, G_TYPE_STRING);
- g_value_set_string (value, e_meeting_attendee_get_cn (attendee));
- break;
- case E_MEETING_STORE_LANGUAGE_COL:
- g_value_init (value, G_TYPE_STRING);
- g_value_set_string (value, e_meeting_attendee_get_language (attendee));
- break;
- case E_MEETING_STORE_ATTENDEE_COL:
- g_value_init (value, G_TYPE_STRING);
- cn = e_meeting_attendee_get_cn (attendee);
- if (strcmp (cn, ""))
- g_value_set_string (value, cn);
- else
- g_value_set_string (value, itip_strip_mailto (e_meeting_attendee_get_address (attendee)));
- break;
- case E_MEETING_STORE_ATTENDEE_UNDERLINE_COL:
- cn = e_meeting_attendee_get_cn (attendee);
- g_value_init (value, PANGO_TYPE_UNDERLINE);
- g_value_set_enum (value, strcmp ("", cn) == 0 ? PANGO_UNDERLINE_NONE : PANGO_UNDERLINE_SINGLE);
- }
-}
-
-static gboolean
-iter_next (GtkTreeModel *model, GtkTreeIter *iter)
-{
- int row;
-
- g_return_val_if_fail (E_IS_MEETING_STORE (model), FALSE);
- g_return_val_if_fail (iter->stamp == E_MEETING_STORE (model)->priv->stamp, FALSE);
-
- row = GPOINTER_TO_INT (iter->user_data) + 1;
- iter->user_data = GINT_TO_POINTER (row);
-
- return ROW_VALID (E_MEETING_STORE (model), row);
-}
-
-static gboolean
-iter_children (GtkTreeModel *model, GtkTreeIter *iter, GtkTreeIter *parent)
-{
- EMeetingStore *store;
-
- g_return_val_if_fail (E_IS_MEETING_STORE (model), FALSE);
-
- store = E_MEETING_STORE (model);
-
- if (parent || store->priv->attendees->len <= 0)
- return FALSE;
-
- iter->stamp = store->priv->stamp;
- iter->user_data = GINT_TO_POINTER (0);
-
- return TRUE;
-}
-
-static gboolean
-iter_has_child (GtkTreeModel *model, GtkTreeIter *iter)
-{
- return FALSE;
-}
-
-static int
-iter_n_children (GtkTreeModel *model, GtkTreeIter *iter)
-{
- g_return_val_if_fail (E_IS_MEETING_STORE (model), -1);
-
- if (!iter)
- return E_MEETING_STORE (model)->priv->attendees->len;
-
- g_return_val_if_fail (iter->stamp == E_MEETING_STORE (model)->priv->stamp, -1);
-
- return 0;
-}
-
-static gboolean
-iter_nth_child (GtkTreeModel *model, GtkTreeIter *iter, GtkTreeIter *parent, int n)
-{
- EMeetingStore *store;
-
- g_return_val_if_fail (E_IS_MEETING_STORE (model), FALSE);
-
- store = E_MEETING_STORE (model);
-
- if (parent || !ROW_VALID (store, n))
- return FALSE;
-
- iter->stamp = store->priv->stamp;
- iter->user_data = GINT_TO_POINTER (n);
-
- return TRUE;
-}
-
-static gboolean
-iter_parent (GtkTreeModel *model, GtkTreeIter *iter, GtkTreeIter *child)
-{
- return FALSE;
-}
-
-static void
-ems_tree_model_init (GtkTreeModelIface *iface)
-{
- iface->get_flags = get_flags;
- iface->get_n_columns = get_n_columns;
- iface->get_column_type = get_column_type;
- iface->get_iter = get_iter;
- iface->get_path = get_path;
- iface->get_value = get_value;
- iface->iter_next = iter_next;
- iface->iter_children = iter_children;
- iface->iter_has_child = iter_has_child;
- iface->iter_n_children = iter_n_children;
- iface->iter_nth_child = iter_nth_child;
- iface->iter_parent = iter_parent;
-}
-
-void
-e_meeting_store_set_value (EMeetingStore *store, int row, int col, const gchar *val)
-{
- icalparameter_cutype type;
- EMeetingAttendee *attendee = g_ptr_array_index (store->priv->attendees, row);
-
- switch (col) {
- case E_MEETING_STORE_ADDRESS_COL:
- if (val != NULL && *((char *)val))
- e_meeting_attendee_set_address (attendee, g_strdup_printf ("MAILTO:%s", (char *) val));
- break;
- case E_MEETING_STORE_MEMBER_COL:
- e_meeting_attendee_set_member (attendee, g_strdup (val));
- break;
- case E_MEETING_STORE_TYPE_COL:
- type = text_to_type (val);
- e_meeting_attendee_set_cutype (attendee, text_to_type (val));
- if (type == ICAL_CUTYPE_RESOURCE) {
- e_meeting_attendee_set_role (attendee, ICAL_ROLE_NONPARTICIPANT);
- }
- break;
- case E_MEETING_STORE_ROLE_COL:
- e_meeting_attendee_set_role (attendee, text_to_role (val));
- break;
- case E_MEETING_STORE_RSVP_COL:
- e_meeting_attendee_set_rsvp (attendee, text_to_boolean (val));
- break;
- case E_MEETING_STORE_DELTO_COL:
- e_meeting_attendee_set_delto (attendee, g_strdup (val));
- break;
- case E_MEETING_STORE_DELFROM_COL:
- e_meeting_attendee_set_delfrom (attendee, g_strdup (val));
- break;
- case E_MEETING_STORE_STATUS_COL:
- e_meeting_attendee_set_status (attendee, text_to_partstat (val));
- break;
- case E_MEETING_STORE_CN_COL:
- e_meeting_attendee_set_cn (attendee, g_strdup (val));
- break;
- case E_MEETING_STORE_LANGUAGE_COL:
- e_meeting_attendee_set_language (attendee, g_strdup (val));
- break;
- }
-}
-
-static gboolean
-is_cell_editable (EMeetingStore *etm, int col, int row)
-{
- EMeetingStore *store;
- EMeetingStorePrivate *priv;
- EMeetingAttendee *attendee;
- EMeetingAttendeeEditLevel level;
-
- store = E_MEETING_STORE (etm);
- priv = store->priv;
-
- if (col == E_MEETING_STORE_DELTO_COL
- || col == E_MEETING_STORE_DELFROM_COL)
- return FALSE;
-
- if (row == -1)
- return TRUE;
- if (row >= priv->attendees->len)
- return TRUE;
-
- attendee = g_ptr_array_index (priv->attendees, row);
- level = e_meeting_attendee_get_edit_level (attendee);
-
- switch (level) {
- case E_MEETING_ATTENDEE_EDIT_FULL:
- return TRUE;
- case E_MEETING_ATTENDEE_EDIT_STATUS:
- return col == E_MEETING_STORE_STATUS_COL;
- case E_MEETING_ATTENDEE_EDIT_NONE:
- return FALSE;
- }
-
- return TRUE;
-}
-
-static void
-refresh_queue_remove (EMeetingStore *store, EMeetingAttendee *attendee)
-{
- EMeetingStorePrivate *priv;
- EMeetingStoreQueueData *qdata;
-
- priv = store->priv;
-
- /* Free the queue data */
- qdata = g_hash_table_lookup (priv->refresh_data, attendee);
- if (qdata) {
- g_hash_table_remove (priv->refresh_data, attendee);
- g_ptr_array_free (qdata->call_backs, TRUE);
- g_ptr_array_free (qdata->data, TRUE);
- g_free (qdata);
- }
-
- /* Unref the attendee */
- g_ptr_array_remove (priv->refresh_queue, attendee);
- g_object_unref (attendee);
-}
-
-static void
-ems_finalize (GObject *obj)
-{
- EMeetingStore *store = E_MEETING_STORE (obj);
- EMeetingStorePrivate *priv;
- int i;
-
- priv = store->priv;
-
- for (i = 0; i < priv->attendees->len; i++)
- g_object_unref (g_ptr_array_index (priv->attendees, i));
- g_ptr_array_free (priv->attendees, TRUE);
-
- if (priv->client != NULL)
- g_object_unref (priv->client);
-
- if (priv->ebook != NULL)
- g_object_unref (priv->ebook);
-
- while (priv->refresh_queue->len > 0)
- refresh_queue_remove (store, g_ptr_array_index (priv->refresh_queue, 0));
- g_ptr_array_free (priv->refresh_queue, TRUE);
- g_hash_table_destroy (priv->refresh_data);
-
- if (priv->refresh_idle_id)
- g_source_remove (priv->refresh_idle_id);
-
- g_free (priv);
-
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (obj);
-}
-
-static void
-ems_class_init (GObjectClass *klass)
-{
- parent_class = g_type_class_peek_parent (klass);
-
- klass->finalize = ems_finalize;
-}
-
-
-static void
-ems_init (EMeetingStore *store)
-{
- EMeetingStorePrivate *priv;
-
- priv = g_new0 (EMeetingStorePrivate, 1);
-
- store->priv = priv;
-
- priv->attendees = g_ptr_array_new ();
-
- priv->zone = icaltimezone_get_builtin_timezone (calendar_config_get_timezone ());
-
- priv->refresh_queue = g_ptr_array_new ();
- priv->refresh_data = g_hash_table_new (g_direct_hash, g_direct_equal);
-
- start_addressbook_server (store);
-}
-
-GType
-e_meeting_store_get_type (void)
-{
- static GType ems_type = 0;
-
- if (!ems_type) {
- static const GTypeInfo ems_info = {
- sizeof (EMeetingStoreClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) ems_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EMeetingStore),
- 0,
- (GInstanceInitFunc) ems_init };
-
- static const GInterfaceInfo tree_model_info = {
- (GInterfaceInitFunc) ems_tree_model_init,
- NULL,
- NULL };
-
- ems_type = g_type_register_static (GTK_TYPE_LIST_STORE,
- "EMeetingStore",
- &ems_info, 0);
-
- g_type_add_interface_static (ems_type,
- GTK_TYPE_TREE_MODEL,
- &tree_model_info);
- }
-
- return ems_type;
-}
-
-GObject *
-e_meeting_store_new (void)
-{
- return g_object_new (E_TYPE_MEETING_STORE, NULL);
-}
-
-
-ECal *
-e_meeting_store_get_e_cal (EMeetingStore *store)
-{
- return store->priv->client;
-}
-
-void
-e_meeting_store_set_e_cal (EMeetingStore *store, ECal *client)
-{
- if (store->priv->client != NULL)
- g_object_unref (store->priv->client);
-
- if (client != NULL)
- g_object_ref (client);
- store->priv->client = client;
-}
-
-icaltimezone *
-e_meeting_store_get_zone (EMeetingStore *store)
-{
- g_return_val_if_fail (E_IS_MEETING_STORE (store), NULL);
-
- return store->priv->zone;
-}
-
-void
-e_meeting_store_set_zone (EMeetingStore *store, icaltimezone *zone)
-{
- g_return_if_fail (E_IS_MEETING_STORE (store));
-
- store->priv->zone = zone;
-}
-
-static void
-attendee_changed_cb (EMeetingAttendee *attendee, gpointer data)
-{
- EMeetingStore *store = E_MEETING_STORE (data);
- GtkTreePath *path;
- GtkTreeIter iter;
- gint row = -1, i;
-
- for (i = 0; i < store->priv->attendees->len; i++) {
- if (attendee == g_ptr_array_index (store->priv->attendees, i)) {
- row = i;
- break;
- }
- }
-
- if (row == -1)
- return;
-
- path = gtk_tree_path_new ();
- gtk_tree_path_append_index (path, row);
- get_iter (GTK_TREE_MODEL (store), &iter, path);
- gtk_tree_model_row_changed (GTK_TREE_MODEL (store), path, &iter);
- gtk_tree_path_free (path);
-}
-
-void
-e_meeting_store_add_attendee (EMeetingStore *store, EMeetingAttendee *attendee)
-{
- GtkTreePath *path;
- GtkTreeIter iter;
-
- g_return_if_fail (E_IS_MEETING_STORE (store));
-
- g_object_ref (attendee);
- g_ptr_array_add (store->priv->attendees, attendee);
-
- g_signal_connect (attendee, "changed", G_CALLBACK (attendee_changed_cb), store);
-
- path = gtk_tree_path_new ();
- gtk_tree_path_append_index (path, store->priv->attendees->len - 1);
- get_iter (GTK_TREE_MODEL (store), &iter, path);
- gtk_tree_model_row_inserted (GTK_TREE_MODEL (store), path, &iter);
- gtk_tree_path_free (path);
-}
-
-EMeetingAttendee *
-e_meeting_store_add_attendee_with_defaults (EMeetingStore *store)
-{
- EMeetingAttendee *attendee;
- char *str;
-
- attendee = E_MEETING_ATTENDEE (e_meeting_attendee_new ());
-
- e_meeting_attendee_set_address (attendee, g_strdup (""));
- e_meeting_attendee_set_member (attendee, g_strdup (""));
-
- str = g_strdup (_("Individual"));
- e_meeting_attendee_set_cutype (attendee, text_to_type (str));
- g_free (str);
- str = g_strdup (_("Required Participant"));
- e_meeting_attendee_set_role (attendee, text_to_role (str));
- g_free (str);
- str = g_strdup (_("Yes"));
- e_meeting_attendee_set_rsvp (attendee, text_to_boolean (str));
- g_free (str);
-
- e_meeting_attendee_set_delto (attendee, g_strdup (""));
- e_meeting_attendee_set_delfrom (attendee, g_strdup (""));
-
- str = g_strdup (_("Needs Action"));
- e_meeting_attendee_set_status (attendee, text_to_partstat (str));
- g_free (str);
-
- e_meeting_attendee_set_cn (attendee, g_strdup (""));
- e_meeting_attendee_set_language (attendee, g_strdup ("en"));
-
- e_meeting_store_add_attendee (store, attendee);
-
- return attendee;
-}
-
-void
-e_meeting_store_remove_attendee (EMeetingStore *store, EMeetingAttendee *attendee)
-{
- gint i, row = -1;
- GtkTreePath *path;
-
- for (i = 0; i < store->priv->attendees->len; i++) {
- if (attendee == g_ptr_array_index (store->priv->attendees, i)) {
- row = i;
- break;
- }
- }
-
- if (row != -1) {
- g_ptr_array_remove_index (store->priv->attendees, row);
- g_object_unref (attendee);
-
- path = gtk_tree_path_new ();
- gtk_tree_path_append_index (path, row);
- gtk_tree_model_row_deleted (GTK_TREE_MODEL (store), path);
- gtk_tree_path_free (path);
- }
-}
-
-void
-e_meeting_store_remove_all_attendees (EMeetingStore *store)
-{
- gint i;
- GtkTreePath *path = gtk_tree_path_new ();
-
- gtk_tree_path_append_index (path, 0);
-
- for (i = 0; i < store->priv->attendees->len; i++) {
- EMeetingAttendee *attendee = g_ptr_array_index (store->priv->attendees, i);
- g_object_unref (attendee);
-
- gtk_tree_model_row_deleted (GTK_TREE_MODEL (store), path);
- gtk_tree_path_next (path);
- }
-
- g_ptr_array_set_size (store->priv->attendees, 0);
- gtk_tree_path_free (path);
-}
-
-EMeetingAttendee *
-e_meeting_store_find_attendee (EMeetingStore *store, const gchar *address, gint *row)
-{
- EMeetingAttendee *attendee;
- int i;
-
- if (address == NULL)
- return NULL;
-
- for (i = 0; i < store->priv->attendees->len; i++) {
- const gchar *attendee_address;
-
- attendee = g_ptr_array_index (store->priv->attendees, i);
-
- attendee_address = e_meeting_attendee_get_address (attendee);
- if (attendee_address && !g_strcasecmp (itip_strip_mailto (attendee_address), itip_strip_mailto (address))) {
- if (row != NULL)
- *row = i;
-
- return attendee;
- }
- }
-
- return NULL;
-}
-
-EMeetingAttendee *
-e_meeting_store_find_attendee_at_row (EMeetingStore *store, gint row)
-{
- g_return_val_if_fail (E_IS_MEETING_STORE (store), NULL);
- g_return_val_if_fail (ROW_VALID (store, row), NULL);
-
- return g_ptr_array_index (store->priv->attendees, row);
-}
-
-gint
-e_meeting_store_count_actual_attendees (EMeetingStore *store)
-{
- g_return_val_if_fail (E_IS_MEETING_STORE (store), 0);
-
- return store->priv->attendees->len;
-}
-
-const GPtrArray *
-e_meeting_store_get_attendees (EMeetingStore *store)
-{
- g_return_val_if_fail (E_IS_MEETING_STORE (store), NULL);
-
- return store->priv->attendees;
-}
-
-static icaltimezone *
-find_zone (icalproperty *ip, icalcomponent *tz_top_level)
-{
- icalparameter *param;
- icalcomponent *sub_comp;
- const char *tzid;
- icalcompiter iter;
-
- if (tz_top_level == NULL)
- return NULL;
-
- param = icalproperty_get_first_parameter (ip, ICAL_TZID_PARAMETER);
- if (param == NULL)
- return NULL;
- tzid = icalparameter_get_tzid (param);
-
- iter = icalcomponent_begin_component (tz_top_level, ICAL_VTIMEZONE_COMPONENT);
- while ((sub_comp = icalcompiter_deref (&iter)) != NULL) {
- icalcomponent *clone;
- icalproperty *prop;
- const char *tz_tzid;
-
- prop = icalcomponent_get_first_property (sub_comp, ICAL_TZID_PROPERTY);
- tz_tzid = icalproperty_get_tzid (prop);
- if (!strcmp (tzid, tz_tzid)) {
- icaltimezone *zone;
-
- zone = icaltimezone_new ();
- clone = icalcomponent_new_clone (sub_comp);
- icaltimezone_set_component (zone, clone);
-
- return zone;
- }
-
- icalcompiter_next (&iter);
- }
-
- return NULL;
-}
-
-static void
-process_callbacks (EMeetingStoreQueueData *qdata)
-{
- EMeetingStore *store;
- int i;
-
- for (i = 0; i < qdata->call_backs->len; i++) {
- EMeetingStoreRefreshCallback call_back;
- gpointer *data;
-
- call_back = g_ptr_array_index (qdata->call_backs, i);
- data = g_ptr_array_index (qdata->data, i);
-
- call_back (data);
- }
-
- store = qdata->store;
- refresh_queue_remove (qdata->store, qdata->attendee);
- g_object_unref (store);
-}
-
-static void
-process_free_busy_comp (EMeetingAttendee *attendee,
- icalcomponent *fb_comp,
- icaltimezone *zone,
- icalcomponent *tz_top_level)
-{
- icalproperty *ip;
-
- ip = icalcomponent_get_first_property (fb_comp, ICAL_DTSTART_PROPERTY);
- if (ip != NULL) {
- struct icaltimetype dtstart;
- icaltimezone *ds_zone;
-
- dtstart = icalproperty_get_dtstart (ip);
- if (!dtstart.is_utc)
- ds_zone = find_zone (ip, tz_top_level);
- else
- ds_zone = icaltimezone_get_utc_timezone ();
- icaltimezone_convert_time (&dtstart, ds_zone, zone);
- e_meeting_attendee_set_start_busy_range (attendee,
- dtstart.year,
- dtstart.month,
- dtstart.day,
- dtstart.hour,
- dtstart.minute);
- }
-
- ip = icalcomponent_get_first_property (fb_comp, ICAL_DTEND_PROPERTY);
- if (ip != NULL) {
- struct icaltimetype dtend;
- icaltimezone *de_zone;
-
- dtend = icalproperty_get_dtend (ip);
- if (!dtend.is_utc)
- de_zone = find_zone (ip, tz_top_level);
- else
- de_zone = icaltimezone_get_utc_timezone ();
- icaltimezone_convert_time (&dtend, de_zone, zone);
- e_meeting_attendee_set_end_busy_range (attendee,
- dtend.year,
- dtend.month,
- dtend.day,
- dtend.hour,
- dtend.minute);
- }
-
- ip = icalcomponent_get_first_property (fb_comp, ICAL_FREEBUSY_PROPERTY);
- while (ip != NULL) {
- icalparameter *param;
- struct icalperiodtype fb;
- EMeetingFreeBusyType busy_type = E_MEETING_FREE_BUSY_LAST;
- icalparameter_fbtype fbtype = ICAL_FBTYPE_BUSY;
-
- fb = icalproperty_get_freebusy (ip);
- param = icalproperty_get_first_parameter (ip, ICAL_FBTYPE_PARAMETER);
- if (param != NULL)
- fbtype = icalparameter_get_fbtype (param);
-
- switch (fbtype) {
- case ICAL_FBTYPE_BUSY:
- busy_type = E_MEETING_FREE_BUSY_BUSY;
- break;
-
- case ICAL_FBTYPE_BUSYUNAVAILABLE:
- busy_type = E_MEETING_FREE_BUSY_OUT_OF_OFFICE;
- break;
-
- case ICAL_FBTYPE_BUSYTENTATIVE:
- busy_type = E_MEETING_FREE_BUSY_TENTATIVE;
- break;
-
- default:
- break;
- }
-
- if (busy_type != E_MEETING_FREE_BUSY_LAST) {
- icaltimezone *utc_zone = icaltimezone_get_utc_timezone ();
-
- icaltimezone_convert_time (&fb.start, utc_zone, zone);
- icaltimezone_convert_time (&fb.end, utc_zone, zone);
- e_meeting_attendee_add_busy_period (attendee,
- fb.start.year,
- fb.start.month,
- fb.start.day,
- fb.start.hour,
- fb.start.minute,
- fb.end.year,
- fb.end.month,
- fb.end.day,
- fb.end.hour,
- fb.end.minute,
- busy_type);
- }
-
- ip = icalcomponent_get_next_property (fb_comp, ICAL_FREEBUSY_PROPERTY);
- }
-}
-
-static void
-process_free_busy (EMeetingStoreQueueData *qdata, char *text)
-{
- EMeetingStore *store = qdata->store;
- EMeetingStorePrivate *priv;
- EMeetingAttendee *attendee = qdata->attendee;
- icalcomponent *main_comp;
- icalcomponent_kind kind = ICAL_NO_COMPONENT;
-
- priv = store->priv;
-
- main_comp = icalparser_parse_string (text);
- if (main_comp == NULL) {
- process_callbacks (qdata);
- return;
- }
-
- kind = icalcomponent_isa (main_comp);
- if (kind == ICAL_VCALENDAR_COMPONENT) {
- icalcompiter iter;
- icalcomponent *tz_top_level, *sub_comp;
-
- tz_top_level = e_cal_util_new_top_level ();
-
- iter = icalcomponent_begin_component (main_comp, ICAL_VTIMEZONE_COMPONENT);
- while ((sub_comp = icalcompiter_deref (&iter)) != NULL) {
- icalcomponent *clone;
-
- clone = icalcomponent_new_clone (sub_comp);
- icalcomponent_add_component (tz_top_level, clone);
-
- icalcompiter_next (&iter);
- }
-
- iter = icalcomponent_begin_component (main_comp, ICAL_VFREEBUSY_COMPONENT);
- while ((sub_comp = icalcompiter_deref (&iter)) != NULL) {
- process_free_busy_comp (attendee, sub_comp, priv->zone, tz_top_level);
-
- icalcompiter_next (&iter);
- }
- icalcomponent_free (tz_top_level);
- } else if (kind == ICAL_VFREEBUSY_COMPONENT) {
- process_free_busy_comp (attendee, main_comp, priv->zone, NULL);
- }
-
- icalcomponent_free (main_comp);
-
- process_callbacks (qdata);
-}
-
-static gboolean
-refresh_busy_periods (gpointer data)
-{
- EMeetingStore *store = E_MEETING_STORE (data);
- EMeetingStorePrivate *priv;
- EMeetingAttendee *attendee = NULL;
- EMeetingStoreQueueData *qdata = NULL;
- char *query;
- int i;
-
- priv = store->priv;
-
- /* Check to see if there are any remaining attendees in the queue */
- for (i = 0; i < priv->refresh_queue->len; i++) {
- attendee = g_ptr_array_index (priv->refresh_queue, i);
- g_assert (attendee != NULL);
-
- qdata = g_hash_table_lookup (priv->refresh_data, attendee);
- if (!qdata)
- continue;
-
- if (!qdata->refreshing)
- break;
- }
-
- /* The everything in the queue is being refreshed */
- if (i >= priv->refresh_queue->len) {
- priv->refresh_idle_id = 0;
- return FALSE;
- }
-
- /* Indicate we are trying to refresh it */
- qdata->refreshing = TRUE;
-
- /* We take a ref in case we get destroyed in the gui during a callback */
- g_object_ref (qdata->store);
-
- /* Check the server for free busy data */
- if (priv->client) {
- GList *fb_data = NULL, *users = NULL;
- struct icaltimetype itt;
- time_t startt, endt;
- const char *user;
-
- itt = icaltime_null_time ();
- itt.year = g_date_year (&qdata->start.date);
- itt.month = g_date_month (&qdata->start.date);
- itt.day = g_date_day (&qdata->start.date);
- itt.hour = qdata->start.hour;
- itt.minute = qdata->start.minute;
- startt = icaltime_as_timet_with_zone (itt, priv->zone);
-
- itt = icaltime_null_time ();
- itt.year = g_date_year (&qdata->end.date);
- itt.month = g_date_month (&qdata->end.date);
- itt.day = g_date_day (&qdata->end.date);
- itt.hour = qdata->end.hour;
- itt.minute = qdata->end.minute;
- endt = icaltime_as_timet_with_zone (itt, priv->zone);
-
- user = itip_strip_mailto (e_meeting_attendee_get_address (attendee));
- users = g_list_append (users, g_strdup (user));
- e_cal_get_free_busy (priv->client, users, startt, endt, &fb_data, NULL);
-
- g_list_foreach (users, (GFunc)g_free, NULL);
- g_list_free (users);
-
- if (fb_data != NULL) {
- ECalComponent *comp = fb_data->data;
- char *comp_str;
-
- comp_str = e_cal_component_get_as_string (comp);
- process_free_busy (qdata, comp_str);
- g_free (comp_str);
- return TRUE;
- }
- }
-
- /* Look for fburl's of attendee with no free busy info on server */
- if (!e_meeting_attendee_is_set_address (attendee)) {
- process_callbacks (qdata);
- return TRUE;
- }
-
- query = g_strdup_printf ("(contains \"email\" \"%s\")",
- itip_strip_mailto (e_meeting_attendee_get_address (attendee)));
- process_callbacks (qdata);
- g_free (query);
-
- return TRUE;
-}
-
-static void
-refresh_queue_add (EMeetingStore *store, int row,
- EMeetingTime *start,
- EMeetingTime *end,
- EMeetingStoreRefreshCallback call_back,
- gpointer data)
-{
- EMeetingStorePrivate *priv;
- EMeetingAttendee *attendee;
- EMeetingStoreQueueData *qdata;
-
- priv = store->priv;
-
- attendee = g_ptr_array_index (priv->attendees, row);
- if (attendee == NULL)
- return;
-
- qdata = g_hash_table_lookup (priv->refresh_data, attendee);
- if (qdata == NULL) {
- qdata = g_new0 (EMeetingStoreQueueData, 1);
-
- qdata->store = store;
- qdata->attendee = attendee;
- e_meeting_attendee_clear_busy_periods (attendee);
- e_meeting_attendee_set_has_calendar_info (attendee, FALSE);
-
- qdata->start = *start;
- qdata->end = *end;
- qdata->string = g_string_new (NULL);
- qdata->call_backs = g_ptr_array_new ();
- qdata->data = g_ptr_array_new ();
- g_ptr_array_add (qdata->call_backs, call_back);
- g_ptr_array_add (qdata->data, data);
-
- g_hash_table_insert (priv->refresh_data, attendee, qdata);
- } else {
- if (e_meeting_time_compare_times (start, &qdata->start) == -1)
- qdata->start = *start;
- if (e_meeting_time_compare_times (end, &qdata->end) == 1)
- qdata->end = *end;
- g_ptr_array_add (qdata->call_backs, call_back);
- g_ptr_array_add (qdata->data, data);
- }
-
- g_object_ref (attendee);
- g_ptr_array_add (priv->refresh_queue, attendee);
-
- if (priv->refresh_idle_id == 0)
- priv->refresh_idle_id = g_idle_add (refresh_busy_periods, store);
-}
-
-static void
-async_close (GnomeVFSAsyncHandle *handle,
- GnomeVFSResult result,
- gpointer data)
-{
- EMeetingStoreQueueData *qdata = data;
-
- process_free_busy (qdata, qdata->string->str);
-}
-
-static void
-async_read (GnomeVFSAsyncHandle *handle,
- GnomeVFSResult result,
- gpointer buffer,
- GnomeVFSFileSize requested,
- GnomeVFSFileSize read,
- gpointer data)
-{
- EMeetingStoreQueueData *qdata = data;
- GnomeVFSFileSize buf_size = BUF_SIZE - 1;
-
- if (result != GNOME_VFS_OK && result != GNOME_VFS_ERROR_EOF) {
- gnome_vfs_async_close (handle, async_close, qdata);
- return;
- }
-
- ((char *)buffer)[read] = '\0';
- qdata->string = g_string_append (qdata->string, buffer);
-
- if (result == GNOME_VFS_ERROR_EOF) {
- gnome_vfs_async_close (handle, async_close, qdata);
- return;
- }
-
- gnome_vfs_async_read (handle, qdata->buffer, buf_size, async_read, qdata);
-}
-
-void
-e_meeting_store_refresh_all_busy_periods (EMeetingStore *store,
- EMeetingTime *start,
- EMeetingTime *end,
- EMeetingStoreRefreshCallback call_back,
- gpointer data)
-{
- int i;
-
- g_return_if_fail (E_IS_MEETING_STORE (store));
-
- for (i = 0; i < store->priv->attendees->len; i++)
- refresh_queue_add (store, i, start, end, call_back, data);
-}
-
-void
-e_meeting_store_refresh_busy_periods (EMeetingStore *store,
- int row,
- EMeetingTime *start,
- EMeetingTime *end,
- EMeetingStoreRefreshCallback call_back,
- gpointer data)
-{
- g_return_if_fail (E_IS_MEETING_STORE (store));
-
- refresh_queue_add (store, row, start, end, call_back, data);
-}
-
diff --git a/calendar/gui/e-meeting-store.h b/calendar/gui/e-meeting-store.h
deleted file mode 100644
index 8454c380b0..0000000000
--- a/calendar/gui/e-meeting-store.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * e-meeting-store.h
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * Author: Mike Kestner
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef _E_MEETING_STORE_H_
-#define _E_MEETING_STORE_H_
-
-#include <gtk/gtkliststore.h>
-#include <libecal/e-cal.h>
-#include "e-meeting-attendee.h"
-
-G_BEGIN_DECLS
-
-#define E_TYPE_MEETING_STORE (e_meeting_store_get_type ())
-#define E_MEETING_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_MEETING_STORE, EMeetingStore))
-#define E_MEETING_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_MEETING_STORE, EMeetingStoreClass))
-#define E_IS_MEETING_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_MEETING_STORE))
-#define E_IS_MEETING_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_MEETING_STORE))
-
-typedef struct _EMeetingStore EMeetingStore;
-typedef struct _EMeetingStorePrivate EMeetingStorePrivate;
-typedef struct _EMeetingStoreClass EMeetingStoreClass;
-
-typedef enum {
- E_MEETING_STORE_ADDRESS_COL,
- E_MEETING_STORE_MEMBER_COL,
- E_MEETING_STORE_TYPE_COL,
- E_MEETING_STORE_ROLE_COL,
- E_MEETING_STORE_RSVP_COL,
- E_MEETING_STORE_DELTO_COL,
- E_MEETING_STORE_DELFROM_COL,
- E_MEETING_STORE_STATUS_COL,
- E_MEETING_STORE_CN_COL,
- E_MEETING_STORE_LANGUAGE_COL,
- E_MEETING_STORE_ATTENDEE_COL,
- E_MEETING_STORE_ATTENDEE_UNDERLINE_COL,
- E_MEETING_STORE_COLUMN_COUNT
-} EMeetingStoreColumns;
-
-struct _EMeetingStore {
- GtkListStore parent;
-
- EMeetingStorePrivate *priv;
-};
-
-struct _EMeetingStoreClass {
- GtkListStoreClass parent_class;
-};
-
-typedef void (* EMeetingStoreRefreshCallback) (gpointer data);
-
-GType e_meeting_store_get_type (void);
-GObject *e_meeting_store_new (void);
-
-void e_meeting_store_set_value (EMeetingStore *im, int row, int col, const gchar *val);
-
-ECal *e_meeting_store_get_e_cal (EMeetingStore *im);
-void e_meeting_store_set_e_cal (EMeetingStore *im, ECal *client);
-
-icaltimezone *e_meeting_store_get_zone (EMeetingStore *im);
-void e_meeting_store_set_zone (EMeetingStore *im, icaltimezone *zone);
-
-void e_meeting_store_add_attendee (EMeetingStore *im, EMeetingAttendee *ia);
-EMeetingAttendee *e_meeting_store_add_attendee_with_defaults (EMeetingStore *im);
-
-void e_meeting_store_remove_attendee (EMeetingStore *im, EMeetingAttendee *ia);
-void e_meeting_store_remove_all_attendees (EMeetingStore *im);
-
-EMeetingAttendee *e_meeting_store_find_attendee (EMeetingStore *im, const gchar *address, gint *row);
-EMeetingAttendee *e_meeting_store_find_attendee_at_row (EMeetingStore *im, gint row);
-
-gint e_meeting_store_count_actual_attendees (EMeetingStore *im);
-const GPtrArray *e_meeting_store_get_attendees (EMeetingStore *im);
-
-void e_meeting_store_refresh_all_busy_periods (EMeetingStore *im,
- EMeetingTime *start,
- EMeetingTime *end,
- EMeetingStoreRefreshCallback call_back,
- gpointer data);
-void e_meeting_store_refresh_busy_periods (EMeetingStore *im,
- int row,
- EMeetingTime *start,
- EMeetingTime *end,
- EMeetingStoreRefreshCallback call_back,
- gpointer data);
-
-
-G_END_DECLS
-
-#endif
diff --git a/calendar/gui/e-meeting-time-sel-item.c b/calendar/gui/e-meeting-time-sel-item.c
deleted file mode 100644
index c714684569..0000000000
--- a/calendar/gui/e-meeting-time-sel-item.c
+++ /dev/null
@@ -1,999 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Author :
- * Damon Chaplin <damon@gtk.org>
- *
- * Copyright 1999, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-/*
- * EMeetingTimeSelectorItem - A GnomeCanvasItem which is used for both the main
- * display canvas and the top display (with the dates, times & All Attendees).
- * I didn't make these separate GnomeCanvasItems since they share a lot of
- * code.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <time.h>
-#include <glib.h>
-#include <libgnome/gnome-i18n.h>
-#include "calendar-config.h"
-#include "e-meeting-time-sel-item.h"
-#include "e-meeting-time-sel.h"
-
-/* Initially the grid lines were drawn at the bottom of cells, but this didn't
- line up well with the GtkEntry widgets, which in the default theme draw a
- black shadow line across the top. So I've switched our code to draw the
- lines across the top of cells. */
-#define E_MEETING_TIME_SELECTOR_DRAW_GRID_LINES_AT_BOTTOM 0
-
-static void e_meeting_time_selector_item_class_init (EMeetingTimeSelectorItemClass *mts_item_class);
-static void e_meeting_time_selector_item_init (EMeetingTimeSelectorItem *mts_item);
-static void e_meeting_time_selector_item_destroy (GtkObject *object);
-
-static void e_meeting_time_selector_item_set_arg (GtkObject *o, GtkArg *arg,
- guint arg_id);
-static void e_meeting_time_selector_item_realize (GnomeCanvasItem *item);
-static void e_meeting_time_selector_item_unrealize (GnomeCanvasItem *item);
-static void e_meeting_time_selector_item_update (GnomeCanvasItem *item,
- double *affine,
- ArtSVP *clip_path, int flags);
-static void e_meeting_time_selector_item_draw (GnomeCanvasItem *item,
- GdkDrawable *drawable,
- int x, int y,
- int width, int height);
-static double e_meeting_time_selector_item_point (GnomeCanvasItem *item,
- double x, double y,
- int cx, int cy,
- GnomeCanvasItem **actual_item);
-static gint e_meeting_time_selector_item_event (GnomeCanvasItem *item,
- GdkEvent *event);
-static gint e_meeting_time_selector_item_button_press (EMeetingTimeSelectorItem *mts_item,
- GdkEvent *event);
-static gint e_meeting_time_selector_item_button_release (EMeetingTimeSelectorItem *mts_item,
- GdkEvent *event);
-static gint e_meeting_time_selector_item_motion_notify (EMeetingTimeSelectorItem *mts_item,
- GdkEvent *event);
-
-static void e_meeting_time_selector_item_paint_day_top (EMeetingTimeSelectorItem *mts_item,
- GdkDrawable *drawable,
- GDate *date,
- int x, int scroll_y,
- int width, int height);
-static void e_meeting_time_selector_item_paint_all_attendees_busy_periods (EMeetingTimeSelectorItem *mts_item, GdkDrawable *drawable, GDate *date, int x, int y, int width, int height);
-static void e_meeting_time_selector_item_paint_day (EMeetingTimeSelectorItem *mts_item,
- GdkDrawable *drawable,
- GDate *date,
- int x, int scroll_y,
- int width, int height);
-static void e_meeting_time_selector_item_paint_busy_periods (EMeetingTimeSelectorItem *mts_item, GdkDrawable *drawable, GDate *date, int x, int scroll_y, int width, int height);
-static gint e_meeting_time_selector_item_find_first_busy_period (EMeetingTimeSelectorItem *mts_item, GDate *date, gint row);
-static void e_meeting_time_selector_item_paint_attendee_busy_periods (EMeetingTimeSelectorItem *mts_item, GdkDrawable *drawable, int row, int x, int y, int width, int first_period, EMeetingFreeBusyType busy_type);
-
-static EMeetingTimeSelectorPosition e_meeting_time_selector_item_get_drag_position (EMeetingTimeSelectorItem *mts_item, gint x, gint y);
-static gboolean e_meeting_time_selector_item_calculate_busy_range (EMeetingTimeSelector *mts,
- gint row,
- gint x,
- gint width,
- gint *start_x,
- gint *end_x);
-
-static GnomeCanvasItemClass *parent_class;
-
-/* The arguments we take */
-enum {
- ARG_0,
- ARG_MEETING_TIME_SELECTOR
-};
-
-E_MAKE_TYPE (e_meeting_time_selector_item, "EMeetingTimeSelectorItem", EMeetingTimeSelectorItem,
- e_meeting_time_selector_item_class_init, e_meeting_time_selector_item_init,
- GNOME_TYPE_CANVAS_ITEM);
-
-static void
-e_meeting_time_selector_item_class_init (EMeetingTimeSelectorItemClass *mts_item_class)
-{
- GtkObjectClass *object_class;
- GnomeCanvasItemClass *item_class;
-
- parent_class = g_type_class_peek_parent (mts_item_class);
-
- object_class = (GtkObjectClass *) mts_item_class;
- item_class = (GnomeCanvasItemClass *) mts_item_class;
-
- gtk_object_add_arg_type ("EMeetingTimeSelectorItem::meeting_time_selector",
- GTK_TYPE_POINTER, GTK_ARG_WRITABLE,
- ARG_MEETING_TIME_SELECTOR);
-
- object_class->destroy = e_meeting_time_selector_item_destroy;
- object_class->set_arg = e_meeting_time_selector_item_set_arg;
-
- /* GnomeCanvasItem method overrides */
- item_class->realize = e_meeting_time_selector_item_realize;
- item_class->unrealize = e_meeting_time_selector_item_unrealize;
- item_class->update = e_meeting_time_selector_item_update;
- item_class->draw = e_meeting_time_selector_item_draw;
- item_class->point = e_meeting_time_selector_item_point;
- item_class->event = e_meeting_time_selector_item_event;
-}
-
-
-static void
-e_meeting_time_selector_item_init (EMeetingTimeSelectorItem *mts_item)
-{
- GnomeCanvasItem *item = GNOME_CANVAS_ITEM (mts_item);
-
- mts_item->mts = NULL;
-
- mts_item->main_gc = NULL;
- mts_item->stipple_gc = NULL;
-
- /* Create the cursors. */
- mts_item->normal_cursor = gdk_cursor_new (GDK_LEFT_PTR);
- mts_item->resize_cursor = gdk_cursor_new (GDK_SB_H_DOUBLE_ARROW);
- mts_item->last_cursor_set = NULL;
-
- item->x1 = 0;
- item->y1 = 0;
- item->x2 = 0;
- item->y2 = 0;
-}
-
-
-static void
-e_meeting_time_selector_item_destroy (GtkObject *object)
-{
- EMeetingTimeSelectorItem *mts_item;
-
- mts_item = E_MEETING_TIME_SELECTOR_ITEM (object);
-
- if (mts_item->normal_cursor) {
- gdk_cursor_destroy (mts_item->normal_cursor);
- mts_item->normal_cursor = NULL;
- }
- if (mts_item->resize_cursor) {
- gdk_cursor_destroy (mts_item->resize_cursor);
- mts_item->resize_cursor = NULL;
- }
-
- if (GTK_OBJECT_CLASS (parent_class)->destroy)
- (*GTK_OBJECT_CLASS (parent_class)->destroy)(object);
-}
-
-
-static void
-e_meeting_time_selector_item_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
-{
- GnomeCanvasItem *item;
- EMeetingTimeSelectorItem *mts_item;
-
- item = GNOME_CANVAS_ITEM (o);
- mts_item = E_MEETING_TIME_SELECTOR_ITEM (o);
-
- switch (arg_id){
- case ARG_MEETING_TIME_SELECTOR:
- mts_item->mts = GTK_VALUE_POINTER (*arg);
- break;
- }
-}
-
-
-static void
-e_meeting_time_selector_item_realize (GnomeCanvasItem *item)
-{
- GnomeCanvas *canvas;
- GdkWindow *window;
- EMeetingTimeSelectorItem *mts_item;
-
- if (GNOME_CANVAS_ITEM_CLASS (parent_class)->realize)
- (*GNOME_CANVAS_ITEM_CLASS (parent_class)->realize)(item);
-
- mts_item = E_MEETING_TIME_SELECTOR_ITEM (item);
-
- canvas = item->canvas;
- window = GTK_WIDGET (canvas)->window;
-
- mts_item->main_gc = gdk_gc_new (window);
- mts_item->stipple_gc = gdk_gc_new (window);
-}
-
-
-static void
-e_meeting_time_selector_item_unrealize (GnomeCanvasItem *item)
-{
- EMeetingTimeSelectorItem *mts_item;
-
- mts_item = E_MEETING_TIME_SELECTOR_ITEM (item);
-
- gdk_gc_unref (mts_item->main_gc);
- mts_item->main_gc = NULL;
- gdk_gc_unref (mts_item->stipple_gc);
- mts_item->stipple_gc = NULL;
-
- if (GNOME_CANVAS_ITEM_CLASS (parent_class)->unrealize)
- (*GNOME_CANVAS_ITEM_CLASS (parent_class)->unrealize)(item);
-}
-
-
-static void
-e_meeting_time_selector_item_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, int flags)
-{
- if (GNOME_CANVAS_ITEM_CLASS (parent_class)->update)
- (* GNOME_CANVAS_ITEM_CLASS (parent_class)->update) (item, affine, clip_path, flags);
-
- /* The grid covers the entire canvas area. */
- item->x1 = 0;
- item->y1 = 0;
- item->x2 = INT_MAX;
- item->y2 = INT_MAX;
-}
-
-
-/*
- * DRAWING ROUTINES - functions to paint the canvas item.
- */
-
-static void
-e_meeting_time_selector_item_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int width, int height)
-{
- EMeetingTimeSelector *mts;
- EMeetingTimeSelectorItem *mts_item;
- EMeetingAttendee *ia;
- gint day_x, meeting_start_x, meeting_end_x, bar_y, bar_height;
- gint row, row_y, start_x, end_x;
- GDate date, last_date, current_date;
- gboolean is_display_top, show_meeting_time;
- GdkGC *gc, *stipple_gc;
-
- mts_item = E_MEETING_TIME_SELECTOR_ITEM (item);
- mts = mts_item->mts;
- g_return_if_fail (mts != NULL);
- gc = mts_item->main_gc;
- stipple_gc = mts_item->stipple_gc;
-
- is_display_top = (GTK_WIDGET (item->canvas) == mts->display_top)
- ? TRUE : FALSE;
-
- /* Calculate the first and last visible days and positions. */
- e_meeting_time_selector_calculate_day_and_position (mts, x,
- &date, &day_x);
- e_meeting_time_selector_calculate_day_and_position (mts, x + width,
- &last_date, NULL);
-
- /* For the top display draw the 'All Attendees' row background. */
- if (is_display_top) {
- gdk_gc_set_foreground (gc, &mts->all_attendees_bg_color);
- gdk_draw_rectangle (drawable, gc, TRUE,
- 0, mts->row_height * 2 - y,
- width, mts->row_height);
- } else {
- gdk_gc_set_foreground (gc, &mts->bg_color);
- gdk_draw_rectangle (drawable, gc, TRUE, 0, 0, width, height);
- }
-
- /* Calculate the x coordinates of the meeting time. */
- show_meeting_time = e_meeting_time_selector_get_meeting_time_positions (mts, &meeting_start_x, &meeting_end_x);
-
- /* Draw the meeting time background. */
- if (show_meeting_time
- && (meeting_end_x - 1 >= x) && (meeting_start_x + 1 < x + width)
- && (meeting_end_x - meeting_start_x > 2)) {
- gdk_gc_set_foreground (gc, &mts->meeting_time_bg_color);
- if (is_display_top)
- gdk_draw_rectangle (drawable, gc, TRUE,
- meeting_start_x + 1 - x, mts->row_height * 2 - y,
- meeting_end_x - meeting_start_x - 2, mts->row_height);
- else
- gdk_draw_rectangle (drawable, gc, TRUE,
- meeting_start_x + 1 - x, 0,
- meeting_end_x - meeting_start_x - 2, height);
- }
-
- /* For the main display draw the stipple background for attendee's
- that have no calendar information. */
- if (!is_display_top) {
- gdk_gc_set_foreground (gc, &mts->grid_color);
- gdk_gc_set_foreground (stipple_gc, &mts->grid_color);
- gdk_gc_set_background (stipple_gc, &mts->stipple_bg_color);
- gdk_gc_set_stipple (stipple_gc, mts->stipple);
- gnome_canvas_set_stipple_origin (item->canvas, stipple_gc);
- gdk_gc_set_fill (stipple_gc, GDK_OPAQUE_STIPPLED);
- row = y / mts->row_height;
- row_y = row * mts->row_height - y;
- while (row < e_meeting_store_count_actual_attendees (mts->model) && row_y < height) {
- ia = e_meeting_store_find_attendee_at_row (mts->model, row);
-
- if (e_meeting_attendee_get_has_calendar_info (ia)) {
- if (e_meeting_time_selector_item_calculate_busy_range (mts, row, x, width, &start_x, &end_x)) {
- if (start_x >= width || end_x <= 0) {
- gdk_draw_rectangle (drawable, stipple_gc, TRUE, 0, row_y, width, mts->row_height);
- } else {
- if (start_x >= 0) {
- gdk_draw_rectangle (drawable, stipple_gc, TRUE, 0, row_y, start_x, mts->row_height);
- gdk_draw_line (drawable, gc, start_x, row_y, start_x, row_y + mts->row_height);
- }
- if (end_x <= width) {
- gdk_draw_rectangle (drawable, stipple_gc, TRUE, end_x, row_y, width - end_x, mts->row_height);
- gdk_draw_line (drawable, gc, end_x, row_y, end_x, row_y + mts->row_height);
- }
- }
- }
- } else {
- gdk_draw_rectangle (drawable, stipple_gc, TRUE,
- 0, row_y,
- width, mts->row_height);
- }
- row++;
- row_y += mts->row_height;
- }
- gdk_gc_set_fill (gc, GDK_SOLID);
- }
-
- /* Now paint the visible days one by one. */
- current_date = date;
- for (;;) {
- /* Currently we use the same GnomeCanvasItem class for the
- top display and the main display. We may use separate
- classes in future if necessary. */
- if (is_display_top)
- e_meeting_time_selector_item_paint_day_top (mts_item, drawable, &current_date, day_x, y, width, height);
- else
- e_meeting_time_selector_item_paint_day (mts_item, drawable, &current_date, day_x, y, width, height);
-
- day_x += mts_item->mts->day_width;
- if (g_date_compare (&current_date, &last_date) == 0)
- break;
- g_date_add_days (&current_date, 1);
- }
-
- /* Draw the busy periods. */
- if (is_display_top)
- e_meeting_time_selector_item_paint_all_attendees_busy_periods (mts_item, drawable, &date, x, y, width, height);
- else
- e_meeting_time_selector_item_paint_busy_periods (mts_item, drawable, &date, x, y, width, height);
-
-
- /* Draw the currently-selected meeting time vertical bars. */
- if (show_meeting_time) {
- if (is_display_top) {
- bar_y = mts->row_height * 2 - y;
- bar_height = mts->row_height;
- } else {
- bar_y = 0;
- bar_height = height;
- }
-
- gdk_gc_set_foreground (gc, &mts->grid_color);
-
- if ((meeting_start_x + 2 >= x)
- && (meeting_start_x - 2 < x + width)) {
- gdk_draw_rectangle (drawable, gc, TRUE,
- meeting_start_x - 2 - x, bar_y,
- 5, bar_height);
- }
-
- if ((meeting_end_x + 2 >= x)
- && (meeting_end_x - 2 < x + width)) {
- gdk_draw_rectangle (drawable, gc, TRUE,
- meeting_end_x - 2 - x, bar_y,
- 5, bar_height);
- }
- }
-}
-
-
-static void
-e_meeting_time_selector_item_paint_day_top (EMeetingTimeSelectorItem *mts_item,
- GdkDrawable *drawable, GDate *date,
- int x, int scroll_y,
- int width, int height)
-{
- EMeetingTimeSelector *mts;
- GdkGC *gc;
- gint y, grid_x;
- gchar buffer[128], *format;
- gint hour, hour_x, hour_y;
- GdkRectangle clip_rect;
- PangoLayout *layout;
-
- mts = mts_item->mts;
- gc = mts_item->main_gc;
-
- gdk_gc_set_foreground (gc, &mts->grid_color);
- layout = gtk_widget_create_pango_layout (GTK_WIDGET (mts), NULL);
-
- /* Draw the horizontal lines. */
- y = mts->row_height - 1 - scroll_y;
- gdk_draw_line (drawable, gc, x, y, x + mts->day_width - 1, y);
- gdk_gc_set_foreground (gc, &mts->grid_shadow_color);
- gdk_draw_line (drawable, gc, x, y + 1, x + mts->day_width - 1, y + 1);
- gdk_gc_set_foreground (gc, &mts->grid_color);
- y += mts->row_height;
- gdk_draw_line (drawable, gc, x, y, x + mts->day_width - 1, y);
- y += mts->row_height;
- gdk_draw_line (drawable, gc, x, y, x + mts->day_width - 1, y);
-
- /* Draw the vertical grid lines. */
- for (grid_x = mts->col_width - 1;
- grid_x < mts->day_width - mts->col_width;
- grid_x += mts->col_width) {
- gdk_draw_line (drawable, gc,
- x + grid_x, mts->row_height * 2 - 4 - scroll_y,
- x + grid_x, height);
- }
- grid_x = mts->day_width - 2;
- gdk_draw_line (drawable, gc, x + grid_x, 0, x + grid_x, height);
- grid_x++;
- gdk_draw_line (drawable, gc, x + grid_x, 0, x + grid_x, height);
-
- /* Draw the date. Set a clipping rectangle so we don't draw over the
- next day. */
- if (mts->date_format == E_MEETING_TIME_SELECTOR_DATE_FULL)
- /* This is a strftime() format string %A = full weekday name,
- %B = full month name, %d = month day, %Y = full year. */
- format = _("%A, %B %d, %Y");
- else if (mts->date_format == E_MEETING_TIME_SELECTOR_DATE_ABBREVIATED_DAY)
- /* This is a strftime() format string %a = abbreviated weekday
- name, %m = month number, %d = month day, %Y = full year. */
- format = _("%a %m/%d/%Y");
- else
- /* This is a strftime() format string %m = month number,
- %d = month day, %Y = full year. */
- format = _("%m/%d/%Y");
-
- g_date_strftime (buffer, sizeof (buffer), format, date);
-
- clip_rect.x = x;
- clip_rect.y = -scroll_y;
- clip_rect.width = mts->day_width - 2;
- clip_rect.height = mts->row_height - 2;
- gdk_gc_set_clip_rectangle (gc, &clip_rect);
- pango_layout_set_text (layout, buffer, -1);
- gdk_draw_layout (drawable, gc,
- x + 2,
- 4 - scroll_y,
- layout);
- gdk_gc_set_clip_rectangle (gc, NULL);
-
- /* Draw the hours. */
- hour = mts->first_hour_shown;
- hour_x = x + 2;
- hour_y = mts->row_height + 4 - scroll_y;
- while (hour < mts->last_hour_shown) {
- if (calendar_config_get_24_hour_format ())
- pango_layout_set_text (layout, EMeetingTimeSelectorHours [hour], -1);
- else
- pango_layout_set_text (layout, EMeetingTimeSelectorHours12 [hour], -1);
-
- gdk_draw_layout (drawable, gc,
- hour_x,
- hour_y,
- layout);
-
- hour += mts->zoomed_out ? 3 : 1;
- hour_x += mts->col_width;
- }
-
- g_object_unref (layout);
-}
-
-
-/* This paints the colored bars representing busy periods for the combined
- list of attendees. For now we just paint the bars for each attendee of
- each other. If we want to speed it up we could optimise it later. */
-static void
-e_meeting_time_selector_item_paint_all_attendees_busy_periods (EMeetingTimeSelectorItem *mts_item, GdkDrawable *drawable, GDate *date, int x, int scroll_y, int width, int height)
-{
- EMeetingTimeSelector *mts;
- EMeetingAttendee *ia;
- EMeetingFreeBusyType busy_type;
- gint row, y;
- GdkGC *gc;
- gint *first_periods;
-
- mts = mts_item->mts;
- gc = mts_item->main_gc;
-
- /* Calculate the y coordinate to paint the row at in the drawable. */
- y = 2 * mts->row_height - scroll_y - 1;
-
- /* Get the first visible busy periods for all the attendees. */
- first_periods = g_new (gint, e_meeting_store_count_actual_attendees (mts->model));
- for (row = 0; row < e_meeting_store_count_actual_attendees (mts->model); row++) {
- ia = e_meeting_store_find_attendee_at_row (mts->model, row);
- first_periods[row] = e_meeting_time_selector_item_find_first_busy_period (mts_item, date, row);
- }
-
- for (busy_type = 0;
- busy_type < E_MEETING_FREE_BUSY_LAST;
- busy_type++) {
- gdk_gc_set_foreground (gc, &mts->busy_colors[busy_type]);
- for (row = 0; row < e_meeting_store_count_actual_attendees (mts->model); row++) {
- if (first_periods[row] == -1)
- continue;
- e_meeting_time_selector_item_paint_attendee_busy_periods (mts_item, drawable, x, y, width, row, first_periods[row], busy_type);
- }
- }
-
- g_free (first_periods);
-}
-
-
-static void
-e_meeting_time_selector_item_paint_day (EMeetingTimeSelectorItem *mts_item,
- GdkDrawable *drawable, GDate *date,
- int x, int scroll_y,
- int width, int height)
-{
- EMeetingTimeSelector *mts;
- GdkGC *gc;
- gint grid_x, grid_y, attendee_index, unused_y;
-
- mts = mts_item->mts;
- gc = mts_item->main_gc;
-
- /* Draw the grid lines. The grid lines around unused rows are drawn in
- a different color. */
-
- /* Draw the horizontal grid lines. */
- attendee_index = scroll_y / mts->row_height;
-#if E_MEETING_TIME_SELECTOR_DRAW_GRID_LINES_AT_BOTTOM
- for (grid_y = mts->row_height - 1 - (scroll_y % mts->row_height);
-#else
- for (grid_y = - (scroll_y % mts->row_height);
-#endif
- grid_y < height;
- grid_y += mts->row_height)
- {
- if (attendee_index <= e_meeting_store_count_actual_attendees (mts->model)) {
- gdk_gc_set_foreground (gc, &mts->grid_color);
- gdk_draw_line (drawable, gc, 0, grid_y,
- width, grid_y);
- } else {
- gdk_gc_set_foreground (gc, &mts->grid_unused_color);
- gdk_draw_line (drawable, gc, 0, grid_y,
- width, grid_y);
- }
- attendee_index++;
- }
-
- /* Draw the vertical grid lines. */
- unused_y = (e_meeting_store_count_actual_attendees (mts->model) * mts->row_height) - scroll_y;
- if (unused_y >= 0) {
- gdk_gc_set_foreground (gc, &mts->grid_color);
- for (grid_x = mts->col_width - 1;
- grid_x < mts->day_width - mts->col_width;
- grid_x += mts->col_width)
- {
- gdk_draw_line (drawable, gc,
- x + grid_x, 0,
- x + grid_x, unused_y - 1);
- }
- gdk_draw_rectangle (drawable, gc, TRUE,
- x + mts->day_width - 2, 0,
- 2, unused_y);
- }
-
- if (unused_y < height) {
- gdk_gc_set_foreground (gc, &mts->grid_unused_color);
- for (grid_x = mts->col_width - 1;
- grid_x < mts->day_width - mts->col_width;
- grid_x += mts->col_width)
- {
- gdk_draw_line (drawable, gc,
- x + grid_x, unused_y,
- x + grid_x, height);
- }
- gdk_draw_rectangle (drawable, gc, TRUE,
- x + mts->day_width - 2, unused_y,
- 2, height - unused_y);
- }
-
-
-}
-
-
-/* This paints the colored bars representing busy periods for the individual
- attendees. */
-static void
-e_meeting_time_selector_item_paint_busy_periods (EMeetingTimeSelectorItem *mts_item, GdkDrawable *drawable, GDate *date, int x, int scroll_y, int width, int height)
-{
- EMeetingTimeSelector *mts;
- EMeetingFreeBusyType busy_type;
- gint row, y, first_period;
- GdkGC *gc;
-
- mts = mts_item->mts;
- gc = mts_item->main_gc;
-
- /* Calculate the first visible attendee row. */
- row = scroll_y / mts->row_height;
-
- /* Calculate the y coordinate to paint the row at in the drawable. */
- y = row * mts->row_height - scroll_y;
-
- /* Step through the attendees painting the busy periods. */
- while (y < height && row < e_meeting_store_count_actual_attendees (mts->model)) {
-
- /* Find the first visible busy period. */
- first_period = e_meeting_time_selector_item_find_first_busy_period (mts_item, date, row);
- if (first_period != -1) {
- /* Paint the different types of busy periods, in
- reverse order of precedence, so the highest
- precedences are displayed. */
- for (busy_type = 0;
- busy_type < E_MEETING_FREE_BUSY_LAST;
- busy_type++) {
- gdk_gc_set_foreground (gc, &mts->busy_colors[busy_type]);
- e_meeting_time_selector_item_paint_attendee_busy_periods (mts_item, drawable, x, y, width, row, first_period, busy_type);
- }
- }
- y += mts->row_height;
- row++;
- }
-}
-
-
-/* This subtracts the attendees longest_period_in_days from the given date,
- and does a binary search of the attendee's busy periods array to find the
- first one which could possible end on the given day or later.
- If none are found it returns -1. */
-static gint
-e_meeting_time_selector_item_find_first_busy_period (EMeetingTimeSelectorItem *mts_item, GDate *date, gint row)
-{
- EMeetingTimeSelector *mts;
- EMeetingAttendee *ia;
- const GArray *busy_periods;
- EMeetingFreeBusyPeriod *period;
- gint period_num;
-
- mts = mts_item->mts;
-
- ia = e_meeting_store_find_attendee_at_row (mts->model, row);
-
- period_num = e_meeting_attendee_find_first_busy_period (ia, date);
- if (period_num == -1)
- return -1;
-
- /* Check if the period starts after the end of the current canvas
- scroll area. */
- busy_periods = e_meeting_attendee_get_busy_periods (ia);
- period = &g_array_index (busy_periods, EMeetingFreeBusyPeriod, period_num);
- if (g_date_compare (&mts->last_date_shown, &period->start.date) < 0)
- return -1;
-
- return period_num;
-}
-
-
-/* This paints the visible busy periods for one attendee which are of a certain
- busy type, e.g out of office. It is passed the index of the first visible
- busy period of the attendee and continues until it runs off the screen. */
-static void
-e_meeting_time_selector_item_paint_attendee_busy_periods (EMeetingTimeSelectorItem *mts_item, GdkDrawable *drawable, int x, int y, int width, int row, int first_period, EMeetingFreeBusyType busy_type)
-{
- EMeetingTimeSelector *mts;
- EMeetingAttendee *ia;
- const GArray *busy_periods;
- EMeetingFreeBusyPeriod *period;
- GdkGC *gc;
- gint period_num, x1, x2, x2_within_day, x2_within_col;
-
- mts = mts_item->mts;
- gc = mts_item->main_gc;
-
- ia = e_meeting_store_find_attendee_at_row (mts->model, row);
-
- busy_periods = e_meeting_attendee_get_busy_periods (ia);
- for (period_num = first_period;
- period_num < busy_periods->len;
- period_num++) {
- period = &g_array_index (busy_periods, EMeetingFreeBusyPeriod, period_num);
-
- if (period->busy_type != busy_type)
- continue;
-
- /* Convert the period start and end times to x coordinates. */
- x1 = e_meeting_time_selector_calculate_time_position (mts, &period->start);
- /* If the period is off the right of the area being drawn, we
- are finished. */
- if (x1 >= x + width)
- return;
-
- x2 = e_meeting_time_selector_calculate_time_position (mts, &period->end);
- /* If the period is off the left edge of the area skip it. */
- if (x2 <= x)
- continue;
-
- /* We paint from x1 to x2 - 1, so that for example a time
- from 5:00-6:00 is distinct from 6:00-7:00.
- We never finish on a grid line separating days, and we only
- ever paint on a normal vertical grid line if the period is
- only 1 pixel wide. */
- x2_within_day = x2 % mts->day_width;
- if (x2_within_day == 0) {
- x2 -= 2;
- } else if (x2_within_day == mts->day_width - 1) {
- x2 -= 1;
- } else {
- x2_within_col = x2_within_day % mts->col_width;
- if (x2_within_col == 0 && x2 > x1 + 1)
- x2 -= 1;
- }
-
- /* Paint the rectangle. We leave a gap of 2 pixels at the
- top and bottom, remembering that the grid is painted along
- the top/bottom line of each row. */
- if (x2 - x1 > 0) {
-#if E_MEETING_TIME_SELECTOR_DRAW_GRID_LINES_AT_BOTTOM
- gdk_draw_rectangle (drawable, gc, TRUE,
- x1 - x, y + 2,
- x2 - x1, mts->row_height - 5);
-#else
- gdk_draw_rectangle (drawable, gc, TRUE,
- x1 - x, y + 3,
- x2 - x1, mts->row_height - 5);
-#endif
- }
- }
-}
-
-
-/*
- * CANVAS ITEM ROUTINES - functions to be a GnomeCanvasItem.
- */
-
-/* This is supposed to return the nearest item the the point and the distance.
- Since we are the only item we just return ourself and 0 for the distance.
- This is needed so that we get button/motion events. */
-static double
-e_meeting_time_selector_item_point (GnomeCanvasItem *item, double x, double y,
- int cx, int cy,
- GnomeCanvasItem **actual_item)
-{
- *actual_item = item;
- return 0.0;
-}
-
-
-static gint
-e_meeting_time_selector_item_event (GnomeCanvasItem *item, GdkEvent *event)
-{
- EMeetingTimeSelectorItem *mts_item;
-
- mts_item = E_MEETING_TIME_SELECTOR_ITEM (item);
-
- switch (event->type) {
- case GDK_BUTTON_PRESS:
- return e_meeting_time_selector_item_button_press (mts_item,
- event);
- case GDK_BUTTON_RELEASE:
- return e_meeting_time_selector_item_button_release (mts_item,
- event);
- case GDK_MOTION_NOTIFY:
- return e_meeting_time_selector_item_motion_notify (mts_item,
- event);
- default:
- break;
- }
-
- return FALSE;
-}
-
-
-/* This handles all button press events for the item. If the cursor is over
- one of the meeting time vertical bars we start a drag. If not we set the
- meeting time to the nearest half-hour interval.
- Note that GnomeCanvas converts the event coords to world coords,
- i.e. relative to the entire canvas scroll area. */
-static gint
-e_meeting_time_selector_item_button_press (EMeetingTimeSelectorItem *mts_item,
- GdkEvent *event)
-{
- EMeetingTimeSelector *mts;
- EMeetingTime start_time, end_time;
- EMeetingTimeSelectorPosition position;
- GDate *start_date, *end_date;
- gint x, y;
-
- mts = mts_item->mts;
- x = (gint) event->button.x;
- y = (gint) event->button.y;
-
- /* Check if we are starting a drag of the vertical meeting time bars.*/
- position = e_meeting_time_selector_item_get_drag_position (mts_item,
- x, y);
- if (position != E_MEETING_TIME_SELECTOR_POS_NONE) {
- if (gnome_canvas_item_grab (GNOME_CANVAS_ITEM (mts_item),
- GDK_POINTER_MOTION_MASK
- | GDK_BUTTON_RELEASE_MASK,
- mts_item->resize_cursor,
- event->button.time) == 0 /*Success*/) {
- mts->dragging_position = position;
- return TRUE;
- }
- }
-
- /* Convert the x coordinate into a EMeetingTimeSelectorTime. */
- e_meeting_time_selector_calculate_time (mts, x, &start_time);
- start_date = &start_time.date;
- end_date = &end_time.date;
-
- /* Find the nearest half-hour or hour interval, depending on whether
- zoomed_out is set. */
- if (!mts->all_day) {
- if (mts->zoomed_out) {
- start_time.minute = 0;
- end_time = start_time;
- end_time.hour += 1;
- } else {
- start_time.minute -= start_time.minute % 30;
- end_time = start_time;
- end_time.minute += 30;
- }
- } else {
- start_time.hour = 0;
- start_time.minute = 0;
- end_time = start_time;
- g_date_add_days (&end_time.date, 1);
- }
-
- /* Fix any overflows. */
- e_meeting_time_selector_fix_time_overflows (&end_time);
-
- /* Set the new meeting time. */
- e_meeting_time_selector_set_meeting_time (mts_item->mts,
- g_date_year (start_date),
- g_date_month (start_date),
- g_date_day (start_date),
- start_time.hour,
- start_time.minute,
- g_date_year (end_date),
- g_date_month (end_date),
- g_date_day (end_date),
- end_time.hour,
- end_time.minute);
-
-
- return FALSE;
-}
-
-
-/* This handles all button release events for the item. If we were dragging,
- we finish the drag. */
-static gint
-e_meeting_time_selector_item_button_release (EMeetingTimeSelectorItem *mts_item,
- GdkEvent *event)
-{
- EMeetingTimeSelector *mts;
-
- mts = mts_item->mts;
-
- /* Reset any drag. */
- if (mts->dragging_position != E_MEETING_TIME_SELECTOR_POS_NONE) {
- mts->dragging_position = E_MEETING_TIME_SELECTOR_POS_NONE;
- e_meeting_time_selector_remove_timeout (mts);
- gnome_canvas_item_ungrab (GNOME_CANVAS_ITEM (mts_item),
- event->button.time);
- }
-
- return FALSE;
-}
-
-
-/* This handles all motion notify events for the item. If button1 is pressed
- we check if a drag is in progress. If not, we set the cursor if we are over
- the meeting time vertical bars. Note that GnomeCanvas doesn't use motion
- hints, which may affect performance. */
-static gint
-e_meeting_time_selector_item_motion_notify (EMeetingTimeSelectorItem *mts_item,
- GdkEvent *event)
-{
- EMeetingTimeSelector *mts;
- EMeetingTimeSelectorPosition position;
- GdkCursor *cursor;
- gint x, y;
-
- mts = mts_item->mts;
- x = (gint) event->motion.x;
- y = (gint) event->motion.y;
-
- if (mts->dragging_position != E_MEETING_TIME_SELECTOR_POS_NONE) {
- e_meeting_time_selector_drag_meeting_time (mts, x);
- return TRUE;
- }
-
- position = e_meeting_time_selector_item_get_drag_position (mts_item,
- x, y);
-
- /* Determine which cursor should be used. */
- if (position == E_MEETING_TIME_SELECTOR_POS_NONE)
- cursor = mts_item->normal_cursor;
- else
- cursor = mts_item->resize_cursor;
-
- /* Only set the cursor if it is different to the last one we set. */
- if (mts_item->last_cursor_set != cursor) {
- mts_item->last_cursor_set = cursor;
- gdk_window_set_cursor (GTK_WIDGET (GNOME_CANVAS_ITEM (mts_item)->canvas)->window, cursor);
- }
-
- return FALSE;
-}
-
-
-static EMeetingTimeSelectorPosition
-e_meeting_time_selector_item_get_drag_position (EMeetingTimeSelectorItem *mts_item,
- gint x, gint y)
-{
- EMeetingTimeSelector *mts;
- gboolean is_display_top;
- gint meeting_start_x, meeting_end_x;
-
- mts = mts_item->mts;
-
- is_display_top = (GTK_WIDGET (GNOME_CANVAS_ITEM (mts_item)->canvas) == mts->display_top) ? TRUE : FALSE;
-
- if (is_display_top && y < mts->row_height * 2)
- return E_MEETING_TIME_SELECTOR_POS_NONE;
-
- if (!e_meeting_time_selector_get_meeting_time_positions (mts, &meeting_start_x, &meeting_end_x))
- return E_MEETING_TIME_SELECTOR_POS_NONE;
-
- if (x >= meeting_end_x - 2 && x <= meeting_end_x + 2)
- return E_MEETING_TIME_SELECTOR_POS_END;
-
- if (x >= meeting_start_x - 2 && x <= meeting_start_x + 2)
- return E_MEETING_TIME_SELECTOR_POS_START;
-
- return E_MEETING_TIME_SELECTOR_POS_NONE;
-}
-
-
-static gboolean
-e_meeting_time_selector_item_calculate_busy_range (EMeetingTimeSelector *mts,
- gint row,
- gint x,
- gint width,
- gint *start_x,
- gint *end_x)
-{
- EMeetingAttendee *ia;
- EMeetingTime busy_periods_start;
- EMeetingTime busy_periods_end;
-
- ia = e_meeting_store_find_attendee_at_row (mts->model, row);
- busy_periods_start = e_meeting_attendee_get_start_busy_range (ia);
- busy_periods_end = e_meeting_attendee_get_end_busy_range (ia);
-
- *start_x = -1;
- *end_x = -1;
-
- if (!g_date_valid (&busy_periods_start.date)
- || !g_date_valid (&busy_periods_end.date))
- return FALSE;
-
- *start_x = e_meeting_time_selector_calculate_time_position (mts, &busy_periods_start) - x - 1;
-
- *end_x = e_meeting_time_selector_calculate_time_position (mts, &busy_periods_end) - x;
-
- return TRUE;
-}
diff --git a/calendar/gui/e-meeting-time-sel-item.h b/calendar/gui/e-meeting-time-sel-item.h
deleted file mode 100644
index 11b355dfa0..0000000000
--- a/calendar/gui/e-meeting-time-sel-item.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Author :
- * Damon Chaplin <damon@gtk.org>
- *
- * Copyright 1999, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-/*
- * MeetingTimeSelectorItem - A GnomeCanvasItem which is used for both the main
- * display canvas and the top display (with the dates, times & All Attendees).
- * I didn't make these separate GnomeCanvasItems since they share a lot of
- * code.
- */
-
-#ifndef _E_MEETING_TIME_SELECTOR_ITEM_H_
-#define _E_MEETING_TIME_SELECTOR_ITEM_H_
-
-#include "e-meeting-time-sel.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-
-#define E_MEETING_TIME_SELECTOR_ITEM(obj) (GTK_CHECK_CAST((obj), e_meeting_time_selector_item_get_type (), EMeetingTimeSelectorItem))
-#define E_MEETING_TIME_SELECTOR_ITEM_CLASS(k) (GTK_CHECK_CLASS_CAST ((k), e_meeting_time_selector_item_get_type (), EMeetingTimeSelectorItemClass))
-#define IS_E_MEETING_TIME_SELECTOR_ITEM(o) (GTK_CHECK_TYPE((o), e_meeting_time_selector_item_get_type ()))
-
-
-typedef struct _EMeetingTimeSelectorItem EMeetingTimeSelectorItem;
-typedef struct _EMeetingTimeSelectorItemClass EMeetingTimeSelectorItemClass;
-
-struct _EMeetingTimeSelectorItem
-{
- GnomeCanvasItem canvas_item;
-
- /* The parent EMeetingTimeSelector widget. */
- EMeetingTimeSelector *mts;
-
- /* This GC is used for most of the drawing. The fg/bg colors are
- changed for each bit. */
- GdkGC *main_gc;
- GdkGC *stipple_gc;
-
- /* The normal & resize cursors. */
- GdkCursor *normal_cursor;
- GdkCursor *resize_cursor;
-
- /* This remembers the last cursor set on the window. */
- GdkCursor *last_cursor_set;
-};
-
-
-struct _EMeetingTimeSelectorItemClass
-{
- GnomeCanvasItemClass parent_class;
-};
-
-GtkType e_meeting_time_selector_item_get_type (void);
-
-
-#endif /* _E_MEETING_TIME_SELECTOR_ITEM_H_ */
diff --git a/calendar/gui/e-meeting-time-sel.c b/calendar/gui/e-meeting-time-sel.c
deleted file mode 100644
index 91d915a4d7..0000000000
--- a/calendar/gui/e-meeting-time-sel.c
+++ /dev/null
@@ -1,2850 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Author :
- * Damon Chaplin <damon@gtk.org>
- *
- * Copyright 1999, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "e-meeting-time-sel.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <glib.h>
-#include <gdk/gdkkeysyms.h>
-#include <gtk/gtkalignment.h>
-#include <gtk/gtkarrow.h>
-#include <gtk/gtkbutton.h>
-#include <gtk/gtkdrawingarea.h>
-#include <gtk/gtkentry.h>
-#include <gtk/gtkfixed.h>
-#include <gtk/gtkhbox.h>
-#include <gtk/gtkhscrollbar.h>
-#include <gtk/gtkhseparator.h>
-#include <gtk/gtklabel.h>
-#include <gtk/gtkmenu.h>
-#include <gtk/gtkradiomenuitem.h>
-#include <gtk/gtksignal.h>
-#include <gtk/gtkvbox.h>
-#include <gtk/gtkvscrollbar.h>
-#include <libgnomeui/gnome-dateedit.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnomecanvas/gnome-canvas-widget.h>
-
-#include <gal/widgets/e-canvas.h>
-#include <gal/widgets/e-canvas-utils.h>
-
-#include <widgets/misc/e-dateedit.h>
-
-#include "calendar-component.h"
-#include "calendar-config.h"
-#include "e-meeting-utils.h"
-#include "e-meeting-list-view.h"
-#include "e-meeting-time-sel-item.h"
-
-/* An array of hour strings for 24 hour time, "0:00" .. "23:00". */
-const gchar *EMeetingTimeSelectorHours[24] = {
- "0:00", "1:00", "2:00", "3:00", "4:00", "5:00", "6:00", "7:00",
- "8:00", "9:00", "10:00", "11:00", "12:00", "13:00", "14:00", "15:00",
- "16:00", "17:00", "18:00", "19:00", "20:00", "21:00", "22:00", "23:00"
-};
-
-/* An array of hour strings for 12 hour time, "12:00am" .. "11:00pm". */
-const gchar *EMeetingTimeSelectorHours12[24] = {
- "12:00am", "1:00am", "2:00am", "3:00am", "4:00am", "5:00am", "6:00am",
- "7:00am", "8:00am", "9:00am", "10:00am", "11:00am", "12:00pm",
- "1:00pm", "2:00pm", "3:00pm", "4:00pm", "5:00pm", "6:00pm", "7:00pm",
- "8:00pm", "9:00pm", "10:00pm", "11:00pm"
-};
-
-/* The number of days shown in the entire canvas. */
-#define E_MEETING_TIME_SELECTOR_DAYS_SHOWN 365
-#define E_MEETING_TIME_SELECTOR_DAYS_START_BEFORE 60
-#define E_MEETING_TIME_SELECTOR_FB_DAYS_BEFORE 7
-#define E_MEETING_TIME_SELECTOR_FB_DAYS_AFTER 28
-
-/* This is the number of pixels between the mouse has to move before the
- scroll speed is incremented. */
-#define E_MEETING_TIME_SELECTOR_SCROLL_INCREMENT_WIDTH 10
-
-/* This is the maximum scrolling speed. */
-#define E_MEETING_TIME_SELECTOR_MAX_SCROLL_SPEED 4
-
-/* Signals */
-enum {
- CHANGED,
- LAST_SIGNAL
-};
-
-
-static gint mts_signals [LAST_SIGNAL] = { 0 };
-
-static void e_meeting_time_selector_class_init (EMeetingTimeSelectorClass * klass);
-static void e_meeting_time_selector_init (EMeetingTimeSelector * mts);
-static void e_meeting_time_selector_destroy (GtkObject *object);
-static void e_meeting_time_selector_alloc_named_color (EMeetingTimeSelector * mts,
- const char *name, GdkColor *c);
-static void e_meeting_time_selector_add_key_color (EMeetingTimeSelector * mts,
- GtkWidget *hbox,
- gchar *label_text,
- GdkColor *color);
-static gint e_meeting_time_selector_expose_key_color (GtkWidget *darea,
- GdkEventExpose *event,
- GdkColor *color);
-static void e_meeting_time_selector_options_menu_detacher (GtkWidget *widget,
- GtkMenu *menu);
-static void e_meeting_time_selector_autopick_menu_detacher (GtkWidget *widget,
- GtkMenu *menu);
-static void e_meeting_time_selector_realize (GtkWidget *widget);
-static void e_meeting_time_selector_unrealize (GtkWidget *widget);
-static void e_meeting_time_selector_style_set (GtkWidget *widget,
- GtkStyle *previous_style);
-static gint e_meeting_time_selector_expose_event (GtkWidget *widget,
- GdkEventExpose *event);
-static void e_meeting_time_selector_draw_shadow (EMeetingTimeSelector *mts);
-static void e_meeting_time_selector_hadjustment_changed (GtkAdjustment *adjustment,
- EMeetingTimeSelector *mts);
-static void e_meeting_time_selector_vadjustment_changed (GtkAdjustment *adjustment,
- EMeetingTimeSelector *mts);
-static void e_meeting_time_selector_on_canvas_realized (GtkWidget *widget,
- EMeetingTimeSelector *mts);
-
-static void e_meeting_time_selector_on_options_button_clicked (GtkWidget *button,
- EMeetingTimeSelector *mts);
-static void e_meeting_time_selector_options_menu_position_callback (GtkMenu *menu,
- gint *x,
- gint *y,
- gboolean *push_in,
- gpointer user_data);
-static void e_meeting_time_selector_on_zoomed_out_toggled (GtkWidget *button,
- EMeetingTimeSelector *mts);
-static void e_meeting_time_selector_on_working_hours_toggled (GtkWidget *button,
- EMeetingTimeSelector *mts);
-static gboolean e_meeting_time_selector_on_invite_others_button_expose (GtkWidget *button,
- GdkEventExpose *event,
- EMeetingTimeSelector *mts);
-static void e_meeting_time_selector_on_invite_others_button_clicked (GtkWidget *button,
- EMeetingTimeSelector *mts);
-static void e_meeting_time_selector_on_update_free_busy (GtkWidget *button,
- EMeetingTimeSelector *mts);
-static void e_meeting_time_selector_on_autopick_button_clicked (GtkWidget *button,
- EMeetingTimeSelector *mts);
-static void e_meeting_time_selector_autopick_menu_position_callback (GtkMenu *menu,
- gint *x,
- gint *y,
- gboolean *push_in,
- gpointer user_data);
-static void e_meeting_time_selector_on_autopick_option_toggled (GtkWidget *button,
- EMeetingTimeSelector *mts);
-static void e_meeting_time_selector_on_prev_button_clicked (GtkWidget *button,
- EMeetingTimeSelector *mts);
-static void e_meeting_time_selector_on_next_button_clicked (GtkWidget *button,
- EMeetingTimeSelector *mts);
-static void e_meeting_time_selector_autopick (EMeetingTimeSelector *mts,
- gboolean forward);
-static void e_meeting_time_selector_calculate_time_difference (EMeetingTime*start,
- EMeetingTime*end,
- gint *days,
- gint *hours,
- gint *minutes);
-static void e_meeting_time_selector_find_nearest_interval (EMeetingTimeSelector *mts,
- EMeetingTime*start_time,
- EMeetingTime*end_time,
- gint days, gint hours, gint mins);
-static void e_meeting_time_selector_find_nearest_interval_backward (EMeetingTimeSelector *mts,
- EMeetingTime *start_time,
- EMeetingTime *end_time,
- gint days, gint hours, gint mins);
-static void e_meeting_time_selector_adjust_time (EMeetingTime*mtstime,
- gint days, gint hours, gint minutes);
-static EMeetingFreeBusyPeriod* e_meeting_time_selector_find_time_clash (EMeetingTimeSelector *mts,
- EMeetingAttendee *attendee,
- EMeetingTime *start_time,
- EMeetingTime *end_time);
-
-
-static void e_meeting_time_selector_recalc_grid (EMeetingTimeSelector *mts);
-static void e_meeting_time_selector_recalc_date_format (EMeetingTimeSelector *mts);
-static void e_meeting_time_selector_save_position (EMeetingTimeSelector *mts,
- EMeetingTime *mtstime);
-static void e_meeting_time_selector_restore_position (EMeetingTimeSelector *mts,
- EMeetingTime*mtstime);
-static void e_meeting_time_selector_on_start_time_changed (GtkWidget *widget,
- EMeetingTimeSelector *mts);
-static void e_meeting_time_selector_on_end_time_changed (GtkWidget *widget,
- EMeetingTimeSelector *mts);
-static void e_meeting_time_selector_update_date_popup_menus (EMeetingTimeSelector *mts);
-static void e_meeting_time_selector_on_canvas_size_allocate (GtkWidget *widget,
- GtkAllocation *allocation,
- EMeetingTimeSelector *mts);
-static void e_meeting_time_selector_update_main_canvas_scroll_region (EMeetingTimeSelector *mts);
-static gboolean e_meeting_time_selector_timeout_handler (gpointer data);
-static void e_meeting_time_selector_update_start_date_edit (EMeetingTimeSelector *mts);
-static void e_meeting_time_selector_update_end_date_edit (EMeetingTimeSelector *mts);
-static void e_meeting_time_selector_ensure_meeting_time_shown (EMeetingTimeSelector *mts);
-static void e_meeting_time_selector_update_dates_shown (EMeetingTimeSelector *mts);
-
-static void row_inserted_cb (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data);
-static void row_changed_cb (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data);
-static void row_deleted_cb (GtkTreeModel *model, GtkTreePath *path, gpointer data);
-
-static GtkTableClass *parent_class;
-
-E_MAKE_TYPE (e_meeting_time_selector, "EMeetingTimeSelector", EMeetingTimeSelector,
- e_meeting_time_selector_class_init, e_meeting_time_selector_init,
- GTK_TYPE_TABLE);
-
-static void
-e_meeting_time_selector_class_init (EMeetingTimeSelectorClass * klass)
-{
- GtkObjectClass *object_class;
- GtkWidgetClass *widget_class;
-
- parent_class = g_type_class_peek_parent (klass);
- object_class = (GtkObjectClass *) klass;
- widget_class = (GtkWidgetClass *) klass;
-
- mts_signals [CHANGED] =
- gtk_signal_new ("changed", GTK_RUN_FIRST,
- G_TYPE_FROM_CLASS (object_class),
- GTK_SIGNAL_OFFSET (EMeetingTimeSelectorClass,
- changed),
- gtk_signal_default_marshaller,
- GTK_TYPE_NONE, 0);
-
- object_class->destroy = e_meeting_time_selector_destroy;
-
- widget_class->realize = e_meeting_time_selector_realize;
- widget_class->unrealize = e_meeting_time_selector_unrealize;
- widget_class->style_set = e_meeting_time_selector_style_set;
- widget_class->expose_event = e_meeting_time_selector_expose_event;
-}
-
-
-static void
-e_meeting_time_selector_init (EMeetingTimeSelector * mts)
-{
- /* The shadow is drawn in the border so it must be >= 2 pixels. */
- gtk_container_set_border_width (GTK_CONTAINER (mts), 2);
-
- mts->accel_group = gtk_accel_group_new ();
-
- mts->working_hours_only = TRUE;
- mts->day_start_hour = 9;
- mts->day_start_minute = 0;
- mts->day_end_hour = 18;
- mts->day_end_minute = 0;
- mts->zoomed_out = TRUE;
- mts->dragging_position = E_MEETING_TIME_SELECTOR_POS_NONE;
-
- mts->list_view = NULL;
-}
-
-
-void
-e_meeting_time_selector_construct (EMeetingTimeSelector * mts, EMeetingStore *ems)
-{
- char *filename;
- GtkWidget *hbox, *vbox, *separator, *button, *label, *table;
- GtkWidget *alignment, *child_hbox, *arrow, *menuitem;
- GSList *group;
- GdkVisual *visual;
- GdkColormap *colormap;
- guint accel_key;
- time_t meeting_start_time;
- struct tm *meeting_start_tm;
- guchar stipple_bits[] = {
- 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80,
- };
-
- /* The default meeting time is the nearest half-hour interval in the
- future, in working hours. */
- meeting_start_time = time (NULL);
- g_date_clear (&mts->meeting_start_time.date, 1);
- g_date_set_time (&mts->meeting_start_time.date, meeting_start_time);
- meeting_start_tm = localtime (&meeting_start_time);
- mts->meeting_start_time.hour = meeting_start_tm->tm_hour;
- mts->meeting_start_time.minute = meeting_start_tm->tm_min;
-
- e_meeting_time_selector_find_nearest_interval (mts, &mts->meeting_start_time,
- &mts->meeting_end_time,
- 0, 0, 30);
-
- e_meeting_time_selector_update_dates_shown (mts);
-
- mts->meeting_positions_valid = FALSE;
-
- mts->row_height = 17;
- mts->col_width = 55;
- mts->day_width = 55 * 24 + 1;
-
- mts->auto_scroll_timeout_id = 0;
-
- vbox = gtk_vbox_new (FALSE, 0);
- gtk_table_attach (GTK_TABLE (mts),
- vbox, 0, 1, 0, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
- gtk_widget_show (vbox);
-
- mts->attendees_vbox_spacer = gtk_vbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (vbox), mts->attendees_vbox_spacer, FALSE, FALSE, 0);
- gtk_widget_show (mts->attendees_vbox_spacer);
-
- mts->attendees_vbox = gtk_vbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (vbox), mts->attendees_vbox, TRUE, TRUE, 0);
- gtk_widget_show (mts->attendees_vbox);
-
-
- /* build the etable */
- filename = g_build_filename (calendar_component_peek_config_directory (calendar_component_peek ()),
- "config", "et-header-meeting-time-sel", NULL);
- mts->model = ems;
-
- if (mts->model)
- g_object_ref (mts->model);
-
- g_signal_connect (mts->model, "row_inserted", G_CALLBACK (row_inserted_cb), mts);
- g_signal_connect (mts->model, "row_changed", G_CALLBACK (row_changed_cb), mts);
- g_signal_connect (mts->model, "row_deleted", G_CALLBACK (row_deleted_cb), mts);
-
- mts->list_view = e_meeting_list_view_new (mts->model);
- e_meeting_list_view_column_set_visible (mts->list_view, "Role", FALSE);
- e_meeting_list_view_column_set_visible (mts->list_view, "RSVP", FALSE);
- gtk_widget_show (GTK_WIDGET (mts->list_view));
-
-#if 0
- /* FIXME: do we need sorting here */
- g_signal_connect (real_table->sort_info, "sort_info_changed", G_CALLBACK (sort_info_changed_cb), mts);
-#endif
-
- gtk_box_pack_start (GTK_BOX (mts->attendees_vbox), GTK_WIDGET (mts->list_view), TRUE, TRUE, 6);
-
- /* The free/busy information */
- mts->display_top = gnome_canvas_new ();
- gtk_widget_set_usize (mts->display_top, -1, mts->row_height * 3);
- gnome_canvas_set_scroll_region (GNOME_CANVAS (mts->display_top),
- 0, 0,
- mts->day_width * E_MEETING_TIME_SELECTOR_DAYS_SHOWN,
- mts->row_height * 3);
- /* Add some horizontal padding for the shadow around the display. */
- gtk_table_attach (GTK_TABLE (mts), mts->display_top,
- 1, 4, 0, 1, GTK_EXPAND | GTK_FILL, 0, 0, 0);
- gtk_widget_show (mts->display_top);
- g_signal_connect (mts->display_top, "realize",
- G_CALLBACK (e_meeting_time_selector_on_canvas_realized), mts);
-
- mts->display_main = gnome_canvas_new ();
- e_meeting_time_selector_update_main_canvas_scroll_region (mts);
- /* Add some horizontal padding for the shadow around the display. */
- gtk_table_attach (GTK_TABLE (mts), mts->display_main,
- 1, 4, 1, 2,
- GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
- gtk_widget_show (mts->display_main);
- g_signal_connect (mts->display_main, "realize",
- G_CALLBACK (e_meeting_time_selector_on_canvas_realized), mts);
- g_signal_connect (mts->display_main, "size_allocate",
- G_CALLBACK (e_meeting_time_selector_on_canvas_size_allocate), mts);
-
- mts->hscrollbar = gtk_hscrollbar_new (GTK_LAYOUT (mts->display_main)->hadjustment);
- GTK_LAYOUT (mts->display_main)->hadjustment->step_increment = mts->col_width;
- gtk_table_attach (GTK_TABLE (mts), mts->hscrollbar,
- 1, 4, 2, 3, GTK_EXPAND | GTK_FILL, 0, 0, 0);
- gtk_widget_show (mts->hscrollbar);
-
- mts->vscrollbar = gtk_vscrollbar_new (GTK_LAYOUT (mts->display_main)->vadjustment);
- GTK_LAYOUT (mts->display_main)->vadjustment->step_increment = mts->row_height;
- gtk_table_attach (GTK_TABLE (mts), mts->vscrollbar,
- 4, 5, 1, 2, 0, GTK_EXPAND | GTK_FILL, 0, 0);
- gtk_widget_show (mts->vscrollbar);
-
- /* Create the item in the top canvas. */
- gnome_canvas_item_new (GNOME_CANVAS_GROUP (GNOME_CANVAS (mts->display_top)->root),
- e_meeting_time_selector_item_get_type (),
- "EMeetingTimeSelectorItem::meeting_time_selector", mts,
- NULL);
-
- /* Create the item in the main canvas. */
- gnome_canvas_item_new (GNOME_CANVAS_GROUP (GNOME_CANVAS (mts->display_main)->root),
- e_meeting_time_selector_item_get_type (),
- "EMeetingTimeSelectorItem::meeting_time_selector", mts,
- NULL);
-
- /* Create the hbox containing the color key. */
- hbox = gtk_hbox_new (FALSE, 2);
- gtk_table_attach (GTK_TABLE (mts), hbox,
- 1, 4, 3, 4, GTK_FILL, 0, 0, 8);
- gtk_widget_show (hbox);
-
- e_meeting_time_selector_add_key_color (mts, hbox, _("Tentative"), &mts->busy_colors[E_MEETING_FREE_BUSY_TENTATIVE]);
- e_meeting_time_selector_add_key_color (mts, hbox, _("Busy"), &mts->busy_colors[E_MEETING_FREE_BUSY_BUSY]);
- e_meeting_time_selector_add_key_color (mts, hbox, _("Out of Office"), &mts->busy_colors[E_MEETING_FREE_BUSY_OUT_OF_OFFICE]);
- e_meeting_time_selector_add_key_color (mts, hbox, _("No Information"),
- NULL);
-
- separator = gtk_hseparator_new ();
- gtk_table_attach (GTK_TABLE (mts), separator,
- 0, 5, 4, 5, GTK_FILL, 0, 6, 6);
- gtk_widget_show (separator);
-
- /* Create the Invite Others & Options buttons on the left. */
- hbox = gtk_hbox_new (FALSE, 4);
- gtk_table_attach (GTK_TABLE (mts), hbox,
- 0, 1, 3, 4, GTK_FILL, 0, 0, 0);
- gtk_widget_show (hbox);
-
- button = gtk_button_new_with_label ("");
- gtk_label_set_text_with_mnemonic (GTK_LABEL (GTK_BIN (button)->child),
- _("_Invite Others..."));
- accel_key = gtk_label_get_mnemonic_keyval (GTK_LABEL (GTK_BIN (button)->child));
- gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 6);
- gtk_widget_show (button);
- gtk_widget_add_accelerator (button, "clicked", mts->accel_group,
- accel_key, GDK_MOD1_MASK, 0);
- g_signal_connect (button, "clicked",
- G_CALLBACK (e_meeting_time_selector_on_invite_others_button_clicked), mts);
- g_signal_connect (button, "expose-event",
- G_CALLBACK (e_meeting_time_selector_on_invite_others_button_expose), mts);
-
- mts->options_button = gtk_button_new ();
- gtk_box_pack_start (GTK_BOX (hbox), mts->options_button, TRUE, TRUE, 6);
- gtk_widget_show (mts->options_button);
-
- g_signal_connect (mts->options_button, "clicked",
- G_CALLBACK (e_meeting_time_selector_on_options_button_clicked), mts);
-
- child_hbox = gtk_hbox_new (FALSE, 2);
- gtk_container_add (GTK_CONTAINER (mts->options_button), child_hbox);
- gtk_widget_show (child_hbox);
-
- label = gtk_label_new ("");
- gtk_label_set_text_with_mnemonic (GTK_LABEL (label), _("_Options"));
- accel_key = gtk_label_get_mnemonic_keyval (GTK_LABEL (label));
- gtk_box_pack_start (GTK_BOX (child_hbox), label, TRUE, TRUE, 6);
- gtk_widget_show (label);
- gtk_widget_add_accelerator (mts->options_button, "clicked", mts->accel_group,
- accel_key, GDK_MOD1_MASK, 0);
-
- arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_OUT);
- gtk_box_pack_start (GTK_BOX (child_hbox), arrow, FALSE, FALSE, 6);
- gtk_widget_show (arrow);
-
- /* Create the Options menu. */
- mts->options_menu = gtk_menu_new ();
- gtk_menu_attach_to_widget (GTK_MENU (mts->options_menu), mts->options_button,
- e_meeting_time_selector_options_menu_detacher);
-
- menuitem = gtk_check_menu_item_new_with_label ("");
- gtk_label_set_text_with_mnemonic (GTK_LABEL (GTK_BIN (menuitem)->child), _("Show _Only Working Hours"));
- gtk_menu_append (GTK_MENU (mts->options_menu), menuitem);
- gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menuitem),
- mts->working_hours_only);
-
- g_signal_connect (menuitem, "toggled",
- G_CALLBACK (e_meeting_time_selector_on_working_hours_toggled), mts);
- gtk_widget_show (menuitem);
-
- menuitem = gtk_check_menu_item_new_with_label ("");
- gtk_label_set_text_with_mnemonic (GTK_LABEL (GTK_BIN (menuitem)->child), _("Show _Zoomed Out"));
- gtk_menu_append (GTK_MENU (mts->options_menu), menuitem);
- gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menuitem),
- mts->zoomed_out);
-
- g_signal_connect (menuitem, "toggled",
- G_CALLBACK (e_meeting_time_selector_on_zoomed_out_toggled), mts);
- gtk_widget_show (menuitem);
-
- menuitem = gtk_menu_item_new ();
- gtk_menu_append (GTK_MENU (mts->options_menu), menuitem);
- gtk_widget_set_sensitive (menuitem, FALSE);
- gtk_widget_show (menuitem);
-
- menuitem = gtk_menu_item_new_with_label ("");
- gtk_label_set_text_with_mnemonic (GTK_LABEL (GTK_BIN (menuitem)->child), _("_Update Free/Busy"));
- gtk_menu_append (GTK_MENU (mts->options_menu), menuitem);
-
- g_signal_connect (menuitem, "activate",
- G_CALLBACK (e_meeting_time_selector_on_update_free_busy), mts);
- gtk_widget_show (menuitem);
-
- /* Create the 3 AutoPick buttons on the left. */
- hbox = gtk_hbox_new (FALSE, 0);
- gtk_table_attach (GTK_TABLE (mts), hbox,
- 0, 1, 5, 6, GTK_FILL, 0, 0, 0);
- gtk_widget_show (hbox);
-
- button = gtk_button_new_with_label ("");
- gtk_label_set_text_with_mnemonic (GTK_LABEL (GTK_BIN (button)->child),
- _("_<<"));
- accel_key = gtk_label_get_mnemonic_keyval (GTK_LABEL (GTK_BIN (button)->child));
- gtk_widget_add_accelerator (button, "clicked", mts->accel_group,
- accel_key, GDK_MOD1_MASK | GDK_SHIFT_MASK, 0);
- gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 6);
- gtk_widget_show (button);
- g_signal_connect (button, "clicked",
- G_CALLBACK (e_meeting_time_selector_on_prev_button_clicked), mts);
-
- mts->autopick_button = gtk_button_new ();
- gtk_box_pack_start (GTK_BOX (hbox), mts->autopick_button, TRUE, TRUE, 6);
- gtk_widget_show (mts->autopick_button);
-
- child_hbox = gtk_hbox_new (FALSE, 2);
- gtk_container_add (GTK_CONTAINER (mts->autopick_button), child_hbox);
- gtk_widget_show (child_hbox);
-
- label = gtk_label_new ("");
- gtk_label_set_text_with_mnemonic (GTK_LABEL (label), _("_Autopick"));
- accel_key = gtk_label_get_mnemonic_keyval (GTK_LABEL (label));
- gtk_box_pack_start (GTK_BOX (child_hbox), label, TRUE, TRUE, 6);
- gtk_widget_show (label);
- gtk_widget_add_accelerator (mts->autopick_button, "clicked", mts->accel_group,
- accel_key, GDK_MOD1_MASK, 0);
- g_signal_connect (mts->autopick_button, "clicked",
- G_CALLBACK (e_meeting_time_selector_on_autopick_button_clicked), mts);
-
- arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_OUT);
- gtk_box_pack_start (GTK_BOX (child_hbox), arrow, FALSE, FALSE, 6);
- gtk_widget_show (arrow);
-
- button = gtk_button_new_with_label ("");
- gtk_label_set_text_with_mnemonic (GTK_LABEL (GTK_BIN (button)->child),
- _(">_>"));
- accel_key = gtk_label_get_mnemonic_keyval (GTK_LABEL (GTK_BIN (button)->child));
- gtk_widget_add_accelerator (button, "clicked", mts->accel_group,
- accel_key, GDK_MOD1_MASK | GDK_SHIFT_MASK, 0);
- gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 6);
- gtk_widget_show (button);
- g_signal_connect (button, "clicked",
- G_CALLBACK (e_meeting_time_selector_on_next_button_clicked), mts);
-
- /* Create the Autopick menu. */
- mts->autopick_menu = gtk_menu_new ();
- gtk_menu_attach_to_widget (GTK_MENU (mts->autopick_menu), mts->autopick_button,
- e_meeting_time_selector_autopick_menu_detacher);
-
- menuitem = gtk_radio_menu_item_new_with_label (NULL, "");
- mts->autopick_all_item = menuitem;
- group = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (menuitem));
- gtk_label_set_text_with_mnemonic (GTK_LABEL (GTK_BIN (menuitem)->child), _("_All People and Resources"));
- gtk_menu_append (GTK_MENU (mts->autopick_menu), menuitem);
- g_signal_connect (menuitem, "toggled",
- G_CALLBACK (e_meeting_time_selector_on_autopick_option_toggled), mts);
- gtk_widget_show (menuitem);
-
- menuitem = gtk_radio_menu_item_new_with_label (group, "");
- mts->autopick_all_people_one_resource_item = menuitem;
- group = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (menuitem));
- gtk_label_set_text_with_mnemonic (GTK_LABEL (GTK_BIN (menuitem)->child), _("All _People and One Resource"));
- gtk_menu_append (GTK_MENU (mts->autopick_menu), menuitem);
- g_signal_connect (menuitem, "toggled",
- G_CALLBACK (e_meeting_time_selector_on_autopick_option_toggled), mts);
- gtk_widget_show (menuitem);
-
- menuitem = gtk_radio_menu_item_new_with_label (group, "");
- mts->autopick_required_people_item = menuitem;
- group = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (menuitem));
- gtk_label_set_text_with_mnemonic (GTK_LABEL (GTK_BIN (menuitem)->child), _("_Required People"));
- gtk_menu_append (GTK_MENU (mts->autopick_menu), menuitem);
- g_signal_connect (menuitem, "activate",
- G_CALLBACK (e_meeting_time_selector_on_autopick_option_toggled), mts);
- gtk_widget_show (menuitem);
-
- menuitem = gtk_radio_menu_item_new_with_label (group, "");
- mts->autopick_required_people_one_resource_item = menuitem;
- group = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (menuitem));
- gtk_label_set_text_with_mnemonic (GTK_LABEL (GTK_BIN (menuitem)->child), _("Required People and _One Resource"));
- gtk_menu_append (GTK_MENU (mts->autopick_menu), menuitem);
- g_signal_connect (menuitem, "activate",
- G_CALLBACK (e_meeting_time_selector_on_autopick_option_toggled), mts);
- gtk_widget_show (menuitem);
-
- /* Create the date entry fields on the right. */
- alignment = gtk_alignment_new (0.0, 0.5, 0, 0);
- gtk_table_attach (GTK_TABLE (mts), alignment,
- 1, 4, 5, 6, GTK_FILL, 0, 0, 0);
- gtk_widget_show (alignment);
-
- table = gtk_table_new (2, 2, FALSE);
- gtk_table_set_row_spacings (GTK_TABLE (table), 4);
- gtk_container_add (GTK_CONTAINER (alignment), table);
- gtk_widget_show (table);
-
- label = gtk_label_new ("");
- gtk_label_set_text_with_mnemonic (GTK_LABEL (label),
- _("Meeting _start time:"));
- accel_key = gtk_label_get_mnemonic_keyval (GTK_LABEL (label));
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_table_attach (GTK_TABLE (table), label,
- 0, 1, 0, 1, GTK_FILL, 0, 4, 0);
- gtk_widget_show (label);
-
- mts->start_date_edit = e_date_edit_new ();
- e_date_edit_set_show_time (E_DATE_EDIT (mts->start_date_edit), TRUE);
- e_date_edit_set_use_24_hour_format (E_DATE_EDIT (mts->start_date_edit),
- calendar_config_get_24_hour_format ());
-
- gtk_table_attach (GTK_TABLE (table), mts->start_date_edit,
- 1, 2, 0, 1, GTK_FILL, 0, 0, 0);
- gtk_widget_show (mts->start_date_edit);
- g_signal_connect (mts->start_date_edit, "changed",
- G_CALLBACK (e_meeting_time_selector_on_start_time_changed), mts);
-
- label = gtk_label_new ("");
- gtk_label_set_text_with_mnemonic (GTK_LABEL (label),
- _("Meeting _end time:"));
- accel_key = gtk_label_get_mnemonic_keyval (GTK_LABEL (label));
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_table_attach (GTK_TABLE (table), label,
- 0, 1, 1, 2, GTK_FILL, 0, 4, 0);
- gtk_widget_show (label);
-
- mts->end_date_edit = e_date_edit_new ();
- e_date_edit_set_show_time (E_DATE_EDIT (mts->end_date_edit), TRUE);
- e_date_edit_set_use_24_hour_format (E_DATE_EDIT (mts->end_date_edit),
- calendar_config_get_24_hour_format ());
-
- gtk_table_attach (GTK_TABLE (table), mts->end_date_edit,
- 1, 2, 1, 2, GTK_FILL, 0, 0, 0);
- gtk_widget_show (mts->end_date_edit);
- g_signal_connect (mts->end_date_edit, "changed",
- G_CALLBACK (e_meeting_time_selector_on_end_time_changed), mts);
-
- gtk_table_set_col_spacing (GTK_TABLE (mts), 0, 4);
- gtk_table_set_row_spacing (GTK_TABLE (mts), 4, 12);
-
- /* Allocate the colors. */
- visual = gtk_widget_get_visual (GTK_WIDGET (mts));
- colormap = gtk_widget_get_colormap (GTK_WIDGET (mts));
- e_meeting_time_selector_alloc_named_color (mts, "gray75", &mts->bg_color);
- e_meeting_time_selector_alloc_named_color (mts, "gray50", &mts->all_attendees_bg_color);
- gdk_color_black (colormap, &mts->grid_color);
- gdk_color_white (colormap, &mts->grid_shadow_color);
- e_meeting_time_selector_alloc_named_color (mts, "gray50", &mts->grid_unused_color);
- gdk_color_white (colormap, &mts->meeting_time_bg_color);
- gdk_color_white (colormap, &mts->stipple_bg_color);
- gdk_color_white (colormap, &mts->attendee_list_bg_color);
-
- e_meeting_time_selector_alloc_named_color (mts, "LightSkyBlue2", &mts->busy_colors[E_MEETING_FREE_BUSY_TENTATIVE]);
- e_meeting_time_selector_alloc_named_color (mts, "blue", &mts->busy_colors[E_MEETING_FREE_BUSY_BUSY]);
- e_meeting_time_selector_alloc_named_color (mts, "HotPink3", &mts->busy_colors[E_MEETING_FREE_BUSY_OUT_OF_OFFICE]);
-
- /* Create the stipple, for attendees with no data. */
- mts->stipple = gdk_bitmap_create_from_data (NULL, (gchar*)stipple_bits,
- 8, 8);
-
- /* Connect handlers to the adjustments scroll the other items. */
- g_signal_connect (GTK_LAYOUT (mts->display_main)->hadjustment, "value_changed",
- G_CALLBACK (e_meeting_time_selector_hadjustment_changed), mts);
- g_signal_connect (GTK_LAYOUT (mts->display_main)->vadjustment, "value_changed",
- G_CALLBACK (e_meeting_time_selector_vadjustment_changed), mts);
- g_signal_connect (GTK_LAYOUT (mts->display_main)->vadjustment, "changed",
- G_CALLBACK (e_meeting_time_selector_vadjustment_changed), mts);
-
- e_meeting_time_selector_recalc_grid (mts);
- e_meeting_time_selector_ensure_meeting_time_shown (mts);
- e_meeting_time_selector_update_start_date_edit (mts);
- e_meeting_time_selector_update_end_date_edit (mts);
- e_meeting_time_selector_update_date_popup_menus (mts);
-
- gtk_signal_emit (GTK_OBJECT (mts), mts_signals [CHANGED]);
-}
-
-
-/* This adds a color to the color key beneath the main display. If color is
- NULL, it displays the No Info stipple instead. */
-static void
-e_meeting_time_selector_add_key_color (EMeetingTimeSelector * mts,
- GtkWidget *hbox,
- gchar *label_text, GdkColor *color)
-{
- GtkWidget *child_hbox, *darea, *label;
-
- child_hbox = gtk_hbox_new (FALSE, 4);
- gtk_box_pack_start (GTK_BOX (hbox), child_hbox, TRUE, TRUE, 0);
- gtk_widget_show (child_hbox);
-
- darea = gtk_drawing_area_new ();
- gtk_box_pack_start (GTK_BOX (child_hbox), darea, FALSE, FALSE, 0);
- gtk_object_set_user_data (GTK_OBJECT (darea), mts);
- gtk_widget_set_usize (darea, 14, 14);
- gtk_widget_show (darea);
-
- label = gtk_label_new (label_text);
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_box_pack_start (GTK_BOX (child_hbox), label, TRUE, TRUE, 6);
- gtk_widget_show (label);
-
- g_signal_connect (darea, "expose_event",
- G_CALLBACK (e_meeting_time_selector_expose_key_color),
- color);
-}
-
-static gint
-e_meeting_time_selector_expose_key_color (GtkWidget *darea,
- GdkEventExpose *event,
- GdkColor *color)
-{
- EMeetingTimeSelector * mts;
- GdkGC *gc;
- gint width, height;
-
- mts = gtk_object_get_user_data (GTK_OBJECT (darea));
- gc = mts->color_key_gc;
- width = darea->allocation.width;
- height = darea->allocation.height;
-
- gtk_draw_shadow (darea->style, darea->window, GTK_STATE_NORMAL,
- GTK_SHADOW_IN, 0, 0, width, height);
-
- if (color) {
- gdk_gc_set_foreground (gc, color);
- gdk_draw_rectangle (darea->window, gc, TRUE, 1, 1,
- width - 2, height - 2);
- } else {
- gdk_gc_set_foreground (gc, &mts->grid_color);
- gdk_gc_set_background (gc, &mts->stipple_bg_color);
- gdk_gc_set_stipple (gc, mts->stipple);
- gdk_gc_set_fill (gc, GDK_OPAQUE_STIPPLED);
- gdk_draw_rectangle (darea->window, gc, TRUE, 1, 1,
- width - 2, height - 2);
- gdk_gc_set_fill (gc, GDK_SOLID);
- }
-
- return TRUE;
-}
-
-
-static void
-e_meeting_time_selector_alloc_named_color (EMeetingTimeSelector * mts,
- const char *name, GdkColor *c)
-{
- GdkColormap *colormap;
-
- g_return_if_fail (name != NULL);
- g_return_if_fail (c != NULL);
-
- gdk_color_parse (name, c);
- colormap = gtk_widget_get_colormap (GTK_WIDGET (mts));
- if (!gdk_colormap_alloc_color (colormap, c, TRUE, TRUE))
- g_warning ("Failed to allocate color: %s\n", name);
-}
-
-
-static void
-e_meeting_time_selector_options_menu_detacher (GtkWidget *widget,
- GtkMenu *menu)
-{
- EMeetingTimeSelector *mts;
-
- g_return_if_fail (widget != NULL);
- g_return_if_fail (IS_E_MEETING_TIME_SELECTOR (widget));
-
- mts = E_MEETING_TIME_SELECTOR (widget);
- g_return_if_fail (mts->options_menu == (GtkWidget*) menu);
-
- mts->options_menu = NULL;
-}
-
-
-static void
-e_meeting_time_selector_autopick_menu_detacher (GtkWidget *widget,
- GtkMenu *menu)
-{
- EMeetingTimeSelector *mts;
-
- g_return_if_fail (widget != NULL);
- g_return_if_fail (IS_E_MEETING_TIME_SELECTOR (widget));
-
- mts = E_MEETING_TIME_SELECTOR (widget);
- g_return_if_fail (mts->autopick_menu == (GtkWidget*) menu);
-
- mts->autopick_menu = NULL;
-}
-
-
-GtkWidget *
-e_meeting_time_selector_new (EMeetingStore *ems)
-{
- GtkWidget *mts;
-
- mts = GTK_WIDGET (g_object_new (e_meeting_time_selector_get_type (), NULL));
-
- e_meeting_time_selector_construct (E_MEETING_TIME_SELECTOR (mts), ems);
-
- return mts;
-}
-
-
-static void
-e_meeting_time_selector_destroy (GtkObject *object)
-{
- EMeetingTimeSelector *mts;
-
- mts = E_MEETING_TIME_SELECTOR (object);
-
- e_meeting_time_selector_remove_timeout (mts);
-
- if (mts->stipple) {
- gdk_bitmap_unref (mts->stipple);
- mts->stipple = NULL;
- }
-
- if (mts->model) {
- g_object_unref (mts->model);
- mts->model = NULL;
- }
-
- mts->display_top = NULL;
- mts->display_main = NULL;
-
- if (GTK_OBJECT_CLASS (parent_class)->destroy)
- (*GTK_OBJECT_CLASS (parent_class)->destroy)(object);
-}
-
-
-static void
-e_meeting_time_selector_realize (GtkWidget *widget)
-{
- EMeetingTimeSelector *mts;
-
- if (GTK_WIDGET_CLASS (parent_class)->realize)
- (*GTK_WIDGET_CLASS (parent_class)->realize)(widget);
-
- mts = E_MEETING_TIME_SELECTOR (widget);
-
- mts->color_key_gc = gdk_gc_new (widget->window);
-}
-
-
-static void
-e_meeting_time_selector_unrealize (GtkWidget *widget)
-{
- EMeetingTimeSelector *mts;
-
- mts = E_MEETING_TIME_SELECTOR (widget);
-
- gdk_gc_unref (mts->color_key_gc);
- mts->color_key_gc = NULL;
-
- if (GTK_WIDGET_CLASS (parent_class)->unrealize)
- (*GTK_WIDGET_CLASS (parent_class)->unrealize)(widget);
-}
-
-static void
-e_meeting_time_selector_style_set (GtkWidget *widget,
- GtkStyle *previous_style)
-{
- EMeetingTimeSelector *mts;
- EMeetingTime saved_time;
- int hour, max_hour_width;
- int maxheight;
- PangoFontDescription *font_desc;
- PangoContext *pango_context;
- PangoFontMetrics *font_metrics;
- PangoLayout *layout;
- GtkTreePath *path;
- GdkRectangle cell_area;
-
- if (GTK_WIDGET_CLASS (parent_class)->style_set)
- (*GTK_WIDGET_CLASS (parent_class)->style_set)(widget, previous_style);
-
- mts = E_MEETING_TIME_SELECTOR (widget);
-
- /* Set up Pango prerequisites */
- font_desc = gtk_widget_get_style (widget)->font_desc;
- pango_context = gtk_widget_get_pango_context (widget);
- font_metrics = pango_context_get_metrics (pango_context, font_desc,
- pango_context_get_language (pango_context));
- layout = pango_layout_new (pango_context);
-
- /* Calculate the widths of the hour strings in the style's font. */
- max_hour_width = 0;
- for (hour = 0; hour < 24; hour++) {
- if (calendar_config_get_24_hour_format ())
- pango_layout_set_text (layout, EMeetingTimeSelectorHours [hour], -1);
- else
- pango_layout_set_text (layout, EMeetingTimeSelectorHours12 [hour], -1);
-
- pango_layout_get_pixel_size (layout, &mts->hour_widths [hour], NULL);
- max_hour_width = MAX (max_hour_width, mts->hour_widths[hour]);
- }
-
- pango_layout_get_pixel_size (layout, NULL, &mts->row_height);
- mts->col_width = max_hour_width + 6;
-
- e_meeting_time_selector_save_position (mts, &saved_time);
- e_meeting_time_selector_recalc_grid (mts);
- e_meeting_time_selector_restore_position (mts, &saved_time);
-
- gtk_widget_set_usize (mts->display_top, -1, mts->row_height * 3 + 4);
-
- /* Calculate header height */
- if (GTK_WIDGET_REALIZED (mts->list_view)) {
- path = gtk_tree_path_new ();
- gtk_tree_path_append_index (path, 0);
- gtk_tree_view_get_cell_area (GTK_TREE_VIEW (mts->list_view), path, NULL, &cell_area);
- gtk_tree_path_free (path);
- maxheight = cell_area.y;
- } else
- maxheight = 10;
-
- gtk_widget_set_usize (mts->attendees_vbox_spacer, 1, mts->row_height * 3 - maxheight);
-
- GTK_LAYOUT (mts->display_main)->hadjustment->step_increment = mts->col_width;
- GTK_LAYOUT (mts->display_main)->vadjustment->step_increment = mts->row_height;
-
- g_object_unref (layout);
- pango_font_metrics_unref (font_metrics);
-}
-
-/* This draws a shadow around the top display and main display. */
-static gint
-e_meeting_time_selector_expose_event (GtkWidget *widget,
- GdkEventExpose *event)
-{
- EMeetingTimeSelector *mts;
-
- mts = E_MEETING_TIME_SELECTOR (widget);
-
- e_meeting_time_selector_draw_shadow (mts);
-
- if (GTK_WIDGET_CLASS (parent_class)->expose_event)
- (*GTK_WIDGET_CLASS (parent_class)->expose_event)(widget, event);
-
- return FALSE;
-}
-
-static void
-e_meeting_time_selector_draw_shadow (EMeetingTimeSelector *mts)
-{
- GtkWidget *widget;
- gint x, y, w, h;
-
- widget = GTK_WIDGET (mts);
-
- /* Draw the shadow around the graphical displays. */
- x = mts->display_top->allocation.x - 2;
- y = mts->display_top->allocation.y - 2;
- w = mts->display_top->allocation.width + 4;
- h = mts->display_top->allocation.height + mts->display_main->allocation.height + 4;
-
- gtk_draw_shadow (widget->style, widget->window, GTK_STATE_NORMAL,
- GTK_SHADOW_IN, x, y, w, h);
-}
-
-
-/* When the main canvas scrolls, we scroll the other canvases. */
-static void
-e_meeting_time_selector_hadjustment_changed (GtkAdjustment *adjustment,
- EMeetingTimeSelector *mts)
-{
- GtkAdjustment *adj;
-
- adj = GTK_LAYOUT (mts->display_top)->hadjustment;
- if (adj->value != adjustment->value) {
- adj->value = adjustment->value;
- gtk_adjustment_value_changed (adj);
- }
-}
-
-
-static void
-e_meeting_time_selector_vadjustment_changed (GtkAdjustment *adjustment,
- EMeetingTimeSelector *mts)
-{
- GtkAdjustment *adj;
-
- adj = gtk_tree_view_get_vadjustment (GTK_TREE_VIEW (mts->list_view));
- if (adj->value != adjustment->value) {
- adj->value = adjustment->value;
- gtk_adjustment_value_changed (adj);
- }
-}
-
-void
-e_meeting_time_selector_get_meeting_time (EMeetingTimeSelector *mts,
- gint *start_year,
- gint *start_month,
- gint *start_day,
- gint *start_hour,
- gint *start_minute,
- gint *end_year,
- gint *end_month,
- gint *end_day,
- gint *end_hour,
- gint *end_minute)
-{
- *start_year = g_date_year (&mts->meeting_start_time.date);
- *start_month = g_date_month (&mts->meeting_start_time.date);
- *start_day = g_date_day (&mts->meeting_start_time.date);
- *start_hour = mts->meeting_start_time.hour;
- *start_minute = mts->meeting_start_time.minute;
-
- *end_year = g_date_year (&mts->meeting_end_time.date);
- *end_month = g_date_month (&mts->meeting_end_time.date);
- *end_day = g_date_day (&mts->meeting_end_time.date);
- *end_hour = mts->meeting_end_time.hour;
- *end_minute = mts->meeting_end_time.minute;
-}
-
-
-gboolean
-e_meeting_time_selector_set_meeting_time (EMeetingTimeSelector *mts,
- gint start_year,
- gint start_month,
- gint start_day,
- gint start_hour,
- gint start_minute,
- gint end_year,
- gint end_month,
- gint end_day,
- gint end_hour,
- gint end_minute)
-{
- g_return_val_if_fail (IS_E_MEETING_TIME_SELECTOR (mts), FALSE);
-
- /* Check the dates are valid. */
- if (!g_date_valid_dmy (start_day, start_month, start_year)
- || !g_date_valid_dmy (end_day, end_month, end_year)
- || start_hour < 0 || start_hour > 23
- || end_hour < 0 || end_hour > 23
- || start_minute < 0 || start_minute > 59
- || end_minute < 0 || end_minute > 59)
- return FALSE;
-
- g_date_set_dmy (&mts->meeting_start_time.date, start_day, start_month,
- start_year);
- mts->meeting_start_time.hour = start_hour;
- mts->meeting_start_time.minute = start_minute;
- g_date_set_dmy (&mts->meeting_end_time.date, end_day, end_month,
- end_year);
- mts->meeting_end_time.hour = end_hour;
- mts->meeting_end_time.minute = end_minute;
-
- mts->meeting_positions_valid = FALSE;
-
- gtk_widget_queue_draw (mts->display_top);
- gtk_widget_queue_draw (mts->display_main);
-
- /* Set the times in the EDateEdit widgets. */
- e_meeting_time_selector_update_start_date_edit (mts);
- e_meeting_time_selector_update_end_date_edit (mts);
-
- gtk_signal_emit (GTK_OBJECT (mts), mts_signals [CHANGED]);
-
- return TRUE;
-}
-
-void
-e_meeting_time_selector_set_all_day (EMeetingTimeSelector *mts,
- gboolean all_day)
-{
- EMeetingTime saved_time;
-
- mts->all_day = all_day;
-
- e_date_edit_set_show_time (E_DATE_EDIT (mts->start_date_edit),
- !all_day);
- e_date_edit_set_show_time (E_DATE_EDIT (mts->end_date_edit),
- !all_day);
-
- e_meeting_time_selector_save_position (mts, &saved_time);
- e_meeting_time_selector_recalc_grid (mts);
- e_meeting_time_selector_restore_position (mts, &saved_time);
-
- gtk_widget_queue_draw (mts->display_top);
- gtk_widget_queue_draw (mts->display_main);
- e_meeting_time_selector_update_date_popup_menus (mts);
-}
-
-
-void
-e_meeting_time_selector_set_working_hours_only (EMeetingTimeSelector *mts,
- gboolean working_hours_only)
-{
- EMeetingTime saved_time;
-
- g_return_if_fail (IS_E_MEETING_TIME_SELECTOR (mts));
-
- if (mts->working_hours_only == working_hours_only)
- return;
-
- mts->working_hours_only = working_hours_only;
-
- e_meeting_time_selector_save_position (mts, &saved_time);
- e_meeting_time_selector_recalc_grid (mts);
- e_meeting_time_selector_restore_position (mts, &saved_time);
-
- gtk_widget_queue_draw (mts->display_top);
- gtk_widget_queue_draw (mts->display_main);
- e_meeting_time_selector_update_date_popup_menus (mts);
-}
-
-
-void
-e_meeting_time_selector_set_working_hours (EMeetingTimeSelector *mts,
- gint day_start_hour,
- gint day_start_minute,
- gint day_end_hour,
- gint day_end_minute)
-{
- EMeetingTime saved_time;
-
- g_return_if_fail (IS_E_MEETING_TIME_SELECTOR (mts));
-
- if (mts->day_start_hour == day_start_hour
- && mts->day_start_minute == day_start_minute
- && mts->day_end_hour == day_end_hour
- && mts->day_end_minute == day_end_minute)
- return;
-
- mts->day_start_hour = day_start_hour;
- mts->day_start_minute = day_start_minute;
-
- /* Make sure we always show atleast an hour */
- if (day_start_hour * 60 + day_start_minute + 60 < day_end_hour * 60 + day_end_minute) {
- mts->day_end_hour = day_end_hour;
- mts->day_end_minute = day_end_minute;
- } else {
- mts->day_end_hour = day_start_hour + 1;
- mts->day_end_minute = day_start_minute;
- }
-
- e_meeting_time_selector_save_position (mts, &saved_time);
- e_meeting_time_selector_recalc_grid (mts);
- e_meeting_time_selector_restore_position (mts, &saved_time);
-
- gtk_widget_queue_draw (mts->display_top);
- gtk_widget_queue_draw (mts->display_main);
- e_meeting_time_selector_update_date_popup_menus (mts);
-}
-
-
-void
-e_meeting_time_selector_set_zoomed_out (EMeetingTimeSelector *mts,
- gboolean zoomed_out)
-{
- EMeetingTime saved_time;
-
- g_return_if_fail (IS_E_MEETING_TIME_SELECTOR (mts));
-
- if (mts->zoomed_out == zoomed_out)
- return;
-
- mts->zoomed_out = zoomed_out;
-
- e_meeting_time_selector_save_position (mts, &saved_time);
- e_meeting_time_selector_recalc_grid (mts);
- e_meeting_time_selector_restore_position (mts, &saved_time);
-
- gtk_widget_queue_draw (mts->display_top);
- gtk_widget_queue_draw (mts->display_main);
-}
-
-static void
-e_meeting_time_selector_refresh_cb (gpointer data)
-{
- EMeetingTimeSelector *mts = data;
-
- if (mts->display_top != NULL)
- gtk_widget_queue_draw (mts->display_top);
- if (mts->display_main != NULL)
- gtk_widget_queue_draw (mts->display_main);
-
- gtk_object_unref (GTK_OBJECT (mts));
-}
-
-static void
-e_meeting_time_selector_refresh_free_busy (EMeetingTimeSelector *mts, int row, gboolean all)
-{
- EMeetingTime start, end;
-
- start = mts->meeting_start_time;
- g_date_subtract_days (&start.date, E_MEETING_TIME_SELECTOR_FB_DAYS_BEFORE);
- start.hour = 0;
- start.minute = 0;
- end = mts->meeting_end_time;
- g_date_add_days (&end.date, E_MEETING_TIME_SELECTOR_FB_DAYS_AFTER);
- end.hour = 0;
- end.minute = 0;
-
- /* Ref ourselves in case we are called back after destruction,
- * we can do this because we will get a call back even after
- * an error */
- /* FIXME We should really have a mechanism to unqueue the
- * notification */
- if (all) {
- int i;
-
- for (i = 0; i < e_meeting_store_count_actual_attendees (mts->model); i++)
- gtk_object_ref (GTK_OBJECT (mts));
- } else {
- gtk_object_ref (GTK_OBJECT (mts));
- }
-
- if (all)
- e_meeting_store_refresh_all_busy_periods (mts->model, &start, &end,
- e_meeting_time_selector_refresh_cb, mts);
- else
- e_meeting_store_refresh_busy_periods (mts->model, row, &start, &end,
- e_meeting_time_selector_refresh_cb, mts);
-}
-
-EMeetingTimeSelectorAutopickOption
-e_meeting_time_selector_get_autopick_option (EMeetingTimeSelector *mts)
-{
- if (GTK_CHECK_MENU_ITEM (mts->autopick_all_item)->active)
- return E_MEETING_TIME_SELECTOR_ALL_PEOPLE_AND_RESOURCES;
- if (GTK_CHECK_MENU_ITEM (mts->autopick_all_people_one_resource_item)->active)
- return E_MEETING_TIME_SELECTOR_ALL_PEOPLE_AND_ONE_RESOURCE;
- if (GTK_CHECK_MENU_ITEM (mts->autopick_required_people_item)->active)
- return E_MEETING_TIME_SELECTOR_REQUIRED_PEOPLE;
- return E_MEETING_TIME_SELECTOR_REQUIRED_PEOPLE_AND_ONE_RESOURCE;
-}
-
-
-void
-e_meeting_time_selector_set_autopick_option (EMeetingTimeSelector *mts,
- EMeetingTimeSelectorAutopickOption autopick_option)
-{
- g_return_if_fail (IS_E_MEETING_TIME_SELECTOR (mts));
-
- switch (autopick_option) {
- case E_MEETING_TIME_SELECTOR_ALL_PEOPLE_AND_RESOURCES:
- gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (mts->autopick_all_item), TRUE);
- break;
- case E_MEETING_TIME_SELECTOR_ALL_PEOPLE_AND_ONE_RESOURCE:
- gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (mts->autopick_all_people_one_resource_item), TRUE);
- break;
- case E_MEETING_TIME_SELECTOR_REQUIRED_PEOPLE:
- gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (mts->autopick_required_people_item), TRUE);
- break;
- case E_MEETING_TIME_SELECTOR_REQUIRED_PEOPLE_AND_ONE_RESOURCE:
- gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (mts->autopick_required_people_one_resource_item), TRUE);
- break;
- }
-}
-#if 0
-void
-e_meeting_time_selector_attendee_set_send_meeting_to (EMeetingTimeSelector *mts,
- gint row,
- gboolean send_meeting_to)
-{
- EMeetingTimeSelectorAttendee *attendee;
-
- g_return_if_fail (IS_E_MEETING_TIME_SELECTOR (mts));
- g_return_if_fail (row >= 0);
- g_return_if_fail (row < mts->attendees->len);
-
- attendee = &g_array_index (mts->attendees,
- EMeetingTimeSelectorAttendee, row);
- attendee->send_meeting_to = send_meeting_to;
-}
-#endif
-
-/*
- * DEBUGGING ROUTINES - functions to output various bits of data.
- */
-
-#ifdef E_MEETING_TIME_SELECTOR_DEBUG
-
-/* Debugging function to dump information on all attendees. */
-void
-e_meeting_time_selector_dump (EMeetingTimeSelector *mts)
-{
- EMeetingTimeSelectorAttendee *attendee;
- EMeetingTimeSelectorPeriod *period;
- gint row, period_num;
- gchar buffer[128];
-
- g_return_if_fail (IS_E_MEETING_TIME_SELECTOR (mts));
-
- g_print ("\n\nAttendee Information:\n");
-
- for (row = 0; row < mts->attendees->len; row++) {
- attendee = &g_array_index (mts->attendees,
- EMeetingTimeSelectorAttendee, row);
- g_print ("Attendee: %s\n", attendee->name);
- g_print (" Longest Busy Period: %i days\n",
- attendee->longest_period_in_days);
-
- e_meeting_time_selector_attendee_ensure_periods_sorted (mts, attendee);
-#if 1
- for (period_num = 0;
- period_num < attendee->busy_periods->len;
- period_num++) {
- period = &g_array_index (attendee->busy_periods,
- EMeetingTimeSelectorPeriod,
- period_num);
-
- /* These are just for debugging so don't need i18n. */
- g_date_strftime (buffer, sizeof (buffer),
- "%A, %B %d, %Y", &period->start.date);
- g_print (" Start: %s %i:%02i\n", buffer,
- period->start.hour, period->start.minute);
-
- g_date_strftime (buffer, sizeof (buffer),
- "%A, %B %d, %Y", &period->end.date);
- g_print (" End : %s %i:%02i\n", buffer,
- period->end.hour, period->end.minute);
- }
-#endif
- }
-
-}
-
-
-/* This formats a EMeetingTimein a string and returns it.
- Note that it uses a static buffer. */
-gchar*
-e_meeting_time_selector_dump_time (EMeetingTime*mtstime)
-{
- static gchar buffer[128];
-
- gchar buffer2[128];
-
- /* This is just for debugging so doesn't need i18n. */
- g_date_strftime (buffer, sizeof (buffer), "%A, %B %d, %Y",
- &mtstime->date);
- sprintf (buffer2, " at %i:%02i", (gint) mtstime->hour,
- (gint) mtstime->minute);
- strcat (buffer, buffer2);
-
- return buffer;
-}
-
-
-/* This formats a GDate in a string and returns it.
- Note that it uses a static buffer. */
-gchar*
-e_meeting_time_selector_dump_date (GDate *date)
-{
- static gchar buffer[128];
-
- /* This is just for debugging so doesn't need i18n. */
- g_date_strftime (buffer, sizeof (buffer), "%A, %B %d, %Y", date);
- return buffer;
-}
-
-#endif /* E_MEETING_TIME_SELECTOR_DEBUG */
-
-
-static gboolean
-e_meeting_time_selector_on_invite_others_button_expose (GtkWidget *button,
- GdkEventExpose *event,
- EMeetingTimeSelector *mts)
-{
- gboolean click_to_add = TRUE;
-
- gtk_widget_set_sensitive (button, click_to_add);
- return FALSE;
-}
-
-static void
-e_meeting_time_selector_on_invite_others_button_clicked (GtkWidget *button,
- EMeetingTimeSelector *mts)
-{
- e_meeting_list_view_invite_others_dialog (mts->list_view);
-}
-
-
-static void
-e_meeting_time_selector_on_options_button_clicked (GtkWidget *button,
- EMeetingTimeSelector *mts)
-{
- gtk_menu_popup (GTK_MENU (mts->options_menu), NULL, NULL,
- e_meeting_time_selector_options_menu_position_callback,
- mts, 1, GDK_CURRENT_TIME);
-}
-
-
-static void
-e_meeting_time_selector_options_menu_position_callback (GtkMenu *menu,
- gint *x,
- gint *y,
- gboolean *push_in,
- gpointer user_data)
-{
- EMeetingTimeSelector *mts;
- GtkRequisition menu_requisition;
- gint max_x, max_y;
-
- mts = E_MEETING_TIME_SELECTOR (user_data);
-
- /* Calculate our preferred position. */
- gdk_window_get_origin (mts->options_button->window, x, y);
- *x += mts->options_button->allocation.x;
- *y += mts->options_button->allocation.y + mts->options_button->allocation.height / 2 - 2;
-
- /* Now make sure we are on the screen. */
- gtk_widget_size_request (mts->options_menu, &menu_requisition);
- max_x = MAX (0, gdk_screen_width () - menu_requisition.width);
- max_y = MAX (0, gdk_screen_height () - menu_requisition.height);
- *x = CLAMP (*x, 0, max_x);
- *y = CLAMP (*y, 0, max_y);
-}
-
-static void
-e_meeting_time_selector_on_update_free_busy (GtkWidget *button,
- EMeetingTimeSelector *mts)
-{
- /* Make sure the menu pops down, which doesn't happen by default if
- keyboard accelerators are used. */
- if (GTK_WIDGET_VISIBLE (mts->options_menu))
- gtk_menu_popdown (GTK_MENU (mts->options_menu));
-
- e_meeting_time_selector_refresh_free_busy (mts, 0, TRUE);
-}
-
-
-static void
-e_meeting_time_selector_on_autopick_button_clicked (GtkWidget *button,
- EMeetingTimeSelector *mts)
-{
- gtk_menu_popup (GTK_MENU (mts->autopick_menu), NULL, NULL,
- e_meeting_time_selector_autopick_menu_position_callback,
- mts, 1, GDK_CURRENT_TIME);
-}
-
-
-static void
-e_meeting_time_selector_autopick_menu_position_callback (GtkMenu *menu,
- gint *x,
- gint *y,
- gboolean *push_in,
- gpointer user_data)
-{
- EMeetingTimeSelector *mts;
- GtkRequisition menu_requisition;
- gint max_x, max_y;
-
- mts = E_MEETING_TIME_SELECTOR (user_data);
-
- /* Calculate our preferred position. */
- gdk_window_get_origin (mts->autopick_button->window, x, y);
- *x += mts->autopick_button->allocation.x;
- *y += mts->autopick_button->allocation.y + mts->autopick_button->allocation.height / 2 - 2;
-
- /* Now make sure we are on the screen. */
- gtk_widget_size_request (mts->autopick_menu, &menu_requisition);
- max_x = MAX (0, gdk_screen_width () - menu_requisition.width);
- max_y = MAX (0, gdk_screen_height () - menu_requisition.height);
- *x = CLAMP (*x, 0, max_x);
- *y = CLAMP (*y, 0, max_y);
-}
-
-
-static void
-e_meeting_time_selector_on_autopick_option_toggled (GtkWidget *button,
- EMeetingTimeSelector *mts)
-{
- /* Make sure the menu pops down, which doesn't happen by default if
- keyboard accelerators are used. */
- if (GTK_WIDGET_VISIBLE (mts->autopick_menu))
- gtk_menu_popdown (GTK_MENU (mts->autopick_menu));
-}
-
-
-static void
-e_meeting_time_selector_on_prev_button_clicked (GtkWidget *button,
- EMeetingTimeSelector *mts)
-{
- e_meeting_time_selector_autopick (mts, FALSE);
-}
-
-
-static void
-e_meeting_time_selector_on_next_button_clicked (GtkWidget *button,
- EMeetingTimeSelector *mts)
-{
- e_meeting_time_selector_autopick (mts, TRUE);
-}
-
-
-/* This tries to find the previous or next meeting time for which all
- attendees will be available. */
-static void
-e_meeting_time_selector_autopick (EMeetingTimeSelector *mts,
- gboolean forward)
-{
- EMeetingTime start_time, end_time, *resource_free;
- EMeetingAttendee *attendee;
- EMeetingFreeBusyPeriod *period;
- EMeetingTimeSelectorAutopickOption autopick_option;
- gint duration_days, duration_hours, duration_minutes, row;
- gboolean meeting_time_ok, skip_optional = FALSE;
- gboolean need_one_resource = FALSE, found_resource;
-
- /* Get the current meeting duration in days + hours + minutes. */
- e_meeting_time_selector_calculate_time_difference (&mts->meeting_start_time, &mts->meeting_end_time, &duration_days, &duration_hours, &duration_minutes);
-
- /* Find the first appropriate start time. */
- start_time = mts->meeting_start_time;
- if (forward)
- e_meeting_time_selector_find_nearest_interval (mts, &start_time, &end_time, duration_days, duration_hours, duration_minutes);
- else
- e_meeting_time_selector_find_nearest_interval_backward (mts, &start_time, &end_time, duration_days, duration_hours, duration_minutes);
-
- /* Determine if we can skip optional people and if we only need one
- resource based on the autopick option. */
- autopick_option = e_meeting_time_selector_get_autopick_option (mts);
- if (autopick_option == E_MEETING_TIME_SELECTOR_REQUIRED_PEOPLE
- || autopick_option == E_MEETING_TIME_SELECTOR_REQUIRED_PEOPLE_AND_ONE_RESOURCE)
- skip_optional = TRUE;
- if (autopick_option == E_MEETING_TIME_SELECTOR_ALL_PEOPLE_AND_ONE_RESOURCE
- || autopick_option == E_MEETING_TIME_SELECTOR_REQUIRED_PEOPLE_AND_ONE_RESOURCE)
- need_one_resource = TRUE;
-
- /* Keep moving forward or backward until we find a possible meeting
- time. */
- for (;;) {
- meeting_time_ok = TRUE;
- found_resource = FALSE;
- resource_free = NULL;
-
- /* Step through each attendee, checking if the meeting time
- intersects one of the attendees busy periods. */
- for (row = 0; row < e_meeting_store_count_actual_attendees (mts->model); row++) {
- attendee = e_meeting_store_find_attendee_at_row (mts->model, row);
-
- /* Skip optional people if they don't matter. */
- if (skip_optional && e_meeting_attendee_get_atype (attendee) == E_MEETING_ATTENDEE_OPTIONAL_PERSON)
- continue;
-
- period = e_meeting_time_selector_find_time_clash (mts, attendee, &start_time, &end_time);
-
- if (need_one_resource && e_meeting_attendee_get_atype (attendee) == E_MEETING_ATTENDEE_RESOURCE) {
- if (period) {
- /* We want to remember the closest
- prev/next time that one resource is
- available, in case we don't find any
- free resources. */
- if (forward) {
- if (!resource_free || e_meeting_time_compare_times (resource_free, &period->end) > 0)
- resource_free = &period->end;
- } else {
- if (!resource_free || e_meeting_time_compare_times (resource_free, &period->start) < 0)
- resource_free = &period->start;
- }
-
- } else {
- found_resource = TRUE;
- }
- } else if (period) {
- /* Skip the period which clashed. */
- if (forward) {
- start_time = period->end;
- } else {
- start_time = period->start;
- e_meeting_time_selector_adjust_time (&start_time, -duration_days, -duration_hours, -duration_minutes);
- }
- meeting_time_ok = FALSE;
- break;
- }
- }
-
- /* Check that we found one resource if necessary. If not, skip
- to the closest time that a resource is free. Note that if
- there are no resources, resource_free will never get set,
- so we assume the meeting time is OK. */
- if (meeting_time_ok && need_one_resource && !found_resource
- && resource_free) {
- if (forward) {
- start_time = *resource_free;
- } else {
- start_time = *resource_free;
- e_meeting_time_selector_adjust_time (&start_time, -duration_days, -duration_hours, -duration_minutes);
- }
- meeting_time_ok = FALSE;
- }
-
- if (meeting_time_ok) {
- mts->meeting_start_time = start_time;
- mts->meeting_end_time = end_time;
- mts->meeting_positions_valid = FALSE;
- gtk_widget_queue_draw (mts->display_top);
- gtk_widget_queue_draw (mts->display_main);
-
- /* Make sure the time is shown. */
- e_meeting_time_selector_ensure_meeting_time_shown (mts);
-
- /* Set the times in the EDateEdit widgets. */
- e_meeting_time_selector_update_start_date_edit (mts);
- e_meeting_time_selector_update_end_date_edit (mts);
-
- gtk_signal_emit (GTK_OBJECT (mts), mts_signals [CHANGED]);
-
- return;
- }
-
- /* Move forward to the next possible interval. */
- if (forward)
- e_meeting_time_selector_find_nearest_interval (mts, &start_time, &end_time, duration_days, duration_hours, duration_minutes);
- else
- e_meeting_time_selector_find_nearest_interval_backward (mts, &start_time, &end_time, duration_days, duration_hours, duration_minutes);
- }
-}
-
-
-static void
-e_meeting_time_selector_calculate_time_difference (EMeetingTime*start,
- EMeetingTime*end,
- gint *days,
- gint *hours,
- gint *minutes)
-{
- *days = g_date_julian (&end->date) - g_date_julian (&start->date);
- *hours = end->hour - start->hour;
- *minutes = end->minute - start->minute;
- if (*minutes < 0) {
- *minutes += 60;
- *hours = *hours - 1;
- }
- if (*hours < 0) {
- *hours += 24;
- *days = *days - 1;
- }
-}
-
-
-/* This moves the given time forward to the next suitable start of a meeting.
- If zoomed_out is set, this means every hour. If not every half-hour. */
-static void
-e_meeting_time_selector_find_nearest_interval (EMeetingTimeSelector *mts,
- EMeetingTime*start_time,
- EMeetingTime*end_time,
- gint days, gint hours, gint mins)
-{
- gint minutes_shown;
- gboolean set_to_start_of_working_day = FALSE;
-
- if (!mts->all_day) {
- if (mts->zoomed_out) {
- start_time->hour++;
- start_time->minute = 0;
- } else {
- start_time->minute += 30;
- start_time->minute -= start_time->minute % 30;
- }
- } else {
- g_date_add_days (&start_time->date, 1);
- start_time->hour = 0;
- start_time->minute = 0;
- }
- e_meeting_time_selector_fix_time_overflows (start_time);
-
- *end_time = *start_time;
- e_meeting_time_selector_adjust_time (end_time, days, hours, mins);
-
- /* Check if the interval is less than a day as seen in the display.
- If it isn't we don't worry about the working day. */
- if (!mts->working_hours_only || days > 0)
- return;
- minutes_shown = (mts->day_end_hour - mts->day_start_hour) * 60;
- minutes_shown += mts->day_end_minute - mts->day_start_minute;
- if (hours * 60 + mins > minutes_shown)
- return;
-
- /* If the meeting time finishes past the end of the working day, move
- onto the start of the next working day. If the meeting time starts
- before the working day, move it on as well. */
- if (start_time->hour > mts->day_end_hour
- || (start_time->hour == mts->day_end_hour
- && start_time->minute > mts->day_end_minute)
- || end_time->hour > mts->day_end_hour
- || (end_time->hour == mts->day_end_hour
- && end_time->minute > mts->day_end_minute)) {
- g_date_add_days (&start_time->date, 1);
- set_to_start_of_working_day = TRUE;
- } else if (start_time->hour < mts->day_start_hour
- || (start_time->hour == mts->day_start_hour
- && start_time->minute < mts->day_start_minute)) {
- set_to_start_of_working_day = TRUE;
- }
-
- if (set_to_start_of_working_day) {
- start_time->hour = mts->day_start_hour;
- start_time->minute = mts->day_start_minute;
-
- if (mts->zoomed_out) {
- if (start_time->minute > 0) {
- start_time->hour++;
- start_time->minute = 0;
- }
- } else {
- start_time->minute += 29;
- start_time->minute -= start_time->minute % 30;
- }
-
- e_meeting_time_selector_fix_time_overflows (start_time);
-
- *end_time = *start_time;
- e_meeting_time_selector_adjust_time (end_time, days, hours, mins);
- }
-}
-
-
-/* This moves the given time backward to the next suitable start of a meeting.
- If zoomed_out is set, this means every hour. If not every half-hour. */
-static void
-e_meeting_time_selector_find_nearest_interval_backward (EMeetingTimeSelector *mts,
- EMeetingTime*start_time,
- EMeetingTime*end_time,
- gint days, gint hours, gint mins)
-{
- gint new_hour, minutes_shown;
- gboolean set_to_end_of_working_day = FALSE;
-
- if (!mts->all_day) {
- new_hour = start_time->hour;
- if (mts->zoomed_out) {
- if (start_time->minute == 0)
- new_hour--;
- start_time->minute = 0;
- } else {
- if (start_time->minute == 0) {
- start_time->minute = 30;
- new_hour--;
- } else if (start_time->minute <= 30)
- start_time->minute = 0;
- else
- start_time->minute = 30;
- }
- if (new_hour < 0) {
- new_hour += 24;
- g_date_subtract_days (&start_time->date, 1);
- }
- start_time->hour = new_hour;
- } else {
- g_date_subtract_days (&start_time->date, 1);
- start_time->hour = 0;
- start_time->minute = 0;
- }
-
- *end_time = *start_time;
- e_meeting_time_selector_adjust_time (end_time, days, hours, mins);
-
- /* Check if the interval is less than a day as seen in the display.
- If it isn't we don't worry about the working day. */
- if (!mts->working_hours_only || days > 0)
- return;
- minutes_shown = (mts->day_end_hour - mts->day_start_hour) * 60;
- minutes_shown += mts->day_end_minute - mts->day_start_minute;
- if (hours * 60 + mins > minutes_shown)
- return;
-
- /* If the meeting time finishes past the end of the working day, move
- back to the end of the working day. If the meeting time starts
- before the working day, move it back to the end of the previous
- working day. */
- if (start_time->hour > mts->day_end_hour
- || (start_time->hour == mts->day_end_hour
- && start_time->minute > mts->day_end_minute)
- || end_time->hour > mts->day_end_hour
- || (end_time->hour == mts->day_end_hour
- && end_time->minute > mts->day_end_minute)) {
- set_to_end_of_working_day = TRUE;
- } else if (start_time->hour < mts->day_start_hour
- || (start_time->hour == mts->day_start_hour
- && start_time->minute < mts->day_start_minute)) {
- g_date_subtract_days (&end_time->date, 1);
- set_to_end_of_working_day = TRUE;
- }
-
- if (set_to_end_of_working_day) {
- end_time->hour = mts->day_end_hour;
- end_time->minute = mts->day_end_minute;
- *start_time = *end_time;
- e_meeting_time_selector_adjust_time (start_time, -days, -hours, -mins);
-
- if (mts->zoomed_out) {
- start_time->minute = 0;
- } else {
- start_time->minute -= start_time->minute % 30;
- }
-
- *end_time = *start_time;
- e_meeting_time_selector_adjust_time (end_time, days, hours, mins);
- }
-}
-
-
-/* This adds on the given days, hours & minutes to a EMeetingTimeSelectorTime.
- It is used to calculate the end of a period given a start & duration.
- Days, hours & minutes can be negative, to move backwards, but they should
- be within normal ranges, e.g. hours should be between -23 and 23. */
-static void
-e_meeting_time_selector_adjust_time (EMeetingTime*mtstime,
- gint days, gint hours, gint minutes)
-{
- gint new_hours, new_minutes;
-
- /* We have to handle negative values for hous and minutes here, since
- EMeetingTimeuses guint8s to store them. */
- new_minutes = mtstime->minute + minutes;
- if (new_minutes < 0) {
- new_minutes += 60;
- hours -= 1;
- }
-
- new_hours = mtstime->hour + hours;
- if (new_hours < 0) {
- new_hours += 24;
- days -= 1;
- }
-
- g_date_add_days (&mtstime->date, days);
- mtstime->hour = new_hours;
- mtstime->minute = new_minutes;
-
- e_meeting_time_selector_fix_time_overflows (mtstime);
-}
-
-
-/* This looks for any busy period of the given attendee which clashes with
- the start and end time. It uses a binary search. */
-static EMeetingFreeBusyPeriod *
-e_meeting_time_selector_find_time_clash (EMeetingTimeSelector *mts,
- EMeetingAttendee *attendee,
- EMeetingTime*start_time,
- EMeetingTime*end_time)
-{
- EMeetingFreeBusyPeriod *period;
- const GArray *busy_periods;
- gint period_num;
-
- busy_periods = e_meeting_attendee_get_busy_periods (attendee);
- period_num = e_meeting_attendee_find_first_busy_period (attendee, &start_time->date);
-
- if (period_num == -1)
- return NULL;
-
- /* Step forward through the busy periods until we find a clash or we
- go past the end_time. */
- while (period_num < busy_periods->len) {
- period = &g_array_index (busy_periods, EMeetingFreeBusyPeriod, period_num);
-
- /* If the period starts at or after the end time, there is no
- clash and we are finished. The busy periods are sorted by
- their start times, so all the rest will be later. */
- if (e_meeting_time_compare_times (&period->start, end_time) >= 0)
- return NULL;
-
- /* If the period ends after the start time, we have found a
- clash. From the above test we already know the busy period
- isn't completely after the meeting time. */
- if (e_meeting_time_compare_times (&period->end, start_time) > 0)
- return period;
-
- period_num++;
- }
-
- return NULL;
-}
-
-static void
-e_meeting_time_selector_on_zoomed_out_toggled (GtkWidget *menuitem,
- EMeetingTimeSelector *mts)
-{
- /* Make sure the menu pops down, which doesn't happen by default if
- keyboard accelerators are used. */
- if (GTK_WIDGET_VISIBLE (mts->options_menu))
- gtk_menu_popdown (GTK_MENU (mts->options_menu));
-
- e_meeting_time_selector_set_zoomed_out (mts, GTK_CHECK_MENU_ITEM (menuitem)->active);
- e_meeting_time_selector_ensure_meeting_time_shown (mts);
-}
-
-
-static void
-e_meeting_time_selector_on_working_hours_toggled (GtkWidget *menuitem,
- EMeetingTimeSelector *mts)
-{
- /* Make sure the menu pops down, which doesn't happen by default if
- keyboard accelerators are used. */
- if (GTK_WIDGET_VISIBLE (mts->options_menu))
- gtk_menu_popdown (GTK_MENU (mts->options_menu));
-
- e_meeting_time_selector_set_working_hours_only (mts, GTK_CHECK_MENU_ITEM (menuitem)->active);
- e_meeting_time_selector_ensure_meeting_time_shown (mts);
-}
-
-
-/* This recalculates day_width, first_hour_shown and last_hour_shown. */
-static void
-e_meeting_time_selector_recalc_grid (EMeetingTimeSelector *mts)
-{
- if (mts->working_hours_only) {
- mts->first_hour_shown = mts->day_start_hour;
- mts->last_hour_shown = mts->day_end_hour;
- if (mts->day_end_minute != 0)
- mts->last_hour_shown += 1;
- } else {
- mts->first_hour_shown = 0;
- mts->last_hour_shown = 24;
- }
-
- /* In the brief view we use the nearest hours divisible by 3. */
- if (mts->zoomed_out) {
- mts->first_hour_shown -= mts->first_hour_shown % 3;
- mts->last_hour_shown += 2;
- mts->last_hour_shown -= mts->last_hour_shown % 3;
- }
-
- mts->day_width = mts->col_width * (mts->last_hour_shown - mts->first_hour_shown);
- if (mts->zoomed_out)
- mts->day_width /= 3;
-
- /* Add one pixel for the extra vertical grid line. */
- mts->day_width++;
-
- gnome_canvas_set_scroll_region (GNOME_CANVAS (mts->display_top),
- 0, 0,
- mts->day_width * E_MEETING_TIME_SELECTOR_DAYS_SHOWN,
- mts->row_height * 3);
- e_meeting_time_selector_update_main_canvas_scroll_region (mts);
-
- e_meeting_time_selector_recalc_date_format (mts);
- mts->meeting_positions_valid = FALSE;
-}
-
-
-/* This saves the first visible time in the given EMeetingTimeSelectorTime. */
-static void
-e_meeting_time_selector_save_position (EMeetingTimeSelector *mts,
- EMeetingTime*mtstime)
-{
- gint scroll_x, scroll_y;
-
- gnome_canvas_get_scroll_offsets (GNOME_CANVAS (mts->display_main),
- &scroll_x, &scroll_y);
- e_meeting_time_selector_calculate_time (mts, scroll_x, mtstime);
-}
-
-
-/* This restores a saved position. */
-static void
-e_meeting_time_selector_restore_position (EMeetingTimeSelector *mts,
- EMeetingTime*mtstime)
-{
- gint scroll_x, scroll_y, new_scroll_x;
-
- new_scroll_x = e_meeting_time_selector_calculate_time_position (mts,
- mtstime);
- gnome_canvas_get_scroll_offsets (GNOME_CANVAS (mts->display_main),
- &scroll_x, &scroll_y);
- gnome_canvas_scroll_to (GNOME_CANVAS (mts->display_main),
- new_scroll_x, scroll_y);
-}
-
-
-/* This returns the x pixel coords of the meeting time in the entire scroll
- region. It recalculates them if they have been marked as invalid.
- If it returns FALSE then no meeting time is set or the meeting time is
- not visible in the current scroll area. */
-gboolean
-e_meeting_time_selector_get_meeting_time_positions (EMeetingTimeSelector *mts,
- gint *start_x,
- gint *end_x)
-{
- if (mts->meeting_positions_valid) {
- if (mts->meeting_positions_in_scroll_area) {
- *start_x = mts->meeting_start_x;
- *end_x = mts->meeting_end_x;
- return TRUE;
- } else {
- return FALSE;
- }
- }
-
- mts->meeting_positions_valid = TRUE;
-
- /* Check if the days aren't in our current range. */
- if (g_date_compare (&mts->meeting_start_time.date, &mts->last_date_shown) > 0
- || g_date_compare (&mts->meeting_end_time.date, &mts->first_date_shown) < 0) {
- mts->meeting_positions_in_scroll_area = FALSE;
- return FALSE;
- }
-
- mts->meeting_positions_in_scroll_area = TRUE;
- *start_x = mts->meeting_start_x = e_meeting_time_selector_calculate_time_position (mts, &mts->meeting_start_time);
- *end_x = mts->meeting_end_x = e_meeting_time_selector_calculate_time_position (mts, &mts->meeting_end_time);
-
- return TRUE;
-}
-
-
-/* This recalculates the date format to used, by computing the width of the
- longest date strings in the widget's font and seeing if they fit. */
-static void
-e_meeting_time_selector_recalc_date_format (EMeetingTimeSelector *mts)
-{
- /* An array of dates, one for each month in the year 2000. They must
- all be Sundays. */
- static const int days[12] = { 23, 20, 19, 23, 21, 18,
- 23, 20, 17, 22, 19, 24 };
- GDate date;
- gint max_date_width, longest_weekday_width, longest_month_width, width;
- gint day, longest_weekday, month, longest_month;
- gchar buffer[128];
- PangoFontDescription *font_desc;
- PangoContext *pango_context;
- PangoLayout *layout;
-
- /* Set up Pango prerequisites */
- font_desc = gtk_widget_get_style (GTK_WIDGET (mts))->font_desc;
- pango_context = gtk_widget_get_pango_context (GTK_WIDGET (mts));
- layout = pango_layout_new (pango_context);
-
- /* Calculate the maximum date width we can fit into the display. */
- max_date_width = mts->day_width - 2;
-
- /* Find the biggest full weekday name. We start on a particular
- Monday and go through seven days. */
- g_date_clear (&date, 1);
- g_date_set_dmy (&date, 3, 1, 2000); /* Monday 3rd Jan 2000. */
- longest_weekday_width = 0;
- longest_weekday = G_DATE_MONDAY;
- for (day = G_DATE_MONDAY; day <= G_DATE_SUNDAY; day++) {
- g_date_strftime (buffer, sizeof (buffer), "%A", &date);
- pango_layout_set_text (layout, buffer, -1);
- pango_layout_get_pixel_size (layout, &width, NULL);
- if (width > longest_weekday_width) {
- longest_weekday = day;
- longest_weekday_width = width;
- }
- g_date_add_days (&date, 1);
- }
-
- /* Now find the biggest month name. */
- longest_month_width = 0;
- longest_month = G_DATE_JANUARY;
- for (month = G_DATE_JANUARY; month <= G_DATE_DECEMBER; month++) {
- g_date_set_month (&date, month);
- g_date_strftime (buffer, sizeof (buffer), "%B", &date);
- pango_layout_set_text (layout, buffer, -1);
- pango_layout_get_pixel_size (layout, &width, NULL);
- if (width > longest_month_width) {
- longest_month = month;
- longest_month_width = width;
- }
- }
-
- /* See if we can use the full date. We want to use a date with a
- month day > 20 and also the longest weekday. We use a
- pre-calculated array of days for each month and add on the
- weekday (which is 1 (Mon) to 7 (Sun). */
- g_date_set_dmy (&date, days[longest_month - 1] + longest_weekday,
- longest_month, 2000);
- /* This is a strftime() format string %A = full weekday name,
- %B = full month name, %d = month day, %Y = full year. */
- g_date_strftime (buffer, sizeof (buffer), _("%A, %B %d, %Y"), &date);
-
-#if 0
- g_print ("longest_month: %i longest_weekday: %i date: %s\n",
- longest_month, longest_weekday, buffer);
-#endif
-
- pango_layout_set_text (layout, buffer, -1);
- pango_layout_get_pixel_size (layout, &width, NULL);
- if (width < max_date_width) {
- mts->date_format = E_MEETING_TIME_SELECTOR_DATE_FULL;
- return;
- }
-
- /* Now try it with abbreviated weekday names. */
- longest_weekday_width = 0;
- longest_weekday = G_DATE_MONDAY;
- g_date_set_dmy (&date, 3, 1, 2000); /* Monday 3rd Jan 2000. */
- for (day = G_DATE_MONDAY; day <= G_DATE_SUNDAY; day++) {
- g_date_strftime (buffer, sizeof (buffer), "%a", &date);
- pango_layout_set_text (layout, buffer, -1);
- pango_layout_get_pixel_size (layout, &width, NULL);
- if (width > longest_weekday_width) {
- longest_weekday = day;
- longest_weekday_width = width;
- }
- g_date_add_days (&date, 1);
- }
-
- g_date_set_dmy (&date, days[longest_month - 1] + longest_weekday,
- longest_month, 2000);
- /* This is a strftime() format string %a = abbreviated weekday name,
- %m = month number, %d = month day, %Y = full year. */
- g_date_strftime (buffer, sizeof (buffer), _("%a %m/%d/%Y"), &date);
-
-#if 0
- g_print ("longest_month: %i longest_weekday: %i date: %s\n",
- longest_month, longest_weekday, buffer);
-#endif
-
- pango_layout_set_text (layout, buffer, -1);
- pango_layout_get_pixel_size (layout, &width, NULL);
- if (width < max_date_width)
- mts->date_format = E_MEETING_TIME_SELECTOR_DATE_ABBREVIATED_DAY;
- else
- mts->date_format = E_MEETING_TIME_SELECTOR_DATE_SHORT;
-
- g_object_unref (layout);
-}
-
-
-/* Turn off the background of the canvas windows. This reduces flicker
- considerably when scrolling. (Why isn't it in GnomeCanvas?). */
-static void
-e_meeting_time_selector_on_canvas_realized (GtkWidget *widget,
- EMeetingTimeSelector *mts)
-{
- gdk_window_set_back_pixmap (GTK_LAYOUT (widget)->bin_window,
- NULL, FALSE);
-}
-
-
-/* This is called when the meeting start time GnomeDateEdit is changed,
- either via the "date_changed". "time_changed" or "activate" signals on one
- of the GtkEntry widgets. So don't use the widget parameter since it may be
- one of the child GtkEntry widgets. */
-static void
-e_meeting_time_selector_on_start_time_changed (GtkWidget *widget,
- EMeetingTimeSelector *mts)
-{
- gint duration_days, duration_hours, duration_minutes;
- EMeetingTime mtstime;
- gint hour = 0, minute = 0;
- time_t newtime;
-
- /* Date */
- newtime = e_date_edit_get_time (E_DATE_EDIT (mts->start_date_edit));
- g_date_clear (&mtstime.date, 1);
- g_date_set_time (&mtstime.date, newtime);
-
- /* Time */
- e_date_edit_get_time_of_day (E_DATE_EDIT (mts->start_date_edit), &hour, &minute);
- mtstime.hour = hour;
- mtstime.minute = minute;
-
- /* If the time hasn't changed, just return. */
- if (e_meeting_time_compare_times (&mtstime, &mts->meeting_start_time) == 0)
- return;
-
- /* Calculate the current meeting duration. */
- e_meeting_time_selector_calculate_time_difference (&mts->meeting_start_time, &mts->meeting_end_time, &duration_days, &duration_hours, &duration_minutes);
-
- /* Set the new start time. */
- mts->meeting_start_time = mtstime;
-
- /* Update the end time so the meeting duration stays the same. */
- mts->meeting_end_time = mts->meeting_start_time;
- e_meeting_time_selector_adjust_time (&mts->meeting_end_time, duration_days, duration_hours, duration_minutes);
- e_meeting_time_selector_update_end_date_edit (mts);
-
- mts->meeting_positions_valid = FALSE;
- e_meeting_time_selector_ensure_meeting_time_shown (mts);
- gtk_widget_queue_draw (mts->display_top);
- gtk_widget_queue_draw (mts->display_main);
-
- gtk_signal_emit (GTK_OBJECT (mts), mts_signals [CHANGED]);
-}
-
-
-/* This is called when the meeting end time GnomeDateEdit is changed,
- either via the "date_changed", "time_changed" or "activate" signals on one
- of the GtkEntry widgets. So don't use the widget parameter since it may be
- one of the child GtkEntry widgets. */
-static void
-e_meeting_time_selector_on_end_time_changed (GtkWidget *widget,
- EMeetingTimeSelector *mts)
-{
- EMeetingTime mtstime;
- gint hour = 0, minute = 0;
- time_t newtime;
-
- /* Date */
- newtime = e_date_edit_get_time (E_DATE_EDIT (mts->end_date_edit));
- g_date_clear (&mtstime.date, 1);
- g_date_set_time (&mtstime.date, newtime);
- if (mts->all_day)
- g_date_add_days (&mtstime.date, 1);
-
- /* Time */
- e_date_edit_get_time_of_day (E_DATE_EDIT (mts->end_date_edit), &hour, &minute);
- mtstime.hour = hour;
- mtstime.minute = minute;
-
- /* If the time hasn't changed, just return. */
- if (e_meeting_time_compare_times (&mtstime, &mts->meeting_end_time) == 0)
- return;
-
- /* Set the new end time. */
- mts->meeting_end_time = mtstime;
-
- /* If the start time is after the end time, set it to the same time. */
- if (e_meeting_time_compare_times (&mtstime, &mts->meeting_start_time) <= 0) {
- /* We set it first, before updating the widget, so the signal
- handler will just return. */
- mts->meeting_start_time = mtstime;
- if (mts->all_day)
- g_date_subtract_days (&mts->meeting_start_time.date, 1);
- e_meeting_time_selector_update_start_date_edit (mts);
- }
-
- mts->meeting_positions_valid = FALSE;
- e_meeting_time_selector_ensure_meeting_time_shown (mts);
- gtk_widget_queue_draw (mts->display_top);
- gtk_widget_queue_draw (mts->display_main);
-
- gtk_signal_emit (GTK_OBJECT (mts), mts_signals [CHANGED]);
-}
-
-
-/* This updates the ranges shown in the GnomeDateEdit popup menus, according
- to working_hours_only etc. */
-static void
-e_meeting_time_selector_update_date_popup_menus (EMeetingTimeSelector *mts)
-{
- EDateEdit *start_edit, *end_edit;
- gint low_hour, high_hour;
-
- start_edit = E_DATE_EDIT (mts->start_date_edit);
- end_edit = E_DATE_EDIT (mts->end_date_edit);
-
- if (mts->working_hours_only) {
- low_hour = mts->day_start_hour;
- high_hour = mts->day_end_hour;
- } else {
- low_hour = 0;
- high_hour = 23;
- }
-
- e_date_edit_set_time_popup_range (start_edit, low_hour, high_hour);
- e_date_edit_set_time_popup_range (end_edit, low_hour, high_hour);
-}
-
-
-static void
-e_meeting_time_selector_on_canvas_size_allocate (GtkWidget *widget,
- GtkAllocation *allocation,
- EMeetingTimeSelector *mts)
-{
- e_meeting_time_selector_update_main_canvas_scroll_region (mts);
-
- e_meeting_time_selector_ensure_meeting_time_shown (mts);
-}
-
-/* This updates the canvas scroll regions according to the number of attendees.
- If the total height needed is less than the height of the canvas, we must
- use the height of the canvas, or it causes problems. */
-static void
-e_meeting_time_selector_update_main_canvas_scroll_region (EMeetingTimeSelector *mts)
-{
- gint height, canvas_height;
-
- height = mts->row_height * (e_meeting_store_count_actual_attendees (mts->model) + 2);
- canvas_height = GTK_WIDGET (mts->display_main)->allocation.height;
-
- height = MAX (height, canvas_height);
-
- gnome_canvas_set_scroll_region (GNOME_CANVAS (mts->display_main),
- 0, 0,
- mts->day_width * E_MEETING_TIME_SELECTOR_DAYS_SHOWN,
- height);
-}
-
-
-/* This changes the meeting time based on the given x coordinate and whether
- we are dragging the start or end bar. It returns the new position, which
- will be swapped if the start bar is dragged past the end bar or vice versa.
- It make sure the meeting time is never dragged outside the visible canvas
- area. */
-void
-e_meeting_time_selector_drag_meeting_time (EMeetingTimeSelector *mts,
- gint x)
-{
- EMeetingTime first_time, last_time, drag_time, *time_to_set;
- gint scroll_x, scroll_y, canvas_width;
- gboolean set_both_times = FALSE;
-
- /* Get the x coords of visible part of the canvas. */
- gnome_canvas_get_scroll_offsets (GNOME_CANVAS (mts->display_main),
- &scroll_x, &scroll_y);
- canvas_width = mts->display_main->allocation.width;
-
- /* Save the x coordinate for the timeout handler. */
- mts->last_drag_x = (x < scroll_x) ? x - scroll_x
- : x - scroll_x - canvas_width + 1;
-
- /* Check if the mouse is off the edge of the canvas. */
- if (x < scroll_x || x > scroll_x + canvas_width) {
- /* If we haven't added a timeout function, add one. */
- if (mts->auto_scroll_timeout_id == 0) {
- mts->auto_scroll_timeout_id = g_timeout_add (60, e_meeting_time_selector_timeout_handler, mts);
- mts->scroll_count = 0;
-
- /* Call the handler to start scrolling now. */
- e_meeting_time_selector_timeout_handler (mts);
- return;
- }
- } else {
- e_meeting_time_selector_remove_timeout (mts);
- }
-
- /* Calculate the minimum & maximum times we can use, based on the
- scroll offsets and whether zoomed_out is set. */
- e_meeting_time_selector_calculate_time (mts, scroll_x, &first_time);
- e_meeting_time_selector_calculate_time (mts, scroll_x + canvas_width - 1,
- &last_time);
- if (!mts->all_day) {
- if (mts->zoomed_out) {
- if (first_time.minute > 30)
- first_time.hour++;
- first_time.minute = 0;
- last_time.minute = 0;
- } else {
- first_time.minute += 15;
- first_time.minute -= first_time.minute % 30;
- last_time.minute -= last_time.minute % 30;
- }
- } else {
- if (first_time.hour > 0 || first_time.minute > 0)
- g_date_add_days (&first_time.date, 1);
- first_time.hour = 0;
- first_time.minute = 0;
- last_time.hour = 0;
- last_time.minute = 0;
- }
- e_meeting_time_selector_fix_time_overflows (&first_time);
- e_meeting_time_selector_fix_time_overflows (&last_time);
-
- /* Calculate the time from x coordinate. */
- e_meeting_time_selector_calculate_time (mts, x, &drag_time);
-
- /* Calculate the nearest half-hour or hour, depending on whether
- zoomed_out is set. */
- if (!mts->all_day) {
- if (mts->zoomed_out) {
- if (drag_time.minute > 30)
- drag_time.hour++;
- drag_time.minute = 0;
- } else {
- drag_time.minute += 15;
- drag_time.minute -= drag_time.minute % 30;
- }
- } else {
- if (drag_time.hour > 12)
- g_date_add_days (&drag_time.date, 1);
- drag_time.hour = 0;
- drag_time.minute = 0;
- }
- e_meeting_time_selector_fix_time_overflows (&drag_time);
-
- /* Now make sure we are between first_time & last_time. */
- if (e_meeting_time_compare_times (&drag_time, &first_time) < 0)
- drag_time = first_time;
- if (e_meeting_time_compare_times (&drag_time, &last_time) > 0)
- drag_time = last_time;
-
- /* Set the meeting start or end time to drag_time. */
- if (mts->dragging_position == E_MEETING_TIME_SELECTOR_POS_START)
- time_to_set = &mts->meeting_start_time;
- else
- time_to_set = &mts->meeting_end_time;
-
- /* If the time is unchanged, just return. */
- if (e_meeting_time_compare_times (time_to_set, &drag_time) == 0)
- return;
-
- /* Don't let an empty occur for all day events */
- if (mts->all_day
- && mts->dragging_position == E_MEETING_TIME_SELECTOR_POS_START
- && e_meeting_time_compare_times (&mts->meeting_end_time, &drag_time) == 0)
- return;
- else if (mts->all_day
- && mts->dragging_position == E_MEETING_TIME_SELECTOR_POS_END
- && e_meeting_time_compare_times (&mts->meeting_start_time, &drag_time) == 0)
- return;
-
- *time_to_set = drag_time;
-
- /* Check if the start time and end time need to be switched. */
- if (e_meeting_time_compare_times (&mts->meeting_start_time,
- &mts->meeting_end_time) > 0) {
- drag_time = mts->meeting_start_time;
- mts->meeting_start_time = mts->meeting_end_time;
- mts->meeting_end_time = drag_time;
-
- if (mts->dragging_position == E_MEETING_TIME_SELECTOR_POS_START)
- mts->dragging_position = E_MEETING_TIME_SELECTOR_POS_END;
- else
- mts->dragging_position = E_MEETING_TIME_SELECTOR_POS_START;
-
- set_both_times = TRUE;
- }
-
-
- /* Mark the calculated positions as invalid. */
- mts->meeting_positions_valid = FALSE;
-
- /* Redraw the canvases. */
- gtk_widget_queue_draw (mts->display_top);
- gtk_widget_queue_draw (mts->display_main);
-
- /* Set the times in the GnomeDateEdit widgets. */
- if (set_both_times
- || mts->dragging_position == E_MEETING_TIME_SELECTOR_POS_START)
- e_meeting_time_selector_update_start_date_edit (mts);
-
- if (set_both_times
- || mts->dragging_position == E_MEETING_TIME_SELECTOR_POS_END)
- e_meeting_time_selector_update_end_date_edit (mts);
-
- if (set_both_times
- || mts->dragging_position == E_MEETING_TIME_SELECTOR_POS_END
- || mts->dragging_position == E_MEETING_TIME_SELECTOR_POS_START)
- gtk_signal_emit (GTK_OBJECT (mts), mts_signals [CHANGED]);
-}
-
-
-/* This is the timeout function which handles auto-scrolling when the user is
- dragging one of the meeting time vertical bars outside the left or right
- edge of the canvas. */
-static gboolean
-e_meeting_time_selector_timeout_handler (gpointer data)
-{
- EMeetingTimeSelector *mts;
- EMeetingTime drag_time, *time_to_set;
- gint scroll_x, max_scroll_x, scroll_y, canvas_width;
- gint scroll_speed, scroll_offset;
- gboolean set_both_times = FALSE;
-
- mts = E_MEETING_TIME_SELECTOR (data);
-
- GDK_THREADS_ENTER ();
-
- /* Return if we don't need to scroll yet. */
- if (mts->scroll_count-- > 0) {
- GDK_THREADS_LEAVE ();
- return TRUE;
- }
-
- /* Get the x coords of visible part of the canvas. */
- gnome_canvas_get_scroll_offsets (GNOME_CANVAS (mts->display_main),
- &scroll_x, &scroll_y);
- canvas_width = mts->display_main->allocation.width;
-
- /* Calculate the scroll delay, between 0 and MAX_SCROLL_SPEED. */
- scroll_speed = abs (mts->last_drag_x / E_MEETING_TIME_SELECTOR_SCROLL_INCREMENT_WIDTH);
- scroll_speed = MIN (scroll_speed,
- E_MEETING_TIME_SELECTOR_MAX_SCROLL_SPEED);
-
- /* Reset the scroll count. */
- mts->scroll_count = E_MEETING_TIME_SELECTOR_MAX_SCROLL_SPEED - scroll_speed;
-
- /* Calculate how much we need to scroll. */
- if (mts->last_drag_x >= 0)
- scroll_offset = mts->col_width;
- else
- scroll_offset = -mts->col_width;
-
- scroll_x += scroll_offset;
- max_scroll_x = (mts->day_width * E_MEETING_TIME_SELECTOR_DAYS_SHOWN)
- - canvas_width;
- scroll_x = CLAMP (scroll_x, 0, max_scroll_x);
-
- /* Calculate the minimum or maximum visible time in the canvas, which
- we will now set the dragged time to. */
- if (scroll_offset > 0) {
- e_meeting_time_selector_calculate_time (mts,
- scroll_x + canvas_width - 1,
- &drag_time);
- if (!mts->all_day) {
- if (mts->zoomed_out) {
- drag_time.minute = 0;
- } else {
- drag_time.minute -= drag_time.minute % 30;
- }
- } else {
- drag_time.hour = 0;
- drag_time.minute = 0;
- }
- } else {
- e_meeting_time_selector_calculate_time (mts, scroll_x,
- &drag_time);
- if (!mts->all_day) {
- if (mts->zoomed_out) {
- if (drag_time.minute > 30)
- drag_time.hour++;
- drag_time.minute = 0;
- } else {
- drag_time.minute += 15;
- drag_time.minute -= drag_time.minute % 30;
- }
- } else {
- if (drag_time.hour > 0 || drag_time.minute > 0)
- g_date_add_days (&drag_time.date, 1);
- drag_time.hour = 0;
- drag_time.minute = 0;
- }
- }
- e_meeting_time_selector_fix_time_overflows (&drag_time);
-
- /* Set the meeting start or end time to drag_time. */
- if (mts->dragging_position == E_MEETING_TIME_SELECTOR_POS_START)
- time_to_set = &mts->meeting_start_time;
- else
- time_to_set = &mts->meeting_end_time;
-
- /* If the time is unchanged, just return. */
- if (e_meeting_time_compare_times (time_to_set, &drag_time) == 0) {
- GDK_THREADS_LEAVE ();
- goto scroll;
- }
-
- /* Don't let an empty occur for all day events */
- if (mts->all_day
- && mts->dragging_position == E_MEETING_TIME_SELECTOR_POS_START
- && e_meeting_time_compare_times (&mts->meeting_end_time, &drag_time) == 0)
- goto scroll;
- else if (mts->all_day
- && mts->dragging_position == E_MEETING_TIME_SELECTOR_POS_END
- && e_meeting_time_compare_times (&mts->meeting_start_time, &drag_time) == 0)
- goto scroll;
-
- *time_to_set = drag_time;
-
- /* Check if the start time and end time need to be switched. */
- if (e_meeting_time_compare_times (&mts->meeting_start_time, &mts->meeting_end_time) > 0) {
- drag_time = mts->meeting_start_time;
- mts->meeting_start_time = mts->meeting_end_time;
- mts->meeting_end_time = drag_time;
-
- if (mts->dragging_position == E_MEETING_TIME_SELECTOR_POS_START)
- mts->dragging_position = E_MEETING_TIME_SELECTOR_POS_END;
- else
- mts->dragging_position = E_MEETING_TIME_SELECTOR_POS_START;
-
- set_both_times = TRUE;
- }
-
- /* Mark the calculated positions as invalid. */
- mts->meeting_positions_valid = FALSE;
-
- /* Set the times in the GnomeDateEdit widgets. */
- if (set_both_times
- || mts->dragging_position == E_MEETING_TIME_SELECTOR_POS_START)
- e_meeting_time_selector_update_start_date_edit (mts);
-
- if (set_both_times
- || mts->dragging_position == E_MEETING_TIME_SELECTOR_POS_END)
- e_meeting_time_selector_update_end_date_edit (mts);
-
- if (set_both_times
- || mts->dragging_position == E_MEETING_TIME_SELECTOR_POS_END
- || mts->dragging_position == E_MEETING_TIME_SELECTOR_POS_START)
- gtk_signal_emit (GTK_OBJECT (mts), mts_signals [CHANGED]);
-
- scroll:
- /* Redraw the canvases. We freeze and thaw the layouts so that they
- get redrawn completely. Otherwise the pixels get scrolled left or
- right which is not good for us (since our vertical bars have been
- moved) and causes flicker. */
- gtk_layout_freeze (GTK_LAYOUT (mts->display_main));
- gtk_layout_freeze (GTK_LAYOUT (mts->display_top));
- gnome_canvas_scroll_to (GNOME_CANVAS (mts->display_main),
- scroll_x, scroll_y);
- gnome_canvas_scroll_to (GNOME_CANVAS (mts->display_top),
- scroll_x, scroll_y);
- gtk_layout_thaw (GTK_LAYOUT (mts->display_main));
- gtk_layout_thaw (GTK_LAYOUT (mts->display_top));
-
- GDK_THREADS_LEAVE ();
- return TRUE;
-}
-
-
-/* This removes our auto-scroll timeout function, if we have one installed. */
-void
-e_meeting_time_selector_remove_timeout (EMeetingTimeSelector *mts)
-{
- if (mts->auto_scroll_timeout_id) {
- g_source_remove (mts->auto_scroll_timeout_id);
- mts->auto_scroll_timeout_id = 0;
- }
-}
-
-
-/* This updates the GnomeDateEdit widget displaying the meeting start time. */
-static void
-e_meeting_time_selector_update_start_date_edit (EMeetingTimeSelector *mts)
-{
- e_date_edit_set_date_and_time_of_day (E_DATE_EDIT (mts->start_date_edit),
- g_date_year (&mts->meeting_start_time.date),
- g_date_month (&mts->meeting_start_time.date),
- g_date_day (&mts->meeting_start_time.date),
- mts->meeting_start_time.hour,
- mts->meeting_start_time.minute);
-}
-
-
-/* This updates the GnomeDateEdit widget displaying the meeting end time. */
-static void
-e_meeting_time_selector_update_end_date_edit (EMeetingTimeSelector *mts)
-{
- GDate date;
-
- date = mts->meeting_end_time.date;
- if (mts->all_day)
- g_date_subtract_days (&date, 1);
-
- e_date_edit_set_date_and_time_of_day (E_DATE_EDIT (mts->end_date_edit),
- g_date_year (&date),
- g_date_month (&date),
- g_date_day (&date),
- mts->meeting_end_time.hour,
- mts->meeting_end_time.minute);
-}
-
-
-/* This ensures that the meeting time is shown on screen, by scrolling the
- canvas and possibly by changing the range of dates shown in the canvas. */
-static void
-e_meeting_time_selector_ensure_meeting_time_shown (EMeetingTimeSelector *mts)
-{
- gint start_x, end_x, scroll_x, scroll_y, canvas_width;
- gint new_scroll_x;
- gboolean fits_in_canvas;
-
- /* Check if we need to change the range of dates shown. */
- if (g_date_compare (&mts->meeting_start_time.date,
- &mts->first_date_shown) < 0
- || g_date_compare (&mts->meeting_end_time.date,
- &mts->last_date_shown) > 0) {
- e_meeting_time_selector_update_dates_shown (mts);
- gtk_widget_queue_draw (mts->display_top);
- gtk_widget_queue_draw (mts->display_main);
- }
-
- /* If all of the meeting time is visible, just return. */
- e_meeting_time_selector_get_meeting_time_positions (mts, &start_x,
- &end_x);
- gnome_canvas_get_scroll_offsets (GNOME_CANVAS (mts->display_main),
- &scroll_x, &scroll_y);
- canvas_width = mts->display_main->allocation.width;
- if (start_x > scroll_x && end_x <= scroll_x + canvas_width)
- return;
-
- fits_in_canvas = end_x - start_x < canvas_width ? TRUE : FALSE;
-
- /* If the meeting is not entirely visible, either center it if it is
- smaller than the canvas, or show the start of it if it is big. */
- if (fits_in_canvas) {
- new_scroll_x = (start_x + end_x - canvas_width) / 2;
- } else {
- new_scroll_x = start_x;
- }
- gnome_canvas_scroll_to (GNOME_CANVAS (mts->display_main),
- new_scroll_x, scroll_y);
-}
-
-
-/* This updates the range of dates shown in the canvas, to make sure that the
- currently selected meeting time is in the range. */
-static void
-e_meeting_time_selector_update_dates_shown (EMeetingTimeSelector *mts)
-{
- mts->first_date_shown = mts->meeting_start_time.date;
- g_date_subtract_days (&mts->first_date_shown,
- E_MEETING_TIME_SELECTOR_DAYS_START_BEFORE);
-
- mts->last_date_shown = mts->first_date_shown;
- g_date_add_days (&mts->last_date_shown,
- E_MEETING_TIME_SELECTOR_DAYS_SHOWN - 1);
-}
-
-
-/* This checks if the time's hour is over 24 or its minute is over 60 and if
- so it updates the day/hour appropriately. Note that hours and minutes are
- stored in guint8's so they can't overflow by much. */
-void
-e_meeting_time_selector_fix_time_overflows (EMeetingTime*mtstime)
-{
- gint hours_to_add, days_to_add;
-
- hours_to_add = mtstime->minute / 60;
- if (hours_to_add > 0) {
- mtstime->minute -= hours_to_add * 60;
- mtstime->hour += hours_to_add;
- }
-
- days_to_add = mtstime->hour / 24;
- if (days_to_add > 0) {
- mtstime->hour -= days_to_add * 24;
- g_date_add_days (&mtstime->date, days_to_add);
- }
-}
-
-/*
- * CONVERSION ROUTINES - functions to convert between different coordinate
- * spaces and dates.
- */
-
-/* This takes an x pixel coordinate within the entire canvas scroll region and
- returns the date in which it falls. If day_position is not NULL it also
- returns the x coordinate within the date, relative to the visible part of
- the canvas. It is used when painting the days in the item_draw function.
- Note that it must handle negative x coordinates in case we are dragging off
- the edge of the canvas. */
-void
-e_meeting_time_selector_calculate_day_and_position (EMeetingTimeSelector *mts,
- gint x,
- GDate *date,
- gint *day_position)
-{
- gint days_from_first_shown;
-
- *date = mts->first_date_shown;
-
- if (x >= 0) {
- days_from_first_shown = x / mts->day_width;
- g_date_add_days (date, days_from_first_shown);
- if (day_position)
- *day_position = - x % mts->day_width;
- } else {
- days_from_first_shown = -x / mts->day_width + 1;
- g_date_subtract_days (date, days_from_first_shown);
- if (day_position)
- *day_position = -mts->day_width - x % mts->day_width;
- }
-}
-
-
-/* This takes an x pixel coordinate within a day, and converts it to hours
- and minutes, depending on working_hours_only and zoomed_out. */
-void
-e_meeting_time_selector_convert_day_position_to_hours_and_mins (EMeetingTimeSelector *mts, gint day_position, guint8 *hours, guint8 *minutes)
-{
- if (mts->zoomed_out)
- day_position *= 3;
-
- /* Calculate the hours & minutes from the first displayed. */
- *hours = day_position / mts->col_width;
- *minutes = (day_position % mts->col_width) * 60 / mts->col_width;
-
- /* Now add on the first hour shown. */
- *hours += mts->first_hour_shown;
-}
-
-
-/* This takes an x pixel coordinate within the entire canvas scroll region and
- returns the time in which it falls. Note that it won't be extremely
- accurate since hours may only be a few pixels wide in the display.
- With zoomed_out set each pixel may represent 5 minutes or more, depending
- on how small the font is. */
-void
-e_meeting_time_selector_calculate_time (EMeetingTimeSelector *mts,
- gint x,
- EMeetingTime*time)
-{
- gint day_position;
-
- /* First get the day and the x position within the day. */
- e_meeting_time_selector_calculate_day_and_position (mts, x, &time->date,
- NULL);
-
- /* Now convert the day_position into an hour and minute. */
- if (x >= 0)
- day_position = x % mts->day_width;
- else
- day_position = mts->day_width + x % mts->day_width;
-
- e_meeting_time_selector_convert_day_position_to_hours_and_mins (mts, day_position, &time->hour, &time->minute);
-}
-
-
-/* This takes a EMeetingTime and calculates the x pixel coordinate
- within the entire canvas scroll region. It is used to draw the selected
- meeting time and all the busy periods. */
-gint
-e_meeting_time_selector_calculate_time_position (EMeetingTimeSelector *mts,
- EMeetingTime *mtstime)
-{
- gint x, date_offset, day_offset;
-
- /* Calculate the number of days since the first date shown in the
- entire canvas scroll region. */
- date_offset = g_date_julian (&mtstime->date) - g_date_julian (&mts->first_date_shown);
-
- /* Calculate the x pixel coordinate of the start of the day. */
- x = date_offset * mts->day_width;
-
- /* Add on the hours and minutes, depending on whether zoomed_out and
- working_hours_only are set. */
- day_offset = (mtstime->hour - mts->first_hour_shown) * 60
- + mtstime->minute;
- /* The day width includes an extra vertical grid line so subtract 1. */
- day_offset *= (mts->day_width - 1);
- day_offset /= (mts->last_hour_shown - mts->first_hour_shown) * 60;
-
- /* Clamp the day_offset in case the time isn't actually visible. */
- x += CLAMP (day_offset, 0, mts->day_width);
-
- return x;
-}
-
-static void
-row_inserted_cb (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
-{
- EMeetingTimeSelector *mts = E_MEETING_TIME_SELECTOR (data);
- int row = gtk_tree_path_get_indices (path) [0];
- /* Update the scroll region. */
- e_meeting_time_selector_update_main_canvas_scroll_region (mts);
-
- /* Redraw */
- gtk_widget_queue_draw (mts->display_top);
- gtk_widget_queue_draw (mts->display_main);
-
- /* Get the latest free/busy info */
- e_meeting_time_selector_refresh_free_busy (mts, row, FALSE);
-}
-
-static void
-row_changed_cb (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
-{
- EMeetingTimeSelector *mts = E_MEETING_TIME_SELECTOR (data);
- int row = gtk_tree_path_get_indices (path) [0];
-
- /* Get the latest free/busy info */
- e_meeting_time_selector_refresh_free_busy (mts, row, FALSE);
-}
-
-static void
-row_deleted_cb (GtkTreeModel *model, GtkTreePath *path, gpointer data)
-{
- EMeetingTimeSelector *mts = E_MEETING_TIME_SELECTOR (data);
-
- /* Update the scroll region. */
- e_meeting_time_selector_update_main_canvas_scroll_region (mts);
-
- /* Redraw */
- gtk_widget_queue_draw (mts->display_top);
- gtk_widget_queue_draw (mts->display_main);
-}
-
diff --git a/calendar/gui/e-meeting-time-sel.etspec b/calendar/gui/e-meeting-time-sel.etspec
deleted file mode 100644
index c0b5c721dd..0000000000
--- a/calendar/gui/e-meeting-time-sel.etspec
+++ /dev/null
@@ -1,19 +0,0 @@
-<ETableSpecification click-to-add="true" click-to-add-end="true" _click-to-add-message="Click here to add an attendee" draw-grid="true">
- <ETableColumn model_col= "0" _title="Attendee" expansion="2.0" minimum_width="10" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col= "1" _title="Member" expansion="2.0" minimum_width="10" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col= "2" _title="Type" expansion="1.0" minimum_width="10" resizable="true" cell="typeedit" compare="string"/>
- <ETableColumn model_col= "3" _title="Role" expansion="1.0" minimum_width="10" resizable="true" cell="roleedit" compare="string"/>
- <ETableColumn model_col= "4" _title="RSVP" expansion="1.0" minimum_width="10" resizable="true" cell="rsvpedit" compare="string"/>
- <ETableColumn model_col= "5" _title="Delegated To" expansion="2.0" minimum_width="10" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col= "6" _title="Delegated From" expansion="2.0" minimum_width="10" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col= "7" _title="Status" expansion="1.0" minimum_width="10" resizable="true" cell="statusedit" compare="string"/>
- <ETableColumn model_col= "8" _title="Common Name" expansion="2.0" minimum_width="10" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col= "9" _title="Language" expansion="2.0" minimum_width="10" resizable="true" cell="string" compare="string"/>
-
- <ETableState>
- <column source="0"/>
- <column source="2"/>
- <column source="7"/>
- <grouping></grouping>
- </ETableState>
-</ETableSpecification>
diff --git a/calendar/gui/e-meeting-time-sel.h b/calendar/gui/e-meeting-time-sel.h
deleted file mode 100644
index ee23dbe672..0000000000
--- a/calendar/gui/e-meeting-time-sel.h
+++ /dev/null
@@ -1,379 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Author :
- * Damon Chaplin <damon@gtk.org>
- *
- * Copyright 1999, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-#ifndef _E_MEETING_TIME_SELECTOR_H_
-#define _E_MEETING_TIME_SELECTOR_H_
-
-#include <glib.h>
-#include <gtk/gtkaccelgroup.h>
-#include <gtk/gtktable.h>
-#include <gtk/gtkwidget.h>
-#include <libgnomecanvas/gnome-canvas.h>
-#include <gal/e-text/e-text.h>
-#include <gal/e-table/e-table-model.h>
-#include <gal/e-table/e-table.h>
-#include "e-meeting-store.h"
-#include "e-meeting-list-view.h"
-
-G_BEGIN_DECLS
-
-/*
- * EMeetingTimeSelector displays a list of attendees for a meeting and a
- * graphical summary of the times which they are free and busy, allowing the
- * user to select an appropriate time for a meeting.
- */
-
-/* Define this to include the debugging functions. */
-#undef E_MEETING_TIME_SELECTOR_DEBUG
-
-/* This is the width of the icon column in the attendees list. */
-#define E_MEETING_TIME_SELECTOR_ICON_COLUMN_WIDTH 24
-
-#define E_MEETING_TIME_SELECTOR_TEXT_Y_PAD 3
-#define E_MEETING_TIME_SELECTOR_TEXT_X_PAD 2
-
-
-/* This is used to specify the format used when displaying the dates.
- The full format is like 'Sunday, September 12, 1999'. The abbreviated format
- is like 'Sun 12/9/99'. The short format is like '12/9/99'. The actual
- format used is determined in e_meeting_time_selector_style_set(), once we
- know the font being used. */
-typedef enum
-{
- E_MEETING_TIME_SELECTOR_DATE_FULL,
- E_MEETING_TIME_SELECTOR_DATE_ABBREVIATED_DAY,
- E_MEETING_TIME_SELECTOR_DATE_SHORT
-} EMeetingTimeSelectorDateFormat;
-
-
-/* This is used to specify a position regarding the vertical bars around the
- current meeting time, so we know which one is being dragged. */
-typedef enum
-{
- E_MEETING_TIME_SELECTOR_POS_NONE,
- E_MEETING_TIME_SELECTOR_POS_START,
- E_MEETING_TIME_SELECTOR_POS_END
-} EMeetingTimeSelectorPosition;
-
-
-/* This is used to specify the autopick option, which determines how we choose
- the previous/next appropriate meeting time. */
-typedef enum
-{
- E_MEETING_TIME_SELECTOR_ALL_PEOPLE_AND_RESOURCES,
- E_MEETING_TIME_SELECTOR_ALL_PEOPLE_AND_ONE_RESOURCE,
- E_MEETING_TIME_SELECTOR_REQUIRED_PEOPLE,
- E_MEETING_TIME_SELECTOR_REQUIRED_PEOPLE_AND_ONE_RESOURCE
-} EMeetingTimeSelectorAutopickOption;
-
-/* An array of hour strings for 24 hour time, "0:00" .. "23:00". */
-extern const gchar *EMeetingTimeSelectorHours[24];
-/* An array of hour strings for 12 hour time, "12:00am" .. "11:00pm". */
-extern const gchar *EMeetingTimeSelectorHours12[24];
-
-
-#define E_MEETING_TIME_SELECTOR(obj) GTK_CHECK_CAST (obj, e_meeting_time_selector_get_type (), EMeetingTimeSelector)
-#define E_MEETING_TIME_SELECTOR_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, e_meeting_time_selector_get_type (), EMeetingTimeSelectorClass)
-#define IS_E_MEETING_TIME_SELECTOR(obj) GTK_CHECK_TYPE (obj, e_meeting_time_selector_get_type ())
-
-
-typedef struct _EMeetingTimeSelector EMeetingTimeSelector;
-typedef struct _EMeetingTimeSelectorClass EMeetingTimeSelectorClass;
-
-struct _EMeetingTimeSelector
-{
- /* We subclass a GtkTable which makes it easy to add extra widgets
- if neccesary. */
- GtkTable table;
-
- /*
- * User Interface stuff - widgets, colors etc.
- */
-
- /* This contains our keyboard accelerators, which need to be added to
- the toplevel window. */
- GtkAccelGroup *accel_group;
-
- /* The vbox in the top-left corner, containing the 'All Attendees'
- title bar packed at the end. Extra widgets can be added here
- with PACK_START if necessary. */
- GtkWidget *attendees_vbox;
- GtkWidget *attendees_vbox_spacer;
-
- /* The etable and model */
- EMeetingStore *model;
- EMeetingListView *list_view;
-
- /* The canvas displaying the dates, times, and the summary
- 'All Attendees' free/busy display. */
- GtkWidget *display_top;
-
- /* The canvas containing the free/busy displays of individual
- attendees. This is separate from display_top since it also scrolls
- vertically. */
- GtkWidget *display_main;
-
- /* This is the 'Options' button & menu. */
- GtkWidget *options_button;
- GtkWidget *options_menu;
-
- /* This is the 'Autopick' button, menu & radio menu items. */
- GtkWidget *autopick_button;
- GtkWidget *autopick_menu;
- GtkWidget *autopick_all_item;
- GtkWidget *autopick_all_people_one_resource_item;
- GtkWidget *autopick_required_people_item;
- GtkWidget *autopick_required_people_one_resource_item;
-
- /* The horizontal scrollbar which scrolls display_top & display_main.*/
- GtkWidget *hscrollbar;
-
- /* The vertical scrollbar which scrolls attendees & display_main. */
- GtkWidget *vscrollbar;
-
- /* The 2 EDateEdit widgets for the meeting start & end times. */
- GtkWidget *start_date_edit;
- GtkWidget *end_date_edit;
-
- /* Colors. */
- GdkColor bg_color;
- GdkColor all_attendees_bg_color;
- GdkColor meeting_time_bg_color;
- GdkColor stipple_bg_color;
- GdkColor attendee_list_bg_color;
- GdkColor grid_color;
- GdkColor grid_shadow_color;
- GdkColor grid_unused_color;
- GdkColor busy_colors[E_MEETING_FREE_BUSY_LAST];
-
- /* The stipple used for attendees with no data. */
- GdkPixmap *stipple;
-
- /* GC for drawing the color key. */
- GdkGC *color_key_gc;
-
- /* Width of the hours strings (e.g. "1:00") in the current font. */
- gint hour_widths[24];
-
- /* Whether we are using the full, abbreviated or short date format. */
- EMeetingTimeSelectorDateFormat date_format;
-
- /*
- * Option Settings.
- */
-
- /* True if we are selecting all day events */
- gboolean all_day;
-
- /* If this is TRUE we only show hours between day_start_hour and
- day_end_hour, defaults to TRUE (9am-6pm). */
- gboolean working_hours_only;
- gint day_start_hour;
- gint day_start_minute;
- gint day_end_hour;
- gint day_end_minute;
-
- /* If TRUE, view is compressed, with one cell for every 3 hours rather
- than every hour. Defaults to FALSE. */
- gboolean zoomed_out;
-
-
- /*
- * Internal Data.
- */
-
- /* These are the first & last dates shown in the current scroll area.
- We show E_MEETING_TIME_SELECTOR_DAYS_SHOWN days at a time. */
- GDate first_date_shown;
- GDate last_date_shown;
-
- /* This is the current selection of the meeting time. */
- EMeetingTime meeting_start_time;
- EMeetingTime meeting_end_time;
-
- /* These are the x pixel coordinates in the entire scroll region of
- the start and end times. Set to meeting_positions_valid to FALSE to
- invalidate. They will then be recomputed when needed. Always access
- with e_meeting_time_selector_get_meeting_time_positions(). */
- gint meeting_positions_valid;
- gint meeting_positions_in_scroll_area;
- gint meeting_start_x;
- gint meeting_end_x;
-
- /* These are the width and height of the cells, including the grid
- lines which are displayed on the right and top or bottom of cells.*/
- gint row_height;
- gint col_width;
-
- /* This is the width of a day in the display, which depends on
- col_width, working_hours_only and zoomed_out. */
- gint day_width;
-
- /* These are the first and last hour of each day we display, depending
- on working_hours_only and zoomed_out. */
- gint first_hour_shown;
- gint last_hour_shown;
-
- /* The id of the source function for auto-scroll timeouts. */
- guint auto_scroll_timeout_id;
-
- /* This specifies if we are dragging one of the vertical bars around
- the meeting time. */
- EMeetingTimeSelectorPosition dragging_position;
-
- /* The last x coordinate of the mouse, relative to either the left or
- right edge of the canvas. Used in the auto_scroll_timeout function
- to determine which way to scroll and how fast. */
- gint last_drag_x;
-
- /* This is used to determine the delay between scrolls. */
- gint scroll_count;
-};
-
-
-struct _EMeetingTimeSelectorClass
-{
- GtkTableClass parent_class;
-
- void (* changed) (EMeetingTimeSelector *mts);
-};
-
-
-/*
- * PUBLIC INTERFACE - note that this interface will probably change, when I
- * know where the data is coming from. This is mainly just for testing for now.
- */
-
-GtkType e_meeting_time_selector_get_type (void);
-GtkWidget* e_meeting_time_selector_new (EMeetingStore *ems);
-void e_meeting_time_selector_construct (EMeetingTimeSelector * mts, EMeetingStore *ems);
-
-/* This returns the currently selected meeting time.
- Note that months are 1-12 and days are 1-31. The start time is guaranteed to
- be before or equal to the end time. You may want to check if they are equal
- if that if it is a problem. */
-void e_meeting_time_selector_get_meeting_time (EMeetingTimeSelector *mts,
- gint *start_year,
- gint *start_month,
- gint *start_day,
- gint *start_hour,
- gint *start_minute,
- gint *end_year,
- gint *end_month,
- gint *end_day,
- gint *end_hour,
- gint *end_minute);
-
-/* This sets the meeting time, returning TRUE if it is valid. */
-gboolean e_meeting_time_selector_set_meeting_time (EMeetingTimeSelector *mts,
- gint start_year,
- gint start_month,
- gint start_day,
- gint start_hour,
- gint start_minute,
- gint end_year,
- gint end_month,
- gint end_day,
- gint end_hour,
- gint end_minute);
-
-void e_meeting_time_selector_set_all_day (EMeetingTimeSelector *mts,
- gboolean all_day);
-void e_meeting_time_selector_set_working_hours_only (EMeetingTimeSelector *mts,
- gboolean working_hours_only);
-void e_meeting_time_selector_set_working_hours (EMeetingTimeSelector *mts,
- gint day_start_hour,
- gint day_start_minute,
- gint day_end_hour,
- gint day_end_minute);
-
-void e_meeting_time_selector_set_zoomed_out (EMeetingTimeSelector *mts,
- gboolean zoomed_out);
-
-EMeetingTimeSelectorAutopickOption e_meeting_time_selector_get_autopick_option (EMeetingTimeSelector *mts);
-void e_meeting_time_selector_set_autopick_option (EMeetingTimeSelector *mts,
- EMeetingTimeSelectorAutopickOption autopick_option);
-
-void e_meeting_time_selector_attendee_set_send_meeting_to (EMeetingTimeSelector *mts,
- gint row,
- gboolean send_meeting_to);
-
-/* Clears all busy times for the given attendee. */
-void e_meeting_time_selector_attendee_clear_busy_periods (EMeetingTimeSelector *mts,
- gint row);
-/* Adds one busy time for the given attendee. */
-gboolean e_meeting_time_selector_attendee_add_busy_period (EMeetingTimeSelector *mts,
- gint row,
- gint start_year,
- gint start_month,
- gint start_day,
- gint start_hour,
- gint start_minute,
- gint end_year,
- gint end_month,
- gint end_day,
- gint end_hour,
- gint end_minute,
- EMeetingFreeBusyType busy_type);
-
-
-
-/*
- * INTERNAL ROUTINES - functions to communicate with the canvas items within
- * the EMeetingTimeSelector.
- */
-
-/* This returns the x pixel coordinates of the meeting start and end times,
- in the entire canvas scroll area. If it returns FALSE, then the meeting
- time isn't in the current scroll area (which shouldn't really happen). */
-gboolean e_meeting_time_selector_get_meeting_time_positions (EMeetingTimeSelector *mts,
- gint *start_x,
- gint *end_x);
-
-void e_meeting_time_selector_drag_meeting_time (EMeetingTimeSelector *mts,
- gint x);
-
-void e_meeting_time_selector_remove_timeout (EMeetingTimeSelector *mts);
-
-void e_meeting_time_selector_fix_time_overflows (EMeetingTime*mtstime);
-
-void e_meeting_time_selector_calculate_day_and_position (EMeetingTimeSelector *mts,
- gint x,
- GDate *date,
- gint *day_position);
-void e_meeting_time_selector_convert_day_position_to_hours_and_mins (EMeetingTimeSelector *mts, gint day_position, guint8 *hours, guint8 *minutes);
-void e_meeting_time_selector_calculate_time (EMeetingTimeSelector *mts,
- gint x,
- EMeetingTime*time);
-gint e_meeting_time_selector_calculate_time_position (EMeetingTimeSelector *mts,
- EMeetingTime *mtstime);
-
-/* Debugging function to dump information on all attendees. */
-#ifdef E_MEETING_TIME_SELECTOR_DEBUG
-void e_meeting_time_selector_dump (EMeetingTimeSelector *mts);
-gchar* e_meeting_time_selector_dump_time (EMeetingTime*mtstime);
-gchar* e_meeting_time_selector_dump_date (GDate *date);
-#endif /* E_MEETING_TIME_SELECTOR_DEBUG */
-
-G_END_DECLS
-
-#endif /* _E_MEETING_TIME_SELECTOR_H_ */
diff --git a/calendar/gui/e-meeting-types.h b/calendar/gui/e-meeting-types.h
deleted file mode 100644
index ab330a6d40..0000000000
--- a/calendar/gui/e-meeting-types.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* itip-attendee.h
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: JP Rosevear
- */
-
-#ifndef _E_MEETING_TYPES_H_
-#define _E_MEETING_TYPES_H_
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <glib.h>
-#include "e-meeting-types.h"
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-
-
-typedef struct _EMeetingTime EMeetingTime;
-typedef struct _EMeetingFreeBusyPeriod EMeetingFreeBusyPeriod;
-
-/* These are used to specify whether an attendee is free or busy at a
- particular time. We'll probably replace this with a global calendar type.
- These should be ordered in increasing order of preference. Higher precedence
- busy periods will be painted over lower precedence ones. These are also
- used as for loop counters, so they should start at 0 and be ordered. */
-typedef enum
-{
- E_MEETING_FREE_BUSY_TENTATIVE = 0,
- E_MEETING_FREE_BUSY_OUT_OF_OFFICE = 1,
- E_MEETING_FREE_BUSY_BUSY = 2,
-
- E_MEETING_FREE_BUSY_LAST = 3
-} EMeetingFreeBusyType;
-
-/* This is our representation of a time. We use a GDate to store the day,
- and guint8s for the hours and minutes. */
-struct _EMeetingTime
-{
- GDate date;
- guint8 hour;
- guint8 minute;
-};
-
-/* This represents a busy period. */
-struct _EMeetingFreeBusyPeriod
-{
- EMeetingTime start;
- EMeetingTime end;
- EMeetingFreeBusyType busy_type;
-};
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _E_MEETING_TYPES_H_ */
diff --git a/calendar/gui/e-meeting-utils.c b/calendar/gui/e-meeting-utils.c
deleted file mode 100644
index 496bb8ebaa..0000000000
--- a/calendar/gui/e-meeting-utils.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* itip-model.c
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: JP Rosevear
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "e-meeting-utils.h"
-
-gint
-e_meeting_time_compare_times (EMeetingTime*time1,
- EMeetingTime*time2)
-{
- gint day_comparison;
-
- day_comparison = g_date_compare (&time1->date,
- &time2->date);
- if (day_comparison != 0)
- return day_comparison;
-
- if (time1->hour < time2->hour)
- return -1;
- if (time1->hour > time2->hour)
- return 1;
-
- if (time1->minute < time2->minute)
- return -1;
- if (time1->minute > time2->minute)
- return 1;
-
- /* The start times are exactly the same. */
- return 0;
-}
diff --git a/calendar/gui/e-meeting-utils.h b/calendar/gui/e-meeting-utils.h
deleted file mode 100644
index 4c2798fcf0..0000000000
--- a/calendar/gui/e-meeting-utils.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* itip-attendee.h
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: JP Rosevear
- */
-
-#ifndef _E_MEETING_UTILS_H_
-#define _E_MEETING_UTILS_H_
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <glib.h>
-#include "e-meeting-types.h"
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-
-
-gint e_meeting_time_compare_times (EMeetingTime *time1,
- EMeetingTime *time2);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _E_MEETING_UTILS_H_ */
-
-
diff --git a/calendar/gui/e-mini-calendar-config.c b/calendar/gui/e-mini-calendar-config.c
deleted file mode 100644
index 2f17b23beb..0000000000
--- a/calendar/gui/e-mini-calendar-config.c
+++ /dev/null
@@ -1,247 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Author :
- * JP Rosevear <jpr@ximian.com>
- *
- * Copyright 2003, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#include "calendar-config.h"
-#include "e-mini-calendar-config.h"
-
-struct _EMiniCalendarConfigPrivate {
- ECalendar *mini_cal;
-
- GList *notifications;
-};
-
-static GObjectClass *parent_class = NULL;
-
-/* Property IDs */
-enum props {
- PROP_0,
- PROP_CALENDAR
-};
-
-static void
-e_mini_calendar_config_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
-{
- EMiniCalendarConfig *mini_config;
- EMiniCalendarConfigPrivate *priv;
-
- mini_config = E_MINI_CALENDAR_CONFIG (object);
- priv = mini_config->priv;
-
- switch (property_id) {
- case PROP_CALENDAR:
- e_mini_calendar_config_set_calendar (mini_config, g_value_get_object (value));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
- break;
- }
-}
-
-static void
-e_mini_calendar_config_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
-{
- EMiniCalendarConfig *mini_config;
- EMiniCalendarConfigPrivate *priv;
-
- mini_config = E_MINI_CALENDAR_CONFIG (object);
- priv = mini_config->priv;
-
- switch (property_id) {
- case PROP_CALENDAR:
- g_value_set_object (value, e_mini_calendar_config_get_calendar (mini_config));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
- break;
- }
-}
-
-static void
-e_mini_calendar_config_dispose (GObject *object)
-{
- EMiniCalendarConfig *mini_config = E_MINI_CALENDAR_CONFIG (object);
- EMiniCalendarConfigPrivate *priv;
-
- priv = mini_config->priv;
-
- e_mini_calendar_config_set_calendar (mini_config, NULL);
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-static void
-e_mini_calendar_config_finalize (GObject *object)
-{
- EMiniCalendarConfig *mini_config = E_MINI_CALENDAR_CONFIG (object);
- EMiniCalendarConfigPrivate *priv;
-
- priv = mini_config->priv;
-
- g_free (priv);
-
- if (G_OBJECT_CLASS (parent_class)->finalize)
- G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-static void
-e_mini_calendar_config_class_init (EMiniCalendarConfigClass *klass)
-{
- GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- GParamSpec *spec;
-
- parent_class = g_type_class_peek_parent (klass);
-
- /* Method override */
- gobject_class->set_property = e_mini_calendar_config_set_property;
- gobject_class->get_property = e_mini_calendar_config_get_property;
- gobject_class->dispose = e_mini_calendar_config_dispose;
- gobject_class->finalize = e_mini_calendar_config_finalize;
-
- spec = g_param_spec_object ("calendar", NULL, NULL, e_calendar_get_type (),
- G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT);
- g_object_class_install_property (gobject_class, PROP_CALENDAR, spec);
-}
-
-static void
-e_mini_calendar_config_init (EMiniCalendarConfig *mini_config, EMiniCalendarConfigClass *klass)
-{
- mini_config->priv = g_new0 (EMiniCalendarConfigPrivate, 1);
-
-}
-
-E_MAKE_TYPE (e_mini_calendar_config, "EMiniCalendarConfig", EMiniCalendarConfig, e_mini_calendar_config_class_init,
- e_mini_calendar_config_init, G_TYPE_OBJECT);
-
-EMiniCalendarConfig *
-e_mini_calendar_config_new (ECalendar *mini_cal)
-{
- EMiniCalendarConfig *mini_config;
-
- mini_config = g_object_new (e_mini_calendar_config_get_type (), "calendar", mini_cal, NULL);
-
- return mini_config;
-}
-
-ECalendar *
-e_mini_calendar_config_get_calendar (EMiniCalendarConfig *mini_config)
-{
- EMiniCalendarConfigPrivate *priv;
-
- g_return_val_if_fail (mini_config != NULL, NULL);
- g_return_val_if_fail (E_IS_MINI_CALENDAR_CONFIG (mini_config), NULL);
-
- priv = mini_config->priv;
-
- return priv->mini_cal;
-}
-
-static void
-set_week_start (ECalendar *mini_cal)
-{
- int week_start_day;
-
- week_start_day = calendar_config_get_week_start_day ();
-
- /* Convert it to 0 (Mon) to 6 (Sun), which is what we use. */
- week_start_day = (week_start_day + 6) % 7;
-
- gnome_canvas_item_set (GNOME_CANVAS_ITEM (mini_cal->calitem),
- "week_start_day", week_start_day,
- NULL);
-}
-
-static void
-week_start_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
-{
- EMiniCalendarConfig *mini_config = data;
- EMiniCalendarConfigPrivate *priv;
-
- priv = mini_config->priv;
-
- set_week_start (priv->mini_cal);
-}
-
-static void
-set_dnav_show_week_no (ECalendar *mini_cal)
-{
- gboolean show_week_no;
-
- show_week_no = calendar_config_get_dnav_show_week_no ();
-
- gnome_canvas_item_set (GNOME_CANVAS_ITEM (mini_cal->calitem),
- "show_week_numbers", show_week_no,
- NULL);
-}
-
-static void
-dnav_show_week_no_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
-{
- EMiniCalendarConfig *mini_config = data;
- EMiniCalendarConfigPrivate *priv;
-
- priv = mini_config->priv;
-
- set_dnav_show_week_no (priv->mini_cal);
-}
-
-void
-e_mini_calendar_config_set_calendar (EMiniCalendarConfig *mini_config, ECalendar *mini_cal)
-{
- EMiniCalendarConfigPrivate *priv;
- guint not;
- GList *l;
-
- g_return_if_fail (mini_config != NULL);
- g_return_if_fail (E_IS_MINI_CALENDAR_CONFIG (mini_config));
-
- priv = mini_config->priv;
-
- if (priv->mini_cal) {
- g_object_unref (priv->mini_cal);
- priv->mini_cal = NULL;
- }
-
- for (l = priv->notifications; l; l = l->next)
- calendar_config_remove_notification (GPOINTER_TO_UINT (l->data));
-
- g_list_free (priv->notifications);
- priv->notifications = NULL;
-
- /* If the new view is NULL, return right now */
- if (!mini_cal)
- return;
-
- priv->mini_cal = g_object_ref (mini_cal);
-
- /* Week start */
- set_week_start (mini_cal);
-
- not = calendar_config_add_notification_week_start_day (week_start_changed_cb, mini_config);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
-
- /* Show week numbers */
- set_dnav_show_week_no (mini_cal);
-
- not = calendar_config_add_notification_dnav_show_week_no (dnav_show_week_no_changed_cb, mini_config);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
-}
diff --git a/calendar/gui/e-mini-calendar-config.h b/calendar/gui/e-mini-calendar-config.h
deleted file mode 100644
index 78b9cfd363..0000000000
--- a/calendar/gui/e-mini-calendar-config.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Author :
- * JP Rosevear <jpr@ximian.com>
- *
- * Copyright 2003, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifndef _E_MINI_CALENDAR_CONFIG_H_
-#define _E_MINI_CALENDAR_CONFIG_H_
-
-#include <widgets/misc/e-calendar.h>
-
-G_BEGIN_DECLS
-
-#define E_MINI_CALENDAR_CONFIG(obj) GTK_CHECK_CAST (obj, e_mini_calendar_config_get_type (), EMiniCalendarConfig)
-#define E_MINI_CALENDAR_CONFIG_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, e_mini_calendar_config_get_type (), EMiniCalendarConfigClass)
-#define E_IS_MINI_CALENDAR_CONFIG(obj) GTK_CHECK_TYPE (obj, e_mini_calendar_config_get_type ())
-
-typedef struct _EMiniCalendarConfig EMiniCalendarConfig;
-typedef struct _EMiniCalendarConfigClass EMiniCalendarConfigClass;
-typedef struct _EMiniCalendarConfigPrivate EMiniCalendarConfigPrivate;
-
-struct _EMiniCalendarConfig {
- GObject parent;
-
- EMiniCalendarConfigPrivate *priv;
-};
-
-struct _EMiniCalendarConfigClass {
- GObjectClass parent_class;
-};
-
-GType e_mini_calendar_config_get_type (void);
-EMiniCalendarConfig *e_mini_calendar_config_new (ECalendar *mini_cal);
-ECalendar *e_mini_calendar_config_get_calendar (EMiniCalendarConfig *mini_config);
-void e_mini_calendar_config_set_calendar (EMiniCalendarConfig *mini_config, ECalendar *mini_cal);
-
-G_END_DECLS
-
-#endif
diff --git a/calendar/gui/e-select-names-editable.c b/calendar/gui/e-select-names-editable.c
deleted file mode 100644
index cf2cd1d661..0000000000
--- a/calendar/gui/e-select-names-editable.c
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
- * e-select-names-editable.c
- *
- * Author: Mike Kestner <mkestner@ximian.com>
- *
- * Copyright (C) 2003 Ximian Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-#include <gdk/gdkkeysyms.h>
-#include <gtk/gtkcelleditable.h>
-#include <bonobo/bonobo-exception.h>
-#include <bonobo/bonobo-widget.h>
-#include <addressbook/util/eab-destination.h>
-
-#include "e-select-names-editable.h"
-#include "Evolution-Addressbook-SelectNames.h"
-
-#define SELECT_NAMES_OAFIID "OAFIID:GNOME_Evolution_Addressbook_SelectNames:" BASE_VERSION
-
-struct _ESelectNamesEditablePriv {
- GNOME_Evolution_Addressbook_SelectNames select_names;
- Bonobo_Control control;
- Bonobo_PropertyBag bag;
-};
-
-static BonoboWidgetClass *parent_class;
-
-static void
-esne_start_editing (GtkCellEditable *cell_editable, GdkEvent *event)
-{
- ESelectNamesEditable *esne = E_SELECT_NAMES_EDITABLE (cell_editable);
-
-}
-
-static void
-esne_cell_editable_init (GtkCellEditableIface *iface)
-{
- iface->start_editing = esne_start_editing;
-}
-
-static void
-esne_finalize (GObject *obj)
-{
- ESelectNamesEditable *esne = (ESelectNamesEditable *) obj;
-
- if (esne->priv->select_names != CORBA_OBJECT_NIL)
- bonobo_object_release_unref (esne->priv->select_names, NULL);
- esne->priv->select_names = CORBA_OBJECT_NIL;
-
- if (esne->priv->bag != CORBA_OBJECT_NIL)
- bonobo_object_release_unref (esne->priv->bag, NULL);
- esne->priv->bag = CORBA_OBJECT_NIL;
-
- g_free (esne->priv);
-
- if (G_OBJECT_CLASS (parent_class)->finalize)
- G_OBJECT_CLASS (parent_class)->finalize (obj);
-}
-
-static void
-esne_init (ESelectNamesEditable *esne)
-{
- esne->priv = g_new0 (ESelectNamesEditablePriv, 1);
-
- esne->priv->select_names = CORBA_OBJECT_NIL;
- esne->priv->control = CORBA_OBJECT_NIL;
- esne->priv->bag = CORBA_OBJECT_NIL;
-}
-
-static void
-esne_class_init (GObjectClass *klass)
-{
- klass->finalize = esne_finalize;
-
- parent_class = BONOBO_WIDGET_CLASS (g_type_class_peek_parent (klass));
-}
-
-GType
-e_select_names_editable_get_type (void)
-{
- static GType esne_type = 0;
-
- if (!esne_type) {
- static const GTypeInfo esne_info = {
- sizeof (ESelectNamesEditableClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) esne_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (ESelectNamesEditable),
- 0, /* n_preallocs */
- (GInstanceInitFunc) esne_init,
- };
-
- static const GInterfaceInfo cell_editable_info = {
- (GInterfaceInitFunc) esne_cell_editable_init,
- NULL,
- NULL
- };
-
- esne_type = g_type_register_static (BONOBO_TYPE_WIDGET, "ESelectNamesEditable", &esne_info, 0);
-
- g_type_add_interface_static (esne_type, GTK_TYPE_CELL_EDITABLE, &cell_editable_info);
- }
-
- return esne_type;
-}
-
-static void
-entry_activate (BonoboListener *listener, const char *event_name, const CORBA_any *arg, CORBA_Environment *ev, gpointer esne)
-{
- gtk_cell_editable_editing_done (GTK_CELL_EDITABLE (esne));
- gtk_cell_editable_remove_widget (GTK_CELL_EDITABLE (esne));
-}
-
-ESelectNamesEditable *
-e_select_names_editable_construct (ESelectNamesEditable *esne)
-{
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
-
- esne->priv->select_names = bonobo_activation_activate_from_id (SELECT_NAMES_OAFIID, 0, NULL, &ev);
- if (BONOBO_EX (&ev)) {
- CORBA_exception_free (&ev);
- return NULL;
- }
-
- GNOME_Evolution_Addressbook_SelectNames_addSection (esne->priv->select_names, "A", "A", &ev);
- if (BONOBO_EX (&ev)) {
- CORBA_exception_free (&ev);
- return NULL;
- }
-
- esne->priv->control = GNOME_Evolution_Addressbook_SelectNames_getEntryBySection (
- esne->priv->select_names, "A", &ev);
- if (BONOBO_EX (&ev)) {
- CORBA_exception_free (&ev);
- return NULL;
- }
-
- bonobo_widget_construct_control_from_objref (BONOBO_WIDGET (esne), esne->priv->control, CORBA_OBJECT_NIL, &ev);
-
- CORBA_exception_free (&ev);
-
- esne->priv->bag = bonobo_control_frame_get_control_property_bag (
- bonobo_widget_get_control_frame (BONOBO_WIDGET (esne)), NULL);
- bonobo_event_source_client_add_listener (esne->priv->bag, entry_activate,
- "GNOME/Evolution/Addressbook/SelectNames:activate:entry",
- NULL, esne);
-
- return esne;
-}
-
-ESelectNamesEditable *
-e_select_names_editable_new ()
-{
- ESelectNamesEditable *esne = g_object_new (E_TYPE_SELECT_NAMES_EDITABLE, NULL);
-
- if (!esne)
- return NULL;
-
- if (!e_select_names_editable_construct (esne)) {
- g_object_unref (esne);
- return NULL;
- }
-
- return esne;
-}
-
-gchar *
-e_select_names_editable_get_address (ESelectNamesEditable *esne)
-{
- EABDestination **dest;
- gchar *dest_str;
- gchar *result;
-
- g_return_val_if_fail (E_SELECT_NAMES_EDITABLE (esne), NULL);
-
- dest_str = bonobo_pbclient_get_string (esne->priv->bag, "destinations", NULL);
- dest = eab_destination_importv (dest_str);
- result = g_strdup (eab_destination_get_email (*dest));
- eab_destination_freev (dest);
-
- return result;
-}
-
-gchar *
-e_select_names_editable_get_name (ESelectNamesEditable *esne)
-{
- EABDestination **dest;
- gchar *dest_str;
- gchar *result;
-
- g_return_val_if_fail (E_SELECT_NAMES_EDITABLE (esne), NULL);
-
- dest_str = bonobo_pbclient_get_string (esne->priv->bag, "destinations", NULL);
- dest = eab_destination_importv (dest_str);
- result = g_strdup (eab_destination_get_name (*dest));
- eab_destination_freev (dest);
-
- return result;
-}
-
-void
-e_select_names_editable_set_address (ESelectNamesEditable *esne, const gchar *text)
-{
- g_return_if_fail (E_IS_SELECT_NAMES_EDITABLE (esne));
-
- bonobo_pbclient_set_string (esne->priv->bag, "addresses", text, NULL);
-}
-
diff --git a/calendar/gui/e-select-names-editable.h b/calendar/gui/e-select-names-editable.h
deleted file mode 100644
index 867118fe9e..0000000000
--- a/calendar/gui/e-select-names-editable.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * e-select-names-editable.h
- *
- * Author: Mike Kestner <mkestner@ximian.com>
- *
- * Copyright (C) 2003 Ximian Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef __E_SELECT_NAMES_EDITABLE_H__
-#define __E_SELECT_NAMES_EDITABLE_H__
-
-#include <bonobo/bonobo-widget.h>
-
-G_BEGIN_DECLS
-
-#define E_TYPE_SELECT_NAMES_EDITABLE (e_select_names_editable_get_type ())
-#define E_SELECT_NAMES_EDITABLE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_SELECT_NAMES_EDITABLE, ESelectNamesEditable))
-#define E_SELECT_NAMES_EDITABLE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), E_TYPE_SELECT_NAMES_EDITABLE, ESelectNamesEditableClass))
-#define E_IS_SELECT_NAMES_EDITABLE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_SELECT_NAMES_EDITABLE))
-#define E_IS_SELECT_NAMES_EDITABLE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((o), E_TYPE_SELECT_NAMES_EDITABLE))
-#define E_SELECT_NAMES_EDITABLE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), E_TYPE_SELECT_NAMES_EDITABLE, ESelectNamesEditableClass))
-
-typedef struct _ESelectNamesEditable ESelectNamesEditable;
-typedef struct _ESelectNamesEditableClass ESelectNamesEditableClass;
-typedef struct _ESelectNamesEditablePriv ESelectNamesEditablePriv;
-
-struct _ESelectNamesEditable
-{
- BonoboWidget parent;
-
- ESelectNamesEditablePriv *priv;
-};
-
-struct _ESelectNamesEditableClass
-{
- BonoboWidgetClass parent_class;
-};
-
-GType e_select_names_editable_get_type (void);
-
-ESelectNamesEditable *e_select_names_editable_construct (ESelectNamesEditable *esne);
-ESelectNamesEditable *e_select_names_editable_new (void);
-
-gchar *e_select_names_editable_get_address (ESelectNamesEditable *esne);
-void e_select_names_editable_set_address (ESelectNamesEditable *esne, const gchar *text);
-
-gchar *e_select_names_editable_get_name (ESelectNamesEditable *esne);
-G_END_DECLS
-
-#endif /* __E_SELECT_NAMES_EDITABLE_H__ */
diff --git a/calendar/gui/e-select-names-renderer.c b/calendar/gui/e-select-names-renderer.c
deleted file mode 100644
index fbda387d23..0000000000
--- a/calendar/gui/e-select-names-renderer.c
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * e-select-names-renderer.c
- *
- * Author: Mike Kestner <mkestner@ximian.com>
- *
- * Copyright (C) 2003 Ximian Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-#include <gtk/gtkcellrenderertext.h>
-#include <gal/util/e-util.h>
-
-#include "e-calendar-marshal.h"
-
-#include "e-select-names-editable.h"
-#include "e-select-names-renderer.h"
-
-
-struct _ESelectNamesRendererPriv {
- ESelectNamesEditable *editable;
- gchar *path;
- gchar *address;
-};
-
-enum {
- PROP_0,
- PROP_ADDRESS
-};
-
-enum {
- CELL_EDITED,
- LAST_SIGNAL
-};
-
-static GtkCellRendererTextClass *parent_class;
-static gint signals [LAST_SIGNAL];
-
-static void
-esnr_editing_done (GtkCellEditable *editable, ESelectNamesRenderer *cell)
-{
- gchar *new_address, *new_name;
-
- new_address = e_select_names_editable_get_address (E_SELECT_NAMES_EDITABLE (editable));
- new_name = e_select_names_editable_get_name (E_SELECT_NAMES_EDITABLE (editable));
-
- g_signal_emit (cell, signals [CELL_EDITED], 0, cell->priv->path, new_address, new_name);
- g_free (new_address);
- g_free (new_name);
- g_free (cell->priv->path);
- cell->priv->path = NULL;
-}
-
-static GtkCellEditable *
-esnr_start_editing (GtkCellRenderer *cell, GdkEvent *event, GtkWidget *widget, const gchar *path,
- GdkRectangle *bg_area, GdkRectangle *cell_area, GtkCellRendererState flags)
-{
- ESelectNamesRenderer *sn_cell = E_SELECT_NAMES_RENDERER (cell);
- GtkCellRendererText *text_cell = GTK_CELL_RENDERER_TEXT (cell);
- ESelectNamesEditable *editable;
-
- if (!text_cell->editable)
- return NULL;
-
- editable = E_SELECT_NAMES_EDITABLE (e_select_names_editable_new ());
- e_select_names_editable_set_address (editable, sn_cell->priv->address);
- gtk_widget_show (GTK_WIDGET (editable));
-
- g_signal_connect (editable, "editing-done", G_CALLBACK (esnr_editing_done), sn_cell);
-
- sn_cell->priv->editable = g_object_ref (editable);
- sn_cell->priv->path = g_strdup (path);
-
- return GTK_CELL_EDITABLE (editable);
-}
-
-static void
-esnr_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
-{
- ESelectNamesRenderer *esnr = E_SELECT_NAMES_RENDERER (object);
-
- switch (prop_id) {
- case PROP_ADDRESS:
- g_value_set_string (value, esnr->priv->address);
- break;
- default:
- break;
- }
-}
-
-static void
-esnr_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
-{
- ESelectNamesRenderer *esnr = E_SELECT_NAMES_RENDERER (object);
-
- switch (prop_id) {
- case PROP_ADDRESS:
- g_free (esnr->priv->address);
- esnr->priv->address = g_strdup (g_value_get_string (value));
- break;
- default:
- break;
- }
-}
-
-static void
-esnr_finalize (GObject *obj)
-{
- ESelectNamesRenderer *cell = (ESelectNamesRenderer *) obj;
-
- if (cell->priv->editable)
- g_object_unref (cell->priv->editable);
- cell->priv->editable = NULL;
-
- g_free (cell->priv->path);
- g_free (cell->priv->address);
- g_free (cell->priv);
-
- if (G_OBJECT_CLASS (parent_class)->finalize)
- G_OBJECT_CLASS (parent_class)->finalize (obj);
-}
-
-static void
-esnr_init (ESelectNamesRenderer *cell)
-{
- cell->priv = g_new0 (ESelectNamesRendererPriv, 1);
-}
-
-static void
-esnr_class_init (ESelectNamesRendererClass *class)
-{
- GtkCellRendererClass *cell_class = GTK_CELL_RENDERER_CLASS (class);
- GObjectClass *obj_class = G_OBJECT_CLASS (class);
-
- parent_class = GTK_CELL_RENDERER_TEXT_CLASS (g_type_class_peek_parent (class));
-
- obj_class->finalize = esnr_finalize;
- obj_class->get_property = esnr_get_property;
- obj_class->set_property = esnr_set_property;
-
- cell_class->start_editing = esnr_start_editing;
-
- g_object_class_install_property (obj_class, PROP_ADDRESS,
- g_param_spec_string ("address", "Address", "Email address.", NULL, G_PARAM_READWRITE));
-
- signals [CELL_EDITED] = g_signal_new ("cell_edited",
- G_OBJECT_CLASS_TYPE (obj_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ESelectNamesRendererClass, cell_edited),
- NULL, NULL,
- e_calendar_marshal_VOID__STRING_STRING_STRING,
- G_TYPE_NONE, 3,
- G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
-}
-
-E_MAKE_TYPE (e_select_names_renderer, "ESelectNamesRenderer", ESelectNamesRenderer, esnr_class_init, esnr_init, GTK_TYPE_CELL_RENDERER_TEXT)
-
-GtkCellRenderer *
-e_select_names_renderer_new (void)
-{
- return GTK_CELL_RENDERER (g_object_new (E_TYPE_SELECT_NAMES_RENDERER, NULL));
-}
-
diff --git a/calendar/gui/e-select-names-renderer.h b/calendar/gui/e-select-names-renderer.h
deleted file mode 100644
index fb045d928f..0000000000
--- a/calendar/gui/e-select-names-renderer.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * e-select-names-renderer.h
- *
- * Author: Mike Kestner <mkestner@ximian.com>
- *
- * Copyright (C) 2003 Ximian Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef __E_SELECT_NAMES_RENDERER_H__
-#define __E_SELECT_NAMES_RENDERER_H__
-
-#include <gtk/gtkcellrenderertext.h>
-
-G_BEGIN_DECLS
-
-#define E_TYPE_SELECT_NAMES_RENDERER (e_select_names_renderer_get_type ())
-#define E_SELECT_NAMES_RENDERER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_SELECT_NAMES_RENDERER, ESelectNamesRenderer))
-#define E_SELECT_NAMES_RENDERER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), E_TYPE_SELECT_NAMES_RENDERER, ESelectNamesRendererClass))
-#define E_IS_SELECT_NAMES_RENDERER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_SELECT_NAMES_RENDERER))
-#define E_IS_SELECT_NAMES_RENDERER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((o), E_TYPE_SELECT_NAMES_RENDERER))
-#define E_SELECT_NAMES_RENDERER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), E_TYPE_SELECT_NAMES_RENDERER, ESelectNamesRendererClass))
-
-typedef struct _ESelectNamesRenderer ESelectNamesRenderer;
-typedef struct _ESelectNamesRendererClass ESelectNamesRendererClass;
-typedef struct _ESelectNamesRendererPriv ESelectNamesRendererPriv;
-
-struct _ESelectNamesRenderer
-{
- GtkCellRendererText parent;
-
- ESelectNamesRendererPriv *priv;
-};
-
-struct _ESelectNamesRendererClass
-{
- GtkCellRendererTextClass parent_class;
-
- void (* cell_edited) (ESelectNamesRenderer *renderer,
- const gchar *path,
- const gchar *address,
- const gchar *name);
-};
-
-GType e_select_names_renderer_get_type (void);
-GtkCellRenderer *e_select_names_renderer_new (void);
-
-G_END_DECLS
-
-#endif /* __E_SELECT_NAMES_RENDERER_H__ */
diff --git a/calendar/gui/e-tasks.c b/calendar/gui/e-tasks.c
deleted file mode 100644
index 936344de43..0000000000
--- a/calendar/gui/e-tasks.c
+++ /dev/null
@@ -1,1163 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* e-tasks.c
- *
- * Copyright (C) 2001-2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Federico Mena Quintero <federico@ximian.com>
- * Damon Chaplin <damon@ximian.com>
- * Rodrigo Moya <rodrigo@ximian.com>
- */
-
-#include <config.h>
-#include <gnome.h>
-#include <libgnomevfs/gnome-vfs-ops.h>
-#include <gal/util/e-util.h>
-#include <gal/e-table/e-table-scrolled.h>
-#include <gal/menus/gal-view-instance.h>
-#include <gal/menus/gal-view-factory-etable.h>
-#include <gal/menus/gal-view-etable.h>
-#include <gtkhtml/gtkhtml.h>
-#include <gtkhtml/gtkhtml-stream.h>
-
-#include "e-util/e-categories-config.h"
-#include "e-util/e-time-utils.h"
-#include "e-util/e-url.h"
-#include <libecal/e-cal-time-util.h>
-#include "widgets/menus/gal-view-menus.h"
-#include "dialogs/delete-error.h"
-#include "dialogs/task-editor.h"
-#include "cal-search-bar.h"
-#include "calendar-config.h"
-#include "calendar-component.h"
-#include "comp-util.h"
-#include "e-calendar-table-config.h"
-#include "misc.h"
-
-#include "e-tasks.h"
-
-
-/* Private part of the GnomeCalendar structure */
-struct _ETasksPrivate {
- /* The task lists for display */
- GHashTable *clients;
- GList *clients_list;
-
- ECalView *query;
-
- /* The ECalendarTable showing the tasks. */
- GtkWidget *tasks_view;
- ECalendarTableConfig *tasks_view_config;
-
- /* Calendar search bar for tasks */
- GtkWidget *search_bar;
-
- /* The HTML widget to display the task's details */
- GtkWidget *html;
- gchar *current_uid;
-
- /* View instance and the view menus handler */
- GalViewInstance *view_instance;
- GalViewMenus *view_menus;
-
- GList *notifications;
-};
-
-
-static void e_tasks_class_init (ETasksClass *class);
-static void e_tasks_init (ETasks *tasks);
-static void setup_widgets (ETasks *tasks);
-static void e_tasks_destroy (GtkObject *object);
-
-static void cal_opened_cb (ECal *client, ECalendarStatus status, gpointer data);
-static void backend_error_cb (ECal *client, const char *message, gpointer data);
-
-/* Signal IDs */
-enum {
- SELECTION_CHANGED,
- LAST_SIGNAL
-};
-
-static GtkTableClass *parent_class;
-static guint e_tasks_signals[LAST_SIGNAL] = { 0 };
-
-
-E_MAKE_TYPE (e_tasks, "ETasks", ETasks,
- e_tasks_class_init, e_tasks_init,
- GTK_TYPE_TABLE)
-
-/* Converts a time_t to a string, relative to the specified timezone */
-static char *
-timet_to_str_with_zone (time_t t, icaltimezone *zone)
-{
- struct icaltimetype itt;
- struct tm tm;
- char buf[256];
-
- if (t == -1)
- return g_strdup (_("invalid time"));
-
- itt = icaltime_from_timet_with_zone (t, FALSE, zone);
- tm = icaltimetype_to_tm (&itt);
-
- e_time_format_date_and_time (&tm, calendar_config_get_24_hour_format (),
- FALSE, FALSE, buf, sizeof (buf));
- return g_strdup (buf);
-}
-
-static void
-write_html (GtkHTMLStream *stream, ECalComponent *comp)
-{
- ECalComponentText text;
- ECalComponentDateTime dt;
- gchar *buf, *str;
- icaltimezone *current_zone;
- GSList *l;
- icalproperty_status status;
- int *priority_value;
-
- g_return_if_fail (E_IS_CAL_COMPONENT (comp));
-
- str = calendar_config_get_timezone ();
- if (str && str[0]) {
- current_zone = icaltimezone_get_builtin_timezone (str);
- } else
- current_zone = icaltimezone_get_utc_timezone ();
-
- /* write document header */
- e_cal_component_get_summary (comp, &text);
- gtk_html_stream_printf (stream,
- "<HTML><BODY><H1>%s</H1>",
- text.value);
-
- /* write icons for the categories */
- e_cal_component_get_categories_list (comp, &l);
- if (l) {
- GSList *node;
-
- for (node = l; node != NULL; node = node->next) {
- const char *icon_file;
-
- icon_file = e_categories_config_get_icon_file_for ((const char *) node->data);
- if (icon_file) {
- gtk_html_stream_printf (stream, "<IMG ALT=\"%s\" SRC=\"file://%s\">",
- (const char *) node->data, icon_file);
- }
- }
-
- e_cal_component_free_categories_list (l);
- }
-
- /* write summary */
- gtk_html_stream_printf (stream,
- "<BR><BR><BR><TABLE BORDER=\"0\" WIDTH=\"80%%\">"
- "<TR><TD VALIGN=\"TOP\" ALIGN=\"RIGHT\" WIDTH=\"15%%\"><B>%s</B></TD><TD>%s</TD></TR>",
- _("Summary:"), text.value);
-
- /* write start date */
- e_cal_component_get_dtstart (comp, &dt);
- if (dt.value != NULL) {
- buf = timet_to_str_with_zone (icaltime_as_timet (*dt.value), current_zone);
- str = g_locale_to_utf8 (buf, -1, NULL, NULL, NULL);
-
- g_free (buf);
- } else
- str = g_strdup ("");
-
- gtk_html_stream_printf (stream, "<TR><TD VALIGN=\"TOP\" ALIGN=\"RIGHT\"><B>%s</B></TD><TD>%s</TD></TR>",
- _("Start Date:"), str);
-
- e_cal_component_free_datetime (&dt);
- g_free (str);
-
- /* write Due Date */
- e_cal_component_get_due (comp, &dt);
- if (dt.value != NULL) {
- buf = timet_to_str_with_zone (icaltime_as_timet (*dt.value), current_zone);
- str = g_locale_to_utf8 (buf, -1, NULL, NULL, NULL);
-
- g_free (buf);
- } else
- str = g_strdup ("");
-
- gtk_html_stream_printf (stream, "<TR><TD VALIGN=\"TOP\" ALIGN=\"RIGHT\"><B>%s</B></TD><TD>%s</TD></TR>",
- _("Due Date:"), str);
-
- e_cal_component_free_datetime (&dt);
- g_free (str);
-
- /* write status */
- gtk_html_stream_printf (stream, "<TR><TD VALIGN=\"TOP\" ALIGN=\"RIGHT\"><B>%s</B></TD>", _("Status:"));
- e_cal_component_get_status (comp, &status);
- switch (status) {
- case ICAL_STATUS_INPROCESS :
- str = g_strdup (_("In Progress"));
- break;
- case ICAL_STATUS_COMPLETED :
- str = g_strdup (_("Completed"));
- break;
- case ICAL_STATUS_CANCELLED :
- str = g_strdup (_("Cancelled"));
- break;
- case ICAL_STATUS_NONE :
- default :
- str = g_strdup (_("Not Started"));
- break;
- }
-
- gtk_html_stream_printf (stream, "<TD>%s</TD></TR>", str);
- g_free (str);
-
- /* write priority */
- gtk_html_stream_printf (stream, "<TR><TD VALIGN=\"TOP\" ALIGN=\"RIGHT\"><B>%s</B></TD>", _("Priority:"));
- e_cal_component_get_priority (comp, &priority_value);
- if (priority_value) {
- if (*priority_value == 0)
- str = g_strdup ("");
- else if (*priority_value <= 4)
- str = g_strdup (_("High"));
- else if (*priority_value == 5)
- str = g_strdup (_("Normal"));
- else
- str = g_strdup (_("Low"));
-
- gtk_html_stream_printf (stream, "<TD>%s</TD></TR>", str);
-
- g_free (str);
- e_cal_component_free_priority (priority_value);
- } else
- gtk_html_stream_printf (stream, "<TD></TD></TR>");
-
- /* write description and URL */
- gtk_html_stream_printf (stream, "<TR><TD COLSPAN=\"2\"><HR></TD></TR>");
-
- gtk_html_stream_printf (stream, "<TR><TD VALIGN=\"TOP\" ALIGN=\"RIGHT\"><B>%s</B></TD>", _("Description:"));
- e_cal_component_get_description_list (comp, &l);
- if (l) {
- GSList *node;
-
- gtk_html_stream_printf (stream, "<TD>");
-
- for (node = l; node != NULL; node = node->next) {
- gint i;
- GString *str = g_string_new ("");;
-
- text = * (ECalComponentText *) node->data;
- for (i = 0; i < strlen (text.value ? text.value : 0); i++) {
- if (text.value[i] == '\n')
- str = g_string_append (str, "<BR>");
- else if (text.value[i] == '<')
- str = g_string_append (str, "&lt;");
- else if (text.value[i] == '>')
- str = g_string_append (str, "&gt;");
- else
- str = g_string_append_c (str, text.value[i]);
- }
-
- gtk_html_stream_printf (stream, str->str);
- g_string_free (str, TRUE);
- }
-
- gtk_html_stream_printf (stream, "</TD></TR>");
-
- e_cal_component_free_text_list (l);
- } else
- gtk_html_stream_printf (stream, "<TD></TD></TR>");
-
- /* URL */
- gtk_html_stream_printf (stream, "<TR><TD VALIGN=\"TOP\" ALIGN=\"RIGHT\"><B>%s</B></TD>", _("Web Page:"));
- e_cal_component_get_url (comp, (const char **) &str);
- if (str)
- gtk_html_stream_printf (stream, "<TD><A HREF=\"%s\">%s</A></TD></TR>", str, str);
- else
- gtk_html_stream_printf (stream, "<TD></TD></TR>");
-
- gtk_html_stream_printf (stream, "</TABLE>");
-
- /* close document */
- gtk_html_stream_printf (stream, "</BODY></HTML>");
-}
-
-static void
-on_link_clicked (GtkHTML *html, const char *url, gpointer data)
-{
- GError *err = NULL;
-
- gnome_url_show (url, &err);
-
- if (err) {
- g_warning ("gnome_url_show: %s", err->message);
- g_error_free (err);
- }
-}
-
-/* Callback used when the cursor changes in the table */
-static void
-table_cursor_change_cb (ETable *etable, int row, gpointer data)
-{
- ETasks *tasks;
- ETasksPrivate *priv;
- int n_selected;
-
- tasks = E_TASKS (data);
- priv = tasks->priv;
-
- n_selected = e_table_selected_count (etable);
-
- /* update the HTML widget */
- if (n_selected == 1) {
- GtkHTMLStream *stream;
- ECalModel *model;
- ECalModelComponent *comp_data;
- ECalComponent *comp;
- const char *uid;
-
- model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->tasks_view));
-
- stream = gtk_html_begin (GTK_HTML (priv->html));
-
- comp_data = e_cal_model_get_component_at (model, e_table_get_cursor_row (etable));
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (comp_data->icalcomp));
- write_html (stream, comp);
-
- gtk_html_stream_close (stream, GTK_HTML_STREAM_OK);
-
- e_cal_component_get_uid (comp, &uid);
- if (priv->current_uid)
- g_free (priv->current_uid);
- priv->current_uid = g_strdup (uid);
-
- g_object_unref (comp);
- } else
- gtk_html_load_empty (GTK_HTML (priv->html));
-}
-
-/* Callback used when the selection changes in the table. */
-static void
-table_selection_change_cb (ETable *etable, gpointer data)
-{
- ETasks *tasks;
- int n_selected;
-
- tasks = E_TASKS (data);
-
- n_selected = e_table_selected_count (etable);
- gtk_signal_emit (GTK_OBJECT (tasks), e_tasks_signals[SELECTION_CHANGED],
- n_selected);
-}
-
-/* Callback used when the sexp in the search bar changes */
-static void
-search_bar_sexp_changed_cb (CalSearchBar *cal_search, const char *sexp, gpointer data)
-{
- ETasks *tasks;
- ETasksPrivate *priv;
- ECalModel *model;
-
- tasks = E_TASKS (data);
- priv = tasks->priv;
-
- model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->tasks_view));
- e_cal_model_set_query (model, sexp);
-}
-
-/* Callback used when the selected category in the search bar changes */
-static void
-search_bar_category_changed_cb (CalSearchBar *cal_search, const char *category, gpointer data)
-{
- ETasks *tasks;
- ETasksPrivate *priv;
- ECalModel *model;
-
- tasks = E_TASKS (data);
- priv = tasks->priv;
-
- model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->tasks_view));
- e_cal_model_set_default_category (model, category);
-}
-
-/* Callback used when the user selects a URL in the HTML widget */
-static void
-url_requested_cb (GtkHTML *html, const char *url, GtkHTMLStream *stream, gpointer data)
-{
- if (!strncmp ("file:///", url, strlen ("file:///"))) {
- GnomeVFSHandle *handle;
- GnomeVFSResult result;
- char buffer[4096];
-
- if (gnome_vfs_open (&handle, url, GNOME_VFS_OPEN_READ) == GNOME_VFS_OK) {
- do {
- GnomeVFSFileSize bread;
-
- result = gnome_vfs_read (handle, buffer, sizeof (buffer), &bread);
- if (result == GNOME_VFS_OK)
- gtk_html_stream_write (stream, buffer, bread);
- } while (result == GNOME_VFS_OK);
-
- gnome_vfs_close (handle);
- }
- }
-}
-
-static gboolean
-vpaned_resized_cb (GtkWidget *widget, GdkEventButton *event, ETasks *tasks)
-{
- calendar_config_set_task_vpane_pos (gtk_paned_get_position (GTK_PANED (widget)));
-
- return FALSE;
-}
-
-static void
-set_timezone (ETasks *tasks)
-{
- ETasksPrivate *priv;
- char *location;
- icaltimezone *zone;
- GList *l;
-
- priv = tasks->priv;
-
- location = calendar_config_get_timezone ();
- zone = icaltimezone_get_builtin_timezone (location);
- g_free (location);
-
- if (!zone)
- zone = icaltimezone_get_utc_timezone ();
-
- for (l = priv->clients_list; l != NULL; l = l->next) {
- ECal *client = l->data;
-
- if (e_cal_get_load_state (client) == E_CAL_LOAD_LOADED)
- /* FIXME Error checking */
- e_cal_set_default_timezone (client, zone, NULL);
- }
-}
-
-static void
-timezone_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
-{
- ETasks *tasks = data;
-
- set_timezone (tasks);
-}
-
-static void
-setup_config (ETasks *tasks)
-{
- ETasksPrivate *priv;
- guint not;
-
- priv = tasks->priv;
-
- /* Timezone */
- set_timezone (tasks);
-
- not = calendar_config_add_notification_timezone (timezone_changed_cb, tasks);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
-}
-
-#define E_TASKS_TABLE_DEFAULT_STATE \
- "<?xml version=\"1.0\"?>" \
- "<ETableState>" \
- "<column source=\"13\"/>" \
- "<column source=\"14\"/>" \
- "<column source=\"9\"/>" \
- "<column source=\"5\"/>" \
- "<grouping/>" \
- "</ETableState>"
-
-static void
-setup_widgets (ETasks *tasks)
-{
- ETasksPrivate *priv;
- ETable *etable;
- GtkWidget *paned, *scroll;
-
- priv = tasks->priv;
-
- priv->search_bar = cal_search_bar_new ();
- g_signal_connect (priv->search_bar, "sexp_changed",
- G_CALLBACK (search_bar_sexp_changed_cb), tasks);
- g_signal_connect (priv->search_bar, "category_changed",
- G_CALLBACK (search_bar_category_changed_cb), tasks);
-
- gtk_table_attach (GTK_TABLE (tasks), priv->search_bar, 0, 1, 0, 1,
- GTK_EXPAND | GTK_FILL | GTK_SHRINK, 0, 0, 0);
- gtk_widget_show (priv->search_bar);
-
- /* add the paned widget for the task list and task detail areas */
- paned = gtk_vpaned_new ();
- gtk_paned_set_position (GTK_PANED (paned), calendar_config_get_task_vpane_pos ());
- g_signal_connect (G_OBJECT (paned), "button_release_event",
- G_CALLBACK (vpaned_resized_cb), tasks);
- gtk_table_attach (GTK_TABLE (tasks), paned, 0, 1, 1, 2,
- GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
- gtk_widget_show (paned);
-
- /* create the task list */
- priv->tasks_view = e_calendar_table_new ();
- priv->tasks_view_config = e_calendar_table_config_new (E_CALENDAR_TABLE (priv->tasks_view));
-
- etable = e_table_scrolled_get_table (
- E_TABLE_SCROLLED (E_CALENDAR_TABLE (priv->tasks_view)->etable));
- e_table_set_state (etable, E_TASKS_TABLE_DEFAULT_STATE);
- gtk_paned_add1 (GTK_PANED (paned), priv->tasks_view);
- gtk_widget_show (priv->tasks_view);
-
- g_signal_connect (etable, "cursor_change", G_CALLBACK (table_cursor_change_cb), tasks);
- g_signal_connect (etable, "selection_change", G_CALLBACK (table_selection_change_cb), tasks);
-
- /* create the task detail */
- priv->html = gtk_html_new ();
- gtk_html_set_default_content_type (GTK_HTML (priv->html), "charset=utf-8");
- gtk_html_load_empty (GTK_HTML (priv->html));
-
- g_signal_connect (G_OBJECT (priv->html), "url_requested",
- G_CALLBACK (url_requested_cb), NULL);
- g_signal_connect (G_OBJECT (priv->html), "link_clicked",
- G_CALLBACK (on_link_clicked), tasks);
-
- gtk_widget_pop_colormap ();
- scroll = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll),
- GTK_POLICY_AUTOMATIC,
- GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scroll), GTK_SHADOW_IN);
- gtk_container_add (GTK_CONTAINER (scroll), priv->html);
- gtk_paned_add2 (GTK_PANED (paned), scroll);
- gtk_widget_show_all (scroll);
-}
-
-/* Class initialization function for the gnome calendar */
- static void
-e_tasks_class_init (ETasksClass *class)
-{
- GtkObjectClass *object_class;
-
- object_class = (GtkObjectClass *) class;
-
- parent_class = gtk_type_class (GTK_TYPE_TABLE);
-
- e_tasks_signals[SELECTION_CHANGED] =
- gtk_signal_new ("selection_changed",
- GTK_RUN_LAST,
- G_TYPE_FROM_CLASS (object_class),
- GTK_SIGNAL_OFFSET (ETasksClass, selection_changed),
- gtk_marshal_NONE__INT,
- GTK_TYPE_NONE, 1,
- GTK_TYPE_INT);
-
- object_class->destroy = e_tasks_destroy;
-
- class->selection_changed = NULL;
-}
-
-
-/* Object initialization function for the gnome calendar */
-static void
-e_tasks_init (ETasks *tasks)
-{
- ETasksPrivate *priv;
-
- priv = g_new0 (ETasksPrivate, 1);
- tasks->priv = priv;
-
- setup_config (tasks);
- setup_widgets (tasks);
-
- priv->clients = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref);
- priv->query = NULL;
- priv->view_instance = NULL;
- priv->view_menus = NULL;
- priv->current_uid = NULL;
-}
-
-/* Callback used when the set of categories changes in the calendar client */
-static void
-client_categories_changed_cb (ECal *client, GPtrArray *categories, gpointer data)
-{
- ETasks *tasks;
- ETasksPrivate *priv;
-
- tasks = E_TASKS (data);
- priv = tasks->priv;
-
- cal_search_bar_set_categories (CAL_SEARCH_BAR (priv->search_bar), categories);
-}
-
-static void
-client_obj_updated_cb (ECal *client, const char *uid, gpointer data)
-{
- ETasks *tasks;
- ETasksPrivate *priv;
-
- tasks = E_TASKS (data);
- priv = tasks->priv;
-
- if (priv->current_uid) {
- if (!strcmp (uid, priv->current_uid)) {
- ETable *etable;
-
- etable = e_table_scrolled_get_table (
- E_TABLE_SCROLLED (E_CALENDAR_TABLE (priv->tasks_view)->etable));
- table_cursor_change_cb (etable, 0, tasks);
- }
- }
-}
-
-
-GtkWidget *
-e_tasks_new (void)
-{
- ETasks *tasks;
-
- tasks = g_object_new (e_tasks_get_type (), NULL);
-
- return GTK_WIDGET (tasks);
-}
-
-
-void
-e_tasks_set_ui_component (ETasks *tasks,
- BonoboUIComponent *ui_component)
-{
- g_return_if_fail (E_IS_TASKS (tasks));
- g_return_if_fail (ui_component == NULL || BONOBO_IS_UI_COMPONENT (ui_component));
-
- e_search_bar_set_ui_component (E_SEARCH_BAR (tasks->priv->search_bar), ui_component);
-}
-
-
-static void
-e_tasks_destroy (GtkObject *object)
-{
- ETasks *tasks;
- ETasksPrivate *priv;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (E_IS_TASKS (object));
-
- tasks = E_TASKS (object);
- priv = tasks->priv;
-
- if (priv) {
- GList *l;
-
- /* disconnect from signals on all the clients */
- for (l = priv->clients_list; l != NULL; l = l->next) {
- g_signal_handlers_disconnect_matched (l->data, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, tasks);
- }
-
- g_hash_table_destroy (priv->clients);
- g_list_free (priv->clients_list);
-
- if (priv->current_uid) {
- g_free (priv->current_uid);
- priv->current_uid = NULL;
- }
-
- if (priv->tasks_view_config) {
- g_object_unref (priv->tasks_view_config);
- priv->tasks_view_config = NULL;
- }
-
- for (l = priv->notifications; l; l = l->next)
- calendar_config_remove_notification (GPOINTER_TO_UINT (l->data));
- priv->notifications = NULL;
-
- g_free (priv);
- tasks->priv = NULL;
- }
-
- if (GTK_OBJECT_CLASS (parent_class)->destroy)
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
-}
-
-static void
-set_status_message (ETasks *tasks, const char *message)
-{
- ETasksPrivate *priv;
-
- priv = tasks->priv;
-
- e_calendar_table_set_status_message (E_CALENDAR_TABLE (priv->tasks_view), message);
-}
-
-/* Displays an error to indicate that loading a calendar failed */
-static void
-load_error (ETasks *tasks,
- const char *uri)
-{
- char *msg;
- char *urinopwd;
-
- urinopwd = get_uri_without_password (uri);
- msg = g_strdup_printf (_("Could not load the tasks in `%s'"), urinopwd);
- gnome_error_dialog_parented (msg, GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (tasks))));
- g_free (msg);
- g_free (urinopwd);
-}
-
-/* Displays an error to indicate that the specified URI method is not supported */
-static void
-method_error (ETasks *tasks,
- const char *uri)
-{
- char *msg;
- char *urinopwd;
-
- urinopwd = get_uri_without_password (uri);
- msg = g_strdup_printf (_("The method required to load `%s' is not supported"), urinopwd);
- gnome_error_dialog_parented (msg, GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (tasks))));
- g_free (msg);
- g_free (urinopwd);
-}
-
-/* Displays an error to indicate permission problems */
-static void
-permission_error (ETasks *tasks, const char *uri)
-{
- char *msg;
- char *urinopwd;
-
- urinopwd = get_uri_without_password (uri);
- msg = g_strdup_printf (_("You don't have permission to open the folder in `%s'"), urinopwd);
- gnome_error_dialog_parented (msg, GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (tasks))));
- g_free (msg);
- g_free (urinopwd);
-}
-
-/* Callback from the calendar client when a calendar is opened */
-static void
-cal_opened_cb (ECal *client,
- ECalendarStatus status,
- gpointer data)
-{
- ETasks *tasks;
- ETasksPrivate *priv;
-
- tasks = E_TASKS (data);
- priv = tasks->priv;
-
- set_status_message (tasks, NULL);
-
- switch (status) {
- case E_CALENDAR_STATUS_OK:
- /* Everything is OK */
- set_timezone (tasks);
- return;
-
- case E_CALENDAR_STATUS_OTHER_ERROR:
- load_error (tasks, e_cal_get_uri (client));
- break;
-
- case E_CALENDAR_STATUS_NO_SUCH_CALENDAR:
- /* bullshit; we did not specify only_if_exists */
- g_assert_not_reached ();
- return;
-
- case E_CALENDAR_STATUS_PROTOCOL_NOT_SUPPORTED:
- method_error (tasks, e_cal_get_uri (client));
- break;
-
- case E_CALENDAR_STATUS_PERMISSION_DENIED:
- permission_error (tasks, e_cal_get_uri (client));
- break;
-
- default:
- g_assert_not_reached ();
- }
-}
-
-/* Callback from the calendar client when an error occurs in the backend */
-static void
-backend_error_cb (ECal *client, const char *message, gpointer data)
-{
- ETasks *tasks;
- ETasksPrivate *priv;
- char *errmsg;
- char *urinopwd;
-
- tasks = E_TASKS (data);
- priv = tasks->priv;
-
- urinopwd = get_uri_without_password (e_cal_get_uri (client));
- errmsg = g_strdup_printf (_("Error on %s:\n %s"), urinopwd, message);
- gnome_error_dialog_parented (errmsg, GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (tasks))));
- g_free (errmsg);
- g_free (urinopwd);
-}
-
-void
-e_tasks_new_task (ETasks *tasks)
-{
- ETasksPrivate *priv;
- TaskEditor *tedit;
- ECalComponent *comp;
- const char *category;
- ECal *ecal;
-
- g_return_if_fail (E_IS_TASKS (tasks));
-
- priv = tasks->priv;
-
- /* FIXME What to do about no default client */
- ecal = e_tasks_get_default_client (tasks);
- if (!ecal)
- return;
-
- comp = cal_comp_task_new_with_defaults (ecal);
-
- category = cal_search_bar_get_category (CAL_SEARCH_BAR (priv->search_bar));
- e_cal_component_set_categories (comp, category);
-
- tedit = task_editor_new (ecal);
- comp_editor_edit_comp (COMP_EDITOR (tedit), comp);
- g_object_unref (comp);
-
- comp_editor_focus (COMP_EDITOR (tedit));
-}
-
-gboolean
-e_tasks_add_todo_uri (ETasks *tasks, const char *str_uri)
-{
- ETasksPrivate *priv;
- ECal *client;
- ECalModel *model;
-
- g_return_val_if_fail (tasks != NULL, FALSE);
- g_return_val_if_fail (E_IS_TASKS (tasks), FALSE);
- g_return_val_if_fail (str_uri != NULL, FALSE);
-
- priv = tasks->priv;
-
- client = g_hash_table_lookup (priv->clients, str_uri);
- if (client)
- return TRUE;
-
- client = e_cal_new_from_uri (str_uri, CALOBJ_TYPE_TODO);
- g_hash_table_insert (priv->clients, g_strdup (str_uri), client);
- priv->clients_list = g_list_prepend (priv->clients_list, client);
-
- g_signal_connect (G_OBJECT (client), "backend_error", G_CALLBACK (backend_error_cb), tasks);
- g_signal_connect (G_OBJECT (client), "categories_changed", G_CALLBACK (client_categories_changed_cb), tasks);
-
- if (!e_cal_open (client, FALSE, NULL)) {
- g_hash_table_remove (priv->clients, str_uri);
- priv->clients_list = g_list_prepend (priv->clients_list, client);
- g_signal_handlers_disconnect_matched (client, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, tasks);
-
- return FALSE;
- }
-
- model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->tasks_view));
- e_cal_model_add_client (model, client);
-
- return TRUE;
-}
-
-gboolean
-e_tasks_remove_todo_uri (ETasks *tasks, const char *str_uri)
-{
- ETasksPrivate *priv;
- ECal *client;
- ECalModel *model;
-
- g_return_val_if_fail (tasks != NULL, FALSE);
- g_return_val_if_fail (E_IS_TASKS (tasks), FALSE);
- g_return_val_if_fail (str_uri != NULL, FALSE);
-
- priv = tasks->priv;
-
- client = g_hash_table_lookup (priv->clients, str_uri);
- if (!client)
- return TRUE;
-
- g_hash_table_remove (priv->clients, str_uri);
- priv->clients_list = g_list_remove (priv->clients_list, client);
- g_signal_handlers_disconnect_matched (client, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, tasks);
-
- model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->tasks_view));
- e_cal_model_remove_client (model, client);
-
- return TRUE;
-}
-
-gboolean
-e_tasks_set_default_uri (ETasks *tasks, const char *str_uri)
-{
- ETasksPrivate *priv;
- ECal *ecal;
- ECalModel *model;
-
- g_return_val_if_fail (tasks != NULL, FALSE);
- g_return_val_if_fail (E_IS_TASKS (tasks), FALSE);
- g_return_val_if_fail (str_uri != NULL, FALSE);
-
- priv = tasks->priv;
-
- ecal = g_hash_table_lookup (priv->clients, str_uri);
- if (!ecal)
- return FALSE;
-
- model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->tasks_view));
- e_cal_model_set_default_client (model, ecal);
-
- return TRUE;
-}
-
-ECal *
-e_tasks_get_default_client (ETasks *tasks)
-{
- ETasksPrivate *priv;
-
- g_return_val_if_fail (tasks != NULL, NULL);
- g_return_val_if_fail (E_IS_TASKS (tasks), NULL);
-
- priv = tasks->priv;
-
- return e_cal_model_get_default_client (e_calendar_table_get_model (E_CALENDAR_TABLE (priv->tasks_view)));
-}
-
-/**
- * e_tasks_complete_selected:
- * @tasks: A tasks control widget
- *
- * Marks the selected tasks complete
- **/
-void
-e_tasks_complete_selected (ETasks *tasks)
-{
- ETasksPrivate *priv;
- ECalendarTable *cal_table;
-
- g_return_if_fail (tasks != NULL);
- g_return_if_fail (E_IS_TASKS (tasks));
-
- priv = tasks->priv;
-
- cal_table = E_CALENDAR_TABLE (priv->tasks_view);
-
- set_status_message (tasks, _("Completing tasks..."));
- e_calendar_table_complete_selected (cal_table);
- set_status_message (tasks, NULL);
-}
-
-/**
- * e_tasks_delete_selected:
- * @tasks: A tasks control widget.
- *
- * Deletes the selected tasks in the task list.
- **/
-void
-e_tasks_delete_selected (ETasks *tasks)
-{
- ETasksPrivate *priv;
- ECalendarTable *cal_table;
-
- g_return_if_fail (tasks != NULL);
- g_return_if_fail (E_IS_TASKS (tasks));
-
- priv = tasks->priv;
-
- cal_table = E_CALENDAR_TABLE (priv->tasks_view);
- set_status_message (tasks, _("Deleting selected objects..."));
- e_calendar_table_delete_selected (cal_table);
- set_status_message (tasks, NULL);
-}
-
-/**
- * e_tasks_expunge:
- * @tasks: A tasks control widget
- *
- * Removes all tasks marked as completed
- **/
-void
-e_tasks_delete_completed (ETasks *tasks)
-{
- ETasksPrivate *priv;
- char *sexp;
- GList *l;
-
- g_return_if_fail (tasks != NULL);
- g_return_if_fail (E_IS_TASKS (tasks));
-
- priv = tasks->priv;
-
- sexp = g_strdup ("(is-completed?)");
-
- set_status_message (tasks, _("Expunging"));
-
- for (l = priv->clients_list; l != NULL; l = l->next) {
- ECal *client = l->data;
- GList *objects, *m;
- gboolean read_only = TRUE;
-
- e_cal_is_read_only (client, &read_only, NULL);
- if (read_only)
- continue;
-
- if (!e_cal_get_object_list (client, sexp, &objects, NULL)) {
- g_warning (G_STRLOC ": Could not get the objects");
-
- continue;
- }
-
- for (m = objects; m; m = m->next) {
- /* FIXME Better error handling */
- e_cal_remove_object (client, icalcomponent_get_uid (m->data), NULL);
- }
- }
-
- set_status_message (tasks, NULL);
-
- g_free (sexp);
-}
-
-/* Callback used from the view collection when we need to display a new view */
-static void
-display_view_cb (GalViewInstance *instance, GalView *view, gpointer data)
-{
- ETasks *tasks;
-
- tasks = E_TASKS (data);
-
- if (GAL_IS_VIEW_ETABLE (view)) {
- gal_view_etable_attach_table (GAL_VIEW_ETABLE (view), e_table_scrolled_get_table (E_TABLE_SCROLLED (E_CALENDAR_TABLE (tasks->priv->tasks_view)->etable)));
- }
-}
-
-/**
- * e_tasks_setup_view_menus:
- * @tasks: A tasks widget.
- * @uic: UI controller to use for the menus.
- *
- * Sets up the #GalView menus for a tasks control. This function should be
- * called from the Bonobo control activation callback for this tasks control.
- * Also, the menus should be discarded using e_tasks_discard_view_menus().
- **/
-void
-e_tasks_setup_view_menus (ETasks *tasks, BonoboUIComponent *uic)
-{
- ETasksPrivate *priv;
- GalViewFactory *factory;
- ETableSpecification *spec;
- char *dir;
- static GalViewCollection *collection = NULL;
-
- g_return_if_fail (tasks != NULL);
- g_return_if_fail (E_IS_TASKS (tasks));
- g_return_if_fail (uic != NULL);
- g_return_if_fail (BONOBO_IS_UI_COMPONENT (uic));
-
- priv = tasks->priv;
-
- g_return_if_fail (priv->view_instance == NULL);
-
- g_assert (priv->view_instance == NULL);
- g_assert (priv->view_menus == NULL);
-
- /* Create the view instance */
-
- if (collection == NULL) {
- collection = gal_view_collection_new ();
-
- gal_view_collection_set_title (collection, _("Tasks"));
-
- dir = gnome_util_prepend_user_home ("/evolution/views/tasks/");
- gal_view_collection_set_storage_directories (collection,
- EVOLUTION_GALVIEWSDIR "/tasks/",
- dir);
- g_free (dir);
-
- /* Create the views */
-
- spec = e_table_specification_new ();
- e_table_specification_load_from_file (spec,
- EVOLUTION_ETSPECDIR "/e-calendar-table.etspec");
-
- factory = gal_view_factory_etable_new (spec);
- g_object_unref (spec);
- gal_view_collection_add_factory (collection, factory);
- g_object_unref (factory);
-
- /* Load the collection and create the menus */
-
- gal_view_collection_load (collection);
- }
-
- priv->view_instance = gal_view_instance_new (collection, e_cal_get_uri (e_tasks_get_default_client (tasks)));
-
- priv->view_menus = gal_view_menus_new (priv->view_instance);
- gal_view_menus_apply (priv->view_menus, uic, NULL);
- g_signal_connect (priv->view_instance, "display_view", G_CALLBACK (display_view_cb), tasks);
- display_view_cb (priv->view_instance, gal_view_instance_get_current_view (priv->view_instance), tasks);
-}
-
-/**
- * e_tasks_discard_view_menus:
- * @tasks: A tasks widget.
- *
- * Discards the #GalView menus used by a tasks control. This function should be
- * called from the Bonobo control deactivation callback for this tasks control.
- * The menus should have been set up with e_tasks_setup_view_menus().
- **/
-void
-e_tasks_discard_view_menus (ETasks *tasks)
-{
- ETasksPrivate *priv;
-
- g_return_if_fail (tasks != NULL);
- g_return_if_fail (E_IS_TASKS (tasks));
-
- priv = tasks->priv;
-
- g_return_if_fail (priv->view_instance != NULL);
-
- g_assert (priv->view_instance != NULL);
- g_assert (priv->view_menus != NULL);
-
- g_object_unref (priv->view_instance);
- priv->view_instance = NULL;
-
- g_object_unref (priv->view_menus);
- priv->view_menus = NULL;
-}
-
-/**
- * e_tasks_get_calendar_table:
- * @tasks: A tasks widget.
- *
- * Queries the #ECalendarTable contained in a tasks widget.
- *
- * Return value: The #ECalendarTable that the tasks widget uses to display its
- * information.
- **/
-ECalendarTable *
-e_tasks_get_calendar_table (ETasks *tasks)
-{
- ETasksPrivate *priv;
-
- g_return_val_if_fail (tasks != NULL, NULL);
- g_return_val_if_fail (E_IS_TASKS (tasks), NULL);
-
- priv = tasks->priv;
- return E_CALENDAR_TABLE (priv->tasks_view);
-}
diff --git a/calendar/gui/e-tasks.h b/calendar/gui/e-tasks.h
deleted file mode 100644
index 10e79ef8c3..0000000000
--- a/calendar/gui/e-tasks.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* e-tasks.h
- *
- * Copyright (C) 2001 Ximian, Inc.
- * Copyright (C) 2001 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Federico Mena Quintero <federico@ximian.com>
- * Damon Chaplin <damon@ximian.com>
- */
-
-#ifndef _E_TASKS_H_
-#define _E_TASKS_H_
-
-#include <bonobo/bonobo-ui-component.h>
-#include <gtk/gtktable.h>
-#include <libecal/e-cal.h>
-#include "e-calendar-table.h"
-
-#define E_TYPE_TASKS (e_tasks_get_type ())
-#define E_TASKS(obj) (GTK_CHECK_CAST ((obj), E_TYPE_TASKS, ETasks))
-#define E_TASKS_CLASS(klass) (GTK_CHECK_CAST_CLASS ((klass), E_TYPE_TASKS, \
- ETasksClass))
-#define E_IS_TASKS(obj) (GTK_CHECK_TYPE ((obj), E_TYPE_TASKS))
-#define E_IS_TASKS_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), E_TYPE_TASKS))
-
-typedef struct _ETasks ETasks;
-typedef struct _ETasksClass ETasksClass;
-typedef struct _ETasksPrivate ETasksPrivate;
-
-struct _ETasks {
- GtkTable table;
-
- /* Private data */
- ETasksPrivate *priv;
-};
-
-struct _ETasksClass {
- GtkTableClass parent_class;
-
- /* Notification signals */
- void (* selection_changed) (ETasks *tasks, int n_selected);
-};
-
-
-GtkType e_tasks_get_type (void);
-GtkWidget *e_tasks_construct (ETasks *tasks);
-
-GtkWidget *e_tasks_new (void);
-
-void e_tasks_set_ui_component (ETasks *tasks,
- BonoboUIComponent *ui_component);
-
-gboolean e_tasks_add_todo_uri (ETasks *tasks, const char *str_uri);
-gboolean e_tasks_remove_todo_uri (ETasks *tasks, const char *str_uri);
-gboolean e_tasks_set_default_uri (ETasks *tasks, const char *str_uri);
-ECal *e_tasks_get_default_client (ETasks *tasks);
-
-void e_tasks_new_task (ETasks *tasks);
-void e_tasks_complete_selected (ETasks *tasks);
-void e_tasks_delete_selected (ETasks *tasks);
-void e_tasks_delete_completed (ETasks *tasks);
-
-
-void e_tasks_setup_view_menus (ETasks *tasks, BonoboUIComponent *uic);
-void e_tasks_discard_view_menus (ETasks *tasks);
-
-ECalendarTable *e_tasks_get_calendar_table (ETasks *tasks);
-
-#endif /* _E_TASKS_H_ */
diff --git a/calendar/gui/e-timezone-entry.c b/calendar/gui/e-timezone-entry.c
deleted file mode 100644
index 6f6a965f7a..0000000000
--- a/calendar/gui/e-timezone-entry.c
+++ /dev/null
@@ -1,320 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Author :
- * Damon Chaplin <damon@ximian.com>
- *
- * Copyright 2001, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-/*
- * ETimezoneEntry - a field for setting a timezone. It shows the timezone in
- * a GtkEntry with a '...' button beside it which shows a dialog for changing
- * the timezone. The dialog contains a map of the world with a point for each
- * timezone, and an option menu as an alternative way of selecting the
- * timezone.
- */
-
-#include <config.h>
-#include <gtk/gtkbutton.h>
-#include <gtk/gtkentry.h>
-#include <gtk/gtksignal.h>
-#include <gnome.h>
-#include <gal/util/e-util.h>
-#include <widgets/e-timezone-dialog/e-timezone-dialog.h>
-#include "e-timezone-entry.h"
-
-/* The timezone icon for the button. */
-#include "art/timezone-16.xpm"
-
-struct _ETimezoneEntryPrivate {
- /* The current timezone, set in e_timezone_entry_set_timezone()
- or from the timezone dialog. Note that we don't copy it or
- use a ref count - we assume it is never destroyed for the
- lifetime of this widget. */
- icaltimezone *zone;
-
- /* This can be set to the default timezone. If the current timezone
- setting in the ETimezoneEntry matches this, then the entry field
- is hidden. This makes the user interface simpler. */
- icaltimezone *default_zone;
-
- GtkWidget *entry;
- GtkWidget *button;
-};
-
-
-enum {
- CHANGED,
- LAST_SIGNAL
-};
-
-
-static void e_timezone_entry_class_init (ETimezoneEntryClass *class);
-static void e_timezone_entry_init (ETimezoneEntry *tentry);
-static void e_timezone_entry_destroy (GtkObject *object);
-
-static gboolean e_timezone_entry_mnemonic_activate (GtkWidget *widget,
- gboolean group_cycling);
-static void on_entry_changed (GtkEntry *entry,
- ETimezoneEntry *tentry);
-static void on_button_clicked (GtkWidget *widget,
- ETimezoneEntry *tentry);
-
-static void e_timezone_entry_set_entry (ETimezoneEntry *tentry);
-
-
-static GtkHBoxClass *parent_class;
-static guint timezone_entry_signals[LAST_SIGNAL] = { 0 };
-
-E_MAKE_TYPE (e_timezone_entry, "ETimezoneEntry", ETimezoneEntry,
- e_timezone_entry_class_init, e_timezone_entry_init, GTK_TYPE_HBOX);
-
-static void
-e_timezone_entry_class_init (ETimezoneEntryClass *class)
-{
- GtkObjectClass *object_class = (GtkObjectClass *) class;
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class) ;
-
- object_class = (GtkObjectClass*) class;
-
- parent_class = g_type_class_peek_parent (class);
-
- widget_class->mnemonic_activate = e_timezone_entry_mnemonic_activate;
- timezone_entry_signals[CHANGED] =
- gtk_signal_new ("changed",
- GTK_RUN_LAST,
- G_TYPE_FROM_CLASS (object_class),
- GTK_SIGNAL_OFFSET (ETimezoneEntryClass,
- changed),
- gtk_marshal_NONE__NONE,
- GTK_TYPE_NONE, 0);
-
-
- object_class->destroy = e_timezone_entry_destroy;
-
- class->changed = NULL;
-}
-
-
-static void
-e_timezone_entry_init (ETimezoneEntry *tentry)
-{
- ETimezoneEntryPrivate *priv;
- GdkColormap *colormap;
- GdkPixmap *timezone_icon;
- GdkBitmap *timezone_mask;
- GtkWidget *pixmap;
-
- tentry->priv = priv = g_new0 (ETimezoneEntryPrivate, 1);
-
- priv->zone = NULL;
- priv->default_zone = NULL;
-
- priv->entry = gtk_entry_new ();
- gtk_entry_set_editable (GTK_ENTRY (priv->entry), FALSE);
- /*gtk_widget_set_usize (priv->date_entry, 90, 0);*/
- gtk_box_pack_start (GTK_BOX (tentry), priv->entry, TRUE, TRUE, 6);
- gtk_widget_show (priv->entry);
- g_signal_connect (priv->entry, "changed", G_CALLBACK (on_entry_changed), tentry);
-
- priv->button = gtk_button_new ();
- g_signal_connect (priv->button, "clicked", G_CALLBACK (on_button_clicked), tentry);
- gtk_box_pack_start (GTK_BOX (tentry), priv->button, FALSE, FALSE, 6);
- gtk_widget_show (priv->button);
-
- colormap = gtk_widget_get_colormap (priv->button);
- timezone_icon = gdk_pixmap_colormap_create_from_xpm_d (NULL, colormap, &timezone_mask, NULL, timezone_16_xpm);
-
- pixmap = gtk_pixmap_new (timezone_icon, timezone_mask);
- gtk_container_add (GTK_CONTAINER (priv->button), pixmap);
- gtk_widget_show (pixmap);
-}
-
-
-/**
- * e_timezone_entry_new:
- *
- * Description: Creates a new #ETimezoneEntry widget which can be used
- * to provide an easy to use way for entering dates and times.
- *
- * Returns: a new #ETimezoneEntry widget.
- */
-GtkWidget *
-e_timezone_entry_new (void)
-{
- ETimezoneEntry *tentry;
-
- tentry = g_object_new (e_timezone_entry_get_type (), NULL);
-
- GTK_WIDGET_SET_FLAGS (GTK_WIDGET(tentry), GTK_CAN_FOCUS);
-
- return GTK_WIDGET (tentry);
-}
-
-
-static void
-e_timezone_entry_destroy (GtkObject *object)
-{
- ETimezoneEntry *tentry;
- ETimezoneEntryPrivate *priv;
-
- g_return_if_fail (E_IS_TIMEZONE_ENTRY (object));
-
- tentry = E_TIMEZONE_ENTRY (object);
- priv = tentry->priv;
-
- g_free (tentry->priv);
- tentry->priv = NULL;
-
- if (GTK_OBJECT_CLASS (parent_class)->destroy)
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
-}
-
-
-/* The arrow button beside the date field has been clicked, so we show the
- popup with the ECalendar in. */
-static void
-on_button_clicked (GtkWidget *widget,
- ETimezoneEntry *tentry)
-{
- ETimezoneEntryPrivate *priv;
- ETimezoneDialog *timezone_dialog;
- GtkWidget *dialog;
-
- priv = tentry->priv;
-
- timezone_dialog = e_timezone_dialog_new ();
-
- e_timezone_dialog_set_timezone (timezone_dialog, priv->zone);
-
- dialog = e_timezone_dialog_get_toplevel (timezone_dialog);
-
- if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) {
- priv->zone = e_timezone_dialog_get_timezone (timezone_dialog);
- e_timezone_entry_set_entry (tentry);
- }
-
- g_object_unref (timezone_dialog);
-}
-
-
-static void
-on_entry_changed (GtkEntry *entry,
- ETimezoneEntry *tentry)
-{
- gtk_signal_emit (GTK_OBJECT (tentry), timezone_entry_signals[CHANGED]);
-}
-
-
-icaltimezone*
-e_timezone_entry_get_timezone (ETimezoneEntry *tentry)
-{
- ETimezoneEntryPrivate *priv;
-
- g_return_val_if_fail (E_IS_TIMEZONE_ENTRY (tentry), NULL);
-
- priv = tentry->priv;
-
- return priv->zone;
-}
-
-
-void
-e_timezone_entry_set_timezone (ETimezoneEntry *tentry,
- icaltimezone *zone)
-{
- ETimezoneEntryPrivate *priv;
-
- g_return_if_fail (E_IS_TIMEZONE_ENTRY (tentry));
-
- priv = tentry->priv;
-
- priv->zone = zone;
-
- e_timezone_entry_set_entry (tentry);
-}
-
-
-/* Sets the default timezone. If the current timezone matches this, then the
- entry field is hidden. This is useful since most people do not use timezones
- so it makes the user interface simpler. */
-void
-e_timezone_entry_set_default_timezone (ETimezoneEntry *tentry,
- icaltimezone *zone)
-{
- ETimezoneEntryPrivate *priv;
-
- g_return_if_fail (E_IS_TIMEZONE_ENTRY (tentry));
-
- priv = tentry->priv;
-
- priv->default_zone = zone;
-
- e_timezone_entry_set_entry (tentry);
-}
-
-
-static void
-e_timezone_entry_set_entry (ETimezoneEntry *tentry)
-{
- ETimezoneEntryPrivate *priv;
- const char *display_name;
- char *name_buffer;
-
- priv = tentry->priv;
-
- if (priv->zone) {
- display_name = icaltimezone_get_display_name (priv->zone);
-
- /* We check if it is one of our builtin timezone
- names, in which case we call gettext to translate
- it. If it isn't a builtin timezone name, we
- don't. */
- if (icaltimezone_get_builtin_timezone (display_name))
- display_name = _(display_name);
- } else
- display_name = "";
-
- name_buffer = g_strdup (display_name);
-
- gtk_entry_set_text (GTK_ENTRY (priv->entry), name_buffer);
-
- if (!priv->default_zone || (priv->zone != priv->default_zone))
- gtk_widget_show (priv->entry);
- else
- gtk_widget_hide (priv->entry);
-
- g_free (name_buffer);
-}
-
-
-static gboolean
-e_timezone_entry_mnemonic_activate (GtkWidget *widget,
- gboolean group_cycling)
-{
- GtkButton *button = NULL;
-
- if (GTK_WIDGET_CAN_FOCUS (widget)) {
- button=((ETimezoneEntryPrivate*) ((ETimezoneEntry*) widget)->priv)->button;
- if (button != NULL)
- gtk_widget_grab_focus (button);
- }
-
- return TRUE;
-}
-
diff --git a/calendar/gui/e-timezone-entry.h b/calendar/gui/e-timezone-entry.h
deleted file mode 100644
index 94a7df9efc..0000000000
--- a/calendar/gui/e-timezone-entry.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Author :
- * Damon Chaplin <damon@ximian.com>
- *
- * Copyright 2001, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-/*
- * ETimezoneEntry - a field for setting a timezone. It shows the timezone in
- * a GtkEntry with a '...' button beside it which shows a dialog for changing
- * the timezone. The dialog contains a map of the world with a point for each
- * timezone, and an option menu as an alternative way of selecting the
- * timezone.
- */
-
-#ifndef __E_TIMEZONE_ENTRY_H_
-#define __E_TIMEZONE_ENTRY_H_
-
-#include <gtk/gtkhbox.h>
-#include <libecal/e-cal.h>
-
-G_BEGIN_DECLS
-
-
-#define E_TYPE_TIMEZONE_ENTRY (e_timezone_entry_get_type ())
-#define E_TIMEZONE_ENTRY(obj) (GTK_CHECK_CAST ((obj), E_TYPE_TIMEZONE_ENTRY, ETimezoneEntry))
-#define E_TIMEZONE_ENTRY_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_TYPE_TIMEZONE_ENTRY, ETimezoneEntryClass))
-#define E_IS_TIMEZONE_ENTRY(obj) (GTK_CHECK_TYPE ((obj), E_TYPE_TIMEZONE_ENTRY))
-#define E_IS_TIMEZONE_ENTRY_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), E_TYPE_TIMEZONE_ENTRY))
-
-
-typedef struct _ETimezoneEntry ETimezoneEntry;
-typedef struct _ETimezoneEntryPrivate ETimezoneEntryPrivate;
-typedef struct _ETimezoneEntryClass ETimezoneEntryClass;
-
-struct _ETimezoneEntry {
- GtkHBox hbox;
-
- /*< private >*/
- ETimezoneEntryPrivate *priv;
-};
-
-struct _ETimezoneEntryClass {
- GtkHBoxClass parent_class;
-
- void (* changed) (ETimezoneEntry *tentry);
-};
-
-GType e_timezone_entry_get_type (void);
-GtkWidget* e_timezone_entry_new (void);
-
-icaltimezone* e_timezone_entry_get_timezone (ETimezoneEntry *tentry);
-void e_timezone_entry_set_timezone (ETimezoneEntry *tentry,
- icaltimezone *zone);
-
-/* Sets the default timezone. If the current timezone matches this, then the
- entry field is hidden. This is useful since most people do not use timezones
- so it makes the user interface simpler. */
-void e_timezone_entry_set_default_timezone(ETimezoneEntry *tentry,
- icaltimezone *zone);
-
-G_END_DECLS
-
-#endif /* __E_TIMEZONE_ENTRY_H_ */
diff --git a/calendar/gui/e-week-view-config.c b/calendar/gui/e-week-view-config.c
deleted file mode 100644
index 1257813062..0000000000
--- a/calendar/gui/e-week-view-config.c
+++ /dev/null
@@ -1,332 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Author :
- * Rodrigo Moya <rodrigo@ximian.com>
- *
- * Copyright 2003, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#include "calendar-config.h"
-#include "e-week-view-config.h"
-
-struct _EWeekViewConfigPrivate {
- EWeekView *view;
-
- GList *notifications;
-};
-
-static GObjectClass *parent_class = NULL;
-
-/* Property IDs */
-enum props {
- PROP_0,
- PROP_VIEW,
-};
-
-static void
-e_week_view_config_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
-{
- EWeekViewConfig *view_config;
- EWeekViewConfigPrivate *priv;
-
- view_config = E_WEEK_VIEW_CONFIG (object);
- priv = view_config->priv;
-
- switch (property_id) {
- case PROP_VIEW:
- e_week_view_config_set_view (view_config, g_value_get_object (value));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
- break;
- }
-}
-
-static void
-e_week_view_config_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
-{
- EWeekViewConfig *view_config;
- EWeekViewConfigPrivate *priv;
-
- view_config = E_WEEK_VIEW_CONFIG (object);
- priv = view_config->priv;
-
- switch (property_id) {
- case PROP_VIEW:
- g_value_set_object (value, e_week_view_config_get_view (view_config));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
- break;
- }
-}
-
-static void
-e_week_view_config_dispose (GObject *object)
-{
- EWeekViewConfig *view_config = E_WEEK_VIEW_CONFIG (object);
- EWeekViewConfigPrivate *priv;
-
- priv = view_config->priv;
-
- e_week_view_config_set_view (view_config, NULL);
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-static void
-e_week_view_config_finalize (GObject *object)
-{
- EWeekViewConfig *view_config = E_WEEK_VIEW_CONFIG (object);
- EWeekViewConfigPrivate *priv;
-
- priv = view_config->priv;
-
- g_free (priv);
-
- if (G_OBJECT_CLASS (parent_class)->finalize)
- G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-static void
-e_week_view_config_class_init (EWeekViewConfigClass *klass)
-{
- GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- GParamSpec *spec;
-
- parent_class = g_type_class_peek_parent (klass);
-
- /* Method override */
- gobject_class->set_property = e_week_view_config_set_property;
- gobject_class->get_property = e_week_view_config_get_property;
- gobject_class->dispose = e_week_view_config_dispose;
- gobject_class->finalize = e_week_view_config_finalize;
-
- spec = g_param_spec_object ("view", NULL, NULL, e_week_view_get_type (),
- G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT);
- g_object_class_install_property (gobject_class, PROP_VIEW, spec);
-}
-
-static void
-e_week_view_config_init (EWeekViewConfig *view_config, EWeekViewConfigClass *klass)
-{
- view_config->priv = g_new0 (EWeekViewConfigPrivate, 1);
-
-}
-
-E_MAKE_TYPE (e_week_view_config, "EWeekViewConfig", EWeekViewConfig, e_week_view_config_class_init,
- e_week_view_config_init, G_TYPE_OBJECT);
-
-EWeekViewConfig *
-e_week_view_config_new (EWeekView *week_view)
-{
- EWeekViewConfig *view_config;
-
- view_config = g_object_new (e_week_view_config_get_type (), "view", week_view, NULL);
-
- return view_config;
-}
-
-EWeekView *
-e_week_view_config_get_view (EWeekViewConfig *view_config)
-{
- EWeekViewConfigPrivate *priv;
-
- g_return_val_if_fail (view_config != NULL, NULL);
- g_return_val_if_fail (E_IS_WEEK_VIEW_CONFIG (view_config), NULL);
-
- priv = view_config->priv;
-
- return priv->view;
-}
-
-static void
-set_timezone (EWeekView *week_view)
-{
- char *location;
- icaltimezone *zone;
-
- location = calendar_config_get_timezone ();
- zone = icaltimezone_get_builtin_timezone (location);
- if (!zone)
- zone = icaltimezone_get_utc_timezone ();
-
- e_calendar_view_set_timezone (E_CALENDAR_VIEW (week_view), zone);
-
- g_free (location);
-}
-
-static void
-timezone_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
-{
- EWeekViewConfig *view_config = data;
- EWeekViewConfigPrivate *priv;
-
- priv = view_config->priv;
-
- set_timezone (priv->view);
-}
-
-static void
-set_week_start (EWeekView *week_view)
-{
- int week_start_week;
-
- week_start_week = calendar_config_get_week_start_day ();
-
- /* Convert it to 0 (Mon) to 6 (Sun), which is what we use. */
- week_start_week = (week_start_week + 6) % 7;
-
- e_week_view_set_week_start_day (week_view, week_start_week);
-}
-
-static void
-week_start_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
-{
- EWeekViewConfig *view_config = data;
- EWeekViewConfigPrivate *priv;
-
- priv = view_config->priv;
-
- set_week_start (priv->view);
-}
-
-static void
-set_twentyfour_hour (EWeekView *week_view)
-{
- gboolean use_24_hour;
-
- use_24_hour = calendar_config_get_24_hour_format ();
-
- e_calendar_view_set_use_24_hour_format (E_CALENDAR_VIEW (week_view), use_24_hour);
-}
-
-static void
-twentyfour_hour_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
-{
- EWeekViewConfig *view_config = data;
- EWeekViewConfigPrivate *priv;
-
- priv = view_config->priv;
-
- set_twentyfour_hour (priv->view);
-}
-
-static void
-set_show_event_end (EWeekView *week_view)
-{
- gboolean show_event_end;
-
- show_event_end = calendar_config_get_show_event_end ();
-
- e_week_view_set_show_event_end_times (week_view, show_event_end);
-}
-
-static void
-show_event_end_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
-{
- EWeekViewConfig *view_config = data;
- EWeekViewConfigPrivate *priv;
-
- priv = view_config->priv;
-
- set_show_event_end (priv->view);
-}
-
-static void
-set_compress_weekend (EWeekView *week_view)
-{
- gboolean compress_weekend;
-
- compress_weekend = calendar_config_get_compress_weekend ();
-
- e_week_view_set_compress_weekend (week_view, compress_weekend);
-}
-
-static void
-compress_weekend_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
-{
- EWeekViewConfig *view_config = data;
- EWeekViewConfigPrivate *priv;
-
- priv = view_config->priv;
-
- set_compress_weekend (priv->view);
-}
-
-void
-e_week_view_config_set_view (EWeekViewConfig *view_config, EWeekView *week_view)
-{
- EWeekViewConfigPrivate *priv;
- guint not;
- GList *l;
-
- g_return_if_fail (view_config != NULL);
- g_return_if_fail (E_IS_WEEK_VIEW_CONFIG (view_config));
-
- priv = view_config->priv;
-
- if (priv->view) {
- g_object_unref (priv->view);
- priv->view = NULL;
- }
-
- for (l = priv->notifications; l; l = l->next)
- calendar_config_remove_notification (GPOINTER_TO_UINT (l->data));
-
- g_list_free (priv->notifications);
- priv->notifications = NULL;
-
- /* If the new view is NULL, return right now */
- if (!week_view)
- return;
-
- priv->view = g_object_ref (week_view);
-
- /* Time zone */
- set_timezone (week_view);
-
- not = calendar_config_add_notification_timezone (timezone_changed_cb, view_config);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
-
- /* Week start */
- set_week_start (week_view);
-
- not = calendar_config_add_notification_week_start_day (week_start_changed_cb, view_config);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
-
- /* 24 Hour format */
- set_twentyfour_hour (week_view);
-
- not = calendar_config_add_notification_24_hour_format (twentyfour_hour_changed_cb, view_config);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
-
- /* Show event end */
- set_show_event_end (week_view);
-
- not = calendar_config_add_notification_show_event_end (show_event_end_changed_cb, view_config);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
-
- /* Compress weekend */
- set_compress_weekend (week_view);
-
- not = calendar_config_add_notification_compress_weekend (compress_weekend_changed_cb, view_config);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
-}
-
diff --git a/calendar/gui/e-week-view-config.h b/calendar/gui/e-week-view-config.h
deleted file mode 100644
index e37cb0cfc0..0000000000
--- a/calendar/gui/e-week-view-config.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Author :
- * JP Rosevear <jpr@ximian.com>
- *
- * Copyright 2003, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifndef _E_WEEK_VIEW_CONFIG_H_
-#define _E_WEEK_VIEW_CONFIG_H_
-
-#include "e-week-view.h"
-
-G_BEGIN_DECLS
-
-#define E_WEEK_VIEW_CONFIG(obj) GTK_CHECK_CAST (obj, e_week_view_config_get_type (), EWeekViewConfig)
-#define E_WEEK_VIEW_CONFIG_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, e_week_view_config_get_type (), EWeekViewConfigClass)
-#define E_IS_WEEK_VIEW_CONFIG(obj) GTK_CHECK_TYPE (obj, e_week_view_config_get_type ())
-
-typedef struct _EWeekViewConfig EWeekViewConfig;
-typedef struct _EWeekViewConfigClass EWeekViewConfigClass;
-typedef struct _EWeekViewConfigPrivate EWeekViewConfigPrivate;
-
-struct _EWeekViewConfig {
- GObject parent;
-
- EWeekViewConfigPrivate *priv;
-};
-
-struct _EWeekViewConfigClass {
- GObjectClass parent_class;
-};
-
-GType e_week_view_config_get_type (void);
-EWeekViewConfig *e_week_view_config_new (EWeekView *week_view);
-EWeekView *e_week_view_config_get_view (EWeekViewConfig *view_config);
-void e_week_view_config_set_view (EWeekViewConfig *view_config, EWeekView *week_view);
-
-G_END_DECLS
-
-#endif
diff --git a/calendar/gui/e-week-view-event-item.c b/calendar/gui/e-week-view-event-item.c
deleted file mode 100644
index 85e1cf775a..0000000000
--- a/calendar/gui/e-week-view-event-item.c
+++ /dev/null
@@ -1,945 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Author :
- * Damon Chaplin <damon@ximian.com>
- *
- * Copyright 1999, Ximian, Inc.
- * Copyright 2001, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-/*
- * EWeekViewEventItem - displays the background, times and icons for an event
- * in the week/month views. A separate EText canvas item is used to display &
- * edit the text.
- */
-
-#include <config.h>
-
-#include "e-util/e-categories-config.h"
-#include "e-week-view-event-item.h"
-
-#include <gtk/gtksignal.h>
-#include <gal/e-text/e-text.h>
-
-static void e_week_view_event_item_class_init (EWeekViewEventItemClass *class);
-static void e_week_view_event_item_init (EWeekViewEventItem *wveitem);
-
-static void e_week_view_event_item_set_arg (GtkObject *o,
- GtkArg *arg,
- guint arg_id);
-static void e_week_view_event_item_update (GnomeCanvasItem *item,
- double *affine,
- ArtSVP *clip_path,
- int flags);
-static void e_week_view_event_item_draw (GnomeCanvasItem *item,
- GdkDrawable *drawable,
- int x,
- int y,
- int width,
- int height);
-static void e_week_view_draw_time (EWeekView *week_view,
- GdkDrawable *drawable,
- gint time_x,
- gint time_y,
- gint hour,
- gint minute);
-static void e_week_view_event_item_draw_icons (EWeekViewEventItem *wveitem,
- GdkDrawable *drawable,
- gint icon_x,
- gint icon_y,
- gint x2,
- gboolean right_align);
-static void e_week_view_event_item_draw_triangle (EWeekViewEventItem *wveitem,
- GdkDrawable *drawable,
- gint x,
- gint y,
- gint w,
- gint h);
-static double e_week_view_event_item_point (GnomeCanvasItem *item,
- double x,
- double y,
- int cx,
- int cy,
- GnomeCanvasItem **actual_item);
-static gint e_week_view_event_item_event (GnomeCanvasItem *item,
- GdkEvent *event);
-static gboolean e_week_view_event_item_button_press (EWeekViewEventItem *wveitem,
- GdkEvent *event);
-static gboolean e_week_view_event_item_button_release (EWeekViewEventItem *wveitem,
- GdkEvent *event);
-static gboolean e_week_view_event_item_double_click (EWeekViewEventItem *wveitem,
- GdkEvent *bevent);
-static ECalendarViewPosition e_week_view_event_item_get_position (EWeekViewEventItem *wveitem,
- gdouble x,
- gdouble y);
-
-
-static GnomeCanvasItemClass *parent_class;
-
-/* The arguments we take */
-enum {
- ARG_0,
- ARG_EVENT_NUM,
- ARG_SPAN_NUM
-};
-
-E_MAKE_TYPE (e_week_view_event_item, "EWeekViewEventItem", EWeekViewEventItem,
- e_week_view_event_item_class_init, e_week_view_event_item_init,
- GNOME_TYPE_CANVAS_ITEM);
-
-static void
-e_week_view_event_item_class_init (EWeekViewEventItemClass *class)
-{
- GtkObjectClass *object_class;
- GnomeCanvasItemClass *item_class;
-
- parent_class = g_type_class_peek_parent (class);
-
- object_class = (GtkObjectClass *) class;
- item_class = (GnomeCanvasItemClass *) class;
-
- gtk_object_add_arg_type ("EWeekViewEventItem::event_num",
- GTK_TYPE_INT, GTK_ARG_WRITABLE,
- ARG_EVENT_NUM);
- gtk_object_add_arg_type ("EWeekViewEventItem::span_num",
- GTK_TYPE_INT, GTK_ARG_WRITABLE,
- ARG_SPAN_NUM);
-
- object_class->set_arg = e_week_view_event_item_set_arg;
-
- /* GnomeCanvasItem method overrides */
- item_class->update = e_week_view_event_item_update;
- item_class->draw = e_week_view_event_item_draw;
- item_class->point = e_week_view_event_item_point;
- item_class->event = e_week_view_event_item_event;
-}
-
-
-static void
-e_week_view_event_item_init (EWeekViewEventItem *wveitem)
-{
- wveitem->event_num = -1;
- wveitem->span_num = -1;
-}
-
-
-static void
-e_week_view_event_item_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
-{
- GnomeCanvasItem *item;
- EWeekViewEventItem *wveitem;
- gboolean needs_update = FALSE;
-
- item = GNOME_CANVAS_ITEM (o);
- wveitem = E_WEEK_VIEW_EVENT_ITEM (o);
-
- switch (arg_id){
- case ARG_EVENT_NUM:
- wveitem->event_num = GTK_VALUE_INT (*arg);
- needs_update = TRUE;
- break;
- case ARG_SPAN_NUM:
- wveitem->span_num = GTK_VALUE_INT (*arg);
- needs_update = TRUE;
- break;
- }
-
- if (needs_update)
- gnome_canvas_item_request_update (item);
-}
-
-
-static void
-e_week_view_event_item_update (GnomeCanvasItem *item,
- double *affine,
- ArtSVP *clip_path,
- int flags)
-{
- EWeekViewEventItem *wveitem;
- EWeekView *week_view;
- gint span_x, span_y, span_w;
-
-#if 0
- g_print ("In e_week_view_event_item_update\n");
-#endif
-
- wveitem = E_WEEK_VIEW_EVENT_ITEM (item);
- week_view = E_WEEK_VIEW (GTK_WIDGET (item->canvas)->parent);
- g_return_if_fail (E_IS_WEEK_VIEW (week_view));
-
- if (GNOME_CANVAS_ITEM_CLASS (parent_class)->update)
- (* GNOME_CANVAS_ITEM_CLASS (parent_class)->update) (item, affine, clip_path, flags);
-
- item->x1 = 0;
- item->y1 = 0;
- item->x2 = 0;
- item->y2 = 0;
-
- if (wveitem->event_num != -1 && wveitem->span_num != -1) {
- if (e_week_view_get_span_position (week_view,
- wveitem->event_num,
- wveitem->span_num,
- &span_x, &span_y,
- &span_w)) {
-#if 0
- g_print (" Event:%i Span:%i %i,%i W:%i\n",
- wveitem->event_num, wveitem->span_num,
- span_x, span_y, span_w);
-#endif
- item->x1 = span_x;
- item->y1 = span_y;
- item->x2 = span_x + span_w - 1;
- item->y2 = span_y + week_view->row_height - 1;
- }
- }
-}
-
-
-/*
- * DRAWING ROUTINES - functions to paint the canvas item.
- */
-
-static void
-e_week_view_event_item_draw (GnomeCanvasItem *canvas_item,
- GdkDrawable *drawable,
- int x,
- int y,
- int width,
- int height)
-{
- EWeekViewEventItem *wveitem;
- EWeekView *week_view;
- EWeekViewEvent *event;
- EWeekViewEventSpan *span;
- GtkStyle *style;
- GdkGC *gc;
- gint x1, y1, x2, y2, time_x, time_y;
- gint icon_x, icon_y, time_width, min_end_time_x, max_icon_x;
- gint rect_x, rect_w, rect_x2;
- gboolean one_day_event, editing_span = FALSE;
- gint start_hour, start_minute, end_hour, end_minute;
- gboolean draw_start, draw_end;
- gboolean draw_start_triangle = FALSE, draw_end_triangle = FALSE;
- GdkRectangle clip_rect;
- GdkColor bg_color;
-
-#if 0
- g_print ("In e_week_view_event_item_draw %i,%i %ix%i\n",
- x, y, width, height);
-#endif
-
- wveitem = E_WEEK_VIEW_EVENT_ITEM (canvas_item);
- week_view = E_WEEK_VIEW (GTK_WIDGET (canvas_item->canvas)->parent);
- g_return_if_fail (E_IS_WEEK_VIEW (week_view));
-
- if (wveitem->event_num == -1 || wveitem->span_num == -1)
- return;
-
- event = &g_array_index (week_view->events, EWeekViewEvent,
- wveitem->event_num);
- span = &g_array_index (week_view->spans, EWeekViewEventSpan,
- event->spans_index + wveitem->span_num);
-
- style = GTK_WIDGET (week_view)->style;
- gc = week_view->main_gc;
-
- x1 = canvas_item->x1 - x;
- y1 = canvas_item->y1 - y;
- x2 = canvas_item->x2 - x;
- y2 = canvas_item->y2 - y;
-
- if (x1 == x2 || y1 == y2)
- return;
-
- icon_x = 0;
- icon_y = y1 + E_WEEK_VIEW_EVENT_BORDER_HEIGHT + E_WEEK_VIEW_ICON_Y_PAD;
-
- /* Get the start & end times in 24-hour format. */
- start_hour = event->start_minute / 60;
- start_minute = event->start_minute % 60;
- end_hour = event->end_minute / 60;
- end_minute = event->end_minute % 60;
-
- time_y = y1 + E_WEEK_VIEW_EVENT_BORDER_HEIGHT
- + E_WEEK_VIEW_EVENT_TEXT_Y_PAD;
-
- time_width = e_week_view_get_time_string_width (week_view);
-
- one_day_event = e_week_view_is_one_day_event (week_view,
- wveitem->event_num);
- if (one_day_event) {
- time_x = x1 + E_WEEK_VIEW_EVENT_L_PAD + 1;
- rect_x = x1 + E_WEEK_VIEW_EVENT_L_PAD;
- rect_w = x2 - x1 - E_WEEK_VIEW_EVENT_L_PAD - E_WEEK_VIEW_EVENT_R_PAD + 1;
-
- if (gdk_color_parse (e_cal_model_get_color_for_component (e_calendar_view_get_model (E_CALENDAR_VIEW (week_view)),
- event->comp_data),
- &bg_color)) {
- GdkColormap *colormap;
-
- colormap = gtk_widget_get_colormap (GTK_WIDGET (week_view));
- if (gdk_colormap_alloc_color (colormap, &bg_color, TRUE, TRUE))
- gdk_gc_set_foreground (gc, &bg_color);
- else
- gdk_gc_set_foreground (gc, &week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BACKGROUND]);
- } else
- gdk_gc_set_foreground (gc, &week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BACKGROUND]);
- gdk_draw_rectangle (drawable, gc, TRUE, rect_x, y1 + 1, rect_w, y2 - y1 - 1);
-
- gdk_gc_set_foreground (gc, &week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BORDER]);
- gdk_draw_line (drawable, gc, rect_x, y1 + 1, rect_x + rect_w, y1 + 1);
- gdk_draw_line (drawable, gc, rect_x, y2, rect_x + rect_w, y2);
- gdk_draw_line (drawable, gc, rect_x, y1 + 1, rect_x, y1 + (y2 - (y1 + 1)));
- gdk_draw_line (drawable, gc, rect_x + rect_w, y1 + 1, rect_x + rect_w, y1 + (y2 - (y1 + 1)));
-
- /* Draw the start and end times, as required. */
- switch (week_view->time_format) {
- case E_WEEK_VIEW_TIME_BOTH_SMALL_MIN:
- case E_WEEK_VIEW_TIME_BOTH:
- draw_start = TRUE;
- draw_end = TRUE;
- break;
-
- case E_WEEK_VIEW_TIME_START_SMALL_MIN:
- case E_WEEK_VIEW_TIME_START:
- draw_start = TRUE;
- draw_end = FALSE;
- break;
-
- case E_WEEK_VIEW_TIME_NONE:
- draw_start = FALSE;
- draw_end = FALSE;
- break;
- default:
- g_assert_not_reached();
- draw_start = FALSE;
- draw_end = FALSE;
- break;
- }
-
- if (draw_start) {
- e_week_view_draw_time (week_view, drawable,
- time_x, time_y,
- start_hour, start_minute);
- time_x += time_width;
- }
-
- if (draw_end) {
- time_x += E_WEEK_VIEW_EVENT_TIME_SPACING;
- e_week_view_draw_time (week_view, drawable,
- time_x, time_y,
- end_hour, end_minute);
- time_x += time_width;
- }
-
- icon_x = time_x;
- if (draw_start)
- icon_x += E_WEEK_VIEW_EVENT_TIME_X_PAD;
-
- /* Draw the icons. */
- e_week_view_event_item_draw_icons (wveitem, drawable,
- icon_x, icon_y,
- x2, FALSE);
-
- } else {
- rect_x = x1 + E_WEEK_VIEW_EVENT_L_PAD;
- rect_w = x2 - x1 - E_WEEK_VIEW_EVENT_L_PAD
- - E_WEEK_VIEW_EVENT_R_PAD + 1;
-
- /* Draw the triangles at the start & end, if needed.
- They also use the first few pixels at the edge of the
- event so we update rect_x & rect_w so we don't draw over
- them. */
- if (event->start < week_view->day_starts[span->start_day]) {
- draw_start_triangle = TRUE;
- rect_x += 2;
- rect_w -= 2;
- }
-
- if (event->end > week_view->day_starts[span->start_day
- + span->num_days]) {
- draw_end_triangle = TRUE;
- rect_w -= 2;
- }
-
- if (gdk_color_parse (e_cal_model_get_color_for_component (e_calendar_view_get_model (E_CALENDAR_VIEW (week_view)),
- event->comp_data),
- &bg_color)) {
- GdkColormap *colormap;
-
- colormap = gtk_widget_get_colormap (GTK_WIDGET (week_view));
- if (gdk_colormap_alloc_color (colormap, &bg_color, TRUE, TRUE))
- gdk_gc_set_foreground (gc, &bg_color);
- else
- gdk_gc_set_foreground (gc, &week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BACKGROUND]);
- } else
- gdk_gc_set_foreground (gc, &week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BACKGROUND]);
- gdk_draw_rectangle (drawable, gc, TRUE, rect_x, y1 + 1, rect_w, y2 - y1 - 1);
-
- gdk_gc_set_foreground (gc, &week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BORDER]);
- rect_x2 = rect_x + rect_w - 1;
- gdk_draw_line (drawable, gc, rect_x, y1, rect_x2, y1);
- gdk_draw_line (drawable, gc, rect_x, y2, rect_x2, y2);
-
- if (draw_start_triangle) {
- e_week_view_event_item_draw_triangle (wveitem, drawable, x1 + E_WEEK_VIEW_EVENT_L_PAD + 2, y1, -3, y2 - y1 + 1);
- } else {
- gdk_draw_line (drawable, gc, rect_x, y1, rect_x, y2);
- }
-
- if (draw_end_triangle) {
- e_week_view_event_item_draw_triangle (wveitem, drawable, x2 - E_WEEK_VIEW_EVENT_R_PAD - 2, y1, 3, y2 - y1 + 1);
- } else {
- gdk_draw_line (drawable, gc, rect_x2, y1, rect_x2, y2);
- }
-
- if (span->text_item && E_TEXT (span->text_item)->editing)
- editing_span = TRUE;
-
- /* Draw the start & end times, if they are not on day
- boundaries. The start time would always be shown if it was
- needed, though it may be clipped as the window shrinks.
- The end time is only displayed if there is enough room.
- We calculate the minimum position for the end time, which
- depends on whether the start time is displayed. If the end
- time doesn't fit, then we don't draw it. */
- min_end_time_x = x1 + E_WEEK_VIEW_EVENT_L_PAD
- + E_WEEK_VIEW_EVENT_BORDER_WIDTH
- + E_WEEK_VIEW_EVENT_EDGE_X_PAD;
- if (!editing_span
- && event->start > week_view->day_starts[span->start_day]) {
- time_x = x1 + E_WEEK_VIEW_EVENT_L_PAD
- + E_WEEK_VIEW_EVENT_BORDER_WIDTH
- + E_WEEK_VIEW_EVENT_EDGE_X_PAD;
-
- clip_rect.x = x1;
- clip_rect.y = y1;
- clip_rect.width = x2 - x1 - E_WEEK_VIEW_EVENT_R_PAD
- - E_WEEK_VIEW_EVENT_BORDER_WIDTH + 1;
- clip_rect.height = y2 - y1 + 1;
- gdk_gc_set_clip_rectangle (gc, &clip_rect);
-
- gdk_gc_set_foreground (gc, &week_view->colors[E_WEEK_VIEW_COLOR_EVENT_TEXT]);
-
- e_week_view_draw_time (week_view, drawable,
- time_x, time_y,
- start_hour, start_minute);
-
- gdk_gc_set_clip_rectangle (gc, NULL);
-
- /* We don't want the end time to be drawn over the
- start time, so we increase the minimum position. */
- min_end_time_x += time_width
- + E_WEEK_VIEW_EVENT_TIME_X_PAD;
- }
-
- max_icon_x = x2 + 1 - E_WEEK_VIEW_EVENT_R_PAD
- - E_WEEK_VIEW_EVENT_BORDER_WIDTH
- - E_WEEK_VIEW_EVENT_EDGE_X_PAD;
-
- if (!editing_span
- && event->end < week_view->day_starts[span->start_day
- + span->num_days]) {
- /* Calculate where the end time should be displayed. */
- time_x = x2 + 1 - E_WEEK_VIEW_EVENT_R_PAD
- - E_WEEK_VIEW_EVENT_BORDER_WIDTH
- - E_WEEK_VIEW_EVENT_EDGE_X_PAD
- - time_width;
-
- /* Draw the end time, if the position is greater than
- the minimum calculated above. */
- if (time_x >= min_end_time_x) {
- e_week_view_draw_time (week_view, drawable,
- time_x, time_y,
- end_hour, end_minute);
- max_icon_x -= time_width
- + E_WEEK_VIEW_EVENT_TIME_X_PAD;
- }
- }
-
- /* Draw the icons. */
- if (span->text_item
- && (week_view->editing_event_num != wveitem->event_num
- || week_view->editing_span_num != wveitem->span_num)) {
- icon_x = span->text_item->x1 - E_WEEK_VIEW_ICON_R_PAD - x;
- e_week_view_event_item_draw_icons (wveitem, drawable,
- icon_x, icon_y,
- max_icon_x, TRUE);
- }
- }
-}
-
-
-static void
-e_week_view_draw_time (EWeekView *week_view,
- GdkDrawable *drawable,
- gint time_x,
- gint time_y,
- gint hour,
- gint minute)
-{
- GtkStyle *style;
- GdkGC *gc;
- gint hour_to_display, suffix_width;
- gint time_y_normal_font, time_y_small_font;
- gchar buffer[128], *suffix;
- PangoLayout *layout;
- PangoFontDescription *small_font_desc;
-
- style = gtk_widget_get_style (GTK_WIDGET (week_view));
- small_font_desc = week_view->small_font_desc;
- gc = week_view->main_gc;
-
- gdk_gc_set_foreground (gc, &week_view->colors[E_WEEK_VIEW_COLOR_EVENT_TEXT]);
-
- layout = gtk_widget_create_pango_layout (GTK_WIDGET (week_view), NULL);
-
- time_y_normal_font = time_y_small_font = time_y;
- if (small_font_desc)
- time_y_small_font = time_y;
-
- e_week_view_convert_time_to_display (week_view, hour, &hour_to_display,
- &suffix, &suffix_width);
-
- if (week_view->use_small_font && week_view->small_font_desc) {
- g_snprintf (buffer, sizeof (buffer), "%2i:%02i",
- hour_to_display, minute);
-
- /* Draw the hour. */
- if (hour_to_display < 10) {
- pango_layout_set_text (layout, buffer + 1, 1);
- gdk_draw_layout (drawable, gc,
- time_x + week_view->digit_width,
- time_y_normal_font,
- layout);
- } else {
- pango_layout_set_text (layout, buffer, 2);
- gdk_draw_layout (drawable, gc,
- time_x,
- time_y_normal_font,
- layout);
- }
-
- time_x += week_view->digit_width * 2;
-
- /* Draw the start minute, in the small font. */
- pango_layout_set_font_description (layout, week_view->small_font_desc);
- pango_layout_set_text (layout, buffer + 3, 2);
- gdk_draw_layout (drawable, gc,
- time_x,
- time_y_small_font,
- layout);
-
- pango_layout_set_font_description (layout, style->font_desc);
-
- time_x += week_view->small_digit_width * 2;
-
- /* Draw the 'am'/'pm' suffix, if 12-hour format. */
- if (!e_calendar_view_get_use_24_hour_format (E_CALENDAR_VIEW (week_view))) {
- pango_layout_set_text (layout, suffix, -1);
- gdk_draw_layout (drawable, gc,
- time_x,
- time_y_normal_font,
- layout);
- }
- } else {
- /* Draw the start time in one go. */
- g_snprintf (buffer, sizeof (buffer), "%2i:%02i%s",
- hour_to_display, minute, suffix);
- if (hour_to_display < 10) {
- pango_layout_set_text (layout, buffer + 1, -1);
- gdk_draw_layout (drawable, gc,
- time_x + week_view->digit_width,
- time_y_normal_font,
- layout);
- } else {
- pango_layout_set_text (layout, buffer, -1);
- gdk_draw_layout (drawable, gc,
- time_x,
- time_y_normal_font,
- layout);
- }
-
- }
-
- g_object_unref (layout);
-}
-
-
-static void
-e_week_view_event_item_draw_icons (EWeekViewEventItem *wveitem,
- GdkDrawable *drawable,
- gint icon_x,
- gint icon_y,
- gint x2,
- gboolean right_align)
-{
- EWeekView *week_view;
- EWeekViewEvent *event;
- EWeekViewEventSpan *span;
- ECalComponent *comp;
- GdkGC *gc;
- gint num_icons = 0, icon_x_inc;
- gboolean draw_reminder_icon = FALSE, draw_recurrence_icon = FALSE;
- gboolean draw_timezone_icon = FALSE;
- GSList *categories_list, *elem;
-
- week_view = E_WEEK_VIEW (GTK_WIDGET (GNOME_CANVAS_ITEM (wveitem)->canvas)->parent);
-
- event = &g_array_index (week_view->events, EWeekViewEvent,
- wveitem->event_num);
- span = &g_array_index (week_view->spans, EWeekViewEventSpan,
- event->spans_index + wveitem->span_num);
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
-
- gc = week_view->main_gc;
-
- if (e_cal_component_has_alarms (comp)) {
- draw_reminder_icon = TRUE;
- num_icons++;
- }
-
- if (e_cal_component_has_recurrences (comp)) {
- draw_recurrence_icon = TRUE;
- num_icons++;
- }
-
- if (event->different_timezone) {
- draw_timezone_icon = TRUE;
- num_icons++;
- }
-
- e_cal_component_get_categories_list (comp, &categories_list);
- for (elem = categories_list; elem; elem = elem->next) {
- char *category;
- GdkPixmap *pixmap = NULL;
- GdkBitmap *mask = NULL;
-
- category = (char *) elem->data;
- if (e_categories_config_get_icon_for (category, &pixmap, &mask))
- num_icons++;
- }
-
- icon_x_inc = E_WEEK_VIEW_ICON_WIDTH + E_WEEK_VIEW_ICON_X_PAD;
-
- if (right_align)
- icon_x -= icon_x_inc * num_icons;
-
- if (draw_reminder_icon && icon_x + E_WEEK_VIEW_ICON_WIDTH <= x2) {
- gdk_gc_set_clip_origin (gc, icon_x, icon_y);
- gdk_gc_set_clip_mask (gc, week_view->reminder_mask);
- gdk_draw_pixmap (drawable, gc,
- week_view->reminder_icon,
- 0, 0, icon_x, icon_y,
- E_WEEK_VIEW_ICON_WIDTH,
- E_WEEK_VIEW_ICON_HEIGHT);
- icon_x += icon_x_inc;
- }
-
- if (draw_recurrence_icon && icon_x + E_WEEK_VIEW_ICON_WIDTH <= x2) {
- gdk_gc_set_clip_origin (gc, icon_x, icon_y);
- gdk_gc_set_clip_mask (gc, week_view->recurrence_mask);
- gdk_draw_pixmap (drawable, gc,
- week_view->recurrence_icon,
- 0, 0, icon_x, icon_y,
- E_WEEK_VIEW_ICON_WIDTH,
- E_WEEK_VIEW_ICON_HEIGHT);
- icon_x += icon_x_inc;
- }
-
- if (draw_timezone_icon && icon_x + E_WEEK_VIEW_ICON_WIDTH <= x2) {
- gdk_gc_set_clip_origin (gc, icon_x, icon_y);
- gdk_gc_set_clip_mask (gc, week_view->timezone_mask);
- gdk_draw_pixmap (drawable, gc,
- week_view->timezone_icon,
- 0, 0, icon_x, icon_y,
- E_WEEK_VIEW_ICON_WIDTH,
- E_WEEK_VIEW_ICON_HEIGHT);
- icon_x += icon_x_inc;
- }
-
- /* draw categories icons */
- for (elem = categories_list; elem; elem = elem->next) {
- char *category;
- GdkPixmap *pixmap = NULL;
- GdkBitmap *mask = NULL;
-
- category = (char *) elem->data;
- if (!e_categories_config_get_icon_for (category, &pixmap, &mask))
- continue;
-
- if (icon_x + E_WEEK_VIEW_ICON_WIDTH <= x2) {
- gdk_gc_set_clip_origin (gc, icon_x, icon_y);
- if (mask != NULL)
- gdk_gc_set_clip_mask (gc, mask);
- gdk_draw_pixmap (drawable, gc,
- pixmap,
- 0, 0, icon_x, icon_y,
- E_WEEK_VIEW_ICON_WIDTH,
- E_WEEK_VIEW_ICON_HEIGHT);
- icon_x += icon_x_inc;
- }
- gdk_pixmap_unref (pixmap);
- if (mask != NULL)
- gdk_bitmap_unref (mask);
- }
-
- e_cal_component_free_categories_list (categories_list);
-
- gdk_gc_set_clip_mask (gc, NULL);
-}
-
-
-/* This draws a little triangle to indicate that an event extends past
- the days visible on screen. */
-static void
-e_week_view_event_item_draw_triangle (EWeekViewEventItem *wveitem,
- GdkDrawable *drawable,
- gint x,
- gint y,
- gint w,
- gint h)
-{
- EWeekView *week_view;
- GdkGC *gc;
- GdkPoint points[3];
- gint c1, c2;
-
- week_view = E_WEEK_VIEW (GTK_WIDGET (GNOME_CANVAS_ITEM (wveitem)->canvas)->parent);
-
- gc = week_view->main_gc;
-
- points[0].x = x;
- points[0].y = y;
- points[1].x = x + w;
- points[1].y = y + (h / 2) - 1;
- points[2].x = x;
- points[2].y = y + h - 1;
-
- gdk_gc_set_foreground (gc, &week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BACKGROUND]);
- gdk_draw_polygon (drawable, gc, TRUE, points, 3);
-
- gdk_gc_set_foreground (gc, &week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BORDER]);
-
- /* If the height is odd we can use the same central point for both
- lines. If it is even we use different end-points. */
- c1 = c2 = y + (h / 2);
- if (h % 2 == 0)
- c1--;
-
- gdk_draw_line (drawable, gc, x, y, x + w, c1);
- gdk_draw_line (drawable, gc, x, y + h - 1, x + w, c2);
-}
-
-
-/* This is supposed to return the nearest item the the point and the distance.
- Since we are the only item we just return ourself and 0 for the distance.
- This is needed so that we get button/motion events. */
-static double
-e_week_view_event_item_point (GnomeCanvasItem *item, double x, double y,
- int cx, int cy,
- GnomeCanvasItem **actual_item)
-{
- *actual_item = item;
- return 0.0;
-}
-
-
-static gint
-e_week_view_event_item_event (GnomeCanvasItem *item, GdkEvent *event)
-{
- EWeekViewEventItem *wveitem;
-
- wveitem = E_WEEK_VIEW_EVENT_ITEM (item);
-
- switch (event->type) {
- case GDK_2BUTTON_PRESS:
- return e_week_view_event_item_double_click (wveitem, event);
- case GDK_BUTTON_PRESS:
- return e_week_view_event_item_button_press (wveitem, event);
- case GDK_BUTTON_RELEASE:
- return e_week_view_event_item_button_release (wveitem, event);
- case GDK_MOTION_NOTIFY:
- break;
- default:
- break;
- }
-
- return FALSE;
-}
-
-
-static gboolean
-e_week_view_event_item_button_press (EWeekViewEventItem *wveitem,
- GdkEvent *bevent)
-{
- EWeekView *week_view;
- ECalendarViewPosition pos;
- EWeekViewEvent *event;
- EWeekViewEventSpan *span;
- GnomeCanvasItem *item;
-
- item = GNOME_CANVAS_ITEM (wveitem);
-
- week_view = E_WEEK_VIEW (GTK_WIDGET (item->canvas)->parent);
- g_return_val_if_fail (E_IS_WEEK_VIEW (week_view), FALSE);
-
- event = &g_array_index (week_view->events, EWeekViewEvent,
- wveitem->event_num);
- span = &g_array_index (week_view->spans, EWeekViewEventSpan,
- event->spans_index + wveitem->span_num);
-
-#if 0
- g_print ("In e_week_view_event_item_button_press\n");
-#endif
-
- pos = e_week_view_event_item_get_position (wveitem, bevent->button.x,
- bevent->button.y);
- if (pos == E_CALENDAR_VIEW_POS_NONE)
- return FALSE;
-
- if (bevent->button.button == 1) {
- week_view->pressed_event_num = wveitem->event_num;
- week_view->pressed_span_num = wveitem->span_num;
-
- /* Ignore clicks on the event while editing. */
- if (E_TEXT (span->text_item)->editing)
- return FALSE;
-
- /* Remember the item clicked and the mouse position,
- so we can start a drag if the mouse moves. */
- week_view->drag_event_x = bevent->button.x;
- week_view->drag_event_y = bevent->button.y;
-
- /* FIXME: Remember the day offset from the start of the event.
- */
-
- return TRUE;
- } else if (bevent->button.button == 3) {
- if (!GTK_WIDGET_HAS_FOCUS (week_view))
- gtk_widget_grab_focus (GTK_WIDGET (week_view));
-
- e_week_view_set_selected_time_range_visible (week_view, event->start, event->end);
-
- e_week_view_show_popup_menu (week_view,
- (GdkEventButton*) bevent,
- wveitem->event_num);
- gtk_signal_emit_stop_by_name (GTK_OBJECT (item->canvas),
- "button_press_event");
-
- return TRUE;
- }
-
- return FALSE;
-}
-
-
-static gboolean
-e_week_view_event_item_button_release (EWeekViewEventItem *wveitem,
- GdkEvent *event)
-{
- EWeekView *week_view;
- GnomeCanvasItem *item;
-
- item = GNOME_CANVAS_ITEM (wveitem);
-
- week_view = E_WEEK_VIEW (GTK_WIDGET (item->canvas)->parent);
- g_return_val_if_fail (E_IS_WEEK_VIEW (week_view), FALSE);
-
-#if 0
- g_print ("In e_week_view_event_item_button_release\n");
-#endif
-
- if (week_view->pressed_event_num != -1
- && week_view->pressed_event_num == wveitem->event_num
- && week_view->pressed_span_num == wveitem->span_num) {
- e_week_view_start_editing_event (week_view,
- wveitem->event_num,
- wveitem->span_num,
- NULL);
- week_view->pressed_event_num = -1;
- return TRUE;
- }
-
- week_view->pressed_event_num = -1;
-
- return FALSE;
-}
-
-
-static gboolean
-e_week_view_event_item_double_click (EWeekViewEventItem *wveitem,
- GdkEvent *bevent)
-{
- EWeekView *week_view;
- EWeekViewEvent *event;
- GnomeCanvasItem *item;
-
- item = GNOME_CANVAS_ITEM (wveitem);
-
- week_view = E_WEEK_VIEW (GTK_WIDGET (item->canvas)->parent);
- g_return_val_if_fail (E_IS_WEEK_VIEW (week_view), FALSE);
-
- event = &g_array_index (week_view->events, EWeekViewEvent,
- wveitem->event_num);
-
- e_week_view_stop_editing_event (week_view);
-
- e_calendar_view_edit_appointment (E_CALENDAR_VIEW (week_view), event->comp_data->client, event->comp_data->icalcomp, FALSE);
-
- return TRUE;
-}
-
-
-static ECalendarViewPosition
-e_week_view_event_item_get_position (EWeekViewEventItem *wveitem,
- gdouble x,
- gdouble y)
-{
- EWeekView *week_view;
- GnomeCanvasItem *item;
-
- item = GNOME_CANVAS_ITEM (wveitem);
-
- week_view = E_WEEK_VIEW (GTK_WIDGET (item->canvas)->parent);
- g_return_val_if_fail (E_IS_WEEK_VIEW (week_view), E_CALENDAR_VIEW_POS_NONE);
-
-#if 0
- g_print ("In e_week_view_event_item_get_position item: %g,%g %g,%g point: %g,%g\n", item->x1, item->y1, item->x2, item->y2, x, y);
-#endif
-
- if (x < item->x1 + E_WEEK_VIEW_EVENT_L_PAD
- || x >= item->x2 - E_WEEK_VIEW_EVENT_R_PAD)
- return E_CALENDAR_VIEW_POS_NONE;
-
- /* Support left/right edge for long events only. */
- if (!e_week_view_is_one_day_event (week_view, wveitem->event_num)) {
- if (x < item->x1 + E_WEEK_VIEW_EVENT_L_PAD
- + E_WEEK_VIEW_EVENT_BORDER_WIDTH
- + E_WEEK_VIEW_EVENT_EDGE_X_PAD)
- return E_CALENDAR_VIEW_POS_LEFT_EDGE;
-
- if (x >= item->x2 + 1 - E_WEEK_VIEW_EVENT_R_PAD
- - E_WEEK_VIEW_EVENT_BORDER_WIDTH
- - E_WEEK_VIEW_EVENT_EDGE_X_PAD)
- return E_CALENDAR_VIEW_POS_RIGHT_EDGE;
- }
-
- return E_CALENDAR_VIEW_POS_EVENT;
-}
diff --git a/calendar/gui/e-week-view-event-item.h b/calendar/gui/e-week-view-event-item.h
deleted file mode 100644
index 20cace0132..0000000000
--- a/calendar/gui/e-week-view-event-item.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Author :
- * Damon Chaplin <damon@ximian.com>
- *
- * Copyright 1999, Ximian, Inc.
- * Copyright 2001, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-#ifndef _E_WEEK_VIEW_EVENT_ITEM_H_
-#define _E_WEEK_VIEW_EVENT_ITEM_H_
-
-#include "e-week-view.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-/*
- * EWeekViewEventItem - displays the background, times and icons for an event
- * in the week/month views. A separate EText canvas item is used to display &
- * edit the text.
- */
-
-#define E_WEEK_VIEW_EVENT_ITEM(obj) (GTK_CHECK_CAST((obj), \
- e_week_view_event_item_get_type (), EWeekViewEventItem))
-#define E_WEEK_VIEW_EVENT_ITEM_CLASS(k) (GTK_CHECK_CLASS_CAST ((k),\
- e_week_view_event_item_get_type ()))
-#define E_IS_WEEK_VIEW_EVENT_ITEM(o) (GTK_CHECK_TYPE((o), \
- e_week_view_event_item_get_type ()))
-
-typedef struct {
- GnomeCanvasItem canvas_item;
-
- /* The event index in the EWeekView events array. */
- gint event_num;
-
- /* The span index within the event. */
- gint span_num;
-} EWeekViewEventItem;
-
-typedef struct {
- GnomeCanvasItemClass parent_class;
-
-} EWeekViewEventItemClass;
-
-
-GtkType e_week_view_event_item_get_type (void);
-
-
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _E_WEEK_VIEW_EVENT_ITEM_H_ */
diff --git a/calendar/gui/e-week-view-layout.c b/calendar/gui/e-week-view-layout.c
deleted file mode 100644
index 4ab1cf1fd9..0000000000
--- a/calendar/gui/e-week-view-layout.c
+++ /dev/null
@@ -1,425 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Author :
- * Damon Chaplin <damon@ximian.com>
- *
- * Copyright 2001, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-/*
- * Lays out events for the Week & Month views of the calendar. It is also
- * used for printing.
- */
-
-#include <config.h>
-
-#include "e-week-view-layout.h"
-
-
-static void e_week_view_layout_event (EWeekViewEvent *event,
- guint8 *grid,
- GArray *spans,
- GArray *old_spans,
- gboolean multi_week_view,
- gint weeks_shown,
- gboolean compress_weekend,
- gint start_weekday,
- time_t *day_starts,
- gint *rows_per_day);
-static gint e_week_view_find_day (time_t time_to_find,
- gboolean include_midnight_in_prev_day,
- gint days_shown,
- time_t *day_starts);
-static gint e_week_view_find_span_end (gboolean multi_week_view,
- gboolean compress_weekend,
- gint display_start_day,
- gint day);
-
-
-GArray*
-e_week_view_layout_events (GArray *events,
- GArray *old_spans,
- gboolean multi_week_view,
- gint weeks_shown,
- gboolean compress_weekend,
- gint start_weekday,
- time_t *day_starts,
- gint *rows_per_day)
-{
- EWeekViewEvent *event;
- EWeekViewEventSpan *span;
- gint num_days, day, event_num, span_num;
- guint8 *grid;
- GArray *spans;
-
- /* This is a temporary 2-d grid which is used to place events.
- Each element is 0 if the position is empty, or 1 if occupied.
- We allocate the maximum size possible here, assuming that each
- event will need its own row. */
- grid = g_new0 (guint8, E_WEEK_VIEW_MAX_ROWS_PER_CELL * 7
- * E_WEEK_VIEW_MAX_WEEKS);
-
- /* We create a new array of spans, which will replace the old one. */
- spans = g_array_new (FALSE, FALSE, sizeof (EWeekViewEventSpan));
-
- /* Clear the number of rows used per day. */
- num_days = multi_week_view ? weeks_shown * 7 : 7;
- for (day = 0; day < num_days; day++) {
- rows_per_day[day] = 0;
- }
-
- /* Iterate over the events, finding which weeks they cover, and putting
- them in the first free row available. */
- for (event_num = 0; event_num < events->len; event_num++) {
- event = &g_array_index (events, EWeekViewEvent, event_num);
- e_week_view_layout_event (event, grid, spans, old_spans,
- multi_week_view,
- weeks_shown, compress_weekend,
- start_weekday, day_starts,
- rows_per_day);
- }
-
- /* Free the grid. */
- g_free (grid);
-
- /* Destroy the old spans array, destroying any unused canvas items. */
- if (old_spans) {
- for (span_num = 0; span_num < old_spans->len; span_num++) {
- span = &g_array_index (old_spans, EWeekViewEventSpan,
- span_num);
- if (span->background_item)
- gtk_object_destroy (GTK_OBJECT (span->background_item));
- if (span->text_item)
- gtk_object_destroy (GTK_OBJECT (span->text_item));
- }
- g_array_free (old_spans, TRUE);
- }
-
- return spans;
-}
-
-
-static void
-e_week_view_layout_event (EWeekViewEvent *event,
- guint8 *grid,
- GArray *spans,
- GArray *old_spans,
- gboolean multi_week_view,
- gint weeks_shown,
- gboolean compress_weekend,
- gint start_weekday,
- time_t *day_starts,
- gint *rows_per_day)
-{
- gint start_day, end_day, span_start_day, span_end_day, rows_per_cell;
- gint free_row, row, day, span_num, spans_index, num_spans, days_shown;
- EWeekViewEventSpan span, *old_span;
-
- days_shown = multi_week_view ? weeks_shown * 7 : 7;
- start_day = e_week_view_find_day (event->start, FALSE, days_shown,
- day_starts);
- end_day = e_week_view_find_day (event->end, TRUE, days_shown,
- day_starts);
- start_day = CLAMP (start_day, 0, days_shown - 1);
- end_day = CLAMP (end_day, 0, days_shown - 1);
-
-#if 0
- g_print ("In e_week_view_layout_event Start:%i End: %i\n",
- start_day, end_day);
-#endif
-
- /* Iterate through each of the spans of the event, where each span
- is a sequence of 1 or more days displayed next to each other. */
- span_start_day = start_day;
- rows_per_cell = E_WEEK_VIEW_MAX_ROWS_PER_CELL;
- span_num = 0;
- spans_index = spans->len;
- num_spans = 0;
- while (span_start_day <= end_day) {
- span_end_day = e_week_view_find_span_end (multi_week_view,
- compress_weekend,
- start_weekday,
- span_start_day);
- span_end_day = MIN (span_end_day, end_day);
-#if 0
- g_print (" Span start:%i end:%i\n", span_start_day,
- span_end_day);
-#endif
- /* Try each row until we find a free one or we fall off the
- bottom of the available rows. */
- row = 0;
- free_row = -1;
- while (free_row == -1 && row < rows_per_cell) {
- free_row = row;
- for (day = span_start_day; day <= span_end_day;
- day++) {
- if (grid[day * rows_per_cell + row]) {
- free_row = -1;
- break;
- }
- }
- row++;
- };
-
- if (free_row != -1) {
- /* Mark the cells as full. */
- for (day = span_start_day; day <= span_end_day;
- day++) {
- grid[day * rows_per_cell + free_row] = 1;
- rows_per_day[day] = MAX (rows_per_day[day],
- free_row + 1);
- }
-#if 0
- g_print (" Span start:%i end:%i row:%i\n",
- span_start_day, span_end_day, free_row);
-#endif
- /* Add the span to the array, and try to reuse any
- canvas items from the old spans. */
- span.start_day = span_start_day;
- span.num_days = span_end_day - span_start_day + 1;
- span.row = free_row;
- span.background_item = NULL;
- span.text_item = NULL;
- if (event->num_spans > span_num) {
- old_span = &g_array_index (old_spans, EWeekViewEventSpan, event->spans_index + span_num);
- span.background_item = old_span->background_item;
- span.text_item = old_span->text_item;
- old_span->background_item = NULL;
- old_span->text_item = NULL;
- }
-
- g_array_append_val (spans, span);
- num_spans++;
- }
-
- span_start_day = span_end_day + 1;
- span_num++;
- }
-
- /* Set the event's spans. */
- event->spans_index = spans_index;
- event->num_spans = num_spans;
-}
-
-
-/* Finds the day containing the given time.
- If include_midnight_in_prev_day is TRUE then if the time exactly
- matches the start of a day the previous day is returned. This is useful
- when calculating the end day of an event. */
-static gint
-e_week_view_find_day (time_t time_to_find,
- gboolean include_midnight_in_prev_day,
- gint days_shown,
- time_t *day_starts)
-{
- gint day;
-
- if (time_to_find < day_starts[0])
- return -1;
- if (time_to_find > day_starts[days_shown])
- return days_shown;
-
- for (day = 1; day <= days_shown; day++) {
- if (time_to_find <= day_starts[day]) {
- if (time_to_find == day_starts[day]
- && !include_midnight_in_prev_day)
- return day;
- return day - 1;
- }
- }
-
- g_assert_not_reached ();
- return days_shown;
-}
-
-
-/* This returns the last possible day in the same span as the given day.
- A span is all the days which are displayed next to each other from left to
- right. In the week view all spans are only 1 day, since Tuesday is below
- Monday rather than beside it etc. In the month view, if the weekends are not
- compressed then each week is a span, otherwise we have to break a span up
- on Saturday, use a separate span for Sunday, and start again on Monday. */
-static gint
-e_week_view_find_span_end (gboolean multi_week_view,
- gboolean compress_weekend,
- gint display_start_day,
- gint day)
-{
- gint week, col, sat_col, end_col;
-
- if (multi_week_view) {
- week = day / 7;
- col = day % 7;
-
- /* We default to the last column in the row. */
- end_col = 6;
-
- /* If the weekend is compressed we must end any spans on
- Saturday and Sunday. */
- if (compress_weekend) {
- sat_col = (5 + 7 - display_start_day) % 7;
- if (col <= sat_col)
- end_col = sat_col;
- else if (col == sat_col + 1)
- end_col = sat_col + 1;
- }
-
- return week * 7 + end_col;
- } else {
- return day;
- }
-}
-
-
-void
-e_week_view_layout_get_day_position (gint day,
- gboolean multi_week_view,
- gint weeks_shown,
- gint display_start_day,
- gboolean compress_weekend,
- gint *day_x,
- gint *day_y,
- gint *rows)
-{
- gint week, day_of_week, row, col, weekend_col, box, weekend_box;
-
- *day_x = *day_y = *rows = 0;
- g_return_if_fail (day >= 0);
-
- if (multi_week_view) {
- g_return_if_fail (day < weeks_shown * 7);
-
- week = day / 7;
- col = day % 7;
- day_of_week = (display_start_day + day) % 7;
- if (compress_weekend && day_of_week >= 5) {
- /* In the compressed view Saturday is above Sunday and
- both have just one row as opposed to 2 for all the
- other days. */
- if (day_of_week == 5) {
- *day_y = week * 2;
- *rows = 1;
- } else {
- *day_y = week * 2 + 1;
- *rows = 1;
- col--;
- }
- /* Both Saturday and Sunday are in the same column. */
- *day_x = col;
- } else {
- /* If the weekend is compressed and the day is after
- the weekend we have to move back a column. */
- if (compress_weekend) {
- /* Calculate where the weekend column is.
- Note that 5 is Saturday. */
- weekend_col = (5 + 7 - display_start_day) % 7;
- if (col > weekend_col)
- col--;
- }
-
- *day_y = week * 2;
- *rows = 2;
- *day_x = col;
- }
- } else {
- g_return_if_fail (day < 7);
-
- /* Calculate which box to place the day in, from 0-5.
- Note that in the week view the weekends are always
- compressed and share a box. */
- box = day;
- day_of_week = (display_start_day + day) % 7;
- weekend_box = (5 + 7 - display_start_day) % 7;
- if (box > weekend_box)
- box--;
-
- if (box < 3)
- *day_x = 0;
- else
- *day_x = 1;
-
- row = (box % 3) * 2;
- if (day_of_week < 5) {
- *day_y = row;
- *rows = 2;
- } else if (day_of_week == 5) {
- /* Saturday. */
- *day_y = row;
- *rows = 1;
-
- } else {
- /* Sunday. */
- *day_y = row + 1;
- *rows = 1;
- }
- }
-}
-
-
-/* Returns TRUE if the event span is visible or FALSE if it isn't.
- It also returns the number of days of the span that are visible.
- Usually this can easily be determined by the start & end days and row of
- the span, which are set in e_week_view_layout_event(). Though we need a
- special case for the weekends when they are compressed, since the span may
- not fit. */
-gboolean
-e_week_view_layout_get_span_position (EWeekViewEvent *event,
- EWeekViewEventSpan *span,
- gint rows_per_cell,
- gint rows_per_compressed_cell,
- gint display_start_day,
- gboolean multi_week_view,
- gboolean compress_weekend,
- gint *span_num_days)
-{
- gint end_day_of_week;
-
- if (span->row >= rows_per_cell)
- return FALSE;
-
- end_day_of_week = (display_start_day + span->start_day
- + span->num_days - 1) % 7;
- *span_num_days = span->num_days;
- /* Check if the row will not be visible in compressed cells. */
- if (span->row >= rows_per_compressed_cell) {
- if (multi_week_view) {
- if (compress_weekend) {
- /* If it ends on a Saturday and is 1 day long
- we skip it, else we shorten it. If it ends
- on a Sunday it must be 1 day long and we
- skip it. */
- if (end_day_of_week == 5) { /* Sat */
- if (*span_num_days == 1) {
- return FALSE;
- } else {
- (*span_num_days)--;
- }
- } else if (end_day_of_week == 6) { /* Sun */
- return FALSE;
- }
- }
- } else {
- /* All spans are 1 day long in the week view, so we
- just skip it. */
- if (end_day_of_week > 4)
- return FALSE;
- }
- }
-
- return TRUE;
-}
diff --git a/calendar/gui/e-week-view-layout.h b/calendar/gui/e-week-view-layout.h
deleted file mode 100644
index 2c6d5a29d8..0000000000
--- a/calendar/gui/e-week-view-layout.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Author :
- * Damon Chaplin <damon@ximian.com>
- *
- * Copyright 2001, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-#ifndef _E_WEEK_VIEW_LAYOUT_H_
-#define _E_WEEK_VIEW_LAYOUT_H_
-
-#include "e-week-view.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-/* I've split these functions away from EWeekView so we can use them for
- printing. */
-
-GArray* e_week_view_layout_events (GArray *events,
- GArray *old_spans,
- gboolean multi_week_view,
- gint weeks_shown,
- gboolean compress_weekend,
- gint start_weekday,
- time_t *day_starts,
- gint *rows_per_day);
-
-/* Returns which 'cell' in the table the day appears in. Note that most days
- have a height of 2 rows, but Sat/Sun are sometimes compressed so they have
- a height of only 1 row. */
-void e_week_view_layout_get_day_position(gint day,
- gboolean multi_week_view,
- gint weeks_shown,
- gint display_start_day,
- gboolean compress_weekend,
- gint *cell_x,
- gint *cell_y,
- gint *rows);
-
-gboolean e_week_view_layout_get_span_position (EWeekViewEvent *event,
- EWeekViewEventSpan *span,
- gint rows_per_cell,
- gint rows_per_compressed_cell,
- gint display_start_day,
- gboolean multi_week_view,
- gboolean compress_weekend,
- gint *span_num_days);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _E_WEEK_VIEW_LAYOUT_H_ */
diff --git a/calendar/gui/e-week-view-main-item.c b/calendar/gui/e-week-view-main-item.c
deleted file mode 100644
index ed823c2dcd..0000000000
--- a/calendar/gui/e-week-view-main-item.c
+++ /dev/null
@@ -1,400 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Author :
- * Damon Chaplin <damon@ximian.com>
- *
- * Copyright 1999, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-/*
- * EWeekViewMainItem - displays the background grid and dates for the Week and
- * Month calendar views.
- */
-
-#include <config.h>
-
-#include <glib.h>
-#include <libgnome/gnome-i18n.h>
-#include "e-week-view-main-item.h"
-
-static void e_week_view_main_item_class_init (EWeekViewMainItemClass *class);
-static void e_week_view_main_item_init (EWeekViewMainItem *wvmitem);
-
-static void e_week_view_main_item_set_arg (GtkObject *o,
- GtkArg *arg,
- guint arg_id);
-static void e_week_view_main_item_update (GnomeCanvasItem *item,
- double *affine,
- ArtSVP *clip_path,
- int flags);
-static void e_week_view_main_item_draw (GnomeCanvasItem *item,
- GdkDrawable *drawable,
- int x,
- int y,
- int width,
- int height);
-static void e_week_view_main_item_draw_day (EWeekViewMainItem *wvmitem,
- gint day,
- GDate *date,
- GdkDrawable *drawable,
- gint x,
- gint y,
- gint width,
- gint height);
-static double e_week_view_main_item_point (GnomeCanvasItem *item,
- double x,
- double y,
- int cx,
- int cy,
- GnomeCanvasItem **actual_item);
-
-
-static GnomeCanvasItemClass *parent_class;
-
-/* The arguments we take */
-enum {
- ARG_0,
- ARG_WEEK_VIEW
-};
-
-E_MAKE_TYPE (e_week_view_main_item, "EWeekViewMainItem", EWeekViewMainItem,
- e_week_view_main_item_class_init, e_week_view_main_item_init,
- GNOME_TYPE_CANVAS_ITEM);
-
-static void
-e_week_view_main_item_class_init (EWeekViewMainItemClass *class)
-{
- GtkObjectClass *object_class;
- GnomeCanvasItemClass *item_class;
-
- parent_class = g_type_class_peek_parent (class);
-
- object_class = (GtkObjectClass *) class;
- item_class = (GnomeCanvasItemClass *) class;
-
- gtk_object_add_arg_type ("EWeekViewMainItem::week_view",
- GTK_TYPE_POINTER, GTK_ARG_WRITABLE,
- ARG_WEEK_VIEW);
-
- object_class->set_arg = e_week_view_main_item_set_arg;
-
- /* GnomeCanvasItem method overrides */
- item_class->update = e_week_view_main_item_update;
- item_class->draw = e_week_view_main_item_draw;
- item_class->point = e_week_view_main_item_point;
-}
-
-
-static void
-e_week_view_main_item_init (EWeekViewMainItem *wvmitem)
-{
- wvmitem->week_view = NULL;
-}
-
-
-static void
-e_week_view_main_item_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
-{
- GnomeCanvasItem *item;
- EWeekViewMainItem *wvmitem;
-
- item = GNOME_CANVAS_ITEM (o);
- wvmitem = E_WEEK_VIEW_MAIN_ITEM (o);
-
- switch (arg_id){
- case ARG_WEEK_VIEW:
- wvmitem->week_view = GTK_VALUE_POINTER (*arg);
- break;
- }
-}
-
-
-static void
-e_week_view_main_item_update (GnomeCanvasItem *item,
- double *affine,
- ArtSVP *clip_path,
- int flags)
-{
- if (GNOME_CANVAS_ITEM_CLASS (parent_class)->update)
- (* GNOME_CANVAS_ITEM_CLASS (parent_class)->update) (item, affine, clip_path, flags);
-
- /* The item covers the entire canvas area. */
- item->x1 = 0;
- item->y1 = 0;
- item->x2 = INT_MAX;
- item->y2 = INT_MAX;
-}
-
-
-/*
- * DRAWING ROUTINES - functions to paint the canvas item.
- */
-
-static void
-e_week_view_main_item_draw (GnomeCanvasItem *canvas_item,
- GdkDrawable *drawable,
- int x,
- int y,
- int width,
- int height)
-{
- EWeekViewMainItem *wvmitem;
- EWeekView *week_view;
- GDate date;
- gint num_days, day, day_x, day_y, day_w, day_h;
-
-#if 0
- g_print ("In e_week_view_main_item_draw %i,%i %ix%i\n",
- x, y, width, height);
-#endif
-
- wvmitem = E_WEEK_VIEW_MAIN_ITEM (canvas_item);
- week_view = wvmitem->week_view;
- g_return_if_fail (week_view != NULL);
-
- /* Step through each of the days. */
- date = week_view->first_day_shown;
-
- /* If no date has been set, we just use Dec 1999/January 2000. */
- if (!g_date_valid (&date))
- g_date_set_dmy (&date, 27, 12, 1999);
-
- num_days = week_view->multi_week_view ? week_view->weeks_shown * 7 : 7;
- for (day = 0; day < num_days; day++) {
- e_week_view_get_day_position (week_view, day,
- &day_x, &day_y,
- &day_w, &day_h);
- /* Skip any days which are outside the area. */
- if (day_x < x + width && day_x + day_w >= x
- && day_y < y + height && day_y + day_h >= y) {
- e_week_view_main_item_draw_day (wvmitem, day, &date,
- drawable,
- day_x - x, day_y - y,
- day_w, day_h);
- }
- g_date_add_days (&date, 1);
- }
-}
-
-
-static void
-e_week_view_main_item_draw_day (EWeekViewMainItem *wvmitem,
- gint day,
- GDate *date,
- GdkDrawable *drawable,
- gint x,
- gint y,
- gint width,
- gint height)
-{
- EWeekView *week_view;
- GtkStyle *style;
- GdkGC *gc;
- gint right_edge, bottom_edge, date_width, date_x, line_y;
- gboolean show_day_name, show_month_name, selected;
- gchar buffer[128], *format_string;
- gint month, day_of_month, max_width;
- GdkColor *bg_color;
- PangoFontDescription *font_desc;
- PangoContext *pango_context;
- PangoFontMetrics *font_metrics;
- PangoLayout *layout;
-
-#if 0
- g_print ("Drawing Day:%i at %i,%i\n", day, x, y);
-#endif
- week_view = wvmitem->week_view;
- style = gtk_widget_get_style (GTK_WIDGET (week_view));
- gc = week_view->main_gc;
-
- /* Set up Pango prerequisites */
- font_desc = style->font_desc;
- pango_context = gtk_widget_get_pango_context (GTK_WIDGET (week_view));
- font_metrics = pango_context_get_metrics (pango_context, font_desc,
- pango_context_get_language (pango_context));
-
- g_return_if_fail (gc != NULL);
-
- month = g_date_month (date);
- day_of_month = g_date_day (date);
- line_y = y + 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;
-
- /* Draw the background of the day. In the month view odd months are
- one color and even months another, so you can easily see when each
- month starts (defaults are white for odd - January, March, ... and
- light gray for even). In the week view the background is always the
- same color, the color used for the odd months in the month view. */
- if (week_view->multi_week_view && (month % 2 == 0))
- bg_color = &week_view->colors[E_WEEK_VIEW_COLOR_EVEN_MONTHS];
- else
- bg_color = &week_view->colors[E_WEEK_VIEW_COLOR_ODD_MONTHS];
-
- gdk_gc_set_foreground (gc, bg_color);
- gdk_draw_rectangle (drawable, gc, TRUE, x, y, width, height);
-
- /* Draw the lines on the right and bottom of the cell. The canvas is
- sized so that the lines on the right & bottom edges will be off the
- edge of the canvas, so we don't have to worry about them. */
- right_edge = x + width - 1;
- bottom_edge = y + height - 1;
-
- gdk_gc_set_foreground (gc, &week_view->colors[E_WEEK_VIEW_COLOR_GRID]);
- gdk_draw_line (drawable, gc,
- right_edge, y, right_edge, bottom_edge);
- gdk_draw_line (drawable, gc,
- x, bottom_edge, right_edge, bottom_edge);
-
- /* If the day is selected, draw the blue background. */
- selected = TRUE;
- if (week_view->selection_start_day == -1
- || week_view->selection_start_day > day
- || week_view->selection_end_day < day)
- selected = FALSE;
- if (selected) {
- if (GTK_WIDGET_HAS_FOCUS (week_view))
- gdk_gc_set_foreground (gc, &week_view->colors[E_WEEK_VIEW_COLOR_SELECTED]);
- else
- gdk_gc_set_foreground (gc, &week_view->colors[E_WEEK_VIEW_COLOR_SELECTED_UNFOCUSSED]);
-
- if (week_view->multi_week_view) {
- gdk_draw_rectangle (drawable, gc, TRUE,
- x + 2, y + 1,
- width - 5,
- E_WEEK_VIEW_DATE_T_PAD - 1 +
- PANGO_PIXELS (pango_font_metrics_get_ascent (font_metrics)) +
- PANGO_PIXELS (pango_font_metrics_get_descent (font_metrics)));
- } else {
- gdk_draw_rectangle (drawable, gc, TRUE,
- x + 2, y + 1,
- width - 5, line_y - y);
- }
- }
-
- /* Display the date in the top of the cell.
- In the week view, display the long format "10 January" in all cells,
- or abbreviate it to "10 Jan" or "10" if that doesn't fit.
- In the month view, only use the long format for the first cell and
- the 1st of each month, otherwise use "10". */
- show_day_name = FALSE;
- show_month_name = FALSE;
- if (!week_view->multi_week_view) {
- show_day_name = TRUE;
- show_month_name = TRUE;
- } else if (day == 0 || day_of_month == 1) {
- show_month_name = TRUE;
- }
-
- /* Now find the longest form of the date that will fit. */
- max_width = width - 4;
- format_string = NULL;
- if (show_day_name) {
- if (week_view->max_day_width + week_view->digit_width * 2
- + week_view->space_width * 2
- + week_view->month_widths[month - 1] < max_width)
- /* strftime format %A = full weekday name, %d = day of
- month, %B = full month name. You can change the
- order but don't change the specifiers or add
- anything. */
- format_string = _("%A %d %B");
- else if (week_view->max_abbr_day_width
- + week_view->digit_width * 2
- + week_view->space_width * 2
- + week_view->abbr_month_widths[month - 1] < max_width)
- /* strftime format %a = abbreviated weekday name,
- %d = day of month, %b = abbreviated month name.
- You can change the order but don't change the
- specifiers or add anything. */
- format_string = _("%a %d %b");
- }
- if (!format_string && show_month_name) {
- if (week_view->digit_width * 2 + week_view->space_width
- + week_view->month_widths[month - 1] < max_width)
- /* strftime format %d = day of month, %B = full
- month name. You can change the order but don't
- change the specifiers or add anything. */
- format_string = _("%d %B");
- else if (week_view->digit_width * 2 + week_view->space_width
- + week_view->abbr_month_widths[month - 1] < max_width)
- /* strftime format %d = day of month, %b = abbreviated
- month name. You can change the order but don't
- change the specifiers or add anything. */
- format_string = _("%d %b");
- }
-
- if (selected) {
- gdk_gc_set_foreground (gc, &week_view->colors[E_WEEK_VIEW_COLOR_DATES_SELECTED]);
- } else if (week_view->multi_week_view) {
- struct icaltimetype tt;
-
- /* Check if we are drawing today */
- tt = icaltime_from_timet_with_zone (time (NULL), FALSE,
- e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view)));
- if (g_date_year (date) == tt.year
- && g_date_month (date) == tt.month
- && g_date_day (date) == tt.day)
- gdk_gc_set_foreground (gc, &week_view->colors[E_WEEK_VIEW_COLOR_TODAY]);
- else
- gdk_gc_set_foreground (gc, &week_view->colors[E_WEEK_VIEW_COLOR_DATES]);
- } else {
- gdk_gc_set_foreground (gc, &week_view->colors[E_WEEK_VIEW_COLOR_DATES]);
- }
-
- g_date_strftime (buffer, sizeof (buffer),
- format_string ? format_string : "%d", date);
-
- layout = gtk_widget_create_pango_layout (GTK_WIDGET (week_view), buffer);
- pango_layout_get_pixel_size (layout, &date_width, NULL);
- date_x = x + width - date_width - E_WEEK_VIEW_DATE_R_PAD;
- date_x = MAX (date_x, x + 1);
-
- gdk_draw_layout (drawable, gc,
- date_x,
- y + E_WEEK_VIEW_DATE_T_PAD,
- layout);
- g_object_unref (layout);
-
- /* Draw the line under the date. */
- if (!week_view->multi_week_view) {
- gdk_gc_set_foreground (gc, &week_view->colors[E_WEEK_VIEW_COLOR_GRID]);
- gdk_draw_line (drawable, gc,
- x + E_WEEK_VIEW_DATE_LINE_L_PAD, line_y,
- right_edge, line_y);
- }
-
- pango_font_metrics_unref (font_metrics);
-}
-
-
-
-
-/* This is supposed to return the nearest item the the point and the distance.
- Since we are the only item we just return ourself and 0 for the distance.
- This is needed so that we get button/motion events. */
-static double
-e_week_view_main_item_point (GnomeCanvasItem *item, double x, double y,
- int cx, int cy,
- GnomeCanvasItem **actual_item)
-{
- *actual_item = item;
- return 0.0;
-}
-
-
diff --git a/calendar/gui/e-week-view-main-item.h b/calendar/gui/e-week-view-main-item.h
deleted file mode 100644
index 35740479da..0000000000
--- a/calendar/gui/e-week-view-main-item.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Author :
- * Damon Chaplin <damon@ximian.com>
- *
- * Copyright 1999, Ximian, Inc.
- * Copyright 2001, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-#ifndef _E_WEEK_VIEW_MAIN_ITEM_H_
-#define _E_WEEK_VIEW_MAIN_ITEM_H_
-
-#include "e-week-view.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-/*
- * EWeekViewMainItem - displays the background grid and dates for the Week and
- * Month calendar views.
- */
-
-#define E_WEEK_VIEW_MAIN_ITEM(obj) (GTK_CHECK_CAST((obj), \
- e_week_view_main_item_get_type (), EWeekViewMainItem))
-#define E_WEEK_VIEW_MAIN_ITEM_CLASS(k) (GTK_CHECK_CLASS_CAST ((k),\
- e_week_view_main_item_get_type ()))
-#define E_IS_WEEK_VIEW_MAIN_ITEM(o) (GTK_CHECK_TYPE((o), \
- e_week_view_main_item_get_type ()))
-
-typedef struct {
- GnomeCanvasItem canvas_item;
-
- /* The parent EWeekView widget. */
- EWeekView *week_view;
-} EWeekViewMainItem;
-
-typedef struct {
- GnomeCanvasItemClass parent_class;
-
-} EWeekViewMainItemClass;
-
-
-GtkType e_week_view_main_item_get_type (void);
-
-
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _E_WEEK_VIEW_MAIN_ITEM_H_ */
diff --git a/calendar/gui/e-week-view-titles-item.c b/calendar/gui/e-week-view-titles-item.c
deleted file mode 100644
index 733bec9a81..0000000000
--- a/calendar/gui/e-week-view-titles-item.c
+++ /dev/null
@@ -1,296 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Author :
- * Damon Chaplin <damon@ximian.com>
- *
- * Copyright 1999, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-/*
- * EWeekViewTitlesItem - displays the 'Monday', 'Tuesday' etc. at the top of
- * the Month calendar view.
- */
-
-#include <config.h>
-#include <string.h>
-#include "e-week-view-titles-item.h"
-
-static void e_week_view_titles_item_class_init (EWeekViewTitlesItemClass *class);
-static void e_week_view_titles_item_init (EWeekViewTitlesItem *wvtitem);
-
-static void e_week_view_titles_item_set_arg (GtkObject *o,
- GtkArg *arg,
- guint arg_id);
-static void e_week_view_titles_item_update (GnomeCanvasItem *item,
- double *affine,
- ArtSVP *clip_path,
- int flags);
-static void e_week_view_titles_item_draw (GnomeCanvasItem *item,
- GdkDrawable *drawable,
- int x,
- int y,
- int width,
- int height);
-static double e_week_view_titles_item_point (GnomeCanvasItem *item,
- double x,
- double y,
- int cx,
- int cy,
- GnomeCanvasItem **actual_item);
-
-
-static GnomeCanvasItemClass *parent_class;
-
-/* The arguments we take */
-enum {
- ARG_0,
- ARG_WEEK_VIEW
-};
-
-E_MAKE_TYPE (e_week_view_titles_item, "EWeekViewTitlesItem", EWeekViewTitlesItem,
- e_week_view_titles_item_class_init, e_week_view_titles_item_init,
- GNOME_TYPE_CANVAS_ITEM);
-
-static void
-e_week_view_titles_item_class_init (EWeekViewTitlesItemClass *class)
-{
- GtkObjectClass *object_class;
- GnomeCanvasItemClass *item_class;
-
- parent_class = g_type_class_peek_parent (class);
-
- object_class = (GtkObjectClass *) class;
- item_class = (GnomeCanvasItemClass *) class;
-
- gtk_object_add_arg_type ("EWeekViewTitlesItem::week_view",
- GTK_TYPE_POINTER, GTK_ARG_WRITABLE,
- ARG_WEEK_VIEW);
-
- object_class->set_arg = e_week_view_titles_item_set_arg;
-
- /* GnomeCanvasItem method overrides */
- item_class->update = e_week_view_titles_item_update;
- item_class->draw = e_week_view_titles_item_draw;
- item_class->point = e_week_view_titles_item_point;
-}
-
-
-static void
-e_week_view_titles_item_init (EWeekViewTitlesItem *wvtitem)
-{
- wvtitem->week_view = NULL;
-}
-
-
-static void
-e_week_view_titles_item_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
-{
- GnomeCanvasItem *item;
- EWeekViewTitlesItem *wvtitem;
-
- item = GNOME_CANVAS_ITEM (o);
- wvtitem = E_WEEK_VIEW_TITLES_ITEM (o);
-
- switch (arg_id){
- case ARG_WEEK_VIEW:
- wvtitem->week_view = GTK_VALUE_POINTER (*arg);
- break;
- }
-}
-
-
-static void
-e_week_view_titles_item_update (GnomeCanvasItem *item,
- double *affine,
- ArtSVP *clip_path,
- int flags)
-{
- if (GNOME_CANVAS_ITEM_CLASS (parent_class)->update)
- (* GNOME_CANVAS_ITEM_CLASS (parent_class)->update) (item, affine, clip_path, flags);
-
- /* The item covers the entire canvas area. */
- item->x1 = 0;
- item->y1 = 0;
- item->x2 = INT_MAX;
- item->y2 = INT_MAX;
-}
-
-
-/*
- * DRAWING ROUTINES - functions to paint the canvas item.
- */
-
-static void
-e_week_view_titles_item_draw (GnomeCanvasItem *canvas_item,
- GdkDrawable *drawable,
- int x,
- int y,
- int width,
- int height)
-{
- EWeekViewTitlesItem *wvtitem;
- EWeekView *week_view;
- GtkStyle *style;
- GdkGC *fg_gc, *bg_gc, *light_gc, *dark_gc;
- gint canvas_width, canvas_height, col_width, col, date_width, date_x;
- gchar buffer[128], *date_format;
- GDate date;
- GdkRectangle clip_rect;
- gboolean long_format;
- gint weekday;
- PangoLayout *layout;
-
-#if 0
- g_print ("In e_week_view_titles_item_draw %i,%i %ix%i\n",
- x, y, width, height);
-#endif
-
- wvtitem = E_WEEK_VIEW_TITLES_ITEM (canvas_item);
- week_view = wvtitem->week_view;
- g_return_if_fail (week_view != NULL);
-
- style = gtk_widget_get_style (GTK_WIDGET (week_view));
- fg_gc = style->fg_gc[GTK_STATE_NORMAL];
- bg_gc = style->bg_gc[GTK_STATE_NORMAL];
- light_gc = style->light_gc[GTK_STATE_NORMAL];
- dark_gc = style->dark_gc[GTK_STATE_NORMAL];
- canvas_width = GTK_WIDGET (canvas_item->canvas)->allocation.width;
- canvas_height = GTK_WIDGET (canvas_item->canvas)->allocation.height;
- layout = gtk_widget_create_pango_layout (GTK_WIDGET (week_view), NULL);
-
- /* Draw the shadow around the dates. */
- gdk_draw_line (drawable, light_gc,
- 1 - x, 1 - y,
- canvas_width - 2 - x, 1 - y);
- gdk_draw_line (drawable, light_gc,
- 1 - x, 2 - y,
- 1 - x, canvas_height - 1 - y);
-
- gdk_draw_rectangle (drawable, dark_gc, FALSE,
- 0 - x, 0 - y,
- canvas_width - 1, canvas_height);
-
- /* Determine the format to use. */
- col_width = canvas_width / week_view->columns;
- if (col_width > week_view->max_day_width + 2) {
- date_format = "%A";
- long_format = TRUE;
- } else {
- date_format = "%a";
- long_format = FALSE;
- }
-
- /* Shift right one pixel to account for the shadow around the main
- canvas. */
- x--;
-
- /* Draw the date. Set a clipping rectangle so we don't draw over the
- next day. */
- g_date_clear (&date, 1);
- /* Note that 20th March 2000 is a Monday. We only care about the
- weekday. */
- weekday = week_view->display_start_day;
- g_date_set_dmy (&date, 20 + weekday, 3, 2000);
- for (col = 0; col < week_view->columns; col++) {
- if (weekday == 5 && week_view->compress_weekend) {
- g_date_strftime (buffer, 128, "%a/", &date);
- g_date_add_days (&date, 1);
- g_date_strftime (buffer + strlen (buffer), 100,
- "%a", &date);
- } else {
- g_date_strftime (buffer, 128, date_format, &date);
- }
-
- clip_rect.x = week_view->col_offsets[col] - x;
- clip_rect.y = 2 - y;
- clip_rect.width = week_view->col_widths[col];
- clip_rect.height = canvas_height - 2;
- gdk_gc_set_clip_rectangle (fg_gc, &clip_rect);
-
- if (weekday == 5 && week_view->compress_weekend)
- date_width = week_view->abbr_day_widths[5]
- + week_view->slash_width
- + week_view->abbr_day_widths[6];
- else if (long_format)
- date_width = week_view->day_widths[weekday];
- else
- date_width = week_view->abbr_day_widths[weekday];
-
- date_x = week_view->col_offsets[col]
- + (week_view->col_widths[col] - date_width) / 2;
- date_x = MAX (date_x, week_view->col_offsets[col]);
-
- pango_layout_set_text (layout, buffer, -1);
- gdk_draw_layout (drawable, fg_gc,
- date_x - x,
- 3 - y,
- layout);
-
- gdk_gc_set_clip_rectangle (fg_gc, NULL);
-
- /* Draw the lines down the left and right of the date cols. */
- if (col != 0) {
- gdk_draw_line (drawable, light_gc,
- week_view->col_offsets[col] - x,
- 4 - y,
- week_view->col_offsets[col] - x,
- canvas_height - 4 - y);
-
- gdk_draw_line (drawable, dark_gc,
- week_view->col_offsets[col] - 1 - x,
- 4 - y,
- week_view->col_offsets[col] - 1 - x,
- canvas_height - 4 - y);
- }
-
- /* Draw the lines between each column. */
- if (col != 0) {
- gdk_draw_line (drawable, style->black_gc,
- week_view->col_offsets[col] - x,
- canvas_height - y,
- week_view->col_offsets[col] - x,
- canvas_height - y);
- }
-
- if (weekday == 5 && week_view->compress_weekend)
- weekday += 2;
- else
- weekday++;
-
- weekday = weekday % 7;
-
- g_date_add_days (&date, 1);
- }
-
- g_object_unref (layout);
-}
-
-
-/* This is supposed to return the nearest item the the point and the distance.
- Since we are the only item we just return ourself and 0 for the distance.
- This is needed so that we get button/motion events. */
-static double
-e_week_view_titles_item_point (GnomeCanvasItem *item, double x, double y,
- int cx, int cy,
- GnomeCanvasItem **actual_item)
-{
- *actual_item = item;
- return 0.0;
-}
-
-
diff --git a/calendar/gui/e-week-view-titles-item.h b/calendar/gui/e-week-view-titles-item.h
deleted file mode 100644
index 77fed506c8..0000000000
--- a/calendar/gui/e-week-view-titles-item.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Author :
- * Damon Chaplin <damon@ximian.com>
- *
- * Copyright 1999, Ximian, Inc.
- * Copyright 2001, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-#ifndef _E_WEEK_VIEW_TITLES_ITEM_H_
-#define _E_WEEK_VIEW_TITLES_ITEM_H_
-
-#include "e-week-view.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-/*
- * EWeekViewTitlesItem - displays the 'Monday', 'Tuesday' etc. at the top of
- * the Month calendar view.
- */
-
-#define E_WEEK_VIEW_TITLES_ITEM(obj) (GTK_CHECK_CAST((obj), \
- e_week_view_titles_item_get_type (), EWeekViewTitlesItem))
-#define E_WEEK_VIEW_TITLES_ITEM_CLASS(k) (GTK_CHECK_CLASS_CAST ((k),\
- e_week_view_titles_item_get_type ()))
-#define E_IS_WEEK_VIEW_TITLES_ITEM(o) (GTK_CHECK_TYPE((o), \
- e_week_view_titles_item_get_type ()))
-
-typedef struct {
- GnomeCanvasItem canvas_item;
-
- /* The parent EWeekView widget. */
- EWeekView *week_view;
-} EWeekViewTitlesItem;
-
-typedef struct {
- GnomeCanvasItemClass parent_class;
-
-} EWeekViewTitlesItemClass;
-
-
-GtkType e_week_view_titles_item_get_type (void);
-
-
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _E_WEEK_VIEW_TITLES_ITEM_H_ */
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c
deleted file mode 100644
index dfa175c90e..0000000000
--- a/calendar/gui/e-week-view.c
+++ /dev/null
@@ -1,3676 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Authors :
- * Damon Chaplin <damon@ximian.com>
- * Rodrigo Moya <rodrigo@ximian.com>
- *
- * Copyright 1999, Ximian, Inc.
- * Copyright 2001, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-/*
- * EWeekView - displays the Week & Month views of the calendar.
- */
-
-#include <config.h>
-
-#include "e-week-view.h"
-#include "ea-calendar.h"
-
-#include <math.h>
-#include <gdk/gdkkeysyms.h>
-#include <gtk/gtkselection.h>
-#include <gtk/gtksignal.h>
-#include <gtk/gtkvscrollbar.h>
-#include <gtk/gtkwindow.h>
-#include <gtk/gtkmain.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnome/gnome-exec.h>
-#include <libgnome/gnome-util.h>
-#include <gdk-pixbuf/gdk-pixbuf.h>
-#include <libgnomecanvas/gnome-canvas-pixbuf.h>
-#include <gal/e-text/e-text.h>
-#include <gal/widgets/e-canvas-utils.h>
-#include <gal/widgets/e-gui-utils.h>
-#include <gal/widgets/e-unicode.h>
-#include <e-util/e-categories-config.h>
-#include <e-util/e-dialog-utils.h>
-#include "dialogs/delete-comp.h"
-#include "dialogs/delete-error.h"
-#include "dialogs/send-comp.h"
-#include "dialogs/cancel-comp.h"
-#include "dialogs/recur-comp.h"
-#include "comp-util.h"
-#include "itip-utils.h"
-#include <libecal/e-cal-time-util.h>
-#include "calendar-commands.h"
-#include "calendar-config.h"
-#include "print.h"
-#include "goto.h"
-#include "e-cal-model-calendar.h"
-#include "e-week-view-event-item.h"
-#include "e-week-view-layout.h"
-#include "e-week-view-main-item.h"
-#include "e-week-view-titles-item.h"
-#include "misc.h"
-
-/* Images */
-#include "art/bell.xpm"
-#include "art/recur.xpm"
-#include "art/timezone-16.xpm"
-#include "art/jump.xpm"
-
-#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
-
-
-typedef struct {
- EWeekView *week_view;
- ECalModelComponent *comp_data;
-} AddEventData;
-
-static void e_week_view_class_init (EWeekViewClass *class);
-static void e_week_view_init (EWeekView *week_view);
-static void e_week_view_destroy (GtkObject *object);
-static void e_week_view_realize (GtkWidget *widget);
-static void e_week_view_unrealize (GtkWidget *widget);
-static void e_week_view_style_set (GtkWidget *widget,
- GtkStyle *previous_style);
-static void e_week_view_size_allocate (GtkWidget *widget,
- GtkAllocation *allocation);
-static void e_week_view_recalc_cell_sizes (EWeekView *week_view);
-static gint e_week_view_focus_in (GtkWidget *widget,
- GdkEventFocus *event);
-static gint e_week_view_focus_out (GtkWidget *widget,
- GdkEventFocus *event);
-static gint e_week_view_expose_event (GtkWidget *widget,
- GdkEventExpose *event);
-static gboolean e_week_view_get_next_tab_event (EWeekView *week_view,
- GtkDirectionType direction,
- gint current_event_num,
- gint current_span_num,
- gint *next_event_num,
- gint *next_span_num);
-static gboolean e_week_view_focus (GtkWidget *widget,
- GtkDirectionType direction);
-static GList *e_week_view_get_selected_events (ECalendarView *cal_view);
-static void e_week_view_get_selected_time_range (ECalendarView *cal_view, time_t *start_time, time_t *end_time);
-static void e_week_view_set_selected_time_range (ECalendarView *cal_view, time_t start_time, time_t end_time);
-static gboolean e_week_view_get_visible_time_range (ECalendarView *cal_view, time_t *start_time, time_t *end_time);
-static void e_week_view_update_query (ECalendarView *cal_view);
-static void e_week_view_draw_shadow (EWeekView *week_view);
-
-static gboolean e_week_view_on_button_press (GtkWidget *widget,
- GdkEventButton *event,
- EWeekView *week_view);
-static gboolean e_week_view_on_button_release (GtkWidget *widget,
- GdkEventButton *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 gboolean e_week_view_add_event (ECalComponent *comp,
- time_t start,
- time_t end,
- 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_adjustment_changed (GtkAdjustment *adjustment,
- EWeekView *week_view);
-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,
- const gchar *uid,
- 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_on_jump_button_event (GnomeCanvasItem *item,
- GdkEvent *event,
- EWeekView *week_view);
-static gboolean e_week_view_key_press (GtkWidget *widget, GdkEventKey *event);
-static gboolean e_week_view_do_key_press (GtkWidget *widget,
- GdkEventKey *event);
-static void e_week_view_on_key_up (EWeekView *week_view, GdkEventKey *event);
-static void e_week_view_on_key_down (EWeekView *week_view, GdkEventKey *event);
-static void e_week_view_on_key_left (EWeekView *week_view, GdkEventKey *event);
-static void e_week_view_on_key_right (EWeekView *week_view, GdkEventKey *event);
-static gboolean e_week_view_popup_menu (GtkWidget *widget);
-
-static gboolean e_week_view_update_event_cb (EWeekView *week_view,
- gint event_num,
- gpointer data);
-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);
-
-static ECalendarViewClass *parent_class;
-
-E_MAKE_TYPE (e_week_view, "EWeekView", EWeekView, e_week_view_class_init,
- e_week_view_init, e_calendar_view_get_type ());
-
-static void
-e_week_view_class_init (EWeekViewClass *class)
-{
- GtkObjectClass *object_class;
- GtkWidgetClass *widget_class;
- ECalendarViewClass *view_class;
-
- parent_class = g_type_class_peek_parent (class);
- object_class = (GtkObjectClass *) class;
- widget_class = (GtkWidgetClass *) class;
- view_class = (ECalendarViewClass *) class;
-
- /* Method override */
- object_class->destroy = e_week_view_destroy;
-
- widget_class->realize = e_week_view_realize;
- widget_class->unrealize = e_week_view_unrealize;
- widget_class->style_set = e_week_view_style_set;
- widget_class->size_allocate = e_week_view_size_allocate;
- widget_class->focus_in_event = e_week_view_focus_in;
- widget_class->focus_out_event = e_week_view_focus_out;
- widget_class->key_press_event = e_week_view_key_press;
- widget_class->popup_menu = e_week_view_popup_menu;
- widget_class->expose_event = e_week_view_expose_event;
- widget_class->focus = e_week_view_focus;
-
- view_class->get_selected_events = e_week_view_get_selected_events;
- view_class->get_selected_time_range = e_week_view_get_selected_time_range;
- view_class->set_selected_time_range = e_week_view_set_selected_time_range;
- view_class->get_visible_time_range = e_week_view_get_visible_time_range;
- view_class->update_query = e_week_view_update_query;
-
- /* init the accessibility support for e_week_view */
- e_week_view_a11y_init ();
-}
-
-static void
-timezone_changed_cb (ECalendarView *cal_view, icaltimezone *old_zone,
- icaltimezone *new_zone, gpointer user_data)
-{
- 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));
-
- /* If we don't have a valid date set yet, just return. */
- if (!g_date_valid (&week_view->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_year (&week_view->first_day_shown);
- tt.month = g_date_month (&week_view->first_day_shown);
- tt.day = g_date_day (&week_view->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 ((ECalendarView *) week_view);
-}
-
-static void
-e_week_view_init (EWeekView *week_view)
-{
- GnomeCanvasGroup *canvas_group;
- GtkObject *adjustment;
- GdkPixbuf *pixbuf;
- gint i;
-
- GTK_WIDGET_SET_FLAGS (week_view, GTK_CAN_FOCUS);
-
- week_view->query = NULL;
-
- 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->multi_week_view = FALSE;
- week_view->weeks_shown = 6;
- week_view->rows = 6;
- week_view->columns = 2;
- week_view->compress_weekend = TRUE;
- week_view->show_event_end_times = TRUE;
- week_view->week_start_day = 0; /* Monday. */
- week_view->display_start_day = 0; /* Monday. */
-
- g_date_clear (&week_view->base_date, 1);
- g_date_clear (&week_view->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->main_gc = NULL;
-
- /* Create the small font. */
- week_view->use_small_font = TRUE;
-
- week_view->small_font_desc =
- pango_font_description_copy (gtk_widget_get_style (GTK_WIDGET (week_view))->font_desc);
- pango_font_description_set_size (week_view->small_font_desc,
- E_WEEK_VIEW_SMALL_FONT_PTSIZE * PANGO_SCALE);
-
- /* 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");
-
-
- /*
- * Titles Canvas. Note that we don't show it is only shown in the
- * Month view.
- */
- week_view->titles_canvas = e_canvas_new ();
- gtk_table_attach (GTK_TABLE (week_view), week_view->titles_canvas,
- 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
-
- 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_table_attach (GTK_TABLE (week_view), week_view->main_canvas,
- 1, 2, 1, 2,
- GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 1, 1);
- 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 char**) 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;
-
- gdk_pixbuf_unref (pixbuf);
-
- /*
- * Scrollbar.
- */
- adjustment = gtk_adjustment_new (0, -52, 52, 1, 1, 1);
- gtk_signal_connect (adjustment, "value_changed",
- G_CALLBACK (e_week_view_on_adjustment_changed),
- week_view);
-
- week_view->vscrollbar = gtk_vscrollbar_new (GTK_ADJUSTMENT (adjustment));
- gtk_table_attach (GTK_TABLE (week_view), week_view->vscrollbar,
- 2, 3, 1, 2, 0, GTK_EXPAND | GTK_FILL, 0, 0);
- 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;
-
- /* connect to ECalendarView's signals */
- g_signal_connect (G_OBJECT (week_view), "timezone_changed",
- G_CALLBACK (timezone_changed_cb), NULL);
-}
-
-
-/**
- * e_week_view_new:
- * @Returns: a new #EWeekView.
- *
- * Creates a new #EWeekView.
- **/
-GtkWidget *
-e_week_view_new (void)
-{
- GtkWidget *week_view;
- ECalModel *model;
-
- model = E_CAL_MODEL (e_cal_model_calendar_new ());
-
- week_view = GTK_WIDGET (g_object_new (e_week_view_get_type (), "model", model, NULL));
-
- g_object_unref (model);
-
- return week_view;
-}
-
-
-static void
-e_week_view_destroy (GtkObject *object)
-{
- EWeekView *week_view;
-
- week_view = E_WEEK_VIEW (object);
-
- e_week_view_cancel_layout (week_view);
-
- 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->query) {
- g_signal_handlers_disconnect_matched (week_view->query, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, week_view);
- g_object_unref (week_view->query);
- week_view->query = 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) {
- gdk_cursor_unref (week_view->normal_cursor);
- week_view->normal_cursor = NULL;
- }
- if (week_view->move_cursor) {
- gdk_cursor_unref (week_view->move_cursor);
- week_view->move_cursor = NULL;
- }
- if (week_view->resize_width_cursor) {
- gdk_cursor_unref (week_view->resize_width_cursor);
- week_view->resize_width_cursor = NULL;
- }
-
- GTK_OBJECT_CLASS (parent_class)->destroy (object);
-}
-
-
-static void
-e_week_view_realize (GtkWidget *widget)
-{
- EWeekView *week_view;
- GdkColormap *colormap;
- gboolean success[E_WEEK_VIEW_COLOR_LAST];
- gint nfailed;
-
- if (GTK_WIDGET_CLASS (parent_class)->realize)
- (*GTK_WIDGET_CLASS (parent_class)->realize)(widget);
-
- week_view = E_WEEK_VIEW (widget);
- week_view->main_gc = gdk_gc_new (widget->window);
-
- colormap = gtk_widget_get_colormap (widget);
-
- /* Allocate the colors. */
- week_view->colors[E_WEEK_VIEW_COLOR_EVEN_MONTHS].red = 0xe0e0;
- week_view->colors[E_WEEK_VIEW_COLOR_EVEN_MONTHS].green = 0xe0e0;
- week_view->colors[E_WEEK_VIEW_COLOR_EVEN_MONTHS].blue = 0xe0e0;
-
- week_view->colors[E_WEEK_VIEW_COLOR_ODD_MONTHS].red = 65535;
- week_view->colors[E_WEEK_VIEW_COLOR_ODD_MONTHS].green = 65535;
- week_view->colors[E_WEEK_VIEW_COLOR_ODD_MONTHS].blue = 65535;
-
- week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BACKGROUND].red = 213 * 257;
- week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BACKGROUND].green = 213 * 257;
- week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BACKGROUND].blue = 213 * 257;
-
- week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BORDER].red = 0;
- week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BORDER].green = 0;
- week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BORDER].blue = 0;
-
- week_view->colors[E_WEEK_VIEW_COLOR_EVENT_TEXT].red = 0;
- week_view->colors[E_WEEK_VIEW_COLOR_EVENT_TEXT].green = 0;
- week_view->colors[E_WEEK_VIEW_COLOR_EVENT_TEXT].blue = 0;
-
- week_view->colors[E_WEEK_VIEW_COLOR_GRID].red = 0 * 257;
- week_view->colors[E_WEEK_VIEW_COLOR_GRID].green = 0 * 257;
- week_view->colors[E_WEEK_VIEW_COLOR_GRID].blue = 0 * 257;
-
- week_view->colors[E_WEEK_VIEW_COLOR_SELECTED].red = 0 * 257;
- week_view->colors[E_WEEK_VIEW_COLOR_SELECTED].green = 0 * 257;
- week_view->colors[E_WEEK_VIEW_COLOR_SELECTED].blue = 156 * 257;
-
- week_view->colors[E_WEEK_VIEW_COLOR_SELECTED_UNFOCUSSED].red = 16 * 257;
- week_view->colors[E_WEEK_VIEW_COLOR_SELECTED_UNFOCUSSED].green = 78 * 257;
- week_view->colors[E_WEEK_VIEW_COLOR_SELECTED_UNFOCUSSED].blue = 139 * 257;
-
- week_view->colors[E_WEEK_VIEW_COLOR_DATES].red = 0 * 257;
- week_view->colors[E_WEEK_VIEW_COLOR_DATES].green = 0 * 257;
- week_view->colors[E_WEEK_VIEW_COLOR_DATES].blue = 0 * 257;
-
- week_view->colors[E_WEEK_VIEW_COLOR_DATES_SELECTED].red = 65535;
- week_view->colors[E_WEEK_VIEW_COLOR_DATES_SELECTED].green = 65535;
- week_view->colors[E_WEEK_VIEW_COLOR_DATES_SELECTED].blue = 65535;
-
- week_view->colors[E_WEEK_VIEW_COLOR_TODAY].red = 65535;
- week_view->colors[E_WEEK_VIEW_COLOR_TODAY].green = 0;
- week_view->colors[E_WEEK_VIEW_COLOR_TODAY].blue = 0;
-
- nfailed = gdk_colormap_alloc_colors (colormap, week_view->colors,
- E_WEEK_VIEW_COLOR_LAST, FALSE,
- TRUE, success);
- if (nfailed)
- g_warning ("Failed to allocate all colors");
-
-
- /* Create the pixmaps. */
- week_view->reminder_icon = gdk_pixmap_colormap_create_from_xpm_d (NULL, colormap, &week_view->reminder_mask, NULL, bell_xpm);
- week_view->recurrence_icon = gdk_pixmap_colormap_create_from_xpm_d (NULL, colormap, &week_view->recurrence_mask, NULL, recur_xpm);
- week_view->timezone_icon = gdk_pixmap_colormap_create_from_xpm_d (NULL, colormap, &week_view->timezone_mask, NULL, timezone_16_xpm);
-}
-
-
-static void
-e_week_view_unrealize (GtkWidget *widget)
-{
- EWeekView *week_view;
- GdkColormap *colormap;
-
- week_view = E_WEEK_VIEW (widget);
-
- gdk_gc_unref (week_view->main_gc);
- week_view->main_gc = NULL;
-
- colormap = gtk_widget_get_colormap (widget);
- gdk_colormap_free_colors (colormap, week_view->colors, E_WEEK_VIEW_COLOR_LAST);
-
- gdk_pixmap_unref (week_view->reminder_icon);
- week_view->reminder_icon = NULL;
- gdk_pixmap_unref (week_view->recurrence_icon);
- week_view->recurrence_icon = NULL;
-
- if (GTK_WIDGET_CLASS (parent_class)->unrealize)
- (*GTK_WIDGET_CLASS (parent_class)->unrealize)(widget);
-}
-
-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;
-}
-
-/* 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 void
-e_week_view_style_set (GtkWidget *widget,
- GtkStyle *previous_style)
-{
- EWeekView *week_view;
- GtkStyle *style;
- gint day, day_width, max_day_width, max_abbr_day_width;
- gint month, month_width, max_month_width, max_abbr_month_width;
- GDate date;
- gchar buffer[128];
- PangoFontDescription *font_desc;
- PangoContext *pango_context;
- PangoFontMetrics *font_metrics;
- PangoLayout *layout;
-
- if (GTK_WIDGET_CLASS (parent_class)->style_set)
- (*GTK_WIDGET_CLASS (parent_class)->style_set)(widget, previous_style);
-
- week_view = E_WEEK_VIEW (widget);
- style = gtk_widget_get_style (widget);
-
- /* Set up Pango prerequisites */
- font_desc = style->font_desc;
- pango_context = gtk_widget_get_pango_context (widget);
- 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_usize (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. */
- g_date_clear (&date, 1);
- g_date_set_dmy (&date, 27, 3, 2000); /* Must be a Monday. */
-
- max_day_width = 0;
- max_abbr_day_width = 0;
- for (day = 0; day < 7; day++) {
- g_date_strftime (buffer, 128, "%A", &date);
- day_width = get_string_width (layout, buffer);
- week_view->day_widths[day] = day_width;
- max_day_width = MAX (max_day_width, day_width);
-
- g_date_strftime (buffer, 128, "%a", &date);
- day_width = get_string_width (layout, buffer);
- week_view->abbr_day_widths[day] = day_width;
- max_abbr_day_width = MAX (max_abbr_day_width, day_width);
-
- g_date_add_days (&date, 1);
- }
-
- max_month_width = 0;
- max_abbr_month_width = 0;
- for (month = 0; month < 12; month++) {
- g_date_set_month (&date, month + 1);
-
- g_date_strftime (buffer, 128, "%B", &date);
- month_width = get_string_width (layout, buffer);
- week_view->month_widths[month] = month_width;
- max_month_width = MAX (max_month_width, month_width);
-
- g_date_strftime (buffer, 128, "%b", &date);
- month_width = get_string_width (layout, buffer);
- 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, style->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);
-}
-
-
-/* This recalculates the sizes of each column. */
-static void
-e_week_view_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
-{
- EWeekView *week_view;
- gdouble old_x2, old_y2, new_x2, new_y2;
-
- week_view = E_WEEK_VIEW (widget);
-
- (*GTK_WIDGET_CLASS (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);
- new_x2 = week_view->titles_canvas->allocation.width - 1;
- new_y2 = week_view->titles_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);
- new_x2 = week_view->main_canvas->allocation.width - 1;
- new_y2 = week_view->main_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 void
-e_week_view_recalc_cell_sizes (EWeekView *week_view)
-{
- gfloat canvas_width, canvas_height, offset;
- gint row, col;
- GtkWidget *widget;
- GtkStyle *style;
- gint width, height, time_width;
- PangoFontDescription *font_desc;
- PangoContext *pango_context;
- PangoFontMetrics *font_metrics;
-
- if (week_view->multi_week_view) {
- week_view->rows = week_view->weeks_shown * 2;
- week_view->columns = week_view->compress_weekend ? 6 : 7;
- } else {
- week_view->rows = 6;
- week_view->columns = 2;
- }
-
- /* 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 = week_view->main_canvas->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 = week_view->main_canvas->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];
- }
-
-
- /* If the font hasn't been set yet just return. */
- widget = GTK_WIDGET (week_view);
- style = gtk_widget_get_style (widget);
- if (!style)
- return;
- font_desc = style->font_desc;
- if (!font_desc)
- return;
-
- pango_context = gtk_widget_get_pango_context (widget);
- font_metrics = pango_context_get_metrics (pango_context, font_desc,
- 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 (week_view->multi_week_view) {
- week_view->events_y_offset = E_WEEK_VIEW_DATE_T_PAD +
- + PANGO_PIXELS (pango_font_metrics_get_ascent (font_metrics))
- + 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 (week_view->show_event_end_times
- && 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 (week_view->show_event_end_times
- && 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);
-}
-
-
-static gint
-e_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);
-
- GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS);
-
- gtk_widget_queue_draw (week_view->main_canvas);
-
- return FALSE;
-}
-
-
-static gint
-e_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);
-
- GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS);
-
- gtk_widget_queue_draw (week_view->main_canvas);
-
- return FALSE;
-}
-
-
-/* This draws a shadow around the top display and main display. */
-static gint
-e_week_view_expose_event (GtkWidget *widget,
- GdkEventExpose *event)
-{
- EWeekView *week_view;
-
- week_view = E_WEEK_VIEW (widget);
-
- e_week_view_draw_shadow (week_view);
-
- if (GTK_WIDGET_CLASS (parent_class)->expose_event)
- (*GTK_WIDGET_CLASS (parent_class)->expose_event)(widget, event);
-
- return FALSE;
-}
-
-/**
- * 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;
-}
-
-static gboolean
-e_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);
-
- 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;
- }
-
- 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);
- if (editable)
- break;
- else {
- /* check if we should go to the jump button */
-
- EWeekViewEvent *event;
- EWeekViewEventSpan *span;
- gint current_day;
-
- event = &g_array_index (week_view->events,
- EWeekViewEvent,
- new_event_num);
- 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;
- }
- }
- last_focus_event_num = new_event_num;
- last_focus_span_num = new_span_num;
- }
- return editable;
-}
-
-/* Returns the currently-selected event, or NULL if none */
-static GList *
-e_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) {
- event = &g_array_index (week_view->events, EWeekViewEvent,
- week_view->editing_event_num);
- } else if (week_view->popup_event_num != -1) {
- event = &g_array_index (week_view->events, EWeekViewEvent,
- week_view->popup_event_num);
- }
-
- if (event)
- list = g_list_prepend (list, event);
-
- return list;
-}
-
-static void
-process_component (EWeekView *week_view, ECalModelComponent *comp_data)
-{
- EWeekViewEvent *event;
- gint event_num, num_days;
- ECalComponent *comp = NULL;
- AddEventData add_event_data;
- const char *uid;
-
- /* If we don't have a valid date set yet, just return. */
- if (!g_date_valid (&week_view->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 ("process_component(): Could not set icalcomponent on ECalComponent");
- return;
- }
-
- e_cal_component_get_uid (comp, &uid);
-
- /* If the event already exists and the dates didn't change, we can
- update the event fairly easily without changing the events arrays
- or computing a new layout. */
- if (e_week_view_find_event_from_uid (week_view, uid, &event_num)) {
- ECalComponent *tmp_comp;
-
- event = &g_array_index (week_view->events, EWeekViewEvent,
- event_num);
-
- tmp_comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (tmp_comp, icalcomponent_new_clone (comp_data->icalcomp));
- if (!e_cal_component_has_recurrences (comp)
- && !e_cal_component_has_recurrences (tmp_comp)
- && e_cal_component_event_dates_match (comp, tmp_comp)) {
-#if 0
- g_print ("updated object's dates unchanged\n");
-#endif
- e_week_view_foreach_event_with_uid (week_view, uid, e_week_view_update_event_cb, comp_data);
- g_object_unref (comp);
- g_object_unref (tmp_comp);
- gtk_widget_queue_draw (week_view->main_canvas);
- return;
- }
-
- /* The dates have changed, so we need to remove the
- old occurrrences before adding the new ones. */
-#if 0
- g_print ("dates changed - removing occurrences\n");
-#endif
- e_week_view_foreach_event_with_uid (week_view, uid,
- e_week_view_remove_event_cb,
- NULL);
-
- g_object_unref (tmp_comp);
- }
-
- /* Add the occurrences of the event */
- num_days = week_view->multi_week_view ? week_view->weeks_shown * 7 : 7;
-
- add_event_data.week_view = week_view;
- add_event_data.comp_data = comp_data;
- e_cal_recur_generate_instances (comp,
- week_view->day_starts[0],
- week_view->day_starts[num_days],
- e_week_view_add_event, &add_event_data,
- e_cal_resolve_tzid_cb, comp_data->client,
- e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view)));
-
- g_object_unref (comp);
-
- e_week_view_queue_layout (week_view);
-}
-
-/* Restarts a query for the week view */
-static void
-e_week_view_update_query (ECalendarView *cal_view)
-{
- gint rows, r;
- EWeekView *week_view = E_WEEK_VIEW (cal_view);
-
- 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);
- g_assert (comp_data != NULL);
- process_component (week_view, comp_data);
- }
-}
-
-static void
-e_week_view_draw_shadow (EWeekView *week_view)
-{
- gint x1, y1, x2, y2;
- GtkStyle *style;
- GdkGC *light_gc, *dark_gc;
- GdkWindow *window;
-
- /* Draw the shadow around the graphical displays. */
- x1 = week_view->main_canvas->allocation.x - 1;
- y1 = week_view->main_canvas->allocation.y - 1;
- x2 = x1 + week_view->main_canvas->allocation.width + 2;
- y2 = y1 + week_view->main_canvas->allocation.height + 2;
-
- style = GTK_WIDGET (week_view)->style;
- dark_gc = style->dark_gc[GTK_STATE_NORMAL];
- light_gc = style->light_gc[GTK_STATE_NORMAL];
-
- window = GTK_WIDGET (week_view)->window;
- gdk_draw_line (window, dark_gc, x1, y1, x1, y2);
- gdk_draw_line (window, dark_gc, x1, y1, x2, y1);
- gdk_draw_line (window, light_gc, x2, y1, x2, y2);
- gdk_draw_line (window, light_gc, x1, y2, x2, y2);
-}
-
-/* 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
-e_week_view_set_selected_time_range (ECalendarView *cal_view,
- time_t start_time,
- time_t end_time)
-{
- GDate date, base_date, end_date;
- gint day_offset, weekday, week_start_offset, num_days;
- gboolean update_adjustment_value = FALSE;
- EWeekView *week_view = E_WEEK_VIEW (cal_view);
-
- 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)));
-
- if (week_view->multi_week_view) {
- /* Find the number of days since the start of the month. */
- day_offset = g_date_day (&date) - 1;
-
- /* Find the 1st week which starts at or before the start of
- the month. */
- base_date = date;
- g_date_set_day (&base_date, 1);
-
- /* Calculate the weekday of the 1st of the month, 0 = Mon. */
- weekday = g_date_weekday (&base_date) - 1;
-
- /* Convert it to an offset from the start of the display. */
- week_start_offset = (weekday + 7 - week_view->display_start_day) % 7;
-
- /* Add it to the day offset so we go back to the 1st week at
- or before the start of the month. */
- day_offset += week_start_offset;
- } else {
- /* Calculate the weekday of the given date, 0 = Mon. */
- weekday = g_date_weekday (&date) - 1;
-
- /* Convert it to an offset from the start of the display. */
- week_start_offset = (weekday + 7 - week_view->display_start_day) % 7;
-
- /* Set the day_offset to the result, so we move back to the
- start of the week. */
- 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)
- || 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->first_day_shown)
- || g_date_compare (&week_view->first_day_shown, &base_date)) {
- week_view->first_day_shown = base_date;
- start_time = time_add_day_with_zone (start_time, -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);
- e_week_view_update_query ((ECalendarView *) week_view);
- }
-
- /* Set the selection to the given days. */
- week_view->selection_start_day = g_date_julian (&date)
- - g_date_julian (&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_julian (&end_date)
- - g_date_julian (&base_date);
- }
-
- /* Make sure the selection is valid. */
- num_days = week_view->multi_week_view ? week_view->weeks_shown * 7 : 7;
- num_days--;
- 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)
- gtk_adjustment_set_value (GTK_RANGE (week_view->vscrollbar)->adjustment, 0);
-
- gtk_widget_queue_draw (week_view->main_canvas);
-}
-
-void
-e_week_view_set_selected_time_range_visible (EWeekView *week_view,
- time_t start_time,
- time_t end_time)
-{
- GDate date, end_date;
- gint num_days;
-
- 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)));
-
- /* Set the selection to the given days. */
- week_view->selection_start_day = g_date_julian (&date)
- - g_date_julian (&week_view->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_julian (&end_date)
- - g_date_julian (&week_view->first_day_shown);
- }
-
- /* Make sure the selection is valid. */
- num_days = week_view->multi_week_view ? week_view->weeks_shown * 7 : 7;
- num_days--;
- 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);
-}
-
-
-/* Returns the selected time range. */
-static void
-e_week_view_get_selected_time_range (ECalendarView *cal_view,
- time_t *start_time,
- time_t *end_time)
-{
- gint start_day, end_day;
- EWeekView *week_view = E_WEEK_VIEW (cal_view);
-
- 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];
-}
-
-/* Gets the visible time range. Returns FALSE if no time range has been set. */
-static gboolean
-e_week_view_get_visible_time_range (ECalendarView *cal_view,
- time_t *start_time,
- time_t *end_time)
-{
- 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->first_day_shown))
- return FALSE;
-
- num_days = week_view->multi_week_view ? week_view->weeks_shown * 7 : 7;
- *start_time = week_view->day_starts[0];
- *end_time = week_view->day_starts[num_days];
-
- return TRUE;
-}
-
-
-/* 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->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;
- gint weekday, day_offset, 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_julian (&week_view->base_date)
- + week_view->selection_start_day;
- old_selection_end_julian =
- g_date_julian (&week_view->base_date)
- + week_view->selection_end_day;
- }
-
- /* Calculate the weekday of the given date, 0 = Mon. */
- weekday = g_date_weekday (date) - 1;
-
- /* Convert it to an offset from the start of the display. */
- day_offset = (weekday + 7 - week_view->display_start_day) % 7;
-
- /* Calculate the base date, i.e. the first day shown when the
- scrollbar adjustment value is 0. */
- 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->first_day_shown)
- || g_date_compare (&week_view->first_day_shown, &base_date)) {
- week_view->first_day_shown = base_date;
-
- start_tt.year = g_date_year (&base_date);
- start_tt.month = g_date_month (&base_date);
- start_tt.day = g_date_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 ((ECalendarView *) 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_julian (&base_date);
- week_view->selection_end_day = old_selection_end_julian
- - g_date_julian (&base_date);
-
- /* Make sure the selection is valid. */
- num_days = week_view->multi_week_view
- ? week_view->weeks_shown * 7 : 7;
- num_days--;
- 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)
- gtk_adjustment_set_value (GTK_RANGE (week_view->vscrollbar)->adjustment, 0);
-
- gtk_widget_queue_draw (week_view->main_canvas);
-}
-
-
-/* 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 = week_view->multi_week_view ? week_view->weeks_shown * 7 : 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->multi_week_view;
-}
-
-
-void
-e_week_view_set_multi_week_view (EWeekView *week_view,
- gboolean multi_week_view)
-{
- GtkAdjustment *adjustment;
- gint page_increment, page_size;
-
- g_return_if_fail (E_IS_WEEK_VIEW (week_view));
-
- if (week_view->multi_week_view == multi_week_view)
- return;
-
- week_view->multi_week_view = multi_week_view;
-
- if (multi_week_view) {
- gtk_widget_show (week_view->titles_canvas);
- page_increment = 4;
- page_size = 5;
- } else {
- gtk_widget_hide (week_view->titles_canvas);
- page_increment = page_size = 1;
- }
-
- adjustment = GTK_RANGE (week_view->vscrollbar)->adjustment;
- adjustment->page_increment = page_increment;
- adjustment->page_size = page_size;
- gtk_adjustment_changed (adjustment);
-
- e_week_view_recalc_cell_sizes (week_view);
-
- if (g_date_valid (&week_view->first_day_shown))
- e_week_view_set_first_day_shown (week_view,
- &week_view->first_day_shown);
-}
-
-
-gint
-e_week_view_get_weeks_shown (EWeekView *week_view)
-{
- g_return_val_if_fail (E_IS_WEEK_VIEW (week_view), 1);
-
- return week_view->weeks_shown;
-}
-
-
-void
-e_week_view_set_weeks_shown (EWeekView *week_view,
- gint weeks_shown)
-{
- 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 (week_view->weeks_shown == weeks_shown)
- return;
-
- week_view->weeks_shown = weeks_shown;
-
- if (week_view->multi_week_view) {
- page_increment = 4;
- page_size = 5;
-
- adjustment = GTK_RANGE (week_view->vscrollbar)->adjustment;
- adjustment->page_increment = page_increment;
- adjustment->page_size = page_size;
- gtk_adjustment_changed (adjustment);
-
- e_week_view_recalc_cell_sizes (week_view);
-
- if (g_date_valid (&week_view->first_day_shown))
- e_week_view_set_first_day_shown (week_view, &week_view->first_day_shown);
-
- e_week_view_update_query ((ECalendarView *) 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->compress_weekend;
-}
-
-
-void
-e_week_view_set_compress_weekend (EWeekView *week_view,
- gboolean compress)
-{
- gboolean need_reload = FALSE;
-
- g_return_if_fail (E_IS_WEEK_VIEW (week_view));
-
- if (week_view->compress_weekend == compress)
- return;
-
- week_view->compress_weekend = compress;
-
- /* The option only affects the month view. */
- if (!week_view->multi_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->first_day_shown))
- e_week_view_set_first_day_shown (week_view, &week_view->first_day_shown);
- } else {
- week_view->events_need_reshape = TRUE;
- e_week_view_check_layout (week_view);
- }
-
- gtk_widget_queue_draw (week_view->main_canvas);
-}
-
-/* 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->show_event_end_times;
-}
-
-
-void
-e_week_view_set_show_event_end_times (EWeekView *week_view,
- gboolean show)
-{
- g_return_if_fail (E_IS_WEEK_VIEW (week_view));
-
- if (week_view->show_event_end_times != show) {
- week_view->show_event_end_times = show;
- e_week_view_recalc_cell_sizes (week_view);
- week_view->events_need_reshape = TRUE;
- e_week_view_check_layout (week_view);
- }
-}
-
-
-/* The first day of the week, 0 (Monday) to 6 (Sunday). */
-gint
-e_week_view_get_week_start_day (EWeekView *week_view)
-{
- g_return_val_if_fail (E_IS_WEEK_VIEW (week_view), 0);
-
- return week_view->week_start_day;
-}
-
-
-void
-e_week_view_set_week_start_day (EWeekView *week_view,
- gint week_start_day)
-{
- g_return_if_fail (E_IS_WEEK_VIEW (week_view));
- g_return_if_fail (week_start_day >= 0);
- g_return_if_fail (week_start_day < 7);
-
- if (week_view->week_start_day == week_start_day)
- return;
-
- week_view->week_start_day = week_start_day;
-
- e_week_view_recalc_display_start_day (week_view);
-
- /* Recalculate the days shown and reload if necessary. */
- if (g_date_valid (&week_view->first_day_shown))
- e_week_view_set_first_day_shown (week_view,
- &week_view->first_day_shown);
-}
-
-static gboolean
-e_week_view_recalc_display_start_day (EWeekView *week_view)
-{
- gint display_start_day;
-
- /* 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_view->week_start_day;
-
- if (display_start_day == 6
- && (!week_view->multi_week_view || week_view->compress_weekend))
- display_start_day = 5;
-
- if (week_view->display_start_day != display_start_day) {
- week_view->display_start_day = display_start_day;
- return TRUE;
- }
-
- return FALSE;
-}
-
-
-static gboolean
-e_week_view_update_event_cb (EWeekView *week_view,
- gint event_num,
- gpointer data)
-{
- EWeekViewEvent *event;
- EWeekViewEventSpan *span;
- gint span_num;
- const gchar *text;
- ECalModelComponent *comp_data;
-
- comp_data = data;
-
- event = &g_array_index (week_view->events, EWeekViewEvent, event_num);
-
- if (event->allocated_comp_data)
- e_cal_model_free_component_data (event->comp_data);
- event->comp_data = comp_data;
- event->allocated_comp_data = FALSE;
-
- for (span_num = 0; span_num < event->num_spans; span_num++) {
- span = &g_array_index (week_view->spans, EWeekViewEventSpan,
- event->spans_index + span_num);
-
- if (span->text_item) {
- text = icalcomponent_get_summary (comp_data->icalcomp);
- gnome_canvas_item_set (span->text_item,
- "text", text ? text : "",
- NULL);
-
- e_week_view_reshape_event_span (week_view, event_num,
- span_num);
- }
- }
- g_signal_emit_by_name (G_OBJECT(week_view),
- "event_changed", event);
-
-
- return TRUE;
-}
-
-
-/* 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 char *u;
-
- event = &g_array_index (week_view->events, EWeekViewEvent,
- event_num);
-
- 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;
-
- event = &g_array_index (week_view->events, EWeekViewEvent, event_num);
-
- /* 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;
-
- /* 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++) {
- span = &g_array_index (week_view->spans, EWeekViewEventSpan,
- event->spans_index + span_num);
-
- if (span->text_item) {
- gtk_object_destroy (GTK_OBJECT (span->text_item));
- span->text_item = NULL;
- }
- if (span->background_item) {
- gtk_object_destroy (GTK_OBJECT (span->background_item));
- span->background_item = NULL;
- }
- }
-
- if (event->allocated_comp_data) {
- e_cal_model_free_component_data (event->comp_data);
- event->allocated_comp_data = FALSE;
- }
-
- 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,
- week_view->multi_week_view,
- week_view->weeks_shown,
- week_view->display_start_day,
- week_view->compress_weekend,
- &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];
- if (cell_h == 2)
- *day_h += week_view->row_heights[cell_y + 1];
-}
-
-
-/* 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);
-
- 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,
- week_view->display_start_day,
- week_view->multi_week_view,
- week_view->compress_weekend,
- &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
-e_week_view_on_button_press (GtkWidget *widget,
- GdkEventButton *event,
- EWeekView *week_view)
-{
- gint x, y, day;
-
-#if 0
- g_print ("In e_week_view_on_button_press\n");
- if (event->type == GDK_2BUTTON_PRESS)
- g_print (" is a double-click\n");
- if (week_view->pressed_event_num != -1)
- g_print (" item is pressed\n");
-#endif
-
- /* Convert the mouse position to a week & day. */
- x = event->x;
- y = event->y;
- day = e_week_view_convert_position_to_day (week_view, x, y);
- if (day == -1)
- return FALSE;
-
- /* If an event is pressed just return. */
- if (week_view->pressed_event_num != -1)
- return FALSE;
-
- if (event->button == 1 && event->type == GDK_2BUTTON_PRESS) {
- e_calendar_view_new_appointment (E_CALENDAR_VIEW (week_view));
- return TRUE;
- }
-
- if (event->button == 1) {
- /* Start the selection drag. */
- if (!GTK_WIDGET_HAS_FOCUS (week_view))
- gtk_widget_grab_focus (GTK_WIDGET (week_view));
-
- if (gdk_pointer_grab (GTK_LAYOUT (widget)->bin_window, FALSE,
- GDK_POINTER_MOTION_MASK
- | GDK_BUTTON_RELEASE_MASK,
- FALSE, NULL, event->time) == 0) {
- week_view->selection_start_day = day;
- week_view->selection_end_day = day;
- week_view->selection_drag_pos = E_WEEK_VIEW_DRAG_END;
-
- /* FIXME: Optimise? */
- gtk_widget_queue_draw (week_view->main_canvas);
- }
- } else if (event->button == 3) {
- if (!GTK_WIDGET_HAS_FOCUS (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, event, -1);
- }
-
- return TRUE;
-}
-
-
-static gboolean
-e_week_view_on_button_release (GtkWidget *widget,
- GdkEventButton *event,
- EWeekView *week_view)
-{
- time_t start, end;
-
-#if 0
- g_print ("In e_week_view_on_button_release\n");
-#endif
-
- if (week_view->selection_drag_pos != E_WEEK_VIEW_DRAG_NONE) {
- week_view->selection_drag_pos = E_WEEK_VIEW_DRAG_NONE;
- gdk_pointer_ungrab (event->time);
- start = week_view->day_starts[week_view->selection_start_day];
- end = week_view->day_starts[week_view->selection_end_day + 1];
-
- gnome_calendar_set_selected_time_range (e_calendar_view_get_calendar (E_CALENDAR_VIEW (week_view)),
- start, end);
- }
-
- return FALSE;
-}
-
-static gboolean
-e_week_view_on_scroll (GtkWidget *widget,
- GdkEventScroll *scroll,
- EWeekView *week_view)
-{
- GtkAdjustment *adj = GTK_RANGE (week_view->vscrollbar)->adjustment;
- gfloat new_value;
-
- switch (scroll->direction){
- case GDK_SCROLL_UP:
- new_value = adj->value - adj->page_increment;
- break;
- case GDK_SCROLL_DOWN:
- new_value = adj->value + adj->page_increment;
- break;
- default:
- return FALSE;
- }
-
- new_value = CLAMP (new_value, adj->lower, adj->upper - adj->page_size);
- gtk_adjustment_set_value (adj, new_value);
-
- return TRUE;
-}
-
-
-static gboolean
-e_week_view_on_motion (GtkWidget *widget,
- GdkEventMotion *mevent,
- EWeekView *week_view)
-{
- gint x, y, day;
-
-#if 0
- g_print ("In e_week_view_on_motion\n");
-#endif
-
- /* 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;
- }
-
- 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)
-{
- gint col, row, grid_x = -1, grid_y = -1, week, day;
- gint weekend_col, box, weekend_box;
-
- /* 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 (week_view->multi_week_view) {
- week = grid_y / 2;
- day = grid_x;
-
- if (week_view->compress_weekend) {
- weekend_col = (5 + 7 - week_view->display_start_day) % 7;
- if (grid_x > weekend_col
- || (grid_x == weekend_col && grid_y % 2 == 1))
- day++;
- }
- } else {
- week = 0;
-
- box = grid_x * 3 + grid_y / 2;
- weekend_box = (5 + 7 - week_view->display_start_day) % 7;
- day = box;
- if (box > weekend_box
- ||( box == weekend_box && grid_y % 2 == 1))
- day++;
- }
-
- return week * 7 + day;
-}
-
-
-static void
-e_week_view_update_selection (EWeekView *week_view,
- gint day)
-{
- gint tmp_day;
- gboolean need_redraw = FALSE;
-
-#if 0
- g_print ("Updating selection %i,%i\n", week, day);
-#endif
-
- 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;
-
- /* 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 (event->allocated_comp_data)
- e_cal_model_free_component_data (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)
- gtk_object_destroy (GTK_OBJECT (span->background_item));
- if (span->text_item)
- gtk_object_destroy (GTK_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 = week_view->multi_week_view ? week_view->weeks_shown * 7 : 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]);
- }
-}
-
-
-/* This adds one event to the view, adding it to the appropriate array. */
-static gboolean
-e_week_view_add_event (ECalComponent *comp,
- time_t start,
- time_t end,
- 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 = add_event_data->week_view->multi_week_view ? add_event_data->week_view->weeks_shown * 7 : 7;
-
-#if 0
- g_print ("View start:%li end:%li Event start:%li end:%li\n",
- add_event_data->week_view->day_starts[0], add_event_data->week_view->day_starts[num_days],
- start, end);
-#endif
- g_return_val_if_fail (start <= end, TRUE);
- g_return_val_if_fail (start < add_event_data->week_view->day_starts[num_days], TRUE);
- g_return_val_if_fail (end > add_event_data->week_view->day_starts[0], TRUE);
-
- 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 = add_event_data->comp_data;
- event.allocated_comp_data = FALSE;
- } else {
- event.comp_data = g_new0 (ECalModelComponent, 1);
- event.allocated_comp_data = TRUE;
-
- event.comp_data->client = e_cal_model_get_default_client (e_calendar_view_get_model (E_CALENDAR_VIEW (add_event_data->week_view)));
- e_cal_component_commit_sequence (comp);
- event.comp_data->icalcomp = icalcomponent_new_clone (e_cal_component_get_icalcomponent (comp));
- }
- 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;
-
- 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;
-
- 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;
-
- return 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 (!GTK_WIDGET_VISIBLE (week_view))
- 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,
- week_view->multi_week_view,
- week_view->weeks_shown,
- week_view->compress_weekend,
- week_view->display_start_day,
- 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 (const void *arg1,
- const void *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;
- 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);
- for (span_num = 0; span_num < event->num_spans; span_num++) {
- e_week_view_reshape_event_span (week_view, event_num,
- span_num);
- }
- }
-
- /* Reshape the jump buttons and show/hide them as appropriate. */
- num_days = week_view->multi_week_view ? week_view->weeks_shown * 7 : 7;
- for (day = 0; day < num_days; day++) {
-
- is_weekend = ((week_view->display_start_day + day) % 7 >= 5) ? TRUE : FALSE;
- if (!is_weekend || (week_view->multi_week_view
- && !week_view->compress_weekend))
- 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 {
- e_week_view_get_day_position (week_view, day,
- &day_x, &day_y,
- &day_w, &day_h);
-
- gnome_canvas_item_set (week_view->jump_buttons[day],
- "GnomeCanvasPixbuf::x", (gdouble) (day_x + day_w - E_WEEK_VIEW_JUMP_BUTTON_X_PAD - E_WEEK_VIEW_JUMP_BUTTON_WIDTH),
- "GnomeCanvasPixbuf::y", (gdouble) (day_y + day_h - E_WEEK_VIEW_JUMP_BUTTON_Y_PAD - E_WEEK_VIEW_JUMP_BUTTON_HEIGHT),
- NULL);
-
- 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 void
-e_week_view_reshape_event_span (EWeekView *week_view,
- gint event_num,
- gint span_num)
-{
- 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;
- PangoFontDescription *font_desc;
- PangoContext *pango_context;
- PangoFontMetrics *font_metrics;
- PangoLayout *layout;
-
- event = &g_array_index (week_view->events, EWeekViewEvent, event_num);
- 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)
- gtk_object_destroy (GTK_OBJECT (span->background_item));
- if (span->text_item)
- gtk_object_destroy (GTK_OBJECT (span->text_item));
- span->background_item = NULL;
- span->text_item = NULL;
-
- g_object_unref (comp);
- return;
- }
-
- /* Set up Pango prerequisites */
- font_desc = gtk_widget_get_style (GTK_WIDGET (week_view))->font_desc;
- pango_context = gtk_widget_get_pango_context (GTK_WIDGET (week_view));
- font_metrics = pango_context_get_metrics (pango_context, font_desc,
- 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;
- }
-
- /* Calculate how many icons we need to show. */
- num_icons = 0;
- if (show_icons) {
- GSList *categories_list, *elem;
-
- if (e_cal_component_has_alarms (comp))
- num_icons++;
- if (e_cal_component_has_recurrences (comp))
- num_icons++;
- if (event->different_timezone)
- num_icons++;
-
- e_cal_component_get_categories_list (comp, &categories_list);
- for (elem = categories_list; elem; elem = elem->next) {
- char *category;
- GdkPixmap *pixmap = NULL;
- GdkBitmap *mask = NULL;
-
- category = (char *) elem->data;
- if (e_categories_config_get_icon_for (category, &pixmap, &mask))
- num_icons++;
- }
-
- e_cal_component_free_categories_list (categories_list);
- }
-
- /* 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);
- }
-
- 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) {
- ECalComponentText text;
-
- e_cal_component_get_summary (comp, &text);
- span->text_item =
- gnome_canvas_item_new (GNOME_CANVAS_GROUP (GNOME_CANVAS (week_view->main_canvas)->root),
- e_text_get_type (),
- "anchor", GTK_ANCHOR_NW,
- "clip", TRUE,
- "max_lines", 1,
- "editable", TRUE,
- "text", text.value ? text.value : "",
- "use_ellipsis", TRUE,
- "fill_color_rgba", GNOME_CANVAS_COLOR(0, 0, 0),
- "im_context", E_CANVAS (week_view->main_canvas)->im_context,
- NULL);
-
- 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);
-
- }
-
- /* 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 {
- /* Get the width of the text of the event. This is a
- bit of a hack. It would be better if EText could
- tell us this. */
- g_object_get (G_OBJECT (span->text_item), "text", &text, NULL);
- 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);
-
- g_object_unref (comp);
- g_object_unref (layout);
- pango_font_metrics_unref (font_metrics);
-}
-
-
-static void
-e_week_view_on_adjustment_changed (GtkAdjustment *adjustment,
- EWeekView *week_view)
-{
- GDate date;
- gint week_offset;
- struct icaltimetype start_tt = icaltime_null_time ();
- time_t lower, start, end;
- guint32 old_first_day_julian, new_first_day_julian;
-
- /* If we don't have a valid date set yet, just return. */
- if (!g_date_valid (&week_view->first_day_shown))
- return;
-
- /* Determine the first date shown. */
- date = week_view->base_date;
- week_offset = floor (adjustment->value + 0.5);
- g_date_add_days (&date, week_offset * 7);
-
- /* Convert the old & new first days shown to julian values. */
- old_first_day_julian = g_date_julian (&week_view->first_day_shown);
- new_first_day_julian = g_date_julian (&date);
-
- /* If we are already showing the date, just return. */
- if (old_first_day_julian == new_first_day_julian)
- return;
-
- /* Set the new first day shown. */
- week_view->first_day_shown = date;
-
- /* Convert it to a time_t. */
- start_tt.year = g_date_year (&date);
- start_tt.month = g_date_month (&date);
- start_tt.day = g_date_day (&date);
-
- lower = 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, lower);
- e_week_view_update_query ((ECalendarView *) week_view);
-
- /* Update the selection, if needed. */
- if (week_view->selection_start_day != -1) {
- start = week_view->day_starts[week_view->selection_start_day];
- end = week_view->day_starts[week_view->selection_end_day + 1];
- gnome_calendar_set_selected_time_range (e_calendar_view_get_calendar (E_CALENDAR_VIEW (week_view)),
- start, end);
- }
-}
-
-
-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;
-
- /* 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;
-
- event = &g_array_index (week_view->events, EWeekViewEvent, event_num);
- span = &g_array_index (week_view->spans, EWeekViewEventSpan,
- event->spans_index + span_num);
-
- /* If the event is not shown, don't try to edit it. */
- if (!span->text_item)
- return FALSE;
-
- if (initial_text) {
- gnome_canvas_item_set (span->text_item,
- "text", initial_text,
- NULL);
- }
-
- /* FIXME: This implicitly stops any edit of another item, causing it
- to be sent to the server and resulting in a call to obj_updated_cb()
- which may reload all the events and so our span and text item may
- actually be destroyed. So we often get a SEGV. */
- e_canvas_item_grab_focus (span->text_item, TRUE);
-
- /* Try to move the cursor to the end of the text. */
- g_object_get (G_OBJECT (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)
-{
- int 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_assert (event_num != -1);
-
- event = &g_array_index (week_view->events, EWeekViewEvent, event_num);
- 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 (G_OBJECT (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 *gdkevent,
- EWeekView *week_view)
-{
- EWeekViewEvent *event;
- gint event_num, span_num;
-
-#if 0
- g_print ("In e_week_view_on_text_item_event\n");
-#endif
-
- switch (gdkevent->type) {
- case GDK_KEY_PRESS:
- if (gdkevent && gdkevent->key.keyval == GDK_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. */
- gtk_signal_emit_stop_by_name (GTK_OBJECT (item),
- "event");
- return TRUE;
- } else if (gdkevent->key.keyval == GDK_Escape) {
- cancel_editing (week_view);
- gtk_signal_emit_stop_by_name (GTK_OBJECT (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;
-
- event = &g_array_index (week_view->events, EWeekViewEvent,
- event_num);
-
- e_calendar_view_edit_appointment (E_CALENDAR_VIEW (week_view),
- event->comp_data->client,
- event->comp_data->icalcomp, FALSE);
-
- gtk_signal_emit_stop_by_name (GTK_OBJECT (item), "event");
- return TRUE;
- case GDK_BUTTON_PRESS:
- if (!e_week_view_find_event_from_item (week_view, item,
- &event_num, &span_num))
- return FALSE;
-
- if (gdkevent->button.button == 3 && !E_TEXT (item)->editing) {
- EWeekViewEvent *e;
-
- e = &g_array_index (week_view->events, EWeekViewEvent, event_num);
-
- if (!GTK_WIDGET_HAS_FOCUS (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,
- (GdkEventButton*) gdkevent,
- event_num);
-
- gtk_signal_emit_stop_by_name (GTK_OBJECT (item->canvas),
- "button_press_event");
- return TRUE;
- }
-
- if (gdkevent->button.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) {
- gtk_signal_emit_stop_by_name (GTK_OBJECT (item),
- "event");
-
- if (gdkevent) {
- week_view->drag_event_x = gdkevent->button.x;
- week_view->drag_event_y = gdkevent->button.y;
- } else
- g_warning ("No GdkEvent");
-
- /* 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. */
- gtk_signal_emit_stop_by_name (GTK_OBJECT (item),
- "event");
- return TRUE;
- }
- week_view->pressed_event_num = -1;
- break;
- case GDK_FOCUS_CHANGE:
- if (gdkevent->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 void
-e_week_view_on_editing_started (EWeekView *week_view,
- GnomeCanvasItem *item)
-{
- gint event_num, span_num;
-
- if (!e_week_view_find_event_from_item (week_view, item,
- &event_num, &span_num))
- return;
-
-#if 0
- g_print ("In e_week_view_on_editing_started event_num:%i span_num:%i\n", event_num, span_num);
-#endif
-
- 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);
- }
-
- g_signal_emit_by_name (week_view, "selection_changed");
-}
-
-
-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;
- ECal *client;
- const char *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;
-
- event = &g_array_index (week_view->events, EWeekViewEvent, event_num);
- 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)
- return;
-
- g_object_set (span->text_item, "handle_popup", FALSE, NULL);
- g_object_get (G_OBJECT (span->text_item), "text", &text, NULL);
- g_assert (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 = cal_comp_is_on_server (comp, client);
-
- if (string_is_empty (text) && !on_server) {
- const char *uid;
-
- e_cal_component_get_uid (comp, &uid);
-
- e_week_view_foreach_event_with_uid (week_view, uid,
- e_week_view_remove_event_cb, NULL);
- 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)) {
- 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);
-
- if (!on_server) {
- if (!e_cal_create_object (client, icalcomp, NULL, NULL))
- g_message (G_STRLOC ": Could not create the object!");
- } else {
- CalObjModType mod = CALOBJ_MOD_ALL;
- GtkWindow *toplevel;
-
- if (e_cal_component_has_recurrences (comp)) {
- if (!recur_component_dialog (client, comp, &mod, NULL)) {
- goto out;
- }
- }
-
- /* FIXME When sending here, what exactly should we send? */
- toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (week_view)));
- if (e_cal_modify_object (client, icalcomp, mod, NULL)) {
- if (itip_organizer_is_user (comp, client)
- && send_component_dialog (toplevel, client, comp, FALSE))
- itip_send_comp (E_CAL_COMPONENT_METHOD_REQUEST, comp,
- client, NULL);
- }
- }
- }
-
- out:
-
- g_free (text);
- g_object_unref (comp);
-
- g_signal_emit_by_name (week_view, "selection_changed");
-}
-
-
-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++) {
- 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,
- const gchar *uid,
- 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 char *u;
-
- event = &g_array_index (week_view->events, EWeekViewEvent,
- event_num);
-
- u = icalcomponent_get_uid (event->comp_data->icalcomp);
- if (u && !strcmp (uid, u)) {
- *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;
-
- event = &g_array_index (week_view->events, EWeekViewEvent, event_num);
- if (event->num_spans != 1)
- 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 gboolean
-e_week_view_do_key_press (GtkWidget *widget, GdkEventKey *event)
-{
- EWeekView *week_view;
- ECalComponent *comp;
- icalcomponent *icalcomp;
- gint event_num;
- gchar *initial_text;
- ECalComponentDateTime date;
- struct icaltimetype itt;
- time_t dtstart, dtend;
- const char *uid;
- AddEventData add_event_data;
-
- 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);
-
- /* The Escape key aborts a resize operation. */
-#if 0
- if (week_view->resize_drag_pos != E_CALENDAR_VIEW_POS_NONE) {
- if (event->keyval == GDK_Escape) {
- e_week_view_abort_resize (week_view, event->time);
- }
- return FALSE;
- }
-#endif
-
- /*Navigation through days with arrow keys*/
- switch (event->keyval) {
- case GDK_Up:
- e_week_view_on_key_up (week_view, event);
- return TRUE;
- case GDK_Down:
- e_week_view_on_key_down (week_view, event);
- return TRUE;
- case GDK_Left:
- e_week_view_on_key_left (week_view, event);
- return TRUE;
- case GDK_Right:
- e_week_view_on_key_right (week_view, event);
- return TRUE;
- default:
- break;
- }
-
- 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_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_Tab)) {
- return FALSE;
- } else
- initial_text = e_utf8_from_gtk_event_key (widget, event->keyval, event->string);
-
- /* Add a new event covering the selected range. */
- icalcomp = e_cal_model_create_component_with_defaults (e_calendar_view_get_model (E_CALENDAR_VIEW (week_view)));
- if (!icalcomp)
- return FALSE;
- uid = icalcomponent_get_uid (icalcomp);
-
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomp);
-
- dtstart = week_view->day_starts[week_view->selection_start_day];
- dtend = week_view->day_starts[week_view->selection_end_day + 1];
-
- date.value = &itt;
- date.tzid = NULL;
-
- /* 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 (dtstart, TRUE,
- e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view)));
- e_cal_component_set_dtstart (comp, &date);
-
- *date.value = icaltime_from_timet_with_zone (dtend, TRUE,
- e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view)));
- e_cal_component_set_dtend (comp, &date);
-
- e_cal_component_set_categories (
- comp, e_calendar_view_get_default_category (E_CALENDAR_VIEW (week_view)));
-
- /* We add the event locally and start editing it. We don't send it
- to the server until the user finishes editing it. */
- add_event_data.week_view = week_view;
- add_event_data.comp_data = NULL;
- e_week_view_add_event (comp, dtstart, dtend, &add_event_data);
- e_week_view_check_layout (week_view);
- gtk_widget_queue_draw (week_view->main_canvas);
-
- if (e_week_view_find_event_from_uid (week_view, uid, &event_num)) {
- e_week_view_start_editing_event (week_view, event_num, 0,
- initial_text);
- } else {
- g_warning ("Couldn't find event to start editing.\n");
- }
-
- if (initial_text)
- g_free (initial_text);
-
- g_object_unref (comp);
-
- return TRUE;
-}
-
-static void
-e_week_view_on_key_up (EWeekView *week_view, GdkEventKey *event)
-{
- gint selection_start_day, selection_end_day;
-
- selection_start_day = week_view->selection_start_day;
- selection_end_day = week_view->selection_end_day;
-
- if (selection_start_day == -1) {
- selection_start_day = 0;
- selection_end_day = 0;
- }
-
- if (week_view->multi_week_view) {
- if (selection_end_day < 7) {
- g_date_subtract_days (&(week_view->first_day_shown), 7);
- } else
- selection_end_day -= 7;
- }
- else {
- if (selection_start_day == selection_end_day) {
- if (selection_end_day == 0) {
- g_date_subtract_days (&(week_view->first_day_shown), 7);
- selection_end_day = 6;
- } else
- selection_end_day--;
- } else {
- selection_end_day =
- (selection_start_day + selection_end_day)/2;
- }
- }
-
- week_view->selection_start_day = selection_end_day;
- week_view->selection_end_day = selection_end_day;
-
- gtk_widget_queue_draw (week_view->main_canvas);
-}
-
-static void
-e_week_view_on_key_down (EWeekView *week_view, GdkEventKey *event)
-{
- gint selection_start_day, selection_end_day;
-
- selection_start_day = week_view->selection_start_day;
- selection_end_day = week_view->selection_end_day;
-
- if (selection_start_day == -1) {
- selection_start_day = 0;
- selection_end_day = 0;
- }
-
- if (week_view->multi_week_view) {
- if ((selection_end_day+7) / 7 >= week_view->weeks_shown) {
- g_date_add_days (&(week_view->first_day_shown), 7);
- } else
- selection_end_day += 7;
- }
- else {
- if (selection_start_day == selection_end_day) {
- if (selection_end_day == 6) {
- g_date_add_days (&(week_view->first_day_shown), 7);
- selection_end_day = 0;
- } else
- selection_end_day++;
- } else {
- selection_end_day =
- (selection_start_day + selection_end_day)/2;
- }
- }
-
- week_view->selection_start_day = selection_end_day;
- week_view->selection_end_day = selection_end_day;
-
- gtk_widget_queue_draw (week_view->main_canvas);
-}
-
-static void
-e_week_view_on_key_left (EWeekView *week_view, GdkEventKey *event)
-{
- gint selection_start_day, selection_end_day;
-
- selection_start_day = week_view->selection_start_day;
- selection_end_day = week_view->selection_end_day;
-
- if (selection_start_day == -1) {
- selection_start_day = 0;
- selection_end_day = 0;
- }
-
- if (week_view->multi_week_view) {
- if (selection_end_day == 0) {
- g_date_subtract_days (&(week_view->first_day_shown), 7);
- selection_end_day = 6;
- } else
- selection_end_day -= 1;
- }
- else {
- switch (selection_end_day) {
- case 0:
- case 1:
- case 2:
- g_date_subtract_days (&(week_view->first_day_shown), 7);
- selection_end_day += 3;
- break;
- case 3:
- case 4:
- case 5:
- selection_end_day -= 3;
- break;
- case 6:
- selection_end_day -= 4;
- break;
- default:
- break;
- }
- }
-
- week_view->selection_start_day = selection_end_day;
- week_view->selection_end_day = selection_end_day;
-
- gtk_widget_queue_draw (week_view->main_canvas);
-
-}
-
-static void
-e_week_view_on_key_right (EWeekView *week_view, GdkEventKey *event)
-{
-
- gint selection_start_day, selection_end_day;
-
- selection_start_day = week_view->selection_start_day;
- selection_end_day = week_view->selection_end_day;
-
- if (selection_start_day == -1) {
- selection_start_day = 0;
- selection_end_day = 0;
- }
-
- if (week_view->multi_week_view) {
- if (selection_end_day == week_view->weeks_shown*7 -1 ) {
- g_date_add_days (&(week_view->first_day_shown), 7);
- selection_end_day -= 6;
- } else
- selection_end_day++;
- }
- else {
- switch (selection_end_day) {
- case 0:
- case 1:
- case 2:
- selection_end_day += 3;
- break;
- case 3:
- case 4:
- case 5:
- g_date_add_days (&(week_view->first_day_shown), 7);
- selection_end_day -= 3;
- break;
- case 6:
- g_date_add_days (&(week_view->first_day_shown), 7);
- selection_end_day -= 4;
- break;
- default:
- break;
- }
- }
-
- week_view->selection_start_day = selection_end_day;
- week_view->selection_end_day = selection_end_day;
-
- gtk_widget_queue_draw (week_view->main_canvas);
-}
-
-static gboolean
-e_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 (parent_class)->key_press_event (widget, event);
- return handled;
-}
-
-void
-e_week_view_show_popup_menu (EWeekView *week_view,
- GdkEventButton *bevent,
- gint event_num)
-{
- GtkMenu *popup;
-
- week_view->popup_event_num = event_num;
-
- popup = e_calendar_view_create_popup_menu (E_CALENDAR_VIEW (week_view));
- e_popup_menu (popup, (GdkEvent *) bevent);
-}
-
-static gboolean
-e_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;
-}
-
-void
-e_week_view_jump_to_button_item (EWeekView *week_view, GnomeCanvasItem *item)
-{
- gint day;
- GnomeCalendar *calendar;
-
- for (day = 0; day < E_WEEK_VIEW_MAX_WEEKS * 7; ++day) {
- if (item == week_view->jump_buttons[day]) {
- calendar = e_calendar_view_get_calendar (E_CALENDAR_VIEW (week_view));
- if (calendar)
- gnome_calendar_dayjump
- (calendar,
- week_view->day_starts[day]);
- else
- g_warning ("Calendar not set");
- 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_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_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 (focus_event->in) {
- week_view->focused_jump_button = day;
- pixbuf = gdk_pixbuf_new_from_xpm_data ((const char**) 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 char**) jump_xpm);
- gnome_canvas_item_set (week_view->jump_buttons[day],
- "GnomeCanvasPixbuf::pixbuf",
- pixbuf, NULL);
- }
- if (pixbuf)
- gdk_pixbuf_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,
- gchar **suffix,
- gint *suffix_width)
-{
- /* 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_calendar_view_get_use_24_hour_format (E_CALENDAR_VIEW (week_view))) {
- *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)
-{
- gint time_width;
-
- 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_calendar_view_get_use_24_hour_format (E_CALENDAR_VIEW (week_view)))
- 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 = g_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) {
- gtk_timeout_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]->object.flags & GNOME_CANVAS_ITEM_VISIBLE;
- return FALSE;
-}
diff --git a/calendar/gui/e-week-view.h b/calendar/gui/e-week-view.h
deleted file mode 100644
index aca3f2bc2a..0000000000
--- a/calendar/gui/e-week-view.h
+++ /dev/null
@@ -1,438 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Author :
- * Damon Chaplin <damon@ximian.com>
- *
- * Copyright 1999, Ximian, Inc.
- * Copyright 2001, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-#ifndef _E_WEEK_VIEW_H_
-#define _E_WEEK_VIEW_H_
-
-#include <gtk/gtktable.h>
-#include <libgnomecanvas/gnome-canvas.h>
-#include <gal/widgets/e-popup-menu.h>
-
-#include "e-cal-view.h"
-#include "gnome-cal.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-/*
- * EWeekView - displays the Week & Month views of the calendar.
- */
-
-/* The maximum number of weeks we show. 5 is usually enough for 1 month,
- but we allow 6 for longer selections. */
-#define E_WEEK_VIEW_MAX_WEEKS 6
-
-/* The size of the reminder & recurrence icons, and padding around them.
- X_PAD is the padding between icons. R_PAD is the padding on the right of
- the last icon, before the event text. */
-#define E_WEEK_VIEW_ICON_WIDTH 16
-#define E_WEEK_VIEW_ICON_HEIGHT 16
-#define E_WEEK_VIEW_ICON_X_PAD 1
-#define E_WEEK_VIEW_ICON_Y_PAD 1
-#define E_WEEK_VIEW_ICON_R_PAD 1
-
-/* The space on the left & right outside of the event. (The triangle to
- indicate the event continues is displayed in this space). */
-#define E_WEEK_VIEW_EVENT_L_PAD 2
-#define E_WEEK_VIEW_EVENT_R_PAD 2
-
-/* The vertical spacing between rows of events. */
-#define E_WEEK_VIEW_EVENT_Y_SPACING 1
-
-/* The size of the border around long events. */
-#define E_WEEK_VIEW_EVENT_BORDER_WIDTH 1
-#define E_WEEK_VIEW_EVENT_BORDER_HEIGHT 1
-
-/* The padding on the top and bottom of the event text. */
-#define E_WEEK_VIEW_EVENT_TEXT_Y_PAD 1
-
-/* The space between the start and end times. */
-#define E_WEEK_VIEW_EVENT_TIME_SPACING 2
-
-/* The space between the time and the event text or icons. */
-#define E_WEEK_VIEW_EVENT_TIME_X_PAD 2
-
-/* The space between the borders of long events and any text of icons. */
-#define E_WEEK_VIEW_EVENT_EDGE_X_PAD 2
-
-/* The padding above and on the right of the date string at the top of each
- cell. */
-#define E_WEEK_VIEW_DATE_T_PAD 2
-#define E_WEEK_VIEW_DATE_R_PAD 4
-
-/* The padding above and below the line under the date string, in the Week
- view, and also the space on the left of it. */
-#define E_WEEK_VIEW_DATE_LINE_T_PAD 1
-#define E_WEEK_VIEW_DATE_LINE_B_PAD 1
-#define E_WEEK_VIEW_DATE_LINE_L_PAD 10
-
-/* The padding below the date string in the Month view. */
-#define E_WEEK_VIEW_DATE_B_PAD 1
-
-/* We use a 7-bit field to store row numbers in EWeekViewEventSpan, so the
- maximum number or rows we can allow is 127. It is very unlikely to be
- reached anyway. */
-#define E_WEEK_VIEW_MAX_ROWS_PER_CELL 127
-
-/* These index our colors array. */
-typedef enum
-{
- E_WEEK_VIEW_COLOR_EVEN_MONTHS,
- E_WEEK_VIEW_COLOR_ODD_MONTHS,
- E_WEEK_VIEW_COLOR_EVENT_BACKGROUND,
- E_WEEK_VIEW_COLOR_EVENT_BORDER,
- E_WEEK_VIEW_COLOR_EVENT_TEXT,
- E_WEEK_VIEW_COLOR_GRID,
- E_WEEK_VIEW_COLOR_SELECTED,
- E_WEEK_VIEW_COLOR_SELECTED_UNFOCUSSED,
- E_WEEK_VIEW_COLOR_DATES,
- E_WEEK_VIEW_COLOR_DATES_SELECTED,
- E_WEEK_VIEW_COLOR_TODAY,
-
- E_WEEK_VIEW_COLOR_LAST
-} EWeekViewColors;
-
-/* These specify which part of the selection we are dragging, if any. */
-typedef enum
-{
- E_WEEK_VIEW_DRAG_NONE,
- E_WEEK_VIEW_DRAG_START,
- E_WEEK_VIEW_DRAG_END
-} EWeekViewDragPosition;
-
-/* These specify which times are shown for the 1-day events. We use the small
- font for the minutes if it can be loaded and the option is on. */
-typedef enum
-{
- E_WEEK_VIEW_TIME_NONE,
- E_WEEK_VIEW_TIME_START,
- E_WEEK_VIEW_TIME_BOTH,
- E_WEEK_VIEW_TIME_START_SMALL_MIN,
- E_WEEK_VIEW_TIME_BOTH_SMALL_MIN
-} EWeekViewTimeFormat;
-
-typedef struct _EWeekViewEventSpan EWeekViewEventSpan;
-struct _EWeekViewEventSpan {
- guint start_day : 6;
- guint num_days : 3;
- guint row : 7;
- GnomeCanvasItem *background_item;
- GnomeCanvasItem *text_item;
-};
-
-typedef struct _EWeekViewEvent EWeekViewEvent;
-struct _EWeekViewEvent {
- E_CALENDAR_VIEW_EVENT_FIELDS
- gint spans_index;
- guint8 num_spans;
-};
-
-
-#define E_WEEK_VIEW(obj) GTK_CHECK_CAST (obj, e_week_view_get_type (), EWeekView)
-#define E_WEEK_VIEW_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, e_week_view_get_type (), EWeekViewClass)
-#define E_IS_WEEK_VIEW(obj) GTK_CHECK_TYPE (obj, e_week_view_get_type ())
-
-
-typedef struct _EWeekView EWeekView;
-typedef struct _EWeekViewClass EWeekViewClass;
-
-struct _EWeekView
-{
- ECalendarView cal_view;
-
- /* The top canvas where the dates are shown. */
- GtkWidget *titles_canvas;
- GnomeCanvasItem *titles_canvas_item;
-
- /* The main canvas where the appointments are shown. */
- GtkWidget *main_canvas;
- GnomeCanvasItem *main_canvas_item;
-
- GnomeCanvasItem *jump_buttons[E_WEEK_VIEW_MAX_WEEKS * 7];
- gint focused_jump_button;
-
- GtkWidget *vscrollbar;
-
- /* The query object */
- ECalView *query;
-
- /* The array of EWeekViewEvent elements. */
- GArray *events;
- gboolean events_sorted;
- gboolean events_need_layout;
- gboolean events_need_reshape;
-
- /* The ID of the timeout function for doing a new layout. */
- gint layout_timeout_id;
-
- /* An array of EWeekViewEventSpan elements. Each event has its own
- space within this array, and uses the spans_index and num_spans
- fields of the EWeekViewEvent struct to access it. */
- GArray *spans;
-
- /* The start of each day displayed. */
- time_t day_starts[E_WEEK_VIEW_MAX_WEEKS * 7 + 1];
-
- /* The base date, where the adjustment value is 0. */
- GDate base_date;
-
- /* 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
- display_month is TRUE. */
- gint weeks_shown;
-
- /* If Sat & Sun are compressed. Only applicable in month view, since
- they are always compressed into 1 cell in the week view. */
- gboolean compress_weekend;
-
- /* Whether we use show event end times. */
- gboolean show_event_end_times;
-
- /* The first day of the week, 0 (Monday) to 6 (Sunday). */
- gint week_start_day;
-
- /* The first day of the week we display, 0 (Monday) to 6 (Sunday).
- This will usually be week_start_day, but if the weekend is
- compressed, and week_start_day is Sunday we have to use Saturday. */
- gint display_start_day;
-
- /* The vertical offset of the events from the top of the cells. */
- gint events_y_offset;
-
- /* The height of the events, not including spacing between them. */
- gint row_height;
-
- /* The number of rows of events in each cell. */
- gint rows_per_cell;
- gint rows_per_compressed_cell;
-
- /* The number of rows we have used for each day (i.e. each cell) */
- gint rows_per_day[E_WEEK_VIEW_MAX_WEEKS * 7];
-
- /* If the small font is used for displaying the minutes. */
- gboolean use_small_font;
-
- /* Small font to display the minutes. */
- PangoFontDescription *small_font_desc;
-
- /* The widths of various pieces of text, used to determine which of
- several date formats to display, set in e_week_view_style_set(). */
- gint space_width; /* One space character ' '. */
- gint colon_width; /* Size of ':' in the font. */
- gint slash_width; /* Size of '/' in the font. */
- gint digit_width; /* Size of a '0' digit. */
- gint small_digit_width; /* Size of a small_font '0' digit. */
- gint day_widths[7]; /* Monday first. */
- gint max_day_width;
- gint abbr_day_widths[7];
- gint max_abbr_day_width;
- gint month_widths[12];
- gint max_month_width;
- gint abbr_month_widths[12];
- gint max_abbr_month_width;
-
- /* The size of the main grid of days and of the cells. A row
- corresponds to a compressed day, so normal days usually take
- up 2 rows. Note that the offsets arrays have one more element
- than the widths/heights arrays since they also contain the
- right/bottom edge. */
- gint rows;
- gint columns;
- gint col_widths[7];
- gint col_offsets[8];
- gint row_heights[E_WEEK_VIEW_MAX_WEEKS * 2];
- gint row_offsets[E_WEEK_VIEW_MAX_WEEKS * 2 + 1];
-
- /* This specifies which times we are showing for the events, depending
- on how much room is available. */
- EWeekViewTimeFormat time_format;
-
- /* The GC used for painting in different colors. */
- GdkGC *main_gc;
-
- /* The icons. */
- GdkPixmap *reminder_icon;
- GdkBitmap *reminder_mask;
- GdkPixmap *recurrence_icon;
- GdkBitmap *recurrence_mask;
- GdkPixmap *timezone_icon;
- GdkBitmap *timezone_mask;
-
- /* Colors for drawing. */
- GdkColor colors[E_WEEK_VIEW_COLOR_LAST];
-
- /* The normal & resizing cursors. */
- GdkCursor *normal_cursor;
- GdkCursor *move_cursor;
- GdkCursor *resize_width_cursor;
-
- /* This remembers the last cursor set on the window. */
- GdkCursor *last_cursor_set;
-
- /* The currently selected region, in days from the first day shown.
- If selection_start_day is -1 there is no current selection. */
- gint selection_start_day;
- gint selection_end_day;
-
- /* This specifies which end of the selection is being dragged, or is
- E_WEEK_VIEW_DRAG_NONE if the selection isn't being dragged. */
- EWeekViewDragPosition selection_drag_pos;
-
- /* This is the event the mouse button was pressed on. If the button
- is released we start editing it, but if the mouse is dragged we set
- this to -1. */
- gint pressed_event_num;
- gint pressed_span_num;
-
- /* The event span currently being edited. The num is -1 if no event is
- being edited. */
- gint editing_event_num;
- gint editing_span_num;
-
- /* The event that the context menu is for. */
- gint popup_event_num;
-
- /* The last mouse position when dragging, in the entire canvas. */
- gint drag_event_x;
- gint drag_event_y;
-
- /* "am" and "pm" in the current locale, and their widths. */
- gchar *am_string;
- gchar *pm_string;
- gint am_string_width;
- gint pm_string_width;
-};
-
-struct _EWeekViewClass
-{
- ECalendarViewClass parent_class;
-};
-
-
-GtkType e_week_view_get_type (void);
-GtkWidget* e_week_view_new (void);
-
-/* The first day shown. Note that it will be rounded down to the start of a
- week when set. The returned value will be invalid if no date has been set
- yet. */
-void e_week_view_get_first_day_shown (EWeekView *week_view,
- GDate *date);
-void e_week_view_set_first_day_shown (EWeekView *week_view,
- GDate *date);
-
-/* The selected time range. The EWeekView will show the corresponding
- month and the days between start_time and end_time will be selected.
- To select a single day, use the same value for start_time & end_time. */
-void e_week_view_set_selected_time_range_visible (EWeekView *week_view,
- time_t start_time,
- time_t end_time);
-
-/* Whether to display 1 week or 1 month (5 weeks). It defaults to 1 week. */
-gboolean e_week_view_get_multi_week_view (EWeekView *week_view);
-void e_week_view_set_multi_week_view (EWeekView *week_view,
- gboolean multi_week_view);
-
-/* The number of weeks shown in the multi-week view. */
-gint e_week_view_get_weeks_shown (EWeekView *week_view);
-void e_week_view_set_weeks_shown (EWeekView *week_view,
- gint weeks_shown);
-
-/* Whether the weekend (Sat/Sun) should be compressed into 1 cell in the Month
- view. In the Week view they are always compressed. */
-gboolean e_week_view_get_compress_weekend (EWeekView *week_view);
-void e_week_view_set_compress_weekend (EWeekView *week_view,
- gboolean compress);
-
-/* Whether we display event end times. */
-gboolean e_week_view_get_show_event_end_times (EWeekView *week_view);
-void e_week_view_set_show_event_end_times (EWeekView *week_view,
- gboolean show);
-
-/* The first day of the week, 0 (Monday) to 6 (Sunday). */
-gint e_week_view_get_week_start_day (EWeekView *week_view);
-void e_week_view_set_week_start_day (EWeekView *week_view,
- gint week_start_day);
-
-void e_week_view_delete_occurrence (EWeekView *week_view);
-
-/* Returns the number of selected events (0 or 1 at present). */
-gint e_week_view_get_num_events_selected (EWeekView *week_view);
-
-/*
- * Internal functions called by the associated canvas items.
- */
-void e_week_view_get_day_position (EWeekView *week_view,
- gint day,
- gint *day_x,
- gint *day_y,
- gint *day_w,
- gint *day_h);
-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);
-gboolean e_week_view_is_one_day_event (EWeekView *week_view,
- gint event_num);
-gboolean e_week_view_start_editing_event (EWeekView *week_view,
- gint event_num,
- gint span_num,
- gchar *initial_text);
-void e_week_view_stop_editing_event (EWeekView *week_view);
-
-void e_week_view_show_popup_menu (EWeekView *week_view,
- GdkEventButton *event,
- gint event_num);
-
-void e_week_view_convert_time_to_display (EWeekView *week_view,
- gint hour,
- gint *display_hour,
- gchar **suffix,
- gint *suffix_width);
-gint e_week_view_get_time_string_width (EWeekView *week_view);
-
-gint e_week_view_event_sort_func (const void *arg1,
- const void *arg2);
-
-gboolean e_week_view_find_event_from_item (EWeekView *week_view,
- GnomeCanvasItem *item,
- gint *event_num_return,
- gint *span_num_return);
-
-gboolean e_week_view_is_jump_button_visible (EWeekView *week_view,
- gint day);
-void e_week_view_jump_to_button_item (EWeekView *week_view, GnomeCanvasItem *item);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _E_WEEK_VIEW_H_ */
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
deleted file mode 100644
index 8978f38988..0000000000
--- a/calendar/gui/gnome-cal.c
+++ /dev/null
@@ -1,2925 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* Evolution calendar - Main calendar view widget
- *
- * Copyright (C) 1998 The Free Software Foundation
- * Copyright (C) 2000 Ximian, Inc.
- * Copyright (C) 2001 Ximian, Inc.
- * Copyright (C) 2003 Novell, Inc
- *
- * Authors: Miguel de Icaza <miguel@ximian.com>
- * Federico Mena-Quintero <federico@ximian.com>
- * Seth Alves <alves@hungry.com>
- * Rodrigo Moya <rodrigo@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-#include <unistd.h>
-#include <signal.h>
-#include <sys/wait.h>
-#include <fcntl.h>
-#include <glib.h>
-#include <gdk/gdkkeysyms.h>
-#include <gtk/gtkbindings.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnome/gnome-util.h>
-#include <libgnomeui/gnome-dialog.h>
-#include <libgnomeui/gnome-dialog-util.h>
-#include <bonobo/bonobo-exception.h>
-#include "e-util/e-url.h"
-#include <libecal/e-cal-time-util.h>
-#include "widgets/menus/gal-view-menus.h"
-#include "e-comp-editor-registry.h"
-#include "dialogs/delete-error.h"
-#include "dialogs/event-editor.h"
-#include "dialogs/task-editor.h"
-#include "comp-util.h"
-#include "e-cal-model-calendar.h"
-#include "e-day-view.h"
-#include "e-day-view-config.h"
-#include "e-day-view-time-item.h"
-#include "e-week-view.h"
-#include "e-week-view-config.h"
-#include "e-cal-list-view.h"
-#include "e-cal-list-view-config.h"
-#include "e-mini-calendar-config.h"
-#include "e-calendar-table-config.h"
-#include "evolution-calendar.h"
-#include "gnome-cal.h"
-#include "calendar-component.h"
-#include "cal-search-bar.h"
-#include "calendar-commands.h"
-#include "calendar-config.h"
-#include "calendar-view.h"
-#include "calendar-view-factory.h"
-#include "tag-calendar.h"
-#include "misc.h"
-#include "ea-calendar.h"
-
-
-
-/* Private part of the GnomeCalendar structure */
-struct _GnomeCalendarPrivate {
- /* The calendars for display */
- GHashTable *clients;
- GList *clients_list;
-
- /* Set of categories from the calendar client */
- /* FIXME are we getting all the categories? */
- GPtrArray *cal_categories;
-
- /*
- * The TaskPad Folder.
- */
-
- /* The calendar client object we monitor */
- ECal *task_pad_client;
-
- /* Set of categories from the tasks client */
- GPtrArray *tasks_categories;
-
- /*
- * Fields for the calendar view
- */
-
- /* This is the last selection explicitly selected by the user. We try
- to keep it the same when we switch views, but we may have to alter
- it depending on the view (e.g. the week views only select days, so
- any times are lost. */
- time_t selection_start_time;
- time_t selection_end_time;
-
- /* Widgets */
-
- GtkWidget *search_bar;
-
- GtkWidget *hpane;
- GtkWidget *notebook;
- GtkWidget *vpane;
-
- ECalendar *date_navigator;
- EMiniCalendarConfig *date_navigator_config;
- GtkWidget *todo;
- ECalendarTableConfig *todo_config;
-
- GtkWidget *day_view;
- GtkWidget *work_week_view;
- GtkWidget *week_view;
- GtkWidget *month_view;
- GtkWidget *list_view;
-
- /* Calendar query for the date navigator */
- GList *dn_queries; /* list of CalQueries */
- char *sexp;
- guint e_cal_view_timeout;
-
- /* This is the view currently shown. We use it to keep track of the
- positions of the panes. range_selected is TRUE if a range of dates
- was selected in the date navigator to show the view. */
- ECalendarView *views[GNOME_CAL_LAST_VIEW];
- GObject *configs[GNOME_CAL_LAST_VIEW];
- GnomeCalendarViewType current_view_type;
- GList *notifications;
-
- gboolean range_selected;
-
- /* These are the saved positions of the panes. They are multiples of
- calendar month widths & heights in the date navigator, so that they
- will work OK after theme changes. */
- gint hpane_pos;
- gint vpane_pos;
- gint hpane_pos_month_view;
- gint vpane_pos_month_view;
-
- /* The signal handler id for our GtkCalendar "day_selected" handler. */
- guint day_selected_id;
-
- /* View instance and menus for the control */
- GalViewInstance *view_instance;
- GalViewMenus *view_menus;
-
- /* Our current timezone. */
- icaltimezone *zone;
-
- /* The dates currently shown. If they are -1 then we have no dates
- shown. We only use these to check if we need to emit a
- 'dates-shown-changed' signal.*/
- time_t visible_start;
- time_t visible_end;
-};
-
-/* Signal IDs */
-
-enum {
- DATES_SHOWN_CHANGED,
- CALENDAR_SELECTION_CHANGED,
- TASKPAD_SELECTION_CHANGED,
- CALENDAR_FOCUS_CHANGE,
- TASKPAD_FOCUS_CHANGE,
- GOTO_DATE,
- LAST_SIGNAL
-};
-
-/* Used to indicate who has the focus within the calendar view */
-typedef enum {
- FOCUS_CALENDAR,
- FOCUS_TASKPAD,
- FOCUS_OTHER
-} FocusLocation;
-
-static guint gnome_calendar_signals[LAST_SIGNAL];
-
-
-
-
-static void gnome_calendar_class_init (GnomeCalendarClass *class);
-static void gnome_calendar_init (GnomeCalendar *gcal);
-static void gnome_calendar_destroy (GtkObject *object);
-static void gnome_calendar_goto_date (GnomeCalendar *gcal,
- GnomeCalendarGotoDateType goto_date);
-
-static void gnome_calendar_set_pane_positions (GnomeCalendar *gcal);
-static void gnome_calendar_update_view_times (GnomeCalendar *gcal);
-static void gnome_calendar_update_date_navigator (GnomeCalendar *gcal);
-
-static void gnome_calendar_hpane_realized (GtkWidget *w, GnomeCalendar *gcal);
-static void gnome_calendar_vpane_realized (GtkWidget *w, GnomeCalendar *gcal);
-static gboolean gnome_calendar_vpane_resized (GtkWidget *w, GdkEventButton *e, GnomeCalendar *gcal);
-static gboolean gnome_calendar_hpane_resized (GtkWidget *w, GdkEventButton *e, GnomeCalendar *gcal);
-
-static void gnome_calendar_on_date_navigator_date_range_changed (ECalendarItem *calitem,
- GnomeCalendar *gcal);
-static void gnome_calendar_on_date_navigator_selection_changed (ECalendarItem *calitem,
- GnomeCalendar *gcal);
-static void gnome_calendar_notify_dates_shown_changed (GnomeCalendar *gcal);
-
-static void update_query (GnomeCalendar *gcal);
-
-
-static GtkVBoxClass *parent_class;
-
-
-
-
-E_MAKE_TYPE (gnome_calendar, "GnomeCalendar", GnomeCalendar, gnome_calendar_class_init,
- gnome_calendar_init, GTK_TYPE_VBOX);
-
-/* Class initialization function for the gnome calendar */
-static void
-gnome_calendar_class_init (GnomeCalendarClass *class)
-{
- GtkObjectClass *object_class;
- GtkBindingSet *binding_set;
-
- object_class = (GtkObjectClass *) class;
-
- parent_class = g_type_class_peek_parent (class);
-
- gnome_calendar_signals[DATES_SHOWN_CHANGED] =
- gtk_signal_new ("dates_shown_changed",
- GTK_RUN_LAST,
- G_TYPE_FROM_CLASS (object_class),
- GTK_SIGNAL_OFFSET (GnomeCalendarClass,
- dates_shown_changed),
- gtk_marshal_NONE__NONE,
- GTK_TYPE_NONE, 0);
-
- gnome_calendar_signals[CALENDAR_SELECTION_CHANGED] =
- gtk_signal_new ("calendar_selection_changed",
- GTK_RUN_LAST,
- G_TYPE_FROM_CLASS (object_class),
- GTK_SIGNAL_OFFSET (GnomeCalendarClass, calendar_selection_changed),
- gtk_marshal_NONE__NONE,
- GTK_TYPE_NONE, 0);
-
- gnome_calendar_signals[TASKPAD_SELECTION_CHANGED] =
- gtk_signal_new ("taskpad_selection_changed",
- GTK_RUN_LAST,
- G_TYPE_FROM_CLASS (object_class),
- GTK_SIGNAL_OFFSET (GnomeCalendarClass, taskpad_selection_changed),
- gtk_marshal_NONE__NONE,
- GTK_TYPE_NONE, 0);
-
- gnome_calendar_signals[CALENDAR_FOCUS_CHANGE] =
- gtk_signal_new ("calendar_focus_change",
- GTK_RUN_FIRST,
- G_TYPE_FROM_CLASS (object_class),
- GTK_SIGNAL_OFFSET (GnomeCalendarClass, calendar_focus_change),
- gtk_marshal_NONE__BOOL,
- GTK_TYPE_NONE, 1,
- GTK_TYPE_BOOL);
-
- gnome_calendar_signals[TASKPAD_FOCUS_CHANGE] =
- gtk_signal_new ("taskpad_focus_change",
- GTK_RUN_FIRST,
- G_TYPE_FROM_CLASS (object_class),
- GTK_SIGNAL_OFFSET (GnomeCalendarClass, taskpad_focus_change),
- gtk_marshal_NONE__BOOL,
- GTK_TYPE_NONE, 1,
- GTK_TYPE_BOOL);
-
- gnome_calendar_signals[GOTO_DATE] =
- g_signal_new ("goto_date",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
- G_STRUCT_OFFSET (GnomeCalendarClass, goto_date),
- NULL, NULL,
- g_cclosure_marshal_VOID__INT,
- G_TYPE_NONE,
- 1,
- G_TYPE_INT);
-
-
- object_class->destroy = gnome_calendar_destroy;
-
- class->dates_shown_changed = NULL;
- class->calendar_selection_changed = NULL;
- class->taskpad_selection_changed = NULL;
- class->calendar_focus_change = NULL;
- class->taskpad_focus_change = NULL;
- class->goto_date = gnome_calendar_goto_date;
-
- /*
- * Key bindings
- */
-
- binding_set = gtk_binding_set_by_class (class);
-
- /* Alt+PageUp/PageDown, go to the first/last day of the month */
- gtk_binding_entry_add_signal (binding_set, GDK_Page_Up,
- GDK_MOD1_MASK,
- "goto_date", 1,
- G_TYPE_ENUM,
- GNOME_CAL_GOTO_FIRST_DAY_OF_MONTH);
- gtk_binding_entry_add_signal (binding_set, GDK_KP_Page_Up,
- GDK_MOD1_MASK,
- "goto_date", 1,
- G_TYPE_ENUM,
- GNOME_CAL_GOTO_FIRST_DAY_OF_MONTH);
- gtk_binding_entry_add_signal (binding_set, GDK_Page_Down,
- GDK_MOD1_MASK,
- "goto_date", 1,
- G_TYPE_ENUM,
- GNOME_CAL_GOTO_LAST_DAY_OF_MONTH);
- gtk_binding_entry_add_signal (binding_set, GDK_KP_Page_Down,
- GDK_MOD1_MASK,
- "goto_date", 1,
- G_TYPE_ENUM,
- GNOME_CAL_GOTO_LAST_DAY_OF_MONTH);
-
- /* Alt+Home/End, go to the first/last day of the week */
- gtk_binding_entry_add_signal (binding_set, GDK_Home,
- GDK_MOD1_MASK,
- "goto_date", 1,
- G_TYPE_ENUM,
- GNOME_CAL_GOTO_FIRST_DAY_OF_WEEK);
- gtk_binding_entry_add_signal (binding_set, GDK_End,
- GDK_MOD1_MASK,
- "goto_date", 1,
- G_TYPE_ENUM,
- GNOME_CAL_GOTO_LAST_DAY_OF_WEEK);
- gtk_binding_entry_add_signal (binding_set, GDK_KP_Home,
- GDK_MOD1_MASK,
- "goto_date", 1,
- G_TYPE_ENUM,
- GNOME_CAL_GOTO_FIRST_DAY_OF_WEEK);
- gtk_binding_entry_add_signal (binding_set, GDK_KP_End,
- GDK_MOD1_MASK,
- "goto_date", 1,
- G_TYPE_ENUM,
- GNOME_CAL_GOTO_LAST_DAY_OF_WEEK);
-
- /*Alt+Left/Right, go to the same day of the previous/next week*/
- gtk_binding_entry_add_signal (binding_set,GDK_Left,
- GDK_MOD1_MASK,
- "goto_date",1,
- G_TYPE_ENUM,
- GNOME_CAL_GOTO_SAME_DAY_OF_PREVIOUS_WEEK);
- gtk_binding_entry_add_signal (binding_set,GDK_KP_Left,
- GDK_MOD1_MASK,
- "goto_date",1,
- G_TYPE_ENUM,
- GNOME_CAL_GOTO_SAME_DAY_OF_PREVIOUS_WEEK);
- gtk_binding_entry_add_signal (binding_set,GDK_Right,
- GDK_MOD1_MASK,
- "goto_date",1,
- G_TYPE_ENUM,
- GNOME_CAL_GOTO_SAME_DAY_OF_NEXT_WEEK);
- gtk_binding_entry_add_signal (binding_set,GDK_KP_Right,
- GDK_MOD1_MASK,
- "goto_date",1,
- G_TYPE_ENUM,
- GNOME_CAL_GOTO_SAME_DAY_OF_NEXT_WEEK);
- /* init the accessibility support for gnome_calendar */
- gnome_calendar_a11y_init ();
-
-}
-
-/* Callback used when the calendar query reports of an updated object */
-static void
-dn_e_cal_view_objects_added_cb (ECalView *query, GList *objects, gpointer data)
-{
- GnomeCalendar *gcal;
- GnomeCalendarPrivate *priv;
- GList *l;
-
- gcal = GNOME_CALENDAR (data);
- priv = gcal->priv;
-
- for (l = objects; l; l = l->next) {
- ECalComponent *comp = NULL;
-
- comp = e_cal_component_new ();
- if (!e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (l->data))) {
- g_object_unref (comp);
-
- continue;
- }
-
- tag_calendar_by_comp (priv->date_navigator, comp, e_cal_view_get_client (query), NULL,
- FALSE, TRUE);
- g_object_unref (comp);
- }
-}
-
-static void
-dn_e_cal_view_objects_modified_cb (ECalView *query, GList *objects, gpointer data)
-{
- GnomeCalendar *gcal;
- GnomeCalendarPrivate *priv;
-
- gcal = GNOME_CALENDAR (data);
- priv = gcal->priv;
-
- /* We have to retag the whole thing: an event may change dates
- * and the tag_calendar_by_comp() below would not know how to
- * untag the old dates.
- */
- update_query (gcal);
-}
-
-/* Callback used when the calendar query reports of a removed object */
-static void
-dn_e_cal_view_objects_removed_cb (ECalView *query, GList *uids, gpointer data)
-{
- GnomeCalendar *gcal;
-
- gcal = GNOME_CALENDAR (data);
-
- /* Just retag the whole thing */
- update_query (gcal);
-}
-
-/* Callback used when the calendar query is done */
-static void
-dn_e_cal_view_done_cb (ECalView *query, ECalendarStatus status, gpointer data)
-{
- GnomeCalendar *gcal;
-
- gcal = GNOME_CALENDAR (data);
-
- /* FIXME Better error reporting */
- if (status != E_CALENDAR_STATUS_OK)
- g_warning (G_STRLOC ": Query did not successfully complete");
-}
-
-/* Returns the current view widget, an EDayView, EWeekView or ECalListView. */
-GtkWidget*
-gnome_calendar_get_current_view_widget (GnomeCalendar *gcal)
-{
- GnomeCalendarPrivate *priv;
-
- priv = gcal->priv;
-
- return GTK_WIDGET (priv->views[priv->current_view_type]);
-}
-
-/* Gets the focus location based on who is the focused widget within the
- * calendar view.
- */
-static FocusLocation
-get_focus_location (GnomeCalendar *gcal)
-{
- GnomeCalendarPrivate *priv;
- ETable *etable;
-
- priv = gcal->priv;
-
- etable = e_calendar_table_get_table (E_CALENDAR_TABLE (priv->todo));
-
- if (GTK_WIDGET_HAS_FOCUS (etable->table_canvas))
- return FOCUS_TASKPAD;
- else {
- GtkWidget *widget;
- EDayView *dv;
- EWeekView *wv;
- ECalListView *lv;
-
- widget = gnome_calendar_get_current_view_widget (gcal);
-
- switch (priv->current_view_type) {
- case GNOME_CAL_DAY_VIEW:
- case GNOME_CAL_WORK_WEEK_VIEW:
- dv = E_DAY_VIEW (widget);
-
- if (GTK_WIDGET_HAS_FOCUS (dv->top_canvas)
- || GTK_WIDGET_HAS_FOCUS (dv->main_canvas))
- return FOCUS_CALENDAR;
- else
- return FOCUS_OTHER;
-
- case GNOME_CAL_WEEK_VIEW:
- case GNOME_CAL_MONTH_VIEW:
- wv = E_WEEK_VIEW (widget);
-
- if (GTK_WIDGET_HAS_FOCUS (wv->main_canvas))
- return FOCUS_CALENDAR;
- else
- return FOCUS_OTHER;
-
- case GNOME_CAL_LIST_VIEW:
- lv = E_CAL_LIST_VIEW (widget);
-
- if (GTK_WIDGET_HAS_FOCUS (e_table_scrolled_get_table (lv->table_scrolled)))
- return FOCUS_CALENDAR;
- else
- return FOCUS_OTHER;
-
- default:
- g_assert_not_reached ();
- return FOCUS_OTHER;
- }
- }
-}
-
-/* Computes the range of time that the date navigator is showing */
-static void
-get_date_navigator_range (GnomeCalendar *gcal, time_t *start_time, time_t *end_time)
-{
- GnomeCalendarPrivate *priv;
- gint start_year, start_month, start_day;
- gint end_year, end_month, end_day;
- struct icaltimetype start_tt;
- struct icaltimetype end_tt;
-
- priv = gcal->priv;
-
- start_tt = icaltime_null_time ();
- end_tt = icaltime_null_time ();
-
- if (!e_calendar_item_get_date_range (priv->date_navigator->calitem,
- &start_year, &start_month, &start_day,
- &end_year, &end_month, &end_day)) {
- *start_time = -1;
- *end_time = -1;
- return;
- }
-
- start_tt.year = start_year;
- start_tt.month = start_month + 1;
- start_tt.day = start_day;
-
- end_tt.year = end_year;
- end_tt.month = end_month + 1;
- end_tt.day = end_day;
-
- icaltime_adjust (&end_tt, 1, 0, 0, 0);
-
- *start_time = icaltime_as_timet_with_zone (start_tt, priv->zone);
- *end_time = icaltime_as_timet_with_zone (end_tt, priv->zone);
-}
-
-/* Adjusts a given query sexp with the time range of the date navigator */
-static char *
-adjust_e_cal_view_sexp (GnomeCalendar *gcal, const char *sexp)
-{
- time_t start_time, end_time;
- char *start, *end;
- char *new_sexp;
-
- get_date_navigator_range (gcal, &start_time, &end_time);
- if (start_time == -1 || end_time == -1)
- return NULL;
-
- start = isodate_from_time_t (start_time);
- end = isodate_from_time_t (end_time);
-
- new_sexp = g_strdup_printf ("(and (occur-in-time-range? (make-time \"%s\")"
- " (make-time \"%s\"))"
- " %s)",
- start, end,
- sexp);
-
-
- g_free (start);
- g_free (end);
-
- return new_sexp;
-}
-
-/* Restarts a query for the date navigator in the calendar */
-static void
-update_query (GnomeCalendar *gcal)
-{
- GnomeCalendarPrivate *priv;
- ECalView *old_query;
- char *real_sexp;
- GList *l;
-
- priv = gcal->priv;
-
- e_calendar_item_clear_marks (priv->date_navigator->calitem);
-
- e_calendar_view_set_status_message (E_CALENDAR_VIEW (priv->week_view), _("Searching"));
-
- /* free the previous queries */
- for (l = priv->dn_queries; l != NULL; l = l->next) {
- old_query = l->data;
-
- if (old_query) {
- g_signal_handlers_disconnect_matched (old_query, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, gcal);
- g_object_unref (old_query);
- }
- }
-
- g_list_free (priv->dn_queries);
- priv->dn_queries = NULL;
-
- g_assert (priv->sexp != NULL);
-
- real_sexp = adjust_e_cal_view_sexp (gcal, priv->sexp);
- if (!real_sexp) {
- e_calendar_view_set_status_message (E_CALENDAR_VIEW (priv->week_view), NULL);
- return; /* No time range is set, so don't start a query */
- }
-
- /* create queries for each loaded client */
- for (l = priv->clients_list; l != NULL; l = l->next) {
- if (!e_cal_get_query ((ECal *) l->data, real_sexp, &old_query, NULL)) {
- g_warning (G_STRLOC ": Could not create the query");
-
- continue;
- }
-
- g_signal_connect (old_query, "objects_added",
- G_CALLBACK (dn_e_cal_view_objects_added_cb), gcal);
- g_signal_connect (old_query, "objects_modified",
- G_CALLBACK (dn_e_cal_view_objects_modified_cb), gcal);
- g_signal_connect (old_query, "objects_removed",
- G_CALLBACK (dn_e_cal_view_objects_removed_cb), gcal);
- g_signal_connect (old_query, "view_done",
- G_CALLBACK (dn_e_cal_view_done_cb), gcal);
-
- priv->dn_queries = g_list_append (priv->dn_queries, old_query);
-
- e_cal_view_start (old_query);
- }
-
- g_free (real_sexp);
-
- e_calendar_view_set_status_message (E_CALENDAR_VIEW (priv->week_view), NULL);
-}
-
-static void
-adjust_e_cal_view_for_view (ECalendarView *cal_view, const char *sexp)
-{
- char *real_sexp, *start, *end;
- time_t ttstart, ttend;
-
- e_calendar_view_get_visible_time_range (cal_view, &ttstart, &ttend);
-
- start = isodate_from_time_t (ttstart);
- end = isodate_from_time_t (ttend);
-
- real_sexp = g_strdup_printf (
- "(and (occur-in-time-range? (make-time \"%s\")"
- " (make-time \"%s\"))"
- " %s)",
- start, end, sexp);
-
- e_cal_model_set_query (e_calendar_view_get_model (cal_view), real_sexp);
-
- g_free (start);
- g_free (end);
- g_free (real_sexp);
-}
-
-/**
- * gnome_calendar_set_query:
- * @gcal: A calendar.
- * @sexp: Sexp that defines the query.
- *
- * Sets the query sexp for all the views in a calendar.
- **/
-void
-gnome_calendar_set_query (GnomeCalendar *gcal, const char *sexp)
-{
- GnomeCalendarPrivate *priv;
- ECalModel *model;
- int i;
-
- g_return_if_fail (gcal != NULL);
- g_return_if_fail (GNOME_IS_CALENDAR (gcal));
- g_return_if_fail (sexp != NULL);
-
- priv = gcal->priv;
-
- /* Set the query on the date navigator */
-
- if (priv->sexp)
- g_free (priv->sexp);
-
- priv->sexp = g_strdup (sexp);
-
- update_query (gcal);
-
- /* Set the query on the views */
- for (i = 0; i < GNOME_CAL_LAST_VIEW; i++)
- adjust_e_cal_view_for_view (E_CALENDAR_VIEW (priv->views[i]), sexp);
-
- /* Set the query on the task pad */
- model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->todo));
- e_cal_model_set_query (model, sexp);
-}
-
-/* Returns the current time, for the ECalendarItem. */
-static struct tm
-get_current_time (ECalendarItem *calitem, gpointer data)
-{
- GnomeCalendar *cal = data;
- struct tm tmp_tm = { 0 };
- struct icaltimetype tt;
-
- g_return_val_if_fail (cal != NULL, tmp_tm);
- g_return_val_if_fail (GNOME_IS_CALENDAR (cal), tmp_tm);
-
- tt = icaltime_from_timet_with_zone (time (NULL), FALSE,
- cal->priv->zone);
-
- /* Now copy it to the struct tm and return it. */
- tmp_tm = icaltimetype_to_tm (&tt);
-
- return tmp_tm;
-}
-
-/* Callback used when the sexp changes in the calendar search bar */
-static void
-search_bar_sexp_changed_cb (CalSearchBar *cal_search, const char *sexp, gpointer data)
-{
- GnomeCalendar *gcal;
-
- gcal = GNOME_CALENDAR (data);
- gnome_calendar_set_query (gcal, sexp);
-}
-
-/* Callback used when the selected category in the search bar changes */
-static void
-search_bar_category_changed_cb (CalSearchBar *cal_search, const char *category, gpointer data)
-{
- GnomeCalendar *gcal;
- GnomeCalendarPrivate *priv;
- ECalModel *model;
- int i;
-
- gcal = GNOME_CALENDAR (data);
- priv = gcal->priv;
-
- for (i = 0; i < GNOME_CAL_LAST_VIEW; i++) {
- e_calendar_view_set_default_category (E_CALENDAR_VIEW (priv->views[i]),
- category);
- }
-
- model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->todo));
- e_cal_model_set_default_category (model, category);
-}
-
-static void
-view_selection_changed_cb (GtkWidget *view, GnomeCalendar *gcal)
-{
- gtk_signal_emit (GTK_OBJECT (gcal),
- gnome_calendar_signals[CALENDAR_SELECTION_CHANGED]);
-}
-
-
-/* Callback used when the taskpad receives a focus event. We emit the
- * corresponding signal so that parents can change the menus as appropriate.
- */
-static gint
-table_canvas_focus_change_cb (GtkWidget *widget, GdkEventFocus *event, gpointer data)
-{
- GnomeCalendar *gcal;
-
- gcal = GNOME_CALENDAR (data);
-
- gtk_signal_emit (GTK_OBJECT (gcal), gnome_calendar_signals [TASKPAD_FOCUS_CHANGE],
- event->in ? TRUE : FALSE);
-
- return FALSE;
-}
-
-static gint
-calendar_focus_change_cb (GtkWidget *widget, GdkEventFocus *event, gpointer data)
-{
- GnomeCalendar *gcal;
-
- gcal = GNOME_CALENDAR (data);
-
- gtk_signal_emit (GTK_OBJECT (gcal), gnome_calendar_signals [CALENDAR_FOCUS_CHANGE],
- event->in ? TRUE : FALSE);
-
- return FALSE;
-}
-
-/* Connects to the focus change signals of a day view widget */
-static void
-connect_day_view_focus (GnomeCalendar *gcal, EDayView *dv)
-{
- g_signal_connect (dv->top_canvas, "focus_in_event",
- G_CALLBACK (calendar_focus_change_cb), gcal);
- g_signal_connect (dv->top_canvas, "focus_out_event",
- G_CALLBACK (calendar_focus_change_cb), gcal);
-
- g_signal_connect (dv->main_canvas, "focus_in_event",
- G_CALLBACK (calendar_focus_change_cb), gcal);
- g_signal_connect (dv->main_canvas, "focus_out_event",
- G_CALLBACK (calendar_focus_change_cb), gcal);
-}
-
-/* Connects to the focus change signals of a week view widget */
-static void
-connect_week_view_focus (GnomeCalendar *gcal, EWeekView *wv)
-{
- g_signal_connect (wv->main_canvas, "focus_in_event",
- G_CALLBACK (calendar_focus_change_cb), gcal);
- g_signal_connect (wv->main_canvas, "focus_out_event",
- G_CALLBACK (calendar_focus_change_cb), gcal);
-}
-
-static void
-connect_list_view_focus (GnomeCalendar *gcal, ECalListView *lv)
-{
- g_signal_connect (lv, "focus_in_event",
- G_CALLBACK (calendar_focus_change_cb), gcal);
- g_signal_connect (lv, "focus_out_event",
- G_CALLBACK (calendar_focus_change_cb), gcal);
-}
-
-/* Callback used when the selection in the taskpad table changes. We just proxy
- * the signal with our own one.
- */
-static void
-table_selection_change_cb (ETable *etable, gpointer data)
-{
- GnomeCalendar *gcal;
- int n_selected;
-
- gcal = GNOME_CALENDAR (data);
-
- n_selected = e_table_selected_count (etable);
- gtk_signal_emit (GTK_OBJECT (gcal), gnome_calendar_signals[TASKPAD_SELECTION_CHANGED]);
-}
-
-static void
-set_timezone (GnomeCalendar *calendar)
-{
- GnomeCalendarPrivate *priv;
- char *location;
- GList *l;
-
- priv = calendar->priv;
-
- location = calendar_config_get_timezone ();
- priv->zone = icaltimezone_get_builtin_timezone (location);
- g_free (location);
-
- if (!priv->zone)
- priv->zone = icaltimezone_get_utc_timezone ();
-
- for (l = priv->clients_list; l != NULL; l = l->next) {
- ECal *client = l->data;
-
- if (e_cal_get_load_state (client) == E_CAL_LOAD_LOADED)
- /* FIXME Error checking */
- e_cal_set_default_timezone (client, priv->zone, NULL);
- }
-
- if (priv->task_pad_client
- && e_cal_get_load_state (priv->task_pad_client) == E_CAL_LOAD_LOADED) {
- /* FIXME Error Checking */
- e_cal_set_default_timezone (priv->task_pad_client,
- priv->zone, NULL);
- }
-}
-
-static void
-timezone_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
-{
- GnomeCalendar *calendar = data;
-
- set_timezone (calendar);
-}
-
-static void
-setup_config (GnomeCalendar *calendar)
-{
- GnomeCalendarPrivate *priv;
- guint not;
-
- priv = calendar->priv;
-
- /* Timezone */
- set_timezone (calendar);
-
- not = calendar_config_add_notification_timezone (timezone_changed_cb, calendar);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
-
- /* Pane positions */
- priv->hpane_pos = calendar_config_get_hpane_pos ();
- priv->vpane_pos = calendar_config_get_vpane_pos ();
- priv->hpane_pos_month_view = calendar_config_get_month_hpane_pos ();
- priv->vpane_pos_month_view = calendar_config_get_month_vpane_pos ();
-}
-
-static void
-setup_widgets (GnomeCalendar *gcal)
-{
- GnomeCalendarPrivate *priv;
- GtkWidget *w;
- gchar *filename;
- ETable *etable;
- int i;
-
- priv = gcal->priv;
-
- priv->search_bar = cal_search_bar_new ();
- g_signal_connect (priv->search_bar, "sexp_changed",
- G_CALLBACK (search_bar_sexp_changed_cb), gcal);
- g_signal_connect (priv->search_bar, "category_changed",
- G_CALLBACK (search_bar_category_changed_cb), gcal);
-
- gtk_widget_show (priv->search_bar);
- gtk_box_pack_start (GTK_BOX (gcal), priv->search_bar, FALSE, FALSE, 6);
-
- /* The main HPaned, with the notebook of calendar views on the left
- and the ECalendar and ToDo list on the right. */
- priv->hpane = gtk_hpaned_new ();
- g_signal_connect_after(priv->hpane, "realize",
- G_CALLBACK(gnome_calendar_hpane_realized), gcal);
- g_signal_connect (priv->hpane, "button_release_event",
- G_CALLBACK (gnome_calendar_hpane_resized), gcal);
- gtk_widget_show (priv->hpane);
- gtk_box_pack_start (GTK_BOX (gcal), priv->hpane, TRUE, TRUE, 6);
-
- /* The Notebook containing the 4 calendar views. */
- priv->notebook = gtk_notebook_new ();
- gtk_notebook_set_show_border (GTK_NOTEBOOK (priv->notebook), FALSE);
- gtk_notebook_set_show_tabs (GTK_NOTEBOOK (priv->notebook), FALSE);
- gtk_widget_show (priv->notebook);
- gtk_paned_pack1 (GTK_PANED (priv->hpane), priv->notebook, FALSE, TRUE);
-
- /* The VPaned widget, to contain the GtkCalendar & ToDo list. */
- priv->vpane = gtk_vpaned_new ();
- g_signal_connect_after (priv->vpane, "realize",
- G_CALLBACK(gnome_calendar_vpane_realized), gcal);
- g_signal_connect (priv->vpane, "button_release_event",
- G_CALLBACK (gnome_calendar_vpane_resized), gcal);
- gtk_widget_show (priv->vpane);
- gtk_paned_pack2 (GTK_PANED (priv->hpane), priv->vpane, TRUE, TRUE);
-
- /* The ECalendar. */
- w = e_calendar_new ();
- priv->date_navigator = E_CALENDAR (w);
- priv->date_navigator_config = e_mini_calendar_config_new (priv->date_navigator);
- e_calendar_item_set_days_start_week_sel (priv->date_navigator->calitem, 9);
- e_calendar_item_set_max_days_sel (priv->date_navigator->calitem, 42);
- gtk_widget_show (w);
- e_calendar_item_set_get_time_callback (priv->date_navigator->calitem,
- (ECalendarItemGetTimeCallback) get_current_time,
- gcal, NULL);
-
- gtk_paned_pack1 (GTK_PANED (priv->vpane), w, FALSE, TRUE);
-
- g_signal_connect (priv->date_navigator->calitem, "selection_changed",
- G_CALLBACK (gnome_calendar_on_date_navigator_selection_changed), gcal);
- g_signal_connect (priv->date_navigator->calitem, "date_range_changed",
- G_CALLBACK (gnome_calendar_on_date_navigator_date_range_changed), gcal);
-
- /* The ToDo list. */
- priv->todo = e_calendar_table_new ();
- priv->todo_config = e_calendar_table_config_new (E_CALENDAR_TABLE (priv->todo));
- gtk_paned_pack2 (GTK_PANED (priv->vpane), priv->todo, TRUE, TRUE);
- gtk_widget_show (priv->todo);
-
- filename = g_build_filename (calendar_component_peek_config_directory (calendar_component_peek ()),
- "TaskPad", NULL);
- e_calendar_table_load_state (E_CALENDAR_TABLE (priv->todo), filename);
- g_free (filename);
-
- etable = e_calendar_table_get_table (E_CALENDAR_TABLE (priv->todo));
- g_signal_connect (etable->table_canvas, "focus_in_event",
- G_CALLBACK (table_canvas_focus_change_cb), gcal);
- g_signal_connect (etable->table_canvas, "focus_out_event",
- G_CALLBACK (table_canvas_focus_change_cb), gcal);
-
- g_signal_connect (etable, "selection_change",
- G_CALLBACK (table_selection_change_cb), gcal);
-
- /* The Day View. */
- priv->day_view = e_day_view_new ();
- g_signal_connect (priv->day_view, "selection_changed",
- G_CALLBACK (view_selection_changed_cb), gcal);
-
- connect_day_view_focus (gcal, E_DAY_VIEW (priv->day_view));
-
- /* The Work Week View. */
- priv->work_week_view = e_day_view_new ();
- e_day_view_set_work_week_view (E_DAY_VIEW (priv->work_week_view),
- TRUE);
- e_day_view_set_days_shown (E_DAY_VIEW (priv->work_week_view), 5);
- e_calendar_view_set_calendar (E_CALENDAR_VIEW (priv->work_week_view), gcal);
-
- connect_day_view_focus (gcal, E_DAY_VIEW (priv->work_week_view));
-
- /* The Week View. */
- priv->week_view = e_week_view_new ();
- e_calendar_view_set_calendar (E_CALENDAR_VIEW (priv->week_view), gcal);
- g_signal_connect (priv->week_view, "selection_changed",
- G_CALLBACK (view_selection_changed_cb), gcal);
-
- connect_week_view_focus (gcal, E_WEEK_VIEW (priv->week_view));
-
- /* The Month View. */
- priv->month_view = e_week_view_new ();
- e_calendar_view_set_calendar (E_CALENDAR_VIEW (priv->month_view), gcal);
- e_week_view_set_multi_week_view (E_WEEK_VIEW (priv->month_view), TRUE);
- g_signal_connect (priv->month_view, "selection_changed",
- G_CALLBACK (view_selection_changed_cb), gcal);
-
- connect_week_view_focus (gcal, E_WEEK_VIEW (priv->month_view));
-
- /* The List View. */
- filename = g_strdup_printf (".evolution/config/CalListView");
- priv->list_view = e_cal_list_view_new (filename);
- g_free (filename);
-
- e_calendar_view_set_calendar (E_CALENDAR_VIEW (priv->list_view), gcal);
-
- connect_list_view_focus (gcal, E_CAL_LIST_VIEW (priv->list_view));
-
- priv->views[GNOME_CAL_DAY_VIEW] = E_CALENDAR_VIEW (priv->day_view);
- priv->configs[GNOME_CAL_DAY_VIEW] = e_day_view_config_new (E_DAY_VIEW (priv->views[GNOME_CAL_DAY_VIEW]));
- priv->views[GNOME_CAL_WORK_WEEK_VIEW] = E_CALENDAR_VIEW (priv->work_week_view);
- priv->configs[GNOME_CAL_WORK_WEEK_VIEW] = e_day_view_config_new (E_DAY_VIEW (priv->views[GNOME_CAL_WORK_WEEK_VIEW]));
- priv->views[GNOME_CAL_WEEK_VIEW] = E_CALENDAR_VIEW (priv->week_view);
- priv->configs[GNOME_CAL_WEEK_VIEW] = e_week_view_config_new (E_WEEK_VIEW (priv->views[GNOME_CAL_WEEK_VIEW]));
- priv->views[GNOME_CAL_MONTH_VIEW] = E_CALENDAR_VIEW (priv->month_view);
- priv->configs[GNOME_CAL_MONTH_VIEW] = e_week_view_config_new (E_WEEK_VIEW (priv->views[GNOME_CAL_MONTH_VIEW]));
- priv->views[GNOME_CAL_LIST_VIEW] = E_CALENDAR_VIEW (priv->list_view);
- priv->configs[GNOME_CAL_MONTH_VIEW] = e_cal_list_view_config_new (E_CAL_LIST_VIEW (priv->views[GNOME_CAL_LIST_VIEW]));
- priv->configs[GNOME_CAL_LIST_VIEW] = NULL;
-
- for (i = 0; i < GNOME_CAL_LAST_VIEW; i++) {
- gtk_notebook_append_page (GTK_NOTEBOOK (priv->notebook),
- GTK_WIDGET (priv->views[i]), gtk_label_new (""));
-
- gtk_widget_show (GTK_WIDGET (priv->views[i]));
- }
-}
-
-/* Object initialization function for the gnome calendar */
-static void
-gnome_calendar_init (GnomeCalendar *gcal)
-{
- GnomeCalendarPrivate *priv;
-
- priv = g_new0 (GnomeCalendarPrivate, 1);
- gcal->priv = priv;
-
- priv->clients = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref);
-
- priv->cal_categories = NULL;
- priv->tasks_categories = NULL;
-
- priv->current_view_type = GNOME_CAL_DAY_VIEW;
- priv->range_selected = FALSE;
-
- setup_config (gcal);
- setup_widgets (gcal);
-
- priv->dn_queries = NULL;
- priv->sexp = g_strdup ("#t"); /* Match all */
-
- priv->selection_start_time = time_day_begin_with_zone (time (NULL),
- priv->zone);
- priv->selection_end_time = time_add_day_with_zone (priv->selection_start_time, 1, priv->zone);
-
- priv->view_instance = NULL;
- priv->view_menus = NULL;
-
- priv->visible_start = -1;
- priv->visible_end = -1;
-}
-
-/* Frees a set of categories */
-static void
-free_categories (GPtrArray *categories)
-{
- int i;
-
- if (!categories)
- return;
-
- for (i = 0; i < categories->len; i++)
- g_free (categories->pdata[i]);
-
- g_ptr_array_free (categories, TRUE);
-}
-
-static void
-gnome_calendar_destroy (GtkObject *object)
-{
- GnomeCalendar *gcal;
- GnomeCalendarPrivate *priv;
- gchar *filename;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (GNOME_IS_CALENDAR (object));
-
- gcal = GNOME_CALENDAR (object);
- priv = gcal->priv;
-
- if (priv) {
- GList *l;
- int i;
-
- /* disconnect from signals on all the clients */
- for (l = priv->clients_list; l != NULL; l = l->next) {
- g_signal_handlers_disconnect_matched (l->data, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, gcal);
- }
-
- g_hash_table_destroy (priv->clients);
- g_list_free (priv->clients_list);
-
- free_categories (priv->cal_categories);
- priv->cal_categories = NULL;
-
- free_categories (priv->tasks_categories);
- priv->tasks_categories = NULL;
-
- for (i = 0; i < GNOME_CAL_LAST_VIEW; i++) {
- if (priv->configs[i])
- g_object_unref (priv->configs[i]);
- priv->configs[i] = NULL;
- }
- g_object_unref (priv->date_navigator_config);
- g_object_unref (priv->todo_config);
-
- for (l = priv->notifications; l; l = l->next)
- calendar_config_remove_notification (GPOINTER_TO_UINT (l->data));
- g_list_free (priv->notifications);
- priv->notifications = NULL;
-
- /* Save the TaskPad layout. */
- filename = g_build_filename (calendar_component_peek_config_directory (calendar_component_peek ()),
- "TaskPad", NULL);
- e_calendar_table_save_state (E_CALENDAR_TABLE (priv->todo), filename);
- g_free (filename);
-
- if (priv->dn_queries) {
- for (l = priv->dn_queries; l != NULL; l = l->next) {
- g_signal_handlers_disconnect_matched ((ECalView *) l->data, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, gcal);
- g_object_unref (l->data);
- }
-
- g_list_free (priv->dn_queries);
- priv->dn_queries = NULL;
- }
-
- if (priv->sexp) {
- g_free (priv->sexp);
- priv->sexp = NULL;
- }
-
- if (priv->e_cal_view_timeout) {
- g_source_remove (priv->e_cal_view_timeout);
- priv->e_cal_view_timeout = 0;
- }
-
- if (priv->task_pad_client) {
- g_signal_handlers_disconnect_matched (priv->task_pad_client, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, gcal);
- g_object_unref (priv->task_pad_client);
- priv->task_pad_client = NULL;
- }
-
- if (priv->view_instance) {
- g_object_unref (priv->view_instance);
- priv->view_instance = NULL;
- }
-
- if (priv->view_menus) {
- g_object_unref (priv->view_menus);
- priv->view_menus = NULL;
- }
-
- g_free (priv);
- gcal->priv = NULL;
- }
-
- if (GTK_OBJECT_CLASS (parent_class)->destroy)
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
-}
-
-static void
-gnome_calendar_goto_date (GnomeCalendar *gcal,
- GnomeCalendarGotoDateType goto_date)
-{
- GnomeCalendarPrivate *priv;
- time_t start_time;
- time_t end_time;
- gboolean need_updating = FALSE;
-
- g_return_if_fail (gcal != NULL);
- g_return_if_fail (GNOME_IS_CALENDAR(gcal));
-
- priv = gcal->priv;
-
- gnome_calendar_get_current_time_range (gcal, &start_time, &end_time);
-
- switch (goto_date) {
- /* GNOME_CAL_GOTO_TODAY and GNOME_CAL_GOTO_DATE are
- currently not used
- */
- case GNOME_CAL_GOTO_TODAY:
- break;
- case GNOME_CAL_GOTO_DATE:
- break;
- case GNOME_CAL_GOTO_FIRST_DAY_OF_MONTH:
- priv->selection_start_time =
- time_month_begin_with_zone (start_time, priv->zone);
- priv->selection_end_time =
- time_add_day_with_zone (priv->selection_start_time,
- 1, priv->zone);
- need_updating = TRUE;
- break;
- case GNOME_CAL_GOTO_LAST_DAY_OF_MONTH:
- start_time = time_add_month_with_zone (start_time, 1,
- priv->zone);
- priv->selection_end_time =
- time_month_begin_with_zone (start_time, priv->zone);
- priv->selection_start_time =
- time_add_day_with_zone (priv->selection_end_time,
- -1, priv->zone);
- need_updating = TRUE;
- break;
- case GNOME_CAL_GOTO_FIRST_DAY_OF_WEEK:
- /* 1 for Monday */
- priv->selection_start_time =
- time_week_begin_with_zone (start_time, 1, priv->zone);
- priv->selection_end_time =
- time_add_day_with_zone (priv->selection_start_time,
- 1, priv->zone);
- need_updating = TRUE;
- break;
- case GNOME_CAL_GOTO_LAST_DAY_OF_WEEK:
- /* 1 for Monday */
- start_time = time_week_begin_with_zone (start_time, 1,
- priv->zone);
- if (priv->current_view_type == GNOME_CAL_DAY_VIEW ||
- priv->current_view_type == GNOME_CAL_WORK_WEEK_VIEW) {
- /* goto Friday of this week */
- priv->selection_start_time =
- time_add_day_with_zone (start_time,
- 4, priv->zone);
- }
- else {
- /* goto Sunday of this week */
- priv->selection_start_time =
- time_add_day_with_zone (start_time,
- 6, priv->zone);
- }
- priv->selection_end_time =
- time_add_day_with_zone (priv->selection_start_time,
- 1, priv->zone);
- need_updating = TRUE;
- break;
- case GNOME_CAL_GOTO_SAME_DAY_OF_PREVIOUS_WEEK:
- priv->selection_start_time = time_add_day_with_zone (start_time,
- -7, priv->zone);
- priv->selection_end_time = time_add_day_with_zone (end_time,
- -7,priv->zone);
- need_updating = TRUE;
- break;
- case GNOME_CAL_GOTO_SAME_DAY_OF_NEXT_WEEK:
- priv->selection_start_time = time_add_day_with_zone (start_time,
- 7, priv->zone);
- priv->selection_end_time = time_add_day_with_zone (end_time,
- 7,priv->zone);
- need_updating = TRUE;
- break;
-
- default:
- break;
- }
-
- if (need_updating) {
- gnome_calendar_update_view_times (gcal);
- gnome_calendar_update_date_navigator (gcal);
- gnome_calendar_notify_dates_shown_changed (gcal);
- }
-}
-
-void
-gnome_calendar_goto (GnomeCalendar *gcal, time_t new_time)
-{
- GnomeCalendarPrivate *priv;
-
- g_return_if_fail (gcal != NULL);
- g_return_if_fail (GNOME_IS_CALENDAR (gcal));
- g_return_if_fail (new_time != -1);
-
- priv = gcal->priv;
-
- priv->selection_start_time = time_day_begin_with_zone (new_time,
- priv->zone);
- priv->selection_end_time = time_add_day_with_zone (priv->selection_start_time, 1, priv->zone);
-
- gnome_calendar_update_view_times (gcal);
- gnome_calendar_update_date_navigator (gcal);
- gnome_calendar_notify_dates_shown_changed (gcal);
-}
-
-
-static void
-gnome_calendar_update_view_times (GnomeCalendar *gcal)
-{
- GnomeCalendarPrivate *priv;
-
- priv = gcal->priv;
-
- e_calendar_view_set_selected_time_range (E_CALENDAR_VIEW (gnome_calendar_get_current_view_widget (gcal)),
- priv->selection_start_time,
- priv->selection_end_time);
-}
-
-static void
-gnome_calendar_direction (GnomeCalendar *gcal, int direction)
-{
- GnomeCalendarPrivate *priv;
- time_t start_time, end_time;
-
- priv = gcal->priv;
-
- start_time = priv->selection_start_time;
- end_time = priv->selection_end_time;
-
- switch (priv->current_view_type) {
- case GNOME_CAL_DAY_VIEW:
- start_time = time_add_day_with_zone (start_time, direction,
- priv->zone);
- end_time = time_add_day_with_zone (end_time, direction,
- priv->zone);
- break;
-
- case GNOME_CAL_WORK_WEEK_VIEW:
- case GNOME_CAL_WEEK_VIEW:
- start_time = time_add_week_with_zone (start_time, direction,
- priv->zone);
- end_time = time_add_week_with_zone (end_time, direction,
- priv->zone);
- break;
-
- case GNOME_CAL_LIST_VIEW:
- g_warning ("Using month view time interval for list view.");
- case GNOME_CAL_MONTH_VIEW:
- start_time = time_add_month_with_zone (start_time, direction,
- priv->zone);
- end_time = time_add_month_with_zone (end_time, direction,
- priv->zone);
- break;
-
- default:
- g_warning ("Weee! Where did the penguin go?");
- g_assert_not_reached ();
- return;
- }
-
- priv->selection_start_time = start_time;
- priv->selection_end_time = end_time;
-
- gnome_calendar_update_view_times (gcal);
- gnome_calendar_update_date_navigator (gcal);
- gnome_calendar_notify_dates_shown_changed (gcal);
-}
-
-void
-gnome_calendar_next (GnomeCalendar *gcal)
-{
- g_return_if_fail (gcal != NULL);
- g_return_if_fail (GNOME_IS_CALENDAR (gcal));
-
- gnome_calendar_direction (gcal, 1);
-}
-
-void
-gnome_calendar_previous (GnomeCalendar *gcal)
-{
- g_return_if_fail (gcal != NULL);
- g_return_if_fail (GNOME_IS_CALENDAR (gcal));
-
- gnome_calendar_direction (gcal, -1);
-}
-
-void
-gnome_calendar_dayjump (GnomeCalendar *gcal, time_t time)
-{
- GnomeCalendarPrivate *priv;
-
- g_return_if_fail (gcal != NULL);
- g_return_if_fail (GNOME_IS_CALENDAR (gcal));
-
- priv = gcal->priv;
-
- priv->selection_start_time = time_day_begin_with_zone (time,
- priv->zone);
- priv->selection_end_time = time_add_day_with_zone (priv->selection_start_time, 1, priv->zone);
-
- gnome_calendar_set_view (gcal, GNOME_CAL_DAY_VIEW, FALSE, TRUE);
-}
-
-static void
-focus_current_view (GnomeCalendar *gcal)
-{
- GnomeCalendarPrivate *priv;
-
- priv = gcal->priv;
-
- gtk_widget_grab_focus (gnome_calendar_get_current_view_widget (gcal));
-}
-
-void
-gnome_calendar_goto_today (GnomeCalendar *gcal)
-{
- g_return_if_fail (gcal != NULL);
- g_return_if_fail (GNOME_IS_CALENDAR (gcal));
-
- gnome_calendar_goto (gcal, time (NULL));
- focus_current_view (gcal);
-}
-
-/**
- * gnome_calendar_get_view:
- * @gcal: A calendar.
- *
- * Queries the type of the view that is being shown in a calendar.
- *
- * Return value: Type of the view that is currently shown.
- **/
-GnomeCalendarViewType
-gnome_calendar_get_view (GnomeCalendar *gcal)
-{
- GnomeCalendarPrivate *priv;
-
- g_return_val_if_fail (gcal != NULL, GNOME_CAL_DAY_VIEW);
- g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), GNOME_CAL_DAY_VIEW);
-
- priv = gcal->priv;
- return priv->current_view_type;
-}
-
-/* Sets the view without changing the selection or updating the date
- * navigator. If a range of dates isn't selected it will also reset the number
- * of days/weeks shown to the default (i.e. 1 day for the day view or 5 weeks
- * for the month view).
- */
-static void
-set_view (GnomeCalendar *gcal, GnomeCalendarViewType view_type,
- gboolean range_selected, gboolean grab_focus)
-{
- GnomeCalendarPrivate *priv;
- gboolean round_selection;
- const char *view_id;
- static gboolean updating = FALSE;
-
- if (updating)
- return;
-
- priv = gcal->priv;
-
- round_selection = FALSE;
-
- switch (view_type) {
- case GNOME_CAL_DAY_VIEW:
- view_id = "Day_View";
-
- if (!range_selected)
- e_day_view_set_days_shown (E_DAY_VIEW (priv->day_view), 1);
-
- break;
-
- case GNOME_CAL_WORK_WEEK_VIEW:
- view_id = "Work_Week_View";
- break;
-
- case GNOME_CAL_WEEK_VIEW:
- view_id = "Week_View";
- round_selection = TRUE;
- break;
-
- case GNOME_CAL_MONTH_VIEW:
- view_id = "Month_View";
-
- if (!range_selected)
- e_week_view_set_weeks_shown (E_WEEK_VIEW (priv->month_view), 5);
-
- round_selection = TRUE;
- break;
-
- case GNOME_CAL_LIST_VIEW:
- view_id = "List_View";
- break;
-
- default:
- g_warning ("A penguin is loose!");
- g_assert_not_reached ();
- return;
- }
-
- priv->current_view_type = view_type;
- priv->range_selected = range_selected;
-
- calendar_config_set_default_view (view_type);
-
- updating = TRUE;
- gtk_notebook_set_page (GTK_NOTEBOOK (priv->notebook), (int) view_type);
- if (priv->view_instance)
- gal_view_instance_set_current_view_id (priv->view_instance, view_id);
- updating = FALSE;
-
- if (grab_focus)
- gtk_widget_grab_focus (GTK_WIDGET (priv->views[view_type]));
-
- gnome_calendar_set_pane_positions (gcal);
-
- /* For the week & month views we want the selection in the date
- navigator to be rounded to the nearest week when the arrow buttons
- are pressed to move to the previous/next month. */
- g_object_set (G_OBJECT (priv->date_navigator->calitem),
- "round_selection_when_moving", round_selection,
- NULL);
-}
-
-/**
- * gnome_calendar_set_view:
- * @gcal: A calendar.
- * @view_type: Type of view to show.
- * @range_selected: If false, the range of days/weeks shown will be reset to the
- * default value (1 for day view, 5 for week view, respectively). If true, the
- * currently displayed range will be kept.
- * @grab_focus: Whether the view widget should grab the focus.
- *
- * Sets the view that should be shown in a calendar. If @reset_range is true,
- * this function will automatically set the number of days or weeks shown in
- * the view; otherwise the last configuration will be kept.
- **/
-void
-gnome_calendar_set_view (GnomeCalendar *gcal, GnomeCalendarViewType view_type,
- gboolean range_selected, gboolean grab_focus)
-{
- g_return_if_fail (gcal != NULL);
- g_return_if_fail (GNOME_IS_CALENDAR (gcal));
-
- set_view (gcal, view_type, range_selected, grab_focus);
- gnome_calendar_update_view_times (gcal);
- gnome_calendar_update_date_navigator (gcal);
- gnome_calendar_notify_dates_shown_changed (gcal);
-}
-
-/* Callback used when the view collection asks us to display a particular view */
-static void
-display_view_cb (GalViewInstance *view_instance, GalView *view, gpointer data)
-{
- GnomeCalendar *gcal;
- CalendarView *cal_view;
-
- gcal = GNOME_CALENDAR (data);
-
- if (!IS_CALENDAR_VIEW (view))
- g_error ("display_view_cb(): Unknown type of view for GnomeCalendar");
-
- cal_view = CALENDAR_VIEW (view);
-
- gnome_calendar_set_view (gcal, calendar_view_get_view_type (cal_view), FALSE, TRUE);
-}
-
-/**
- * gnome_calendar_setup_view_menus:
- * @gcal: A calendar.
- * @uic: UI controller to use for the menus.
- *
- * Sets up the #GalView menus for a calendar. This function should be called
- * from the Bonobo control activation callback for this calendar. Also, the
- * menus should be discarded using gnome_calendar_discard_view_menus().
- **/
-void
-gnome_calendar_setup_view_menus (GnomeCalendar *gcal, BonoboUIComponent *uic)
-{
- GnomeCalendarPrivate *priv;
- char *path;
- CalendarViewFactory *factory;
- static GalViewCollection *collection = NULL;
-
- g_return_if_fail (gcal != NULL);
- g_return_if_fail (GNOME_IS_CALENDAR (gcal));
- g_return_if_fail (uic != NULL);
- g_return_if_fail (BONOBO_IS_UI_COMPONENT (uic));
-
- priv = gcal->priv;
-
- g_return_if_fail (priv->view_instance == NULL);
-
- g_assert (priv->view_instance == NULL);
- g_assert (priv->view_menus == NULL);
-
- /* Create the view instance */
-
- if (collection == NULL) {
- collection = gal_view_collection_new ();
-
- gal_view_collection_set_title (collection, _("Calendar"));
-
- path = gnome_util_prepend_user_home ("/evolution/views/calendar/");
- gal_view_collection_set_storage_directories (collection,
- EVOLUTION_GALVIEWSDIR "/calendar/",
- path);
- g_free (path);
-
- /* Create the views */
-
- factory = calendar_view_factory_new (GNOME_CAL_DAY_VIEW);
- gal_view_collection_add_factory (collection, GAL_VIEW_FACTORY (factory));
- g_object_unref (factory);
-
- factory = calendar_view_factory_new (GNOME_CAL_WORK_WEEK_VIEW);
- gal_view_collection_add_factory (collection, GAL_VIEW_FACTORY (factory));
- g_object_unref (factory);
-
- factory = calendar_view_factory_new (GNOME_CAL_WEEK_VIEW);
- gal_view_collection_add_factory (collection, GAL_VIEW_FACTORY (factory));
- g_object_unref (factory);
-
- factory = calendar_view_factory_new (GNOME_CAL_MONTH_VIEW);
- gal_view_collection_add_factory (collection, GAL_VIEW_FACTORY (factory));
- g_object_unref (factory);
-
- factory = calendar_view_factory_new (GNOME_CAL_LIST_VIEW);
- gal_view_collection_add_factory (collection, GAL_VIEW_FACTORY (factory));
- g_object_unref (factory);
-
- /* Load the collection and create the menus */
-
- gal_view_collection_load (collection);
- }
-
- priv->view_instance = gal_view_instance_new (collection,
- e_cal_get_uri (gnome_calendar_get_default_client (gcal)));
-
- priv->view_menus = gal_view_menus_new (priv->view_instance);
- gal_view_menus_set_show_define_views (priv->view_menus, FALSE);
- gal_view_menus_apply (priv->view_menus, uic, NULL);
- gnome_calendar_set_view (gcal, priv->current_view_type, TRUE, FALSE);
-
- g_signal_connect (priv->view_instance, "display_view",
- G_CALLBACK (display_view_cb), gcal);
- display_view_cb (priv->view_instance, gal_view_instance_get_current_view (priv->view_instance), gcal);
-}
-
-/**
- * gnome_calendar_discard_view_menus:
- * @gcal: A calendar.
- *
- * Discards the #GalView menus used by a calendar. This function should be
- * called from the Bonobo control deactivation callback for this calendar. The
- * menus should have been set up with gnome_calendar_setup_view_menus().
- **/
-void
-gnome_calendar_discard_view_menus (GnomeCalendar *gcal)
-{
- GnomeCalendarPrivate *priv;
-
- g_return_if_fail (gcal != NULL);
-
- priv = gcal->priv;
-
- g_return_if_fail (priv->view_instance != NULL);
-
- g_assert (priv->view_instance != NULL);
- g_assert (priv->view_menus != NULL);
-
- g_object_unref (priv->view_instance);
- priv->view_instance = NULL;
-
- g_object_unref (priv->view_menus);
- priv->view_menus = NULL;
-}
-
-EPopupMenu *
-gnome_calendar_setup_view_popup (GnomeCalendar *gcal)
-{
- GnomeCalendarPrivate *priv;
-
- g_return_val_if_fail (gcal != NULL, NULL);
- g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), NULL);
-
- priv = gcal->priv;
-
- g_return_val_if_fail (priv->view_instance != NULL, NULL);
-
- return gal_view_instance_get_popup_menu (priv->view_instance);
-}
-
-void
-gnome_calendar_discard_view_popup (GnomeCalendar *gcal, EPopupMenu *popup)
-{
-
-
- GnomeCalendarPrivate *priv;
-
- g_return_if_fail (gcal != NULL);
- g_return_if_fail (GNOME_IS_CALENDAR (gcal));
-
- priv = gcal->priv;
-
- g_return_if_fail (priv->view_instance != NULL);
-
- gal_view_instance_free_popup_menu (priv->view_instance, popup);
-}
-
-static void
-gnome_calendar_set_pane_positions (GnomeCalendar *gcal)
-{
- GnomeCalendarPrivate *priv;
-
- priv = gcal->priv;
-
- if (priv->current_view_type == GNOME_CAL_MONTH_VIEW && !priv->range_selected) {
- gtk_paned_set_position (GTK_PANED (priv->hpane), priv->hpane_pos_month_view);
- gtk_paned_set_position (GTK_PANED (priv->vpane), priv->vpane_pos_month_view);
- } else {
- gtk_paned_set_position (GTK_PANED (priv->hpane), priv->hpane_pos);
- gtk_paned_set_position (GTK_PANED (priv->vpane), priv->vpane_pos);
- }
-}
-
-/* Displays an error to indicate that opening a calendar failed */
-static void
-open_error (GnomeCalendar *gcal, const char *uri)
-{
- char *msg;
- char *urinopwd;
-
- urinopwd = get_uri_without_password (uri);
- msg = g_strdup_printf (_("Could not open the folder in `%s'"), urinopwd);
- gnome_error_dialog_parented (msg, GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gcal))));
- g_free (msg);
- g_free (urinopwd);
-}
-
-/* Displays an error to indicate that the specified URI method is not supported */
-static void
-method_error (GnomeCalendar *gcal, const char *uri)
-{
- char *msg;
- char *urinopwd;
-
- urinopwd = get_uri_without_password (uri);
- msg = g_strdup_printf (_("The method required to open `%s' is not supported"), urinopwd);
- gnome_error_dialog_parented (msg, GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gcal))));
- g_free (msg);
- g_free (urinopwd);
-}
-
-/* Displays an error to indicate permission problems */
-static void
-permission_error (GnomeCalendar *gcal, const char *uri)
-{
- char *msg;
- char *urinopwd;
-
- urinopwd = get_uri_without_password (uri);
- msg = g_strdup_printf (_("You don't have permission to open the folder in `%s'"), urinopwd);
- gnome_error_dialog_parented (msg, GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gcal))));
- g_free (msg);
- g_free (urinopwd);
-}
-
-/* Callback from the calendar client when a calendar is loaded */
-static gboolean
-update_e_cal_view_timeout (gpointer data)
-{
- GnomeCalendar *gcal = data;
- GnomeCalendarPrivate *priv;
-
- gcal = GNOME_CALENDAR (data);
- priv = gcal->priv;
-
- update_query (gcal);
- priv->e_cal_view_timeout = 0;
-
- return FALSE;
-}
-
-static void
-client_cal_opened_cb (ECal *client, ECalendarStatus status, gpointer data)
-{
- GnomeCalendar *gcal;
- GnomeCalendarPrivate *priv;
- char *msg;
- char *uristr;
-
- gcal = GNOME_CALENDAR (data);
- priv = gcal->priv;
-
- switch (status) {
- case E_CALENDAR_STATUS_OK:
- /* Set the client's default timezone, if we have one. */
- if (priv->zone) {
- /* FIXME Error checking */
- e_cal_set_default_timezone (client, priv->zone, NULL);
- }
-
- /* add the alarms for this client */
- uristr = get_uri_without_password (e_cal_get_uri (client));
- msg = g_strdup_printf (_("Adding alarms for %s"), uristr);
- g_free (uristr);
- if (client == priv->task_pad_client) {
- e_calendar_table_set_status_message (E_CALENDAR_TABLE (priv->todo), msg);
- e_cal_model_add_client (e_calendar_table_get_model (E_CALENDAR_TABLE (priv->todo)),
- priv->task_pad_client);
- }
- else {
- e_calendar_view_set_status_message (E_CALENDAR_VIEW (priv->week_view), msg);
- e_cal_model_add_client (e_calendar_view_get_model (E_CALENDAR_VIEW (priv->week_view)), client);
-
- priv->e_cal_view_timeout = g_timeout_add (100, update_e_cal_view_timeout, gcal);
- }
- g_free (msg);
-
- break;
-
- case E_CALENDAR_STATUS_OTHER_ERROR:
- open_error (gcal, e_cal_get_uri (client));
- break;
-
- case E_CALENDAR_STATUS_NO_SUCH_CALENDAR:
- /* bullshit; we did not specify only_if_exists */
- g_assert_not_reached ();
- return;
-
- case E_CALENDAR_STATUS_PROTOCOL_NOT_SUPPORTED:
- method_error (gcal, e_cal_get_uri (client));
- break;
-
- case E_CALENDAR_STATUS_PERMISSION_DENIED :
- permission_error (gcal, e_cal_get_uri (client));
- break;
-
- default:
- g_assert_not_reached ();
- return;
- }
-
- if (client == priv->task_pad_client)
- e_calendar_table_set_status_message (E_CALENDAR_TABLE (priv->todo), NULL);
- else
- e_calendar_view_set_status_message (E_CALENDAR_VIEW (priv->week_view), NULL);
-}
-
-/* Duplicates an array of categories */
-static GPtrArray *
-copy_categories (GPtrArray *categories)
-{
- GPtrArray *c;
- int i;
-
- c = g_ptr_array_new ();
- g_ptr_array_set_size (c, categories->len);
-
- for (i = 0; i < categories->len; i++)
- c->pdata[i] = g_strdup (categories->pdata[i]);
-
- return c;
-}
-
-/* Adds the categories from an array to a hash table if they don't exist there
- * already.
- */
-static void
-add_categories (GHashTable *categories, GPtrArray *c)
-{
- int i;
-
- if (!c)
- return;
-
- for (i = 0; i < c->len; i++) {
- const char *cat;
- const char *str;
-
- cat = c->pdata[i];
- str = g_hash_table_lookup (categories, cat);
-
- if (!str)
- g_hash_table_insert (categories, (char *) cat, NULL);
- }
-}
-
-/* Used to append categories from a hash table to an array */
-struct append_category_closure {
- GPtrArray *c;
-
- int i;
-};
-
-/* Appends a category from the hash table to the array */
-static void
-append_category_cb (gpointer key, gpointer value, gpointer data)
-{
- struct append_category_closure *closure;
- const char *category;
-
- category = key;
- closure = data;
-
- closure->c->pdata[closure->i] = g_strdup (category);
- closure->i++;
-}
-
-/* Creates the union of two sets of categories */
-static GPtrArray *
-merge_categories (GPtrArray *a, GPtrArray *b)
-{
- GHashTable *categories;
- int n;
- GPtrArray *c;
- struct append_category_closure closure;
-
- categories = g_hash_table_new (g_str_hash, g_str_equal);
-
- add_categories (categories, a);
- add_categories (categories, b);
-
- n = g_hash_table_size (categories);
-
- c = g_ptr_array_new ();
- g_ptr_array_set_size (c, n);
-
- closure.c = c;
- closure.i = 0;
- g_hash_table_foreach (categories, append_category_cb, &closure);
- g_hash_table_destroy (categories);
-
- return c;
-}
-
-/* Callback from the calendar client when the set of categories changes. We
- * have to merge the categories of the calendar and tasks clients.
- */
-static void
-client_categories_changed_cb (ECal *client, GPtrArray *categories, gpointer data)
-{
- GnomeCalendar *gcal;
- GnomeCalendarPrivate *priv;
- GPtrArray *merged;
-
- gcal = GNOME_CALENDAR (data);
- priv = gcal->priv;
-
- if (client == priv->task_pad_client) {
- free_categories (priv->tasks_categories);
- priv->tasks_categories = copy_categories (categories);
- } else {
- free_categories (priv->cal_categories);
- priv->cal_categories = copy_categories (categories);
- }
-
- merged = merge_categories (priv->cal_categories, priv->tasks_categories);
- cal_search_bar_set_categories (CAL_SEARCH_BAR (priv->search_bar), merged);
- free_categories (merged);
-}
-
-/* Callback when we get an error message from the backend */
-static void
-backend_error_cb (ECal *client, const char *message, gpointer data)
-{
- GnomeCalendar *gcal;
- GnomeCalendarPrivate *priv;
- char *errmsg;
- char *uristr;
-
- gcal = GNOME_CALENDAR (data);
- priv = gcal->priv;
-
- uristr = get_uri_without_password (e_cal_get_uri (client));
- errmsg = g_strdup_printf (_("Error on %s:\n %s"), uristr, message);
- gnome_error_dialog_parented (errmsg, GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gcal))));
- g_free (errmsg);
- g_free (uristr);
-}
-
-/* Callback when the backend dies */
-static void
-backend_died_cb (ECal *client, gpointer data)
-{
- GnomeCalendar *gcal;
- GnomeCalendarPrivate *priv;
- char *message;
- char *uristr;
-
- gcal = GNOME_CALENDAR (data);
- priv = gcal->priv;
-
- /* FIXME This doesn't remove the calendar from the list or anything */
- uristr = get_uri_without_password (e_cal_get_uri (client));
- if (client == priv->task_pad_client) {
- message = g_strdup_printf (_("The task backend for\n%s\n has crashed. "
- "You will have to restart Evolution in order "
- "to use it again"),
- uristr);
- e_calendar_table_set_status_message (E_CALENDAR_TABLE (priv->todo), NULL);
- } else {
- int i;
-
- message = g_strdup_printf (_("The calendar backend for\n%s\n has crashed. "
- "You will have to restart Evolution in order "
- "to use it again"),
- uristr);
-
- for (i = 0; i < GNOME_CAL_LAST_VIEW; i++)
- e_calendar_view_set_status_message (priv->views[i], NULL);
- }
-
- gnome_error_dialog_parented (message, GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gcal))));
- g_free (message);
- g_free (uristr);
-}
-
-GtkWidget *
-gnome_calendar_construct (GnomeCalendar *gcal)
-{
- GnomeCalendarPrivate *priv;
- GnomeCalendarViewType view_type;
-
- g_return_val_if_fail (gcal != NULL, NULL);
- g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), NULL);
-
- priv = gcal->priv;
-
- /*
- * TaskPad Folder Client.
- */
- priv->task_pad_client = e_cal_new_from_uri ("", CALOBJ_TYPE_TODO); /* FIXME: use default tasks */
- if (!priv->task_pad_client)
- return NULL;
-
- g_signal_connect (priv->task_pad_client, "cal_opened",
- G_CALLBACK (client_cal_opened_cb), gcal);
- g_signal_connect (priv->task_pad_client, "backend_error",
- G_CALLBACK (backend_error_cb), gcal);
- g_signal_connect (priv->task_pad_client, "categories_changed",
- G_CALLBACK (client_categories_changed_cb), gcal);
- g_signal_connect (priv->task_pad_client, "backend_died",
- G_CALLBACK (backend_died_cb), gcal);
-
- /* Get the default view to show. */
- view_type = calendar_config_get_default_view ();
- if (view_type < GNOME_CAL_DAY_VIEW || view_type > GNOME_CAL_LIST_VIEW)
- view_type = GNOME_CAL_DAY_VIEW;
-
- gnome_calendar_set_view (gcal, view_type, FALSE, FALSE);
-
- return GTK_WIDGET (gcal);
-}
-
-GtkWidget *
-gnome_calendar_new (void)
-{
- GnomeCalendar *gcal;
-
- gcal = g_object_new (gnome_calendar_get_type (), NULL);
-
- if (!gnome_calendar_construct (gcal)) {
- g_message ("gnome_calendar_new(): Could not construct the calendar GUI");
- g_object_unref (gcal);
- return NULL;
- }
-
- return GTK_WIDGET (gcal);
-}
-
-void
-gnome_calendar_set_ui_component (GnomeCalendar *gcal,
- BonoboUIComponent *ui_component)
-{
- g_return_if_fail (GNOME_IS_CALENDAR (gcal));
- g_return_if_fail (ui_component == NULL || BONOBO_IS_UI_COMPONENT (ui_component));
-
- e_search_bar_set_ui_component (E_SEARCH_BAR (gcal->priv->search_bar), ui_component);
-}
-
-/**
- * gnome_calendar_get_calendar_model:
- * @gcal: A calendar view.
- *
- * Queries the calendar model object that a calendar view is using.
- *
- * Return value: A calendar client interface object.
- **/
-ECalModel *
-gnome_calendar_get_calendar_model (GnomeCalendar *gcal)
-{
- GnomeCalendarPrivate *priv;
-
- g_return_val_if_fail (gcal != NULL, NULL);
- g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), NULL);
-
- priv = gcal->priv;
-
- return e_calendar_view_get_model (priv->views[priv->current_view_type]);
-}
-
-/**
- * gnome_calendar_get_default_client
- */
-ECal *
-gnome_calendar_get_default_client (GnomeCalendar *gcal)
-{
- g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), NULL);
-
- return e_cal_model_get_default_client (e_calendar_view_get_model (E_CALENDAR_VIEW (gcal->priv->week_view)));
-}
-
-/**
- * gnome_calendar_get_task_pad_e_cal:
- * @gcal: A calendar view.
- *
- * Queries the calendar client interface object that a calendar view is using
- * for the Task Pad.
- *
- * Return value: A calendar client interface object.
- **/
-ECal *
-gnome_calendar_get_task_pad_e_cal (GnomeCalendar *gcal)
-{
- GnomeCalendarPrivate *priv;
-
- g_return_val_if_fail (gcal != NULL, NULL);
- g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), NULL);
-
- priv = gcal->priv;
-
- return priv->task_pad_client;
-}
-
-/**
- * gnome_calendar_add_event_uri:
- * @gcal: A GnomeCalendar.
- * @str_uri: URI to add to the calendar views.
- *
- * Adds the given calendar URI to the calendar views.
- *
- * Returns: TRUE if successful, FALSE if error.
- */
-gboolean
-gnome_calendar_add_event_uri (GnomeCalendar *gcal, const char *str_uri)
-{
- GnomeCalendarPrivate *priv;
- ECal *client;
- int i;
-
- g_return_val_if_fail (gcal != NULL, FALSE);
- g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), FALSE);
- g_return_val_if_fail (str_uri != NULL, FALSE);
-
- priv = gcal->priv;
-
- client = g_hash_table_lookup (priv->clients, str_uri);
- if (client)
- return TRUE;
-
- client = e_cal_new_from_uri (str_uri, CALOBJ_TYPE_EVENT);
- g_hash_table_insert (priv->clients, g_strdup (str_uri), client);
- priv->clients_list = g_list_prepend (priv->clients_list, client);
-
- g_signal_connect (G_OBJECT (client), "backend_error", G_CALLBACK (backend_error_cb), gcal);
- g_signal_connect (G_OBJECT (client), "categories_changed", G_CALLBACK (client_categories_changed_cb), gcal);
- g_signal_connect (G_OBJECT (client), "backend_died", G_CALLBACK (backend_died_cb), gcal);
-
- /* FIXME Do this async? */
- if (!e_cal_open (client, FALSE, NULL)) {
- g_hash_table_remove (priv->clients, str_uri);
- priv->clients_list = g_list_prepend (priv->clients_list, client);
- g_signal_handlers_disconnect_matched (client, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, gcal);
-
- return FALSE;
- }
-
- for (i = 0; i < GNOME_CAL_LAST_VIEW; i++) {
- ECalModel *model;
-
- model = e_calendar_view_get_model (priv->views[i]);
- e_cal_model_add_client (model, client);
- }
-
- /* update date navigator query */
- update_query (gcal);
-
- return TRUE;
-}
-
-/**
- * gnome_calendar_remove_event_uri
- * @gcal: A #GnomeCalendar.
- * @str_uri: URI to be removed from the clients.
- *
- * Removes the given URI from the list of clients being shown by the
- * calendar views.
- *
- * Returns: TRUE if successful, FALSE otherwise.
- */
-gboolean
-gnome_calendar_remove_event_uri (GnomeCalendar *gcal, const char *str_uri)
-{
- GnomeCalendarPrivate *priv;
- ECal *client;
- int i;
-
- g_return_val_if_fail (gcal != NULL, FALSE);
- g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), FALSE);
- g_return_val_if_fail (str_uri != NULL, FALSE);
-
- priv = gcal->priv;
-
- client = g_hash_table_lookup (priv->clients, str_uri);
- if (!client)
- return TRUE;
-
- g_hash_table_remove (priv->clients, str_uri);
- priv->clients_list = g_list_remove (priv->clients_list, client);
- g_signal_handlers_disconnect_matched (client, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, gcal);
-
- for (i = 0; i < GNOME_CAL_LAST_VIEW; i++) {
- ECalModel *model;
-
- model = e_calendar_view_get_model (priv->views[i]);
- e_cal_model_remove_client (model, client);
- }
-
- /* update date navigator query */
- update_query (gcal);
-
- return TRUE;
-}
-
-/**
- * gnome_calendar_set_default_uri:
- * @gcal: A calendar view
- * @uri: The uri to use as default
- *
- * Set the default uri on the given calendar view, the default uri
- * will be used as the default when creating events in the view.
-
- *
- * Return value: TRUE if the uri was already added and is set, FALSE
- * otherwise
- **/
-gboolean
-gnome_calendar_set_default_uri (GnomeCalendar *gcal, const char *str_uri)
-{
- GnomeCalendarPrivate *priv;
- ECal *client;
- int i;
-
- g_return_val_if_fail (gcal != NULL, FALSE);
- g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), FALSE);
- g_return_val_if_fail (str_uri != NULL, FALSE);
-
- priv = gcal->priv;
-
- client = g_hash_table_lookup (priv->clients, str_uri);
- if (!client)
- return FALSE;
-
- for (i = 0; i < GNOME_CAL_LAST_VIEW; i++) {
- e_cal_model_set_default_client (
- e_calendar_view_get_model (E_CALENDAR_VIEW (priv->views[i])),
- client);
- }
-
- return TRUE;
-}
-
-void
-gnome_calendar_set_selected_time_range (GnomeCalendar *gcal,
- time_t start_time,
- time_t end_time)
-{
- GnomeCalendarPrivate *priv;
-
- priv = gcal->priv;
-
- priv->selection_start_time = start_time;
- priv->selection_end_time = end_time;
-
- gnome_calendar_update_date_navigator (gcal);
- gnome_calendar_notify_dates_shown_changed (gcal);
-}
-
-/**
- * gnome_calendar_get_selected_time_range:
- * @gcal: A calendar view.
- * @start_time: Return value for the start of the time selection.
- * @end_time: Return value for the end of the time selection.
- *
- * Queries the time selection range on the calendar view.
- **/
-void
-gnome_calendar_get_selected_time_range (GnomeCalendar *gcal,
- time_t *start_time,
- time_t *end_time)
-{
- GnomeCalendarPrivate *priv;
-
- g_return_if_fail (gcal != NULL);
- g_return_if_fail (GNOME_IS_CALENDAR (gcal));
-
- priv = gcal->priv;
-
- if (start_time)
- *start_time = priv->selection_start_time;
-
- if (end_time)
- *end_time = priv->selection_end_time;
-}
-
-/**
- * gnome_calendar_new_task:
- * @gcal: An Evolution calendar.
- *
- * Opens a task editor dialog for a new task.
- **/
-void
-gnome_calendar_new_task (GnomeCalendar *gcal)
-{
- GnomeCalendarPrivate *priv;
- TaskEditor *tedit;
- ECalComponent *comp;
- icalcomponent *icalcomp;
- const char *category;
-
- g_return_if_fail (gcal != NULL);
- g_return_if_fail (GNOME_IS_CALENDAR (gcal));
-
- priv = gcal->priv;
-
- tedit = task_editor_new (priv->task_pad_client);
-
- icalcomp = e_cal_model_create_component_with_defaults (e_calendar_view_get_model (E_CALENDAR_VIEW (priv->week_view)));
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomp);
-
- category = cal_search_bar_get_category (CAL_SEARCH_BAR (priv->search_bar));
- e_cal_component_set_categories (comp, category);
-
- comp_editor_edit_comp (COMP_EDITOR (tedit), comp);
- g_object_unref (comp);
-
- comp_editor_focus (COMP_EDITOR (tedit));
-}
-
-
-/* Returns the selected time range for the current view. Note that this may be
- different from the fields in the GnomeCalendar, since the view may clip
- this or choose a more appropriate time. */
-void
-gnome_calendar_get_current_time_range (GnomeCalendar *gcal,
- time_t *start_time,
- time_t *end_time)
-{
- GnomeCalendarPrivate *priv;
-
- priv = gcal->priv;
-
- e_calendar_view_get_selected_time_range (E_CALENDAR_VIEW (gnome_calendar_get_current_view_widget (gcal)),
- start_time, end_time);
-}
-
-
-/* Gets the visible time range for the current view. Returns FALSE if no
- time range has been set yet. */
-gboolean
-gnome_calendar_get_visible_time_range (GnomeCalendar *gcal,
- time_t *start_time,
- time_t *end_time)
-{
- GnomeCalendarPrivate *priv;
- gboolean retval = FALSE;
-
- g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), FALSE);
-
- priv = gcal->priv;
-
- retval = e_calendar_view_get_visible_time_range (E_CALENDAR_VIEW (gnome_calendar_get_current_view_widget (gcal)),
- start_time, end_time);
-
- return retval;
-}
-
-
-
-static void
-get_days_shown (GnomeCalendar *gcal, GDate *start_date, gint *days_shown)
-{
- GnomeCalendarPrivate *priv;
-
- priv = gcal->priv;
-
- switch (priv->current_view_type) {
- case GNOME_CAL_DAY_VIEW:
- time_to_gdate_with_zone (start_date,
- E_DAY_VIEW (priv->day_view)->lower,
- priv->zone);
- *days_shown = e_day_view_get_days_shown (E_DAY_VIEW (priv->day_view));
- break;
-
- case GNOME_CAL_WORK_WEEK_VIEW:
- time_to_gdate_with_zone (start_date,
- E_DAY_VIEW (priv->work_week_view)->lower,
- priv->zone);
- *days_shown = e_day_view_get_days_shown (E_DAY_VIEW (priv->work_week_view));
- break;
-
- case GNOME_CAL_WEEK_VIEW:
- *start_date = E_WEEK_VIEW (priv->week_view)->first_day_shown;
- if (e_week_view_get_multi_week_view (E_WEEK_VIEW (priv->week_view)))
- *days_shown = e_week_view_get_weeks_shown (
- E_WEEK_VIEW (priv->week_view)) * 7;
- else
- *days_shown = 7;
-
- break;
-
- case GNOME_CAL_MONTH_VIEW:
- *start_date = E_WEEK_VIEW (priv->month_view)->first_day_shown;
- if (e_week_view_get_multi_week_view (E_WEEK_VIEW (priv->month_view)))
- *days_shown = e_week_view_get_weeks_shown (
- E_WEEK_VIEW (priv->month_view)) * 7;
- else
- *days_shown = 7;
-
- break;
-
- case GNOME_CAL_LIST_VIEW:
- if (!e_cal_list_view_get_range_shown (E_CAL_LIST_VIEW (priv->list_view),
- start_date, days_shown)) {
- /* No valid items in list */
- time_to_gdate_with_zone (start_date, time (NULL), priv->zone);
- *days_shown = 1;
- }
- else if (*days_shown < 1) {
- *days_shown = 1;
- }
- break;
-
- default:
- g_assert_not_reached ();
- }
-}
-
-
-/* This updates the month shown and the days selected in the calendar, if
- necessary. */
-static void
-gnome_calendar_update_date_navigator (GnomeCalendar *gcal)
-{
- GnomeCalendarPrivate *priv;
- GDate start_date, end_date;
- gint days_shown;
-
- priv = gcal->priv;
-
- /* If the ECalendar isn't visible, we just return. */
- if (!GTK_WIDGET_VISIBLE (priv->date_navigator))
- return;
-
- get_days_shown (gcal, &start_date, &days_shown);
-
- end_date = start_date;
- g_date_add_days (&end_date, days_shown - 1);
-
- e_calendar_item_set_selection (priv->date_navigator->calitem,
- &start_date, &end_date);
-}
-
-
-static void
-gnome_calendar_on_date_navigator_selection_changed (ECalendarItem *calitem,
- GnomeCalendar *gcal)
-{
- GnomeCalendarPrivate *priv;
- GDate start_date, end_date, new_start_date, new_end_date;
- gint days_shown, new_days_shown;
- gboolean starts_on_week_start_day;
- struct icaltimetype tt;
-
- priv = gcal->priv;
-
- starts_on_week_start_day = FALSE;
-
- get_days_shown (gcal, &start_date, &days_shown);
-
- end_date = start_date;
- g_date_add_days (&end_date, days_shown - 1);
-
- e_calendar_item_get_selection (calitem, &new_start_date, &new_end_date);
-
- /* If the selection hasn't changed just return. */
- if (!g_date_compare (&start_date, &new_start_date)
- && !g_date_compare (&end_date, &new_end_date))
- return;
-
- new_days_shown = g_date_julian (&new_end_date) - g_date_julian (&new_start_date) + 1;
-
- /* If a complete week is selected we show the Week view.
- Note that if weekends are compressed and the week start day is set
- to Sunday we don't actually show complete weeks in the Week view,
- so this may need tweaking. */
- if (g_date_weekday (&new_start_date) % 7 == calendar_config_get_week_start_day ())
- starts_on_week_start_day = TRUE;
-
- /* Update selection to be in the new time range */
- tt = icaltime_null_time ();
- tt.year = g_date_year (&new_start_date);
- tt.month = g_date_month (&new_start_date);
- tt.day = g_date_day (&new_start_date);
- priv->selection_start_time = icaltime_as_timet_with_zone (tt, priv->zone);
- icaltime_adjust (&tt, 1, 0, 0, 0);
- priv->selection_end_time = icaltime_as_timet_with_zone (tt, priv->zone);
-
- /* Switch views as appropriate, and change the number of days or weeks
- shown. */
- if (new_days_shown > 9) {
- e_week_view_set_weeks_shown (E_WEEK_VIEW (priv->month_view),
- (new_days_shown + 6) / 7);
- e_week_view_set_first_day_shown (E_WEEK_VIEW (priv->month_view), &new_start_date);
-
- set_view (gcal, GNOME_CAL_MONTH_VIEW, TRUE, FALSE);
- gnome_calendar_update_date_navigator (gcal);
- gnome_calendar_notify_dates_shown_changed (gcal);
- } else if (new_days_shown == 7 && starts_on_week_start_day) {
- e_week_view_set_first_day_shown (E_WEEK_VIEW (priv->week_view), &new_start_date);
-
- set_view (gcal, GNOME_CAL_WEEK_VIEW, TRUE, FALSE);
- gnome_calendar_update_date_navigator (gcal);
- gnome_calendar_notify_dates_shown_changed (gcal);
- } else {
- e_day_view_set_days_shown (E_DAY_VIEW (priv->day_view), new_days_shown);
-
- if (new_days_shown == 5 && priv->current_view_type == GNOME_CAL_WORK_WEEK_VIEW)
- gnome_calendar_set_view (gcal, GNOME_CAL_WORK_WEEK_VIEW, TRUE, FALSE);
- else
- gnome_calendar_set_view (gcal, GNOME_CAL_DAY_VIEW, TRUE, FALSE);
-
- }
-
- focus_current_view (gcal);
-}
-
-
-static void
-gnome_calendar_on_date_navigator_date_range_changed (ECalendarItem *calitem,
- GnomeCalendar *gcal)
-{
- update_query (gcal);
-}
-
-static void
-gnome_calendar_hpane_realized (GtkWidget *w, GnomeCalendar *gcal)
-{
- GnomeCalendarPrivate *priv;
-
- priv = gcal->priv;
-
- if (priv->current_view_type == GNOME_CAL_MONTH_VIEW && !priv->range_selected) {
- gtk_paned_set_position (GTK_PANED (priv->hpane), priv->hpane_pos_month_view);
- } else {
- gtk_paned_set_position (GTK_PANED (priv->hpane), priv->hpane_pos);
- }
-}
-
-static void
-gnome_calendar_vpane_realized (GtkWidget *w, GnomeCalendar *gcal)
-{
- GnomeCalendarPrivate *priv;
-
- priv = gcal->priv;
-
- if (priv->current_view_type == GNOME_CAL_MONTH_VIEW && !priv->range_selected) {
- gtk_paned_set_position (GTK_PANED (priv->vpane), priv->vpane_pos_month_view);
- } else {
- gtk_paned_set_position (GTK_PANED (priv->vpane), priv->vpane_pos);
- }
-}
-
-static gboolean
-gnome_calendar_vpane_resized (GtkWidget *w, GdkEventButton *e, GnomeCalendar *gcal)
-{
- GnomeCalendarPrivate *priv;
-
- priv = gcal->priv;
-
- if (priv->current_view_type == GNOME_CAL_MONTH_VIEW && !priv->range_selected) {
- priv->vpane_pos_month_view = gtk_paned_get_position (GTK_PANED (priv->vpane));
- calendar_config_set_month_vpane_pos (priv->vpane_pos_month_view);
- } else {
- priv->vpane_pos = gtk_paned_get_position (GTK_PANED (priv->vpane));
- calendar_config_set_vpane_pos (priv->vpane_pos);
- }
-
- return FALSE;
-}
-
-static gboolean
-gnome_calendar_hpane_resized (GtkWidget *w, GdkEventButton *e, GnomeCalendar *gcal)
-{
- GnomeCalendarPrivate *priv;
- gint times_width;
-
- priv = gcal->priv;
-
- if (priv->current_view_type == GNOME_CAL_MONTH_VIEW && !priv->range_selected) {
- priv->hpane_pos_month_view = gtk_paned_get_position (GTK_PANED (priv->hpane));
- calendar_config_set_month_hpane_pos (priv->hpane_pos_month_view);
- } else {
- priv->hpane_pos = gtk_paned_get_position (GTK_PANED (priv->hpane));
- calendar_config_set_hpane_pos (priv->hpane_pos);
- }
-
- /* adjust the size of the EDayView's time column */
- times_width = e_day_view_time_item_get_column_width (
- E_DAY_VIEW_TIME_ITEM (E_DAY_VIEW (priv->day_view)->time_canvas_item));
- if (times_width < priv->hpane_pos - 20)
- gtk_widget_set_usize (E_DAY_VIEW (priv->day_view)->time_canvas, times_width, -1);
- else
- gtk_widget_set_usize (E_DAY_VIEW (priv->day_view)->time_canvas, priv->hpane_pos - 20, -1);
-
-
- return FALSE;
-}
-
-void
-gnome_calendar_cut_clipboard (GnomeCalendar *gcal)
-{
- GnomeCalendarPrivate *priv;
- FocusLocation location;
-
- priv = gcal->priv;
-
- location = get_focus_location (gcal);
-
- if (location == FOCUS_CALENDAR) {
- e_calendar_view_cut_clipboard (E_CALENDAR_VIEW (gnome_calendar_get_current_view_widget (gcal)));
- } else if (location == FOCUS_TASKPAD)
- e_calendar_table_cut_clipboard (E_CALENDAR_TABLE (priv->todo));
- else
- g_assert_not_reached ();
-}
-
-void
-gnome_calendar_copy_clipboard (GnomeCalendar *gcal)
-{
- GnomeCalendarPrivate *priv;
- FocusLocation location;
-
- priv = gcal->priv;
-
- location = get_focus_location (gcal);
-
- if (location == FOCUS_CALENDAR) {
- e_calendar_view_copy_clipboard (E_CALENDAR_VIEW (gnome_calendar_get_current_view_widget (gcal)));
- } else if (location == FOCUS_TASKPAD)
- e_calendar_table_copy_clipboard (E_CALENDAR_TABLE (priv->todo));
- else
- g_assert_not_reached ();
-}
-
-void
-gnome_calendar_paste_clipboard (GnomeCalendar *gcal)
-{
- GnomeCalendarPrivate *priv;
- FocusLocation location;
-
- priv = gcal->priv;
-
- location = get_focus_location (gcal);
-
- if (location == FOCUS_CALENDAR) {
- e_calendar_view_paste_clipboard (E_CALENDAR_VIEW (gnome_calendar_get_current_view_widget (gcal)));
- } else if (location == FOCUS_TASKPAD)
- e_calendar_table_paste_clipboard (E_CALENDAR_TABLE (priv->todo));
- else
- g_assert_not_reached ();
-}
-
-
-/* Get the current timezone. */
-icaltimezone*
-gnome_calendar_get_timezone (GnomeCalendar *gcal)
-{
- g_return_val_if_fail (gcal != NULL, NULL);
- g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), NULL);
-
- return gcal->priv->zone;
-}
-
-
-static void
-gnome_calendar_notify_dates_shown_changed (GnomeCalendar *gcal)
-{
- GnomeCalendarPrivate *priv;
- time_t start_time, end_time;
-
- g_return_if_fail (GNOME_IS_CALENDAR (gcal));
-
- priv = gcal->priv;
-
- /* If no time range is set yet, just return. */
- if (!gnome_calendar_get_visible_time_range (gcal, &start_time,
- &end_time))
- return;
-
- /* We check if the visible date range has changed, and only emit the
- signal if it has. (This makes sure we only change the folder title
- bar label in the shell when we need to.) */
- if (priv->visible_start != start_time
- || priv->visible_end != end_time) {
- priv->visible_start = start_time;
- priv->visible_end = end_time;
-
- gtk_signal_emit (GTK_OBJECT (gcal),
- gnome_calendar_signals[DATES_SHOWN_CHANGED]);
- }
-}
-
-
-/* Returns the number of selected events (0 or 1 at present). */
-gint
-gnome_calendar_get_num_events_selected (GnomeCalendar *gcal)
-{
- GtkWidget *view;
- gint retval = 0;
-
- g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), 0);
-
- view = gnome_calendar_get_current_view_widget (gcal);
- if (E_IS_DAY_VIEW (view))
- retval = e_day_view_get_num_events_selected (E_DAY_VIEW (view));
- else
- retval = e_week_view_get_num_events_selected (E_WEEK_VIEW (view));
-
- return retval;
-}
-
-/**
- * gnome_calendar_get_num_tasks_selected:
- * @gcal: A calendar view.
- *
- * Queries the number of tasks that are currently selected in the task pad of a
- * calendar view.
- *
- * Return value: Number of selected tasks.
- **/
-gint
-gnome_calendar_get_num_tasks_selected (GnomeCalendar *gcal)
-{
- GnomeCalendarPrivate *priv;
- ETable *etable;
-
- g_return_val_if_fail (gcal != NULL, -1);
- g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), -1);
-
- priv = gcal->priv;
-
- etable = e_calendar_table_get_table (E_CALENDAR_TABLE (priv->todo));
- return e_table_selected_count (etable);
-}
-
-
-void
-gnome_calendar_delete_selection (GnomeCalendar *gcal)
-{
- GnomeCalendarPrivate *priv;
- FocusLocation location;
- GtkWidget *view;
-
- g_return_if_fail (GNOME_IS_CALENDAR (gcal));
-
- priv = gcal->priv;
-
- location = get_focus_location (gcal);
-
- if (location == FOCUS_CALENDAR) {
- view = gnome_calendar_get_current_view_widget (gcal);
-
- e_calendar_view_delete_selected_events (E_CALENDAR_VIEW (view));
- } else if (location == FOCUS_TASKPAD)
- e_calendar_table_delete_selected (E_CALENDAR_TABLE (priv->todo));
- else
- g_assert_not_reached ();
-}
-
-void
-gnome_calendar_delete_selected_occurrence (GnomeCalendar *gcal)
-{
- GnomeCalendarPrivate *priv;
- FocusLocation location;
- GtkWidget *view;
-
- g_return_if_fail (GNOME_IS_CALENDAR (gcal));
-
- priv = gcal->priv;
-
- location = get_focus_location (gcal);
-
- if (location == FOCUS_CALENDAR) {
-
- view = gnome_calendar_get_current_view_widget (gcal);
- e_calendar_view_delete_selected_occurrence (E_CALENDAR_VIEW (view));
- }
-}
-
-static gboolean
-check_instance_cb (ECalComponent *comp,
- time_t instance_start,
- time_t instance_end,
- gpointer data)
-{
- gboolean *remove = data;
-
- *remove = FALSE;
-
- return FALSE;
-}
-
-void
-gnome_calendar_purge (GnomeCalendar *gcal, time_t older_than)
-{
- GnomeCalendarPrivate *priv;
- char *sexp, *start, *end;
- GList *l;
-
- g_return_if_fail (GNOME_IS_CALENDAR (gcal));
-
- priv = gcal->priv;
-
- start = isodate_from_time_t (0);
- end = isodate_from_time_t (older_than);
- sexp = g_strdup_printf ("(occur-in-time-range? (make-time \"%s\")"
- " (make-time \"%s\"))",
- start, end);
-
- e_calendar_view_set_status_message (E_CALENDAR_VIEW (priv->week_view), _("Purging"));
-
- /* FIXME Confirm expunge */
- for (l = priv->clients_list; l != NULL; l = l->next) {
- ECal *client = l->data;
- GList *objects, *m;
- gboolean read_only = TRUE;
-
- e_cal_is_read_only (client, &read_only, NULL);
- if (!read_only)
- continue;
-
- if (!e_cal_get_object_list (client, sexp, &objects, NULL)) {
- g_warning (G_STRLOC ": Could not get the objects");
-
- continue;
- }
-
- for (m = objects; m; m = m->next) {
- ECalComponent *comp;
- gboolean remove = TRUE;
-
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (m->data));
-
- e_cal_recur_generate_instances (comp, older_than, -1,
- (ECalRecurInstanceFn) check_instance_cb,
- &remove,
- (ECalRecurResolveTimezoneFn) e_cal_resolve_tzid_cb,
- client, priv->zone);
-
- /* FIXME Better error handling */
- if (remove)
- e_cal_remove_object (client, icalcomponent_get_uid (m->data), NULL);
-
- g_object_unref (comp);
- }
- }
-
- e_calendar_view_set_status_message (E_CALENDAR_VIEW (priv->week_view), NULL);
-
- g_free (sexp);
- g_free (start);
- g_free (end);
-
-}
-
-ECalendarTable*
-gnome_calendar_get_task_pad (GnomeCalendar *gcal)
-{
- g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), NULL);
-
- return E_CALENDAR_TABLE (gcal->priv->todo);
-}
-
-GtkWidget *
-gnome_calendar_get_e_calendar_widget (GnomeCalendar *gcal)
-{
- g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), NULL);
-
- return GTK_WIDGET(gcal->priv->date_navigator);
-}
-
-GtkWidget *
-gnome_calendar_get_search_bar_widget (GnomeCalendar *gcal)
-{
- g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), NULL);
-
- return GTK_WIDGET(gcal->priv->search_bar);
-}
-
-GtkWidget *
-gnome_calendar_get_view_notebook_widget (GnomeCalendar *gcal)
-{
- g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), NULL);
-
- return GTK_WIDGET(gcal->priv->notebook);
-}
diff --git a/calendar/gui/gnome-cal.h b/calendar/gui/gnome-cal.h
deleted file mode 100644
index 896faaa13b..0000000000
--- a/calendar/gui/gnome-cal.h
+++ /dev/null
@@ -1,189 +0,0 @@
-/* Evolution calendar - Main calendar view widget
- *
- * Copyright (C) 1998 The Free Software Foundation
- * Copyright (C) 2000 Ximian, Inc.
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Authors: Miguel de Icaza <miguel@ximian.com>
- * Federico Mena-Quintero <federico@ximian.com>
- * Seth Alves <alves@hungry.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef GNOME_CALENDAR_APP_H
-#define GNOME_CALENDAR_APP_H
-
-#include <time.h>
-#include <gtk/gtkvbox.h>
-#include <bonobo/bonobo-ui-component.h>
-#include <gal/widgets/e-popup-menu.h>
-#include <widgets/misc/e-calendar.h>
-#include <libecal/e-cal.h>
-
-#include "e-calendar-table.h"
-
-G_BEGIN_DECLS
-
-
-
-#define GNOME_TYPE_CALENDAR (gnome_calendar_get_type ())
-#define GNOME_CALENDAR(obj) (GTK_CHECK_CAST ((obj), GNOME_TYPE_CALENDAR, GnomeCalendar))
-#define GNOME_CALENDAR_CLASS(klass) (GTK_CHECK_CAST_CLASS ((klass), GNOME_TYPE_CALENDAR, \
- GnomeCalendarClass))
-#define GNOME_IS_CALENDAR(obj) (GTK_CHECK_TYPE ((obj), GNOME_TYPE_CALENDAR))
-#define GNOME_IS_CALENDAR_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GNOME_TYPE_CALENDAR))
-
-typedef struct _GnomeCalendar GnomeCalendar;
-typedef struct _GnomeCalendarClass GnomeCalendarClass;
-typedef struct _GnomeCalendarPrivate GnomeCalendarPrivate;
-
-/* View types */
-typedef enum {
- GNOME_CAL_DAY_VIEW,
- GNOME_CAL_WORK_WEEK_VIEW,
- GNOME_CAL_WEEK_VIEW,
- GNOME_CAL_MONTH_VIEW,
- GNOME_CAL_LIST_VIEW,
- GNOME_CAL_LAST_VIEW
-} GnomeCalendarViewType;
-
-typedef enum {
- GNOME_CAL_GOTO_TODAY,
- GNOME_CAL_GOTO_DATE,
- GNOME_CAL_GOTO_FIRST_DAY_OF_MONTH,
- GNOME_CAL_GOTO_LAST_DAY_OF_MONTH,
- GNOME_CAL_GOTO_FIRST_DAY_OF_WEEK,
- GNOME_CAL_GOTO_LAST_DAY_OF_WEEK,
- GNOME_CAL_GOTO_SAME_DAY_OF_PREVIOUS_WEEK,
- GNOME_CAL_GOTO_SAME_DAY_OF_NEXT_WEEK
-} GnomeCalendarGotoDateType;
-
-struct _GnomeCalendar {
- GtkVBox vbox;
-
- /* Private data */
- GnomeCalendarPrivate *priv;
-};
-
-struct _GnomeCalendarClass {
- GtkVBoxClass parent_class;
-
- /* Notification signals */
- void (* dates_shown_changed) (GnomeCalendar *gcal);
-
- void (* calendar_selection_changed) (GnomeCalendar *gcal);
- void (* taskpad_selection_changed) (GnomeCalendar *gcal);
-
- void (* calendar_focus_change) (GnomeCalendar *gcal, gboolean in);
- void (* taskpad_focus_change) (GnomeCalendar *gcal, gboolean in);
- void (* goto_date) (GnomeCalendar *gcal,
- GnomeCalendarGotoDateType date);
-
-};
-
-
-GtkType gnome_calendar_get_type (void);
-GtkWidget *gnome_calendar_construct (GnomeCalendar *gcal);
-
-GtkWidget *gnome_calendar_new (void);
-
-void gnome_calendar_set_ui_component (GnomeCalendar *cal,
- BonoboUIComponent *ui_component);
-
-ECalendarTable *gnome_calendar_get_task_pad (GnomeCalendar *gcal);
-
-ECalModel *gnome_calendar_get_calendar_model (GnomeCalendar *gcal);
-ECal *gnome_calendar_get_default_client (GnomeCalendar *gcal);
-ECal *gnome_calendar_get_task_pad_e_cal(GnomeCalendar *gcal);
-
-gboolean gnome_calendar_add_event_uri (GnomeCalendar *gcal, const char *str_uri);
-gboolean gnome_calendar_remove_event_uri (GnomeCalendar *gcal, const char *str_uri);
-gboolean gnome_calendar_set_default_uri (GnomeCalendar *gcal, const char *str_uri);
-
-void gnome_calendar_set_query (GnomeCalendar *gcal, const char *sexp);
-
-void gnome_calendar_next (GnomeCalendar *gcal);
-void gnome_calendar_previous (GnomeCalendar *gcal);
-void gnome_calendar_goto (GnomeCalendar *gcal,
- time_t new_time);
-void gnome_calendar_dayjump (GnomeCalendar *gcal,
- time_t time);
-/* Jumps to the current day */
-void gnome_calendar_goto_today (GnomeCalendar *gcal);
-
-GnomeCalendarViewType gnome_calendar_get_view (GnomeCalendar *gcal);
-void gnome_calendar_set_view (GnomeCalendar *gcal, GnomeCalendarViewType view_type,
- gboolean range_selected, gboolean grab_focus);
-
-GtkWidget *gnome_calendar_get_current_view_widget (GnomeCalendar *gcal);
-
-ECalendarTable *gnome_calendar_get_task_pad (GnomeCalendar *gcal);
-GtkWidget *gnome_calendar_get_e_calendar_widget (GnomeCalendar *gcal);
-GtkWidget *gnome_calendar_get_search_bar_widget (GnomeCalendar *gcal);
-GtkWidget *gnome_calendar_get_view_notebook_widget (GnomeCalendar *gcal);
-
-void gnome_calendar_setup_view_menus (GnomeCalendar *gcal, BonoboUIComponent *uic);
-void gnome_calendar_discard_view_menus (GnomeCalendar *gcal);
-
-EPopupMenu *gnome_calendar_setup_view_popup (GnomeCalendar *gcal);
-void gnome_calendar_discard_view_popup (GnomeCalendar *gcal, EPopupMenu *popup);
-
-void gnome_calendar_set_selected_time_range (GnomeCalendar *gcal,
- time_t start_time,
- time_t end_time);
-void gnome_calendar_get_selected_time_range (GnomeCalendar *gcal,
- time_t *start_time,
- time_t *end_time);
-
-void gnome_calendar_new_task (GnomeCalendar *gcal);
-
-/* Returns the selected time range for the current view. Note that this may be
- different from the fields in the GnomeCalendar, since the view may clip
- this or choose a more appropriate time. */
-void gnome_calendar_get_current_time_range (GnomeCalendar *gcal,
- time_t *start_time,
- time_t *end_time);
-
-/* Gets the visible time range for the current view. Returns FALSE if no
- time range has been set yet. */
-gboolean gnome_calendar_get_visible_time_range (GnomeCalendar *gcal,
- time_t *start_time,
- time_t *end_time);
-
-/* Returns the number of selected events (0 or 1 at present). */
-gint gnome_calendar_get_num_events_selected (GnomeCalendar *gcal);
-
-/* Returns the number of selected tasks */
-gint gnome_calendar_get_num_tasks_selected (GnomeCalendar *gcal);
-
-/* Get the current timezone. */
-icaltimezone *gnome_calendar_get_timezone (GnomeCalendar *gcal);
-
-
-/* Clipboard operations */
-void gnome_calendar_cut_clipboard (GnomeCalendar *gcal);
-void gnome_calendar_copy_clipboard (GnomeCalendar *gcal);
-void gnome_calendar_paste_clipboard (GnomeCalendar *gcal);
-
-void gnome_calendar_delete_selection (GnomeCalendar *gcal);
-void gnome_calendar_delete_selected_occurrence (GnomeCalendar *gcal);
-void gnome_calendar_purge (GnomeCalendar *gcal,
- time_t older_than);
-
-
-
-G_END_DECLS
-
-#endif
diff --git a/calendar/gui/gnome-calendar-conduit.png b/calendar/gui/gnome-calendar-conduit.png
deleted file mode 100644
index e867ba90b2..0000000000
--- a/calendar/gui/gnome-calendar-conduit.png
+++ /dev/null
Binary files differ
diff --git a/calendar/gui/goto-dialog.glade b/calendar/gui/goto-dialog.glade
deleted file mode 100644
index b268e03294..0000000000
--- a/calendar/gui/goto-dialog.glade
+++ /dev/null
@@ -1,225 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-
-<widget class="GtkDialog" id="goto-dialog">
- <property name="title" translatable="yes">Go To Date</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="has_separator">True</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox1">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">8</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area1">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="button4">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Go To Today</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button5">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">-6</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="GtkHBox" id="hbox12">
- <property name="visible">True</property>
- <property name="homogeneous">True</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="GtkOptionMenu" id="month">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget1">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget2">
- <property name="visible">True</property>
- <property name="label" translatable="yes">January</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget3">
- <property name="visible">True</property>
- <property name="label" translatable="yes">February</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget4">
- <property name="visible">True</property>
- <property name="label" translatable="yes">March</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget5">
- <property name="visible">True</property>
- <property name="label" translatable="yes">April</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget6">
- <property name="visible">True</property>
- <property name="label" translatable="yes">May</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget7">
- <property name="visible">True</property>
- <property name="label" translatable="yes">June</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget8">
- <property name="visible">True</property>
- <property name="label" translatable="yes">July</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget9">
- <property name="visible">True</property>
- <property name="label" translatable="yes">August</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget10">
- <property name="visible">True</property>
- <property name="label" translatable="yes">September</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget11">
- <property name="visible">True</property>
- <property name="label" translatable="yes">October</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget12">
- <property name="visible">True</property>
- <property name="label" translatable="yes">November</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget13">
- <property name="visible">True</property>
- <property name="label" translatable="yes">December</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkSpinButton" id="year">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">True</property>
- <property name="update_policy">GTK_UPDATE_IF_VALID</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">1969 1969 2038 1 5 10</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/calendar/gui/goto.c b/calendar/gui/goto.c
deleted file mode 100644
index 66c6ecbad4..0000000000
--- a/calendar/gui/goto.c
+++ /dev/null
@@ -1,266 +0,0 @@
-/* Go to date dialog for Evolution
- *
- * Copyright (C) 1998 Red Hat, Inc.
- * Copyright (C) 2000 Ximian, Inc.
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Authors: Federico Mena <federico@ximian.com>
- * JP Rosevear <jpr@ximian.com>
- */
-
-#include <config.h>
-#include <gtk/gtkmenu.h>
-#include <gtk/gtkoptionmenu.h>
-#include <gtk/gtksignal.h>
-#include <gtk/gtkspinbutton.h>
-#include <gtk/gtktogglebutton.h>
-#include <gtk/gtkwindow.h>
-#include <gtk/gtkdialog.h>
-#include <libgnomeui/gnome-dialog.h>
-#include <glade/glade.h>
-#include "calendar-commands.h"
-#include "calendar-config.h"
-#include "tag-calendar.h"
-#include "goto.h"
-
-typedef struct
-{
- GladeXML *xml;
- GtkWidget *dialog;
-
- GtkWidget *month;
- GtkWidget *year;
- ECalendar *ecal;
- GtkWidget *vbox;
-
- GnomeCalendar *gcal;
- gint year_val;
- gint month_val;
- gint day_val;
-
-} GoToDialog;
-
-GoToDialog *dlg = NULL;
-
-/* Callback used when the year adjustment is changed */
-static void
-year_changed (GtkAdjustment *adj, gpointer data)
-{
- GoToDialog *dlg = data;
-
- dlg->year_val = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (dlg->year));
- e_calendar_item_set_first_month (dlg->ecal->calitem, dlg->year_val, dlg->month_val);
-}
-
-/* Callback used when a month button is toggled */
-static void
-month_changed (GtkToggleButton *toggle, gpointer data)
-{
- GoToDialog *dlg = data;
- GtkWidget *menu, *active;
-
- menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (dlg->month));
- active = gtk_menu_get_active (GTK_MENU (menu));
- dlg->month_val = g_list_index (GTK_MENU_SHELL (menu)->children, active);
-
- e_calendar_item_set_first_month (dlg->ecal->calitem, dlg->year_val, dlg->month_val);
-}
-
-static void
-ecal_date_range_changed (ECalendarItem *calitem, gpointer user_data)
-{
- GoToDialog *dlg = user_data;
- ECal *client;
-
- client = gnome_calendar_get_default_client (dlg->gcal);
- if (client)
- tag_calendar_by_client (dlg->ecal, client);
-}
-
-/* Event handler for day groups in the month item. A button press makes the calendar jump to the
- * selected day and destroys the Go-to dialog box.
- */
-static void
-ecal_event (ECalendarItem *calitem, gpointer user_data)
-{
- GoToDialog *dlg = user_data;
- GDate start_date, end_date;
- struct icaltimetype tt = icaltime_null_time ();
- time_t et;
-
- e_calendar_item_get_selection (calitem, &start_date, &end_date);
-
- tt.year = g_date_year (&start_date);
- tt.month = g_date_month (&start_date);
- tt.day = g_date_day (&start_date);
-
- et = icaltime_as_timet_with_zone (tt, gnome_calendar_get_timezone (dlg->gcal));
-
- gnome_calendar_goto (dlg->gcal, et);
-
- gtk_dialog_response (GTK_DIALOG (dlg->dialog), GTK_RESPONSE_NONE);
- /* gnome_dialog_close (GNOME_DIALOG (dlg->dialog)); */
-}
-
-/* Returns the current time, for the ECalendarItem. */
-static struct tm
-get_current_time (ECalendarItem *calitem, gpointer data)
-{
- char *location;
- icaltimezone *zone;
- struct tm tmp_tm = { 0 };
- struct icaltimetype tt;
-
- /* Get the current timezone. */
- location = calendar_config_get_timezone ();
- zone = icaltimezone_get_builtin_timezone (location);
-
- tt = icaltime_from_timet_with_zone (time (NULL), FALSE, zone);
-
- /* Now copy it to the struct tm and return it. */
- tmp_tm.tm_year = tt.year - 1900;
- tmp_tm.tm_mon = tt.month - 1;
- tmp_tm.tm_mday = tt.day;
- tmp_tm.tm_hour = tt.hour;
- tmp_tm.tm_min = tt.minute;
- tmp_tm.tm_sec = tt.second;
- tmp_tm.tm_isdst = -1;
-
- return tmp_tm;
-}
-
-/* Creates the ecalendar */
-static void
-create_ecal (GoToDialog *dlg)
-{
- ECalendarItem *calitem;
-
- dlg->ecal = E_CALENDAR (e_calendar_new ());
- calitem = dlg->ecal->calitem;
-
- gnome_canvas_item_set (GNOME_CANVAS_ITEM (calitem),
- "move_selection_when_moving", FALSE,
- NULL);
- e_calendar_item_set_display_popup (calitem, FALSE);
- gtk_widget_show (GTK_WIDGET (dlg->ecal));
- gtk_box_pack_start (GTK_BOX (dlg->vbox), GTK_WIDGET (dlg->ecal), TRUE, TRUE, 0);
-
- e_calendar_item_set_first_month (calitem, dlg->year_val, dlg->month_val);
- e_calendar_item_set_get_time_callback (calitem,
- get_current_time,
- dlg, NULL);
-
- ecal_date_range_changed (calitem, dlg);
-}
-
-static void
-goto_today (GoToDialog *dlg)
-{
- gnome_calendar_goto_today (dlg->gcal);
-}
-
-/* Gets the widgets from the XML file and returns if they are all available. */
-static gboolean
-get_widgets (GoToDialog *dlg)
-{
-#define GW(name) glade_xml_get_widget (dlg->xml, name)
-
- dlg->dialog = GW ("goto-dialog");
-
- dlg->month = GW ("month");
- dlg->year = GW ("year");
- dlg->vbox = GW ("vbox");
-
-#undef GW
-
- return (dlg->dialog
- && dlg->month
- && dlg->year
- && dlg->vbox);
-}
-
-static void
-goto_dialog_init_widgets (GoToDialog *dlg)
-{
- GtkWidget *menu;
- GtkAdjustment *adj;
- GList *l;
-
- menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (dlg->month));
- for (l = GTK_MENU_SHELL (menu)->children; l != NULL; l = l->next)
- g_signal_connect (menu, "selection_done", G_CALLBACK (month_changed), dlg);
-
- adj = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (dlg->year));
- g_signal_connect (adj, "value_changed", G_CALLBACK (year_changed), dlg);
-
- g_signal_connect (dlg->ecal->calitem, "date_range_changed", G_CALLBACK (ecal_date_range_changed), dlg);
- g_signal_connect (dlg->ecal->calitem, "selection_changed", G_CALLBACK (ecal_event), dlg);
-}
-
-/* Creates a "goto date" dialog and runs it */
-void
-goto_dialog (GnomeCalendar *gcal)
-{
- GtkWidget *menu;
- time_t start_time;
- struct icaltimetype tt;
- int b;
-
- if (dlg) {
- return;
- }
-
- dlg = g_new0 (GoToDialog, 1);
-
- /* Load the content widgets */
- dlg->xml = glade_xml_new (EVOLUTION_GLADEDIR "/goto-dialog.glade", NULL, NULL);
- if (!dlg->xml) {
- g_message ("goto_dialog(): Could not load the Glade XML file!");
- g_free (dlg);
- return;
- }
-
- if (!get_widgets (dlg)) {
- g_message ("goto_dialog(): Could not find all widgets in the XML file!");
- g_free (dlg);
- return;
- }
- dlg->gcal = gcal;
-
- gnome_calendar_get_selected_time_range (dlg->gcal, &start_time, NULL);
- tt = icaltime_from_timet_with_zone (start_time, FALSE, gnome_calendar_get_timezone (gcal));
- dlg->year_val = tt.year;
- dlg->month_val = tt.month - 1;
- dlg->day_val = tt.day;
-
- menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (dlg->month));
- gtk_option_menu_set_history (GTK_OPTION_MENU (dlg->month), dlg->month_val);
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (dlg->year), dlg->year_val);
-
- create_ecal (dlg);
-
- goto_dialog_init_widgets (dlg);
-
- gtk_window_set_transient_for (GTK_WINDOW (dlg->dialog),
- GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gcal))));
-
- /* set initial selection to current day */
-
- dlg->ecal->calitem->selection_set = TRUE;
- dlg->ecal->calitem->selection_start_month_offset = 0;
- dlg->ecal->calitem->selection_start_day = tt.day;
- dlg->ecal->calitem->selection_end_month_offset = 0;
- dlg->ecal->calitem->selection_end_day = tt.day;
-
- gnome_canvas_item_grab_focus (GNOME_CANVAS_ITEM (dlg->ecal->calitem));
-
- b = gtk_dialog_run (GTK_DIALOG (dlg->dialog));
- gtk_widget_destroy (dlg->dialog);
-
- if (b == 0)
- goto_today (dlg);
-
- g_object_unref (dlg->xml);
- g_free (dlg);
- dlg = NULL;
-}
diff --git a/calendar/gui/goto.h b/calendar/gui/goto.h
deleted file mode 100644
index 9ecfeeeb83..0000000000
--- a/calendar/gui/goto.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Evolution calendar - Go To Date dialog
- *
- * Copyright (C) 1998 Red Hat, Inc.
- * Copyright (C) 2000 Ximian, Inc.
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Authors: Federico Mena <federico@ximian.com>
- * JP Rosevear <jpr@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef GOTO_DIALOG_H
-#define GOTO_DIALOG_H
-
-#include "gnome-cal.h"
-
-void goto_dialog (GnomeCalendar *gcal);
-
-#endif
diff --git a/calendar/gui/itip-bonobo-control.c b/calendar/gui/itip-bonobo-control.c
deleted file mode 100644
index 391bc1f73d..0000000000
--- a/calendar/gui/itip-bonobo-control.c
+++ /dev/null
@@ -1,265 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* Evolution calendar - Control for displaying iTIP mail messages
- *
- * Copyright (C) 2000 Ximian, Inc.
- * Copyright (C) 2000 Ximian, Inc.
- *
- * Author: Jesse Pavel <jpavel@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-#include <string.h>
-#include <glib.h>
-#include <gtk/gtkobject.h>
-#include <gtk/gtkwidget.h>
-#include <bonobo/bonobo-generic-factory.h>
-#include <bonobo/bonobo-control.h>
-#include <bonobo/bonobo-property-bag.h>
-#include <bonobo/bonobo-persist-stream.h>
-#include <bonobo/bonobo-stream-client.h>
-#include <bonobo/bonobo-context.h>
-#include <bonobo/bonobo-exception.h>
-#include <libical/ical.h>
-
-#include "e-itip-control.h"
-#include "itip-bonobo-control.h"
-
-extern gchar *evolution_dir;
-
-enum E_ITIP_BONOBO_ARGS {
- FROM_ADDRESS_ARG_ID,
- VIEW_ONLY_ARG_ID
-};
-
-/*
- * Bonobo::PersistStream
- *
- * These two functions implement the Bonobo::PersistStream load and
- * save methods which allow data to be loaded into and out of the
- * BonoboObject.
- */
-
-static char *
-stream_read (Bonobo_Stream stream)
-{
- Bonobo_Stream_iobuf *buffer;
- CORBA_Environment ev;
- gchar *data = NULL;
- gint length = 0;
-
- CORBA_exception_init (&ev);
- do {
-#define READ_CHUNK_SIZE 65536
- Bonobo_Stream_read (stream, READ_CHUNK_SIZE,
- &buffer, &ev);
-
- if (BONOBO_EX (&ev)) {
- CORBA_exception_free (&ev);
- return NULL;
- }
-
- if (buffer->_length <= 0)
- break;
-
- data = g_realloc (data, length + buffer->_length + 1);
- memcpy (data + length, buffer->_buffer, buffer->_length);
- length += buffer->_length;
- data[length] = '\0';
-
- CORBA_free (buffer);
-#undef READ_CHUNK_SIZE
- } while (1);
-
- CORBA_free (buffer);
- CORBA_exception_free (&ev);
-
- if (data == NULL)
- data = g_strdup("");
-
- return data;
-} /* stream_read */
-
-/*
- * This function implements the Bonobo::PersistStream:load method.
- */
-typedef struct {
- EItipControl *itip;
- char *text;
-} idle_data;
-
-static gboolean
-set_data_idle_cb (gpointer data)
-{
- idle_data *id = data;
-
- e_itip_control_set_data (id->itip, id->text);
- g_object_unref (id->itip);
- g_free (id->text);
- g_free (id);
-
- return FALSE;
-}
-
-static void
-pstream_load (BonoboPersistStream *ps, const Bonobo_Stream stream,
- Bonobo_Persist_ContentType type, void *data,
- CORBA_Environment *ev)
-{
- EItipControl *itip = data;
- idle_data *id;
-
- if (type && g_strcasecmp (type, "text/calendar") != 0 &&
- g_strcasecmp (type, "text/x-calendar") != 0) {
- bonobo_exception_set (ev, ex_Bonobo_Persist_WrongDataType);
- return;
- }
-
- id = g_new0 (idle_data, 1);
- if ((id->text = stream_read (stream)) == NULL) {
- bonobo_exception_set (ev, ex_Bonobo_Persist_FileNotFound);
- g_free (id);
- return;
- }
- g_object_ref (itip);
- id->itip = itip;
-
- g_idle_add (set_data_idle_cb, id);
-}
-/*
- * This function implements the Bonobo::PersistStream:save method.
- */
-static void
-pstream_save (BonoboPersistStream *ps, const Bonobo_Stream stream,
- Bonobo_Persist_ContentType type, void *data,
- CORBA_Environment *ev)
-{
- EItipControl *itip = data;
- gchar *text;
- gint len;
-
- if (type && g_strcasecmp (type, "text/calendar") != 0 &&
- g_strcasecmp (type, "text/x-calendar") != 0) {
- bonobo_exception_set (ev, ex_Bonobo_Persist_WrongDataType);
- return;
- }
-
- text = e_itip_control_get_data (itip);
- len = e_itip_control_get_data_size (itip);
-
- bonobo_stream_client_write (stream, text, len, ev);
- g_free (text);
-} /* pstream_save */
-
-/* static CORBA_long */
-/* pstream_get_max_size (BonoboPersistStream *ps, void *data, */
-/* CORBA_Environment *ev) */
-/* { */
-/* EItipControl *itip = data; */
-/* gint len; */
-
-/* len = e_itip_control_get_data_size (itip); */
-
-/* if (len > 0) */
-/* return len; */
-
-/* return 0L; */
-/* } */
-
-static Bonobo_Persist_ContentTypeList *
-pstream_get_content_types (BonoboPersistStream *ps, void *closure,
- CORBA_Environment *ev)
-{
- return bonobo_persist_generate_content_types (2, "text/calendar", "text/x-calendar");
-}
-
-static void
-get_prop (BonoboPropertyBag *bag,
- BonoboArg *arg,
- guint arg_id,
- CORBA_Environment *ev,
- gpointer user_data)
-{
- EItipControl *itip = user_data;
-
- switch (arg_id) {
- case FROM_ADDRESS_ARG_ID:
- BONOBO_ARG_SET_STRING (arg, e_itip_control_get_from_address (itip));
- break;
- case VIEW_ONLY_ARG_ID:
- BONOBO_ARG_SET_INT (arg, e_itip_control_get_view_only (itip));
- break;
- }
-}
-
-static void
-set_prop ( BonoboPropertyBag *bag,
- const BonoboArg *arg,
- guint arg_id,
- CORBA_Environment *ev,
- gpointer user_data)
-{
- EItipControl *itip = user_data;
-
- switch (arg_id) {
- case FROM_ADDRESS_ARG_ID:
- e_itip_control_set_from_address (itip, BONOBO_ARG_GET_STRING (arg));
- break;
- case VIEW_ONLY_ARG_ID:
- e_itip_control_set_view_only (itip, BONOBO_ARG_GET_INT (arg));
- break;
- }
-}
-
-
-BonoboControl *
-itip_bonobo_control_new (void)
-{
- BonoboControl *control;
- BonoboPropertyBag *prop_bag;
- BonoboPersistStream *stream;
- GtkWidget *itip;
-
- itip = e_itip_control_new ();
- gtk_widget_show (itip);
- control = bonobo_control_new (itip);
-
- /* create a property bag */
- prop_bag = bonobo_property_bag_new (get_prop, set_prop, itip);
- bonobo_property_bag_add (prop_bag, "from_address", FROM_ADDRESS_ARG_ID, BONOBO_ARG_STRING, NULL,
- "from_address", 0 );
- bonobo_property_bag_add (prop_bag, "view_only", VIEW_ONLY_ARG_ID, BONOBO_ARG_INT, NULL,
- "view_only", 0 );
-
- bonobo_control_set_properties (control, bonobo_object_corba_objref (BONOBO_OBJECT (prop_bag)), NULL);
- bonobo_object_unref (BONOBO_OBJECT (prop_bag));
-
- bonobo_control_set_automerge (control, TRUE);
-
- stream = bonobo_persist_stream_new (pstream_load, pstream_save,
- pstream_get_content_types,
- "OAFIID:GNOME_Evolution_Calendar_iTip_Control:" BASE_VERSION,
- itip);
-
- if (stream == NULL) {
- bonobo_object_unref (BONOBO_OBJECT (control));
- return NULL;
- }
-
- bonobo_object_add_interface (BONOBO_OBJECT (control),
- BONOBO_OBJECT (stream));
-
- return control;
-}
diff --git a/calendar/gui/itip-bonobo-control.h b/calendar/gui/itip-bonobo-control.h
deleted file mode 100644
index 11b33e6602..0000000000
--- a/calendar/gui/itip-bonobo-control.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Evolution calendar - Control for displaying iTIP mail messages
- *
- * Copyright (C) 2000 Ximian, Inc.
- * Copyright (C) 2000 Ximian, Inc.
- *
- * Authors:
- * Jesse Pavel <jpavel@ximian.com>
- * JP Rosevear <jpr@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef __ITIP_CONTROL_FACTORY_H__
-#define __ITIP_CONTROL_FACTORY_H__
-
-#include <bonobo/bonobo-control.h>
-
-BonoboControl *itip_bonobo_control_new (void);
-
-#endif /* __ITIP_CONTROL_H__ */
diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c
deleted file mode 100644
index 30e95dbcfe..0000000000
--- a/calendar/gui/itip-utils.c
+++ /dev/null
@@ -1,979 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * JP Rosevear <jpr@ximian.com>
- *
- * Copyright 2001, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <bonobo/bonobo-exception.h>
-#include <bonobo/bonobo-object.h>
-#include <bonobo/bonobo-moniker-util.h>
-#include <libgnome/gnome-i18n.h>
-#include <gtk/gtkmessagedialog.h>
-#include <gtk/gtkwidget.h>
-#include <gal/util/e-util.h>
-#include <libical/ical.h>
-#include <Evolution-Composer.h>
-#include <e-util/e-dialog-utils.h>
-#include <e-util/e-time-utils.h>
-#include <libecal/e-cal-time-util.h>
-#include <libecal/e-cal-util.h>
-#include "calendar-config.h"
-#include "itip-utils.h"
-
-#define GNOME_EVOLUTION_COMPOSER_OAFIID "OAFIID:GNOME_Evolution_Mail_Composer:" BASE_VERSION
-
-static gchar *itip_methods[] = {
- "PUBLISH",
- "REQUEST",
- "REPLY",
- "ADD",
- "CANCEL",
- "RERESH",
- "COUNTER",
- "DECLINECOUNTER"
-};
-
-static icalproperty_method itip_methods_enum[] = {
- ICAL_METHOD_PUBLISH,
- ICAL_METHOD_REQUEST,
- ICAL_METHOD_REPLY,
- ICAL_METHOD_ADD,
- ICAL_METHOD_CANCEL,
- ICAL_METHOD_REFRESH,
- ICAL_METHOD_COUNTER,
- ICAL_METHOD_DECLINECOUNTER,
-};
-
-static EAccountList *accounts = NULL;
-
-EAccountList *
-itip_addresses_get (void)
-{
- if (accounts == NULL) {
- GConfClient *gconf_client = gconf_client_get_default ();
- accounts = e_account_list_new (gconf_client);
- g_object_unref (gconf_client);
- }
-
- return accounts;
-}
-
-EAccount *
-itip_addresses_get_default (void)
-{
- return (EAccount *)e_account_list_get_default(itip_addresses_get());
-}
-
-gboolean
-itip_organizer_is_user (ECalComponent *comp, ECal *client)
-{
- ECalComponentOrganizer organizer;
- const char *strip;
- gboolean user_org = FALSE;
-
- if (!e_cal_component_has_organizer (comp))
- return FALSE;
-
- e_cal_component_get_organizer (comp, &organizer);
- if (organizer.value != NULL) {
-
- strip = itip_strip_mailto (organizer.value);
-
- if (e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_ORGANIZER_NOT_EMAIL_ADDRESS)) {
- char *email;
-
- if (e_cal_get_cal_address (client, &email, NULL) && !g_strcasecmp (email, strip)) {
- g_free (email);
-
- return TRUE;
- }
-
- return FALSE;
- }
-
- user_org = e_account_list_find(itip_addresses_get(), E_ACCOUNT_FIND_ID_ADDRESS, strip) != NULL;
- }
-
- return user_org;
-}
-
-gboolean
-itip_sentby_is_user (ECalComponent *comp)
-{
- ECalComponentOrganizer organizer;
- const char *strip;
- gboolean user_sentby = FALSE;
-
- if (!e_cal_component_has_organizer (comp))
- return FALSE;
-
- e_cal_component_get_organizer (comp, &organizer);
- if (organizer.sentby != NULL) {
- strip = itip_strip_mailto (organizer.sentby);
- user_sentby = e_account_list_find(itip_addresses_get(), E_ACCOUNT_FIND_ID_ADDRESS, strip) != NULL;
- }
-
- return user_sentby;
-}
-
-const gchar *
-itip_strip_mailto (const gchar *address)
-{
- if (address == NULL)
- return NULL;
-
- if (!g_strncasecmp (address, "mailto:", 7))
- address += 7;
-
- return address;
-}
-
-static char *
-get_label (struct icaltimetype *tt)
-{
- char buffer[1000];
- struct tm tmp_tm;
-
- tmp_tm = icaltimetype_to_tm (tt);
- e_time_format_date_and_time (&tmp_tm,
- calendar_config_get_24_hour_format (),
- FALSE, FALSE,
- buffer, 1000);
-
- return g_strdup (buffer);
-}
-
-typedef struct {
- GHashTable *tzids;
- icalcomponent *icomp;
- ECal *client;
- icalcomponent *zones;
-} ItipUtilTZData;
-
-
-static void
-foreach_tzid_callback (icalparameter *param, gpointer data)
-{
- ItipUtilTZData *tz_data = data;
- const char *tzid;
- icaltimezone *zone = NULL;
- icalcomponent *vtimezone_comp;
-
- /* Get the TZID string from the parameter. */
- tzid = icalparameter_get_tzid (param);
- if (!tzid || g_hash_table_lookup (tz_data->tzids, tzid))
- return;
-
- /* Look for the timezone */
- if (tz_data->zones != NULL)
- zone = icalcomponent_get_timezone (tz_data->zones, tzid);
- if (zone == NULL)
- zone = icaltimezone_get_builtin_timezone_from_tzid (tzid);
- if (zone == NULL && tz_data->client != NULL)
- e_cal_get_timezone (tz_data->client, tzid, &zone, NULL);
- if (zone == NULL)
- return;
-
- /* Convert it to a string and add it to the hash. */
- vtimezone_comp = icaltimezone_get_component (zone);
- if (!vtimezone_comp)
- return;
-
- icalcomponent_add_component (tz_data->icomp, icalcomponent_new_clone (vtimezone_comp));
- g_hash_table_insert (tz_data->tzids, (char *)tzid, (char *)tzid);
-}
-
-static icalcomponent *
-comp_toplevel_with_zones (ECalComponentItipMethod method, ECalComponent *comp, ECal *client, icalcomponent *zones)
-{
- icalcomponent *top_level, *icomp;
- icalproperty *prop;
- icalvalue *value;
- ItipUtilTZData tz_data;
-
- top_level = e_cal_util_new_top_level ();
-
- prop = icalproperty_new (ICAL_METHOD_PROPERTY);
- value = icalvalue_new_method (itip_methods_enum[method]);
- icalproperty_set_value (prop, value);
- icalcomponent_add_property (top_level, prop);
-
- icomp = e_cal_component_get_icalcomponent (comp);
- icomp = icalcomponent_new_clone (icomp);
-
- tz_data.tzids = g_hash_table_new (g_str_hash, g_str_equal);
- tz_data.icomp = top_level;
- tz_data.client = client;
- tz_data.zones = zones;
- icalcomponent_foreach_tzid (icomp, foreach_tzid_callback, &tz_data);
- g_hash_table_destroy (tz_data.tzids);
-
- icalcomponent_add_component (top_level, icomp);
-
- return top_level;
-}
-
-static gboolean
-users_has_attendee (GList *users, const char *address)
-{
- GList *l;
-
- for (l = users; l != NULL; l = l->next) {
- if (!g_strcasecmp (address, l->data))
- return TRUE;
- }
-
- return FALSE;
-}
-
-static CORBA_char *
-comp_from (ECalComponentItipMethod method, ECalComponent *comp)
-{
- ECalComponentOrganizer organizer;
- ECalComponentAttendee *attendee;
- GSList *attendees;
- CORBA_char *str;
-
- switch (method) {
- case E_CAL_COMPONENT_METHOD_PUBLISH:
- return CORBA_string_dup ("");
-
- case E_CAL_COMPONENT_METHOD_REQUEST:
- case E_CAL_COMPONENT_METHOD_CANCEL:
- case E_CAL_COMPONENT_METHOD_ADD:
- e_cal_component_get_organizer (comp, &organizer);
- if (organizer.value == NULL) {
- e_notice (NULL, GTK_MESSAGE_ERROR,
- _("An organizer must be set."));
- return NULL;
- }
-
- return CORBA_string_dup (itip_strip_mailto (organizer.value));
-
- default:
- if (!e_cal_component_has_attendees (comp))
- return CORBA_string_dup ("");
-
- e_cal_component_get_attendee_list (comp, &attendees);
- attendee = attendees->data;
- str = CORBA_string_dup (attendee->value ? itip_strip_mailto (attendee->value) : "");
- e_cal_component_free_attendee_list (attendees);
-
- return str;
- }
-}
-
-static GNOME_Evolution_Composer_RecipientList *
-comp_to_list (ECalComponentItipMethod method, ECalComponent *comp, GList *users)
-{
- GNOME_Evolution_Composer_RecipientList *to_list;
- GNOME_Evolution_Composer_Recipient *recipient;
- ECalComponentOrganizer organizer;
- GSList *attendees, *l;
- gint len;
-
- switch (method) {
- case E_CAL_COMPONENT_METHOD_REQUEST:
- case E_CAL_COMPONENT_METHOD_CANCEL:
- e_cal_component_get_attendee_list (comp, &attendees);
- len = g_slist_length (attendees);
- if (len <= 0) {
- e_notice (NULL, GTK_MESSAGE_ERROR,
- _("At least one attendee is necessary"));
- e_cal_component_free_attendee_list (attendees);
- return NULL;
- }
-
- to_list = GNOME_Evolution_Composer_RecipientList__alloc ();
- to_list->_maximum = len;
- to_list->_length = 0;
- to_list->_buffer = CORBA_sequence_GNOME_Evolution_Composer_Recipient_allocbuf (len);
-
- e_cal_component_get_organizer (comp, &organizer);
- if (organizer.value == NULL) {
- e_notice (NULL, GTK_MESSAGE_ERROR,
- _("An organizer must be set."));
- return NULL;
- }
-
- for (l = attendees; l != NULL; l = l->next) {
- ECalComponentAttendee *att = l->data;
-
- if (users_has_attendee (users, att->value))
- continue;
- else if (!g_strcasecmp (att->value, organizer.value))
- continue;
-
- recipient = &(to_list->_buffer[to_list->_length]);
- if (att->cn)
- recipient->name = CORBA_string_dup (att->cn);
- else
- recipient->name = CORBA_string_dup ("");
- recipient->address = CORBA_string_dup (itip_strip_mailto (att->value));
-
- to_list->_length++;
- }
- e_cal_component_free_attendee_list (attendees);
- break;
-
- case E_CAL_COMPONENT_METHOD_REPLY:
- case E_CAL_COMPONENT_METHOD_ADD:
- case E_CAL_COMPONENT_METHOD_REFRESH:
- case E_CAL_COMPONENT_METHOD_COUNTER:
- case E_CAL_COMPONENT_METHOD_DECLINECOUNTER:
- e_cal_component_get_organizer (comp, &organizer);
- if (organizer.value == NULL) {
- e_notice (NULL, GTK_MESSAGE_ERROR,
- _("An organizer must be set."));
- return NULL;
- }
-
- len = 1;
-
- to_list = GNOME_Evolution_Composer_RecipientList__alloc ();
- to_list->_maximum = len;
- to_list->_length = len;
- to_list->_buffer = CORBA_sequence_GNOME_Evolution_Composer_Recipient_allocbuf (len);
- recipient = &(to_list->_buffer[0]);
-
- if (organizer.cn != NULL)
- recipient->name = CORBA_string_dup (organizer.cn);
- else
- recipient->name = CORBA_string_dup ("");
- recipient->address = CORBA_string_dup (itip_strip_mailto (organizer.value));
- break;
-
- default:
- to_list = GNOME_Evolution_Composer_RecipientList__alloc ();
- to_list->_maximum = to_list->_length = 0;
- break;
- }
- CORBA_sequence_set_release (to_list, TRUE);
-
- return to_list;
-}
-
-static CORBA_char *
-comp_subject (ECalComponentItipMethod method, ECalComponent *comp)
-{
- ECalComponentText caltext;
- const char *description, *prefix = NULL;
- GSList *alist;
- CORBA_char *subject;
-
- e_cal_component_get_summary (comp, &caltext);
- if (caltext.value != NULL)
- description = caltext.value;
- else {
- switch (e_cal_component_get_vtype (comp)) {
- case E_CAL_COMPONENT_EVENT:
- description = _("Event information");
- case E_CAL_COMPONENT_TODO:
- description = _("Task information");
- case E_CAL_COMPONENT_JOURNAL:
- description = _("Journal information");
- case E_CAL_COMPONENT_FREEBUSY:
- description = _("Free/Busy information");
- default:
- description = _("Calendar information");
- }
- }
-
- switch (method) {
- case E_CAL_COMPONENT_METHOD_PUBLISH:
- case E_CAL_COMPONENT_METHOD_REQUEST:
- /* FIXME: If this is an update to a previous
- * PUBLISH or REQUEST, then
- prefix = U_("Updated");
- */
- break;
-
- case E_CAL_COMPONENT_METHOD_REPLY:
- e_cal_component_get_attendee_list (comp, &alist);
- if (alist != NULL) {
- ECalComponentAttendee *a = alist->data;
-
- switch (a->status) {
- case ICAL_PARTSTAT_ACCEPTED:
- prefix = _("Accepted");
- break;
- case ICAL_PARTSTAT_TENTATIVE:
- prefix = _("Tentatively Accepted");
- break;
- case ICAL_PARTSTAT_DECLINED:
- prefix = _("Declined");
- break;
- default:
- break;
- }
- e_cal_component_free_attendee_list (alist);
- }
- break;
-
- case E_CAL_COMPONENT_METHOD_ADD:
- prefix = _("Updated");
- break;
-
- case E_CAL_COMPONENT_METHOD_CANCEL:
- prefix = _("Cancel");
- break;
-
- case E_CAL_COMPONENT_METHOD_REFRESH:
- prefix = _("Refresh");
- break;
-
- case E_CAL_COMPONENT_METHOD_COUNTER:
- prefix = _("Counter-proposal");
- break;
-
- case E_CAL_COMPONENT_METHOD_DECLINECOUNTER:
- prefix = _("Declined");
- break;
-
- default:
- break;
- }
-
- if (prefix) {
- subject = CORBA_string_alloc (strlen (description) +
- strlen (prefix) + 3);
- sprintf (subject, "%s: %s", prefix, description);
- } else
- subject = CORBA_string_dup (description);
-
- return subject;
-}
-
-static CORBA_char *
-comp_content_type (ECalComponent *comp, ECalComponentItipMethod method)
-{
- char tmp[256];
-
- sprintf (tmp, "text/calendar; name=\"%s\"; charset=utf-8; METHOD=%s",
- e_cal_component_get_vtype (comp) == E_CAL_COMPONENT_FREEBUSY ?
- "freebusy.ifb" : "calendar.ics", itip_methods[method]);
- return CORBA_string_dup (tmp);
-
-}
-
-static CORBA_char *
-comp_filename (ECalComponent *comp)
-{
- switch (e_cal_component_get_vtype (comp)) {
- case E_CAL_COMPONENT_FREEBUSY:
- return CORBA_string_dup ("freebusy.ifb");
- default:
- return CORBA_string_dup ("calendar.ics");
- }
-}
-
-static CORBA_char *
-comp_description (ECalComponent *comp)
-{
- CORBA_char *description;
- ECalComponentDateTime dt;
- char *start = NULL, *end = NULL;
-
- switch (e_cal_component_get_vtype (comp)) {
- case E_CAL_COMPONENT_EVENT:
- return CORBA_string_dup (_("Event information"));
- case E_CAL_COMPONENT_TODO:
- return CORBA_string_dup (_("Task information"));
- case E_CAL_COMPONENT_JOURNAL:
- return CORBA_string_dup (_("Journal information"));
- case E_CAL_COMPONENT_FREEBUSY:
- e_cal_component_get_dtstart (comp, &dt);
- if (dt.value)
- start = get_label (dt.value);
- e_cal_component_free_datetime (&dt);
-
- e_cal_component_get_dtend (comp, &dt);
- if (dt.value)
- end = get_label (dt.value);
- e_cal_component_free_datetime (&dt);
-
- if (start != NULL && end != NULL) {
- char *tmp;
- tmp = g_strdup_printf (_("Free/Busy information (%s to %s)"), start, end);
- description = CORBA_string_dup (tmp);
- g_free (tmp);
- } else {
- description = CORBA_string_dup (_("Free/Busy information"));
- }
- g_free (start);
- g_free (end);
- return description;
- default:
- return CORBA_string_dup (_("iCalendar information"));
- }
-}
-
-static gboolean
-comp_server_send (ECalComponentItipMethod method, ECalComponent *comp, ECal *client,
- icalcomponent *zones, GList **users)
-{
- icalcomponent *top_level;
- gboolean retval = TRUE;
- GError *error = NULL;
-
- top_level = comp_toplevel_with_zones (method, comp, client, zones);
- if (!e_cal_send_objects (client, top_level, &error)) {
- /* FIXME Really need a book problem status code */
- if (error->code != E_CALENDAR_STATUS_OK) {
- /* FIXME Better error message */
- e_notice (NULL, GTK_MESSAGE_ERROR, "Unable to book");
-
- retval = FALSE;
- }
- }
-
- g_clear_error (&error);
-
- icalcomponent_free (top_level);
-
- return retval;
-}
-
-static gboolean
-comp_limit_attendees (ECalComponent *comp)
-{
- icalcomponent *icomp;
- icalproperty *prop;
- gboolean found = FALSE, match = FALSE;
- GSList *l, *list = NULL;
-
- icomp = e_cal_component_get_icalcomponent (comp);
-
- for (prop = icalcomponent_get_first_property (icomp, ICAL_ATTENDEE_PROPERTY);
- prop != NULL;
- prop = icalcomponent_get_next_property (icomp, ICAL_ATTENDEE_PROPERTY))
- {
- icalvalue *value;
- const char *attendee;
- char *text;
-
- /* If we've already found something, just erase the rest */
- if (found) {
- list = g_slist_prepend (list, prop);
- continue;
- }
-
- value = icalproperty_get_value (prop);
- if (!value)
- continue;
-
- attendee = icalvalue_get_string (value);
-
- text = g_strdup (itip_strip_mailto (attendee));
- text = g_strstrip (text);
- found = match = e_account_list_find(itip_addresses_get(), E_ACCOUNT_FIND_ID_ADDRESS, text) != NULL;
- g_free (text);
-
- if (!match)
- list = g_slist_prepend (list, prop);
- match = FALSE;
- }
-
- for (l = list; l != NULL; l = l->next) {
- prop = l->data;
-
- icalcomponent_remove_property (icomp, prop);
- icalproperty_free (prop);
- }
- g_slist_free (list);
-
- return found;
-}
-
-static void
-comp_sentby (ECalComponent *comp, ECal *client)
-{
- ECalComponentOrganizer organizer;
-
- e_cal_component_get_organizer (comp, &organizer);
- if (!organizer.value) {
- EAccount *a = itip_addresses_get_default ();
-
- organizer.value = g_strdup_printf ("MAILTO:%s", a->id->address);
- organizer.sentby = NULL;
- organizer.cn = a->id->name;
- organizer.language = NULL;
-
- e_cal_component_set_organizer (comp, &organizer);
- g_free ((char *) organizer.value);
-
- return;
- }
-
- if (!itip_organizer_is_user (comp, client) && !itip_sentby_is_user (comp)) {
- EAccount *a = itip_addresses_get_default ();
-
- organizer.value = g_strdup (organizer.value);
- organizer.sentby = g_strdup_printf ("MAILTO:%s", a->id->address);
- organizer.cn = g_strdup (organizer.cn);
- organizer.language = g_strdup (organizer.language);
-
- e_cal_component_set_organizer (comp, &organizer);
-
- g_free ((char *)organizer.value);
- g_free ((char *)organizer.sentby);
- g_free ((char *)organizer.cn);
- g_free ((char *)organizer.language);
- }
-}
-static ECalComponent *
-comp_minimal (ECalComponent *comp, gboolean attendee)
-{
- ECalComponent *clone;
- icalcomponent *icomp, *icomp_clone;
- icalproperty *prop;
- ECalComponentOrganizer organizer;
- const char *uid;
- GSList *comments;
- struct icaltimetype itt;
- ECalComponentRange recur_id;
-
- clone = e_cal_component_new ();
- e_cal_component_set_new_vtype (clone, e_cal_component_get_vtype (comp));
-
- if (attendee) {
- GSList *attendees;
-
- e_cal_component_get_attendee_list (comp, &attendees);
- e_cal_component_set_attendee_list (clone, attendees);
-
- if (!comp_limit_attendees (clone)) {
- e_notice (NULL, GTK_MESSAGE_ERROR,
- _("You must be an attendee of the event."));
- goto error;
- }
- }
-
- itt = icaltime_from_timet_with_zone (time (NULL), FALSE,
- icaltimezone_get_utc_timezone ());
- e_cal_component_set_dtstamp (clone, &itt);
-
- e_cal_component_get_organizer (comp, &organizer);
- if (organizer.value == NULL)
- goto error;
- e_cal_component_set_organizer (clone, &organizer);
-
- e_cal_component_get_uid (comp, &uid);
- e_cal_component_set_uid (clone, uid);
-
- e_cal_component_get_comment_list (comp, &comments);
- if (g_slist_length (comments) <= 1) {
- e_cal_component_set_comment_list (clone, comments);
- } else {
- GSList *l = comments;
-
- comments = g_slist_remove_link (comments, l);
- e_cal_component_set_comment_list (clone, l);
- e_cal_component_free_text_list (l);
- }
- e_cal_component_free_text_list (comments);
-
- e_cal_component_get_recurid (comp, &recur_id);
- if (recur_id.datetime.value != NULL)
- e_cal_component_set_recurid (clone, &recur_id);
-
- icomp = e_cal_component_get_icalcomponent (comp);
- icomp_clone = e_cal_component_get_icalcomponent (clone);
- for (prop = icalcomponent_get_first_property (icomp, ICAL_X_PROPERTY);
- prop != NULL;
- prop = icalcomponent_get_next_property (icomp, ICAL_X_PROPERTY))
- {
- icalproperty *p;
-
- p = icalproperty_new_clone (prop);
- icalcomponent_add_property (icomp_clone, p);
- }
-
- e_cal_component_rescan (clone);
-
- return clone;
-
- error:
- g_object_unref (clone);
- return NULL;
-}
-
-static ECalComponent *
-comp_compliant (ECalComponentItipMethod method, ECalComponent *comp, ECal *client, icalcomponent *zones)
-{
- ECalComponent *clone, *temp_clone;
- struct icaltimetype itt;
-
- clone = e_cal_component_clone (comp);
- itt = icaltime_from_timet_with_zone (time (NULL), FALSE,
- icaltimezone_get_utc_timezone ());
- e_cal_component_set_dtstamp (clone, &itt);
-
- /* Make UNTIL date a datetime in a simple recurrence */
- if (e_cal_component_has_recurrences (clone)
- && e_cal_component_has_simple_recurrence (clone)) {
- GSList *rrule_list;
- struct icalrecurrencetype *r;
-
- e_cal_component_get_rrule_list (clone, &rrule_list);
- r = rrule_list->data;
-
- if (!icaltime_is_null_time (r->until) && r->until.is_date) {
- ECalComponentDateTime dt;
- icaltimezone *from_zone = NULL, *to_zone;
-
- e_cal_component_get_dtstart (clone, &dt);
-
- if (dt.value->is_date) {
- from_zone = icaltimezone_get_builtin_timezone (calendar_config_get_timezone ());
- } else if (dt.tzid == NULL) {
- from_zone = icaltimezone_get_utc_timezone ();
- } else {
- if (zones != NULL)
- from_zone = icalcomponent_get_timezone (zones, dt.tzid);
- if (from_zone == NULL)
- from_zone = icaltimezone_get_builtin_timezone_from_tzid (dt.tzid);
- if (from_zone == NULL && client != NULL)
- /* FIXME Error checking */
- e_cal_get_timezone (client, dt.tzid, &from_zone, NULL);
- }
-
- to_zone = icaltimezone_get_utc_timezone ();
-
- r->until.hour = dt.value->hour;
- r->until.minute = dt.value->minute;
- r->until.second = dt.value->second;
- r->until.is_date = FALSE;
-
- icaltimezone_convert_time (&r->until, from_zone, to_zone);
- r->until.is_utc = TRUE;
-
- e_cal_component_set_rrule_list (clone, rrule_list);
- e_cal_component_abort_sequence (clone);
- }
-
- e_cal_component_free_recur_list (rrule_list);
- }
-
- /* We delete incoming alarms anyhow, and this helps with outlook */
- e_cal_component_remove_all_alarms (clone);
-
- /* Strip X-LIC-ERROR stuff */
- e_cal_component_strip_errors (clone);
-
- /* Comply with itip spec */
- switch (method) {
- case E_CAL_COMPONENT_METHOD_PUBLISH:
- comp_sentby (clone, client);
- e_cal_component_set_attendee_list (clone, NULL);
- break;
- case E_CAL_COMPONENT_METHOD_REQUEST:
- comp_sentby (clone, client);
- break;
- case E_CAL_COMPONENT_METHOD_CANCEL:
- comp_sentby (clone, client);
- break;
- case E_CAL_COMPONENT_METHOD_REPLY:
- break;
- case E_CAL_COMPONENT_METHOD_ADD:
- break;
- case E_CAL_COMPONENT_METHOD_REFRESH:
- /* Need to remove almost everything */
- temp_clone = comp_minimal (clone, TRUE);
- g_object_unref (clone);
- clone = temp_clone;
- break;
- case E_CAL_COMPONENT_METHOD_COUNTER:
- break;
- case E_CAL_COMPONENT_METHOD_DECLINECOUNTER:
- /* Need to remove almost everything */
- temp_clone = comp_minimal (clone, FALSE);
- g_object_unref (clone);
- clone = temp_clone;
- break;
- default:
- break;
- }
-
- return clone;
-}
-
-gboolean
-itip_send_comp (ECalComponentItipMethod method, ECalComponent *send_comp,
- ECal *client, icalcomponent *zones)
-{
- GNOME_Evolution_Composer composer_server;
- ECalComponent *comp = NULL;
- icalcomponent *top_level = NULL;
- GList *users = NULL;
- GNOME_Evolution_Composer_RecipientList *to_list = NULL;
- GNOME_Evolution_Composer_RecipientList *cc_list = NULL;
- GNOME_Evolution_Composer_RecipientList *bcc_list = NULL;
- CORBA_char *subject = NULL, *body = NULL, *content_type = NULL;
- CORBA_char *from = NULL, *filename = NULL, *description = NULL;
- GNOME_Evolution_Composer_AttachmentData *attach_data = NULL;
- char *ical_string;
- CORBA_Environment ev;
- gboolean retval = FALSE;
-
- CORBA_exception_init (&ev);
-
- /* Give the server a chance to manipulate the comp */
- if (method != E_CAL_COMPONENT_METHOD_PUBLISH) {
- if (!comp_server_send (method, send_comp, client, zones, &users))
- goto cleanup;
- }
-
- /* Tidy up the comp */
- comp = comp_compliant (method, send_comp, client, zones);
- if (comp == NULL)
- goto cleanup;
-
- /* Recipients */
- to_list = comp_to_list (method, comp, users);
- if (method != E_CAL_COMPONENT_METHOD_PUBLISH) {
- if (to_list == NULL || to_list->_length == 0) {
- /* We sent them all via the server */
- retval = TRUE;
- goto cleanup;
- }
- }
-
- cc_list = GNOME_Evolution_Composer_RecipientList__alloc ();
- cc_list->_maximum = cc_list->_length = 0;
- bcc_list = GNOME_Evolution_Composer_RecipientList__alloc ();
- bcc_list->_maximum = bcc_list->_length = 0;
-
- /* Subject information */
- subject = comp_subject (method, comp);
-
- /* From address */
- from = comp_from (method, comp);
-
- /* Obtain an object reference for the Composer. */
- composer_server = bonobo_activation_activate_from_id (GNOME_EVOLUTION_COMPOSER_OAFIID, 0, NULL, &ev);
- if (BONOBO_EX (&ev)) {
- g_warning ("Could not activate composer: %s", bonobo_exception_get_text (&ev));
- CORBA_exception_free (&ev);
- return FALSE;
- }
-
- /* Set recipients, subject */
- GNOME_Evolution_Composer_setHeaders (composer_server, from, to_list, cc_list, bcc_list, subject, &ev);
- if (BONOBO_EX (&ev)) {
- g_warning ("Unable to set composer headers while sending iTip message: %s",
- bonobo_exception_get_text (&ev));
- goto cleanup;
- }
-
-
- /* Content type */
- content_type = comp_content_type (comp, method);
-
- top_level = comp_toplevel_with_zones (method, comp, client, zones);
- ical_string = icalcomponent_as_ical_string (top_level);
-
- if (e_cal_component_get_vtype (comp) == E_CAL_COMPONENT_EVENT) {
- GNOME_Evolution_Composer_setBody (composer_server, ical_string, content_type, &ev);
- } else {
- GNOME_Evolution_Composer_setMultipartType (composer_server, GNOME_Evolution_Composer_MIXED, &ev);
- if (BONOBO_EX (&ev)) {
- g_warning ("Unable to set multipart type while sending iTip message");
- goto cleanup;
- }
-
- filename = comp_filename (comp);
- description = comp_description (comp);
-
- GNOME_Evolution_Composer_setBody (composer_server, description, "text/plain", &ev);
- if (BONOBO_EX (&ev)) {
- g_warning ("Unable to set body text while sending iTip message");
- goto cleanup;
- }
-
- attach_data = GNOME_Evolution_Composer_AttachmentData__alloc ();
- attach_data->_length = strlen (ical_string) + 1;
- attach_data->_maximum = attach_data->_length;
- attach_data->_buffer = CORBA_sequence_CORBA_char_allocbuf (attach_data->_length);
- strcpy (attach_data->_buffer, ical_string);
-
- GNOME_Evolution_Composer_attachData (composer_server,
- content_type, filename, description,
- TRUE, attach_data,
- &ev);
- }
-
- if (BONOBO_EX (&ev)) {
- g_warning ("Unable to place iTip message in composer");
- goto cleanup;
- }
-
- if (method == E_CAL_COMPONENT_METHOD_PUBLISH) {
- GNOME_Evolution_Composer_show (composer_server, &ev);
- if (BONOBO_EX (&ev))
- g_warning ("Unable to show the composer while sending iTip message");
- else
- retval = TRUE;
- } else {
- GNOME_Evolution_Composer_send (composer_server, &ev);
- if (BONOBO_EX (&ev))
- g_warning ("Unable to send iTip message");
- else
- retval = TRUE;
- }
-
- cleanup:
- CORBA_exception_free (&ev);
-
- if (comp != NULL)
- g_object_unref (comp);
- if (top_level != NULL)
- icalcomponent_free (top_level);
-
- if (to_list != NULL)
- CORBA_free (to_list);
- if (cc_list != NULL)
- CORBA_free (cc_list);
- if (bcc_list != NULL)
- CORBA_free (bcc_list);
-
- if (from != NULL)
- CORBA_free (from);
- if (subject != NULL)
- CORBA_free (subject);
- if (body != NULL)
- CORBA_free (body);
- if (content_type != NULL)
- CORBA_free (content_type);
- if (filename != NULL)
- CORBA_free (filename);
- if (description != NULL)
- CORBA_free (description);
- if (attach_data != NULL) {
- CORBA_free (attach_data->_buffer);
- CORBA_free (attach_data);
- }
-
- return retval;
-}
-
diff --git a/calendar/gui/itip-utils.h b/calendar/gui/itip-utils.h
deleted file mode 100644
index cf9dd37643..0000000000
--- a/calendar/gui/itip-utils.h
+++ /dev/null
@@ -1,35 +0,0 @@
-
-#ifndef ITIP_UTILS_HEADER
-#define ITIP_UTILS_HEADER
-
-#include <libical/ical.h>
-#include <string.h>
-#include <glib.h>
-#include <libecal/e-cal.h>
-#include <libecal/e-cal-component.h>
-#include <e-util/e-account-list.h>
-
-typedef enum {
- E_CAL_COMPONENT_METHOD_PUBLISH,
- E_CAL_COMPONENT_METHOD_REQUEST,
- E_CAL_COMPONENT_METHOD_REPLY,
- E_CAL_COMPONENT_METHOD_ADD,
- E_CAL_COMPONENT_METHOD_CANCEL,
- E_CAL_COMPONENT_METHOD_REFRESH,
- E_CAL_COMPONENT_METHOD_COUNTER,
- E_CAL_COMPONENT_METHOD_DECLINECOUNTER
-} ECalComponentItipMethod;
-
-EAccountList *itip_addresses_get (void);
-EAccount *itip_addresses_get_default (void);
-
-gboolean itip_organizer_is_user (ECalComponent *comp, ECal *client);
-gboolean itip_sentby_is_user (ECalComponent *comp);
-
-const gchar *itip_strip_mailto (const gchar *address);
-
-gboolean itip_send_comp (ECalComponentItipMethod method, ECalComponent *comp,
- ECal *client, icalcomponent *zones);
-
-
-#endif
diff --git a/calendar/gui/main.c b/calendar/gui/main.c
deleted file mode 100644
index 838917244d..0000000000
--- a/calendar/gui/main.c
+++ /dev/null
@@ -1,181 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* main.c
- *
- * Copyright (C) 2000, 2001, 2002, 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Ettore Perazzoli
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <glib.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnome/gnome-init.h>
-#include <libgnomevfs/gnome-vfs-init.h>
-#include <glade/glade.h>
-
-#include <bonobo/bonobo-main.h>
-#include <bonobo/bonobo-shlib-factory.h>
-#include <bonobo/bonobo-exception.h>
-
-#include <gal/widgets/e-cursors.h>
-
-#include "dialogs/cal-prefs-dialog.h"
-#include "calendar-commands.h"
-#include "calendar-config.h"
-#include "calendar-component.h"
-#include "e-comp-editor-registry.h"
-#include "comp-editor-factory.h"
-#include "control-factory.h"
-#include "itip-bonobo-control.h"
-#include "tasks-control.h"
-#include "tasks-component.h"
-
-
-#define FACTORY_ID "OAFIID:GNOME_Evolution_Calendar_Factory:" BASE_VERSION
-
-#define CALENDAR_COMPONENT_ID "OAFIID:GNOME_Evolution_Calendar_Component:" BASE_VERSION
-#define CALENDAR_CONTROL_ID "OAFIID:GNOME_Evolution_Calendar_Control:" BASE_VERSION
-#define TASKS_COMPONENT_ID "OAFIID:GNOME_Evolution_Tasks_Component:" BASE_VERSION
-#define TASKS_CONTROL_ID "OAFIID:GNOME_Evolution_Tasks_Control:" BASE_VERSION
-#define ITIP_CONTROL_ID "OAFIID:GNOME_Evolution_Calendar_iTip_Control:" BASE_VERSION
-#define CONFIG_CONTROL_ID "OAFIID:GNOME_Evolution_Calendar_ConfigControl:" BASE_VERSION
-#define COMP_EDITOR_FACTORY_ID "OAFIID:GNOME_Evolution_Calendar_CompEditorFactory:" BASE_VERSION
-
-ECompEditorRegistry *comp_editor_registry = NULL;
-
-/* The component editor factory */
-static CompEditorFactory *comp_editor_factory = NULL;
-
-
-/* Factory function for the calendar component factory; just creates and
- * references a singleton service object.
- */
-static BonoboObject *
-comp_editor_factory_fn (void)
-{
- if (!comp_editor_factory) {
- comp_editor_factory = comp_editor_factory_new ();
- if (!comp_editor_factory)
- return NULL;
- }
-
- bonobo_object_ref (BONOBO_OBJECT (comp_editor_factory));
- return BONOBO_OBJECT (comp_editor_factory);
-}
-
-
-/* Does a simple activation and unreffing of the alarm notification service so
- * that the daemon will be launched if it is not running yet.
- */
-static gboolean
-launch_alarm_daemon_cb (gpointer data)
-{
- CORBA_Environment ev;
- CORBA_Object an;
- guint *idle_id = (guint *) data;
-
- /* remove the idle function */
- g_source_remove (*idle_id);
- g_free (idle_id);
-
- /* activate the alarm daemon */
- CORBA_exception_init (&ev);
- an = bonobo_activation_activate_from_id ("OAFIID:GNOME_Evolution_Calendar_AlarmNotify:" BASE_VERSION, 0, NULL, &ev);
-
- if (BONOBO_EX (&ev)) {
- g_message ("launch_alarm_daemon_cb(): Could not activate the alarm notification service");
- CORBA_exception_free (&ev);
- return FALSE;
- }
- CORBA_exception_free (&ev);
-
- /* Just get rid of it; what we are interested in is that it gets launched */
-
- CORBA_exception_init (&ev);
- bonobo_object_release_unref (an, &ev);
- if (BONOBO_EX (&ev))
- g_message ("add_alarms(): Could not unref the alarm notification service");
-
- CORBA_exception_free (&ev);
-
- return FALSE;
-}
-
-static void
-launch_alarm_daemon (void)
-{
- guint *idle_id;
-
- idle_id = g_new0 (guint, 1);
- *idle_id = g_idle_add ((GSourceFunc) launch_alarm_daemon_cb, idle_id);
-}
-
-static void
-initialize (void)
-{
- comp_editor_registry = E_COMP_EDITOR_REGISTRY (e_comp_editor_registry_new ());
-
- calendar_config_init ();
-
-#if 0
- itip_control_factory_init ();
- component_editor_factory_init ();
-#endif
-
- launch_alarm_daemon ();
-}
-
-
-static BonoboObject *
-factory (BonoboGenericFactory *factory,
- const char *component_id,
- void *closure)
-{
- static gboolean initialized = FALSE;
-
- if (! initialized) {
- initialize ();
- initialized = TRUE;
- }
-
- if (strcmp (component_id, CALENDAR_COMPONENT_ID) == 0) {
- BonoboObject *object = BONOBO_OBJECT (calendar_component_peek ());
- bonobo_object_ref (object);
- return object;
- } else if (strcmp (component_id, CALENDAR_CONTROL_ID) == 0)
- return BONOBO_OBJECT (control_factory_new_control ());
- else if (strcmp (component_id, TASKS_COMPONENT_ID) == 0) {
- BonoboObject *object = BONOBO_OBJECT (tasks_component_peek ());
- bonobo_object_ref (object);
- return object;
- } else if (strcmp (component_id, TASKS_CONTROL_ID) == 0)
- return BONOBO_OBJECT (tasks_control_new ());
- else if (strcmp (component_id, ITIP_CONTROL_ID) == 0)
- return BONOBO_OBJECT (itip_bonobo_control_new ());
- else if (strcmp (component_id, CONFIG_CONTROL_ID) == 0)
- return BONOBO_OBJECT (cal_prefs_dialog_new ());
- else if (strcmp (component_id, COMP_EDITOR_FACTORY_ID) == 0)
- return BONOBO_OBJECT (comp_editor_factory_fn ());
-
- g_warning (FACTORY_ID ": Don't know what to do with %s", component_id);
- return NULL;
-}
-
-BONOBO_ACTIVATION_SHLIB_FACTORY (FACTORY_ID, "Evolution Calendar component factory", factory, NULL)
diff --git a/calendar/gui/migration.c b/calendar/gui/migration.c
deleted file mode 100644
index afb0a59b68..0000000000
--- a/calendar/gui/migration.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* calendar-component.c
- *
- * Copyright (C) 2003 Ximian, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Rodrigo Moya <rodrigo@ximian.com>
- */
-
-#include <bonobo/bonobo-i18n.h>
-#include <libgnomevfs/gnome-vfs-uri.h>
-#include <libgnomevfs/gnome-vfs-xfer.h>
-#include <gal/util/e-util.h>
-#include "migration.h"
-
-
-static gboolean
-process_old_dir (ESourceGroup *source_group, const char *path,
- const char *filename, const char *name, const char *base_uri)
-{
- char *s;
- GnomeVFSURI *from, *to;
- GnomeVFSResult vres;
- ESource *source;
- GDir *dir;
- gboolean retval = TRUE;
-
- s = g_build_filename (path, filename, NULL);
- if (!g_file_test (s, G_FILE_TEST_EXISTS)) {
- g_free (s);
- return FALSE;
- }
-
- /* transfer the old file to its new location */
- from = gnome_vfs_uri_new (s);
- g_free (s);
- if (!from)
- return FALSE;
-
- s = g_build_filename (e_source_group_peek_base_uri (source_group), base_uri,
- filename, NULL);
- if (e_mkdir_hier (s, 0700) != 0) {
- gnome_vfs_uri_unref (from);
- g_free (s);
- return FALSE;
- }
- to = gnome_vfs_uri_new (s);
- g_free (s);
- if (!to) {
- gnome_vfs_uri_unref (from);
- return FALSE;
- }
-
- vres = gnome_vfs_xfer_uri ((const GnomeVFSURI *) from,
- (const GnomeVFSURI *) to,
- GNOME_VFS_XFER_DEFAULT,
- GNOME_VFS_XFER_ERROR_MODE_ABORT,
- GNOME_VFS_XFER_OVERWRITE_MODE_REPLACE,
- NULL, NULL);
- gnome_vfs_uri_unref (from);
- gnome_vfs_uri_unref (to);
-
- if (vres != GNOME_VFS_OK)
- return FALSE;
-
- /* create the new source */
- source = e_source_new (name, base_uri);
- e_source_group_add_source (source_group, source, -1);
-
- /* process subfolders */
- s = g_build_filename (path, "subfolders", NULL);
- dir = g_dir_open (s, 0, NULL);
- if (dir) {
- const char *name, *tmp_s;
-
- while ((name = g_dir_read_name (dir))) {
- tmp_s = g_build_filename (s, name, NULL);
- if (g_file_test (tmp_s, G_FILE_TEST_IS_DIR)) {
- retval = process_old_dir (source_group, tmp_s, filename, name, name);
- }
-
- g_free (tmp_s);
- }
-
- g_dir_close (dir);
- }
-
- g_free (s);
-
- return retval;
-}
-
-gboolean
-migrate_old_calendars (ESourceGroup *source_group)
-{
- char *path;
- gboolean retval;
-
- g_return_val_if_fail (E_IS_SOURCE_GROUP (source_group), FALSE);
-
- path = g_build_filename (g_get_home_dir (), "evolution", NULL);
- if (!g_file_test (path, G_FILE_TEST_IS_DIR)) {
- g_free (path);
- return FALSE;
- }
- g_free (path);
-
- /* look for the top-level calendar */
- path = g_build_filename (g_get_home_dir (), "evolution/local/Calendar", NULL);
- retval = process_old_dir (source_group, path, "calendar.ics", _("Personal"), "Personal");
- g_free (path);
-
- return retval;
-}
-
-gboolean
-migrate_old_tasks (ESourceGroup *source_group)
-{
- char *path;
- gboolean retval;
-
- g_return_val_if_fail (E_IS_SOURCE_GROUP (source_group), FALSE);
-
- path = g_build_filename (g_get_home_dir (), "evolution", NULL);
- if (!g_file_test (path, G_FILE_TEST_IS_DIR)) {
- g_free (path);
- return FALSE;
- }
- g_free (path);
-
- /* look for the top-level calendar */
- path = g_build_filename (g_get_home_dir (), "evolution/local/Tasks", NULL);
- retval = process_old_dir (source_group, path, "tasks.ics", _("Personal"), "Personal");
- g_free (path);
-
- return retval;
-}
diff --git a/calendar/gui/migration.h b/calendar/gui/migration.h
deleted file mode 100644
index b217ae97c8..0000000000
--- a/calendar/gui/migration.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* calendar-component.c
- *
- * Copyright (C) 2003 Ximian, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Rodrigo Moya <rodrigo@ximian.com>
- */
-
-#ifndef MIGRATION_H
-#define MIGRATION_H
-
-#include <libedataserver/e-source-group.h>
-
-gboolean migrate_old_calendars (ESourceGroup *source_group);
-gboolean migrate_old_tasks (ESourceGroup *source_group);
-
-#endif
diff --git a/calendar/gui/misc.c b/calendar/gui/misc.c
deleted file mode 100644
index e286442a89..0000000000
--- a/calendar/gui/misc.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/* Evolution calendar - Miscellaneous utility functions
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Authors: Federico Mena-Quintero <federico@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <ctype.h>
-#include <e-util/e-url.h>
-#include "misc.h"
-
-
-
-/**
- * string_is_empty:
- * @value: A string.
- *
- * Returns whether a string is NULL, the empty string, or completely made up of
- * whitespace characters.
- *
- * Return value: TRUE if the string is empty, FALSE otherwise.
- **/
-gboolean
-string_is_empty (const char *value)
-{
- const char *p;
- gboolean empty;
-
- empty = TRUE;
-
- if (value) {
- p = value;
- while (*p) {
- if (!isspace ((unsigned char) *p)) {
- empty = FALSE;
- break;
- }
- p++;
- }
- }
- return empty;
-
-}
-
-/**
- * get_uri_without_password
- */
-char *
-get_uri_without_password (const char *full_uri)
-{
- EUri *uri;
- char *uristr;
-
- uri = e_uri_new (full_uri);
- if (!uri)
- return NULL;
-
- uristr = e_uri_to_string (uri, FALSE);
- e_uri_free (uri);
-
- return uristr;
- }
diff --git a/calendar/gui/misc.h b/calendar/gui/misc.h
deleted file mode 100644
index d32739f9f5..0000000000
--- a/calendar/gui/misc.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Evolution calendar - Miscellaneous utility functions
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Authors: Federico Mena-Quintero <federico@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef MISC_H
-#define MISC_H
-
-#include <glib.h>
-
-gboolean string_is_empty (const char *value);
-char *get_uri_without_password (const char *uri);
-
-#endif
diff --git a/calendar/gui/print.c b/calendar/gui/print.c
deleted file mode 100644
index 1e647c096b..0000000000
--- a/calendar/gui/print.c
+++ /dev/null
@@ -1,2658 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/* Evolution calendar - Print support
- *
- * Copyright (C) 2000 Ximian, Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- * Federico Mena-Quintero <federico@ximian.com>
- * Damon Chaplin <damon@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-#include <sys/stat.h>
-#include <sys/time.h>
-#include <math.h>
-#include <string.h>
-#include <time.h>
-#include <glib.h>
-#include <gtk/gtkradiobutton.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnomeui/gnome-dialog.h>
-#include <libgnomeui/gnome-uidefs.h>
-#include <libgnomeui/gnome-stock-icons.h>
-#include <libgnomeprint/gnome-print.h>
-#include <libgnomeprint/gnome-print-paper.h>
-#include <libgnomeprint/gnome-print-job.h>
-#include <libgnomeprintui/gnome-print-job-preview.h>
-#include <libgnomeprintui/gnome-print-paper-selector.h>
-#include <libgnomeprintui/gnome-print-preview.h>
-#include <libgnomeprintui/gnome-print-dialog.h>
-#include <gal/util/e-util.h>
-#include <e-util/e-dialog-widgets.h>
-#include <e-util/e-time-utils.h>
-#include <libecal/e-cal-time-util.h>
-#include "calendar-commands.h"
-#include "calendar-config.h"
-#include "e-day-view.h"
-#include "e-day-view-layout.h"
-#include "e-week-view.h"
-#include "e-week-view-layout.h"
-#include "gnome-cal.h"
-#include "print.h"
-
-
-
-/*
- * 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 REGULAR_FONT "Sans Regular"
-#define BOLD_FONT "Sans Bold"
-
-/* 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
-
-/* 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 SMALL_MONTH_WIDTH 80
-#define SMALL_MONTH_PAD 4
-#define SMALL_MONTH_SPACING 12
-
-/* 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 20
-
-/* The minutes per row in the day view printout. */
-#define DAY_VIEW_MINS_PER_ROW 30
-
-#define DAY_VIEW_ROWS ((60 / DAY_VIEW_MINS_PER_ROW) * 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 int 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;
- gint8 cols_per_row[DAY_VIEW_ROWS];
- gboolean use_24_hour_format;
-};
-
-struct psinfo
-{
- gint days_shown;
- time_t day_starts[E_WEEK_VIEW_MAX_WEEKS * 7 + 1];
-
- GArray *events;
-
- int rows_per_cell;
- int rows_per_compressed_cell;
- int display_start_weekday;
- gboolean multi_week_view;
- int weeks_shown;
- int month;
- gboolean compress_weekend;
- gboolean use_24_hour_format;
- double row_height;
- double header_row_height;
-};
-
-struct ptinfo
-{
- GList *todos;
-};
-
-struct einfo
-{
- char *text;
- time_t start;
- time_t end;
- int count;
-};
-
-static GnomePrintConfig *print_config = NULL;
-
-
-/* Convenience function to help the transition to timezone functions.
- It returns the current timezone. */
-static icaltimezone*
-get_timezone (void)
-{
- char *location = calendar_config_get_timezone ();
- return icaltimezone_get_builtin_timezone (location);
-}
-
-
-/* Convenience function to help the transition to timezone functions.
- It converts a time_t to a struct tm. */
-static struct tm*
-convert_timet_to_struct_tm (time_t time, icaltimezone *zone)
-{
- static struct tm my_tm;
- struct icaltimetype tt;
-
- /* Convert it to an icaltimetype. */
- tt = icaltime_from_timet_with_zone (time, FALSE, zone);
-
- /* Fill in the struct tm. */
- my_tm.tm_year = tt.year - 1900;
- my_tm.tm_mon = tt.month - 1;
- my_tm.tm_mday = tt.day;
- my_tm.tm_hour = tt.hour;
- my_tm.tm_min = tt.minute;
- my_tm.tm_sec = tt.second;
- my_tm.tm_isdst = tt.is_daylight;
-
- my_tm.tm_wday = time_day_of_week (tt.day, tt.month - 1, tt.year);
-
- return &my_tm;
-}
-
-
-/* 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 (int month, int year, int *days, int *start, int *end)
-{
- int i;
- int d_month, d_week, 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 (int));
-
- 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, 0=Sun to 6=Sat. */
- week_start_day = calendar_config_get_week_start_day ();
-
- /* Figure out which square we want to put the 1 in. */
- d_week = (d_week + 7 - week_start_day) % 7;
-
- for (i = 0; i < d_month; i++)
- days[d_week + i] = i + 1;
-
- if (start)
- *start = d_week;
-
- if (end)
- *end = d_week + d_month - 1;
-}
-
-static GnomeFont *
-get_font_for_size (double h, GnomeFontWeight weight, gboolean italic)
-{
- GnomeFontFace *face;
- GnomeFont *font;
- double asc, desc, size;
- gchar *font_name;
-
- if (weight <= GNOME_FONT_BOOK)
- font_name = REGULAR_FONT;
- else
- font_name = BOLD_FONT;
-
- if (italic)
- font_name = g_strconcat (font_name, " Italic", NULL);
-
- /* This function is broken in gnome-print (it doesn't find a suitable face).
- * face = gnome_font_face_find_closest_from_weight_slant (DEFAULT_FONT, weight, italic); */
- face = gnome_font_face_find (font_name);
-
- asc = gnome_font_face_get_ascender (face);
- desc = abs (gnome_font_face_get_descender (face));
- size = h * 1000 / (asc + desc);
-
- /* This function is broken in gnome-print (it doesn't find a suitable font).
- * font = gnome_font_find_closest_from_weight_slant (DEFAULT_FONT, weight, italic, size); */
- font = gnome_font_find_closest (font_name, size);
-
- g_object_unref (face);
- if (italic)
- g_free (font_name);
- return font;
-}
-
-enum align_box {
- ALIGN_LEFT=1,
- ALIGN_RIGHT,
- ALIGN_CENTER,
- ALIGN_BORDER= 1<<8
-};
-
-
-/* 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.
- fillcolor = shade of 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 (GnomePrintContext *pc,
- double l, double r, double t, double b,
- double width, double fillcolor,
- double left_triangle_width,
- double right_triangle_width)
-{
- gnome_print_gsave (pc);
-
- /* Fill in the interior of the rectangle, if desired. */
- if (fillcolor >= -EPSILON) {
- gnome_print_moveto (pc, l, t);
- if (left_triangle_width > 0.0)
- gnome_print_lineto (pc, l - left_triangle_width,
- (t + b) / 2);
- gnome_print_lineto (pc, l, b);
- gnome_print_lineto (pc, r, b);
- if (right_triangle_width > 0.0)
- gnome_print_lineto (pc, r + right_triangle_width,
- (t + b) / 2);
- gnome_print_lineto (pc, r, t);
- gnome_print_closepath (pc);
- gnome_print_setrgbcolor (pc, fillcolor, fillcolor,
- fillcolor);
- gnome_print_fill (pc);
- }
-
- /* Draw the outline, if desired. */
- if (width >= -EPSILON) {
- gnome_print_moveto (pc, l, t);
- if (left_triangle_width > 0.0)
- gnome_print_lineto (pc, l - left_triangle_width,
- (t + b) / 2);
- gnome_print_lineto (pc, l, b);
- gnome_print_lineto (pc, r, b);
- if (right_triangle_width > 0.0)
- gnome_print_lineto (pc, r + right_triangle_width,
- (t + b) / 2);
- gnome_print_lineto (pc, r, t);
- gnome_print_closepath (pc);
- gnome_print_setrgbcolor (pc, 0, 0, 0);
- gnome_print_setlinewidth (pc, width);
- gnome_print_stroke (pc);
- }
-
- gnome_print_grestore (pc);
-}
-
-
-/* Prints a rectangle, with or without a border, and filled or outline.
- width = width of border, -ve means no border.
- fillcolor = shade of fill, -ve means no fill. */
-static void
-print_border (GnomePrintContext *pc,
- double l, double r, double t, double b,
- double width, double fillcolor)
-{
- print_border_with_triangles (pc, l, r, t, b, width, fillcolor,
- -1.0, -1.0);
-}
-
-
-/* Prints 1 line of aligned text in a box. It is centered vertically, and
- the horizontal alignment can be either ALIGN_LEFT, ALIGN_RIGHT, or
- ALIGN_CENTER. */
-static void
-print_text(GnomePrintContext *pc, GnomeFont *font, const char *text,
- enum align_box align, double l, double r, double t, double b)
-{
- double w, x, y;
-
- gnome_print_gsave (pc);
-
- w = gnome_font_get_width_utf8 (font, text);
-
- switch (align & 3) {
- case ALIGN_LEFT:
- default:
- x = l;
- break;
- case ALIGN_RIGHT:
- x = r - w;
- break;
- case ALIGN_CENTER:
- x = l + ((r - l) - w) / 2;
- break;
- }
-
- /* Make sure we don't go off the left edge. */
- x = MAX (l, x);
-
- /* Now calculate the baseline. */
- y = t - gnome_font_get_ascender (font);
-
- /* Set a clipping rectangle. */
- gnome_print_moveto (pc, l, t);
- gnome_print_lineto (pc, r, t);
- gnome_print_lineto (pc, r, b);
- gnome_print_lineto (pc, l, b);
- gnome_print_closepath (pc);
- gnome_print_clip (pc);
-
- gnome_print_newpath (pc);
- gnome_print_moveto (pc, x, y);
- gnome_print_setfont (pc, font);
- gnome_print_setrgbcolor (pc, 0, 0, 0);
- gnome_print_show (pc, text);
-
- gnome_print_grestore (pc);
-}
-
-/* gets/frees the font for you, as a book font */
-static void
-print_text_size(GnomePrintContext *pc, const char *text,
- enum align_box align, double l, double r, double t, double b)
-{
- GnomeFont *font;
-
- font = get_font_for_size (t - b, GNOME_FONT_BOOK, FALSE);
- print_text(pc, font, text, align, l, r, t, b);
- g_object_unref (font);
-}
-
-/* gets/frees the font for you, as a bold font */
-static void
-print_text_size_bold(GnomePrintContext *pc, const char *text,
- enum align_box align, double l, double r, double t, double b)
-{
- GnomeFont *font;
-
- font = get_font_for_size (t - b, GNOME_FONT_BOLD, FALSE);
- print_text(pc, font, text, align, l, r, t, b);
- g_object_unref (font);
-}
-
-static void
-titled_box (GnomePrintContext *pc, const char *text, GnomeFont *font,
- enum align_box align, double *l, double *r, double *t, double *b,
- double linewidth)
-{
- double size;
-
- size = gnome_font_get_size (font);
-
- if (align & ALIGN_BORDER) {
- print_border (pc, *l, *r, *t, *t - size * 1.4,
- linewidth, 0.9);
- print_border (pc, *l, *r, *t - size * 1.4, *b,
- linewidth, -1.0);
-
- *l += 2;
- *r -= 2;
- *b += 2;
- }
-
- print_text (pc, font, text, align, *l, *r, *t, *t - size * 1.4);
- *t -= size * 1.4;
-}
-
-enum datefmt {
- DATE_MONTH = 1 << 0,
- DATE_DAY = 1 << 1,
- DATE_DAYNAME = 1 << 2,
- DATE_YEAR = 1 << 3
-};
-
-static char *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 char *
-format_date(time_t time, int flags, char *buffer, int bufflen)
-{
- icaltimezone *zone = get_timezone ();
- char fmt[64];
- struct tm tm;
-
- tm = *convert_timet_to_struct_tm (time, zone);
-
- fmt[0] = 0;
- if (flags & DATE_DAYNAME) {
- strcat(fmt, "%A");
- }
- if (flags & DATE_DAY) {
- if (flags & DATE_DAYNAME)
- strcat(fmt, " ");
- strcat(fmt, gettext(days[tm.tm_mday-1]));
- }
- if (flags & DATE_MONTH) {
- if (flags & (DATE_DAY|DATE_DAYNAME))
- strcat(fmt, " ");
- strcat(fmt, "%B");
- if ((flags & (DATE_DAY|DATE_YEAR)) == (DATE_DAY|DATE_YEAR))
- strcat(fmt, ",");
- }
- if (flags & DATE_YEAR) {
- if (flags & (DATE_DAY|DATE_DAYNAME|DATE_MONTH))
- strcat(fmt, " ");
- strcat(fmt, "%Y");
- }
- e_utf8_strftime(buffer, bufflen, fmt, &tm);
- buffer[bufflen - 1] = '\0';
-
- return buffer;
-}
-
-static gboolean
-instance_cb (ECalComponent *comp, time_t instance_start, time_t instance_end, gpointer data)
-{
- gboolean *found = data;
-
- *found = TRUE;
-
- return FALSE;
-}
-
-
-/*
- print out the month small, embolden any days with events.
-*/
-static void
-print_month_small (GnomePrintContext *pc, GnomeCalendar *gcal, time_t month,
- double left, double right, double top, double bottom,
- int titleflags, time_t greystart, time_t greyend,
- int bordertitle)
-{
- icaltimezone *zone = get_timezone ();
- ECal *client;
- GnomeFont *font, *font_bold, *font_normal;
- time_t now, next;
- int x, y;
- int days[42];
- int day, weekday, week_start_day;
- char buf[100];
- struct tm tm;
- double font_size, max_font_size;
- double header_size, col_width, row_height, text_xpad, w;
- double cell_top, cell_bottom, cell_left, cell_right, text_right;
- char *daynames[] = { N_("Su"), N_("Mo"), N_("Tu"), N_("We"),
- N_("Th"), N_("Fr"), N_("Sa") };
-
- /* Print the title, e.g. 'June 2001', in the top 16% of the area. */
- format_date (month, titleflags, buf, 100);
- header_size = (top - bottom) * 0.16;
- font = get_font_for_size (header_size, GNOME_FONT_BOLD, FALSE);
- if (bordertitle) {
- print_border (pc, left, right, top, top - header_size,
- 1.0, 0.9);
- }
- print_text (pc, font, buf, ALIGN_CENTER, left, right,
- top, top - header_size);
- g_object_unref (font);
-
- top -= header_size;
-
- client = gnome_calendar_get_default_client (gcal);
-
- col_width = (right - left) / 7;
-
- /* The top row with the day abbreviations gets an extra bit of
- vertical space around it. */
- row_height = (top - bottom) / 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;
-
- /* Check that it isn't going to be too wide. The characters are about
- twice as high as they are wide, but we need to fit two characters
- into each cell, so we don't want to go over col_width. */
- max_font_size = col_width * 0.65;
-
- font_size = row_height;
-
- /* get month days */
- tm = *convert_timet_to_struct_tm (month, zone);
- build_month (tm.tm_mon, tm.tm_year + 1900, days, 0, 0);
-
- font_normal = get_font_for_size (font_size, GNOME_FONT_BOOK, FALSE);
- font_bold = get_font_for_size (font_size, GNOME_FONT_BOLD, FALSE);
-
- /* 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 = gnome_font_get_width_utf8 (font_bold, "23");
- text_xpad = (col_width - w) / 2;
-
- gnome_print_setrgbcolor (pc, 0, 0, 0);
-
- /* Print the abbreviated day names across the top in bold. */
- week_start_day = calendar_config_get_week_start_day ();
- weekday = week_start_day;
- for (x = 0; x < 7; x++) {
- print_text (pc, font_bold, _(daynames[weekday]), ALIGN_CENTER,
- left + x * col_width, left + (x + 1) * col_width,
- top, top - row_height * 1.4);
- weekday = (weekday + 1) % 7;
- }
-
- top -= row_height * 1.4;
-
- now = time_month_begin_with_zone (month, zone);
- for (y = 0; y < 6; y++) {
-
- cell_top = top - y * row_height;
- cell_bottom = cell_top - row_height;
-
- for (x = 0; x < 7; x++) {
-
- cell_left = left + x * 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_generate_instances (client, now, CALOBJ_TYPE_EVENT,
- 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 (pc,
- cell_left, cell_right,
- cell_top, cell_bottom,
- -1.0, 0.75);
- }
- print_text (pc, font, buf, ALIGN_RIGHT,
- cell_left, text_right,
- cell_top, cell_bottom);
-
- now = next;
- }
- }
- }
- g_object_unref (font_normal);
- g_object_unref (font_bold);
-}
-
-
-
-/* wraps text into the print context, not taking up more than its allowed space */
-static double
-bound_text(GnomePrintContext *pc, GnomeFont *font, const char *text,
- double left, double right, double top, double bottom, double indent)
-{
- double maxwidth = right-left;
- double width;
- const char *p;
- char *wordstart;
- int c;
- char *outbuffer, *o, *outbuffendmarker;
- int outbufflen;
- int dump=0;
- int first=1;
-
- g_return_val_if_fail(text!=NULL, top);
-
- if (top<bottom) {
- /* too much to fit in appointment printout */
- return top;
- }
-
- outbufflen = 1024;
- outbuffer = g_malloc(outbufflen);
- outbuffendmarker = outbuffer+outbufflen-2;
-
- top -= gnome_font_get_size (font);
- gnome_print_setfont (pc, font);
-
- width=0;
- p = text;
- wordstart = outbuffer;
- o = outbuffer;
- while ((c=*p)) {
- if (c=='\n') {
- wordstart=o;
- dump=1;
- } else {
- /* grow output buffer if required */
- if (o>=outbuffendmarker) {
- char *newbuf;
- outbufflen*=2;
- newbuf = g_realloc(outbuffer, outbufflen);
- o = newbuf+(o-outbuffer);
- wordstart = newbuf+(o-outbuffer);
- outbuffer = newbuf;
- outbuffendmarker = outbuffer+outbufflen-2;
- }
- *o++=c;
- if (c==' ')
- wordstart = o;
- width+=gnome_font_get_glyph_width(font, gnome_font_lookup_default (font, c));
- if (width>maxwidth)
- dump=1;
- else
- dump=0;
- }
- if (dump) {
- if (wordstart==outbuffer)
- wordstart=o;
- c=*wordstart;
- *wordstart=0;
- gnome_print_moveto(pc, left, top);
- gnome_print_show(pc, outbuffer);
- *wordstart=c;
- memcpy(outbuffer, wordstart, o-wordstart);
- width = gnome_font_get_width_utf8_sized(font, outbuffer, o-wordstart);
- o=outbuffer+(o-wordstart);
- wordstart = outbuffer;
- top -= gnome_font_get_size (font);
- if (top<bottom) {
- /* too much to fit, drop the rest */
- g_free(outbuffer);
- return top;
- }
- if (first) {
- left += indent;
- maxwidth -= indent;
- first=0;
- }
- }
- p++;
- }
- if (dump==0) {
- *o=0;
- gnome_print_moveto(pc, left, top);
- gnome_print_show(pc, outbuffer);
- top -= gnome_font_get_size (font);
- }
- g_free(outbuffer);
- return top;
-}
-
-
-/* Draw the borders, lines, and times down the left of the day view. */
-static void
-print_day_background (GnomePrintContext *pc, GnomeCalendar *gcal,
- time_t whence, struct pdinfo *pdi,
- double left, double right, double top, double bottom)
-{
- GnomeFont *font_hour, *font_minute;
- double yinc, y;
- double width = DAY_VIEW_TIME_COLUMN_WIDTH;
- double font_size, max_font_size, hour_font_size, minute_font_size;
- char buf[20];
- const char *minute;
- gboolean use_24_hour;
- int i, hour, row;
-
- /* Fill the time column in light-gray. */
- print_border (pc, left, left + width, top, bottom, -1.0, 0.9);
-
- /* Draw the border around the entire view. */
- gnome_print_setrgbcolor (pc, 0, 0, 0);
- print_border (pc, left, right, top, bottom, 1.0, -1.0);
-
- /* Draw the vertical line on the right of the time column. */
- gnome_print_setlinewidth (pc, 0.0);
- gnome_print_moveto (pc, left + width, bottom);
- gnome_print_lineto (pc, left + width, top);
- gnome_print_stroke (pc);
-
- /* Calculate the row height. */
- yinc = (top - bottom) / (pdi->end_hour - pdi->start_hour);
-
- /* Get the 2 fonts we need. */
- font_size = yinc * 0.6;
- max_font_size = width * 0.5;
- hour_font_size = MIN (font_size, max_font_size);
- font_hour = get_font_for_size (hour_font_size, GNOME_FONT_BOLD, FALSE);
-
- font_size = yinc * 0.33;
- max_font_size = width * 0.25;
- minute_font_size = MIN (font_size, max_font_size);
- font_minute = get_font_for_size (minute_font_size, GNOME_FONT_BOLD, FALSE);
-
- use_24_hour = calendar_config_get_24_hour_format ();
-
- row = 0;
- for (i = pdi->start_hour; i < pdi->end_hour; i++) {
- y = top - yinc * (row + 1);
- gnome_print_setrgbcolor (pc, 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 (pc, font_hour, buf, ALIGN_RIGHT,
- left, left + width * 0.58,
- y + yinc - 4, y + yinc - 4 - hour_font_size);
- print_text (pc, font_minute, minute, ALIGN_RIGHT,
- left, left + width - 3,
- y + yinc - 3, y + yinc - 3 - minute_font_size);
-
- /* Draw the horizontal line between hours, across the entire
- width of the day view. */
- gnome_print_moveto (pc, left, y);
- gnome_print_lineto (pc, right, y);
- gnome_print_stroke (pc);
-
- /* Draw the horizontal line for the 1/2-hours, across the
- entire width except for part of the time column. */
- gnome_print_moveto (pc, left + width * 0.6, y + yinc / 2);
- gnome_print_lineto (pc, right, y + yinc / 2);
- gnome_print_stroke (pc);
-
- row++;
- }
-
- g_object_unref (font_hour);
- g_object_unref (font_minute);
-}
-
-
-/* This adds one event to the view, adding it to the appropriate array. */
-static gint
-print_day_add_event (ECalComponent *comp,
- time_t start,
- time_t end,
- gint days_shown,
- time_t *day_starts,
- GArray *long_events,
- GArray **events)
-
-{
-/* icaltimezone *zone = get_timezone (); */
-/* 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 = comp; */
-/* g_object_ref (comp); */
-/* 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)
-{
- struct pdinfo *pdi = (struct pdinfo *)data;
-
- print_day_add_event (comp, istart, iend,
- 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)
- gtk_object_destroy (GTK_OBJECT (event->canvas_item));
- }
-
- g_array_set_size (array, 0);
-}
-
-
-static void
-print_day_long_event (GnomePrintContext *pc, GnomeFont *font,
- double left, double right, double top, double bottom,
- double row_height, EDayViewEvent *event,
- struct pdinfo *pdi)
-{
- const gchar *summary;
- double x1, x2, y1, y2;
- double left_triangle_width = -1.0, right_triangle_width = -1.0;
- char *text;
- char buffer[32];
- struct tm date_tm;
-
- /* 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 - 4;
- y2 = y1 - row_height + 4;
- print_border_with_triangles (pc, x1, x2, y1, y2, 0.5, 0.95,
- 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;
- print_text (pc, font, buffer, ALIGN_LEFT, x1, x2, y1, y2);
- x1 += gnome_font_get_width_utf8 (font, buffer);
- }
-
- /* 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;
- print_text (pc, font, buffer, ALIGN_RIGHT, x1, x2, y1, y2);
- x2 -= gnome_font_get_width_utf8 (font, buffer);
- }
-
- /* Print the text. */
- summary = icalcomponent_get_summary (event->comp_data->icalcomp);
- text = summary ? (char*) summary : "";
-
- x1 += 4;
- x2 -= 4;
- print_text (pc, font, text, ALIGN_CENTER, x1, x2, y1, y2);
-}
-
-
-static void
-print_day_event (GnomePrintContext *pc, GnomeFont *font,
- double left, double right, double top, double bottom,
- EDayViewEvent *event, struct pdinfo *pdi)
-{
- const gchar *summary;
- double x1, x2, y1, y2, col_width, row_height;
- int start_offset, end_offset, start_row, end_row;
- char *text, start_buffer[32], end_buffer[32];
- gboolean display_times = FALSE, free_text = FALSE;
- struct tm date_tm;
-
- 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 = (top - bottom) / 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
-
- print_border (pc, x1, x2, y1, y2, 1.0, 0.95);
-
- summary = icalcomponent_get_summary (event->comp_data->icalcomp);
- text = summary ? (char*) summary : "";
-
-
- if (display_times) {
- 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));
-
- text = g_strdup_printf ("%s - %s %s ", start_buffer,
- end_buffer, text);
-
- free_text = TRUE;
- }
-
- bound_text (pc, font, text, x1 + 2, x2 - 2, y1, y2, 0);
-
- if (free_text)
- g_free (text);
-}
-
-
-static void
-print_day_details (GnomePrintContext *pc, GnomeCalendar *gcal, time_t whence,
- double left, double right, double top, double bottom)
-{
- icaltimezone *zone = get_timezone ();
- ECal *client;
- EDayViewEvent *event;
- GnomeFont *font;
- time_t start, end;
- struct pdinfo pdi;
- gint rows_in_top_display, i;
- double font_size, max_font_size;
-
- 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 = calendar_config_get_day_start_hour ();
- pdi.end_hour = calendar_config_get_day_end_hour ();
- if (calendar_config_get_day_end_minute () != 0)
- pdi.end_hour++;
- pdi.rows = (pdi.end_hour - pdi.start_hour) * 2;
- pdi.mins_per_row = 30;
- pdi.start_minute_offset = pdi.start_hour * 60;
- pdi.end_minute_offset = pdi.end_hour * 60;
- pdi.use_24_hour_format = calendar_config_get_24_hour_format ();
-
- /* Get the events from the server. */
- client = gnome_calendar_get_default_client (gcal);
- e_cal_generate_instances (client, CALOBJ_TYPE_EVENT, 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) {
- icaltimezone *zone = get_timezone ();
- 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) * 2;
- }
-
- /* 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, GNOME_FONT_BOOK, FALSE);
- for (i = 0; i < pdi.long_events->len; i++) {
- event = &g_array_index (pdi.long_events, EDayViewEvent, i);
- print_day_long_event (pc, font, left, right, top, bottom,
- DAY_VIEW_ROW_HEIGHT, event, &pdi);
- }
- g_object_unref (font);
-
- /* 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. */
- rows_in_top_display = MAX (rows_in_top_display,
- DAY_VIEW_MIN_ROWS_IN_TOP_DISPLAY);
-
- /* Draw the border around the long events. */
- gnome_print_setrgbcolor (pc, 0, 0, 0);
- print_border (pc, left, right,
- top, top - rows_in_top_display * DAY_VIEW_ROW_HEIGHT - 4,
- 1.0, -1.0);
-
- /* Adjust the area containing the main display. */
- top -= rows_in_top_display * DAY_VIEW_ROW_HEIGHT + 4;
-
- /* Draw the borders, lines, and times down the left. */
- print_day_background (pc, gcal, 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], DAY_VIEW_ROWS,
- DAY_VIEW_MINS_PER_ROW, pdi.cols_per_row);
-
- /* Print the short events. */
- max_font_size = ((top - bottom) / pdi.rows) - 4;
- font_size = MIN (DAY_NORMAL_FONT_SIZE, max_font_size);
- font = get_font_for_size (font_size, GNOME_FONT_BOOK, FALSE);
- for (i = 0; i < pdi.events[0]->len; i++) {
- event = &g_array_index (pdi.events[0], EDayViewEvent, i);
- print_day_event (pc, font, left, right, top, bottom,
- event, &pdi);
- }
- g_object_unref (font);
-
- /* Free everything. */
- free_event_array (pdi.long_events);
- g_array_free (pdi.long_events, TRUE);
- free_event_array (pdi.events[0]);
- g_array_free (pdi.events[0], 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)
-
-{
-/* icaltimezone *zone = get_timezone (); */
-/* EWeekViewEvent event; */
-/* struct icaltimetype start_tt, end_tt; */
-
-/* struct psinfo *psi = (struct psinfo *)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, zone); */
-/* end_tt = icaltime_from_timet_with_zone (end, FALSE, zone); */
-
-/* event.comp = comp; */
-/* g_object_ref (event.comp); */
-/* 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;
-}
-
-
-/* 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 (GnomePrintContext *pc, GnomeFont *font,
- struct psinfo *psi,
- double x1, double x2, double y1, double y2,
- EWeekViewEvent *event, EWeekViewEventSpan *span,
- char *text)
-{
- double left_triangle_width = -1.0, right_triangle_width = -1.0;
- struct tm date_tm;
- char 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 (pc, x1, x2, y1, y2, 0.5, 0.9,
- 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 > 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 += 4;
- print_text_size (pc, buffer, ALIGN_LEFT, x1, x2, y1, y2);
- x1 += gnome_font_get_width_utf8 (font, buffer);
- }
-
- /* 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 -= 4;
- print_text_size (pc, buffer, ALIGN_RIGHT, x1, x2, y1, y2);
- x2 -= gnome_font_get_width_utf8 (font, buffer);
- }
-
- x1 += 4;
- x2 -= 4;
- print_text_size (pc, text, ALIGN_CENTER, x1, x2, y1, y2);
-}
-
-
-static void
-print_week_day_event (GnomePrintContext *pc, GnomeFont *font,
- struct psinfo *psi,
- double x1, double x2, double y1, double y2,
- EWeekViewEvent *event, EWeekViewEventSpan *span,
- char *text)
-{
- struct tm date_tm;
- char 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_text_size (pc, buffer, ALIGN_LEFT, x1, x2, y1, y2);
- x1 += gnome_font_get_width_utf8 (font, buffer);
-
- x1 += 4;
- print_text_size (pc, text, ALIGN_LEFT, x1, x2, y1, y2);
-}
-
-
-static void
-print_week_event (GnomePrintContext *pc, GnomeFont *font,
- struct psinfo *psi,
- double left, double top,
- double cell_width, double cell_height,
- EWeekViewEvent *event, GArray *spans)
-{
- EWeekViewEventSpan *span;
- gint span_num;
- const gchar *summary;
- char *text;
- int num_days, start_x, start_y, start_h, end_x, end_y, end_h;
- double x1, x2, y1, y2;
-
- summary = icalcomponent_get_summary (event->comp_data->icalcomp);
- text = summary ? (char*) summary : "";
-
- 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 + 6;
- x2 = left + (end_x + 1) * cell_width - 6;
- y1 = top - start_y * cell_height
- - psi->header_row_height
- - span->row * psi->row_height;
- y2 = y1 - psi->row_height * 0.9;
-
- if (print_is_one_day_week_event (event, span,
- psi->day_starts)) {
- print_week_day_event (pc, font, psi,
- x1, x2, y1, y2,
- event, span, text);
- } else {
- print_week_long_event (pc, font, psi,
- x1, x2, y1, y2,
- event, span, text);
- }
- }
- }
-}
-
-
-static void
-print_week_view_background (GnomePrintContext *pc, GnomeFont *font,
- struct psinfo *psi,
- double left, double top,
- double cell_width, double cell_height)
-{
- icaltimezone *zone = get_timezone ();
- int day, day_x, day_y, day_h;
- double x1, x2, y1, y2, font_size, fillcolor;
- struct tm tm;
- char *format_string, buffer[128];
-
- font_size = gnome_font_get_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;
-
- tm = *convert_timet_to_struct_tm (psi->day_starts[day], zone);
-
- /* 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 (pc, 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 {
- gnome_print_moveto (pc, x1 + 0.1 * cell_width,
- y1 - psi->header_row_height + 3);
- gnome_print_lineto (pc, x2,
- y1 - psi->header_row_height + 3);
- gnome_print_setrgbcolor (pc, 0, 0, 0);
- gnome_print_setlinewidth (pc, 0.5);
- gnome_print_stroke (pc);
-
- /* 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_size (pc, buffer, ALIGN_RIGHT,
- x1, x2 - 4, y1 - 2, y1 - 2 - font_size);
- }
-}
-
-
-
-static void
-print_week_summary (GnomePrintContext *pc, GnomeCalendar *gcal,
- time_t whence, gboolean multi_week_view, int weeks_shown,
- int month, double font_size,
- double left, double right, double top, double bottom)
-{
- icaltimezone *zone = get_timezone ();
- ECal *client;
- EWeekViewEvent *event;
- struct psinfo psi;
- time_t day_start;
- gint rows_per_day[E_WEEK_VIEW_MAX_WEEKS * 7], day, event_num;
- GArray *spans;
- GnomeFont *font;
- double cell_width, cell_height;
-
- 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;
-
- /* Get a few config settings. */
- if (multi_week_view)
- psi.compress_weekend = calendar_config_get_compress_weekend ();
- else
- psi.compress_weekend = TRUE;
- psi.use_24_hour_format = calendar_config_get_24_hour_format ();
-
- /* We convert this from (0 = Sun, 6 = Sat) to (0 = Mon, 6 = Sun). */
- psi.display_start_weekday = calendar_config_get_week_start_day ();
- psi.display_start_weekday = (psi.display_start_weekday + 6) % 7;
-
- /* If weekends are compressed then we can't start on a Sunday. */
- if (psi.compress_weekend && psi.display_start_weekday == 6)
- psi.display_start_weekday = 5;
-
- 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. */
- client = gnome_calendar_get_default_client (gcal);
- e_cal_generate_instances (client, CALOBJ_TYPE_EVENT,
- 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 = (top - bottom) / (weeks_shown * 2);
- } else {
- cell_width = (right - left) / 2;
- cell_height = (top - bottom) / 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;
- psi.rows_per_compressed_cell = (cell_height - psi.header_row_height)
- / psi.row_height;
-
- font = get_font_for_size (font_size, GNOME_FONT_BOOK, FALSE);
-
- /* Draw the grid and the day names/numbers. */
- print_week_view_background (pc, font, &psi, left, top,
- cell_width, cell_height);
-
- /* Print the events. */
- for (event_num = 0; event_num < psi.events->len; event_num++) {
- event = &g_array_index (psi.events, EWeekViewEvent, event_num);
- print_week_event (pc, font, &psi, left, top,
- cell_width, cell_height, event, spans);
- }
-
- g_object_unref (font);
-
- /* Free everything. */
- for (event_num = 0; event_num < psi.events->len; event_num++) {
- event = &g_array_index (psi.events, EWeekViewEvent, event_num);
- }
- g_array_free (psi.events, TRUE);
- g_array_free (spans, TRUE);
-}
-
-
-static void
-print_year_summary (GnomePrintContext *pc, GnomeCalendar *gcal, time_t whence,
- double left, double right, double top, double bottom,
- int morerows)
-{
- icaltimezone *zone = get_timezone ();
- double row_height, col_width, l, r, t, b;
- time_t now;
- int col, row, rows, cols;
-
- l = left;
- t = top;
-
- /* If morerows is set we do 4 rows and 3 columns instead of 3 rows and
- 4 columns. This is useful if we switch paper orientation. */
- if (morerows) {
- rows = 4;
- cols = 3;
- } else {
- rows = 3;
- cols = 4;
- }
-
- row_height = (top - bottom) / rows;
- col_width = (right - left) / cols;
- r = l + col_width;
- b = top - row_height;
- now = time_year_begin_with_zone (whence, zone);
-
- for (row = 0; row < rows; row++) {
- t = top - row_height * row;
- b = t - row_height;
- for (col = 0; col < cols; col++) {
- l = left + col_width * col;
- r = l + col_width;
- print_month_small (pc, gcal, now,
- l + 8, r - 8, t - 8, b + 8,
- DATE_MONTH, 0, 0, TRUE);
- now = time_add_month_with_zone (now, 1, zone);
- }
- }
-}
-
-static void
-print_month_summary (GnomePrintContext *pc, GnomeCalendar *gcal, time_t whence,
- double left, double right, double top, double bottom)
-{
- icaltimezone *zone = get_timezone ();
- time_t date;
- struct tm tm;
- struct icaltimetype tt;
- char buffer[100];
- GnomeFont *font;
- gboolean compress_weekend;
- int columns, col, weekday, len, month;
- double font_size, cell_width, x1, x2, y1, y2;
-
- weekday = calendar_config_get_week_start_day ();
- compress_weekend = calendar_config_get_compress_weekend ();
-
- /* 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. */
- date = time_month_begin_with_zone (whence, zone);
- date = time_week_begin_with_zone (date, weekday, zone);
-
- /* If weekends are compressed then we can't start on a Sunday. */
- if (compress_weekend && weekday == 0)
- 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. */
- tm = *convert_timet_to_struct_tm (date, zone);
- tm.tm_mday = (tm.tm_mday % 7) + 7;
-
- font = get_font_for_size (MONTH_NORMAL_FONT_SIZE, GNOME_FONT_BOLD, FALSE);
- font_size = gnome_font_get_size (font);
- gnome_print_setfont (pc, 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) {
- e_utf8_strftime (buffer, sizeof (buffer), "%a/", &tm);
- len = strlen (buffer);
- tm.tm_mday++;
- tm.tm_wday = (tm.tm_wday + 1) % 7;
- e_utf8_strftime (buffer + len, sizeof (buffer) - len,
- "%a", &tm);
- } else {
- e_utf8_strftime (buffer, sizeof (buffer), "%A", &tm);
- }
-
- x1 = left + cell_width * col;
- x2 = x1 + cell_width;
-
- print_border (pc, x1, x2, y1, y2, 1.0, -1.0);
- print_text_size (pc, buffer, ALIGN_CENTER, x1, x2, y1, y2);
-
- tm.tm_mday++;
- tm.tm_wday = (tm.tm_wday + 1) % 7;
- }
- g_object_unref (font);
-
- top = y2;
- print_week_summary (pc, gcal, date, TRUE, 6, month,
- MONTH_NORMAL_FONT_SIZE,
- left, right, top, bottom);
-}
-
-
-static void
-print_todo_details (GnomePrintContext *pc, GnomeCalendar *gcal,
- time_t start, time_t end,
- double left, double right, double top, double bottom)
-{
- ECal *client;
- GnomeFont *font_summary;
- double y, yend, x, xend;
- struct icaltimetype *tt;
- ECalendarTable *task_pad;
- ETable *table;
- ECalModel *model;
- gint rows, row;
-
- /* We get the tasks directly from the TaskPad ETable. This means we
- get them filtered & sorted for free. */
- task_pad = gnome_calendar_get_task_pad (gcal);
- table = e_calendar_table_get_table (task_pad);
- model = e_calendar_table_get_model (task_pad);
- client = gnome_calendar_get_task_pad_e_cal (gcal);
-
- font_summary = get_font_for_size (10, GNOME_FONT_BOOK, FALSE);
-
- gnome_print_setrgbcolor (pc, 0, 0, 0);
- gnome_print_setlinewidth (pc, 0.0);
-
- titled_box (pc, _("Tasks"), font_summary, ALIGN_CENTER | ALIGN_BORDER,
- &left, &right, &top, &bottom, 1.0);
-
- y = top - 3;
- 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;
- int model_row;
-
- model_row = e_table_view_to_model_row (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)
- break;
-
- /* Print the box to put the tick in. */
- print_border (pc, x + 2, x + 8, y - 3, y - 11, 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);
-
- gnome_print_setrgbcolor (pc, 0, 0, 0);
- gnome_print_setlinewidth (pc, 1.0);
- gnome_print_moveto (pc, x + 3, y - 8);
- gnome_print_lineto (pc, x + 5, y - 10);
- gnome_print_lineto (pc, x + 7, y - 3.5);
- gnome_print_stroke (pc);
- }
-
- y = bound_text (pc, font_summary, summary.value,
- x + 10, xend, y, yend, 0);
- y += gnome_font_get_size (font_summary) - 6;
- gnome_print_moveto (pc, x, y);
- gnome_print_lineto (pc, xend, y);
- gnome_print_stroke (pc);
- y -= 3;
-
- g_object_unref (comp);
- }
-
- g_object_unref (font_summary);
-}
-
-
-/* Value for the PrintView enum */
-static const int print_view_map[] = {
- PRINT_VIEW_DAY,
- PRINT_VIEW_WEEK,
- PRINT_VIEW_MONTH,
- PRINT_VIEW_YEAR,
- -1
-};
-
-/* Creates the range selector widget for printing a calendar */
-static GtkWidget *
-range_selector_new (GtkWidget *dialog, time_t at, int *view)
-{
- icaltimezone *zone = get_timezone ();
- GtkWidget *box;
- GtkWidget *radio;
- GSList *group;
- char text[1024];
- char str1[512];
- char str2[512];
- struct tm tm;
- time_t week_begin, week_end;
- struct tm week_begin_tm, week_end_tm;
- gint week_start_day;
-
- box = gtk_vbox_new (FALSE, GNOME_PAD_SMALL);
-
- tm = *convert_timet_to_struct_tm (at, zone);
-
- /* Day */
-
- e_utf8_strftime (text, sizeof (text), _("Selected day (%a %b %d %Y)"), &tm);
- radio = gtk_radio_button_new_with_label (NULL, text);
- group = gtk_radio_button_group (GTK_RADIO_BUTTON (radio));
- gtk_box_pack_start (GTK_BOX (box), radio, FALSE, FALSE, 0);
-
- /* Week */
-
- week_start_day = calendar_config_get_week_start_day ();
- week_begin = time_week_begin_with_zone (at, week_start_day, zone);
- /* If the week starts on a Sunday, we have to show the Saturday first,
- since the weekend is compressed. If the original date passed in was
- a Saturday, we need to move on to the next Saturday, else we move
- back to the last one. */
- if (week_start_day == 0) {
- if (tm.tm_wday == 6)
- week_begin = time_add_day_with_zone (week_begin, 6, zone);
- else
- week_begin = time_add_day_with_zone (week_begin, -1, zone);
- }
- week_end = time_add_day_with_zone (week_begin, 6, zone);
-
- week_begin_tm = *convert_timet_to_struct_tm (week_begin, zone);
- week_end_tm = *convert_timet_to_struct_tm (week_end, zone);
-
- if (week_begin_tm.tm_mon == week_end_tm.tm_mon) {
- e_utf8_strftime (str1, sizeof (str1), _("%a %b %d"), &week_begin_tm);
- e_utf8_strftime (str2, sizeof (str2), _("%a %d %Y"), &week_end_tm);
- } else {
- if (week_begin_tm.tm_year == week_end_tm.tm_year) {
- e_utf8_strftime (str1, sizeof (str1), _("%a %b %d"), &week_begin_tm);
- e_utf8_strftime (str2, sizeof (str2), _("%a %b %d %Y"), &week_end_tm);
- } else {
- e_utf8_strftime (str1, sizeof (str1), _("%a %b %d %Y"), &week_begin_tm);
- e_utf8_strftime (str2, sizeof (str2), _("%a %b %d %Y"), &week_end_tm);
- }
- }
-
- g_snprintf (text, sizeof (text), _("Selected week (%s - %s)"), str1, str2);
-
- radio = gtk_radio_button_new_with_label (group, text);
- group = gtk_radio_button_group (GTK_RADIO_BUTTON (radio));
- gtk_box_pack_start (GTK_BOX (box), radio, FALSE, FALSE, 0);
-
- /* Month */
-
- e_utf8_strftime (text, sizeof (text), _("Selected month (%b %Y)"), &tm);
- radio = gtk_radio_button_new_with_label (group, text);
- group = gtk_radio_button_group (GTK_RADIO_BUTTON (radio));
- gtk_box_pack_start (GTK_BOX (box), radio, FALSE, FALSE, 0);
-
- /* Year */
-
- e_utf8_strftime (text, sizeof (text), _("Selected year (%Y)"), &tm);
- radio = gtk_radio_button_new_with_label (group, text);
- group = gtk_radio_button_group (GTK_RADIO_BUTTON (radio));
- gtk_box_pack_start (GTK_BOX (box), radio, FALSE, FALSE, 0);
-
- /* Select default */
-
- e_dialog_widget_hook_value (dialog, radio, view, (gpointer) print_view_map);
-
- gtk_widget_show_all (box);
- return box;
-}
-
-
-static void
-print_day_view (GnomePrintContext *pc, GnomeCalendar *gcal, time_t date,
- double left, double right, double top, double bottom)
-{
- icaltimezone *zone = get_timezone ();
- int i, days = 1;
- double todo, header, l;
- char buf[100];
-
- for (i = 0; i < days; i++) {
- todo = (right - left) * 0.75 + left;
- header = top - HEADER_HEIGHT;
-
- gnome_print_beginpage (pc, NULL);
-
- /* Print the main view with all the events in. */
- print_day_details (pc, gcal, date,
- left, todo - 2.0, header, bottom);
-
- /* Print the TaskPad down the right. */
- print_todo_details (pc, gcal, 0, INT_MAX,
- todo, right, header, bottom);
-
- /* Print the filled border around the header. */
- print_border (pc, left, right, top, header + 2.0, 1.0, 0.9);
-
- /* Print the 2 mini calendar-months. */
- l = right - SMALL_MONTH_PAD - SMALL_MONTH_WIDTH * 2
- - SMALL_MONTH_SPACING;
- print_month_small (pc, gcal, date,
- l, l + SMALL_MONTH_WIDTH,
- top - 4, header + 4,
- DATE_MONTH | DATE_YEAR, date, date, FALSE);
-
- l += SMALL_MONTH_SPACING + SMALL_MONTH_WIDTH;
- print_month_small (pc, gcal,
- time_add_month_with_zone (date, 1, zone),
- l, l + SMALL_MONTH_WIDTH,
- top - 4, header + 4,
- DATE_MONTH | DATE_YEAR, 0, 0, FALSE);
-
- /* Print the date, e.g. '8th May, 2001'. */
- format_date (date, DATE_DAY | DATE_MONTH | DATE_YEAR,
- buf, 100);
- print_text_size_bold (pc, buf, ALIGN_LEFT,
- left + 4, todo, top - 4, top - 4 - 24);
-
- /* Print the day, e.g. 'Tuesday'. */
- format_date (date, DATE_DAYNAME, buf, 100);
- print_text_size_bold (pc, buf, ALIGN_LEFT,
- left + 4, todo, top - 32, top - 32 - 18);
-
- gnome_print_showpage (pc);
- date = time_add_day_with_zone (date, 1, zone);
- }
-}
-
-
-static void
-print_week_view (GnomePrintContext *pc, GnomeCalendar *gcal, time_t date,
- double left, double right, double top, double bottom)
-{
- icaltimezone *zone = get_timezone ();
- double header, l;
- char buf[100];
- time_t when;
- gint week_start_day;
- struct tm tm;
-
- header = top - HEADER_HEIGHT;
-
- gnome_print_beginpage (pc, NULL);
-
- tm = *convert_timet_to_struct_tm (date, zone);
- week_start_day = calendar_config_get_week_start_day ();
- when = time_week_begin_with_zone (date, week_start_day, zone);
- /* If the week starts on a Sunday, we have to show the Saturday first,
- since the weekend is compressed. */
- if (week_start_day == 0) {
- 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 (pc, gcal, when, FALSE, 1, 0,
- WEEK_NORMAL_FONT_SIZE,
- left, right, header, bottom);
-
- /* Print the border around the main view. */
- print_border (pc, left, right, header, bottom, 1.0, -1.0);
-
- /* Print the border around the header area. */
- print_border (pc, left, right, top, header + 2.0, 1.0, 0.9);
-
- /* Print the 2 mini calendar-months. */
- l = right - SMALL_MONTH_PAD - SMALL_MONTH_WIDTH * 2
- - SMALL_MONTH_SPACING;
- print_month_small (pc, gcal, when,
- l, l + SMALL_MONTH_WIDTH,
- top - 4, header + 4,
- DATE_MONTH | DATE_YEAR, when,
- time_add_week_with_zone (when, 1, zone), FALSE);
-
- l += SMALL_MONTH_SPACING + SMALL_MONTH_WIDTH;
- print_month_small (pc, gcal,
- time_add_month_with_zone (when, 1, zone),
- l, l + SMALL_MONTH_WIDTH,
- top - 4, header + 4,
- 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'. */
- format_date (when, DATE_DAY | DATE_MONTH | DATE_YEAR, buf, 100);
- print_text_size_bold (pc, buf, ALIGN_LEFT,
- left + 3, right, top - 4, top - 4 - 24);
-
- /* Print the end day of the week, e.g. '13th May 2001'. */
- when = time_add_day_with_zone (when, 6, zone);
- format_date (when, DATE_DAY | DATE_MONTH | DATE_YEAR, buf, 100);
- print_text_size_bold (pc, buf, ALIGN_LEFT,
- left + 3, right, top - 24 - 3, top - 24 - 3 - 24);
-
- gnome_print_showpage (pc);
-}
-
-
-static void
-print_month_view (GnomePrintContext *pc, GnomeCalendar *gcal, time_t date,
- double left, double right, double top, double bottom)
-{
- icaltimezone *zone = get_timezone ();
- double header;
- char buf[100];
-
- header = top - HEADER_HEIGHT;
-
- gnome_print_beginpage (pc, NULL);
-
- /* Print the main month view. */
- print_month_summary (pc, gcal, date, left, right, header, bottom);
-
- /* Print the border around the header. */
- print_border (pc, left, right, top, header, 1.0, 0.9);
-
- /* Print the 2 mini calendar-months. */
- print_month_small (pc, gcal,
- time_add_month_with_zone (date, 1, zone),
- right - (right - left) / 7 + 2, right - 8,
- top - 4, header,
- DATE_MONTH | DATE_YEAR, 0, 0, FALSE);
- print_month_small (pc, gcal,
- time_add_month_with_zone (date, -1, zone),
- left + 8, left + (right - left) / 7 - 2,
- top - 4, header,
- DATE_MONTH | DATE_YEAR, 0, 0, FALSE);
-
- /* Print the month, e.g. 'May 2001'. */
- format_date (date, DATE_MONTH | DATE_YEAR, buf, 100);
- print_text_size_bold (pc, buf, ALIGN_CENTER,
- left + 3, right - 3, top - 3, top - 3 - 24);
-
- gnome_print_showpage (pc);
-}
-
-
-static void
-print_year_view (GnomePrintContext *pc, GnomeCalendar *gcal, time_t date,
- double left, double right, double top, double bottom)
-{
- char buf[100];
-
- gnome_print_beginpage (pc, NULL);
-
- print_year_summary (pc, gcal, date, left, right, top - 50, bottom,
- TRUE);
-
- /* centered title */
- format_date (date, DATE_YEAR, buf, 100);
- print_text_size_bold (pc, buf, ALIGN_CENTER,
- left+3, right, top-3, top - 27);
-
- gnome_print_showpage (pc);
-}
-
-static void
-write_label_piece (time_t t, char *buffer, int size, char *stext, char *etext)
-{
- icaltimezone *zone = get_timezone ();
- struct tm *tmp_tm;
- int len;
-
- tmp_tm = convert_timet_to_struct_tm (t, zone);
-
- if (stext != NULL)
- strcat (buffer, stext);
-
- len = strlen (buffer);
- e_time_format_date_and_time (tmp_tm,
- calendar_config_get_24_hour_format (),
- FALSE, FALSE,
- &buffer[len], size - len);
- if (etext != NULL)
- strcat (buffer, etext);
-}
-
-static icaltimezone*
-get_zone_from_tzid (ECal *client, const char *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) {
- if (!e_cal_get_timezone (client, tzid, &zone, NULL))
- /* FIXME: Handle error better. */
- g_warning ("Couldn't get timezone from server: %s",
- tzid ? tzid : "");
- }
-
- return zone;
-}
-
-static void
-print_date_label (GnomePrintContext *pc, ECalComponent *comp, ECal *client,
- double left, double right, double top, double bottom)
-{
- icaltimezone *start_zone, *end_zone, *due_zone, *completed_zone;
- ECalComponentDateTime datetime;
- time_t start = 0, end = 0, complete = 0, due = 0;
- static char buffer[1024];
-
- e_cal_component_get_dtstart (comp, &datetime);
- if (datetime.value) {
- start_zone = get_zone_from_tzid (client, datetime.tzid);
- 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);
- 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);
- 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, buffer, 1024, NULL, NULL);
-
- if (end > 0 && start > 0)
- write_label_piece (end, buffer, 1024, _(" to "), NULL);
-
- if (complete > 0) {
- if (start > 0)
- write_label_piece (complete, buffer, 1024, _(" (Completed "), ")");
- else
- write_label_piece (complete, buffer, 1024, _("Completed "), NULL);
- }
-
- if (due > 0 && complete == 0) {
- if (start > 0)
- write_label_piece (due, buffer, 1024, _(" (Due "), ")");
- else
- write_label_piece (due, buffer, 1024, _("Due "), NULL);
- }
-
- print_text_size_bold (pc, buffer, ALIGN_LEFT,
- left, right, top, top - 15);
-}
-
-static void
-print_comp_item (GnomePrintContext *pc, ECalComponent *comp, ECal *client,
- double left, double right, double top, double bottom)
-{
- GnomeFont *font;
- ECalComponentVType vtype;
- ECalComponentText text;
- GSList *desc, *l;
- const char *title, *categories;
- char *categories_string;
- GSList *contact_list, *elem;
- gint header_size;
-
- vtype = e_cal_component_get_vtype (comp);
-
- /* We should only be asked to print VEVENTs or VTODOs. */
- if (vtype == E_CAL_COMPONENT_EVENT)
- title = _("Appointment");
- else if (vtype == E_CAL_COMPONENT_TODO)
- title = _("Task");
- else
- return;
-
- gnome_print_beginpage (pc, NULL);
-
- /* Print the title in a box at the top of the page. */
- font = get_font_for_size (18, GNOME_FONT_BOLD, FALSE);
- header_size = 50;
- print_border (pc, left, right, top, top - header_size,
- 1.0, 0.9);
- print_text (pc, font, title, ALIGN_CENTER, left, right,
- top - header_size * 0.1, top - header_size);
- g_object_unref (font);
-
- top -= header_size + 10;
-
- /* Summary */
- font = get_font_for_size (18, GNOME_FONT_BOLD, FALSE);
- e_cal_component_get_summary (comp, &text);
- top = bound_text (pc, font, text.value, left, right,
- top - 3, bottom, 0);
- g_object_unref (font);
-
- /* Date information */
- print_date_label (pc, comp, client, left, right, top-3, top - 15);
- top -= 20;
-
- font = get_font_for_size (12, GNOME_FONT_BOOK, FALSE);
-
- /* For a VTODO we print the Status, Priority, % Complete and URL. */
- if (vtype == E_CAL_COMPONENT_TODO) {
- icalproperty_status status;
- const char *status_string = NULL;
- int *percent;
- int *priority;
- const char *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) {
- char *text = g_strdup_printf (_("Status: %s"),
- status_string);
- top = bound_text (pc, font, text,
- left, right, top, bottom, 0);
- top += gnome_font_get_size (font) - 6;
- g_free (text);
- }
- }
-
- /* Priority */
- e_cal_component_get_priority (comp, &priority);
- if (priority && *priority >= 0) {
- char *priority_string, *text;
-
- priority_string = e_cal_util_priority_to_string (*priority);
- e_cal_component_free_priority (priority);
-
- text = g_strdup_printf (_("Priority: %s"), priority_string);
- top = bound_text (pc, font, text,
- left, right, top, bottom, 0);
- top += gnome_font_get_size (font) - 6;
- g_free (text);
- }
-
- /* Percent Complete */
- e_cal_component_get_percent (comp, &percent);
- if (percent) {
- char *percent_string;
-
- percent_string = g_strdup_printf (_("Percent Complete: %i"), *percent);
- e_cal_component_free_percent (percent);
-
- top = bound_text (pc, font, percent_string,
- left, right, top, bottom, 0);
- top += gnome_font_get_size (font) - 6;
- }
-
-
- /* URL */
- e_cal_component_get_url (comp, &url);
- if (url && url[0]) {
- char *url_string = g_strdup_printf (_("URL: %s"),
- url);
-
- top = bound_text (pc, font, url_string,
- left, right, top, bottom, 0);
- top += gnome_font_get_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 (pc, font, categories_string,
- left, right, top, bottom, 0);
- top += gnome_font_get_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 (pc, font, contacts->str,
- left, right, top, bottom, 0);
- top += gnome_font_get_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 *text = l->data;
-
- if (text->value != NULL)
- top = bound_text (pc, font, text->value, left, right, top-3, bottom, 0);
- }
- e_cal_component_free_text_list (desc);
- g_object_unref (font);
-
- gnome_print_showpage (pc);
-}
-
-void
-print_calendar (GnomeCalendar *gcal, gboolean preview, time_t date,
- PrintView default_view)
-{
- GnomePrintJob *gpm;
- GnomePrintContext *pc;
- int copies, collate;
- double l, r, t, b;
- gchar *old_orientation;
-
- g_return_if_fail (gcal != NULL);
- g_return_if_fail (GNOME_IS_CALENDAR (gcal));
-
- if (!print_config)
- print_config = gnome_print_config_default ();
-
- copies = 1;
- collate = FALSE;
-
- gpm = gnome_print_job_new (print_config);
-
- if (!preview) {
- GtkWidget *gpd;
- GtkWidget *range;
- int view;
-
- gpd = gnome_print_dialog_new (gpm, _("Print"), 0);
-
- view = (int) default_view;
- range = range_selector_new (gpd, date, &view);
- gnome_print_dialog_construct_range_custom (GNOME_PRINT_DIALOG (gpd), range);
-
- gtk_dialog_set_default_response (GTK_DIALOG (gpd),
- GNOME_PRINT_DIALOG_RESPONSE_PRINT);
-
- /* Run dialog */
-
- switch (gtk_dialog_run (GTK_DIALOG (gpd))) {
- case GNOME_PRINT_DIALOG_RESPONSE_PRINT:
- break;
-
- case GNOME_PRINT_DIALOG_RESPONSE_PREVIEW:
- preview = TRUE;
- break;
-
- case -1:
- return;
-
- default:
- gtk_widget_destroy (gpd);
- return;
- }
-
- e_dialog_get_values (gpd);
- default_view = (PrintView) view;
-
- gtk_widget_destroy (gpd);
- }
-
- old_orientation = gnome_print_config_get (print_config, GNOME_PRINT_KEY_PAGE_ORIENTATION);
-
- if (default_view == PRINT_VIEW_MONTH)
- gnome_print_config_set (print_config, GNOME_PRINT_KEY_PAGE_ORIENTATION, "R90");
-
- pc = gnome_print_job_get_context (gpm);
- gnome_print_config_get_page_size (print_config, &r, &t);
-
- /* See top of source for an explanation of this */
-
- /* gnome_print_config_get_double (print_config, GNOME_PRINT_KEY_PAGE_MARGIN_TOP, &temp_d);
- * t -= temp_d;
- * gnome_print_config_get_double (print_config, GNOME_PRINT_KEY_PAGE_MARGIN_RIGHT, &temp_d);
- * r -= temp_d;
- * gnome_print_config_get_double (print_config, GNOME_PRINT_KEY_PAGE_MARGIN_BOTTOM, &b);
- * gnome_print_config_get_double (print_config, GNOME_PRINT_KEY_PAGE_MARGIN_LEFT, &l);
- * b = l = TEMP_MARGIN; */
-
- b = t * TEMP_MARGIN;
- l = r * TEMP_MARGIN;
- t *= (1.0 - TEMP_MARGIN);
- r *= (1.0 - TEMP_MARGIN);
-
- /* depending on the view, do a different output */
- switch (default_view) {
- case PRINT_VIEW_DAY:
- print_day_view (pc, gcal, date, l, r, t, b);
- break;
- case PRINT_VIEW_WEEK:
- print_week_view (pc, gcal, date, l, r, t, b);
- break;
- case PRINT_VIEW_MONTH:
- print_month_view (pc, gcal, date, l, r, t, b);
- break;
- case PRINT_VIEW_YEAR:
- print_year_view (pc, gcal, date, l, r, t, b);
- break;
- default:
- g_assert_not_reached ();
- }
-
- gnome_print_job_close (gpm);
-
- if (preview) {
- GtkWidget *gpmp;
-
- gpmp = gnome_print_job_preview_new (gpm, _("Print Preview"));
- gtk_widget_show (gpmp);
- } else {
- gnome_print_job_print (gpm);
- }
-
- gnome_print_config_set (print_config, GNOME_PRINT_KEY_PAGE_ORIENTATION, old_orientation);
- g_free (old_orientation);
- g_object_unref (gpm);
-}
-
-
-void
-print_comp (ECalComponent *comp, ECal *client, gboolean preview)
-{
- GnomePrintJob *gpm;
- GnomePrintContext *pc;
- int copies, collate;
- double l, r, t, b;
-
- g_return_if_fail (comp != NULL);
- g_return_if_fail (E_IS_CAL_COMPONENT (comp));
-
- if (!print_config)
- print_config = gnome_print_config_default ();
-
- copies = 1;
- collate = FALSE;
-
- gpm = gnome_print_job_new (print_config);
-
- if (!preview) {
- GtkWidget *gpd;
-
- gpd = gnome_print_dialog_new (gpm, _("Print Item"),
- GNOME_PRINT_DIALOG_COPIES);
-
- gtk_dialog_set_default_response (GTK_DIALOG (gpd),
- GNOME_PRINT_DIALOG_RESPONSE_PRINT);
-
- /* Run dialog */
-
- switch (gtk_dialog_run (GTK_DIALOG (gpd))) {
- case GNOME_PRINT_DIALOG_RESPONSE_PRINT:
- break;
-
- case GNOME_PRINT_DIALOG_RESPONSE_PREVIEW:
- preview = TRUE;
- break;
-
- case -1:
- return;
-
- default:
- gtk_widget_destroy (gpd);
- return;
- }
-
- e_dialog_get_values (gpd);
- gtk_widget_destroy (gpd);
- }
-
- pc = gnome_print_job_get_context (gpm);
- gnome_print_config_get_page_size (print_config, &r, &t);
-
- /* See top of source for an explanation of this */
-
- /* gnome_print_config_get_double (print_config, GNOME_PRINT_KEY_PAGE_MARGIN_TOP, &temp_d);
- * t -= temp_d;
- * gnome_print_config_get_double (print_config, GNOME_PRINT_KEY_PAGE_MARGIN_RIGHT, &temp_d);
- * r -= temp_d;
- * gnome_print_config_get_double (print_config, GNOME_PRINT_KEY_PAGE_MARGIN_BOTTOM, &b);
- * gnome_print_config_get_double (print_config, GNOME_PRINT_KEY_PAGE_MARGIN_LEFT, &l);
- * b = l = TEMP_MARGIN; */
-
- b = t * TEMP_MARGIN;
- l = r * TEMP_MARGIN;
- t *= (1.0 - TEMP_MARGIN);
- r *= (1.0 - TEMP_MARGIN);
-
- print_comp_item (pc, comp, client, l, r, t, b);
- gnome_print_job_close (gpm);
-
- if (preview) {
- GtkWidget *gpmp;
-
- gpmp = gnome_print_job_preview_new (gpm, _("Print Preview"));
- gtk_widget_show (gpmp);
- } else {
- gnome_print_job_print (gpm);
- }
-
- g_object_unref (gpm);
-}
-
-void
-print_setup (void)
-{
- GtkWidget *ps;
-
- if (!print_config)
- print_config = gnome_print_config_default ();
-
- ps = gnome_paper_selector_new (print_config);
- gtk_widget_show (ps);
-
-#if 0
- dlg = gtk_dialog_new_with_buttons (_("Print Setup"),
- NULL, /* FIXME: Set a sensible parent */
- 0,
- GNOME_STOCK_BUTTON_OK,
- GNOME_STOCK_BUTTON_CANCEL,
- NULL);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), ps, TRUE, TRUE, 2);
-
- btn = gtk_dialog_run (GTK_DIALOG (dlg));
- if (btn == 0) {
- gchar *name;
-
- print_config = gnome_paper_selector_get_config (ps);
-
- name = gnome_paper_selector_get_name (GNOME_PAPER_SELECTOR (ps));
- paper_info = gnome_paper_with_name (name);
- }
-
- gtk_widget_destroy (dlg);
-#endif
-}
diff --git a/calendar/gui/print.h b/calendar/gui/print.h
deleted file mode 100644
index 495007d81d..0000000000
--- a/calendar/gui/print.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Evolution calendar - Print support
- *
- * Copyright (C) 2000 Ximian, Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- * Federico Mena-Quintero <federico@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef PRINT_H
-#define PRINT_H
-
-#include "gnome-cal.h"
-
-
-
-typedef enum {
- PRINT_VIEW_DAY,
- PRINT_VIEW_WEEK,
- PRINT_VIEW_MONTH,
- PRINT_VIEW_YEAR
-} PrintView;
-
-void print_calendar (GnomeCalendar *gcal, gboolean preview, time_t at, PrintView default_view);
-void print_comp (ECalComponent *comp, ECal *client, gboolean preview);
-
-void print_setup (void);
-
-
-
-#endif
diff --git a/calendar/gui/tag-calendar.c b/calendar/gui/tag-calendar.c
deleted file mode 100644
index 8e6937d08a..0000000000
--- a/calendar/gui/tag-calendar.c
+++ /dev/null
@@ -1,230 +0,0 @@
-/* Evolution calendar - Utilities for tagging ECalendar widgets
- *
- * Copyright (C) 2000 Ximian, Inc.
- *
- * Authors: Damon Chaplin <damon@ximian.com>
- * Federico Mena-Quintero <federico@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <libecal/e-cal-time-util.h>
-#include "calendar-config.h"
-#include "tag-calendar.h"
-
-
-
-struct calendar_tag_closure {
- ECalendarItem *calitem;
- icaltimezone *zone;
- time_t start_time;
- time_t end_time;
-
- gboolean skip_transparent_events;
-};
-
-/* Clears all the tags in a calendar and fills a closure structure with the
- * necessary information for iterating over occurrences.
- * Returns FALSE if the calendar has no dates shown.
- */
-static gboolean
-prepare_tag (ECalendar *ecal, struct calendar_tag_closure *c, icaltimezone *zone, gboolean clear_first)
-{
- gint start_year, start_month, start_day;
- gint end_year, end_month, end_day;
- struct icaltimetype start_tt = icaltime_null_time ();
- struct icaltimetype end_tt = icaltime_null_time ();
- char *location;
-
- if (clear_first)
- e_calendar_item_clear_marks (ecal->calitem);
-
- if (!e_calendar_item_get_date_range (ecal->calitem,
- &start_year, &start_month,
- &start_day,
- &end_year, &end_month, &end_day))
- return FALSE;
-
- start_tt.year = start_year;
- start_tt.month = start_month + 1;
- start_tt.day = start_day;
-
- end_tt.year = end_year;
- end_tt.month = end_month + 1;
- end_tt.day = end_day;
-
- icaltime_adjust (&end_tt, 1, 0, 0, 0);
-
- c->calitem = ecal->calitem;
-
- if (zone) {
- c->zone = zone;
- } else {
- location = calendar_config_get_timezone ();
- c->zone = icaltimezone_get_builtin_timezone (location);
- }
-
- c->start_time = icaltime_as_timet_with_zone (start_tt, c->zone);
- c->end_time = icaltime_as_timet_with_zone (end_tt, c->zone);
-
- return TRUE;
-}
-
-/* Marks the specified range in an ECalendar; called from e_cal_generate_instances() */
-static gboolean
-tag_calendar_cb (ECalComponent *comp,
- time_t istart,
- time_t iend,
- gpointer data)
-{
- struct calendar_tag_closure *c = data;
- struct icaltimetype start_tt, end_tt;
- ECalComponentTransparency transparency;
-
- /* If we are skipping TRANSPARENT events, return if the event is
- transparent. */
- if (c->skip_transparent_events) {
- e_cal_component_get_transparency (comp, &transparency);
- if (transparency == E_CAL_COMPONENT_TRANSP_TRANSPARENT)
- return TRUE;
- }
-
- start_tt = icaltime_from_timet_with_zone (istart, FALSE, c->zone);
- end_tt = icaltime_from_timet_with_zone (iend - 1, FALSE, c->zone);
- e_calendar_item_mark_days (c->calitem,
- start_tt.year, start_tt.month - 1,
- start_tt.day,
- end_tt.year, end_tt.month - 1,
- end_tt.day,
- E_CALENDAR_ITEM_MARK_BOLD);
-
- return TRUE;
-}
-
-/**
- * tag_calendar_by_client:
- * @ecal: Calendar widget to tag.
- * @client: A calendar client object.
- *
- * Tags an #ECalendar widget with the events that occur in its current time
- * range. The occurrences are extracted from the specified calendar @client.
- **/
-void
-tag_calendar_by_client (ECalendar *ecal, ECal *client)
-{
- struct calendar_tag_closure c;
-
- g_return_if_fail (ecal != NULL);
- g_return_if_fail (E_IS_CALENDAR (ecal));
- g_return_if_fail (client != NULL);
- g_return_if_fail (E_IS_CAL (client));
-
- /* If the ECalendar isn't visible, we just return. */
- if (!GTK_WIDGET_VISIBLE (ecal))
- return;
-
- if (e_cal_get_load_state (client) != E_CAL_LOAD_LOADED)
- return;
-
- if (!prepare_tag (ecal, &c, NULL, TRUE))
- return;
-
- c.skip_transparent_events = TRUE;
-
-#if 0
- g_print ("DateNavigator generating instances\n");
-#endif
- e_cal_generate_instances (client, CALOBJ_TYPE_EVENT,
- c.start_time, c.end_time,
- tag_calendar_cb, &c);
-}
-
-/* Resolves TZIDs for the recurrence generator, for when the comp is not on
- the server. We need to try to use builtin timezones first, as they may not
- be added to the server yet. */
-static icaltimezone*
-resolve_tzid_cb (const char *tzid, gpointer data)
-{
- ECal *client;
- icaltimezone *zone = NULL;
-
- g_return_val_if_fail (data != NULL, NULL);
- g_return_val_if_fail (E_IS_CAL (data), NULL);
-
- client = E_CAL (data);
-
- /* Try to find the builtin timezone first. */
- zone = icaltimezone_get_builtin_timezone_from_tzid (tzid);
-
- if (!zone) {
- /* FIXME: Handle errors. */
- e_cal_get_timezone (client, tzid, &zone, NULL);
- }
-
- return zone;
-}
-
-/**
- * tag_calendar_by_comp:
- * @ecal: Calendar widget to tag.
- * @comp: A calendar component object.
- * @clear_first: Whether the #ECalendar should be cleared of any marks first.
- *
- * Tags an #ECalendar widget with any occurrences of a specific calendar
- * component that occur within the calendar's current time range.
- * Note that TRANSPARENT events are also tagged here.
- *
- * If comp_is_on_server is FALSE, it will try to resolve TZIDs using builtin
- * timezones first, before querying the server, since the timezones may not
- * have been added to the calendar on the server yet.
- **/
-void
-tag_calendar_by_comp (ECalendar *ecal, ECalComponent *comp, ECal *client, icaltimezone *display_zone,
- gboolean clear_first, gboolean comp_is_on_server)
-{
- struct calendar_tag_closure c;
-
- g_return_if_fail (ecal != NULL);
- g_return_if_fail (E_IS_CALENDAR (ecal));
- g_return_if_fail (comp != NULL);
- g_return_if_fail (E_IS_CAL_COMPONENT (comp));
-
- /* If the ECalendar isn't visible, we just return. */
- if (!GTK_WIDGET_VISIBLE (ecal))
- return;
-
- if (!prepare_tag (ecal, &c, display_zone, clear_first))
- return;
-
- c.skip_transparent_events = FALSE;
-
-#if 0
- g_print ("DateNavigator generating instances\n");
-#endif
- if (comp_is_on_server) {
- e_cal_recur_generate_instances (comp, c.start_time, c.end_time,
- tag_calendar_cb, &c,
- e_cal_resolve_tzid_cb,
- client, c.zone);
- } else {
- e_cal_recur_generate_instances (comp, c.start_time, c.end_time,
- tag_calendar_cb, &c,
- resolve_tzid_cb,
- client, c.zone);
- }
-}
diff --git a/calendar/gui/tag-calendar.h b/calendar/gui/tag-calendar.h
deleted file mode 100644
index d31d675543..0000000000
--- a/calendar/gui/tag-calendar.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Evolution calendar - Utilities for tagging ECalendar widgets
- *
- * Copyright (C) 2000 Ximian, Inc.
- *
- * Authors: Damon Chaplin <damon@ximian.com>
- * Federico Mena-Quintero <federico@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef TAG_CALENDAR_H
-#define TAG_CALENDAR_H
-
-#include <widgets/misc/e-calendar.h>
-#include <libecal/e-cal.h>
-
-void tag_calendar_by_client (ECalendar *ecal, ECal *client);
-void tag_calendar_by_comp (ECalendar *ecal, ECalComponent *comp,
- ECal *client, icaltimezone *display_zone,
- gboolean clear_first, gboolean comp_is_on_server);
-
-#endif
diff --git a/calendar/gui/tasks-component.c b/calendar/gui/tasks-component.c
deleted file mode 100644
index db7864bdd7..0000000000
--- a/calendar/gui/tasks-component.c
+++ /dev/null
@@ -1,812 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* tasks-component.c
- *
- * Copyright (C) 2003 Rodrigo Moya
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Rodrigo Moya <rodrigo@ximian.com>
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <errno.h>
-#include <string.h>
-#include <bonobo/bonobo-control.h>
-#include <bonobo/bonobo-i18n.h>
-#include <bonobo/bonobo-exception.h>
-#include <gconf/gconf-client.h>
-#include <libecal/e-cal.h>
-#include "e-cal-model.h"
-#include "e-tasks.h"
-#include "tasks-component.h"
-#include "tasks-control.h"
-#include "e-comp-editor-registry.h"
-#include "migration.h"
-#include "comp-util.h"
-#include "calendar-config.h"
-#include "dialogs/comp-editor.h"
-#include "dialogs/copy-source-dialog.h"
-#include "dialogs/new-task-list.h"
-#include "dialogs/task-editor.h"
-#include "widgets/misc/e-source-selector.h"
-
-
-#define CREATE_TASK_ID "task"
-
-
-#define PARENT_TYPE bonobo_object_get_type ()
-
-static BonoboObjectClass *parent_class = NULL;
-
-/* Tasks should have their own registry */
-extern ECompEditorRegistry *comp_editor_registry;
-
-struct _TasksComponentPrivate {
- char *config_directory;
- GConfClient *gconf_client;
-
- ESourceList *source_list;
- GSList *source_selection;
-
- ETasks *tasks;
- GtkWidget *source_selector;
-
- ECal *create_ecal;
-
- GList *notifications;
-};
-
-/* Utility functions. */
-/* FIXME Some of these are duplicated from calendar-component.c */
-static void
-add_uri_for_source (ESource *source, ETasks *tasks)
-{
- char *uri = e_source_get_uri (source);
-
- e_tasks_add_todo_uri (tasks, uri);
- g_free (uri);
-}
-
-static void
-remove_uri_for_source (ESource *source, ETasks *tasks)
-{
- char *uri = e_source_get_uri (source);
-
- e_tasks_remove_todo_uri (tasks, uri);
- g_free (uri);
-}
-
-static gboolean
-is_in_selection (GSList *selection, ESource *source)
-{
- GSList *l;
-
- for (l = selection; l; l = l->next) {
- ESource *selected_source = l->data;
-
- if (!strcmp (e_source_peek_uid (selected_source), e_source_peek_uid (source)))
- return TRUE;
- }
-
- return FALSE;
-}
-
-static gboolean
-is_in_uids (GSList *uids, ESource *source)
-{
- GSList *l;
-
- for (l = uids; l; l = l->next) {
- const char *uid = l->data;
-
- if (!strcmp (uid, e_source_peek_uid (source)))
- return TRUE;
- }
-
- return FALSE;
-}
-
-static ESource *
-find_first_source (ESourceList *source_list)
-{
- GSList *groups, *sources, *l, *m;
-
- groups = e_source_list_peek_groups (source_list);
- for (l = groups; l; l = l->next) {
- ESourceGroup *group = l->data;
-
- sources = e_source_group_peek_sources (group);
- for (m = sources; m; m = m->next) {
- ESource *source = m->data;
-
- return source;
- }
- }
-
- return NULL;
-}
-
-static void
-update_uris_for_selection (TasksComponent *component)
-{
- TasksComponentPrivate *priv;
- GSList *selection, *l, *uids_selected = NULL;
-
- priv = component->priv;
-
- selection = e_source_selector_get_selection (E_SOURCE_SELECTOR (priv->source_selector));
-
- for (l = priv->source_selection; l; l = l->next) {
- ESource *old_selected_source = l->data;
-
- if (!is_in_selection (selection, old_selected_source))
- remove_uri_for_source (old_selected_source, E_TASKS (priv->tasks));
- }
-
- for (l = selection; l; l = l->next) {
- ESource *selected_source = l->data;
-
- add_uri_for_source (selected_source, E_TASKS (priv->tasks));
- uids_selected = g_slist_append (uids_selected, (char *)e_source_peek_uid (selected_source));
- }
-
- e_source_selector_free_selection (priv->source_selection);
- priv->source_selection = selection;
-
- /* Save the selection for next time we start up */
- calendar_config_set_tasks_selected (uids_selected);
- g_slist_free (uids_selected);
-}
-
-static void
-update_uri_for_primary_selection (TasksComponent *component)
-{
- TasksComponentPrivate *priv;
- ESource *source;
- char *uri;
-
- priv = component->priv;
-
- source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (priv->source_selector));
- if (!source)
- return;
-
- /* Set the default */
- uri = e_source_get_uri (source);
- e_tasks_set_default_uri (priv->tasks, uri);
- g_free (uri);
-
- /* Save the selection for next time we start up */
- calendar_config_set_primary_tasks (e_source_peek_uid (source));
-}
-
-static void
-update_selection (TasksComponent *task_component)
-{
- TasksComponentPrivate *priv;
- GSList *selection, *uids_selected, *l;
-
- priv = task_component->priv;
-
- /* Get the selection in gconf */
- uids_selected = calendar_config_get_tasks_selected ();
-
- /* Remove any that aren't there any more */
- selection = e_source_selector_get_selection (E_SOURCE_SELECTOR (priv->source_selector));
-
- for (l = selection; l; l = l->next) {
- ESource *source = l->data;
-
- if (!is_in_uids (uids_selected, source))
- e_source_selector_unselect_source (E_SOURCE_SELECTOR (priv->source_selector), source);
- }
-
- e_source_selector_free_selection (selection);
-
- /* Make sure the whole selection is there */
- for (l = uids_selected; l; l = l->next) {
- char *uid = l->data;
- ESource *source;
-
- source = e_source_list_peek_source_by_uid (priv->source_list, uid);
- if (source)
- e_source_selector_select_source (E_SOURCE_SELECTOR (priv->source_selector), source);
-
- g_free (uid);
- }
- g_slist_free (uids_selected);
-}
-
-static void
-update_primary_selection (TasksComponent *component)
-{
- TasksComponentPrivate *priv;
- ESource *source;
- char *uid;
-
- priv = component->priv;
-
- uid = calendar_config_get_primary_tasks ();
- if (uid) {
- source = e_source_list_peek_source_by_uid (priv->source_list, uid);
- g_free (uid);
-
- e_source_selector_set_primary_selection (E_SOURCE_SELECTOR (priv->source_selector), source);
- } else {
- ESource *source;
-
- /* Try to create a default if there isn't one */
- source = find_first_source (priv->source_list);
- if (source)
- e_source_selector_set_primary_selection (E_SOURCE_SELECTOR (priv->source_selector), source);
- }
-}
-
-/* FIXME This is duplicated from comp-editor-factory.c, should it go in comp-util? */
-static ECalComponent *
-get_default_task (ECal *ecal)
-{
- ECalComponent *comp;
-
- comp = cal_comp_task_new_with_defaults (ecal);
-
- return comp;
-}
-
-/* Callbacks. */
-static void
-add_popup_menu_item (GtkMenu *menu, const char *label, const char *pixmap,
- GCallback callback, gpointer user_data, gboolean sensitive)
-{
- GtkWidget *item, *image;
-
- if (pixmap) {
- item = gtk_image_menu_item_new_with_label (label);
-
- /* load the image */
- image = gtk_image_new_from_stock (pixmap, GTK_ICON_SIZE_MENU);
- if (!image)
- image = gtk_image_new_from_file (pixmap);
-
- if (image) {
- gtk_widget_show (image);
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
- }
- } else {
- item = gtk_menu_item_new_with_label (label);
- }
-
- if (callback)
- g_signal_connect (G_OBJECT (item), "activate", callback, user_data);
-
- if (!sensitive)
- gtk_widget_set_sensitive (item, FALSE);
-
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
- gtk_widget_show (item);
-}
-
-static void
-copy_task_list_cb (GtkWidget *widget, TasksComponent *comp)
-{
- ESource *selected_source;
- TasksComponentPrivate *priv;
-
- priv = comp->priv;
-
- selected_source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (priv->source_selector));
- if (!selected_source)
- return;
-
- copy_source_dialog (GTK_WINDOW (gtk_widget_get_toplevel (widget)), selected_source, CALOBJ_TYPE_TODO);
-}
-
-static void
-delete_task_list_cb (GtkWidget *widget, TasksComponent *comp)
-{
- ESource *selected_source;
- TasksComponentPrivate *priv;
- GtkWidget *dialog;
-
- priv = comp->priv;
-
- selected_source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (priv->source_selector));
- if (!selected_source)
- return;
-
- /* create the confirmation dialog */
- dialog = gtk_message_dialog_new (
- GTK_WINDOW (gtk_widget_get_toplevel (widget)),
- GTK_DIALOG_MODAL,
- GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_YES_NO,
- _("Task List '%s' will be removed. Are you sure you want to continue?"),
- e_source_peek_name (selected_source));
- if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_YES) {
- if (e_source_selector_source_is_selected (E_SOURCE_SELECTOR (priv->source_selector),
- selected_source))
- e_source_selector_unselect_source (E_SOURCE_SELECTOR (priv->source_selector),
- selected_source);
-
- e_source_group_remove_source (e_source_peek_group (selected_source), selected_source);
-
- /* FIXME: remove the tasks.ics file and the directory */
- }
-
- gtk_widget_destroy (dialog);
-}
-
-static void
-new_task_list_cb (GtkWidget *widget, TasksComponent *component)
-{
- new_task_list_dialog (GTK_WINDOW (gtk_widget_get_toplevel (widget)));
-}
-
-static void
-rename_task_list_cb (GtkWidget *widget, TasksComponent *comp)
-{
- TasksComponentPrivate *priv;
- ESource *selected_source;
- GtkWidget *dialog, *entry;
-
- priv = comp->priv;
-
- selected_source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (priv->source_selector));
- if (!selected_source)
- return;
-
- /* create the dialog to prompt the user for the new name */
- dialog = gtk_message_dialog_new (GTK_WINDOW (gtk_widget_get_toplevel (widget)),
- GTK_DIALOG_MODAL,
- GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_OK_CANCEL,
- _("Rename this task list to"));
- entry = gtk_entry_new ();
- gtk_entry_set_text (GTK_ENTRY (entry), e_source_peek_name (selected_source));
- gtk_widget_show (entry);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), entry, TRUE, FALSE, 6);
-
- if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK)
- e_source_set_name (selected_source, gtk_entry_get_text (GTK_ENTRY (entry)));
-
- gtk_widget_destroy (dialog);
-}
-
-static void
-fill_popup_menu_cb (ESourceSelector *selector, GtkMenu *menu, TasksComponent *component)
-{
- gboolean sensitive;
-
- sensitive = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (component->priv->source_selector)) ?
- TRUE : FALSE;
-
- add_popup_menu_item (menu, _("New Task List"), GTK_STOCK_NEW, G_CALLBACK (new_task_list_cb),
- component, TRUE);
- add_popup_menu_item (menu, _("Copy"), NULL, G_CALLBACK (copy_task_list_cb), component, sensitive);
- add_popup_menu_item (menu, _("Rename"), NULL, G_CALLBACK (rename_task_list_cb),
- component, sensitive);
- add_popup_menu_item (menu, _("Delete"), GTK_STOCK_DELETE, G_CALLBACK (delete_task_list_cb),
- component, sensitive);
-}
-
-static void
-source_selection_changed_cb (ESourceSelector *selector, TasksComponent *component)
-{
- update_uris_for_selection (component);
-}
-
-static void
-primary_source_selection_changed_cb (ESourceSelector *selector, TasksComponent *component)
-{
- update_uri_for_primary_selection (component);
-}
-
-static void
-config_selection_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
-{
- update_selection (data);
-}
-
-static void
-config_primary_selection_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
-{
- update_primary_selection (data);
-}
-
-/* GObject methods */
-
-static void
-impl_dispose (GObject *object)
-{
- TasksComponentPrivate *priv = TASKS_COMPONENT (object)->priv;
- GList *l;
-
- if (priv->source_list != NULL) {
- g_object_unref (priv->source_list);
- priv->source_list = NULL;
- }
-
- if (priv->source_selection != NULL) {
- e_source_selector_free_selection (priv->source_selection);
- priv->source_selection = NULL;
- }
-
- if (priv->gconf_client != NULL) {
- g_object_unref (priv->gconf_client);
- priv->gconf_client = NULL;
- }
-
- if (priv->create_ecal) {
- g_object_unref (priv->create_ecal);
- priv->create_ecal = NULL;
- }
-
- for (l = priv->notifications; l; l = l->next)
- calendar_config_remove_notification (GPOINTER_TO_UINT (l->data));
- g_list_free (priv->notifications);
- priv->notifications = NULL;
-
- (* G_OBJECT_CLASS (parent_class)->dispose) (object);
-}
-
-static void
-impl_finalize (GObject *object)
-{
- TasksComponentPrivate *priv = TASKS_COMPONENT (object)->priv;
-
- g_free (priv->config_directory);
- g_free (priv);
-
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
-}
-
-/* Evolution::Component CORBA methods */
-
-static void
-control_activate_cb (BonoboControl *control, gboolean activate, gpointer data)
-{
- ETasks *tasks = data;
-
- if (activate)
- tasks_control_activate (control, tasks);
- else
- tasks_control_deactivate (control, tasks);
-}
-
-static void
-impl_createControls (PortableServer_Servant servant,
- Bonobo_Control *corba_sidebar_control,
- Bonobo_Control *corba_view_control,
- Bonobo_Control *corba_statusbar_control,
- CORBA_Environment *ev)
-{
- TasksComponent *component = TASKS_COMPONENT (bonobo_object_from_servant (servant));
- TasksComponentPrivate *priv;
- GtkWidget *selector_scrolled_window;
- BonoboControl *sidebar_control, *view_control;
- guint not;
-
- priv = component->priv;
-
- /* create sidebar selector */
- priv->source_selector = e_source_selector_new (priv->source_list);
- gtk_widget_show (priv->source_selector);
-
- selector_scrolled_window = gtk_scrolled_window_new (NULL, NULL);
- gtk_container_add (GTK_CONTAINER (selector_scrolled_window), priv->source_selector);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (selector_scrolled_window),
- GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (selector_scrolled_window),
- GTK_SHADOW_IN);
- gtk_widget_show (selector_scrolled_window);
-
- sidebar_control = bonobo_control_new (selector_scrolled_window);
-
- /* create the tasks view */
- priv->tasks = E_TASKS (e_tasks_new ());
- if (!priv->tasks) {
- g_warning (G_STRLOC ": could not create the control!");
- bonobo_exception_set (ev, ex_GNOME_Evolution_Component_Failed);
- return;
- }
-
- gtk_widget_show (GTK_WIDGET (priv->tasks));
-
- view_control = bonobo_control_new (GTK_WIDGET (priv->tasks));
- if (!view_control) {
- g_warning (G_STRLOC ": could not create the control!");
- bonobo_exception_set (ev, ex_GNOME_Evolution_Component_Failed);
- return;
- }
-
- g_signal_connect (view_control, "activate", G_CALLBACK (control_activate_cb), priv->tasks);
-
- g_signal_connect_object (priv->source_selector, "selection_changed",
- G_CALLBACK (source_selection_changed_cb),
- G_OBJECT (component), 0);
- g_signal_connect_object (priv->source_selector, "primary_selection_changed",
- G_CALLBACK (primary_source_selection_changed_cb),
- G_OBJECT (component), 0);
- g_signal_connect_object (priv->source_selector, "fill_popup_menu",
- G_CALLBACK (fill_popup_menu_cb),
- G_OBJECT (component), 0);
-
- /* Load the selection from the last run */
- update_selection (component);
- update_primary_selection (component);
-
- /* If it gets fiddled with update */
- not = calendar_config_add_notification_tasks_selected (config_selection_changed_cb,
- component);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
-
- not = calendar_config_add_notification_primary_tasks (config_primary_selection_changed_cb,
- component);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
-
- /* Return the controls */
- *corba_sidebar_control = CORBA_Object_duplicate (BONOBO_OBJREF (sidebar_control), ev);
- *corba_view_control = CORBA_Object_duplicate (BONOBO_OBJREF (view_control), ev);
-
- /* The tasks component doesn't use the status bar so just return an empty label. */
- {
- GtkWidget *label = gtk_label_new ("");
- BonoboControl *control;
-
- gtk_widget_show (label);
- control = bonobo_control_new (label);
- *corba_statusbar_control = CORBA_Object_duplicate (BONOBO_OBJREF (control), ev);
- }
-}
-
-static GNOME_Evolution_CreatableItemTypeList *
-impl__get_userCreatableItems (PortableServer_Servant servant,
- CORBA_Environment *ev)
-{
- GNOME_Evolution_CreatableItemTypeList *list = GNOME_Evolution_CreatableItemTypeList__alloc ();
-
- list->_length = 1;
- list->_maximum = list->_length;
- list->_buffer = GNOME_Evolution_CreatableItemTypeList_allocbuf (list->_length);
-
- CORBA_sequence_set_release (list, FALSE);
-
- list->_buffer[0].id = CREATE_TASK_ID;
- list->_buffer[0].description = _("New task");
- list->_buffer[0].menuDescription = _("_Task");
- list->_buffer[0].tooltip = _("Create a new task");
- list->_buffer[0].menuShortcut = 't';
- list->_buffer[0].iconName = "new_task-16.png";
-
- return list;
-}
-
-static void
-config_create_ecal_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
-{
- TasksComponent *component = data;
- TasksComponentPrivate *priv;
-
- priv = component->priv;
-
- g_object_unref (priv->create_ecal);
- priv->create_ecal = NULL;
-
- priv->notifications = g_list_remove (priv->notifications, GUINT_TO_POINTER (id));
-}
-
-static gboolean
-setup_create_ecal (TasksComponent *component)
-{
- TasksComponentPrivate *priv;
- ESource *source = NULL;
- char *uid;
- guint not;
-
- priv = component->priv;
-
- if (priv->create_ecal)
- return TRUE;
-
- /* Try to use the client from the calendar first to avoid re-opening things */
- if (priv->tasks) {
- ECal *default_ecal;
-
- default_ecal = e_tasks_get_default_client (priv->tasks);
- if (default_ecal) {
- priv->create_ecal = g_object_ref (default_ecal);
- return TRUE;
- }
- }
-
- /* Get the current primary calendar, or try to set one if it doesn't already exist */
- uid = calendar_config_get_primary_tasks ();
- if (uid) {
- source = e_source_list_peek_source_by_uid (priv->source_list, uid);
- g_free (uid);
-
- priv->create_ecal = e_cal_new (source, CALOBJ_TYPE_TODO);
- }
-
- if (!priv->create_ecal) {
- /* Try to create a default if there isn't one */
- source = find_first_source (priv->source_list);
- if (source)
- priv->create_ecal = e_cal_new (source, CALOBJ_TYPE_TODO);
- }
-
- if (priv->create_ecal) {
- if (!e_cal_open (priv->create_ecal, FALSE, NULL)) {
- GtkWidget *dialog;
-
- dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
- GTK_MESSAGE_WARNING, GTK_BUTTONS_OK,
- _("Unable to open the task list '%s' for creating events and meetings"),
- e_source_peek_name (source));
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
-
- return FALSE;
- }
- } else {
- GtkWidget *dialog;
-
- dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
- GTK_MESSAGE_WARNING, GTK_BUTTONS_OK,
- _("There is no calendar available for creating tasks"));
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
-
- return FALSE;
- }
-
- /* Handle the fact it may change on us */
- not = calendar_config_add_notification_primary_calendar (config_create_ecal_changed_cb,
- component);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
-
- /* Save the primary source for use elsewhere */
- calendar_config_set_primary_tasks (e_source_peek_uid (source));
-
- return TRUE;
-}
-
-static void
-impl_requestCreateItem (PortableServer_Servant servant,
- const CORBA_char *item_type_name,
- CORBA_Environment *ev)
-{
- TasksComponent *tasks_component = TASKS_COMPONENT (bonobo_object_from_servant (servant));
- TasksComponentPrivate *priv;
- ECalComponent *comp;
- TaskEditor *editor;
-
- priv = tasks_component->priv;
-
- if (!setup_create_ecal (tasks_component))
- return;
-
- editor = task_editor_new (priv->create_ecal);
-
- if (strcmp (item_type_name, CREATE_TASK_ID) == 0) {
- comp = get_default_task (priv->create_ecal);
- } else {
- bonobo_exception_set (ev, ex_GNOME_Evolution_Component_UnknownType);
- return;
- }
-
- comp_editor_edit_comp (COMP_EDITOR (editor), comp);
- comp_editor_focus (COMP_EDITOR (editor));
-
- e_comp_editor_registry_add (comp_editor_registry, COMP_EDITOR (editor), TRUE);
-}
-
-/* Initialization */
-
-static void
-tasks_component_class_init (TasksComponentClass *klass)
-{
- POA_GNOME_Evolution_Component__epv *epv = &klass->epv;
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_peek_parent (klass);
-
- epv->createControls = impl_createControls;
- epv->_get_userCreatableItems = impl__get_userCreatableItems;
- epv->requestCreateItem = impl_requestCreateItem;
-
- object_class->dispose = impl_dispose;
- object_class->finalize = impl_finalize;
-}
-
-static void
-tasks_component_init (TasksComponent *component, TasksComponentClass *klass)
-{
- TasksComponentPrivate *priv;
- GSList *groups;
-
- priv = g_new0 (TasksComponentPrivate, 1);
- priv->config_directory = g_build_filename (g_get_home_dir (),
- ".evolution", "tasks", "config",
- NULL);
-
- /* load the groups from the configuration */
- priv->gconf_client = gconf_client_get_default ();
- priv->source_list = e_source_list_new_for_gconf (priv->gconf_client,
- "/apps/evolution/tasks/sources");
-
- /* create default tasks folders if there are no groups */
- groups = e_source_list_peek_groups (priv->source_list);
- if (!groups) {
- ESourceGroup *group;
- ESource *source;
- char *base_uri, *new_dir;
-
- /* create the source group */
- base_uri = g_build_filename (g_get_home_dir (),
- ".evolution/tasks/local/OnThisComputer/",
- NULL);
- group = e_source_group_new (_("On This Computer"), base_uri);
- e_source_list_add_group (priv->source_list, group, -1);
-
- /* migrate tasks from older setup */
- if (!migrate_old_tasks (group)) {
- /* create default tasks folders */
- new_dir = g_build_filename (base_uri, "Personal/", NULL);
- if (!e_mkdir_hier (new_dir, 0700)) {
- source = e_source_new (_("Personal"), "Personal");
- e_source_group_add_source (group, source, -1);
- }
-
- g_free (new_dir);
- }
-
- g_free (base_uri);
- }
-
- component->priv = priv;
-}
-
-/* Public API */
-
-TasksComponent *
-tasks_component_peek (void)
-{
- static TasksComponent *component = NULL;
-
- if (component == NULL) {
- component = g_object_new (tasks_component_get_type (), NULL);
-
- if (e_mkdir_hier (component->priv->config_directory, 0777) != 0) {
- g_warning (G_STRLOC ": Cannot create directory %s: %s",
- component->priv->config_directory, g_strerror (errno));
- g_object_unref (component);
- component = NULL;
- }
- }
-
- return component;
-}
-
-const char *
-tasks_component_peek_config_directory (TasksComponent *component)
-{
- return (const char *) component->priv->config_directory;
-}
-
-BONOBO_TYPE_FUNC_FULL (TasksComponent, GNOME_Evolution_Component, PARENT_TYPE, tasks_component)
diff --git a/calendar/gui/tasks-component.h b/calendar/gui/tasks-component.h
deleted file mode 100644
index 1c47c4d9b1..0000000000
--- a/calendar/gui/tasks-component.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* tasks-component.h
- *
- * Copyright (C) 2003 Rodrigo Moya
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Rodrigo Moya <rodrigo@ximian.com>
- */
-
-#ifndef _TASKS_COMPONENT_H_
-#define _TASKS_COMPONENT_H_
-
-#include <bonobo/bonobo-object.h>
-#include <libedataserver/e-source-list.h>
-#include "Evolution.h"
-
-
-#define TASKS_TYPE_COMPONENT (tasks_component_get_type ())
-#define TASKS_COMPONENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TASKS_TYPE_COMPONENT, TasksComponent))
-#define TASKS_COMPONENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TASKS_TYPE_COMPONENT, TasksComponentClass))
-#define TASKS_IS_COMPONENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TASKS_TYPE_COMPONENT))
-#define TASKS_IS_COMPONENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), TASKS_TYPE_COMPONENT))
-
-
-typedef struct _TasksComponent TasksComponent;
-typedef struct _TasksComponentPrivate TasksComponentPrivate;
-typedef struct _TasksComponentClass TasksComponentClass;
-
-struct _TasksComponent {
- BonoboObject parent;
-
- TasksComponentPrivate *priv;
-};
-
-struct _TasksComponentClass {
- BonoboObjectClass parent_class;
-
- POA_GNOME_Evolution_Component__epv epv;
-};
-
-
-GType tasks_component_get_type (void);
-TasksComponent *tasks_component_peek (void);
-const char *tasks_component_peek_config_directory (TasksComponent *component);
-ESourceList *tasks_component_peek_source_list (TasksComponent *component);
-
-#endif /* _TASKS_COMPONENT_H_ */
diff --git a/calendar/gui/tasks-control.c b/calendar/gui/tasks-control.c
deleted file mode 100644
index 0c0a3bd202..0000000000
--- a/calendar/gui/tasks-control.c
+++ /dev/null
@@ -1,627 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* tasks-control.c
- *
- * Copyright (C) 2000, 2001, 2002, 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Damon Chaplin <damon@ximian.com>
- * Ettore Perazzoli
- */
-
-#include <config.h>
-#include <gtk/gtksignal.h>
-#include <gtk/gtklabel.h>
-#include <gtk/gtkcheckbutton.h>
-#include <gtk/gtkmessagedialog.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnome/gnome-util.h>
-#include <libgnomeui/gnome-dialog.h>
-#include <libgnomeui/gnome-dialog-util.h>
-#include <libgnomeui/gnome-stock-icons.h>
-#include <libgnomeprint/gnome-print.h>
-#include <libgnomeprint/gnome-print-paper.h>
-#include <libgnomeprint/gnome-print-job.h>
-#include <libgnomeprintui/gnome-print-job-preview.h>
-#include <libgnomeprintui/gnome-print-paper-selector.h>
-#include <libgnomeprintui/gnome-print-preview.h>
-#include <libgnomeprintui/gnome-print-dialog.h>
-#include <bonobo/bonobo-control.h>
-#include <bonobo/bonobo-property-bag.h>
-#include <bonobo/bonobo-ui-util.h>
-#include <gal/widgets/e-gui-utils.h>
-#include <e-util/e-dialog-utils.h>
-#include "dialogs/cal-prefs-dialog.h"
-#include "calendar-config.h"
-#include "calendar-commands.h"
-#include "e-tasks.h"
-#include "e-calendar-table.h"
-#include "tasks-control.h"
-#include "evolution-shell-component-utils.h"
-
-#define TASKS_CONTROL_PROPERTY_URI "folder_uri"
-#define TASKS_CONTROL_PROPERTY_URI_IDX 1
-#define FIXED_MARGIN .05
-
-
-static void tasks_control_properties_init (BonoboControl *control,
- ETasks *tasks);
-static void tasks_control_get_property (BonoboPropertyBag *bag,
- BonoboArg *arg,
- guint arg_id,
- CORBA_Environment *ev,
- gpointer user_data);
-static void tasks_control_set_property (BonoboPropertyBag *bag,
- const BonoboArg *arg,
- guint arg_id,
- CORBA_Environment *ev,
- gpointer user_data);
-static void tasks_control_activate_cb (BonoboControl *control,
- gboolean activate,
- gpointer user_data);
-static void tasks_control_new_task_cmd (BonoboUIComponent *uic,
- gpointer data,
- const char *path);
-static void tasks_control_cut_cmd (BonoboUIComponent *uic,
- gpointer data,
- const gchar *path);
-static void tasks_control_copy_cmd (BonoboUIComponent *uic,
- gpointer data,
- const gchar *path);
-static void tasks_control_paste_cmd (BonoboUIComponent *uic,
- gpointer data,
- const gchar *path);
-static void tasks_control_delete_cmd (BonoboUIComponent *uic,
- gpointer data,
- const char *path);
-static void tasks_control_complete_cmd (BonoboUIComponent *uic,
- gpointer data,
- const char *path);
-static void tasks_control_purge_cmd (BonoboUIComponent *uic,
- gpointer data,
- const char *path);
-static void tasks_control_print_cmd (BonoboUIComponent *uic,
- gpointer data,
- const char *path);
-static void tasks_control_print_preview_cmd (BonoboUIComponent *uic,
- gpointer data,
- const char *path);
-
-
-static GnomePrintConfig *print_config = NULL;
-
-
-BonoboControl *
-tasks_control_new (void)
-{
- BonoboControl *control;
- GtkWidget *tasks;
-
- tasks = e_tasks_new ();
- if (!tasks)
- return NULL;
- gtk_widget_show (tasks);
-
- control = bonobo_control_new (tasks);
- if (!control) {
- gtk_widget_destroy (tasks);
- g_message ("control_factory_fn(): could not create the control!");
- return NULL;
- }
-
- tasks_control_properties_init (control, E_TASKS (tasks));
-
- g_signal_connect (control, "activate", G_CALLBACK (tasks_control_activate_cb), tasks);
-
- return control;
-}
-
-
-/* Creates the property bag for our new control. */
-static void
-tasks_control_properties_init (BonoboControl *control,
- ETasks *tasks)
-
-{
- BonoboPropertyBag *pbag;
-
- pbag = bonobo_property_bag_new (tasks_control_get_property,
- tasks_control_set_property, tasks);
-
- bonobo_property_bag_add (pbag,
- TASKS_CONTROL_PROPERTY_URI,
- TASKS_CONTROL_PROPERTY_URI_IDX,
- BONOBO_ARG_STRING,
- NULL,
- _("The URI of the tasks folder to display"),
- 0);
-
- bonobo_control_set_properties (control, bonobo_object_corba_objref (BONOBO_OBJECT (pbag)), NULL);
- bonobo_object_unref (BONOBO_OBJECT (pbag));
-}
-
-
-/* Gets a property of our control. FIXME: Finish. */
-static void
-tasks_control_get_property (BonoboPropertyBag *bag,
- BonoboArg *arg,
- guint arg_id,
- CORBA_Environment *ev,
- gpointer user_data)
-{
- ETasks *tasks = user_data;
- const char *uri;
- ECalModel *model;
-
- switch (arg_id) {
-
- case TASKS_CONTROL_PROPERTY_URI_IDX:
- model = e_calendar_table_get_model (e_tasks_get_calendar_table (tasks));
- uri = e_cal_get_uri (e_cal_model_get_default_client (model));
- BONOBO_ARG_SET_STRING (arg, uri);
- break;
-
- default:
- g_warning ("Unhandled arg %d\n", arg_id);
- }
-}
-
-
-static void
-tasks_control_set_property (BonoboPropertyBag *bag,
- const BonoboArg *arg,
- guint arg_id,
- CORBA_Environment *ev,
- gpointer user_data)
-{
- ETasks *tasks = user_data;
- char *uri;
-
- switch (arg_id) {
-
- case TASKS_CONTROL_PROPERTY_URI_IDX:
- /* FIXME Remove the old uri? */
- uri = BONOBO_ARG_GET_STRING (arg);
- if (!e_tasks_add_todo_uri (tasks, uri)) {
- char *msg;
-
- msg = g_strdup_printf (_("Could not load the tasks in `%s'"), uri);
- gnome_error_dialog_parented (
- msg,
- GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (tasks))));
- g_free (msg);
- }
- break;
-
- default:
- g_warning ("Unhandled arg %d\n", arg_id);
- break;
- }
-}
-
-
-static void
-tasks_control_activate_cb (BonoboControl *control,
- gboolean activate,
- gpointer user_data)
-{
- ETasks *tasks;
-
- tasks = E_TASKS (user_data);
-
- if (activate)
- tasks_control_activate (control, tasks);
- else
- tasks_control_deactivate (control, tasks);
-}
-
-/* Sensitizes the UI Component menu/toolbar commands based on the number of
- * selected tasks.
- */
-static void
-sensitize_commands (ETasks *tasks, BonoboControl *control, int n_selected)
-{
- BonoboUIComponent *uic;
- gboolean read_only = TRUE;
- ECalModel *model;
-
- uic = bonobo_control_get_ui_component (control);
- g_assert (uic != NULL);
-
- model = e_calendar_table_get_model (e_tasks_get_calendar_table (tasks));
- e_cal_is_read_only (e_cal_model_get_default_client (model), &read_only, NULL);
-
- bonobo_ui_component_set_prop (uic, "/commands/TasksCut", "sensitive",
- n_selected == 0 || read_only ? "0" : "1",
- NULL);
- bonobo_ui_component_set_prop (uic, "/commands/TasksCopy", "sensitive",
- n_selected == 0 ? "0" : "1",
- NULL);
- bonobo_ui_component_set_prop (uic, "/commands/TasksPaste", "sensitive",
- read_only ? "0" : "1",
- NULL);
- bonobo_ui_component_set_prop (uic, "/commands/TasksDelete", "sensitive",
- n_selected == 0 || read_only ? "0" : "1",
- NULL);
- bonobo_ui_component_set_prop (uic, "/commands/TasksMarkComplete", "sensitive",
- n_selected == 0 || read_only ? "0" : "1",
- NULL);
- bonobo_ui_component_set_prop (uic, "/commands/TasksPurge", "sensitive",
- read_only ? "0" : "1",
- NULL);
-}
-
-/* Callback used when the selection in the table changes */
-static void
-selection_changed_cb (ETasks *tasks, int n_selected, gpointer data)
-{
- BonoboControl *control;
-
- control = BONOBO_CONTROL (data);
-
- sensitize_commands (tasks, control, n_selected);
-}
-
-static BonoboUIVerb verbs [] = {
- BONOBO_UI_VERB ("TasksNewTask", tasks_control_new_task_cmd),
- BONOBO_UI_VERB ("TasksCut", tasks_control_cut_cmd),
- BONOBO_UI_VERB ("TasksCopy", tasks_control_copy_cmd),
- BONOBO_UI_VERB ("TasksPaste", tasks_control_paste_cmd),
- BONOBO_UI_VERB ("TasksDelete", tasks_control_delete_cmd),
- BONOBO_UI_VERB ("TasksMarkComplete", tasks_control_complete_cmd),
- BONOBO_UI_VERB ("TasksPurge", tasks_control_purge_cmd),
- BONOBO_UI_VERB ("TasksPrint", tasks_control_print_cmd),
- BONOBO_UI_VERB ("TasksPrintPreview", tasks_control_print_preview_cmd),
-
- BONOBO_UI_VERB_END
-};
-
-void
-tasks_control_activate (BonoboControl *control, ETasks *tasks)
-{
- Bonobo_UIContainer remote_uih;
- BonoboUIComponent *uic;
- int n_selected;
- ECalendarTable *cal_table;
- ETable *etable;
-
- uic = bonobo_control_get_ui_component (control);
- g_assert (uic != NULL);
-
- remote_uih = bonobo_control_get_remote_ui_container (control, NULL);
- bonobo_ui_component_set_container (uic, remote_uih, NULL);
- bonobo_object_release_unref (remote_uih, NULL);
-
- e_tasks_set_ui_component (tasks, uic);
-
- bonobo_ui_component_add_verb_list_with_data (uic, verbs, tasks);
-
- bonobo_ui_component_freeze (uic, NULL);
-
- bonobo_ui_util_set_ui (uic, PREFIX,
- EVOLUTION_UIDIR "/evolution-tasks.xml",
- "evolution-tasks",
- NULL);
-
- e_tasks_setup_view_menus (tasks, uic);
-
- /* Signals from the tasks widget; also sensitize the menu items as appropriate */
-
- g_signal_connect (tasks, "selection_changed", G_CALLBACK (selection_changed_cb), control);
-
- cal_table = e_tasks_get_calendar_table (tasks);
- etable = e_calendar_table_get_table (cal_table);
- n_selected = e_table_selected_count (etable);
-
- sensitize_commands (tasks, control, n_selected);
-
- bonobo_ui_component_thaw (uic, NULL);
-
- /* Show the dialog for setting the timezone if the user hasn't chosen
- a default timezone already. This is done in the startup wizard now,
- so we don't do it here. */
-#if 0
- calendar_config_check_timezone_set ();
-#endif
-}
-
-
-void
-tasks_control_deactivate (BonoboControl *control, ETasks *tasks)
-{
- BonoboUIComponent *uic = bonobo_control_get_ui_component (control);
-
- g_assert (uic != NULL);
-
- e_tasks_set_ui_component (tasks, NULL);
-
- e_tasks_discard_view_menus (tasks);
-
- /* Stop monitoring the "selection_changed" signal */
- g_signal_handlers_disconnect_matched (tasks, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, control);
-
- bonobo_ui_component_rm (uic, "/", NULL);
- bonobo_ui_component_unset_container (uic, NULL);
-}
-
-
-static void
-tasks_control_new_task_cmd (BonoboUIComponent *uic,
- gpointer data,
- const char *path)
-{
- ETasks *tasks;
-
- tasks = E_TASKS (data);
- e_tasks_new_task (tasks);
-}
-
-static void
-tasks_control_cut_cmd (BonoboUIComponent *uic,
- gpointer data,
- const char *path)
-{
- ETasks *tasks;
- ECalendarTable *cal_table;
-
- tasks = E_TASKS (data);
- cal_table = e_tasks_get_calendar_table (tasks);
- e_calendar_table_cut_clipboard (cal_table);
-}
-
-static void
-tasks_control_copy_cmd (BonoboUIComponent *uic,
- gpointer data,
- const char *path)
-{
- ETasks *tasks;
- ECalendarTable *cal_table;
-
- tasks = E_TASKS (data);
- cal_table = e_tasks_get_calendar_table (tasks);
- e_calendar_table_copy_clipboard (cal_table);
-}
-
-static void
-tasks_control_paste_cmd (BonoboUIComponent *uic,
- gpointer data,
- const char *path)
-{
- ETasks *tasks;
- ECalendarTable *cal_table;
-
- tasks = E_TASKS (data);
- cal_table = e_tasks_get_calendar_table (tasks);
- e_calendar_table_paste_clipboard (cal_table);
-}
-
-static void
-tasks_control_delete_cmd (BonoboUIComponent *uic,
- gpointer data,
- const char *path)
-{
- ETasks *tasks;
-
- tasks = E_TASKS (data);
- e_tasks_delete_selected (tasks);
-}
-
-static void
-tasks_control_complete_cmd (BonoboUIComponent *uic,
- gpointer data,
- const char *path)
-{
- ETasks *tasks;
-
- tasks = E_TASKS (data);
- e_tasks_complete_selected (tasks);
-}
-
-static gboolean
-confirm_purge (ETasks *tasks)
-{
- GtkWidget *dialog, *checkbox, *parent;
- int button;
-
- if (!calendar_config_get_confirm_purge ())
- return TRUE;
-
- parent = gtk_widget_get_toplevel (GTK_WIDGET (tasks));
- dialog = gtk_message_dialog_new (
- (GtkWindow *)parent,
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_YES_NO,
- _("This operation will permanently erase all tasks marked as completed. If you continue, you will not be able to recover these tasks.\n\nReally erase these tasks?"));
- gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_NO);
-
- checkbox = gtk_check_button_new_with_label (_("Do not ask me again."));
- gtk_widget_show (checkbox);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), checkbox, TRUE, TRUE, 6);
-
- button = gtk_dialog_run (GTK_DIALOG (dialog));
- if (button == GTK_RESPONSE_YES && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbox)))
- calendar_config_set_confirm_purge (FALSE);
- gtk_widget_destroy (dialog);
-
- return button == GTK_RESPONSE_YES ? TRUE : FALSE;
-}
-
-static void
-tasks_control_purge_cmd (BonoboUIComponent *uic,
- gpointer data,
- const char *path)
-{
- ETasks *tasks;
-
- tasks = E_TASKS (data);
-
- if (confirm_purge (tasks))
- e_tasks_delete_completed (tasks);
-}
-
-
-static void
-print_title (GnomePrintContext *pc,
- double page_width, double page_height)
-{
- GnomeFont *font;
- char *text;
- double w, x, y;
-
- font = gnome_font_find_closest ("Sans Bold", 18);
-
- text = _("Tasks");
- w = gnome_font_get_width_utf8 (font, text);
-
- x = (page_width - w) / 2;
- y = page_height - gnome_font_get_ascender (font);
-
- gnome_print_moveto (pc, x, y);
- gnome_print_setfont (pc, font);
- gnome_print_setrgbcolor (pc, 0, 0, 0);
- gnome_print_show (pc, text);
-
- g_object_unref (font);
-}
-
-static void
-print_tasks (ETasks *tasks, gboolean preview)
-{
- ECalendarTable *cal_table;
- EPrintable *printable;
- ETable *etable;
- GnomePrintContext *pc;
- GnomePrintJob *gpm;
- double l, r, t, b, page_width, page_height, left_margin, bottom_margin;
-
- if (!print_config)
- print_config = gnome_print_config_default ();
-
- cal_table = e_tasks_get_calendar_table (tasks);
- etable = e_calendar_table_get_table (E_CALENDAR_TABLE (cal_table));
- printable = e_table_get_printable (etable);
- g_object_ref (printable);
- gtk_object_sink (GTK_OBJECT (printable));
- e_printable_reset (printable);
-
- gpm = gnome_print_job_new (print_config);
- pc = gnome_print_job_get_context (gpm);
-
- gnome_print_config_get_page_size (print_config, &r, &t);
-
-#if 0
- gnome_print_config_get_double (print_config, GNOME_PRINT_KEY_PAGE_MARGIN_TOP, &temp_d);
- t -= temp_d;
- gnome_print_config_get_double (print_config, GNOME_PRINT_KEY_PAGE_MARGIN_RIGHT, &temp_d);
- r -= temp_d;
- gnome_print_config_get_double (print_config, GNOME_PRINT_KEY_PAGE_MARGIN_BOTTOM, &b);
- gnome_print_config_get_double (print_config, GNOME_PRINT_KEY_PAGE_MARGIN_LEFT, &l);
-#endif
-
- b = t * FIXED_MARGIN;
- l = r * FIXED_MARGIN;
- t *= (1.0 - FIXED_MARGIN);
- r *= (1.0 - FIXED_MARGIN);
-
- page_width = r - l;
- page_height = t - b;
- left_margin = l;
- bottom_margin = b;
-
- while (e_printable_data_left (printable)) {
- gnome_print_beginpage (pc, "Tasks");
- gnome_print_gsave (pc);
-
- gnome_print_translate (pc, left_margin, bottom_margin);
-
- print_title (pc, page_width, page_height);
-
- e_printable_print_page (printable, pc,
- page_width, page_height - 24, TRUE);
-
- gnome_print_grestore (pc);
- gnome_print_showpage (pc);
- }
-
- gnome_print_job_close (gpm);
-
- if (preview) {
- GtkWidget *gpmp;
- gpmp = gnome_print_job_preview_new (gpm, _("Print Preview"));
- gtk_widget_show (gpmp);
- } else {
- gnome_print_job_print (gpm);
- }
-
- g_object_unref (gpm);
- g_object_unref (printable);
-}
-
-
-/* File/Print callback */
-static void
-tasks_control_print_cmd (BonoboUIComponent *uic,
- gpointer data,
- const char *path)
-{
- ETasks *tasks;
- GtkWidget *gpd;
- gboolean preview = FALSE;
- GnomePrintJob *gpm;
-
- tasks = E_TASKS (data);
-
- if (!print_config)
- print_config = gnome_print_config_default ();
-
- gpm = gnome_print_job_new (print_config);
-
- gpd = gnome_print_dialog_new (gpm, _("Print Tasks"), GNOME_PRINT_DIALOG_COPIES);
- gtk_dialog_set_default_response (GTK_DIALOG (gpd), GNOME_PRINT_DIALOG_RESPONSE_PRINT);
-
- /* Run dialog */
- switch (gtk_dialog_run (GTK_DIALOG (gpd))) {
- case GNOME_PRINT_DIALOG_RESPONSE_PRINT:
- break;
-
- case GNOME_PRINT_DIALOG_RESPONSE_PREVIEW:
- preview = TRUE;
- break;
-
- case -1:
- return;
-
- default:
- gtk_widget_destroy (gpd);
- return;
- }
-
- gtk_widget_destroy (gpd);
- print_tasks (tasks, preview);
-}
-
-static void
-tasks_control_print_preview_cmd (BonoboUIComponent *uic,
- gpointer data,
- const char *path)
-{
- ETasks *tasks;
-
- tasks = E_TASKS (data);
-
- print_tasks (tasks, TRUE);
-}
-
diff --git a/calendar/gui/tasks-control.h b/calendar/gui/tasks-control.h
deleted file mode 100644
index eca68c3f0a..0000000000
--- a/calendar/gui/tasks-control.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* tasks-control.h
- *
- * Copyright (C) 2000, 2001, 2002, 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Federico Mena Quintero <federico@ximian.com>
- * Damon Chaplin <damon@ximian.com>
- */
-
-#ifndef _TASKS_CONTROL_H_
-#define _TASKS_CONTROL_H_
-
-#include "e-tasks.h"
-
-BonoboControl *tasks_control_new (void);
-void tasks_control_activate (BonoboControl *control, ETasks *tasks);
-void tasks_control_deactivate (BonoboControl *control, ETasks *tasks);
-
-
-#endif /* _TASKS_CONTROL_H_ */
diff --git a/calendar/gui/weekday-picker.c b/calendar/gui/weekday-picker.c
deleted file mode 100644
index 87438fd62d..0000000000
--- a/calendar/gui/weekday-picker.c
+++ /dev/null
@@ -1,572 +0,0 @@
-/* Evolution calendar - Week day picker widget
- *
- * Copyright (C) 2000 Ximian, Inc.
- *
- * Author: Federico Mena-Quintero <federico@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-#include <gtk/gtksignal.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnomecanvas/gnome-canvas-rect-ellipse.h>
-#include <libgnomecanvas/gnome-canvas-text.h>
-#include <gal/util/e-util.h>
-#include "weekday-picker.h"
-
-
-
-#define PADDING 2
-
-/* Private part of the WeekdayPicker structure */
-struct _WeekdayPickerPrivate {
- /* Selected days; see weekday_picker_set_days() */
- guint8 day_mask;
-
- /* Blocked days; these cannot be modified */
- guint8 blocked_day_mask;
-
- /* Day that defines the start of the week; 0 = Sunday, ..., 6 = Saturday */
- int week_start_day;
-
- /* Metrics */
- int font_ascent, font_descent;
- int max_letter_width;
-
- /* Components */
- GnomeCanvasItem *boxes[7];
- GnomeCanvasItem *labels[7];
-};
-
-
-
-/* Signal IDs */
-enum {
- CHANGED,
- LAST_SIGNAL
-};
-
-static void weekday_picker_class_init (WeekdayPickerClass *class);
-static void weekday_picker_init (WeekdayPicker *wp);
-static void weekday_picker_destroy (GtkObject *object);
-
-static void weekday_picker_realize (GtkWidget *widget);
-static void weekday_picker_size_request (GtkWidget *widget, GtkRequisition *requisition);
-static void weekday_picker_size_allocate (GtkWidget *widget, GtkAllocation *allocation);
-static void weekday_picker_style_set (GtkWidget *widget, GtkStyle *previous_style);
-
-static GnomeCanvasClass *parent_class;
-
-static guint wp_signals[LAST_SIGNAL];
-
-
-
-E_MAKE_TYPE (weekday_picker, "WeekdayPicker", WeekdayPicker,
- weekday_picker_class_init, weekday_picker_init, GNOME_TYPE_CANVAS);
-
-/* Class initialization function for the weekday picker */
-static void
-weekday_picker_class_init (WeekdayPickerClass *class)
-{
- GtkObjectClass *object_class;
- GtkWidgetClass *widget_class;
-
- object_class = (GtkObjectClass *) class;
- widget_class = (GtkWidgetClass *) class;
-
- parent_class = g_type_class_peek_parent (class);
-
- wp_signals[CHANGED] =
- gtk_signal_new ("changed",
- GTK_RUN_FIRST,
- G_TYPE_FROM_CLASS (object_class),
- GTK_SIGNAL_OFFSET (WeekdayPickerClass, changed),
- gtk_marshal_NONE__NONE,
- GTK_TYPE_NONE, 0);
-
- object_class->destroy = weekday_picker_destroy;
-
- widget_class->realize = weekday_picker_realize;
- widget_class->size_request = weekday_picker_size_request;
- widget_class->size_allocate = weekday_picker_size_allocate;
- widget_class->style_set = weekday_picker_style_set;
-
- class->changed = NULL;
-}
-
-/* Event handler for the day items */
-static gint
-day_event_cb (GnomeCanvasItem *item, GdkEvent *event, gpointer data)
-{
- WeekdayPicker *wp;
- WeekdayPickerPrivate *priv;
- int i;
- guint8 day_mask;
-
- wp = WEEKDAY_PICKER (data);
- priv = wp->priv;
-
- if (!(event->type == GDK_BUTTON_PRESS && event->button.button == 1))
- return FALSE;
-
- /* Find which box was clicked */
-
- for (i = 0; i < 7; i++)
- if (priv->boxes[i] == item || priv->labels[i] == item)
- break;
-
- g_assert (i != 7);
-
- /* Turn on that day */
-
- i += priv->week_start_day;
- if (i >= 7)
- i -= 7;
-
- if (priv->blocked_day_mask & (0x1 << i))
- return TRUE;
-
- if (priv->day_mask & (0x1 << i))
- day_mask = priv->day_mask & ~(0x1 << i);
- else
- day_mask = priv->day_mask | (0x1 << i);
-
- weekday_picker_set_days (wp, day_mask);
-
- return TRUE;
-}
-
-
-/* Creates the canvas items for the weekday picker. The items are empty until
- * they are configured elsewhere.
- */
-static void
-create_items (WeekdayPicker *wp)
-{
- WeekdayPickerPrivate *priv;
- GnomeCanvasGroup *parent;
- int i;
-
- priv = wp->priv;
-
- parent = gnome_canvas_root (GNOME_CANVAS (wp));
-
- for (i = 0; i < 7; i++) {
- priv->boxes[i] = gnome_canvas_item_new (parent,
- GNOME_TYPE_CANVAS_RECT,
- NULL);
- g_signal_connect (priv->boxes[i], "event", G_CALLBACK (day_event_cb), wp);
-
- priv->labels[i] = gnome_canvas_item_new (parent,
- GNOME_TYPE_CANVAS_TEXT,
- NULL);
- g_signal_connect (priv->labels[i], "event", G_CALLBACK (day_event_cb), wp);
- }
-}
-
-/* Object initialization function for the weekday picker */
-static void
-weekday_picker_init (WeekdayPicker *wp)
-{
- WeekdayPickerPrivate *priv;
-
- GTK_WIDGET_UNSET_FLAGS (wp, GTK_CAN_FOCUS);
-
- priv = g_new0 (WeekdayPickerPrivate, 1);
-
- wp->priv = priv;
-
- create_items (wp);
-}
-
-/* Finalize handler for the weekday picker */
-static void
-weekday_picker_destroy (GtkObject *object)
-{
- WeekdayPicker *wp;
- WeekdayPickerPrivate *priv;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (IS_WEEKDAY_PICKER (object));
-
- wp = WEEKDAY_PICKER (object);
- priv = wp->priv;
-
- g_free (priv);
- wp->priv = NULL;
-
- if (GTK_OBJECT_CLASS (parent_class)->destroy)
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
-}
-
-static void
-colorize_items (WeekdayPicker *wp)
-{
- WeekdayPickerPrivate *priv;
- GdkColor *outline;
- GdkColor *fill, *sel_fill;
- GdkColor *text_fill, *sel_text_fill;
- int i;
-
- priv = wp->priv;
-
- outline = &GTK_WIDGET (wp)->style->fg[GTK_WIDGET_STATE (wp)];
-
- fill = &GTK_WIDGET (wp)->style->base[GTK_WIDGET_STATE (wp)];
- text_fill = &GTK_WIDGET (wp)->style->fg[GTK_WIDGET_STATE (wp)];
-
- sel_fill = &GTK_WIDGET (wp)->style->bg[GTK_STATE_SELECTED];
- sel_text_fill = &GTK_WIDGET (wp)->style->fg[GTK_STATE_SELECTED];
-
- for (i = 0; i < 7; i++) {
- int day;
- GdkColor *f, *t;
-
- day = i + priv->week_start_day;
- if (day >= 7)
- day -= 7;
-
- if (priv->day_mask & (0x1 << day)) {
- f = sel_fill;
- t = sel_text_fill;
- } else {
- f = fill;
- t = text_fill;
- }
-
- gnome_canvas_item_set (priv->boxes[i],
- "fill_color_gdk", f,
- "outline_color_gdk", outline,
- NULL);
-
- gnome_canvas_item_set (priv->labels[i],
- "fill_color_gdk", t,
- NULL);
- }
-}
-
-/* Configures the items in the weekday picker by setting their attributes. */
-static char *
-get_day_text (int day_index)
-{
- const char *str = _("SMTWTFS");
- char *day;
- int char_size = 0;
-
- day = g_utf8_offset_to_pointer (str, day_index);
-
- /* we use strlen because we actually want to count bytes */
- if (day_index == 6)
- char_size = strlen (day);
- else
- char_size = strlen (day) - strlen (g_utf8_find_next_char (day, NULL));
-
- return g_strndup (day, char_size);
-}
-
-static void
-configure_items (WeekdayPicker *wp)
-{
- WeekdayPickerPrivate *priv;
- int width, height;
- int box_width;
- int i;
-
- priv = wp->priv;
-
- width = GTK_WIDGET (wp)->allocation.width;
- height = GTK_WIDGET (wp)->allocation.height;
-
- box_width = (width - 1) / 7;
-
- for (i = 0; i < 7; i++) {
- char *c;
- int day;
-
- day = i + priv->week_start_day;
- if (day >= 7)
- day -= 7;
-
- gnome_canvas_item_set (priv->boxes[i],
- "x1", (double) (i * box_width),
- "y1", (double) 0,
- "x2", (double) ((i + 1) * box_width),
- "y2", (double) (height - 1),
- "width_pixels", 0,
- NULL);
-
- c = get_day_text (day);
- gnome_canvas_item_set (priv->labels[i],
- "text", c,
-#if 0
- "font_gdk", gtk_style_get_font (gtk_widget_get_style (GTK_WIDGET (wp))),
-#endif
- "x", (double) (i * box_width) + box_width / 2.0,
- "y", (double) (1 + PADDING),
- "anchor", GTK_ANCHOR_N,
- NULL);
- g_free (c);
- }
-
- colorize_items (wp);
-}
-
-/* Realize handler for the weekday picker */
-static void
-weekday_picker_realize (GtkWidget *widget)
-{
- WeekdayPicker *wp;
-
- wp = WEEKDAY_PICKER (widget);
-
- if (GTK_WIDGET_CLASS (parent_class)->realize)
- (* GTK_WIDGET_CLASS (parent_class)->realize) (widget);
-
- configure_items (wp);
-}
-
-/* Size_request handler for the weekday picker */
-static void
-weekday_picker_size_request (GtkWidget *widget, GtkRequisition *requisition)
-{
- WeekdayPicker *wp;
- WeekdayPickerPrivate *priv;
-
- wp = WEEKDAY_PICKER (widget);
- priv = wp->priv;
-
- requisition->width = (priv->max_letter_width + 2 * PADDING + 1) * 7 + 1;
- requisition->height = (priv->font_ascent + priv->font_descent + 2 * PADDING + 2);
-}
-
-/* Size_allocate handler for the weekday picker */
-static void
-weekday_picker_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
-{
- WeekdayPicker *wp;
-
- wp = WEEKDAY_PICKER (widget);
-
- if (GTK_WIDGET_CLASS (parent_class)->size_allocate)
- (* GTK_WIDGET_CLASS (parent_class)->size_allocate) (widget, allocation);
-
- gnome_canvas_set_scroll_region (GNOME_CANVAS (wp),
- 0, 0, allocation->width, allocation->height);
-
- configure_items (wp);
-}
-
-/* Style_set handler for the weekday picker */
-static void
-weekday_picker_style_set (GtkWidget *widget, GtkStyle *previous_style)
-{
- WeekdayPicker *wp;
- WeekdayPickerPrivate *priv;
- int max_width;
- int i;
- PangoFontDescription *font_desc;
- PangoContext *pango_context;
- PangoFontMetrics *font_metrics;
- PangoLayout *layout;
-
- wp = WEEKDAY_PICKER (widget);
- priv = wp->priv;
-
- /* Set up Pango prerequisites */
- font_desc = gtk_widget_get_style (widget)->font_desc;
- pango_context = gtk_widget_get_pango_context (widget);
- font_metrics = pango_context_get_metrics (pango_context, font_desc,
- pango_context_get_language (pango_context));
- layout = pango_layout_new (pango_context);
-
- priv->font_ascent = PANGO_PIXELS (pango_font_metrics_get_ascent (font_metrics));
- priv->font_descent = PANGO_PIXELS (pango_font_metrics_get_descent (font_metrics));
-
- max_width = 0;
-
- for (i = 0; i < 7; i++) {
- char *c;
- int w;
-
- c = get_day_text (i);
- pango_layout_set_text (layout, c, strlen (c));
- pango_layout_get_pixel_size (layout, &w, NULL);
- g_free (c);
-
- if (w > max_width)
- max_width = w;
- }
-
- priv->max_letter_width = max_width;
-
- configure_items (wp);
- g_object_unref (layout);
- pango_font_metrics_unref (font_metrics);
-
- if (GTK_WIDGET_CLASS (parent_class)->style_set)
- (* GTK_WIDGET_CLASS (parent_class)->style_set) (widget, previous_style);
-}
-
-
-
-/**
- * weekday_picker_new:
- * @void:
- *
- * Creates a new weekday picker widget.
- *
- * Return value: A newly-created weekday picker.
- **/
-GtkWidget *
-weekday_picker_new (void)
-{
- return g_object_new (TYPE_WEEKDAY_PICKER, NULL);
-}
-
-/**
- * weekday_picker_set_days:
- * @wp: A weekday picker.
- * @day_mask: Bitmask with the days to be selected.
- *
- * Sets the days that are selected in a weekday picker. In the @day_mask,
- * Sunday is bit 0, Monday is bit 1, etc.
- **/
-void
-weekday_picker_set_days (WeekdayPicker *wp, guint8 day_mask)
-{
- WeekdayPickerPrivate *priv;
-
- g_return_if_fail (wp != NULL);
- g_return_if_fail (IS_WEEKDAY_PICKER (wp));
-
- priv = wp->priv;
-
- priv->day_mask = day_mask;
- colorize_items (wp);
-
- gtk_signal_emit (GTK_OBJECT (wp), wp_signals[CHANGED]);
-}
-
-/**
- * weekday_picker_get_days:
- * @wp: A weekday picker.
- *
- * Queries the days that are selected in a weekday picker.
- *
- * Return value: Bit mask of selected days. Sunday is bit 0, Monday is bit 1,
- * etc.
- **/
-guint8
-weekday_picker_get_days (WeekdayPicker *wp)
-{
- WeekdayPickerPrivate *priv;
-
- g_return_val_if_fail (wp != NULL, 0);
- g_return_val_if_fail (IS_WEEKDAY_PICKER (wp), 0);
-
- priv = wp->priv;
- return priv->day_mask;
-}
-
-/**
- * weekday_picker_set_blocked_days:
- * @wp: A weekday picker.
- * @blocked_day_mask: Bitmask with the days to be blocked.
- *
- * Sets the days that the weekday picker will prevent from being modified by the
- * user. The @blocked_day_mask is specified in the same way as in
- * weekday_picker_set_days().
- **/
-void
-weekday_picker_set_blocked_days (WeekdayPicker *wp, guint8 blocked_day_mask)
-{
- WeekdayPickerPrivate *priv;
-
- g_return_if_fail (wp != NULL);
- g_return_if_fail (IS_WEEKDAY_PICKER (wp));
-
- priv = wp->priv;
- priv->blocked_day_mask = blocked_day_mask;
-}
-
-/**
- * weekday_picker_get_blocked_days:
- * @wp: A weekday picker.
- *
- * Queries the set of days that the weekday picker prevents from being modified
- * by the user.
- *
- * Return value: Bit mask of blocked days, with the same format as that returned
- * by weekday_picker_get_days().
- **/
-guint
-weekday_picker_get_blocked_days (WeekdayPicker *wp)
-{
- WeekdayPickerPrivate *priv;
-
- g_return_val_if_fail (wp != NULL, 0);
- g_return_val_if_fail (IS_WEEKDAY_PICKER (wp), 0);
-
- priv = wp->priv;
- return priv->blocked_day_mask;
-}
-
-/**
- * weekday_picker_set_week_start_day:
- * @wp: A weekday picker.
- * @week_start_day: Index of the day that defines the start of the week; 0 is
- * Sunday, 1 is Monday, etc.
- *
- * Sets the day that defines the start of the week for a weekday picker.
- **/
-void
-weekday_picker_set_week_start_day (WeekdayPicker *wp, int week_start_day)
-{
- WeekdayPickerPrivate *priv;
-
- g_return_if_fail (wp != NULL);
- g_return_if_fail (IS_WEEKDAY_PICKER (wp));
- g_return_if_fail (week_start_day >= 0 && week_start_day < 7);
-
- priv = wp->priv;
- priv->week_start_day = week_start_day;
-
- configure_items (wp);
-}
-
-/**
- * weekday_picker_get_week_start_day:
- * @wp: A weekday picker.
- *
- * Queries the day that defines the start of the week in a weekday picker.
- *
- * Return value: Index of the day that defines the start of the week. See
- * weekday_picker_set_week_start_day() to see how this is represented.
- **/
-int
-weekday_picker_get_week_start_day (WeekdayPicker *wp)
-{
- WeekdayPickerPrivate *priv;
-
- g_return_val_if_fail (wp != NULL, -1);
- g_return_val_if_fail (IS_WEEKDAY_PICKER (wp), -1);
-
- priv = wp->priv;
- return priv->week_start_day;
-}
diff --git a/calendar/gui/weekday-picker.h b/calendar/gui/weekday-picker.h
deleted file mode 100644
index 67a72f9ebd..0000000000
--- a/calendar/gui/weekday-picker.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* Evolution calendar - Week day picker widget
- *
- * Copyright (C) 2000 Ximian, Inc.
- *
- * Author: Federico Mena-Quintero <federico@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef WEEKDAY_PICKER_H
-#define WEEKDAY_PICKER_H
-
-#include <libgnomecanvas/gnome-canvas.h>
-
-G_BEGIN_DECLS
-
-
-
-#define TYPE_WEEKDAY_PICKER (weekday_picker_get_type ())
-#define WEEKDAY_PICKER(obj) (GTK_CHECK_CAST ((obj), TYPE_WEEKDAY_PICKER, WeekdayPicker))
-#define WEEKDAY_PICKER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), TYPE_WEEKDAY_PICKER, \
- WeekdayPickerClass))
-#define IS_WEEKDAY_PICKER(obj) (GTK_CHECK_TYPE ((obj), TYPE_WEEKDAY_PICKER))
-#define IS_WEEKDAY_PICKER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), TYPE_WEEKDAY_PICKER))
-
-typedef struct _WeekdayPicker WeekdayPicker;
-typedef struct _WeekdayPickerClass WeekdayPickerClass;
-typedef struct _WeekdayPickerPrivate WeekdayPickerPrivate;
-
-struct _WeekdayPicker {
- GnomeCanvas canvas;
-
- /* Private data */
- WeekdayPickerPrivate *priv;
-};
-
-struct _WeekdayPickerClass {
- GnomeCanvasClass parent_class;
-
- void (* changed) (WeekdayPicker *wp);
-};
-
-GtkType weekday_picker_get_type (void);
-
-GtkWidget *weekday_picker_new (void);
-
-void weekday_picker_set_days (WeekdayPicker *wp, guint8 day_mask);
-guint8 weekday_picker_get_days (WeekdayPicker *wp);
-
-void weekday_picker_set_blocked_days (WeekdayPicker *wp, guint8 blocked_day_mask);
-guint weekday_picker_get_blocked_days (WeekdayPicker *wp);
-
-void weekday_picker_set_week_start_day (WeekdayPicker *wp, int week_start_day);
-int weekday_picker_get_week_start_day (WeekdayPicker *wp);
-
-
-
-G_END_DECLS
-
-#endif
diff --git a/calendar/idl/.cvsignore b/calendar/idl/.cvsignore
deleted file mode 100644
index b840c21800..0000000000
--- a/calendar/idl/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile.in
-Makefile \ No newline at end of file
diff --git a/calendar/idl/Makefile.am b/calendar/idl/Makefile.am
deleted file mode 100644
index dd866141fc..0000000000
--- a/calendar/idl/Makefile.am
+++ /dev/null
@@ -1,5 +0,0 @@
-idl_DATA = \
- evolution-calendar.idl
-
-EXTRA_DIST = \
- $(idl_DATA)
diff --git a/calendar/idl/evolution-calendar.idl b/calendar/idl/evolution-calendar.idl
deleted file mode 100644
index 66f4eb8939..0000000000
--- a/calendar/idl/evolution-calendar.idl
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Evolution calendar interface
- *
- * Copyright (C) 2000 Eskil Heyn Olsen
- * Copyright (C) 2000 Ximian, Inc.
- * Copyright (C) 2000 Ximian, Inc.
- *
- * Authors: Eskil Heyn Olsen <deity@eskil.dk>
- * Federico Mena-Quintero <federico@ximian.com>
- */
-
-#ifndef _EVOLUTION_CALENDAR_IDL_
-#define _EVOLUTION_CALENDAR_IDL_
-
-#include <Bonobo.idl>
-
-module GNOME {
-module Evolution {
-
-module Calendar {
- /* A unique identifier for a calendar component */
- typedef string CalObjUID;
-
- /* Factory to centralize calendar component editor dialogs */
- interface CompEditorFactory : Bonobo::Unknown {
- exception InvalidURI {};
- exception BackendContactError {};
- exception UnsupportedType {};
-
- typedef long CompEditorMode;
- const CompEditorMode EDITOR_MODE_EVENT = 1 << 0;
- const CompEditorMode EDITOR_MODE_ALLDAY_EVENT = 1 << 1;
- const CompEditorMode EDITOR_MODE_MEETING = 1 << 2;
- const CompEditorMode EDITOR_MODE_TODO = 1 << 3;
-
- /* Loads a calendar and opens an editor for the specified object */
- void editExisting (in string uri, in CalObjUID uid)
- raises (InvalidURI, BackendContactError);
-
- /* Loads a calendar and creates a new component of the specified type */
- void editNew (in string uri, in CompEditorMode mode)
- raises (InvalidURI, BackendContactError, UnsupportedType);
- };
-};
-
-};
-};
-
-#endif
diff --git a/calendar/importers/.cvsignore b/calendar/importers/.cvsignore
deleted file mode 100644
index 99d6030704..0000000000
--- a/calendar/importers/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-.deps
-.libs
-Makefile
-Makefile.in
-evolution-calendar-importer
-GNOME_Evolution_Calendar_Importer*.server
diff --git a/calendar/importers/GNOME_Evolution_Calendar_Importer.server.in.in b/calendar/importers/GNOME_Evolution_Calendar_Importer.server.in.in
deleted file mode 100644
index 810905fbfa..0000000000
--- a/calendar/importers/GNOME_Evolution_Calendar_Importer.server.in.in
+++ /dev/null
@@ -1,54 +0,0 @@
-<oaf_info>
-
-<oaf_server iid="OAFIID:GNOME_Evolution_Calendar_ImporterFactory:@VERSION@"
- type="shlib"
- location="@IMPORTERSDIR@/libevolution-calendar-importers.so">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/ObjectFactory:1.0"/>
- </oaf_attribute>
- <oaf_attribute name="name" type="string"
- _value="Evolution iCalendar importer"/>
-</oaf_server>
-
-<oaf_server iid="OAFIID:GNOME_Evolution_Calendar_iCalendar_Importer:@VERSION@"
- type="factory"
- location="OAFIID:GNOME_Evolution_Calendar_ImporterFactory:@VERSION@">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/Evolution/Importer:@VERSION@"/>
- </oaf_attribute>
- <oaf_attribute name="evolution:menu_name" type="string"
- _value="iCalendar files (.ics)"/>
- <oaf_attribute name="name" type="string"
- _value="Evolution iCalendar importer"/>
-
-</oaf_server>
-
-<oaf_server iid="OAFIID:GNOME_Evolution_Calendar_vCalendar_Importer:@VERSION@"
- type="factory"
- location="OAFIID:GNOME_Evolution_Calendar_ImporterFactory:@VERSION@">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/Evolution/Importer:@VERSION@"/>
- </oaf_attribute>
- <oaf_attribute name="evolution:menu_name" type="string"
- _value="vCalendar files (.vcf)"/>
- <oaf_attribute name="name" type="string"
- _value="Evolution vCalendar importer"/>
-
-</oaf_server>
-
-<oaf_server iid="OAFIID:GNOME_Evolution_Gnome_Calendar_Intelligent_Importer:@VERSION@"
- type="factory"
- location="OAFIID:GNOME_Evolution_Calendar_ImporterFactory:@VERSION@">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/Evolution/IntelligentImporter:@VERSION@"/>
- </oaf_attribute>
-
- <oaf_attribute name="name" type="string"
- _value="Evolution Calendar intelligent importer"/>
-
-</oaf_server>
-</oaf_info>
diff --git a/calendar/importers/Makefile.am b/calendar/importers/Makefile.am
deleted file mode 100644
index a36c7ef4a6..0000000000
--- a/calendar/importers/Makefile.am
+++ /dev/null
@@ -1,53 +0,0 @@
-importersdir = $(privlibdir)/evolution-calendar-importers
-
-importers_LTLIBRARIES = libevolution-calendar-importers.la
-
-# privlibexec_PROGRAMS = evolution-calendar-importer
-
-INCLUDES = \
- -DEVOLUTION_LOCALEDIR=\""$(localedir)"\" \
- -DEVOLUTION_SOUNDDIR=\""$(soundsdir)"\" \
- -DG_LOG_DOMAIN=\"Evolution-Importer\" \
- -I$(top_srcdir) \
- -I$(top_builddir)/shell \
- -I$(top_srcdir)/shell \
- -I$(top_srcdir)/calendar \
- -I$(top_builddir)/calendar \
- $(EVOLUTION_CALENDAR_CFLAGS)
-
-libevolution_calendar_importers_la_SOURCES = \
- evolution-calendar-importer.h \
- icalendar-importer.c \
- main.c
-
-libevolution_calendar_importers_la_LDFLAGS = -avoid-version -module
-
-libevolution_calendar_importers_la_LIBADD = \
- $(top_builddir)/shell/importer/libevolution-importer.la \
- $(IMPORTERS_LIBS)
-
-# evolution_calendar_importer_SOURCES = \
-# evolution-calendar-importer.h \
-# icalendar-importer.c \
-# main.c
-#
-# evolution_calendar_importer_LDADD = \
-# $(top_builddir)/shell/libeshell.la \
-# $(top_builddir)/shell/importer/libevolution-importer.la \
-# $(top_builddir)/calendar/cal-util/libcal-util.la \
-# $(top_builddir)/calendar/cal-client/libcal-client.la \
-# $(top_builddir)/libwombat/libwombat.la \
-# $(EVOLUTION_CALENDAR_LIBS)
-
-server_in_files = GNOME_Evolution_Calendar_Importer.server.in.in
-server_DATA = $(server_in_files:.server.in.in=_$(BASE_VERSION).server)
-@EVO_SERVER_RULE@
-@INTLTOOL_SERVER_RULE@
-
-BUILT_SOURCES = $(server_DATA)
-CLEANFILES = $(BUILT_SOURCES)
-
-EXTRA_DIST = $(server_in_files)
-
-dist-hook:
- cd $(distdir); rm -f $(BUILT_SOURCES) \ No newline at end of file
diff --git a/calendar/importers/evolution-calendar-importer.h b/calendar/importers/evolution-calendar-importer.h
deleted file mode 100644
index 0691ee2cab..0000000000
--- a/calendar/importers/evolution-calendar-importer.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* Evolution calendar importer component
- *
- * Authors: Rodrigo Moya <rodrigo@ximian.com>
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef EVOLUTION_CALENDAR_IMPORTER_H
-#define EVOLUTION_CALENDAR_IMPORTER_H
-
-#include <bonobo/bonobo-object.h>
-
-G_BEGIN_DECLS
-
-BonoboObject *ical_importer_new (void);
-BonoboObject *vcal_importer_new (void);
-
-BonoboObject *gnome_calendar_importer_new (void);
-
-G_END_DECLS
-
-#endif
diff --git a/calendar/importers/icalendar-importer.c b/calendar/importers/icalendar-importer.c
deleted file mode 100644
index ae9a5c9b21..0000000000
--- a/calendar/importers/icalendar-importer.c
+++ /dev/null
@@ -1,753 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* Evolution calendar importer component
- *
- * Authors: Rodrigo Moya <rodrigo@ximian.com>
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <string.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <gtk/gtksignal.h>
-#include <gtk/gtkcheckbutton.h>
-#include <gtk/gtkhbox.h>
-#include <gtk/gtkmain.h>
-#include <libgnome/gnome-util.h>
-#include <libgnome/gnome-i18n.h>
-#include <bonobo/bonobo-control.h>
-#include <bonobo/bonobo-exception.h>
-#include <libecal/e-cal.h>
-#include <importer/evolution-importer.h>
-#include <importer/evolution-intelligent-importer.h>
-#include <importer/GNOME_Evolution_Importer.h>
-#include <libical/icalvcal.h>
-#include "evolution-calendar-importer.h"
-
-/* We timeout after 2 minutes, when opening the folders. */
-#define IMPORTER_TIMEOUT_SECONDS 120
-
-
-typedef struct {
- ECal *client;
- ECal *tasks_client;
- EvolutionImporter *importer;
- icalcomponent *icalcomp;
- gboolean folder_contains_events;
- gboolean folder_contains_tasks;
-} ICalImporter;
-
-typedef struct {
- gboolean do_calendar;
- gboolean do_tasks;
-} ICalIntelligentImporter;
-
-/*
- * Functions shared by iCalendar & vCalendar importer.
- */
-
-static void
-importer_destroy_cb (gpointer user_data)
-{
- ICalImporter *ici = (ICalImporter *) user_data;
-
- g_return_if_fail (ici != NULL);
-
- g_object_unref (ici->client);
- g_object_unref (ici->tasks_client);
-
- if (ici->icalcomp != NULL) {
- icalcomponent_free (ici->icalcomp);
- ici->icalcomp = NULL;
- }
-
- g_free (ici);
-}
-
-/* This reads in an entire file and returns it. It returns NULL on error.
- The returned string should be freed. */
-static char*
-read_file (const char *filename)
-{
- int fd, n;
- GString *str;
- char buffer[2049];
- gboolean error = FALSE;
-
- /* read file contents */
- fd = open (filename, O_RDONLY);
- if (fd == -1)
- return NULL;
-
- str = g_string_new ("");
- while (1) {
- memset (buffer, 0, sizeof(buffer));
- n = read (fd, buffer, sizeof (buffer) - 1);
- if (n > 0) {
- str = g_string_append (str, buffer);
- } else if (n == 0) {
- break;
- } else {
- error = TRUE;
- break;
- }
- }
-
- close (fd);
-
- if (error) {
- g_string_free (str, FALSE);
- return NULL;
- } else {
- gchar *retval = str->str;
- g_string_free (str, FALSE);
- return retval;
- }
-}
-
-/* This removes all components except VEVENTs and VTIMEZONEs from the toplevel
- icalcomponent, and returns a GList of the VTODO components. */
-static GList*
-prepare_events (icalcomponent *icalcomp)
-{
- icalcomponent *subcomp;
- GList *vtodos = NULL;
- icalcompiter iter;
-
- iter = icalcomponent_begin_component (icalcomp, ICAL_ANY_COMPONENT);
- while ((subcomp = icalcompiter_deref (&iter)) != NULL) {
- icalcomponent_kind child_kind = icalcomponent_isa (subcomp);
- if (child_kind != ICAL_VEVENT_COMPONENT
- && child_kind != ICAL_VTIMEZONE_COMPONENT) {
-
- icalcompiter_next (&iter);
-
- icalcomponent_remove_component (icalcomp, subcomp);
- if (child_kind == ICAL_VTODO_COMPONENT)
- vtodos = g_list_prepend (vtodos, subcomp);
- else
- icalcomponent_free (subcomp);
-
- continue;
- }
-
- icalcompiter_next (&iter);
- }
-
- return vtodos;
-}
-
-
-/* This removes all components except VTODOs and VTIMEZONEs from the toplevel
- icalcomponent, and adds the given list of VTODO components. The list is
- freed afterwards. */
-static void
-prepare_tasks (icalcomponent *icalcomp, GList *vtodos)
-{
- icalcomponent *subcomp;
- GList *elem;
- icalcompiter iter;
-
- iter = icalcomponent_begin_component (icalcomp, ICAL_ANY_COMPONENT);
- while ((subcomp = icalcompiter_deref (&iter)) != NULL) {
- icalcomponent_kind child_kind = icalcomponent_isa (subcomp);
- if (child_kind != ICAL_VTODO_COMPONENT
- && child_kind != ICAL_VTIMEZONE_COMPONENT) {
- icalcompiter_next (&iter);
- icalcomponent_remove_component (icalcomp, subcomp);
- icalcomponent_free (subcomp);
-
- continue;
- }
-
- icalcompiter_next (&iter);
- }
-
- for (elem = vtodos; elem; elem = elem->next) {
- icalcomponent_add_component (icalcomp, elem->data);
- }
- g_list_free (vtodos);
-}
-
-static gboolean
-update_single_object (ECal *client, icalcomponent *icalcomp)
-{
- char *uid;
- icalcomponent *tmp_icalcomp;
-
- uid = (char *) icalcomponent_get_uid (icalcomp);
-
- if (e_cal_get_object (client, uid, NULL, &tmp_icalcomp, NULL))
- return e_cal_modify_object (client, icalcomp, CALOBJ_MOD_ALL, NULL);
-
- return e_cal_create_object (client, icalcomp, &uid, NULL);
-}
-
-static gboolean
-update_objects (ECal *client, icalcomponent *icalcomp)
-{
- icalcomponent *subcomp;
- icalcomponent_kind kind;
-
- kind = icalcomponent_isa (icalcomp);
- if (kind == ICAL_VTODO_COMPONENT || kind == ICAL_VEVENT_COMPONENT)
- return update_single_object (client, icalcomp);
- else if (kind != ICAL_VCALENDAR_COMPONENT)
- return FALSE;
-
- subcomp = icalcomponent_get_first_component (icalcomp, ICAL_ANY_COMPONENT);
- while (subcomp) {
- gboolean success;
-
- kind = icalcomponent_isa (subcomp);
- if (kind == ICAL_VTIMEZONE_COMPONENT) {
- icaltimezone *zone;
-
- zone = icaltimezone_new ();
- icaltimezone_set_component (zone, subcomp);
-
- success = e_cal_add_timezone (client, zone, NULL);
- icaltimezone_free (zone, 1);
- if (!success)
- return success;
- } else if (kind == ICAL_VTODO_COMPONENT ||
- kind == ICAL_VEVENT_COMPONENT) {
- success = update_single_object (client, subcomp);
- if (!success)
- return success;
- }
-
- subcomp = icalcomponent_get_next_component (icalcomp, ICAL_ANY_COMPONENT);
- }
-
- return TRUE;
-}
-
-static void
-process_item_fn (EvolutionImporter *importer,
- CORBA_Object listener,
- void *closure,
- CORBA_Environment *ev)
-{
- ECalLoadState state, tasks_state;
- ICalImporter *ici = (ICalImporter *) closure;
- GNOME_Evolution_ImporterListener_ImporterResult result;
-
- result = GNOME_Evolution_ImporterListener_OK;
-
- g_return_if_fail (ici != NULL);
- g_return_if_fail (E_IS_CAL (ici->client));
- g_return_if_fail (ici->icalcomp != NULL);
-
- state = e_cal_get_load_state (ici->client);
- tasks_state = e_cal_get_load_state (ici->tasks_client);
- if (state == E_CAL_LOAD_LOADING
- || tasks_state == E_CAL_LOAD_LOADING) {
- GNOME_Evolution_ImporterListener_notifyResult (
- listener,
- GNOME_Evolution_ImporterListener_BUSY,
- TRUE, ev);
- return;
- } else if (state != E_CAL_LOAD_LOADED
- || tasks_state != E_CAL_LOAD_LOADED) {
- GNOME_Evolution_ImporterListener_notifyResult (
- listener,
- GNOME_Evolution_ImporterListener_UNSUPPORTED_OPERATION,
- FALSE, ev);
- return;
- }
-
- /* If the folder contains events & tasks we can just import everything
- into it. If it contains just events, we have to strip out the
- VTODOs and import them into the default tasks folder. If the folder
- contains just tasks, we strip out the VEVENTs, which do not get
- imported at all. */
- if (ici->folder_contains_events && ici->folder_contains_tasks) {
- if (!update_objects (ici->client, ici->icalcomp))
- result = GNOME_Evolution_ImporterListener_BAD_DATA;
- } else if (ici->folder_contains_events) {
- GList *vtodos = prepare_events (ici->icalcomp);
- if (!update_objects (ici->client, ici->icalcomp))
- result = GNOME_Evolution_ImporterListener_BAD_DATA;
-
- prepare_tasks (ici->icalcomp, vtodos);
- if (!update_objects (ici->tasks_client, ici->icalcomp))
- result = GNOME_Evolution_ImporterListener_BAD_DATA;
- } else {
- prepare_tasks (ici->icalcomp, NULL);
- if (!update_objects (ici->client, ici->icalcomp))
- result = GNOME_Evolution_ImporterListener_BAD_DATA;
- }
-
- GNOME_Evolution_ImporterListener_notifyResult (listener, result, FALSE,
- ev);
-}
-
-
-/*
- * iCalendar importer functions.
- */
-
-static gboolean
-support_format_fn (EvolutionImporter *importer,
- const char *filename,
- void *closure)
-{
- char *contents;
- icalcomponent *icalcomp;
- gboolean ret = FALSE;
-
- contents = read_file (filename);
-
- /* parse the file */
- if (contents) {
- icalcomp = icalparser_parse_string (contents);
- if (icalcomp) {
- if (icalcomponent_is_valid (icalcomp))
- ret = TRUE;
- else
- ret = FALSE;
- icalcomponent_free (icalcomp);
- }
- }
-
- g_free (contents);
-
- return ret;
-}
-
-static gboolean
-load_file_fn (EvolutionImporter *importer,
- const char *filename,
- const char *physical_uri,
- const char *folder_type,
- void *closure)
-{
- char *contents, *f;
- gboolean ret = FALSE;
- ICalImporter *ici = (ICalImporter *) closure;
-
- g_return_val_if_fail (ici != NULL, FALSE);
-
- contents = read_file (filename);
-
- if (!strcmp (folder_type, "calendar")) {
- ici->folder_contains_events = TRUE;
- ici->folder_contains_tasks = FALSE;
-
- f = g_strdup ("calendar.ics");
- } else {
- ici->folder_contains_events = FALSE;
- ici->folder_contains_tasks = TRUE;
-
- f = g_strdup ("tasks.ics");
- }
-
- /* parse the file */
- if (contents) {
- icalcomponent *icalcomp;
-
- icalcomp = icalparser_parse_string (contents);
- if (icalcomp) {
- char *real_uri;
-
- if (!g_strncasecmp (physical_uri, "file", 4) &&
- g_strcasecmp (physical_uri + (strlen (physical_uri) - strlen (f)), f)) {
- real_uri = g_concat_dir_and_file (physical_uri, f);
- } else
- real_uri = g_strdup (physical_uri);
-
- /* create ECal's */
- if (!ici->client)
- ici->client = e_cal_new_from_uri (real_uri, CALOBJ_TYPE_EVENT);
- if (!ici->tasks_client)
- ici->tasks_client = e_cal_new_from_uri ("", CALOBJ_TYPE_TODO); /* FIXME */
-
- if (e_cal_open (ici->client, TRUE, NULL)
- && e_cal_open (ici->tasks_client, FALSE, NULL)) {
- ici->icalcomp = icalcomp;
- ret = TRUE;
- }
-
- g_free (real_uri);
- }
- }
-
- g_free (contents);
- g_free (f);
-
- return ret;
-}
-
-BonoboObject *
-ical_importer_new (void)
-{
- ICalImporter *ici;
-
- ici = g_new0 (ICalImporter, 1);
- ici->client = NULL;
- ici->tasks_client = NULL;
- ici->icalcomp = NULL;
- ici->importer = evolution_importer_new (support_format_fn,
- load_file_fn,
- process_item_fn,
- NULL,
- ici);
-
- g_object_weak_ref (G_OBJECT (ici->importer), (GWeakNotify) importer_destroy_cb, ici);
-
- return BONOBO_OBJECT (ici->importer);
-}
-
-
-
-/*
- * vCalendar importer functions.
- */
-
-static gboolean
-vcal_support_format_fn (EvolutionImporter *importer,
- const char *filename,
- void *closure)
-{
- char *contents;
- gboolean ret = FALSE;
-
- contents = read_file (filename);
-
- /* parse the file */
- if (contents) {
- VObject *vcal;
-
- vcal = Parse_MIME (contents, strlen (contents));
-
- if (vcal) {
- icalcomponent *icalcomp;
-
- icalcomp = icalvcal_convert (vcal);
-
- if (icalcomp) {
- icalcomponent_free (icalcomp);
- ret = TRUE;
- }
-
- cleanVObject (vcal);
- }
- }
-
- g_free (contents);
-
- return ret;
-}
-
-/* This tries to load in a vCalendar file and convert it to an icalcomponent.
- It returns NULL on failure. */
-static icalcomponent*
-load_vcalendar_file (const char *filename)
-{
- icalvcal_defaults defaults = { 0 };
- icalcomponent *icalcomp = NULL;
- char *contents;
-
- defaults.alarm_audio_url = "file://" EVOLUTION_SOUNDDIR "/default_alarm.wav";
- defaults.alarm_audio_fmttype = "audio/x-wav";
- defaults.alarm_description = (char*) _("Reminder!!");
-
- contents = read_file (filename);
-
- /* parse the file */
- if (contents) {
- VObject *vcal;
-
- vcal = Parse_MIME (contents, strlen (contents));
-
- if (vcal) {
- icalcomp = icalvcal_convert_with_defaults (vcal,
- &defaults);
- cleanVObject (vcal);
- }
- }
-
- g_free (contents);
-
- return icalcomp;
-}
-
-static gboolean
-vcal_load_file_fn (EvolutionImporter *importer,
- const char *filename,
- const char *physical_uri,
- const char *folder_type,
- void *closure)
-{
- gboolean ret = FALSE;
- char *f;
- ICalImporter *ici = (ICalImporter *) closure;
- icalcomponent *icalcomp;
-
- g_return_val_if_fail (ici != NULL, FALSE);
-
- if (!strcmp (folder_type, "calendar")) {
- ici->folder_contains_events = TRUE;
- ici->folder_contains_tasks = FALSE;
-
- f = g_strdup ("calendar.ics");
- } else {
- ici->folder_contains_events = FALSE;
- ici->folder_contains_tasks = TRUE;
-
- f = g_strdup ("tasks.ics");
- }
-
- icalcomp = load_vcalendar_file (filename);
- if (icalcomp) {
- char *real_uri;
-
- if (!g_strncasecmp (physical_uri, "file", 4) &&
- g_strcasecmp (physical_uri + (strlen (physical_uri) - strlen (f)), f)) {
- real_uri = g_concat_dir_and_file (physical_uri, f);
- } else
- real_uri = g_strdup (physical_uri);
-
- /* create ECal's */
- if (!ici->client)
- ici->client = e_cal_new_from_uri (real_uri, CALOBJ_TYPE_EVENT);
- if (!ici->tasks_client)
- ici->tasks_client = e_cal_new_from_uri ("", CALOBJ_TYPE_TODO);
-
- if (e_cal_open (ici->client, TRUE, NULL)
- && e_cal_open (ici->tasks_client, FALSE, NULL)) {
- ici->icalcomp = icalcomp;
- ret = TRUE;
- }
-
- g_free (real_uri);
- }
-
- g_free (f);
-
- return ret;
-}
-
-BonoboObject *
-vcal_importer_new (void)
-{
- ICalImporter *ici;
-
- ici = g_new0 (ICalImporter, 1);
- ici->client = NULL;
- ici->tasks_client = NULL;
- ici->icalcomp = NULL;
- ici->importer = evolution_importer_new (vcal_support_format_fn,
- vcal_load_file_fn,
- process_item_fn,
- NULL,
- ici);
-
- g_object_weak_ref (G_OBJECT (ici->importer), (GWeakNotify) importer_destroy_cb, ici);
-
- return BONOBO_OBJECT (ici->importer);
-}
-
-
-
-
-
-
-static void
-gnome_calendar_importer_destroy_cb (gpointer user_data)
-{
- ICalIntelligentImporter *ici = (ICalIntelligentImporter *) user_data;
-
- g_return_if_fail (ici != NULL);
-
- g_free (ici);
-}
-
-
-
-static gboolean
-gnome_calendar_can_import_fn (EvolutionIntelligentImporter *ii,
- void *closure)
-{
- char *filename;
- gboolean gnome_calendar_exists;
-
- filename = gnome_util_home_file ("user-cal.vcf");
- gnome_calendar_exists = g_file_exists (filename);
- g_free (filename);
-
- return gnome_calendar_exists;
-}
-
-
-static void
-gnome_calendar_import_data_fn (EvolutionIntelligentImporter *ii,
- void *closure)
-{
- ICalIntelligentImporter *ici = closure;
- icalcomponent *icalcomp = NULL;
- char *filename;
- GList *vtodos;
- ECal *calendar_client = NULL, *tasks_client = NULL;
- int t;
-
- /* If neither is selected, just return. */
- if (!ici->do_calendar && !ici->do_tasks) {
- return;
- }
-
- /* Try to open the default calendar & tasks folders. */
- if (ici->do_calendar) {
- calendar_client = e_cal_new_from_uri ("", CALOBJ_TYPE_EVENT); /* FIXME: use default folder */
- if (!e_cal_open (calendar_client, FALSE, NULL))
- goto out;
- }
-
- if (ici->do_tasks) {
- tasks_client = e_cal_new_from_uri ("", CALOBJ_TYPE_TODO); /* FIXME: use default folder */
- if (!e_cal_open (tasks_client, FALSE, NULL))
- goto out;
- }
-
- /* Load the Gnome Calendar file and convert to iCalendar. */
- filename = gnome_util_home_file ("user-cal.vcf");
- icalcomp = load_vcalendar_file (filename);
- g_free (filename);
-
- /* If we couldn't load the file, just return. FIXME: Error message? */
- if (!icalcomp)
- goto out;
-
- /*
- * Import the calendar events into the default calendar folder.
- */
- vtodos = prepare_events (icalcomp);
-
- /* Wait for client to finish opening the calendar & tasks folders. */
- for (t = 0; t < IMPORTER_TIMEOUT_SECONDS; t++) {
- ECalLoadState calendar_state, tasks_state;
-
- calendar_state = tasks_state = E_CAL_LOAD_LOADED;
-
- /* We need this so the ECal gets notified that the
- folder is opened, via Corba. */
- while (gtk_events_pending ())
- gtk_main_iteration ();
-
- if (ici->do_calendar)
- calendar_state = e_cal_get_load_state (calendar_client);
-
- if (ici->do_tasks)
- tasks_state = e_cal_get_load_state (tasks_client);
-
- if (calendar_state == E_CAL_LOAD_LOADED
- && tasks_state == E_CAL_LOAD_LOADED)
- break;
-
- sleep (1);
- }
-
- /* If we timed out, just return. */
- if (t == IMPORTER_TIMEOUT_SECONDS)
- goto out;
-
- /* Import the calendar events. */
- /* FIXME: What do intelligent importers do about errors? */
- if (ici->do_calendar)
- update_objects (calendar_client, icalcomp);
-
-
- /*
- * Import the tasks into the default tasks folder.
- */
- prepare_tasks (icalcomp, vtodos);
- if (ici->do_tasks)
- update_objects (tasks_client, icalcomp);
-
- out:
- if (icalcomp)
- icalcomponent_free (icalcomp);
- if (calendar_client)
- g_object_unref (calendar_client);
- if (tasks_client)
- g_object_unref (tasks_client);
-}
-
-
-/* Fun with aggregation */
-static void
-checkbox_toggle_cb (GtkToggleButton *tb,
- gboolean *do_item)
-{
- *do_item = gtk_toggle_button_get_active (tb);
-}
-
-static BonoboControl *
-create_checkboxes_control (ICalIntelligentImporter *ici)
-{
- GtkWidget *hbox, *calendar_checkbox, *tasks_checkbox;
- BonoboControl *control;
-
- hbox = gtk_hbox_new (FALSE, 2);
-
- calendar_checkbox = gtk_check_button_new_with_label (_("Calendar Events"));
- g_signal_connect (G_OBJECT (calendar_checkbox), "toggled",
- G_CALLBACK (checkbox_toggle_cb),
- &ici->do_calendar);
- gtk_box_pack_start (GTK_BOX (hbox), calendar_checkbox,
- FALSE, FALSE, 0);
-
- tasks_checkbox = gtk_check_button_new_with_label (_("Tasks"));
- g_signal_connect (G_OBJECT (tasks_checkbox), "toggled",
- G_CALLBACK (checkbox_toggle_cb),
- &ici->do_tasks);
- gtk_box_pack_start (GTK_BOX (hbox), tasks_checkbox,
- FALSE, FALSE, 0);
-
- gtk_widget_show_all (hbox);
- control = bonobo_control_new (hbox);
- return control;
-}
-
-BonoboObject *
-gnome_calendar_importer_new (void)
-{
- EvolutionIntelligentImporter *importer;
- ICalIntelligentImporter *ici;
- BonoboControl *control;
- char *message = N_("Evolution has found Gnome Calendar files.\n"
- "Would you like to import them into Evolution?");
-
- ici = g_new0 (ICalIntelligentImporter, 1);
-
- importer = evolution_intelligent_importer_new (gnome_calendar_can_import_fn,
- gnome_calendar_import_data_fn,
- _("Gnome Calendar"),
- _(message),
- ici);
-
-
- g_object_weak_ref (G_OBJECT (importer), (GWeakNotify) gnome_calendar_importer_destroy_cb, ici);
-
- control = create_checkboxes_control (ici);
- bonobo_object_add_interface (BONOBO_OBJECT (importer),
- BONOBO_OBJECT (control));
-
- return BONOBO_OBJECT (importer);
-}
diff --git a/calendar/importers/main.c b/calendar/importers/main.c
deleted file mode 100644
index d19f98a271..0000000000
--- a/calendar/importers/main.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* Evolution calendar importer component
- *
- * Authors: Rodrigo Moya <rodrigo@ximian.com>
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <string.h>
-#include <bonobo/bonobo-shlib-factory.h>
-#include <bonobo/bonobo-context.h>
-#include <bonobo/bonobo-main.h>
-#include "evolution-calendar-importer.h"
-
-#define IMPORTER_FACTORY_ID "OAFIID:GNOME_Evolution_Calendar_ImporterFactory:" BASE_VERSION
-#define ICALENDAR_IMPORTER_ID "OAFIID:GNOME_Evolution_Calendar_iCalendar_Importer:" BASE_VERSION
-#define VCALENDAR_IMPORTER_ID "OAFIID:GNOME_Evolution_Calendar_vCalendar_Importer:" BASE_VERSION
-#define GNOME_CALENDAR_IMPORTER_ID "OAFIID:GNOME_Evolution_Gnome_Calendar_Intelligent_Importer:" BASE_VERSION
-
-static BonoboObject *
-importer_factory_fn (BonoboGenericFactory *factory, const char *id, void *closure)
-{
- BonoboObject *object = NULL;
-
- g_return_val_if_fail (id != NULL, NULL);
-
- if (!strcmp (id, ICALENDAR_IMPORTER_ID))
- object = ical_importer_new ();
- else if (!strcmp (id, VCALENDAR_IMPORTER_ID))
- object = vcal_importer_new ();
- else if (!strcmp (id, GNOME_CALENDAR_IMPORTER_ID))
- object = gnome_calendar_importer_new ();
- else
- g_warning ("Component not supported by this factory");
-
- return object;
-}
-
-BONOBO_ACTIVATION_SHLIB_FACTORY (IMPORTER_FACTORY_ID, "Evolution Calendar importer factory", importer_factory_fn, NULL)
diff --git a/calendar/zones.h b/calendar/zones.h
deleted file mode 100644
index 5b482255f0..0000000000
--- a/calendar/zones.h
+++ /dev/null
@@ -1,387 +0,0 @@
-/*
- * These are the timezone names from the Olson timezone data.
- * We only place them here so gettext picks them up for translation.
- * Don't include in any C files.
- */
-
-N_("Africa/Abidjan");
-N_("Africa/Accra");
-N_("Africa/Addis_Ababa");
-N_("Africa/Algiers");
-N_("Africa/Asmera");
-N_("Africa/Bamako");
-N_("Africa/Bangui");
-N_("Africa/Banjul");
-N_("Africa/Bissau");
-N_("Africa/Blantyre");
-N_("Africa/Brazzaville");
-N_("Africa/Bujumbura");
-N_("Africa/Cairo");
-N_("Africa/Casablanca");
-N_("Africa/Ceuta");
-N_("Africa/Conakry");
-N_("Africa/Dakar");
-N_("Africa/Dar_es_Salaam");
-N_("Africa/Djibouti");
-N_("Africa/Douala");
-N_("Africa/El_Aaiun");
-N_("Africa/Freetown");
-N_("Africa/Gaborone");
-N_("Africa/Harare");
-N_("Africa/Johannesburg");
-N_("Africa/Kampala");
-N_("Africa/Khartoum");
-N_("Africa/Kigali");
-N_("Africa/Kinshasa");
-N_("Africa/Lagos");
-N_("Africa/Libreville");
-N_("Africa/Lome");
-N_("Africa/Luanda");
-N_("Africa/Lubumbashi");
-N_("Africa/Lusaka");
-N_("Africa/Malabo");
-N_("Africa/Maputo");
-N_("Africa/Maseru");
-N_("Africa/Mbabane");
-N_("Africa/Mogadishu");
-N_("Africa/Monrovia");
-N_("Africa/Nairobi");
-N_("Africa/Ndjamena");
-N_("Africa/Niamey");
-N_("Africa/Nouakchott");
-N_("Africa/Ouagadougou");
-N_("Africa/Porto-Novo");
-N_("Africa/Sao_Tome");
-N_("Africa/Timbuktu");
-N_("Africa/Tripoli");
-N_("Africa/Tunis");
-N_("Africa/Windhoek");
-N_("America/Adak");
-N_("America/Anchorage");
-N_("America/Anguilla");
-N_("America/Antigua");
-N_("America/Araguaina");
-N_("America/Aruba");
-N_("America/Asuncion");
-N_("America/Barbados");
-N_("America/Belem");
-N_("America/Belize");
-N_("America/Boa_Vista");
-N_("America/Bogota");
-N_("America/Boise");
-N_("America/Buenos_Aires");
-N_("America/Cambridge_Bay");
-N_("America/Cancun");
-N_("America/Caracas");
-N_("America/Catamarca");
-N_("America/Cayenne");
-N_("America/Cayman");
-N_("America/Chicago");
-N_("America/Chihuahua");
-N_("America/Cordoba");
-N_("America/Costa_Rica");
-N_("America/Cuiaba");
-N_("America/Curacao");
-N_("America/Danmarkshavn");
-N_("America/Dawson");
-N_("America/Dawson_Creek");
-N_("America/Denver");
-N_("America/Detroit");
-N_("America/Dominica");
-N_("America/Edmonton");
-N_("America/Eirunepe");
-N_("America/El_Salvador");
-N_("America/Fortaleza");
-N_("America/Glace_Bay");
-N_("America/Godthab");
-N_("America/Goose_Bay");
-N_("America/Grand_Turk");
-N_("America/Grenada");
-N_("America/Guadeloupe");
-N_("America/Guatemala");
-N_("America/Guayaquil");
-N_("America/Guyana");
-N_("America/Halifax");
-N_("America/Havana");
-N_("America/Hermosillo");
-N_("America/Indiana/Indianapolis");
-N_("America/Indiana/Knox");
-N_("America/Indiana/Marengo");
-N_("America/Indiana/Vevay");
-N_("America/Indianapolis");
-N_("America/Inuvik");
-N_("America/Iqaluit");
-N_("America/Jamaica");
-N_("America/Jujuy");
-N_("America/Juneau");
-N_("America/Kentucky/Louisville");
-N_("America/Kentucky/Monticello");
-N_("America/La_Paz");
-N_("America/Lima");
-N_("America/Los_Angeles");
-N_("America/Louisville");
-N_("America/Maceio");
-N_("America/Managua");
-N_("America/Manaus");
-N_("America/Martinique");
-N_("America/Mazatlan");
-N_("America/Mendoza");
-N_("America/Menominee");
-N_("America/Merida");
-N_("America/Mexico_City");
-N_("America/Miquelon");
-N_("America/Monterrey");
-N_("America/Montevideo");
-N_("America/Montreal");
-N_("America/Montserrat");
-N_("America/Nassau");
-N_("America/New_York");
-N_("America/Nipigon");
-N_("America/Nome");
-N_("America/Noronha");
-N_("America/North_Dakota/Center");
-N_("America/Panama");
-N_("America/Pangnirtung");
-N_("America/Paramaribo");
-N_("America/Phoenix");
-N_("America/Port-au-Prince");
-N_("America/Port_of_Spain");
-N_("America/Porto_Velho");
-N_("America/Puerto_Rico");
-N_("America/Rainy_River");
-N_("America/Rankin_Inlet");
-N_("America/Recife");
-N_("America/Regina");
-N_("America/Rio_Branco");
-N_("America/Rosario");
-N_("America/Santiago");
-N_("America/Santo_Domingo");
-N_("America/Sao_Paulo");
-N_("America/Scoresbysund");
-N_("America/Shiprock");
-N_("America/St_Johns");
-N_("America/St_Kitts");
-N_("America/St_Lucia");
-N_("America/St_Thomas");
-N_("America/St_Vincent");
-N_("America/Swift_Current");
-N_("America/Tegucigalpa");
-N_("America/Thule");
-N_("America/Thunder_Bay");
-N_("America/Tijuana");
-N_("America/Tortola");
-N_("America/Vancouver");
-N_("America/Whitehorse");
-N_("America/Winnipeg");
-N_("America/Yakutat");
-N_("America/Yellowknife");
-N_("Antarctica/Casey");
-N_("Antarctica/Davis");
-N_("Antarctica/DumontDUrville");
-N_("Antarctica/Mawson");
-N_("Antarctica/McMurdo");
-N_("Antarctica/Palmer");
-N_("Antarctica/South_Pole");
-N_("Antarctica/Syowa");
-N_("Antarctica/Vostok");
-N_("Arctic/Longyearbyen");
-N_("Asia/Aden");
-N_("Asia/Almaty");
-N_("Asia/Amman");
-N_("Asia/Anadyr");
-N_("Asia/Aqtau");
-N_("Asia/Aqtobe");
-N_("Asia/Ashgabat");
-N_("Asia/Baghdad");
-N_("Asia/Bahrain");
-N_("Asia/Baku");
-N_("Asia/Bangkok");
-N_("Asia/Beirut");
-N_("Asia/Bishkek");
-N_("Asia/Brunei");
-N_("Asia/Calcutta");
-N_("Asia/Choibalsan");
-N_("Asia/Chongqing");
-N_("Asia/Colombo");
-N_("Asia/Damascus");
-N_("Asia/Dhaka");
-N_("Asia/Dili");
-N_("Asia/Dubai");
-N_("Asia/Dushanbe");
-N_("Asia/Gaza");
-N_("Asia/Harbin");
-N_("Asia/Hong_Kong");
-N_("Asia/Hovd");
-N_("Asia/Irkutsk");
-N_("Asia/Istanbul");
-N_("Asia/Jakarta");
-N_("Asia/Jayapura");
-N_("Asia/Jerusalem");
-N_("Asia/Kabul");
-N_("Asia/Kamchatka");
-N_("Asia/Karachi");
-N_("Asia/Kashgar");
-N_("Asia/Katmandu");
-N_("Asia/Krasnoyarsk");
-N_("Asia/Kuala_Lumpur");
-N_("Asia/Kuching");
-N_("Asia/Kuwait");
-N_("Asia/Macao");
-N_("Asia/Macau");
-N_("Asia/Magadan");
-N_("Asia/Makassar");
-N_("Asia/Manila");
-N_("Asia/Muscat");
-N_("Asia/Nicosia");
-N_("Asia/Novosibirsk");
-N_("Asia/Omsk");
-N_("Asia/Oral");
-N_("Asia/Phnom_Penh");
-N_("Asia/Pontianak");
-N_("Asia/Pyongyang");
-N_("Asia/Qatar");
-N_("Asia/Qyzylorda");
-N_("Asia/Rangoon");
-N_("Asia/Riyadh");
-N_("Asia/Saigon");
-N_("Asia/Sakhalin");
-N_("Asia/Samarkand");
-N_("Asia/Seoul");
-N_("Asia/Shanghai");
-N_("Asia/Singapore");
-N_("Asia/Taipei");
-N_("Asia/Tashkent");
-N_("Asia/Tbilisi");
-N_("Asia/Tehran");
-N_("Asia/Thimphu");
-N_("Asia/Tokyo");
-N_("Asia/Ujung_Pandang");
-N_("Asia/Ulaanbaatar");
-N_("Asia/Urumqi");
-N_("Asia/Vientiane");
-N_("Asia/Vladivostok");
-N_("Asia/Yakutsk");
-N_("Asia/Yekaterinburg");
-N_("Asia/Yerevan");
-N_("Atlantic/Azores");
-N_("Atlantic/Bermuda");
-N_("Atlantic/Canary");
-N_("Atlantic/Cape_Verde");
-N_("Atlantic/Faeroe");
-N_("Atlantic/Jan_Mayen");
-N_("Atlantic/Madeira");
-N_("Atlantic/Reykjavik");
-N_("Atlantic/South_Georgia");
-N_("Atlantic/St_Helena");
-N_("Atlantic/Stanley");
-N_("Australia/Adelaide");
-N_("Australia/Brisbane");
-N_("Australia/Broken_Hill");
-N_("Australia/Darwin");
-N_("Australia/Hobart");
-N_("Australia/Lindeman");
-N_("Australia/Lord_Howe");
-N_("Australia/Melbourne");
-N_("Australia/Perth");
-N_("Australia/Sydney");
-N_("Europe/Amsterdam");
-N_("Europe/Andorra");
-N_("Europe/Athens");
-N_("Europe/Belfast");
-N_("Europe/Belgrade");
-N_("Europe/Berlin");
-N_("Europe/Bratislava");
-N_("Europe/Brussels");
-N_("Europe/Bucharest");
-N_("Europe/Budapest");
-N_("Europe/Chisinau");
-N_("Europe/Copenhagen");
-N_("Europe/Dublin");
-N_("Europe/Gibraltar");
-N_("Europe/Helsinki");
-N_("Europe/Istanbul");
-N_("Europe/Kaliningrad");
-N_("Europe/Kiev");
-N_("Europe/Lisbon");
-N_("Europe/Ljubljana");
-N_("Europe/London");
-N_("Europe/Luxembourg");
-N_("Europe/Madrid");
-N_("Europe/Malta");
-N_("Europe/Minsk");
-N_("Europe/Monaco");
-N_("Europe/Moscow");
-N_("Europe/Nicosia");
-N_("Europe/Oslo");
-N_("Europe/Paris");
-N_("Europe/Prague");
-N_("Europe/Riga");
-N_("Europe/Rome");
-N_("Europe/Samara");
-N_("Europe/San_Marino");
-N_("Europe/Sarajevo");
-N_("Europe/Simferopol");
-N_("Europe/Skopje");
-N_("Europe/Sofia");
-N_("Europe/Stockholm");
-N_("Europe/Tallinn");
-N_("Europe/Tirane");
-N_("Europe/Uzhgorod");
-N_("Europe/Vaduz");
-N_("Europe/Vatican");
-N_("Europe/Vienna");
-N_("Europe/Vilnius");
-N_("Europe/Warsaw");
-N_("Europe/Zagreb");
-N_("Europe/Zaporozhye");
-N_("Europe/Zurich");
-N_("Indian/Antananarivo");
-N_("Indian/Chagos");
-N_("Indian/Christmas");
-N_("Indian/Cocos");
-N_("Indian/Comoro");
-N_("Indian/Kerguelen");
-N_("Indian/Mahe");
-N_("Indian/Maldives");
-N_("Indian/Mauritius");
-N_("Indian/Mayotte");
-N_("Indian/Reunion");
-N_("Pacific/Apia");
-N_("Pacific/Auckland");
-N_("Pacific/Chatham");
-N_("Pacific/Easter");
-N_("Pacific/Efate");
-N_("Pacific/Enderbury");
-N_("Pacific/Fakaofo");
-N_("Pacific/Fiji");
-N_("Pacific/Funafuti");
-N_("Pacific/Galapagos");
-N_("Pacific/Gambier");
-N_("Pacific/Guadalcanal");
-N_("Pacific/Guam");
-N_("Pacific/Honolulu");
-N_("Pacific/Johnston");
-N_("Pacific/Kiritimati");
-N_("Pacific/Kosrae");
-N_("Pacific/Kwajalein");
-N_("Pacific/Majuro");
-N_("Pacific/Marquesas");
-N_("Pacific/Midway");
-N_("Pacific/Nauru");
-N_("Pacific/Niue");
-N_("Pacific/Norfolk");
-N_("Pacific/Noumea");
-N_("Pacific/Pago_Pago");
-N_("Pacific/Palau");
-N_("Pacific/Pitcairn");
-N_("Pacific/Ponape");
-N_("Pacific/Port_Moresby");
-N_("Pacific/Rarotonga");
-N_("Pacific/Saipan");
-N_("Pacific/Tahiti");
-N_("Pacific/Tarawa");
-N_("Pacific/Tongatapu");
-N_("Pacific/Truk");
-N_("Pacific/Wake");
-N_("Pacific/Wallis");
-N_("Pacific/Yap");
diff --git a/camel.pc.in b/camel.pc.in
deleted file mode 100644
index 1249b1897c..0000000000
--- a/camel.pc.in
+++ /dev/null
@@ -1,15 +0,0 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
-
-camel_providerdir=@camel_providerdir@
-privlibdir=@privlibdir@
-privincludedir=@privincludedir@
-
-Name: camel
-Description: the Evolution mail library
-Version: @VERSION@
-Requires: gal-2.2 >= @GAL_REQUIRED@
-Libs: -L${privlibdir} -lcamel
-Cflags: -I${privincludedir}
diff --git a/camel/.cvsignore b/camel/.cvsignore
deleted file mode 100644
index 094641c7a6..0000000000
--- a/camel/.cvsignore
+++ /dev/null
@@ -1,13 +0,0 @@
-.deps
-Makefile
-Makefile.in
-.libs
-.deps
-*.lo
-*.la
-*.bb
-*.bbg
-*.da
-*.gcov
-camel-lock-helper
-camel-index-control \ No newline at end of file
diff --git a/camel/CODING.STYLE b/camel/CODING.STYLE
deleted file mode 100644
index 58e9c68bbe..0000000000
--- a/camel/CODING.STYLE
+++ /dev/null
@@ -1,19 +0,0 @@
-Note to hackers
----------------
-
-When hacking on camel (and on the gnome mailer in general),
-be sure to follow the same coding style as the initial authors.
-Please read the file HACKING in gnumeric and follow the
-general guidelines explained in it.
-
-Please take a look at camel source files and try to exactly
-imitate the coding style. We are perfectly aware that this
-is not the best and unique style, but it is absolutely
-mandatory that Camel is homogeneous. If you find the current
-coding style to have some weaknesses, please contact the
-authors to discuss this matter.
-
-Thanks.
-
- Bertrand.
-
diff --git a/camel/ChangeLog b/camel/ChangeLog
deleted file mode 100644
index 94ffcdc39b..0000000000
--- a/camel/ChangeLog
+++ /dev/null
@@ -1,1488 +0,0 @@
-2003-12-08 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-utils.c (header_decode_rfc2184_param): Revert the
- s/is_/camel_mime_is_/ changes or we get really long variable
- names.
- (header_decode_param): Same.
- (header_decode_param_list): Here too.
-
-2003-12-09 Not Zed <NotZed@Ximian.com>
-
- * providers/smtp/camel-smtp-transport.c (smtp_send_to): encode the
- address before sending it out, rather than using the raw/utf8
- version.
-
- * camel-internet-address.c
- (camel_internet_address_encode_address): check for quoting the
- local part of the address before outputting it.
- (cia_encode_addrspec): quote local part if need be.
- (camel_internet_address_encode_address): make folding optional
- based on whether inlen is null or not.
-
- * camel-mime-utils.[ch]: rename is_* to camel_mime_is_* and export
- the type functions.
-
-2003-12-08 Not Zed <NotZed@Ximian.com>
-
- * providers/imap/camel-imap-utils.c (imap_atom_specials): add } to
- the atom specials list. This isn't correct, but some busted
- servers expect it. Bug #50728.
-
-2003-12-08 Jeffrey Stedfast <fejj@ximian.com>
-
- Fixes bug #51881
-
- * providers/local/camel-mbox-store.c (delete_folder): Same.
-
- * providers/local/camel-local-store.c (delete_folder): Unlink the
- cmeta file too.
-
-2003-12-06 JP Rosevear <jpr@ximian.com>
-
- * */Makefile.am: Remove hard coded disable deprecated flags
-
-2003-12-05 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-gpg-context.c (gpg_ctx_op_start): Properly set the
- O_NONBLOCK flag along with any previously set flags.
-
- * camel-filter-search.c (run_command): Don't set O_NONBLOCK on the
- pipe (1. we don't need to, and 2. we should have been setting
- O_NONBLOCK|prev_flags but we weren't, and so the pipe got
- O_RDONLY|O_NONBLOCK even tho we wanted to write to it).
-
- * camel-filter-driver.c (pipe_to_system): Same.
-
-2003-12-04 Radek Doulik <rodo@ximian.com>
-
- * camel-folder.c (folder_changed): check recent messages for junk
- mail
-
- * camel-session.c (camel_session_check_junk): new wrapper method
- for check_junk flag
- (camel_session_set_check_junk): ditto
-
- * camel-session.h (struct _CamelSession): added check_junk flag
- (if to check incoming mail for junk messages)
-
-2003-12-03 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-store.c (add_special_info): Free fi->path if we are gonna
- replace it with the vinfo path.
-
- * providers/local/camel-mbox-store.c (create_folder): Treat
- parent_name == NULL and parent_name == "" the same.
-
- * camel-store.c (camel_store_get_folder_info): Only add
- vTrash/vJunk info's if we've requested the toplevel folder tree,
- otherwise we get vTrash/vJunk folders in odd places in the folder
- tree.
- (add_special_info): Use the provider->url_flags to determine if
- the url uses the fragment or not for the path.
-
-2003-12-02 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-local-folder.c (local_setv): remove some
- debug printfs.
-
- ** See bug #51576.
-
- * camel-url.c (camel_url_decode): robustify url decoding for bad
- input, addresses a crash.
-
- ** See bug #51478.
-
- * camel-gpg-context.c (gpg_ctx_free): handle the context being
- NULL, and exit silently.
-
-2003-12-01 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-process.c (camel_process_fork): Start at fd = 3.
-
- * camel-gpg-context.c (gpg_ctx_op_start): Same.
-
- * camel-filter-driver.c (pipe_to_system): Same.
-
- * camel-filter-search.c (run_command): Start at fd = 3.
-
-2003-12-01 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-stream-process.c (do_exec_command): Same.
-
- * camel-process.c (camel_process_fork): Same.
-
- * camel-filter-search.c (run_command): Same as below.
-
- * camel-filter-driver.c (pipe_to_system): Same as below.
-
- * camel-gpg-context.c (gpg_ctx_op_start): Use fcntl() to set
- FD_CLOEXEC on each fd rather than close()ing it. Apparently
- Linux's older pthread implementations use sockets and so this
- fouls threading up. GO LINUX! GO!
-
-2003-12-01 Radek Doulik <rodo@ximian.com>
-
- * camel-store.c (add_special_info): set SUBSCRIBED and NOINFERIORS
- flags to special folders, renamed method from
- add_vtrash_or_vjunk_info
- (camel_store_get_folder_info): call add_special_info directly
-
-2003-11-28 Radek Doulik <rodo@ximian.com>
-
- * camel-store.c (camel_store_get_folder_info): use old code from
- mail-ops to add vtrash/vjunk info
-
-2003-11-28 David Woodhouse <dwmw2@redhat.com>
-
- * providers/imap/camel-imap-provider.c: Enable GUI option for
- 'custom command' connection.
- * providers/imap/camel-imap-store.c: Don't g_free strings in
- .rodata. It's considered rude.
-
-2003-11-28 Not Zed <NotZed@Ximian.com>
-
- * camel-mime-utils.c (mail_list_magic[]): Added list-unsubscribe
- header match.
-
-2003-11-26 Not Zed <NotZed@Ximian.com>
-
- * camel-smime-context.c (sm_verify_cmsg): take a stream rather
- than a part for the content.
- (sm_verify): get the content directly as a stream.
-
- * camel-multipart-signed.c
- (camel_multipart_signed_get_content_stream): new api to get the
- content stream which will match the signed version.
-
-2003-11-26 JP Rosevear <jpr@ximian.com>
-
- * Makefile.am: make sure we always dist the smime stuff
-
-2003-11-26 JP Rosevear <jpr@ximian.com>
-
- * Makefile.am (libcamelinclude_HEADERS): conditionally compile
- s/mime support
-
-2003-11-25 Not Zed <NotZed@Ximian.com>
-
- * camel-cipher-context.c (camel_cipher_validity_envelope): change
- args to make it suit storing the validity in a tree.
- (camel_cipher_validity_init): init the list header.
- (camel_cipher_validity_clone): call validity_new so it gets init
- properly.
- (camel_cipher_validity_free): free any children nodes recursively.
-
- * camel-cipher-context.h (CamelCipherValidity): added next/prev
- and list header.
-
-2003-11-18 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-session.c (camel_session_finalise): Don't destroy the
- providers as it mans we can never ever have more than 1 session
- object. See bug #51119 for details.
-
-2003-11-17 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/local/camel-mbox-store.c (create_folder): Fixed an
- exception to give a more meaningful description.
- (get_folder_info): We always want to scan at least one level deep.
-
-2003-11-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/local/camel-mbox-store.c (get_folder_info): Handle ""
- as a request for a full dirscan as well (not just NULL). Makes it
- consistant with other stores.
- (scan_dir): Set the fi->flags appropriately.
-
- * providers/local/camel-mbox-folder.c
- (camel_mbox_folder_get_full_path): Removed temporary hack.
-
-2003-11-14 Not Zed <NotZed@Ximian.com>
-
- * camel-mime-parser.c (SCAN_BUF): oops, put the mempool stuff
- back, we don't use e-memory afterall. Damn plane hacking.
-
-2003-11-13 Not Zed <NotZed@Ximian.com>
-
- * camel-mime-parser.c: Remove mempool code, we use the stuff in
- e-util.
- (PRESERVE_HEADERS): new compile option, if on, we preserve headers
- and folding exactly rather than unfolding all input. THIS BREAKS
- EVERYTHING right now, so don't turn it on.
-
- * camel-gpg-context.c (gpg_decrypt): reset the input memstream
- before passing it to the gpg engine.
-
- * tests/smime/pgp-mime.c (main): redirect /dev/null to stdin so it
- doesn't hang waiting for input.
- (main): removed from build - this tests multipart/signed
- explictly, but now the details of this is handled directly by the
- cipher context.
-
- * tests/smime/pgp.c (main): fixes for api changes.
- (main): redirect /dev/null to stdin so it doesn't hang waiting for
- input.
-
- * tests/message/test1.c (main): update for api changes.
-
- * camel-smime-context.c (sm_verify): look at the content object's
- mime type, not the container's type.
-
-2003-11-11 Not Zed <NotZed@Ximian.com>
-
- * camel-cipher-context.c (camel_cipher_validity_set_valid): take
- into account the @valid argument and set validity properly.
- (camel_cipher_validity_clone): new method to copy validities.
-
- * camel-smime-context.c (sm_signing_cmsmessage): removed a todo.
-
-2003-11-10 Not Zed <NotZed@Ximian.com>
-
- * camel-smime-context.c (sm_verify_cmsg): split out the CMSMessage
- verification code so it can be used from enveloped or externally
- signed data.
-
- * camel-cipher-context.c (camel_cipher_verify): only take a
- mimepart, internally handle multiparts and the hash.
-
-2003-11-07 Not Zed <NotZed@Ximian.com>
-
- * camel-cipher-context.c: make ciphervalidity a public structure,
- added encrypt status.
- (camel_cipher_decrypt): changed to return a ciphervalidity. fixed
- implementations.
- (camel_cipher_validity_*): Fixed implementations to match new
- structure, some of this is now redundant.
-
-2003-11-06 Not Zed <NotZed@Ximian.com>
-
- * camel-smime-context.c (camel_smime_context_describe_part):
- implement.
-
-2003-11-05 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/smtp/camel-smtp-transport.c (connect_to_server): Don't
- bother trying to see if the server advertises EHLO. Simply always
- try EHLO and fall back to HELO if EHLO fails. Fixes bug #50535.
-
-2003-11-05 Not Zed <NotZed@Ximian.com>
-
- * camel-smime-context.c (camel_smime_context_describe_part): new
- (unfinished) api to peek inside smime parts to tell us whats in
- it.
-
-2003-11-03 Not Zed <NotZed@Ximian.com>
-
- * camel-gpg-context.c (gpg_encrypt): Make this output the
- full multipart/encrypted part, not just the encrypted content part.
-
- * camel-cipher-context.c (camel_cipher_sign): change to output
- full mime part, not just a stream.
- (camel_cipher_canonical_to_stream): utility function to
- canonicalise a mimepart to a stream.
-
- * camel-smime-context.c (sm_encode_cmsmessage): removed.
- (sm_sign): change interface to output a full mime-part, not just a
- part of a mime part in multipart/signed mode.
-
-2003-11-04 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-gpg-context.c (gpg_ctx_parse_status): We might need to
- convert the passwd from UTF-8 into the locale charset. Fixes bug
- #50485.
-
-2003-10-31 Not Zed <NotZed@Ximian.com>
-
- * camel-cms-context.[ch]: removed, now redundant.
-
-2003-10-30 Not Zed <NotZed@Ximian.com>
-
- * camel-smime-context.c (sm_get_passwd): implement something basic.
-
- * camel-cipher-context.h: Added a note about api inconsistencies.
-
-2003-10-30 Not Zed <NotZed@Ximian.com>
-
- * camel-multipart-encrypted.c (camel_multipart_encrypted_decrypt):
- fix for cipher_decrypt changes.
-
- * camel-gpg-context.c, camel-cipher-context.c: moved all the init
- code to the end to save having to keep forward declarations
- around.
- (camel_cipher_decrypt): changed to take mimepart input and return
- a mimepart.
- (gpg_decrypt): fix for changed args.
-
-2003-10-29 Not Zed <NotZed@Ximian.com>
-
- * camel-smime-context.[ch]: replaced entirely with a new
- implementation which inherits from camel-cipher-context, and add
- to build.
-
- * camel-multipart-encrypted.c (camel_multipart_encrypted_encrypt):
- fix for cipher_encrypt api changes.
- (camel_multipart_encrypted_decrypt): use g_ascii_strcasecmp.
-
- * camel-gpg-context.c (gpg_encrypt): Fix to handle input/output as
- parts not streams
-
- * camel-cipher-context.c (camel_cipher_encrypt): change to take
- mimeparts rather than streams as input/output. And remove the
- 'sign' argument, it is implied if userid is supplied.
-
-2003-10-28 Not Zed <NotZed@Ximian.com>
-
- * tests/smime/pgp.c (main): fix for ciphercontext api changes.
-
- * camel-multipart-signed.c (camel_multipart_signed_verify): pass
- in the part to cipher_verify directly.
- (camel_multipart_signed_sign): let the cipher context setup the
- part details.
-
- * camel-gpg-context.c (gpg_sign): put the signature stream into a
- mimepart, with appropriate headers/encoding.
- (swrite): write out a mimepart rather than a stream.
- (gpg_verify): handle changed args.
-
- * camel-cipher-context.c (camel_cipher_sign): write the signature
- to a mimepart rather than a simple stream.
- (camel_cipher_verify): take the signature as a mimepart not a
- stream.
-
-2003-10-22 Not Zed <NotZed@Ximian.com>
-
- * camel-utf8.c (camel_ucs2_utf8, camel_utf8_ucs2): helpers for
- ucs2 stuff. ucs2 is 16 bit truncated unicode.
-
-2003-10-28 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-utils.c: We should check List-Post before List-Id
- (List-Post has to contain the mailing-list posting address,
- whereas List-Id does not.) WAlso moved X-Loop to after List-Id to
- make FreeBSD lusers happy. Fixes bug #32297.
-
-2003-10-28 Jeffrey Stedfast <fejj@ximian.com>
-
- * Fixes bug #35083
-
- * providers/imap/camel-imap-store.c (connect_to_server): Same
- here.
-
- * providers/pop3/camel-pop3-store.c (connect_to_server): Same as
- the smtp changes.
-
- * providers/smtp/camel-smtp-transport.c (connect_to_server): If
- HAVE_SSL is undefined, don't default to raw connections if the
- option to connect via ssl is set. Instead set an exception and
- return fail.
-
-2003-10-27 Frederic Crozat <fcrozat@mandrakesoft.com>
-
- * camel-mime-utils.c: (camel_header_decode_date):
- better detection of broken date to give to broken_date_parser.
-
-2003-10-24 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-text-index.c (text_index_name_add_buffer): If a word is
- longer than CAMEL_TEXT_INDEX_MAX_WORDLEN, then ignore it. This
- fixes bug #50096.
-
-2003-10-23 Jeffrey Stedfast <fejj@ximian.com>
-
- * *.c: Removed unneeded CAMEL_OBJECT() casts.
-
-2003-10-21 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-local-folder.c (local_getv, local_setv):
- use the right tag name for the index_body arg.
- (local_sync): write any persistent metadata - to make it
- persistent.
- (camel_local_folder_construct): turn off indexing, for now, it
- should be done in local_setv.
-
- * providers/local/camel-local-folder.h: change body_index to a bool
- type.
-
- * camel-object.c (cobject_state_read, cobject_state_write): handle
- bool types
- (cobject_state_write): make sure we free all arg types.
-
- * camel-arg.c (camel_argv_build):
- (camel_arggetv_build): handle bool type.
-
- * camel-arg.h: Added BOO (bool) type.
-
-2003-10-15 Not Zed <NotZed@Ximian.com>
-
- * camel-store.c (camel_folder_info_build): Fix so we output the
- tree in sorted depth-first order, rather in reverse.
-
-2003-10-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-sasl-kerberos4.c: Fixed a #include.
-
-2003-10-10 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-local-provider.c: set the url fragment
- flag for local providers.
-
- * camel-provider.h: Move the URL_PART_NEED bits to the high 16
- bits, to allow for easier changes in the future. Added a
- URL_PART_FRAGMENT flag for providers that use fragment = folder
- path.
-
-2003-10-09 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-utils.c (header_decode_date): Allow timezone offsets
- to be up to 14 hours ahead of UTC. Fixes bug #49357.
-
- * broken-date-parser.c (get_tzone): Same.
-
-2003-10-08 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/smtp/camel-smtp-transport.c (smtp_helo): Removed an
- unused variable.
-
-2003-09-25 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/smtp/camel-smtp-transport.c (smtp_helo): If the
- localhost lookup results in a numeric IPv6 host, use the form
- "[IPv6:<addr>]" as specified in rfc2821. Fixes bug #46006.
-
-2003-09-23 Ettore Perazzoli <ettore@ximian.com>
-
- * providers/local/camel-local-provider.c: Set the IS_STORAGE bit
- in the mbox provider, since it can now contain a hierarchy of
- folders.
-
-2003-09-23 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/local/camel-mbox-store.c (get_folder): If the CREATE
- flag is set and the parent .sbd directory does not exist, create
- it.
-
- * camel-mime-utils.c (append_8bit): Don't forget to flush the
- iconv conversion.
-
- * tests/message/test4.c (main): Don't try dot-files.
-
-2003-09-22 Not Zed <NotZed@Ximian.com>
-
- ** See bug #41610
-
- * providers/pop3/camel-pop3-folder.c (cmd_tocache): protect a
- divide by 0 for 0 length messages.
-
-2003-09-22 Not Zed <NotZed@Ximian.com>
-
- * providers/imap/camel-imap-provider.c: Added "offline_sync"
- option, which lets you synchronise all mail to local storage
- automagically.
-
- * camel-disco-folder.c (cdf_folder_changed): hook onto the folder
- changed single, for all new messages, check that they are online
- using another thread, if the offline_sync option has been enabled
- for this store.
-
-2003-09-21 Not Zed <NotZed@Ximian.com>
-
- * camel-session.c (session_thread_destroy): call proper entry
- point for freeing the message.
-
-2003-09-18 Not Zed <NotZed@Ximian.com>
-
- * camel-folder.c (filter_filter): register the filtering process
- for progress, and do progress of the filtering process.
-
-2003-09-17 Not Zed <NotZed@Ximian.com>
-
- * camel.c (camel_init): init camel operation.
-
- * camel-operation.c (camel_operation_reset): removed, not used,
- not worth it.
- (camel_operation_mute): new method to stop all status updates
- permanently.
- (*): Changed to use thread specific data and a list rather than a
- hashtable.
- (cancel_thread): removed.
- (camel_operation_register): return the previously registered op.
-
-2003-09-22 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/nntp/camel-nntp-store.c (connect_to_server): Fix the
- code that creates a new ssl stream to pass the correct arguments
- and the proper flags.
-
- * providers/imapp/camel-imapp-folder.c (imap_sync): Cast the
- CamelFolder to a CamelIMAPPFolder to hush some compiler warnings.
-
- * camel-mime-utils.h: Define a struct _CamelContentDisposition
- (allows the imapp code to compile)
-
- * providers/imapp/camel-imapp-driver.c: #include <string.h>
-
-2003-09-18 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-utils.c (camel_transfer_encoding_to_string): New
- function to replace the one from camel-mime-part.c
- (camel_transfer_encoding_from_string): Same.
- (camel_content_transfer_encoding_decode): Renamed from
- camel_header_content_encoding_decode().
-
- * camel-mime-part.c (camel_mime_part_encoding_to_string): Removed.
- (camel_mime_part_encoding_from_string): Removed.
-
- * camel-data-wrapper.[c,h]: updated for CamelTransferEncoding
- namespace changes
-
- * camel-folder-summary.c: updated for CamelTransferEncoding
- namespace changes
-
- * camel-mime-filter-bestenc.[c,h]: updated for CamelTransferEncoding
- namespace changes
-
- * camel-mime-message.c: updated for CamelTransferEncoding
- namespace changes
-
- * camel-mime-part-utils.c: updated for CamelTransferEncoding
- namespace changes
-
- * camel-multipart-signed.c: updated for CamelTransferEncoding
- namespace changes
-
- * camel-smime-context.c: updated for CamelTransferEncoding
- namespace changes
-
- * providers/imapp/camel-imapp-utils.c: updated for
- CamelTransferEncoding namespace changes
-
- * tests/lib/messages.c: updated for CamelTransferEncoding
- namespace changes
-
- * tests/message/test1.c: updated for CamelTransferEncoding
- namespace changes
-
-2003-09-18 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-utils.[c,h]: namespaced the encoding/decoding
- routines.
-
- * camel-mime-filter-basic.c: updated for namespace changes to the
- encoding/decoding routines in camel-mime-utils.c
-
- * camel-multipart.c: updated for namespace changes to the
- encoding/decoding routines in camel-mime-utils.c
-
- * camel-sasl-digest-md5.c: updated for namespace changes to the
- encoding/decoding routines in camel-mime-utils.c
-
- * camel-sasl.c: updated for namespace changes to the
- encoding/decoding routines in camel-mime-utils.c
-
- * camel-vee-folder.c: updated for namespace changes to the
- encoding/decoding routines in camel-mime-utils.c
-
- * providers/imap/camel-imap-search.c: updated for namespace
- changes to the encoding/decoding routines in camel-mime-utils.c
-
- * providers/pop3/camel-pop3-folder.c: updated for namespace
- changes to the encoding/decoding routines in camel-mime-utils.c
-
-2003-08-26 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-parser.[c,h]: s/HSCAN_/CAMEL_MIME_PARSER_STATE_/g and
- s/_header_state/_camel_mime_parser_state/g
-
- * camel-filter-driver.c: Same.
-
- * camel-folder-summary.c: Here too.
-
- * camel-http-stream.c: And here.
-
- * camel-mime-message.c: ...
-
- * camel-mime-part-utils.c: ...
-
- * camel-mime-part.c: ...
-
- * camel-movemail.c: ...
-
- * camel-multipart-signed.c: ...
-
- * camel-multipart.c: ...
-
- * providers/local/camel-mbox-folder.c: ...
-
- * providers/local/camel-mbox-summary.c: ...
-
- * providers/local/camel-mh-summary.c: ...
-
- * providers/nntp/camel-nntp-summary.c: ...
-
- * providers/pop3/camel-pop3-folder.c: ...
-
-2003-08-25 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-utils.[c,h]: Namespaced.
-
- * camel-data-wrapper.c: updated for namespace changed made to
- camel-mime-utils.[c,h]
-
- * camel-digest-folder.c: updated for namespace changed made to
- camel-mime-utils.[c,h]
-
- * camel-filter-driver.c: updated for namespace changed made to
- camel-mime-utils.[c,h]
-
- * camel-filter-search.c: updated for namespace changed made to
- camel-mime-utils.[c,h]
-
- * camel-folder-search.c: updated for namespace changed made to
- camel-mime-utils.[c,h]
-
- * camel-folder-summary.[c,h]: updated for namespace changed made
- to camel-mime-utils.[c,h]
-
- * camel-http-stream.c: updated for namespace changed made to
- camel-mime-utils.[c,h]
-
- * camel-http-stream.h: updated for namespace changed made to
- camel-mime-utils.[c,h]
-
- * camel-internet-address.c: updated for namespace changed made to
- camel-mime-utils.[c,h]
-
- * camel-medium.[c,h]: updated for namespace changed made to
- camel-mime-utils.[c,h]
-
- * camel-mime-message.c: updated for namespace changed made to
- camel-mime-utils.[c,h]
-
- * camel-mime-parser.[c,h]: updated for namespace changed made to
- camel-mime-utils.[c,h]
-
- * camel-mime-part-utils.c: updated for namespace changed made to
- camel-mime-utils.[c,h]
-
- * camel-mime-part.[c,h]: updated for namespace changed made to
- camel-mime-utils.[c,h]
-
- * camel-movemail.c: updated for namespace changed made to
- camel-mime-utils.[c,h]
-
- * camel-multipart-encrypted.c: updated for namespace changed made
- to camel-mime-utils.[c,h]
-
- * camel-multipart-signed.c: updated for namespace changed made to
- camel-mime-utils.[c,h]
-
- * camel-multipart.c: updated for namespace changed made to
- camel-mime-utils.[c,h]
-
- * camel-search-private.[c,h]: updated for namespace changed made
- to camel-mime-utils.[c,h]
-
- * camel-types.h: updated for namespace changed made to
- camel-mime-utils.[c,h]
-
- * providers/imap/camel-imap-folder.c: updated for namespace
- changed made to camel-mime-utils.[c,h]
-
- * providers/imap/camel-imap-store-summary.c: updated for namespace
- changed made to camel-mime-utils.[c,h]
-
- * providers/imap/camel-imap-utils.c: updated for namespace changed
- made to camel-mime-utils.[c,h]
-
- * providers/imapp/camel-imapp-utils.[c,h]: updated for namespace
- changed made to camel-mime-utils.[c,h]
-
- * providers/local/camel-local-summary.[c,h]: updated for namespace
- changed made to camel-mime-utils.[c,h]
-
- * providers/local/camel-maildir-summary.c: updated for namespace
- changed made to camel-mime-utils.[c,h]
-
- * providers/local/camel-mbox-summary.c: updated for namespace
- changed made to camel-mime-utils.[c,h]
-
- * providers/local/camel-spool-summary.h: updated for namespace
- changed made to camel-mime-utils.[c,h]
-
- * providers/nntp/camel-nntp-summary.c: updated for namespace
- changed made to camel-mime-utils.[c,h]
-
- * providers/nntp/camel-nntp-utils.c: updated for namespace changed
- made to camel-mime-utils.[c,h]
-
- * providers/pop3/camel-pop3-folder.c: updated for namespace
- changed made to camel-mime-utils.[c,h]
-
- * providers/sendmail/camel-sendmail-transport.c: updated for
- namespace changed made to camel-mime-utils.[c,h]
-
- * providers/smtp/camel-smtp-transport.c: updated for namespace
- changed made to camel-mime-utils.[c,h]
-
-2003-09-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/local/camel-mbox-folder.c
- (camel_mbox_folder_get_full_path): Implement a temp hack so trunk
- works until we merge in new-ui-branch.
-
- * camel-stream-filter.c (do_flush): Don't warning about how we
- haven't written anything to the stream, this is not an
- error. fflush() doesn't care if you try to fflush() a stream
- without writing to it, so we shouldn't care either.
-
-2003-09-15 Not Zed <NotZed@Ximian.com>
-
- * providers/imapp/camel-imapp-store.c (store_resp_list)
- (imap_login, try_sasl, imap_try_authenticate): removed dead code.
-
- * providers/imapp/camel-imapp-stream.c: return -1 if stream not
- set.
-
- * providers/imapp/camel-imapp-engine.c (iterate_completion): put
- done request on the done queue, so all requests are always
- somewhere.
- (camel_imapp_engine_command_free): just spit warnings of active
- messages being freed, but abort if the item isn't in any list.
- Also remove the node from its list before going on.
- (iterate_untagged, iterate_continuation, iterate_completion):
- staticifiy.
-
- * providers/imapp/camel-imapp-provider.c
- (camel_imapp_module_init): move camel_exception_setup call here.
-
- * providers/imapp/camel-imapp-driver.c
- (camel_imapp_driver_get_type): remove execption setup here, it
- isn't early enough.
- (camel_imapp_driver_list): handle exceptions.
-
-2003-09-12 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/local/camel-mbox-folder.c
- (camel_mbox_folder_get_full_path): Implements
- CamelLocalFolder::get_full_path() (publicly namespaced so that
- CamelMboxStore can re-use them).
- (camel_mbox_folder_get_meta_path): Same.
-
- * providers/local/camel-mbox-store.c (get_folder): Changed the way
- the path is constructed, since we now handle subdirectories and
- stuff.
- (delete_folder): Try deleting the Folder.sbd directory. We also
- need to manage our own meta files since CamelLocalStore's impl
- constructs paths differently than what we need.
- (create_folder): Implemented.
- (rename_folder): Implemented.
- (scan_dir): Scan an mbox tree
- (get_folder_info): Implemented using scan_dir().
-
- * providers/local/camel-local-store.c (delete_folder): Set fi->url
- to the correct value, meaning we need to prefix it with the
- protocol and the folder_name is not actually part of the path, it
- is a separate component to the url.
-
- * providers/local/camel-local-folder.c
- (camel_local_folder_construct): Use the new class virtual method
- to construct the full folder path and all the meta files.
- (local_get_full_path): Implemented default get_full_path method.
- (local_get_meta_path): Implemented default get_meta_path method.
-
-2003-09-11 Dan Winship <danw@ximian.com>
-
- * Makefile.am (noinst_LTLIBRARIES): Remove libcamel-static.la
-
-2003-09-05 Not Zed <NotZed@Ximian.com>
-
- * providers/imap/camel-imap-store.c (imap_noop): call
- camel_folder_sync bypassing the folder lock. See
- imap_store_refresh_folders too.
-
-2003-09-04 David Woodhouse <dwmw2@infradead.org>
-
- * providers/camel-imap-store.[ch]: Add PREAUTH handling and
- pine/mutt/etpan/etc.-style 'ssh <mailhost> exec imapd' support.
-
-2003-09-03 David Woodhouse <dwmw2@infradead.org>
-
- * camel-stream-process.[ch]: New stream implementation for running
- commands.
- * Makefile.am: Compile the above
-
-2003-08-20 Not Zed <NotZed@Ximian.com>
-
- ** See bug #47765.
-
- * camel-folder-search.h: Removed match1 member.
-
- * camel-folder-search.c (camel_folder_search_match_expression):
- use current directly rather than match1. This method isn't used
- anywhere anyway.
- (search_not): remove match1 stuff.
- (search_match_all): properly handle the match-all against 1
- message as a scalar result, not an array result.
-
-2003-09-03 Not Zed <NotZed@Ximian.com>
-
- * camel-http-stream.c (camel_http_stream_set_proxy): handle NULL
- proxy_url - unset the proxy.
-
-2003-08-29 Not Zed <NotZed@Ximian.com>
-
- * camel-object.c (camel_object_state_write):
- (cobject_getv):
- (cobject_setv, cobject_state_read, cobject_state_read)
- (cobject_state_write): removed debug printfs.
-
- * providers/local/camel-local-folder.c (local_getv): Need to copy
- the local properties list before passing it out, since it's freed.
-
-2003-08-27 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-local-folder.c (local_getv): implement
- PERSISTENT_PROPERTIES, for index mode.
-
- * camel-object.c (cobject_state_read): Also add property reading,
- and bump version to 1.
- (cobject_state_write): add persistent property writing.
-
-2003-08-26 Not Zed <NotZed@Ximian.com>
-
- * camel-folder.c (folder_getv): chain up properly.
-
- * camel-file-utils.c (camel_file_util_savename): helper to create
- a .#filename filename.
-
- * providers/local/camel-local-folder.c
- (camel_local_folder_construct): init meta-data for local folders.
- (local_getv): chain up properly, if args are not processed, rather
- than don't if they aren't.
-
-2003-08-23 Not Zed <NotZed@Ximian.com>
-
- * camel-object.c (cobject_class_init): added a new event,
- meta_changed.
- (camel_object_meta_set, camel_object_meta_get): meta-data api.
- (camel_object_free_hooks): Free meta-data if it is set on the
- object.
-
- * providers/local/camel-local-folder.c
- (camel_local_folder_get_type): setup a property list for local
- folders, just 'index_body' at present.
-
-2003-08-25 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-filter-driver.c (pipe_to_system): Added some more error
- checking for reading/writing to the pipes. Fixes bug #47880.
-
-2003-08-21 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-data-wrapper.c (decode_to_stream): Don't poke
- wrapper->stream directly, use camel_data_wrapper_write_to_stream()
- instead as this simplifies things and makes the imap data wrapper
- implementation Just Work (tm).
-
- * providers/imap/camel-imap-wrapper.c: changed prototype of
- write_to_stream() to return ssize_t.
-
-2003-08-20 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-wrapper.c (imap_wrapper_hydrate): Make
- sure to ref the stream. Fixes bug #47749.
-
-2003-08-18 Not Zed <NotZed@Ximian.com>
-
- * camel-http-stream.c: Various fixes to make it work.
-
- * tests/smime/pgp-mime.c (main): added missing 'ret' variable.
-
- * providers/smtp/camel-smtp-transport.c (connect_to_server):
- * providers/imapp/camel-imapp-store.c (connect_to_server:
- * providers/imap/camel-imap-store.c (connect_to_server):
- * providers/pop3/camel-pop3-store.c (connect_to_server):
- * camel-http-stream.c (http_connect): change service->session for
- tcp_stream_ssl_new.
-
- * camel-tcp-stream-ssl.c: Changed service to session, and fix some
- refcounting of it.
- include camel-operation.h
-
-2003-08-15 Not Zed <NotZed@Ximian.com>
-
- ** See bug #47634.
-
- * tests/lib/messages.c (test_message_compare): check
- write_to_stream returns.
- (message_dump_rec): helper to dump message structure.
-
- * camel-mime-part-utils.c
- (simple_data_wrapper_construct_from_parser): dont set content
- encoding here.
- (camel_mime_part_construct_content_from_parser): set it here
- instead, on every part. basically same as setting the
- mime_type_field always.
-
- * camel-multipart-signed.c (camel_multipart_signed_class_init):
- * camel-mime-message.c (camel_mime_message_class_init):
- * camel-multipart.c (camel_multipart_class_init): override
- decode_to_stream to always do the same as write_to_stream, since
- we can never be encoded.
-
-2003-08-15 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-wrapper.c (imap_wrapper_hydrate):
- Don't attach any filters to decode base64/qp/etc.
-
-2003-08-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-part.c (write_to_stream): Save errno when
- flushing/unreffing the filter stream.
-
-2003-08-13 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-part.c (write_to_stream): If the content is
- base64/qp/uu/etc encoded but the part is 7bit/8bit/(or otherwise
- non-encoded), set reencode to TRUE so that we decode the original
- content stream. Fixes a bug noticed on
- evolution-patches@ximian.com where a patch had a
- Content-Transfer-Encoding of 7bit but was base64 encoded.
-
-2003-08-13 Not Zed <NotZed@Ximian.com>
-
- * camel-folder-summary.c (camel_folder_summary_remove_range): Fix
- the range check, we were stopping removal of 1 or 2 removals, for
- some odd and completely uncomprehensible reason. Perhaps debug
- left in?
-
-2003-08-13 Not Zed <NotZed@Ximian.com>
-
- ** See bug #47517.
-
- * camel-vee-folder.c (vee_sync): Always rebuild folder on any
- sync, not just expunge ones.
-
-2003-08-11 Not Zed <NotZed@Ximian.com>
-
- * providers/imapp/camel-imapp-store.c (imap_get_folder_info):
- force connect manually so basics work.
-
- ** See bug #45505.
-
- * camel-service.c (camel_gethostbyname): duh, pthread_create
- returns the error code directly, not via errno.
- (camel_gethostbyaddr): Same, also properly handle the failure
- case.
-
-2003-08-01 Not Zed <NotZed@Ximian.com>
-
- ** See bug #47208.
-
- * camel-filter-search.c (match_all): match-all with no arguments
- should always return TRUE.
-
- * camel-folder-search.c (camel_folder_search_execute_expression):
- print a warning when we get an invalid result type & fixed a leak
- for that case.
-
-2003-08-08 Jeffrey Stedfast <fejj@ximian.com>
-
- * tests/message/test4.c: New test suite for the mime parser (which
- is where the below 2 fixes were noticed).
-
- * camel-mime-parser.c (folder_boundary_check): Calculate 'len' by
- subtracting the boundary start from inend rather than 'atleast'.
- (folder_scan_content): Calculate 'inend' differently depending on
- the EOF state.
-
-2003-08-08 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-filter-tohtml.c (html_convert): Rather than checking
- *inptr == '\n', check inptr >= inend - this gets rid of an Invalid
- Read report from valgrind.
-
- * camel-mime-part.c (write_to_stream): Don't necessarily re-encode
- just because the encodings differ. Need to look into making it so
- that message/rfc822 and multipart parts ignore the
- Content-Transfer-Encoding header and just keep their 'encoding'
- bits set to DEFAULT.
-
-2003-08-05 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-folder.c (get_content): Updated.
-
- * camel-mime-message.c (camel_mime_message_init): Don't override
- the mime_type here.
- (process_header): Updated to use CamelDataWrapper's mime_type
- field.
- (find_best_encoding): Same.
- (best_encoding): Here too.
-
- * camel-digest-folder.c (camel_digest_folder_new): Updated for
- CamelMimePart::content_type change.
-
- * camel-mime-part.c (camel_mime_part_init): Override our parent
- class's default mime_type.
- (camel_mime_part_finalize): Don't need to unref the content_type
- anymore.
- (process_header): Updated to use CamelDataWrapper's mime_type
- field.
- (camel_mime_part_set_filename): Same.
- (camel_mime_part_get_filename): Same.
- (camel_mime_part_get_content_type): Same.
- (set_content_object): Here too.
- (write_to_stream): Updated.
- (construct_from_parser): Updated.
-
- * camel-mime-part.h: Remove the content_type field.
-
-2003-07-31 Jeffrey Stedfast <fejj@ximian.com>
-
- * tests/lib/messages.c (test_message_compare_content): If the
- chunks differ, perform a hexdump on the data being compared so
- that we may analyse it easier.
-
- * camel-multipart-signed.c (write_to_stream): Return ssize_t.
-
- * camel-mime-utils.h: Added the CamelMimePartEncodingType enum
- here.
-
- * camel-mime-part.h: Removed the CamelMimePartEncodingType enum
- from here.
-
- * camel-mime-part.c (write_to_stream): Updated to return
- ssize_t. Also minor changes to only re-encode the content stream
- if the charset or encoding changed (this way we write it out in
- the original raw form if nothing changed).
-
- * camel-mime-part-utils.c
- (simple_data_wrapper_construct_from_parser): Drastically
- simplify. We no longer scan html content to try and find the
- charset, nor do we care about converting the content to UTF-8 and
- handling broken windows charsets.
-
- * camel-mime-message.c (find_best_encoding): Use
- decode_to_stream() here. Also updated to not assume the content
- charset is UTF-8 since it is very likely not the case anymore
- since data-wrappers no longer are converted to UTF-8 at parse
- time.
-
- * camel-folder-summary.c (summary_build_content_info_message): Use
- decode_to_stream instead here too.
-
- * camel-folder-search.c (match_words_1message): Use
- decode_to_stream instead of write_to_stream so we can search the
- contents.
-
- * camel-data-wrapper.c (camel_data_wrapper_init): Set the default
- encoding to DEFAULT.
- (write_to_stream): Updated to return ssize_t
- (camel_data_wrapper_decode_to_stream): New virtual function to
- decode a data wrapper to a stream (results in nearly identical
- behaviour to the old write_to_stream method).
- (decode_to_stream): Default implementation of above virtual
- method. Decodes base64/qp/etc streams.
-
- * camel-data-wrapper.h: Removed the rawtext bit and added an
- encoding member.
-
-2003-08-01 Jeffrey Stedfast <fejj@ximian.com>
-
- * tests/smime/pgp-mime.c: Same.
-
- * tests/smime/pgp.c: Updated to build and to import some custom
- gpg keys for use with testing.
-
-2003-07-30 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-message.c (write_to_stream): Also updated.
-
- * camel-data-wrapper.c (write_to_stream): This should return ssize_t
-
- * camel-multipart-signed.c (write_to_stream): Updated.
-
- * camel-multipart.c (write_to_stream): Same.
-
- * camel-mime-part.c (write_to_stream): Here too.
-
-2003-07-11 Suresh Chandrasekharan <suresh.chandrasekharan@sun.com>
-
- * camel-iconv.c: Fix for #46168 'some additional locale aliases
- required for chinese support'.
-
-2003-07-25 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-utils.c (header_decode_word): Revert NotZed's fix for
- bug #42170 - this causes even more problems than it solves. See
- bug #46331 for info. Basically, each address header would be
- converted to UTF-8 twice which means no raw 8bit address header
- would render correctly.
- (header_decode_mailbox): Perform a sanity check on the resultant
- addr->str to make sure that it is valid UTF-8, if not convert it
- to UTF-8. Fixes bug #42170.
-
-2003-07-23 Ettore Perazzoli <ettore@ximian.com>
-
- * camel-provider.c (camel_provider_init): Print the provider
- directory as well, for debugging.
-
-2003-07-23 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-message.c (find_best_encoding): Revert my previous
- changes to this function.
-
- * camel-mime-utils.h: Revert previous changes.
-
- * camel-mime-part.h: Revert previous changes.
-
- * camel-mime-part-utils.c: Revert previous changes.
-
- * camel-data-wrapper.c (camel_data_wrapper_init): Revert previous
- changes.
- (write_to_stream): Revert previous changes.
-
-2003-07-23 Dan Winship <danw@ximian.com>
-
- * camel-block-file.c: #include camel-file-utils.h for camel_read()
-
- * camel-uid-cache.c (camel_uid_cache_save): Remove unused variable
- and label.
-
- * camel-url.c: #include camel-string-utils.h for camel_strdown
-
- * providers/pop3/camel-pop3-store.c (pop3_try_authenticate): Cast
- an (unsigned char *) to (char *) to fix a warning
-
-2003-07-17 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-message.c (find_best_encoding): Updated to convert
- to/from the correct charset (since content is no longer
- necessarily in UTF-8).
- (best_encoding): Free the charset string when we're done with it.
-
- * camel-stream-fs.c (stream_read): Increment the seekable stream
- position by the number of bytes read. Oops.
- (stream_write): Same here.
-
-2003-07-17 Timo Sirainen <tss@iki.fi>
-
- ** See bug #42573
-
- * providers/imap/camel-imap-folder.c (do_append): Only free the
- response after we have finished the literal request, otherwise we
- could try processing folder updates incorrectly.
-
-2003-07-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-utils.h: Add the CamelMimePartEncodingType definition
- here.
-
- * camel-mime-part.h: Remove the CamelMimePartEncodingType
- definition.
-
- * camel-mime-part-utils.c
- (simple_data_wrapper_construct_from_parser): Don't do any of the
- auto-detection we used to do here anymore. Just read the content
- into a memory buffer and record the encoding type.
- (camel_mime_part_construct_content_from_parser): Don't mangle the
- Content-Type struct here anymore.
-
- * camel-data-wrapper.c (camel_data_wrapper_init): Init encoding to
- DEFAULT.
- (write_to_stream): If the stream needs to be decoded, decode it.
-
-2003-07-15 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-stream-fs.c (stream_read): If we read 0 bytes, then set
- eos to TRUE.
-
-2003-07-09 Jeffrey Stedfast <fejj@ximian.com>
-
- Get rid of the #ifdef ENABLE_THREADS since we no longer plan to
- support/maintain this.
-
- * providers/nntp/camel-nntp-store.c: Here.
-
- * providers/nntp/camel-nntp-newsrc.c: And here.
-
- * providers/nntp/camel-nntp-folder.c: Same.
-
- * providers/local/camel-local-folder.c: And here.
-
- * camel-block-file.c: Here too.
-
- * camel.c: Same.
-
- * camel-certdb.c: Here too.
-
- * camel-charset-map.c: And here.
-
- * camel-cipher-context.c: "
-
- * camel-data-wrapper.c: "
-
- * camel-digest-folder.c: "
-
- * camel-exception.c: "
-
- * camel-folder.c: "
-
- * camel-folder-summary.c: "
-
- * camel-lock-client.c: "
-
- * camel-mime-utils.c: "
-
- * camel-object.c: "
-
- * camel-operation.c: "
-
- * camel-partition-table.c: "
-
- * camel-sasl-popb4smtp.c: "
-
- * camel-service.c: "
-
- * camel-session.c: "
-
- * camel-store.c: "
-
- * camel-store-summary.c: "
-
- * camel-text-index.c: "
-
- * camel-transport.c: "
-
- * camel-vee-folder.c: "
-
- * camel-tcp-stream-openssl.c: Removed pthread.h, it isn't needed.
-
-2003-07-09 Larry Ewing <lewing@ximian.com>
-
- * camel.h: remove reference to camel-pgp-mime.h
-
-2003-07-08 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-pgp-mime.[c,h]: Removed.
-
- * camel-iconv.c: Updated (new copy/paste from e-iconv).
-
- * camel-block-file.c (camel_block_file_get_block): Use
- camel_read() rather than libc read.
-
- * camel-tcp-stream-raw.c (stream_read): Use camel_read().
- (stream_write): Use camel_write().
-
- * camel-stream-fs.c (stream_read): Use camel_read().
- (stream_write): Use camel_write().
-
-2003-07-07 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/nntp/camel-nntp-folder.c (camel_nntp_folder_new): Use
- camel_mkdir().
-
- * providers/imap/camel-imap-folder.c (camel_imap_folder_new): Use
- camel_mkdir().
-
- * camel-session.c (get_storage_path): Use camel_mkdir().
-
- * camel-store.c (camel_mkdir_hier): Removed.
-
- * camel-data-cache.c (camel_data_cache_new): Updated to use
- camel_mkdir().
- (data_cache_path): Same.
-
- * camel-file-utils.c (camel_mkdir): Renamed and documented.
- (camel_file_util_safe_filename): Documented.
- (camel_read): Moved here from camel-io.c
- (camel_write): Same.
-
- * camel-io.[c,h]: Removed.
-
- * camel-uid-cache.c (camel_uid_cache_new): Use the
- camel-file-utils.c version of mkdir.
-
-2003-07-07 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-session.c (camel_session_init): Updated for string-utils
- namespace changes.
-
- * camel-provider.c: Updated for string-utils namespace changes.
-
- * camel-mime-part.c (init_header_name_table): Updated for
- string-utils namespace changes.
-
- * camel-mime-message.c (camel_mime_message_class_init): Updated
- for string-utils namespace changes.
- (camel_mime_message_init): Same.
-
- * camel-mime-filter-enriched.c
- (camel_mime_filter_enriched_class_init): Updated for string-utils
- namespace changes.
-
- * camel-folder-summary.c (camel_folder_summary_init): Updated for
- string-utils namespace changes.
-
- * camel-string-utils.[c,h]: Renamed from string-utils.[c,h] and
- also namespaced all functions.
-
-2003-07-01 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-sasl-digest-md5.c (digest_response): Don't quote the
- charset value, the qop value, nor the response value. Fixes bug
- #45712.
-
-2003-07-01 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-utils.c (header_format_date): Use gmtime_r() instead
- of using gmtime() and memcpy() to try and be "atomic".
-
-2003-06-30 Dan Winship <danw@ximian.com>
-
- * camel-folder-search.c (camel_folder_search_finalize): free the
- summary hash
-
-2003-06-24 David Woodhouse <dwmw2@infradead.org>
-
- * camel-mime-utils.c (header_format_date): Put day of week into
- outgoing email.
-
-
-2003-06-25 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-folder-summary.h: Added prototype for
- camel_folder_summary_remove_range().
-
-2003-06-25 Not Zed <NotZed@Ximian.com>
-
- ** See bug #45386
-
- * camel-service.c (camel_gethostbyname, camel_gethostbyaddr): Make
- sure we have an exception that we test against.
-
-2003-06-20 Not Zed <NotZed@Ximian.com>
-
- ** See bug #43887
-
- * camel-mime-filter-enriched.c (camel_enriched_to_html): simple
- wrapper to convert enriched to html in one go.
-
-2003-06-18 Not Zed <NotZed@Ximian.com>
-
- * camel-service.c (get_hostbyaddr, get_hostbyname): if we got
- cancelled, the message is floating, so free it.
- (struct _lookup_msg): Add a cancelled tag.
- (camel_gethostbyname, camel_gethostbyaddr): if we get a
- failure/cancel, cancel the lookup thread and detach, so we dont
- have to wait for it to return. cleanup changed to handle the case
- where we didn't get a reply message.
-
-2003-06-13 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/pop3/camel-pop3-folder.c (pop3_finalize): Made static
- (to match the prototype).
-
-2003-06-13 Larry Ewing <lewing@ximian.com>
-
- * camel-folder-thread.c (camel_folder_thread_messages_apply):
- don't leak the summary when reloading it. Fixes a very large
- leak.
-
-2003-06-17 Not Zed <NotZed@Ximian.com>
-
- * camel-vee-folder.c (vee_folder_remove_folder): Calculate ranges
- to remove folder info's more efficiently. affects shutdown
- performance on big vfolders signifinantly.
- (vee_folder_build_folder): do the same here, when rebuilding a
- folder's definition.
-
- * camel-folder-summary.c (camel_folder_summary_remove_index): new
- function to drop a range of index entries in one hit.
-
-2003-06-16 Not Zed <NotZed@Ximian.com>
-
- ** See bug #31745
-
- * providers/imap/camel-imap-store-summary.c
- (camel_imap_store_summary_namespace_new): Workaround a shell bug -
- if the namespace has '#' in it, then strip it.
-
-2003-06-16 Not Zed <NotZed@Ximian.com>
-
- ** See bug #44322
-
- * providers/imap/camel-imap-command.c (imap_command_strdup_vprintf):
- If we are outputting a folder name, make sure we calculate buffer
- size based on the raw/utf7 version
-
- ** See bug #44121
-
- * camel-multipart-signed.c (signed_get_part): If we can't parse
- the content, but we have a stream, just use that as the content.
-
-2003-06-05 Jeffrey Stedfast <fejj@ximian.com>
-
- Fix for bug #40788.
-
- * providers/pop3/camel-pop3-engine.c (camel_pop3_engine_new): Now
- takes a flags argument. Currently there is only 1 flag which can
- be used to disable Pop3 server extensions.
- (get_capabilities): Don't check for Pop3 server extensions if the
- DISABLE_EXTENSIONS flag is set on the engine.
- (camel_pop3_engine_iterate): If we get a response that is neither
- +OK nor -ERR, default to treating it like a -ERR.
-
- * providers/pop3/camel-pop3-store.c (connect_to_server): Check for
- the disable_extensions param.
-
- * providers/pop3/camel-pop3-provider.c: Define a checkbox to
- disable all POP3 extension support.
-
-2003-06-11 Jeffrey Stedfast <fejj@ximian.com>
-
- Partial fix for bug #44457.
-
- * camel-mime-part-utils.c
- (simple_data_wrapper_construct_from_parser): Make sure to set
- rawtext to FALSE if we successfully convert the text to UTF-8.
-
- * camel-data-wrapper.c (camel_data_wrapper_init): Default the
- value of rawtext to TRUE instead of FALSE. This way if the mailer
- decides to try displaying a non-textual part as text, it knows
- that it needs to convert the content to UTF-8.
-
-2003-06-04 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-uid-cache.c (camel_uid_cache_new): Create the directory
- with mode 0777 and the cache file itself with mode 0666. Let the
- user's umask filter the permissions. Instead of saving the fd on
- the Cache object, instead save the filename. Use camel_read()
- instead of expecting read() to just always work without getting an
- EINTR/etc.
- (maybe_write_uid): Don't do anything if cache->fd == -1, this
- means an error has occured in a previous callback. Replace the 2
- calls to write() with camel_write() and check their return
- values. If either of them fails, set cache->fd to -1 (GHashTable
- doesn't give us a way to abort foreach'ing thru the table).
- (camel_uid_cache_save): Save to a temp file instead of overwriting
- the original. Do proper error checking, etc. Also added some
- smarts about whether to try and overwrite the old cache even if we
- haven't successfully saved all the uids in the cache.
- (camel_uid_cache_destroy): Free the cache->filename, no longer
- need to close (cache->fd).
-
-2003-06-11 Larry Ewing <lewing@ximian.com>
-
- * camel-text-index.c (text_index_normalise): use g_utf8_strdown
- properly.
-
-2003-06-09 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-message.c (find_best_encoding): Add the
- CAMEL_BESTENC_TEXT bit to enctype if the part is a text part.
-
- * camel-mime-filter-bestenc.c
- (camel_mime_filter_bestenc_get_best_encoding): If we have any
- nul-bytes or if the content is non-text and contains any 8bit
- octets, we need to use base64. Fixes bug #44344.
diff --git a/camel/ChangeLog.pre-1-4 b/camel/ChangeLog.pre-1-4
deleted file mode 100644
index 7ea58c89d4..0000000000
--- a/camel/ChangeLog.pre-1-4
+++ /dev/null
@@ -1,22083 +0,0 @@
-2003-06-01 Jeffrey Stedfast <fejj@ximian.com>
-
- * broken-date-parser.c (d): Turn off debugging.
-
- * providers/pop3/camel-pop3-engine.c (get_capabilities): Move the
- code that prepends the 'password' authtype to the auth list so
- that we don't add it again when regetting the capabilities.
-
-2003-05-30 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-filter-driver.c (run_only_once): Turned off a debugging
- printf.
-
-2003-05-27 Jeffrey Stedfast <fejj@ximian.com>
-
- This should finish fixing all variations of bug #42854, which,
- funnily enough specified "copying" as the scenario for reproducing
- this bug, but somehow I found/fixed it only for expunging for some
- reason? I can't even guess as to how this happened. Oh well,
- expunging needed fixing either way.
-
- * providers/imap/camel-imap-folder.c (imap_transfer_online): Sort
- the uids here too (just like I had fixed for expunge a week or so
- ago).
- (imap_transfer_resyncing): Sort them here too.
- (imap_search_by_uids): Sort here too, even though I don't think it
- is necessary. Can't hurt.
- (imap_expunge_uids_offline): Might as well sort here too.
-
-2003-05-22 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-object.c (camel_object_bag_destroy): Lets try this
- again. We don't actually want to free the key here, because
- camel_object_bag_remove() does that for us. This should fix bug
- #43406 properly.
-
-2003-05-20 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-object.c (camel_object_bag_destroy): Create a second
- GPtrArray for the keys. We don't want to use bag->free_key() on
- the object. Fixes bug #43406.
-
-2003-05-19 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-folder-summary.c (camel_folder_summary_load): Only display
- a warning if errno != EINVAL (EINVAL means there was a version
- mismatch, so we don't really need to warn here since we are
- supposed to be able to handle this situation).
- (perform_content_info_load): Turn off debugging message.
- (summary_assign_uid): Turn off uid-clash warning.
- (camel_folder_summary_decode_token): Turn off debug messages.
- (summary_header_load): Turn off version-mismatch warning.
-
-2003-05-16 Jeremy Katz <katzj@redhat.com>
-
- * providers/smtp/camel-smtp-transport.c (smtp_helo): Ensure cmdbuf
- is initialized to avoid compiler warning.
-
- * providers/local/camel-mbox-summary.c (summary_header_load): Cast
- folder_size to uint32 to fix warning.
- (camel_mbox_summary_sync_mbox): Update for new API.
-
- * providers/imap/camel-imap-utils.c (parse_params):
- imap_parse_nstring expects size_t, not int
- (imap_body_decode): Likewise.
-
- * camel-stream-filter.c (do_read): presize needs to be size_t
- instead of int.
- (do_write): Likewise.
-
- * camel-seekable-substream.c (stream_read): Return ssize_t instead
- of int to match prototypes.
- (stream_write): Likewise.
-
- * camel-mime-part.c (construct_from_parser): len needs to be
- size_t instead of int.
-
- * camel-mime-parser.c (folder_scan_step): datalength needs to be a
- size_t* instead of an int* to make dependent APIs safe.
- (camel_mime_parser_step): Likewise.
- (folder_scan_content): Likewise.
- * camel-mime-parser.h: Likewise.
-
- * camel-mime-message.c (camel_mime_message_class_init): Use glib
- macro for pointer/int conversions.
- (construct_from_parser): Update for new API.
-
- * camel-folder-summary.c
- (camel_folder_summary_info_new_from_parser): Update len to be
- size_t for new API.
- (summary_build_content_info): Likewise.
- * camel-http-stream.c (http_get_headers): Likewise.
- * camel-mime-part-utils.c
- (simple_data_wrapper_construct_from_parser): Likewise.
- * camel-multipart-signed.c (signed_construct_from_parser): Likewise.
- * camel-multipart.c (construct_from_parser): Likewise.
-
- * camel-folder-search.c (match_words_index): Use glib macros for
- pointer/int conversions.
- * camel-html-parser.c (tokenise_setup): Likewise.
- (convert_entity): Likewise.
- * camel-block-file.c (block_hash_func): Likewise.
- (camel_block_file_get_block): Likewise.
- (camel_block_file_get_block): Likewise.
- (camel_block_file_detach_block): Likewise.
- * camel-session.c (session_thread_msg_new): Likewise.
- (session_thread_msg_free): Likewise.
- (session_thread_wait): Likewise.
- * camel-text-index.c (text_index_compress_nosync): Likewise.
- (text_index_compress_nosync): Likewise.
- (camel_text_index_validate): Likewise.
- * camel-vee-folder.c (vee_folder_remove_folder): Likewise.
- (unmatched_check_uid): Likewise.
- (folder_added_uid): Likewise.
- (vee_folder_build_folder): Likewise.
- (folder_changed_add_uid): Likewise.
- (folder_changed_remove_uid): Likewise.
- * providers/imap/camel-imap-search.c (imap_body_contains): Likewise.
- * providers/pop3/camel-pop3-folder.c (cmd_list): Likewise.
- (cmd_uidl): Likewise.
-
- * camel-data-cache.c (data_cache_init): Cast to CamelCopyFunc.
- Fixes a warning.
-
-2003-05-15 Not Zed <NotZed@Ximian.com>
-
- * camel-mime-utils.c (header_decode_word): Simplistic quick-fix
- for #42710. Add a charset argument. If the data is 8 bit, try to
- decode into the passed in charset (i.e. the message header?), at
- worst, fall back to latin1, similarly to header_decode_text.
- Fixed all callers to pass in a charset if available, or NULL.
-
-2003-05-14 Not Zed <NotZed@Ximian.com>
-
- ** See bug #42540
-
- * camel-service.c (camel_gethostbyname): pre-initialise the error
- return to invalid, so if we cancel, we definetly get a bad result.
- Also, for a valid return against result, not herr.
- (camel_gethostbyaddr): Likewise.
-
-2003-05-13 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/local/camel-local-folder.c (local_delete): Only delete
- the index if it is non-NULL. Fixes bug #42763.
-
-2003-05-13 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-utils.c (imap_uid_array_to_set): Added
- a note to the comment block for this function noting that uids
- MUST be in sorted order.
-
- * providers/imap/camel-imap-folder.c (imap_expunge_uids_online):
- Sort the uids before splitting them into UID set chunks. The code
- that splits the uid array into sets expects the uids to be in
- sorted order. Fixes bug #42854.
-
- * providers/imap/camel-imap-command.c (imap_command_start):
- Re-enable camel_verbose_debug logging.
-
-2003-05-12 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/smtp/camel-smtp-transport.c (smtp_helo): If
- host->h_name is NULL or an empty string, default back to using the
- IP address rather than the hostname in the EHLO command.
-
-2003-05-13 Ettore Perazzoli <ettore@ximian.com>
-
- * providers/imap/camel-imap-folder.c (d): Disable debugging.
-
- * providers/imap/camel-imap-command.c (d): Disable debugging.
-
- * providers/imap/camel-imap-search.c (d): Disable debugging.
-
-2003-05-02 Dan Winship <danw@ximian.com>
-
- * camel-mime-part-utils.c
- (simple_data_wrapper_construct_from_parser): Don't call
- g_utf8_validate on an empty message. Fixes a warning.
-
-2003-05-01 Jeffrey Stedfast <fejj@ximian.com>
-
- Workaround for POS mailers like the one in bug #42045.
-
- * camel-mime-utils.c (header_decode_date): Make sure the numeric
- timezone is between -1200 and 1200, otherwise it is invalid.
-
- * broken-date-parser.c (get_tzone): Make sure the numeric timezone
- is between -1200 and 1200, otherwise it is invalid.
-
-2003-04-29 Dan Winship <danw@ximian.com>
-
- * Makefile.am (camel_lock_helper_SOURCES): Remove camel-lock.c
- from here because it upsets automake 1.6 for some reason
- (camel_lock_helper_LDADD): Add camel-lock.o here
-
-2003-04-29 Jeremy Katz <katzj@redhat.com>
-
- * providers/imap/camel-imap-folder.c (parse_fetch_response):
- body_len needs to be a size_t instead of int
-
-2003-04-22 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-utils.c: Disable debugging printfs.
-
- * providers/imap/camel-imap-store.c (imap_connect_online): #if 0
- out some code that parsed the namespaces since the results aren't
- used and they generate debugging output.
-
-2003-04-23 Not Zed <NotZed@Ximian.com>
-
- * providers/smtp/camel-smtp-transport.c (smtp_helo): only free the
- host if it was set. removes a run-time warning.
-
- * camel-session.c (get_service): oops, the service owns the url
- after we construct it.
-
-2003-04-22 Not Zed <NotZed@Ximian.com>
-
- ** Should fix #41629, #41448, et al.
-
- * tests/folder/test10.c: a new torture test for object bag
- creation/unreffing.
-
- * camel-url.c (camel_url_copy): new function to copy a url.
-
- * camel-object.c (camel_object_bag_new): add arguments for key
- copy and key free functions. Fixed all callers.
- (camel_object_bag_destroy): fix a memleak, free the bag key.
- (camel_object_bag_get, camel_object_bag_reserve)
- (camel_object_bag_abort, save_bag, save_object): Make the key a
- void type, rather than char *.
- (camel_object_bag_add): As above, and also copy the key.
- (camel_object_bag_remove_unlocked): free the key using
- bag->free_key.
-
- * camel-session.c (register_provider)
- (camel_session_destroy_provider, get_service): Changed to use an
- object bag instead of a hash table for the service 'cache'.
- (service_cache_remove): Removed, no longer required.
-
-2003-04-21 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-gpg-context.c (gpg_ctx_parse_status): Don't set seen_eof1
- here anymore once we get a trust metric.
- (gpg_ctx_new): Init seen_eof1 to TRUE here.
- (gpg_ctx_set_ostream): Change seen_eof1 to FALSE here this way we
- only ever have to set this if we are expecting output.
- (gpg_ctx_parse_status): Don't set seen_eof1 for importing either.
- (gpg_ctx_op_step): Only FD_SET() those fd's that we have not yet
- finished reading.
-
-2003-04-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-url-scanner.c (camel_url_web_end): Urls are unlikely to
- end with punctuation or closing braces, so strip any of those off
- the end of the url. Fixes bug #41461.
-
- * tests/mime-filter/data/html.1.out: Removed a trailing \n at the
- end of the file, this is incorrect (since out input file does not
- contain one).
-
- * camel-mime-filter-tohtml.c (html_convert): Only output a <br> if
- we found an eoln in the input. Along the same lines, don't write a
- '\n' to the output buffer unless we've encountered that eoln in
- the input. Fixes bug #41407.
-
-2003-04-17 Not Zed <NotZed@Ximian.com>
-
- ** for #40989
-
- * camel-text-index.c (text_index_delete): delete the block
- file/key file directly, not just its files.
-
- * providers/local/camel-local-folder.c (local_delete): implement,
- just delete the index file if it exists.
- camel-store-delete-folder will delete other data (maybe it all
- should be done here).
-
- * camel-block-file.c (camel_key_file_finalise): keep lock around
- decrementing key file use count.
- (camel_key_file_delete): new function to delete the key file (&
- close it off).
- (key_file_use): if we've been deleted, always fail.
- (camel_block_file_finalise): only close the file if its a valid
- fd.
- (block_file_use): if we've been deleted, always fail.
- (camel_block_file_delete): delete the block file & close.
- (struct _CamelBlockFilePrivate): fix the !ENABLE_THREADS case to
- still compile this.
-
- ** for #41163
-
- * camel-multipart-signed.c (parse_content): Dont assume adding 1
- to line length will go to the next line. e.g. for dos lines that
- end in \r\n. Fix for #41163.
- (parse_boundary): util function to help above.
-
-2003-04-15 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-gpg-context.c (gpg_verify): The gpg child process exiting
- does not necessarily mean that we've ready everything that we can
- from its pipes, so don't use gpg_ctx_op_exited() as a loop-exit
- condition. If for some reason the gpg child process does exit (due
- to an error), gpg_ctx_op_step() will eventually fail (as soon as
- it has finished reading any data in the pipes) and cause the loop
- to be terminated anyway. This fixes truncation of the gpg --verify
- stderr output that Evolution displays as the "validity report"
- (for lack of a better description).
- (gpg_ctx_op_step): Removed some debugging printf's
- (gpg_ctx_get_diagnostics): Use a bitfield to decide if we've
- already flushed the diagnostics stream, much simpler (plus we have
- plenty of bits to spare so might as well use them).
- (gpg_ctx_new): Fixed another logic bug which determined whether or
- not we should convert the gpg output from the locale charset into
- UTF-8.
-
-2003-04-10 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/smtp/camel-smtp-transport.c: Turn off debugging if
- CAMEL_VERBOSE_DEBUG isn't set.
-
-2003-04-10 Not Zed <NotZed@Ximian.com>
-
- * tests/mime-filter/data: filter data test cases.
-
- * tests/mime-filter/test-tohtml.c: New test for html filter.
-
- ** See bug #40969
-
- * camel-mime-filter-tohtml.c (html_convert): Change the logic
- slightly, scan a whole line within the main loop.
-
-2003-04-09 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-gpg-context.c (gpg_ctx_get_utf8_diagnostics): Removed. I
- just realised that we ALWAYS want to get gpg's stderr in UTF-8, so
- the better solution (plus less code duplication) is to just have
- the diagnostics buffer be a CamelStreamMem with a charset filter.
- (gpg_ctx_new): Setup a filter stream to convert our gpg stderr
- diagnostics into UTF-8 if needed.
- (gpg_ctx_free): Unref the diagnostcis stream.
- (gpg_ctx_parse_status): Flush the diagnostics stream if we are
- going to use the data in an exception.
- (gpg_ctx_op_step): Use camel_stream_write() to append to the
- diagnostics stream rather than appending the buffer to a
- GByteArray like we used to do.
- (gpg_ctx_op_step): Flush the diagnostics stream here too.
- (gpg_verify): Use a const char *diagnostics string here, forcing a
- slight rearrangement of calls - use the const char *dignostics
- before we gpg_ctx_free, otherwise we'll be passing free'd memory
- off to the cipher_validity.
- (gpg_ctx_get_diagnostics): Do the work here to flush the
- diagnostics stream and nul-terminate the buffer. Also return const
- now, instead of strdupping. No need for that.
- (gpg_ctx_parse_status): Convert the user hint to UTF-8.
-
-2003-04-09 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-gpg-context.c (gpg_ctx_get_utf8_diagnostics): Changed my
- mind a bit on how I wanted this to work. Instead of aborting on an
- illegal sequence, do like we do with camel-mime-filter-charset and
- just skip over invalid sequences. Also, in the noop failure case,
- close the iconv_t so we don't leak it.
-
-2003-04-09 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-utils.c (imap_body_decode): Save the
- content size in a temp variable until after we've successfully
- parsed all of the body_type_1part expr. Also fixed a type-o in the
- body_type_mpart case that caused the parser to fail.
- (imap_parse_body): On failure to parse the body, as we iterate
- through the child nodes, set their children/parent/next nodes to
- NULL so that content_info_free() won't double-free any of the
- other nodes we have already free'd (or are about to free).
-
- * camel-gpg-context.c (gpg_ctx_get_utf8_diagnostics): New function
- to get the UTF-8 version of the diagnostics (if the locale isn't
- already UTF-8 safe).
- (gpg_verify): Use the utf-8 diagnostics here. Also fixed a memleak
- in the exception case.
-
- * camel-mime-filter-charset.c
- (camel_mime_filter_charset_new_convert): NULL-protect the to/from
- charsets in the g_warning call.
-
-2003-04-08 Jeffrey Stedfast <fejj@ximian.com>
-
- Fixes for bug #40778. Probably others as well.
-
- * providers/imap/camel-imap-utils.c (parse_params): Return 0 on
- success, or -1 on fail. The other small utility functions should
- probably do the same, but I was too lazy to fix them. Setting
- inptr to NULL is just lame.
- (imap_body_decode): New function to correctly parse a BODY
- response.
- (imap_parse_body): Rewritten to use the above function.
-
-2003-04-08 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/smtp/camel-smtp-transport.c (smtp_helo): Make sure
- host->h_name is not an empty string too? Apparently for one user
- his resolved hostname is "". Go figure. Probably a broken system,
- but easy enough to work around.
-
- * providers/pop3/camel-pop3-store.c (pop3_try_authenticate): If
- store->engine->line is NULL, use _("Unknown error") as the error
- string instead.
-
-2003-04-08 Not Zed <NotZed@Ximian.com>
-
- * camel-folder-summary.c (camel_folder_summary_load): use
- g_strerror, and use errno directly rather than ferrno().
- (summary_header_load): set errno when we get a version mismatch.
-
-2003-04-07 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-gpg-context.c: Disable debug printf's
-
-2003-03-28 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-sasl-gssapi.c (gssapi_challenge): If we are using the
- heimdal krb5 implementation, don't free outbuf ever. Seems to
- segfault if we do.
-
-2003-03-31 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-filter-enriched.c (enriched_to_html): Use strncasecmp
- for matching the nofill and /nofill tags. Also fixed to handle
- enriched tags that require <param> tags.
-
-2003-03-28 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-spool-store.c (get_folder): remove unused
- var.
-
- * providers/imap/camel-imap-utils.c (imap_parse_list_response):
- moved an unused var to the #if 0'd out block.
-
- * providers/imap/camel-imap-store.c
- (parse_list_response_as_folder_info): remove unused vars.
-
- * camel-index-control.c (main): deifne camel_init() before using
- it.
-
- * camel-vee-store.c (vee_get_folder): removed unused var.
-
- * camel-stream-mem.c (stream_write): warning -> fixme.
-
- * camel-stream-filter.c (_CamelStreamFilterPrivate): Add a ; to
- the end of the struct definition.
-
- * camel-store.c (camel_store_delete_folder): remove unused var.
- (camel_store_rename_folder): "
- (camel_store_unsubscribe_folder): "
-
- * camel-mime-part.c (write_to_stream): Changed warning into a
- TODO.
- (construct_from_parser): removed warning, the code was fixed.
-
- * camel-mime-message.c (construct_from_parser): Remove the
- warning, the code was fixed.
-
- * camel-mime-filter-enriched.c (camel_mime_filter_enriched_new):
- Remove unused var.
-
- * camel-medium.c (camel_medium_get_header): Removed warning, and
- changed docs to reflect it.
-
- * camel-gpg-context.c (gpg_ctx_parse_status): handle MODE_EXPORT
- as a noop (warning).
-
- * camel-folder.c (get_message_user_tag): changed a warning into a
- fixme (its not that important).
- (camel_folder_get_message_user_tag): "
-
- * camel-data-cache.c (data_cache_finalise): removed unused vars.
- (data_cache_expire): "
-
-2003-03-27 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-sasl-gssapi.c (gssapi_challenge): Get rid of debug
- printf's that are no longer needed. In the case of errors, don't
- release the outbuf gss_buffer_t since it shouldn't be set. Also
- g_free (str) when we are done with it.
-
- * camel-mime-utils.c (header_encode_phrase_merge_words): When we
- remove a node from the list, make sure to g_list_free_1().
- (header_encode_phrase_merge_words): Don't use
- CAMEL_FOLD_PREENCODED as the upper-bound for merged-word length if
- the merged-word will not be an rfc2047 encoded word. Instead, use
- CAMEL_FOLD_SIZE-8 (which is the value we use in other places for
- determining upper-bound lengths). Solves bug #38659.
-
-2003-03-27 Dan Winship <danw@ximian.com>
-
- * camel-url.c (append_url_encoded): Like camel_url_encode, but
- works directly on an existing GString.
- (camel_url_to_string, output_param): Use it.
- (camel_url_encode): Likewise. Remove "escape_unsafe" arg since the
- "unsafe" chars are the ones that should *always* be escaped, and
- the places we were passing FALSE were wrong.
- (camel_url_decode): replace with a new version
-
- * camel-file-utils.c (camel_file_util_safe_filename): Remove extra
- arg to camel_url_encode.
-
- * tests/misc/url.c (main): Add tests of basic URL parsing and
- unparsing
-
-2003-03-28 Not Zed <NotZed@Ximian.com>
-
- *
- camel-mime-part-utils.c (simple_data_wrapper_construct_from_parser):
- Do a more thorough check for html marked as text/plain. Check
- that the text starts with <html or <!doctype. More complete fix
- for #16817.
-
-2003-03-26 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-sasl-gssapi.c (camel_sasl_gssapi_finalize): Pass in the
- addresses of the second args to the delete/release functions.
-
-2003-03-27 Not Zed <NotZed@Ximian.com>
-
- * camel-object.c (camel_object_bag_list): Ignore whether or not
- the bag is currently reserved. We'll miss the new potential
- object, but only 1. Should address #40103.
-
-2003-03-25 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-service.c (camel_gethostbyaddr): Don't use setv when we
- don't need the stdarg interface.
- (camel_gethostbyname): Same.
-
-2003-03-24 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-folder-search.c (search_user_tag): This expression can
- never return an array. We must always return a string value.
-
-2003-03-24 Timo Sirainen <tss@iki.fi>
-
- * camel-imap-command.c (imap_read_untagged) Integer overflow fix.
- If server sent a huge literal length, only a few bytes of memory
- was allocated to it, but server could write as much data there as
- it wanted.
-
-2003-03-21 Jeffrey Stedfast <fejj@ximian.com>
-
- Camel part of the fix for Lewing's bug #39204. Second half of the
- patch should also fix it so that text/plain parts that are
- detected as being text/html are rendered as html (not that I agree
- with this mind you, but corporate customers want this "feature").
-
- * camel-mime-part-utils.c
- (simple_data_wrapper_construct_from_parser): If the part is
- text/html and doesn't have a charset and we are able to find a
- charset in the meta tags of the html content, set the charset
- param on the content-type.
- (camel_mime_part_construct_content_from_parser): After setting the
- content object on the mime part, re-set the content-type of the
- content object back to the one from the parser (as it may contain
- changes from the original - see changes made to the ct in
- simple_data_wrapper_construct_from_parser for details).
-
-2003-03-21 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-tcp-stream-ssl.c (camel_certdb_nss_cert_get): continue
- reading the cert file until we've read it all or get a non-EINTR
- errno.
-
-2003-03-21 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-sasl-gssapi.c: #include <com_err.h> instead of
- #include <et/com_err.h>
-
-2003-03-20 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-sasl.c: Plug in GSSAPI support.
-
- * camel-sasl-gssapi.[c,h]: Various fixes to make it compile (fixed
- type-o's mostly).
-
-2003-03-20 Dan Winship <danw@ximian.com>
-
- Handle raw 8-bit From data "correctly". (The same way we handle
- raw 8-bit Subject data.)
-
- * camel-mime-utils.c (header_decode_mailbox): Take a charset arg
- and pass it to header_decode_string.
- (header_decode_address): Take a charset arg and pass it to
- header_decode_mailbox.
- (header_mailbox_decode): Likewise.
- (header_address_decode): Take a charset arg and pass it to
- header_decode_address.
-
- * camel-folder-summary.c (summary_format_address): Take a charset
- arg and pass to header_address_decode.
- (message_info_new, camel_message_info_new_from_header): Pass
- charset to summary_format_address
-
- * camel-internet-address.c (internet_decode): Update for
- header_address_decode change. (Unfortunately we don't have a
- charset to pass here.)
-
- * camel-mime-message.c (camel_mime_message_build_mbox_from): Move
- this here from camel-mbox-summary since the same functionality is
- needed by evolution-mail too (and update for header_address_decode
- change)
-
- * providers/local/camel-mbox-summary.c
- (camel_mbox_summary_build_from): Moved to CamelMimeMessage
-
-2003-03-17 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-part.c (process_header): Removed unused variable left
- over from my previous fix.
-
- * providers/smtp/camel-smtp-transport.c (smtp_send_to): Don't pass
- 'has_8bit_parts' to smtp_data() anymore.
- (smtp_data): No longer takes 'has_8bit_parts' argument. Ignore
- whether or not the message has 8bit parts when deciding what the
- required encoding type we need to enforce. Fixes bug #39744.
-
-2003-03-13 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-part.c (process_header): Use
- header_contentid_decode() as this new function should be safer
- than the hack that we had before.
-
- * camel-mime-utils.c (header_contentid_decode): New function to
- try and parse a content-id string in such a way as to work around
- some of the known bugs in other MIME implementations. Try to be as
- "safe" as we can - ie. don't allow for more than 1 @ (since the
- mailer uses "@@@%d" as a fake content-id value for parts without
- content-ids) and don't allow for invalid content-type chars.
-
-2003-03-13 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-folder.c (get_uids): Don't add bogus uids to the uid
- array. Might fix bug #38868 (it's the only way I can figure that
- camel_folder_get_message_info() could possibly return NULL for the
- Outbox folder).
-
-2003-03-12 Not Zed <NotZed@Ximian.com>
-
- * camel-object.c (remove_bag): removed, it was double-freeing the
- key.
- (save_object): Just save the object in an array.
- (camel_object_bag_destroy): first save the object bag's objects in
- a list, then remove them one at a time from the bag since we can't
- remove hash table entries while we're in a foreach (PITA glib
- shit). For #39486.
- (camel_object_bag_*): killed some warnings.
-
-2003-03-09 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-url-scanner.c (camel_url_addrspec_end): Doh! If inptr ==
- pos + 1, then return FALSE (before it was checking for inptr ==
- pos, but it will never be pos).
-
-2003-03-07 Not Zed <NotZed@Ximian.com>
-
- * camel-vee-folder.c (vee_search_by_expression): handle a null
- return from search_by_expression, for bug #33786.
-
-2003-03-06 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-utils.c (imap_next_word):
- s/g_strncasecmp/strncasecmp/g
-
- * camel-iconv.c: Updated to be an exact copy of e-iconv (except
- names changed). We don't use this yet, but we may in the future.
-
- * camel-url.c (camel_url_new_with_base): Here too.
-
- * camel-sasl-kerberos4.c (krb4_challenge): Use camel_strdown()
- here instead of g_strdown() since the latter has been deprecated.
-
- * providers/imap/camel-imap-utils.c (imap_parse_body): Use
- camel_strdown() since g_ascii_strdown() does not do what we
- thought.
-
- * providers/imap/camel-imap-store.c:
- s/strstrcase/camel_strstrcase/g
-
- * providers/imap/camel-imap-folder.c (do_append):
- s/strstrcase/camel_strstrcase/
- (handle_copyuid): Same.
-
- * string-utils.c (camel_strdown): New function because the
- g_ascii_strdown interface sucks.
- (camel_strstrcase): Renamed from strstrcase.
-
-2003-03-06 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-text-index.c (camel_utf8_next): Same as below.
-
- * camel-search-private.c (camel_utf8_getc): Updated since not all
- platforms/compiles support __inline__.
-
-2003-03-06 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-part.c (camel_mime_part_get_encoding): Get rid of the
- const return - it mismatches the prototype and we don't need it
- anyway. Fixes bug #39173.
-
-2003-03-06 Jeffrey Stedfast <fejj@ximian.com>
-
- Fixes for bug #39170
-
- * camel-store-summary.c (camel_store_info_set_string): Remove
- return keyword.
-
- * camel-session.c (camel_session_thread_msg_free): Remove return
- keyword.
- (camel_session_thread_wait): Same.
-
- * camel-index.c (camel_index_cursor_reset): Remove return keyword.
-
-2003-03-06 Jeffrey Stedfast <fejj@ximian.com>
-
- Fixes for bug #39168
-
- * providers/local/camel-spool-summary.c: Get rid of the empty
- private struct.
-
- * providers/local/camel-mbox-summary.c: Get rid of the empty
- private struct.
-
- * camel-vee-store.c: Get rid of the empty private struct.
-
- * camel-mime-filter-from.c: Get rid of the empty private struct.
-
-2003-03-05 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/sendmail/camel-sendmail-transport.c
- (sendmail_send_to): Add a CRLF filter to the output stream to
- convert any CRLF sequences into plain old line-feeds to work
- around a bug in some local transport programs.
-
-2003-03-04 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-object.h: s/class/klass in one place so that the header is
- c++-safe.
-
-2003-03-03 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-tcp-stream-openssl.c (camel_tcp_stream_ssl_new): Updated
- to use the new API from a fe commits ago for the NSS stream. This
- is just to make it compile, but does not update the behaviour to
- act like the NSS stream. Note that people shouldn't be using
- OpenSSL anyway.
- (camel_tcp_stream_ssl_new_raw): Same.
-
- * camel-process.[c,h]: New source file containing convenience
- functions for process creation/termination mainly for use with
- Pipe filters but should be usable for anything we want.
-
- * camel-io.[c,h]: New source files implementing read/write system
- calls with proper error checking and cancellation
- (ie. StreamFs::read/write and CamelTcpStreamRaw::read/write). No
- sense duplicating the same code over and over. Now I can use this
- same code easily in other i/o code (such as Pipe filters and gpg
- code?).
-
-2003-03-03 Not Zed <NotZed@Ximian.com>
-
- * camel-store.c (camel_store_unsubscribe_folder): Do similar
- folder != NULL checking as for delete_folder before passing a NULL
- to object_bag_remove.
-
-2003-02-28 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-http-stream.c (http_connect): Here too.
-
- * providers/smtp/camel-smtp-transport.c (connect_to_server): Same
- as IMAP and POP.
-
- * providers/imap/camel-imap-store.c (connect_to_server): Same as
- the POP3 code.
-
- * providers/pop3/camel-pop3-store.c (connect_to_server): Pass in
- appropriate flags for camel_tcp_stream_ssl_new*() functions.
-
- * camel-tcp-stream-ssl.c (enable_ssl): Not all ssl/tls streams
- will want to allow each of SSLv2, SSLv3 and TLSv1 so use flags to
- decide which to enable/disable.
- (camel_tcp_stream_ssl_new): Now takes a flags argument to mask out
- which SSL/TLS versions the stream should be compatable with.
- (camel_tcp_stream_ssl_new_raw): Same.
-
-2003-02-27 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-stream-filter.c: Add a 'flushed' state variable to the
- private struct.
- (do_read): Set p->flushed to TRUE after we call
- camel_mime_filter_complete() on all the filters.
- (do_reset): Set p->flushed to FALSE.
- (do_eos): Make sure the filters have been flushed before returning
- that the stream is at EOS.
-
- * camel-mime-filter-canon.c (complete): Don't add a eol -
- otherwise we will fail to verify some mutt signatures that do not
- have a blank line before the boundary line (and note that the last
- \n before the boundary really belongs to the boundary anyway) so
- #if 0 this code out for now.
-
-2003-02-27 Not Zed <NotZed@Ximian.com>
-
- * camel-multipart-signed.c: Undo jeff's changes.
-
- * providers/local/camel-spool-store.c (scan_dir): Fix a paste-o in
- the object_bag_get key.
-
-2003-02-26 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-multipart-signed.c: Updated to use g_alloca instead of
- alloca so that we can skip all the #ifdef checks and skip checking
- for alloca in configure.in and all that foo.
-
- * camel-store.c (camel_store_delete_folder): Make sure the folder
- is non-NULL before trying to remove it from the store's
- object-bag.
-
-2003-02-25 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-part-utils.c
- (simple_data_wrapper_construct_from_parser): canonicalise the
- charset name (if it is an iso charset) so that our strncasecmp to
- see if it is an iso-8859-# charset will be guarenteed to work on
- all systems.
- (canon_charset_name): New function to return the canonical iso
- charset name.
- (simple_data_wrapper_construct_from_parser): If the charset is
- NULL *or* the charset == "us-ascii" then check that it is 7bit
- clean to decide if it is rawtext (we did not check the case where
- charset was "us-ascii" before).
-
-2003-02-25 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-message.c: Same as the ones below.
-
- * camel-mime-part.c: Reverted back to pre-camel-iconv
-
- * camel-filter-search.c: Same as below.
-
- * camel-folder-summary.c: Reverted back to pre-camel-iconv
-
- * camel.c (camel_init): Reverted to pre-camel-iconv
-
- * camel-charset-map.c (camel_charset_locale_name): Removed (part
- of the revert).
- (camel_charset_canonical_name): Same.
-
- * camel-mime-filter-charset.c: Revert back to using e_iconv from GAL.
-
- * camel-mime-part-utils.c: Revert back to using e_iconv from GAL.
-
- * camel-mime-utils.c: Revert back to using e_iconv from GAL.
-
- * camel-sasl-digest-md5.c: Revert back to using e-iconv from GAL.
-
-2003-02-24 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-charset-map.c (camel_charset_canonical_name): g_alloca
- (strlen (charset) + 1) so we don't overflow the buffer.
-
- * providers/pop3/camel-pop3-stream.c (stream_write): Don't write
- the passwd, fixes "bug" #38601.
-
- * camel-iconv.c: Make bucket->refcount 31 bits and bucket->used 1
- bit instead of having each use their own 32bit int.
- (iconv_cache_bucket_expire): Use g_iconv_close() here, missed this
- before.
- (camel_iconv): Might as well call g_iconv here even though it just
- calls iconv directly.
-
-2003-02-21 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-iconv.c (camel_iconv_charset_name): New function...back
- from the depths of hell from whence it came originally. Turns out
- that g_iconv_open() is lame and can't handle all the stuff we used
- to handle in e_iconv_charset_name().
- (camel_iconv_open): Use camel_iconv_charset_name() on the to/from
- charsets rather than camel_charset_canonical_name(). Now maybe
- g_iconv_open will work for charsets such as "ks_c_5601-1987".
-
- * providers/pop3/camel-pop3-store.c (pop3_connect): Reget the
- capabilities after a successful authentication.
-
- * providers/pop3/camel-pop3-engine.c (get_capabilities): If we are
- in the TRANSACTION state and CAPA did not list UIDL as a supported
- command, try checking for it the hard way.
-
-2003-02-23 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/smtp/camel-smtp-transport.c (smtp_data): Do it the
- same way we just made the sendmail code do it.
-
- * providers/sendmail/camel-sendmail-transport.c
- (sendmail_send_to): My last change but in a better way.
-
-2003-02-22 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/smtp/camel-smtp-transport.c (smtp_data): Remove all
- Bcc headers before sending to the smtp server.
-
- * providers/sendmail/camel-sendmail-transport.c
- (sendmail_send_to): Remove all Bcc headers before sending to
- sendmail.
-
-2003-02-20 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel.c (camel_init): Call camel_iconv_init().
- (camel_shutdown): Call camel_iconv_shutdown().
-
- * camel-sasl-digest-md5.c (digest_response): Updated to use
- camel-iconv and the new camel-charset-map functions.
-
- * camel-mime-utils.c: Updated to use camel-iconv and the new
- camel-charset-map functions.
-
- * camel-mime-part-utils.c (check_html_charset): Use
- camel_charset_canonical_name() instead of e_iconv_charset_name()
- which is longer available.
- (convert_buffer): Use camel-iconv.
- (simple_data_wrapper_construct_from_parser): Since
- camel_charset_iso_to_windows() returns the charset in it's
- canonical format, no need to re-canonicalise it.
-
- * camel-mime-part.c (process_header): Use
- camel_charset_canonical_name() instead of e_iconv_charset_name()
- which is longer available.
-
- * camel-mime-message.c (process_header): Use
- camel_charset_canonical_name() instead of e_iconv_charset_name()
- which is longer available.
-
- * camel-mime-filter-charset.c: Use camel-iconv.
-
- * camel-folder-summary.c (message_info_new): Use
- camel_charset_canonical_name() instead of e_iconv_charset_name()
- which is longer available.
- (content_info_new): Use camel_charset_locale_name().
- (camel_message_info_new_from_header): Same as message_info_new().
-
- * camel-search-private.c: Use g_alloca() instead of alloca().
-
- * camel-filter-search.c (check_header): Use
- camel_charset_canonical_name() instead of e_iconv_charset_name()
- which is longer available.
-
- * camel-charset-map.c (camel_charset_locale_name): New function,
- replaces e_iconv_locale_charset().
- (camel_charset_canonical_name): New function, similar to
- e_iconv_charset_name() but instead of returning the iconv-friendly
- name, it returns the canonical name. (g_iconv will do the
- iconv-friendly name conversions for us).
-
-2003-02-20 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-filter-search.c (run_command): Redirect program's stdout
- and stderr to /dev/null
-
- * camel-filter-driver.c (pipe_to_system): Redirect the program's
- stderr to /dev/null
- (pipe_to_system): Write the pipe to a mem stream and use the mem
- stream in the parser. Also, when setting an exception get the
- errno from the parser so we can give more info about the error to
- the user.
-
-2003-02-19 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-tcp-stream-ssl.c (stream_connect): Fixed a type-o in the
- ENABLE_IPv6 ifdef section.
-
-2003-02-19 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-filter-driver.c (pipe_message): New filter action that
- pipes the message source to the user-program and reads back the
- modified message and replaces driver->priv->message with the new
- message object.
- (do_copy): Check p->modified to make sure the message hasn't been
- modified by the pipe-message action - if it has been modified,
- default to the slower camel_folder_append_message() way of
- copying.
- (do_move): Same.
- (pipe_to_system): Set p->modified to TRUE if the user-program gave
- us back a message stream and we were able to parse it.
- (camel_filter_driver_filter_message): If the message has been
- modified, always use camel_folder_append_message() when appending
- it to the default folder.
-
-2003-02-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-folder-search.c: Added a (get-size ) function to fix bug
- #38073.
- (search_get_size): Implemented.
-
-2003-02-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-url-scanner.c (url_scanner_table_init): Mark chars with
- the high-bit set as CTRL chars.
- (camel_url_web_end): If the char before the start of the url is an
- open-brace, watch out for the matching close-brace.
- (camel_url_file_end): Same.
-
-2003-02-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-smime-context.c (smime_get_password): Same as the gpg and
- pkcs7 contexts.
-
- * camel-sasl-popb4smtp.c (popb4smtp_challenge): Updated for
- camel_session_get_password().
-
- * camel-pkcs7-context.c (get_password): Same as the gpg code.
-
- * camel-gpg-context.c (gpg_ctx_parse_status): Updated for
- camel_session_get_password().
-
- * providers/smtp/camel-smtp-transport.c (smtp_connect): No need to
- set USER_CANCEL exception here as it is done by
- camel_session_get_password(). Also updated for the new
- get_password() API change.
-
- * providers/imap/camel-imap-store.c (imap_auth_loop): Updated for
- camel_session_get_password() changes. We don't need to play the
- "bad passwd" game here too, do we? Bah, probably should but I
- don't feel like it for now. Maybe when we rewrite the IMAP
- provider.
-
- * camel-session.c (camel_session_get_password): Now takes a
- 'reprompt' argument that will force user-input to be given even if
- we have the passwd cached.
-
- * providers/pop3/camel-pop3-store.c (pop3_connect): Instead of
- uncaching the passwd after we receive a -ERR from the POP server,
- set 'reprompt' to TRUE to force user-input for the next password
- prompt (ie, make sure the front-end knows not to just return the
- cached value). The front-end can then decide to fill-in the
- user-input field with the last passwd that the user supplied.
- (pop3_try_authenticate): Now takes a reprompt argument which we
- pass into camel_session_get_password().
-
-2003-02-05 Dan Winship <danw@ximian.com>
-
- * Makefile.am (libcamelincludedir): Define in terms of
- privincludedir.
- (camellibexecdir): Define in terms of privlibexecdir
- (libcamel_la_LDFLAGS): Remove -rpath. (automake will add that)
-
- * providers/imap/Makefile.am (libcamelimapincludedir): Define in
- terms of privincludedir.
- (INCLUDES): Remove -I$(includedir)
- * providers/local/Makefile.am: Likewise
- * providers/nntp/Makefile.am: Likewise
- * providers/pop3/Makefile.am: Likewise
- * providers/sendmail/Makefile.am: Likewise
- * providers/smtp/Makefile.am: Likewise
-
-2003-02-04 Not Zed <NotZed@Ximian.com>
-
- * camel-object.c (camel_object_bag_new): Init bag->owner to 0.
-
-2003-01-31 Not Zed <NotZed@Ximian.com>
-
- * camel-object.c (camel_object_bag_*): Changed to use a posix
- semaphore instead of a condition variable + flag to reserve the
- object bag because e_mutex_cond is broken.
-
-2003-02-04 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-utils.c (imap_parse_body): Use
- g_ascii_strdown() instead of g_strdown, since g_strdown is
- deprecated.
- (imap_parse_body): Same.
-
- * providers/imap/camel-imap-folder.c (decode_internaldate): Use
- strncasecmp() here too.
- (parse_fetch_response): And here.
- (camel_imap_folder_selected): Here too.
-
- * providers/imap/camel-imap-utils.c (imap_namespace_decode): Use
- strncasecmp() instead of g_strncasecmp() because the latter is
- deprecated.
-
- * providers/imap/camel-imap-store.c (imap_get_capability): Again here.
- (hash_folder_name): Here too.
- (compare_folder_name): And here.
- (get_folder_online): Again.
- (get_folder_offline): And again.
-
- * providers/imap/camel-imap-folder.c (camel_imap_folder_selected):
- Same as below again.
-
- * providers/imap/camel-imap-command.c (camel_imap_response_free):
- Same as below.
-
- * providers/smtp/camel-smtp-transport.c (smtp_data): Use
- strcasecmp() because g_strcasecmp() is deprecated.
-
- * camel-url.c (camel_url_new_with_base): Use g_ascii_strdown()
- instead of g_strdown, since g_strdown is deprecated.
-
-2003-01-28 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-sasl-gssapi.c (gssapi_challenge): Pass in some default
- flags to gss_init_sec_context() (these default flags are defined
- as a MUST in rfc1964).
-
-2003-01-22 Hans Petter Jansson <hpj@ximan.com>
-
- * Makefile.am: $(libexec) -> $(libexecdir)
-
-2003-01-22 Ettore Perazzoli <ettore@ximian.com>
-
- * providers/imap/Makefile.am (libcamelimapincludedir): Update to
- the new $(BASE_VERSION)-versioned path.
- * providers/smtp/Makefile.am (libcamelsmtpincludedir): Likewise.
- * providers/sendmail/Makefile.am (libcamelsendmailincludedir):
- Likewise.
- * providers/pop3/Makefile.am (libcamelpop3includedir): Likewise.
- * providers/nntp/Makefile.am (libcamelnntpincludedir): Likewise.
- * providers/local/Makefile.am (libcamellocalincludedir): Likewise.
-
- * camel-lock-client.c (camel_lock_helper_init): Use
- CAMEL_LIBEXECDIR instead of CAMEL_SBINDIR to find
- camel-lock-helper.
-
- * Makefile.am: Install camel-lock-helper and camel-index-control
- in $(libexec)/evolution/$(BASE_VERSION)/camel. Install
- libcamel.la in $privlibdir.
- (install-exec-hook): Update for the new location of
- camel-lock-helper.
- (libcamelincludedir): Version using $(BASE_VERSION).
- (INCLUDES): Define CAMEL_LIBEXECDIR.
-
-2003-01-21 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-filter-canon.c (complete): Set the backbuflen to 0 so
- that calling us again won't re-flush the same data.
-
-2003-01-17 Larry Ewing <lewing@ximian.com>
-
- * camel-mime-filter-enriched.c (enriched_to_html): only grow the
- buffer when we are out of space.
-
-2003-01-14 Not Zed <NotZed@Ximian.com>
-
- * camel-mime-parser.c (folder_scan_step): If we have no
- content-type header, set it to text/plain explcitly, rather than
- NULL, because some code doesn't handle NULL.
-
-2003-01-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-sasl-gssapi.[c,h]: New source files implementing the
- GSSAPI SASL mechanism.
-
-2003-01-13 Not Zed <NotZed@Ximian.com>
-
- * camel-mime-filter-tohtml.c: fix header include order.
-
- * camel-object.c (camel_object_bag_reserve): Add an assert to
- check we're not trying to reserve the bag more than once in a
- given thread.
- (camel_object_bag_list): If we have reserved the bag, dont try and
- cond wait. Fixes a deadlock.
-
- * camel-mime-filter-tohtml.c (writeln): Read the characters as
- utf8, rather than as 8 bit bytes. Remove the PRESERVE_8BIT as it
- has no meaning. Also change the default logic slightly so that 8
- bit or greater characters are properly converted to entities.
-
- * camel-utf8.c (camel_utf8_getc_limit): new function, gets a utf8
- char, bounded by an end pointer.
-
-2003-01-07 Dan Winship <danw@ximian.com>
-
- * camel-provider.h (CamelProvider): add a "translation_domain"
- field. (NULL for all providers in the camel source tree itself).
-
- * camel-session.c (register_provider): Translate provider strings
- in the correct domain
-
-2003-01-06 Not Zed <NotZed@Ximian.com>
-
- * camel-store.c (store_sync): init local exception before doing
- anything. fixes a crash.
-
-2003-01-04 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/smtp/camel-smtp-transport.c (smtp_send_to): Instead of
- checking recipients != NULL, check that camel_address_length
- (recipients) != 0 since it is illegal for recipients to be NULL
- (camel_transport_send_to already checks this).
-
-2002-12-17 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-utils.c: Replace calls to
- g_string_sprintfa() with g_string_append_printf() since the former
- seems to have been deprecated.
-
- * providers/imap/camel-imap-search.c: Same.
-
- * providers/imap/camel-imap-folder.c: Here too.
-
- * providers/local/camel-mbox-summary.c: And here.
-
- * providers/local/camel-local-summary.c: Replace
- g_string_sprintf() with g_string_printf().
-
- * camel-data-cache.c (data_cache_expire): Replace
- g_string_sprintf() with g_string_printf().
-
- * camel-url.c: Replace calls to g_string_sprintfa() with
- g_string_append_printf() since the former seems to have been
- deprecated.
-
- * camel-service.c: Same.
-
- * camel-mime-utils.c: Here too.
-
-2002-12-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-part-utils.c
- (simple_data_wrapper_construct_from_parser): Detect text/html
- parts that were marked as text/plain and re-tag them as text/html
- parts. Note: currently just checks if the first non-lwsp char is a
- '<' - but we might need to be smarter about this? *sigh* Stupid
- Windows mailers.
-
- * camel-mime-filter-tohtml.c (camel_text_to_html): New convenience
- function to replace calls to e_text_to_html() in the
- mailer/composer etc.
-
- * camel.h: #include some headers we had forgotten to add
- previously, also added camel-mime-filter-enriched.h.
-
- * camel-mime-filter-enriched.[c,h]: New stream filter to convert
- text/enriched and text/richtext into HTML.
-
-2002-12-15 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-multipart-signed.c (camel_multipart_signed_verify): Don't
- apply the CANON_STRIP filter here, since we are verifying whatever
- raw data we received (all we want to do is convert o the canonical
- CRLF format).
-
-2002-12-10 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-filter-tohtml.c (html_convert): Use camel-url-scanner
- instead of regex.
-
-2002-12-09 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-url-scanner.c (camel_url_addrspec_end): Fixed to not be
- fooled in the case where the address is followed immediately by a
- period.
- (camel_url_web_end): Made more robust.
- (camel_url_scanner_scan): Oops. We need to set the match->pattern
- string pointer to the correct pattern before executing the
- start/end methods (as some of them rely on this info).
-
-2002-12-09 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-url-scanner.c: New code to scan for patterns (used only
- for url pattern matching atm, but we may find other uses for this
- and thus rename it? I dunno). Uses ETrie.
-
-2002-12-07 Not Zed <NotZed@Ximian.com>
-
- * camel-data-cache.c (data_cache_init): Use a bag instead of a
- hashtable to track the cache streams.
- (data_cache_finalise): Same.
- (free_busy): No longer needed.
- (data_cache_expire): use bag instead of hashtable.
- (stream_finalised): No longer required.
- (camel_data_cache_add): objectbagise
- (camel_data_cache_get): "
- (camel_data_cache_remove): "
- (data_cache_path): Set the now expired date before running expiry,
- so it plays better with multiple threads. Still a couple of
- harmless races.
-
-2002-12-06 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-spool-store.c (scan_dir): folders ->
- object bag.
- (get_folder_info_mbox): folders -> object bag.
-
- * providers/local/camel-mh-store.c (folder_info_new): folders ->
- object bag.
-
- * providers/local/camel-maildir-store.c (scan_dir): folders ->
- object bag.
-
- * providers/local/camel-local-store.c (rename_folder): folders ->
- object bag.
-
- * camel-private.h (CamelStorePrivate): Remove 'cache' lock,
- handled by the objectbag.
-
- * providers/imap/camel-imap-store.c (copy_folder): Removed.
- (imap_store_refresh_folders): folders -> object bag.
- (get_folder_counts): folders -> object bag.
-
- * camel-vee-store.c (vee_get_folder): changes for folders
- objectbag.
- (vee_get_folder_info): Change to use folders objectbag. Also,
- dont refresh the base folder if we're in FAST mode.
- (build_info): Removed, no longer needed.
- (vee_rename_folder): Fixed for folders objectbag.
-
- * camel-store.c (camel_store_init): init the folders objectbag.
- (camel_store_finalize): Destroy the folders object bag.
- (folder_matches):
- (folder_finalize): Removed, now handled implicitly by the
- objectbag.
- (camel_store_get_folder): object bag changes.
- (camel_store_delete_folder): "
- (get_subfolders): Removed, now handled without a callback.
- (camel_store_rename_folder): Changed to use object bag of folders.
- (trash_add_folder): Removed.
- (init_trash): use folders object bag.
- (copy_folder_cache):
- (sync_folder): Removed, no longer needed. Weird arsed code anyway.
- (store_sync): Use folder object bag instead of hashtable.
- (camel_store_unsubscribe_folder): "
- (camel_store_init): remove cache_lock init, no longer used.
- (camel_store_finalize): Same for cleanup.
-
-2002-12-05 Not Zed <NotZed@Ximian.com>
-
- * camel-store.h (struct _CamelStore): change folders from a
- hashtable into a CamelObjectBag.
-
- * camel-object.c (camel_object_ref): Use type_lock instead of
- class lock for ref counting.
- (camel_object_unref): Use type_lock instead of class lock for
- unref.
- (camel_object_unref): If the object is 'bagged', then also look
- hooks, and remove it from any bags.
- (camel_object_bag_new):
- (camel_object_bag_destroy):
- (camel_object_bag_add):
- (camel_object_bag_get):
- (camel_object_bag_remove_unlocked):
- (camel_object_bag_list):
- (camel_object_bag_abort):
- (camel_object_bag_remove): New functions to implement a utility
- object which can manage a 'bag' of weakly ref'd children in an
- atomic & threadsafe way.
-
-2002-12-04 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-store-summary.c
- (camel_imap_store_summary_add_from_full): Properly handle the case
- where the namespace is "". Fixes bug #34975
-
-2002-12-03 Jeffrey Stedfast <fejj@ximian.com>
-
- * broken-date-parser.c (get_tzone): Fixed to not get false
- positives when the token is shorter than the actual timezone
- string (but matches the first little bit of it).
- (datetok): Modified to properly handle when the first char of a
- token is a special char (such as a '-') that is also used as a
- token delimiter.
-
-2002-11-21 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-tcp-stream-ssl.c (stream_read): Use the new
- camel_operation_cancel_prfd() function to get the cancellation fd
- so we can poll on it for cancellation stuff.
- (stream_write): Same.
-
-2002-11-22 Not Zed <NotZed@Ximian.com>
-
- * camel-operation.c (camel_operation_cancel_prfd): Implement, gets
- a nspr pr filedesc to poll/wait on
- (struct _CamelOperation): include a pr filedesc.
-
-2002-11-21 Not Zed <NotZed@Ximian.com>
-
- * providers/imap/camel-imap-store-summary.c
- (camel_imap_store_summary_namespace_find_path): If we have a
- namespace of "", then always match any path.
- (camel_imap_store_summary_namespace_find_full): Same, for full
- names. Should address #33309 & friends.
-
-2002-11-19 Radek Doulik <rodo@ximian.com>
-
- * camel-mime-filter-tohtml.c (html_convert): added
- CAMEL_MIME_FILTER_TOHTML_PRESERVE_8BIT flag
-
-2002-11-18 Rodney Dawes <dobey@ximian.com>
-
- * tests/*/Makefile.am: Removed $(GNOME_LIBDIR) and $(GNOMEUI_LIBS)
-
-2002-11-15 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-store.c (imap_connect_online): If the
- namespace is at/below INBOX, check for the INBOX explicitly (since
- it obviously won't show up in a LSUB INBOX.*). If either INBOX is
- not returned in the response or if the folder flags contain
- \NoSelect, subscribe to INBOX and then try LSUB again.
-
-2002-11-11 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-filter-tohtml.c (html_convert): Rewritten. Much much
- much cleaner implementation now, though uses malloc/free more
- often than I'd like.
-
-2002-11-11 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-folder.c (get_message_simple): Use
- g_strerror when setting an exception string (we need it to be in
- UTF-8).
-
- * providers/pop3/camel-pop3-store.c (pop3_try_authenticate): Use
- g_strerror when setting an exception string (we need it to be in
- UTF-8).
-
- * providers/pop3/camel-pop3-folder.c (pop3_refresh_info): Use
- g_strerror when setting an exception string (we need it to be in
- UTF-8).
- (pop3_get_message): Same.
-
- * providers/local/camel-spool-summary.c (spool_summary_sync_full):
- Use g_strerror when setting an exception string (we need it to be
- in UTF-8).
- (spool_summary_check): Here too.
-
- * providers/local/camel-spool-store.c (construct): Use g_strerror
- when setting an exception string (we need it to be in UTF-8).
- (get_folder): Same.
- (scan_dir): Here too.
-
- * providers/local/camel-spool-folder.c (spool_lock): Use
- g_strerror when setting an exception string (we need it to be in
- UTF-8).
-
- * providers/local/camel-mh-summary.c (mh_summary_check): Use
- g_strerror when setting an exception string (we need it to be in
- UTF-8).
-
- * providers/local/camel-mh-store.c (delete_folder): Use g_strerror
- when setting an exception string (we need it to be in UTF-8).
-
- * providers/local/camel-mbox-summary.c (summary_update): Use
- g_strerror when setting an exception string (we need it to be in
- UTF-8).
- (mbox_summary_sync_full): Here too.
- (mbox_summary_sync_quick): Same.
- (mbox_summary_sync): Also here.
- (camel_mbox_summary_sync_mbox): Again here.
-
- * providers/local/camel-mbox-folder.c (mbox_lock): Use g_strerror
- when setting an exception string (we need it to be in UTF-8).
- (mbox_append_message): Same.
- (mbox_get_message): Here too.
-
- * providers/local/camel-maildir-summary.c (maildir_summary_load):
- Use g_strerror when setting an exception string (we need it to be
- in UTF-8).
- (maildir_summary_check): Same.
-
- * providers/local/camel-maildir-store.c (get_folder): Use
- g_strerror when setting an exception string (we need it to be in
- UTF-8).
- (delete_folder): Same.
- (delete_folder): Here too.
-
- * providers/local/camel-local-summary.c (local_summary_sync): Use
- g_strerror when setting an exception string (we need it to be in
- UTF-8).
-
- * providers/local/camel-local-store.c (get_folder): Use g_strerror
- when setting an exception string (we need it to be in UTF-8).
- (create_folder): Same.
- (xrename): Here too.
- (rename_folder): And here.
- (delete_folder): Also here.
-
- * camel-provider.c (camel_provider_init): For debugging printfs,
- we want to use normal strerror (we want locale charset, not
- UTF-8).
-
- * camel-movemail.c (camel_movemail): Use g_strerror when setting
- an exception string (we need it to be in UTF-8).
- (movemail_external): Same.
- (camel_movemail_copy_file): Here too.
- (camel_movemail_solaris): Also here.
-
- * camel-mime-utils.c (rfc2047_decode_word): For debugging printfs,
- we want to use normal strerror (we want locale charset, not
- UTF-8).
- (header_encode_param): Same.
-
- * camel-mime-part-utils.c (convert_buffer): For debugging printfs,
- we want to use normal strerror (we want locale charset, not
- UTF-8).
-
- * camel-lock-client.c (camel_lock_helper_init): Use g_strerror
- when setting an exception string (we need it to be in UTF-8).
-
- * camel-data-cache.c (camel_data_cache_remove): Use g_strerror
- when setting an exception string (we need it to be in UTF-8).
-
- * camel-tcp-stream-raw.c (flaky_tcp_write): For debugging printfs,
- we want to use normal strerror (we want locale charset, not
- UTF-8).
- (flaky_tcp_read): Same.
-
- * camel-gpg-context.c (gpg_ctx_op_step): For debugging printfs, we
- want to use normal strerror (we want locale charset, not UTF-8).
-
- * camel-service.c (camel_gethostbyname): Use g_strerror when
- setting an exception string (we need it to be in UTF-8).
-
- * camel-lock.c (camel_lock_dot): Use g_strerror when setting an
- exception string (we need it to be in UTF-8).
- (camel_lock_fcntl): Same.
-
-2002-11-07 Not Zed <NotZed@Ximian.com>
-
- * camel-mime-part.c (camel_mime_part_set_content_type): constify
- the content_type.
-
-2002-11-07 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-i18n.h: Added.
-
- * camel-object.h: #include camel-i18n.h instead of gnome-i18n.h
-
- * camel-lock.c: Same.
-
-2002-11-07 Rodrigo Moya <rodrigo@ximian.com>
-
- * camel-object.h: removed gnome-defs.h, it does not exist.
-
-2002-11-05 Not Zed <NotZed@Ximian.com>
-
- * Makefile.am (camel_lock_helper_LDADD): Created temporary link
- list, we need to link with something for gettext.
-
- * camel.h: Remove gstring-util.h and hash-table-utils.h.
-
- * camel-text-index.c:
- (text_index_normalise): Changed for g_utf8_strdown api change.
-
- * camel-search-private.c:
- * camel-mime-utils.c:
- * camel-mime-part-utils.c:
- * camel-html-parser.c:
- * camel-charset-map.c: Include glib/gunicode.h from glib instead
- of gal.
-
- * camel-filter-driver.c: Remove include of gtk/gtk.h, should never
- have been there.
-
-2002-11-01 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-utils.c (g_string_append_len): Removed. Glib2 has
- this function.
-
- * providers/local/camel-local-store.c (delete_folder): Use
- g_path_get_basename instead of g_strdup (g_basename (filename)).
-
- * camel-uid-cache.c (camel_uid_cache_new): Use g_path_get_dirname
- since g_dirname has been deprecated.
-
-2002-10-31 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-gpg-context.c (camel_gpg_context_class_init): Set the
- virtual method pointers to the import/export methods.
- (camel_gpg_context_init): Set the key_protocol string.
- (gpg_hash_to_id): Handle 2 more hash types.
- (gpg_id_to_hash): Same.
- (gpg_ctx_op_step): Slight fixes to support import/export.
- (gpg_ctx_parse_status): Fix to hack around the fact that importing
- keys doesn't write to stdout.
- (gpg_import_keys): Implemented.
- (gpg_export_keys): Implemented.
-
- * camel-cipher-context.c (camel_cipher_context_class_init): Hook
- up default virtual methods for import/export.
- (camel_cipher_import_keys): Implemented.
- (camel_cipher_export_keys): Implemented.
-
-2002-10-31 Jeffrey Stedfast <fejj@ximian.com>
-
- * Makefile.am: Removed hash-table-utils.[c,h] from the build.
-
- * hash-table-utils.[c,h]: Removed.
-
- * string-util.c: Imported g_strcase[hash,equal] into here so we
- can remove hash-table-utils.[c,h].
-
- * camel-medium.c: Removed #include "hash-table-utils.h"
-
- * camel-mime-message.c: Same here.
-
- * camel-mime-part.c: And here.
-
- * camel-session.c: Here too.
-
- * providers/imap/camel-imap-store-summary.c: #include
- string-utils.h instead of hash-table-utils.h
-
- * camel-charset-map.c: Same.
-
- * camel-folder-summary.c: Here too.
-
- * camel-provider.c: Again here.
-
- * camel-store-summary.c: And again...
-
-2002-10-31 Jeffrey Stedfast <fejj@ximian.com>
-
- Remove a ton of useless snot.
-
- * Makefile.am: Remove gstring-util.[c,h] from the build.
-
- * gstring-util.[c,h]: Removed.
-
- * string-utils.c (string_equal_for_glist): Removed.
- (string_split): Removed.
- (string_trim): Removed.
- (string_prefix): Removed.
- (string_unquote): Removed.
- (strip): Removed.
-
- * hash-table-utils.c (g_hash_table_generic_free): Removed.
-
- g_str[n]casecmp functions are deprecated in glib2.
-
- * string-utils.c (strstrcase): Use strncasecmp instead of
- g_strncasecmp.
-
- * hash-table-utils.c (g_strcase_equal): Use strcasecmp
- instead of g_strcasecmp.
-
- * camel-smime-utils.c (camel_smime_is_smime_v3_signed): Same.
- (camel_smime_is_smime_v3_encrypted): Here too.
-
- * camel-sasl-digest-md5.c (decode_data_type): And here.
- (parse_server_challenge): Again here.
-
- * camel-pgp-mime.c (camel_pgp_mime_is_rfc2015_signed): Same.
- (camel_pgp_mime_is_rfc2015_encrypted): Same
-
- * camel-mime-part-utils.c (check_html_charset): Here too.
-
- * camel-folder-summary.c (camel_system_flag): Same.
-
-2002-10-25 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-gpg-context.c (gpg_ctx_parse_status): Don't prematurely
- set gpg->complete to TRUE. Let gpg_ctx_op_step () set it to TRUE
- when gpg closes the status-fd instead.
-
-2002-10-24 Not Zed <NotZed@Ximian.com>
-
- ** For bug #31647 and bug #31456.
-
- * camel-store-summary.c (store_info_string): for STORE_INFO_NAME,
- skip the leading /.
-
- * providers/imap/camel-imap-store.c
- (parse_list_response_as_folder_info): Remove jeff's last patch,
- and use the store summary to create the name and path of the
- folderinfo so it manages namespace issues.
- (get_folder_info_online): Just pass @top directly to
- build_folder_info always, since namespace is mapped to 1 tree
- level.
- (imap_build_folder_info): Remove jeff's last patch, dont strip
- leading /'s, they shouldn't exist.
- (imap_connect_online): Remove adding the INBOX here, we add it
- later.
- (get_subscribed_folders): Make sure INBOX is always in the list.
- some imap servers dont seem to let you subscribe to it(?), so
- always have it act as subscribed.
-
- * camel-store.c (camel_folder_info_build): back out the last 2
- patches from Jeff (for #31456) to get the original behaviour.
- (camel_folder_info_build): When creating a fake
- parent, dont strip the namespace from the full_name. malloc keys
- in hash since we dont have them anymore.
- (free_name): Helper to free names.
-
- * providers/imap/camel-imap-store-summary.c
- (camel_imap_store_summary_namespace_new): Canonicalise the
- namespace (strip trailing dir_sep), and change the path to remove
- any /'s.
- (camel_imap_store_summary_namespace_find_path):
- (camel_imap_store_summary_namespace_find_full): new, find
- namespace by path/full name.
- (camel_imap_store_summary_full_from_path): Changed to a simple
- wrapper around path_to_full, after checking namespace.
- (camel_imap_store_summary_add_from_full): map the namespace if
- present.
- (camel_imap_store_summary_path_to_full): If namespace exists,
- unmap it.
-
-2002-10-18 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-filter-driver.c (camel_filter_driver_filter_folder):
- Canonicalise the source_uri to not have a path. Fixes bug #32268.
-
-2002-10-17 Jeffrey Stedfast <fejj@ximian.com>
-
- Possible fix for bug #32270
-
- * providers/pop3/camel-pop3-store.c (try_sasl): If we get an I/O
- error, we should not be setting the CANT_AUTH exception but should
- instead be setting the SYSTEM exception. Also check for EINTR
- which signifies a USER_CANCEL exception.
- (pop3_try_authenticate): If the auth mechanism isn't supported,
- don't set the CANT_AUTH exception since then we will loop and try
- again with the same data which will just cause an infinite loop.
- (pop3_connect): Simplified a bit.
-
-2002-10-17 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-tcp-stream-ssl.c (camel_certdb_nss_cert_set): If
- ~/.camel_certs doesn't exist, create it.
-
-2002-10-15 Not Zed <NotZed@Ximian.com>
-
- * camel-tcp-stream-ssl.c (cert_fingerprint): helper, build
- fingerprint.
- (camel_certdb_nss_cert_get): Helper for nss certs. Lookup cert.
- As well as fingerprint, the whole raw cert is checked for
- validity.
- (camel_certdb_nss_cert_add): Add an nss cert to a certdb, also
- saves the cert by fingerprint in ~/.camel_certs/.
- (ssl_bad_cert): Changed to use above functions to simplify logic.
- (ssl_bad_cert): Also added non-compiled code which mimics what
- mozilla does, but it doesn't work right :-/
- (camel_certdb_nss_cert_set): Save the raw cert associated with a
- cert.
-
- * camel-certdb.c (certdb_cert_free): Free the raw cert data if
- set.
-
-2002-10-14 Not Zed <NotZed@Ximian.com>
-
- * camel-file-utils.c (camel_file_util_encode_string): Encode a
- length of 0 as 1, not 0, to match the decode code.
-
-2002-10-03 Not Zed <NotZed@Ximian.com>
-
- * camel-folder.c (filter_filter): Do the filtering ourselves.
- This is so a problem like a missing uid (which can happen
- legitemitely) doesn't prematurely abort filtering. Stop on all
- other errors. See #31667.
-
-2002-10-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-gpg-context.c (camel_gpg_context_new): No longer takes a
- path argument.
- (camel_gpg_context_fianlise): No need to free ctx->path.
- (gpg_ctx_new): No longer takes a path argument either.
- (gpg_ctx_free): No need to free ctx->path, it's no longer used.
- (gpg_ctx_op_start): Don't stat the path anymore and change the
- first arg to execvp to "gpg" so that we use the shell's
- environment to find gpg.
- (gpg_sign): Updated.
- (gpg_verify): Updated.
- (gpg_encrypt): Updated.
- (gpg_decrypt): Updated.
- (gpg_ctx_get_argv): Removed some debug printfs.
-
-2002-10-15 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-gpg-context.c (gpg_id_to_hash): If the hash id is NULL,
- return CAMEL_CIPHER_HASH_DEFAULT. Fixes bug #32229.
-
-2002-10-08 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-command.c (imap_read_response): If the
- response from the IMAP server is "No", don't set the
- SERVICE_UNAVAILABLE exception, this makes error reporting in the
- UI for deleting IMAP folders that cannot be deleted inaccurate
- (ie, it reports "Cannot delete in offline mode" which is not the
- problem).
-
-2002-10-07 Jeffrey Stedfast <fejj@ximian.com>
-
- Fixes bug #31752
-
- * providers/smtp/camel-smtp-transport.c (connect_to_server): Don't
- forget to send another EHLO command to the server once we toggle
- into STARTTLS mode.
- (smtp_helo): Reset any flags set using the EHLO response and also
- any authtypes.
-
-2002-10-06 Jeffrey Stedfast <fejj@ximian.com>
-
- Fixes bug #31681
-
- * camel-mime-utils.c: Fix all mailing list regex patterns to allow
- any number of spaces *or* tabs as pre-padding for the header
- values.
-
-2002-10-03 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-part.c (write_to_stream): Use the content-object's
- rawtext flag to decide if it needs to be filtered through the
- charset filter instead of using the mime part's rawtext flag since
- this will never be set. Partial fix for bug #31655.
-
-2002-10-03 Not Zed <NotZed@Ximian.com>
-
- * camel-folder.c (folder_changed): Dont get the filter driver
- inside the change_lock. Its not necessary, and can cause deadlock
- with the way the mailer gets the filter driver via g_mainloop.
- Should fix #31572.
-
-2002-10-02 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-charset-map.c (camel_charset_iso_to_windows): Map us-ascii
- to windows-1252 also.
-
-2002-10-02 Not Zed <NotZed@Ximian.com>
-
- * providers/imap/camel-imap-folder.c (get_matching): Set *set to
- NULL if we dont get any matches.
- (imap_sync_online): If we get no matches, skip any work, also
- reorder some code to make it easier to skip. See #31031.
-
- * providers/imap/camel-imap-store.c
- (imap_check_folder_still_extant): Default to "TRUE", if the list
- command failed, it probably means a server problem, assume the
- worst. This makes imap_refresh_info not clear the exception and
- crash. Fixes crash of #31000.
-
-2002-10-01 Not Zed <NotZed@Ximian.com>
-
- * providers/imap/camel-imap-folder.c (imap_refresh_info): Make
- sure we pass the exception to imap_folder_selected(), otherwise
- failures can be lost. See bug #31000.
-
-2002-10-01 Not Zed <NotZed@Ximian.com>
-
- * camel-folder.c (thaw): Add an assertion that the frozen count>0.
- (freeze): Same for >= 0.
-
- * camel-vee-folder.c (camel_vee_folder_remove_folder): Use the
- unmatched freeze_count when thawing folders removed from
- unmatched, rather than the folder's freeze_count. Might be
- related to #27391.
-
-2002-10-01 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-folder.c (decode_internaldate): Use
- strtol when decoding the timezone (since it can be negative) and
- don't forget to increment inptr to the start of the time (ie,
- don't leave inptr pointing to the year when decoding the
- hour:min:sec).
-
-2002-09-30 Jeffrey Stedfast <fejj@ximian.com>
-
- Fixes bug #31456.
-
- * providers/imap/camel-imap-store.c (imap_connect_online): Don't
- LSUB "" "*", instead get both an LSUB containing the subfolders of
- the namespace and an LSUB of INBOX (assuming namespace was
- non-empty). This fix really has nothing to do with bug #31456 but
- is what should have been done in the first place.
- (parse_list_response_as_folder_info): Simplify a tad and strip
- extra leading /'s from fi->path.
- (imap_build_folder_info): Strip extra leading /'s from fi->path.
-
- * camel-store.c (camel_folder_info_build): Don't strip the
- namespace from the fi->full_name when hashing or creating fake
- parent folder-infos. Fixes a bug I found while trying to reproduce
- bug #31456.
- (camel_folder_info_build_path): Strip off extra leading dir_sep
- chars from the path.
-
-2002-09-30 Not Zed <NotZed@Ximian.com>
-
- * providers/imap/camel-imap-folder.c (imap_get_message): Remove
- debug content_info_dump, could cause a crash, and not really
- needed anymore.
-
- * camel-folder-summary.c (camel_content_info_dump): Check ci->type
- != NULL before dereferencing it. Should fix crash #31331.
-
-2002-09-27 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-folder.c (decode_internaldate): New
- function to decode the INTERNALDATE response from an IMAP server
- so we don't have to use my broken-date-parser routines.
-
-2002-09-27 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-store.c (connect_to_server):
- NULL-check the streams before unreffing them in the case of a
- failure during ssl negotiations.
-
- * camel-tcp-stream-ssl.c (camel_tcp_stream_ssl_enable_ssl): Check
- SSL_ResetHandshake() for errors. Also force a handshake after
- we've reset the handshake state on the socket.
-
-2002-09-27 Not Zed <NotZed@Ximian.com>
-
- * providers/imap/camel-imap-folder.c (imap_update_summary): Use
- the summary's last uid as the one to fetch from, ignoring the
- cache. Use strtoul instead of atoi as well.
-
- * providers/imap/camel-imap-store.c (get_folder_counts): If we
- have the folder open, and the unread count has changed, refresh
- it. Should fix #30399 enough. Also in non-check-all mode, if we
- have the folder open, use it anyway.
-
-2002-09-26 Not Zed <NotZed@Ximian.com>
-
- * tests/folder/test2.c (main): Treat spool as a local folder, so
- the ref checks work right.
-
- * providers/local/camel-spool-store.c (get_folder): Implement
- FOLDER_CREATE flag.
- (scan_dir): Dont free name on exception, its alloca'd.
- (scan_dir): If we start scanning from a file, just add that
- directly.
- (scan_dir): Allow empty files to also show up in folder list, as
- well as files starting with "From ".
- (get_folder): Use creat() instead of open() to create file.
-
- * providers/local/camel-spool-folder.c (camel_spool_folder_new):
- Check folder != NULL before writing to it.
-
- * providers/local/camel-local-store.c (create_folder): Handle a
- parent of NULL for creating top-level dirs. Part of #31186.
-
- * providers/imap/camel-imap-store.c
- (parse_list_response_as_folder_info): Store the folder flags in
- the store summary.
- (get_one_folder_offline): Set the noselect url parameter if this
- is a noselect folder, from the stored summary flags. #30877.
-
-2002-09-23 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-filter-charset.c (complete): Handle EILSEQ by eating
- bytes in the input buffer until conversion is successful. The old
- behaviour aborted when it got EILSEQ and just dumped the raw data.
- (filter): Same. Fixes bug #30873.
-
-2002-09-24 Not Zed <NotZed@Ximian.com>
-
- * camel-mime-utils.c (mail_list_magic[]): Changed the Mailing-List
- rule to get the complete domain (* in wrong spot). #31087.
-
- * camel-text-index.c (text_index_compress_nosync): If we have no
- data written to a key, dont add it, or its partition header.
-
-2002-09-23 Not Zed <NotZed@Ximian.com>
-
- * camel-block-file.c (sync_nolock): Mark root block dirty if we're
- going to sync it.
- (camel_key_file_finalise): de-count the active list if we close
- it.
-
- * camel-text-index.c (text_index_delete): Implement.
- (text_index_compress_nosync): Use index_delete when we're finished
- with the old one, so it is properly deactivated.
-
- * camel-index.c (camel_index_delete): Remove api call. Mark index
- deleted in new state variable.
- (camel_index_*): Wrap all calls in check for deleted state.
-
-2002-09-23 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-folder.c (transfer_message_to): If the original message is
- deleted, reset the deleted flag when we're done. Fixes bug #30876.
-
- * providers/imap/camel-imap-folder.c (add_message_from_data):
- Decode the INTERNALDATE if we've got one.
- (imap_update_summary): Instead of requesting a list of specific
- headers, request HEADER.FIELDS.NOT (RECEIVED) to reduce bandwidth
- usage even more.
- (parse_fetch_response): Change slightly to allow HEADER.FIELDS or
- HEADER.FIELDS.NOT so that we can make changes in
- imap_update_summary and not need to keep changing this function to
- match. Also parse an INTERNALDATE response.
-
-2002-09-22 Dan Winship <danw@ximian.com>
-
- * camel-mime-parser.c (folder_scan_drop_step): fix non-ANSI switch
- statement.
-
- * camel-service.c (service_getv): Likewise.
-
- * providers/imap/camel-imap-store.c (imap_getv): Likewise.
-
- * providers/pop3/camel-pop3-folder.c (cmd_builduid): Likewise.
-
-2002-09-20 Not Zed <NotZed@Ximian.com>
-
- * tests/misc/split.c: New regression test for word
- splitting/search input parsing code.
-
- * tests/folder/test9.c (main): Fix for filter_driver api change.
-
- * camel-search-private.c (camel_search_words_split): Handle "'s
- and \'s to escape characters. For fat, lazy, slobs who dont like
- anything changing.
-
-2002-09-19 Not Zed <NotZed@Ximian.com>
-
- * camel-filter-search.c (camel_filter_search_match): Take new
- session arg. Update callers.
- (symbols[]): changed get-source to header-source
- (header_source): Changed from get_source. Now a boolean, returns
- true if source matches one of the arguments. Uses the provider
- url comparison directly for accurate checking. Makes 'filter on
- source' work.
-
- * camel-filter-driver.c (camel_filter_driver_new): Take new arg,
- session.
- (camel_filter_driver_finalise): Free session.
-
-2002-09-19 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-folder.c (parse_fetch_response): Don't
- increment the response pointer when deciding what type of header
- response we got, this screws up the string that we strdup into the
- part_spec string later. Also, instead of using the entire blob of
- HEADER.FIELDS that we get in the response, shorten it to just
- HEADER.FIELDS to use as the part_spec key.
-
-2002-09-18 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-folder.c (CAMEL_MESSAGE_INFO_HEADERS):
- Include MIME-VERSION and CONTENT-TYPE.
-
-2002-09-18 Not Zed <NotZed@Ximian.com>
-
- * providers/imap/camel-imap-command.c
- (camel_imap_command_response): If we get an ALERT, pass it to the
- user. An rfc2060 MUST, and bug #22496.
-
-2002-09-17 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-folder.c (parse_fetch_response):
- Handle when the response is from a HEADER.FIELDS (if so, we don't
- want to cache the result).
- (imap_update_summary): Request specific headers when building the
- CamelMessageInfo's rather than fetching the full headers.
-
-2002-09-13 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-part.c (process_header): If header_msgid_decode fails
- for the content-id field, just grab whatever is between the <>'s
- (yes, this means that the content-id is invalid - but what can ya
- do?). Addresses bug #21027.
-
-2002-09-11 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-utils.c (header_encode_string): Revert a patch that I
- had not meant to commit that was aimed at fixing bug #29234.
-
-2002-09-10 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-store-summary.c (camel_store_summary_load): Same as
- below. Also save errno before closing the file so our caller can
- figure out why we failed.
- (camel_store_summary_save): Same here, but also flush the output
- stream to disk.
-
- * camel-folder-summary.c (camel_folder_summary_load): s/fclose(in)
- == -1/fclose(in) != 0/ since fclose doesn't necessarily return -1
- on fail, all we really know is that it returns 0 on success and
- non-zero on fail.
-
- * camel-certdb.c (camel_certdb_save): fsync() the stream after we
- fflush it.
-
- * camel-folder-summary.c (perform_content_info_save): Do proper
- error checking and return -1 on fail.
- (camel_folder_summary_save): Check the return of
- perform_content_info_save and a few other output calls within the
- message_info_save loop. If any of them fail, save errno, close the
- file, and return -1. If we finish the loop without fail, fflush
- the stream and then fsync (fflush only flushes user-space buffers,
- you still need to fsync afterward to flush the data to disk). If
- either fail, treat it as an exception by saving errno, closing the
- stream, and returning -1. I suspect that this also fixes bug
- #30150 because the old code would fclose if fflush or fclose
- failed in the check after the loop (man fclose(3) states that any
- further calls using the stream (even another call to fclose) will
- have undefined behaviour no matter what the first fclose call
- returned).
-
- * providers/local/camel-local-summary.c
- (camel_local_summary_init): Don't malloc a private struct of 0
- size.
-
- * providers/imap/camel-imap-folder.c
- (camel_imap_folder_fetch_data): Clear the exception even if we
- failed to get the message (part) from the imap-message-cache if we
- are online and able to try fetching it from the IMAP server.
-
-2002-09-10 Not Zed <NotZed@Ximian.com>
-
- * camel-data-cache.c (data_cache_expire): Remove the hash table
- entry using the right path. Related to #29731.
- (camel_data_cache_remove): "
-
-2002-09-09 Jeffrey Stedfast <fejj@ximian.com>
-
- Fixes bug #4224
-
- * providers/imap/camel-imap-folder.c
- (camel_imap_folder_fetch_data): Pass ex into
- camel_imap_message_cache_get().
-
- * providers/imap/camel-imap-message-cache.c
- (camel_imap_message_cache_get): Now takes an exception and sets it
- on fail.
- (camel_imap_message_cache_copy): Updated to properly handle
- cache_get error conditions.
-
-2002-09-04 Dan Winship <danw@ximian.com>
-
- * camel-mime-utils.c (header_decode_date): Use e_mktime_utc.
-
- * camel-mime-message.c (camel_mime_message_set_date): Use
- e_localtime_with_offset.
-
- * broken-date-parser.c (decode_broken_date): Use e_mktime_utc.
-
-2002-09-04 Not Zed <NotZed@Ximian.com>
-
- * tests/folder/test4.c (main): clear nonfatal stuff.
-
- * tests/folder/test6.c (main): check inbox and 'another folder'
- because some servers do different things w/ inbox.
-
- * providers/imap/camel-imap-message-cache.c
- (camel_imap_message_cache_get): Dont try to open the directory
- instead of an empty "" uid.
-
- * providers/imap/camel-imap-folder.c (imap_get_message): we dont
- want to g_return_if_fail, we need to set an exception and always
- handle the case.
- (get_message_simple): Set an exception if we get a construct
- failure.
- (imap_refresh_info): if we're refreshing inbox, force a reselect.
- this is required for at least cyrus. CHECK doesnt work either :(
-
- * tests/lib/folders.c (test_folder_basic): for non-local stores,
- the folder will have an extra ref for selection, take this into
- account when checking ref leaks.
- (test_folder_message_ops): Dont try to delete folder with messages
- in it, it works generally with imap. also, change params so we
- can test different mailbox types.
- (test_folder_message_ops): disconnect remote services before
- finishing off. doesn't need to stricly but makes ref count
- checking more accurate.
- (test_folder_message_ops): removed explicit remote sync, imap does
- it itself now ...
-
- * providers/imap/camel-imap-store.c:
- (camel_imap_store_finalize): call service_disconnect, so it isn't
- called later in the finalise chain, to properly cleanup on exit.
-
- * camel-mime-parser.c (folder_scan_content): If we fake the from
- eof file boundary, also make sure we say we matched nothing. Also
- make the end case a little more robust to make sure we expired all
- hope of finding a sub-boundary.
-
- * providers/imap/camel-imap-store.c,
- providers/imap/camel-imap-folder.c: Lots of changes, too numerous
- to list. Changed to use camel-imap-store-summary to cache list
- requests. Changed to use a canonicalised url path with / instead
- of per-store directory separator. Indirects folder name so
- invalid folder names can still be accessed. Summary now stored in
- a new expandable format in .ev-store-summary.
-
-2002-08-29 Not Zed <NotZed@Ximian.com>
-
- * tests/folder/test3.c: Change the case sensitive search of
- subject to expect case insensitive results, as the behaviour has
- changed.
- (main): Made the search content before sync nonfatal. its
- something that needs to be fixed but not practical concern in
- evolution.
-
- * camel-block-file.c (block_file_validate_root): Only spit out the
- invalid root warnings if the file isn't empty.
-
- * camel-text-index.c (text_index_compress_nosync): Swap the path
- as well when we compress.
-
- * camel-mime-parser.c (folder_scan_content): Treat the end of file
- as a boundary if we're scanning From lines, and drop the last \n.
- (folder_scan_init_with_fd): Dont pre-read from the fd, and init eof.
- (folder_scan_init_with_stream): Similar.
- (folder_read): Handle eof, and set eof on 0 read.
- (folder_seek): Dont pre-read after a seek, and reset eof flag.
- (camel_mime_parser_init_with_fd): Fix doco, no pre-read occurs
- anymore.
- (camel_mime_parser_init_with_stream): Same.
-
- * providers/local/camel-mbox-summary.c
- (camel_mbox_summary_sync_mbox): Add a \n to end of content of each
- message, not at start.
-
- * providers/local/camel-mbox-folder.c (mbox_append_message):
- Instead of appending "\nFrom " to a mailbox, start with "From ",
- and append a \n after the message always. For better mutt/elm
- compatability. Also, unlock after we've stat'd.
- (mbox_append_message): Set the message's from_pos exactly as the
- mbox size.
-
-2002-08-28 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-tcp-stream-openssl.c (stream_setsockopt): Fixed `set' to
- hold the correct value when setting the flags.
-
- * camel-tcp-stream-raw.c (stream_setsockopt): Fixed `set' to hold
- the correct value when setting the flags.
-
- * camel-mime-filter-tohtml.c (is_protocol): Match file: urls too.
-
-2002-08-28 Not Zed <NotZed@Ximian.com>
-
- * tests/folder/test8.c (test_add_message): Change message number
- to use hex, so its properly unique.
- (worker): Same here.
-
- * tests/misc/utf7.c: some utf7/utf8 tests.
-
- * providers/imap/camel-imap-utils.c (imap_mailbox_encode): Changed
- to use camel_utf8_utf7 code.
- (imap_mailbox_decode): As above, using camel_utf8_utf7. 'UTF-7'
- isn't a widely support iconv() codeset, and besides the new code
- is simpler.
-
- * camel-utf8.[ch]: robust utilities for working with utf8 and utf7.
-
-2002-08-27 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-folder-thread.c (camel_folder_thread_messages_new): Now
- takes a third argument to specify whether or not to group messages
- by subject when threading. It seems some people don't want this
- feature (see bug #22791 for details).
- (thread_summary): If thread_by_subject is enabled, group
- un-threaded messages by subject otherwise don't bother.
-
-2002-08-26 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-command.c
- (camel_imap_response_free_without_processing): If the response is
- NULL, just return. (now works the same way as imap_response_free
- which allowed a NULL response argument). Fixes bug #25491.
-
-2002-08-26 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-store.c:
-
- * providers/imap/camel-imap-folder.c:
-
- * providers/imap/camel-imap-command.c: Lock the
- CamelService->priv->connect_lock instead of using our own
- command_lock. This fixes bug #28177.
-
-2002-08-23 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/smtp/camel-smtp-transport.c (smtp_helo): If we fail to
- send the EHLO/HELO command successfully, set transport->connected
- to FALSE when we close the tcp connection. Also updated to work on
- an IPv6 network.
- (smtp_connect): transport->authtypes can be NULL, so NULL-protect
- the call to g_hash_table_size() - this should fix a warning that
- was reported on the evolution@ximian.com mailing list.
- (smtp_set_exception): If the status message is multi-line, add a
- \n between lines.
- (connect_to_server): If we are going to ignore the EHLO/HELO error
- as if it were non-fatal, then we should clear the exception.
-
-2002-08-22 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-store.c (imap_noop): If current_folder
- is not NULL and the summary for that folder is dirty, sync the
- flags rather than sending a NOOP.
-
- * providers/imap/camel-imap-utils.c (imap_parse_list_response):
- Workaround for Courier imap's brokeness when LSUBing the INBOX
- folder when it isn't subscribed to. Fixes bug #28929.
-
-2002-08-21 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-store.c (connect_to_server): If
- imap_get_capability() fails, after unlocking the command_lock,
- disconnect the service.
-
-2002-08-21 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-session.c (get_service): Don't register the noop timeout
- here anymore, we're gonna handle all this in the mailer now.
- (camel_session_register_timeout): Removed.
- (camel_session_remove_timeout): Removed.
-
-2002-08-28 Not Zed <NotZed@Ximian.com>
-
- * providers/imap/camel-imap-store.c (construct): Load store
- summary if it exists.
- (can_work_offline): Just see if we have any folders to say whether
- we can work offline or not. Should probably always just return
- true.
-
-2002-08-27 Not Zed <NotZed@Ximian.com>
-
- * providers/imap/camel-imap-store-summary.[ch]: New files to
- handle offline definition of folders, etc.
-
- * camel-url.h: Define CamelURL to be struct _CamelURL rather than
- anonymous struct.
-
- * camel-store-summary.[ch]: a few api tweaks. Also, the summary
- header is versioned separately at each level, so that version
- upgrades can be handled separately. Renamed FolderInfo ->
- StoreInfo to avoid namespace with current FolderInfo code. This
- should be reversed when the FolderInfo code is rationalised to
- this new base.
-
-2002-08-23 Not Zed <NotZed@Ximian.com>
-
- * providers/imap/camel-imap-command.c (camel_imap_command): domt
- encode folder name.
-
- * providers/imap/camel-imap-folder.c (do_copy): dont encode folder
- name.
- (do_append): dont encode folder name.
-
- * providers/imap/camel-imap-store.c (get_folder_status): don
- encode folder name in imap request.
- (get_folder_online): here too for creating folder.
- (rename_folder): Assume the incoming 'new name' is a utf8 path,
- whereas the 'old name' is as from get folder info (raw).
- (create_folder): Dont encode parent_name, assume its the raw
- thing.
-
-2002-08-22 Not Zed <NotZed@Ximian.com>
-
- * providers/imap/camel-imap-store.c (get_folder_online): Select
- based on unconverted name.
- (imap_build_folder_info): New function to create a folderinfo
- properly based on raw name.
- (subscribe_folder): Use above helper.
- (imap_folder_effectively_unsubscribed): Same here.
- (imap_forget_folder): Same here.
- (get_one_folder_offline): "
-
-2002-08-21 Not Zed <NotZed@Ximian.com>
-
- * providers/imap/camel-imap-store.c
- (parse_list_response_as_folder_info): Setup path properly, as
- decoded path with / separator. Setup full_name as non-decoded raw
- name. Keep url as decoded path but with server separator
- ... (ick).
- (create_folder): Dont call build_path anymore, get_folders() does
- it for us.
- (subscribe_folder): Build the path ourself.
- (imap_folder_effectively_unsubscribed): Same here.
- (get_subscribed_folders): list using %S not %F, we're using the
- raw server provided name directly.
- (subscribe_folder): As above, for SUBSCRIBE.
- (unsubscribe_folder): Same here.
- (delete_folder): Same.
- (rename_folder_info): Same here for source name.
- (rename_folder): And here?
- (get_folders_online): Amd here.
-
- * providers/imap/camel-imap-utils.c:
- (imap_parse_list_response): Dont decode the mailbox.
-
- * camel-utf8.[ch]: some new utf8 & utf7 utilities.
-
- * providers/imap/camel-imap-utils.c (imap_mailbox_encode):
- (imap_mailbox_decode): use camel_utf7/8* functions instead.
- : Add config.h and alloca.h headers.
-
-2002-08-20 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-store.c (imap_noop): Override the
- default noop implementation.
-
- * camel-store.c (camel_store_noop): New virtual method to ping a
- store.
-
- * camel-session.c (get_service): Register a timeout that calls
- camel_store_noop() every 10 minutes.
-
-2002-08-19 Peter Williams <peterw@ximian.com>
-
- Plug some large leaks in the indexing code.
-
- * camel-mime-filter-index.c (camel_mime_filter_index_set_index): Unref
- the old index if necessary.
-
- * camel-text-index.c (camel_text_index_get_type): Give it the correct
- parent type so that finalize handlers chain.
- (camel_text_index_name_get_type): Here too.
- (camel_text_index_cursor_get_type): Here too.
- (camel_text_index_key_cursor_get_type): Here too.
-
-2002-08-20 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-store.c (get_folders): Don't let the
- minimum recursive depth be negative.
- (get_folders): Pass flags & CAMEL_FOLDER_INFO_SUBSCRIBED as the
- `lsub' argument to get_folders_online() otherwise we'll end up
- doing a LIST when we really wanted to do an LSUB.
-
- * camel-session.c: Set CAMEL_URL_NEED_PATH for the vFolder
- provider.
-
-2002-08-19 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-store.c: Changed the STOREINFO_VERSION
- - should fix bug #28571, but if it doesn't - oh well, I don't
- care. I'm considering it fixed no matter what.
-
- * camel-gpg-context.c (gpg_sign): If the diagnostics are empty,
- just explain that gpg failed to execute.
- (gpg_encrypt): Same.
- (gpg_decrypt): And here too.
-
- * tests/lib/camel-test.c (camel_test_init): Updated to pass the
- needed arguments to camel_init() and to init gthreads before camel
- (since camel expectes it to be initialised already).
-
- * tests/lib/session.c: #include <config.h> needed for
- ENABLE_THREADS so that sizeof (CamelSessionClass) gives the
- correct size.
-
- * tests/*: Updated to work with camel API changes.
-
-2002-08-16 Dan Winship <danw@ximian.com>
-
- * camel-session.c (get_service): If the passed-in URL contains a
- path, but the service doesn't allow paths, then the path part must
- be a folder name, and we should ignore it here. #29010
-
-2002-08-16 Chris Toshok <toshok@ximian.com>
-
- * camel-arg.h: remove the outer parens from the expansion of
- camel_argv_{start,end} since at least on freebsd va_end is
- #defined to be nothing, so (va_end(..)) causes a syntax error.
-
-2002-08-16 Not Zed <NotZed@Ximian.com>
-
- * providers/imap/camel-imap-store.c (get_folders): Fix the logic
- check for working out if we add inbox or not, we do it if we
- listed the namespace.
-
-2002-08-15 Not Zed <NotZed@Ximian.com>
-
- * camel-store.h (CamelFolderInfo): added a flags field, defined
- some flags, currently only used by imap. This and below is first
- step to getting incremental folder tree loading.
-
- * providers/imap/camel-imap-store.c (get_subscribed_folders): If
- the subscribed list is empty, always add inbox.
- (imap_connect_offline): If the 'storeinfo' namespace isn't the
- same as our own (if its set), then ignore it, assume we changed
- settings. Otherwise you can't change the namespace ...
- (get_folders): allow the env variable CAMEL_IMAP_MAX_DEPTH to
- override the default maximum recursion depth if 10 levels.
- (camel_imap_store_readline): Dont depend the log debug on d(x)
- being defined.
- (get_folder_info_online): changed to use new functions/names.
-
-2002-08-14 Not Zed <NotZed@Ximian.com>
-
- * providers/imap/camel-imap-store.c (get_subscribed_folders):
- Removed the by_hand sillyness. Return an array instead.
- (get_folders): New method to get folders recursively without
- having to use '*'. Uses '%', and stops if it gets too deep
- (current max of 10).
- (get_folder_counts): New method to fill out unread counts on
- folderinfo tree.
- (get_subscribed_folders): Fix some failure logic.
-
- * providers/imap/camel-imap-utils.[ch]: Changed IMAP_LIST_FLAGS to
- use the new CamelFolderInfoFlags directly.
-
-2002-08-09 Peter Williams <peterw@ximian.com>
-
- * providers/imap/camel-imap-folder.c (get_temp_uid): New function,
- generate a UID that has better chances of being unique.
- (imap_append_offline): Use it here.
- (imap_transfer_offline): And here.
-
-2002-08-09 Peter Williams <peterw@ximian.com>
-
- * providers/imap/camel-imap-store.c
- (get_folder_info_online): Tweak how we build the tree based on whether
- a full tree or a subtree is being requested. Fixes subscribe dialog
- on UW servers.
- (get_one_folder_offline): Don't add folders that we're not subscribed
- to; fixes UW folders that weren't being marked as NoSelect because
- the storeinfo doesn't record that information.
-
-2002-08-09 Peter Williams <peterw@ximian.com>
-
- * providers/imap/camel-imap-folder.c (imap_rename): When renaming our
- cache, add the "/folders" to the path.
-
-2002-08-08 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-folder.c (camel_imap_folder_init): Set
- some default permanent_flags. This is the other cause of bug
- #28038.
- (imap_refresh_info): After calling camel_imap_command() with a
- NULL format value (this is a shortcut to change the current_folder
- by SELECTing it), call camel_imap_folder_selected(). This may have
- been why permanent_flags never got set on the folder even after
- going online in bug #28038.
- (imap_update_summary): Same here. Also NULL-guard
- camel_imap_response_free().
-
-2002-08-07 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-utils.c (header_encode_param): Oops - outbuf pointed
- to alloca'd memory but we were g_free'ing it after using
- it. Instead use g_malloc for this outbuf buffer since it may be
- kinda large. Also don't depend on a single byte to nul-terminate
- the outbuf buffer so as to be safe with charsets such as UCS2 and
- UCS4, instead keep a pointer to the end of the buffer.
-
- * providers/imap/camel-imap-folder.c (parse_fetch_response): Only
- add the stream to the gdatalist if it is non-NULL.
-
-2002-08-06 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/sendmail/camel-sendmail-transport.c
- (sendmail_send_to): If writing to the sendmail pipe fails, wait
- for the sendmail process to exit before returning. Fixes bug
- #19636.
-
-2002-08-06 Not Zed <NotZed@Ximian.com>
-
- * providers/pop3/camel-pop3-folder.c (cmd_list): Add messageinfo
- to id table, and store array index in messageinfo too.
- (fi_to_index): Removed, use index member of messageinfo, fixed
- callers.
- (cmd_builduid): Parse the headers of the data, and ignore any
- status or x-status headers.
- (uid_to_fi): Removed, use the hashtable instead.
- (id_to_fi): Same.
- (cmd_uidl): Add messageinfo to uid table.
- (pop3_refresh_info): Setup hash tables, and fill out uid table for
- nonuid capable servers.
- (pop3_finalize): Destroy hash tables. Only free resources if the
- uids table is not null (if finalised before we ran refresh info).
- (id_to_fi): Removed. Use id hash table instead, fixed caller.
-
-2002-08-05 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel.c (camel_init): Always set a g_atexit handler to
- flush/save the camel-certdb.
-
- * providers/imap/camel-imap-store.c (get_folder_info_online): If
- we are asking for the toplevel folders, use the IMAP store's
- namespace as the toplevel folder rather than an empty
- string. Fixes bug #28574.
- (imap_forget_folder): Rearrange the code so that name can never be
- used uninitialised.
-
- * providers/imap/camel-imap-utils.c (imap_namespace_concat):
- Removed.
-
-2002-08-05 Dan Winship <danw@ximian.com>
-
- * camel-folder-summary.h (CamelMessageFlags): Add
- CAMEL_MESSAGE_ANSWERED_ALL, for folders that can distinguish a
- reply-to-sender from a reply-to-all. (eg, Exchange)
-
- * providers/local/camel-local-folder.c (local_init): Add
- ANSWERED_ALL to permanent_flags too.
-
-2002-08-02 Jeffrey Stedfast <fejj@ximian.com>
-
- Fixes bug #26237.
-
- * providers/imap/camel-imap-command.c
- (imap_command_strdup_vprintf): Don't prepend any namespace shit in
- the %F case.
-
- * providers/imap/camel-imap-utils.c (imap_parse_list_response):
- Don't strip off the namespace.
-
-2002-08-01 Peter Williams <peterw@ximian.com>
-
- * providers/imap/camel-imap-store.c (create_folder): If the folder
- name contains the directory separator, reject it.
-
-2002-08-02 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-mbox-summary.c (mbox_summary_check): Clear
- the summary after building the 'removed uid' list.
-
- * camel-folder-summary.c (message_info_load): revert jeff's patch
- below, and do it slightly differently, and stop the auto-reformatting
- bullshit.
-
-2002-08-02 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-maildir-summary.c (message_info_new): If
- we get a duplicate, just re-use the old info.
- (remove_summary): Add any removed to a change list.
- (maildir_summary_check): If we find new ones in 'cur' track them
- in the change list. Removed FIXME about it. For #18348.
-
-2002-08-01 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-folder-summary.c (message_info_load): Do more error
- checking to prevent crashing if we fail to read a string for
- example.
-
-2002-07-29 Peter Williams <peterw@ximian.com>
-
- Fix bug #28238
-
- * providers/imap/camel-imap-store.c (imap_forget_folder): New
- function, breaking out the code in delete_folder() to handle when
- a folder is removed.
- (imap_folder_effectively_unsubscribed): New function, breaking out
- the code in unsubscribe_folder() to handle when a folder is
- unsubscribed.
- (imap_check_folder_still_extant): New function, check whether a
- folder exists by LIST'ing it.
- (imap_store_refresh_folders): Add code here to check if the folder
- still exists if we're unable to refresh its info. If so, pretend
- that it was unsubscribed (to get the mailer to remove it from
- the tree) and delete its cache. If somehow this goofs up, the
- worst that can happen is that we must redownload the headers.
- (get_folder_status): If we can't get the status, behave as above.
- (delete_folder): Call imap_forget_folder() where the bulk of this
- code has gone.
- (unsubscribe_folder): Call imap_folder_effectively_unsubscribed()
- where the bulk of this code has gone.
-
-2002-07-31 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-folder.c (parse_fetch_response):
- Disable my fix to not cache headers as it means that each time we
- load the message, we've got to re-fecth the headers.
-
- * camel-mime-filter-tohtml.c (is_addr_char): Don't use
- "isprint(c)" to mean "c >= 32 && c < 128" since it doesn't in most
- locales.
- (is_url_char): Same.
- (is_trailing_garbage): Same.
- (is_domain_name_char): New macro for dns-valid characters
- (email_address_extract): Use is_domain_name_char rather than
- is_addr_char for the part after the @.
-
-2002-07-30 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-tcp-stream.c (camel_tcp_address_new): Update the comment.
-
- * camel-tcp-stream-raw.c (socket_connect): If building with IPv6
- support and the address is an IPv6 address, connect using a
- sockaddr_in6 otherwise use the standard IPv4 sockaddr_in
- structure.
- (stream_get_local_address): Fix to work with IPv6 addresses.
- (stream_get_remote_address): Same.
-
- * camel-tcp-stream-openssl.c (socket_connect): Same as above.
- (stream_get_local_address): Fix to work with IPv6 addresses.
- (stream_get_remote_address): Same.
-
- * camel-tcp-stream-ssl.c (stream_connect): If building with IPv6
- support and the address is an IPv6 address, initialise the
- PRNetAddr accordingly.
- (stream_get_local_address): Fix to work with IPv6 addresses.
- (stream_get_remote_address): Same.
-
-2002-07-30 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-tcp-stream-openssl.c (ssl_verify): X509_digest() needs a
- pointer to an int len. Also fixed some other compiler errors.
-
- * camel-certdb.h: #include <stdio.h>
-
-2002-07-30 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-certdb.c: New source file implementing a very basic
- certificate database. This is mostly just here because the Mozilla
- NSS certdb seems to not be working for everyone's Evolution
- install (works fine for me and Ettore but not many other people).
-
- * camel-tcp-stream-ssl.c (ssl_bad_cert): If we have this
- certificate in our own CamelCertDB, then get the trust value from
- that and only prompt the user if the trust is unknown.
-
- * camel-tcp-stream-openssl.c (ssl_verify): Same.
-
- * camel.c (camel_init): Create our default certdb.
-
-2002-07-30 Peter Williams <peterw@ximian.com>
-
- * providers/imap/camel-imap-folder.c (imap_transfer_offline): Use
- the same command-counter mojo that the append code uses in case
- the use tries to copy the same message to the folder repeatedly.
-
-2002-07-29 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-filter-driver.c (unset_flag): New filter action to unset a
- system flag. The exact opposite of set_flag.
-
-2002-07-26 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/local/camel-local-store.c (get_folder): If the path
- exists and is a directory, return non-NULL. Missed this before
- which is how we could return NULL even on success. Oops.
-
-2002-07-26 Peter Williams <peterw@ximian.com>
-
- * providers/imap/camel-imap-summary.c
- (camel_imap_summary_add_offline_uncached): The flags'n'tags
- copy was unnecessary. Removed it.
-
-2002-07-25 Jeffrey Stedfast <fejj@ximian.com>
-
- If we're gonna do an elite hack, lets do it right.
-
- * providers/local/camel-local-store.c (get_folder): On success,
- return non-NULL so that our caller doesn't have to depend on 'ex'
- being non-NULL in order to work correctly.
-
- * providers/local/camel-mbox-store.c (get_folder): Don't bother
- checking if an exception was set, just use the return value of
- camel-local-store's get_folder.
-
- * providers/local/camel-maildir-store.c (get_folder): Same as the
- mbox change.
-
- * providers/local/camel-mh-store.c (get_folder): Here too.
-
-2002-07-25 Peter Williams <peterw@ximian.com>
-
- * providers/imap/camel-imap-summary.h
- (camel_imap_summary_add_offline_uncached): Prototype.
-
- * providers/imap/camel-imap-summary.c
- (camel_imap_summary_add_offline_uncached): New function to add an
- uncached message to the summary while offline.
-
- * providers/imap/camel-imap-store.c (imap_connect_online): Only
- refresh the folders if the disco diary is empty (ie, we're not
- resyncing.)
-
- * providers/imap/camel-imap-folder.c (imap_transfer_offline): Emit
- an event for the source if deleting its originals. Also, if we
- can't load the message, still process it, using the new imap
- summary function.
-
-2002-07-25 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/smtp/camel-smtp-transport.c: Remove "possibly
- non-fatal" exception strings, all exceptions are fatal unless
- their caller decides otherwise.
- (connect_to_server): If smtp_helo() fails due to us getting
- disconnected, treat the exception as fatal.
- (smtp_connect): Abort if smtp_helo() fails and we got
- disconnected.
- (smtp_send_to): If smtp_mail() fails, abort the send operation.
- (smtp_set_exception): If respbuf was NULL, then we got
- disconnected and so update our state accordingly.
- (smtp_disconnect): Only send a QUIT if we are still in the
- connected state (or, at least think we are).
-
-2002-07-24 Peter Williams <peterw@ximian.com>
-
- * providers/imap/camel-imap-folder.c
- (imap_expunge_uids_resyncing): It would help to mark the UIDs as
- deleted before we try to expunge them
- (in the case when no other UIDs were marked deleted this didn't
- happen.) Also fix an FMR.
- (imap_expunge_uids_offline): Trigger a folder_changed event with
- our own changeinfo because camel_imap_response_free won't be able
- to do that for us.
-
-2002-07-25 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-filter-driver.c (do_shell): Renamed from
- shell_exec(). Also, we now want to pass argc/argv on to the
- CamelFilterDriverShellFunc.
- (camel_filter_driver_set_shell_func): Renamed a bit.
-
- * camel-filter-search.c (pipe_message): Renamed from shell_exec().
-
-2002-07-25 Not Zed <NotZed@Ximian.com>
-
- * camel-folder-summary.c (camel_folder_summary_save): When writing
- the summary, use TRUNC flag, duh. Also, write to a temp file
- first, and rename when closed successfully, and check ferror() and
- fclose() against 0 rather than -1.
-
- * providers/local/camel-mbox-summary.c (summary_update): Decrement
- i if we remove the summary item so we dont skip every 2nd one.
-
- * camel-mime-utils.c (header_decode_mailbox): Use
- rfc2047_decode_word explicitly incase we just found an encoded
- word. Stops us re-decoding the string twice, which fixes memory
- corruption in #26330 when the HUGE string is used later.
-
-2002-07-24 Not Zed <NotZed@Ximian.com>
-
- * camel-partition-table.c (camel_key_table_next): Didn't unlock if
- we exited on an empty key list.
-
- * providers/imap/camel-imap-folder.c (imap_expunge_uids_online):
- Sync before doing an expunge if we dont have uidplus. See #25766.
- (imap_expunge_uids_resyncing): Same here.
-
- * providers/imap/camel-imap-store.c (get_folder_info_online):
- Duplicated the very much hack in imap_store_refresh_folders() to
- avoid a deadlock in #27959. A decent fix has to wait for a
- rewrite.
- (get_folder_online): Move folders to a subdirectory of
- storage_path, rather than in it. Bye bye everyones settings. See
- 24947.
- (get_folder_offline): And here too.
- (delete_folder): And here too.
- (rename_folder): and here too.
- (get_folder_info_offline): And here too. I love code reuse.
-
-2002-07-23 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-tcp-stream.c: #include <string.h> for memcpy.
-
-2002-07-22 Not Zed <NotZed@Ximian.com>
-
- * camel-vee-folder.c (vee_set_message_user_tag): Oops, forgot to
- implement this. Fixes #24604.
-
-2002-07-21 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-filter-crlf.c (filter): Only add a \r if the
- character before the \n wasn't already a \r - this covers for when
- people add DOS files as attachments. Fixes bug #28056.
-
-2002-07-19 Not Zed <NotZed@Ximian.com>
-
- * camel-mime-part-utils.c (convert_buffer): Changed to use a
- different length calculator.
-
-2002-07-17 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-lock.c: Add the appropriate #include for the _() macro.
-
-2002-07-17 Not Zed <NotZed@Ximian.com>
-
- * providers/pop3/camel-pop3-store.c (pop3_try_authenticate): Got
- rid of the stupid "tryagain" semantics, which didn't work.
- (pop3_connect): Fixed here to only retry under proper conditions.
-
-2002-07-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-filter-canon.c (filter): When CRLF encoding, "empty"
- (after stripping trailing whitespace characters) lines need to end
- in CRLF also, not just lines with data in them.
-
-2002-07-16 Peter Williams <peterw@ximian.com>
-
- * providers/imap/camel-imap-folder.c (imap_sync_online): Clean
- up some improper usage of CamelExceptions (looking at
- camel_exception_is_set when ex = NULL).
-
- * providers/imap/camel-imap-store.c (get_folder_online): Here too.
-
- * providers/imap/camel-imap-message-cache.c
- (camel_imap_message_cache_new): Nothing sets the exception so
- don't bother to check it at the end of this function. Prevents
- a warning about checking a NULL exception's value.
-
-2002-07-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/smtp/camel-smtp-transport.c (smtp_helo): Make the
- standard AUTH format take priority over the AUTH= priority, since
- sometimes servers only list a subset of the supported authtypes in
- the AUTH= response while they list all authtypes in the standard
- AUTH response. Fixes "bug" #27841.
-
-2002-07-15 Peter Williams <peterw@ximian.com>
-
- * providers/imap/camel-imap-folder.c (imap_get_message): If we're
- not online and the message isn't in our cache, give up.
-
-2002-07-15 Not Zed <NotZed@Ximian.com>
-
- * camel-filter-search.c (get_label): Removed.
- (get_score): Removed. Labels & scores are stored in tags, we
- already have a function to get tags.
- (user_tag): Fail if we dont get valid arguments, it must be a
- string type.
- (system_flag): Same here.
-
-2002-07-15 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-utils.c (header_msgid_generate): Try to get the FQDN
- from the results of gethostname(). If that fails, then fall back
- to the results gotten from gethostname() or if that fails just use
- "localhost.localdomain". Addresses bug #17416.
- (header_decode_param): Protect against a NULL value.
-
- * providers/smtp/camel-smtp-transport.c (smtp_data): Get rid of
- the constant 'required' variable, just use the value when calling
- set_best_encoding.
-
- * providers/local/camel-local-provider.c: Changed the mbox and
- spool provider descriptions to try and be more clear. I'm not sure
- I like the mention of Evolution in the mbox provider description,
- but there was no other way to make it clear that it MOVED mail out
- of the mbox folder into a folder managed by Evolution without
- mentioning Evolution. *sigh* Anyways, to me "retrieve" means move,
- but apparently this isn't clear to the weak minded.
-
-2002-07-15 Peter Williams <peterw@ximian.com>
-
- * providers/imap/camel-imap-folder.c (imap_rescan): >= is not
- appropriate here because the sequences are 1-based; so seq =
- summary_len is valid. Hopefully addresses 15646, because this
- caused the last message in a folder to be reloaded, replacing its
- CamelMessageInfo, and the tree view was using the old
- CamelMessageInfo.
-
-2002-07-13 Not Zed <NotZed@Ximian.com>
-
- * camel-folder-summary.c
- (camel_folder_summary_info_new_from_message): Only assign a uid if
- indexing is enabled. This stops us always assigning a uid in the
- imap folder and disco folder?
-
- * providers/imap/camel-imap-folder.c (imap_update_summary): Also
- check the uid is set at all, another bit of a fix for #15667.
-
-2002-07-09 Not Zed <NotZed@Ximian.com>
-
- * providers/imap/camel-imap-folder.c (imap_update_summary): Check
- for existing messages of the same uid before doing anything. If
- it exists, do nothing (perhaps it should merge?). A dirty hack for
- #15667.
-
-2002-07-12 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-multipart-encrypted.c (camel_multipart_encrypted_decrypt):
- On error, do not unref the parts gotten using
- camel_multipart_get_part() since that function does not ref the
- parts. Also don't forget to reset the decrypted stream before
- trying to parse it ;-)
-
-2002-07-12 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-multipart.c (camel_multipart_class_init): Updated to not
- use camel_type_get_global_classfuncs() since this is just a cast
- macro now.
-
- * providers/imap/camel-imap-folder.c (get_content): Handle
- multipart/encrypted parts too.
-
- * camel-mime-part-utils.c
- (camel_mime_part_construct_content_from_parser): Handle
- multipart/encrypted types too.
-
-2002-07-11 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/smtp/camel-smtp-transport.c (smtp_data): Don't let any
- parts have a binary encoding.
-
-2002-07-11 Jeffrey Stedfast <fejj@ximian.com>
-
- Fixes bug #27672
-
- * camel-mime-filter-bestenc.c: Conditionally #include <config.h>
-
- * camel-mime-filter-linewrap.c: Same here... although we could
- probably just get rid of this filter? We don't seem to use it
- anywhere since we try to QP/Base64 encode any text parts with long
- lines. Besides, we couldn't use this filter for SMTP anyway since
- we can't risk possibly linewrapping a binary mime part. I dunno,
- maybe this could be useful in the composer though? *shrug*
-
- * providers/smtp/camel-smtp-transport.c (smtp_data): Always call
- camel_mime_message_set_best_encoding() even if the server allows
- 8BITMIME and even if we don't have any 8bit parts because we may
- have parts with long lines (>998 octets) which also need to be
- encoded.
-
- * camel-mime-message.c (check_8bit): Don't forget to check for the
- binary encoding here as well.
-
-2002-07-11 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-folder.c (parse_fetch_response): If we
- are fetching HEADERs, don't cache the stream - instead just create
- a mem-stream and return that. This reduces a significant amount of
- overhead due to disk i/o.
-
- * camel-multipart-encrypted.c (camel_multipart_encrypted_decrypt):
- Don't forget to set an appropriate exception before returning
- NULL.
-
-2002-07-10 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-filter-driver.c (get_message_cb): Make sure message is
- non-NULL before setting the source on it.
-
- * camel-gpg-context.c: Renamed stdin to stdin_fd, stdout to
- stdout_fd, and stderr to stderr_fd in struct _GpgCtx since
- Solaris' stdin/stdout/etderr variables seem to be macros and are
- thus breaking the compilation.
-
-2002-07-04 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/nntp/camel-nntp-provider.c: Set the IS_SOURCE provider
- flag.
-
- * providers/pop3/camel-pop3-store.c: Change all exceptions to
- report which POP server failed (and tried to make a few of the
- exceptions a bit more clear).
-
-2002-07-03 Not Zed <NotZed@Ximian.com>
-
- * camel-vee-folder.c (vee_sync): If we get an exception from the
- child sync, update the exception string so we know where it really
- was.
-
- * camel-vee-store.c (change_folder): Util to emit created/deleted
- events.
- (vee_get_folder): If the folder has path elements, and its parents
- dont exist, create dummy no-select nodes. This is for bug #4246.
- (vee_delete_folder): Use change_folder() to save code.
-
- * providers/local/camel-mbox-folder.c (mbox_set_message_flags):
- Only set xevchange if we're storing status headers in pine format,
- so we dont do a full sync every time any flag changes.
-
-2002-06-27 Not Zed <NotZed@Ximian.com>
-
- * camel-object.c (camel_object_hook_event): Take a void object arg.
- (camel_object_remove_event): "
- (camel_object_unhook_event): "
- (camel_object_trigger_event): ", also, execute events in the same
- order they were added, i.e. reverse hook-list order.
-
-2002-06-28 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-gpg-context.c (gpg_ctx_get_argv): Don't use
- --no-auto-key-retrieve, this option has apparently been deprecated
- in gpg 1.0.7.
-
-2002-06-27 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-gpg-context.c (gpg_ctx_op_step): Loop on our reads while
- errno is EINTR or EAGAIN. Also make sure to completely read stdout
- and stderr by keeping better state.
- (gpg_ctx_parse_status): In the case of a NODATA response from gpg,
- try to use the diagnostics that gpg may have written to its
- stderr.
- (gpg_verify): Check that the gpg process has not exited.
- (gpg_ctx_op_wait): Make sure we haven't already exited (as by
- gpg_ctx_op_is_exited()) and if we have, retrieve the exit status
- from the gpg context.
-
-2002-06-26 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-pgp-context.[c,h]: Removed.
-
- * camel-pgp-mime.c (pgp_mime_part_sign_restore_part): Removed.
- (pgp_mime_part_sign_prepare_part): Removed.
- (camel_pgp_mime_part_sign): Removed.
- (camel_pgp_mime_part_verify): Removed.
- (camel_pgp_mime_part_encrypt): Removed.
- (camel_pgp_mime_part_decrypt): Removed.
- (camel_pgp_mime_is_rfc2015_signed): Documented.
- (camel_pgp_mime_is_rfc2015_encrypted): Same.
-
-2002-06-26 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-multipart-encrypted.c (camel_multipart_encrypted_encrypt):
- Oops, this needs to take a userid argument.
-
- * camel-gpg-context.c (gpg_clearsign): Removed (never did anything
- anyway).
-
- * camel-pgp-context.c (pgp_clearsign): Removed.
-
- * camel-cipher-context.c (camel_cipher_clearsign): Removed unused
- method.
-
- * camel-multipart-encrypted.[c,h]: New class implementing the
- multipart/encrypted content type. Contains methods for encrypting
- and decrypting a multipart/encrypted MIME object.
-
- * camel-gpg-context.c (gpg_ctx_parse_status): Check for NODATA
- too.
-
-2002-06-25 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/local/camel-local-provider.c: Remove the #include for
- camel-spoold-store.h
-
-2002-06-26 Not Zed <NotZed@Ximian.com>
-
- * camel-gpg-context.c: Include <sys/time.h> for struct timeval.
-
- * providers/local/camel-local-provider.c
- (camel_provider_module_init): Removed spoold provider. The spool
- provider does it now.
- (): Spoold doesn't exist anymore, remove its header.
-
-2002-06-25 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-spool-folder.c (camel_spool_folder_new):
- Support a new xstatus option - folders update/honour the
- Status/X-Status headers in addition to X-Evolution.
-
- * providers/local/camel-local-summary.c
- (camel_local_summary_write_headers): If supplied with an
- additional status or xstatus arg, write a Status header and/or
- X-Status. Also fix the case of properly terminating the headers
- if an xev line isn't supplied.
-
- * providers/local/Makefile.am (libcamellocalinclude_HEADERS,SOURCES):
- Removed spoold-store.[ch].
-
- * providers/local/camel-local-provider.c
- (camel_provider_module_init): For the spoold type, just use the
- spool store instead.
-
- * providers/local/camel-spool-store.h: Added a type field, so the
- 1 store can implement different types without having to subclass.
-
- * providers/local/camel-spool-store.c
- (camel_spool_store_get_toplevel_dir): Removed, inherits from local
- store now.
- (construct): If we're pointing to a file, treat it as mbox mode,
- otherwise treat it as 'elm' mode.
- (get_folder): Only test for INBOX in mbox mode.
- (get_folder_info_elm):
- (get_folder_info_mbox): Two alternatives for getting folder info,
- depending on the type of folder we're looking at.
- (get_folder_info_mbox): Make the url include the protocol.
- (scan_dir): "
-
- * providers/local/camel-spoold-store.c
- (camel_spoold_store_get_toplevel_dir): Removed, inherits from
- local store now.
-
- * camel-folder.c (get_message_user_tag): Dont use a
- g_return_if_fail for info==NULL. This is not an error.
- (set_message_user_tag): And same here.
- (set_message_user_flag): Sigh, and here.
- (get_message_user_flag): And here.
- (set_message_flags): and here ...
- (get_message_flags): Dum de dum, de done at last.
-
- * providers/local/camel-mbox-folder.c (mbox_get_message): Check
- for new messages whenever we retrieve one. In the common
- no-update case, this is a single stat.
- (mbox_get_message): If we need to rescan, then force a full rescan
- to make sure it does the right thing.
- (mbox_get_message): Cleanup the exception handling a bit, if we do
- get an error, propagate any folder changes anyway as well.
- (mbox_set_message_user_flag): Argh more of these stupid g_returns
- taht shouldn't be.
- (mbox_set_message_user_tag): Here too.
- (mbox_set_message_flags): If the read flag is being changed, mark
- it as an xevchange (i.e. Status line change).
-
- * providers/local/camel-mbox-summary.c (summary_rebuild): Merged
- into summary_update.
- (summary_update): Changed to allow it to update existing lists of
- messages without clearing out the summary.
- (mbox_summary_check): Dont clear the summary, just re-scan.
- (message_info_new): Attempt to support the 'Status: RO' elm/pine
- thing.
- (camel_mbox_summary_encode_status):
- (camel_mbox_summary_decode_status): Util functions for
- creating/parsing the Status line.
- (camel_mbox_summary_sync_mbox): Write out the status line if we're
- going to try support it.
- (camel_mbox_summary_xstatus): Implement option to control
- read/write of (x-)status.
- (message_info_new): Do x-status stuff based on run-time option.
- (camel_mbox_summary_sync_mbox): "
- (mbox_summary_add): If x-status enabled, then always add
- status/x-status headers to message.
-
- * camel-folder-summary.c (summary_assign_uid): If the messageinfo
- is already in the summary, AND is the same messageinfo, dont do
- anything, return a value to indicate this.
- (camel_folder_summary_add): Do nothing if this info already in the
- summary, so we can perform updates.
-
-2002-06-24 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-local-summary.c
- (camel_local_summary_check_force): New method to force the next
- summary check to be a full check, set if a mismatch occurs.
-
- * camel-folder-summary.c (camel_folder_summary_load): If we have
- no summary path set, dont do any i/o, rather than abort.
- (camel_folder_summary_save): "
- (camel_folder_summary_header_load): "
-
- * providers/local/camel-spool-store.h: Inherit from camel mbox
- store, even if we override almost everything.
-
- * providers/local/camel-local-folder.c
- (camel_local_folder_construct): If the base path points to a file,
- use that as the folder path as well.
-
- * providers/local/camel-spool-folder.h: Inherit from
- camel-mbox-folder.
-
- * providers/local/camel-spool-summary.c (spool_summary_sync_full):
- Use camel_mbox_summary_sync_mbox to do most of the work.
-
- * providers/local/camel-spool-summary.[ch]: Make spool-summary
- inherit from mbox summary rather than foldersummary.
-
- * providers/local/camel-mbox-summary.c (mbox_summary_sync): Make
- sync_full/quick virtual methods.
- (camel_mbox_summary_sync_mbox): The full sync method put into a
- simple function that sync's from fd to fd.
- (mbox_summary_sync_full): Use summary_sync_mbox to do the real
- work.
- (mbox_summary_check): Create removed events if the folder gets
- cleared. Also, dont clear the summary before a rebuild, try to
- merge.
-
-2002-06-25 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-gpg-context.c: #include <sys/time.h>
-
-2002-06-25 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-gpg-context.c (gpg_hash_str): Return the option as
- --digest-algo=<micalg>
- (gpg_ctx_parse_status): Decode more status information and keep
- track of trust and such.
- (gpg_ctx_op_complete): Make sure we aren't waiting for gpg to
- write data to stdout (such as encrypted/decrypted data or a
- signature).
- (gpg_encrypt): Remove the fejj@stampede.org hard-coded value
- (which had only meant to be for testing).
-
-2002-06-24 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-gpg-context.c (gpg_ctx_get_argv): Use --command-fd rather
- than --passphrase-fd since what we really want is an interactive
- mode (besides, --passphrase-fd requires a passphrase to be sent
- before --status-fd will send a NEED_PASSPHRASE status message).
- (gpg_ctx_parse_status): When we encounter a BAD_PASSPHRASE, tell
- the session to uncache it.
- (camel_gpg_context_set_always_trust): Implemented.
-
-2002-06-23 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-gpg-context.c (gpg_ctx_parse_status): Check for ERRSIG
- also.
- (gpg_ctx_op_step): Don't try writing a passphrase unless our
- operation requires it.
-
-2002-06-22 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-gpg-context.c (gpg_encrypt): Return -1 on error.
- (gpg_decrypt): Same.
- (gpg_sign): Again here.
- (gpg_ctx_op_step): Only attenmpt to read from the status-fd if we
- are not already 'complete'.
-
- * camel-pgp-mime.c (camel_pgp_mime_part_encrypt): Flush the
- filtered stream.
-
-2002-06-21 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-gpg-context.[c,h]: New source files implementing the
- CamelCipherContext class for gnupg.
-
- * camel-pgp-context.c (camel_pgp_context_new): Return a
- CamelCipherContext.
-
- * camel-pgp-mime.c (camel_pgp_mime_part_decrypt): Take a
- CamelCipherContext argument rather than a CamelPgpContext since we
- now have a CamelGpgContext also.
- (camel_pgp_mime_part_encrypt): Same.
- (camel_pgp_mime_part_verify): Same.
- (camel_pgp_mime_part_sign): Same.
-
-2002-06-20 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-digest-folder.c: Updated to support searching as well as
- making it use CamelDigestSummary.
-
- * camel-digest-summary.[c,h]: New class to handle the summary for
- CamelDigestFolder.
-
- * camel-tcp-stream-ssl.c (set_errno): PR_IO_TIMEOUT_ERROR should
- map to ETIMEDOUT and not EAGAIN.
- (stream_connect): Reset the PR_Poll() timeout back to 2 minutes as
- this wasn't the problem afterall.
-
-2002-06-19 Not Zed <NotZed@Ximian.com>
-
- * camel-mime-parser.c (folder_scan_drop_step): Drop back to
- initial state if we came from eof state.
-
-2002-06-19 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-tcp-stream-ssl.c (stream_connect): Set the poll timeout to
- be PR_INTERVAL_MIN, this one shouldn't need to be 2 minutes (plus
- it blocks my connection at home for far too long).
-
- * providers/imap/camel-imap-folder.c (imap_refresh_info): Make
- sure we hold the command_lock before accessing current_folder.
- (imap_append_online): Same.
- (imap_transfer_online): Same.
-
- * providers/imap/camel-imap-store.c (delete_folder): We need to
- hold the command_lock before we can set the current_folder to
- NULL.
- (rename_folder): Same.
- (get_folder_info_online): We need to make sure we hold the
- command_lock in order to use current_folder.
- (everywhere): Same.
-
-2002-06-19 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/smtp/camel-smtp-transport.c (smtp_connect): Don't
- bother trying to authenticate (and thus don't throw up an error
- dialog) unless the server is an ESMTP server and supports
- authentication.
-
- * camel-sasl-plain.c: Change the user-friendly name to PLAIN, this
- is what it should be. Not "Password" because user's immediately
- think that they need authentication when they see "Password" even
- if they don't need it at all.
-
-2002-06-17 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-vee-folder.c (camel_vee_folder_add_folder): Update the
- freeze state of the new source folder.
- (camel_vee_folder_remove_folder): Undo any freeze state that we
- have imposed on this source folder.
-
-2002-06-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-vee-folder.c (vee_freeze): Freeze source folders.
- (vee_thaw): Thaw all source folders. Fixes bug #24317.
-
- * providers/imap/camel-imap-folder.c (imap_sync_online): Unlock
- the command_lock after each UID STORE command so that other
- (probably more important) threads can send their requests.
-
- * camel-arg.c:
- * camel-disco-diary.c:
- * camel-index-control.c:
- * camel-mime-part.c:
- * camel-pgp-mime.c:
- * camel-store.c:
- * camel-tcp-stream-ssl.c:
- * camel-text-index.c: Fixed compiler warnings.
-
- * camel-multipart-signed.c: Updated to use ctx->sign_protocol
- rather than ctx->protocol.
-
- * camel-cipher-context.h: Add an ecnryption protocol member.
-
- * camel-pgp-context.c (camel_pgp_context_init): Set the encryption
- protocol.
-
-2002-06-11 Not Zed <NotZed@Ximian.com>
-
- * camel-vtrash-folder.c (camel_vtrash_folder_class_init): Our
- parent class is camel_vee_folder, not camel_folder, fix setting of
- parent folder (unused anyway, but removes a run-time warning).
-
-2002-06-07 Not Zed <NotZed@Ximian.com>
-
- * camel-pgp-context.c (camel_pgp_context_init): Duh! The protocol
- is application/pgp-signature. TODO: need to have a signed and an
- encrypted protocol specified separately.
-
-2002-06-06 Not Zed <NotZed@Ximian.com>
-
- * camel-folder-thread.c (thread_summary): Do the work here.
- (camel_folder_thread_messages_remove): Implement. Remove some
- uid's from the tree. Disalbe from build, for now.
- (remove_uid_node_rec): Actually do the work.
- (camel_folder_thread_messages_add): Implement. Add some summary
- items to the tree. Disable from build though.
- (camel_folder_thread_messages_apply): Make a thread tree built
- using camel_folder_thread_new() map to a new set of uids,
- preserving some order. Meant primarily to manage deleted + added
- uids in a user-friendly manner.
-
-2002-06-09 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-multipart-signed.c (camel_multipart_signed_verify): Use
- CAMEL_EXCEPTION_SYSTEM rather than '1' for clarity.
-
-2002-06-07 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-tcp-stream-ssl.c (stream_connect): Up the timeout on the
- connect code to 2 minutes.
-
-2002-06-05 Dan Winship <danw@ximian.com>
-
- * camel-mime-utils.c (header_decode_mailbox): Parse
- "From: Dan Winship <danw>" (with no domain) in the way the sender
- meant it, even though it's completely wrong.
-
-2002-06-04 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-local-provider.c: Remove the
- CONF_DEFAULT_PATH entry, as this is handled by the url config
- stuff. This made it basically impossible to configure any local
- folder from the gui.
-
- * providers/local/camel-local-folder.c (local_refresh_info): Force
- a refresh. Should work for all local folders to force them to
- refresh.
-
- * providers/local/camel-maildir-folder.c (maildir_refresh_info):
- Removed, moved into camel-local-folder.
-
- * providers/local/camel-mh-summary.c (mh_summary_next_uid_string):
- Once we assign or get a uid, tell the summary of this, so the next
- uid we get will be higher than any previously.
-
- * camel-object.c (camel_object_ref, camel_object_unref): I got
- sick of casting, these now take void * like they should, and
- perform their own run-time type checking.
-
- * providers/local/camel-mh-store.c (recursive_scan): Changed to
- use stat, not lstat (*shrug* maybe someone wants to softlink their
- maildir tree?).
- (inode_hash):
- (inode_equal):
- (inode_free): Copied from camel-maildir store (should put into
- camel-local-store or utils?).
- (recursive_scan): Changed to check for re-visiting inodes. Also,
- it builds the tree itself, rather than using folder_info_build.
- (add_folder): Changed to folder_info_new.
- (recursive_scan): Properly honour the recursive flag. Also,
- lookup unread count from folder.
- (folder_info_new): Init unread message count to -1, since we dont
- know yet.
- (folder_info_new): Take the name as an argument, and perform the
- merging here.
- (folders_update): Util func to add/remove folders from .folders
- file. I'm assuming its sorted.
- (get_folder): Add the folder to .folders if we created a new one,
- and if it exists.
- (delete_folder): Remove from .folders, etc.
- (folders_scan): If we have a .folders file, read and use that
- instead.
- (recursive_scan): Handle scanning from a particular directory
- properly.
- (rename_folder): Implement so we can track any changes to the
- .folders file if its turned on.
-
- ** Applied patch below from Greg Hudson.
-
-2002-05-10 Greg Hudson <ghudson@mit.edu>
-
- * camel-mh-store.c (get_inbox, get_folder_info, recursive_scan,
- add_folder): Implement support for MH stores.
-
- * camel-mh-summary.c (mh_summary_check, sort_uid_cmp): Sort MH
- messages by message number (uid), like we sort maildir messages by
- date.
-
- * camel-local-provider.c (mh_provider): Turn on source and store
- flags.
-
-2002-06-03 Not Zed <NotZed@Ximian.com>
-
- * camel-vee-folder.c (camel_vee_folder_add_folder):
- (folder_changed_change):
- (folder_changed_remove_uid):
- (folder_changed_add_uid):
- (vee_folder_build_folder): Check that any unmatched operation is
- not concerning any vfolder. Other vfolders should never be part of any
- unmatched handling. For #24615, and others probably.
-
-2002-06-02 Not Zed <NotZed@Ximian.com>
-
- * camel-sasl.c (camel_sasl_new):
- (camel_sasl_finalize): setup/free the mech string.
-
- * camel-sasl.h: Added 'mech' mechanism string.
-
-2002-06-01 Not Zed <NotZed@Ximian.com>
-
- * providers/imap/camel-imap-folder.c (imap_getv): Implement. Only
- the object_description arg.
- (camel_imap_folder_get_type): Init parent_class holder.
-
- * providers/local/camel-local-folder.c (local_getv): Implement,
- object_description arg.
-
- * camel-folder.c (folder_getv): Implement, add a bunch of args you
- can get -> camel_folder_get_unread_count etc will be going RSN i
- hope.
- (camel_folder_finalize): Free cached description string.
-
- * camel-object.c (cobject_getv): Implement
- CAMEL_OBJECT_ARG_DESCRIPTION, just return the classname of the
- object.
- (camel_object_getv):
- (camel_object_get):
- (camel_object_setv):
- (camel_object_set): Take object = void *, to simplify usage.
- (camel_object_setv): Removed unecessary locals.
- (camel_object_getv): Same.
- (camel_object_free): New method, free an arg, upto implementations
- whether args are static/const or not.
- (cobject_free): Implement a dummy do nothing free.
-
-2002-05-31 Not Zed <NotZed@Ximian.com>
-
- * camel-vee-folder.c (camel_vee_folder_get_location): new function
- to get the real location (folder) (and uid) of a vfolder object.
- Using the folderinfo, since we already have it, maybe it should
- use the uid.
-
-2002-05-31 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-folder.c (get_content): When the part
- is a multipart/signed, make sure to free the part_spec before
- returning (the other types already did this properly).
-
- * providers/imap/camel-imap-message-cache.c
- (camel_imap_message_cache_get): Free the path buffer when we're
- done with it.
-
- * providers/imap/camel-imap-folder.c (imap_update_summary): Free
- the final tagged response buffer.
-
- * providers/imap/camel-imap-command.c (imap_read_untagged): If we
- fail to read a literal, free the temporary string buffer.
-
- * providers/imap/camel-imap-folder.c (imap_rescan): Revert my fix
- from the other day since camel_imap_command_response() doesn't
- guarentee that resp will be set to NULL on error.
-
- * camel-data-cache.c (camel_data_cache_get): If we fail to be able
- to create a stream to insert into the cache, then free the 'real'
- path.
-
-2002-05-30 Not Zed <NotZed@Ximian.com>
-
- * camel-cipher-context.h: Added a protocol field for users to use.
-
- * camel-stream-filter.c (do_read): Sigh, the pre-size is READ_PAD
- not READ_SIZE. Big difference.
- (READ_PAD): Bumped upto 128 from 64, so we can fit a typical line
- in full.
-
- * providers/imap/camel-imap-folder.c (get_content): Changed to
- load multipart/signed as an opaque block into the right kind of
- object.
-
- * camel-multipart.h (struct _CamelMultipart): Removed the boundary
- field. It wans't actually used anywhere.
-
- * camel-seekable-substream.c
- (camel_seekable_substream_new_with_seekable_stream_and_bounds):
- Shortened this stupidly long name to just :new(), its the only way
- its ever used. Fixed all callers.
-
- * camel-multipart-signed.[ch]: new wrapper for multipart/signed
- types. We need to treat the entire content as a blob of data for
- transport purposes. This also cleans up a lot of the sign/verify
- handling.
-
- * camel-mime-part-utils.c
- (camel_mime_part_construct_content_from_parser): Just call
- camel_multipart_construct_from_parser for multipart parts, also
- use a multipart_signed for multipart/signed types.
-
- * camel-multipart.c (camel_multipart_construct_from_parser): New
- virtual function for multiparts to buld themselves.
- (construct_from_parser): Implement for normal multiparts.
- (toplevel): Got rid of a warning, it'll never be an abstract
- class.
-
- * camel-pgp-context.c (pgp_hash_to_id):
- (pgp_id_to_hash): Implement.
- (camel_pgp_context_init): Init the pgp protocol specifier.
-
- * camel-cipher-context.c (camel_cipher_id_to_hash):
- (camel_cipher_hash_to_id): Util virtual methods to handle the
- cipher id string.
-
- * camel-mime-filter-canon.[ch]: A new filter, end/start of line
- canonicalisation filter. Can escape "From " and strip trailing
- whitespace, and canonicalise the end of line to crlf or to lf.
-
-2002-05-29 Not Zed <NotZed@Ximian.com>
-
- * camel-multipart.h (struct _CamelMultipart): Removed the
- 'parent', nothing used it, anywhere. Cleaned up some formatting
- slightly.
-
-2002-05-30 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-store.c (camel_imap_store_readline):
- On error, don't leak the GByteArray buffer.
-
- * providers/imap/camel-imap-folder.c (imap_rescan): Free the
- response before checking for errors. I'm not sure this'll actually
- fix the memory leak here, but it might? Certainly can't hurt.
-
- * camel-block-file.c (camel_block_file_finalise): Destroy the
- blocks hash table.
-
-2002-05-29 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-store.c (connect_to_server): Only free
- the LOGOUT response if it is non-NULL.
-
-2002-05-28 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-maildir-folder.c (maildir_refresh_info):
- Implement. Run a summary check to update for any newly arrived
- messages.
-
- * providers/local/camel-maildir-store.c (scan_dir): If we have a
- folder, execute a refresh_info on it, to suck in any new stuff.
-
-2002-05-28 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-filter-driver.c (camel_filter_driver_log): Use the
- CamelMessageInfo rather than the CamelMimeMessage because the
- message may not have been loaded (thus NULL).
-
-2002-05-27 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/smtp/camel-smtp-transport.c (connect_to_server): On
- connection failure, unref the tcp stream.
-
- * providers/pop3/camel-pop3-store.c (connect_to_server): On
- connection failure, unref the tcp stream.
-
- * providers/imap/camel-imap-store.c (connect_to_server): On
- connection failure, unref the tcp stream.
-
- * providers/nntp/camel-nntp-store.c (nntp_store_query_auth_types):
- Our parent class is no longer CamelRemoteStore.
- (nntp_store_init): Same.
- (camel_nntp_store_get_type): Here too.
- (nntp_connect): Rewritten to try to connect via SSL. Also remove
- code using CamelRemoteStore.
- (camel_nntp_command): Don't call camel_remote_store_connected().
-
-2002-05-24 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-folder.c (content_info_get_part_spec):
- Helps if we allocate enough space here. Also, start smoking the
- same purple flavoured IMAP crack when counting parts (parts don't
- count if their parent part is a message/* part with a parent
- part). Fixes bug #25260.
-
-2002-05-24 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-command.c (imap_read_untagged): Use
- the new readline function.
-
- * providers/imap/camel-imap-store.c (connect_to_server): Use the
- new camel_imap_store_readline() function which doesn't suck quite
- as bad as the original camel_remote_store_recv_line() function.
- (camel_imap_store_readline): New function to replace
- camel_remote_store_recv_line(). This function is at least safe
- with embedded nul chars. Not that any of our callers use it
- *sigh*.
-
-2002-05-24 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-store.c (connect_to_server): Added
- some NULL protection fixes.
-
-2002-05-22 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-remote-store.c: Removed from the build. Glory glory
- hallelujah.
-
- * camel-disco-store.c: Updated to inherit from
- CamelStore rather than CamelRemoteStore.
-
- * providers/imap/camel-imap-command.c (imap_command_start): Don't
- use the camel-remote-store shit to send a string. Just use
- camel_stream_printf for chrissakes.
-
- * providers/imap/camel-imap-store.c: Updated to not depend on
- CamelRemoteStore and to handle STARTTLS.
- (imap_disconnect_online): Unref the streams.
- (imap_keepalive): Removed.
- (camel_imap_store_connected): New function to replace
- camel_remote_store_connected().
- (camel_imap_store_finalize): Unref the streams.
- (camel_imap_store_recv_line): New function to replace
- camel_remote_store_recv_line().
- (imap_get_capability): Renamed from connect_to_server
- (connect_to_server): New function to try and connect to the
- server.
- (connect_to_server_wrapper): New wrapper function around
- connect_to_server that takes the ssl modes into consideration.
- (query_auth_types): Don't bother calling our parent's
- implementation of query_auth_types() since CamelDiscoStore doesn't
- have any anyway.
- (imap_get_name): New method to implement CamelService::get_name
-
-2002-05-18 Not Zed <NotZed@Ximian.com>
-
- * camel-search-private.c (camel_utf8_getc): If we get an invalid
- start char, just ignore it and goto the next character.
-
-2002-05-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-store.c (get_folder_offline): Don't
- call some retarded function to simply set an exception.
-
- * camel-filter-search.c (get_label): New e-sexp callback function
- to get a user_tag label value.
-
-2002-05-15 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-utils.c
- (imap_parse_namespace_response): New function to parse a NAMESPACE
- response properly.
- (imap_namespaces_destroy): New function to destroy the returned
- structure from the above function.
-
-2002-05-15 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-service.c (service_setv): Only reconnect if we are already
- connected, if we are in a disconnected state then no need to
- reconnect.
-
- * providers/imap/camel-imap-folder.c (get_content): If the
- part_spec is an empty string for a leaft part, use "1" since we
- don't actually want to get the raw message headers too.
-
-2002-05-15 Not Zed <NotZed@Ximian.com>
-
- * providers/imap/camel-imap-store.c (refresh_folder_info): removed.
- (imap_store_refresh_folders): Copy the folders first, then refresh
- them, outside of the cache_lock, which could cause deadlocks
- because of a workaround for crappo exchange.
- (imap_disconnect_online): Dont pass an exception to LOGOUT
- command. The required response 'BYE' always sets an exception
- when we call LOGOUT. This also interfered with a lot of other
- processing causing partial failures and messed up offline/online
- state.
-
- * camel-disco-folder.c (disco_prepare_for_offline): Do progress
- reporting.
-
-2002-05-14 Jeffrey Stedfast <fejj@ximian.com>
-
- Fixes bug #24136.
-
- * providers/imap/camel-imap-folder.c (content_info_get_part_spec):
- New function to take a CamelMessageContentInfo and generate a
- part-specification string.
- (get_content): Stop passing around part_spec strings and use
- content_info_get_part_spec instead.
-
- * camel-folder-summary.c (camel_content_info_dump): Made this into
- a public debugging function.
-
- * providers/imap/camel-imap-utils.c (imap_parse_body): Make sure
- to set the parent of any message/rfc822 subparts.
-
-2002-05-13 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-folder.c (imap_get_message): Previous
- fix reverted.
-
-2002-05-13 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-store.c (camel_imap_store_class_init):
- Overload the setv/getv CamelObject virtual methods.
- (imap_setv): Implemented.
- (imap_getv): Implemented.
-
-2002-05-13 Dan Winship <danw@ximian.com>
-
- * camel-folder.c (camel_folder_append_message): Add a "char
- **appended_uid" argument, for the caller to optionally pass in a
- variable to receive the UID of the appended message (if the
- provider knows it).
- (camel_folder_transfer_messages_to): Likewise, add "GPtrArray
- **transferred_uids"
- (transfer_messages_to): Update default implementation to handle
- transferred_uids.
-
- * camel-disco-folder.c (disco_append_message,
- disco_transfer_messages_to): Update for API changes.
-
- * camel-disco-diary.c (camel_disco_diary_replay): Update the
- diary's temporary uid->real uid map when replaying appends and
- transfers.
-
- * providers/imap/camel-imap-folder.c (imap_append_offline,
- imap_append_online, imap_transfer_offline): Pass back the new
- UIDs, when requested and available.
- (imap_append_resyncing): Pass back the new UIDs when requested and
- available. Remove the diary uidmap managing code since
- CamelDiscoDiary can handle that itself now.
- (imap_transfer_online, imap_transfer_resyncing): Update for new
- APIs, but don't actually pass back the new UIDs yet. (It's tricky
- since the COPYUID response may not be in the same order as the
- input uids.)
-
- * providers/local/camel-maildir-folder.c (maildir_append_message):
- Pass back the new UID if requested.
-
- * providers/local/camel-mbox-folder.c (mbox_append_message):
- Likewise.
-
- * providers/local/camel-mh-folder.c (mh_append_message): Likewise.
-
- * providers/local/camel-spool-folder.c (spool_append_message):
- Likewise.
-
- * camel-digest-folder.c (digest_append_message,
- digest_transfer_messages_to): Update for API changes.
-
- * camel-filter-driver.c (camel_filter_driver_filter_message,
- do_copy, do_move): Update for API changes.
-
- * camel-vee-folder.c (vee_append_message,
- vee_transfer_messages_to): Likewise.
-
- * camel-vtrash-folder.c (vtrash_append_message,
- vtrash_transfer_messages_to): Likewise.
-
-2002-05-13 Not Zed <NotZed@Ximian.com>
-
- * camel-folder-thread.c
- (camel_folder_thread_messages_new_summary):
- (camel_folder_thread_messages_new): Since the fix for #3357 uses
- 'order=0' to indicate tree structure nodes, make sure we dont
- actually set order=0 for valid messages, otherwise we silently
- lose duplicates of the first message (i==0). Fixes #19920.
-
-2002-05-10 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-folder.c (imap_get_message): Fetch the
- BODYSTRUCTURE rather than BODY since BODY seems to be lacking some
- of the data we need. This fixes bug #24136.
-
- * camel-transport.c (camel_transport_get_type): Might help if we
- called camel_transport_class_init.
-
-2002-05-10 Dan Winship <danw@ximian.com>
-
- * camel-folder.c (camel_folder_transfer_messages_to): Replace
- copy_messages_to and move_messages_to with a single function that
- just takes a "delete_originals" flag. Also, use the vtrash
- implementation if *either* folder is a vtrash.
- (transfer_messages_to): Make this use camel_operation_progress
- (previously move_messages_to did but copy_messages_to didn't), and
- freeze/thaw the folder(s) if doing multiple messages.
-
- * camel-vtrash-folder.c (vtrash_transfer_messages_to): Update for
- move/copy merge. Move the "move messages into vtrash" code here
- from mail-ops.c. Now all of the vtrash move/copy special casing is
- in camel instead of half of it being here and half in mail/. (This
- should also make it so that "Move to Trash" will work in filter
- rules.)
-
- * camel-vee-folder.c (vee_transfer_messages_to): Make this just
- return an exception, since it will only be called when trying to
- move/copy messages from one vfolder to another.
- (vee_append_message): Add this too so we get a nicer error message
- than the default "unimplemented" one in camel-folder.c.
-
- * camel-digest-folder.c: Replace copy_messages_to and
- move_messages_to with transfer_messages_to.
-
- * camel-disco-folder.c: Likewise
-
- * camel-disco-diary.c (camel_disco_diary_log,
- camel_disco_diary_replay): replace MOVE/COPY with TRANSFER.
-
- * providers/imap/camel-imap-folder.c (imap_transfer_offline,
- imap_transfer_online, imap_transfer_resyncing): Update for
- changes. (This ends up being a bit more complicated than it was
- before for now, but later disconnected operation changes should
- resimplify it.)
-
- * camel-filter-driver.c (camel_filter_driver_filter_message,
- do_copy, do_move): Use transfer_messages_to instead of copy.
-
-2002-05-09 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-filter-search.c (shell_exec): New filter function to pipe
- a message to another program.
- (run_command): Fixed some bugs to make this work.
-
-2002-05-09 Not Zed <NotZed@Ximian.com>
-
- * camel-service.c (camel_service_disconnect): Instead of testing
- for SERVICE_CONNECTED, we need to also handle SERVICE_CONNECTING
- too, as it will often have setup some details before it failed.
- Make it !DISCONNECTED (and !DISCONNECTING for recursive calls,
- which happen). Fixes #23782, and maybe also #21604 and many other
- random crashes.
-
-2002-05-08 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-digest-store.c (digest_setv): Implemented.
- (digest_getv): Implemented.
-
- * camel-disco-store.c (disco_setv): Implemented.
- (disco_getv): Implemented.
-
- * camel-remote-store.c (remote_store_setv): Implemented.
- (remote_store_getv): Implemented.
-
- * camel-transport.c (camel_transport_class_init): Implemented.
- (transport_setv): Implemented.
- (transport_getv): Implemented.
-
- * camel-store.c (store_setv): Implemented.
- (store_getv): Implemented.
-
- * camel-service.c (service_setv): Implemented.
- (service_getv): Implemented.
-
- * providers/pop3/camel-pop3-store.c (pop3_try_authenticate):
- camel_pop3_engine_iterate doesn't return the state, it returns -1
- on fail, 0 when finished processing request or >0 if more ops are
- in the queue, so don't check status against CAMEL_POP3_STATE_OK,
- instead check pcp->state against that.
-
-2002-05-07 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-object.h: s/class/klass for arguments so that c++
- developers don't complain later.
-
-2002-05-07 Dan Winship <danw@ximian.com>
-
- * camel-object.c (camel_object_class_cast): Fix a crash in a
- g_warning.
-
-2002-05-07 Not Zed <NotZed@Ximian.com>
-
- * camel-remote-store.c (remote_send_string): Check for LOGIN xxxx
- as well if debug is on, so we dont print passwords to evolution
- logs.
-
- * providers/imap/camel-imap-utils.c (imap_is_atom_char): This was
- really broken. 1. isprint() is locale dependent, and 2. it looked
- up an 8 bit value in a 7 bit table without truncating it. I've
- removed the isprint() stuff and just put it directly into the
- special table, which i've expanded to the right size too.
-
- * providers/imap/*: Applied patch from Preston Elder
- <prez@magick.tm> to make camel only use literals if it needs to
- for simple strings. Changed slightly to use imap_is_atom() and
- more consistent formatting.
- * providers/imap/camel-imap-utils.c (imap_is_atom): Changed from
- imap_needs_quoting().
-
- ** Merged in camel-object2 branch. Simpler camelobject
- implementation + object args interface.
-
- * camel.c (camel_init): Call camel_object_get_type() to make sure
- camel_object_type is initialised.
-
- * camel-object.h (CAMEL_OBJECT_TYPE): Changed to return global
- camel_object_type pointer, not call camel_object_get_type.
-
-2002-05-06 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/pop3/camel-pop3-store.c (pop3_try_authenticate): If
- the pop3 command status is -1, then we probably have a TCP error
- (?) so set a SYSTEM exception so our caller can distinguish
- between a "bad password" and a "tcp error".
- (pop3_connect): Only uncache the password on "bad password"
- errors.
-
- * camel-pgp-mime.c (pgp_mime_part_sign_prepare_part): Use
- CamelMimeFilterBestenc to get a more appropriate encoding rather
- than just blindling assigning QP.
-
- * providers/imap/camel-imap-folder.c (do_append): Call
- camel_mime_message_encode_8bit_parts() which fixes bug #10885.
-
- * camel-tcp-stream-raw.c (socket_connect): Don't bother with
- counting down the timeout.
-
-2002-05-02 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-stream-fs.c (stream_read): Same fix as the tcp stream.
- (stream_write): Again here. Just like tcp stream's stream_write(),
- also make sure to save errno before calling fcntl to restore the
- fd flags.
-
- * camel-tcp-stream-raw.c (stream_read): Handle EINTR errors for
- select().
- (stream_write): Same and also preserve errno when setting the fd
- flags back. If w == -1, return -1.
-
-2002-05-02 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-utils.c (header_decode_mailbox): Fixed the fix for
- stupidly-broken-mailer bug #5 to work when multiple unescaped
- characters were in a row. Fixes bug #24140.
-
- * camel-tcp-stream-raw.c (socket_connect): Check select() for
- EINTR errors.
-
- * camel-pgp-context.c (crypto_exec_with_passwd): Change the order
- of some code so that we check if the select() failed before we
- check for user-cancellation.
-
- * camel-service.c (camel_gethostbyname): Check for EINTR when
- select()ing.
- (camel_gethostbyaddr): Same.
-
-2002-04-29 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-provider.c (camel_provider_auto_detect): Now takes a
- CamelURL argument rather than a GHashTable *settings argument.
-
-2002-04-29 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-spool-store.c (get_folder_info): We want
- to set unread_count to get_unread_message_count, not
- get_message_count(). Might fix #17174. Also removed FIXME: as it
- was fixed.
-
-2002-04-26 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/local/Makefile.am: Don't link to libibex.a anymore.
-
- * providers/nntp/Makefile.am: Same.
-
- * providers/imap/Makefile.am: And again here.
-
- * camel-store-summary.h: No longer want to #include
- <libibex/ibex.h>
-
- * camel-provider.c (camel_provider_auto_detect): New function to
- auto-detect configuration settings.
-
-2002-04-26 Not Zed <NotZed@Ximian.com>
-
- * camel-block-file.c (block_file_validate_root): Remove the
- excessive \n's, after printfs.
-
- * camel-text-index.c (text_index_compress_nosync): @!#$@#$!@$#!.
- Since the rename op was fixed, this broke compression's rename,
- resulting in the index 'vanishing' after every compress
- (i.e. after every reindex). Fix this code to account for the
- fixed rename operation.
-
-2002-04-25 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/smtp/camel-smtp-transport.c (smtp_rcpt): Don't put a
- space between the "RCPT TO:" and the "<recipient>" strings -
- rfc0821 was not clear on this but it seems rfc2821 defines a
- grammar excluding that SP.
- (smtp_mail): Same.
-
-2002-04-24 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/local/camel-local-provider.c
- (camel_provider_module_init): Configure the default paths for mh,
- mbox, maildir, spools, etc.
-
- * camel-provider.h: Add a CAMEL_PROVIDER_CONF_LABEL enum and
- define some default CamelProviderConfEntry macros.
-
-2002-04-19 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/pop3/camel-pop3-folder.c (pop3_refresh_info): Free the
- LIST pop3 command.
-
- * camel-data-cache.c (data_cache_finalise): Free the cdc->path.
-
- * camel-multipart.c (write_to_stream): Don't g_return_val_if_fail
- here if the boundary is an empty string. See bug #23676 for
- details. The way I see it, we have 2 options: 1) leave this fix
- the way it is, thus allowing multipart boundaries to be
- empty-strings; or 2) make camel_multipart_get_boundary() change
- the boundary to something legal if the boundary is an
- empty-string. Since the parser should be able to handle an
- empty-string boundary *and* more importantly because we want to
- keep the same boundaries as the original raw message so as to be
- able to verify multipart/signed parts, I vote for solution #1.
-
-2002-04-19 Not Zed <NotZed@Ximian.com>
-
- * devel-docs/camel-index.txt: Start of a white-paperish document
- describing camel-index and older libibex.
-
-2002-04-18 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-local-store.c (rename_folder): If we get a
- failure, make sure we set an exception.
-
- * camel-text-index.c (camel_text_index_rename): If the file
- doesn't exist, just assume it never did, dont return failure.
- (text_index_rename): Add '.index' to the path name we're using,
- since we dont get it passed in.
-
- * camel-folder-search.c (check_header): When doing a contains
- match, split the words and perform an and on it.
- (match_words_messages): If we have an index, but were forced to do
- a full search, first lookup a subset of messages using
- the index and a simplified word set. Only do a manual search of
- this subset.
-
-2002-04-17 Not Zed <NotZed@Ximian.com>
-
- * camel-folder-search.c (match_message_index): Changed to take a
- utf8 string not a regex pattern.
- (match_words_index): Matches against a camel_search_words list.
- (match_words_1message): Matches a single message against a
- camel_search_words list.
- (match_words_message): Same, but gets the message from the folder
- for you.
- (match_words_messages): Matches a list of messages against a words
- list.
- (search_body_contains): Rewritten to handle multiple word
- searches. For #23371.
-
- * providers/imap/camel-imap-search.c (sync_match): Split words
- when searching, to support multiple search words. Also, try
- searching specifying charset of utf8 if we can, if that fails,
- fall back to not specifying charset. TODO: It should translate
- the strings into the locale default charset?
-
- * providers/imap/camel-imap-store.c (connect_to_server): Added new
- cap - utf8_search, if set, we tell the server we're searching
- using utf8, otherwise we dont (incorrectly, since we always use
- utf8 to search).
-
- * camel-search-private.c (camel_ustrstrcase): Make this class public.
- (camel_search_words_split): Split a word into multiple words based
- on whitespace, and keep track of whether the word is simple
- (indexable directly), or not.
- (camel_search_words_free): Free 'em.
-
-2002-04-17 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-vee-folder.c (vee_search_by_expression): If the vee-folder
- is the unmatched, we don't have our own expression so we cannot
- merge them. Instead, just use the expression passed in. This fixes
- a Null-Pointer-Read crash on Solaris systems at least.
-
-2002-04-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-filter-driver.c (camel_filter_driver_filter_folder): Get
- rid of an unused variable.
-
- * providers/smtp/camel-smtp-transport.c (smtp_helo): Use
- camel_gethostbyaddr since gethostbyaddr is not reentrant.
-
- * camel-http-stream.c (http_connect): Updated after the rename of
- camel_get_host_byname.
-
- * camel-service.c (camel_gethostbyname): Renamed.
- (camel_gethostbyaddr): New cancellable/reentrant version of
- gethostbyaddr.
-
-2002-04-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/local/camel-spoold-store.c: Added #include
- <sys/types.h> for dirent.h which needs it on MacOS X.
-
- * providers/local/camel-maildir-store.c: Same.
-
- * providers/nntp/camel-nntp-store.c: Same.
-
- * providers/imap/camel-imap-message-cache.c: Same.
-
- * camel-provider.c: Same.
-
- * camel-data-cache.c: Same.
-
-2002-04-12 Jeffrey Stedfast <fejj@ximian.com>
-
- * broken-date-parser.c (datetok): Treat commas as token
- delimeters.
- (WEEKDAY_CHARS): Use full weekday names in case the broken mailer
- used the full names.
- (MONTH_CHARS): Same as above but for months.
-
-2002-04-15 Not Zed <NotZed@Ximian.com>
-
- * *.c: Fix callers for api changes to camel-object, mainly
- declare_event->add_event, and classfuncs->klass, and a couple
- of missing #include <config.h>'s
-
- * camel-arg.[ch], Makefile.am: New support code for
- camel_object_get/set arg.
-
- * *.h: Fixed all uses of get_type to return a CamelType rather
- than a guint (now a pointer).
-
- * camel-object.[ch]: Major cleanup of object implementation. Also
- added a get/set interface, and some debugging options.
-
-2002-04-11 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-spool-summary.c (spool_summary_sync_full):
- If the last message(s) were deleted, and we had any messages
- output, account for the lost \n of the following From line by
- adding an extra \n. fix for #8214.
-
-2002-04-10 Not Zed <NotZed@Ximian.com>
-
- * camel-mime-part-utils.c (convert_buffer): If we get a 0 length
- input, return a 0 lenght output as valid - fixes bugs with some
- iconv impl and its simpler anyway.
-
-2002-04-11 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-folder.c: Set the UID_SET_LIMIT value
- to 4096. I ran into an issue tonight where apparently the IMAP
- server changed the UIDVALIDITY and so Evo needed to re-fetch all
- headers and it was trying to send a uid set of some 25k (yes, I
- have a very large INBOX). Anyways, it was set to unlimited
- before. Courier IMAPd can safely handle up to ~16k per token, but
- UW IMAPd can only handle 8k per command-line, so I set it to 4k
- just to be safe.
-
-2002-04-10 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-part-utils.c (convert_buffer): Fixed a bug that would
- miscalculate how much data to copy into the GByteArray (negative
- value) thus causing a segfault. Also optimized it while I was at
- it.
-
-2002-04-09 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-store.c (camel_store_init): Make the folder_lock
- recursive. See bug #22363 for details. Basically,
- get_folder_info() is requesting a diary folder which in turn
- connects which requests then calls get_folder() but deadlocks
- because get_folder_info already holds the lock.
-
- * camel-mime-message.c (camel_mime_message_set_date): Don't adjust
- the timezone offset if we used tm.tm_gmtoff because it is already
- adjusted.
-
-2002-04-09 Not Zed <NotZed@Ximian.com>
-
- * camel-mime-part.c (construct_from_parser): If we get multiple
- Content-Type header values, change subsequent headers to
- X-Invalid-Content-Type so it doesn't wreck processing. This fixes
- the reported case in #18929, but i dont know if it fixes the
- original posters problems.
-
-2002-04-08 Not Zed <NotZed@Ximian.com>
-
- * camel-vtrash-folder.c (vtrash_move_messages_to): If we find
- we're moving from the vtrash to another folder, we need to convert
- the uid from a vfolder uid to the source uid (+8). Fix for
- #20886. Also changed to batch multiple moves to different folders
- so they are done as efficiently as possible rather than one at a
- time.
-
- * camel-mime-utils.c (base64_decode_step): If we only get passed
- '=', we back track only if we actually output any data. Fix for
- #21716.
- (quoted_decode): Pass out size_t instead of int, and use 0 instead
- of -1 for error since its not signed. This will fix similar bug
- to above in different circumstances since the result is taken as
- unsigned. This is only an internal func.
- (quoted_encode): Return size_t just for consistency.
-
- * camel-block-file.c (block_file_validate_root): Comment out the
- debug and move it into a warning when the validation fails.
-
-2002-04-08 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-utils.c (uuencode_close): Don't count our filler when
- encoding our line-length octet.
-
-2002-04-05 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-http-stream.c (http_get_headers): Don't get the statuscode
- here anymore.
- (http_method_invoke): Use a User-Agent header and do basic proxy
- authentication.
- (stream_read): Handle redirects.
- (camel_http_stream_set_user_agent): New function to allow client
- to set the User-Agent string.
- (camel_http_stream_set_proxy): New function for setting the proxy
- server.
- (camel_http_stream_set_proxy_authrealm): New function for setting
- the proxy auth realm.
- (camel_http_stream_set_proxy_authpass): New function for setting
- the proxy auth password.
-
-2002-04-04 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-folder-summary.c (message_info_new): Simplified since we
- can now decode in-reply-to without getting extra cruft. Get rid of
- the FIXME about having to check scan->id because of the
- possibility of it being NULL, this can no longer happen.
-
- * camel-mime-utils.c (header_references_inreplyto_decode): New
- function to decode in-reply-to headers. Only grabs the first thing
- that looks like a message-id and then returns.
- (header_references_decode): Loop calling
- header_references_decode_single (a new internal function).
-
-2002-04-04 Not Zed <NotZed@Ximian.com>
-
- * providers/imap/camel-imap-search.c (imap_body_contains): If
- (body-contains) is not passed any arguments, return empty/false.
- Fixes a crash exposed by #15001.
-
- * camel-remote-store.c (remote_connect): Reset the keepalive
- timeout to 10 minutes rather than the 30 seconds I was using for
- testing.
-
-2002-04-03 Dan Winship <danw@ximian.com>
-
- * camel-provider.h (CamelProvider): make service_cache be an array
- of CAMEL_NUM_PROVIDER_TYPES elements so you can have a single
- provider offer both stores and transports. (Eg, Exchange, NNTP)
-
- * providers/imap/camel-imap-provider.c: Don't initialize
- service_cache here. (The session code can do it itself since the
- url_hash and url_equal functions are stored as part of the
- provider.)
-
- * providers/nntp/camel-nntp-provider.c: Likewise.
-
- * providers/local/camel-local-provider.c: Likewise.
-
- * providers/pop3/camel-pop3-provider.c: Likewise.
-
- * providers/sendmail/camel-sendmail-provider.c: Likewise.
-
- * providers/smtp/camel-smtp-provider.c: Likewise.
-
- * camel-session.c (register_provider): Initialize the provider's
- service cache(s) here.
- (camel_session_class_init): Don't initialize.
- vee_provider.service_cache here.
- (camel_session_destroy_provider): Update to destroy multiple
- service_caches.
- (service_cache_remove, get_service): Tweak these a bit to deal
- with multiple service_caches.
-
-2002-04-02 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-tcp-stream-ssl.c (set_errno): Handle a ton more nspr i/o
- errno's.
- (stream_connect): Act as if we are doing a non-blocking
- connect. This is to try and work around bug #15120 where users get
- an EINPROGRESS error. Maybe importing a PRFileDesc into SSL mode
- automagically makes it non-blocking? I dunno.
-
-2002-04-01 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-folder-summary.c (message_info_new): Updated the
- construction of the references to match JWZ's updated algorithm
- initialization (ie, append any In-Reply-To reference onto any
- References header and never take more than a single message-id
- from the In-Reply-To header since anything after the first will
- probably just be email addresses). Fixes bug #1336.
-
-2002-04-03 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-local-folder.c
- (camel_local_folder_construct): Turn indexing back on, fingers
- crossed ...
-
- * camel-block-file.c (sync_nolock): #!@$@$#@~#$
- DF@#$!Q@$#!@$#!#%. Well it helps if we're iterating a list to
- iterate the node pointer ...
-
- * camel-text-index.c (text_index_sync): Sync the key tables
- explcitly.
- (text_index_sync): Debug out frag info.
- (camel_text_index_dump): Added a (rather large, but optional) raw
- dumping mode for debugging purposes.
-
- * camel-partition-table.c (camel_key_table_finalise): Sync root
- block when done.
- (camel_key_table_sync): New function, sync key table (root) explicitly.
- (camel_partition_table_sync): Method to explicitly sync the
- partition table.
-
-2002-04-02 Not Zed <NotZed@Ximian.com>
-
- * camel-block-file.c (camel_block_file_free_block): Mark root
- block dirty when we change it (this function isn't used yet
- anyway).
-
- * camel-text-index.c (text_index_add_name_to_word): Touch the root
- block when we modify the counts. Also, abort processing on any
- errors.
- (text_index_sync): Fix typo in comments. Sync the block file
- inside the lock.
- (text_index_compress_nosync): Lock the old index while we're
- compressing.
- (text_index_compress_nosync): Remove the bogus while() at the end
- of the while() loops! Also plug a memleak - records weren't
- freed.
- (text_index_rename): Lock around rename op.
- (text_index_add_name): More typos.
- (text_index_sync): Touch root when changing it.
- (text_index_add_name): "
- (text_index_delete_name): "
- (camel_text_index_new): Touch root if we change it.
- (text_index_cursor_reset): Make sure we NULL pointers after we
- free them (nothing uses this yet).
-
- * camel-partition-table.c (hash_key): Remove some debug
- accidentally left in.
- (camel_partition_table_add): When linking in the next block list,
- set the right previous pointer.
- (camel_key_table_add): Simplify the 'left' calculation (it was
- already ok though).
- (camel_key_table_next): Initialise returns before processing.
- Broaden the lock slightly, and simplify validity calculations.
-
- * providers/imap/camel-imap-store.c (imap_keepalive): Put back in
- the exception setup stuff i disabled for debugging.
-
- * providers/local/camel-local-folder.c
- (camel_local_folder_construct): Temporarily disable indexing.
-
-2002-03-28 Not Zed <NotZed@Ximian.com>
-
- * camel-partition-table.c (camel_key_table_lookup): Change range
- checking assert to a warning.
-
- * providers/pop3/camel-pop3-folder.c (pop3_finalize): Make sure we
- flush out all outstanding commands before finalising, stops being
- finalised while outsanding requests are processed by the store
- finalise.
- (pop3_get_message): Instead of pre-fetching all messages, just
- pre-fetch a maxiumum number at any one time, stops us running out
- of cache fd's.
-
- * providers/nntp/camel-nntp-folder.c (nntp_folder_init/finalise):
- Setup priv data + locks, & free.
-
- * providers/imap/camel-imap-folder.c (imap_rescan): Batch all
- message_chagned events into a single folder_changed event
- (otherwise updates can be >>> expensive, like >5 hours for 80K
- messages changing!). Alternately it could use folder
- freeze/unfreeze perhaps.
-
-2002-03-27 Not Zed <NotZed@Ximian.com>
-
- * providers/imap/camel-imap-store.c (imap_keepalive): Pass an
- exception to called code so it behaves properly since it uses the
- passed exception to check returns.
-
-2002-04-01 Dan Winship <danw@ximian.com>
-
- * providers/imap/Makefile.am (libcamelimap_la_LDFLAGS): Use
- -avoid-version instead of -version-info 0:0:0, and specify
- -module. (From Max Horn <max@quendi.de>).
-
- * providers/local/Makefile.am (libcamellocal_la_LDFLAGS): Likewise.
-
- * providers/nntp/Makefile.am (libcamelnntp_la_LDFLAGS): Likewise.
-
- * providers/sendmail/Makefile.am (libcamelsendmail_la_LDFLAGS):
- Likewise.
-
- * providers/smtp/Makefile.am (libcamelsmtp_la_LDFLAGS): Likewise.
-
- * providers/pop3/Makefile.am (libcamelpop3_la_LDFLAGS): Likewise.
- Also remove $(KRB4_LDFLAGS) since KPOP is gone.
- (INCLUDES): and $(KRB4_CFLAGS)
-
-2002-03-28 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-filter-driver.c (do_copy): We now have to check to make
- sure that p->message is non-NULL because we only load the message
- when we have to.
- (do_move): Same here.
-
-2002-03-28 Dan Winship <danw@ximian.com>
-
- * camel-transport.c (camel_transport_send_to): Change the message
- arg to a CamelMimeMessage instead of a CamelMedium. Even the NNTP
- provider returns CamelMimeMessages, and we're never going to
- support anything more exotic than that. Also do a few more
- g_return_if_fails here instead of in the providers.
- (camel_transport_can_send): No longer needed.
- (camel_transport_send): Remove this too. It wasn't being used any
- more, and it doesn't behave exactly the same in sendmail and smtp.
-
- * providers/smtp/camel-smtp-transport.c (smtp_send,
- smtp_can_send): Gone.
- (smtp_send_to): Update for arg change.
- (smtp_data): Make this take a CamelMimeMessage too.
-
- * providers/sendmail/camel-sendmail-transport.c (sendmail_send,
- sendmail_can_send): Gone.
- (sendmail_send_to): Update for arg change, and merge in the part
- that used to be shared with sendmail_send.
-
-2002-03-27 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-filter-driver.c (camel_filter_driver_filter_folder):
- Construct the source_url the right way. The previous way was
- generating urls like pop://fejj@ximian.com;keep_on_server/inbox
- which is wrong.
-
-2002-03-26 Not Zed <NotZed@Ximian.com>
-
- * camel-text-index.c (text_index_normalise): Changed to use just
- g_utf8_strdown instead of utf8_normalise, to match the indexing
- code. utf8_normalise is just far too expensive (saves approx 25%
- total processing).
-
-2002-03-25 Not Zed <NotZed@Ximian.com>
-
- * camel-text-index.c (text_index_add_name): When we add a new
- name, up all of the cache limits, because we're probably going to
- be adding more.
- (text_index_sync): Drop the cache limits back down again, we dont
- need them when looking words up.
-
- ** MERGE camel_index branch.
-
- * camel-text-index.[ch]: Added files i forgot to add (eep nearly
- lost all this work!)
-
- * camel-block-file.c (sync_nolock): Fix an infinite loop in syncing.
-
-2002-03-21 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-folder-summary.c (camel_message_info_new_from_header): Use
- the date in the received header for the received_date.
-
-2002-03-22 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-local-folder.c
- (camel_local_folder_construct): Use the right option to remove the
- index file and reset the index file on creation.
- (camel_local_folder_construct): Remove any existing '.ibex' files
- - these are the old format index files.
-
- * camel-block-file.c (camel_block_file_rename): Lock io lock while
- renaming.
- (camel_key_file_rename): Lock around rename.
- (block_file_validate_root): Implement sync flag checking.
- (camel_block_file_touch_block): Turn off the sync flag if we're
- touching any non-root block and write it to disk. Shoudl this
- fsync()?
- (sync_nolock): sync the root block only if we need to.
-
- * providers/local/camel-local-store.c (rename_folder): Re-enable
- index rename code. Not sure how race-free it is though.
- (delete_folder): Delete the index file properly.
-
- * camel-partition-table.c (camel_key_table_lookup): Initialise
- output values to 0 before doing anything.
- (camel_key_table_add): Do some range-checking on values.
-
- * camel-text-index.c (text_index_compress): Changed to call sync here.
- (text_index_compress_nolock): and not here - stops a recursive
- sync call when sync performs a compress also.
- (text_index_compress_nolock): Change to _nosync, since the locking
- is irrelevent (recursive lock). Fixed callers.
- (text_index_add_name_to_word): If we get a failure with key table
- ops, fail immediately.
- (text_index_compress_nosync): Likewise.
- (text_index_write_name): If the nameid is 0, do nothing.
- (text_index_add_name): If we can't get a keyid, dont add it to the
- partition table.
- (camel_text_index_remove): Function to delete an index file.
- (text_index_compress_nosync): Clean up temp files when done.
-
- * camel-folder-search.c (match_messages_index): New function,
- split from body_contains, matches a regex against all words in an
- index.
- (match_message_index): Similar to above but matches against an
- individual message.
- (search_body_contains): Changed to use above functions for
- matching - substring matches should now work on indexed data.
-
-2002-03-21 Not Zed <NotZed@Ximian.com>
-
- * camel-index.c (camel_index_words/names): New virtual
- methods/stubs to get a cursor of all words and names.
-
- * camel-text-index.c (text_index_compress_nolock): Split from
- text_index_compress, so we can call the compressor while locked
- also, removed lock calls.
- (text_index_compress): Changed to stub which calls
- text_index_compress_nolock.
- (camel_text_index_key_cursor_new): New object to iterate through
- a key table.
- (text_index_words, text_index_names): Implement virtual functions
- for iterating through all words or names.
-
- * camel-block-file.c: Turn off some debug.
-
-2002-03-20 Not Zed <NotZed@Ximian.com>
-
- ** New body index implementation.
-
- * camel-index*: Code for camel index, a new class to replace ibex.
-
- * camel-block-file.[ch]: block-based and link based
- filesystem-in-a-file classes.
-
- * camel-partition-table.[ch]: An implementation of a partition
- table (automatically extending on-disk hash-table using ideal
- hash), and a key-table, a key<>name mapping table. Used by
- camelindex.
-
- * providers/local/*, camel-folder-summary.[ch]: Changed to use
- camel-index interface rather than ibex.
-
-2002-03-05 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-maildir-summary.c (maildir_summary_check):
- Do progress reporting of operations.
- (maildir_summary_sync): Same here.
-
-2002-03-04 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-spoold-store.c (scan_dir): Kill a warning
- with a cast.
-
- * providers/local/camel-*.c: Changed for ibex->camelindex.
-
- * camel-folder-search.c (camel_folder_search_set_summary): Init
- summary_hash to point to 'static' uid strings.
- (search_body_contains): Use the static uid memory to return
- results rather than the values from the index library.
-
- * camel-folder-search.[ch]: Changed to use camelindex object.
-
- * camel-folder-summary.c (summary_build_content_info_message):
- Use a stream to index content, also filter html mail first.
- (camel_folder_summary_info_new_from_message): Use a stream
- filtered to index content.
- (main): Removed the test main code. Added headers for open call
- (ibex must've had them before).
-
- * camel-folder-summary.[ch]: Changed from ibex to CamelIndex.
-
- * camel-mime-filter-index.c (camel_mime_filter_index_finalize):
- Unref index.
-
- * camel-mime-filter-index.[ch]: Changed from ibex to CamelIndex.
-
-2002-03-19 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-utils.c (header_encode_param): Fix this to work
- right. We need to convert the input buffer to the charset we claim
- in the encoded param (duh).
-
-2002-03-18 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/smtp/camel-smtp-transport.c
- (connect_to_server_wrapper): Updated to use the same logic as the
- POP code.
-
- * providers/pop3/camel-pop3-store.c (connect_to_server): No longer
- takes a stls_supported argument since we no longer need it with
- the new logic.
- (connect_to_server_wrapper): New logic: First try connecting to
- the SSL port (995 by default), if that fails with
- SERVICE_UNAVAILABLE, then we attempt to connect (to port 110 by
- default) and try to use STARTTLS.
-
-2002-03-15 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-folder.h:
-
- * camel-private.h: Don't allow any empty structs. If
- !ENABLE_THREADS, provide a gpointer dummy member. Fixes bug #6382.
-
-2002-03-13 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/smtp/camel-smtp-transport.c (smtp_auth): Added a
- work-around for SMTP servers that can't read the RFCs and thus
- implement SASL incorrectly. Oh well, that's life in the world of
- mail clients I guess.
-
-2002-03-12 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-digest-store.c (camel_digest_store_new): Now takes a url
- argument.
-
- * camel-digest-folder.c (digest_add_multipart): Fixed some memory
- corruption and also modified to use CAMEL_IS_MIME_MESSAGE() rather
- than comparing content-type strings.
- (digest_get_message): Fixed a logic blooper.
-
- * camel-folder-summary.c (camel_message_info_new_from_header): Set
- the date fields of the CamelMessageInfo as well. This may even fix
- some filter-related bugs where the user was trying to compare
- dates.
-
-2002-03-11 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-digest-store.c: A pretty empty store implementation to be
- the parent store of a CamelDigestFolder.
-
- * camel-digest-folder.c: Updated to reference it's parent store.
-
-2002-03-11 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-digest-folder.c (camel_digest_folder_new): Allow any leaf
- part to be a message/rfc822 part.
- (digest_get_uids): Recurse the mime structure and add all
- message/rfc822 parts and use a uid scheme similar to IMAP's mime
- part naming convention.
- (digest_get_message): Decode the uid to get the correct mime part.
-
-2002-03-11 Ettore Perazzoli <ettore@ximian.com>
-
- * camel-mime-utils.c: Change the order of the mailing list magic
- patterns so that the more mailing-list specific ones are on the
- top.
-
-2002-03-11 Jeffrey Stedfast <fejj@ximian.com>
-
- These fixes should fix bug #21737.
-
- * providers/smtp/camel-smtp-transport.c
- (connect_to_server_wrapper): Same as with the POP code.
-
- * providers/pop3/camel-pop3-store.c (connect_to_server_wrapper):
- Slight restructuring of the if-statements for the USE_SSL_ALWAYS
- case so that we can't possibly return TRUE unless we really did
- connect successfully.
-
-2002-03-10 Dan Winship <danw@ximian.com>
-
- Rename the OpenSSL implementation of things to match the NSS
- implementation so that callers don't need to care which one is
- being used.
-
- * camel-tcp-stream-openssl.c: Implement CamelTcpStreamSSL, not
- CamelTcpStreamOpenSSL. Rename methods as well. Replace the
- camel-tcp-stream-openssl.h include with camel-tcp-stream-ssl.h.
-
- * camel-tcp-stream-openssl.h: Gone.
-
- * camel-tcp-stream-ssl.c: Add a note explaining that this
- implementation is only used for NSS, and that OpenSSL's
- implementation is in another file. (Should probably do some CVS
- renaming magic at some point.)
-
- * camel-http-stream.c (http_connect): Remove OpenSSL refs; the
- previously-NSS-specific code works for both now.
-
- * camel-remote-store.c: Likewise.
-
- * providers/smtp/camel-smtp-transport.c: Likewise.
-
- * providers/pop3/camel-pop3-store.c: Likewise.
-
- * Makefile.am (libcamelinclude_HEADERS): Remove
- camel-tcp-stream-openssl.h
-
-2002-03-10 Dan Winship <danw@ximian.com>
-
- * camel-tcp-stream.c (camel_tcp_stream_get_socket): Remove this:
- it couldn't be generically used, because different subclasses
- returned entirely different types of data.
- (camel_tcp_stream_get_local_address,
- camel_tcp_stream_get_remote_address): Add these to replace what
- get_socket was being used for.
- (camel_tcp_address_new, camel_tcp_address_free): Utility functions
- for get_{local,remote}_address.
-
- * providers/smtp/camel-smtp-transport.c: Change localaddr to a
- CamelTcpAddress *.
- (connect_to_server): Call camel_tcp_stream_get_local_address to
- get the local IP address.
- (smtp_disconnect): free localaddr.
- (smtp_helo): Update for localaddr change.
-
- * camel-tcp-stream-raw.c (stream_get_socket): Remove
- (stream_get_local_address, stream_get_remote_address): Implement.
-
- * camel-tcp-stream-ssl.c (stream_get_socket): Remove
- (stream_get_local_address, stream_get_remote_address): Implement.
-
- * camel-tcp-stream-openssl.c (stream_get_socket): Remove
- (stream_get_local_address, stream_get_remote_address): Implement.
-
-2002-03-08 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/pop3/camel-pop3-provider.c
- (camel_provider_module_init): Don't call
- camel_remote_store_get_authtypes since we no longer subclass
- camel-remote-store.
-
- * providers/pop3/camel-pop3-engine.c: Added STARTTLS to the
- capabilities to look for.
- (camel_pop3_engine_reget_capabilities): New function to re-get
- capabilities.
-
- * providers/pop3/camel-pop3-store.c: Updated to not subclass
- CamelRemoteStore.
- (connect_to_server): Rewritten to not depend on CamelRemoteStore's
- connect implementation. Also added support for STLS (aka
- STARTTLS).
-
-2002-03-07 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-pgp-mime.c (camel_pgp_mime_part_sign): Add support for
- hash type RIPEMD160.
-
- * camel-cipher-context.h: Add RIPEMD160 hash type.
-
- * camel-pgp-context.c (pgp_sign): Updated to consider hash
- function for pgp5 and pgp6.
- (pgp_clearsign): Same.
-
- * camel-tcp-stream-openssl.c (stream_read): Add a timeout on the
- select.
- (stream_write): Same.
-
-2002-03-06 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/smtp/camel-smtp-transport.c (connect_to_server): Fix
- to work with OpenSSL.
-
- * camel-tcp-stream-openssl.c: compile fixes.
- (camel_tcp_stream_openssl_enable_ssl): Check to make sure that the
- sockfd != -1, it's not enough to check that it is non-zero. Also
- set the sockfd to -1 on fail (open_ssl_connection will close the
- sockfd on fail).
-
-2002-03-06 Dan Winship <danw@ximian.com>
-
- * providers/smtp/camel-smtp-transport.c (smtp_construct): Make
- this compile.
-
-2002-03-05 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-tcp-stream-ssl.c (save_ssl_cert): Removed. Glory glory
- hallelujah!
- (ssl_bad_cert): No longer calls ssl_save_cert or
- ssl_cert_is_saved.
-
-2002-03-05 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-tcp-stream-openssl.c (camel_tcp_stream_openssl_new_raw):
- Start the ssl stream off in non-ssl mode (useful for STARTTLS).
- (camel_tcp_stream_openssl_enable_ssl): New function to toggle an
- ssl stream into ssl mode.
- (open_ssl_connection): Close the sockfd on fail so our caller
- doesn't have to - this also allows us to save the original errno.
- (stream_connect): If we want ssl mode, do our ssl stuff.
- (camel_tcp_stream_openssl_class_init): Init some SSL stuff here
- instead of in open_ssl_connection since these only ever need to be
- called once.
- (stream_read): Only use SSL_read if we are in ssl mode.
- (stream_write): Only use SSL_write if we are in ssl mode.
-
- * providers/smtp/camel-smtp-transport.c (smtp_helo): Check for the
- STARTTLS extension.
- (connect_to_server): Try to use STARTTLS whenever possible rather
- than the old way of doing things.
- (connect_to_server_wrapper): Wrapper around connect_to_server() to
- first try STARTTLS and then attempt normal SSL mode if we can't
- connect via STARTTLS.
-
- * camel-tcp-stream-ssl.c (camel_tcp_stream_ssl_enable_ssl): New
- function to toggle an ssl stream into ssl mode.
- (camel_tcp_stream_ssl_new_raw): Start the ssl stream off in
- non-ssl mode (useful for STARTTLS).
- (stream_connect): Only connect in SSL mode if required.
-
-2002-03-01 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-vtrash-folder.h:
- * camel-vee-store.h:
- * camel-vee-folder.h:
- * camel-stream-null.h:
- * camel-stream-filter.h:
- * camel-store-summary.h:
- * camel-news-address.h:
- * camel-mime-utils.h:
- * camel-mime-parser.h:
- * camel-mime-filter-save.h:
- * camel-mime-filter-linewrap.h:
- * camel-mime-filter-index.h:
- * camel-mime-filter-html.h:
- * camel-mime-filter.h:
- * camel-mime-filter-from.h:
- * camel-mime-filter-crlf.h:
- * camel-mime-filter-chomp.h:
- * camel-mime-filter-charset.h:
- * camel-mime-filter-bestenc.h:
- * camel-mime-filter-basic.h:
- * camel-internet-address.h:
- * camel-folder-thread.h:
- * camel-folder-summary.h:
- * camel-folder-search.h:
- * camel-filter-driver.h:
- * camel-charset-map.h:
- * camel-address.h: Add c++ armoring.
-
- * camel-object.h: s/class/klass
-
-2002-03-01 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-part-utils.c
- (camel_mime_part_construct_content_from_parser): Reverted my
- pgp/mime fixes here too.
-
- * camel-mime-part.c (write_to_stream): Removed my pgp/mime raw
- stream hack, this is causing problems such as some messages to not
- displaying, view->source not working at all, etc.
-
-2002-02-28 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-parser.c: Changed offset variables from int's to
- off_t's since the system may support large files.
-
- * camel-mime-part-utils.c
- (camel_mime_part_construct_content_from_parser): Rearrange the
- save filter stuff so that we save raw streams for all mime
- parts. If the mime part turns out to be a multupart, then don't
- bother saving the raw stream, we only need to save the raw stream
- for leaf parts.
-
-2002-02-27 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-folder-summary.h: Don't #include camel-mime-filter-save.h,
- we don't use it.
-
- * camel-file-utils.c: Fixed a few 'might be used uninitialized'
- warnings which were real problems.
-
- * camel-mime-part-utils.c
- (camel_mime_part_construct_content_from_parser): Save the raw mime
- stream for any/all signed parts.
-
- * camel-mime-part.c (camel_mime_part_init): Initialize our raw
- stream to NULL.
- (camel_mime_part_finalize): Unref our raw stream, if we have one.
- (write_to_stream): If we have a raw stream, write that out instead
- of re-encoding.
-
- * camel-mime-filter-save.[c,h]: Rewritten to save to a stream
- rather than a file.
-
-2002-02-28 Not Zed <NotZed@Ximian.com>
-
- * camel-mime-utils.c (header_fold): Use the FOLD_SIZE as a
- recommended folding size, but add a new FOLD_MAX_SIZE (=998, the
- smtp max line size) as the hard limit for any output.
-
-2002-02-27 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-filter-chomp.c (camel_mime_filter_chomp_new): New
- stream filter that chomps excess trailing whitespace from the end
- of the stream. This is needed to update the PGP/MIME code to
- comply with rfc3156.
-
- * camel-pgp-mime.c (camel_pgp_mime_part_verify): Don't attach a
- from filter, if it ain't from-filtered already, then we'll just be
- breaking stuff. To become rfc3156 compliant, add a chomp filter
- here.
- (camel_pgp_mime_part_sign): Add a chomp filter here too.
-
-2002-02-27 Not Zed <NotZed@Ximian.com>
-
- * camel-mime-part.c (init_header_name_table): Changed header
- formatted table to contain a pointer to an output function, and
- added in-reply-to and references headers.
- (write_references): New function to write out references header,
- folded properly. It only approximates based on the last >, but it
- should be adequate and will also handle invalid headers.
- (write_fold): Function to write out headers folded. Since this is
- the default it isn't required.
- (write_raw): Write out an already formatted header, e.g. most of
- the rest.
- (write_to_stream): Lookup header output function, if we have one,
- use that, otherwise fold header using basic (dumb) function.
-
- This is all for #14779. A better fix is probably do have the
- headers always stored formatted, but that can wait.
-
-2002-02-25 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-digest-folder.c (camel_digest_folder_new): Allow all
- multiparts that contain message/rfc822 attachments.
- (digest_get_uids): Only assign uids to message parts.
-
-2002-02-22 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-part.c (camel_mime_part_set_filename): Set the 'name'
- parameter on the Content-Type too. Fixes bug #20779.
-
-2002-02-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-pgp-context.c (pgp_sign): Pass --always-trust to gpg
- (requested by users).
- (pgp_clearsign): Same.
- (pgp_encrypt): Here too.
-
-2002-02-12 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/smtp/camel-smtp-transport.c (smtp_helo): Since the
- AUTH token sometimes uses '=' instead of whitespace, don't use
- smtp_token_next here.
-
-2002-02-09 Not Zed <NotZed@Ximian.com>
-
- * providers/pop3/camel-pop3-engine.c (get_capabilities): Duh, when
- we grab the apop stamp it needs to include the <> as well, I even
- read the rfc, silly me.
-
- * providers/pop3/camel-pop3-store.c (pop3_try_authenticate): Doh,
- when iterating the authtype list, it helps to goto the next node.
- Found with help from miles.
-
-2002-02-08 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-spool-summary.c
- (camel_spool_summary_build_from): The day number has to be 2 chars
- wide, space filled to work properly with pine, etc.
-
- * providers/local/camel-spoold-store.[ch]: new type of provider
- 'spool directory', which lets you view external mbox dirs without
- adding any extra cruft. Perhaps it should use . files to store
- summaries? Still a bit experimental, there's a warning when you
- select it in the account editor. Finished off most of #1185.
- Can't rename or move folders.
-
- * camel-mime-utils.c (header_decode_date): If the date is
- 100->1900 then we actually want to use it as the year in the tm
- struct, not year+100. e.g. year 102 -> 2002, not 2102.
-
-2002-02-07 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-spool-store.c (get_folder): Pass path into
- spool_folder_new.
-
- * providers/local/camel-spool-folder.c (camel_spool_folder_new):
- (camel_spool_folder_construct): Take the full path to the folder
- and use that as the file path, independent of the full_name we
- use.
-
-2002-02-07 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-local-provider.c: Added new type, spoold
- provider, spoold: for local directories.
-
- * providers/imap/camel-imap-store.c (get_one_folder_offline):
- Create offline uri's in a compatible manner to online ones.
-
-2002-02-07 Dan Winship <danw@ximian.com>
-
- * camel-sasl-ntlm.c: Implementation of NTLM (aka "Secure Password
- Authentication") auth, taken from soup.
-
- * Makefile.am (libcamel_la_SOURCES, libcamel_la_HEADERS): Add
- camel-sasl-ntlm.
-
- * camel-sasl.c: Add refs to camel-sasl-ntlm.
-
- * providers/imap/camel-imap-store.c (try_auth): Use
- imap_next_word() to skip over the "+ " of the continuation rather
- than just "resp + 2" since Exchange (incorrectly) returns "+"
- instead of "+ " for an empty continuation response.
-
-2002-02-06 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-folder-summary.h: Remove the CAMEL_MESSAGE_NEEDS_REPLY
- flag, we no longer will be using this.
-
-2002-02-04 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-http-stream.c (stream_read): Use camel_mime_parser_read to
- read internal parser data.
- (camel_http_stream_get_content_type): Implemented.
- (http_method_invoke): Use HTTP/1.0 instead of 1.1
-
- * camel-mime-utils.c (header_decode_int): Made public.
-
- * camel-http-stream.[c,h]: Added. New stream for HTTP requests
- (currently supported are GET and HEAD).
-
- * camel-tcp-stream-ssl.c (stream_connect): Call set_errno
- appropriately.
-
-2002-01-31 Not Zed <NotZed@Ximian.com>
-
- * camel-mime-utils.c (header_decode_domain): Oops, this was
- converting foo@[blah] to foo@[ blah ], fixed.
-
-2002-01-30 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/pop3/camel-pop3-provider.c: Use "pop" instead of
- "pop3" so current configurations continue to work.
-
-2002-01-30 Not Zed <NotZed@Ximian.com>
-
- * camel-sasl-login.c: Changed name from "NT Login" to simply
- "Login".
-
- * providers/pop3/*: Entirely new pop implmentation, supporting
- pipelining.
-
-2002-01-29 Not Zed <NotZed@Ximian.com>
-
- * camel-data-cache.c (free_busy): We dont want to unref the
- stream, instead, stop listening to the finalised events, and free
- the path only.
-
-2002-01-25 Not Zed <NotZed@Ximian.com>
-
- * camel-data-cache.c (stream_finalised): Remove the object from
- the busy_stream hashtable, not the busy_path hashtable.
-
-2002-01-29 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-folder.c (imap_update_summary): Added
- more kludge to an existing Exchange IMAP 5.5 kludge to work around
- it returning multiple messages with the same UIDs.
-
-2002-01-28 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-message.c (process_header): Handle Resent headers
- too.
-
- * camel-mime-message.h: Added Resent-* #defines.
-
- * camel-filter-driver.c (camel_filter_driver_remove_rule_by_name):
- Use while (node->next) instead of while (node)
-
- * providers/smtp/camel-smtp-transport.c (smtp_decode_status_code):
- New function to decode an enhanced status code.
- (smtp_set_exception): Sets an exception based on the
- Enhanced-Status-Code.
- (esmtp_get_authtypes): Don't diplicate the key in the hash since
- the key and value are the same.
- (smtp_rcpt): Include the failed recipient in the error message to
- be more helpful to the user.
-
- * camel-mime-utils.c (hex_decode): Make sure to allocate enough
- for the NUL byte.
-
-2002-01-28 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/smtp/camel-smtp-transport.c (smtp_construct):
- (connect_to_server): Use flags rather than a bunch of gboolean
- variables.
- (smtp_connect): Same.
- (smtp_mail): Here too. Use the enhanced status codes if available.
- (smtp_data): And again here.
- (smtp_helo): Finally here. Also detect the ENHANCEDSTATUSCODES
- extension.
- (smtp_rcpt): Use the enhanced status codes if available.
- (smtp_rset): Here too.
- (smtp_quit): And finally here.
-
- * camel-transport.h: Removed gboolean supports_8bit since this is
- pretty local to only SMTP for now.
-
-2002-01-24 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am: Remove some old cruft.
-
-2002-01-24 Ettore Perazzoli <ettore@ximian.com>
-
- * tests/folder/Makefile.am: s/MAILER_LIBS/EVOLUTION_MAIL_LIBS/.
- * tests/message/Makefile.am: Likewise.
- * tests/mime-filter/Makefile.am: Likewise.
- * tests/misc/Makefile.am: Likewise.
- * tests/smime/Makefile.am: Likewise.
- * tests/stream/Makefile.am: Likewise.
-
-2002-01-24 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-filter-driver.c (do_beep): Call the beep callback
- function.
- (camel_filter_driver_set_system_beep_func): New function to set
- the beep callback.
-
-2002-01-22 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-filter-driver.c (camel_filter_driver_remove_rule_by_name):
- New function to remove a filter rule by name.
-
-2002-01-21 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-filter-driver.c (do_beep): As a temporary solution, just
- printf ("\a"); to make a beep :-)
-
- * providers/imap/camel-imap-command.c
- (imap_command_strdup_vprintf): Encode the mailbox to UTF-7 here.
-
- * providers/imap/camel-imap-utils.c (imap_parse_list_response):
- Decode the mailbox name as we parse the list response.
- (imap_mailbox_decode): It's only an illegal mailbox name if it
- didn't switch back to US-ASCII mode.
-
-2002-01-18 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-utils.c (imap_mailbox_decode): New
- function to decode an IMAP mailbox name from modified UTF-7
- encoding to UTF-8.
- (imap_mailbox_encode): New function to convert a mailbox name from
- UTF-8 to IMAP's modified UTF-7 encoding.
-
-2002-01-17 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-filter-basic.c (filter): Stop uudecoding once the
- CAMEL_UUDECODE_STATE_END state bit gets set. Set the
- CAMEL_UUDECODE_STATE_BEGIN state bit once we find the begin line.
- (reset): No longer have uu_begin or uulen state variables, these
- are now stuffed into a single state variable.
-
- * camel-mime-utils.c (uudecode_step): No longer needs a uulen
- argument and also keeps track of whether or not the end of the
- encoded data has been found in 'state'.
- (uuencode_step): Now stuffs uulen into state so that the uulen
- argument is no longer needed.
- (uuencode_close): Same.
-
-2002-01-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-filter-basic.c (filter): If we don't want to corrupt
- the uuencoded data by overwriting it with base64 decoded data
- afterward, we need to add a break statement!
-
- * camel-folder-summary.c (summary_build_content_info): Add code to
- add a uu filter.
- (camel_folder_summary_finalize): Unref the uuencode filter.
-
-2002-01-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-filter-basic.c (filter): Fixed slight logic error to
- find the uuencode begin line. Fixes bug #18754.
-
-2002-01-15 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/smtp/camel-smtp-transport.c (smtp_send_to): Updated to
- match the new send_to API.
- (smtp_send): Get the from address and pass that along to
- smtp_send_to().
-
- * providers/sendmail/camel-sendmail-transport.c
- (sendmail_send_to): Updated to match the new send_to API.
-
- * camel-transport.c (camel_transport_send_to): Now takes a from
- argument too.
-
- * providers/imap/camel-imap-folder.c (imap_update_summary): Sort
- the needheaders UID array and fixed to respect the
- UID_SET_LIMIT. This should now finish the fixification of bug
- #2529. There's still the possible issue that a command-line (The
- only command-line I can think of that can still be too long is a
- SEARCH command, but this can't possibly be fixed until we rewrite
- the imap code to use Zucchi's ImapEngine idea).
-
-2002-01-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-folder.c (imap_expunge_uids_online):
- Move the command-lock outside the loop.
-
-2002-01-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-folder.c (imap_expunge_uids_online):
- Updated to use the new imap_uid_array_to_set() interface.
- (imap_expunge_uids_resyncing): Same.
- (do_copy): Here too.
- (imap_update_summary): Added a FIXME comment to rewrite allowing
- for a uid-set limitation.
- (get_matching): Copy some of the logic over from
- imap_uid_adday_to_set() to limit the length of the uid-set string.
- (imap_sync_online): Added a comment to explain what is going on
- with get_matching() since the behavior has changed slightly.
-
- * providers/imap/camel-imap-utils.c (imap_uid_array_to_set):
- Modify the interface so that we can limit the size of the uid set
- string returned.
-
-2002-01-14 Not Zed <NotZed@Ximian.com>
-
- * providers/imap/camel-imap-search.c (imap_body_contains):
- Rewritten to use a cache for body searches when online. Will need
- some heavy testing but so far seems to be beneficial.
-
- * providers/imap/camel-imap-folder.c (imap_search_by_expression,
- search_by_uids): dont initialise search object here.
- (camel_imap_folder_new): Setup search object here with pointer to
- cache dir.
-
-2001-12-01 Not Zed <NotZed@Ximian.com>
-
- * camel-store-summary.[ch]: New class to store a store's folder
- list in. Not yet completed.
-
-2002-01-11 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-folder.c (imap_update_summary): Kludge
- around a bug in Exchange 5.5 that reports 2 messages with the same
- UID. Fixes bug #17694. Replaces the fix from yesterday.
-
-2002-01-10 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/local/camel-local-folder.c: If PATH_MAX doesn't exist,
- use _POSIX_PATH_MAX.
-
- * providers/imap/camel-imap-folder.c (imap_update_summary): If mi
- is NULL, don't bother updating it. Should fix bug #17694.
-
-2002-01-10 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel.h: #include camel-mime-filter-tohtml.h
-
- * providers/imap/camel-imap-folder.c (imap_update_summary): Kludge
- around Microsoft Exchange 5.5 (bug #5348) by forgetting our
- currently selected folder and re-SELECTing it so that the Exchange
- server has a chance to realise it has new messages.
-
-2002-01-09 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/local/camel-local-folder.c
- (camel_local_folder_construct): If the mbox file is a symlink,
- follow the symlink and get the One True Path so that we can
- rewrite the mbox later without worrying about clobbering the
- symlink.
-
-2002-01-08 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-filter-search.c (TODO): There are a few sexp callbacks
- that could be modified to use fms->info rather than using a
- message object (like date and possibly mlist stuff) but *only* if
- the date exists on the CamelMessageInfo object (since it may be
- blank except for message flags).
- (camel_filter_search_get_message): New internal convenience
- function to make sure that the FilterMessageSearch has loaded the
- message (and to load the message if this isn't the case).
- (check_header): Call camel_filter_search_get_message().
- (header_exists): Same.
- (header_regex): Here too.
- (header_full_regex): And here.
- (body_contains): Again here.
- (body_regex): Here too.
- (get_sent_date): Here also.
- (get_received_date): Same.
- (get_source): Here if we need to.
- (camel_filter_search_match): Now takes a callback function/data
- pair for on-demand message loading so that we don't necessarily
- have to load the message if the defined filter rules don't require
- it.
-
- * camel-filter-driver.c (camel_filter_driver_filter_folder): Don't
- bother fetching the message here, let
- camel_filter_driver_filter_message() worry about this.
- (get_message_cb): New utility callback to fetch a message.
- (camel_filter_driver_filter_message): Only fetch the message if we
- absolutely need it to get a CamelMessageInfo. Instead of passing a
- message object to camel_filter_search_match(), pass get_message_cb
- and some user_data so that the matching code can fetch the message
- on demand.
-
-2002-01-07 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-folder.c (filter_filter): Flush the only-once actions.
-
- * camel-filter-driver.c (camel_filter_driver_filter_message):
- Don't increment a filtered_count here any longer.
- (camel_filter_driver_reset_filtered_count): Removed.
- (camel_filter_driver_get_filtered_count): Removed.
- (do_beep): New action.
- (play_sound): New action to play a sound
- (do_only_once): Another new action.
- (camel_filter_driver_finalise): Free the only_once hash if the
- driver has not been "flushed".
- (camel_filter_driver_flush): Flush all of the only-once actions.
-
- * camel-charset-map.c: Moved windows-1251 to the end of the list
- since it contains the euro and we'd prefer to use iso-8859-15 when
- the euro is requested than a windows charset if possible.
-
- * camel-charset-map-private.h: Regenerated.
-
-2001-12-12 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-folder-summary.c (content_info_load): Don't try setting a
- content-type parameter if either the name or value is NULL.
-
- * camel-mime-utils.c (header_set_param): NULL-protection.
-
-2002-01-02 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-tcp-stream-ssl.c (ssl_bad_cert): Do more like what mutt
- does so hopefully this'll fix bug #16363 and #16300.
-
-2001-12-21 Jeffrey Stedfast <fejj@ximian.com>
-
- * broken-date-parser.c (parse_broken_date): Completely
- rewritten. It is now a load faster and a heck of a lot more
- accurate, also now returns a time_t and sets the saveoffset
- variable rather than returning a new char* buffer for the normal
- camel date parser to re-parse. This saves a fair number of cpu
- cycles :-)
-
- * camel-mime-utils.c (header_decode_date): Cleanup the broken date
- parsing code.
-
-2001-12-20 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-address.h: Change the prototype for camel_address_get_type
- to return a CamelType (since internally this is what it returns
- and also in case we decide to write a replacement for the current
- CamelObject it'd be easier to drop in).
-
- * camel-internet-address.h: Same but for
- camel_internet_address_get_type()
-
- * providers/smtp/camel-smtp-transport.c (smtp_send_to): Updated to
- use a CamelAddress of recipients.
- (smtp_send): Since smtp_send_to now takes a CamelAddress
- recipients argument, our lives have been simplified and we can now
- just concat To/Cc/Bcc into a recipients addr and send away.
-
- * providers/sendmail/camel-sendmail-transport.c
- (sendmail_send_to): Updated to use a CamelAddress of recipients.
-
- * camel-transport.c (camel_transport_send_to): Now takes a
- CamelAddress argument for the recipient list rather than a GList.
-
-2001-12-19 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/smtp/Makefile.am: Remove the providerdir variable.
-
- * providers/sendmail/Makefile.am: Same.
-
-2001-12-17 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-charset-map.c (camel_charset_iso_to_windows): New function
- to map ISO charsets to the Windows charsets.
-
- * camel-mime-part-utils.c (broken_windows_charset): Detect Windows
- charsets.
- (simple_data_wrapper_construct_from_parser): Simplify a tad and
- also check for iso-8859-* charsets that are really Windows
- charsets. Fixes bug #12631.
-
-2001-12-17 Dan Winship <danw@ximian.com>
-
- * Makefile.am (INCLUDES): define CAMEL_PROVIDERDIR to be the
- configure.in-defined camel_providerdir.
-
- * providers/Makefile.am: Remove some outdated comments
-
- * providers/imap/Makefile.am (camel_provider_LTLIBRARIES,
- camel_provider_DATA): renamed from provider_LTLIBRARIES,
- provider_DATA.
-
- * providers/local/Makefile.am: Likewise
-
- * providers/nntp/Makefile.am: Likewise
-
- * providers/pop3/Makefile.am: Likewise
-
- * providers/sendmail/Makefile.am: Likewise
-
- * providers/smtp/Makefile.am: Likewise
-
-2001-12-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-folder.c (get_content): Reverted my
- previous changes here since it doesn't actually work afterall.
-
- * providers/imap/camel-imap-wrapper.c (imap_wrapper_hydrate):
- Update to do uudecoding when appropriate.
-
-2001-12-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-folder.c (get_content): Try to use the
- original boundary so luis will stop bugging me about "data
- corruption". Also preserve other params in the multipart
- content-type by dumping it to a string and setting it on the mime
- part.
-
-2001-12-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-filter-driver.c
- (camel_filter_driver_reset_filtered_count): Reset the
- filtered_count to zero.
- (camel_filter_driver_get_filtered_count): Return the private
- filtered_count value.
- (camel_filter_driver_filter_message): Increment the
- filtered_count.
- (camel_filter_driver_set_shell_exec_func): New function to set the
- shell-exec func.
- (shell_exec): New ESExp filter action callback.
-
-2001-12-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-pgp-mime.c (camel_pgp_mime_part_verify): Removed
- x-inline-pgp-hack kludge because it doesn't work.
- (camel_pgp_mime_part_decrypt): Same.
-
-2001-12-13 Chris Toshok <toshok@ximian.com>
-
- * camel-data-cache.c: include stdlib.h (for alloca on freebsd) and
- only include alloca.h if HAVE_ALLOCA_H is defined.
-
-2001-12-11 Zbigniew Chyla <cyba@gnome.pl>
-
- Fixes #17085
-
- * camel-charset-map.c: Added #include <errno.h>.
-
- * camel-charset-map-private.h:
- Recreated (following instructions from camel-charset-map.c)
-
-2001-12-11 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-object.c (camel_type_register): Keep a name-to-type hash
- so that we can make sure that the type has not yet been registered
- (prevents a race condition such as the one in bug #16559).
-
- * camel-service.c (camel_service_connect): Make sure that the
- connect_op is non-NULL before unregistering/unreffing it.
-
-2001-12-04 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-utils.c (header_content_type_simple): Protect against
- either of the types being NULL.
-
-2001-12-05 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-filter-basic.c (filter): If complete() allocates
- len+2 bytes for the out buffer, so should this. See bug #16371 for
- an example case.
-
-2001-12-05 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-sasl-digest-md5.c: iconv() returns a size_t, not an int.
-
- * camel-pgp-context.c: The return value of iconv() is a size_t,
- not an int.
-
- * camel-mime-part-utils.c (convert_buffer): Always use size_t args
- for iconv().
-
- * camel-mime-filter-charset.c (complete): Always use size_t args
- for iconv().
- (filter): Same.
-
- * camel-mime-utils.c (header_address_fold): Make headerlen a
- size_t instead of an int.
- (header_fold): Same.
- (base64_encode_close): We should be returning a size_t and inlen
- should also be a size_t.
- (base64_encode_step): Same here.
- (base64_decode_step): Here too.
- (base64_encode_simple): And here...
- (base64_decode_simple): Same.
- (uuencode_close): We should also use size_t's here...
- (uuencode_step): And here too.
- (uudecode_step): And also here.
- (quoted_encode_close): Same idea here.
- (quoted_encode_step): Again here.
- (quoted_decode_step): Here too.
- (quoted_encode): Input length should be a size_t.
- (rfc2047_decode_word): Same.
- (g_string_append_len): Here too.
- (append_8bit): "
- (rfc2047_encode_word): "
- (quote_word): "
- (hex_decode): "
- (rfc2184_decode): Use size_t's with iconv().
- (header_decode_param): Same.
-
-2001-12-09 Jon Trowbridge <trow@ximian.com>
-
- * camel-folder-summary.c: Add "NeedsReply" to the flag_names array
- for CAMEL_MESSAGE_NEEDS_REPLY.
-
- * camel-folder-summary.h: Added CAMEL_MESSAGE_NEEDS_REPLY flag.
-
-2001-12-07 Dan Winship <danw@ximian.com>
-
- * camel-mime-message.c (camel_mime_message_set_date): Fix the
- tm_gmtoff case (its sign is the opposite of "timezone"). Fixes
- #14678
-
-2001-11-29 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-folder-search.c (search_body_contains): Don't use regex
- matching. Fixes bug #16227.
-
- * camel-mime-message.c (best_encoding): Check the content-object's
- mime type, not the mime part types. Should fix bug #15843.
-
-2001-11-27 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-folder.c (get_content): Return NULL if
- construct_from_stream fails.
- (get_message): Same.
- (get_message_simple): Here too.
- (add_message_from_data): And here.
-
-2001-11-14 Not Zed <NotZed@Ximian.com>
-
- * camel-vee-folder.c (folder_changed_remove_uid): Use the uid
- rather than vuid for unmatched. Also add the uid to unmatched if
- it wasn't in the unmatched_uids table at all.
- (folder_changed_change): If checking for added, if the new ones
- dont match, then try to add them to unmatched. Fixes #6893.
-
- * camel-folder-summary.c (camel_folder_summary_index): Change lock
- order, always summary_lock before ref_lock.
- (camel_folder_summary_array): "
- (camel_folder_summary_uid): "
- (camel_folder_summary_remove_uid): " Fixes a deadlock.
-
-2001-11-30 Not Zed <NotZed@Ximian.com>
-
- * providers/nntp/camel-nntp-*.c: Completely new implementation of
- NNTP.
-
- Doesn't support subscriptions yet (lists all folders), but should
- be more reliable (faster?), and has an integrated cache.
-
- * camel-exception.c (camel_exception_new): Use e_memchunks for
- exception blocks.
- (camel_exception_free): Same.
-
- * camel-data-cache.[ch]: New object for managing on-disk caches of
- anything that can be stored in a camel-stream.
-
- * camel-file-utils.c (camel_file_util_mkdir): New function, just a
- nicer place to put this (than camel-store), should be removed from
- camel-store.
- (camel_file_util_safe_filename): New function to url-encode a
- filename.
-
- * camel-mime-parser.c (drop_states): New func to drop the parser
- state to initial state.
- (folder_scan_init_with_fd):
- (folder_scan_init_with_stream): Call above func to reset state if
- the stream is changed on us so we can change streams to reuse a
- parser object.
-
-2001-11-25 Not Zed <NotZed@Ximian.com>
-
- * providers/nntp/camel-nntp-folder.c (nntp_folder_get_message): If
- the uid doesn't have a ',' in it, fail to crash.
-
- * providers/nntp/camel-nntp-newsrc.c
- (camel_nntp_newsrc_article_is_read): check group != NULL before
- scanning.
- (camel_nntp_newsrc_get_highest_article_read): "
- (camel_nntp_newsrc_get_num_articles_read): "
- (camel_nntp_newsrc_mark_range_read): "
-
- * providers/nntp/camel-nntp-store.c
- (camel_nntp_store_get_overview_fmt): IF we dont have
- nntp_list_follows, dont try and get a list response.
- (nntp_store_get_folder_info): Set path part of folderinfo.
-
-2001-11-20 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/smtp/camel-smtp-transport.c (get_smtp_error_string):
- Check to see that errno is non-zero before returning
- g_strerror. If it's 0, then we have an unknown error.
-
-2001-11-26 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-filter-basic.c: For the uudecoding mode, garble up
- the "begin <mode> <filename>" line before decoding.
-
- * camel-mime-part-utils.c
- (simple_data_wrapper_construct_from_parser): Add a uudecoder if
- the transfer encoding is x-uuencode.
-
- * camel-mime-part.c (write_to_stream): Handle x-uuencoded content
- too.
-
-2001-11-19 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-tcp-stream-ssl.c (stream_read): Added a check to see if
- the operation has been cancelled.
- (stream_write): Same.
-
-2001-11-19 Jeffrey Stedfast <fejj@ximian.com>
-
- Updates for compliance with rfc2231
-
- * camel-mime-utils.c (header_encode_param):
- camel_mime_special_table[c] & IS_ESAFE should have been
- !(camel_mime_special_table[c] & IS_ESAFE). Also added a few
- comments for how to improve the code at some future date.
- (header_decode_param): Now takes an argument rfc2184_part so our
- caller can get this information as well.
- (header_decode_param_list): Pass an rfc2184_part argument to
- header_decode_param and also added a few comments on where to
- improve on rfc2184/rfc2231 compliance.
- (rfc2047_decode_word): Updated to respect the updated ABNF syntax
- of rfc2047 encoded words, yay.
-
-2001-11-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-utils.c (imap_parse_body): Abort if
- body == NULL.
-
- * camel-mime-filter-tohtml.c (camel_mime_filter_tohtml_new): New
- mime filter to convert plain text to html.
-
-2001-11-16 Jeffrey Stedfast <fejj@ximian.com>
-
- Since some mail clients like Outlook are broken, we need to set a
- name parameter on pgp signed and encrypted parts.
-
- * camel-pgp-mime.c (camel_pgp_mime_part_encrypt): Set a name
- parameter.
- (camel_pgp_mime_part_sign): Same.
-
-2001-11-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-command.c
- (camel_imap_command_response): If we get a BYE response, call
- camel_service_disconnect() and set an exception. Also do the check
- for "* BYE" first instead of passing it off imap_read_untagged()
- since we'll just waste time in there mallocing left and right only
- to arrive at the single response line "* BYE" again :-)
-
-2001-11-13 Not Zed <NotZed@Ximian.com>
-
- * camel-filter-search.c (get_source): If we have no source string,
- then use undefined, which should always evaluate to FALSE. Fix
- for #15267.
-
-2001-11-12 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-store.c (camel_store_get_folder): Added a
- g_return_val_if_fail for folder_name != NULL.
-
-2001-11-08 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-pgp-context.c (crypto_exec_with_passwd): If any of the
- pipe()'s fail, clean up any pipes that may have succeeded. Also
- close the password fds.
-
-2001-11-09 Not Zed <NotZed@Ximian.com>
-
- * providers/imap/camel-imap-store.c (imap_auth_loop): If we get a
- user cancel and that causes us to fail to authenticate, abort
- rather than loop forever. Fix for #14951.
-
-2001-11-06 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-command.c
- (camel_imap_command_continuation): Now takes a command-length
- argument so we can 1) avoid duping the command string yet again,
- yay. 2) we now don't have to worry about embedded nul-chars
- screwing us over (we still need to avoid allowing them into the
- string but at least now it won't mess us up).
-
- * providers/imap/camel-imap-folder.c (do_append): Instead of
- appending a nul char to the end of the byte array and then passing
- that off as if it were a string to
- camel_imap_command_continuation, instead pass the byte-array
- length since that function now takes a length argument. Yay. Also
- encode any 8bit parts to avoid the possibility of sending embedded
- nul chars to the imap server.
-
- * providers/imap/camel-imap-store.c (try_auth): Updated to pass a
- command-length argument to camel_imap_command_continuation().
-
-2001-11-07 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-tcp-stream-ssl.c (save_ssl_cert): Oops, pass a mode
- argument to the open() call.
-
- * camel-tcp-stream-openssl.c (save_ssl_cert): Oops, pass a mode
- argument to the open() call.
-
-2001-11-07 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-pgp-mime.c (camel_pgp_mime_part_decrypt): Add code to
- kludge around any x-inline-pgp-hacks by prepending some content
- headers to the decrypted data.
-
-2001-11-02 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-data-wrapper.c (camel_data_wrapper_init): Initialize our
- private mutex.
- (camel_data_wrapper_finalize): Destroy our private mutex.
- (write_to_stream): Lock around camel_stream_write_to_stream() so
- that we don't get 2 threads trying to read from our stream at the
- same time.
-
-2001-11-01 Not Zed <NotZed@Ximian.com>
-
- * camel-vee-folder.c (folder_changed_change): Move all searching
- operations outside of any locks except subfolder lock, same as
- build_folder. Fix for #14294.
-
-2001-10-31 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-spool-folder.c (spool_get_message): Same
- as below.
-
- * providers/local/camel-maildir-folder.c (maildir_get_message):
- Same as below.
-
- * providers/local/camel-mbox-folder.c (mbox_get_message): Set
- USER_CANCEL if failed due to EINTR.
-
- * camel-filter-driver.c (camel_filter_driver_filter_mbox): If
- construct from parser fails due to user cancel, set USER_CANCEL on
- exception.
-
- * camel-mime-part.c (construct_from_parser): Return error if the
- parser had an io error.
-
- * camel-mime-message.c (construct_from_parser): Check error on
- parser/return error.
-
- * camel-mime-parser.c (folder_scan_init): Init error number.
- (camel_mime_parser_errno): New function, return errno of any io
- failures.
- (folder_read): Set errno if a failure occured.
- (folder_seek): Same.
- (folder_scan_init_with_fd): Setup errno depeding on ok/failure.
- (folder_scan_init_with_stream): Same.
-
-2001-10-30 Not Zed <NotZed@Ximian.com>
-
- * camel-operation.c (camel_operation_new): Dont setup cancel_fd.
- (camel_operation_cancel_fd): If cancel_fd not created, set it up.
- (camel_operation_cancel): Set cancel flag before sending message.
- (cancel_thread): Same.
-
- * camel-filter-driver.c (camel_filter_driver_filter_mbox): Make
- sure we unref the mimeparse when we're done (successfully). This
- was leaking an fd every get-mail! :(
-
- * camel-lock-client.c (camel_lock_helper_init): Close all fd's
- above 2.
-
- * providers/local/camel-mbox-folder.c (mbox_get_message): Remove
- the X-Evolution header before anyone else gets to see this private
- thing. Shoudl fix 11676 since we were inheriting flags from
- X-Evolution headers we didn't want to.
-
- * camel-folder-search.c (match_message): If we can't retrieve the
- message, ignore it, it can't match.
-
- * providers/imap/camel-imap-search.c
- (camel_imap_search_class_init): Setup parent class pointer.
- (imap_body_contains): If offline, just use the parent
- body_contains method which will get the messages and search them
- manually.
-
- * providers/imap/camel-imap-folder.c (imap_search_by_expression,
- imap_search_by_uids): Remove offline check.
-
-2001-10-30 Dan Winship <danw@ximian.com>
-
- * camel-mime-part.c (free_headers): Fix this to match get_headers.
-
-2001-10-30 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-local-store.c (rename_folder): Dont try to
- move ibex if we have none.
-
- * camel-tcp-stream-openssl.c (stream_write): Fixed compilation
- errors.
-
-2001-10-29 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-utils.c (camel_mime_utils_init): Removed unused
- variable.
-
-2001-10-30 Not Zed <NotZed@Ximian.com>
-
- * camel-mime-utils.c (header_decode_mailbox): w(x) out some warnings.
-
- * providers/local/camel-local-summary.c
- (camel_local_summary_load): Remove the warning about not loading
- summary file - its a valid case for new folders.
-
-2001-10-29 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-tcp-stream-openssl.c (my_SSL_write): Removed.
- (stream_write): Keep looping (non-blocking case) if errno is
- EAGAIN, EINTR or EWOULDBLOCK. For NONBLOCKing I/O, sync up with
- CamelTcpStreamRaw. As with CamelTcpStreamRaw/SSL - make sure to
- write out everything before returning.
- (my_SSL_read): Removed.
- (stream_read): Just call ssl_error_to_errno() and check the errno
- values that we care about so we can keep the general look of all
- this stream code the same. Also when checking the return value of
- SSL_read, check for <0 instead of ==-1 since the man page for
- SSL_read doesn't say it will return -1 on fail, it just says <0.
- (stream_flush): Don't fsync() since syncing on a socket is a Bad
- Thing (tm).
-
- * camel-tcp-stream-ssl.c (stream_write): Make sure we write out
- everything just like in camel-tcp-stream-raw.c.
-
- * camel-stream-buffer.c (camel_stream_buffer_gets): If
- camel_stream_read() returns -1, don't necessarily return -1 to our
- caller since it's possible that we did actually "read" some data
- (ie, we copied some pre-buffered data into the out buffer).
-
- * camel-stream-buffer.h: Removed CAMEL_STREAM_BUFFER_NEWLINE since
- it never got used anywhere and it isn't supported anyway.
-
-2001-10-30 Not Zed <NotZed@Ximian.com>
-
- * providers/imap/camel-imap-store.c
- (parse_list_response_as_folder_info): If we get an empty name,
- then mark that as NoSelect. Workaround fix for #13239.
-
-2001-10-29 Dan Winship <danw@ximian.com>
-
- * providers/imap/camel-imap-folder.c (get_message_simple,
- imap_get_message): Set an X-Evolution-Source header on the
- returned message so replies come from the right identity.
-
-2001-10-29 Not Zed <NotZed@Ximian.com>
-
- * camel-vee-folder.c (folder_changed_change): If we're not going
- to search on a changed uid, make sure we change out copy still.
- Fixes #13916.
-
-2001-10-29 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-store.c (subscribe_folder): Don't emit
- a folder_subscribed signal if we are in the process of renaming
- folders.
- (unsubscribe_folder): Same here but for the unsubscribe signal.
- (rename_folder): Unsubscribe from the folder being renamed and any
- subfolders it may have before actually renaming. Once the folder
- has been renamed, re-subscribe to it and it's subfolders with the
- new name.
-
- * camel-store.c (camel_folder_info_build): Sort the folder info's
- before constructing the tree.
-
- * camel-mime-utils.c (header_decode_param): Minor fix - should
- have been using a strNcmp when checking if it was an rfc2047
- encoded word.
-
- * camel-pgp-context.c (pgp_sign): Notify the user that PGP 2.6.x
- is no longer supported and use camel_exception_set() instead of
- setv() where appropriate.
- (pgp_clearsign): Same.
- (pgp_verify): And again here.
- (pgp_encrypt): Here too.
- (pgp_decrypt): And finally here.
-
-2001-10-29 Dan Winship <danw@ximian.com>
-
- * providers/imap/camel-imap-store.c (unsubscribe_folder): Don't
- free the hash table key if the folder wasn't found in the hash
- table. I'm not sure where the bug is/was that made it possible to
- add a folder to the tree after creating it failed, but now if that
- happens, it won't crash if you try to delete it again. (#11492)
-
- * camel-disco-store.c (camel_disco_store_status): if the service
- is being connected and thinks it's online, but the session is
- offline, then mark the service offline as well. Fixes 13683.
-
-2001-10-29 Not Zed <NotZed@Ximian.com>
-
- * camel-mime-utils.c: Turn off w() -> warnings.
-
- * providers/imap/camel-imap-store.c (rename_folder): Also rename
- the message cache.
- (rename_folder): Fix subscribed folders table with rename(s).
-
- * providers/imap/camel-imap-folder.c (imap_rename): Implement,
- rename the cache dir pointer.
-
- * providers/imap/camel-imap-message-cache.c
- (camel_imap_message_cache_set_path): New method to set the path
- used by a message cache.
-
- * camel-vee-store.c (build_info): Fix the 'is this a matching
- subfolder or subfolder' logic to match camel-store
- get_subfolders'.
-
- * camel-store.c (get_subfolders): Fix the 'is this a matching
- folder or subfolder' logic.
-
-2001-10-28 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-local-store.c (rename_folder): Changed to
- call ibex_move to rename it internally.
-
- * camel-store.c (camel_store_rename_folder): Use the right
- variable, not info.
-
-2001-10-28 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-stream-buffer.c (camel_stream_buffer_read_line): Make sure
- we've actually read data before checking if p[-] is '\r' or not.
-
- * camel-tcp-stream-raw.c (stream_write): Same.
-
- * camel-stream-fs.c (stream_write): If errno isn't EAGAIN, just
- exit with -1 and instead of using continue (which doesn't go to
- the top of the do-while thus making our logic suck), just set w to
- 0. Still seems to be a bug in select() if it's telling us the
- socket is ready for data when it really isn't but oh well.
-
-2001-10-28 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-local-folder.c
- (camel_local_folder_construct): Use path not protocol as the path
- part of the uri of the folder_created event.
-
- * providers/local/camel-maildir-store.c (scan_dir): If FAST is
- set, dont try and scan for unread counts.
-
- * providers/local/camel-local-store.c (create_folder): Implement,
- just return the folderinfo of the folder matched, not all of it.
-
- * camel-store.c (camel_store_rename_folder): Rename the
- camelfolders before emitting the folderchanged event (otherwise
- vstore fails to pick up change.
-
-2001-10-27 Not Zed <NotZed@Ximian.com>
-
- * camel-store.c (camel_store_init): Always use a default dir_sep
- of '/'.
-
- * camel-store.h (struct _CamelStore): Added a dir_sep to the base
- store so rename and whatnot can work, temporary fix for mixed dir
- separator in folder name api's.
-
- * providers/imap/camel-imap-store.c (rename_folder): Finished
- implementation.
- (imap_connect_online): Also set the store's dir_sep here.
- (imap_connect_offline): "
-
- * providers/local/camel-local-folder.c (local_rename): Implement
- local rename of folder objects.
-
-2001-10-26 Not Zed <NotZed@Ximian.com>
-
- * camel-vee-folder.c (camel_vee_folder_class_init): Hook into
- rename function.
- (vee_rename): Implement the veefolder rename function.
- (camel_vee_folder_class_init):
- (folder_changed_change): Kill a warning with a cast.
-
- * camel-vee-store.c (vee_rename_folder): Emit a folder_renamed
- event properly, also call parent to do some rename stuff.
-
- * camel-store.h: Added a CamelRenameInfo for the rename event.
-
- * camel-folder.c (camel_folder_rename): New function to rename a
- folder object.
- (camel_folder_class_init): Added a renamed event.
- (folder_rename): Default impl, set full_name, and set name
- assuming the dir separator is '/'.
-
- * camel-store.c (camel_store_class_init): Added folder_renamed
- event.
- (camel_store_rename_folder): Rename an active folder object if we
- have one, and update the folder table.
- (rename_folder): Make a default implementation that handles
- updating the folder tree.
-
-2001-10-26 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-store.c (delete_folder): Don't bother
- checking ex since we can rely on the response being NULL on error.
- (rename_folder): Implemented.
-
-2001-10-26 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-folder.c (imap_get_message): Check to
- make sure that the dataset is non-NULL before using and/or
- freeing.
-
- * camel-tcp-stream-raw.c (stream_write): Check for EWOULDBLOCK
- too?
- (stream_read): Same.
- (stream_flush): Return 0 always, fsync() and tcp sockets don't
- play nice :-)
-
- * providers/imap/camel-imap-message-cache.c
- (camel_imap_message_cache_get): Lets try putting a
- camel_stream_reset() here. Logic being that the stream may have
- been read from since it was cached and thus our caller may try
- reading from it and get no data from it since it is already at the
- EOS. This may fix bug #12943.
-
-2001-10-25 Not Zed <NotZed@Ximian.com>
-
- * camel-search-private.c (utf8_get): Remove the stupid warning
- that should never have been there in the first place.
-
- * camel-sasl-digest-md5.c (digest_response): s/iconv/e_iconv/
-
- * camel-pgp-context.c (pgp_verify): "
-
- * camel-mime-utils.c (rfc2047_decode_word, rfc2047_decode_word,
- append_8bit, rfc2047_encode_word, rfc2184_decode,
- header_decode_param): "
-
- * camel-mime-part-utils.c (convert_buffer, convert_buffer): "
-
- * camel-mime-filter-charset.c (reset, complete, filter): "
-
-2001-10-24 Not Zed <NotZed@Ximian.com>
-
- * camel-mime-filter-basic.c (complete): For qp decoding, if the
- data isn't really qp encoded, we could possible grow the buffer by
- upto 2 bytes above the input size, fix allocations/assertions
- appropraitely.
-
- * camel-vee-folder.c (folder_changed_change): If we're not
- autoupdate, only search for new matches against changed uid's that
- we dont already have.
-
-2001-10-24 Dan Winship <danw@ximian.com>
-
- * providers/imap/camel-imap-store.c (unsubscribe_folder): Don't
- let fi->name be NULL.
-
-2001-10-24 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-stream-fs.c (stream_read): Same as in the TcpStreamRaw code.
- (stream_write): And again here...
-
- * camel-tcp-stream-raw.c (stream_read): Handle the EAGAIN error
- case as well.
- (stream_write): Same here, this might fix the SMTP truncation
- thing? I hope?
-
-2001-10-23 Dan Winship <danw@ximian.com>
-
- * camel-mime-utils.c (mail_list_magic): Remove an extra * in one
- of the regexps that glibc apparently doesn't mind but bsd does.
-
-2001-10-23 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-mbox-summary.c: made d(x) x recompile again.
-
-2001-10-22 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-spool-summary.c (summary_rebuild): No, use
- Storing, as the other code does :p
- (spool_summary_check): Check for consistency.
-
-2001-10-22 Jon Trowbridge <trow@ximian.com>
-
- * providers/local/camel-spool-summary.c (summary_rebuild):
- s/summarising/summarizing/.
- (spool_summary_check): s/summarise/summarize/.
-
-2001-10-22 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-pgp-mime.c (camel_pgp_mime_part_verify): If we are
- kludging around a inline-pgp signed part, do some charset
- conversion to protect any 8bit text.
-
-2001-10-22 Not Zed <NotZed@Ximian.com>
-
- * camel-filter-search.c, camel-folder-search.c (check_header): Use
- search_type_mlist for mailing list searches.
-
- * camel.c (camel_init): call camel-mime-utils-init func.
-
- * camel-mime-utils.c: Changed mail mail_list_magic to include a
- domain part, also pre-compile all the patterns. They are all
- backward compatible except List-Id: which now uses the
- mail-address-like <list-name.host.name> part rather than the
- plain-text part (which might've been blank anyway).
- (camel_mime_utils_init): Initialisation function to setup any
- static data required by camel-mime-utils at run-time. We now
- setup the base64/charset class tables here, so it doesn't need to
- be done statically.
- (camel_mime_special_table, camel_mime_base64_rank): No longer
- statically initialise these.
- (main): Removed + the tests at the end of the file.
- (header_raw_check_mailing_list): Dont compile regex's here,
- already compiled in utils_init. Use the regex patterns to remove
- leading <'s from addresses. Also, if there is a domain part
- matched, add that after a '@' is added.
-
- * camel-search-private.c (camel_search_header_match): Match check
- against all addresses in a multiple address match. Should fix
- #13051.
- (camel_search_header_match): Oops, missing i=0.
- (camel_search_header_match): Added SEARCH_TYPE_MLIST for mlist
- search types. It ignores the domain part if either (but not both)
- of the values dont have it.
-
-2001-10-22 Dan Winship <danw@ximian.com>
-
- * camel-pgp-mime.c (camel_pgp_mime_part_verify): Add a hack: if
- the multipart/signed part has a "x-inline-pgp-hack" parameter in
- its Content-Type, don't pass the MIME headers as part of the data
- to be verified.
-
-2001-10-22 Rodrigo Moya <rodrigo@ximian.com>
-
- * Makefile.am: added $GNOME_INCLUDEDIR to INCLUDES, needed for latest
- libgnome, which install headers in $(prefix)/gnome-1.0
-
-2001-10-21 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-part-utils.c
- (simple_data_wrapper_construct_from_parser): Only do the rawtext
- checks if the part is a text part, otherwise don't bother wasting
- cpu cycles.
-
- * camel-store.c (camel_folder_info_build): Updated comments to
- make the code a bit more clear.
-
-2001-10-21 Not Zed <NotZed@Ximian.com>
-
- * camel-store.c (CS_CLASS): Dont do the macro stuff - basically so
- you can actually debug calls.
- (camel_store_uri_cmp): New function to compare store objects.
-
- * camel-vee-folder.c (vee_folder_add_info): oops, dont free the
- vuid, since its alloca'd now.
- (folder_changed_change): Kill a compile warning.
-
-2001-10-20 Not Zed <NotZed@Ximian.com>
-
- * camel-folder.c (move_messages_to): If no exception supplied, use
- a local one.
- (move_message_to): Set the seen flag also when we delete it.
-
-2001-10-19 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-vtrash-folder.c (vtrash_move_messages_to): If the
- destination folder is the vfolder source folder, then
- set_message_flags on it.
-
-2001-10-19 Not Zed <NotZed@Ximian.com>
-
- * camel-session.c (register_provider): When registering provider,
- translate all strings.
-
- * camel-vee-folder.c (camel_vee_folder_remove_folder): Lock the
- right lock for unmatched subfolder list stuff. If the sub folder
- is deleted & part of unmatched, or the last ref to the sub folder
- is gone from unmatched, blow it away completely from unmatched,
- but only do it once.
- (vee_folder_remove_folder): Added arg to kill unmatched
- unconditionally. Also handle deleted folders, always remove
- stuff.
- (folder_changed_change): Lock subfolder lock for entirety of
- operation, and also check to see if the subfolder is still there
- before doing any fancy work (incase it got removed while we were
- waiting to execute).
- (folder_changed_change_uid): Use alloca for vuid, and not
- sprintf(".lengths")
- (vee_search_by_expression): Dont use sprintf for vuid.
- (vee_search_by_uids): "
- (vee_folder_add_info): "
- (folder_changed_remove_uid): "
- (folder_changed_change): "
- (folder_changed_change_uid): Also check folder_unmatched for
- changed uid's so we properly update/propagate unmatched changes.
- (folder_changed_change): Ok, so dont hold the subfolder lock for
- the whole duration of the changed event, although we probably
- should, requires a recursive mutex.
- (folder_changed_change): Change logic, we always add changed stuff
- if it now matches, but dont remove it unless its auto-remove, only
- propagate changes for it.
- (vee_set_message_flags): Call parent method after doing our work.
- (vee_set_message_user_flag): Same here.
-
-2001-10-18 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-part-utils.c
- (simple_data_wrapper_construct_from_parser): If a charset isn't
- specified or claims to be utf-8, check the validity of the text
- and if it's invalid, set the rawtext bit to TRUE. If the charset
- is x-unknown or some other x- charset, always set the rawtext bit
- to TRUE.
-
-2001-10-18 Not Zed <NotZed@Ximian.com>
-
- * camel-store.c (camel_store_unsubscribe_folder): If we are
- unsubscribing from a folder we have loaded, set the folder
- deleted, as with the delete_folder case.
-
- * providers/(imap|local|pop3|sendmail|smtp)/Makefile.am: Added
- CAMEL_CFLAGS so we get the right iconv stuff, patch from Yanko
- Kaneti <yaneti@declera.com>
-
-2001-10-18 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-pgp-context.c (crypto_exec_with_passwd): Make sure the
- cancel_fd isn't -1.
-
-2001-10-18 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-message-cache.c (insert_finish): Flush
- the stream here, not sure it really matters but it might
- (hopefully) fix bug #12943.
-
- * camel-pgp-context.c (crypto_exec_with_passwd): Make
- user-cancellable.
-
- * providers/local/camel-local-provider.c: String cleanup for bug
- #6640.
-
- * providers/imap/camel-imap-folder.c (imap_sync_online): Fix my
- Cyrus imapd workaround...instead of checking to see if info->flags
- == FLAGGED, just check to see if it contains any IMAP flags.
-
-2001-10-17 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-maildir-folder.c
- (camel_maildir_folder_new): Use '.' as the inbox name for filter
- new messages test.
-
- * camel-store.c (camel_folder_info_clone): New function to clone a
- folderinfo tree.
-
-2001-10-17 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/local/camel-mh-folder.c (mh_append_message): Same as
- maildir and mbox append-message.
-
- * providers/local/camel-maildir-folder.c (maildir_append_message):
- Same as mbox append.
-
- * camel-exception.c (camel_exception_set): Make sure the new
- description isn't the same as the old description pointer before
- freeing the old one.
- (camel_exception_setv): Don't free the old description until we
- set the new one this way we can reuse the old description in the
- new description.
-
- * providers/local/camel-mbox-folder.c (mbox_append_message): If
- errno == EINTR, then we got a user-cancel so set the exception
- appropriately so that we don't make the user shit his pants.
-
- * camel-filter-driver.c (do_copy): Add an optimization for when
- destination folder is the same as the source folder.
-
-2001-10-17 Not Zed <NotZed@Ximian.com>
-
- * providers/imap/camel-imap-store.c (get_folder_info_online):
- (parse_list_response_as_folder_info): Patch from Danw, Use unread
- count of -1 to mark unflagged messages. Make sure any folder we
- dont lookup explicitly is marked as -1. Should fix #9947 and
- friends.
-
- * providers/local/camel-mbox-summary.c (mbox_summary_sync): Only
- touch the summary if the timestamp or size changed.
-
-2001-10-17 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-filter-driver.c (camel_filter_driver_filter_message): Set
- the DELETED flag on directly on the info if the source folder
- doesn't have summary capability.
-
-2001-10-17 Not Zed <NotZed@Ximian.com>
-
- * camel-tcp-stream-raw.c (stream_write): As below.
-
- * camel-stream-fs.c (stream_write): If not checking cancellation,
- make sure we write out everything asked of us.
-
-2001-10-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-pgp-context.c (pgp_verify): Rearange the order of the gpg
- options slightly otherwise it might try to use "--no-tty" as the
- filename to verify :-)
-
- * camel-object.[c,h]: If CAMEL_DEBUG is defined, print some useful
- ref/unref info.
-
- * providers/imap/camel-imap-store.c (delete_folder): Fixed an
- assignment warning.
-
- * camel-uid-cache.c (camel_uid_cache_new): Make sure that the
- parent directory exists before trying to open the filename, if it
- doesn't, create it.
-
-2001-10-16 Not Zed <NotZed@Ximian.com>
-
- * camel-mime-utils.c (header_address_decode): If no content, dont
- try and decode further and spit meaningless warnings.
-
-2001-10-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-filter-driver.c (do_flag): Only perform the operation on
- the folder if the folder has summary capability, else just poke
- the info directly. Fixes the "Filters don't work" bug.
- (do_score): Same.
- (do_colour): And here too.
-
-2001-10-15 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-stream-fs.c (stream_read): Save the errno before calling
- fcntl so fcntl doesn't overwrite errno in case of a previous
- error.
- (stream_write): Same.
-
-2001-10-13 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/smtp/camel-smtp-transport.c (smtp_data): Replace the
- Bcc headers in a single location and don't flush the data unless
- the write was successful.
-
-2001-10-12 Jeffrey Stedfast <fejj@ximian.com>
-
- * Makefile.am: Remove the stripheader filter from the build.
-
- * camel-mime-filter-stripheader.[c,h]: Removed.
-
- * providers/smtp/camel-smtp-transport.c (smtp_data): Check the
- return value of camel_stream_flush to make sure it flushed the
- data successfully before continuing. Don't use the stripheader
- filter, it was completely broken - instead remove the header and
- set it again after we send.
-
-2001-10-12 Not Zed <NotZed@Ximian.com>
-
- * camel-vee-folder.c (camel_vee_folder_remove_folder): Unhook from
- all events before removing folder.
- (camel_vee_folder_add_folder): Hook onto delete event.
- (camel_vee_folder_finalise): Unhook from deleted event for suibfolder.
- (subfolder_deleted): When the folder is deleted, remove it from
- the vfolder automagically.
-
-2001-10-11 Not Zed <NotZed@Ximian.com>
-
- * camel-vee-folder.c (vee_search_by_uids): convert the uids list
- to a subset appropriate for each subfolder before trying to search
- on it.
-
- * camel-charset-map.[ch]: Removed charset/locale charset lookup
- and iconv_open/close functions, moved to gal. Fixed all callers.
-
-2001-10-11 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-tcp-stream-ssl.c (ssl_cert_is_saved): Same.
-
- * camel-tcp-stream-openssl.c (ssl_cert_is_saved): Instead of
- opening the file, stat it and make sure that it belongs to us.
-
-2001-10-10 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-tcp-stream-openssl.c (ssl_verify): Same hack as below.
-
- * camel-tcp-stream-ssl.c (ssl_bad_cert): Hack around the fact that
- adding a cert to nss's certdb seems to not work.
-
-2001-10-10 Not Zed <NotZed@Ximian.com>
-
- * camel-vee-folder.c (vee_sync): Only re-build the folder if we're
- expunging. Also only clear out the changed folders list if we're
- expungung and everything worked.
-
-2001-10-10 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-charset-map.c (camel_charset_map_init): Added a hack for
- Solaris systems.
-
-2001-10-10 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-maildir-store.c (scan_dir): oops, we want
- get_unread_message_count, not get_message_count!
-
-2001-10-09 Not Zed <NotZed@Ximian.com>
-
- * camel-service.c (camel_service_disconnect): Duplicate connect
- code that unregisters a cancel op if we created one.
-
- * camel-operation.c (camel_operation_progress): Another go at
- getting the logic right again. Make transients only update after
- 5 seconds (CAMEL_OPERATION_TRANSIENT_DELAY)
- (camel_operation_end): Likewise.
-
- * providers/local/camel-spool-folder.c (spool_search_by_uids):
- Implement.
-
- * providers/imap/camel-imap-search.c (imap_body_contains): If
- searching a sub-set of the total message count, then use a UID
- range to search only specific messages.
-
- * camel-vee-folder.c (vee_folder_change_match): Removed.
- (folder_changed_add_uid): Helper func for changed code.
- (folder_changed_remove_uid): "
- (folder_changed_change_uid): "
- (folder_changed): Rewritten. Supports proper auto-updating of
- changes, but not removals till a sync occurs.
- (vee_search_by_uids): Implement.
- (folder_changed): Changed to call an async threaded function to do
- the actual folder updating.
-
- * camel-folder-summary.c (camel_flag_list_copy): New func to copy
- a whole list of flags.
- (camel_tag_list_copy): New func to copy a whole list of flags.
-
- * providers/imap/camel-imap-folder.c (imap_search_by_uids):
- Implement.
-
- * providers/local/camel-local-folder.c (local_search_by_uids):
- Implement.
-
- * camel-folder.c (camel_folder_search_by_uids): New function,
- search a subset of uid's.
- (search_by_uids): Default impl, return error.
-
-2001-10-08 Dan Winship <danw@ximian.com>
-
- * camel-folder.h (struct _CamelFolder): replace the ever-growing
- list of gbooleans with a single guint32 for flags.
-
- * camel-folder.c: Update folder flag setting/checking.
-
- * providers/pop3/camel-pop3-folder.c (camel_pop3_folder_init):
- * providers/nntp/camel-nntp-folder.c (camel_nntp_folder_new):
- * providers/local/camel-spool-folder.c (spool_init,
- camel_spool_folder_new):
- * providers/local/camel-maildir-folder.c (camel_maildir_folder_new):
- * providers/local/camel-local-folder.c (local_init):
- * providers/imap/camel-imap-folder.c (camel_imap_folder_init,
- camel_imap_folder_new):
- * camel-vtrash-folder.c (camel_vtrash_folder_init):
- * camel-vee-folder.c (camel_vee_folder_init):
- * camel-digest-folder.c (camel_digest_folder_init): update folder
- flag setting.
-
-2001-10-07 Dan Winship <danw@ximian.com>
-
- * providers/imap/camel-imap-store.c (get_folder_online): Unlock
- the store before returning error. (noted by NotZed)
-
-2001-10-06 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-utils.c (header_decode_text): Fix a slight error in
- logic. Just because the last word was an encoded word doesn't mean
- we ignore the lwsp padding, we only ignore it if the last word and
- *this* word are encoded.
-
-2001-10-06 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-filter-basic.c (filter): Implemented uuencoding and
- decoding.
- (complete): Implemented uuencoding and decoding.
-
- * camel-mime-utils.c (uuencode_close): New function to flush the
- uu encoder.
- (uuencode_step): New function to uuencode a block of data.
-
-2001-10-05 Not Zed <NotZed@Ximian.com>
-
- * providers/imap/camel-imap-store.c (subscribe_folder): Use a
- folder_subscribed event rather than a folder_created one.
- (unsubscribe_folder): Similarly for unsubscribed/deleted.
- (create_folder): Emit a folder_created event on the folders we
- added. Not sure hsould probably check which ones are new and
- which ones are just existing ones?
- (delete_folder): Emit a folder_deletd event when we've deleted the
- folder. Part of fix for #11831.
-
- * camel-store.c (camel_store_class_init): Added
- folder_subscribed/unsubscribed events.
-
-2001-10-05 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-service.c (camel_service_finalize): Turn off warnings.
- (get_name): Same.
-
- * camel-sasl.c (sasl_challenge): Turn off warnings.
-
- * camel-tcp-stream.c (tcp_connect): Turn off warnings.
- (tcp_getsockopt): Same.
- (tcp_setsockopt): Here too.
- (tcp_get_socket): And here.
-
- * camel-folder.c (folder_sync): Turn off warnings.
- (expunge): Same.
- (append_message): Here too.
- (get_message): And here.
- (search_by_expression): And again here.
- (folder_changed): Here too.
-
- * camel-store.c (get_folder): Set an exception and turn off
- debugging g_warnings.
- (create_folder): Same.
- (delete_folder): Here too.
- (rename_folder): And here.
- (get_trash): And here.
- (get_folder_info): Same.
- (free_folder_info): And again here.
- (camel_folder_info_build): Here too.
- (folder_subscribed): Same.
- (subscribe_folder): Here too.
- (unsubscribe_folder): And here.
-
-2001-10-05 Not Zed <NotZed@Ximian.com>
-
- * camel-mime-utils.c (header_decode_mailbox): Try harder to get
- broken names out of addresses. Unencoded ,'s in names will still
- break it, but well what can you do eh?
- (header_decode_mailbox): Always add .'s into address we've scanned
- past a '.', even if we can't decode the next part. Fix for some
- annoying bug #.
-
-2001-10-04 Not Zed <NotZed@Ximian.com>
-
- * camel-store.c (camel_store_delete_folder): Change the order of
- execution slightly. We delete the folder first, then call the
- classes delete folder, then cleanup the hashtable afterwards.
- This is so deletes of vfolders work, since vee-store uses the
- folder hashtable to store all of is vfolders :-/
-
-2001-10-04 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-service.c (camel_service_connect): Unregister the
- operation before unreffing it.
-
-2001-10-03 Not Zed <NotZed@Ximian.com>
-
- * providers/imap/camel-imap-folder.c (camel_imap_folder_changed):
- Remove now unused 'recents' array/freeing func.
-
- * camel-object.c (camel_object_trigger_event): Oops, always run
- the prep function, even if we have no hooks listening. Causes
- incoming imap recents to get ignored bythe camel-folder filter
- inbox code.
-
- * providers/local/camel-local-folder.c (local_sync): Dont
- explicitly save metadata, its saved in summary_sync.
-
- * providers/local/camel-mh-summary.c: Call superclass.
- (mh_summary_check): Dont save ibex.
-
- * providers/local/camel-maildir-summary.c: Call superclass method.
- (maildir_summary_check): Dont save ibex explictly.
-
- * providers/local/camel-mbox-summary.c: Call super-class sync when
- done, saves summary/ibex, etc.
- (mbox_summary_check): Dont save ibex.
- (mbox_summary_sync): Call summary_check rather than trying to
- update from our known position.
-
- * providers/local/camel-local-summary.c
- (camel_local_summary_check): Dont save the summary or index here.
- (local_summary_sync): Save the summary/index here.
-
- * camel-search-private.c (camel_search_build_match_regex): Added
- MATCH_NEWLINE flag, -> REG_NEWLINE.
-
- * camel-lock-helper.c: Include <string.h> to kill some warnings.
-
- * camel-filter-search.c (get_full_header): Put \n's between each
- line we generate.
- (header_full_regex): Dont drop the first argument to the command
- -> empty matches!
- (header_full_regex): Set match_newline for building regex.
- (body_regex): And here too. These all fix #9877.
-
-2001-10-03 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-store.c (camel_store_delete_folder): Call
- camel_folder_delete() on the folder if it's "alive".
-
- * camel-folder.c (camel_folder_delete): Mark the folder as
- deleted, perform any folder specific cleanup and emit the deleted
- event.
- (camel_folder_sync): Only sync the folder if it hasn't been
- deleted.
- (camel_folder_expunge): Same.
-
-2001-10-03 Dan Winship <danw@ximian.com>
-
- * providers/local/camel-local-provider.c (local_url_equal):
- Strange are the ways of alloca. Fixes 11543.
-
-2001-10-02 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-tcp-stream-ssl.c (ssl_bad_cert): Import the certificate if
- the user accepts it.
-
-2001-10-02 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-local-provider.c (local_url_hash,
- local_url_equal): for hashing/comparing local url's, we ignore
- trailing /'s in paths (maybe shuld handle multiple /'s too).
- (camel_provider_module_init): Use local_url_hash/equal for all
- functions.
-
- * camel-sasl-digest-md5.c (digest_response): Change to
- camel_charset_iconv_open/close.
-
- * camel-pgp-context.c (pgp_verify): Change to
- camel_charset_iconv_open/close.
-
- * camel-mime-part-utils.c (convert_buffer): Change to
- camel_charset_iconv_open().
-
- * camel-mime-filter-charset.c
- (camel_mime_filter_charset_new_convert, finalise): Change to
- camel_charset_iconv_open, etc.
-
- * camel-mime-utils.c: Use the camel_charset_iconv_open/close()
- functions to open/close it.
-
- * camel-charset-map.c (camel_charset_iconv_open): New function,
- wrap iconv_open, so we can cache ic's.
- (camel_charset_iconv_close): Likewise for close.
- (camel_charset_map_init,shutdown): Init/free iconv cache.
-
-2001-10-02 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-charset-map.c (camel_charset_to_iconv): Revert my
- x-unknown special-case hack - this may mask other problems.
-
- * camel-mime-utils.c (rfc2047_decode_word): If the iconv
- conversion fails, for whatever reason, retry using the user's
- locale charset.
-
-2001-10-02 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-maildir-store.c (get_folder_info): Go back
- to using the store url's path, not the toplevel_dir thing.
-
- * camel-operation.c (camel_operation_progress): Fix the progress
- logic, so we dont update too often.
-
- * camel-object.c (camel_object_get_hooks): Change the lock to a
- recursive e-mutex.
- (camel_object_hook_event): Maintain list length of hook list.
- (camel_object_unhook_event): "
- (camel_object_unhook_event): If we are in an event, just mark the
- pair as removed, without removing it.
- (camel_object_trigger_event): Before running events, copy the
- list, and also ignore 'removed' events. After running events, if
- we're all out of events, then free up any pending-removed events.
- (camel_object_free_hooks): Add some new assertions on the state of
- the hook structure.
- Removed the #error if threads not defined. It _should_ actually
- work without threads.
- (camel_object_free_hooks): Free mutex when done.
-
-2001-10-01 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-store.c (delete_folder): Remove any
- cached messages that belonged to the deleted folder.
- (subscribe_folder): Don't ever let the info->name be NULL and
- don't use the stupid concat kludge to generate the URL, just use a
- CamelURL to do it. This way we don't risk breaking stuff by having
- a url like imap://fejj@imap//folder
-
- * camel-charset-map.c (camel_charset_to_iconv): If the charset is
- x-unknown, return the locale_charset.
-
-2001-10-01 Dan Winship <danw@ximian.com>
-
- * camel-provider.h: Fix up the provider flags to specify things
- more completely so we don't have to hardcode provider names in the
- mailer.
-
- * providers/local/camel-local-provider.c: MH, mbox, and Maildir
- are LOCAL. MH and mbox are no longer STORAGE by the new
- definition.
-
- * camel-session.c (vee_provider): The vfolder store is a STORAGE.
-
-2001-10-01 Dan Winship <danw@ximian.com>
-
- * providers/local/camel-local-store.c (construct): Don't munge the
- URL; CamelSession's caching relies on it not changing. Instead,
- add a toplevel_dir field to CamelLocalStore, and set that to the
- path, but always ending with /.
- (camel_local_store_finalize): Free toplevel_dir
- (camel_local_store_get_toplevel_dir): Return toplevel_dir rather
- than url->path.
-
- * providers/local/*: Lots of s/url->path/toplevel_dir/
-
- * providers/local/camel-spool-store.c (construct): Likewise, don't
- try to strip a trailing / from url->path here, but I didn't make
- the corresponding toplevel_dir change, because there's no good
- reason someone should expect "/var/spool/mail/danw/" to work since
- that's not a directory.
-
- * providers/pop3/camel-pop3-folder.c (pop3_refresh_info): if STAT
- returns 0, don't bother sending UIDL. Speeds things up slightly
- and also works around a bug in a particular random POP server.
- (ximian bug 11369).
-
-2001-09-29 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-pgp-context.c (pgp_sign): Add --no-secmem-warning and
- --no-greeting to the gpg command-line options.
- (pgp_clearsign): Same.
- (pgp_verify): Here too.
- (pgp_encrypt): And here.
- (pgp_decrypt): And finally here.
-
-2001-09-28 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-filter-search.c (get_source): Same here.
-
- * camel-mime-message.c (camel_mime_message_set_source): Don't use
- the e_url_shroud hack, use CamelURL functions instead.
-
-2001-09-28 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/nntp/camel-nntp-provider.c
- (camel_provider_module_init): Init the nntp url hash and url_equal
- functions.
-
- * providers/sendmail/camel-sendmail-provider.c
- (camel_provider_module_init): Init the sendmail url hash and
- url_equal functions.
-
- * providers/smtp/camel-smtp-provider.c
- (camel_provider_module_init): Init the smtp url hash and url_equal
- functions.
-
- * providers/pop3/camel-pop3-provider.c
- (camel_provider_module_init): Init the pop3 url hash and url_equal
- functions.
-
- * providers/imap/camel-imap-provider.c
- (camel_provider_module_init): Init the imap url hash and url_equal
- functions.
-
- * providers/local/camel-local-provider.c
- (camel_provider_module_init): Init the local url hash and
- url_equal functions.
-
- * camel-session.c (camel_session_class_init): Init the vfolder url
- hash and url_equal functions.
-
- * camel-provider.h: Added url_hash and url_equal function pointers
- to the structure.
-
- * camel-vtrash-folder.c (vtrash_move_messages_to): Oops, a
- CamelFolder is not a CamelFolderClass.
-
-2001-09-28 Dan Winship <danw@ximian.com>
-
- * camel-tcp-stream-openssl.c (ssl_error_to_errno): Make this take
- an SSL * instead of a CamelTcpStreamSSL *, since it can get called
- from open_ssl_connection, when the CamelTcpStreamSSL isn't set up
- right yet. Fixes a crash on connection failure.
-
-2001-09-27 Dan Winship <danw@ximian.com>
-
- * providers/imap/camel-imap-folder.c
- (camel_imap_folder_fetch_data): Grab the store's command_lock
- before grabbing the folder's cache_lock to prevent deadlock if
- another thread is processing an EXPUNGE response.
-
- * providers/imap/camel-imap-folder.c
- (imap_expunge_uids_resyncing): Fix a compiler warning that might
- point out a real bug...
-
- * providers/imap/camel-imap-folder.c (get_content): and one that
- doesn't
-
-2001-09-27 Not Zed <NotZed@Ximian.com>
-
- * camel-service.c (camel_service_connect): Dont re-register the
- connect_op if we got it by calling 'operation_registered', which
- returns an already-registered one.
- (camel_service_disconnect): Likewise here. This removes all the
- re-registered warnings.
-
- * camel-object.c (camel_object_unref): Fill the finalised data
- with nonsense, rather than 0's - more easily detect bad data.
- (camel_object_new): Clear instance data when we retrieve it off
- the list.
-
- * camel-object.h (_CamelObject): Added an event lock pointer for
- uh, locking event stuff. Also change the hooklist hashtable into
- a list. Changed all the code to handle it. Result: thread-safe
- events, event-hooks, and save memory too, and SHOULD FINALLY FIX
- THAT UNREAD COUNT PROBLEM.
-
-2001-09-27 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-pgp-mime.c (camel_pgp_mime_part_decrypt): CRLF decode the
- stream before parsing it into a MIME part. This fixes bug #10521.
-
- * camel-store.c: Remove the old folder from the vTrash folder.
-
-2001-09-27 Dan Winship <danw@ximian.com>
-
- * camel-service.c: Change "gboolean connected" to
- "CamelServiceConnectionStatus status", which can be disconnected,
- connecting, connected, or disconnecting.
- (camel_service_init, camel_service_finalize): create/destroy the
- connect_op_lock. Refer to service->status rather than
- service->connected.
- (camel_service_connect): When connecting, note the current
- operation (and create a new one if there's none registered) and
- mark the connection "connecting" until we succeed or fail.
- (camel_service_disconnect): Likewise in reverse.
- (camel_service_cancel_connect): New function to cancel a
- connection attempt.
- (cancel_connect): Default implementation: Call
- camel_operation_cancel on the connect_op.
-
- * camel-disco-store.c (disco_connect): Only call
- CamelRemoteStore's connect func if we're online.
- (disco_cancel_connect): Fall back to offline if a connection gets
- cancelled.
- (disco_get_folder_info): Kludge: call connect explicitly before
- deciding whether to do the online or offline version, so if the
- connect fails, we fall back correctly.
-
- * camel-session.c (camel_session_get_service_connected):
- s/svc->connected/svc->status/
-
- * camel-remote-store.c (camel_remote_store_finalise):
- Change service->connected check to service->status check.
- (remote_connect): Don't set service->connected here:
- camel_service_connect() itself does that.
-
- * camel-operation.c (camel_operation_registered): Deal with the
- possibility that there's no registered op.
-
-2001-09-26 Not Zed <NotZed@Ximian.com>
-
- * camel-filter-driver.c (camel_filter_driver_filter_message): If
- we get a search error, just abort, dont try and fall back and copy
- to inbox.
- (camel_filter_driver_filter_message): Make sure we ALWAYS use
- exceptions for important things - like moving messages to inbox!
- (camel_filter_driver_filter_message): If we have the source
- folder, use camel_folder_set_message_flags rather then poking the
- info directly, which skips changed events. This means filtering
- immediate doesn't lose changed events.
- (do_flag): Same here.
- (do_colour): Same thing but using set_tag.
- (do_score): Same again.
- (camel_filter_driver_filter_folder): Use ~0 as the 'set' arg to
- set_flags, just saves typing.
- (open_folder): We cache folders that we couldn't open as well as
- those ones we could. Use magic token FOLDER_INVALID =
- (void *)~0 as the marker.
- (close_folder): Handle FOLDER_INVALID case properly.
-
-2001-09-26 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-message.c
- (camel_mime_message_get_part_by_content_id): New function to
- convenience Larry ;-)
- (check_content_id): Oops, return !found instead of found. This
- callback has to return whether or not to keep searching, not
- whether or not it found what it's looking for. Do'h!
-
- * camel-pgp-mime.c (camel_pgp_mime_is_rfc2015_signed): block out
- some code if ENABLE_PEDANTIC_PGPMIME is not defined.
-
-2001-09-26 Not Zed <NotZed@Ximian.com>
-
- * camel-vee-store.c: Emptied VeeStorePrivate, member wasn't used.
-
- * camel-vee-folder.c (camel_vee_folder_set_expression): Lock
- changed list separately.
- (camel_vee_folder_remove_folder): "
- (camel_vee_folder_set_folders): Use changed_lock for changed list.
- (vee_refresh_info): Use changed_lock, also just grab the list,
- reset it in the lock, and do the work unlocked.
- (vee_sync): Use changed lock for changed list.
- (folder_changed): ". All this kills a deadlock with sync/expunge.
-
- * camel-private.h (CamelVeeFolderPrivate): Added a new lock for
- the folders-changed list.
- (CamelVeeStorePrivate): Removed, defined in camel-vee-store.c,
- thanks to a pedantic.
-
-2001-09-26 Jeffrey Stedfast <fejj@ximian.com>
-
- * Makefile.am: Fix Ettore's fix.
-
-2001-09-25 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-pgp-context.c (camel_pgp_context_new): No longer takes a
- remember argument.
- (pgp_sign): Only uncache the passphrase on failure.
- (pgp_clearsign): Same.
- (pgp_encrypt): Here too.
- (pgp_decrypt): And here.
- (pass_free): New function to zero the passphrase before freeing
- it.
-
-2001-09-25 Ettore Perazzoli <ettore@ximian.com>
-
- [Patch for Automake 1.5 compatibility pointed out by Richard
- Boulton <richard@tartarus.org>, as per #9258.]
-
- * providers/nntp/Makefile.am: Remove some commented parts that
- make Automake 1.5 choke.
-
- * Makefile.am (camel-lock-helper): Add $(EXEEXT) for Automake 1.5
- compatibility.
-
-2001-09-25 Not Zed <NotZed@Ximian.com>
-
- * camel-folder.c (get_unread_message_count): Only unref info if we
- got it.
-
- * camel-operation.c (camel_operation_unref): Fix for !threads
- enabled not ccompiling.
- (camel_operation_ref): Assert refcount > 0.
- (struct _CamelOperation): Removed the lock. On further
- investigation, I dont think this will always work, the
- registration operations assume that a lookup in the
- operation_active table will return a ref, that will remain valid
- until we ref it, which needn't be the case. So now i'm using a
- single global lock, since we'd need to do that for unref anyway,
- and every operation is fast & memory-bound. Changed all the code
- to handle this.
- (camel_operation_progress_count): Since the code is identical,
- just call progress() for now.
- (camel_operation_register): No longer refcount, use unref to
- check/clear the active table.
- (camel_operation_unregister): Same here.
- (camel_operation_unref): Check if operation is in active table, if
- so, warn, remove.
-
-2001-09-25 Dan Winship <danw@ximian.com>
-
- * camel-tcp-stream-openssl.c (my_SSL_read, my_SSL_write): call
- SSL_read/write, looping on SSL_ERROR_WANT_READ/WRITE. I'm sure
- there's a perfectly good reason that the API works this way. No,
- really.
- (stream_read, stream_write): use my_SSL_read and my_SSL_write.
- Fixes at least ximian 8593, and probably 6024 and maybe 10366,
- at least for OpenSSL. There may be a parallel NSS bug?
-
-2001-09-25 Not Zed <NotZed@Ximian.com>
-
- * camel-stream-buffer.c (stream_write_all): A "safe write"
- function that always writes out all data asked of it, till
- finished.
- (stream_write): Rewritten. What was i on when i wrote that
- originally, how did it ever work with tcp streams ...
-
-2001-09-24 Not Zed <NotZed@Ximian.com>
-
- * camel-folder.c (append_message): Set the exception to
- FOLDER_INVALID rather than making out it worked. A fix for #7025.
- (search_by_expression): Here too.
-
- * providers/imap/camel-imap-folder.c (imap_update_summary): In the
- 'lose' case, free messages, not fetch_data twice!
-
- * camel-filter-search.c (check_header): If the type is encoded,
- get the fallback charset from the message content-type.
-
- * camel-mime-part-utils.c (check_html_charset): Dont check for
- charset==null before calling charset_to_iconv.
- (simple_data_wrapper_construct_from_parser): "
-
- * camel-mime-message.c (process_header): Try use content-type
- charset param as the fallback charset.
-
- * camel-charset-map.c (camel_charset_to_iconv): Handle name ==
- NULL, return NULL.
-
- * camel-folder-summary.c (camel_folder_summary_format_address):
- (camel_folder_summary_format_string): Made private again, removed
- #warning about it. Renamed to s/camel_folder//.
- (summary_format_string): Take default charset param.
- (camel_message_info_new_from_header, message_info_new): Decode
- content-type field to get the charset parameter to use as the
- default charset for decoding strings.
-
- * camel-search-private.c (camel_search_header_match): Pass NULL as
- the charset, the locale charset is always tried.
- (camel_search_header_match): Supply a default_charset parameter to
- be used with TYPE_ENCODED params.
-
- * camel-mime-utils.c
- (header_param): get rid of the g_strcasecmp crap.
- (header_set_param): Same here.
- (header_decode_param_list): And here.
- (header_decode_text): Totally rewritten. 30% of its size. If the
- word is not rfc2047 encoded, always try default_charset if
- supplied, if that fails, try locale charset if it exists, if that
- fails then assume latin1/7 bit ascii.
- (append_8bit): Changed to return FALSE if we can't convert for
- whatever reason, and dont append anything.
-
- * camel-mime-part.h (struct _CamelMimePart): Move content_type and
- headers out of the 'private' section.
-
- * camel-mime-part.c (get_headers): Dont do any conversion on the
- header.
- (process_header): Get the content-type charset as the fallback
- charset for decode_string.
- (construct_from_parser): IF we have a content-type header, process
- it before doing anything else, so we have access to a fallback
- charset for invalid headers.
-
-2001-09-23 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-tcp-stream-openssl.c (ssl_verify): Don't even try to alert
- the user if the session isn't interactive.
- (errlib_error_to_errno): Make the default errno EINTR so that we
- act just like CamelTcpStreamSSL.
-
- * camel-pgp-context.c (pgp_sign): When the password is not
- provided, set the exception to USER_CANCEL.
- (pgp_clearsign): Same.
- (pgp_encrypt): And here.
- (pgp_decrypt): Here too.
-
-2001-09-21 Not Zed <NotZed@Ximian.com>
-
- * camel-store.c (create_folder): Set the exception if
- create_folder isn't implemented.
-
-2001-09-21 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-store.c (create_folder): Go back to
- not using camel_folder_info_build() here because this seems to
- break folder creation (returning nodes from the root path when it
- shouldn't be?).
-
-2001-09-21 Not Zed <NotZed@Ximian.com>
-
- * camel-vee-store.c (vee_get_folder_info): Force a refresh of
- vfolders before storing their count. This essentially makes
- 'get_folderinfo' refresh all vfolders, so that get-mail works as
- expected.
-
- * camel-vee-folder.c (camel_vee_folder_finalise): Clear lists.
- (folder_changed): If we're not autoupdating the folder, then
- add this folder to the list of 'changed' folders for this vfolder.
- (camel_vee_folder_set_expression): Reset the folders_changed list.
- (camel_vee_folder_remove_folder): Remove the folder from the
- folders_changed list.
- (camel_vee_folder_set_folders): If we have a folder already, but
- its changed, use this opportunity to update it.
- (vee_sync): Remove any synced folders from the folders_changed
- list.
- (vee_refresh_info): Refresh folder, re-run queries on any changed
- folders.
-
-2001-09-20 Not Zed <NotZed@Ximian.com>
-
- * camel-folder-summary.c (camel_folder_summary_header_load): New
- function to just load the summary. Not much use yet, until unread
- counts are stored in the summary (which now looks like too much
- work!).
-
- * camel-mime-utils.c (header_decode_mailbox): Crappy fix for
- stupid mailers. If we get 'name b. name <foo>' then treat it as
- '"name b. name" <foo>'. See 8147.
- (header_decode_mailbox): Another fix for really broken mailers
- that have things that look like addresses followed by <address>
- bits.
- (rfc2047_encode_word): Escape ??= to avoid some bizarre warning
- about trigraphs.
-
- * providers/local/camel-local-folder.c
- (camel_local_folder_construct): Setup unread count properly, and
- also setup the url properly.
-
- * providers/local/camel-maildir-store.c (camel_folder_info_new):
- Build the path on the folderinfo.
- (scan_dir): Dont include empty host part in url for folder.
- (scan_dir): Lookup folder counts for any folders we currenty have
- open.
- (scan_dir): If we dont have the folder open, then scan the 'new'
- and 'cur' folders for new and unread messages to count instead.
-
- * providers/local/camel-spool-store.c (get_folder_info): If we
- have this folder open, then set unread from the folder itself.
- (get_folder_info): Change the INBOX path to not include the
- leading /.
-
- * providers/local/camel-spool-folder.c
- (camel_spool_folder_construct): Fix path.
- (camel_spool_folder_construct): Properly setup the url field when
- we say we've got a new folder created.
-
- * providers/imap/camel-imap-store.c (unsubscribe_folder): Build
- path on folderinfo.
-
- * camel-store.c (camel_folder_info_build_path): Prepend / to path.
-
- * camel-vee-folder.c (camel_vee_folder_construct): Use macro for
- unmatched folder name.
- (camel_vee_folder_new): "
-
- * camel-vee-store.c (vee_get_folder_info): Use macro for unmatched
- folder name.
- (vee_delete_folder): "
- (vee_rename_folder): "
- (vee_get_folder): Prepend / onto path.
- (vee_delete_folder): Setup path in folderinfo.
- (vee_get_folder_info): Fix path in folderinfo.
-
- * camel-vee-folder.h (CAMEL_UNMATCHED_NAME): New define for
- unmatched (internal) name.
-
-2001-09-20 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/local/camel-spool-folder.c
- (camel_spool_folder_construct): And finally here.
-
- * providers/local/camel-local-folder.c
- (camel_local_folder_construct): And here.
-
- * camel-vee-store.c (vee_get_folder): ANd here too.
- (vee_get_folder_info): And here.
-
- * providers/imap/camel-imap-store.c (create_folder): Use
- camel_folder_info_build() and do better error checking.
- (subscribe_folder): Set the path on the folder info.
-
- * camel-store.c (camel_folder_info_build): Set the folder-info
- path if it hasn't already been set by the caller.
- (camel_folder_info_free): Free the path.
-
- * camel-store.h: Added a path member to the FolderInfo type.
-
-2001-09-20 Dan Winship <danw@ximian.com>
-
- * camel-charset-map.c (camel_charset_to_iconv): Nuke debug warning.
-
-2001-09-19 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-pgp-context.c: Updated exception strings to be more clear.
-
- * camel-pgp-mime.c (pgp_mime_part_sign_restore_part): Stupid
- mistake, fixes bug #9975.
-
- * camel-tcp-stream-ssl.c (ssl_bad_cert): Oops, don't fail if
- `data' isn't a CamelService...cuz it's not supposed to be! It's a
- CamelTcpStreamSSL object...doh!
-
-2001-09-19 Not Zed <NotZed@Ximian.com>
-
- * General cleanup of camel debug printfs.
-
- * camel-lock.c (camel_lock_fcntl): Changed to return 'success' if
- the error indicates file locking isn't supported on this
- filesystem. Still return a warning just incase (if its the first
- time). Might fix a lot of reported bugs.
-
- * providers/local/camel-spool-store.c (get_folder_info): Dont
- include the empty // host part in the uri. This 'breaks' the
- service lookup.
-
-2001-09-18 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-utils.c: Match mailing-list header List-Owner.
-
-2001-09-18 Not Zed <NotZed@Ximian.com>
-
- * camel-vee-store.c (vee_get_folder): Fix the uri genereated for
- the folderinfo for the folder_created event.
-
- * camel-store.h: Added 'total' to CamelFolderInfo.
-
-2000-09-18 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-maildir-folder.c
- (camel_maildir_folder_new): If filter inbox is set on the store,
- and we're opening inbox '', then enable filtering on new messages.
-
- * providers/local/camel-local-folder.c
- (camel_local_folder_construct): After loading the summary, check
- it, and only abort if that fails. Also maintain the changes
- count.
-
- * providers/local/camel-local-summary.c
- (camel_local_summary_load): Remove summary_check code from here.
- (camel_local_summary_check): Sync index/summary here, if we were
- successful.
-
- * providers/local/camel-spool-folder.c
- (camel_spool_folder_new): If we have filter-new-messages-on-inbox
- set and we just opened inbox, turn on filtering on this folder.
- (camel_spool_folder_construct): Keep track of changes for the
- folder, so that filter-new-messages works right (?)
-
- * providers/local/camel-spool-store.c (get_folder): Pass 'INBOX'
- as the folder name, not the path.
-
- * camel-folder-search.c (search_not): Modified patch from
- <peterw@ximian.com> since the summary is messageinfo's, not
- strings.
-
- ** Ok so the problem with the stuff below is that maildir/spool
- 'summary_load' throws away all events, including recents, joy eh?
-
- * providers/local/camel-maildir-summary.c (maildir_summary_check):
- Add new messages to the recent changeinfo.
-
- * providers/local/camel-spool-summary.c: Mark 'new' message as
- recent, for later processing if required (i.e. 'filter new
- messages').
-
- * camel-store.c (construct): new function, cascade up construct
- method and check for 'filter' param, and set accordingly for any
- one that might want it.
-
- * providers/imap/camel-imap-store.c (construct): map the
- param_filter_inbox flag to the store->flags as
- CAMEL_STORE_FILTER_INBOX.
-
- * camel-store.h (CAMEL_STORE_FILTER_INBOX): new flag to tell it to
- filter inbox.
-
- * providers/imap/camel-imap-folder.h: Removed do_filtering flag
- from CamelImapFolder.
-
- * providers/imap/camel-imap-folder.c (imap_update_summary): Remove
- the 'recents' parameter, use the 'changes' parameter instead to
- convey this info.
- (camel_imap_folder_changed): Changed for update_summary api
- change. Now always just emit the changed event if we have any
- changes to report, filtering code removed, handled upstream.
- (filter_proc):
- (filter_free): Removed old filtering code.
- (camel_imap_folder_new): Set the filter_recent flag on the folder
- if we're the inbox and filtering of inbox is enabled.
-
- * camel-folder.c (folder_changed): If we have 'recent' messages,
- and are set to filter recents, then freeze the folder and launch a
- thread to do the processing (or similar if threading not enabled).
- (thaw): Make sure we emit the changed signal outside of owning the
- lock and if things have changed. Also, no longer bother
- downgrading folder_changed events to message_changed events.
-
- * camel-folder.h (struct _CamelFolder): Added filter_recent flag
- -> signifies all recent messages in folder should be filtered.
-
- * camel-session.c: (camel_session_thread_msg_new,
- camel_session_thread_msg_free, camel_session_thread_queue,
- camel_session_thread_wait): code to handle async operations as
- part of camel processing.
- (camel_session_finalise): free thread_lock, destroy thread, active
- hash, etc.
- (camel_session_init): init thread, active hash, etc.
- (camel_session_class_init): Init virtual functions.
- (session_thread_msg_new, session_thread_msg_free,
- session_thread_destroy, session_thread_received,
- session_thread_queue, session_thread_wait): default implementation
- of session threads stuff.
-
-2001-09-17 Not Zed <NotZed@Ximian.com>
-
- * camel-folder.c (camel_folder_change_info_recent_uid): New
- function to add a 'recent' uid to the change info.
- (camel_folder_change_info_clear): Clear recent list.
- (camel_folder_change_info_free): Free recent list.
- (camel_folder_change_info_new): Setup recent list.
-
- * camel-folder.h: Added a uid_recent item to the folder_changed
- event data.
-
- * providers/local/camel-maildir-store.c (scan_dir): Free new in
- the right block.
-
- * providers/local/camel-local-provider.c: Add local config entries
- to filter on new messages in spool and maildir provider.
-
- * camel-vee-folder.c (vee_folder_construct): Remove the assertion
- which stops ? in names from being allowed.
-
-2001-09-18 Dan Winship <danw@ximian.com>
-
- * camel-data-wrapper.c (camel_data_wrapper_is_offline): Virtualize
- this.
-
- * camel-medium.c (is_offline): A medium is offline if its content
- object is offline.
-
- * camel-multipart.c (is_offline): A multipart is offline if any of
- its subparts are offline.
-
-2001-09-18 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-charset-map.c: Added korean charset conversion.
-
-2001-09-17 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-store.c (delete_folder): Don't process
- the ImapResponse data, we don't want to block forever on data we
- don't care about...
- (create_folder): Use get_folders_online() instead of
- get_folder_info_online().
-
- * camel-folder.c: Reverted previous changes.
-
-2001-09-17 JP Rosevear <jpr@ximian.com>
-
- * Makefile.am: Helpful install-exec-hook debugging output
-
-2001-09-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-folder.c (camel_folder_get_uri): New function to get the
- URI of a folder.
- (get_uri): Default implementation.
-
-2001-09-14 Not Zed <NotZed@Ximian.com>
-
- * camel-vee-folder.c (camel_vee_folder_set_folders): New function,
- set the complete list of folders on a vfolder, all at once.
- (camel_vee_folder_set_expression): If we set the query to be the
- same thing, dont do anything.
-
- * camel-vee-store.c (camel_vee_store_init): Turn off vtrash for
- this store.
-
- * camel-store.c (camel_store_init): Enable vtrash by default via
- flags.
- (camel_store_get_trash): REturn NULL if the store doesn't support
- vtrash.
- (init_trash): Dont init if store doesn't support vtrash.
-
- * camel-store.h: Add a new flags CAMEL_STORE_VTRASH -> store
- supports vtrash.
-
-2001-09-13 Not Zed <NotZed@Ximian.com>
-
- * camel-vee-store.c (vee_get_folder_info): Implement.
- (build_info): Used to build a folder record from the folders
- hashtable.
- (vee_delete_folder): Implemented, remove folder from hashtable.
- (vee_rename_folder): Implemented, remove old folder from
- hashtable, add new one and rename its guts too.
-
- * camel-store.c (camel_store_rename_folder): Do nothing if we're
- not asked to actually change names. Also dont do the renamed
- cache check till after we've called the subclass.
- (camel_store_delete_folder): Call the subclass delete firs,t then
- make sure the cache is right.
-
- * camel-vee-folder.c (vee_folder_construct): Remove support for
- name?query syntax to setup vfolder. Abort if such syntax is used.
- (camel_vee_folder_new): Removed code that handles ? syntax, etc.
- (vee_folder_build_folder): Handle unset expression, treat it as an
- empty search.
- (camel_vee_folder_set_expression): Oops, actually set the
- expression.
-
- * camel-vtrash-folder.c (camel_vtrash_folder_new): Dont use
- name?query syntax to setup vfolder, but set the expression
- directly. Also fixes a small memleak.
-
-2001-09-12 Not Zed <NotZed@Ximian.com>
-
- * camel-store.c (camel_store_delete_folder): Fixed warnings with a
- cast.
- (camel_store_rename_folder): "
-
-2001-09-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-url.c (camel_url_set_param): Use g_datalist_set_data_full
- so that the data will be free'd when we clear the list.
-
-2001-09-14 Dan Winship <danw@ximian.com>
-
- * camel-file-utils.c (camel_file_util_encode_string,
- camel_file_util_decode_string): Don't claim failure when
- reading/writing the empty string.
-
-2001-09-14 JP Rosevear <jpr@ximian.com>
-
- * Makefile.am: use install hook instead of install rule to
- guarantee we run after installation
-
-2001-09-13 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-filter-driver.c (camel_filter_driver_filter_folder): Don't
- reuse the exception if it has already been set.
- (camel_filter_driver_filter_message): Same here. Also use the new
- return value from camel_filter_search_match().
-
- * camel-filter-search.c (camel_filter_search_match): Return an
- integer (matched, no-match, or error).
-
- * providers/local/camel-mbox-folder.c (mbox_append_message): Do
- error-checking based on function return values rather than
- exceptions as it's possible for them to be NULL.
- (mbox_get_message): Same.
-
- * providers/imap/camel-imap-folder.c (imap_append_offline): Pass
- an exception to the cache.
- (imap_append_online): Same.
- (imap_append_resyncing): Here too.
- (imap_copy_offline): And here.
- (handle_copyuid): Pass NULL as the exception here...
- (parse_fetch_response): And finally here.
-
- * providers/imap/camel-imap-message-cache.c
- (camel_imap_message_cache_insert):
- (insert_setup):
- (camel_imap_message_cache_insert_stream):
- (camel_imap_message_cache_insert_wrapper):
- (camel_imap_message_cache_copy): Take an exception argument and
- set it on error.
-
- * camel-mime-part-utils.c
- (simple_data_wrapper_construct_from_parser): Convert the charset
- to the iconv-friendly name.
-
- * camel-charset-map.c (camel_charset_to_iconv): Add code to
- convert windows-[cp]#### charsets to their iconv-friendly format
- of cp####.
-
- * camel-pgp-context.c (crypto_exec_with_passwd): Return -1 on
- failure.
-
-2001-09-12 Larry Ewing <lewing@ximian.com>
-
- * camel-filter-driver.c (camel_filter_driver_filter_mbox): free
- the source url in the nonfailure case.
-
-2001-09-12 Not Zed <NotZed@Ximian.com>
-
- * camel-folder-search.h: Change the 'not' virtual method from an
- immediate e-sexp function to a non-immediate one, which is what it
- should be.
-
- * camel-folder-search.c (search_not): Implement a 'not' function
- ourselves. If 'not' on a vector value, then not over all items
- in the summary.
- (builtings[]): Change the 'not' builtin to be a non-immediate
- function.
-
-2001-09-12 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-filter-driver.c (camel_filter_driver_filter_mbox): Unref
- the message info.
-
-2001-09-10 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-maildir-store.c (get_folder_info): Pass in
- a hashtalbe used for finding visited nodes.
- (inode_hash):
- (inode_equal):
- (inode_free): Helper functions for visited node checks, hashes on
- inode + device number.
- (scan_dir): Dont re-visited directories we've already visited, use
- inodes + device number.
- Also, if the folder doesn't contain cur/tmp/new, mark it as
- noselect, but continue to recurse folders, if asked.
-
- * camel-folder.c (move_messages_to): Progress reporting while
- moving messages.
-
- * camel-store.c (camel_store_delete_folder): Make sure we remove
- the folder from our vtrash, if we have it in our opened set, and
- also remove it from our hashtable.
- (camel_store_rename_folder): Remove the old folder name from the
- folder cahce, if it is there.
-
-2001-09-10 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-charset-map.c (camel_charset_to_iconv): Get rid of the
- g_warning, we no longer really need that.
-
-2001-09-10 Not Zed <NotZed@Ximian.com>
-
- * providers/imap/camel-imap-store.c (camel_imap_msg_new): Forgot
- to return the newly allocated msg.
-
-2001-09-08 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-spool-summary.c (spool_summary_sync_full):
- Likewise.
-
- * providers/local/camel-mbox-summary.c (mbox_summary_sync_full):
- Fix the wording.
-
- * camel-tcp-stream-raw.c (stream_read): Save errno around fcntl
- call in cancellable read case. Also, loop while we get EINTR.
- This might fix some weird reconnect behaviour with pop.
- (stream_write): "
-
-2001-09-07 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-tcp-stream-ssl.c (ssl_bad_cert): #if 0 out the code that
- was hopefully going to fix bug #5325 because the functions I used
- seem to have been deprecated. *sigh*.
-
- * camel-remote-store.c (camel_remote_store_finalise): Disconnect
- from the service here otherwise the locks will be destroyed and by
- the time CamelService finalizes we'll crash or hang.
-
- * providers/smtp/camel-smtp-transport.c (smtp_data): Make sure to
- unref the mime filters when we finish with them.
-
-2001-09-07 Ettore Perazzoli <ettore@ximian.com>
-
- * providers/local/camel-mbox-summary.c (mbox_summary_sync_full):
- s/Synchronising/Synchronizing/.
- (mbox_summary_sync_quick): Likewise.
- (summary_rebuild): s/Summarising/Summarizing/.
-
-2001-09-07 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-multipart.c (camel_multipart_set_boundary): Take a const
- char * instead of a char *.
-
- * camel-mime-part-utils.c
- (camel_mime_part_construct_content_from_parser): Reuse the
- original boundary instead of generating our own.
-
-2001-09-06 Not Zed <NotZed@Ximian.com>
-
- * providers/imap/camel-imap-folder.c (filter_proc): Thread
- function to perform filtering.
- (filter_free): Free the filter object.
- (camel_imap_folder_changed): If we have threads enabled, then
- queue up a request to perform filtering. For bug #4422.
-
- * providers/imap/camel-imap-store.c (camel_imap_msg_new): Create a
- new 'imap msg'.
- (camel_imap_msg_queue): Queue an 'imap msg'.
- (async_received): Handle receiving of imap msg in async thread.
- (async_destroy): Handle destroying of imap msg.
- (camel_imap_store_finalize): Destroy thread when done.
- (camel_imap_store_init): Setup thread.
-
- * providers/imap/camel-imap-store.h: Added an ethread to the
- store, for async processing.
-
-2001-09-06 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-remote-store.c (remote_recv_line): Use
- camel_stream_buffer_read_line() instead of duplicationing the
- functionality. Also, the previous way was broken anyway. What if a
- line was the same length as our buffer? Then we'd go and read a
- second line and a third and so on until they weren't the same
- length, leaving \r's in the middle of the buffer.
-
-2001-09-06 Dan Winship <danw@ximian.com>
-
- * providers/pop3/camel-pop3-store.c (pop3_get_response): Fix this
- to always set an exception if it returns POP3_FAIL, as documented.
-
- * providers/pop3/camel-pop3-folder.c (pop3_get_message_stream):
- Revert.
-
-2001-09-06 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/pop3/camel-pop3-folder.c (pop3_get_message_stream):
- Set an exception on POP3_FAIL as well.
-
-2001-09-06 Dan Winship <danw@ximian.com>
-
- * providers/pop3/camel-pop3-provider.c: #ifdef out the "delete
- after N days" option in pop3_conf_entries, since it won't be done
- for 1.0.
-
-2001-09-04 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-remote-store.c (remote_disconnect): Too late to sync the
- folders here... if this is gonna happen at all it should be done
- in the provider.
-
- * camel-service.c (camel_service_finalize): Do a clean disconnect.
-
-2001-08-30 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/local/camel-spool-store.c (get_inbox): Return the
- default folder (ie. INBOX) rather than saying we don't support an
- inbox.
-
- * camel-tcp-stream-ssl.c: #include pk11func.h.
- (ssl_bad_cert): Use CERT_GetDefaultCertDB.
-
-2001-08-29 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-smime-context.c (smime_sign_prepare): Do the same here as
- what we did in the pgp code a moment ago.
- (smime_sign_restore): And again here.
- (smime_sign): And update thise code to pass in the address of the
- encodings list when restoring parts.
-
- * camel-pgp-mime.c (pgp_mime_part_sign_prepare_part): Special-case
- message/rfc822 mime parts - don't set an encoding on these,
- instead traverse into their subparts and set the encodings for
- those.
- (pgp_mime_part_sign_restore_part): Reverse any operations done to
- message/rfc822 parts in the above prepare_part() function and also
- take a pointer to a GSList of encodings instead of just a GSList
- so we can properly keep track of which encoding we are on.
- (camel_pgp_mime_part_sign): Pass in the address to the encodings
- list when restoring parts.
-
-2001-08-29 Not Zed <NotZed@Ximian.com>
-
- * providers/pop3/camel-pop3-folder.c (pop3_sync): Add progress
- reporting to deleting messages. Dont change the calculation to a
- bloody float. Bug #6189.
-
-2001-08-28 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-pgp-context.c (crypto_exec_with_passwd): Initialize buf
- and diag_buf to NULL, hopefully this fixes the crash if the
- select() times out.
- (pgp_encrypt): Argh. What was I thinking? Don't use "-r recipient"
- as an argument, instead use "-r" and "recipient" as 2 separate
- arguments to pgp. This might fix the "gpg only encrypts to my
- private key" bug?
-
-2001-08-28 Peter Williams <peterw@ximian.com>
-
- * providers/imap/camel-imap-store.c (create_folder): Whoops.
- Double-free and FMR = bad.
-
- * camel-remote-store.c (remote_send_string): Don't reveal the
- user's IMAP password if their server supports LITERALPLUS. Also
- add some more dashes to make it line up nicely :-)
-
-2001-08-28 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-tcp-stream-ssl.c (ssl_bad_cert): If the user accepts the
- certificate, add it to the database as a trusted CA.
-
-2001-08-28 Peter Williams <peterw@ximian.com>
-
- * camel-object.c (camel_object_unref): Make the locking more
- fine-grained on destruction; specifically, don't hold the
- type lock while calling the finalize functions.
-
-2001-08-27 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/local/camel-local-provider.c: Changed the
- description/names of some of the local providers to try and
- clarify the meanings.
-
- * providers/pop3/camel-pop3-provider.c: Simplify the POP
- description - we want short but sweet.
-
- * providers/imap/camel-imap-provider.c: s/IMAPv4/IMAP
-
-2001-08-27 Not Zed <NotZed@Ximian.com>
-
- * camel-mime-part-utils.c (convert_buffer): re-read the iconv man
- page, and treat the return value properly. It returns the number
- of non-reversible conversions performed, not the number of output
- characters, sigh.
- (check_html_charset): Changed to just take a buffer of data, and
- not the mime parser.
- (simple_data_wrapper_construct_from_parser): Since we dont need
- the charset till we have all the data, search for the charset
- after we've read the data, if we have html data with no charset in
- the header.
- (simple_data_wrapper_construct_from_parser): Remove the
- seekable_source stuff.
-
- * Re-apply patches from before.
-
-2001-08-25 Not Zed <NotZed@Ximian.com>
-
- ["Summarising" and "Synchronising" are spelt with a "s" in
- ENGLISH]
-
- * providers/local/camel-mbox-summary.c (mbox_summary_sync_quick):
- s/Synchronizing/Synchronising/.
-
- * providers/local/camel-mbox-summary.c (summary_rebuild):
- s/Summarizing/Summarising/
-
-2001-08-24 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-disco-diary.c (camel_disco_diary_replay): Use fseek
- instead of fseeko since we want to be portable and use ftell
- rather than ftello for the same reason.
- (camel_disco_diary_empty): Same here.
-
-2001-08-24 Peter Williams <peterw@ximian.com>
-
- * Revert Not Zed's previous commits as they apparently can cause
- serious data loss for POP3 users.
-
-2001-08-24 Ettore Perazzoli <ettore@ximian.com>
-
- ["Summarizing" and "Synchronizing" are spelt with a "z" in the
- default locale, that happens to be "en_US".]
-
- * providers/local/camel-mbox-summary.c (mbox_summary_sync_quick):
- s/Synchronising/Synchronizing/.
-
- * providers/local/camel-mbox-summary.c (summary_rebuild):
- s/Summarising/Summarizing/
-
-2001-08-24 Not Zed <NotZed@Ximian.com>
-
- * camel-mime-part-utils.c (convert_buffer): Limit the maximum
- output buffer size. iconv bugs? returns E2BIG forever on some
- (valid) data?
-
- * providers/local/camel-spool-summary.c (summary_rebuild):
- Likewise.
-
- * providers/local/camel-mbox-summary.c (summary_rebuild):
- Summarising is spelt with an s.
-
-2001-08-23 Not Zed <NotZed@Ximian.com>
-
- * camel-mime-part.c (write_to_stream): If we have rawtext, then
- dont do any charset conversion, only encoding/crlf conversion.
-
- * camel-data-wrapper.h (struct _CamelDataWrapper): Added 'rawtext'
- member, says the character encoding is raw, not utf8.
-
- * providers/local/camel-spool-summary.c
- (spool_summary_sync_quick): Synchronising is spelt with an s, not
- a z.
- (spool_summary_sync_full): "
-
- * providers/local/camel-mbox-summary.c (mbox_summary_sync_full):
- No, synchronising is spelt with an s.
- (mbox_summary_sync_quick): "
-
- * camel-mime-part-utils.c
- (camel_mime_part_construct_content_from_parser): Remove the
- warnings which aren't going anywhere fast.
- (convert_buffer): Function to convert a bytearray of textual
- content from one charset to another. If the charset doesn't exist
- or fails, then do no conversion.
- (simple_data_wrapper_construct_from_parser): First, read in data,
- then try and convert it using the specified charset if supplied.
- If that fails, then dont do any conversion, and leave as raw.
- Also, if we have any x-* charsets, then dont do any processing.
-
-2001-08-23 Peter Williams <peterw@ximian.com>
-
- * providers/local/camel-mbox-summary.c (summary_rebuild): Add a
- missing \n to the end of a printf.
-
- * providers/local/camel-spool-summary.c (summary_rebuild): Same.
-
-2001-08-22 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/pop3/camel-pop3-folder.c (pop3_generate_uids):
- Oops. Fixed a mis-use of GPtrArray. If we set_size, then using
- g_ptr_array_add will assume `size' elements have already been
- initialized and will start appending on to the end.
-
-2001-08-21 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-pgp-context.c (pgp_verify): Turn on --batch and reenable
- gpg keyserver lookups.
- (pgp_decrypt): Disable keyserver lookups if we are disconnected.
-
-2001-08-21 Dan Winship <danw@ximian.com>
-
- * camel-folder-thread.c
- (camel_folder_thread_messages_new_summary): Fix the duplicate
- message check so it doesn't mess up threading when a reply appears
- in the folder before the message it's a reply to. Fixes bug #3357.
- (camel_folder_thread_messages_new): Likewise, although I don't
- think this function is used any more.
-
-2001-08-20 JP Rosevear <jpr@ximian.com>
-
- * Makefile.am: build a static camel for the addressbook conduit
-
-2001-08-20 Ettore Perazzoli <ettore@ximian.com>
-
- * providers/local/camel-mbox-summary.c (mbox_summary_sync_full):
- s/Synchronising/Synchronizing/.
- (mbox_summary_sync_quick): Likewise. *
- providers/local/camel-spool-summary.c (spool_summary_sync_full):
- Likewise.
- (spool_summary_sync_quick): Likewise.
-
-2001-08-20 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-store.c (create_folder): Get the
- entire directory structure for the folder we just created, meaning
- if we created a folder named "test.mailbox" where test didn't
- previously exist, get the listing for "test" and "test.mailbox".
-
- * providers/imap/camel-imap-utils.c (imap_parse_folder_name): New
- function.
-
-2001-08-19 Chris Toshok <toshok@ximian.com>
-
- * camel-store.h: #include <sys/types.h> for mode_t on freebsd.
-
-2001-08-19 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/pop3/camel-pop3-folder.c (pop3_generate_uids): Make
- sure the generated UID is non-NULL before appending it to the
- array of UIDs. How would this even happen? I have no clue...
-
-2001-08-17 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-folder.c (imap_update_summary): Start
- scanning new messages at maxuid + 1 rather than uidval + 1? Maybe
- I'm missing the logic, but anyways...this might fix bug #5348.
-
-2001-08-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-store.c (imap_keepalive): If we are
- online and message flags have changed in the current folder, sync
- the flags else do a NOOP. This fixes bug #4666. Also lock around
- the NOOP command.
-
- * providers/imap/camel-imap-folder.c (imap_sync_online): Don't
- ever send "STORE FLAGS.SILENT ()" since Cyrus imapd doesn't like
- this (and maybe others too?) so what we'll do instead is to send
- "STORE -FLAGS.SILENT (\Seen \Answered \Deleted \Marked)" to clear
- all the flags (since this is in essence what we want to do
- anyway).
-
-2001-08-16 Peter Williams <peterw@ximian.com>
-
- * providers/imap/camel-imap-store.c (imap_connect_online): Fix
- this again. Sigh. Problem of namespace = "" may not yet be
- completely solved.
-
-2001-08-15 Peter Williams <peterw@ximian.com>
-
- * camel-tcp-stream-openssl.c (ssl_error_to_errno): New
- function. Try to approximate the SSL error into errno.
- (errlib_error_to_errno): New function, try to approximate
- OpenSSl's error library's error (ERR_*) into errno.
- (stream_read): Try to set errno using ssl_error_to_errno.
- (stream_write): Same.
- (open_ssl_connection): Same.
-
- * providers/imap/camel-imap-store.c (imap_connect_online): Oh
- crap, huge killer typo.
-
-2001-08-14 Peter Williams <peterw@ximian.com>
-
- * providers/imap/camel-imap-store.c (imap_connect_online):
- Canonicalize store->namespace to end in store->dir_sep, once both
- values are known. The %F-related code makes this
- assumption. Probably fixes a bug reported on the mailing list.
-
-2001-08-13 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-store.c (camel_store_get_folder): After talking to NotZed,
- it turns out I was wrong after all.
- (store_sync): Create a copy of the folder-cache that owns a ref on
- each of the folders so that if one of the folders get's finalized
- inside store_sync(), we don't run into any locking issues. This is
- mostly meant to solve a problem in IMAP (#6089).
-
-2001-08-13 Peter Williams <peterw@ximian.com>
-
- * providers/imap/camel-imap-store.c (delete_folder): Fix a leak.
-
- * providers/imap/camel-imap-utils.c (imap_namespace_concat): Bleah,
- handle when namespace = NULL (can happen upon initial open of mailbox.)
-
- * providers/imap/camel-imap-command.c (imap_command_strdup_vprintf):
- Don't crash when %F'ing with an empty folder name and NULL namespace.
-
-2001-08-13 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-store.c (camel_store_get_folder): We need to be ref'ing
- the folder if/when we add it to the hash. This may fix bug #6089?
- (camel_store_get_folder): Nevermind, reverted the fix.
- (camel_store_get_folder): No, I wasn't on crack before after
- all...if we don't ref here, then we're open to a race condition
- later.
-
-2001-08-11 Ettore Perazzoli <ettore@ximian.com>
-
- * providers/local/camel-spool-summary.c (summary_rebuild):
- s/summarising/summarizing/.
- (summary_rebuild): Likewise.
-
- * providers/local/camel-mbox-summary.c (mbox_summary_sync_full):
- s/summarise/summarize/.
- (mbox_summary_sync_quick): Likewise.
- (summary_rebuild): Likewise.
- (mbox_summary_check): Likewise.
-
-2001-08-10 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-utils.c (imap_quote_string): Added an
- assert - at this point a backtrace would be more useful than a
- transaction log for debugging.
-
- * providers/imap/camel-imap-command.c (imap_command_start): Return
- FALSE here, not NULL.
-
- * providers/imap/camel-imap-folder.c (imap_rescan): Don't
- g_strdup() the uid into the trigger_event call.
-
- * providers/pop3/camel-pop3-folder.c (pop3_get_message_stream):
- Set the total bytes expected to 0 if the response is empty too.
- (pop3_refresh_info): Return of there was an error generating pop3
- uids.
-
- * camel-mime-utils.c (header_raw_check_mailing_list): regfree the
- pattern before continue'ing. This was showing up quite a bit under
- purify.
-
-2001-08-09 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-utils.c (imap_parse_string_generic): A
- quoted string cannot contain \n's so check for those as well.
- (imap_atom_specials): Update this to fix bug #6553.
-
-2001-08-08 Jon Trowbridge <trow@ximian.com>
-
- * camel-filter-search.c (get_source): Remove trailing stuff from
- URLs before returning. (Done in an evil way, not in the good way
- suggested by fejj. :)) (Bug #4876)
-
-2001-08-08 jacob berkman <jacob@ximian.com>
-
- * camel-search-private.c (camel_search_header_match): check for
- NULL name and addr (fixes a bug i was about to report)
-
-2001-08-08 Not Zed <NotZed@Ximian.com>
-
- * camel-filter-search.c (check_header): Properly determine match
- type to pass to header_match.
- (address_matches_exactly): Removed, effectively added to
- camel_search_header_match.
-
- * camel-folder-search.c (check_header): Properly determine the
- match type to pass to header_match.
-
- * camel-search-private.c (camel_search_header_match): Add a new
- parameter 'type' which is the type of header we're matching
- against. ASIS means utf8 format, ADDRESS means an internet
- address ('formatted'), ADDRESS_ENCODED means a raw address header,
- ENCODED means rfc 2047 encoded text.
- (header_match): Move original logic here, have search_header_match
- call it as appropriate for the 'type' of match.
-
-2001-08-07 Not Zed <NotZed@Ximian.com>
-
- * camel-session.c (camel_session_class_init): Only init the vee
- provider struct once (if we're subclassed this will get called
- multiple times).
-
- * camel-object.c (obj_finalize): Removed a bit of a debug that
- crept in with jacob's poolv patch (?).
-
-2001-08-07 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-filter-search.c (address_matches_exactly): New function to
- do danw's address "is" comparison (as specified in bug #5886.
- (check_header): Special-case address-type headers when we are
- doing an exact match to use the address_matches_exactly function.
-
-2001-08-06 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/pop3/camel-pop3-folder.c (pop3_get_message_stream):
- Modify to take a headers_only argument which will then only fetch
- message headers.
- (pop3_generate_uids): Pass in TRUE for headers_only.
- (pop3_get_message): Pass in FALSE for headers_only and move the
- camel_operation() stuff out of get_message_stream and in to here
- instead.
- (pop3_generate_uids): We also need to be using i+ 1 as the id
- since we are starting at 0.
-
-2001-08-06 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/pop3/camel-pop3-folder.c (pop3_get_message_stream):
- New internal function to get a message stream by message sequence
- id (so that we can share code between pop3_get_message and
- pop3_generate_uids).
- (pop3_get_message): Use pop3_get_message_stream.
- (pop3_generate_uids): New function to generate UIDs based on the
- message - this fixes bug #1256.
- (pop3_refresh_info): If the server doesn't support UIDL, call
- pop3_generate_uids to get our list of UIDs.
-
- * providers/imap/camel-imap-store.c (get_folder_info_online):
- Don't strstr for noselect=yes, that's just plain broken.
-
-2001-08-06 Dan Winship <danw@ximian.com>
-
- * providers/imap/camel-imap-folder.c (imap_rescan): Fix off-by-one
- error in cleaning up deleted messages at the end of the folder.
- Fixes bug #5585 and maybe others.
-
- * providers/imap/camel-imap-store.c (get_folder_info_online): Do a
- refresh_info on the selected folder before looking at its unread
- count. Should fix bug #4944.
-
-2001-08-06 Peter Williams <peterw@ximian.com>
-
- Completely hide the namespace from everything external to the IMAP
- code, which Dan W says is the way it should be.
-
- * providers/imap/camel-imap-command.c
- (imap_command_strdup_vprintf): Add a new %F argument, which is like
- %S but will add the namespace (for folder names).
- (camel_imap_command): Use %F here.
-
- * providers/imap/camel-imap-utils.c (imap_parse_list_response):
- Changed to strip out the namespec when returning *folder. In order
- to do this we need to be passed the CamelImapStore.
- (imap_concat): Move to here from camel-imap-store.c, un-static
- (imap_namespace_concat): New function, adds the namespace to the
- folder name, unless it's INBOX.
-
- * providers/imap/camel-imap-utils.h: Prototypes.
-
- * providers/imap/camel-imap-store.c (imap_connect_online): Extra
- arg to imap_parse_list_response.
- (imap_connect_offline): Here too.
- (get_folder_status): Use %F.
- (get_folder_online): Here too.
- (delete_folder): Here too.
- (create_folder): Here too, and arg to imap_parse_list_response.
- (parse_list_response_as_folder_info): Arg to i_p_l_r.
- (get_subscribed_folders_by_hand): Use %F.
- (get_folders_online): Here too.
- (get_folder_info_online): Instead of checking for NULL @name, check
- for name = NULL or "", and set to "" instead of namespace. Pass ""
- instead of namespace to camel_folder_info_build.
- (subscribe_folder): Use %F.
- (unsubscribe_folder): Here too.
-
- * providers/imap/camel-imap-folder.c (imap_get_full_name): This
- now just returns folder->full_name.
- (do_append): Use %F
- (do_copy): Here too.
-
-2001-08-06 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-pgp-context.c (pgp_verify): Always do --no-auto-key-retrieve.
-
-2001-08-03 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-pgp-context.c (pgp_verify): Minor changes to the iconv
- code so that it does the check in the return value of iconv() just
- like the code in camel-mime-utils.c in case this fixes Bo Rosen's
- gpg bugs (but I doubt this will change anything?).
-
-2001-08-03 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/smtp/camel-smtp-transport.c (smtp_connect): First
- check to make sure that service->url->authmech is non-NULL before
- passing it into strcmp to avoid a segfault.
-
- * camel-pgp-context.c (pgp_decrypt): Sigh, if gpg returns '1' it
- means that the key is bad but it did succeede in decrypting the
- block so to make users happy (even though I find this a
- questionable action) we are going to ignore the error and show it
- to the user anyway. This fixes bug #6136.
-
-2001-08-03 Not Zed <NotZed@Ximian.com>
-
- * providers/smtp/camel-smtp-transport.c (smtp_connect): special
- case popb4smtp auth before we try and connect, and do the magic
- here first.
-
-2001-08-02 Not Zed <NotZed@Ximian.com>
-
- * providers/smtp/camel-smtp-transport.c (smtp_connect): Check for
- POPB4SMTP separate to the esmtp auth list.
- (smtp_auth): If creating the sasl object means it is
- already authenticated, then exit early. Sort of 'clean hack' to
- help popb4smtp work.
- (smtp_auth): Unref the sasl object, clean up a memleak i think.
-
- * providers/smtp/camel-smtp-provider.c
- (camel_provider_module_init): Added POPB4SMTP auth type.
-
- * camel-sasl.c (camel_sasl_authtype): Added POPB4SMTP type.
-
- * camel-sasl-popb4smtp.c: New file for pop before smtp
- 'authentication'.
-
- * Makefile.am (libcamel_la_SOURCES, HEADERS): Add
- camel-sasl-popb4smtp.[ch].
-
-2001-08-01 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-mbox-folder.c (mbox_lock): If we fail to
- get the lock, make sure we close our locking fd, and reset it.
- Fixes the crash part of 5095.
-
- * providers/imap/camel-imap-folder.c (camel_imap_folder_changed):
- Slightly re-arranged filter/change notification logic. If we;re
- filtering, freeze the folder till we're finished to smooth the ui
- for new mail.
-
-2001-07-31 Not Zed <NotZed@Ximian.com>
-
- * camel-folder.c (camel_folder_init): Changed mutexes to
- e_mutexes, folder lock recursive. This fixes the imap filtering
- bug, or at least some cases of it.
- (camel_folder_finalize): Free mutexes.
-
- * camel-private.h (CamelFolderPrivate): Changed mutexes to
- e_mutexes.
-
-2001-07-25 Not Zed <NotZed@Ximian.com>
-
- * camel-folder.c (camel_folder_change_info_*): Change the
- return if fail's into asserts.
- (camel_folder_change_info_free): Don't let it accept a NULL
- argument. This isn't g_lib so we dont have to.
-
-2001-07-27 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-utils.c (header_decode_param): Fix the fix that fixes
- broken mailer behavior. We want to make sure that the user's
- locale charset is non-NULL before we pass it off to
- iconv_open(). If it *is* NULL, we want to use iso-8859-1.
-
-2001-07-26 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-url.c (camel_url_free): Allow the url to be NULL just like
- the libc free convention.
-
-2001-07-26 Dan Winship <danw@ximian.com>
-
- * providers/imap/camel-imap-command.c (camel_imap_command_start):
- Send an IMAP command, but don't wait for responses.
- (camel_imap_command_response): Read a single line of response from
- the server.
- (camel_imap_command, etc): Reimplement in terms of the new code.
-
- * providers/imap/camel-imap-folder.c (imap_rescan): Use
- camel_imap_command_start and camel_imap_command_response, and
- call camel_operation_progress after each line read from the
- server.
- (imap_update_summary): Likewise, although with more fudging on the
- precentages... Also, fix this so that if none of the new messages
- are cached, it only does a single FETCH, and if some of them are
- cached, it does two FETCHes (one to get the UIDs, FLAGS, and
- SIZEs, and another to get the bodies of all of the messages that
- aren't cached now that it knows the relevant UIDs). This should
- speed up startup a bunch (especially if you have high bandwidth
- but also high latency to the IMAP server).
-
-2001-07-25 Dan Winship <danw@ximian.com>
-
- * camel-mime-utils.c (mail_mlist_magic): Add another Sender
- pattern.
-
-2001-07-24 Not Zed <NotZed@Ximian.com>
-
- * providers/imap/camel-imap-folder.c (camel_imap_folder_changed):
- Change the break into a continue, we should process as many as we
- can find.
-
- * camel-folder.c (camel_folder_move_messages_to): If we have no
- uid's to copy, exit here before going any further. Some code
- internally [imap] assumes there are uids to copy otherwise it can
- segfault.
- (camel_folder_copy_messages_to): Same.
-
-2001-07-24 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-utils.c (header_decode_param): Handle broken mailers
- that send unencoded 8bit header params. And there was much
- rejoicing. Rah.
-
- * camel-url.h (CAMEL_URL_HIDE_ALL): New #define, and there was
- much rejoicing. Rah.
-
-2001-07-24 Not Zed <NotZed@Ximian.com>
-
- * camel-operation.c (camel_operation_register, unregister): Added
- some warnings for bad cases.
-
-2001-07-23 Not Zed <NotZed@Ximian.com>
-
- * camel-operation.c (camel_operation_register): Only insert a hash
- entry if we haven't already.
- (camel_operation_unregister): Only remove the has entry if the id
- is a real thread.
-
-2001-07-23 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-filter-driver.c (do_move): Slight fix for when source ==
- destination (we don't want to do this action because on-demand
- filtering would then delete the messages it supposedly "moved").
-
-2001-07-23 Not Zed <NotZed@Ximian.com>
-
- * providers/smtp/camel-smtp-transport.c (smtp_auth, smtp_helo,
- send_to): Added some operation progress reporting. Actual data
- transfer is 'tricky' because of the layers used.
- (smtp_auth): Instead of checking exception_is_set, use
- challenge==NULL to test if sasl_challenge_base64 failed.
-
- * providers/local/camel-mbox-summary.c (mbox_summary_sync): Remove
- peters changes below and put in a better fix. These functions
- already return -1 on error, just use that, and not worry about
- building our own exception redundantly.
-
- * camel-service.c (camel_get_host_byname): Turn the progress into
- a transient event.
-
-2001-07-20 Peter Williams <peterw@ximian.com>
-
- * providers/local/camel-mbox-summary.c (mbox_summary_sync): More
- usage fixes for CamelException. Check our own exception for
- summary_update and xfer it out if an error occurred.
-
-2001-07-20 JP Rosevear <jpr@ximian.com>
-
- * Pull up test fixes to get them building again
-
-2001-07-20 Not Zed <NotZed@Ximian.com>
-
- * camel-charset-map.c (camel_charset_get_iconv_friendly_name):
- renamed to camel_charset_to_iconv() to make it just a little more
- consistent and not so long & fixed callers.
-
-2001-07-19 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-filter-charset.c
- (camel_mime_filter_charset_new_convert): Convert to the
- iconv-friendly charset names.
-
- * providers/imap/camel-imap-store.c (create_folder): Fixed a
- compiler warning about returning without a value in a non-void
- function. Blah.
-
- * camel-mime-part.c (process_header): Pass the locale charset as
- the default_charset to header_decode_string().
-
- * camel-folder-summary.c (camel_folder_summary_format_string):
- Pass the locale charset as the default_charset to
- header_decode_string().
- (content_info_new): Same.
-
- * camel-mime-message.c (process_header): Pass the locale charset
- as the default_charset to header_decode_string().
-
- * camel-mime-utils.c (append_8bit): New helper function who's
- purpose is similar to append_latin1() but for 8bit text that we
- are assuming is not latin1.
- (header_decode_text): Now takes a default_charset parameter and
- calls append_8bit when appropriate.
- (header_decode_string): Also takes a default_charset parameter
- now.
- (header_decode_mailbox): Pass NULL as the default_charset to
- header_decode_string().
-
-2001-07-19 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-pgp-context.c (pgp_verify): Modified to treat the return
- value from camel_charset_locale_name() as a const char*.
-
- * camel-sasl-digest-md5.c (digest_response): Modified to treat the
- return value from camel_charset_locale_name() as a const char*.
-
- * camel-charset-map.c (camel_charset_locale_name): Modify to
- return const char* by returning the static locale_charset which is
- created inside of camel_charset_map_init().
- (camel_charset_map_init): Find the locale charset here and set the
- static variable.
-
-2001-07-19 Peter Williams <peterw@ximian.com>
-
- Policy change: NULL url's are no longer allowed in
- CamelFolderInfos. They used to signify that the folder was, in
- IMAP jargon, NoSelect; now the same effect is achieved by adding a
- "noselect=yes" parameter to the end of the URL. As far as I know,
- IMAP is the only affected provider.
-
- * providers/imap/camel-imap-store.c (delete_folder): New
- function. Implement folder deletion.
- (camel_imap_store_class_init): Set the delete_folder class
- function here.
- (get_folder_status): New function. Utility wrapper around the
- STATUS command.
- (create_folder): If the parent folder is NoSelect but is empty,
- delete it and recreate it as a a subfolder-containing folder. If
- it is NoSelect but contains messages, set an exception.
- (parse_list_response_as_folder_info): Always set the FolderInfo's
- URL, but add a NoSelect parameter if it isn't selectable.
- (get_folder_info_online): Change logic of removing the namespace
- to reflect URL change. Same for logic of checking unread counts.
- (get_folder_info_online): Use get_folder_status to simplify this.
-
- * camel-store.c (camel_folder_info_build): When creating dummy
- parents, copy the child's URL and set the NoSelect parameter.
-
-2001-07-19 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-part-utils.c
- (simple_data_wrapper_construct_from_parser): No need for
- `acharset' anymore.
- (check_html_charset): Return a const char* and also use
- camel_charset_get_iconv_friendly_name() internally.
-
- * camel-mime-utils.c (rfc2047_decode_word): Remove my iso8859-1 ->
- iso-8859-1 hack and use camel_charset_get_iconv_friendly_name()
- instead.
- (rfc2184_decode): Use camel_charset_get_iconv_friendly_name()
-
- * camel.c (camel_init): Call camel_charset_map_init().
-
- * camel-charset-map.c (camel_charset_map_init): New function to
- initialize the charset-equivalent lookup table. To be called by
- camel_init().
- (camel_charset_get_iconv_friendly_name): New function to try and
- convert a charset into something that iconv is more likely to
- accept.
-
-2001-07-19 Peter Williams <peterw@ximian.com>
-
- * Revert 7/11/2001 patch for IMAP INBOX filtering at NotZed's
- request.
-
-2001-07-17 Peter Williams <peterw@ximian.com>
-
- Clean up some exception misusage.
-
- * providers/imap/camel-imap-command.c (camel_imap_command): Use
- our own internal exception for sending the string and transfer it
- to @ex if anything goes wrong.
- (imap_read_response): Use our own internal exception for reading
- the untagged responses and blah blah blah.
-
- * camel-session.c (get_service): Use our own internal exception
- when constructing the service and transfer it to @ex if anything
- goes wrong.
-
- * camel-remote-store.c (remote_recv_line): Instead of having
- gboolean exception, use our own internal exception and copy
- it to @ex if anything goes wrong.
-
- * camel-store.c (store_sync): Create an internal exception
- because sync_folder() checks it for validity. Transfer it to
- @ex when done.
-
- * camel-exception.c (camel_exception_get_description): If @ex is
- NULL, complain - passing NULL exceptions to Camel is okay, but
- there should be no circumstances under which they're then
- examined.
- (camel_exception_get_id): Same here,
- (camel_exception_xfer): NULL-protect and warn if transferring from
- a NULL exception.
-
-2001-07-17 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-store.c (init_trash): Use CAMEL_VTRASH_NAME.
-
- * camel-vtrash-folder.h: #define CAMEL_VTRASH_NAME
-
-2001-07-16 Dan Winship <danw@ximian.com>
-
- * providers/imap/camel-imap-command.c (camel_imap_response_free):
- Given:
- * 4 EXISTS
- * 1 EXPUNGE
- We have to pass 3, not 4 to camel_imap_folder_changed for the
- exists count. Fixes ximian bug #2112 (finally!).
-
-2001-07-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-folder.c (camel_imap_folder_changed):
- If the message info for an expunged message is NULL, then just
- break out - maybe a message was expunged that we were never
- notified even existed?
-
-2001-07-13 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-utils.c (rfc2047_decode_word): Added a hack to
- convert charsets in the format iso8859-1 to iso-8859-1 because it
- seems to be more iconv friendly. It has been reported that on some
- systems, iconv doesn't know about iso8859-1 while it *does* know
- about iso-8859-1. See bug #4530.
-
-2001-07-13 Peter Williams <peterw@ximian.com>
-
- * Makefile.am (install-exec-local): Let people install as
- non-root, but give them a bigass warning so they're not allowed to
- complain when it doesn't work right.
-
- * camel-remote-store.c (sync_remote_folder): New function: hash
- table callback.
- (remote_disconnect): If cleanly disconnecting, sync our
- folders. Fixes deadlocks on exit (folders syncing after store
- disconnects) and also makes sense.
-
-2001-07-13 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-uid-cache.c (camel_uid_cache_new): We now use a structure
- as the bucket data rather than just a cache level so set the save
- state to TRUE.
- (maybe_write_uid): We only save the uid if the cache levels are
- the same *and* if the save state is TRUE.
- (free_uid): Free the state value.
- (camel_uid_cache_get_new_uids): New uids that get added to the
- cache start with a save state of FALSE.
- (camel_uid_cache_save_uid): Set the save state of the uid to
- TRUE. What should we do if the uid isn't already in the cache?
- Currently I make it add the uid, but maybe it shouldn't?
-
- * providers/imap/camel-imap-folder.c (imap_filter_timeout): Update
- to reflect CamelFilterDriver API changes.
-
- * camel-filter-driver.c (camel_filter_driver_filter_folder): Take
- a cache argument so we can tell the cache whether or not the uid
- should be saved (meaning we have successfully filtered it).
-
-2001-07-12 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-filter-driver.c (camel_filter_driver_filter_message):
- Okay, I've decided that that user is just on crack. We don't want
- to allow filtering of deleted messages or we could get some
- unexpected behavior.
- (do_move): Oops. My last fix needs to be after the if-statement,
- not inside it.
- (do_copy): And here too.
-
-2001-07-12 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-filter-driver.c (do_move): Only set p->copied and
- p->deleted if the messages are copied without an exception.
- (do_copy): Same - but obviously we don't set the p->deleted here
- at all.
- (camel_filter_driver_filter_message): Since users complained that
- they couldn't filter deleted messages for "safe keeping" (WTF?
- safe keeping? why were they deleted in the first place then??), I
- have taken out the code that optimized filtering by not allowing
- deleted messages to be filtered. This fixes bug #4473.
-
- Note: Users have a warped sense of logic.
-
-2001-07-12 Not Zed <NotZed@Ximian.com>
-
- * camel-mime-part-utils.c (extract_metatag_charset): Removed.
- (check_html_charset): Replaced with this.
- (simple_data_wrapper_construct_from_parser): Call
- check_html_charset if we dont have a charset on the content-type,
- and we have text/html data.
- (check_html_charset): We also need to do qp/base64 decoding
- ourselves, sigh.
-
- * camel-mime-utils.c (html_meta_param_list_decode): Removed. This
- was very wrong, the rules for mail headers vastly different from
- rules for decoding html elements.
- (rfc2184_decode): Move the malloc inside the iconv_open worked,
- otherwise we have a memleak.
-
- * camel-mime-filter-html.c (camel_mime_filter_html_finalize, init,
- run, reset): Changed to use camelhtmlparser, and fixed a tiny
- memleak.
-
- * camel-html-parser.c: Made the html indexer tokeniser re-usable.
- ONLY TO BE USED INTERNAL TO CAMEL HOWEVER.
- (tokenise_step): Slight fix to non-quoted values.
-
- * camel-folder-summary.c
- (camel_folder_summary_info_new_from_message): Removed some code i
- wasn't supposed to commit.
-
- * providers/local/camel-local-summary.c (local_summary_add): Only
- set info->size if it is not zero.
- (local_summary_add): If we dont get a size from the info passed
- in, calculate it using a null stream write. Should do #4392.
-
-2001-07-11 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-part-utils.c (extract_metatag_charset): New function
- to extract a meta-tag charset value if it exists.
- (simple_data_wrapper_construct_from_parser): Along the same lines
- as the code I previously ripped out, but this time use the
- mime-parser's seek ability to help us along. Currently I read up
- to a 2k buffer size - this is probably overkill, 1k is probably
- plenty.
-
- * camel-mime-utils.c (html_meta_param_list_decode): When we get to
- an `=', we must skip past it before trying to grab the param
- value. duh.
-
-2001-07-11 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-part-utils.c
- (simple_data_wrapper_construct_from_parser): Ripped out my code
- since it was never being used since the mime parser is not using a
- seekable stream (ever?) which pretty much means my code needs to
- be done someplace else.
-
-2001-07-11 Peter Williams <peterw@ximian.com>
-
- * providers/imap/camel-imap-folder.c (camel_imap_folder_changed):
- Run the filter in its own thread to prevent locking issues.
- (imap_filter_timeout): New function that does the filtering called
- as a CamelSession timeout.
-
-2001-07-11 Not Zed <NotZed@Ximian.com>
-
- * camel-filter-driver.c (camel_filter_driver_filter_mbox): Create
- the messageinfo itself, so we can properly set the size.
-
- * camel-movemail.c (camel_movemail_solaris): Write out the from
- line between each message.
-
-2001-07-10 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-local-summary.c (local_summary_add): Copy
- the size across from the source message info if supplied.
-
- * camel-stream-null.c: Added a 'written' member which keeps track
- of how much has been written to the stream.
-
- * camel-movemail.c (camel_movemail): If we have BROKEN_SPOOL
- defined, then use the solaris movemail to quote from lines that
- sendmail didn't.
- (camel_movemail_solaris): Compile this in if BROKEN_SPOOL defined.
-
-2001-07-10 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-utils.c (html_meta_param_list_decode): New function
- to parse an HTML meta-tag.
-
- * camel-mime-part-utils.c
- (simple_data_wrapper_construct_from_parser): If the Content-Type
- did not contain a charset parameter and it's also a text/html
- part, we have 1 last place to look - in the META html tags. *sigh*
-
- * camel-mime-message.c (camel_mime_message_get_source):
- s/gint/unsigned since that's what it should be.
-
-2001-07-09 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-pgp-context.c (pgp_sign): Forget the passphrase if the
- user has set that option.
- (pgp_clearsign): Same.
- (pgp_encrypt): And here...
- (pgp_decrypt): And finally here.
- (camel_pgp_context_new): Take a `remember' argument.
-
-2001-07-09 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-maildir-summary.c (maildir_summary_sync):
- Oops, e_poolv_set free's it for us, so dont double-free here.
-
-2001-07-06 Not Zed <NotZed@Ximian.com>
-
- * camel-vee-folder.c (camel_vee_folder_finalise): Changed so we
- dont have the list changing under us, just going to the next node
- before we call a function that might change the list is
- potentially dangerous (slight mod of peters fix). Hmm, i think it
- would've double-unref'd it too(?)
-
-2001-07-08 Chris Toshok <toshok@ximian.com>
-
- * camel-tcp-stream-openssl.c (camel_tcp_stream_openssl_finalize):
- openssl_table is gone. we now store/get the stream from the
- SSL_CTX's app_data.
- (stream_read): rework the non-blocking case to account for SSL
- possibly buffering data (in which case select will block even
- though data is ready to be read), and to account for FreeBSD's
- strange behavior of returning -1/EAGAIN even though select said
- the fd was ready to be read.
- (ssl_verify): openssl_table is gone.
- (open_ssl_connection): set the SSL_CTX's app_data to be the
- stream, remove the openssl_table code.
-
-2001-07-06 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-utils.c (header_encode_param): Don't allow in to be
- NULL, so instead of doing if (in == NULL) return;, make it a
- g_return_val_if_fail and later we can make it an assert or
- something.
-
- * providers/local/camel-maildir-store.c (get_inbox): Fixes bug
- #1138.
-
- * providers/local/camel-mbox-summary.c
- (camel_mbox_summary_build_from): Make the `day-of-month' digit
- take up 2 chars by using "%2d". Fixes bug #3989 for lame mailers
- like Pine.
-
- * camel-pgp-context.c (crypto_exec_with_passwd): Set the pipe fd's
- to nonblocking.
-
-2001-07-06 Peter Williams <peterw@ximian.com>
-
- * camel-object.c (camel_object_unref): Make sure that after the
- finalization event has happened and the finalization functions
- have been called that the object still has a zero refcount.
-
-2001-07-06 Joe Shaw <joe@ximian.com>
-
- * providers/nntp/camel-nntp-grouplist.c: Add locking to
- camel_nntp_get_grouplist_from_server().
-
- * providers/nntp/camel-nntp-resp-codes.h: Added
- NNTP_EXTENSIONS_SUPPORTED (202).
-
- * providers/nntp/camel-nntp-store.c (camel_nntp_store_get_extensions):
- Check for both NNTP_LIST_FOLLOWS and NNTP_EXTENSIONS_SUPPORTED from
- a LIST EXTENSIONS request. (Dunno if NNTP_LIST_FOLLOWS ever comes
- out of this, but that's what was already there...) Also, put some
- locking around it.
- (finalize): e_mutex_destroy() the command lock
- (camel_nntp_store_init): e_mutex_new() the command lock.
-
- * providers/nntp/camel-nntp-store.h: Add locking macros.
-
-2001-07-05 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-folder-summary.c (camel_message_info_string): Added an
- assert to make sure that `mi' isn't NULL.
- (camel_message_info_set_string): Same.
-
- * providers/imap/camel-imap-command.c (camel_imap_response_free):
- Create and use a temporary CamelException for use with
- camel_imap_folder_changed.
-
-2001-07-05 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-pgp-context.c (pgp_verify): Send the
- --no-auto-key-retrieve argument to gpg if we are in offline mode
- so that we don't have to worry about gpg hanging if it can't
- connect to the key servers, because now it shouldn't even attempt
- to.
-
-2001-07-05 Chris Toshok <toshok@ximian.com>
-
- * camel-tcp-stream-openssl.c (ssl_verify): use
- X509_STORE_CTX_get_ex_data to get at the SSL* - don't use the
- X509_STORE_CTX to look up our stream, since it's not what we used
- to insert our stream into the hashtable.
- (open_ssl_connection): insert the stream into the hashtable before
- calling SSL_connect, as this can cause ssl_verify to be called,
- and we need to look up the stream there. remove the stream from
- the hashtable if there's an error connecting.
- (stream_connect): pass the CamelTcpStreamOpenSSL* to
- open_ssl_connection since it handles the hashtable stuff. remove
- hashtable stuff from here.
-
-2001-07-05 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-folder.c (camel_folder_copy_messages_to): if source ==
- dest, just no-op.
-
-2001-07-05 Peter Williams <peterw@ximian.com>
-
- * camel-vee-folder.c (camel_vee_folder_finalise): Move this before the
- camel_vee_folder_remove_folder because that function modifies p->folders
- messing up our iteration.
- (camel_vee_folder_finalise): Don't unref our summary; camel-folder now
- does this.
-
- * camel-object.h (CamelObject): Add a 'destroying' flag to CamelObject.
-
- * camel-object.c (obj_init): Clear 'destroying'.
- (camel_object_unref): If 'destroying' then do not send the finalize
- event and do not call finalize functions. Otherwise, set destroying
- so just in case we get refed (eg event code) we don't get doubly
- finalized.
-
-2001-07-05 Not Zed <NotZed@Ximian.com>
-
- * camel-mime-filter-basic.c (filter): Fix the assertion slightly,
- if we have a little bit of input the output size could be larger,
- since we store upto 3 chars in the state.
-
- * camel-folder-summary.c
- (camel_folder_summary_info_new_from_message): When indexing a new
- record, create a pseudo word 'ibexindexed' so we can always tell
- that a message has already been idnexed, even if it contains no
- words of its own. Things like maildir use this check to see if
- its already been processed, and it matters if it is incorrect in
- this case (not just wasted cycles).
- (camel_message_info_dup_to): Assign the to->strings from the
- e_poolv_cpy() call, since it may allocaote a new poolv if the
- lengths do not match.
-
- (camel_folder_summary_info_new_from_parser): And same here.
-
- * providers/local/camel-maildir-summary.c (maildir_summary_sync):
- Changed the logicfor epoolv code to be different, we dont need to
- update hash references or any tricky stuff.
- (maildir_summary_check): Samehere.
-
- * camel-folder-summary.h: Removed include of e-memory.h.
-
-2001-07-03 Joe Shaw <joe@ximian.com>
-
- * providers/nntp/camel-nntp-resp-codes.h: Added NNTP_NO_PERMISSION
- (502) to the list of response codes.
-
- * providers/nntp/camel-nntp-store.c (nntp_store_connect): If we
- receive a NNTP_NO_PERMISSION, don't get into an infinite loop trying
- to reconnect, get extensions, etc. Just give up and return FALSE.
-
-2001-07-03 Dan Winship <danw@ximian.com>
-
- * providers/imap/camel-imap-message-cache.c
- (camel_imap_message_cache_clear): Doh. Don't remove things from
- the hash table while foreach'ing it. (And can't use foreach_remove
- either because we have to remove them in a weird order). Fixes
- #3618.
-
- * providers/imap/camel-imap-folder.c (imap_get_message): If the
- server returns OK from the FETCH BODY, but there's no parseable
- BODY response, it's probably because there's an UN-parseable BODY
- response, implying the message is badly formatted, MIMEwise. In
- that case, fall back to fetching the message as a single part.
-
-2001-07-02 Sam Creasey <sammy@oh.verio.com>
-
- * providers/nntp/camel-nntp-folder.c: Implemented
- nntp_folder_search_by_expression and
- nntp_folder_search_free. Basic search functionality e.g. unread
- marking now works for NNTP folders.
-
- * camel_filter_search.c (get_size): Added get-size sexp directive
- to get the size of a message for filters.
-
- * providers/nntp/camel-nntp-folder.c (camel_nntp_folder_new):
- Always check with the NNTP server after summary load -- this
- function now always expires old summary entries and syncs with
- the news server.
-
- * providers/nntp/camel-nntp-utils.c (camel_nntp_get_headers):
- Only fetch headers for articles not already logged in
- the summary file.
-
- * providers/nntp/camel-nntp-grouplist.c
- (camel_nntp_get_grouplist_from_*): change from g_list_append()
- to g_list_prepend() + g_list_reverse. Traversing 40,000
- element linked lists sucks.
-
- * providers/nntp/camel-nntp-store.c (camel_nntp_command):
- Should the NNTP connection die with
- CAMEL_EXCEPTION_SERVICE_NOT_CONNECTED, make a single retry
- attempt. Timing out the NNTP link is less painful this way.
-
-2001-07-02 Peter Williams <peterw@ximian.com>
-
- * README (Introduction): Add comment noting that Camel actually
- exists now :-)
-
-2001-07-02 Dan Winship <danw@ximian.com>
-
- * camel-session.c (camel_session_get_filter_driver): new method to
- get an application-initialized filter driver.
-
- * camel-filter-driver.c (camel_filter_driver_new): Remove the
- get_folder function and data args from here...
- (camel_filter_driver_set_folder_func): ...and add this function to
- set/change them.
-
- * providers/imap/camel-imap-folder.c (camel_imap_folder_new): If
- this folder is INBOX and we're filtering INBOX, set a flag on the
- folder for later.
- (imap_update_summary): Add another argument (GPtrArray *recents),
- and if it's non-NULL, add the uids of any \Recent new messages to
- it.
- (camel_imap_folder_changed): If doing filtering in this folder,
- create a recents array and pass it to imap_update_summary. Then
- get a filter driver and use it to filter the recent messages.
-
- * providers/imap/camel-imap-summary.h:
- * providers/imap/camel-imap-utils.c (imap_parse_flag_list): Add
- support for the \Recent flag.
-
- * providers/imap/camel-imap-provider.c (imap_conf_entries): enable
- the "filter" option.
-
- * camel-types.h: add CamelFilterDriver typedef here
-
-2001-07-02 Not Zed <NotZed@Ximian.com>
-
- * camel-lock-client.c (camel_lock_helper_init): properly return
- error if we can't create pipes.
-
- * camel-folder-summary.c (summary_build_content_info): re-enable
- html indexing.
-
- * camel-mime-filter-html.c: Completely re-implemented using a
- custom parser.
-
-2001-07-02 Dan Winship <danw@ximian.com>
-
- * tests/misc/url.c (main): Change a camel_exception_clear to
- camel_exception_init to fix a sometimes-crash
-
-2001-06-29 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-utils.c: Added Originator: header as a header to look
- for when looking for the mailing list.
-
- * tests/mime-filter/Makefile.am: Build the test-crlf test program.
-
- * tests/mime-filter/test-crlf.c: New test suite for the crlf
- filter.
-
- * camel-mime-filter-crlf.c (filter): Fixed to correctly encode and
- decode dots.
-
-2001-06-28 Peter Williams <peterw@ximian.com>
-
- * camel-mime-filter-stripheader.c: New file. Filter that strips a
- header from mime output.
-
- * camel-mime-filter-stripheader.h: New file. Header for the above.
-
- * providers/smtp/camel-smtp-transport.c (smtp_data): Use the
- stripheader filter to remove the "Bcc" header.
-
- * Makefile.am: Add the stripheader files.
-
- * tests/lib/Makefile.am (INCLUDES): Get this to compile again.
-
- * tests/mime-filter/test-stripheader.c: New file. Test suite for
- the CamelMimeFilterStripHeader.
-
- * tests/mime-filter/Makefile.am: New test section: mime filters.
-
-2001-06-28 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-utils.c (header_decode_param_list): Fix a memory
- leak. Also if the decoded value is NULL, that means it wasn't
- encoded so we don't want to toss the old value.
- (header_param_list_format_append): Correctly wrap long parameter
- values according to rfc2184.
-
-2001-06-28 Dan Winship <danw@ximian.com>
-
- * providers/imap/camel-imap-folder.c (imap_refresh_info): If the
- folder is frozen, don't refresh, just record that we need to do it
- later.
- (imap_append_online): If the APPEND doesn't trigger an immediate
- EXISTS response (because the folder isn't the selected folder, or
- because the server doesn't do that until the next command), call
- imap_refresh_info on the folder.
- (imap_copy_online): Likewise. (Replacing the unconditional NOOP
- that was there before, which absolutely killed filter performance
- by forcing the IMAP provider to switch back and forth between
- folders after every copy or move.)
- (imap_thaw): If the folder needs a refresh, do it.
-
- * camel-folder.c (camel_folder_is_frozen): New method
-
-2001-06-27 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-transport.c (camel_transport_init): Initialize the private
- send_lock.
- (camel_transport_finalize): Free the private send_lock.
- (camel_transport_get_type): Set the init and finalize functions.
- (camel_transport_send): Lock the transport.
- (camel_transport_send_to): Same.
-
- * camel-private.h: Add CAMEL_TRANSPORT_(UN)LOCK macros.
-
-2001-06-27 Jeffrey Stedfast <fejj@ximian.com>
-
- * tests/folder/test9.c (main): Updated to match the current API.
-
- * tests/folder/test3.c: #include <gtk/gtk.h> since we use
- gtk_init().
-
- * camel-internet-address.c
- (camel_internet_address_encode_address): Use the new
- header_address_fold.
-
- * camel-mime-utils.c: Removed some old #if 0'd code of mine.
- (rfc2047_encode_word): If enclen is 0, don't write an encoded word
- token (=?iso-8859-7?Q??= would be an invalid token).
- (header_address_fold): New function to wrap address headers -
- header_fold() was force-wrapping rfc2047 encoded words which was
- making the test suite fail. The *real* solution, however, is to
- not create rfc2047 encoded words longer than 72 chars.
-
-2001-06-26 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-filter-driver.c (open_folder): Since we want an error
- opening a folder to result in the message being copied to Inbox
- (assuming no other filters get a chance to `move` it), don't
- record any exceptions that may occur in this function.
-
-2001-06-26 Dan Winship <danw@ximian.com>
-
- * providers/imap/camel-imap-folder.c (camel_imap_folder_selected,
- imap_append_offline, imap_append_online,
- camel_imap_folder_changed): lock the cache around accesses
-
- * providers/imap/camel-imap-store.c (get_folder_online): ref the
- newly-created folder (as current_folder) before calling
- camel_imap_folder_selected, in case that needs to do something
- that causes another folder to become current...
-
- * camel-service.c (camel_service_get_url): D'oh.
- s/FALSE/CAMEL_URL_HIDE_PASSWORD/
-
-2001-06-25 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-filter-search.c (get_source): g_strdup() the message
- source here or we will have problems later when we go to free the
- result ;-)
-
-2001-06-25 Dan Winship <danw@ximian.com>
-
- * providers/imap/camel-imap-store.c (try_auth): Fix this: IMAP
- doesn't allow an extra argument to AUTHENTICATE to avoid a useless
- round trip like some other SASL bindings do.
-
- * providers/imap/camel-imap-command.c (imap_read_response): Deal
- with IMAP servers that (incorrectly) return "+\r\n" rather than
- "+ \r\n" for an empty continuation response.
- (camel_imap_response_extract_continuation): Likewise.
-
-2001-06-21 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-utils.c (word_types_compatable): New function that
- decides if 2 word types are mergeable. An atom and a qstring are
- mergeable; 2 qstrings are mergeable; and 2 encoded words are
- mergeable.
- (header_encode_phrase_merge_words): If 2 words are merged, the new
- word type is the MAX of the combined types. This means that if we
- merge a qstring and an atom, the resulting word type is a
- qstring.
-
- * camel-internet-address.c (internet_format):
- s/g_string_sprintfa/g_string_append since this makes more sense in
- this particular case.
- (internet_encode): Same here.
-
-2001-06-21 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/smtp/camel-smtp-transport.c (smtp_send): Use
- camel_address_length() rather than casting and accessing data
- members.
-
-2001-06-20 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-utils.c (header_raw_check_mailing_list): If the first
- char of the mailing-list name is '<', chop it off to make Ettore
- happy. Fixes bug #2153.
-
-2001-06-19 Not Zed <NotZed@Ximian.com>
-
- * camel-lock-helper.c (unlock_id): Fixed a bug when not running
- setuid it wouldn't unlock.
-
- * camel-movemail.c (camel_movemail): use new
- locking daemon, also return an error code.
-
-2001-06-18 Jeffrey Stedfast <fejj@ximian.com>
-
- Note: Except for the info_free(), the NULL checks are
- g_return's. I felt that since g_free() handles NULL that our
- _free() functions should also.
-
- * camel-folder.c (camel_folder_change_info_free): Check to make
- sure that the info pointer isn't NULL.
- (camel_folder_change_info_change_uid): Same.
- (camel_folder_change_info_changed): Same.
- (camel_folder_change_info_remove_uid): Same.
- (camel_folder_change_info_add_uid): Same.
- (camel_folder_change_info_build_diff): Same.
- (camel_folder_change_info_cat): Same.
- (camel_folder_change_info_add_source): Same.
- (camel_folder_change_info_add_source_list): Same.
- (camel_folder_change_info_add_update): Same.
- (camel_folder_change_info_add_update_list): Same.
-
-2001-06-18 Dan Winship <danw@ximian.com>
-
- * tests/stream/Makefile.am (LDADD):
- * tests/smime/Makefile.am (LDADD):
- * tests/misc/Makefile.am (LDADD):
- * tests/message/Makefile.am (LDADD):
- * tests/folder/Makefile.am (LDADD): Remove DB3_LDADD
-
- * Makefile.am (install-exec-local): Set camel-lock-help setgid or
- setuid as needed
-
-2001-06-18 Not Zed <NotZed@Ximian.com>
-
- * camel-folder-summary.c
- (camel_folder_summary_info_new_from_parser): Only create a missing
- uid if we have indexing turned on.
-
- * camel-lock-helper.c (setup_process): Function to setup
- process/sanity/security checks. Change to the real uid as soon as
- we can.
- (lock_path): First try to lock as the real uid, if that fails, try
- the root uid.
- (unlock_id): Unlock as the uid we created the lock as.
-
- * Makefile.am (INCLUDES): Added -DCAMEL_SBINDIR for lock helper
- location.
-
- * providers/local/camel-spool-folder.c (spool_lock): Implemented,
- using lock helper locking. Need to work out if the locking
- requires a root created lock?
- (spool_unlock): Likewise.
-
-2001-06-15 Not Zed <NotZed@Ximian.com>
-
- * camel-lock-helper.c: Setuid Lock helper process. Creates and manages
- .locks, keeping them active, removing them, etc. What real perms it
- needs is a little system dependent.
-
-2001-06-14 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-maildir-store.c (get_folder_info): Implement.
- (scan_dir): Does the work of scanning for maildir directories.
-
-2001-06-13 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-spool-store.c (get_folder_info):
- Implemented, just returns a hardcoded INBOX folder.
- (free_folder_info): implemented, free's the 1 possible level of
- folder info.
-
- * providers/local/camel-spool-folder.c
- (camel_spool_folder_construct): Set the real unread message
- count on the folder_created thing.
-
-2001-06-15 Dan Winship <danw@ximian.com>
-
- * providers/imap/camel-imap-message-cache.c
- (camel_imap_message_cache_max_uid): Return the largest real UID in
- the cache (as an integer). Eventually to be used for an
- optimization in the new-message fetch code.
- (cache_put): Keep track of max_uid.
-
-2001-06-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-utils.c: Added Mailing-List header regex so that we
- can do mlist magic on that header.
-
-2001-05-28 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-utils.c (header_decode_param): Properly handle
- correct and incorrect (for the common case, ie Outlook and
- Netscape/Mozilla) rfc2184 values.
- (header_decode_rfc2184_param): Get the param name and see if we
- should expect a rfc2184 parameter value.
- (rfc2184_decode): Decode a rfc2184 value.
- (hex_decode): hex decode a string.
- (header_decode_param_list): Handle rfc2184 encoded parameters (ie
- parameters that have been split and perhaps encoded).
- (header_param_list_format_append): Encode the value before seeing
- if it will fit on the line. If the value does get encoded, be sure
- to put a '*' before the equal-sign.
- (header_encode_param): New function to rfc2184 encode a parameter
- value (maybe it should be renamed?)
-
-2001-06-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-part.c (init_header_name_table): Don't try to format
- the Reply-To header - we don't want to wrap the reply-to address.
-
-2001-06-12 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-spool-*.[ch]: A new provider, for spool
- mailboxes. Mostly a cut and paste of the mbox code, but not a
- subclass CamelLocal*. Not tested a lot, doesn't lock yet, use
- with extreme caution.
-
- * tests/lib/folders.c (test_folder_message_ops): Added spool arg,
- spool folders can't be deleted, renamed, etc.
- (test_folder_basic): Same.
-
- * tests/folder/test2.c (main): Added checks for spool type.
-
- * tests/[message|stream|folder|misc|smime]/Makefile.am (LDADD):
- Added db3 flags, so make check compiles, doesn't run though.
-
-2001-05-24 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-local-provider.c
- (camel_provider_module_init): Added spool provider.
-
-2001-06-07 Jon Trowbridge <trow@ximian.com>
-
- * camel-filter-driver.c (camel_filter_driver_filter_folder): Add a
- separator between the service url and the folder name, if needed.
-
- * camel-filter-driver.c (camel_filter_driver_filter_mbox): Added
- an argument, so that the original source URI of the mbox can be
- passed in. This is needed because this function is called
- post-movemail, so we are never reading from the original mbox
- anymore. Without the original mbox URI, the X-Evolution-Source
- tag gets set incorrectly and filter-on-source will fail to work.
- (camel_filter_driver_filter_message): Also take an extra arg
- for the original source URI. It is the original URI, not the
- source URI, that is used for filtering and for setting the
- X-Evolution-Source tag.
-
-2001-06-05 Dan Winship <danw@ximian.com>
-
- * providers/imap/camel-imap-folder.c (imap_rescan): Don't fetch
- the UID and FLAGS of messages we don't know about yet, since
- they'll just get discarded.
-
-2001-06-01 Jeffrey Stedfast <fejj@ximian.com>
-
- * tests/smime/pgp.c: Fix to not get into a recursive loop in
- get_type().
-
- * tests/smime/pgp-mime.c: Same.
-
-2001-05-31 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-smime-context.c: Numerous fixes to get it to compile.
-
- * camel.h: Added camel-cipher-context.h, camel-cms-context.h,
- camel-smime-context.h, and camel-smime-utils.h
-
- * camel-cms-context.[c,h]: New virtual class for manipulating
- cryptographic message syntax messages (like S/MIME).
-
- * camel-smime-context.[c,h]: Modified to inherit from the
- CamelCMSContext class rather than the CamelCipherContext class.
-
- * camel-smime.[c,h]: Removed - just use camel-smime-context
- directly.
-
- * camel-smime-utils.[c,h]: New source files. Moved the 2 useful
- functions from camel-smime.[c,h] into here.
-
-2001-05-30 Dan Winship <danw@ximian.com>
-
- * camel-charset-map.c: Redo the BUILD_MAP code to not depend on
- libunicode. Now it only generates a map of "popular" 8bit
- encodings. (It's not worthwhile to support obscure encodings,
- because any mailer that supports them will support UTF8 too. And
- Chinese and Japanese use mostly the same UTF8 characters so you
- need to decide between those encodings based on the locale or
- the charset of the message you're replying to or the input
- method you used. So this is sufficient for camel_charset_best's
- use.)
-
- * camel-charset-map-private.h: Regenerated.
-
- * camel.c (camel_shutdown): Move #ifdefs around to prevent a
- warning.
-
-2001-05-29 Dan Winship <danw@ximian.com>
-
- * camel-disco-diary.c: Code for logging and replaying offline
- operations.
-
- * camel-disco-store.c (disco_construct): Set disco->status here
- (where we can base it on the session's offline status) rather than
- at init time.
- (disco_connect): If we connect online and have a non-empty diary,
- switch to RESYNCING mode and replay the diary to the server.
- (disco_get_folder, disco_get_folder_info): Add _resyncing
- variants.
-
- * camel-disco-folder.c (disco_sync, disco_expunge_uids,
- disco_append_message, disco_copy_messages_to,
- disco_move_messages_to): Add _resyncing variants to switches.
- (disco_expunge_uids, disco_append_message, disco_copy_messages_to,
- disco_move_messages_to): Remove #ifdef'ed out diary code: let the
- provider do it.
- (disco_append_message): Redo the append methods to no longer
- return the UID, since we're no longer doing the logging from here.
-
- * providers/imap/camel-imap-store.c (imap_connect_online,
- imap_connect_offline): Create a CamelDiscoDiary.
- (imap_disconnect_offline): And free it.
-
- * providers/imap/camel-imap-folder.c (camel_imap_folder_selected):
- If RESYNCING, don't do any sort of checking that the remote folder
- matches the summary, beyond making sure that the UIDVALIDITY is
- correct.
- (imap_rescan): Add a missing camel_folder_summary_info_free when
- removing a UID from the summary.
- (imap_expunge_uids_offline): Implement. Fairly simple.
- (imap_expunge_uids_resyncing): Implement. If the store supports
- UIDPLUS, we can just use imap_expunge_uids_online. If not, we need
- to temporarily undelete any messages marked deleted on the server
- that aren't supposed to get expunged.
- (imap_append_offline): Implement, using cache and summary
- operations, and triggering the folder_changed event by hand.
- (imap_append_resyncing): Implement. Redo imap_append_online a bit
- in the process to make them able to share more code.
- (imap_copy_offline): Implement.
- (imap_copy_online): Move parts of this out into a helper.
- (imap_copy_resyncing): Implement. In most cases this is just like
- imap_copy_online, but if you are copying a message that was itself
- copied or appended into the folder, and the server doesn't do
- UIDPLUS, it will be necessary to replace at least part of the copy
- operation with one or more appends.
-
- * providers/imap/camel-imap-command.c (imap_read_response): Don't
- record the current folder in the response when in RESYNCING mode.
- (This means that EXISTS and EXPUNGE responses won't be processed,
- which is needed because the summary may not match the folder at
- this point.)
- (imap_read_response): On error, call
- camel_imap_response_free_without_processing, not
- camel_imap_response_free.
-
- * providers/imap/camel-imap-utils.c (imap_uid_array_to_set): Make
- this work better when operating on UIDs that aren't in the summary.
-
- * providers/imap/camel-imap-summary.c
- (camel_imap_summary_add_offline): New routine used by
- imap_append_offline and imap_copy_offline to create new summary
- entries.
-
-2001-05-28 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-utils.c (header_set_param): Use g_strcasecmp()
- because some systems don't have strcasecmp(). Also, when removing
- a param, make sure to free the param->name too.
-
-2001-05-27 Dan Winship <danw@ximian.com>
-
- * tests/lib/messages.c (test_message_read_file): Fix an fd leak
-
- * tests/lib/session.c, tests/lib/session.h: a CamelSession
- subclass for the test programs.
-
- * tests/lib/Makefile.am: include session.[ch]
-
- * tests/folder/test*.c: Use a CamelTestSession from libcameltest
- instead of cut+pasting everywhere.
-
- * tests/misc/url.c (main): Update for a camel_url_new change at
- some point.
-
- * tests/*/.cvsignore: Add stuff.
-
- * camel-mime-utils.c (rfc2047_encode_word): Fix a silly ==/!=
- mixup.
-
-2001-05-26 Dan Winship <danw@ximian.com>
-
- * providers/imap/camel-imap-folder.c: Add a "need_rescan" flag
- saying if we want to rescan the entire folder for flag changes
- next time it's selected.
- (camel_imap_folder_init): Set need_rescan TRUE.
- (camel_imap_folder_selected): If need_rescan is TRUE, call
- imap_rescan.
- (imap_refresh_info): Only do a full rescan if need_rescan is TRUE.
- Otherwise just do a NOOP, making this a MUCH more lightweight
- operation. Also, don't call imap_rescan directly if the folder
- isn't selected, since that could end up causing the folder to be
- scanned *twice* (imap_rescan -> camel_imap_command ->
- camel_imap_folder_selected -> imap_rescan).
- (imap_rescan): Set need_rescan FALSE.
- (imap_sync_online): Don't NOOP if no changes were pushed: the
- caller will call refresh_info if it wants to poll for changes.
- Fixes evolution-mail doing lots of unnecessary extra work at
- quit time.
-
- * providers/imap/camel-imap-store.c (refresh_folder_info): Set
- need_rescan on each folder before calling refresh_info.
-
-2001-05-25 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/smtp/camel-smtp-transport.c (smtp_auth): Oops. Use a
- strNcmp to make sure the response begins with a 334 code, not a
- strcmp. Duh.
-
- * providers/local/camel-maildir-folder.c (maildir_append_message):
- remove the summary info so we are not out-of-sync with the maildir
- folder.
-
- * providers/local/camel-mh-folder.c (mh_append_message): remove
- the summary info so we are not out-of-sync with the mh folder.
-
- * providers/local/camel-mbox-folder.c (mbox_append_message):
- remove the summary info so we are not out-of-sync with the mbox.
-
-2001-05-24 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-smime-context.c (camel_smime_context_new): Oops, I spelled
- the get-default-db function name wrong.
-
-2001-05-23 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/local/camel-local-folder.c
- (camel_local_folder_construct): s/folder_deleted/folder_created -
- result of a bad copy/paste.
-
- * providers/imap/camel-imap-search.c (imap_body_contains):
- Optimize the match "" case.
-
-2001-05-21 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-store.c (get_folder_info_online):
- Store the CamelFolderInfo tree that was returned from
- camel_folder_info_build() in a new variable, 'tree', rather than
- 'fi' since we later use 'fi' when syncing folders. Not only does
- this fix a memory leak, but it also fixes the bug where the user
- would only see the last folder in the folder list and/or it's
- subfolders.
-
-2001-05-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-session.c (camel_session_forget_password): The service can
- be NULL here too, thanks to Wayne Davis for pointing this out.
-
- * camel-smime-context.c (camel_smime_context_new): We don't need
- to be passed the certdb path anymore.
-
-2001-05-16 Dan Winship <danw@ximian.com>
-
- * camel-medium.c (camel_medium_get_headers): New function to
- return an array of all headers.
- (camel_medium_free_headers): And free them.
-
- * camel-mime-part.c (get_headers, free_headers): Implement this
- for CamelMimePart. (Works for CamelMimeMessage too.)
-
-2001-05-15 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-smime-context.c (camel_smime_context_finalise): Don't
- close or free (it wasn't allocated) the certdb.
- (camel_smime_context_new): If we get a NULL certdb handle, then
- don't bother trying to create a new certdb handle since NSS_Init*
- should have done that.
-
-2001-05-15 Jeffrey Stedfast <fejj@ximian.com>
-
- * Makefile.am: Don't use EXTRA_GNOME_*, use the new CAMEL_*
- variables so we don't link in tons of extra cruft that we don't
- need.
-
- * tests/smime/pkcs7.c: Added to the test suite - tests the S/MIME
- pkcs7 functions.
-
-2001-05-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-smime-context.c: Lots of fixes to get this to compile.
-
- * camel-smime.c (camel_smime_part_verify): Updated to pass in a
- hash argument to camel_smime_verify().
-
- * camel-pgp-mime.c (camel_pgp_mime_part_verify): Update according
- to the changes in the context API.
-
- * camel-pgp-context.c (pgp_verify): Updated to take a
- CamelCipherHash argument.
-
- * camel-cipher-context.c (camel_cipher_verify): Now takes a hash
- argument since the S/MIME code needs this.
-
- * Makefile.am: Add camel-smime-context.[c,h] and camel-smime.[c,h]
- to the build.
-
- * camel-smime.[c,h]: New source files for manipulating S/MIME
- message parts.
-
-2001-05-14 Jon Trowbridge <trow@ximian.com>
-
- * camel-search-private.c (utf8_get): Replicate the semantics of
- the libunicode utf8 functions by returning NULL in the arg
- on invalid utf8.
-
- * camel-pgp-context.c (pgp_verify): Check for valid utf8,
- terminate loop if something looks wrong.
-
- * camel-mime-utils.c (header_encode_phrase_get_words): Properly
- check for invalid utf8.
- (header_encode_string): Properly check for invalid utf8.
-
- * camel-charset-map.c (camel_charset_step): Properly check for
- invalid utf8.
-
-2001-05-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * tests/folder/test9.c:
- * tests/folder/test8.c:
- * tests/folder/test7.c:
- * tests/folder/test6.c:
- * tests/folder/test5.c:
- * tests/folder/test4.c:
- * tests/folder/test3.c:
- * tests/folder/test2.c:
- * tests/folder/test1.c:
- * tests/smime/pgp-mime.c:
- * tests/smime/pgp.c: Subclass CamelSession since we can no longer
- specify the passwd callback any other way and update code
- accordingly.
-
-2001-05-11 Dan Winship <danw@ximian.com>
-
- * camel-mime-utils.c (header_location_decode): Decode
- Content-Location, either correctly or Netscape-generated-brokenly.
-
- * camel-mime-part.c (camel_mime_part_set_content_location,
- camel_mime_part_get_content_location, etc): Deal with
- Content-Location header.
-
-2001-05-11 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/smtp/camel-smtp-transport.c (smtp_auth): Don't check
- the initial auth response until we get into the while-loop
- otherwise we have problems if the SASL mechanism supported a
- client initiated challenge (like PLAIN and LOGIN do).
-
-2001-05-11 Dan Winship <danw@ximian.com>
-
- * camel-stream-null.c (camel_stream_null_new): Make this return
- CamelStream * (like the other stream new functions) instead of
- CamelStreamNull *
-
-2001-05-10 Chris Toshok <toshok@ximian.com>
-
- * camel-tcp-stream-ssl.c (stream_connect): call SSL_Enable after
- the SSL_ImportFD and before PR_Connect. Otherwise, NSS aborts
- during the connect.
-
-2001-05-10 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-session.c (camel_session_get_password): Don't abort if the
- Service is NULL, this is perfectly valid for cipher contexts.
-
-2001-05-09 Peter Williams <peterw@ximian.com>
-
- * providers/imap/camel-imap-folder.c (imap_move_messages_to): Pass
- appropriate parameters to CF_CLASS and add comment explaining why
- my initial attempt at a solution didn't work.
-
-2001-05-09 Dan Winship <danw@ximian.com>
-
- * camel-disco-store.c (camel_disco_set_status): Set the
- disconnected status.
- (camel_disco_store_can_work_offline): Return whether or not a
- given CamelDiscoStore can work offline or not.
-
- * camel-disco-folder.c (camel_disco_folder_cache_message):
- Explicitly tell a folder to cache a message. (Better than using
- get_message, because for IMAP that doesn't guarantee you'll get
- all the message parts.)
- (camel_disco_folder_prepare_for_offline): Prepare a folder for
- offline use by caching all messages meeting given search criteria
- (and doing anything else the particular folder implementation
- needs).
-
- * camel-session.c (camel_session_set_online,
- camel_session_is_online): A session-wide online/offline toggle.
- (camel_session_init): Set online to TRUE.
-
- * providers/imap/camel-imap-store.c (can_work_offline):
- Implementation of CamelDiscoStore::can_work_offline. (Checks that
- the store has been used online at least once.)
- (imap_get_folder_online, imap_get_folder_offline): Deal with
- request for "inbox" properly. ("Don't you mean... 'INBOX'?").
-
- * providers/imap/camel-imap-folder.c (imap_cache_message):
- Implementation of CamelDiscoFolder::cache_message.
-
- * camel.h: Add camel-disco-store.h and camel-disco-folder.h
-
-2001-05-09 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-part.c (camel_mime_part_set_content_id): Wrap the
- content-id with <>'s.
-
-2001-05-04 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/smtp/camel-smtp-transport.c (connect_to_server): Add
- support for using OpenSSL.
-
- * camel-remote-store.c (remote_connect): Add support for using the
- OpenSSL implementation.
-
- * camel-tcp-stream-ssl.c (ssl_bad_cert): Hmmmm, don't pass in a
- NULL as the last argument to alert_user - prototype doesn't take
- that argument anymore?
-
- * camel-tcp-stream-openssl.c (camel_tcp_stream_openssl_finalize):
- (ssl_verify): Use a global hash table to try and lookup the
- CamelTcpStreamOpenSSL object given the ssl context since OpenSSL
- doesn't think one needs to pass data around, we should all be
- living in a world of global variables, duh!
-
-2001-05-06 Dan Winship <danw@ximian.com>
-
- * Makefile.am (libcamelinclude_HEADERS): Fix another build
- problem. (Um, anyone else could have done this...)
-
-2001-05-04 Dan Winship <danw@ximian.com>
-
- * providers/imap/camel-imap-store.c (get_folder_online): Fix up
- refcounting on current_folder.
-
- * camel-disco-folder.c, camel-disco-store.h: Remove
- CamelDiscoDiary refs that weren't supposed to escape yet.
-
-2001-05-03 Dan Winship <danw@ximian.com>
-
- * camel-disco-store.c: new abstract class for disconnectable
- remote stores
-
- * camel-disco-folder.c: new abstract class for folders on
- disconnectable stores.
-
- * Makefile.am: Add camel-disco-folder.[ch] and
- camel-disco-store.[ch].
-
- * providers/imap/camel-imap-store.c: Make this a subclass of
- CamelDiscoStore, and fix up the offline interfaces for the changes
- since they were first written (particularly the fact that some
- IMAP stores don't just use subscribed folders).
-
- * providers/imap/camel-imap-folder.c: Make this a subclass of
- CamelDiscoFolder, although most ops still fail in disconnected
- mode.
-
- * camel-store.c (camel_store_get_folder_info): Change gboolean,
- gboolean, gboolean to guint32 in the prototype for this function.
-
- * providers/local/camel-local-store.c (get_folder_info): Update
- for prototype change.
-
-2001-05-02 Dan Winship <danw@ximian.com>
-
- * providers/imap/camel-imap-store.h: Clean this up a bit. Add a
- "tag_prefix" member. Move "useful_lsub" into capabilities.
-
- * providers/imap/camel-imap-store.c (camel_imap_store_init):
- Initialize the tag_prefix, based on a static variable.
-
- * providers/imap/camel-imap-command.c (camel_imap_command): Use
- the store's tag_prefix character rather than "A" at the start of
- the tag. Makes the verbose debug output easier to parse when
- connected to multiple IMAP servers. (Well, unless you're connected
- to more than 26 servers...)
-
- * providers/imap/camel-imap-utils.c (imap_uid_array_to_set): Fix
- this up... it was losing count in some cases and giving a more
- verbose answer than it needed to.
-
- * providers/pop3/camel-pop3-store.c: Rescue the KPOP code from bit
- rot.
-
-2001-05-01 Dan Winship <danw@ximian.com>
-
- * providers/imap/camel-imap-command.c (camel_imap_command): Redo
- command locking. Since command_lock is recursive, we can just get
- a lock here, and release it either on error, or when the caller
- frees the response data. (This simplifies a lot of stuff, and
- fixes some problems with camel_imap_folder_changed being called
- without the command_lock locked because of the 2001-03-22 change.)
-
- (camel_imap_response_free):
- (camel_imap_response_free_without_processing):
- (camel_imap_response_extract):
- (camel_imap_response_extract_continuation): These all take a
- CamelImapStore now as well, to deal with locking.
-
- * providers/imap/camel-imap-private.h: Add
- CAMEL_IMAP_STORE_ASSERT_LOCKED, which defaults to a noop, but can
- be made to call e_mutex_assert_locked.
-
- * providers/imap/camel-imap-folder.c, camel-imap-search.c,
- camel-imap-store.c: Simplify using new locking stuff. Add a few
- CAMEL_IMAP_STORE_ASSERT_LOCKED checks.
-
-2001-05-01 Dan Winship <danw@ximian.com>
-
- Support the IMAP UIDPLUS extension (RFC 2359), which lets you
- resync after disconnected operation more efficiently, but also
- makes it possible to do appends and moves/copies more efficiently
- now.
-
- * providers/imap/camel-imap-folder.c (imap_append_message): If the
- server supports UIDPLUS, grab the APPENDUID response and cache the
- message into the folder's message cache.
- (imap_copy_messages_to): Likewise, for COPYUID, copy any message
- parts we have cached between the source and destination folder
- caches.
- (imap_get_message): If the entire message is already in the cache,
- just return that rather than building it from parts.
- (imap_update_summary): Fetch just the "UID FLAGS RFC822.SIZE" of
- the new messages first, then only fetch the headers for messages
- where we don't already have the headers cached.
-
- * providers/imap/camel-imap-message-cache.c: Add gtk-doc comments.
- (cache_put): Fix refcounting stuff here.
- (camel_imap_message_cache_insert_stream,
- camel_imap_message_cache_insert_wrapper): New.
- (camel_imap_message_cache_get): Fix a bug here so the memory
- caching actually works.
- (camel_imap_message_cache_copy): New routine, used by
- imap_copy_messages_to.
-
- * providers/imap/camel-imap-utils.c (imap_uid_set_to_array):
- Inverse operation of imap_uid_array_to_set. Used to parse COPYUID
- response.
-
-2001-04-30 Dan Winship <danw@ximian.com>
-
- * providers/imap/camel-imap-utils.c (imap_uid_array_to_set):
- New-and-improved version of get_uid_set() from
- camel-imap-folder.c. Looks at the summary as it goes so that if
- you ask for messages 5, 6, 8, and 9, and there is no message 7,
- then you get "5:9" instead of "5:6,8:9"
-
- * providers/imap/camel-imap-folder.c (imap_copy_messages_to): Use
- imap_uid_array_to_set() rather than get_uid_set().
- (get_uid_set): Gone
-
-2001-04-27 Dan Winship <danw@ximian.com>
-
- * camel-session.c: Redo this a lot so that instead of having a
- class full of callbacks, we have a subclassable class. Also,
- replace the increasingly horrifying
- camel_session_query_authenticator with three new routines,
- camel_session_get_password, camel_session_forget_password, and
- camel_session_alert_user.
-
- * camel-pgp-context.c:
- * camel-pkcs7-context.c:
- * camel-smime-context.c:
- * providers/imap/camel-imap-store.c:
- * providers/pop3/camel-pop3-store.c:
- * providers/smtp/camel-smtp-transport.c:
- Use camel_session_get_password / camel_session_forget_password.
-
- * camel-tcp-stream-ssl.c (ssl_bad_cert): Use
- camel_session_alert_user.
-
-2001-04-26 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel.c (camel_init): Automagically call camel_shutdown()
- atexit() ;-)
- (camel_init): Also initialize NSS databases as read/write for
- S/MIME and if NSS fails to init, try initializing with volatile
- databases.
-
- * camel-file-utils.h: #include <sys/types.h> for off_t.
-
-2001-04-26 Dan Winship <danw@ximian.com>
-
- * camel-file-utils.c: New file, with the int, string, time_t, and
- off_t encode/decode routines from camel-folder-summary.c moved
- here and renamed, for the enjoyment of non-CamelFolderSummary
- subclasses.
-
- * Makefile.am (libcamel_la_SOURCES): Add camel-file-utils.c
- (libcamelinclude_HEADERS): and camel-file-utils.h
-
- * camel-folder-summary.c: Remove functions that were moved to
- camel-file-utils.c, update uses of them for the new names.
- (camel_folder_summary_{en,de}code_token are still here.)
-
- * providers/local/camel-mbox-summary.c: Use camel_file_util_*
- names
-
- * providers/imap/camel-imap-summary.c: Use camel_file_util_* names
-
- * providers/imap/camel-imap-store.c (imap_store_setup_online,
- imap_store_setup_offline): Use camel_file_util_* names, which
- makes much more sense since this isn't folder summary stuff.
-
-2001-04-26 Dan Winship <danw@ximian.com>
-
- * Makefile.am (INCLUDES): Remove UNICODE_CFLAGS (and some other
- stuff that's redundant with EXTRA_GNOME_CFLAGS)
- (libcamel_la_LIBADD): Replace UNICODE_LIBS with GAL_LIBS.
-
- * camel-search-private.c:
- * camel-pgp-context.c:
- * camel-mime-utils.c: Use gunicode interfaces rather than
- libunicode.
-
- * camel-charset-map.c: Use gunicode rather than libunicode. (The
- charmap-regen code still depends on libunicode though.)
-
- * camel-mime-filter-charset.h:
- * tests/message/test2.c (convert): Use iconv rather than
- unicode_iconv.
-
- * providers/smtp/Makefile.am (libcamelsmtp_la_LIBADD):
- * providers/pop3/Makefile.am (libcamelpop3_la_LIBADD):
- * providers/local/Makefile.am (libcamellocal_la_LIBADD): Remove
- UNICODE_LIBS.
-
- * camel.c (camel_init): Remove call to unicode_init.
-
- * camel-mime-parser.c: Remove unused unicode.h include.
-
-2001-04-26 Dan Winship <danw@ximian.com>
-
- * camel-service.c (get_host): Use e_gethostbyname_r.
- (camel_service_gethost): Remove unused var.
-
-2001-04-26 Not Zed <NotZed@Ximian.com>
-
- * Applied jacob's patches for e-poolv stuff.
-
-2001-04-23 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel.h: Add camel-vee-folder.h and camel-digest-folder.h
-
- * camel-digest-folder.[c,h]: New class that can be used to browse
- a multipart/digest message as if it were a CamelFolder.
-
-2001-04-22 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-pgp-context.c (pgp_verify): Oops, don't use the return
- value of iconv() as a string length, it only tells us the number
- of non-reversable character conversions. This fixes it so we
- actually see the gpg output in the message viewer.
-
-2001-04-23 Mikael Hallendal <micke@codefactory.se>
-
- * providers/nntp/Makefile.am (INCLUDES):
- Changed GTK_INCLUDEDIR to EXTRA_GNOME_CFLAGS.
-
-2001-04-20 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-smime-context.c (smime_sign): Implemented using the
- secmime.h convenience functions.
- (smime_clearsign): We just error our here, there is no clearsign
- for smime.
- (smime_verify): Copied code over from the pkcs7 verify - same
- state, ugly and unknown :-)
- (smime_encrypt): Implemented using the secmime.h convenience
- functions.
- (smime_decrypt): Same as the code in pkcs7-context.
-
-2001-04-19 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-pkcs7-context.c (pkcs7_sign): Implemented.
- (pkcs7_clearsign): Implemented.
- (get_zero_len_passwd): Convenience function to try a 0-length key
- on the certificate db - if this works then there is no need to
- prompt the user.
- (get_password): Callback to get the password.
- (camel_cipher_hash_to_nss): Convenience function to convert a
- CamelCipherHash to an NSS HASH_HashType.
- (nss_hash_to_sec_oid): Converts a HASH_HashType to a SecOidTag.
- (pkcs7_digest): Digest function for use with pkcs7_sign().
- (sign_encode_cb): Callback to write the signed data to the output
- stream.
- (pkcs7_verify): Hacked on a bit more but am still a bit on the
- confused side. This might work but I wouldn't hold my breath. The
- sign/clearsign should be close if not correct, but this one...god
- only knows.
- (pkcs7_decrypt): Implemented.
- (pkcs7_encrypt): Implemented (mostly, still need to handle when
- 'sign' is TRUE).
-
-2001-04-18 Dan Winship <danw@ximian.com>
-
- * providers/imap/camel-imap-store.c (camel_imap_store_finalize):
- Free base_url and storage_path.
-
- * providers/pop3/camel-pop3-store.c (finalize): Free the
- implementation string.
- (camel_pop3_command): Clarify documentation to mention that
- @ex isn't set (and *@ret is) on CAMEL_POP3_ERR.
- (connect_to_server): Set @ex properly on CAMEL_POP3_ERR.
-
- * providers/pop3/camel-pop3-folder.c (pop3_refresh_info,
- pop3_get_message): Set @ex properly on CAMEL_POP3_ERR.
-
-2001-04-17 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-pkcs7-context.[c,h]: New source files to handle Pkcs7
- encryption, decryption, signing, and verifying. Not yet
- complete. I'm sensing this is going to take a while seeing as how
- NSS is just so well documented.
-
-2001-04-17 Dan Winship <danw@ximian.com>
-
- * camel-filter-driver.c (camel_filter_driver_filter_message): Fix
- a memory leak in the error case.
-
-2001-04-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/local/camel-mbox-summary.c (summary_rebuild): Don't we
- want to tell where we are by using the start of the message? I
- think this should be using camel_mime_parser_tell_start_from()
- instead. Also divide by the size *before* multiplying by 100 so
- that we don't overflow the int which was giving us negative values
- for our progress status (oops).
-
-2001-04-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-operation.c: Added a prototype for stamp().
-
- * camel-charset-map.c (camel_charset_locale_name): #include
- string.h so we don't get a warning about strchr being undefined
- and also init charset to NULL.
-
- * camel-pgp-context.c (pgp_verify): Go back to doing the utf8
- conversion by hand so that we don't depend on gal.
-
- * Makefile.am: Remove the EXTRA_GNOME_CFLAGS include.
-
- * camel-store.c (camel_mkdir_hier): Convenience function that it
- seems a number of camel-store implementations used gal for.
-
- * providers/nntp/camel-nntp-store.c (ensure_news_dir_exists): Lets
- not depend on gal for just e_mkdir_hier() - use camel_mkdir_hier()
- instead.
-
- * providers/nntp/camel-imap-store.c: Lets not depend on gal for
- just e_mkdir_hier() - use camel_mkdir_hier() instead.
-
- * camel-session.c (camel_session_get_storage_path): Don't depend
- on e_mkdir_heir() anymore, use the CamelStore version.
-
- * camel-folder-search.h: Removed gal dependency, why was this even
- there in the first place?
-
- * providers/imap/camel-imap-folder.c: Don't need gal/util/e-util.h
- here, so remove it.
-
- * string-utils.c (strstrcase): New function, well more like old
- function brought back to life so we don't have to depend on gal.
-
- * providers/imap/camel-imap-store.c (imap_store_setup_online): Use
- strstrcase rather than e_strstrcase so we don't depend on gal.
- (get_unread_online): Same here.
-
- * providers/smtp/camel-smtp-transport.c (smtp_helo): Use
- strstrcase.
-
-2001-04-15 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-utils.c (header_raw_check_mailing_list): regex
- doesn't set errno and regcomp returns 0 on success and any other
- value for an error (so don't *just* check for -1).
-
-2001-04-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-cipher-context.c: Check to make sure the context is a
- valid context in all the user functions.
-
-2001-04-13 Jon Trowbridge <trow@ximian.com>
-
- * providers/imap/camel-imap-store.c (imap_disconnect):
- s/imap_store/store/, fixing a typo that was causing the build to
- fail.
-
- * camel-filter-search.c (get_source): Make the (previously unused)
- get-source command actually do the right thing, properly shrouding
- any passed-in source and falling back to use the source attached
- to the mime message.
-
-2001-04-13 Dan Winship <danw@ximian.com>
-
- * camel-object.c (camel_object_hook_event):
- * camel-uid-cache.c (camel_uid_cache_get_new_uids):
- * camel-url.c (camel_url_new_with_base): Plug leaks.
-
- * camel-remote-store.c (camel_remote_store_init): Don't
- re-initialize the folders hash table.
-
- * providers/imap/camel-imap-store.c (imap_disconnect): Free
- authtypes since they'll be re-read on re-connect.
- (get_folder_info): Free folderinfos that we're discarding from the
- list.
-
-2001-04-12 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-pgp-context.c (camel_pgp_context_get_type): Oops, lets not
- get into a recursive call here ;-)
-
- * tests/smime/pgp.c: Updated to reflect changes to the PGP code.
-
- * tests/smime/pgp-mime.c: Same.
-
-2001-04-12 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-pgp-mime.c: Updated to reflect the few changes made to the
- CamelPgpContext class.
-
- * camel-pgp-context.c: Updated to subclass of CamelCipherContext.
-
- * camel-cipher-context.[c,h]: New base class for
- CamelPgpContext. Also contains the replacement for
- CamelPgpValidity, CamelCipherValidity.
-
-2001-04-12 Dan Winship <danw@ximian.com>
-
- * camel-mime-filter-crlf.c (filter): Fix a pair of array bounds
- reads noted by purify
-
-2001-04-12 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel.h: #include the pgp stuff.
-
-2001-04-12 Dan Winship <danw@ximian.com>
-
- * providers/imap/camel-imap-message-cache.c
- (camel_imap_message_cache_remove):
- * camel-url.c (camel_url_to_string): Plug memory leaks.
-
-2001-04-11 Dan Winship <danw@ximian.com>
-
- * providers/imap/camel-imap-utils.c (imap_parse_string_generic):
- Simplify peterw's imap_is_atom_char fix.
-
-2001-04-11 Jeffrey Stedfast <fejj@ximian.com>
-
- * tests/smime/Makefile.am: Added pgp-mime.c to the tests.
-
- * tests/smime/pgp-mime.c: Test suite for camel-pgp-mime.c functions.
-
- * Makefile.am: Add camel-pgp-mime.[c,h] to the build.
-
- * camel-pgp-mime.c: Made a number of fixes to get it to compile
- and also fixed a few logic errors (mostly forgetting to reset
- streams) so that it worked (thanks to the pgp-mime test program).
-
-2001-04-11 JP Rosevear <jpr@ximian.com>
-
- * providers/imap/Makefile.am: user GNOME_INCLUDEDIR since gnome
- files are included in the top level camel headers and the gtk
- include dir is now versioned and such
-
- * providers/local/Makefile.am: ditto
-
- * providers/pop3/Makefile.am: ditto
-
- * providers/smtp/Makefile.am: ditto
-
- * providers/sendmail/Makefile.am: ditto
-
- * camel-service.c: use five arg version of gethostbyname_r if
- appropriate
- (camel_get_host_byname): check if msg->herr is non-zero instead of
- checking if msg->hp is null since we may not always have msg->hp
-
-2001-04-11 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-sasl-digest-md5.c (digest_response): Use
- camel_charset_locale_name() to get the locale charset rather than
- checking the CHARSET environment variable. This is a much less
- ugly hack. Also: If we fail to be able to convert to UTF8, then
- disavow all knowledge of the charset parameter.
-
- * camel-charset-map.c (camel_charset_locale_name): New function to
- return the locale charset (or NULL if US-ASCII).
-
-2001-04-11 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-pgp-context.c (camel_pgp_verify): Use
- e_utf8_from_locale_string() rather than trying to do it manually
- since Lauris's version works much better.
-
-2001-04-06 Jeffrey Stedfast <fejj@ximian.com>
-
- * Makefile.am: Added camel-pgp-context.[c,h] to the build. Also
- added tests/smime/pgp.c and Makefile.am
-
- * tests/smime/pgp.c: New test suite for PGP functions.
-
- * camel-pgp-context.c: Various fixes to get it to build.
-
-2001-04-07 Peter Williams <peterw@ximian.com>
-
- * providers/imap/camel-imap-utils.c (imap_parse_string_generic): It
- would be a good idea to recognize '\0'. Before, this code was running
- off the ends of strings and intermittently coredumping (if it didn't
- hit an imap_atom_char first) -- whoops!
-
-2001-04-05 Not Zed <NotZed@Ximian.com>
-
- * merge from evolution-0-10-branch to evolution-0-10-merge-0
-
-2001-04-03 Jeffrey Stedfast <fejj@ximian.com>
-
- * Makefile.am: Added tests/ back in
-
- * camel-mime-utils.c (header_decode_text): Ignore whitespace
- between encoded words (there were a few cases where it didn't
- before).
- (header_encode_string): Preserve whitespace between words that are
- to be encoded by encoding them too.
- (header_encode_phrase): Same here but with phrases.
-
-2001-04-03 Dan Winship <danw@ximian.com>
-
- * providers/imap/camel-imap-folder.c (imap_sync): If we don't
- change any flags or expunge, send a NOOP to give the server a
- chance to send EXISTS, etc, messages.
- (imap_get_message): If the server_level < IMAP4rev1, always fetch
- messages all-at-once, since they don't support the [#.MIME]
- syntax.
- (imap_update_summary): When reading message flags, set the
- server_flags field as well, and don't overwrite any flags set by
- camel_folder_summary_info_new_from_message. Might help with some
- of the flag problems...
-
-2001-04-02 Dan Winship <danw@ximian.com>
-
- * camel-service.h: Remove the "quick_login" member, which is
- unnecessary.
-
- * providers/smtp/camel-smtp-transport.c (smtp_auth): Remove the
- references to quick_login and fix this to use the CamelSasl
- interfaces correctly to do the same thing.
- (connect_to_server): Split this out of smtp_connect
- (smtp_connect): Use connect_to_server. When re-EHLO'ing after
- auth, ignore errors.
- (query_auth_types): Use connect_to_server rather than
- smtp_connect, so it doesn't try to authenticate. Add LOGIN
- authtype to the list of authtypes to check for.
-
- * providers/smtp/camel-smtp-provider.c
- (camel_provider_module_init): Add LOGIN authtype to the authtypes
- list explicitly.
-
- * camel-sasl.c (camel_sasl_authtype_list): Don't list LOGIN here:
- it's not a real SASL authtype and is only used for SMTP.
-
- * camel-sasl-plain.c:
- * camel-sasl-login.c:
- * camel-sasl-kerberos4.c:
- * camel-sasl-cram-md5.c:
- * camel-sasl-anonymous.c:
- * providers/pop3/camel-pop3-provider.c: Remove "quick_login"
- argument from authtypes.
-
-2001-04-02 Gediminas Paulauskas <menesis@delfi.lt>
-
- * camel-filter-driver.c: marked missing report status' for translation.
-
-2001-04-02 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-pgp-context.c (camel_pgp_sign): mutex lock & unlock the
- context.
- (camel_pgp_clearsign): Same.
- (camel_pgp_verify): Same.
- (camel_pgp_encrypt): Same.
- (camel_pgp_decrypt): And finally here...
-
- * camel-pgp-context.h: Update the function prototypes to match
- those found in camel-pgp-context.c.
-
- * camel-pgp-context.c: Updated.
-
- * camel-pgp-mime.c (camel_pgp_mime_part_sign): Implemented.
- (camel_pgp_mime_part_verify): Implemented.
- (camel_pgp_mime_part_encrypt): Implemented.
- (camel_pgp_mime_part_decrypt): Implemented.
-
-2001-04-01 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-sasl-login.[c,h]: New files to handle the LOGIN SASL
- mechanism.
-
- * camel-sasl-plain.c: Removed the definition of
- camel_sasl_login_authtype.
-
- * camel-sasl.c (camel_sasl_new): Oops. I thought LOGIN was an
- alias to PLAIN. I was wrong. These two SASL objects have to be
- separate.
-
- * providers/smtp/camel-smtp-transport.c (smtp_auth): Updated to
- check for and use authmech->quick_login when available.
-
-2001-04-01 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/pop3/camel-pop3-provider.c: Updated the authtypes here
- too.
-
- * camel-sasl-plain.c:
- * camel-sasl-anonymous.c:
- * camel-sasl-digest-md5.c:
- * camel-sasl-cram-md5.c:
- * camel-sasl-kerberos4.c: Updated the authtype values.
-
- * camel-service.h: Added another field to CamelServiceAuthType
- that specifies whether or not the mechanism supports "quick auth"
- which means that the client can send the initial challenge in the
- AUTH request.
-
- * camel-sasl.c (camel_sasl_new): Add support for LOGIN.
- (camel_sasl_authtype_list): Here too.
- (camel_sasl_authtype): And finally here.
-
- * camel-sasl-plain.c: Define camel_sasl_login_authtype.
-
- * providers/smtp/camel-smtp-transport.c (smtp_auth): Only unref
- the SASL object if it exists.
-
-2001-03-30 Dan Winship <danw@ximian.com>
-
- * providers/pop3/camel-pop3-store.c (connect_to_server,
- query_auth_types, pop3_connect): Move things around here to make
- this all work right again (so you don't get prompted for a
- password when checking the supported authtypes.)
-
-2001-03-30 Jon Trowbridge <trow@ximian.com>
-
- * camel-mime-message.c (camel_mime_message_set_source): Shrould
- our source URL before putting it into X-Evolution-Source.
-
-2001-03-29 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-store.c (get_folder_info): Don't
- blindly append "/INBOX", construct a CamelURL and set the path
- that way.
- (parse_list_response_as_folder_info): Don't blindly append
- "/<foldername>", construct a CamelURL and set the path that way
- instead.
- (get_folders_offline): And again here.
-
-2001-03-30 Not Zed <NotZed@Ximian.com>
-
- * camel-service.c (camel_get_host_byname): Dont overwrite an
- exception if we got one already. Added camel_operation status to
- it, and comment out some debug.
-
-2001-03-29 Not Zed <NotZed@Ximian.com>
-
- * providers/smtp/camel-smtp-transport.c (smtp_connect): Free host
- name info when done ... blah blah.
-
- * camel-sasl-kerberos4.c (krb4_challenge): Free host name info
- after we're done with it.
-
- * camel-sasl-digest-md5.c (digest_md5_challenge): Free host name
- info after we're done with it.
-
- * camel-remote-store.c (remote_connect): Free the host name info
- from get_host after we're finished with it.
-
- * camel-service.c (camel_get_host_byname): New function to
- lookup a name, and still be cancellable.
- (camel_free_host): And a function to free the structure
- returned.
- (camel_service_gethost): Call get_host_byname for this.
-
-2001-03-29 Jon Trowbridge <trow@ximian.com>
-
- * camel-filter-driver.c (camel_filter_driver_filter_message): Save
- the source URL using camel_mime_message_set_source.
-
- * camel-mime-message.c (camel_mime_message_set_source): Renamed
- camel_mime_message_set_identity to this. Sets the X-Evolution-Source
- header.
- (camel_mime_message_get_source): Returns the X-Evolution-Source
- header.
-
-2001-03-29 Kjartan Maraas <kmaraas@gnome.org>
-
- * broken-date-parser.c: #include <stdio.h>, <stdlib.h> and <string.h>
- * broken-date-parser.h: Remove all includes but <glib.h>
- * camel-address.h: Added #include <glib.h>
- * camel-data-wrapper.c: Move system includes to the top.
- * camel-data-wrapper.h: #include <glib.h>
- * camel-exception.c: #ifdef HAVE_CONFIG_H
- * camel-exception.h: Remove #include <glib.h>
- * camel-filter-driver.c: #ifdef HAVE_CONFIG_H and move system
- headers to top. Mark strings in camel_exception_set*() for i18n.
- * camel-filter-driver.h: #include <glib.h>
- * camel-filter-search.c: #ifdef HAVE_CONFIG_H
- * camel-folder-search.c: #include <config.h>
- * camel-folder-search.h: Header shuffling
- * camel-folder-summary.h: Same here
- * camel-folder-thread.c: #ifdef HAVE_CONFIG_H
- * camel-folder.c: Here too.
- * camel-folder.h: #include <glib.h>
- * camel-internet-address.c: Move system headers up
- * camel-lock.c: #ifdef HAVE_CONFIG_H
- * camel-medium.c: Same here
- * camel-mime-filter-bestenc.c: Move system headers up
- * camel-mime-filter-from.c: Same here
- * camel-mime-filter-linewrap.c: And here
- * camel-mime-filter.c: #include <string.h> to fix warnings from new gcc
- * camel-mime-filter.h: System headers moved up
- * camel-mime-message.c: Here too. #ifdef HAVE_CONFIG_H added
- * camel-mime-part-utils.c: #ifdef HAVE_CONFIG_H added
- * camel-mime-part.c: Here too, and shuffle headers
- * camel-mime-utils.c: #ifdef HAVE_CONFIG_H. Remove const from two
- variables to remove warning.
- * camel-mime-utils.h: Shuffle headers
- * camel-movemail.c: #ifdef HAVE_CONFIG_H. Mark string in camel_exception_set
- * camel-multipart.c: #ifdef HAVE_CONFIG_H. Added includes to remove
- warnings from new gcc
- * camel-object.c: #ifdef HAVE_CONFIG_H
- * camel-object.h: Shuffle headers
- * camel-operation.c: #ifdef HAVE_CONFIG_H
- * camel-provider.c: #ifdef HAVE_CONFIG_H. Shuffle headers. Mark a string
- * camel-remote-store.c: #ifdef HAVE_CONFIG_H
- * camel-sasl-anonymous.c: #ifdef HAVE_CONFIG_H. #include <string.h>
- * camel-sasl-cram-md5.c: #ifdef HAVE_CONFIG_H. #include <string.h> and
- <stdio.h> to remove warnings.
- * camel-sasl-digest-md5.c: #ifdef HAVE_CONFIG_H. shuffle headers
- * camel-sasl-digest-md5.h: Shuffle headers.
- * camel-sasl-kerberos4.c: #ifdef HAVE_CONFIG_H. Shuffle headers.
- * camel-sasl-kerberos4.h: Shuffle headers.
- * camel-sasl-plain.c: #ifdef HAVE_CONFIG_H. Shuffle
- * camel-sasl.c: #ifdef HAVE_CONFIG_H. #include <string.h>
- * camel-search-private.c: #include <config.h>
- * camel-seekable-stream.c: #ifdef HAVE_CONFIG_H
- * camel-seekable-stream.h: Shuffle
- * camel-seekable-substream.c: #ifdef HAVE_CONFIG_H
- * camel-service.c: Same
- * camel-service.h: Shuffle
- * camel-session.c: #ifdef HAVE_CONFIG_H
- * camel-store.c: Same
- * camel-stream-buffer.c: Here too
- * camel-stream-buffer.h: Shuffle
- * camel-stream-filter.c: #include <string.h>
- * camel-stream-fs.c: #ifdef HAVE_CONFIG_H
- * camel-stream-fs.h: Shuffle headers
- * camel-stream-mem.c: Same as above
- * camel-stream-mem.h: Here too
- * camel-stream-null.c: #ifdef HAVE_CONFIG_H
- * camel-stream.c: Here too
- * camel-stream.h: Shuffle
- * camel-tcp-stream-openssl.c: #ifdef HAVE_CONFIG_H
- * camel-tcp-stream-raw.c: Same here. and move local includes down
- * camel-tcp-stream-ssl.c: Same as above
- * camel-tcp-stream.c: #ifdef HAVE_CONFIG_H
- * camel-tcp-stream.h: move local include down
- * camel-transport.c: #ifdef HAVE_CONFIG_H
- * camel-transport.h: #include <glib.h>
- * camel-uid-cache.c: #ifdef HAVE_CONFIG_H. Shuffle headers
- * camel-uid-cache.h: Shuffle
- * camel-url.c: #ifdef HAVE_CONFIG_H
- * camel-vee-folder.c: #ifdef HAVE_CONFIG_H. Shuffle headers
- * camel-vee-folder.h: #include <glib.h>
- * camel-vee-store.h: Same here
- * camel.c: #ifdef HAVE_CONFIG_H
- * gstring-util.c: Here too
- * hash-table-utils.c: Remove #include <glib.h>
- * hash-table-utils.h: #include it here instead.
- * string-utils.c: #ifdef HAVE_CONFIG_H
- * providers/cache/camel-cache-map.c: #ifdef HAVE_CONFIG_H, shuffle
- headers and mark strings in camel_exception_set*()
- * providers/cache/camel-cache-provider.c: #ifdef HAVE_CONFIG_H
- * providers/cache/camel-cache-store.c: Same here, and mark a string.
- * providers/imap/camel-imap-command.c: #ifdef HAVE_CONFIG_H
- * providers/imap/camel-imap-command.h: Shuffle header
- * providers/imap/camel-imap-folder.c: #ifdef HAVE_CONFIG_H
- * providers/imap/camel-imap-message-cache.c: #ifdef HAVE_CONFIG_H
- * providers/imap/camel-imap-provider.c: #ifdef HAVE_CONFIG_H and
- #include <string.h>
- * providers/imap/camel-imap-search.c: #ifdef HAVE_CONFIG_H
- * providers/imap/camel-imap-store.c: #ifdef HAVE_CONFIG_H and mark
- a string.
- * providers/imap/camel-imap-summary.c: Shuffle headers
- * providers/imap/camel-imap-wrapper.c: #ifdef HAVE_CONFIG_H. Shuffle
- * providers/local/camel-local-folder.c: #ifdef HAVE_CONFIG_H
- * providers/local/camel-local-provider.c: #ifdef HAVE_CONFIG_H
- * providers/local/camel-local-store.c: Same here
- * providers/local/camel-local-summary.c: Here too, shuffle, mark a string
- * providers/local/camel-maildir-folder.c: #ifdef HAVE_CONFIG_H
- * providers/local/camel-maildir-store.c: Same
- * providers/local/camel-maildir-summary.c: Here too
- * providers/local/camel-mbox-summary.c: And here
- * providers/local/camel-mbox-store.c: And here
- * providers/local/camel-mbox-summary.c: #include <config.h>
- * providers/local/camel-mh-folder.c: #ifdef HAVE_CONFIG_H
- * providers/local/camel-mh-store.c: same
- * providers/local/camel-mh-summary.c: #ifdef HAVE_CONFIG_H, shuffle headers
- and mark a string for translation.
- * providers/nntp/camel-nntp-auth.c: #include <config.h>
- * providers/nntp/camel-nntp-store.c: Remove superfluous arg to
- CAMEL_SERVICE_CLASS to make it compile
- * providers/pop3/camel-pop3-provider.c: #ifdef HAVE_CONFIG_H
- * providers/pop3/camel-pop3-store.c: Same here
- * providers/sendmail/camel-sendmail-provider.c: Here too
- * providers/sendmail/camel-sendmail-transport.c: Here too
- * providers/smtp/camel-smtp-provider.c: Same
- * providers/smtp/camel-smtp-transport.c: #ifdef HAVE_CONFIG_H, mark
- strings for translations.
-
-2001-03-29 Dan Winship <danw@ximian.com>
-
- * camel-url.c (camel_url_to_string): change "gboolean show_passwd"
- to "guint32 flags".
-
- * tests/misc/url.c (main): Update calls to camel_url_to_string
-
- * providers/imap/camel-imap-store.c (construct): Call
- camel_url_to_string with flags to hide password, authtype, and
- params to create the base_url.
- (etc): Update for the fact that the base_url no longer has the "/"
- at the end.
-
- * camel-service.c (construct): Update calls to camel_url_to_string
- (pass CAMEL_URL_HIDE_PASSWORD)
-
-2001-04-03 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-utils.c (header_decode_text): Ignore whitespace
- between encoded words (there were a few cases where it didn't
- before).
- (header_encode_string): Preserve whitespace between words that are
- to be encoded by encoding them too.
- (header_encode_phrase): Same here but with phrases.
-
-2001-04-04 Kjartan Maraas <kmaraas@gnome.org>
-
- * camel-filter-driver.c: Added #include <config.h>. Marked
- a bunch of strings for translation.
- * camel-folder-search.c: Added #include <config.h>.
- * camel-folder-summary.c: Same here.
- * camel-movemail.c: Marked strings for translation.
- * camel-provider.c: Same here.
- * camel-search-private.c: #include <config.h>
- * camel-vee-folder.c: Mark string for translation.
- * providers/local/camel-mbox-summary.c: #include <config.h>
-
-2001-04-03 Dan Winship <danw@ximian.com>
-
- * providers/imap/camel-imap-folder.c (imap_sync): If we don't
- change any flags or expunge, send a NOOP to give the server a
- chance to send EXISTS, etc, messages.
- (imap_get_message): If the server_level < IMAP4rev1, always fetch
- messages all-at-once, since they don't support the [#.MIME]
- syntax.
-
-2001-04-01 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-store.c (get_folder_info): Don't
- blindly append "/INBOX", construct a CamelURL and set the path
- that way.
- (parse_list_response_as_folder_info): Don't blindly append
- "/<foldername>", construct a CamelURL and set the path that way
- instead.
- (get_folders_offline): And again here.
-
-2001-03-31 Not Zed <NotZed@Ximian.com>
-
- * camel-operation.c (struct _status_stack): change stamp to
- unsigned to avoid overflow.
- (camel_operation_end):
- (camel_operation_progress_count):
- (camel_operation_progress): Double the delay before transient
- events start showing their own progress.
-
-2001-03-30 Not Zed <NotZed@Ximian.com>
-
- * providers/pop3/camel-pop3-folder.c (pop3_get_message): Change
- the pop download into a transient event.
-
- * camel-operation.c (stamp): Get a timestamp that changes 4x a
- second (or rather, arbitrarily more often than 1/second).
- (camel_operation_progress): Use stamp() for time updates.
- (camel_operation_progress_count): "
- (camel_operation_start): Store the status as a struct status_stack
- item.
- (camel_operation_start_transient): New function to start a
- transient event, which is only reported if it runs for too
- long/and is reset afterwards.
- (camel_operation_progress):
- (camel_operation_progress_count): Fix for status_stack changes,
- and account for transient updates.
-
- * camel-filter-driver.c (camel_filter_driver_filter_folder): When
- we remove things (set deleted), always set seen too, to mirror
- interface behaviour when you delete.
- (camel_filter_driver_filter_message): And same here too.
-
-2001-03-30 Dan Winship <danw@ximian.com>
-
- * providers/pop3/camel-pop3-store.c (connect_to_server,
- query_auth_types, pop3_connect): Move things around here to make
- this all work right again (so you don't get prompted for a
- password when checking the supported authtypes.)
-
-2001-03-29 Dan Winship <danw@ximian.com>
-
- * camel-url.c (camel_url_to_string): change "gboolean show_passwd"
- to "guint32 flags".
-
- * tests/misc/url.c (main): Update calls to camel_url_to_string
-
- * providers/imap/camel-imap-store.c (construct): Call
- camel_url_to_string with flags to hide password, authtype, and
- params to create the base_url.
- (etc): Update for the fact that the base_url no longer has the "/"
- at the end.
-
- * camel-service.c (construct): Update calls to camel_url_to_string
- (pass CAMEL_URL_HIDE_PASSWORD)
-
-2001-03-28 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-pgp-context.[c,h]: New class for PGP encrypting,
- decrypting, signing and verifying. Next I'll be moving the
- contents of mail/mail-crypto into Camel. These files will
- basically replace mail/openpgp-utils.[c,h].
-
-2001-03-29 Not Zed <NotZed@Ximian.com>
-
- * camel-folder-search.c (search_body_contains): Optimise the match
- "" case, just match everything in the folder (if we have it).
-
- * camel-vtrash-folder.c (vtrash_move_messages_to): Access the
- folder directly from the message info.
- (vtrash_move_messages_to): I think we also need to call the real
- move_messages_to, and not try and bypass the lock, since we dont
- have the lock for that folder.
-
- * camel-vee-folder.h: Move CamelVeeMessageInfo to public, so
- subclasses can get to it.
-
- * camel-vee-folder.c (camel_vee_folder_add_folder): Dont let you
- add a vfolder to itself.
- (folder_changed):
- (vee_folder_remove_folder):
- (vee_folder_build_folder): Copy changes before triggering changed
- events, so we can do them outside of locks.
- (camel_vee_folder_get_message_folder): Removed function.
- (camel_vee_folder_hash_folder): Made public (renamed from
- hash_folder), simply for subclasses (probably not needed).
- (vee_expunge): Oops, call the class sync, not superclass sync.
- (vee_sync): Remove some accidental debug.
-
-2001-03-27 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-service.c (get_path): Add the port (if user defined) to
- the path to fix bug #1996.
-
- Danw: I'm iffy on the "fix" so I'd like you to comment.
-
-2001-03-27 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/pop3/camel-pop3-folder.c (pop3_sync): If we aren't
- going to even check the resp/free buffer that gets returned from
- camel_pop3_command, don't even bother using it. Send in NULL
- instead.
- (pop3_get_message): Check to make sure that the `result' string is
- non-NULL. It's possible that some POP servers may return with
- "+OK\r\n<message>..." rather than the expected
- "+OK ### octets\r\n<message>..."
-
-2001-03-27 Not Zed <NotZed@Ximian.com>
-
- * camel-folder-summary.c (camel_folder_summary_finalize): Unref
- the html filter when done.
- (summary_build_content_info): Disable using the html parser to
- help index html mails until it gets sorted out.
-
- * camel-vee-folder.c (folder_changed): Fix a cut n paste bug, we
- want uid_removed not uid_changed deref, fixes bug #1999.
-
-2001-03-27 Dan Winship <danw@ximian.com>
-
- * camel-sasl.c (camel_sasl_authtype_list): add an argument to say
- whether or not you want "PLAIN" in the list (so you don't end up
- with "Password" twice in the config dialog).
-
- * providers/imap/camel-imap-provider.c (camel_provider_module_init):
- * providers/imap/camel-imap-store.c (query_auth_types): We don't
- want PLAIN.
-
- * providers/smtp/camel-smtp-provider.c (camel_provider_module_init):
- * providers/smtp/camel-smtp-transport.c (query_auth_types): But we
- do.
-
-2001-03-27 Dan Winship <danw@ximian.com>
-
- * camel-provider.h: Add an "extra_conf" field to CamelProvider
- with structures and defines and stuff, for providers to specify
- additional configuration options that they want. Also add a
- "supports ssl" flag to the provider flags.
-
- * camel-url.c (camel_url_new_with_base): Fix parsing of params.
- (output_param): And unparsing...
-
- * camel-remote-store.c: add a "default_ssl_port" field.
- (remote_construct): If the URL has the "use_ssl" parameter, set
- the store's use_ssl flag.
- (remote_connect): If using SSL and no port specified, use the
- default_ssl_port rather than the default_port.
-
- * providers/smtp/camel-smtp-provider.c (smtp_provider): add
- CAMEL_PROVIDER_SUPPORTS_SSL and CAMEL_URL_ALLOW_USER. (The config
- gui code knows that the ALLOW_USER and ALLOW_AUTH go together.)
- (ssmtp_provider): gone
-
- * providers/smtp/camel-smtp-transport.c (smtp_construct): Set a
- flag if "use_ssl" param is set.
- (smtp_connect): Check the CamelSmtpTransport use_ssl flag rather
- than checking if this is smtp or ssmtp.
-
- * providers/imap/camel-imap-provider.c (imap_conf_entries): Add a
- bunch of IMAP-specific configuration options, like "check for new
- mail in all folders" (default TRUE), "show only subscribed
- folders" (default TRUE), "ignore server-supplied namespace", and
- "apply filters to INBOX" (not yet implemented).
- (imap_provider): We support SSL and we no longer allow a path in
- the URL. (namespace is handled via extra_conf)
- (simap_provider): Gone
-
- * providers/imap/camel-imap-store.c (camel_imap_store_init): Set
- default_ssl_port, don't set CAMEL_STORE_SUBSCRIPTIONS here
- (construct): remove simap stuff, deal with "use_lsub",
- "namespace", "check_all", and "filter" parameters. Set base_url
- to not include params.
- (imap_store_setup_online): Don't ask for the namespace if it was
- set explicitly. Don't get subscribed folders if !use_lsub.
- (imap_concat): Fix a bug.
- (get_folder_info): Support for not checking all folders.
-
- * providers/imap/camel-imap-folder.c (imap_get_full_name): Rewrite
- to use imap_store->namespace, not service->url->path
-
- * providers/pop3/camel-pop3-provider.c (pop3_conf_entries): "keep
- on server" (currently still implemented by the mailer code, not
- here), "delete after N days" (not yet implemented).
- (pop3_provider): we support SSL
- (spop_provider): gone
-
- * providers/pop3/camel-pop3-store.c (camel_pop3_store_init): Set
- default_ssl_port
- (pop3_connect): Remove spop code
-
-2001-03-26 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-vee-folder.c (vee_folder_construct): Move all of the
- camel_vee_folder_construct() internals here.
- (camel_vee_folder_construct): This function basically becomes a
- wrapper for vee_folder_construct and also checks to make sure that
- the UNMATCHED vfodler is constructed otherwise constructs it.
- (camel_vee_folder_new): Call vee_folder_construct() instead so
- that we don't get into a dead-lock.
-
-2001-03-26 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-store.c (init_trash): Use camel_vtrash_folder_new() to
- create the vtrash folder now.
-
- * camel-vtrash-folder.[c,h]: New subclass of CamelVeeFolder for
- our vTrash folders.
-
- * camel-folder.c (camel_folder_copy_messages_to): Don't watch for
- vtrash folders anymore.
- (camel_folder_move_messages_to): Same.
-
- * camel-vee-folder.c (camel_vee_folder_class_init): Update.
- (vee_move_messages_to): Rewrite to use the new move API.
-
- * camel-filter-driver.c (do_copy): Updated to reflect
- copy_message_to changes. Create a temporary uid array and use
- that.
- (do_move): Same.
- (camel_filter_driver_filter_message): And again, here...
-
- * providers/imap/camel-imap-folder.c (imap_copy_messages_to):
- Update to the new API.
- (imap_move_messages_to): Same.
- (get_uid_set): New function to create a `set' string based on an
- array of UIDs for use with imap_copy_messages_to.
-
- * camel-folder.c (camel_folder_copy_messages_to): Replaces
- camel_folder_copy_message_to
- (camel_folder_move_message_to): Replaces
- camel_folder_move_message_to.
-
-2001-03-27 Not Zed <NotZed@Ximian.com>
-
- * camel-vee-store.c (vee_get_folder): Added folder_created event
- here.
-
- * camel-vee-folder.c (unmatched_finalise): Removed, moved into
- main finalise code.
- (message_changed): Just create a new change entry and promote it
- to a folder_changed thing.
- (vee_sync): Always rebuild folder on sync, even when not expunge.
- (folder_changed): If not autoupdating, make sure we remove any
- removed entries.
- (vee_folder_build_folder):
- (vee_folder_remove_folder): NOP if we're called on
- folder_unmatched.
- (vee_search_by_expression): Only search each folder once. Should
- we also order the result in summary order?
-
-2001-03-20 Not Zed <NotZed@Ximian.com>
-
- * camel-store.c (init_trash): Fix calling for vee_folder_new().
-
- * camel-folder-summary.c (camel_folder_summary_remove_index):
- Optimise slightly, use ptr_array_remove_index rather than have to
- search for the index by using summary_remove.
-
- * camel-vee-folder.h: Removed local member from VeeFolder, since
- it was never used.
-
- * camel-vee-store.c (camel_vee_store_finalise): Setup finalise
- function.
-
- * camel-vee-folder.c (camel_vee_folder_set_expression): New
- function to set the query of an existing vfolder.
- (camel_vee_folder_construct): New function for
- convenience/subclasses.
- (camel_vee_folder_new): Removed exception parameter, no longer
- needed (since we dont search yet).
- (camel_vee_folder_new): Changed to use folder_construct, and no
- longer raise the folder created signal.
- (vee_folder_build_folder): Make it return error on exception, so
- we can work without exceptions.
- (vee_folder_remove_folder): Use remove index rather than
- remove_uid, this is ok since we have the summary locked for our
- own access.
- (camel_vee_folder_add_folder): Only add the folder to the
- unmatched private if it is not a private folder.
- (camel_vee_folder_remove_folder): Only remove the folder from
- unmatched if it is not private.
- (vee_expunge): Just call sync with expunge set.
- (vee_sync): If expunging, also refresh the search.
- (vee_folder_build_folder): We do our own locking now, removed from
- callers, also trigger changed events here too (within locks),
- fixed callers appropriately.
- (vee_folder_remove_folder): Do our own locking, and trigger
- changed events.
- (vee_folder_add_info): Renamed of vee_folder_add, we now take a
- hash of the folder name, rather than use the folders address.
- (hash_folder): Convert a folder name into an 8 character hash.
- (vee_get_message, vee_search_by_expression, vee_set_message_flags,
- vee_set_message_user_flag, vee_move_message_to): Changed the uid
- to be an 8 byte hash + original uid, with no ':' anymore.
-
-2001-03-26 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-utils.c (header_decode_text): When writing the last
- token (if not rfc2047 encoded), don't use g_string_append_len, use
- append_latin1.
-
- * camel-mime-message.c (write_to_stream): Don't spew a warning if
- the message-id wasn't set by the application, not a big deal since
- we create one right here.
-
-2001-03-26 Dan Winship <danw@ximian.com>
-
- * providers/imap/camel-imap-command.c (camel_imap_command): keep a
- reference on the store's current_folder.
-
- * providers/imap/camel-imap-store.c (camel_imap_store_finalize):
- (imap_disconnect): unref the current_folder before clearing it.
-
- * camel-url.c (camel_url_get_param): Add missing accessor.
-
- * camel-session.c (camel_session_get_provider): New. Return
- the provider for a URL.
-
-2001-03-25 Dan Winship <danw@ximian.com>
-
- * camel-url.c (camel_url_new_with_base): New URL parser with full
- RFC1808 relative URL support. Yum.
- (camel_url_new): Wrapper around camel_url_new_with_base now.
-
- * tests/Makefile.am: add misc subdir
-
- * tests/misc/url.c: relative URL test cases from RFC 1808
-
-2001-03-25 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-filter-driver.c (do_copy): Don't use copy_to if the source
- folder doesn't support summary info's.
- (do_move): Same.
- (camel_filter_driver_filter_message): And again here. I think
- this will fix the problem of "colour" tags not staying with the
- message when it's copied to a folder during the filter process.
-
-2001-03-24 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-sasl-digest-md5.c (digest_response): Do charset conversion
- on the username param here if needed.
- (parse_server_challenge): Protect against possibly empty-string
- charset values.
-
-2001-03-23 Jon Trowbridge <trow@ximian.com>
-
- * camel-filter-driver.c (camel_filter_driver_filter_message):
- Don't call camel_mime_message_set_identity. (The call is
- commented out, left over from some earlier experimentation that I
- want to be able to remember later...)
-
- * camel-mime-message.c (camel_mime_message_set_identity): Added.
- A function to set the X-Evolution-Identity header.
-
-2001-03-22 Dan Winship <danw@ximian.com>
-
- * providers/imap/camel-imap-command.c (imap_read_response): Don't
- look at untagged responses other than "* BYE"...
- (camel_imap_response_free): ...do it here instead...
- (camel_imap_response_free_without_processing): ...but not here.
-
- * providers/imap/camel-imap-folder.c (camel_imap_folder_selected):
- Remove the "EXISTS" line from the response so
- camel_imap_response_free won't try to process it.
- (camel_imap_folder_selected): If we get an EXISTS response mixed
- in with the FETCH responses, record the new EXISTS value.
- Use camel_imap_response_free_without_processing so that an EXISTS
- response won't cause a loop.
- (imap_rescan): Use camel_imap_response_free_without_processing.
- (imap_update_summary): Use
- camel_imap_response_free_without_processing. If an EXISTS response
- shows up, call imap_update_summary again to get the new messages.
- (imap_protocol_get_summary_specifier): Use BODY.PEEK[0], not
- RFC822.HEADER for prev IMAP4rev1, since the FETCH parser won't
- deal with RFC822.HEADER responses.
-
- * providers/imap/camel-imap-store.c (get_folder_info): Fix an
- uninitialized variable
-
-2001-03-21 Dan Winship <danw@ximian.com>
-
- * camel-provider.h: (CamelProvider) add a "GList *authtypes", so
- you can get the list of authtypes used by a provider without
- needing to have an actual CamelService object handy. (Will be
- needed by the new config druid.)
- (CAMEL_PROVIDER_ALLOWS, CAMEL_PROVIDER_NEEDS): New macros to test
- the URL part stuff, since the way it works is too complicated and
- everyone always does it wrong.
-
- * camel-service.c (camel_service_query_auth_types): Remove the
- @connected arg again: if you don't want to connect, you can just
- get the list of authtypes off the provider.
- (camel_service_free_auth_types): Remove this. All existing
- implementations do authtypes the same way, so just say the caller
- should "g_list_free" the list. (Oh, look, removing this function
- doesn't actually cause the mailer to not build. How 'bout that.)
- (construct, get_path): Use the new URL part macros.
-
- * camel-remote-store.c (remote_query_auth_types): Update
- (remote_free_auth_types): Nuke
- (camel_remote_store_authtype_list): New function for use by
- subclasses.
-
- * providers/imap/camel-imap-provider.c:
- * providers/pop3/camel-pop3-provider.c:
- * providers/smtp/camel-smtp-provider.c: Update CamelProvider
- structures.
- (camel_provider_module_init): Put all the SSL parts together so
- there's only 1 #ifdef. Set up the provider authtypes field using
- the SASL, CamelRemoteStore, and standard authtypes, as
- appropriate. Copy that from the normal provider to the SSL
- provider.
-
- * providers/local/camel-local-provider.c:
- * providers/sendmail/camel-sendmail-provider.c:
- * camel-session.c: Update CamelProvider structures.
-
- * providers/imap/camel-imap-store.c (query_auth_types):
- * providers/pop3/camel-pop3-store.c (query_auth_types): Update
-
- * providers/smtp/camel-smtp-store.c (query_auth_types): Update.
- Remove the no_authtype, because that's what "ALLOW_AUTH" rather
- than "NEED_AUTH" means.
- (free_auth_types): Nuke.
-
-2001-03-21 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-filter-driver.c (camel_filter_driver_filter_message):
- Return -1 on fail.
- (camel_filter_driver_filter_folder): Same.
- (camel_filter_driver_filter_mbox): Same.
- (camel_filter_driver_filter_folder): Return -1 if an exception was
- set as well.
-
-2001-03-19 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-tcp-stream-openssl.c (camel_tcp_stream_openssl_finalize):
- Free the expected host.
- (camel_tcp_stream_openssl_new): Now takes a Service and an
- expected_host. Set them.
-
-2001-03-20 Dan Winship <danw@ximian.com>
-
- * providers/imap/camel-imap-store.c
- (camel_imap_store_check_online): Function to check if the store is
- online and set an exception if not. Currently controlled by an
- environment variable, but eventually there will be both a global
- (session-level) setting and a per-store setting.
- (construct): Set up storage_path and base_url here rather than at
- connect-time.
- (imap_auth_loop): Split out from imap_connect.
- (imap_setup_online): Split out from imap_connect. Do the
- post-authentication connection setup, and cache the results to
- disk.
- (imap_setup_offline): Set up a CamelImapStore with information
- saved from a previous imap_setup_online.
- (imap_connect): If online, do connect_to_server(),
- imap_auth_loop(), and imap_setup_online(). Otherwise, do
- imap_setup_offline().
- (get_folder, get_folder_info): Add offline support.
- (create_folder, subscribe_folder, unsubscribe_folder): Disable
- these when offline (for now).
-
- * providers/imap/camel-imap-folder.c (camel_imap_folder_new):
- Remove the sync'ing-with-server stuff... it's done by
- camel_imap_folder_selected now, which only gets called if the
- store is online.
- (camel_imap_folder_selected): add the code removed from
- camel_imap_folder_new. Besides simplifying the folder_new and
- summary_new code, this also means now that we'll DTRT if a
- folder's UIDVALIDITY changes while we're connected. Also, when
- that happens, clear the message cache explicitly.
- (imap_refresh_info, imap_sync): These are no-ops when offline.
- (imap_expunge, imap_append_message, imap_copy_message_to,
- imap_search_by_expression): These don't yet work offline.
- (imap_get_message, camel_imap_folder_fetch_data): Return an error
- when trying to fetch a non-cached body part when we're offline.
-
- * providers/imap/camel-imap-summary.c (camel_imap_summary_new):
- Rewrite to not check the validity here. (We'll do it from
- camel_imap_folder_selected instead.)
-
- * providers/imap/camel-imap-command.c (camel_imap_command): Call
- camel_imap_folder_selected even when the selection is all we're
- doing, to match the changes in camel-imap-folder.c.
-
- * providers/imap/camel-imap-message-cache.c
- (camel_imap_message_cache_clear): New function to clear out a
- message cache.
-
-2001-03-19 Christopher James Lahey <clahey@ximian.com>
-
- * Makefile.am (INCLUDES): Added $(EXTRA_GNOME_CFLAGS)
-
-2001-03-19 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/pop3/camel-pop3-store.c (pop3_connect): Set the errbuf
- to NULL after freeing it? I don't think this should fix bug #1801
- but I guess it can't hurt.
-
-2001-03-18 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-remote-store.c (remote_recv_line): Protect against a
- possibly NULL exception.
-
- * camel-filter-driver.c (camel_filter_driver_filter_message):
- Document and modify to return a boolean value denoting whether or
- not errors occured during processing.
- (camel_filter_driver_filter_mbox): Same as above and also modified
- to check return codes of filter_message rather than relying only
- on whether or not the exception was set (as it's possible to pass
- in NULL for the exception).
- (camel_filter_driver_filter_folder): Same as above.
-
- * camel-mime-utils.c (header_param_list_format_append): Quote the
- param value if it contains whitespace as well.
-
-2001-03-17 Jeffrey Stedfast <fejj@ximian.com>
-
- * Makefile.am: Don't include system include dir.
-
- * camel.c: Use quotes around the nss.h include so it doesn't try
- to use the systen nss.h file.
-
- * camel-tcp-stream-ssl.c: Same here.
-
-2001-03-17 Not Zed <NotZed@Ximian.com>
-
- * providers/local/camel-maildir-summary.c (maildir_summary_sync):
- Modified patch from Dan Berger <dberger@ix.netcom.com> to re-check
- the maildir directory for new/updated messages at sync time.
-
- * camel-folder.c (camel_folder_ref_message_info): Implemented.
- (ref_message_info): And default implementation.
-
- * camel-folder.h: Added ref_message_info virtual method.
-
-2001-03-16 Not Zed <NotZed@Ximian.com>
-
- * camel-folder-thread.c
- (camel_folder_thread_messages_new_summary): New function to create
- a thread tree from a supplied summary array.
- (camel_folder_thread_messages_destroy): Handle thread trees
- generated by the above function properly.
-
-2001-03-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-private.h: Same.
-
- * camel-remote-store.h: Fixed #include to use <>'s instead of ""'s
-
-2001-03-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-tcp-stream-ssl.c (ssl_bad_cert): Print info about the
- issuer of the certificate.
-
- * providers/smtp/camel-smtp-transport.c (smtp_connect): Use
- camel_tcp_stream_get_socket().
-
- * camel-tcp-stream-openssl.c (stream_get_socket): Implemented.
-
- * camel-tcp-stream-ssl.c (stream_get_socket): Implemented.
-
- * camel-tcp-stream-raw.c (stream_get_socket): Implemented.
-
- * camel-tcp-stream.c (camel_tcp_stream_get_socket): New function.
-
-2001-03-16 Kjartan Maraas <kmaraas@gnome.org>
-
- * providers/pop3/camel-pop3-folder.c: Added #include <config.h>
-
-2001-03-16 Dan Winship <danw@ximian.com>
-
- * camel-mime-utils.c (header_msgid_generate): Don't use
- getdomainname: it's NIS crap, not DNS.
-
-2001-03-15 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel.c (camel_init): Don't use the hardcoded cert db directory,
- use the one passed in.
-
- * camel-tcp-stream-ssl.c (ssl_get_client_auth): Wrote the default
- implementation. Not that we'll use this though, since this is the
- default implementation provided by NSS anyway. This more or less
- serves as a reference in case we want to change anything.
- (ssl_auth_cert): Same.
- (ssl_bad_cert): Changed the prompt string and free it when we're
- done.
-
-2001-03-15 Dan Winship <danw@ximian.com>
-
- First batch of disconnected IMAP-related stuff. This adds local
- caching of message parts, but NOT any actual disconnected support.
- (But it should speed up IMAP use.)
-
- * providers/imap/camel-imap-message-cache.c: New class for caching
- message data to disk, and removing it when it's no longer
- relevant. Will eventually also support merging message parts
- together to save on files. Or maybe using a db instead of files?
-
- * providers/imap/camel-imap-private.h: Add a cache_lock to
- CamelImapFolderPrivate. This lock must be recursive, so make both
- locks EMutexes rather than GMutex.
-
- * providers/imap/camel-imap-folder.c (parse_fetch_response): "The
- only FETCH response parser you need!" Replaces the various
- almost-correct bits of code formerly scattered throughout this
- file with a single fully-correct function that can handle any
- FETCH response at any time, so we don't get confused by seeing a
- flags update when we were only expecting a message body, etc.
- (camel_imap_folder_fetch_data): FETCH a message body part either
- from the cache or the server
- (camel_imap_folder_changed): Remove expunged messages from the
- message cache.
- (camel_imap_folder_new): Change to take a directory instead of a
- summary file name. Create a CamelImapMessageCache for the folder.
- (imap_finalize): Unref the message cache.
- (camel_imap_folder_selected, imap_rescan, get_content,
- get_message, imap_get_message, imap_update_summary): Redone a
- bunch to use parse_fetch_data, CamelImapMessageCache, etc.
-
- * providers/imap/camel-imap-store.c (get_folder): Pass directory
- name to camel_imap_folder_new, not summary filename. Use
- e_path_to_physical to generate a path with /subfolders/ inserted
- between directory components.
-
- * providers/imap/camel-imap-wrapper.c (camel_imap_wrapper_new):
- Call camel_imap_folder_fetch_data (with cache_only TRUE) and if
- the data is cached, return an online datawrapper rather than an
- offline one.
- (write_to_stream): Use camel_imap_folder_fetch_data (with
- cache_only FALSE) here too
-
- * providers/imap/camel-imap-utils.c (imap_skip_list): Renamed from
- skip_list and made non-static.
-
-2001-03-15 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-tcp-stream-ssl.h: Uninclude prnetdb.h since it's not
- needed here.
-
- * providers/smtp/camel-smtp-transport.c: #include prnetdb.h here
- instead of making camel-tcp-stream-ssl.h include it. Prevents some
- header bloat.
-
- * providers/smtp/Makefile.am: Include the NSPR_CFLAGS and
- NSS_CFLAGS.
-
-2001-03-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/smtp/camel-smtp-transport.c (smtp_connect): Update for
- using CamelTcpStreams and also for using SSL.
-
- * providers/smtp/libcamelsmtp.urls: defined "ssmtp"
-
- * providers/smtp/camel-smtp-provider.c: Defined the Secure SMTP
- provider.
- (camel_provider_module_init): Register the Secure SMTP provider.
-
-2001-03-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-store.c (imap_connect): Check for
- "simap" instead of "imaps".
-
- * providers/pop3/camel-pop3-store.c (pop3_connect): Change the
- port to be 995 for spop.
-
- * providers/pop3/libcamelpop3.urls: Change to "spop".
-
- * providers/imap/libcamelimap.urls: Change "imaps" to "simap" to
- correspond to /etc/services.
-
-2001-03-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/pop3/camel-pop3-store.c (pop3_connect): Check to see
- if we are using "pops" and then set the appropriate SSL settings.
-
- * providers/pop3/libcamelpop3.urls: Add "pops"
-
- * providers/pop3/camel-pop3-provider.c: Defined the pops provider.
- (camel_provider_module_init): Register the pops provider.
-
-2001-03-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-tcp-stream-ssl.c (camel_tcp_stream_ssl_new): Ya know what?
- Lets not ref the service because otherwise we'll start having the
- same problems we had back with vtrash. Besides, since the store
- owns the stream, it's not like the store is going anywhere without
- the stream anyway.
- (camel_tcp_stream_ssl_finalize): No need to unref the service.
-
-2001-03-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-remote-store.c (remote_connect): Pass the service into the
- SSL stream, not the session.
-
- * camel-tcp-stream-ssl.c (camel_tcp_stream_ssl_init): Set the
- service to NULL.
- (camel_tcp_stream_ssl_finalize): Unref the service.
- (camel_tcp_stream_ssl_new): Takes a CamelService arg now rather
- than a CamelSession arg.
-
-2001-03-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel.c (camel_init): So it turns out that NSS_Init *isn't*
- idempotent, so we have to protect against initializing it more
- than once(contrary to what their design specs suggest).
-
- * camel-session.c (camel_session_get_service): Use
- camel_exception_is_set() - Makes no difference but it's more
- consistant with how we normally do it.
-
- * camel-provider.h (CAMEL_URL_ALLOW_SSL): We don't need this.
-
- * providers/imap/camel-imap-provider.c: Define the imaps provider.
- (camel_provider_module_init): Register the imaps provider.
-
- * camel-provider.c (camel_provider_init): Only add the protocol to
- the hash table if it's non empty. Also, g_strdup() the filename
- into the hash table.
-
- * providers/imap/camel-imap-store.c (camel_imap_store_init): Eek!
- So the service's URL isn't set until after this is
- initialized. This means we can't check for SSL here.
- (imap_connect): Set the SSL options here instead.
-
-2001-03-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-tcp-stream-ssl.c: Numerous fixes to get it to build
- correctly with NSS enabled.
-
- * camel-remote-store.c (remote_connect): Pass in the session and
- expected host args, oops.
-
- * camel-provider.h (CAMEL_URL_ALLOW_SSL): Defined.
-
- * providers/imap/camel-imap-store.c (camel_imap_store_init): Check
- to see if we are supposed to use SSL and set the options
- accordingly.
- (imap_connect): Return FALSE here instead of NULL.
-
- * providers/imap/camel-imap-provider.c: Add CAMEL_URL_ALLOW_SSL.
-
- * providers/imap/libcamelimap.urls: Add "imaps" which is the
- protocol for Secure IMAP.
-
-2001-03-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-tcp-stream-openssl.[c,h]: Added
-
- * Makefile.am: Added camel-tcp-stream-openssl.[c,h] to the build.
-
- * camel-types.h: Added CamelTcpStreamSSL and CamelTcpStreamOpenSSL
-
-2001-03-14 Not Zed <NotZed@Ximian.com>
-
- * camel-mime-filter-charset.c (filter, complete): re-constify
- inbuf, to remove a warning.
-
- * camel-mime-parser.c (folder_scan_step): When we're out of data,
- run the filter_complete. For some reason the logic that was there
- was never being run, always try it now, i think it was to work
- around a buggy filter, rather than fix it the right way.
-
- * camel-folder-summary.c (summary_build_content_info): If indexing
- html parts, use the html filter to convert it to some indexable
- format.
- (summary_build_content_info): Reset the filters before adding them
- back to the stream, if they get re-used in a given instance
- (likely).
-
- * Makefile.am (libcamelinclude_HEADERS): Added
- camel-mime-filter-html.[ch].
- (INCLUDES): Added xml clags
-
-2001-03-05 Not Zed <NotZed@Ximian.com>
-
- * camel-folder-search.c (camel_folder_search_class_init): Setup a
- new function, "uid" which matches uids.
- (search_uid): Implement the "match uid" command.
-
-2001-03-13 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-utils.c: Check for a new type of mailing list header.
-
-2001-03-13 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-tcp-stream-raw.c (stream_read): Made cancellable.
- (stream_write): Same.
- (stream_connect): Removed checks for DIVINE_INTERVENTION as the
- code worked fine.
-
- * camel-tcp-stream-ssl.c (stream_write): get rid of 'w' as it
- wasn't really needed.
- (set_errno): New function to set errno based on the NSPR error
- code.
- (stream_read): If an error occured, call set_errno().
- (stream_write): Same.
-
-2001-03-13 Jeffrey Stedfast <fejj@ximian.com>
-
- * Makefile.am: Added camel-tcp-stream-ssl to the build.
-
- * camel-remote-store.h: Add a use_ssl member to the
- CamelRemoteStore object.
-
-2001-03-13 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-tcp-stream-ssl.c (camel_tcp_stream_ssl_get_type):
- Oops. Make this a subclass of CamelTcpStream, not CamelStream.
-
- * camel-types.h: Add the defs for CamelTcpStream and
- CamelTcpStreamRaw
-
- * Makefile.am: Add camel-tcp-stream and camel-tcp-stream-raw to
- the build.
-
- * camel-remote-store.c (remote_connect): Update to use
- CamelTcpStreams.
-
- * camel-tcp-stream-raw.c (stream_connect): Made cancellable by
- copying the currently used code in camel-remote-store.c.
- (stream_setsockopt): Oops, flags = fcntl (..., GET_FL);
- (camel_tcp_stream_raw_get_type): Oops. Make this a subclass of
- CamelTcpStream, not CamelStream.
-
-2001-03-13 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel.c (camel_init): Since all of the Mozilla libs (including
- NSPR and NSS) correctly handle reinitializations, we might as well
- init both NSPR and NSS in camel_init so we can be sure of that
- these libs have been initialized.
- (camel_shutdown): New function to call the NSS cleanup stuff.
-
-2001-03-13 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-folder.c (camel_folder_copy_message_to): Don't allow the
- user to copy a message to or from the vtrash folder. Set an
- exception if they try.
- (camel_folder_move_message_to): This one is a bit more
- complicated: 1) If the user tried to move a message from the
- vtrash into the original folder, just undelete the message. 2) If
- the user tries to move the message to the vtrash folder, then just
- mark the message as deleted. 3) If the user tries to move the
- message from the vTrash to a folder other than the original, use
- the original folder as the source. As another optimization, I've
- made it so that if the user tries to move a message to the same
- folder, just no-op.
- (move_message_to): Unset the deleted flag before moving (assuming
- it's there).
- (copy_message_to): Same.
-
- * camel-vee-folder.c (camel_vee_folder_get_message_folder): New
- convenience function to get the folder from which the message uid
- is derived from.
-
-2001-03-13 Dan Winship <danw@ximian.com>
-
- * providers/imap/camel-imap-store.c (imap_connect): When trying
- again after a failed password attempt, check if the connection got
- dropped (which Courier will do) and deal accordingly.
-
- * providers/sendmail/camel-sendmail-transport.c (sendmail_send_to,
- sendmail_send): More fixing for exim: It can't deal with "-tif",
- you need to say "-t -i -f".
-
-2001-03-12 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-store.c (init_trash): Rename the folder to "Trash" and
- i18nify it.
-
-2001-03-09 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-tcp-stream-ssl.h: Comment out everything unless HAVE_NSS
- is defined.
-
- * camel-tcp-stream-ssl.c (stream_read): Don't use errno, use
- nspr's error code stuff.
- (stream_write): Same.
-
-2001-03-09 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-session.c (camel_session_query_authenticator): Created a
- new mode (CAMEL_AUTHENTICATOR_ACCEPT) which is a Yes/No prompt to
- the user. This will be needed by the SSL/TLS code to come. Also
- changed the return value to a gpointer rather than a char* to
- allow the returning of TRUE/FALSE values.
-
- * camel.c: Wrap stuff with HAVE_NSS
-
-2001-03-09 Dan Winship <danw@ximian.com>
-
- * providers/sendmail/camel-sendmail-transport.c (sendmail_send,
- sendmail_send_to): Remove the "-U" for now, because it breaks
- exim's "sendmail" wrapper. (And it doesn't actually do all that
- much to sendmail's behavior, and it was working fine before
- anyway.)
-
- * camel-mime-utils.c (header_fold): Fix a bug that could make this
- walk off the end of a string. (The bug has been there since
- December... maybe this will fix some unreproduceable crashes?)
-
-2001-03-08 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-store.c (camel_store_get_folder): Changes so that the
- folder gets added to the vtrash reguardless of whether or not the
- store is holding it's own folder lookup hash.
- (init_trash): Oops, lets try locking the cache before we go and
- add all the cached folders to the vtrash.
-
-2001-03-08 Jeffrey Stedfast <fejj@ximian.com>
- These fixes make it so that the CamelStore does not actually hold
- a ref on it's vTrash folder. The vTrash folder is now created ONLY
- when it is requested. This solves the problem of not being able to
- unref a Store and have it disconnect/finalize like we expect it to.
-
- * camel-store.c (init_trash): When we create the vtrash, add all
- previously opened folders to it and hook on to the finalize event
- so that we can then set the store->vtrash to NULL.
- (get_trash): If a vtrash folder for the store doesn't exist,
- init_trash() and then try.
- (construct): No longer need this.
- (camel_store_class_init): Don't override the construct method.
- (camel_store_finalize): We no longer hold a ref on the vtrash so
- don't unref it.
-
-2001-03-07 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/pop3/camel-pop3-store.c (init_trash): Implement.
- (get_trash): Implement.
- (camel_pop3_store_class_init): Override the default init_trash and
- get_trash virtual functions. Hopefully this should fix the problem
- of pop3 sotre's not disconnecting after the send&recv code
- finishes downloading mail.
-
- Wonder if I should override the default implementation for the
- mbox, mh, and maildir too?
-
-2001-03-07 Dan Winship <danw@ximian.com>
-
- * camel-remote-store.c (camel_remote_store_connected): Return the
- return value of camel_service_connect rather than returning
- !camel_exception_is_set(), since that will be wrong if ex==NULL...
- Fixes a crash in the IMAP keepalive code, but this same problem
- probably exists in other places too...
- (remote_recv_line): Fix another problem...
-
- * providers/local/camel-mbox-provider.c:
- * providers/vee/.cvsignore:
- * providers/vee/libcamelvee.urls: Remove some unused stuff
-
-2001-03-06 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-sasl-digest-md5.c (compute_response): Redone so as to save
- on memory allocations and speed.
-
-2001-03-05 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-sasl-plain.c (plain_challenge): Don't return NULL if the
- token is non-NULL. This is why:
-
- sending : AUTH PLAIN
- received: 334 ok. go on. <-- this is why
- sending : ZGZPaQpAZ214Lm5ldBBnb29jYXI=
- received: 235 {mp005-rz3} go ahead
-
- * camel-sasl.c (camel_sasl_authtype): Add the PLAIN type here.
- (camel_sasl_authtype_list): And here too.
-
- * camel-sasl-plain.c: Initialize the camel_sasl_plain_authtype.
-
- * camel-sasl-plain.h: extern the camel_sasl_plain_authtype.
-
-2001-03-05 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-store.c (imap_connect): i18n'd some
- strings in here.
-
- * providers/smtp/camel-smtp-transport.c (smtp_connect): Keep
- trying to authenticate until either we succeed or until the user
- cancels.
-
-2001-03-04 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-utils.c: Wrote a new version of header_fold() that
- takes a 'force' option and uses another new function called
- header_fold_next_space() in place of strchr(inptr, ' ') to get the
- next whitespace char. The idea of header_fold_next_space() is to
- not treat spaces between a set of quotes as a space - this way it
- will be possible to fold (for example) the Content-Type MIME
- header without worrying about breaking up a boundary string.
- Note: This code is #if 0'd out until Zucchi approves of the patch.
- Another Note: We will probably still want to use the "don't fold
- this header" hash lookup for headers like the Message-Id and
- possibly a few others.
-
-2001-03-04 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-internet-address.c
- (camel_internet_address_encode_address): Make sure there is a
- space between the name and the address tokens.
-
- * camel-mime-utils.c (rfc2047_decode_word): encoded string
- segments need to be at least 8 chars (7 doesn't leave room for an
- ecoding value. To be more realistic, even 8 chars isn't enough as
- this assumes there is no charset nor any encoded text. If the
- encoding value is not 'Q' or 'B', then return NULL. This fixes bug
- #1689.
-
-2001-03-03 Not Zed <NotZed@Ximian.com>
-
- * camel-vee-folder.c (vee_folder_remove_folder): New function to
- remove a folder from a vfolder.
- (camel_vee_folder_remove_folder): New public function to remove a
- folder from a vfolder.
-
-2001-03-02 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/smtp/camel-smtp-provider.c: Doh! Set the
- CAMEL_URL_ALLOW_AUTH flag.
-
- * providers/smtp/camel-smtp-transport.c (get_smtp_error_string):
- Updated with the extended AUTH return codes.
-
-2001-03-02 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-store.c (try_auth): Don't forget to
- unref the SASL object.
-
- * providers/smtp/camel-smtp-transport.c (query_auth_types):
- Implemented.
- (smtp_auth): Implemented.
- (smtp_helo): Don't bother parsing the authtypes if we already have
- them.
- (smtp_connect): call smtp_auth() here if we found any authtypes.
- (smtp_disconnect): Updated as I now use a hash table for the
- supported authtypes rather than a linked list.
- (esmtp_get_authtypes): modify to use a hash table instead of a
- linked list and also use isspace() rather than == ' '.
-
-2001-03-02 Dan Winship <danw@ximian.com>
-
- * providers/sendmail/camel-sendmail-transport.c (sendmail_send_to,
- sendmail_send): Use "-f" to set the envelope from address so
- bounces go to the right place. Also, pass "-U" since the man page
- says we're supposed to...
-
-2001-03-01 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-sasl.c: #include "camel-sasl-digest-md5.h"
- (camel_sasl_authtype_list): add DIGEST-MD5 stuff here.
- (camel_sasl_authtype): And here too.
- (camel_sasl_new): And here...
-
- * camel-sasl-digest-md5.[c,h]: new SASL class for DIGEST-MD5 (has
- been tested and proven to work).
-
-2001-03-01 Dan Winship <danw@ximian.com>
-
- * camel-sasl.c (camel_sasl_challenge): Take a GByteArray as input
- as well. Comment that you can pass %NULL for @token to get the
- initial auth data for mechanisms that are client-initiated.
- (camel_sasl_challenge_base64): Convenience function for protocols
- that use base64-encoded SASL.
- (camel_sasl_authenticated): Implement this... (it was prototyped
- already)
- (camel_sasl_new): Function to take a service name, a mechanism
- name, and a CamelService, and return a CamelSasl for it.
- (camel_sasl_authtype, camel_sasl_authtype_list): Functions to
- return CamelServiceAuthType information about SASL mechanisms, to
- allow providers to deal with them generically.
-
- * camel-sasl-anonymous.c, camel-sasl-plain.c: Update/simplify for
- CamelSasl changes. Both of these are single-round
- (client-initiated) mechanisms, so they don't need to keep state.
- (camel_sasl_plain_new): Removed; use camel_sasl_new instead.
- (Can't get rid of camel_sasl_anonymous_new though...)
-
- * camel-sasl-cram-md5.c: Update/simplify for CamelSasl changes.
- (camel_sasl_cram_md5_new): Removed; use camel_sasl_new instead.
- (cram_md5_challenge): Use md5_get_digest where possible, and
- various other minor simplifications. CRAM-MD5 only has a single
- round, so there's no need to keep track of state. This code is now
- tested (against Cyrus IMAPd) and known to work.
-
- * camel-sasl-kerberos4.h: Update/simplify for CamelSasl changes.
- Make only a single #ifdef HAVE_KRB4. Remove stuff from priv that
- isn't needed between rounds.
- (camel_sasl_kerberos4_new): Removed; use camel_sasl_new instead
- (krb4_challenge): Fix up the logic I broke in my previous "at
- least make it compile" fixes, update to match other changes, and
- remove IMAP-isms that shouldn't be in the generic code. This still
- isn't tested, because we're stuck behind a NAT right now...
-
- * providers/imap/camel-imap-store.c: Add an "authtypes" hash table
- to CamelImapStore recording the supported authtypes.
- (connect_to_server): Record supported authtypes in the authtypes
- hash rather than the capabilities bitmask, since now the IMAP code
- is no longer responsible for keeping track of which authtypes we
- support.
- (query_auth_types): Use camel_sasl_authtype_list to get the
- SASL-supported authtypes.
- (try_auth): New function to try a SASL auth mechanism. Sort of
- formerly imap_try_kerberos_v4_auth.
- (imap_connect): Get rid of the krb4-specific bits and genericize
- them for any SASL authtype.
-
- * providers/imap/Makefile.am: Remove camel-imap-auth.[ch] (moved
- into camel-imap-store.c since it's now constant size) and the
- KRB4_CFLAGS and KRB4_LDFLAGS references.
-
-2001-03-01 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-sasl-anonymous.c (anon_challenge): Don't base64 encode the
- data, leave that up to the provider to do if it needs to. Also
- save on some memory allocations and stuff.
-
- * camel-sasl-cram-md5.c (cram_md5_challenge): Same here. Also get
- rid of the need for the temp buf as we can just write it to the
- GByteArray.
-
-2001-03-02 Not Zed <NotZed@Ximian.com>
-
- * camel-mime-utils.c (rfc2047_encode_word, rfc2047_decode_word):
- Reconstify variables to match iconv.
-
- * camel-search-private.c (camel_ustrstrcase): Change some
- assertions back into valid returns.
-
-2001-03-01 Dan Winship <danw@ximian.com>
-
- * Makefile.am (libcamel_la_LIBADD, INCLUDES): camel depends on
- krb4 now (where available), for camel-sasl-kerberos4.c
-
- * camel-sasl-kerberos4.[ch]: Make this at least compile. Dunno if
- it works yet.
-
-2001-03-01 Peter Williams <peterw@ximian.com>
-
- * camel-url.c (camel_url_new): Assert url_string != NULL.
-
-2001-02-28 Jeffrey Stedfast <fejj@ximian.com>
-
- * Makefile.am: Added camel-sasl-anonymous.[c,h] to the build.
-
- * camel-sasl-anonymous.[c,h]: new SASL class for ANONYMOUS
-
- * camel-sasl-plain.c (plain_challenge): Oops, have a state for
- setting sasl->authenticated = TRUE;
-
- * camel-sasl-cram-md5.c (cram_md5_challenge): Same here.
-
-2001-02-28 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-utils.c (header_decode_date): A fix for broken
- mailers that send 2-digit years (ie "Wed, 28 Feb 01
- 04:59:41"). Fixes bug #1633.
-
- * camel-filter-driver.c (camel_filter_driver_filter_folder): Check
- to make sure message isn't NULL.
-
-2001-02-28 Dan Winship <danw@ximian.com>
-
- * camel-remote-store.c (remote_recv_line): If we get back 0 bytes
- from camel_stream_buffer_gets, that means the socket got
- disconnected, so set an exception. (Noticed because of a message
- that crashes our IMAP server when you try to look at it. :)
-
-2001-02-28 Jeffrey Stedfast <fejj@ximian.com>
-
- * Makefile.am: Added camel-sasl*.[c,h] to the build.
-
- * camel-sasl.[c,h]: new "abstract" SASL class
-
- * camel-sasl-kerberos4.[c,h]: new SASL class for KERBEROS_V4
-
- * camel-sasl-cram-md5.[c,h]: new SASL class for CRAM-MD5
-
- * camel-sasl-plain.[c,h]: new SASL class for PLAIN
-
- * providers/imap/camel-imap-auth.c: Removed the base64 functions.
-
- * camel-mime-utils.c (base64_encode_simple): Moved here from
- camel-imap-auth.c
- (base64_decode_simple): Same.
-
-2001-02-26 Dan Winship <danw@ximian.com>
-
- * providers/imap/camel-imap-folder.c (imap_sync): Group messages
- into sets with the same flags and use the IMAP message set
- notation rather than doing a separate STORE FLAGS for each one.
- This cuts the network traffic down to just a handful of commands
- per sync rather than one per changed message. Removed the progress
- notification stuff since it's no longer meaningful and should
- hopefully be unnecessary.
- (imap_copy_message_to): move the former sync_message function
- into here, since it's no longer shared with imap_sync.
-
-2001-02-26 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-utils.c: Made thread-safe and moved to above the test
- code.
-
- * camel-mime-message.c (camel_mime_message_init): Set the
- message_id to NULL.
- (camel_mime_message_finalize): Free the message_id.
- (camel_mime_message_set_message_id): New function to set the
- Message-Id.
- (camel_mime_message_get_message_id): New function to get the
- Message-Id.
- (process_header): Decode the message-id.
-
-2001-02-24 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-store.c (construct): init the vTrash folder here instead
- of in store_init.
- (camel_store_class_init): init service_class->construct.
- (camel_store_finalize): We only need to unref the vtrash folder.
- (init_trash): don't create a vstore since we don't need it.
-
-2001-02-23 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-store.c (camel_store_class_init): init get_trash and
- init_trash.
- (camel_store_init): call the virtual init_trash function.
- (camel_store_finalize): unref the vtrash folder/store if present.
- (camel_store_get_folder): Add the new folder to the vtrash
- vfolder.
- (init_trash): default implementation of init_trash.
- (get_trash): default implementation of get_trash.
-
- * camel-vee-store.c (vee_init_trash): No-op.
- (vee_get_trash): return NULL
-
-2001-02-23 Not Zed <NotZed@Ximian.com>
-
- * camel-folder-summary.c (camel_message_info_new_from_header):
- Doh, cut and paste problem, use mlist not cc.
-
- * camel-folder.c (move_message_to):
- (copy_message_to): If the source folder doesn't support a
- summary, dont try and get the message info from it.
-
- * camel-filter-search.c (check_header): Implement a pseudo-header
- "x-camel-mlist" which just looks up in the message info for a
- match.
-
- * camel-folder-search.c (check_header): Add pseudo-header
- "x-camel-mlist" which can be used to match on mailing list.
-
- * providers/imap/camel-imap-folder.c (imap_sync): Add some
- internal progress reporting.
- (imap_rescan): Do some progress reporting.
-
- * camel-mime-part.c (init_header_name_table): Add the message-id
- to the formatted table, so we dont try and wrap it, and break it.
-
-2001-02-22 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-folder.h: Remove the 'FIXME: remove because this isn't
- required...' comment for copy_message_to since we now need and
- cherish its existance in the filter-driver code ;-)
-
- * camel-filter-driver.c (camel_filter_driver_filter_message): Now
- takes a UID and CamelFolder arguments (which can be NULL) to allow
- for possible optimizations when copying messages between folders
- on the same store.
- (camel_filter_driver_filter_mbox): Updated (passes NULL for both
- since this case can't be optimized anyway).
- (camel_filter_driver_filter_folder): Updated to pass in the uid
- and folder of the message.
-
-2001-02-22 Dan Winship <danw@ximian.com>
-
- * providers/imap/camel-imap-summary.h (CAMEL_IMAP_SERVER_FLAGS):
- #define this as the set of all IMAP system flags
-
- * providers/imap/camel-imap-folder.c (sync_message): after syncing
- flags, set server_flags to (flags & CAMEL_IMAP_SERVER_FLAGS)
- rather than just "flags", since any other flags won't have been
- synced. Prevents the CAMEL_MESSAGE_ATTACHMENTS flag from getting
- lost.
-
-2001-02-22 Not Zed <NotZed@Ximian.com>
-
- * providers/vee/*: Removed all files.
-
- * camel-private.h: Move camel-vee-private.h stuff into here.
-
- * camel-session.c: Move the vee_provider here, and initialise it
- always as part of a session. The vfolder provider is always
- available.
-
- * providers/Makefile.am: Remove "vee" from the build list, now
- built as part of the main library.
-
- * Makefile.am (libcamelinclude_HEADERS):
- (libcamel_la_SOURCES): Added camel-vee-store.[ch],
- camel-vee-folder.[ch].
-
- * providers/vee/camel-vee-folder.c (vee_folder_build): Removed,
- not used.
- (camel_vee_folder_new): Removed call to build_folder.
- (vee_get_message): Dont try and free the mi if we didn't get it.
-
- * camel-folder.c (camel_folder_change_info_new): Added a hash
- table of what we have in the lists, plus moved private things into
- private pointer.
- (camel_folder_change_info_add_source): Fixed up private accesses.
- (camel_folder_change_info_add_uid): Changed to use a hashtable to
- see if we already have the uid, etc.
- (camel_folder_change_info_remove_uid): Similar.
- (change_info_remove): Likewise.
- (camel_folder_change_info_clear): Fixes for privatisations.
- (camel_folder_change_info_free): "
-
-2001-02-21 Dan Winship <danw@ximian.com>
-
- * providers/imap/camel-imap-folder.c (fetch_medium): Fixes for
- IMAP4-pre-rev1 from Torsten Schulz.
-
-2001-02-20 Not Zed <NotZed@Ximian.com>
-
- * camel-mime-utils.c (mail_list_magic): Take the ^Header: part out
- of the expression, since we look that up ourselves.
- (header_raw_check_mailing_list): When getting the match, get match
- 1, not match 0, we dont want the full string match.
-
- * camel-folder-summary.c (CAMEL_FOLDER_SUMMARY_VERSION): Bumped
- for summary change.
- (message_info_new): Extract the mlist info from the headers.
- (message_info_load): Load mlist from summary.
- (message_info_save): Save mlist to summary.
- (message_info_free): Save the mlist entry.
- (camel_message_info_new_from_header): Extract mailing list header.
- (camel_message_info_dup_to): Copy the mlist entry.
- (camel_message_info_free): Free mlist.
- (message_info_dump): Dump the mlist.
-
- * camel-folder-summary.h: Add an mlist (mailing list) string to
- the summary.
-
-2001-02-19 Not Zed <NotZed@Ximian.com>
-
- * providers/vee/camel-vee-folder.c (camel_vee_folder_new): Added
- flags argument.
- (message_changed): Add support for the auto-update flag, in which
- case we auto-match the content as it changes.
- (camel_vee_folder_init): Remoive "DYNAMIC" optionality
- (camel_vee_folder_finalise): "
- (vee_expunge): As we expunge folders, re-sync their content by
- rerunning the query.
-
- * providers/vee/camel-vee-store.c (vee_get_folder): Pass flags to
- folder new.
-
-2001-02-18 Not Zed <NotZed@Ximian.com>
-
- * providers/vee/Makefile.am (noinst_HEADERS): Added
- camel-vee-private.h.
-
- * providers/vee/camel-vee-private.h: New file to add locking stuff
- for vee folders.
-
- * providers/vee/camel-vee-folder.c (camel_vee_folder_new): Add
- locking around unmatched setup.
- (camel_vee_folder_init): Setup lock.
- (camel_vee_folder_finalise): Free locks.
- (folder_changed): Add locking.
- (unmatched_finalise): "
- (message_changed): "
- (vee_folder_build): "
-
-2001-02-17 Not Zed <NotZed@Ximian.com>
-
- * providers/vee/camel-vee-folder.c (vee_folder_add): Check uid
- doesn't exist before adding it.
-
-2001-02-16 Not Zed <NotZed@Ximian.com>
-
- * providers/vee/camel-vee-folder.c (camel_vee_folder_new): Create
- a new virtual virtual folder UNMATCHED, to store all messages that
- dont match other vfolders.
- (unmatched_folder_changed): When a vfolder issues a changed event,
- use its info to update the unmatched folder info.
- (unmatched_finalise): When a vfolder is finalised, remove any uids
- it has as if we had a removed event for it.
-
-2001-02-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-filter-driver.c (camel_filter_driver_finalise): Thaw the
- defaultfolder.
- (camel_filter_driver_set_default_folder): Thaw the defaultfolder
- we're about to replace, and freeze the new defaultfolder.
-
-2001-02-15 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/vee/camel-vee-folder.c (camel_vee_folder_new): Emit
- the folder_created signal here.
-
- * providers/local/camel-local-folder.c
- (camel_local_folder_construct): Emit the folder_created signal.
-
- * providers/local/camel-local-store.c (delete_folder): On error,
- free the 'name' string so we don't leak. Also emit the
- folder_deleted signal.
-
- * providers/imap/camel-imap-store.c (subscribe_folder): Emit the
- folder_created signal.
- (unsubscribe_folder): Emit the folder_deleted signal.
-
- * camel-store.c (camel_store_class_init): Added folder_created and
- folder_deleted signal defs.
-
-2001-02-15 Dan Winship <danw@ximian.com>
-
- * camel-folder-thread.c (container_parent_child): Deal with
- out-of-order References headers so they don't cause messages to
- disappear in threaded view.
-
- * providers/imap/camel-imap-folder.c (fetch_medium): IMAP4
- (pre-rev1) doesn't allow BODY.PEEK[], so use RFC822.PEEK instead
- in that case.
-
-2001-02-14 Christopher James Lahey <clahey@ximian.com>
-
- * camel-mime-filter-charset.c (complete, filter),
- camel-mime-utils.c (rfc2047_decode_word, rfc2047_encode_word):
- Changed this code to match the glibc iconv signature.
-
-2001-02-14 Dan Winship <danw@ximian.com>
-
- * camel-store.c (camel_store_create_folder): New method to create
- a folder when you don't know its full name.
-
- * providers/imap/camel-imap-store.c (create_folder): Implement.
- (create_folder): Oops, and fix bug involving namespaces
-
-2001-02-12 Not Zed <NotZed@Ximian.com>
-
- * camel-mime-part.c (init_header_name_table): Add address headers
- to list that we dont fold when writing. The are properly
- formatted as we build them.
- (write_to_stream): DOH, lookup the header name in the formatted
- hash table, not the value, that would never have worked.
-
- * camel-internet-address.c
- (camel_internet_address_encode_address): Changed to take a
- parameter saying how much we've printed so far. We now fold the
- header as we format it. We dont fold addresses, even if they are
- too long, we simply put them on another line by themselves: this
- should make the result more parsable by mailers that can't handle
- split up addresses (which are legal).
- (internet_encode): Fix for changes to above.
-
-2001-02-12 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/local/camel-local-provider.c: mbox, mh, and maildir
- camel-url's need absolute paths.
-
- * camel-provider.h (CAMEL_URL_PATH_IS_ABSOLUTE): New flaggy flag.
-
-2001-02-08 Dan Winship <danw@ximian.com>
-
- * camel-store.c: Rewrite a bunch. Replace the existing folder
- cache stuff with much simpler code that still handles all the
- existing cases. Now the folder hash table is always created by the
- base class, using hash and compare functions provided by the class
- implementation. (If they are set to NULL, CamelStore won't cache
- folders.) lookup_folder, cache_folder, and uncache_folder are no
- longer class methods, and get_name is gone completely.
-
- (camel_store_get_inbox): Renamed from
- camel_store_get_default_folder, since that wasn't being used, and
- this is what we actually need.
- (camel_store_get_root_folder): Removed, since it's not needed for
- anything given get_folder_info.
-
- * camel-remote-store.c:
- * providers/local/camel-local-store.c:
- * providers/local/camel-mbox-store.c:
- * providers/local/camel-mh-store.c:
- * providers/local/camel-maildir-store.c:
- * providers/nntp/camel-nntp-store.c:
- * providers/pop3/camel-pop3-store.c:
- * providers/vee/camel-vee-store.c: Minor updates for CamelStore
- changes
-
- * providers/imap/camel-imap-store.c (camel_imap_store_class_init):
- Update for CamelStore changes.
- (hash_folder_name, compare_folder_name): treat INBOX
- case-insensitively, otherwise use g_str_hash and g_str_equal.
-
- * camel-service.c (camel_service_construct): Remove
- camel_service_new and create camel_service_construct (as a class
- method) in its place.
-
- * camel-session.c (camel_session_get_service): Use
- camel_object_new and camel_service_construct to replace
- camel_service_new.
-
- * providers/local/camel-local-store.c (construct): Append a '/' to
- the URL path if it doesn't end with one
-
-2001-01-31 Jeffrey Stedfast <fejj@helixcode.com>
-
- * camel-tcp-stream-ssl.c: Oops, include the camel-tcp-stream-ssl
- header instead of the raw one.
-
-2001-02-07 Not Zed <NotZed@Ximian.com>
-
- * camel-operation.c (camel_operation_start): Changed to push the
- operation into a status stack.
- (camel_operation_progress): Changed to only accept % complete.
- (camel_operation_reset): Free status stack as well.
-
- * providers/pop3/camel-pop3-folder.c (pop3_get_message): Get the
- octect count from the return line, and pass it to
- get_additional_data().
- (pop3_refresh_info): Added status stuff.
-
- * providers/pop3/camel-pop3-store.c
- (camel_pop3_command_get_additional_data): Added a total bytes
- expected argument for progress reporting & fixed callers.
- (camel_pop3_command_get_additional_data): Added progress
- reporting.
-
- * providers/local/camel-mbox-summary.c (mbox_summary_sync_full):
- (mbox_summary_sync_quick):
- (summary_rebuild): Added progress reporting stuff.
-
-2001-02-07 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-search-private.c (CAMEL_SEARCH_COMPARE): Macro for making
- comparisons easy.
- (camel_ustrcasecmp): Use CAMEL_SEARCH_COMPARE and check for
- end-of-string before the utf-8 error check.
- (camel_ustrncasecmp): Same.
- (camel_search_header_match): Strip leading spaces before doing
- anything else. Also use vlen and mlen so as to not need to do 500
- strlen()'s.
- (camel_ustrcasecmp): Don't get_utf8() for the 2 strings in the
- comparison part of the loop because of short-circuit expression
- evaluation. (blame JPR if this is the wrong term!)
- (camel_ustrncasecmp): Same.
-
-2001-02-06 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-search-private.c (utf8_get): Rewrote using unicode_get_utf8().
- (camel_ustrcasecmp): Use unicode_char_t
- (camel_ustrncasecmp): Same.
-
-2001-02-06 Christopher James Lahey <clahey@ximian.com>
-
- * camel-mime-filter-charset.c (complete, filter),
- camel-mime-utils.c (rfc2047_decode_word, rfc2047_encode_word):
- Made these pass char ** as the second parameter to iconv.
-
-2001-02-06 Not Zed <NotZed@Ximian.com>
-
- * camel-session.c: Removed all the camel_cancel stuff.
-
- * camel-stream-fs.c (stream_read): Change to use camel_operation.
- (stream_write): "
-
- * camel-remote-store.c (socket_connect): Change to use
- camel_operation rather than camel_cancel stuff.
- Removed gal include, WTF is that doing there anyway?
-
- * Makefile.am (libcamel_la_SOURCES):
- (libcamelinclude_HEADERS): Added camel-operation.[ch], stuff to
- handle notification and cancellation.
-
- * camel-search-private.c: Removed unwanted header. It was never
- put in for a reason. Stop fixing irrelevant warnings.
-
- (camel_ustrstrcase): Our own strstrcase impl for utf8 strings.
- (camel_ustrcasecmp): Ditto for strcasecmp.
- (camel_ustrncasecmp): And strncasecmp.
- (utf8_get): Simpler interface to utf8 string processing.
- (camel_search_header_match): Use the new things.
-
-2001-02-05 Not Zed <NotZed@Ximian.com>
-
- * camel-folder.c (get_summary): Removed some old variables/a small
- memleak.
- (free_summary): Removed old variables.
-
- * camel-mime-utils.c (header_raw_check_mailing_list): New utility
- function to get the mailing list (if any) that a set of headers
- came from.
-
-2001-02-05 Christopher James Lahey <clahey@helixcode.com>
-
- * camel-stream-fs.c: Added a missing #include.
-
- * camel-search-private.c: Added a missing #include.
-
-2001-02-05 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-remote-store.c (remote_query_auth_types): Oops. Change
- this too.
-
- * providers/smtp/camel-smtp-transport.c (query_auth_types): Updated.
-
- * providers/nntp/camel-nntp-store.c (nntp_store_query_auth_types):
- Updated.
-
- * providers/pop3/camel-pop3-store.c (query_auth_types): Updated.
-
- * providers/imap/camel-imap-store.c (query_auth_types): Updated.
-
- * camel-service.c (camel_service_query_auth_types): Now takes a
- boolean value to specify whether or not to connect when
- constructing a supported authtype list.
-
-2001-02-05 Not Zed <NotZed@Ximian.com>
-
- * camel-stream-filter.c (do_write): Revert jeff's earlier change,
- the change below is the more-correct fix. All his was doing was
- ignoring the return code & looping actually :)
-
- * camel-stream-fs.c (stream_write): Since we are non-blocking on
- the outgoing fd, keep looping if writing out large blocks, so we
- can keep checking for cancel, etc.
-
-2001-02-02 Not Zed <NotZed@Ximian.com>
-
- * camel-folder-thread.c (camel_folder_thread_messages_new): When
- we drop a fake node, dont skip checking the next in the list.
- (camel_folder_thread_messages_new): Add an assertion check just to
- make sure we dont get any pseudo nodes, and spit a warning if we
- do.
-
-2001-02-04 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-stream-filter.c (do_write): Make do_write loop until the
- entire buffer is written.
-
-2001-02-02 Not Zed <NotZed@Ximian.com>
-
- * camel-stream-fs.c: Add missing header for cancel check stuff.
-
- * camel-session.c (camel_cancel_cancel): Fix a wrong cast.
-
- * camel-mime-part.c (init_header_name_table): Setup a new table
- header_formatted_table, that lists headers that we dont want to
- fold (they've already been folded).
- (write_to_stream): Check for already formatted headers, and dont
- try and fold them. This is a fix for bug #1097.
-
-2001-02-01 Not Zed <NotZed@Ximian.com>
-
- * camel-mime-utils.c (header_fold): If we are folding, drop the
- space at the end of the line.
-
-2001-01-30 Not Zed <NotZed@Ximian.com>
-
- * camel-remote-store.c (timeout_cb): Remvoe the stream locking
- here. I think this was leading to a deadlock when a keepalive is
- being sent, in imap.
-
-2001-01-29 Not Zed <NotZed@Ximian.com>
-
- * providers/imap/camel-imap-command.c
- (imap_command_strdup_vprintf): Include the terminating NUL in the
- calculated string length. This hit memcheck.
-
-2001-01-25 Not Zed <NotZed@Ximian.com>
-
- * tests/folder/test3.c: Changed the subject search to handle case
- sensitive when it is mixed case.
-
- * Makefile.am (libcamel_la_SOURCES): Added camel-ssearch-private.c
- (noinst_HEADERS): Added camel-search-private.h
-
- * camel-folder-search.c (check_header): New function to do the
- work of the various header checks.
- (search_header_matches):
- (search_header_starts_with):
- (search_header_ends_with):
- (search_header_contains): Use check_header to do the work.
- (build_match_regex): Removed.
-
- * camel-search-private.c (header_soundex): New
- function to match words to phrases using soundex algorithm.
-
- * camel-filter-search.c (soundexcmp): Removed.
- (check_match): Moved to search-private.h
-
-2001-01-24 Not Zed <NotZed@Ximian.com>
-
- * camel-search-private.c (camel_search_build_match_regex): Added
- extra flags, so the same function can be used for
- start/end/whole/partial matches.
- (camel_search_header_match): Convenience function to check a
- single header against all sorts of different matches.
-
- * providers/imap/camel-imap-search.c (imap_body_contains): Fix for
- e_sexp api changes.
-
- * camel-folder-search.c: Fix for e_sexp api changes.
- (search_header_contains): Free args/quit on unknown header.
- (search_header_matches): "
- (search_header_starts_with): "
- (search_header_ends_with): "
- (match_message): Add an exception argument.
- (search_body_contains): Free args/quit on fatal error.
- (message_body_contains): Removed (moved to
- camel-search-private.c), fixed callers.
-
- * camel-filter-search.c: Fix for e_sexp api changes.
- (build_match_regex, message_body_contains): Moved into
- camel-filter-private.c Fixed callers.
- (check_header): moved guts to camel-search-private, and
- changed to use regex's for everything. Just calls that with the
- right args.
- (check_header): GEts the header, decodes it, and checks for
- failure, and whatnot.
- (check_match): Removed.
- (header_soundex): Changed significantly. Now it soundexes each
- word in the header separately, and compares it to the first
- argument.
-
- * tests/folder/test9.c (main): Fix for api changes.
- (main): Added tests to see that invalid match and action
- rules are properly detected.
-
- * camel-filter-driver.c (camel_filter_driver_filter_mbox): Remove
- the 'finished message' bit.
- (camel_filter_driver_filter_message): Remove an accidentally
- checked in debug.
- (camel_filter_driver_filter_message): Fix for e-sexp api changes.
-
-2001-01-23 Dan Winship <danw@ximian.com>
-
- * providers/imap/camel-imap-wrapper.c: Add a lock around the
- delayed loading, so two threads won't try to do it at the same
- time.
-
-2001-01-22 Dan Winship <danw@ximian.com>
-
- * providers/vee/camel-vee-folder.c (camel_vee_folder_new): Set the
- CamelFolder::name to just the base part of the vfolder name (the
- non-query part)
-
-2001-01-23 Not Zed <NotZed@Ximian.com>
-
- * camel-filter-search.c (camel_filter_search_match): Perform error
- checking on parsing/execution.
-
- * camel-folder-search.c (camel_folder_search_execute_expression):
- Perform error handling on search expression.
- (CamelFolderSearchPrivate): Add a camelexception for error
- returns.
- (camel_folder_search_execute_expression): Setup exception pointer.
- (search_match_all): Quit on error.
-
- * providers/imap/camel-imap-summary.c (message_info_load): Removed
- some debug 'warnings', as they should now be displayed at the
- toplevel loader, and just made the code match similar code
- elsewhere.
-
- * providers/local/camel-mbox-summary.c (message_info_load): Error
- handling.
- (message_info_save): more error handling.
-
- * camel-folder-summary.c (message_info_load): Add error handling
- and sanity checking.
- (camel_folder_summary_load): Add error checks.
- (perform_content_info_load): Error + sanity checks.
- (content_info_load): error + sanity checks.
-
- * camel-filter-driver.c (close_folder): avoid /0 by updating after
- we've done the sync.
- (close_folders): Setup the first progress report to start it off.
- (camel_filter_driver_filter_message): Fix a fixme, check errors in
- e_sexp parsing, etc.
-
-2001-01-22 Christopher James Lahey <clahey@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (camel_imap_folder_selected):
- Initialize the value of the variable exists here.
-
-2001-01-22 Not Zed <NotZed@Ximian.com>
-
- * .cvsignore */*/.cvsignore: Added profiling temp
- files.
-
- * camel-folder-thread.c (camel_folder_thread_messages_new): When
- removing phantom nodes, check for the end node too.
-
- * camel-filter-driver.[ch]: Changed status vars to be
- CAMEL_FILTER_STATUS_ etc.
-
-2001-01-21 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-mime-utils.c (header_param_list_format_append): Make the
- output a little prettier. Okay, so I'm anal...
-
-2001-01-21 Not Zed <NotZed@Ximian.com>
-
- * camel-filter-driver.h: Added an exception to
- CamelFilterGetFolderFunc.
-
- * camel-filter-driver.c (camel_filter_driver_filter_message):
- Remove source parameter, as it is determined elsewhere now.
- (camel_filter_driver_filter_folder): Same here.
- (camel_filter_driver_filter_mbox): And here.
- (do_move): If we cannot open a folder, quit, rather than ignoring
- it.
- (do_copy): Here too.
- (open_folder): Pass an exception into get_folder callback.
- (camel_filter_driver_filter_folder): Report that we're syncing,
- when we are.
- (camel_filter_driver_filter_mbox): And here too.
- (close_folder): And here.
-
-2001-01-19 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-filter-driver.c (camel_filter_driver_filter_message): Set
- the deleted bit *before* copying to the default folder, this way
- if they are importing mail and have a rule to delete it, it
- doesn't get copied to the default folder un-deleted.
-
-2001-01-19 Dan Winship <danw@ximian.com>
-
- * providers/imap/camel-imap-store.c
- (get_subscribed_folders_by_hand): If LISTing a subscribed folder
- doesn't return a LIST response, just ignore that folder. Yay
- RFC2060.
- (subscribe_folder): add a missing UNLOCK
-
-2001-01-19 Kjartan Maraas <kmaraas@gnome.org>
-
- * providers/smtp/camel-smtp-provider.c: Mark strings for translation.
-
-2001-01-19 Not Zed <NotZed@Ximian.com>
-
- * camel-filter-driver.c (report_status): Add a percentage complete
- indicator to the status thing.
- (camel_filter_driver_filter_mbox): Add percentage complete to
- reporting.
- (camel_filter_driver_filter_folder): Same.
-
-2001-01-18 Dan Winship <danw@ximian.com>
-
- * camel-store.c (camel_folder_info_build): More tweaking... skip
- separator characters after the namespace character. (Gets rid of
- the shell folder registration warning some people have had with
- IMAP)
-
- * providers/imap/camel-imap-store.c (imap_connect): I'm sure there
- was some clever reason I was storing the flags of the folder in
- the hash table rather than just "1", but I don't remember what it
- was now. Anyway, since we only ever test NULL/non-NULL, store 1,
- since flags is sometimes 0.
-
- * providers/imap/camel-imap-folder.c (imap_update_summary): Oops.
- Somewhere in one of the reorgs, the code to add new messages to
- the CamelFolderChangeInfo structure got removed. Fix that.
-
-2001-01-17 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/imap/camel-imap-summary.c (message_info_load): Add
- some g_warnings() to help debug later if I ever get the segfaults
- I was getting earlier. Can't seem to reproduce them after my
- previous "fix".
-
- * camel-folder-summary.c (camel_folder_summary_load): Undid my
- change here, NotZed said it was wrong and that if it gets a NULL
- mi then it should abort and not continue.
-
-2001-01-17 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-folder-summary.c (camel_folder_summary_load): Make sure
- that the message-info is non-null before we go accessing inner
- parts of it and/or adding it to the summary array. I may not have
- handled the error correctly, but it does seem to work
- correctly. If NotZed could double-check this it'd be great.
-
- * providers/smtp/camel-smtp-transport.c (get_smtp_error_string):
- New smtp error-code to string mapping function.
- (smtp_connect): Use the new error->string function for reporting
- useful errors.
- (smtp_helo): Same. Also use a case-insensitive strstr for 8BITMIME
- as it seems Exchange sends back lowercase for that one single SMTP
- extension. Everything else is uppercase. I'm seeing a lack of love
- for that extension by Microsoft dudes...
- (smtp_mail): Use get_smtp_error_string.
- (smtp_rcpt): Same.
- (smtp_data): Same.
- (smtp_quit): Same.
- (smtp_rset): Same.
-
-2001-01-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-folder-summary.c (camel_folder_summary_array): Add an int
- i so this code will compile. Should I be worried about how well
- this code will work? ;-)
-
-2001-01-17 Not Zed <NotZed@Ximian.com>
-
- * camel-folder.c (free_summary): Call
- camel_folder_summary_array_free() to do the work.
- (get_summary): Use camel_folder_summary_array() to get the array
- atomically. These fixes allow folder/test8 to work again, and fix
- a sort of race where the summary size can change while we were
- making a copy of it.
-
- * camel-folder-summary.c (camel_folder_summary_array): Get the
- summary array atomically, so it can't contain empty records.
- (camel_folder_summary_array_free): And free it.
-
- * tests/lib/camel-test.c (die): If we are verbose & in threads,
- then goto sleep so we can debug.
-
- * tests/folder/test8.c (worker): Add a missing pull() for
- comnparing content.
-
- * camel-filter-search.c: Fix the symbol table, so match-all is an
- immediate function, as it should be.
-
- * tests/folder/test9.c (main): New test, tests some filtering
- things.
-
- * tests/message/test3.c (main): Dont use a boundary string with
- spaces in it. Folding can corrupt it. Maybe the folding isn't
- working entirely right, but anyway.
-
- * camel-session.c: Debug out the debug.
-
- * camel-filter-driver.c (camel_filter_driver_filter_folder): Plug
- a messageinfo leak.
-
-2001-01-16 Dan Winship <danw@ximian.com>
-
- Delayed loading of IMAP message parts.
-
- * camel-types.h: typedef CamelMessageInfo and
- CamelMessageContentInfo here
-
- * camel-folder-summary.h: Add a "size" field to
- CamelMessageContentInfo.
-
- * camel-folder-summary.c (camel_folder_summary_content_info_new,
- camel_folder_summary_content_info_free): Renamed and made
- non-static for providers that construct their own content info.
- (content_info_load, content_info_save): load/save size
-
- * camel-data-wrapper.c (camel_data_wrapper_is_offline): New
- function to return if a data wrapper's contents are "offline". (So
- that, for example, we don't make thumbnails of images that haven't
- been loaded off the IMAP server yet.) Defaults to FALSE.
-
- * providers/imap/camel-imap-folder.c (camel_imap_folder_selected):
- Fix a bug in re-selecting a folder when messages have been
- expunged from it by another client in the meantime.
- (imap_get_message): Rewrite. If the message is larger than a
- certain size, just create a skeleton message containing
- CamelImapWrappers that will read parts as needed. This way, large
- attachments only need to be downloaded if the user looks at them,
- and multipart/alternative alternatives that aren't used will never
- be downloaded at all.
- (imap_update_summary): Rewrite this a bunch too to make the
- parsing more robust.
-
- * providers/imap/camel-imap-summary.c
- (CAMEL_IMAP_SUMMARY_VERSION): bump.
- (camel_imap_summary_new): Set build_content to TRUE.
- (content_info_load, content_info_save): Only save/load the content
- for messages that have it. (The content info gets created as a
- side effect of imap_get_message.)
-
- * providers/imap/camel-imap-utils.c (imap_parse_body): New routine
- (and helpers) to parse an IMAP 'body' FETCH response and fill in a
- CamelMessageContentInfo from it.
-
- * providers/imap/Makefile.am (libcamelimap_la_SOURCES,
- libcamelimap_la_HEADERS): add camel-imap-wrapper.
-
-2001-01-16 Dan Winship <danw@ximian.com>
-
- * camel-tcp-stream-raw.c (stream_getsockopt, stream_setsockopt):
- * camel-stream-fs.c (stream_read, stream_write):
- * camel-remote-store.c (socket_connect): fcntl(fd, F_GETFL)
- returns the flags as the return value, not via a passed in
- pointer. And F_SETFL looks for an int, not a long, and you have to
- pass it what it's expecting because it's a va_arg parameter. (Yes,
- the man page lies on Linux. But check the UNIX98 spec or the glibc
- source.) Also, fix another bug in socket_connect: if we manage to
- connect right away, unset O_NONBLOCK so it doesn't mess us up
- later.
-
- Fixes a bunch of problems with non-blocking I/O being done in the
- allegedly-blocking case and then returning EWOULDBLOCK.
-
-2001-01-16 Chris Toshok <toshok@ximian.com>
-
- * providers/Makefile.am (NNTP_DIR): set to nntp if ENABLE_NNTP
- (SUBDIRS): use $(NNTP_DIR)
-
-2001-01-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * providers/smtp/camel-smtp-transport.c (smtp_rcpt): Don't check
- errno as it's not being set. Fixes bug #1150.
-
-2001-01-16 Jeffrey Stedfast <fejj@ximian.com>
-
- Ugh, this design is ugly like my butt.
-
- * camel-session.c (camel_session_query_cert_authenticator): New
- function which will be useful when we integrate SSL.
-
- * camel-tcp-stream-ssl.c (ssl_auth_cert): Callback to authenticate
- a certificate.
- (ssl_bad_cert): Callback that gets the reason the certificate is
- bad and then calls camel's cert-authenticator callback to notify
- the user and to allow the user to override the check.
- (stream_connect): Set the URL we expect to connect with and setup
- the auth_cert and bad_cert callbacks.
- (camel_tcp_stream_ssl_new): Now takes a CamelSession and a
- expected_host argument that it will use for certificate
- authentication.
- (camel_tcp_stream_ssl_finalize): Unref the session and free the
- expected_host.
-
-2001-01-16 Not Zed <NotZed@Ximian.com>
-
- * camel-filter-search.c (header_exists): Changed to support
- multiple args (or'd together).
- (header_contains): Cleaned up to match the search code. Why did
- fejj change it? I'll never know.
- (header_matches):
- (header_starts_with):
- (header_ends_with): Big cleanup of fejj's "i'm the cut & paste
- king" code. Also properly handle or'ing of additional args to
- match what the folder-search code should do.
- (check_match): New function which does the annoying matching
- stuff (for header matches).
- (check_header): Similarly, handles or'ing of the matches together.
- (header_contains):
- (header_matches):
- (header_starts_with):
- (header_ends_with): Call check_header to do the actual work.
- (header_soundex): And here too.
- (match_all): Yeah like match-all isn't passed expression results,
- its passed expression terms. Fix this so match-all works like it
- should, by executing the contained expression.
- (message_body_contains): Copied directly from
- camel-folder-search.c, a more robust/faster/simpler body search
- code.
- (mime_part_matches): Removed entirely.
- (handle_multipart): Removed entirely.
- (build_match_regex): Copied from camel-folder-search. Builds a
- set of simple strings into a regex pattern that matches any of
- them (for faster & simpler matching). Expanded to accept regex
- patterns itself, so it can merge them together.
- (body_contains): Use build match/match message to match using a
- built regex.
- (body_regex): Likewise, this time we tell it we're building a
- regex though.
- (header_full_regex): Use build_match_regex to take the drudgery
- out of it, and expand it to handle multiple regex's at once.
- (get_full_header): slightly cleaner (well i dunno, the sprintf
- stuff just got to me).
- (header_regex): Cleaned up to use build_match_Regex too, and to
- properly check types.
- (filter_message_search): Just allocate 'fms' on the stack.
-
- * camel-filter-driver.c (camel_filter_driver_finalise):
- (camel_filter_driver_init):
- (camel_filter_driver_class_init):
- (camel_filter_driver_get_type): Changed from gtk object to camel
- object.
- (camel_filter_driver_add_rule): New function to add a rule to be
- processed in sexp form.
- (camel_filter_driver_init): Init the rules list.
- (camel_filter_driver_finalise): Clear the rules/rules list.
- (camel_filter_driver_filter_message): Scan rules list directly
- rather than creating on the fly.
-
- * Makefile.am (libcamelinclude_HEADERS): Added camel-filter-driver.h
- (libcamel_la_SOURCES): Added camel-filter-driver.c, code taken
- from filter-driver, which can drive, uh, filters based on sexp's.
- (libcamelinclude_HEADERS):
- (libcamel_la_SOURCES): Added camel-filter-search.[ch]
-
- * camel-folder-summary.c (camel_folder_summary_decode_string):
- Chganged len back to be unsigned. And do a simple range check on
- the string value to try and detect corrupted summary files.
-
- * providers/imap/camel-imap-command.c (imap_read_untagged): Handle
- cancelled stream reads with an appropriate exception.
-
- * providers/imap/camel-imap-private.h: Fix the include-once
- macro. Doh, confliced with camel-private.h.
-
- * providers/imap/camel-imap-store.c (imap_store_refresh_folders):
- A copy of camel_remote_store_refresh_folders. We avoid locking
- each folder when we call it though. This should be removed when i
- can work out how to remove the folder lock from this function
- easily.
-
- * camel-stream-fs.c (stream_write): Fix n' argument of select.
- (stream_read): Likewise.
-
- * camel-remote-store.c (socket_connect): Bump the connect timeout
- upto 4 minutes.
- (socket_connect): Oops, fix the 'n' argument of select.
-
- * camel-session.c (camel_cancel_cancel): If we are given no
- cancellation node, then do it for all active ones.
-
-2001-01-15 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-stream-fs.c (stream_close): If the close() is successful,
- set the fd to -1.
-
- * camel-tcp-stream-raw.c: Removed the disconnect() method.
- (stream_close): If the close() is successful, set the sockfd to
- -1.
-
- * camel-tcp-stream-ssl.c: Removed the disconnect() method.
- (stream_close): If the close() is successful, set the sockfd to
- NULL.
-
- * camel-tcp-stream.c (camel_tcp_stream_disconnect): Removed,
- easier to just use the close() method as it did the same thing
- anyway.
-
-2001-01-15 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-tcp-stream-raw.c (stream_getsockopt): Updated to be able
- to get the CAMEL_SOCKOPT_NONBLOCKING socket opt.
- (stream_setsockopt): Updated to be able to set the
- CAMEL_SOCKOPT_NONBLOCKING socket opt.
-
-2001-01-15 Peter Williams <peterw@ximian.com>
-
- * providers/imap/camel-imap-folder.c (camel_imap_folder_new): Lock
- around the imap_rescan, which needs it.
-
-2001-01-15 Not Zed <NotZed@Ximian.com>
-
- * camel-remote-store.c (socket_connect): A cancellable connection
- routine.
- (remote_send_string): Return cancelled exception if we were.
- (remote_send_stream): "
- (remote_recv_line): "
-
- * camel-stream-fs.c (stream_read): First cut at cancellation
- stuff. Its looking a bit ugly.
-
-2001-01-15 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-tcp-stream-ssl.c (stream_connect): Uses an SSL socket now
- although there's still a few things missing (like certificate
- handling and such).
-
- * camel.c (camel_ssl_init): A replacement function for
- camel_init() that also initializes SSL.
-
-2001-01-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-tcp-stream-ssl.c (stream_getsockopt): Implemented.
- (stream_setsockopt): Implemented.
-
- * camel-tcp-stream-raw.c (stream_getsockopt): Implemented.
- (stream_setsockopt): Implemented.
-
- * camel-tcp-stream.c (camel_tcp_stream_getsockopt): New method.
- (camel_tcp_stream_setsockopt): Another new method. I think you get
- the idea of what these are for so I won't explain them.
-
-2001-01-14 Jeffrey Stedfast <fejj@helixcode.com>
-
- * camel-tcp-stream-ssl.[c,h]: New CamelTcpStream class that
- implements nspr sockets and eventually will use nss for
- SSL/TLS. Currently doesn't do any SSL/TLS but it should still
- work. It's functionally equivalent to CamelTcpStreamRaw at the
- moment only it uses nspr i/o.
-
- * camel-tcp-stream-raw.[c,h]: New CamelTcpStream class that
- implements native sockets. Should be usable but may have some bugs
- yet.
-
-2001-01-13 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-tcp-stream.[c,h]: New abstract class for TCP streams. The
- next step is to write child classes (CamelTcpStreamBSD and
- CamelTcpStreamSSL). The BSD stream will use normal BSD sockets
- while SSL will use Mozilla's NSPR and NSS libraries to do Secure
- Socket Layers which wille ventually replace CamelStreamSSL which I
- just commit'd. Oh well.
-
-2001-01-13 Jeffrey Stedfast <fejj@ximian.com>
-
- * camel-stream-ssl.[c,h]: New stream for handling SSL/TLS
- connections.
-
-2001-01-12 Not Zed <NotZed@Ximian.com>
-
- * camel-folder-thread.c (camel_folder_thread_messages_new):
- Perform a final pass, removing any pseudo nodes we added earlier.
- Quick patch to test the idea.
- (camel_folder_thread_messages_new): Added casts to rmeove some
- warnings for the analites out there.
-
-2001-01-11 Dan Winship <danw@ximian.com>
-
- * providers/imap/camel-imap-folder.c (camel_imap_folder_selected):
- Fix a bug in previous commit: don't check for deleted messages if
- there are no known messages in the folder (because it would end up
- sending "FETCH 0 ...").
- (imap_copy_message_to): Fix this up: sync flags to the server
- before copying so that they end up correct in the remote folder.
- And poke the destination folder after doing the copy so it notices
- the new message right away.
- (imap_move_message_to): Call imap_copy_message_to for most of the
- work rather than duplicating the code (since it's much more
- complicated now).
-
-2001-01-11 Dan Winship <danw@ximian.com>
-
- * providers/imap/camel-imap-folder.c (camel_imap_folder_selected):
- New function to check for added/deleted messages when re-selecting
- a folder.
- (imap_refresh_info, imap_rescan, imap_update_summary): Various
- locking tweaks that turn out to be irrelevant since command_lock
- is recursive, but whatever.
-
- * providers/imap/camel-imap-command.c (camel_imap_command): When
- selecting a new folder, call camel_imap_folder_selected on it.
-
- * camel-folder.c (camel_folder_copy_message_to): Fix a locking
- problem. (One branch of an if statement was returning with the
- lock still locked.) Also remove the deprecation comments, to match
- move_message_to.
-
-2001-01-10 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/local/camel-local-provider.c: Changed the descriptions
- for mh, mbox, and maildir to be more "user-friendly".
-
-2001-01-10 Dan Winship <danw@helixcode.com>
-
- * providers/imap/camel-imap-types.h: New header to prevent
- recursive #include problems
-
- * providers/imap/*.h: Replace some #includes with #include
- "camel-imap-types.h", remove typedefs that were moved to
- camel-imap-types.h
-
- * providers/imap/*.c: Add #includes to make up for #includes
- removed from .h files
-
- * providers/imap/Makefile.am (libcamelimapinclude_HEADERS): Add
- camel-imap-types.h
-
-2001-01-10 Dan Winship <danw@helixcode.com>
-
- * camel-store.c (camel_store_sync): New class function, parallel
- to camel_folder_sync. (The default implementation just calls
- camel_folder_sync on each cached folder.)
-
- * providers/imap/camel-imap-store.c (get_folder_info): Call
- camel_store_sync before doing anything else so that the IMAP
- server and Camel are working from the same data. Don't ask the
- server for the unread message count of the current folder, since
- UW will return often-incorrect cached data, and we can calculate
- it without talking to the server anyway.
-
-2001-01-09 Dan Winship <danw@helixcode.com>
-
- Mostly IMAP changes. Use the NAMESPACE extension (where
- available). Deal with servers that don't return LIST flags in
- response to LSUB (like UW) to get rid of the "not a selectable
- folder" error messages in the UI. Take advantage of the \Marked
- and \Unmarked flags to try to speed up the folder scan by not
- doing STATUS on unmarked folders. Some further tweaks on the shape
- of the resulting folder tree in various situations...
-
- * camel-store.h: Remove the (read) message_count, since nothing
- uses it, and we can speed up IMAP a bit this way.
-
- * camel-store.c (camel_folder_info_build): Redo this a bit to make
- it more useful for IMAP since that's the only thing that uses it.
-
- * camel-remote-store.c (camel_remote_store_connected): Public
- function to check if the store is connected, and try to connect it
- if it's not.
- (remote_send_string, remote_send_stream, remote_recv_line): Use
- that.
-
- * providers/imap/camel-imap-store.c (camel_imap_store_finalize):
- fix up for changes.
- (camel_imap_store_init): Initialize subscribed_folders to NULL
- rather than an empty hash table.
- (imap_connect): Get the list of subscribed folders here. If the
- server doesn't claim that any of them are either Marked or
- Unmarked, then assume that it doesn't do that for LSUB and
- remember that for later. If the server supports the NAMESPACE
- extension and the user didn't specify a namespace, use the
- server-provided one.
- (imap_disconnect): Free the list of subscribed folders, and the
- namespace.
- (get_folder): check camel_remote_store_connected
- (get_folder_info): check camel_remote_store_connected. Add a bunch
- of new cleverness. If we learned that the server doesn't do LSUB
- usefully, do a bunch of LISTs by hand. Then, if we're getting
- unread counts, only do it for folders that weren't listed as
- Unmarked. Also, deal with namespaces that end with the separator
- character, and update for changes to camel_folder_info_build.
- (folder_subscribed): Add a g_return_val_if_fail.
- (subscribe_folder, unsubscribe_folder): check
- camel_remote_store_connected.
-
- * providers/nntp/camel-nntp-store.c (build_folder_info,
- build_folder_info_from_grouplist, nntp_store_get_folder_info):
- Don't fill in message_count since it doesn't exist any more.
-
-2001-01-09 Dan Winship <danw@helixcode.com>
-
- Kill off a long-hated Camel kludge: "empty" URLs and
- query_auth_types_generic.
-
- * camel-url.c: Remove "empty" from CamelURL.
- (camel_url_new): No longer set it.
- (camel_url_to_string): Treat "" as equivalent to NULL for
- authmech. (Unrelated change, but it simplifies some stuff with the
- new config dialog.)
-
- * camel-service.c (camel_service_new): Remove url->empty check: if
- the URL isn't valid, we don't create the service.
- (camel_service_query_auth_types): No longer need to switch between
- generic and connected variants.
-
- * providers/smtp/camel-smtp-transport.c (query_auth_types):
- * providers/pop3/camel-pop3-store.c (query_auth_types):
- * providers/nntp/camel-nntp-store.c (nntp_store_query_auth_types):
- * providers/imap/camel-imap-store.c (query_auth_types):
- * camel-remote-store.c (remote_query_auth_types): Remove generic
- version, rename connected version.
-
-2001-01-06 Not Zed <NotZed@HelixCode.com>
-
- * providers/vee/camel-vee-folder.c (vee_folder_build_folder): Dont
- try and unref a messageinfo that wasn't there, and use the right
- free function too. Modified patch from Iain.
- (vee_move_message_to): New method, call the real folders'
- move_message_to method.
-
-2001-01-04 JP Rosevear <jpr@helixcode.com>
-
- * tests/lib/Makefile.am: fix includes for compilation
-
- * tests/message/Makefile.am: Build test3 again
-
- * tests/message/test2.c: Kill warnings with header includes
-
- * tests/message/test3.c: ditto
-
- * tests/lib/streams.c: ditto
-
- * tests/lib/camel-test.c: ditto
-
- * tests/lib/messages.c: ditto
-
- * tests/lib/folders.c: ditto
-
-2001-01-04 Dan Winship <danw@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (imap_rescan): Fix two
- problems in figuring out server-expunged messages.
-
-2001-01-04 Not Zed <NotZed@HelixCode.com>
-
- * camel-folder.c (thaw): If we have a lot of messages changed,
- promote it to a folder changed event.
-
-2000-01-03 Jeffrey Stedfast <fejj@helixcode.com>
-
- * camel-folder-search.c (search_header_matches): Implemented.
- (search_header_exists): Implemented.
- (search_header_starts_with): Implemented.
- (search_header_ends_with): Implemented.
-
-2001-01-03 Christopher James Lahey <clahey@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (camel_imap_folder_new):
- Initialize the exists variable so that we don't do random things
- if the imap server misbehaves.
-
-2000-12-29 Not Zed <NotZed@HelixCode.com>
-
- * camel-folder.c (camel_folder_move_message_to): REmove warning,
- this isn't really deprecated, sigh.
-
- * camel-mime-utils.c (header_fold): Comment out some debug.
-
-2001-01-02 Christopher James Lahey <clahey@helixcode.com>
-
- * providers/maildir/, providers/mbox/, providers/mh/: Removed
- these directories since they're unused.
-
-2001-01-02 Dan Winship <danw@helixcode.com>
-
- IMAP randomness.
-
- * providers/imap/camel-imap-stream.[ch]: Remove. To be replaced.
-
- * providers/imap/Makefile.am (libcamelimapinclude_HEADERS): Remove
- camel-imap-stream.h
-
- * providers/imap/camel-imap-utils.c (imap_parse_flag_list): Take a
- char ** instead of char *, to return the position at the end of
- parsing like the string parsing functions.
- (imap_parse_string_generic): New function to parse a string,
- nstring, or astring.
- (imap_parse_nstring, imap_parse_astring): Now macros
- (imap_parse_string): Added
-
- * providers/imap/camel-imap-folder.h: Remove the "exists" field
- from CamelImapFolder.
-
- * providers/imap/camel-imap-folder.c: Remove unused include of
- camel-imap-stream.h.
- (camel_imap_folder_init): Remove no-longer-relevant summary
- initialization.
- (camel_imap_folder_new): Update for imap_parse_flag_list change,
- exists removal, and imap_rescan.
- (imap_rescan): New function that does most of the work of the old
- imap_refresh_info, but taking "exists" as an argument instead of
- getting it from the folder. Also calls camel_imap_folder_changed
- to do the summary updating and signalling, rather than duplicating
- that code.
- (imap_refresh_info): Just call imap_rescan (using the size of the
- folder summary as "exists").
- (imap_update_summary): Update for imap_parse_flag_list change
- (camel_imap_folder_changed): Update for "exists" change.
-
-2001-01-02 Dan Winship <danw@helixcode.com>
-
- * camel-mime-utils.c (header_content_type_simple): New function to
- return just foo/bar with no parameters.
-
- * camel-data-wrapper.c (get_mime_type): Use
- header_content_type_simple rather than header_content_type_format.
-
-2000-12-28 Dan Winship <danw@helixcode.com>
-
- * gmime-content-field.[ch]: Remove this. It was only a thin
- wrapper around struct _header_content_type anyway, and didn't
- match the naming scheme of anything else.
-
- * Makefile.am: Remove gmime-content-field.[ch]
-
- * camel.h: Remove gmime-content-field.h
-
- * camel-types.h: Add CamelContentType as a typedef for struct
- _header_content_type (especially for use outside of camel).
-
- * camel-multipart.c:
- * camel-mime-part.c:
- * camel-mime-message.c:
- * camel-folder-summary.c:
- * camel-folder-search.c:
- * camel-data-wrapper.[ch]: Use CamelContentType and
- header_content_type_* functions rather than the GMime stuff.
-
- * camel-mime-part-utils.c:
- * camel-medium.c: Remove unused gmime-content-field.h include.
-
-2000-12-27 Dan Winship <danw@helixcode.com>
-
- * providers/pop3/camel-pop3-store.c (connect_to_server): Fix the
- APOP check to not crash on servers that don't return any
- information on the +OK greeting line.
-
-2000-12-24 Not Zed <NotZed@HelixCode.com>
-
- * providers/imap/camel-imap-search.c (imap_body_contains): Lock
- the command channel while searching.
- (imap_body_contains): If performing a whole uid search, then add
- references to our own summary items, dont look it up in the
- folder. This way they can't vanish unexpectedly.
-
- * providers/imap/camel-imap-folder.h (CamelImapFolder): Added a
- private field.
- (CamelImapFolder): Removed summary again from here.
-
- * providers/imap/camel-imap-private.h: Added lock for imap
- searches.
-
- * Merge from camel-mt-branch.
-
- * providers/imap/camel-imap-folder.c (imap_update_summary): Merge
- fix, use the folder->summary.
- (imap_get_message_flags, imap_set_message_flags,
- imap_get_message_user_flag, imap_set_message_user_flag): Removed
- again.
- (camel_imap_folder_init): Setup private data/lock.
- (imap_finalize): Free private data/search lock.
- (imap_search_free): Lock the search_lock.
- (imap_search_by_expression): Lock the search lock when using the
- search object. Also copy/ref hte summary, rather than getting it
- directly.
- (imap_refresh_info): Free any info lookups. Use folder->summary
- not imap_folder->summary. And lock around commands.
- (camel_imap_folder_changed): Use folder->summary again.
- (camel_imap_folder_changed): Make sure we unref the summary lookup.
-
-2000-12-22 Dan Winship <danw@helixcode.com>
-
- * providers/imap/camel-imap-store.c (get_folder_info): When
- getting the top-level folder list, include INBOX even if it's not
- subscribed. Don't show subscribed folders outside of the given
- namespace. Do a better job of pruning the namespace from the
- returned folder tree.
-
-2000-12-21 Dan Winship <danw@helixcode.com>
-
- * providers/imap/camel-imap-search.c: New CamelFolderSearch
- subclass that just reimplements body_contains (using the IMAP
- SEARCH command). All other kinds of searching are done against the
- local summary.
-
- * providers/imap/camel-imap-folder.c (imap_search_by_expression):
- Use a CamelImapSearch to do searching.
-
- * providers/imap/camel-imap-utils.c (imap_translate_sexp, etc): No
- longer needed.
-
- * camel-folder-search.h: Add missing CAMEL_FOLDER_SEARCH_TYPE
- #define
-
-2000-12-21 Dan Winship <danw@helixcode.com>
-
- * camel-stream-buffer.c (camel_stream_buffer_gets): Update the
- doc comment: since it always NUL-terminates the buffer, it reads
- at most @max-1 bytes, not @max.
-
- * camel-remote-store.c (remote_recv_line): Fix the "did
- camel_stream_buffer_gets fill the whole buffer" check. Fixes a bug
- when reading lines longer than 1024 characters (eg, IMAP SEARCH
- responses in very large folders).
-
-2000-12-19 Dan Winship <danw@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (imap_refresh_info): Oops.
- Don't do "FETCH 1:0" when the folder is empty.
- (imap_protocol_get_summary_specifier): Request RFC822.SIZE too.
- (imap_update_summary): Parse RFC822.SIZE and add it to the
- summary.
-
-2000-12-18 Dan Winship <danw@helixcode.com>
-
- * providers/imap/camel-imap-summary.c: Add "guint32 server_flags"
- to CamelImapMessageInfo to keep track of the last known message
- flag state on the server.
- (message_info_save, message_info_load): Save/load the
- server_flags.
-
- * providers/imap/camel-imap-folder.c: Make this use
- CamelFolderChangeInfo and emit folder_changed notifications as it
- gets them rather than only on refresh_info.
- (imap_refresh_info): Notice flags that get cleared on the server
- as well as flags that get set.
- (imap_update_summary): Remove a comment that never actually
- applied to the committed code.
-
-2000-12-15 Dan Winship <danw@helixcode.com>
-
- * providers/imap/camel-imap-command.c (camel_imap_command): Change
- the semantics of fmt: Now %S (capital S) means an IMAP "string",
- (which can be sent as either a quoted string or a literal). If
- the server supports LITERAL+, these will be sent as extended
- literals (which don't require any special escaping). Otherwise
- they'll be sent as quoted strings (and it now properly deals with
- " or \ in the string).
- (imap_command_strdup_vprintf): Utility routine that does the real
- work for the functionality mentioned above.
-
- * providers/imap/camel-imap-utils.c (imap_quote_string): Turns a
- string into a proper IMAP "quoted string".
-
- * providers/imap/camel-imap-store.c:
- * providers/imap/camel-imap-folder.c: Use %S instead of "%s" where
- appropriate.
-
-2000-12-22 Not Zed <NotZed@HelixCode.com>
-
- * camel-folder-summary.c (GLOBAL_INFO_UNLOCK): Doh, cut and paste
- victim again, call unlock instead of lock!
- (summary_assign_uid): Unlock around trying to get a new uid, if we
- have a clash.
-
-2000-12-21 Not Zed <NotZed@HelixCode.com>
-
- * tests/folder/Makefile.am (TESTS): reenabled the tests here.
-
- * providers/nntp/camel-nntp-newsrc.c (CamelNNTPNewsrc): Add a
- lock. Made completely mt-safe. Sigh, this is all so i can
- support snooping of the set_flags stuff inside camel-nntp-folder,
- since i've removed the global folder lock from all of the other
- folder summary operations.
- (camel_nntp_newsrc_read_for_server): Setup lock.
- (camel_nntp_newsrc_get_highest_article_read): Lock internal access.
- (camel_nntp_newsrc_get_num_articles_read):
- (camel_nntp_newsrc_mark_article_read):
- (camel_nntp_newsrc_mark_range_read):
- (camel_nntp_newsrc_article_is_read):
- (camel_nntp_newsrc_group_is_subscribed):
- (camel_nntp_newsrc_unsubscribe_group):
- (camel_nntp_newsrc_subscribe_group):
- (camel_nntp_newsrc_get_subscribed_group_names):
- (camel_nntp_newsrc_get_all_group_names): "
- (camel_nntp_newsrc_write_to_file): Lock internal accesses.
- (camel_nntp_newsrc_write): Lock around diry stuff.
-
- * providers/local/camel-maildir-summary.c (maildir_summary_check):
- Lock around our internal poking of the summary hashtable/array.
- (maildir_summary_sync): And the same here too.
-
- * camel-folder-summary.c: Moved the summaryprivate data into
- camel-private.h. Only needed for the locks really.
- (camel_folder_summary_init): Setup locks.
- (camel_folder_summary_set_filename): Lock.
- (camel_folder_summary_index): lock
- (camel_folder_summary_uid): Lock
- (camel_folder_summary_next_uid): "
- (camel_folder_summary_set_uid): "
- (camel_folder_summary_load): Lock around whole load. Hrm,
- probably not required.
- (camel_folder_summary_save): Lock around whole save, this is
- reqwuired, unless we ref/copy the whole list first, and i couldn't
- be bothreed.
- (camel_folder_summary_add): lock
- (summary_assign_uid): Lock around internal accesses.
- (camel_folder_summary_info_new_from_parser): Lock around filtr stuff.
- (camel_folder_summary_info_ref): Add locking. Could probably use
- its own lock?
- (camel_folder_summary_touch): Add locking, likewise.
- (camel_folder_summary_clear): Lock. If the preiovus two are
- changed, then so this will need mroe locking.
- (camel_folder_summary_info_free): Lock around refcounting.
- (camel_folder_summary_remove): Locking.
- (camel_folder_summary_remove_uid): Lock ref, unlock, unref. Also
- fixed a bug that would have made this never work, freeing the key,
- which isn't allocated.
- (camel_folder_summary_remove_index): lock, ref, unlock unref also.
- (camel_message_info_ref): Lock using a separate global lock, since
- we have no context here.
- (camel_message_info_free): Here too.
- (content_info_alloc): Use an alocation lock here. avoids races
- with setting up content_info_chunks, etc.
- (camel_folder_summary_info_new): And here too.
- (camel_folder_summary_load): Changed to use a differnet lock for
- loading/saving.
- (camel_folder_summary_init): Doh, i do need a reflock afterall,
- set one up.
- (camel_folder_summary_finalize): Free it.
- (camel_folder_summary_index): Add a reflock.
- (camel_folder_summary_uid): And here too.
- (camel_folder_summary_info_free): Use reflock instead of
- summary_lock.
- (camel_folder_summary_info_ref): Likewise.
- (camel_folder_summary_remove_uid): Add reflocking.
- (camel_folder_summary_remove_index): And here too.
-
- * providers/vee/camel-vee-folder.c (camel_vee_folder_new): Setup a
- summary object.
- (vee_folder_build): Build each item into the real summary object.
- (vee_folder_add, vee_folder_add_uid, vee_folder_add_change): New
- functions to add a single record to the vfolder summary.
- (vee_folder_build_folder): Use a real summary.
- (vee_get_uids): Removed, use default impl.
- (vee_free_message_info): "
- (vee_get_message_info): "
- (vee_get_summary): "
- (vee_get_unread_message_count): "
- (vee_get_message_count): "
- (vee_sync): Make vee-folder-sync sync all subordinate folders.
- Well i dont think this is right, but enough peopl ehave aksed for
- it.
- (vee_expunge): Same for expunge.
- (vee_set_message_flags): Call parent class, then mirror flags to
- subfolder.
- (vee_get_message_user_flag): Removed, we just use the default
- impl, and our flags should always match.
- (vee_set_message_user_flag): Snoop the set and set on subfolder.
- (vee_get_message_flags): Removed, jsut use parent impl, assume our
- copy matches the real ones.
- (get_real_message): Removed. We sort ofneed to keep the
- summaryitem refed while we use it, so this doesn't make as much
- sense as it did once.
- (camel_vee_folder_finalise): Unhook listening events as we unref
- folders.
- (camel_vee_folder_new): Set the summary messageinfo data size
- properly.
- (vfolder_remove_match): Fixed for summary change.
- (folder_changed): ditto. Also stopped changed items from being
- re-searched and possibly removed. Might have to resort to the old
- whole-search idea again.
- (message_changed): Similarly. Might be easier just not to bother
- with a whole search.
-
- * providers/vee/camel-vee-folder.h: Removes summary
- hashtable/array, and use a real summary object. Sigh, more work.
-
- * providers/nntp/camel-nntp-folder.c (nntp_folder_sync): Move
- summary to folder object.
- (nntp_folder_get_message_count): Removed, use default impl.
- (nntp_folder_set_message_flags): Call parent impl to do the work,
- but snoop for newsrc.
- (nntp_folder_get_uids): Removed, use default impl.
- (nntp_folder_get_summary): "
- (nntp_folder_get_message_info): "
- (nntp_folder_free_message_info): "
- (camel_nntp_folder_new): moved summary to folder class
-
- * providers/imap/camel-imap-folder.c (camel_imap_folder_init):
- Move summary to folder object.
- (camel_imap_folder_new): "
- (imap_finalize): No longer unref the summary (or infact, do
- anything else either).
- (imap_refresh_info): move summary to folder object.
- (imap_sync): "
- (imap_get_message_count): Removed, use default impl.
- (imap_get_unread_message_count): "
- (imap_get_uids): "
- (imap_get_summary): "
- (imap_free_summary): "
- (imap_get_message_info): "
- (imap_free_message_info): "
- (imap_get_message_flags): "
- (imap_set_message_flags): "
- (imap_get_message_user_flag): ", this changes functionality, but
- only by providing non-permanent flags.
- (imap_set_message_user_flag): "
- (imap_update_summary): move summary to folder object, and use
- camel_folder_summary_info_new_from_header, instead of calling the
- virtual function directly.
-
- * providers/local/camel-maildir-folder.c (maildir_append_message):
- move summary to folder object, again.
- (maildir_get_message): "
-
- * providers/local/camel-mh-folder.c (mh_append_message): move
- summary to folder object.
- (mh_get_message): "
-
- * providers/local/camel-mbox-folder.c (mbox_append_message): Move
- summary to folder object
- (mbox_get_message): "
- (mbox_set_message_user_flag): We need our own copy of this, sigh,
- so we can track if the xev needs a rewrite (probably, its only a
- guide anyway).
- (mbox_set_message_user_tag): Same same with this one.
- (camel_mbox_folder_class_init): Link in these new virtual functions.
-
- * providers/local/camel-local-folder.h (CamelLocalFolder): removed
- summary.
-
- * providers/local/camel-local-folder.c (local_get_message_count):
- (local_get_unread_message_count):
- (local_get_uids):
- (local_get_summary):
- (local_free_summary):
- (local_get_message_info):
- (local_free_message_info):
- (local_get_message_flags):
- (local_set_message_flags):
- (local_get_message_user_flag):
- (local_set_message_user_flag):
- (local_get_message_user_tag):
- (local_set_message_user_tag): Removed, all now use default
- implementation.
- (camel_local_folder_class_init): Removed overrides.
- (local_init): Clear folder->summary.
- (local_finalize): move summary to folder.
- (camel_local_folder_construct): "
- (local_sync): "
-
- * camel-folder.c (free_summary): Provide a real impl.
- (get_summary): "
- (free_uids): "
- (get_uids): "
- (free_message_info): "
- (get_message_info): "
- (set_message_user_tag): "
- (get_message_user_tag): "
- (set_message_user_flag): "
- (get_message_user_flag): " Sigh, the last so far.
- (get_message_flags): Sigh, 1 more afterall.
- (get_unread_message_count): And and this.
- (get_message_count): and this!
- (set_message_flags): Sigh, and this.
- (camel_folder_finalize): Unref the summary if we have it.
- (camel_folder_free_uids): Remove locking.
- (camel_folder_get_message_flags): Remove locks, since the summary
- is now mt-safe.
- (camel_folder_set_message_flags): "
- (camel_folder_get_message_user_flag): "
- (camel_folder_set_message_user_flag): "
- (camel_folder_get_message_user_tag): "
- (camel_folder_set_message_user_tag): "
- (camel_folder_get_message_info): "
- (camel_folder_free_message_info): "
- (camel_folder_get_uids): "
- (camel_folder_free_summary): "
- (camel_folder_get_unread_message_count): "
- (get_unread_message_count): Check we got info, no big deal, but
- the summary might change while we're counting, and upset the count
- slightly.
- (camel_folder_get_message_count): Remove locks.
-
- * camel-folder.h (struct _CamelFolder): Added CamelFolderSummary
- to the base folder object. Sigh, this is going to be a lot of
- work ...
-
- * camel-service.c (camel_service_init, finalise): changed
- connect_lock to be recursive e_mutex.
-
- * camel-remote-store.c (camel_remote_store_init, finalise): Changed
- stream_lock to recursive e_mutex.
-
- * camel-private.h (RemoteStorePrivate, ServicePrivate): Use
- recursive mutexes for connect_lock & stream_lock. Ick. Because
- of the imap code.
-
- * providers/imap/camel-imap-private.h: Change the command_lock to
- be an EMutex.
-
- * providers/imap/camel-imap-store.c (connect_to_server): Removed
- the command_lock stuff. If we are just connected again, it should
- be safe to assume we have exclusive access at this point without
- it (and yes, removes a deadlock).
- (imap_create): Remove a lock that wasn't even supposed to be
- there.
- (camel_imap_store_finalize, init): g_mutex->e_mutex(E_MUTEX_REC).
- Use a recursive mutex since the imap code is multiply recursivly
- calling some functions (sigh, it would be nice to fix this).
-
-2000-12-20 Not Zed <NotZed@HelixCode.com>
-
- * camel-folder.c (folder_changed): Change the locks to inside the
- if. Stops a deadloc,k and we dont need a lock to read a value.
- (message_changed): Likewise.
-
- * camel.c (camel_init): Blah, comment out g_thread_init, leave it
- to the caller, since it can only ever be done once.
-
- * camel-folder-thread.c (camel_folder_thread_messages_new): Ref
- and save the folder in the thread return. Also get the summary
- once, and access that for the messageinfo's. Added bonus that now
- threads should come out in a similar order. We need to do this so
- that the messageinfo's dont get unref'd under us, and using the
- summary directly simplifies memory management.
- (camel_folder_thread_messages_destroy): Free the summary/unref the
- folder.
-
- * camel-folder-thread.h: Add a folder to CamelFolderThread struct.
-
-2000-12-19 Not Zed <NotZed@HelixCode.com>
-
- * providers/imap/camel-imap-utils.c (imap_translate_sexp): Unref
- using e_sexp_unref, since it is no longer an object.
-
- * tests/lib/camel-test.c: Added a global lock, and made it
- thread-aware.
-
- * camel-exception.c: Add a global lock. Not sure its really
- needed here, but it doesn't really hurt.
- (camel_exception_clear): Lock around access.
- (camel_exception_set): Same.
- (camel_exception_setv): "
- (camel_exception_xfer): "
-
- * providers/local/Makefile.am (noinst_HEADERS): Added, for
- camel-local-private.h
-
- * camel-folder.c (camel_folder_search_by_expression): Removed
- locking here, now upto the implementing class to lock.
- (camel_folder_search_free): Removed the folder lock here too, for
- consistency really, and the locking probably wasn't needed.
-
- * providers/local/camel-local-folder.c (local_get_summary):
- Changed to copy/ref the summary items.
- (local_free_summary): Unref the summary items/free the array.
- (local_get_unread_message_count): Free info lookups.
- (local_search_by_expression): Perform more fine-grained locking,
- and dont lock the whole folder while searching, just the search
- object. Dum de dum, it *would* be possible to not even have to
- lock the search, by using our own copy of the search object each
- time. Could be investigated.
- (local_init): Init priaate data/lock.
- (local_finalize): Free private data/lock.
- (local_search_free): Also lock around the search object, because
- it accesses global data inside.
-
- * README.mt: Some info about the mt code development.
-
- * camel-folder-search.c (match_message): Put in a warning, this
- plain deadlocks so far, but i'm going to bed now.
- (camel_folder_search_finalize): Use e_sexp_unref() since its no
- longer an object.
-
- * camel-session.c (camel_session_init): Init private data/lock.
- (camel_session_finalise): Free private data/lock.
- (camel_session_register_provider): Lock hash insert.
- (service_cache_remove): Lock.
- (camel_session_list_providers): "
- (camel_session_get_service): Lock the whole function.
-
- * camel-session.h (struct _CamelSession): Added private data.
-
- * providers/imap/camel-imap-store.c (camel_imap_store_init): Setup
- private data.
- (camel_imap_store_finalize): Free private data.
- (connect_to_server): Lock around command calls. I dont think its
- needed, but it shouldn't hurt either.
- (imap_connect): Lock around command calls. Again, I don think it
- is needed, but wont hurt.
- (imap_disconnect): ditto for this one.
- (imap_create): Lock around command.
- (get_folder): "
- (get_folder_info): "
- (subscribe_folder): "
- (unsubscribe_folder): "
- (imap_keepalive): "
-
- * providers/imap/camel-imap-folder.c (camel_imap_folder_new): Lock
- around calling a command.
- (imap_refresh_info): Likewise.
- (imap_sync): "
- (imap_append_message): "
- (imap_copy_message_to): "
- (imap_move_message_to): "
- (imap_get_message): "
- (imap_update_summary): "
- (imap_search_by_expression): ", also minor logic cleanup.
- (imap_get_summary): Copy/ref the summary items.
- (imap_free_summary): And free it now too.
-
- * providers/imap/camel-imap-auth.c (imap_try_kerberos_v4_auth):
- Lock the command stream for the command session.
-
- * providers/imap/camel-imap-private.h: Private (locking info)
- stuff for imap provider.
- (CAMEL_IMAP_STORE_UNLOCK): Fix to call unlock, rather than lock!
-
- * camel-service.c (camel_service_query_auth_types): Lock also for
- the connection here, incase the service needs to connect.
-
- * camel-remote-store.c (camel_remote_store_init): Init private
- data/lock.
- (camel_remote_store_finalise): Readded, free private data/lock.
- (remote_send_stream): Changed to return the number of bytes
- written, like a good little stream function should.
- (camel_remote_store_send_string): Lock for stream access.
- (camel_remote_store_send_stream): Same here.
- (camel_remote_store_recv_line): And here.
- (camel_remote_store_refresh_folders): Lock the store for cache
- access.
- (timeout_cb): Lock for stream access.
-
-2000-12-18 Not Zed <NotZed@HelixCode.com>
-
- * camel-service.c (camel_service_init): Init private data.
- (camel_service_finalise): Free private data.
- (camel_service_connect): Lock around connection access.
- (camel_service_disconnect): "
-
- * camel-service.h (struct _CamelService): Added private field.
-
- * camel-store.c (camel_store_init): Init private data/lock.
- (camel_store_finalize): Free private data/lock.
- (camel_store_get_folder): Lock internal calls.
- (camel_store_delete_folder): "
- (camel_store_rename_folder): "
- (camel_store_get_root_folder): "
- (camel_store_get_default_folder): "
- (camel_store_get_folder_info): "
- (camel_store_folder_subscribed): "
- (camel_store_subscribe_folder): "
- (camel_store_unsubscribe_folder): "
- (lookup_folder): Lock accesses to the folder cache.
- (cache_folder): "
- (uncache_folder): And here too.
-
- * camel-store.h (struct _CamelStore): Added a private field.
-
- * Makefile.am (noinst_HEADERS): Add camel-private.h. There is a
- comment in that header as to why it ins't installed.
-
- * camel-private.h: New header for private data, that subclasses
- can get to.
-
- * tests/lib/camel-test.c (camel_test_init): If we do have threads
- enabled already, dont call g_thread_init().
-
- * tests/lib/folders.c (test_folder_counts): Add free of info.
- (test_folder_message): And here too.
-
- * providers/local/camel-maildir-summary.c (remove_summary): Free
- info.
- (maildir_summary_check): Free info lookups.
-
- * providers/local/camel-mh-summary.c (message_info_new): Removed,
- didn't add value.
- (remove_summary): free info after being used.
- (mh_summary_check): Free info lookups.
- (mh_summary_sync): and here too.
-
- * providers/local/camel-mbox-summary.c (summary_update): Free info
- lookups.
- (mbox_summary_sync_full): Likewise.
- (mbox_summary_sync_quick): And here.
- (mbox_summary_sync): ... and here.
-
- * providers/local/camel-maildir-folder.c (maildir_get_message):
- Free messageinfo lookups.
-
- * providers/local/camel-mh-folder.c (mh_get_message): Free
- messageinfo lookups.
-
- * providers/local/camel-mbox-folder.c (mbox_get_message): Free
- messageinfo lookups.
-
- * providers/local/camel-local-summary.c
- (message_info_new_from_message): Removed, since it wasn't doing
- anything useful.
- (message_info_new_from_parser): Same. And some other dead code.
-
- * providers/local/camel-local-folder.c (local_get_message_info):
- deconstify.
- (local_free_message_info):new func to free info.
- (local_get_uids):
- (local_get_message_flags):
- (local_set_message_flags):
- (local_get_message_user_flag):
- (local_set_message_user_flag):
- (local_get_message_user_tag):
- (local_set_message_user_tag): Free all info lookups.
- (local_expunge): Dont call camel_folder_* functions, to avoid a deadlock.
-
- * providers/nntp/camel-nntp-folder.c
- (nntp_folder_get_message_info): deconstify.
- (nntp_folder_free_message_info): Free summary item.
- (nntp_folder_get_message_flags): Free summary lookup.
- (nntp_folder_set_message_flags): and here.
- (nntp_folder_get_uids): And here.
-
- * providers/imap/camel-imap-auth.c: Make base64_*_simple optional
- with the HAVE_KRB4 flag.
-
- * providers/imap/camel-imap-folder.c (imap_free_message_info):
- Added a free of the message info.
- (imap_refresh_info):
- (imap_sync):
- (imap_refresh_info):
- (imap_get_unread_message_count):
- (imap_get_uids):
- (imap_get_message_flags):
- (imap_set_message_flags): Free any summary lookups.
- (imap_get_message_flags): Get the message info directly from the
- summary, not via the folder interface.
- (imap_move_message_to): Dont call folder functions directly
- (delete_message), as it will deadlock since we already have the
- lock.
-
- * providers/vee/camel-vee-folder.c (vee_free_message_info): Free/unref
- the messageinfo.
- (vee_get_message_info): First ref the internal copy, then return it.
- (folder_changed): Free all got message info's.
- (message_changed): And here.
- (get_real_message): And here.
- (vee_folder_build): and here.
- (vee_folder_build_folder): ... and here.
-
- * camel-folder-summary.c (camel_folder_summary_info_new):
- Initialise the messageinfo refcount to 1.
- (camel_folder_summary_info_free): Down the refcount till we need
- to free.
- (camel_folder_summary_info_ref): New function to up the refcount.
- (camel_message_info_dup_to): Sewt the refcount of the dest to 1.
- (camel_message_info_new): Set refcount to 1.
- (camel_message_info_new_from_header): Dont allocate the mi
- ourselves.
- (camel_message_info_free): Handle refcounting.
- (camel_message_info_ref): New function.
- (camel_folder_summary_index): Ref the messageinfo before returning
- it.
- (camel_folder_summary_uid): Likewise.
- (camel_folder_summary_save): Access the messageinfo array
- directly, rather than through accessors (saves ref/unref).
- (camel_folder_summary_clear): Likewise.
- (camel_folder_summary_remove_index): Likewise.
- (main): Free lookups.
-
- * camel-folder-summary.h (CamelMessageInfo): Added a refcount
- value.
-
- * camel-folder.c (camel_folder_free_message_info): New function to
- 'free' a message info.
- (camel_folder_get_message_info): Deconstify return.
- (camel_folder_lock): New (internal) function to thread-lock the
- folder.
- (camel_folder_unlock): Likewise for unlocking.
- (freeze):
- (thaw): Lock around access to folder->frozen/changed_frozen.
- (folder_changed): Likewise.
- (message_changed): Likewise.
- (camel_folder_init): Init private data, locks and moved frozen
- info.
- (camel_folder_finalize): Free new private data, locks and moved
- frozen info.
- (copy_message_to): Free the messageinfo after we've used it.
- (move_message_to): And here too.
- (camel_folder_sync): Lock around virtual method invocation. Just
- locking around any virtual method that is known to need it. This
- is the first cut at locking.
- (camel_folder_refresh_info): "
- (camel_folder_expunge): "
- (camel_folder_get_message_count): "
- (camel_folder_get_unread_message_count): "
- (camel_folder_append_message): "
- (camel_folder_set_message_flags): "
- (camel_folder_get_message_flags): "
- (camel_folder_get_message_user_flag): "
- (camel_folder_set_message_user_flag): "
- (camel_folder_get_message_user_tag): "
- (camel_folder_set_message_user_tag): "
- (camel_folder_get_message): "
- (camel_folder_get_uids): "
- (camel_folder_free_uids): "
- (camel_folder_get_summary): "
- (camel_folder_search_by_expression): "
- (camel_folder_free_summary): "
- (camel_folder_search_free): "
- (camel_folder_move_message_to): "
- (camel_folder_copy_message_to): "
- (copy_message_to): Dont call any of our own folder functions
- directly, otherwise we will deadlock.
- (move_message_to): Likewise.
-
- * camel-folder.h (CamelFolder): Added free_message_info() function
- & deconstify get_message_info()'s return.
- (CamelFolder): Add a private field (for locks).
- (struct _CamelFolder): Moved changed_changed/frozen into private
- data, since it really is private and now needs locked access.
-
-2000-12-15 Jeffrey Stedfast <fejj@helixcode.com>
-
- * camel-mime-utils.c (header_fold): When checking to see if we
- need to fold the header, when we come accross a \n, make sure to
- start at p + 1 the next time through the loop or else we get into
- an infinite loop.
-
-2000-12-13 Dan Winship <danw@helixcode.com>
-
- * Namespace cleanup: change a bunch of IS_CAMEL_* macros to
- CAMEL_IS_*
-
-2000-12-13 Chris Toshok <toshok@helixcode.com>
-
- * providers/imap/camel-imap-auth.c: add #include <sys/types.h> for
- freebsd.
-
-2000-12-12 Christopher James Lahey <clahey@helixcode.com>
-
- * camel-folder-summary.c, camel-folder-summary.h: Added #ifndef
- NO_WARNINGS around a #warning. Added (void) to the prototype and
- declaration of camel_message_info_new.
-
- * camel-mime-message.h: Added an include for
- camel-mime-filter-bestenc.h. Added a prototype for
- camel_mime_message_set_best_encoding. Reformatted prototypes to
- line up.
-
- * camel-mime-parser.c: Added #if d(!)0 around the states string
- lookup table since it's only used in debugging output.
-
- * camel-seekable-substream.c (stream_flush): Added a cast.
-
- * providers/imap/camel-imap-auth.c: Added #include <netinet/in.h>.
-
- * providers/imap/camel-imap-folder.c (imap_refresh_info): Made uid
- and flags const to fix warnings here.
-
- * providers/imap/camel-imap-store.c (get_folder_info): Made p
- const to fix warnings here.
-
-2000-12-12 Dan Winship <danw@helixcode.com>
-
- * tests/lib/Makefile.am: Add missing .h file. (From campd.)
-
-2000-12-11 Not Zed <NotZed@HelixCode.com>
-
- * providers/smtp/camel-smtp-transport.c (smtp_data): Remove use of
- linewrap filter. Headers are now wrapped. encode_8bit already
- enforces a 998 octet line limit.
- (smtp_data): Also fixed a memleak, we always have to unref our own
- copy of the filters. We also dont need to remove them manually,
- so dont bother. The type's an int too ...
-
- * camel-internet-address.c (internet_unformat): When scanning past
- quotes, remove them also.
- (camel_internet_address_format_address): If the name contains "'s,
- or ','s then strip and quotes and wrap the whole lot in one set of
- quotes.
-
- * Makefile.am (noinst_HEADERS): We dont want to install
- camel-charset-map-private.h, ever. There are probably other
- similar files ..?
-
- * camel-mime-part.c (write_to_stream): Fold header lines
- appropriately as we're writing them out.
-
- * camel-mime-utils.c (header_fold): Add a new argument, headerlen,
- tells it how long the associated header token is.
- (header_fold): Also,k check to see if we need to fold first, using
- a better algorithm, and also accept already-folded lines, and
- re-process accordingly.
- (rfc2047_decode_word): Add a little buffer space to iconv output
- for shifting overheads?
- (rfc2047_decode_word): finish the iconv with a null call, to flush
- shift state, etc.
- (rfc2047_encode_word): Attempt to break up long words into
- appropriately sized, independent, chunks. See rfc2047, section 2.
- (header_decode_mailbox): Dont add in extra spaces into the output
- if we are decoding adjacent encoded words. We can only guess this
- case, as some broken mailers put encoded words inside quoted
- words.
- (header_encode_phrase): Dont merge words if they are going to end
- up too long. Also change back ot only merge consecutive words of
- the same type. e.g. 'foo. blah fum.' -> "foo." blah "fum." or
- 'iam an. idiot' -> iam "an." idiot
-
- * camel-medium.c (camel_medium_set_header): Hrm, we actually want
- to call set_header, not add_header here, probably explains some
- duplicate X-Evolution headers i was trying to track down. Also
- changed the api to handle a NULL value == remove the header.
-
- * providers/local/camel-maildir-summary.c
- (maildir_summary_decode_x_evolution): Always return error, we dont
- use x-evolution for maildir.
- (maildir_summary_encode_x_evolution): Always return a NULL string,
- likewise.
- (maildir_summary_add): Hook in here, since the _new function
- doesn't have access to any flags from the caller. If we have
- flags, then update the filename again. Not ideal, but should
- work.
-
-2000-12-08 JP Rosevear <jpr@helixcode.com>
-
- * tests/message/Makefile.am: Remove test3 from build until the files
- show up
-
-2000-12-09 Not Zed <NotZed@HelixCode.com>
-
- * camel-mime-message.c (camel_mime_message_set_date): Change the
- sign of the default date offset when none is supplied.
- (camel_mime_message_set_date): Also do dst if its dst (forward 1
- hour). Fixes #928 + some.
-
-2000-12-06 Not Zed <NotZed@HelixCode.com>
-
- * tests/lib/camel-test.h (check): Change line no format so that
- emacs can detect it.
-
-2000-12-06 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (imap_refresh_info): We want
- to bitwise-or the server and cached flags here so that we keep the
- flags that we have set locally and set any additional flags that a
- parallel connection may have set.
-
-2000-12-05 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/smtp/camel-smtp-transport.c (smtp_data): If the data
- wrapper fails to be written to the stream, unref it and the
- filters before returning.
-
-2000-12-05 Dan Winship <danw@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (imap_get_message): use
- BODY.PEEK[] rather than RFC822, so the message doesn't get marked
- as \Seen.
- (imap_refresh_info): Fix a really really really dumb bug.
-
-2000-12-05 Dan Winship <danw@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (imap_set_message_flags): Fix
- the check for "flags aren't actually changing".
-
- * providers/local/camel-local-folder.c (local_set_message_flags,
- local_set_message_user_flag, local_set_message_user_tag): Don't
- emit message_changed unless the flags actually changed.
-
- * providers/nntp/camel-nntp-folder.c
- (nntp_folder_set_message_flags): Don't emit message_changed unless
- the flags actually changed. Fix the check for marked as seen.
-
-2000-12-05 Not Zed <NotZed@HelixCode.com>
-
- * camel-seekable-substream.c (stream_flush): stream_flush does
- make sense for a substream afterall (if you have a stream_write).
- (stream_write): Implement this.
- (stream_seek): Change the STREAM_END behaviour to be more sane.
- if bounded go from the end of the bound, if unbounded, go from the
- end of the parent stream.
-
- * camel-stream-mem.c (stream_read): Dont return error if reading
- past the end of data, just return 0.
-
- * camel-stream-fs.c (camel_stream_fs_init): Initialise the stream
- to be unbound.
- (stream_seek): Fix the logic when seeking from the end of an
- unbounded stream.
- (camel_stream_fs_new_with_fd): If the fd is invalid (-1), then
- return NULL immediately.
- (stream_seek): Range check a SEEK_END so it fits within
- bound_start.
-
-2000-12-01 Not Zed <NotZed@HelixCode.com>
-
- * tests/lib/folders.c (test_folder_basic): New test to perform
- basic store operations on folders (taken from folders/test1).
- (test_folder_message_ops): Tkane the guts out of folders/test2.
-
-2000-12-04 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/smtp/camel-smtp-transport.c (smtp_connect): i18n-ize
- exception strings.
- (get_name): And here.
- (_send_to): Here too.
- (smtp_helo): And here and there...
- (smtp_mail): And around the square...
- (smtp_rcpt): Saying catch me if you can...
- (smtp_data): And here three.
- (smtp_rset): And here.
- (smtp_quit): And finally here.
-
-2000-12-01 Jeffrey Stedfast <fejj@helixcode.com>
-
- * camel-folder-search.h: Added system_flag to CamelFolderSearchClass
-
- * camel-folder-summary.c (camel_system_flag_get): Convenience
- function to return whether or not a flag is set using a string as
- the flag name.
- (camel_system_flag): Return the integer value of the flag string.
-
- * camel-folder-search.c (search_system_flag): New ESExp callback
- for allowing vfoldering on CamelMessageInfo flags.
-
-2000-12-01 Dan Winship <danw@helixcode.com>
-
- * camel-service.c (camel_service_disconnect): Don't
- g_return_if_fail if the service is already disconnected. Just
- return.
-
- * providers/pop3/camel-pop3-store.c (pop3_try_authenticate):
- Return FALSE (don't try again) if we get CAMEL_POP3_FAIL.
- (pop3_connect): If we don't succeed, disconnect.
-
-2000-11-30 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-store.c
- (parse_list_response_as_folder_info): Fix a possible bug where
- 'name' could be uninitialized.
-
- * camel-folder-summary.c (camel_message_info_new): New convenience
- function, doesn't do much but it sure makes code cleaner to read.
- (camel_message_info_new_from_header): This one makes my life heaven.
-
-2000-11-30 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-summary.c (camel_imap_summary_new):
- Handle the case where the summary failed to load - clear the
- summary and then set the dirty bit so that it is sure to save
- later. Is this the right fix?
-
-2000-11-30 Dan Winship <danw@helixcode.com>
-
- * camel-exception.c (camel_exception_setv): Remove unused
- variable.
-
-2000-11-30 Not Zed <NotZed@HelixCode.com>
-
- * providers/local/camel-mbox-folder.c (mbox_get_message): Remove
- assertion that content is there, when it no longer can be.
-
- * camel-folder-summary.h: Removed pos/bodypos/endpos from
- camelmeessagecontentinfo.
- (CamelMessageFlags): Added an attachments flag.
-
- * providers/local/camel-local-summary.h: Added load virtual
- function.
-
- * tests/lib/folders.c (test_message_info): Accessors.
- (test_folder_message): "
-
- * camel-folder-thread.c (get_root_subject): Fix accessors.
- (dump_tree_rec): "
-
- * camel-folder-search.c (camel_folder_search_execute_expression):
- Accessors for messageinfo.
- (search_match_all): "
- (search_header_contains): "
- (search_header_contains): "
- (search_body_contains): "
- (camel_folder_search_execute_expression): Use mepool_strdup.
-
- * providers/local/camel-mbox-summary.c (summary_update): Accessors
- for messageinfo.
- (mbox_summary_sync_full): "
-
- * providers/local/camel-mh-summary.c (remove_summary): Accessors
- for messageinfo.
- (mh_summary_check): "
- (mh_summary_sync_message): "
- (mh_summary_sync): "
-
- * providers/local/camel-mh-folder.c (mh_append_message): Use
- accessor for uid.
-
- * providers/local/camel-local-summary.c
- (local_summary_decode_x_evolution): Use accessor to uid.
- (local_summary_encode_x_evolution): Likewise.
- (message_info_new): And here.
- (camel_local_summary_load): Call virtual load function.
- (local_summary_load): Default load function, load summary.
- (camel_local_summary_load): Check file exists before trying to
- load.
- (camel_local_summary_construct): Turn off building content info!
- (CAMEL_LOCAL_SUMMARY_VERSION): Bump, since we dont build content
- info anymore.
- (camel_local_summary_load): After a successful load/check, do a
- save too so we dont have to go through it again randomly.
-
- * providers/nntp/camel-nntp-utils.c (get_XOVER_headers): Use
- accessors for messageinfo.
-
- * providers/nntp/camel-nntp-folder.c (nntp_folder_get_uids): Use
- accessors for uid.
-
- * providers/imap/camel-imap-folder.c (imap_refresh_info): Use
- accessor for uid.
- (imap_sync): Likewise.
- (imap_get_uids): Likewise.
- (imap_update_summary): And here.
-
- * providers/vee/camel-vee-folder.c (vfolder_remove_match): Use
- accessor for uid.
- (vfolder_add_match): Handle estrv stuff.
- (vfolder_change_match): Accessor for uid.
- (get_real_message): "
- (vee_get_uids): "
- (vee_folder_build): " + estrv.
- (vee_folder_build_folder): "
-
- * providers/local/camel-maildir-folder.c (maildir_append_message):
- Use acccessors for uid's.
- (maildir_get_message): Here too.
-
- * providers/local/camel-maildir-summary.c
- (camel_maildir_summary_init): Setup the string count for us.
- (message_info_new): Access the string array directly.
- (message_info_free): No need to free string if using array.
- (camel_maildir_summary_info_to_name): Use accessor to get to uid.
- (remove_summary): And here.
- (maildir_summary_check): Likewise.
- (maildir_summary_sync): And here.
- (maildir_summary_load): Load up a cache of uid->filename mappings
- before loading the actual summary file. This saves us having to
- waste the diskspace storing the filenames in the summary itself,
- and also helps us sync the summary better on load.
- (message_info_load): If we have the load_map setup, and the uid
- exists, then set the filename cache from it, and update the flags
- from the name, incase our summary mismatches it.
-
- * camel-folder-summary.c (camel_folder_summary_init): Setup string
- count for compressed info record. An optional compile mode which
- stores all strings for a given messageinfo into a packed array,
- which should save 36-50 bytes/record.
- (camel_folder_summary_info_new): Init the string array.
- (message_info_new): Set the string array items, as required.
- (message_info_load): And here too.
- (message_info_save): Use accessors to get to strings.
- (message_info_free): Free strings as one.
- (camel_message_info_dup_to): Handle packed array case.
- (camel_folder_summary_add): Use accessors. And pack the strv
- before storing it.
- (summary_assign_uid): New function to assign a unique uid to a
- message, if it doesn't have one.
- (camel_folder_summary_add): Call assign_uid instead of doing it
- ourselves.
- (camel_folder_summary_info_new_from_parser): "
- (camel_folder_summary_info_new_from_message): "
- (camel_folder_summary_encode_string): constify.
- (camel_folder_summary_encode_token): "
- (summary_build_content_info_message): Fix accessors to messageinfo.
- (CAMEL_FOLDER_SUMMARY_VERSION): Bumped, for removal of
- contentinfo->pos data.
- (camel_folder_summary_info_new_from_parser): Calculate the size
- based on the parser position, not the removed contentinfo stuff.
- (camel_folder_summary_info_new_from_message): Remove size stuff.
- (camel_folder_summary_offset_content): Removed, no longer means anything.
- (content_info_new):
- (content_info_load):
- (content_info_save):
- (summary_build_content_info): Remove stuff for contentinfo->pos*.
- (summary_build_content_info): Take a msginfo argument, set
- attachments flag if we find any attachments.
- (summary_build_content_info_message): set attachments flag if we
- find any attachments.
- (camel_folder_summary_info_new_from_parser): Always scan the
- content info, even if we dont save it.
- (camel_folder_summary_info_new_from_message): And here too.
- (summary_build_content_info): Only create the contentinfo stuff if
- we have it turned on, otherwise just parse and discard.
- (summary_build_content_info_message): Likewise.
-
-2000-11-29 Jeffrey Stedfast <fejj@helixcode.com>
-
- * camel-store.c (camel_store_get_folder): Updated the gtk-doc
- comment.
-
-2000-11-29 Dan Winship <danw@helixcode.com>
-
- * camel-mime-utils.c:
- * camel-mime-filter-charset.c: Use iconv instead of unicode_iconv.
-
- * providers/imap/camel-imap-command.c (imap_read_untagged): Fix
- some off-by-one-ness.
-
- * camel-stream-buffer.c (stream_read): Fix another bug found in
- previously-unused code here.
-
-2000-11-29 Ettore Perazzoli <ettore@helixcode.com>
-
- * tests/lib/Makefile.am (INCLUDES): `$(top_srcdir)' for builddir
- != srcdir compilation.
-
-2000-11-29 Not Zed <NotZed@HelixCode.com>
-
- * tests/message/test2.c (main): Add a missed unref.
-
- * camel-stream-mem.c (camel_stream_mem_set_buffer): We must set
- ourselves as the owner of the byte-array.
- Weird, someone has modified this file (its been reindented), but i
- can't see any changelogs ...
-
- * tests/lib/messages.c (content_finalise): Fix memleak in tester,
- free byte array when our content object is deleted.
-
- * camel-folder-search.c (camel_folder_search_finalize): Yeah
- great, so the sexp is a gtk object, not a camel object. Isn't
- that going to be fun to fix?
-
- * camel-session.c (camel_session_finalise): Free the storage path.
-
- * providers/local/camel-local-store.c (camel_local_store_init): If
- store->folders is setup, free it first, then overwrite. Hmm,
- this seems a bit crappy to me.
-
- * camel-store.c (camel_store_init): Dont setup store->folders if
- its already setup.
-
- * camel-exception.c (camel_exception_setv): Removed a memleak. no
- need to strdup after a strdup_printf!!!
-
- * camel-address.c (camel_address_finalize): Free the address
- ptrarray, once finished.
-
- * providers/local/camel-local-folder.c (local_finalize): Make sure
- we dont leave the folder locked on close.
- (local_finalize): Free summary/search.
-
- * providers/local/camel-mh-summary.c (mh_summary_next_uid_string):
- Small memleak, always free name after using it.
-
- * camel-mime-part.c (set_content_object): Free txt after setting
- the header.
-
- * providers/local/camel-maildir-summary.c (maildir_summary_check):
- Fix a memleak, close the dir after scanning new.
- (message_info_free): Added so we can free the filename cached in
- the messageinfo.
- (camel_maildir_summary_finalise): Free the hostname.
-
- * tests/folder/test[12].c (main): Clear out camel-test before
- starting.
-
- * providers/local/camel-mbox-summary.c (mbox_summary_sync_quick):
- Because encode_x_evolution folds the line (sigh, because
- encode_param does, unlike every other function in
- camel-mime-utils), unfold the encoded result before comparing.
- (mbox_summary_sync_quick): Another small memleak, free xevnew once
- finished with it.
-
- * camel-mime-utils.c (header_decode_quoted_string): Removed a
- redundant check for c=0.
- (header_unfold): New function to un-fold headers.
-
- * providers/local/camel-local-summary.c
- (local_summary_encode_x_evolution): some problems with encoding
- tags, using the wrong output strings.
- (local_summary_encode_x_evolution): We dont need to append a ;
- either, param_list_format_append() will do it for us.
-
-2000-11-28 JP Rosevear <jpr@helixcode.com>
-
- * camel-lock.c: No longer hard code the enabled lock types
-
-2000-11-28 Dan Winship <danw@helixcode.com>
-
- * camel-remote-store.c (remote_recv_line): Don't set exception to
- g_strerror (errno) when nread == 0, because it won't have been
- set.
-
- * providers/pop3/camel-pop3-folder.c (pop3_finalize): Don't try to
- free things if they haven't been set yet.
-
-2000-11-28 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/smtp/camel-smtp-transport.c (smtp_connect): Clear the
- exception if EHLO fails before trying HELO in the cases where the
- SMTP provider doesn't announce its ESMTPness.
-
-2000-11-28 Not Zed <NotZed@HelixCode.com>
-
- * providers/local/camel-maildir-summary.c
- (camel_maildir_summary_init): Set the info size's properly, oops!
-
- * tests/lib/folders.[ch]: Folder testing helpers.
-
- * tests/folder/test2.c: Test basic message ops on folders.
-
- * tests/folder/test1.c (main): Test basic folder ops on (local)
- stores.
-
- * providers/local/camel-local-provider.c
- (camel_provider_module_init): Removed some debug.
-
- * providers/local/camel-maildir-folder.c
- (camel_maildir_folder_class_init): fix parent class.
-
- * providers/local/camel-mh-folder.c (camel_mh_folder_class_init):
- Fix parent class (damn cut & paste).
-
- * providers/local/camel-maildir-store.c (get_folder): Call parent
- impl.
- (camel_maildir_store_class_init): Fix parent class setup.
- (delete_folder): Check the folder exists before trying to delete
- it.
- (delete_folder): Try and make the delete operation atomic/rollback
- failures. e.g. if one directory isn't empty, then create the
- other empty ones back. Also clear the tmp directory fully first.
-
- * providers/local/camel-mbox-store.c (get_folder): Call parent
- impl.
- (camel_mbox_store_class_init): parent class is camel_local_store,
- not camel_folder, oops.
- (delete_folder): Return an error if it doesn't exist, rather than
- covering it up.
-
- * providers/local/camel-mh-store.c (get_folder): Call parent impl.
- (camel_mh_store_class_init): fix parent class setup.
- (delete_folder): Error if it doesn't exist now.
-
- * camel-folder.c (camel_folder_move_message_to):
- (camel_folder_copy_message_to): Added warnings as these functions
- are going to be removed later.
-
- * camel-store.c (camel_store_get_root_folder): Fix for an early
- api change. We want CAMEL_STORE_FOLDER_CREATE, not TRUE, since
- its a flag.
- (camel_store_get_default_folder): And here too.
-
- * providers/local/camel-local-store.c (xrename): Handle renaming
- folders differently to renaming files.
- (get_default_folder_name): local stores dont have a default
- folder, so make it so. Or at least, it doesn't seem to make sense
- to have one.
- (get_root_folder_name): Same for root.
- (get_folder): Added parent implementation, that makes sure the
- service path exists, if we are creating a new folder (but doesn't
- create the folder).
-
-2000-11-27 Not Zed <NotZed@HelixCode.com>
-
- * providers/local/camel-local-store.c (xrename): Fixed races. Use
- link/unlink, rather than rename, to properly detect overwriting
- another file. And allow some files to be missing.
-
-2000-11-28 Radek Doulik <rodo@helixcode.com>
-
- * providers/local/camel-local-summary.c
- (local_summary_decode_x_evolution): add scan = scan->next; to
- avoid infinite loop
-
-2000-11-27 Dan Winship <danw@helixcode.com>
-
- * providers/imap/camel-imap-command.c (imap_read_untagged): Make
- this gratuitously more complicated. No wait, I mean, fix bugs. Now
- fully handles NULs in the data stream (which "can't happen" but
- do) and also handles responses containing multiple literals. Also
- does less copying than the original code.
-
- * camel-stream-buffer.c (stream_read): Fix a bug that could make
- it lose sync and/or overrun buffers.
-
-2000-11-27 JP Rosevear <jpr@helixcode.com>
-
- * providers/local/.cvsignore: shush
-
-2000-11-27 Not Zed <NotZed@HelixCode.com>
-
- * providers/Makefile.am: Removed mh, mbox, added local, to the default.
-
-2000-11-24 Not Zed <NotZed@HelixCode.com>
-
- * tests/data/getaddr.pl: little util to scan mailboxes for any and
- every address they contain.
-
- * tests/message/test2.c (main): Added a bunch of stuff to test
- decoding/reencoding/etc of internationalised addresses.
-
- * tests/message/lib/address-data.h: Copy of some unicode/other
- testing data. **Beware** of editing this file in emacs, it'll
- probably try and convert all the characters to something
- unusable.
-
- * tests/lib/camel-test.c (camel_test_break): Add a debugger hook
- point.
-
- * camel-mime-utils.c (quoted_encode): Check for space and convert
- to _ separately.
- (header_decode_mailbox): Fixed the 'check comments for realname'
- code, problem was the domain getting code was skipping all
- whitespace/comments before we could get a look-in. This is
- approximate but fairly robust.
- (header_decode_text): Dont use the c-type isspace func here, we
- want a specific whitespace only.
- (header_decode_text): If we have decoded words next to each other,
- do not insert whitespaces between them, which is what rfc2047 requires.
- (header_decode_text): Make c unsigned too.
-
- * tests/README: Added at least some explanation of all this stuff.
-
- * tests/lib/camel-test.h (check_msg): Added a non-gcc version of
- the fail command, we dont get the expression that failed, but no
- matter. Should be (more) portable now.
- (check, check_msg): Put the file/lineno in the default message.
-
- * Makefile.am (SUBDIRS): Add tests.
-
- * camel-mime-filter-basic.c (filter): Well, I'll add the extra
- bytes here too, lathough not strictly needed, might save a
- re-malloc when we get to complete().
-
- * camel-mime-filter-charset.c (filter): Make sure we have room if
- we only convert very short data.
- (complete): and here too.
-
- * tests/Makefile.am: Initial test harness & tests. Requires gcc
- for this.
-
- * camel-internet-address.c (d): Turn off debug.
-
- * camel-charset-map.c (camel_charset_step): Oops, & masks for set
- intersection, not | them. Dunno how this got even close to
- working.
-
-2000-11-23 Not Zed <NotZed@HelixCode.com>
-
- * camel-mime-filter-basic.c (filter): For base64 encoding, the
- output size for 0, 1, or 2 bytes of input can exceed input*2, so
- make sure we account for that as well.
- (complete): And here.
- (complete): Similarly for qp encoding, if we have a trailing
- space, we need some extra bytes (not needed for 'filter()', as any
- such bytes are stored in state/save).
-
- * camel-mime-utils.c (quoted_decode_step): Removed fixme not required.
- (quoted_encode_close): Dont append a trailing afterall. Otherwise
- a pass through the encode/decode will grow the message each time.
-
-2000-11-22 Radek Doulik <rodo@helixcode.com>
-
- * camel-mime-utils.c (header_msgid_generate): check for return
- values
-
-2000-11-21 Dan Winship <danw@helixcode.com>
-
- * camel-lock.c:
- * camel-movemail.c: add #ifdef HAVE_ALLOCA_H
-
-2000-11-21 Not Zed <NotZed@HelixCode.com>
-
- * providers/local/camel-mh-summary.c (mh_summary_sync_message):
- Shite, -1 on error, >=0 on success. So i've just been truncating
- all the messages I touched, good one zed.
- (mh_summary_sync_message): Sigh, and write to the right damn fd as
- well.
- (mh_summary_sync_message): Argh, and we need to compare the length
- of the old xev -1 to the new xev, to check if we can optimise it.
-
- * camel-folder.c (camel_folder_change_info_new): Init the pool.
- (camel_folder_change_info_add_source): Allocate string in the
- pool.
- (camel_folder_change_info_add_source_list):
- (camel_folder_change_info_add_update): No longer free the key, as
- it cannot be yet.
- (change_info_add_uid): Add a new arg, copy, telling it whether to
- copy the uid argument or not, and copy using mempool_strdup.
- (change_info_cat): Tell add_uid to copy the string.
- (camel_folder_change_info_add_update): Call add_uid directly.
- (change_info_remove): Call add_uid directly, with no copy, and
- dont free the key.
- (change_info_free_update): No longer required since we dont malloc
- the keys.
- (camel_folder_change_info_add_uid): Fix for add_uid change.
- (camel_folder_change_info_remove_uid):
- (camel_folder_change_info_change_uid):
- (change_info_clear): No longer needed, just set the size to 0 on
- the array directly.
- (camel_folder_change_info_clear): Empty the arrays directly, and
- flush the mempool too, and also clear uid_source, incase anyone
- was silly enough to call us in the wrong order.
- (camel_folder_change_info_free): Dont bother clearing the array's
- contents, just free the pool and throw away all the indexes.
-
- * camel-folder.h: Added a mempool to CamelFolderChangeInfo to
- store the uid's we get.
-
- * camel-folder-search.c (search_match_all): If we are only
- matching a single info, just use that/do the search.
- (camel_folder_search_match_expression): New function. Matches a
- single message info against an expression.
- (camel_folder_search_init): Init a hash table used to map the
- returned gptrarrays' to mempools.
- (camel_folder_search_execute_expression): Store all of the string
- data in a mempool, slightly faster, less wasted space (usually),.
- (camel_folder_search_free_result): Check for the mempool that
- stores the data for the list, and free that if we have it,
- otherwise assume we need to use g_free() (which should only happen
- if the list is empty at the moment).
- : commented out the debugging prints. Got sick of 'executing
- header search' crap.
-
- * providers/vee/camel-vee-folder.c (camel_vee_folder_init): Init
- changes.
- (camel_vee_folder_finalise): Free changes.
- (vfolder_add_match): Simple helper to add a new matching info
- record.
- (camel_vee_folder_add_folder): Only trigger a changed event if we
- have changes.
- (vfolder_change_match): New function, changes our local vfolder
- info to match the source.
- (vfolder_add_match): Add a new info to the vfolder list.
- (vfolder_remove_match): Remove a no-longer matching info from the
- vfolder summary.
- (message_changed): check if the message still matches, and
- remove/etc as required.
- (camel_vee_folder_finalise, init): init/free search object.
- (vee_folder_build_folder): Build the changes to the folder into
- the changes data, as we go.
- (folder_changed): If the folder gave us an explicit list of
- changes, then process each one separately (unless there's a lot
- added/changed).
-
- * providers/vee/camel-vee-folder.h: Added a changes field to the
- folder.
-
- * Makefile.am (libcamel_la_SOURCES): Added
- camel-folder-thread.[ch].
-
- * camel-folder-thread.c: message-threading algorithm, taken from
- evolutions' mail component, as it is generally more useful than
- just for evolution itself. Changed to use e-memchunks as well to
- speed it up a little and use less mem.
-
-2000-11-20 Jeffrey Stedfast <fejj@helixcode.com>
-
- * camel-remote-store.c (remote_recv_line): Fixed to return the
- correct bytecount in all cases which is the real fix to
- imap_parse_nstring.
-
- * providers/imap/camel-imap-command.c (imap_read_untagged): Again,
- don't use strlen for the post-data, use 'n'.
-
- * providers/imap/camel-imap-utils.c (imap_parse_nstring): Undo my
- previous temp-fix.
-
-2000-11-20 Not Zed <NotZed@HelixCode.com>
-
- * providers/nntp/camel-nntp-utils.c (get_XOVER_headers): Fixes for
- the summary messageid changes. Hash the messageid and store it.
- (get_XOVER_headers): Use camel_folder_summary_info_new() to create
- the summary item before adding it.
-
- * camel-folder-summary.h (CamelMessageInfo): Changed the
- messgae-id to be an 8 byte md5 hash, and the references list to be
- an array of these.
-
- * providers/local/camel-mh-summary.c (mh_summary_sync_message):
- New function, sync out the message info stuff. Only updates the
- X-Ev header if it can get away with it, otherwise writes out a
- whole new message.
- (mh_summary_sync): Added more functionality. All summary info is
- now written to the X-Ev header, etc, and new messages re-written
- if required during the sync process.
-
- * providers/local/camel-local-folder.c
- (local_set_message_user_flag): Set the XEVCHANGE flag.
- (local_set_message_user_tag): And here too.
-
- * providers/local/camel-local-summary.h: New flag
- CAMEL_MESSAGE_FOLDER_XEVCHANGE to indicate the XEV header has
- probably changed size and needs to be rewritten in whole.
-
- * camel-folder-summary.c (next_uid_string): Want this static, not
- const.
- (message_info_new): Store the references and message-id values as
- 64 bit, binary hashes.
- (message_info_load): fix for message-id/references changes.
- (message_info_save): Likewise.
- (camel_message_info_dup_to): And here.
- (camel_message_info_free): And here too. No longer free
- message_id, and simple free for references array.
- (CAMEL_FOLDER_SUMMARY_VERSION): Bumped file revision.
- (camel_folder_summary_init): Init memchunk allocators to empty.
- (camel_folder_summary_finalize): Free memchunk allocators if
- there.
- (message_info_new): Use the chunk allocator to allocate message
- info's.
- (camel_folder_summary_info_new): New helper to allocate the
- message info, and setup the memchunk if required.
- (content_info_alloc): Likewise for content info's.
- (message_info_load): Use summary_info_new_empty.
- (content_info_new): Use content_info_alloc.
- (content_info_load): "
- (content_info_free): Free the content info as a memchunk.
- (message_info_free): Free everything directly and the base as a
- memchunk, rather than calling camel_message_info_free(), which
- assumes a malloc'd array.
-
- * providers/local/camel-local-summary.c: Include ctype.h, kill a
- warning.
- (local_summary_decode_x_evolution): If we get a NULL message info,
- then dont try and set anything, just check for validity.
- (camel_local_summary_write_headers): New function to write a set
- of headers to an fd.
- (camel_local_summary_check): Added some statistic generation
- stuff for memory profiling.
-
- * providers/local/camel-mbox-summary.c (header_write): Changed to
- use stdoi functions to write out the header to a buffered stream,
- instead of using writev, which is apparently slow (and writing
- each line separately is slow anyway).
- (mbox_summary_sync_full): New implementation. Does things
- differently, doesn't use or require the content info stuff.
- (summary_rebuild): Dont return an error if we start scanning at
- the end of file.
- (mbox_summary_sync_full): If we are not writing out new headers,
- make sure we copy the From line as we go, and update frompos
- appropriately.
- (mbox_summary_sync_full): Always copy the From line from the
- existing one, rather than trying to make one up ourselves.
- (mbox_summary_sync): If we can get by with a quick-sync, then try
- it, if that fails, then try a full sync anyway.
- (mbox_summary_sync_quick): Quick sync. Only update system flags,
- etc.
- (mbox_summary_sync_full): Use the proper local summary encode_xev
- function.
- (header_evolution_decode): Removed, no longer needed.
- (header_evolution_encode): Same.
- (copy_block): No longer needed, removed.
- (header_write): Removed, replaced with
- camel_local_summary_write_headers.
- (mbox_summary_sync_full): Fixed for header_write change.
-
- * camel-mime-parser.c (folder_scan_step): Implement the new
- optional parser state HSCAN_PRE_FROM, that returns the (currently
- unfiltered) input data.
- (folder_scan_drop_step): Do the right thing for the PRE_FROM
- state.
- (camel_mime_parser_scan_from): Update the doco.
- (camel_mime_parser_scan_pre_from): Ok, make this behaviour
- optional, it simplifies a lot of loops that dont otherwise need to
- know about it.
- (folder_scan_step): Made the PRE_FROM state optional.
- (struct _header_scan_state): Made the bool vars 1 bit.
- (folder_pull_part): Free the from_line buffer if it is there.
- (folder_scan_skip_line): Added a new arg, can save the skpped data
- to a byte_array, as we go.
- (folder_scan_step): Fixed calls to skip_line approrpiately. Now
- we save the from line as we parse it.
- (camel_mime_parser_read): New function to read from the mime
- parser buffer directly. Useful if you use the parser to read the
- first/some headers, then need to scan the rest of the data,
- without needing to use a seek(), or allocate your own buffers.
-
- * camel-mime-parser.h (struct _header_state): Added a new parser state,
- pre-from which returns any data found before a from line during
- parsing (all other data can be retrieved by the caller except
- this).
-
-2000-11-17 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-utils.c (imap_parse_nstring): When
- extracting a literal string, capture up until the end of the last
- line - this we we don't lose any data if the byte count is off.
-
- * providers/imap/camel-imap-command.c (imap_read_untagged): Use
- the byte-read count to decrement the number of bytes left to read
- rather than using strlen. Not only does this protect against a DoS
- (embedded NUL chars in the literal string would make strlen
- inaccurate) but it also improves performace a little.
-
- * camel-remote-store.c (remote_recv_line): *Sigh* Return the
- number of bytes read on success rather than 0. Also don't use
- camel_stream_buffer_read_line since we can't get an accurate octet
- count.
-
-2000-11-17 Not Zed <NotZed@HelixCode.com>
-
- * providers/local/camel-local-summary.c (local_summary_add): Clear
- the NOXEV/FLAGGED bits, since we do have an xev header. um m,
- maybe this is right, this assumes a write is following. Maybe
- this should be done in folder::append() instead ...
-
- * camel-stream-buffer.c (camel_stream_buffer_gets): We should
- always terminate the string. No need to check outptr is in range,
- its already been checked.
-
- * providers/local/camel-mbox-summary.c (mbox_summary_sync): When
- we update the summary, do it from mbox_summary->folder_size, not
- the content info endpos (which isn't any good anymore anyway).
-
- * providers/local/camel-mbox-folder.c (mbox_append_message): Set
- the frompos from the current folder size, since summary_add wont
- have initialised it to anything useful.
-
-2000-11-16 Not Zed <NotZed@HelixCode.com>
-
- * providers/local/camel-local-summary.c
- (local_summary_encode_x_evolution): Check the uid string is all
- digits before trying to write a 'standard' x-ev header.
-
- * providers/local/camel-maildir-summary.c
- (camel_maildir_summary_info_to_name): Convert an info into a
- maildir name:info filename.
- (camel_maildir_summary_name_to_info): Convert a name:info filename
- into an info, and tell us if it didn't match it.
- (message_info_new): When creating a new filename, gets its info
- from the flags field. Likewise if creating from an existing file,
- extract the flags.
- (maildir_summary_sync): Remove a small memleak. Also, if our
- flags and that requires a filename change, perform that here.
- (message_info_new): Get the received date from the filename.
- Also, dont overwirte the uid if we have one.
- (maildir_summary_check): Sort the summary in received order before
- completion.
- (maildir_summary_next_uid_string): Test the name for collusions
- before we give it out. Retry, and if that fails, well, I guess we
- collide :(
-
- * providers/local/camel-mbox-folder.c (mbox_lock): Implement mbox
- locking.
- (mbox_unlock): And unlocking.
- (mbox_append_message): Lock the folder for write before doing
- anything.
- (mbox_get_message): Lock the folder for read before doing
- anything.
-
- * providers/local/camel-local-folder.c (camel_local_folder_lock):
- Implement something here. We handle the recursive ability but
- pass the locking to the folder itself.
- (camel_local_folder_unlock): Likewise for unlocking.
- (local_lock): Default - do nothing, return success.
- (local_unlock): Same.
- (local_sync): Changed slightly for locking api changes, and also,
- only lock around the sync process itself.
-
- * camel-lock.c: New file - utility functions for locking using
- different strategies and/or for locking folders safely.
-
- * Makefile.am (libcamel_la_SOURCES): Adde camel-lock.[ch]
-
-2000-11-15 Radek Doulik <rodo@helixcode.com>
-
- * camel-mime-utils.c: mime_guess_type_from_file_name moved back to
- composer as it introduced unwanted VFS dependency
- removed #include <libgnomevfs/gnome-vfs.h>
-
-2000-11-15 Not Zed <NotZed@HelixCode.com>
-
- * providers/Makefile.am: Removed local again, not quite ready.
-
-2000-11-14 Not Zed <NotZed@HelixCode.com>
-
- * camel-folder-summary.c (message_info_new_from_message): Use
- message_info_new to create the summary from headers, instead of
- getting directly from the message.
- (format_recipients): No longer required.
-
- * providers/Makefile.am (SUBDIRS): Added local.
-
-2000-11-11 Not Zed <NotZed@HelixCode.com>
-
- * camel-mime-parser.c (folder_push_part): Make sure 'atleast' is
- at least 1, always. This is possibly a temporary fix for a
- bad failure mode on bad multipart messages.
- (folder_scan_content): Go until inend, not inend+1. Changed the
- continuation and retry logic to be simpler and more robust. If we
- can't find a marker within
- the atleast we need, just set it to 1, and try again, rather than
- just going to the next smaller limit (boundary check checks the
- length anyway).
- (header_append): streamline the empty line case. And strip
- trailing \r's if there are any (\n's already stripped).
- (folder_scan_header): Reordered and cleaned up a lot. Check for
- continuation only once, and compress lwsp then. Assume the header
- buffer already has end of line's stripped, and simplify some things:
- Only check for end of headers once and easier.
- Dont check to remove end of line character
- Dont bother testing inptr-start if we get a boundary match - it is
- always zero.
- (folder_scan_header): Removed the unused part variable, and a few
- pointless assignments.
- (folder_scan_header): Change the end limit to be 1 higher, to make
- sure we get all content.
- (folder_scan_content): And here too.
- (folder_scan_header): Killed a warning.
- (folder_push_part): Removed a bad comment. Actually
- boundarylenfinal can be zero for a new message not in a
- multipart. So we fix that here.
-
-2000-11-09 Not Zed <NotZed@HelixCode.com>
-
- * camel-mime-utils.c (header_decode_param_list): Renamed from
- header_param_list_decode.
- (header_param_list_decode): New external function to decode a
- parameter list.
- (header_param_list_format_append): Made public.
- (header_param_list_format): Another new public helper function for
- formatting just a param list.
-
- * camel-folder-summary.c (next_uid_string): Default implementation
- is the same as before.
- (camel_folder_summary_class_init): And set it up.
-
- * camel-folder-summary.h: Make next_uid_string a virtual function.
-
- * camel-folder.c (camel_folder_change_info_changed): New function
- to return true if the changeset contains any changes.
-
-2000-11-14 Jeffrey Stedfast <fejj@helixcode.com>
-
- * camel-stream.c (camel_stream_printf): Don't cast an int to a
- ssize_t.
-
-2000-11-10 Dan Winship <danw@helixcode.com>
-
- * providers/mbox/camel-mbox-summary.c
- (camel_mbox_summary_build_from): put a space before a single-digit
- day of the month since it seems some mailers are fantastically
- picky about this. (bugs.gnome.org #27232)
-
-2000-11-10 Radek Doulik <rodo@helixcode.com>
-
- * camel-mime-utils.c (header_msgid_generate): fix ids ending with '.'
-
-2000-11-09 Dan Winship <danw@helixcode.com>
-
- * providers/imap/camel-imap-auth.c (imap_try_kerberos_v4_auth):
- Fix error handling. (Only send a "*" to bail out of authentication
- if the server hasn't already bailed on us.)
-
-2000-11-08 Radek Doulik <rodo@helixcode.com>
-
- * camel-mime-utils.c (mime_guess_type_from_file_name): new
- function, moved from composer
-
-2000-11-08 Not Zed <NotZed@HelixCode.com>
-
- * camel-mime-message.c (find_best_encoding): Keep track of the
- caller bestenc flags that make sense.
-
- * camel-mime-filter-bestenc.c (filter): Added code to detect when
- we have "^From " lines in the sequence of text.
- (camel_mime_filter_bestenc_get_best_encoding): Added a new flag
- CAMEL_BESTENC_NO_FROM: if set, it will not allow any lines
- matching "^From " to appear in the output - currently forcing
- base64 encoding to achieve this.
-
- * camel-mime-parser.c (folder_scan_step): Call
- camel_mime-filter_complete() once we're done, rather than
- filter_filter().
- (folder_scan_content): Some fixes for state changing; so that when
- we do find another boundary it is properly flagged. Since we
- strip the last \n off all data, we must take that into account
- too. Sigh. Fixes a rather nasty set of bugs where multipart
- messages could start including following messages as parts, etc.
- (struct _header_scan_stack): Added new parameter,
- boundarylenfinal, which holds the length of the final boundary, if
- it is different (e.g. for From lines, whihc aren't)
- (folder_scan_step): Setup teh boundarylenfinal value when creating
- a new boundary.
- (folder_scan_content): Hmm, if we hit the end-of-buffer sentinal,
- reset the scanner back to leave 'atleast' chars in the buffer
- still, dump that content, and retry again. Stops us losing a
- check for a boundary on some data we haven't really looked at yet!
- (folder_scan_content): Use boundarylenfinal to calculate
- 'atleast'.
- (folder_scan_header): And here too.
- (folder_boundary_check): Use the atleast value directly, dont
- truncate it. Use the boundarylen/boundarylenfinal values directly
- too.
- (struct _header_scan_stack): Add an atleast parameter to cache the
- atleast info.
- (folder_push_part): Determine/set 'atleast', every time we add a
- new part.
- (folder_scan_header): Get the cached atleast info from the current
- part.
- (folder_scan_content): And here too.
- (folder_scan_header): Fix a problem where a part starting with
- " text" would be interpreted as a followon header wrongly.
-
- * camel-mime-filter-charset.c (complete): Add some assertions to
- find a bug.
-
-2000-11-07 Ettore Perazzoli <ettore@helixcode.com>
-
- * camel-service.c (get_name): Strdup the "???" string you return,
- so that the expected semantics for `::get_name()' is respected.
-
-2000-11-07 Dan Winship <danw@helixcode.com>
-
- * camel-stream-filter.c (d): Kill debugging, as it causes lots of
- evolution-mail spewage.
-
-2000-11-07 Not Zed <NotZed@HelixCode.com>
-
- * camel-mime-filter-bestenc.c (complete): Implement a complete()
- function, now we need one.
- (filter): Upgraded to match rfrc2045 properly. Checks also for
- length of line and valid CRLF sequences.
- (camel_mime_filter_bestenc_get_best_encoding): Do the work of
- working out what is the best encoding given what we found about
- the stream.
-
- * camel-mime-part.c (camel_mime_part_encoding_to_string): Use a
- lookup table to get the encoding naem, and add the binary type.
- (camel_mime_part_encoding_from_string): Likewise for the reverse.
-
- * camel-mime-part.h: Added the binary encoding type, see rfc2045.
-
- * camel-mime-utils.c (header_param_list_format_append): Dont put a
- space before ;'s in parameter lists, makes them more
- readable/consistent.
-
- * camel-mime-message.c (multipart_has_8bit_parts): Cleaned up the
- old stuff, well removed it.
- (camel_mime_message_set_best_encoding): Added another argument
- that lets you select what you want to set the best of. i.e. for
- smtp transport we only need 7 bit, and dont need to optimise the
- charset (although of course, we should always).
- (find_best_encoding): Implement this feature, if we are not
- getting the best charset, use the one we have.
- (best_encoding): Set the charset on the part appropriately. Sigh,
- the interfaces for this are nonexistant.
- (find_best_encoding): Tell the bestenc filter that lf should be
- treated as crlf for the purposes of determining encodings.
-
-2000-11-06 Not Zed <NotZed@HelixCode.com>
-
- * camel-charset-map.c (camel_charset_init): Init function for an
- iterative charset determinator.
- (camel_charset_step): Iterate another buffer.
- (camel_charset_mask): Removed, since it couldn't have worked.
- (camel_charset_best): Use the iterative interface to do the work.
- (camel_charset_best_name): Get the best name for a charset so far.
-
- * camel-mime-filter-bestenc.c: New class, a stream
- filter that can be used to memory-efficiently determine the best
- encoding and/or charset to use for a given stream of bytes.
-
- * Makefile.am (libcamelinclude_HEADERS): Added stream-null*.
- (libcamel_la_SOURCES): Added bestenc*
-
- * camel-stream-null.c: New class, a null-stream, that always
- succeeds, and never has any contents.
-
- * camel-stream.c: Minor pointless changes. Was going to do
- something else but changed my mind. Added trivial default
- implementations for all callbacks.
-
- * camel-mime-message.h: Cleaned up some old cruft.
-
- * camel-folder-summary.c (camel_folder_summary_format_address):
- address_list_format() no longer encodes, so we dont need to decode
- it.
-
- * camel-address.c (camel_address_unformat): New function, attempts
- to reverse the formatting process on display addresses.
- (camel_address_length): New function to get the number of
- addresses, without having to peek the structure.
-
- * camel-mime-message.c (camel_mime_message_set_from): Fix a typo.
- (camel_mime_message_finalize): Only unref from/reply_to if we have
- it.
- (camel_mime_message_set_recipients): New function - set the
- recipients as a CamelInternetAddress. This function effectively
- deprecates the older recipient setting functions.
- (camel_mime_message_add_recipient): What the hell, i'll bite the
- bullet. Terminate this function. The old api was ambiguious and
- inefficient and didn't work right anyway.
- (camel_mime_message_remove_recipient_address): And this one.
- (camel_mime_message_remove_recipient_name): And this one too.
- (camel_mime_message_set_recipients): If we set an empty header,
- then remove it from the header list. Allow a null receipient
- object to clear a header.
- (camel_mime_message_set_from): Likewise, if setting an empty from
- address.
- (camel_mime_message_encode_8bit_parts): Eeek!!
- camel_stream_mem_new_with_byte_array owns the byte_array we give
- it, so make sure we dont free any of it!
- (camel_mime_message_encode_8bit_parts): Infact, i'll just rewrite
- the whole lot, its a bit of a mess. Should really rename it and
- make it a little more useful too, lets see ...
- (best_encoding): This has a string interface? Oh boy.
- (camel_mime_message_foreach_part): New experimental function to
- iterate over all message parts. Might not remain.
- (camel_mime_message_has_8bit_parts): New implementation using
- foreach_part. Fixed a couple of problems.
- (find_best_encoding): New function, that finds the best encoding
- for a given part (will probably be moved to camel-mime-part), and
- also the best charset to use if it is a text part. Since one
- affects the other it is a two pass process, but uses streams and
- not memory to achieve this.
- (camel_mime_message_set_best_encoding): Uses the function above to
- configure an entire message for the best encoding possible given
- transport constraints.
- (camel_mime_message_encode_8bit_parts): Reimplemented to use the
- function above to perform the work.
-
- * camel-internet-address.c
- (camel_internet_address_format_address): Dont put <> around a lone
- address with no real name.
- (camel_internet_address_encode_address): Similarly.
- (internet_decode): Actually return the count of decoded addresses.
- (internet_unformat): Implement the unformatting routine.
-
-2000-11-05 Not Zed <NotZed@HelixCode.com>
-
- * providers/smtp/camel-smtp-transport.c (_send_to): Changed to get
- the internetaddress directly, rather than having to parse it
- itself.
-
- * camel-address.c (camel_address_format): Added a new function
- which will format address, suitable for display.
- (camel_address_cat): Concatentate 1 camel address onto another.
- It is upto the caller to ensure the addresses are of compatible
- types.
- (camel_address_new_clone): New function to create a new address by
- copying an existing one of the same type.
- (camel_address_copy): New helper function to copy an address.
-
- * camel-mime-message.h (struct _CamelMimeMessage): Removed cached
- copy of date string.
- (struct _CamelMimeMessage): Added date_received info.
-
- * camel-mime-message.c (camel_mime_message_get_date_string):
- Removed. Nothing uses it anyway, and it is redundant.
- (camel_mime_message_finalize): No more date_str.
- (camel_mime_message_init): No more date_str, initialise
- date_received*
- (write_to_stream): Change the check for a date header.
- (process_header): No longer track the date_str.
- (camel_mime_message_get_received_date): Removed. totally invalid
- anyway.
- (camel_mime_message_get_sent_date): Removed. Redundant. The only
- 'date' is the sent date, the received date is just made up.
- (camel_mime_message_get_date): Args changed to be more consistent
- with utility functions.
- (camel_mime_message_get_date): Dont set the date when we're asked
- for it (if its not set by the time its written, it'll be set
- then).
- (camel_mime_message_get_date_received): Actually do 'the right
- thing' here, if we have a received header, use that to determine
- the received date. And return the data in the same format as
- get_date.
- (camel_mime_message_set_from): Changed the api to better match
- what we should be doing. Pass a camelinternetaddress, etc.
- (camel_mime_message_set_reply_to): Cahnged similarly to take an
- internetaddress.
- (camel_mime_message_get_reply_to): Likewise.
- (camel_mime_message_finalize): Unref the from/reply_to objects.
- (format_address): Removed, no longer needed.
- (process_header): Changed to store the from/reply_to as
- internetaddress's.
- (write_to_stream): Set the from header directly to empty, if we
- dont have one. Maybe we should just abort, and/or create one
- based on the current user.
-
- * camel-mime-utils.c (header_address_list_format): Renamed to
- header_address_list_encode, which is what it is actually doing.
- (header_address_list_format_append): Similarly.
- (encoding_map[]): Removed, no longer used.
- (header_address_list_encode_append): Take another arg, do we
- encode the address (for internet), or not (for display - utf8
- only).
- (header_address_list_format): Re-added this function, but now it
- generates a display version only. Surprise surprise, that is all
- anythign needs to generate anyway. Sigh.
-
- * camel-internet-address.c (camel_internet_address_get): Return
- false if we get an invalid index only.
- (camel_internet_address_encode_address): Helper function to encode
- a single address for mailing.
- (internet_encode): Use the above function to format it.
- (camel_internet_address_format_address): Format a single address
- for display.
- (internet_format): Implement the display version.
- (camel_internet_address_class_init): Init the internet_format
- virtual function.
- (internet_cat): Implement virtual function to concatenate
- addresses.
-
- * camel-folder-summary.c
- (camel_folder_summary_info_new_from_header): new function, only
- build the summary info, dont add it.
- (camel_folder_summary_info_new_from_parser): Likewise, for new
- info from parser.
- (camel_folder_summary_add_from_parser): Cahnged to call function
- above to build info.
- (camel_folder_summary_add_from_header): Changed to call function
- above, to build info.
- (camel_folder_summary_info_free): New function to free the summary
- message info.
- (camel_folder_summary_clear): Changed to clal above to free info.
- (camel_folder_summary_remove): Likewise.
- (camel_folder_summary_add): Cleaned up the clashing uid
- re-assignment logic a little bit.
- (camel_folder_summary_decode_uint32): Fixed a typo, 01 != -1.
- (camel_folder_summary_decode_time_t): Return -1 on error.
- (camel_folder_summary_encode_off_t): New function to encode an
- off_t type.
- (camel_folder_summary_decode_off_t): And likewise for the reverse.
- (CAMEL_FOLDER_SUMMARY_VERSION): Bumped the summary version, since
- we're now encoding time/off_t's right.
- (summary_header_save): Use time_t encoder to save the timestamp.
- (summary_header_load): Likewise for decoding the timestamp.
- (content_info_load): Decode off_t types directly, now we can.
- (content_info_save): And likewise for encoding.
- (camel_folder_summary_add_from_message): New function, create a
- summary item from an existing message and add it.
- (camel_folder_summary_info_new_from_message): New function, create
- a summary item from an existing message.
- (summary_build_content_info_message): New function to do the dirty
- work of building the conent info/indexing, from a message source.
- (format_recipients): Format an internetaddress suitable for the
- summary.
- (message_info_new_from_message): Build a new summary item from a
- mime message.
- (content_info_new_from_message): Build a new conent info from a
- mime part.
- (camel_folder_summary_class_init): Init the new class functions.
- (message_info_new_from_message): Fixed for message api change.
-
- Added documentation to the functions.
-
-2000-11-03 Radek Doulik <rodo@helixcode.com>
-
- * camel-mime-utils.c (header_msgid_generate): new function,
- generates simple message/content id
-
-2000-11-04 Not Zed <NotZed@HelixCode.com>
-
- * camel-mime-part-utils.c
- (camel_mime_part_construct_content_from_parser): Set the
- preface/postface from the parser into the multipart object.
-
- * camel-multipart.c (camel_multipart_set_postface): Function to
- set the postface text on a multipart.
- (camel_multipart_set_preface): Similarly for preface text.
-
- * camel-mime-parser.c (folder_scan_content): If we scan until a
- boundary, then we do not include the \n that starts the boundary
- line in the content.
- (struct _header_scan_stack): Added a ByteArray to store the
- multipart pre/post-text as we're scanning.
- (folder_pull_part): Free pre/posttext if they are allocated.
- (folder_scan_step): Build into the pre/posttext arrays as we
- encounter data.
- (camel_mime_parser_preface): REturn the multipart preface text, if
- there is any scanned.
- (camel_mime_parser_postface): Likewise for postface text.
- (byte_array_to_string): helper function for above.
-
- * providers/mbox/camel-mbox-folder.c (mbox_append_message): Change
- the from line to be "\nFrom ..." always, so no need to
- check/append a \n to messages.
- (mbox_append_message): Open the output stream with append mode
- [assuming this is more efficient than seeking to the end]
- And dont prepend \n on the From line if its the first in the
- mbox.
- (mbox_append_message): Pass the offset of the real start of the
- "From " line when we perform the update (which may != 'seek')
-
- * camel-mime-filter-charset.c (complete): Removed the terminating
- NUL 'fix'.
-
- * camel-stream-filter.c (do_read): Added some debug.
- (do_flush): And here.
- (do_write): And here too.
- (do_write): ARGH!!! ARGH! Ok, so the filter stream was writing a
- different number of bytes than the requester was asking it to
- write (because of filtering, of course!). So instead of returning
- the true number of written bytes, we'll return what they asked us
- to write - unless there is an error in which case we return -1.
-
- * camel-mime-utils.c (base64_encode_close): Sigh, forgot to make
- it unsigned. I think this is actually a gcc bug as (48 >> 2)
- somehow ended up negative, when it obviously should not, even if
- the data load was signed.
-
-2000-11-03 Jeffrey Stedfast <fejj@helixcode.com>
-
- * camel-url.c: Undo my incorrect fix - I misunderstood danw -
- sorry!
-
-2000-11-03 Dan Winship <danw@helixcode.com>
-
- * providers/pop3/camel-pop3-store.c (camel_pop3_store_expunge):
- Unbreak this.
-
-2000-11-03 Jeffrey Stedfast <fejj@helixcode.com>
-
- * camel-url.c (camel_url_to_string): If show_pass, then base64 the
- password before writing it to the output string.
- (camel_url_new): Assume password has been base64 encoded and
- decode accordingly.
-
-2000-11-03 Dan Winship <danw@helixcode.com>
-
- * camel-provider.h: Add an "url_flags" field to CamelProvider.
- Move the CAMEL_SERVICE_URL_* defines here and remove the SERVICE_
- part of the name.
-
- * camel-service.h: Remove CAMEL_SERVICE_URL_* flags and
- service->url_flags field.
-
- * camel-service.c (check_url, get_path): Get URL flags from
- service->provider, update for changed flag names.
-
- * providers/*/camel-*-provider.c: Add URL flags to provider
- structures.
-
- * providers/*/camel-*-{store,transport}.c, camel-remote-store.c:
- Remove service->url_flags initialization.
-
-2000-11-02 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-store.c (get_folder_info): Quote
- foldernames when sending to the IMAP server because the folder
- name might contain spaces.
-
-2000-11-02 Not Zed <NotZed@HelixCode.com>
-
- * Merged in camel-incremental-branch.
-
-2000-11-01 Dan Winship <danw@helixcode.com>
-
- * providers/imap/camel-imap-store.c (get_folder_info): Remove old
- subbed folders from hash table after freeing them.
-
- * providers/imap/camel-imap-folder.c (imap_get_full_name): Deal
- correctly with namespace == ""
-
-2000-11-01 Gediminas Paulauskas <menesis@delfi.lt>
-
- * camel-charset-map.c, camel-charset-map-private.h: synced all charsets
- with ones found in libunicode. Just include more "iso/*.h" and rebuild
- ...private.h with this.
-
-2000-10-31 Dan Winship <danw@helixcode.com>
-
- * camel-service.c (service_disconnect): Add a new argument, clean,
- that says whether or not to try to disconnect cleanly.
-
- * camel-remote-store.c (remote_send_string, remote_send_stream,
- remote_recv_line): disconnect uncleanly on failure to prevent
- infinite loops when providers would normally send commands from
- disconnect(). Remove some unneeded CamelException goo.
-
- * providers/smtp/camel-smtp-transport.c (smtp_disconnect):
- * providers/pop3/camel-pop3-store.c (pop3_disconnect):
- * providers/nntp/camel-nntp-store.c (nntp_store_disconnect):
- * providers/imap/camel-imap-store.c (imap_disconnect): Don't send
- QUIT/LOGOUT if !clean.
-
-2000-10-30 Dan Winship <danw@helixcode.com>
-
- * providers/imap/camel-imap-auth.c: New file with code for IMAP
- authentication mechanisms. (Currently just krb4, and without
- integrity/privacy protection).
-
- * providers/imap/Makefile.am: Add camel-imap-auth.[ch] and krb4
- CFLAGS/LDFLAGS
-
- * providers/imap/camel-imap-store.c (connect_to_server): Split out
- from imap_connect. Just does the basic connect and CAPABILITY
- check. Redo the CAPABILITY code more robustly.
- (query_auth_types_connected): Do this right rather than punting to
- query_auth_types_generic. Check for KERBEROS_V4 if compiled with
- krb4 support.
- (query_auth_types_generic): Mention KERBEROS_V4 if compiled with
- krb4 support.
- (imap_connect): Use connect_to_server().
-
- * camel-mime-utils.c (base64_encode_step, base64_encode_close):
- Take an additional argument, "break_lines", saying whether or not
- to add '\n's to the output.
-
- * camel-multipart.c (set_boundary):
- * camel-mime-filter-basic.c (filter, complete): Update for base64
- api change.
-
-2000-10-30 Peter Williams <peterw@helixcode.com>
-
- * providers/imap/camel-imap-store.c (unsubscribe_folder): Correct
- parameters to g_hash_table_lookup_extended.
-
-2000-10-29 Dan Winship <danw@helixcode.com>
-
- Improved IMAP namespace handling: leave the namespace in the
- folder names rather than constantly prepending it and stripping it
- off. Also some subscription fixes.
-
- * camel-store.c (camel_folder_info_build): Fix for the case where
- @top isn't in @folders.
-
- * providers/imap/camel-imap-folder.c (camel_imap_folder_new): Add
- a "short_name" argument rather than figuring it out ourselves.
- (imap_get_full_name): Implementation of CamelFolder::get_full_name
- that strips off namespace so the user doesn't have to see it.
- (imap_append_message, imap_copy_message_to, imap_move_message_to):
- Use folder->full_name rather than calling
- camel_imap_store_get_folder_path.
-
- * providers/imap/camel-imap-utils.c (imap_parse_list_response):
- Update this: make @flags a bitmask and @sep a char rather than a
- string. Make all of the out arguments optional. Handle literals in
- the server response.
-
- * providers/imap/camel-imap-store.c (imap_connect): Do a better
- job of getting the correct dir_sep for the namespace we're using.
- Construct a base_url here that will be used by get_folder_info.
- (camel_imap_store_folder_path): Removed
- (imap_folder_exists): Add an argument to return the short name of
- the folder (parsed out of the LIST response). Update for
- imap_parse_list_response change.
- (get_folder): Update for the various other changes.
- (get_folder_info): Update for the various other changes. Be more
- consistent about the returned layout: put everything underneath
- the "namespace" directory, including INBOX, even if it doesn't
- belong there. Don't destroy the list of subscribed folders until
- we've actually gotten the new list.
- (folder_subscribed, subscribe_folder, unsubscribe_folder): Use
- folder_name directly rather than camel_imap_store_folder_Path.
-
- * providers/imap/camel-imap-command.c (camel_imap_command): Update
- for folder name changes.
-
-2000-10-29 Dan Winship <danw@helixcode.com>
-
- * camel.h: Remove md5-utils.h include since it's not part of Camel
- any more.
-
- * camel-charset-map.c: Kill some warnings.
-
- * providers/nntp/camel-nntp-grouplist.c
- (camel_nntp_get_grouplist_from_file, camel_nntp_grouplist_save):
- Clean up warnings about time_t casts.
-
- * providers/smtp/camel-smtp-transport.c: Remove unused md5-utils.h
- include.
-
- * providers/pop3/camel-pop3-store.c: Undefine the "_" macro
- defined by krb4's des.h when compiling with krb support.
- Fix md5-utils.h include.
-
-2000-10-27 Dan Winship <danw@helixcode.com>
-
- * camel-mime-utils.c (header_param_list_format_append): Only quote
- Content-type parameters when the quoting is mandatory, and deal
- with embedded quotes/backslashes when quoting.
-
-2000-10-27 JPR <jpr@helixcode.com>
-
- * providers/pop3/Makefile.am: Tidy up build
-
- * providers/smtp/Makefile.am: ditto
-
- * Makefile.am: Move md5-utils.[hc] to e-util because the
- addressbook is going to use md5 hashes for pilot syncing.
- Maybe the calendar conduits as well because this is a good idea
- Chris had.
-
-2000-10-26 Kjartan Maraas <kmaraas@gnome.org>
-
- * camel-exceptions-list.def: Add newline to kill warnings.
-
-2000-10-25 Dan Winship <danw@helixcode.com>
-
- * providers/imap/camel-imap-store.c (get_folder_info): Fix folder
- listing code infinite loop.
-
- * camel-store.h: Add a "parent" field to CamelFolderInfo.
-
- * camel-store.c (camel_folder_info_build): Deal with "parent"
- (camel_store_folder_subscribed, camel_store_subscribe_folder,
- camel_store_unsubscribe_folder): Add g_return_if_fails checking
- that the folder supports subscriptions.
-
- * providers/imap/camel-imap-store.c (folder_subscribed,
- subscribe_folder, unsubscribe_folder): Remove "+ 1"s since the
- mail subscribe UI won't prepend / to the folder names now.
- (get_folder_info): Clear the "parent" field of the folderinfos
- when removing an empty top level.
-
- * providers/nntp/camel-nntp-store.c (nntp_store_folder_subscribed,
- nntp_store_subscribe_folder, nntp_store_unsubscribe_folder):
- Remove "+ 1"s since the mail subscribe UI won't prepend / to the
- folder names now.
-
-2000-10-24 Chris Toshok <toshok@helixcode.com>
-
- * providers/imap/camel-imap-store.h: add subscribed_folders.
-
- * providers/imap/camel-imap-store.c (camel_imap_store_class_init):
- fill in vtable entries for subscription functions.
- (camel_imap_store_finalize): new function, so we can free up our
- subscribed_folders hashtable.
- (camel_imap_store_init): set CAMEL_STORE_SUBSCRIPTIONS in the
- CamelStore flags, and create our subscribed_folders hashtable.
- (camel_imap_store_get_type): camel_imap_store_finalize is our
- finalize function.
- (get_folder_info): if we're looking at subscribed_only, clear out
- the subscribed_folders hashtable, use LSUB instead of LIST, and
- insert folder paths (prepended by their namespace if there is one)
- into subscribed_folders. INBOX subscription support needs work,
- since we always show it, regardless of it's subscribed state.
- (folder_subscribed): new function. just look up the folder_path
- in the hashtable.
- (subscribe_folder): new function. use the imap SUBSCRIBE command,
- and if successful add it to the hashtable.
- (unsubscribe_folder): new function. use the imap UNSUBSCRIBE
- command, and if successful remove it from the hashtable.
-
-2000-10-24 Dan Winship <danw@helixcode.com>
-
- * providers/imap/camel-imap-store.c (get_folder_info): Fill in the
- message_count and unread_message_count flags (if !fast).
-
-2000-10-23 Dan Winship <danw@helixcode.com>
-
- * camel-object.h: #include gnome-i18n.h (and gnome-defs.h since
- the former depends on it.)
-
- * *: Add lots of _() and N_().
-
-2000-10-23 Chris Toshok <toshok@helixcode.com>
-
- * providers/nntp/Makefile.am (libcamelnntpinclude_HEADERS): add
- camel-nntp-types.h.
-
-2000-10-23 Dan Winship <danw@helixcode.com>
-
- * providers/imap/camel-imap-command.c (imap_read_untagged): Fix a
- "how could this have been working before" memory overrun bug
- found by Vlad.
-
- * camel-op-queue.[ch], camel-thread-proxy.[ch]: These should have
- gone away a long time ago.
-
-2000-10-20 Chris Toshok <toshok@helixcode.com>
-
- * providers/Makefile.am (SUBDIRS): re-enable the nntp provider.
-
-2000-10-20 Chris Toshok <toshok@helixcode.com>
-
- * providers/nntp/camel-nntp-store.c (build_folder_info): add
- function to build a tree from the nntp group names (using '.' as a
- heirarchy separator.) #ifdefed INFO_AS_TREE only.
- (build_folder_info_from_grouplist): if INFO_AS_TREE is selected,
- call build_folder_info instead of appending a new CamelFolderInfo
- to our list.
- (ensure_news_dir_exists): use e_mkdir_hier instead of failing if a
- parent directory (~/evolution/news generally) isn't there.
-
-2000-10-19 Chris Toshok <toshok@helixcode.com>
-
- * camel-folder-search.c: #include <sys/types.h> before <regex.h>
-
-2000-10-19 Dan Winship <danw@helixcode.com>
-
- * providers/imap/camel-imap-utils.c (imap_parse_list_response):
- Fix a bug with "INBOX" (or anything else with NIL hierarchy
- separator) as the namespace.
-
- * providers/imap/camel-imap-folder.c (imap_refresh_info): Emit
- message_changed and folder_changed as appropriate.
-
-2000-10-19 Dan Winship <danw@helixcode.com>
-
- * camel-folder.c (camel_folder_refresh_info): Update comment here
- so refresh_info isn't just for reconnects any more. Make the
- default implementation a no-op rather than an error.
-
- * providers/nntp/camel-nntp-folder.c: Move refresh_info impl into
- camel_nntp_folder_new, since it would have leaked memory and not
- done anything useful if it was called later.
-
- * providers/mbox/camel-mbox-folder.c: Remove no-longer-necessary
- refresh_info impl.
-
- * providers/imap/camel-imap-folder.c (camel_imap_folder_changed):
- Update imap_folder->exists, but don't actually load the new
- messages. This is a temporary workaround to deal with the IMAP
- provider stealing the message list focus at annoying times.
- (imap_copy_message_to, imap_move_message_to): Emit a
- folder_changed by hand, for now.
-
-2000-10-19 Ettore Perazzoli <ettore@helixcode.com>
-
- * providers/imap/Makefile.am (libcamelimapinclude_HEADERS): Add
- `camel-imap-stream.h'.
-
- * Makefile.am (libcamelinclude_HEADERS): Add `camel-charset-map.h'
- and `camel-charset-map-private.h'.
-
-2000-10-18 Jeffrey Stedfast <fejj@helixcode.com>
-
- * camel-mime-part.c (camel_mime_part_set_description): The correct
- fix this time - the description should be encoded here and not in
- the camel-medium layer.
-
-2000-10-30 Not Zed <NotZed@HelixCode.com>
-
- * camel-folder.c (camel_folder_change_info_add_update): Fixed the
- changeset logic, which was completely wrong.
-
-2000-10-27 Not Zed <NotZed@HelixCode.com>
-
- * camel-mime-utils.c (quoted_encode_step): Removed is_blank() stuff.
- (header_decode_init): When we set the 'space' bit, dont clear all
- the others.
- (quoted_encode): Put back the safemask. Yes we totally need it,
- see rfc 2047 section 5, parts (1) and (3).
- (CHARS_PSPECIAL): Remove '=' and '_' from the list of allowed
- characters (this is an allowed list, not a not-allowed list, like
- the ESPECIAL).
- (camel_mime_special_table): Updated for fixes to definitions.
- (CHARS_ESPECIAL): Added '_' to list of characters that should be
- encoded.
-
-2000-10-26 Not Zed <NotZed@HelixCode.com>
-
- * providers/mbox/camel-mbox-summary.c (camel_mbox_summary_update):
- Use the new camel_folder_change_info_* stuff to build the update
- diff, rather than doing it ourselves.
-
- * camel-folder.c (camel_folder_change_info_add_source): Add a
- 'source' list, used to create change lists.
- (camel_folder_change_info_add_source_list): Add a list of uid's,
- convenience function.
- (camel_folder_change_info_add_update): Add a uid to the list of
- uid's in the new updated list.
- (camel_folder_change_info_add_update_list): Add a bunch of uid's
- at once for the same purpose.
- (camel_folder_change_info_build_diff): Take the source list, the
- update list, and find the differences, building on the added or
- removed list as appropriate.
-
-2000-10-20 Not Zed <NotZed@HelixCode.com>
-
- * providers/mbox/camel-mbox-summary.c (removed_uids): REnamed from
- add_uid.
- (camel_mbox_summary_update): Oops, fix the reversed logic for
- determining the uid changesets.
-
- * camel-folder.c (message_changed): Oops, we want to change the
- uid, not add it.
-
-2000-10-19 Not Zed <NotZed@HelixCode.com>
-
- * providers/mh/camel-mh-summary.c (camel_mh_summary_sync): Added a
- change list argument, and add expunged uid's to it.
-
- * providers/mh/camel-mh-folder.c (mh_init): Setup the change list.
- (mh_finalize): And free it.
- (mh_sync): Track changes, and send a folder_changed signal as
- appropriate.
- (mh_expunge): Likewise.
- (mh_append_message): Add the new uid to the change list and
- trigger a folder_changed event.
-
- * providers/mbox/camel-mbox-folder.c (camel_mbox_folder_new):
- Setup a mbox list of changes structure.
- (mbox_finalize): And free it.
- (mbox_expunge): Include the change list with the folder_changed
- event, and clear it off.
- (mbox_sync): And the same for when we are just syncing the folder.
- (mbox_append_message): And do the same here, after we've updated
- the folder.
-
- * providers/mbox/camel-mbox-summary.c
- (camel_mbox_summary_build_from): Use gmtime_r to get the time
- thread-safely.
- (camel_mbox_summary_sync): Added a changeinfo argument. Add any
- removed or changed messages to the changelists as appropriate.
- (camel_mbox_summary_update): Added a changeinfo argument.
- Genereate a list of added/removed uid's based on the difference
- before and after rebuilding the summary.
-
- * camel-folder.c (camel_folder_change_info_new):
- (camel_folder_change_info_add_uid):
- (change_info_add_uid):
- (camel_folder_change_info_remove_uid):
- (camel_folder_change_info_change_uid):
- (change_info_clear):
- (camel_folder_change_info_clear):
- (camel_folder_change_info_free):
- (change_info_cat):
- (camel_folder_change_info_cat): Bunch of utility functions for
- working with change info lists.
- (camel_folder_init): Init the change info list.
- (camel_folder_finalize): And free it.
- (thaw): Changed to pass through a list of changes, or to get the
- changed message uids from the camelfolderchangeinfo struct, and
- reset it.
- (folder_changed): Add the changed lists to the frozen change list
- if we are frozen.
- (message_changed): Add the message to the changed list if we are
- in the frozen state.
-
- * camel-folder.h (CamelFolderChangeInfo): New structure to hold
- information for the folder_changed event.
-
-2000-10-18 Ettore Perazzoli <ettore@helixcode.com>
-
- * camel-mime-filter-charset.c (complete): Put a zero at the start
- of the outbuf.
-
-2000-10-18 Not Zed <NotZed@HelixCode.com>
-
- * camel-mime-part.c (add_header): No, we must not encode the
- headers here. These interfaces ARE raw interfaces as they are
- defined in camel_medium. Also removed a bogus/meaningless FIXME.
- (set_header): Likewise here, we must not.
- (process_header): Removed another bogus comment.
-
- * camel-object.c (shared_is_of_type): Comment out the spitting of
- a big warning when we're trying to determine types from code.
-
- * providers/mbox/camel-mbox-summary.c
- (message_info_new_from_parser): Only call ibex funcitons if we
- have an index.
-
- * providers/mh/camel-mh-summary.c (camel_mh_summary_add): Only
- call ibex functions if we have an index.
- (remove_summary): Likewise.
- (camel_mh_summary_check): Likewise.
-
- * providers/nntp/camel-nntp-store.c (nntp_store_get_folder):
- get_folder -> flags argument.
-
- * providers/vee/camel-vee-store.c (vee_get_folder): create->flags.
-
- * providers/pop3/camel-pop3-store.c (get_folder): Changed create
- -> flags.
-
- * providers/imap/camel-imap-store.c (get_folder): Added flags
- argument.
-
- * providers/mh/camel-mh-folder.c (camel_mh_folder_new): Added
- flags argument, and fixed code appropriately.
-
- * providers/mh/camel-mh-store.c (get_folder): Added flags argument.
-
- * camel-folder-search.c (message_body_contains): Perform a regex
- match on the contents of messages. This wont quite work yet as
- message contents are encoded when written to a stream.
- (build_match_regex): Converts a number of strings into a regex
- matching pattern, escaping special chars.
- (match_message): match a single message from a folder, by uid.
- Slow.
- (search_body_contains): Changed to support matching where no index
- is supplied. Matches are performed by retrieving message
- contents, etc.
- () WTF? camel should not be including any widget headers.
-
- * providers/mbox/camel-mbox-folder.c (camel_mbox_folder_new):
- Added flags argument.
- (mbox_refresh_info): Changed into a NOP, the refresh info code
- moved into the new function.
- (camel_mbox_folder_new): If we have an index requested, build one,
- otherwise, remove an old one, or just dont do anything.
-
- * providers/mbox/camel-mbox-store.c (get_folder): Changed create
- to flags, changed code to suit.
-
- * camel-store.c (camel_store_get_folder): Changed create to flags.
- (get_folder_internal): And here.
- (get_folder): And here too.
-
- * camel-store.h (camel_store_get_folder): Change the create
- argument to be a flags argument.
-
-2000-10-17 Dan Winship <danw@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (imap_refresh_info): Remove
- cached info at the end of the summary when the folder shrinks
- between sessions. Also remove an untrue comment.
- (camel_imap_folder_new): Move the summary creation to after the
- folder selection again, since it depends on the uidvalidity
- having been set.
-
- * providers/imap/camel-imap-store.c (get_folder): Fix up
- summary_file to not include the namespace twice.
-
-2000-10-17 Jeffrey Stedfast <fejj@helixcode.com>
-
- * camel-mime-part.c (set_header): Encode the header value.
- (add_header): Same.
-
-2000-10-17 Not Zed <NotZed@HelixCode.com>
-
- * camel-mime-filter.c: Added some malloc check debugging stuff.
-
- * camel-mime-parser.c
- (struct _header_scan_state): Removed top_part, top_start, and
- pending. I can't even remember why they were there, and they're
- not used anymore.
-
- * camel-mime-filter-basic.c (filter): Forgot to up the space here
- too.
-
-2000-10-14 Not Zed <NotZed@HelixCode.com>
-
- * camel-mime-filter-basic.c (complete): Ok, so we hit a fixme, 3x
- just wasn't enough for some sequences.
-
-2000-10-16 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-command.c
- (imap_read_response): Don't imap_next_word(respbuf + 2), instead
- use imap_next_word(respbuf) or else we'll skip over the second
- token.
-
-2000-10-16 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-command.c
- (camel_imap_response_extract): Don't free 'resp' as it doesn't
- point to the beginning of the allocated data, instead free
- response->untagged->pdata[i]. Also, if '*resp' is equal to a space
- character, then set resp = imap_next_word (resp) rather than
- expecting resp++ to work (there's a list broken IMAP daemons that
- like to put extra spaces between tokens).
- (imap_read_response): Don't expect 'respbuf+2' to be where the
- untagged number response to start (see above fix for an
- explanation).
-
-2000-10-16 Chris Toshok <toshok@helixcode.com>
-
- * camel-service.c (get_path): when using the construct (flags &
- CAMEL_SERVICE_URL_NEED_*) make sure to do ((flags &
- CAMEL_SERVICE_URL_NEED_*) == CAMEL_SERVICE_URL_NEED_*)
- (check_url): same.
-
-2000-10-16 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-store.c (imap_disconnect): Only send
- the LOGOUT command if the store is connected.
- (imap_connect): Set the 'connected' state to TRUE when we
- successfully connect.
- (get_folder_info): if (!topfi), 'topfi' was allocated but then
- 'fi' was set. I think Dan meant to set topfi since fi is an
- uninitialized value at this point.
-
- * providers/imap/camel-imap-command.c (imap_read_response): Check
- for the untagged BYE response and set the 'connected' state to
- FALSE if we receive the BYE response. Return NULL if we get a BYE
- response.
-
-2000-10-16 Dan Winship <danw@helixcode.com>
-
- * providers/imap/camel-imap-store.c (get_folder_info): Deal with
- the possibility of not getting a LIST response back for the top
- level.
-
-2000-10-12 Dan Winship <danw@helixcode.com>
-
- * providers/imap/camel-imap-summary.c: Simple subclass of
- CamelFolderSummary that also keeps a UIDVALIDITY value (and
- doesn't, for the moment, build content info).
-
- * providers/imap/camel-imap-folder.c:
- (various): Use a CamelImapSummary to store/fetch summary info.
- (camel_imap_folder_new): Take a path to a file to use for the
- summary. Set the folder's permanent_flags correctly according to
- the server response. Read in the summary (checking the
- UIDVALIDITY) and update it if it's out of date.
- (imap_refresh_info): Just fetch UIDs and flags. If the UIDs all
- match, update the flags as needed and be done with it. Otherwise,
- delete messages that have been expunged from the server and fetch
- full summary info for any new messages.
- (imap_sync): Save the summary to disk.
- (imap_update_summary): Renamed from imap_get_summary_internal. Can
- now be told to get summary for only a subset of messages. Use
- camel-mime-utils functions rather than rolling our own header
- parsing.
- (imap_get_message_info_internal): Merged into imap_update_summary.
- (imap_set_message_flags): Don't marked the message FOLDER_FLAGGED
- if we're not actually changing the value of any of the flags.
- (camel_imap_folder_changed): Deal with EXISTS rather than RECENT.
-
- * providers/imap/camel-imap-store.c (imap_connect): Call
- camel_session_get_storage_path and save the value.
- (get_folder): Create a local directory to store summary
- information and pass a summary file name to camel_imap_folder_new.
- Don't call camel_folder_refresh_info from here any more since
- camel_imap_folder_new does it again.
-
- * providers/imap/camel-imap-command.c (camel_imap_command): Add a
- special case to this to make it possible to get the repsonses from
- a SELECT and still have store->current_folder be updated
- correctly.
- (imap_read_response): parse EXISTS rather than RECENT
-
- * camel-session.c (camel_session_get_storage_path): Use
- e_mkdir_hier.
-
- * camel-folder-summary.c (camel_folder_summary_remove_index): New
- function.
-
- * camel-mime-utils.c (header_raw_append_parse): fix this.
- (camel-mime-parser.c doesn't use this code because of the MEMPOOL
- optimization, so nothing was ever actually calling it before.)
-
-2000-10-11 Not Zed <NotZed@HelixCode.com>
-
- * camel-mime-part.h (struct _CamelMimePart): Removed
- temp_message_buffer, and content_input_stream fields which seem to
- have come from nowhere, and are unused.
-
- * camel-mime-utils.c: Added a note about touching this file.
- Nobody is to touch it without asking me first. That goes for you
- too Jeff.
- (header_decode_text): In what way is this broken?
-
-2000-10-10 Not Zed <NotZed@HelixCode.com>
-
- * providers/imap/camel-imap-folder.c (imap_get_summary_internal):
- Fix camel_summary_* function rename
- (imap_get_message_info_internal): Likewise.
-
- * camel-mime-parser.c (camel_mime_parser_finalise): Fixed a spelling mistake.
-
- * camel-folder-summary.c (camel_summary_format_address): Uh, why
- do we encode and then decode here ... sigh. This is not the way
- to fix this.
- (camel_folder_summary_format_address): Renamed to a proper name,
- this was only supposed to be a private function.
- (camel_folder_summary_format_string): Likewise. Oh i see why it
- was made public, code reuse by cut & paste. Joy.
-
-2000-10-11 Chris Toshok <toshok@helixcode.com>
-
- * providers/nntp/camel-nntp-store.c (nntp_store_unsubscribe_folder): remove the leading '/'.
- (nntp_store_subscribe_folder): same.
- (nntp_store_folder_subscribed): same.
-
-2000-10-11 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (imap_move_message_to): Quote
- the mailbox name as it may contain spaces.
- (imap_copy_message_to): Same.
-
-2000-10-10 Chris Toshok <toshok@helixcode.com>
-
- * providers/nntp/camel-nntp-store.c
- (build_folder_info_from_grouplist): fill in message_count and
- unread_message_count properly.
-
- * providers/nntp/camel-nntp-newsrc.h: reformat.
-
- * providers/nntp/camel-nntp-grouplist.c
- (camel_nntp_get_grouplist_from_file): remove spew.
-
- * providers/nntp/camel-nntp-newsrc.c
- (camel_nntp_newsrc_group_get_num_articles_read): new function.
- (camel_nntp_newsrc_group_get_highest_article_read): robustification.
-
-2000-10-10 Joe Shaw <joe@helixcode.com>
-
- * providers/imap/camel-imap-store.c
- (parse_list_response_as_folder_info): Check before dereferencing the
- sep pointer.
-
-2000-10-10 Jacob "Ulysses" Berkman <jacob@helixcode.com>
-
- * camel-*.c: teach camel about "its" vs. "it's"
-
-2000-10-09 Chris Toshok <toshok@helixcode.com>
-
- * providers/nntp/camel-nntp-store.c (finalize): write out the
- newsrc.
- (nntp_store_get_name): if @brief, just return host.
-
- * providers/nntp/camel-nntp-newsrc.c: robustification and bug
- fixes.
-
-2000-10-06 Jeffrey Stedfast <fejj@helixcode.com>
-
- * camel-folder-summary.c (camel_summary_format_address): Decode
- the resulting string.
-
-2000-10-06 Chris Toshok <toshok@helixcode.com>
-
- * providers/nntp/camel-nntp-grouplist.c: new file.
-
- * providers/nntp/camel-nntp-grouplist.h: new file.
-
- * providers/nntp/camel-nntp-types.h: new file.
-
-2000-10-06 Jeffrey Stedfast <fejj@helixcode.com>
-
- * camel-mime-utils.c (quoted_encode): Fix so that we don't encode
- every single char in the word. Also, do we need a safemask? I
- don't see why we would.
- (header_encode_string): Don't strip off the last char!!
-
-2000-10-06 Chris Toshok <toshok@helixcode.com>
-
- * providers/nntp/Makefile.am (libcamelnntpinclude_HEADERS): add
- camel-nntp-grouplist.h
- (libcamelnntp_la_SOURCES): add camel-nntp-grouplist.c
-
- * providers/nntp/camel-nntp-provider.c: add our own hash functions
- for nntp urls.
-
- * providers/nntp/camel-nntp-newsrc.c
- (camel_nntp_newsrc_group_is_subscribed): new function.
- (camel_nntp_newsrc_subscribe_group): new function.
- (camel_nntp_newsrc_unsubscribe_group): new function.
-
- * providers/nntp/camel-nntp-newsrc.h: add prototypes for
- _group_is_subscribed, _subscribe_group, and _unsubscribe_group.
-
- * providers/nntp/camel-nntp-store.c
- (build_folder_info_from_grouplist): new function.
- (nntp_store_get_folder_info): add subscribed_only_parameter. if
- it's FALSE, load the grouplist and call
- build_folder_info_from_grouplist.
- (nntp_store_folder_subscribed): implement.
- (nntp_store_subscribe_folder): implement.
- (nntp_store_unsubscribe_folder): implement.
- (camel_nntp_store_init): add CAMEL_STORE_SUBSCRIPTIONS to the
- store's flags.
-
- * providers/mh/camel-mh-store.c (get_folder_info): add
- subscribed_only parameter.
-
- * providers/mbox/camel-mbox-store.c (get_folder_info): add
- subscribed_only parameter.
-
- * providers/imap/camel-imap-store.c (get_folder_info): add
- subscribed_only parameter.
-
- * camel-store.c (camel_store_supports_subscriptions): new function.
- (camel_store_folder_subscribed): new function.
- (camel_store_subscribe_folder): new function.
- (camel_store_unsubscribe_folder): new function.
-
- * camel-store.h: add prototypes and virtual functions for the
- subscribe implementation. also, add a subscribed_only argument to
- camel_store_get_folder_info.
-
-2000-10-05 Jeffrey Stedfast <fejj@helixcode.com>
-
- * camel-mime-utils.c (header_address_list_format_append): Encode
- the name part of the address and don't quote the name.
- (header_decode_text): Rewrote from scratch, the old code was badly
- broken.
-
-2000-10-05 Jeffrey Stedfast <fejj@helixcode.com>
-
- * camel-mime-message.c (camel_mime_message_set_reply_to): Use the
- camel_address_encode function again.
- (camel_mime_message_set_from): Same.
-
-2000-10-05 Jeffrey Stedfast <fejj@helixcode.com>
-
- * camel-mime-utils.c (quoted_encode_step): Modified to not encode
- space chars in the middle of a line.
- (isblank): New macro if we're not on a system with the GNU isblank
- extension.
-
- * camel-mime-message.c (camel_mime_message_set_from): Reversed my
- changes, don't header_encode_phrase - it generates broken headers.
- (camel_mime_message_set_reply_to): Same.
-
-2000-10-04 Chris Toshok <toshok@helixcode.com>
-
- * providers/nntp/camel-nntp-utils.c (camel_nntp_get_headers):
- revert to old method (only use XOVER if OVER is supported.)
-
- * providers/nntp/camel-nntp-store.c
- (camel_nntp_store_get_overview_fmt): handle the case where the
- OVER extension isn't listed but LIST OVERVIEW.FMT works (again,
- INN 2.2). enable the OVER extension in this case.
-
-2000-10-04 Chris Toshok <toshok@helixcode.com>
-
- * providers/nntp/camel-nntp-utils.c (get_XOVER_headers): return a
- gboolean so we can tell if this command worked. we can't key off
- the OVER extension being present because at least one server (INN
- 2.2) doesn't report the OVER extension but implements the XOVER
- command. This could of course just be because I'm a loser for
- thinking they were related in the first place.
- (camel_nntp_get_headers): always try XOVER first, and if it fails
- revert to the slow method.
-
-2000-10-04 Dan Winship <danw@helixcode.com>
-
- * providers/mbox/camel-mbox-store.c (get_folder): Fix a case where
- a variable was free'd and then possibly used in an error message.
-
-2000-10-04 Chris Toshok <toshok@helixcode.com>
-
- * providers/nntp/camel-nntp-provider.c
- (camel_provider_module_init): news: -> nntp:.
-
-2000-10-04 Chris Toshok <toshok@helixcode.com>
-
- * providers/nntp/camel-nntp-store.c (nntp_store_get_folder_info):
- use "nntp:" instead of "news:" since "news:" urls aren't supposed
- to have host/user/port info in them. also, if there's a user
- defined in the url, put it in the urls for our folders.
-
-2000-10-04 Chris Toshok <toshok@helixcode.com>
-
- * providers/nntp/camel-nntp-auth.c (camel_nntp_auth_authenticate):
- borrow some code from the imap provider to query the user for
- their password, and pass the user/passwd to nntp. be extra
- paranoid and zero out the password before freeing it.
-
- * providers/nntp/camel-nntp-store.c (camel_nntp_store_init): add
- ALLOW_USER/ALLOW_PASSWORD/ALLOW_AUTH to the url flags.
- (nntp_store_query_auth_types_generic): return our list of
- auth_types.
- (nntp_store_query_auth_types_connected): broken, return same as in
- query_auth_types_generic.
-
-2000-10-04 Dan Winship <danw@helixcode.com>
-
- * providers/imap/camel-imap-store.c (imap_connect): IMAP4
- (pre-rev1) doesn't support the 'LIST "" ""' idiom, so don't use
- it. Just assume the dir_sep is '/'. Shrug.
-
-2000-10-04 Jeffrey Stedfast <fejj@helixcode.com>
-
- * camel-mime-message.c (camel_mime_message_set_reply_to): Use
- header_encode_phrase instead.
- (camel_mime_message_set_from): Same.
-
-2000-10-04 Not Zed <NotZed@HelixCode.com>
-
- * camel-mime-utils.c (header_content_type_is): Handle the case
- where ct != NULL, but type and subtype are, and also match that
- against text/plain.
-
- * camel-folder-summary.c: Bump summary file version.
- (message_info_save): Save the size from the messageinfo.
- (message_info_load): Load the size from the summary file.
- (message_info_load): Fixed up the time_t saving/loading. There
- was a reason the warning was left there ... obviously nobody could
- read the comment "/* warnings, leave them here */", why do i even
- bother.
- (camel_folder_summary_decode_time_t): Decode a time_t value from
- the summary file.
- (camel_folder_summary_encode_time_t): Encode a time_t value to the
- summary file.
-
-2000-10-03 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-command.c (camel_imap_command): Quote
- the mailbox name when sending a SELECT request otherwise mailboxes
- with spaces in their names will cause problems.
-
- * camel-mime-message.c (camel_mime_message_set_reply_to): encode
- before setting.
- (camel_mime_message_set_from): Same.
-
-2000-10-03 Dan Winship <danw@helixcode.com>
-
- * providers/imap/camel-imap-command.c: New file containing
- camel_imap_command and friends. Major camel_imap_command rewrite
- to remove duplicated code, make the parsing of literals be
- more safe/correct, deal with RECENT/EXPUNGE responses more
- consistently, and make it possible to implement the AUTHENTICATE
- command.
-
- * providers/imap/camel-imap-utils.c (imap_parse_nstring): New
- function, to parse an IMAP "nstring".
-
- * providers/imap/camel-imap-store.c: Move command stuff to
- camel-imap-command.c. Update for camel_imap_command changes.
-
- * providers/imap/camel-imap-folder.c: Update for
- camel_imap_command changes.
- (imap_append_message): CRLF filter the message before sending it.
-
- * providers/imap/Makefile.am: Add camel-imap-command.[ch], remove
- camel-imap-stream.[ch] for now.
-
-2000-10-02 Jeffrey Stedfast <fejj@helixcode.com>
-
- * camel-mime-message.c (camel_mime_message_has_8bit_parts): New
- convenience function to determine if there are any 8bit mime parts
- in a mime message.
- (camel_mime_message_encode_8bit_parts): New convenience function
- to recursively reencode all 8bit mime parts to either
- quoted-printable or base64 depending on which would be the best
- encoding for that part.
-
- * providers/smtp/camel-smtp-transport.c (smtp_data): If the mime
- message contains 8bit parts and the server doesn't support 8bit
- transfers, reencode those parts before proceding with the send.
- (smtp_mail): If the mime message contains 8bit parts and the
- server supports the 8BITMIME extension to SMTP, notify the server
- that we'll be sending it 8bit mime parts.
- (_send_to): Find out if the message contains 8bit parts.
-
-2000-10-02 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/smtp/camel-smtp-transport.c (_send_to): Use the
- CamelInternetAddress parser.
- (smtp_get_email_addr_from_text): deprecated.
-
-2000-10-02 Dan Winship <danw@helixcode.com>
-
- * camel-provider.h: Remove default_ports.
-
- * camel-remote-store.c (remote_connect): Get default_port from
- CamelRemoteStore rather than CamelProvider.
-
- * providers/{imap,nntp,pop3}/camel-*-store.c: Initialize
- CamelRemoteStore::default_port
-
- * providers/*/camel-*-provider.c: Remove default_ports.
-
-2000-10-02 Dan Winship <danw@helixcode.com>
-
- * camel-folder.[ch]: Remove
- camel_folder_{get,free}_subfolder_info, as we want to be able to
- scan the whole subfolder tree without having to open any folders,
- so this needs to be in CamelStore. Remove can_hold_folders and
- can_hold_messages flags; things that don't hold messages are no
- longer considered CamelFolders.
-
- * camel-folder-summary.[ch]: Remove CamelFolderInfo stuff.
-
- * camel-store.[ch]: Add camel_store_{get,free}_folder_info, as
- well as camel_store_free_folder_info_full and ..._nop for default
- implementations, and camel_folder_info_free and
- camel_folder_info_build as convenience functions. Turn
- CamelFolderInfo into a tree structure and also add an "url"
- member.
-
- * providers/*/camel-*-folder.c: Remove subfolder_info and can_hold
- stuff.
- * providers/*/camel-*-store.c: Add folder_info stuff.
-
- * providers/imap/camel-imap-folder.c (imap_summary_free): Free the
- summary elements with camel_message_info_free, not
- camel_folder_info_free. Oops.
-
- * providers/imap/camel-imap-utils.c: const poison
-
-2000-09-28 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/smtp/camel-smtp-transport.c: Fixed some memory leaks.
- (camel_smtp_transport_init): Initialize supports_8bit to FALSE.
- (smtp_helo): If server supports 8bit, set supports_8bit to TRUE.
-
- * camel-transport.h (struct _CamelTransport): Added variable
- gboolean supports_8bit (we'll need this eventually? - see bugzilla
- bug #53)
-
- * providers/smtp/camel-smtp-transport.c
- (smtp_get_email_addr_from_text): Ugh, no wonder people were
- getting illegal seek warnings *sigh*. I guess I can only blame
- myself for this one though :-(
-
-2000-09-28 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/smtp/camel-smtp-transport.c (_send_to): Don't send the
- recipient data through smtp_get_email_addr_from_text - this is a
- complete waste. In fact, we don't want to have to use that
- function ever.
-
- * camel-internet-address.c, camel-address.c: Added some gtk-doc
- comments.
-
-2000-09-28 Jeffrey Stedfast <fejj@helixcode.com>
-
- * camel-mime-utils.c (header_encode_string): Make sure to add the
- space char after an encoded word when the encoding is iso-8859-1.
-
-2000-09-28 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (imap_get_message): When
- getting a literal string response, don't include the \r\n after
- the closing } (as in: "... {798}\r\n...")
-
- * providers/imap/camel-imap-stream.c (stream_read): Same.
-
-2000-09-28 Not Zed <NotZed@HelixCode.com>
-
- * camel-mime-utils.c (header_fold): New function to fold headers.
-
-2000-09-27 Not Zed <NotZed@HelixCode.com>
-
- * camel-mime-parser.c (folder_scan_header): If we had an empty
- header, then it must be end of the headers too.
- (folder_scan_init): No we dont need to init the outbuf with a nul
- terminator.
-
- * camel-folder-summary.c (camel_folder_summary_set_uid): New
- function to reset the uid to a higher value.
-
- * providers/mbox/camel-mbox-summary.c (camel_mbox_summary_sync):
- "something failed (yo!)" what sort of crap is this? Fixed all the
- indenting again, what wanker keeps running stuff through indent?
- (message_info_new): Check the uid we loaded off the disk, if it
- existed already, assign a new one. If it didn't then make sure
- the nextuid is higher.
-
- * camel-charset-map.c: New file, used to build a large unicode
- decoding mapping table, and use it to determine what is the
- lowest charset a given word can be encoded with. Uses tables from
- libunicode's source.
-
- * camel-internet-address.c (internet_encode): Use
- header_phrase_encode to properly encode the fullname, as required.
- refixed indenting. Who keeps doing that?
- (camel_internet_address_find_address): Changed fatal return/warnings
- into assertions.
-
- * camel-mime-utils.c (header_raw_append_parse): Check : explicitly
- (removed from is_fieldname() macro).
- (camel_mime_special_table): Changed to short, so we can represent
- more bit types.
- (quoted_encode): Take a mask of the safe chars for this encoding.
- (header_address_decode): Removed a #warning that makes no sense
- anymore.
- (header_decode_date): Fixed the 'broken date' parser code, if it
- ever decoded it it just threw away the result.
- (header_encode_string): Use better charset matching for encoding
- strings as well.
-
-2000-08-31 Not Zed <NotZed@HelixCode.com>
-
- * providers/mh/camel-mh-summary.c (camel_mh_summary_sync): Save
- the index if we do a sync.
- (camel_mh_summary_check): Save the index here too. Probably.
-
-2000-09-27 Dan Winship <danw@helixcode.com>
-
- * providers/imap/camel-imap-store.c (camel_imap_command_extended):
- Return untagged data in a GPtrArray rather than a string, since it
- saves processing time and is much easier to deal with for several
- commands. Update for camel_imap_folder_changed change.
- (camel_imap_fetch_command): Update for camel_imap_folder_changed
- change.
- (imap_connect, imap_folder_exists): Update for
- camel_imap_command_extended change.
-
- * providers/imap/camel-imap-folder.c
- (imap_get_message_count_internal,
- imap_get_subfolder_info_internal, imap_search_by_expression):
- Update for camel_imap_command_extended change.
-
- (imap_get_summary_internal, imap_get_message_info_internal): Use
- camel_imap_fetch_command here now to get around the
- camel_imap_command_extended change.
-
- (camel_imap_folder_changed): turn expunged into a GArray of ints
- rather than a GPtrArray of strings representing ints.
-
-2000-09-26 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c
- (imap_get_message_count_internal): Quote the folder name as it may
- contain spaces.
- (imap_get_subfolder_info_internal): Same.
-
- * providers/imap/camel-imap-utils.c (imap_parse_list_response): Do
- proper unquoting for folder names.
- (func_get_current_date): Implemented.
-
- * providers/imap/camel-imap-store.c
- (imap_folder_exists): Quote the folder name as it may have spaces.
- (imap_create): Same.
- (check_current_folder): Same.
-
-2000-09-22 Dan Winship <danw@helixcode.com>
-
- * providers/imap/camel-imap-folder.c
- (imap_get_subfolder_info_internal): The root folder's name is "",
- not the namespace.
- (camel_imap_folder_new): constify folder_name.
-
- * providers/imap/camel-imap-store.c (get_folder): Create the
- folder with folder_name, not folder_path.
- (camel_imap_command_preliminary): Don't free cmdid here.
-
-2000-09-21 Dan Winship <danw@helixcode.com>
-
- * providers/imap/camel-imap-utils.c (imap_create_flag_list): New
- function to convert Camel flags to an IMAP flag_list.
- (imap_parse_flag_list): Contrariwise.
-
- * providers/imap/camel-imap-store.c (camel_imap_command_*): Make
- the @ret arg actually optional, as (mostly) documented.
- (various): Don't pass "&result" to camel_imap_command_* if we're
- just going to immediately free it. Don't record status if we're
- not going to look at it.
-
- * providers/imap/camel-imap-folder.c: Likewise.
- (imap_summary_free): Use camel_folder_info_free.
- (imap_sync): Use imap_create_flag_list. Clear
- CAMEL_MESSAGE_FOLDER_FLAGGED after syncing so we don't keep
- re-syncing.
- (imap_append_message): Use imap_create_flag_list. Don't leak the
- memstream if the append fails.
- (imap_move_message_to): Use camel_folder_delete_message rather
- than doing it by hand.
- (imap_get_summary_internal, imap_get_message_info_internal): Use
- imap_parse_flag_list and header_raw_clear.
- (camel_imap_folder_changed): Use camel_message_info_free.
-
-2000-09-21 Dan Winship <danw@helixcode.com>
-
- * providers/imap/camel-imap-store.c (get_folder_name): INBOX is
- case-insensitive.
- (get_root_folder_name): Make the root folder "" rather than "/".
- (get_folder): Update for root folder name change.
- (camel_imap_store_get_toplevel_dir): Removed. (Unused, unneeded.)
- (camel_imap_store_folder_path): New function to turn a Camel
- folder name into the corresponding namespaced IMAP path.
- (imap_folder_exists): Make this take a store and a path rather
- than a folder.
- (imap_create): Likewise
- (get_folder): Update for camel_imap_store_folder_path and other
- changes.
- (check_current_folder): Likewise.
-
- * providers/imap/camel-imap-folder.c: Change a bunch of CamelStore
- variables to CamelImapStore (and add a few more) to prevent excess
- gratuitous casting. Use camel_imap_store_folder_path where
- appropriate.
- (camel_imap_folder_new): Update for root folder name change.
-
-2000-09-19 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/smtp/camel-smtp-transport.c (smtp_data): Use the
- linewrap filter to achieve full RFC0821 compliance.
-
- * camel-mime-filter-linewrap.[c,h]: New mime-filter to word-wrap.
-
-2000-09-19 Jeffrey Stedfast <fejj@helixcode.com>
-
- * camel-internet-address.c (internet_encode): When encoding the
- internet address, quote the name as the name may have commas or
- any other token which may later confuse our address parser.
-
-2000-09-19 Dan Winship <danw@helixcode.com>
-
- * providers/imap/camel-imap-folder.c
- (imap_get_subfolder_info_internal): Fix the case where INBOX
- isn't returned in the folder listing.
-
-2000-09-19 Dan Winship <danw@helixcode.com>
-
- * camel-folder.c: (init): Removed
- (camel_folder_init, camel_folder_construct): New object init
- function and public object constructor to replace the old init
- method in a more Gtk-like fashion.
-
- (get_parent_folder, camel_folder_get_parent_folder): Removed. No
- CamelFolder subclass was ever setting the parent_folder member, no
- code has ever needed to look at it, and fixing it would actually
- be pretty hard.
-
- (get_subfolder_info, camel_folder_get_subfolder_info): Renamed
- from ..._names. Deals in CamelFolderInfo now.
- (free_subfolder_info, camel_folder_free_subfolder_info): Likewise.
-
- (get_subfolder, camel_folder_get_subfolder): Removed.
- CamelFolderInfo contains the subfolder's full name, so this is
- unnecessary now, and removing it lets us get rid of the
- CamelFolder separator member, which is needed for the default
- implementation of this function, but not otherwise needed for most
- providers.
-
- Also, lots of code style fixes.
-
- * providers/*: Update CamelFolder subclasses for changes, although
- none of them fill in the message counts in the CamelFolderInfo
- yet.
-
-2000-09-18 Christopher James Lahey <clahey@helixcode.com>
-
- * camel-folder-search.c, camel-folder-search.h,
- camel-remote-store.c, providers/imap/camel-imap-folder.c,
- providers/imap/camel-imap-store.c: Fixed the #include lines to
- deal properly with gal.
-
-2000-09-17 Dan Winship <danw@helixcode.com>
-
- * camel-folder-summary.h: update CamelFolderInfo
- * camel-folder-summary.c (camel_folder_info_free): New function to
- free the contents of a CamelFolderInfo
-
-2000-09-15 Dan Winship <danw@helixcode.com>
-
- * camel.c (camel_init): Set camel_verbose_debug to TRUE if
- CAMEL_VERBOSE_DEBUG is set in the environment.
-
- * camel-remote-store.c (remote_send_line, remote_recv_line): only
- log if camel_verbose_debug is TRUE.
-
-2000-09-14 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-store.c (get_folder): Don't use
- dir_sep as top-level directory, use "/".
-
- * providers/imap/camel-imap-folder.c (imap_expunge): Get rid of
- unused variable.
-
-2000-09-13 Dan Winship <danw@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (imap_expunge): Don't look at
- the response of the command. camel_imap_command_extended()
- processes EXPUNGE responses itself, so if we do it here too we
- remove twice as many summary items as we should.
-
-2000-09-13 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-store.c (imap_folder_exists): Rewrote
- to take a third argument (gboolean *selectable) so that we can
- find out if the folder is selectable or not as we look to see if
- it exists. Also, don't use EXAMINE because that will not work on
- non-selectable folders, so use LIST instead.
- (get_folder): Check to see if the folder exists even vefore
- calling imap_create as this will save time. If the folder does
- exist, find out if it's selectable. Moved the call to refresh_info
- here.
-
- * providers/imap/camel-imap-folder.c (imap_get_uids): Check for a
- NULL summary.
- (camel_imap_folder_new): Don't call refresh_info here - call it in
- get_folder() because we don't know if this folder even exists on
- the server yet! And even if it does, we don't know if it can hold
- messages or not yet.
-
-2000-09-12 Jeffrey Stedfast <fejj@helixcode.com>
-
- * camel-mime-parser.c (folder_scan_step): Make sure *datalength is
- > 0 before calling camel_mime_filter_filter otherwise we will get
- a segfault if the filter calls iconv().
-
-2000-09-08 Christopher James Lahey <clahey@helixcode.com>
-
- * providers/nntp/camel-nntp-auth.c,
- providers/nntp/camel-nntp-auth.h: Fixed a warning.
-
-2000-09-07 Dan Winship <danw@helixcode.com>
-
- * camel-session.c (camel_session_get_storage_path): Make this not
- leak.
-
-2000-09-07 Dan Winship <danw@helixcode.com>
-
- * camel-session.c (camel_session_new): Make this take a path to a
- directory that Camel can use for its own nefarious purposes.
- (camel_session_get_storage_path): New function to return a path
- that a service can use for its own nefarious sub-purposes.
-
- * camel-service.c (camel_service_get_path): New method (and
- useful default implementation) to get a (relative) pathname
- corresponding to the service.
-
-2000-09-06 Dan Winship <danw@helixcode.com>
-
- * providers/pop3/camel-pop3-store.c (connect_to_server): Make KPOP
- work again.
-
-2000-09-06 Jeffrey Stedfast <fejj@helixcode.com>
-
- * camel-mime-message.c (camel_mime_message_get_received_date):
- Implemented (someone added these to camel-mime-message.h but never
- implemented them!!) - though it may not be right.
- (camel_mime_message_get_sent_date): Same.
-
-2000-09-05 Dan Winship <danw@helixcode.com>
-
- * camel-mime-part.c (camel_mime_part_get_filename): If a MIME part
- has no Content-Disposition, but does have a "name" on the
- Content-Type, return that as the filename.
- (process_header): strstrip the Content-Description
-
-2000-09-05 Chris Toshok <toshok@helixcode.com>
-
- * providers/nntp/camel-nntp-utils.c (get_OVER_headers): care about
- response code.
- (get_HEAD_headers): same.
- (camel_nntp_get_headers): same.
-
- * providers/nntp/camel-nntp-store.h: get rid of
- CAMEL_NNTP_OK/ERR/FAIL.
-
- * providers/nntp/camel-nntp-store.c
- (camel_nntp_store_get_extensions): take CamelException arg and
- pass along to camel_nntp_command.
- (camel_nntp_store_get_overview_fmt): same.
- (nntp_store_connect): convert to using constants in
- camel-nntp-resp-codes.h
- (nntp_store_get_folder): make use of camel_nntp_folder_new.
- (camel_nntp_command_send_recv): new function to deal with auth
- challenge.
- (camel_nntp_command): split out most of this function into
- camel_nntp_command_send_recv. also, return the actual response
- code instead of CAMEL_NNTP_OK/ERR/FAIL.
-
- * providers/nntp/camel-nntp-resp-codes.h: new file.
-
- * providers/nntp/camel-nntp-folder.h: prototype for
- camel_nntp_folder_new.
-
- * providers/nntp/camel-nntp-folder.c (camel_nntp_folder_new): new
- convenience function.
- (nntp_folder_get_message): care more about the actual response
- code.
-
- * providers/nntp/Makefile.am (libcamelnntp_la_SOURCES): add
- camel-nntp-auth.c.
- (libcamelnntpinclude_HEADERS): add camel-nntp-auth.h.
-
- * providers/nntp/camel-nntp-auth.h: new file.
-
- * providers/nntp/camel-nntp-auth.c: new file.
-
-2000-09-05 Peter Williams <peterw@helixcode.com>
-
- * providers/imap/camel-imap-store.c (imap_folder_exists): Don't free the
- result on error; the exception will have the relevant info.
-
- * providers/imap/camel-imap-folder.c (camel_imap_folder_new): Check for
- exceptions here.
-
- * providers/imap/camel-imap-store.c (imap_connect): Check the exception
- on the refresh_folders call.
-
- * providers/imap/camel-imap-store.h: Clean up some now-unused fields.
-
- * camel.c (camel_init): Call unicode_init again, now that libunicode
- will not initialize itself twice.
-
-2000-09-02 Lauris Kaplinski <lauris@helixcode.com>
-
- * camel-folder-search (search_header_contains): Use e_utf8_strstrcase
-
-2000-09-01 Christopher James Lahey <clahey@helixcode.com>
-
- * providers/imap/camel-imap-utils.c: Removed some unused
- functions.
-
-2000-09-01 Peter Williams <peterw@helixcode.com>
-
- * providers/nntp/camel-nntp-store.c (camel_nntp_command): Initialize
- the statically-allocated CamelException so that it doesn't contain
- junk data that camel_exception_set() may try to free.
- (camel_nntp_store_get_extensions): Same.
- (camel_nntp_store_get_overview_fmt): Same.
-
- * providers/pop3/camel-pop3-store.c (camel_pop3_command): Typo
- fix (if (*ret) -> if (ret)).
-
- * providers/pop3/camel-pop3-store.c (pop3_connect): Set the
- port # back to what was specified ASAP, so that the hash of
- the URL doesn't change (which causes a failure in
- service_cache_remove that leads to a segfault).
-
- * providers/imap/camel-imap-store.c (imap_connect): Clear the
- exception after a failed LOGIN so that it doesn't pass through
- to the upper level and make mail think that the login failed.
-
- * providers/pop3/camel-pop3-store.c (pop3_connect): As above.
-
-2000-08-31 Peter Williams <peterw@helixcode.com>
-
- * providers/pop3/camel-pop3-store.c (camel_pop3_store_get_type):
- Implement POP3 with the CamelRemoteStore now.
- (connect_to_server): Hack this a bit to get KPOP to work. Obey
- the new connection semantics of the remote store (implicitly).
- (query_auth_types_connected): Clear exceptions after attempts
- to connect; the code at the bottom will catch hard errors.
- Use camel_service_connect.
- (camel_pop3_command): Take a CamelException; now, when an error
- occurs, ret is set to NULL and the exception passes back the
- appropriate information.
- (pop3_get_response): Same as above.
- (pop3_try_authenticate): Give camel_pop3_command its exception
- and handle it properly.
- (pop3_connect): Call the parent classfuncs. Don't disconnect
- on error (done for us).
-
- * providers/pop3/camel-pop3-folder.c: Obey the camel_pop3_command
- semantics.
-
- * camel-remote-store.c (remote_query_auth_types_connected): Don't
- warn; just return NULL.
- (remote_query_auth_types_generic): Same.
- (remote_send_string): Filter out passwords in debugging output.
-
- * providers/pop3/camel-pop3-store.c (camel_pop3_store_init): Also
- set the ALLOW_AUTH flag.
-
- * providers/imap/camel-imap-store.c (camel_imap_store_init): Same.
-
-2000-08-31 Chris Toshok <toshok@helixcode.com>
-
- * providers/nntp/camel-nntp-store.c (camel_nntp_store_class_init):
- remove get_folder_name.
- (nntp_store_get_folder_name): remove.
-
-2000-08-31 Lauris Kaplinski <lauris@helixcode.com>
-
- * camel-mime-part.c (write_to-stream): Use filter only if we have one
-
-2000-08-31 Chris Toshok <toshok@helixcode.com>
-
- * providers/nntp/camel-nntp-utils.c (get_OVER_headers): use
- camel_remote_store_recv_line.
-
- * providers/nntp/camel-nntp-folder.c (nntp_folder_get_message):
- use camel_remote_store_recv_line to build message. also, free our
- buffer so we don't leak like mad.
-
- * providers/nntp/camel-nntp-store.c:
- (camel_nntp_store_get_additional_data) remove.
- (camel_nntp_store_get_extensions): use
- camel_remote_store_recv_line.
- (camel_nntp_store_get_overview_fmt): same. also, don't rely on
- _get_additional_data anymore since it's easier to parse without.
- (camel_nntp_command): use camel_remote_store_send_string and
- camel_remote_store_recv_line.
-
- * providers/nntp/camel-nntp-store.h: CamelRemoteStore is the
- parent class now. remove istream/ostream since CamelRemoteStore
- takes care of that for us. also remove the prototype for
- camel_nntp_store_get_additional_data.
-
- * providers/nntp/camel-nntp-newsrc.c (camel_nntp_newsrc_write):
- make sure to clear dirty bit.
- (camel_nntp_newsrc_read_for_server): don't worry about continually
- trying to open the file - if it fails we just return an
- unpopulated .newsrc file.
-
-2000-08-31 Chris Toshok <toshok@helixcode.com>
-
- * providers/nntp/camel-nntp-newsrc.c
- (camel_nntp_newsrc_read_for_server): make this a bit more robust.
- try to create an empty .newsrc file for the server if we can't
- open it for reading. also, don't allocate everything until we've
- opened the file.
-
- * providers/nntp/camel-nntp-utils.c (get_OVER_headers): make use
- of our overview field indices.
- (camel_nntp_get_headers): only call get_OVER_headers if the
- extension is present. warn if it's not - since get_HEAD_headers
- needs work before it works.
-
- * providers/nntp/camel-nntp-store.c
- (camel_nntp_store_get_extensions): new function - query the server
- for it's extensions.
- (camel_nntp_store_get_overview_fmt): new function - query the
- server for the overview format and build our table of the indices
- we care about. support the "full" suffix on fields.
- (nntp_store_connect): call camel_nntp_store_get_extensions and
- camel_nntp_store_get_overview_fmt.
-
- * providers/nntp/camel-nntp-store.h: add codes for extensions
- found on news.mozilla.org. only one that we care about is OVER.
- also, add CamelNNTPOverField and an enum of the overview fields
- that we care about.
-
-2000-08-31 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-utils.c (imap_translate_sexp):
- Reimplemented. It should now work correctly for most possible
- VFolder rules.
-
-2000-08-31 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-store.c (camel_imap_command_extended):
- Don't save any exceptions caused by camel_imap_folder_changed
- (camel_imap_fetch_command): Same.
-
- * providers/imap/camel-imap-folder.c (camel_imap_folder_changed):
- Using a new way of calculating the first recent message that seems
- more accurate. Also added code to make sure we don't accidently
- add a duplicate summary.
-
-2000-08-31 Not Zed <NotZed@HelixCode.com>
-
- * camel-mime-part.c (write_to_stream): Use the proper type
- checking function to check for text types.
- (write_to_stream): If we have a charset on a text type that
- isn't us-ascii or utf-8, then we need to reencode it, so add a
- filter to do that too.
- (write_to_stream): Fix some warnings/use the right constructor,
- oops.
- (write_to_stream): Rearrange the logic so it always does charset
- conversion, and not just if we have a qp/base64 block.
-
- * camel-mime-utils.c (append_latin1): New function - even though
- its broken, we'll assume mailers send latin1 headers instead of
- us-ascii. We just have to encode high chars into utf-8.
- (header_decode_text): Call append_latin1 for appending unencoded
- text segments.
- (append_latin1): Do an additional mask for account for c's
- undefined behaviour for sign extension whilst shifting right.
-
-2000-08-30 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-store.c (camel_imap_fetch_command):
- Rewrote to ignore strings that look like server responses until it
- is sure that it has finished reading the literal string response.
-
-2000-08-30 Jeffrey Stedfast <fejj@helixcode.com>
-
- * camel-remote-store.c (remote_send_string): Don't wrap printed
- strings in quotes, makes things messy
-
- * providers/imap/camel-imap-folder.c (imap_get_message): Updated
- to use the camel_imap_fetch_command
-
- * providers/imap/camel-imap-stream.c (stream_read): Updated to use
- camel_imap_fetch_command
-
- * providers/imap/camel-imap-store.c (camel_imap_command_extended):
- No longer handles FETCH requests so no longer needs to be
- concerned with checking to make sure that server responses are
- valid (they have to be).
- (camel_imap_fetch_command): New convenience function that handles
- all FETCH requests
-
-2000-08-30 Peter Williams <peterw@helixcode.com>
-
- * camel-remote-store.c (remote_connect): Unify with remote_post_connect.
- (remote_disconnect): Unify with remote_pre_disconnect.
- (camel_remote_store_class_init): Don't use the post_connect and
- pre_disconnect classfuncs anymore ; they weren't especially useful.
-
- * providers/imap/camel-imap-store.c (imap_connect): Use this again
- instead of implementing post_connect.
- (imap_disconnect): Analogous to above.
-
- * camel-session.c (camel_session_get_service_connected): New function.
- Like camel_session_get_service() but also connects to the service
- if needed. camel_session_get_{store,transport} (defined in the header)
- used this now, preventing annoying when-to-connect problems.
-
- * camel-service.c (camel_service_new): Revert to the old behavior
- of not connecting until told to do so. Otherwise doing auth
- testing correctly is really hard.
- (camel_service_connect): Fix behavior here (set the connected
- flag).
- (camel_service_disconnect): Unset the connected flag.
-
-2000-08-30 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-store.c: General cleanup / moving
- stuff around to make things easier to follow.
-
-2000-08-30 Jeffrey Stedfast <fejj@helixcode.com>
-
- * camel-remote-store.c: Prevent exceptions from being overwritten
-
- * providers/imap/camel-imap-folder.c (imap_expunge): Beautified
- (imap_get_subfolder_names_internal): Removed old code as the
- replacement code has now been tested and proven to work
-
-2000-08-29 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-utils.c: Removed old code that will
- never be needed again
-
- * providers/imap/camel-imap-store.c: Removed old code for
- try_connect - will never need this code
- (slurp_response): Update to make sure we aren't falsely detecting
- EXPUNGE flags
-
-2000-08-29 Peter Williams <peterw@helixcode.com>
-
- * camel-service.c (camel_service_connect): Uncomment this.
- (camel_service_disconnect): Same.
-
- * camel-remote-store.[ch]: New files. Abstract remote storages
- (IMAP, POP3, NNTP) and hides the lower-level networky stuff.
-
- * camel-service.c (camel_service_new): Take an extra argument, the
- provider that created us, cause it's useful.
- (camel_service_finalize): Unref our new provider member.
-
- * camel-session.c (camel_session_get_service): Pass the proper number of
- arguments to camel_service_new().
-
- * camel-imap-store.c: Massive update: 1) use the CamelRemoteService to
- make our life Very Easy (TM). 2) Change the semantics of all
- camel_imap_command* functions to take exceptions, centralize tons of
- duplicate code, and use the handy RemoteStore utility functions
-
- * camel-imap-folder.c: Use the new semantics of camel_imap_command*
-
- * camel-imap-stream.c: Same.
-
-2000-08-29 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-store.c (camel_imap_command_extended):
- Updated to check for EXPUNGE notifications
-
- * providers/imap/camel-imap-folder.c (camel_imap_folder_changed):
- Updated to account for messages which have been expunged (now
- takes a new arg, a GPtrArray of message id's that have been
- expunged)
- (imap_expunge): Updated (we may want to just use the code in
- folder_changed now instead of doing our own summary
- expunging...but that can be fixed later)
- (imap_append_message): Updated.
- (imap_copy_message_to): Updated.
- (imap_move_message_to): Updated.
-
-2000-08-28 Peter Williams <peterw@helixcode.com>
-
- * camel-folder.c (camel_folder_refresh_info): New member function,
- refresh_info, used for rereading folder state after its state has
- somehow become unknown. Tries to preserve last-known status of
- messages.
-
- * providers/mbox/camel-mbox-folder.c (mbox_refresh_info): Implement
- ::refresh_info (split up ::init)
-
- * providers/mbox/camel-mbox-store.c (get_folder): Call ::refresh_info.
-
- * providers/imap/camel-imap-folder.c (camel_imap_folder_new): Call
- ::refresh_info once initialized.
- (imap_refresh_info): New member function; reads the summary from
- the server (used to be in camel_imap_folder_new; split out).
-
- * providers/imap/camel-imap-store.c (imap_connect): Set
- CamelService::connected a little early so that
- camel_imap_command won't try to connect while already
- connnecting.
- (camel_imap_command*): Try to connect if not connected already.
-
- * providers/pop3/camel-pop3-folder.c (pop3_refresh_info): Same as above.
-
- * providers/pop3/camel-pop3-folder.c (camel_pop3_folder_new): Same
- as above.
-
- * providers/pop3/camel-pop3-store.c (pop3_connect): Set
- CamelService::connected a little early so that
- camel_pop3_command won't try to connect while already
- connecting
- (connect_to_server): Same.
-
- * providers/nntp/camel-nntp-folder.c (nntp_folder_refresh_info): Same
- as above.
-
-2000-08-28 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (imap_get_message): Fixed the
- hack around quoted string responses - should now handle them
- according to the specifications in the RFC
-
- * providers/imap/camel-imap-stream.c (stream_read): Updated to
- match the code currently used in camel-imap-folder.c
-
-2000-08-28 Ettore Perazzoli <ettore@helixcode.com>
-
- * providers/mbox/camel-mbox-summary.c (camel_mbox_summary_sync):
- Never ever free `tmpname' as it comes from `alloca()'!
-
-2000-08-26 Ettore Perazzoli <ettore@helixcode.com>
-
- * camel-mime-utils.c (header_decode_text): Use `g_free()', not
- `free()', to free `decword'.
-
-2000-08-25 Peter Williams <peterw@helixcode.com>
-
- * camel.c (camel_init): Don't call unicode_init; code in e-util
- will do it, and if unicode_init is called twice, you get an
- infinite loop when looking up nonexistant encodings (patch
- has been submitted to libunicode's maintainer).
-
- * camel-provider.h: Add a new field, default_ports, which
- helps the configuration code guess about how to make CamelURL's
- from providers.
-
- * providers/*/camel-*-provider.c: Specify default ports.
-
-2000-08-25 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c
- (imap_get_subfolder_names_internal): If the url path is "/" and
- the folder path is "/", just LIST "" "*" (this should fix some
- cyrus imapd problems). Also, INBOX is case insensitive so use
- g_strcasecmp
-
-2000-08-24 Lauris Kaplinski <lauris@helixcode.com>
-
- * camel-folder-summary.c (summary_build_content_info):
- Use UTF-8 as default
- * camel-mime-part-utils.c (simple_data_wrapper_construct_from_parser):
- Use UTF-8 as default
- * camel-mime-utils.c (rfc2047_decode_word): Use UTF-8
-
-2000-08-17 Not Zed <NotZed@HelixCode.com>
-
- * providers/mh/camel-mh-folder.c (mh_finalize): And here too.
-
- * providers/mbox/camel-mbox-folder.c (mbox_finalize): Close index
- on exit.
-
-2000-08-23 Dan Winship <danw@helixcode.com>
-
- * camel-mime-utils.c (header_address_list_format_append): put
- commas between addresses.
-
-2000-08-22 Dan Winship <danw@helixcode.com>
-
- * providers/imap/camel-imap-folder.c
- (imap_protocol_get_summary_specifier): use BODY.PEEK, not BODY, so
- we don't set the message \Seen.
-
-2000-08-22 Christopher James Lahey <clahey@helixcode.com>
-
- * providers/pop3/camel-pop3-store.c: Fixed a small warning.
-
-2000-08-22 Peter Williams <peterw@helixcode.com>
-
- * camel-service.c (camel_service_new): Connect automatically if the
- URL is not empty.
- (finalize): Disconnect automatically if connected.
- (camel_service_query_auth_types): Split into two functions; one to
- be called if we're connected to an actual server (_connected), one
- to be called if we're just gauging the general authtypes supported
- (_generic).
- (is_connected): Remove.
-
- * camel-store.c (camel_store_get_folder): Don't connect explicitly to
- the service.
-
- * providers/nntp/camel-nntp-store.c (query_auth_types_generic): Split
- the query_auth_types function. Hook it up in _new.
- (finalize): Don't try to disconnect here.
-
- * providers/pop3/camel-pop3-store.c (query_auth_types_generic): Same.
- (finalize): Don't try to disconnect here.
-
- * providers/imap/camel-imap-store.c (query_auth_types_generic): Same.
- (finalize): Don't try to disconnect here.
-
- * providers/smtp/camel-smtp-transport.c (query_auth_types_generic): Split
- the query_auth_types (dummy, in this case) function. Hook it up in _new.
- (finalize): Don't try to disconnect here.
-
-2000-08-21 JP Rosevear <jpr@helixcode.com>
-
- * providers/nntp/camel-nntp-folder.c (nntp_folder_get_subfolder_names):
- Make sure newsrc is not null
- (nntp_folder_get_subfolder_names): ditto
-
- * providers/nntp/camel-nntp-newsrc.c
- (camel_nntp_newsrc_get_subscribed_group_names): Programming check
- for newsrc == NULL
- (camel_nntp_newsrc_get_all_group_names): ditto
- (camel_nntp_newsrc_write_to_file): ditto
- (camel_nntp_newsrc_write): ditto
-
-2000-08-21 JP Rosevear <jpr@helixcode.com>
-
- * providers/nntp/camel-nntp-store.c (camel_nntp_command):
- Make sure respbuffer is not null before manipulating it.
- If it is null, return CAMEL_NNTP_FAIL and a decent error
- message.
-
-2000-08-18 Peter Williams <peterw@helixcode.com>
-
- * camel-internet-address.c (internet_encode): If the name is "" we
- weren't outputting anything; output the address at least.
-
-2000-08-16 Peter Williams <peterw@helixcode.com>
-
- * camel-internet-address.c (internet_encode): Fix a leak when
- name = "". It's a single-byte leak, but it's the little things
- that count.
-
- * camel-object.c (camel_type_lock_up): Don't leave the type
- system locked when a bad unlock happens.
-
- * providers/mbox/camel-mbox-store.c (get_folder): Fix a leak.
-
-2000-08-15 Peter Williams <peterw@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (imap_copy_message_to): Typo fix.
-
-2000-08-14 Peter Williams <peterw@helixcode.com>
-
- * camel-folder-search.c (search_get_sent_date): New search function;
- returns the time_t when the message was sent.
- (search_get_receive_date): Same for when it was received.
- (search_get_current_date): Gets the current time for use with the
- above two. Is this in the right place?
-
- * camel-folder-search.h: Add the new functions above to the class.
-
-2000-08-13 Dan Winship <danw@helixcode.com>
-
- * providers/nntp/Makefile.am (libcamelnntpinclude_HEADERS): Add
- camel-nntp-utils.h
-
- * providers/imap/camel-imap-folder.c
- (imap_get_subfolder_names_internal): do a strcasecmp rather than
- just a strcmp when checking if a folder is "INBOX", since it is
- a case-insensitive name.
-
-2000-08-12 Dan Winship <danw@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (imap_get_summary_internal):
- Don't assume the FETCH results will come back in the order they
- were requested.
- (imap_get_subfolder_names_internal): Add "INBOX" to the list as
- g_malloc'ed memory, not a static string.
-
-2000-08-12 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-store.c
- (camel_imap_command_continuation): Now takes a char * parameter
- rather than a stream
- (camel_imap_command_continuation_with_stream): Same function as
- above but takes a stream parameter instead
-
- * providers/imap/camel-imap-folder.c (imap_append_message): Use
- camel_imap_command_continuation_with_stream
-
-2000-08-12 Dan Winship <danw@helixcode.com>
-
- * providers/pop3/camel-pop3-store.c (pop3_try_authenticate): New
- function to do one round of attempted authentication.
- (pop3_connect): Move a bunch of code out into
- pop3_try_authenticate and fix some bugs in the edge cases.
-
-2000-08-12 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-store.c (query_auth_types): No longer
- calls try_connect() to get authtypes
-
-2000-08-11 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-store.c
- (camel_imap_command_continuation): Changed param order a bit and
- fixed some logic
-
- * providers/imap/camel-imap-folder.c (imap_append_message): Use
- the new multi-transactional convenience functions
-
-2000-08-11 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-store.c
- (camel_imap_command_preliminary): New convenience function for
- multi-transactional commands (opening request)
- (camel_imap_command_continuation): New convenience function for
- multi-transactional commands (followup data)
-
-2000-08-11 Christopher James Lahey <clahey@helixcode.com>
-
- * providers/mh/camel-mh-folder.c: Fixed a warning.
-
-2000-08-11 Chris Toshok <toshok@helixcode.com>
-
- * providers/nntp/camel-nntp-folder.c
- (camel_nntp_folder_class_init): remove get_name and get_full_name
- assignments, since the camel-folder.c implementation does what we
- need.
-
-2000-08-11 Chris Toshok <toshok@helixcode.com>
-
- * providers/nntp/camel-nntp-store.c
- (camel_nntp_store_get_toplevel_dir): use g_get_home_dir, since
- evolution_dir isn't available in the providers.
-
-2000-08-11 Peter Williams <peterw@helixcode.com>
-
- * camel-folder.c (thaw): Fix a bug where the message_changed
- signal wasn't being emitted.
-
-2000-08-11 Not Zed <NotZed@HelixCode.com>
-
- * providers/mh/camel-mh-folder.c (mh_set_message_user_tag):
- Implement.
- (mh_get_message_user_tag): Implement.
-
- * providers/mbox/camel-mbox-folder.c (mbox_get_message_user_tag):
- (mbox_set_message_user_tag): Implement.
-
- * camel-folder.c (move_message_to): Yay so lets fix an already
- fixed fix, again.
- (copy_message_to): and here too ... update for api change to append().
- And removed another warning.
- (camel_folder_set_message_user_tag): Routine to set message tags.
- (camel_folder_get_message_user_tag): And accessor.
-
-2000-08-10 Christopher James Lahey <clahey@helixcode.com>
-
- * camel-folder-search.c, camel-folder-summary.c, camel-medium.c,
- camel-mime-filter-charset.c, camel-mime-filter.c,
- camel-mime-filter.h, camel-mime-message.c, camel-mime-parser.c,
- camel-mime-part-utils.c, camel-mime-part.c, camel-mime-utils.c,
- camel-movemail.c, camel-multipart.c, camel-object.c,
- camel-stream-mem.c, providers/mbox/camel-mbox-folder.c,
- providers/mbox/camel-mbox-summary.c,
- providers/mh/camel-mh-folder.c,
- providers/smtp/camel-smtp-transport.c: Fixed some warnings.
-
-2000-08-11 Not Zed <NotZed@HelixCode.com>
-
- * providers/vee/camel-vee-folder.c (vee_folder_build_folder): Free
- the search properly.
- (vee_folder_build): And here too.
-
-2000-08-10 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (camel_imap_folder_changed):
- If we go over the max number of messages, don't keep requesting
- new message summaries, just break.
-
-2000-08-11 Not Zed <NotZed@HelixCode.com>
-
- * camel-mime-parser.c (folder_scan_header): A better way to
- compress leading whitespace. The code is probably invalid anyway,
- I dont think it will work across buffer boundaries.
-
- * providers/mbox/camel-mbox-folder.c (mbox_append_message): And
- write out proper format From lines here too.
-
- * providers/mbox/camel-mbox-summary.c
- (camel_mbox_summary_build_from): New function to build a more
- compatible mbox "From " line.
- (camel_mbox_summary_sync): Write From lines in the proper format.
-
-2000-08-10 Not Zed <NotZed@HelixCode.com>
-
- * providers/mh/camel-mh-store.c (get_folder): Remove warnin g.
-
- * providers/mbox/camel-mbox-store.c (xrename): Kill some warnings
- with constification.
-
- * providers/imap/camel-imap-folder.c (imap_append_message): Fixed
- for append api change. Eek this routine seriously wastes memory.
-
- * providers/mh/camel-mh-folder.c (mh_search_free): Impelemnt.
- (mh_append_message): Fix for api change, and include user flags
- and tags in new message.
-
- * providers/vee/camel-vee-folder.c (vee_search_by_expression): Fix
- for search api change.
-
- * camel-folder.c (camel_folder_search_free): New function for
- freeing search results.
- (search_free): Changed my mind, implement a default that actually
- does something. Free as to the old interface.
- (camel_folder_append_message): Changed to accept a
- camelmessageinfo rather than flags, which just doesn't have enough
- info in it.
- (copy_message_to): Change for append_message api change.
- (move_message_to): Likewise.
-
- * providers/mbox/camel-mbox-folder.c (mbox_search_free):
- Implement.
- (mbox_append_message): Fix for api change, and also copy user
- flags/tags across to new summary.
-
- * camel-folder-search.c (search_user_tag): A search expression
- that returns the current use flag by name.
- (camel_folder_search_free_result): New function to free the result
- of a search.
-
- * camel-folder-summary.c: Bump summary version.
- (message_info_new):
- (message_info_load):
- (message_info_save):
- (camel_message_info_dup_to):
- (camel_message_info_free): Added support for arbitrary tag/value
- pairs (CamelTag's).
- (camel_tag_get):
- (camel_tag_set):
- (camel_tag_list_size):
- (camel_tag_list_free): Operations for working with CamelTags.
-
-2000-08-09 Peter Williams <peterw@helixcode.com>
-
- * camel-store.c (camel_store_get_folder): Connect beforehand, if
- necessary.
-
- * providers/imap/camel-imap-store.c (camel_imap_store_init): Default
- the dir_sep to "/" so that certain functions can safely assume that
- dir_sep is valid (at least, nonnull).
-
-2000-08-09 Ettore Perazzoli <ettore@helixcode.com>
-
- * providers/nntp/camel-nntp-folder.c
- (nntp_folder_set_message_flags): Get rid of an unused variable.
-
- * providers/nntp/Makefile.am (INCLUDES): Fix includes so that we
- don't use installed headers anymore. [I copied this over from the
- IMAP provider, that does not seem to have this problem.]
-
-2000-08-09 Not Zed <NotZed@HelixCode.com>
-
- * camel-folder-search.c (camel_folder_search_execute_expression):
- Reorder search result in summary order if we searched with a
- summary.
-
-2000-08-08 Dan Winship <danw@helixcode.com>
-
- * camel-uid-cache.c: New code to keep an on-disk cache of what
- UIDs have been seen in a folder.
-
- * camel-provider.h: Add new flags CAMEL_PROVIDER_IS_SOURCE (mail
- can arrive in it by non-Camel means) and CAMEL_PROVIDER_IS_STORAGE
- (you can work with mail directly without needing to copy it local).
-
- * providers/*/camel-*-provider.c: Add flags as needed: imap and
- mbox are SOURCE and STORAGE. mh and nntp are just STORAGE, pop3 is
- just SOURCE.
-
- * camel-mime-message.c (process_header): Add another subject
- g_strstrip that fejj's earlier commit missed.
-
-2000-08-08 Peter Williams <peterw@helixcode.com>
-
- * camel-provider.h: Remove some GTK stuff that I missed.
-
- * providers/imap/camel-imap-store.c (imap_noop): Turn this
- back on with the new timeout interface in CamelSession.
-
- * camel-session.[ch] (camel_session_register_timeout): New
- interface for Camel to register timeouts. Basically the
- GTK timeout interface is copied. We do this because Camel isn't
- allowed to use GTK anymore.
-
-2000-08-07 Not Zed <NotZed@HelixCode.com>
-
- * providers/mh/camel-mh-folder.c (mh_append_message): Only retry
- another uid if we had a name clash, otherwise fail.
-
-2000-08-07 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c
- (imap_get_subfolder_names_internal): If we are trying to get a
- subfolder listing of the root folder, always make sure INBOX is
- there...
-
- * providers/imap/camel-imap-utils.c (imap_parse_list_response):
- Check for NIL as a directory separator.
-
-2000-08-07 Peter Williams <peterw@helixcode.com>
-
- * providers/nntp/Makefile.am: Reorder the INCLUDES to pull
- in the camel headers from the local source tree before
- the ones in $(includedir). This was causing compile problems
- because the installed, Gtk-based camel-object.h was included
- before the uninstall Camel-based one.
-
-2000-08-07 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-utils.c (imap_translate_sexp): Strip
- all \n's from the expression
-
- * string-utils.c (strip): New convenience function to strip
- occurences of a single char from a string
-
- * camel-mime-message.c (camel_mime_message_set_subject): Do a
- g_strstrip on the subject so we can stop getting those annoying
- leading spaces
-
-2000-08-07 Dan Winship <danw@helixcode.com>
-
- * camel-folder.c (camel_folder_free_deep): Fix this to not require
- NULL-termination of the array.
-
-2000-08-04 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-store.c (imap_connect): If we fail to
- get a dir_sep, then supply the default of "/".
- (get_folder): Undo changes by Peter
-
-2000-08-04 Peter Williams <peterw@helixcode.com>
-
- * providers/imap/camel-imap-store.c (get_folder): Prevent a coredump
- when get_folder()ing from a store with dir_sep = NULL.
-
-2000-08-04 Peter Williams <peterw@helixcode.com>
-
- * camel-store.h: Include camel-object.h. Ettore said this wasn't
- compiling.
-
-2000-08-04 Not Zed <NotZed@HelixCode.com>
-
- * camel-url.c (camel_url_set_protocol):
- (camel_url_set_host):
- (camel_url_set_path):
- (camel_url_set_port): Url editing functions.
-
-2000-08-04 Dan Winship <danw@helixcode.com>
-
- * providers/pop3/camel-pop3-folder.c (pop3_set_message_flags):
- (pop3_sync): Indexes into the flags array are message_number minus
- 1, not just message_number.
-
- * providers/pop3/camel-pop3-store.c: add a debugging macro for
- doing protocol tracing.
-
-2000-08-03 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (camel_imap_folder_new): Only
- call imap_get_summary_internal if the folder can hold messages
-
- * providers/nntp/camel-nntp-provider.c (camel_provider_module_init):
- Initialize the service_cache for the news/nntp providers
-
-2000-08-03 Peter Williams <peterw@helixcode.com>
-
- * providers/nntp/Makefile.am (INCLUDES): Add -I$(top_srcdir) to
- pull in libibex/ibex.h
-
-2000-08-02 Not Zed <NotZed@HelixCode.com>
-
- * providers/mh/camel-mh-summary.c (camel_mh_summary_sync): Expunge
- from the end, so the index isn't messed up when you remove a
- message.
-
- * providers/mh/camel-mh-folder.c (mh_append_message): Fix a bug
- where it would never open an output file/uid.
-
- * providers/mbox/camel-mbox-store.c (rename_folder):
- Implementation for mbox as well.
-
- * camel-store.c (camel_store_rename_folder): New method to rename folders.
- (rename_folder): Default implementation.
-
- * providers/mh/camel-mh-store.c (delete_folder): Implement this.
- (rename_folder): Implement a rename operation.
-
-2000-08-02 Dan Winship <danw@helixcode.com>
-
- * providers/MH: Kill this. It doesn't have any code to do anything
- the new mh provider doesn't do better.
-
- * providers/Makefile.am: Remove reference to MH subdir, and
- promote nntp to fully-supported status, since it does compile and
- all.
-
- * camel-mime-message.c (camel_mime_message_set_subject): Trim
- trailing space from the subject. I've now seen replies from two
- different people that tricked the threading code by (a) not having
- References/In-Reply-To, and (b) adding an extra space to the end
- of the subject line so the subject-based threading fails too. Who
- writes these broken mailers anyway?
-
-2000-08-01 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/smtp/camel-smtp-transport.c (smtp_helo): When forced
- to use the IP, place it in square brackets.
-
- * providers/imap/camel-imap-utils.c (imap_translate_sexp): New and
- improved sexp parser. An honest try at using e-sexp is wrapped in
- a #ifdef at the bottom of the file but is currently not used
-
- * providers/imap/camel-imap-folder.c (imap_search_by_expression):
- We want to do a UID SEARCH so we get UIDs back instead of sequence
- numbers
-
-2000-08-01 Not Zed <NotZed@HelixCode.com>
-
- * providers/mh: New mh provider implementation.
-
- * providers/Makefile.am (SUBDIRS): Added mh provider.
-
-2000-07-31 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (imap_get_message_info_internal):
- Some IMAP servers don't wrap the UID in ()'s so don't depend on that
- (imap_get_summary_internal): Same
-
- * providers/imap/camel-imap-utils.c (free_sexp_node): Oops, forgot to
- free node->function - not good.
-
-2000-07-31 Peter Williams <peterw@helixcode.com>
-
- * providers/vee/camel-vee-folder.c (vee_search_by_expression): Add
- a NULL to the matches pointer array so that g_strfreev knows where
- the end is.
-
-2000-07-31 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-utils.c (imap_translate_sexp): New
- convenience function to translate a Camel sexp into the equivalent
- IMAP sexp.
-
- * providers/imap/camel-imap-store.c: More places now use
- imap_next_word
-
- * providers/imap/camel-imap-folder.c (imap_search_by_expression):
- Implemented initial version (this may or may not work quite right)
-
-2000-07-28 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (imap_expunge): Make sure
- the third word/token (whatever) is "EXPUNGE" and not something
- else like "EXISTS" or "RECENT". When removing the message from
- the summary also make sure to free that data to avoid leakage.
- Also make sure to subtract 1 from the 'id' since IMAP starts
- at 1 and our summary starts at 0 :-)
-
-2000-07-28 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-store.c (camel_imap_status): Cleaned
- up a bit, now uses imap_next_word()
- (camel_imap_command_extended): Now uses imap_next_word(). When
- checking for RECENT, allow the first digit of the recent-count
- be between 0 and 9 inclusive instead of exclusive.
-
- * providers/imap/camel-imap-folder.c (imap_expunge): Optimized.
- No longer will it need to reload the summary as it now instead
- removes the appropriate message summaries from the cache.
- (camel_imap_folder_changed): If recent == 0 then return. If
- recent < 0 then just emit the folder_changed signal, don't reload
- summaries.
-
-2000-07-28 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c
- (imap_get_message_count_internal): Get message count when STATUS
- is not available.
- (imap_init): folder->has_search_capability is required for IMAP so
- should always be set to TRUE (is currently being set to FALSE as
- I've not yet implemented SEARCH support).
- (camel_imap_folder_changed): Seem to have fixed my optimization
- hack
-
-2000-07-28 Jon K Hellan <hellan@acm.org>
-
- * providers/imap/camel-imap-store.h (CamelImapServerLevel): New
- enum.
- (CamelImapStore): Added server_level and has_status_capability
- members.
-
- * providers/imap/camel-imap-store.c (imap_connect): Detect
- IMAP4REV1, IMAP4 and STATUS in capability response.
-
- * providers/imap/camel-imap-folder.c
- (imap_get_message_count_internal): Use STATUS only if server
- supports it. TODO: Get message count when STATUS not supported.
- (imap_get_message, imap_get_summary_internal,
- imap_get_message_info_internal): Handle IMAP4 as well.
- (imap_protocol_get_summary_specifier): New function: Make a data
- item specifier for the header lines we need, appropriate to the
- server level.
-
-2000-07-27 Peter Williams <peterw@helixcode.com>
-
- * camel-mime-utils.c (header_decode_lwsp): More
- checks for end of string.
-
- * providers/imap/camel-imap-store.c:
- (imap_command_extended): Free the elements of our
- array (huge mem leak)
-
- * providers/imap/camel-imap-folder.c:
- (summary_get_internal): Same as above.
-
-2000-07-27 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (camel_imap_folder_changed):
- Fixed my routine to only fetch new headers, my IDs were off by 1
- on the high end, so when it would fetch the last newly arrived
- message it would fail and end up fetching all of the summaries
- because of the corruption.
-
-2000-07-27 Jeffrey Stedfast <fejj@helixcode.com>
-
- * camel-url.c (camel_url_to_string): If the path doesn't begin
- with a / and there is a host, prepend a / to the path.
-
-2000-07-27 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/Makefile.am: Added camel-imap-utils.[c,h]
-
- * providers/imap/camel-imap-utils.[c,h]: Utilities for parsing
- server responses for use in both camel-imap-store.c and
- camel-imap-folder.c
-
- * providers/imap/camel-imap-folder.c (imap_get_summary_internal):
- Free all the pointers in the headers array.
- (imap_get_subfolder_names_internal): Updated to use
- imap_parse_list_response
- (imap_parse_subfolder_list): Removed in favor of
- imap_parse_list_response
-
- * providers/imap/camel-imap-store.c (camel_imap_command_extended):
- Free all the pointers in the data array.
- (imap_connect): Updated to use imap_parse_list_response and fixed
- a leak
- (folder_is_selectable): Updated.
-
-2000-07-27 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (imap_get_message_info): Now
- uses a hash table for looking up message info rather than a linear
- search :)
-
-2000-07-27 Peter Williams <peterw@helixcode.com>
-
- * providers/*/Makefile.am: Don't specify SUBDIRS =
- [nothing]. Messes up distcheck.
-
-2000-07-26 Peter Williams <peterw@helixcode.com>
-
- * camel-mime-parser.c (folder_scan_init): Initialize
- outbuf to be "" -- it's not guaranteed to be zeroed.
-
- * camel-mime-utils.c (header_references_decode): Return
- if the header is NULL -> or "" <-. Don't do our stupid
- mailer trick if we point to \0.
- (header_decode_quoted_string): Don't rip past end of
- string!
-
-2000-07-26 Dan Winship <danw@helixcode.com>
-
- * camel-movemail.c (movemail_external): routine to call an
- external movemail program.
- (camel_movemail): Nuke return value, use movemail_external when
- available and useful, and don't delete "dest" on errors, since
- it might have started non-empty.
-
-2000-07-26 Jeffrey Stedfast <fejj@helixcode.com>
-
- * camel-url.c (camel_url_to_string): Should now always prepend a '/'
- before the path if it doesn't already exist.
-
- * providers/imap/camel-imap-folder.c: Fixed a few compiler warnings
-
-2000-07-25 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (imap_summary_free): Fixed the
- real problem that Peter was running into.
-
-2000-07-25 Dan Winship <danw@helixcode.com>
-
- * camel-mime-message.c (write_to_stream): Don't add a Mime-Version
- header to a message that already has one.
-
- * camel-internet-address.c (internet_encode): Don't put <>s around
- addresses with no name part.
-
-2000-07-25 Peter Williams <peterw@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (imap_expunge): Set
- imap_folder->summary to NULL after calling imap_summary_free,
- so we don't get stuck with a junk summary pointer. Should
- we free it at all?
-
-2000-07-25 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (camel_imap_folder_changed):
- Optimized to try and get the new message headers without reloading
- the entire summary from scratch.
- (imap_get_summary_internal): Will now sync() before attempting to
- reload the summary so that flags are set in the reloaded summary
- as well.
-
-2000-07-24 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-store.c (get_folder): Updated to give
- special attention to the root folder.
-
- * providers/imap/camel-imap-folder.c
- (imap_get_subfolder_names_internal): Updated to handle the root
- folder
- (imap_get_message_count_internal): return 0 if folder can't hold
- messages
- (camel_imap_folder_new): Change so that root folder gets special
- attention and always gets can_hold_messages set to FALSE
-
-2000-07-24 Dan Winship <danw@helixcode.com>
-
- * camel-folder.c: Remove exceptions from a number of methods that
- work on what ought to be static data: get_parent_folder,
- get_parent_store, get_message_count, get_unread_message_count,
- get_permanent_flags, get_message_flags, set_message_flags,
- get_message_user_flag, set_message_user_flag, get_uids,
- get_summary, get_subfolder_names. Turn camel_folder_delete_message
- into a macro. (Mostly a pull-up from the camel-async branch.)
-
- * providers/{imap,mbox,nntp,pop3,vee}: Update for CamelFolder
- changes
-
-2000-07-24 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (imap_get_message_info): Updated
- to port easily to the new Camel API
- (imap_init): Don't SELECT INBOX, we don't need to do that
-
-2000-07-24 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (camel_imap_folder_new):
- Initialize the summary and subfolder listing.
- (imap_summary_free): Now takes a GPtrArray arg rather than a
- CamelImapFolder as it increases it's usefullness for free()'ing
- temporary summaries.
- (imap_get_message_count_internal): A new convenience function for
- getting the actual message count on a server to be used by
- imap_get_summary_internal)
- (imap_get_message_count): Since the Camel API is on the move again,
- the future version of this function will not be able to make a
- call to the store, it must only access previously fetched data (thus
- the creation of the _internal function)
- (imap_get_subfolder_names_internal): Again, because the future version
- of imap_get_subfolder_names will not take an exception, we must rename
- this function which will be called by camel_imap_folder_new()
- (imap_get_subfolder_names): We now return the previously collected
- subfolder listing that the _internal function fetched previously
- (imap_get_summary_internal): Again, same idea as the previous _internal
- functions...
- (imap_get_summary): Again... now returns a previously aquired summary
-
- * providers/imap/camel-imap-store.c (imap_noop): This will hopefully
- prevent the imap store from disconnecting.
- (imap_connect): Modified to add a gtk timeout event that will call
- imap_noop() every 10 minutes (we may want to change this time value)
- (imap_disconnect): Modified to remove the NOOP timeout event from the
- store.
- (camel_imap_command_extended): Commented out the code that would try
- and detect if the store was disconnected and then reconnect if it was
- needed.
-
-2000-07-24 Dan Winship <danw@helixcode.com>
-
- * camel-folder.[ch]: Remove camel_folder_get_message_uid, which
- was not used, and not implemented by any provider.
-
- * providers/nntp/camel-nntp-folder.c: Remove get_message_uid
- non-implementation.
-
- * camel-folder-pt-proxy.[ch], camel-arg-collector.c,
- camel-marshal-utils.[ch]: Bye bye bye.
-
- * Makefile.am: remove reference to camel-arg-collector.c
-
-2000-07-23 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-store.c (imap_disconnect): Made it a
- little more forgiving. Also set current_folder to NULL as there is
- no selected folder after a disconnect.
- (stream_is_alive): Detects whether or not a socket is "alive"
- (camel_imap_command_extended): Use stream_is_alive() to aid in the
- detection of a disconnected state.
-
-2000-07-22 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-store.c (get_folder): Clear
- CamelExceptions when appropriate (eg when folder is marked as
- \NoSelect). Still needs some cleanup and perhaps Dan will have a
- better way of doing this as this seems like a messy way of
- handling this.
-
- * providers/imap/camel-imap-folder.c (imap_get_uids): Took out
- some debug statements as they are no longer needed.
-
-2000-07-21 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (imap_get_subfolder_names):
- Updated to not strip out subfolders that are marked as \NoSelect
- because this will be correctly handled in store->get_folder from
- now on.
-
- * providers/imap/camel-imap-store.c (folder_is_selectable): New
- convenience function for use in get_folder().
- (parse_list_response): Now takes a char **flags argument which is
- needed by folder_is_selectable().
- (imap_connect): Updated to reflect changes to
- parse_list_response().
-
-2000-07-21 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-stream.c (stream_read): Updated with
- some of the same fixes I've made to camel-imap-folder.c like
- recalculating message part lengths.
-
- * providers/imap/camel-imap-store.c (camel_imap_command_extended):
- Rewrote the code to check for "* %d RECENT". Still needs to be
- modified, but should no longer cause an infinite loop by detecting
- mis-detecting RECENT messages.
-
-2000-07-20 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (imap_get_summary):
- (imap_get_message_info): Oops. Fix UID parser to allow 0 and 9 to
- be in the range of valid UID chars.
-
-2000-07-20 Peter Williams <peterw@helixcode.com>
-
- * camel-object.c (camel_object_unref): Add a new global mutex
- 'refcount' held when refcounting operations occur.
-
-2000-07-19 Peter Williams <peterw@helixcode.com>
-
- * camel-object.c (camel_type_lock_up): Correct the recursiveness;
- the locklevel is stored as a private, so each thread has its own
- idea of the locklevel. Thus one thread can relock, but a different
- one will think that it's a level 0 and try to lock the type_system
- mutex.
-
-2000-07-19 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c: General cleanup working
- towards getting Actions->Expunge working correctly.
-
- * providers/imap/camel-imap-store.c
- (cammel_imap_command_extended): Added code to look for "* %d
- RECENT" and to emit the folder_changed signal if there are any
- recent messages. Note: this is a hack and needs to be rewritten
- badly.
-
-2000-07-19 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (imap_get_summary): If the
- folder's message count is not the same as the number of summaries,
- free the old summary and create a new summary.
-
-2000-07-18 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c
- (camel_imap_folder_class_init): Added in
- imap_[g,s]et_message_user_flag() methods
- (imap_get_message_info): Rewrote to use the more efficient way of
- downloading summary information and also added a UID comparison so
- that if the UID requested doesn't match the UID received, it
- returns NULL. FIXME: When the mailer gets NULL when it requested
- message info, it seems that it displays a row for that message and
- when you try and select the blank row, it segfaults.
-
- * providers/imap/camel-imap-store.c (get_folder): Oops, this
- should not be checking against "/", it should be checking against
- dir_sep.
-
- * providers/imap/camel-imap-folder.c (imap_parse_subfolder_line):
- Updated to trim out the leading namespace.
- (imap_get_subfolder_names): Let the subfolder parser trim the
- namespace off the folder name.
-
-2000-07-17 Peter Williams <peterw@helixcode.com>
-
- * camel-object.c (camel_type_lock_up): New function; the
- Camel type_system lock is now fakey-recursive, being controlled
- by a semaphore that goes up and down and is protected by another
- lock. Theoretically all we need is the lock on the semaphore,
- but this we catch exceptions "better" (by deadlocking).
- (camel_type_lock_down): Corresponding to above.
- (all functions): s,G_LOCK,camel_type_lock_up, etc.
-
-2000-07-17 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-store.c (imap_disconnect): Send a
- "LOGOUT" command.
-
- * providers/imap/camel-imap-folder.c (imap_get_message): Hacks to
- get IMAP code to work with CommunigatePro and MS Exchange (and any
- other servers that send back a UID at the end of each FETCH inside
- of the main body of the message part).
- (imap_sync): Un-#if 0 the code that sets the flags on the IMAP
- server for messages that have changed. Oops, don't mask with
- DELETED to find out if the message has been answered ;-)
- (imap_expunge): sync before expunging.
-
-2000-07-16 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-store.c: All SELECT calls now pass
- a NULL folder argument to camel_imap_command_extended() since it's
- not needed.
- (imap_connect): Moved service_class->connect() to the point right
- after a connection is established with the server rather than
- waiting until the end of the function.
- (camel_imap_command): Updated the documentation comment
- (camel_imap_command_extended): Before sending a command, first
- check to make sure we are connected; if we aren't, then reconnect.
- Don't strncmp() command with "SELECT" as it's redundant.
-
- * providers/imap/camel-imap-folder.c: All SELECT calls now pass
- a NULL folder argument to camel_imap_command_extended() since it's
- not needed. Also s/camel_imap_command/camel_imap_command_extended as
- I will probably be doing away with camel_imap_command() or at least
- only using it for LOGIN and similar commands where the server won't
- notify us of any recent messages.
-
-2000-07-15 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (camel_imap_folder_new):
- One last fix to get rid of hard-coded "/" directory separators
-
-2000-07-14 Peter Williams <peterw@helixcode.com>
-
- * camel-object.c : Implement 'events', which are suspiciously
- like signals except without all the marshalling baggage, and
- with quasi-thread-safety.
- (camel_object_class_declare_event): New func.
- (camel_object_hook_event): Ditto.
- (camel_object_trigger_event): Ditto.
- (obj_class_init): Declare the "finalize" event.
- (obj_class_finalize): Free the hashtable of events->preps
- (obj_finalize): Free the hashtable of events->hooklists
- (camel_object_unref): Trigger the finalize event (ourselves,
- to prevent massively unpleasant looping things.)
-
-2000-07-14 Peter Williams <peterw@helixcode.com>
-
- * camel-object.c (make_global_classfuncs): Change to return
- a CamelObjectClass. Change parents to a GSList and free it
- when done.
- (camel_object_new): Don't allocate a classfuncs for every object;
- merely give it a reference to the global_classfuncs. Convert
- parents to a GSList and free it when done.
- (camel_object_unref): Don't free the classfuncs. Free the parents
- list, which is changed to a GSList.
-
-2000-07-14 Jeffrey Stedfast <fejj@helixcode.com>
-
- * string-utils.c (string_unquote): New convenience function
- to unquote a string if it's encapsulated by "'s
-
- * providers/imap/camel-imap-folder.c:
- * providers/imap/camel-imap-store.c: Made the necessary changes
- to stop using hard coded directory separators.
-
-2000-07-13 Dan Winship <danw@helixcode.com>
-
- * providers/mbox/camel-mbox-summary.c (camel_mbox_summary_load):
- If the summary is for a smaller mbox, and rebuilding from the
- last-known end position fails, try rebuilding from the beginning.
- Deals with the case where the user edits the mbox and makes it
- bigger, without adding new messages.
-
-2000-07-13 Peter Williams <peterw@helixcode.com>
-
- * camel-object.c: Rewritten to not be based on GtkObject,
- but a tiny threadsafe ripoff thereof. Objects still cannot
- be shared across threads, but ref/unref/destroy/new/etc
- will work. Signals are not implemented because doing it
- robustly would be a major pain in the butt, but class
- functions are. There's a small demonstration that it doesn't
- crash in ./temp-test.c: build it with ./make-test.sh.
- * camel-stream.c, camel-seekable-stream.c, camel-stream-mem.c:
- moved over to CamelObject. Proof of concept: two levels of
- subclass and class functions, all working without coredumps.
- To port to CamelObject:
- - s,GTK_,CAMEL_,g in the cast checks
- - s,gtk_type_new,camel_object_new,g
- - s,GtkType,CamelType,g
- - Change get_type function over to camel_type_declare
- - instead of hooking to finalize function, it goes into the
- type declaration.
- - remove signals.
- - instead of GTK_OBJECT(so)->klass, CAMEL_OBJECT_GET_CLASS(so)
- - s,gtk_type_class,camel_type_get_global_classfuncs,g
- - don't chain finalize handlers; it will be done for you
-
-2000-07-13 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c:
- * providers/imap/camel-imap-store.c: If a SELECT fails, set
- imap_store->current_folder to NULL so a SELECT is forced before
- any message/folder operations are requested. Also, because some
- users don't use a namespace, make sure that if the url->path is
- "/" we don't use it when creating the folder_path.
- (camel_imap_command[_extended]): Since we allow the passing of
- a NULL folder which we can use to bypass a forced SELECT, no need
- to check for the individual commands that don't require a folder
- to be selected.
-
-2000-07-13 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c:
- * providers/imap/camel-imap-store.c: Updated to use CAMEL_IMAP_OK,
- CAMEL_IMAP_NO, CAMEL_IMAP_BAD, and CAMEL_IMAP_FAIL rather than the
- ones copied from the POP3 provider.
-
-2000-07-13 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (imap_get_summary): Oops.
- If the number of messages in the folder is 0, don't fetch
- summaries 1 thru 0, just return an empty summary.
- (imap_copy_message_to): Fixed to use message UID and also send
- the source folder as an arg to camel_imap_command rather than NULL.
- (imap_move_message_to): Same.
- (imap_init): If SELECT is successful, we need to set the current
- folder to the one selected, this was causing problems with move/copy
-
-2000-07-13 Dan Winship <danw@helixcode.com>
-
- * camel-service.h: define a set of CAMEL_SERVICE_URL_ALLOW_* flags
- parallel to the _NEED_* flags, and make the _NEED_* flags imply
- the _ALLOW_* ones.
-
- * providers/imap/camel-imap-store.c (camel_imap_store_init): imap
- urls ALLOW_PATH
-
-2000-07-13 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (imap_get_summary): New
- and improved approach to fetching an entire folder summary
- that should be much much faster than the old way as it gets
- the entire folder summary in 1 shot rather than requesting
- message by message. As with the last update, this version
- also only fetches the minimum number of header fields.
- (imap_get_summary): Oops, forgot to free the temp
- GPtrArray *headers
-
-2000-07-13 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (imap_get_summary): Don't
- fetch the entire RFC822 header, just fetch the fields we want.
- (imap_get_message_info): Same.
-
-2000-07-13 Not Zed <NotZed@HelixCode.com>
-
- * camel-mime-filter-basic.c (camel_mime_filter_basic_new_type):
- Reset filter on setup.
- (reset): When resetting qp encoding, set the state to -1, instead
- of 0.
-
- * camel-mime-utils.c (quoted_encode_step): Actually count the
- characters output sofar (it never counted any). Bunch of other
- fixes.
- (quoted_encode_close): Also flush out final character, if there's
- one.
-
-2000-07-12 Jeffrey Stedfast <fejj@helixcode.com>
-
- Chris forgot to add #include <e-util/e-util.h> to the source files
-
- * providers/imap/camel-imap-store.c (imap_connect): Fixed Peter's
- fix, we don't want to send a string to a %d.
-
-2000-07-12 Christopher James Lahey <clahey@helixcode.com>
-
- * camel-folder-search.c, providers/imap/camel-imap-store.c:
- Changed from strstrcase to e_strstrcase.
-
- * string-utils.c, string-utils.h: Removed strstrcase (in favor of
- e_strstrcase in e-util/e-util.c.)
-
-2000-07-12 Chris Toshok <toshok@helixcode.com>
-
- * providers/nntp/camel-nntp-folder.c
- (nntp_folder_set_message_flags): get the article num out of our
- uid and mark it read in the newsrc.
- (nntp_folder_get_message): get the message id out of the uid to
- fetch the article.
-
- * providers/nntp/camel-nntp-utils.c (get_XOVER_headers): the uid
- is now <article-num>,<messageid>
- (get_HEAD_headers): same.
-
- * camel-mime-parser.c (folder_scan_step): go to HSCAN_MESSAGE
- state when ct->subtype is "news" as well as "rfc822". this makes
- attachments of type "message/news" display properly.
-
-2000-07-12 Dan Winship <danw@helixcode.com>
-
- * camel-folder.c (camel_folder_free_deep,
- camel_folder_free_shallow, camel_folder_free_nop): Useful default
- implementations for free_{uids,subfolder_names,summary}.
- (free_subfolder_names, free_uids): Make these g_warning-ing
- default implementations.
-
- * providers/*/camel-*-folder.c: Use the new functions where
- appropriate, remove duplicated code.
-
-2000-07-12 Peter Williams <peterw@helixcode.com>
-
- * providers/imap/camel-imap-store.c (query_auth_types): Check for
- NULL parameters when setting the exception so as to not crash on
- Solaris (can't handle a %s passed NULL).
- (imap_connect): Same.
-
-2000-07-12 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/mbox/camel-mbox-folder.c (mbox_delete_message): Use
- mbox_set_message_flags () instead of setting the flags by hand. This
- fixes the problem of the "message_changed" signal not being emitted
- at the correct time.
-
- * providers/imap/camel-imap-folder.c: "folder_changed" signals should
- pass a third argument (which is ignored).
-
- * camel-folder.c: Undo gtk signal emits done in set_flags and
- expunge.
- (move_message_to):
- (copy_message_to): Create info as a const CamelMessageInfo
-
-2000-07-12 Chris Toshok <toshok@helixcode.com>
-
- * providers/nntp/Makefile.am: don't add test-newsrc to the build
- since it needs libcamel (which isn't built at the time test-newsrc
- needs linking.)
-
- * providers/nntp/camel-nntp-utils.c (get_HEAD_headers): fill in
- MessageInfo->message_id.
- (get_XOVER_headers): same.
-
- * providers/nntp/camel-nntp-folder.c (nntp_folder_init): move
- summary loading here.
- (nntp_folder_sync): summary/newsrc changes should be stored here.
- put a comment to that effect.
- (nntp_folder_set_message_flags): don't save the newsrc here.
- (nntp_folder_get_uids): use g_ptr_array_index instead of the
- cast/addition.
- (nntp_folder_get_summary): no need to check if we should generate
- the summary here. already done.
- (nntp_folder_get_message_info): implement.
-
- * providers/nntp/camel-nntp-store.c
- (camel_nntp_store_get_toplevel_dir): use evolution_dir instead of
- computing it ourselves.
- (nntp_store_disconnect): call camel_nntp_newsrc_write.
- (ensure_news_dir_exists): new function to create the news/<news
- server> subdir.
- (camel_nntp_store_class_init): hook up connect/disconnect and
- finalize.
- (nntp_store_connect): if ensure_news_dir_exists fails throw an
- exception.
-
-2000-07-12 Peter Williams <peterw@helixcode.com>
-
- * camel-folder.c (camel_folder_set_message_flags): Emit a message_changed
- signal once the flags are set on the message.
- (camel_folder_set_user_flag): Ditto.
- (camel_folder_expunge): Emit a folder_changed if no exception.
-
-2000-07-12 Jeffrey Stedfast <fejj@helixcode.com>
-
- * camel-stream.c: Use size_t and ssize_t for read/write methods
-
- * providers/imap/camel-imap-folder.c (imap_set_message_flags):
- Updated to emit the message_changed signal.
- (imap_delete_message): Updated to use imap_set_message_flags ().
- (imap_move_message_to): Updated to use imap_set_message_flags ()
- and to emit the folder_changed signal on the destination folder.
- (imap_copy_message_to): Updated to emit the folder_changed signal
- on the destination folder.
- (imap_append_message): Updated to emit the folder_changed signal
- on the destination folder.
-
-2000-07-11 Jeffrey Stedfast <fejj@helixcode.com>
-
- * camel-folder.c (camel_folder_append_message): Now takes a
- flags argument to specify the flags to be set on the message
- since we might not necessarily want the flags to be wiped clean.
- (move_message_to):
- (copy_message_to): Updated to send a flags argument to
- append_message (); currently sends the original message's flags.
-
- * providers/mbox/camel-mbox-folder.c (mbox_append_message):
- * providers/imap/camel-imap-folder.c (imap_append_message):
- Updated.
-
-2000-07-11 Dan Winship <danw@helixcode.com>
-
- * camel-folder.c: Remove exceptions from a number of methods
- that work on what ought to be static data: get_parent_folder,
- get_parent_store, get_message_count, get_unread_message_count,
- get_permanent_flags, get_message_flags, set_message_flags,
- get_message_user_flag, set_message_user_flag, get_message_uid,
- get_uids, get_summary, get_subfolder_names. Turn
- camel_folder_delete_message into a macro.
-
- * providers/{mbox,pop3,vee}: Update for CamelFolder changes
-
- * providers/Makefile.am: Disable imap and nntp for now
-
-2000-07-11 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (imap_search_by_expression):
- This shouldn't return NULL, it should return g_ptr_array_new ()
- so the mailer gets what it expects.
-
-2000-07-10 Jeffrey Stedfast <fejj@helixcode.com>
-
- * camel-folder-summary.c (camel_folder_summary_decode_string):
- Oops, an unsigned integer can never be < 0
-
-2000-07-10 Dan Winship <danw@helixcode.com>
-
- * providers/vee/camel-vee-folder.c (vee_search_by_expression):
- Initialize a variable to make this not crash again. And fix a bug
- so it actually does something.
-
-2000-07-10 Jeffrey Stedfast <fejj@helixcode.com>
-
- * camel-folder-summary.c: Cleaned up a bunch of compile warnings
-
-2000-07-10 Dan Winship <danw@helixcode.com>
-
- * providers/vee: kill more debugging messages
-
-2000-07-10 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/mbox/camel-mbox-folder.c (mbox_get_unread_message_count):
- * providers/vee/camel-vee-folder.c (vee_get_unread_message_count):
- * providers/imap/camel-imap-folder.c (imap_get_unread_message_count):
- Implemented.
-
- * camel-folder.c (camel_folder_get_unread_message_count): New
- convenience function to allow the mailer to query the number
- of unread messages in a folder (for displaying message stats
- in a folder tree?).
-
-2000-07-09 Dan Winship <danw@helixcode.com>
-
- * camel-mime-utils.c (header_references_dup): New function to copy
- a header_references structure.
-
- * camel-folder-summary.c (camel_message_info_dup_to): New function
- to (deep) copy the data from one CamelMessageInfo into another.
- (camel_message_info_free): And free the data.
-
- * providers/vee/camel-vee-folder.c (vee_sync): Implement. (empty).
- (vee_search_by_expression): belatedly update for
- camel_folder_search change.
- (vee_folder_build): belatedly update for camel_folder_search
- change. Use camel_message_info_dup_to and camel_message_info_free
- (in particular, so that we get message_id and references info so
- vfolders can be threaded).
- (vee_folder_build_folder): Ditto.
-
-2000-07-08 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/nntp/camel-nntp-folder.c:
- * providers/nntp/camel-nntp-utils.c:
- * providers/nntp/camel-nntp-store.c: Update to reflect past changes
- in the Camel API. Use gtk macro casts wherever possible and use glib's
- memory functions instead of standard c's (since they are not
- compatable)
-
- * providers/smtp/camel-smtp-transport.c:
- * providers/imap/camel-imap-store.c: Wrap debug print statements
- in a macro
-
- * providers/imap/camel-imap-stream.c (stream_read): Make sure
- that we get up to and including the last \n of the mime part.
-
- * providers/imap/camel-imap-folder.c (imap_get_message): Make sure
- that we get up to and including the last \n of the mime part.
- Wrap debug print statements in a macro.
-
- * providers/imap/camel-imap-stream.c (stream_read): Only cache
- the important data (aka the mime part requested and no extra
- server response stuff)
-
-2000-07-07 Dan Winship <danw@helixcode.com>
-
- * camel-mime-utils.c (header_references_decode): Work around
- In-Reply-To's with unquoted punctuation. So many broken mailers.
-
- * camel-folder.c (camel_folder_search_by_expression): Make this
- return a GPtrArray rather than a GList.
-
- * camel-folder-search.c (camel_folder_search_execute_expression):
- * providers/imap/camel-imap-folder.c (imap_search_by_expression):
- * providers/mbox/camel-mbox-folder.c (mbox_search_by_expression):
- * providers/nntp/camel-nntp-folder.c (nntp_search_by_expression):
- Update to return a GPtrArray rather than a GList.
-
-2000-07-07 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/smtp/camel-smtp-transport.c (esmtp_get_authtypes):
- Fixed the parser to actually work
-
-2000-07-06 Dan Winship <danw@helixcode.com>
-
- * camel-mime-utils.c (header_references_decode): Make this deal
- with the full RFC822 References/In-Reply-To format rather than
- just the more-nicely-behaved RFC1036 version. (Needed to parse
- In-Reply-To headers with extra junk in them.)
-
-2000-07-06 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (imap_get_summary): Parse for
- more header information to allow message threading in IMAP.
- (imap_get_message_info): Same.
-
- * camel-folder-summary.c: Renamed summary_format_* to
- camel_summary_format_* and moved them into public scope.
-
- * providers/smtp/camel-smtp-transport.c (smtp_connect): Oops. Don't
- pass port # as a string in the error code (if it fails to connect).
-
- * providers/imap/camel-imap-folder.c (imap_append_message): Changed
- over to camel_imap_command_extended as that was the source of the
- problems - apparently appending replies with more than just 1 line.
-
-2000-07-05 Dan Winship <danw@helixcode.com>
-
- * camel-folder-search.c (search_header_contains): make header
- matching case-insensitive
-
- * camel-folder-summary.c:
- * camel-session.c:
- * providers/mbox/camel-mbox-folder.c:
- * providers/mbox/camel-mbox-summary.c: Remove some non-error case
- debugging-type messages.
-
-2000-07-05 Ettore Perazzoli <ettore@helixcode.com>
-
- * providers/mbox/camel-mbox-summary.c (d): Define to empty so that
- we get rid of a ton of debugging messages.
-
-2000-07-05 Jeffrey Stedfast <fejj@helixcode.com>
-
- * camel-mime-utils.h: Added prototype for uudecode_step
-
- * camel-mime-utils.c (uudecode_step): Cleaned up some junk that
- should have been cleaned up when debugging printf's were taken out.
-
-2000-07-05 Ettore Perazzoli <ettore@helixcode.com>
-
- * providers/mbox/camel-mbox-summary.c (camel_mbox_summary_sync):
- Update the X-Evolution: header even if the in-memory UID and the
- saved UID are not the same. Otherwise mboxes with clashing UIDs
- can never be fixed.
-
- * camel-folder-summary.c
- (camel_folder_summary_add_from_parser): Add the message to the
- summary before doing any ibex stuff. In fact, this might also
- have the side effect of reassigning the UID so it needs to be done
- before we start using the UID.
-
- * providers/mbox/camel-mbox-folder.c (mbox_append_message): Add
- debugging message to keep track of the UIDs we add.
-
-2000-07-05 Dan Winship <danw@helixcode.com>
-
- * camel-folder-summary.c: Add "Cc" to summary and bump summary
- version number.
-
- * camel-folder-search.c (search_header_contains): make "Cc" a
- searchable header.
-
-2000-07-03 Ettore Perazzoli <ettore@helixcode.com>
-
- * camel-folder-summary.c (camel_folder_summary_next_uid_string):
- New.
- (camel_folder_summary_add): Use
- `camel_folder_summary_next_uid_string()' instead of recomputing
- the UID manually here.
- (camel_folder_summary_add_from_parser): Likewise.
-
-2000-07-03 Ettore Perazzoli <ettore@helixcode.com>
-
- * camel-folder-summary.c (camel_folder_summary_set_uid): Removed.
-
-2000-07-03 Dan Winship <danw@helixcode.com>
-
- * camel-folder-summary.c (message_info_new): Parse In-Reply-To
- with header_references_decode, not header_msgid_decode.
-
- * camel-mime-message.c (camel_mime_message_class_init): message
- headers are case-insensitive.
-
- * providers/pop3/camel-pop3-store.c (camel_pop3_command): Fix a
- bug in error-setting code.
- (pop3_connect): Don't re-prompt for password in the KPOP case.
- (pop3_get_response): New function, split out from
- camel_pop3_command.
- (connect_to_server): Use pop3_get_response to parse the greeting
- message, and error out appropriately if it's -ERR.
-
-2000-07-02 Dan Winship <danw@helixcode.com>
-
- * camel-folder.c (camel_folder_freeze, camel_folder_thaw): New
- functions to freeze and thaw a folder (to prevent message/folder
- changed signals in the middle of a long series of operations).
- (camel_folder_class_init): Change signals to GTK_RUN_FIRST.
- (message_changed, folder_changed): Add default implementations
- that stop the emission and record info for later if the folder is
- frozen.
-
- * providers/mbox/camel-mbox-folder.c (mbox_sync): leftover fixes
- from the close->sync change: don't destroy the ibex, summary, and
- search when syncing.
- (append_message): emit "folder_changed" on a successful append.
-
-2000-07-02 Jeffrey Stedfast <fejj@helixcode.com>
-
- * camel-mime-utils.c (uudecode_step): A rather complex uudecoder
- written in the spirit of Zucchi-ness, is it up to par? Only the
- Z-man can tell us :-)
-
-2000-07-01 Dan Winship <danw@helixcode.com>
-
- * camel-service.c (camel_service_get_name): New method, to return
- an end-user-friendly name corresponding to a service. (eg, "POP
- service for danw on trna.helixcode.com").
-
- * providers/imap/camel-imap-store.c,
- providers/mbox/camel-mbox-store.c,
- providers/nntp/camel-nntp-store.c,
- providers/pop3/camel-pop3-store.c,
- providers/sendmail/camel-sendmail-transport.c,
- providers/smtp/camel-smtp-transport.c: Implement.
-
- * providers/imap/Makefile.am: remove unneeded
- libcamelimap_la_LDADD.
-
- * providers/pop3/camel-pop3-store.c (connect_to_server): fix the
- CAPA-parsing code to not get into an infinite loop.
-
-2000-07-01 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (imap_get_message): Fixed
- the bug that would sometimes leave part of the server response
- tacked on to the end of the message.
-
- * camel-folder.c: Renamed _by_uid methods. Since we no longer
- have get-by-number methods, no need to have the _by_uid
- extensions.
- (get_message_by_uid): Renamed to get_message
- (delete_message_by_uid): Renamed to delete_message
- (summary_get_by_uid): Renamed to get_message_info
-
- * providers/mbox/camel-mbox-folder.c:
- * providers/pop3/camel-pop3-folder.c:
- * providers/imap/camel-imap-folder.c:
- * providers/vee/camel-vee-folder.c: Updated to reflect
- camel-folder changes.
-
-2000-06-30 Jeffrey Stedfast <fejj@helixcode.com>
-
- * camel-folder.c (camel_folder_copy_message_to): New function, to
- copy a message from one folder to another. The default
- implementation just uses append_message, but providers can
- implement more efficient versions for use when both folders are on
- the same store.
-
- * broken-date-parser.[c,h]: Utilities for parsing broken
- date strings.
-
- * providers/imap/camel-imap-folder.c (imap_move_message_to):
- (imap_copy_message_to): Implemented.
-
- * camel-mime-utils.c (header_decode_date): Wrote some code to try
- and un-mangle broken date formats and then parse that new string
- instead.
-
-2000-06-30 Dan Winship <danw@helixcode.com>
-
- * camel-folder.c (camel_folder_move_message_to): New function, to
- move a message from one folder to another. The default
- implementation just uses append_message and delete_message, but
- providers can implement more efficient versions for use when both
- folders are on the same store.
-
-2000-06-29 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (imap_expunge): Should now
- print a meaningful error message when it doesn't succeed
-
-2000-06-28 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-store.c (imap_connect): Changed to
- keep prompting user for a valid password until it either
- authenticates or until Canceled by the user.
- (camel_imap_command_extended): Improved speed (replaced the
- g_strjoinv call with a faster implementation)
-
- * providers/pop3/camel-pop3-store.c
- (camel_pop3_command_get_additional_data): Fixed.
- (pop3_connect): Changed to keep prompting the user for a
- password until it either works or until Canceled by the user.
-
- * providers/mbox/camel-mbox-summary.c: General cleanup
- (camel_mbox_summary_sync): Fixed a memory leak and added
- CamelException handling.
-
- * providers/mbox/camel-mbox-store.c (delete_folder): Fixed a
- memory leak
-
- * providers/mbox/camel-mbox-folder.c (mbox_append_message):
- Default 'off_t seek' to -1 so as to make sure it's initialized
- before it's used in the case of a bad stat() call.
- (mbox_sync): Updated
- (mbox_expunge): Updated
-
-2000-06-27 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-store.c (imap_connect): Move the
- CAPABILITY command here so we don't have to keep checking
- each time we open a folder.
- (camel_imap_command_extended): If we are doing an EXAMINE,
- don't bother doing a SELECT first.
-
- * providers/imap/camel-imap-folder.c (imap_init): Update so
- folder->has_search_capability depends on the parent IMAP store
- (since this is really dependant on the IMAP implementation and
- not the folder)
-
-2000-06-27 Christopher James Lahey <clahey@helixcode.com>
-
- * providers/smtp/camel-smtp-transport.c: Don't close the filter
- stream when done with it (this causes the source stream to close);
- Instead, just flush it when done.
-
-2000-06-27 Michael Zucchi <zucchi@zedzone.mmc.com.au>
-
- * camel-folder-search.c (search_header_contains): Make header
- search 'to' match 'to', and not 'from', small typo, fixes #317.
-
-2000-06-26 Christopher James Lahey <clahey@helixcode.com>
-
- * providers/mbox/camel-mbox-summary.c: Added debugging
- information.
-
-2000-06-23 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-store.c:
- * providers/imap/camel-imap-folder.c: Improved folder parsing.
- Not specifying a namespace should no longer list the entire
- filesystem.
-
-2000-06-22 Chris Toshok <toshok@helixcode.com>
-
- * providers/nntp/.cvsignore: ignore test-newsrc
-
- * providers/nntp/camel-nntp-store.c,
- providers/nntp/camel-nntp-store.h,
- providers/nntp/camel-nntp-folder.c,
- providers/nntp/camel-nntp-folder.h,
- providers/nntp/camel-nntp-utils.c: Bring the nntp provider up to a
- state where it builds and is usable with the current camel. there
- are still warts (semi-broken .newsrc file handling, and a lack of
- a subscribe ui -- in fact no way to add a new server, really), but
- it'll display news messages.
-
- * providers/nntp/Makefile.am (libcamelnntp_la_SOURCES): add
- camel-nntp-newsrc.c
- (libcamelnntpinclude_HEADERS): add camel-nntp-newsrc.h
- also, add test-newsrc stuff.
-
- * providers/nntp/test-newsrc.c: new file that tests the newsrc
- stuff by parsing and regurgitating a .newsrc file for a particular
- server.
-
- * providers/nntp/camel-nntp-newsrc.c,
- providers/nntp/camel-nntp-newsrc.h: new files, initial support for .newsrc files.
-
-2000-06-22 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (imap_get_message_count):
- Oops. Now appends the namespace to the folder before querying
- for the number of messages.
-
- * providers/imap/camel-imap-store.c (imap_folder_exists): New
- convenience function for use by imap_create().
- (get_folder): If folder is specified as "/", we really want
- "INBOX".
-
- * providers/sendmail/camel-sendmail-provider.c:
- * providers/vee/camel-vee-provider.c:
- * providers/smtp/camel-smtp-provider.c:
- * providers/mbox/camel-mbox-provider.c:
- * providers/pop3/camel-pop3-provider.c:
- * providers/imap/camel-imap-provider.c: Updated
-
- * camel-session.c: Moved service_cache hash table into the
- providers.
- (service_cache_remove): Updated.
- (camel_session_get_service): Updated.
-
- * camel-url.c (camel_url_hash): Took out the hashing of
- url->passwd. We don't want this anymore.
-
- * providers/imap/camel-imap-folder.c (imap_init): Took out
- references to 'namespace'
- (camel_imap_folder_init): Same
-
- * providers/imap/camel-imap-folder.h: No more namespace. We are
- instead going to use url->path as the namespace.
-
-2000-06-21 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-store.c (imap_create): Modified to
- use the "namespace" (url->path) if it exists.
-
- * providers/imap/camel-imap-folder.c (imap_delete_message_by_uid):
- Now just sets the deleted flag on the summary rather than speaking
- directly to the IMAP server. This is both faster and cleaner.
-
-2000-06-21 Dan Winship <danw@helixcode.com>
-
- * providers/pop3/camel-pop3-store.c (query_auth_types): Fix dumb
- bug.
-
-2000-06-21 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (imap_get_message_by_uid):
- We are getting mail in IMAP now!! whoo-hoo!. Stripped out the
- filtering so messages may have some dot-stuffing, but the
- filtering can always be added back in later when we know it
- works and isn't the problem.
-
-2000-06-21 Peter Williams <peterw@curious-george.helixcode.com>
-
- * providers/mbox/camel-mbox-folder.c (mbox_init): Use the basename
- of the mailbox so we don't get pathnames like ~/evolution/inbox///movemail.ibex
-
-2000-06-21 Dan Winship <danw@helixcode.com>
-
- * camel-folder-summary.c (message_info_new): Set date_received
- based on the first (most recent) "Received" header.
-
-2000-06-20 Dan Winship <danw@helixcode.com>
-
- * camel-mime-part.c (write_to_stream): flush the filter stream
- before unreffing it, so it will camel_mime_filter_complete.
-
- * camel-stream-filter.c (camel_stream_filter_class_init): Fix a
- braino so camel_stream_flush works here.
-
- * camel-stream-mem.c (stream_seek): Fix a bug that resulted in
- large attachments being silently dropped.
-
- * providers/pop3/camel-pop3-store.c
- (camel_pop3_command_get_additional_data): Don't use g_strjoinv
- here, since it is O(n^2) on the length of the output string, and
- we can do O(n).
-
- * camel-mime-part-utils.c
- (simple_data_wrapper_construct_from_parser): add a CRLF decoder
- after the QP/B64 decoder if it's text.
-
-2000-06-20 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (imap_get_summary): Only
- fetch the summary if the folder summary doesn't already exist.
- When the summary *does* exist, start fetching from 1, not 0.
- (imap_free_summary): Don't do anything here.
- (imap_finalize): Free the summary here instead of in
- imap_free_summary().
- (imap_set_message_flags): Implemented
- (imap_sync): Added code to set flags on messages that have had
- their flags changed (however I #if'd it out until we are more
- confidant in the IMAP code :)
- (imap_summary_get_by_uid): Now parese flags correctly.
- (imap_get_summary): Now parese flags correctly. Also correctly
- parses the UID correctly.
-
- * camel-url.c (check_equal): No need to check s1 if s2 is NULL
- (camel_url_equal): Don't check the passwd component of the url.
-
-2000-06-20 Dan Winship <danw@helixcode.com>
-
- * camel-folder-summary.c (camel_folder_summary_add): mark the
- message info with CAMEL_MESSAGE_FOLDER_FLAGGED if we change the
- uid, so the folder will know that it's dirty.
-
-2000-06-20 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-store.c (camel_imap_command_extended):
- Now returns the last line of data that the server sends back as
- well. This is needed for commands like SELECT (like Peter pointed
- out).
- (camel_imap_command): No longer checks for SELECT (no need)
-
- * providers/imap/camel-imap-folder.c: Added namespace stuff
- which we will need later on...
- (imap_parse_subfolder_line): Convenience function for use in
- get_subfolder_names()
- (imap_get_subfolder_names): Updated. Also changed it to use LIST
- instead of LSUB (temporary change).
-
-2000-06-19 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (camel_imap_folder_init): Set
- summary equal to NULL.
- (imap_get_summary): Store the summary in the ImapFolder
- (imap_summary_get_by_uid): If we have a summary cache in the
- ImapFolder, first check to see if that message info is in the
- cached summary first, if not fetch it directly from the IMAP
- server and append it to the summary cache.
- (imap_get_message_flags): Don't free the message info that we get
- back from summary_get_by_uid as we don't want to be corrupting our
- cached summary.
-
-2000-06-19 Peter Williams <peterw@curious-george.helixcode.com>
-
- * providers/imap/camel-imap-store.c (camel_imap_command{,_extended}): When
- SELECT'ing a folder for an IMAP command, use _extended to grab the entire
- response (before we just used camel_imap_command and missed the OK codes)
-
-2000-06-18 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (imap_summary_get_by_uid):
- Now gets the message flags as it should.
- (imap_get_summary): Same as imap_summary_get_by_uid
- (imap_get_permanent_flags): Return the permanent flags stored
- on the folder.
- (imap_get_message_flags): Return message flags associated with
- given uid. Note: we may want to somehow cache summary info so
- that we don't have to keep querying the IMAP provider in
- imap_summary_get_by_uid().
-
-2000-06-17 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (imap_free_summary): We were
- leaking memory - but not anymore!
- (imap_get_summary): We now get the UIDs and the beginnings of the
- code to get the message flags as well.
-
-2000-06-17 Dan Winship <danw@helixcode.com>
-
- * camel-mime-parser.c (folder_scan_header): Don't copy newlines
- into the parsed header text, and turn any number of tabs and
- spaces after a newline into a single space.
-
-2000-06-17 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (imap_init): Should now
- correctly do CAPABILITY.
-
-2000-06-17 Dan Winship <danw@helixcode.com>
-
- * providers/mbox/camel-mbox-summary.c: Add some debugging printfs
- when rebulding summary to help figure out why people's summaries
- are always being rebuilt.
-
-2000-06-17 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (imap_search_by_expression):
- Began to implement, need to get information on how to
- deconstruct @expression into an IMAP search expression and
- parse the results.
- (imap_init): Now queries the IMAP provider for CAPABILITY to
- determine if SEARCH is implemented or not.
-
- * providers/imap/imap.c: Removed - no longer a need to have
- this as an example for anyone interesting to help mecode IMAP
- support.
-
-2000-06-16 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (imap_sync): Added code
- to expunge if called for (still need to finish coding this).
- (imap_get_uids): Implemented.
- (imap_get_summary): Found a way to get the date
- (imap_summary_get_by_uid): Same.
- (imap_free_summary): Implemented.
-
- * string-utils.c (strstrcase): Fixed a compile warning
-
- * providers/imap/camel-imap-summary.c: Removed - we don't
- need a CamelImapSummary structure.
-
-2000-06-16 Dan Winship <danw@helixcode.com>
-
- Move flag handling from CamelMimeMessage to CamelFolder. This
- simplifies several flag-handling pieces of code in the mailer, and
- lets you change a message's flags without having to fetch the
- message body. It also means that fully-constructed
- CamelMimeMessages are now essentially constant, which will help
- simplify locking issues later since it means two threads
- interested in the same message can just work with separate copies
- of it.
-
- * camel-mime-message.h (struct _CamelMimeMessage): Removed flags
- and user_flags (moved to summary). Removed expunged and
- message_number which were unused. Removed message_uid and folder
- which are no longer needed in the new scheme.
- (struct CamelMimeMessageClass): Removed message_changed signal and
- get/set_message_number methods.
-
- * camel-mime-message.c: Updates for CamelMimeMessage changes.
- (camel_mime_message_get/set_flags,
- camel_mime_message_get/set_user_flag): Replaced with methods in
- CamelFolder.
- (camel_flag_get, camel_flag_set, camel_flag_list_size,
- camel_flag_list_free): Moved verbatim to camel-folder-summary.c
-
- * camel-folder.c (camel_folder_get/set_message_flags,
- camel_folder_get/set_message_user_flag): New methods (and
- corresponding useless default implementations)
- (camel_folder_class_init): add a message_changed signal
-
- * camel-folder-summary.c (camel_flag_get, camel_flag_set,
- camel_flag_list_size, camel_flag_list_free): Moved here from
- camel-mime-message.c
-
- * providers/mbox/camel-mbox-folder.c (message_changed): Removed.
- (mbox_get_message_flags, mbox_set_message_flags,
- mbox_get_message_user_flag, mbox_set_message_user_flag): Tweak
- summary bits as appropriate. (Functionality moved here from
- message_changed.)
- (mbox_get_message_by_uid): Update for CamelMimeMessage changes
- (less stuff to initialize).
-
- * providers/imap/camel-imap-folder.c (message_changed): Remove
- this. It was just copied from the mbox provider and doesn't deal
- with the real IMAP flag stuff anyway. (So there's currently no
- flag support in the IMAP provider.)
- (imap_get_message_by_uid): Update for CamelMimeMessage changes.
-
- * providers/vee/camel-vee-folder.c: (message_changed): Remove old
- one. Add a new one to listen for message_changed on each folder
- and re-emit message_changed signals that correspond to messages in
- the vfolder.
- (vee_get/set_message_flags, vee_get/set_message_user_flag): Proxy
- flag setting to the underlying real messages.
- (vee_append_message): Removed for now; there's no way to translate
- this into the new CamelMimeMessage/CamelFolder scheme, but (a)
- there's also no code which would ever call it and (b) we're
- probably going want a better interface than append_message for
- message drag and drop to work anyway. To be revisited.
-
-2000-06-16 Dan Winship <danw@helixcode.com>
-
- * camel-mime-utils.c (rfc2047_decode_word):
- * camel-mime-part-utils.c (simple_data_wrapper_construct_from_parser):
- * camel-folder-summary.c (summary_build_content_info):
- KLUDGE! Since neither ETable nor GtkHTML supports UTF-8 yet,
- output ISO-8859-1 instead, so Ettore can read his Italian mail. :)
- This will be reverted later.
-
-2000-06-15 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (imap_get_summary): Started to
- implement - may want to use ENVELOPE instead of BODY.PEEK[HEADER]
- (imap_summary_get_by_uid): Started to code, I've got to find a way to
- get the date in time_t format and also get the flags
-
- * string-utils.c (strstrcase): Added this convenience function - I
- know about strcasestr() but it's not portable.
-
-2000-06-15 Dan Winship <danw@helixcode.com>
-
- * camel-service.c: Remove camel_service_connect_with_url. (URLs
- must be specified when the service is requested from the session,
- so that there can only ever be one service for any URL.)
-
- * camel-folder.c: (camel_folder_open, camel_folder_is_open,
- camel_folder_get_mode): Kill. Folders are now always open, and
- handle "closing" sorts of operations at sync or finalize time.
- (camel_folder_sync): renamed from camel_folder_close. Syncs state
- to the store but doesn't necessarily close/disconnect.
-
- * providers/*/camel-*-folder.c: Merge "open" methods into "init"
- methods. Rename close to sync and update appropriately.
-
- * providers/imap/camel-imap-store.c: Remove camel_imap_store_open
- and camel_imap_store_close, which should not have been copied from
- the POP provider (where the exist to work around limitations of
- the POP protocol).
-
- * providers/mbox/camel-mbox-summary.c: fix a bug. (don't expunge
- deleted messages if called with expunge == FALSE)
-
- * providers/pop3/camel-pop3-store.c (connect_to_server): Check
- server for various interesting extensions.
-
- * providers/pop3/camel-pop3-folder.c (get_uids): If the server
- supports UIDL, use real UIDs rather than fake ones.
- (etc): Map uids back to numbers appropriately
-
- * providers/mbox/camel-mbox-folder.c (mbox_append_message): Fix to
- previous change: make sure the "seek" variable ends up with the
- value it should.
-
- * providers/mbox/camel-mbox-summary.c (summary_rebuild): Update
- summary mtime as well as size.
-
-2000-06-14 Dan Winship <danw@helixcode.com>
-
- * providers/mbox/camel-mbox-folder.c (mbox_append_message): if the
- mbox doesn't end with a '\n', write one before appending the new
- message.
-
-2000-06-14 Jeffrey Stedfast <fejj@helixcode.com>
-
- * camel-mime-filter-crlf.c (filter): Updated the encoder to allocate
- more memory (since we are also now adding dots). Also updated the
- decoder as we have found that it sometimes passes the end of the
- buffer.
-
- * providers/pop3/camel-pop3-folder.c (get_message_by_uid): Took out the
- filter code (we already filter in
- camel_pop3_command_get_additional_data)
-
- * camel-folder.c (init): Updated: a separator is now a char* rather
- than a single char because IMAP can have a string for a directory
- separator. Also, since IMAP does not begin with a directory separator,
- there is a new argument (path_begins_with_sep) which decides if a
- directory should begin with a directory separator.
-
- * providers/imap/camel-imap-store.c (imap_create): Since, on connect,
- Camel tries to create INBOX (which already exists on every IMAP
- provider) we can return TRUE when the folder name is "INBOX".
-
- * providers/vee/camel-vee-folder.c (vee_init): Updated.
-
- * providers/imap/camel-imap-folder.c (camel_imap_folder_new): Updated.
-
- * providers/mbox/camel-mbox-store.c (get_folder): Updated.
-
- * providers/mbox/camel-mbox-folder.c (mbox_init): Updated.
-
- * providers/pop3/camel-pop3-folder.c (camel_pop3_folder_new): Updated.
-
-2000-06-14 Dan Winship <danw@helixcode.com>
-
- * providers/mbox/camel-mbox-summary.c (camel_mbox_summary_sync):
- Renamed from camel_mbox_summary_expunge. Takes a gboolean saying
- whether to expunge or just sync the mbox file. Change some
- g_errors to g_warning so we don't abort. Make the quick
- X-Evolution updating code lseek around correctly. Update the
- mbox mtime in the summary file even in the quick case.
-
- * providers/mbox/camel-mbox-summary.h: make
- CAMEL_MESSAGE_FOLDER_NOXEV not conflict with
- CAMEL_MESSAGE_FOLDER_FLAGGED defined in camel-mime-message.h
-
- * providers/mbox/camel-mbox-folder.c (mbox_close): call
- camel_mbox_summary_sync to save flag state if not expunging.
- (mbox_expunge): Update for camel_mbox_summary_expunge rename.
-
-2000-06-13 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-store.c (camel_imap_store_open):
- (camel_imap_store_close): Added.
- (camel_imap_command_extended): Fixed a segfault and updated
- to use camel_imap_status()
- (camel_imap_command): Updated to use camel_imap_status()
- (camel_imap_status): New convenience function for parsing
- the return status of an IMAP command
-
-2000-06-12 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c (imap_get_message_by_uid):
- Works like the POP fetch code, should work temporarily until
- we get around to coding it the way it "Should Be".
-
- * providers/pop3/camel-pop3-folder.c (get_message_by_uid): Now uses
- the camel-mime-filter-crlf decoder when retrieving messages.
-
- * camel-mime-filter-smtp.c: Deprecated.
-
- * providers/smtp/camel-smtp-transport.c (smtp_data): Updated to use
- camel-mime-filter-crlf with my 'dot' extension in place of
- camel-mime-filter-smtp
-
- * camel-mime-part.c (write_to_stream): Updated to reflect changes
- made to camel-mime-filter-crlf.c
-
- * camel-mime-filter-crlf.c (filter): Modified to be able to
- encode/decode dots ("\n.\n"<->"\n..\n"). Also fixed the decoder
- so that it should no longer get caught in an infinite loop.
-
-2000-06-12 Dan Winship <danw@helixcode.com>
-
- * providers/*/Makefile.am: don't pass a second (incorrect) -rpath
- in addition to the (correct) one automatically provided by
- automake.
-
- * camel-mime-filter-crlf.c: New filter to do CRLF<->LF conversion.
- (Currently only tested in the LF->CRLF direction.)
-
- * camel-mime-part.c (write_to_stream): if content-type is text,
- and it's QP or B64 encoded, pass through the CRLF filter before
- the other filter to satisfy the "canonical encoding" rules in the
- MIME spec.
-
-2000-06-09 Dan Winship <danw@helixcode.com>
-
- * camel-session.c (camel_session_query_authenticator): Add another
- argument, "mode", which can be CAMEL_AUTHENTICATOR_ASK or
- CAMEL_AUTHENTICATOR_TELL, so callers can get the app to un-cache
- bad info.
-
- * providers/pop3/camel-pop3-store.c (pop3_connect): uncache the
- password if it doesn't work.
-
-2000-06-09 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-stream.c (stream_read): Updated to reflect
- changes made in camel-imap-store.c
-
- * providers/imap/camel-imap-store.c (imap_create): No longer checks to
- make sure a folder doesn't already exists (as this is no longer needed)
- (camel_imap_command): Now takes a CamelFolder argument so it can detect
- whether or not it needs to SELECT a folder or not
- (camel_imap_command_extended): Same.
-
- * providers/smtp/camel-smtp-transport.c (smtp_connect): Will now always
- send EHLO first, if that fails it will fall back on HELO.
- (esmtp_get_authtypes): Should now correctly parse authtypes.
-
-2000-06-07 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-summary.c: Now builds (not that it's worth
- much yet).
-
- * providers/imap/camel-imap-folder.c (imap_get_uids): Now uses the
- correct cast to a CamelImapMessageInfo structure (should get rid of
- compile warnings).
-
- * providers/imap/Makefile.am: Added rules to build
- camel-imap-stream
-
- * providers/imap/camel-imap-store.c (get_folder): Update.
- Moved imap_create here.
-
- * providers/imap/camel-imap-folder.c (delete_messages): Remove.
- (imap_create): Removed.
- (imap_delete): Removed.
- (imap_exists): Removed.
-
- * providers/imap/camel-imap-stream.h: Added typedef's for the stream
-
- * providers/imap/camel-imap-stream.c: Modified to build cleanly
-
-2000-06-07 Not Zed <NotZed@HelixCode.com>
-
- * camel-mime-utils.c (header_msgid_decode_internal): Properly
- dereference warning/debug messages.
- (header_references_decode): Check we actually have msgid stuff
- before trying to decode it ...
-
-2000-06-06 Jeffrey Stedfast <fejj@helixcode.com>
-
- * camel-imap-stream.[c,h]: Removed
-
- * providers/imap/camel-imap-stream.[c,h]: Relocated to this
- location
-
- * providers/imap/camel-imap-summary.c: Added
-
-2000-06-06 Dan Winship <danw@helixcode.com>
-
- * camel-folder.c: Remove exists, create, delete. A CamelFolder
- now always references an existing folder. Remove delete_messages
- too since it wasn't being used. Add a "create" flag to
- get_subfolder saying whether or not to create the subfolder if it
- doesn't yet exist.
-
- * camel-store.c (camel_store_get_folder): Add a "create" flag to
- say whether or not to create the folder if it doesn't yet exist.
- (camel_store_delete_folder): New method, moved from CamelFolder.
- (cache_folder, uncache_folder): Fix up a bit.
- (get_folder_name): Explain what this is for.
-
- * providers/mbox/camel-mbox-folder.c:
- * providers/mbox/camel-mbox-store.c: Update. Remove support for
- hierarchical folders to simplify this for now, since we're not
- using it, and it's not completely clear how they should work in an
- ELocalStorage world. Needs to be revisited.
-
- * providers/pop3/camel-pop3-folder.c (delete_messages): Remove.
- * providers/pop3/camel-pop3-store.c (get_folder): Update.
-
- * providers/vee/camel-vee-folder.c (exists): Remove.
- * providers/vee/camel-vee-store.c (vee_get_folder): Update.
-
-2000-06-06 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-*.[c,h]: Started on getting
- imap to build cleanly (tho some work has not been completed
- so it still won't build until camel-imap-summary is finished
- along with a few methods in camel-imap-folder)
-
- * camel-stream.[c,h]: Changed the read and write method prototypes
- to return an ssize_t type rather than an int and also changed
- the 'number of bytes' to read or write to a size_t type
-
- * camel-stream-fs.c: same as above
-
- * camel-stream-mem.c: again, same as above
-
- * camel-stream-buffer.c: same
-
- * camel-imap-stream.[c,h]: Added this new stream, cache's previously
- read data so each successive call will instead read from the cache
-
-2000-06-05 Dan Winship <danw@helixcode.com>
-
- * camel-mime-part.c (camel_mime_part_set_disposition): fix
- typo/braino (set "Content-Disposition", not "Content-Description")
- (camel_mime_part_set_filename): const poison
-
-2000-06-02 Not Zed <NotZed@HelixCode.com>
-
- * camel-mime-utils.c (base64_encode_step): Ick, damn signs! Fix a
- bug with sign extended bytes.
-
- * camel-mime-filter-smtp.c (filter): Changed layout/logic slightly
- (to match From filter)
-
-2000-06-02 Jeffrey Stedfast <fejj@helixcode.com>
-
- * camel-mime-filter-smtp.c (filter): Fixed the filter so that it
- wouldn't insert garbage under certain conditions.
-
-2000-06-02 Christopher James Lahey <clahey@helixcode.com>
-
- * camel-session.c: Don't ref the services in the cache.
-
-2000-06-02 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/smtp/camel-smtp-transport.c: Rearanged where debug
- fprintf statements we placed so that any data the server sends
- back is printed out before an exception is set and the function
- returns.
-
-2000-06-02 Not Zed <NotZed@HelixCode.com>
-
- * camel-mime-utils.c (header_decode_date): If we get a funny
- result, just throw it out. Basically a fix for the one true
- broken TradeClient.
-
-2000-06-01 Not Zed <NotZed@HelixCode.com>
-
- * camel-folder-summary.c (message_info_free): Free
- references/messsage id.
- (message_info_save): Save them.
- (message_info_load): Load them.
- (message_info_new): And get them from the new message.
- (CAMEL_FOLDER_SUMMARY_VERSION): Bumped for new changes.
-
- * camel-folder-summary.h: Added references and messageid to
- summary.
-
-2000-06-02 Christopher James Lahey <clahey@helixcode.com>
-
- * camel-session.c: Ref and unref objects in the service cache
- properly.
-
- * camel-store.c: Ref the folder when returning it using
- lookup_folder. Used the folder's full name for the key for the
- folder cache since that's used to uncache it.
-
-2000-06-02 Dan Winship <danw@helixcode.com>
-
- Fun with purify.
-
- * providers/pop3/camel-pop3-store.c (pop3_connect): free msg on
- success as well as failure.
- (camel_pop3_command_get_additional_data): free buf after reading
- the last line (".").
-
- * providers/pop3/camel-pop3-folder.c (get_message_by_uid): free
- body data after creating the memstream from it (which will copy
- the data).
-
- * providers/mbox/camel-mbox-folder.c (mbox_finalize): free summary
- and index paths.
-
- * camel-data-wrapper.c (finalize): unref the stream, if it exists.
-
-2000-06-01 Not Zed <NotZed@HelixCode.com>
-
- * camel-mime-part.c (construct_from_parser): For a message part,
- set the default content-type to message/rfc822. Maybe needs to be
- done for multiparts too?
-
-2000-05-31 Not Zed <NotZed@HelixCode.com>
-
- * camel-mime-message.c (construct_from_parser): Typo in assersion.
-
- * camel-mime-parser.c (folder_scan_step): Use a default type of
- message/rfc822 for multipart/digest. Bug Z192.
- (folder_scan_drop_step): Remove warning.
-
-2000-05-30 Not Zed <NotZed@HelixCode.com>
-
- * providers/mbox/camel-mbox-folder.c (mbox_append_message): Init
- filter_from to NULL, for exception case.
- (mbox_get_message_by_uid): Cast off_t to long int for diagnostics.
-
- * camel-url.c (camel_url_hash): Hash funciton for using camel
- url's as hash keys.
- (camel_url_equal): equal function for same.
-
- * camel-session.c (camel_session_finalise): Free cached services.
- (camel_session_init): Init service cache.
- (service_cache_remove): destroy callback to remove a service from
- the cache.
-
- * camel-store.c (get_folder_internal): Remove the extra ref of the
- folder. That seems the right behaviour ...?
- (camel_store_get_type): Doh, actually call store init, so the
- cache works.
- (cache_folder): strdup the folder name! no wonder it never found
- it again.
-
-2000-05-30 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-folder.c: Implemented a few more
- methods like imap_append and 1 or 2 others
-
-2000-05-29 Not Zed <NotZed@HelixCode.com>
-
- * camel-store.c (camel_store_init): Move it to here. If this
- level is going to maintain it, it should set it up. Lets see what
- caching folders breaks :(
-
- * providers/pop3/camel-pop3-store.c (camel_pop3_store_init): Dont
- init folder cache here.
-
- * providers/mbox/camel-mbox-summary.c
- (camel_mbox_summary_expunge): Make sure we copy messages which are
- still intact to the new folder.
- (camel_mbox_summary_expunge): Update the frompos as well when
- moving the content.
- (camel_mbox_summary_expunge): Remove some debug, and dont offset
- frompos?
-
- * providers/vee/camel-vee-folder.c (vee_folder_build): Check the
- searched folder is open before trying to search it.
- (message_changed): Track changes to the source message in the
- summary.
- (folder_changed): Track folder changes, re-query the folder that
- changed, and cascade the changed event as well.
- (camel_vee_folder_finalise): Free subfolder and subfolder summary.
-
-2000-05-29 Dan Winship <danw@helixcode.com>
-
- * camel-service.c (camel_service_new): Fix up some glib
- precondition stuff. Try to set the URL in camel_service_new before
- checking whether or not it's "empty" so that you can successfully
- set "sendmail:" as a URL.
-
-2000-05-28 Dan Winship <danw@helixcode.com>
-
- * camel-provider.h: Add a domain field to CamelProvider, to say
- what kind of data it provides.
-
- * providers/imap/camel-imap-provider.c:
- * providers/mbox/camel-mbox-provider.c:
- * providers/pop3/camel-pop3-provider.c:
- * providers/sendmail/camel-sendmail-provider.c:
- * providers/smtp/camel-smtp-provider.c: Set domain to "mail".
-
- * providers/nntp/camel-nntp-provider.c: Set domain to "news".
-
- * providers/vee/camel-vee-provider.c: Set domain to "vfolder". (So
- it doesn't end up being listed as a potential mail source in the
- mail config wizard.)
-
- * providers/pop3/camel-pop3-store.c: Split apart password and APOP
- auth, since some servers seem to do both, but don't really.
- (connect_to_server): Renamed from try_connect. Now actually does
- the connection up to the point of checking the greeting for APOP
- support.
- (query_auth_types): Return APOP, if appropriate. Call
- pop3_disconnect after connect_to_server since we don't really want
- to be connected.
- (pop3_connect): Use connect_to_server rather than duplicating
- code. Fix a one-byte buffer overrun in the APOP code.
- (pop3_disconnect): Make this able to clean up after a partial
- connect.
- (connect_to_server): Remove port number from error message since
- it's not terribly useful and we were getting it from the wrong
- place anyway.
-
- * camel-mime-utils.c (header_address_list_format_append): Use
- `foo@bar' rather than `"" <foo@bar>' for email addresses with no
- name component.
-
-2000-05-27 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-store.c: Removed
- camel_imap_command_get_additional_data() as it was
- completely useless, replaced with
- camel_imap_command_extended() which may eventually replace
- camel_imap_command() as well.
-
- * providers/imap/camel-imap-store.h: Modified to reflect
- changes made to camel-imap-store.c
-
- * providers/imap/camel-imap-folder.c: Wrote the first of many
- methods: camel_imap_init(), imap_open(), imap_expunge(),
- imap_get_message_count(), and imap_get_subfolder_names()
-
-2000-05-26 Dan Winship <danw@helixcode.com>
-
- * camel-multipart.c (camel_multipart_init): Don't set a default
- boundary. Require the caller to do that.
- (set_boundary): if boundary is NULL, generate a "random" boundary.
-
- * camel-mime-part-utils.c
- (camel_mime_part_construct_content_from_parser): Add a call to
- camel_multipart_set_boundary after creating a new multipart.
-
-2000-05-25 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap/camel-imap-store.c (try_connect): Removed
- Exception code - Pop doesn't seem to set exceptions
-
- * providers/imap/camel-imap-folder.c: Initial code, mostly
- just a template for future code
-
- * providers/imap/imap.[c,h]: Source code from my personal
- mailer - for reference only!
-
-2000-05-25 NotZed <NotZed@HelixCode.com>
-
- * camel-mime-part-utils.c
- (camel_mime_part_construct_content_from_parser): Replace simple
- data wrapper here too, oops.
-
- * Makefile.am (libcamel_la_SOURCES): Removed
- camel-simple-data-wrapper again. Less code to maintain == better
- code.
-
- * camel-data-wrapper.c (construct_from_stream): Fixes for bug
- where text attachments dont work. Made data-wrapper concrete for
- the second time.
-
-2000-05-23 NotZed <NotZed@HelixCode.com>
-
- * providers/vee/camel-vee-folder.c (vee_folder_build_folder):
- Update the vfolder details for a single folder.
-
-2000-05-25 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/smtp/camel-smtp-transport.c (_send_to): Took out code
- that had been there to reconnect to the server if it was not
- already connected - Mailer code was fixed so that this should not
- be needed.
-
- * providers/imap/camel-imap-store.[c,h]: Initial code.
-
-2000-05-24 Dan Winship <danw@helixcode.com>
-
- * camel.h: Re-add camel-simple-data-wrapper.h, which was removed
- for some reason.
-
-2000-05-24 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/smtp/camel-smtp-transport.[c,h]: Moved global
- variables into struct CamelSmtpTransport to make SMTP
- thread-safe
-
- * providers/imap/camel-imap-*.h: Stolen from Mbox. Rough structure
- for Imap.
-
-2000-05-23 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/imap: Added some initial code to the camel tree
- for IMAPv4
-
- * providers/imap/.cvsignore: Added to repository
-
- * providers/smtp/camel-smtp-transport.c: Added debug fprintf's
- so that testers can provide more information. Tested with simple
- messages and a reply to the hello@helixcode.com default message
- but should really be tested more.
- (smtp_data): Fixed to use data_wrapper_write_to_stream.
-
- * camel-mime-filter-smtp.c (filter): Modified to escape all lines
- beginning with a '.' and to place a \r before each \n if one did
- not previously exist. Removed code to escape "From " as it was
- found to not be needed for SMTP.
-
-2000-05-22 Jeffrey Stedfast <fejj@helixcode.com>
-
- * providers/smtp/camel-smtp-transport.c (smtp_data): Fixed the
- filtered stream. Fixes for stream changes, updated to use
- camel-mime-filter-smtp.
-
- * Makefile.am: Added camel-mime-filter-smtp.c
-
- * camel-mime-filter-smtp.[c,h]: Added to camel tree
- Smtp filter used to change \n into \r\n, escape lone dots,
- and escape "From "'s.
-
-2000-05-19 NotZed <NotZed@HelixCode.com>
-
- * camel-simple-data-wrapper.c (construct_from_stream): If we
- already have been constructed, unref our content.
- (write_to_stream): Check we've been constructued, and change for
- stream api changes.
-
- * camel-mime-parser.c: Removed exception stuff.
-
- * md5-utils.c (md5_get_digest_from_stream): repaired.
-
- * camel-mime-message.c: Remove exception from write_to_stream, and
- fix, and fix formatting.
-
- * providers/sendmail/camel-sendmail-transport.c (_send_internal):
- Fix for stream changes.
-
- * providers/pop3/camel-pop3-store.c (camel_pop3_command): Fixes
- for stream changes.
-
- * providers/mbox/camel-mbox-folder.c, and elsewhere, fix all
- stream api changes.
- (mbox_append_message): Use stream_close() now its back.
- (mbox_append_message): unref the from filter.
-
- * camel-stream-mem.c: And here.
-
- * camel-stream-fs.[ch]: Here too.
-
- * camel-stream-filter.c: Likewise. This is getting tedious.
-
- * camel-stream-buffer.c (stream_write): Fix a few little problems.
- (stream_close): Reimplement.
- (camel_stream_buffer_read_line): Slightly more efficient version,
- that also only allocates the right amount of memory for strings.
-
- * camel-seekable-substream.c: Likewise.
-
- * camel-seekable-stream.[ch]: Remove exceptions, fix formatting,
- changes for stream (re)fixes. set_bounds returns an error.
-
- * camel-stream.[ch]: Remove exceptions. Make flush and reset return
- an error code, repair all the screwed up formatting, and put back
- close.
-
- * camel-mime-part-utils.c
- (camel_mime_part_construct_content_from_parser): And here.
-
- * camel-mime-part.c (camel_mime_part_set_content): And this too.
- (write_to_stream): Fixed for stream changes.
-
- * camel.h: Fixed.
-
- * providers/vee/camel-vee-folder.c (vee_search_by_expression):
- Implement. Performs an intersection of the two searches.
- (camel_vee_folder_finalise): Unref search folders.
- (vee_append_message): Implement append.
-
-2000-05-18 Dan Winship <danw@helixcode.com>
-
- * camel-folder.c: remove message_number_capability and require uid
- capatibility.
- (camel_folder_list_subfolders, camel_folder_get_uid_list,
- camel_folder_get_subfolder_info, camel_folder_get_message_info):
- removed
- (camel_folder_get_subfolder_names,
- camel_folder_free_subfolder_names): new subfolder interfaces.
- (camel_folder_get_uids, camel_folder_free_uids): new uid
- interfaces
- (camel_folder_get_summary, camel_folder_free_summary): new summary
- interfaces
-
- * providers/mbox/camel-mbox-folder.c,
- * providers/nntp/camel-nntp-folder.c:
- * providers/vee/camel-vee-folder.c: Update for changes
-
- * providers/pop3/camel-pop3-folder.c: Implement get_uids, update
- for other changes.
-
-2000-05-18 NotZed <NotZed@HelixCode.com>
-
- * providers/vee/camel-vee-folder.c: Guess!
-
- * camel-folder-search.c (search_user_flag): Implement user_flag
- search term.
-
- * camel-folder-search.h: Added user_flag search capability
- (user-flag "blah")
-
- * providers/mbox/camel-mbox-folder.c (mbox_init): Set USER flag in
- permanent flags for the folder.
-
-2000-05-17 Dan Winship <danw@helixcode.com>
-
- * camel-folder.c: Remove unused async open/close and
- copy_message_to functions.
- Rename functions without initial _. Fix glib preconditions and
- gtk-doc comments.
-
-2000-05-17 Dan Winship <danw@helixcode.com>
-
- * camel-data-wrapper.c: remove get/set_output_stream operations.
- They're redundant with write_to_stream, and CamelMimePart and
- CamelMimeMessage only implement the latter, meaning that trying to
- get_output_stream on a CamelMimeMessage that was built from pieces
- rather than being parsed from a stream doesn't work. Anything that
- uses get_output_stream can be rewritten to use write_to_stream, so
- we'll standardize on that.
- (camel_data_wrapper_new): remove this: CamelDataWrapper is
- supposed to be an abstract class.
- (write_to_stream): remove default implementation. (Moved to
- CamelSimpleDataWrapper)
-
- * camel-simple-data-wrapper.c: resurrect, although it's not really
- the same thing it was before. A simple data wrapper, which is
- backed by a CamelStream.
-
- * camel-mime-part-utils.c
- (simple_data_wrapper_construct_from_parser): Use
- construct_from_stream rather than set_output_stream.
- (camel_mime_part_construct_content_from_parser): Change
- camel_data_wrapper_new to camel_simple_data_wrapper_new.
-
- * camel-mime-part.c (camel_mime_part_set_content): Change
- camel_data_wrapper_new to camel_simple_data_wrapper_new.
-
-2000-05-17 Darin Adler <darin@eazel.com>
-
- * camel-folder-summary.c: (message_info_load):
- Quick fix to get it to compile. I hope I don't get into trouble.
-
-2000-05-17 Dan Winship <danw@helixcode.com>
-
- * camel.h: Don't include the no-longer-distributed
- possibly-to-be-removed headers.
-
- * providers/smtp/camel-smtp-transport.c
- (smtp_get_email_addr_from_text): fix an off-by-one error in
- address parsing
- (smtp_data): use camel_data_wrapper_get_output_stream rather than
- data_wrapper->output_stream
-
-2000-05-17 NotZed <NotZed@HelixCode.com>
-
- * providers/mbox/camel-mbox-folder.c (message_changed): Snoop
- changes to user flags on the message into the summary as well.
-
- * providers/mbox/camel-mbox-summary.c (camel_mbox_summary_init):
- Changed version init to include the parent class version info
- (i.e. add it not overwrite it).
-
- * camel-folder-summary.c (message_info_new): Initialise user_flags
- to empty.
- (message_info_load): And load user flags.
- (message_info_save): And save user flags.
- (message_info_free): And free them.
- (CAMEL_FOLDER_SUMMARY_VERSION): Bumped file revision.
-
- * camel-folder-summary.h: Added user-flags to summary.
-
- * camel-mime-message.c (camel_mime_message_set_user_flag): Dont
- use a hashtable for user flags.
- (camel_mime_message_get_user_flag): And changed here too.
- (camel_flag_get): New interface to get a flag from a flag
- list. Flag lists are easier to work with than hash tables, and
- save memory too.
- (camel_flag_set): And set.
- (camel_flag_list_free): And free.
- (free_key_only): Discard.
- (finalize): Remove the flag list.
-
-2000-05-17 Jeffrey Stedfast <fejj@stampede.org>
-
- * providers/smtp/camel-smtp-transport.c: (smtp_helo): Error
- checking on gethostbyaddr() eliminating a possible segfault.
-
-2000-05-16 NotZed <NotZed@HelixCode.com>
-
- * providers/mbox/camel-mbox-folder.c (mbox_delete_message_by_uid):
- Implement.
-
-2000-05-12 NotZed <NotZed@HelixCode.com>
-
- * camel-movemail.c (camel_movemail): Open the destination with
- O_APPEND, so we dont blow away a partially transferred mbox.
- (camel_movemail): Loop if we get errno=INTR, and not fail.
-
-2000-05-11 NotZed <NotZed@HelixCode.com>
-
- * providers/mbox/camel-mbox-summary.c (summary_rebuild): Update
- the summarised file size, if everything went ok.
- (camel_mbox_summary_expunge): Clear header flags after updating.
-
-2000-05-16 Chris Toshok <toshok@helixcode.com>
-
- * providers/nntp/camel-nntp-folder.c:
- * providers/nntp/camel-nntp-folder.h:
- * providers/nntp/camel-nntp-provider.c:
- * providers/nntp/camel-nntp-store.c:
- * providers/nntp/camel-nntp-utils.c:
- * providers/nntp/camel-nntp-utils.h:
- get things working with new camel summary stuff.
-
- * providers/nntp/camel-nntp-summary.c:
- * providers/nntp/camel-nntp-summary.h:
- removed files since camel-folder-summary does all we need.
-
-2000-05-15 Jeffrey Stedfast <fejj@stampede.org>
-
- * providers/smtp/camel-smtp-transport.c: Added some preliminary
- AUTH support.
-
-2000-05-15 Dan Winship <danw@helixcode.com>
-
- * camel-folder.h: Remove camel_folder_get_summary, which no longer
- exists.
-
-2000-05-11 Dan Winship <danw@helixcode.com>
-
- * Makefile.am: remove some cruft that we're not currently using.
-
- * camel-stream-mem.c (camel_stream_mem_new_with_buffer): Change
- to match prototype (size_t vs unsigned int) so it works on 64-bit
- machines. Noted by msw.
-
-2000-05-11 NotZed <NotZed@HelixCode.com>
-
- * providers/mbox/camel-mbox-folder.c (message_changed): Indicate
- the summary changed also.
-
-2000-05-11 Jeffrey Stedfast <fejj@stampede.org>
-
- * providers/smtp/camel-smtp-transport.c: (smtp_helo):
- Updated to more closely comply with RFC 821 standards
-
-2000-05-11 NotZed <NotZed@HelixCode.com>
-
- * camel-mime-part.c (write_to_stream): Unref the filter after
- adding it to the filtering stream.
-
- * providers/mbox/camel-mbox-summary.c
- (camel_mbox_summary_finalise): Free the folder path.
- (camel_mbox_summary_update): Also save summary when done.
- (camel_mbox_summary_expunge): Unindex items when deleting them.
- (camel_mbox_summary_expunge): Save the index as well as the
- summary.
-
- * camel-folder-summary.c (camel_folder_summary_finalise): Free the
- summary path.
- (camel_folder_summary_touch): New function, indicate the summary
- info changed.
- (camel_folder_summary_remove): Dirty here.
-
- * camel-internet-address.c (internet_decode): Free multiple entry
- addresses properly.
-
- * camel-mime-utils.c (header_decode_mailbox): Plugged another
- memleak, free text after converting it.
- (header_decode_addrspec): More leaks plugged.
-
- * camel-mime-message.c (finalize): Free message_uid.
- (finalize): Free the recipients hashtable.
-
-2000-05-11 NotZed <notzed@helixcode.com>
-
- * camel-folder-summary.c (camel_folder_summary_finalise): Free
- summary items and charset filters.
-
-2000-05-10 NotZed <notzed@helixcode.com>
-
- * camel-folder-summary.c (camel_folder_summary_finalise): Don't
- free stuff in p, after we've free'd p.
-
- * providers/mbox/camel-mbox-folder.c (mbox_append_message): Unref
- the stream we created for appending.
-
-2000-05-10 Jeffrey Stedfast <fejj@stampede.org>
-
- * providers/smtp/camel-smtp-transport.c: (camel_smtp_transport_class_init):
- Added initialization for service_class
-
-2000-05-10 Dan Winship <danw@helixcode.com>
-
- * camel-multipart.c (write_to_stream): fix a stupid typo. Thank
- you, C.
-
- * camel-mime-part.c (write_to_stream): don't ref the stream before
- wrapper a filter around it, since nothing will ever unref it.
-
-2000-05-10 Christopher James Lahey <clahey@helixcode.com>
-
- * Makefile.am: Added camel-types.h, camel-folder-pt-proxy.h, and
- camel-thread-proxy.h.
-
-2000-05-09 Dan Winship <danw@helixcode.com>
-
- * providers/sendmail/camel-sendmail-transport.c (_send_internal):
- Bleah. Can't fsync a pipe. As a quick kludge, just don't
- stream_flush it. The right fix will require bringing back
- stream_close though.
-
-2000-05-09 Jeffrey Stedfast <fejj@stampede.org>
- * camel-internet-address.[c,h]: Undid my changes (moved
- struct _address back into came-internet-address.c)
- * providers/smtp/camel-smtp-transport.c: (_send): changed
- from using it's own address manipulation (using struct _address)
- to using camel_internet_address_get(). Also some format changes
- to keep consistant with the rest of Camel
-
-2000-05-09 Jeffrey Stedfast <fejj@stampede.org>
-
- * camel-internet-address.[c,h]: Moved struct _address from
- camel-internet-address.c to camel-internet-address.h
- (hopefully this doesn't break anything...)
- * providers/smtp/camel-smtp-transport.c: (_send): now
- populates the recipient list with To, Cc, and Bcc addresses.
- Should now be able to use this module.
-
-2000-05-09 Dan Winship <danw@helixcode.com>
-
- * providers/mbox/camel-mbox-folder.c (mbox_get_message_by_uid):
- one more refcounting fix I missed before.
-
-2000-05-08 Jeffrey Stedfast <fejj@stampede.org>
-
- * providers/smtp/camel-smtp-transport.c: no longer frees memory it
- shouldn't, updated to reflect camel-stream changes involving
- CamelException (perhaps it should use a different CamelException
- variable than is passed to the camel smtp module?)
-
-2000-05-08 Dan Winship <danw@helixcode.com>
-
- * camel-stream.c (camel_stream_read, camel_stream_write,
- camel_stream_flush, camel_stream_reset, camel_stream_printf,
- camel_stream_write_to_stream): Use CamelException to signal
- failure.
- (camel_stream_write_strings): Remove. camel_stream_printf is more
- useful in most of the places that used this.
- (camel_stream_write_string): Change from macro to function to
- prevent problems with double-evaluation.
-
- * camel-seekable-stream.c (camel_seekable_stream_seek,
- camel_seekable_stream_set_bounds): Use CamelException.
- (reset): Update.
-
- * camel-seekable-substream.c, camel-stream-buffer.c,
- camel-stream-filter.c, camel-stream-fs.c, camel-stream-mem.c:
- Update.
-
- * camel-stream-fs.c: Remove the virtual init functions and move
- the code into the creator functions. Add CamelExceptions to
- creation functions that could fail.
-
- * camel-data-wrapper.c (camel_data_wrapper_write_to_stream): Use
- CamelException.
- * camel-mime-message.c, camel-mime-part.c, camel-multipart.c
- (write_to_stream): Update.
-
- * camel-mime-parser.c: add an exception to the mime parser private
- data and pass that to stream functions as needed.
-
- * gmime-content-field.c, md5-utils.c: Update (badly) for stream
- changes.
-
- * camel-exception.h (camel_exception_is_set): convenience macro.
-
- * providers/Makefile.am: disable SMTP for now
-
- * providers/mbox/camel-mbox-folder.c (mbox_append_message): Pass
- CamelException to the functions that now need it. Check the
- exception after calling camel_stream_flush, and fail if it fails.
- (mbox_get_message_by_uid): More updates.
-
- * providers/pop/camel-pop3-folder.c,
- providers/pop/camel-pop3-store.c,
- providers/sendmail/camel-sendmail/transport.c: Update.
-
-
-2000-05-08 NotZed <NotZed@HelixCode.com>
-
- * camel-mime-message.c (process_header): Format From and Reply-To
- to at least a decoded string. Should probably store them as an
- camelinternetaddress.
-
- * Merged NEW_SUMMARY branch back to trunk, and resolved conflicts.
-
- * providers/mbox/camel-mbox-summary.c (camel_mbox_summary_update):
- Return status.
- (camel_mbox_summary_expunge): Force an update of the summary
- before we do anything.
- (camel_mbox_summary_expunge): Build new xev line in xevnew, and
- free that, and consify xev.
- (camel_mbox_summary_load): If we are rebuilding from scratch, make
- sure we clear the summary content.
-
- * camel-stream-filter.c (do_close): We NEED a stream close.
-
-2000-05-07 Dan Winship <danw@helixcode.com>
-
- Make camel not leak like a sieve.
-
- * camel-object.c: New subclass of GtkObject which is now the base
- of the Camel object hierarchy. Currently the only difference
- between CamelObject and GtkObject is that CamelObjects don't start
- out floating.
-
- * *.h: Move a bunch of typedefs to camel-types.h. Standardize on
- using <camel/foo.h> in header files rather than <foo.h>, "foo.h",
- or "camel/foo.h". Remove some unneeded includes.
-
- * camel-address.c, camel-data-wrapper.c, camel-folder-search.c,
- camel-folder-summary.c, camel-folder.c, camel-mime-filter.c,
- camel-mime-parser.c, camel-service.c, camel-session.c,
- camel-stream.c: These are now subclasses of CamelObject.
-
- * camel-data-wrapper.c (set_output_stream):
- * camel-medium.c (set_content_object):
- * camel-seekable-substream.c
- (init_with_seekable_stream_and_bounds):
- * providers/mbox/camel-mbox-folder.c (mbox_get_message_by_uid):
- remove gtk_object_sink calls.
-
- * camel-stream-buffer.c (init_vbuf):
- * camel-stream-filter.c (camel_stream_filter_new_with_stream):
- ref the original stream.
-
- * camel-folder-summary.c (camel_folder_summary_finalise): unref
- the filters when finalizing.
-
- * camel-mime-part-utils.c
- (simple_data_wrapper_construct_from_parser,
- camel_mime_part_construct_content_from_parser):
- * camel-mime-part.c (camel_mime_part_set_content): Unref objects
- that are created only to be handed off to other objects. If
- they're going to be needed later, they will have been additionally
- ref'ed by the object that needs them.
-
- * providers/pop3/camel-pop3-folder.c (get_message_by_number):
- unref the message stream after creating the data from it.
-
- * camel-stream.c, camel-stream-buffer.c, camel-stream-filter.c,
- camel-stream-fs.c, camel-stream-mem.c: Remove camel_stream_close,
- since its semantics are dubious (what happens when you close a
- stream other people still have references on?).
-
- * providers/nntp/camel-nntp-store.c:
- * providers/smtp/camel-smtp-transport.c:
- * providers/pop3/camel-pop3-store.c:
- replace camel_stream_close calls with gtk_object_unref.
-
- * providers/mbox/camel-mbox-folder.c:
- * providers/nntp/camel-nntp-folder.c:
- * providers/sendmail/camel-sendmail-transport.c:
- replace camel_stream_close with camel_stream_flush +
- gtk_object_unref
-
-2000-05-06 Dan Winship <danw@helixcode.com>
-
- * providers/pop3/camel-pop3-store.c (query_auth_types): A machine
- which serves neither POP nor KPOP is not a POP server.
-
- * providers/smtp/camel-smtp-provider.c: Note in the description
- that this provider is not yet tested.
-
-2000-05-08 NotZed <notzed@helixcode.com>
-
- * camel-mime-part.c (write_to_stream): Free the filter stream when
- done.
-
- * camel-mime-parser.c (folder_seek): Make sure we add the \n
- terminal when we seek as well (frob!).
-
- * camel-mime-utils.c (header_decode_addrspec): Plug minor memleak.
-
- * camel-mime-part.c (finalize): Free header tables once finished.
-
- * camel-folder-summary.c (camel_folder_summary_remove): Dont try
- to access info after its free'd.
-
-2000-05-07 NotZed <NotZed@HelixCode.com>
-
- * camel-mime-part.c (write_to_stream): Apply encoding to content
- part, when writing to a stream *sigh*.
-
- * camel-stream-filter.c (do_write): implement write for the
- filtering stream. Writes shouldn't be mixed with reads.
- (do_flush): Implemented flush. Again write/flush shouldn't be
- mixed with reads. Only flushes if the last op was write.
- (do_close): Force flush on close.
-
- * camel-mime-filter.c (filter_run): Oops, make sure we include the
- backlen in the total length before passing onto the filter.
-
- * camel-mime-filter-from.c: New filter, munges 'From ' lines into
- '>From ', for mbox.
-
- * camel-mime-parser.c (camel_mime_parser_header_remove): New
- function to remove the parser's raw header, rather than
- manipulating the header directly (wich doesn't work with
- mempools).
-
- * camel-mime-utils.c (header_address_list_clear): Fixed some
- broken(tm) logic, which would leak entries on multivalued lists.
-
- * providers/mbox/camel-mbox-summary.c (camel_mbox_summary_load):
- Use ibex_save() to save the ibex. Makes a big difference to
- startup times for very large mailboxes.
- (camel_mbox_summary_expunge): Dum de dum, reimplemented. Designed
- to be much more robust, and to stop immediately if anything awry
- happens.
- (copy_block): Utility function to copy n bytes from one fd to
- another.
- (header_write): Utility function to write out raw headers to an
- fd.
- (camel_mbox_summary_update): Incremental summary updater.
-
- * providers/mbox/camel-mbox-folder.c (mbox_get_message_by_uid):
- Dont unref the stream, because of the broken(tm) ref model of gtk
- widget that for some odd reason is being perpetuated in camel.
- (mbox_expunge): Reenable expunge again.
- (mbox_append_message): Removed the optimised mbox append. If its
- an issue, it can go back later. Cleaned up a lot, checks error
- returns, and automagically translates 'From ' into '>From' as
- necessary.
-
-2000-05-07 NotZed <notzed@helixcode.com>
-
- * camel-mime-filter.c (filter_run): Oops, forgot to add the
- backlen to the pre-buffer (*poof*).
-
-2000-05-07 NotZed <NotZed@HelixCode.com>
-
- * camel-mime-message.c (construct_from_parser): Allow
- HSCAN_FROM_END to terminate the processing of a message.
-
- * camel-folder-summary.c (perform_content_info_load): Ick, dont
- try and append a node onto its own list.
- (camel_folder_summary_clear): Actually clear the indexes after
- we've removed the messages.
- (camel_folder_summary_clear): Set dirty if it changes.
- (camel_folder_summary_load): Clear dirty.
- (camel_folder_summary_save): Only save if dirty.
-
- * providers/mbox/camel-mbox-summary.c (summary_header_load): Oops,
- remember to call that parent class first ...
- (summary_header_save): Here too.
- (camel_mbox_summary_load): Do more checking to verify the index
- contents as well as teh summary contents, against the mbox
- contents.
- (camel_mbox_summary_load): Removed some fo that checking, it needs
- more code to work reliably.
-
-2000-05-07 NotZed <notzed@helixcode.com>
-
- * providers/mbox/camel-mbox-summary.c (camel_mbox_summary_load):
- Set the size and mtime of the mbox we indexed once done.
-
- * camel-folder-summary.c (camel_folder_summary_set_index): Dont
- write the index if it changes - let the claler fix it (uh, kind of
- impacts performance).
- (camel_folder_summary_load): close in.
-
- * camel-folder-summary.c (summary_format_string): Check header
- exists before trying to strip its leading spaces.
-
-2000-05-06 NotZed <NotZed@HelixCode.com>
-
- * camel-folder.h: Removed summary info from here, and include
- camel-folder-summary.h as well.
-
- * camel-mime-parser.c (camel_mime_parser_step): Allow it to accept
- a NULL databuffer.
-
- * providers/mbox/camel-mbox-summary.c: Totally new file, now
- subclasses camel-folder-summary.
-
- * camel-folder-summary.c (message_info_load): Load the uid as a
- string.
- (message_info_save): And save too.
- (camel_folder_summary_clear): New function, clears the contents of
- the summary.
-
- * providers/mbox/camel-mbox-folder.c: Fixes for summary changes.
- (mbox_get_message_by_uid): Completely redone. Now cross-checks
- the summary information to make sure we get a real message.
- (mbox_append_message): Disabled the copy version of append for
- now.
- (mbox_expunge): Temporarily disabled the expunge function, until
- it is put back in camel-mbox-summary.c
-
-2000-05-05 NotZed <NotZed@HelixCode.com>
-
- * camel-folder-summary.c: And same here ...
- (camel_folder_summary_encode_fixed_int32): Ugh, fwrite doesn't
- return -1 on error ..
- (camel_folder_summary_decode_fixed_int32): Neither deos fread.
- (camel_folder_summary_encode_token): Fix here too.
- (summary_build_content_info): Use start-headers to get the pos of
- the message, not parser_tell(), which might not be what we
- expected because of parser_unstep().
- (camel_folder_summary_encode_token): Use bserch() to tokenise the
- values, rather than a linear search.
-
- * camel-mime-utils.c: Defined out some memory profiling stuff I
- left there by mistake.
- (header_decode_mailbox): Dont try to append the word part of a
- local address if we ran out of words.
-
- * camel-mime-parser.c (folder_scan_content): Apply the fix from
- the header scanner to here too.
- (folder_scan_header): Only check for end of header if we have
- space for it (didn't end the read with a newline)
- (folder_scan_header): inptr is the only real thing we need
- registerised for performance. Try to help the compiler be smart
- about it ..
- (folder_scan_header): Simplified the save header case a tad.
-
- Commented out some memory profiling stuff.
-
-2000-05-05 NotZed <notzed@helixcode.com>
-
- * camel-mime-utils.c (header_decode_mailbox): Plug a memory leak.
- (header_decode_text): Fixed memory leaks with g_string_append().
- (header_encode_string): And here too, and a few other places. The
- glib api is so awful ...
- (header_content_type_decode): More memory leaks.
-
-2000-05-05 NotZed <notzed@helixcode.com>
-
- * camel-mime-parser.c (folder_scan_init_with_fd): Make sure we
- init the end of buffer sentinal!
- (folder_scan_init_with_stream): And here too ...
-
-2000-05-04 NotZed <NotZed@HelixCode.com>
-
- * providers/mbox/camel-mbox-folder.c (summary_get_message_info):
- Maxcount is minimum of the max and the requested count, not the
- maximum :)
-
- * camel-mime-parser.c (folder_scan_content): Properly set midline,
- so we dont falsely catch offset boundary markers (i.e. From inside
- content).
- (folder_read): Set a sentinal on the end of the read data (\n) so
- we dont have to check the buffer boundary in the inner loop.
- (mempool_*): New experimental memory management routines, speed
- up simple structure parsing by about 25% ... not compiled in by
- default. Something similar may be needed for camel-mime-utils to
- address performance issues with g_malloc and friends.
-
- * camel-mime-utils.c: Added a macro w(x) used to wrap all warnings
- about mime/rfc violations, so they can be turned off.
-
- * camel-folder-summary.c (summary_build_content_info): Step after
- the end of a message ...
- Turn into a stand-alone program for testing and profiling.
-
-2000-05-04 Dan Winship <danw@helixcode.com>
-
- * providers/pop3/camel-pop3-store.c (pop3_connect): Don't fall
- back to plaintext passwords if APOP fails, since it should also
- fail.
-
-2000-05-04 Dan Winship <danw@helixcode.com>
-
- * camel-session.c (camel_session_list_providers): New function to
- replace camel_provider_scan. Returns a list of either (a) all
- currently-loaded providers, or (b) all available providers.
-
- * camel-url.[ch]: Add an "empty" flag to CamelURL (indicating that
- it contains only a protocol).
-
- * camel-service.c (camel_service_query_auth_types): Make this take
- a CamelException (since it may have to try to connect to the
- server, and it might not able to.)
-
- * providers/pop3/camel-pop3-store.c: add KPOP (Kerberized POP)
- support. This is mostly so I have two kinds of authmech to play
- with instead of just one. (But it does actually work.)
-
- * providers/smtp/camel-smtp-transport.c (query_auth_types): update
- for prototype change, but disable the functionality, since it
- doesn't really support any auth types yet.
- (camel_smtp_transport_get_type): add an object init function to
- set the service url_flags.
-
-2000-05-04 NotZed <NotZed@HelixCode.com>
-
- * providers/mbox/camel-mbox-summary.c: Yes, and anotherone.
-
- * camel-mime-utils.c: And another one.
-
- * camel-mime-part.c: And another one.
-
- * camel-mime-part-utils.c: And another one.
-
- * camel-folder-search.c: And another one.
-
- * camel-mime-parser.c: Reverted a change wihtout a ChangeLog entry.
-
-2000-05-04 NotZed <NotZed@HelixCode.com>
-
- * camel-folder-summary.[hc]: Yes, CamelFolderSummary is back ...
- ... re-usable class to summarise and index any stream or message
- and to manage/load/save the created summaries.
-
- * camel-folder.c: Include string.h to kill a warning.
-
-2000-05-03 Jason Leach <leach@wam.umd.edu>
-
- * Makefile.am (INCLUDES): add $(UNICODE_CFLAGS) to the INCLUDES,
- people who installed libunicde in non-standard include paths need
- this.
-
-2000-05-03 NotZed <NotZed@HelixCode.com>
-
- * camel-folder.h: Added pos/bodypos/endpos to the basic message
- content info object. Size to be removed? Moved the
- messageconentinfo and messageinfo back to camel-folder-summary.h.
-
- * camel-mime-filter-index.c (camel_mime_filter_index_set_ibex):
- New function to (re)set the index to use on a filter.
-
- * camel-mime-parser.c (camel_mime_parser_scan_from): Whole bunch
- of inline docs.
- (camel_mime_parser_drop_step): New function to drop a state from
- the parser. Needs more testing.
-
- * camel-mime-utils.c (rfc2047_decode_word): If the iconv handle is
- -1, then dont try and convert (crashes unicode_iconv?).
- (rfc2047_decode_word): Use alloca for variables instead of
- g_malloc - by the rfc they should always be short.
- (rfc2047_decode_word): If we can't do the charset conversion, undo
- the quoted-printable/base64 at least? Should probably convert
- unknown characters to the utf-8 unknown character.
-
-2000-05-02 Larry Ewing <lewing@helixcode.com>
-
- * camel-mime-utils.c (header_decode_date): fix typo when
- dereferencing saveoffset.
-
-2000-05-02 NotZed <NotZed@HelixCode.com>
-
- * camel-folder-search.c: Added some header doco.
-
- * camel.h: REmove gmime-utils.h from here.
-
- * providers/mbox/camel-mbox-search.[ch]: Removed. Functionally
- redundant.
-
- * providers/mbox/camel-mbox-folder.c (mbox_search_by_expression):
- Use the new CamelFolderSearch class to do the actual searching,
- just setup the search here.
-
- * camel-folder-search.[ch]: A helper class that providers may
- subclass to provide their own search functionality, or they can
- simply use as is, it supports body searches if an ibex is
- supplied, and header searches if a summary is supplied.
-
-2000-05-02 Matt Loper <matt@helixcode.com>
-
- * Makefile.am: set G_LOG_DOMAIN.
- * providers/MH/Makefile.am: same.
- * providers/maildir/Makefile.am: same.
- * providers/mbox/Makefile.am: same.
- * providers/nntp/Makefile.am: same.
- * providers/pop3/Makefile.am: same.
- * providers/sendmail/Makefile.am: same.
- * providers/smtp/Makefile.am: same.
-
-2000-05-02 NotZed <NotZed@HelixCode.com>
-
- * providers/mbox/camel-mbox-search.c
- (camel_mbox_folder_search_by_expression): Dont store/remove
- current search from the search list.
-
- * providers/mbox/camel-mbox-folder.h: Removed searches list,
- searches are all sync now.
-
- * gmime-utils.[ch]: What the hell, remove it. This will break the
- nntp provider. The mime parser can be used instead though.
- Removed from all code including it (but none were using it).
-
- * gmime-utils.c (_store_header_pair_from_string): Removed bizarre
- string_dichotomy version of this. This code is somewhat redundant
- now, and is headed for death anyway.
-
- * gstring-util.c (g_string_dichotomy): Same with this one.
- (g_string_clone): Removed a memory leak, g_string_new() allocates
- its own memory.
- (g_string_append_g_string): Allow to append an empty gstring onto
- another gstring, dont abort()!
-
- * string-utils.c (string_dichotomy): Removed this incredibly weird
- function.
-
- * camel-folder.c (_create): Replaced the rather obtuse use of
- "string_dichotomy" function with a simple strrchr(). Still not
- sure it'll work.
-
- * camel-folder-summary.c: cvs removed a long-removed file.
-
- * camel-mime-parser.c (folder_scan_header): Fix the previous
- overflow problem properly (can happen in 2 places).
- (header_append): A new macro to include the code changed above, so
- it only appears in one place.
- (folder_scan_step): Change the content type to text/plain if the
- multipart is broken. Doesn't actually change the header though.
- (header_append): Also move the header-start tracking stuff here.
- Could be a static function to save code.
-
-2000-05-02 NotZed <notzed@helixcode.com>
-
- * camel-mime-part-utils.c
- (simple_data_wrapper_construct_from_parser): Dont use autofill on
- these fucking long function anmes!!!!!!
-
-2000-05-02 NotZed <NotZed@HelixCode.com>
-
- * providers/mbox/camel-mbox-summary.c
- (camel_mbox_summary_expunge): Fix the offset for the summary when
- an item is expunged to take account of the From line.
-
-2000-05-01 NotZed <NotZed@HelixCode.com>
-
- * providers/mbox/camel-mbox-folder.h (CamelMboxFolder): Removed
- search_id.
-
- * providers/mbox/camel-mbox-search.c
- (camel_mbox_folder_search_cancel): Remove.d
- (camel_mbox_folder_search_complete): Removed.
- (camel_mbox_folder_search_by_expression): Changed back to sync
- api.
- (struct _searchcontext): Removed cancelled flag.
- (find_context): Removed.
- (func_header_contains): Debug out some search stuff.
-
- * providers/mbox/camel-mbox-search.h
- (camel_mbox_folder_search_by_expression): Moved back to sync api.
-
- * providers/mbox/camel-mbox-summary.c
- (camel_mbox_summary_set_flags_by_uid): New function to update the
- flags in the summary.
- (camel_mbox_summary_expunge): Expunge messages from a folder.
- (offset_content): Re-align offsets of summary when messages
- added/removed to an existing summary.
- (camel_mbox_summary_remove_uid): Remove a message summary entry by
- uid.
- (index_folder): Restore flags from X-Evolution header, if they are set.
- (index_folder): Make sure we index using a decimal uid, since
- thats what everything else indexes off (oops).
- Upped SUMMARY_VERSION as a result.
- (camel_mbox_summary_expunge): Oops, my wrong, use the string uid
- to unindex on.
-
- * providers/mbox/camel-mbox-folder.c (_get_message_by_uid):
- Connect to the message_changed signal.
- (_init): Set permanent flags to something reasonable. No user
- flags yet ...
- (message_changed): If the flags of the message change, update the
- flags in the summary.
- (mbox_expunge): Implement the expunge.
- (camel_mbox_folder_class_init): Renamed all leading _'s to mbox_'s
- (mbox_expunge): Emit a folder_changed signal on expunge (uh, even
- if it didn't ...)
-
- * camel-folder.c (_finalize): Uh, dont free permanent_flags
- anymore (this wouldn't failed anyway, it was a GList !!!)
- (camel_folder_search_complete): Removed.
- (camel_folder_search_cancel): Removed.
- (camel_folder_expunge): Changed to only allow expunge on an open
- folder. It doesn't make sense for mbox, otherwise (?)
- (camel_folder_class_init): Added a folder_changed signal.
-
- * camel-folder.h (struct _CamelFolder): Change permanent_flags to
- a bitfield.
- (list_permanent_flags): Renamed to get_permanent_flags, and
- returns a bitfield.
- (camel_folder_expunge): Changed expunge to a void type. The
- messages would no longer be useful after they have been removed
- ...
- (CamelFolderClass): New function summary_get_by_uid() to get a single
- summary.
- (*search*): Moved back to synchronous search api ... *sigh*
-
- * camel-folder.h: Removed CamelSearchFunc.
-
- * camel-mime-message.c (set_flag): Removed.
- (camel_mime_message_set_flag): Removed.
- (get_flag): Removed.
- (camel_mime_message_get_flag): Removed.
- (add_flag_to_list): Removed.
- (get_flag_list): Removed.
- (camel_mime_message_get_flag_list): Removed.
- (camel_mime_message_get_flags): New interface to get system flags.
- (camel_mime_message_set_flags): " to set ".
- (camel_mime_message_get_user_flag): To get a user flag.
- (camel_mime_message_set_user_flag): To set a user flag.
- (finalize): Hmm, the old one free'd the key and data, not good
- when the data is a boolean ...
-
-2000-04-30 Dan Winship <danw@helixcode.com>
-
- * camel-provider.h: Tweak the definition of CamelProvider. Among
- other things, a provider may now be both a store and a transport.
-
- * camel-provider.c: Remove a lot of code we had no intention of
- using. This now only contains two functions: camel_provider_init
- to read the installed .urls files, and camel_provider_load to
- load and register a new provider.
-
- * camel-session.c: Remove more unused code and simplify some of
- the remaining code. The list of available provider modules is now
- stored in the session, and it handles calling camel_provider_load
- to load them as needed. Provider registration is now done by
- calling back from the module init routine, which allows a single
- module to register providers for multiple URL types.
-
- * providers/*: Update provider structures and init routines for
- the new stuff. Add a .urls file to each provider specifying what
- urls it handles, and install that with the library.
-
- * providers/nntp/camel-nntp-provider.c: Add hints towards
- supporting both news: and nntp: URLs, and using nntp as both a
- store and a transport.
-
-2000-04-29 Dan Winship <danw@helixcode.com>
-
- * camel-internet-address.c (camel_internet_address_get): const
- poison
-
- * camel-mime-part-utils.c
- (simple_data_wrapper_construct_from_parser):
- camel_mime_parser_tell() returns an offset from where it started
- parsing, not necessarily from the start of data. Since we're
- parsing a bounded seekable_stream, we need to add the stream's
- starting bound to camel_mime_parser_tell's return value to
- create the substream in the right place.
-
- * camel-seekable-substream.c
- (camel_seekable_substream_new_with_seekable_stream_and_bounds):
- say CAMEL_STREAM_UNBOUND rather than -1 in doc.
-
- * camel-seekable-stream.c (camel_seekable_stream_seek): Add more
- info to docs.
-
-2000-04-28 Dan Winship <danw@helixcode.com>
-
- * camel-mime-parser.c (folder_scan_header): fix a bug that would
- cause corruption with very long headers.
-
-2000-04-27 Ettore Perazzoli <ettore@helixcode.com>
-
- * providers/pop3/Makefile.am (INCLUDES): Add `-I$(srcdir)/../../..'
- to pick the Camel includes.
- * providers/sendmail/Makefile.am (INCLUDES): Likewise.
-
- * camel.h: Don't #include <camel/data-wrapper-repository.h> anymore.
-
-2000-04-27 NotZed <NotZed@HelixCode.com>
-
- * camel-mime-utils.c (check_header): Dont try and check a NULL
- header.
-
- * camel-recipient.[ch]: Dead. Its not pining.
-
- * camel-mime-message.h: Dont include recipients.h anymore.
-
- * camel-mime-message.c (camel_mime_message_add_recipient): Accept
- name/address separately, and store in an CamelInternetAddress.
- (add_recipient): Removed.
- (remove_recipient): Removed.
- (remove_recipient_address): Renamed from remove_receipient, works
- via address.
- (camel_mime_message_remove_recipient_name): New function to remove
- by name.
- (get_recipients): Removed.
- (camel_mime_message_get_recipients): Return a camel-internet-address.
- (write_to_stream): No longer write receipients directly.
- (write_recipients_to_stream): Removed.
- (write_one_recipient_to_stream): Removed.
- (camel_mime_message_init): Setup recipients hashtable, rather than
- usign the recipients stuff.
- (set_recipient_list_from_string): Killed, a violent and lengthy
- death.
- (process_header): Simplified recipient handling code a lot.
- (received_date_str, sent_date_str, reply_to_str, subject_str,
- from_str): Removed some oddly-defined global statics.
- (camel_mime_message_class_init): Dont initialise above variables
- anymore.
- (init_header_name_table): Removed, use a table to init this, and
- do it in class init (2 lines of code ...).
-
- * camel-news-address.c: Class to represent news addresses -
- currently empty, and not built.
-
- * camel-internet-address.h: Class to represent internet (email)
- addresses.
-
- * camel-address.h: Abstract class to represent (lists of)
- addresses.
-
-2000-04-27 Dan Winship <danw@helixcode.com>
-
- * camel-mime-part.c (write_to_stream): Revert previous change. I
- was confused.
-
- * camel-url.[ch] (camel_url_encode, camel_url_decode): expose
- these routines.
-
-2000-04-26 Dan Winship <danw@helixcode.com>
-
- * camel-mime-part.c (write_to_stream): Only write a newline
- between the headers and the content object if the content object
- is not a CamelMedium. (If the content is a medium, it may have its
- own headers, which then need to go before the blank line.)
-
- * camel-mime-body-part.[ch]: Remove. We weren't using the fields
- that made this different from camel-mime-part, so it basically
- just forced us to do lots of gratuitous typecasting.
-
- * camel-multipart.[ch]: Use CamelMimePart. Remove the multipart
- parent stuff, since we weren't using that either.
-
- * etc: update for CamelMimeBodyPart -> CamelMimePart
-
-2000-04-26 Dan Winship <danw@helixcode.com>
-
- * camel-medium.c (set_content_object): sink the content object
- after referencing it.
-
- * camel-mime-part.c: fix various little things in the handling
- of CamelMedium methods. Change camel_mime_part_set_text to the
- more generic camel_mime_part_set_content.
-
- * camel.h: sync to current reality
-
- * camel-folder-utils.[ch]: removed
-
- * camel-mime-utils.c (header_format_date): fix format specifier
- for time zone. Fix typo in month names array.
-
-2000-04-26 NotZed <NotZed@HelixCode.com>
-
- * camel-seekable-substream.c (stream_seek): Changed to have
- absolute seek semantics, not relative to the bounds.
-
- * camel-seekable-stream.c (reset): When we reset, seek to the
- start of the bound, if there is one.
- (stream_tell): Make tell virtual.
-
- * camel-stream-filter.c (do_available): Removed.
-
- * camel-stream-buffer.c: Remove leading _'s from static functions.
- (stream_read): Renamed from read(). Fancy that conflicting! (my
- boo!) Others too.
-
- * providers/pop3/camel-pop3-folder.c (get_message_by_number):
- Changed to stream_mem interface.
-
- * providers/mbox/camel-mbox-folder.c (_get_message_by_uid): Fixed
- for streamfs interface changes, and implement a failure case.
- (_append_message): Changed for fs stream interface change.
-
- * camel-multipart.c (print_part): Iterate rahter than callback. I
- hate glists's interface (hence, move this to write_to_stream).
- (write_to_stream): Return an error (yuck, this is a royal PITA to
- do with the stream write interface).
-
- * camel-mime-message.c: Removed leading _ from static names.
-
- * camel-mime-part.h: construct_from_parser() now returns an error
- code.
-
- * camel-mime-part-utils.c
- (camel_mime_part_construct_content_from_parser): Changed to use a
- camel-data-wrapper instead of a camel-simple-data-wrapper (no
- change needed elsewhere?).
- (simple_data_wrapper_construct_from_parser): Fixes for stream-mem
- interface changes.
-
- * camel-simple-data-wrapper.[ch],
- camel-simple-data-wrapper-stream.[ch],
- camel-stream-data-wrapper.[ch], removed. Fixed including of these
- files.
-
- * camel-mime-part.c (camel_mime_part_set_text): Remove the use of
- the camel-simple-data-wrapper-stream, just use a mem stream.
- (write_to_stream): Renamed from my_*
- (construct_from_stream): Return an error on error.
-
- * camel-stream-mem.c (camel_stream_mem_new*): Remove mode
- parameter.
-
- * camel-stream-mem.h (enum CamelStreamMemMode): Removed. It
- wasn't used at all.
-
- * camel-data-wrapper.h: Add camel_data_wrapper_new() to create
- these.
- (write_to_stream, construct_from_stream): Return an error
- indicator for success. Fixed all methods to match (ICK).
-
- * Makefile.am (libcamel_la_SOURCES): Remove
- camel-simple-data-wrapper.c, camel-simple-data-wrapper-stream.c,
- camel-stream-data-wrapper.c. Obsoleted by code re-use!
-
- * camel-data-wrapper.c (construct_from_stream): Change the default
- implementation to just set the output stream == construction
- stream. Well, this lets me get rid of both simple-data-wrapper
- and stream-data-wrapper (unused anyway), and
- simple-data-wrapper-stream in one hit. CamelDataWrapper is now
- also a concrete class.
- (write_to_stream): Use camel_stream_write_to_stream() to
- calculate/return values (and save code).
- Include <errno.h> for obvious reasons.
-
- * camel-stream.c (eos): Provide a default implementation of .eos().
- (camel_stream_write_to_stream): Make it return an error code on
- error.
- (camel_stream_printf): Changed to return the number of bytes
- written/error.
- (camel_stream_available): Removed.
-
- * camel-stream-fs.h (enum CamelStreamFsMode): Removed. Changed to
- use unix modes and so forth (wasn't used for anything but new file
- creation and didn't work well either).
-
- * camel-stream-fs.c: Removed leading _'s for names. And removed
- some virtual method 'documentation'.
- (destroy): Dont try and close a closed/error fd. Only report
- error if close returns -1. Moved all the code to finalise(), and
- killed this function.
- (init_with_fd): Properly setup the seek offset, if it is a
- valid and seekable file descriptor.
- (init_with_fd_and_bounds): Use off_t for bounds, set bounds on the
- seekable stream.
- (init_with_name): Return error codes.
- (init_with_name_and_bounds): Ditto.
- (camel_stream_fs_new_with_name): REturn NULL object if it failed.
- (camel_stream_fs_new_with_name_and_bounds): Return NULL object on
- failure. Changed with_name* api's to take unix open style args
- and flags.
- (read): The bounded stream bounds checking seemed off, simplified
- code a bit.
- (write): Implement bounds checking for writing, the comment was
- wrong, it could make sense to bound writing. Cleaned up a little.
- (available): Gone.
- (eos): Removed. Use CamelStream's implementation now.
- (close): Reset the fd to -1, provide a warning for bad usage.
- (seek): Cleaned up. Changed the behaviour a little, the returned
- offset is the absolute position in the file, even in bounded
- streams.
- (seek): Seek from end mirrors lseek() behaviour (reverse seeking).
-
-2000-04-25 NotZed <NotZed@HelixCode.com>
-
- * camel-stream-fs.h (struct _CamelStreamFs): Moved bounds and eof
- indicator to other parent classes.
-
- * camel-stream.c (camel_stream_printf): New utility
- function. Obvious use.
-
- * camel-stream-mem.c: Removed leading _'s from static func's.
- (camel_stream_mem_new_with_byte_array): Fixed for api changes, set
- the owner for the byte array to us.
- : Removed A bunch of gtk doc stuff for static (implementation) functions.
- (available): Removed.
- (write): Fixed the write implementation so that seek() works on a
- seekable memory stream, as expected. Seeking past the end of the
- buffer has unix semantics (filling with 0).
- (available): Removed.
- (write): Implement seekable stream bounded stream.
- (read): Implement seekable stream bounded stream.
- (close): Dont free the stream_mem if we're not the owner.
- (seek): Allow to seek beyond the end of memory area,
- implement bounds checking.
- (seek): Set errno on bad policy.
-
- * camel-stream-mem.h (struct _CamelStreamMem): Changed position to off_t.
- (new_with_buffer): Changed len to be a size_t.
- (set_buffer, set_byte_array): New interface functions.
- (struct _CamelStreamMem): Removed position, it is stored in the
- superclass.
-
- * camel-stream.h: Removed some of the seemingly random
- whitespace. Removed the available method (its not
- impelemented/useful enough).
-
- * camel-seekable-substream.c
- (init_with_seekable_stream_and_bounds): Remove the data_available
- stuff, it hasn't been properly implemented/finished, and may never
- work (unfortunately *sigh).
- (reemit_parent_signal): Removed part of the above change.
- (set_bounds): Removed (moved to seekable-stream).
- : Fixed up some of the generally unreadable indenting (sorry,
- wrapping at 80 characters with
- camels_really_long_function_names()
- just_doesnt_work_very_well_does_it().
- (available): Removed.
- (stream_seek): Fixup for object changes. Make sure we return -1
- if the parent stream can't seek.
-
- * camel-seekable-stream.c (ccamel_seekable_stream_set_bounds): New
- function to bound any seekable stream.
- : Removed _'s.
- (camel_seekable_stream_class_init): Implement an init function, to
- setup the stream bounds to unbound.
-
- * camel-seekable-stream.h (CamelSeekableStreamClass): New virtual
- method set_bounds for seekable streams.
- (CAMEL_STREAM_UNBOUND): New define for no bound.
-
- * camel-seekable-substream.h (struct _CamelSeekableSubstream):
- Removed sup_bound and inf_bound, moved to CamelSeekableStream (and
- renamed, and changed to off_t's).
- (new_with_seekable_stream_and_bounds): Use off_t as the bounds.
- (CamelSeekableSubstreamClass): Uh, why was the intialiser virtual?
- Removed.
-
- * camel-seekable-stream.[ch] (CamelSeekableStreamClass): Changed seek
- to accept an off_t as the offset.
- (struct _CamelSeekableStream): Renamed cur_pos to position and
- changed it to an off_t type.
- (enum CamelStreamSeekPolicy): Set to match the SEEK_* constants
- from lseek().
- (get_current_position): Renamed to tell().
-
- * camel-stream-buffer.h: Commented out set_vbuf - never implemented.
-
-2000-04-25 Dan Winship <danw@helixcode.com>
-
- * camel-stream-buffer.c (_eos): only return TRUE if the parent is
- at eos AND the buffer has been exhausted
-
- * camel-mime-message.c: fix some incorrect macro usage that
- resulted in bogus casts
-
-2000-04-24 Dan Winship <danw@helixcode.com>
-
- * camel-mime-part-utils.c
- (simple_data_wrapper_construct_from_parser): fix a cut-and-pasto.
-
- * providers/mbox/camel-mbox-folder.c (_get_message_by_uid): ref
- (and sink) the message stream if we're going to unref it later.
- Otherwise it could get destroyed while there are still substreams
- attached to it. This needs a cleaner solution.
-
- * camel.h: remove data-wrapper-repository.h include(s)
-
-2000-04-24 NotZed <NotZed@HelixCode.com>
-
- * camel-mime-message.c (construct_from_parser): Allow MESSAGE_END
- _or_ EOF as valid termination conditions.
-
- * providers/mbox/camel-mbox-summary.c (message_struct_new): Decode
- and then re-encode the addresses, so they are consistently
- formatted.
-
- * camel-mime-utils.c (header_decode_mailbox): Store the address in
- a _header_address. And try to get a comment-stored name if there
- is one.
- (header_decode_address): Actually return an address.
- (header_to_decode): Renamed to header_address_decode()
- (header_mailbox_decode): New function to get a single mailbox.
- (header_mime_decode): Return the major/minor value, as
- appropriate.
- (header_address_new, and friends): Whole bunch of utility
- functions for working with the address thingies.
- (header_decode_domain): Free the string header, and dont expand
- '.' into ' . '.
-
- * camel.c (camel_init): No longer call
- data_wrapper_repository_init.
-
- * camel-medium.c (write_to_stream): Moved (back) to
- camel-mime-part.
- (add_header):
- (set_header):
- (remove_header):
- (get_header): Make all these abstract, and spit warnings if
- called. I guess it could manage the list, but well, it doesn't.
-
- * camel-medium.h (struct _CamelMedium): Dont store headers here,
- the implementor is the only one who knows their format.
- (CamelMediumClass): Changed header values to be void *'s. They
- need not be strings?
-
- * camel-simple-data-wrapper.c (construct_from_stream): And we're
- back. Set the output stream.
- (construct_from_parser): Moved to camel-mime-part-utils.
-
- * camel-mime-part-utils.c
- (camel_mime_part_construct_content_from_parser): Create the
- contents of multipart and simple messages.
- (camel_mime_part_construct_content_from_parser): Oops, this was
- totally screwed up, try creating the right cotnent on the right
- object.
-
- * camel-multipart.c (construct_from_parser): Moved to
- camel-mime-part-utils.
- (separate_part): Removed.
-
- * camel-mime-part.c (construct_from_stream): Back again! This now
- switches over to using a mime parser for any mime parts, only.
- (my_write_to_stream): Write our headers and so forth here.
- (add_header): Add header directly, parent class is abstract.
- (remove_header): Ditto.
- (set_header): Ditto.
-
- * camel-data-wrapper.c (camel_data_wrapper_construct_from_stream):
- Remade abstract.
- (camel_data_wrapper_construct_from_parser): Moved to
- camel_mime_part.
-
- * camel-data-wrapper.h: Put back construct_from_stream.
-
- * camel-mime-part.h: Put construct_from_parser in here, the
- data-wrapper shouldn't know about mime. Ok, so now to undo half
- of the last hours changes ... duh.
-
-2000-04-23 Dan Winship <danw@helixcode.com>
-
- * camel-mime-utils.c (header_to_decode, header_mime_decode): fix
- some obvious minor bugs noted by -Wall.
-
-2000-04-23 NotZed <NotZed@HelixCode.com>
-
- * providers/pop3/camel-pop3-folder.c (get_message_by_number): Use
- construct_from_stream instead of set_input_stream().
-
- * camel-simple-data-wrapper-stream.c
- (camel_simple_data_wrapper_stream_construct): REmoved the destroy
- callback code.
- (wrapper_destroy_cb): Removed.
-
- * camel-simple-data-wrapper.h: Add prototype for _construct()
- method.
-
- * camel.c: Include unicode.h to kill a warning.
-
- * camel-data-wrapper.h (CameldataWrapperClass): Removed
- construct_from_stream virtual method.
- Removed get/set input stream.
-
- * data-wrapper-repository.[ch]: Removed&from build. Obsoleted?
- The justification as is follows: It is mixing storage
- protocol/format with message architecture. It really just doesn't
- serve any purpose, as each medium implementor will have to have its
- own type->handler mapping, and the only current implementor,
- mimepart has a very simple structure and no need for this.
-
- * camel-medium.c (write_to_stream): Moved here from most of the
- stuff in camel-mime-part. Well, the MEDIUM is the one that knows
- what the headers are, and the content is, let it write it out.
-
- * camel-mime-part-utils.c (camel_mime_part_construct_content):
- Copied from camel-mime-part.c, removed handling of message
- followon state (moved to camel-mime-message).
- (camel_mime_part_construct_content_from_parser): Renamed from
- construct_content.
- (camel_mime_part_construct_headers_from_stream):
- (camel_mime_part_construct_content_from_stream):
- (camel_mime_part_store_stream_in_buffer): Removed. Replaced by
- the new construct from parser stuff.
-
- * camel-mime-message.c (construct_from_parser): Do
- construct_from_parser for mime-message.
- (_write_to_stream): Set the mime-version header for medium to
- write out, rather than writing it out ourselves.
-
- * camel-data-wrapper.c (set_mime_type_field): Ref the
- content_field when we get it?
- (construct_from_stream): Removed.
- (camel_data_wrapper_construct_from_stream): Changed to a helper
- function, creates a mime_parser, and constructs from that.
- (set_input_stream): Removed.
- (camel_data_wrapper_set_input_stream): Removed.
- (get_input_stream): Removed.
- (camel_data_wrapper_get_input_stream): Removed.
-
- * camel-mime-parser.c (camel_mime_parser_unstep): New function.
- Cause a subsequent call to mime_parser_step() to return the same
- state over again.
-
- * providers/mbox/camel-mbox-folder.c (_get_message_by_uid):
- Initial test code using the mime parser to construct the message.
- (_get_message_by_uid): Use construct_from_stream() instead of
- creating our own parser.
-
- * camel-mime-part.c (construct_from_parser): part constructor.
- (camel_mime_part_construct_content): Basically a simpler
- replacement for the datawrapper repository.
- (camel_mime_part_init): Set the default type to text/plain.
- (camel_mime_part_construct_content): Removed to
- camel-mime-part-utils.c
- (my_get_output_stream): Removed. The streeam is in the
- data-wrapper.
- (my_get_content_object): Removed. The content object is stored in
- the medium. If none is there, the object wasn't created properly.
- (my_write_content_to_stream): Removed. The content object is the
- one that knows how to write itself out!!!!!!!!
- (my_write_to_stream): Remove the base header writing stuff - has
- been moved to camel-medium, where it belongs. This can just be
- used to check for mandatory headers.
- (my_construct_from_stream): Removed.
- (my_set_input_stream): What the hell, i'll remove this too.
- Nobody seems to understand how it differs from create from stream,
- and they both seem to serve the same purpose ...
-
- * camel-simple-data-wrapper.c (construct_from_parser): Initial
- implementation of a content constructor.
- (construct_from_stream): Removed! Job taken over by
- construct_from_parser.
-
- * camel-multipart.c (construct_from_parser): Multipart
- construction routine.
- (camel_multipart_init): Set the default multipart type to
- multipart/mixed. Duh, no subtype is not allowed anyway.
- (set_input_stream): REmoved. Replaced by construct_from_parser.
-
-2000-04-22 Dan Winship <danw@helixcode.com>
-
- * camel-multipart.[ch]: clean, document, etc.
- (camel_multipart_init): pick a prettier default boundary. Still
- need to deal with the larger problem
-
-2000-04-22 NotZed <NotZed@HelixCode.com>
-
- * camel-mime-message.h (struct _CamelMimeMessage): Removed
- send_date, and received_date, and replaced it with a time_t
- 'date' (this is what the header is called), and date_offset to
- store the GMT offset of the date.
-
- * camel-mime-message.c (camel_mime_message_set_from): Update raw
- header as we go.
- (_set_from): Removed.
- (_get_from): Removed.
- (camel_mime_message_get_from): Moved implementation here.
- (camel_mime_message_get_subject): Move implementation here.
- (_get_subject): Nuked.
- (camel_mime_message_set_subject): Handle utf-8 input, and also
- update raw header when changed.
- (_set_subject): Removed.
- (_set_received_date): Removed.
- (camel_mime_message_set_received_date): Removed.
- (_get_received_date): Removed.
- (camel_mime_message_get_received_date): Removed.
- (_get_sent_date): Removed.
- (camel_mime_message_get_sent_date): Removed.
- (camel_mime_message_get_date): New function to get the date as a
- time_t/offset.
- (camel_mime_message_set_date): Set the date as a time_t/offset.
- (camel_mime_message_get_date_string): Get the date as a string.
- (camel_mime_message_init): Initialise the current date as
- 'CMAEL_MESSAGE_DATE_CURRENT'.
- (_set_reply_to): Removed.
- (camel_mime_message_set_reply_to): Moved implementation here.
- This is still broken, reply-to can have multiple addresses.
- (_get_reply_to): Removed.
- (_set_field): Removed, no longer used anywhere.
- (_get_field): Also removed.
- (_init_header_name_table): Add the Date header.
- (process_header): Also handle snooping of Date header here.
-
- * camel-stream-filter.c (finalise): Unref the source stream on
- finalise, and also call the parent class (oops).
-
- * camel-mime-parser.c (camel_mime_parser_state): New function to
- get the current parser state.
- (camel_mime_parser_stream): Allow you to get the stream back from
- the mime_parser.
- (camel_mime_parser_fd): Alternative to allow you to get the fd
- back from the mime_parser.
- (folder_scan_init_with_stream): Properly ref/unref the stream.
- (folder_scan_close): Properly unref the stream/close the fd on
- exit.
- (folder_scan_init_with_fd): Close the old fd if there is one.
-
- * camel-data-wrapper.c (camel_data_wrapper_construct_from_parser):
- New method, construct a data wrapper from an initialised parser.
- (construct_from_parser): Empty implementation.
-
- * providers/mbox/camel-mbox-summary.c (message_struct_new):
- Convert subject line to unicode, before storing in the summary.
- (strdup_trim): Removed, no longer needed.
-
- * providers/mbox/camel-mbox-folder.c (_get_message_by_uid): Ref
- the folder after setting it in the new message.
-
- * camel-mime-part.c (my_set_content_object): Have the headers
- follow the content-type change here too.
- (my_write_to_stream): Dont write content-type here, automatically
- stored in the headers ...
- (my_write_to_stream): Use header_disposition_format() to format
- the content-disposition header.
- (my_write_to_stream): Removed old code, all headers are now stored
- in the camel-medium level, always. Need to do the same with
- camel-mime-message i suppose ...
- (my_write_to_stream): Write the content using the parent class,
- not some weird function.
- (camel_mime_part_class_init): Dont override get_output_stream.
- (camel_mime_part_encoding_from_string): Bleh, make it
- case-insensitive.
-
- * camel-mime-utils.c (header_content_type_is): Handle empty types.
- (header_encode_string): Start of an implementation of the rfc2047
- encoder. It does iso-8859-1, and us-ascii, and utf-8 (others get
- tricky *sigh*)
- (rfc2047_encode_word): Convert a single word/string into rfc2047
- encoding.
- (quoted_encode): Different quoted-printable encoding for rfc2047
- encoding of headers.
-
- * gmime-content-field.c (gmime_content_field_write_to_stream): Use
- header_content_type_format() to format it.
-
-2000-04-21 NotZed <NotZed@HelixCode.com>
-
- * camel-mime-utils.h: Add prototype for header_param_list_free.
-
- * camel-recipient.c: New function to remove all the types of a
- recipient list. I think this whole object needs a major review.
-
- * camel-mime-message.c (camel_mime_message_class_init): Removed
- parse_header_pair override, override add_header instead.
- (_parse_header_pair): Renamed to add_header.
- (remove_header): Add this method, to make sure we keep upto date
- with removed headers too.
- (_set_field): If given a NULL value, clear it out.
- (_set_recipient_list_from_string): Constify.
- (set_header): Override set_header from camel_medium.
- (process_header): Local function to handle set/add/remove of each
- header we know about.
-
- * camel-mime-part.c (camel_mime_part_class_init): Removed
- parse_header_pair setup.
- (my_parse_header_pair): Moved into add_header(), removed.
- (my_set_disposition): Allow a NULL disposition to clear it.
- (my_set_content_id): Allow NULL content id to clear it.
- (remove_header): Track removed headers.
- (my_set_description): Allow NULL description to clear it.
- (my_set_content_MD5): Make sure we copy the md5 value, and allow a
- NULL value to reset it.
- (my_set_filename): Copy the filename.
- (my_set_header_lines): Removed. Nothing uses it, it doesn't
- actually serve any purpose.
- (camel_mime_part_set_header_lines): Ditto.
- (my_get_header_lines): Ditto.
- (camel_mime_part_get_header_lines): Ditto.
- (camel_mime_part_class_init): Remove *_header_lines setup.
- (camel_mime_part_init): Remove header_lines init.
- (my_finalize): Remove header_lines finalise.
- (my_write_to_stream): Write the headers here. This is just WRONG,
- camel_medium should be doing this.
- (my_get_output_stream): Kill a warning.
- (camel_mime_part_encoding_to_string): Ditto.
- (camel_mime_part_set_description): Unvirtualiase, use add_header()
- to do the processing.
- (my_set_description): Removed.
- (set_disposition): Renamed from my_set_disposition.
- (camel_mime_part_get_description): Get the descriptionf rom the
- get_header method.
- (my_get_description): Removed.
- (my_set_filename): Removed.
- (camel_mime_part_get_filename): Get the parameter from the
- disposition.
- (camel_mime_part_encoding_from_string): Handle NULL string.
- (camel_mime_part_init): Remove reference to filename.
- (my_finalize): Dont free filename.
-
- * camel-mime-part.h (CamelMimePartClass): Removed
- parse_header_pair() method, it doesn't add anything that
- add_header() can't be used for.
- (CamelMimePartClass): Remove *_header_lines methods.
- (struct _CamelMimePart): Remove header_lines list.
- (struct _CamelMimePart): Removed filename attribute.
-
- * camel-medium.c (camel_medium_init): Init headers to null, not a
- hashtable.
- (add_header): Append the headers as a list.
- (remove_header): Remove headers as a list.
- (get_header): Likewise for lookup.
- (free_header): Removed, no longer needed.
- (finalize): Free headers using header_raw_clear().
- (camel_medium_set_header): New function, to reset and override all
- values of a header with a new value.
-
- * camel-medium.h (struct _CamelMedium): Changed to use a
- header_raw struct rather than a hash table, to store headers
- (many headers can occur multiple times).
-
- * camel-mime-utils.c (header_raw_find_next): New function, allows
- you to find multi-valued header fields.
- (header_disposition_format): New function to format/create
- content-disposition header string.
- (header_param_list_format_append): Function to format parameter
- lists into a GString.
- (header_content_type_format): Function to format content-type into
- a usable format.
- (header_set_param): allow NULL value to remove the parameter.
- (decode_token): Renamed from header_decode_token.
- (header_decode_token): New interface for external use.
- (quoted_decode): Made static to kill annoying warnings.
- (g_strdup_len): Killed, replaced with calls to g_strndup().
- (rfc2047_decode_word): Made static to kill warnings.
- (decode_coded_string): Terminated.
- (g_string_append_len): Made static to kill warnings.
- (header_decode_text): Made static to kill warnings.
- (header_decode_text): Constify.
- (rfc2047_decode_word): Constify.
- (header_param): Constify.
- (header_content_type_new): Copy the type/subtype strings.
- (header_param_list_decode): Made static.
- (header_param_list_format_append): Made static.
- (quoted_decode): Constify.
- (g_string_append_len): Constify.
- (header_token_decode): New function to decode a single token.
-
- * providers/mbox/camel-mbox-summary.c (header_write): Append a
- trailing \n when writing headers.
- (strdup_trim): Killed a warning.
- (camel_mbox_summary_set_uid): Make sure the next uid is at least 1
- higher than any existing one.
- (header_evolution_decode): Use header_token_decode to get the
- token.
-
- * camel-mime-parser.c (folder_scan_header): Strip the trailing \n
- of the end of all header lines.
-
-2000-04-20 NotZed <NotZed@HelixCode.com>
-
- * providers/mbox/camel-mbox-utils.[ch]: Removed.
-
- * providers/mbox/camel-mbox-parser.[ch]: Removed. Removed
- references to it.
-
-2000-04-20 Dan Winship <danw@helixcode.com>
-
- * camel-mime-utils.c (rfc2047_decode_word): use libunicode iconv
- functions rather than libc ones (since libc might not have them).
- (header_decode_date): add autoconfiscation on timezone code
-
- * camel.c (camel_init): call unicode_init ()
-
-2000-04-20 NotZed <NotZed@HelixCode.com>
-
- * providers/mbox/camel-mbox-summary.c (message_struct_new): Trim
- leading/trailing spaces off the raw headers.
-
- * MERGE NEW_PARSER branch into HEAD, fixed conflicts.
-
- * gmime-content-field.c (_print_parameter): Duh, removed again
- (@@#$@ cvs merge).
-
- * camel-mime-utils.c (header_content_type_is): Constify.
- (header_content_type_unref): Killed a couple warnings.
-
- * camel-folder.c (_init): Removed more log crap.
-
- * providers/Makefile.am (SUBDIRS): Removed nntp, pending fixes for
- summary changes.
-
- * providers/mbox/camel-mbox-folder.c (_get_message_by_number):
- Fixed for new summary interface. Added a warning for using this
- broken api.
- (_get_message_by_uid): Fixed for message new with session
- vanishing.
-
-2000-04-19 Dan Winship <danw@helixcode.com>
-
- * camel-simple-data-wrapper-stream.c
- (camel_simple_data_wrapper_stream_get_type): This is a subtype of
- CamelSeekableStream, not CamelStream.
-
- * camel-seekable-substream.c: clean up a lot.
- (eos): When testing for end-of-stream, reset the parent position
- before testing if it is at end-of-stream, since either (a) it may
- have been seek'ed to eos by someone else, or (b) we may have been
- seek'ed away from eos and it hasn't been synced yet.
-
- * camel-medium.[ch] (camel_medium_add_header): const poison.
- (Belatedly goes with my change of 2000-02-23.)
- (camel_medium_init): Use g_strcase_{hash,equal} on the header
- array.
-
-2000-04-18 Dan Winship <danw@helixcode.com>
-
- * camel-mime-part.c (my_set_input_stream):
- * camel-data-wrapper.c (set_input_stream, set_output_stream): do
- better reference counting of streams so they actually go away
- when they should.
-
- * camel-log.[ch], *: Nuke camel log stuff. Replace calls to
- CAMEL_LOG_WARNING with calls to g_warning.
-
- * camel-data-wrapper.[ch]:
- * camel-simple-data-wrapper.[ch]:
- * camel-medium.[ch]: Clean, polish, document. Most of the gtk-doc
- comments added to camel-data-wrapper.c note serious problems that
- need to be fixed.
-
-2000-04-17 Dan Winship <danw@helixcode.com>
-
- * camel-mime-message.[ch]: Remove the "session" field from
- CamelMimeMessage. Nothing uses it, about half of the existing
- calls to camel_mime_message_new_with_session pass NULL, and
- there's no obvious reason for it to be there.
-
- * providers/MH/camel-mh-folder.c:
- * providers/maildir/camel-maildir-folder.c:
- * providers/mbox/camel-mbox-folder.c:
- * providers/mbox/camel-mbox-utils.c:
- * providers/nntp/camel-nntp-folder.c:
- * providers/pop3/camel-pop3-folder.c: Use camel_mime_message_new
- instead of camel_mime_message_new_with_session.
-
- * camel-session.c (get_store_for_protocol_with_url): Set the
- exception if no provider is found.
-
- * camel-url.c: Add code to encode and decode %-escapes in URLs,
- and do some additional correctness-checking on URL syntax. From
- Tiago Anto with modifications by me.
-
-2000-04-14 Chris Toshok <toshok@helixcode.com>
-
- * providers/Makefile.am (SUBDIRS): add nntp
-
-2000-04-14 Christopher James Lahey <clahey@helixcode.com>
-
- * providers/mbox/camel-mbox-folder.c: Fix switch statement.
-
-2000-04-14 Chris Toshok <toshok@helixcode.com>
-
- * providers/nntp/camel-nntp-folder.c (_exists): always return TRUE
- for now. we need to check the server response to make sure the
- group exists.
- (_get_message_by_uid): make sure to account for the \n we add to
- the string after every line.
-
- * providers/nntp/camel-nntp-utils.c (get_XOVER_headers): function
- to get the headers using the XOVER command.
- (get_HEAD_headers): function to get the headers using the HEAD
- command on each message. slooooooow.
- (camel_nntp_get_headers): make this function use either XOVER or HEAD
- versions depending on whether or not the server extension is present.
-
-2000-04-14 Dan Winship <danw@helixcode.com>
-
- * camel-formatter.[ch]: This didn't belong in Camel. Move to mail/
-
- * Makefile.am, camel-types.h: remove references to
- camel-formatter.
-
-2000-04-12 Matt Loper <matt@helixcode.com>
-
- * camel-folder-pt-proxy.c (_folder_open_cb): Print warning message
- for broken function.
- (_folder_close_cb): Same.
-
-2000-04-12 Miguel de Icaza <miguel@gnu.org>
-
- * Makefile.am (pthread_SRC): Use correct names for the pthread
- source variables.
-
-2000-04-10 Dan Winship <danw@helixcode.com>
-
- * providers/pop3/camel-pop3-store.c (pop3_connect): fix various
- bugs in APOP code (still untested) and some of the error cases.
-
- * camel-provider.h: Clarify what provider.protocol, provider.name,
- and provider.description should be.
-
- * providers/mbox/camel-mbox-provider.c:
- * providers/pop3/camel-pop3-provider.c:
- * providers/sendmail/camel-sendmail-provider.c:
- * providers/smtp/camel-smtp-provider.c: update protocols, names,
- and descriptions
-
- * providers/mbox/camel-mbox-folder.c (_get_message_by_number):
- implement get_message_by_number for the mail fetch code.
-
-2000-04-09 Jeffrey Stedfast <fejj@stampede.org>
-
- * providers/smtp/camel-smtp-transport.c: reformatted to fit
- the standard indent format used by helix code
-
-2000-04-09 Dan Winship <danw@helixcode.com>
-
- * camel-movemail.c: New file with new function to dot-lock an mbox
- file and copy it to a safe private directory.
-
-2000-04-08 Christopher James Lahey <clahey@helixcode.com>
-
- * providers/smtp/.cvsignore: Added a .cvsignore file.
-
-2000-04-08 Dan Winship <danw@helixcode.com>
-
- * providers/sendmail/camel-sendmail-transport.c (_send_internal):
- actually record the pid returned by fork(). Noticed by clahey.
-
- * providers/smtp/camel-smtp-transport.c: #include <sys/param.h>
- for MAXHOSTNAMELEN. (This is a stopgap: some of the uses of
- MAXHOSTNAMELEN are wrong anyway...)
-
-2000-04-07 Jeffrey Stedfast <fejj@stampede.org>
-
- * providers/smtp/camel-smtp-transport.c: fixes to numerous bugs;
- should now build fine.
- * providers/Makefile.am: Readded smtp now that smtp builds without
- error.
-
-2000-04-20 NotZed <NotZed@HelixCode.com>
-
- * providers/mbox/camel-mbox-summary.c
- (camel_mbox_summary_next_uid): Public function to get the next
- uid, makes sure its saved to disk too.
-
- * camel-mime-part.c (my_finalize): Fix disposition crap with a
- real disposition.
- (my_set_disposition): Likewise.
- (my_get_disposition): And here.
- (my_write_to_stream): And here, needs more cleanup.
-
- * providers/mbox/camel-mbox-folder.c (_append_message): Assign a
- new uid at this point.
-
- * gmime-content-field.c (gmime_content_field_write_to_stream):
- Make something up if we have an invalid/missing content type
- (i.e. text/plain).
-
-2000-04-19 NotZed <NotZed@HelixCode.com>
-
- * providers/mbox/camel-mbox-folder.c (_delete): Fixed completely
- broken switch() syntax, only compiled because errno is a macro on
- some systems.
- (_list_subfolders): Likewise.
-
-2000-04-18 NotZed <NotZed@HelixCode.com>
-
- * camel-mime-parser.c (folder_scan_init): init stream to null.
-
- * providers/mbox/camel-mbox-summary.c
- (CAMEL_MBOX_SUMMARY_VERSION): Moved to .c file, incremented.
- (index_folder): Changed to have index passed via the summary.
- (decode_string): Do a sanity check on the string size, so we dont
- visit g_malloc()'s friendly abort().
-
- * camel-folder-pt-proxy.c (camel_folder_pt_proxy_class_init):
- Removed reference to set_name.
- (_set_name): Removed.
-
- * providers/mbox/camel-mbox-utils.c
- (parsed_information_to_mbox_summary): Removed. Most of this file
- is about to be binned.
-
- * providers/mbox/camel-mbox-search.c (func_header_contains): Fixes
- for changes to summary interface.
- (struct _searchcontext): Remove pointer to message info, get it
- straight from the mboxsummary.
- (camel_mbox_folder_search_by_expression): New summary interface.
- (camel_mbox_folder_search_by_expression): Uh, the summary is not
- an object anymore (well not yet).
-
- * providers/mbox/camel-mbox-folder.c
- (camel_mbox_folder_class_init): Removed set_name init.
- (_set_name): Removed.
- (_open): Call new summary interface.
- (_close): Use new summary interface.
- (_create): Removed a summary object leak.
- (_get_message_count): New summary interface.
- (_get_uid_list): Use new summary interface. FIXME: this is leaky.
- (_get_message_by_uid): Use the new summary interface, some
- cleanup.
- (_append_message): Totally changed, basically just appends the
- message directly, ignores the summary (for now), the summary will
- fix itself up if it needs to.
- (_check_get_or_maybe_generate_summary_file): Bye bye old code.
- (summary_get_message_info): Implement get_message_info again, for
- folder.
-
- * camel-folder.c (camel_folder_class_init): Removed set_name
- setup.
- (_set_name): Moved contents into _init.
- (_init): Perform the old functions of set_name here.
-
- * camel-folder.h: Removed the set_name internal interface.
-
-2000-04-14 NotZed <NotZed@HelixCode.com>
-
- * providers/mbox/camel-mbox-summary.[ch]: Completely replaced with
- new code.
-
- * Makefile.am (libcamel_la_SOURCES): Removed
- camel-folder-summary.[ch].
-
- * camel-folder.h (struct _CamelFolder): Removed summary.
- (struct _CamelFolder): Changed flags to be 1 bit bitfields.
-
- * camel-folder-summary.[ch]: Class removed entirely.
-
- * camel-folder.c (camel_folder_get_summary): Removed.
- (camel_folder_summary_get_message_info): Moved from
- camel-folder-summary.c
- (camel_folder_summary_get_subfolder_info): Moved from
- camel-folder-summary.c
-
- * camel-mime-parser.c (folder_scan_step): Store the start of
- headers and start of from in the scan state.
- (camel_mime_parser_tell_start_headers): Query the start of the
- headers.
- (camel_mime_parser_tell_start_from): Query the cached start of
- from marker.
-
-2000-04-13 NotZed <NotZed@HelixCode.com>
-
- * gmime-content-field.c (gmime_content_field_free): Removed this
- function. If its too dangerous to use, it shouldn't be here.
- (gmime_content_field_ref): Also ref the embedded content-type.
- (gmime_content_field_unref): Ditto to unref it.
-
- * camel-mime-utils.h: Add a refcount for content-type header.
-
- * camel-mime-utils.c (header_content_type_unref): Implement unref
- for content-type.
- (header_content_type_ref): Implement ref for header content type.
-
-2000-04-12 NotZed <NotZed@HelixCode.com>
-
- * gmime-content-field.h: Changed to use a _header_content_type.
- Added type/subtype back for compatability with clients.
-
- * gmime-content-field.c: Basically a total rewrite, and now just a
- thin wrapper ontop of header_content_type.
- (_free_parameter): Got rid of it.
- (gmime_content_field_new): Use header_content_type_* functions.
- (gmime_content_field_set_parameter): Likewise.
- (_print_parameter): Blow away.
- (gmime_content_field_write_to_stream): Get details from the
- content_type field. Should check if it needs to escape chars in
- the paramter value.
- (gmime_content_field_get_mime_type): Likewise.
- (___debug_print_parameter): Get rid of this rather annoyingly
- named function.
- (gmime_content_field_get_parameter): Simplified function.
- (gmime_content_field_construct_from_string): Fixed this to use a
- real parser.
- (gmime_content_field_is_type): New function to test if a type matches.
- (gmime_content_field_construct_from_string): Track type/subtype
- from subordinate content_type header struct.
-
- * gmime-rfc2047.[ch]: Removed. Unused.
-
- * camel-stream-b64.[ch]: Blown away more duplicated code.
-
- * Makefile.am: Removed camel-stream-b64.[ch], and
- gmime-base64.[ch].
-
- * camel-mime-part.c (my_get_content_object): Replaced
- camel-stream-b64 with camel-stream-filter/camel-mime-filter-basic.
- (my_write_content_to_stream): Replaced camel-stream-b64 with the
- camel-stream-filter with an encoder.
- (my_get_content_object): Also implement quoted-printable decoding.
- (my_write_content_to_stream): Also implement quoted-printable
- encoding.
- (my_get_output_stream): Took out stream-b64 code (nothing's being
- executed yet anyway).
-
- * gmime-base64.[ch]: Blown away. Not used, dont need it.
-
- * camel-mime-utils.h: Added offset for this header. Records where
- it is in the source.
-
- * camel-mime-utils.c (header_raw_append_parse): Add offset
- parameter, to store where the header is stored in the stream.
- (header_raw_append): Added offset param.
- (header_raw_find): Return offset, if a pointer supplied for it.
- (header_raw_replace): Add offset param.
- (header_content_type_new): New function, to create an empty
- content type.
- (header_content_type_set_param): Set a parameter in the
- content-type.
- (header_set_param): Generic header parameter setting function.
- (header_decode_string): Handle NULL input.
-
- * camel-mime-parser.c (camel_mime_parser_headers_raw): New
- function to get access to all the raw headers.
- (folder_scan_header): Keep track of the header start position, and
- store it when saving the header.
-
-2000-04-11 NotZed <NotZed@HelixCode.com>
-
- * camel-mime-utils.c: Moved a bunch of printf's to debug.
-
- * camel-mime-parser.c: Moved a bunch of printf's to debug.
- (folder_scan_header): Detect end of each header line using the
- last scanned char, and not the last scanned position.
-
- * camel-mime-filter-index.[ch]: Indexing filter. Indexes unicode
- sequences into ibex files.
-
-2000-04-09 NotZed <NotZed@HelixCode.com>
-
- * camel-mime-part.c: Dont include gmime-base64.h
-
- * camel-mime-filter-charset.c (complete): Implement the completion
- function.
-
- * camel-mime-parser.c (folder_scan_step): If we get to the end of
- the body data, check any filters for outstanding completion data.
- (camel_mime_parser_scan_from): Set whether we scan for "From "
- headers or not.
-
- * camel-stream-filter.c (do_read): If we get to end of stream on
- the source, then call the filtering completion function to see if
- we have any more data to return.
-
- * camel-mime-filter-basic.c (filter): Implement quoted printable
- encoding and decoding filters.
- (complete): And the complete function as well.
-
- * camel-mime-utils.c (base64_encode_close): Also take an input
- buffer, allow closing of filters.
- (quoted_encode_step): First cut, simple quoted-printable encoder.
- Doesn't handle trailing spaces/tabs on end of line properly yet.
- (quoted_encode_close): Complete a quoted-encoding.
- (is_qpsafe): New type check, for quoted-printable safe characters
- (that do not need encoding). Thats all bits used in the type
- table! Rebuilt the types table.
- (header_content_type_is): Checks a content type against at
- type/subtype match.
- (header_content_type_param): Handle NULL content type pointer.
-
-2000-04-08 NotZed <NotZed@HelixCode.com>
-
- * camel-mime-filter-basic.c (filter): Implement the base64
- encoder. Problem is, there is no way to know when to close it.
- Close/Reset will have to provide the same args as filter, so it can
- flush remaining data *sigh*
-
- * camel-mime-utils.c (base64_encode_step): A rather complex base64
- encoder, fast?
- (base64_step_close): Companion function to finish off the base64
- sequence.
-
- * camel-mime-part.c (my_write_content_to_stream): Changed to use
- camel_stream_write_to_stream().
-
- * camel-stream.[ch] (camel_stream_write_to_stream): From
- camel_stream_b64_write_to_stream(). Fixed some infinite loop
- bugs with error conditions.
-
- * camel-stream-b64.[ch] (camel_stream_b64_write_to_stream): Removed.
- This has nothing to do with stream-b64, so i've moved it to
- CamelStream.
-
- * camel-mime-utils.h: Add a comment about refcounting
- header_content_type struct.
-
- * Makefile.am: Added camel-stream-filter*.[ch].
-
- * camel-stream-filter.[ch]: Class to implement a generic
- (multipass) filter ontop of a stream. Only implements a read-only
- stream.
-
- * camel-mime-parser.c (camel_mime_parser_filter_add): Ref the
- filter we just added.
-
- * Makefile.am: Added camel-mime-filter*.[ch].
-
- * camel-mime-filter-charset.[ch]: A filter to preform character set
- conversion (uses unicode_iconv).
-
- * camel-mime-filter-save.[ch]: A simple filter which will save all
- data directly to a file or file descriptor.
-
- * camel-mime-filter-basic.[ch]: Implements the basic mime filters,
- base64 and quoted-printable decoding (encoding not implemented yet).
-
- * camel-mime-filter.[ch]: A filtering class, which can filter streams
- of data without having to copy them. Simpler than stream classes,
- and can be plugged into a single stream class (when i write it).
-
-2000-04-07 Dan Winship <danw@helixcode.com>
-
- * providers/pop3/camel-pop3-store.c (pop3_connect): Clarify error
- messages.
- (finalize): fix a bug in camel_exception usage
- (pop3_connect): Remember the password after asking for it the
- first time.
-
-2000-04-07 NotZed <NotZed@HelixCode.com>
-
- * Makefile.am: Added camel-mime-parser/camel-mime-utils.
-
- * camel-mime-parser.c: Fast mime parser.
-
- * camel-mime-utils.c: Mime utility functions, and email header
- parsers.
-
-2000-04-07 NotZed <NotZed@HelixCode.com>
-
- * providers/Makefile.am: Removed smtp for now, its a long way from
- building.
- * providers/smtp/Makefile.in: Removed file that shouldn't have been
- checked in.
-
-2000-04-06 Matt Loper <matt@helixcode.com>
-
- * camel-folder-pt-proxy.c (_get_full_name): Remove exception param
- from get_full_name() called, since get_full_name() was changed to
- not have an exception in the last param (see dan's notes below).
- (_get_name): same.
-
-2000-04-06 Dan Winship <danw@helixcode.com>
-
- * camel-store.[ch]: Reorganize the folder-fetching methods and
- implement a folder cache so that multiple requests for the same
- folder will yield the same CamelFolder object (as long as it
- remains active). Includes some code to remove no-longer-active
- folders from the cache, but it doesn't get used since nothing is
- ever unref'ed in Camel right now...
-
- * providers/mbox/camel-mbox-store.c:
- * providers/pop3/camel-pop3-store.c: update for CamelStore
- changes.
-
- * camel-folder.[ch]: Remove the (unused) CamelException argument
- from camel_folder_get_name and camel_folder_get_full_name.
- (camel_folder_set_name): make this go away since changing a
- folder's name after it has been created could result in it
- conflicting with a separately-issued folder.
-
-2000-04-05 Dan Winship <danw@helixcode.com>
-
- * g_url_new really wanted to take a CamelException. So, rename
- Gurl to CamelURL, g_url_* to camel_url_* (with camel_url_new
- taking an exception), and url-util.[ch] to camel-url.[ch]. Also
- force url->port to be numeric and remove camel_service_getport. (I
- was confused before: the URL RFC says the port must be numeric, so
- we don't want to do getportbyname.)
-
-2000-04-01 Dan Winship <danw@helixcode.com>
-
- * providers/mbox/camel-mbox-folder.c
- (_check_get_or_maybe_generate_summary_file): Compare
- mbox_file_size and mbox_modtime to the results of stat()ing the
- mbox file, not the summary file. Duh.
- (_close): Update the summary's mbox_file_size and mbox_modtime
- before writing it to disk.
-
- * providers/mbox/camel-mbox-summary.c (camel_mbox_summary_save,
- camel_mbox_summary_load): Wow. I must have been tired when I wrote
- this code. First, the comparison bug above. Second, it was using
- ntohs and htons instead of ntohl and htonl. Third, I was reading
- the status flag byte in two different places and thus getting out
- of sync. Fourth, it was writing out field_length bytes of each
- header field after having converted field_length to network byte
- order, resulting in lots of random crap being appended, and the
- summary files being huge. (Fortunately, since the size/modtime
- comparison was biffed, the garbage summary read from disk was
- always immediately discarded.)
-
- * providers/mbox/camel-mbox-parser.c (camel_mbox_parse_file): fix
- an off-by-one error that caused the last-used UID to be reused if
- the summary file was regenerated. (That one wasn't my fault. :-)
-
-2000-03-31 Dan Winship <danw@helixcode.com>
-
- * camel-stream-mem.c: implement unimplemented methods
-
- * gmime-content-field.c
- (gmime_content_field_construct_from_string):
- * data-wrapper-repository.c
- (data_wrapper_repository_get_data_wrapper_type):
- * camel-simple-data-wrapper.c (my_write_to_stream):
- * camel-mime-part.c (my_set_input_stream):
- remove debugging printf()s that no longer seem useful.
-
-2000-03-31 Matt Loper <matt@helixcode.com>
-
- * camel-formatter.c (text_to_html): Added "convert_newlines_to_br"
- boolean param, to give the option of not converting '\n's to <br>
- tags. This way, when we stick stuff in a <pre> tag, newlines stay
- newlines.
-
-2000-03-30 Matt Loper <matt@helixcode.com>
-
- * camel-formatter.c (handle_text_plain): Use <pre> tag to force
- the use of monospaced fonts.
-
-2000-03-30 Dan Winship <danw@helixcode.com>
-
- * camel-service.c (camel_service_getport): Add a htons in the
- default_number case, and document the fact that the function
- returns the port in network byte order.
-
- * providers/pop3/camel-pop3-store.c (pop3_connect): Revert
- Miguel's change. The port number bug was actually somewhere
- else, and the IP address copying code was fine already.
-
-2000-03-29 Miguel de Icaza <miguel@gnu.org>
-
- * providers/pop3/camel-pop3-store.c (pop3_connect): Add htons
- (port), and only copy 4 bytes for the IP address to prevent a DNS
- attack.
-
-2000-03-28 Dan Winship <danw@helixcode.com>
-
- * camel-seekable-substream.c
- (camel_seekable_substream_new_with_seekable_stream_and_bounds):
- make this return a CamelStream rather than a
- CamelSeekableSubstream, because that's the way Gtk objects tend to
- work.
-
- * camel-service.c (camel_service_gethost,
- camel_service_getport): convenience functions to canonicalize
- the host and port values of a service's URL.
- * providers/pop3/camel-pop3-store.c: use them
-
- * providers/mbox/camel-mbox-folder.c
- (_check_get_or_maybe_generate_summary_file): Make this work when
- the inbox file doesn't yet exist.
-
-2000-03-27 Dan Winship <danw@helixcode.com>
-
- * providers/mbox/camel-mbox-folder.c (_append_message): uncomment
- the call to unlink the temp file: there's no way to tell
- camel_stream_fs to truncate a file, so reusing the same file was
- resulting in junk at the ends of messages.
-
- * camel-folder.[ch]: add delete_message_by_{number,uid}.
-
- * providers/pop3/camel-pop3-folder.[ch]: implement
- delete_message_by_uid. Add a close method to do expunging
- of deleted messages if requested.
-
- * providers/pop3/camel-pop3-store.[ch]: support for
- CamelPop3Folder::close. (You have to close the connection
- in order to expunge the folder, thus the store may be
- connected in the CamelService::is_connected sense when it
- is not actually connected to the server.) Also some bugfixes.
-
-2000-03-27 NotZed <NotZed@HelixCode.com>
-
- * providers/mbox/camel-mbox-folder.c (_append_message): Unref the
- output_stream when done, close doesn't do it.
- (_append_message): Clear all uid's from the appending messages, so
- they are reassigned proper unique id's.
-
- * gmime-utils.c (get_header_array_from_stream): Actually free the
- header, it is copied elsewhere.
-
-2000-03-26 NotZed <NotZed@HelixCode.com>
-
- * providers/mbox/camel-mbox-utils.c (camel_mbox_write_xev): Added
- folder parameter to function. Fixed callers.
- (index_message): Index a message as it is assigned a unique id.
-
- * camel-mime-part.c (my_set_content_id): Make sure we malloc and
- copy the content_id, otherwise *poof*
-
-2000-03-25 NotZed <NotZed@HelixCode.com>
-
- * camel-medium.c (_finalize): Another leak, unref the content if
- finished with it.
-
- * camel-recipient.c (camel_recipient_table_free): Plug another
- memory leak - actually free the recipient table.
-
- * camel-mime-message.c (_finalize): Plugged a memory leak with the
- flags table.
-
- * gmime-utils.c (_store_header_pair_from_string): A simpler, more
- debuggable and functionally identical header extraction function.
-
-2000-03-24 NotZed <NotZed@HelixCode.com>
-
- * gmime-content-field.c (gmime_content_field_set_parameter):
- Remove the hash table entry before freeing its key and data.
-
-2000-03-27 Dan Winship <danw@helixcode.com>
-
- * providers/Makefile.am (SUBDIRS): Add pop3.
-
- * providers/pop3/camel-pop3-store.c: keep separate input and
- output streams so the output doesn't end up being buffered.
-
- * providers/pop3/camel-pop3-folder.c (get_message_by_number):
- finish implementing this.
-
-2000-03-27 Michael Meeks <michael@helixcode.com>
-
- * camel-mime-part.c (my_set_disposition): fix so less broken.
- (my_finalize): remove dodgy disposition free.
-
- * camel-data-wrapper.c (my_set_mime_type_field): unref instead of
- free on mime_type.
-
-2000-03-27 Dan Winship <danw@helixcode.com>
-
- * camel-service.c (camel_service_free_auth_types): new routine to
- free the data allocated by camel_service_query_auth_types.
-
- * providers/pop3/camel-pop3-store.c (free_auth_types): implement
-
- * camel-stream-mem.c (camel_stream_mem_new_with_buffer): rename
- camel_stream_mem_new_with_buffer to ..._with_byte_array and add a
- new ..._with_buffer that takes a char * rather than a GByteArray.
-
- * Remove CamelStreamBufferedFs, since CamelStreamBuffer makes it
- redundant.
-
-2000-03-25 Dan Winship <danw@helixcode.com>
-
- * camel-folder-summary.[ch]: change the CamelFolderSummary
- interfaces to allow partial summary queries (for dealing
- with very large folders). Remove the "extended_fields" from
- CamelFolderInfo and CamelMessageInfo: this is better dealt
- with by subtyping.
-
- * providers/mbox/camel-mbox-summary.[ch]: Make CamelMboxSummary a
- subclass of CamelFolderSummary. Update interfaces for that. Remove
- the internal/external summary distinction. Remove the (unused) md5
- checksum in the folder summary. Change the summary file format
- (primarily to make it no longer byte-order dependent) and add a
- version number to it so it will be easier to change in the future.
-
- * providers/mbox/camel-mbox-folder.[ch]
- * providers/mbox/camel-mbox-search.c
- * providers/mbox/camel-mbox-utils.c: update for summary changes
-
- * camel-exception-list.def: add
- CAMEL_EXCEPTION_FOLDER_SUMMARY_INVALID
-
-2000-03-23 NotZed <NotZed@HelixCode.com>
-
- * providers/mbox/camel-mbox-provider.c: Added flag to provider
- initialisation, to match changed structure.
-
-2000-03-22 NotZed <NotZed@HelixCode.com>
-
- * camel-folder.[ch]: Added async search api.
-
- * providers/mbox/camel-mbox-search.c
- (camel_mbox_folder_search_by_expression): Changed to use an
- asynchronous interface.
- (camel_mbox_folder_search_cancel): Cancel function for async
- interface.
-
-2000-03-23 Dan Winship <danw@helixcode.com>
-
- * camel-stream-buffer.c (camel_stream_buffer_read_line): Function
- to read one line of any size from a stream and return it in
- allocated memory.
-
-2000-03-22 Dan Winship <danw@helixcode.com>
-
- * camel-service.c (camel_service_query_auth_types): New function
- to query a service for the authentication protocols it supports.
- * providers/pop3/camel-pop3-store.c (query_auth_types): implement
-
- * camel-provider.c (camel_provider_scan): New function to
- scan the provider dir and return a list of all providers.
-
- * providers/pop3/camel-pop3-folder.c: fill this in partially
- * providers/pop3/camel-pop3-store.c: make camel_pop3_command
- return the text after "+OK"/"-ERR" and add a separate
- camel_pop3_get_additional_data to get the message body or
- whatever. Also make them take a CamelPop3Store rather than
- a CamelStreamBuffer.
-
-2000-03-22 Matt Loper <matt@helixcode.com>
-
- * camel-formatter.c (debug): Disabled some useless debug
- messaging.
-
-2000-03-21 Dan Winship <danw@helixcode.com>
-
- * providers/pop3: some initial bits of the POP3 provider, to
- make Matt happy. Incomplete, untested, etc.
-
-2000-03-21 bertrand <bertrand@helixcode.com>
-
- * providers/mbox/camel-mbox-summary.c
- (camel_mbox_summary_append_internal_to_external): copy the size field
-
- * providers/mbox/camel-mbox-folder.c (_get_message_by_uid): initialize
- message_info to NULL
-
- * camel-folder-summary.h: added the size field.
-
- * providers/mbox/camel-mbox-summary.h:
- added the received_date field.
-
- * providers/mbox/camel-mbox-summary.c:
- documented all functions.
-
- * camel-folder-summary.h: name change and
- new fields.
-
- * providers/mbox/camel-mbox-search.c: update to
- conform to name change in the summary fields.
-
-2000-03-10 bertrand <bertrand@helixcode.com>
-
- * camel-service.h: cosmetic changes.
-
-2000-03-09 Dan Winship <danw@helixcode.com>
-
- * s/HelixCode/Helix Code, Inc./ in the copyrights
-
-2000-03-07 bertrand <bertrand@helixcode.com>
-
- * camel-formatter.c (handle_mime_part):
- plug mem leaks due to bad documentation
- of camel_content_field_get_mime_type
- (print_camel_body_part): idem
- (handle_multipart_alternative): idem
-
- * gmime-content-field.c (gmime_content_field_get_mime_type):
- documentation fix.
-
-
- * camel-mime-part.c (my_finalize): unref the
- content_input_stream if any.
-
-2000-03-06 bertrand <bertrand@helixcode.com>
-
- * camel-stream-fs.c (_seek): fix a bogus calculation
- in the return position.
-
-2000-03-05 bertrand <bertrand@helixcode.com>
-
- * camel-session.h: cosmetic fixes.
-
- * camel-stream-fs.c (_read):
- (_seek): fixed the current position so that it refers
- to the current position in the stream, not in its parent.
-
-2000-03-04 NotZed <NotZed@HelixCode.com>
-
- * providers/mbox/camel-mbox-search.c
- (camel_mbox_folder_search_by_expression): Ref the summary
- after we have got it.
-
-2000-03-04 bertrand <bertrand@helixcode.com>
-
- * camel-mime-part.c (my_write_content_to_stream):
- stream the raw content instead of nothing if the encoding
- is not supported.
-
- * camel-stream-fs.c (_seek): handle eos more
- properly.
-
- * camel-formatter.c (get_bonobo_tag_for_object):
- bonobo-goad-id is the good key to look for.
- (get_bonobo_tag_for_object): close the <object> tag.
- (get_bonobo_tag_for_object): the correct syntax for the
- to set a parameter inside an <object> tag is :
- <object classid="..."> <param name="uid" value="..."> <param ...>
- </object>
-
-2000-03-03 bertrand <bertrand@helixcode.com>
-
- * providers/mbox/camel-mbox-folder.c (_get_message_by_uid):
- use set_input_stream instead of construct_from_stream
- to feed the message object.
-
- * camel-data-wrapper.c (my_write_to_stream): reset output stream.
- (my_set_input_stream): unref the previous input stream.
- use the set_output_stream for default behaviour.
- (my_set_output_stream): unref previous output stream.
-
- * camel-mime-part.c (my_write_content_to_stream): reset content
- object output stream.
-
-2000-03-03 NotZed <NotZed@HelixCode.com>
-
- * providers/mbox/camel-mbox-utils.c (camel_mbox_write_xev): Make
- sure we open with create with a creation mask.
-
-2000-03-01 NotZed <NotZed@HelixCode.com>
-
- * camel-mime-part-utils.c
- (camel_mime_part_construct_content_from_stream): DO NOT assert on
- content type, we have fallback code 4 lines below it ... *sigh*
-
-2000-02-29 NotZed <NotZed@HelixCode.com>
-
- * Makefile.am (libcamelinclude_HEADERS): Added camel-stream-buffer
- to build.
-
- * camel-stream-buffer.[ch]: Generic buffer which can be applied to
- any stream.
-
-2000-03-03 bertrand <bertrand@helixcode.com>
-
- * camel-formatter.c (handle_image): in the case
- of images, put the content object output stream
- in the url. This allows the message browser
- to show inline images.
-
- * camel-stream-b64.c (my_read_encode): fixed state
- 0 keep value.
-
-2000-03-02 bertrand <bertrand@helixcode.com>
-
- * camel-stream-b64.c (my_read_encode): don't forget to
- set the state to 0 after 3.
- (my_read_encode): don't forget to encode, even in state 3.
-
- * camel-simple-data-wrapper.c: static functions are prefixed
- with my_ instead of _
- * camel-multipart.c: static functions are prefixed
- with my_ instead of _
- (my_write_to_stream): commented.
- (my_write_to_stream): warning in case the boudary is set
- but is a zero length string.
-
- * camel-mime-part.c (camel_mime_part_encoding_from_string):
- remove debug trace.
-
- * camel-mime-part.c: Replaced all static functions
- with name begining with _ by the same name begining
- with "my_" to prevent the possible conflicts
- with system symbols Dan warned us about.
-
- * camel-stream-b64.c (camel_stream_b64_write_to_stream):
- use CamelStreamB64 type for the input stream.
-
- * camel-mime-part.c (_get_content_object): remove
- debugging trace
- (_write_content_to_stream): implement the b64
- encoding the new way (that is using camel_stream_b64)
-
- * camel-data-wrapper.c (my_write_to_stream):
- fix implementation so that it writes properly
- to the output stream even.
-
- * camel-stream-b64.c (camel_stream_b64_write_to_stream):
- fix implementation.
-
-2000-02-29 bertrand <bertrand@helixcode.com>
-
- * camel-stream-b64.c (camel_stream_b64_write_to_stream): new
- utility function.
-
- * camel-data-wrapper.c (_write_to_stream): default
- implementation.
-
- * gmime-utils.c (_store_header_pair_from_string):
- revert strange changes.
-
- * camel-stream-b64.c (my_read_decode): set eos to true when we
- have read the whole input stream.
- (my_reset): set eos to FALSE.
-
-2000-02-28 NotZed <NotZed@HelixCode.com>
-
- * camel-mime-part.c (_parse_header_pair): Dont free this either.
-
- * camel-medium.c (_remove_header): Ugh, dont free the header
- before we actually remove it.
- (_add_header): Ugh, dont free hashtable entries which may be
- duplicated (hash_insert _will_ reference that memory).
-
- * string-utils.c (string_trim): Trimming a 0-length string is not
- an error.
-
- * camel-mime-message.c (_parse_header_pair): Fixed very broken
- memory handling of header_name/value.
-
- * providers/mbox/camel-mbox-utils.c (camel_mbox_write_xev):
- Initialise end_of_last_message always.
- (camel_mbox_copy_file_chunk): Stop trying to read if we run out of
- data, rather than looping forever.
- (camel_mbox_write_xev): Use an open flag when opening with create.
-
- * camel-folder.c (camel_folder_search_by_expression): No, its not
- a fatal error to search on a non-searchable folder, you just dont
- get any matches.
- (_open): Dont open an opened folder (i dont see why this is really
- a bug, but what the hell ...)
-
- * providers/mbox/camel-mbox-folder.c (_init): Set search cap on.
- (_open): Call parent class to perform open. Remove folder-open
- check to parent instead.
- (_create): open takes a creation mask, dont use umask to try and
- set the open mode.
- (_delete): Dont bother checking folder==NULL, its already been
- checked on the external interface (changed to an assertion, this
- would have to be a camel bug).
- (_delete_messages): Likewise.
- (_create): Ditto.
- (_init): Dont go and clear all the paths and shit that the parent
- open just setup for us.
- (_delete_messages): Get rid of more umask stuff.
- (_append_message): Make sure we pass file mode to open with create.
- (_append_message): Cleaned up some indenting to make it readable.
-
- * camel-stream-b64.c (my_read_encode): Fixed a typo.
-
- * providers/mbox/camel-mbox-search.c: Changed to use e-sexp,
- rather than filter-sexp.
-
-2000-02-28 bertrand <bertrand@helixcode.com>
-
- * camel-stream-b64.c (my_read_encode): encoding
- filter.
-
-2000-02-23 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel-stream-b64.c: changed the __static
- suffix into a my_ prefix.
- (camel_stream_b64_set_mode): reset the persistent
- status.
- (my_read_decode): remove superfluous %
-
- * providers/mbox/camel-mbox-utils.c (camel_mbox_copy_file_chunk):
- fix exception description message.
-
-2000-02-24 Dan Winship <danw@helixcode.com>
-
- * camel-session.c: Add camel_session_get_transport_for_protocol.
-
- * camel-transport.h:
- * camel-transport.c: Add an abstract CamelTransport class.
-
- * providers/sendmail/*: A CamelTransport that uses sendmail
- to deliver mail.
-
-2000-02-24 Dan Winship <danw@helixcode.com>
-
- * camel-folder.c: use CamelExceptions for run-time errors, not
- incorrect code. Don't bother validating that an object exists from
- inside one of its methods, since you couldn't have gotten there if
- it didn't. Fix some code style bugs.
-
- (_init): Rename init_with_store to init and add parent_folder,
- separator, and name arguments.
- (_set_name): Get separator from self, not parent_store now.
-
- * camel-store.h:
- * camel-store.c: Remove get/set_separator.
-
- * providers/mbox/: Update for above.
-
-2000-02-23 Dan Winship <danw@helixcode.com>
-
- * camel-medium.c (_finalize): Free the data in the headers hash
- table.
- (_add_header): g_strdup the header name and value when adding it.
-
- * camel-mime-part-utils.c
- (camel_mime_part_construct_headers_from_stream): Free the header
- data after calling camel_medium_add_header, since it will have
- g_strdup()ed it itself.
-
-2000-02-22 NotZed <NotZed@HelixCode.com>
-
- * providers/mbox/camel-mbox-search.c: Dont compile by default.
-
- * providers/mbox/Makefile.am: Fuck off the filter code.
-
-2000-02-22 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel-stream-b64.c (read_decode__static):
- don't read the char if we reached the length
- of the output buffer. Hours lost on this
- %$!@# bug : 3.5
-
- * camel-folder.c (camel_folder_get_subfolder):
- (camel_folder_create):
- (camel_folder_delete):
- (camel_folder_delete_messages):
- (camel_folder_list_subfolders):
- (camel_folder_expunge):
- (camel_folder_get_message_by_number):
- (camel_folder_get_message_count):
- (camel_folder_append_message):
- (camel_folder_copy_message_to):
- (camel_folder_get_summary):
- (camel_folder_get_message_uid):
- (camel_folder_get_message_by_uid):
- (camel_folder_get_uid_list):
- Check folder state (open/close) and raise an
- exception if it is not ok.
-
- * providers/mbox/camel-mbox-folder.c (_create):
- create the file and the path with two different
- names.
-
- * camel-folder.c (_create): handle the case
- when the folder name starts with '/'
-
- * camel-exception.c (camel_exception_new): use
- (void) instead of () in decl.
-
- * camel-exception.h: cosmetic fixes.
-
- * camel-exception.c (camel_exception_init): new routine.
- Fix a bug in mail/message-list.c
-
-
- * camel-folder.h: cosmetic changes.
-
- * camel-stream-b64.c (reset__static): added a
- reset method. Thanks message-browser to find
- so much bugs :)
-
- * providers/mbox/Makefile.am (libcamelmbox_la_LIBADD): readd
- Unicode libs.
-
-2000-02-21 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel-formatter.c (lookup_unique_id):
- awful hack to test get_output_stream.
- * camel-stream-b64.[ch] :
- b64 encoding/decoding is now implemented as
- a stream.
-
-2000-02-21 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel-seekable-substream.c (_reemit_parent_signal):
- emit "data_available" when parent stream emits it.
-
-2000-02-21 NotZed <NotZed@HelixCode.com>
-
- * providers/mbox/Makefile.am: Uh, fixed LIBADD again. What was
- there was never ever going to work, wasn't it tested?
-
-2000-02-21 Dan Winship <danw@helixcode.com>
-
- * camel-session.h: (struct _CamelSession): Add authenticator.
-
- * camel-session.c (camel_session_new): Add authenticator.
- (camel_session_query_authenticator): New function to query the
- session authenticator for password, etc, information.
-
-2000-02-21 Dan Winship <danw@helixcode.com>
-
- * camel-session.c: add CamelExceptions to several functions. Use
- camel_session_new to initialize the session and URL fields of
- created CamelStores as appropriate.
-
- * camel-store.h:
- * camel-store.c
- * camel-service.h:
- * camel-service.c: Move the session and url (and associated
- functions) from CamelStore to CamelService. Add url_flags to
- CamelService so subclasses can specify which URL components
- are mandatory for them. Add camel_session_new for
- camel_session_get_store* to use.
-
- * providers/mbox/camel-mbox-folder.c:
- * providers/mbox/camel-mbox-store.c:
- * providers/mbox/camel-mbox-store.h: Update for above changes.
-
- * camel-exception-list.def: Once camel is being used for real,
- exceptions won't be renumberable. So renumber them now to make
- more room to add exceptions to the various categories later, and
- add a big warning message.
-
-2000-02-20 Dan Winship <danw@helixcode.com>
-
- * providers/mbox/Makefile.am: add libibex back to
- libcamelmbox_la_LIBADD
-
-2000-02-18 NotZed <NotZed@HelixCode.com>
-
- * providers/mbox/camel-mbox-search.h
- (camel_mbox_folder_search_by_expression): Added exception to call,
- and fixed caller.
-
- * providers/mbox/camel-mbox-search.c
- (camel_mbox_folder_search_by_expression): Major changes, to use
- the sexp evaluator from filter/filter-sexp.c to implement the
- searching.
- (func_body_contains): Changed to support multiple strings in 1
- command (results or'd together)
-
- * url-util.c (g_url_new): Fixed a typo (colon == 0 isn't right),
- and made it so full url's are absolute pathed (Dan, this is how it
- has to work!). Also, always include a path part, even if it is an
- empty string.
-
-2000-02-18 Dan Winship <danw@helixcode.com>
-
- * camel/camel-types.h: New header with the typedefs for all camel
- classes. Now the class headers can just include this and the
- header for the parent type. This makes it possible for
- CamelService to include a CamelSession without creating an
- #include loop.
-
- * camel/*:
- * composer/e-msg-composer-attachment-bar.h:
- * mail/folder-browser.c:
- * mail/message-list.c: frob #includes to match the new reality
-
-2000-02-17 Dan Winship <danw@helixcode.com>
-
- * camel/camel-service.h:
- * camel/camel-service.c: Make camel-service us a Gurl internally.
- Remove the login/password interfaces and instead provide
- camel_service_connect_with_url. Add CamelExceptions
-
-2000-02-17 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-formatter.c (handle_text_plain):
- (handle_text_html): use camel_stream_reset instead
- of seek. The formatter should be able to work
- with all streams, not only seekable streams.
- In the case where some provider implementation
- would not be able to provide a reset method
- to their stream, implementors would have
- to find a workaround.
-
- * camel/camel-session.c (camel_session_new): use
- (void) instean of () in function decl.
-
- * camel/camel-folder.c: ifdef async operation
- related code.
-
- * camel/camel-seekable-stream.c (_seek): added a warning.
- (_reset): default implementation of reset for seekable
- stream.
-
- * camel/camel-mime-message.h: set_received_date declaration fix.
- cosmetic changes.
-
- * camel/providers/mbox/camel-mbox-provider.c (camel_provider_module_init):
- use (void) instead of ().
-
- * camel/camel-stream.c (camel_stream_reset):
- new method for CamelStream.
-
-2000-02-17 Dan Winship <danw@helixcode.com>
-
- * camel/url-util.c (g_url_to_string): New function to convert
- a Gurl back into a char *.
-
-2000-02-17 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-formatter.c (handle_text_plain):
- revamped so that it uses the output stream
- of the data wrapper
- (handle_text_html): ditto.
-
-
- * camel/camel-simple-data-wrapper.h:
- * camel/camel-simple-data-wrapper.c (camel_simple_data_wrapper_new):
- use (void) instead of ().
- (_get_output_stream): simple implementation.
-
-2000-02-16 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-data-wrapper.c (_set_input_stream): ref input stream
- (_set_output_stream): ref output stream
- (_finalize): unref input and output streams
-
- * camel/camel-seekable-substream.c (_set_bounds): don't
- seek the begining of the substream.
- (_eos): fix eos condition testing.
- (_finalize): unref parent stream
- (_init_with_seekable_stream_and_bounds): ref parent stream
-
- * camel/gstring-util.c (g_string_equal_for_hash):
- (g_string_equal_for_glist): return type is int.
-
- * camel/camel.h:
- * camel/camel.c (camel_init): use (void)
- instead of ().
-
-2000-02-16 NotZed <NotZed@HelixCode.com>
-
- * providers/mbox/Makefile.am (libcamelmbox_la_LIBADD): Added
- libfilter to link line (temporarily?). Required for
- filter-sexp.
-
-2000-02-15 bertrand <bertrand@helixcode.com>
-
- * camel/camel-multipart.c (_localize_part):
- this routine replaces the _read_part routine
- and does not store the part in a buffer.
- (_set_input_stream): use the set_input_stream
- instead of the construct_from_stream.
- each bodypart is given an input stream.
-
- * camel/camel-mime-part-utils.c:
- include the data-wrapper-repository header.
- (camel_mime_part_construct_content_from_stream):
- use the set_input_stream instead of the
- construct_from_stream method.
-
- * camel/camel-seekable-substream.c (_set_bounds):
- cur position is set to 0 not to inf_bound.
-
-2000-02-15 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-mime-part.c: include gmime-base64.h
- various compilation and runtime fixes.
- (_set_input_stream): store the input substream
- for the content object.
-
- * camel/camel-data-wrapper.h: declare the
- set/get function on input/output stream.
-
- * camel/camel-mime-part.c (_get_content_object):
- don't use a temporary mem stream.
-
- * camel/camel-seekable-substream.c (_seek):
- (_eos):
- (_read): the substream can be unlimited in length
-
- * camel/camel-data-wrapper.c (camel_data_wrapper_class_init):
- set the get/set_input/output_stream methods.
-
- * camel/camel-multipart.c (_construct_from_stream):
- camel_stream_seek -> camel_seekable_stream_seek
-
-2000-02-14 Miguel de Icaza <miguel@gnu.org>
-
- * camel/providers/mbox/Makefile.am (libcamelmbox_la_LIBADD): Add
- the unicode libraries as well.
-
- * camel/camel-provider.c (camel_provider_register_as_module): Add
- error reporting here. Desire to use Solaris increases. Hair loss
- in the last two hours: 5,400.
-
- * camel/providers/mbox/camel-mbox-provider.c
- (camel_mbox_get_provider): Renamed function.
-
- * camel/camel.h: All include files use camel/ now here.
-
- * camel/providers/mbox/Makefile.am: Drop all the dynamism from
- Camel, and make this a standard library.
-
-2000-02-14 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/gmime-utils.c (get_header_array_from_stream): use the
- eos stream method.
- (gmime_read_line_from_stream): ditto.
-
- * camel/camel-stream-fs.h (struct ): add the eof field
- cosmetics changes.
-
- * camel/camel-stream-fs.c (camel_stream_fs_init): set eof.
- (_read): set eof on end of file.
- (_eos): implemented.
-
- * camel/gmime-utils.c (get_header_array_from_stream):
- make a blocking version of the header parser.
- When the fs stream uses gnome-vfs, this should
- be changed.
- (gmime_read_line_from_stream): ditto.
-
-2000-02-11 bertrand <Bertrand.Guiheneuf@aful.org>
-
- * camel/camel-stream-fs.c:
- everywhere, when using the cur_pos field, do it
- on the CamelSeekableStream object.
- (_seek): small fix.
-
- * camel/camel-seekable-stream.c (camel_seekable_stream_seek):
- s/camel_stream_seek/camel_seekable_stream_seek/g
-
- * camel/camel-seekable-stream.h:
- (struct ): added a field to store the
- current position.
-
- * camel/camel-seekable-stream.c (camel_seekable_stream_get_current_position):
- New function. Allows to get the current position
- of a seekable stream.
-
-
-2000-02-13 NotZed <notzed@zedzone.helixcode.com>
-
- * providers/mbox/camel-mbox-search.c: New file, implements the
- search api for mbox folders.
-
- * providers/mbox/Makefile.am: Link with ibex.
-
- * camel-folder.c (camel_folder_has_search_capability): Api
- additions.
- (camel_folder_search_by_expression): Ditto.
-
-2000-02-12 NotZed <notzed@zedzone.helixcode.com>
-
- * providers/mbox/camel-mbox-folder.c (_set_name): Setup index
- filename as well.
- (_init_with_store): Init index filename. Hmm, none of these
- names ever seem to get free'd (FIXME?)
-
- * providers/mbox/camel-mbox-folder.h: Add index file name.
-
-2000-02-12 NotZed <notzed@helixcode.com>
-
- * camel-folder.h: Add folder search functions.
-
- ** Created ChangeLog just for camel **
- - refer to ../ChangeLog for changes prior to this date.
diff --git a/camel/Makefile.am b/camel/Makefile.am
deleted file mode 100644
index 3924e0cd80..0000000000
--- a/camel/Makefile.am
+++ /dev/null
@@ -1,296 +0,0 @@
-## Process this file with automake to produce Makefile.in
-
-SUBDIRS = . providers tests
-
-libcamelincludedir = $(privincludedir)/camel
-
-camellibexecdir = $(privlibexecdir)/camel
-camellibexec_PROGRAMS = camel-lock-helper camel-index-control
-
-privlib_LTLIBRARIES = libcamel.la
-
-INCLUDES = -I.. -I$(srcdir)/.. \
- -I$(top_srcdir)/intl \
- -I$(top_srcdir)/e-util \
- -DCAMEL_LIBEXECDIR=\""$(camellibexecdir)"\" \
- -DCAMEL_PROVIDERDIR=\""$(camel_providerdir)"\" \
- -DG_LOG_DOMAIN=\"camel\" \
- $(CAMEL_CFLAGS)
-
-if ENABLE_SMIME
-SMIME_SOURCES_C = camel-smime-context.c
-SMIME_SOURCES_H = camel-smime-context.h
-else
-SMIME_SOURCES_C =
-SMIME_SOURCES_H =
-endif
-
-libcamel_la_SOURCES = \
- broken-date-parser.c \
- camel-address.c \
- camel-arg.c \
- camel-block-file.c \
- camel-certdb.c \
- camel-charset-map.c \
- camel-cipher-context.c \
- camel-data-cache.c \
- camel-data-wrapper.c \
- camel-digest-folder.c \
- camel-digest-store.c \
- camel-digest-summary.c \
- camel-disco-diary.c \
- camel-disco-folder.c \
- camel-disco-store.c \
- camel-exception.c \
- camel-file-utils.c \
- camel-filter-driver.c \
- camel-filter-search.c \
- camel-folder-search.c \
- camel-folder-summary.c \
- camel-folder-thread.c \
- camel-folder.c \
- camel-gpg-context.c \
- camel-html-parser.c \
- camel-http-stream.c \
- camel-index.c \
- camel-internet-address.c \
- camel-junk-plugin.c \
- camel-lock.c \
- camel-lock-client.c \
- camel-medium.c \
- camel-mime-filter-bestenc.c \
- camel-mime-filter-basic.c \
- camel-mime-filter-charset.c \
- camel-mime-filter-canon.c \
- camel-mime-filter-crlf.c \
- camel-mime-filter-enriched.c \
- camel-mime-filter-from.c \
- camel-mime-filter-html.c \
- camel-mime-filter-tohtml.c \
- camel-mime-filter-index.c \
- camel-mime-filter-linewrap.c \
- camel-mime-filter-save.c \
- camel-mime-filter-windows.c \
- camel-mime-filter.c \
- camel-mime-message.c \
- camel-mime-parser.c \
- camel-mime-part-utils.c \
- camel-mime-part.c \
- camel-mime-utils.c \
- camel-movemail.c \
- camel-multipart.c \
- camel-multipart-encrypted.c \
- camel-multipart-signed.c \
- camel-object.c \
- camel-operation.c \
- camel-partition-table.c \
- camel-provider.c \
- camel-sasl.c \
- camel-sasl-anonymous.c \
- camel-sasl-cram-md5.c \
- camel-sasl-digest-md5.c \
- camel-sasl-gssapi.c \
- camel-sasl-kerberos4.c \
- camel-sasl-login.c \
- camel-sasl-ntlm.c \
- camel-sasl-plain.c \
- camel-sasl-popb4smtp.c \
- camel-search-private.c \
- camel-seekable-stream.c \
- camel-seekable-substream.c \
- camel-service.c \
- camel-session.c \
- $(SMIME_SOURCES_C) \
- camel-store.c \
- camel-store-summary.c \
- camel-stream-buffer.c \
- camel-stream-filter.c \
- camel-stream-fs.c \
- camel-stream-mem.c \
- camel-stream-null.c \
- camel-stream-process.c \
- camel-stream.c \
- camel-string-utils.c \
- camel-text-index.c \
- camel-tcp-stream-raw.c \
- camel-tcp-stream-ssl.c \
- camel-tcp-stream-openssl.c \
- camel-tcp-stream.c \
- camel-transport.c \
- camel-uid-cache.c \
- camel-url.c \
- camel-url-scanner.c \
- camel-utf8.c \
- camel-vee-folder.c \
- camel-vee-store.c \
- camel-vtrash-folder.c \
- camel.c
-
-libcamelinclude_HEADERS = \
- broken-date-parser.h \
- camel-address.h \
- camel-arg.h \
- camel-block-file.h \
- camel-certdb.h \
- camel-charset-map.h \
- camel-cipher-context.h \
- camel-data-cache.h \
- camel-data-wrapper.h \
- camel-digest-folder.h \
- camel-digest-store.h \
- camel-digest-summary.h \
- camel-disco-diary.h \
- camel-disco-folder.h \
- camel-disco-store.h \
- camel-exception-list.def \
- camel-exception.h \
- camel-file-utils.h \
- camel-filter-driver.h \
- camel-filter-search.h \
- camel-folder-search.h \
- camel-folder-summary.h \
- camel-folder-thread.h \
- camel-folder.h \
- camel-gpg-context.h \
- camel-http-stream.h \
- camel-index.h \
- camel-internet-address.h \
- camel-i18n.h \
- camel-junk-plugin.h \
- camel-lock.h \
- camel-lock-client.h \
- camel-medium.h \
- camel-mime-filter-bestenc.h \
- camel-mime-filter-basic.h \
- camel-mime-filter-charset.h \
- camel-mime-filter-canon.h \
- camel-mime-filter-crlf.h \
- camel-mime-filter-enriched.h \
- camel-mime-filter-from.h \
- camel-mime-filter-html.h \
- camel-mime-filter-tohtml.h \
- camel-mime-filter-index.h \
- camel-mime-filter-linewrap.h \
- camel-mime-filter-save.h \
- camel-mime-filter-windows.h \
- camel-mime-filter.h \
- camel-mime-message.h \
- camel-mime-parser.h \
- camel-mime-part-utils.h \
- camel-mime-part.h \
- camel-mime-utils.h \
- camel-movemail.h \
- camel-multipart.h \
- camel-multipart-encrypted.h \
- camel-multipart-signed.h \
- camel-object.h \
- camel-operation.h \
- camel-partition-table.h \
- camel-provider.h \
- camel-sasl.h \
- camel-sasl-anonymous.h \
- camel-sasl-cram-md5.h \
- camel-sasl-digest-md5.h \
- camel-sasl-gssapi.h \
- camel-sasl-kerberos4.h \
- camel-sasl-login.h \
- camel-sasl-ntlm.h \
- camel-sasl-plain.h \
- camel-sasl-popb4smtp.h \
- camel-seekable-stream.h \
- camel-seekable-substream.h \
- camel-service.h \
- camel-session.h \
- $(SMIME_SOURCES_H) \
- camel-store.h \
- camel-store-summary.h \
- camel-stream-buffer.h \
- camel-stream-filter.h \
- camel-stream-fs.h \
- camel-stream-mem.h \
- camel-stream-null.h \
- camel-stream-process.h \
- camel-stream.h \
- camel-string-utils.h \
- camel-text-index.h \
- camel-tcp-stream-raw.h \
- camel-tcp-stream-ssl.h \
- camel-tcp-stream.h \
- camel-transport.h \
- camel-types.h \
- camel-uid-cache.h \
- camel-url.h \
- camel-url-scanner.h \
- camel-utf8.h \
- camel-vee-folder.h \
- camel-vee-store.h \
- camel-vtrash-folder.h \
- camel.h
-
-libcamel_la_LDFLAGS = -version-info 0:0:0
-
-libcamel_la_LIBADD = \
- $(top_builddir)/e-util/libeutil.la \
- $(CAMEL_LIBS)
-
-camel_lock_helper_SOURCES = \
- camel-lock-helper.c \
- camel-lock-helper.h
-
-# NOTE: This needs to be cleaned up, it shouldn't link with all this crap,
-# because it might be setuid.
-camel_lock_helper_LDADD = \
- camel-lock.o \
- $(libcamel_la_LIBADD)
-
-camel_index_control_SOURCES = \
- camel-index-control.c
-
-camel_index_control_LDADD = \
- $(libcamel_la_LIBADD) \
- libcamel.la
-# $(EVOLUTION_MAIL_LIBS)
-
-install-exec-hook:
- @if test -n "$(CAMEL_LOCK_HELPER_USER)"; then \
- if test `whoami` = root ; then \
- chown $(CAMEL_LOCK_HELPER_USER) $(DESTDIR)$(camellibexecdir)/camel-lock-helper ; \
- chmod u+s $(DESTDIR)$(camellibexecdir)/camel-lock-helper ; \
- else \
- echo '*** WARNING ***' ; \
- echo "Camel will not be able to open mbox files until you perform the following steps:" ; \
- echo " 1. Become root" ; \
- echo " 2. chown $(CAMEL_LOCK_HELPER_USER) $(DESTDIR)$(sbindir)/camel-lock-helper" ; \
- echo " 3. chmod u+s $(DESTDIR)$(sbindir)/camel-lock-helper" ; \
- echo '*** WARNING ***' ; \
- fi \
- else \
- echo "No user to chown to"; \
- fi
- @if test -n "$(CAMEL_LOCK_HELPER_GROUP)"; then \
- if test `whoami` = root ; then \
- chgrp $(CAMEL_LOCK_HELPER_GROUP) $(DESTDIR)$(camellibexecdir)/camel-lock-helper ; \
- chmod g+s $(DESTDIR)$(camellibexecdir)/camel-lock-helper ; \
- else \
- echo '*** WARNING ***' ; \
- echo "Camel will not be able to open mbox files until you perform the following steps:" ; \
- echo " 1. Become root" ; \
- echo " 2. chgrp $(CAMEL_LOCK_HELPER_GROUP) $(DESTDIR)$(camellibexecdir)/camel-lock-helper" ; \
- echo " 3. chmod g+s $(DESTDIR)$(camellibexecdir)/camel-lock-helper" ; \
- echo '*** WARNING ***' ; \
- fi \
- else \
- echo "No user to chown to"; \
- fi
-
-noinst_HEADERS = \
- camel-charset-map-private.h \
- camel-private.h \
- camel-search-private.h \
- camel-html-parser.h
-
-EXTRA_DIST = \
- ChangeLog.pre-1-4 \
- camel-smime-context.h \
- camel-smime-context.c \
- README
diff --git a/camel/README b/camel/README
deleted file mode 100644
index 89b57ad3c7..0000000000
--- a/camel/README
+++ /dev/null
@@ -1,54 +0,0 @@
-
- CAMEL
-
-
- A generic Messaging Library
-
-
- ----
-
-
-Introduction:
--------------
-
-Camel is a generic messaging library. It supports the standard
-messaging system for receiving and sending messages. It is the
-messaging backend for Evolution.
-
-The name "camel" stands for ... nothing. Open area of development there.
-You know, that "bazaar" thing. Maybe could we organize a big contest on
-gnome-list to find the best explanation :)
-
-Camel draws heavily from JavaMail and the IMAP4rev1 RFC. People
-wanting to hack on a provider should read the JavaMail API
-specification, but CMC and MAPI are of interest too.
-
-
-Organization:
--------------
-
-The library is roughly a set of abstract classes, some kind of generic
-"interfaces" (IDL interfaces, not Java interfaces).
-
-Particular implementations are called providers.
-
-Here are the basic objects:
-
-* CamelService : An abstract class representing an access to a server.
-Handles the connection and authentication to any server.
-
-* CamelStore (CamelService): A hierarchy of folders on a server.
-
-* CamelFolder : An object containing messages. A folder is always
-associated with a store.
-
-* CamelMessage : An object contained in folders. Is defined by a set
-of attributes and a content. (Attributes include: the date it was
-received, the sender address, .....)
-
-* CamelTransport (CamelService): A way to send messages.
-
-....
-...
-
-
diff --git a/camel/README.COPYRIGHT b/camel/README.COPYRIGHT
deleted file mode 100644
index bad1b76eb8..0000000000
--- a/camel/README.COPYRIGHT
+++ /dev/null
@@ -1,46 +0,0 @@
-Important note for Camel hackers:
----------------------------------
-
-Camel has been a lot of work, and has been conceived to be general
-enough to be used outside the gnome-mailer. It is possible in the
-future that it is used in software with licenses incompatible with the
-GPL. For this reason, the copyright has to be owned by a unique
-entity. Be sure, however, that Camel will always be available under
-the GPL. Significant authors will always be consulted before any
-special use of Camel. Moreover, in special situations, they may be
-given the authorization to use Camel with a license different than the
-GPL.
-
-Thus, when adding code in Camel, always add the following lines at the
-begining of the file:
-
-/*
- * Copyright 1999, 200x Ximian, Inc. (http://www.ximian.com)
- *
- * Author: Your name <your.email@address>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-You may also want to add your name to the author list inside this
-header.
-
-Please contact Ximian, Inc. (http://www.ximian.com) if you want to discuss
-this copyright issue.
-
-Happy hacking,
-
-Ximian, Inc.
diff --git a/camel/README.HACKING b/camel/README.HACKING
deleted file mode 100644
index a4742ee7b8..0000000000
--- a/camel/README.HACKING
+++ /dev/null
@@ -1,14 +0,0 @@
-You want to hack on Camel ?
-
-Thanks. Camel aims at being the best messaging
-library for Linux and your help is welcome.
-Please be sure to read the following files before
-commiting any change or sending any patch:
-
-CODING.STYLE
-README.COPYRIGHT
-
-
-Thanks.
-
- Bertrand <Bertrand.Guiheneuf@aful.org> \ No newline at end of file
diff --git a/camel/README.mt b/camel/README.mt
deleted file mode 100644
index aeece1b0bb..0000000000
--- a/camel/README.mt
+++ /dev/null
@@ -1,171 +0,0 @@
-
-This version of camel is working towards being multi-thread safe
-(MT-SAFE). At least, for the important api's.
-
-This code has now been merged into the main head, but this file
-will remain here as a log of how it was done, incase any issues
-arise. The ChangeLog of course has a much more detailed list
-of changes.
-
-Intended method
-===============
-
-I intend working on it in several stages:
-
-1. Making the api multi-threadable. Basically removing some const-returns,
-and copying some data where it wasn't before. The api should
-still continue to work if not being used in a multithreaded
-application. There is not a significant amount of work here since
-this was more or less the intention all along.
-
-Some functions where references to objects are returned may have to be
-changed slightly, so that refcounts are incremented before return.
-This doesn't affect much though.
-
-camel_folder::get_message_info done
-camel_folder_summary::uid done
-camel_folder_summary::index done
-camel_folder::get_summary
- Needs to ref each summary item it points to. done
-camel_folder::free_summary
- Needs to unref each summary item it points to. done
-camel_folder_get_message_tag
- needs to copy the tag return
-camel_maildir_summary filename string
- should not be able to modify the string
- array contents after it has been added to
- the summary.
-camel_folder done
- Make every camel-folder use a camel-folder-summary.
- This just reduces some of the code duplication,
- since everything but vee-folder does this already.
-
-2. Adding high level locks for proof of concept. The locks will
-be stored in private or global data, so the api should remain the same for
-non-threaded applications.
-
-A per-folder lock which governs access to the folder
- summary, the folder file or
- communications socket, etc. done
-Locking for exceptions. done
-Per store locks for internal stuff. done
-Per-service locks for various internal lists and
- caches done
-
-3. Further fine-grained locking where it can be done/is worthwhile.
-
-A per-index lock for libibex done
-Locking for the search object half done
-Internal lock for the folder_summary itself
- So that searching can be detatched from other
- folder operations, etc. done
-Possibly a lock for access to parts of a mime-part
- or message
-
-4. A method to cancel operations.
-
-Individual outstanding operations must be cancellable, and not just
-'all current operations'. This will probably not use pthread_cancel
-type of cancelling.
-
-This will however, probably use a method for starting a new thread,
-through camel, that can then be cancelled, and/or some method of
-registering that a thread can be cancelled. Blocking states within
-camel, within that thread, will then act as checkpoints for if the
-operation, and if it is cancelled, the operation will abort
-(i.e. fail, with an appropriate exception code).
-
-Operation cancelling should also function when the application is not
-multi-threaded. Not sure of the api for this yet, probably a callback
-system. Hopefully the api for both scenarios can be made the same.
-
-Other thoughts
-==============
-
-Basically much of the code in camel that does the actual work does NOT
-need to be thread safe to make it safely usable in an mt context.
-
-camel-folder, camel-summary, camel-imap-search, and the camel-service
-classes (at least) are the important ones to be made multithreaded.
-
-For other things, they are either resources that are created
-one-off (for example, camel-mime-message, and its associated
-parts, like camel-internet-address), or multithreadedness
-doesn't make a lot of sense - e.g. camel-stream, or camel-mime-parser.
-
-So basically the approach is a low-risk one. Adding the minimum
-number of locks to start with, and providing further fine-grained
-locks as required. The locks should not need to be particularly
-fine-grained in order to get reasonable results.
-
-Log of changes
-==============
-
-Changed CamelFolder:get_message_info() to return a ref'd copy, requiring
-all get_message_info()'s to have a matching free_message_info().
-
-Moved the CamelFolder frozen changelog data to a private structure.
-
-Added a mutex for CamelFolder frozen changelog stuff (it was just easy
-to do, although it isn't needed yet).
-
-Added a single mutex around all other CamelFolder functions that need
-it, this is just the first cut at mt'edness.
-
-Fixed all camel-folder implementations that call any other
-camel-folder functions to call via virtual methods, to bypass the locks.
-
-Added camel-store private data.
-
-Added a single mutex lock for camel-store's folder functions.
-
-Added camel-service private data.
-
-Added a single mutex lock for camel-service's connect stuff.
-
-Added a mutex for remote-store stream io stuff.
-
-Added a mutex for imap, so it can bracket a compound command
-exclusively. Pop doesn't need this since you can only have a single
-folder per store, and the folder interface is already forced
-single-threaded.
-
-Added mutex for camel-session, most operations.
-
-Running the tests finds at least 1 deadlock so far. Need to
-work on that.
-
-Fixed get_summary to ref/unref its items.
-
-Removed the global folder lock from the toplevel
-camel_folder_search(), each implementation must now handle locking.
-
-Fixed the local-folder implementation of searching. imap-folder
-searching should already be mt-safe through the command lock.
-
-Fixed imap summary to ref/unref too.
-
-Built some test cases, and expanded the test framework library to
-handle multiple threads. It works!
-
-Next, added a recursive mutex class, so that locking inside imap had
-any chance of working. Got imap working.
-
-Moved the camel folder summary into the base folder class, and fixed
-everything to use it that way.
-
-Made the vfolder use a real camel-folder-summary rather than a
-hashtable + array that it was using, and probably fixed some problems
-which caused evolution-mail not to always catch flag updates. Oh, and
-made it sync/expunge all its subfolders when sync/expungeing.
-
-Made the camel-folder summary completely mt-safe.
-
-Removed all of the locks on the folder functions dealing directly with
-the summary, so now for example all summary lookups will not be
-interupted by long operations.
-
-Made the nntp newsrc thing mt-safe, because of some unfortunate
-sideeffect of it being called from the summary interaction code in
-nntp-folder.
-
diff --git a/camel/broken-date-parser.c b/camel/broken-date-parser.c
deleted file mode 100644
index 19fc0c2271..0000000000
--- a/camel/broken-date-parser.c
+++ /dev/null
@@ -1,532 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <glib.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <sys/time.h>
-#include <time.h>
-
-#include "broken-date-parser.h"
-#include "e-time-utils.h"
-
-#define d(x)
-
-#define NUMERIC_CHARS "1234567890"
-#define WEEKDAY_CHARS "SundayMondayTuesdayWednesdayThursdayFridaySaturday"
-#define MONTH_CHARS "JanuaryFebruaryMarchAprilMayJuneJulyAugustSeptemberOctoberNovemberDecember"
-#define TIMEZONE_ALPHA_CHARS "UTCGMTESTEDTCSTCDTMSTPSTPDTZAMNY()"
-#define TIMEZONE_NUMERIC_CHARS "-+1234567890"
-#define TIME_CHARS "1234567890:"
-
-#define DATE_TOKEN_NON_NUMERIC (1 << 0)
-#define DATE_TOKEN_NON_WEEKDAY (1 << 1)
-#define DATE_TOKEN_NON_MONTH (1 << 2)
-#define DATE_TOKEN_NON_TIME (1 << 3)
-#define DATE_TOKEN_HAS_COLON (1 << 4)
-#define DATE_TOKEN_NON_TIMEZONE_ALPHA (1 << 5)
-#define DATE_TOKEN_NON_TIMEZONE_NUMERIC (1 << 6)
-#define DATE_TOKEN_HAS_SIGN (1 << 7)
-
-static unsigned char datetok_table[256] = {
- 128,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,
- 111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,
- 111,111,111,111,111,111,111,111, 79, 79,111,175,111,175,111,111,
- 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,119,111,111,111,111,111,
- 111, 75,111, 79, 75, 79,105, 79,111,111,107,111,111, 73, 75,107,
- 79,111,111, 73, 77, 79,111,109,111, 79, 79,111,111,111,111,111,
- 111,105,107,107,109,105,111,107,105,105,111,111,107,107,105,105,
- 107,111,105,105,105,105,107,111,111,105,111,111,111,111,111,111,
- 111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,
- 111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,
- 111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,
- 111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,
- 111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,
- 111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,
- 111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,
- 111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,
-};
-
-/* hrm, is there a library for this shit? */
-static struct {
- char *name;
- int offset;
-} tz_offsets [] = {
- { "UT", 0 },
- { "GMT", 0 },
- { "EST", -500 }, /* these are all US timezones. bloody yanks */
- { "EDT", -400 },
- { "CST", -600 },
- { "CDT", -500 },
- { "MST", -700 },
- { "MDT", -600 },
- { "PST", -800 },
- { "PDT", -700 },
- { "Z", 0 },
- { "A", -100 },
- { "M", -1200 },
- { "N", 100 },
- { "Y", 1200 },
-};
-
-static char *tm_months[] = {
- "Jan", "Feb", "Mar", "Apr", "May", "Jun",
- "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
-};
-
-static char *tm_days[] = {
- "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
-};
-
-
-struct _date_token {
- struct _date_token *next;
- const unsigned char *start;
- unsigned int len;
- unsigned int mask;
-};
-
-/* This is where it gets ugly... */
-static struct _date_token *
-datetok (const char *date)
-{
- struct _date_token *tokens = NULL, *token, *tail = (struct _date_token *) &tokens;
- const unsigned char *start, *end;
- unsigned int mask;
-
- start = date;
- while (*start) {
- /* kill leading whitespace */
- while (*start && isspace ((int) *start))
- start++;
-
- if (*start == '\0')
- break;
-
- mask = datetok_table[*start];
-
- /* find the end of this token */
- end = start + 1;
- while (*end && !strchr ("-/,\t\r\n ", *end))
- mask |= datetok_table[*end++];
-
- if (end != start) {
- token = g_malloc (sizeof (struct _date_token));
- token->next = NULL;
- token->start = start;
- token->len = end - start;
- token->mask = mask;
-
- tail->next = token;
- tail = token;
- }
-
- if (*end)
- start = end + 1;
- else
- break;
- }
-
- return tokens;
-}
-
-static int
-decode_int (const unsigned char *in, unsigned int inlen)
-{
- register const unsigned char *inptr;
- const unsigned char *inend;
- int sign = 1, val = 0;
-
- inptr = in;
- inend = in + inlen;
-
- if (*inptr == '-') {
- sign = -1;
- inptr++;
- } else if (*inptr == '+')
- inptr++;
-
- for ( ; inptr < inend; inptr++) {
- if (!isdigit ((int) *inptr))
- return -1;
- else
- val = (val * 10) + (*inptr - '0');
- }
-
- val *= sign;
-
- return val;
-}
-
-static int
-get_wday (const unsigned char *in, unsigned int inlen)
-{
- int wday;
-
- if (inlen < 3)
- return -1;
-
- for (wday = 0; wday < 7; wday++)
- if (!strncasecmp (in, tm_days[wday], 3))
- return wday;
-
- return -1; /* unknown week day */
-}
-
-static int
-get_mday (const unsigned char *in, unsigned int inlen)
-{
- int mday;
-
- mday = decode_int (in, inlen);
-
- if (mday < 0 || mday > 31)
- mday = -1;
-
- return mday;
-}
-
-static int
-get_month (const unsigned char *in, unsigned int inlen)
-{
- int i;
-
- if (inlen < 3)
- return -1;
-
- for (i = 0; i < 12; i++)
- if (!strncasecmp (in, tm_months[i], 3))
- return i;
-
- return -1; /* unknown month */
-}
-
-static int
-get_year (const unsigned char *in, unsigned int inlen)
-{
- int year;
-
- year = decode_int (in, inlen);
- if (year == -1)
- return -1;
-
- if (year < 100)
- year += (year < 70) ? 2000 : 1900;
-
- if (year < 1969)
- return -1;
-
- return year;
-}
-
-static gboolean
-get_time (const unsigned char *in, unsigned int inlen, int *hour, int *min, int *sec)
-{
- register const unsigned char *inptr;
- const unsigned char *inend;
- int *val, colons = 0;
-
- *hour = *min = *sec = 0;
-
- inend = in + inlen;
- val = hour;
- for (inptr = in; inptr < inend; inptr++) {
- if (*inptr == ':') {
- colons++;
- switch (colons) {
- case 1:
- val = min;
- break;
- case 2:
- val = sec;
- break;
- default:
- return FALSE;
- }
- } else if (!isdigit ((int) *inptr))
- return FALSE;
- else
- *val = (*val * 10) + (*inptr - '0');
- }
-
- return TRUE;
-}
-
-static int
-get_tzone (struct _date_token **token)
-{
- const unsigned char *inptr, *inend;
- unsigned int inlen;
- int i, t;
-
- for (i = 0; *token && i < 2; *token = (*token)->next, i++) {
- inptr = (*token)->start;
- inlen = (*token)->len;
- inend = inptr + inlen;
-
- if (*inptr == '+' || *inptr == '-') {
- t = decode_int (inptr, inlen);
- if (t < -1200 || t > 1400)
- return -1;
-
- return t;
- } else {
- if (*inptr == '(') {
- inptr++;
- if (*(inend - 1) == ')')
- inlen -= 2;
- else
- inlen--;
- }
-
- for (t = 0; t < 15; t++) {
- unsigned int len = strlen (tz_offsets[t].name);
-
- if (len != inlen)
- continue;
-
- if (!strncmp (inptr, tz_offsets[t].name, len))
- return tz_offsets[t].offset;
- }
- }
- }
-
- return -1;
-}
-
-/* This is where things get interesting... ;-) */
-
-#define date_token_mask(t) (((struct _date_token *) t)->mask)
-#define is_numeric(t) ((date_token_mask (t) & DATE_TOKEN_NON_NUMERIC) == 0)
-#define is_weekday(t) ((date_token_mask (t) & DATE_TOKEN_NON_WEEKDAY) == 0)
-#define is_month(t) ((date_token_mask (t) & DATE_TOKEN_NON_MONTH) == 0)
-#define is_time(t) (((date_token_mask (t) & DATE_TOKEN_NON_TIME) == 0) && (date_token_mask (t) & DATE_TOKEN_HAS_COLON))
-#define is_tzone_alpha(t) ((date_token_mask (t) & DATE_TOKEN_NON_TIMEZONE_ALPHA) == 0)
-#define is_tzone_numeric(t) (((date_token_mask (t) & DATE_TOKEN_NON_TIMEZONE_NUMERIC) == 0) && (date_token_mask (t) & DATE_TOKEN_HAS_SIGN))
-#define is_tzone(t) (is_tzone_alpha (t) || is_tzone_numeric (t))
-
-static time_t
-decode_broken_date (struct _date_token *tokens, int *tzone)
-{
- gboolean got_wday, got_month, got_tzone;
- int hour, min, sec, offset, n;
- struct _date_token *token;
- struct tm tm;
- time_t time;
-
- memset ((void *) &tm, 0, sizeof (struct tm));
- got_wday = got_month = got_tzone = FALSE;
- offset = 0;
-
- token = tokens;
- while (token) {
- if (is_weekday (token) && !got_wday) {
- if ((n = get_wday (token->start, token->len)) != -1) {
- d(printf ("weekday; "));
- got_wday = TRUE;
- tm.tm_wday = n;
- goto next_token;
- }
- }
-
- if (is_month (token) && !got_month) {
- if ((n = get_month (token->start, token->len)) != -1) {
- d(printf ("month; "));
- got_month = TRUE;
- tm.tm_mon = n;
- goto next_token;
- }
- }
-
- if (is_time (token) && !tm.tm_hour && !tm.tm_min && !tm.tm_sec) {
- if (get_time (token->start, token->len, &hour, &min, &sec)) {
- d(printf ("time; "));
- tm.tm_hour = hour;
- tm.tm_min = min;
- tm.tm_sec = sec;
- goto next_token;
- }
- }
-
- if (is_tzone (token) && !got_tzone) {
- struct _date_token *t = token;
-
- if ((n = get_tzone (&t)) != -1) {
- d(printf ("tzone; "));
- got_tzone = TRUE;
- offset = n;
- goto next_token;
- }
- }
-
- if (is_numeric (token)) {
- if (token->len == 4 && !tm.tm_year) {
- if ((n = get_year (token->start, token->len)) != -1) {
- d(printf ("year; "));
- tm.tm_year = n - 1900;
- goto next_token;
- }
- } else {
- if (!got_month && !got_wday && token->next && is_numeric (token->next)) {
- d(printf ("mon; "));
- n = decode_int (token->start, token->len);
- got_month = TRUE;
- tm.tm_mon = n - 1;
- goto next_token;
- } else if (!tm.tm_mday && (n = get_mday (token->start, token->len)) != -1) {
- d(printf ("mday; "));
- tm.tm_mday = n;
- goto next_token;
- } else if (!tm.tm_year) {
- d(printf ("2-digit year; "));
- n = get_year (token->start, token->len);
- tm.tm_year = n - 1900;
- goto next_token;
- }
- }
- }
-
- d(printf ("???; "));
-
- next_token:
-
- token = token->next;
- }
-
- d(printf ("\n"));
-
- time = e_mktime_utc (&tm);
-
- /* time is now GMT of the time we want, but not offset by the timezone ... */
-
- /* this should convert the time to the GMT equiv time */
- time -= ((offset / 100) * 60 * 60) + (offset % 100) * 60;
-
- if (tzone)
- *tzone = offset;
-
- return time;
-}
-
-
-/**
- * parse_broken_date:
- * @datestr: input date string
- * @saveoffset:
- *
- * Decodes the rfc822/broken date string and saves the GMT offset into
- * @saveoffset if non-NULL.
- *
- * Returns the time_t representation of the date string specified by
- * @in. If 'saveoffset' is non-NULL, the value of the timezone offset
- * will be stored.
- **/
-time_t
-parse_broken_date (const char *datestr, int *saveoffset)
-{
- struct _date_token *token, *tokens;
- time_t date;
-
- tokens = datetok (datestr);
-
- date = decode_broken_date (tokens, saveoffset);
-
- /* cleanup */
- while (tokens) {
- token = tokens;
- tokens = tokens->next;
- g_free (token);
- }
-
- return date;
-}
-
-
-
-
-
-#ifdef DATETOK_STANDALONE
-
-static void
-table_init ()
-{
- int i;
-
- memset (datetok_table, 0, sizeof (datetok_table));
-
- for (i = 0; i < 256; i++) {
- if (!strchr (NUMERIC_CHARS, i))
- datetok_table[i] |= DATE_TOKEN_NON_NUMERIC;
-
- if (!strchr (WEEKDAY_CHARS, i))
- datetok_table[i] |= DATE_TOKEN_NON_WEEKDAY;
-
- if (!strchr (MONTH_CHARS, i))
- datetok_table[i] |= DATE_TOKEN_NON_MONTH;
-
- if (!strchr (TIME_CHARS, i))
- datetok_table[i] |= DATE_TOKEN_NON_TIME;
-
- if (!strchr (TIMEZONE_ALPHA_CHARS, i))
- datetok_table[i] |= DATE_TOKEN_NON_TIMEZONE_ALPHA;
-
- if (!strchr (TIMEZONE_NUMERIC_CHARS, i))
- datetok_table[i] |= DATE_TOKEN_NON_TIMEZONE_NUMERIC;
-
- if (((char) i) == ':')
- datetok_table[i] |= DATE_TOKEN_HAS_COLON;
-
- if (strchr ("+-", i))
- datetok_table[i] |= DATE_TOKEN_HAS_SIGN;
- }
-
- printf ("static unsigned int datetok_table[256] = {");
- for (i = 0; i < 256; i++) {
- if (i % 16 == 0)
- printf ("\n\t");
- printf ("%3d,", datetok_table[i]);
- }
- printf ("\n};\n");
-}
-
-
-int main (int argc, char **argv)
-{
- time_t date;
- int offset;
-
- /*table_init ();*/
-
- date = parse_broken_date (argv[1], &offset);
- printf ("%d; %d\n", date, offset);
-
- return 0;
-}
-
-#endif /* DATETOK_STANDALONE */
diff --git a/camel/broken-date-parser.h b/camel/broken-date-parser.h
deleted file mode 100644
index b69d7636d7..0000000000
--- a/camel/broken-date-parser.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-
-#include <time.h>
-
-/* prototypes for functions dealing with broken date formats */
-
-time_t parse_broken_date (const char *datestr, int *saveoffset);
-
-
-
-
-
diff --git a/camel/camel-address.c b/camel/camel-address.c
deleted file mode 100644
index a25e9ba791..0000000000
--- a/camel/camel-address.c
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include "camel-address.h"
-
-
-static void camel_address_class_init (CamelAddressClass *klass);
-static void camel_address_init (CamelAddress *obj);
-static void camel_address_finalize (CamelObject *obj);
-
-static CamelObjectClass *camel_address_parent;
-
-static void
-camel_address_class_init (CamelAddressClass *klass)
-{
- camel_address_parent = camel_type_get_global_classfuncs (camel_object_get_type ());
-}
-
-static void
-camel_address_init (CamelAddress *obj)
-{
- obj->addresses = g_ptr_array_new();
-}
-
-static void
-camel_address_finalize (CamelObject *obj)
-{
- camel_address_remove((CamelAddress *)obj, -1);
- g_ptr_array_free(((CamelAddress *)obj)->addresses, TRUE);
-}
-
-CamelType
-camel_address_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_object_get_type (), "CamelAddress",
- sizeof (CamelAddress),
- sizeof (CamelAddressClass),
- (CamelObjectClassInitFunc) camel_address_class_init,
- NULL,
- (CamelObjectInitFunc) camel_address_init,
- (CamelObjectFinalizeFunc) camel_address_finalize);
- }
-
- return type;
-}
-
-/**
- * camel_address_new:
- *
- * Create a new CamelAddress object.
- *
- * Return value: A new CamelAddress widget.
- **/
-CamelAddress *
-camel_address_new (void)
-{
- CamelAddress *new = CAMEL_ADDRESS(camel_object_new(camel_address_get_type()));
- return new;
-}
-
-/**
- * camel_address_new_clone:
- * @in:
- *
- * Clone an existing address type.
- *
- * Return value:
- **/
-CamelAddress *
-camel_address_new_clone(const CamelAddress *in)
-{
- CamelAddress *new = CAMEL_ADDRESS(camel_object_new(CAMEL_OBJECT_GET_TYPE(in)));
-
- camel_address_cat(new, in);
- return new;
-}
-
-/**
- * camel_address_length:
- * @a:
- *
- * Return the number of addresses stored in the address @a.
- *
- * Return value:
- **/
-int
-camel_address_length(CamelAddress *a)
-{
- return a->addresses->len;
-}
-
-/**
- * camel_address_decode:
- * @a: An address.
- * @raw: Raw address description.
- *
- * Construct a new address from a raw address field.
- *
- * Return value: Returns the number of addresses found,
- * or -1 if the addresses could not be parsed fully.
- **/
-int
-camel_address_decode (CamelAddress *a, const char *raw)
-{
- g_return_val_if_fail(CAMEL_IS_ADDRESS(a), -1);
-
- return CAMEL_ADDRESS_CLASS (CAMEL_OBJECT_GET_CLASS (a))->decode(a, raw);
-}
-
-/**
- * camel_address_encode:
- * @a:
- *
- * Encode an address in a format suitable for a raw header.
- *
- * Return value: The encoded address.
- **/
-char *
-camel_address_encode (CamelAddress *a)
-{
- g_return_val_if_fail(CAMEL_IS_ADDRESS(a), NULL);
-
- return CAMEL_ADDRESS_CLASS (CAMEL_OBJECT_GET_CLASS (a))->encode(a);
-}
-
-/**
- * camel_address_unformat:
- * @a:
- * @raw:
- *
- * Attempt to convert a previously formatted and/or edited
- * address back into internal form.
- *
- * Return value: -1 if it could not be parsed, or the number
- * of valid addresses found.
- **/
-int
-camel_address_unformat(CamelAddress *a, const char *raw)
-{
- g_return_val_if_fail(CAMEL_IS_ADDRESS(a), -1);
-
- return CAMEL_ADDRESS_CLASS (CAMEL_OBJECT_GET_CLASS (a))->unformat(a, raw);
-}
-
-/**
- * camel_address_format:
- * @a:
- *
- * Format an address in a format suitable for display.
- *
- * Return value: The formatted address.
- **/
-char *
-camel_address_format (CamelAddress *a)
-{
- if (a == NULL)
- return NULL;
-
- g_return_val_if_fail(CAMEL_IS_ADDRESS(a), NULL);
-
- return CAMEL_ADDRESS_CLASS (CAMEL_OBJECT_GET_CLASS (a))->format(a);
-}
-
-/**
- * camel_address_cat:
- * @dest:
- * @source:
- *
- * Concatenate one address onto another. The addresses must
- * be of the same type.
- *
- * Return value:
- **/
-int
-camel_address_cat (CamelAddress *dest, const CamelAddress *source)
-{
- g_return_val_if_fail(CAMEL_IS_ADDRESS(dest), -1);
- g_return_val_if_fail(CAMEL_IS_ADDRESS(source), -1);
-
- return CAMEL_ADDRESS_CLASS(CAMEL_OBJECT_GET_CLASS(dest))->cat(dest, source);
-}
-
-/**
- * camel_address_copy:
- * @dest:
- * @source:
- *
- * Copy an address contents.
- *
- * Return value:
- **/
-int
-camel_address_copy (CamelAddress *dest, const CamelAddress *source)
-{
- g_return_val_if_fail(CAMEL_IS_ADDRESS(dest), -1);
- g_return_val_if_fail(CAMEL_IS_ADDRESS(source), -1);
-
- camel_address_remove(dest, -1);
- return camel_address_cat(dest, source);
-}
-
-/**
- * camel_address_remove:
- * @a:
- * @index: The address to remove, use -1 to remove all address.
- *
- * Remove an address by index, or all addresses.
- **/
-void
-camel_address_remove (CamelAddress *a, int index)
-{
- g_return_if_fail(CAMEL_IS_ADDRESS(a));
-
- if (index == -1) {
- for (index=a->addresses->len; index>-1; index--)
- CAMEL_ADDRESS_CLASS (CAMEL_OBJECT_GET_CLASS (a))->remove(a, index);
- } else {
- CAMEL_ADDRESS_CLASS (CAMEL_OBJECT_GET_CLASS (a))->remove(a, index);
- }
-}
diff --git a/camel/camel-address.h b/camel/camel-address.h
deleted file mode 100644
index caf7e97755..0000000000
--- a/camel/camel-address.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef _CAMEL_ADDRESS_H
-#define _CAMEL_ADDRESS_H
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <glib.h>
-#include <camel/camel-object.h>
-
-#define CAMEL_ADDRESS(obj) CAMEL_CHECK_CAST (obj, camel_address_get_type (), CamelAddress)
-#define CAMEL_ADDRESS_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_address_get_type (), CamelAddressClass)
-#define CAMEL_IS_ADDRESS(obj) CAMEL_CHECK_TYPE (obj, camel_address_get_type ())
-
-typedef struct _CamelAddressClass CamelAddressClass;
-
-struct _CamelAddress {
- CamelObject parent;
-
- GPtrArray *addresses;
-
- struct _CamelAddressPrivate *priv;
-};
-
-struct _CamelAddressClass {
- CamelObjectClass parent_class;
-
- int (*decode) (CamelAddress *, const char *raw);
- char *(*encode) (CamelAddress *);
-
- int (*unformat) (CamelAddress *, const char *raw);
- char *(*format) (CamelAddress *);
-
- int (*cat) (CamelAddress *, const CamelAddress *);
-
- void (*remove) (CamelAddress *, int index);
-};
-
-CamelType camel_address_get_type (void);
-CamelAddress *camel_address_new (void);
-CamelAddress *camel_address_new_clone (const CamelAddress *);
-int camel_address_length (CamelAddress *);
-
-int camel_address_decode (CamelAddress *, const char *);
-char *camel_address_encode (CamelAddress *);
-int camel_address_unformat (CamelAddress *, const char *);
-char *camel_address_format (CamelAddress *);
-
-int camel_address_cat (CamelAddress *, const CamelAddress *);
-int camel_address_copy (CamelAddress *, const CamelAddress *);
-
-void camel_address_remove (CamelAddress *, int index);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* ! _CAMEL_ADDRESS_H */
diff --git a/camel/camel-arg.c b/camel/camel-arg.c
deleted file mode 100644
index bcd79bab59..0000000000
--- a/camel/camel-arg.c
+++ /dev/null
@@ -1,130 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- *
- *
- * Author:
- * Michael Zucchi <notzed@ximian.com>
- *
- * Copyright 2002 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include "camel-arg.h"
-
-int camel_argv_build(CamelArgV *tv)
-{
- register guint32 tag;
- register int i;
- register CamelArg *a;
- int more = TRUE;
-
- for (i=0;i<CAMEL_ARGV_MAX;i++) {
- a = &tv->argv[i];
-
- if ( (tag = va_arg(tv->ap, guint32)) == 0) {
- more = FALSE;
- break;
- }
-
- a->tag = tag;
-
- switch((tag & CAMEL_ARG_TYPE)) {
- case CAMEL_ARG_OBJ:
- a->ca_object = va_arg(tv->ap, void *);
- break;
- case CAMEL_ARG_INT:
- a->ca_int = va_arg(tv->ap, int);
- break;
- case CAMEL_ARG_DBL:
- a->ca_double = va_arg(tv->ap, double);
- break;
- case CAMEL_ARG_STR:
- a->ca_str = va_arg(tv->ap, char *);
- break;
- case CAMEL_ARG_PTR:
- a->ca_ptr = va_arg(tv->ap, void *);
- break;
- case CAMEL_ARG_BOO:
- a->ca_int = va_arg(tv->ap, int) != 0;
- break;
- default:
- printf("Error, unknown type, truncating result\n");
- more = FALSE;
- goto fail;
- }
-
- }
-fail:
- tv->argc = i;
-
- return more;
-}
-
-int camel_arggetv_build(CamelArgGetV *tv)
-{
- register guint32 tag;
- register int i;
- register CamelArgGet *a;
- int more = TRUE;
-
- for (i=0;i<CAMEL_ARGV_MAX;i++) {
- a = &tv->argv[i];
-
- if ( (tag = va_arg(tv->ap, guint32)) == 0) {
- more = FALSE;
- break;
- }
-
- a->tag = tag;
-
- switch((tag & CAMEL_ARG_TYPE)) {
- case CAMEL_ARG_OBJ:
- a->ca_object = va_arg(tv->ap, void **);
- *a->ca_object = NULL;
- break;
- case CAMEL_ARG_INT:
- case CAMEL_ARG_BOO:
- a->ca_int = va_arg(tv->ap, int *);
- *a->ca_int = 0;
- break;
- case CAMEL_ARG_DBL:
- a->ca_double = va_arg(tv->ap, double *);
- *a->ca_double = 0.0;
- break;
- case CAMEL_ARG_STR:
- a->ca_str = va_arg(tv->ap, char **);
- *a->ca_str = NULL;
- break;
- case CAMEL_ARG_PTR:
- a->ca_ptr = va_arg(tv->ap, void **);
- *a->ca_ptr = NULL;
- break;
- default:
- printf("Error, unknown type, truncating result\n");
- more = FALSE;
- goto fail;
- }
-
- }
-fail:
- tv->argc = i;
-
- return more;
-}
-
diff --git a/camel/camel-arg.h b/camel/camel-arg.h
deleted file mode 100644
index ebecc0f217..0000000000
--- a/camel/camel-arg.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Author:
- * Michael Zucchi <notzed@ximian.com>
- *
- * Copyright 2002 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifndef CAMEL_ARG_H
-#define CAMEL_ARG_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus } */
-
-#include <glib.h>
-#include <stdarg.h>
-
-enum camel_arg_t {
- CAMEL_ARG_END = 0,
- CAMEL_ARG_IGNORE = 1, /* override/ignore an arg in-place */
-
- CAMEL_ARG_FIRST = 1024, /* 1024 args reserved for arg system */
-
- CAMEL_ARG_TYPE = 0xf0000000, /* type field for tags */
- CAMEL_ARG_TAG = 0x0fffffff, /* tag field for args */
-
- CAMEL_ARG_OBJ = 0x00000000, /* object */
- CAMEL_ARG_INT = 0x10000000, /* int */
- CAMEL_ARG_DBL = 0x20000000, /* double */
- CAMEL_ARG_STR = 0x30000000, /* c string */
- CAMEL_ARG_PTR = 0x40000000, /* ptr */
- CAMEL_ARG_BOO = 0x50000000, /* bool */
-};
-
-typedef struct _CamelArg CamelArg;
-typedef struct _CamelArgV CamelArgV;
-
-typedef struct _CamelArgGet CamelArgGet;
-typedef struct _CamelArgGetV CamelArgGetV;
-
-struct _CamelArg {
- guint32 tag;
- union {
- void *ca_object;
- int ca_int;
- double ca_double;
- char *ca_str;
- void *ca_ptr;
- } u;
-};
-struct _CamelArgGet {
- guint32 tag;
- union {
- void **ca_object;
- int *ca_int;
- double *ca_double;
- char **ca_str;
- void **ca_ptr;
- } u;
-};
-#define ca_object u.ca_object
-#define ca_int u.ca_int
-#define ca_double u.ca_double
-#define ca_str u.ca_str
-#define ca_ptr u.ca_ptr
-
-/* maximum no of args processed at any one time, not the max of all args */
-#define CAMEL_ARGV_MAX (20)
-
-struct _CamelArgV {
- va_list ap;
- int argc;
- CamelArg argv[CAMEL_ARGV_MAX];
-};
-
-struct _CamelArgGetV {
- va_list ap;
- int argc;
- CamelArgGet argv[CAMEL_ARGV_MAX];
-};
-
-#define camel_argv_start(tv, last) va_start((tv)->ap, last)
-#define camel_argv_end(tv) va_end((tv)->ap)
-int camel_argv_build(CamelArgV *tv);
-int camel_arggetv_build(CamelArgGetV *tv);
-
-/* set an arg ignored */
-#define camel_argv_ignore(tv, i) ((tv)->argv[i].tag = ((tv)->argv[i].tag & CAMEL_ARG_TYPE) | CAMEL_ARG_IGNORE)
-
-/* 'self-describing' property list */
-typedef struct _CamelProperty CamelProperty;
-
-struct _CamelProperty {
- guint32 tag;
- char *name;
- char *description;
-};
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_ARG_H */
diff --git a/camel/camel-block-file.c b/camel/camel-block-file.c
deleted file mode 100644
index 68008502b4..0000000000
--- a/camel/camel-block-file.c
+++ /dev/null
@@ -1,1181 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2001-2003 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/uio.h>
-#include <pthread.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-
-#include "e-util/e-msgport.h"
-
-#include "camel-block-file.h"
-#include "camel-file-utils.h"
-
-#define d(x) /*(printf("%s(%d):%s: ", __FILE__, __LINE__, __PRETTY_FUNCTION__),(x))*/
-
-/* Locks must be obtained in the order defined */
-
-struct _CamelBlockFilePrivate {
- /* We use the private structure to form our lru list from */
- struct _CamelBlockFilePrivate *next;
- struct _CamelBlockFilePrivate *prev;
-
- struct _CamelBlockFile *base;
-
- pthread_mutex_t root_lock; /* for modifying the root block */
- pthread_mutex_t cache_lock; /* for refcounting, flag manip, cache manip */
- pthread_mutex_t io_lock; /* for all io ops */
-
- unsigned int deleted:1;
-};
-
-
-#define CAMEL_BLOCK_FILE_LOCK(kf, lock) (pthread_mutex_lock(&(kf)->priv->lock))
-#define CAMEL_BLOCK_FILE_TRYLOCK(kf, lock) (pthread_mutex_trylock(&(kf)->priv->lock))
-#define CAMEL_BLOCK_FILE_UNLOCK(kf, lock) (pthread_mutex_unlock(&(kf)->priv->lock))
-
-#define LOCK(x) pthread_mutex_lock(&x)
-#define UNLOCK(x) pthread_mutex_unlock(&x)
-
-static pthread_mutex_t block_file_lock = PTHREAD_MUTEX_INITIALIZER;
-
-/* lru cache of block files */
-static EDList block_file_list = E_DLIST_INITIALISER(block_file_list);
-/* list to store block files that are actually intialised */
-static EDList block_file_active_list = E_DLIST_INITIALISER(block_file_active_list);
-static int block_file_count = 0;
-static int block_file_threshhold = 10;
-
-#define CBF_CLASS(o) ((CamelBlockFileClass *)(((CamelObject *)o)->klass))
-
-static int sync_nolock(CamelBlockFile *bs);
-static int sync_block_nolock(CamelBlockFile *bs, CamelBlock *bl);
-
-static int
-block_file_validate_root(CamelBlockFile *bs)
-{
- struct stat st;
- CamelBlockRoot *br;
- int s;
-
- br = bs->root;
-
- s = fstat(bs->fd, &st);
-
- d(printf("Validate root: '%s'\n", bs->path));
- d(printf("version: %.8s (%.8s)\n", bs->root->version, bs->version));
- d(printf("block size: %d (%d)%s\n", br->block_size, bs->block_size,
- br->block_size != bs->block_size ? " BAD":" OK"));
- d(printf("free: %ld (%d add size < %ld)%s\n", (long)br->free, br->free / bs->block_size * bs->block_size, (long)st.st_size,
- (br->free > st.st_size) || (br->free % bs->block_size) != 0 ? " BAD":" OK"));
- d(printf("last: %ld (%d and size: %ld)%s\n", (long)br->last, br->last / bs->block_size * bs->block_size, (long)st.st_size,
- (br->last != st.st_size) || ((br->last % bs->block_size) != 0) ? " BAD": " OK"));
- d(printf("flags: %s\n", (br->flags & CAMEL_BLOCK_FILE_SYNC)?"SYNC":"unSYNC"));
-
- if (br->last == 0
- || memcmp(bs->root->version, bs->version, 8) != 0
- || br->block_size != bs->block_size
- || (br->free % bs->block_size) != 0
- || (br->last % bs->block_size) != 0
- || fstat(bs->fd, &st) == -1
- || st.st_size != br->last
- || br->free > st.st_size
- || (br->flags & CAMEL_BLOCK_FILE_SYNC) == 0) {
- if (s != -1 && st.st_size > 0) {
- g_warning("Invalid root: '%s'", bs->path);
- g_warning("version: %.8s (%.8s)", bs->root->version, bs->version);
- g_warning("block size: %d (%d)%s", br->block_size, bs->block_size,
- br->block_size != bs->block_size ? " BAD":" OK");
- g_warning("free: %ld (%d add size < %ld)%s", (long)br->free, br->free / bs->block_size * bs->block_size, (long)st.st_size,
- (br->free > st.st_size) || (br->free % bs->block_size) != 0 ? " BAD":" OK");
- g_warning("last: %ld (%d and size: %ld)%s", (long)br->last, br->last / bs->block_size * bs->block_size, (long)st.st_size,
- (br->last != st.st_size) || ((br->last % bs->block_size) != 0) ? " BAD": " OK");
- g_warning("flags: %s", (br->flags & CAMEL_BLOCK_FILE_SYNC)?"SYNC":"unSYNC");
- }
- return -1;
- }
-
- return 0;
-}
-
-static int
-block_file_init_root(CamelBlockFile *bs)
-{
- CamelBlockRoot *br = bs->root;
-
- memset(br, 0, bs->block_size);
- memcpy(br->version, bs->version, 8);
- br->last = bs->block_size;
- br->flags = CAMEL_BLOCK_FILE_SYNC;
- br->free = 0;
- br->block_size = bs->block_size;
-
- return 0;
-}
-
-static void
-camel_block_file_class_init(CamelBlockFileClass *klass)
-{
- klass->validate_root = block_file_validate_root;
- klass->init_root = block_file_init_root;
-}
-
-static guint
-block_hash_func(const void *v)
-{
- return ((camel_block_t) GPOINTER_TO_UINT(v)) >> CAMEL_BLOCK_SIZE_BITS;
-}
-
-static void
-camel_block_file_init(CamelBlockFile *bs)
-{
- struct _CamelBlockFilePrivate *p;
-
- bs->fd = -1;
- bs->block_size = CAMEL_BLOCK_SIZE;
- e_dlist_init(&bs->block_cache);
- bs->blocks = g_hash_table_new((GHashFunc)block_hash_func, NULL);
- /* this cache size and the text index size have been tuned for about the best
- with moderate memory usage. Doubling the memory usage barely affects performance. */
- bs->block_cache_limit = 256;
-
- p = bs->priv = g_malloc0(sizeof(*bs->priv));
- p->base = bs;
-
- pthread_mutex_init(&p->root_lock, NULL);
- pthread_mutex_init(&p->cache_lock, NULL);
- pthread_mutex_init(&p->io_lock, NULL);
-
- /* link into lru list */
- LOCK(block_file_lock);
- e_dlist_addhead(&block_file_list, (EDListNode *)p);
-
-#if 0
- {
- printf("dumping block list\n");
- printf(" head = %p p = %p\n", block_file_list.head, p);
- p = block_file_list.head;
- while (p->next) {
- printf(" '%s'\n", p->base->path);
- p = p->next;
- }
- }
-#endif
-
- UNLOCK(block_file_lock);
-}
-
-static void
-camel_block_file_finalise(CamelBlockFile *bs)
-{
- CamelBlock *bl, *bn;
- struct _CamelBlockFilePrivate *p;
-
- p = bs->priv;
-
- if (bs->root_block)
- camel_block_file_sync(bs);
-
- /* remove from lru list */
- LOCK(block_file_lock);
- if (bs->fd != -1)
- block_file_count--;
- e_dlist_remove((EDListNode *)p);
- UNLOCK(block_file_lock);
-
- bl = (CamelBlock *)bs->block_cache.head;
- bn = bl->next;
- while (bn) {
- if (bl->refcount != 0)
- g_warning("Block '%d' still referenced", bl->id);
- g_free(bl);
- bl = bn;
- bn = bn->next;
- }
-
- g_hash_table_destroy (bs->blocks);
-
- if (bs->root_block)
- camel_block_file_unref_block(bs, bs->root_block);
- g_free(bs->path);
- if (bs->fd != -1)
- close(bs->fd);
-
- pthread_mutex_destroy(&p->io_lock);
- pthread_mutex_destroy(&p->cache_lock);
- pthread_mutex_destroy(&p->root_lock);
-
- g_free(p);
-}
-
-CamelType
-camel_block_file_get_type(void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register(camel_object_get_type(), "CamelBlockFile",
- sizeof (CamelBlockFile),
- sizeof (CamelBlockFileClass),
- (CamelObjectClassInitFunc) camel_block_file_class_init,
- NULL,
- (CamelObjectInitFunc) camel_block_file_init,
- (CamelObjectFinalizeFunc) camel_block_file_finalise);
- }
-
- return type;
-}
-
-/* 'use' a block file for io */
-static int
-block_file_use(CamelBlockFile *bs)
-{
- struct _CamelBlockFilePrivate *nw, *nn, *p = bs->priv;
- CamelBlockFile *bf;
- int err;
-
- /* We want to:
- remove file from active list
- lock it
-
- Then when done:
- unlock it
- add it back to end of active list
- */
-
- CAMEL_BLOCK_FILE_LOCK(bs, io_lock);
-
- if (bs->fd != -1)
- return 0;
- else if (p->deleted) {
- CAMEL_BLOCK_FILE_UNLOCK(bs, io_lock);
- errno = ENOENT;
- return -1;
- } else
- d(printf("Turning block file online: %s\n", bs->path));
-
- if ((bs->fd = open(bs->path, bs->flags, 0600)) == -1) {
- err = errno;
- CAMEL_BLOCK_FILE_UNLOCK(bs, io_lock);
- errno = err;
- return -1;
- }
-
- LOCK(block_file_lock);
- e_dlist_remove((EDListNode *)p);
- e_dlist_addtail(&block_file_active_list, (EDListNode *)p);
-
- block_file_count++;
-
- nw = (struct _CamelBlockFilePrivate *)block_file_list.head;
- nn = nw->next;
- while (block_file_count > block_file_threshhold && nn) {
- /* We never hit the current blockfile here, as its removed from the list first */
- bf = nw->base;
- if (bf->fd != -1) {
- /* Need to trylock, as any of these lock levels might be trying
- to lock the block_file_lock, so we need to check and abort if so */
- if (CAMEL_BLOCK_FILE_TRYLOCK(bf, root_lock) == 0) {
- if (CAMEL_BLOCK_FILE_TRYLOCK(bf, cache_lock) == 0) {
- if (CAMEL_BLOCK_FILE_TRYLOCK(bf, io_lock) == 0) {
- d(printf("[%d] Turning block file offline: %s\n", block_file_count-1, bf->path));
- sync_nolock(bf);
- close(bf->fd);
- bf->fd = -1;
- block_file_count--;
- CAMEL_BLOCK_FILE_UNLOCK(bf, io_lock);
- }
- CAMEL_BLOCK_FILE_UNLOCK(bf, cache_lock);
- }
- CAMEL_BLOCK_FILE_UNLOCK(bf, root_lock);
- }
- }
- nw = nn;
- nn = nw->next;
- }
-
- UNLOCK(block_file_lock);
-
- return 0;
-}
-
-static void
-block_file_unuse(CamelBlockFile *bs)
-{
- LOCK(block_file_lock);
- e_dlist_remove((EDListNode *)bs->priv);
- e_dlist_addtail(&block_file_list, (EDListNode *)bs->priv);
- UNLOCK(block_file_lock);
-
- CAMEL_BLOCK_FILE_UNLOCK(bs, io_lock);
-}
-
-/*
-o = camel_cache_get(c, key);
-camel_cache_unref(c, key);
-camel_cache_add(c, key, o);
-camel_cache_remove(c, key);
-*/
-
-/**
- * camel_block_file_new:
- * @path:
- * @:
- * @block_size:
- *
- * Allocate a new block file, stored at @path. @version contains an 8 character
- * version string which must match the head of the file, or the file will be
- * intitialised.
- *
- * @block_size is currently ignored and is set to CAMEL_BLOCK_SIZE.
- *
- * Return value: The new block file, or NULL if it could not be created.
- **/
-CamelBlockFile *camel_block_file_new(const char *path, int flags, const char version[8], size_t block_size)
-{
- CamelBlockFile *bs;
-
- bs = (CamelBlockFile *)camel_object_new(camel_block_file_get_type());
- memcpy(bs->version, version, 8);
- bs->path = g_strdup(path);
- bs->flags = flags;
-
- bs->root_block = camel_block_file_get_block(bs, 0);
- if (bs->root_block == NULL) {
- camel_object_unref((CamelObject *)bs);
- return NULL;
- }
- camel_block_file_detach_block(bs, bs->root_block);
- bs->root = (CamelBlockRoot *)&bs->root_block->data;
-
- /* we only need these flags on first open */
- bs->flags &= ~(O_CREAT|O_EXCL|O_TRUNC);
-
- /* Do we need to init the root block? */
- if (CBF_CLASS(bs)->validate_root(bs) == -1) {
- d(printf("Initialise root block: %.8s\n", version));
-
- CBF_CLASS(bs)->init_root(bs);
- camel_block_file_touch_block(bs, bs->root_block);
- if (block_file_use(bs) == -1) {
- camel_object_unref((CamelObject *)bs);
- return NULL;
- }
- if (sync_block_nolock(bs, bs->root_block) == -1
- || ftruncate(bs->fd, bs->root->last) == -1) {
- block_file_unuse(bs);
- camel_object_unref((CamelObject *)bs);
- return NULL;
- }
- block_file_unuse(bs);
- }
-
- return bs;
-}
-
-int
-camel_block_file_rename(CamelBlockFile *bs, const char *path)
-{
- int ret;
- struct stat st;
- int err;
-
- CAMEL_BLOCK_FILE_LOCK(bs, io_lock);
-
- ret = rename(bs->path, path);
- if (ret == -1) {
- /* Maybe the rename actually worked */
- err = errno;
- if (stat(path, &st) == 0
- && stat(bs->path, &st) == -1
- && errno == ENOENT)
- ret = 0;
- errno = err;
- }
-
- if (ret != -1) {
- g_free(bs->path);
- bs->path = g_strdup(path);
- }
-
- CAMEL_BLOCK_FILE_UNLOCK(bs, io_lock);
-
- return ret;
-}
-
-int
-camel_block_file_delete(CamelBlockFile *bs)
-{
- int ret;
- struct _CamelBlockFilePrivate *p = bs->priv;
-
- CAMEL_BLOCK_FILE_LOCK(bs, io_lock);
-
- if (bs->fd != -1) {
- LOCK(block_file_lock);
- block_file_count--;
- UNLOCK(block_file_lock);
- close(bs->fd);
- bs->fd = -1;
- }
-
- p->deleted = TRUE;
- ret = unlink(bs->path);
-
- CAMEL_BLOCK_FILE_UNLOCK(bs, io_lock);
-
- return ret;
-
-}
-
-/**
- * camel_block_file_new_block:
- * @bs:
- *
- * Allocate a new block, return a pointer to it. Old blocks
- * may be flushed to disk during this call.
- *
- * Return value: The block, or NULL if an error occured.
- **/
-CamelBlock *camel_block_file_new_block(CamelBlockFile *bs)
-{
- CamelBlock *bl;
-
- CAMEL_BLOCK_FILE_LOCK(bs, root_lock);
-
- if (bs->root->free) {
- bl = camel_block_file_get_block(bs, bs->root->free);
- if (bl == NULL)
- goto fail;
- bs->root->free = ((camel_block_t *)bl->data)[0];
- } else {
- bl = camel_block_file_get_block(bs, bs->root->last);
- if (bl == NULL)
- goto fail;
- bs->root->last += CAMEL_BLOCK_SIZE;
- }
-
- bs->root_block->flags |= CAMEL_BLOCK_DIRTY;
-
- bl->flags |= CAMEL_BLOCK_DIRTY;
- memset(bl->data, 0, CAMEL_BLOCK_SIZE);
-fail:
- CAMEL_BLOCK_FILE_UNLOCK(bs, root_lock);
-
- return bl;
-}
-
-/**
- * camel_block_file_free_block:
- * @bs:
- * @id:
- *
- *
- **/
-int camel_block_file_free_block(CamelBlockFile *bs, camel_block_t id)
-{
- CamelBlock *bl;
-
- bl = camel_block_file_get_block(bs, id);
- if (bl == NULL)
- return -1;
-
- CAMEL_BLOCK_FILE_LOCK(bs, root_lock);
-
- ((camel_block_t *)bl->data)[0] = bs->root->free;
- bs->root->free = bl->id;
- bs->root_block->flags |= CAMEL_BLOCK_DIRTY;
- bl->flags |= CAMEL_BLOCK_DIRTY;
- camel_block_file_unref_block(bs, bl);
-
- CAMEL_BLOCK_FILE_UNLOCK(bs, root_lock);
-
- return 0;
-}
-
-/**
- * camel_block_file_get_block:
- * @bs:
- * @id:
- *
- * Retreive a block @id.
- *
- * Return value: The block, or NULL if blockid is invalid or a file error
- * occured.
- **/
-CamelBlock *camel_block_file_get_block(CamelBlockFile *bs, camel_block_t id)
-{
- CamelBlock *bl, *flush, *prev;
-
- /* Sanity check: Dont allow reading of root block (except before its been read)
- or blocks with invalid block id's */
- if ((bs->root == NULL && id != 0)
- || (bs->root != NULL && (id > bs->root->last || id == 0))
- || (id % bs->block_size) != 0) {
- errno = EINVAL;
- return NULL;
- }
-
- CAMEL_BLOCK_FILE_LOCK(bs, cache_lock);
-
- bl = g_hash_table_lookup(bs->blocks, GUINT_TO_POINTER(id));
-
- d(printf("Get block %08x: %s\n", id, bl?"cached":"must read"));
-
- if (bl == NULL) {
- /* LOCK io_lock */
- if (block_file_use(bs) == -1) {
- CAMEL_BLOCK_FILE_UNLOCK(bs, cache_lock);
- return NULL;
- }
-
- bl = g_malloc0(sizeof(*bl));
- bl->id = id;
- if (lseek(bs->fd, id, SEEK_SET) == -1 ||
- camel_read (bs->fd, bl->data, CAMEL_BLOCK_SIZE) == -1) {
- block_file_unuse(bs);
- CAMEL_BLOCK_FILE_UNLOCK(bs, cache_lock);
- g_free(bl);
- return NULL;
- }
-
- bs->block_cache_count++;
- g_hash_table_insert(bs->blocks, GUINT_TO_POINTER(bl->id), bl);
-
- /* flush old blocks */
- flush = (CamelBlock *)bs->block_cache.tailpred;
- prev = flush->prev;
- while (bs->block_cache_count > bs->block_cache_limit && prev) {
- if (flush->refcount == 0) {
- if (sync_block_nolock(bs, flush) != -1) {
- g_hash_table_remove(bs->blocks, GUINT_TO_POINTER(flush->id));
- e_dlist_remove((EDListNode *)flush);
- g_free(flush);
- bs->block_cache_count--;
- }
- }
- flush = prev;
- prev = prev->prev;
- }
- /* UNLOCK io_lock */
- block_file_unuse(bs);
- } else {
- e_dlist_remove((EDListNode *)bl);
- }
-
- e_dlist_addhead(&bs->block_cache, (EDListNode *)bl);
- bl->refcount++;
-
- CAMEL_BLOCK_FILE_UNLOCK(bs, cache_lock);
-
- d(printf("Got block %08x\n", id));
-
- return bl;
-}
-
-/**
- * camel_block_file_detach_block:
- * @bs:
- * @bl:
- *
- * Detatch a block from the block file's cache. The block should
- * be unref'd or attached when finished with. The block file will
- * perform no writes of this block or flushing of it if the cache
- * fills.
- **/
-void camel_block_file_detach_block(CamelBlockFile *bs, CamelBlock *bl)
-{
- CAMEL_BLOCK_FILE_LOCK(bs, cache_lock);
-
- g_hash_table_remove(bs->blocks, GUINT_TO_POINTER(bl->id));
- e_dlist_remove((EDListNode *)bl);
- bl->flags |= CAMEL_BLOCK_DETACHED;
-
- CAMEL_BLOCK_FILE_UNLOCK(bs, cache_lock);
-}
-
-/**
- * camel_block_file_attach_block:
- * @bs:
- * @bl:
- *
- * Reattach a block that has been detached.
- **/
-void camel_block_file_attach_block(CamelBlockFile *bs, CamelBlock *bl)
-{
- CAMEL_BLOCK_FILE_LOCK(bs, cache_lock);
-
- g_hash_table_insert(bs->blocks, GUINT_TO_POINTER(bl->id), bl);
- e_dlist_addtail(&bs->block_cache, (EDListNode *)bl);
- bl->flags &= ~CAMEL_BLOCK_DETACHED;
-
- CAMEL_BLOCK_FILE_UNLOCK(bs, cache_lock);
-}
-
-/**
- * camel_block_file_touch_block:
- * @bs:
- * @bl:
- *
- * Mark a block as dirty. The block will be written to disk if
- * it ever expires from the cache.
- **/
-void camel_block_file_touch_block(CamelBlockFile *bs, CamelBlock *bl)
-{
- CAMEL_BLOCK_FILE_LOCK(bs, root_lock);
- CAMEL_BLOCK_FILE_LOCK(bs, cache_lock);
-
- bl->flags |= CAMEL_BLOCK_DIRTY;
-
- if ((bs->root->flags & CAMEL_BLOCK_FILE_SYNC) && bl != bs->root_block) {
- d(printf("turning off sync flag\n"));
- bs->root->flags &= ~CAMEL_BLOCK_FILE_SYNC;
- bs->root_block->flags |= CAMEL_BLOCK_DIRTY;
- camel_block_file_sync_block(bs, bs->root_block);
- }
-
- CAMEL_BLOCK_FILE_UNLOCK(bs, cache_lock);
- CAMEL_BLOCK_FILE_UNLOCK(bs, root_lock);
-}
-
-/**
- * camel_block_file_unref_block:
- * @bs:
- * @bl:
- *
- * Mark a block as unused. If a block is used it will not be
- * written to disk, or flushed from memory.
- *
- * If a block is detatched and this is the last reference, the
- * block will be freed.
- **/
-void camel_block_file_unref_block(CamelBlockFile *bs, CamelBlock *bl)
-{
- CAMEL_BLOCK_FILE_LOCK(bs, cache_lock);
-
- if (bl->refcount == 1 && (bl->flags & CAMEL_BLOCK_DETACHED))
- g_free(bl);
- else
- bl->refcount--;
-
- CAMEL_BLOCK_FILE_UNLOCK(bs, cache_lock);
-}
-
-static int
-sync_block_nolock(CamelBlockFile *bs, CamelBlock *bl)
-{
- d(printf("Sync block %08x: %s\n", bl->id, (bl->flags & CAMEL_BLOCK_DIRTY)?"dirty":"clean"));
-
- if (bl->flags & CAMEL_BLOCK_DIRTY) {
- if (lseek(bs->fd, bl->id, SEEK_SET) == -1
- || write(bs->fd, bl->data, CAMEL_BLOCK_SIZE) != CAMEL_BLOCK_SIZE) {
- return -1;
- }
- bl->flags &= ~CAMEL_BLOCK_DIRTY;
- }
-
- return 0;
-}
-
-static int
-sync_nolock(CamelBlockFile *bs)
-{
- CamelBlock *bl, *bn;
- int work = FALSE;
-
- bl = (CamelBlock *)bs->block_cache.head;
- bn = bl->next;
- while (bn) {
- if (bl->flags & CAMEL_BLOCK_DIRTY) {
- work = TRUE;
- if (sync_block_nolock(bs, bl) == -1)
- return -1;
- }
- bl = bn;
- bn = bn->next;
- }
-
- if (!work
- && (bs->root_block->flags & CAMEL_BLOCK_DIRTY) == 0
- && (bs->root->flags & CAMEL_BLOCK_FILE_SYNC) != 0)
- return 0;
-
- d(printf("turning on sync flag\n"));
-
- bs->root->flags |= CAMEL_BLOCK_FILE_SYNC;
- bs->root_block->flags |= CAMEL_BLOCK_DIRTY;
-
- return sync_block_nolock(bs, bs->root_block);
-}
-
-/**
- * camel_block_file_sync_block:
- * @bs:
- * @bl:
- *
- * Flush a block to disk immediately. The block will only
- * be flushed to disk if it is marked as dirty (touched).
- *
- * Return value: -1 on io error.
- **/
-int camel_block_file_sync_block(CamelBlockFile *bs, CamelBlock *bl)
-{
- int ret;
-
- /* LOCK io_lock */
- if (block_file_use(bs) == -1)
- return -1;
-
- ret = sync_block_nolock(bs, bl);
-
- block_file_unuse(bs);
-
- return ret;
-}
-
-/**
- * camel_block_file_sync:
- * @bs:
- *
- * Sync all dirty blocks to disk, including the root block.
- *
- * Return value: -1 on io error.
- **/
-int camel_block_file_sync(CamelBlockFile *bs)
-{
- int ret;
-
- CAMEL_BLOCK_FILE_LOCK(bs, root_lock);
- CAMEL_BLOCK_FILE_LOCK(bs, cache_lock);
-
- /* LOCK io_lock */
- if (block_file_use(bs) == -1)
- ret = -1;
- else {
- ret = sync_nolock(bs);
- block_file_unuse(bs);
- }
-
- CAMEL_BLOCK_FILE_UNLOCK(bs, cache_lock);
- CAMEL_BLOCK_FILE_UNLOCK(bs, root_lock);
-
- return ret;
-}
-
-/* ********************************************************************** */
-
-struct _CamelKeyFilePrivate {
- struct _CamelKeyFilePrivate *next;
- struct _CamelKeyFilePrivate *prev;
-
- struct _CamelKeyFile *base;
- pthread_mutex_t lock;
- unsigned int deleted:1;
-};
-
-#define CAMEL_KEY_FILE_LOCK(kf, lock) (pthread_mutex_lock(&(kf)->priv->lock))
-#define CAMEL_KEY_FILE_TRYLOCK(kf, lock) (pthread_mutex_trylock(&(kf)->priv->lock))
-#define CAMEL_KEY_FILE_UNLOCK(kf, lock) (pthread_mutex_unlock(&(kf)->priv->lock))
-
-static pthread_mutex_t key_file_lock = PTHREAD_MUTEX_INITIALIZER;
-
-/* lru cache of block files */
-static EDList key_file_list = E_DLIST_INITIALISER(key_file_list);
-static EDList key_file_active_list = E_DLIST_INITIALISER(key_file_active_list);
-static int key_file_count = 0;
-static int key_file_threshhold = 10;
-
-static void
-camel_key_file_class_init(CamelKeyFileClass *klass)
-{
-}
-
-static void
-camel_key_file_init(CamelKeyFile *bs)
-{
- struct _CamelKeyFilePrivate *p;
-
- p = bs->priv = g_malloc0(sizeof(*bs->priv));
- p->base = bs;
-
- pthread_mutex_init(&p->lock, NULL);
-
- LOCK(key_file_lock);
- e_dlist_addhead(&key_file_list, (EDListNode *)p);
- UNLOCK(key_file_lock);
-}
-
-static void
-camel_key_file_finalise(CamelKeyFile *bs)
-{
- struct _CamelKeyFilePrivate *p = bs->priv;
-
- LOCK(key_file_lock);
- e_dlist_remove((EDListNode *)p);
-
- if (bs-> fp) {
- key_file_count--;
- fclose(bs->fp);
- }
-
- UNLOCK(key_file_lock);
-
- g_free(bs->path);
-
- pthread_mutex_destroy(&p->lock);
-
- g_free(p);
-}
-
-CamelType
-camel_key_file_get_type(void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register(camel_object_get_type(), "CamelKeyFile",
- sizeof (CamelKeyFile),
- sizeof (CamelKeyFileClass),
- (CamelObjectClassInitFunc) camel_key_file_class_init,
- NULL,
- (CamelObjectInitFunc) camel_key_file_init,
- (CamelObjectFinalizeFunc) camel_key_file_finalise);
- }
-
- return type;
-}
-
-/* 'use' a key file for io */
-static int
-key_file_use(CamelKeyFile *bs)
-{
- struct _CamelKeyFilePrivate *nw, *nn, *p = bs->priv;
- CamelKeyFile *bf;
- int err, fd;
- char *flag;
-
- /* We want to:
- remove file from active list
- lock it
-
- Then when done:
- unlock it
- add it back to end of active list
- */
-
- /* TODO: Check header on reset? */
-
- CAMEL_KEY_FILE_LOCK(bs, lock);
-
- if (bs->fp != NULL)
- return 0;
- else if (p->deleted) {
- CAMEL_KEY_FILE_UNLOCK(bs, lock);
- errno = ENOENT;
- return -1;
- } else
- d(printf("Turning key file online: '%s'\n", bs->path));
-
- if ((bs->flags & O_ACCMODE) == O_RDONLY)
- flag = "r";
- else
- flag = "a+";
-
- if ((fd = open(bs->path, bs->flags, 0600)) == -1
- || (bs->fp = fdopen(fd, flag)) == NULL) {
- err = errno;
- close(fd);
- CAMEL_KEY_FILE_UNLOCK(bs, lock);
- errno = err;
- return -1;
- }
-
- LOCK(key_file_lock);
- e_dlist_remove((EDListNode *)p);
- e_dlist_addtail(&key_file_active_list, (EDListNode *)p);
-
- key_file_count++;
-
- nw = (struct _CamelKeyFilePrivate *)key_file_list.head;
- nn = nw->next;
- while (key_file_count > key_file_threshhold && nn) {
- /* We never hit the current keyfile here, as its removed from the list first */
- bf = nw->base;
- if (bf->fp != NULL) {
- /* Need to trylock, as any of these lock levels might be trying
- to lock the key_file_lock, so we need to check and abort if so */
- if (CAMEL_BLOCK_FILE_TRYLOCK(bf, lock) == 0) {
- d(printf("Turning key file offline: %s\n", bf->path));
- fclose(bf->fp);
- bf->fp = NULL;
- key_file_count--;
- CAMEL_BLOCK_FILE_UNLOCK(bf, lock);
- }
- }
- nw = nn;
- nn = nw->next;
- }
-
- UNLOCK(key_file_lock);
-
- return 0;
-}
-
-static void
-key_file_unuse(CamelKeyFile *bs)
-{
- LOCK(key_file_lock);
- e_dlist_remove((EDListNode *)bs->priv);
- e_dlist_addtail(&key_file_list, (EDListNode *)bs->priv);
- UNLOCK(key_file_lock);
-
- CAMEL_KEY_FILE_UNLOCK(bs, lock);
-}
-
-/**
- * camel_key_file_new:
- * @path:
- * @flags: open flags
- * @version[]: Version string (header) of file. Currently
- * written but not checked.
- *
- * Create a new key file. A linked list of record blocks.
- *
- * Return value: A new key file, or NULL if the file could not
- * be opened/created/initialised.
- **/
-CamelKeyFile *
-camel_key_file_new(const char *path, int flags, const char version[8])
-{
- CamelKeyFile *kf;
- off_t last;
- int err;
-
- d(printf("New key file '%s'\n", path));
-
- kf = (CamelKeyFile *)camel_object_new(camel_key_file_get_type());
- kf->path = g_strdup(path);
- kf->fp = NULL;
- kf->flags = flags;
- kf->last = 8;
-
- if (key_file_use(kf) == -1) {
- camel_object_unref((CamelObject *)kf);
- kf = NULL;
- } else {
- fseek(kf->fp, 0, SEEK_END);
- last = ftell(kf->fp);
- if (last == 0) {
- fwrite(version, 8, 1, kf->fp);
- last += 8;
- }
- kf->last = last;
-
- err = ferror(kf->fp);
- key_file_unuse(kf);
-
- /* we only need these flags on first open */
- kf->flags &= ~(O_CREAT|O_EXCL|O_TRUNC);
-
- if (err) {
- camel_object_unref((CamelObject *)kf);
- kf = NULL;
- }
- }
-
- return kf;
-}
-
-int
-camel_key_file_rename(CamelKeyFile *kf, const char *path)
-{
- int ret;
- struct stat st;
- int err;
-
- CAMEL_KEY_FILE_LOCK(kf, lock);
-
- ret = rename(kf->path, path);
- if (ret == -1) {
- /* Maybe the rename actually worked */
- err = errno;
- if (stat(path, &st) == 0
- && stat(kf->path, &st) == -1
- && errno == ENOENT)
- ret = 0;
- errno = err;
- }
-
- if (ret != -1) {
- g_free(kf->path);
- kf->path = g_strdup(path);
- }
-
- CAMEL_KEY_FILE_UNLOCK(kf, lock);
-
- return ret;
-}
-
-int
-camel_key_file_delete(CamelKeyFile *kf)
-{
- int ret;
- struct _CamelKeyFilePrivate *p = kf->priv;
-
- CAMEL_KEY_FILE_LOCK(kf, lock);
-
- if (kf->fp) {
- LOCK(key_file_lock);
- key_file_count--;
- UNLOCK(key_file_lock);
- fclose(kf->fp);
- kf->fp = NULL;
- }
-
- p->deleted = TRUE;
- ret = unlink(kf->path);
-
- CAMEL_KEY_FILE_UNLOCK(kf, lock);
-
- return ret;
-
-}
-
-/**
- * camel_key_file_write:
- * @kf:
- * @parent:
- * @len:
- * @records:
- *
- * Write a new list of records to the key file.
- *
- * Return value: -1 on io error. The key file will remain unchanged.
- **/
-int
-camel_key_file_write(CamelKeyFile *kf, camel_block_t *parent, size_t len, camel_key_t *records)
-{
- camel_block_t next;
- guint32 size;
- int ret = -1;
-
- d(printf("write key %08x len = %d\n", *parent, len));
-
- if (len == 0) {
- d(printf(" new parent = %08x\n", *parent));
- return 0;
- }
-
- /* LOCK */
- if (key_file_use(kf) == -1)
- return -1;
-
- size = len;
-
- /* FIXME: Use io util functions? */
- next = kf->last;
- fseek(kf->fp, kf->last, SEEK_SET);
- fwrite(parent, sizeof(*parent), 1, kf->fp);
- fwrite(&size, sizeof(size), 1, kf->fp);
- fwrite(records, sizeof(records[0]), len, kf->fp);
-
- if (ferror(kf->fp)) {
- clearerr(kf->fp);
- } else {
- kf->last = ftell(kf->fp);
- *parent = next;
- ret = len;
- }
-
- /* UNLOCK */
- key_file_unuse(kf);
-
- d(printf(" new parent = %08x\n", *parent));
-
- return ret;
-}
-
-/**
- * camel_key_file_read:
- * @kf:
- * @start: The record pointer. This will be set to the next record pointer on success.
- * @len: Number of records read, if != NULL.
- * @records: Records, allocated, must be freed with g_free, if != NULL.
- *
- * Read the next block of data from the key file. Returns the number of
- * records.
- *
- * Return value: -1 on io error.
- **/
-int
-camel_key_file_read(CamelKeyFile *kf, camel_block_t *start, size_t *len, camel_key_t **records)
-{
- guint32 size;
- long pos = *start;
- camel_block_t next;
- int ret = -1;
-
- if (pos == 0)
- return 0;
-
- /* LOCK */
- if (key_file_use(kf) == -1)
- return -1;
-
- if (fseek(kf->fp, pos, SEEK_SET) == -1
- || fread(&next, sizeof(next), 1, kf->fp) != 1
- || fread(&size, sizeof(size), 1, kf->fp) != 1
- || size > 1024) {
- clearerr(kf->fp);
- goto fail;
- }
-
- if (len)
- *len = size;
-
- if (records) {
- camel_key_t *keys = g_malloc(size * sizeof(camel_key_t));
-
- if (fread(keys, sizeof(camel_key_t), size, kf->fp) != size) {
- g_free(keys);
- goto fail;
- }
- *records = keys;
- }
-
- *start = next;
-
- ret = 0;
-fail:
- /* UNLOCK */
- key_file_unuse(kf);
-
- return ret;
-}
diff --git a/camel/camel-block-file.h b/camel/camel-block-file.h
deleted file mode 100644
index eec0ee26f9..0000000000
--- a/camel/camel-block-file.h
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Copyright (C) 2001 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef _CAMEL_BLOCK_FILE_H
-#define _CAMEL_BLOCK_FILE_H
-
-#include <camel/camel-object.h>
-#include <glib.h>
-#include <e-util/e-msgport.h>
-#include <stdio.h>
-
-typedef guint32 camel_block_t; /* block offset, absolute, bottom BLOCK_SIZE_BITS always 0 */
-typedef guint32 camel_key_t; /* this is a bitfield of (block offset:BLOCK_SIZE_BITS) */
-
-typedef struct _CamelBlockRoot CamelBlockRoot;
-typedef struct _CamelBlock CamelBlock;
-typedef struct _CamelBlockFile CamelBlockFile;
-typedef struct _CamelBlockFileClass CamelBlockFileClass;
-
-#define CAMEL_BLOCK_FILE_SYNC (1<<0)
-
-#define CAMEL_BLOCK_SIZE (1024)
-#define CAMEL_BLOCK_SIZE_BITS (10) /* # bits to contain block_size bytes */
-
-#define CAMEL_BLOCK_DIRTY (1<<0)
-#define CAMEL_BLOCK_DETACHED (1<<1)
-
-struct _CamelBlockRoot {
- char version[8]; /* version number */
-
- guint32 flags; /* flags for file */
- guint32 block_size; /* block size of this file */
- camel_block_t free; /* free block list */
- camel_block_t last; /* pointer to end of blocks */
-
- /* subclasses tack on, but no more than CAMEL_BLOCK_SIZE! */
-};
-
-/* LRU cache of blocks */
-struct _CamelBlock {
- struct _CamelBlock *next;
- struct _CamelBlock *prev;
-
- camel_block_t id;
- guint32 flags;
- guint32 refcount;
- guint32 align00;
-
- unsigned char data[CAMEL_BLOCK_SIZE];
-};
-
-struct _CamelBlockFile {
- CamelObject parent;
-
- struct _CamelBlockFilePrivate *priv;
-
- char version[8];
- char *path;
- int flags;
-
- int fd;
- size_t block_size;
-
- CamelBlockRoot *root;
- CamelBlock *root_block;
-
- /* make private? */
- int block_cache_limit;
- int block_cache_count;
- EDList block_cache;
- GHashTable *blocks;
-};
-
-struct _CamelBlockFileClass {
- CamelObjectClass parent;
-
- int (*validate_root)(CamelBlockFile *);
- int (*init_root)(CamelBlockFile *);
-};
-
-CamelType camel_block_file_get_type(void);
-
-CamelBlockFile *camel_block_file_new(const char *path, int flags, const char version[8], size_t block_size);
-int camel_block_file_rename(CamelBlockFile *bs, const char *path);
-int camel_block_file_delete(CamelBlockFile *kf);
-
-CamelBlock *camel_block_file_new_block(CamelBlockFile *bs);
-int camel_block_file_free_block(CamelBlockFile *bs, camel_block_t id);
-CamelBlock *camel_block_file_get_block(CamelBlockFile *bs, camel_block_t id);
-void camel_block_file_detach_block(CamelBlockFile *bs, CamelBlock *bl);
-void camel_block_file_attach_block(CamelBlockFile *bs, CamelBlock *bl);
-void camel_block_file_touch_block(CamelBlockFile *bs, CamelBlock *bl);
-void camel_block_file_unref_block(CamelBlockFile *bs, CamelBlock *bl);
-int camel_block_file_sync_block(CamelBlockFile *bs, CamelBlock *bl);
-int camel_block_file_sync(CamelBlockFile *bs);
-
-/* ********************************************************************** */
-
-typedef struct _CamelKeyFile CamelKeyFile;
-typedef struct _CamelKeyFileClass CamelKeyFileClass;
-
-struct _CamelKeyFile {
- CamelObject parent;
-
- struct _CamelKeyFilePrivate *priv;
-
- FILE *fp;
- char *path;
- int flags;
- off_t last;
-};
-
-struct _CamelKeyFileClass {
- CamelObjectClass parent;
-};
-
-CamelType camel_key_file_get_type(void);
-
-CamelKeyFile * camel_key_file_new(const char *path, int flags, const char version[8]);
-int camel_key_file_rename(CamelKeyFile *kf, const char *path);
-int camel_key_file_delete(CamelKeyFile *kf);
-
-int camel_key_file_write(CamelKeyFile *kf, camel_block_t *parent, size_t len, camel_key_t *records);
-int camel_key_file_read(CamelKeyFile *kf, camel_block_t *start, size_t *len, camel_key_t **records);
-
-
-#endif /* ! _CAMEL_BLOCK_FILE_H */
diff --git a/camel/camel-certdb.c b/camel/camel-certdb.c
deleted file mode 100644
index 8df6f2e578..0000000000
--- a/camel/camel-certdb.c
+++ /dev/null
@@ -1,665 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2002-2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <glib.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <pthread.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-
-#include "camel-certdb.h"
-#include "camel-private.h"
-
-#include <camel/camel-file-utils.h>
-
-#include <e-util/e-memory.h>
-
-
-#define CAMEL_CERTDB_GET_CLASS(db) ((CamelCertDBClass *) CAMEL_OBJECT_GET_CLASS (db))
-
-#define CAMEL_CERTDB_VERSION 0x100
-
-static void camel_certdb_class_init (CamelCertDBClass *klass);
-static void camel_certdb_init (CamelCertDB *certdb);
-static void camel_certdb_finalize (CamelObject *obj);
-
-static int certdb_header_load (CamelCertDB *certdb, FILE *istream);
-static int certdb_header_save (CamelCertDB *certdb, FILE *ostream);
-static CamelCert *certdb_cert_load (CamelCertDB *certdb, FILE *istream);
-static int certdb_cert_save (CamelCertDB *certdb, CamelCert *cert, FILE *ostream);
-static CamelCert *certdb_cert_new (CamelCertDB *certdb);
-static void certdb_cert_free (CamelCertDB *certdb, CamelCert *cert);
-
-static const char *cert_get_string (CamelCertDB *certdb, CamelCert *cert, int string);
-static void cert_set_string (CamelCertDB *certdb, CamelCert *cert, int string, const char *value);
-
-
-static CamelObjectClass *parent_class = NULL;
-
-
-CamelType
-camel_certdb_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_object_get_type (),
- "CamelCertDB",
- sizeof (CamelCertDB),
- sizeof (CamelCertDBClass),
- (CamelObjectClassInitFunc) camel_certdb_class_init,
- NULL,
- (CamelObjectInitFunc) camel_certdb_init,
- (CamelObjectFinalizeFunc) camel_certdb_finalize);
- }
-
- return type;
-}
-
-
-static void
-camel_certdb_class_init (CamelCertDBClass *klass)
-{
- parent_class = camel_type_get_global_classfuncs (camel_object_get_type ());
-
- klass->header_load = certdb_header_load;
- klass->header_save = certdb_header_save;
-
- klass->cert_new = certdb_cert_new;
- klass->cert_load = certdb_cert_load;
- klass->cert_save = certdb_cert_save;
- klass->cert_free = certdb_cert_free;
- klass->cert_get_string = cert_get_string;
- klass->cert_set_string = cert_set_string;
-}
-
-static void
-camel_certdb_init (CamelCertDB *certdb)
-{
- certdb->priv = g_malloc (sizeof (struct _CamelCertDBPrivate));
-
- certdb->filename = NULL;
- certdb->version = CAMEL_CERTDB_VERSION;
- certdb->saved_certs = 0;
-
- certdb->cert_size = sizeof (CamelCert);
-
- certdb->cert_chunks = NULL;
-
- certdb->certs = g_ptr_array_new ();
- certdb->cert_hash = g_hash_table_new (g_str_hash, g_str_equal);
-
- certdb->priv->db_lock = g_mutex_new ();
- certdb->priv->io_lock = g_mutex_new ();
- certdb->priv->alloc_lock = g_mutex_new ();
- certdb->priv->ref_lock = g_mutex_new ();
-}
-
-static void
-camel_certdb_finalize (CamelObject *obj)
-{
- CamelCertDB *certdb = (CamelCertDB *) obj;
- struct _CamelCertDBPrivate *p;
-
- p = certdb->priv;
-
- if (certdb->flags & CAMEL_CERTDB_DIRTY)
- camel_certdb_save (certdb);
-
- camel_certdb_clear (certdb);
- g_ptr_array_free (certdb->certs, TRUE);
- g_hash_table_destroy (certdb->cert_hash);
-
- g_free (certdb->filename);
-
- if (certdb->cert_chunks)
- e_memchunk_destroy (certdb->cert_chunks);
-
- g_mutex_free (p->db_lock);
- g_mutex_free (p->io_lock);
- g_mutex_free (p->alloc_lock);
- g_mutex_free (p->ref_lock);
-
- g_free (p);
-}
-
-
-CamelCertDB *
-camel_certdb_new (void)
-{
- return (CamelCertDB *) camel_object_new (camel_certdb_get_type ());
-}
-
-
-static CamelCertDB *default_certdb = NULL;
-static pthread_mutex_t default_certdb_lock = PTHREAD_MUTEX_INITIALIZER;
-
-
-void
-camel_certdb_set_default (CamelCertDB *certdb)
-{
- pthread_mutex_lock (&default_certdb_lock);
-
- if (default_certdb)
- camel_object_unref (default_certdb);
-
- if (certdb)
- camel_object_ref (certdb);
-
- default_certdb = certdb;
-
- pthread_mutex_unlock (&default_certdb_lock);
-}
-
-
-CamelCertDB *
-camel_certdb_get_default (void)
-{
- CamelCertDB *certdb;
-
- pthread_mutex_lock (&default_certdb_lock);
-
- if (default_certdb)
- camel_object_ref (default_certdb);
-
- certdb = default_certdb;
-
- pthread_mutex_unlock (&default_certdb_lock);
-
- return certdb;
-}
-
-
-void
-camel_certdb_set_filename (CamelCertDB *certdb, const char *filename)
-{
- g_return_if_fail (CAMEL_IS_CERTDB (certdb));
- g_return_if_fail (filename != NULL);
-
- CAMEL_CERTDB_LOCK (certdb, db_lock);
-
- g_free (certdb->filename);
- certdb->filename = g_strdup (filename);
-
- CAMEL_CERTDB_UNLOCK (certdb, db_lock);
-}
-
-
-static int
-certdb_header_load (CamelCertDB *certdb, FILE *istream)
-{
- if (camel_file_util_decode_uint32 (istream, &certdb->version) == -1)
- return -1;
- if (camel_file_util_decode_uint32 (istream, &certdb->saved_certs) == -1)
- return -1;
-
- return 0;
-}
-
-static CamelCert *
-certdb_cert_load (CamelCertDB *certdb, FILE *istream)
-{
- CamelCert *cert;
-
- cert = camel_certdb_cert_new (certdb);
-
- if (camel_file_util_decode_string (istream, &cert->issuer) == -1)
- goto error;
- if (camel_file_util_decode_string (istream, &cert->subject) == -1)
- goto error;
- if (camel_file_util_decode_string (istream, &cert->hostname) == -1)
- goto error;
- if (camel_file_util_decode_string (istream, &cert->fingerprint) == -1)
- goto error;
- if (camel_file_util_decode_uint32 (istream, &cert->trust) == -1)
- goto error;
-
- return cert;
-
- error:
-
- camel_certdb_cert_unref (certdb, cert);
-
- return NULL;
-}
-
-int
-camel_certdb_load (CamelCertDB *certdb)
-{
- CamelCert *cert;
- FILE *in;
- int i;
-
- g_return_val_if_fail (CAMEL_IS_CERTDB (certdb), -1);
- g_return_val_if_fail (certdb->filename, -1);
-
- in = fopen (certdb->filename, "r");
- if (in == NULL)
- return -1;
-
- CAMEL_CERTDB_LOCK (certdb, io_lock);
- if (CAMEL_CERTDB_GET_CLASS (certdb)->header_load (certdb, in) == -1)
- goto error;
-
- for (i = 0; i < certdb->saved_certs; i++) {
- cert = CAMEL_CERTDB_GET_CLASS (certdb)->cert_load (certdb, in);
-
- if (cert == NULL)
- goto error;
-
- camel_certdb_add (certdb, cert);
- }
-
- CAMEL_CERTDB_UNLOCK (certdb, io_lock);
-
- if (fclose (in) != 0)
- return -1;
-
- certdb->flags &= ~CAMEL_CERTDB_DIRTY;
-
- return 0;
-
- error:
-
- g_warning ("Cannot load certificate database: %s", strerror (ferror (in)));
-
- CAMEL_CERTDB_UNLOCK (certdb, io_lock);
-
- fclose (in);
-
- return -1;
-}
-
-static int
-certdb_header_save (CamelCertDB *certdb, FILE *ostream)
-{
- if (camel_file_util_encode_uint32 (ostream, certdb->version) == -1)
- return -1;
- if (camel_file_util_encode_uint32 (ostream, certdb->saved_certs) == -1)
- return -1;
-
- return 0;
-}
-
-static int
-certdb_cert_save (CamelCertDB *certdb, CamelCert *cert, FILE *ostream)
-{
- if (camel_file_util_encode_string (ostream, cert->issuer) == -1)
- return -1;
- if (camel_file_util_encode_string (ostream, cert->subject) == -1)
- return -1;
- if (camel_file_util_encode_string (ostream, cert->hostname) == -1)
- return -1;
- if (camel_file_util_encode_string (ostream, cert->fingerprint) == -1)
- return -1;
- if (camel_file_util_encode_uint32 (ostream, cert->trust) == -1)
- return -1;
-
- return 0;
-}
-
-int
-camel_certdb_save (CamelCertDB *certdb)
-{
- CamelCert *cert;
- char *filename;
- int fd, i;
- FILE *out;
-
- g_return_val_if_fail (CAMEL_IS_CERTDB (certdb), -1);
- g_return_val_if_fail (certdb->filename, -1);
-
- filename = alloca (strlen (certdb->filename) + 4);
- sprintf (filename, "%s~", certdb->filename);
-
- fd = open (filename, O_WRONLY | O_CREAT | O_TRUNC, 0600);
- if (fd == -1)
- return -1;
-
- out = fdopen (fd, "w");
- if (out == NULL) {
- i = errno;
- close (fd);
- unlink (filename);
- errno = i;
- return -1;
- }
-
- CAMEL_CERTDB_LOCK (certdb, io_lock);
-
- certdb->saved_certs = certdb->certs->len;
- if (CAMEL_CERTDB_GET_CLASS (certdb)->header_save (certdb, out) == -1)
- goto error;
-
- for (i = 0; i < certdb->saved_certs; i++) {
- cert = (CamelCert *) certdb->certs->pdata[i];
-
- if (CAMEL_CERTDB_GET_CLASS (certdb)->cert_save (certdb, cert, out) == -1)
- goto error;
- }
-
- CAMEL_CERTDB_UNLOCK (certdb, io_lock);
-
- if (fflush (out) != 0 || fsync (fileno (out)) == -1) {
- i = errno;
- fclose (out);
- unlink (filename);
- errno = i;
- return -1;
- }
-
- if (fclose (out) != 0) {
- i = errno;
- unlink (filename);
- errno = i;
- return -1;
- }
-
- if (rename (filename, certdb->filename) == -1) {
- i = errno;
- unlink (filename);
- errno = i;
- return -1;
- }
-
- certdb->flags &= ~CAMEL_CERTDB_DIRTY;
-
- return 0;
-
- error:
-
- g_warning ("Cannot save certificate database: %s", strerror (ferror (out)));
-
- CAMEL_CERTDB_UNLOCK (certdb, io_lock);
-
- i = errno;
- fclose (out);
- unlink (filename);
- errno = i;
-
- return -1;
-}
-
-void
-camel_certdb_touch (CamelCertDB *certdb)
-{
- g_return_if_fail (CAMEL_IS_CERTDB (certdb));
-
- certdb->flags |= CAMEL_CERTDB_DIRTY;
-}
-
-CamelCert *
-camel_certdb_get_cert (CamelCertDB *certdb, const char *fingerprint)
-{
- CamelCert *cert;
-
- g_return_val_if_fail (CAMEL_IS_CERTDB (certdb), NULL);
-
- CAMEL_CERTDB_LOCK (certdb, db_lock);
-
- cert = g_hash_table_lookup (certdb->cert_hash, fingerprint);
- if (cert)
- camel_certdb_cert_ref (certdb, cert);
-
- CAMEL_CERTDB_UNLOCK (certdb, db_lock);
-
- return cert;
-}
-
-void
-camel_certdb_add (CamelCertDB *certdb, CamelCert *cert)
-{
- g_return_if_fail (CAMEL_IS_CERTDB (certdb));
-
- CAMEL_CERTDB_LOCK (certdb, db_lock);
-
- if (g_hash_table_lookup (certdb->cert_hash, cert->fingerprint)) {
- CAMEL_CERTDB_UNLOCK (certdb, db_lock);
- return;
- }
-
- camel_certdb_cert_ref (certdb, cert);
- g_ptr_array_add (certdb->certs, cert);
- g_hash_table_insert (certdb->cert_hash, cert->fingerprint, cert);
-
- certdb->flags |= CAMEL_CERTDB_DIRTY;
-
- CAMEL_CERTDB_UNLOCK (certdb, db_lock);
-}
-
-void
-camel_certdb_remove (CamelCertDB *certdb, CamelCert *cert)
-{
- g_return_if_fail (CAMEL_IS_CERTDB (certdb));
-
- CAMEL_CERTDB_LOCK (certdb, db_lock);
-
- if (g_hash_table_lookup (certdb->cert_hash, cert->fingerprint)) {
- g_hash_table_remove (certdb->cert_hash, cert->fingerprint);
- g_ptr_array_remove (certdb->certs, cert);
- camel_certdb_cert_unref (certdb, cert);
-
- certdb->flags |= CAMEL_CERTDB_DIRTY;
- }
-
- CAMEL_CERTDB_UNLOCK (certdb, db_lock);
-}
-
-static CamelCert *
-certdb_cert_new (CamelCertDB *certdb)
-{
- CamelCert *cert;
-
- if (certdb->cert_chunks)
- cert = e_memchunk_alloc0 (certdb->cert_chunks);
- else
- cert = g_malloc0 (certdb->cert_size);
-
- cert->refcount = 1;
-
- return cert;
-}
-
-CamelCert *
-camel_certdb_cert_new (CamelCertDB *certdb)
-{
- CamelCert *cert;
-
- g_return_val_if_fail (CAMEL_IS_CERTDB (certdb), NULL);
-
- CAMEL_CERTDB_LOCK (certdb, alloc_lock);
-
- cert = CAMEL_CERTDB_GET_CLASS (certdb)->cert_new (certdb);
-
- CAMEL_CERTDB_UNLOCK (certdb, alloc_lock);
-
- return cert;
-}
-
-void
-camel_certdb_cert_ref (CamelCertDB *certdb, CamelCert *cert)
-{
- g_return_if_fail (CAMEL_IS_CERTDB (certdb));
- g_return_if_fail (cert != NULL);
-
- CAMEL_CERTDB_LOCK (certdb, ref_lock);
- cert->refcount++;
- CAMEL_CERTDB_UNLOCK (certdb, ref_lock);
-}
-
-static void
-certdb_cert_free (CamelCertDB *certdb, CamelCert *cert)
-{
- g_free (cert->issuer);
- g_free (cert->subject);
- g_free (cert->hostname);
- g_free (cert->fingerprint);
- if (cert->rawcert)
- g_byte_array_free(cert->rawcert, TRUE);
-}
-
-void
-camel_certdb_cert_unref (CamelCertDB *certdb, CamelCert *cert)
-{
- g_return_if_fail (CAMEL_IS_CERTDB (certdb));
- g_return_if_fail (cert != NULL);
-
- CAMEL_CERTDB_LOCK (certdb, ref_lock);
-
- if (cert->refcount <= 1) {
- CAMEL_CERTDB_GET_CLASS (certdb)->cert_free (certdb, cert);
- if (certdb->cert_chunks)
- e_memchunk_free (certdb->cert_chunks, cert);
- else
- g_free (cert);
- } else {
- cert->refcount--;
- }
-
- CAMEL_CERTDB_UNLOCK (certdb, ref_lock);
-}
-
-
-static gboolean
-cert_remove (gpointer key, gpointer value, gpointer user_data)
-{
- return TRUE;
-}
-
-void
-camel_certdb_clear (CamelCertDB *certdb)
-{
- CamelCert *cert;
- int i;
-
- g_return_if_fail (CAMEL_IS_CERTDB (certdb));
-
- CAMEL_CERTDB_LOCK (certdb, db_lock);
-
- g_hash_table_foreach_remove (certdb->cert_hash, cert_remove, NULL);
- for (i = 0; i < certdb->certs->len; i++) {
- cert = (CamelCert *) certdb->certs->pdata[i];
- camel_certdb_cert_unref (certdb, cert);
- }
-
- certdb->saved_certs = 0;
- g_ptr_array_set_size (certdb->certs, 0);
- certdb->flags |= CAMEL_CERTDB_DIRTY;
-
- CAMEL_CERTDB_UNLOCK (certdb, db_lock);
-}
-
-
-static const char *
-cert_get_string (CamelCertDB *certdb, CamelCert *cert, int string)
-{
- switch (string) {
- case CAMEL_CERT_STRING_ISSUER:
- return cert->issuer;
- case CAMEL_CERT_STRING_SUBJECT:
- return cert->subject;
- case CAMEL_CERT_STRING_HOSTNAME:
- return cert->hostname;
- case CAMEL_CERT_STRING_FINGERPRINT:
- return cert->fingerprint;
- default:
- return NULL;
- }
-}
-
-
-const char *
-camel_cert_get_string (CamelCertDB *certdb, CamelCert *cert, int string)
-{
- g_return_val_if_fail (CAMEL_IS_CERTDB (certdb), NULL);
- g_return_val_if_fail (cert != NULL, NULL);
-
- /* FIXME: do locking? */
-
- return CAMEL_CERTDB_GET_CLASS (certdb)->cert_get_string (certdb, cert, string);
-}
-
-static void
-cert_set_string (CamelCertDB *certdb, CamelCert *cert, int string, const char *value)
-{
- switch (string) {
- case CAMEL_CERT_STRING_ISSUER:
- g_free (cert->issuer);
- cert->issuer = g_strdup (value);
- break;
- case CAMEL_CERT_STRING_SUBJECT:
- g_free (cert->subject);
- cert->subject = g_strdup (value);
- break;
- case CAMEL_CERT_STRING_HOSTNAME:
- g_free (cert->hostname);
- cert->hostname = g_strdup (value);
- break;
- case CAMEL_CERT_STRING_FINGERPRINT:
- g_free (cert->fingerprint);
- cert->fingerprint = g_strdup (value);
- break;
- default:
- break;
- }
-}
-
-
-void
-camel_cert_set_string (CamelCertDB *certdb, CamelCert *cert, int string, const char *value)
-{
- g_return_if_fail (CAMEL_IS_CERTDB (certdb));
- g_return_if_fail (cert != NULL);
-
- /* FIXME: do locking? */
-
- CAMEL_CERTDB_GET_CLASS (certdb)->cert_set_string (certdb, cert, string, value);
-}
-
-
-CamelCertTrust
-camel_cert_get_trust (CamelCertDB *certdb, CamelCert *cert)
-{
- g_return_val_if_fail (CAMEL_IS_CERTDB (certdb), CAMEL_CERT_TRUST_UNKNOWN);
- g_return_val_if_fail (cert != NULL, CAMEL_CERT_TRUST_UNKNOWN);
-
- return cert->trust;
-}
-
-
-void
-camel_cert_set_trust (CamelCertDB *certdb, CamelCert *cert, CamelCertTrust trust)
-{
- g_return_if_fail (CAMEL_IS_CERTDB (certdb));
- g_return_if_fail (cert != NULL);
-
- cert->trust = trust;
-}
diff --git a/camel/camel-certdb.h b/camel/camel-certdb.h
deleted file mode 100644
index 60429edcd1..0000000000
--- a/camel/camel-certdb.h
+++ /dev/null
@@ -1,154 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2002 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifndef __CAMEL_CERTDB_H__
-#define __CAMEL_CERTDB_H__
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <stdio.h>
-#include <camel/camel-object.h>
-
-#define CAMEL_CERTDB_TYPE (camel_certdb_get_type ())
-#define CAMEL_CERTDB(obj) (CAMEL_CHECK_CAST (obj, camel_certdb_get_type (), CamelCertDB))
-#define CAMEL_CERTDB_CLASS(klass) (CAMEL_CHECK_CLASS_CAST (klass, camel_certdb_get_type (), CamelCertDBClass))
-#define CAMEL_IS_CERTDB(obj) (CAMEL_CHECK_TYPE (obj, camel_certdb_get_type ()))
-
-typedef struct _CamelCertDB CamelCertDB;
-typedef struct _CamelCertDBClass CamelCertDBClass;
-
-enum {
- CAMEL_CERTDB_DIRTY = (1 << 0),
-};
-
-enum {
- CAMEL_CERT_STRING_ISSUER,
- CAMEL_CERT_STRING_SUBJECT,
- CAMEL_CERT_STRING_HOSTNAME,
- CAMEL_CERT_STRING_FINGERPRINT,
-};
-
-typedef enum {
- CAMEL_CERT_TRUST_UNKNOWN,
- CAMEL_CERT_TRUST_NEVER,
- CAMEL_CERT_TRUST_MARGINAL,
- CAMEL_CERT_TRUST_FULLY,
- CAMEL_CERT_TRUST_ULTIMATE,
-} CamelCertTrust;
-
-typedef struct {
- guint32 refcount;
-
- char *issuer;
- char *subject;
- char *hostname;
- char *fingerprint;
-
- CamelCertTrust trust;
- GByteArray *rawcert;
-} CamelCert;
-
-struct _CamelCertDB {
- CamelObject parent_object;
- struct _CamelCertDBPrivate *priv;
-
- char *filename;
- guint32 version;
- guint32 saved_certs;
- guint32 flags;
-
- guint32 cert_size;
-
- struct _EMemChunk *cert_chunks;
-
- GPtrArray *certs;
- GHashTable *cert_hash;
-};
-
-struct _CamelCertDBClass {
- CamelObjectClass parent_class;
-
- int (*header_load) (CamelCertDB *certdb, FILE *istream);
- int (*header_save) (CamelCertDB *certdb, FILE *ostream);
-
- CamelCert * (*cert_load) (CamelCertDB *certdb, FILE *istream);
- int (*cert_save) (CamelCertDB *certdb, CamelCert *cert, FILE *ostream);
-
- CamelCert * (*cert_new) (CamelCertDB *certdb);
- void (*cert_free) (CamelCertDB *certdb, CamelCert *cert);
-
- const char * (*cert_get_string) (CamelCertDB *certdb, CamelCert *cert, int string);
- void (*cert_set_string) (CamelCertDB *certdb, CamelCert *cert, int string, const char *value);
-};
-
-
-CamelType camel_certdb_get_type (void);
-
-CamelCertDB *camel_certdb_new (void);
-
-void camel_certdb_set_default (CamelCertDB *certdb);
-CamelCertDB *camel_certdb_get_default (void);
-
-void camel_certdb_set_filename (CamelCertDB *certdb, const char *filename);
-
-int camel_certdb_load (CamelCertDB *certdb);
-int camel_certdb_save (CamelCertDB *certdb);
-
-void camel_certdb_touch (CamelCertDB *certdb);
-
-CamelCert *camel_certdb_get_cert (CamelCertDB *certdb, const char *fingerprint);
-
-void camel_certdb_add (CamelCertDB *certdb, CamelCert *cert);
-void camel_certdb_remove (CamelCertDB *certdb, CamelCert *cert);
-
-CamelCert *camel_certdb_cert_new (CamelCertDB *certdb);
-void camel_certdb_cert_ref (CamelCertDB *certdb, CamelCert *cert);
-void camel_certdb_cert_unref (CamelCertDB *certdb, CamelCert *cert);
-
-void camel_certdb_clear (CamelCertDB *certdb);
-
-
-const char *camel_cert_get_string (CamelCertDB *certdb, CamelCert *cert, int string);
-void camel_cert_set_string (CamelCertDB *certdb, CamelCert *cert, int string, const char *value);
-
-#define camel_cert_get_issuer(certdb,cert) camel_cert_get_string (certdb, cert, CAMEL_CERT_STRING_ISSUER)
-#define camel_cert_get_subject(certdb,cert) camel_cert_get_string (certdb, cert, CAMEL_CERT_STRING_SUBJECT)
-#define camel_cert_get_hostname(certdb,cert) camel_cert_get_string (certdb, cert, CAMEL_CERT_STRING_HOSTNAME)
-#define camel_cert_get_fingerprint(certdb,cert) camel_cert_get_string (certdb, cert, CAMEL_CERT_STRING_FINGERPRINT)
-
-#define camel_cert_set_issuer(certdb,cert,issuer) camel_cert_set_string (certdb, cert, CAMEL_CERT_STRING_ISSUER, issuer)
-#define camel_cert_set_subject(certdb,cert,subject) camel_cert_set_string (certdb, cert, CAMEL_CERT_STRING_SUBJECT, subject)
-#define camel_cert_set_hostname(certdb,cert,hostname) camel_cert_set_string (certdb, cert, CAMEL_CERT_STRING_HOSTNAME, hostname)
-#define camel_cert_set_fingerprint(certdb,cert,fingerprint) camel_cert_set_string (certdb, cert, CAMEL_CERT_STRING_FINGERPRINT, fingerprint)
-
-CamelCertTrust camel_cert_get_trust (CamelCertDB *certdb, CamelCert *cert);
-void camel_cert_set_trust (CamelCertDB *certdb, CamelCert *cert, CamelCertTrust trust);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __CAMEL_CERTDB_H__ */
diff --git a/camel/camel-charset-map-private.h b/camel/camel-charset-map-private.h
deleted file mode 100644
index 35556db87e..0000000000
--- a/camel/camel-charset-map-private.h
+++ /dev/null
@@ -1,621 +0,0 @@
-/* This file is automatically generated: DO NOT EDIT */
-
-static unsigned char m000[256] = {
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xbf, 0xbf, 0xbf, 0xbf,
- 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf,
- 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf,
- 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf,
- 0xbf, 0xbf, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f,
- 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3,
- 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3,
- 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3,
- 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3,
- 0xff, 0x80, 0xc0, 0xe0, 0xc3, 0xc0, 0xe0, 0xf3,
- 0xe3, 0xec, 0x80, 0xe0, 0xe0, 0xf3, 0xc0, 0xc2,
- 0xef, 0xe0, 0xec, 0xe0, 0xc3, 0xc0, 0xc0, 0xec,
- 0xc3, 0xc0, 0x80, 0xe0, 0xc0, 0xe0, 0xc0, 0x80,
- 0x80, 0x83, 0x83, 0x82, 0x83, 0x82, 0x82, 0x81,
- 0x80, 0x83, 0x80, 0x83, 0x80, 0x83, 0x83, 0x80,
- 0x00, 0x80, 0x80, 0x81, 0x83, 0x82, 0x83, 0xc3,
- 0x82, 0x80, 0x83, 0x82, 0x83, 0x01, 0x00, 0x83,
- 0x80, 0x83, 0x83, 0x82, 0x83, 0x82, 0x82, 0x81,
- 0x80, 0x83, 0x80, 0x83, 0x80, 0x83, 0x83, 0x80,
- 0x00, 0x80, 0x80, 0x81, 0x83, 0x82, 0x83, 0xcf,
- 0x82, 0x80, 0x83, 0x82, 0x83, 0x01, 0x00, 0x80,
-};
-
-static unsigned char m001[256] = {
- 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
- 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
- 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
- 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
- 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
- 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
- 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
- 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
- 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
- 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
- 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
- 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
- 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
- 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
- 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
- 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x03,
- 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
- 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
- 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
- 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
- 0x07, 0x02, 0x03, 0x03, 0x05, 0x02, 0x05, 0x07,
- 0x00, 0x07, 0x02, 0x07, 0x07, 0x07, 0x07, 0x02,
- 0x07, 0x07, 0x03, 0x03, 0x00, 0x07, 0x07, 0x07,
- 0x00, 0x03, 0x02, 0x07, 0x01, 0x01, 0x01, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x02,
- 0x02, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03,
- 0x03, 0x02, 0x02, 0x02, 0x03, 0x02, 0x02, 0x03,
- 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x02,
- 0x02, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03,
- 0x03, 0x02, 0x02, 0x02, 0x03, 0x02, 0x02, 0x02,
-};
-
-static unsigned char m010[256] = {
- 0x02, 0x02, 0x01, 0x01, 0x03, 0x03, 0x01, 0x01,
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x01, 0x01,
- 0x03, 0x03, 0x02, 0x02, 0x00, 0x00, 0x02, 0x02,
- 0x03, 0x03, 0x01, 0x01, 0x00, 0x00, 0x80, 0x80,
- 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00,
- 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x02, 0x02,
- 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
- 0x02, 0x01, 0x01, 0x02, 0x02, 0x01, 0x01, 0x00,
- 0x00, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x01,
- 0x01, 0x00, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00,
- 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x02, 0x02,
- 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x81, 0x81,
- 0x03, 0x03, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x01, 0x01,
- 0x01, 0x01, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x01, 0x01, 0x01, 0x01, 0x03, 0x03, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-
-static unsigned char m011[256] = {
- 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
- 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01,
- 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
- 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00,
- 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
- 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x01, 0x01,
- 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
- 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
- 0x02, 0x01, 0x01, 0x01, 0x01, 0x03, 0x03, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-
-static unsigned char m020[256] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x01, 0x03, 0x00, 0x03, 0x00, 0x01, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-
-static unsigned char m030[256] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x20, 0x00,
- 0x20, 0x20, 0x20, 0x00, 0x20, 0x00, 0x20, 0x20,
- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
- 0x20, 0x20, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20,
- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-
-static unsigned char m040[256] = {
- 0x00, 0x1c, 0x10, 0x10, 0x18, 0x10, 0x18, 0x18,
- 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x10, 0x10,
- 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c,
- 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c,
- 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c,
- 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c,
- 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c,
- 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c,
- 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c,
- 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c,
- 0x00, 0x1c, 0x10, 0x10, 0x18, 0x10, 0x18, 0x18,
- 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x10, 0x10,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-
-static unsigned char m041[256] = {
- 0x00, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x00, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x00, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x00, 0x04, 0x04,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-
-static unsigned char m050[256] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
- 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
- 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
- 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-
-static unsigned char m200[256] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x40,
- 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-
-static unsigned char m201[256] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x00,
- 0x04, 0x05, 0x04, 0x00, 0x05, 0x05, 0x05, 0x00,
- 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-
-static unsigned char m210[256] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-
-static unsigned char m211[256] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-
-static unsigned char m220[256] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x0c, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0c, 0x0c, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-
-static unsigned char m230[256] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0c, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-
-static unsigned char m250[256] = {
- 0x0c, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
- 0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
- 0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0c, 0x0c, 0x0c, 0x04, 0x0c, 0x04, 0x04, 0x0c,
- 0x0c, 0x0c, 0x0c, 0x0c, 0x04, 0x0c, 0x0c, 0x0c,
- 0x0c, 0x0c, 0x04, 0x0c, 0x04, 0x04, 0x0c, 0x0c,
- 0x0c, 0x0c, 0x0c, 0x04, 0x0c, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
- 0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
- 0x0c, 0x0c, 0x0c, 0x0c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-
-struct {
- unsigned char *bits0;
- unsigned char *bits1;
-} camel_charmap[256] = {
- { m000, m001, }, { m010, m011, }, { m020, 0, }, { m030, 0, }, { m040, m041, }, { m050, 0, }, { 0, 0, }, { 0, 0, },
- { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, },
- { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, },
- { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, },
- { m200, m201, }, { m210, m211, }, { m220, 0, }, { m230, 0, }, { 0, 0, }, { m250, 0, }, { 0, 0, }, { 0, 0, },
- { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, },
- { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, },
- { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, },
- { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, },
- { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, },
- { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, },
- { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, },
- { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, },
- { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, },
- { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, },
- { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, },
- { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, },
- { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, },
- { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, },
- { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, },
- { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, },
- { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, },
- { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, },
- { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, },
- { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, },
- { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, },
- { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, },
- { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, },
- { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, },
- { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, },
- { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, },
- { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, }, { 0, 0, },
-};
-
-struct {
- const char *name;
- unsigned int bit;
-} camel_charinfo[] = {
- { "iso-8859-2", 0x0001 },
- { "iso-8859-4", 0x0002 },
- { "koi8-r", 0x0004 },
- { "koi8-u", 0x0008 },
- { "iso-8859-5", 0x0010 },
- { "iso-8859-7", 0x0020 },
- { "iso-8859-8", 0x0040 },
- { "iso-8859-9", 0x0080 },
- { "iso-8859-13", 0x0100 },
- { "iso-8859-15", 0x0200 },
- { "windows-1251", 0x0400 },
-};
-
-#define charset_mask(x) \
- (camel_charmap[(x)>>8].bits0?camel_charmap[(x)>>8].bits0[(x)&0xff]<<0:0) \
- | (camel_charmap[(x)>>8].bits1?camel_charmap[(x)>>8].bits1[(x)&0xff]<<8:0)
-
diff --git a/camel/camel-charset-map.c b/camel/camel-charset-map.c
deleted file mode 100644
index 9bd4f4e253..0000000000
--- a/camel/camel-charset-map.c
+++ /dev/null
@@ -1,352 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; -*- */
-/*
- * Authors:
- * Michael Zucchi <notzed@ximian.com>
- * Jeffrey Stedfast <fejj@ximian.com>
- * Dan Winship <danw@ximian.com>
- *
- * Copyright 2000-2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-
-/*
- if you want to build the charset map, compile this with something like:
- gcc -DBUILD_MAP camel-charset-map.c `glib-config --cflags`
- (plus any -I/-L/-l flags you need for iconv), then run it as
- ./a.out > camel-charset-map-private.h
-
- Note that the big-endian variant isn't tested...
-
- The tables genereated work like this:
-
- An indirect array for each page of unicode character
- Each array element has an indirect pointer to one of the bytes of
- the generated bitmask.
-*/
-
-#ifdef BUILD_MAP
-#include <iconv.h>
-#include <glib.h>
-
-static struct {
- char *name;
- unsigned int bit; /* assigned bit */
-} tables[] = {
- /* These are the 8bit character sets (other than iso-8859-1,
- * which is special-cased) which are supported by both other
- * mailers and the GNOME environment. Note that the order
- * they're listed in is the order they'll be tried in, so put
- * the more-popular ones first.
- */
- { "iso-8859-2", 0 }, /* Central/Eastern European */
- { "iso-8859-4", 0 }, /* Baltic */
- { "koi8-r", 0 }, /* Russian */
- { "koi8-u", 0 }, /* Ukranian */
- { "iso-8859-5", 0 }, /* Least-popular Russian encoding */
- { "iso-8859-7", 0 }, /* Greek */
- { "iso-8859-8", 0 }, /* Hebrew; Visual */
- { "iso-8859-9", 0 }, /* Turkish */
- { "iso-8859-13", 0 }, /* Baltic again */
- { "iso-8859-15", 0 }, /* New-and-improved iso-8859-1, but most
- * programs that support this support UTF8
- */
- { "windows-1251", 0 }, /* Russian */
- { 0, 0 }
-};
-
-unsigned int encoding_map[256 * 256];
-
-#if G_BYTE_ORDER == G_BIG_ENDIAN
-#define UCS "UCS-4BE"
-#else
-#define UCS "UCS-4LE"
-#endif
-
-int main (void)
-{
- int i, j;
- int max, min;
- int bit = 0x01;
- int k;
- int bytes;
- iconv_t cd;
- char in[128];
- guint32 out[128];
- char *inptr, *outptr;
- size_t inlen, outlen;
-
- /* dont count the terminator */
- bytes = ((sizeof(tables)/sizeof(tables[0]))+7-1)/8;
-
- for (i = 0; i < 128; i++)
- in[i] = i + 128;
-
- for (j = 0; tables[j].name; j++) {
- cd = iconv_open (UCS, tables[j].name);
- inptr = in;
- outptr = (char *)(out);
- inlen = sizeof (in);
- outlen = sizeof (out);
- while (iconv (cd, &inptr, &inlen, &outptr, &outlen) == -1) {
- if (errno == EILSEQ) {
- inptr++;
- inlen--;
- } else {
- printf ("%s\n", strerror (errno));
- exit (1);
- }
- }
- iconv_close (cd);
-
- for (i = 0; i < 128 - outlen / 4; i++) {
- encoding_map[i] |= bit;
- encoding_map[out[i]] |= bit;
- }
-
- tables[j].bit = bit;
- bit <<= 1;
- }
-
- printf("/* This file is automatically generated: DO NOT EDIT */\n\n");
-
- for (i=0;i<256;i++) {
- /* first, do we need this block? */
- for (k=0;k<bytes;k++) {
- for (j=0;j<256;j++) {
- if ((encoding_map[i*256 + j] & (0xff << (k*8))) != 0)
- break;
- }
- if (j < 256) {
- /* yes, dump it */
- printf("static unsigned char m%02x%x[256] = {\n\t", i, k);
- for (j=0;j<256;j++) {
- printf("0x%02x, ", (encoding_map[i*256+j] >> (k*8)) & 0xff );
- if (((j+1)&7) == 0 && j<255)
- printf("\n\t");
- }
- printf("\n};\n\n");
- }
- }
- }
-
- printf("struct {\n");
- for (k=0;k<bytes;k++) {
- printf("\tunsigned char *bits%d;\n", k);
- }
- printf("} camel_charmap[256] = {\n\t");
- for (i=0;i<256;i++) {
- /* first, do we need this block? */
- printf("{ ");
- for (k=0;k<bytes;k++) {
- for (j=0;j<256;j++) {
- if ((encoding_map[i*256 + j] & (0xff << (k*8))) != 0)
- break;
- }
- if (j < 256) {
- printf("m%02x%x, ", i, k);
- } else {
- printf("0, ");
- }
- }
- printf("}, ");
- if (((i+1)&7) == 0 && i<255)
- printf("\n\t");
- }
- printf("\n};\n\n");
-
- printf("struct {\n\tconst char *name;\n\tunsigned int bit;\n} camel_charinfo[] = {\n");
- for (j=0;tables[j].name;j++) {
- printf("\t{ \"%s\", 0x%04x },\n", tables[j].name, tables[j].bit);
- }
- printf("};\n\n");
-
- printf("#define charset_mask(x) \\\n");
- for (k=0;k<bytes;k++) {
- if (k!=0)
- printf("\t| ");
- else
- printf("\t");
- printf("(camel_charmap[(x)>>8].bits%d?camel_charmap[(x)>>8].bits%d[(x)&0xff]<<%d:0)", k, k, k*8);
- if (k<bytes-1)
- printf("\t\\\n");
- }
- printf("\n\n");
-
- return 0;
-}
-
-#else
-
-#include "camel-charset-map.h"
-#include "camel-charset-map-private.h"
-
-#include <glib.h>
-#include <locale.h>
-#include <ctype.h>
-#include <pthread.h>
-#ifdef HAVE_CODESET
-#include <langinfo.h>
-#endif
-
-void
-camel_charset_init (CamelCharset *c)
-{
- c->mask = (unsigned int) ~0;
- c->level = 0;
-}
-
-void
-camel_charset_step (CamelCharset *c, const char *in, int len)
-{
- register unsigned int mask;
- register int level;
- const char *inptr = in, *inend = in+len;
-
- mask = c->mask;
- level = c->level;
-
- /* check what charset a given string will fit in */
- while (inptr < inend) {
- gunichar c;
- const char *newinptr;
- newinptr = g_utf8_next_char(inptr);
- c = g_utf8_get_char(inptr);
- if (newinptr == NULL || !g_unichar_validate (c)) {
- inptr++;
- continue;
- }
-
- inptr = newinptr;
- if (c<=0xffff) {
- mask &= charset_mask(c);
-
- if (c>=128 && c<256)
- level = MAX(level, 1);
- else if (c>=256)
- level = MAX(level, 2);
- } else {
- mask = 0;
- level = MAX(level, 2);
- }
- }
-
- c->mask = mask;
- c->level = level;
-}
-
-/* gets the best charset from the mask of chars in it */
-static const char *
-camel_charset_best_mask(unsigned int mask)
-{
- int i;
-
- for (i=0;i<sizeof(camel_charinfo)/sizeof(camel_charinfo[0]);i++) {
- if (camel_charinfo[i].bit & mask)
- return camel_charinfo[i].name;
- }
- return "UTF-8";
-}
-
-const char *
-camel_charset_best_name (CamelCharset *charset)
-{
- if (charset->level == 1)
- return "ISO-8859-1";
- else if (charset->level == 2)
- return camel_charset_best_mask (charset->mask);
- else
- return NULL;
-
-}
-
-/* finds the minimum charset for this string NULL means US-ASCII */
-const char *
-camel_charset_best (const char *in, int len)
-{
- CamelCharset charset;
-
- camel_charset_init (&charset);
- camel_charset_step (&charset, in, len);
- return camel_charset_best_name (&charset);
-}
-
-
-/**
- * camel_charset_iso_to_windows:
- * @isocharset: a canonicalised ISO charset
- *
- * Returns the equivalent Windows charset.
- **/
-const char *
-camel_charset_iso_to_windows (const char *isocharset)
-{
- /* According to http://czyborra.com/charsets/codepages.html,
- * the charset mapping is as follows:
- *
- * us-ascii maps to windows-cp1252
- * iso-8859-1 maps to windows-cp1252
- * iso-8859-2 maps to windows-cp1250
- * iso-8859-3 maps to windows-cp????
- * iso-8859-4 maps to windows-cp????
- * iso-8859-5 maps to windows-cp1251
- * iso-8859-6 maps to windows-cp1256
- * iso-8859-7 maps to windows-cp1253
- * iso-8859-8 maps to windows-cp1255
- * iso-8859-9 maps to windows-cp1254
- * iso-8859-10 maps to windows-cp????
- * iso-8859-11 maps to windows-cp????
- * iso-8859-12 maps to windows-cp????
- * iso-8859-13 maps to windows-cp1257
- *
- * Assumptions:
- * - I'm going to assume that since iso-8859-4 and
- * iso-8859-13 are Baltic that it also maps to
- * windows-cp1257.
- */
-
- if (!strcasecmp (isocharset, "iso-8859-1") || !strcasecmp (isocharset, "us-ascii"))
- return "windows-cp1252";
- else if (!strcasecmp (isocharset, "iso-8859-2"))
- return "windows-cp1250";
- else if (!strcasecmp (isocharset, "iso-8859-4"))
- return "windows-cp1257";
- else if (!strcasecmp (isocharset, "iso-8859-5"))
- return "windows-cp1251";
- else if (!strcasecmp (isocharset, "iso-8859-6"))
- return "windows-cp1256";
- else if (!strcasecmp (isocharset, "iso-8859-7"))
- return "windows-cp1253";
- else if (!strcasecmp (isocharset, "iso-8859-8"))
- return "windows-cp1255";
- else if (!strcasecmp (isocharset, "iso-8859-9"))
- return "windows-cp1254";
- else if (!strcasecmp (isocharset, "iso-8859-13"))
- return "windows-cp1257";
-
- return isocharset;
-}
-
-#endif /* !BUILD_MAP */
diff --git a/camel/camel-charset-map.h b/camel/camel-charset-map.h
deleted file mode 100644
index cd627ee488..0000000000
--- a/camel/camel-charset-map.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2000-2003 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef _CAMEL_CHARSET_MAP_H
-#define _CAMEL_CHARSET_MAP_H
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-typedef struct _CamelCharset CamelCharset;
-
-struct _CamelCharset {
- unsigned int mask;
- int level;
-};
-
-void camel_charset_init(CamelCharset *);
-void camel_charset_step(CamelCharset *, const char *in, int len);
-
-const char *camel_charset_best_name (CamelCharset *);
-
-/* helper function */
-const char *camel_charset_best(const char *in, int len);
-
-const char *camel_charset_iso_to_windows (const char *isocharset);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* ! _CAMEL_CHARSET_MAP_H */
diff --git a/camel/camel-cipher-context.c b/camel/camel-cipher-context.c
deleted file mode 100644
index b730d927c8..0000000000
--- a/camel/camel-cipher-context.c
+++ /dev/null
@@ -1,585 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2001-2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <pthread.h>
-#include <string.h>
-
-#include <glib.h>
-
-#include "camel-cipher-context.h"
-#include "camel-stream.h"
-
-#include "camel-mime-utils.h"
-#include "camel-medium.h"
-#include "camel-multipart.h"
-#include "camel-mime-message.h"
-#include "camel-mime-filter-canon.h"
-#include "camel-stream-filter.h"
-
-#define CIPHER_LOCK(ctx) g_mutex_lock (((CamelCipherContext *) ctx)->priv->lock)
-#define CIPHER_UNLOCK(ctx) g_mutex_unlock (((CamelCipherContext *) ctx)->priv->lock);
-
-#define d(x)
-
-#define CCC_CLASS(o) CAMEL_CIPHER_CONTEXT_CLASS(CAMEL_OBJECT_GET_CLASS(o))
-
-struct _CamelCipherContextPrivate {
- GMutex *lock;
-};
-
-static CamelObjectClass *parent_class = NULL;
-
-/**
- * camel_cipher_context_new:
- * @session: CamelSession
- *
- * This creates a new CamelCipherContext object which is used to sign,
- * verify, encrypt and decrypt streams.
- *
- * Return value: the new CamelCipherContext
- **/
-CamelCipherContext *
-camel_cipher_context_new (CamelSession *session)
-{
- CamelCipherContext *context;
-
- g_return_val_if_fail (session != NULL, NULL);
-
- context = CAMEL_CIPHER_CONTEXT (camel_object_new (CAMEL_CIPHER_CONTEXT_TYPE));
-
- camel_object_ref (session);
- context->session = session;
-
- return context;
-}
-
-/**
- * camel_cipher_context_construct:
- * @context: CamelCipherContext
- * @session: CamelSession
- *
- * Constucts the CamelCipherContext
- **/
-void
-camel_cipher_context_construct (CamelCipherContext *context, CamelSession *session)
-{
- g_return_if_fail (CAMEL_IS_CIPHER_CONTEXT (context));
- g_return_if_fail (CAMEL_IS_SESSION (session));
-
- camel_object_ref (session);
- context->session = session;
-}
-
-static int
-cipher_sign (CamelCipherContext *ctx, const char *userid, CamelCipherHash hash,
- struct _CamelMimePart *ipart, struct _CamelMimePart *opart, CamelException *ex)
-{
- camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Signing is not supported by this cipher"));
- return -1;
-}
-
-/**
- * camel_cipher_sign:
- * @context: Cipher Context
- * @userid: private key to use to sign the stream
- * @hash: preferred Message-Integrity-Check hash algorithm
- * @ipart: Input part.
- * @opart: output part.
- * @ex: exception
- *
- * Converts the (unsigned) part @ipart into a new self-contained mime part @opart.
- * This may be a multipart/signed part, or a simple part for enveloped types.
- *
- * Return value: 0 for success or -1 for failure.
- **/
-int
-camel_cipher_sign (CamelCipherContext *context, const char *userid, CamelCipherHash hash,
- struct _CamelMimePart *ipart, struct _CamelMimePart *opart, CamelException *ex)
-{
- int retval;
-
- g_return_val_if_fail (CAMEL_IS_CIPHER_CONTEXT (context), -1);
-
- CIPHER_LOCK(context);
-
- retval = CCC_CLASS (context)->sign (context, userid, hash, ipart, opart, ex);
-
- CIPHER_UNLOCK(context);
-
- return retval;
-}
-
-static CamelCipherValidity *
-cipher_verify (CamelCipherContext *context, struct _CamelMimePart *sigpart, CamelException *ex)
-{
- camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Verifying is not supported by this cipher"));
- return NULL;
-}
-
-/**
- * camel_cipher_verify:
- * @context: Cipher Context
- * @ipart: part to verify
- * @ex: exception
- *
- * Verifies the signature. If @istream is a clearsigned stream,
- * you should pass %NULL as the sigstream parameter. Otherwise
- * @sigstream is assumed to be the signature stream and is used to
- * verify the integirity of the @istream.
- *
- * Return value: a CamelCipherValidity structure containing information
- * about the integrity of the input stream or %NULL on failure to
- * execute at all.
- **/
-CamelCipherValidity *
-camel_cipher_verify (CamelCipherContext *context, struct _CamelMimePart *ipart, CamelException *ex)
-{
- CamelCipherValidity *valid;
-
- g_return_val_if_fail (CAMEL_IS_CIPHER_CONTEXT (context), NULL);
-
- CIPHER_LOCK(context);
-
- valid = CCC_CLASS (context)->verify (context, ipart, ex);
-
- CIPHER_UNLOCK(context);
-
- return valid;
-}
-
-static int
-cipher_encrypt (CamelCipherContext *context, const char *userid, GPtrArray *recipients,
- struct _CamelMimePart *ipart, struct _CamelMimePart *opart, CamelException *ex)
-{
- camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Encryption is not supported by this cipher"));
- return -1;
-}
-
-/**
- * camel_cipher_encrypt:
- * @context: Cipher Context
- * @userid: key id (or email address) to use when signing, or NULL to not sign.
- * @recipients: an array of recipient key ids and/or email addresses
- * @istream: cleartext input stream
- * @ostream: ciphertext output stream
- * @ex: exception
- *
- * Encrypts (and optionally signs) the cleartext input stream and
- * writes the resulting ciphertext to the output stream.
- *
- * Return value: 0 for success or -1 for failure.
- **/
-int
-camel_cipher_encrypt (CamelCipherContext *context, const char *userid, GPtrArray *recipients,
- struct _CamelMimePart *ipart, struct _CamelMimePart *opart, CamelException *ex)
-{
- int retval;
-
- g_return_val_if_fail (CAMEL_IS_CIPHER_CONTEXT (context), -1);
-
- CIPHER_LOCK(context);
-
- retval = CCC_CLASS (context)->encrypt (context, userid, recipients, ipart, opart, ex);
-
- CIPHER_UNLOCK(context);
-
- return retval;
-}
-
-static CamelCipherValidity *
-cipher_decrypt(CamelCipherContext *context, struct _CamelMimePart *ipart, struct _CamelMimePart *opart, CamelException *ex)
-{
- camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Decryption is not supported by this cipher"));
- return NULL;
-}
-
-/**
- * camel_cipher_decrypt:
- * @context:
- * @ipart:
- * @opart:
- * @ex:
- *
- * Decrypts @ipart into @opart.
- *
- * Return value: A validity/encryption status.
- **/
-CamelCipherValidity *
-camel_cipher_decrypt(CamelCipherContext *context, struct _CamelMimePart *ipart, struct _CamelMimePart *opart, CamelException *ex)
-{
- CamelCipherValidity *valid;
-
- g_return_val_if_fail (CAMEL_IS_CIPHER_CONTEXT (context), NULL);
-
- CIPHER_LOCK(context);
-
- valid = CCC_CLASS (context)->decrypt (context, ipart, opart, ex);
-
- CIPHER_UNLOCK(context);
-
- return valid;
-}
-
-static int
-cipher_import_keys (CamelCipherContext *context, struct _CamelStream *istream, CamelException *ex)
-{
- camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
- _("You may not import keys with this cipher"));
-
- return -1;
-}
-
-/**
- * camel_cipher_import_keys:
- * @ctx: Cipher Context
- * @istream: input stream (containing keys)
- * @ex: exception
- *
- * Imports a stream of keys/certificates contained within @istream
- * into the key/certificate database controlled by @ctx.
- *
- * Returns 0 on success or -1 on fail.
- **/
-int
-camel_cipher_import_keys (CamelCipherContext *context, struct _CamelStream *istream, CamelException *ex)
-{
- g_return_val_if_fail (CAMEL_IS_CIPHER_CONTEXT (context), -1);
- g_return_val_if_fail (CAMEL_IS_STREAM (istream), -1);
-
- return CCC_CLASS (context)->import_keys (context, istream, ex);
-}
-
-static int
-cipher_export_keys (CamelCipherContext *context, GPtrArray *keys,
- struct _CamelStream *ostream, CamelException *ex)
-{
- camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
- _("You may not export keys with this cipher"));
-
- return -1;
-}
-
-/**
- * camel_cipher_export_keys:
- * @ctx: Cipher Context
- * @keys: an array of key ids
- * @ostream: output stream
- * @ex: exception
- *
- * Exports the keys/certificates in @keys to the stream @ostream from
- * the key/certificate database controlled by @ctx.
- *
- * Returns 0 on success or -1 on fail.
- **/
-int
-camel_cipher_export_keys (CamelCipherContext *context, GPtrArray *keys,
- struct _CamelStream *ostream, CamelException *ex)
-{
- g_return_val_if_fail (CAMEL_IS_CIPHER_CONTEXT (context), -1);
- g_return_val_if_fail (CAMEL_IS_STREAM (ostream), -1);
- g_return_val_if_fail (keys != NULL, -1);
-
- return CCC_CLASS (context)->export_keys (context, keys, ostream, ex);
-}
-
-static CamelCipherHash
-cipher_id_to_hash(CamelCipherContext *context, const char *id)
-{
- return CAMEL_CIPHER_HASH_DEFAULT;
-}
-
-/* a couple of util functions */
-CamelCipherHash
-camel_cipher_id_to_hash(CamelCipherContext *context, const char *id)
-{
- g_return_val_if_fail (CAMEL_IS_CIPHER_CONTEXT (context), CAMEL_CIPHER_HASH_DEFAULT);
-
- return CCC_CLASS (context)->id_to_hash (context, id);
-}
-
-static const char *
-cipher_hash_to_id(CamelCipherContext *context, CamelCipherHash hash)
-{
- return NULL;
-}
-
-const char *
-camel_cipher_hash_to_id(CamelCipherContext *context, CamelCipherHash hash)
-{
- g_return_val_if_fail (CAMEL_IS_CIPHER_CONTEXT (context), NULL);
-
- return CCC_CLASS (context)->hash_to_id (context, hash);
-}
-
-/* Cipher Validity stuff */
-
-CamelCipherValidity *
-camel_cipher_validity_new (void)
-{
- CamelCipherValidity *validity;
-
- validity = g_malloc(sizeof(*validity));
- camel_cipher_validity_init(validity);
-
- return validity;
-}
-
-void
-camel_cipher_validity_init (CamelCipherValidity *validity)
-{
- g_assert (validity != NULL);
-
- memset(validity, 0, sizeof(*validity));
- e_dlist_init(&validity->children);
-}
-
-gboolean
-camel_cipher_validity_get_valid (CamelCipherValidity *validity)
-{
- return validity != NULL
- && validity->sign.status == CAMEL_CIPHER_VALIDITY_SIGN_GOOD;
-}
-
-void
-camel_cipher_validity_set_valid (CamelCipherValidity *validity, gboolean valid)
-{
- g_assert (validity != NULL);
-
- validity->sign.status = valid?CAMEL_CIPHER_VALIDITY_SIGN_GOOD:CAMEL_CIPHER_VALIDITY_SIGN_BAD;
-}
-
-gchar *
-camel_cipher_validity_get_description (CamelCipherValidity *validity)
-{
- if (validity == NULL)
- return NULL;
-
- return validity->sign.description;
-}
-
-void
-camel_cipher_validity_set_description (CamelCipherValidity *validity, const gchar *description)
-{
- g_assert (validity != NULL);
-
- g_free(validity->sign.description);
- validity->sign.description = g_strdup(description);
-}
-
-void
-camel_cipher_validity_clear (CamelCipherValidity *validity)
-{
- g_assert (validity != NULL);
-
- g_free(validity->sign.description);
- g_free(validity->encrypt.description);
- camel_cipher_validity_init(validity);
-}
-
-CamelCipherValidity *
-camel_cipher_validity_clone(CamelCipherValidity *vin)
-{
- CamelCipherValidity *vo;
-
- vo = camel_cipher_validity_new();
- vo->sign.status = vin->sign.status;
- vo->sign.description = g_strdup(vin->sign.description);
- vo->encrypt.status = vin->encrypt.status;
- vo->encrypt.description = g_strdup(vin->encrypt.description);
-
- return vo;
-}
-
-/**
- * camel_cipher_validity_envelope:
- * @validity:
- * @outer:
- *
- * Calculate a conglomerate validity based on wrapping one secure part inside
- * another one.
- **/
-void
-camel_cipher_validity_envelope(CamelCipherValidity *parent, CamelCipherValidity *valid)
-{
- if (parent->sign.status != CAMEL_CIPHER_VALIDITY_SIGN_NONE
- && parent->encrypt.status == CAMEL_CIPHER_VALIDITY_ENCRYPT_NONE
- && valid->sign.status == CAMEL_CIPHER_VALIDITY_SIGN_NONE
- && valid->encrypt.status != CAMEL_CIPHER_VALIDITY_ENCRYPT_NONE) {
- /* case 1: only signed inside only encrypted -> merge both */
- parent->encrypt.status = valid->encrypt.status;
- parent->encrypt.description = g_strdup(valid->encrypt.description);
- } else if (parent->sign.status == CAMEL_CIPHER_VALIDITY_SIGN_NONE
- && parent->encrypt.status != CAMEL_CIPHER_VALIDITY_ENCRYPT_NONE
- && valid->sign.status != CAMEL_CIPHER_VALIDITY_SIGN_NONE
- && valid->encrypt.status == CAMEL_CIPHER_VALIDITY_ENCRYPT_NONE) {
- /* case 2: only encrypted inside only signed */
- parent->sign.status = valid->sign.status;
- parent->sign.description = g_strdup(valid->sign.description);
- }
- /* Otherwise, I dunno - what do you do? */
-}
-
-void
-camel_cipher_validity_free (CamelCipherValidity *validity)
-{
- CamelCipherValidity *child;
-
- if (validity == NULL)
- return;
-
- while ((child = (CamelCipherValidity *)e_dlist_remhead(&validity->children)))
- camel_cipher_validity_free(child);
-
- camel_cipher_validity_clear(validity);
- g_free(validity);
-}
-
-/* ********************************************************************** */
-
-static void
-camel_cipher_context_init (CamelCipherContext *context)
-{
- context->priv = g_new0 (struct _CamelCipherContextPrivate, 1);
- context->priv->lock = g_mutex_new ();
-}
-
-static void
-camel_cipher_context_finalise (CamelObject *o)
-{
- CamelCipherContext *context = (CamelCipherContext *)o;
-
- camel_object_unref (CAMEL_OBJECT (context->session));
-
- g_mutex_free (context->priv->lock);
-
- g_free (context->priv);
-}
-
-static void
-camel_cipher_context_class_init (CamelCipherContextClass *camel_cipher_context_class)
-{
- parent_class = camel_type_get_global_classfuncs (camel_object_get_type ());
-
- camel_cipher_context_class->hash_to_id = cipher_hash_to_id;
- camel_cipher_context_class->id_to_hash = cipher_id_to_hash;
- camel_cipher_context_class->sign = cipher_sign;
- camel_cipher_context_class->verify = cipher_verify;
- camel_cipher_context_class->encrypt = cipher_encrypt;
- camel_cipher_context_class->decrypt = cipher_decrypt;
- camel_cipher_context_class->import_keys = cipher_import_keys;
- camel_cipher_context_class->export_keys = cipher_export_keys;
-}
-
-CamelType
-camel_cipher_context_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_object_get_type (),
- "CamelCipherContext",
- sizeof (CamelCipherContext),
- sizeof (CamelCipherContextClass),
- (CamelObjectClassInitFunc) camel_cipher_context_class_init,
- NULL,
- (CamelObjectInitFunc) camel_cipher_context_init,
- (CamelObjectFinalizeFunc) camel_cipher_context_finalise);
- }
-
- return type;
-}
-
-/* See rfc3156, section 2 and others */
-/* We do this simply: Anything not base64 must be qp
- This is so that we can safely translate any occurance of "From "
- into the quoted-printable escaped version safely. */
-static void
-cc_prepare_sign(CamelMimePart *part)
-{
- CamelDataWrapper *dw;
- CamelTransferEncoding encoding;
- int parts, i;
-
- dw = camel_medium_get_content_object((CamelMedium *)part);
- if (!dw)
- return;
-
- if (CAMEL_IS_MULTIPART (dw)) {
- parts = camel_multipart_get_number((CamelMultipart *)dw);
- for (i = 0; i < parts; i++)
- cc_prepare_sign(camel_multipart_get_part((CamelMultipart *)dw, i));
- } else if (CAMEL_IS_MIME_MESSAGE (dw)) {
- cc_prepare_sign((CamelMimePart *)dw);
- } else {
- encoding = camel_mime_part_get_encoding(part);
-
- if (encoding != CAMEL_TRANSFER_ENCODING_BASE64
- && encoding != CAMEL_TRANSFER_ENCODING_QUOTEDPRINTABLE) {
- camel_mime_part_set_encoding(part, CAMEL_TRANSFER_ENCODING_QUOTEDPRINTABLE);
- }
- }
-}
-
-/**
- * camel_cipher_canonical_to_stream:
- * @part: Part to write.
- * @flags: flags for the canonicalisation filter (CamelMimeFilterCanon)
- * @ostream: stream to write canonicalised output to.
- *
- * Writes a part to a stream in a canonicalised format, suitable for signing/encrypting.
- *
- * The transfer encoding paramaters for the part may be changed by this function.
- *
- * Return value: -1 on error;
- **/
-int
-camel_cipher_canonical_to_stream(CamelMimePart *part, guint32 flags, CamelStream *ostream)
-{
- CamelStreamFilter *filter;
- CamelMimeFilter *canon;
- int res = -1;
-
- if (flags & (CAMEL_MIME_FILTER_CANON_FROM|CAMEL_MIME_FILTER_CANON_STRIP))
- cc_prepare_sign(part);
-
- filter = camel_stream_filter_new_with_stream(ostream);
- canon = camel_mime_filter_canon_new(flags);
- camel_stream_filter_add(filter, canon);
- camel_object_unref(canon);
-
- if (camel_data_wrapper_write_to_stream((CamelDataWrapper *)part, (CamelStream *)filter) != -1
- && camel_stream_flush((CamelStream *)filter) != -1)
- res = 0;
-
- camel_object_unref(filter);
- camel_stream_reset(ostream);
-
- return res;
-}
diff --git a/camel/camel-cipher-context.h b/camel/camel-cipher-context.h
deleted file mode 100644
index 1a7387ac2c..0000000000
--- a/camel/camel-cipher-context.h
+++ /dev/null
@@ -1,174 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2001 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef CAMEL_CIPHER_CONTEXT_H
-#define CAMEL_CIPHER_CONTEXT_H
-
-#include <camel/camel-session.h>
-#include <camel/camel-exception.h>
-
-/* FIXME: camelise */
-#include "e-util/e-msgport.h"
-
-struct _CamelStream;
-struct _CamelMimePart;
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#define CAMEL_CIPHER_CONTEXT_TYPE (camel_cipher_context_get_type ())
-#define CAMEL_CIPHER_CONTEXT(obj) (CAMEL_CHECK_CAST((obj), CAMEL_CIPHER_CONTEXT_TYPE, CamelCipherContext))
-#define CAMEL_CIPHER_CONTEXT_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_CIPHER_CONTEXT_TYPE, CamelCipherContextClass))
-#define CAMEL_IS_CIPHER_CONTEXT(o) (CAMEL_CHECK_TYPE((o), CAMEL_CIPHER_CONTEXT_TYPE))
-
-typedef struct _CamelCipherValidity CamelCipherValidity;
-
-typedef enum {
- CAMEL_CIPHER_HASH_DEFAULT,
- CAMEL_CIPHER_HASH_MD2,
- CAMEL_CIPHER_HASH_MD5,
- CAMEL_CIPHER_HASH_SHA1,
- CAMEL_CIPHER_HASH_RIPEMD160,
- CAMEL_CIPHER_HASH_TIGER192,
- CAMEL_CIPHER_HASH_HAVAL5160
-} CamelCipherHash;
-
-enum _camel_cipher_validity_sign_t {
- CAMEL_CIPHER_VALIDITY_SIGN_NONE,
- CAMEL_CIPHER_VALIDITY_SIGN_GOOD,
- CAMEL_CIPHER_VALIDITY_SIGN_BAD,
- CAMEL_CIPHER_VALIDITY_SIGN_UNKNOWN,
-};
-
-enum _camel_cipher_validity_encrypt_t {
- CAMEL_CIPHER_VALIDITY_ENCRYPT_NONE,
- CAMEL_CIPHER_VALIDITY_ENCRYPT_WEAK,
- CAMEL_CIPHER_VALIDITY_ENCRYPT_ENCRYPTED, /* encrypted, unknown strenght */
- CAMEL_CIPHER_VALIDITY_ENCRYPT_STRONG,
-};
-
-struct _CamelCipherValidity {
- struct _CamelCipherValidity *next;
- struct _CamelCipherValidity *prev;
- EDList children;
-
- struct {
- enum _camel_cipher_validity_sign_t status;
- char *description;
- } sign;
- struct {
- enum _camel_cipher_validity_encrypt_t status;
- char *description;
- } encrypt;
-};
-
-typedef struct _CamelCipherContext {
- CamelObject parent_object;
-
- struct _CamelCipherContextPrivate *priv;
-
- CamelSession *session;
-
- /* these MUST be set by implementors */
- const char *sign_protocol;
- const char *encrypt_protocol;
- const char *key_protocol;
-} CamelCipherContext;
-
-typedef struct _CamelCipherContextClass {
- CamelObjectClass parent_class;
-
- CamelCipherHash (*id_to_hash)(CamelCipherContext *context, const char *id);
- const char * (*hash_to_id)(CamelCipherContext *context, CamelCipherHash hash);
-
- int (*sign) (CamelCipherContext *context, const char *userid, CamelCipherHash hash,
- struct _CamelMimePart *ipart, struct _CamelMimePart *opart, CamelException *ex);
-
- CamelCipherValidity * (*verify) (CamelCipherContext *context, struct _CamelMimePart *ipart, CamelException *ex);
-
- int (*encrypt) (CamelCipherContext *context, const char *userid,
- GPtrArray *recipients, struct _CamelMimePart *ipart, struct _CamelMimePart *opart,
- CamelException *ex);
-
- CamelCipherValidity *(*decrypt) (CamelCipherContext *context, struct _CamelMimePart *ipart, struct _CamelMimePart *opart,
- CamelException *ex);
-
- int (*import_keys) (CamelCipherContext *context, struct _CamelStream *istream,
- CamelException *ex);
-
- int (*export_keys) (CamelCipherContext *context, GPtrArray *keys,
- struct _CamelStream *ostream, CamelException *ex);
-} CamelCipherContextClass;
-
-CamelType camel_cipher_context_get_type (void);
-
-CamelCipherContext *camel_cipher_context_new (CamelSession *session);
-
-void camel_cipher_context_construct (CamelCipherContext *context, CamelSession *session);
-
-/* cipher context util routines */
-CamelCipherHash camel_cipher_id_to_hash (CamelCipherContext *context, const char *id);
-const char * camel_cipher_hash_to_id (CamelCipherContext *context, CamelCipherHash hash);
-
-/* FIXME:
- There are some inconsistencies here, the api's should probably handle CamelMimePart's as input/outputs,
- Something that might generate a multipart/signed should do it as part of that processing, internally
- to the cipher, etc etc. */
-
-/* cipher routines */
-int camel_cipher_sign (CamelCipherContext *context, const char *userid, CamelCipherHash hash,
- struct _CamelMimePart *ipart, struct _CamelMimePart *opart, CamelException *ex);
-CamelCipherValidity *camel_cipher_verify (CamelCipherContext *context, struct _CamelMimePart *ipart, CamelException *ex);
-int camel_cipher_encrypt (CamelCipherContext *context, const char *userid,
- GPtrArray *recipients, struct _CamelMimePart *ipart, struct _CamelMimePart *opart,
- CamelException *ex);
-CamelCipherValidity *camel_cipher_decrypt (CamelCipherContext *context, struct _CamelMimePart *ipart, struct _CamelMimePart *opart,
- CamelException *ex);
-
-/* key/certificate routines */
-int camel_cipher_import_keys (CamelCipherContext *context, struct _CamelStream *istream,
- CamelException *ex);
-int camel_cipher_export_keys (CamelCipherContext *context, GPtrArray *keys,
- struct _CamelStream *ostream, CamelException *ex);
-
-/* CamelCipherValidity utility functions */
-CamelCipherValidity *camel_cipher_validity_new (void);
-void camel_cipher_validity_init (CamelCipherValidity *validity);
-gboolean camel_cipher_validity_get_valid (CamelCipherValidity *validity);
-void camel_cipher_validity_set_valid (CamelCipherValidity *validity, gboolean valid);
-char *camel_cipher_validity_get_description (CamelCipherValidity *validity);
-void camel_cipher_validity_set_description (CamelCipherValidity *validity, const char *description);
-void camel_cipher_validity_clear (CamelCipherValidity *validity);
-CamelCipherValidity *camel_cipher_validity_clone(CamelCipherValidity *vin);
-void camel_cipher_validity_envelope(CamelCipherValidity *valid, CamelCipherValidity *outer);
-void camel_cipher_validity_free (CamelCipherValidity *validity);
-
-/* utility functions */
-int camel_cipher_canonical_to_stream(CamelMimePart *part, guint32 flags, CamelStream *ostream);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_CIPHER_CONTEXT_H */
diff --git a/camel/camel-data-cache.c b/camel/camel-data-cache.c
deleted file mode 100644
index a585f59a9d..0000000000
--- a/camel/camel-data-cache.c
+++ /dev/null
@@ -1,421 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-message-cache.c: Class for a Camel cache.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * Copyright (C) 2001 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <sys/types.h>
-#include <ctype.h>
-#include <dirent.h>
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-#ifdef HAVE_ALLOCA_H
-#include <alloca.h>
-#endif
-
-#include "camel-data-cache.h"
-#include "camel-exception.h"
-#include "camel-stream-fs.h"
-#include "camel-stream-mem.h"
-#include "camel-file-utils.h"
-
-extern int camel_verbose_debug;
-#define dd(x) (camel_verbose_debug?(x):0)
-#define d(x)
-
-/* how many 'bits' of hash are used to key the toplevel directory */
-#define CAMEL_DATA_CACHE_BITS (6)
-#define CAMEL_DATA_CACHE_MASK ((1<<CAMEL_DATA_CACHE_BITS)-1)
-
-/* timeout before a cache dir is checked again for expired entries,
- once an hour should be enough */
-#define CAMEL_DATA_CACHE_CYCLE_TIME (60*60)
-
-struct _CamelDataCachePrivate {
- CamelObjectBag *busy_bag;
-
- int expire_inc;
- time_t expire_last[1<<CAMEL_DATA_CACHE_BITS];
-};
-
-static CamelObject *camel_data_cache_parent;
-
-static void data_cache_class_init(CamelDataCacheClass *klass)
-{
- camel_data_cache_parent = (CamelObject *)camel_object_get_type ();
-
-#if 0
- klass->add = data_cache_add;
- klass->get = data_cache_get;
- klass->close = data_cache_close;
- klass->remove = data_cache_remove;
- klass->clear = data_cache_clear;
-#endif
-}
-
-static void data_cache_init(CamelDataCache *cdc, CamelDataCacheClass *klass)
-{
- struct _CamelDataCachePrivate *p;
-
- p = cdc->priv = g_malloc0(sizeof(*cdc->priv));
- p->busy_bag = camel_object_bag_new(g_str_hash, g_str_equal, (CamelCopyFunc)g_strdup, g_free);
-}
-
-static void data_cache_finalise(CamelDataCache *cdc)
-{
- struct _CamelDataCachePrivate *p;
-
- p = cdc->priv;
- camel_object_bag_destroy(p->busy_bag);
- g_free(p);
-
- g_free (cdc->path);
-}
-
-CamelType
-camel_data_cache_get_type(void)
-{
- static CamelType camel_data_cache_type = CAMEL_INVALID_TYPE;
-
- if (camel_data_cache_type == CAMEL_INVALID_TYPE) {
- camel_data_cache_type = camel_type_register(
- CAMEL_OBJECT_TYPE, "CamelDataCache",
- sizeof (CamelDataCache),
- sizeof (CamelDataCacheClass),
- (CamelObjectClassInitFunc) data_cache_class_init,
- NULL,
- (CamelObjectInitFunc) data_cache_init,
- (CamelObjectFinalizeFunc) data_cache_finalise);
- }
-
- return camel_data_cache_type;
-}
-
-/**
- * camel_data_cache_new:
- * @path: Base path of cache, subdirectories will be created here.
- * @flags: Open flags, none defined.
- * @ex:
- *
- * Create a new data cache.
- *
- * Return value: A new cache object, or NULL if the base path cannot
- * be written to.
- **/
-CamelDataCache *
-camel_data_cache_new(const char *path, guint32 flags, CamelException *ex)
-{
- CamelDataCache *cdc;
-
- if (camel_mkdir (path, 0700) == -1) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Unable to create cache path"));
- return NULL;
- }
-
- cdc = (CamelDataCache *)camel_object_new(CAMEL_DATA_CACHE_TYPE);
-
- cdc->path = g_strdup(path);
- cdc->flags = flags;
- cdc->expire_age = -1;
- cdc->expire_access = -1;
-
- return cdc;
-}
-
-/**
- * camel_data_cache_set_expire_age:
- * @cdc:
- * @when: Timeout for age expiry, or -1 to disable.
- *
- * Set the cache expiration policy for aged entries.
- *
- * Items in the cache older than @when seconds may be
- * flushed at any time. Items are expired in a lazy
- * manner, so it is indeterminate when the items will
- * physically be removed.
- *
- * Note you can set both an age and an access limit. The
- * age acts as a hard limit on cache entries.
- **/
-void
-camel_data_cache_set_expire_age(CamelDataCache *cdc, time_t when)
-{
- cdc->expire_age = when;
-}
-
-/**
- * camel_data_cache_set_expire_access:
- * @cdc:
- * @when: Timeout for access, or -1 to disable access expiry.
- *
- * Set the cache expiration policy for access times.
- *
- * Items in the cache which haven't been accessed for @when
- * seconds may be expired at any time. Items are expired in a lazy
- * manner, so it is indeterminate when the items will
- * physically be removed.
- *
- * Note you can set both an age and an access limit. The
- * age acts as a hard limit on cache entries.
- **/
-void
-camel_data_cache_set_expire_access(CamelDataCache *cdc, time_t when)
-{
- cdc->expire_access = when;
-}
-
-static void
-data_cache_expire(CamelDataCache *cdc, const char *path, const char *keep, time_t now)
-{
- DIR *dir;
- struct dirent *d;
- GString *s;
- struct stat st;
- CamelStream *stream;
-
- dir = opendir(path);
- if (dir == NULL)
- return;
-
- s = g_string_new("");
- while ( (d = readdir(dir)) ) {
- if (strcmp(d->d_name, keep) == 0)
- continue;
-
- g_string_printf (s, "%s/%s", path, d->d_name);
- dd(printf("Checking '%s' for expiry\n", s->str));
- if (stat(s->str, &st) == 0
- && S_ISREG(st.st_mode)
- && ((cdc->expire_age != -1 && st.st_mtime + cdc->expire_age < now)
- || (cdc->expire_access != -1 && st.st_atime + cdc->expire_access < now))) {
- dd(printf("Has expired! Removing!\n"));
- unlink(s->str);
- stream = camel_object_bag_get(cdc->priv->busy_bag, s->str);
- if (stream) {
- camel_object_bag_remove(cdc->priv->busy_bag, stream);
- camel_object_unref(stream);
- }
- }
- }
- g_string_free(s, TRUE);
- closedir(dir);
-}
-
-/* Since we have to stat the directory anyway, we use this opportunity to
- lazily expire old data.
- If it is this directories 'turn', and we haven't done it for CYCLE_TIME seconds,
- then we perform an expiry run */
-static char *
-data_cache_path(CamelDataCache *cdc, int create, const char *path, const char *key)
-{
- char *dir, *real, *tmp;
- guint32 hash;
-
- hash = g_str_hash(key);
- hash = (hash>>5)&CAMEL_DATA_CACHE_MASK;
- dir = alloca(strlen(cdc->path) + strlen(path) + 8);
- sprintf(dir, "%s/%s/%02x", cdc->path, path, hash);
- if (access(dir, F_OK) == -1) {
- if (create)
- camel_mkdir (dir, 0700);
- } else if (cdc->priv->expire_inc == hash
- && (cdc->expire_age != -1 || cdc->expire_access != -1)) {
- time_t now;
-
- dd(printf("Checking expire cycle time on dir '%s'\n", dir));
-
- /* This has a race, but at worst we re-run an expire cycle which is safe */
- now = time(0);
- if (cdc->priv->expire_last[hash] + CAMEL_DATA_CACHE_CYCLE_TIME < now) {
- cdc->priv->expire_last[hash] = now;
- data_cache_expire(cdc, dir, key, now);
- }
- cdc->priv->expire_inc = (cdc->priv->expire_inc + 1) & CAMEL_DATA_CACHE_MASK;
- }
-
- tmp = camel_file_util_safe_filename(key);
- real = g_strdup_printf("%s/%s", dir, tmp);
- g_free(tmp);
-
- return real;
-}
-
-/**
- * camel_data_cache_add:
- * @cdc:
- * @path: Relative path of item to add.
- * @key: Key of item to add.
- * @ex:
- *
- * Add a new item to the cache.
- *
- * The key and the path combine to form a unique key used to store
- * the item.
- *
- * Potentially, expiry processing will be performed while this call
- * is executing.
- *
- * Return value: A CamelStream (file) opened in read-write mode.
- * The caller must unref this when finished.
- **/
-CamelStream *
-camel_data_cache_add(CamelDataCache *cdc, const char *path, const char *key, CamelException *ex)
-{
- char *real;
- CamelStream *stream;
-
- real = data_cache_path(cdc, TRUE, path, key);
- stream = camel_object_bag_reserve(cdc->priv->busy_bag, real);
- if (stream) {
- unlink(real);
- camel_object_bag_remove(cdc->priv->busy_bag, stream);
- camel_object_unref(stream);
- }
-
- stream = camel_stream_fs_new_with_name(real, O_RDWR|O_CREAT|O_TRUNC, 0600);
- if (stream)
- camel_object_bag_add(cdc->priv->busy_bag, real, stream);
- else
- camel_object_bag_abort(cdc->priv->busy_bag, real);
-
- g_free(real);
-
- return stream;
-}
-
-/**
- * camel_data_cache_get:
- * @cdc:
- * @path: Path to the (sub) cache the item exists in.
- * @key: Key for the cache item.
- * @ex:
- *
- * Lookup an item in the cache. If the item exists, a stream
- * is returned for the item. The stream may be shared by
- * multiple callers, so ensure the stream is in a valid state
- * through external locking.
- *
- * Return value: A cache item, or NULL if the cache item does not exist.
- **/
-CamelStream *
-camel_data_cache_get(CamelDataCache *cdc, const char *path, const char *key, CamelException *ex)
-{
- char *real;
- CamelStream *stream;
-
- real = data_cache_path(cdc, FALSE, path, key);
- stream = camel_object_bag_reserve(cdc->priv->busy_bag, real);
- if (!stream) {
- stream = camel_stream_fs_new_with_name(real, O_RDWR, 0600);
- if (stream)
- camel_object_bag_add(cdc->priv->busy_bag, real, stream);
- else
- camel_object_bag_abort(cdc->priv->busy_bag, real);
- }
- g_free(real);
-
- return stream;
-}
-
-/**
- * camel_data_cache_remove:
- * @cdc:
- * @path:
- * @key:
- * @ex:
- *
- * Remove/expire a cache item.
- *
- * Return value:
- **/
-int
-camel_data_cache_remove(CamelDataCache *cdc, const char *path, const char *key, CamelException *ex)
-{
- CamelStream *stream;
- char *real;
- int ret;
-
- real = data_cache_path(cdc, FALSE, path, key);
- stream = camel_object_bag_get(cdc->priv->busy_bag, real);
- if (stream) {
- camel_object_bag_remove(cdc->priv->busy_bag, stream);
- camel_object_unref(stream);
- }
-
- /* maybe we were a mem stream */
- if (unlink (real) == -1 && errno != ENOENT) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not remove cache entry: %s: %s"),
- real, g_strerror (errno));
- ret = -1;
- } else {
- ret = 0;
- }
-
- g_free(real);
-
- return ret;
-}
-
-/**
- * camel_data_cache_rename:
- * @cache:
- * @old:
- * @new:
- * @ex:
- *
- * Rename a cache path. All cache items accessed from the old path
- * are accessible using the new path.
- *
- * CURRENTLY UNIMPLEMENTED
- *
- * Return value: -1 on error.
- **/
-int camel_data_cache_rename(CamelDataCache *cache,
- const char *old, const char *new, CamelException *ex)
-{
- /* blah dont care yet */
- return -1;
-}
-
-/**
- * camel_data_cache_clear:
- * @cache:
- * @path: Path to clear, or NULL to clear all items in
- * all paths.
- * @ex:
- *
- * Clear all items in a given cache path or all items in the cache.
- *
- * CURRENTLY_UNIMPLEMENTED
- *
- * Return value: -1 on error.
- **/
-int
-camel_data_cache_clear(CamelDataCache *cache, const char *path, CamelException *ex)
-{
- /* nor for this? */
- return -1;
-}
diff --git a/camel/camel-data-cache.h b/camel/camel-data-cache.h
deleted file mode 100644
index ab6c29a622..0000000000
--- a/camel/camel-data-cache.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-data-cache.h: Class for a Camel filesystem cache
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * Copyright (C) 2001 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifndef CAMEL_DATA_CACHE_H
-#define CAMEL_DATA_CACHE_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include <glib.h>
-
-#include <camel/camel-stream.h>
-#include <camel/camel-exception.h>
-
-#define CAMEL_DATA_CACHE_TYPE (camel_data_cache_get_type ())
-#define CAMEL_DATA_CACHE(obj) (CAMEL_CHECK_CAST((obj), CAMEL_DATA_CACHE_TYPE, CamelFolder))
-#define CAMEL_DATA_CACHE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_DATA_CACHE_TYPE, CamelFolderClass))
-#define CAMEL_IS_DATA_CACHE(o) (CAMEL_CHECK_TYPE((o), CAMEL_DATA_CACHE_TYPE))
-
-typedef struct _CamelDataCache CamelDataCache;
-typedef struct _CamelDataCacheClass CamelDataCacheClass;
-
-struct _CamelDataCache {
- CamelObject parent_object;
-
- struct _CamelDataCachePrivate *priv;
-
- char *path;
- guint32 flags;
-
- time_t expire_age;
- time_t expire_access;
-};
-
-struct _CamelDataCacheClass {
- CamelObjectClass parent_class;
-
- /* None are virtual yet */
-#if 0
- /* Virtual methods */
- CamelStream *(*add)(CamelDataCache *cmc, const char *path, const char *key, CamelException *ex);
- CamelStream *(*get)(CamelDataCache *cmc, const char *path, const char *key, CamelException *ex);
- int (*close)(CamelDataCache *cmc, CamelStream *stream, CamelException *ex);
- int (*remove)(CamelDataCache *cmc, const char *path, const char *key, CamelException *ex);
-
- int (*clear)(CamelDataCache *cmc, const char *path, CamelException *ex);
-#endif
-};
-
-/* public methods */
-CamelDataCache *camel_data_cache_new(const char *path, guint32 flags, CamelException *ex);
-
-void camel_data_cache_set_expire_age(CamelDataCache *cache, time_t when);
-void camel_data_cache_set_expire_access(CamelDataCache *cdc, time_t when);
-
-int camel_data_cache_rename(CamelDataCache *cache,
- const char *old, const char *new, CamelException *ex);
-
-CamelStream *camel_data_cache_add(CamelDataCache *cache,
- const char *path, const char *key, CamelException *ex);
-CamelStream *camel_data_cache_get(CamelDataCache *cache,
- const char *path, const char *key, CamelException *ex);
-int camel_data_cache_remove(CamelDataCache *cache,
- const char *path, const char *key, CamelException *ex);
-
-int camel_data_cache_clear(CamelDataCache *cache,
- const char *path, CamelException *ex);
-
-/* Standard Camel function */
-CamelType camel_data_cache_get_type (void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_DATA_CACHE_H */
diff --git a/camel/camel-data-wrapper.c b/camel/camel-data-wrapper.c
deleted file mode 100644
index e30cd10927..0000000000
--- a/camel/camel-data-wrapper.c
+++ /dev/null
@@ -1,389 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; -*- */
-/*
- *
- * Authors: Bertrand Guiheneuf <bertrand@helixcode.com>
- *
- * Copyright 1999-2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <errno.h>
-
-#include "camel-data-wrapper.h"
-#include "camel-stream.h"
-#include "camel-stream-filter.h"
-#include "camel-mime-filter-basic.h"
-#include "camel-mime-filter-crlf.h"
-#include "camel-exception.h"
-#include "camel-private.h"
-
-#define d(x)
-
-static CamelObjectClass *parent_class = NULL;
-
-/* Returns the class for a CamelDataWrapper */
-#define CDW_CLASS(so) CAMEL_DATA_WRAPPER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-
-static int construct_from_stream(CamelDataWrapper *, CamelStream *);
-static ssize_t write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream);
-static ssize_t decode_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream);
-static void set_mime_type (CamelDataWrapper *data_wrapper, const char *mime_type);
-static gchar *get_mime_type (CamelDataWrapper *data_wrapper);
-static CamelContentType *get_mime_type_field (CamelDataWrapper *data_wrapper);
-static void set_mime_type_field (CamelDataWrapper *data_wrapper, CamelContentType *mime_type);
-static gboolean is_offline (CamelDataWrapper *data_wrapper);
-
-static void
-camel_data_wrapper_class_init (CamelDataWrapperClass *camel_data_wrapper_class)
-{
- parent_class = camel_type_get_global_classfuncs (camel_object_get_type ());
-
- /* virtual method definition */
- camel_data_wrapper_class->write_to_stream = write_to_stream;
- camel_data_wrapper_class->decode_to_stream = decode_to_stream;
- camel_data_wrapper_class->set_mime_type = set_mime_type;
- camel_data_wrapper_class->get_mime_type = get_mime_type;
- camel_data_wrapper_class->get_mime_type_field = get_mime_type_field;
- camel_data_wrapper_class->set_mime_type_field = set_mime_type_field;
- camel_data_wrapper_class->construct_from_stream = construct_from_stream;
- camel_data_wrapper_class->is_offline = is_offline;
-}
-
-static void
-camel_data_wrapper_init (gpointer object, gpointer klass)
-{
- CamelDataWrapper *camel_data_wrapper = CAMEL_DATA_WRAPPER (object);
-
- camel_data_wrapper->priv = g_malloc (sizeof (struct _CamelDataWrapperPrivate));
- pthread_mutex_init (&camel_data_wrapper->priv->stream_lock, NULL);
-
- camel_data_wrapper->mime_type = camel_content_type_new ("application", "octet-stream");
- camel_data_wrapper->encoding = CAMEL_TRANSFER_ENCODING_DEFAULT;
- camel_data_wrapper->offline = FALSE;
-}
-
-static void
-camel_data_wrapper_finalize (CamelObject *object)
-{
- CamelDataWrapper *camel_data_wrapper = CAMEL_DATA_WRAPPER (object);
-
- pthread_mutex_destroy (&camel_data_wrapper->priv->stream_lock);
-
- g_free (camel_data_wrapper->priv);
-
- if (camel_data_wrapper->mime_type)
- camel_content_type_unref (camel_data_wrapper->mime_type);
-
- if (camel_data_wrapper->stream)
- camel_object_unref (camel_data_wrapper->stream);
-}
-
-CamelType
-camel_data_wrapper_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (CAMEL_OBJECT_TYPE,
- "CamelDataWrapper",
- sizeof (CamelDataWrapper),
- sizeof (CamelDataWrapperClass),
- (CamelObjectClassInitFunc) camel_data_wrapper_class_init,
- NULL,
- (CamelObjectInitFunc) camel_data_wrapper_init,
- (CamelObjectFinalizeFunc) camel_data_wrapper_finalize);
- }
-
- return type;
-}
-
-
-CamelDataWrapper *
-camel_data_wrapper_new (void)
-{
- return (CamelDataWrapper *) camel_object_new (CAMEL_DATA_WRAPPER_TYPE);
-}
-
-static ssize_t
-write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
-{
- ssize_t ret;
-
- if (data_wrapper->stream == NULL) {
- return -1;
- }
-
- CAMEL_DATA_WRAPPER_LOCK (data_wrapper, stream_lock);
- if (camel_stream_reset (data_wrapper->stream) == -1) {
- CAMEL_DATA_WRAPPER_UNLOCK (data_wrapper, stream_lock);
- return -1;
- }
-
- ret = camel_stream_write_to_stream (data_wrapper->stream, stream);
-
- CAMEL_DATA_WRAPPER_UNLOCK (data_wrapper, stream_lock);
-
- return ret;
-}
-
-/**
- * camel_data_wrapper_write_to_stream:
- * @data_wrapper: a data wrapper
- * @stream: stream for data to be written to
- * @ex: a CamelException
- *
- * Writes the data content to @stream in a machine-independent format
- * appropriate for the data. It should be possible to construct an
- * equivalent data wrapper object later by passing this stream to
- * camel_data_wrapper_construct_from_stream().
- *
- * Return value: the number of bytes written, or -1 if an error
- * occurs.
- **/
-ssize_t
-camel_data_wrapper_write_to_stream (CamelDataWrapper *data_wrapper,
- CamelStream *stream)
-{
- g_return_val_if_fail (CAMEL_IS_DATA_WRAPPER (data_wrapper), -1);
- g_return_val_if_fail (CAMEL_IS_STREAM (stream), -1);
-
- return CDW_CLASS (data_wrapper)->write_to_stream (data_wrapper, stream);
-}
-
-
-static ssize_t
-decode_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
-{
- CamelMimeFilter *filter;
- CamelStream *fstream;
- ssize_t ret;
-
- fstream = (CamelStream *) camel_stream_filter_new_with_stream (stream);
-
- switch (data_wrapper->encoding) {
- case CAMEL_TRANSFER_ENCODING_BASE64:
- filter = (CamelMimeFilter *) camel_mime_filter_basic_new_type (CAMEL_MIME_FILTER_BASIC_BASE64_DEC);
- camel_stream_filter_add (CAMEL_STREAM_FILTER (fstream), filter);
- camel_object_unref (filter);
- break;
- case CAMEL_TRANSFER_ENCODING_QUOTEDPRINTABLE:
- filter = (CamelMimeFilter *) camel_mime_filter_basic_new_type (CAMEL_MIME_FILTER_BASIC_QP_DEC);
- camel_stream_filter_add (CAMEL_STREAM_FILTER (fstream), filter);
- camel_object_unref (filter);
- break;
- case CAMEL_TRANSFER_ENCODING_UUENCODE:
- filter = (CamelMimeFilter *) camel_mime_filter_basic_new_type (CAMEL_MIME_FILTER_BASIC_UU_DEC);
- camel_stream_filter_add (CAMEL_STREAM_FILTER (fstream), filter);
- camel_object_unref (filter);
- break;
- default:
- break;
- }
-
- if (camel_content_type_is (data_wrapper->mime_type, "text", "*")) {
- filter = camel_mime_filter_crlf_new (CAMEL_MIME_FILTER_CRLF_DECODE,
- CAMEL_MIME_FILTER_CRLF_MODE_CRLF_ONLY);
- camel_stream_filter_add (CAMEL_STREAM_FILTER (fstream), filter);
- camel_object_unref (filter);
- }
-
- ret = camel_data_wrapper_write_to_stream (data_wrapper, fstream);
- camel_stream_flush (fstream);
- camel_object_unref (fstream);
-
- return ret;
-}
-
-/**
- * camel_data_wrapper_decode_to_stream:
- * @data_wrapper: a data wrapper
- * @stream: stream for decoded data to be written to
- * @ex: a CamelException
- *
- * Writes the decoded data content to @stream.
- *
- * Return value: the number of bytes written, or -1 if an error
- * occurs.
- **/
-ssize_t
-camel_data_wrapper_decode_to_stream (CamelDataWrapper *data_wrapper,
- CamelStream *stream)
-{
- g_return_val_if_fail (CAMEL_IS_DATA_WRAPPER (data_wrapper), -1);
- g_return_val_if_fail (CAMEL_IS_STREAM (stream), -1);
-
- return CDW_CLASS (data_wrapper)->decode_to_stream (data_wrapper, stream);
-}
-
-
-static int
-construct_from_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
-{
- if (data_wrapper->stream)
- camel_object_unref (data_wrapper->stream);
-
- data_wrapper->stream = stream;
- camel_object_ref (stream);
- return 0;
-}
-
-/**
- * camel_data_wrapper_construct_from_stream:
- * @data_wrapper: a data wrapper
- * @stream: A stream that can be read from.
- *
- * Constructs the content of the data wrapper from the
- * supplied @stream.
- *
- * Return value: -1 on error.
- **/
-int
-camel_data_wrapper_construct_from_stream (CamelDataWrapper *data_wrapper,
- CamelStream *stream)
-{
- g_return_val_if_fail (CAMEL_IS_DATA_WRAPPER (data_wrapper), -1);
- g_return_val_if_fail (CAMEL_IS_STREAM (stream), -1);
-
- return CDW_CLASS (data_wrapper)->construct_from_stream (data_wrapper, stream);
-}
-
-
-static void
-set_mime_type (CamelDataWrapper *data_wrapper, const char *mime_type)
-{
- if (data_wrapper->mime_type)
- camel_content_type_unref (data_wrapper->mime_type);
- data_wrapper->mime_type = camel_content_type_decode (mime_type);
-}
-
-/**
- * camel_data_wrapper_set_mime_type:
- * @data_wrapper: a data wrapper
- * @mime_type: the text representation of a MIME type
- *
- * This sets the data wrapper's MIME type.
- * It might fail, but you won't know. It will allow you to set
- * Content-Type parameters on the data wrapper, which are meaningless.
- * You should not be allowed to change the MIME type of a data wrapper
- * that contains data, or at least, if you do, it should invalidate the
- * data.
- **/
-void
-camel_data_wrapper_set_mime_type (CamelDataWrapper *data_wrapper,
- const char *mime_type)
-{
- g_return_if_fail (CAMEL_IS_DATA_WRAPPER (data_wrapper));
- g_return_if_fail (mime_type != NULL);
-
- CDW_CLASS (data_wrapper)->set_mime_type (data_wrapper, mime_type);
-}
-
-static char *
-get_mime_type (CamelDataWrapper *data_wrapper)
-{
- return camel_content_type_simple (data_wrapper->mime_type);
-}
-
-/**
- * camel_data_wrapper_get_mime_type:
- * @data_wrapper: a data wrapper
- *
- * Return value: the text form of the data wrapper's MIME type,
- * which the caller must free.
- **/
-char *
-camel_data_wrapper_get_mime_type (CamelDataWrapper *data_wrapper)
-{
- g_return_val_if_fail (CAMEL_IS_DATA_WRAPPER (data_wrapper), NULL);
-
- return CDW_CLASS (data_wrapper)->get_mime_type (data_wrapper);
-}
-
-
-static CamelContentType *
-get_mime_type_field (CamelDataWrapper *data_wrapper)
-{
- return data_wrapper->mime_type;
-}
-
-/**
- * camel_data_wrapper_get_mime_type_field:
- * @data_wrapper: a data wrapper
- *
- * Return value: the parsed form of the data wrapper's MIME type
- **/
-CamelContentType *
-camel_data_wrapper_get_mime_type_field (CamelDataWrapper *data_wrapper)
-{
- g_return_val_if_fail (CAMEL_IS_DATA_WRAPPER (data_wrapper), NULL);
-
- return CDW_CLASS (data_wrapper)->get_mime_type_field (data_wrapper);
-}
-
-/**
- * camel_data_wrapper_set_mime_type_field:
- * @data_wrapper: a data wrapper
- * @mime_type: the parsed representation of a MIME type
- *
- * This sets the data wrapper's MIME type. It suffers from the same
- * flaws as camel_data_wrapper_set_mime_type.
- **/
-static void
-set_mime_type_field (CamelDataWrapper *data_wrapper,
- CamelContentType *mime_type)
-{
- g_return_if_fail (CAMEL_IS_DATA_WRAPPER (data_wrapper));
- g_return_if_fail (mime_type != NULL);
-
- if (data_wrapper->mime_type)
- camel_content_type_unref (data_wrapper->mime_type);
- data_wrapper->mime_type = mime_type;
- if (mime_type)
- camel_content_type_ref (data_wrapper->mime_type);
-}
-
-void
-camel_data_wrapper_set_mime_type_field (CamelDataWrapper *data_wrapper,
- CamelContentType *mime_type)
-{
- CDW_CLASS (data_wrapper)->set_mime_type_field (data_wrapper, mime_type);
-}
-
-
-static gboolean
-is_offline (CamelDataWrapper *data_wrapper)
-{
- return data_wrapper->offline;
-}
-
-/**
- * camel_data_wrapper_is_offline:
- * @data_wrapper: a data wrapper
- *
- * Return value: whether @data_wrapper is "offline" (data stored
- * remotely) or not. Some optional code paths may choose to not
- * operate on offline data.
- **/
-gboolean
-camel_data_wrapper_is_offline (CamelDataWrapper *data_wrapper)
-{
- return CDW_CLASS (data_wrapper)->is_offline (data_wrapper);
-}
diff --git a/camel/camel-data-wrapper.h b/camel/camel-data-wrapper.h
deleted file mode 100644
index 1e22595019..0000000000
--- a/camel/camel-data-wrapper.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Bertrand Guiheneuf <bertrand@helixcode.com>
- * Michael Zucchi <notzed@ximian.com>
- * Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 1999-2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifndef CAMEL_DATA_WRAPPER_H
-#define CAMEL_DATA_WRAPPER_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <glib.h>
-#include <sys/types.h>
-#include <camel/camel-object.h>
-#include <camel/camel-mime-utils.h>
-
-#define CAMEL_DATA_WRAPPER_TYPE (camel_data_wrapper_get_type ())
-#define CAMEL_DATA_WRAPPER(obj) (CAMEL_CHECK_CAST((obj), CAMEL_DATA_WRAPPER_TYPE, CamelDataWrapper))
-#define CAMEL_DATA_WRAPPER_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_DATA_WRAPPER_TYPE, CamelDataWrapperClass))
-#define CAMEL_IS_DATA_WRAPPER(o) (CAMEL_CHECK_TYPE((o), CAMEL_DATA_WRAPPER_TYPE))
-
-struct _CamelDataWrapper {
- CamelObject parent_object;
- struct _CamelDataWrapperPrivate *priv;
-
- CamelTransferEncoding encoding;
-
- CamelContentType *mime_type;
- CamelStream *stream;
-
- unsigned int offline:1;
-};
-
-typedef struct {
- CamelObjectClass parent_class;
-
- /* Virtual methods */
- void (*set_mime_type) (CamelDataWrapper *data_wrapper,
- const char *mime_type);
- char * (*get_mime_type) (CamelDataWrapper *data_wrapper);
- CamelContentType * (*get_mime_type_field) (CamelDataWrapper *data_wrapper);
- void (*set_mime_type_field) (CamelDataWrapper *data_wrapper,
- CamelContentType *mime_type_field);
-
- ssize_t (*write_to_stream) (CamelDataWrapper *data_wrapper,
- CamelStream *stream);
-
- ssize_t (*decode_to_stream) (CamelDataWrapper *data_wrapper,
- CamelStream *stream);
-
- int (*construct_from_stream) (CamelDataWrapper *data_wrapper,
- CamelStream *);
-
- gboolean (*is_offline) (CamelDataWrapper *data_wrapper);
-} CamelDataWrapperClass;
-
-/* Standard Camel function */
-CamelType camel_data_wrapper_get_type (void);
-
-/* public methods */
-CamelDataWrapper *camel_data_wrapper_new(void);
-ssize_t camel_data_wrapper_write_to_stream (CamelDataWrapper *data_wrapper,
- CamelStream *stream);
-ssize_t camel_data_wrapper_decode_to_stream (CamelDataWrapper *data_wrapper,
- CamelStream *stream);
-
-void camel_data_wrapper_set_mime_type (CamelDataWrapper *data_wrapper,
- const char *mime_type);
-char *camel_data_wrapper_get_mime_type (CamelDataWrapper *data_wrapper);
-CamelContentType *camel_data_wrapper_get_mime_type_field (CamelDataWrapper *data_wrapper);
-void camel_data_wrapper_set_mime_type_field (CamelDataWrapper *data_wrapper,
- CamelContentType *mime_type);
-
-int camel_data_wrapper_construct_from_stream (CamelDataWrapper *data_wrapper,
- CamelStream *stream);
-
-gboolean camel_data_wrapper_is_offline (CamelDataWrapper *data_wrapper);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_DATA_WRAPPER_H */
diff --git a/camel/camel-digest-folder.c b/camel/camel-digest-folder.c
deleted file mode 100644
index b2c81b5d4d..0000000000
--- a/camel/camel-digest-folder.c
+++ /dev/null
@@ -1,396 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2001-2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "camel-digest-folder.h"
-#include "camel-digest-summary.h"
-
-#include "camel-exception.h"
-#include "camel-multipart.h"
-#include "camel-mime-message.h"
-#include "camel-folder-search.h"
-
-#define d(x)
-
-#define _PRIVATE(o) (((CamelDigestFolder *)(o))->priv)
-
-struct _CamelDigestFolderPrivate {
- CamelMimeMessage *message;
- CamelFolderSearch *search;
- GMutex *search_lock;
-};
-
-#define CAMEL_DIGEST_FOLDER_LOCK(f, l) (g_mutex_lock(((CamelDigestFolder *)f)->priv->l))
-#define CAMEL_DIGEST_FOLDER_UNLOCK(f, l) (g_mutex_unlock(((CamelDigestFolder *)f)->priv->l))
-
-static CamelFolderClass *parent_class = NULL;
-
-static void digest_refresh_info (CamelFolder *folder, CamelException *ex);
-static void digest_sync (CamelFolder *folder, gboolean expunge, CamelException *ex);
-static const char *digest_get_full_name (CamelFolder *folder);
-static void digest_expunge (CamelFolder *folder, CamelException *ex);
-
-/* message manipulation */
-static CamelMimeMessage *digest_get_message (CamelFolder *folder, const gchar *uid,
- CamelException *ex);
-static void digest_append_message (CamelFolder *folder, CamelMimeMessage *message,
- const CamelMessageInfo *info, char **appended_uid, CamelException *ex);
-static void digest_transfer_messages_to (CamelFolder *source, GPtrArray *uids,
- CamelFolder *dest, GPtrArray **transferred_uids,
- gboolean delete_originals, CamelException *ex);
-
-static GPtrArray *digest_search_by_expression (CamelFolder *folder, const char *expression,
- CamelException *ex);
-
-static GPtrArray *digest_search_by_uids (CamelFolder *folder, const char *expression,
- GPtrArray *uids, CamelException *ex);
-
-static void digest_search_free (CamelFolder *folder, GPtrArray *result);
-
-static void
-camel_digest_folder_class_init (CamelDigestFolderClass *camel_digest_folder_class)
-{
- CamelFolderClass *camel_folder_class = CAMEL_FOLDER_CLASS (camel_digest_folder_class);
-
- parent_class = CAMEL_FOLDER_CLASS (camel_type_get_global_classfuncs (camel_folder_get_type ()));
-
- /* virtual method definition */
-
- /* virtual method overload */
- camel_folder_class->refresh_info = digest_refresh_info;
- camel_folder_class->sync = digest_sync;
- camel_folder_class->expunge = digest_expunge;
- camel_folder_class->get_full_name = digest_get_full_name;
-
- camel_folder_class->get_message = digest_get_message;
- camel_folder_class->append_message = digest_append_message;
- camel_folder_class->transfer_messages_to = digest_transfer_messages_to;
-
- camel_folder_class->search_by_expression = digest_search_by_expression;
- camel_folder_class->search_by_uids = digest_search_by_uids;
- camel_folder_class->search_free = digest_search_free;
-}
-
-static void
-camel_digest_folder_init (gpointer object, gpointer klass)
-{
- CamelDigestFolder *digest_folder = CAMEL_DIGEST_FOLDER (object);
- CamelFolder *folder = CAMEL_FOLDER (object);
-
- folder->folder_flags |= CAMEL_FOLDER_HAS_SUMMARY_CAPABILITY | CAMEL_FOLDER_HAS_SEARCH_CAPABILITY;
-
- folder->summary = camel_digest_summary_new ();
-
- digest_folder->priv = g_new (struct _CamelDigestFolderPrivate, 1);
- digest_folder->priv->message = NULL;
- digest_folder->priv->search = NULL;
- digest_folder->priv->search_lock = g_mutex_new ();
-}
-
-static void
-digest_finalize (CamelObject *object)
-{
- CamelDigestFolder *digest_folder = CAMEL_DIGEST_FOLDER (object);
- CamelFolder *folder = CAMEL_FOLDER (object);
-
- if (folder->summary) {
- camel_object_unref (folder->summary);
- folder->summary = NULL;
- }
-
- camel_object_unref (digest_folder->priv->message);
-
- if (digest_folder->priv->search)
- camel_object_unref (digest_folder->priv->search);
-
- g_mutex_free (digest_folder->priv->search_lock);
-
- g_free (digest_folder->priv);
-}
-
-CamelType
-camel_digest_folder_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (CAMEL_FOLDER_TYPE,
- "CamelDigestFolder",
- sizeof (CamelDigestFolder),
- sizeof (CamelDigestFolderClass),
- (CamelObjectClassInitFunc) camel_digest_folder_class_init,
- NULL,
- (CamelObjectInitFunc) camel_digest_folder_init,
- (CamelObjectFinalizeFunc) digest_finalize);
- }
-
- return type;
-}
-
-static gboolean
-multipart_contains_message_parts (CamelMultipart *multipart)
-{
- gboolean has_message_parts = FALSE;
- CamelDataWrapper *wrapper;
- CamelMimePart *part;
- int i, parts;
-
- parts = camel_multipart_get_number (multipart);
- for (i = 0; i < parts && !has_message_parts; i++) {
- part = camel_multipart_get_part (multipart, i);
- wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (part));
- if (CAMEL_IS_MULTIPART (wrapper)) {
- has_message_parts = multipart_contains_message_parts (CAMEL_MULTIPART (wrapper));
- } else if (CAMEL_IS_MIME_MESSAGE (wrapper)) {
- has_message_parts = TRUE;
- }
- }
-
- return has_message_parts;
-}
-
-static void
-digest_add_multipart (CamelFolder *folder, CamelMultipart *multipart, const char *preuid)
-{
- CamelDataWrapper *wrapper;
- CamelMessageInfo *info;
- CamelMimePart *part;
- int parts, i;
- char *uid;
-
- parts = camel_multipart_get_number (multipart);
- for (i = 0; i < parts; i++) {
- part = camel_multipart_get_part (multipart, i);
-
- wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (part));
-
- if (CAMEL_IS_MULTIPART (wrapper)) {
- uid = g_strdup_printf ("%s%d.", preuid, i);
- digest_add_multipart (folder, CAMEL_MULTIPART (wrapper), uid);
- g_free (uid);
- continue;
- } else if (!CAMEL_IS_MIME_MESSAGE (wrapper)) {
- continue;
- }
-
- info = camel_folder_summary_info_new_from_message (folder->summary, CAMEL_MIME_MESSAGE (wrapper));
-
- uid = g_strdup_printf ("%s%d", preuid, i);
- camel_message_info_set_uid (info, uid);
- camel_folder_summary_add (folder->summary, info);
- }
-}
-
-static void
-construct_summary (CamelFolder *folder, CamelMultipart *multipart)
-{
- digest_add_multipart (folder, multipart, "");
-}
-
-CamelFolder *
-camel_digest_folder_new (CamelStore *parent_store, CamelMimeMessage *message)
-{
- CamelDigestFolder *digest_folder;
- CamelDataWrapper *wrapper;
- CamelFolder *folder;
-
- wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (message));
- if (!wrapper || !CAMEL_IS_MULTIPART (wrapper))
- return NULL;
-
- /* Make sure we have a multipart/digest subpart or at least some message/rfc822 attachments... */
- if (!camel_content_type_is (CAMEL_DATA_WRAPPER (message)->mime_type, "multipart", "digest")) {
- if (!multipart_contains_message_parts (CAMEL_MULTIPART (wrapper)))
- return NULL;
- }
-
- folder = CAMEL_FOLDER (camel_object_new (camel_digest_folder_get_type ()));
- digest_folder = CAMEL_DIGEST_FOLDER (folder);
-
- camel_folder_construct (folder, parent_store, "folder_name", "short_name");
-
- camel_object_ref (message);
- digest_folder->priv->message = message;
-
- construct_summary (folder, CAMEL_MULTIPART (wrapper));
-
- return folder;
-}
-
-static void
-digest_refresh_info (CamelFolder *folder, CamelException *ex)
-{
-
-}
-
-static void
-digest_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
-{
- /* no-op */
-}
-
-static void
-digest_expunge (CamelFolder *folder, CamelException *ex)
-{
- /* no-op */
-}
-
-static const char *
-digest_get_full_name (CamelFolder *folder)
-{
- return folder->full_name;
-}
-
-static void
-digest_append_message (CamelFolder *folder, CamelMimeMessage *message,
- const CamelMessageInfo *info, char **appended_uid,
- CamelException *ex)
-{
- /* no-op */
- if (appended_uid)
- *appended_uid = NULL;
-}
-
-static void
-digest_transfer_messages_to (CamelFolder *source, GPtrArray *uids,
- CamelFolder *dest, GPtrArray **transferred_uids,
- gboolean delete_originals, CamelException *ex)
-{
- /* no-op */
- if (transferred_uids)
- *transferred_uids = NULL;
-}
-
-static CamelMimeMessage *
-digest_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
-{
- CamelDigestFolder *digest = CAMEL_DIGEST_FOLDER (folder);
- CamelDataWrapper *wrapper;
- CamelMimeMessage *message;
- CamelMimePart *part;
- char *subuid;
- int id;
-
- part = CAMEL_MIME_PART (digest->priv->message);
- wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (part));
-
- do {
- id = strtoul (uid, &subuid, 10);
- if (!CAMEL_IS_MULTIPART (wrapper))
- return NULL;
-
- part = camel_multipart_get_part (CAMEL_MULTIPART (wrapper), id);
- wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (part));
- uid = subuid + 1;
- } while (*subuid == '.');
-
- if (!CAMEL_IS_MIME_MESSAGE (wrapper))
- return NULL;
-
- message = CAMEL_MIME_MESSAGE (wrapper);
- camel_object_ref (message);
-
- return message;
-}
-
-
-static GPtrArray *
-digest_search_by_expression (CamelFolder *folder, const char *expression, CamelException *ex)
-{
- CamelDigestFolder *df = (CamelDigestFolder *) folder;
- CamelFolderSearch *search;
- GPtrArray *summary, *matches;
-
- summary = camel_folder_get_summary (folder);
-
- CAMEL_DIGEST_FOLDER_LOCK (folder, search_lock);
-
- if (!df->priv->search)
- df->priv->search = camel_folder_search_new ();
-
- search = df->priv->search;
- camel_folder_search_set_folder (search, folder);
- camel_folder_search_set_summary (search, summary);
-
- matches = camel_folder_search_execute_expression (search, expression, ex);
-
- CAMEL_DIGEST_FOLDER_UNLOCK (folder, search_lock);
-
- camel_folder_free_summary (folder, summary);
-
- return matches;
-}
-
-static GPtrArray *
-digest_search_by_uids (CamelFolder *folder, const char *expression, GPtrArray *uids, CamelException *ex)
-{
- CamelDigestFolder *df = (CamelDigestFolder *) folder;
- CamelFolderSearch *search;
- GPtrArray *summary, *matches;
- int i;
-
- summary = g_ptr_array_new ();
- for (i = 0; i < uids->len; i++) {
- CamelMessageInfo *info;
-
- info = camel_folder_get_message_info (folder, uids->pdata[i]);
- if (info)
- g_ptr_array_add (summary, info);
- }
-
- if (summary->len == 0)
- return summary;
-
- CAMEL_DIGEST_FOLDER_LOCK (folder, search_lock);
-
- if (!df->priv->search)
- df->priv->search = camel_folder_search_new ();
-
- search = df->priv->search;
- camel_folder_search_set_folder (search, folder);
- camel_folder_search_set_summary (search, summary);
-
- matches = camel_folder_search_execute_expression (search, expression, ex);
-
- CAMEL_DIGEST_FOLDER_UNLOCK (folder, search_lock);
-
- for (i = 0; i < summary->len; i++)
- camel_folder_free_message_info (folder, summary->pdata[i]);
- g_ptr_array_free (summary, TRUE);
-
- return matches;
-}
-
-static void
-digest_search_free (CamelFolder *folder, GPtrArray *result)
-{
- CamelDigestFolder *digest_folder = CAMEL_DIGEST_FOLDER (folder);
-
- CAMEL_DIGEST_FOLDER_LOCK (folder, search_lock);
-
- camel_folder_search_free_result (digest_folder->priv->search, result);
-
- CAMEL_DIGEST_FOLDER_UNLOCK (folder, search_lock);
-}
diff --git a/camel/camel-digest-folder.h b/camel/camel-digest-folder.h
deleted file mode 100644
index 1035930f56..0000000000
--- a/camel/camel-digest-folder.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2001 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef _CAMEL_DIGEST_FOLDER_H
-#define _CAMEL_DIGEST_FOLDER_H
-
-#include <glib.h>
-#include <camel/camel-store.h>
-#include <camel/camel-folder.h>
-#include <camel/camel-mime-message.h>
-
-#define CAMEL_DIGEST_FOLDER(obj) CAMEL_CHECK_CAST (obj, camel_digest_folder_get_type (), CamelDigestFolder)
-#define CAMEL_DIGEST_FOLDER_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_digest_folder_get_type (), CamelDigestFolderClass)
-#define CAMEL_IS_DIGEST_FOLDER(obj) CAMEL_CHECK_TYPE (obj, camel_digest_folder_get_type ())
-
-typedef struct _CamelDigestFolderClass CamelDigestFolderClass;
-
-struct _CamelDigestFolder {
- CamelFolder parent;
-
- struct _CamelDigestFolderPrivate *priv;
-};
-
-struct _CamelDigestFolderClass {
- CamelFolderClass parent_class;
-
-};
-
-CamelType camel_digest_folder_get_type (void);
-
-CamelFolder *camel_digest_folder_new (CamelStore *parent_store, CamelMimeMessage *message);
-
-#endif /* ! _CAMEL_DIGEST_FOLDER_H */
diff --git a/camel/camel-digest-store.c b/camel/camel-digest-store.c
deleted file mode 100644
index 833593ac9f..0000000000
--- a/camel/camel-digest-store.c
+++ /dev/null
@@ -1,203 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2002 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-
-#include "camel-exception.h"
-#include "camel-digest-store.h"
-#include "camel-digest-folder.h"
-
-#include "camel-private.h"
-
-#define d(x)
-
-static CamelFolder *digest_get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex);
-static void digest_delete_folder (CamelStore *store, const char *folder_name, CamelException *ex);
-static void digest_rename_folder (CamelStore *store, const char *old, const char *new, CamelException *ex);
-static void digest_init_trash (CamelStore *store);
-static CamelFolder *digest_get_trash (CamelStore *store, CamelException *ex);
-static void digest_init_junk (CamelStore *store);
-static CamelFolder *digest_get_junk (CamelStore *store, CamelException *ex);
-
-static CamelFolderInfo *digest_get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelException *ex);
-
-static void camel_digest_store_class_init (CamelDigestStoreClass *klass);
-static void camel_digest_store_init (CamelDigestStore *obj);
-static void camel_digest_store_finalise (CamelObject *obj);
-
-static int digest_setv (CamelObject *object, CamelException *ex, CamelArgV *args);
-static int digest_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args);
-
-static CamelStoreClass *parent_class = NULL;
-
-
-CamelType
-camel_digest_store_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_store_get_type (),
- "CamelDigestStore",
- sizeof (CamelDigestStore),
- sizeof (CamelDigestStoreClass),
- (CamelObjectClassInitFunc) camel_digest_store_class_init,
- NULL,
- (CamelObjectInitFunc) camel_digest_store_init,
- (CamelObjectFinalizeFunc) camel_digest_store_finalise);
- }
-
- return type;
-}
-
-static void
-camel_digest_store_class_init (CamelDigestStoreClass *klass)
-{
- CamelObjectClass *object_class = (CamelObjectClass *) klass;
- CamelStoreClass *store_class = (CamelStoreClass *) klass;
-
- parent_class = CAMEL_STORE_CLASS(camel_type_get_global_classfuncs (camel_store_get_type ()));
-
- /* virtual method overload */
- object_class->setv = digest_setv;
- object_class->getv = digest_getv;
-
- store_class->get_folder = digest_get_folder;
- store_class->rename_folder = digest_rename_folder;
- store_class->delete_folder = digest_delete_folder;
- store_class->get_folder_info = digest_get_folder_info;
- store_class->free_folder_info = camel_store_free_folder_info_full;
-
- store_class->init_trash = digest_init_trash;
- store_class->get_trash = digest_get_trash;
- store_class->init_junk = digest_init_junk;
- store_class->get_junk = digest_get_junk;
-}
-
-static void
-camel_digest_store_init (CamelDigestStore *obj)
-{
- CamelStore *store = (CamelStore *) obj;
-
- /* we dont want a vtrash and vjunk on this one */
- store->flags &= ~(CAMEL_STORE_VTRASH | CAMEL_STORE_VJUNK);
-}
-
-static void
-camel_digest_store_finalise (CamelObject *obj)
-{
-
-}
-
-static int
-digest_setv (CamelObject *object, CamelException *ex, CamelArgV *args)
-{
- /* CamelDigestStore doesn't currently have anything to set */
- return CAMEL_OBJECT_CLASS (parent_class)->setv (object, ex, args);
-}
-
-static int
-digest_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args)
-{
- /* CamelDigestStore doesn't currently have anything to get */
- return CAMEL_OBJECT_CLASS (parent_class)->getv (object, ex, args);
-}
-
-
-/**
- * camel_digest_store_new:
- * @url:
- *
- * Create a new CamelDigestStore object.
- *
- * Return value: A new CamelDigestStore widget.
- **/
-CamelStore *
-camel_digest_store_new (const char *url)
-{
- CamelStore *store;
- CamelURL *uri;
-
- uri = camel_url_new (url, NULL);
- if (!uri)
- return NULL;
-
- store = CAMEL_STORE (camel_object_new (camel_digest_store_get_type ()));
- CAMEL_SERVICE (store)->url = uri;
-
- return store;
-}
-
-static CamelFolder *
-digest_get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex)
-{
- return NULL;
-}
-
-static void
-digest_init_trash (CamelStore *store)
-{
- /* no-op */
- ;
-}
-
-static CamelFolder *
-digest_get_trash (CamelStore *store, CamelException *ex)
-{
- return NULL;
-}
-
-static void
-digest_init_junk (CamelStore *store)
-{
- /* no-op */
- ;
-}
-
-static CamelFolder *
-digest_get_junk (CamelStore *store, CamelException *ex)
-{
- return NULL;
-}
-
-static CamelFolderInfo *
-digest_get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelException *ex)
-{
- return NULL;
-}
-
-static void
-digest_delete_folder (CamelStore *store, const char *folder_name, CamelException *ex)
-{
-
-}
-
-static void
-digest_rename_folder (CamelStore *store, const char *old, const char *new, CamelException *ex)
-{
-
-}
diff --git a/camel/camel-digest-store.h b/camel/camel-digest-store.h
deleted file mode 100644
index 90e802f09f..0000000000
--- a/camel/camel-digest-store.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2002 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifndef __CAMEL_DIGEST_STORE_H__
-#define __CAMEL_DIGEST_STORE_H__
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <glib.h>
-#include <camel/camel-store.h>
-
-#define CAMEL_DIGEST_STORE(obj) CAMEL_CHECK_CAST (obj, camel_digest_store_get_type (), CamelDigestStore)
-#define CAMEL_DIGEST_STORE_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_digest_store_get_type (), CamelDigestStoreClass)
-#define CAMEL_IS_DIGEST_STORE(obj) CAMEL_CHECK_TYPE (obj, camel_digest_store_get_type ())
-
-typedef struct _CamelDigestStoreClass CamelDigestStoreClass;
-
-struct _CamelDigestStore {
- CamelStore parent;
-
-};
-
-struct _CamelDigestStoreClass {
- CamelStoreClass parent_class;
-
-};
-
-CamelType camel_digest_store_get_type (void);
-
-CamelStore *camel_digest_store_new (const char *url);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __CAMEL_DIGEST_STORE_H__ */
diff --git a/camel/camel-digest-summary.c b/camel/camel-digest-summary.c
deleted file mode 100644
index f17867e083..0000000000
--- a/camel/camel-digest-summary.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2002 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "camel-digest-summary.h"
-
-#define CAMEL_DIGEST_SUMMARY_VERSION 0
-
-static void camel_digest_summary_class_init (CamelDigestSummaryClass *klass);
-static void camel_digest_summary_init (CamelDigestSummary *obj);
-static void camel_digest_summary_finalise (CamelObject *obj);
-
-
-static CamelFolderSummaryClass *parent_class = NULL;
-
-
-CamelType
-camel_digest_summary_get_type(void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (
- camel_folder_summary_get_type (),
- "CamelDigestSummary",
- sizeof (CamelDigestSummary),
- sizeof (CamelDigestSummaryClass),
- (CamelObjectClassInitFunc) camel_digest_summary_class_init,
- NULL,
- (CamelObjectInitFunc) camel_digest_summary_init,
- (CamelObjectFinalizeFunc) camel_digest_summary_finalise);
- }
-
- return type;
-}
-
-static void
-camel_digest_summary_class_init (CamelDigestSummaryClass *klass)
-{
- parent_class = CAMEL_FOLDER_SUMMARY_CLASS (camel_type_get_global_classfuncs (camel_folder_summary_get_type ()));
-}
-
-static void
-camel_digest_summary_init (CamelDigestSummary *summary)
-{
- CamelFolderSummary *s = (CamelFolderSummary *) summary;
-
- /* subclasses need to set the right instance data sizes */
- s->message_info_size = sizeof (CamelMessageInfo);
- s->content_info_size = sizeof (CamelMessageContentInfo);
-
- /* and a unique file version */
- s->version += CAMEL_DIGEST_SUMMARY_VERSION;
-}
-
-static void
-camel_digest_summary_finalise (CamelObject *object)
-{
-
-}
-
-
-CamelFolderSummary *
-camel_digest_summary_new (void)
-{
- return (CamelFolderSummary *) camel_object_new (camel_digest_summary_get_type ());
-}
diff --git a/camel/camel-digest-summary.h b/camel/camel-digest-summary.h
deleted file mode 100644
index 16bf5e5c9f..0000000000
--- a/camel/camel-digest-summary.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2002 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifndef __CAMEL_DIGEST_SUMMARY_H__
-#define __CAMEL_DIGEST_SUMMARY_H__
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <camel/camel-folder-summary.h>
-#include <camel/camel-folder.h>
-#include <camel/camel-exception.h>
-
-#define CAMEL_DIGEST_SUMMARY(obj) CAMEL_CHECK_CAST (obj, camel_digest_summary_get_type (), CamelDigestSummary)
-#define CAMEL_DIGEST_SUMMARY_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_digest_summary_get_type (), CamelDigestSummaryClass)
-#define CAMEL_IS_DIGEST_SUMMARY(obj) CAMEL_CHECK_TYPE (obj, camel_digest_summary_get_type ())
-
-typedef struct _CamelDigestSummary CamelDigestSummary;
-typedef struct _CamelDigestSummaryClass CamelDigestSummaryClass;
-
-struct _CamelDigestSummary {
- CamelFolderSummary parent_object;
-
-};
-
-struct _CamelDigestSummaryClass {
- CamelFolderSummaryClass parent_class;
-
-};
-
-
-CamelType camel_digest_summary_get_type (void);
-
-CamelFolderSummary *camel_digest_summary_new (void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __CAMEL_DIGEST_SUMMARY_H__ */
diff --git a/camel/camel-disco-diary.c b/camel/camel-disco-diary.c
deleted file mode 100644
index 927a97f432..0000000000
--- a/camel/camel-disco-diary.c
+++ /dev/null
@@ -1,436 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-disco-diary.c: class for a disconnected operation log */
-
-/*
- * Authors: Dan Winship <danw@ximian.com>
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#define __USE_LARGEFILE 1
-#include <stdio.h>
-#include <errno.h>
-
-#include "camel-disco-diary.h"
-#include "camel-disco-folder.h"
-#include "camel-disco-store.h"
-#include "camel-exception.h"
-#include "camel-file-utils.h"
-#include "camel-folder.h"
-#include "camel-operation.h"
-#include "camel-session.h"
-#include "camel-store.h"
-
-
-static void
-camel_disco_diary_class_init (CamelDiscoDiaryClass *camel_disco_diary_class)
-{
- /* virtual method definition */
-}
-
-static void
-camel_disco_diary_init (CamelDiscoDiary *diary)
-{
- diary->folders = g_hash_table_new (g_str_hash, g_str_equal);
- diary->uidmap = g_hash_table_new (g_str_hash, g_str_equal);
-}
-
-static void
-unref_folder (gpointer key, gpointer value, gpointer data)
-{
- camel_object_unref (value);
-}
-
-static void
-free_uid (gpointer key, gpointer value, gpointer data)
-{
- g_free (key);
- g_free (value);
-}
-
-static void
-camel_disco_diary_finalize (CamelDiscoDiary *diary)
-{
- if (diary->file)
- fclose (diary->file);
- if (diary->folders) {
- g_hash_table_foreach (diary->folders, unref_folder, NULL);
- g_hash_table_destroy (diary->folders);
- }
- if (diary->uidmap) {
- g_hash_table_foreach (diary->uidmap, free_uid, NULL);
- g_hash_table_destroy (diary->uidmap);
- }
-}
-
-CamelType
-camel_disco_diary_get_type (void)
-{
- static CamelType camel_disco_diary_type = CAMEL_INVALID_TYPE;
-
- if (camel_disco_diary_type == CAMEL_INVALID_TYPE) {
- camel_disco_diary_type = camel_type_register (
- CAMEL_OBJECT_TYPE, "CamelDiscoDiary",
- sizeof (CamelDiscoDiary),
- sizeof (CamelDiscoDiaryClass),
- (CamelObjectClassInitFunc) camel_disco_diary_class_init,
- NULL,
- (CamelObjectInitFunc) camel_disco_diary_init,
- (CamelObjectFinalizeFunc) camel_disco_diary_finalize);
- }
-
- return camel_disco_diary_type;
-}
-
-
-static int
-diary_encode_uids (CamelDiscoDiary *diary, GPtrArray *uids)
-{
- int i, status;
-
- status = camel_file_util_encode_uint32 (diary->file, uids->len);
- for (i = 0; status != -1 && i < uids->len; i++)
- status = camel_file_util_encode_string (diary->file, uids->pdata[i]);
- return status;
-}
-
-void
-camel_disco_diary_log (CamelDiscoDiary *diary, CamelDiscoDiaryAction action,
- ...)
-{
- va_list ap;
- int status;
-
- /* You may already be a loser. */
- if (!diary->file)
- return;
-
- status = camel_file_util_encode_uint32 (diary->file, action);
- if (status == -1)
- goto lose;
-
- va_start (ap, action);
- switch (action) {
- case CAMEL_DISCO_DIARY_FOLDER_EXPUNGE:
- {
- CamelFolder *folder = va_arg (ap, CamelFolder *);
- GPtrArray *uids = va_arg (ap, GPtrArray *);
-
- status = camel_file_util_encode_string (diary->file, folder->full_name);
- if (status != -1)
- status = diary_encode_uids (diary, uids);
- break;
- }
-
- case CAMEL_DISCO_DIARY_FOLDER_APPEND:
- {
- CamelFolder *folder = va_arg (ap, CamelFolder *);
- char *uid = va_arg (ap, char *);
-
- status = camel_file_util_encode_string (diary->file, folder->full_name);
- if (status != -1)
- status = camel_file_util_encode_string (diary->file, uid);
- break;
- }
-
- case CAMEL_DISCO_DIARY_FOLDER_TRANSFER:
- {
- CamelFolder *source = va_arg (ap, CamelFolder *);
- CamelFolder *destination = va_arg (ap, CamelFolder *);
- GPtrArray *uids = va_arg (ap, GPtrArray *);
- gboolean delete_originals = va_arg (ap, gboolean);
-
- status = camel_file_util_encode_string (diary->file, source->full_name);
- if (status == -1)
- break;
- status = camel_file_util_encode_string (diary->file, destination->full_name);
- if (status == -1)
- break;
- status = diary_encode_uids (diary, uids);
- if (status == -1)
- break;
- status = camel_file_util_encode_uint32 (diary->file, delete_originals);
- break;
- }
-
- default:
- g_assert_not_reached ();
- break;
- }
-
- va_end (ap);
-
- lose:
- if (status == -1) {
- char *msg;
-
- msg = g_strdup_printf (_("Could not write log entry: %s\n"
- "Further operations on this server "
- "will not be replayed when you\n"
- "reconnect to the network."),
- g_strerror (errno));
- camel_session_alert_user (camel_service_get_session (CAMEL_SERVICE (diary->store)),
- CAMEL_SESSION_ALERT_ERROR,
- msg, FALSE);
- g_free (msg);
-
- fclose (diary->file);
- diary->file = NULL;
- }
-}
-
-static void
-free_uids (GPtrArray *array)
-{
- while (array->len--)
- g_free (array->pdata[array->len]);
- g_ptr_array_free (array, TRUE);
-}
-
-static GPtrArray *
-diary_decode_uids (CamelDiscoDiary *diary)
-{
- GPtrArray *uids;
- char *uid;
- guint32 i;
-
- if (camel_file_util_decode_uint32 (diary->file, &i) == -1)
- return NULL;
- uids = g_ptr_array_new ();
- while (i--) {
- if (camel_file_util_decode_string (diary->file, &uid) == -1) {
- free_uids (uids);
- return NULL;
- }
- g_ptr_array_add (uids, uid);
- }
-
- return uids;
-}
-
-static CamelFolder *
-diary_decode_folder (CamelDiscoDiary *diary)
-{
- CamelFolder *folder;
- char *name;
-
- if (camel_file_util_decode_string (diary->file, &name) == -1)
- return NULL;
- folder = g_hash_table_lookup (diary->folders, name);
- if (!folder) {
- CamelException ex;
- char *msg;
-
- camel_exception_init (&ex);
- folder = camel_store_get_folder (CAMEL_STORE (diary->store),
- name, 0, &ex);
- if (folder)
- g_hash_table_insert (diary->folders, name, folder);
- else {
- msg = g_strdup_printf (_("Could not open `%s':\n%s\nChanges made to this folder will not be resynchronized."),
- name, camel_exception_get_description (&ex));
- camel_exception_clear (&ex);
- camel_session_alert_user (camel_service_get_session (CAMEL_SERVICE (diary->store)),
- CAMEL_SESSION_ALERT_WARNING,
- msg, FALSE);
- g_free (msg);
- g_free (name);
- }
- } else
- g_free (name);
- return folder;
-}
-
-static void
-close_folder (gpointer name, gpointer folder, gpointer data)
-{
- g_free (name);
- camel_folder_sync (folder, FALSE, NULL);
- camel_object_unref (folder);
-}
-
-void
-camel_disco_diary_replay (CamelDiscoDiary *diary, CamelException *ex)
-{
- guint32 action;
- off_t size;
- double pc;
-
- fseek (diary->file, 0, SEEK_END);
- size = ftell (diary->file);
- g_return_if_fail (size != 0);
- rewind (diary->file);
-
- camel_operation_start (NULL, _("Resynchronizing with server"));
- while (!camel_exception_is_set (ex)) {
- pc = ftell (diary->file) / size;
- camel_operation_progress (NULL, pc * 100);
-
- if (camel_file_util_decode_uint32 (diary->file, &action) == -1)
- break;
- if (action == CAMEL_DISCO_DIARY_END)
- break;
-
- switch (action) {
- case CAMEL_DISCO_DIARY_FOLDER_EXPUNGE:
- {
- CamelFolder *folder;
- GPtrArray *uids;
-
- folder = diary_decode_folder (diary);
- uids = diary_decode_uids (diary);
- if (!uids)
- goto lose;
-
- if (folder)
- camel_disco_folder_expunge_uids (folder, uids, ex);
- free_uids (uids);
- break;
- }
-
- case CAMEL_DISCO_DIARY_FOLDER_APPEND:
- {
- CamelFolder *folder;
- char *uid, *ret_uid;
- CamelMimeMessage *message;
- CamelMessageInfo *info;
-
- folder = diary_decode_folder (diary);
- if (camel_file_util_decode_string (diary->file, &uid) == -1)
- goto lose;
-
- if (!folder) {
- g_free (uid);
- continue;
- }
-
- message = camel_folder_get_message (folder, uid, NULL);
- if (!message) {
- /* The message was appended and then deleted. */
- g_free (uid);
- continue;
- }
- info = camel_folder_get_message_info (folder, uid);
-
- camel_folder_append_message (folder, message, info, &ret_uid, ex);
- camel_folder_free_message_info (folder, info);
-
- if (ret_uid) {
- camel_disco_diary_uidmap_add (diary, uid, ret_uid);
- g_free (ret_uid);
- }
- g_free (uid);
-
- break;
- }
-
- case CAMEL_DISCO_DIARY_FOLDER_TRANSFER:
- {
- CamelFolder *source, *destination;
- GPtrArray *uids, *ret_uids;
- guint32 delete_originals;
- int i;
-
- source = diary_decode_folder (diary);
- destination = diary_decode_folder (diary);
- uids = diary_decode_uids (diary);
- if (!uids)
- goto lose;
- if (camel_file_util_decode_uint32 (diary->file, &delete_originals) == -1)
- goto lose;
-
- if (!source || !destination) {
- free_uids (uids);
- continue;
- }
-
- camel_folder_transfer_messages_to (source, uids, destination, &ret_uids, delete_originals, ex);
-
- if (ret_uids) {
- for (i = 0; i < uids->len; i++) {
- if (!ret_uids->pdata[i])
- continue;
- camel_disco_diary_uidmap_add (diary, uids->pdata[i], ret_uids->pdata[i]);
- g_free (ret_uids->pdata[i]);
- }
- g_ptr_array_free (ret_uids, TRUE);
- }
- free_uids (uids);
- break;
- }
-
- }
- }
-
- lose:
- camel_operation_end (NULL);
-
- /* Close folders */
- g_hash_table_foreach (diary->folders, close_folder, diary);
- g_hash_table_destroy (diary->folders);
- diary->folders = NULL;
-
- /* Truncate the log */
- ftruncate (fileno (diary->file), 0);
-}
-
-CamelDiscoDiary *
-camel_disco_diary_new (CamelDiscoStore *store, const char *filename, CamelException *ex)
-{
- CamelDiscoDiary *diary;
-
- g_return_val_if_fail (CAMEL_IS_DISCO_STORE (store), NULL);
- g_return_val_if_fail (filename != NULL, NULL);
-
- diary = CAMEL_DISCO_DIARY (camel_object_new (CAMEL_DISCO_DIARY_TYPE));
- diary->store = store;
-
- diary->file = fopen (filename, "a+");
- if (!diary->file) {
- camel_object_unref (diary);
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- "Could not open journal file: %s",
- g_strerror (errno));
- return NULL;
- }
-
- return diary;
-}
-
-gboolean
-camel_disco_diary_empty (CamelDiscoDiary *diary)
-{
- return ftell (diary->file) == 0;
-}
-
-void
-camel_disco_diary_uidmap_add (CamelDiscoDiary *diary, const char *old_uid,
- const char *new_uid)
-{
- g_hash_table_insert (diary->uidmap, g_strdup (old_uid),
- g_strdup (new_uid));
-}
-
-const char *
-camel_disco_diary_uidmap_lookup (CamelDiscoDiary *diary, const char *uid)
-{
- return g_hash_table_lookup (diary->uidmap, uid);
-}
diff --git a/camel/camel-disco-diary.h b/camel/camel-disco-diary.h
deleted file mode 100644
index b177d8ef6f..0000000000
--- a/camel/camel-disco-diary.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * camel-disco-diary.h: class for logging disconnected operation
- *
- * Authors: Dan Winship <danw@ximian.com>
- *
- * Copyright 2001 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifndef CAMEL_DISCO_DIARY_H
-#define CAMEL_DISCO_DIARY_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include "camel-object.h"
-#include <stdarg.h>
-#include <stdio.h>
-
-#define CAMEL_DISCO_DIARY_TYPE (camel_disco_diary_get_type ())
-#define CAMEL_DISCO_DIARY(obj) (CAMEL_CHECK_CAST((obj), CAMEL_DISCO_DIARY_TYPE, CamelDiscoDiary))
-#define CAMEL_DISCO_DIARY_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_DISCO_DIARY_TYPE, CamelDiscoDiaryClass))
-#define CAMEL_IS_DISCO_DIARY(o) (CAMEL_CHECK_TYPE((o), CAMEL_DISCO_DIARY_TYPE))
-
-typedef enum {
- CAMEL_DISCO_DIARY_END = 0,
-
- CAMEL_DISCO_DIARY_FOLDER_EXPUNGE,
- CAMEL_DISCO_DIARY_FOLDER_APPEND,
- CAMEL_DISCO_DIARY_FOLDER_TRANSFER,
-} CamelDiscoDiaryAction;
-
-typedef enum {
- CAMEL_DISCO_DIARY_ARG_NONE = 0,
-
- CAMEL_DISCO_DIARY_ARG_FOLDER,
- CAMEL_DISCO_DIARY_ARG_UID,
- CAMEL_DISCO_DIARY_ARG_UID_LIST
-} CamelDiscoDiaryArgType;
-
-struct _CamelDiscoDiary {
- CamelObject parent_object;
-
- CamelDiscoStore *store;
- FILE *file;
- GHashTable *folders, *uidmap;
-};
-
-typedef struct {
- CamelObjectClass parent_class;
-
-} CamelDiscoDiaryClass;
-
-
-/* public methods */
-CamelDiscoDiary *camel_disco_diary_new (CamelDiscoStore *store,
- const char *filename,
- CamelException *ex);
-
-gboolean camel_disco_diary_empty (CamelDiscoDiary *diary);
-
-void camel_disco_diary_log (CamelDiscoDiary *diary,
- CamelDiscoDiaryAction action,
- ...);
-void camel_disco_diary_replay (CamelDiscoDiary *diary,
- CamelException *ex);
-
-/* Temporary->Permanent UID map stuff */
-void camel_disco_diary_uidmap_add (CamelDiscoDiary *diary,
- const char *old_uid,
- const char *new_uid);
-const char *camel_disco_diary_uidmap_lookup (CamelDiscoDiary *diary,
- const char *uid);
-
-/* Standard Camel function */
-CamelType camel_disco_diary_get_type (void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_DISCO_DIARY_H */
diff --git a/camel/camel-disco-folder.c b/camel/camel-disco-folder.c
deleted file mode 100644
index 61e825020c..0000000000
--- a/camel/camel-disco-folder.c
+++ /dev/null
@@ -1,399 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-disco-folder.c: abstract class for a disconnectable folder */
-
-/*
- * Authors: Dan Winship <danw@ximian.com>
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "camel-disco-folder.h"
-#include "camel-disco-store.h"
-#include "camel-exception.h"
-
-#include "camel-session.h"
-
-#define CF_CLASS(o) (CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS (o)))
-#define CDF_CLASS(o) (CAMEL_DISCO_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS (o)))
-
-static CamelFolderClass *parent_class = NULL;
-
-static void disco_refresh_info (CamelFolder *folder, CamelException *ex);
-static void disco_sync (CamelFolder *folder, gboolean expunge, CamelException *ex);
-static void disco_expunge (CamelFolder *folder, CamelException *ex);
-
-static void disco_append_message (CamelFolder *folder, CamelMimeMessage *message,
- const CamelMessageInfo *info, char **appended_uid, CamelException *ex);
-static void disco_transfer_messages_to (CamelFolder *source, GPtrArray *uids,
- CamelFolder *destination,
- GPtrArray **transferred_uids,
- gboolean delete_originals,
- CamelException *ex);
-
-static void disco_cache_message (CamelDiscoFolder *disco_folder,
- const char *uid, CamelException *ex);
-static void disco_prepare_for_offline (CamelDiscoFolder *disco_folder,
- const char *expression,
- CamelException *ex);
-
-static void
-camel_disco_folder_class_init (CamelDiscoFolderClass *camel_disco_folder_class)
-{
- CamelFolderClass *camel_folder_class = CAMEL_FOLDER_CLASS (camel_disco_folder_class);
-
- parent_class = CAMEL_FOLDER_CLASS (camel_type_get_global_classfuncs (camel_folder_get_type ()));
-
- /* virtual method definition */
- camel_disco_folder_class->cache_message = disco_cache_message;
- camel_disco_folder_class->prepare_for_offline = disco_prepare_for_offline;
-
- /* virtual method overload */
- camel_folder_class->refresh_info = disco_refresh_info;
- camel_folder_class->sync = disco_sync;
- camel_folder_class->expunge = disco_expunge;
-
- camel_folder_class->append_message = disco_append_message;
- camel_folder_class->transfer_messages_to = disco_transfer_messages_to;
-}
-
-struct _cdf_sync_msg {
- CamelSessionThreadMsg msg;
-
- CamelFolder *folder;
- CamelFolderChangeInfo *changes;
-};
-
-static void
-cdf_sync_offline(CamelSession *session, CamelSessionThreadMsg *mm)
-{
- struct _cdf_sync_msg *m = (struct _cdf_sync_msg *)mm;
- int i;
-
- camel_operation_start(NULL, _("Downloading new messages for offline mode"));
-
- if (m->changes) {
- for (i=0;i<m->changes->uid_added->len;i++) {
- int pc = i * 100 / m->changes->uid_added->len;
-
- camel_operation_progress(NULL, pc);
- camel_disco_folder_cache_message((CamelDiscoFolder *)m->folder,
- m->changes->uid_added->pdata[i],
- &mm->ex);
- }
- } else {
- camel_disco_folder_prepare_for_offline((CamelDiscoFolder *)m->folder,
- "(match-all)",
- &mm->ex);
- }
-
- camel_operation_end(NULL);
-}
-
-static void
-cdf_sync_free(CamelSession *session, CamelSessionThreadMsg *mm)
-{
- struct _cdf_sync_msg *m = (struct _cdf_sync_msg *)mm;
-
- if (m->changes)
- camel_folder_change_info_free(m->changes);
- camel_object_unref(m->folder);
-}
-
-static CamelSessionThreadOps cdf_sync_ops = {
- cdf_sync_offline,
- cdf_sync_free,
-};
-
-static void
-cdf_folder_changed(CamelFolder *folder, CamelFolderChangeInfo *changes, void *dummy)
-{
- if (changes->uid_added->len > 0
- && camel_url_get_param(((CamelService *)folder->parent_store)->url, "offline_sync")) {
- CamelSession *session = ((CamelService *)folder->parent_store)->session;
- struct _cdf_sync_msg *m;
-
- m = camel_session_thread_msg_new(session, &cdf_sync_ops, sizeof(*m));
- m->changes = camel_folder_change_info_new();
- camel_folder_change_info_cat(m->changes, changes);
- m->folder = folder;
- camel_object_ref(folder);
- camel_session_thread_queue(session, &m->msg, 0);
- }
-}
-
-static void
-camel_disco_folder_init(CamelDiscoFolder *folder)
-{
- camel_object_hook_event(folder, "folder_changed", (CamelObjectEventHookFunc)cdf_folder_changed, NULL);
-}
-
-CamelType
-camel_disco_folder_get_type (void)
-{
- static CamelType camel_disco_folder_type = CAMEL_INVALID_TYPE;
-
- if (camel_disco_folder_type == CAMEL_INVALID_TYPE) {
- camel_disco_folder_type = camel_type_register (
- CAMEL_FOLDER_TYPE, "CamelDiscoFolder",
- sizeof (CamelDiscoFolder),
- sizeof (CamelDiscoFolderClass),
- (CamelObjectClassInitFunc)camel_disco_folder_class_init, NULL,
- (CamelObjectInitFunc)camel_disco_folder_init, NULL);
- }
-
- return camel_disco_folder_type;
-}
-
-
-static void
-disco_refresh_info (CamelFolder *folder, CamelException *ex)
-{
- if (camel_disco_store_status (CAMEL_DISCO_STORE (folder->parent_store)) != CAMEL_DISCO_STORE_ONLINE)
- return;
- CDF_CLASS (folder)->refresh_info_online (folder, ex);
-}
-
-static void
-disco_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
-{
- if (expunge) {
- disco_expunge (folder, ex);
- if (camel_exception_is_set (ex))
- return;
- }
-
- switch (camel_disco_store_status (CAMEL_DISCO_STORE (folder->parent_store))) {
- case CAMEL_DISCO_STORE_ONLINE:
- CDF_CLASS (folder)->sync_online (folder, ex);
- break;
-
- case CAMEL_DISCO_STORE_OFFLINE:
- CDF_CLASS (folder)->sync_offline (folder, ex);
- break;
-
- case CAMEL_DISCO_STORE_RESYNCING:
- CDF_CLASS (folder)->sync_resyncing (folder, ex);
- break;
- }
-}
-
-static void
-disco_expunge_uids (CamelFolder *folder, GPtrArray *uids, CamelException *ex)
-{
- CamelDiscoStore *disco = CAMEL_DISCO_STORE (folder->parent_store);
-
- if (uids->len == 0)
- return;
-
- switch (camel_disco_store_status (disco)) {
- case CAMEL_DISCO_STORE_ONLINE:
- CDF_CLASS (folder)->expunge_uids_online (folder, uids, ex);
- break;
-
- case CAMEL_DISCO_STORE_OFFLINE:
- CDF_CLASS (folder)->expunge_uids_offline (folder, uids, ex);
- break;
-
- case CAMEL_DISCO_STORE_RESYNCING:
- CDF_CLASS (folder)->expunge_uids_resyncing (folder, uids, ex);
- break;
- }
-}
-
-static void
-disco_expunge (CamelFolder *folder, CamelException *ex)
-{
- GPtrArray *uids;
- int i, count;
- CamelMessageInfo *info;
-
- uids = g_ptr_array_new ();
- count = camel_folder_summary_count (folder->summary);
- for (i = 0; i < count; i++) {
- info = camel_folder_summary_index (folder->summary, i);
- if (info->flags & CAMEL_MESSAGE_DELETED)
- g_ptr_array_add (uids, g_strdup (camel_message_info_uid (info)));
- camel_folder_summary_info_free (folder->summary, info);
- }
-
- disco_expunge_uids (folder, uids, ex);
-
- for (i = 0; i < uids->len; i++)
- g_free (uids->pdata[i]);
- g_ptr_array_free (uids, TRUE);
-}
-
-static void
-disco_append_message (CamelFolder *folder, CamelMimeMessage *message,
- const CamelMessageInfo *info, char **appended_uid,
- CamelException *ex)
-{
- CamelDiscoStore *disco = CAMEL_DISCO_STORE (folder->parent_store);
-
- switch (camel_disco_store_status (disco)) {
- case CAMEL_DISCO_STORE_ONLINE:
- CDF_CLASS (folder)->append_online (folder, message, info,
- appended_uid, ex);
- break;
-
- case CAMEL_DISCO_STORE_OFFLINE:
- CDF_CLASS (folder)->append_offline (folder, message, info,
- appended_uid, ex);
- break;
-
- case CAMEL_DISCO_STORE_RESYNCING:
- CDF_CLASS (folder)->append_resyncing (folder, message, info,
- appended_uid, ex);
- break;
- }
-}
-
-static void
-disco_transfer_messages_to (CamelFolder *source, GPtrArray *uids,
- CamelFolder *dest, GPtrArray **transferred_uids,
- gboolean delete_originals, CamelException *ex)
-{
- CamelDiscoStore *disco = CAMEL_DISCO_STORE (source->parent_store);
-
- switch (camel_disco_store_status (disco)) {
- case CAMEL_DISCO_STORE_ONLINE:
- CDF_CLASS (source)->transfer_online (source, uids,
- dest, transferred_uids,
- delete_originals, ex);
- break;
-
- case CAMEL_DISCO_STORE_OFFLINE:
- CDF_CLASS (source)->transfer_offline (source, uids,
- dest, transferred_uids,
- delete_originals, ex);
- break;
-
- case CAMEL_DISCO_STORE_RESYNCING:
- CDF_CLASS (source)->transfer_resyncing (source, uids,
- dest, transferred_uids,
- delete_originals, ex);
- break;
- }
-}
-
-
-/**
- * camel_disco_folder_expunge_uids:
- * @folder: a (disconnectable) folder
- * @uids: array of UIDs to expunge
- * @ex: a CamelException
- *
- * This expunges the messages in @uids from @folder. It should take
- * whatever steps are needed to avoid expunging any other messages,
- * although in some cases it may not be possible to avoid expunging
- * messages that are marked deleted by another client at the same time
- * as the expunge_uids call is running.
- **/
-void
-camel_disco_folder_expunge_uids (CamelFolder *folder, GPtrArray *uids,
- CamelException *ex)
-{
- disco_expunge_uids (folder, uids, ex);
-}
-
-
-static void
-disco_cache_message (CamelDiscoFolder *disco_folder, const char *uid,
- CamelException *ex)
-{
- g_warning ("CamelDiscoFolder::cache_message not implemented for `%s'",
- camel_type_to_name (CAMEL_OBJECT_GET_TYPE (disco_folder)));
-}
-
-/**
- * camel_disco_folder_cache_message:
- * @disco_folder: the folder
- * @uid: the UID of the message to cache
- * @ex: a CamelException
- *
- * Requests that @disco_folder cache message @uid to disk.
- **/
-void
-camel_disco_folder_cache_message (CamelDiscoFolder *disco_folder,
- const char *uid, CamelException *ex)
-{
- CDF_CLASS (disco_folder)->cache_message (disco_folder, uid, ex);
-}
-
-
-static void
-disco_prepare_for_offline (CamelDiscoFolder *disco_folder,
- const char *expression,
- CamelException *ex)
-{
- CamelFolder *folder = CAMEL_FOLDER (disco_folder);
- GPtrArray *uids;
- int i;
-
- camel_operation_start(NULL, _("Preparing folder '%s' for offline"), folder->full_name);
-
- if (expression)
- uids = camel_folder_search_by_expression (folder, expression, ex);
- else
- uids = camel_folder_get_uids (folder);
-
- if (!uids) {
- camel_operation_end(NULL);
- return;
- }
-
- for (i = 0; i < uids->len; i++) {
- int pc = i * 100 / uids->len;
-
- camel_disco_folder_cache_message (disco_folder, uids->pdata[i], ex);
- camel_operation_progress(NULL, pc);
- if (camel_exception_is_set (ex))
- break;
- }
-
- if (expression)
- camel_folder_search_free (folder, uids);
- else
- camel_folder_free_uids (folder, uids);
-
- camel_operation_end(NULL);
-}
-
-/**
- * camel_disco_folder_prepare_for_offline:
- * @disco_folder: the folder
- * @expression: an expression describing messages to synchronize, or %NULL
- * if all messages should be sync'ed.
- * @ex: a CamelException
- *
- * This prepares @disco_folder for offline operation, by downloading
- * the bodies of all messages described by @expression (using the
- * same syntax as camel_folder_search_by_expression() ).
- **/
-void
-camel_disco_folder_prepare_for_offline (CamelDiscoFolder *disco_folder,
- const char *expression,
- CamelException *ex)
-{
- g_return_if_fail (CAMEL_IS_DISCO_FOLDER (disco_folder));
-
- CDF_CLASS (disco_folder)->prepare_for_offline (disco_folder, expression, ex);
-}
diff --git a/camel/camel-disco-folder.h b/camel/camel-disco-folder.h
deleted file mode 100644
index 0d857c0b9b..0000000000
--- a/camel/camel-disco-folder.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * camel-disco-folder.h: Abstract class for a disconnectable folder
- *
- * Authors: Dan Winship <danw@ximian.com>
- *
- * Copyright 2001 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifndef CAMEL_DISCO_FOLDER_H
-#define CAMEL_DISCO_FOLDER_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include "camel-folder.h"
-
-#define CAMEL_DISCO_FOLDER_TYPE (camel_disco_folder_get_type ())
-#define CAMEL_DISCO_FOLDER(obj) (CAMEL_CHECK_CAST((obj), CAMEL_DISCO_FOLDER_TYPE, CamelDiscoFolder))
-#define CAMEL_DISCO_FOLDER_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_DISCO_FOLDER_TYPE, CamelDiscoFolderClass))
-#define CAMEL_IS_DISCO_FOLDER(o) (CAMEL_CHECK_TYPE((o), CAMEL_DISCO_FOLDER_TYPE))
-
-struct _CamelDiscoFolder {
- CamelFolder parent_object;
-
-};
-
-typedef struct {
- CamelFolderClass parent_class;
-
- void (*refresh_info_online) (CamelFolder *folder, CamelException *ex);
-
- void (*sync_online) (CamelFolder *folder, CamelException *ex);
- void (*sync_offline) (CamelFolder *folder, CamelException *ex);
- void (*sync_resyncing) (CamelFolder *folder, CamelException *ex);
-
- void (*expunge_uids_online) (CamelFolder *folder, GPtrArray *uids,
- CamelException *ex);
- void (*expunge_uids_offline) (CamelFolder *folder, GPtrArray *uids,
- CamelException *ex);
- void (*expunge_uids_resyncing) (CamelFolder *folder, GPtrArray *uids,
- CamelException *ex);
-
- void (*append_online) (CamelFolder *folder,
- CamelMimeMessage *message,
- const CamelMessageInfo *info,
- char **appended_uid,
- CamelException *ex);
- void (*append_offline) (CamelFolder *folder,
- CamelMimeMessage *message,
- const CamelMessageInfo *info,
- char **appended_uid,
- CamelException *ex);
- void (*append_resyncing) (CamelFolder *folder,
- CamelMimeMessage *message,
- const CamelMessageInfo *info,
- char **appended_uid,
- CamelException *ex);
-
- void (*transfer_online) (CamelFolder *source, GPtrArray *uids,
- CamelFolder *destination,
- GPtrArray **transferred_uids,
- gboolean delete_originals,
- CamelException *ex);
- void (*transfer_offline) (CamelFolder *source, GPtrArray *uids,
- CamelFolder *destination,
- GPtrArray **transferred_uids,
- gboolean delete_originals,
- CamelException *ex);
- void (*transfer_resyncing) (CamelFolder *source, GPtrArray *uids,
- CamelFolder *destination,
- GPtrArray **transferred_uids,
- gboolean delete_originals,
- CamelException *ex);
-
- void (*cache_message) (CamelDiscoFolder *disco_folder,
- const char *uid, CamelException *ex);
- void (*prepare_for_offline) (CamelDiscoFolder *disco_folder,
- const char *expression,
- CamelException *ex);
-
- void (*update_uid) (CamelFolder *folder, const char *old_uid,
- const char *new_uid);
-} CamelDiscoFolderClass;
-
-
-/* public methods */
-void camel_disco_folder_expunge_uids (CamelFolder *folder, GPtrArray *uids,
- CamelException *ex);
-
-void camel_disco_folder_cache_message (CamelDiscoFolder *disco_folder,
- const char *uid,
- CamelException *ex);
-void camel_disco_folder_prepare_for_offline (CamelDiscoFolder *disco_folder,
- const char *expression,
- CamelException *ex);
-
-/* Standard Camel function */
-CamelType camel_disco_folder_get_type (void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_DISCO_FOLDER_H */
diff --git a/camel/camel-disco-store.c b/camel/camel-disco-store.c
deleted file mode 100644
index 7afff575b1..0000000000
--- a/camel/camel-disco-store.c
+++ /dev/null
@@ -1,373 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-disco-store.c: abstract class for a disconnectable store */
-
-/*
- * Authors: Dan Winship <danw@ximian.com>
- *
- * Copyright 2001 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "camel-disco-store.h"
-#include "camel-disco-diary.h"
-#include "camel-exception.h"
-#include "camel-session.h"
-
-#define CDS_CLASS(o) (CAMEL_DISCO_STORE_CLASS (CAMEL_OBJECT_GET_CLASS (o)))
-
-static CamelStoreClass *parent_class = NULL;
-
-static void disco_construct (CamelService *service, CamelSession *session,
- CamelProvider *provider, CamelURL *url,
- CamelException *ex);
-static gboolean disco_connect (CamelService *service, CamelException *ex);
-static void disco_cancel_connect (CamelService *service);
-static gboolean disco_disconnect (CamelService *service, gboolean clean, CamelException *ex);
-static CamelFolder *disco_get_folder (CamelStore *store, const char *name,
- guint32 flags, CamelException *ex);
-static CamelFolderInfo *disco_get_folder_info (CamelStore *store,
- const char *top, guint32 flags,
- CamelException *ex);
-static void set_status (CamelDiscoStore *disco_store,
- CamelDiscoStoreStatus status,
- CamelException *ex);
-static gboolean can_work_offline (CamelDiscoStore *disco_store);
-
-static int disco_setv (CamelObject *object, CamelException *ex, CamelArgV *args);
-static int disco_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args);
-
-static void
-camel_disco_store_class_init (CamelDiscoStoreClass *camel_disco_store_class)
-{
- CamelObjectClass *camel_object_class =
- CAMEL_OBJECT_CLASS (camel_disco_store_class);
- CamelServiceClass *camel_service_class =
- CAMEL_SERVICE_CLASS (camel_disco_store_class);
- CamelStoreClass *camel_store_class =
- CAMEL_STORE_CLASS (camel_disco_store_class);
-
- parent_class = CAMEL_STORE_CLASS (camel_type_get_global_classfuncs (camel_store_get_type ()));
-
- /* virtual method definition */
- camel_disco_store_class->set_status = set_status;
- camel_disco_store_class->can_work_offline = can_work_offline;
-
- /* virtual method overload */
- camel_object_class->setv = disco_setv;
- camel_object_class->getv = disco_getv;
-
- camel_service_class->construct = disco_construct;
- camel_service_class->connect = disco_connect;
- camel_service_class->disconnect = disco_disconnect;
- camel_service_class->cancel_connect = disco_cancel_connect;
-
- camel_store_class->get_folder = disco_get_folder;
- camel_store_class->get_folder_info = disco_get_folder_info;
-}
-
-CamelType
-camel_disco_store_get_type (void)
-{
- static CamelType camel_disco_store_type = CAMEL_INVALID_TYPE;
-
- if (camel_disco_store_type == CAMEL_INVALID_TYPE) {
- camel_disco_store_type = camel_type_register (
- CAMEL_STORE_TYPE,
- "CamelDiscoStore",
- sizeof (CamelDiscoStore),
- sizeof (CamelDiscoStoreClass),
- (CamelObjectClassInitFunc) camel_disco_store_class_init,
- NULL,
- NULL,
- NULL);
- }
-
- return camel_disco_store_type;
-}
-
-static int
-disco_setv (CamelObject *object, CamelException *ex, CamelArgV *args)
-{
- /* CamelDiscoStore doesn't currently have anything to set */
- return CAMEL_OBJECT_CLASS (parent_class)->setv (object, ex, args);
-}
-
-static int
-disco_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args)
-{
- /* CamelDiscoStore doesn't currently have anything to get */
- return CAMEL_OBJECT_CLASS (parent_class)->getv (object, ex, args);
-}
-
-static void
-disco_construct (CamelService *service, CamelSession *session,
- CamelProvider *provider, CamelURL *url,
- CamelException *ex)
-{
- CamelDiscoStore *disco = CAMEL_DISCO_STORE (service);
-
- CAMEL_SERVICE_CLASS (parent_class)->construct (service, session, provider, url, ex);
- if (camel_exception_is_set (ex))
- return;
-
- disco->status = camel_session_is_online (session) ?
- CAMEL_DISCO_STORE_ONLINE : CAMEL_DISCO_STORE_OFFLINE;
-}
-
-static gboolean
-disco_connect (CamelService *service, CamelException *ex)
-{
- CamelDiscoStore *store = CAMEL_DISCO_STORE (service);
- CamelDiscoStoreStatus status;
-
- status = camel_disco_store_status (store);
- if (status != CAMEL_DISCO_STORE_OFFLINE) {
- if (!CAMEL_SERVICE_CLASS (parent_class)->connect (service, ex)) {
- status = camel_disco_store_status (store);
- if (status != CAMEL_DISCO_STORE_OFFLINE)
- return FALSE;
- camel_exception_clear (ex);
- }
- }
-
- switch (status) {
- case CAMEL_DISCO_STORE_ONLINE:
- case CAMEL_DISCO_STORE_RESYNCING:
- if (!CDS_CLASS (service)->connect_online (service, ex))
- return FALSE;
- if (camel_disco_diary_empty (store->diary))
- return TRUE;
-
- /* Need to resync */
- store->status = CAMEL_DISCO_STORE_RESYNCING;
- camel_disco_diary_replay (store->diary, ex);
- store->status = CAMEL_DISCO_STORE_ONLINE;
- if (camel_exception_is_set (ex))
- return FALSE;
-
- if (!camel_service_disconnect (service, TRUE, ex))
- return FALSE;
- return camel_service_connect (service, ex);
-
- case CAMEL_DISCO_STORE_OFFLINE:
- return CDS_CLASS (service)->connect_offline (service, ex);
- }
-
- g_assert_not_reached ();
- return FALSE;
-}
-
-static void
-disco_cancel_connect (CamelService *service)
-{
- CamelDiscoStore *store = CAMEL_DISCO_STORE (service);
-
- /* Fall back */
- store->status = CAMEL_DISCO_STORE_OFFLINE;
-
- CAMEL_SERVICE_CLASS (parent_class)->cancel_connect (service);
-}
-
-static gboolean
-disco_disconnect (CamelService *service, gboolean clean, CamelException *ex)
-{
- CamelDiscoStore *store = CAMEL_DISCO_STORE (service);
-
- switch (camel_disco_store_status (store)) {
- case CAMEL_DISCO_STORE_ONLINE:
- case CAMEL_DISCO_STORE_RESYNCING:
- if (!CDS_CLASS (service)->disconnect_online (service, clean, ex))
- return FALSE;
- break;
-
- case CAMEL_DISCO_STORE_OFFLINE:
- if (!CDS_CLASS (service)->disconnect_offline (service, clean, ex))
- return FALSE;
- break;
-
- }
-
- return CAMEL_SERVICE_CLASS (parent_class)->disconnect (service, clean, ex);
-}
-
-static CamelFolder *
-disco_get_folder (CamelStore *store, const char *name,
- guint32 flags, CamelException *ex)
-{
- CamelDiscoStore *disco_store = CAMEL_DISCO_STORE (store);
-
- switch (camel_disco_store_status (disco_store)) {
- case CAMEL_DISCO_STORE_ONLINE:
- return CDS_CLASS (store)->get_folder_online (store, name, flags, ex);
-
- case CAMEL_DISCO_STORE_OFFLINE:
- return CDS_CLASS (store)->get_folder_offline (store, name, flags, ex);
-
- case CAMEL_DISCO_STORE_RESYNCING:
- return CDS_CLASS (store)->get_folder_resyncing (store, name, flags, ex);
- }
-
- g_assert_not_reached ();
- return NULL;
-}
-
-static CamelFolderInfo *
-disco_get_folder_info (CamelStore *store, const char *top,
- guint32 flags, CamelException *ex)
-{
- CamelDiscoStore *disco_store = CAMEL_DISCO_STORE (store);
-
- /* Do this first so if we get forced offline, we'll switch to
- * the correct branch below. (FIXME: This only works because
- * we know that get_folder_info is the first call that the
- * mailer makes on a store.)
- */
- if (CAMEL_SERVICE (store)->status == CAMEL_SERVICE_DISCONNECTED) {
- if (!camel_service_connect (CAMEL_SERVICE (store), ex))
- return NULL;
- }
-
- switch (camel_disco_store_status (disco_store)) {
- case CAMEL_DISCO_STORE_ONLINE:
- return CDS_CLASS (store)->get_folder_info_online (store, top, flags, ex);
-
- case CAMEL_DISCO_STORE_OFFLINE:
- /* Can't edit subscriptions while offline */
- if ((store->flags & CAMEL_STORE_SUBSCRIPTIONS) &&
- !(flags & CAMEL_STORE_FOLDER_INFO_SUBSCRIBED)) {
- camel_disco_store_check_online (disco_store, ex);
- return NULL;
- }
-
- return CDS_CLASS (store)->get_folder_info_offline (store, top, flags, ex);
-
- case CAMEL_DISCO_STORE_RESYNCING:
- return CDS_CLASS (store)->get_folder_info_resyncing (store, top, flags, ex);
- }
-
- g_assert_not_reached ();
- return NULL;
-}
-
-
-/**
- * camel_disco_store_status:
- * @store: a disconnectable store
- *
- * Return value: the current online/offline status of @store.
- **/
-CamelDiscoStoreStatus
-camel_disco_store_status (CamelDiscoStore *store)
-{
- CamelService *service = CAMEL_SERVICE (store);
-
- g_return_val_if_fail (CAMEL_IS_DISCO_STORE (store), CAMEL_DISCO_STORE_ONLINE);
-
- if (service->status == CAMEL_SERVICE_CONNECTING &&
- store->status == CAMEL_DISCO_STORE_ONLINE &&
- !camel_session_is_online (service->session))
- store->status = CAMEL_DISCO_STORE_OFFLINE;
-
- return store->status;
-}
-
-
-static void
-set_status (CamelDiscoStore *disco_store, CamelDiscoStoreStatus status,
- CamelException *ex)
-{
- if (disco_store->status == status)
- return;
-
- camel_store_sync (CAMEL_STORE (disco_store), ex);
- if (camel_exception_is_set (ex))
- return;
- if (!camel_service_disconnect (CAMEL_SERVICE (disco_store), TRUE, ex))
- return;
-
- disco_store->status = status;
- camel_service_connect (CAMEL_SERVICE (disco_store), ex);
-}
-
-/**
- * camel_disco_store_set_status:
- * @store: a disconnectable store
- * @status: the new status
- * @ex: a CamelException
- *
- * Sets @store to @status. If an error occurrs and the status cannot
- * be set to @status, @ex will be set.
- **/
-void
-camel_disco_store_set_status (CamelDiscoStore *store,
- CamelDiscoStoreStatus status,
- CamelException *ex)
-{
- CDS_CLASS (store)->set_status (store, status, ex);
-}
-
-
-static gboolean
-can_work_offline (CamelDiscoStore *disco_store)
-{
- g_warning ("CamelDiscoStore::can_work_offline not implemented for `%s'",
- camel_type_to_name (CAMEL_OBJECT_GET_TYPE (disco_store)));
- return FALSE;
-}
-
-/**
- * camel_disco_store_can_work_offline:
- * @store: a disconnectable store
- *
- * Return value: whether or not @store can be used offline. (Will be
- * %FALSE if the store is not caching data to local disk, for example.)
- **/
-gboolean
-camel_disco_store_can_work_offline (CamelDiscoStore *store)
-{
- return CDS_CLASS (store)->can_work_offline (store);
-}
-
-
-/**
- * camel_disco_store_check_online:
- * @store: a disconnectable store
- * @ex: a CamelException
- *
- * This checks that @store is online, and sets @ex if it is not. This
- * can be used as a simple way to set a generic error message in @ex
- * for operations that won't work offline.
- *
- * Return value: whether or not @store is online.
- **/
-gboolean
-camel_disco_store_check_online (CamelDiscoStore *store, CamelException *ex)
-{
- if (camel_disco_store_status (store) != CAMEL_DISCO_STORE_ONLINE) {
- camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
- _("You must be working online to "
- "complete this operation"));
- return FALSE;
- }
-
- return TRUE;
-}
diff --git a/camel/camel-disco-store.h b/camel/camel-disco-store.h
deleted file mode 100644
index 7c95c96456..0000000000
--- a/camel/camel-disco-store.h
+++ /dev/null
@@ -1,125 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-disco-store.h: abstruct class for a disconnectable store */
-
-/*
- * Authors: Dan Winship <danw@ximian.com>
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifndef CAMEL_DISCO_STORE_H
-#define CAMEL_DISCO_STORE_H 1
-
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <camel/camel-store.h>
-
-#define CAMEL_DISCO_STORE_TYPE (camel_disco_store_get_type ())
-#define CAMEL_DISCO_STORE(obj) (CAMEL_CHECK_CAST((obj), CAMEL_DISCO_STORE_TYPE, CamelDiscoStore))
-#define CAMEL_DISCO_STORE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_DISCO_STORE_TYPE, CamelDiscoStoreClass))
-#define CAMEL_IS_DISCO_STORE(o) (CAMEL_CHECK_TYPE((o), CAMEL_DISCO_STORE_TYPE))
-
-enum {
- CAMEL_DISCO_STORE_ARG_FIRST = CAMEL_STORE_ARG_FIRST + 100,
-};
-
-typedef enum {
- CAMEL_DISCO_STORE_ONLINE,
- CAMEL_DISCO_STORE_OFFLINE,
- CAMEL_DISCO_STORE_RESYNCING
-} CamelDiscoStoreStatus;
-
-struct _CamelDiscoStore {
- CamelStore parent_object;
-
- CamelDiscoStoreStatus status;
- CamelDiscoDiary *diary;
-};
-
-
-typedef struct {
- CamelStoreClass parent_class;
-
- void (*set_status) (CamelDiscoStore *,
- CamelDiscoStoreStatus,
- CamelException *);
- gboolean (*can_work_offline) (CamelDiscoStore *);
-
-
- gboolean (*connect_online) (CamelService *,
- CamelException *);
- gboolean (*connect_offline) (CamelService *,
- CamelException *);
-
- gboolean (*disconnect_online) (CamelService *, gboolean,
- CamelException *);
- gboolean (*disconnect_offline) (CamelService *, gboolean,
- CamelException *);
-
- CamelFolder * (*get_folder_online) (CamelStore *store,
- const char *name,
- guint32 flags,
- CamelException *ex);
- CamelFolder * (*get_folder_offline) (CamelStore *store,
- const char *name,
- guint32 flags,
- CamelException *ex);
- CamelFolder * (*get_folder_resyncing) (CamelStore *store,
- const char *name,
- guint32 flags,
- CamelException *ex);
-
- CamelFolderInfo * (*get_folder_info_online) (CamelStore *store,
- const char *top,
- guint32 flags,
- CamelException *ex);
- CamelFolderInfo * (*get_folder_info_offline) (CamelStore *store,
- const char *top,
- guint32 flags,
- CamelException *ex);
- CamelFolderInfo * (*get_folder_info_resyncing) (CamelStore *store,
- const char *top,
- guint32 flags,
- CamelException *ex);
-
-} CamelDiscoStoreClass;
-
-
-/* Standard Camel function */
-CamelType camel_disco_store_get_type (void);
-
-/* Public methods */
-CamelDiscoStoreStatus camel_disco_store_status (CamelDiscoStore *);
-void camel_disco_store_set_status (CamelDiscoStore *,
- CamelDiscoStoreStatus,
- CamelException *);
-gboolean camel_disco_store_can_work_offline (CamelDiscoStore *);
-
-
-/* Convenience functions */
-gboolean camel_disco_store_check_online (CamelDiscoStore *store, CamelException *ex);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_DISCO_STORE_H */
diff --git a/camel/camel-exception-list.def b/camel/camel-exception-list.def
deleted file mode 100644
index 8fe1e268cf..0000000000
--- a/camel/camel-exception-list.def
+++ /dev/null
@@ -1,37 +0,0 @@
-/* WARNING: Exceptions MUST NOT be renumbered: they need to be
- * consistent across libraries compiled at different times.
- * Categories should be widely separated, old unused exceptions can
- * never be deleted, and new exceptions can be added only to the
- * ends of categories.
- */
-
-CAMEL_EXCEPTION_NONE = 0,
-
-/* Generic exceptions */
-CAMEL_EXCEPTION_INVALID_PARAM,
-CAMEL_EXCEPTION_SYSTEM,
-CAMEL_EXCEPTION_USER_CANCEL,
-
-/* CamelFolderException */
-CAMEL_EXCEPTION_FOLDER_NULL = 100,
-CAMEL_EXCEPTION_FOLDER_INVALID,
-CAMEL_EXCEPTION_FOLDER_INVALID_STATE,
-CAMEL_EXCEPTION_FOLDER_NON_EMPTY,
-CAMEL_EXCEPTION_FOLDER_NON_UID,
-CAMEL_EXCEPTION_FOLDER_INSUFFICIENT_PERMISSION,
-CAMEL_EXCEPTION_FOLDER_INVALID_PATH,
-CAMEL_EXCEPTION_FOLDER_INVALID_UID,
-CAMEL_EXCEPTION_FOLDER_SUMMARY_INVALID,
-
-/* CamelStoreException */
-CAMEL_EXCEPTION_STORE_NULL = 200,
-CAMEL_EXCEPTION_STORE_INVALID,
-CAMEL_EXCEPTION_STORE_NO_FOLDER,
-
-/* CamelServiceException */
-CAMEL_EXCEPTION_SERVICE_NULL = 300,
-CAMEL_EXCEPTION_SERVICE_INVALID,
-CAMEL_EXCEPTION_SERVICE_URL_INVALID,
-CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
-CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
-CAMEL_EXCEPTION_SERVICE_NOT_CONNECTED
diff --git a/camel/camel-exception.c b/camel/camel-exception.c
deleted file mode 100644
index 95e376624a..0000000000
--- a/camel/camel-exception.c
+++ /dev/null
@@ -1,306 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- *
- * Author :
- * Bertrand Guiheneuf <bertrand@helixcode.com>
- *
- * Copyright 1999-2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <glib.h>
-#include <pthread.h>
-
-#include "camel-exception.h"
-#include "e-util/e-memory.h"
-
-/* i dont know why gthread_mutex stuff even exists, this is easier */
-
-/* also, i'm not convinced mutexes are needed here. But it
- doesn't really hurt either */
-static pthread_mutex_t exception_mutex = PTHREAD_MUTEX_INITIALIZER;
-
-#define CAMEL_EXCEPTION_LOCK(e) (pthread_mutex_lock(&exception_mutex))
-#define CAMEL_EXCEPTION_UNLOCK(e) (pthread_mutex_unlock(&exception_mutex))
-
-static EMemChunk *exception_chunks = NULL;
-
-/**
- * camel_exception_new: allocate a new exception object.
- *
- * Create and returns a new exception object.
- *
- *
- * Return value: The newly allocated exception object.
- **/
-CamelException *
-camel_exception_new (void)
-{
- CamelException *ex;
-
- CAMEL_EXCEPTION_LOCK(exception);
-
- if (exception_chunks == NULL)
- exception_chunks = e_memchunk_new(16, sizeof(CamelException));
-
- ex = e_memchunk_alloc(exception_chunks);
- ex->desc = NULL;
-
- /* set the Exception Id to NULL */
- ex->id = CAMEL_EXCEPTION_NONE;
-
- CAMEL_EXCEPTION_UNLOCK(exception);
-
- return ex;
-}
-
-/**
- * camel_exception_init: init a (statically allocated) exception.
- *
- * Init an exception. This routine is mainly
- * useful when using a statically allocated
- * exception.
- *
- *
- **/
-void
-camel_exception_init (CamelException *ex)
-{
- ex->desc = NULL;
-
- /* set the Exception Id to NULL */
- ex->id = CAMEL_EXCEPTION_NONE;
-}
-
-
-/**
- * camel_exception_clear: Clear an exception
- * @exception: the exception object
- *
- * Clear an exception, that is, set the
- * exception ID to CAMEL_EXCEPTION_NONE and
- * free the description text.
- * If the exception is NULL, this funtion just
- * returns.
- **/
-void
-camel_exception_clear (CamelException *exception)
-{
- if (!exception)
- return;
-
- CAMEL_EXCEPTION_LOCK(exception);
-
- if (exception->desc)
- g_free (exception->desc);
- exception->desc = NULL;
- exception->id = CAMEL_EXCEPTION_NONE;
-
- CAMEL_EXCEPTION_UNLOCK(exception);
-}
-
-/**
- * camel_exception_free: Free an exception
- * @exception: The exception object to free
- *
- * Free an exception object. If the exception
- * is NULL, nothing is done, the routine simply
- * returns.
- **/
-void
-camel_exception_free (CamelException *exception)
-{
- if (!exception)
- return;
-
- if (exception->desc)
- g_free (exception->desc);
-
- CAMEL_EXCEPTION_LOCK(exception);
-
- e_memchunk_free(exception_chunks, exception);
-
- CAMEL_EXCEPTION_UNLOCK(exception);
-}
-
-/**
- * camel_exception_set: set an exception
- * @ex: exception object
- * @id: exception id
- * @desc: textual description of the exception
- *
- * Set the value of an exception. The exception id is
- * a unique number representing the exception. The
- * textual description is a small text explaining
- * what happened and provoked the exception.
- *
- * When @ex is NULL, nothing is done, this routine
- * simply returns.
- *
- **/
-void
-camel_exception_set (CamelException *ex,
- ExceptionId id,
- const char *desc)
-{
- if (!ex)
- return;
-
- CAMEL_EXCEPTION_LOCK(exception);
-
- ex->id = id;
-
- if (desc != ex->desc) {
- g_free (ex->desc);
- ex->desc = g_strdup (desc);
- }
-
- CAMEL_EXCEPTION_UNLOCK(exception);
-}
-
-/**
- * camel_exception_setv: set an exception
- * @ex: exception object
- * @id: exception id
- * @format: format of the description string. The format string is
- * used as in printf().
- *
- * Set the value of an exception. The exception id is
- * a unique number representing the exception. The
- * textual description is a small text explaining
- * what happened and provoked the exception.
- * In this version, the string is created from the format
- * string and the variable argument list.
- *
- * It is safe to say:
- * camel_exception_setv (ex, ..., camel_exception_get_description (ex), ...);
- *
- * When @ex is NULL, nothing is done, this routine
- * simply returns.
- *
- **/
-void
-camel_exception_setv (CamelException *ex,
- ExceptionId id,
- const char *format,
- ...)
-{
- va_list args;
- char *old;
-
- if (!ex)
- return;
-
- CAMEL_EXCEPTION_LOCK(exception);
-
- old = ex->desc;
-
- va_start(args, format);
- ex->desc = g_strdup_vprintf (format, args);
- va_end (args);
-
- g_free (old);
-
- ex->id = id;
-
- CAMEL_EXCEPTION_UNLOCK(exception);
-}
-
-/**
- * camel_exception_xfer: transfer an exception
- * @ex_dst: Destination exception object
- * @ex_src: Source exception object
- *
- * Transfer the content of an exception from
- * an exception object to another.
- * The destination exception receives the id and
- * the description text of the source exception.
- **/
-void
-camel_exception_xfer (CamelException *ex_dst,
- CamelException *ex_src)
-{
- if (ex_src == NULL) {
- g_warning ("camel_exception_xfer: trying to transfer NULL exception to %p\n", ex_dst);
- return;
- }
-
- if (ex_dst == NULL) {
- /* must have same side-effects */
- camel_exception_clear (ex_src);
- return;
- }
-
- CAMEL_EXCEPTION_LOCK(exception);
-
- if (ex_dst->desc)
- g_free (ex_dst->desc);
-
- ex_dst->id = ex_src->id;
- ex_dst->desc = ex_src->desc;
-
- ex_src->desc = NULL;
- ex_src->id = CAMEL_EXCEPTION_NONE;
-
- CAMEL_EXCEPTION_UNLOCK(exception);
-}
-
-/**
- * camel_exception_get_id: get the exception id
- * @ex: The exception object
- *
- * Return the id of an exception.
- * If @ex is NULL, return CAMEL_EXCEPTION_NONE;
- *
- * Return value: Exception ID.
- **/
-ExceptionId
-camel_exception_get_id (CamelException *ex)
-{
- if (ex)
- return ex->id;
- else {
- g_warning ("camel_exception_get_id called with NULL parameter.");
- return CAMEL_EXCEPTION_NONE;
- }
-}
-
-/**
- * camel_exception_get_description: get the description of an exception.
- * @ex: The exception object
- *
- * Return the exception description text.
- * If @ex is NULL, return NULL;
- *
- *
- * Return value: Exception description text.
- **/
-const gchar *
-camel_exception_get_description (CamelException *ex)
-{
- char *ret = NULL;
-
- if (ex)
- ret = ex->desc;
- else
- g_warning ("camel_exception_get_description called with NULL parameter.");
-
- return ret;
-}
diff --git a/camel/camel-exception.h b/camel/camel-exception.h
deleted file mode 100644
index 77c2c16066..0000000000
--- a/camel/camel-exception.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-execpetion.h : exception utils */
-
-/*
- *
- * Author :
- * Bertrand Guiheneuf <bertrand@helixcode.com>
- *
- * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-
-#ifndef CAMEL_EXCEPTION_H
-#define CAMEL_EXCEPTION_H 1
-
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include <camel/camel-types.h>
-
-typedef enum {
-#include "camel-exception-list.def"
-
-} ExceptionId;
-
-
-struct _CamelException {
- /* do not access the fields directly */
- ExceptionId id;
- char *desc;
-
-};
-
-
-
-/* creation and destruction functions */
-CamelException * camel_exception_new (void);
-void camel_exception_free (CamelException *exception);
-void camel_exception_init (CamelException *ex);
-
-
-/* exception content manipulation */
-void camel_exception_clear (CamelException *exception);
-void camel_exception_set (CamelException *ex,
- ExceptionId id,
- const char *desc);
-void camel_exception_setv (CamelException *ex,
- ExceptionId id,
- const char *format,
- ...);
-
-
-/* exception content transfer */
-void camel_exception_xfer (CamelException *ex_dst,
- CamelException *ex_src);
-
-
-/* exception content retrieval */
-ExceptionId camel_exception_get_id (CamelException *ex);
-const char * camel_exception_get_description (CamelException *ex);
-
-#define camel_exception_is_set(ex) (camel_exception_get_id (ex) != CAMEL_EXCEPTION_NONE)
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_EXCEPTION_H */
-
diff --git a/camel/camel-file-utils.c b/camel/camel-file-utils.c
deleted file mode 100644
index 540fef2739..0000000000
--- a/camel/camel-file-utils.c
+++ /dev/null
@@ -1,546 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Authors:
- * Michael Zucchi <notzed@ximian.com>
- * Jeffrey Stedfast <fejj@ximian.com>
- * Dan Winship <danw@ximian.com>
- *
- * Copyright (C) 2000, 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-
-#include "camel-file-utils.h"
-#include "camel-operation.h"
-#include "camel-url.h"
-
-#ifndef MAX
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-#endif
-
-
-/**
- * camel_file_util_encode_uint32:
- * @out: file to output to
- * @value: value to output
- *
- * Utility function to save an uint32 to a file.
- *
- * Return value: 0 on success, -1 on error.
- **/
-int
-camel_file_util_encode_uint32 (FILE *out, guint32 value)
-{
- int i;
-
- for (i = 28; i > 0; i -= 7) {
- if (value >= (1 << i)) {
- unsigned int c = (value >> i) & 0x7f;
- if (fputc (c, out) == -1)
- return -1;
- }
- }
- return fputc (value | 0x80, out);
-}
-
-
-/**
- * camel_file_util_decode_uint32:
- * @in: file to read from
- * @dest: pointer to a variable to store the value in
- *
- * Retrieve an encoded uint32 from a file.
- *
- * Return value: 0 on success, -1 on error. @*dest will contain the
- * decoded value.
- **/
-int
-camel_file_util_decode_uint32 (FILE *in, guint32 *dest)
-{
- guint32 value = 0;
- int v;
-
- /* until we get the last byte, keep decoding 7 bits at a time */
- while ( ((v = fgetc (in)) & 0x80) == 0 && v!=EOF) {
- value |= v;
- value <<= 7;
- }
- if (v == EOF) {
- *dest = value >> 7;
- return -1;
- }
- *dest = value | (v & 0x7f);
-
- return 0;
-}
-
-
-/**
- * camel_file_util_encode_fixed_int32:
- * @out: file to output to
- * @value: value to output
- *
- * Encode a gint32, performing no compression, but converting
- * to network order.
- *
- * Return value: 0 on success, -1 on error.
- **/
-int
-camel_file_util_encode_fixed_int32 (FILE *out, gint32 value)
-{
- guint32 save;
-
- save = htonl (value);
- if (fwrite (&save, sizeof (save), 1, out) != 1)
- return -1;
- return 0;
-}
-
-
-/**
- * camel_file_util_decode_fixed_int32:
- * @in: file to read from
- * @dest: pointer to a variable to store the value in
- *
- * Retrieve a gint32.
- *
- * Return value: 0 on success, -1 on error.
- **/
-int
-camel_file_util_decode_fixed_int32 (FILE *in, gint32 *dest)
-{
- guint32 save;
-
- if (fread (&save, sizeof (save), 1, in) == 1) {
- *dest = ntohl (save);
- return 0;
- } else {
- return -1;
- }
-}
-
-
-/**
- * camel_file_util_encode_time_t:
- * @out: file to output to
- * @value: value to output
- *
- * Encode a time_t value to the file.
- *
- * Return value: 0 on success, -1 on error.
- **/
-int
-camel_file_util_encode_time_t(FILE *out, time_t value)
-{
- int i;
-
- for (i = sizeof (time_t) - 1; i >= 0; i--) {
- if (fputc((value >> (i * 8)) & 0xff, out) == -1)
- return -1;
- }
- return 0;
-}
-
-
-/**
- * camel_file_util_decode_time_t:
- * @in: file to read from
- * @dest: pointer to a variable to store the value in
- *
- * Decode a time_t value.
- *
- * Return value: 0 on success, -1 on error.
- **/
-int
-camel_file_util_decode_time_t (FILE *in, time_t *dest)
-{
- time_t save = 0;
- int i = sizeof (time_t) - 1;
- int v = EOF;
-
- while (i >= 0 && (v = fgetc (in)) != EOF) {
- save |= ((time_t)v) << (i * 8);
- i--;
- }
- *dest = save;
- if (v == EOF)
- return -1;
- return 0;
-}
-
-
-/**
- * camel_file_util_encode_off_t:
- * @out: file to output to
- * @value: value to output
- *
- * Encode an off_t type.
- *
- * Return value: 0 on success, -1 on error.
- **/
-int
-camel_file_util_encode_off_t (FILE *out, off_t value)
-{
- int i;
-
- for (i = sizeof (off_t) - 1; i >= 0; i--) {
- if (fputc ((value >> (i * 8)) & 0xff, out) == -1)
- return -1;
- }
- return 0;
-}
-
-
-/**
- * camel_file_util_decode_off_t:
- * @in: file to read from
- * @dest: pointer to a variable to put the value in
- *
- * Decode an off_t type.
- *
- * Return value: 0 on success, -1 on failure.
- **/
-int
-camel_file_util_decode_off_t (FILE *in, off_t *dest)
-{
- off_t save = 0;
- int i = sizeof(off_t) - 1;
- int v = EOF;
-
- while (i >= 0 && (v = fgetc (in)) != EOF) {
- save |= ((off_t)v) << (i * 8);
- i--;
- }
- *dest = save;
- if (v == EOF)
- return -1;
- return 0;
-}
-
-
-/**
- * camel_file_util_encode_string:
- * @out: file to output to
- * @str: value to output
- *
- * Encode a normal string and save it in the output file.
- *
- * Return value: 0 on success, -1 on error.
- **/
-int
-camel_file_util_encode_string (FILE *out, const char *str)
-{
- register int len;
-
- if (str == NULL)
- return camel_file_util_encode_uint32 (out, 1);
-
- len = strlen (str);
- if (camel_file_util_encode_uint32 (out, len+1) == -1)
- return -1;
- if (len == 0 || fwrite (str, len, 1, out) == 1)
- return 0;
- return -1;
-}
-
-
-/**
- * camel_file_util_decode_string:
- * @in: file to read from
- * @str: pointer to a variable to store the value in
- *
- * Decode a normal string from the input file.
- *
- * Return value: 0 on success, -1 on error.
- **/
-int
-camel_file_util_decode_string (FILE *in, char **str)
-{
- guint32 len;
- register char *ret;
-
- if (camel_file_util_decode_uint32 (in, &len) == -1) {
- *str = NULL;
- return -1;
- }
-
- len--;
- if (len > 65536) {
- *str = NULL;
- return -1;
- }
-
- ret = g_malloc (len+1);
- if (len > 0 && fread (ret, len, 1, in) != 1) {
- g_free (ret);
- *str = NULL;
- return -1;
- }
-
- ret[len] = 0;
- *str = ret;
- return 0;
-}
-
-
-/**
- * camel_mkdir:
- * @path: directory path to create
- * @mode: permissions
- *
- * Creates the directory path described in @path, creating any parent
- * directories as necessary.
- *
- * Returns 0 on success or -1 on fail. In the case of failure, errno
- * will be set appropriately.
- **/
-int
-camel_mkdir (const char *path, mode_t mode)
-{
- char *copy, *p;
-
- g_assert(path && path[0] == '/');
-
- p = copy = g_alloca (strlen (path) + 1);
- strcpy(copy, path);
- do {
- p = strchr(p + 1, '/');
- if (p)
- *p = '\0';
- if (access(copy, F_OK) == -1) {
- if (mkdir(copy, mode) == -1)
- return -1;
- }
- if (p)
- *p = '/';
- } while (p);
-
- return 0;
-}
-
-
-/**
- * camel_file_util_safe_filename:
- * @name: string to 'flattened' into a safe filename
- *
- * 'Flattens' @name into a safe filename string by hex encoding any
- * chars that may cause problems on the filesystem.
- *
- * Returns a safe filename string.
- **/
-char *
-camel_file_util_safe_filename (const char *name)
-{
- if (name == NULL)
- return NULL;
-
- return camel_url_encode(name, "/?()'*");
-}
-
-
-/* FIXME: poll() might be more efficient and more portable? */
-
-/**
- * camel_read:
- * @fd: file descriptor
- * @buf: buffer to fill
- * @n: number of bytes to read into @buf
- *
- * Cancellable libc read() replacement.
- *
- * Returns number of bytes read or -1 on fail. On failure, errno will
- * be set appropriately.
- **/
-ssize_t
-camel_read (int fd, char *buf, size_t n)
-{
- ssize_t nread;
- int cancel_fd;
-
- if (camel_operation_cancel_check (NULL)) {
- errno = EINTR;
- return -1;
- }
-
- cancel_fd = camel_operation_cancel_fd (NULL);
- if (cancel_fd == -1) {
- do {
- nread = read (fd, buf, n);
- } while (nread == -1 && (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK));
- } else {
- int errnosav, flags, fdmax;
- fd_set rdset;
-
- flags = fcntl (fd, F_GETFL);
- fcntl (fd, F_SETFL, flags | O_NONBLOCK);
-
- do {
- FD_ZERO (&rdset);
- FD_SET (fd, &rdset);
- FD_SET (cancel_fd, &rdset);
- fdmax = MAX (fd, cancel_fd) + 1;
-
- nread = -1;
- if (select (fdmax, &rdset, 0, 0, NULL) != -1) {
- if (FD_ISSET (cancel_fd, &rdset)) {
- fcntl (fd, F_SETFL, flags);
- errno = EINTR;
- return -1;
- }
-
- do {
- nread = read (fd, buf, n);
- } while (nread == -1 && errno == EINTR);
- } else if (errno == EINTR) {
- errno = EAGAIN;
- }
- } while (nread == -1 && (errno == EAGAIN || errno == EWOULDBLOCK));
-
- errnosav = errno;
- fcntl (fd, F_SETFL, flags);
- errno = errnosav;
- }
-
- return nread;
-}
-
-
-/**
- * camel_write:
- * @fd: file descriptor
- * @buf: buffer to write
- * @n: number of bytes of @buf to write
- *
- * Cancellable libc write() replacement.
- *
- * Returns number of bytes written or -1 on fail. On failure, errno will
- * be set appropriately.
- **/
-ssize_t
-camel_write (int fd, const char *buf, size_t n)
-{
- ssize_t w, written = 0;
- int cancel_fd;
-
- if (camel_operation_cancel_check (NULL)) {
- errno = EINTR;
- return -1;
- }
-
- cancel_fd = camel_operation_cancel_fd (NULL);
- if (cancel_fd == -1) {
- do {
- do {
- w = write (fd, buf + written, n - written);
- } while (w == -1 && (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK));
-
- if (w > 0)
- written += w;
- } while (w != -1 && written < n);
- } else {
- int errnosav, flags, fdmax;
- fd_set rdset, wrset;
-
- flags = fcntl (fd, F_GETFL);
- fcntl (fd, F_SETFL, flags | O_NONBLOCK);
-
- fdmax = MAX (fd, cancel_fd) + 1;
- do {
- FD_ZERO (&rdset);
- FD_ZERO (&wrset);
- FD_SET (fd, &wrset);
- FD_SET (cancel_fd, &rdset);
-
- w = -1;
- if (select (fdmax, &rdset, &wrset, 0, NULL) != -1) {
- if (FD_ISSET (cancel_fd, &rdset)) {
- fcntl (fd, F_SETFL, flags);
- errno = EINTR;
- return -1;
- }
-
- do {
- w = write (fd, buf + written, n - written);
- } while (w == -1 && errno == EINTR);
-
- if (w == -1) {
- if (errno == EAGAIN || errno == EWOULDBLOCK) {
- w = 0;
- } else {
- errnosav = errno;
- fcntl (fd, F_SETFL, flags);
- errno = errnosav;
- return -1;
- }
- } else
- written += w;
- } else if (errno == EINTR) {
- w = 0;
- }
- } while (w != -1 && written < n);
-
- errnosav = errno;
- fcntl (fd, F_SETFL, flags);
- errno = errnosav;
- }
-
- if (w == -1)
- return -1;
-
- return written;
-}
-
-/**
- * camel_file_util_savename:
- * @filename:
- *
- * Builds a filename of the form ".#" + @filename, used to create
- * a two-stage commit file write.
- *
- * Return value: ".#" + filename. It must be free'd with g_free().
- **/
-char *
-camel_file_util_savename(const char *filename)
-{
- char *name, *slash;
- int off;
-
- name = g_malloc(strlen(filename)+3);
- slash = strrchr(filename, '/');
- if (slash) {
- off = slash-filename;
-
- memcpy(name, filename, off+1);
- memcpy(name + off+1, ".#", 2);
- strcpy(name + off+3, filename+off+1);
- } else {
- sprintf(name, ".#%s", filename);
- }
-
- return name;
-}
diff --git a/camel/camel-file-utils.h b/camel/camel-file-utils.h
deleted file mode 100644
index 15022d99b3..0000000000
--- a/camel/camel-file-utils.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Authors:
- * Michael Zucchi <notzed@ximian.com>
- * Jeffrey Stedfast <fejj@ximian.com>
- * Dan Winship <danw@ximian.com>
- *
- * Copyright (C) 2000, 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifndef CAMEL_FILE_UTILS_H
-#define CAMEL_FILE_UTILS_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <glib.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <time.h>
-
-int camel_file_util_encode_fixed_int32 (FILE *out, gint32);
-int camel_file_util_decode_fixed_int32 (FILE *in, gint32 *);
-int camel_file_util_encode_uint32 (FILE *out, guint32);
-int camel_file_util_decode_uint32 (FILE *in, guint32 *);
-int camel_file_util_encode_time_t (FILE *out, time_t);
-int camel_file_util_decode_time_t (FILE *in, time_t *);
-int camel_file_util_encode_off_t (FILE *out, off_t);
-int camel_file_util_decode_off_t (FILE *in, off_t *);
-int camel_file_util_encode_string (FILE *out, const char *);
-int camel_file_util_decode_string (FILE *in, char **);
-
-int camel_mkdir (const char *path, mode_t mode);
-char *camel_file_util_safe_filename (const char *name);
-
-ssize_t camel_read (int fd, char *buf, size_t n);
-ssize_t camel_write (int fd, const char *buf, size_t n);
-
-char *camel_file_util_savename(const char *filename);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_FILE_UTILS_H */
diff --git a/camel/camel-filter-driver.c b/camel/camel-filter-driver.c
deleted file mode 100644
index 1282188eb0..0000000000
--- a/camel/camel-filter-driver.c
+++ /dev/null
@@ -1,1473 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- * Jeffrey Stedfast <fejj@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <signal.h>
-#include <fcntl.h>
-#include <errno.h>
-
-#include <string.h>
-#include <time.h>
-
-#include <glib.h>
-
-#include "camel-filter-driver.h"
-#include "camel-filter-search.h"
-
-#include "camel-service.h"
-#include "camel-stream-fs.h"
-#include "camel-stream-mem.h"
-#include "camel-mime-message.h"
-
-#include "e-util/e-sexp.h"
-#include "e-util/e-memory.h"
-#include "e-util/e-msgport.h" /* for edlist */
-
-#define d(x)
-
-/* an invalid pointer */
-#define FOLDER_INVALID ((void *)~0)
-
-/* type of status for a log report */
-enum filter_log_t {
- FILTER_LOG_NONE,
- FILTER_LOG_START, /* start of new log entry */
- FILTER_LOG_ACTION, /* an action performed */
- FILTER_LOG_END, /* end of log */
-};
-
-/* list of rule nodes */
-struct _filter_rule {
- struct _filter_rule *next;
- struct _filter_rule *prev;
-
- char *match;
- char *action;
- char *name;
-};
-
-struct _CamelFilterDriverPrivate {
- GHashTable *globals; /* global variables */
-
- CamelSession *session;
-
- CamelFolder *defaultfolder; /* defualt folder */
-
- CamelFilterStatusFunc *statusfunc; /* status callback */
- void *statusdata; /* status callback data */
-
- CamelFilterShellFunc *shellfunc; /* execute shell command callback */
- void *shelldata; /* execute shell command callback data */
-
- CamelFilterPlaySoundFunc *playfunc; /* play-sound command callback */
- void *playdata; /* play-sound command callback data */
-
- CamelFilterSystemBeepFunc *beep; /* system beep callback */
- void *beepdata; /* system beep callback data */
-
- /* for callback */
- CamelFilterGetFolderFunc get_folder;
- void *data;
-
- /* run-time data */
- GHashTable *folders; /* folders that message has been copied to */
- int closed; /* close count */
- GHashTable *forwards; /* addresses that have been forwarded the message */
- GHashTable *only_once; /* actions to run only-once */
-
- gboolean terminated; /* message processing was terminated */
- gboolean deleted; /* message was marked for deletion */
- gboolean copied; /* message was copied to some folder or another */
-
- CamelMimeMessage *message; /* input message */
- CamelMessageInfo *info; /* message summary info */
- const char *uid; /* message uid */
- CamelFolder *source; /* message source folder */
- gboolean modified; /* has the input message been modified? */
-
- FILE *logfile; /* log file */
-
- EDList rules; /* list of _filter_rule structs */
-
- CamelException *ex;
-
- /* evaluator */
- ESExp *eval;
-};
-
-#define _PRIVATE(o) (((CamelFilterDriver *)(o))->priv)
-
-static void camel_filter_driver_class_init (CamelFilterDriverClass *klass);
-static void camel_filter_driver_init (CamelFilterDriver *obj);
-static void camel_filter_driver_finalise (CamelObject *obj);
-
-static void camel_filter_driver_log (CamelFilterDriver *driver, enum filter_log_t status, const char *desc, ...);
-
-static CamelFolder *open_folder (CamelFilterDriver *d, const char *folder_url);
-static int close_folders (CamelFilterDriver *d);
-
-static ESExpResult *do_delete (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *);
-static ESExpResult *mark_forward (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *);
-static ESExpResult *do_copy (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *);
-static ESExpResult *do_move (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *);
-static ESExpResult *do_stop (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *);
-static ESExpResult *do_colour (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *);
-static ESExpResult *do_score (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *);
-static ESExpResult *set_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *);
-static ESExpResult *unset_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *);
-static ESExpResult *do_shell (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *);
-static ESExpResult *do_beep (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *);
-static ESExpResult *play_sound (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *);
-static ESExpResult *do_only_once (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *);
-static ESExpResult *pipe_message (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *);
-
-/* these are our filter actions - each must have a callback */
-static struct {
- char *name;
- ESExpFunc *func;
- int type; /* set to 1 if a function can perform shortcut evaluation, or
- doesn't execute everything, 0 otherwise */
-} symbols[] = {
- { "delete", (ESExpFunc *) do_delete, 0 },
- { "forward-to", (ESExpFunc *) mark_forward, 0 },
- { "copy-to", (ESExpFunc *) do_copy, 0 },
- { "move-to", (ESExpFunc *) do_move, 0 },
- { "stop", (ESExpFunc *) do_stop, 0 },
- { "set-colour", (ESExpFunc *) do_colour, 0 },
- { "set-score", (ESExpFunc *) do_score, 0 },
- { "set-system-flag", (ESExpFunc *) set_flag, 0 },
- { "unset-system-flag", (ESExpFunc *) unset_flag, 0 },
- { "pipe-message", (ESExpFunc *) pipe_message, 0 },
- { "shell", (ESExpFunc *) do_shell, 0 },
- { "beep", (ESExpFunc *) do_beep, 0 },
- { "play-sound", (ESExpFunc *) play_sound, 0 },
- { "only-once", (ESExpFunc *) do_only_once, 0 }
-};
-
-static CamelObjectClass *camel_filter_driver_parent;
-
-CamelType
-camel_filter_driver_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (CAMEL_OBJECT_TYPE,
- "CamelFilterDriver",
- sizeof (CamelFilterDriver),
- sizeof (CamelFilterDriverClass),
- (CamelObjectClassInitFunc) camel_filter_driver_class_init,
- NULL,
- (CamelObjectInitFunc) camel_filter_driver_init,
- (CamelObjectFinalizeFunc) camel_filter_driver_finalise);
- }
-
- return type;
-}
-
-static void
-camel_filter_driver_class_init (CamelFilterDriverClass *klass)
-{
- /*CamelObjectClass *object_class = (CamelObjectClass *) klass;*/
-
- camel_filter_driver_parent = camel_type_get_global_classfuncs(camel_object_get_type());
-}
-
-static void
-camel_filter_driver_init (CamelFilterDriver *obj)
-{
- struct _CamelFilterDriverPrivate *p;
- int i;
-
- p = _PRIVATE (obj) = g_malloc0 (sizeof (*p));
-
- e_dlist_init(&p->rules);
-
- p->eval = e_sexp_new ();
- /* Load in builtin symbols */
- for (i = 0; i < sizeof (symbols) / sizeof (symbols[0]); i++) {
- if (symbols[i].type == 1) {
- e_sexp_add_ifunction (p->eval, 0, symbols[i].name, (ESExpIFunc *)symbols[i].func, obj);
- } else {
- e_sexp_add_function (p->eval, 0, symbols[i].name, symbols[i].func, obj);
- }
- }
-
- p->globals = g_hash_table_new (g_str_hash, g_str_equal);
-
- p->folders = g_hash_table_new (g_str_hash, g_str_equal);
-
- p->only_once = g_hash_table_new (g_str_hash, g_str_equal);
-}
-
-static void
-free_hash_strings (void *key, void *value, void *data)
-{
- g_free (key);
- g_free (value);
-}
-
-static void
-camel_filter_driver_finalise (CamelObject *obj)
-{
- CamelFilterDriver *driver = (CamelFilterDriver *) obj;
- struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
- struct _filter_rule *node;
-
- /* close all folders that were opened for appending */
- close_folders (driver);
- g_hash_table_destroy (p->folders);
-
- g_hash_table_foreach (p->globals, free_hash_strings, driver);
- g_hash_table_destroy (p->globals);
-
- g_hash_table_foreach (p->only_once, free_hash_strings, driver);
- g_hash_table_destroy (p->only_once);
-
- e_sexp_unref(p->eval);
-
- if (p->defaultfolder) {
- camel_folder_thaw (p->defaultfolder);
- camel_object_unref (p->defaultfolder);
- }
-
- while ((node = (struct _filter_rule *)e_dlist_remhead(&p->rules))) {
- g_free(node->match);
- g_free(node->action);
- g_free(node->name);
- g_free(node);
- }
-
- camel_object_unref(p->session);
-
- g_free (p);
-}
-
-/**
- * camel_filter_driver_new:
- *
- * Return value: A new CamelFilterDriver object
- **/
-CamelFilterDriver *
-camel_filter_driver_new (CamelSession *session)
-{
- CamelFilterDriver *d = (CamelFilterDriver *)camel_object_new(camel_filter_driver_get_type());
-
- d->priv->session = session;
- camel_object_ref((CamelObject *)session);
-
- return d;
-}
-
-void
-camel_filter_driver_set_folder_func (CamelFilterDriver *d, CamelFilterGetFolderFunc get_folder, void *data)
-{
- struct _CamelFilterDriverPrivate *p = _PRIVATE (d);
-
- p->get_folder = get_folder;
- p->data = data;
-}
-
-void
-camel_filter_driver_set_logfile (CamelFilterDriver *d, FILE *logfile)
-{
- struct _CamelFilterDriverPrivate *p = _PRIVATE (d);
-
- p->logfile = logfile;
-}
-
-void
-camel_filter_driver_set_status_func (CamelFilterDriver *d, CamelFilterStatusFunc *func, void *data)
-{
- struct _CamelFilterDriverPrivate *p = _PRIVATE (d);
-
- p->statusfunc = func;
- p->statusdata = data;
-}
-
-void
-camel_filter_driver_set_shell_func (CamelFilterDriver *d, CamelFilterShellFunc *func, void *data)
-{
- struct _CamelFilterDriverPrivate *p = _PRIVATE (d);
-
- p->shellfunc = func;
- p->shelldata = data;
-}
-
-void
-camel_filter_driver_set_play_sound_func (CamelFilterDriver *d, CamelFilterPlaySoundFunc *func, void *data)
-{
- struct _CamelFilterDriverPrivate *p = _PRIVATE (d);
-
- p->playfunc = func;
- p->playdata = data;
-}
-
-void
-camel_filter_driver_set_system_beep_func (CamelFilterDriver *d, CamelFilterSystemBeepFunc *func, void *data)
-{
- struct _CamelFilterDriverPrivate *p = _PRIVATE (d);
-
- p->beep = func;
- p->beepdata = data;
-}
-
-void
-camel_filter_driver_set_default_folder (CamelFilterDriver *d, CamelFolder *def)
-{
- struct _CamelFilterDriverPrivate *p = _PRIVATE (d);
-
- if (p->defaultfolder) {
- camel_folder_thaw (p->defaultfolder);
- camel_object_unref (p->defaultfolder);
- }
-
- p->defaultfolder = def;
-
- if (p->defaultfolder) {
- camel_folder_freeze (p->defaultfolder);
- camel_object_ref (p->defaultfolder);
- }
-}
-
-void
-camel_filter_driver_add_rule(CamelFilterDriver *d, const char *name, const char *match, const char *action)
-{
- struct _CamelFilterDriverPrivate *p = _PRIVATE (d);
- struct _filter_rule *node;
-
- node = g_malloc(sizeof(*node));
- node->match = g_strdup(match);
- node->action = g_strdup(action);
- node->name = g_strdup(name);
- e_dlist_addtail(&p->rules, (EDListNode *)node);
-}
-
-int
-camel_filter_driver_remove_rule_by_name (CamelFilterDriver *d, const char *name)
-{
- struct _CamelFilterDriverPrivate *p = _PRIVATE (d);
- struct _filter_rule *node;
-
- node = (struct _filter_rule *) p->rules.head;
- while (node->next) {
- if (!strcmp (node->name, name)) {
- e_dlist_remove ((EDListNode *) node);
- g_free (node->match);
- g_free (node->action);
- g_free (node->name);
- g_free (node);
-
- return 0;
- }
-
- node = node->next;
- }
-
- return -1;
-}
-
-static void
-report_status (CamelFilterDriver *driver, enum camel_filter_status_t status, int pc, const char *desc, ...)
-{
- /* call user-defined status report function */
- struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
- va_list ap;
- char *str;
-
- if (p->statusfunc) {
- va_start (ap, desc);
- str = g_strdup_vprintf (desc, ap);
- p->statusfunc (driver, status, pc, str, p->statusdata);
- g_free (str);
- }
-}
-
-
-#if 0
-void
-camel_filter_driver_set_global (CamelFilterDriver *d, const char *name, const char *value)
-{
- struct _CamelFilterDriverPrivate *p = _PRIVATE (d);
- char *oldkey, *oldvalue;
-
- if (g_hash_table_lookup_extended (p->globals, name, (void *)&oldkey, (void *)&oldvalue)) {
- g_free (oldvalue);
- g_hash_table_insert (p->globals, oldkey, g_strdup (value));
- } else {
- g_hash_table_insert (p->globals, g_strdup (name), g_strdup (value));
- }
-}
-#endif
-
-static ESExpResult *
-do_delete (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
-{
- struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
-
- d(fprintf (stderr, "doing delete\n"));
- p->deleted = TRUE;
- camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Delete");
-
- return NULL;
-}
-
-static ESExpResult *
-mark_forward (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
-{
- /*struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);*/
-
- d(fprintf (stderr, "marking message for forwarding\n"));
- /* FIXME: do stuff here */
- camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Forward");
-
- return NULL;
-}
-
-static ESExpResult *
-do_copy (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
-{
- struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
- int i;
-
- d(fprintf (stderr, "copying message...\n"));
-
- for (i = 0; i < argc; i++) {
- if (argv[i]->type == ESEXP_RES_STRING) {
- /* open folders we intent to copy to */
- char *folder = argv[i]->value.string;
- CamelFolder *outbox;
-
- outbox = open_folder (driver, folder);
- if (!outbox)
- break;
-
- if (outbox == p->source)
- break;
-
- if (!p->modified && p->uid && p->source && camel_folder_has_summary_capability (p->source)) {
- GPtrArray *uids;
-
- uids = g_ptr_array_new ();
- g_ptr_array_add (uids, (char *) p->uid);
- camel_folder_transfer_messages_to (p->source, uids, outbox, NULL, FALSE, p->ex);
- g_ptr_array_free (uids, TRUE);
- } else {
- if (p->message == NULL)
- p->message = camel_folder_get_message (p->source, p->uid, p->ex);
-
- if (!p->message)
- continue;
-
- camel_folder_append_message (outbox, p->message, p->info, NULL, p->ex);
- }
-
- if (!camel_exception_is_set (p->ex))
- p->copied = TRUE;
-
- camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Copy to folder %s",
- folder);
- }
- }
-
- return NULL;
-}
-
-static ESExpResult *
-do_move (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
-{
- struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
- int i;
-
- d(fprintf (stderr, "moving message...\n"));
-
- for (i = 0; i < argc; i++) {
- if (argv[i]->type == ESEXP_RES_STRING) {
- /* open folders we intent to move to */
- char *folder = argv[i]->value.string;
- CamelFolder *outbox;
-
- outbox = open_folder (driver, folder);
- if (!outbox)
- break;
-
- if (outbox == p->source)
- break;
-
- if (!p->modified && p->uid && p->source && camel_folder_has_summary_capability (p->source)) {
- GPtrArray *uids;
-
- uids = g_ptr_array_new ();
- g_ptr_array_add (uids, (char *) p->uid);
- camel_folder_transfer_messages_to (p->source, uids, outbox, NULL, FALSE, p->ex);
- g_ptr_array_free (uids, TRUE);
- } else {
- if (p->message == NULL)
- p->message = camel_folder_get_message (p->source, p->uid, p->ex);
-
- if (!p->message)
- continue;
-
- camel_folder_append_message (outbox, p->message, p->info, NULL, p->ex);
- }
-
- if (!camel_exception_is_set (p->ex)) {
- /* a 'move' is a copy & delete */
- p->copied = TRUE;
- p->deleted = TRUE;
- }
-
- camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Move to folder %s",
- folder);
- }
- }
-
- return NULL;
-}
-
-static ESExpResult *
-do_stop (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
-{
- struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
-
- camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Stopped processing");
- d(fprintf (stderr, "terminating message processing\n"));
- p->terminated = TRUE;
-
- return NULL;
-}
-
-static ESExpResult *
-do_colour (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
-{
- struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
-
- d(fprintf (stderr, "setting colour tag\n"));
- if (argc > 0 && argv[0]->type == ESEXP_RES_STRING) {
- if (p->source && p->uid && camel_folder_has_summary_capability (p->source))
- camel_folder_set_message_user_tag (p->source, p->uid, "colour", argv[0]->value.string);
- else
- camel_tag_set (&p->info->user_tags, "colour", argv[0]->value.string);
- camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Set colour to %s", argv[0]->value.string);
- }
-
- return NULL;
-}
-
-static ESExpResult *
-do_score (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
-{
- struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
-
- d(fprintf (stderr, "setting score tag\n"));
- if (argc > 0 && argv[0]->type == ESEXP_RES_INT) {
- char *value;
-
- value = g_strdup_printf ("%d", argv[0]->value.number);
- if (p->source && p->uid && camel_folder_has_summary_capability (p->source))
- camel_folder_set_message_user_tag (p->source, p->uid, "score", value);
- else
- camel_tag_set (&p->info->user_tags, "score", value);
- camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Set score to %d", argv[0]->value.number);
- g_free (value);
- }
-
- return NULL;
-}
-
-static ESExpResult *
-set_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
-{
- struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
- guint32 flags;
-
- d(fprintf (stderr, "setting flag\n"));
- if (argc == 1 && argv[0]->type == ESEXP_RES_STRING) {
- flags = camel_system_flag (argv[0]->value.string);
- if (p->source && p->uid && camel_folder_has_summary_capability (p->source))
- camel_folder_set_message_flags (p->source, p->uid, flags, ~0);
- else
- p->info->flags |= flags | CAMEL_MESSAGE_FOLDER_FLAGGED;
- camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Set %s flag", argv[0]->value.string);
- }
-
- return NULL;
-}
-
-static ESExpResult *
-unset_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
-{
- struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
- guint32 flags;
-
- d(fprintf (stderr, "unsetting flag\n"));
- if (argc == 1 && argv[0]->type == ESEXP_RES_STRING) {
- flags = camel_system_flag (argv[0]->value.string);
- if (p->source && p->uid && camel_folder_has_summary_capability (p->source))
- camel_folder_set_message_flags (p->source, p->uid, flags, 0);
- else
- p->info->flags = (p->info->flags & ~flags) | CAMEL_MESSAGE_FOLDER_FLAGGED;
- camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Unset %s flag", argv[0]->value.string);
- }
-
- return NULL;
-}
-
-static int
-pipe_to_system (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
-{
- struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
- int result, status, fds[4], i;
- CamelMimeMessage *message = NULL;
- CamelMimeParser *parser;
- CamelStream *stream, *mem;
- pid_t pid;
-
- if (argc < 1 || argv[0]->value.string[0] == '\0')
- return 0;
-
- /* make sure we have the message... */
- if (p->message == NULL) {
- if (!(p->message = camel_folder_get_message (p->source, p->uid, p->ex)))
- return -1;
- }
-
- for (i = 0; i < 4; i++)
- fds[i] = -1;
-
- for (i = 0; i < 4; i += 2) {
- if (pipe (fds + i) == -1) {
- camel_exception_setv (p->ex, CAMEL_EXCEPTION_SYSTEM,
- _("Failed to create pipe to '%s': %s"),
- argv[0]->value.string, g_strerror (errno));
-
- for (i = 0; i < 4; i++) {
- if (fds[i] == -1)
- break;
- close (fds[i]);
- }
-
- return -1;
- }
- }
-
- if (!(pid = fork ())) {
- /* child process */
- GPtrArray *args;
- int maxfd, fd;
-
- fd = open ("/dev/null", O_WRONLY);
-
- if (dup2 (fds[0], STDIN_FILENO) < 0 ||
- dup2 (fds[3], STDOUT_FILENO) < 0 ||
- dup2 (fd, STDERR_FILENO) < 0)
- _exit (255);
-
- setsid ();
-
- maxfd = sysconf (_SC_OPEN_MAX);
- for (fd = 3; fd < maxfd; fd++)
- fcntl (fd, F_SETFD, FD_CLOEXEC);
-
- args = g_ptr_array_new ();
- for (i = 0; i < argc; i++)
- g_ptr_array_add (args, argv[i]->value.string);
- g_ptr_array_add (args, NULL);
-
- execvp (argv[0]->value.string, (char **) args->pdata);
-
- g_ptr_array_free (args, TRUE);
-
- d(printf ("Could not execute %s: %s\n", argv[0]->value.string, g_strerror (errno)));
- _exit (255);
- } else if (pid < 0) {
- camel_exception_setv (p->ex, CAMEL_EXCEPTION_SYSTEM,
- _("Failed to create create child process '%s': %s"),
- argv[0]->value.string, g_strerror (errno));
- return -1;
- }
-
- /* parent process */
- close (fds[0]);
- close (fds[3]);
-
- stream = camel_stream_fs_new_with_fd (fds[1]);
- if (camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (p->message), stream) == -1) {
- camel_object_unref (stream);
- close (fds[2]);
- goto wait;
- }
-
- if (camel_stream_flush (stream) == -1) {
- camel_object_unref (stream);
- close (fds[2]);
- goto wait;
- }
-
- camel_object_unref (stream);
-
- stream = camel_stream_fs_new_with_fd (fds[2]);
- mem = camel_stream_mem_new ();
- if (camel_stream_write_to_stream (stream, mem) == -1) {
- camel_object_unref (stream);
- camel_object_unref (mem);
- goto wait;
- }
-
- camel_object_unref (stream);
- camel_stream_reset (mem);
-
- parser = camel_mime_parser_new ();
- camel_mime_parser_init_with_stream (parser, mem);
- camel_mime_parser_scan_from (parser, FALSE);
- camel_object_unref (mem);
-
- message = camel_mime_message_new ();
- if (camel_mime_part_construct_from_parser ((CamelMimePart *) message, parser) == -1) {
- camel_exception_setv (p->ex, CAMEL_EXCEPTION_SYSTEM,
- _("Invalid message stream received from %s: %s"),
- argv[0]->value.string,
- g_strerror (camel_mime_parser_errno (parser)));
- camel_object_unref (message);
- message = NULL;
- } else {
- camel_object_unref (p->message);
- p->message = message;
- p->modified = TRUE;
- }
-
- camel_object_unref (parser);
-
- wait:
-
- result = waitpid (pid, &status, 0);
-
- if (result == -1 && errno == EINTR) {
- /* child process is hanging... */
- kill (pid, SIGTERM);
- sleep (1);
- result = waitpid (pid, &status, WNOHANG);
- if (result == 0) {
- /* ...still hanging, set phasers to KILL */
- kill (pid, SIGKILL);
- sleep (1);
- result = waitpid (pid, &status, WNOHANG);
- }
- }
-
- if (message && result != -1 && WIFEXITED (status))
- return WEXITSTATUS (status);
- else
- return -1;
-}
-
-static ESExpResult *
-pipe_message (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
-{
- int i;
-
- /* make sure all args are strings */
- for (i = 0; i < argc; i++) {
- if (argv[i]->type != ESEXP_RES_STRING)
- return NULL;
- }
-
- camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Piping message to %s", argv[0]->value.string);
- pipe_to_system (f, argc, argv, driver);
-
- return NULL;
-}
-
-static ESExpResult *
-do_shell (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
-{
- struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
- GString *command;
- GPtrArray *args;
- int i;
-
- d(fprintf (stderr, "executing shell command\n"));
-
- command = g_string_new ("");
-
- args = g_ptr_array_new ();
-
- /* make sure all args are strings */
- for (i = 0; i < argc; i++) {
- if (argv[i]->type != ESEXP_RES_STRING)
- goto done;
-
- g_ptr_array_add (args, argv[i]->value.string);
-
- g_string_append (command, argv[i]->value.string);
- g_string_append_c (command, ' ');
- }
-
- g_string_truncate (command, command->len - 1);
-
- if (p->shellfunc && argc >= 1) {
- p->shellfunc (driver, argc, (char **) args->pdata, p->shelldata);
- camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Executing shell command: [%s]",
- command->str);
- }
-
- done:
-
- g_ptr_array_free (args, TRUE);
- g_string_free (command, TRUE);
-
- return NULL;
-}
-
-static ESExpResult *
-do_beep (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
-{
- struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
-
- d(fprintf (stderr, "beep\n"));
-
- if (p->beep) {
- p->beep (driver, p->beepdata);
- camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Beep");
- }
-
- return NULL;
-}
-
-static ESExpResult *
-play_sound (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
-{
- struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
-
- d(fprintf (stderr, "play sound\n"));
-
- if (p->playfunc && argc == 1 && argv[0]->type == ESEXP_RES_STRING) {
- p->playfunc (driver, argv[0]->value.string, p->playdata);
- camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Play sound");
- }
-
- return NULL;
-}
-
-static ESExpResult *
-do_only_once (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
-{
- struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
-
- d(fprintf (stderr, "only once\n"));
-
- if (argc == 2 && !g_hash_table_lookup (p->only_once, argv[0]->value.string))
- g_hash_table_insert (p->only_once, g_strdup (argv[0]->value.string),
- g_strdup (argv[1]->value.string));
-
- return NULL;
-}
-
-static CamelFolder *
-open_folder (CamelFilterDriver *driver, const char *folder_url)
-{
- struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
- CamelFolder *camelfolder;
- CamelException ex;
-
- /* we have a lookup table of currently open folders */
- camelfolder = g_hash_table_lookup (p->folders, folder_url);
- if (camelfolder)
- return camelfolder == FOLDER_INVALID?NULL:camelfolder;
-
- camel_exception_init (&ex);
- camelfolder = p->get_folder (driver, folder_url, p->data, &ex);
- camel_exception_clear (&ex);
-
- if (camelfolder) {
- g_hash_table_insert (p->folders, g_strdup (folder_url), camelfolder);
- camel_folder_freeze (camelfolder);
- } else {
- g_hash_table_insert (p->folders, g_strdup (folder_url), FOLDER_INVALID);
- }
-
- return camelfolder;
-}
-
-static void
-close_folder (void *key, void *value, void *data)
-{
- CamelFolder *folder = value;
- CamelFilterDriver *driver = data;
- struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
-
- p->closed++;
- g_free (key);
-
- if (folder != FOLDER_INVALID) {
- camel_folder_sync (folder, FALSE, p->ex);
- camel_folder_thaw (folder);
- camel_object_unref (folder);
- }
-
- report_status(driver, CAMEL_FILTER_STATUS_PROGRESS, g_hash_table_size(p->folders)* 100 / p->closed, _("Syncing folders"));
-}
-
-/* flush/close all folders */
-static int
-close_folders (CamelFilterDriver *driver)
-{
- struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
-
- report_status(driver, CAMEL_FILTER_STATUS_PROGRESS, 0, _("Syncing folders"));
-
- p->closed = 0;
- g_hash_table_foreach (p->folders, close_folder, driver);
- g_hash_table_destroy (p->folders);
- p->folders = g_hash_table_new (g_str_hash, g_str_equal);
-
- /* FIXME: status from driver */
- return 0;
-}
-
-#if 0
-static void
-free_key (gpointer key, gpointer value, gpointer user_data)
-{
- g_free (key);
-}
-#endif
-
-
-static void
-camel_filter_driver_log (CamelFilterDriver *driver, enum filter_log_t status, const char *desc, ...)
-{
- struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
-
- if (p->logfile) {
- char *str = NULL;
-
- if (desc) {
- va_list ap;
-
- va_start (ap, desc);
- str = g_strdup_vprintf (desc, ap);
- }
-
- switch (status) {
- case FILTER_LOG_START: {
- /* write log header */
- const char *subject = NULL;
- const char *from = NULL;
- char date[50];
- time_t t;
-
- /* FIXME: does this need locking? Probably */
-
- from = camel_message_info_from (p->info);
- subject = camel_message_info_subject (p->info);
-
- time (&t);
- strftime (date, 49, "%a, %d %b %Y %H:%M:%S", localtime (&t));
- fprintf (p->logfile, "Applied filter \"%s\" to message from %s - \"%s\" at %s\n",
- str, from ? from : "unknown", subject ? subject : "", date);
-
- break;
- }
- case FILTER_LOG_ACTION:
- fprintf (p->logfile, "Action: %s\n", str);
- break;
- case FILTER_LOG_END:
- fprintf (p->logfile, "\n");
- break;
- default:
- /* nothing else is loggable */
- break;
- }
-
- g_free (str);
- }
-}
-
-
-struct _run_only_once {
- CamelFilterDriver *driver;
- CamelException *ex;
-};
-
-static gboolean
-run_only_once (gpointer key, char *action, struct _run_only_once *data)
-{
- struct _CamelFilterDriverPrivate *p = _PRIVATE (data->driver);
- CamelException *ex = data->ex;
- ESExpResult *r;
-
- d(printf ("evaluating: %s\n\n", action));
-
- e_sexp_input_text (p->eval, action, strlen (action));
- if (e_sexp_parse (p->eval) == -1) {
- if (!camel_exception_is_set (ex))
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Error parsing filter: %s: %s"),
- e_sexp_error (p->eval), action);
- goto done;
- }
-
- r = e_sexp_eval (p->eval);
- if (r == NULL) {
- if (!camel_exception_is_set (ex))
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Error executing filter: %s: %s"),
- e_sexp_error (p->eval), action);
- goto done;
- }
-
- e_sexp_result_free (p->eval, r);
-
- done:
-
- g_free (key);
- g_free (action);
-
- return TRUE;
-}
-
-
-/**
- * camel_filter_driver_flush:
- * @driver:
- * @ex:
- *
- * Flush all of the only-once filter actions.
- **/
-void
-camel_filter_driver_flush (CamelFilterDriver *driver, CamelException *ex)
-{
- struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
- struct _run_only_once data;
-
- if (!p->only_once)
- return;
-
- data.driver = driver;
- data.ex = ex;
-
- g_hash_table_foreach_remove (p->only_once, (GHRFunc) run_only_once, &data);
-}
-
-/**
- * camel_filter_driver_filter_mbox:
- * @driver: CamelFilterDriver
- * @mbox: mbox filename to be filtered
- * @ex: exception
- *
- * Filters an mbox file based on rules defined in the FilterDriver
- * object. Is more efficient as it doesn't need to open the folder
- * through Camel directly.
- *
- * Returns -1 if errors were encountered during filtering,
- * otherwise returns 0.
- *
- **/
-int
-camel_filter_driver_filter_mbox (CamelFilterDriver *driver, const char *mbox, const char *original_source_url, CamelException *ex)
-{
- struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
- CamelMimeParser *mp = NULL;
- char *source_url = NULL;
- int fd = -1;
- int i = 0;
- struct stat st;
- int status;
- off_t last = 0;
- int ret = -1;
-
- fd = open (mbox, O_RDONLY);
- if (fd == -1) {
- camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, _("Unable to open spool folder"));
- goto fail;
- }
- /* to get the filesize */
- fstat (fd, &st);
-
- mp = camel_mime_parser_new ();
- camel_mime_parser_scan_from (mp, TRUE);
- if (camel_mime_parser_init_with_fd (mp, fd) == -1) {
- camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, _("Unable to process spool folder"));
- goto fail;
- }
- fd = -1;
-
- source_url = g_strdup_printf ("file://%s", mbox);
-
- while (camel_mime_parser_step (mp, 0, 0) == CAMEL_MIME_PARSER_STATE_FROM) {
- CamelMessageInfo *info;
- CamelMimeMessage *msg;
- int pc = 0;
-
- if (st.st_size > 0)
- pc = (int)(100.0 * ((double)camel_mime_parser_tell (mp) / (double)st.st_size));
-
- report_status (driver, CAMEL_FILTER_STATUS_START, pc, _("Getting message %d (%d%%)"), i, pc);
-
- msg = camel_mime_message_new ();
- if (camel_mime_part_construct_from_parser (CAMEL_MIME_PART (msg), mp) == -1) {
- camel_exception_set (ex, (errno==EINTR)?CAMEL_EXCEPTION_USER_CANCEL:CAMEL_EXCEPTION_SYSTEM, _("Cannot open message"));
- report_status (driver, CAMEL_FILTER_STATUS_END, 100, _("Failed on message %d"), i);
- camel_object_unref (msg);
- goto fail;
- }
-
- info = camel_message_info_new_from_header(((CamelMimePart *)msg)->headers);
- info->size = camel_mime_parser_tell(mp) - last;
- last = camel_mime_parser_tell(mp);
- status = camel_filter_driver_filter_message (driver, msg, info, NULL, NULL, source_url,
- original_source_url ? original_source_url : source_url, ex);
- camel_object_unref (msg);
- if (camel_exception_is_set (ex) || status == -1) {
- report_status (driver, CAMEL_FILTER_STATUS_END, 100, _("Failed on message %d"), i);
- camel_message_info_free (info);
- goto fail;
- }
-
- i++;
-
- /* skip over the FROM_END state */
- camel_mime_parser_step (mp, 0, 0);
-
- camel_message_info_free (info);
- }
-
- if (p->defaultfolder) {
- report_status(driver, CAMEL_FILTER_STATUS_PROGRESS, 100, _("Syncing folder"));
- camel_folder_sync(p->defaultfolder, FALSE, camel_exception_is_set (ex) ? NULL : ex);
- }
-
- report_status (driver, CAMEL_FILTER_STATUS_END, 100, _("Complete"));
-
- ret = 0;
-fail:
- g_free (source_url);
- if (fd != -1)
- close (fd);
- if (mp)
- camel_object_unref (mp);
-
- return -1;
-}
-
-
-/**
- * camel_filter_driver_filter_folder:
- * @driver: CamelFilterDriver
- * @folder: CamelFolder to be filtered
- * @cache: UID cache (needed for POP folders)
- * @uids: message uids to be filtered or NULL (as a shortcut to filter all messages)
- * @remove: TRUE to mark filtered messages as deleted
- * @ex: exception
- *
- * Filters a folder based on rules defined in the FilterDriver
- * object.
- *
- * Returns -1 if errors were encountered during filtering,
- * otherwise returns 0.
- *
- **/
-int
-camel_filter_driver_filter_folder (CamelFilterDriver *driver, CamelFolder *folder, CamelUIDCache *cache,
- GPtrArray *uids, gboolean remove, CamelException *ex)
-{
- struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
- gboolean freeuids = FALSE;
- CamelMessageInfo *info;
- char *source_url, *service_url;
- int status = 0;
- CamelURL *url;
- int i;
-
- service_url = camel_service_get_url (CAMEL_SERVICE (camel_folder_get_parent_store (folder)));
- url = camel_url_new (service_url, NULL);
- g_free (service_url);
-
- source_url = camel_url_to_string (url, CAMEL_URL_HIDE_ALL);
- camel_url_free (url);
-
- if (uids == NULL) {
- uids = camel_folder_get_uids (folder);
- freeuids = TRUE;
- }
-
- for (i = 0; i < uids->len; i++) {
- int pc = (100 * i)/uids->len;
-
- report_status (driver, CAMEL_FILTER_STATUS_START, pc, _("Getting message %d of %d"), i+1,
- uids->len);
-
- if (camel_folder_has_summary_capability (folder))
- info = camel_folder_get_message_info (folder, uids->pdata[i]);
- else
- info = NULL;
-
- status = camel_filter_driver_filter_message (driver, NULL, info, uids->pdata[i],
- folder, source_url, source_url, ex);
-
- if (camel_folder_has_summary_capability (folder))
- camel_folder_free_message_info (folder, info);
-
- if (camel_exception_is_set (ex) || status == -1) {
- report_status (driver, CAMEL_FILTER_STATUS_END, 100, _("Failed at message %d of %d"),
- i+1, uids->len);
- status = -1;
- break;
- }
-
- if (remove)
- camel_folder_set_message_flags (folder, uids->pdata[i],
- CAMEL_MESSAGE_DELETED | CAMEL_MESSAGE_SEEN, ~0);
-
- if (cache)
- camel_uid_cache_save_uid (cache, uids->pdata[i]);
- }
-
- if (freeuids)
- camel_folder_free_uids (folder, uids);
-
- if (p->defaultfolder) {
- report_status (driver, CAMEL_FILTER_STATUS_PROGRESS, 100, _("Syncing folder"));
- camel_folder_sync (p->defaultfolder, FALSE, camel_exception_is_set (ex) ? NULL : ex);
- }
-
- if (i == uids->len)
- report_status (driver, CAMEL_FILTER_STATUS_END, 100, _("Complete"));
-
- g_free (source_url);
-
- return status;
-}
-
-
-struct _get_message {
- struct _CamelFilterDriverPrivate *p;
- const char *source_url;
-};
-
-
-static CamelMimeMessage *
-get_message_cb (void *data, CamelException *ex)
-{
- struct _get_message *msgdata = data;
- struct _CamelFilterDriverPrivate *p = msgdata->p;
- const char *source_url = msgdata->source_url;
- CamelMimeMessage *message;
-
- if (p->message) {
- message = p->message;
- camel_object_ref (message);
- } else {
- const char *uid;
-
- if (p->uid)
- uid = p->uid;
- else
- uid = camel_message_info_uid (p->info);
-
- message = camel_folder_get_message (p->source, uid, ex);
- }
-
- if (source_url && message && camel_mime_message_get_source (message) == NULL)
- camel_mime_message_set_source (message, source_url);
-
- return message;
-}
-
-/**
- * camel_filter_driver_filter_message:
- * @driver: CamelFilterDriver
- * @message: message to filter or NULL
- * @info: message info or NULL
- * @uid: message uid or NULL
- * @source: source folder or NULL
- * @source_url: url of source folder or NULL
- * @original_source_url: url of original source folder (pre-movemail) or NULL
- * @ex: exception
- *
- * Filters a message based on rules defined in the FilterDriver
- * object. If the source folder (@source) and the uid (@uid) are
- * provided, the filter will operate on the CamelFolder (which in
- * certain cases is more efficient than using the default
- * camel_folder_append_message() function).
- *
- * Returns -1 if errors were encountered during filtering,
- * otherwise returns 0.
- *
- **/
-int
-camel_filter_driver_filter_message (CamelFilterDriver *driver, CamelMimeMessage *message,
- CamelMessageInfo *info, const char *uid,
- CamelFolder *source, const char *source_url,
- const char *original_source_url,
- CamelException *ex)
-{
- struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
- struct _filter_rule *node;
- gboolean freeinfo = FALSE;
- gboolean filtered = FALSE;
- ESExpResult *r;
- int result;
-
- /* FIXME: make me into a g_return_if_fail/g_assert or whatever... */
- if (message == NULL && (source == NULL || uid == NULL)) {
- g_warning ("there is no way to fetch the message using the information provided...");
- return -1;
- }
-
- if (info == NULL) {
- struct _camel_header_raw *h;
-
- if (message) {
- camel_object_ref (message);
- } else {
- message = camel_folder_get_message (source, uid, ex);
- if (!message)
- return -1;
- }
-
- h = CAMEL_MIME_PART (message)->headers;
- info = camel_message_info_new_from_header (h);
- freeinfo = TRUE;
- } else {
- if (info->flags & CAMEL_MESSAGE_DELETED)
- return 0;
-
- uid = camel_message_info_uid (info);
-
- if (message)
- camel_object_ref (message);
- }
-
- p->ex = ex;
- p->terminated = FALSE;
- p->deleted = FALSE;
- p->copied = FALSE;
- p->message = message;
- p->info = info;
- p->uid = uid;
- p->source = source;
-
- if (message && original_source_url && camel_mime_message_get_source (message) == NULL)
- camel_mime_message_set_source (message, original_source_url);
-
- node = (struct _filter_rule *) p->rules.head;
- result = CAMEL_SEARCH_NOMATCH;
- while (node->next && !p->terminated) {
- struct _get_message data;
-
- d(fprintf (stderr, "applying rule %s\naction %s\n", node->match, node->action));
-
- data.p = p;
- data.source_url = original_source_url;
-
- result = camel_filter_search_match (p->session, get_message_cb, &data, p->info,
- original_source_url ? original_source_url : source_url,
- node->match, p->ex);
-
- switch (result) {
- case CAMEL_SEARCH_ERROR:
- goto error;
- case CAMEL_SEARCH_MATCHED:
- filtered = TRUE;
- camel_filter_driver_log (driver, FILTER_LOG_START, node->name);
-
- /* perform necessary filtering actions */
- e_sexp_input_text (p->eval, node->action, strlen (node->action));
- if (e_sexp_parse (p->eval) == -1) {
- camel_exception_setv (ex, 1, _("Error parsing filter: %s: %s"),
- e_sexp_error (p->eval), node->action);
- goto error;
- }
- r = e_sexp_eval (p->eval);
- if (r == NULL) {
- camel_exception_setv (ex, 1, _("Error executing filter: %s: %s"),
- e_sexp_error (p->eval), node->action);
- goto error;
- }
- e_sexp_result_free (p->eval, r);
- default:
- break;
- }
-
- node = node->next;
- }
-
- /* *Now* we can set the DELETED flag... */
- if (p->deleted) {
- if (p->source && p->uid && camel_folder_has_summary_capability (p->source))
- camel_folder_set_message_flags(p->source, p->uid, CAMEL_MESSAGE_DELETED|CAMEL_MESSAGE_SEEN, ~0);
- else
- info->flags |= CAMEL_MESSAGE_DELETED|CAMEL_MESSAGE_SEEN|CAMEL_MESSAGE_FOLDER_FLAGGED;
- }
-
- /* Logic: if !Moved and there exists a default folder... */
- if (!(p->copied && p->deleted) && p->defaultfolder) {
- /* copy it to the default inbox */
- filtered = TRUE;
- camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Copy to default folder");
- if (!p->modified && p->uid && p->source && camel_folder_has_summary_capability (p->source)) {
- GPtrArray *uids;
-
- uids = g_ptr_array_new ();
- g_ptr_array_add (uids, (char *) p->uid);
- camel_folder_transfer_messages_to (p->source, uids, p->defaultfolder, NULL, FALSE, p->ex);
- g_ptr_array_free (uids, TRUE);
- } else {
- if (p->message == NULL) {
- p->message = camel_folder_get_message (source, uid, ex);
- if (!p->message)
- goto error;
- }
-
- camel_folder_append_message (p->defaultfolder, p->message, p->info, NULL, p->ex);
- }
- }
-
- if (p->message)
- camel_object_unref (p->message);
-
- if (freeinfo)
- camel_message_info_free (info);
-
- return 0;
-
- error:
- if (filtered)
- camel_filter_driver_log (driver, FILTER_LOG_END, NULL);
-
- if (p->message)
- camel_object_unref (p->message);
-
- if (freeinfo)
- camel_message_info_free (info);
-
- return -1;
-}
diff --git a/camel/camel-filter-driver.h b/camel/camel-filter-driver.h
deleted file mode 100644
index 8295859cb0..0000000000
--- a/camel/camel-filter-driver.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- * Jeffrey Stedfast <fejj@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef _CAMEL_FILTER_DRIVER_H
-#define _CAMEL_FILTER_DRIVER_H
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <glib.h>
-#include <camel/camel-object.h>
-#include <camel/camel-session.h>
-#include <camel/camel-folder.h>
-#include <camel/camel-uid-cache.h>
-
-#define CAMEL_FILTER_DRIVER_TYPE (camel_filter_driver_get_type ())
-#define CAMEL_FILTER_DRIVER(obj) CAMEL_CHECK_CAST (obj, CAMEL_FILTER_DRIVER_TYPE, CamelFilterDriver)
-#define CAMEL_FILTER_DRIVER_CLASS(klass) CAMEL__CHECK_CLASS_CAST (klass, CAMEL_FILTER_DRIVER_TYPE, CamelFilterDriverClass)
-#define CAMEL_IS_FILTER_DRIVER(obj) CAMEL_CHECK_TYPE (obj, CAMEL_FILTER_DRIVER_TYPE)
-
-typedef struct _CamelFilterDriverClass CamelFilterDriverClass;
-
-struct _CamelFilterDriver {
- CamelObject parent;
-
- struct _CamelFilterDriverPrivate *priv;
-};
-
-struct _CamelFilterDriverClass {
- CamelObjectClass parent_class;
-};
-
-/* FIXME: this maybe should change... */
-/* type of status for a status report */
-enum camel_filter_status_t {
- CAMEL_FILTER_STATUS_NONE,
- CAMEL_FILTER_STATUS_START, /* start of new message processed */
- CAMEL_FILTER_STATUS_ACTION, /* an action performed */
- CAMEL_FILTER_STATUS_PROGRESS, /* (an) extra update(s), if its taking longer to process */
- CAMEL_FILTER_STATUS_END, /* end of message */
-};
-
-typedef CamelFolder * (*CamelFilterGetFolderFunc) (CamelFilterDriver *driver, const char *uri,
- void *data, CamelException *ex);
-/* report status */
-typedef void (CamelFilterStatusFunc) (CamelFilterDriver *driver, enum camel_filter_status_t status,
- int pc, const char *desc, void *data);
-
-typedef void (CamelFilterShellFunc) (CamelFilterDriver *driver, int argc, char **argv, void *data);
-typedef void (CamelFilterPlaySoundFunc) (CamelFilterDriver *driver, const char *filename, void *data);
-typedef void (CamelFilterSystemBeepFunc) (CamelFilterDriver *driver, void *data);
-
-CamelType camel_filter_driver_get_type (void);
-CamelFilterDriver *camel_filter_driver_new (CamelSession *);
-
-/* modifiers */
-void camel_filter_driver_set_logfile (CamelFilterDriver *d, FILE *logfile);
-
-void camel_filter_driver_set_status_func (CamelFilterDriver *d, CamelFilterStatusFunc *func, void *data);
-void camel_filter_driver_set_shell_func (CamelFilterDriver *d, CamelFilterShellFunc *func, void *data);
-void camel_filter_driver_set_play_sound_func (CamelFilterDriver *d, CamelFilterPlaySoundFunc *func, void *data);
-void camel_filter_driver_set_system_beep_func (CamelFilterDriver *d, CamelFilterSystemBeepFunc *func, void *data);
-void camel_filter_driver_set_folder_func (CamelFilterDriver *d, CamelFilterGetFolderFunc fetcher, void *data);
-
-void camel_filter_driver_set_default_folder (CamelFilterDriver *d, CamelFolder *def);
-
-void camel_filter_driver_add_rule (CamelFilterDriver *d, const char *name, const char *match,
- const char *action);
-int camel_filter_driver_remove_rule_by_name (CamelFilterDriver *d, const char *name);
-
-/*void camel_filter_driver_set_global(CamelFilterDriver *, const char *name, const char *value);*/
-
-void camel_filter_driver_flush (CamelFilterDriver *driver, CamelException *ex);
-
-int camel_filter_driver_filter_message (CamelFilterDriver *driver, CamelMimeMessage *message,
- CamelMessageInfo *info, const char *uri,
- CamelFolder *source, const char *source_url,
- const char *original_source_url, CamelException *ex);
-
-int camel_filter_driver_filter_mbox (CamelFilterDriver *driver, const char *mbox,
- const char *original_source_url, CamelException *ex);
-
-int camel_filter_driver_filter_folder (CamelFilterDriver *driver, CamelFolder *folder, CamelUIDCache *cache,
- GPtrArray *uids, gboolean remove, CamelException *ex);
-
-#if 0
-/* generate the search query/action string for a filter option */
-void camel_filter_driver_expand_option (CamelFilterDriver *d, GString *s, GString *action, struct filter_option *op);
-
-/* get info about rules (options) */
-int camel_filter_driver_rule_count (CamelFilterDriver *d);
-struct filter_option *camel_filter_driver_rule_get (CamelFilterDriver *d, int n);
-#endif
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* ! _CAMEL_FILTER_DRIVER_H */
diff --git a/camel/camel-filter-search.c b/camel/camel-filter-search.c
deleted file mode 100644
index 53fe074b10..0000000000
--- a/camel/camel-filter-search.c
+++ /dev/null
@@ -1,703 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- * Michael Zucchi <NotZed@Ximian.com>
- *
- * Copyright 2000 Ximian, Inc. (www.ximian.com)
- * Copyright 2001 Ximian Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-/* (from glibc headers:
- POSIX says that <sys/types.h> must be included (by the caller) before <regex.h>. */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <regex.h>
-#include <string.h>
-#include <unistd.h>
-#include <ctype.h>
-#include <fcntl.h>
-#include <errno.h>
-
-#include <signal.h>
-#include <sys/wait.h>
-
-#include <e-util/e-sexp.h>
-
-#include <gal/util/e-iconv.h>
-
-#include "camel-mime-message.h"
-#include "camel-provider.h"
-#include "camel-session.h"
-#include "camel-filter-search.h"
-#include "camel-exception.h"
-#include "camel-multipart.h"
-#include "camel-stream-mem.h"
-#include "camel-stream-fs.h"
-#include "camel-search-private.h"
-
-#include "camel-url.h"
-
-#define d(x)
-
-typedef struct {
- CamelSession *session;
- CamelFilterSearchGetMessageFunc get_message;
- void *get_message_data;
- CamelMimeMessage *message;
- CamelMessageInfo *info;
- const char *source;
- CamelException *ex;
-} FilterMessageSearch;
-
-/* ESExp callbacks */
-static ESExpResult *header_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
-static ESExpResult *header_matches (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
-static ESExpResult *header_starts_with (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
-static ESExpResult *header_ends_with (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
-static ESExpResult *header_exists (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
-static ESExpResult *header_soundex (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
-static ESExpResult *header_regex (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
-static ESExpResult *header_full_regex (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
-static ESExpResult *match_all (struct _ESExp *f, int argc, struct _ESExpTerm **argv, FilterMessageSearch *fms);
-static ESExpResult *body_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
-static ESExpResult *body_regex (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
-static ESExpResult *user_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
-static ESExpResult *user_tag (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
-static ESExpResult *system_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
-static ESExpResult *get_sent_date (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
-static ESExpResult *get_received_date (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
-static ESExpResult *get_current_date (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
-static ESExpResult *header_source (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
-static ESExpResult *get_size (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
-static ESExpResult *pipe_message (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
-static ESExpResult *junk_test (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
-
-/* builtin functions */
-static struct {
- char *name;
- ESExpFunc *func;
- int type; /* set to 1 if a function can perform shortcut evaluation, or
- doesn't execute everything, 0 otherwise */
-} symbols[] = {
- { "match-all", (ESExpFunc *) match_all, 1 },
- { "body-contains", (ESExpFunc *) body_contains, 0 },
- { "body-regex", (ESExpFunc *) body_regex, 0 },
- { "header-contains", (ESExpFunc *) header_contains, 0 },
- { "header-matches", (ESExpFunc *) header_matches, 0 },
- { "header-starts-with", (ESExpFunc *) header_starts_with, 0 },
- { "header-ends-with", (ESExpFunc *) header_ends_with, 0 },
- { "header-exists", (ESExpFunc *) header_exists, 0 },
- { "header-soundex", (ESExpFunc *) header_soundex, 0 },
- { "header-regex", (ESExpFunc *) header_regex, 0 },
- { "header-full-regex", (ESExpFunc *) header_full_regex, 0 },
- { "user-tag", (ESExpFunc *) user_tag, 0 },
- { "user-flag", (ESExpFunc *) user_flag, 0 },
- { "system-flag", (ESExpFunc *) system_flag, 0 },
- { "get-sent-date", (ESExpFunc *) get_sent_date, 0 },
- { "get-received-date", (ESExpFunc *) get_received_date, 0 },
- { "get-current-date", (ESExpFunc *) get_current_date, 0 },
- { "header-source", (ESExpFunc *) header_source, 0 },
- { "get-size", (ESExpFunc *) get_size, 0 },
- { "pipe-message", (ESExpFunc *) pipe_message, 0 },
- { "junk-test", (ESExpFunc *) junk_test, 0 },
-};
-
-
-static CamelMimeMessage *
-camel_filter_search_get_message (FilterMessageSearch *fms, struct _ESExp *sexp)
-{
- if (fms->message)
- return fms->message;
-
- fms->message = fms->get_message (fms->get_message_data, fms->ex);
-
- if (fms->message == NULL)
- e_sexp_fatal_error (sexp, _("Failed to retrieve message"));
-
- return fms->message;
-}
-
-static ESExpResult *
-check_header (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms, camel_search_match_t how)
-{
- gboolean matched = FALSE;
- ESExpResult *r;
- int i;
-
- if (argc > 1 && argv[0]->type == ESEXP_RES_STRING) {
- char *name = argv[0]->value.string;
- const char *header;
- camel_search_t type = CAMEL_SEARCH_TYPE_ENCODED;
- CamelContentType *ct;
- const char *charset = NULL;
-
- if (strcasecmp(name, "x-camel-mlist") == 0) {
- header = camel_message_info_mlist(fms->info);
- type = CAMEL_SEARCH_TYPE_MLIST;
- } else {
- CamelMimeMessage *message = camel_filter_search_get_message (fms, f);
-
- header = camel_medium_get_header (CAMEL_MEDIUM (message), argv[0]->value.string);
- /* FIXME: what about Resent-To, Resent-Cc and Resent-From? */
- if (strcasecmp("to", name) == 0 || strcasecmp("cc", name) == 0 || strcasecmp("from", name) == 0)
- type = CAMEL_SEARCH_TYPE_ADDRESS_ENCODED;
- else {
- ct = camel_mime_part_get_content_type (CAMEL_MIME_PART (message));
- if (ct) {
- charset = camel_content_type_param (ct, "charset");
- charset = e_iconv_charset_name (charset);
- }
- }
- }
-
- if (header) {
- for (i=1; i<argc && !matched; i++) {
- if (argv[i]->type == ESEXP_RES_STRING)
- matched = camel_search_header_match(header, argv[i]->value.string, how, type, charset);
- }
- }
- }
-
- r = e_sexp_result_new (f, ESEXP_RES_BOOL);
- r->value.bool = matched;
-
- return r;
-}
-
-static ESExpResult *
-header_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
-{
- return check_header (f, argc, argv, fms, CAMEL_SEARCH_MATCH_CONTAINS);
-}
-
-
-static ESExpResult *
-header_matches (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
-{
- return check_header (f, argc, argv, fms, CAMEL_SEARCH_MATCH_EXACT);
-}
-
-static ESExpResult *
-header_starts_with (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
-{
- return check_header (f, argc, argv, fms, CAMEL_SEARCH_MATCH_STARTS);
-}
-
-static ESExpResult *
-header_ends_with (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
-{
- return check_header (f, argc, argv, fms, CAMEL_SEARCH_MATCH_ENDS);
-}
-
-static ESExpResult *
-header_soundex (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
-{
- return check_header (f, argc, argv, fms, CAMEL_SEARCH_MATCH_SOUNDEX);
-}
-
-static ESExpResult *
-header_exists (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
-{
- CamelMimeMessage *message;
- gboolean matched = FALSE;
- ESExpResult *r;
- int i;
-
- message = camel_filter_search_get_message (fms, f);
-
- for (i = 0; i < argc && !matched; i++) {
- if (argv[i]->type == ESEXP_RES_STRING)
- matched = camel_medium_get_header (CAMEL_MEDIUM (message), argv[i]->value.string) != NULL;
- }
-
- r = e_sexp_result_new (f, ESEXP_RES_BOOL);
- r->value.bool = matched;
-
- return r;
-}
-
-static ESExpResult *
-header_regex (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
-{
- ESExpResult *r = e_sexp_result_new (f, ESEXP_RES_BOOL);
- CamelMimeMessage *message;
- regex_t pattern;
- const char *contents;
-
- message = camel_filter_search_get_message (fms, f);
-
- if (argc > 1 && argv[0]->type == ESEXP_RES_STRING
- && (contents = camel_medium_get_header (CAMEL_MEDIUM (message), argv[0]->value.string))
- && camel_search_build_match_regex(&pattern, CAMEL_SEARCH_MATCH_REGEX|CAMEL_SEARCH_MATCH_ICASE, argc-1, argv+1, fms->ex) == 0) {
- r->value.bool = regexec (&pattern, contents, 0, NULL, 0) == 0;
- regfree (&pattern);
- } else
- r->value.bool = FALSE;
-
- return r;
-}
-
-static gchar *
-get_full_header (CamelMimeMessage *message)
-{
- CamelMimePart *mp = CAMEL_MIME_PART (message);
- GString *str = g_string_new ("");
- char *ret;
- struct _camel_header_raw *h;
-
- for (h = mp->headers; h; h = h->next) {
- if (h->value != NULL) {
- g_string_append (str, h->name);
- if (isspace (h->value[0]))
- g_string_append (str, ":");
- else
- g_string_append (str, ": ");
- g_string_append (str, h->value);
- g_string_append_c(str, '\n');
- }
- }
-
- ret = str->str;
- g_string_free (str, FALSE);
-
- return ret;
-}
-
-static ESExpResult *
-header_full_regex (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
-{
- ESExpResult *r = e_sexp_result_new (f, ESEXP_RES_BOOL);
- CamelMimeMessage *message;
- regex_t pattern;
- char *contents;
-
- if (camel_search_build_match_regex(&pattern, CAMEL_SEARCH_MATCH_REGEX|CAMEL_SEARCH_MATCH_ICASE|CAMEL_SEARCH_MATCH_NEWLINE,
- argc, argv, fms->ex) == 0) {
- message = camel_filter_search_get_message (fms, f);
- contents = get_full_header (message);
- r->value.bool = regexec (&pattern, contents, 0, NULL, 0) == 0;
- g_free (contents);
- regfree (&pattern);
- } else
- r->value.bool = FALSE;
-
- return r;
-}
-
-static ESExpResult *
-match_all (struct _ESExp *f, int argc, struct _ESExpTerm **argv, FilterMessageSearch *fms)
-{
- /* match-all: when dealing with single messages is a no-op */
- ESExpResult *r;
-
- if (argc > 0)
- return e_sexp_term_eval (f, argv[0]);
-
- r = e_sexp_result_new (f, ESEXP_RES_BOOL);
- r->value.bool = TRUE;
-
- return r;
-}
-
-static ESExpResult *
-body_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
-{
- ESExpResult *r = e_sexp_result_new (f, ESEXP_RES_BOOL);
- CamelMimeMessage *message;
- regex_t pattern;
-
- if (camel_search_build_match_regex (&pattern, CAMEL_SEARCH_MATCH_ICASE, argc, argv, fms->ex) == 0) {
- message = camel_filter_search_get_message (fms, f);
- r->value.bool = camel_search_message_body_contains ((CamelDataWrapper *) message, &pattern);
- regfree (&pattern);
- } else
- r->value.bool = FALSE;
-
- return r;
-}
-
-static ESExpResult *
-body_regex (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
-{
- ESExpResult *r = e_sexp_result_new(f, ESEXP_RES_BOOL);
- CamelMimeMessage *message;
- regex_t pattern;
-
- if (camel_search_build_match_regex(&pattern, CAMEL_SEARCH_MATCH_ICASE|CAMEL_SEARCH_MATCH_REGEX|CAMEL_SEARCH_MATCH_NEWLINE,
- argc, argv, fms->ex) == 0) {
- message = camel_filter_search_get_message (fms, f);
- r->value.bool = camel_search_message_body_contains ((CamelDataWrapper *) message, &pattern);
- regfree (&pattern);
- } else
- r->value.bool = FALSE;
-
- return r;
-}
-
-static ESExpResult *
-user_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
-{
- ESExpResult *r;
- gboolean truth = FALSE;
- int i;
-
- /* performs an OR of all words */
- for (i = 0; i < argc && !truth; i++) {
- if (argv[i]->type == ESEXP_RES_STRING
- && camel_flag_get (&fms->info->user_flags, argv[i]->value.string)) {
- truth = TRUE;
- break;
- }
- }
-
- r = e_sexp_result_new (f, ESEXP_RES_BOOL);
- r->value.bool = truth;
-
- return r;
-}
-
-static ESExpResult *
-system_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
-{
- ESExpResult *r;
-
- if (argc != 1 || argv[0]->type != ESEXP_RES_STRING)
- e_sexp_fatal_error(f, _("Invalid arguments to (system-flag)"));
-
- r = e_sexp_result_new (f, ESEXP_RES_BOOL);
- r->value.bool = camel_system_flag_get (fms->info->flags, argv[0]->value.string);
-
- return r;
-}
-
-static ESExpResult *
-user_tag (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
-{
- ESExpResult *r;
- const char *tag;
-
- if (argc != 1 || argv[0]->type != ESEXP_RES_STRING)
- e_sexp_fatal_error(f, _("Invalid arguments to (user-tag)"));
-
- tag = camel_tag_get (&fms->info->user_tags, argv[0]->value.string);
-
- r = e_sexp_result_new (f, ESEXP_RES_STRING);
- r->value.string = g_strdup (tag ? tag : "");
-
- return r;
-}
-
-static ESExpResult *
-get_sent_date (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
-{
- CamelMimeMessage *message;
- ESExpResult *r;
-
- message = camel_filter_search_get_message (fms, f);
- r = e_sexp_result_new (f, ESEXP_RES_INT);
- r->value.number = camel_mime_message_get_date (message, NULL);
-
- return r;
-}
-
-static ESExpResult *
-get_received_date (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
-{
- CamelMimeMessage *message;
- ESExpResult *r;
-
- message = camel_filter_search_get_message (fms, f);
- r = e_sexp_result_new (f, ESEXP_RES_INT);
- r->value.number = camel_mime_message_get_date_received (message, NULL);
-
- return r;
-}
-
-static ESExpResult *
-get_current_date (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
-{
- ESExpResult *r;
-
- r = e_sexp_result_new (f, ESEXP_RES_INT);
- r->value.number = time (NULL);
-
- return r;
-}
-
-static ESExpResult *
-header_source (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
-{
- CamelMimeMessage *message;
- ESExpResult *r;
- const char *src;
- int truth = FALSE, i;
- CamelProvider *provider;
- CamelURL *uria, *urib;
-
- if (fms->source) {
- src = fms->source;
- } else {
- message = camel_filter_search_get_message(fms, f);
- src = camel_mime_message_get_source(message);
- }
-
- if (src
- && (provider = camel_session_get_provider(fms->session, src, NULL))
- && provider->url_equal) {
- uria = camel_url_new(src, NULL);
- if (uria) {
- for (i=0;i<argc && !truth;i++) {
- if (argv[i]->type == ESEXP_RES_STRING
- && (urib = camel_url_new(argv[i]->value.string, NULL))) {
- truth = provider->url_equal(uria, urib);
- camel_url_free(urib);
- }
- }
- camel_url_free(uria);
- }
- }
-
- r = e_sexp_result_new(f, ESEXP_RES_BOOL);
- r->value.bool = truth;
-
- return r;
-}
-
-/* remember, the size comparisons are done at Kbytes */
-static ESExpResult *
-get_size (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
-{
- ESExpResult *r;
-
- r = e_sexp_result_new(f, ESEXP_RES_INT);
- r->value.number = fms->info->size / 1024;
-
- return r;
-}
-
-static int
-run_command (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
-{
- CamelMimeMessage *message;
- CamelStream *stream;
- int result, status;
- int in_fds[2];
- pid_t pid;
-
- if (argc < 1 || argv[0]->value.string[0] == '\0')
- return 0;
-
- if (pipe (in_fds) == -1) {
- camel_exception_setv (fms->ex, CAMEL_EXCEPTION_SYSTEM,
- _("Failed to create pipe to '%s': %s"),
- argv[0]->value.string, g_strerror (errno));
- return -1;
- }
-
- if (!(pid = fork ())) {
- /* child process */
- GPtrArray *args;
- int maxfd, fd, i;
-
- fd = open ("/dev/null", O_WRONLY);
-
- if (dup2 (in_fds[0], STDIN_FILENO) < 0 ||
- dup2 (fd, STDOUT_FILENO) < 0 ||
- dup2 (fd, STDERR_FILENO) < 0)
- _exit (255);
-
- setsid ();
-
- maxfd = sysconf (_SC_OPEN_MAX);
- for (fd = 3; fd < maxfd; fd++)
- fcntl (fd, F_SETFD, FD_CLOEXEC);
-
- args = g_ptr_array_new ();
- for (i = 0; i < argc; i++)
- g_ptr_array_add (args, argv[i]->value.string);
- g_ptr_array_add (args, NULL);
-
- execvp (argv[0]->value.string, (char **) args->pdata);
-
- g_ptr_array_free (args, TRUE);
-
- d(printf ("Could not execute %s: %s\n", argv[0]->value.string, g_strerror (errno)));
- _exit (255);
- } else if (pid < 0) {
- camel_exception_setv (fms->ex, CAMEL_EXCEPTION_SYSTEM,
- _("Failed to create create child process '%s': %s"),
- argv[0]->value.string, g_strerror (errno));
- return -1;
- }
-
- /* parent process */
- close (in_fds[0]);
-
- message = camel_filter_search_get_message (fms, f);
-
- stream = camel_stream_fs_new_with_fd (in_fds[1]);
- camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (message), stream);
- camel_stream_flush (stream);
- camel_object_unref (stream);
-
- result = waitpid (pid, &status, 0);
-
- if (result == -1 && errno == EINTR) {
- /* child process is hanging... */
- kill (pid, SIGTERM);
- sleep (1);
- result = waitpid (pid, &status, WNOHANG);
- if (result == 0) {
- /* ...still hanging, set phasers to KILL */
- kill (pid, SIGKILL);
- sleep (1);
- result = waitpid (pid, &status, WNOHANG);
- }
- }
-
- if (result != -1 && WIFEXITED (status))
- return WEXITSTATUS (status);
- else
- return -1;
-}
-
-static ESExpResult *
-pipe_message (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
-{
- ESExpResult *r;
- int retval, i;
-
- /* make sure all args are strings */
- for (i = 0; i < argc; i++) {
- if (argv[i]->type != ESEXP_RES_STRING) {
- retval = -1;
- goto done;
- }
- }
-
- retval = run_command (f, argc, argv, fms);
-
- done:
- r = e_sexp_result_new (f, ESEXP_RES_INT);
- r->value.number = retval;
-
- return r;
-}
-
-static ESExpResult *
-junk_test (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
-{
- ESExpResult *r;
- gboolean retval = FALSE;
-
- if (fms->session->junk_plugin != NULL) {
- retval = camel_junk_plugin_check_junk (fms->session->junk_plugin, camel_filter_search_get_message (fms, f));
-
- fprintf (stderr, "junk filter => %s\n", retval ? "*JUNK*" : "clean");
- }
- r = e_sexp_result_new (f, ESEXP_RES_BOOL);
- r->value.number = retval;
-
- return r;
-}
-
-
-/**
- * camel_filter_search_match:
- * @session:
- * @get_message: function to retrieve the message if necessary
- * @data: data for above
- * @info:
- * @source:
- * @expression:
- * @ex:
- *
- * Returns one of CAMEL_SEARCH_MATCHED, CAMEL_SEARCH_NOMATCH, or CAMEL_SEARCH_ERROR.
- **/
-int
-camel_filter_search_match (CamelSession *session,
- CamelFilterSearchGetMessageFunc get_message, void *data,
- CamelMessageInfo *info, const char *source,
- const char *expression, CamelException *ex)
-{
- FilterMessageSearch fms;
- ESExp *sexp;
- ESExpResult *result;
- gboolean retval;
- int i;
-
- fms.session = session;
- fms.get_message = get_message;
- fms.get_message_data = data;
- fms.message = NULL;
- fms.info = info;
- fms.source = source;
- fms.ex = ex;
-
- sexp = e_sexp_new ();
-
- for (i = 0; i < sizeof (symbols) / sizeof (symbols[0]); i++) {
- if (symbols[i].type == 1)
- e_sexp_add_ifunction (sexp, 0, symbols[i].name, (ESExpIFunc *)symbols[i].func, &fms);
- else
- e_sexp_add_function (sexp, 0, symbols[i].name, symbols[i].func, &fms);
- }
-
- e_sexp_input_text (sexp, expression, strlen (expression));
- if (e_sexp_parse (sexp) == -1) {
- if (!camel_exception_is_set (ex))
- camel_exception_setv (ex, 1, _("Error executing filter search: %s: %s"),
- e_sexp_error (sexp), expression);
- goto error;
- }
-
- result = e_sexp_eval (sexp);
- if (result == NULL) {
- if (!camel_exception_is_set (ex))
- camel_exception_setv (ex, 1, _("Error executing filter search: %s: %s"),
- e_sexp_error (sexp), expression);
- goto error;
- }
-
- if (result->type == ESEXP_RES_BOOL)
- retval = result->value.bool ? CAMEL_SEARCH_MATCHED : CAMEL_SEARCH_NOMATCH;
- else
- retval = CAMEL_SEARCH_NOMATCH;
-
- e_sexp_result_free (sexp, result);
- e_sexp_unref (sexp);
-
- if (fms.message)
- camel_object_unref (fms.message);
-
- return retval;
-
- error:
- if (fms.message)
- camel_object_unref (fms.message);
-
- e_sexp_unref (sexp);
-
- return CAMEL_SEARCH_ERROR;
-}
diff --git a/camel/camel-filter-search.h b/camel/camel-filter-search.h
deleted file mode 100644
index 51b988362f..0000000000
--- a/camel/camel-filter-search.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- * Michael Zucchi <NotZed@Ximian.com>
- *
- * Copyright 2000 Ximian, Inc. (www.ximian.com)
- * Copyright 2001 Ximian Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef CAMEL_FILTER_SEARCH_H
-#define CAMEL_FILTER_SEARCH_H
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <glib.h>
-#include <camel/camel-mime-message.h>
-#include <camel/camel-folder-summary.h>
-
-enum {
- CAMEL_SEARCH_ERROR = -1,
- CAMEL_SEARCH_NOMATCH = 0,
- CAMEL_SEARCH_MATCHED = 1,
-};
-
-typedef CamelMimeMessage * (*CamelFilterSearchGetMessageFunc) (void *data, CamelException *ex);
-
-int camel_filter_search_match (CamelSession *session,
- CamelFilterSearchGetMessageFunc get_message, void *data,
- CamelMessageInfo *info, const char *source,
- const char *expression, CamelException *ex);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* ! CAMEL_FILTER_SEARCH_H */
diff --git a/camel/camel-folder-search.c b/camel/camel-folder-search.c
deleted file mode 100644
index 8262ee3c3a..0000000000
--- a/camel/camel-folder-search.c
+++ /dev/null
@@ -1,1174 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2000-2003 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-/* This is a helper class for folders to implement the search function.
- It implements enough to do basic searches on folders that can provide
- an in-memory summary and a body index. */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <sys/types.h>
-#include <regex.h>
-
-#include <glib.h>
-
-#include "camel-folder-search.h"
-
-#include "camel-exception.h"
-#include "camel-medium.h"
-#include "camel-multipart.h"
-#include "camel-mime-message.h"
-#include "camel-stream-mem.h"
-#include "e-util/e-memory.h"
-#include "camel-search-private.h"
-
-#define d(x)
-#define r(x)
-
-struct _CamelFolderSearchPrivate {
- GHashTable *mempool_hash;
- CamelException *ex;
-};
-
-#define _PRIVATE(o) (((CamelFolderSearch *)(o))->priv)
-
-static ESExpResult *search_not(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search);
-
-static ESExpResult *search_header_contains(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search);
-static ESExpResult *search_header_matches(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search);
-static ESExpResult *search_header_starts_with(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search);
-static ESExpResult *search_header_ends_with(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search);
-static ESExpResult *search_header_exists(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search);
-static ESExpResult *search_match_all(struct _ESExp *f, int argc, struct _ESExpTerm **argv, CamelFolderSearch *search);
-static ESExpResult *search_body_contains(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search);
-static ESExpResult *search_user_flag(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
-static ESExpResult *search_user_tag(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
-static ESExpResult *search_system_flag(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
-static ESExpResult *search_get_sent_date(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
-static ESExpResult *search_get_received_date(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
-static ESExpResult *search_get_current_date(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
-static ESExpResult *search_get_size(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
-static ESExpResult *search_uid(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
-
-static ESExpResult *search_dummy(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search);
-
-static void camel_folder_search_class_init (CamelFolderSearchClass *klass);
-static void camel_folder_search_init (CamelFolderSearch *obj);
-static void camel_folder_search_finalize (CamelObject *obj);
-
-static CamelObjectClass *camel_folder_search_parent;
-
-static void
-camel_folder_search_class_init (CamelFolderSearchClass *klass)
-{
- camel_folder_search_parent = camel_type_get_global_classfuncs (camel_object_get_type ());
-
- klass->not = search_not;
-
- klass->match_all = search_match_all;
- klass->body_contains = search_body_contains;
- klass->header_contains = search_header_contains;
- klass->header_matches = search_header_matches;
- klass->header_starts_with = search_header_starts_with;
- klass->header_ends_with = search_header_ends_with;
- klass->header_exists = search_header_exists;
- klass->user_tag = search_user_tag;
- klass->user_flag = search_user_flag;
- klass->system_flag = search_system_flag;
- klass->get_sent_date = search_get_sent_date;
- klass->get_received_date = search_get_received_date;
- klass->get_current_date = search_get_current_date;
- klass->get_size = search_get_size;
- klass->uid = search_uid;
-}
-
-static void
-camel_folder_search_init (CamelFolderSearch *obj)
-{
- struct _CamelFolderSearchPrivate *p;
-
- p = _PRIVATE(obj) = g_malloc0(sizeof(*p));
-
- obj->sexp = e_sexp_new();
-
- /* use a hash of mempools to associate the returned uid lists with
- the backing mempool. yes pretty weird, but i didn't want to change
- the api just yet */
-
- p->mempool_hash = g_hash_table_new(0, 0);
-}
-
-static void
-free_mempool(void *key, void *value, void *data)
-{
- GPtrArray *uids = key;
- EMemPool *pool = value;
-
- g_warning("Search closed with outstanding result unfreed: %p", uids);
-
- g_ptr_array_free(uids, TRUE);
- e_mempool_destroy(pool);
-}
-
-static void
-camel_folder_search_finalize (CamelObject *obj)
-{
- CamelFolderSearch *search = (CamelFolderSearch *)obj;
- struct _CamelFolderSearchPrivate *p = _PRIVATE(obj);
-
- if (search->sexp)
- e_sexp_unref(search->sexp);
- if (search->summary_hash)
- g_hash_table_destroy(search->summary_hash);
-
- g_free(search->last_search);
- g_hash_table_foreach(p->mempool_hash, free_mempool, obj);
- g_hash_table_destroy(p->mempool_hash);
- g_free(p);
-}
-
-CamelType
-camel_folder_search_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_object_get_type (), "CamelFolderSearch",
- sizeof (CamelFolderSearch),
- sizeof (CamelFolderSearchClass),
- (CamelObjectClassInitFunc) camel_folder_search_class_init,
- NULL,
- (CamelObjectInitFunc) camel_folder_search_init,
- (CamelObjectFinalizeFunc) camel_folder_search_finalize);
- }
-
- return type;
-}
-
-#ifdef offsetof
-#define CAMEL_STRUCT_OFFSET(type, field) ((gint) offsetof (type, field))
-#else
-#define CAMEL_STRUCT_OFFSET(type, field) ((gint) ((gchar*) &((type *) 0)->field))
-#endif
-
-struct {
- char *name;
- int offset;
- int flags; /* 0x02 = immediate, 0x01 = always enter */
-} builtins[] = {
- /* these have default implementations in e-sexp */
- { "and", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, and), 2 },
- { "or", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, or), 2 },
- /* we need to override this one though to implement an 'array not' */
- { "not", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, not), 0 },
- { "<", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, lt), 2 },
- { ">", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, gt), 2 },
- { "=", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, eq), 2 },
-
- /* these we have to use our own default if there is none */
- /* they should all be defined in the language? so it parses, or should they not?? */
- { "match-all", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, match_all), 3 },
- { "body-contains", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, body_contains), 1 },
- { "header-contains", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, header_contains), 1 },
- { "header-matches", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, header_matches), 1 },
- { "header-starts-with", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, header_starts_with), 1 },
- { "header-ends-with", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, header_ends_with), 1 },
- { "header-exists", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, header_exists), 1 },
- { "user-tag", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, user_tag), 1 },
- { "user-flag", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, user_flag), 1 },
- { "system-flag", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, system_flag), 1 },
- { "get-sent-date", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, get_sent_date), 1 },
- { "get-received-date", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, get_received_date), 1 },
- { "get-current-date", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, get_current_date), 1 },
- { "get-size", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, get_size), 1 },
- { "uid", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, uid), 1 },
-};
-
-void
-camel_folder_search_construct (CamelFolderSearch *search)
-{
- int i;
- CamelFolderSearchClass *klass = (CamelFolderSearchClass *)CAMEL_OBJECT_GET_CLASS(search);
-
- for (i=0;i<sizeof(builtins)/sizeof(builtins[0]);i++) {
- void *func;
- /* c is sure messy sometimes */
- func = *((void **)(((char *)klass)+builtins[i].offset));
- if (func == NULL && builtins[i].flags&1) {
- g_warning("Search class doesn't implement '%s' method: %s", builtins[i].name, camel_type_to_name(CAMEL_OBJECT_GET_CLASS(search)));
- func = (void *)search_dummy;
- }
- if (func != NULL) {
- if (builtins[i].flags&2) {
- e_sexp_add_ifunction(search->sexp, 0, builtins[i].name, (ESExpIFunc *)func, search);
- } else {
- e_sexp_add_function(search->sexp, 0, builtins[i].name, (ESExpFunc *)func, search);
- }
- }
- }
-}
-
-/**
- * camel_folder_search_new:
- *
- * Create a new CamelFolderSearch object.
- *
- * A CamelFolderSearch is a subclassable, extensible s-exp
- * evaluator which enforces a particular set of s-expressions.
- * Particular methods may be overriden by an implementation to
- * implement a search for any sort of backend.
- *
- * Return value: A new CamelFolderSearch widget.
- **/
-CamelFolderSearch *
-camel_folder_search_new (void)
-{
- CamelFolderSearch *new = CAMEL_FOLDER_SEARCH (camel_object_new (camel_folder_search_get_type ()));
-
- camel_folder_search_construct(new);
- return new;
-}
-
-/**
- * camel_folder_search_set_folder:
- * @search:
- * @folder: A folder.
- *
- * Set the folder attribute of the search. This is currently unused, but
- * could be used to perform a slow-search when indexes and so forth are not
- * available. Or for use by subclasses.
- **/
-void
-camel_folder_search_set_folder(CamelFolderSearch *search, CamelFolder *folder)
-{
- search->folder = folder;
-}
-
-/**
- * camel_folder_search_set_summary:
- * @search:
- * @summary: An array of CamelMessageInfo pointers.
- *
- * Set the array of summary objects representing the span of the search.
- *
- * If this is not set, then a subclass must provide the functions
- * for searching headers and for the match-all operator.
- **/
-void
-camel_folder_search_set_summary(CamelFolderSearch *search, GPtrArray *summary)
-{
- int i;
-
- search->summary = summary;
- if (search->summary_hash)
- g_hash_table_destroy(search->summary_hash);
- search->summary_hash = g_hash_table_new(g_str_hash, g_str_equal);
- for (i=0;i<summary->len;i++)
- g_hash_table_insert(search->summary_hash, (char *)camel_message_info_uid(summary->pdata[i]), summary->pdata[i]);
-}
-
-/**
- * camel_folder_search_set_body_index:
- * @search:
- * @index:
- *
- * Set the index representing the contents of all messages
- * in this folder. If this is not set, then the folder implementation
- * should sub-class the CamelFolderSearch and provide its own
- * body-contains function.
- **/
-void
-camel_folder_search_set_body_index(CamelFolderSearch *search, CamelIndex *index)
-{
- if (search->body_index)
- camel_object_unref((CamelObject *)search->body_index);
- search->body_index = index;
- if (index)
- camel_object_ref((CamelObject *)index);
-}
-
-/**
- * camel_folder_search_execute_expression:
- * @search:
- * @expr:
- * @ex:
- *
- * Execute the search expression @expr, returning an array of
- * all matches as a GPtrArray of uid's of matching messages.
- *
- * Note that any settings such as set_body_index(), set_folder(),
- * and so on are reset to #NULL once the search has completed.
- *
- * TODO: The interface should probably return summary items instead
- * (since they are much more useful to any client).
- *
- * Return value: A GPtrArray of strings of all matching messages.
- * This must only be freed by camel_folder_search_free_result.
- **/
-GPtrArray *
-camel_folder_search_execute_expression(CamelFolderSearch *search, const char *expr, CamelException *ex)
-{
- ESExpResult *r;
- GPtrArray *matches;
- int i;
- GHashTable *results;
- EMemPool *pool;
- struct _CamelFolderSearchPrivate *p = _PRIVATE(search);
-
- p->ex = ex;
-
- /* only re-parse if the search has changed */
- if (search->last_search == NULL
- || strcmp(search->last_search, expr)) {
- e_sexp_input_text(search->sexp, expr, strlen(expr));
- if (e_sexp_parse(search->sexp) == -1) {
- camel_exception_setv(ex, 1, _("Cannot parse search expression: %s:\n%s"), e_sexp_error(search->sexp), expr);
- return NULL;
- }
-
- g_free(search->last_search);
- search->last_search = g_strdup(expr);
- }
- r = e_sexp_eval(search->sexp);
- if (r == NULL) {
- if (!camel_exception_is_set(ex))
- camel_exception_setv(ex, 1, _("Error executing search expression: %s:\n%s"), e_sexp_error(search->sexp), expr);
- return NULL;
- }
-
- matches = g_ptr_array_new();
-
- /* now create a folder summary to return?? */
- if (r->type == ESEXP_RES_ARRAY_PTR) {
- d(printf("got result ...\n"));
- /* we use a mempool to store the strings, packed in tight as possible, and freed together */
- /* because the strings are often short (like <8 bytes long), we would be wasting appx 50%
- of memory just storing the size tag that malloc assigns us and alignment padding, so this
- gets around that (and is faster to allocate and free as a bonus) */
- pool = e_mempool_new(512, 256, E_MEMPOOL_ALIGN_BYTE);
- if (search->summary) {
- /* reorder result in summary order */
- results = g_hash_table_new(g_str_hash, g_str_equal);
- for (i=0;i<r->value.ptrarray->len;i++) {
- d(printf("adding match: %s\n", (char *)g_ptr_array_index(r->value.ptrarray, i)));
- g_hash_table_insert(results, g_ptr_array_index(r->value.ptrarray, i), (void *)1);
- }
- for (i=0;i<search->summary->len;i++) {
- CamelMessageInfo *info = g_ptr_array_index(search->summary, i);
- char *uid = (char *)camel_message_info_uid(info);
- if (g_hash_table_lookup(results, uid)) {
- g_ptr_array_add(matches, e_mempool_strdup(pool, uid));
- }
- }
- g_hash_table_destroy(results);
- } else {
- for (i=0;i<r->value.ptrarray->len;i++) {
- d(printf("adding match: %s\n", (char *)g_ptr_array_index(r->value.ptrarray, i)));
- g_ptr_array_add(matches, e_mempool_strdup(pool, g_ptr_array_index(r->value.ptrarray, i)));
- }
- }
- /* instead of putting the mempool_hash in the structure, we keep the api clean by
- putting a reference to it in a hashtable. Lets us do some debugging and catch
- unfree'd results as well. */
- g_hash_table_insert(p->mempool_hash, matches, pool);
- } else {
- g_warning("Search returned an invalid result type");
- }
-
- e_sexp_result_free(search->sexp, r);
-
- search->folder = NULL;
- search->summary = NULL;
- search->current = NULL;
- search->body_index = NULL;
-
- return matches;
-}
-
-/**
- * camel_folder_search_match_expression:
- * @search:
- * @expr:
- * @info:
- * @ex:
- *
- * Returns #TRUE if the expression matches the specific message info @info.
- * Note that the folder and index may need to be set for body searches to
- * operate as well.
- *
- * Return value:
- **/
-gboolean
-camel_folder_search_match_expression(CamelFolderSearch *search, const char *expr, const CamelMessageInfo *info, CamelException *ex)
-{
- GPtrArray *uids;
- int ret = FALSE;
-
- search->current = (CamelMessageInfo *)info;
-
- uids = camel_folder_search_execute_expression(search, expr, ex);
- if (uids) {
- if (uids->len == 1)
- ret = TRUE;
- camel_folder_search_free_result(search, uids);
- }
- search->current = NULL;
-
- return ret;
-}
-
-void camel_folder_search_free_result(CamelFolderSearch *search, GPtrArray *result)
-{
- int i;
- struct _CamelFolderSearchPrivate *p = _PRIVATE(search);
- EMemPool *pool;
-
- pool = g_hash_table_lookup(p->mempool_hash, result);
- if (pool) {
- e_mempool_destroy(pool);
- g_hash_table_remove(p->mempool_hash, result);
- } else {
- for (i=0;i<result->len;i++)
- g_free(g_ptr_array_index(result, i));
- }
- g_ptr_array_free(result, TRUE);
-}
-
-
-
-
-/* dummy function, returns false always, or an empty match array */
-static ESExpResult *
-search_dummy(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search)
-{
- ESExpResult *r;
-
- if (search->current == NULL) {
- r = e_sexp_result_new(f, ESEXP_RES_BOOL);
- r->value.bool = FALSE;
- } else {
- r = e_sexp_result_new(f, ESEXP_RES_ARRAY_PTR);
- r->value.ptrarray = g_ptr_array_new();
- }
-
- return r;
-}
-
-/* impelemnt an 'array not', i.e. everything in the summary, not in the supplied array */
-static ESExpResult *
-search_not(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search)
-{
- ESExpResult *r;
- int i;
-
- if (argc>0) {
- if (argv[0]->type == ESEXP_RES_ARRAY_PTR) {
- GPtrArray *v = argv[0]->value.ptrarray;
- const char *uid;
-
- r = e_sexp_result_new(f, ESEXP_RES_ARRAY_PTR);
- r->value.ptrarray = g_ptr_array_new();
-
- /* not against a single message?*/
- if (search->current) {
- int found = FALSE;
-
- uid = camel_message_info_uid(search->current);
- for (i=0;!found && i<v->len;i++) {
- if (strcmp(uid, v->pdata[i]) == 0)
- found = TRUE;
- }
-
- if (!found)
- g_ptr_array_add(r->value.ptrarray, (char *)uid);
- } else if (search->summary == NULL) {
- g_warning("No summary set, 'not' against an array requires a summary");
- } else {
- /* 'not' against the whole summary */
- GHashTable *have = g_hash_table_new(g_str_hash, g_str_equal);
- char **s;
- CamelMessageInfo **m;
-
- s = (char **)v->pdata;
- for (i=0;i<v->len;i++)
- g_hash_table_insert(have, s[i], s[i]);
-
- v = search->summary;
- m = (CamelMessageInfo **)v->pdata;
- for (i=0;i<v->len;i++) {
- char *uid = (char *)camel_message_info_uid(m[i]);
-
- if (g_hash_table_lookup(have, uid) == NULL)
- g_ptr_array_add(r->value.ptrarray, uid);
- }
- g_hash_table_destroy(have);
- }
- } else {
- int res = TRUE;
-
- if (argv[0]->type == ESEXP_RES_BOOL)
- res = ! argv[0]->value.bool;
-
- r = e_sexp_result_new(f, ESEXP_RES_BOOL);
- r->value.bool = res;
- }
- } else {
- r = e_sexp_result_new(f, ESEXP_RES_BOOL);
- r->value.bool = TRUE;
- }
-
- return r;
-}
-
-static ESExpResult *
-search_match_all(struct _ESExp *f, int argc, struct _ESExpTerm **argv, CamelFolderSearch *search)
-{
- int i;
- ESExpResult *r, *r1;
-
- if (argc>1) {
- g_warning("match-all only takes a single argument, other arguments ignored");
- }
-
- /* we are only matching a single message? or already inside a match-all? */
- if (search->current) {
- d(printf("matching against 1 message: %s\n", camel_message_info_subject(search->current)));
-
- r = e_sexp_result_new(f, ESEXP_RES_BOOL);
- r->value.bool = FALSE;
-
- if (argc>0) {
- r1 = e_sexp_term_eval(f, argv[0]);
- if (r1->type == ESEXP_RES_BOOL) {
- r->value.bool = r1->value.bool;
- } else {
- g_warning("invalid syntax, matches require a single bool result");
- e_sexp_fatal_error(f, _("(match-all) requires a single bool result"));
- }
- e_sexp_result_free(f, r1);
- } else {
- r->value.bool = TRUE;
- }
- return r;
- }
-
- r = e_sexp_result_new(f, ESEXP_RES_ARRAY_PTR);
- r->value.ptrarray = g_ptr_array_new();
-
- if (search->summary == NULL) {
- /* TODO: make it work - e.g. use the folder and so forth for a slower search */
- g_warning("No summary supplied, match-all doesn't work with no summary");
- g_assert(0);
- return r;
- }
-
- /* TODO: Could make this a bit faster in the uncommon case (of match-everything) */
- for (i=0;i<search->summary->len;i++) {
- search->current = g_ptr_array_index(search->summary, i);
- if (argc>0) {
- r1 = e_sexp_term_eval(f, argv[0]);
- if (r1->type == ESEXP_RES_BOOL) {
- if (r1->value.bool)
- g_ptr_array_add(r->value.ptrarray, (char *)camel_message_info_uid(search->current));
- } else {
- g_warning("invalid syntax, matches require a single bool result");
- e_sexp_fatal_error(f, _("(match-all) requires a single bool result"));
- }
- e_sexp_result_free(f, r1);
- } else {
- g_ptr_array_add(r->value.ptrarray, (char *)camel_message_info_uid(search->current));
- }
- }
- search->current = NULL;
-
- return r;
-}
-
-static ESExpResult *
-check_header(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search, camel_search_match_t how)
-{
- ESExpResult *r;
- int truth = FALSE;
-
- r(printf("executing check-header %d\n", how));
-
- /* are we inside a match-all? */
- if (search->current && argc>1
- && argv[0]->type == ESEXP_RES_STRING) {
- char *headername;
- const char *header = NULL;
- char strbuf[32];
- int i, j;
- camel_search_t type = CAMEL_SEARCH_TYPE_ASIS;
- struct _camel_search_words *words;
-
- /* only a subset of headers are supported .. */
- headername = argv[0]->value.string;
- if (!strcasecmp(headername, "subject")) {
- header = camel_message_info_subject(search->current);
- } else if (!strcasecmp(headername, "date")) {
- /* FIXME: not a very useful form of the date */
- sprintf(strbuf, "%d", (int)search->current->date_sent);
- header = strbuf;
- } else if (!strcasecmp(headername, "from")) {
- header = camel_message_info_from(search->current);
- type = CAMEL_SEARCH_TYPE_ADDRESS;
- } else if (!strcasecmp(headername, "to")) {
- header = camel_message_info_to(search->current);
- type = CAMEL_SEARCH_TYPE_ADDRESS;
- } else if (!strcasecmp(headername, "cc")) {
- header = camel_message_info_cc(search->current);
- type = CAMEL_SEARCH_TYPE_ADDRESS;
- } else if (!strcasecmp(headername, "x-camel-mlist")) {
- header = camel_message_info_mlist(search->current);
- type = CAMEL_SEARCH_TYPE_MLIST;
- } else {
- e_sexp_resultv_free(f, argc, argv);
- e_sexp_fatal_error(f, _("Performing query on unknown header: %s"), headername);
- }
-
- if (header) {
- /* performs an OR of all words */
- for (i=1;i<argc && !truth;i++) {
- if (argv[i]->type == ESEXP_RES_STRING) {
- if (argv[i]->value.string[0] == 0) {
- truth = TRUE;
- } else if (how == CAMEL_SEARCH_MATCH_CONTAINS) {
- /* doesn't make sense to split words on anything but contains i.e. we can't have an ending match different words */
- words = camel_search_words_split(argv[i]->value.string);
- truth = TRUE;
- for (j=0;j<words->len && truth;j++) {
- truth = camel_search_header_match(header, words->words[j]->word, how, type, NULL);
- }
- camel_search_words_free(words);
- } else {
- truth = camel_search_header_match(header, argv[i]->value.string, how, type, NULL);
- }
- }
- }
- }
- }
- /* TODO: else, find all matches */
-
- r = e_sexp_result_new(f, ESEXP_RES_BOOL);
- r->value.bool = truth;
-
- return r;
-}
-
-static ESExpResult *
-search_header_contains(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search)
-{
- return check_header(f, argc, argv, search, CAMEL_SEARCH_MATCH_CONTAINS);
-}
-
-static ESExpResult *
-search_header_matches(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search)
-{
- return check_header(f, argc, argv, search, CAMEL_SEARCH_MATCH_EXACT);
-}
-
-static ESExpResult *
-search_header_starts_with (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search)
-{
- return check_header(f, argc, argv, search, CAMEL_SEARCH_MATCH_STARTS);
-}
-
-static ESExpResult *
-search_header_ends_with (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search)
-{
- return check_header(f, argc, argv, search, CAMEL_SEARCH_MATCH_ENDS);
-}
-
-static ESExpResult *
-search_header_exists (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search)
-{
- ESExpResult *r;
-
- r(printf ("executing header-exists\n"));
-
- if (search->current) {
- r = e_sexp_result_new(f, ESEXP_RES_BOOL);
- if (argc == 1 && argv[0]->type == ESEXP_RES_STRING)
- r->value.bool = camel_medium_get_header(CAMEL_MEDIUM(search->current), argv[0]->value.string) != NULL;
-
- } else {
- r = e_sexp_result_new(f, ESEXP_RES_ARRAY_PTR);
- r->value.ptrarray = g_ptr_array_new();
- }
-
- return r;
-}
-
-/* this is just to OR results together */
-struct _glib_sux_donkeys {
- int count;
- GPtrArray *uids;
-};
-
-/* or, store all unique values */
-static void
-g_lib_sux_htor(char *key, int value, struct _glib_sux_donkeys *fuckup)
-{
- g_ptr_array_add(fuckup->uids, key);
-}
-
-/* and, only store duplicates */
-static void
-g_lib_sux_htand(char *key, int value, struct _glib_sux_donkeys *fuckup)
-{
- if (value == fuckup->count)
- g_ptr_array_add(fuckup->uids, key);
-}
-
-static int
-match_message_index(CamelIndex *idx, const char *uid, const char *match, CamelException *ex)
-{
- CamelIndexCursor *wc, *nc;
- const char *word, *name;
- int truth = FALSE;
-
- wc = camel_index_words(idx);
- if (wc) {
- while (!truth && (word = camel_index_cursor_next(wc))) {
- if (camel_ustrstrcase(word,match) != NULL) {
- /* perf: could have the wc cursor return the name cursor */
- nc = camel_index_find(idx, word);
- if (nc) {
- while (!truth && (name = camel_index_cursor_next(nc)))
- truth = strcmp(name, uid) == 0;
- camel_object_unref((CamelObject *)nc);
- }
- }
- }
- camel_object_unref((CamelObject *)wc);
- }
-
- return truth;
-}
-
-/*
- "one two" "three" "four five"
-
- one and two
-or
- three
-or
- four and five
-*/
-
-/* returns messages which contain all words listed in words */
-static GPtrArray *
-match_words_index(CamelFolderSearch *search, struct _camel_search_words *words, CamelException *ex)
-{
- GPtrArray *result = g_ptr_array_new();
- GHashTable *ht = g_hash_table_new(g_str_hash, g_str_equal);
- struct _glib_sux_donkeys lambdafoo;
- CamelIndexCursor *wc, *nc;
- const char *word, *name;
- CamelMessageInfo *mi;
- int i;
-
- /* we can have a maximum of 32 words, as we use it as the AND mask */
-
- wc = camel_index_words(search->body_index);
- if (wc) {
- while ((word = camel_index_cursor_next(wc))) {
- for (i=0;i<words->len;i++) {
- if (camel_ustrstrcase(word, words->words[i]->word) != NULL) {
- /* perf: could have the wc cursor return the name cursor */
- nc = camel_index_find(search->body_index, word);
- if (nc) {
- while ((name = camel_index_cursor_next(nc))) {
- mi = g_hash_table_lookup(search->summary_hash, name);
- if (mi) {
- int mask;
- const char *uid = camel_message_info_uid(mi);
-
- mask = (GPOINTER_TO_INT(g_hash_table_lookup(ht, uid))) | (1<<i);
- g_hash_table_insert(ht, (char *)uid, GINT_TO_POINTER(mask));
- }
- }
- camel_object_unref((CamelObject *)nc);
- }
- }
- }
- }
- camel_object_unref((CamelObject *)wc);
-
- lambdafoo.uids = result;
- lambdafoo.count = (1<<words->len) - 1;
- g_hash_table_foreach(ht, (GHFunc)g_lib_sux_htand, &lambdafoo);
- g_hash_table_destroy(ht);
- }
-
- return result;
-}
-
-static gboolean
-match_words_1message (CamelDataWrapper *object, struct _camel_search_words *words, guint32 *mask)
-{
- CamelDataWrapper *containee;
- int truth = FALSE;
- int parts, i;
-
- containee = camel_medium_get_content_object (CAMEL_MEDIUM (object));
-
- if (containee == NULL)
- return FALSE;
-
- /* using the object types is more accurate than using the mime/types */
- if (CAMEL_IS_MULTIPART (containee)) {
- parts = camel_multipart_get_number (CAMEL_MULTIPART (containee));
- for (i = 0; i < parts && truth == FALSE; i++) {
- CamelDataWrapper *part = (CamelDataWrapper *)camel_multipart_get_part (CAMEL_MULTIPART (containee), i);
- if (part)
- truth = match_words_1message(part, words, mask);
- }
- } else if (CAMEL_IS_MIME_MESSAGE (containee)) {
- /* for messages we only look at its contents */
- truth = match_words_1message((CamelDataWrapper *)containee, words, mask);
- } else if (camel_content_type_is(CAMEL_DATA_WRAPPER (containee)->mime_type, "text", "*")) {
- /* for all other text parts, we look inside, otherwise we dont care */
- CamelStreamMem *mem = (CamelStreamMem *)camel_stream_mem_new ();
-
- /* FIXME: The match should be part of a stream op */
- camel_data_wrapper_decode_to_stream (containee, CAMEL_STREAM (mem));
- camel_stream_write (CAMEL_STREAM (mem), "", 1);
- for (i=0;i<words->len;i++) {
- /* FIXME: This is horridly slow, and should use a real search algorithm */
- if (camel_ustrstrcase(mem->buffer->data, words->words[i]->word) != NULL) {
- *mask |= (1<<i);
- /* shortcut a match */
- if (*mask == (1<<(words->len))-1)
- return TRUE;
- }
- }
-
- camel_object_unref (mem);
- }
-
- return truth;
-}
-
-static gboolean
-match_words_message(CamelFolder *folder, const char *uid, struct _camel_search_words *words, CamelException *ex)
-{
- guint32 mask;
- CamelMimeMessage *msg;
- int truth;
-
- msg = camel_folder_get_message(folder, uid, ex);
- if (msg) {
- mask = 0;
- truth = match_words_1message((CamelDataWrapper *)msg, words, &mask);
- camel_object_unref((CamelObject *)msg);
- } else {
- camel_exception_clear(ex);
- truth = FALSE;
- }
-
- return truth;
-}
-
-static GPtrArray *
-match_words_messages(CamelFolderSearch *search, struct _camel_search_words *words, CamelException *ex)
-{
- int i;
- GPtrArray *matches = g_ptr_array_new();
-
- if (search->body_index) {
- GPtrArray *indexed;
- struct _camel_search_words *simple;
-
- simple = camel_search_words_simple(words);
- indexed = match_words_index(search, simple, ex);
- camel_search_words_free(simple);
-
- for (i=0;i<indexed->len;i++) {
- const char *uid = g_ptr_array_index(indexed, i);
-
- if (match_words_message(search->folder, uid, words, ex))
- g_ptr_array_add(matches, (char *)uid);
- }
-
- g_ptr_array_free(indexed, TRUE);
- } else {
- for (i=0;i<search->summary->len;i++) {
- CamelMessageInfo *info = g_ptr_array_index(search->summary, i);
- const char *uid = camel_message_info_uid(info);
-
- if (match_words_message(search->folder, uid, words, ex))
- g_ptr_array_add(matches, (char *)uid);
- }
- }
-
- return matches;
-}
-
-static ESExpResult *
-search_body_contains(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search)
-{
- int i, j;
- CamelException *ex = search->priv->ex;
- struct _camel_search_words *words;
- ESExpResult *r;
- struct _glib_sux_donkeys lambdafoo;
-
- if (search->current) {
- int truth = FALSE;
-
- if (argc == 1 && argv[0]->value.string[0] == 0) {
- truth = TRUE;
- } else {
- for (i=0;i<argc && !truth;i++) {
- if (argv[i]->type == ESEXP_RES_STRING) {
- words = camel_search_words_split(argv[i]->value.string);
- truth = TRUE;
- if ((words->type & CAMEL_SEARCH_WORD_COMPLEX) == 0 && search->body_index) {
- for (j=0;j<words->len && truth;j++)
- truth = match_message_index(search->body_index, camel_message_info_uid(search->current), words->words[j]->word, ex);
- } else {
- /* TODO: cache current message incase of multiple body search terms */
- truth = match_words_message(search->folder, camel_message_info_uid(search->current), words, ex);
- }
- camel_search_words_free(words);
- }
- }
- }
- r = e_sexp_result_new(f, ESEXP_RES_BOOL);
- r->value.bool = truth;
- } else {
- r = e_sexp_result_new(f, ESEXP_RES_ARRAY_PTR);
- r->value.ptrarray = g_ptr_array_new();
-
- if (argc == 1 && argv[0]->value.string[0] == 0) {
- for (i=0;i<search->summary->len;i++) {
- CamelMessageInfo *info = g_ptr_array_index(search->summary, i);
-
- g_ptr_array_add(r->value.ptrarray, (char *)camel_message_info_uid(info));
- }
- } else {
- GHashTable *ht = g_hash_table_new(g_str_hash, g_str_equal);
- GPtrArray *matches;
-
- for (i=0;i<argc;i++) {
- if (argv[i]->type == ESEXP_RES_STRING) {
- words = camel_search_words_split(argv[i]->value.string);
- if ((words->type & CAMEL_SEARCH_WORD_COMPLEX) == 0 && search->body_index) {
- matches = match_words_index(search, words, ex);
- } else {
- matches = match_words_messages(search, words, ex);
- }
- for (j=0;j<matches->len;j++)
- g_hash_table_insert(ht, matches->pdata[j], matches->pdata[j]);
- g_ptr_array_free(matches, TRUE);
- camel_search_words_free(words);
- }
- }
- lambdafoo.uids = r->value.ptrarray;
- g_hash_table_foreach(ht, (GHFunc)g_lib_sux_htor, &lambdafoo);
- g_hash_table_destroy(ht);
- }
- }
-
- return r;
-}
-
-static ESExpResult *
-search_user_flag(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search)
-{
- ESExpResult *r;
- int i;
-
- r(printf("executing user-flag\n"));
-
- /* are we inside a match-all? */
- if (search->current) {
- int truth = FALSE;
- /* performs an OR of all words */
- for (i=0;i<argc && !truth;i++) {
- if (argv[i]->type == ESEXP_RES_STRING
- && camel_flag_get(&search->current->user_flags, argv[i]->value.string)) {
- truth = TRUE;
- break;
- }
- }
- r = e_sexp_result_new(f, ESEXP_RES_BOOL);
- r->value.bool = truth;
- } else {
- r = e_sexp_result_new(f, ESEXP_RES_ARRAY_PTR);
- r->value.ptrarray = g_ptr_array_new();
- }
-
- return r;
-}
-
-static ESExpResult *
-search_system_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search)
-{
- ESExpResult *r;
-
- r(printf ("executing system-flag\n"));
-
- if (search->current) {
- gboolean truth = FALSE;
-
- if (argc == 1)
- truth = camel_system_flag_get (search->current->flags, argv[0]->value.string);
-
- r = e_sexp_result_new(f, ESEXP_RES_BOOL);
- r->value.bool = truth;
- } else {
- r = e_sexp_result_new(f, ESEXP_RES_ARRAY_PTR);
- r->value.ptrarray = g_ptr_array_new ();
- }
-
- return r;
-}
-
-static ESExpResult *
-search_user_tag(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search)
-{
- const char *value = NULL;
- ESExpResult *r;
-
- r(printf("executing user-tag\n"));
-
- if (argc == 1)
- value = camel_tag_get (&search->current->user_tags, argv[0]->value.string);
-
- r = e_sexp_result_new(f, ESEXP_RES_STRING);
- r->value.string = g_strdup (value ? value : "");
-
- return r;
-}
-
-static ESExpResult *
-search_get_sent_date(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s)
-{
- ESExpResult *r;
-
- r(printf("executing get-sent-date\n"));
-
- /* are we inside a match-all? */
- if (s->current) {
- r = e_sexp_result_new(f, ESEXP_RES_INT);
-
- r->value.number = s->current->date_sent;
- } else {
- r = e_sexp_result_new(f, ESEXP_RES_ARRAY_PTR);
- r->value.ptrarray = g_ptr_array_new ();
- }
-
- return r;
-}
-
-static ESExpResult *
-search_get_received_date(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s)
-{
- ESExpResult *r;
-
- r(printf("executing get-received-date\n"));
-
- /* are we inside a match-all? */
- if (s->current) {
- r = e_sexp_result_new(f, ESEXP_RES_INT);
-
- r->value.number = s->current->date_received;
- } else {
- r = e_sexp_result_new(f, ESEXP_RES_ARRAY_PTR);
- r->value.ptrarray = g_ptr_array_new ();
- }
-
- return r;
-}
-
-static ESExpResult *
-search_get_current_date(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s)
-{
- ESExpResult *r;
-
- r(printf("executing get-current-date\n"));
-
- r = e_sexp_result_new(f, ESEXP_RES_INT);
- r->value.number = time (NULL);
- return r;
-}
-
-static ESExpResult *
-search_get_size (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s)
-{
- ESExpResult *r;
-
- r(printf("executing get-size\n"));
-
- /* are we inside a match-all? */
- if (s->current) {
- r = e_sexp_result_new (f, ESEXP_RES_INT);
- r->value.number = s->current->size / 1024;
- } else {
- r = e_sexp_result_new (f, ESEXP_RES_ARRAY_PTR);
- r->value.ptrarray = g_ptr_array_new ();
- }
-
- return r;
-}
-
-static ESExpResult *
-search_uid(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search)
-{
- ESExpResult *r;
- int i;
-
- r(printf("executing uid\n"));
-
- /* are we inside a match-all? */
- if (search->current) {
- int truth = FALSE;
- const char *uid = camel_message_info_uid(search->current);
-
- /* performs an OR of all words */
- for (i=0;i<argc && !truth;i++) {
- if (argv[i]->type == ESEXP_RES_STRING
- && !strcmp(uid, argv[i]->value.string)) {
- truth = TRUE;
- break;
- }
- }
- r = e_sexp_result_new(f, ESEXP_RES_BOOL);
- r->value.bool = truth;
- } else {
- r = e_sexp_result_new(f, ESEXP_RES_ARRAY_PTR);
- r->value.ptrarray = g_ptr_array_new();
- for (i=0;i<argc;i++) {
- if (argv[i]->type == ESEXP_RES_STRING)
- g_ptr_array_add(r->value.ptrarray, argv[i]->value.string);
- }
- }
-
- return r;
-}
diff --git a/camel/camel-folder-search.h b/camel/camel-folder-search.h
deleted file mode 100644
index e4d2253224..0000000000
--- a/camel/camel-folder-search.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef _CAMEL_FOLDER_SEARCH_H
-#define _CAMEL_FOLDER_SEARCH_H
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <e-util/e-sexp.h>
-#include <camel/camel-folder.h>
-#include <camel/camel-object.h>
-#include <camel/camel-index.h>
-
-#define CAMEL_FOLDER_SEARCH_TYPE (camel_folder_search_get_type ())
-#define CAMEL_FOLDER_SEARCH(obj) CAMEL_CHECK_CAST (obj, camel_folder_search_get_type (), CamelFolderSearch)
-#define CAMEL_FOLDER_SEARCH_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_folder_search_get_type (), CamelFolderSearchClass)
-#define CAMEL_IS_FOLDER_SEARCH(obj) CAMEL_CHECK_TYPE (obj, camel_folder_search_get_type ())
-
-typedef struct _CamelFolderSearchClass CamelFolderSearchClass;
-
-struct _CamelFolderSearch {
- CamelObject parent;
-
- struct _CamelFolderSearchPrivate *priv;
-
- ESExp *sexp; /* s-exp evaluator */
- char *last_search; /* last searched expression */
-
- /* these are only valid during the search, and are reset afterwards */
- CamelFolder *folder; /* folder for current search */
- GPtrArray *summary; /* summary array for current search */
- GHashTable *summary_hash; /* hashtable of summary items */
- CamelMessageInfo *current; /* current message info, when searching one by one */
- CamelMimeMessage *current_message; /* cache of current message, if required */
- CamelIndex *body_index;
-};
-
-struct _CamelFolderSearchClass {
- CamelObjectClass parent_class;
-
- /* general bool/comparison options, usually these wont need to be set, unless it is compiling into another language */
- ESExpResult * (*and)(struct _ESExp *f, int argc, struct _ESExpTerm **argv, CamelFolderSearch *s);
- ESExpResult * (*or)(struct _ESExp *f, int argc, struct _ESExpTerm **argv, CamelFolderSearch *s);
- ESExpResult * (*not)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
- ESExpResult * (*lt)(struct _ESExp *f, int argc, struct _ESExpTerm **argv, CamelFolderSearch *s);
- ESExpResult * (*gt)(struct _ESExp *f, int argc, struct _ESExpTerm **argv, CamelFolderSearch *s);
- ESExpResult * (*eq)(struct _ESExp *f, int argc, struct _ESExpTerm **argv, CamelFolderSearch *s);
-
- /* search options */
- /* (match-all [boolean expression]) Apply match to all messages */
- ESExpResult * (*match_all)(struct _ESExp *f, int argc, struct _ESExpTerm **argv, CamelFolderSearch *s);
-
- /* (body-contains "string1" "string2" ...) Returns a list of matches, or true if in single-message mode */
- ESExpResult * (*body_contains)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
-
- /* (header-contains "headername" "string1" ...) List of matches, or true if in single-message mode */
- ESExpResult * (*header_contains)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
-
- /* (header-matches "headername" "string") */
- ESExpResult * (*header_matches)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
-
- /* (header-starts-with "headername" "string") */
- ESExpResult * (*header_starts_with)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
-
- /* (header-ends-with "headername" "string") */
- ESExpResult * (*header_ends_with)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
-
- /* (header-exists "headername") */
- ESExpResult * (*header_exists)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
-
- /* (user-flag "flagname" "flagname" ...) If one of user-flag set */
- ESExpResult * (*user_flag)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
-
- /* (user-tag "flagname") Returns the value of a user tag. Can only be used in match-all */
- ESExpResult * (*user_tag)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
-
- /* (system-flag "flagname") Returns the value of a system flag. Can only be used in match-all */
- ESExpResult * (*system_flag)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
-
- /* (get-sent-date) Retrieve the date that the message was sent on as a time_t */
- ESExpResult * (*get_sent_date)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
-
- /* (get-received-date) Retrieve the date that the message was received on as a time_t */
- ESExpResult * (*get_received_date)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
-
- /* (get-current-date) Retrieve 'now' as a time_t */
- ESExpResult * (*get_current_date)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
-
- /* (get-size) Retrieve message size as an int (in kilobytes) */
- ESExpResult * (*get_size)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
-
- /* (uid "uid" ...) True if the uid is in the list */
- ESExpResult * (*uid)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
-};
-
-CamelType camel_folder_search_get_type (void);
-CamelFolderSearch *camel_folder_search_new (void);
-void camel_folder_search_construct (CamelFolderSearch *search);
-
-void camel_folder_search_set_folder(CamelFolderSearch *search, CamelFolder *folder);
-void camel_folder_search_set_summary(CamelFolderSearch *search, GPtrArray *summary);
-void camel_folder_search_set_body_index(CamelFolderSearch *search, CamelIndex *index);
-GPtrArray *camel_folder_search_execute_expression(CamelFolderSearch *search, const char *expr, CamelException *ex);
-gboolean camel_folder_search_match_expression(CamelFolderSearch *search, const char *expr,
- const CamelMessageInfo *info, CamelException *ex);
-void camel_folder_search_free_result(CamelFolderSearch *search, GPtrArray *);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* ! _CAMEL_FOLDER_SEARCH_H */
diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c
deleted file mode 100644
index 05b3f3a056..0000000000
--- a/camel/camel-folder-summary.c
+++ /dev/null
@@ -1,2831 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2000-2003 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <pthread.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <ctype.h>
-
-#include <gal/util/e-iconv.h>
-
-#include "camel-folder-summary.h"
-
-#include <camel/camel-file-utils.h>
-#include <camel/camel-mime-filter.h>
-#include <camel/camel-mime-filter-index.h>
-#include <camel/camel-mime-filter-charset.h>
-#include <camel/camel-mime-filter-basic.h>
-#include <camel/camel-mime-filter-html.h>
-#include <camel/camel-mime-message.h>
-#include <camel/camel-multipart.h>
-#include <camel/camel-stream-mem.h>
-
-#include <camel/camel-stream-null.h>
-#include <camel/camel-stream-filter.h>
-
-#include <camel/camel-string-utils.h>
-
-#include "e-util/md5-utils.h"
-#include "e-util/e-memory.h"
-
-#include "camel-private.h"
-
-
-static pthread_mutex_t info_lock = PTHREAD_MUTEX_INITIALIZER;
-
-/* this lock is ONLY for the standalone messageinfo stuff */
-#define GLOBAL_INFO_LOCK(i) pthread_mutex_lock(&info_lock)
-#define GLOBAL_INFO_UNLOCK(i) pthread_mutex_unlock(&info_lock)
-
-
-/* this should probably be conditional on it existing */
-#define USE_BSEARCH
-
-#define d(x)
-#define io(x) /* io debug */
-
-#if 0
-extern int strdup_count, malloc_count, free_count;
-#endif
-
-#define CAMEL_FOLDER_SUMMARY_VERSION (12)
-
-#define _PRIVATE(o) (((CamelFolderSummary *)(o))->priv)
-
-/* trivial lists, just because ... */
-struct _node {
- struct _node *next;
-};
-
-static struct _node *my_list_append(struct _node **list, struct _node *n);
-static int my_list_size(struct _node **list);
-
-static int summary_header_load(CamelFolderSummary *, FILE *);
-static int summary_header_save(CamelFolderSummary *, FILE *);
-
-static CamelMessageInfo * message_info_new(CamelFolderSummary *, struct _camel_header_raw *);
-static CamelMessageInfo * message_info_new_from_parser(CamelFolderSummary *, CamelMimeParser *);
-static CamelMessageInfo * message_info_new_from_message(CamelFolderSummary *s, CamelMimeMessage *msg);
-static CamelMessageInfo * message_info_load(CamelFolderSummary *, FILE *);
-static int message_info_save(CamelFolderSummary *, FILE *, CamelMessageInfo *);
-static void message_info_free(CamelFolderSummary *, CamelMessageInfo *);
-
-static CamelMessageContentInfo * content_info_new(CamelFolderSummary *, struct _camel_header_raw *);
-static CamelMessageContentInfo * content_info_new_from_parser(CamelFolderSummary *, CamelMimeParser *);
-static CamelMessageContentInfo * content_info_new_from_message(CamelFolderSummary *s, CamelMimePart *mp);
-static CamelMessageContentInfo * content_info_load(CamelFolderSummary *, FILE *);
-static int content_info_save(CamelFolderSummary *, FILE *, CamelMessageContentInfo *);
-static void content_info_free(CamelFolderSummary *, CamelMessageContentInfo *);
-
-static char *next_uid_string(CamelFolderSummary *s);
-
-static CamelMessageContentInfo * summary_build_content_info(CamelFolderSummary *s, CamelMessageInfo *msginfo, CamelMimeParser *mp);
-static CamelMessageContentInfo * summary_build_content_info_message(CamelFolderSummary *s, CamelMessageInfo *msginfo, CamelMimePart *object);
-
-static void camel_folder_summary_class_init (CamelFolderSummaryClass *klass);
-static void camel_folder_summary_init (CamelFolderSummary *obj);
-static void camel_folder_summary_finalize (CamelObject *obj);
-
-static CamelObjectClass *camel_folder_summary_parent;
-
-static void
-camel_folder_summary_class_init (CamelFolderSummaryClass *klass)
-{
- camel_folder_summary_parent = camel_type_get_global_classfuncs (camel_object_get_type ());
-
- klass->summary_header_load = summary_header_load;
- klass->summary_header_save = summary_header_save;
-
- klass->message_info_new = message_info_new;
- klass->message_info_new_from_parser = message_info_new_from_parser;
- klass->message_info_new_from_message = message_info_new_from_message;
- klass->message_info_load = message_info_load;
- klass->message_info_save = message_info_save;
- klass->message_info_free = message_info_free;
-
- klass->content_info_new = content_info_new;
- klass->content_info_new_from_parser = content_info_new_from_parser;
- klass->content_info_new_from_message = content_info_new_from_message;
- klass->content_info_load = content_info_load;
- klass->content_info_save = content_info_save;
- klass->content_info_free = content_info_free;
-
- klass->next_uid_string = next_uid_string;
-}
-
-static void
-camel_folder_summary_init (CamelFolderSummary *s)
-{
- struct _CamelFolderSummaryPrivate *p;
-
- p = _PRIVATE(s) = g_malloc0(sizeof(*p));
-
- p->filter_charset = g_hash_table_new (camel_strcase_hash, camel_strcase_equal);
-
- s->message_info_size = sizeof(CamelMessageInfo);
- s->content_info_size = sizeof(CamelMessageContentInfo);
-
- s->message_info_chunks = NULL;
- s->content_info_chunks = NULL;
-
-#if defined (DOESTRV) || defined (DOEPOOLV)
- s->message_info_strings = CAMEL_MESSAGE_INFO_LAST;
-#endif
-
- s->version = CAMEL_FOLDER_SUMMARY_VERSION;
- s->flags = 0;
- s->time = 0;
- s->nextuid = 1;
-
- s->messages = g_ptr_array_new();
- s->messages_uid = g_hash_table_new(g_str_hash, g_str_equal);
-
- p->summary_lock = g_mutex_new();
- p->io_lock = g_mutex_new();
- p->filter_lock = g_mutex_new();
- p->alloc_lock = g_mutex_new();
- p->ref_lock = g_mutex_new();
-}
-
-static void free_o_name(void *key, void *value, void *data)
-{
- camel_object_unref((CamelObject *)value);
- g_free(key);
-}
-
-static void
-camel_folder_summary_finalize (CamelObject *obj)
-{
- struct _CamelFolderSummaryPrivate *p;
- CamelFolderSummary *s = (CamelFolderSummary *)obj;
-
- p = _PRIVATE(obj);
-
- camel_folder_summary_clear(s);
- g_ptr_array_free(s->messages, TRUE);
- g_hash_table_destroy(s->messages_uid);
-
- g_hash_table_foreach(p->filter_charset, free_o_name, 0);
- g_hash_table_destroy(p->filter_charset);
-
- g_free(s->summary_path);
-
- if (s->message_info_chunks)
- e_memchunk_destroy(s->message_info_chunks);
- if (s->content_info_chunks)
- e_memchunk_destroy(s->content_info_chunks);
-
- if (p->filter_index)
- camel_object_unref((CamelObject *)p->filter_index);
- if (p->filter_64)
- camel_object_unref((CamelObject *)p->filter_64);
- if (p->filter_qp)
- camel_object_unref((CamelObject *)p->filter_qp);
- if (p->filter_uu)
- camel_object_unref((CamelObject *)p->filter_uu);
- if (p->filter_save)
- camel_object_unref((CamelObject *)p->filter_save);
- if (p->filter_html)
- camel_object_unref((CamelObject *)p->filter_html);
-
- if (p->filter_stream)
- camel_object_unref((CamelObject *)p->filter_stream);
- if (p->index)
- camel_object_unref((CamelObject *)p->index);
-
- g_mutex_free(p->summary_lock);
- g_mutex_free(p->io_lock);
- g_mutex_free(p->filter_lock);
- g_mutex_free(p->alloc_lock);
- g_mutex_free(p->ref_lock);
-
- g_free(p);
-}
-
-CamelType
-camel_folder_summary_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_object_get_type (), "CamelFolderSummary",
- sizeof (CamelFolderSummary),
- sizeof (CamelFolderSummaryClass),
- (CamelObjectClassInitFunc) camel_folder_summary_class_init,
- NULL,
- (CamelObjectInitFunc) camel_folder_summary_init,
- (CamelObjectFinalizeFunc) camel_folder_summary_finalize);
- }
-
- return type;
-}
-
-/**
- * camel_folder_summary_new:
- *
- * Create a new CamelFolderSummary object.
- *
- * Return value: A new CamelFolderSummary widget.
- **/
-CamelFolderSummary *
-camel_folder_summary_new (void)
-{
- CamelFolderSummary *new = CAMEL_FOLDER_SUMMARY ( camel_object_new (camel_folder_summary_get_type ())); return new;
-}
-
-
-/**
- * camel_folder_summary_set_filename:
- * @s:
- * @name:
- *
- * Set the filename where the summary will be loaded to/saved from.
- **/
-void camel_folder_summary_set_filename(CamelFolderSummary *s, const char *name)
-{
- CAMEL_SUMMARY_LOCK(s, summary_lock);
-
- g_free(s->summary_path);
- s->summary_path = g_strdup(name);
-
- CAMEL_SUMMARY_UNLOCK(s, summary_lock);
-}
-
-/**
- * camel_folder_summary_set_index:
- * @s:
- * @index:
- *
- * Set the index used to index body content. If the index is NULL, or
- * not set (the default), no indexing of body content will take place.
- *
- * Unlike earlier behaviour, build_content need not be set to perform indexing.
- **/
-void camel_folder_summary_set_index(CamelFolderSummary *s, CamelIndex *index)
-{
- struct _CamelFolderSummaryPrivate *p = _PRIVATE(s);
-
- if (p->index)
- camel_object_unref((CamelObject *)p->index);
-
- p->index = index;
- if (index)
- camel_object_ref((CamelObject *)index);
-}
-
-/**
- * camel_folder_summary_set_build_content:
- * @s:
- * @state:
- *
- * Set a flag to tell the summary to build the content info summary
- * (CamelMessageInfo.content). The default is not to build content info
- * summaries.
- **/
-void camel_folder_summary_set_build_content(CamelFolderSummary *s, gboolean state)
-{
- s->build_content = state;
-}
-
-/**
- * camel_folder_summary_count:
- * @s:
- *
- * Get the number of summary items stored in this summary.
- *
- * Return value: The number of items int he summary.
- **/
-int
-camel_folder_summary_count(CamelFolderSummary *s)
-{
- return s->messages->len;
-}
-
-/**
- * camel_folder_summary_index:
- * @s:
- * @i:
- *
- * Retrieve a summary item by index number.
- *
- * A referenced to the summary item is returned, which may be
- * ref'd or free'd as appropriate.
- *
- * Return value: The summary item, or NULL if the index @i is out
- * of range.
- * It must be freed using camel_folder_summary_info_free().
- **/
-CamelMessageInfo *
-camel_folder_summary_index(CamelFolderSummary *s, int i)
-{
- CamelMessageInfo *info = NULL;
-
- CAMEL_SUMMARY_LOCK(s, summary_lock);
- CAMEL_SUMMARY_LOCK(s, ref_lock);
-
- if (i<s->messages->len)
- info = g_ptr_array_index(s->messages, i);
-
- if (info)
- info->refcount++;
-
- CAMEL_SUMMARY_UNLOCK(s, ref_lock);
- CAMEL_SUMMARY_UNLOCK(s, summary_lock);
-
- return info;
-}
-
-/**
- * camel_folder_summary_index:
- * @s:
- * @i:
- *
- * Obtain a copy of the summary array. This is done atomically,
- * so cannot contain empty entries.
- *
- * It must be freed using camel_folder_summary_array_free().
- **/
-GPtrArray *
-camel_folder_summary_array(CamelFolderSummary *s)
-{
- CamelMessageInfo *info;
- GPtrArray *res = g_ptr_array_new();
- int i;
-
- CAMEL_SUMMARY_LOCK(s, summary_lock);
- CAMEL_SUMMARY_LOCK(s, ref_lock);
-
- g_ptr_array_set_size(res, s->messages->len);
- for (i=0;i<s->messages->len;i++) {
- info = res->pdata[i] = g_ptr_array_index(s->messages, i);
- info->refcount++;
- }
-
- CAMEL_SUMMARY_UNLOCK(s, ref_lock);
- CAMEL_SUMMARY_UNLOCK(s, summary_lock);
-
- return res;
-}
-
-/**
- * camel_folder_summary_array_free:
- * @s:
- * @array:
- *
- * Free the folder summary array.
- **/
-void
-camel_folder_summary_array_free(CamelFolderSummary *s, GPtrArray *array)
-{
- int i;
-
- for (i=0;i<array->len;i++)
- camel_folder_summary_info_free(s, array->pdata[i]);
-
- g_ptr_array_free(array, TRUE);
-}
-
-/**
- * camel_folder_summary_uid:
- * @s:
- * @uid:
- *
- * Retrieve a summary item by uid.
- *
- * A referenced to the summary item is returned, which may be
- * ref'd or free'd as appropriate.
- *
- * Return value: The summary item, or NULL if the uid @uid
- * is not available.
- * It must be freed using camel_folder_summary_info_free().
- **/
-CamelMessageInfo *
-camel_folder_summary_uid(CamelFolderSummary *s, const char *uid)
-{
- CamelMessageInfo *info;
-
- CAMEL_SUMMARY_LOCK(s, summary_lock);
- CAMEL_SUMMARY_LOCK(s, ref_lock);
-
- info = g_hash_table_lookup(s->messages_uid, uid);
-
- if (info)
- info->refcount++;
-
- CAMEL_SUMMARY_UNLOCK(s, ref_lock);
- CAMEL_SUMMARY_UNLOCK(s, summary_lock);
-
- return info;
-}
-
-/**
- * camel_folder_summary_next_uid:
- * @s:
- *
- * Generate a new unique uid value as an integer. This
- * may be used to create a unique sequence of numbers.
- *
- * Return value: The next unique uid value.
- **/
-guint32 camel_folder_summary_next_uid(CamelFolderSummary *s)
-{
- guint32 uid;
-
-
- CAMEL_SUMMARY_LOCK(s, summary_lock);
-
- uid = s->nextuid++;
-
- CAMEL_SUMMARY_UNLOCK(s, summary_lock);
-
- /* FIXME: sync this to disk */
-/* summary_header_save(s);*/
- return uid;
-}
-
-/**
- * camel_folder_summary_set_uid:
- * @s:
- * @uid: The next minimum uid to assign. To avoid clashing
- * uid's, set this to the uid of a given messages + 1.
- *
- * Set the next minimum uid available. This can be used to
- * ensure new uid's do not clash with existing uid's.
- **/
-void camel_folder_summary_set_uid(CamelFolderSummary *s, guint32 uid)
-{
- /* TODO: sync to disk? */
- CAMEL_SUMMARY_LOCK(s, summary_lock);
-
- s->nextuid = MAX(s->nextuid, uid);
-
- CAMEL_SUMMARY_UNLOCK(s, summary_lock);
-}
-
-/**
- * camel_folder_summary_next_uid_string:
- * @s:
- *
- * Retrieve the next uid, but as a formatted string.
- *
- * Return value: The next uid as an unsigned integer string.
- * This string must be freed by the caller.
- **/
-char *
-camel_folder_summary_next_uid_string(CamelFolderSummary *s)
-{
- return ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->next_uid_string(s);
-}
-
-/* loads the content descriptions, recursively */
-static CamelMessageContentInfo *
-perform_content_info_load(CamelFolderSummary *s, FILE *in)
-{
- int i;
- guint32 count;
- CamelMessageContentInfo *ci, *part;
-
- ci = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->content_info_load(s, in);
- if (ci == NULL)
- return NULL;
-
- if (camel_file_util_decode_uint32(in, &count) == -1 || count > 500) {
- camel_folder_summary_content_info_free(s, ci);
- return NULL;
- }
-
- for (i=0;i<count;i++) {
- part = perform_content_info_load(s, in);
- if (part) {
- my_list_append((struct _node **)&ci->childs, (struct _node *)part);
- part->parent = ci;
- } else {
- d(fprintf (stderr, "Summary file format messed up?"));
- camel_folder_summary_content_info_free(s, ci);
- return NULL;
- }
- }
- return ci;
-}
-
-int
-camel_folder_summary_load(CamelFolderSummary *s)
-{
- FILE *in;
- int i;
- CamelMessageInfo *mi;
-
- if (s->summary_path == NULL)
- return 0;
-
- in = fopen(s->summary_path, "r");
- if (in == NULL)
- return -1;
-
- CAMEL_SUMMARY_LOCK(s, io_lock);
- if ( ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->summary_header_load(s, in) == -1)
- goto error;
-
- /* now read in each message ... */
- for (i=0;i<s->saved_count;i++) {
- mi = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->message_info_load(s, in);
-
- if (mi == NULL)
- goto error;
-
- if (s->build_content) {
- mi->content = perform_content_info_load(s, in);
- if (mi->content == NULL) {
- camel_folder_summary_info_free(s, mi);
- goto error;
- }
- }
-
- camel_folder_summary_add(s, mi);
- }
-
- CAMEL_SUMMARY_UNLOCK(s, io_lock);
-
- if (fclose (in) != 0)
- return -1;
-
- s->flags &= ~CAMEL_SUMMARY_DIRTY;
-
- return 0;
-
-error:
- if (errno != EINVAL)
- g_warning ("Cannot load summary file: `%s': %s", s->summary_path, g_strerror (errno));
-
- CAMEL_SUMMARY_UNLOCK(s, io_lock);
- fclose (in);
- s->flags |= ~CAMEL_SUMMARY_DIRTY;
-
- return -1;
-}
-
-/* saves the content descriptions, recursively */
-static int
-perform_content_info_save(CamelFolderSummary *s, FILE *out, CamelMessageContentInfo *ci)
-{
- CamelMessageContentInfo *part;
-
- if (((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS (s)))->content_info_save (s, out, ci) == -1)
- return -1;
-
- if (camel_file_util_encode_uint32 (out, my_list_size ((struct _node **)&ci->childs)) == -1)
- return -1;
-
- part = ci->childs;
- while (part) {
- if (perform_content_info_save (s, out, part) == -1)
- return -1;
- part = part->next;
- }
-
- return 0;
-}
-
-/**
- * camel_folder_summary_save:
- * @s:
- *
- * Writes the summary to disk. The summary is only written if changes
- * have occured.
- *
- * Return value: Returns -1 on error.
- **/
-int
-camel_folder_summary_save(CamelFolderSummary *s)
-{
- FILE *out;
- int fd, i;
- guint32 count;
- CamelMessageInfo *mi;
- char *path;
-
- if (s->summary_path == NULL
- || (s->flags & CAMEL_SUMMARY_DIRTY) == 0)
- return 0;
-
- path = alloca(strlen(s->summary_path)+4);
- sprintf(path, "%s~", s->summary_path);
- fd = open(path, O_RDWR|O_CREAT|O_TRUNC, 0600);
- if (fd == -1)
- return -1;
- out = fdopen(fd, "w");
- if (out == NULL) {
- i = errno;
- unlink(path);
- close(fd);
- errno = i;
- return -1;
- }
-
- io(printf("saving header\n"));
-
- CAMEL_SUMMARY_LOCK(s, io_lock);
-
- if (((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->summary_header_save(s, out) == -1)
- goto exception;
-
- /* now write out each message ... */
- /* we check ferorr when done for i/o errors */
- count = s->messages->len;
- for (i = 0; i < count; i++) {
- mi = s->messages->pdata[i];
- if (((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS (s)))->message_info_save (s, out, mi) == -1)
- goto exception;
-
- if (s->build_content) {
- if (perform_content_info_save (s, out, mi->content) == -1)
- goto exception;
- }
- }
-
- if (fflush (out) != 0 || fsync (fileno (out)) == -1)
- goto exception;
-
- fclose (out);
-
- CAMEL_SUMMARY_UNLOCK(s, io_lock);
-
- if (rename(path, s->summary_path) == -1) {
- i = errno;
- unlink(path);
- errno = i;
- return -1;
- }
-
- s->flags &= ~CAMEL_SUMMARY_DIRTY;
- return 0;
-
- exception:
-
- i = errno;
-
- fclose (out);
-
- CAMEL_SUMMARY_UNLOCK(s, io_lock);
-
- unlink (path);
- errno = i;
-
- return -1;
-}
-
-/**
- * camel_folder_summary_header_load:
- * @s: Summary object.
- *
- * Only load the header information from the summary,
- * keep the rest on disk. This should only be done on
- * a fresh summary object.
- *
- * Return value: -1 on error.
- **/
-int camel_folder_summary_header_load(CamelFolderSummary *s)
-{
- FILE *in;
- int ret;
-
- if (s->summary_path == NULL)
- return 0;
-
- in = fopen(s->summary_path, "r");
- if (in == NULL)
- return -1;
-
- CAMEL_SUMMARY_LOCK(s, io_lock);
- ret = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->summary_header_load(s, in);
- CAMEL_SUMMARY_UNLOCK(s, io_lock);
-
- fclose(in);
- s->flags &= ~CAMEL_SUMMARY_DIRTY;
- return ret;
-}
-
-static int
-summary_assign_uid(CamelFolderSummary *s, CamelMessageInfo *info)
-{
- const char *uid;
- CamelMessageInfo *mi;
-
- uid = camel_message_info_uid(info);
- if (uid == NULL || uid[0] == 0) {
- camel_message_info_set_uid(info, camel_folder_summary_next_uid_string(s));
- uid = camel_message_info_uid(info);
- }
-
- CAMEL_SUMMARY_LOCK(s, summary_lock);
-
- while ((mi = g_hash_table_lookup(s->messages_uid, uid))) {
- CAMEL_SUMMARY_UNLOCK(s, summary_lock);
- if (mi == info)
- return 0;
- d(printf ("Trying to insert message with clashing uid (%s). new uid re-assigned", camel_message_info_uid(info)));
- camel_message_info_set_uid(info, camel_folder_summary_next_uid_string(s));
- uid = camel_message_info_uid(info);
- info->flags |= CAMEL_MESSAGE_FOLDER_FLAGGED;
- CAMEL_SUMMARY_LOCK(s, summary_lock);
- }
-
- CAMEL_SUMMARY_UNLOCK(s, summary_lock);
- return 1;
-}
-
-/**
- * camel_folder_summary_add:
- * @s:
- * @info:
- *
- * Adds a new @info record to the summary. If @info->uid is NULL, then a new
- * uid is automatically re-assigned by calling :next_uid_string().
- *
- * The @info record should have been generated by calling one of the
- * info_new_*() functions, as it will be free'd based on the summary
- * class. And MUST NOT be allocated directly using malloc.
- **/
-void camel_folder_summary_add(CamelFolderSummary *s, CamelMessageInfo *info)
-{
- if (info == NULL)
- return;
-
- if (summary_assign_uid(s, info) == 0)
- return;
-
- CAMEL_SUMMARY_LOCK(s, summary_lock);
-
-/* unnecessary for pooled vectors */
-#ifdef DOESTRV
- /* this is vitally important, and also if this is ever modified, then
- the hash table needs to be resynced */
- info->strings = e_strv_pack(info->strings);
-#endif
-
- g_ptr_array_add(s->messages, info);
- g_hash_table_insert(s->messages_uid, (char *)camel_message_info_uid(info), info);
- s->flags |= CAMEL_SUMMARY_DIRTY;
-
- CAMEL_SUMMARY_UNLOCK(s, summary_lock);
-}
-
-/**
- * camel_folder_summary_add_from_header:
- * @s:
- * @h:
- *
- * Build a new info record based on a set of headers, and add it to the
- * summary.
- *
- * Note that this function should not be used if build_content_info has
- * been specified for this summary.
- *
- * Return value: The newly added record.
- **/
-CamelMessageInfo *camel_folder_summary_add_from_header(CamelFolderSummary *s, struct _camel_header_raw *h)
-{
- CamelMessageInfo *info = camel_folder_summary_info_new_from_header(s, h);
-
- camel_folder_summary_add(s, info);
-
- return info;
-}
-
-/**
- * camel_folder_summary_add_from_parser:
- * @s:
- * @mp:
- *
- * Build a new info record based on the current position of a CamelMimeParser.
- *
- * The parser should be positioned before the start of the message to summarise.
- * This function may be used if build_contnet_info or an index has been
- * specified for the summary.
- *
- * Return value: The newly added record.
- **/
-CamelMessageInfo *camel_folder_summary_add_from_parser(CamelFolderSummary *s, CamelMimeParser *mp)
-{
- CamelMessageInfo *info = camel_folder_summary_info_new_from_parser(s, mp);
-
- camel_folder_summary_add(s, info);
-
- return info;
-}
-
-/**
- * camel_folder_summary_add_from_message:
- * @s:
- * @msg:
- *
- * Add a summary item from an existing message.
- *
- * Return value:
- **/
-CamelMessageInfo *camel_folder_summary_add_from_message(CamelFolderSummary *s, CamelMimeMessage *msg)
-{
- CamelMessageInfo *info = camel_folder_summary_info_new_from_message(s, msg);
-
- camel_folder_summary_add(s, info);
-
- return info;
-}
-
-/**
- * camel_folder_summary_info_new_from_header:
- * @s:
- * @h:
- *
- * Create a new info record from a header.
- *
- * Return value: Guess? This info record MUST be freed using
- * camel_folder_summary_info_free(), camel_message_info_free() will not work.
- **/
-CamelMessageInfo *camel_folder_summary_info_new_from_header(CamelFolderSummary *s, struct _camel_header_raw *h)
-{
- return ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s))) -> message_info_new(s, h);
-}
-
-/**
- * camel_folder_summary_info_new_from_parser:
- * @s:
- * @mp:
- *
- * Create a new info record from a parser. If the parser cannot
- * determine a uid, then none will be assigned.
-
- * If indexing is enabled, and the parser cannot determine a new uid, then
- * one is automatically assigned.
- *
- * If indexing is enabled, then the content will be indexed based
- * on this new uid. In this case, the message info MUST be
- * added using :add().
- *
- * Once complete, the parser will be positioned at the end of
- * the message.
- *
- * Return value: Guess? This info record MUST be freed using
- * camel_folder_summary_info_free(), camel_message_info_free() will not work.
- **/
-CamelMessageInfo *camel_folder_summary_info_new_from_parser(CamelFolderSummary *s, CamelMimeParser *mp)
-{
- CamelMessageInfo *info = NULL;
- char *buffer;
- size_t len;
- struct _CamelFolderSummaryPrivate *p = _PRIVATE(s);
- off_t start;
- CamelIndexName *name = NULL;
-
- /* should this check the parser is in the right state, or assume it is?? */
-
- start = camel_mime_parser_tell(mp);
- if (camel_mime_parser_step(mp, &buffer, &len) != CAMEL_MIME_PARSER_STATE_EOF) {
- info = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->message_info_new_from_parser(s, mp);
-
- camel_mime_parser_unstep(mp);
-
- /* assign a unique uid, this is slightly 'wrong' as we do not really
- * know if we are going to store this in the summary, but no matter */
- if (p->index)
- summary_assign_uid(s, info);
-
- CAMEL_SUMMARY_LOCK(s, filter_lock);
-
- if (p->index) {
- if (p->filter_index == NULL)
- p->filter_index = camel_mime_filter_index_new_index(p->index);
- camel_index_delete_name(p->index, camel_message_info_uid(info));
- name = camel_index_add_name(p->index, camel_message_info_uid(info));
- camel_mime_filter_index_set_name(p->filter_index, name);
- }
-
- /* always scan the content info, even if we dont save it */
- info->content = summary_build_content_info(s, info, mp);
-
- if (name) {
- camel_index_write_name(p->index, name);
- camel_object_unref((CamelObject *)name);
- camel_mime_filter_index_set_name(p->filter_index, NULL);
- }
-
- CAMEL_SUMMARY_UNLOCK(s, filter_lock);
-
- info->size = camel_mime_parser_tell(mp) - start;
- }
- return info;
-}
-
-/**
- * camel_folder_summary_info_new_from_message:
- * @:
- * @:
- *
- * Create a summary item from a message.
- *
- * Return value:
- **/
-CamelMessageInfo *camel_folder_summary_info_new_from_message(CamelFolderSummary *s, CamelMimeMessage *msg)
-{
- CamelMessageInfo *info;
- struct _CamelFolderSummaryPrivate *p = _PRIVATE(s);
- CamelIndexName *name = NULL;
-
- info = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->message_info_new_from_message(s, msg);
-
- /* assign a unique uid, this is slightly 'wrong' as we do not really
- * know if we are going to store this in the summary, but we need it set for indexing */
- if (p->index)
- summary_assign_uid(s, info);
-
- CAMEL_SUMMARY_LOCK(s, filter_lock);
-
- if (p->index) {
- if (p->filter_index == NULL)
- p->filter_index = camel_mime_filter_index_new_index(p->index);
- camel_index_delete_name(p->index, camel_message_info_uid(info));
- name = camel_index_add_name(p->index, camel_message_info_uid(info));
- camel_mime_filter_index_set_name(p->filter_index, name);
-
- if (p->filter_stream == NULL) {
- CamelStream *null = camel_stream_null_new();
-
- p->filter_stream = camel_stream_filter_new_with_stream(null);
- camel_object_unref((CamelObject *)null);
- }
- }
-
- info->content = summary_build_content_info_message(s, info, (CamelMimePart *)msg);
-
- if (name) {
- camel_index_write_name(p->index, name);
- camel_object_unref((CamelObject *)name);
- camel_mime_filter_index_set_name(p->filter_index, NULL);
- }
-
- CAMEL_SUMMARY_UNLOCK(s, filter_lock);
-
- return info;
-}
-
-/**
- * camel_folder_summary_content_info_free:
- * @s:
- * @ci:
- *
- * Free the content info @ci, and all associated memory.
- **/
-void
-camel_folder_summary_content_info_free(CamelFolderSummary *s, CamelMessageContentInfo *ci)
-{
- CamelMessageContentInfo *pw, *pn;
-
- pw = ci->childs;
- ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->content_info_free(s, ci);
- while (pw) {
- pn = pw->next;
- camel_folder_summary_content_info_free(s, pw);
- pw = pn;
- }
-}
-
-/**
- * camel_folder_summary_info_free:
- * @s:
- * @mi:
- *
- * Unref and potentially free the message info @mi, and all associated memory.
- **/
-void camel_folder_summary_info_free(CamelFolderSummary *s, CamelMessageInfo *mi)
-{
- CamelMessageContentInfo *ci;
-
- g_assert(mi);
- g_assert(s);
-
- CAMEL_SUMMARY_LOCK(s, ref_lock);
-
- g_assert(mi->refcount >= 1);
-
- mi->refcount--;
- if (mi->refcount > 0) {
- CAMEL_SUMMARY_UNLOCK(s, ref_lock);
- return;
- }
-
- CAMEL_SUMMARY_UNLOCK(s, ref_lock);
-
- ci = mi->content;
-
- ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->message_info_free(s, mi);
- if (s->build_content && ci) {
- camel_folder_summary_content_info_free(s, ci);
- }
-}
-
-/**
- * camel_folder_summary_info_ref:
- * @s:
- * @mi:
- *
- * Add an extra reference to @mi.
- **/
-void camel_folder_summary_info_ref(CamelFolderSummary *s, CamelMessageInfo *mi)
-{
- g_assert(mi);
- g_assert(s);
-
- CAMEL_SUMMARY_LOCK(s, ref_lock);
- g_assert(mi->refcount >= 1);
- mi->refcount++;
- CAMEL_SUMMARY_UNLOCK(s, ref_lock);
-}
-
-/**
- * camel_folder_summary_touch:
- * @s:
- *
- * Mark the summary as changed, so that a save will save it.
- **/
-void
-camel_folder_summary_touch(CamelFolderSummary *s)
-{
- CAMEL_SUMMARY_LOCK(s, summary_lock);
- s->flags |= CAMEL_SUMMARY_DIRTY;
- CAMEL_SUMMARY_UNLOCK(s, summary_lock);
-}
-
-/**
- * camel_folder_summary_clear:
- * @s:
- *
- * Empty the summary contents.
- **/
-void
-camel_folder_summary_clear(CamelFolderSummary *s)
-{
- int i;
-
- CAMEL_SUMMARY_LOCK(s, summary_lock);
- if (camel_folder_summary_count(s) == 0) {
- CAMEL_SUMMARY_UNLOCK(s, summary_lock);
- return;
- }
-
- for (i=0;i<s->messages->len;i++)
- camel_folder_summary_info_free(s, s->messages->pdata[i]);
-
- g_ptr_array_set_size(s->messages, 0);
- g_hash_table_destroy(s->messages_uid);
- s->messages_uid = g_hash_table_new(g_str_hash, g_str_equal);
- s->flags |= CAMEL_SUMMARY_DIRTY;
- CAMEL_SUMMARY_UNLOCK(s, summary_lock);
-}
-
-/**
- * camel_folder_summary_remove:
- * @s:
- * @info:
- *
- * Remove a specific @info record from the summary.
- **/
-void camel_folder_summary_remove(CamelFolderSummary *s, CamelMessageInfo *info)
-{
- CAMEL_SUMMARY_LOCK(s, summary_lock);
- g_hash_table_remove(s->messages_uid, camel_message_info_uid(info));
- g_ptr_array_remove(s->messages, info);
- s->flags |= CAMEL_SUMMARY_DIRTY;
- CAMEL_SUMMARY_UNLOCK(s, summary_lock);
-
- camel_folder_summary_info_free(s, info);
-}
-
-/**
- * camel_folder_summary_remove_uid:
- * @s:
- * @uid:
- *
- * Remove a specific info record from the summary, by @uid.
- **/
-void camel_folder_summary_remove_uid(CamelFolderSummary *s, const char *uid)
-{
- CamelMessageInfo *oldinfo;
- char *olduid;
-
- CAMEL_SUMMARY_LOCK(s, summary_lock);
- CAMEL_SUMMARY_LOCK(s, ref_lock);
- if (g_hash_table_lookup_extended(s->messages_uid, uid, (void *)&olduid, (void *)&oldinfo)) {
- /* make sure it doesn't vanish while we're removing it */
- oldinfo->refcount++;
- CAMEL_SUMMARY_UNLOCK(s, ref_lock);
- CAMEL_SUMMARY_UNLOCK(s, summary_lock);
- camel_folder_summary_remove(s, oldinfo);
- camel_folder_summary_info_free(s, oldinfo);
- } else {
- CAMEL_SUMMARY_UNLOCK(s, ref_lock);
- CAMEL_SUMMARY_UNLOCK(s, summary_lock);
- }
-}
-
-/**
- * camel_folder_summary_remove_index:
- * @s:
- * @index:
- *
- * Remove a specific info record from the summary, by index.
- **/
-void camel_folder_summary_remove_index(CamelFolderSummary *s, int index)
-{
- CAMEL_SUMMARY_LOCK(s, summary_lock);
- if (index < s->messages->len) {
- CamelMessageInfo *info = s->messages->pdata[index];
-
- g_hash_table_remove(s->messages_uid, camel_message_info_uid(info));
- g_ptr_array_remove_index(s->messages, index);
- s->flags |= CAMEL_SUMMARY_DIRTY;
-
- CAMEL_SUMMARY_UNLOCK(s, summary_lock);
- camel_folder_summary_info_free(s, info);
- } else {
- CAMEL_SUMMARY_UNLOCK(s, summary_lock);
- }
-}
-
-/**
- * camel_folder_summary_remove_range:
- * @s:
- * @start: initial index
- * @end: last index to remove
- *
- * Removes an indexed range of info records.
- **/
-void camel_folder_summary_remove_range(CamelFolderSummary *s, int start, int end)
-{
- if (end < start)
- return;
-
- CAMEL_SUMMARY_LOCK(s, summary_lock);
- if (start < s->messages->len) {
- CamelMessageInfo **infos;
- int i;
-
- end = MIN(end+1, s->messages->len);
- infos = g_malloc((end-start)*sizeof(infos[0]));
-
- for (i=start;i<end;i++) {
- CamelMessageInfo *info = s->messages->pdata[i];
-
- infos[i-start] = info;
- g_hash_table_remove(s->messages_uid, camel_message_info_uid(info));
- }
-
- memmove(s->messages->pdata+start, s->messages->pdata+end, (s->messages->len-end)*sizeof(s->messages->pdata[0]));
- g_ptr_array_set_size(s->messages, s->messages->len - (end - start));
- s->flags |= CAMEL_SUMMARY_DIRTY;
-
- CAMEL_SUMMARY_UNLOCK(s, summary_lock);
-
- for (i=start;i<end;i++)
- camel_folder_summary_info_free(s, infos[i-start]);
- g_free(infos);
- } else {
- CAMEL_SUMMARY_UNLOCK(s, summary_lock);
- }
-}
-
-/* should be sorted, for binary search */
-/* This is a tokenisation mechanism for strings written to the
- summary - to save space.
- This list can have at most 31 words. */
-static char * tokens[] = {
- "7bit",
- "8bit",
- "alternative",
- "application",
- "base64",
- "boundary",
- "charset",
- "filename",
- "html",
- "image",
- "iso-8859-1",
- "iso-8859-8",
- "message",
- "mixed",
- "multipart",
- "name",
- "octet-stream",
- "parallel",
- "plain",
- "postscript",
- "quoted-printable",
- "related",
- "rfc822",
- "text",
- "us-ascii", /* 25 words */
-};
-
-#define tokens_len (sizeof(tokens)/sizeof(tokens[0]))
-
-/* baiscally ...
- 0 = null
- 1-tokens_len == tokens[id-1]
- >=32 string, length = n-32
-*/
-
-#ifdef USE_BSEARCH
-static int
-token_search_cmp(char *key, char **index)
-{
- d(printf("comparing '%s' to '%s'\n", key, *index));
- return strcmp(key, *index);
-}
-#endif
-
-/**
- * camel_folder_summary_encode_token:
- * @out:
- * @str:
- *
- * Encode a string value, but use tokenisation and compression
- * to reduce the size taken for common mailer words. This
- * can still be used to encode normal strings as well.
- *
- * Return value: -1 on error.
- **/
-int
-camel_folder_summary_encode_token(FILE *out, const char *str)
-{
- io(printf("Encoding token: '%s'\n", str));
-
- if (str == NULL) {
- return camel_file_util_encode_uint32(out, 0);
- } else {
- int len = strlen(str);
- int i, token=-1;
-
- if (len <= 16) {
- char lower[32];
- char **match;
-
- for (i=0;i<len;i++)
- lower[i] = tolower(str[i]);
- lower[i] = 0;
-#ifdef USE_BSEARCH
- match = bsearch(lower, tokens, tokens_len, sizeof(char *), (int (*)(const void *, const void *))token_search_cmp);
- if (match)
- token = match-tokens;
-#else
- for (i=0;i<tokens_len;i++) {
- if (!strcmp(tokens[i], lower)) {
- token = i;
- break;
- }
- }
-#endif
- }
- if (token != -1) {
- return camel_file_util_encode_uint32(out, token+1);
- } else {
- if (camel_file_util_encode_uint32(out, len+32) == -1)
- return -1;
- if (fwrite(str, len, 1, out) != 1)
- return -1;
- }
- }
- return 0;
-}
-
-/**
- * camel_folder_summary_decode_token:
- * @in:
- * @str:
- *
- * Decode a token value.
- *
- * Return value: -1 on error.
- **/
-int
-camel_folder_summary_decode_token(FILE *in, char **str)
-{
- char *ret;
- guint32 len;
-
- io(printf("Decode token ...\n"));
-
- if (camel_file_util_decode_uint32(in, &len) == -1) {
- io(printf ("Could not decode token from file"));
- *str = NULL;
- return -1;
- }
-
- if (len<32) {
- if (len <= 0) {
- ret = NULL;
- } else if (len<= tokens_len) {
- ret = g_strdup(tokens[len-1]);
- } else {
- io(printf ("Invalid token encountered: %d", len));
- *str = NULL;
- return -1;
- }
- } else if (len > 10240) {
- io(printf ("Got broken string header length: %d bytes", len));
- *str = NULL;
- return -1;
- } else {
- len -= 32;
- ret = g_malloc(len+1);
- if (fread(ret, len, 1, in) != 1) {
- g_free(ret);
- *str = NULL;
- return -1;
- }
- ret[len]=0;
- }
-
- io(printf("Token = '%s'\n", ret));
-
- *str = ret;
- return 0;
-}
-
-static struct _node *
-my_list_append(struct _node **list, struct _node *n)
-{
- struct _node *ln = (struct _node *)list;
- while (ln->next)
- ln = ln->next;
- n->next = 0;
- ln->next = n;
- return n;
-}
-
-static int
-my_list_size(struct _node **list)
-{
- int len = 0;
- struct _node *ln = (struct _node *)list;
- while (ln->next) {
- ln = ln->next;
- len++;
- }
- return len;
-}
-
-static int
-summary_header_load(CamelFolderSummary *s, FILE *in)
-{
- gint32 version, flags, nextuid, count;
- time_t time;
-
- fseek(in, 0, SEEK_SET);
-
- io(printf("Loading header\n"));
-
- if (camel_file_util_decode_fixed_int32(in, &version) == -1
- || camel_file_util_decode_fixed_int32(in, &flags) == -1
- || camel_file_util_decode_fixed_int32(in, &nextuid) == -1
- || camel_file_util_decode_time_t(in, &time) == -1
- || camel_file_util_decode_fixed_int32(in, &count) == -1) {
- return -1;
- }
-
- s->nextuid = nextuid;
- s->flags = flags;
- s->time = time;
- s->saved_count = count;
- if (s->version != version) {
- d(printf ("Summary header version mismatch"));
- errno = EINVAL;
- return -1;
- }
- return 0;
-}
-
-static int
-summary_header_save(CamelFolderSummary *s, FILE *out)
-{
- fseek(out, 0, SEEK_SET);
-
- io(printf("Savining header\n"));
-
- camel_file_util_encode_fixed_int32(out, s->version);
- camel_file_util_encode_fixed_int32(out, s->flags);
- camel_file_util_encode_fixed_int32(out, s->nextuid);
- camel_file_util_encode_time_t(out, s->time);
- return camel_file_util_encode_fixed_int32(out, camel_folder_summary_count(s));
-}
-
-/* are these even useful for anything??? */
-static CamelMessageInfo * message_info_new_from_parser(CamelFolderSummary *s, CamelMimeParser *mp)
-{
- CamelMessageInfo *mi = NULL;
- int state;
-
- state = camel_mime_parser_state(mp);
- switch (state) {
- case CAMEL_MIME_PARSER_STATE_HEADER:
- case CAMEL_MIME_PARSER_STATE_MESSAGE:
- case CAMEL_MIME_PARSER_STATE_MULTIPART:
- mi = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->message_info_new(s, camel_mime_parser_headers_raw(mp));
- break;
- default:
- g_error("Invalid parser state");
- }
-
- return mi;
-}
-
-static CamelMessageContentInfo * content_info_new_from_parser(CamelFolderSummary *s, CamelMimeParser *mp)
-{
- CamelMessageContentInfo *ci = NULL;
-
- switch (camel_mime_parser_state(mp)) {
- case CAMEL_MIME_PARSER_STATE_HEADER:
- case CAMEL_MIME_PARSER_STATE_MESSAGE:
- case CAMEL_MIME_PARSER_STATE_MULTIPART:
- ci = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->content_info_new(s, camel_mime_parser_headers_raw(mp));
- if (ci) {
- ci->type = camel_mime_parser_content_type(mp);
- camel_content_type_ref(ci->type);
- }
- break;
- default:
- g_error("Invalid parser state");
- }
-
- return ci;
-}
-
-static CamelMessageInfo * message_info_new_from_message(CamelFolderSummary *s, CamelMimeMessage *msg)
-{
- CamelMessageInfo *mi;
-
- mi = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->message_info_new(s, ((CamelMimePart *)msg)->headers);
-
- return mi;
-}
-
-static CamelMessageContentInfo * content_info_new_from_message(CamelFolderSummary *s, CamelMimePart *mp)
-{
- CamelMessageContentInfo *ci;
-
- ci = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->content_info_new(s, mp->headers);
-
- return ci;
-}
-
-static char *
-summary_format_address(struct _camel_header_raw *h, const char *name, const char *charset)
-{
- struct _camel_header_address *addr;
- const char *text;
- char *ret;
-
- text = camel_header_raw_find (&h, name, NULL);
- addr = camel_header_address_decode (text, charset);
- if (addr) {
- ret = camel_header_address_list_format (addr);
- camel_header_address_list_clear (&addr);
- } else {
- ret = g_strdup (text);
- }
-
- return ret;
-}
-
-static char *
-summary_format_string (struct _camel_header_raw *h, const char *name, const char *charset)
-{
- const char *text;
-
- text = camel_header_raw_find (&h, name, NULL);
- if (text) {
- while (isspace ((unsigned) *text))
- text++;
- return camel_header_decode_string (text, charset);
- } else {
- return NULL;
- }
-}
-
-/**
- * camel_folder_summary_info_new:
- * @s:
- *
- * Allocate a new camel message info, suitable for adding
- * to this summary.
- *
- * Return value:
- **/
-CamelMessageInfo *
-camel_folder_summary_info_new(CamelFolderSummary *s)
-{
- CamelMessageInfo *mi;
-
- CAMEL_SUMMARY_LOCK(s, alloc_lock);
- if (s->message_info_chunks == NULL)
- s->message_info_chunks = e_memchunk_new(32, s->message_info_size);
- mi = e_memchunk_alloc(s->message_info_chunks);
- CAMEL_SUMMARY_UNLOCK(s, alloc_lock);
-
- memset(mi, 0, s->message_info_size);
-#ifdef DOEPOOLV
- mi->strings = e_poolv_new (s->message_info_strings);
-#endif
-#ifdef DOESTRV
- mi->strings = e_strv_new(s->message_info_strings);
-#endif
- mi->refcount = 1;
- return mi;
-}
-
-/**
- * camel_folder_summary_content_info_new:
- * @s:
- *
- * Allocate a new camel message content info, suitable for adding
- * to this summary.
- *
- * Return value:
- **/
-CamelMessageContentInfo *
-camel_folder_summary_content_info_new(CamelFolderSummary *s)
-{
- CamelMessageContentInfo *ci;
-
- CAMEL_SUMMARY_LOCK(s, alloc_lock);
- if (s->content_info_chunks == NULL)
- s->content_info_chunks = e_memchunk_new(32, s->content_info_size);
- ci = e_memchunk_alloc(s->content_info_chunks);
- CAMEL_SUMMARY_UNLOCK(s, alloc_lock);
-
- memset(ci, 0, s->content_info_size);
- return ci;
-}
-
-static CamelMessageInfo *
-message_info_new(CamelFolderSummary *s, struct _camel_header_raw *h)
-{
- CamelMessageInfo *mi;
- const char *received;
- guchar digest[16];
- struct _camel_header_references *refs, *irt, *scan;
- char *msgid;
- int count;
- char *subject, *from, *to, *cc, *mlist;
- CamelContentType *ct = NULL;
- const char *content, *charset = NULL;
-
- mi = camel_folder_summary_info_new(s);
-
- if ((content = camel_header_raw_find(&h, "Content-Type", NULL))
- && (ct = camel_content_type_decode(content))
- && (charset = camel_content_type_param(ct, "charset"))
- && (strcasecmp(charset, "us-ascii") == 0))
- charset = NULL;
-
- charset = charset ? e_iconv_charset_name (charset) : NULL;
-
- subject = summary_format_string(h, "subject", charset);
- from = summary_format_address(h, "from", charset);
- to = summary_format_address(h, "to", charset);
- cc = summary_format_address(h, "cc", charset);
- mlist = camel_header_raw_check_mailing_list(&h);
-
- if (ct)
- camel_content_type_unref(ct);
-
-#ifdef DOEPOOLV
- e_poolv_set(mi->strings, CAMEL_MESSAGE_INFO_SUBJECT, subject, TRUE);
- e_poolv_set(mi->strings, CAMEL_MESSAGE_INFO_FROM, from, TRUE);
- e_poolv_set(mi->strings, CAMEL_MESSAGE_INFO_TO, to, TRUE);
- e_poolv_set(mi->strings, CAMEL_MESSAGE_INFO_CC, cc, TRUE);
- e_poolv_set(mi->strings, CAMEL_MESSAGE_INFO_MLIST, mlist, TRUE);
-#elif defined (DOESTRV)
- e_strv_set_ref_free(mi->strings, CAMEL_MESSAGE_INFO_SUBJECT, subject);
- e_strv_set_ref_free(mi->strings, CAMEL_MESSAGE_INFO_FROM, from);
- e_strv_set_ref_free(mi->strings, CAMEL_MESSAGE_INFO_TO, to);
- e_strv_set_ref_free(mi->strings, CAMEL_MESSAGE_INFO_CC, cc);
- e_strv_set_ref_free(mi->strings, CAMEL_MESSAGE_INFO_MLIST, mlist);
-#else
- mi->subject = subject;
- mi->from = from;
- mi->to = to;
- mi->cc = cc;
- mi->mlist = mlist;
-#endif
-
- mi->user_flags = NULL;
- mi->user_tags = NULL;
- mi->date_sent = camel_header_decode_date(camel_header_raw_find(&h, "date", NULL), NULL);
- received = camel_header_raw_find(&h, "received", NULL);
- if (received)
- received = strrchr(received, ';');
- if (received)
- mi->date_received = camel_header_decode_date(received + 1, NULL);
- else
- mi->date_received = 0;
-
- msgid = camel_header_msgid_decode(camel_header_raw_find(&h, "message-id", NULL));
- if (msgid) {
- md5_get_digest(msgid, strlen(msgid), digest);
- memcpy(mi->message_id.id.hash, digest, sizeof(mi->message_id.id.hash));
- g_free(msgid);
- }
-
- /* decode our references and in-reply-to headers */
- refs = camel_header_references_decode (camel_header_raw_find (&h, "references", NULL));
- irt = camel_header_references_inreplyto_decode (camel_header_raw_find (&h, "in-reply-to", NULL));
- if (refs || irt) {
- if (irt) {
- /* The References field is populated from the ``References'' and/or ``In-Reply-To''
- headers. If both headers exist, take the first thing in the In-Reply-To header
- that looks like a Message-ID, and append it to the References header. */
-
- if (refs)
- irt->next = refs;
-
- refs = irt;
- }
-
- count = camel_header_references_list_size(&refs);
- mi->references = g_malloc(sizeof(*mi->references) + ((count-1) * sizeof(mi->references->references[0])));
- count = 0;
- scan = refs;
- while (scan) {
- md5_get_digest(scan->id, strlen(scan->id), digest);
- memcpy(mi->references->references[count].id.hash, digest, sizeof(mi->message_id.id.hash));
- count++;
- scan = scan->next;
- }
- mi->references->size = count;
- camel_header_references_list_clear(&refs);
- }
-
- return mi;
-}
-
-
-static CamelMessageInfo *
-message_info_load(CamelFolderSummary *s, FILE *in)
-{
- CamelMessageInfo *mi;
- guint count;
- int i;
- char *subject, *from, *to, *cc, *mlist, *uid;;
-
- mi = camel_folder_summary_info_new(s);
-
- io(printf("Loading message info\n"));
-
- camel_file_util_decode_string(in, &uid);
- camel_file_util_decode_uint32(in, &mi->flags);
- camel_file_util_decode_uint32(in, &mi->size);
- camel_file_util_decode_time_t(in, &mi->date_sent);
- camel_file_util_decode_time_t(in, &mi->date_received);
- camel_file_util_decode_string(in, &subject);
- camel_file_util_decode_string(in, &from);
- camel_file_util_decode_string(in, &to);
- camel_file_util_decode_string(in, &cc);
- camel_file_util_decode_string(in, &mlist);
-
-#ifdef DOEPOOLV
- e_poolv_set(mi->strings, CAMEL_MESSAGE_INFO_UID, uid, TRUE);
- e_poolv_set(mi->strings, CAMEL_MESSAGE_INFO_SUBJECT, subject, TRUE);
- e_poolv_set(mi->strings, CAMEL_MESSAGE_INFO_FROM, from, TRUE);
- e_poolv_set(mi->strings, CAMEL_MESSAGE_INFO_TO, to, TRUE);
- e_poolv_set(mi->strings, CAMEL_MESSAGE_INFO_CC, cc, TRUE);
- e_poolv_set(mi->strings, CAMEL_MESSAGE_INFO_MLIST, mlist, TRUE);
-#elif defined (DOESTRV)
- e_strv_set_ref_free(mi->strings, CAMEL_MESSAGE_INFO_UID, uid);
- e_strv_set_ref_free(mi->strings, CAMEL_MESSAGE_INFO_SUBJECT, subject);
- e_strv_set_ref_free(mi->strings, CAMEL_MESSAGE_INFO_FROM, from);
- e_strv_set_ref_free(mi->strings, CAMEL_MESSAGE_INFO_TO, to);
- e_strv_set_ref_free(mi->strings, CAMEL_MESSAGE_INFO_CC, cc);
- e_strv_set_ref_free(mi->strings, CAMEL_MESSAGE_INFO_MLIST, mlist);
-#else
- mi->uid = uid;
- mi->subject = subject;
- mi->from = from;
- mi->to = to;
- mi->cc = cc;
- mi->mlist = mlist;
-#endif
-
- mi->content = NULL;
-
- camel_file_util_decode_fixed_int32(in, &mi->message_id.id.part.hi);
- camel_file_util_decode_fixed_int32(in, &mi->message_id.id.part.lo);
-
- if (camel_file_util_decode_uint32(in, &count) == -1 || count > 500)
- goto error;
-
- if (count > 0) {
- mi->references = g_malloc(sizeof(*mi->references) + ((count-1) * sizeof(mi->references->references[0])));
- mi->references->size = count;
- for (i=0;i<count;i++) {
- camel_file_util_decode_fixed_int32(in, &mi->references->references[i].id.part.hi);
- camel_file_util_decode_fixed_int32(in, &mi->references->references[i].id.part.lo);
- }
- }
-
- if (camel_file_util_decode_uint32(in, &count) == -1 || count > 500)
- goto error;
-
- for (i=0;i<count;i++) {
- char *name;
- if (camel_file_util_decode_string(in, &name) == -1 || name == NULL)
- goto error;
- camel_flag_set(&mi->user_flags, name, TRUE);
- g_free(name);
- }
-
- if (camel_file_util_decode_uint32(in, &count) == -1 || count > 500)
- goto error;
-
- for (i=0;i<count;i++) {
- char *name, *value;
- if (camel_file_util_decode_string(in, &name) == -1 || name == NULL
- || camel_file_util_decode_string(in, &value) == -1)
- goto error;
- camel_tag_set(&mi->user_tags, name, value);
- g_free(name);
- g_free(value);
- }
-
- if (!ferror(in))
- return mi;
-
-error:
- camel_folder_summary_info_free(s, mi);
-
- return NULL;
-}
-
-static int
-message_info_save(CamelFolderSummary *s, FILE *out, CamelMessageInfo *mi)
-{
- guint32 count;
- CamelFlag *flag;
- CamelTag *tag;
- int i;
-
- io(printf("Saving message info\n"));
-
- camel_file_util_encode_string(out, camel_message_info_uid(mi));
- camel_file_util_encode_uint32(out, mi->flags);
- camel_file_util_encode_uint32(out, mi->size);
- camel_file_util_encode_time_t(out, mi->date_sent);
- camel_file_util_encode_time_t(out, mi->date_received);
- camel_file_util_encode_string(out, camel_message_info_subject(mi));
- camel_file_util_encode_string(out, camel_message_info_from(mi));
- camel_file_util_encode_string(out, camel_message_info_to(mi));
- camel_file_util_encode_string(out, camel_message_info_cc(mi));
- camel_file_util_encode_string(out, camel_message_info_mlist(mi));
-
- camel_file_util_encode_fixed_int32(out, mi->message_id.id.part.hi);
- camel_file_util_encode_fixed_int32(out, mi->message_id.id.part.lo);
-
- if (mi->references) {
- camel_file_util_encode_uint32(out, mi->references->size);
- for (i=0;i<mi->references->size;i++) {
- camel_file_util_encode_fixed_int32(out, mi->references->references[i].id.part.hi);
- camel_file_util_encode_fixed_int32(out, mi->references->references[i].id.part.lo);
- }
- } else {
- camel_file_util_encode_uint32(out, 0);
- }
-
- count = camel_flag_list_size(&mi->user_flags);
- camel_file_util_encode_uint32(out, count);
- flag = mi->user_flags;
- while (flag) {
- camel_file_util_encode_string(out, flag->name);
- flag = flag->next;
- }
-
- count = camel_tag_list_size(&mi->user_tags);
- camel_file_util_encode_uint32(out, count);
- tag = mi->user_tags;
- while (tag) {
- camel_file_util_encode_string(out, tag->name);
- camel_file_util_encode_string(out, tag->value);
- tag = tag->next;
- }
-
- return ferror(out);
-}
-
-static void
-message_info_free(CamelFolderSummary *s, CamelMessageInfo *mi)
-{
-#ifdef DOEPOOLV
- e_poolv_destroy(mi->strings);
-#elif defined (DOESTRV)
- e_strv_destroy(mi->strings);
-#else
- g_free(mi->uid);
- g_free(mi->subject);
- g_free(mi->from);
- g_free(mi->to);
- g_free(mi->cc);
- g_free(mi->mlist);
-#endif
- g_free(mi->references);
- camel_flag_list_free(&mi->user_flags);
- camel_tag_list_free(&mi->user_tags);
- e_memchunk_free(s->message_info_chunks, mi);
-}
-
-static CamelMessageContentInfo *
-content_info_new (CamelFolderSummary *s, struct _camel_header_raw *h)
-{
- CamelMessageContentInfo *ci;
- const char *charset;
-
- ci = camel_folder_summary_content_info_new (s);
-
- charset = e_iconv_locale_charset ();
- ci->id = camel_header_msgid_decode (camel_header_raw_find (&h, "content-id", NULL));
- ci->description = camel_header_decode_string (camel_header_raw_find (&h, "content-description", NULL), NULL);
- ci->encoding = camel_content_transfer_encoding_decode (camel_header_raw_find (&h, "content-transfer-encoding", NULL));
-
- return ci;
-}
-
-static CamelMessageContentInfo *
-content_info_load(CamelFolderSummary *s, FILE *in)
-{
- CamelMessageContentInfo *ci;
- char *type, *subtype;
- guint32 count, i;
- CamelContentType *ct;
-
- io(printf("Loading content info\n"));
-
- ci = camel_folder_summary_content_info_new(s);
-
- camel_folder_summary_decode_token(in, &type);
- camel_folder_summary_decode_token(in, &subtype);
- ct = camel_content_type_new(type, subtype);
- g_free(type); /* can this be removed? */
- g_free(subtype);
- if (camel_file_util_decode_uint32(in, &count) == -1 || count > 500)
- goto error;
-
- for (i=0;i<count;i++) {
- char *name, *value;
- camel_folder_summary_decode_token(in, &name);
- camel_folder_summary_decode_token(in, &value);
- if (!(name && value))
- goto error;
-
- camel_content_type_set_param(ct, name, value);
- /* TODO: do this so we dont have to double alloc/free */
- g_free(name);
- g_free(value);
- }
- ci->type = ct;
-
- camel_folder_summary_decode_token(in, &ci->id);
- camel_folder_summary_decode_token(in, &ci->description);
- camel_folder_summary_decode_token(in, &ci->encoding);
-
- camel_file_util_decode_uint32(in, &ci->size);
-
- ci->childs = NULL;
-
- if (!ferror(in))
- return ci;
-
- error:
- camel_folder_summary_content_info_free(s, ci);
- return NULL;
-}
-
-static int
-content_info_save(CamelFolderSummary *s, FILE *out, CamelMessageContentInfo *ci)
-{
- CamelContentType *ct;
- struct _camel_header_param *hp;
-
- io(printf("Saving content info\n"));
-
- ct = ci->type;
- if (ct) {
- camel_folder_summary_encode_token(out, ct->type);
- camel_folder_summary_encode_token(out, ct->subtype);
- camel_file_util_encode_uint32(out, my_list_size((struct _node **)&ct->params));
- hp = ct->params;
- while (hp) {
- camel_folder_summary_encode_token(out, hp->name);
- camel_folder_summary_encode_token(out, hp->value);
- hp = hp->next;
- }
- } else {
- camel_folder_summary_encode_token(out, NULL);
- camel_folder_summary_encode_token(out, NULL);
- camel_file_util_encode_uint32(out, 0);
- }
- camel_folder_summary_encode_token(out, ci->id);
- camel_folder_summary_encode_token(out, ci->description);
- camel_folder_summary_encode_token(out, ci->encoding);
- return camel_file_util_encode_uint32(out, ci->size);
-}
-
-static void
-content_info_free(CamelFolderSummary *s, CamelMessageContentInfo *ci)
-{
- camel_content_type_unref(ci->type);
- g_free(ci->id);
- g_free(ci->description);
- g_free(ci->encoding);
- e_memchunk_free(s->content_info_chunks, ci);
-}
-
-static char *
-next_uid_string(CamelFolderSummary *s)
-{
- return g_strdup_printf("%u", camel_folder_summary_next_uid(s));
-}
-
-/*
- OK
- Now this is where all the "smarts" happen, where the content info is built,
- and any indexing and what not is performed
-*/
-
-/* must have filter_lock before calling this function */
-static CamelMessageContentInfo *
-summary_build_content_info(CamelFolderSummary *s, CamelMessageInfo *msginfo, CamelMimeParser *mp)
-{
- int state;
- size_t len;
- char *buffer;
- CamelMessageContentInfo *info = NULL;
- CamelContentType *ct;
- int body;
- int enc_id = -1, chr_id = -1, html_id = -1, idx_id = -1;
- struct _CamelFolderSummaryPrivate *p = _PRIVATE(s);
- CamelMimeFilterCharset *mfc;
- CamelMessageContentInfo *part;
-
- d(printf("building content info\n"));
-
- /* start of this part */
- state = camel_mime_parser_step(mp, &buffer, &len);
- body = camel_mime_parser_tell(mp);
-
- if (s->build_content)
- info = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->content_info_new_from_parser(s, mp);
-
- switch(state) {
- case CAMEL_MIME_PARSER_STATE_HEADER:
- /* check content type for indexing, then read body */
- ct = camel_mime_parser_content_type(mp);
- /* update attachments flag as we go */
- if (!camel_content_type_is(ct, "text", "*"))
- msginfo->flags |= CAMEL_MESSAGE_ATTACHMENTS;
-
- if (p->index && camel_content_type_is(ct, "text", "*")) {
- char *encoding;
- const char *charset;
-
- d(printf("generating index:\n"));
-
- encoding = camel_content_transfer_encoding_decode(camel_mime_parser_header(mp, "content-transfer-encoding", NULL));
- if (encoding) {
- if (!strcasecmp(encoding, "base64")) {
- d(printf(" decoding base64\n"));
- if (p->filter_64 == NULL)
- p->filter_64 = camel_mime_filter_basic_new_type(CAMEL_MIME_FILTER_BASIC_BASE64_DEC);
- else
- camel_mime_filter_reset((CamelMimeFilter *)p->filter_64);
- enc_id = camel_mime_parser_filter_add(mp, (CamelMimeFilter *)p->filter_64);
- } else if (!strcasecmp(encoding, "quoted-printable")) {
- d(printf(" decoding quoted-printable\n"));
- if (p->filter_qp == NULL)
- p->filter_qp = camel_mime_filter_basic_new_type(CAMEL_MIME_FILTER_BASIC_QP_DEC);
- else
- camel_mime_filter_reset((CamelMimeFilter *)p->filter_qp);
- enc_id = camel_mime_parser_filter_add(mp, (CamelMimeFilter *)p->filter_qp);
- } else if (!strcasecmp (encoding, "x-uuencode")) {
- d(printf(" decoding x-uuencode\n"));
- if (p->filter_uu == NULL)
- p->filter_uu = camel_mime_filter_basic_new_type(CAMEL_MIME_FILTER_BASIC_UU_DEC);
- else
- camel_mime_filter_reset((CamelMimeFilter *)p->filter_uu);
- enc_id = camel_mime_parser_filter_add(mp, (CamelMimeFilter *)p->filter_uu);
- } else {
- d(printf(" ignoring encoding %s\n", encoding));
- }
- g_free(encoding);
- }
-
- charset = camel_content_type_param(ct, "charset");
- if (charset!=NULL
- && !(strcasecmp(charset, "us-ascii")==0
- || strcasecmp(charset, "utf-8")==0)) {
- d(printf(" Adding conversion filter from %s to UTF-8\n", charset));
- mfc = g_hash_table_lookup(p->filter_charset, charset);
- if (mfc == NULL) {
- mfc = camel_mime_filter_charset_new_convert(charset, "UTF-8");
- if (mfc)
- g_hash_table_insert(p->filter_charset, g_strdup(charset), mfc);
- } else {
- camel_mime_filter_reset((CamelMimeFilter *)mfc);
- }
- if (mfc) {
- chr_id = camel_mime_parser_filter_add(mp, (CamelMimeFilter *)mfc);
- } else {
- g_warning("Cannot convert '%s' to 'UTF-8', message index may be corrupt", charset);
- }
- }
-
- /* we do charset conversions before this filter, which isn't strictly correct,
- but works in most cases */
- if (camel_content_type_is(ct, "text", "html")) {
- if (p->filter_html == NULL)
- p->filter_html = camel_mime_filter_html_new();
- else
- camel_mime_filter_reset((CamelMimeFilter *)p->filter_html);
- html_id = camel_mime_parser_filter_add(mp, (CamelMimeFilter *)p->filter_html);
- }
-
- /* and this filter actually does the indexing */
- idx_id = camel_mime_parser_filter_add(mp, (CamelMimeFilter *)p->filter_index);
- }
- /* and scan/index everything */
- while (camel_mime_parser_step(mp, &buffer, &len) != CAMEL_MIME_PARSER_STATE_BODY_END)
- ;
- /* and remove the filters */
- camel_mime_parser_filter_remove(mp, enc_id);
- camel_mime_parser_filter_remove(mp, chr_id);
- camel_mime_parser_filter_remove(mp, html_id);
- camel_mime_parser_filter_remove(mp, idx_id);
- break;
- case CAMEL_MIME_PARSER_STATE_MULTIPART:
- d(printf("Summarising multipart\n"));
- /* update attachments flag as we go */
- ct = camel_mime_parser_content_type(mp);
- if (camel_content_type_is(ct, "multipart", "mixed"))
- msginfo->flags |= CAMEL_MESSAGE_ATTACHMENTS;
-
- while (camel_mime_parser_step(mp, &buffer, &len) != CAMEL_MIME_PARSER_STATE_MULTIPART_END) {
- camel_mime_parser_unstep(mp);
- part = summary_build_content_info(s, msginfo, mp);
- if (part) {
- part->parent = info;
- my_list_append((struct _node **)&info->childs, (struct _node *)part);
- }
- }
- break;
- case CAMEL_MIME_PARSER_STATE_MESSAGE:
- d(printf("Summarising message\n"));
- /* update attachments flag as we go */
- msginfo->flags |= CAMEL_MESSAGE_ATTACHMENTS;
-
- part = summary_build_content_info(s, msginfo, mp);
- if (part) {
- part->parent = info;
- my_list_append((struct _node **)&info->childs, (struct _node *)part);
- }
- state = camel_mime_parser_step(mp, &buffer, &len);
- if (state != CAMEL_MIME_PARSER_STATE_MESSAGE_END) {
- g_error("Bad parser state: Expecing MESSAGE_END or MESSAGE_EOF, got: %d", state);
- camel_mime_parser_unstep(mp);
- }
- break;
- }
-
- d(printf("finished building content info\n"));
-
- return info;
-}
-
-/* build the content-info, from a message */
-/* this needs the filter lock since it uses filters to perform indexing */
-static CamelMessageContentInfo *
-summary_build_content_info_message(CamelFolderSummary *s, CamelMessageInfo *msginfo, CamelMimePart *object)
-{
- CamelDataWrapper *containee;
- int parts, i;
- struct _CamelFolderSummaryPrivate *p = _PRIVATE(s);
- CamelMessageContentInfo *info = NULL, *child;
-
- if (s->build_content)
- info = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->content_info_new_from_message(s, object);
-
- containee = camel_medium_get_content_object(CAMEL_MEDIUM(object));
-
- if (containee == NULL)
- return info;
-
- /* TODO: I find it odd that get_part and get_content_object do not
- add a reference, probably need fixing for multithreading */
-
- /* check for attachments */
- if (camel_content_type_is(CAMEL_DATA_WRAPPER(containee)->mime_type, "multipart", "*")) {
- if (camel_content_type_is(CAMEL_DATA_WRAPPER(containee)->mime_type, "multipart", "mixed"))
- msginfo->flags |= CAMEL_MESSAGE_ATTACHMENTS;
- } else if (!camel_content_type_is(CAMEL_DATA_WRAPPER(containee)->mime_type, "text", "*"))
- msginfo->flags |= CAMEL_MESSAGE_ATTACHMENTS;
-
- /* using the object types is more accurate than using the mime/types */
- if (CAMEL_IS_MULTIPART(containee)) {
- parts = camel_multipart_get_number(CAMEL_MULTIPART(containee));
- for (i=0;i<parts;i++) {
- CamelMimePart *part = camel_multipart_get_part(CAMEL_MULTIPART(containee), i);
- g_assert(part);
- child = summary_build_content_info_message(s, msginfo, part);
- if (child) {
- child->parent = info;
- my_list_append((struct _node **)&info->childs, (struct _node *)child);
- }
- }
- } else if (CAMEL_IS_MIME_MESSAGE(containee)) {
- /* for messages we only look at its contents */
- child = summary_build_content_info_message(s, msginfo, (CamelMimePart *)containee);
- if (child) {
- child->parent = info;
- my_list_append((struct _node **)&info->childs, (struct _node *)child);
- }
- } else if (p->filter_stream
- && camel_content_type_is(CAMEL_DATA_WRAPPER(containee)->mime_type, "text", "*")) {
- int html_id = -1, idx_id = -1;
-
- /* pre-attach html filter if required, otherwise just index filter */
- if (camel_content_type_is(CAMEL_DATA_WRAPPER(containee)->mime_type, "text", "html")) {
- if (p->filter_html == NULL)
- p->filter_html = camel_mime_filter_html_new();
- else
- camel_mime_filter_reset((CamelMimeFilter *)p->filter_html);
- html_id = camel_stream_filter_add(p->filter_stream, (CamelMimeFilter *)p->filter_html);
- }
- idx_id = camel_stream_filter_add(p->filter_stream, (CamelMimeFilter *)p->filter_index);
-
- camel_data_wrapper_decode_to_stream(containee, (CamelStream *)p->filter_stream);
- camel_stream_flush((CamelStream *)p->filter_stream);
-
- camel_stream_filter_remove(p->filter_stream, idx_id);
- camel_stream_filter_remove(p->filter_stream, html_id);
- }
-
- return info;
-}
-
-/**
- * camel_flag_get:
- * @list:
- * @name:
- *
- * Find the state of the flag @name in @list.
- *
- * Return value: The state of the flag (TRUE or FALSE).
- **/
-gboolean
-camel_flag_get(CamelFlag **list, const char *name)
-{
- CamelFlag *flag;
- flag = *list;
- while (flag) {
- if (!strcmp(flag->name, name))
- return TRUE;
- flag = flag->next;
- }
- return FALSE;
-}
-
-/**
- * camel_flag_set:
- * @list:
- * @name:
- * @value:
- *
- * Set the state of a flag @name in the list @list to @value.
- *
- * Return value: Whether or not it changed.
- **/
-gboolean
-camel_flag_set(CamelFlag **list, const char *name, gboolean value)
-{
- CamelFlag *flag, *tmp;
-
- /* this 'trick' works because flag->next is the first element */
- flag = (CamelFlag *)list;
- while (flag->next) {
- tmp = flag->next;
- if (!strcmp(flag->next->name, name)) {
- if (!value) {
- flag->next = tmp->next;
- g_free(tmp);
- }
- return !value;
- }
- flag = tmp;
- }
-
- if (value) {
- tmp = g_malloc(sizeof(*tmp) + strlen(name));
- strcpy(tmp->name, name);
- tmp->next = 0;
- flag->next = tmp;
- }
- return value;
-}
-
-/**
- * camel_flag_list_size:
- * @list:
- *
- * Get the length of the flag list.
- *
- * Return value: The number of TRUE flags in the list.
- **/
-int
-camel_flag_list_size(CamelFlag **list)
-{
- int count=0;
- CamelFlag *flag;
-
- flag = *list;
- while (flag) {
- count++;
- flag = flag->next;
- }
- return count;
-}
-
-/**
- * camel_flag_list_free:
- * @list:
- *
- * Free the memory associated with the flag list @list.
- **/
-void
-camel_flag_list_free(CamelFlag **list)
-{
- CamelFlag *flag, *tmp;
- flag = *list;
- while (flag) {
- tmp = flag->next;
- g_free(flag);
- flag = tmp;
- }
- *list = NULL;
-}
-
-/**
- * camel_flag_list_copy:
- * @to:
- * @from:
- *
- * Copy a flag list, return true if the destination list @to changed.
- *
- * Return value:
- **/
-gboolean
-camel_flag_list_copy(CamelFlag **to, CamelFlag **from)
-{
- CamelFlag *flag, *tmp;
- int changed = FALSE;
-
- if (*to == NULL && from == NULL)
- return FALSE;
-
- /* Remove any now-missing flags */
- flag = (CamelFlag *)to;
- while (flag->next) {
- tmp = flag->next;
- if (!camel_flag_get(from, tmp->name)) {
- flag->next = tmp->next;
- g_free(tmp);
- changed = TRUE;
- } else {
- flag = tmp;
- }
- }
-
- /* Add any new flags */
- flag = *from;
- while (flag) {
- changed |= camel_flag_set(to, flag->name, TRUE);
- flag = flag->next;
- }
-
- return changed;
-}
-
-const char *
-camel_tag_get(CamelTag **list, const char *name)
-{
- CamelTag *tag;
-
- tag = *list;
- while (tag) {
- if (!strcmp(tag->name, name))
- return (const char *)tag->value;
- tag = tag->next;
- }
- return NULL;
-}
-
-/**
- * camel_tag_set:
- * @list:
- * @name:
- * @value:
- *
- * Set the tag @name in the tag list @list to @value.
- *
- * Return value: whether or not it changed
- **/
-gboolean
-camel_tag_set(CamelTag **list, const char *name, const char *value)
-{
- CamelTag *tag, *tmp;
-
- /* this 'trick' works because tag->next is the first element */
- tag = (CamelTag *)list;
- while (tag->next) {
- tmp = tag->next;
- if (!strcmp(tmp->name, name)) {
- if (value == NULL) { /* clear it? */
- tag->next = tmp->next;
- g_free(tmp->value);
- g_free(tmp);
- return TRUE;
- } else if (strcmp(tmp->value, value)) { /* has it changed? */
- g_free(tmp->value);
- tmp->value = g_strdup(value);
- return TRUE;
- }
- return FALSE;
- }
- tag = tmp;
- }
-
- if (value) {
- tmp = g_malloc(sizeof(*tmp)+strlen(name));
- strcpy(tmp->name, name);
- tmp->value = g_strdup(value);
- tmp->next = 0;
- tag->next = tmp;
- return TRUE;
- }
- return FALSE;
-}
-
-/**
- * camel_tag_list_size:
- * @list:
- *
- * Get the number of tags present in the tag list @list.
- *
- * Return value: The number of tags.
- **/
-int camel_tag_list_size(CamelTag **list)
-{
- int count=0;
- CamelTag *tag;
-
- tag = *list;
- while (tag) {
- count++;
- tag = tag->next;
- }
- return count;
-}
-
-static void
-rem_tag(char *key, char *value, CamelTag **to)
-{
- camel_tag_set(to, key, NULL);
-}
-
-/**
- * camel_tag_list_copy:
- * @to:
- * @from:
- *
- * Copy a list of tags.
- *
- * Return value:
- **/
-gboolean
-camel_tag_list_copy(CamelTag **to, CamelTag **from)
-{
- int changed = FALSE;
- CamelTag *tag;
- GHashTable *left;
-
- if (*to == NULL && from == NULL)
- return FALSE;
-
- left = g_hash_table_new(g_str_hash, g_str_equal);
- tag = *to;
- while (tag) {
- g_hash_table_insert(left, tag->name, tag);
- tag = tag->next;
- }
-
- tag = *from;
- while (tag) {
- changed |= camel_tag_set(to, tag->name, tag->value);
- g_hash_table_remove(left, tag->name);
- tag = tag->next;
- }
-
- if (g_hash_table_size(left)>0) {
- g_hash_table_foreach(left, (GHFunc)rem_tag, to);
- changed = TRUE;
- }
- g_hash_table_destroy(left);
-
- return changed;
-}
-
-/**
- * camel_tag_list_free:
- * @list:
- *
- * Free the tag list @list.
- **/
-void camel_tag_list_free(CamelTag **list)
-{
- CamelTag *tag, *tmp;
- tag = *list;
- while (tag) {
- tmp = tag->next;
- g_free(tag->value);
- g_free(tag);
- tag = tmp;
- }
- *list = NULL;
-}
-
-struct flag_names_t {
- char *name;
- guint32 value;
-} flag_names[] = {
- { "answered", CAMEL_MESSAGE_ANSWERED },
- { "deleted", CAMEL_MESSAGE_DELETED },
- { "draft", CAMEL_MESSAGE_DELETED },
- { "flagged", CAMEL_MESSAGE_FLAGGED },
- { "seen", CAMEL_MESSAGE_SEEN },
- { "attachments", CAMEL_MESSAGE_ATTACHMENTS },
- { "junk", CAMEL_MESSAGE_JUNK },
- { NULL, 0 }
-};
-
-/**
- * camel_system_flag:
- * @name:
- *
- * Returns the integer value of the flag string.
- **/
-guint32
-camel_system_flag (const char *name)
-{
- struct flag_names_t *flag;
-
- g_return_val_if_fail (name != NULL, 0);
-
- for (flag = flag_names; *flag->name; flag++)
- if (!strcasecmp (name, flag->name))
- return flag->value;
-
- return 0;
-}
-
-/**
- * camel_system_flag_get:
- * @flags:
- * @name:
- *
- * Find the state of the flag @name in @flags.
- *
- * Return value: The state of the flag (TRUE or FALSE).
- **/
-gboolean
-camel_system_flag_get (guint32 flags, const char *name)
-{
- g_return_val_if_fail (name != NULL, FALSE);
-
- return flags & camel_system_flag (name);
-}
-
-
-/**
- * camel_message_info_new:
- *
- * Returns a new CamelMessageInfo structure.
- **/
-CamelMessageInfo *
-camel_message_info_new (void)
-{
- CamelMessageInfo *info;
-
- info = g_malloc0(sizeof(*info));
-#ifdef DOEPOOLV
- info->strings = e_poolv_new(CAMEL_MESSAGE_INFO_LAST);
-#endif
-#ifdef DOESTRV
- info->strings = e_strv_new (CAMEL_MESSAGE_INFO_LAST);
-#endif
- info->refcount = 1;
-
- return info;
-}
-
-/**
- * camel_message_info_ref:
- * @info:
- *
- * Reference an info.
- *
- * NOTE: This interface is not MT-SAFE, like the others.
- **/
-void camel_message_info_ref(CamelMessageInfo *info)
-{
- GLOBAL_INFO_LOCK(info);
- info->refcount++;
- GLOBAL_INFO_UNLOCK(info);
-}
-
-/**
- * camel_message_info_new_from_header:
- * @header: raw header
- *
- * Returns a new CamelMessageInfo structure populated by the header.
- **/
-CamelMessageInfo *
-camel_message_info_new_from_header (struct _camel_header_raw *header)
-{
- CamelMessageInfo *info;
- char *subject, *from, *to, *cc, *mlist;
- CamelContentType *ct = NULL;
- const char *content, *date, *charset = NULL;
-
- if ((content = camel_header_raw_find(&header, "Content-Type", NULL))
- && (ct = camel_content_type_decode(content))
- && (charset = camel_content_type_param(ct, "charset"))
- && (strcasecmp(charset, "us-ascii") == 0))
- charset = NULL;
-
- charset = charset ? e_iconv_charset_name (charset) : NULL;
-
- subject = summary_format_string(header, "subject", charset);
- from = summary_format_address(header, "from", charset);
- to = summary_format_address(header, "to", charset);
- cc = summary_format_address(header, "cc", charset);
- date = camel_header_raw_find(&header, "date", NULL);
- mlist = camel_header_raw_check_mailing_list(&header);
-
- if (ct)
- camel_content_type_unref(ct);
-
- info = camel_message_info_new();
-
- camel_message_info_set_subject(info, subject);
- camel_message_info_set_from(info, from);
- camel_message_info_set_to(info, to);
- camel_message_info_set_cc(info, cc);
- camel_message_info_set_mlist(info, mlist);
-
- if (date)
- info->date_sent = camel_header_decode_date (date, NULL);
- else
- info->date_sent = time (NULL);
-
- date = camel_header_raw_find (&header, "received", NULL);
- if (date && (date = strrchr (date, ';')))
- date++;
-
- if (date)
- info->date_received = camel_header_decode_date (date, NULL);
- else
- info->date_received = time (NULL);
-
- return info;
-}
-
-/**
- * camel_message_info_dup_to:
- * @from: source message info
- * @to: destination message info
- *
- * Duplicates the contents of one CamelMessageInfo structure into another.
- * (The destination is assumed to be empty: its contents are not freed.)
- * The slightly odd interface is to allow this to be used to initialize
- * "subclasses" of CamelMessageInfo.
- **/
-void
-camel_message_info_dup_to(const CamelMessageInfo *from, CamelMessageInfo *to)
-{
- CamelFlag *flag;
- CamelTag *tag;
-
- /* Copy numbers */
- to->flags = from->flags;
- to->size = from->size;
- to->date_sent = from->date_sent;
- to->date_received = from->date_received;
- to->refcount = 1;
-
- /* Copy strings */
-#ifdef DOEPOOLV
- to->strings = e_poolv_cpy (to->strings, from->strings);
-#elif defined (DOESTRV)
- /* to->strings = e_strv_new(CAMEL_MESSAGE_INFO_LAST); */
- e_strv_set(to->strings, CAMEL_MESSAGE_INFO_SUBJECT, camel_message_info_subject(from));
- e_strv_set(to->strings, CAMEL_MESSAGE_INFO_FROM, camel_message_info_from(from));
- e_strv_set(to->strings, CAMEL_MESSAGE_INFO_TO, camel_message_info_to(from));
- e_strv_set(to->strings, CAMEL_MESSAGE_INFO_CC, camel_message_info_cc(from));
- e_strv_set(to->strings, CAMEL_MESSAGE_INFO_UID, camel_message_info_uid(from));
- e_strv_set(to->strings, CAMEL_MESSAGE_INFO_UID, camel_message_info_mlist(from));
-#else
- to->subject = g_strdup(from->subject);
- to->from = g_strdup(from->from);
- to->to = g_strdup(from->to);
- to->cc = g_strdup(from->cc);
- to->uid = g_strdup(from->uid);
- to->mlist = g_strdup(from->mlist);
-#endif
- memcpy(&to->message_id, &from->message_id, sizeof(from->message_id));
-
- /* Copy structures */
- if (from->references) {
- int len = sizeof(*from->references) + ((from->references->size-1) * sizeof(from->references->references[0]));
-
- to->references = g_malloc(len);
- memcpy(to->references, from->references, len);
- } else {
- to->references = NULL;
- }
-
- flag = from->user_flags;
- while (flag) {
- camel_flag_set(&to->user_flags, flag->name, TRUE);
- flag = flag->next;
- }
-
- tag = from->user_tags;
- while (tag) {
- camel_tag_set(&to->user_tags, tag->name, tag->value);
- tag = tag->next;
- }
-
- /* No, this is impossible without knowing the class of summary we came from */
- /* FIXME some day */
- to->content = NULL;
-}
-
-/**
- * camel_message_info_free:
- * @mi: the message info
- *
- * Unref's and potentially frees a CamelMessageInfo and its contents.
- *
- * Can only be used to free CamelMessageInfo's created with
- * camel_message_info_dup_to.
- *
- * NOTE: This interface is not MT-SAFE, like the others.
- *
- **/
-void
-camel_message_info_free(CamelMessageInfo *mi)
-{
- g_return_if_fail(mi != NULL);
-
- GLOBAL_INFO_LOCK(info);
- mi->refcount--;
- if (mi->refcount > 0) {
- GLOBAL_INFO_UNLOCK(info);
- return;
- }
- GLOBAL_INFO_UNLOCK(info);
-
-#ifdef DOEPOOLV
- e_poolv_destroy(mi->strings);
-#elif defined (DOESTRV)
- e_strv_destroy(mi->strings);
-#else
- g_free(mi->uid);
- g_free(mi->subject);
- g_free(mi->from);
- g_free(mi->to);
- g_free(mi->cc);
- g_free(mi->mlist);
-#endif
- g_free(mi->references);
- camel_flag_list_free(&mi->user_flags);
- camel_tag_list_free(&mi->user_tags);
- /* FIXME: content info? */
- g_free(mi);
-}
-
-#if defined (DOEPOOLV) || defined (DOESTRV)
-const char *
-camel_message_info_string (const CamelMessageInfo *mi, int type)
-{
- g_assert (mi != NULL);
-
- if (mi->strings == NULL)
- return "";
-#ifdef DOEPOOLV
- return e_poolv_get (mi->strings, type);
-#else
- return e_strv_get (mi->strings, type);
-#endif
-}
-
-void
-camel_message_info_set_string (CamelMessageInfo *mi, int type, char *str)
-{
- g_assert (mi != NULL);
- g_assert (mi->strings != NULL);
-#ifdef DOEPOOLV
- e_poolv_set (mi->strings, type, str, TRUE);
-#else
- mi->strings = e_strv_set_ref_free (mi->strings, type, str);
-#endif
-}
-#endif
-
-
-void
-camel_content_info_dump (CamelMessageContentInfo *ci, int depth)
-{
- char *p;
-
- p = alloca (depth * 4 + 1);
- memset (p, ' ', depth * 4);
- p[depth * 4] = 0;
-
- if (ci == NULL) {
- printf ("%s<empty>\n", p);
- return;
- }
-
- if (ci->type)
- printf ("%scontent-type: %s/%s\n", p, ci->type->type ? ci->type->type : "(null)",
- ci->type->subtype ? ci->type->subtype : "(null)");
- else
- printf ("%scontent-type: <unset>\n", p);
- printf ("%scontent-transfer-encoding: %s\n", p, ci->encoding ? ci->encoding : "(null)");
- printf ("%scontent-description: %s\n", p, ci->description ? ci->description : "(null)");
- printf ("%ssize: %lu\n", p, (unsigned long) ci->size);
- ci = ci->childs;
- while (ci) {
- camel_content_info_dump (ci, depth + 1);
- ci = ci->next;
- }
-}
-
-void
-camel_message_info_dump (CamelMessageInfo *mi)
-{
- if (mi == NULL) {
- printf("No message?\n");
- return;
- }
-
- printf("Subject: %s\n", camel_message_info_subject(mi));
- printf("To: %s\n", camel_message_info_to(mi));
- printf("Cc: %s\n", camel_message_info_cc(mi));
- printf("mailing list: %s\n", camel_message_info_mlist(mi));
- printf("From: %s\n", camel_message_info_from(mi));
- printf("UID: %s\n", camel_message_info_uid(mi));
- printf("Flags: %04x\n", mi->flags & 0xffff);
- camel_content_info_dump(mi->content, 0);
-}
diff --git a/camel/camel-folder-summary.h b/camel/camel-folder-summary.h
deleted file mode 100644
index e57be75ae1..0000000000
--- a/camel/camel-folder-summary.h
+++ /dev/null
@@ -1,350 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef _CAMEL_FOLDER_SUMMARY_H
-#define _CAMEL_FOLDER_SUMMARY_H
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <stdio.h>
-#include <time.h>
-#include <camel/camel-mime-parser.h>
-#include <camel/camel-object.h>
-#include <camel/camel-index.h>
-
-#define CAMEL_FOLDER_SUMMARY(obj) CAMEL_CHECK_CAST (obj, camel_folder_summary_get_type (), CamelFolderSummary)
-#define CAMEL_FOLDER_SUMMARY_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_folder_summary_get_type (), CamelFolderSummaryClass)
-#define CAMEL_IS_FOLDER_SUMMARY(obj) CAMEL_CHECK_TYPE (obj, camel_folder_summary_get_type ())
-
-/*typedef struct _CamelFolderSummary CamelFolderSummary;*/
-typedef struct _CamelFolderSummaryClass CamelFolderSummaryClass;
-
-/* A tree of message content info structures
- describe the content structure of the message (if it has any) */
-struct _CamelMessageContentInfo {
- struct _CamelMessageContentInfo *next;
-
- struct _CamelMessageContentInfo *childs;
- struct _CamelMessageContentInfo *parent;
-
- CamelContentType *type;
- char *id;
- char *description;
- char *encoding; /* this should be an enum?? */
- guint32 size;
-};
-
-/* system flag bits */
-enum _CamelMessageFlags {
- CAMEL_MESSAGE_ANSWERED = 1<<0,
- CAMEL_MESSAGE_DELETED = 1<<1,
- CAMEL_MESSAGE_DRAFT = 1<<2,
- CAMEL_MESSAGE_FLAGGED = 1<<3,
- CAMEL_MESSAGE_SEEN = 1<<4,
- CAMEL_MESSAGE_ATTACHMENTS = 1<<5,
- CAMEL_MESSAGE_ANSWERED_ALL = 1<<6,
- CAMEL_MESSAGE_JUNK = 1<<7,
-
- /* following flags are for the folder, and are not really permanent flags */
- CAMEL_MESSAGE_FOLDER_FLAGGED = 1<<16, /* for use by the folder implementation */
- CAMEL_MESSAGE_USER = 1<<31 /* supports user flags */
-};
-
-typedef struct _CamelFlag {
- struct _CamelFlag *next;
- char name[1]; /* name allocated as part of the structure */
-} CamelFlag;
-
-typedef struct _CamelTag {
- struct _CamelTag *next;
- char *value;
- char name[1]; /* name allocated as part of the structure */
-} CamelTag;
-
-/* a summary messageid is a 64 bit identifier (partial md5 hash) */
-typedef struct _CamelSummaryMessageID {
- union {
- guint64 id;
- unsigned char hash[8];
- struct {
- guint32 hi;
- guint32 lo;
- } part;
- } id;
-} CamelSummaryMessageID;
-
-/* summary references is a fixed size array of references */
-typedef struct _CamelSummaryReferences {
- int size;
- CamelSummaryMessageID references[1];
-} CamelSummaryReferences;
-
-/* #define DOESTRV */
-#define DOEPOOLV
-
-#if defined (DOEPOOLV) || defined (DOESTRV)
-
-/* string array indices */
-enum {
- CAMEL_MESSAGE_INFO_UID,
- CAMEL_MESSAGE_INFO_SUBJECT,
- CAMEL_MESSAGE_INFO_FROM,
- CAMEL_MESSAGE_INFO_TO,
- CAMEL_MESSAGE_INFO_CC,
- CAMEL_MESSAGE_INFO_MLIST,
- CAMEL_MESSAGE_INFO_LAST,
-};
-#endif
-
-/* information about a given object */
-struct _CamelMessageInfo {
- /* public fields */
-#ifdef DOEPOOLV
- struct _EPoolv *strings;
-#elif defined (DOESTRV)
- struct _EStrv *strings; /* all strings packed into a single compact array */
-#else
- char *subject;
- char *from;
- char *to;
- char *cc;
- char *mlist;
-
- char *uid;
-#endif /* DOEPOOLV */
- guint32 flags;
- guint32 size;
- guint32 refcount;
-
- time_t date_sent;
- time_t date_received;
-
- CamelSummaryMessageID message_id;/* for this message */
- CamelSummaryReferences *references;/* from parent to root */
-
- struct _CamelFlag *user_flags;
- struct _CamelTag *user_tags;
-
- /* tree of content description - NULL if it is not available */
- CamelMessageContentInfo *content;
-};
-
-enum _CamelFolderSummaryFlags {
- CAMEL_SUMMARY_DIRTY = 1<<0,
-};
-
-struct _CamelFolderSummary {
- CamelObject parent;
-
- struct _CamelFolderSummaryPrivate *priv;
-
- /* header info */
- guint32 version; /* version of file required, should be set by implementors */
- guint32 flags; /* flags */
- guint32 nextuid; /* next uid? */
- guint32 saved_count; /* how many were saved/loaded */
- time_t time; /* timestamp for this summary (for implementors to use) */
-
- /* sizes of memory objects */
- guint32 message_info_size;
- guint32 content_info_size;
-
-#if defined (DOEPOOLV) || defined (DOESTRV)
- guint32 message_info_strings;
-#endif
- /* memory allocators (setup automatically) */
- struct _EMemChunk *message_info_chunks;
- struct _EMemChunk *content_info_chunks;
-
- char *summary_path;
- gboolean build_content; /* do we try and parse/index the content, or not? */
-
- GPtrArray *messages; /* CamelMessageInfo's */
- GHashTable *messages_uid; /* CamelMessageInfo's by uid */
-};
-
-struct _CamelFolderSummaryClass {
- CamelObjectClass parent_class;
-
- /* load/save the global info */
- int (*summary_header_load)(CamelFolderSummary *, FILE *);
- int (*summary_header_save)(CamelFolderSummary *, FILE *);
-
- /* create/save/load an individual message info */
- CamelMessageInfo * (*message_info_new)(CamelFolderSummary *, struct _camel_header_raw *);
- CamelMessageInfo * (*message_info_new_from_parser)(CamelFolderSummary *, CamelMimeParser *);
- CamelMessageInfo * (*message_info_new_from_message)(CamelFolderSummary *, CamelMimeMessage *);
- CamelMessageInfo * (*message_info_load)(CamelFolderSummary *, FILE *);
- int (*message_info_save)(CamelFolderSummary *, FILE *, CamelMessageInfo *);
- void (*message_info_free)(CamelFolderSummary *, CamelMessageInfo *);
-
- /* save/load individual content info's */
- CamelMessageContentInfo * (*content_info_new)(CamelFolderSummary *, struct _camel_header_raw *);
- CamelMessageContentInfo * (*content_info_new_from_parser)(CamelFolderSummary *, CamelMimeParser *);
- CamelMessageContentInfo * (*content_info_new_from_message)(CamelFolderSummary *, CamelMimePart *);
- CamelMessageContentInfo * (*content_info_load)(CamelFolderSummary *, FILE *);
- int (*content_info_save)(CamelFolderSummary *, FILE *, CamelMessageContentInfo *);
- void (*content_info_free)(CamelFolderSummary *, CamelMessageContentInfo *);
-
- /* get the next uid */
- char *(*next_uid_string)(CamelFolderSummary *);
-};
-
-CamelType camel_folder_summary_get_type (void);
-CamelFolderSummary *camel_folder_summary_new (void);
-
-void camel_folder_summary_set_filename(CamelFolderSummary *, const char *);
-void camel_folder_summary_set_index(CamelFolderSummary *, CamelIndex *);
-void camel_folder_summary_set_build_content(CamelFolderSummary *, gboolean state);
-
-guint32 camel_folder_summary_next_uid (CamelFolderSummary *s);
-char *camel_folder_summary_next_uid_string (CamelFolderSummary *s);
-void camel_folder_summary_set_uid (CamelFolderSummary *s, guint32 uid);
-
-/* load/save the summary in its entirety */
-int camel_folder_summary_load(CamelFolderSummary *);
-int camel_folder_summary_save(CamelFolderSummary *);
-
-/* only load the header */
-int camel_folder_summary_header_load(CamelFolderSummary *);
-
-/* set the dirty bit on the summary */
-void camel_folder_summary_touch(CamelFolderSummary *s);
-
-/* add a new raw summary item */
-void camel_folder_summary_add(CamelFolderSummary *, CamelMessageInfo *info);
-
-/* build/add raw summary items */
-CamelMessageInfo *camel_folder_summary_add_from_header(CamelFolderSummary *, struct _camel_header_raw *);
-CamelMessageInfo *camel_folder_summary_add_from_parser(CamelFolderSummary *, CamelMimeParser *);
-CamelMessageInfo *camel_folder_summary_add_from_message(CamelFolderSummary *, CamelMimeMessage *);
-
-/* Just build raw summary items */
-CamelMessageInfo *camel_folder_summary_info_new(CamelFolderSummary *s);
-CamelMessageInfo *camel_folder_summary_info_new_from_header(CamelFolderSummary *, struct _camel_header_raw *);
-CamelMessageInfo *camel_folder_summary_info_new_from_parser(CamelFolderSummary *, CamelMimeParser *);
-CamelMessageInfo *camel_folder_summary_info_new_from_message(CamelFolderSummary *, CamelMimeMessage *);
-
-void camel_folder_summary_info_ref(CamelFolderSummary *, CamelMessageInfo *);
-void camel_folder_summary_info_free(CamelFolderSummary *, CamelMessageInfo *);
-
-CamelMessageContentInfo *camel_folder_summary_content_info_new(CamelFolderSummary *s);
-void camel_folder_summary_content_info_free(CamelFolderSummary *s, CamelMessageContentInfo *ci);
-
-/* removes a summary item, doesn't fix content offsets */
-void camel_folder_summary_remove(CamelFolderSummary *s, CamelMessageInfo *info);
-void camel_folder_summary_remove_uid(CamelFolderSummary *s, const char *uid);
-void camel_folder_summary_remove_index(CamelFolderSummary *s, int);
-void camel_folder_summary_remove_range(CamelFolderSummary *s, int start, int end);
-/* remove all items */
-void camel_folder_summary_clear(CamelFolderSummary *s);
-
-/* lookup functions */
-int camel_folder_summary_count(CamelFolderSummary *);
-CamelMessageInfo *camel_folder_summary_index(CamelFolderSummary *, int);
-CamelMessageInfo *camel_folder_summary_uid(CamelFolderSummary *, const char *uid);
-GPtrArray *camel_folder_summary_array(CamelFolderSummary *s);
-void camel_folder_summary_array_free(CamelFolderSummary *s, GPtrArray *array);
-
-/* summary formatting utils */
-char *camel_folder_summary_format_address(struct _camel_header_raw *h, const char *name);
-char *camel_folder_summary_format_string(struct _camel_header_raw *h, const char *name);
-
-/* basically like strings, but certain keywords can be compressed and de-cased */
-int camel_folder_summary_encode_token(FILE *, const char *);
-int camel_folder_summary_decode_token(FILE *, char **);
-
-/* message flag operations */
-gboolean camel_flag_get(CamelFlag **list, const char *name);
-gboolean camel_flag_set(CamelFlag **list, const char *name, gboolean state);
-gboolean camel_flag_list_copy(CamelFlag **to, CamelFlag **from);
-int camel_flag_list_size(CamelFlag **list);
-void camel_flag_list_free(CamelFlag **list);
-
-guint32 camel_system_flag (const char *name);
-gboolean camel_system_flag_get (guint32 flags, const char *name);
-
-/* message tag operations */
-const char *camel_tag_get(CamelTag **list, const char *name);
-gboolean camel_tag_set(CamelTag **list, const char *name, const char *value);
-gboolean camel_tag_list_copy(CamelTag **to, CamelTag **from);
-int camel_tag_list_size(CamelTag **list);
-void camel_tag_list_free(CamelTag **list);
-
-/* message info utils for working with pseudo-messageinfo structures
- NOTE: These cannot be added to a real summary object, but suffice for all
- other external interfaces that use message info's */
-CamelMessageInfo *camel_message_info_new(void);
-void camel_message_info_ref(CamelMessageInfo *info);
-CamelMessageInfo *camel_message_info_new_from_header(struct _camel_header_raw *header);
-void camel_message_info_dup_to(const CamelMessageInfo *from, CamelMessageInfo *to);
-void camel_message_info_free(CamelMessageInfo *mi);
-
-/* accessors */
-#if defined (DOEPOOLV) || defined (DOESTRV)
-const char *camel_message_info_string(const CamelMessageInfo *mi, int type);
-#define camel_message_info_subject(x) camel_message_info_string((const CamelMessageInfo *)(x), CAMEL_MESSAGE_INFO_SUBJECT)
-#define camel_message_info_from(x) camel_message_info_string((const CamelMessageInfo *)(x), CAMEL_MESSAGE_INFO_FROM)
-#define camel_message_info_to(x) camel_message_info_string((const CamelMessageInfo *)(x), CAMEL_MESSAGE_INFO_TO)
-#define camel_message_info_cc(x) camel_message_info_string((const CamelMessageInfo *)(x), CAMEL_MESSAGE_INFO_CC)
-#define camel_message_info_uid(x) camel_message_info_string((const CamelMessageInfo *)(x), CAMEL_MESSAGE_INFO_UID)
-#define camel_message_info_mlist(x) camel_message_info_string((const CamelMessageInfo *)(x), CAMEL_MESSAGE_INFO_MLIST)
-
-void camel_message_info_set_string(CamelMessageInfo *mi, int type, char *str);
-#define camel_message_info_set_subject(x, s) camel_message_info_set_string(x, CAMEL_MESSAGE_INFO_SUBJECT, s)
-#define camel_message_info_set_from(x, s) camel_message_info_set_string(x, CAMEL_MESSAGE_INFO_FROM, s)
-#define camel_message_info_set_to(x, s) camel_message_info_set_string(x, CAMEL_MESSAGE_INFO_TO, s)
-#define camel_message_info_set_cc(x, s) camel_message_info_set_string(x, CAMEL_MESSAGE_INFO_CC, s)
-#define camel_message_info_set_uid(x, s) camel_message_info_set_string(x, CAMEL_MESSAGE_INFO_UID, s)
-#define camel_message_info_set_mlist(x, s) camel_message_info_set_string(x, CAMEL_MESSAGE_INFO_MLIST, s)
-
-#else
-
-#define camel_message_info_subject(x) (((CamelMessageInfo *)(x))->subject?((CamelMessageInfo *)(x))->subject:"")
-#define camel_message_info_from(x) (((CamelMessageInfo *)(x))->from?((CamelMessageInfo *)(x))->from:"")
-#define camel_message_info_to(x) (((CamelMessageInfo *)(x))->to?((CamelMessageInfo *)(x))->to:"")
-#define camel_message_info_cc(x) (((CamelMessageInfo *)(x))->cc?((CamelMessageInfo *)(x))->cc:"")
-#define camel_message_info_uid(x) (((CamelMessageInfo *)(x))->uid?((CamelMessageInfo *)(x))->uid:"")
-#define camel_message_info_mlist(x) (((CamelMessageInfo *)(x))->mlist?((CamelMessageInfo *)(x))->mlist:"")
-
-#define camel_message_info_set_subject(x, s) (g_free(((CamelMessageInfo *)(x))->subject),((CamelMessageInfo *)(x))->subject = (s))
-#define camel_message_info_set_from(x, s) (g_free(((CamelMessageInfo *)(x))->from),((CamelMessageInfo *)(x))->from = (s))
-#define camel_message_info_set_to(x, s) (g_free(((CamelMessageInfo *)(x))->to),((CamelMessageInfo *)(x))->to = (s))
-#define camel_message_info_set_cc(x, s) (g_free(((CamelMessageInfo *)(x))->cc),((CamelMessageInfo *)(x))->cc = (s))
-#define camel_message_info_set_uid(x, s) (g_free(((CamelMessageInfo *)(x))->uid),((CamelMessageInfo *)(x))->uid = (s))
-#define camel_message_info_set_mlist(x, s) (g_free(((CamelMessageInfo *)(x))->mlist),((CamelMessageInfo *)(x))->mlist = (s))
-#endif
-
-
-/* debugging functions */
-
-void camel_content_info_dump (CamelMessageContentInfo *ci, int depth);
-
-void camel_message_info_dump (CamelMessageInfo *mi);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* ! _CAMEL_FOLDER_SUMMARY_H */
diff --git a/camel/camel-folder-thread.c b/camel/camel-folder-thread.c
deleted file mode 100644
index a67ab5d5b2..0000000000
--- a/camel/camel-folder-thread.c
+++ /dev/null
@@ -1,861 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-/* TODO: This could probably be made a camel object, but it isn't really required */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <sys/types.h>
-#include <unistd.h>
-#include <errno.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <ctype.h>
-#include <glib.h>
-
-#include "camel-folder-thread.h"
-#include "e-util/e-memory.h"
-
-#define d(x)
-
-/*#define TIMEIT*/
-
-#ifdef TIMEIT
-#include <sys/time.h>
-#include <unistd.h>
-#endif
-
-static void
-container_add_child(CamelFolderThreadNode *node, CamelFolderThreadNode *child)
-{
- d(printf("\nAdding child %p to parent %p \n", child, node));
- child->next = node->child;
- node->child = child;
- child->parent = node;
-}
-
-static void
-container_parent_child(CamelFolderThreadNode *parent, CamelFolderThreadNode *child)
-{
- CamelFolderThreadNode *c, *node;
-
- /* are we already the right parent? */
- if (child->parent == parent)
- return;
-
- /* would this create a loop? */
- node = parent->parent;
- while (node) {
- if (node == child)
- return;
- node = node->parent;
- }
-
- /* are we unparented? */
- if (child->parent == NULL) {
- container_add_child(parent, child);
- return;
- }
-
- /* else remove child from its existing parent, and reparent */
- node = child->parent;
- c = (CamelFolderThreadNode *)&node->child;
- d(printf("scanning children:\n"));
- while (c->next) {
- d(printf(" %p\n", c));
- if (c->next==child) {
- d(printf("found node %p\n", child));
- c->next = c->next->next;
- child->parent = NULL;
- container_add_child(parent, child);
- return;
- }
- c = c->next;
- }
-
- printf("DAMN, we shouldn't be here!\n");
-}
-
-static void
-prune_empty(CamelFolderThread *thread, CamelFolderThreadNode **cp)
-{
- CamelFolderThreadNode *child, *next, *c, *lastc;
-
- /* yes, this is intentional */
- lastc = (CamelFolderThreadNode *)cp;
- while (lastc->next) {
- c = lastc->next;
-
- d(printf("checking message %p %p (%08x%08x)\n", c,
- c->message, c->message?c->message->message_id.id.part.hi:0,
- c->message?c->message->message_id.id.part.lo:0));
- if (c->message == NULL) {
- if (c->child == NULL) {
- d(printf("removing empty node\n"));
- lastc->next = c->next;
- e_memchunk_free(thread->node_chunks, c);
- continue;
- }
- if (c->parent || c->child->next==0) {
- d(printf("promoting child\n"));
- lastc->next = c->next; /* remove us */
- child = c->child;
- while (child) {
- next = child->next;
-
- child->parent = c->parent;
- child->next = lastc->next;
- lastc->next = child;
-
- child = next;
- }
- continue;
- }
- }
- prune_empty(thread, &c->child);
- lastc = c;
- }
-}
-
-static void
-hashloop(void *key, void *value, void *data)
-{
- CamelFolderThreadNode *c = value;
- CamelFolderThreadNode *tail = data;
-
- if (c->parent == NULL) {
- c->next = tail->next;
- tail->next = c;
- }
-}
-
-static char *
-get_root_subject(CamelFolderThreadNode *c, int *re)
-{
- char *s, *p;
- CamelFolderThreadNode *scan;
-
- s = NULL;
- *re = FALSE;
- if (c->message)
- s = (char *)camel_message_info_subject(c->message);
- else {
- /* one of the children will always have a message */
- scan = c->child;
- while (scan) {
- if (scan->message) {
- s = (char *)camel_message_info_subject(scan->message);
- break;
- }
- scan = scan->next;
- }
- }
- if (s != NULL) {
- while (*s) {
- while (isspace(*s))
- s++;
- if (s[0] == 0)
- break;
- if ((s[0] == 'r' || s[0]=='R')
- && (s[1] == 'e' || s[1]=='E')) {
- p = s+2;
- while (isdigit(*p) || (ispunct(*p) && (*p != ':')))
- p++;
- if (*p==':') {
- *re = TRUE;
- s = p+1;
- } else
- break;
- } else
- break;
- }
- if (*s)
- return s;
- }
- return NULL;
-}
-
-/* this can be pretty slow, but not used often */
-/* clast cannot be null */
-static void
-remove_node(CamelFolderThreadNode **list, CamelFolderThreadNode *node, CamelFolderThreadNode **clast)
-{
- CamelFolderThreadNode *c;
-
- /* this is intentional, even if it looks funny */
- /* if we have a parent, then we should remove it from the parent list,
- otherwise we remove it from the root list */
- if (node->parent) {
- c = (CamelFolderThreadNode *)&node->parent->child;
- } else {
- c = (CamelFolderThreadNode *)list;
- }
- while (c->next) {
- if (c->next == node) {
- if (*clast == c->next)
- *clast = c;
- c->next = c->next->next;
- return;
- }
- c = c->next;
- }
-
- printf("ERROR: removing node %p failed\n", node);
-}
-
-static void
-group_root_set(CamelFolderThread *thread, CamelFolderThreadNode **cp)
-{
- GHashTable *subject_table = g_hash_table_new(g_str_hash, g_str_equal);
- CamelFolderThreadNode *c, *clast, *scan, *container;
-
- /* gather subject lines */
- d(printf("gathering subject lines\n"));
- clast = (CamelFolderThreadNode *)cp;
- c = clast->next;
- while (c) {
- c->root_subject = get_root_subject(c, &c->re);
- if (c->root_subject) {
- container = g_hash_table_lookup(subject_table, c->root_subject);
- if (container == NULL
- || (container->message == NULL && c->message)
- || (container->re == TRUE && !c->re)) {
- g_hash_table_insert(subject_table, c->root_subject, c);
- }
- }
- c = c->next;
- }
-
- /* merge common subjects? */
- clast = (CamelFolderThreadNode *)cp;
- while (clast->next) {
- c = clast->next;
- d(printf("checking %p %s\n", c, c->root_subject));
- if (c->root_subject
- && (container = g_hash_table_lookup(subject_table, c->root_subject))
- && (container != c)) {
- d(printf(" matching %p %s\n", container, container->root_subject));
- if (c->message == NULL && container->message == NULL) {
- d(printf("merge containers children\n"));
- /* steal the children from c onto container, and unlink c */
- scan = (CamelFolderThreadNode *)&container->child;
- while (scan->next)
- scan = scan->next;
- scan->next = c->child;
- clast->next = c->next;
- e_memchunk_free(thread->node_chunks, c);
- continue;
- } if (c->message == NULL && container->message != NULL) {
- d(printf("container is non-empty parent\n"));
- remove_node(cp, container, &clast);
- container_add_child(c, container);
- } else if (c->message != NULL && container->message == NULL) {
- d(printf("container is empty child\n"));
- clast->next = c->next;
- container_add_child(container, c);
- continue;
- } else if (c->re && !container->re) {
- d(printf("container is re\n"));
- clast->next = c->next;
- container_add_child(container, c);
- continue;
- } else if (!c->re && container->re) {
- d(printf("container is not re\n"));
- remove_node(cp, container, &clast);
- container_add_child(c, container);
- } else if (c->re && container->re) {
- d(printf("subjects are common %p and %p\n", c, container));
-
- /* build a phantom node */
- remove_node(cp, container, &clast);
- remove_node(cp, c, &clast);
-
- scan = e_memchunk_alloc0(thread->node_chunks);
-
- scan->root_subject = c->root_subject;
- scan->re = c->re && container->re;
- scan->next = c->next;
- clast->next = scan;
- container_add_child(scan, c);
- container_add_child(scan, container);
- clast = scan;
- g_hash_table_insert(subject_table, scan->root_subject, scan);
- continue;
- }
- }
- clast = c;
- }
- g_hash_table_destroy(subject_table);
-}
-
-struct _tree_info {
- GHashTable *visited;
-};
-
-static int
-dump_tree_rec(struct _tree_info *info, CamelFolderThreadNode *c, int depth)
-{
- char *p;
- int count=0;
-
- p = alloca(depth*2+1);
- memset(p, ' ', depth*2);
- p[depth*2] = 0;
-
- while (c) {
- if (g_hash_table_lookup(info->visited, c)) {
- printf("WARNING: NODE REVISITED: %p\n", c);
- } else {
- g_hash_table_insert(info->visited, c, c);
- }
- if (c->message) {
- printf("%s %p Subject: %s <%.8s>\n", p, c, camel_message_info_subject(c->message), c->message->message_id.id.hash);
- count += 1;
- } else {
- printf("%s %p <empty>\n", p, c);
- }
- if (c->child)
- count += dump_tree_rec(info, c->child, depth+1);
- c = c->next;
- }
- return count;
-}
-
-int
-camel_folder_threaded_messages_dump(CamelFolderThreadNode *c)
-{
- int count;
- struct _tree_info info;
-
- info.visited = g_hash_table_new(g_direct_hash, g_direct_equal);
- count = dump_tree_rec(&info, c, 0);
- g_hash_table_destroy(info.visited);
- return count;
-}
-
-static int
-sort_node(const void *a, const void *b)
-{
- const CamelFolderThreadNode *a1 = ((CamelFolderThreadNode **)a)[0];
- const CamelFolderThreadNode *b1 = ((CamelFolderThreadNode **)b)[0];
-
- /* if we have no message, it must be a dummy node, which
- also means it must have a child, just use that as the
- sort data (close enough?) */
- if (a1->message == NULL)
- a1 = a1->child;
- if (b1->message == NULL)
- b1 = b1->child;
- if (a1->order == b1->order)
- return 0;
- if (a1->order < b1->order)
- return -1;
- else
- return 1;
-}
-
-static void
-sort_thread(CamelFolderThreadNode **cp)
-{
- CamelFolderThreadNode *c, *head, **carray;
- int size=0;
-
- c = *cp;
- while (c) {
- /* sort the children while we're at it */
- if (c->child)
- sort_thread(&c->child);
- size++;
- c = c->next;
- }
- if (size<2)
- return;
- carray = alloca(size*sizeof(CamelFolderThreadNode *));
- c = *cp;
- size=0;
- while (c) {
- carray[size] = c;
- c = c->next;
- size++;
- }
- qsort(carray, size, sizeof(CamelFolderThreadNode *), sort_node);
- size--;
- head = carray[size];
- head->next = NULL;
- size--;
- do {
- c = carray[size];
- c->next = head;
- head = c;
- size--;
- } while (size>=0);
- *cp = head;
-}
-
-static guint id_hash(void *key)
-{
- CamelSummaryMessageID *id = (CamelSummaryMessageID *)key;
-
- return id->id.part.lo;
-}
-
-static gint id_equal(void *a, void *b)
-{
- return ((CamelSummaryMessageID *)a)->id.id == ((CamelSummaryMessageID *)b)->id.id;
-}
-
-/* perform actual threading */
-static void
-thread_summary(CamelFolderThread *thread, GPtrArray *summary)
-{
- GHashTable *id_table, *no_id_table;
- int i;
- CamelFolderThreadNode *c, *child, *head;
-#ifdef TIMEIT
- struct timeval start, end;
- unsigned long diff;
-
- gettimeofday(&start, NULL);
-#endif
-
- id_table = g_hash_table_new((GHashFunc)id_hash, (GCompareFunc)id_equal);
- no_id_table = g_hash_table_new(NULL, NULL);
- for (i=0;i<summary->len;i++) {
- CamelMessageInfo *mi = summary->pdata[i];
-
- if (mi->message_id.id.id) {
- c = g_hash_table_lookup(id_table, &mi->message_id);
- /* check for duplicate messages */
- if (c && c->order) {
- /* if duplicate, just make out it is a no-id message, but try and insert it
- into the right spot in the tree */
- d(printf("doing: (duplicate message id)\n"));
- c = e_memchunk_alloc0(thread->node_chunks);
- g_hash_table_insert(no_id_table, (void *)mi, c);
- } else if (!c) {
- d(printf("doing : %08x%08x (%s)\n", mi->message_id.id.part.hi, mi->message_id.id.part.lo, camel_message_info_subject(mi)));
- c = e_memchunk_alloc0(thread->node_chunks);
- g_hash_table_insert(id_table, (void *)&mi->message_id, c);
- }
- } else {
- d(printf("doing : (no message id)\n"));
- c = e_memchunk_alloc0(thread->node_chunks);
- g_hash_table_insert(no_id_table, (void *)mi, c);
- }
-
- c->message = mi;
- c->order = i+1;
- child = c;
- if (mi->references) {
- int j;
-
- d(printf("references:\n"));
- for (j=0;j<mi->references->size;j++) {
- /* should never be empty, but just incase */
- if (mi->references->references[j].id.id == 0)
- continue;
-
- c = g_hash_table_lookup(id_table, &mi->references->references[j]);
- if (c == NULL) {
- d(printf("not found\n"));
- c = e_memchunk_alloc0(thread->node_chunks);
- g_hash_table_insert(id_table, &mi->references->references[j], c);
- }
- if (c!=child)
- container_parent_child(c, child);
- child = c;
- }
- }
- }
-
- d(printf("\n\n"));
- /* build a list of root messages (no parent) */
- head = NULL;
- g_hash_table_foreach(id_table, hashloop, &head);
- g_hash_table_foreach(no_id_table, hashloop, &head);
-
- g_hash_table_destroy(id_table);
- g_hash_table_destroy(no_id_table);
-
- /* remove empty parent nodes */
- prune_empty(thread, &head);
-
- /* find any siblings which missed out - but only if we are allowing threading by subject */
- if (thread->subject)
- group_root_set (thread, &head);
-
-#if 0
- printf("finished\n");
- i = camel_folder_thread_messages_dump(head);
- printf("%d count, %d items in tree\n", uids->len, i);
-#endif
-
- sort_thread(&head);
-
- /* remove any phantom nodes, this could possibly be put in group_root_set()? */
- c = (CamelFolderThreadNode *)&head;
- while (c && c->next) {
- CamelFolderThreadNode *scan, *newtop;
-
- child = c->next;
- if (child->message == NULL) {
- newtop = child->child;
- /* unlink pseudo node */
- c->next = newtop;
-
- /* link its siblings onto the end of its children */
- scan = (CamelFolderThreadNode *)&newtop->child;
- while (scan->next)
- scan = scan->next;
- scan->next = newtop->next;
- /* and link the now 'real' node into the list */
- newtop->next = child->next;
- c = newtop;
- e_memchunk_free(thread->node_chunks, child);
- } else {
- c = child;
- }
- }
-
- /* this is only debug assertion stuff */
- c = (CamelFolderThreadNode *)&head;
- while (c->next) {
- c = c->next;
- if (c->message == NULL)
- g_warning("threading missed removing a pseudo node: %s\n", c->root_subject);
- }
-
- thread->tree = head;
-
-#ifdef TIMEIT
- gettimeofday(&end, NULL);
- diff = end.tv_sec * 1000 + end.tv_usec/1000;
- diff -= start.tv_sec * 1000 + start.tv_usec/1000;
- printf("Message threading %d messages took %ld.%03ld seconds\n",
- summary->len, diff / 1000, diff % 1000);
-#endif
-}
-
-/**
- * camel_folder_thread_messages_new:
- * @folder:
- * @uids: The subset of uid's to thread. If NULL. then thread all
- * uid's in @folder.
- * @thread_subject: thread based on subject also
- *
- * Thread a (subset) of the messages in a folder. And sort the result
- * in summary order.
- *
- * If @thread_subject is %TRUE, messages with
- * related subjects will also be threaded. The default behaviour is to
- * only thread based on message-id.
- *
- * This function is probably to be removed soon.
- *
- * Return value: A CamelFolderThread contianing a tree of CamelFolderThreadNode's
- * which represent the threaded structure of the messages.
- **/
-CamelFolderThread *
-camel_folder_thread_messages_new (CamelFolder *folder, GPtrArray *uids, gboolean thread_subject)
-{
- CamelFolderThread *thread;
- GHashTable *wanted = NULL;
- GPtrArray *summary;
- GPtrArray *fsummary;
- int i;
-
- thread = g_malloc(sizeof(*thread));
- thread->refcount = 1;
- thread->subject = thread_subject;
- thread->tree = NULL;
- thread->node_chunks = e_memchunk_new(32, sizeof(CamelFolderThreadNode));
- thread->folder = folder;
- camel_object_ref((CamelObject *)folder);
-
- /* get all of the summary items of interest in summary order */
- if (uids) {
- wanted = g_hash_table_new(g_str_hash, g_str_equal);
- for (i=0;i<uids->len;i++)
- g_hash_table_insert(wanted, uids->pdata[i], uids->pdata[i]);
- }
-
- fsummary = camel_folder_get_summary(folder);
- thread->summary = summary = g_ptr_array_new();
-
- for (i=0;i<fsummary->len;i++) {
- CamelMessageInfo *info = fsummary->pdata[i];
-
- if (wanted == NULL || g_hash_table_lookup(wanted, camel_message_info_uid(info)) != NULL) {
- camel_folder_ref_message_info(folder, info);
- g_ptr_array_add(summary, info);
- }
- }
-
- camel_folder_free_summary(folder, fsummary);
-
- thread_summary(thread, summary);
-
- g_hash_table_destroy(wanted);
-
- return thread;
-}
-
-/* add any still there, in the existing order */
-static void
-add_present_rec(CamelFolderThread *thread, GHashTable *have, GPtrArray *summary, CamelFolderThreadNode *node)
-{
- while (node) {
- const char *uid = camel_message_info_uid(node->message);
-
- if (g_hash_table_lookup(have, (char *)uid)) {
- g_hash_table_remove(have, (char *)camel_message_info_uid(node->message));
- g_ptr_array_add(summary, (void *) node->message);
- } else {
- camel_folder_free_message_info(thread->folder, (CamelMessageInfo *)node->message);
- }
-
- if (node->child)
- add_present_rec(thread, have, summary, node->child);
- node = node->next;
- }
-}
-
-void
-camel_folder_thread_messages_apply(CamelFolderThread *thread, GPtrArray *uids)
-{
- int i;
- GPtrArray *all;
- GHashTable *table;
- CamelMessageInfo *info;
-
- all = g_ptr_array_new();
- table = g_hash_table_new(g_str_hash, g_str_equal);
- for (i=0;i<uids->len;i++)
- g_hash_table_insert(table, uids->pdata[i], uids->pdata[i]);
-
- add_present_rec(thread, table, all, thread->tree);
-
- /* add any new ones, in supplied order */
- for (i=0;i<uids->len;i++)
- if (g_hash_table_lookup(table, uids->pdata[i]) && (info = camel_folder_get_message_info(thread->folder, uids->pdata[i])))
- g_ptr_array_add(all, info);
-
- g_hash_table_destroy(table);
-
- thread->tree = NULL;
- e_memchunk_destroy(thread->node_chunks);
- thread->node_chunks = e_memchunk_new(32, sizeof(CamelFolderThreadNode));
- thread_summary(thread, all);
-
- g_ptr_array_free(thread->summary, TRUE);
- thread->summary = all;
-}
-
-void
-camel_folder_thread_messages_ref(CamelFolderThread *thread)
-{
- thread->refcount++;
-}
-
-/**
- * camel_folder_thread_messages_unref:
- * @thread:
- *
- * Free all memory associated with the thread descriptor @thread.
- **/
-void
-camel_folder_thread_messages_unref(CamelFolderThread *thread)
-{
- if (thread->refcount > 1) {
- thread->refcount--;
- return;
- }
-
- if (thread->folder) {
- int i;
-
- for (i=0;i<thread->summary->len;i++)
- camel_folder_free_message_info(thread->folder, thread->summary->pdata[i]);
- g_ptr_array_free(thread->summary, TRUE);
- camel_object_unref((CamelObject *)thread->folder);
- }
- e_memchunk_destroy(thread->node_chunks);
- g_free(thread);
-}
-
-#if 0
-/**
- * camel_folder_thread_messages_new_summary:
- * @summary: Array of CamelMessageInfo's to thread.
- *
- * Thread a list of MessageInfo's. The summary must remain valid for the
- * life of the CamelFolderThread created by this function, and it is upto the
- * caller to ensure this.
- *
- * Return value: A CamelFolderThread contianing a tree of CamelFolderThreadNode's
- * which represent the threaded structure of the messages.
- **/
-CamelFolderThread *
-camel_folder_thread_messages_new_summary(GPtrArray *summary)
-{
- CamelFolderThread *thread;
-
-#ifdef TIMEIT
- struct timeval start, end;
- unsigned long diff;
-
- gettimeofday(&start, NULL);
-#endif
-
- thread = g_malloc(sizeof(*thread));
- thread->refcount = 1;
- thread->tree = NULL;
- thread->node_chunks = e_memchunk_new(32, sizeof(CamelFolderThreadNode));
- thread->folder = NULL;
- thread->summary = NULL;
-
- thread_summary(thread, summary);
-
- return thread;
-}
-
-/* scan the list in depth-first fashion */
-static void
-build_summary_rec(GHashTable *have, GPtrArray *summary, CamelFolderThreadNode *node)
-{
- while (node) {
- if (node->message)
- g_hash_table_insert(have, (char *)camel_message_info_uid(node->message), node->message);
- g_ptr_array_add(summary, node);
- if (node->child)
- build_summary_rec(have, summary, node->child);
- node = node->next;
- }
-}
-
-void
-camel_folder_thread_messages_add(CamelFolderThread *thread, GPtrArray *summary)
-{
- GPtrArray *all;
- int i;
- GHashTable *table;
-
- /* Instead of working out all the complex in's and out's of
- trying to do an incremental summary generation, just redo the whole
- thing with the summary in the current order - so it comes out
- in the same order */
-
- all = g_ptr_array_new();
- table = g_hash_table_new(g_str_hash, g_str_equal);
- build_summary_rec(table, all, thread->tree);
- for (i=0;i<summary->len;i++) {
- CamelMessageInfo *info = summary->pdata[i];
-
- /* check its not already there, we dont want duplicates */
- if (g_hash_table_lookup(table, camel_message_info_uid(info)) == NULL)
- g_ptr_array_add(all, info);
- }
- g_hash_table_destroy(table);
-
- /* reset the tree, and rebuild fully */
- thread->tree = NULL;
- e_memchunk_empty(thread->node_chunks);
- thread_summary(thread, all);
-}
-
-static void
-remove_uid_node_rec(CamelFolderThread *thread, GHashTable *table, CamelFolderThreadNode **list, CamelFolderThreadNode *parent)
-{
- CamelFolderThreadNode *prev = NULL;
- CamelFolderThreadNode *node, *next, *child, *rest;
-
- node = (CamelFolderThreadNode *)list;
- next = node->next;
- while (next) {
-
- if (next->child)
- remove_uid_node_rec(thread, table, &next->child, next);
-
- /* do we have a node to remove? */
- if (next->message && g_hash_table_lookup(table, (char *)camel_message_info_uid(node->message))) {
- child = next->child;
- if (child) {
- /*
- node
- next
- child
- lchild
- rest
-
- becomes:
- node
- child
- lchild
- rest
- */
-
- rest = next->next;
- node->next = child;
- e_memchunk_free(thread->node_chunks, next);
- next = child;
- do {
- lchild = child;
- child->parent = parent;
- child = child->next;
- } while (child);
- lchild->next = rest;
- } else {
- /*
- node
- next
- rest
- becomes:
- node
- rest */
- node->next = next->next;
- e_memchunk_free(thread->node_chunks, next);
- next = node->next;
- }
- } else {
- node = next;
- next = node->next;
- }
- }
-}
-
-void
-camel_folder_thread_messages_remove(CamelFolderThread *thread, GPtrArray *uids)
-{
- GHashTable *table;
- int i;
-
- table = g_hash_table_new(g_str_hash, g_str_equal);
- for (i=0;i<uids->len;i++)
- g_hash_table_insert(table, uids->pdata[i], uids->pdata[i]);
-
- remove_uid_node_rec(thread, table, &thread->tree, NULL);
- g_hash_table_destroy(table);
-}
-
-#endif
diff --git a/camel/camel-folder-thread.h b/camel/camel-folder-thread.h
deleted file mode 100644
index 8bb78e27a0..0000000000
--- a/camel/camel-folder-thread.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef _CAMEL_FOLDER_THREAD_H
-#define _CAMEL_FOLDER_THREAD_H
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <camel/camel-folder-summary.h>
-#include <camel/camel-folder.h>
-
-typedef struct _CamelFolderThreadNode {
- struct _CamelFolderThreadNode *next,
- *parent,
- *child;
- const CamelMessageInfo *message;
- char *root_subject; /* cached root equivalent subject */
- int re; /* re version of subject? */
- int order;
-} CamelFolderThreadNode;
-
-typedef struct _CamelFolderThread {
- guint32 refcount : 31;
- guint32 subject : 1;
-
- struct _CamelFolderThreadNode *tree;
- struct _EMemChunk *node_chunks;
- CamelFolder *folder;
- GPtrArray *summary;
-} CamelFolderThread;
-
-/* interface 1: using uid's */
-CamelFolderThread *camel_folder_thread_messages_new(CamelFolder *folder, GPtrArray *uids, gboolean thread_subject);
-void camel_folder_thread_messages_apply(CamelFolderThread *thread, GPtrArray *uids);
-
-/* interface 2: using messageinfo's. Currently disabled. */
-#if 0
-/* new improved interface */
-CamelFolderThread *camel_folder_thread_messages_new_summary(GPtrArray *summary);
-void camel_folder_thread_messages_add(CamelFolderThread *thread, GPtrArray *summary);
-void camel_folder_thread_messages_remove(CamelFolderThread *thread, GPtrArray *uids);
-#endif
-
-void camel_folder_thread_messages_ref(CamelFolderThread *threads);
-void camel_folder_thread_messages_unref(CamelFolderThread *threads);
-
-/* debugging function only */
-int camel_folder_threaded_messages_dump(CamelFolderThreadNode *c);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* !_CAMEL_FOLDER_THREAD_H */
diff --git a/camel/camel-folder.c b/camel/camel-folder.c
deleted file mode 100644
index 08fd816d97..0000000000
--- a/camel/camel-folder.c
+++ /dev/null
@@ -1,2161 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-folder.c: Abstract class for an email folder */
-
-/*
- * Author:
- * Bertrand Guiheneuf <bertrand@helixcode.com>
- *
- * Copyright 1999-2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-
-#include "camel-folder.h"
-#include "camel-exception.h"
-#include "camel-store.h"
-#include "camel-mime-message.h"
-
-#include "e-util/e-memory.h"
-#include "camel-operation.h"
-
-#include "camel-session.h"
-#include "camel-filter-driver.h"
-#include "camel-private.h"
-#include "camel-vtrash-folder.h"
-#include "filter/filter-rule.h"
-
-#define d(x)
-#define w(x)
-
-static CamelObjectClass *parent_class = NULL;
-
-/* Returns the class for a CamelFolder */
-#define CF_CLASS(so) ((CamelFolderClass *)((CamelObject *)(so))->klass)
-
-static void camel_folder_finalize (CamelObject *object);
-
-static void refresh_info (CamelFolder *folder, CamelException *ex);
-
-static void folder_sync (CamelFolder *folder, gboolean expunge,
- CamelException *ex);
-
-static const gchar *get_name (CamelFolder *folder);
-static const gchar *get_full_name (CamelFolder *folder);
-static CamelStore *get_parent_store (CamelFolder *folder);
-
-static guint32 get_permanent_flags (CamelFolder *folder);
-static guint32 get_message_flags (CamelFolder *folder, const char *uid);
-static void set_message_flags (CamelFolder *folder, const char *uid,
- guint32 flags, guint32 set);
-static gboolean get_message_user_flag (CamelFolder *folder, const char *uid, const char *name);
-static void set_message_user_flag (CamelFolder *folder, const char *uid,
- const char *name, gboolean value);
-static const char *get_message_user_tag(CamelFolder *folder, const char *uid, const char *name);
-static void set_message_user_tag(CamelFolder *folder, const char *uid, const char *name, const char *value);
-
-static gint get_message_count (CamelFolder *folder);
-static gint get_unread_message_count (CamelFolder *folder);
-
-static void expunge (CamelFolder *folder,
- CamelException *ex);
-static int folder_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args);
-static void folder_free(CamelObject *o, guint32 tag, void *val);
-
-
-static void append_message (CamelFolder *folder, CamelMimeMessage *message,
- const CamelMessageInfo *info, char **appended_uid,
- CamelException *ex);
-
-
-static GPtrArray *get_uids (CamelFolder *folder);
-static void free_uids (CamelFolder *folder,
- GPtrArray *array);
-static GPtrArray *get_summary (CamelFolder *folder);
-static void free_summary (CamelFolder *folder,
- GPtrArray *array);
-
-static CamelMimeMessage *get_message (CamelFolder *folder, const gchar *uid, CamelException *ex);
-
-static CamelMessageInfo *get_message_info (CamelFolder *folder, const char *uid);
-static void free_message_info (CamelFolder *folder, CamelMessageInfo *info);
-static void ref_message_info (CamelFolder *folder, CamelMessageInfo *info);
-
-static GPtrArray *search_by_expression (CamelFolder *folder, const char *exp, CamelException *ex);
-static GPtrArray *search_by_uids (CamelFolder *folder, const char *exp, GPtrArray *uids, CamelException *ex);
-static void search_free (CamelFolder * folder, GPtrArray *result);
-
-static void transfer_messages_to (CamelFolder *source, GPtrArray *uids, CamelFolder *dest,
- GPtrArray **transferred_uids, gboolean delete_originals, CamelException *ex);
-
-static void delete (CamelFolder *folder);
-static void folder_rename (CamelFolder *folder, const char *new);
-
-static void freeze (CamelFolder *folder);
-static void thaw (CamelFolder *folder);
-static gboolean is_frozen (CamelFolder *folder);
-
-static gboolean folder_changed (CamelObject *object,
- gpointer event_data);
-static gboolean message_changed (CamelObject *object,
- /*const char *uid*/gpointer event_data);
-
-static void
-camel_folder_class_init (CamelFolderClass *camel_folder_class)
-{
- CamelObjectClass *camel_object_class = CAMEL_OBJECT_CLASS (camel_folder_class);
-
- parent_class = camel_type_get_global_classfuncs (camel_object_get_type ());
-
- /* virtual method definition */
- camel_folder_class->sync = folder_sync;
- camel_folder_class->refresh_info = refresh_info;
- camel_folder_class->get_name = get_name;
- camel_folder_class->get_full_name = get_full_name;
- camel_folder_class->get_parent_store = get_parent_store;
- camel_folder_class->expunge = expunge;
- camel_folder_class->get_message_count = get_message_count;
- camel_folder_class->get_unread_message_count = get_unread_message_count;
- camel_folder_class->append_message = append_message;
- camel_folder_class->get_permanent_flags = get_permanent_flags;
- camel_folder_class->get_message_flags = get_message_flags;
- camel_folder_class->set_message_flags = set_message_flags;
- camel_folder_class->get_message_user_flag = get_message_user_flag;
- camel_folder_class->set_message_user_flag = set_message_user_flag;
- camel_folder_class->get_message_user_tag = get_message_user_tag;
- camel_folder_class->set_message_user_tag = set_message_user_tag;
- camel_folder_class->get_message = get_message;
- camel_folder_class->get_uids = get_uids;
- camel_folder_class->free_uids = free_uids;
- camel_folder_class->get_summary = get_summary;
- camel_folder_class->free_summary = free_summary;
- camel_folder_class->search_by_expression = search_by_expression;
- camel_folder_class->search_by_uids = search_by_uids;
- camel_folder_class->search_free = search_free;
- camel_folder_class->get_message_info = get_message_info;
- camel_folder_class->ref_message_info = ref_message_info;
- camel_folder_class->free_message_info = free_message_info;
- camel_folder_class->transfer_messages_to = transfer_messages_to;
- camel_folder_class->delete = delete;
- camel_folder_class->rename = folder_rename;
- camel_folder_class->freeze = freeze;
- camel_folder_class->thaw = thaw;
- camel_folder_class->is_frozen = is_frozen;
-
- /* virtual method overload */
- camel_object_class->getv = folder_getv;
- camel_object_class->free = folder_free;
-
- /* events */
- camel_object_class_add_event(camel_object_class, "folder_changed", folder_changed);
- camel_object_class_add_event(camel_object_class, "message_changed", message_changed);
- camel_object_class_add_event(camel_object_class, "deleted", NULL);
- camel_object_class_add_event(camel_object_class, "renamed", NULL);
-}
-
-static void
-camel_folder_init (gpointer object, gpointer klass)
-{
- CamelFolder *folder = object;
-
- folder->priv = g_malloc0(sizeof(*folder->priv));
- folder->priv->frozen = 0;
- folder->priv->changed_frozen = camel_folder_change_info_new();
- folder->priv->lock = e_mutex_new(E_MUTEX_REC);
- folder->priv->change_lock = e_mutex_new(E_MUTEX_SIMPLE);
-}
-
-static void
-camel_folder_finalize (CamelObject *object)
-{
- CamelFolder *camel_folder = CAMEL_FOLDER (object);
- struct _CamelFolderPrivate *p = camel_folder->priv;
-
- g_free(camel_folder->name);
- g_free(camel_folder->full_name);
- g_free(camel_folder->description);
-
- if (camel_folder->parent_store)
- camel_object_unref (camel_folder->parent_store);
-
- if (camel_folder->summary)
- camel_object_unref (camel_folder->summary);
-
- camel_folder_change_info_free(p->changed_frozen);
-
- e_mutex_destroy(p->lock);
- e_mutex_destroy(p->change_lock);
-
- g_free(p);
-}
-
-CamelType
-camel_folder_get_type (void)
-{
- static CamelType camel_folder_type = CAMEL_INVALID_TYPE;
-
- if (camel_folder_type == CAMEL_INVALID_TYPE) {
- camel_folder_type = camel_type_register (CAMEL_OBJECT_TYPE, "CamelFolder",
- sizeof (CamelFolder),
- sizeof (CamelFolderClass),
- (CamelObjectClassInitFunc) camel_folder_class_init,
- NULL,
- (CamelObjectInitFunc) camel_folder_init,
- (CamelObjectFinalizeFunc) camel_folder_finalize );
- }
-
- return camel_folder_type;
-}
-
-
-/**
- * camel_folder_construct:
- * @folder: folder object to construct
- * @parent_store: parent store object of the folder
- * @full_name: full name of the folder
- * @name: short name of the folder
- *
- * Initalizes the folder by setting the parent store and name.
- **/
-void
-camel_folder_construct (CamelFolder *folder, CamelStore *parent_store,
- const char *full_name, const char *name)
-{
- g_return_if_fail (CAMEL_IS_FOLDER (folder));
- g_return_if_fail (CAMEL_IS_STORE (parent_store));
- g_return_if_fail (folder->parent_store == NULL);
- g_return_if_fail (folder->name == NULL);
-
- folder->parent_store = parent_store;
- if (parent_store)
- camel_object_ref(parent_store);
-
- folder->name = g_strdup (name);
- folder->full_name = g_strdup (full_name);
-}
-
-
-static void
-folder_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
-{
- w(g_warning ("CamelFolder::sync not implemented for `%s'",
- camel_type_to_name (CAMEL_OBJECT_GET_TYPE (folder))));
-}
-
-/**
- * camel_folder_sync:
- * @folder: The folder object
- * @expunge: whether or not to expunge deleted messages
- * @ex: exception object
- *
- * Sync changes made to a folder to its backing store, possibly expunging
- * deleted messages as well.
- **/
-void
-camel_folder_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
-{
- g_return_if_fail (CAMEL_IS_FOLDER (folder));
-
- CAMEL_FOLDER_LOCK(folder, lock);
-
- if (!(folder->folder_flags & CAMEL_FOLDER_HAS_BEEN_DELETED))
- CF_CLASS (folder)->sync (folder, expunge, ex);
-
- CAMEL_FOLDER_UNLOCK(folder, lock);
-}
-
-
-static void
-refresh_info (CamelFolder *folder, CamelException *ex)
-{
- /* No op */
-}
-
-/**
- * camel_folder_refresh_info:
- * @folder: The folder object
- * @ex: exception object
- *
- * Updates a folder's summary to be in sync with its backing store.
- **/
-void
-camel_folder_refresh_info (CamelFolder *folder, CamelException *ex)
-{
- g_return_if_fail (CAMEL_IS_FOLDER (folder));
-
- CAMEL_FOLDER_LOCK(folder, lock);
-
- CF_CLASS (folder)->refresh_info (folder, ex);
-
- CAMEL_FOLDER_UNLOCK(folder, lock);
-}
-
-static int
-folder_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args)
-{
- CamelFolder *folder = (CamelFolder *)object;
- int i;
- guint32 tag;
-
- for (i=0;i<args->argc;i++) {
- CamelArgGet *arg = &args->argv[i];
-
- tag = arg->tag;
-
- switch (tag & CAMEL_ARG_TAG) {
- /* CamelObject args */
- case CAMEL_OBJECT_ARG_DESCRIPTION:
- if (folder->description == NULL)
- folder->description = g_strdup_printf("%s", folder->full_name);
- *arg->ca_str = folder->description;
- break;
-
- /* CamelFolder args */
- case CAMEL_FOLDER_ARG_NAME:
- *arg->ca_str = folder->name;
- break;
- case CAMEL_FOLDER_ARG_FULL_NAME:
- *arg->ca_str = folder->full_name;
- break;
- case CAMEL_FOLDER_ARG_STORE:
- *arg->ca_object = folder->parent_store;
- break;
- case CAMEL_FOLDER_ARG_PERMANENTFLAGS:
- *arg->ca_int = folder->permanent_flags;
- break;
- case CAMEL_FOLDER_ARG_TOTAL:
- *arg->ca_int = camel_folder_summary_count(folder->summary);
- break;
- case CAMEL_FOLDER_ARG_UNREAD: {
- int j, unread = 0, count;
- CamelMessageInfo *info;
-
- count = camel_folder_summary_count(folder->summary);
- for (j=0; j<count; j++) {
- if ((info = camel_folder_summary_index(folder->summary, j))) {
- if (!(info->flags & CAMEL_MESSAGE_SEEN))
- unread++;
- camel_folder_summary_info_free(folder->summary, info);
- }
- }
-
- *arg->ca_int = unread;
- break; }
- case CAMEL_FOLDER_ARG_UID_ARRAY: {
- int j, count;
- CamelMessageInfo *info;
- GPtrArray *array;
-
- count = camel_folder_summary_count(folder->summary);
- array = g_ptr_array_new();
- g_ptr_array_set_size(array, count);
- for (j=0; j<count; j++) {
- if ((info = camel_folder_summary_index(folder->summary, j))) {
- array->pdata[i] = g_strdup(camel_message_info_uid(info));
- camel_folder_summary_info_free(folder->summary, info);
- }
- }
- *arg->ca_ptr = array;
- break; }
- case CAMEL_FOLDER_ARG_INFO_ARRAY:
- *arg->ca_ptr = camel_folder_summary_array(folder->summary);
- break;
- case CAMEL_FOLDER_ARG_PROPERTIES:
- *arg->ca_ptr = NULL;
- break;
- default:
- continue;
- }
-
- arg->tag = (tag & CAMEL_ARG_TYPE) | CAMEL_ARG_IGNORE;
- }
-
- return parent_class->getv(object, ex, args);
-}
-
-static void
-folder_free(CamelObject *o, guint32 tag, void *val)
-{
- CamelFolder *folder = (CamelFolder *)o;
-
- switch (tag & CAMEL_ARG_TAG) {
- case CAMEL_FOLDER_ARG_UID_ARRAY: {
- GPtrArray *array = val;
- int i;
-
- for (i=0; i<array->len; i++)
- g_free(array->pdata[i]);
- g_ptr_array_free(array, TRUE);
- break; }
- case CAMEL_FOLDER_ARG_INFO_ARRAY:
- camel_folder_summary_array_free(folder->summary, val);
- break;
- case CAMEL_FOLDER_ARG_PROPERTIES:
- g_slist_free(val);
- break;
- default:
- parent_class->free(o, tag, val);
- }
-}
-
-static const char *
-get_name (CamelFolder *folder)
-{
- return folder->name;
-}
-
-/**
- * camel_folder_get_name:
- * @folder: a folder
- *
- * Get the (short) name of the folder. The fully qualified name
- * can be obtained with the get_full_name method.
- *
- * Return value: name of the folder
- **/
-const char *
-camel_folder_get_name (CamelFolder * folder)
-{
- g_return_val_if_fail (CAMEL_IS_FOLDER (folder), NULL);
-
- return CF_CLASS (folder)->get_name (folder);
-}
-
-
-static const char *
-get_full_name (CamelFolder *folder)
-{
- return folder->full_name;
-}
-
-/**
- * camel_folder_get_full_name:
- * @folder: a folder
- *
- * Get the (full) name of the folder.
- *
- * Return value: full name of the folder
- **/
-const char *
-camel_folder_get_full_name (CamelFolder *folder)
-{
- g_return_val_if_fail (CAMEL_IS_FOLDER (folder), NULL);
-
- return CF_CLASS (folder)->get_full_name (folder);
-}
-
-
-static CamelStore *
-get_parent_store (CamelFolder * folder)
-{
- return folder->parent_store;
-}
-
-/**
- * camel_folder_get_parent_store:
- * @folder: folder to get the parent of
- *
- * Return value: the parent store of the folder.
- **/
-CamelStore *
-camel_folder_get_parent_store (CamelFolder *folder)
-{
- g_return_val_if_fail (CAMEL_IS_FOLDER (folder), NULL);
-
- return CF_CLASS (folder)->get_parent_store (folder);
-}
-
-
-static void
-expunge (CamelFolder *folder, CamelException *ex)
-{
- w(g_warning ("CamelFolder::expunge not implemented for `%s'",
- camel_type_to_name (CAMEL_OBJECT_GET_TYPE (folder))));
-}
-
-
-/**
- * camel_folder_expunge:
- * @folder: the folder
- * @ex: a CamelException
- *
- * Delete messages which have been marked as "DELETED"
- **/
-void
-camel_folder_expunge (CamelFolder *folder, CamelException *ex)
-{
- g_return_if_fail (CAMEL_IS_FOLDER (folder));
-
- CAMEL_FOLDER_LOCK(folder, lock);
-
- if (!(folder->folder_flags & CAMEL_FOLDER_HAS_BEEN_DELETED))
- CF_CLASS (folder)->expunge (folder, ex);
-
- CAMEL_FOLDER_UNLOCK(folder, lock);
-}
-
-static int
-get_message_count (CamelFolder *folder)
-{
- g_return_val_if_fail(folder->summary != NULL, -1);
-
- return camel_folder_summary_count(folder->summary);
-}
-
-/**
- * camel_folder_get_message_count:
- * @folder: A CamelFolder object
- *
- * Return value: the number of messages in the folder, or -1 if unknown.
- **/
-int
-camel_folder_get_message_count (CamelFolder *folder)
-{
- int ret;
-
- g_return_val_if_fail (CAMEL_IS_FOLDER (folder), -1);
-
- ret = CF_CLASS (folder)->get_message_count (folder);
-
- return ret;
-}
-
-static int
-get_unread_message_count(CamelFolder *folder)
-{
- int i, count, unread=0;
-
- g_return_val_if_fail(folder->summary != NULL, -1);
-
- count = camel_folder_summary_count(folder->summary);
- for (i=0; i<count; i++) {
- CamelMessageInfo *info = camel_folder_summary_index(folder->summary, i);
-
- if (info) {
- if (!(info->flags & CAMEL_MESSAGE_SEEN) && (!(info->flags & CAMEL_MESSAGE_JUNK) || (folder->folder_flags & CAMEL_FOLDER_IS_JUNK)))
- unread++;
- camel_folder_summary_info_free(folder->summary, info);
- }
- }
-
- return unread;
-}
-
-/**
- * camel_folder_unread_get_message_count:
- * @folder: A CamelFolder object
- *
- * Return value: the number of unread messages in the folder, or -1 if unknown.
- **/
-int
-camel_folder_get_unread_message_count (CamelFolder *folder)
-{
- int ret;
-
- g_return_val_if_fail (CAMEL_IS_FOLDER (folder), -1);
-
- ret = CF_CLASS (folder)->get_unread_message_count (folder);
-
- return ret;
-}
-
-static void
-append_message (CamelFolder *folder, CamelMimeMessage *message,
- const CamelMessageInfo *info, char **appended_uid,
- CamelException *ex)
-{
- camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID,
- _("Unsupported operation: append message: for %s"),
- camel_type_to_name (CAMEL_OBJECT_GET_TYPE (folder)));
-
- w(g_warning ("CamelFolder::append_message not implemented for `%s'",
- camel_type_to_name (CAMEL_OBJECT_GET_TYPE (folder))));
-
- return;
-
-}
-
-/**
- * camel_folder_append_message: add a message to a folder
- * @folder: folder object to add the message to
- * @message: message object
- * @info: message info with additional flags/etc to set on
- * new message, or %NULL
- * @appended_uid: if non-%NULL, the UID of the appended message will
- * be returned here, if it is known.
- * @ex: exception object
- *
- * Add a message to a folder. Only the flag and tag data from @info
- * is used. If @info is %NULL, no flags or tags will be set.
- **/
-void
-camel_folder_append_message (CamelFolder *folder, CamelMimeMessage *message,
- const CamelMessageInfo *info, char **appended_uid,
- CamelException *ex)
-{
- g_return_if_fail (CAMEL_IS_FOLDER (folder));
-
- CAMEL_FOLDER_LOCK(folder, lock);
-
- CF_CLASS (folder)->append_message (folder, message, info, appended_uid, ex);
-
- CAMEL_FOLDER_UNLOCK(folder, lock);
-}
-
-
-static guint32
-get_permanent_flags (CamelFolder *folder)
-{
- return folder->permanent_flags;
-}
-
-/**
- * camel_folder_get_permanent_flags:
- * @folder: a CamelFolder
- *
- * Return value: the set of CamelMessageFlags that can be permanently
- * stored on a message between sessions. If it includes %CAMEL_FLAG_USER,
- * then user-defined flags will be remembered.
- **/
-guint32
-camel_folder_get_permanent_flags (CamelFolder *folder)
-{
- g_return_val_if_fail (CAMEL_IS_FOLDER (folder), 0);
-
- return CF_CLASS (folder)->get_permanent_flags (folder);
-}
-
-static guint32
-get_message_flags(CamelFolder *folder, const char *uid)
-{
- CamelMessageInfo *info;
- guint32 flags;
-
- g_return_val_if_fail(folder->summary != NULL, 0);
-
- info = camel_folder_summary_uid(folder->summary, uid);
- if (info == NULL)
- return 0;
-
- flags = info->flags;
- camel_folder_summary_info_free(folder->summary, info);
-
- return flags;
-}
-
-/**
- * camel_folder_get_message_flags:
- * @folder: a CamelFolder
- * @uid: the UID of a message in @folder
- *
- * Return value: the CamelMessageFlags that are set on the indicated
- * message.
- **/
-guint32
-camel_folder_get_message_flags (CamelFolder *folder, const char *uid)
-{
- guint32 ret;
-
- g_return_val_if_fail (CAMEL_IS_FOLDER (folder), 0);
-
- ret = CF_CLASS (folder)->get_message_flags (folder, uid);
-
- return ret;
-}
-
-static void
-set_message_flags(CamelFolder *folder, const char *uid, guint32 flags, guint32 set)
-{
- CamelMessageInfo *info;
- guint32 new;
-
- g_return_if_fail(folder->summary != NULL);
-
- info = camel_folder_summary_uid(folder->summary, uid);
- if (info == NULL)
- return;
-
- new = (info->flags & ~flags) | (set & flags);
- if (new == info->flags) {
- camel_folder_summary_info_free(folder->summary, info);
- return;
- }
-
- info->flags = new | CAMEL_MESSAGE_FOLDER_FLAGGED;
- camel_folder_summary_touch(folder->summary);
- camel_folder_summary_info_free(folder->summary, info);
-
- camel_object_trigger_event (folder, "message_changed", (char *) uid);
-}
-
-/**
- * camel_folder_set_message_flags:
- * @folder: a CamelFolder
- * @uid: the UID of a message in @folder
- * @flags: a set of CamelMessageFlag values to set
- * @set: the mask of values in @flags to use.
- *
- * Sets those flags specified by @set to the values specified by @flags
- * on the indicated message. (This may or may not persist after the
- * folder or store is closed. See camel_folder_get_permanent_flags().)
- **/
-void
-camel_folder_set_message_flags (CamelFolder *folder, const char *uid,
- guint32 flags, guint32 set)
-{
- g_return_if_fail (CAMEL_IS_FOLDER (folder));
-
- CF_CLASS (folder)->set_message_flags (folder, uid, flags, set);
-}
-
-
-static gboolean
-get_message_user_flag(CamelFolder *folder, const char *uid, const char *name)
-{
- CamelMessageInfo *info;
- gboolean ret;
-
- g_return_val_if_fail(folder->summary != NULL, FALSE);
-
- info = camel_folder_summary_uid(folder->summary, uid);
- if (info == NULL)
- return FALSE;
-
- ret = camel_flag_get(&info->user_flags, name);
- camel_folder_summary_info_free(folder->summary, info);
-
- return ret;
-}
-
-/**
- * camel_folder_get_message_user_flag:
- * @folder: a CamelFolder
- * @uid: the UID of a message in @folder
- * @name: the name of a user flag
- *
- * Return value: whether or not the given user flag is set on the message.
- **/
-gboolean
-camel_folder_get_message_user_flag (CamelFolder *folder, const char *uid,
- const char *name)
-{
- gboolean ret;
-
- g_return_val_if_fail (CAMEL_IS_FOLDER (folder), 0);
-
- ret = CF_CLASS (folder)->get_message_user_flag (folder, uid, name);
-
- return ret;
-}
-
-static void
-set_message_user_flag(CamelFolder *folder, const char *uid, const char *name, gboolean value)
-{
- CamelMessageInfo *info;
-
- g_return_if_fail(folder->summary != NULL);
-
- info = camel_folder_summary_uid(folder->summary, uid);
- if (info == NULL)
- return;
-
- if (camel_flag_set(&info->user_flags, name, value)) {
- info->flags |= CAMEL_MESSAGE_FOLDER_FLAGGED;
- camel_folder_summary_touch(folder->summary);
- camel_object_trigger_event (folder, "message_changed", (char *) uid);
- }
- camel_folder_summary_info_free(folder->summary, info);
-}
-
-/**
- * camel_folder_set_message_user_flag:
- * @folder: a CamelFolder
- * @uid: the UID of a message in @folder
- * @name: the name of the user flag to set
- * @value: the value to set it to
- *
- * Sets the user flag specified by @name to the value specified by @value
- * on the indicated message. (This may or may not persist after the
- * folder or store is closed. See camel_folder_get_permanent_flags().)
- **/
-void
-camel_folder_set_message_user_flag (CamelFolder *folder, const char *uid,
- const char *name, gboolean value)
-{
- g_return_if_fail (CAMEL_IS_FOLDER (folder));
-
- CF_CLASS (folder)->set_message_user_flag (folder, uid, name, value);
-}
-
-static const char *
-get_message_user_tag(CamelFolder *folder, const char *uid, const char *name)
-{
- CamelMessageInfo *info;
- const char *ret;
-
- g_return_val_if_fail(folder->summary != NULL, NULL);
-
- info = camel_folder_summary_uid(folder->summary, uid);
- if (info == NULL)
- return NULL;
-
- /* FIXME: Need to duplicate tag string */
-
- ret = camel_tag_get(&info->user_tags, name);
- camel_folder_summary_info_free(folder->summary, info);
-
- return ret;
-}
-
-/**
- * camel_folder_get_message_user_tag:
- * @folder: a CamelFolder
- * @uid: the UID of a message in @folder
- * @name: the name of a user tag
- *
- * Return value: Returns the value of the user tag.
- **/
-const char *
-camel_folder_get_message_user_tag (CamelFolder *folder, const char *uid, const char *name)
-{
- const char *ret;
-
- g_return_val_if_fail (CAMEL_IS_FOLDER (folder), 0);
-
- /* FIXME: should duplicate string */
- ret = CF_CLASS (folder)->get_message_user_tag (folder, uid, name);
-
- return ret;
-}
-
-static void
-set_message_user_tag(CamelFolder *folder, const char *uid, const char *name, const char *value)
-{
- CamelMessageInfo *info;
-
- g_return_if_fail(folder->summary != NULL);
-
- info = camel_folder_summary_uid(folder->summary, uid);
- if (info == NULL)
- return;
-
- if (camel_tag_set(&info->user_tags, name, value)) {
- info->flags |= CAMEL_MESSAGE_FOLDER_FLAGGED;
- camel_folder_summary_touch(folder->summary);
- camel_object_trigger_event (folder, "message_changed", (char *) uid);
- }
- camel_folder_summary_info_free(folder->summary, info);
-}
-
-/**
- * camel_folder_set_message_user_tag:
- * @folder: a CamelFolder
- * @uid: the UID of a message in @folder
- * @name: the name of the user tag to set
- * @value: the value to set it to
- *
- * Sets the user tag specified by @name to the value specified by @value
- * on the indicated message. (This may or may not persist after the
- * folder or store is closed. See camel_folder_get_permanent_flags().)
- **/
-void
-camel_folder_set_message_user_tag (CamelFolder *folder, const char *uid, const char *name, const char *value)
-{
- g_return_if_fail (CAMEL_IS_FOLDER (folder));
-
- CF_CLASS (folder)->set_message_user_tag (folder, uid, name, value);
-}
-
-static CamelMessageInfo *
-get_message_info (CamelFolder *folder, const char *uid)
-{
- g_return_val_if_fail(folder->summary != NULL, NULL);
-
- return camel_folder_summary_uid(folder->summary, uid);
-}
-
-/**
- * camel_folder_get_message_info:
- * @folder: a CamelFolder
- * @uid: the uid of a message
- *
- * Retrieve the CamelMessageInfo for the specified @uid. This return
- * must be freed using free_message_info().
- *
- * Return value: the summary information for the indicated message, or NULL
- * if the uid does not exist.
- **/
-CamelMessageInfo *
-camel_folder_get_message_info (CamelFolder *folder, const char *uid)
-{
- CamelMessageInfo *ret;
-
- g_return_val_if_fail (CAMEL_IS_FOLDER (folder), NULL);
- g_return_val_if_fail (uid != NULL, NULL);
-
- ret = CF_CLASS (folder)->get_message_info (folder, uid);
-
- return ret;
-}
-
-static void
-free_message_info (CamelFolder *folder, CamelMessageInfo *info)
-{
- g_return_if_fail(folder->summary != NULL);
-
- camel_folder_summary_info_free(folder->summary, info);
-}
-
-/**
- * camel_folder_free_message_info:
- * @folder:
- * @info:
- *
- * Free (unref) a CamelMessageInfo, previously obtained with get_message_info().
- **/
-void
-camel_folder_free_message_info(CamelFolder *folder, CamelMessageInfo *info)
-{
- g_return_if_fail(CAMEL_IS_FOLDER (folder));
- g_return_if_fail(info != NULL);
-
- CF_CLASS (folder)->free_message_info(folder, info);
-}
-
-static void
-ref_message_info (CamelFolder *folder, CamelMessageInfo *info)
-{
- g_return_if_fail(folder->summary != NULL);
-
- camel_folder_summary_info_ref(folder->summary, info);
-}
-
-/**
- * camel_folder_ref_message_info:
- * @folder:
- * @info:
- *
- * Ref a CamelMessageInfo, previously obtained with get_message_info().
- **/
-void
-camel_folder_ref_message_info(CamelFolder *folder, CamelMessageInfo *info)
-{
- g_return_if_fail(CAMEL_IS_FOLDER (folder));
- g_return_if_fail(info != NULL);
-
- CF_CLASS (folder)->ref_message_info(folder, info);
-}
-
-/* TODO: is this function required anyway? */
-gboolean
-camel_folder_has_summary_capability (CamelFolder *folder)
-{
- g_return_val_if_fail (CAMEL_IS_FOLDER (folder), FALSE);
-
- return folder->folder_flags & CAMEL_FOLDER_HAS_SUMMARY_CAPABILITY;
-}
-
-
-/* UIDs stuff */
-
-static CamelMimeMessage *
-get_message (CamelFolder *folder, const gchar *uid, CamelException *ex)
-{
- w(g_warning ("CamelFolder::get_message not implemented for `%s'",
- camel_type_to_name (CAMEL_OBJECT_GET_TYPE (folder))));
-
- return NULL;
-}
-
-/**
- * camel_folder_get_message:
- * @folder: the folder object
- * @uid: the UID
- * @ex: a CamelException
- *
- * Get a message from its UID in the folder. Messages are cached
- * within a folder, that is, asking twice for the same UID returns the
- * same message object. (FIXME: is this true?)
- *
- * Return value: Message corresponding to the UID
- **/
-CamelMimeMessage *
-camel_folder_get_message (CamelFolder *folder, const gchar *uid, CamelException *ex)
-{
- CamelMimeMessage *ret;
-
- g_return_val_if_fail (CAMEL_IS_FOLDER (folder), NULL);
-
- CAMEL_FOLDER_LOCK(folder, lock);
-
- ret = CF_CLASS (folder)->get_message (folder, uid, ex);
-
- CAMEL_FOLDER_UNLOCK(folder, lock);
-
- return ret;
-}
-
-static GPtrArray *
-get_uids(CamelFolder *folder)
-{
- GPtrArray *array;
- int i, j, count;
-
- array = g_ptr_array_new();
-
- g_return_val_if_fail(folder->summary != NULL, array);
-
- count = camel_folder_summary_count(folder->summary);
- g_ptr_array_set_size(array, count);
- for (i = 0, j = 0; i < count; i++) {
- CamelMessageInfo *info = camel_folder_summary_index(folder->summary, i);
-
- if (info) {
- array->pdata[j++] = g_strdup (camel_message_info_uid (info));
- camel_folder_summary_info_free(folder->summary, info);
- }
- }
-
- g_ptr_array_set_size (array, j);
-
- return array;
-}
-
-/**
- * camel_folder_get_uids:
- * @folder: folder object
- *
- * Get the list of UIDs available in a folder. This routine is useful
- * for finding what messages are available when the folder does not
- * support summaries. The returned array shoudl not be modified, and
- * must be freed by passing it to camel_folder_free_uids().
- *
- * Return value: GPtrArray of UIDs corresponding to the messages
- * available in the folder.
- **/
-GPtrArray *
-camel_folder_get_uids (CamelFolder *folder)
-{
- GPtrArray *ret;
-
- g_return_val_if_fail (CAMEL_IS_FOLDER (folder), NULL);
-
- ret = CF_CLASS (folder)->get_uids (folder);
-
- return ret;
-}
-
-static void
-free_uids (CamelFolder *folder, GPtrArray *array)
-{
- int i;
-
- for (i=0; i<array->len; i++)
- g_free(array->pdata[i]);
- g_ptr_array_free(array, TRUE);
-}
-
-/**
- * camel_folder_free_uids:
- * @folder: folder object
- * @array: the array of uids to free
- *
- * Frees the array of UIDs returned by camel_folder_get_uids().
- **/
-void
-camel_folder_free_uids (CamelFolder *folder, GPtrArray *array)
-{
- g_return_if_fail (CAMEL_IS_FOLDER (folder));
-
- CF_CLASS (folder)->free_uids (folder, array);
-}
-
-static GPtrArray *
-get_summary(CamelFolder *folder)
-{
- g_assert(folder->summary != NULL);
-
- return camel_folder_summary_array(folder->summary);
-}
-
-/**
- * camel_folder_get_summary:
- * @folder: a folder object
- *
- * This returns the summary information for the folder. This array
- * should not be modified, and must be freed with
- * camel_folder_free_summary().
- *
- * Return value: an array of CamelMessageInfo
- **/
-GPtrArray *
-camel_folder_get_summary (CamelFolder *folder)
-{
- GPtrArray *ret;
-
- g_return_val_if_fail (CAMEL_IS_FOLDER (folder), NULL);
-
- ret = CF_CLASS (folder)->get_summary (folder);
-
- return ret;
-}
-
-static void
-free_summary(CamelFolder *folder, GPtrArray *summary)
-{
- g_assert(folder->summary != NULL);
-
- camel_folder_summary_array_free(folder->summary, summary);
-}
-
-/**
- * camel_folder_free_summary:
- * @folder: folder object
- * @array: the summary array to free
- *
- * Frees the summary array returned by camel_folder_get_summary().
- **/
-void camel_folder_free_summary(CamelFolder * folder, GPtrArray * array)
-{
- g_return_if_fail(CAMEL_IS_FOLDER(folder));
-
- CF_CLASS(folder)->free_summary(folder, array);
-}
-
-/**
- * camel_folder_has_search_capability:
- * @folder: Folder object
- *
- * Checks if a folder supports searching.
- *
- * Return value: %TRUE if the folder supports searching
- **/
-gboolean
-camel_folder_has_search_capability (CamelFolder *folder)
-{
- g_return_val_if_fail (CAMEL_IS_FOLDER (folder), FALSE);
-
- return folder->folder_flags & CAMEL_FOLDER_HAS_SEARCH_CAPABILITY;
-}
-
-static GPtrArray *
-search_by_expression (CamelFolder *folder, const char *expression,
- CamelException *ex)
-{
- camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID,
- _("Unsupported operation: search by expression: for %s"),
- camel_type_to_name (CAMEL_OBJECT_GET_TYPE (folder)));
-
- w(g_warning ("CamelFolder::search_by_expression not implemented for "
- "`%s'", camel_type_to_name (CAMEL_OBJECT_GET_TYPE (folder))));
-
- return NULL;
-}
-
-/**
- * camel_folder_search_by_expression:
- * @folder: Folder object
- * @expression: a search expression
- * @ex: a CamelException
- *
- * Searches the folder for messages matching the given search expression.
- *
- * Return value: a list of uids of matching messages. The caller must
- * free the list and each of the elements when it is done.
- **/
-GPtrArray *
-camel_folder_search_by_expression (CamelFolder *folder, const char *expression,
- CamelException *ex)
-{
- GPtrArray *ret;
-
- g_return_val_if_fail (CAMEL_IS_FOLDER (folder), NULL);
- g_return_val_if_fail (folder->folder_flags & CAMEL_FOLDER_HAS_SEARCH_CAPABILITY, NULL);
-
- /* NOTE: that it is upto the callee to lock */
-
- ret = CF_CLASS (folder)->search_by_expression (folder, expression, ex);
-
- return ret;
-}
-
-static GPtrArray *
-search_by_uids(CamelFolder *folder, const char *exp, GPtrArray *uids, CamelException *ex)
-{
- camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID,
- _("Unsupported operation: search by uids: for %s"),
- camel_type_to_name (CAMEL_OBJECT_GET_TYPE (folder)));
-
- w(g_warning ("CamelFolder::search_by_expression not implemented for "
- "`%s'", camel_type_to_name (CAMEL_OBJECT_GET_TYPE (folder))));
-
- return NULL;
-}
-
-/**
- * camel_folder_search_by_uids:
- * @folder:
- * @expr:
- * @uids: array of uid's to match against.
- * @ex:
- *
- * Search a subset of uid's for an expression match.
- *
- * Return value:
- **/
-GPtrArray *
-camel_folder_search_by_uids(CamelFolder *folder, const char *expr, GPtrArray *uids, CamelException *ex)
-{
- GPtrArray *ret;
-
- g_return_val_if_fail(CAMEL_IS_FOLDER (folder), NULL);
- g_return_val_if_fail(folder->folder_flags & CAMEL_FOLDER_HAS_SEARCH_CAPABILITY, NULL);
-
- /* NOTE: that it is upto the callee to lock */
-
- ret = CF_CLASS(folder)->search_by_uids(folder, expr, uids, ex);
-
- return ret;
-}
-
-static void
-search_free (CamelFolder *folder, GPtrArray *result)
-{
- int i;
-
- for (i = 0; i < result->len; i++)
- g_free (g_ptr_array_index (result, i));
- g_ptr_array_free (result, TRUE);
-}
-
-/**
- * camel_folder_search_free:
- * @folder:
- * @result:
- *
- * Free the result of a search.
- **/
-void
-camel_folder_search_free (CamelFolder *folder, GPtrArray *result)
-{
- g_return_if_fail (CAMEL_IS_FOLDER (folder));
-
- /* NOTE: upto the callee to lock */
- CF_CLASS (folder)->search_free (folder, result);
-}
-
-
-static void
-transfer_message_to (CamelFolder *source, const char *uid, CamelFolder *dest,
- char **transferred_uid, gboolean delete_original,
- CamelException *ex)
-{
- CamelMimeMessage *msg;
- CamelMessageInfo *info = NULL;
-
- /* Default implementation. */
-
- /* we alredy have the lock, dont deadlock */
- msg = CF_CLASS (source)->get_message (source, uid, ex);
- if (!msg)
- return;
-
- if (source->folder_flags & CAMEL_FOLDER_HAS_SUMMARY_CAPABILITY)
- info = CF_CLASS (source)->get_message_info (source, uid);
- else
- info = camel_message_info_new_from_header (((CamelMimePart *)msg)->headers);
-
- /* we don't want to retain the deleted flag */
- if (info && info->flags & CAMEL_MESSAGE_DELETED) {
- info->flags = info->flags & ~CAMEL_MESSAGE_DELETED;
- delete_original = TRUE;
- }
-
- camel_folder_append_message (dest, msg, info, transferred_uid, ex);
- camel_object_unref (msg);
-
- if (delete_original && !camel_exception_is_set (ex))
- camel_folder_set_message_flags (source, uid, CAMEL_MESSAGE_DELETED|CAMEL_MESSAGE_SEEN, ~0);
-
- if (info) {
- if (source->folder_flags & CAMEL_FOLDER_HAS_SUMMARY_CAPABILITY)
- CF_CLASS (source)->free_message_info (source, info);
- else
- camel_message_info_free (info);
- }
-}
-
-static void
-transfer_messages_to (CamelFolder *source, GPtrArray *uids, CamelFolder *dest, GPtrArray **transferred_uids, gboolean delete_originals, CamelException *ex)
-{
- CamelException local;
- char **ret_uid = NULL;
- int i;
-
- if (transferred_uids) {
- *transferred_uids = g_ptr_array_new ();
- g_ptr_array_set_size (*transferred_uids, uids->len);
- }
-
- camel_exception_init(&local);
- if (ex == NULL)
- ex = &local;
-
- camel_operation_start(NULL, delete_originals ? _("Moving messages") : _("Copying messages"));
-
- if (uids->len > 1) {
- camel_folder_freeze(dest);
- if (delete_originals)
- camel_folder_freeze(source);
- }
- for (i = 0; i < uids->len && !camel_exception_is_set (ex); i++) {
- if (transferred_uids)
- ret_uid = (char **)&((*transferred_uids)->pdata[i]);
- transfer_message_to (source, uids->pdata[i], dest, ret_uid, delete_originals, ex);
- camel_operation_progress(NULL, i * 100 / uids->len);
- }
- if (uids->len > 1) {
- camel_folder_thaw(dest);
- if (delete_originals)
- camel_folder_thaw(source);
- }
-
- camel_operation_end(NULL);
- camel_exception_clear(&local);
-}
-
-/**
- * camel_folder_transfer_messages_to:
- * @source: source folder
- * @uids: message UIDs in @source
- * @dest: destination folder
- * @transferred_uids: if non-%NULL, the UIDs of the resulting messages
- * in @dest will be stored here, if known.
- * @delete_originals: whether or not to delete the original messages
- * @ex: a CamelException
- *
- * This copies or moves messages from one folder to another. If the
- * @source and @dest folders have the same parent_store, this may be
- * more efficient than using camel_folder_append_message().
- **/
-void
-camel_folder_transfer_messages_to (CamelFolder *source, GPtrArray *uids,
- CamelFolder *dest, GPtrArray **transferred_uids,
- gboolean delete_originals, CamelException *ex)
-{
- g_return_if_fail (CAMEL_IS_FOLDER (source));
- g_return_if_fail (CAMEL_IS_FOLDER (dest));
- g_return_if_fail (uids != NULL);
-
- if (source == dest || uids->len == 0) {
- /* source and destination folders are the same, or no work to do, do nothing. */
- return;
- }
-
- CAMEL_FOLDER_LOCK(source, lock);
-
- if (source->parent_store == dest->parent_store) {
- /* If either folder is a vtrash, we need to use the
- * vtrash transfer method.
- */
- if (CAMEL_IS_VTRASH_FOLDER (dest))
- CF_CLASS (dest)->transfer_messages_to (source, uids, dest, transferred_uids, delete_originals, ex);
- else
- CF_CLASS (source)->transfer_messages_to (source, uids, dest, transferred_uids, delete_originals, ex);
- } else
- transfer_messages_to (source, uids, dest, transferred_uids, delete_originals, ex);
-
- CAMEL_FOLDER_UNLOCK(source, lock);
-}
-
-static void
-delete (CamelFolder *folder)
-{
- if (folder->summary)
- camel_folder_summary_clear (folder->summary);
-}
-
-/**
- * camel_folder_delete:
- * @folder: folder
- *
- * Marks a folder object as deleted and performs any required cleanup.
- **/
-void
-camel_folder_delete (CamelFolder *folder)
-{
- g_return_if_fail (CAMEL_IS_FOLDER (folder));
-
- CAMEL_FOLDER_LOCK (folder, lock);
- if (folder->folder_flags & CAMEL_FOLDER_HAS_BEEN_DELETED) {
- CAMEL_FOLDER_UNLOCK (folder, lock);
- return;
- }
-
- folder->folder_flags |= CAMEL_FOLDER_HAS_BEEN_DELETED;
-
- CF_CLASS (folder)->delete (folder);
-
- CAMEL_FOLDER_UNLOCK (folder, lock);
-
- camel_object_trigger_event (folder, "deleted", NULL);
-}
-
-static void
-folder_rename (CamelFolder *folder, const char *new)
-{
- char *tmp;
-
- printf("CamelFolder:rename('%s')\n", new);
-
- g_free(folder->full_name);
- folder->full_name = g_strdup(new);
- g_free(folder->name);
- tmp = strrchr(new, folder->parent_store->dir_sep);
- folder->name = g_strdup(tmp?tmp+1:new);
-}
-
-/**
- * camel_folder_rename:
- * @folder:
- * @new:
- *
- * Mark an active folder object as renamed.
- *
- * NOTE: This is an internal function used by camel stores, no locking
- * is performed on the folder.
- **/
-void
-camel_folder_rename(CamelFolder *folder, const char *new)
-{
- char *old;
-
- old = g_strdup(folder->full_name);
-
- CF_CLASS (folder)->rename(folder, new);
-
- camel_object_trigger_event (folder, "renamed", old);
- g_free(old);
-}
-
-static void
-freeze (CamelFolder *folder)
-{
- CAMEL_FOLDER_LOCK(folder, change_lock);
-
- g_assert(folder->priv->frozen >= 0);
-
- folder->priv->frozen++;
-
- d(printf ("freeze(%p '%s') = %d\n", folder, folder->full_name, folder->priv->frozen));
- CAMEL_FOLDER_UNLOCK(folder, change_lock);
-}
-
-/**
- * camel_folder_freeze:
- * @folder: a folder
- *
- * Freezes the folder so that a series of operation can be performed
- * without "message_changed" and "folder_changed" signals being emitted.
- * When the folder is later thawed with camel_folder_thaw(), the
- * suppressed signals will be emitted.
- **/
-void
-camel_folder_freeze (CamelFolder * folder)
-{
- g_return_if_fail (CAMEL_IS_FOLDER (folder));
-
- CF_CLASS (folder)->freeze (folder);
-}
-
-static void
-thaw (CamelFolder * folder)
-{
- CamelFolderChangeInfo *info = NULL;
-
- CAMEL_FOLDER_LOCK(folder, change_lock);
-
- g_assert(folder->priv->frozen > 0);
-
- folder->priv->frozen--;
-
- d(printf ("thaw(%p '%s') = %d\n", folder, folder->full_name, folder->priv->frozen));
-
- if (folder->priv->frozen == 0
- && camel_folder_change_info_changed(folder->priv->changed_frozen)) {
- info = folder->priv->changed_frozen;
- folder->priv->changed_frozen = camel_folder_change_info_new();
- }
-
- CAMEL_FOLDER_UNLOCK(folder, change_lock);
-
- if (info) {
- camel_object_trigger_event (folder, "folder_changed", info);
- camel_folder_change_info_free(info);
- }
-}
-
-/**
- * camel_folder_thaw:
- * @folder: a folder
- *
- * Thaws the folder and emits any pending folder_changed or
- * message_changed signals.
- **/
-void
-camel_folder_thaw (CamelFolder *folder)
-{
- g_return_if_fail (CAMEL_IS_FOLDER (folder));
- g_return_if_fail (folder->priv->frozen != 0);
-
- CF_CLASS (folder)->thaw (folder);
-}
-
-static gboolean
-is_frozen (CamelFolder *folder)
-{
- return folder->priv->frozen != 0;
-}
-
-/**
- * camel_folder_is_frozen:
- * @folder: a folder
- *
- * Return value: whether or not the folder is frozen.
- **/
-gboolean
-camel_folder_is_frozen (CamelFolder *folder)
-{
- g_return_val_if_fail (CAMEL_IS_FOLDER (folder), FALSE);
-
- return CF_CLASS (folder)->is_frozen (folder);
-}
-
-
-struct _folder_filter_msg {
- CamelSessionThreadMsg msg;
-
- GPtrArray *recents;
- CamelFolder *folder;
- CamelFilterDriver *driver;
- CamelException ex;
-};
-
-static void
-filter_filter(CamelSession *session, CamelSessionThreadMsg *msg)
-{
- struct _folder_filter_msg *m = (struct _folder_filter_msg *)msg;
- CamelMessageInfo *info;
- int i, status = 0;
- CamelURL *uri;
- char *source_url;
- CamelException ex;
-
- camel_operation_start(NULL, _("Filtering new message(s)"));
-
- source_url = camel_service_get_url((CamelService *)m->folder->parent_store);
- uri = camel_url_new(source_url, NULL);
- g_free(source_url);
- if (m->folder->full_name && m->folder->full_name[0] != '/') {
- char *tmp = alloca(strlen(m->folder->full_name)+2);
-
- sprintf(tmp, "/%s", m->folder->full_name);
- camel_url_set_path(uri, tmp);
- } else
- camel_url_set_path(uri, m->folder->full_name);
- source_url = camel_url_to_string(uri, CAMEL_URL_HIDE_ALL);
- camel_url_free(uri);
-
- for (i=0;status == 0 && i<m->recents->len;i++) {
- char *uid = m->recents->pdata[i];
- int pc = 100 * i / m->recents->len;
-
- camel_operation_progress(NULL, pc);
-
- info = camel_folder_get_message_info(m->folder, uid);
- if (info == NULL) {
- g_warning("uid %s vanished from folder: %s", uid, source_url);
- continue;
- }
-
- status = camel_filter_driver_filter_message(m->driver, NULL, info, uid, m->folder, source_url, source_url, &m->ex);
-
- camel_folder_free_message_info(m->folder, info);
- }
-
- camel_exception_init(&ex);
- camel_filter_driver_flush(m->driver, &ex);
- if (!camel_exception_is_set(&m->ex))
- camel_exception_xfer(&m->ex, &ex);
-
- g_free(source_url);
-
- camel_operation_end(NULL);
-}
-
-static void
-filter_free(CamelSession *session, CamelSessionThreadMsg *msg)
-{
- struct _folder_filter_msg *m = (struct _folder_filter_msg *)msg;
- int i;
-
- camel_folder_thaw(m->folder);
- camel_object_unref((CamelObject *)m->folder);
- camel_object_unref((CamelObject *)m->driver);
- for (i=0;i<m->recents->len;i++)
- g_free(m->recents->pdata[i]);
- g_ptr_array_free(m->recents, TRUE);
-}
-
-static CamelSessionThreadOps filter_ops = {
- filter_filter,
- filter_free,
-};
-
-
-/* Event hooks that block emission when frozen */
-static gboolean
-folder_changed (CamelObject *obj, gpointer event_data)
-{
- CamelFolder *folder = CAMEL_FOLDER (obj);
- CamelFolderChangeInfo *changed = event_data;
- gboolean ret = TRUE;
-
- d(printf ("folder_changed(%p, %p), frozen=%d\n", obj, event_data, folder->priv->frozen));
- d(printf(" added %d remoded %d changed %d recent %d\n",
- changed->uid_added->len, changed->uid_removed->len,
- changed->uid_changed->len, changed->uid_recent->len));
-
- if (changed != NULL) {
- CamelSession *session = ((CamelService *)folder->parent_store)->session;
- CamelFilterDriver *driver = NULL;
-
- if (((folder->folder_flags & CAMEL_FOLDER_FILTER_RECENT) || camel_session_check_junk (session))
- && changed->uid_recent->len > 0)
- driver = camel_session_get_filter_driver(session,
- (folder->folder_flags & CAMEL_FOLDER_FILTER_RECENT) ? FILTER_SOURCE_INCOMING : FILTER_SOURCE_JUNKTEST, NULL);
-
- CAMEL_FOLDER_LOCK(folder, change_lock);
-
- if (driver) {
- GPtrArray *recents = g_ptr_array_new();
- int i;
- struct _folder_filter_msg *msg;
-
- d(printf("** Have '%d' recent messages, launching thread to process them\n", changed->uid_recent->len));
-
- folder->priv->frozen++;
- msg = camel_session_thread_msg_new(session, &filter_ops, sizeof(*msg));
- for (i=0;i<changed->uid_recent->len;i++)
- g_ptr_array_add(recents, g_strdup(changed->uid_recent->pdata[i]));
- msg->recents = recents;
- msg->folder = folder;
- camel_object_ref((CamelObject *)folder);
- msg->driver = driver;
- camel_exception_init(&msg->ex);
- camel_session_thread_queue(session, &msg->msg, 0);
-
- /* zero out the recent list so we dont reprocess */
- /* this pokes past abstraction, but changeinfo is our structure anyway */
- /* the only other alternative is to recognise when trigger is called from
- thaw(), but thats a pita */
- g_ptr_array_set_size(changed->uid_recent, 0);
- }
-
- if (folder->priv->frozen) {
- camel_folder_change_info_cat(folder->priv->changed_frozen, changed);
- ret = FALSE;
- }
- CAMEL_FOLDER_UNLOCK(folder, change_lock);
- } else {
- w(g_warning ("Class %s is passing NULL to folder_changed event",
- camel_type_to_name (CAMEL_OBJECT_GET_TYPE (folder))));
- }
-
- return ret;
-}
-
-static gboolean
-message_changed (CamelObject *obj, /*const char *uid*/gpointer event_data)
-{
- CamelFolder *folder = CAMEL_FOLDER (obj);
- gboolean ret = TRUE;
-
- d(printf ("message_changed(%p, %p), frozen=%d\n", folder, event_data, folder->priv->frozen));
-
- if (folder->priv->frozen) {
- CAMEL_FOLDER_LOCK(folder, change_lock);
-
- camel_folder_change_info_change_uid(folder->priv->changed_frozen, (char *)event_data);
- ret = FALSE;
-
- CAMEL_FOLDER_UNLOCK(folder, change_lock);
- }
-
- return ret;
-}
-
-
-/**
- * camel_folder_free_nop:
- * @folder: a folder
- * @array: an array of uids or CamelMessageInfo
- *
- * "Frees" the provided array by doing nothing. Used by CamelFolder
- * subclasses as an implementation for free_uids, or free_summary when
- * the returned array is "static" information and should not be freed.
- **/
-void
-camel_folder_free_nop (CamelFolder *folder, GPtrArray *array)
-{
- ;
-}
-
-/**
- * camel_folder_free_shallow:
- * @folder: a folder
- * @array: an array of uids or CamelMessageInfo
- *
- * Frees the provided array but not its contents. Used by CamelFolder
- * subclasses as an implementation for free_uids or free_summary when
- * the returned array needs to be freed but its contents come from
- * "static" information.
- **/
-void
-camel_folder_free_shallow (CamelFolder *folder, GPtrArray *array)
-{
- g_ptr_array_free (array, TRUE);
-}
-
-/**
- * camel_folder_free_deep:
- * @folder: a folder
- * @array: an array of uids
- *
- * Frees the provided array and its contents. Used by CamelFolder
- * subclasses as an implementation for free_uids when the provided
- * information was created explicitly by the corresponding get_ call.
- **/
-void
-camel_folder_free_deep (CamelFolder *folder, GPtrArray *array)
-{
- int i;
-
- for (i = 0; i < array->len; i++)
- g_free (array->pdata[i]);
- g_ptr_array_free (array, TRUE);
-}
-
-struct _CamelFolderChangeInfoPrivate {
- GHashTable *uid_stored; /* what we have stored, which array they're in */
- GHashTable *uid_source; /* used to create unique lists */
- struct _EMemPool *uid_pool; /* pool used to store copies of uid strings */
-};
-
-/**
- * camel_folder_change_info_new:
- * @void:
- *
- * Create a new folder change info structure.
- *
- * Change info structures are not MT-SAFE and must be
- * locked for exclusive access externally.
- *
- * Return value:
- **/
-CamelFolderChangeInfo *
-camel_folder_change_info_new(void)
-{
- CamelFolderChangeInfo *info;
-
- info = g_malloc(sizeof(*info));
- info->uid_added = g_ptr_array_new();
- info->uid_removed = g_ptr_array_new();
- info->uid_changed = g_ptr_array_new();
- info->uid_recent = g_ptr_array_new();
- info->priv = g_malloc0(sizeof(*info->priv));
- info->priv->uid_stored = g_hash_table_new(g_str_hash, g_str_equal);
- info->priv->uid_source = NULL;
- info->priv->uid_pool = e_mempool_new(512, 256, E_MEMPOOL_ALIGN_BYTE);
-
- return info;
-}
-
-/**
- * camel_folder_change_info_add_source:
- * @info:
- * @uid:
- *
- * Add a source uid for generating a changeset.
- **/
-void
-camel_folder_change_info_add_source(CamelFolderChangeInfo *info, const char *uid)
-{
- struct _CamelFolderChangeInfoPrivate *p;
-
- g_assert(info != NULL);
-
- p = info->priv;
-
- if (p->uid_source == NULL)
- p->uid_source = g_hash_table_new(g_str_hash, g_str_equal);
-
- if (g_hash_table_lookup(p->uid_source, uid) == NULL)
- g_hash_table_insert(p->uid_source, e_mempool_strdup(p->uid_pool, uid), (void *)1);
-}
-
-/**
- * camel_folder_change_info_add_source_list:
- * @info:
- * @list:
- *
- * Add a list of source uid's for generating a changeset.
- **/
-void
-camel_folder_change_info_add_source_list(CamelFolderChangeInfo *info, const GPtrArray *list)
-{
- struct _CamelFolderChangeInfoPrivate *p;
- int i;
-
- g_assert(info != NULL);
- g_assert(list != NULL);
-
- p = info->priv;
-
- if (p->uid_source == NULL)
- p->uid_source = g_hash_table_new(g_str_hash, g_str_equal);
-
- for (i=0;i<list->len;i++) {
- char *uid = list->pdata[i];
-
- if (g_hash_table_lookup(p->uid_source, uid) == NULL)
- g_hash_table_insert(p->uid_source, e_mempool_strdup(p->uid_pool, uid), (void *)1);
- }
-}
-
-/**
- * camel_folder_change_info_add_update:
- * @info:
- * @uid:
- *
- * Add a uid from the updated list, used to generate a changeset diff.
- **/
-void
-camel_folder_change_info_add_update(CamelFolderChangeInfo *info, const char *uid)
-{
- struct _CamelFolderChangeInfoPrivate *p;
- char *key;
- int value;
-
- g_assert(info != NULL);
-
- p = info->priv;
-
- if (p->uid_source == NULL) {
- camel_folder_change_info_add_uid(info, uid);
- return;
- }
-
- if (g_hash_table_lookup_extended(p->uid_source, uid, (void **)&key, (void **)&value)) {
- g_hash_table_remove(p->uid_source, key);
- } else {
- camel_folder_change_info_add_uid(info, uid);
- }
-}
-
-/**
- * camel_folder_change_info_add_update_list:
- * @info:
- * @list:
- *
- * Add a list of uid's from the updated list.
- **/
-void
-camel_folder_change_info_add_update_list(CamelFolderChangeInfo *info, const GPtrArray *list)
-{
- int i;
-
- g_assert(info != NULL);
- g_assert(list != NULL);
-
- for (i=0;i<list->len;i++)
- camel_folder_change_info_add_update(info, list->pdata[i]);
-}
-
-static void
-change_info_remove(char *key, void *value, CamelFolderChangeInfo *info)
-{
- struct _CamelFolderChangeInfoPrivate *p = info->priv;
- GPtrArray *olduids;
- char *olduid;
-
- if (g_hash_table_lookup_extended(p->uid_stored, key, (void **)&olduid, (void **)&olduids)) {
- /* if it was added/changed them removed, then remove it */
- if (olduids != info->uid_removed) {
- g_ptr_array_remove_fast(olduids, olduid);
- g_ptr_array_add(info->uid_removed, olduid);
- g_hash_table_insert(p->uid_stored, olduid, info->uid_removed);
- }
- return;
- }
-
- /* we dont need to copy this, as they've already been copied into our pool */
- g_ptr_array_add(info->uid_removed, key);
- g_hash_table_insert(p->uid_stored, key, info->uid_removed);
-}
-
-/**
- * camel_folder_change_info_build_diff:
- * @info:
- *
- * Compare the source uid set to the updated uid set and generate the differences
- * into the added and removed lists.
- **/
-void
-camel_folder_change_info_build_diff(CamelFolderChangeInfo *info)
-{
- struct _CamelFolderChangeInfoPrivate *p;
-
- g_assert(info != NULL);
-
- p = info->priv;
-
- if (p->uid_source) {
- g_hash_table_foreach(p->uid_source, (GHFunc)change_info_remove, info);
- g_hash_table_destroy(p->uid_source);
- p->uid_source = NULL;
- }
-}
-
-static void
-change_info_cat(CamelFolderChangeInfo *info, GPtrArray *source, void (*add)(CamelFolderChangeInfo *info, const char *uid))
-{
- int i;
-
- for (i=0;i<source->len;i++)
- add(info, source->pdata[i]);
-}
-
-/**
- * camel_folder_change_info_cat:
- * @info:
- * @source:
- *
- * Concatenate one change info onto antoher. Can be used to copy
- * them too.
- **/
-void
-camel_folder_change_info_cat(CamelFolderChangeInfo *info, CamelFolderChangeInfo *source)
-{
- g_assert(info != NULL);
- g_assert(source != NULL);
-
- change_info_cat(info, source->uid_added, camel_folder_change_info_add_uid);
- change_info_cat(info, source->uid_removed, camel_folder_change_info_remove_uid);
- change_info_cat(info, source->uid_changed, camel_folder_change_info_change_uid);
- change_info_cat(info, source->uid_recent, camel_folder_change_info_recent_uid);
-}
-
-/**
- * camel_folder_change_info_add_uid:
- * @info:
- * @uid:
- *
- * Add a new uid to the changeinfo.
- **/
-void
-camel_folder_change_info_add_uid(CamelFolderChangeInfo *info, const char *uid)
-{
- struct _CamelFolderChangeInfoPrivate *p;
- GPtrArray *olduids;
- char *olduid;
-
- g_assert(info != NULL);
-
- p = info->priv;
-
- if (g_hash_table_lookup_extended(p->uid_stored, uid, (void **)&olduid, (void **)&olduids)) {
- /* if it was removed then added, promote it to a changed */
- /* if it was changed then added, leave as changed */
- if (olduids == info->uid_removed) {
- g_ptr_array_remove_fast(olduids, olduid);
- g_ptr_array_add(info->uid_changed, olduid);
- g_hash_table_insert(p->uid_stored, olduid, info->uid_changed);
- }
- return;
- }
-
- olduid = e_mempool_strdup(p->uid_pool, uid);
- g_ptr_array_add(info->uid_added, olduid);
- g_hash_table_insert(p->uid_stored, olduid, info->uid_added);
-}
-
-/**
- * camel_folder_change_info_remove_uid:
- * @info:
- * @uid:
- *
- * Add a uid to the removed uid list.
- **/
-void
-camel_folder_change_info_remove_uid(CamelFolderChangeInfo *info, const char *uid)
-{
- struct _CamelFolderChangeInfoPrivate *p;
- GPtrArray *olduids;
- char *olduid;
-
- g_assert(info != NULL);
-
- p = info->priv;
-
- if (g_hash_table_lookup_extended(p->uid_stored, uid, (void **)&olduid, (void **)&olduids)) {
- /* if it was added/changed them removed, then remove it */
- if (olduids != info->uid_removed) {
- g_ptr_array_remove_fast(olduids, olduid);
- g_ptr_array_add(info->uid_removed, olduid);
- g_hash_table_insert(p->uid_stored, olduid, info->uid_removed);
- }
- return;
- }
-
- olduid = e_mempool_strdup(p->uid_pool, uid);
- g_ptr_array_add(info->uid_removed, olduid);
- g_hash_table_insert(p->uid_stored, olduid, info->uid_removed);
-}
-
-/**
- * camel_folder_change_info_change_uid:
- * @info:
- * @uid:
- *
- * Add a uid to the changed uid list.
- **/
-void
-camel_folder_change_info_change_uid(CamelFolderChangeInfo *info, const char *uid)
-{
- struct _CamelFolderChangeInfoPrivate *p;
- GPtrArray *olduids;
- char *olduid;
-
- g_assert(info != NULL);
-
- p = info->priv;
-
- if (g_hash_table_lookup_extended(p->uid_stored, uid, (void **)&olduid, (void **)&olduids)) {
- /* if we have it already, leave it as that */
- return;
- }
-
- olduid = e_mempool_strdup(p->uid_pool, uid);
- g_ptr_array_add(info->uid_changed, olduid);
- g_hash_table_insert(p->uid_stored, olduid, info->uid_changed);
-}
-
-void
-camel_folder_change_info_recent_uid(CamelFolderChangeInfo *info, const char *uid)
-{
- struct _CamelFolderChangeInfoPrivate *p;
- GPtrArray *olduids;
- char *olduid;
-
- g_assert(info != NULL);
-
- p = info->priv;
-
- /* always add to recent, but dont let anyone else know */
- if (!g_hash_table_lookup_extended(p->uid_stored, uid, (void **)&olduid, (void **)&olduids)) {
- olduid = e_mempool_strdup(p->uid_pool, uid);
- }
- g_ptr_array_add(info->uid_recent, olduid);
-}
-
-/**
- * camel_folder_change_info_changed:
- * @info:
- *
- * Return true if the changeset contains any changes.
- *
- * Return Value:
- **/
-gboolean
-camel_folder_change_info_changed(CamelFolderChangeInfo *info)
-{
- g_assert(info != NULL);
-
- return (info->uid_added->len || info->uid_removed->len || info->uid_changed->len || info->uid_recent->len);
-}
-
-/**
- * camel_folder_change_info_clear:
- * @info:
- *
- * Empty out the change info; called after changes have been processed.
- **/
-void
-camel_folder_change_info_clear(CamelFolderChangeInfo *info)
-{
- struct _CamelFolderChangeInfoPrivate *p;
-
- g_assert(info != NULL);
-
- p = info->priv;
-
- g_ptr_array_set_size(info->uid_added, 0);
- g_ptr_array_set_size(info->uid_removed, 0);
- g_ptr_array_set_size(info->uid_changed, 0);
- g_ptr_array_set_size(info->uid_recent, 0);
- if (p->uid_source) {
- g_hash_table_destroy(p->uid_source);
- p->uid_source = NULL;
- }
- g_hash_table_destroy(p->uid_stored);
- p->uid_stored = g_hash_table_new(g_str_hash, g_str_equal);
- e_mempool_flush(p->uid_pool, TRUE);
-}
-
-/**
- * camel_folder_change_info_free:
- * @info:
- *
- * Free memory associated with the folder change info lists.
- **/
-void
-camel_folder_change_info_free(CamelFolderChangeInfo *info)
-{
- struct _CamelFolderChangeInfoPrivate *p;
-
- g_assert(info != NULL);
-
- p = info->priv;
-
- if (p->uid_source)
- g_hash_table_destroy(p->uid_source);
-
- g_hash_table_destroy(p->uid_stored);
- e_mempool_destroy(p->uid_pool);
- g_free(p);
-
- g_ptr_array_free(info->uid_added, TRUE);
- g_ptr_array_free(info->uid_removed, TRUE);
- g_ptr_array_free(info->uid_changed, TRUE);
- g_ptr_array_free(info->uid_recent, TRUE);
- g_free(info);
-}
diff --git a/camel/camel-folder.h b/camel/camel-folder.h
deleted file mode 100644
index 83df665147..0000000000
--- a/camel/camel-folder.h
+++ /dev/null
@@ -1,348 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * camel-folder.h: Abstract class for an email folder
- *
- * Authors: Bertrand Guiheneuf <bertrand@helixcode.com>
- * Michael Zucchi <notzed@ximian.com>
- *
- * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifndef CAMEL_FOLDER_H
-#define CAMEL_FOLDER_H 1
-
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <glib.h>
-#include <camel/camel-object.h>
-#include <camel/camel-folder-summary.h>
-
-#define CAMEL_FOLDER_TYPE (camel_folder_get_type ())
-#define CAMEL_FOLDER(obj) (CAMEL_CHECK_CAST((obj), CAMEL_FOLDER_TYPE, CamelFolder))
-#define CAMEL_FOLDER_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_FOLDER_TYPE, CamelFolderClass))
-#define CAMEL_IS_FOLDER(o) (CAMEL_CHECK_TYPE((o), CAMEL_FOLDER_TYPE))
-
-typedef struct _CamelFolderChangeInfo CamelFolderChangeInfo;
-
-enum {
- CAMEL_FOLDER_ARG_FIRST = CAMEL_ARG_FIRST + 0x1000,
- CAMEL_FOLDER_ARG_NAME = CAMEL_FOLDER_ARG_FIRST,
- CAMEL_FOLDER_ARG_FULL_NAME,
- CAMEL_FOLDER_ARG_STORE,
- CAMEL_FOLDER_ARG_PERMANENTFLAGS,
- CAMEL_FOLDER_ARG_TOTAL,
- CAMEL_FOLDER_ARG_UNREAD,
- CAMEL_FOLDER_ARG_UID_ARRAY,
- CAMEL_FOLDER_ARG_INFO_ARRAY,
- CAMEL_FOLDER_ARG_PROPERTIES,
- CAMEL_FOLDER_ARG_LAST = CAMEL_ARG_FIRST + 0x2000,
-};
-
-enum {
- CAMEL_FOLDER_NAME = CAMEL_FOLDER_ARG_NAME | CAMEL_ARG_STR,
- CAMEL_FOLDER_FULL_NAME = CAMEL_FOLDER_ARG_FULL_NAME | CAMEL_ARG_STR,
- CAMEL_FOLDER_STORE = CAMEL_FOLDER_ARG_STORE | CAMEL_ARG_OBJ,
- CAMEL_FOLDER_PERMANENTFLAGS = CAMEL_FOLDER_ARG_PERMANENTFLAGS | CAMEL_ARG_INT,
- CAMEL_FOLDER_TOTAL = CAMEL_FOLDER_ARG_TOTAL | CAMEL_ARG_INT,
- CAMEL_FOLDER_UNREAD = CAMEL_FOLDER_ARG_UNREAD | CAMEL_ARG_INT,
- /* should we only get static data? not stuff that needs to be free'd? */
- CAMEL_FOLDER_UID_ARRAY = CAMEL_FOLDER_ARG_UID_ARRAY | CAMEL_ARG_PTR,
- CAMEL_FOLDER_INFO_ARRAY = CAMEL_FOLDER_ARG_INFO_ARRAY | CAMEL_ARG_PTR,
-
- /* GSList of settable folder properties */
- CAMEL_FOLDER_PROPERTIES = CAMEL_FOLDER_ARG_PROPERTIES | CAMEL_ARG_PTR,
-};
-
-struct _CamelFolderChangeInfo {
- GPtrArray *uid_added;
- GPtrArray *uid_removed;
- GPtrArray *uid_changed;
- GPtrArray *uid_recent;
-
- struct _CamelFolderChangeInfoPrivate *priv;
-};
-
-struct _CamelFolder
-{
- CamelObject parent_object;
-
- struct _CamelFolderPrivate *priv;
-
- /* get these via the :get() method, they might not be set otherwise */
- char *name;
- char *full_name;
- char *description;
-
- CamelStore *parent_store;
- CamelFolderSummary *summary;
-
- guint32 folder_flags;
- guint32 permanent_flags;
-};
-
-#define CAMEL_FOLDER_HAS_SUMMARY_CAPABILITY (1<<0)
-#define CAMEL_FOLDER_HAS_SEARCH_CAPABILITY (1<<1)
-#define CAMEL_FOLDER_FILTER_RECENT (1<<2)
-#define CAMEL_FOLDER_HAS_BEEN_DELETED (1<<3)
-#define CAMEL_FOLDER_IS_TRASH (1<<4)
-#define CAMEL_FOLDER_IS_JUNK (1<<5)
-
-typedef struct {
- CamelObjectClass parent_class;
-
- /* Virtual methods */
- void (*refresh_info) (CamelFolder *folder, CamelException *ex);
-
- void (*sync) (CamelFolder *folder, gboolean expunge,
- CamelException *ex);
-
- const char * (*get_name) (CamelFolder *folder);
- const char * (*get_full_name) (CamelFolder *folder);
-
- CamelStore * (*get_parent_store) (CamelFolder *folder);
-
- void (*expunge) (CamelFolder *folder,
- CamelException *ex);
-
- int (*get_message_count) (CamelFolder *folder);
-
- int (*get_unread_message_count) (CamelFolder *folder);
-
- void (*append_message) (CamelFolder *folder,
- CamelMimeMessage *message,
- const CamelMessageInfo *info,
- char **appended_uid,
- CamelException *ex);
-
- guint32 (*get_permanent_flags) (CamelFolder *folder);
- guint32 (*get_message_flags) (CamelFolder *folder,
- const char *uid);
- void (*set_message_flags) (CamelFolder *folder,
- const char *uid,
- guint32 flags, guint32 set);
-
- gboolean (*get_message_user_flag) (CamelFolder *folder,
- const char *uid,
- const char *name);
- void (*set_message_user_flag) (CamelFolder *folder,
- const char *uid,
- const char *name,
- gboolean value);
-
- const char * (*get_message_user_tag) (CamelFolder *folder,
- const char *uid,
- const char *name);
- void (*set_message_user_tag) (CamelFolder *folder,
- const char *uid,
- const char *name,
- const char *value);
-
- CamelMimeMessage * (*get_message) (CamelFolder *folder,
- const char *uid,
- CamelException *ex);
-
- GPtrArray * (*get_uids) (CamelFolder *folder);
- void (*free_uids) (CamelFolder *folder,
- GPtrArray *array);
-
- GPtrArray * (*get_summary) (CamelFolder *folder);
- void (*free_summary) (CamelFolder *folder,
- GPtrArray *summary);
-
- gboolean (*has_search_capability) (CamelFolder *folder);
-
- GPtrArray * (*search_by_expression) (CamelFolder *, const char *, CamelException *);
- GPtrArray * (*search_by_uids) (CamelFolder *, const char *, GPtrArray *uids, CamelException *);
-
- void (*search_free) (CamelFolder *folder, GPtrArray *result);
-
- CamelMessageInfo * (*get_message_info) (CamelFolder *, const char *uid);
- void (*ref_message_info) (CamelFolder *, CamelMessageInfo *);
- void (*free_message_info) (CamelFolder *, CamelMessageInfo *);
-
- void (*transfer_messages_to) (CamelFolder *source,
- GPtrArray *uids,
- CamelFolder *destination,
- GPtrArray **transferred_uids,
- gboolean delete_originals,
- CamelException *ex);
-
- void (*delete) (CamelFolder *folder);
- void (*rename) (CamelFolder *folder, const char *newname);
-
- void (*freeze) (CamelFolder *folder);
- void (*thaw) (CamelFolder *folder);
- gboolean (*is_frozen) (CamelFolder *folder);
-} CamelFolderClass;
-
-/* Standard Camel function */
-CamelType camel_folder_get_type (void);
-
-
-/* public methods */
-void camel_folder_construct (CamelFolder *folder,
- CamelStore *parent_store,
- const char *full_name,
- const char *name);
-
-void camel_folder_refresh_info (CamelFolder * folder,
- CamelException * ex);
-void camel_folder_sync (CamelFolder *folder,
- gboolean expunge,
- CamelException *ex);
-
-CamelStore * camel_folder_get_parent_store (CamelFolder *folder);
-
-
-/* delete operations */
-void camel_folder_expunge (CamelFolder *folder,
- CamelException *ex);
-
-
-/* folder name operations */
-const char * camel_folder_get_name (CamelFolder *folder);
-const char * camel_folder_get_full_name (CamelFolder *folder);
-
-
-/* various properties accessors */
-guint32 camel_folder_get_permanent_flags (CamelFolder *folder);
-
-guint32 camel_folder_get_message_flags (CamelFolder *folder,
- const char *uid);
-
-void camel_folder_set_message_flags (CamelFolder *folder,
- const char *uid,
- guint32 flags,
- guint32 set);
-
-gboolean camel_folder_get_message_user_flag (CamelFolder *folder,
- const char *uid,
- const char *name);
-
-void camel_folder_set_message_user_flag (CamelFolder *folder,
- const char *uid,
- const char *name,
- gboolean value);
-const char * camel_folder_get_message_user_tag (CamelFolder *folder,
- const char *uid,
- const char *name);
-
-void camel_folder_set_message_user_tag (CamelFolder *folder,
- const char *uid,
- const char *name,
- const char *value);
-
-
-
-/* message manipulation */
-void camel_folder_append_message (CamelFolder *folder,
- CamelMimeMessage *message,
- const CamelMessageInfo *info,
- char **appended_uid,
- CamelException *ex);
-
-
-/* summary related operations */
-gboolean camel_folder_has_summary_capability (CamelFolder *folder);
-
-
-int camel_folder_get_message_count (CamelFolder *folder);
-
-int camel_folder_get_unread_message_count (CamelFolder *folder);
-
-GPtrArray * camel_folder_get_summary (CamelFolder *folder);
-void camel_folder_free_summary (CamelFolder *folder,
- GPtrArray *array);
-
-/* uid based access operations */
-CamelMimeMessage * camel_folder_get_message (CamelFolder *folder,
- const char *uid,
- CamelException *ex);
-#define camel_folder_delete_message(folder, uid) \
- camel_folder_set_message_flags (folder, uid, CAMEL_MESSAGE_DELETED, CAMEL_MESSAGE_DELETED)
-
-GPtrArray * camel_folder_get_uids (CamelFolder *folder);
-void camel_folder_free_uids (CamelFolder *folder,
- GPtrArray *array);
-
-/* search api */
-gboolean camel_folder_has_search_capability (CamelFolder *folder);
-GPtrArray * camel_folder_search_by_expression (CamelFolder *folder, const char *expr, CamelException *ex);
-GPtrArray * camel_folder_search_by_uids (CamelFolder *folder, const char *expr, GPtrArray *uids, CamelException *ex);
-void camel_folder_search_free (CamelFolder *folder, GPtrArray *);
-
-/* summary info */
-CamelMessageInfo *camel_folder_get_message_info (CamelFolder *folder, const char *uid);
-void camel_folder_free_message_info (CamelFolder *folder, CamelMessageInfo *info);
-void camel_folder_ref_message_info (CamelFolder *folder, CamelMessageInfo *info);
-
-void camel_folder_transfer_messages_to (CamelFolder *source,
- GPtrArray *uids,
- CamelFolder *dest,
- GPtrArray **transferred_uids,
- gboolean delete_originals,
- CamelException *ex);
-
-void camel_folder_delete (CamelFolder *folder);
-void camel_folder_rename (CamelFolder *folder, const char *new);
-
-/* stop/restart getting events */
-void camel_folder_freeze (CamelFolder *folder);
-void camel_folder_thaw (CamelFolder *folder);
-gboolean camel_folder_is_frozen (CamelFolder *folder);
-
-#if 0
-/* lock/unlock at the thread level, NOTE: only used internally */
-void camel_folder_lock (CamelFolder *folder);
-void camel_folder_unlock (CamelFolder *folder);
-#endif
-
-/* For use by subclasses (for free_{uids,summary,subfolder_names}) */
-void camel_folder_free_nop (CamelFolder *folder, GPtrArray *array);
-void camel_folder_free_shallow (CamelFolder *folder, GPtrArray *array);
-void camel_folder_free_deep (CamelFolder *folder, GPtrArray *array);
-
-/* update functions for change info */
-CamelFolderChangeInfo * camel_folder_change_info_new (void);
-void camel_folder_change_info_clear (CamelFolderChangeInfo *info);
-void camel_folder_change_info_free (CamelFolderChangeInfo *info);
-gboolean camel_folder_change_info_changed (CamelFolderChangeInfo *info);
-
-/* for building diff's automatically */
-void camel_folder_change_info_add_source (CamelFolderChangeInfo *info, const char *uid);
-void camel_folder_change_info_add_source_list(CamelFolderChangeInfo *info, const GPtrArray *list);
-void camel_folder_change_info_add_update (CamelFolderChangeInfo *info, const char *uid);
-void camel_folder_change_info_add_update_list(CamelFolderChangeInfo *info, const GPtrArray *list);
-void camel_folder_change_info_build_diff (CamelFolderChangeInfo *info);
-
-/* for manipulating diff's directly */
-void camel_folder_change_info_cat (CamelFolderChangeInfo *info, CamelFolderChangeInfo *s);
-void camel_folder_change_info_add_uid (CamelFolderChangeInfo *info, const char *uid);
-void camel_folder_change_info_remove_uid (CamelFolderChangeInfo *info, const char *uid);
-void camel_folder_change_info_change_uid (CamelFolderChangeInfo *info, const char *uid);
-void camel_folder_change_info_recent_uid (CamelFolderChangeInfo *info, const char *uid);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_FOLDER_H */
-
diff --git a/camel/camel-gpg-context.c b/camel/camel-gpg-context.c
deleted file mode 100644
index f7f52fd7fd..0000000000
--- a/camel/camel-gpg-context.c
+++ /dev/null
@@ -1,1794 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2002 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <sys/time.h>
-#include <termios.h>
-#include <signal.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <ctype.h>
-
-#include "gal/util/e-iconv.h"
-
-#include "camel-gpg-context.h"
-#include "camel-mime-filter-charset.h"
-#include "camel-stream-filter.h"
-#include "camel-stream-mem.h"
-#include "camel-stream-fs.h"
-#include "camel-operation.h"
-#include "camel-mime-part.h"
-#include "camel-mime-filter-canon.h"
-
-#include "camel-multipart-signed.h"
-#include "camel-multipart-encrypted.h"
-
-#define d(x)
-
-static CamelCipherContextClass *parent_class = NULL;
-
-/**
- * camel_gpg_context_new:
- * @session: session
- *
- * Creates a new gpg cipher context object.
- *
- * Returns a new gpg cipher context object.
- **/
-CamelCipherContext *
-camel_gpg_context_new (CamelSession *session)
-{
- CamelCipherContext *cipher;
- CamelGpgContext *ctx;
-
- g_return_val_if_fail (CAMEL_IS_SESSION (session), NULL);
-
- ctx = (CamelGpgContext *) camel_object_new (camel_gpg_context_get_type ());
-
- cipher = (CamelCipherContext *) ctx;
- cipher->session = session;
- camel_object_ref (session);
-
- return cipher;
-}
-
-
-/**
- * camel_gpg_context_set_always_trust:
- * @ctx: gpg context
- * @always_trust always truct flag
- *
- * Sets the @always_trust flag on the gpg context which is used for
- * encryption.
- **/
-void
-camel_gpg_context_set_always_trust (CamelGpgContext *ctx, gboolean always_trust)
-{
- g_return_if_fail (CAMEL_IS_GPG_CONTEXT (ctx));
-
- ctx->always_trust = always_trust;
-}
-
-
-static const char *
-gpg_hash_to_id (CamelCipherContext *context, CamelCipherHash hash)
-{
- switch (hash) {
- case CAMEL_CIPHER_HASH_MD2:
- return "pgp-md2";
- case CAMEL_CIPHER_HASH_MD5:
- return "pgp-md5";
- case CAMEL_CIPHER_HASH_SHA1:
- case CAMEL_CIPHER_HASH_DEFAULT:
- return "pgp-sha1";
- case CAMEL_CIPHER_HASH_RIPEMD160:
- return "pgp-ripemd160";
- case CAMEL_CIPHER_HASH_TIGER192:
- return "pgp-tiger192";
- case CAMEL_CIPHER_HASH_HAVAL5160:
- return "pgp-haval-5-160";
- }
-
- return NULL;
-}
-
-static CamelCipherHash
-gpg_id_to_hash (CamelCipherContext *context, const char *id)
-{
- if (id) {
- if (!strcmp (id, "pgp-md2"))
- return CAMEL_CIPHER_HASH_MD2;
- else if (!strcmp (id, "pgp-md5"))
- return CAMEL_CIPHER_HASH_MD5;
- else if (!strcmp (id, "pgp-sha1"))
- return CAMEL_CIPHER_HASH_SHA1;
- else if (!strcmp (id, "pgp-ripemd160"))
- return CAMEL_CIPHER_HASH_RIPEMD160;
- else if (!strcmp (id, "tiger192"))
- return CAMEL_CIPHER_HASH_TIGER192;
- else if (!strcmp (id, "haval-5-160"))
- return CAMEL_CIPHER_HASH_HAVAL5160;
- }
-
- return CAMEL_CIPHER_HASH_DEFAULT;
-}
-
-
-enum _GpgCtxMode {
- GPG_CTX_MODE_SIGN,
- GPG_CTX_MODE_VERIFY,
- GPG_CTX_MODE_ENCRYPT,
- GPG_CTX_MODE_DECRYPT,
- GPG_CTX_MODE_IMPORT,
- GPG_CTX_MODE_EXPORT,
-};
-
-enum _GpgTrustMetric {
- GPG_TRUST_UNKNOWN,
- GPG_TRUST_NEVER,
- GPG_TRUST_MARGINAL,
- GPG_TRUST_FULLY,
- GPG_TRUST_ULTIMATE
-};
-
-struct _GpgCtx {
- enum _GpgCtxMode mode;
- CamelSession *session;
- GHashTable *userid_hint;
- pid_t pid;
-
- char *userid;
- char *sigfile;
- GPtrArray *recipients;
- CamelCipherHash hash;
-
- int stdin_fd;
- int stdout_fd;
- int stderr_fd;
- int status_fd;
- int passwd_fd; /* only needed for sign/decrypt */
-
- /* status-fd buffer */
- unsigned char *statusbuf;
- unsigned char *statusptr;
- unsigned int statusleft;
-
- char *passwd;
-
- CamelStream *istream;
- CamelStream *ostream;
-
- GByteArray *diagbuf;
- CamelStream *diagnostics;
-
- int exit_status;
-
- unsigned int exited:1;
- unsigned int complete:1;
- unsigned int seen_eof1:1;
- unsigned int seen_eof2:1;
- unsigned int always_trust:1;
- unsigned int armor:1;
- unsigned int need_passwd:1;
- unsigned int send_passwd:1;
-
- unsigned int bad_passwds:2;
-
- unsigned int validsig:1;
- unsigned int trust:3;
-
- unsigned int diagflushed:1;
-
- unsigned int utf8:1;
-
- unsigned int padding:16;
-};
-
-static struct _GpgCtx *
-gpg_ctx_new (CamelSession *session)
-{
- struct _GpgCtx *gpg;
- const char *charset;
- CamelStream *stream;
-
- gpg = g_new (struct _GpgCtx, 1);
- gpg->mode = GPG_CTX_MODE_SIGN;
- gpg->session = session;
- camel_object_ref (session);
- gpg->userid_hint = g_hash_table_new (g_str_hash, g_str_equal);
- gpg->complete = FALSE;
- gpg->seen_eof1 = TRUE;
- gpg->seen_eof2 = FALSE;
- gpg->pid = (pid_t) -1;
- gpg->exit_status = 0;
- gpg->exited = FALSE;
-
- gpg->userid = NULL;
- gpg->sigfile = NULL;
- gpg->recipients = NULL;
- gpg->hash = CAMEL_CIPHER_HASH_DEFAULT;
- gpg->always_trust = FALSE;
- gpg->armor = FALSE;
-
- gpg->stdin_fd = -1;
- gpg->stdout_fd = -1;
- gpg->stderr_fd = -1;
- gpg->status_fd = -1;
- gpg->passwd_fd = -1;
-
- gpg->statusbuf = g_malloc (128);
- gpg->statusptr = gpg->statusbuf;
- gpg->statusleft = 128;
-
- gpg->bad_passwds = 0;
- gpg->need_passwd = FALSE;
- gpg->send_passwd = FALSE;
- gpg->passwd = NULL;
-
- gpg->validsig = FALSE;
- gpg->trust = GPG_TRUST_UNKNOWN;
-
- gpg->istream = NULL;
- gpg->ostream = NULL;
-
- stream = camel_stream_mem_new ();
- gpg->diagbuf = CAMEL_STREAM_MEM (stream)->buffer;
- gpg->diagflushed = FALSE;
-
- if ((charset = e_iconv_locale_charset ()) && strcasecmp (charset, "UTF-8") != 0) {
- CamelMimeFilterCharset *filter;
- CamelStreamFilter *fstream;
-
- gpg->utf8 = FALSE;
-
- if ((filter = camel_mime_filter_charset_new_convert (charset, "UTF-8"))) {
- fstream = camel_stream_filter_new_with_stream (stream);
- camel_stream_filter_add (fstream, (CamelMimeFilter *) filter);
- camel_object_unref (filter);
- camel_object_unref (stream);
-
- stream = (CamelStream *) fstream;
- }
- } else {
- gpg->utf8 = TRUE;
- }
-
- gpg->diagnostics = stream;
-
- return gpg;
-}
-
-static void
-gpg_ctx_set_mode (struct _GpgCtx *gpg, enum _GpgCtxMode mode)
-{
- gpg->mode = mode;
- gpg->need_passwd = ((gpg->mode == GPG_CTX_MODE_SIGN) || (gpg->mode == GPG_CTX_MODE_DECRYPT));
-}
-
-static void
-gpg_ctx_set_hash (struct _GpgCtx *gpg, CamelCipherHash hash)
-{
- gpg->hash = hash;
-}
-
-static void
-gpg_ctx_set_always_trust (struct _GpgCtx *gpg, gboolean trust)
-{
- gpg->always_trust = trust;
-}
-
-static void
-gpg_ctx_set_userid (struct _GpgCtx *gpg, const char *userid)
-{
- g_free (gpg->userid);
- gpg->userid = g_strdup (userid);
-}
-
-static void
-gpg_ctx_add_recipient (struct _GpgCtx *gpg, const char *keyid)
-{
- if (gpg->mode != GPG_CTX_MODE_ENCRYPT && gpg->mode != GPG_CTX_MODE_EXPORT)
- return;
-
- if (!gpg->recipients)
- gpg->recipients = g_ptr_array_new ();
-
- g_ptr_array_add (gpg->recipients, g_strdup (keyid));
-}
-
-static void
-gpg_ctx_set_sigfile (struct _GpgCtx *gpg, const char *sigfile)
-{
- g_free (gpg->sigfile);
- gpg->sigfile = g_strdup (sigfile);
-}
-
-static void
-gpg_ctx_set_armor (struct _GpgCtx *gpg, gboolean armor)
-{
- gpg->armor = armor;
-}
-
-static void
-gpg_ctx_set_istream (struct _GpgCtx *gpg, CamelStream *istream)
-{
- camel_object_ref (istream);
- if (gpg->istream)
- camel_object_unref (gpg->istream);
- gpg->istream = istream;
-}
-
-static void
-gpg_ctx_set_ostream (struct _GpgCtx *gpg, CamelStream *ostream)
-{
- camel_object_ref (ostream);
- if (gpg->ostream)
- camel_object_unref (gpg->ostream);
- gpg->ostream = ostream;
- gpg->seen_eof1 = FALSE;
-}
-
-static const char *
-gpg_ctx_get_diagnostics (struct _GpgCtx *gpg)
-{
- if (!gpg->diagflushed) {
- gpg->diagflushed = TRUE;
- camel_stream_flush (gpg->diagnostics);
- if (gpg->diagbuf->len == 0)
- return NULL;
-
- g_byte_array_append (gpg->diagbuf, "", 1);
- }
-
- return gpg->diagbuf->data;
-}
-
-static void
-userid_hint_free (gpointer key, gpointer value, gpointer user_data)
-{
- g_free (key);
- g_free (value);
-}
-
-static void
-gpg_ctx_free (struct _GpgCtx *gpg)
-{
- int i;
-
- if (gpg == NULL)
- return;
-
- if (gpg->session)
- camel_object_unref (gpg->session);
-
- g_hash_table_foreach (gpg->userid_hint, userid_hint_free, NULL);
- g_hash_table_destroy (gpg->userid_hint);
-
- g_free (gpg->userid);
-
- g_free (gpg->sigfile);
-
- if (gpg->recipients) {
- for (i = 0; i < gpg->recipients->len; i++)
- g_free (gpg->recipients->pdata[i]);
-
- g_ptr_array_free (gpg->recipients, TRUE);
- }
-
- if (gpg->stdin_fd != -1)
- close (gpg->stdin_fd);
- if (gpg->stdout_fd != -1)
- close (gpg->stdout_fd);
- if (gpg->stderr_fd != -1)
- close (gpg->stderr_fd);
- if (gpg->status_fd != -1)
- close (gpg->status_fd);
- if (gpg->passwd_fd != -1)
- close (gpg->passwd_fd);
-
- g_free (gpg->statusbuf);
-
- if (gpg->passwd)
- g_free (gpg->passwd);
-
- if (gpg->istream)
- camel_object_unref (gpg->istream);
-
- if (gpg->ostream)
- camel_object_unref (gpg->ostream);
-
- camel_object_unref (gpg->diagnostics);
-
- g_free (gpg);
-}
-
-static const char *
-gpg_hash_str (CamelCipherHash hash)
-{
- switch (hash) {
- case CAMEL_CIPHER_HASH_MD2:
- return "--digest-algo=MD2";
- case CAMEL_CIPHER_HASH_MD5:
- return "--digest-algo=MD5";
- case CAMEL_CIPHER_HASH_SHA1:
- return "--digest-algo=SHA1";
- case CAMEL_CIPHER_HASH_RIPEMD160:
- return "--digest-algo=RIPEMD160";
- default:
- return NULL;
- }
-}
-
-static GPtrArray *
-gpg_ctx_get_argv (struct _GpgCtx *gpg, int status_fd, char **sfd, int passwd_fd, char **pfd)
-{
- const char *hash_str;
- GPtrArray *argv;
- char *buf;
- int i;
-
- argv = g_ptr_array_new ();
- g_ptr_array_add (argv, "gpg");
-
- g_ptr_array_add (argv, "--verbose");
- g_ptr_array_add (argv, "--no-secmem-warning");
- g_ptr_array_add (argv, "--no-greeting");
- g_ptr_array_add (argv, "--no-tty");
- if (passwd_fd == -1) {
- /* only use batch mode if we don't intend on using the
- interactive --command-fd option */
- g_ptr_array_add (argv, "--batch");
- g_ptr_array_add (argv, "--yes");
- }
-
- *sfd = buf = g_strdup_printf ("--status-fd=%d", status_fd);
- g_ptr_array_add (argv, buf);
-
- if (passwd_fd != -1) {
- *pfd = buf = g_strdup_printf ("--command-fd=%d", passwd_fd);
- g_ptr_array_add (argv, buf);
- }
-
- switch (gpg->mode) {
- case GPG_CTX_MODE_SIGN:
- g_ptr_array_add (argv, "--sign");
- g_ptr_array_add (argv, "--detach");
- if (gpg->armor)
- g_ptr_array_add (argv, "--armor");
- hash_str = gpg_hash_str (gpg->hash);
- if (hash_str)
- g_ptr_array_add (argv, (char *) hash_str);
- if (gpg->userid) {
- g_ptr_array_add (argv, "-u");
- g_ptr_array_add (argv, (char *) gpg->userid);
- }
- g_ptr_array_add (argv, "--output");
- g_ptr_array_add (argv, "-");
- break;
- case GPG_CTX_MODE_VERIFY:
- if (!camel_session_is_online (gpg->session)) {
- /* this is a deprecated flag to gpg since 1.0.7 */
- /*g_ptr_array_add (argv, "--no-auto-key-retrieve");*/
- g_ptr_array_add (argv, "--keyserver-options");
- g_ptr_array_add (argv, "no-auto-key-retrieve");
- }
- g_ptr_array_add (argv, "--verify");
- if (gpg->sigfile)
- g_ptr_array_add (argv, gpg->sigfile);
- g_ptr_array_add (argv, "-");
- break;
- case GPG_CTX_MODE_ENCRYPT:
- g_ptr_array_add (argv, "--encrypt");
- if (gpg->armor)
- g_ptr_array_add (argv, "--armor");
- if (gpg->always_trust)
- g_ptr_array_add (argv, "--always-trust");
- if (gpg->userid) {
- g_ptr_array_add (argv, "-u");
- g_ptr_array_add (argv, (char *) gpg->userid);
- }
- if (gpg->recipients) {
- for (i = 0; i < gpg->recipients->len; i++) {
- g_ptr_array_add (argv, "-r");
- g_ptr_array_add (argv, gpg->recipients->pdata[i]);
- }
- }
- g_ptr_array_add (argv, "--output");
- g_ptr_array_add (argv, "-");
- break;
- case GPG_CTX_MODE_DECRYPT:
- g_ptr_array_add (argv, "--decrypt");
- g_ptr_array_add (argv, "--output");
- g_ptr_array_add (argv, "-");
- break;
- case GPG_CTX_MODE_IMPORT:
- g_ptr_array_add (argv, "--import");
- g_ptr_array_add (argv, "-");
- break;
- case GPG_CTX_MODE_EXPORT:
- if (gpg->armor)
- g_ptr_array_add (argv, "--armor");
- g_ptr_array_add (argv, "--export");
- for (i = 0; i < gpg->recipients->len; i++)
- g_ptr_array_add (argv, gpg->recipients->pdata[i]);
- break;
- }
-
- g_ptr_array_add (argv, NULL);
-
- return argv;
-}
-
-static int
-gpg_ctx_op_start (struct _GpgCtx *gpg)
-{
- char *status_fd = NULL, *passwd_fd = NULL;
- int i, maxfd, errnosave, fds[10];
- GPtrArray *argv;
- int flags;
-
- for (i = 0; i < 10; i++)
- fds[i] = -1;
-
- maxfd = gpg->need_passwd ? 10 : 8;
- for (i = 0; i < maxfd; i += 2) {
- if (pipe (fds + i) == -1)
- goto exception;
- }
-
- argv = gpg_ctx_get_argv (gpg, fds[7], &status_fd, fds[8], &passwd_fd);
-
- if (!(gpg->pid = fork ())) {
- /* child process */
-
- if ((dup2 (fds[0], STDIN_FILENO) < 0 ) ||
- (dup2 (fds[3], STDOUT_FILENO) < 0 ) ||
- (dup2 (fds[5], STDERR_FILENO) < 0 )) {
- _exit (255);
- }
-
- /* Dissociate from camel's controlling terminal so
- * that gpg won't be able to read from it.
- */
- setsid ();
-
- maxfd = sysconf (_SC_OPEN_MAX);
- /* Loop over all fds. */
- for (i = 3; i < maxfd; i++) {
- /* don't close the status-fd or passwd-fd */
- if (i != fds[7] && i != fds[8])
- fcntl (i, F_SETFD, FD_CLOEXEC);
- }
-
- /* run gpg */
- execvp ("gpg", (char **) argv->pdata);
- _exit (255);
- } else if (gpg->pid < 0) {
- g_ptr_array_free (argv, TRUE);
- g_free (status_fd);
- g_free (passwd_fd);
- goto exception;
- }
-
- g_ptr_array_free (argv, TRUE);
- g_free (status_fd);
- g_free (passwd_fd);
-
- /* Parent */
- close (fds[0]);
- gpg->stdin_fd = fds[1];
- gpg->stdout_fd = fds[2];
- close (fds[3]);
- gpg->stderr_fd = fds[4];
- close (fds[5]);
- gpg->status_fd = fds[6];
- close (fds[7]);
- if (gpg->need_passwd) {
- close (fds[8]);
- gpg->passwd_fd = fds[9];
- flags = fcntl (gpg->passwd_fd, F_GETFL);
- fcntl (gpg->passwd_fd, F_SETFL, flags | O_NONBLOCK);
- }
-
- flags = fcntl (gpg->stdin_fd, F_GETFL);
- fcntl (gpg->stdin_fd, F_SETFL, flags | O_NONBLOCK);
-
- flags = fcntl (gpg->stdout_fd, F_GETFL);
- fcntl (gpg->stdout_fd, F_SETFL, flags | O_NONBLOCK);
-
- flags = fcntl (gpg->stderr_fd, F_GETFL);
- fcntl (gpg->stderr_fd, F_SETFL, flags | O_NONBLOCK);
-
- flags = fcntl (gpg->status_fd, F_GETFL);
- fcntl (gpg->status_fd, F_SETFL, flags | O_NONBLOCK);
-
- return 0;
-
- exception:
-
- errnosave = errno;
-
- for (i = 0; i < 10; i++) {
- if (fds[i] != -1)
- close (fds[i]);
- }
-
- errno = errnosave;
-
- return -1;
-}
-
-static const char *
-next_token (const char *in, char **token)
-{
- const char *start, *inptr = in;
-
- while (*inptr == ' ')
- inptr++;
-
- if (*inptr == '\0' || *inptr == '\n') {
- if (token)
- *token = NULL;
- return inptr;
- }
-
- start = inptr;
- while (*inptr && *inptr != ' ' && *inptr != '\n')
- inptr++;
-
- if (token)
- *token = g_strndup (start, inptr - start);
-
- return inptr;
-}
-
-static int
-gpg_ctx_parse_status (struct _GpgCtx *gpg, CamelException *ex)
-{
- register unsigned char *inptr;
- const unsigned char *status;
- size_t nread, nwritten;
- int len;
-
- parse:
-
- inptr = gpg->statusbuf;
- while (inptr < gpg->statusptr && *inptr != '\n')
- inptr++;
-
- if (*inptr != '\n') {
- /* we don't have enough data buffered to parse this status line */
- return 0;
- }
-
- *inptr++ = '\0';
- status = gpg->statusbuf;
-
- d(printf ("status: %s\n", status));
-
- if (strncmp (status, "[GNUPG:] ", 9) != 0) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Unexpected GnuPG status message encountered:\n\n%s"),
- status);
- return -1;
- }
-
- status += 9;
-
- if (!strncmp (status, "USERID_HINT ", 12)) {
- char *hint, *user;
-
- status += 12;
- status = next_token (status, &hint);
- if (!hint) {
- camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Failed to parse gpg userid hint."));
- return -1;
- }
-
- if (g_hash_table_lookup (gpg->userid_hint, hint)) {
- /* we already have this userid hint... */
- g_free (hint);
- goto recycle;
- }
-
- if (gpg->utf8 || !(user = g_locale_to_utf8 (status, -1, &nread, &nwritten, NULL)))
- user = g_strdup (status);
-
- g_strstrip (user);
-
- g_hash_table_insert (gpg->userid_hint, hint, user);
- } else if (!strncmp (status, "NEED_PASSPHRASE ", 16)) {
- char *prompt, *userid, *passwd;
- const char *name;
-
- status += 16;
-
- status = next_token (status, &userid);
- if (!userid) {
- camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Failed to parse gpg passphrase request."));
- return -1;
- }
-
- name = g_hash_table_lookup (gpg->userid_hint, userid);
- if (!name)
- name = userid;
-
- prompt = g_strdup_printf (_("You need a passphrase to unlock the key for\n"
- "user: \"%s\""), name);
-
- if ((passwd = camel_session_get_password (gpg->session, prompt, FALSE, TRUE, NULL, userid, ex)) && !gpg->utf8) {
- char *opasswd = passwd;
-
- if ((passwd = g_locale_to_utf8 (passwd, -1, &nread, &nwritten, NULL))) {
- memset (opasswd, 0, strlen (opasswd));
- g_free (opasswd);
- } else {
- passwd = opasswd;
- }
- }
- g_free (prompt);
-
- g_free (gpg->userid);
- gpg->userid = userid;
-
- if (passwd == NULL) {
- if (!camel_exception_is_set (ex))
- camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL, _("Cancelled."));
- return -1;
- }
-
- gpg->passwd = g_strdup_printf ("%s\n", passwd);
- memset (passwd, 0, strlen (passwd));
- g_free (passwd);
-
- gpg->send_passwd = TRUE;
- } else if (!strncmp (status, "GOOD_PASSPHRASE", 15)) {
- gpg->bad_passwds = 0;
- } else if (!strncmp (status, "BAD_PASSPHRASE", 14)) {
- gpg->bad_passwds++;
-
- camel_session_forget_password (gpg->session, NULL, gpg->userid, ex);
-
- if (gpg->bad_passwds == 3) {
- camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
- _("Failed to unlock secret key: 3 bad passphrases given."));
- return -1;
- }
- } else if (!strncmp (status, "UNEXPECTED ", 11)) {
- /* this is an error */
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Unexpected response from GnuPG: %s"),
- status + 11);
- return -1;
- } else if (!strncmp (status, "NODATA", 6)) {
- /* this is an error */
- const char *diagnostics;
-
- diagnostics = gpg_ctx_get_diagnostics (gpg);
- if (diagnostics && *diagnostics)
- camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, diagnostics);
- else
- camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
- _("No data provided"));
- return -1;
- } else {
- /* check to see if we are complete */
- switch (gpg->mode) {
- case GPG_CTX_MODE_SIGN:
- if (!strncmp (status, "SIG_CREATED ", 12)) {
- /* FIXME: save this state? */
- }
- break;
- case GPG_CTX_MODE_VERIFY:
- if (!strncmp (status, "TRUST_", 6)) {
- status += 6;
- if (!strncmp (status, "NEVER", 5)) {
- gpg->trust = GPG_TRUST_NEVER;
- } else if (!strncmp (status, "MARGINAL", 8)) {
- gpg->trust = GPG_TRUST_MARGINAL;
- } else if (!strncmp (status, "FULLY", 5)) {
- gpg->trust = GPG_TRUST_FULLY;
- } else if (!strncmp (status, "ULTIMATE", 8)) {
- gpg->trust = GPG_TRUST_ULTIMATE;
- }
- } else if (!strncmp (status, "VALIDSIG", 8)) {
- gpg->validsig = TRUE;
- } else if (!strncmp (status, "BADSIG", 6)) {
- gpg->validsig = FALSE;
- } else if (!strncmp (status, "ERRSIG", 6)) {
- /* Note: NO_PUBKEY often comes after an ERRSIG, but do we really care? */
- gpg->validsig = FALSE;
- }
- break;
- case GPG_CTX_MODE_ENCRYPT:
- if (!strncmp (status, "BEGIN_ENCRYPTION", 16)) {
- /* nothing to do... but we know to expect data on stdout soon */
- } else if (!strncmp (status, "END_ENCRYPTION", 14)) {
- /* nothing to do, but we know the end is near? */
- } else if (!strncmp (status, "NO_RECP", 7)) {
- camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Failed to encrypt: No valid recipients specified."));
- return -1;
- }
- break;
- case GPG_CTX_MODE_DECRYPT:
- if (!strncmp (status, "BEGIN_DECRYPTION", 16)) {
- /* nothing to do... but we know to expect data on stdout soon */
- } else if (!strncmp (status, "END_DECRYPTION", 14)) {
- /* nothing to do, but we know the end is near? */
- }
- break;
- case GPG_CTX_MODE_IMPORT:
- /* noop */
- break;
- case GPG_CTX_MODE_EXPORT:
- /* noop */
- break;
- }
- }
-
- recycle:
-
- /* recycle our statusbuf by moving inptr to the beginning of statusbuf */
- len = gpg->statusptr - inptr;
- memmove (gpg->statusbuf, inptr, len);
-
- len = inptr - gpg->statusbuf;
- gpg->statusleft += len;
- gpg->statusptr -= len;
-
- /* if we have more data, try parsing the next line? */
- if (gpg->statusptr > gpg->statusbuf)
- goto parse;
-
- return 0;
-}
-
-#define status_backup(gpg, start, len) G_STMT_START { \
- if (gpg->statusleft <= len) { \
- unsigned int slen, soff; \
- \
- slen = soff = gpg->statusptr - gpg->statusbuf; \
- slen = slen ? slen : 1; \
- \
- while (slen < soff + len) \
- slen <<= 1; \
- \
- gpg->statusbuf = g_realloc (gpg->statusbuf, slen + 1); \
- gpg->statusptr = gpg->statusbuf + soff; \
- gpg->statusleft = slen - soff; \
- } \
- \
- memcpy (gpg->statusptr, start, len); \
- gpg->statusptr += len; \
- gpg->statusleft -= len; \
-} G_STMT_END
-
-static int
-gpg_ctx_op_step (struct _GpgCtx *gpg, CamelException *ex)
-{
- fd_set rdset, wrset, *wrsetp = NULL;
- const char *diagnostics;
- struct timeval timeout;
- const char *mode;
- int maxfd = 0;
- int ready;
-
- retry:
- FD_ZERO (&rdset);
-
- if (!gpg->seen_eof1) {
- FD_SET (gpg->stdout_fd, &rdset);
- maxfd = MAX (maxfd, gpg->stdout_fd);
- }
-
- if (!gpg->seen_eof2) {
- FD_SET (gpg->stderr_fd, &rdset);
- maxfd = MAX (maxfd, gpg->stderr_fd);
- }
-
- if (!gpg->complete) {
- FD_SET (gpg->status_fd, &rdset);
- maxfd = MAX (maxfd, gpg->status_fd);
- }
-
- if (gpg->stdin_fd != -1 || gpg->passwd_fd != -1) {
- FD_ZERO (&wrset);
- if (gpg->stdin_fd != -1) {
- FD_SET (gpg->stdin_fd, &wrset);
- maxfd = MAX (maxfd, gpg->stdin_fd);
- }
- if (gpg->passwd_fd != -1) {
- FD_SET (gpg->passwd_fd, &wrset);
- maxfd = MAX (maxfd, gpg->passwd_fd);
- }
-
- wrsetp = &wrset;
- }
-
- g_assert (maxfd > 0);
-
- timeout.tv_sec = 10; /* timeout in seconds */
- timeout.tv_usec = 0;
-
- if ((ready = select (maxfd + 1, &rdset, wrsetp, NULL, &timeout)) == 0)
- return 0;
-
- if (ready < 0) {
- if (errno == EINTR)
- goto retry;
-
- d(printf ("select() failed: %s\n", strerror (errno)));
-
- return -1;
- }
-
- /* Test each and every file descriptor to see if it's 'ready',
- and if so - do what we can with it and then drop through to
- the next file descriptor and so on until we've done what we
- can to all of them. If one fails along the way, return
- -1. */
-
- if (FD_ISSET (gpg->status_fd, &rdset)) {
- /* read the status message and decide what to do... */
- char buffer[4096];
- ssize_t nread;
-
- d(printf ("reading from gpg's status-fd...\n"));
-
- do {
- nread = read (gpg->status_fd, buffer, sizeof (buffer));
- } while (nread == -1 && (errno == EINTR || errno == EAGAIN));
- if (nread == -1)
- goto exception;
-
- if (nread > 0) {
- status_backup (gpg, buffer, nread);
-
- if (gpg_ctx_parse_status (gpg, ex) == -1)
- return -1;
- } else {
- gpg->complete = TRUE;
- }
- }
-
- if (FD_ISSET (gpg->stdout_fd, &rdset) && gpg->ostream) {
- char buffer[4096];
- ssize_t nread;
-
- d(printf ("reading gpg's stdout...\n"));
-
- do {
- nread = read (gpg->stdout_fd, buffer, sizeof (buffer));
- } while (nread == -1 && (errno == EINTR || errno == EAGAIN));
- if (nread == -1)
- goto exception;
-
- if (nread > 0) {
- if (camel_stream_write (gpg->ostream, buffer, (size_t) nread) == -1)
- goto exception;
- } else {
- gpg->seen_eof1 = TRUE;
- }
- }
-
- if (FD_ISSET (gpg->stderr_fd, &rdset)) {
- char buffer[4096];
- ssize_t nread;
-
- d(printf ("reading gpg's stderr...\n"));
-
- do {
- nread = read (gpg->stderr_fd, buffer, sizeof (buffer));
- } while (nread == -1 && (errno == EINTR || errno == EAGAIN));
- if (nread == -1)
- goto exception;
-
- if (nread > 0) {
- camel_stream_write (gpg->diagnostics, buffer, nread);
- } else {
- gpg->seen_eof2 = TRUE;
- }
- }
-
- if (wrsetp && gpg->passwd_fd != -1 && FD_ISSET (gpg->passwd_fd, &wrset) && gpg->need_passwd && gpg->send_passwd) {
- ssize_t w, nwritten = 0;
- size_t n;
-
- d(printf ("sending gpg our passphrase...\n"));
-
- /* send the passphrase to gpg */
- n = strlen (gpg->passwd);
- do {
- do {
- w = write (gpg->passwd_fd, gpg->passwd + nwritten, n - nwritten);
- } while (w == -1 && (errno == EINTR || errno == EAGAIN));
-
- if (w > 0)
- nwritten += w;
- } while (nwritten < n && w != -1);
-
- /* zero and free our passwd buffer */
- memset (gpg->passwd, 0, n);
- g_free (gpg->passwd);
- gpg->passwd = NULL;
-
- if (w == -1)
- goto exception;
-
- gpg->send_passwd = FALSE;
- }
-
- if (gpg->istream && wrsetp && gpg->stdin_fd != -1 && FD_ISSET (gpg->stdin_fd, &wrset)) {
- char buffer[4096];
- ssize_t nread;
-
- d(printf ("writing to gpg's stdin...\n"));
-
- /* write our stream to gpg's stdin */
- nread = camel_stream_read (gpg->istream, buffer, sizeof (buffer));
- if (nread > 0) {
- ssize_t w, nwritten = 0;
-
- do {
- do {
- w = write (gpg->stdin_fd, buffer + nwritten, nread - nwritten);
- } while (w == -1 && (errno == EINTR || errno == EAGAIN));
-
- if (w > 0)
- nwritten += w;
- } while (nwritten < nread && w != -1);
-
- d(printf ("wrote %d (out of %d) bytes to gpg's stdin\n", nwritten, nread));
-
- if (w == -1)
- goto exception;
- }
-
- if (camel_stream_eos (gpg->istream)) {
- d(printf ("closing gpg's stdin\n"));
- close (gpg->stdin_fd);
- gpg->stdin_fd = -1;
- }
- }
-
- return 0;
-
- exception:
-
- switch (gpg->mode) {
- case GPG_CTX_MODE_SIGN:
- mode = "sign";
- break;
- case GPG_CTX_MODE_VERIFY:
- mode = "verify";
- break;
- case GPG_CTX_MODE_ENCRYPT:
- mode = "encrypt";
- break;
- case GPG_CTX_MODE_DECRYPT:
- mode = "decrypt";
- break;
- case GPG_CTX_MODE_IMPORT:
- mode = "import keys";
- break;
- case GPG_CTX_MODE_EXPORT:
- mode = "export keys";
- break;
- default:
- g_assert_not_reached ();
- mode = NULL;
- break;
- }
-
- diagnostics = gpg_ctx_get_diagnostics (gpg);
- if (diagnostics && *diagnostics) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Failed to GPG %s: %s\n\n%s"),
- mode, g_strerror (errno),
- diagnostics);
- } else {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Failed to GPG %s: %s\n"),
- mode, g_strerror (errno));
- }
-
- return -1;
-}
-
-static gboolean
-gpg_ctx_op_complete (struct _GpgCtx *gpg)
-{
- return gpg->complete && gpg->seen_eof1 && gpg->seen_eof2;
-}
-
-#if 0
-static gboolean
-gpg_ctx_op_exited (struct _GpgCtx *gpg)
-{
- pid_t retval;
- int status;
-
- if (gpg->exited)
- return TRUE;
-
- retval = waitpid (gpg->pid, &status, WNOHANG);
- if (retval == gpg->pid) {
- gpg->exit_status = status;
- gpg->exited = TRUE;
- return TRUE;
- }
-
- return FALSE;
-}
-#endif
-
-static void
-gpg_ctx_op_cancel (struct _GpgCtx *gpg)
-{
- pid_t retval;
- int status;
-
- if (gpg->exited)
- return;
-
- kill (gpg->pid, SIGTERM);
- sleep (1);
- retval = waitpid (gpg->pid, &status, WNOHANG);
- if (retval == (pid_t) 0) {
- /* no more mr nice guy... */
- kill (gpg->pid, SIGKILL);
- sleep (1);
- waitpid (gpg->pid, &status, WNOHANG);
- }
-}
-
-static int
-gpg_ctx_op_wait (struct _GpgCtx *gpg)
-{
- sigset_t mask, omask;
- pid_t retval;
- int status;
-
- if (!gpg->exited) {
- sigemptyset (&mask);
- sigaddset (&mask, SIGALRM);
- sigprocmask (SIG_BLOCK, &mask, &omask);
- alarm (1);
- retval = waitpid (gpg->pid, &status, 0);
- alarm (0);
- sigprocmask (SIG_SETMASK, &omask, NULL);
-
- if (retval == (pid_t) -1 && errno == EINTR) {
- /* The child is hanging: send a friendly reminder. */
- kill (gpg->pid, SIGTERM);
- sleep (1);
- retval = waitpid (gpg->pid, &status, WNOHANG);
- if (retval == (pid_t) 0) {
- /* Still hanging; use brute force. */
- kill (gpg->pid, SIGKILL);
- sleep (1);
- retval = waitpid (gpg->pid, &status, WNOHANG);
- }
- }
- } else {
- status = gpg->exit_status;
- retval = gpg->pid;
- }
-
- if (retval != (pid_t) -1 && WIFEXITED (status))
- return WEXITSTATUS (status);
- else
- return -1;
-}
-
-
-
-static int
-gpg_sign (CamelCipherContext *context, const char *userid, CamelCipherHash hash, CamelMimePart *ipart, CamelMimePart *opart, CamelException *ex)
-{
- struct _GpgCtx *gpg;
- CamelStream *ostream = camel_stream_mem_new(), *istream;
- CamelDataWrapper *dw;
- CamelContentType *ct;
- int res = -1;
- CamelMimePart *sigpart;
- CamelMultipartSigned *mps;
-
- /* Note: see rfc2015 or rfc3156, section 5 */
-
- /* FIXME: stream this, we stream output at least */
- istream = camel_stream_mem_new();
- if (camel_cipher_canonical_to_stream(ipart, CAMEL_MIME_FILTER_CANON_STRIP|CAMEL_MIME_FILTER_CANON_CRLF|CAMEL_MIME_FILTER_CANON_FROM,
- istream) == -1) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not generate signing data: %s"), g_strerror(errno));
- goto fail;
- }
-
- gpg = gpg_ctx_new (context->session);
- gpg_ctx_set_mode (gpg, GPG_CTX_MODE_SIGN);
- gpg_ctx_set_hash (gpg, hash);
- gpg_ctx_set_armor (gpg, TRUE);
- gpg_ctx_set_userid (gpg, userid);
- gpg_ctx_set_istream (gpg, istream);
- gpg_ctx_set_ostream (gpg, ostream);
-
- if (gpg_ctx_op_start (gpg) == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Failed to execute gpg: %s"), g_strerror (errno));
- goto fail;
- }
-
- while (!gpg_ctx_op_complete (gpg)) {
- if (camel_operation_cancel_check (NULL)) {
- camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
- _("Cancelled."));
- gpg_ctx_op_cancel (gpg);
- goto fail;
- }
-
- if (gpg_ctx_op_step (gpg, ex) == -1) {
- gpg_ctx_op_cancel (gpg);
- goto fail;
- }
- }
-
- if (gpg_ctx_op_wait (gpg) != 0) {
- const char *diagnostics;
-
- diagnostics = gpg_ctx_get_diagnostics (gpg);
- camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
- diagnostics && *diagnostics ? diagnostics :
- _("Failed to execute gpg."));
- goto fail;
- }
-
- res = 0;
-
- dw = camel_data_wrapper_new();
- camel_stream_reset(ostream);
- camel_data_wrapper_construct_from_stream(dw, ostream);
-
- sigpart = camel_mime_part_new();
- ct = camel_content_type_new("application", "pgp-signature");
- camel_content_type_set_param(ct, "name", "signature.asc");
- camel_data_wrapper_set_mime_type_field(dw, ct);
- camel_content_type_unref(ct);
-
- camel_medium_set_content_object((CamelMedium *)sigpart, dw);
- camel_object_unref(dw);
-
- camel_mime_part_set_description(sigpart, _("This is a digitally signed message part"));
-
- mps = camel_multipart_signed_new();
- ct = camel_content_type_new("multipart", "signed");
- camel_content_type_set_param(ct, "micalg", camel_cipher_hash_to_id(context, hash));
- camel_content_type_set_param(ct, "protocol", context->sign_protocol);
- camel_data_wrapper_set_mime_type_field((CamelDataWrapper *)mps, ct);
- camel_content_type_unref(ct);
- camel_multipart_set_boundary((CamelMultipart *)mps, NULL);
-
- mps->signature = sigpart;
- mps->contentraw = istream;
- camel_stream_reset(istream);
- camel_object_ref(istream);
-
- camel_medium_set_content_object((CamelMedium *)opart, (CamelDataWrapper *)mps);
-fail:
- camel_object_unref(ostream);
- gpg_ctx_free (gpg);
-
- return res;
-}
-
-
-static char *
-swrite (CamelMimePart *sigpart)
-{
- CamelStream *ostream;
- char *template;
- int fd, ret;
-
- template = g_strdup ("/tmp/evolution-pgp.XXXXXX");
- fd = mkstemp (template);
- if (fd == -1) {
- g_free (template);
- return NULL;
- }
-
- /* TODO: This should probably just write the decoded message content out, not the part + headers */
-
- ostream = camel_stream_fs_new_with_fd (fd);
- ret = camel_data_wrapper_write_to_stream((CamelDataWrapper *)sigpart, ostream);
- if (ret != -1) {
- ret = camel_stream_flush (ostream);
- if (ret != -1)
- ret = camel_stream_close (ostream);
- }
-
- camel_object_unref(ostream);
-
- if (ret == -1) {
- unlink (template);
- g_free (template);
- return NULL;
- }
-
- return template;
-}
-
-static CamelCipherValidity *
-gpg_verify (CamelCipherContext *context, CamelMimePart *ipart, CamelException *ex)
-{
- CamelCipherValidity *validity;
- const char *diagnostics = NULL, *tmp;
- struct _GpgCtx *gpg = NULL;
- char *sigfile = NULL;
- gboolean valid;
- CamelContentType *ct;
- CamelMimePart *sigpart, *datapart;
- CamelStream *istream = NULL;
- CamelMultipart *mps;
-
- ct = camel_mime_part_get_content_type(ipart);
- tmp = camel_content_type_param(ct, "protocol");
- mps = (CamelMultipart *)camel_medium_get_content_object((CamelMedium *)ipart);
- if (!camel_content_type_is(ct, "multipart", "signed")
- || !CAMEL_IS_MULTIPART_SIGNED(mps)
- || tmp == NULL
- || g_ascii_strcasecmp(tmp, context->sign_protocol) != 0) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Cannot verify message signature: Incorrect message format"));
- return NULL;
- }
-
- datapart = camel_multipart_get_part(mps, CAMEL_MULTIPART_SIGNED_CONTENT);
- sigpart = camel_multipart_get_part(mps, CAMEL_MULTIPART_SIGNED_SIGNATURE);
-
- if (sigpart == NULL || datapart == NULL) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Cannot verify message signature: Incorrect message format"));
- goto exception;
- }
-
- sigfile = swrite (sigpart);
- if (sigfile == NULL) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Cannot verify message signature: could not create temp file: %s"),
- g_strerror (errno));
- goto exception;
- }
-
- istream = camel_stream_mem_new();
- camel_cipher_canonical_to_stream(datapart, CAMEL_MIME_FILTER_CANON_CRLF, istream);
- camel_stream_reset(istream);
-
- gpg = gpg_ctx_new (context->session);
- gpg_ctx_set_mode (gpg, GPG_CTX_MODE_VERIFY);
- gpg_ctx_set_hash (gpg, camel_cipher_id_to_hash(context, camel_content_type_param(ct, "micalg")));
- gpg_ctx_set_sigfile (gpg, sigfile);
- gpg_ctx_set_istream (gpg, istream);
-
- if (gpg_ctx_op_start (gpg) == -1) {
- camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Failed to execute gpg."));
- gpg_ctx_free (gpg);
- goto exception;
- }
-
- while (!gpg_ctx_op_complete (gpg)) {
- if (camel_operation_cancel_check (NULL)) {
- camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
- _("Cancelled."));
- gpg_ctx_op_cancel (gpg);
- goto exception;
- }
-
- if (gpg_ctx_op_step (gpg, ex) == -1) {
- gpg_ctx_op_cancel (gpg);
- goto exception;
- }
- }
-
- valid = gpg_ctx_op_wait (gpg) == 0;
- validity = camel_cipher_validity_new ();
- diagnostics = gpg_ctx_get_diagnostics (gpg);
- camel_cipher_validity_set_valid (validity, valid);
- camel_cipher_validity_set_description (validity, diagnostics);
- gpg_ctx_free (gpg);
-
- if (sigfile) {
- unlink (sigfile);
- g_free (sigfile);
- }
-
- return validity;
-
- exception:
-
- gpg_ctx_free (gpg);
-
- if (istream)
- camel_object_unref(istream);
-
- if (sigfile) {
- unlink (sigfile);
- g_free (sigfile);
- }
-
- return NULL;
-}
-
-static int
-gpg_encrypt (CamelCipherContext *context, const char *userid, GPtrArray *recipients, struct _CamelMimePart *ipart, struct _CamelMimePart *opart, CamelException *ex)
-{
- CamelGpgContext *ctx = (CamelGpgContext *) context;
- struct _GpgCtx *gpg;
- int i, res = -1;
- CamelStream *istream, *ostream, *vstream;
- CamelMimePart *encpart, *verpart;
- CamelDataWrapper *dw;
- CamelContentType *ct;
- CamelMultipartEncrypted *mpe;
-
- ostream = camel_stream_mem_new();
- istream = camel_stream_mem_new();
- if (camel_cipher_canonical_to_stream(ipart, CAMEL_MIME_FILTER_CANON_CRLF, istream) == -1) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not generate encrypting data: %s"), g_strerror(errno));
- goto fail1;
- }
-
- gpg = gpg_ctx_new (context->session);
- gpg_ctx_set_mode (gpg, GPG_CTX_MODE_ENCRYPT);
- gpg_ctx_set_armor (gpg, TRUE);
- gpg_ctx_set_userid (gpg, userid);
- gpg_ctx_set_istream (gpg, istream);
- gpg_ctx_set_ostream (gpg, ostream);
- gpg_ctx_set_always_trust (gpg, ctx->always_trust);
-
- for (i = 0; i < recipients->len; i++) {
- gpg_ctx_add_recipient (gpg, recipients->pdata[i]);
- }
-
- if (gpg_ctx_op_start (gpg) == -1) {
- camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, _("Failed to execute gpg."));
- goto fail;
- }
-
- /* FIXME: move tihs to a common routine */
- while (!gpg_ctx_op_complete(gpg)) {
- if (camel_operation_cancel_check(NULL)) {
- camel_exception_set(ex, CAMEL_EXCEPTION_USER_CANCEL, _("Cancelled."));
- gpg_ctx_op_cancel(gpg);
- goto fail;
- }
-
- if (gpg_ctx_op_step (gpg, ex) == -1) {
- gpg_ctx_op_cancel (gpg);
- goto fail;
- }
- }
-
- if (gpg_ctx_op_wait (gpg) != 0) {
- const char *diagnostics;
-
- diagnostics = gpg_ctx_get_diagnostics (gpg);
- camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
- diagnostics && *diagnostics ? diagnostics : _("Failed to execute gpg."));
- goto fail;
- }
-
- res = 0;
-
- dw = camel_data_wrapper_new();
- camel_data_wrapper_construct_from_stream(dw, ostream);
-
- encpart = camel_mime_part_new();
- ct = camel_content_type_new("application", "octet-stream");
- camel_content_type_set_param(ct, "name", "encrypted.asc");
- camel_data_wrapper_set_mime_type_field(dw, ct);
- camel_content_type_unref(ct);
-
- camel_medium_set_content_object((CamelMedium *)encpart, dw);
- camel_object_unref(dw);
-
- camel_mime_part_set_description(encpart, _("This is a digitally encrypted message part"));
-
- vstream = camel_stream_mem_new();
- camel_stream_write(vstream, "Version: 1\n", strlen("Version: 1\n"));
- camel_stream_reset(vstream);
-
- verpart = camel_mime_part_new();
- dw = camel_data_wrapper_new();
- camel_data_wrapper_set_mime_type(dw, context->encrypt_protocol);
- camel_data_wrapper_construct_from_stream(dw, vstream);
- camel_object_unref(vstream);
- camel_medium_set_content_object((CamelMedium *)verpart, dw);
- camel_object_unref(dw);
-
- mpe = camel_multipart_encrypted_new();
- ct = camel_content_type_new("multipart", "encrypted");
- camel_content_type_set_param(ct, "protocol", context->encrypt_protocol);
- camel_data_wrapper_set_mime_type_field((CamelDataWrapper *)mpe, ct);
- camel_content_type_unref(ct);
- camel_multipart_set_boundary((CamelMultipart *)mpe, NULL);
-
- mpe->decrypted = ipart;
- camel_object_ref(ipart);
-
- camel_multipart_add_part((CamelMultipart *)mpe, verpart);
- camel_object_unref(verpart);
- camel_multipart_add_part((CamelMultipart *)mpe, encpart);
- camel_object_unref(encpart);
-
- camel_medium_set_content_object((CamelMedium *)opart, (CamelDataWrapper *)mpe);
-fail:
- gpg_ctx_free(gpg);
-fail1:
- camel_object_unref(istream);
- camel_object_unref(ostream);
-
- return res;
-}
-
-static CamelCipherValidity *
-gpg_decrypt(CamelCipherContext *context, CamelMimePart *ipart, CamelMimePart *opart, CamelException *ex)
-{
- struct _GpgCtx *gpg;
- CamelCipherValidity *valid = NULL;
- CamelStream *ostream, *istream;
-
- istream = camel_stream_mem_new();
- camel_data_wrapper_write_to_stream(camel_medium_get_content_object((CamelMedium *)ipart), istream);
- camel_stream_reset(istream);
-
- /* TODO: de-canonicalise end of lines? */
- /*stream = camel_stream_mem_new ();
- filtered_stream = (CamelStream *) camel_stream_filter_new_with_stream (stream);
- crlf_filter = camel_mime_filter_crlf_new (CAMEL_MIME_FILTER_CRLF_DECODE,
- CAMEL_MIME_FILTER_CRLF_MODE_CRLF_ONLY);
- camel_stream_filter_add (CAMEL_STREAM_FILTER (filtered_stream), crlf_filter);
- camel_object_unref (crlf_filter);*/
- ostream = camel_stream_mem_new();
-
- gpg = gpg_ctx_new (context->session);
- gpg_ctx_set_mode (gpg, GPG_CTX_MODE_DECRYPT);
- gpg_ctx_set_istream (gpg, istream);
- gpg_ctx_set_ostream (gpg, ostream);
-
- if (gpg_ctx_op_start (gpg) == -1) {
- camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Failed to execute gpg."));
- goto fail;
- }
-
- while (!gpg_ctx_op_complete (gpg)) {
- if (camel_operation_cancel_check (NULL)) {
- camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
- _("Cancelled."));
- gpg_ctx_op_cancel (gpg);
- goto fail;
- }
-
- if (gpg_ctx_op_step (gpg, ex) == -1) {
- gpg_ctx_op_cancel (gpg);
- goto fail;
- }
- }
-
- if (gpg_ctx_op_wait (gpg) != 0) {
- const char *diagnostics;
-
- diagnostics = gpg_ctx_get_diagnostics (gpg);
- camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
- diagnostics && *diagnostics ? diagnostics :
- _("Failed to execute gpg."));
- goto fail;
- }
-
- camel_stream_reset(ostream);
- if (camel_data_wrapper_construct_from_stream((CamelDataWrapper *)opart, ostream) != -1) {
- valid = camel_cipher_validity_new();
- valid->encrypt.description = g_strdup(_("Encrypted content"));
- valid->encrypt.status = CAMEL_CIPHER_VALIDITY_ENCRYPT_ENCRYPTED;
- } else {
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Unable to parse message content"));
- }
-fail:
- camel_object_unref(ostream);
- camel_object_unref(istream);
- gpg_ctx_free (gpg);
-
- return valid;
-}
-
-static int
-gpg_import_keys (CamelCipherContext *context, CamelStream *istream, CamelException *ex)
-{
- struct _GpgCtx *gpg;
-
- gpg = gpg_ctx_new (context->session);
- gpg_ctx_set_mode (gpg, GPG_CTX_MODE_IMPORT);
- gpg_ctx_set_istream (gpg, istream);
-
- if (gpg_ctx_op_start (gpg) == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Failed to execute gpg: %s"),
- errno ? g_strerror (errno) : _("Unknown"));
- gpg_ctx_free (gpg);
-
- return -1;
- }
-
- while (!gpg_ctx_op_complete (gpg)) {
- if (gpg_ctx_op_step (gpg, ex) == -1) {
- gpg_ctx_op_cancel (gpg);
- gpg_ctx_free (gpg);
-
- return -1;
- }
- }
-
- if (gpg_ctx_op_wait (gpg) != 0) {
- const char *diagnostics;
-
- diagnostics = gpg_ctx_get_diagnostics (gpg);
- camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
- diagnostics && *diagnostics ? diagnostics :
- _("Failed to execute gpg."));
-
- gpg_ctx_free (gpg);
-
- return -1;
- }
-
- gpg_ctx_free (gpg);
-
- return 0;
-}
-
-static int
-gpg_export_keys (CamelCipherContext *context, GPtrArray *keys, CamelStream *ostream, CamelException *ex)
-{
- struct _GpgCtx *gpg;
- int i;
-
- gpg = gpg_ctx_new (context->session);
- gpg_ctx_set_mode (gpg, GPG_CTX_MODE_EXPORT);
- gpg_ctx_set_armor (gpg, TRUE);
- gpg_ctx_set_ostream (gpg, ostream);
-
- for (i = 0; i < keys->len; i++) {
- gpg_ctx_add_recipient (gpg, keys->pdata[i]);
- }
-
- if (gpg_ctx_op_start (gpg) == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Failed to execute gpg: %s"),
- errno ? g_strerror (errno) : _("Unknown"));
- gpg_ctx_free (gpg);
-
- return -1;
- }
-
- while (!gpg_ctx_op_complete (gpg)) {
- if (gpg_ctx_op_step (gpg, ex) == -1) {
- gpg_ctx_op_cancel (gpg);
- gpg_ctx_free (gpg);
-
- return -1;
- }
- }
-
- if (gpg_ctx_op_wait (gpg) != 0) {
- const char *diagnostics;
-
- diagnostics = gpg_ctx_get_diagnostics (gpg);
- camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
- diagnostics && *diagnostics ? diagnostics :
- _("Failed to execute gpg."));
-
- gpg_ctx_free (gpg);
-
- return -1;
- }
-
- gpg_ctx_free (gpg);
-
- return 0;
-}
-
-/* ********************************************************************** */
-
-static void
-camel_gpg_context_class_init (CamelGpgContextClass *klass)
-{
- CamelCipherContextClass *cipher_class = CAMEL_CIPHER_CONTEXT_CLASS (klass);
-
- parent_class = CAMEL_CIPHER_CONTEXT_CLASS (camel_type_get_global_classfuncs (camel_cipher_context_get_type ()));
-
- cipher_class->hash_to_id = gpg_hash_to_id;
- cipher_class->id_to_hash = gpg_id_to_hash;
- cipher_class->sign = gpg_sign;
- cipher_class->verify = gpg_verify;
- cipher_class->encrypt = gpg_encrypt;
- cipher_class->decrypt = gpg_decrypt;
- cipher_class->import_keys = gpg_import_keys;
- cipher_class->export_keys = gpg_export_keys;
-}
-
-static void
-camel_gpg_context_init (CamelGpgContext *context)
-{
- CamelCipherContext *cipher = (CamelCipherContext *) context;
-
- context->always_trust = FALSE;
-
- cipher->sign_protocol = "application/pgp-signature";
- cipher->encrypt_protocol = "application/pgp-encrypted";
- cipher->key_protocol = "application/pgp-keys";
-}
-
-static void
-camel_gpg_context_finalise (CamelObject *object)
-{
- ;
-}
-
-CamelType
-camel_gpg_context_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_cipher_context_get_type (),
- "CamelGpgContext",
- sizeof (CamelGpgContext),
- sizeof (CamelGpgContextClass),
- (CamelObjectClassInitFunc) camel_gpg_context_class_init,
- NULL,
- (CamelObjectInitFunc) camel_gpg_context_init,
- (CamelObjectFinalizeFunc) camel_gpg_context_finalise);
- }
-
- return type;
-}
-
-
diff --git a/camel/camel-gpg-context.h b/camel/camel-gpg-context.h
deleted file mode 100644
index 0d98fed75d..0000000000
--- a/camel/camel-gpg-context.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2002 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifndef __CAMEL_GPG_CONTEXT_H__
-#define __CAMEL_GPG_CONTEXT_H__
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <camel/camel-cipher-context.h>
-
-#define CAMEL_GPG_CONTEXT_TYPE (camel_gpg_context_get_type ())
-#define CAMEL_GPG_CONTEXT(obj) (CAMEL_CHECK_CAST((obj), CAMEL_GPG_CONTEXT_TYPE, CamelGpgContext))
-#define CAMEL_GPG_CONTEXT_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_GPG_CONTEXT_TYPE, CamelGpgContextClass))
-#define CAMEL_IS_GPG_CONTEXT(o) (CAMEL_CHECK_TYPE((o), CAMEL_GPG_CONTEXT_TYPE))
-
-typedef struct _CamelGpgContext CamelGpgContext;
-typedef struct _CamelGpgContextClass CamelGpgContextClass;
-
-struct _CamelGpgContext {
- CamelCipherContext parent_object;
-
- gboolean always_trust;
-};
-
-struct _CamelGpgContextClass {
- CamelCipherContextClass parent_class;
-
-};
-
-
-CamelType camel_gpg_context_get_type (void);
-
-CamelCipherContext *camel_gpg_context_new (CamelSession *session);
-
-void camel_gpg_context_set_always_trust (CamelGpgContext *ctx, gboolean trust);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __CAMEL_GPG_CONTEXT_H__ */
diff --git a/camel/camel-html-parser.c b/camel/camel-html-parser.c
deleted file mode 100644
index 31c0aee15b..0000000000
--- a/camel/camel-html-parser.c
+++ /dev/null
@@ -1,807 +0,0 @@
-/*
- * Copyright (C) 2001 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-/** WARNING
- **
- ** DO NOT USE THIS CODE OUTSIDE OF CAMEL
- **
- ** IT IS SUBJECT TO CHANGE OR MAY VANISH AT ANY TIME
- **/
-
-#include "camel-html-parser.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <glib/gunicode.h>
-#include <ctype.h>
-
-/* if defined, must also compile in dump_tag() below somewhere */
-#define d(x)
-
-static void camel_html_parser_class_init (CamelHTMLParserClass *klass);
-static void camel_html_parser_init (CamelObject *o);
-static void camel_html_parser_finalize (CamelObject *o);
-
-static CamelObjectClass *camel_html_parser_parent;
-
-/* Parser definitions, see below object code for details */
-
-typedef struct _CamelHTMLParserPrivate CamelHTMLParserPrivate;
-
-struct _CamelHTMLParserPrivate {
- char *inbuf,
- *inptr,
- *inend,
- *start;
- enum _camel_html_parser_t state;
- char *charset;
- int eof;
- GString *tag;
- GString *ent;
- char ent_utf8[8];
- int attr;
- GPtrArray *attrs;
- GPtrArray *values;
- int quote;
-};
-
-static void tokenise_setup(void);
-static CamelHTMLParserPrivate *tokenise_init(void);
-static void tokenise_free(CamelHTMLParserPrivate *p);
-static int tokenise_step(CamelHTMLParserPrivate *p, char **datap, int *lenp);
-
-/* ********************************************************************** */
-
-CamelType
-camel_html_parser_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_object_get_type (), "CamelHTMLParser",
- sizeof (CamelHTMLParser),
- sizeof (CamelHTMLParserClass),
- (CamelObjectClassInitFunc) camel_html_parser_class_init,
- NULL,
- (CamelObjectInitFunc) camel_html_parser_init,
- (CamelObjectFinalizeFunc) camel_html_parser_finalize);
- }
-
- return type;
-}
-
-static void
-camel_html_parser_finalize(CamelObject *o)
-{
- CamelHTMLParser *f = (CamelHTMLParser *)o;
-
- tokenise_free(f->priv);
-}
-
-static void
-camel_html_parser_init (CamelObject *o)
-{
- CamelHTMLParser *f = (CamelHTMLParser *)o;
-
- f->priv = tokenise_init();
-}
-
-static void
-camel_html_parser_class_init (CamelHTMLParserClass *klass)
-{
- camel_html_parser_parent = CAMEL_OBJECT_CLASS (camel_type_get_global_classfuncs (camel_object_get_type ()));
-
- tokenise_setup();
-}
-
-/**
- * camel_html_parser_new:
- *
- * Create a new CamelHTMLParser object.
- *
- * Return value: A new CamelHTMLParser widget.
- **/
-CamelHTMLParser *
-camel_html_parser_new (void)
-{
- CamelHTMLParser *new = CAMEL_HTML_PARSER ( camel_object_new (camel_html_parser_get_type ()));
- return new;
-}
-
-
-void camel_html_parser_set_data(CamelHTMLParser *hp, const char *start, int len, int last)
-{
- CamelHTMLParserPrivate *p = hp->priv;
-
- p->inptr = p->inbuf = (char *)start;
- p->inend = (char *)start+len;
- p->eof = last;
-}
-
-camel_html_parser_t camel_html_parser_step(CamelHTMLParser *hp, const char **datap, int *lenp)
-{
- return tokenise_step(hp->priv, (char **)datap, lenp);
-}
-
-const char *camel_html_parser_left(CamelHTMLParser *hp, int *lenp)
-{
- CamelHTMLParserPrivate *p = hp->priv;
-
- if (lenp)
- *lenp = p->inend - p->inptr;
-
- return p->inptr;
-}
-
-const char *camel_html_parser_tag(CamelHTMLParser *hp)
-{
- return hp->priv->tag->str;
-}
-
-const char *camel_html_parser_attr(CamelHTMLParser *hp, const char *name)
-{
- int i;
- CamelHTMLParserPrivate *p = hp->priv;
-
- for (i=0;i<p->attrs->len;i++) {
- if (!strcasecmp(((GString *)p->attrs->pdata[i])->str, name)) {
- return ((GString *)p->values->pdata[i])->str;
- }
- }
-
- return NULL;
-}
-
-const GPtrArray *camel_html_parser_attr_list(CamelHTMLParser *hp, const GPtrArray **values)
-{
- if (values)
- *values = hp->priv->values;
-
- return hp->priv->attrs;
-}
-
-/* this map taken out of libxml */
-static struct {
- unsigned int val;
- const char *name;
-} entity_map[] = {
-/*
- * the 4 absolute ones,
- */
- { 34, "quot", /* quotation mark = APL quote, U+0022 ISOnum */ },
- { 38, "amp", /* ampersand, U+0026 ISOnum */ },
- { 60, "lt", /* less-than sign, U+003C ISOnum */ },
- { 62, "gt", /* greater-than sign, U+003E ISOnum */ },
-
-/*
- * A bunch still in the 128-255 range
- * Replacing them depend really on the charset used.
- */
- { 39, "apos", /* single quote */ },
- { 160, "nbsp", /* no-break space = non-breaking space, U+00A0 ISOnum */ },
- { 161, "iexcl",/* inverted exclamation mark, U+00A1 ISOnum */ },
- { 162, "cent", /* cent sign, U+00A2 ISOnum */ },
- { 163, "pound",/* pound sign, U+00A3 ISOnum */ },
- { 164, "curren",/* currency sign, U+00A4 ISOnum */ },
- { 165, "yen", /* yen sign = yuan sign, U+00A5 ISOnum */ },
- { 166, "brvbar",/* broken bar = broken vertical bar, U+00A6 ISOnum */ },
- { 167, "sect", /* section sign, U+00A7 ISOnum */ },
- { 168, "uml", /* diaeresis = spacing diaeresis, U+00A8 ISOdia */ },
- { 169, "copy", /* copyright sign, U+00A9 ISOnum */ },
- { 170, "ordf", /* feminine ordinal indicator, U+00AA ISOnum */ },
- { 171, "laquo",/* left-pointing double angle quotation mark = left pointing guillemet, U+00AB ISOnum */ },
- { 172, "not", /* not sign, U+00AC ISOnum */ },
- { 173, "shy", /* soft hyphen = discretionary hyphen, U+00AD ISOnum */ },
- { 174, "reg", /* registered sign = registered trade mark sign, U+00AE ISOnum */ },
- { 175, "macr", /* macron = spacing macron = overline = APL overbar, U+00AF ISOdia */ },
- { 176, "deg", /* degree sign, U+00B0 ISOnum */ },
- { 177, "plusmn",/* plus-minus sign = plus-or-minus sign, U+00B1 ISOnum */ },
- { 178, "sup2", /* superscript two = superscript digit two = squared, U+00B2 ISOnum */ },
- { 179, "sup3", /* superscript three = superscript digit three = cubed, U+00B3 ISOnum */ },
- { 180, "acute",/* acute accent = spacing acute, U+00B4 ISOdia */ },
- { 181, "micro",/* micro sign, U+00B5 ISOnum */ },
- { 182, "para", /* pilcrow sign = paragraph sign, U+00B6 ISOnum */ },
- { 183, "middot",/* middle dot = Georgian comma Greek middle dot, U+00B7 ISOnum */ },
- { 184, "cedil",/* cedilla = spacing cedilla, U+00B8 ISOdia */ },
- { 185, "sup1", /* superscript one = superscript digit one, U+00B9 ISOnum */ },
- { 186, "ordm", /* masculine ordinal indicator, U+00BA ISOnum */ },
- { 187, "raquo",/* right-pointing double angle quotation mark right pointing guillemet, U+00BB ISOnum */ },
- { 188, "frac14",/* vulgar fraction one quarter = fraction one quarter, U+00BC ISOnum */ },
- { 189, "frac12",/* vulgar fraction one half = fraction one half, U+00BD ISOnum */ },
- { 190, "frac34",/* vulgar fraction three quarters = fraction three quarters, U+00BE ISOnum */ },
- { 191, "iquest",/* inverted question mark = turned question mark, U+00BF ISOnum */ },
- { 192, "Agrave",/* latin capital letter A with grave = latin capital letter A grave, U+00C0 ISOlat1 */ },
- { 193, "Aacute",/* latin capital letter A with acute, U+00C1 ISOlat1 */ },
- { 194, "Acirc",/* latin capital letter A with circumflex, U+00C2 ISOlat1 */ },
- { 195, "Atilde",/* latin capital letter A with tilde, U+00C3 ISOlat1 */ },
- { 196, "Auml", /* latin capital letter A with diaeresis, U+00C4 ISOlat1 */ },
- { 197, "Aring",/* latin capital letter A with ring above = latin capital letter A ring, U+00C5 ISOlat1 */ },
- { 198, "AElig",/* latin capital letter AE = latin capital ligature AE, U+00C6 ISOlat1 */ },
- { 199, "Ccedil",/* latin capital letter C with cedilla, U+00C7 ISOlat1 */ },
- { 200, "Egrave",/* latin capital letter E with grave, U+00C8 ISOlat1 */ },
- { 201, "Eacute",/* latin capital letter E with acute, U+00C9 ISOlat1 */ },
- { 202, "Ecirc",/* latin capital letter E with circumflex, U+00CA ISOlat1 */ },
- { 203, "Euml", /* latin capital letter E with diaeresis, U+00CB ISOlat1 */ },
- { 204, "Igrave",/* latin capital letter I with grave, U+00CC ISOlat1 */ },
- { 205, "Iacute",/* latin capital letter I with acute, U+00CD ISOlat1 */ },
- { 206, "Icirc",/* latin capital letter I with circumflex, U+00CE ISOlat1 */ },
- { 207, "Iuml", /* latin capital letter I with diaeresis, U+00CF ISOlat1 */ },
- { 208, "ETH", /* latin capital letter ETH, U+00D0 ISOlat1 */ },
- { 209, "Ntilde",/* latin capital letter N with tilde, U+00D1 ISOlat1 */ },
- { 210, "Ograve",/* latin capital letter O with grave, U+00D2 ISOlat1 */ },
- { 211, "Oacute",/* latin capital letter O with acute, U+00D3 ISOlat1 */ },
- { 212, "Ocirc",/* latin capital letter O with circumflex, U+00D4 ISOlat1 */ },
- { 213, "Otilde",/* latin capital letter O with tilde, U+00D5 ISOlat1 */ },
- { 214, "Ouml", /* latin capital letter O with diaeresis, U+00D6 ISOlat1 */ },
- { 215, "times",/* multiplication sign, U+00D7 ISOnum */ },
- { 216, "Oslash",/* latin capital letter O with stroke latin capital letter O slash, U+00D8 ISOlat1 */ },
- { 217, "Ugrave",/* latin capital letter U with grave, U+00D9 ISOlat1 */ },
- { 218, "Uacute",/* latin capital letter U with acute, U+00DA ISOlat1 */ },
- { 219, "Ucirc",/* latin capital letter U with circumflex, U+00DB ISOlat1 */ },
- { 220, "Uuml", /* latin capital letter U with diaeresis, U+00DC ISOlat1 */ },
- { 221, "Yacute",/* latin capital letter Y with acute, U+00DD ISOlat1 */ },
- { 222, "THORN",/* latin capital letter THORN, U+00DE ISOlat1 */ },
- { 223, "szlig",/* latin small letter sharp s = ess-zed, U+00DF ISOlat1 */ },
- { 224, "agrave",/* latin small letter a with grave = latin small letter a grave, U+00E0 ISOlat1 */ },
- { 225, "aacute",/* latin small letter a with acute, U+00E1 ISOlat1 */ },
- { 226, "acirc",/* latin small letter a with circumflex, U+00E2 ISOlat1 */ },
- { 227, "atilde",/* latin small letter a with tilde, U+00E3 ISOlat1 */ },
- { 228, "auml", /* latin small letter a with diaeresis, U+00E4 ISOlat1 */ },
- { 229, "aring",/* latin small letter a with ring above = latin small letter a ring, U+00E5 ISOlat1 */ },
- { 230, "aelig",/* latin small letter ae = latin small ligature ae, U+00E6 ISOlat1 */ },
- { 231, "ccedil",/* latin small letter c with cedilla, U+00E7 ISOlat1 */ },
- { 232, "egrave",/* latin small letter e with grave, U+00E8 ISOlat1 */ },
- { 233, "eacute",/* latin small letter e with acute, U+00E9 ISOlat1 */ },
- { 234, "ecirc",/* latin small letter e with circumflex, U+00EA ISOlat1 */ },
- { 235, "euml", /* latin small letter e with diaeresis, U+00EB ISOlat1 */ },
- { 236, "igrave",/* latin small letter i with grave, U+00EC ISOlat1 */ },
- { 237, "iacute",/* latin small letter i with acute, U+00ED ISOlat1 */ },
- { 238, "icirc",/* latin small letter i with circumflex, U+00EE ISOlat1 */ },
- { 239, "iuml", /* latin small letter i with diaeresis, U+00EF ISOlat1 */ },
- { 240, "eth", /* latin small letter eth, U+00F0 ISOlat1 */ },
- { 241, "ntilde",/* latin small letter n with tilde, U+00F1 ISOlat1 */ },
- { 242, "ograve",/* latin small letter o with grave, U+00F2 ISOlat1 */ },
- { 243, "oacute",/* latin small letter o with acute, U+00F3 ISOlat1 */ },
- { 244, "ocirc",/* latin small letter o with circumflex, U+00F4 ISOlat1 */ },
- { 245, "otilde",/* latin small letter o with tilde, U+00F5 ISOlat1 */ },
- { 246, "ouml", /* latin small letter o with diaeresis, U+00F6 ISOlat1 */ },
- { 247, "divide",/* division sign, U+00F7 ISOnum */ },
- { 248, "oslash",/* latin small letter o with stroke, = latin small letter o slash, U+00F8 ISOlat1 */ },
- { 249, "ugrave",/* latin small letter u with grave, U+00F9 ISOlat1 */ },
- { 250, "uacute",/* latin small letter u with acute, U+00FA ISOlat1 */ },
- { 251, "ucirc",/* latin small letter u with circumflex, U+00FB ISOlat1 */ },
- { 252, "uuml", /* latin small letter u with diaeresis, U+00FC ISOlat1 */ },
- { 253, "yacute",/* latin small letter y with acute, U+00FD ISOlat1 */ },
- { 254, "thorn",/* latin small letter thorn with, U+00FE ISOlat1 */ },
- { 255, "yuml", /* latin small letter y with diaeresis, U+00FF ISOlat1 */ },
-
-/*
- * Anything below should really be kept as entities references
- */
- { 402, "fnof", /* latin small f with hook = function = florin, U+0192 ISOtech */ },
-
- { 913, "Alpha",/* greek capital letter alpha, U+0391 */ },
- { 914, "Beta", /* greek capital letter beta, U+0392 */ },
- { 915, "Gamma",/* greek capital letter gamma, U+0393 ISOgrk3 */ },
- { 916, "Delta",/* greek capital letter delta, U+0394 ISOgrk3 */ },
- { 917, "Epsilon",/* greek capital letter epsilon, U+0395 */ },
- { 918, "Zeta", /* greek capital letter zeta, U+0396 */ },
- { 919, "Eta", /* greek capital letter eta, U+0397 */ },
- { 920, "Theta",/* greek capital letter theta, U+0398 ISOgrk3 */ },
- { 921, "Iota", /* greek capital letter iota, U+0399 */ },
- { 922, "Kappa",/* greek capital letter kappa, U+039A */ },
- { 923, "Lambda"/* greek capital letter lambda, U+039B ISOgrk3 */ },
- { 924, "Mu", /* greek capital letter mu, U+039C */ },
- { 925, "Nu", /* greek capital letter nu, U+039D */ },
- { 926, "Xi", /* greek capital letter xi, U+039E ISOgrk3 */ },
- { 927, "Omicron",/* greek capital letter omicron, U+039F */ },
- { 928, "Pi", /* greek capital letter pi, U+03A0 ISOgrk3 */ },
- { 929, "Rho", /* greek capital letter rho, U+03A1 */ },
- { 931, "Sigma",/* greek capital letter sigma, U+03A3 ISOgrk3 */ },
- { 932, "Tau", /* greek capital letter tau, U+03A4 */ },
- { 933, "Upsilon",/* greek capital letter upsilon, U+03A5 ISOgrk3 */ },
- { 934, "Phi", /* greek capital letter phi, U+03A6 ISOgrk3 */ },
- { 935, "Chi", /* greek capital letter chi, U+03A7 */ },
- { 936, "Psi", /* greek capital letter psi, U+03A8 ISOgrk3 */ },
- { 937, "Omega",/* greek capital letter omega, U+03A9 ISOgrk3 */ },
-
- { 945, "alpha",/* greek small letter alpha, U+03B1 ISOgrk3 */ },
- { 946, "beta", /* greek small letter beta, U+03B2 ISOgrk3 */ },
- { 947, "gamma",/* greek small letter gamma, U+03B3 ISOgrk3 */ },
- { 948, "delta",/* greek small letter delta, U+03B4 ISOgrk3 */ },
- { 949, "epsilon",/* greek small letter epsilon, U+03B5 ISOgrk3 */ },
- { 950, "zeta", /* greek small letter zeta, U+03B6 ISOgrk3 */ },
- { 951, "eta", /* greek small letter eta, U+03B7 ISOgrk3 */ },
- { 952, "theta",/* greek small letter theta, U+03B8 ISOgrk3 */ },
- { 953, "iota", /* greek small letter iota, U+03B9 ISOgrk3 */ },
- { 954, "kappa",/* greek small letter kappa, U+03BA ISOgrk3 */ },
- { 955, "lambda",/* greek small letter lambda, U+03BB ISOgrk3 */ },
- { 956, "mu", /* greek small letter mu, U+03BC ISOgrk3 */ },
- { 957, "nu", /* greek small letter nu, U+03BD ISOgrk3 */ },
- { 958, "xi", /* greek small letter xi, U+03BE ISOgrk3 */ },
- { 959, "omicron",/* greek small letter omicron, U+03BF NEW */ },
- { 960, "pi", /* greek small letter pi, U+03C0 ISOgrk3 */ },
- { 961, "rho", /* greek small letter rho, U+03C1 ISOgrk3 */ },
- { 962, "sigmaf",/* greek small letter final sigma, U+03C2 ISOgrk3 */ },
- { 963, "sigma",/* greek small letter sigma, U+03C3 ISOgrk3 */ },
- { 964, "tau", /* greek small letter tau, U+03C4 ISOgrk3 */ },
- { 965, "upsilon",/* greek small letter upsilon, U+03C5 ISOgrk3 */ },
- { 966, "phi", /* greek small letter phi, U+03C6 ISOgrk3 */ },
- { 967, "chi", /* greek small letter chi, U+03C7 ISOgrk3 */ },
- { 968, "psi", /* greek small letter psi, U+03C8 ISOgrk3 */ },
- { 969, "omega",/* greek small letter omega, U+03C9 ISOgrk3 */ },
- { 977, "thetasym",/* greek small letter theta symbol, U+03D1 NEW */ },
- { 978, "upsih",/* greek upsilon with hook symbol, U+03D2 NEW */ },
- { 982, "piv", /* greek pi symbol, U+03D6 ISOgrk3 */ },
-
- { 8226, "bull", /* bullet = black small circle, U+2022 ISOpub */ },
- { 8230, "hellip",/* horizontal ellipsis = three dot leader, U+2026 ISOpub */ },
- { 8242, "prime",/* prime = minutes = feet, U+2032 ISOtech */ },
- { 8243, "Prime",/* double prime = seconds = inches, U+2033 ISOtech */ },
- { 8254, "oline",/* overline = spacing overscore, U+203E NEW */ },
- { 8260, "frasl",/* fraction slash, U+2044 NEW */ },
-
- { 8472, "weierp",/* script capital P = power set = Weierstrass p, U+2118 ISOamso */ },
- { 8465, "image",/* blackletter capital I = imaginary part, U+2111 ISOamso */ },
- { 8476, "real", /* blackletter capital R = real part symbol, U+211C ISOamso */ },
- { 8482, "trade",/* trade mark sign, U+2122 ISOnum */ },
- { 8501, "alefsym",/* alef symbol = first transfinite cardinal, U+2135 NEW */ },
- { 8592, "larr", /* leftwards arrow, U+2190 ISOnum */ },
- { 8593, "uarr", /* upwards arrow, U+2191 ISOnum */ },
- { 8594, "rarr", /* rightwards arrow, U+2192 ISOnum */ },
- { 8595, "darr", /* downwards arrow, U+2193 ISOnum */ },
- { 8596, "harr", /* left right arrow, U+2194 ISOamsa */ },
- { 8629, "crarr",/* downwards arrow with corner leftwards = carriage return, U+21B5 NEW */ },
- { 8656, "lArr", /* leftwards double arrow, U+21D0 ISOtech */ },
- { 8657, "uArr", /* upwards double arrow, U+21D1 ISOamsa */ },
- { 8658, "rArr", /* rightwards double arrow, U+21D2 ISOtech */ },
- { 8659, "dArr", /* downwards double arrow, U+21D3 ISOamsa */ },
- { 8660, "hArr", /* left right double arrow, U+21D4 ISOamsa */ },
-
-
- { 8704, "forall",/* for all, U+2200 ISOtech */ },
- { 8706, "part", /* partial differential, U+2202 ISOtech */ },
- { 8707, "exist",/* there exists, U+2203 ISOtech */ },
- { 8709, "empty",/* empty set = null set = diameter, U+2205 ISOamso */ },
- { 8711, "nabla",/* nabla = backward difference, U+2207 ISOtech */ },
- { 8712, "isin", /* element of, U+2208 ISOtech */ },
- { 8713, "notin",/* not an element of, U+2209 ISOtech */ },
- { 8715, "ni", /* contains as member, U+220B ISOtech */ },
- { 8719, "prod", /* n-ary product = product sign, U+220F ISOamsb */ },
- { 8721, "sum", /* n-ary sumation, U+2211 ISOamsb */ },
- { 8722, "minus",/* minus sign, U+2212 ISOtech */ },
- { 8727, "lowast",/* asterisk operator, U+2217 ISOtech */ },
- { 8730, "radic",/* square root = radical sign, U+221A ISOtech */ },
- { 8733, "prop", /* proportional to, U+221D ISOtech */ },
- { 8734, "infin",/* infinity, U+221E ISOtech */ },
- { 8736, "ang", /* angle, U+2220 ISOamso */ },
- { 8743, "and", /* logical and = wedge, U+2227 ISOtech */ },
- { 8744, "or", /* logical or = vee, U+2228 ISOtech */ },
- { 8745, "cap", /* intersection = cap, U+2229 ISOtech */ },
- { 8746, "cup", /* union = cup, U+222A ISOtech */ },
- { 8747, "int", /* integral, U+222B ISOtech */ },
- { 8756, "there4",/* therefore, U+2234 ISOtech */ },
- { 8764, "sim", /* tilde operator = varies with = similar to, U+223C ISOtech */ },
- { 8773, "cong", /* approximately equal to, U+2245 ISOtech */ },
- { 8776, "asymp",/* almost equal to = asymptotic to, U+2248 ISOamsr */ },
- { 8800, "ne", /* not equal to, U+2260 ISOtech */ },
- { 8801, "equiv",/* identical to, U+2261 ISOtech */ },
- { 8804, "le", /* less-than or equal to, U+2264 ISOtech */ },
- { 8805, "ge", /* greater-than or equal to, U+2265 ISOtech */ },
- { 8834, "sub", /* subset of, U+2282 ISOtech */ },
- { 8835, "sup", /* superset of, U+2283 ISOtech */ },
- { 8836, "nsub", /* not a subset of, U+2284 ISOamsn */ },
- { 8838, "sube", /* subset of or equal to, U+2286 ISOtech */ },
- { 8839, "supe", /* superset of or equal to, U+2287 ISOtech */ },
- { 8853, "oplus",/* circled plus = direct sum, U+2295 ISOamsb */ },
- { 8855, "otimes",/* circled times = vector product, U+2297 ISOamsb */ },
- { 8869, "perp", /* up tack = orthogonal to = perpendicular, U+22A5 ISOtech */ },
- { 8901, "sdot", /* dot operator, U+22C5 ISOamsb */ },
- { 8968, "lceil",/* left ceiling = apl upstile, U+2308 ISOamsc */ },
- { 8969, "rceil",/* right ceiling, U+2309 ISOamsc */ },
- { 8970, "lfloor",/* left floor = apl downstile, U+230A ISOamsc */ },
- { 8971, "rfloor",/* right floor, U+230B ISOamsc */ },
- { 9001, "lang", /* left-pointing angle bracket = bra, U+2329 ISOtech */ },
- { 9002, "rang", /* right-pointing angle bracket = ket, U+232A ISOtech */ },
- { 9674, "loz", /* lozenge, U+25CA ISOpub */ },
-
- { 9824, "spades",/* black spade suit, U+2660 ISOpub */ },
- { 9827, "clubs",/* black club suit = shamrock, U+2663 ISOpub */ },
- { 9829, "hearts",/* black heart suit = valentine, U+2665 ISOpub */ },
- { 9830, "diams",/* black diamond suit, U+2666 ISOpub */ },
-
- { 338, "OElig",/* latin capital ligature OE, U+0152 ISOlat2 */ },
- { 339, "oelig",/* latin small ligature oe, U+0153 ISOlat2 */ },
- { 352, "Scaron",/* latin capital letter S with caron, U+0160 ISOlat2 */ },
- { 353, "scaron",/* latin small letter s with caron, U+0161 ISOlat2 */ },
- { 376, "Yuml", /* latin capital letter Y with diaeresis, U+0178 ISOlat2 */ },
- { 710, "circ", /* modifier letter circumflex accent, U+02C6 ISOpub */ },
- { 732, "tilde",/* small tilde, U+02DC ISOdia */ },
-
- { 8194, "ensp", /* en space, U+2002 ISOpub */ },
- { 8195, "emsp", /* em space, U+2003 ISOpub */ },
- { 8201, "thinsp",/* thin space, U+2009 ISOpub */ },
- { 8204, "zwnj", /* zero width non-joiner, U+200C NEW RFC 2070 */ },
- { 8205, "zwj", /* zero width joiner, U+200D NEW RFC 2070 */ },
- { 8206, "lrm", /* left-to-right mark, U+200E NEW RFC 2070 */ },
- { 8207, "rlm", /* right-to-left mark, U+200F NEW RFC 2070 */ },
- { 8211, "ndash",/* en dash, U+2013 ISOpub */ },
- { 8212, "mdash",/* em dash, U+2014 ISOpub */ },
- { 8216, "lsquo",/* left single quotation mark, U+2018 ISOnum */ },
- { 8217, "rsquo",/* right single quotation mark, U+2019 ISOnum */ },
- { 8218, "sbquo",/* single low-9 quotation mark, U+201A NEW */ },
- { 8220, "ldquo",/* left double quotation mark, U+201C ISOnum */ },
- { 8221, "rdquo",/* right double quotation mark, U+201D ISOnum */ },
- { 8222, "bdquo",/* double low-9 quotation mark, U+201E NEW */ },
- { 8224, "dagger",/* dagger, U+2020 ISOpub */ },
- { 8225, "Dagger",/* double dagger, U+2021 ISOpub */ },
- { 8240, "permil",/* per mille sign, U+2030 ISOtech */ },
- { 8249, "lsaquo",/* single left-pointing angle quotation mark, U+2039 ISO proposed */ },
- { 8250, "rsaquo",/* single right-pointing angle quotation mark, U+203A ISO proposed */ },
- { 8364, "euro", /* euro sign, U+20AC NEW */ }
-};
-
-static GHashTable *entities;
-
-/* this cannot be called in a thread context */
-static void tokenise_setup(void)
-{
- int i;
-
- if (entities == NULL) {
- entities = g_hash_table_new(g_str_hash, g_str_equal);
- for (i=0;i<sizeof(entity_map)/sizeof(entity_map[0]);i++) {
- g_hash_table_insert(entities, (char *)entity_map[i].name, GUINT_TO_POINTER(entity_map[i].val));
- }
- }
-}
-
-static CamelHTMLParserPrivate *tokenise_init(void)
-{
- CamelHTMLParserPrivate *p;
-
- p = g_malloc(sizeof(*p));
- p->state = CAMEL_HTML_PARSER_DATA;
-
- p->attr = 0;
- p->attrs = g_ptr_array_new();
- p->values = g_ptr_array_new();
- p->tag = g_string_new("");
- p->ent = g_string_new("");
- p->charset = NULL;
-
- if (entities == NULL)
- tokenise_setup();
-
- return p;
-}
-
-static void tokenise_free(CamelHTMLParserPrivate *p)
-{
- int i;
-
- g_string_free(p->tag, TRUE);
- g_string_free(p->ent, TRUE);
- g_free(p->charset);
-
- for (i=0;i<p->attrs->len;i++)
- g_string_free(p->attrs->pdata[i], TRUE);
-
- for (i=0;i<p->values->len;i++)
- g_string_free(p->values->pdata[i], TRUE);
-
- g_free(p);
-}
-
-static int convert_entity(const char *e, char *ent)
-{
- unsigned int val;
-
- if (e[0] == '#')
- return g_unichar_to_utf8(atoi(e+1), ent);
-
- val = GPOINTER_TO_UINT(g_hash_table_lookup(entities, e));
- if (ent)
- return g_unichar_to_utf8(val, ent);
- else
- return 0;
-}
-
-#if 0
-static void dump_tag(CamelHTMLParserPrivate *p)
-{
- int i;
-
- printf("got tag: %s\n", p->tag->str);
- printf("%d attributes:\n", p->attr);
- for (i=0;i<p->attr;i++) {
- printf(" %s = '%s'\n", ((GString *)p->attrs->pdata[i])->str, ((GString *)p->values->pdata[i])->str);
- }
-}
-#endif
-
-static int tokenise_step(CamelHTMLParserPrivate *p, char **datap, int *lenp)
-{
- char *in = p->inptr;
- char *inend = p->inend;
- char c;
- int state = p->state, ret, len;
- char *start = p->inptr;
-
- d(printf("Tokenise step\n"));
-
- while (in < inend) {
- c = *in++;
- switch (state) {
- case CAMEL_HTML_PARSER_DATA:
- if (c == '<') {
- ret = state;
- state = CAMEL_HTML_PARSER_TAG;
- p->attr = 0;
- g_string_truncate(p->tag, 0);
- d(printf("got data '%.*s'\n", in-start-1, start));
- *datap = start;
- *lenp = in-start-1;
- goto done;
- } else if (c=='&') {
- ret = state;
- state = CAMEL_HTML_PARSER_ENT;
- g_string_truncate(p->ent, 0);
- g_string_append_c(p->ent, c);
- d(printf("got data '%.*s'\n", in-start-1, start));
- *datap = start;
- *lenp = in-start-1;
- goto done;
- }
- break;
- case CAMEL_HTML_PARSER_ENT:
- if (c==';') {
- len = convert_entity(p->ent->str+1, p->ent_utf8);
- if (len == 0) {
- /* handle broken entity */
- g_string_append_c(p->ent, c);
- ret = state = CAMEL_HTML_PARSER_DATA;
- *datap = p->ent->str;
- *lenp = p->ent->len;
- goto done;
- } else {
- d(printf("got entity: %s = %s\n", p->ent->str, p->ent_utf8));
- ret = state;
- state = CAMEL_HTML_PARSER_DATA;
- *datap = p->ent_utf8;
- *lenp = len;
- goto done;
- }
- } else if (isalnum(c) || c=='#') { /* FIXME: right type */
- g_string_append_c(p->ent, c);
- } else {
- /* handle broken entity */
- g_string_append_c(p->ent, c);
- ret = state = CAMEL_HTML_PARSER_DATA;
- *datap = p->ent->str;
- *lenp = p->ent->len;
- goto done;
- }
- break;
- case CAMEL_HTML_PARSER_TAG:
- if (c == '!') {
- state = CAMEL_HTML_PARSER_COMMENT0;
- g_string_append_c(p->tag, c);
- } else if (c == '>') {
- d(dump_tag(p));
- ret = CAMEL_HTML_PARSER_ELEMENT;
- state = CAMEL_HTML_PARSER_DATA;
- goto done;
- } else if (c == ' ' || c=='\n' || c=='\t') {
- state = CAMEL_HTML_PARSER_ATTR0;
- } else {
- g_string_append_c(p->tag, c);
- }
- break;
- /* check for <!-- */
- case CAMEL_HTML_PARSER_COMMENT0:
- if (c == '-') {
- g_string_append_c(p->tag, c);
- if (p->tag->len == 3) {
- g_string_truncate(p->tag, 0);
- state = CAMEL_HTML_PARSER_COMMENT;
- }
- } else {
- /* got something else, probbly dtd entity */
- state = CAMEL_HTML_PARSER_DTDENT;
- }
- break;
- case CAMEL_HTML_PARSER_DTDENT:
- if (c == '>') {
- ret = CAMEL_HTML_PARSER_DTDENT;
- state = CAMEL_HTML_PARSER_DATA;
- *datap = start;
- *lenp = in-start-1;
- goto done;
- }
- break;
- case CAMEL_HTML_PARSER_COMMENT:
- if (c == '>' && p->tag->len == 2) {
- ret = CAMEL_HTML_PARSER_COMMENT;
- state = CAMEL_HTML_PARSER_DATA;
- *datap = start;
- *lenp = in-start-1;
- goto done;
- } else if (c=='-') {
- /* we dont care if we get 'n' --'s before the > */
- if (p->tag->len < 2)
- g_string_append_c(p->tag, c);
- } else {
- g_string_truncate(p->tag, 0);
- }
- break;
- case CAMEL_HTML_PARSER_ATTR0: /* pre-attribute whitespace */
- if (c == '>') {
- d(dump_tag(p));
- ret = CAMEL_HTML_PARSER_ELEMENT;
- state = CAMEL_HTML_PARSER_DATA;
- goto done;
- } else if (c == ' ' || c=='\n' || c=='\t') {
- } else {
- if (p->attrs->len <= p->attr) {
- g_ptr_array_add(p->attrs, g_string_new(""));
- g_ptr_array_add(p->values, g_string_new(""));
- } else {
- g_string_truncate(p->attrs->pdata[p->attr], 0);
- g_string_truncate(p->values->pdata[p->attr], 0);
- }
- g_string_append_c(p->attrs->pdata[p->attr], c);
- state = CAMEL_HTML_PARSER_ATTR;
- }
- break;
- case CAMEL_HTML_PARSER_ATTR:
- if (c == '>') {
- d(dump_tag(p));
- ret = CAMEL_HTML_PARSER_ELEMENT;
- state = CAMEL_HTML_PARSER_DATA;
- goto done;
- } else if (c == '=') {
- state = CAMEL_HTML_PARSER_VAL0;
- } else if (c == ' ' || c=='\n' || c=='\t') {
- state = CAMEL_HTML_PARSER_ATTR0;
- p->attr++;
- } else {
- g_string_append_c(p->attrs->pdata[p->attr], c);
- }
- break;
- case CAMEL_HTML_PARSER_VAL0:
- if (c == '>') {
- d(printf("value truncated\n"));
- d(dump_tag(p));
- ret = CAMEL_HTML_PARSER_ELEMENT;
- state = CAMEL_HTML_PARSER_DATA;
- goto done;
- } else if (c == '\'' || c == '\"') {
- p->quote = c;
- state = CAMEL_HTML_PARSER_VAL;
- } else if (c == ' ' || c=='\n' || c=='\t') {
- } else {
- g_string_append_c(p->values->pdata[p->attr], c);
- p->quote = 0;
- state = CAMEL_HTML_PARSER_VAL;
- }
- break;
- case CAMEL_HTML_PARSER_VAL:
- do_val:
- if (p->quote) {
- if (c == '>') {
- d(printf("value truncated\n"));
- d(dump_tag(p));
- ret = CAMEL_HTML_PARSER_ELEMENT;
- state = CAMEL_HTML_PARSER_DATA;
- p->attr++;
- goto done;
- } else if (c == p->quote) {
- state = CAMEL_HTML_PARSER_ATTR0;
- p->attr++;
- } else if (c=='&') {
- state = CAMEL_HTML_PARSER_VAL_ENT;
- g_string_truncate(p->ent, 0);
- } else {
- g_string_append_c(p->values->pdata[p->attr], c);
- }
- } else if (c == '>') {
- d(dump_tag(p));
- ret = CAMEL_HTML_PARSER_ELEMENT;
- state = CAMEL_HTML_PARSER_DATA;
- p->attr++;
- goto done;
- } else if (c == ' ' || c=='\n' || c=='\t') {
- state = CAMEL_HTML_PARSER_ATTR0;
- p->attr++;
- } else if (c=='&') {
- state = CAMEL_HTML_PARSER_VAL_ENT;
- g_string_truncate(p->ent, 0);
- } else {
- g_string_append_c(p->values->pdata[p->attr], c);
- }
- break;
- case CAMEL_HTML_PARSER_VAL_ENT:
- if (c==';') {
- state = CAMEL_HTML_PARSER_VAL;
- len = convert_entity(p->ent->str+1, p->ent_utf8);
- if (len == 0) {
- /* fallback; broken entity, just output it and see why we ended */
- g_string_append(p->values->pdata[p->attr], p->ent->str);
- g_string_append_c(p->values->pdata[p->attr], ';');
- } else {
- d(printf("got entity: %s = %s\n", p->ent->str, p->ent_utf8));
- g_string_append(p->values->pdata[p->attr], p->ent_utf8);
- }
- } else if (isalnum(c) || c=='#') { /* FIXME: right type */
- g_string_append_c(p->ent, c);
- } else {
- /* fallback; broken entity, just output it and see why we ended */
- g_string_append(p->values->pdata[p->attr], p->ent->str);
- goto do_val;
- }
- break;
- }
- }
-
- if (p->eof) {
- /* FIXME: what about other truncated states? */
- switch (state) {
- case CAMEL_HTML_PARSER_DATA:
- case CAMEL_HTML_PARSER_COMMENT:
- if (in > start) {
- ret = state;
- *datap = start;
- *lenp = in-start-1;
- } else {
- ret = CAMEL_HTML_PARSER_EOF;
- state = CAMEL_HTML_PARSER_EOF;
- }
- break;
- default:
- ret = CAMEL_HTML_PARSER_EOF;
- state = CAMEL_HTML_PARSER_EOF;
- }
- } else {
- /* we only care about remaining data for this buffer, everything else has its own copy */
- switch (state) {
- case CAMEL_HTML_PARSER_DATA:
- case CAMEL_HTML_PARSER_COMMENT:
- if (in > start) {
- ret = state;
- *datap = start;
- *lenp = in-start-1;
- } else {
- ret = CAMEL_HTML_PARSER_EOD;
- }
- break;
- default:
- ret = CAMEL_HTML_PARSER_EOD;
- }
- }
-
-done:
- p->start = start;
- p->state = state;
- p->inptr = in;
-
- return ret;
-}
diff --git a/camel/camel-html-parser.h b/camel/camel-html-parser.h
deleted file mode 100644
index 2e68e3bdff..0000000000
--- a/camel/camel-html-parser.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (C) 2001 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-/** WARNING
- **
- ** DO NOT USE THIS CODE OUTSIDE OF CAMEL
- **
- ** IT IS SUBJECT TO CHANGE OR MAY VANISH AT ANY TIME
- **/
-
-#ifndef _CAMEL_HTML_PARSER_H
-#define _CAMEL_HTML_PARSER_H
-
-#include <camel/camel-object.h>
-
-#define CAMEL_HTML_PARSER(obj) CAMEL_CHECK_CAST (obj, camel_html_parser_get_type (), CamelHTMLParser)
-#define CAMEL_HTML_PARSER_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_html_parser_get_type (), CamelHTMLParserClass)
-#define CAMEL_IS_HTML_PARSER(obj) CAMEL_CHECK_TYPE (obj, camel_html_parser_get_type ())
-
-typedef struct _CamelHTMLParserClass CamelHTMLParserClass;
-typedef struct _CamelHTMLParser CamelHTMLParser;
-
-/* Parser/tokeniser states */
-typedef enum _camel_html_parser_t {
- CAMEL_HTML_PARSER_DATA, /* raw data */
- CAMEL_HTML_PARSER_ENT, /* entity in data */
- CAMEL_HTML_PARSER_ELEMENT, /* element (tag + attributes scanned) */
- CAMEL_HTML_PARSER_TAG, /* tag */
- CAMEL_HTML_PARSER_DTDENT, /* dtd entity? <! blah blah > */
- CAMEL_HTML_PARSER_COMMENT0, /* start of comment */
- CAMEL_HTML_PARSER_COMMENT, /* body of comment */
- CAMEL_HTML_PARSER_ATTR0, /* start of attribute */
- CAMEL_HTML_PARSER_ATTR, /* attribute */
- CAMEL_HTML_PARSER_VAL0, /* start of value */
- CAMEL_HTML_PARSER_VAL, /* value */
- CAMEL_HTML_PARSER_VAL_ENT, /* entity in value */
- CAMEL_HTML_PARSER_EOD, /* end of current data */
- CAMEL_HTML_PARSER_EOF, /* end of file */
-} camel_html_parser_t;
-
-struct _CamelHTMLParser {
- CamelObject parent;
-
- struct _CamelHTMLParserPrivate *priv;
-};
-
-struct _CamelHTMLParserClass {
- CamelObjectClass parent_class;
-};
-
-CamelType camel_html_parser_get_type (void);
-CamelHTMLParser *camel_html_parser_new (void);
-
-void camel_html_parser_set_data(CamelHTMLParser *hp, const char *start, int len, int last);
-camel_html_parser_t camel_html_parser_step(CamelHTMLParser *hp, const char **datap, int *lenp);
-const char *camel_html_parser_left(CamelHTMLParser *hp, int *lenp);
-const char *camel_html_parser_tag(CamelHTMLParser *hp);
-const char *camel_html_parser_attr(CamelHTMLParser *hp, const char *name);
-const GPtrArray *camel_html_parser_attr_list(CamelHTMLParser *hp, const GPtrArray **values);
-
-#endif /* ! _CAMEL_HTML_PARSER_H */
diff --git a/camel/camel-http-stream.c b/camel/camel-http-stream.c
deleted file mode 100644
index b754422a3a..0000000000
--- a/camel/camel-http-stream.c
+++ /dev/null
@@ -1,583 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2002 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <errno.h>
-
-#include "camel-http-stream.h"
-
-#include "camel-mime-utils.h"
-#include "camel-stream-buffer.h"
-#include "camel-tcp-stream-raw.h"
-#ifdef HAVE_SSL
-#include "camel-tcp-stream-ssl.h"
-#endif
-#include "camel-exception.h"
-#include "camel-session.h"
-#include "camel-service.h" /* for hostname stuff */
-
-#define d(x) x
-
-
-static CamelStreamClass *parent_class = NULL;
-
-static ssize_t stream_read (CamelStream *stream, char *buffer, size_t n);
-static ssize_t stream_write (CamelStream *stream, const char *buffer, size_t n);
-static int stream_flush (CamelStream *stream);
-static int stream_close (CamelStream *stream);
-static int stream_reset (CamelStream *stream);
-
-static void
-camel_http_stream_class_init (CamelHttpStreamClass *camel_http_stream_class)
-{
- CamelStreamClass *camel_stream_class =
- CAMEL_STREAM_CLASS (camel_http_stream_class);
-
- parent_class = CAMEL_STREAM_CLASS (camel_type_get_global_classfuncs (camel_stream_get_type ()));
-
- /* virtual method overload */
- camel_stream_class->read = stream_read;
- camel_stream_class->write = stream_write;
- camel_stream_class->flush = stream_flush;
- camel_stream_class->close = stream_close;
- camel_stream_class->reset = stream_reset;
-}
-
-static void
-camel_http_stream_init (gpointer object, gpointer klass)
-{
- CamelHttpStream *http = CAMEL_HTTP_STREAM (object);
-
- http->parser = NULL;
- http->content_type = NULL;
- http->headers = NULL;
- http->session = NULL;
- http->url = NULL;
- http->proxy = NULL;
- http->authrealm = NULL;
- http->authpass = NULL;
- http->statuscode = 0;
- http->raw = NULL;
-}
-
-static void
-camel_http_stream_finalize (CamelObject *object)
-{
- CamelHttpStream *http = CAMEL_HTTP_STREAM (object);
-
- if (http->parser)
- camel_object_unref(http->parser);
-
- if (http->content_type)
- camel_content_type_unref (http->content_type);
-
- if (http->headers)
- camel_header_raw_clear (&http->headers);
-
- if (http->session)
- camel_object_unref(http->session);
-
- if (http->url)
- camel_url_free (http->url);
-
- if (http->proxy)
- camel_url_free (http->proxy);
-
- g_free (http->authrealm);
- g_free (http->authpass);
-
- if (http->raw)
- camel_object_unref(http->raw);
- if (http->read)
- camel_object_unref(http->read);
-}
-
-CamelType
-camel_http_stream_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_stream_get_type (),
- "CamelHttpStream",
- sizeof (CamelHttpStream),
- sizeof (CamelHttpStreamClass),
- (CamelObjectClassInitFunc) camel_http_stream_class_init,
- NULL,
- (CamelObjectInitFunc) camel_http_stream_init,
- (CamelObjectFinalizeFunc) camel_http_stream_finalize);
- }
-
- return type;
-}
-
-/**
- * camel_http_stream_new:
- * @method: HTTP method
- * @session: active session
- * @url: URL to act upon
- *
- * Return value: a http stream
- **/
-CamelStream *
-camel_http_stream_new (CamelHttpMethod method, struct _CamelSession *session, CamelURL *url)
-{
- CamelHttpStream *stream;
- char *str;
-
- g_return_val_if_fail(CAMEL_IS_SESSION(session), NULL);
- g_return_val_if_fail(url != NULL, NULL);
-
- stream = CAMEL_HTTP_STREAM (camel_object_new (camel_http_stream_get_type ()));
-
- stream->method = method;
- stream->session = session;
- camel_object_ref(session);
-
- str = camel_url_to_string (url, 0);
- stream->url = camel_url_new (str, NULL);
- g_free (str);
-
- return (CamelStream *)stream;
-}
-
-#define SSL_FLAGS (CAMEL_TCP_STREAM_SSL_ENABLE_SSL2 | CAMEL_TCP_STREAM_SSL_ENABLE_SSL3)
-
-static CamelStream *
-http_connect (CamelHttpStream *http, CamelURL *url)
-{
- CamelStream *stream = NULL;
- struct hostent *host;
- int errsave;
-
- if (!strcasecmp (url->protocol, "https")) {
-#ifdef HAVE_SSL
- stream = camel_tcp_stream_ssl_new (http->session, url->host, SSL_FLAGS);
-#endif
- } else {
- stream = camel_tcp_stream_raw_new ();
- }
-
- if (stream == NULL) {
- errno = EINVAL;
- return NULL;
- }
-
- printf("connecting to http stream @ '%s'\n", url->host);
-
- host = camel_gethostbyname (url->host, NULL);
- if (!host) {
- errno = EHOSTUNREACH;
- return NULL;
- }
-
- if (camel_tcp_stream_connect (CAMEL_TCP_STREAM (stream), host, url->port ? url->port : 80) == -1) {
- errsave = errno;
- camel_object_unref (stream);
- camel_free_host (host);
- errno = errsave;
- return NULL;
- }
-
- camel_free_host (host);
-
- http->raw = stream;
- http->read = camel_stream_buffer_new (stream, CAMEL_STREAM_BUFFER_READ);
-
- return stream;
-}
-
-static void
-http_disconnect(CamelHttpStream *http)
-{
- if (http->raw) {
- camel_object_unref(http->raw);
- http->raw = NULL;
- }
-
- if (http->read) {
- camel_object_unref(http->read);
- http->read = NULL;
- }
-
- if (http->parser) {
- camel_object_unref(http->parser);
- http->parser = NULL;
- }
-}
-
-static const char *
-http_next_token (const unsigned char *in)
-{
- const unsigned char *inptr = in;
-
- while (*inptr && !isspace ((int) *inptr))
- inptr++;
-
- while (*inptr && isspace ((int) *inptr))
- inptr++;
-
- return (const char *) inptr;
-}
-
-static int
-http_get_statuscode (CamelHttpStream *http)
-{
- const char *token;
- char buffer[4096];
-
- if (camel_stream_buffer_gets ((CamelStreamBuffer *)http->read, buffer, sizeof (buffer)) <= 0)
- return -1;
-
- d(printf("HTTP Status: %s\n", buffer));
-
- /* parse the HTTP status code */
- if (!strncasecmp (buffer, "HTTP/", 5)) {
- token = http_next_token (buffer);
- http->statuscode = camel_header_decode_int (&token);
- return http->statuscode;
- }
-
- http_disconnect(http);
-
- return -1;
-}
-
-static int
-http_get_headers (CamelHttpStream *http)
-{
- struct _camel_header_raw *headers, *node, *tail;
- const char *type;
- char *buf;
- size_t len;
- int err;
-
- if (http->parser)
- camel_object_unref (http->parser);
-
- http->parser = camel_mime_parser_new ();
- camel_mime_parser_init_with_stream (http->parser, http->read);
-
- switch (camel_mime_parser_step (http->parser, &buf, &len)) {
- case CAMEL_MIME_PARSER_STATE_MESSAGE:
- case CAMEL_MIME_PARSER_STATE_HEADER:
- headers = camel_mime_parser_headers_raw (http->parser);
- if (http->content_type)
- camel_content_type_unref (http->content_type);
- type = camel_header_raw_find (&headers, "Content-Type", NULL);
- if (type)
- http->content_type = camel_content_type_decode (type);
- else
- http->content_type = NULL;
-
- if (http->headers)
- camel_header_raw_clear (&http->headers);
-
- http->headers = NULL;
- tail = (struct _camel_header_raw *) &http->headers;
-
- d(printf("HTTP Headers:\n"));
- while (headers) {
- d(printf(" %s:%s\n", headers->name, headers->value));
- node = g_new (struct _camel_header_raw, 1);
- node->next = NULL;
- node->name = g_strdup (headers->name);
- node->value = g_strdup (headers->value);
- node->offset = headers->offset;
- tail->next = node;
- tail = node;
- headers = headers->next;
- }
-
- break;
- default:
- g_warning ("Invalid state encountered???: %d", camel_mime_parser_state (http->parser));
- }
-
- err = camel_mime_parser_errno (http->parser);
-
- if (err != 0) {
- camel_object_unref (http->parser);
- http->parser = NULL;
- goto exception;
- }
-
- camel_mime_parser_drop_step (http->parser);
-
- return 0;
-
- exception:
- http_disconnect(http);
-
- return -1;
-}
-
-static int
-http_method_invoke (CamelHttpStream *http)
-{
- const char *method = NULL;
- char *url;
-
- switch (http->method) {
- case CAMEL_HTTP_METHOD_GET:
- method = "GET";
- break;
- case CAMEL_HTTP_METHOD_HEAD:
- method = "HEAD";
- break;
- default:
- g_assert_not_reached ();
- }
-
- url = camel_url_to_string (http->url, 0);
- d(printf("HTTP Stream Sending: %s %s HTTP/1.0\r\nUser-Agent: %s\r\nHost: %s\r\n",
- method,
- http->proxy ? url : http->url->path,
- http->user_agent ? http->user_agent : "CamelHttpStream/1.0",
- http->url->host));
- if (camel_stream_printf (http->raw, "%s %s HTTP/1.0\r\nUser-Agent: %s\r\nHost: %s\r\n",
- method,
- http->proxy ? url : http->url->path,
- http->user_agent ? http->user_agent : "CamelHttpStream/1.0",
- http->url->host) == -1) {
- http_disconnect(http);
- g_free (url);
- return -1;
- }
- g_free (url);
-
- if (http->authrealm)
- d(printf("HTTP Stream Sending: WWW-Authenticate: %s\n", http->authrealm));
-
- if (http->authrealm && camel_stream_printf (http->raw, "WWW-Authenticate: %s\r\n", http->authrealm) == -1) {
- http_disconnect(http);
- return -1;
- }
-
- if (http->authpass && http->proxy && camel_stream_printf (http->raw, "Proxy-Authorization: Basic %s\r\n",
- http->authpass) == -1) {
- http_disconnect(http);
- return -1;
- }
-
- /* end the headers */
- if (camel_stream_write (http->raw, "\r\n", 2) == -1 || camel_stream_flush (http->raw) == -1) {
- http_disconnect(http);
- return -1;
- }
-
- return 0;
-}
-
-static ssize_t
-stream_read (CamelStream *stream, char *buffer, size_t n)
-{
- CamelHttpStream *http = CAMEL_HTTP_STREAM (stream);
- const char *parser_buf;
- ssize_t nread;
-
- if (http->method != CAMEL_HTTP_METHOD_GET && http->method != CAMEL_HTTP_METHOD_HEAD) {
- errno = EIO;
- return -1;
- }
-
- redirect:
-
- if (!http->raw) {
- if (http_connect (http, http->proxy ? http->proxy : http->url) == NULL)
- return -1;
-
- if (http_method_invoke (http) == -1)
- return -1;
-
- if (http_get_statuscode (http) == -1)
- return -1;
-
- if (http_get_headers (http) == -1)
- return -1;
-
- switch (http->statuscode) {
- case 200:
- case 206:
- /* we are OK to go... */
- break;
- case 301:
- case 302: {
- char *loc;
-
- camel_content_type_unref (http->content_type);
- http->content_type = NULL;
- http_disconnect(http);
-
- loc = g_strdup(camel_header_raw_find(&http->headers, "Location", NULL));
- if (loc == NULL) {
- camel_header_raw_clear(&http->headers);
- return -1;
- }
-
- /* redirect... */
- g_strstrip(loc);
- d(printf("HTTP redirect, location = %s\n", loc));
- camel_url_free (http->url);
- http->url = camel_url_new(loc, NULL);
- if (http->url == NULL) {
- printf("redirect url '%s' cannot be parsed\n", loc);
- camel_header_raw_clear (&http->headers);
- return -1;
- }
- d(printf(" redirect url = %p\n", http->url));
- camel_header_raw_clear (&http->headers);
-
- goto redirect;
- break; }
- case 407:
- /* failed proxy authentication? */
- default:
- /* unknown error */
- http_disconnect(http);
- return -1;
- }
- }
-
- nread = camel_mime_parser_read (http->parser, &parser_buf, n);
-
- if (nread > 0)
- memcpy (buffer, parser_buf, nread);
- else if (nread == 0)
- stream->eos = TRUE;
-
- return nread;
-}
-
-static ssize_t
-stream_write (CamelStream *stream, const char *buffer, size_t n)
-{
- return -1;
-}
-
-static int
-stream_flush (CamelStream *stream)
-{
- CamelHttpStream *http = (CamelHttpStream *) stream;
-
- if (http->raw)
- return camel_stream_flush (http->raw);
- else
- return 0;
-}
-
-static int
-stream_close (CamelStream *stream)
-{
- CamelHttpStream *http = (CamelHttpStream *) stream;
-
- if (http->raw) {
- if (camel_stream_close (http->raw) == -1)
- return -1;
-
- http_disconnect(http);
- }
-
- return 0;
-}
-
-static int
-stream_reset (CamelStream *stream)
-{
- CamelHttpStream *http = CAMEL_HTTP_STREAM (stream);
-
- if (http->raw)
- http_disconnect(http);
-
- return 0;
-};
-
-CamelContentType *
-camel_http_stream_get_content_type (CamelHttpStream *http_stream)
-{
- g_return_val_if_fail (CAMEL_IS_HTTP_STREAM (http_stream), NULL);
-
- if (!http_stream->content_type && !http_stream->raw) {
- if (http_connect (http_stream, http_stream->url) == NULL)
- return NULL;
-
- if (http_method_invoke (http_stream) == -1)
- return NULL;
-
- if (http_get_headers (http_stream) == -1)
- return NULL;
- }
-
- if (http_stream->content_type)
- camel_content_type_ref (http_stream->content_type);
-
- return http_stream->content_type;
-}
-
-void
-camel_http_stream_set_user_agent (CamelHttpStream *http_stream, const char *user_agent)
-{
- g_return_if_fail (CAMEL_IS_HTTP_STREAM (http_stream));
-
- g_free (http_stream->user_agent);
- http_stream->user_agent = g_strdup (user_agent);
-}
-
-void
-camel_http_stream_set_proxy (CamelHttpStream *http_stream, const char *proxy_url)
-{
- g_return_if_fail (CAMEL_IS_HTTP_STREAM (http_stream));
-
- if (http_stream->proxy)
- camel_url_free (http_stream->proxy);
-
- if (proxy_url == NULL)
- http_stream->proxy = NULL;
- else
- http_stream->proxy = camel_url_new (proxy_url, NULL);
-}
-
-void
-camel_http_stream_set_proxy_authrealm (CamelHttpStream *http_stream, const char *proxy_authrealm)
-{
- g_return_if_fail (CAMEL_IS_HTTP_STREAM (http_stream));
-
- g_free (http_stream->authrealm);
- http_stream->authrealm = g_strdup (proxy_authrealm);
-}
-
-void
-camel_http_stream_set_proxy_authpass (CamelHttpStream *http_stream, const char *proxy_authpass)
-{
- g_return_if_fail (CAMEL_IS_HTTP_STREAM (http_stream));
-
- g_free (http_stream->authpass);
- http_stream->authpass = g_strdup (proxy_authpass);
-}
diff --git a/camel/camel-http-stream.h b/camel/camel-http-stream.h
deleted file mode 100644
index 94272ee6c3..0000000000
--- a/camel/camel-http-stream.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2002 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifndef __CAMEL_HTTP_STREAM_H__
-#define __CAMEL_HTTP_STREAM_H__
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <camel/camel-mime-parser.h>
-#include <camel/camel-mime-utils.h>
-#include <camel/camel-stream.h>
-#include <camel/camel-url.h>
-
-#define CAMEL_HTTP_STREAM_TYPE (camel_http_stream_get_type ())
-#define CAMEL_HTTP_STREAM(obj) (CAMEL_CHECK_CAST((obj), CAMEL_HTTP_STREAM_TYPE, CamelHttpStream))
-#define CAMEL_HTTP_STREAM_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_HTTP_STREAM_TYPE, CamelHttpStreamClass))
-#define CAMEL_IS_HTTP_STREAM(o) (CAMEL_CHECK_TYPE((o), CAMEL_HTTP_STREAM_TYPE))
-
-typedef enum {
- /*CAMEL_HTTP_METHOD_OPTIONS,*/
- CAMEL_HTTP_METHOD_GET,
- CAMEL_HTTP_METHOD_HEAD,
- /*CAMEL_HTTP_METHOD_POST,*/
- /*CAMEL_HTTP_METHOD_PUT,*/
- /*CAMEL_HTTP_METHOD_DELETE,*/
- /*CAMEL_HTTP_METHOD_TRACE,*/
- /*CAMEL_HTTP_METHOD_CONNECT*/
-} CamelHttpMethod;
-
-
-typedef struct _CamelHttpStreamClass CamelHttpStreamClass;
-
-struct _CamelHttpStream {
- CamelStream parent_object;
-
- CamelMimeParser *parser;
-
- CamelContentType *content_type;
- struct _camel_header_raw *headers;
-
- CamelHttpMethod method;
- struct _CamelSession *session;
- CamelURL *url;
-
- char *user_agent;
-
- /* proxy info */
- CamelURL *proxy;
- char *authrealm;
- char *authpass;
-
- int statuscode;
-
- CamelStream *raw;
- CamelStream *read;
-};
-
-struct _CamelHttpStreamClass {
- CamelStreamClass parent_class;
-
- /* Virtual methods */
-};
-
-/* Standard Camel function */
-CamelType camel_http_stream_get_type (void);
-
-/* public methods */
-CamelStream *camel_http_stream_new (CamelHttpMethod method, struct _CamelSession *session, CamelURL *url);
-
-void camel_http_stream_set_user_agent (CamelHttpStream *http_stream, const char *user_agent);
-
-void camel_http_stream_set_proxy (CamelHttpStream *http_stream, const char *proxy_url);
-void camel_http_stream_set_proxy_authrealm (CamelHttpStream *http_stream, const char *proxy_authrealm);
-void camel_http_stream_set_proxy_authpass (CamelHttpStream *http_stream, const char *proxy_authpass);
-
-CamelContentType *camel_http_stream_get_content_type (CamelHttpStream *http_stream);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __CAMEL_HTTP_STREAM_H__ */
diff --git a/camel/camel-i18n.h b/camel/camel-i18n.h
deleted file mode 100644
index 9330fe68d9..0000000000
--- a/camel/camel-i18n.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2002 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifndef __CAMEL_I18N_H__
-#define __CAMEL_I18N_H__
-
-#include <glib.h>
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#ifdef ENABLE_NLS
-# include <libintl.h>
-# ifdef CAMEL_EXPLICIT_TRANSLATION_DOMAIN
-# undef _
-# define _(String) dgettext (CAMEL_EXPLICIT_TRANSLATION_DOMAIN, String)
-# else
-# define _(String) gettext (String)
-# endif
-# ifdef gettext_noop
-# define N_(String) gettext_noop (String)
-# else
-# define N_(String) (String)
-# endif
-#else
-/* Stubs that do something close enough. */
-# define textdomain(String) (String)
-# define gettext(String) (String)
-# define dgettext(Domain,Message) (Message)
-# define dcgettext(Domain,Message,Type) (Message)
-# define bindtextdomain(Domain,Directory) (Domain)
-# define _(String) (String)
-# define N_(String) (String)
-#endif
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __CAMEL_I18N_H__ */
diff --git a/camel/camel-iconv.c b/camel/camel-iconv.c
deleted file mode 100644
index 690ec520ad..0000000000
--- a/camel/camel-iconv.c
+++ /dev/null
@@ -1,646 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- * Michael Zucchi <notzed@ximian.com>
- *
- * Copyright 2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <glib.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-
-#include <locale.h>
-
-#ifdef HAVE_CODESET
-#include <langinfo.h>
-#endif
-
-#include "e-util/e-memory.h"
-#include "camel-charset-map.h"
-#include "string-utils.h"
-#include "camel-iconv.h"
-
-#define d(x)
-
-#ifdef G_THREADS_ENABLED
-static GStaticMutex lock = G_STATIC_MUTEX_INIT;
-#define LOCK() g_static_mutex_lock (&lock)
-#define UNLOCK() g_static_mutex_unlock (&lock)
-#else
-#define LOCK()
-#define UNLOCK()
-#endif
-
-
-typedef struct _EDListNode {
- struct _EDListNode *next;
- struct _EDListNode *prev;
-} EDListNode;
-
-typedef struct _EDList {
- struct _EDListNode *head;
- struct _EDListNode *tail;
- struct _EDListNode *tailpred;
-} EDList;
-
-#define E_DLIST_INITIALISER(l) { (EDListNode *)&l.tail, 0, (EDListNode *)&l.head }
-
-struct _iconv_cache_node {
- struct _iconv_cache_node *next;
- struct _iconv_cache_node *prev;
-
- struct _iconv_cache *parent;
-
- int busy;
- iconv_t cd;
-};
-
-struct _iconv_cache {
- struct _iconv_cache *next;
- struct _iconv_cache *prev;
-
- char *conv;
-
- EDList open; /* stores iconv_cache_nodes, busy ones up front */
-};
-
-#define CAMEL_ICONV_CACHE_SIZE (16)
-
-static EDList iconv_cache_list;
-static GHashTable *iconv_cache;
-static GHashTable *iconv_cache_open;
-static unsigned int iconv_cache_size = 0;
-
-static GHashTable *iconv_charsets = NULL;
-static char *locale_charset = NULL;
-static char *locale_lang = NULL;
-
-struct {
- char *charset;
- char *iconv_name;
-} known_iconv_charsets[] = {
-#if 0
- /* charset name, iconv-friendly charset name */
- { "iso-8859-1", "iso-8859-1" },
- { "iso8859-1", "iso-8859-1" },
- /* the above mostly serves as an example for iso-style charsets,
- but we have code that will populate the iso-*'s if/when they
- show up in e_iconv_charset_name() so I'm
- not going to bother putting them all in here... */
- { "windows-cp1251", "cp1251" },
- { "windows-1251", "cp1251" },
- { "cp1251", "cp1251" },
- /* the above mostly serves as an example for windows-style
- charsets, but we have code that will parse and convert them
- to their cp#### equivalents if/when they show up in
- e_iconv_charset_name() so I'm not going to bother
- putting them all in here either... */
-#endif
- /* charset name (lowercase!), iconv-friendly name (sometimes case sensitive) */
- { "utf-8", "UTF-8" },
-
- /* 10646 is a special case, its usually UCS-2 big endian */
- /* This might need some checking but should be ok for solaris/linux */
- { "iso-10646-1", "UCS-2BE" },
- { "iso_10646-1", "UCS-2BE" },
- { "iso10646-1", "UCS-2BE" },
- { "iso-10646", "UCS-2BE" },
- { "iso_10646", "UCS-2BE" },
- { "iso10646", "UCS-2BE" },
-
- { "ks_c_5601-1987", "EUC-KR" },
-
- /* FIXME: Japanese/Korean/Chinese stuff needs checking */
- { "euckr-0", "EUC-KR" },
- { "5601", "EUC-KR" },
- { "zh_TW-euc", "EUC-TW" },
- { "zh_CN.euc", "gb2312" },
- { "zh_TW-big5", "BIG5" },
- { "big5-0", "BIG5" },
- { "big5.eten-0", "BIG5" },
- { "big5hkscs-0", "BIG5HKSCS" },
- { "gb2312-0", "gb2312" },
- { "gb2312.1980-0", "gb2312" },
- { "gb-2312", "gb2312" },
- { "gb18030-0", "gb18030" },
- { "gbk-0", "GBK" },
-
- { "eucjp-0", "eucJP" },
- { "ujis-0", "ujis" },
- { "jisx0208.1983-0","SJIS" },
- { "jisx0212.1990-0","SJIS" },
- { "pck", "SJIS" },
- { NULL, NULL }
-};
-
-
-
-/* Another copy of this trivial list implementation
- Why? This stuff gets called a lot (potentially), should run fast,
- and g_list's are f@@#$ed up to make this a hassle */
-static void
-e_dlist_init (EDList *v)
-{
- v->head = (EDListNode *) &v->tail;
- v->tail = 0;
- v->tailpred = (EDListNode *) &v->head;
-}
-
-static EDListNode *
-e_dlist_addhead (EDList *l, EDListNode *n)
-{
- n->next = l->head;
- n->prev = (EDListNode *) &l->head;
- l->head->prev = n;
- l->head = n;
- return n;
-}
-
-static EDListNode *
-e_dlist_addtail (EDList *l, EDListNode *n)
-{
- n->next = (EDListNode *) &l->tail;
- n->prev = l->tailpred;
- l->tailpred->next = n;
- l->tailpred = n;
- return n;
-}
-
-static EDListNode *
-e_dlist_remove (EDListNode *n)
-{
- n->next->prev = n->prev;
- n->prev->next = n->next;
- return n;
-}
-
-
-static void
-locale_parse_lang (const char *locale)
-{
- char *codeset, *lang;
-
- if ((codeset = strchr (locale, '.')))
- lang = g_strndup (locale, codeset - locale);
- else
- lang = g_strdup (locale);
-
- /* validate the language */
- if (strlen (lang) >= 2) {
- if (lang[2] == '-' || lang[2] == '_') {
- /* canonicalise the lang */
- camel_strdown (lang);
-
- /* validate the country code */
- if (strlen (lang + 3) > 2) {
- /* invalid country code */
- lang[2] = '\0';
- } else {
- lang[2] = '-';
- e_strup (lang + 3);
- }
- } else if (lang[2] != '\0') {
- /* invalid language */
- g_free (lang);
- lang = NULL;
- }
-
- locale_lang = lang;
- } else {
- /* invalid language */
- locale_lang = NULL;
- g_free (lang);
- }
-}
-
-
-/**
- * camel_iconv_init:
- *
- * Initialize Camel's iconv cache. This *MUST* be called before any
- * camel-iconv interfaces will work correctly.
- **/
-static void
-camel_iconv_init (int keep)
-{
- char *from, *to, *locale;
- int i;
-
- LOCK ();
-
- if (iconv_charsets != NULL) {
- if (!keep)
- UNLOCK ();
- return;
- }
-
- iconv_charsets = g_hash_table_new (g_str_hash, g_str_equal);
-
- for (i = 0; known_iconv_charsets[i].charset != NULL; i++) {
- from = g_strdup (known_iconv_charsets[i].charset);
- to = g_strdup (known_iconv_charsets[i].iconv_name);
- camel_strdown (from);
- g_hash_table_insert (iconv_charsets, from, to);
- }
-
- e_dlist_init (&iconv_cache_list);
- iconv_cache = g_hash_table_new (g_str_hash, g_str_equal);
- iconv_cache_open = g_hash_table_new (NULL, NULL);
-
- locale = setlocale (LC_ALL, NULL);
-
- if (!locale || !strcmp (locale, "C") || !strcmp (locale, "POSIX")) {
- /* The locale "C" or "POSIX" is a portable locale; its
- * LC_CTYPE part corresponds to the 7-bit ASCII character
- * set.
- */
-
- locale_charset = NULL;
- locale_lang = NULL;
- } else {
-#ifdef HAVE_CODESET
- locale_charset = g_strdup (nl_langinfo (CODESET));
- camel_strdown (locale_charset);
-#else
- /* A locale name is typically of the form language[_terri-
- * tory][.codeset][@modifier], where language is an ISO 639
- * language code, territory is an ISO 3166 country code, and
- * codeset is a character set or encoding identifier like
- * ISO-8859-1 or UTF-8.
- */
- char *codeset, *p;
-
- codeset = strchr (locale, '.');
- if (codeset) {
- codeset++;
-
- /* ; is a hack for debian systems and / is a hack for Solaris systems */
- for (p = codeset; *p && !strchr ("@;/", *p); p++);
- locale_charset = g_strndup (codeset, p - codeset);
- camel_strdown (locale_charset);
- } else {
- /* charset unknown */
- locale_charset = NULL;
- }
-#endif
-
- /* parse the locale lang */
- locale_parse_lang (locale);
- }
-
- if (!keep)
- UNLOCK ();
-}
-
-
-/**
- * camel_iconv_charset_name:
- * @charset: charset name
- *
- * Maps charset names to the names that iconv_open() is more
- * likely able to handle.
- *
- * Returns an iconv-friendly name for @charset.
- **/
-const char *
-camel_iconv_charset_name (const char *charset)
-{
- char *name, *iname, *tmp;
-
- if (charset == NULL)
- return NULL;
-
- name = g_alloca (strlen (charset) + 1);
- strcpy (name, charset);
- camel_strdown (name);
-
- camel_iconv_init (TRUE);
- if ((iname = g_hash_table_lookup (iconv_charsets, name)) != NULL) {
- UNLOCK ();
- return iname;
- }
-
- /* Unknown, try canonicalise some basic charset types to something that should work */
- if (strncmp (name, "iso", 3) == 0) {
- /* Convert iso-####-# or iso####-# or iso_####-# to iso-####-# or iso####-# */
- int iso, codepage;
- char *p;
-
- tmp = name + 3;
- if (*tmp == '-' || *tmp == '_')
- tmp++;
-
- iso = strtoul (tmp, &p, 10);
-
- if (iso == 10646) {
- /* they all become ICONV_10646 */
- iname = g_strdup (ICONV_10646);
- } else {
- tmp = p;
- if (*tmp == '-' || *tmp == '_')
- tmp++;
-
- codepage = strtoul (tmp, &p, 10);
-
- if (p > tmp) {
- /* codepage is numeric */
-#ifdef __aix__
- if (codepage == 13)
- iname = g_strdup ("IBM-921");
- else
-#endif /* __aix__ */
- iname = g_strdup_printf (ICONV_ISO_D_FORMAT, iso, codepage);
- } else {
- /* codepage is a string - probably iso-2022-jp or something */
- iname = g_strdup_printf (ICONV_ISO_S_FORMAT, iso, p);
- }
- }
- } else if (strncmp (name, "windows-", 8) == 0) {
- /* Convert windows-#### or windows-cp#### to cp#### */
- tmp = name + 8;
- if (!strncmp (tmp, "cp", 2))
- tmp += 2;
- iname = g_strdup_printf ("CP%s", tmp);
- } else if (strncmp (name, "microsoft-", 10) == 0) {
- /* Convert microsoft-#### or microsoft-cp#### to cp#### */
- tmp = name + 10;
- if (!strncmp (tmp, "cp", 2))
- tmp += 2;
- iname = g_strdup_printf ("CP%s", tmp);
- } else {
- /* Just assume its ok enough as is, case and all */
- iname = g_strdup (charset);
- }
-
- g_hash_table_insert (iconv_charsets, g_strdup (name), iname);
- UNLOCK ();
-
- return iname;
-}
-
-static void
-flush_entry (struct _iconv_cache *ic)
-{
- struct _iconv_cache_node *in, *nn;
-
- in = (struct _iconv_cache_node *) ic->open.head;
- nn = in->next;
- while (nn) {
- if (in->cd != (iconv_t) -1) {
- g_hash_table_remove (iconv_cache_open, in->cd);
- iconv_close (in->cd);
- }
-
- g_free (in);
- in = nn;
- nn = in->next;
- }
-
- g_free (ic->conv);
- g_free (ic);
-}
-
-
-/* This should run pretty quick, its called a lot */
-/**
- * camel_iconv_open:
- * @to: charset to convert to
- * @from: charset to convert from
- *
- * Allocates a coversion descriptor suitable for converting byte
- * sequences from charset @from to charset @to. The resulting
- * descriptor can be used with iconv (or the camel_iconv wrapper) any
- * number of times until closed using camel_iconv_close.
- *
- * Returns a new conversion descriptor for use with iconv on success
- * or (iconv_t) -1 on fail as well as setting an appropriate errno
- * value.
- **/
-iconv_t
-camel_iconv_open (const char *to, const char *from)
-{
- struct _iconv_cache *ic;
- struct _iconv_cache_node *in;
- int errnosav;
- iconv_t cd;
- char *key;
-
- if (to == NULL || from == NULL) {
- errno = EINVAL;
- return (iconv_t) -1;
- }
-
- to = camel_iconv_charset_name (to);
- from = camel_iconv_charset_name (from);
- key = g_alloca (strlen (to) + strlen (from) + 2);
- sprintf (key, "%s:%s", to, from);
-
- LOCK ();
-
- ic = g_hash_table_lookup (iconv_cache, key);
- if (ic) {
- e_dlist_remove ((EDListNode *) ic);
- } else {
- struct _iconv_cache *last = (struct _iconv_cache *) iconv_cache_list.tailpred;
- struct _iconv_cache *prev;
-
- prev = last->prev;
- while (prev && iconv_cache_size > CAMEL_ICONV_CACHE_SIZE) {
- in = (struct _iconv_cache_node *) last->open.head;
- if (in->next && !in->busy) {
- d(printf ("Flushing iconv converter '%s'\n", last->conv));
- e_dlist_remove ((EDListNode *) last);
- g_hash_table_remove (iconv_cache, last->conv);
- flush_entry (last);
- iconv_cache_size--;
- }
- last = prev;
- prev = last->prev;
- }
-
- iconv_cache_size++;
-
- ic = g_new (struct _iconv_cache);
- e_dlist_init (&ic->open);
- ic->conv = g_strdup (key);
- g_hash_table_insert (iconv_cache, ic->conv, ic);
-
- d(printf ("Creating iconv converter '%s'\n", ic->conv));
- }
- e_dlist_addhead (&iconv_cache_list, (EDListNode *) ic);
-
- /* If we have a free iconv, use it */
- in = (struct _iconv_cache_node *) ic->open.tailpred;
- if (in->prev && !in->busy) {
- d(printf ("using existing iconv converter '%s'\n", ic->conv));
- cd = in->cd;
- if (cd != (iconv_t) -1) {
- /* work around some broken iconv implementations
- * that die if the length arguments are NULL
- */
- size_t buggy_iconv_len = 0;
- char *buggy_iconv_buf = NULL;
-
- /* resets the converter */
- iconv (cd, &buggy_iconv_buf, &buggy_iconv_len, &buggy_iconv_buf, &buggy_iconv_len);
- in->busy = TRUE;
- e_dlist_remove ((EDListNode *) in);
- e_dlist_addhead (&ic->open, (EDListNode *) in);
- }
- } else {
- d(printf("creating new iconv converter '%s'\n", ic->conv));
- cd = iconv_open (to, from);
- in = g_new (struct _iconv_cache_node);
- in->cd = cd;
- in->parent = ic;
- e_dlist_addhead (&ic->open, (EDListNode *) in);
- if (cd != (iconv_t) -1) {
- g_hash_table_insert (iconv_cache_open, cd, in);
- in->busy = TRUE;
- } else {
- errnosav = errno;
- g_warning ("Could not open converter for '%s' to '%s' charset", from, to);
- in->busy = FALSE;
- errno = errnosav;
- }
- }
-
- UNLOCK ();
-
- return cd;
-}
-
-
-/**
- * camel_iconv:
- * @cd: conversion descriptor
- * @inbuf: address of input buffer
- * @inleft: input bytes left
- * @outbuf: address of output buffer
- * @outleft: output bytes left
- *
- * Read `man 3 iconv`
- **/
-size_t
-camel_iconv (iconv_t cd, const char **inbuf, size_t *inleft, char **outbuf, size_t *outleft)
-{
- return iconv (cd, (ICONV_CONST char **) inbuf, inleft, outbuf, outleft);
-}
-
-
-/**
- * camel_iconv_close:
- * @cd: iconv conversion descriptor
- *
- * Closes the iconv descriptor @cd.
- *
- * Returns 0 on success or -1 on fail as well as setting an
- * appropriate errno value.
- **/
-void
-camel_iconv_close (iconv_t cd)
-{
- struct _iconv_cache_node *in;
-
- if (cd == (iconv_t) -1)
- return;
-
- LOCK ();
-
- in = g_hash_table_lookup (iconv_cache_open, cd);
- if (in) {
- d(printf ("closing iconv converter '%s'\n", in->parent->conv));
- e_dlist_remove ((EDListNode *) in);
- in->busy = FALSE;
- e_dlist_addtail (&in->parent->open, (EDListNode *) in);
- } else {
- g_warning ("trying to close iconv i dont know about: %p", cd);
- iconv_close (cd);
- }
-
- UNLOCK ();
-}
-
-
-const char *
-camel_iconv_locale_charset (void)
-{
- camel_iconv_init (FALSE);
-
- return locale_charset;
-}
-
-
-const char *
-camel_iconv_locale_language (void)
-{
- camel_iconv_init (FALSE);
-
- return locale_lang;
-}
-
-/* map CJKR charsets to their language code */
-/* NOTE: only support charset names that will be returned by
- * e_iconv_charset_name() so that we don't have to keep track of all
- * the aliases too. */
-static struct {
- char *charset;
- char *lang;
-} cjkr_lang_map[] = {
- { "Big5", "zh" },
- { "BIG5HKSCS", "zh" },
- { "gb2312", "zh" },
- { "gb18030", "zh" },
- { "gbk", "zh" },
- { "euc-tw", "zh" },
- { "iso-2022-jp", "ja" },
- { "sjis", "ja" },
- { "ujis", "ja" },
- { "eucJP", "ja" },
- { "euc-jp", "ja" },
- { "euc-kr", "ko" },
- { "koi8-r", "ru" },
- { "koi8-u", "uk" }
-};
-
-#define NUM_CJKR_LANGS (sizeof (cjkr_lang_map) / sizeof (cjkr_lang_map[0]))
-
-const char *
-camel_iconv_charset_language (const char *charset)
-{
- int i;
-
- if (!charset)
- return NULL;
-
- charset = camel_iconv_charset_name (charset);
- for (i = 0; i < NUM_CJKR_LANGS; i++) {
- if (!strcasecmp (cjkr_lang_map[i].charset, charset))
- return cjkr_lang_map[i].lang;
- }
-
- return NULL;
-}
diff --git a/camel/camel-iconv.h b/camel/camel-iconv.h
deleted file mode 100644
index f57346816a..0000000000
--- a/camel/camel-iconv.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifndef __CAMEL_ICONV_H__
-#define __CAMEL_ICONV_H__
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <sys/types.h>
-#include <iconv.h>
-
-const char *camel_iconv_locale_charset (void);
-const char *camel_iconv_locale_language (void);
-
-const char *camel_iconv_charset_name (const char *charset);
-
-const char *camel_iconv_charset_language (const char *charset);
-
-iconv_t camel_iconv_open (const char *to, const char *from);
-size_t camel_iconv (iconv_t cd, const char **inbuf, size_t *inleft, char **outbuf, size_t *outleft);
-void camel_iconv_close (iconv_t cd);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __CAMEL_ICONV_H__ */
diff --git a/camel/camel-index-control.c b/camel/camel-index-control.c
deleted file mode 100644
index f42819f5a5..0000000000
--- a/camel/camel-index-control.c
+++ /dev/null
@@ -1,213 +0,0 @@
-
-/* Command to manually force a compression/dump of an index file */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <ctype.h>
-#include <sys/stat.h>
-#include <sys/uio.h>
-#include <unistd.h>
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-#include "e-util/e-msgport.h"
-#include "e-util/e-memory.h"
-
-#include "camel/camel-object.h"
-
-#include "camel-text-index.h"
-
-#include <stdio.h>
-
-static void
-do_usage(char *argv0)
-{
- fprintf(stderr, "Usage: %s [ compress | dump | info ] file(s) ...\n", argv0);
- fprintf(stderr, " compress - compress (an) index file(s)\n");
- fprintf(stderr, " dump - dump (an) index file's content to stdout\n");
- fprintf(stderr, " info - dump summary info to stdout\n");
- exit(1);
-}
-
-static int
-do_compress(int argc, char **argv)
-{
- int i;
- CamelIndex *idx;
-
- for (i=2;i<argc;i++) {
- printf("Opening index file: %s\n", argv[i]);
- idx = (CamelIndex *)camel_text_index_new(argv[i], O_RDWR);
- if (idx) {
- printf(" Compressing ...\n");
- if (camel_index_compress(idx) == -1) {
- camel_object_unref((CamelObject *)idx);
- return 1;
- }
- camel_object_unref((CamelObject *)idx);
- } else {
- printf(" Failed: %s\n", strerror (errno));
- return 1;
- }
- }
- return 0;
-}
-
-static int
-do_dump(int argc, char **argv)
-{
- int i;
- CamelIndex *idx;
-
- for (i=2;i<argc;i++) {
- printf("Opening index file: %s\n", argv[i]);
- idx = (CamelIndex *)camel_text_index_new(argv[i], O_RDONLY);
- if (idx) {
- printf(" Dumping ...\n");
- camel_text_index_dump((CamelTextIndex *)idx);
- camel_object_unref((CamelObject *)idx);
- } else {
- printf(" Failed: %s\n", strerror (errno));
- return 1;
- }
- }
- return 0;
-}
-
-static int
-do_info(int argc, char **argv)
-{
- int i;
- CamelIndex *idx;
-
- for (i=2;i<argc;i++) {
- printf("Opening index file: %s\n", argv[i]);
- idx = (CamelIndex *)camel_text_index_new(argv[i], O_RDONLY);
- if (idx) {
- camel_text_index_info((CamelTextIndex *)idx);
- camel_object_unref((CamelObject *)idx);
- } else {
- printf(" Failed: %s\n", strerror (errno));
- return 0;
- }
- }
- return 1;
-}
-
-static int
-do_check(int argc, char **argv)
-{
- int i;
- CamelIndex *idx;
-
- for (i=2;i<argc;i++) {
- printf("Opening index file: %s\n", argv[i]);
- idx = (CamelIndex *)camel_text_index_new(argv[i], O_RDONLY);
- if (idx) {
- camel_text_index_validate((CamelTextIndex *)idx);
- camel_object_unref((CamelObject *)idx);
- } else {
- printf(" Failed: %s\n", strerror (errno));
- return 0;
- }
- }
- return 1;
-}
-
-static int do_perf(int argc, char **argv);
-
-int main(int argc, char **argv)
-{
- extern int camel_init(const char *certdb_dir, gboolean nss_init);
-
- if (argc<2)
- do_usage(argv[0]);
-
- g_thread_init(NULL);
- camel_init(NULL, 0);
-
- if (!strcmp(argv[1], "compress"))
- return do_compress(argc, argv);
- else if (!strcmp(argv[1], "dump"))
- return do_dump(argc, argv);
- else if (!strcmp(argv[1], "info"))
- return do_info(argc, argv);
- else if (!strcmp(argv[1], "check"))
- return do_check(argc, argv);
- else if (!strcmp(argv[1], "perf"))
- return do_perf(argc, argv);
-
- do_usage(argv[0]);
- return 1;
-}
-
-#include <sys/types.h>
-#include <dirent.h>
-#include "camel-stream-null.h"
-#include "camel-stream-filter.h"
-#include "camel-mime-filter-index.h"
-#include "camel-stream-fs.h"
-
-static int
-do_perf(int argc, char **argv)
-{
- CamelIndex *idx;
- DIR *dir;
- char *path = "/home/notzed/evolution/local/Inbox/mbox/cur";
- struct dirent *d;
- CamelStream *null, *filter, *stream;
- CamelMimeFilterIndex *filter_index;
- char *name;
- CamelIndexName *idn;
-
- dir = opendir(path);
- if (dir == NULL) {
- perror("open dir");
- return 1;
- }
-
- idx = (CamelIndex *)camel_text_index_new("/tmp/index", O_TRUNC|O_CREAT|O_RDWR);
- if (idx == NULL) {
- perror("open index");
- return 1;
- }
-
- null = camel_stream_null_new();
- filter = (CamelStream *)camel_stream_filter_new_with_stream(null);
- camel_object_unref((CamelObject *)null);
- filter_index = camel_mime_filter_index_new_index(idx);
- camel_stream_filter_add((CamelStreamFilter *)filter, (CamelMimeFilter *)filter_index);
-
- while ((d = readdir(dir))) {
- printf("indexing '%s'\n", d->d_name);
-
- idn = camel_index_add_name(idx, d->d_name);
- camel_mime_filter_index_set_name(filter_index, idn);
- name = g_strdup_printf("%s/%s", path, d->d_name);
- stream = camel_stream_fs_new_with_name(name, O_RDONLY, 0);
- camel_stream_write_to_stream(stream, filter);
- camel_object_unref((CamelObject *)stream);
- g_free(name);
-
- camel_index_write_name(idx, idn);
- camel_object_unref((CamelObject *)idn);
- camel_mime_filter_index_set_name(filter_index, NULL);
- }
-
- closedir(dir);
-
- camel_index_sync(idx);
- camel_object_unref((CamelObject *)idx);
-
- camel_object_unref((CamelObject *)filter);
- camel_object_unref((CamelObject *)filter_index);
-
- return 0;
-}
diff --git a/camel/camel-index.c b/camel/camel-index.c
deleted file mode 100644
index 6a7cba6afe..0000000000
--- a/camel/camel-index.c
+++ /dev/null
@@ -1,396 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; fill-column: 160 -*- */
-/*
- * Copyright (C) 2001 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <ctype.h>
-#include <sys/stat.h>
-#include <sys/uio.h>
-#include <unistd.h>
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include "camel-index.h"
-#include "camel/camel-object.h"
-
-#define w(x)
-#define io(x)
-#define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))*/
-
-#define CAMEL_INDEX_VERSION (0x01)
-
-struct _CamelIndexPrivate {
- void *dummy;
-};
-
-#define _PRIVATE(o) (((CamelIndex *)(o))->priv)
-
-#define CI_CLASS(o) ((CamelIndexClass *)(((CamelObject *)o)->klass))
-
-/* ********************************************************************** */
-/* CamelIndex */
-/* ********************************************************************** */
-
-static CamelObjectClass *camel_index_parent;
-
-static void
-camel_index_class_init(CamelIndexClass *klass)
-{
- camel_index_parent = CAMEL_OBJECT_CLASS(camel_type_get_global_classfuncs(camel_object_get_type()));
-}
-
-static void
-camel_index_init(CamelIndex *idx)
-{
- struct _CamelIndexPrivate *p;
-
- p = _PRIVATE(idx) = g_malloc0(sizeof(*p));
-
- idx->version = CAMEL_INDEX_VERSION;
-}
-
-static void
-camel_index_finalise(CamelIndex *idx)
-{
- g_free(idx->path);
- g_free(idx->priv);
-}
-
-CamelType
-camel_index_get_type(void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register(camel_object_get_type(), "CamelIndex",
- sizeof (CamelIndex),
- sizeof (CamelIndexClass),
- (CamelObjectClassInitFunc) camel_index_class_init,
- NULL,
- (CamelObjectInitFunc) camel_index_init,
- (CamelObjectFinalizeFunc) camel_index_finalise);
- }
-
- return type;
-}
-
-CamelIndex *
-camel_index_new(const char *path, int flags)
-{
- CamelIndex *idx = (CamelIndex *)camel_object_new(camel_index_get_type());
-
- camel_index_construct(idx, path, flags);
-
- return idx;
-}
-
-void
-camel_index_construct(CamelIndex *idx, const char *path, int flags)
-{
- g_free(idx->path);
- idx->path = g_strdup_printf("%s.index", path);
- idx->flags = flags;
-}
-
-int
-camel_index_rename(CamelIndex *idx, const char *path)
-{
- if ((idx->state & CAMEL_INDEX_DELETED) == 0)
- return CI_CLASS(idx)->rename(idx, path);
- else {
- errno = ENOENT;
- return -1;
- }
-}
-
-void
-camel_index_set_normalise(CamelIndex *idx, CamelIndexNorm func, void *data)
-{
- idx->normalise = func;
- idx->normalise_data = data;
-}
-
-int
-camel_index_sync(CamelIndex *idx)
-{
- if ((idx->state & CAMEL_INDEX_DELETED) == 0)
- return CI_CLASS(idx)->sync(idx);
- else {
- errno = ENOENT;
- return -1;
- }
-}
-
-int
-camel_index_compress(CamelIndex *idx)
-{
- if ((idx->state & CAMEL_INDEX_DELETED) == 0)
- return CI_CLASS(idx)->compress(idx);
- else {
- errno = ENOENT;
- return -1;
- }
-}
-
-int
-camel_index_delete(CamelIndex *idx)
-{
- int ret;
-
- if ((idx->state & CAMEL_INDEX_DELETED) == 0) {
- ret = CI_CLASS(idx)->delete(idx);
- idx->state |= CAMEL_INDEX_DELETED;
- } else {
- errno = ENOENT;
- ret = -1;
- }
-
- return ret;
-}
-
-int
-camel_index_has_name(CamelIndex *idx, const char *name)
-{
- if ((idx->state & CAMEL_INDEX_DELETED) == 0)
- return CI_CLASS(idx)->has_name(idx, name);
- else
- return FALSE;
-}
-
-CamelIndexName *
-camel_index_add_name(CamelIndex *idx, const char *name)
-{
- if ((idx->state & CAMEL_INDEX_DELETED) == 0)
- return CI_CLASS(idx)->add_name(idx, name);
- else
- return NULL;
-}
-
-int
-camel_index_write_name(CamelIndex *idx, CamelIndexName *idn)
-{
- if ((idx->state & CAMEL_INDEX_DELETED) == 0)
- return CI_CLASS(idx)->write_name(idx, idn);
- else {
- errno = ENOENT;
- return -1;
- }
-}
-
-CamelIndexCursor *
-camel_index_find_name(CamelIndex *idx, const char *name)
-{
- if ((idx->state & CAMEL_INDEX_DELETED) == 0)
- return CI_CLASS(idx)->find_name(idx, name);
- else
- return NULL;
-}
-
-void
-camel_index_delete_name(CamelIndex *idx, const char *name)
-{
- if ((idx->state & CAMEL_INDEX_DELETED) == 0)
- CI_CLASS(idx)->delete_name(idx, name);
-}
-
-CamelIndexCursor *
-camel_index_find(CamelIndex *idx, const char *word)
-{
- char *b = (char *)word;
- CamelIndexCursor *ret;
-
- if ((idx->state & CAMEL_INDEX_DELETED) != 0)
- return NULL;
-
- if (idx->normalise)
- b = idx->normalise(idx, word, idx->normalise_data);
-
- ret = CI_CLASS(idx)->find(idx, b);
-
- if (b != word)
- g_free(b);
-
- return ret;
-}
-
-CamelIndexCursor *
-camel_index_words(CamelIndex *idx)
-{
- if ((idx->state & CAMEL_INDEX_DELETED) == 0)
- return CI_CLASS(idx)->words(idx);
- else
- return NULL;
-}
-
-CamelIndexCursor *
-camel_index_names(CamelIndex *idx)
-{
- if ((idx->state & CAMEL_INDEX_DELETED) == 0)
- return CI_CLASS(idx)->names(idx);
- else
- return NULL;
-}
-
-/* ********************************************************************** */
-/* CamelIndexName */
-/* ********************************************************************** */
-
-static CamelObjectClass *camel_index_name_parent;
-
-#define CIN_CLASS(o) ((CamelIndexNameClass *)(((CamelObject *)o)->klass))
-
-static void
-camel_index_name_class_init(CamelIndexNameClass *klass)
-{
- camel_index_name_parent = CAMEL_OBJECT_CLASS(camel_type_get_global_classfuncs(camel_object_get_type()));
-}
-
-static void
-camel_index_name_init(CamelIndexName *idn)
-{
-}
-
-static void
-camel_index_name_finalise(CamelIndexName *idn)
-{
- if (idn->index)
- camel_object_unref((CamelObject *)idn->index);
-}
-
-CamelType
-camel_index_name_get_type(void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register(camel_object_get_type(), "CamelIndexName",
- sizeof (CamelIndexName),
- sizeof (CamelIndexNameClass),
- (CamelObjectClassInitFunc) camel_index_name_class_init,
- NULL,
- (CamelObjectInitFunc) camel_index_name_init,
- (CamelObjectFinalizeFunc) camel_index_name_finalise);
- }
-
- return type;
-}
-
-CamelIndexName *
-camel_index_name_new(CamelIndex *idx, const char *name)
-{
- CamelIndexName *idn = (CamelIndexName *)camel_object_new(camel_index_name_get_type());
-
- idn->index = idx;
- camel_object_ref((CamelObject *)idx);
-
- return idn;
-}
-
-void
-camel_index_name_add_word(CamelIndexName *idn, const char *word)
-{
- char *b = (char *)word;
-
- if (idn->index->normalise)
- b = idn->index->normalise(idn->index, word, idn->index->normalise_data);
-
- CIN_CLASS(idn)->add_word(idn, b);
-
- if (b != word)
- g_free(b);
-}
-
-size_t
-camel_index_name_add_buffer(CamelIndexName *idn, const char *buffer, size_t len)
-{
- return CIN_CLASS(idn)->add_buffer(idn, buffer, len);
-}
-
-/* ********************************************************************** */
-/* CamelIndexCursor */
-/* ********************************************************************** */
-
-static CamelObjectClass *camel_index_cursor_parent;
-
-#define CIC_CLASS(o) ((CamelIndexCursorClass *)(((CamelObject *)o)->klass))
-
-static void
-camel_index_cursor_class_init(CamelIndexCursorClass *klass)
-{
- camel_index_cursor_parent = CAMEL_OBJECT_CLASS(camel_type_get_global_classfuncs(camel_object_get_type()));
-}
-
-static void
-camel_index_cursor_init(CamelIndexCursor *idc)
-{
-}
-
-static void
-camel_index_cursor_finalise(CamelIndexCursor *idc)
-{
- if (idc->index)
- camel_object_unref((CamelObject *)idc->index);
-}
-
-CamelType
-camel_index_cursor_get_type(void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register(camel_object_get_type(), "CamelIndexCursor",
- sizeof (CamelIndexCursor),
- sizeof (CamelIndexCursorClass),
- (CamelObjectClassInitFunc) camel_index_cursor_class_init,
- NULL,
- (CamelObjectInitFunc) camel_index_cursor_init,
- (CamelObjectFinalizeFunc) camel_index_cursor_finalise);
- }
-
- return type;
-}
-
-CamelIndexCursor *
-camel_index_cursor_new(CamelIndex *idx, const char *name)
-{
- CamelIndexCursor *idc = (CamelIndexCursor *)camel_object_new(camel_index_cursor_get_type());
-
- idc->index = idx;
- camel_object_ref((CamelObject *)idx);
-
- return idc;
-}
-
-const char *
-camel_index_cursor_next(CamelIndexCursor *idc)
-{
- return CIC_CLASS(idc)->next(idc);
-}
-
-void
-camel_index_cursor_reset(CamelIndexCursor *idc)
-{
- CIC_CLASS(idc)->reset(idc);
-}
-
diff --git a/camel/camel-index.h b/camel/camel-index.h
deleted file mode 100644
index 0382dc1d0d..0000000000
--- a/camel/camel-index.h
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Copyright (C) 2001 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef _CAMEL_INDEX_H
-#define _CAMEL_INDEX_H
-
-#include <camel/camel-exception.h>
-#include <camel/camel-object.h>
-
-#define CAMEL_INDEX(obj) CAMEL_CHECK_CAST (obj, camel_index_get_type (), CamelIndex)
-#define CAMEL_INDEX_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_index_get_type (), CamelIndexClass)
-#define CAMEL_IS_INDEX(obj) CAMEL_CHECK_TYPE (obj, camel_index_get_type ())
-
-typedef struct _CamelIndex CamelIndex;
-typedef struct _CamelIndexClass CamelIndexClass;
-
-#define CAMEL_INDEX_NAME(obj) CAMEL_CHECK_CAST (obj, camel_index_name_get_type (), CamelIndexName)
-#define CAMEL_INDEX_NAME_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_index_name_get_type (), CamelIndexNameClass)
-#define CAMEL_IS_INDEX_NAME(obj) CAMEL_CHECK_TYPE (obj, camel_index_name_get_type ())
-
-typedef struct _CamelIndexName CamelIndexName;
-typedef struct _CamelIndexNameClass CamelIndexNameClass;
-
-#define CAMEL_INDEX_CURSOR(obj) CAMEL_CHECK_CAST (obj, camel_index_cursor_get_type (), CamelIndexCursor)
-#define CAMEL_INDEX_CURSOR_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_index_cursor_get_type (), CamelIndexCursorClass)
-#define CAMEL_IS_INDEX_CURSOR(obj) CAMEL_CHECK_TYPE (obj, camel_index_cursor_get_type ())
-
-typedef struct _CamelIndexCursor CamelIndexCursor;
-typedef struct _CamelIndexCursorClass CamelIndexCursorClass;
-
-typedef char * (*CamelIndexNorm)(CamelIndex *idx, const char *word, void *data);
-
-/* ********************************************************************** */
-
-struct _CamelIndexCursor {
- CamelObject parent;
-
- struct _CamelIndexCursorPrivate *priv;
-
- CamelIndex *index;
-};
-
-struct _CamelIndexCursorClass {
- CamelObjectClass parent;
-
- const char * (*next) (CamelIndexCursor *idc);
- void (*reset) (CamelIndexCursor *idc);
-};
-
-CamelType camel_index_cursor_get_type(void);
-
-CamelIndexCursor *camel_index_cursor_new(CamelIndex *idx, const char *name);
-
-const char *camel_index_cursor_next(CamelIndexCursor *idc);
-void camel_index_cursor_reset(CamelIndexCursor *idc);
-
-/* ********************************************************************** */
-
-struct _CamelIndexName {
- CamelObject parent;
-
- struct _CamelIndexNamePrivate *priv;
-
- CamelIndex *index;
-
- char *name; /* name being indexed */
-
- GByteArray *buffer; /* used for normalisation */
- GHashTable *words; /* unique list of words */
-};
-
-struct _CamelIndexNameClass {
- CamelObjectClass parent;
-
- int (*sync)(CamelIndexName *name);
- void (*add_word)(CamelIndexName *name, const char *word);
- size_t (*add_buffer)(CamelIndexName *name, const char *buffer, size_t len);
-};
-
-CamelType camel_index_name_get_type (void);
-
-CamelIndexName *camel_index_name_new(CamelIndex *idx, const char *name);
-
-void camel_index_name_add_word(CamelIndexName *name, const char *word);
-size_t camel_index_name_add_buffer(CamelIndexName *name, const char *buffer, size_t len);
-
-/* ********************************************************************** */
-
-struct _CamelIndex {
- CamelObject parent;
-
- struct _CamelIndexPrivate *priv;
-
- char *path;
- guint32 version;
- guint32 flags; /* open flags */
- guint32 state;
-
- CamelIndexNorm normalise;
- void *normalise_data;
-};
-
-struct _CamelIndexClass {
- CamelObjectClass parent_class;
-
- int (*sync)(CamelIndex *idx);
- int (*compress)(CamelIndex *idx);
- int (*delete)(CamelIndex *idx);
-
- int (*rename)(CamelIndex *idx, const char *path);
-
- int (*has_name)(CamelIndex *idx, const char *name);
- CamelIndexName * (*add_name)(CamelIndex *idx, const char *name);
- int (*write_name)(CamelIndex *idx, CamelIndexName *idn);
- CamelIndexCursor * (*find_name)(CamelIndex *idx, const char *name);
- void (*delete_name)(CamelIndex *idx, const char *name);
- CamelIndexCursor * (*find)(CamelIndex *idx, const char *word);
-
- CamelIndexCursor * (*words)(CamelIndex *idx);
- CamelIndexCursor * (*names)(CamelIndex *idx);
-};
-
-/* flags, stored in 'state', set with set_state */
-#define CAMEL_INDEX_DELETED (1<<0)
-
-CamelType camel_index_get_type (void);
-
-CamelIndex *camel_index_new(const char *path, int flags);
-void camel_index_construct(CamelIndex *, const char *path, int flags);
-int camel_index_rename(CamelIndex *, const char *path);
-
-void camel_index_set_normalise(CamelIndex *idx, CamelIndexNorm func, void *data);
-
-int camel_index_sync(CamelIndex *idx);
-int camel_index_compress(CamelIndex *idx);
-int camel_index_delete(CamelIndex *idx);
-
-int camel_index_has_name(CamelIndex *idx, const char *name);
-CamelIndexName *camel_index_add_name(CamelIndex *idx, const char *name);
-int camel_index_write_name(CamelIndex *idx, CamelIndexName *idn);
-CamelIndexCursor *camel_index_find_name(CamelIndex *idx, const char *name);
-void camel_index_delete_name(CamelIndex *idx, const char *name);
-CamelIndexCursor *camel_index_find(CamelIndex *idx, const char *word);
-
-CamelIndexCursor *camel_index_words(CamelIndex *idx);
-CamelIndexCursor *camel_index_names(CamelIndex *idx);
-
-#endif /* ! _CAMEL_INDEX_H */
diff --git a/camel/camel-internet-address.c b/camel/camel-internet-address.c
deleted file mode 100644
index 6a82393d8d..0000000000
--- a/camel/camel-internet-address.c
+++ /dev/null
@@ -1,551 +0,0 @@
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <stdio.h>
-#include <string.h>
-
-#include "camel-mime-utils.h"
-#include "camel-internet-address.h"
-
-#define d(x)
-
-static int internet_decode (CamelAddress *, const char *raw);
-static char * internet_encode (CamelAddress *);
-static int internet_unformat (CamelAddress *, const char *raw);
-static char * internet_format (CamelAddress *);
-static int internet_cat (CamelAddress *dest, const CamelAddress *source);
-static void internet_remove (CamelAddress *, int index);
-
-static void camel_internet_address_class_init (CamelInternetAddressClass *klass);
-static void camel_internet_address_init (CamelInternetAddress *obj);
-
-static CamelAddressClass *camel_internet_address_parent;
-
-struct _address {
- char *name;
- char *address;
-};
-
-static void
-camel_internet_address_class_init(CamelInternetAddressClass *klass)
-{
- CamelAddressClass *address = (CamelAddressClass *) klass;
-
- camel_internet_address_parent = CAMEL_ADDRESS_CLASS(camel_type_get_global_classfuncs(camel_address_get_type()));
-
- address->decode = internet_decode;
- address->encode = internet_encode;
- address->unformat = internet_unformat;
- address->format = internet_format;
- address->remove = internet_remove;
- address->cat = internet_cat;
-}
-
-static void
-camel_internet_address_init(CamelInternetAddress *obj)
-{
-}
-
-CamelType
-camel_internet_address_get_type(void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register(camel_address_get_type(), "CamelInternetAddress",
- sizeof (CamelInternetAddress),
- sizeof (CamelInternetAddressClass),
- (CamelObjectClassInitFunc) camel_internet_address_class_init,
- NULL,
- (CamelObjectInitFunc) camel_internet_address_init,
- NULL);
- }
-
- return type;
-}
-
-static int
-internet_decode (CamelAddress *a, const char *raw)
-{
- struct _camel_header_address *ha, *n;
- int count = a->addresses->len;
-
- /* Should probably use its own decoder or something */
- ha = camel_header_address_decode(raw, NULL);
- if (ha) {
- n = ha;
- while (n) {
- if (n->type == HEADER_ADDRESS_NAME) {
- camel_internet_address_add((CamelInternetAddress *)a, n->name, n->v.addr);
- } else if (n->type == HEADER_ADDRESS_GROUP) {
- struct _camel_header_address *g = n->v.members;
- while (g) {
- if (g->type == HEADER_ADDRESS_NAME)
- camel_internet_address_add((CamelInternetAddress *)a, g->name, g->v.addr);
- /* otherwise, it's an error, infact */
- g = g->next;
- }
- }
- n = n->next;
- }
- camel_header_address_list_clear(&ha);
- }
-
- return a->addresses->len - count;
-}
-
-static char *
-internet_encode (CamelAddress *a)
-{
- int i;
- GString *out;
- char *ret;
- int len = 6; /* "From: ", assume longer of the address headers */
-
- if (a->addresses->len == 0)
- return NULL;
-
- out = g_string_new("");
-
- for (i = 0;i < a->addresses->len; i++) {
- struct _address *addr = g_ptr_array_index(a->addresses, i);
- char *enc;
-
- if (i != 0)
- g_string_append(out, ", ");
-
- enc = camel_internet_address_encode_address(&len, addr->name, addr->address);
- g_string_append(out, enc);
- g_free(enc);
- }
-
- ret = out->str;
- g_string_free(out, FALSE);
-
- return ret;
-}
-
-static int
-internet_unformat(CamelAddress *a, const char *raw)
-{
- char *buffer, *p, *name, *addr;
- int c;
- int count = a->addresses->len;
-
- if (raw == NULL)
- return 0;
-
- d(printf("unformatting address: %s\n", raw));
-
- /* we copy, so we can modify as we go */
- buffer = g_strdup(raw);
-
- /* this can be simpler than decode, since there are much fewer rules */
- p = buffer;
- name = NULL;
- addr = p;
- do {
- c = (unsigned char)*p++;
- switch (c) {
- /* removes quotes, they should only be around the total name anyway */
- case '"':
- p[-1] = ' ';
- while (*p)
- if (*p == '"') {
- *p++ = ' ';
- break;
- } else {
- p++;
- }
- break;
- case '<':
- if (name == NULL)
- name = addr;
- addr = p;
- addr[-1] = 0;
- while (*p && *p != '>')
- p++;
- if (*p == 0)
- break;
- p++;
- /* falls through */
- case ',':
- p[-1] = 0;
- /* falls through */
- case 0:
- if (name)
- name = g_strstrip(name);
- addr = g_strstrip(addr);
- if (addr[0]) {
- d(printf("found address: '%s' <%s>\n", name, addr));
- camel_internet_address_add((CamelInternetAddress *)a, name, addr);
- }
- name = NULL;
- addr = p;
- break;
- }
- } while (c);
-
- g_free(buffer);
-
- return a->addresses->len - count;
-}
-
-static char *
-internet_format (CamelAddress *a)
-{
- int i;
- GString *out;
- char *ret;
-
- if (a->addresses->len == 0)
- return NULL;
-
- out = g_string_new("");
-
- for (i = 0;i < a->addresses->len; i++) {
- struct _address *addr = g_ptr_array_index(a->addresses, i);
- char *enc;
-
- if (i != 0)
- g_string_append(out, ", ");
-
- enc = camel_internet_address_format_address(addr->name, addr->address);
- g_string_append(out, enc);
- g_free(enc);
- }
-
- ret = out->str;
- g_string_free(out, FALSE);
-
- return ret;
-}
-
-static int
-internet_cat (CamelAddress *dest, const CamelAddress *source)
-{
- int i;
-
- g_assert(CAMEL_IS_INTERNET_ADDRESS(source));
-
- for (i=0;i<source->addresses->len;i++) {
- struct _address *addr = g_ptr_array_index(source->addresses, i);
- camel_internet_address_add((CamelInternetAddress *)dest, addr->name, addr->address);
- }
-
- return i;
-}
-
-static void
-internet_remove (CamelAddress *a, int index)
-{
- struct _address *addr;
-
- if (index < 0 || index >= a->addresses->len)
- return;
-
- addr = g_ptr_array_index(a->addresses, index);
- g_free(addr->name);
- g_free(addr->address);
- g_free(addr);
- g_ptr_array_remove_index(a->addresses, index);
-}
-
-/**
- * camel_internet_address_new:
- *
- * Create a new CamelInternetAddress object.
- *
- * Return value: A new CamelInternetAddress object.
- **/
-CamelInternetAddress *
-camel_internet_address_new (void)
-{
- CamelInternetAddress *new = CAMEL_INTERNET_ADDRESS(camel_object_new(camel_internet_address_get_type()));
- return new;
-}
-
-/**
- * camel_internet_address_add:
- * @a: internet address object
- * @name:
- * @address:
- *
- * Add a new internet address to the address object.
- *
- * Return value: Index of added entry.
- **/
-int
-camel_internet_address_add (CamelInternetAddress *a, const char *name, const char *address)
-{
- struct _address *new;
- int index;
-
- g_assert(CAMEL_IS_INTERNET_ADDRESS(a));
-
- new = g_malloc(sizeof(*new));
- new->name = g_strdup(name);
- new->address = g_strdup(address);
- index = ((CamelAddress *)a)->addresses->len;
- g_ptr_array_add(((CamelAddress *)a)->addresses, new);
-
- return index;
-}
-
-/**
- * camel_internet_address_get:
- * @a: internet address object
- * @index: address's array index
- * @namep: Holder for the returned name, or NULL, if not required.
- * @addressp: Holder for the returned address, or NULL, if not required.
- *
- * Get the address at @index.
- *
- * Return value: TRUE if such an address exists, or FALSE otherwise.
- **/
-gboolean
-camel_internet_address_get (const CamelInternetAddress *a, int index, const char **namep, const char **addressp)
-{
- struct _address *addr;
-
- g_assert(CAMEL_IS_INTERNET_ADDRESS(a));
-
- if (index < 0 || index >= ((CamelAddress *)a)->addresses->len)
- return FALSE;
-
- addr = g_ptr_array_index( ((CamelAddress *)a)->addresses, index);
- if (namep)
- *namep = addr->name;
- if (addressp)
- *addressp = addr->address;
- return TRUE;
-}
-
-/**
- * camel_internet_address_find_name:
- * @a:
- * @name:
- * @addressp: Holder for address part, or NULL, if not required.
- *
- * Find address by real name.
- *
- * Return value: The index of the address matching the name, or -1
- * if no match was found.
- **/
-int
-camel_internet_address_find_name(CamelInternetAddress *a, const char *name, const char **addressp)
-{
- struct _address *addr;
- int i, len;
-
- g_assert(CAMEL_IS_INTERNET_ADDRESS(a));
-
- len = ((CamelAddress *)a)->addresses->len;
- for (i=0;i<len;i++) {
- addr = g_ptr_array_index( ((CamelAddress *)a)->addresses, i );
- if (!strcmp(addr->name, name)) {
- if (addressp)
- *addressp = addr->address;
- return i;
- }
- }
- return -1;
-}
-
-/**
- * camel_internet_address_find_address:
- * @a:
- * @address:
- * @namep: Return for the matching name, or NULL, if not required.
- *
- * Find an address by address.
- *
- * Return value: The index of the address, or -1 if not found.
- **/
-int
-camel_internet_address_find_address(CamelInternetAddress *a, const char *address, const char **namep)
-{
- struct _address *addr;
- int i, len;
-
- g_assert(CAMEL_IS_INTERNET_ADDRESS(a));
-
- len = ((CamelAddress *)a)->addresses->len;
- for (i=0;i<len;i++) {
- addr = g_ptr_array_index( ((CamelAddress *)a)->addresses, i );
- if (!strcmp(addr->address, address)) {
- if (namep)
- *namep = addr->name;
- return i;
- }
- }
- return -1;
-}
-
-static void
-cia_encode_addrspec(GString *out, const char *addr)
-{
- const char *at, *p;
-
- at = strchr(addr, '@');
- if (at == NULL)
- goto append;
-
- p = addr;
- while (p < at) {
- char c = *p++;
-
- /* strictly by rfc, we should split local parts on dots.
- however i think 2822 changes this, and not many clients grok it, so
- just quote the whole local part if need be */
- if (!(camel_mime_is_atom(c) || c=='.')) {
- g_string_append_c(out, '"');
-
- p = addr;
- while (p < at) {
- c = *p++;
- if (c == '"' || c == '\\')
- g_string_append_c(out, '\\');
- g_string_append_c(out, c);
- }
- g_string_append_c(out, '"');
- g_string_append(out, p);
-
- return;
- }
- }
-
-append:
- g_string_append(out, addr);
-}
-
-/**
- * camel_internet_address_encode_address:
- * @len: The encoded length so far, of this line
- * @name:
- * @addr:
- *
- * Encode a single address ready for internet usage. Header folding
- * as per rfc 822 is also performed, based on the length *@inlen. If @inlen
- * is NULL, then no folding will occur.
- *
- * Return value: The encoded address.
- **/
-char *
-camel_internet_address_encode_address(int *inlen, const char *real, const char *addr)
-{
- char *name = camel_header_encode_phrase(real);
- char *ret = NULL;
- int len = 0;
- GString *out = g_string_new("");
-
- g_assert(addr);
-
- if (inlen != NULL)
- len = *inlen;
-
- if (name && name[0]) {
- if (inlen != NULL && (strlen(name) + len) > CAMEL_FOLD_SIZE) {
- char *folded = camel_header_address_fold(name, len);
- char *last;
- g_string_append(out, folded);
- g_free(folded);
- last = strrchr(out->str, '\n');
- if (last)
- len = last-(out->str+out->len);
- else
- len = out->len;
- } else {
- g_string_append(out, name);
- len += strlen(name);
- }
- }
-
- /* NOTE: Strictly speaking, we could and should split the
- * internal address up if we need to, on atom or specials
- * boundaries - however, to aid interoperability with mailers
- * that will probably not handle this case, we will just move
- * the whole address to its own line. */
- if (inlen != NULL && (strlen(addr) + len) > CAMEL_FOLD_SIZE) {
- g_string_append(out, "\n\t");
- len = 1;
- }
-
- len -= out->len;
-
- if (name && name[0])
- g_string_append_printf(out, " <");
- cia_encode_addrspec(out, addr);
- if (name && name[0])
- g_string_append_printf(out, ">");
-
- len += out->len;
-
- if (inlen != NULL)
- *inlen = len;
-
- g_free(name);
-
- ret = out->str;
- g_string_free(out, FALSE);
-
- return ret;
-}
-
-/**
- * camel_internet_address_format_address:
- * @name: A name, quotes may be stripped from it.
- * @addr: Assumes a valid rfc822 email address.
- *
- * Function to format a single address, suitable for display.
- *
- * Return value:
- **/
-char *
-camel_internet_address_format_address(const char *name, const char *addr)
-{
- char *ret = NULL;
-
- g_assert(addr);
-
- if (name && name[0]) {
- const char *p = name;
- char *o, c;
-
- while ((c = *p++)) {
- if (c == '\"' || c == ',') {
- o = ret = g_malloc(strlen(name)+3+strlen(addr)+3 + 1);
- p = name;
- *o++ = '\"';
- while ((c = *p++))
- if (c != '\"')
- *o++ = c;
- *o++ = '\"';
- sprintf(o, " <%s>", addr);
- d(printf("encoded '%s' => '%s'\n", name, ret));
- return ret;
- }
- }
- ret = g_strdup_printf("%s <%s>", name, addr);
- } else
- ret = g_strdup(addr);
-
- return ret;
-}
diff --git a/camel/camel-internet-address.h b/camel/camel-internet-address.h
deleted file mode 100644
index 9bfa0f44c2..0000000000
--- a/camel/camel-internet-address.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef _CAMEL_INTERNET_ADDRESS_H
-#define _CAMEL_INTERNET_ADDRESS_H
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <camel/camel-address.h>
-
-#define CAMEL_INTERNET_ADDRESS(obj) CAMEL_CHECK_CAST (obj, camel_internet_address_get_type (), CamelInternetAddress)
-#define CAMEL_INTERNET_ADDRESS_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_internet_address_get_type (), CamelInternetAddressClass)
-#define CAMEL_IS_INTERNET_ADDRESS(obj) CAMEL_CHECK_TYPE (obj, camel_internet_address_get_type ())
-
-typedef struct _CamelInternetAddressClass CamelInternetAddressClass;
-
-struct _CamelInternetAddress {
- CamelAddress parent;
-
- struct _CamelInternetAddressPrivate *priv;
-};
-
-struct _CamelInternetAddressClass {
- CamelAddressClass parent_class;
-};
-
-CamelType camel_internet_address_get_type (void);
-CamelInternetAddress *camel_internet_address_new (void);
-
-int camel_internet_address_add (CamelInternetAddress *, const char *, const char *);
-gboolean camel_internet_address_get (const CamelInternetAddress *, int, const char **, const char **);
-
-int camel_internet_address_find_name(CamelInternetAddress *, const char *, const char **);
-int camel_internet_address_find_address(CamelInternetAddress *, const char *, const char **);
-
-/* utility functions, for network/display formatting */
-char * camel_internet_address_encode_address(int *len, const char *name, const char *addr);
-char * camel_internet_address_format_address(const char *real, const char *addr);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* ! _CAMEL_INTERNET_ADDRESS_H */
diff --git a/camel/camel-junk-plugin.c b/camel/camel-junk-plugin.c
deleted file mode 100644
index a203b45c3e..0000000000
--- a/camel/camel-junk-plugin.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Author:
- * Radek Doulik <rodo@ximian.com>
- *
- * Copyright 2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#include <stdio.h>
-#include <glib.h>
-#include <camel/camel-junk-plugin.h>
-#include <camel/camel-mime-message.h>
-
-#define d(x) x
-
-const char *
-camel_junk_plugin_get_name (CamelJunkPlugin *csp)
-{
- g_return_val_if_fail (csp->get_name != NULL, NULL);
-
- d(fprintf (stderr, "camel_junk_plugin_get_namen");)
-
- return (*csp->get_name) ();
-}
-
-int
-camel_junk_plugin_check_junk (CamelJunkPlugin *csp, CamelMimeMessage *message)
-{
- g_return_val_if_fail (csp->check_junk != NULL, FALSE);
-
- d(fprintf (stderr, "camel_junk_plugin_check_junk\n");)
-
- return (*csp->check_junk) (message);
-}
-
-void
-camel_junk_plugin_report_junk (CamelJunkPlugin *csp, CamelMimeMessage *message)
-{
- d(fprintf (stderr, "camel_junk_plugin_report_junk\n");)
-
- if (csp->report_junk)
- (*csp->report_junk) (message);
-}
-
-void
-camel_junk_plugin_report_notjunk (CamelJunkPlugin *csp, CamelMimeMessage *message)
-{
- d(fprintf (stderr, "camel_junk_plugin_report_notjunk\n");)
-
- if (csp->report_notjunk)
- (*csp->report_notjunk) (message);
-}
-
-void
-camel_junk_plugin_commit_reports (CamelJunkPlugin *csp)
-{
- d(fprintf (stderr, "camel_junk_plugin_commit_reports\n");)
-
- if (csp->commit_reports)
- (*csp->commit_reports) ();
-}
diff --git a/camel/camel-junk-plugin.h b/camel/camel-junk-plugin.h
deleted file mode 100644
index 79d1bf6331..0000000000
--- a/camel/camel-junk-plugin.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Author:
- * Radek Doulik <rodo@ximian.com>
- *
- * Copyright 2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifndef _CAMEL_JUNK_PLUGIN_H
-#define _CAMEL_JUNK_PLUGIN_H
-
-#define CAMEL_JUNK_PLUGIN(x) ((CamelJunkPlugin *) x)
-
-typedef struct _CamelJunkPlugin CamelJunkPlugin;
-struct _CamelMimeMessage;
-
-struct _CamelJunkPlugin
-{
- /* junk filter human readable name, translated */
- const char * (*get_name) (void);
-
- /* should be set to 1 */
- int api_version;
-
- /* when called, it should return TRUE if message is identified as junk,
- FALSE otherwise */
- int (*check_junk) (struct _CamelMimeMessage *message);
-
- /* called when user identified a message to be junk */
- void (*report_junk) (struct _CamelMimeMessage *message);
-
- /* called when user identified a message not to be junk */
- void (*report_notjunk) (struct _CamelMimeMessage *message);
-
- /* called after one or more junk/ham(s) reported */
- void (*commit_reports) (void);
-};
-
-const char * camel_junk_plugin_get_name (CamelJunkPlugin *csp);
-int camel_junk_plugin_check_junk (CamelJunkPlugin *csp, struct _CamelMimeMessage *message);
-void camel_junk_plugin_report_junk (CamelJunkPlugin *csp, struct _CamelMimeMessage *message);
-void camel_junk_plugin_report_notjunk (CamelJunkPlugin *csp, struct _CamelMimeMessage *message);
-void camel_junk_plugin_commit_reports (CamelJunkPlugin *csp);
-
-#endif
diff --git a/camel/camel-lock-client.c b/camel/camel-lock-client.c
deleted file mode 100644
index fb245d1eca..0000000000
--- a/camel/camel-lock-client.c
+++ /dev/null
@@ -1,321 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Copyright (C) 2001-2003 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <pthread.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-
-#include "camel-exception.h"
-#include "camel-lock-helper.h"
-#include "camel-lock-client.h"
-
-#define d(x)
-
-/* dunno where this fucking thing is got from */
-/* see also camel-lock.c */
-#define _(x) (x)
-
-static pthread_mutex_t lock_lock = PTHREAD_MUTEX_INITIALIZER;
-#define LOCK() pthread_mutex_lock(&lock_lock)
-#define UNLOCK() pthread_mutex_unlock(&lock_lock)
-
-static int lock_sequence;
-static int lock_helper_pid = -1;
-static int lock_stdin_pipe[2], lock_stdout_pipe[2];
-
-static int read_n(int fd, void *buffer, int inlen)
-{
- char *p = buffer;
- int len, left = inlen;
-
- do {
- len = read(fd, p, left);
- if (len == -1) {
- if (errno != EINTR)
- return -1;
- } else {
- left -= len;
- p += len;
- }
- } while (left > 0 && len != 0);
-
- return inlen - left;
-}
-
-static int write_n(int fd, void *buffer, int inlen)
-{
- char *p = buffer;
- int len, left = inlen;
-
- do {
- len = write(fd, p, left);
- if (len == -1) {
- if (errno != EINTR)
- return -1;
- } else {
- left -= len;
- p += len;
- }
- } while (left > 0);
-
- return inlen;
-}
-
-static int camel_lock_helper_init(CamelException *ex)
-{
- int i;
-
- if (pipe(lock_stdin_pipe) == -1
- || pipe(lock_stdout_pipe) == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Cannot build locking helper pipe: %s"),
- g_strerror (errno));
- return -1;
- }
-
- lock_helper_pid = fork();
- switch(lock_helper_pid) {
- case -1:
- close(lock_stdin_pipe[0]);
- close(lock_stdin_pipe[1]);
- close(lock_stdout_pipe[0]);
- close(lock_stdout_pipe[1]);
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Cannot fork locking helper: %s"),
- g_strerror (errno));
- return -1;
- case 0:
- close(STDIN_FILENO);
- dup(lock_stdin_pipe[0]);
- close(STDOUT_FILENO);
- dup(lock_stdout_pipe[1]);
- close(lock_stdin_pipe[0]);
- close(lock_stdin_pipe[1]);
- close(lock_stdout_pipe[0]);
- close(lock_stdout_pipe[1]);
- for (i=3;i<255;i++)
- close(i);
- execl(CAMEL_LIBEXECDIR "/camel-lock-helper", "camel-lock-helper", NULL);
- d(fprintf(stderr, "shit, couldn't exec lock helper!\n"));
- /* it'll pick this up when it tries to use us */
- exit(255);
- default:
- close(lock_stdin_pipe[0]);
- close(lock_stdout_pipe[1]);
-
- /* so the child knows when we vanish */
- fcntl(lock_stdin_pipe[1], F_SETFD, FD_CLOEXEC);
- fcntl(lock_stdout_pipe[0], F_SETFD, FD_CLOEXEC);
- }
-
- return 0;
-}
-
-int camel_lock_helper_lock(const char *path, CamelException *ex)
-{
- struct _CamelLockHelperMsg *msg;
- int len = strlen(path);
- int res = -1;
- int retry = 3;
-
- LOCK();
-
- if (lock_helper_pid == -1) {
- if (camel_lock_helper_init(ex) == -1) {
- UNLOCK();
- return -1;
- }
- }
-
- msg = alloca(len + sizeof(*msg));
-again:
- msg->magic = CAMEL_LOCK_HELPER_MAGIC;
- msg->seq = lock_sequence;
- msg->id = CAMEL_LOCK_HELPER_LOCK;
- msg->data = len;
- memcpy(msg+1, path, len);
-
- write_n(lock_stdin_pipe[1], msg, len+sizeof(*msg));
-
- do {
- /* should also have a timeout here? cancellation? */
- len = read_n(lock_stdout_pipe[0], msg, sizeof(*msg));
- if (len == 0) {
- /* child quit, do we try ressurect it? */
- res = CAMEL_LOCK_HELPER_STATUS_PROTOCOL;
- /* if the child exited, this should get it, waidpid returns 0 if the child hasn't */
- if (waitpid(lock_helper_pid, NULL, WNOHANG) > 0) {
- lock_helper_pid = -1;
- close(lock_stdout_pipe[0]);
- close(lock_stdin_pipe[1]);
- lock_stdout_pipe[0] = -1;
- lock_stdin_pipe[1] = -1;
- }
- goto fail;
- }
-
- if (msg->magic != CAMEL_LOCK_HELPER_RETURN_MAGIC
- || msg->seq > lock_sequence) {
- res = CAMEL_LOCK_HELPER_STATUS_PROTOCOL;
- d(printf("lock child protocol error\n"));
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not lock '%s': protocol error with lock-helper"), path);
- goto fail;
- }
- } while (msg->seq < lock_sequence);
-
- if (msg->seq == lock_sequence) {
- switch(msg->id) {
- case CAMEL_LOCK_HELPER_STATUS_OK:
- d(printf("lock child locked ok, id is %d\n", msg->data));
- res = msg->data;
- break;
- default:
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not lock '%s'"), path);
- d(printf("locking failed ! status = %d\n", msg->id));
- break;
- }
- } else if (retry > 0) {
- d(printf("sequence failure, lost message? retry?\n"));
- retry--;
- goto again;
- } else {
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not lock '%s': protocol error with lock-helper"), path);
- }
-
-fail:
- lock_sequence++;
-
- UNLOCK();
-
- return res;
-}
-
-int camel_lock_helper_unlock(int lockid)
-{
- struct _CamelLockHelperMsg *msg;
- int res = -1;
- int retry = 3;
- int len;
-
- d(printf("unlocking lock id %d\n", lockid));
-
- LOCK();
-
- /* impossible to unlock if we haven't locked yet */
- if (lock_helper_pid == -1) {
- UNLOCK();
- return -1;
- }
-
- msg = alloca(sizeof(*msg));
-again:
- msg->magic = CAMEL_LOCK_HELPER_MAGIC;
- msg->seq = lock_sequence;
- msg->id = CAMEL_LOCK_HELPER_UNLOCK;
- msg->data = lockid;
-
- write_n(lock_stdin_pipe[1], msg, sizeof(*msg));
-
- do {
- /* should also have a timeout here? cancellation? */
- len = read_n(lock_stdout_pipe[0], msg, sizeof(*msg));
- if (len == 0) {
- /* child quit, do we try ressurect it? */
- res = CAMEL_LOCK_HELPER_STATUS_PROTOCOL;
- if (waitpid(lock_helper_pid, NULL, WNOHANG) > 0) {
- lock_helper_pid = -1;
- close(lock_stdout_pipe[0]);
- close(lock_stdin_pipe[1]);
- lock_stdout_pipe[0] = -1;
- lock_stdin_pipe[1] = -1;
- }
- goto fail;
- }
-
- if (msg->magic != CAMEL_LOCK_HELPER_RETURN_MAGIC
- || msg->seq > lock_sequence) {
- goto fail;
- }
- } while (msg->seq < lock_sequence);
-
- if (msg->seq == lock_sequence) {
- switch(msg->id) {
- case CAMEL_LOCK_HELPER_STATUS_OK:
- d(printf("lock child unlocked ok\n"));
- res = 0;
- break;
- default:
- d(printf("locking failed ! \n"));
- break;
- }
- } else if (retry > 0) {
- d(printf("sequence failure, lost message? retry?\n"));
- lock_sequence++;
- retry--;
- goto again;
- }
-
-fail:
- lock_sequence++;
-
- UNLOCK();
-
- return res;
-}
-
-#if 0
-int main(int argc, char **argv)
-{
- int id1, id2;
-
- d(printf("locking started\n"));
- camel_lock_helper_init();
-
- id1 = camel_lock_helper_lock("1 path 1");
- if (id1 != -1) {
- d(printf("lock ok, unlock\n"));
- camel_lock_helper_unlock(id1);
- }
-
- id1 = camel_lock_helper_lock("2 path 1");
- id2 = camel_lock_helper_lock("2 path 2");
- camel_lock_helper_unlock(id2);
- camel_lock_helper_unlock(id1);
-
- id1 = camel_lock_helper_lock("3 path 1");
- id2 = camel_lock_helper_lock("3 path 2");
- camel_lock_helper_unlock(id1);
-}
-#endif
diff --git a/camel/camel-lock-client.h b/camel/camel-lock-client.h
deleted file mode 100644
index fc45e1d127..0000000000
--- a/camel/camel-lock-client.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Author: Michael Zucchi <notzed@ximian.com>
- *
- * Copyright (C) 2001 Ximian Inc (www.ximian.com/)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-/* defines protocol for lock helper process ipc */
-
-#ifndef _CAMEL_LOCK_CLIENT_H
-#define _CAMEL_LOCK_CLIENT_H
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include <camel/camel-exception.h>
-
-int camel_lock_helper_lock(const char *path , CamelException *ex);
-int camel_lock_helper_unlock(int lockid);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* !_CAMEL_LOCK_HELPER_H */
diff --git a/camel/camel-lock-helper.c b/camel/camel-lock-helper.c
deleted file mode 100644
index 9e5dc012a3..0000000000
--- a/camel/camel-lock-helper.c
+++ /dev/null
@@ -1,390 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Copyright (C) 2001 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-/* lock helper process */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <errno.h>
-
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#include <signal.h>
-
-#include <unistd.h>
-#include <fcntl.h>
-#include <utime.h>
-
-#include <time.h>
-
-#include <string.h>
-
-#define SETEUID_SAVES (1)
-
-/* we try and include as little as possible */
-
-#include "camel-lock-helper.h"
-#include "camel-lock.h"
-
-#define d(x)
-
-/* keeps track of open locks */
-struct _lock_info {
- struct _lock_info *next;
- uid_t uid;
- int id;
- int depth;
- time_t stamp; /* when last updated */
- char path[1];
-};
-
-static int lock_id = 0;
-static struct _lock_info *lock_info_list;
-static uid_t lock_root_uid = -1;
-static uid_t lock_real_uid = -1;
-
-/* utility functions */
-
-static int read_n(int fd, void *buffer, int inlen)
-{
- char *p = buffer;
- int len, left = inlen;
-
- do {
- len = read(fd, p, left);
- if (len == -1) {
- if (errno != EINTR)
- return -1;
- } else {
- left -= len;
- p += len;
- }
- } while (left > 0 && len != 0);
-
- return inlen - left;
-}
-
-static int write_n(int fd, void *buffer, int inlen)
-{
- char *p = buffer;
- int len, left = inlen;
-
- do {
- len = write(fd, p, left);
- if (len == -1) {
- if (errno != EINTR)
- return -1;
- } else {
- left -= len;
- p += len;
- }
- } while (left > 0);
-
- return inlen;
-}
-
-void
-camel_exception_setv (CamelException *ex, ExceptionId id, const char *format, ...)
-{
- ;
-}
-
-void
-camel_exception_clear (CamelException *exception)
-{
- ;
-}
-
-char *gettext (const char *msgid);
-
-char *
-gettext (const char *msgid)
-{
- return NULL;
-}
-
-static int lock_path(const char *path, guint32 *lockid)
-{
- struct _lock_info *info = NULL;
- int res = CAMEL_LOCK_HELPER_STATUS_OK;
- struct stat st;
-
- d(fprintf(stderr, "locking path '%s' id = %d\n", path, lock_id));
-
- /* check to see if we have it locked already, make the lock 'recursive' */
- /* we could also error i suppose, but why bother */
- info = lock_info_list;
- while (info) {
- if (!strcmp(info->path, path)) {
- info->depth++;
- return CAMEL_LOCK_HELPER_STATUS_OK;
- }
- info = info->next;
- }
-
- /* check we are allowed to lock it, we must own it, be able to write to it, and it has to exist */
- if (stat(path, &st) == -1
- || st.st_uid != getuid()
- || !S_ISREG(st.st_mode)
- || (st.st_mode & 0400) == 0) {
- return CAMEL_LOCK_HELPER_STATUS_INVALID;
- }
-
- info = malloc(sizeof(*info) + strlen(path));
- if (info == NULL) {
- res = CAMEL_LOCK_HELPER_STATUS_NOMEM;
- goto fail;
- }
-
- /* we try the real uid first, and if that fails, try the 'root id' */
- if (camel_lock_dot(path, NULL) == -1) {
-#ifdef SETEUID_SAVES
- if (lock_real_uid != lock_root_uid) {
- if (seteuid(lock_root_uid) != -1) {
- if (camel_lock_dot(path, NULL) == -1) {
- seteuid(lock_real_uid);
- res = CAMEL_LOCK_HELPER_STATUS_SYSTEM;
- goto fail;
- }
- seteuid(lock_real_uid);
- } else {
- res = CAMEL_LOCK_HELPER_STATUS_SYSTEM;
- goto fail;
- }
- } else {
- res = CAMEL_LOCK_HELPER_STATUS_SYSTEM;
- goto fail;
- }
-#else
- res = CAMEL_LOCK_HELPER_STATUS_SYSTEM;
- goto fail;
-#endif
- } else {
- info->uid = lock_real_uid;
- }
-
- strcpy(info->path, path);
- info->id = lock_id;
- info->depth = 1;
- info->next = lock_info_list;
- info->stamp = time(0);
- lock_info_list = info;
-
- if (lockid)
- *lockid = lock_id;
-
- lock_id++;
-
- d(fprintf(stderr, "lock ok\n"));
-
- return res;
-fail:
- d(fprintf(stderr, "lock failed\n"));
-
- if (info)
- free(info);
-
- return res;
-}
-
-static int unlock_id(guint32 lockid)
-{
- struct _lock_info *info, *p;
-
- d(fprintf(stderr, "unlocking id '%d'\n", lockid));
-
- p = (struct _lock_info *)&lock_info_list;
- info = p->next;
- while (info) {
- if (info->id == lockid) {
- d(fprintf(stderr, "found id %d path '%s'\n", lockid, info->path));
- info->depth--;
- if (info->depth <= 0) {
-#ifdef SETEUID_SAVES
- if (info->uid != lock_real_uid) {
- seteuid(lock_root_uid);
- camel_unlock_dot(info->path);
- seteuid(lock_real_uid);
- } else
-#endif
- camel_unlock_dot(info->path);
-
- p->next = info->next;
- free(info);
- }
-
- return CAMEL_LOCK_HELPER_STATUS_OK;
- }
- p = info;
- info = info->next;
- }
-
- d(fprintf(stderr, "unknown id asked to be unlocked %d\n", lockid));
- return CAMEL_LOCK_HELPER_STATUS_PROTOCOL;
-}
-
-static void lock_touch(const char *path)
-{
- char *name;
-
- /* we could also check that we haven't had our lock stolen from us here */
-
- name = alloca(strlen(path) + 10);
- sprintf(name, "%s.lock", path);
-
- d(fprintf(stderr, "Updating lock %s\n", name));
- utime(name, NULL);
-}
-
-static void setup_process(void)
-{
- struct sigaction sa;
- sigset_t sigset;
-
- /* ignore sigint/sigio */
- sa.sa_handler = SIG_IGN;
- sigemptyset (&sa.sa_mask);
- sa.sa_flags = 0;
-
- sigemptyset(&sigset);
- sigaddset(&sigset, SIGIO);
- sigaddset(&sigset, SIGINT);
- sigprocmask(SIG_UNBLOCK, &sigset, NULL);
-
- sigaction (SIGIO, &sa, NULL);
- sigaction (SIGINT, &sa, NULL);
-
- /* FIXME: add more sanity checks/setup here */
-
-#ifdef SETEUID_SAVES
- /* here we change to the real user id, this is probably not particularly
- portable so may need configure checks */
- lock_real_uid = getuid();
- lock_root_uid = geteuid();
- if (lock_real_uid != lock_root_uid)
- seteuid(lock_real_uid);
-#endif
-}
-
-int main(int argc, char **argv)
-{
- struct _CamelLockHelperMsg msg;
- int len;
- int res;
- char *path;
- fd_set rset;
- struct timeval tv;
- struct _lock_info *info;
-
- setup_process();
-
- do {
- /* do a poll/etc, so we can refresh the .locks as required ... */
- FD_ZERO(&rset);
- FD_SET(STDIN_FILENO, &rset);
-
- /* check the minimum timeout we need to refresh the next oldest lock */
- if (lock_info_list) {
- time_t now = time(0);
- time_t left;
- time_t delay = CAMEL_DOT_LOCK_REFRESH;
-
- info = lock_info_list;
- while (info) {
- left = CAMEL_DOT_LOCK_REFRESH - (now - info->stamp);
- left = MAX(left, 0);
- delay = MIN(left, delay);
- info = info->next;
- }
-
- tv.tv_sec = delay;
- tv.tv_usec = 0;
- }
-
- d(fprintf(stderr, "lock helper waiting for input\n"));
- if (select(STDIN_FILENO+1, &rset, NULL, NULL, lock_info_list?&tv:NULL) == -1) {
- if (errno == EINTR)
- break;
-
- continue;
- }
-
- /* did we get a timeout? scan for any locks that need updating */
- if (!FD_ISSET(STDIN_FILENO, &rset)) {
- time_t now = time(0);
- time_t left;
-
- d(fprintf(stderr, "Got a timeout, checking locks\n"));
-
- info = lock_info_list;
- while (info) {
- left = (now - info->stamp);
- if (left >= CAMEL_DOT_LOCK_REFRESH) {
- lock_touch(info->path);
- info->stamp = now;
- }
- info = info->next;
- }
-
- continue;
- }
-
-
- len = read_n(STDIN_FILENO, &msg, sizeof(msg));
- if (len == 0)
- break;
-
- res = CAMEL_LOCK_HELPER_STATUS_PROTOCOL;
- if (len == sizeof(msg) && msg.magic == CAMEL_LOCK_HELPER_MAGIC) {
- switch(msg.id) {
- case CAMEL_LOCK_HELPER_LOCK:
- res = CAMEL_LOCK_HELPER_STATUS_NOMEM;
- path = malloc(msg.data+1);
- if (path != NULL) {
- res = CAMEL_LOCK_HELPER_STATUS_PROTOCOL;
- len = read_n(STDIN_FILENO, path, msg.data);
- if (len == msg.data) {
- path[len] = 0;
- res = lock_path(path, &msg.data);
- }
- free(path);
- }
- break;
- case CAMEL_LOCK_HELPER_UNLOCK:
- res = unlock_id(msg.data);
- break;
- }
- }
- d(fprintf(stderr, "returning result %d\n", res));
- msg.id = res;
- msg.magic = CAMEL_LOCK_HELPER_RETURN_MAGIC;
- write_n(STDOUT_FILENO, &msg, sizeof(msg));
- } while (1);
-
- d(fprintf(stderr, "parent exited, clsoing down remaining id's\n"));
- while (lock_info_list)
- unlock_id(lock_info_list->id);
-
- return 0;
-}
diff --git a/camel/camel-lock-helper.h b/camel/camel-lock-helper.h
deleted file mode 100644
index c61a097642..0000000000
--- a/camel/camel-lock-helper.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Author: Michael Zucchi <notzed@ximian.com>
- *
- * Copyright (C) 1999 Ximian (www.ximian.com/).
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-/* defines protocol for lock helper process ipc */
-
-#ifndef _CAMEL_LOCK_HELPER_H
-#define _CAMEL_LOCK_HELPER_H
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include <glib.h>
-
-struct _CamelLockHelperMsg {
- guint32 magic;
- guint32 seq;
- guint32 id;
- guint32 data;
-};
-
-/* magic values */
-enum {
- CAMEL_LOCK_HELPER_MAGIC = 0xABADF00D,
- CAMEL_LOCK_HELPER_RETURN_MAGIC = 0xDEADBEEF
-};
-
-/* return status */
-enum {
- CAMEL_LOCK_HELPER_STATUS_OK = 0,
- CAMEL_LOCK_HELPER_STATUS_PROTOCOL,
- CAMEL_LOCK_HELPER_STATUS_NOMEM,
- CAMEL_LOCK_HELPER_STATUS_SYSTEM,
- CAMEL_LOCK_HELPER_STATUS_INVALID, /* not allowed to lock/doesn't exist etc */
-};
-
-/* commands */
-enum {
- CAMEL_LOCK_HELPER_LOCK = 0xf0f,
- CAMEL_LOCK_HELPER_UNLOCK = 0xf0f0,
-};
-
-/* seconds between lock refreshes */
-#define CAMEL_DOT_LOCK_REFRESH (30)
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* !_CAMEL_LOCK_HELPER_H */
diff --git a/camel/camel-lock.c b/camel/camel-lock.c
deleted file mode 100644
index dd52daa882..0000000000
--- a/camel/camel-lock.c
+++ /dev/null
@@ -1,425 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Author: Michael Zucchi <notzed@ximian.com>
- *
- * Copyright (C) 1999 Ximian (www.ximian.com/).
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <sys/stat.h>
-#include <unistd.h>
-#include <errno.h>
-#ifdef HAVE_ALLOCA_H
-#include <alloca.h>
-#endif
-#include <time.h>
-
-#ifdef USE_DOT
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#endif
-
-#ifdef USE_FCNTL
-#include <unistd.h>
-#include <fcntl.h>
-#endif
-
-#ifdef USE_FLOCK
-#include <sys/file.h>
-#endif
-
-#include <glib.h>
-
-#include "camel-lock.h"
-#include "camel-i18n.h"
-
-#define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))*/
-
-/**
- * camel_lock_dot:
- * @path:
- * @ex:
- *
- * Create an exclusive lock using .lock semantics.
- * All locks are equivalent to write locks (exclusive).
- *
- * Return value: -1 on error, sets @ex appropriately.
- **/
-int
-camel_lock_dot(const char *path, CamelException *ex)
-{
-#ifdef USE_DOT
- char *locktmp, *lock;
- int retry = 0;
- int fdtmp;
- struct stat st;
-
- /* TODO: Is there a reliable way to refresh the lock, if we're still busy with it?
- Does it matter? We will normally also use fcntl too ... */
-
- /* use alloca, save cleaning up afterwards */
- lock = alloca(strlen(path) + strlen(".lock") + 1);
- sprintf(lock, "%s.lock", path);
- locktmp = alloca(strlen(path) + strlen("XXXXXX") + 1);
-
-#ifndef HAVE_MKSTEMP
- sprintf(locktmp, "%sXXXXXX", path);
- if (mktemp(locktmp) == NULL) {
- /* well, this is really only a programatic error */
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not create lock file for %s: %s"),
- path, g_strerror (errno));
- return -1;
- }
-#endif
-
- while (retry < CAMEL_LOCK_DOT_RETRY) {
-
- d(printf("trying to lock '%s', attempt %d\n", lock, retry));
-
- if (retry > 0)
- sleep(CAMEL_LOCK_DOT_DELAY);
-
-#ifdef HAVE_MKSTEMP
- sprintf(locktmp, "%sXXXXXX", path);
- fdtmp = mkstemp(locktmp);
-#else
- fdtmp = open(locktmp, O_RDWR|O_CREAT|O_EXCL, 0600);
-#endif
- if (fdtmp == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not create lock file for %s: %s"),
- path, g_strerror (errno));
- return -1;
- }
- close(fdtmp);
-
- /* apparently return code from link can be unreliable for nfs (see link(2)), so we ignore it */
- link(locktmp, lock);
-
- /* but we check stat instead (again, see link(2)) */
- if (stat(locktmp, &st) == -1) {
- d(printf("Our lock file %s vanished!?\n", locktmp));
-
- /* well that was unexpected, try cleanup/retry */
- unlink(locktmp);
- unlink(lock);
- } else {
- d(printf("tmp lock created, link count is %d\n", st.st_nlink));
-
- unlink(locktmp);
-
- /* if we had 2 links, we have created the .lock, return ok, otherwise we need to keep trying */
- if (st.st_nlink == 2)
- return 0;
- }
-
- /* check for stale lock, kill it */
- if (stat(lock, &st) == 0) {
- time_t now = time(0);
- (printf("There is an existing lock %ld seconds old\n", now-st.st_ctime));
- if (st.st_ctime < now - CAMEL_LOCK_DOT_STALE) {
- d(printf("Removing it now\n"));
- unlink(lock);
- }
- }
-
- retry++;
- }
-
- d(printf("failed to get lock after %d retries\n", retry));
-
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, _("Timed out trying to get lock file on %s. Try again later."), path);
- return -1;
-#else /* ! USE_DOT */
- return 0;
-#endif
-}
-
-/**
- * camel_unlock_dot:
- * @path:
- *
- * Attempt to unlock a .lock lock.
- **/
-void
-camel_unlock_dot(const char *path)
-{
-#ifdef USE_DOT
- char *lock;
-
- lock = alloca(strlen(path) + strlen(".lock") + 1);
- sprintf(lock, "%s.lock", path);
- d(printf("unlocking %s\n", lock));
- (void)unlink(lock);
-#endif
-}
-
-/**
- * camel_lock_fcntl:
- * @fd:
- * @type:
- * @ex:
- *
- * Create a lock using fcntl(2).
- *
- * @type is CAMEL_LOCK_WRITE or CAMEL_LOCK_READ,
- * to create exclusive or shared read locks
- *
- * Return value: -1 on error.
- **/
-int
-camel_lock_fcntl(int fd, CamelLockType type, CamelException *ex)
-{
-#ifdef USE_FCNTL
- struct flock lock;
-
- d(printf("fcntl locking %d\n", fd));
-
- memset(&lock, 0, sizeof(lock));
- lock.l_type = type==CAMEL_LOCK_READ?F_RDLCK:F_WRLCK;
- if (fcntl(fd, F_SETLK, &lock) == -1) {
- /* If we get a 'locking not vailable' type error,
- we assume the filesystem doesn't support fcntl() locking */
- /* this is somewhat system-dependent */
- if (errno != EINVAL && errno != ENOLCK) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Failed to get lock using fcntl(2): %s"),
- g_strerror (errno));
- return -1;
- } else {
- static int failed = 0;
-
- if (failed == 0)
- fprintf(stderr, "fcntl(2) locking appears not to work on this filesystem");
- failed++;
- }
- }
-#endif
- return 0;
-}
-
-/**
- * camel_unlock_fcntl:
- * @fd:
- *
- * Unlock an fcntl lock.
- **/
-void
-camel_unlock_fcntl(int fd)
-{
-#ifdef USE_FCNTL
- struct flock lock;
-
- d(printf("fcntl unlocking %d\n", fd));
-
- memset(&lock, 0, sizeof(lock));
- lock.l_type = F_UNLCK;
- fcntl(fd, F_SETLK, &lock);
-#endif
-}
-
-/**
- * camel_lock_flock:
- * @fd:
- * @type:
- * @ex:
- *
- * Create a lock using flock(2).
- *
- * @type is CAMEL_LOCK_WRITE or CAMEL_LOCK_READ,
- * to create exclusive or shared read locks
- *
- * Return value: -1 on error.
- **/
-int
-camel_lock_flock(int fd, CamelLockType type, CamelException *ex)
-{
-#ifdef USE_FLOCK
- int op;
-
- d(printf("flock locking %d\n", fd));
-
- if (type == CAMEL_LOCK_READ)
- op = LOCK_SH|LOCK_NB;
- else
- op = LOCK_EX|LOCK_NB;
-
- if (flock(fd, op) == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Failed to get lock using flock(2): %s"),
- g_strerror (errno));
- return -1;
- }
-#endif
- return 0;
-}
-
-/**
- * camel_unlock_flock:
- * @fd:
- *
- * Unlock an flock lock.
- **/
-void
-camel_unlock_flock(int fd)
-{
-#ifdef USE_FLOCK
- d(printf("flock unlocking %d\n", fd));
-
- (void)flock(fd, LOCK_UN);
-#endif
-}
-
-/**
- * camel_lock_folder:
- * @path: Path to the file to lock (used for .locking only).
- * @fd: Open file descriptor of the right type to lock.
- * @type: Type of lock, CAMEL_LOCK_READ or CAMEL_LOCK_WRITE.
- * @ex:
- *
- * Attempt to lock a folder, multiple attempts will be made using all
- * locking strategies available.
- *
- * Return value: -1 on error, @ex will describe the locking system that failed.
- **/
-int
-camel_lock_folder(const char *path, int fd, CamelLockType type, CamelException *ex)
-{
- int retry = 0;
-
- while (retry < CAMEL_LOCK_RETRY) {
- if (retry > 0)
- sleep(CAMEL_LOCK_DELAY);
-
- camel_exception_clear(ex);
-
- if (camel_lock_fcntl(fd, type, ex) == 0) {
- if (camel_lock_flock(fd, type, ex) == 0) {
- if (camel_lock_dot(path, ex) == 0)
- return 0;
- camel_unlock_flock(fd);
- }
- camel_unlock_fcntl(fd);
- }
- retry++;
- }
-
- return -1;
-}
-
-/**
- * camel_unlock_folder:
- * @path: Filename of folder.
- * @fd: Open descrptor on which locks were placed.
- *
- * Free a lock on a folder.
- **/
-void
-camel_unlock_folder(const char *path, int fd)
-{
- camel_unlock_dot(path);
- camel_unlock_flock(fd);
- camel_unlock_fcntl(fd);
-}
-
-#if 0
-int main(int argc, char **argv)
-{
- CamelException *ex;
- int fd1, fd2;
-
- ex = camel_exception_new();
-
-#if 0
- if (camel_lock_dot("mylock", ex) == 0) {
- if (camel_lock_dot("mylock", ex) == 0) {
- printf("Got lock twice?\n");
- } else {
- printf("failed to get lock 2: %s\n", camel_exception_get_description(ex));
- }
- camel_unlock_dot("mylock");
- } else {
- printf("failed to get lock 1: %s\n", camel_exception_get_description(ex));
- }
-
- camel_exception_clear(ex);
-#endif
-
- fd1 = open("mylock", O_RDWR);
- fd2 = open("mylock", O_RDWR);
-
- if (camel_lock_fcntl(fd1, CAMEL_LOCK_WRITE, ex) == 0) {
- printf("got fcntl write lock once\n");
- sleep(5);
- if (camel_lock_fcntl(fd2, CAMEL_LOCK_WRITE, ex) == 0) {
- printf("got fcntl write lock twice!\n");
- } else {
- printf("failed to get write lock: %s\n", camel_exception_get_description(ex));
- }
-
- camel_exception_clear(ex);
-
- if (camel_lock_fcntl(fd2, CAMEL_LOCK_READ, ex) == 0) {
- printf("got fcntl read lock as well?\n");
- camel_unlock_fcntl(fd2);
- } else {
- printf("failed to get read lock: %s\n", camel_exception_get_description(ex));
- }
-
- camel_exception_clear(ex);
- camel_unlock_fcntl(fd1);
- } else {
- printf("failed to get write lock at all: %s\n", camel_exception_get_description(ex));
- }
-
- if (camel_lock_fcntl(fd1, CAMEL_LOCK_READ, ex) == 0) {
- printf("got fcntl read lock once\n");
- sleep(5);
- if (camel_lock_fcntl(fd2, CAMEL_LOCK_WRITE, ex) == 0) {
- printf("got fcntl write lock too?!\n");
- } else {
- printf("failed to get write lock: %s\n", camel_exception_get_description(ex));
- }
-
- camel_exception_clear(ex);
-
- if (camel_lock_fcntl(fd2, CAMEL_LOCK_READ, ex) == 0) {
- printf("got fcntl read lock twice\n");
- camel_unlock_fcntl(fd2);
- } else {
- printf("failed to get read lock: %s\n", camel_exception_get_description(ex));
- }
-
- camel_exception_clear(ex);
- camel_unlock_fcntl(fd1);
- }
-
- close(fd1);
- close(fd2);
-
- return 0;
-}
-#endif
diff --git a/camel/camel-lock.h b/camel/camel-lock.h
deleted file mode 100644
index d54f7ed071..0000000000
--- a/camel/camel-lock.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Author: Michael Zucchi <notzed@ximian.com>
- *
- * Copyright (C) 1999 Ximian (www.ximian.com/).
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifndef _CAMEL_LOCK_H
-#define _CAMEL_LOCK_H
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include <camel/camel-exception.h>
-
-/* for .lock locking, retry, delay and stale counts */
-#define CAMEL_LOCK_DOT_RETRY (5) /* number of times to retry lock */
-#define CAMEL_LOCK_DOT_DELAY (2) /* delay between locking retries */
-#define CAMEL_LOCK_DOT_STALE (60) /* seconds before a lock becomes stale */
-
-/* for locking folders, retry/interretry delay */
-#define CAMEL_LOCK_RETRY (5) /* number of times to retry lock */
-#define CAMEL_LOCK_DELAY (2) /* delay between locking retries */
-
-typedef enum {
- CAMEL_LOCK_READ,
- CAMEL_LOCK_WRITE,
-} CamelLockType;
-
-/* specific locking strategies */
-int camel_lock_dot(const char *path, CamelException *ex);
-int camel_lock_fcntl(int fd, CamelLockType type, CamelException *ex);
-int camel_lock_flock(int fd, CamelLockType type, CamelException *ex);
-
-void camel_unlock_dot(const char *path);
-void camel_unlock_fcntl(int fd);
-void camel_unlock_flock(int fd);
-
-/* lock a folder in a standard way */
-int camel_lock_folder(const char *path, int fd, CamelLockType type, CamelException *ex);
-void camel_unlock_folder(const char *path, int fd);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* !_CAMEL_LOCK_H */
diff --git a/camel/camel-medium.c b/camel/camel-medium.c
deleted file mode 100644
index 6a89682a2c..0000000000
--- a/camel/camel-medium.c
+++ /dev/null
@@ -1,332 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/* camelMedium.c : Abstract class for a medium
- *
- * Authors: Bertrand Guiheneuf <bertrand@helixcode.com>
- * Michael Zucchi <notzed@ximian.com>
- *
- * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <ctype.h>
-
-#include "camel-medium.h"
-
-#define d(x)
-
-static CamelDataWrapperClass *parent_class = NULL;
-
-/* Returns the class for a CamelMedium */
-#define CM_CLASS(so) CAMEL_MEDIUM_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-
-static gboolean is_offline (CamelDataWrapper *data_wrapper);
-static void add_header (CamelMedium *medium, const char *name,
- const void *value);
-static void set_header (CamelMedium *medium, const char *name, const void *value);
-static void remove_header (CamelMedium *medium, const char *name);
-static const void *get_header (CamelMedium *medium, const char *name);
-
-static GArray *get_headers (CamelMedium *medium);
-static void free_headers (CamelMedium *medium, GArray *headers);
-
-static CamelDataWrapper *get_content_object (CamelMedium *medium);
-static void set_content_object (CamelMedium *medium,
- CamelDataWrapper *content);
-
-static void
-camel_medium_class_init (CamelMediumClass *camel_medium_class)
-{
- CamelDataWrapperClass *camel_data_wrapper_class =
- CAMEL_DATA_WRAPPER_CLASS (camel_medium_class);
-
- parent_class = CAMEL_DATA_WRAPPER_CLASS (camel_type_get_global_classfuncs (camel_data_wrapper_get_type ()));
-
- /* virtual method overload */
- camel_data_wrapper_class->is_offline = is_offline;
-
- /* virtual method definition */
- camel_medium_class->add_header = add_header;
- camel_medium_class->set_header = set_header;
- camel_medium_class->remove_header = remove_header;
- camel_medium_class->get_header = get_header;
-
- camel_medium_class->get_headers = get_headers;
- camel_medium_class->free_headers = free_headers;
-
- camel_medium_class->set_content_object = set_content_object;
- camel_medium_class->get_content_object = get_content_object;
-}
-
-static void
-camel_medium_init (gpointer object, gpointer klass)
-{
- CamelMedium *camel_medium = CAMEL_MEDIUM (object);
-
- camel_medium->content = NULL;
-}
-
-static void
-camel_medium_finalize (CamelObject *object)
-{
- CamelMedium *medium = CAMEL_MEDIUM (object);
-
- if (medium->content)
- camel_object_unref (medium->content);
-}
-
-
-CamelType
-camel_medium_get_type (void)
-{
- static CamelType camel_medium_type = CAMEL_INVALID_TYPE;
-
- if (camel_medium_type == CAMEL_INVALID_TYPE) {
- camel_medium_type = camel_type_register (CAMEL_DATA_WRAPPER_TYPE, "medium",
- sizeof (CamelMedium),
- sizeof (CamelMediumClass),
- (CamelObjectClassInitFunc) camel_medium_class_init,
- NULL,
- (CamelObjectInitFunc) camel_medium_init,
- (CamelObjectFinalizeFunc) camel_medium_finalize);
- }
-
- return camel_medium_type;
-}
-
-static gboolean
-is_offline (CamelDataWrapper *data_wrapper)
-{
- return parent_class->is_offline (data_wrapper) ||
- camel_data_wrapper_is_offline (CAMEL_MEDIUM (data_wrapper)->content);
-}
-
-static void
-add_header (CamelMedium *medium, const char *name, const void *value)
-{
- g_warning("No %s::add_header implemented, adding %s", camel_type_to_name(CAMEL_OBJECT_GET_TYPE(medium)), name);
-}
-
-/**
- * camel_medium_add_header:
- * @medium: a CamelMedium
- * @name: name of the header
- * @value: value of the header
- *
- * Adds a header to a medium.
- *
- * FIXME: Where does it add it? We need to be able to prepend and
- * append headers, and also be able to insert them relative to other
- * headers. No we dont, order isn't important! Z
- **/
-void
-camel_medium_add_header (CamelMedium *medium, const char *name, const void *value)
-{
- g_return_if_fail (CAMEL_IS_MEDIUM (medium));
- g_return_if_fail (name != NULL);
- g_return_if_fail (value != NULL);
-
- CM_CLASS (medium)->add_header(medium, name, value);
-}
-
-static void
-set_header (CamelMedium *medium, const char *name, const void *value)
-{
- g_warning("No %s::set_header implemented, setting %s", camel_type_to_name(CAMEL_OBJECT_GET_TYPE(medium)), name);
-}
-
-/**
- * camel_medium_set_header:
- * @medium: a CamelMedium
- * @name: name of the header
- * @value: value of the header
- *
- * Sets the value of a header. Any other occurances of the header
- * will be removed. Setting a %NULL header can be used to remove
- * the header also.
- **/
-void
-camel_medium_set_header (CamelMedium *medium, const char *name, const void *value)
-{
- g_return_if_fail (CAMEL_IS_MEDIUM (medium));
- g_return_if_fail (name != NULL);
-
- if (value == NULL)
- CM_CLASS(medium)->remove_header(medium, name);
- else
- CM_CLASS(medium)->set_header(medium, name, value);
-}
-
-static void
-remove_header(CamelMedium *medium, const char *name)
-{
- g_warning("No %s::remove_header implemented, removing %s", camel_type_to_name(CAMEL_OBJECT_GET_TYPE(medium)), name);
-}
-
-/**
- * camel_medium_remove_header:
- * @medium: a medium
- * @name: the name of the header
- *
- * Removes the named header from the medium. All occurances of the
- * header are removed.
- **/
-void
-camel_medium_remove_header(CamelMedium *medium, const char *name)
-{
- g_return_if_fail (CAMEL_IS_MEDIUM (medium));
- g_return_if_fail (name != NULL);
-
- CM_CLASS(medium)->remove_header(medium, name);
-}
-
-
-static const void *
-get_header(CamelMedium *medium, const char *name)
-{
- g_warning("No %s::get_header implemented, getting %s", camel_type_to_name(CAMEL_OBJECT_GET_TYPE(medium)), name);
- return NULL;
-}
-
-/**
- * camel_medium_get_header:
- * @medium: a medium
- * @name: the name of the header
- *
- * Returns the value of the named header in the medium, or %NULL if
- * it is unset. The caller should not modify or free the data.
- *
- * If the header occurs more than once, only retrieve the first
- * instance of the header. For multi-occuring headers, use
- * :get_headers().
- *
- * Return value: the value of the named header, or %NULL
- **/
-const void *
-camel_medium_get_header(CamelMedium *medium, const char *name)
-{
- g_return_val_if_fail (CAMEL_IS_MEDIUM (medium), NULL);
- g_return_val_if_fail (name != NULL, NULL);
-
- return CM_CLASS (medium)->get_header (medium, name);
-}
-
-
-static GArray *
-get_headers(CamelMedium *medium)
-{
- g_warning("No %s::get_headers implemented", camel_type_to_name(CAMEL_OBJECT_GET_TYPE(medium)));
- return NULL;
-}
-
-/**
- * camel_medium_get_headers:
- * @medium: a medium
- *
- * Returns an array of all header name/value pairs (as
- * CamelMediumHeader structures). The values will be decoded
- * to UTF-8 for any headers that are recognized by Camel. The
- * caller should not modify the returned data.
- *
- * Return value: the array of headers, which must be freed with
- * camel_medium_free_headers().
- **/
-GArray *
-camel_medium_get_headers(CamelMedium *medium)
-{
- g_return_val_if_fail (CAMEL_IS_MEDIUM (medium), NULL);
-
- return CM_CLASS (medium)->get_headers (medium);
-}
-
-static void
-free_headers (CamelMedium *medium, GArray *headers)
-{
- g_warning("No %s::free_headers implemented", camel_type_to_name(CAMEL_OBJECT_GET_TYPE(medium)));
-}
-
-/**
- * camel_medium_free_headers:
- * @medium: a medium
- * @headers: an array of headers returned from camel_medium_get_headers()
- *
- * Frees @headers
- **/
-void
-camel_medium_free_headers (CamelMedium *medium, GArray *headers)
-{
- g_return_if_fail (CAMEL_IS_MEDIUM (medium));
- g_return_if_fail (headers != NULL);
-
- CM_CLASS (medium)->free_headers (medium, headers);
-}
-
-
-static CamelDataWrapper *
-get_content_object(CamelMedium *medium)
-{
- return medium->content;
-}
-
-/**
- * camel_medium_get_content_object:
- * @medium: a medium
- *
- * Returns a data wrapper that represents the content of the medium,
- * without its headers.
- *
- * Return value: the medium's content object.
- **/
-CamelDataWrapper *
-camel_medium_get_content_object (CamelMedium *medium)
-{
- g_return_val_if_fail (CAMEL_IS_MEDIUM (medium), NULL);
-
- return CM_CLASS (medium)->get_content_object (medium);
-}
-
-
-static void
-set_content_object (CamelMedium *medium, CamelDataWrapper *content)
-{
- if (medium->content)
- camel_object_unref (medium->content);
- camel_object_ref (content);
- medium->content = content;
-}
-
-/**
- * camel_medium_set_content_object:
- * @medium: a medium
- * @content: a data wrapper representing the medium's content
- *
- * Sets the content of @medium to be @content.
- **/
-void
-camel_medium_set_content_object (CamelMedium *medium,
- CamelDataWrapper *content)
-{
- g_return_if_fail (CAMEL_IS_MEDIUM (medium));
- g_return_if_fail (CAMEL_IS_DATA_WRAPPER (content));
-
- CM_CLASS (medium)->set_content_object (medium, content);
-}
diff --git a/camel/camel-medium.h b/camel/camel-medium.h
deleted file mode 100644
index 7b01eae39f..0000000000
--- a/camel/camel-medium.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-medium.h : class for a medium object */
-
-/*
- *
- * Authors: Bertrand Guiheneuf <bertrand@helixcode.com>
- * Michael Zucchi <notzed@ximian.com>
- *
- * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifndef CAMEL_MEDIUM_H
-#define CAMEL_MEDIUM_H 1
-
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <camel/camel-data-wrapper.h>
-
-#define CAMEL_MEDIUM_TYPE (camel_medium_get_type ())
-#define CAMEL_MEDIUM(obj) (CAMEL_CHECK_CAST((obj), CAMEL_MEDIUM_TYPE, CamelMedium))
-#define CAMEL_MEDIUM_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_MEDIUM_TYPE, CamelMediumClass))
-#define CAMEL_IS_MEDIUM(o) (CAMEL_CHECK_TYPE((o), CAMEL_MEDIUM_TYPE))
-
-
-typedef struct {
- const char *name;
- const char *value;
-} CamelMediumHeader;
-
-struct _CamelMedium {
- CamelDataWrapper parent_object;
-
- /* The content of the medium, as opposed to our parent
- * CamelDataWrapper, which wraps both the headers and the
- * content.
- */
- CamelDataWrapper *content;
-};
-
-typedef struct {
- CamelDataWrapperClass parent_class;
-
- /* Virtual methods */
- void (*add_header) (CamelMedium *medium, const char *name, const void *value);
- void (*set_header) (CamelMedium *medium, const char *name, const void *value);
- void (*remove_header) (CamelMedium *medium, const char *name);
- const void * (*get_header) (CamelMedium *medium, const char *name);
-
- GArray * (*get_headers) (CamelMedium *medium);
- void (*free_headers) (CamelMedium *medium, GArray *headers);
-
- CamelDataWrapper * (*get_content_object) (CamelMedium *medium);
- void (*set_content_object) (CamelMedium *medium, CamelDataWrapper *content);
-} CamelMediumClass;
-
-/* Standard Camel function */
-CamelType camel_medium_get_type (void);
-
-/* Header get/set interface */
-void camel_medium_add_header (CamelMedium *medium, const char *name, const void *value);
-void camel_medium_set_header (CamelMedium *medium, const char *name, const void *value);
-void camel_medium_remove_header (CamelMedium *medium, const char *name);
-const void *camel_medium_get_header (CamelMedium *medium, const char *name);
-
-GArray *camel_medium_get_headers (CamelMedium *medium);
-void camel_medium_free_headers (CamelMedium *medium, GArray *headers);
-
-/* accessor methods */
-CamelDataWrapper *camel_medium_get_content_object (CamelMedium *medium);
-void camel_medium_set_content_object (CamelMedium *medium,
- CamelDataWrapper *content);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_MEDIUM_H */
-
diff --git a/camel/camel-mime-filter-basic.c b/camel/camel-mime-filter-basic.c
deleted file mode 100644
index d99d465443..0000000000
--- a/camel/camel-mime-filter-basic.c
+++ /dev/null
@@ -1,291 +0,0 @@
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- * Jeffrey Stedfast <fejj@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include "camel-mime-filter-basic.h"
-
-#include "camel-mime-utils.h"
-#include <string.h>
-
-static void reset(CamelMimeFilter *mf);
-static void complete(CamelMimeFilter *mf, char *in, size_t len,
- size_t prespace, char **out,
- size_t *outlen, size_t *outprespace);
-static void filter(CamelMimeFilter *mf, char *in, size_t len,
- size_t prespace, char **out,
- size_t *outlen, size_t *outprespace);
-
-static void camel_mime_filter_basic_class_init (CamelMimeFilterBasicClass *klass);
-static void camel_mime_filter_basic_init (CamelMimeFilterBasic *obj);
-
-static CamelMimeFilterClass *camel_mime_filter_basic_parent;
-
-static void
-camel_mime_filter_basic_class_init (CamelMimeFilterBasicClass *klass)
-{
- CamelMimeFilterClass *filter_class = (CamelMimeFilterClass *) klass;
-
- camel_mime_filter_basic_parent = CAMEL_MIME_FILTER_CLASS(camel_type_get_global_classfuncs (camel_mime_filter_get_type ()));
-
- filter_class->reset = reset;
- filter_class->filter = filter;
- filter_class->complete = complete;
-}
-
-static void
-camel_mime_filter_basic_init (CamelMimeFilterBasic *obj)
-{
- obj->state = 0;
- obj->save = 0;
-}
-
-
-CamelType
-camel_mime_filter_basic_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_mime_filter_get_type (), "CamelMimeFilterBasic",
- sizeof (CamelMimeFilterBasic),
- sizeof (CamelMimeFilterBasicClass),
- (CamelObjectClassInitFunc) camel_mime_filter_basic_class_init,
- NULL,
- (CamelObjectInitFunc) camel_mime_filter_basic_init,
- NULL);
- }
-
- return type;
-}
-
-/* should this 'flush' outstanding state/data bytes? */
-static void
-reset(CamelMimeFilter *mf)
-{
- CamelMimeFilterBasic *f = (CamelMimeFilterBasic *)mf;
-
- switch(f->type) {
- case CAMEL_MIME_FILTER_BASIC_QP_ENC:
- f->state = -1;
- break;
- default:
- f->state = 0;
- }
- f->save = 0;
-}
-
-static void
-complete(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, size_t *outlen, size_t *outprespace)
-{
- CamelMimeFilterBasic *f = (CamelMimeFilterBasic *)mf;
- size_t newlen;
-
- switch(f->type) {
- case CAMEL_MIME_FILTER_BASIC_BASE64_ENC:
- /* wont go to more than 2x size (overly conservative) */
- camel_mime_filter_set_size(mf, len*2+6, FALSE);
- newlen = camel_base64_encode_close(in, len, TRUE, mf->outbuf, &f->state, &f->save);
- g_assert(newlen <= len*2+6);
- break;
- case CAMEL_MIME_FILTER_BASIC_QP_ENC:
- /* *4 is definetly more than needed ... */
- camel_mime_filter_set_size(mf, len*4+4, FALSE);
- newlen = camel_quoted_decode_close(in, len, mf->outbuf, &f->state, &f->save);
- g_assert(newlen <= len*4+4);
- break;
- case CAMEL_MIME_FILTER_BASIC_UU_ENC:
- /* won't go to more than 2 * (x + 2) + 62 */
- camel_mime_filter_set_size (mf, (len + 2) * 2 + 62, FALSE);
- newlen = camel_uuencode_close (in, len, mf->outbuf, f->uubuf, &f->state, &f->save);
- g_assert (newlen <= (len + 2) * 2 + 62);
- break;
- case CAMEL_MIME_FILTER_BASIC_BASE64_DEC:
- /* output can't possibly exceed the input size */
- camel_mime_filter_set_size(mf, len, FALSE);
- newlen = camel_base64_decode_step(in, len, mf->outbuf, &f->state, &f->save);
- g_assert(newlen <= len);
- break;
- case CAMEL_MIME_FILTER_BASIC_QP_DEC:
- /* output can't possibly exceed the input size, well unless its not really qp, then +2 max */
- camel_mime_filter_set_size(mf, len+2, FALSE);
- newlen = camel_quoted_decode_step(in, len, mf->outbuf, &f->state, &f->save);
- g_assert(newlen <= len+2);
- break;
- case CAMEL_MIME_FILTER_BASIC_UU_DEC:
- if ((f->state & CAMEL_UUDECODE_STATE_BEGIN) && !(f->state & CAMEL_UUDECODE_STATE_END)) {
- /* "begin <mode> <filename>\n" has been found, so we can now start decoding */
- camel_mime_filter_set_size (mf, len + 3, FALSE);
- newlen = camel_uudecode_step (in, len, mf->outbuf, &f->state, &f->save);
- } else {
- newlen = 0;
- }
- break;
- default:
- g_warning("unknown type %d in CamelMimeFilterBasic", f->type);
- goto donothing;
- }
-
- *out = mf->outbuf;
- *outlen = newlen;
- *outprespace = mf->outpre;
-
- return;
-donothing:
- *out = in;
- *outlen = len;
- *outprespace = prespace;
-}
-
-/* here we do all of the basic mime filtering */
-static void
-filter(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, size_t *outlen, size_t *outprespace)
-{
- CamelMimeFilterBasic *f = (CamelMimeFilterBasic *)mf;
- size_t newlen;
-
- switch(f->type) {
- case CAMEL_MIME_FILTER_BASIC_BASE64_ENC:
- /* wont go to more than 2x size (overly conservative) */
- camel_mime_filter_set_size(mf, len*2+6, FALSE);
- newlen = camel_base64_encode_step(in, len, TRUE, mf->outbuf, &f->state, &f->save);
- g_assert(newlen <= len*2+6);
- break;
- case CAMEL_MIME_FILTER_BASIC_QP_ENC:
- /* *4 is overly conservative, but will do */
- camel_mime_filter_set_size(mf, len*4+4, FALSE);
- newlen = camel_quoted_encode_step(in, len, mf->outbuf, &f->state, &f->save);
- g_assert(newlen <= len*4+4);
- break;
- case CAMEL_MIME_FILTER_BASIC_UU_ENC:
- /* won't go to more than 2 * (x + 2) + 62 */
- camel_mime_filter_set_size (mf, (len + 2) * 2 + 62, FALSE);
- newlen = camel_uuencode_step (in, len, mf->outbuf, f->uubuf, &f->state, &f->save);
- g_assert (newlen <= (len + 2) * 2 + 62);
- break;
- case CAMEL_MIME_FILTER_BASIC_BASE64_DEC:
- /* output can't possibly exceed the input size */
- camel_mime_filter_set_size(mf, len+3, FALSE);
- newlen = camel_base64_decode_step(in, len, mf->outbuf, &f->state, &f->save);
- g_assert(newlen <= len+3);
- break;
- case CAMEL_MIME_FILTER_BASIC_QP_DEC:
- /* output can't possibly exceed the input size */
- camel_mime_filter_set_size(mf, len + 2, FALSE);
- newlen = camel_quoted_decode_step(in, len, mf->outbuf, &f->state, &f->save);
- g_assert(newlen <= len + 2);
- break;
- case CAMEL_MIME_FILTER_BASIC_UU_DEC:
- if (!(f->state & CAMEL_UUDECODE_STATE_BEGIN)) {
- register char *inptr, *inend;
- size_t left;
-
- inptr = in;
- inend = inptr + len;
-
- while (inptr < inend) {
- left = inend - inptr;
- if (left < 6) {
- if (!strncmp (inptr, "begin ", left))
- camel_mime_filter_backup (mf, inptr, left);
- break;
- } else if (!strncmp (inptr, "begin ", 6)) {
- for (in = inptr; inptr < inend && *inptr != '\n'; inptr++);
- if (inptr < inend) {
- inptr++;
- f->state |= CAMEL_UUDECODE_STATE_BEGIN;
- /* we can start uudecoding... */
- in = inptr;
- len = inend - in;
- } else {
- camel_mime_filter_backup (mf, in, left);
- }
- break;
- }
-
- /* go to the next line */
- for ( ; inptr < inend && *inptr != '\n'; inptr++);
-
- if (inptr < inend)
- inptr++;
- }
- }
-
- if ((f->state & CAMEL_UUDECODE_STATE_BEGIN) && !(f->state & CAMEL_UUDECODE_STATE_END)) {
- /* "begin <mode> <filename>\n" has been found, so we can now start decoding */
- camel_mime_filter_set_size (mf, len + 3, FALSE);
- newlen = camel_uudecode_step (in, len, mf->outbuf, &f->state, &f->save);
- } else {
- newlen = 0;
- }
- break;
- default:
- g_warning("unknown type %d in CamelMimeFilterBasic", f->type);
- goto donothing;
- }
-
- *out = mf->outbuf;
- *outlen = newlen;
- *outprespace = mf->outpre;
-
- return;
-donothing:
- *out = in;
- *outlen = len;
- *outprespace = prespace;
-}
-
-/**
- * camel_mime_filter_basic_new:
- *
- * Create a new CamelMimeFilterBasic object.
- *
- * Return value: A new CamelMimeFilterBasic widget.
- **/
-CamelMimeFilterBasic *
-camel_mime_filter_basic_new (void)
-{
- CamelMimeFilterBasic *new = CAMEL_MIME_FILTER_BASIC ( camel_object_new (camel_mime_filter_basic_get_type ()));
- return new;
-}
-
-CamelMimeFilterBasic *
-camel_mime_filter_basic_new_type(CamelMimeFilterBasicType type)
-{
- CamelMimeFilterBasic *new;
-
- switch (type) {
- case CAMEL_MIME_FILTER_BASIC_BASE64_ENC:
- case CAMEL_MIME_FILTER_BASIC_QP_ENC:
- case CAMEL_MIME_FILTER_BASIC_BASE64_DEC:
- case CAMEL_MIME_FILTER_BASIC_QP_DEC:
- case CAMEL_MIME_FILTER_BASIC_UU_ENC:
- case CAMEL_MIME_FILTER_BASIC_UU_DEC:
- new = camel_mime_filter_basic_new();
- new->type = type;
- break;
- default:
- g_warning("Invalid type of CamelMimeFilterBasic requested: %d", type);
- new = NULL;
- break;
- }
- camel_mime_filter_reset((CamelMimeFilter *)new);
- return new;
-}
-
diff --git a/camel/camel-mime-filter-basic.h b/camel/camel-mime-filter-basic.h
deleted file mode 100644
index f380f5e7a4..0000000000
--- a/camel/camel-mime-filter-basic.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2000-2003 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef _CAMEL_MIME_FILTER_BASIC_H
-#define _CAMEL_MIME_FILTER_BASIC_H
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <camel/camel-mime-filter.h>
-
-#define CAMEL_MIME_FILTER_BASIC(obj) CAMEL_CHECK_CAST (obj, camel_mime_filter_basic_get_type (), CamelMimeFilterBasic)
-#define CAMEL_MIME_FILTER_BASIC_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_mime_filter_basic_get_type (), CamelMimeFilterBasicClass)
-#define CAMEL_IS_MIME_FILTER_BASIC(obj) CAMEL_CHECK_TYPE (obj, camel_mime_filter_basic_get_type ())
-
-typedef struct _CamelMimeFilterBasicClass CamelMimeFilterBasicClass;
-
-typedef enum {
- CAMEL_MIME_FILTER_BASIC_BASE64_ENC = 1,
- CAMEL_MIME_FILTER_BASIC_BASE64_DEC,
- CAMEL_MIME_FILTER_BASIC_QP_ENC,
- CAMEL_MIME_FILTER_BASIC_QP_DEC,
- CAMEL_MIME_FILTER_BASIC_UU_ENC,
- CAMEL_MIME_FILTER_BASIC_UU_DEC,
-} CamelMimeFilterBasicType;
-
-struct _CamelMimeFilterBasic {
- CamelMimeFilter parent;
-
- struct _CamelMimeFilterBasicPrivate *priv;
-
- CamelMimeFilterBasicType type;
-
- unsigned char uubuf[60];
- int state;
- int save;
-};
-
-struct _CamelMimeFilterBasicClass {
- CamelMimeFilterClass parent_class;
-};
-
-CamelType camel_mime_filter_basic_get_type (void);
-CamelMimeFilterBasic *camel_mime_filter_basic_new (void);
-CamelMimeFilterBasic *camel_mime_filter_basic_new_type (CamelMimeFilterBasicType type);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* ! _CAMEL_MIME_FILTER_BASIC_H */
diff --git a/camel/camel-mime-filter-bestenc.c b/camel/camel-mime-filter-bestenc.c
deleted file mode 100644
index 2752652003..0000000000
--- a/camel/camel-mime-filter-bestenc.c
+++ /dev/null
@@ -1,300 +0,0 @@
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <string.h>
-
-#include "camel-mime-filter-bestenc.h"
-
-static void camel_mime_filter_bestenc_class_init (CamelMimeFilterBestencClass *klass);
-static void camel_mime_filter_bestenc_init (CamelMimeFilter *obj);
-
-static CamelMimeFilterClass *camel_mime_filter_bestenc_parent;
-
-CamelType
-camel_mime_filter_bestenc_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_mime_filter_get_type (), "CamelMimeFilterBestenc",
- sizeof (CamelMimeFilterBestenc),
- sizeof (CamelMimeFilterBestencClass),
- (CamelObjectClassInitFunc) camel_mime_filter_bestenc_class_init,
- NULL,
- (CamelObjectInitFunc) camel_mime_filter_bestenc_init,
- NULL);
- }
-
- return type;
-}
-
-static void
-reset(CamelMimeFilter *mf)
-{
- CamelMimeFilterBestenc *f = (CamelMimeFilterBestenc *)mf;
-
- f->count0 = 0;
- f->count8 = 0;
- f->countline = 0;
- f->total = 0;
- f->lastc = ~0;
- f->crlfnoorder = FALSE;
- f->fromcount = 0;
- f->hadfrom = FALSE;
- f->startofline = TRUE;
-
- camel_charset_init(&f->charset);
-}
-
-static void
-filter(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, size_t *outlen, size_t *outprespace)
-{
- CamelMimeFilterBestenc *f = (CamelMimeFilterBestenc *)mf;
- register unsigned char *p, *pend;
-
- if (len == 0)
- goto donothing;
-
- if (f->flags & CAMEL_BESTENC_GET_ENCODING) {
- register unsigned int /* hopefully reg's are assinged in the order they appear? */
- c,
- lastc=f->lastc,
- countline=f->countline,
- count0=f->count0,
- count8 = f->count8;
-
- /* Check ^From lines first call, or have the start of a new line waiting? */
- if ((f->flags & CAMEL_BESTENC_NO_FROM) && !f->hadfrom
- && (f->fromcount > 0 || f->startofline)) {
- if (f->fromcount + len >=5) {
- memcpy(&f->fromsave[f->fromcount], in, 5-f->fromcount);
- f->hadfrom = strncmp(f->fromsave, "From ", 5) == 0;
- f->fromcount = 0;
- } else {
- memcpy(&f->fromsave[f->fromcount], in, len);
- f->fromcount += len;
- }
- }
-
- f->startofline = FALSE;
-
- /* See rfc2045 section 2 for definitions of 7bit/8bit/binary */
- p = in;
- pend = p + len;
- while (p<pend) {
- c = *p++;
- /* check for 8 bit characters */
- if (c & 0x80)
- count8++;
-
- /* check for nul's */
- if (c == 0)
- count0++;
-
- /* check for wild '\r's in a unix format stream */
- if (c == '\r' && (f->flags & CAMEL_BESTENC_LF_IS_CRLF)) {
- f->crlfnoorder = TRUE;
- }
-
- /* check for end of line */
- if (c == '\n') {
- /* check for wild '\n's in canonical format stream */
- if (lastc == '\r' || (f->flags & CAMEL_BESTENC_LF_IS_CRLF)) {
- if (countline > f->maxline)
- f->maxline = countline;
- countline = 0;
-
- /* Check for "^From " lines */
- if ((f->flags & CAMEL_BESTENC_NO_FROM) && !f->hadfrom) {
- if (pend-p >= 5) {
- f->hadfrom = strncmp(p, "From ", 5) == 0;
- } else if (pend-p == 0) {
- f->startofline = TRUE;
- } else {
- f->fromcount = pend-p;
- memcpy(f->fromsave, p, pend-p);
- }
- }
- } else {
- f->crlfnoorder = TRUE;
- }
- } else {
- countline++;
- }
- lastc = c;
- }
- f->count8 = count8;
- f->count0 = count0;
- f->countline = countline;
- f->lastc = lastc;
- }
-
- f->total += len;
-
- if (f->flags & CAMEL_BESTENC_GET_CHARSET)
- camel_charset_step(&f->charset, in, len);
-
-donothing:
- *out = in;
- *outlen = len;
- *outprespace = prespace;
-}
-
-static void
-complete(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, size_t *outlen, size_t *outprespace)
-{
- CamelMimeFilterBestenc *f = (CamelMimeFilterBestenc *)mf;
-
- filter(mf, in, len, prespace, out, outlen, outprespace);
-
- if (f->countline > f->maxline)
- f->maxline = f->countline;
- f->countline = 0;
-}
-
-static void
-camel_mime_filter_bestenc_class_init (CamelMimeFilterBestencClass *klass)
-{
- CamelMimeFilterClass *filter_class = (CamelMimeFilterClass *) klass;
-
- camel_mime_filter_bestenc_parent = (CamelMimeFilterClass *)(camel_type_get_global_classfuncs (camel_mime_filter_get_type ()));
-
- filter_class->reset = reset;
- filter_class->filter = filter;
- filter_class->complete = complete;
-}
-
-static void
-camel_mime_filter_bestenc_init (CamelMimeFilter *f)
-{
- reset(f);
-}
-
-/**
- * camel_mime_filter_bestenc_new:
- * @flags: A bitmask of data required.
- *
- * Create a new CamelMimeFilterBestenc object.
- *
- * Return value:
- **/
-CamelMimeFilterBestenc *
-camel_mime_filter_bestenc_new (unsigned int flags)
-{
- CamelMimeFilterBestenc *new = (CamelMimeFilterBestenc *)camel_object_new(camel_mime_filter_bestenc_get_type());
- new->flags = flags;
- return new;
-}
-
-/**
- * camel_mime_filter_bestenc_get_best_encoding:
- * @f: bestenc filter object
- * @required: maximum level of output encoding allowed.
- *
- * Return the best encoding, given specific constraints, that can be used to
- * encode a stream of bytes.
- *
- * Return value:
- **/
-CamelTransferEncoding
-camel_mime_filter_bestenc_get_best_encoding(CamelMimeFilterBestenc *f, CamelBestencEncoding required)
-{
- CamelTransferEncoding bestenc;
- int istext;
-
- istext = (required & CAMEL_BESTENC_TEXT) ? 1 : 0;
- required = required & ~CAMEL_BESTENC_TEXT;
-
-#if 0
- printf("count0 = %d, count8 = %d, total = %d\n", f->count0, f->count8, f->total);
- printf("maxline = %d, crlfnoorder = %s\n", f->maxline, f->crlfnoorder?"TRUE":"FALSE");
- printf(" %d%% require encoding?\n", (f->count0+f->count8)*100 / f->total);
-#endif
-
- /* if we're not allowed to have From lines and we had one, use an encoding
- that will never let it show. Unfortunately only base64 can at present,
- although qp could be modified to allow it too */
- if ((f->flags & CAMEL_BESTENC_NO_FROM) && f->hadfrom)
- return CAMEL_TRANSFER_ENCODING_BASE64;
-
- /* if we need to encode, see how we do it */
- if (required == CAMEL_BESTENC_BINARY)
- bestenc = CAMEL_TRANSFER_ENCODING_BINARY;
- else if (istext && (f->count0 == 0 && f->count8 < (f->total * 17 / 100)))
- bestenc = CAMEL_TRANSFER_ENCODING_QUOTEDPRINTABLE;
- else
- bestenc = CAMEL_TRANSFER_ENCODING_BASE64;
-
- /* if we have nocrlf order, or long lines, we need to encode always */
- if (f->crlfnoorder || f->maxline >= 998)
- return bestenc;
-
- /* if we have no 8 bit chars or nul's, we can just use 7 bit */
- if (f->count8 + f->count0 == 0)
- return CAMEL_TRANSFER_ENCODING_7BIT;
-
- /* otherwise, we see if we can use 8 bit, or not */
- switch(required) {
- case CAMEL_BESTENC_7BIT:
- return bestenc;
- case CAMEL_BESTENC_8BIT:
- case CAMEL_BESTENC_BINARY:
- default:
- if (f->count0 == 0)
- return CAMEL_TRANSFER_ENCODING_8BIT;
- else
- return bestenc;
- }
-
- return CAMEL_TRANSFER_ENCODING_DEFAULT;
-}
-
-/**
- * camel_mime_filter_bestenc_get_best_charset:
- * @f: bestenc filter object
- *
- * Gets the best charset that can be used to contain this content.
- *
- * Return value:
- **/
-const char *
-camel_mime_filter_bestenc_get_best_charset(CamelMimeFilterBestenc *f)
-{
- return camel_charset_best_name(&f->charset);
-}
-
-/**
- * camel_mime_filter_bestenc_set_flags:
- * @f:
- * @flags:
- *
- * Set the flags for subsequent operations.
- **/
-void
-camel_mime_filter_bestenc_set_flags(CamelMimeFilterBestenc *f, unsigned int flags)
-{
- f->flags = flags;
-}
diff --git a/camel/camel-mime-filter-bestenc.h b/camel/camel-mime-filter-bestenc.h
deleted file mode 100644
index be0b8ae37a..0000000000
--- a/camel/camel-mime-filter-bestenc.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef _CAMEL_MIME_FILTER_BESTENC_H
-#define _CAMEL_MIME_FILTER_BESTENC_H
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <camel/camel-mime-filter.h>
-#include <camel/camel-mime-part.h>
-#include <camel/camel-charset-map.h>
-
-#define CAMEL_MIME_FILTER_BESTENC(obj) CAMEL_CHECK_CAST (obj, camel_mime_filter_bestenc_get_type (), CamelMimeFilterBestenc)
-#define CAMEL_MIME_FILTER_BESTENC_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_mime_filter_bestenc_get_type (), CamelMimeFilterBestencClass)
-#define CAMEL_IS_MIME_FILTER_BESTENC(obj) CAMEL_CHECK_TYPE (obj, camel_mime_filter_bestenc_get_type ())
-
-typedef struct _CamelMimeFilterBestencClass CamelMimeFilterBestencClass;
-
-enum _CamelBestencRequired {
- CAMEL_BESTENC_GET_ENCODING = 1<<0,
- CAMEL_BESTENC_GET_CHARSET = 1<<1,
-
- /* do we treat 'lf' as if it were crlf? */
- CAMEL_BESTENC_LF_IS_CRLF = 1<<8,
- /* do we not allow "From " to appear at the start of a line in any part? */
- CAMEL_BESTENC_NO_FROM = 1<<9,
-};
-typedef enum _CamelBestencRequired CamelBestencRequired;
-
-enum _CamelBestencEncoding {
- CAMEL_BESTENC_7BIT,
- CAMEL_BESTENC_8BIT,
- CAMEL_BESTENC_BINARY,
-
- /* is the content stream to be treated as text? */
- CAMEL_BESTENC_TEXT = 1<<8,
-};
-typedef enum _CamelBestencEncoding CamelBestencEncoding;
-
-struct _CamelMimeFilterBestenc {
- CamelMimeFilter parent;
-
- unsigned int flags; /* our creation flags, see above */
-
- unsigned int count0; /* count of NUL characters */
- unsigned int count8; /* count of 8 bit characters */
- unsigned int total; /* total characters read */
-
- unsigned int lastc; /* the last character read */
- int crlfnoorder; /* if crlf's occured where they shouldn't have */
-
- int startofline; /* are we at the start of a new line? */
-
- int fromcount;
- char fromsave[6]; /* save a few characters if we found an \n near the end of the buffer */
- int hadfrom; /* did we encounter a "\nFrom " in the data? */
-
- unsigned int countline; /* current count of characters on a given line */
- unsigned int maxline; /* max length of any line */
-
- CamelCharset charset; /* used to determine the best charset to use */
-};
-
-struct _CamelMimeFilterBestencClass {
- CamelMimeFilterClass parent_class;
-};
-
-CamelType camel_mime_filter_bestenc_get_type (void);
-CamelMimeFilterBestenc *camel_mime_filter_bestenc_new (unsigned int flags);
-
-
-CamelTransferEncoding camel_mime_filter_bestenc_get_best_encoding(CamelMimeFilterBestenc *f, CamelBestencEncoding required);
-const char * camel_mime_filter_bestenc_get_best_charset(CamelMimeFilterBestenc *f);
-void camel_mime_filter_bestenc_set_flags(CamelMimeFilterBestenc *f, unsigned int flags);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* ! _CAMEL_MIME_FILTER_BESTENC_H */
diff --git a/camel/camel-mime-filter-canon.c b/camel/camel-mime-filter-canon.c
deleted file mode 100644
index 43337ae856..0000000000
--- a/camel/camel-mime-filter-canon.c
+++ /dev/null
@@ -1,239 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2002 Ximian, Inc.
- *
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- * Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-/* canonicalisation filter, used for secure mime incoming and outgoing */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-#include <ctype.h>
-
-#include "camel-mime-filter-canon.h"
-
-static void filter (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace);
-static void complete (CamelMimeFilter *f, char *in, size_t len,
- size_t prespace, char **out, size_t *outlen,
- size_t *outprespace);
-static void reset (CamelMimeFilter *f);
-
-
-static void
-camel_mime_filter_canon_class_init (CamelMimeFilterCanonClass *klass)
-{
- CamelMimeFilterClass *mime_filter_class = (CamelMimeFilterClass *) klass;
-
- mime_filter_class->filter = filter;
- mime_filter_class->complete = complete;
- mime_filter_class->reset = reset;
-}
-
-CamelType
-camel_mime_filter_canon_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_mime_filter_get_type(), "CamelMimeFilterCanon",
- sizeof (CamelMimeFilterCanon),
- sizeof (CamelMimeFilterCanonClass),
- (CamelObjectClassInitFunc) camel_mime_filter_canon_class_init,
- NULL,
- NULL,
- NULL);
- }
-
- return type;
-}
-
-static void
-filter(CamelMimeFilter *f, char *in, size_t len, size_t prespace, char **out, size_t *outlen, size_t *outprespace)
-{
- register unsigned char *inptr, c;
- const unsigned char *inend, *start;
- char *starto;
- register char *o;
- int lf = 0;
- guint32 flags;
-
- flags = ((CamelMimeFilterCanon *)f)->flags;
-
- /* first, work out how much space we need */
- inptr = in;
- inend = in+len;
- while (inptr < inend)
- if (*inptr++ == '\n')
- lf++;
-
- /* worst case, extra 3 chars per line
- "From \n" -> "=46rom \r\n"
- We add 1 extra incase we're called from complete, when we didn't end in \n */
-
- camel_mime_filter_set_size(f, len+lf*3+4, FALSE);
-
- o = f->outbuf;
- inptr = in;
- start = inptr;
- starto = o;
- while (inptr < inend) {
- /* first, check start of line, we always start at the start of the line */
- c = *inptr;
- if (flags & CAMEL_MIME_FILTER_CANON_FROM && c == 'F') {
- inptr++;
- if (inptr < inend-4) {
- if (strncmp(inptr, "rom ", 4) == 0) {
- *o++ = '=';
- *o++ = '4';
- *o++ = '6';
- } else
- *o++ = 'F';
- *o++ = *inptr++;
- *o++ = *inptr++;
- *o++ = *inptr++;
- *o++ = *inptr++;
- } else {
- break;
- }
- }
-
- /* now scan for end of line */
- while (inptr < inend) {
- c = *inptr++;
- if (c == '\n') {
- /* check to strip trailing space */
- if (flags & CAMEL_MIME_FILTER_CANON_STRIP) {
- while (o>starto && (o[-1] == ' ' || o[-1] == '\t' || o[-1]=='\r'))
- o--;
- }
- /* check end of line canonicalisation */
- if (o>starto) {
- if (flags & CAMEL_MIME_FILTER_CANON_CRLF) {
- if (o[-1] != '\r')
- *o++ = '\r';
- } else {
- if (o[-1] == '\r')
- o--;
- }
- } else if (flags & CAMEL_MIME_FILTER_CANON_CRLF) {
- /* empty line */
- *o++ = '\r';
- }
-
- *o++ = c;
- start = inptr;
- starto = o;
- break;
- } else
- *o++ = c;
- }
- }
-
- /* TODO: We should probably track if we end somewhere in the middle of a line,
- otherwise we potentially backup a full line, which could be large */
-
- /* we got to the end of the data without finding anything, backup to start and re-process next time around */
- camel_mime_filter_backup(f, start, inend - start);
-
- *out = f->outbuf;
- *outlen = starto - f->outbuf;
- *outprespace = f->outpre;
-}
-
-static void
-complete(CamelMimeFilter *f, char *in, size_t len, size_t prespace, char **out, size_t *outlen, size_t *outprespace)
-{
- unsigned char *inptr, *inend;
- char *o, *starto;
- guint32 flags;
-
- if (len)
- filter(f, in, len, prespace, out, outlen, outprespace);
-
- /* the data didn't contain an eol or was too short for "From ", we only need to check for "From" and add an eol */
- if (f->backlen) {
- inptr = (unsigned char *)f->backbuf;
- inend = (unsigned char *)f->backbuf + f->backlen;
- starto = o = *out + *outlen;
- flags = ((CamelMimeFilterCanon *)f)->flags;
-
- /* Check any embedded "From " */
- if (f->backlen >= 5
- && (flags & CAMEL_MIME_FILTER_CANON_FROM)
- && strcmp(inptr, "From ") == 0) {
- strcpy(o, "=46rom ");
- o += 7;
- inptr += 5;
- }
-
- /* copy the rest of it */
- while (inptr < inend)
- *o++ = *inptr++;
-
- /* check to strip trailing space */
- if (flags & CAMEL_MIME_FILTER_CANON_STRIP) {
- while (o>starto && (o[-1] == ' ' || o[-1] == '\t' || o[-1]=='\r'))
- o--;
- }
-
-#if 0
- /* Note: #if 0'd out because we do not want to add a
- * \r\n for PGP/MIME verification if it isn't there in
- * the original content stream */
-
- /* check end of line canonicalisation */
- if (o>starto) {
- if (flags & CAMEL_MIME_FILTER_CANON_CRLF) {
- if (o[-1] != '\r')
- *o++ = '\r';
- } else {
- if (o[-1] == '\r')
- o--;
- }
- }
-
- /* and always finish with an eol */
- *o++ = '\n';
-#endif
-
- *outlen = o - *out;
-
- f->backlen = 0;
- }
-}
-
-static void
-reset (CamelMimeFilter *f)
-{
- /* no-op */
-}
-
-CamelMimeFilter *
-camel_mime_filter_canon_new(guint32 flags)
-{
- CamelMimeFilterCanon *chomp = CAMEL_MIME_FILTER_CANON (camel_object_new (CAMEL_MIME_FILTER_CANON_TYPE));
-
- chomp->flags = flags;
-
- return (CamelMimeFilter *) chomp;
-}
diff --git a/camel/camel-mime-filter-canon.h b/camel/camel-mime-filter-canon.h
deleted file mode 100644
index d3cffb240e..0000000000
--- a/camel/camel-mime-filter-canon.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2002 Ximian Inc.
- *
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- * Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef _CAMEL_MIME_FILTER_CANON_H
-#define _CAMEL_MIME_FILTER_CANON_H
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <camel/camel-mime-filter.h>
-
-#define CAMEL_MIME_FILTER_CANON_TYPE (camel_mime_filter_canon_get_type ())
-#define CAMEL_MIME_FILTER_CANON(obj) CAMEL_CHECK_CAST (obj, CAMEL_MIME_FILTER_CANON_TYPE, CamelMimeFilterCanon)
-#define CAMEL_MIME_FILTER_CANON_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, CAMEL_MIME_FILTER_CANON_TYPE, CamelMimeFilterCanonClass)
-#define CAMEL_IS_MIME_FILTER_CANON(obj) CAMEL_CHECK_TYPE (obj, CAMEL_MIME_FILTER_CANON_TYPE)
-
-typedef struct _CamelMimeFilterCanon CamelMimeFilterCanon;
-typedef struct _CamelMimeFilterCanonClass CamelMimeFilterCanonClass;
-
-enum {
- CAMEL_MIME_FILTER_CANON_CRLF = (1<<0), /* canoncialise end of line to crlf, otherwise canonicalise to lf only */
- CAMEL_MIME_FILTER_CANON_FROM = (1<<1), /* escape "^From " using quoted-printable semantics into "=46rom " */
- CAMEL_MIME_FILTER_CANON_STRIP = (1<<2), /* strip trailing space */
-};
-
-struct _CamelMimeFilterCanon {
- CamelMimeFilter parent;
-
- guint32 flags;
-};
-
-struct _CamelMimeFilterCanonClass {
- CamelMimeFilterClass parent_class;
-};
-
-CamelType camel_mime_filter_canon_get_type (void);
-
-CamelMimeFilter *camel_mime_filter_canon_new(guint32 flags);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* ! _CAMEL_MIME_FILTER_CANON_H */
diff --git a/camel/camel-mime-filter-charset.c b/camel/camel-mime-filter-charset.c
deleted file mode 100644
index 012f1897be..0000000000
--- a/camel/camel-mime-filter-charset.c
+++ /dev/null
@@ -1,277 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-#include <errno.h>
-
-#include <gal/util/e-iconv.h>
-
-#include "camel-mime-filter-charset.h"
-#include "camel-charset-map.h"
-
-#define d(x)
-
-static void camel_mime_filter_charset_class_init (CamelMimeFilterCharsetClass *klass);
-static void camel_mime_filter_charset_init (CamelMimeFilterCharset *obj);
-static void camel_mime_filter_charset_finalize (CamelObject *o);
-
-static CamelMimeFilterClass *camel_mime_filter_charset_parent;
-
-CamelType
-camel_mime_filter_charset_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_mime_filter_get_type (), "CamelMimeFilterCharset",
- sizeof (CamelMimeFilterCharset),
- sizeof (CamelMimeFilterCharsetClass),
- (CamelObjectClassInitFunc) camel_mime_filter_charset_class_init,
- NULL,
- (CamelObjectInitFunc) camel_mime_filter_charset_init,
- (CamelObjectFinalizeFunc) camel_mime_filter_charset_finalize);
- }
-
- return type;
-}
-
-static void
-camel_mime_filter_charset_finalize(CamelObject *o)
-{
- CamelMimeFilterCharset *f = (CamelMimeFilterCharset *)o;
-
- g_free(f->from);
- g_free(f->to);
- if (f->ic != (iconv_t) -1) {
- e_iconv_close (f->ic);
- f->ic = (iconv_t) -1;
- }
-}
-
-static void
-reset(CamelMimeFilter *mf)
-{
- CamelMimeFilterCharset *f = (CamelMimeFilterCharset *)mf;
- char buf[16];
- char *buffer;
- size_t outlen = 16;
-
- /* what happens with the output bytes if this resets the state? */
- if (f->ic != (iconv_t) -1) {
- buffer = buf;
- e_iconv (f->ic, NULL, 0, &buffer, &outlen);
- }
-}
-
-static void
-complete(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, size_t *outlen, size_t *outprespace)
-{
- CamelMimeFilterCharset *charset = (CamelMimeFilterCharset *)mf;
- size_t inleft, outleft, converted = 0;
- const char *inbuf;
- char *outbuf;
-
- if (charset->ic == (iconv_t) -1)
- goto noop;
-
- camel_mime_filter_set_size (mf, len * 5 + 16, FALSE);
- outbuf = mf->outbuf;
- outleft = mf->outsize;
-
- inbuf = in;
- inleft = len;
-
- if (inleft > 0) {
- do {
- converted = e_iconv (charset->ic, &inbuf, &inleft, &outbuf, &outleft);
- if (converted == (size_t) -1) {
- if (errno == E2BIG) {
- /*
- * E2BIG There is not sufficient room at *outbuf.
- *
- * We just need to grow our outbuffer and try again.
- */
-
- converted = outbuf - mf->outbuf;
- camel_mime_filter_set_size (mf, inleft * 5 + mf->outsize + 16, TRUE);
- outbuf = mf->outbuf + converted;
- outleft = mf->outsize - converted;
- } else if (errno == EILSEQ) {
- /*
- * EILSEQ An invalid multibyte sequence has been encountered
- * in the input.
- *
- * What we do here is eat the invalid bytes in the sequence and continue
- */
-
- inbuf++;
- inleft--;
- } else if (errno == EINVAL) {
- /*
- * EINVAL An incomplete multibyte sequence has been encoun
- * tered in the input.
- *
- * We assume that this can only happen if we've run out of
- * bytes for a multibyte sequence, if not we're in trouble.
- */
-
- break;
- } else
- goto noop;
- }
- } while (((int) inleft) > 0);
- }
-
- /* flush the iconv conversion */
- e_iconv (charset->ic, NULL, NULL, &outbuf, &outleft);
-
- *out = mf->outbuf;
- *outlen = mf->outsize - outleft;
- *outprespace = mf->outpre;
-
- return;
-
- noop:
-
- *out = in;
- *outlen = len;
- *outprespace = prespace;
-}
-
-static void
-filter(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, size_t *outlen, size_t *outprespace)
-{
- CamelMimeFilterCharset *charset = (CamelMimeFilterCharset *)mf;
- size_t inleft, outleft, converted = 0;
- const char *inbuf;
- char *outbuf;
-
- if (charset->ic == (iconv_t) -1)
- goto noop;
-
- camel_mime_filter_set_size (mf, len * 5 + 16, FALSE);
- outbuf = mf->outbuf + converted;
- outleft = mf->outsize - converted;
-
- inbuf = in;
- inleft = len;
-
- do {
- converted = e_iconv (charset->ic, &inbuf, &inleft, &outbuf, &outleft);
- if (converted == (size_t) -1) {
- if (errno == E2BIG || errno == EINVAL)
- break;
-
- if (errno == EILSEQ) {
- /*
- * EILSEQ An invalid multibyte sequence has been encountered
- * in the input.
- *
- * What we do here is eat the invalid bytes in the sequence and continue
- */
-
- inbuf++;
- inleft--;
- } else {
- /* unknown error condition */
- goto noop;
- }
- }
- } while (((int) inleft) > 0);
-
- if (((int) inleft) > 0) {
- /* We've either got an E2BIG or EINVAL. Save the
- remainder of the buffer as we'll process this next
- time through */
- camel_mime_filter_backup (mf, inbuf, inleft);
- }
-
- *out = mf->outbuf;
- *outlen = outbuf - mf->outbuf;
- *outprespace = mf->outpre;
-
- return;
-
- noop:
-
- *out = in;
- *outlen = len;
- *outprespace = prespace;
-}
-
-static void
-camel_mime_filter_charset_class_init (CamelMimeFilterCharsetClass *klass)
-{
- CamelMimeFilterClass *filter_class = (CamelMimeFilterClass *) klass;
-
- camel_mime_filter_charset_parent = CAMEL_MIME_FILTER_CLASS (camel_type_get_global_classfuncs (camel_mime_filter_get_type ()));
-
- filter_class->reset = reset;
- filter_class->filter = filter;
- filter_class->complete = complete;
-}
-
-static void
-camel_mime_filter_charset_init (CamelMimeFilterCharset *obj)
-{
- obj->ic = (iconv_t)-1;
-}
-
-/**
- * camel_mime_filter_charset_new:
- *
- * Create a new CamelMimeFilterCharset object.
- *
- * Return value: A new CamelMimeFilterCharset widget.
- **/
-CamelMimeFilterCharset *
-camel_mime_filter_charset_new (void)
-{
- return CAMEL_MIME_FILTER_CHARSET (camel_object_new (camel_mime_filter_charset_get_type ()));
-}
-
-CamelMimeFilterCharset *
-camel_mime_filter_charset_new_convert (const char *from_charset, const char *to_charset)
-{
- CamelMimeFilterCharset *new;
-
- new = CAMEL_MIME_FILTER_CHARSET (camel_object_new (camel_mime_filter_charset_get_type ()));
-
- new->ic = e_iconv_open (to_charset, from_charset);
- if (new->ic == (iconv_t) -1) {
- g_warning ("Cannot create charset conversion from %s to %s: %s",
- from_charset ? from_charset : "(null)",
- to_charset ? to_charset : "(null)",
- g_strerror (errno));
- camel_object_unref (new);
- new = NULL;
- } else {
- new->from = g_strdup (from_charset);
- new->to = g_strdup (to_charset);
- }
-
- return new;
-}
diff --git a/camel/camel-mime-filter-charset.h b/camel/camel-mime-filter-charset.h
deleted file mode 100644
index ddc3025eb0..0000000000
--- a/camel/camel-mime-filter-charset.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef _CAMEL_MIME_FILTER_CHARSET_H
-#define _CAMEL_MIME_FILTER_CHARSET_H
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <camel/camel-mime-filter.h>
-#include <iconv.h>
-
-#define CAMEL_MIME_FILTER_CHARSET(obj) CAMEL_CHECK_CAST (obj, camel_mime_filter_charset_get_type (), CamelMimeFilterCharset)
-#define CAMEL_MIME_FILTER_CHARSET_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_mime_filter_charset_get_type (), CamelMimeFilterCharsetClass)
-#define CAMEL_IS_MIME_FILTER_CHARSET(obj) CAMEL_CHECK_TYPE (obj, camel_mime_filter_charset_get_type ())
-
-typedef struct _CamelMimeFilterCharsetClass CamelMimeFilterCharsetClass;
-
-struct _CamelMimeFilterCharset {
- CamelMimeFilter parent;
-
- struct _CamelMimeFilterCharsetPrivate *priv;
-
- iconv_t ic;
- char *from;
- char *to;
-};
-
-struct _CamelMimeFilterCharsetClass {
- CamelMimeFilterClass parent_class;
-};
-
-CamelType camel_mime_filter_charset_get_type (void);
-CamelMimeFilterCharset *camel_mime_filter_charset_new (void);
-
-CamelMimeFilterCharset *camel_mime_filter_charset_new_convert (const char *from_charset, const char *to_charset);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* ! _CAMEL_MIME_FILTER_CHARSET_H */
diff --git a/camel/camel-mime-filter-crlf.c b/camel/camel-mime-filter-crlf.c
deleted file mode 100644
index bd21ef991c..0000000000
--- a/camel/camel-mime-filter-crlf.c
+++ /dev/null
@@ -1,172 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2000 Ximian, Inc.
- *
- * Authors: Dan Winship <danw@ximian.com>
- * Jeffrey Stedfast <fejj@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include "camel-mime-filter-crlf.h"
-
-static void filter (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace);
-static void complete (CamelMimeFilter *f, char *in, size_t len,
- size_t prespace, char **out, size_t *outlen,
- size_t *outprespace);
-static void reset (CamelMimeFilter *f);
-
-
-static void
-camel_mime_filter_crlf_class_init (CamelMimeFilterCRLFClass *klass)
-{
- CamelMimeFilterClass *mime_filter_class =
- (CamelMimeFilterClass *) klass;
-
- mime_filter_class->filter = filter;
- mime_filter_class->complete = complete;
- mime_filter_class->reset = reset;
-}
-
-CamelType
-camel_mime_filter_crlf_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_mime_filter_get_type(), "CamelMimeFilterCRLF",
- sizeof (CamelMimeFilterCRLF),
- sizeof (CamelMimeFilterCRLFClass),
- (CamelObjectClassInitFunc) camel_mime_filter_crlf_class_init,
- NULL,
- NULL,
- NULL);
- }
-
- return type;
-}
-
-static void
-filter (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace)
-{
- CamelMimeFilterCRLF *crlf = (CamelMimeFilterCRLF *)f;
- register const char *inptr;
- const char *inend;
- gboolean do_dots;
- char *outptr;
-
- do_dots = crlf->mode == CAMEL_MIME_FILTER_CRLF_MODE_CRLF_DOTS;
-
- inptr = in;
- inend = in + len;
-
- if (crlf->direction == CAMEL_MIME_FILTER_CRLF_ENCODE) {
- camel_mime_filter_set_size (f, 3 * len, FALSE);
-
- outptr = f->outbuf;
- while (inptr < inend) {
- if (*inptr == '\r') {
- crlf->saw_cr = TRUE;
- } else if (*inptr == '\n') {
- crlf->saw_lf = TRUE;
- if (!crlf->saw_cr)
- *outptr++ = '\r';
- crlf->saw_cr = FALSE;
- } else {
- if (do_dots && *inptr == '.' && crlf->saw_lf)
- *outptr++ = '.';
-
- crlf->saw_cr = FALSE;
- crlf->saw_lf = FALSE;
- }
-
- *outptr++ = *inptr++;
- }
- } else {
- camel_mime_filter_set_size (f, len, FALSE);
-
- outptr = f->outbuf;
- while (inptr < inend) {
- if (*inptr == '\r') {
- crlf->saw_cr = TRUE;
- } else {
- if (crlf->saw_cr) {
- crlf->saw_cr = FALSE;
-
- if (*inptr == '\n') {
- crlf->saw_lf = TRUE;
- *outptr++ = *inptr++;
- continue;
- } else
- *outptr++ = '\r';
- }
-
- *outptr++ = *inptr;
- }
-
- if (do_dots && *inptr == '.') {
- if (crlf->saw_lf) {
- crlf->saw_dot = TRUE;
- crlf->saw_lf = FALSE;
- inptr++;
- } else if (crlf->saw_dot) {
- crlf->saw_dot = FALSE;
- }
- }
-
- crlf->saw_lf = FALSE;
-
- inptr++;
- }
- }
-
- *out = f->outbuf;
- *outlen = outptr - f->outbuf;
- *outprespace = f->outpre;
-}
-
-static void
-complete (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace)
-{
- if (len)
- filter (f, in, len, prespace, out, outlen, outprespace);
-}
-
-static void
-reset (CamelMimeFilter *f)
-{
- CamelMimeFilterCRLF *crlf = (CamelMimeFilterCRLF *)f;
-
- crlf->saw_cr = FALSE;
- crlf->saw_lf = TRUE;
- crlf->saw_dot = FALSE;
-}
-
-CamelMimeFilter *
-camel_mime_filter_crlf_new (CamelMimeFilterCRLFDirection direction, CamelMimeFilterCRLFMode mode)
-{
- CamelMimeFilterCRLF *crlf = CAMEL_MIME_FILTER_CRLF(camel_object_new (CAMEL_MIME_FILTER_CRLF_TYPE));
-
- crlf->direction = direction;
- crlf->mode = mode;
- crlf->saw_cr = FALSE;
- crlf->saw_lf = TRUE;
- crlf->saw_dot = FALSE;
-
- return (CamelMimeFilter *)crlf;
-}
diff --git a/camel/camel-mime-filter-crlf.h b/camel/camel-mime-filter-crlf.h
deleted file mode 100644
index 1e3526d600..0000000000
--- a/camel/camel-mime-filter-crlf.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Dan Winship <danw@ximian.com>
- * Jeffrey Stedfast <fejj@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-
-#ifndef _CAMEL_MIME_FILTER_CRLF_H
-#define _CAMEL_MIME_FILTER_CRLF_H
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <camel/camel-mime-filter.h>
-
-#define CAMEL_MIME_FILTER_CRLF_TYPE (camel_mime_filter_crlf_get_type ())
-#define CAMEL_MIME_FILTER_CRLF(obj) CAMEL_CHECK_CAST (obj, CAMEL_MIME_FILTER_CRLF_TYPE, CamelMimeFilterCRLF)
-#define CAMEL_MIME_FILTER_CRLF_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, CAMEL_MIME_FILTER_CRLF_TYPE, CamelMimeFilterCRLFClass)
-#define CAMEL_IS_MIME_FILTER_CRLF(obj) CAMEL_CHECK_TYPE (obj, CAMEL_MIME_FILTER_CRLF_TYPE)
-
-typedef struct _CamelMimeFilterCRLFClass CamelMimeFilterCRLFClass;
-
-typedef enum {
- CAMEL_MIME_FILTER_CRLF_ENCODE,
- CAMEL_MIME_FILTER_CRLF_DECODE
-} CamelMimeFilterCRLFDirection;
-
-typedef enum {
- CAMEL_MIME_FILTER_CRLF_MODE_CRLF_DOTS,
- CAMEL_MIME_FILTER_CRLF_MODE_CRLF_ONLY,
-} CamelMimeFilterCRLFMode;
-
-struct _CamelMimeFilterCRLF {
- CamelMimeFilter parent;
-
- CamelMimeFilterCRLFDirection direction;
- CamelMimeFilterCRLFMode mode;
- gboolean saw_cr;
- gboolean saw_lf;
- gboolean saw_dot;
-};
-
-struct _CamelMimeFilterCRLFClass {
- CamelMimeFilterClass parent_class;
-};
-
-CamelType camel_mime_filter_crlf_get_type (void);
-
-CamelMimeFilter *camel_mime_filter_crlf_new (CamelMimeFilterCRLFDirection direction, CamelMimeFilterCRLFMode mode);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* ! _CAMEL_MIME_FILTER_CRLF_H */
diff --git a/camel/camel-mime-filter-enriched.c b/camel/camel-mime-filter-enriched.c
deleted file mode 100644
index b31502ead6..0000000000
--- a/camel/camel-mime-filter-enriched.c
+++ /dev/null
@@ -1,591 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2002 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <string.h>
-
-#include <camel/camel-string-utils.h>
-
-#include "camel-mime-filter-enriched.h"
-
-/* text/enriched is rfc1896 */
-
-typedef char * (*EnrichedParamParser) (const char *inptr, int inlen);
-
-static char *param_parse_colour (const char *inptr, int inlen);
-static char *param_parse_font (const char *inptr, int inlen);
-static char *param_parse_lang (const char *inptr, int inlen);
-
-static struct {
- char *enriched;
- char *html;
- gboolean needs_param;
- EnrichedParamParser parse_param; /* parses *and* validates the input */
-} enriched_tags[] = {
- { "bold", "<b>", FALSE, NULL },
- { "/bold", "</b>", FALSE, NULL },
- { "italic", "<i>", FALSE, NULL },
- { "/italic", "</i>", FALSE, NULL },
- { "fixed", "<tt>", FALSE, NULL },
- { "/fixed", "</tt>", FALSE, NULL },
- { "smaller", "<font size=-1>", FALSE, NULL },
- { "/smaller", "</font>", FALSE, NULL },
- { "bigger", "<font size=+1>", FALSE, NULL },
- { "/bigger", "</font>", FALSE, NULL },
- { "underline", "<u>", FALSE, NULL },
- { "/underline", "</u>", FALSE, NULL },
- { "center", "<p align=center>", FALSE, NULL },
- { "/center", "</p>", FALSE, NULL },
- { "flushleft", "<p align=left>", FALSE, NULL },
- { "/flushleft", "</p>", FALSE, NULL },
- { "flushright", "<p align=right>", FALSE, NULL },
- { "/flushright", "</p>", FALSE, NULL },
- { "excerpt", "<blockquote>", FALSE, NULL },
- { "/excerpt", "</blockquote>", FALSE, NULL },
- { "paragraph", "<p>", FALSE, NULL },
- { "signature", "<address>", FALSE, NULL },
- { "/signature", "</address>", FALSE, NULL },
- { "comment", "<!-- ", FALSE, NULL },
- { "/comment", " -->", FALSE, NULL },
- { "np", "<hr>", FALSE, NULL },
- { "fontfamily", "<font face=\"%s\">", TRUE, param_parse_font },
- { "/fontfamily", "</font>", FALSE, NULL },
- { "color", "<font color=\"%s\">", TRUE, param_parse_colour },
- { "/color", "</font>", FALSE, NULL },
- { "lang", "<span lang=\"%s\">", TRUE, param_parse_lang },
- { "/lang", "</span>", FALSE, NULL },
-
- /* don't handle this tag yet... */
- { "paraindent", "<!-- ", /* TRUE */ FALSE, NULL },
- { "/paraindent", " -->", FALSE, NULL },
-
- /* as soon as we support all the tags that can have a param
- * tag argument, these should be unnecessary, but we'll keep
- * them anyway just in case? */
- { "param", "<!-- ", FALSE, NULL },
- { "/param", " -->", FALSE, NULL },
-};
-
-#define NUM_ENRICHED_TAGS (sizeof (enriched_tags) / sizeof (enriched_tags[0]))
-
-static GHashTable *enriched_hash = NULL;
-
-
-static void camel_mime_filter_enriched_class_init (CamelMimeFilterEnrichedClass *klass);
-static void camel_mime_filter_enriched_init (CamelMimeFilterEnriched *filter);
-static void camel_mime_filter_enriched_finalize (CamelObject *obj);
-
-static void filter_filter (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace);
-static void filter_complete (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace);
-static void filter_reset (CamelMimeFilter *filter);
-
-
-static CamelMimeFilterClass *parent_class = NULL;
-
-
-CamelType
-camel_mime_filter_enriched_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_mime_filter_get_type (),
- "CamelMimeFilterEnriched",
- sizeof (CamelMimeFilterEnriched),
- sizeof (CamelMimeFilterEnrichedClass),
- (CamelObjectClassInitFunc) camel_mime_filter_enriched_class_init,
- NULL,
- (CamelObjectInitFunc) camel_mime_filter_enriched_init,
- (CamelObjectFinalizeFunc) camel_mime_filter_enriched_finalize);
- }
-
- return type;
-}
-
-static void
-camel_mime_filter_enriched_class_init (CamelMimeFilterEnrichedClass *klass)
-{
- CamelMimeFilterClass *filter_class = (CamelMimeFilterClass *) klass;
- int i;
-
- parent_class = CAMEL_MIME_FILTER_CLASS (camel_mime_filter_get_type ());
-
- filter_class->reset = filter_reset;
- filter_class->filter = filter_filter;
- filter_class->complete = filter_complete;
-
- if (!enriched_hash) {
- enriched_hash = g_hash_table_new (camel_strcase_hash, camel_strcase_equal);
- for (i = 0; i < NUM_ENRICHED_TAGS; i++)
- g_hash_table_insert (enriched_hash, enriched_tags[i].enriched,
- enriched_tags[i].html);
- }
-}
-
-static void
-camel_mime_filter_enriched_finalize (CamelObject *obj)
-{
- ;
-}
-
-static void
-camel_mime_filter_enriched_init (CamelMimeFilterEnriched *filter)
-{
- filter->flags = 0;
- filter->nofill = 0;
-}
-
-
-#if 0
-static gboolean
-enriched_tag_needs_param (const char *tag)
-{
- int i;
-
- for (i = 0; i < NUM_ENRICHED_TAGS; i++)
- if (!strcasecmp (tag, enriched_tags[i].enriched))
- return enriched_tags[i].needs_param;
-
- return FALSE;
-}
-#endif
-
-static gboolean
-html_tag_needs_param (const char *tag)
-{
- return strstr (tag, "%s") != NULL;
-}
-
-static const char *valid_colours[] = {
- "red", "green", "blue", "yellow", "cyan", "magenta", "black", "white"
-};
-
-#define NUM_VALID_COLOURS (sizeof (valid_colours) / sizeof (valid_colours[0]))
-
-static char *
-param_parse_colour (const char *inptr, int inlen)
-{
- const char *inend, *end;
- guint32 rgb = 0;
- guint v;
- int i;
-
- for (i = 0; i < NUM_VALID_COLOURS; i++) {
- if (!strncasecmp (inptr, valid_colours[i], inlen))
- return g_strdup (valid_colours[i]);
- }
-
- /* check for numeric r/g/b in the format: ####,####,#### */
- if (inptr[4] != ',' || inptr[9] != ',') {
- /* okay, mailer must have used a string name that
- * rfc1896 did not specify? do some simple scanning
- * action, a colour name MUST be [a-zA-Z] */
- end = inptr;
- inend = inptr + inlen;
- while (end < inend && ((*end >= 'a' && *end <= 'z') || (*end >= 'A' && *end <= 'Z')))
- end++;
-
- return g_strndup (inptr, end - inptr);
- }
-
- for (i = 0; i < 3; i++) {
- v = strtoul (inptr, (char **) &end, 16);
- if (end != inptr + 4)
- goto invalid_format;
-
- v >>= 8;
- rgb = (rgb << 8) | (v & 0xff);
-
- inptr += 5;
- }
-
- return g_strdup_printf ("#%.6X", rgb);
-
- invalid_format:
-
- /* default colour? */
- return g_strdup ("black");
-}
-
-static char *
-param_parse_font (const char *fontfamily, int inlen)
-{
- register const char *inptr = fontfamily;
- const char *inend = inptr + inlen;
-
- /* don't allow any of '"', '<', nor '>' */
- while (inptr < inend && *inptr != '"' && *inptr != '<' && *inptr != '>')
- inptr++;
-
- return g_strndup (fontfamily, inptr - fontfamily);
-}
-
-static char *
-param_parse_lang (const char *lang, int inlen)
-{
- register const char *inptr = lang;
- const char *inend = inptr + inlen;
-
- /* don't allow any of '"', '<', nor '>' */
- while (inptr < inend && *inptr != '"' && *inptr != '<' && *inptr != '>')
- inptr++;
-
- return g_strndup (lang, inptr - lang);
-}
-
-static char *
-param_parse (const char *enriched, const char *inptr, int inlen)
-{
- int i;
-
- for (i = 0; i < NUM_ENRICHED_TAGS; i++) {
- if (!strcasecmp (enriched, enriched_tags[i].enriched))
- return enriched_tags[i].parse_param (inptr, inlen);
- }
-
- g_assert_not_reached ();
-
- return NULL;
-}
-
-#define IS_RICHTEXT CAMEL_MIME_FILTER_ENRICHED_IS_RICHTEXT
-
-static void
-enriched_to_html (CamelMimeFilter *filter, char *in, size_t inlen, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace, gboolean flush)
-{
- CamelMimeFilterEnriched *enriched = (CamelMimeFilterEnriched *) filter;
- const char *tag, *inend, *outend;
- register const char *inptr;
- register char *outptr;
-
- camel_mime_filter_set_size (filter, inlen * 2 + 6, FALSE);
-
- inptr = in;
- inend = in + inlen;
- outptr = filter->outbuf;
- outend = filter->outbuf + filter->outsize;
-
- retry:
- do {
- while (inptr < inend && outptr < outend && !strchr (" <>&\n", *inptr))
- *outptr++ = *inptr++;
-
- if (outptr == outend)
- goto backup;
-
- if ((inptr + 1) >= inend)
- break;
-
- switch (*inptr++) {
- case ' ':
- while (inptr < inend && (outptr + 7) < outend && *inptr == ' ') {
- memcpy (outptr, "&nbsp;", 6);
- outptr += 6;
- inptr++;
- }
-
- if (outptr < outend)
- *outptr++ = ' ';
-
- break;
- case '\n':
- if (!(enriched->flags & IS_RICHTEXT) && enriched->nofill <= 0) {
- /* text/enriched */
- while (inptr < inend && (outptr + 4) < outend && *inptr == '\n') {
- memcpy (outptr, "<br>", 4);
- outptr += 4;
- inptr++;
- }
- } else {
- /* text/richtext */
- *outptr++ = ' ';
- }
- break;
- case '>':
- if ((outptr + 4) < outend) {
- memcpy (outptr, "&gt;", 4);
- outptr += 4;
- } else {
- inptr--;
- goto backup;
- }
- break;
- case '&':
- if ((outptr + 5) < outend) {
- memcpy (outptr, "&amp;", 5);
- outptr += 5;
- } else {
- inptr--;
- goto backup;
- }
- break;
- case '<':
- if (!(enriched->flags & IS_RICHTEXT)) {
- /* text/enriched */
- if (*inptr == '<') {
- if ((outptr + 4) < outend) {
- memcpy (outptr, "&lt;", 4);
- outptr += 4;
- inptr++;
- break;
- } else {
- inptr--;
- goto backup;
- }
- }
- } else {
- /* text/richtext */
- if ((inend - inptr) >= 3 && (outptr + 4) < outend) {
- if (strncmp (inptr, "lt>", 3) == 0) {
- memcpy (outptr, "&lt;", 4);
- outptr += 4;
- inptr += 3;
- break;
- } else if (strncmp (inptr, "nl>", 3) == 0) {
- memcpy (outptr, "<br>", 4);
- outptr += 4;
- inptr += 3;
- break;
- }
- } else {
- inptr--;
- goto backup;
- }
- }
-
- tag = inptr;
- while (inptr < inend && *inptr != '>')
- inptr++;
-
- if (inptr == inend) {
- inptr = tag - 1;
- goto need_input;
- }
-
- if (!strncasecmp (tag, "nofill>", 7)) {
- if ((outptr + 5) < outend) {
- memcpy (outptr, "<pre>", 5);
- enriched->nofill++;
- outptr += 5;
- } else {
- inptr = tag - 1;
- goto backup;
- }
- } else if (!strncasecmp (tag, "/nofill>", 8)) {
- if ((outptr + 6) < outend) {
- memcpy (outptr, "</pre>", 6);
- enriched->nofill--;
- outptr += 6;
- } else {
- inptr = tag - 1;
- goto backup;
- }
- } else {
- const char *html_tag;
- char *enriched_tag;
- int len;
-
- len = inptr - tag;
- enriched_tag = g_alloca (len + 1);
- memcpy (enriched_tag, tag, len);
- enriched_tag[len] = '\0';
-
- html_tag = g_hash_table_lookup (enriched_hash, enriched_tag);
-
- if (html_tag) {
- if (html_tag_needs_param (html_tag)) {
- const char *start;
- char *param;
-
- while (inptr < inend && *inptr != '<')
- inptr++;
-
-#define PARAM_TAG_MIN_LEN (sizeof ("<param>") + sizeof ("</param>") - 1)
- if (inptr == inend || (inend - inptr) <= PARAM_TAG_MIN_LEN) {
- inptr = tag - 1;
- goto need_input;
- }
-
- if (strncasecmp (inptr, "<param>", 7) != 0) {
- /* ignore the enriched command tag... */
- inptr -= 1;
- goto loop;
- }
-
- inptr += 7;
- start = inptr;
-
- while (inptr < inend && *inptr != '<')
- inptr++;
-
- if (inptr == inend || (inend - inptr) <= 8) {
- inptr = tag - 1;
- goto need_input;
- }
-
- if (strncasecmp (inptr, "</param>", 8) != 0) {
- /* ignore the enriched command tag... */
- inptr += 7;
- goto loop;
- }
-
- len = inptr - start;
- param = param_parse (enriched_tag, start, len);
- len = strlen (param);
-
- inptr += 7;
-
- len += strlen (html_tag);
-
- if ((outptr + len) < outend) {
- outptr += snprintf (outptr, len, html_tag, param);
- g_free (param);
- } else {
- g_free (param);
- inptr = tag - 1;
- goto backup;
- }
- } else {
- len = strlen (html_tag);
- if ((outptr + len) < outend) {
- memcpy (outptr, html_tag, len);
- outptr += len;
- } else {
- inptr = tag - 1;
- goto backup;
- }
- }
- }
- }
-
- loop:
- inptr++;
- break;
- default:
- break;
- }
- } while (inptr < inend);
-
- need_input:
-
- /* the reason we ignore @flush here is because if there isn't
- enough input to parse a tag, then there's nothing we can
- do. */
-
- if (inptr < inend)
- camel_mime_filter_backup (filter, inptr, (unsigned) (inend - inptr));
-
- *out = filter->outbuf;
- *outlen = outptr - filter->outbuf;
- *outprespace = filter->outpre;
-
- return;
-
- backup:
-
- if (flush) {
- size_t offset, grow;
-
- grow = (inend - inptr) * 2 + 20;
- offset = outptr - filter->outbuf;
- camel_mime_filter_set_size (filter, filter->outsize + grow, TRUE);
- outend = filter->outbuf + filter->outsize;
- outptr = filter->outbuf + offset;
-
- goto retry;
- } else {
- camel_mime_filter_backup (filter, inptr, (unsigned) (inend - inptr));
- }
-
- *out = filter->outbuf;
- *outlen = outptr - filter->outbuf;
- *outprespace = filter->outpre;
-}
-
-static void
-filter_filter (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace)
-{
- enriched_to_html (filter, in, len, prespace, out, outlen, outprespace, FALSE);
-}
-
-static void
-filter_complete (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace)
-{
- enriched_to_html (filter, in, len, prespace, out, outlen, outprespace, TRUE);
-}
-
-static void
-filter_reset (CamelMimeFilter *filter)
-{
- CamelMimeFilterEnriched *enriched = (CamelMimeFilterEnriched *) filter;
-
- enriched->nofill = 0;
-}
-
-
-/**
- * camel_mime_filter_enriched_new:
- * @flags:
- *
- * Creates a new CamelMimeFilterEnriched object.
- *
- * Returns a new CamelMimeFilter object.
- **/
-CamelMimeFilter *
-camel_mime_filter_enriched_new (guint32 flags)
-{
- CamelMimeFilterEnriched *new;
-
- new = (CamelMimeFilterEnriched *) camel_object_new (CAMEL_TYPE_MIME_FILTER_ENRICHED);
- new->flags = flags;
-
- return CAMEL_MIME_FILTER (new);
-}
-
-char *
-camel_enriched_to_html(const char *in, guint32 flags)
-{
- CamelMimeFilter *filter;
- size_t outlen, outpre;
- char *outbuf;
-
- if (in == NULL)
- return NULL;
-
- filter = camel_mime_filter_enriched_new(flags);
-
- camel_mime_filter_complete(filter, (char *)in, strlen(in), 0, &outbuf, &outlen, &outpre);
- outbuf = g_strndup (outbuf, outlen);
- camel_object_unref (filter);
-
- return outbuf;
-}
diff --git a/camel/camel-mime-filter-enriched.h b/camel/camel-mime-filter-enriched.h
deleted file mode 100644
index 8561bd65a4..0000000000
--- a/camel/camel-mime-filter-enriched.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2002 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifndef __CAMEL_MIME_FILTER_ENRICHED_H__
-#define __CAMEL_MIME_FILTER_ENRICHED_H__
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <camel/camel-mime-filter.h>
-
-#define CAMEL_TYPE_MIME_FILTER_ENRICHED (camel_mime_filter_enriched_get_type ())
-#define CAMEL_MIME_FILTER_ENRICHED(obj) (CAMEL_CHECK_CAST (obj, CAMEL_TYPE_MIME_FILTER_ENRICHED, CamelMimeFilterEnriched))
-#define CAMEL_MIME_FILTER_ENRICHED_CLASS(klass) (CAMEL_CHECK_CLASS_CAST (klass, CAMEL_TYPE_MIME_FILTER_ENRICHED, CamelMimeFilterEnrichedClass))
-#define CAMEL_IS_MIME_FILTER_ENRICHED(obj) (CAMEL_CHECK_TYPE (obj, CAMEL_TYPE_MIME_FILTER_ENRICHED))
-
-
-#define CAMEL_MIME_FILTER_ENRICHED_IS_RICHTEXT (1 << 0)
-
-
-typedef struct _CamelMimeFilterEnriched CamelMimeFilterEnriched;
-typedef struct _CamelMimeFilterEnrichedClass CamelMimeFilterEnrichedClass;
-
-struct _CamelMimeFilterEnriched {
- CamelMimeFilter parent_object;
-
- guint32 flags;
- int nofill;
-};
-
-struct _CamelMimeFilterEnrichedClass {
- CamelMimeFilterClass parent_class;
-
-};
-
-CamelType camel_mime_filter_enriched_get_type (void);
-
-CamelMimeFilter *camel_mime_filter_enriched_new (guint32 flags);
-char *camel_enriched_to_html(const char *in, guint32 flags);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __CAMEL_MIME_FILTER_ENRICHED_H__ */
diff --git a/camel/camel-mime-filter-from.c b/camel/camel-mime-filter-from.c
deleted file mode 100644
index 092f4d3904..0000000000
--- a/camel/camel-mime-filter-from.c
+++ /dev/null
@@ -1,217 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-#include "camel-mime-filter-from.h"
-
-#define d(x)
-
-static void camel_mime_filter_from_class_init (CamelMimeFilterFromClass *klass);
-static void camel_mime_filter_from_init (CamelMimeFilterFrom *obj);
-
-static CamelMimeFilterClass *camel_mime_filter_from_parent;
-
-CamelType
-camel_mime_filter_from_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_mime_filter_get_type (), "CamelMimeFilterFrom",
- sizeof (CamelMimeFilterFrom),
- sizeof (CamelMimeFilterFromClass),
- (CamelObjectClassInitFunc) camel_mime_filter_from_class_init,
- NULL,
- (CamelObjectInitFunc) camel_mime_filter_from_init,
- NULL);
- }
-
- return type;
-}
-
-struct fromnode {
- struct fromnode *next;
- char *pointer;
-};
-
-static void
-complete(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, size_t *outlen, size_t *outprespace)
-{
- *out = in;
- *outlen = len;
- *outprespace = prespace;
-}
-
-/* Yes, it is complicated ... */
-static void
-filter(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, size_t *outlen, size_t *outprespace)
-{
- CamelMimeFilterFrom *f = (CamelMimeFilterFrom *)mf;
- register char *inptr, *inend;
- int left;
- int midline = f->midline;
- int fromcount = 0;
- struct fromnode *head = NULL, *tail = (struct fromnode *)&head, *node;
- char *outptr;
-
- inptr = in;
- inend = inptr+len;
-
- d(printf("Filtering '%.*s'\n", len, in));
-
- /* first, see if we need to escape any from's */
- while (inptr<inend) {
- register int c = -1;
-
- if (midline)
- while (inptr < inend && (c = *inptr++) != '\n')
- ;
-
- if (c == '\n' || !midline) {
- left = inend-inptr;
- if (left > 0) {
- midline = TRUE;
- if (left < 5) {
- if (inptr[0] == 'F') {
- camel_mime_filter_backup(mf, inptr, left);
- midline = FALSE;
- inend = inptr;
- break;
- }
- } else {
- if (!strncmp(inptr, "From ", 5)) {
- fromcount++;
- /* yes, we do alloc them on the stack ... at most we're going to get
- len / 7 of them anyway */
- node = alloca(sizeof(*node));
- node->pointer = inptr;
- node->next = NULL;
- tail->next = node;
- tail = node;
- inptr += 5;
- }
- }
- } else {
- /* \n is at end of line, check next buffer */
- midline = FALSE;
- }
- }
- }
-
- f->midline = midline;
-
- if (fromcount > 0) {
- camel_mime_filter_set_size(mf, len + fromcount, FALSE);
- node = head;
- inptr = in;
- outptr = mf->outbuf;
- while (node) {
- memcpy(outptr, inptr, node->pointer - inptr);
- outptr += node->pointer - inptr;
- *outptr++ = '>';
- inptr = node->pointer;
- node = node->next;
- }
- memcpy(outptr, inptr, inend - inptr);
- outptr += inend - inptr;
- *out = mf->outbuf;
- *outlen = outptr - mf->outbuf;
- *outprespace = mf->outbuf - mf->outreal;
-
- d(printf("Filtered '%.*s'\n", *outlen, *out));
- } else {
- *out = in;
- *outlen = inend - in;
- *outprespace = prespace;
-
- d(printf("Filtered '%.*s'\n", *outlen, *out));
- }
-}
-
-static void
-camel_mime_filter_from_class_init (CamelMimeFilterFromClass *klass)
-{
- CamelMimeFilterClass *filter_class = (CamelMimeFilterClass *) klass;
-
- camel_mime_filter_from_parent = CAMEL_MIME_FILTER_CLASS (camel_type_get_global_classfuncs (camel_mime_filter_get_type ()));
-
- filter_class->filter = filter;
- filter_class->complete = complete;
-}
-
-static void
-camel_mime_filter_from_init (CamelMimeFilterFrom *obj)
-{
- ;
-}
-
-/**
- * camel_mime_filter_from_new:
- *
- * Create a new CamelMimeFilterFrom object.
- *
- * Return value: A new CamelMimeFilterFrom widget.
- **/
-CamelMimeFilterFrom *
-camel_mime_filter_from_new (void)
-{
- CamelMimeFilterFrom *new = CAMEL_MIME_FILTER_FROM ( camel_object_new (camel_mime_filter_from_get_type ()));
- return new;
-}
-
-#if 0
-
-#include <stdio.h>
-
-int main(int argc, char **argv)
-{
- CamelMimeFilterFrom *f;
- char *buffer;
- int len, prespace;
-
- g_tk_init(&argc, &argv);
-
-
- f = camel_mime_filter_from_new();
-
- buffer = "This is a test\nFrom Someone\nTo someone. From Someone else, From\n From blah\nFromblah\nBye! \nFrom ";
- len = strlen(buffer);
- prespace = 0;
-
- printf("input = '%.*s'\n", len, buffer);
- camel_mime_filter_filter(f, buffer, len, prespace, &buffer, &len, &prespace);
- printf("output = '%.*s'\n", len, buffer);
- buffer = "";
- len = 0;
- prespace = 0;
- camel_mime_filter_complete(f, buffer, len, prespace, &buffer, &len, &prespace);
- printf("complete = '%.*s'\n", len, buffer);
-
-
- return 0;
-}
-
-#endif
diff --git a/camel/camel-mime-filter-from.h b/camel/camel-mime-filter-from.h
deleted file mode 100644
index b8f1bb9a4e..0000000000
--- a/camel/camel-mime-filter-from.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-
-#ifndef _CAMEL_MIME_FILTER_FROM_H
-#define _CAMEL_MIME_FILTER_FROM_H
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <camel/camel-mime-filter.h>
-
-#define CAMEL_MIME_FILTER_FROM(obj) CAMEL_CHECK_CAST (obj, camel_mime_filter_from_get_type (), CamelMimeFilterFrom)
-#define CAMEL_MIME_FILTER_FROM_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_mime_filter_from_get_type (), CamelMimeFilterFromClass)
-#define CAMEL_IS_MIME_FILTER_FROM(obj) CAMEL_CHECK_TYPE (obj, camel_mime_filter_from_get_type ())
-
-typedef struct _CamelMimeFilterFrom CamelMimeFilterFrom;
-typedef struct _CamelMimeFilterFromClass CamelMimeFilterFromClass;
-
-struct _CamelMimeFilterFrom {
- CamelMimeFilter parent;
-
- int midline; /* are we between lines? */
-};
-
-struct _CamelMimeFilterFromClass {
- CamelMimeFilterClass parent_class;
-};
-
-CamelType camel_mime_filter_from_get_type (void);
-CamelMimeFilterFrom *camel_mime_filter_from_new (void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* ! _CAMEL_MIME_FILTER_FROM_H */
diff --git a/camel/camel-mime-filter-html.c b/camel/camel-mime-filter-html.c
deleted file mode 100644
index 3a9bdaba75..0000000000
--- a/camel/camel-mime-filter-html.c
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Copyright (C) 2001 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdarg.h>
-
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdlib.h>
-
-#include "camel-mime-filter-html.h"
-#include "camel-html-parser.h"
-
-#define d(x)
-
-static void camel_mime_filter_html_class_init (CamelMimeFilterHTMLClass *klass);
-static void camel_mime_filter_html_init (CamelObject *o);
-static void camel_mime_filter_html_finalize (CamelObject *o);
-
-static CamelMimeFilterClass *camel_mime_filter_html_parent;
-
-struct _CamelMimeFilterHTMLPrivate {
- CamelHTMLParser *ctxt;
-};
-
-/* ********************************************************************** */
-
-#if 0
-
-/* well we odnt use this stuff yet */
-
-#define ARRAY_LEN(x) (sizeof(x)/sizeof((x)[0]))
-
-static struct {
- char *element;
- char *remap;
-} map_start[] = {
- { "p", "\n\n" },
- { "br", "\n" },
- { "h1", "\n" }, { "h2", "\n" }, { "h3", "\n" }, { "h4", "\n" }, { "h5", "\n" }, { "h6", "\n" },
-};
-
-
-static struct {
- char *element;
- char *remap;
-} map_end[] = {
- { "h1", "\n" }, { "h2", "\n" }, { "h3", "\n" }, { "h4", "\n" }, { "h5", "\n" }, { "h6", "\n" },
-};
-#endif
-
-
-/* ********************************************************************** */
-
-
-CamelType
-camel_mime_filter_html_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_mime_filter_get_type (), "CamelMimeFilterHTML",
- sizeof (CamelMimeFilterHTML),
- sizeof (CamelMimeFilterHTMLClass),
- (CamelObjectClassInitFunc) camel_mime_filter_html_class_init,
- NULL,
- (CamelObjectInitFunc) camel_mime_filter_html_init,
- (CamelObjectFinalizeFunc) camel_mime_filter_html_finalize);
- }
-
- return type;
-}
-
-static void
-camel_mime_filter_html_finalize(CamelObject *o)
-{
- CamelMimeFilterHTML *f = (CamelMimeFilterHTML *)o;
-
- camel_object_unref((CamelObject *)f->priv->ctxt);
- g_free(f->priv);
-}
-
-static void
-camel_mime_filter_html_init (CamelObject *o)
-{
- CamelMimeFilterHTML *f = (CamelMimeFilterHTML *)o;
-
- f->priv = g_malloc0(sizeof(*f->priv));
- f->priv->ctxt = camel_html_parser_new();
-}
-
-static void
-run(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, size_t *outlenptr, size_t *outprespace, int last)
-{
- camel_html_parser_t state;
- char *outp;
- CamelMimeFilterHTML *f = (CamelMimeFilterHTML *)mf;
-
- d(printf("converting html:\n%.*s\n", (int)len, in));
-
- /* We should generally shrink the data, but this'll do */
- camel_mime_filter_set_size(mf, len*2+256, FALSE);
- outp = mf->outbuf;
-
- camel_html_parser_set_data(f->priv->ctxt, in, len, last);
- do {
- const char *data;
- int len;
-
- state = camel_html_parser_step(f->priv->ctxt, &data, &len);
-
- switch(state) {
- case CAMEL_HTML_PARSER_DATA:
- case CAMEL_HTML_PARSER_ENT:
- memcpy(outp, data, len);
- outp += len;
- break;
- case CAMEL_HTML_PARSER_ELEMENT:
- /* FIXME: do some whitespace processing here */
- break;
- default:
- /* ignore everything else */
- break;
- }
- } while (state != CAMEL_HTML_PARSER_EOF && state != CAMEL_HTML_PARSER_EOD);
-
- *out = mf->outbuf;
- *outlenptr = outp - mf->outbuf;
- *outprespace = mf->outbuf - mf->outreal;
-
- d(printf("converted html end:\n%.*s\n", (int)*outlenptr, *out));
-}
-
-static void
-complete(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, size_t *outlenptr, size_t *outprespace)
-{
- run(mf, in, len, prespace, out, outlenptr, outprespace, TRUE);
-}
-
-static void
-filter(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, size_t *outlenptr, size_t *outprespace)
-{
- run(mf, in, len, prespace, out, outlenptr, outprespace, FALSE);
-}
-
-static void
-reset(CamelMimeFilter *mf)
-{
- CamelMimeFilterHTML *f = (CamelMimeFilterHTML *)mf;
-
- camel_object_unref((CamelObject *)f->priv->ctxt);
- f->priv->ctxt = camel_html_parser_new();
-}
-
-static void
-camel_mime_filter_html_class_init (CamelMimeFilterHTMLClass *klass)
-{
- CamelMimeFilterClass *filter_class = (CamelMimeFilterClass *) klass;
-
- camel_mime_filter_html_parent = CAMEL_MIME_FILTER_CLASS (camel_type_get_global_classfuncs (camel_mime_filter_get_type ()));
-
- filter_class->reset = reset;
- filter_class->filter = filter;
- filter_class->complete = complete;
-}
-
-/**
- * camel_mime_filter_html_new:
- *
- * Create a new CamelMimeFilterHTML object.
- *
- * Return value: A new CamelMimeFilterHTML widget.
- **/
-CamelMimeFilterHTML *
-camel_mime_filter_html_new (void)
-{
- CamelMimeFilterHTML *new = CAMEL_MIME_FILTER_HTML ( camel_object_new (camel_mime_filter_html_get_type ()));
- return new;
-}
diff --git a/camel/camel-mime-filter-html.h b/camel/camel-mime-filter-html.h
deleted file mode 100644
index bb9b6aaa4e..0000000000
--- a/camel/camel-mime-filter-html.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2001 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-
-#ifndef _CAMEL_MIME_FILTER_HTML_H
-#define _CAMEL_MIME_FILTER_HTML_H
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <camel/camel-mime-filter.h>
-
-#define CAMEL_MIME_FILTER_HTML(obj) CAMEL_CHECK_CAST (obj, camel_mime_filter_html_get_type (), CamelMimeFilterHTML)
-#define CAMEL_MIME_FILTER_HTML_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_mime_filter_html_get_type (), CamelMimeFilterHTMLClass)
-#define CAMEL_IS_MIME_FILTER_HTML(obj) CAMEL_CHECK_TYPE (obj, camel_mime_filter_html_get_type ())
-
-typedef struct _CamelMimeFilterHTMLClass CamelMimeFilterHTMLClass;
-typedef struct _CamelMimeFilterHTML CamelMimeFilterHTML;
-
-struct _CamelMimeFilterHTML {
- CamelMimeFilter parent;
-
- struct _CamelMimeFilterHTMLPrivate *priv;
-};
-
-struct _CamelMimeFilterHTMLClass {
- CamelMimeFilterClass parent_class;
-};
-
-CamelType camel_mime_filter_html_get_type (void);
-CamelMimeFilterHTML *camel_mime_filter_html_new (void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* ! _CAMEL_MIME_FILTER_HTML_H */
diff --git a/camel/camel-mime-filter-index.c b/camel/camel-mime-filter-index.c
deleted file mode 100644
index 6648abf860..0000000000
--- a/camel/camel-mime-filter-index.c
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include "camel-mime-filter-index.h"
-
-#include "camel-text-index.h"
-
-static void camel_mime_filter_index_class_init (CamelMimeFilterIndexClass *klass);
-static void camel_mime_filter_index_finalize (CamelObject *o);
-
-static CamelMimeFilterClass *camel_mime_filter_index_parent;
-
-CamelType
-camel_mime_filter_index_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_mime_filter_get_type (), "CamelMimeFilterIndex",
- sizeof (CamelMimeFilterIndex),
- sizeof (CamelMimeFilterIndexClass),
- (CamelObjectClassInitFunc) camel_mime_filter_index_class_init,
- NULL,
- NULL,
- (CamelObjectFinalizeFunc) camel_mime_filter_index_finalize);
- }
-
- return type;
-}
-
-static void
-camel_mime_filter_index_finalize(CamelObject *o)
-{
- CamelMimeFilterIndex *f = (CamelMimeFilterIndex *)o;
-
- if (f->name)
- camel_object_unref((CamelObject *)f->name);
- camel_object_unref((CamelObject *)f->index);
-}
-
-static void
-complete(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, size_t *outlenptr, size_t *outprespace)
-{
- CamelMimeFilterIndex *f = (CamelMimeFilterIndex *)mf;
-
- if (f->index == NULL || f->name==NULL) {
- goto donothing;
- }
-
- camel_index_name_add_buffer(f->name, in, len);
- camel_index_name_add_buffer(f->name, NULL, 0);
-
-donothing:
- *out = in;
- *outlenptr = len;
- *outprespace = prespace;
-}
-
-static void
-filter(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, size_t *outlenptr, size_t *outprespace)
-{
- CamelMimeFilterIndex *f = (CamelMimeFilterIndex *)mf;
-
- if (f->index == NULL || f->name==NULL) {
- goto donothing;
- }
-
- camel_index_name_add_buffer(f->name, in, len);
-
-donothing:
- *out = in;
- *outlenptr = len;
- *outprespace = prespace;
-}
-
-static void
-camel_mime_filter_index_class_init (CamelMimeFilterIndexClass *klass)
-{
- CamelMimeFilterClass *filter_class = (CamelMimeFilterClass *) klass;
-
- camel_mime_filter_index_parent = CAMEL_MIME_FILTER_CLASS (camel_type_get_global_classfuncs (camel_mime_filter_get_type ()));
-
- /*filter_class->reset = reset;*/
- filter_class->filter = filter;
- filter_class->complete = complete;
-}
-
-/**
- * camel_mime_filter_index_new:
- *
- * Create a new CamelMimeFilterIndex object.
- *
- * Return value: A new CamelMimeFilterIndex widget.
- **/
-CamelMimeFilterIndex *
-camel_mime_filter_index_new (void)
-{
- CamelMimeFilterIndex *new = CAMEL_MIME_FILTER_INDEX ( camel_object_new (camel_mime_filter_index_get_type ()));
- return new;
-}
-
-CamelMimeFilterIndex *camel_mime_filter_index_new_index (struct _CamelIndex *index)
-{
- CamelMimeFilterIndex *new = camel_mime_filter_index_new();
-
- if (new) {
- new->index = index;
- if (index)
- camel_object_ref((CamelObject *)index);
- }
- return new;
-}
-
-/* Set the match name for any indexed words */
-void camel_mime_filter_index_set_name (CamelMimeFilterIndex *mf, struct _CamelIndexName *name)
-{
- if (mf->name)
- camel_object_unref((CamelObject *)mf->name);
- mf->name = name;
- if (name)
- camel_object_ref((CamelObject *)name);
-}
-
-void camel_mime_filter_index_set_index (CamelMimeFilterIndex *mf, CamelIndex *index)
-{
- if (mf->index) {
- char *out;
- size_t outlen, outspace;
-
- camel_mime_filter_complete((CamelMimeFilter *)mf, "", 0, 0, &out, &outlen, &outspace);
- camel_object_unref ((CamelObject *)index);
- }
-
- mf->index = index;
- if (index)
- camel_object_ref((CamelObject *)index);
-}
-
-
-
diff --git a/camel/camel-mime-filter-index.h b/camel/camel-mime-filter-index.h
deleted file mode 100644
index 3bb1bd532c..0000000000
--- a/camel/camel-mime-filter-index.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-
-#ifndef _CAMEL_MIME_FILTER_INDEX_H
-#define _CAMEL_MIME_FILTER_INDEX_H
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <camel/camel-mime-filter.h>
-
-#define CAMEL_MIME_FILTER_INDEX(obj) CAMEL_CHECK_CAST (obj, camel_mime_filter_index_get_type (), CamelMimeFilterIndex)
-#define CAMEL_MIME_FILTER_INDEX_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_mime_filter_index_get_type (), CamelMimeFilterIndexClass)
-#define CAMEL_IS_MIME_FILTER_INDEX(obj) CAMEL_CHECK_TYPE (obj, camel_mime_filter_index_get_type ())
-
-typedef struct _CamelMimeFilterIndexClass CamelMimeFilterIndexClass;
-
-struct _CamelMimeFilterIndex {
- CamelMimeFilter parent;
-
- struct _CamelMimeFilterIndexPrivate *priv;
-
- struct _CamelIndex *index;
- struct _CamelIndexName *name;
-};
-
-struct _CamelMimeFilterIndexClass {
- CamelMimeFilterClass parent_class;
-};
-
-CamelType camel_mime_filter_index_get_type (void);
-CamelMimeFilterIndex *camel_mime_filter_index_new (void);
-
-CamelMimeFilterIndex *camel_mime_filter_index_new_index(struct _CamelIndex *);
-
-/* Set the match name for any indexed words */
-void camel_mime_filter_index_set_name (CamelMimeFilterIndex *, struct _CamelIndexName *name);
-void camel_mime_filter_index_set_index (CamelMimeFilterIndex *mf, struct _CamelIndex *index);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* ! _CAMEL_MIME_FILTER_INDEX_H */
diff --git a/camel/camel-mime-filter-linewrap.c b/camel/camel-mime-filter-linewrap.c
deleted file mode 100644
index c9a741dacf..0000000000
--- a/camel/camel-mime-filter-linewrap.c
+++ /dev/null
@@ -1,147 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2000 Ximian, Inc.
- *
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <ctype.h>
-
-#include "camel-mime-filter-linewrap.h"
-
-
-static void filter (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace);
-static void complete (CamelMimeFilter *f, char *in, size_t len,
- size_t prespace, char **out, size_t *outlen,
- size_t *outprespace);
-static void reset (CamelMimeFilter *f);
-
-
-static void
-camel_mime_filter_linewrap_class_init (CamelMimeFilterLinewrapClass *klass)
-{
- CamelMimeFilterClass *mime_filter_class =
- (CamelMimeFilterClass *) klass;
-
- mime_filter_class->filter = filter;
- mime_filter_class->complete = complete;
- mime_filter_class->reset = reset;
-}
-
-CamelType
-camel_mime_filter_linewrap_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_mime_filter_get_type(), "CamelMimeFilterLinewrap",
- sizeof (CamelMimeFilterLinewrap),
- sizeof (CamelMimeFilterLinewrapClass),
- (CamelObjectClassInitFunc) camel_mime_filter_linewrap_class_init,
- NULL,
- NULL,
- NULL);
- }
-
- return type;
-}
-
-static void
-filter (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace)
-{
- CamelMimeFilterLinewrap *linewrap = (CamelMimeFilterLinewrap *)f;
- char *inend, *last, *p, *q;
- int nchars = linewrap->nchars;
-
- /* we'll be adding chars here so we need a bigger buffer */
- camel_mime_filter_set_size (f, 3 * len, FALSE);
-
- p = in;
- q = f->outbuf;
- inend = in + len;
-
- while (p < inend) {
- if (*p == '\n') {
- last = q;
- *q++ = *p++;
- nchars = 0;
- } else if (isspace (*p)) {
- last = q;
-
- if (nchars >= linewrap->wrap_len) {
- *q++ = '\n';
- p++;
- nchars = 0;
- } else {
- *q++ = *p++;
- }
- } else {
- *q++ = *p++;
- nchars++;
- }
-
- /* line is getting way too long, we must force a wrap here */
- if (nchars >= (linewrap->max_len - 1) && *p != '\n') {
- *q++ = '\n';
- *q++ = linewrap->indent;
- nchars = 0;
- }
- }
-
- linewrap->nchars = nchars;
-
- *out = f->outbuf;
- *outlen = q - f->outbuf;
- *outprespace = f->outpre;
-}
-
-static void
-complete (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace)
-{
- if (len)
- filter (f, in, len, prespace, out, outlen, outprespace);
-}
-
-static void
-reset (CamelMimeFilter *f)
-{
- CamelMimeFilterLinewrap *linewrap = (CamelMimeFilterLinewrap *)f;
-
- linewrap->nchars = 0;
-}
-
-CamelMimeFilter *
-camel_mime_filter_linewrap_new (guint preferred_len, guint max_len, char indent_char)
-{
- CamelMimeFilterLinewrap *linewrap =
- CAMEL_MIME_FILTER_LINEWRAP (camel_object_new (CAMEL_MIME_FILTER_LINEWRAP_TYPE));
-
- linewrap->indent = indent_char;
- linewrap->wrap_len = preferred_len;
- linewrap->max_len = max_len;
- linewrap->nchars = 0;
-
- return (CamelMimeFilter *) linewrap;
-}
diff --git a/camel/camel-mime-filter-linewrap.h b/camel/camel-mime-filter-linewrap.h
deleted file mode 100644
index 1d6f444da4..0000000000
--- a/camel/camel-mime-filter-linewrap.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef _CAMEL_MIME_FILTER_LINEWRAP_H
-#define _CAMEL_MIME_FILTER_LINEWRAP_H
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <camel/camel-mime-filter.h>
-
-#define CAMEL_MIME_FILTER_LINEWRAP_TYPE (camel_mime_filter_linewrap_get_type ())
-#define CAMEL_MIME_FILTER_LINEWRAP(obj) CAMEL_CHECK_CAST (obj, CAMEL_MIME_FILTER_LINEWRAP_TYPE, CamelMimeFilterLinewrap)
-#define CAMEL_MIME_FILTER_LINEWRAP_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, CAMEL_MIME_FILTER_LINEWRAP_TYPE, CamelMimeFilterLinewrapClass)
-#define CAMEL_IS_MIME_FILTER_LINEWRAP(obj) CAMEL_CHECK_TYPE (obj, CAMEL_MIME_FILTER_LINEWRAP_TYPE)
-
-typedef struct _CamelMimeFilterLinewrapClass CamelMimeFilterLinewrapClass;
-
-struct _CamelMimeFilterLinewrap {
- CamelMimeFilter parent;
-
- guint wrap_len;
- guint max_len;
- char indent;
- int nchars;
-};
-
-struct _CamelMimeFilterLinewrapClass {
- CamelMimeFilterClass parent_class;
-};
-
-CamelType camel_mime_filter_linewrap_get_type (void);
-
-CamelMimeFilter *camel_mime_filter_linewrap_new (guint preferred_len, guint max_len, char indent_char);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* ! _CAMEL_MIME_FILTER_LINEWRAP_H */
diff --git a/camel/camel-mime-filter-save.c b/camel/camel-mime-filter-save.c
deleted file mode 100644
index 3c6bf4b8a3..0000000000
--- a/camel/camel-mime-filter-save.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2002 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifndef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "camel-mime-filter-save.h"
-#include "camel-stream-mem.h"
-
-static void filter (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace);
-static void complete (CamelMimeFilter *f, char *in, size_t len,
- size_t prespace, char **out, size_t *outlen,
- size_t *outprespace);
-static void reset (CamelMimeFilter *f);
-
-
-static void
-camel_mime_filter_save_class_init (CamelMimeFilterSaveClass *klass)
-{
- CamelMimeFilterClass *mime_filter_class =
- (CamelMimeFilterClass *) klass;
-
- mime_filter_class->filter = filter;
- mime_filter_class->complete = complete;
- mime_filter_class->reset = reset;
-}
-
-CamelType
-camel_mime_filter_save_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_mime_filter_get_type(), "CamelMimeFilterSave",
- sizeof (CamelMimeFilterSave),
- sizeof (CamelMimeFilterSaveClass),
- (CamelObjectClassInitFunc) camel_mime_filter_save_class_init,
- NULL,
- NULL,
- NULL);
- }
-
- return type;
-}
-
-static void
-filter (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace)
-{
- CamelMimeFilterSave *save = (CamelMimeFilterSave *) f;
-
- if (save->stream)
- camel_stream_write (save->stream, in, len);
-
- *out = in;
- *outlen = len;
- *outprespace = f->outpre;
-}
-
-static void
-complete (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace)
-{
- if (len)
- filter (f, in, len, prespace, out, outlen, outprespace);
-}
-
-static void
-reset (CamelMimeFilter *f)
-{
- /* no-op */
-}
-
-CamelMimeFilter *
-camel_mime_filter_save_new (void)
-{
- CamelMimeFilterSave *save = CAMEL_MIME_FILTER_SAVE (camel_object_new (CAMEL_MIME_FILTER_SAVE_TYPE));
-
- save->stream = camel_stream_mem_new ();
-
- return (CamelMimeFilter *) save;
-}
-
-CamelMimeFilter *
-camel_mime_filter_save_new_with_stream (CamelStream *stream)
-{
- CamelMimeFilterSave *save = CAMEL_MIME_FILTER_SAVE (camel_object_new (CAMEL_MIME_FILTER_SAVE_TYPE));
-
- save->stream = stream;
- camel_object_ref (stream);
-
- return (CamelMimeFilter *) save;
-}
diff --git a/camel/camel-mime-filter-save.h b/camel/camel-mime-filter-save.h
deleted file mode 100644
index 20ebbea6f4..0000000000
--- a/camel/camel-mime-filter-save.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2002 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifndef __CAMEL_MIME_FILTER_SAVE_H__
-#define __CAMEL_MIME_FILTER_SAVE_H__
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <camel/camel-mime-filter.h>
-#include <camel/camel-seekable-stream.h>
-
-#define CAMEL_MIME_FILTER_SAVE_TYPE (camel_mime_filter_save_get_type ())
-#define CAMEL_MIME_FILTER_SAVE(obj) CAMEL_CHECK_CAST (obj, camel_mime_filter_save_get_type (), CamelMimeFilterSave)
-#define CAMEL_MIME_FILTER_SAVE_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_mime_filter_save_get_type (), CamelMimeFilterSaveClass)
-#define CAMEL_IS_MIME_FILTER_SAVE(obj) CAMEL_CHECK_TYPE (obj, camel_mime_filter_save_get_type ())
-
-typedef struct _CamelMimeFilterSaveClass CamelMimeFilterSaveClass;
-
-struct _CamelMimeFilterSave {
- CamelMimeFilter parent;
-
- CamelStream *stream;
-};
-
-struct _CamelMimeFilterSaveClass {
- CamelMimeFilterClass parent_class;
-};
-
-CamelType camel_mime_filter_save_get_type (void);
-
-CamelMimeFilter *camel_mime_filter_save_new (void);
-CamelMimeFilter *camel_mime_filter_save_new_with_stream (CamelStream *stream);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __CAMEL_MIME_FILTER_SAVE_H__ */
diff --git a/camel/camel-mime-filter-tohtml.c b/camel/camel-mime-filter-tohtml.c
deleted file mode 100644
index 678d8005f4..0000000000
--- a/camel/camel-mime-filter-tohtml.c
+++ /dev/null
@@ -1,447 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2001 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <string.h>
-
-#include "camel-url-scanner.h"
-#include "camel-mime-filter-tohtml.h"
-#include "camel-utf8.h"
-
-/**
- * TODO: convert common text/plain 'markup' to html. eg.:
- *
- * _word_ -> <u>_word_</u>
- * *word* -> <b>*word*</b>
- * /word/ -> <i>/word/</i>
- **/
-
-#define d(x)
-
-#define CONVERT_WEB_URLS CAMEL_MIME_FILTER_TOHTML_CONVERT_URLS
-#define CONVERT_ADDRSPEC CAMEL_MIME_FILTER_TOHTML_CONVERT_ADDRESSES
-
-static struct {
- unsigned int mask;
- urlpattern_t pattern;
-} patterns[] = {
- { CONVERT_WEB_URLS, { "file://", "", camel_url_file_start, camel_url_file_end } },
- { CONVERT_WEB_URLS, { "ftp://", "", camel_url_web_start, camel_url_web_end } },
- { CONVERT_WEB_URLS, { "http://", "", camel_url_web_start, camel_url_web_end } },
- { CONVERT_WEB_URLS, { "https://", "", camel_url_web_start, camel_url_web_end } },
- { CONVERT_WEB_URLS, { "news://", "", camel_url_web_start, camel_url_web_end } },
- { CONVERT_WEB_URLS, { "nntp://", "", camel_url_web_start, camel_url_web_end } },
- { CONVERT_WEB_URLS, { "telnet://", "", camel_url_web_start, camel_url_web_end } },
- { CONVERT_WEB_URLS, { "www.", "http://", camel_url_web_start, camel_url_web_end } },
- { CONVERT_WEB_URLS, { "ftp.", "ftp://", camel_url_web_start, camel_url_web_end } },
- { CONVERT_ADDRSPEC, { "@", "mailto:", camel_url_addrspec_start, camel_url_addrspec_end } },
-};
-
-#define NUM_URL_PATTERNS (sizeof (patterns) / sizeof (patterns[0]))
-
-static void camel_mime_filter_tohtml_class_init (CamelMimeFilterToHTMLClass *klass);
-static void camel_mime_filter_tohtml_init (CamelMimeFilterToHTML *filter);
-static void camel_mime_filter_tohtml_finalize (CamelObject *obj);
-
-static CamelMimeFilterClass *camel_mime_filter_tohtml_parent;
-
-
-CamelType
-camel_mime_filter_tohtml_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_mime_filter_get_type (),
- "CamelMimeFilterToHTML",
- sizeof (CamelMimeFilterToHTML),
- sizeof (CamelMimeFilterToHTMLClass),
- (CamelObjectClassInitFunc) camel_mime_filter_tohtml_class_init,
- NULL,
- (CamelObjectInitFunc) camel_mime_filter_tohtml_init,
- (CamelObjectFinalizeFunc) camel_mime_filter_tohtml_finalize);
- }
-
- return type;
-}
-
-static void
-camel_mime_filter_tohtml_finalize (CamelObject *obj)
-{
- CamelMimeFilterToHTML *filter = (CamelMimeFilterToHTML *) obj;
-
- camel_url_scanner_free (filter->scanner);
-}
-
-static void
-camel_mime_filter_tohtml_init (CamelMimeFilterToHTML *filter)
-{
- filter->scanner = camel_url_scanner_new ();
-
- filter->flags = 0;
- filter->colour = 0;
- filter->column = 0;
- filter->pre_open = FALSE;
-}
-
-
-static char *
-check_size (CamelMimeFilter *filter, char *outptr, char **outend, size_t len)
-{
- size_t offset;
-
- if (*outend - outptr >= len)
- return outptr;
-
- offset = outptr - filter->outbuf;
-
- camel_mime_filter_set_size (filter, filter->outsize + len, TRUE);
-
- *outend = filter->outbuf + filter->outsize;
-
- return filter->outbuf + offset;
-}
-
-static int
-citation_depth (const char *in)
-{
- register const char *inptr = in;
- int depth = 1;
-
- if (*inptr++ != '>')
- return 0;
-
- /* check that it isn't an escaped From line */
- if (!strncmp (inptr, "From", 4))
- return 0;
-
- while (*inptr != '\n') {
- if (*inptr == ' ')
- inptr++;
-
- if (*inptr++ != '>')
- break;
-
- depth++;
- }
-
- return depth;
-}
-
-static char *
-writeln (CamelMimeFilter *filter, const char *in, const char *inend, char *outptr, char **outend)
-{
- CamelMimeFilterToHTML *html = (CamelMimeFilterToHTML *) filter;
- const char *inptr = in;
-
- while (inptr < inend) {
- guint32 u;
-
- outptr = check_size (filter, outptr, outend, 16);
-
- u = camel_utf8_getc_limit ((const unsigned char **) &inptr, inend);
- switch (u) {
- case 0xffff:
- g_warning("Truncated utf8 buffer");
- return outptr;
- case '<':
- outptr = g_stpcpy (outptr, "&lt;");
- html->column++;
- break;
- case '>':
- outptr = g_stpcpy (outptr, "&gt;");
- html->column++;
- break;
- case '&':
- outptr = g_stpcpy (outptr, "&amp;");
- html->column++;
- break;
- case '"':
- outptr = g_stpcpy (outptr, "&quot;");
- html->column++;
- break;
- case '\t':
- if (html->flags & (CAMEL_MIME_FILTER_TOHTML_CONVERT_SPACES)) {
- do {
- outptr = check_size (filter, outptr, outend, 7);
- outptr = g_stpcpy (outptr, "&nbsp;");
- html->column++;
- } while (html->column % 8);
- break;
- }
- /* otherwise, FALL THROUGH */
- case ' ':
- if (html->flags & CAMEL_MIME_FILTER_TOHTML_CONVERT_SPACES
- && ((inptr == (in + 1) || *inptr == ' ' || *inptr == '\t'))) {
- outptr = g_stpcpy (outptr, "&nbsp;");
- html->column++;
- break;
- }
- /* otherwise, FALL THROUGH */
- default:
- if (u >= 20 && u <0x80)
- *outptr++ = u;
- else {
- if (html->flags & CAMEL_MIME_FILTER_TOHTML_ESCAPE_8BIT)
- *outptr++ = '?';
- else
- outptr += sprintf(outptr, "&#%u;", u);
- }
- html->column++;
- break;
- }
- }
-
- return outptr;
-}
-
-static void
-html_convert (CamelMimeFilter *filter, char *in, size_t inlen, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace, gboolean flush)
-{
- CamelMimeFilterToHTML *html = (CamelMimeFilterToHTML *) filter;
- register char *inptr, *outptr;
- char *start, *outend;
- const char *inend;
- int depth;
-
- if (inlen == 0) {
- *out = in;
- *outlen = 0;
- *outprespace = 0;
-
- return;
- }
-
- camel_mime_filter_set_size (filter, inlen * 2 + 6, FALSE);
-
- inptr = in;
- inend = in + inlen;
- outptr = filter->outbuf;
- outend = filter->outbuf + filter->outsize;
-
- if (html->flags & CAMEL_MIME_FILTER_TOHTML_PRE && !html->pre_open) {
- outptr = g_stpcpy (outptr, "<pre>");
- html->pre_open = TRUE;
- }
-
- start = inptr;
- do {
- while (inptr < inend && *inptr != '\n')
- inptr++;
-
- if (inptr >= inend && !flush)
- break;
-
- html->column = 0;
- depth = 0;
-
- if (html->flags & CAMEL_MIME_FILTER_TOHTML_MARK_CITATION) {
- if ((depth = citation_depth (start)) > 0) {
- /* FIXME: we could easily support multiple colour depths here */
-
- outptr = check_size (filter, outptr, &outend, 25);
- outptr += sprintf(outptr, "<font color=\"#%06x\">", (html->colour & 0xffffff));
- } else if (*start == '>') {
- /* >From line */
- start++;
- }
- } else if (html->flags & CAMEL_MIME_FILTER_TOHTML_CITE) {
- outptr = check_size (filter, outptr, &outend, 6);
- outptr = g_stpcpy (outptr, "&gt; ");
- html->column += 2;
- }
-
-#define CONVERT_URLS (CAMEL_MIME_FILTER_TOHTML_CONVERT_URLS | CAMEL_MIME_FILTER_TOHTML_CONVERT_ADDRESSES)
- if (html->flags & CONVERT_URLS) {
- size_t matchlen, buflen, len;
- urlmatch_t match;
-
- len = inptr - start;
-
- do {
- if (camel_url_scanner_scan (html->scanner, start, len, &match)) {
- /* write out anything before the first regex match */
- outptr = writeln (filter, start, start + match.um_so,
- outptr, &outend);
-
- start += match.um_so;
- len -= match.um_so;
-
- matchlen = match.um_eo - match.um_so;
-
- buflen = 20 + strlen (match.prefix) + matchlen + matchlen;
- outptr = check_size (filter, outptr, &outend, buflen);
-
- /* write out the href tag */
- outptr = g_stpcpy (outptr, "<a href=\"");
- outptr = g_stpcpy (outptr, match.prefix);
- memcpy (outptr, start, matchlen);
- outptr += matchlen;
- outptr = g_stpcpy (outptr, "\">");
-
- /* now write the matched string */
- memcpy (outptr, start, matchlen);
- html->column += matchlen;
- outptr += matchlen;
- start += matchlen;
- len -= matchlen;
-
- /* close the href tag */
- outptr = g_stpcpy (outptr, "</a>");
- } else {
- /* nothing matched so write out the remainder of this line buffer */
- outptr = writeln (filter, start, start + len, outptr, &outend);
- break;
- }
- } while (len > 0);
- } else {
- outptr = writeln (filter, start, inptr, outptr, &outend);
- }
-
- if ((html->flags & CAMEL_MIME_FILTER_TOHTML_MARK_CITATION) && depth > 0) {
- outptr = check_size (filter, outptr, &outend, 8);
- outptr = g_stpcpy (outptr, "</font>");
- }
-
- if (inptr < inend) {
- if (html->flags & CAMEL_MIME_FILTER_TOHTML_CONVERT_NL) {
- outptr = check_size (filter, outptr, &outend, 5);
- outptr = g_stpcpy (outptr, "<br>");
- }
-
- *outptr++ = '\n';
- }
-
- start = ++inptr;
- } while (inptr < inend);
-
- if (flush) {
- /* flush the rest of our input buffer */
- if (start < inend)
- outptr = writeln (filter, start, inend, outptr, &outend);
-
- if (html->pre_open) {
- /* close the pre-tag */
- outptr = check_size (filter, outptr, &outend, 10);
- outptr = g_stpcpy (outptr, "</pre>");
- }
- } else if (start < inend) {
- /* backup */
- camel_mime_filter_backup (filter, start, (unsigned) (inend - start));
- }
-
- *out = filter->outbuf;
- *outlen = outptr - filter->outbuf;
- *outprespace = filter->outpre;
-}
-
-static void
-filter_filter (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace)
-{
- html_convert (filter, in, len, prespace, out, outlen, outprespace, FALSE);
-}
-
-static void
-filter_complete (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace)
-{
- html_convert (filter, in, len, prespace, out, outlen, outprespace, TRUE);
-}
-
-static void
-filter_reset (CamelMimeFilter *filter)
-{
- CamelMimeFilterToHTML *html = (CamelMimeFilterToHTML *) filter;
-
- html->column = 0;
- html->pre_open = FALSE;
-}
-
-static void
-camel_mime_filter_tohtml_class_init (CamelMimeFilterToHTMLClass *klass)
-{
- CamelMimeFilterClass *filter_class = (CamelMimeFilterClass *) klass;
-
- camel_mime_filter_tohtml_parent = CAMEL_MIME_FILTER_CLASS (camel_type_get_global_classfuncs (camel_mime_filter_get_type ()));
-
- filter_class->reset = filter_reset;
- filter_class->filter = filter_filter;
- filter_class->complete = filter_complete;
-}
-
-
-/**
- * camel_mime_filter_tohtml_new:
- * @flags:
- * @colour:
- *
- * Creates a new CamelMimeFilterToHTML object.
- *
- * Returns a new CamelMimeFilter object.
- **/
-CamelMimeFilter *
-camel_mime_filter_tohtml_new (guint32 flags, guint32 colour)
-{
- CamelMimeFilterToHTML *new;
- int i;
-
- new = CAMEL_MIME_FILTER_TOHTML (camel_object_new (camel_mime_filter_tohtml_get_type ()));
-
- new->flags = flags;
- new->colour = colour;
-
- for (i = 0; i < NUM_URL_PATTERNS; i++) {
- if (patterns[i].mask & flags)
- camel_url_scanner_add (new->scanner, &patterns[i].pattern);
- }
-
- return CAMEL_MIME_FILTER (new);
-}
-
-
-char *
-camel_text_to_html (const char *in, guint32 flags, guint32 colour)
-{
- CamelMimeFilter *filter;
- size_t outlen, outpre;
- char *outbuf;
-
- g_return_val_if_fail (in != NULL, NULL);
-
- filter = camel_mime_filter_tohtml_new (flags, colour);
-
- camel_mime_filter_complete (filter, (char *) in, strlen (in), 0,
- &outbuf, &outlen, &outpre);
-
- outbuf = g_strndup (outbuf, outlen);
-
- camel_object_unref (filter);
-
- return outbuf;
-}
diff --git a/camel/camel-mime-filter-tohtml.h b/camel/camel-mime-filter-tohtml.h
deleted file mode 100644
index de8690a1e0..0000000000
--- a/camel/camel-mime-filter-tohtml.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2001 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifndef __CAMEL_MIME_FILTER_TOHTML_H__
-#define __CAMEL_MIME_FILTER_TOHTML_H__
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <camel/camel-mime-filter.h>
-
-#define CAMEL_MIME_FILTER_TOHTML(obj) CAMEL_CHECK_CAST (obj, camel_mime_filter_tohtml_get_type (), CamelMimeFilterToHTML)
-#define CAMEL_MIME_FILTER_TOHTML_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_mime_filter_tohtml_get_type (), CamelMimeFilterToHTMLClass)
-#define CAMEL_IS_MIME_FILTER_TOHTML(obj) CAMEL_CHECK_TYPE (obj, camel_mime_filter_tohtml_get_type ())
-
-#define CAMEL_MIME_FILTER_TOHTML_PRE (1 << 0)
-#define CAMEL_MIME_FILTER_TOHTML_CONVERT_NL (1 << 1)
-#define CAMEL_MIME_FILTER_TOHTML_CONVERT_SPACES (1 << 2)
-#define CAMEL_MIME_FILTER_TOHTML_CONVERT_URLS (1 << 3)
-#define CAMEL_MIME_FILTER_TOHTML_MARK_CITATION (1 << 4)
-#define CAMEL_MIME_FILTER_TOHTML_CONVERT_ADDRESSES (1 << 5)
-#define CAMEL_MIME_FILTER_TOHTML_ESCAPE_8BIT (1 << 6)
-#define CAMEL_MIME_FILTER_TOHTML_CITE (1 << 7)
-#define CAMEL_MIME_FILTER_TOHTML_PRESERVE_8BIT (1 << 8)
-#define CAMEL_MIME_FILTER_TOHTML_FORMAT_FLOWED (1 << 9)
-
-typedef struct _CamelMimeFilterToHTMLClass CamelMimeFilterToHTMLClass;
-typedef struct _CamelMimeFilterToHTML CamelMimeFilterToHTML;
-
-struct _CamelMimeFilterToHTML {
- CamelMimeFilter parent;
-
- struct _CamelUrlScanner *scanner;
-
- guint32 flags;
- guint32 colour;
-
- guint32 column : 31;
- guint32 pre_open : 1;
-};
-
-struct _CamelMimeFilterToHTMLClass {
- CamelMimeFilterClass parent_class;
-};
-
-
-CamelType camel_mime_filter_tohtml_get_type (void);
-
-CamelMimeFilter *camel_mime_filter_tohtml_new (guint32 flags, guint32 colour);
-
-
-/* utility functions to replace e_text_to_html shit */
-
-char *camel_text_to_html (const char *in, guint32 flags, guint32 colour);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __CAMEL_MIME_FILTER_TOHTML_H__ */
diff --git a/camel/camel-mime-filter-windows.c b/camel/camel-mime-filter-windows.c
deleted file mode 100644
index 0b6e00dea0..0000000000
--- a/camel/camel-mime-filter-windows.c
+++ /dev/null
@@ -1,180 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2002 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-
-#include "camel-mime-filter-windows.h"
-
-#include "camel-charset-map.h"
-
-#define d(x)
-
-static void camel_mime_filter_windows_class_init (CamelMimeFilterWindowsClass *klass);
-static void camel_mime_filter_windows_init (CamelObject *o);
-static void camel_mime_filter_windows_finalize (CamelObject *o);
-
-
-static CamelMimeFilterClass *parent_class = NULL;
-
-
-CamelType
-camel_mime_filter_windows_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_mime_filter_get_type (),
- "CamelMimeFilterWindows",
- sizeof (CamelMimeFilterWindows),
- sizeof (CamelMimeFilterWindowsClass),
- (CamelObjectClassInitFunc) camel_mime_filter_windows_class_init,
- NULL,
- (CamelObjectInitFunc) camel_mime_filter_windows_init,
- (CamelObjectFinalizeFunc) camel_mime_filter_windows_finalize);
- }
-
- return type;
-}
-
-static void
-camel_mime_filter_windows_finalize (CamelObject *o)
-{
- CamelMimeFilterWindows *windows = (CamelMimeFilterWindows *) o;
-
- g_free (windows->claimed_charset);
-}
-
-static void
-camel_mime_filter_windows_init (CamelObject *o)
-{
- CamelMimeFilterWindows *windows = (CamelMimeFilterWindows *) o;
-
- windows->is_windows = FALSE;
- windows->claimed_charset = NULL;
-}
-
-static void
-filter_filter (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace)
-{
- CamelMimeFilterWindows *windows = (CamelMimeFilterWindows *) filter;
- register unsigned char *inptr;
- unsigned char *inend;
-
- if (!windows->is_windows) {
- inptr = (unsigned char *) in;
- inend = inptr + len;
-
- while (inptr < inend) {
- register unsigned char c = *inptr++;
-
- if (c >= 128 && c <= 159) {
- g_warning ("Encountered Windows charset parading as %s",
- windows->claimed_charset);
- windows->is_windows = TRUE;
- break;
- }
- }
- }
-
- *out = in;
- *outlen = len;
- *outprespace = prespace;
-}
-
-static void
-filter_complete (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace)
-{
- filter_filter (filter, in, len, prespace, out, outlen, outprespace);
-}
-
-static void
-filter_reset (CamelMimeFilter *filter)
-{
- CamelMimeFilterWindows *windows = (CamelMimeFilterWindows *) filter;
-
- windows->is_windows = FALSE;
-}
-
-static void
-camel_mime_filter_windows_class_init (CamelMimeFilterWindowsClass *klass)
-{
- CamelMimeFilterClass *filter_class = (CamelMimeFilterClass *) klass;
-
- parent_class = CAMEL_MIME_FILTER_CLASS (camel_type_get_global_classfuncs (camel_mime_filter_get_type ()));
-
- filter_class->reset = filter_reset;
- filter_class->filter = filter_filter;
- filter_class->complete = filter_complete;
-}
-
-
-/**
- * camel_mime_filter_windows_new:
- * @claimed_charset:
- *
- * Creates a new CamelMimeFilterWindows object.
- *
- * Returns a new CamelMimeFilter object.
- **/
-CamelMimeFilter *
-camel_mime_filter_windows_new (const char *claimed_charset)
-{
- CamelMimeFilterWindows *new;
-
- g_return_val_if_fail (claimed_charset != NULL, NULL);
-
- new = CAMEL_MIME_FILTER_WINDOWS (camel_object_new (camel_mime_filter_windows_get_type ()));
-
- new->claimed_charset = g_strdup (claimed_charset);
-
- return CAMEL_MIME_FILTER (new);
-}
-
-
-gboolean
-camel_mime_filter_windows_is_windows_charset (CamelMimeFilterWindows *filter)
-{
- g_return_val_if_fail (CAMEL_IS_MIME_FILTER_WINDOWS (filter), FALSE);
-
- return filter->is_windows;
-}
-
-
-const char *
-camel_mime_filter_windows_real_charset (CamelMimeFilterWindows *filter)
-{
- g_return_val_if_fail (CAMEL_IS_MIME_FILTER_WINDOWS (filter), NULL);
-
- if (filter->is_windows)
- return camel_charset_iso_to_windows (filter->claimed_charset);
- else
- return filter->claimed_charset;
-}
diff --git a/camel/camel-mime-filter-windows.h b/camel/camel-mime-filter-windows.h
deleted file mode 100644
index d2dac4fe92..0000000000
--- a/camel/camel-mime-filter-windows.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2002 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifndef __CAMEL_MIME_FILTER_WINDOWS_H__
-#define __CAMEL_MIME_FILTER_WINDOWS_H__
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <camel/camel-mime-filter.h>
-
-#define CAMEL_MIME_FILTER_WINDOWS(obj) CAMEL_CHECK_CAST (obj, camel_mime_filter_windows_get_type (), CamelMimeFilterWindows)
-#define CAMEL_MIME_FILTER_WINDOWS_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_mime_filter_windows_get_type (), CamelMimeFilterWindowsClass)
-#define CAMEL_IS_MIME_FILTER_WINDOWS(obj) CAMEL_CHECK_TYPE (obj, camel_mime_filter_windows_get_type ())
-
-typedef struct _CamelMimeFilterWindowsClass CamelMimeFilterWindowsClass;
-typedef struct _CamelMimeFilterWindows CamelMimeFilterWindows;
-
-struct _CamelMimeFilterWindows {
- CamelMimeFilter parent;
-
- gboolean is_windows;
- char *claimed_charset;
-};
-
-struct _CamelMimeFilterWindowsClass {
- CamelMimeFilterClass parent_class;
-
-};
-
-
-CamelType camel_mime_filter_windows_get_type (void);
-
-CamelMimeFilter *camel_mime_filter_windows_new (const char *claimed_charset);
-
-gboolean camel_mime_filter_windows_is_windows_charset (CamelMimeFilterWindows *filter);
-const char *camel_mime_filter_windows_real_charset (CamelMimeFilterWindows *filter);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __CAMEL_MIME_FILTER_WINDOWS_H__ */
diff --git a/camel/camel-mime-filter.c b/camel/camel-mime-filter.c
deleted file mode 100644
index 6e94b3cde4..0000000000
--- a/camel/camel-mime-filter.c
+++ /dev/null
@@ -1,256 +0,0 @@
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <string.h>
-#include "camel-mime-filter.h"
-
-/*#define MALLOC_CHECK */ /* for some malloc checking, requires mcheck enabled */
-
-/* only suitable for glibc */
-#ifdef MALLOC_CHECK
-#include <mcheck.h>
-#endif
-
-struct _CamelMimeFilterPrivate {
- char *inbuf;
- size_t inlen;
-};
-
-#define PRE_HEAD (64)
-#define BACK_HEAD (64)
-#define _PRIVATE(o) (((CamelMimeFilter *)(o))->priv)
-#define FCLASS(o) ((CamelMimeFilterClass *)(CAMEL_OBJECT_GET_CLASS(o)))
-
-static CamelObjectClass *camel_mime_filter_parent;
-
-static void complete (CamelMimeFilter *mf, char *in, size_t len,
- size_t prespace, char **out, size_t *outlen,
- size_t *outprespace);
-
-static void
-camel_mime_filter_class_init (CamelMimeFilterClass *klass)
-{
- camel_mime_filter_parent = camel_type_get_global_classfuncs (camel_object_get_type ());
-
- klass->complete = complete;
-}
-
-static void
-camel_mime_filter_init (CamelMimeFilter *obj)
-{
- obj->outreal = NULL;
- obj->outbuf = NULL;
- obj->outsize = 0;
-
- obj->backbuf = NULL;
- obj->backsize = 0;
- obj->backlen = 0;
-
- _PRIVATE(obj) = g_malloc0(sizeof(*obj->priv));
-}
-
-static void
-camel_mime_filter_finalize(CamelObject *o)
-{
- CamelMimeFilter *f = (CamelMimeFilter *)o;
- struct _CamelMimeFilterPrivate *p = _PRIVATE(f);
-
- g_free(f->outreal);
- g_free(f->backbuf);
- g_free(p->inbuf);
- g_free(p);
-}
-
-CamelType
-camel_mime_filter_get_type (void)
-{
- static CamelType camel_mime_filter_type = CAMEL_INVALID_TYPE;
-
- if (camel_mime_filter_type == CAMEL_INVALID_TYPE) {
- camel_mime_filter_type = camel_type_register (CAMEL_OBJECT_TYPE, "CamelMimeFilter",
- sizeof (CamelMimeFilter),
- sizeof (CamelMimeFilterClass),
- (CamelObjectClassInitFunc) camel_mime_filter_class_init,
- NULL,
- (CamelObjectInitFunc) camel_mime_filter_init,
- (CamelObjectFinalizeFunc) camel_mime_filter_finalize);
- }
-
- return camel_mime_filter_type;
-}
-
-static void
-complete(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, size_t *outlen, size_t *outprespace)
-{
- /* default - do nothing */
-}
-
-/**
- * camel_mime_filter_new:
- *
- * Create a new CamelMimeFilter object.
- *
- * Return value: A new CamelMimeFilter widget.
- **/
-CamelMimeFilter *
-camel_mime_filter_new (void)
-{
- CamelMimeFilter *new = CAMEL_MIME_FILTER ( camel_object_new (camel_mime_filter_get_type ()));
- return new;
-}
-
-#ifdef MALLOC_CHECK
-static void
-checkmem(void *p)
-{
- if (p) {
- int status = mprobe(p);
-
- switch (status) {
- case MCHECK_HEAD:
- printf("Memory underrun at %p\n", p);
- abort();
- case MCHECK_TAIL:
- printf("Memory overrun at %p\n", p);
- abort();
- case MCHECK_FREE:
- printf("Double free %p\n", p);
- abort();
- }
- }
-}
-#endif
-
-static void filter_run(CamelMimeFilter *f,
- char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace,
- void (*filterfunc)(CamelMimeFilter *f,
- char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace))
-{
- struct _CamelMimeFilterPrivate *p;
-
-#ifdef MALLOC_CHECK
- checkmem(f->outreal);
- checkmem(f->backbuf);
-#endif
- /*
- here we take a performance hit, if the input buffer doesn't
- have the pre-space required. We make a buffer that does ...
- */
- if (prespace < f->backlen) {
- int newlen = len+prespace+f->backlen;
- p = _PRIVATE(f);
- if (p->inlen < newlen) {
- /* NOTE: g_realloc copies data, we dont need that (slower) */
- g_free(p->inbuf);
- p->inbuf = g_malloc(newlen+PRE_HEAD);
- p->inlen = newlen+PRE_HEAD;
- }
- /* copy to end of structure */
- memcpy(p->inbuf+p->inlen - len, in, len);
- in = p->inbuf+p->inlen - len;
- prespace = p->inlen - len;
- }
-
-#ifdef MALLOC_CHECK
- checkmem(f->outreal);
- checkmem(f->backbuf);
-#endif
-
- /* preload any backed up data */
- if (f->backlen > 0) {
- memcpy(in-f->backlen, f->backbuf, f->backlen);
- in -= f->backlen;
- len += f->backlen;
- prespace -= f->backlen;
- f->backlen = 0;
- }
-
- filterfunc(f, in, len, prespace, out, outlen, outprespace);
-
-#ifdef MALLOC_CHECK
- checkmem(f->outreal);
- checkmem(f->backbuf);
-#endif
-
-}
-
-void camel_mime_filter_filter(CamelMimeFilter *f,
- char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace)
-{
- if (FCLASS(f)->filter)
- filter_run(f, in, len, prespace, out, outlen, outprespace, FCLASS(f)->filter);
- else
- g_error("Filter function unplmenented in class");
-}
-
-void camel_mime_filter_complete(CamelMimeFilter *f,
- char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace)
-{
- if (FCLASS(f)->complete)
- filter_run(f, in, len, prespace, out, outlen, outprespace, FCLASS(f)->complete);
-}
-
-void camel_mime_filter_reset(CamelMimeFilter *f)
-{
- if (FCLASS(f)->reset) {
- FCLASS(f)->reset(f);
- }
-
- /* could free some buffers, if they are really big? */
- f->backlen = 0;
-}
-
-/* sets number of bytes backed up on the input, new calls replace previous ones */
-void camel_mime_filter_backup(CamelMimeFilter *f, const char *data, size_t length)
-{
- if (f->backsize < length) {
- /* g_realloc copies data, unnecessary overhead */
- g_free(f->backbuf);
- f->backbuf = g_malloc(length+BACK_HEAD);
- f->backsize = length+BACK_HEAD;
- }
- f->backlen = length;
- memcpy(f->backbuf, data, length);
-}
-
-/* ensure this much size available for filter output (if required) */
-void camel_mime_filter_set_size(CamelMimeFilter *f, size_t size, int keep)
-{
- if (f->outsize < size) {
- int offset = f->outptr - f->outreal;
- if (keep) {
- f->outreal = g_realloc(f->outreal, size + PRE_HEAD*4);
- } else {
- g_free(f->outreal);
- f->outreal = g_malloc(size + PRE_HEAD*4);
- }
- f->outptr = f->outreal + offset;
- f->outbuf = f->outreal + PRE_HEAD*4;
- f->outsize = size;
- /* this could be offset from the end of the structure, but
- this should be good enough */
- f->outpre = PRE_HEAD*4;
- }
-}
-
diff --git a/camel/camel-mime-filter.h b/camel/camel-mime-filter.h
deleted file mode 100644
index 3cd65fe8d1..0000000000
--- a/camel/camel-mime-filter.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-/* Abstract class for non-copying filters */
-
-#ifndef _CAMEL_MIME_FILTER_H
-#define _CAMEL_MIME_FILTER_H
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <sys/types.h>
-#include <camel/camel-object.h>
-
-#define CAMEL_MIME_FILTER_TYPE (camel_mime_filter_get_type ())
-#define CAMEL_MIME_FILTER(obj) CAMEL_CHECK_CAST (obj, camel_mime_filter_get_type (), CamelMimeFilter)
-#define CAMEL_MIME_FILTER_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_mime_filter_get_type (), CamelMimeFilterClass)
-#define CAMEL_IS_MIME_FILTER(obj) CAMEL_CHECK_TYPE (obj, camel_mime_filter_get_type ())
-
-typedef struct _CamelMimeFilterClass CamelMimeFilterClass;
-
-struct _CamelMimeFilter {
- CamelObject parent;
-
- struct _CamelMimeFilterPrivate *priv;
-
- char *outreal; /* real malloc'd buffer */
- char *outbuf; /* first 'writable' position allowed (outreal + outpre) */
- char *outptr;
- size_t outsize;
- size_t outpre; /* prespace of this buffer */
-
- char *backbuf;
- size_t backsize;
- size_t backlen; /* significant data there */
-};
-
-struct _CamelMimeFilterClass {
- CamelObjectClass parent_class;
-
- /* virtual functions */
- void (*filter)(CamelMimeFilter *f,
- char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace);
- void (*complete)(CamelMimeFilter *f,
- char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace);
- void (*reset)(CamelMimeFilter *f);
-};
-
-CamelType camel_mime_filter_get_type (void);
-CamelMimeFilter *camel_mime_filter_new (void);
-
-void camel_mime_filter_filter(CamelMimeFilter *f,
- char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace);
-
-void camel_mime_filter_complete(CamelMimeFilter *f,
- char *in, size_t len, size_t prespace,
- char **out, size_t *outlen, size_t *outprespace);
-
-void camel_mime_filter_reset(CamelMimeFilter *f);
-
-/* sets/returns number of bytes backed up on the input */
-void camel_mime_filter_backup(CamelMimeFilter *f, const char *data, size_t length);
-
-/* ensure this much size available for filter output */
-void camel_mime_filter_set_size(CamelMimeFilter *f, size_t size, int keep);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* ! _CAMEL_MIME_FILTER_H */
diff --git a/camel/camel-mime-message.c b/camel/camel-mime-message.c
deleted file mode 100644
index 7f4ac93f4b..0000000000
--- a/camel/camel-mime-message.c
+++ /dev/null
@@ -1,963 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; fill-column: 160 -*- */
-/* camel-mime-message.c : class for a mime_message */
-
-/*
- * Authors: Bertrand Guiheneuf <bertrand@helixcode.com>
- * Michael Zucchi <notzed@ximian.com>
- * Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 1999-2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <ctype.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-
-#include <gal/util/e-iconv.h>
-
-#include <e-util/e-time-utils.h>
-
-#include "camel-mime-message.h"
-#include "camel-multipart.h"
-#include "camel-stream-mem.h"
-#include "camel-string-utils.h"
-#include "camel-url.h"
-
-#include "camel-stream-filter.h"
-#include "camel-stream-null.h"
-#include "camel-mime-filter-charset.h"
-#include "camel-mime-filter-bestenc.h"
-
-#define d(x)
-
-/* these 2 below should be kept in sync */
-typedef enum {
- HEADER_UNKNOWN,
- HEADER_FROM,
- HEADER_REPLY_TO,
- HEADER_SUBJECT,
- HEADER_TO,
- HEADER_RESENT_TO,
- HEADER_CC,
- HEADER_RESENT_CC,
- HEADER_BCC,
- HEADER_RESENT_BCC,
- HEADER_DATE,
- HEADER_MESSAGE_ID
-} CamelHeaderType;
-
-static char *header_names[] = {
- /* dont include HEADER_UNKNOWN string */
- "From", "Reply-To", "Subject", "To", "Resent-To", "Cc", "Resent-Cc",
- "Bcc", "Resent-Bcc", "Date", "Message-Id", NULL
-};
-
-static GHashTable *header_name_table;
-
-static CamelMimePartClass *parent_class = NULL;
-
-static char *recipient_names[] = {
- "To", "Cc", "Bcc", "Resent-To", "Resent-Cc", "Resent-Bcc", NULL
-};
-
-static ssize_t write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream);
-static void add_header (CamelMedium *medium, const char *name, const void *value);
-static void set_header (CamelMedium *medium, const char *name, const void *value);
-static void remove_header (CamelMedium *medium, const char *name);
-static int construct_from_parser (CamelMimePart *, CamelMimeParser *);
-static void unref_recipient (gpointer key, gpointer value, gpointer user_data);
-
-/* Returns the class for a CamelMimeMessage */
-#define CMM_CLASS(so) CAMEL_MIME_MESSAGE_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-#define CDW_CLASS(so) CAMEL_DATA_WRAPPER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-#define CMD_CLASS(so) CAMEL_MEDIUM_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-
-static void
-camel_mime_message_class_init (CamelMimeMessageClass *camel_mime_message_class)
-{
- CamelDataWrapperClass *camel_data_wrapper_class = CAMEL_DATA_WRAPPER_CLASS (camel_mime_message_class);
- CamelMimePartClass *camel_mime_part_class = CAMEL_MIME_PART_CLASS (camel_mime_message_class);
- CamelMediumClass *camel_medium_class = CAMEL_MEDIUM_CLASS (camel_mime_message_class);
- int i;
-
- parent_class = CAMEL_MIME_PART_CLASS (camel_type_get_global_classfuncs (camel_mime_part_get_type ()));
-
- header_name_table = g_hash_table_new (camel_strcase_hash, camel_strcase_equal);
- for (i = 0;header_names[i]; i++)
- g_hash_table_insert (header_name_table, header_names[i], GINT_TO_POINTER(i+1));
-
- /* virtual method overload */
- camel_data_wrapper_class->write_to_stream = write_to_stream;
- camel_data_wrapper_class->decode_to_stream = write_to_stream;
-
- camel_medium_class->add_header = add_header;
- camel_medium_class->set_header = set_header;
- camel_medium_class->remove_header = remove_header;
-
- camel_mime_part_class->construct_from_parser = construct_from_parser;
-}
-
-
-static void
-camel_mime_message_init (gpointer object, gpointer klass)
-{
- CamelMimeMessage *mime_message = (CamelMimeMessage *)object;
- int i;
-
- mime_message->recipients = g_hash_table_new (camel_strcase_hash, camel_strcase_equal);
- for (i=0;recipient_names[i];i++) {
- g_hash_table_insert(mime_message->recipients, recipient_names[i], camel_internet_address_new());
- }
-
- mime_message->subject = NULL;
- mime_message->reply_to = NULL;
- mime_message->from = NULL;
- mime_message->date = CAMEL_MESSAGE_DATE_CURRENT;
- mime_message->date_offset = 0;
- mime_message->date_received = CAMEL_MESSAGE_DATE_CURRENT;
- mime_message->date_received_offset = 0;
- mime_message->message_id = NULL;
-}
-
-static void
-camel_mime_message_finalize (CamelObject *object)
-{
- CamelMimeMessage *message = CAMEL_MIME_MESSAGE (object);
-
- g_free (message->subject);
-
- g_free (message->message_id);
-
- if (message->reply_to)
- camel_object_unref ((CamelObject *)message->reply_to);
-
- if (message->from)
- camel_object_unref ((CamelObject *)message->from);
-
- g_hash_table_foreach (message->recipients, unref_recipient, NULL);
- g_hash_table_destroy (message->recipients);
-}
-
-
-CamelType
-camel_mime_message_get_type (void)
-{
- static CamelType camel_mime_message_type = CAMEL_INVALID_TYPE;
-
- if (camel_mime_message_type == CAMEL_INVALID_TYPE) {
- camel_mime_message_type = camel_type_register (camel_mime_part_get_type(), "CamelMimeMessage",
- sizeof (CamelMimeMessage),
- sizeof (CamelMimeMessageClass),
- (CamelObjectClassInitFunc) camel_mime_message_class_init,
- NULL,
- (CamelObjectInitFunc) camel_mime_message_init,
- (CamelObjectFinalizeFunc) camel_mime_message_finalize);
- }
-
- return camel_mime_message_type;
-}
-
-static void
-unref_recipient (gpointer key, gpointer value, gpointer user_data)
-{
- camel_object_unref (value);
-}
-
-CamelMimeMessage *
-camel_mime_message_new (void)
-{
- CamelMimeMessage *mime_message;
- mime_message = CAMEL_MIME_MESSAGE (camel_object_new (CAMEL_MIME_MESSAGE_TYPE));
-
- return mime_message;
-}
-
-/* **** Date: */
-
-void
-camel_mime_message_set_date (CamelMimeMessage *message, time_t date, int offset)
-{
- char *datestr;
-
- g_assert(message);
-
- if (date == CAMEL_MESSAGE_DATE_CURRENT) {
- struct tm local;
- int tz;
-
- date = time(0);
- e_localtime_with_offset(date, &local, &tz);
- offset = (((tz/60/60) * 100) + (tz/60 % 60));
- }
- message->date = date;
- message->date_offset = offset;
-
- datestr = camel_header_format_date (date, offset);
- CAMEL_MEDIUM_CLASS (parent_class)->set_header ((CamelMedium *)message, "Date", datestr);
- g_free (datestr);
-}
-
-time_t
-camel_mime_message_get_date (CamelMimeMessage *msg, int *offset)
-{
- if (offset)
- *offset = msg->date_offset;
-
- return msg->date;
-}
-
-time_t
-camel_mime_message_get_date_received (CamelMimeMessage *msg, int *offset)
-{
- if (msg->date_received == CAMEL_MESSAGE_DATE_CURRENT) {
- const char *received;
-
- received = camel_medium_get_header ((CamelMedium *)msg, "received");
- if (received)
- received = strrchr (received, ';');
- if (received)
- msg->date_received = camel_header_decode_date (received + 1, &msg->date_received_offset);
- }
-
- if (offset)
- *offset = msg->date_received_offset;
-
- return msg->date_received;
-}
-
-/* **** Message-Id: */
-
-void
-camel_mime_message_set_message_id (CamelMimeMessage *mime_message, const char *message_id)
-{
- char *id;
-
- g_assert (mime_message);
-
- g_free (mime_message->message_id);
-
- if (message_id) {
- id = g_strstrip (g_strdup (message_id));
- } else {
- id = camel_header_msgid_generate ();
- }
-
- mime_message->message_id = id;
- id = g_strdup_printf ("<%s>", mime_message->message_id);
- CAMEL_MEDIUM_CLASS (parent_class)->set_header (CAMEL_MEDIUM (mime_message), "Message-Id", id);
- g_free (id);
-}
-
-const char *
-camel_mime_message_get_message_id (CamelMimeMessage *mime_message)
-{
- g_assert (mime_message);
-
- return mime_message->message_id;
-}
-
-/* **** Reply-To: */
-
-void
-camel_mime_message_set_reply_to (CamelMimeMessage *msg, const CamelInternetAddress *reply_to)
-{
- char *addr;
-
- g_assert(msg);
-
- if (msg->reply_to) {
- camel_object_unref ((CamelObject *)msg->reply_to);
- msg->reply_to = NULL;
- }
-
- if (reply_to == NULL) {
- CAMEL_MEDIUM_CLASS (parent_class)->remove_header (CAMEL_MEDIUM (msg), "Reply-To");
- return;
- }
-
- msg->reply_to = (CamelInternetAddress *)camel_address_new_clone ((CamelAddress *)reply_to);
- addr = camel_address_encode ((CamelAddress *)msg->reply_to);
- CAMEL_MEDIUM_CLASS (parent_class)->set_header (CAMEL_MEDIUM (msg), "Reply-To", addr);
- g_free (addr);
-}
-
-const CamelInternetAddress *
-camel_mime_message_get_reply_to (CamelMimeMessage *mime_message)
-{
- g_assert (mime_message);
-
- /* TODO: ref for threading? */
-
- return mime_message->reply_to;
-}
-
-/* **** Subject: */
-
-void
-camel_mime_message_set_subject (CamelMimeMessage *mime_message, const char *subject)
-{
- char *text;
-
- g_assert(mime_message);
-
- g_free (mime_message->subject);
- mime_message->subject = g_strstrip (g_strdup (subject));
- text = camel_header_encode_string((unsigned char *)mime_message->subject);
- CAMEL_MEDIUM_CLASS(parent_class)->set_header(CAMEL_MEDIUM (mime_message), "Subject", text);
- g_free (text);
-}
-
-const char *
-camel_mime_message_get_subject (CamelMimeMessage *mime_message)
-{
- g_assert(mime_message);
-
- return mime_message->subject;
-}
-
-/* *** From: */
-
-/* Thought: Since get_from/set_from are so rarely called, it is probably not useful
- to cache the from (and reply_to) addresses as InternetAddresses internally, we
- could just get it from the headers and reprocess every time. */
-void
-camel_mime_message_set_from (CamelMimeMessage *msg, const CamelInternetAddress *from)
-{
- char *addr;
-
- g_assert(msg);
-
- if (msg->from) {
- camel_object_unref((CamelObject *)msg->from);
- msg->from = NULL;
- }
-
- if (from == NULL || camel_address_length((CamelAddress *)from) == 0) {
- CAMEL_MEDIUM_CLASS(parent_class)->remove_header(CAMEL_MEDIUM(msg), "From");
- return;
- }
-
- msg->from = (CamelInternetAddress *)camel_address_new_clone((CamelAddress *)from);
- addr = camel_address_encode((CamelAddress *)msg->from);
- CAMEL_MEDIUM_CLASS (parent_class)->set_header(CAMEL_MEDIUM(msg), "From", addr);
- g_free(addr);
-}
-
-const CamelInternetAddress *
-camel_mime_message_get_from (CamelMimeMessage *mime_message)
-{
- g_assert (mime_message);
-
- /* TODO: we should really ref this for multi-threading to work */
-
- return mime_message->from;
-}
-
-/* **** To: Cc: Bcc: */
-
-void
-camel_mime_message_set_recipients(CamelMimeMessage *mime_message, const char *type, const CamelInternetAddress *r)
-{
- char *text;
- CamelInternetAddress *addr;
-
- g_assert(mime_message);
-
- addr = g_hash_table_lookup (mime_message->recipients, type);
- if (addr == NULL) {
- g_warning ("trying to set a non-valid receipient type: %s", type);
- return;
- }
-
- if (r == NULL || camel_address_length ((CamelAddress *)r) == 0) {
- camel_address_remove ((CamelAddress *)addr, -1);
- CAMEL_MEDIUM_CLASS (parent_class)->remove_header (CAMEL_MEDIUM (mime_message), type);
- return;
- }
-
- /* note this does copy, and not append (cat) */
- camel_address_copy ((CamelAddress *)addr, (const CamelAddress *)r);
-
- /* and sync our headers */
- text = camel_address_encode (CAMEL_ADDRESS (addr));
- CAMEL_MEDIUM_CLASS (parent_class)->set_header (CAMEL_MEDIUM (mime_message), type, text);
- g_free(text);
-}
-
-void
-camel_mime_message_set_source (CamelMimeMessage *mime_message, const char *src)
-{
- CamelURL *url;
- char *uri;
-
- g_assert (mime_message);
-
- url = camel_url_new (src, NULL);
- if (url) {
- uri = camel_url_to_string (url, CAMEL_URL_HIDE_ALL);
- camel_medium_add_header (CAMEL_MEDIUM (mime_message), "X-Evolution-Source", uri);
- g_free (uri);
- camel_url_free (url);
- }
-}
-
-const char *
-camel_mime_message_get_source (CamelMimeMessage *mime_message)
-{
- const char *src;
-
- g_assert(mime_message);
-
- src = camel_medium_get_header (CAMEL_MEDIUM (mime_message), "X-Evolution-Source");
- if (src) {
- while (*src && isspace ((unsigned) *src))
- ++src;
- }
- return src;
-}
-
-const CamelInternetAddress *
-camel_mime_message_get_recipients (CamelMimeMessage *mime_message, const char *type)
-{
- g_assert(mime_message);
-
- return g_hash_table_lookup (mime_message->recipients, type);
-}
-
-/* mime_message */
-static int
-construct_from_parser (CamelMimePart *dw, CamelMimeParser *mp)
-{
- char *buf;
- size_t len;
- int state;
- int ret;
- int err;
-
- d(printf("constructing mime-message\n"));
-
- d(printf("mime_message::construct_from_parser()\n"));
-
- /* let the mime-part construct the guts ... */
- ret = ((CamelMimePartClass *)parent_class)->construct_from_parser(dw, mp);
-
- if (ret == -1)
- return -1;
-
- /* ... then clean up the follow-on state */
- state = camel_mime_parser_step (mp, &buf, &len);
- switch (state) {
- case CAMEL_MIME_PARSER_STATE_EOF: case CAMEL_MIME_PARSER_STATE_FROM_END: /* these doesn't belong to us */
- camel_mime_parser_unstep (mp);
- case CAMEL_MIME_PARSER_STATE_MESSAGE_END:
- break;
- default:
- g_error ("Bad parser state: Expecing MESSAGE_END or EOF or EOM, got: %d", camel_mime_parser_state (mp));
- camel_mime_parser_unstep (mp);
- return -1;
- }
-
- d(printf("mime_message::construct_from_parser() leaving\n"));
- err = camel_mime_parser_errno(mp);
- if (err != 0) {
- errno = err;
- ret = -1;
- }
-
- return ret;
-}
-
-static ssize_t
-write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
-{
- CamelMimeMessage *mm = CAMEL_MIME_MESSAGE (data_wrapper);
-
- /* force mandatory headers ... */
- if (mm->from == NULL) {
- /* FIXME: should we just abort? Should we make one up? */
- g_warning ("No from set for message");
- camel_medium_set_header ((CamelMedium *)mm, "From", "");
- }
- if (!camel_medium_get_header ((CamelMedium *)mm, "Date"))
- camel_mime_message_set_date (mm, CAMEL_MESSAGE_DATE_CURRENT, 0);
-
- if (mm->subject == NULL)
- camel_mime_message_set_subject (mm, "No Subject");
-
- if (mm->message_id == NULL)
- camel_mime_message_set_message_id (mm, NULL);
-
- /* FIXME: "To" header needs to be set explicitly as well ... */
-
- if (!camel_medium_get_header ((CamelMedium *)mm, "Mime-Version"))
- camel_medium_set_header ((CamelMedium *)mm, "Mime-Version", "1.0");
-
- return CAMEL_DATA_WRAPPER_CLASS (parent_class)->write_to_stream (data_wrapper, stream);
-}
-
-/* FIXME: check format of fields. */
-static gboolean
-process_header (CamelMedium *medium, const char *name, const char *value)
-{
- CamelHeaderType header_type;
- CamelMimeMessage *message = CAMEL_MIME_MESSAGE (medium);
- CamelInternetAddress *addr;
- const char *charset;
-
- header_type = (CamelHeaderType) g_hash_table_lookup (header_name_table, name);
- switch (header_type) {
- case HEADER_FROM:
- if (message->from)
- camel_object_unref (message->from);
- message->from = camel_internet_address_new ();
- camel_address_decode (CAMEL_ADDRESS (message->from), value);
- break;
- case HEADER_REPLY_TO:
- if (message->reply_to)
- camel_object_unref (message->reply_to);
- message->reply_to = camel_internet_address_new ();
- camel_address_decode (CAMEL_ADDRESS (message->reply_to), value);
- break;
- case HEADER_SUBJECT:
- g_free (message->subject);
- if (((CamelDataWrapper *) message)->mime_type) {
- charset = camel_content_type_param (((CamelDataWrapper *) message)->mime_type, "charset");
- charset = e_iconv_charset_name (charset);
- } else
- charset = NULL;
- message->subject = g_strstrip (camel_header_decode_string (value, charset));
- break;
- case HEADER_TO:
- case HEADER_CC:
- case HEADER_BCC:
- case HEADER_RESENT_TO:
- case HEADER_RESENT_CC:
- case HEADER_RESENT_BCC:
- addr = g_hash_table_lookup (message->recipients, name);
- if (value)
- camel_address_decode (CAMEL_ADDRESS (addr), value);
- else
- camel_address_remove (CAMEL_ADDRESS (addr), -1);
- break;
- case HEADER_DATE:
- if (value) {
- message->date = camel_header_decode_date (value, &message->date_offset);
- } else {
- message->date = CAMEL_MESSAGE_DATE_CURRENT;
- message->date_offset = 0;
- }
- break;
- case HEADER_MESSAGE_ID:
- g_free (message->message_id);
- if (value)
- message->message_id = camel_header_msgid_decode (value);
- else
- message->message_id = NULL;
- break;
- default:
- return FALSE;
- }
-
- return TRUE;
-}
-
-static void
-set_header (CamelMedium *medium, const char *name, const void *value)
-{
- process_header (medium, name, value);
- parent_class->parent_class.set_header (medium, name, value);
-}
-
-static void
-add_header (CamelMedium *medium, const char *name, const void *value)
-{
- /* if we process it, then it must be forced unique as well ... */
- if (process_header (medium, name, value))
- parent_class->parent_class.set_header (medium, name, value);
- else
- parent_class->parent_class.add_header (medium, name, value);
-}
-
-static void
-remove_header (CamelMedium *medium, const char *name)
-{
- process_header (medium, name, NULL);
- parent_class->parent_class.remove_header (medium, name);
-}
-
-typedef gboolean (*CamelPartFunc)(CamelMimeMessage *, CamelMimePart *, void *data);
-
-static gboolean
-message_foreach_part_rec (CamelMimeMessage *msg, CamelMimePart *part, CamelPartFunc callback, void *data)
-{
- CamelDataWrapper *containee;
- int parts, i;
- int go = TRUE;
-
- if (callback (msg, part, data) == FALSE)
- return FALSE;
-
- containee = camel_medium_get_content_object (CAMEL_MEDIUM (part));
-
- if (containee == NULL)
- return go;
-
- /* using the object types is more accurate than using the mime/types */
- if (CAMEL_IS_MULTIPART (containee)) {
- parts = camel_multipart_get_number (CAMEL_MULTIPART (containee));
- for (i = 0; go && i < parts; i++) {
- CamelMimePart *part = camel_multipart_get_part (CAMEL_MULTIPART (containee), i);
-
- go = message_foreach_part_rec (msg, part, callback, data);
- }
- } else if (CAMEL_IS_MIME_MESSAGE (containee)) {
- go = message_foreach_part_rec (msg, (CamelMimePart *)containee, callback, data);
- }
-
- return go;
-}
-
-/* dont make this public yet, it might need some more thinking ... */
-/* MPZ */
-static void
-camel_mime_message_foreach_part (CamelMimeMessage *msg, CamelPartFunc callback, void *data)
-{
- message_foreach_part_rec (msg, (CamelMimePart *)msg, callback, data);
-}
-
-static gboolean
-check_8bit (CamelMimeMessage *msg, CamelMimePart *part, void *data)
-{
- CamelTransferEncoding encoding;
- int *has8bit = data;
-
- /* check this part, and stop as soon as we are done */
- encoding = camel_mime_part_get_encoding (part);
-
- *has8bit = encoding == CAMEL_TRANSFER_ENCODING_8BIT || encoding == CAMEL_TRANSFER_ENCODING_BINARY;
-
- return !(*has8bit);
-}
-
-gboolean
-camel_mime_message_has_8bit_parts (CamelMimeMessage *msg)
-{
- int has8bit = FALSE;
-
- camel_mime_message_foreach_part (msg, check_8bit, &has8bit);
-
- return has8bit;
-}
-
-/* finds the best charset and transfer encoding for a given part */
-static CamelTransferEncoding
-find_best_encoding (CamelMimePart *part, CamelBestencRequired required, CamelBestencEncoding enctype, char **charsetp)
-{
- CamelMimeFilterCharset *charenc = NULL;
- CamelTransferEncoding encoding;
- CamelMimeFilterBestenc *bestenc;
- unsigned int flags, callerflags;
- CamelDataWrapper *content;
- CamelStreamFilter *filter;
- const char *charsetin = NULL;
- char *charset = NULL;
- CamelStream *null;
- int idb, idc = -1;
- gboolean istext;
-
- /* we use all these weird stream things so we can do it with streams, and
- not have to read the whole lot into memory - although i have a feeling
- it would make things a fair bit simpler to do so ... */
-
- d(printf("starting to check part\n"));
-
- content = camel_medium_get_content_object ((CamelMedium *)part);
- if (content == NULL) {
- /* charset might not be right here, but it'll get the right stuff
- if it is ever set */
- *charsetp = NULL;
- return CAMEL_TRANSFER_ENCODING_DEFAULT;
- }
-
- istext = camel_content_type_is (((CamelDataWrapper *) part)->mime_type, "text", "*");
- if (istext) {
- flags = CAMEL_BESTENC_GET_CHARSET | CAMEL_BESTENC_GET_ENCODING;
- enctype |= CAMEL_BESTENC_TEXT;
- } else {
- flags = CAMEL_BESTENC_GET_ENCODING;
- }
-
- /* when building the message, any encoded parts are translated already */
- flags |= CAMEL_BESTENC_LF_IS_CRLF;
- /* and get any flags the caller passed in */
- callerflags = (required & CAMEL_BESTENC_NO_FROM);
- flags |= callerflags;
-
- /* first a null stream, so any filtering is thrown away; we only want the sideeffects */
- null = (CamelStream *)camel_stream_null_new ();
- filter = camel_stream_filter_new_with_stream (null);
-
- /* if we're looking for the best charset, then we need to convert to UTF-8 */
- if (istext && (required & CAMEL_BESTENC_GET_CHARSET) != 0
- && (charsetin = camel_content_type_param (content->mime_type, "charset"))) {
- charenc = camel_mime_filter_charset_new_convert (charsetin, "UTF-8");
- if (charenc != NULL)
- idc = camel_stream_filter_add (filter, (CamelMimeFilter *)charenc);
- charsetin = NULL;
- }
-
- bestenc = camel_mime_filter_bestenc_new (flags);
- idb = camel_stream_filter_add (filter, (CamelMimeFilter *)bestenc);
- d(printf("writing to checking stream\n"));
- camel_data_wrapper_decode_to_stream (content, (CamelStream *)filter);
- camel_stream_filter_remove (filter, idb);
- if (idc != -1) {
- camel_stream_filter_remove (filter, idc);
- camel_object_unref (charenc);
- charenc = NULL;
- }
-
- if (istext && (required & CAMEL_BESTENC_GET_CHARSET) != 0) {
- charsetin = camel_mime_filter_bestenc_get_best_charset (bestenc);
- d(printf("best charset = %s\n", charsetin ? charsetin : "(null)"));
- charset = g_strdup (charsetin);
-
- charsetin = camel_content_type_param (content->mime_type, "charset");
- } else {
- charset = NULL;
- }
-
- /* if we have US-ASCII, or we're not doing text, we dont need to bother with the rest */
- if (istext && charsetin && charset && (required & CAMEL_BESTENC_GET_CHARSET) != 0) {
- d(printf("have charset, trying conversion/etc\n"));
-
- /* now that 'bestenc' has told us what the best encoding is, we can use that to create
- a charset conversion filter as well, and then re-add the bestenc to filter the
- result to find the best encoding to use as well */
-
- charenc = camel_mime_filter_charset_new_convert (charsetin, charset);
- if (charenc != NULL) {
- /* otherwise, try another pass, converting to the real charset */
-
- camel_mime_filter_reset ((CamelMimeFilter *)bestenc);
- camel_mime_filter_bestenc_set_flags (bestenc, CAMEL_BESTENC_GET_ENCODING |
- CAMEL_BESTENC_LF_IS_CRLF | callerflags);
-
- camel_stream_filter_add (filter, (CamelMimeFilter *)charenc);
- camel_stream_filter_add (filter, (CamelMimeFilter *)bestenc);
-
- /* and write it to the new stream */
- camel_data_wrapper_write_to_stream (content, (CamelStream *)filter);
-
- camel_object_unref (charenc);
- }
- }
-
- encoding = camel_mime_filter_bestenc_get_best_encoding (bestenc, enctype);
-
- camel_object_unref (filter);
- camel_object_unref (bestenc);
- camel_object_unref (null);
-
- d(printf("done, best encoding = %d\n", encoding));
-
- if (charsetp)
- *charsetp = charset;
- else
- g_free (charset);
-
- return encoding;
-}
-
-struct _enc_data {
- CamelBestencRequired required;
- CamelBestencEncoding enctype;
-};
-
-static gboolean
-best_encoding (CamelMimeMessage *msg, CamelMimePart *part, void *datap)
-{
- struct _enc_data *data = datap;
- CamelTransferEncoding encoding;
- CamelDataWrapper *wrapper;
- char *charset;
-
- wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (part));
- if (!wrapper)
- return FALSE;
-
- /* we only care about actual content objects */
- if (!CAMEL_IS_MULTIPART (wrapper) && !CAMEL_IS_MIME_MESSAGE (wrapper)) {
- encoding = find_best_encoding (part, data->required, data->enctype, &charset);
- /* we always set the encoding, if we got this far. GET_CHARSET implies
- also GET_ENCODING */
- camel_mime_part_set_encoding (part, encoding);
-
- if ((data->required & CAMEL_BESTENC_GET_CHARSET) != 0) {
- if (camel_content_type_is (((CamelDataWrapper *) part)->mime_type, "text", "*")) {
- char *newct;
-
- /* FIXME: ick, the part content_type interface needs fixing bigtime */
- camel_content_type_set_param (((CamelDataWrapper *) part)->mime_type, "charset",
- charset ? charset : "us-ascii");
- newct = camel_content_type_format (((CamelDataWrapper *) part)->mime_type);
- if (newct) {
- d(printf("Setting content-type to %s\n", newct));
-
- camel_mime_part_set_content_type (part, newct);
- g_free (newct);
- }
- }
- }
-
- g_free (charset);
- }
-
- return TRUE;
-}
-
-void
-camel_mime_message_set_best_encoding (CamelMimeMessage *msg, CamelBestencRequired required, CamelBestencEncoding enctype)
-{
- struct _enc_data data;
-
- if ((required & (CAMEL_BESTENC_GET_ENCODING|CAMEL_BESTENC_GET_CHARSET)) == 0)
- return;
-
- data.required = required;
- data.enctype = enctype;
-
- camel_mime_message_foreach_part (msg, best_encoding, &data);
-}
-
-void
-camel_mime_message_encode_8bit_parts (CamelMimeMessage *mime_message)
-{
- camel_mime_message_set_best_encoding (mime_message, CAMEL_BESTENC_GET_ENCODING, CAMEL_BESTENC_7BIT);
-}
-
-
-struct _check_content_id {
- CamelMimePart *part;
- const char *content_id;
-};
-
-static gboolean
-check_content_id (CamelMimeMessage *message, CamelMimePart *part, void *data)
-{
- struct _check_content_id *check = (struct _check_content_id *) data;
- const char *content_id;
- gboolean found;
-
- content_id = camel_mime_part_get_content_id (part);
-
- found = content_id && !strcmp (content_id, check->content_id) ? TRUE : FALSE;
- if (found) {
- check->part = part;
- camel_object_ref (part);
- }
-
- return !found;
-}
-
-CamelMimePart *
-camel_mime_message_get_part_by_content_id (CamelMimeMessage *message, const char *id)
-{
- struct _check_content_id check;
-
- g_return_val_if_fail (CAMEL_IS_MIME_MESSAGE (message), NULL);
-
- if (id == NULL)
- return NULL;
-
- check.content_id = id;
- check.part = NULL;
-
- camel_mime_message_foreach_part (message, check_content_id, &check);
-
- return check.part;
-}
-
-static char *tz_months[] = {
- "Jan", "Feb", "Mar", "Apr", "May", "Jun",
- "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
-};
-
-static char *tz_days[] = {
- "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
-};
-
-char *
-camel_mime_message_build_mbox_from (CamelMimeMessage *message)
-{
- struct _camel_header_raw *header = ((CamelMimePart *)message)->headers;
- GString *out = g_string_new("From ");
- char *ret;
- const char *tmp;
- time_t thetime;
- int offset;
- struct tm tm;
-
- tmp = camel_header_raw_find (&header, "Sender", NULL);
- if (tmp == NULL)
- tmp = camel_header_raw_find (&header, "From", NULL);
- if (tmp != NULL) {
- struct _camel_header_address *addr = camel_header_address_decode (tmp, NULL);
-
- tmp = NULL;
- if (addr) {
- if (addr->type == HEADER_ADDRESS_NAME) {
- g_string_append (out, addr->v.addr);
- tmp = "";
- }
- camel_header_address_unref (addr);
- }
- }
-
- if (tmp == NULL)
- g_string_append (out, "unknown@nodomain.now.au");
-
- /* try use the received header to get the date */
- tmp = camel_header_raw_find (&header, "Received", NULL);
- if (tmp) {
- tmp = strrchr(tmp, ';');
- if (tmp)
- tmp++;
- }
-
- /* if there isn't one, try the Date field */
- if (tmp == NULL)
- tmp = camel_header_raw_find (&header, "Date", NULL);
-
- thetime = camel_header_decode_date (tmp, &offset);
- thetime += ((offset / 100) * (60 * 60)) + (offset % 100) * 60;
- gmtime_r (&thetime, &tm);
- g_string_append_printf (out, " %s %s %2d %02d:%02d:%02d %4d\n",
- tz_days[tm.tm_wday], tz_months[tm.tm_mon],
- tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec,
- tm.tm_year + 1900);
-
- ret = out->str;
- g_string_free (out, FALSE);
-
- return ret;
-}
diff --git a/camel/camel-mime-message.h b/camel/camel-mime-message.h
deleted file mode 100644
index c1149d5ef5..0000000000
--- a/camel/camel-mime-message.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; fill-column: 160 -*- */
-/* camelMimeMessage.h : class for a mime message
- *
- * Authors: Bertrand Guiheneuf <bertrand@helixcode.com>
- * Michael Zucchi <notzed@ximian.com>
- *
- * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifndef CAMEL_MIME_MESSAGE_H
-#define CAMEL_MIME_MESSAGE_H 1
-
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include <camel/camel-mime-part.h>
-#include <camel/camel-mime-utils.h>
-#include <camel/camel-internet-address.h>
-#include <camel/camel-mime-filter-bestenc.h>
-
-#define CAMEL_RECIPIENT_TYPE_TO "To"
-#define CAMEL_RECIPIENT_TYPE_CC "Cc"
-#define CAMEL_RECIPIENT_TYPE_BCC "Bcc"
-
-#define CAMEL_RECIPIENT_TYPE_RESENT_TO "Resent-To"
-#define CAMEL_RECIPIENT_TYPE_RESENT_CC "Resent-Cc"
-#define CAMEL_RECIPIENT_TYPE_RESENT_BCC "Resent-Bcc"
-
-#define CAMEL_MIME_MESSAGE_TYPE (camel_mime_message_get_type ())
-#define CAMEL_MIME_MESSAGE(obj) (CAMEL_CHECK_CAST((obj), CAMEL_MIME_MESSAGE_TYPE, CamelMimeMessage))
-#define CAMEL_MIME_MESSAGE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_MIME_MESSAGE_TYPE, CamelMimeMessageClass))
-#define CAMEL_IS_MIME_MESSAGE(o) (CAMEL_CHECK_TYPE((o), CAMEL_MIME_MESSAGE_TYPE))
-
-
-/* specify local time */
-#define CAMEL_MESSAGE_DATE_CURRENT (~0)
-
-struct _CamelMimeMessage
-{
- CamelMimePart parent_object;
-
- /* header fields */
- time_t date;
- int date_offset; /* GMT offset */
-
- /* cached internal copy */
- time_t date_received;
- int date_received_offset; /* GMT offset */
-
- char *subject;
-
- char *message_id;
-
- CamelInternetAddress *reply_to;
- CamelInternetAddress *from;
-
- GHashTable *recipients; /* hash table of CamelInternetAddress's */
-};
-
-typedef struct {
- CamelMimePartClass parent_class;
-
- /* Virtual methods */
-
-} CamelMimeMessageClass;
-
-
-
-/* Standard Camel function */
-CamelType camel_mime_message_get_type (void);
-
-
-/* public methods */
-CamelMimeMessage *camel_mime_message_new (void);
-void camel_mime_message_set_date (CamelMimeMessage *mime_message,
- time_t date,
- int offset);
-time_t camel_mime_message_get_date (CamelMimeMessage *mime_message,
- int *offset);
-time_t camel_mime_message_get_date_received (CamelMimeMessage *mime_message,
- int *offset);
-void camel_mime_message_set_message_id (CamelMimeMessage *mime_message,
- const char *message_id);
-const char *camel_mime_message_get_message_id (CamelMimeMessage *mime_message);
-void camel_mime_message_set_reply_to (CamelMimeMessage *mime_message,
- const CamelInternetAddress *reply_to);
-const CamelInternetAddress *camel_mime_message_get_reply_to (CamelMimeMessage *mime_message);
-
-void camel_mime_message_set_subject (CamelMimeMessage *mime_message,
- const char *subject);
-const char *camel_mime_message_get_subject (CamelMimeMessage *mime_message);
-void camel_mime_message_set_from (CamelMimeMessage *mime_message,
- const CamelInternetAddress *from);
-const CamelInternetAddress *camel_mime_message_get_from (CamelMimeMessage *mime_message);
-
-const CamelInternetAddress *camel_mime_message_get_recipients (CamelMimeMessage *mime_message,
- const char *type);
-void camel_mime_message_set_recipients (CamelMimeMessage *mime_message,
- const char *type,
- const CamelInternetAddress *r);
-
-void camel_mime_message_set_source (CamelMimeMessage *mime_message,
- const char *identity);
-const char *camel_mime_message_get_source (CamelMimeMessage *mime_message);
-
-
-/* utility functions */
-gboolean camel_mime_message_has_8bit_parts (CamelMimeMessage *mime_message);
-void camel_mime_message_set_best_encoding (CamelMimeMessage *msg,
- CamelBestencRequired required,
- CamelBestencEncoding enctype);
-void camel_mime_message_encode_8bit_parts (CamelMimeMessage *mime_message);
-
-CamelMimePart *camel_mime_message_get_part_by_content_id (CamelMimeMessage *message, const char *content_id);
-
-char *camel_mime_message_build_mbox_from (CamelMimeMessage *mime_message);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_MIME_MESSAGE_H */
diff --git a/camel/camel-mime-parser.c b/camel/camel-mime-parser.c
deleted file mode 100644
index d3954c069c..0000000000
--- a/camel/camel-mime-parser.c
+++ /dev/null
@@ -1,1982 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2000-2003 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-/* What should hopefully be a fast mail parser */
-
-/* Do not change this code without asking me (Michael Zucchi) first
-
- There is almost always a reason something was done a certain way.
- */
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-
-#include <string.h>
-
-#include <stdio.h>
-#include <errno.h>
-
-#include <regex.h>
-#include <ctype.h>
-
-#include <glib.h>
-#include "camel-mime-parser.h"
-#include "camel-mime-utils.h"
-#include "camel-mime-filter.h"
-#include "camel-stream.h"
-#include "camel-seekable-stream.h"
-
-#define r(x)
-#define h(x)
-#define c(x)
-#define d(x)
-
-/*#define PRESERVE_HEADERS*/
-
-/*#define PURIFY*/
-
-#define MEMPOOL
-
-#define STRUCT_ALIGN 4
-
-#ifdef PURIFY
-int inend_id = -1,
- inbuffer_id = -1;
-#endif
-
-#define SCAN_BUF 4096 /* size of read buffer */
-#define SCAN_HEAD 128 /* headroom guaranteed to be before each read buffer */
-
-/* a little hacky, but i couldn't be bothered renaming everything */
-#define _header_scan_state _CamelMimeParserPrivate
-#define _PRIVATE(o) (((CamelMimeParser *)(o))->priv)
-
-#ifdef MEMPOOL
-typedef struct _MemPoolNode {
- struct _MemPoolNode *next;
-
- int free;
- char data[1];
-} MemPoolNode;
-
-typedef struct _MemPoolThresholdNode {
- struct _MemPoolThresholdNode *next;
- char data[1];
-} MemPoolThresholdNode;
-
-typedef struct _MemPool {
- int blocksize;
- int threshold;
- struct _MemPoolNode *blocks;
- struct _MemPoolThresholdNode *threshold_blocks;
-} MemPool;
-
-MemPool *mempool_new(int blocksize, int threshold);
-void *mempool_alloc(MemPool *pool, int size);
-void mempool_flush(MemPool *pool, int freeall);
-void mempool_free(MemPool *pool);
-
-MemPool *mempool_new(int blocksize, int threshold)
-{
- MemPool *pool;
-
- pool = g_malloc(sizeof(*pool));
- if (threshold >= blocksize)
- threshold = blocksize * 2 / 3;
- pool->blocksize = blocksize;
- pool->threshold = threshold;
- pool->blocks = NULL;
- pool->threshold_blocks = NULL;
- return pool;
-}
-
-void *mempool_alloc(MemPool *pool, int size)
-{
- size = (size + STRUCT_ALIGN) & (~(STRUCT_ALIGN-1));
- if (size>=pool->threshold) {
- MemPoolThresholdNode *n;
-
- n = g_malloc(sizeof(*n) - sizeof(char) + size);
- n->next = pool->threshold_blocks;
- pool->threshold_blocks = n;
- return &n->data[0];
- } else {
- MemPoolNode *n;
-
- n = pool->blocks;
- while (n) {
- if (n->free >= size) {
- n->free -= size;
- return &n->data[n->free];
- }
- n = n->next;
- }
-
- n = g_malloc(sizeof(*n) - sizeof(char) + pool->blocksize);
- n->next = pool->blocks;
- pool->blocks = n;
- n->free = pool->blocksize - size;
- return &n->data[n->free];
- }
-}
-
-void mempool_flush(MemPool *pool, int freeall)
-{
- MemPoolThresholdNode *tn, *tw;
- MemPoolNode *pw, *pn;
-
- tw = pool->threshold_blocks;
- while (tw) {
- tn = tw->next;
- g_free(tw);
- tw = tn;
- }
- pool->threshold_blocks = NULL;
-
- if (freeall) {
- pw = pool->blocks;
- while (pw) {
- pn = pw->next;
- g_free(pw);
- pw = pn;
- }
- pool->blocks = NULL;
- } else {
- pw = pool->blocks;
- while (pw) {
- pw->free = pool->blocksize;
- pw = pw->next;
- }
- }
-}
-
-void mempool_free(MemPool *pool)
-{
- if (pool) {
- mempool_flush(pool, 1);
- g_free(pool);
- }
-}
-
-#endif
-
-struct _header_scan_state {
-
- /* global state */
-
- enum _camel_mime_parser_state state;
-
- /* for building headers during scanning */
- char *outbuf;
- char *outptr;
- char *outend;
-
- int fd; /* input for a fd input */
- CamelStream *stream; /* or for a stream */
-
- int ioerrno; /* io error state */
-
- /* for scanning input buffers */
- char *realbuf; /* the real buffer, SCAN_HEAD*2 + SCAN_BUF bytes */
- char *inbuf; /* points to a subset of the allocated memory, the underflow */
- char *inptr; /* (upto SCAN_HEAD) is for use by filters so they dont copy all data */
- char *inend;
-
- int atleast;
-
- off_t seek; /* current offset to start of buffer */
- int unstep; /* how many states to 'unstep' (repeat the current state) */
-
- unsigned int midline:1; /* are we mid-line interrupted? */
- unsigned int scan_from:1; /* do we care about From lines? */
- unsigned int scan_pre_from:1; /* do we return pre-from data? */
- unsigned int eof:1; /* reached eof? */
-
- off_t start_of_from; /* where from started */
- off_t start_of_headers; /* where headers started from the last scan */
-
- off_t header_start; /* start of last header, or -1 */
-
- /* filters to apply to all content before output */
- int filterid; /* id of next filter */
- struct _header_scan_filter *filters;
-
- /* per message/part info */
- struct _header_scan_stack *parts;
-
-};
-
-struct _header_scan_stack {
- struct _header_scan_stack *parent;
-
- enum _camel_mime_parser_state savestate; /* state at invocation of this part */
-
-#ifdef MEMPOOL
- MemPool *pool; /* memory pool to keep track of headers/etc at this level */
-#endif
- struct _camel_header_raw *headers; /* headers for this part */
-
- CamelContentType *content_type;
-
- /* I dont use GString's casue you can't efficiently append a buffer to them */
- GByteArray *pretext; /* for multipart types, save the pre-boundary data here */
- GByteArray *posttext; /* for multipart types, save the post-boundary data here */
- int prestage; /* used to determine if it is a pre-boundary or post-boundary data segment */
-
- GByteArray *from_line; /* the from line */
-
- char *boundary; /* for multipart/ * boundaries, including leading -- and trailing -- for the final part */
- int boundarylen; /* actual length of boundary, including leading -- if there is one */
- int boundarylenfinal; /* length of boundary, including trailing -- if there is one */
- int atleast; /* the biggest boundary from here to the parent */
-};
-
-struct _header_scan_filter {
- struct _header_scan_filter *next;
- int id;
- CamelMimeFilter *filter;
-};
-
-static void folder_scan_step(struct _header_scan_state *s, char **databuffer, size_t *datalength);
-static void folder_scan_drop_step(struct _header_scan_state *s);
-static int folder_scan_init_with_fd(struct _header_scan_state *s, int fd);
-static int folder_scan_init_with_stream(struct _header_scan_state *s, CamelStream *stream);
-static struct _header_scan_state *folder_scan_init(void);
-static void folder_scan_close(struct _header_scan_state *s);
-static struct _header_scan_stack *folder_scan_content(struct _header_scan_state *s, int *lastone, char **data, size_t *length);
-static struct _header_scan_stack *folder_scan_header(struct _header_scan_state *s, int *lastone);
-static int folder_scan_skip_line(struct _header_scan_state *s, GByteArray *save);
-static off_t folder_seek(struct _header_scan_state *s, off_t offset, int whence);
-static off_t folder_tell(struct _header_scan_state *s);
-static int folder_read(struct _header_scan_state *s);
-#ifdef MEMPOOL
-static void header_append_mempool(struct _header_scan_state *s, struct _header_scan_stack *h, char *header, int offset);
-#endif
-
-static void camel_mime_parser_class_init (CamelMimeParserClass *klass);
-static void camel_mime_parser_init (CamelMimeParser *obj);
-
-#if d(!)0
-static char *states[] = {
- "CAMEL_MIME_PARSER_STATE_INITIAL",
- "CAMEL_MIME_PARSER_STATE_PRE_FROM", /* pre-from data */
- "CAMEL_MIME_PARSER_STATE_FROM", /* got 'From' line */
- "CAMEL_MIME_PARSER_STATE_HEADER", /* toplevel header */
- "CAMEL_MIME_PARSER_STATE_BODY", /* scanning body of message */
- "CAMEL_MIME_PARSER_STATE_MULTIPART", /* got multipart header */
- "CAMEL_MIME_PARSER_STATE_MESSAGE", /* rfc822/news message */
-
- "CAMEL_MIME_PARSER_STATE_PART", /* part of a multipart */
-
- "CAMEL_MIME_PARSER_STATE_EOF", /* end of file */
- "CAMEL_MIME_PARSER_STATE_PRE_FROM_END",
- "CAMEL_MIME_PARSER_STATE_FROM_END",
- "CAMEL_MIME_PARSER_STATE_HEAER_END",
- "CAMEL_MIME_PARSER_STATE_BODY_END",
- "CAMEL_MIME_PARSER_STATE_MULTIPART_END",
- "CAMEL_MIME_PARSER_STATE_MESSAGE_END",
-};
-#endif
-
-static CamelObjectClass *camel_mime_parser_parent;
-
-static void
-camel_mime_parser_class_init (CamelMimeParserClass *klass)
-{
- camel_mime_parser_parent = camel_type_get_global_classfuncs (camel_object_get_type ());
-}
-
-static void
-camel_mime_parser_init (CamelMimeParser *obj)
-{
- struct _header_scan_state *s;
-
- s = folder_scan_init();
- _PRIVATE(obj) = s;
-}
-
-static void
-camel_mime_parser_finalise(CamelObject *o)
-{
- struct _header_scan_state *s = _PRIVATE(o);
-#ifdef PURIFY
- purify_watch_remove_all();
-#endif
- folder_scan_close(s);
-}
-
-CamelType
-camel_mime_parser_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_object_get_type (), "CamelMimeParser",
- sizeof (CamelMimeParser),
- sizeof (CamelMimeParserClass),
- (CamelObjectClassInitFunc) camel_mime_parser_class_init,
- NULL,
- (CamelObjectInitFunc) camel_mime_parser_init,
- (CamelObjectFinalizeFunc) camel_mime_parser_finalise);
- }
-
- return type;
-}
-
-/**
- * camel_mime_parser_new:
- *
- * Create a new CamelMimeParser object.
- *
- * Return value: A new CamelMimeParser widget.
- **/
-CamelMimeParser *
-camel_mime_parser_new (void)
-{
- CamelMimeParser *new = CAMEL_MIME_PARSER ( camel_object_new (camel_mime_parser_get_type ()));
- return new;
-}
-
-
-/**
- * camel_mime_parser_filter_add:
- * @m:
- * @mf:
- *
- * Add a filter that will be applied to any body content before it is passed
- * to the caller. Filters may be pipelined to perform multi-pass operations
- * on the content, and are applied in the order they were added.
- *
- * Note that filters are only applied to the body content of messages, and once
- * a filter has been set, all content returned by a filter_step() with a state
- * of CAMEL_MIME_PARSER_STATE_BODY will have passed through the filter.
- *
- * Return value: An id that may be passed to filter_remove() to remove
- * the filter, or -1 if the operation failed.
- **/
-int
-camel_mime_parser_filter_add(CamelMimeParser *m, CamelMimeFilter *mf)
-{
- struct _header_scan_state *s = _PRIVATE(m);
- struct _header_scan_filter *f, *new;
-
- new = g_malloc(sizeof(*new));
- new->filter = mf;
- new->id = s->filterid++;
- if (s->filterid == -1)
- s->filterid++;
- new->next = 0;
- camel_object_ref((CamelObject *)mf);
-
- /* yes, this is correct, since 'next' is the first element of the struct */
- f = (struct _header_scan_filter *)&s->filters;
- while (f->next)
- f = f->next;
- f->next = new;
- return new->id;
-}
-
-/**
- * camel_mime_parser_filter_remove:
- * @m:
- * @id:
- *
- * Remove a processing filter from the pipeline. There is no
- * restriction on the order the filters can be removed.
- **/
-void
-camel_mime_parser_filter_remove(CamelMimeParser *m, int id)
-{
- struct _header_scan_state *s = _PRIVATE(m);
- struct _header_scan_filter *f, *old;
-
- f = (struct _header_scan_filter *)&s->filters;
- while (f && f->next) {
- old = f->next;
- if (old->id == id) {
- camel_object_unref((CamelObject *)old->filter);
- f->next = old->next;
- g_free(old);
- /* there should only be a single matching id, but
- scan the whole lot anyway */
- }
- f = f->next;
- }
-}
-
-/**
- * camel_mime_parser_header:
- * @m:
- * @name: Name of header.
- * @offset: Pointer that can receive the offset of the header in
- * the stream from the start of parsing.
- *
- * Lookup a header by name.
- *
- * Return value: The header value, or NULL if the header is not
- * defined.
- **/
-const char *
-camel_mime_parser_header(CamelMimeParser *m, const char *name, int *offset)
-{
- struct _header_scan_state *s = _PRIVATE(m);
-
- if (s->parts &&
- s->parts->headers) {
- return camel_header_raw_find(&s->parts->headers, name, offset);
- }
- return NULL;
-}
-
-/**
- * camel_mime_parser_headers_raw:
- * @m:
- *
- * Get the list of the raw headers which are defined for the
- * current state of the parser. These headers are valid
- * until the next call to parser_step(), or parser_drop_step().
- *
- * Return value: The raw headers, or NULL if there are no headers
- * defined for the current part or state. These are READ ONLY.
- **/
-struct _camel_header_raw *
-camel_mime_parser_headers_raw(CamelMimeParser *m)
-{
- struct _header_scan_state *s = _PRIVATE(m);
-
- if (s->parts)
- return s->parts->headers;
- return NULL;
-}
-
-static const char *
-byte_array_to_string(GByteArray *array)
-{
- if (array == NULL)
- return NULL;
-
- if (array->len == 0 || array->data[array->len-1] != '\0')
- g_byte_array_append(array, "", 1);
-
- return array->data;
-}
-
-/**
- * camel_mime_parser_preface:
- * @m:
- *
- * Retrieve the preface text for the current multipart.
- * Can only be used when the state is CAMEL_MIME_PARSER_STATE_MULTIPART_END.
- *
- * Return value: The preface text, or NULL if there wasn't any.
- **/
-const char *
-camel_mime_parser_preface(CamelMimeParser *m)
-{
- struct _header_scan_state *s = _PRIVATE(m);
-
- if (s->parts)
- return byte_array_to_string(s->parts->pretext);
-
- return NULL;
-}
-
-/**
- * camel_mime_parser_postface:
- * @m:
- *
- * Retrieve the postface text for the current multipart.
- * Only returns valid data when the current state if
- * CAMEL_MIME_PARSER_STATE_MULTIPART_END.
- *
- * Return value: The postface text, or NULL if there wasn't any.
- **/
-const char *
-camel_mime_parser_postface(CamelMimeParser *m)
-{
- struct _header_scan_state *s = _PRIVATE(m);
-
- if (s->parts)
- return byte_array_to_string(s->parts->posttext);
-
- return NULL;
-}
-
-/**
- * camel_mime_parser_from_line:
- * @m:
- *
- * Get the last scanned "From " line, from a recently scanned from.
- * This should only be called in the CAMEL_MIME_PARSER_STATE_FROM state. The
- * from line will include the closing \n found (if there was one).
- *
- * The return value will remain valid while in the CAMEL_MIME_PARSER_STATE_FROM
- * state, or any deeper state.
- *
- * Return value: The From line, or NULL if called out of context.
- **/
-const char *
-camel_mime_parser_from_line(CamelMimeParser *m)
-{
- struct _header_scan_state *s = _PRIVATE(m);
-
- if (s->parts)
- return byte_array_to_string(s->parts->from_line);
-
- return NULL;
-}
-
-/**
- * camel_mime_parser_init_with_fd:
- * @m:
- * @fd: A valid file descriptor.
- *
- * Initialise the scanner with an fd. The scanner's offsets
- * will be relative to the current file position of the file
- * descriptor. As a result, seekable descritors should
- * be seeked using the parser seek functions.
- *
- * Return value: Returns -1 on error.
- **/
-int
-camel_mime_parser_init_with_fd(CamelMimeParser *m, int fd)
-{
- struct _header_scan_state *s = _PRIVATE(m);
-
- return folder_scan_init_with_fd(s, fd);
-}
-
-/**
- * camel_mime_parser_init_with_stream:
- * @m:
- * @stream:
- *
- * Initialise the scanner with a source stream. The scanner's
- * offsets will be relative to the current file position of
- * the stream. As a result, seekable streams should only
- * be seeked using the parser seek function.
- *
- * Return value: -1 on error.
- **/
-int
-camel_mime_parser_init_with_stream(CamelMimeParser *m, CamelStream *stream)
-{
- struct _header_scan_state *s = _PRIVATE(m);
-
- return folder_scan_init_with_stream(s, stream);
-}
-
-/**
- * camel_mime_parser_scan_from:
- * @parser: MIME parser object
- * @scan_from: #TRUE if the scanner should scan From lines.
- *
- * Tell the scanner if it should scan "^From " lines or not.
- *
- * If the scanner is scanning from lines, two additional
- * states CAMEL_MIME_PARSER_STATE_FROM and CAMEL_MIME_PARSER_STATE_FROM_END will be returned
- * to the caller during parsing.
- *
- * This may also be preceeded by an optional
- * CAMEL_MIME_PARSER_STATE_PRE_FROM state which contains the scanned data
- * found before the From line is encountered. See also
- * scan_pre_from().
- **/
-void
-camel_mime_parser_scan_from (CamelMimeParser *parser, gboolean scan_from)
-{
- struct _header_scan_state *s = _PRIVATE (parser);
-
- s->scan_from = scan_from;
-}
-
-/**
- * camel_mime_parser_scan_pre_from:
- * @parser: MIME parser object
- * @scan_pre_from: #TRUE if we want to get pre-from data.
- *
- * Tell the scanner whether we want to know abou the pre-from
- * data during a scan. If we do, then we may get an additional
- * state CAMEL_MIME_PARSER_STATE_PRE_FROM which returns the specified data.
- **/
-void
-camel_mime_parser_scan_pre_from (CamelMimeParser *parser, gboolean scan_pre_from)
-{
- struct _header_scan_state *s = _PRIVATE (parser);
-
- s->scan_pre_from = scan_pre_from;
-}
-
-/**
- * camel_mime_parser_content_type:
- * @parser: MIME parser object
- *
- * Get the content type defined in the current part.
- *
- * Return value: A content_type structure, or NULL if there
- * is no content-type defined for this part of state of the
- * parser.
- **/
-CamelContentType *
-camel_mime_parser_content_type (CamelMimeParser *parser)
-{
- struct _header_scan_state *s = _PRIVATE (parser);
-
- /* FIXME: should this search up until it's found the 'right'
- content-type? can it? */
- if (s->parts)
- return s->parts->content_type;
-
- return NULL;
-}
-
-/**
- * camel_mime_parser_unstep:
- * @parser: MIME parser object
- *
- * Cause the last step operation to repeat itself. If this is
- * called repeated times, then the same step will be repeated
- * that many times.
- *
- * Note that it is not possible to scan back using this function,
- * only to have a way of peeking the next state.
- **/
-void
-camel_mime_parser_unstep (CamelMimeParser *parser)
-{
- struct _header_scan_state *s = _PRIVATE (parser);
-
- s->unstep++;
-}
-
-/**
- * camel_mime_parser_drop_step:
- * @parser: MIME parser object
- *
- * Drop the last step call. This should only be used
- * in conjunction with seeking of the stream as the
- * stream may be in an undefined state relative to the
- * state of the parser.
- *
- * Use this call with care.
- **/
-void
-camel_mime_parser_drop_step (CamelMimeParser *parser)
-{
- struct _header_scan_state *s = _PRIVATE (parser);
-
- s->unstep = 0;
- folder_scan_drop_step(s);
-}
-
-/**
- * camel_mime_parser_step:
- * @parser: MIME parser object
- * @databuffer: Pointer to accept a pointer to the data
- * associated with this step (if any). May be #NULL,
- * in which case datalength is also ingored.
- * @datalength: Pointer to accept a pointer to the data
- * length associated with this step (if any).
- *
- * Parse the next part of the MIME message. If _unstep()
- * has been called, then continue to return the same state
- * for that many calls.
- *
- * If the step is CAMEL_MIME_PARSER_STATE_BODY then the databuffer and datalength
- * pointers will be setup to point to the internal data buffer
- * of the scanner and may be processed as required. Any
- * filters will have already been applied to this data.
- *
- * Refer to the state diagram elsewhere for a full listing of
- * the states an application is gauranteed to get from the
- * scanner.
- *
- * Return value: The current new state of the parser
- * is returned.
- **/
-enum _camel_mime_parser_state
-camel_mime_parser_step (CamelMimeParser *parser, char **databuffer, size_t *datalength)
-{
- struct _header_scan_state *s = _PRIVATE (parser);
-
- d(printf("OLD STATE: '%s' :\n", states[s->state]));
-
- if (s->unstep <= 0) {
- char *dummy;
- size_t dummylength;
-
- if (databuffer == NULL) {
- databuffer = &dummy;
- datalength = &dummylength;
- }
-
- folder_scan_step(s, databuffer, datalength);
- } else
- s->unstep--;
-
- d(printf("NEW STATE: '%s' :\n", states[s->state]));
-
- return s->state;
-}
-
-/**
- * camel_mime_parser_read:
- * @parser: MIME parser object
- * @databuffer:
- * @len:
- *
- * Read at most @len bytes from the internal mime parser buffer.
- *
- * Returns the address of the internal buffer in @databuffer,
- * and the length of useful data.
- *
- * @len may be specified as INT_MAX, in which case you will
- * get the full remainder of the buffer at each call.
- *
- * Note that no parsing of the data read through this function
- * occurs, so no state changes occur, but the seek position
- * is updated appropriately.
- *
- * Return value: The number of bytes available, or -1 on error.
- **/
-int
-camel_mime_parser_read (CamelMimeParser *parser, const char **databuffer, int len)
-{
- struct _header_scan_state *s = _PRIVATE (parser);
- int there;
-
- if (len == 0)
- return 0;
-
- d(printf("parser::read() reading %d bytes\n", len));
-
- there = MIN(s->inend - s->inptr, len);
- d(printf("parser::read() there = %d bytes\n", there));
- if (there > 0) {
- *databuffer = s->inptr;
- s->inptr += there;
- return there;
- }
-
- if (folder_read(s) == -1)
- return -1;
-
- there = MIN(s->inend - s->inptr, len);
- d(printf("parser::read() had to re-read, now there = %d bytes\n", there));
-
- *databuffer = s->inptr;
- s->inptr += there;
-
- return there;
-}
-
-/**
- * camel_mime_parser_tell:
- * @parser: MIME parser object
- *
- * Return the current scanning offset. The meaning of this
- * value will depend on the current state of the parser.
- *
- * An incomplete listing of the states:
- *
- * CAMEL_MIME_PARSER_STATE_INITIAL, The start of the current message.
- * CAMEL_MIME_PARSER_STATE_HEADER, CAMEL_MIME_PARSER_STATE_MESSAGE, CAMEL_MIME_PARSER_STATE_MULTIPART, the character
- * position immediately after the end of the header.
- * CAMEL_MIME_PARSER_STATE_BODY, Position within the message of the start
- * of the current data block.
- * CAMEL_MIME_PARSER_STATE_*_END, The position of the character starting
- * the next section of the scan (the last position + 1 of
- * the respective current state).
- *
- * Return value: See above.
- **/
-off_t
-camel_mime_parser_tell (CamelMimeParser *parser)
-{
- struct _header_scan_state *s = _PRIVATE (parser);
-
- return folder_tell(s);
-}
-
-/**
- * camel_mime_parser_tell_start_headers:
- * @parser: MIME parser object
- *
- * Find out the position within the file of where the
- * headers started, this is cached by the parser
- * at the time.
- *
- * Return value: The header start position, or -1 if
- * no headers were scanned in the current state.
- **/
-off_t
-camel_mime_parser_tell_start_headers (CamelMimeParser *parser)
-{
- struct _header_scan_state *s = _PRIVATE (parser);
-
- return s->start_of_headers;
-}
-
-/**
- * camel_mime_parser_tell_start_from:
- * @parser: MIME parser object
- *
- * If the parser is scanning From lines, then this returns
- * the position of the start of the From line.
- *
- * Return value: The start of the from line, or -1 if there
- * was no From line, or From lines are not being scanned.
- **/
-off_t
-camel_mime_parser_tell_start_from (CamelMimeParser *parser)
-{
- struct _header_scan_state *s = _PRIVATE (parser);
-
- return s->start_of_from;
-}
-
-/**
- * camel_mime_parser_seek:
- * @parser: MIME parser object
- * @offset: Number of bytes to offset the seek by.
- * @whence: SEEK_SET, SEEK_CUR, SEEK_END
- *
- * Reset the source position to a known value.
- *
- * Note that if the source stream/descriptor was not
- * positioned at 0 to begin with, and an absolute seek
- * is specified (whence != SEEK_CUR), then the seek
- * position may not match the desired seek position.
- *
- * Return value: The new seek offset, or -1 on
- * an error (for example, trying to seek on a non-seekable
- * stream or file descriptor).
- **/
-off_t
-camel_mime_parser_seek(CamelMimeParser *parser, off_t offset, int whence)
-{
- struct _header_scan_state *s = _PRIVATE (parser);
-
- return folder_seek(s, offset, whence);
-}
-
-/**
- * camel_mime_parser_state:
- * @parser: MIME parser object
- *
- * Get the current parser state.
- *
- * Return value: The current parser state.
- **/
-enum _camel_mime_parser_state
-camel_mime_parser_state (CamelMimeParser *parser)
-{
- struct _header_scan_state *s = _PRIVATE (parser);
-
- return s->state;
-}
-
-/**
- * camel_mime_parser_stream:
- * @parser: MIME parser object
- *
- * Get the stream, if any, the parser has been initialised
- * with. May be used to setup sub-streams, but should not
- * be read from directly (without saving and restoring
- * the seek position in between).
- *
- * Return value: The stream from _init_with_stream(), or NULL
- * if the parser is reading from a file descriptor or is
- * uninitialised.
- **/
-CamelStream *
-camel_mime_parser_stream (CamelMimeParser *parser)
-{
- struct _header_scan_state *s = _PRIVATE (parser);
-
- return s->stream;
-}
-
-/**
- * camel_mime_parser_fd:
- * @parser: MIME parser object
- *
- * Return the file descriptor, if any, the parser has been
- * initialised with.
- *
- * Should not be read from unless the parser it to terminate,
- * or the seek offset can be reset before the next parse
- * step.
- *
- * Return value: The file descriptor or -1 if the parser
- * is reading from a stream or has not been initialised.
- **/
-int
-camel_mime_parser_fd (CamelMimeParser *parser)
-{
- struct _header_scan_state *s = _PRIVATE (parser);
-
- return s->fd;
-}
-
-/* Return errno of the parser, incase any error occured during processing */
-int
-camel_mime_parser_errno (CamelMimeParser *parser)
-{
- struct _header_scan_state *s = _PRIVATE (parser);
-
- return s->ioerrno;
-}
-
-/* ********************************************************************** */
-/* Implementation */
-/* ********************************************************************** */
-
-/* read the next bit of data, ensure there is enough room 'atleast' bytes */
-static int
-folder_read(struct _header_scan_state *s)
-{
- int len;
- int inoffset;
-
- if (s->inptr<s->inend-s->atleast || s->eof)
- return s->inend-s->inptr;
-#ifdef PURIFY
- purify_watch_remove(inend_id);
- purify_watch_remove(inbuffer_id);
-#endif
- /* check for any remaning bytes (under the atleast limit( */
- inoffset = s->inend - s->inptr;
- if (inoffset>0) {
- memcpy(s->inbuf, s->inptr, inoffset);
- }
- if (s->stream) {
- len = camel_stream_read(s->stream, s->inbuf+inoffset, SCAN_BUF-inoffset);
- } else {
- len = read(s->fd, s->inbuf+inoffset, SCAN_BUF-inoffset);
- }
- r(printf("read %d bytes, offset = %d\n", len, inoffset));
- if (len>=0) {
- /* add on the last read block */
- s->seek += s->inptr - s->inbuf;
- s->inptr = s->inbuf;
- s->inend = s->inbuf+len+inoffset;
- s->eof = (len == 0);
- r(printf("content = %d '%.*s'\n",s->inend - s->inptr, s->inend - s->inptr, s->inptr));
- } else {
- s->ioerrno = errno?errno:EIO;
- }
-
- g_assert(s->inptr<=s->inend);
-#ifdef PURIFY
- inend_id = purify_watch(&s->inend);
- inbuffer_id = purify_watch_n(s->inend+1, SCAN_HEAD-1, "rw");
-#endif
- r(printf("content = %d '%.*s'\n", s->inend - s->inptr, s->inend - s->inptr, s->inptr));
- /* set a sentinal, for the inner loops to check against */
- s->inend[0] = '\n';
- return s->inend-s->inptr;
-}
-
-/* return the current absolute position of the data pointer */
-static off_t
-folder_tell(struct _header_scan_state *s)
-{
- return s->seek + (s->inptr - s->inbuf);
-}
-
-/*
- need some way to prime the parser state, so this actually works for
- other than top-level messages
-*/
-static off_t
-folder_seek(struct _header_scan_state *s, off_t offset, int whence)
-{
- off_t newoffset;
-
- if (s->stream) {
- if (CAMEL_IS_SEEKABLE_STREAM(s->stream)) {
- /* NOTE: assumes whence seekable stream == whence libc, which is probably
- the case (or bloody well should've been) */
- newoffset = camel_seekable_stream_seek((CamelSeekableStream *)s->stream, offset, whence);
- } else {
- newoffset = -1;
- errno = EINVAL;
- }
- } else {
- newoffset = lseek(s->fd, offset, whence);
- }
-#ifdef PURIFY
- purify_watch_remove(inend_id);
- purify_watch_remove(inbuffer_id);
-#endif
- if (newoffset != -1) {
- s->seek = newoffset;
- s->inptr = s->inbuf;
- s->inend = s->inbuf;
- s->eof = FALSE;
- } else {
- s->ioerrno = errno?errno:EIO;
- }
-#ifdef PURIFY
- inend_id = purify_watch(&s->inend);
- inbuffer_id = purify_watch_n(s->inend+1, SCAN_HEAD-1, "rw");
-#endif
- return newoffset;
-}
-
-static void
-folder_push_part(struct _header_scan_state *s, struct _header_scan_stack *h)
-{
- if (s->parts && s->parts->atleast > h->boundarylenfinal)
- h->atleast = s->parts->atleast;
- else
- h->atleast = MAX(h->boundarylenfinal, 1);
-
- h->parent = s->parts;
- s->parts = h;
-}
-
-static void
-folder_pull_part(struct _header_scan_state *s)
-{
- struct _header_scan_stack *h;
-
- h = s->parts;
- if (h) {
- s->parts = h->parent;
- g_free(h->boundary);
-#ifdef MEMPOOL
- mempool_free(h->pool);
-#else
- camel_header_raw_clear(&h->headers);
-#endif
- camel_content_type_unref(h->content_type);
- if (h->pretext)
- g_byte_array_free(h->pretext, TRUE);
- if (h->posttext)
- g_byte_array_free(h->posttext, TRUE);
- if (h->from_line)
- g_byte_array_free(h->from_line, TRUE);
- g_free(h);
- } else {
- g_warning("Header stack underflow!\n");
- }
-}
-
-static int
-folder_scan_skip_line(struct _header_scan_state *s, GByteArray *save)
-{
- int atleast = s->atleast;
- register char *inptr, *inend, c;
- int len;
-
- s->atleast = 1;
-
- d(printf("skipping line\n"));
-
- while ( (len = folder_read(s)) > 0 && len > s->atleast) { /* ensure we have at least enough room here */
- inptr = s->inptr;
- inend = s->inend-1;
-
- c = -1;
- while (inptr<inend
- && (c = *inptr++)!='\n') {
- d(printf("(%2x,%c)", c, isprint(c)?c:'.'));
- ;
- }
-
- if (save)
- g_byte_array_append(save, s->inptr, inptr-s->inptr);
-
- s->inptr = inptr;
-
- if (c=='\n') {
- s->atleast = atleast;
- return 0;
- }
- }
-
- s->atleast = atleast;
-
- return -1; /* not found */
-}
-
-/* TODO: Is there any way to make this run faster? It gets called a lot ... */
-static struct _header_scan_stack *
-folder_boundary_check(struct _header_scan_state *s, const char *boundary, int *lastone)
-{
- struct _header_scan_stack *part;
- int len = s->inend - boundary; /* make sure we dont access past the buffer */
-
- h(printf("checking boundary marker upto %d bytes\n", len));
- part = s->parts;
- while (part) {
- h(printf(" boundary: %s\n", part->boundary));
- h(printf(" against: '%.*s'\n", part->boundarylen, boundary));
- if (part->boundary
- && part->boundarylen <= len
- && memcmp(boundary, part->boundary, part->boundarylen)==0) {
- h(printf("matched boundary: %s\n", part->boundary));
- /* again, make sure we're in range */
- if (part->boundarylenfinal <= len) {
- int extra = part->boundarylenfinal - part->boundarylen;
-
- /* check the extra stuff on an final boundary, normally -- for mime parts */
- if (extra>0) {
- *lastone = memcmp(&boundary[part->boundarylen],
- &part->boundary[part->boundarylen],
- extra) == 0;
- } else {
- *lastone = TRUE;
- }
- h(printf("checking lastone = %s\n", *lastone?"TRUE":"FALSE"));
- } else {
- h(printf("not enough room to check last one?\n"));
- *lastone = FALSE;
- }
- /*printf("ok, we found it! : %s \n", (*lastone)?"Last one":"More to come?");*/
- return part;
- }
- part = part->parent;
- }
- return NULL;
-}
-
-#ifdef MEMPOOL
-static void
-header_append_mempool(struct _header_scan_state *s, struct _header_scan_stack *h, char *header, int offset)
-{
- struct _camel_header_raw *l, *n;
- char *content;
-
- content = strchr(header, ':');
- if (content) {
- register int len;
- n = mempool_alloc(h->pool, sizeof(*n));
- n->next = NULL;
-
- len = content-header;
- n->name = mempool_alloc(h->pool, len+1);
- memcpy(n->name, header, len);
- n->name[len] = 0;
-
- content++;
-
- len = s->outptr - content;
- n->value = mempool_alloc(h->pool, len+1);
- memcpy(n->value, content, len);
- n->value[len] = 0;
-
- n->offset = offset;
-
- l = (struct _camel_header_raw *)&h->headers;
- while (l->next) {
- l = l->next;
- }
- l->next = n;
- }
-
-}
-
-#define header_raw_append_parse(a, b, c) (header_append_mempool(s, h, b, c))
-
-#endif
-
-/* Copy the string start->inptr into the header buffer (s->outbuf),
- grow if necessary
- remove trailing \r chars (\n's assumed already removed)
- and track the start offset of the header */
-/* Basically an optimised version of g_byte_array_append() */
-#define header_append(s, start, inptr) \
-{ \
- register int headerlen = inptr-start; \
- \
- if (headerlen > 0) { \
- if (headerlen >= (s->outend - s->outptr)) { \
- register char *outnew; \
- register int len = ((s->outend - s->outbuf)+headerlen)*2+1; \
- outnew = g_realloc(s->outbuf, len); \
- s->outptr = s->outptr - s->outbuf + outnew; \
- s->outbuf = outnew; \
- s->outend = outnew + len; \
- } \
- if (start[headerlen-1] == '\r') \
- headerlen--; \
- memcpy(s->outptr, start, headerlen); \
- s->outptr += headerlen; \
- } \
- if (s->header_start == -1) \
- s->header_start = (start-s->inbuf) + s->seek; \
-}
-
-static struct _header_scan_stack *
-folder_scan_header(struct _header_scan_state *s, int *lastone)
-{
- int atleast = s->atleast, newatleast;
- char *start = NULL;
- int len;
- struct _header_scan_stack *h;
- char *inend;
- register char *inptr;
-
- h(printf("scanning first bit\n"));
-
- h = g_malloc0(sizeof(*h));
-#ifdef MEMPOOL
- h->pool = mempool_new(8192, 4096);
-#endif
-
- if (s->parts)
- newatleast = s->parts->atleast;
- else
- newatleast = 1;
- *lastone = FALSE;
-
- do {
- s->atleast = newatleast;
-
- h(printf("atleast = %d\n", s->atleast));
-
- while ((len = folder_read(s))>0 && len >= s->atleast) { /* ensure we have at least enough room here */
- inptr = s->inptr;
- inend = s->inend-s->atleast+1;
-
- while (inptr<inend) {
- if (!s->midline) {
- if (folder_boundary_check(s, inptr, lastone)) {
- if ((s->outptr>s->outbuf))
- goto header_truncated; /* may not actually be truncated */
-
- goto header_done;
- }
- }
-
- start = inptr;
-
- /* goto next line/sentinal */
- while ((*inptr++)!='\n')
- ;
-
- g_assert(inptr<=s->inend+1);
-
- /* check for sentinal or real end of line */
- if (inptr > inend) {
- h(printf("not at end of line yet, going further\n"));
- /* didn't find end of line within our allowed area */
- inptr = inend;
- s->midline = TRUE;
- header_append(s, start, inptr);
- } else {
- h(printf("got line part: '%.*s'\n", inptr-1-start, start));
- /* got a line, strip and add it, process it */
- s->midline = FALSE;
-#ifdef PRESERVE_HEADERS
- header_append(s, start, inptr);
-#else
- header_append(s, start, inptr-1);
-#endif
- /* check for end of headers */
- if (s->outbuf == s->outptr)
- goto header_done;
-
- /* check for continuation/compress headers, we have atleast 1 char here to work with */
- if (inptr[0] == ' ' || inptr[0] == '\t') {
- h(printf("continuation\n"));
-#ifndef PRESERVE_HEADERS
- /* TODO: this wont catch multiple space continuation across a read boundary, but
- that is assumed rare, and not fatal anyway */
- do
- inptr++;
- while (*inptr == ' ' || *inptr == '\t');
- inptr--;
- *inptr = ' ';
-#endif
- } else {
- /* otherwise, complete header, add it */
-#ifdef PRESERVE_HEADERS
- s->outptr--;
- if (s->outptr[-1] == '\r')
- s->outptr--;
-#endif
- s->outptr[0] = 0;
-
- h(printf("header '%s' at %d\n", s->outbuf, (int)s->header_start));
-
- header_raw_append_parse(&h->headers, s->outbuf, s->header_start);
- s->outptr = s->outbuf;
- s->header_start = -1;
- }
- }
- }
- s->inptr = inptr;
- }
- h(printf("end of file? read %d bytes\n", len));
- newatleast = 1;
- } while (s->atleast > 1);
-
- if ((s->outptr > s->outbuf) || s->inend > s->inptr) {
- start = s->inptr;
- inptr = s->inend;
- if (inptr > start) {
- if (inptr[-1] == '\n')
- inptr--;
- }
- goto header_truncated;
- }
-
- s->atleast = atleast;
-
- return h;
-
-header_truncated:
- header_append(s, start, inptr);
-
- s->outptr[0] = 0;
- if (s->outbuf == s->outptr)
- goto header_done;
-
- header_raw_append_parse(&h->headers, s->outbuf, s->header_start);
-
- s->outptr = s->outbuf;
-header_done:
- s->inptr = inptr;
- s->atleast = atleast;
- s->header_start = -1;
- return h;
-}
-
-static struct _header_scan_stack *
-folder_scan_content(struct _header_scan_state *s, int *lastone, char **data, size_t *length)
-{
- int atleast = s->atleast, newatleast;
- register char *inptr;
- char *inend;
- char *start;
- int len;
- struct _header_scan_stack *part;
- int onboundary = FALSE;
-
- c(printf("scanning content\n"));
-
- part = s->parts;
- if (part)
- newatleast = part->atleast;
- else
- newatleast = 1;
- *lastone = FALSE;
-
- c(printf("atleast = %d\n", newatleast));
-
- do {
- s->atleast = newatleast;
-
- while ((len = folder_read(s))>0 && len >= s->atleast) { /* ensure we have at least enough room here */
- inptr = s->inptr;
- if (s->eof)
- inend = s->inend;
- else
- inend = s->inend-s->atleast+1;
- start = inptr;
-
- c(printf("inptr = %p, inend = %p\n", inptr, inend));
-
- while (inptr<inend) {
- if (!s->midline
- && (part = folder_boundary_check(s, inptr, lastone))) {
- onboundary = TRUE;
-
- /* since we truncate the boundary data, we need at least 1 char here spare,
- to remain in the same state */
- if ( (inptr-start) > 1)
- goto content;
-
- /* otherwise, jump to the state of the boundary we actually found */
- goto normal_exit;
- }
-
- /* goto the next line */
- while ((*inptr++)!='\n')
- ;
-
- /* check the sentinal, if we went past the atleast limit, and reset it to there */
- if (inptr > inend) {
- s->midline = TRUE;
- inptr = inend;
- } else {
- s->midline = FALSE;
- }
- }
-
- c(printf("ran out of input, dumping what i have (%d) bytes midline = %s\n",
- inptr-start, s->midline?"TRUE":"FALSE"));
- goto content;
- }
- newatleast = 1;
- } while (s->atleast > 1);
-
- c(printf("length read = %d\n", len));
-
- if (s->inend > s->inptr) {
- start = s->inptr;
- inptr = s->inend;
- goto content;
- }
-
- *length = 0;
- s->atleast = atleast;
- return NULL;
-
-content:
- /* treat eof as the last boundary in From mode */
- if (s->scan_from && s->eof && s->atleast <= 1) {
- onboundary = TRUE;
- part = NULL;
- } else {
- part = s->parts;
- }
-normal_exit:
- s->atleast = atleast;
- s->inptr = inptr;
-
- *data = start;
- /* if we hit a boundary, we should not include the closing \n */
- if (onboundary && (inptr-start)>0)
- *length = inptr-start-1;
- else
- *length = inptr-start;
-
- /*printf("got %scontent: '%.*s'\n", s->midline?"partial ":"", inptr-start, start);*/
-
- return part;
-}
-
-
-static void
-folder_scan_close(struct _header_scan_state *s)
-{
- g_free(s->realbuf);
- g_free(s->outbuf);
- while (s->parts)
- folder_pull_part(s);
- if (s->fd != -1)
- close(s->fd);
- if (s->stream) {
- camel_object_unref((CamelObject *)s->stream);
- }
- g_free(s);
-}
-
-
-static struct _header_scan_state *
-folder_scan_init(void)
-{
- struct _header_scan_state *s;
-
- s = g_malloc(sizeof(*s));
-
- s->fd = -1;
- s->stream = NULL;
- s->ioerrno = 0;
-
- s->outbuf = g_malloc(1024);
- s->outptr = s->outbuf;
- s->outend = s->outbuf+1024;
-
- s->realbuf = g_malloc(SCAN_BUF + SCAN_HEAD*2);
- s->inbuf = s->realbuf + SCAN_HEAD;
- s->inptr = s->inbuf;
- s->inend = s->inbuf;
- s->atleast = 0;
-
- s->seek = 0; /* current character position in file of the last read block */
- s->unstep = 0;
-
- s->header_start = -1;
-
- s->start_of_from = -1;
- s->start_of_headers = -1;
-
- s->midline = FALSE;
- s->scan_from = FALSE;
- s->scan_pre_from = FALSE;
- s->eof = FALSE;
-
- s->filters = NULL;
- s->filterid = 1;
-
- s->parts = NULL;
-
- s->state = CAMEL_MIME_PARSER_STATE_INITIAL;
- return s;
-}
-
-static void
-drop_states(struct _header_scan_state *s)
-{
- while (s->parts) {
- folder_scan_drop_step(s);
- }
- s->unstep = 0;
- s->state = CAMEL_MIME_PARSER_STATE_INITIAL;
-}
-
-static void
-folder_scan_reset(struct _header_scan_state *s)
-{
- drop_states(s);
- s->inend = s->inbuf;
- s->inptr = s->inbuf;
- s->inend[0] = '\n';
- if (s->fd != -1) {
- close(s->fd);
- s->fd = -1;
- }
- if (s->stream) {
- camel_object_unref((CamelObject *)s->stream);
- s->stream = NULL;
- }
- s->ioerrno = 0;
- s->eof = FALSE;
-}
-
-static int
-folder_scan_init_with_fd(struct _header_scan_state *s, int fd)
-{
- folder_scan_reset(s);
- s->fd = fd;
-
- return 0;
-}
-
-static int
-folder_scan_init_with_stream(struct _header_scan_state *s, CamelStream *stream)
-{
- folder_scan_reset(s);
- s->stream = stream;
- camel_object_ref((CamelObject *)stream);
-
- return 0;
-}
-
-#define USE_FROM
-
-static void
-folder_scan_step(struct _header_scan_state *s, char **databuffer, size_t *datalength)
-{
- struct _header_scan_stack *h, *hb;
- const char *content;
- const char *bound;
- int type;
- int state;
- CamelContentType *ct = NULL;
- struct _header_scan_filter *f;
- size_t presize;
-
-/* printf("\nSCAN PASS: state = %d '%s'\n", s->state, states[s->state]);*/
-
-tail_recurse:
- d({
- printf("\nSCAN STACK:\n");
- printf(" '%s' :\n", states[s->state]);
- hb = s->parts;
- while (hb) {
- printf(" '%s' : %s ", states[hb->savestate], hb->boundary);
- if (hb->content_type) {
- printf("(%s/%s)", hb->content_type->type, hb->content_type->subtype);
- } else {
- printf("(default)");
- }
- printf("\n");
- hb = hb->parent;
- }
- printf("\n");
- });
-
- switch (s->state) {
-
-#ifdef USE_FROM
- case CAMEL_MIME_PARSER_STATE_INITIAL:
- if (s->scan_from) {
- h = g_malloc0(sizeof(*h));
- h->boundary = g_strdup("From ");
- h->boundarylen = strlen(h->boundary);
- h->boundarylenfinal = h->boundarylen;
- h->from_line = g_byte_array_new();
- folder_push_part(s, h);
- s->state = CAMEL_MIME_PARSER_STATE_PRE_FROM;
- } else {
- s->start_of_from = -1;
- goto scan_header;
- }
-
- case CAMEL_MIME_PARSER_STATE_PRE_FROM:
-
- h = s->parts;
- do {
- hb = folder_scan_content(s, &state, databuffer, datalength);
- if (s->scan_pre_from && *datalength > 0) {
- d(printf("got pre-from content %d bytes\n", *datalength));
- return;
- }
- } while (hb==h && *datalength>0);
-
- if (*datalength==0 && hb==h) {
- d(printf("found 'From '\n"));
- s->start_of_from = folder_tell(s);
- folder_scan_skip_line(s, h->from_line);
- h->savestate = CAMEL_MIME_PARSER_STATE_INITIAL;
- s->state = CAMEL_MIME_PARSER_STATE_FROM;
- } else {
- folder_pull_part(s);
- s->state = CAMEL_MIME_PARSER_STATE_EOF;
- }
- return;
-#else
- case CAMEL_MIME_PARSER_STATE_INITIAL:
- case CAMEL_MIME_PARSER_STATE_PRE_FROM:
-#endif /* !USE_FROM */
-
- scan_header:
- case CAMEL_MIME_PARSER_STATE_FROM:
- s->start_of_headers = folder_tell(s);
- h = folder_scan_header(s, &state);
-#ifdef USE_FROM
- if (s->scan_from)
- h->savestate = CAMEL_MIME_PARSER_STATE_FROM_END;
- else
-#endif
- h->savestate = CAMEL_MIME_PARSER_STATE_EOF;
-
- /* FIXME: should this check for MIME-Version: 1.0 as well? */
-
- type = CAMEL_MIME_PARSER_STATE_HEADER;
- if ( (content = camel_header_raw_find(&h->headers, "Content-Type", NULL))
- && (ct = camel_content_type_decode(content))) {
- if (!strcasecmp(ct->type, "multipart")) {
- if (!camel_content_type_is(ct, "multipart", "signed")
- && (bound = camel_content_type_param(ct, "boundary"))) {
- d(printf("multipart, boundary = %s\n", bound));
- h->boundarylen = strlen(bound)+2;
- h->boundarylenfinal = h->boundarylen+2;
- h->boundary = g_malloc(h->boundarylen+3);
- sprintf(h->boundary, "--%s--", bound);
- type = CAMEL_MIME_PARSER_STATE_MULTIPART;
- } else {
- /*camel_content_type_unref(ct);
- ct = camel_content_type_decode("text/plain");*/
-/* We can't quite do this, as it will mess up all the offsets ... */
-/* camel_header_raw_replace(&h->headers, "Content-Type", "text/plain", offset);*/
- /*g_warning("Multipart with no boundary, treating as text/plain");*/
- }
- } else if (!strcasecmp(ct->type, "message")) {
- if (!strcasecmp(ct->subtype, "rfc822")
- || !strcasecmp(ct->subtype, "news")
- /*|| !strcasecmp(ct->subtype, "partial")*/) {
- type = CAMEL_MIME_PARSER_STATE_MESSAGE;
- }
- }
- } else {
- /* make the default type for multipart/digest be message/rfc822 */
- if ((s->parts
- && camel_content_type_is(s->parts->content_type, "multipart", "digest"))) {
- ct = camel_content_type_decode("message/rfc822");
- type = CAMEL_MIME_PARSER_STATE_MESSAGE;
- d(printf("parent was multipart/digest, autoupgrading to message/rfc822?\n"));
- /* maybe we should do this too?
- header_raw_append_parse(&h->headers, "Content-Type: message/rfc822", -1);*/
- } else {
- ct = camel_content_type_decode("text/plain");
- }
- }
- h->content_type = ct;
- folder_push_part(s, h);
- s->state = type;
- return;
-
- case CAMEL_MIME_PARSER_STATE_HEADER:
- s->state = CAMEL_MIME_PARSER_STATE_BODY;
-
- case CAMEL_MIME_PARSER_STATE_BODY:
- h = s->parts;
- *datalength = 0;
- presize = SCAN_HEAD;
- f = s->filters;
-
- do {
- hb = folder_scan_content (s, &state, databuffer, datalength);
-
- d(printf ("\n\nOriginal content: '"));
- d(fwrite(*databuffer, sizeof(char), *datalength, stdout));
- d(printf("'\n"));
-
- if (*datalength > 0) {
- while (f) {
- camel_mime_filter_filter(f->filter, *databuffer, *datalength, presize,
- databuffer, datalength, &presize);
- d(printf("Filtered content (%s): '", ((CamelObject *)f->filter)->klass->name));
- d(fwrite(*databuffer, sizeof(char), *datalength, stdout));
- d(printf("'\n"));
- f = f->next;
- }
- return;
- }
- } while (hb == h && *datalength > 0);
-
- /* check for any filter completion data */
- while (f) {
- camel_mime_filter_complete(f->filter, *databuffer, *datalength, presize,
- databuffer, datalength, &presize);
- f = f->next;
- }
-
- if (*datalength > 0)
- return;
-
- s->state = CAMEL_MIME_PARSER_STATE_BODY_END;
- break;
-
- case CAMEL_MIME_PARSER_STATE_MULTIPART:
- h = s->parts;
- do {
- do {
- hb = folder_scan_content(s, &state, databuffer, datalength);
- if (*datalength>0) {
- /* instead of a new state, we'll just store it locally and provide
- an accessor function */
- d(printf("Multipart %s Content %p: '%.*s'\n",
- h->prestage>0?"post":"pre", h, *datalength, *databuffer));
- if (h->prestage > 0) {
- if (h->posttext == NULL)
- h->posttext = g_byte_array_new();
- g_byte_array_append(h->posttext, *databuffer, *datalength);
- } else {
- if (h->pretext == NULL)
- h->pretext = g_byte_array_new();
- g_byte_array_append(h->pretext, *databuffer, *datalength);
- }
- }
- } while (hb==h && *datalength>0);
- h->prestage++;
- if (*datalength==0 && hb==h) {
- d(printf("got boundary: %s\n", hb->boundary));
- folder_scan_skip_line(s, NULL);
- if (!state) {
- s->state = CAMEL_MIME_PARSER_STATE_FROM;
- folder_scan_step(s, databuffer, datalength);
- s->parts->savestate = CAMEL_MIME_PARSER_STATE_MULTIPART; /* set return state for the new head part */
- return;
- }
- } else {
- break;
- }
- } while (1);
-
- s->state = CAMEL_MIME_PARSER_STATE_MULTIPART_END;
- break;
-
- case CAMEL_MIME_PARSER_STATE_MESSAGE:
- s->state = CAMEL_MIME_PARSER_STATE_FROM;
- folder_scan_step(s, databuffer, datalength);
- s->parts->savestate = CAMEL_MIME_PARSER_STATE_MESSAGE_END;
- break;
-
- case CAMEL_MIME_PARSER_STATE_FROM_END:
- case CAMEL_MIME_PARSER_STATE_BODY_END:
- case CAMEL_MIME_PARSER_STATE_MULTIPART_END:
- case CAMEL_MIME_PARSER_STATE_MESSAGE_END:
- s->state = s->parts->savestate;
- folder_pull_part(s);
- if (s->state & CAMEL_MIME_PARSER_STATE_END)
- return;
- goto tail_recurse;
-
- case CAMEL_MIME_PARSER_STATE_EOF:
- return;
-
- default:
- g_warning("Invalid state in camel-mime-parser: %d", s->state);
- break;
- }
-
- return;
-}
-
-/* drops the current state back one */
-static void
-folder_scan_drop_step(struct _header_scan_state *s)
-{
- switch (s->state) {
- case CAMEL_MIME_PARSER_STATE_EOF:
- s->state = CAMEL_MIME_PARSER_STATE_INITIAL;
- case CAMEL_MIME_PARSER_STATE_INITIAL:
- return;
-
- case CAMEL_MIME_PARSER_STATE_FROM:
- case CAMEL_MIME_PARSER_STATE_PRE_FROM:
- s->state = CAMEL_MIME_PARSER_STATE_INITIAL;
- folder_pull_part(s);
- return;
-
- case CAMEL_MIME_PARSER_STATE_MESSAGE:
- case CAMEL_MIME_PARSER_STATE_HEADER:
- case CAMEL_MIME_PARSER_STATE_MULTIPART:
-
- case CAMEL_MIME_PARSER_STATE_FROM_END:
- case CAMEL_MIME_PARSER_STATE_BODY_END:
- case CAMEL_MIME_PARSER_STATE_MULTIPART_END:
- case CAMEL_MIME_PARSER_STATE_MESSAGE_END:
-
- s->state = s->parts->savestate;
- folder_pull_part(s);
- if (s->state & CAMEL_MIME_PARSER_STATE_END) {
- s->state &= ~CAMEL_MIME_PARSER_STATE_END;
- }
- return;
- default:
- /* FIXME: not sure if this is entirely right */
- break;
- }
-}
-
-#ifdef STANDALONE
-int main(int argc, char **argv)
-{
- int fd;
- struct _header_scan_state *s;
- char *data;
- size_t len;
- int state;
- char *name = "/tmp/evmail/Inbox";
- struct _header_scan_stack *h;
- int i;
- int attach = 0;
-
- if (argc==2)
- name = argv[1];
-
- printf("opening: %s", name);
-
- for (i=1;i<argc;i++) {
- const char *encoding = NULL, *charset = NULL;
- char *attachname;
-
- name = argv[i];
- printf("opening: %s", name);
-
- fd = open(name, O_RDONLY);
- if (fd==-1) {
- perror("Cannot open mailbox");
- exit(1);
- }
- s = folder_scan_init();
- folder_scan_init_with_fd(s, fd);
- s->scan_from = FALSE;
-#if 0
- h = g_malloc0(sizeof(*h));
- h->savestate = CAMEL_MIME_PARSER_STATE_EOF;
- folder_push_part(s, h);
-#endif
- while (s->state != CAMEL_MIME_PARSER_STATE_EOF) {
- folder_scan_step(s, &data, &len);
- printf("\n -- PARSER STEP RETURN -- %d '%s'\n\n", s->state, states[s->state]);
- switch (s->state) {
- case CAMEL_MIME_PARSER_STATE_HEADER:
- if (s->parts->content_type
- && (charset = camel_content_type_param(s->parts->content_type, "charset"))) {
- if (strcasecmp(charset, "us-ascii")) {
-#if 0
- folder_push_filter_charset(s, "UTF-8", charset);
-#endif
- } else {
- charset = NULL;
- }
- } else {
- charset = NULL;
- }
-
- encoding = camel_header_raw_find(&s->parts->headers, "Content-transfer-encoding", 0);
- printf("encoding = '%s'\n", encoding);
- if (encoding && !strncasecmp(encoding, " base64", 7)) {
- printf("adding base64 filter\n");
- attachname = g_strdup_printf("attach.%d.%d", i, attach++);
-#if 0
- folder_push_filter_save(s, attachname);
-#endif
- g_free(attachname);
-#if 0
- folder_push_filter_mime(s, 0);
-#endif
- }
- if (encoding && !strncasecmp(encoding, " quoted-printable", 17)) {
- printf("adding quoted-printable filter\n");
- attachname = g_strdup_printf("attach.%d.%d", i, attach++);
-#if 0
- folder_push_filter_save(s, attachname);
-#endif
- g_free(attachname);
-#if 0
- folder_push_filter_mime(s, 1);
-#endif
- }
-
- break;
- case CAMEL_MIME_PARSER_STATE_BODY:
- printf("got body %d '%.*s'\n", len, len, data);
- break;
- case CAMEL_MIME_PARSER_STATE_BODY_END:
- printf("end body %d '%.*s'\n", len, len, data);
- if (encoding && !strncasecmp(encoding, " base64", 7)) {
- printf("removing filters\n");
-#if 0
- folder_filter_pull(s);
- folder_filter_pull(s);
-#endif
- }
- if (encoding && !strncasecmp(encoding, " quoted-printable", 17)) {
- printf("removing filters\n");
-#if 0
- folder_filter_pull(s);
- folder_filter_pull(s);
-#endif
- }
- if (charset) {
-#if 0
- folder_filter_pull(s);
-#endif
- charset = NULL;
- }
- encoding = NULL;
- break;
- default:
- break;
- }
- }
- folder_scan_close(s);
- close(fd);
- }
- return 0;
-}
-
-#endif /* STANDALONE */
-
diff --git a/camel/camel-mime-parser.h b/camel/camel-mime-parser.h
deleted file mode 100644
index db85133cbc..0000000000
--- a/camel/camel-mime-parser.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2000-2003 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-
-#ifndef _CAMEL_MIME_PARSER_H
-#define _CAMEL_MIME_PARSER_H
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <camel/camel-object.h>
-
-#include <camel/camel-mime-utils.h>
-#include <camel/camel-mime-filter.h>
-#include <camel/camel-stream.h>
-
-#define CAMEL_MIME_PARSER(obj) CAMEL_CHECK_CAST (obj, camel_mime_parser_get_type (), CamelMimeParser)
-#define CAMEL_MIME_PARSER_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_mime_parser_get_type (), CamelMimeParserClass)
-#define CAMEL_IS_MIME_PARSER(obj) CAMEL_CHECK_TYPE (obj, camel_mime_parser_get_type ())
-
-typedef struct _CamelMimeParserClass CamelMimeParserClass;
-
-/* NOTE: if you add more states, you may need to bump the
- start of the END tags to 16 or 32, etc - so they are
- the same as the matching start tag, with a bit difference */
-enum _camel_mime_parser_state {
- CAMEL_MIME_PARSER_STATE_INITIAL,
- CAMEL_MIME_PARSER_STATE_PRE_FROM, /* data before a 'From' line */
- CAMEL_MIME_PARSER_STATE_FROM, /* got 'From' line */
- CAMEL_MIME_PARSER_STATE_HEADER, /* toplevel header */
- CAMEL_MIME_PARSER_STATE_BODY, /* scanning body of message */
- CAMEL_MIME_PARSER_STATE_MULTIPART, /* got multipart header */
- CAMEL_MIME_PARSER_STATE_MESSAGE, /* rfc822 message */
-
- CAMEL_MIME_PARSER_STATE_PART, /* part of a multipart */
-
- CAMEL_MIME_PARSER_STATE_END = 8, /* bit mask for 'end' flags */
-
- CAMEL_MIME_PARSER_STATE_EOF = 8, /* end of file */
- CAMEL_MIME_PARSER_STATE_PRE_FROM_END, /* pre from end */
- CAMEL_MIME_PARSER_STATE_FROM_END, /* end of whole from bracket */
- CAMEL_MIME_PARSER_STATE_HEADER_END, /* dummy value */
- CAMEL_MIME_PARSER_STATE_BODY_END, /* end of message */
- CAMEL_MIME_PARSER_STATE_MULTIPART_END, /* end of multipart */
- CAMEL_MIME_PARSER_STATE_MESSAGE_END, /* end of message */
-};
-
-struct _CamelMimeParser {
- CamelObject parent;
-
- struct _CamelMimeParserPrivate *priv;
-};
-
-struct _CamelMimeParserClass {
- CamelObjectClass parent_class;
-
- void (*message) (CamelMimeParser *parser, void *headers);
- void (*part) (CamelMimeParser *parser);
- void (*content) (CamelMimeParser *parser);
-};
-
-CamelType camel_mime_parser_get_type (void);
-CamelMimeParser *camel_mime_parser_new (void);
-
-/* quick-fix for parser not erroring, we can find out if it had an error afterwards */
-int camel_mime_parser_errno (CamelMimeParser *parser);
-
-/* using an fd will be a little faster, but not much (over a simple stream) */
-int camel_mime_parser_init_with_fd (CamelMimeParser *parser, int fd);
-int camel_mime_parser_init_with_stream (CamelMimeParser *parser, CamelStream *stream);
-
-/* get the stream or fd back of the parser */
-CamelStream *camel_mime_parser_stream (CamelMimeParser *parser);
-int camel_mime_parser_fd (CamelMimeParser *parser);
-
-/* scan 'From' separators? */
-void camel_mime_parser_scan_from (CamelMimeParser *parser, gboolean scan_from);
-/* Do we want to know about the pre-from data? */
-void camel_mime_parser_scan_pre_from (CamelMimeParser *parser, gboolean scan_pre_from);
-
-/* what headers to save, MUST include ^Content-Type: */
-int camel_mime_parser_set_header_regex (CamelMimeParser *parser, char *matchstr);
-
-/* normal interface */
-enum _camel_mime_parser_state camel_mime_parser_step (CamelMimeParser *parser, char **buf, size_t *buflen);
-void camel_mime_parser_unstep (CamelMimeParser *parser);
-void camel_mime_parser_drop_step (CamelMimeParser *parser);
-enum _camel_mime_parser_state camel_mime_parser_state (CamelMimeParser *parser);
-
-/* read through the parser */
-int camel_mime_parser_read (CamelMimeParser *parser, const char **databuffer, int len);
-
-/* get content type for the current part/header */
-CamelContentType *camel_mime_parser_content_type (CamelMimeParser *parser);
-
-/* get/change raw header by name */
-const char *camel_mime_parser_header (CamelMimeParser *parser, const char *name, int *offset);
-
-/* get all raw headers. READ ONLY! */
-struct _camel_header_raw *camel_mime_parser_headers_raw (CamelMimeParser *parser);
-
-/* get multipart pre/postface */
-const char *camel_mime_parser_preface (CamelMimeParser *parser);
-const char *camel_mime_parser_postface (CamelMimeParser *parser);
-
-/* return the from line content */
-const char *camel_mime_parser_from_line (CamelMimeParser *parser);
-
-/* add a processing filter for body contents */
-int camel_mime_parser_filter_add (CamelMimeParser *parser, CamelMimeFilter *filter);
-void camel_mime_parser_filter_remove (CamelMimeParser *parser, int id);
-
-/* these should be used with caution, because the state will not
- track the seeked position */
-/* FIXME: something to bootstrap the state? */
-off_t camel_mime_parser_tell (CamelMimeParser *parser);
-off_t camel_mime_parser_seek (CamelMimeParser *parser, off_t offset, int whence);
-
-off_t camel_mime_parser_tell_start_headers (CamelMimeParser *parser);
-off_t camel_mime_parser_tell_start_from (CamelMimeParser *parser);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* ! _CAMEL_MIME_PARSER_H */
diff --git a/camel/camel-mime-part-utils.c b/camel/camel-mime-part-utils.c
deleted file mode 100644
index f063b3af80..0000000000
--- a/camel/camel-mime-part-utils.c
+++ /dev/null
@@ -1,137 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; fill-column: 160 -*- */
-/* camel-mime-part-utils : Utility for mime parsing and so on
- *
- * Authors: Bertrand Guiheneuf <bertrand@helixcode.com>
- * Michael Zucchi <notzed@ximian.com>
- * Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 1999-2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <ctype.h>
-#include <errno.h>
-
-#include <gal/util/e-iconv.h>
-
-#include "camel-charset-map.h"
-#include "camel-mime-part-utils.h"
-#include "camel-mime-message.h"
-#include "camel-multipart.h"
-#include "camel-multipart-signed.h"
-#include "camel-multipart-encrypted.h"
-#include "camel-seekable-substream.h"
-#include "camel-stream-fs.h"
-#include "camel-stream-filter.h"
-#include "camel-stream-mem.h"
-#include "camel-mime-filter-basic.h"
-#include "camel-mime-filter-charset.h"
-#include "camel-mime-filter-crlf.h"
-#include "camel-mime-filter-save.h"
-#include "camel-html-parser.h"
-
-#define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))
- #include <stdio.h>*/
-
-/* simple data wrapper */
-static void
-simple_data_wrapper_construct_from_parser (CamelDataWrapper *dw, CamelMimeParser *mp)
-{
- char *buf;
- GByteArray *buffer;
- CamelStream *mem;
- size_t len;
-
- d(printf ("simple_data_wrapper_construct_from_parser()\n"));
-
- /* read in the entire content */
- buffer = g_byte_array_new ();
- while (camel_mime_parser_step (mp, &buf, &len) != CAMEL_MIME_PARSER_STATE_BODY_END) {
- d(printf("appending o/p data: %d: %.*s\n", len, len, buf));
- g_byte_array_append (buffer, buf, len);
- }
-
- d(printf("message part kept in memory!\n"));
-
- mem = camel_stream_mem_new_with_byte_array (buffer);
- camel_data_wrapper_construct_from_stream (dw, mem);
- camel_object_unref (mem);
-}
-
-/* This replaces the data wrapper repository ... and/or could be replaced by it? */
-void
-camel_mime_part_construct_content_from_parser (CamelMimePart *dw, CamelMimeParser *mp)
-{
- CamelDataWrapper *content = NULL;
- CamelContentType *ct;
- char *encoding;
-
- ct = camel_mime_parser_content_type (mp);
-
- encoding = camel_content_transfer_encoding_decode (camel_mime_parser_header (mp, "Content-Transfer-Encoding", NULL));
-
- switch (camel_mime_parser_state (mp)) {
- case CAMEL_MIME_PARSER_STATE_HEADER:
- d(printf("Creating body part\n"));
- /* multipart/signed is some fucked up type that we must treat as binary data, fun huh, idiots. */
- if (camel_content_type_is (ct, "multipart", "signed")) {
- content = (CamelDataWrapper *) camel_multipart_signed_new ();
- camel_multipart_construct_from_parser ((CamelMultipart *) content, mp);
- } else {
- content = camel_data_wrapper_new ();
- simple_data_wrapper_construct_from_parser (content, mp);
- }
- break;
- case CAMEL_MIME_PARSER_STATE_MESSAGE:
- d(printf("Creating message part\n"));
- content = (CamelDataWrapper *) camel_mime_message_new ();
- camel_mime_part_construct_from_parser ((CamelMimePart *)content, mp);
- break;
- case CAMEL_MIME_PARSER_STATE_MULTIPART:
- d(printf("Creating multi-part\n"));
- if (camel_content_type_is (ct, "multipart", "encrypted"))
- content = (CamelDataWrapper *) camel_multipart_encrypted_new ();
- else if (camel_content_type_is (ct, "multipart", "signed"))
- content = (CamelDataWrapper *) camel_multipart_signed_new ();
- else
- content = (CamelDataWrapper *) camel_multipart_new ();
-
- camel_multipart_construct_from_parser((CamelMultipart *)content, mp);
- d(printf("Created multi-part\n"));
- break;
- default:
- g_warning("Invalid state encountered???: %d", camel_mime_parser_state (mp));
- }
-
- if (content) {
- if (encoding)
- content->encoding = camel_transfer_encoding_from_string (encoding);
-
- /* would you believe you have to set this BEFORE you set the content object??? oh my god !!!! */
- camel_data_wrapper_set_mime_type_field (content, camel_mime_part_get_content_type (dw));
- camel_medium_set_content_object ((CamelMedium *)dw, content);
- camel_object_unref (content);
- }
-
- g_free (encoding);
-}
diff --git a/camel/camel-mime-part-utils.h b/camel/camel-mime-part-utils.h
deleted file mode 100644
index 576f7bd3e4..0000000000
--- a/camel/camel-mime-part-utils.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-mime-part-utils : Utility for mime parsing and so on */
-
-
-/*
- *
- * Author :
- * Bertrand Guiheneuf <bertrand@helixcode.com>
- *
- * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifndef CAMEL_MIME_PART_UTILS_H
-#define CAMEL_MIME_PART_UTILS_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include <camel/camel-mime-part.h>
-
-void camel_mime_part_construct_content_from_parser(CamelMimePart *, CamelMimeParser *mp);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_MIME_PART_UTILS_H */
-
diff --git a/camel/camel-mime-part.c b/camel/camel-mime-part.c
deleted file mode 100644
index 3a57a51970..0000000000
--- a/camel/camel-mime-part.c
+++ /dev/null
@@ -1,912 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; fill-column: 160 -*- */
-/* camelMimePart.c : Abstract class for a mime_part */
-
-/*
- * Authors: Bertrand Guiheneuf <bertrand@helixcode.com>
- * Michael Zucchi <notzed@ximian.com>
- * Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 1999-2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <errno.h>
-
-#include <gal/util/e-iconv.h>
-
-#include "camel-mime-parser.h"
-#include "camel-stream-mem.h"
-#include "camel-stream-filter.h"
-#include "camel-mime-filter-basic.h"
-#include "camel-mime-filter-crlf.h"
-#include "camel-mime-filter-charset.h"
-#include "camel-mime-part.h"
-#include "camel-mime-part-utils.h"
-#include "camel-mime-utils.h"
-#include "camel-exception.h"
-#include "camel-charset-map.h"
-#include "camel-string-utils.h"
-
-#define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))*/
-
-typedef enum {
- HEADER_UNKNOWN,
- HEADER_DESCRIPTION,
- HEADER_DISPOSITION,
- HEADER_CONTENT_ID,
- HEADER_ENCODING,
- HEADER_CONTENT_MD5,
- HEADER_CONTENT_LOCATION,
- HEADER_CONTENT_LANGUAGES,
- HEADER_CONTENT_TYPE
-} CamelHeaderType;
-
-
-static GHashTable *header_name_table;
-static GHashTable *header_formatted_table;
-
-static CamelMediumClass *parent_class=NULL;
-
-/* Returns the class for a CamelMimePart */
-#define CMP_CLASS(so) CAMEL_MIME_PART_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-#define CDW_CLASS(so) CAMEL_DATA_WRAPPER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-#define CMD_CLASS(so) CAMEL_MEDIUM_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-
-/* from CamelDataWrapper */
-static ssize_t write_to_stream (CamelDataWrapper *dw, CamelStream *stream);
-static int construct_from_stream (CamelDataWrapper *dw, CamelStream *stream);
-
-/* from CamelMedium */
-static void add_header (CamelMedium *medium, const char *name, const void *value);
-static void set_header (CamelMedium *medium, const char *name, const void *value);
-static void remove_header (CamelMedium *medium, const char *name);
-static const void *get_header (CamelMedium *medium, const char *name);
-static GArray *get_headers (CamelMedium *medium);
-static void free_headers (CamelMedium *medium, GArray *headers);
-
-static void set_content_object (CamelMedium *medium, CamelDataWrapper *content);
-
-/* from camel mime parser */
-static int construct_from_parser (CamelMimePart *mime_part, CamelMimeParser *mp);
-
-/* forward references */
-static void set_disposition (CamelMimePart *mime_part, const char *disposition);
-
-/* format output of headers */
-static int write_references(CamelStream *stream, struct _camel_header_raw *h);
-/*static int write_fold(CamelStream *stream, struct _camel_header_raw *h);*/
-static int write_raw(CamelStream *stream, struct _camel_header_raw *h);
-
-
-/* loads in a hash table the set of header names we */
-/* recognize and associate them with a unique enum */
-/* identifier (see CamelHeaderType above) */
-static void
-init_header_name_table()
-{
- header_name_table = g_hash_table_new (camel_strcase_hash, camel_strcase_equal);
- g_hash_table_insert (header_name_table, "Content-Description", (gpointer)HEADER_DESCRIPTION);
- g_hash_table_insert (header_name_table, "Content-Disposition", (gpointer)HEADER_DISPOSITION);
- g_hash_table_insert (header_name_table, "Content-id", (gpointer)HEADER_CONTENT_ID);
- g_hash_table_insert (header_name_table, "Content-Transfer-Encoding", (gpointer)HEADER_ENCODING);
- g_hash_table_insert (header_name_table, "Content-MD5", (gpointer)HEADER_CONTENT_MD5);
- g_hash_table_insert (header_name_table, "Content-Location", (gpointer)HEADER_CONTENT_LOCATION);
- g_hash_table_insert (header_name_table, "Content-Type", (gpointer)HEADER_CONTENT_TYPE);
-
- header_formatted_table = g_hash_table_new (camel_strcase_hash, camel_strcase_equal);
- g_hash_table_insert(header_formatted_table, "Content-Type", write_raw);
- g_hash_table_insert(header_formatted_table, "Content-Disposition", write_raw);
- g_hash_table_insert(header_formatted_table, "To", write_raw);
- g_hash_table_insert(header_formatted_table, "From", write_raw);
- g_hash_table_insert(header_formatted_table, "Reply-To", write_raw);
- g_hash_table_insert(header_formatted_table, "Cc", write_raw);
- g_hash_table_insert(header_formatted_table, "Bcc", write_raw);
- g_hash_table_insert(header_formatted_table, "Message-ID", write_raw);
- g_hash_table_insert(header_formatted_table, "In-Reply-To", write_raw);
- g_hash_table_insert(header_formatted_table, "References", write_references);
-}
-
-static void
-camel_mime_part_class_init (CamelMimePartClass *camel_mime_part_class)
-{
- CamelMediumClass *camel_medium_class = CAMEL_MEDIUM_CLASS (camel_mime_part_class);
- CamelDataWrapperClass *camel_data_wrapper_class = CAMEL_DATA_WRAPPER_CLASS (camel_mime_part_class);
-
- parent_class = CAMEL_MEDIUM_CLASS (camel_type_get_global_classfuncs (camel_medium_get_type ()));
- init_header_name_table();
-
- camel_mime_part_class->construct_from_parser = construct_from_parser;
-
- /* virtual method overload */
- camel_medium_class->add_header = add_header;
- camel_medium_class->set_header = set_header;
- camel_medium_class->get_header = get_header;
- camel_medium_class->remove_header = remove_header;
- camel_medium_class->get_headers = get_headers;
- camel_medium_class->free_headers = free_headers;
- camel_medium_class->set_content_object = set_content_object;
-
- camel_data_wrapper_class->write_to_stream = write_to_stream;
- camel_data_wrapper_class->construct_from_stream= construct_from_stream;
-}
-
-static void
-camel_mime_part_init (gpointer object, gpointer klass)
-{
- CamelMimePart *mime_part = CAMEL_MIME_PART (object);
-
- if (((CamelDataWrapper *) mime_part)->mime_type)
- camel_content_type_unref (((CamelDataWrapper *) mime_part)->mime_type);
- ((CamelDataWrapper *) mime_part)->mime_type = camel_content_type_new ("text", "plain");
-
- mime_part->description = NULL;
- mime_part->disposition = NULL;
- mime_part->content_id = NULL;
- mime_part->content_MD5 = NULL;
- mime_part->content_location = NULL;
- mime_part->content_languages = NULL;
- mime_part->encoding = CAMEL_TRANSFER_ENCODING_DEFAULT;
-}
-
-
-static void
-camel_mime_part_finalize (CamelObject *object)
-{
- CamelMimePart *mime_part = CAMEL_MIME_PART (object);
-
- g_free (mime_part->description);
- g_free (mime_part->content_id);
- g_free (mime_part->content_MD5);
- g_free (mime_part->content_location);
- camel_string_list_free (mime_part->content_languages);
- camel_content_disposition_unref(mime_part->disposition);
-
- camel_header_raw_clear(&mime_part->headers);
-}
-
-
-
-CamelType
-camel_mime_part_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (CAMEL_MEDIUM_TYPE,
- "CamelMimePart",
- sizeof (CamelMimePart),
- sizeof (CamelMimePartClass),
- (CamelObjectClassInitFunc) camel_mime_part_class_init,
- NULL,
- (CamelObjectInitFunc) camel_mime_part_init,
- (CamelObjectFinalizeFunc) camel_mime_part_finalize);
- }
-
- return type;
-}
-
-
-/* **** */
-
-static gboolean
-process_header(CamelMedium *medium, const char *name, const char *value)
-{
- CamelMimePart *mime_part = CAMEL_MIME_PART (medium);
- CamelHeaderType header_type;
- const char *charset;
- char *text;
-
- /* Try to parse the header pair. If it corresponds to something */
- /* known, the job is done in the parsing routine. If not, */
- /* we simply add the header in a raw fashion */
-
- header_type = (CamelHeaderType) g_hash_table_lookup (header_name_table, name);
- switch (header_type) {
- case HEADER_DESCRIPTION: /* raw header->utf8 conversion */
- g_free (mime_part->description);
- if (((CamelDataWrapper *) mime_part)->mime_type) {
- charset = camel_content_type_param (((CamelDataWrapper *) mime_part)->mime_type, "charset");
- charset = e_iconv_charset_name (charset);
- } else
- charset = NULL;
- mime_part->description = g_strstrip (camel_header_decode_string (value, charset));
- break;
- case HEADER_DISPOSITION:
- set_disposition (mime_part, value);
- break;
- case HEADER_CONTENT_ID:
- g_free (mime_part->content_id);
- mime_part->content_id = camel_header_contentid_decode (value);
- break;
- case HEADER_ENCODING:
- text = camel_header_token_decode (value);
- mime_part->encoding = camel_transfer_encoding_from_string (text);
- g_free (text);
- break;
- case HEADER_CONTENT_MD5:
- g_free (mime_part->content_MD5);
- mime_part->content_MD5 = g_strdup (value);
- break;
- case HEADER_CONTENT_LOCATION:
- g_free (mime_part->content_location);
- mime_part->content_location = camel_header_location_decode (value);
- break;
- case HEADER_CONTENT_TYPE:
- if (((CamelDataWrapper *) mime_part)->mime_type)
- camel_content_type_unref (((CamelDataWrapper *) mime_part)->mime_type);
- ((CamelDataWrapper *) mime_part)->mime_type = camel_content_type_decode (value);
- break;
- default:
- return FALSE;
- }
- return TRUE;
-}
-
-static void
-set_header (CamelMedium *medium, const char *name, const void *value)
-{
- CamelMimePart *part = CAMEL_MIME_PART (medium);
-
- process_header(medium, name, value);
- camel_header_raw_replace(&part->headers, name, value, -1);
-}
-
-static void
-add_header (CamelMedium *medium, const char *name, const void *value)
-{
- CamelMimePart *part = CAMEL_MIME_PART (medium);
-
- /* Try to parse the header pair. If it corresponds to something */
- /* known, the job is done in the parsing routine. If not, */
- /* we simply add the header in a raw fashion */
-
- /* If it was one of the headers we handled, it must be unique, set it instead of add */
- if (process_header(medium, name, value))
- camel_header_raw_replace(&part->headers, name, value, -1);
- else
- camel_header_raw_append(&part->headers, name, value, -1);
-}
-
-static void
-remove_header (CamelMedium *medium, const char *name)
-{
- CamelMimePart *part = (CamelMimePart *)medium;
-
- process_header(medium, name, NULL);
- camel_header_raw_remove(&part->headers, name);
-}
-
-static const void *
-get_header (CamelMedium *medium, const char *name)
-{
- CamelMimePart *part = (CamelMimePart *)medium;
-
- return camel_header_raw_find(&part->headers, name, NULL);
-}
-
-static GArray *
-get_headers (CamelMedium *medium)
-{
- CamelMimePart *part = (CamelMimePart *)medium;
- GArray *headers;
- CamelMediumHeader header;
- struct _camel_header_raw *h;
-
- headers = g_array_new (FALSE, FALSE, sizeof (CamelMediumHeader));
- for (h = part->headers; h; h = h->next) {
- header.name = h->name;
- header.value = h->value;
- g_array_append_val (headers, header);
- }
-
- return headers;
-}
-
-static void
-free_headers (CamelMedium *medium, GArray *gheaders)
-{
- g_array_free (gheaders, TRUE);
-}
-
-/* **** Content-Description */
-void
-camel_mime_part_set_description (CamelMimePart *mime_part, const char *description)
-{
- char *text = camel_header_encode_string (description);
-
- camel_medium_set_header (CAMEL_MEDIUM (mime_part),
- "Content-Description", text);
- g_free (text);
-}
-
-const char *
-camel_mime_part_get_description (CamelMimePart *mime_part)
-{
- return mime_part->description;
-}
-
-/* **** Content-Disposition */
-
-static void
-set_disposition (CamelMimePart *mime_part, const char *disposition)
-{
- camel_content_disposition_unref(mime_part->disposition);
- if (disposition)
- mime_part->disposition = camel_content_disposition_decode(disposition);
- else
- mime_part->disposition = NULL;
-}
-
-
-void
-camel_mime_part_set_disposition (CamelMimePart *mime_part, const char *disposition)
-{
- char *text;
-
- /* we poke in a new disposition (so we dont lose 'filename', etc) */
- if (mime_part->disposition == NULL) {
- set_disposition(mime_part, disposition);
- }
- if (mime_part->disposition != NULL) {
- g_free(mime_part->disposition->disposition);
- mime_part->disposition->disposition = g_strdup(disposition);
- }
- text = camel_content_disposition_format(mime_part->disposition);
-
- camel_medium_set_header (CAMEL_MEDIUM (mime_part),
- "Content-Disposition", text);
-
- g_free(text);
-}
-
-const char *
-camel_mime_part_get_disposition (CamelMimePart *mime_part)
-{
- if (mime_part->disposition)
- return (mime_part->disposition)->disposition;
- else
- return NULL;
-}
-
-
-/* **** Content-Disposition: filename="xxx" */
-
-void
-camel_mime_part_set_filename (CamelMimePart *mime_part, const char *filename)
-{
- char *str;
-
- if (mime_part->disposition == NULL)
- mime_part->disposition = camel_content_disposition_decode("attachment");
-
- camel_header_set_param(&mime_part->disposition->params, "filename", filename);
- str = camel_content_disposition_format(mime_part->disposition);
-
- camel_medium_set_header (CAMEL_MEDIUM (mime_part),
- "Content-Disposition", str);
- g_free(str);
-
- camel_content_type_set_param (((CamelDataWrapper *) mime_part)->mime_type, "name", filename);
- str = camel_content_type_format (((CamelDataWrapper *) mime_part)->mime_type);
- camel_medium_set_header (CAMEL_MEDIUM (mime_part), "Content-Type", str);
- g_free (str);
-}
-
-const char *
-camel_mime_part_get_filename (CamelMimePart *mime_part)
-{
- if (mime_part->disposition) {
- const char *name = camel_header_param (mime_part->disposition->params, "filename");
- if (name)
- return name;
- }
-
- return camel_content_type_param (((CamelDataWrapper *) mime_part)->mime_type, "name");
-}
-
-
-/* **** Content-ID: */
-
-void
-camel_mime_part_set_content_id (CamelMimePart *mime_part, const char *contentid)
-{
- char *cid, *id;
-
- if (contentid)
- id = g_strstrip (g_strdup (contentid));
- else
- id = camel_header_msgid_generate ();
-
- cid = g_strdup_printf ("<%s>", id);
- g_free (id);
- camel_medium_set_header (CAMEL_MEDIUM (mime_part), "Content-ID", cid);
- g_free (cid);
-}
-
-const char *
-camel_mime_part_get_content_id (CamelMimePart *mime_part)
-{
- return mime_part->content_id;
-}
-
-/* **** Content-MD5: */
-
-void
-camel_mime_part_set_content_MD5 (CamelMimePart *mime_part, const char *md5)
-{
- camel_medium_set_header (CAMEL_MEDIUM (mime_part), "Content-MD5", md5);
-}
-
-const char *
-camel_mime_part_get_content_MD5 (CamelMimePart *mime_part)
-{
- return mime_part->content_MD5;
-}
-
-/* **** Content-MD5: */
-
-void
-camel_mime_part_set_content_location (CamelMimePart *mime_part, const char *location)
-{
- camel_medium_set_header (CAMEL_MEDIUM (mime_part), "Content-Location", location);
-}
-
-const char *
-camel_mime_part_get_content_location (CamelMimePart *mime_part)
-{
- return mime_part->content_location;
-}
-
-/* **** Content-Transfer-Encoding: */
-
-void
-camel_mime_part_set_encoding (CamelMimePart *mime_part,
- CamelTransferEncoding encoding)
-{
- const char *text;
-
- text = camel_transfer_encoding_to_string (encoding);
- camel_medium_set_header (CAMEL_MEDIUM (mime_part),
- "Content-Transfer-Encoding", text);
-}
-
-CamelTransferEncoding
-camel_mime_part_get_encoding (CamelMimePart *mime_part)
-{
- return mime_part->encoding;
-}
-
-/* FIXME: do something with this stuff ... */
-
-void
-camel_mime_part_set_content_languages (CamelMimePart *mime_part, GList *content_languages)
-{
- if (mime_part->content_languages)
- camel_string_list_free (mime_part->content_languages);
-
- mime_part->content_languages = content_languages;
-
- /* FIXME: translate to a header and set it */
-}
-
-const GList *
-camel_mime_part_get_content_languages (CamelMimePart *mime_part)
-{
- return mime_part->content_languages;
-}
-
-
-/* **** */
-
-/* **** Content-Type: */
-
-void
-camel_mime_part_set_content_type (CamelMimePart *mime_part, const char *content_type)
-{
- camel_medium_set_header (CAMEL_MEDIUM (mime_part),
- "Content-Type", content_type);
-}
-
-CamelContentType *
-camel_mime_part_get_content_type (CamelMimePart *mime_part)
-{
- return ((CamelDataWrapper *) mime_part)->mime_type;
-}
-
-
-static void
-set_content_object (CamelMedium *medium, CamelDataWrapper *content)
-{
- CamelDataWrapper *mime_part = CAMEL_DATA_WRAPPER (medium);
- CamelContentType *content_type;
-
- parent_class->set_content_object (medium, content);
-
- content_type = camel_data_wrapper_get_mime_type_field (content);
- if (mime_part->mime_type != content_type) {
- char *txt;
-
- txt = camel_content_type_format (content_type);
- camel_medium_set_header (CAMEL_MEDIUM (mime_part), "Content-Type", txt);
- g_free (txt);
- }
-}
-
-/**********************************************************************/
-
-static ssize_t
-write_references(CamelStream *stream, struct _camel_header_raw *h)
-{
- ssize_t len, out, total;
- char *v, *ids, *ide;
-
- /* this is only approximate, based on the next >, this way it retains any content
- from the original which may not be properly formatted, etc. It also doesn't handle
- the case where an individual messageid is too long, however thats a bad mail to
- start with ... */
-
- v = h->value;
- len = strlen(h->name)+1;
- total = camel_stream_printf(stream, "%s%s", h->name, isspace(v[0])?":":": ");
- if (total == -1)
- return -1;
- while (*v) {
- ids = v;
- ide = strchr(ids+1, '>');
- if (ide)
- v = ++ide;
- else
- ide = v = strlen(ids)+ids;
-
- if (len>0 && len + (ide - ids) >= CAMEL_FOLD_SIZE) {
- out = camel_stream_printf(stream, "\n\t");
- if (out == -1)
- return -1;
- total += out;
- len = 0;
- }
- out = camel_stream_write(stream, ids, ide-ids);
- if (out == -1)
- return -1;
- len += out;
- total += out;
- }
- camel_stream_write(stream, "\n", 1);
-
- return total;
-}
-
-#if 0
-/* not needed - yet - handled by default case */
-static ssize_t
-write_fold(CamelStream *stream, struct _camel_header_raw *h)
-{
- char *val;
- int count;
-
- val = camel_header_fold(h->value, strlen(h->name));
- count = camel_stream_printf(stream, "%s%s%s\n", h->name, isspace(val[0]) ? ":" : ": ", val);
- g_free(val);
-
- return count;
-}
-#endif
-
-static ssize_t
-write_raw(CamelStream *stream, struct _camel_header_raw *h)
-{
- char *val = h->value;
-
- return camel_stream_printf(stream, "%s%s%s\n", h->name, isspace(val[0]) ? ":" : ": ", val);
-}
-
-static ssize_t
-write_to_stream (CamelDataWrapper *dw, CamelStream *stream)
-{
- CamelMimePart *mp = CAMEL_MIME_PART (dw);
- CamelMedium *medium = CAMEL_MEDIUM (dw);
- CamelStream *ostream = stream;
- CamelDataWrapper *content;
- ssize_t total = 0;
- ssize_t count;
- int errnosav;
-
- d(printf("mime_part::write_to_stream\n"));
-
- /* FIXME: something needs to be done about this ... */
- /* TODO: content-languages header? */
-
- if (mp->headers) {
- struct _camel_header_raw *h = mp->headers;
- char *val;
- ssize_t (*writefn)(CamelStream *stream, struct _camel_header_raw *);
-
- /* fold/write the headers. But dont fold headers that are already formatted
- (e.g. ones with parameter-lists, that we know about, and have created) */
- while (h) {
- val = h->value;
- if (val == NULL) {
- g_warning("h->value is NULL here for %s", h->name);
- count = 0;
- } else if ((writefn = g_hash_table_lookup(header_formatted_table, h->name)) == NULL) {
- val = camel_header_fold(val, strlen(h->name));
- count = camel_stream_printf(stream, "%s%s%s\n", h->name, isspace(val[0]) ? ":" : ": ", val);
- g_free(val);
- } else {
- count = writefn(stream, h);
- }
- if (count == -1)
- return -1;
- total += count;
- h = h->next;
- }
- }
-
- count = camel_stream_write(stream, "\n", 1);
- if (count == -1)
- return -1;
- total += count;
-
- content = camel_medium_get_content_object(medium);
- if (content) {
- CamelMimeFilter *filter = NULL;
- CamelStreamFilter *filter_stream = NULL;
- CamelMimeFilter *charenc = NULL;
- const char *content_charset = NULL;
- const char *part_charset = NULL;
- gboolean reencode = FALSE;
- const char *filename;
-
- if (camel_content_type_is (dw->mime_type, "text", "*")) {
- content_charset = camel_content_type_param (content->mime_type, "charset");
- part_charset = camel_content_type_param (dw->mime_type, "charset");
-
- if (content_charset && part_charset) {
- content_charset = e_iconv_charset_name (content_charset);
- part_charset = e_iconv_charset_name (part_charset);
- }
- }
-
- if (mp->encoding != content->encoding) {
- switch (mp->encoding) {
- case CAMEL_TRANSFER_ENCODING_BASE64:
- filter = (CamelMimeFilter *) camel_mime_filter_basic_new_type (CAMEL_MIME_FILTER_BASIC_BASE64_ENC);
- break;
- case CAMEL_TRANSFER_ENCODING_QUOTEDPRINTABLE:
- filter = (CamelMimeFilter *) camel_mime_filter_basic_new_type (CAMEL_MIME_FILTER_BASIC_QP_ENC);
- break;
- case CAMEL_TRANSFER_ENCODING_UUENCODE:
- filename = camel_mime_part_get_filename (mp);
- count = camel_stream_printf (ostream, "begin 644 %s\n", filename ? filename : "untitled");
- if (count == -1)
- return -1;
- total += count;
- filter = (CamelMimeFilter *) camel_mime_filter_basic_new_type (CAMEL_MIME_FILTER_BASIC_UU_ENC);
- break;
- default:
- /* content is encoded but the part doesn't want to be... */
- reencode = TRUE;
- break;
- }
- }
-
- if (content_charset && part_charset && part_charset != content_charset)
- charenc = (CamelMimeFilter *) camel_mime_filter_charset_new_convert (content_charset, part_charset);
-
- if (filter || charenc) {
- filter_stream = camel_stream_filter_new_with_stream(stream);
-
- /* if we have a character encoder, add that always */
- if (charenc) {
- camel_stream_filter_add(filter_stream, charenc);
- camel_object_unref (charenc);
- }
-
- /* we only re-do crlf on encoded blocks */
- if (filter && camel_content_type_is (dw->mime_type, "text", "*")) {
- CamelMimeFilter *crlf = camel_mime_filter_crlf_new(CAMEL_MIME_FILTER_CRLF_ENCODE,
- CAMEL_MIME_FILTER_CRLF_MODE_CRLF_ONLY);
-
- camel_stream_filter_add(filter_stream, crlf);
- camel_object_unref (crlf);
- }
-
- if (filter) {
- camel_stream_filter_add(filter_stream, filter);
- camel_object_unref (filter);
- }
-
- stream = (CamelStream *)filter_stream;
-
- reencode = TRUE;
- }
-
- if (reencode)
- count = camel_data_wrapper_decode_to_stream (content, stream);
- else
- count = camel_data_wrapper_write_to_stream (content, stream);
-
- if (filter_stream) {
- errnosav = errno;
- camel_stream_flush (stream);
- camel_object_unref (filter_stream);
- errno = errnosav;
- }
-
- if (count == -1)
- return -1;
-
- total += count;
-
- if (reencode && mp->encoding == CAMEL_TRANSFER_ENCODING_UUENCODE) {
- count = camel_stream_write (ostream, "end\n", 4);
- if (count == -1)
- return -1;
- total += count;
- }
- } else {
- g_warning("No content for medium, nothing to write");
- }
-
- return total;
-}
-
-/* mime_part */
-static int
-construct_from_parser (CamelMimePart *mime_part, CamelMimeParser *mp)
-{
- CamelDataWrapper *dw = (CamelDataWrapper *) mime_part;
- struct _camel_header_raw *headers;
- const char *content;
- char *buf;
- size_t len;
- int err;
-
- d(printf("mime_part::construct_from_parser()\n"));
-
- switch (camel_mime_parser_step(mp, &buf, &len)) {
- case CAMEL_MIME_PARSER_STATE_MESSAGE:
- /* set the default type of a message always */
- if (dw->mime_type)
- camel_content_type_unref (dw->mime_type);
- dw->mime_type = camel_content_type_decode ("message/rfc822");
- case CAMEL_MIME_PARSER_STATE_HEADER:
- case CAMEL_MIME_PARSER_STATE_MULTIPART:
- /* we have the headers, build them into 'us' */
- headers = camel_mime_parser_headers_raw(mp);
-
- /* if content-type exists, process it first, set for fallback charset in headers */
- content = camel_header_raw_find(&headers, "content-type", NULL);
- if (content)
- process_header((CamelMedium *)dw, "content-type", content);
-
- while (headers) {
- if (strcasecmp(headers->name, "content-type") == 0
- && headers->value != content)
- camel_medium_add_header((CamelMedium *)dw, "X-Invalid-Content-Type", headers->value);
- else
- camel_medium_add_header((CamelMedium *)dw, headers->name, headers->value);
- headers = headers->next;
- }
-
- camel_mime_part_construct_content_from_parser (mime_part, mp);
- break;
- default:
- g_warning("Invalid state encountered???: %d", camel_mime_parser_state(mp));
- }
-
- d(printf("mime_part::construct_from_parser() leaving\n"));
- err = camel_mime_parser_errno(mp);
- if (err != 0) {
- errno = err;
- return -1;
- }
-
- return 0;
-}
-
-/**
- * camel_mime_part_construct_from_parser:
- * @mime_part:
- * @mp:
- *
- *
- *
- * Return value:
- **/
-int
-camel_mime_part_construct_from_parser(CamelMimePart *mime_part, CamelMimeParser *mp)
-{
- return CMP_CLASS (mime_part)->construct_from_parser (mime_part, mp);
-}
-
-static int
-construct_from_stream(CamelDataWrapper *dw, CamelStream *s)
-{
- CamelMimeParser *mp;
- int ret;
-
- d(printf("mime_part::construct_from_stream()\n"));
-
- mp = camel_mime_parser_new();
- if (camel_mime_parser_init_with_stream(mp, s) == -1) {
- g_warning("Cannot create parser for stream");
- ret = -1;
- } else {
- ret = camel_mime_part_construct_from_parser((CamelMimePart *)dw, mp);
- }
- camel_object_unref((CamelObject *)mp);
- return ret;
-}
-
-/******************************/
-/** Misc utility functions **/
-
-/**
- * camel_mime_part_new:
- *
- * Return value: a new CamelMimePart
- **/
-CamelMimePart *
-camel_mime_part_new (void)
-{
- return (CamelMimePart *)camel_object_new (CAMEL_MIME_PART_TYPE);
-}
-
-/**
- * camel_mime_part_set_content:
- * @camel_mime_part: Mime part
- * @data: data to put into the part
- * @length: length of @data
- * @type: Content-Type of the data
- *
- * Utility function used to set the content of a mime part object to
- * be the provided data. If @length is 0, this routine can be used as
- * a way to remove old content (in which case @data and @type are
- * ignored and may be %NULL).
- **/
-void
-camel_mime_part_set_content (CamelMimePart *camel_mime_part,
- const char *data, int length,
- const char *type) /* why on earth is the type last? */
-{
- CamelMedium *medium = CAMEL_MEDIUM (camel_mime_part);
-
- if (length) {
- CamelDataWrapper *dw;
- CamelStream *stream;
-
- dw = camel_data_wrapper_new ();
- camel_data_wrapper_set_mime_type (dw, type);
- stream = camel_stream_mem_new_with_buffer (data, length);
- camel_data_wrapper_construct_from_stream (dw, stream);
- camel_object_unref (stream);
- camel_medium_set_content_object (medium, dw);
- camel_object_unref (dw);
- } else {
- if (medium->content)
- camel_object_unref (medium->content);
- medium->content = NULL;
- }
-}
diff --git a/camel/camel-mime-part.h b/camel/camel-mime-part.h
deleted file mode 100644
index 2e7ea48a9c..0000000000
--- a/camel/camel-mime-part.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; fill-column: 160 -*- */
-/* camel-mime-part.h : class for a mime part */
-
-/*
- *
- * Authors: Bertrand Guiheneuf <bertrand@helixcode.com>
- * Michael Zucchi <notzed@ximian.com>
- *
- * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifndef CAMEL_MIME_PART_H
-#define CAMEL_MIME_PART_H 1
-
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <camel/camel-medium.h>
-#include <camel/camel-mime-utils.h>
-#include <camel/camel-mime-parser.h>
-
-#define CAMEL_MIME_PART_TYPE (camel_mime_part_get_type ())
-#define CAMEL_MIME_PART(obj) (CAMEL_CHECK_CAST((obj), CAMEL_MIME_PART_TYPE, CamelMimePart))
-#define CAMEL_MIME_PART_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_MIME_PART_TYPE, CamelMimePartClass))
-#define CAMEL_IS_MIME_PART(o) (CAMEL_CHECK_TYPE((o), CAMEL_MIME_PART_TYPE))
-
-/* Do not change these values directly, you would regret it one day */
-struct _CamelMimePart {
- CamelMedium parent_object;
-
- struct _camel_header_raw *headers; /* mime headers */
-
- /* All fields here are -** PRIVATE **- */
- /* TODO: these should be in a camelcontentinfo */
- char *description;
- CamelContentDisposition *disposition;
- char *content_id;
- char *content_MD5;
- char *content_location;
- GList *content_languages;
- CamelTransferEncoding encoding;
-};
-
-typedef struct _CamelMimePartClass {
- CamelMediumClass parent_class;
-
- /* Virtual methods */
- int (*construct_from_parser) (CamelMimePart *, CamelMimeParser *);
-} CamelMimePartClass;
-
-/* Standard Camel function */
-CamelType camel_mime_part_get_type (void);
-
-/* public methods */
-CamelMimePart * camel_mime_part_new (void);
-
-void camel_mime_part_set_description (CamelMimePart *mime_part, const char *description);
-const char *camel_mime_part_get_description (CamelMimePart *mime_part);
-
-void camel_mime_part_set_disposition (CamelMimePart *mime_part, const char *disposition);
-const char *camel_mime_part_get_disposition (CamelMimePart *mime_part);
-
-void camel_mime_part_set_filename (CamelMimePart *mime_part, const char *filename);
-const char *camel_mime_part_get_filename (CamelMimePart *mime_part);
-
-void camel_mime_part_set_content_id (CamelMimePart *mime_part, const char *contentid);
-const char *camel_mime_part_get_content_id (CamelMimePart *mime_part);
-
-void camel_mime_part_set_content_MD5 (CamelMimePart *mime_part, const char *);
-const char *camel_mime_part_get_content_MD5 (CamelMimePart *mime_part);
-
-void camel_mime_part_set_content_location (CamelMimePart *mime_part, const char *);
-const char *camel_mime_part_get_content_location (CamelMimePart *mime_part);
-
-void camel_mime_part_set_encoding (CamelMimePart *mime_part, CamelTransferEncoding type);
-CamelTransferEncoding camel_mime_part_get_encoding (CamelMimePart *mime_part);
-
-void camel_mime_part_set_content_languages (CamelMimePart *mime_part, GList *content_languages);
-const GList *camel_mime_part_get_content_languages (CamelMimePart *mime_part);
-
-/* FIXME: what about content-type parameters? what about major/minor parts? */
-void camel_mime_part_set_content_type (CamelMimePart *mime_part, const char *content_type);
-CamelContentType *camel_mime_part_get_content_type (CamelMimePart *mime_part);
-
-/* construction */
-int camel_mime_part_construct_from_parser (CamelMimePart *, CamelMimeParser *);
-
-/* utility functions */
-void camel_mime_part_set_content (CamelMimePart *camel_mime_part,
- const char *content, int length, const char *type);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_MIME_PART_H */
-
diff --git a/camel/camel-mime-utils.c b/camel/camel-mime-utils.c
deleted file mode 100644
index 88a7c2ad9b..0000000000
--- a/camel/camel-mime-utils.c
+++ /dev/null
@@ -1,4346 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2000-2003 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- * Jeffrey Stedfast <fejj@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-/* dont touch this file without my permission - Michael */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/param.h> /* for MAXHOSTNAMELEN */
-#include <sys/stat.h>
-#include <pthread.h>
-#include <unistd.h>
-#include <regex.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <ctype.h>
-#include <time.h>
-
-#ifndef MAXHOSTNAMELEN
-#define MAXHOSTNAMELEN 1024
-#endif
-
-#include <glib.h>
-#include <gal/util/e-iconv.h>
-#include <e-util/e-time-utils.h>
-
-#include "camel-mime-utils.h"
-#include "camel-charset-map.h"
-#include "camel-service.h" /* for camel_gethostbyname() */
-
-#ifndef CLEAN_DATE
-#include "broken-date-parser.h"
-#endif
-
-#if 0
-int strdup_count = 0;
-int malloc_count = 0;
-int free_count = 0;
-
-#define g_strdup(x) (strdup_count++, g_strdup(x))
-#define g_malloc(x) (malloc_count++, g_malloc(x))
-#define g_free(x) (free_count++, g_free(x))
-#endif
-
-/* for all non-essential warnings ... */
-#define w(x)
-
-#define d(x)
-#define d2(x)
-
-#define CAMEL_UUENCODE_CHAR(c) ((c) ? (c) + ' ' : '`')
-#define CAMEL_UUDECODE_CHAR(c) (((c) - ' ') & 077)
-
-static char *base64_alphabet =
-"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-
-static unsigned char tohex[16] = {
- '0', '1', '2', '3', '4', '5', '6', '7',
- '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
-};
-
-unsigned short camel_mime_special_table[256];
-static unsigned char camel_mime_base64_rank[256];
-
-/* Used by table initialisation code for special characters */
-#define CHARS_LWSP " \t\n\r"
-#define CHARS_TSPECIAL "()<>@,;:\\\"/[]?="
-#define CHARS_SPECIAL "()<>@,;:\\\".[]"
-#define CHARS_CSPECIAL "()\\\r" /* not in comments */
-#define CHARS_DSPECIAL "[]\\\r \t" /* not in domains */
-#define CHARS_ESPECIAL "()<>@,;:\"/[]?.=_" /* list of characters that must be encoded.
- encoded word in text specials: rfc 2047 5(1)*/
-#define CHARS_PSPECIAL "!*+-/" /* list of additional characters that can be left unencoded.
- encoded word in phrase specials: rfc 2047 5(3) */
-
-static void
-header_remove_bits(unsigned short bit, unsigned char *vals)
-{
- int i;
-
- for (i=0;vals[i];i++)
- camel_mime_special_table[vals[i]] &= ~ bit;
-}
-
-static void
-header_init_bits(unsigned short bit, unsigned short bitcopy, int remove, unsigned char *vals)
-{
- int i;
- int len = strlen(vals);
-
- if (!remove) {
- for (i=0;i<len;i++) {
- camel_mime_special_table[vals[i]] |= bit;
- }
- if (bitcopy) {
- for (i=0;i<256;i++) {
- if (camel_mime_special_table[i] & bitcopy)
- camel_mime_special_table[i] |= bit;
- }
- }
- } else {
- for (i=0;i<256;i++)
- camel_mime_special_table[i] |= bit;
- for (i=0;i<len;i++) {
- camel_mime_special_table[vals[i]] &= ~bit;
- }
- if (bitcopy) {
- for (i=0;i<256;i++) {
- if (camel_mime_special_table[i] & bitcopy)
- camel_mime_special_table[i] &= ~bit;
- }
- }
- }
-}
-
-static void
-header_decode_init(void)
-{
- int i;
-
- for (i=0;i<256;i++) {
- camel_mime_special_table[i] = 0;
- if (i<32)
- camel_mime_special_table[i] |= CAMEL_MIME_IS_CTRL;
- if ((i>=32 && i<=60) || (i>=62 && i<=126) || i==9)
- camel_mime_special_table[i] |= (CAMEL_MIME_IS_QPSAFE|CAMEL_MIME_IS_ESAFE);
- if ((i>='0' && i<='9') || (i>='a' && i<='z') || (i>='A' && i<= 'Z'))
- camel_mime_special_table[i] |= CAMEL_MIME_IS_PSAFE;
- }
- camel_mime_special_table[127] |= CAMEL_MIME_IS_CTRL;
- camel_mime_special_table[' '] |= CAMEL_MIME_IS_SPACE;
- header_init_bits(CAMEL_MIME_IS_LWSP, 0, 0, CHARS_LWSP);
- header_init_bits(CAMEL_MIME_IS_TSPECIAL, CAMEL_MIME_IS_CTRL, 0, CHARS_TSPECIAL);
- header_init_bits(CAMEL_MIME_IS_SPECIAL, 0, 0, CHARS_SPECIAL);
- header_init_bits(CAMEL_MIME_IS_DSPECIAL, 0, FALSE, CHARS_DSPECIAL);
- header_remove_bits(CAMEL_MIME_IS_ESAFE, CHARS_ESPECIAL);
- header_init_bits(CAMEL_MIME_IS_PSAFE, 0, 0, CHARS_PSPECIAL);
-}
-
-static void
-base64_init(void)
-{
- int i;
-
- memset(camel_mime_base64_rank, 0xff, sizeof(camel_mime_base64_rank));
- for (i=0;i<64;i++) {
- camel_mime_base64_rank[(unsigned int)base64_alphabet[i]] = i;
- }
- camel_mime_base64_rank['='] = 0;
-}
-
-/* call this when finished encoding everything, to
- flush off the last little bit */
-size_t
-camel_base64_encode_close(unsigned char *in, size_t inlen, gboolean break_lines, unsigned char *out, int *state, int *save)
-{
- int c1, c2;
- unsigned char *outptr = out;
-
- if (inlen>0)
- outptr += camel_base64_encode_step(in, inlen, break_lines, outptr, state, save);
-
- c1 = ((unsigned char *)save)[1];
- c2 = ((unsigned char *)save)[2];
-
- d(printf("mode = %d\nc1 = %c\nc2 = %c\n",
- (int)((char *)save)[0],
- (int)((char *)save)[1],
- (int)((char *)save)[2]));
-
- switch (((char *)save)[0]) {
- case 2:
- outptr[2] = base64_alphabet[ ( (c2 &0x0f) << 2 ) ];
- g_assert(outptr[2] != 0);
- goto skip;
- case 1:
- outptr[2] = '=';
- skip:
- outptr[0] = base64_alphabet[ c1 >> 2 ];
- outptr[1] = base64_alphabet[ c2 >> 4 | ( (c1&0x3) << 4 )];
- outptr[3] = '=';
- outptr += 4;
- break;
- }
- if (break_lines)
- *outptr++ = '\n';
-
- *save = 0;
- *state = 0;
-
- return outptr-out;
-}
-
-/*
- performs an 'encode step', only encodes blocks of 3 characters to the
- output at a time, saves left-over state in state and save (initialise to
- 0 on first invocation).
-*/
-size_t
-camel_base64_encode_step(unsigned char *in, size_t len, gboolean break_lines, unsigned char *out, int *state, int *save)
-{
- register unsigned char *inptr, *outptr;
-
- if (len<=0)
- return 0;
-
- inptr = in;
- outptr = out;
-
- d(printf("we have %d chars, and %d saved chars\n", len, ((char *)save)[0]));
-
- if (len + ((char *)save)[0] > 2) {
- unsigned char *inend = in+len-2;
- register int c1, c2, c3;
- register int already;
-
- already = *state;
-
- switch (((char *)save)[0]) {
- case 1: c1 = ((unsigned char *)save)[1]; goto skip1;
- case 2: c1 = ((unsigned char *)save)[1];
- c2 = ((unsigned char *)save)[2]; goto skip2;
- }
-
- /* yes, we jump into the loop, no i'm not going to change it, it's beautiful! */
- while (inptr < inend) {
- c1 = *inptr++;
- skip1:
- c2 = *inptr++;
- skip2:
- c3 = *inptr++;
- *outptr++ = base64_alphabet[ c1 >> 2 ];
- *outptr++ = base64_alphabet[ c2 >> 4 | ( (c1&0x3) << 4 ) ];
- *outptr++ = base64_alphabet[ ( (c2 &0x0f) << 2 ) | (c3 >> 6) ];
- *outptr++ = base64_alphabet[ c3 & 0x3f ];
- /* this is a bit ugly ... */
- if (break_lines && (++already)>=19) {
- *outptr++='\n';
- already = 0;
- }
- }
-
- ((char *)save)[0] = 0;
- len = 2-(inptr-inend);
- *state = already;
- }
-
- d(printf("state = %d, len = %d\n",
- (int)((char *)save)[0],
- len));
-
- if (len>0) {
- register char *saveout;
-
- /* points to the slot for the next char to save */
- saveout = & (((char *)save)[1]) + ((char *)save)[0];
-
- /* len can only be 0 1 or 2 */
- switch(len) {
- case 2: *saveout++ = *inptr++;
- case 1: *saveout++ = *inptr++;
- }
- ((char *)save)[0]+=len;
- }
-
- d(printf("mode = %d\nc1 = %c\nc2 = %c\n",
- (int)((char *)save)[0],
- (int)((char *)save)[1],
- (int)((char *)save)[2]));
-
- return outptr-out;
-}
-
-
-/**
- * camel_base64_decode_step: decode a chunk of base64 encoded data
- * @in: input stream
- * @len: max length of data to decode
- * @out: output stream
- * @state: holds the number of bits that are stored in @save
- * @save: leftover bits that have not yet been decoded
- *
- * Decodes a chunk of base64 encoded data
- **/
-size_t
-camel_base64_decode_step(unsigned char *in, size_t len, unsigned char *out, int *state, unsigned int *save)
-{
- register unsigned char *inptr, *outptr;
- unsigned char *inend, c;
- register unsigned int v;
- int i;
-
- inend = in+len;
- outptr = out;
-
- /* convert 4 base64 bytes to 3 normal bytes */
- v=*save;
- i=*state;
- inptr = in;
- while (inptr<inend) {
- c = camel_mime_base64_rank[*inptr++];
- if (c != 0xff) {
- v = (v<<6) | c;
- i++;
- if (i==4) {
- *outptr++ = v>>16;
- *outptr++ = v>>8;
- *outptr++ = v;
- i=0;
- }
- }
- }
-
- *save = v;
- *state = i;
-
- /* quick scan back for '=' on the end somewhere */
- /* fortunately we can drop 1 output char for each trailing = (upto 2) */
- i=2;
- while (inptr>in && i) {
- inptr--;
- if (camel_mime_base64_rank[*inptr] != 0xff) {
- if (*inptr == '=' && outptr>out)
- outptr--;
- i--;
- }
- }
-
- /* if i!= 0 then there is a truncation error! */
- return outptr-out;
-}
-
-char *
-camel_base64_encode_simple (const char *data, size_t len)
-{
- unsigned char *out;
- int state = 0, outlen;
- unsigned int save = 0;
-
- out = g_malloc (len * 4 / 3 + 5);
- outlen = camel_base64_encode_close ((unsigned char *)data, len, FALSE,
- out, &state, &save);
- out[outlen] = '\0';
- return (char *)out;
-}
-
-size_t
-camel_base64_decode_simple (char *data, size_t len)
-{
- int state = 0;
- unsigned int save = 0;
-
- return camel_base64_decode_step ((unsigned char *)data, len,
- (unsigned char *)data, &state, &save);
-}
-
-/**
- * camel_uuencode_close: uuencode a chunk of data
- * @in: input stream
- * @len: input stream length
- * @out: output stream
- * @uubuf: temporary buffer of 60 bytes
- * @state: holds the number of bits that are stored in @save
- * @save: leftover bits that have not yet been encoded
- *
- * Returns the number of bytes encoded. Call this when finished
- * encoding data with camel_uuencode_step to flush off the last little
- * bit.
- **/
-size_t
-camel_uuencode_close (unsigned char *in, size_t len, unsigned char *out, unsigned char *uubuf, int *state, guint32 *save)
-{
- register unsigned char *outptr, *bufptr;
- register guint32 saved;
- int uulen, uufill, i;
-
- outptr = out;
-
- if (len > 0)
- outptr += camel_uuencode_step (in, len, out, uubuf, state, save);
-
- uufill = 0;
-
- saved = *save;
- i = *state & 0xff;
- uulen = (*state >> 8) & 0xff;
-
- bufptr = uubuf + ((uulen / 3) * 4);
-
- if (i > 0) {
- while (i < 3) {
- saved <<= 8 | 0;
- uufill++;
- i++;
- }
-
- if (i == 3) {
- /* convert 3 normal bytes into 4 uuencoded bytes */
- unsigned char b0, b1, b2;
-
- b0 = saved >> 16;
- b1 = saved >> 8 & 0xff;
- b2 = saved & 0xff;
-
- *bufptr++ = CAMEL_UUENCODE_CHAR ((b0 >> 2) & 0x3f);
- *bufptr++ = CAMEL_UUENCODE_CHAR (((b0 << 4) | ((b1 >> 4) & 0xf)) & 0x3f);
- *bufptr++ = CAMEL_UUENCODE_CHAR (((b1 << 2) | ((b2 >> 6) & 0x3)) & 0x3f);
- *bufptr++ = CAMEL_UUENCODE_CHAR (b2 & 0x3f);
-
- i = 0;
- saved = 0;
- uulen += 3;
- }
- }
-
- if (uulen > 0) {
- int cplen = ((uulen / 3) * 4);
-
- *outptr++ = CAMEL_UUENCODE_CHAR ((uulen - uufill) & 0xff);
- memcpy (outptr, uubuf, cplen);
- outptr += cplen;
- *outptr++ = '\n';
- uulen = 0;
- }
-
- *outptr++ = CAMEL_UUENCODE_CHAR (uulen & 0xff);
- *outptr++ = '\n';
-
- *save = 0;
- *state = 0;
-
- return outptr - out;
-}
-
-
-/**
- * camel_uuencode_step: uuencode a chunk of data
- * @in: input stream
- * @len: input stream length
- * @out: output stream
- * @uubuf: temporary buffer of 60 bytes
- * @state: holds the number of bits that are stored in @save
- * @save: leftover bits that have not yet been encoded
- *
- * Returns the number of bytes encoded. Performs an 'encode step',
- * only encodes blocks of 45 characters to the output at a time, saves
- * left-over state in @uubuf, @state and @save (initialize to 0 on first
- * invocation).
- **/
-size_t
-camel_uuencode_step (unsigned char *in, size_t len, unsigned char *out, unsigned char *uubuf, int *state, guint32 *save)
-{
- register unsigned char *inptr, *outptr, *bufptr;
- unsigned char *inend;
- register guint32 saved;
- int uulen, i;
-
- saved = *save;
- i = *state & 0xff;
- uulen = (*state >> 8) & 0xff;
-
- inptr = in;
- inend = in + len;
-
- outptr = out;
-
- bufptr = uubuf + ((uulen / 3) * 4);
-
- while (inptr < inend) {
- while (uulen < 45 && inptr < inend) {
- while (i < 3 && inptr < inend) {
- saved = (saved << 8) | *inptr++;
- i++;
- }
-
- if (i == 3) {
- /* convert 3 normal bytes into 4 uuencoded bytes */
- unsigned char b0, b1, b2;
-
- b0 = saved >> 16;
- b1 = saved >> 8 & 0xff;
- b2 = saved & 0xff;
-
- *bufptr++ = CAMEL_UUENCODE_CHAR ((b0 >> 2) & 0x3f);
- *bufptr++ = CAMEL_UUENCODE_CHAR (((b0 << 4) | ((b1 >> 4) & 0xf)) & 0x3f);
- *bufptr++ = CAMEL_UUENCODE_CHAR (((b1 << 2) | ((b2 >> 6) & 0x3)) & 0x3f);
- *bufptr++ = CAMEL_UUENCODE_CHAR (b2 & 0x3f);
-
- i = 0;
- saved = 0;
- uulen += 3;
- }
- }
-
- if (uulen >= 45) {
- *outptr++ = CAMEL_UUENCODE_CHAR (uulen & 0xff);
- memcpy (outptr, uubuf, ((uulen / 3) * 4));
- outptr += ((uulen / 3) * 4);
- *outptr++ = '\n';
- uulen = 0;
- bufptr = uubuf;
- }
- }
-
- *save = saved;
- *state = ((uulen & 0xff) << 8) | (i & 0xff);
-
- return outptr - out;
-}
-
-
-/**
- * camel_uudecode_step: uudecode a chunk of data
- * @in: input stream
- * @inlen: max length of data to decode ( normally strlen(in) ??)
- * @out: output stream
- * @state: holds the number of bits that are stored in @save
- * @save: leftover bits that have not yet been decoded
- *
- * Returns the number of bytes decoded. Performs a 'decode step' on
- * a chunk of uuencoded data. Assumes the "begin <mode> <file name>"
- * line has been stripped off.
- **/
-size_t
-camel_uudecode_step (unsigned char *in, size_t len, unsigned char *out, int *state, guint32 *save)
-{
- register unsigned char *inptr, *outptr;
- unsigned char *inend, ch;
- register guint32 saved;
- gboolean last_was_eoln;
- int uulen, i;
-
- if (*state & CAMEL_UUDECODE_STATE_END)
- return 0;
-
- saved = *save;
- i = *state & 0xff;
- uulen = (*state >> 8) & 0xff;
- if (uulen == 0)
- last_was_eoln = TRUE;
- else
- last_was_eoln = FALSE;
-
- inend = in + len;
- outptr = out;
-
- inptr = in;
- while (inptr < inend) {
- if (*inptr == '\n' || last_was_eoln) {
- if (last_was_eoln && *inptr != '\n') {
- uulen = CAMEL_UUDECODE_CHAR (*inptr);
- last_was_eoln = FALSE;
- if (uulen == 0) {
- *state |= CAMEL_UUDECODE_STATE_END;
- break;
- }
- } else {
- last_was_eoln = TRUE;
- }
-
- inptr++;
- continue;
- }
-
- ch = *inptr++;
-
- if (uulen > 0) {
- /* save the byte */
- saved = (saved << 8) | ch;
- i++;
- if (i == 4) {
- /* convert 4 uuencoded bytes to 3 normal bytes */
- unsigned char b0, b1, b2, b3;
-
- b0 = saved >> 24;
- b1 = saved >> 16 & 0xff;
- b2 = saved >> 8 & 0xff;
- b3 = saved & 0xff;
-
- if (uulen >= 3) {
- *outptr++ = CAMEL_UUDECODE_CHAR (b0) << 2 | CAMEL_UUDECODE_CHAR (b1) >> 4;
- *outptr++ = CAMEL_UUDECODE_CHAR (b1) << 4 | CAMEL_UUDECODE_CHAR (b2) >> 2;
- *outptr++ = CAMEL_UUDECODE_CHAR (b2) << 6 | CAMEL_UUDECODE_CHAR (b3);
- } else {
- if (uulen >= 1) {
- *outptr++ = CAMEL_UUDECODE_CHAR (b0) << 2 | CAMEL_UUDECODE_CHAR (b1) >> 4;
- }
- if (uulen >= 2) {
- *outptr++ = CAMEL_UUDECODE_CHAR (b1) << 4 | CAMEL_UUDECODE_CHAR (b2) >> 2;
- }
- }
-
- i = 0;
- saved = 0;
- uulen -= 3;
- }
- } else {
- break;
- }
- }
-
- *save = saved;
- *state = (*state & CAMEL_UUDECODE_STATE_MASK) | ((uulen & 0xff) << 8) | (i & 0xff);
-
- return outptr - out;
-}
-
-
-/* complete qp encoding */
-size_t
-camel_quoted_decode_close(unsigned char *in, size_t len, unsigned char *out, int *state, int *save)
-{
- register unsigned char *outptr = out;
- int last;
-
- if (len>0)
- outptr += camel_quoted_encode_step(in, len, outptr, state, save);
-
- last = *state;
- if (last != -1) {
- /* space/tab must be encoded if it's the last character on
- the line */
- if (camel_mime_is_qpsafe(last) && last!=' ' && last!=9) {
- *outptr++ = last;
- } else {
- *outptr++ = '=';
- *outptr++ = tohex[(last>>4) & 0xf];
- *outptr++ = tohex[last & 0xf];
- }
- }
-
- *save = 0;
- *state = -1;
-
- return outptr-out;
-}
-
-/* perform qp encoding, initialise state to -1 and save to 0 on first invocation */
-size_t
-camel_quoted_encode_step (unsigned char *in, size_t len, unsigned char *out, int *statep, int *save)
-{
- register guchar *inptr, *outptr, *inend;
- unsigned char c;
- register int sofar = *save; /* keeps track of how many chars on a line */
- register int last = *statep; /* keeps track if last char to end was a space cr etc */
-
- inptr = in;
- inend = in + len;
- outptr = out;
- while (inptr < inend) {
- c = *inptr++;
- if (c == '\r') {
- if (last != -1) {
- *outptr++ = '=';
- *outptr++ = tohex[(last >> 4) & 0xf];
- *outptr++ = tohex[last & 0xf];
- sofar += 3;
- }
- last = c;
- } else if (c == '\n') {
- if (last != -1 && last != '\r') {
- *outptr++ = '=';
- *outptr++ = tohex[(last >> 4) & 0xf];
- *outptr++ = tohex[last & 0xf];
- }
- *outptr++ = '\n';
- sofar = 0;
- last = -1;
- } else {
- if (last != -1) {
- if (camel_mime_is_qpsafe(last)) {
- *outptr++ = last;
- sofar++;
- } else {
- *outptr++ = '=';
- *outptr++ = tohex[(last >> 4) & 0xf];
- *outptr++ = tohex[last & 0xf];
- sofar += 3;
- }
- }
-
- if (camel_mime_is_qpsafe(c)) {
- if (sofar > 74) {
- *outptr++ = '=';
- *outptr++ = '\n';
- sofar = 0;
- }
-
- /* delay output of space char */
- if (c==' ' || c=='\t') {
- last = c;
- } else {
- *outptr++ = c;
- sofar++;
- last = -1;
- }
- } else {
- if (sofar > 72) {
- *outptr++ = '=';
- *outptr++ = '\n';
- sofar = 3;
- } else
- sofar += 3;
-
- *outptr++ = '=';
- *outptr++ = tohex[(c >> 4) & 0xf];
- *outptr++ = tohex[c & 0xf];
- last = -1;
- }
- }
- }
- *save = sofar;
- *statep = last;
-
- return (outptr - out);
-}
-
-/*
- FIXME: this does not strip trailing spaces from lines (as it should, rfc 2045, section 6.7)
- Should it also canonicalise the end of line to CR LF??
-
- Note: Trailing rubbish (at the end of input), like = or =x or =\r will be lost.
-*/
-
-size_t
-camel_quoted_decode_step(unsigned char *in, size_t len, unsigned char *out, int *savestate, int *saveme)
-{
- register unsigned char *inptr, *outptr;
- unsigned char *inend, c;
- int state, save;
-
- inend = in+len;
- outptr = out;
-
- d(printf("quoted-printable, decoding text '%.*s'\n", len, in));
-
- state = *savestate;
- save = *saveme;
- inptr = in;
- while (inptr<inend) {
- switch (state) {
- case 0:
- while (inptr<inend) {
- c = *inptr++;
- if (c=='=') {
- state = 1;
- break;
- }
-#ifdef CANONICALISE_EOL
- /*else if (c=='\r') {
- state = 3;
- } else if (c=='\n') {
- *outptr++ = '\r';
- *outptr++ = c;
- } */
-#endif
- else {
- *outptr++ = c;
- }
- }
- break;
- case 1:
- c = *inptr++;
- if (c=='\n') {
- /* soft break ... unix end of line */
- state = 0;
- } else {
- save = c;
- state = 2;
- }
- break;
- case 2:
- c = *inptr++;
- if (isxdigit(c) && isxdigit(save)) {
- c = toupper(c);
- save = toupper(save);
- *outptr++ = (((save>='A'?save-'A'+10:save-'0')&0x0f) << 4)
- | ((c>='A'?c-'A'+10:c-'0')&0x0f);
- } else if (c=='\n' && save == '\r') {
- /* soft break ... canonical end of line */
- } else {
- /* just output the data */
- *outptr++ = '=';
- *outptr++ = save;
- *outptr++ = c;
- }
- state = 0;
- break;
-#ifdef CANONICALISE_EOL
- case 3:
- /* convert \r -> to \r\n, leaves \r\n alone */
- c = *inptr++;
- if (c=='\n') {
- *outptr++ = '\r';
- *outptr++ = c;
- } else {
- *outptr++ = '\r';
- *outptr++ = '\n';
- *outptr++ = c;
- }
- state = 0;
- break;
-#endif
- }
- }
-
- *savestate = state;
- *saveme = save;
-
- return outptr-out;
-}
-
-/*
- this is for the "Q" encoding of international words,
- which is slightly different than plain quoted-printable (mainly by allowing 0x20 <> _)
-*/
-static size_t
-quoted_decode(const unsigned char *in, size_t len, unsigned char *out)
-{
- register const unsigned char *inptr;
- register unsigned char *outptr;
- unsigned const char *inend;
- unsigned char c, c1;
- int ret = 0;
-
- inend = in+len;
- outptr = out;
-
- d(printf("decoding text '%.*s'\n", len, in));
-
- inptr = in;
- while (inptr<inend) {
- c = *inptr++;
- if (c=='=') {
- /* silently ignore truncated data? */
- if (inend-in>=2) {
- c = toupper(*inptr++);
- c1 = toupper(*inptr++);
- *outptr++ = (((c>='A'?c-'A'+10:c-'0')&0x0f) << 4)
- | ((c1>='A'?c1-'A'+10:c1-'0')&0x0f);
- } else {
- ret = -1;
- break;
- }
- } else if (c=='_') {
- *outptr++ = 0x20;
- } else if (c==' ' || c==0x09) {
- /* FIXME: this is an error! ignore for now ... */
- ret = -1;
- break;
- } else {
- *outptr++ = c;
- }
- }
- if (ret==0) {
- return outptr-out;
- }
- return 0;
-}
-
-/* rfc2047 version of quoted-printable */
-/* safemask is the mask to apply to the camel_mime_special_table to determine what
- characters can safely be included without encoding */
-static size_t
-quoted_encode (const unsigned char *in, size_t len, unsigned char *out, unsigned short safemask)
-{
- register const unsigned char *inptr, *inend;
- unsigned char *outptr;
- unsigned char c;
-
- inptr = in;
- inend = in + len;
- outptr = out;
- while (inptr < inend) {
- c = *inptr++;
- if (c==' ') {
- *outptr++ = '_';
- } else if (camel_mime_special_table[c] & safemask) {
- *outptr++ = c;
- } else {
- *outptr++ = '=';
- *outptr++ = tohex[(c >> 4) & 0xf];
- *outptr++ = tohex[c & 0xf];
- }
- }
-
- d(printf("encoding '%.*s' = '%.*s'\n", len, in, outptr-out, out));
-
- return (outptr - out);
-}
-
-
-static void
-header_decode_lwsp(const char **in)
-{
- const char *inptr = *in;
- char c;
-
- d2(printf("is ws: '%s'\n", *in));
-
- while (camel_mime_is_lwsp(*inptr) || (*inptr =='(' && *inptr != '\0')) {
- while (camel_mime_is_lwsp(*inptr) && inptr != '\0') {
- d2(printf("(%c)", *inptr));
- inptr++;
- }
- d2(printf("\n"));
-
- /* check for comments */
- if (*inptr == '(') {
- int depth = 1;
- inptr++;
- while (depth && (c=*inptr) && *inptr != '\0') {
- if (c=='\\' && inptr[1]) {
- inptr++;
- } else if (c=='(') {
- depth++;
- } else if (c==')') {
- depth--;
- }
- inptr++;
- }
- }
- }
- *in = inptr;
-}
-
-/* decode rfc 2047 encoded string segment */
-static char *
-rfc2047_decode_word(const char *in, size_t len)
-{
- const char *inptr = in+2;
- const char *inend = in+len-2;
- const char *inbuf;
- const char *charset;
- char *encname, *p;
- int tmplen;
- size_t ret;
- char *decword = NULL;
- char *decoded = NULL;
- char *outbase = NULL;
- char *outbuf;
- size_t inlen, outlen;
- gboolean retried = FALSE;
- iconv_t ic;
-
- d(printf("rfc2047: decoding '%.*s'\n", len, in));
-
- /* quick check to see if this could possibly be a real encoded word */
- if (len < 8 || !(in[0] == '=' && in[1] == '?' && in[len-1] == '=' && in[len-2] == '?')) {
- d(printf("invalid\n"));
- return NULL;
- }
-
- /* skip past the charset to the encoding type */
- inptr = memchr (inptr, '?', inend-inptr);
- if (inptr != NULL && inptr < inend + 2 && inptr[2] == '?') {
- d(printf("found ?, encoding is '%c'\n", inptr[0]));
- inptr++;
- tmplen = inend-inptr-2;
- decword = g_alloca (tmplen); /* this will always be more-than-enough room */
- switch(toupper(inptr[0])) {
- case 'Q':
- inlen = quoted_decode(inptr+2, tmplen, decword);
- break;
- case 'B': {
- int state = 0;
- unsigned int save = 0;
-
- inlen = camel_base64_decode_step((char *)inptr+2, tmplen, decword, &state, &save);
- /* if state != 0 then error? */
- break;
- }
- default:
- /* uhhh, unknown encoding type - probably an invalid encoded word string */
- return NULL;
- }
- d(printf("The encoded length = %d\n", inlen));
- if (inlen > 0) {
- /* yuck, all this snot is to setup iconv! */
- tmplen = inptr - in - 3;
- encname = g_alloca (tmplen + 1);
- memcpy (encname, in + 2, tmplen);
- encname[tmplen] = '\0';
-
- /* rfc2231 updates rfc2047 encoded words...
- * The ABNF given in RFC 2047 for encoded-words is:
- * encoded-word := "=?" charset "?" encoding "?" encoded-text "?="
- * This specification changes this ABNF to:
- * encoded-word := "=?" charset ["*" language] "?" encoding "?" encoded-text "?="
- */
-
- /* trim off the 'language' part if it's there... */
- p = strchr (encname, '*');
- if (p)
- *p = '\0';
-
- charset = e_iconv_charset_name (encname);
-
- inbuf = decword;
-
- outlen = inlen * 6 + 16;
- outbase = g_alloca (outlen);
- outbuf = outbase;
-
- retry:
- ic = e_iconv_open ("UTF-8", charset);
- if (ic != (iconv_t) -1) {
- ret = e_iconv (ic, &inbuf, &inlen, &outbuf, &outlen);
- if (ret != (size_t) -1) {
- e_iconv (ic, NULL, 0, &outbuf, &outlen);
- *outbuf = 0;
- decoded = g_strdup (outbase);
- }
- e_iconv_close (ic);
- } else {
- w(g_warning ("Cannot decode charset, header display may be corrupt: %s: %s",
- charset, strerror (errno)));
-
- if (!retried) {
- charset = e_iconv_locale_charset ();
- if (!charset)
- charset = "iso-8859-1";
-
- retried = TRUE;
- goto retry;
- }
-
- /* we return the encoded word here because we've got to return valid utf8 */
- decoded = g_strndup (in, inlen);
- }
- }
- }
-
- d(printf("decoded '%s'\n", decoded));
-
- return decoded;
-}
-
-/* ok, a lot of mailers are BROKEN, and send iso-latin1 encoded
- headers, when they should just be sticking to US-ASCII
- according to the rfc's. Anyway, since the conversion to utf-8
- is trivial, just do it here without iconv */
-static GString *
-append_latin1 (GString *out, const char *in, size_t len)
-{
- unsigned int c;
-
- while (len) {
- c = (unsigned int)*in++;
- len--;
- if (c & 0x80) {
- out = g_string_append_c (out, 0xc0 | ((c >> 6) & 0x3)); /* 110000xx */
- out = g_string_append_c (out, 0x80 | (c & 0x3f)); /* 10xxxxxx */
- } else {
- out = g_string_append_c (out, c);
- }
- }
- return out;
-}
-
-static int
-append_8bit (GString *out, const char *inbuf, size_t inlen, const char *charset)
-{
- char *outbase, *outbuf;
- size_t outlen;
- iconv_t ic;
-
- ic = e_iconv_open ("UTF-8", charset);
- if (ic == (iconv_t) -1)
- return FALSE;
-
- outlen = inlen * 6 + 16;
- outbuf = outbase = g_malloc(outlen);
-
- if (e_iconv (ic, &inbuf, &inlen, &outbuf, &outlen) == (size_t) -1) {
- w(g_warning("Conversion to '%s' failed: %s", charset, strerror (errno)));
- g_free(outbase);
- e_iconv_close (ic);
- return FALSE;
- }
-
- e_iconv (ic, NULL, NULL, &outbuf, &outlen);
-
- *outbuf = 0;
- g_string_append(out, outbase);
- g_free(outbase);
- e_iconv_close (ic);
-
- return TRUE;
-
-}
-
-/* decodes a simple text, rfc822 + rfc2047 */
-static char *
-header_decode_text (const char *in, size_t inlen, const char *default_charset)
-{
- GString *out;
- const char *inptr, *inend, *start, *chunk, *locale_charset;
- char *dword = NULL;
-
- locale_charset = e_iconv_locale_charset ();
-
- out = g_string_new ("");
- inptr = in;
- inend = inptr + inlen;
- chunk = NULL;
-
- while (inptr < inend) {
- start = inptr;
- while (inptr < inend && camel_mime_is_lwsp(*inptr))
- inptr++;
-
- if (inptr == inend) {
- g_string_append_len(out, start, inptr-start);
- break;
- } else if (dword == NULL) {
- g_string_append_len(out, start, inptr-start);
- } else {
- chunk = start;
- }
-
- start = inptr;
- while (inptr < inend && !camel_mime_is_lwsp(*inptr))
- inptr++;
-
- dword = rfc2047_decode_word(start, inptr-start);
- if (dword) {
- g_string_append(out, dword);
- g_free(dword);
- } else {
- if (!chunk)
- chunk = start;
-
- if ((default_charset == NULL || !append_8bit (out, chunk, inptr-chunk, default_charset))
- && (locale_charset == NULL || !append_8bit(out, chunk, inptr-chunk, locale_charset)))
- append_latin1(out, chunk, inptr-chunk);
- }
-
- chunk = NULL;
- }
-
- dword = out->str;
- g_string_free (out, FALSE);
-
- return dword;
-}
-
-char *
-camel_header_decode_string (const char *in, const char *default_charset)
-{
- if (in == NULL)
- return NULL;
- return header_decode_text (in, strlen (in), default_charset);
-}
-
-/* how long a sequence of pre-encoded words should be less than, to attempt to
- fit into a properly folded word. Only a guide. */
-#define CAMEL_FOLD_PREENCODED (24)
-
-/* FIXME: needs a way to cache iconv opens for different charsets? */
-static void
-rfc2047_encode_word(GString *outstring, const char *in, size_t len, const char *type, unsigned short safemask)
-{
- iconv_t ic = (iconv_t) -1;
- char *buffer, *out, *ascii;
- size_t inlen, outlen, enclen, bufflen;
- const char *inptr, *p;
- int first = 1;
-
- d(printf("Converting [%d] '%.*s' to %s\n", len, len, in, type));
-
- /* convert utf8->encoding */
- bufflen = len * 6 + 16;
- buffer = g_alloca (bufflen);
- inlen = len;
- inptr = in;
-
- ascii = g_alloca (bufflen);
-
- if (strcasecmp (type, "UTF-8") != 0)
- ic = e_iconv_open (type, "UTF-8");
-
- while (inlen) {
- size_t convlen, proclen;
- int i;
-
- /* break up words into smaller bits, what we really want is encoded + overhead < 75,
- but we'll just guess what that means in terms of input chars, and assume its good enough */
-
- out = buffer;
- outlen = bufflen;
-
- if (ic == (iconv_t) -1) {
- /* native encoding case, the easy one (?) */
- /* we work out how much we can convert, and still be in length */
- /* proclen will be the result of input characters that we can convert, to the nearest
- (approximated) valid utf8 char */
- convlen = 0;
- proclen = 0;
- p = inptr;
- i = 0;
- while (p < (in+len) && convlen < (75 - strlen("=?utf-8?q\?\?="))) {
- unsigned char c = *p++;
-
- if (c >= 0xc0)
- proclen = i;
- i++;
- if (c < 0x80)
- proclen = i;
- if (camel_mime_special_table[c] & safemask)
- convlen += 1;
- else
- convlen += 3;
- }
- /* well, we probably have broken utf8, just copy it anyway what the heck */
- if (proclen == 0) {
- w(g_warning("Appear to have truncated utf8 sequence"));
- proclen = inlen;
- }
- memcpy(out, inptr, proclen);
- inptr += proclen;
- inlen -= proclen;
- out += proclen;
- } else {
- /* well we could do similar, but we can't (without undue effort), we'll just break it up into
- hopefully-small-enough chunks, and leave it at that */
- convlen = MIN(inlen, CAMEL_FOLD_PREENCODED);
- p = inptr;
- if (e_iconv (ic, &inptr, &convlen, &out, &outlen) == (size_t) -1) {
- w(g_warning("Conversion problem: conversion truncated: %s", strerror (errno)));
- /* blah, we include it anyway, better than infinite loop ... */
- inptr = p + convlen;
- } else {
- /* make sure we flush out any shift state */
- e_iconv (ic, NULL, 0, &out, &outlen);
- }
- inlen -= (inptr - p);
- }
-
- enclen = out-buffer;
-
- if (enclen) {
- /* create token */
- out = ascii;
- if (first)
- first = 0;
- else
- *out++ = ' ';
- out += sprintf (out, "=?%s?Q?", type);
- out += quoted_encode (buffer, enclen, out, safemask);
- sprintf (out, "?=");
-
- d(printf("converted part = %s\n", ascii));
-
- g_string_append (outstring, ascii);
- }
- }
-
- if (ic != (iconv_t) -1)
- e_iconv_close (ic);
-}
-
-
-/* TODO: Should this worry about quotes?? */
-char *
-camel_header_encode_string (const unsigned char *in)
-{
- const unsigned char *inptr = in, *start, *word;
- gboolean last_was_encoded = FALSE;
- gboolean last_was_space = FALSE;
- int encoding;
- GString *out;
- char *outstr;
-
- g_return_val_if_fail (g_utf8_validate (in, -1, NULL), NULL);
-
- if (in == NULL)
- return NULL;
-
- /* do a quick us-ascii check (the common case?) */
- while (*inptr) {
- if (*inptr > 127)
- break;
- inptr++;
- }
- if (*inptr == '\0')
- return g_strdup (in);
-
- /* This gets each word out of the input, and checks to see what charset
- can be used to encode it. */
- /* TODO: Work out when to merge subsequent words, or across word-parts */
- out = g_string_new ("");
- inptr = in;
- encoding = 0;
- word = NULL;
- start = inptr;
- while (inptr && *inptr) {
- gunichar c;
- const char *newinptr;
-
- newinptr = g_utf8_next_char (inptr);
- c = g_utf8_get_char (inptr);
- if (newinptr == NULL || !g_unichar_validate (c)) {
- w(g_warning ("Invalid UTF-8 sequence encountered (pos %d, char '%c'): %s",
- (inptr-in), inptr[0], in));
- inptr++;
- continue;
- }
-
- if (g_unichar_isspace (c) && !last_was_space) {
- /* we've reached the end of a 'word' */
- if (word && !(last_was_encoded && encoding)) {
- g_string_append_len (out, start, word - start);
- start = word;
- }
-
- switch (encoding) {
- case 0:
- out = g_string_append_len (out, word, inptr - start);
- last_was_encoded = FALSE;
- break;
- case 1:
- if (last_was_encoded)
- g_string_append_c (out, ' ');
-
- rfc2047_encode_word (out, start, inptr - start, "ISO-8859-1", CAMEL_MIME_IS_ESAFE);
- last_was_encoded = TRUE;
- break;
- case 2:
- if (last_was_encoded)
- g_string_append_c (out, ' ');
-
- rfc2047_encode_word (out, start, inptr - start,
- camel_charset_best (start, inptr - start), CAMEL_MIME_IS_ESAFE);
- last_was_encoded = TRUE;
- break;
- }
-
- last_was_space = TRUE;
- start = inptr;
- word = NULL;
- encoding = 0;
- } else if (c > 127 && c < 256) {
- encoding = MAX (encoding, 1);
- last_was_space = FALSE;
- } else if (c >= 256) {
- encoding = MAX (encoding, 2);
- last_was_space = FALSE;
- } else if (!g_unichar_isspace (c)) {
- last_was_space = FALSE;
- }
-
- if (!g_unichar_isspace (c) && !word)
- word = inptr;
-
- inptr = newinptr;
- }
-
- if (inptr - start) {
- if (word && !(last_was_encoded && encoding)) {
- g_string_append_len (out, start, word - start);
- start = word;
- }
-
- switch (encoding) {
- case 0:
- out = g_string_append_len (out, start, inptr - start);
- break;
- case 1:
- if (last_was_encoded)
- g_string_append_c (out, ' ');
-
- rfc2047_encode_word (out, start, inptr - start, "ISO-8859-1", CAMEL_MIME_IS_ESAFE);
- break;
- case 2:
- if (last_was_encoded)
- g_string_append_c (out, ' ');
-
- rfc2047_encode_word (out, start, inptr - start,
- camel_charset_best (start, inptr - start - 1), CAMEL_MIME_IS_ESAFE);
- break;
- }
- }
-
- outstr = out->str;
- g_string_free (out, FALSE);
-
- return outstr;
-}
-
-/* apply quoted-string rules to a string */
-static void
-quote_word(GString *out, gboolean do_quotes, const char *start, size_t len)
-{
- int i, c;
-
- /* TODO: What about folding on long lines? */
- if (do_quotes)
- g_string_append_c(out, '"');
- for (i=0;i<len;i++) {
- c = *start++;
- if (c == '\"' || c=='\\' || c=='\r')
- g_string_append_c(out, '\\');
- g_string_append_c(out, c);
- }
- if (do_quotes)
- g_string_append_c(out, '"');
-}
-
-/* incrementing possibility for the word type */
-enum _phrase_word_t {
- WORD_ATOM,
- WORD_QSTRING,
- WORD_2047
-};
-
-struct _phrase_word {
- const unsigned char *start, *end;
- enum _phrase_word_t type;
- int encoding;
-};
-
-static gboolean
-word_types_compatable (enum _phrase_word_t type1, enum _phrase_word_t type2)
-{
- switch (type1) {
- case WORD_ATOM:
- return type2 == WORD_QSTRING;
- case WORD_QSTRING:
- return type2 != WORD_2047;
- case WORD_2047:
- return type2 == WORD_2047;
- default:
- return FALSE;
- }
-}
-
-/* split the input into words with info about each word
- * merge common word types clean up */
-static GList *
-header_encode_phrase_get_words (const unsigned char *in)
-{
- const unsigned char *inptr = in, *start, *last;
- struct _phrase_word *word;
- enum _phrase_word_t type;
- int encoding, count = 0;
- GList *words = NULL;
-
- /* break the input into words */
- type = WORD_ATOM;
- last = inptr;
- start = inptr;
- encoding = 0;
- while (inptr && *inptr) {
- gunichar c;
- const char *newinptr;
-
- newinptr = g_utf8_next_char (inptr);
- c = g_utf8_get_char (inptr);
-
- if (!g_unichar_validate (c)) {
- w(g_warning ("Invalid UTF-8 sequence encountered (pos %d, char '%c'): %s",
- (inptr - in), inptr[0], in));
- inptr++;
- continue;
- }
-
- inptr = newinptr;
- if (g_unichar_isspace (c)) {
- if (count > 0) {
- word = g_new0 (struct _phrase_word, 1);
- word->start = start;
- word->end = last;
- word->type = type;
- word->encoding = encoding;
- words = g_list_append (words, word);
- count = 0;
- }
-
- start = inptr;
- type = WORD_ATOM;
- encoding = 0;
- } else {
- count++;
- if (c < 128) {
- if (!camel_mime_is_atom (c))
- type = MAX (type, WORD_QSTRING);
- } else if (c > 127 && c < 256) {
- type = WORD_2047;
- encoding = MAX (encoding, 1);
- } else if (c >= 256) {
- type = WORD_2047;
- encoding = MAX (encoding, 2);
- }
- }
-
- last = inptr;
- }
-
- if (count > 0) {
- word = g_new0 (struct _phrase_word, 1);
- word->start = start;
- word->end = last;
- word->type = type;
- word->encoding = encoding;
- words = g_list_append (words, word);
- }
-
- return words;
-}
-
-#define MERGED_WORD_LT_FOLDLEN(wordlen, type) ((type) == WORD_2047 ? (wordlen) < CAMEL_FOLD_PREENCODED : (wordlen) < (CAMEL_FOLD_SIZE - 8))
-
-static gboolean
-header_encode_phrase_merge_words (GList **wordsp)
-{
- GList *wordl, *nextl, *words = *wordsp;
- struct _phrase_word *word, *next;
- gboolean merged = FALSE;
-
- /* scan the list, checking for words of similar types that can be merged */
- wordl = words;
- while (wordl) {
- word = wordl->data;
- nextl = g_list_next (wordl);
-
- while (nextl) {
- next = nextl->data;
- /* merge nodes of the same type AND we are not creating too long a string */
- if (word_types_compatable (word->type, next->type)) {
- if (MERGED_WORD_LT_FOLDLEN (next->end - word->start, MAX (word->type, next->type))) {
- /* the resulting word type is the MAX of the 2 types */
- word->type = MAX(word->type, next->type);
-
- word->end = next->end;
- words = g_list_remove_link (words, nextl);
- g_list_free_1 (nextl);
- g_free (next);
-
- nextl = g_list_next (wordl);
-
- merged = TRUE;
- } else {
- /* if it is going to be too long, make sure we include the
- separating whitespace */
- word->end = next->start;
- break;
- }
- } else {
- break;
- }
- }
-
- wordl = g_list_next (wordl);
- }
-
- *wordsp = words;
-
- return merged;
-}
-
-/* encodes a phrase sequence (different quoting/encoding rules to strings) */
-char *
-camel_header_encode_phrase (const unsigned char *in)
-{
- struct _phrase_word *word = NULL, *last_word = NULL;
- GList *words, *wordl;
- GString *out;
- char *outstr;
-
- if (in == NULL)
- return NULL;
-
- words = header_encode_phrase_get_words (in);
- if (!words)
- return NULL;
-
- while (header_encode_phrase_merge_words (&words))
- ;
-
- out = g_string_new ("");
-
- /* output words now with spaces between them */
- wordl = words;
- while (wordl) {
- const char *start;
- size_t len;
-
- word = wordl->data;
-
- /* append correct number of spaces between words */
- if (last_word && !(last_word->type == WORD_2047 && word->type == WORD_2047)) {
- /* one or both of the words are not encoded so we write the spaces out untouched */
- len = word->start - last_word->end;
- out = g_string_append_len (out, last_word->end, len);
- }
-
- switch (word->type) {
- case WORD_ATOM:
- out = g_string_append_len (out, word->start, word->end - word->start);
- break;
- case WORD_QSTRING:
- quote_word (out, TRUE, word->start, word->end - word->start);
- break;
- case WORD_2047:
- if (last_word && last_word->type == WORD_2047) {
- /* include the whitespace chars between these 2 words in the
- resulting rfc2047 encoded word. */
- len = word->end - last_word->end;
- start = last_word->end;
-
- /* encoded words need to be separated by linear whitespace */
- g_string_append_c (out, ' ');
- } else {
- len = word->end - word->start;
- start = word->start;
- }
-
- if (word->encoding == 1)
- rfc2047_encode_word (out, start, len, "ISO-8859-1", CAMEL_MIME_IS_PSAFE);
- else
- rfc2047_encode_word (out, start, len,
- camel_charset_best (start, len), CAMEL_MIME_IS_PSAFE);
- break;
- }
-
- g_free (last_word);
- wordl = g_list_next (wordl);
-
- last_word = word;
- }
-
- /* and we no longer need the list */
- g_free (word);
- g_list_free (words);
-
- outstr = out->str;
- g_string_free (out, FALSE);
-
- return outstr;
-}
-
-
-/* these are all internal parser functions */
-
-static char *
-decode_token (const char **in)
-{
- const char *inptr = *in;
- const char *start;
-
- header_decode_lwsp (&inptr);
- start = inptr;
- while (camel_mime_is_ttoken (*inptr))
- inptr++;
- if (inptr > start) {
- *in = inptr;
- return g_strndup (start, inptr - start);
- } else {
- return NULL;
- }
-}
-
-char *
-camel_header_token_decode(const char *in)
-{
- if (in == NULL)
- return NULL;
-
- return decode_token(&in);
-}
-
-/*
- <"> * ( <any char except <"> \, cr / \ <any char> ) <">
-*/
-static char *
-header_decode_quoted_string(const char **in)
-{
- const char *inptr = *in;
- char *out = NULL, *outptr;
- size_t outlen;
- int c;
-
- header_decode_lwsp(&inptr);
- if (*inptr == '"') {
- const char *intmp;
- int skip = 0;
-
- /* first, calc length */
- inptr++;
- intmp = inptr;
- while ( (c = *intmp++) && c!= '"') {
- if (c=='\\' && *intmp) {
- intmp++;
- skip++;
- }
- }
- outlen = intmp-inptr-skip;
- out = outptr = g_malloc(outlen+1);
- while ( (c = *inptr++) && c!= '"') {
- if (c=='\\' && *inptr) {
- c = *inptr++;
- }
- *outptr++ = c;
- }
- *outptr = '\0';
- }
- *in = inptr;
- return out;
-}
-
-static char *
-header_decode_atom(const char **in)
-{
- const char *inptr = *in, *start;
-
- header_decode_lwsp(&inptr);
- start = inptr;
- while (camel_mime_is_atom(*inptr))
- inptr++;
- *in = inptr;
- if (inptr > start)
- return g_strndup(start, inptr-start);
- else
- return NULL;
-}
-
-static char *
-header_decode_word (const char **in)
-{
- const char *inptr = *in;
-
- header_decode_lwsp (&inptr);
- if (*inptr == '"') {
- *in = inptr;
- return header_decode_quoted_string (in);
- } else {
- *in = inptr;
- return header_decode_atom (in);
- }
-}
-
-static char *
-header_decode_value(const char **in)
-{
- const char *inptr = *in;
-
- header_decode_lwsp(&inptr);
- if (*inptr == '"') {
- d(printf("decoding quoted string\n"));
- return header_decode_quoted_string(in);
- } else if (camel_mime_is_ttoken(*inptr)) {
- d(printf("decoding token\n"));
- /* this may not have the right specials for all params? */
- return decode_token(in);
- }
- return NULL;
-}
-
-/* should this return -1 for no int? */
-int
-camel_header_decode_int(const char **in)
-{
- const char *inptr = *in;
- int c, v=0;
-
- header_decode_lwsp(&inptr);
- while ( (c=*inptr++ & 0xff)
- && isdigit(c) ) {
- v = v*10+(c-'0');
- }
- *in = inptr-1;
- return v;
-}
-
-#define HEXVAL(c) (isdigit (c) ? (c) - '0' : tolower (c) - 'a' + 10)
-
-static char *
-hex_decode (const char *in, size_t len)
-{
- const unsigned char *inend = in + len;
- unsigned char *inptr, *outptr;
- char *outbuf;
-
- outptr = outbuf = g_malloc (len + 1);
-
- inptr = (unsigned char *) in;
- while (inptr < inend) {
- if (*inptr == '%') {
- if (isxdigit (inptr[1]) && isxdigit (inptr[2])) {
- *outptr++ = HEXVAL (inptr[1]) * 16 + HEXVAL (inptr[2]);
- inptr += 3;
- } else
- *outptr++ = *inptr++;
- } else
- *outptr++ = *inptr++;
- }
-
- *outptr = '\0';
-
- return outbuf;
-}
-
-/* an rfc2184 encoded string looks something like:
- * us-ascii'en'This%20is%20even%20more%20
- */
-
-static char *
-rfc2184_decode (const char *in, size_t len)
-{
- const char *inptr = in;
- const char *inend = in + len;
- const char *charset;
- char *decoded = NULL;
- char *encoding;
-
- inptr = memchr (inptr, '\'', len);
- if (!inptr)
- return NULL;
-
- encoding = g_strndup (in, inptr - in);
- charset = e_iconv_charset_name (encoding);
- g_free (encoding);
-
- inptr = memchr (inptr + 1, '\'', inend - inptr - 1);
- if (!inptr)
- return NULL;
-
- inptr++;
- if (inptr < inend) {
- char *decword, *outbase, *outbuf;
- const char *inbuf;
- size_t inlen, outlen;
- iconv_t ic;
-
- inbuf = decword = hex_decode (inptr, inend - inptr);
- inlen = strlen (inbuf);
-
- ic = e_iconv_open ("UTF-8", charset);
- if (ic != (iconv_t) -1) {
- size_t ret;
-
- outlen = inlen * 6 + 16;
- outbuf = outbase = g_malloc (outlen);
-
- ret = e_iconv (ic, &inbuf, &inlen, &outbuf, &outlen);
- if (ret != (size_t) -1) {
- e_iconv (ic, NULL, 0, &outbuf, &outlen);
- *outbuf = '\0';
- g_free (decoded);
- decoded = outbase;
- }
-
- e_iconv_close (ic);
- } else {
- decoded = decword;
- }
- }
-
- return decoded;
-}
-
-/* This function is basically the same as decode_token()
- * except that it will not accept *'s which have a special
- * meaning for rfc2184 params */
-static char *
-decode_param_token (const char **in)
-{
- const char *inptr = *in;
- const char *start;
-
- header_decode_lwsp (&inptr);
- start = inptr;
- while (camel_mime_is_ttoken (*inptr) && *inptr != '*')
- inptr++;
- if (inptr > start) {
- *in = inptr;
- return g_strndup (start, inptr - start);
- } else {
- return NULL;
- }
-}
-
-static gboolean
-header_decode_rfc2184_param (const char **in, char **paramp, gboolean *is_encoded, int *part)
-{
- gboolean is_rfc2184 = FALSE;
- const char *inptr = *in;
- char *param;
-
- *is_encoded = FALSE;
- *part = -1;
-
- param = decode_param_token (&inptr);
- header_decode_lwsp (&inptr);
-
- if (*inptr == '*') {
- is_rfc2184 = TRUE;
- inptr++;
- header_decode_lwsp (&inptr);
- if (*inptr == '=') {
- /* form := param*=value */
- if (is_encoded)
- *is_encoded = TRUE;
- } else {
- /* form := param*#=value or param*#*=value */
- *part = camel_header_decode_int (&inptr);
- header_decode_lwsp (&inptr);
- if (*inptr == '*') {
- /* form := param*#*=value */
- if (is_encoded)
- *is_encoded = TRUE;
- inptr++;
- header_decode_lwsp (&inptr);
- }
- }
- }
-
- if (paramp)
- *paramp = param;
-
- if (param)
- *in = inptr;
-
- return is_rfc2184;
-}
-
-static int
-header_decode_param (const char **in, char **paramp, char **valuep, int *is_rfc2184_param, int *rfc2184_part)
-{
- gboolean is_rfc2184_encoded = FALSE;
- gboolean is_rfc2184 = FALSE;
- const char *inptr = *in;
- char *param = NULL;
- char *value = NULL;
-
- *is_rfc2184_param = FALSE;
- *rfc2184_part = -1;
-
- is_rfc2184 = header_decode_rfc2184_param (&inptr, &param, &is_rfc2184_encoded, rfc2184_part);
-
- if (*inptr == '=') {
- inptr++;
- value = header_decode_value (&inptr);
-
- if (value && is_rfc2184) {
- /* We have ourselves an rfc2184 parameter */
-
- if (*rfc2184_part == -1) {
- /* rfc2184 allows the value to be broken into
- * multiple parts - this isn't one of them so
- * it is safe to decode it.
- */
- char *val;
-
- val = rfc2184_decode (value, strlen (value));
- if (val) {
- g_free (value);
- value = val;
- }
- } else {
- /* Since we are expecting to find the rest of
- * this paramter value later, let our caller know.
- */
- *is_rfc2184_param = TRUE;
- }
- } else if (value && !strncmp (value, "=?", 2)) {
- /* We have a broken param value that is rfc2047 encoded.
- * Since both Outlook and Netscape/Mozilla do this, we
- * should handle this case.
- */
- char *val;
-
- val = rfc2047_decode_word (value, strlen (value));
- if (val) {
- g_free (value);
- value = val;
- }
- }
- }
-
- if (value && !g_utf8_validate (value, -1, NULL)) {
- /* The (broken) mailer sent us an unencoded 8bit value
- * attempt to save it by assuming it's in the user's
- * locale and converting to utf8 */
- char *outbase, *outbuf, *p;
- const char *charset, *inbuf;
- size_t inlen, outlen;
- iconv_t ic;
-
- inbuf = value;
- inlen = strlen (inbuf);
-
- charset = e_iconv_locale_charset ();
- ic = e_iconv_open ("UTF-8", charset ? charset : "ISO-8859-1");
- if (ic != (iconv_t) -1) {
- size_t ret;
-
- outlen = inlen * 6 + 16;
- outbuf = outbase = g_malloc (outlen);
-
- ret = e_iconv (ic, &inbuf, &inlen, &outbuf, &outlen);
- if (ret != (size_t) -1) {
- e_iconv (ic, NULL, 0, &outbuf, &outlen);
- *outbuf = '\0';
- }
-
- e_iconv_close (ic);
-
- g_free (value);
- value = outbase;
- } else {
- /* Okay, so now what? I guess we convert invalid chars to _'s? */
- for (p = value; *p; p++)
- if (!isascii ((unsigned) *p))
- *p = '_';
- }
- }
-
- if (param && value) {
- *paramp = param;
- *valuep = value;
- *in = inptr;
- return 0;
- } else {
- g_free (param);
- g_free (value);
- return 1;
- }
-}
-
-char *
-camel_header_param (struct _camel_header_param *p, const char *name)
-{
- while (p && strcasecmp (p->name, name) != 0)
- p = p->next;
- if (p)
- return p->value;
- return NULL;
-}
-
-struct _camel_header_param *
-camel_header_set_param (struct _camel_header_param **l, const char *name, const char *value)
-{
- struct _camel_header_param *p = (struct _camel_header_param *)l, *pn;
-
- if (name == NULL)
- return NULL;
-
- while (p->next) {
- pn = p->next;
- if (!strcasecmp (pn->name, name)) {
- g_free (pn->value);
- if (value) {
- pn->value = g_strdup (value);
- return pn;
- } else {
- p->next = pn->next;
- g_free (pn->name);
- g_free (pn);
- return NULL;
- }
- }
- p = pn;
- }
-
- if (value == NULL)
- return NULL;
-
- pn = g_malloc (sizeof (*pn));
- pn->next = 0;
- pn->name = g_strdup (name);
- pn->value = g_strdup (value);
- p->next = pn;
-
- return pn;
-}
-
-const char *
-camel_content_type_param (CamelContentType *t, const char *name)
-{
- if (t==NULL)
- return NULL;
- return camel_header_param (t->params, name);
-}
-
-void
-camel_content_type_set_param (CamelContentType *t, const char *name, const char *value)
-{
- camel_header_set_param (&t->params, name, value);
-}
-
-/**
- * camel_content_type_is:
- * @ct: A content type specifier, or #NULL.
- * @type: A type to check against.
- * @subtype: A subtype to check against, or "*" to match any subtype.
- *
- * Returns #TRUE if the content type @ct is of type @type/@subtype.
- * The subtype of "*" will match any subtype. If @ct is #NULL, then
- * it will match the type "text/plain".
- *
- * Return value: #TRUE or #FALSE depending on the matching of the type.
- **/
-int
-camel_content_type_is(CamelContentType *ct, const char *type, const char *subtype)
-{
- /* no type == text/plain or text/"*" */
- if (ct==NULL || (ct->type == NULL && ct->subtype == NULL)) {
- return (!strcasecmp(type, "text")
- && (!strcasecmp(subtype, "plain")
- || !strcasecmp(subtype, "*")));
- }
-
- return (ct->type != NULL
- && (!strcasecmp(ct->type, type)
- && ((ct->subtype != NULL
- && !strcasecmp(ct->subtype, subtype))
- || !strcasecmp("*", subtype))));
-}
-
-void
-camel_header_param_list_free(struct _camel_header_param *p)
-{
- struct _camel_header_param *n;
-
- while (p) {
- n = p->next;
- g_free(p->name);
- g_free(p->value);
- g_free(p);
- p = n;
- }
-}
-
-CamelContentType *
-camel_content_type_new(const char *type, const char *subtype)
-{
- CamelContentType *t = g_malloc(sizeof(*t));
-
- t->type = g_strdup(type);
- t->subtype = g_strdup(subtype);
- t->params = NULL;
- t->refcount = 1;
- return t;
-}
-
-void
-camel_content_type_ref(CamelContentType *ct)
-{
- if (ct)
- ct->refcount++;
-}
-
-
-void
-camel_content_type_unref(CamelContentType *ct)
-{
- if (ct) {
- if (ct->refcount <= 1) {
- camel_header_param_list_free(ct->params);
- g_free(ct->type);
- g_free(ct->subtype);
- g_free(ct);
- } else {
- ct->refcount--;
- }
- }
-}
-
-/* for decoding email addresses, canonically */
-static char *
-header_decode_domain(const char **in)
-{
- const char *inptr = *in, *start;
- int go = TRUE;
- char *ret;
- GString *domain = g_string_new("");
-
- /* domain ref | domain literal */
- header_decode_lwsp(&inptr);
- while (go) {
- if (*inptr == '[') { /* domain literal */
- domain = g_string_append_c(domain, '[');
- inptr++;
- header_decode_lwsp(&inptr);
- start = inptr;
- while (camel_mime_is_dtext(*inptr)) {
- domain = g_string_append_c(domain, *inptr);
- inptr++;
- }
- if (*inptr == ']') {
- domain = g_string_append_c(domain, ']');
- inptr++;
- } else {
- w(g_warning("closing ']' not found in domain: %s", *in));
- }
- } else {
- char *a = header_decode_atom(&inptr);
- if (a) {
- domain = g_string_append(domain, a);
- g_free(a);
- } else {
- w(g_warning("missing atom from domain-ref"));
- break;
- }
- }
- header_decode_lwsp(&inptr);
- if (*inptr == '.') { /* next sub-domain? */
- domain = g_string_append_c(domain, '.');
- inptr++;
- header_decode_lwsp(&inptr);
- } else
- go = FALSE;
- }
-
- *in = inptr;
-
- ret = domain->str;
- g_string_free(domain, FALSE);
- return ret;
-}
-
-static char *
-header_decode_addrspec(const char **in)
-{
- const char *inptr = *in;
- char *word;
- GString *addr = g_string_new("");
-
- header_decode_lwsp(&inptr);
-
- /* addr-spec */
- word = header_decode_word (&inptr);
- if (word) {
- addr = g_string_append(addr, word);
- header_decode_lwsp(&inptr);
- g_free(word);
- while (*inptr == '.' && word) {
- inptr++;
- addr = g_string_append_c(addr, '.');
- word = header_decode_word (&inptr);
- if (word) {
- addr = g_string_append(addr, word);
- header_decode_lwsp(&inptr);
- g_free(word);
- } else {
- w(g_warning("Invalid address spec: %s", *in));
- }
- }
- if (*inptr == '@') {
- inptr++;
- addr = g_string_append_c(addr, '@');
- word = header_decode_domain(&inptr);
- if (word) {
- addr = g_string_append(addr, word);
- g_free(word);
- } else {
- w(g_warning("Invalid address, missing domain: %s", *in));
- }
- } else {
- w(g_warning("Invalid addr-spec, missing @: %s", *in));
- }
- } else {
- w(g_warning("invalid addr-spec, no local part"));
- }
-
- /* FIXME: return null on error? */
-
- *in = inptr;
- word = addr->str;
- g_string_free(addr, FALSE);
- return word;
-}
-
-/*
- address:
- word *('.' word) @ domain |
- *(word) '<' [ *('@' domain ) ':' ] word *( '.' word) @ domain |
-
- 1*word ':' [ word ... etc (mailbox, as above) ] ';'
- */
-
-/* mailbox:
- word *( '.' word ) '@' domain
- *(word) '<' [ *('@' domain ) ':' ] word *( '.' word) @ domain
- */
-
-static struct _camel_header_address *
-header_decode_mailbox(const char **in, const char *charset)
-{
- const char *inptr = *in;
- char *pre;
- int closeme = FALSE;
- GString *addr;
- GString *name = NULL;
- struct _camel_header_address *address = NULL;
- const char *comment = NULL;
-
- addr = g_string_new("");
-
- /* for each address */
- pre = header_decode_word (&inptr);
- header_decode_lwsp(&inptr);
- if (!(*inptr == '.' || *inptr == '@' || *inptr==',' || *inptr=='\0')) {
- /* ',' and '\0' required incase it is a simple address, no @ domain part (buggy writer) */
- name = g_string_new ("");
- while (pre) {
- char *text, *last;
-
- /* perform internationalised decoding, and append */
- text = camel_header_decode_string (pre, charset);
- g_string_append (name, text);
- last = pre;
- g_free(text);
-
- pre = header_decode_word (&inptr);
- if (pre) {
- size_t l = strlen (last);
- size_t p = strlen (pre);
-
- /* dont append ' ' between sucsessive encoded words */
- if ((l>6 && last[l-2] == '?' && last[l-1] == '=')
- && (p>6 && pre[0] == '=' && pre[1] == '?')) {
- /* dont append ' ' */
- } else {
- name = g_string_append_c(name, ' ');
- }
- } else {
- /* Fix for stupidly-broken-mailers that like to put '.''s in names unquoted */
- /* see bug #8147 */
- while (!pre && *inptr && *inptr != '<') {
- w(g_warning("Working around stupid mailer bug #5: unescaped characters in names"));
- name = g_string_append_c(name, *inptr++);
- pre = header_decode_word (&inptr);
- }
- }
- g_free(last);
- }
- header_decode_lwsp(&inptr);
- if (*inptr == '<') {
- closeme = TRUE;
- try_address_again:
- inptr++;
- header_decode_lwsp(&inptr);
- if (*inptr == '@') {
- while (*inptr == '@') {
- inptr++;
- header_decode_domain(&inptr);
- header_decode_lwsp(&inptr);
- if (*inptr == ',') {
- inptr++;
- header_decode_lwsp(&inptr);
- }
- }
- if (*inptr == ':') {
- inptr++;
- } else {
- w(g_warning("broken route-address, missing ':': %s", *in));
- }
- }
- pre = header_decode_word (&inptr);
- header_decode_lwsp(&inptr);
- } else {
- w(g_warning("broken address? %s", *in));
- }
- }
-
- if (pre) {
- addr = g_string_append(addr, pre);
- } else {
- w(g_warning("No local-part for email address: %s", *in));
- }
-
- /* should be at word '.' localpart */
- while (*inptr == '.' && pre) {
- inptr++;
- g_free(pre);
- pre = header_decode_word (&inptr);
- addr = g_string_append_c(addr, '.');
- if (pre)
- addr = g_string_append(addr, pre);
- comment = inptr;
- header_decode_lwsp(&inptr);
- }
- g_free(pre);
-
- /* now at '@' domain part */
- if (*inptr == '@') {
- char *dom;
-
- inptr++;
- addr = g_string_append_c(addr, '@');
- comment = inptr;
- dom = header_decode_domain(&inptr);
- addr = g_string_append(addr, dom);
- g_free(dom);
- } else if (*inptr != '>' || !closeme) {
- /* If we get a <, the address was probably a name part, lets try again shall we? */
- /* Another fix for seriously-broken-mailers */
- if (*inptr && *inptr != ',') {
- char *text;
-
- w(g_warning("We didn't get an '@' where we expected in '%s', trying again", *in));
- w(g_warning("Name is '%s', Addr is '%s' we're at '%s'\n", name?name->str:"<UNSET>", addr->str, inptr));
-
- /* need to keep *inptr, as try_address_again will drop the current character */
- if (*inptr == '<')
- closeme = TRUE;
- else
- g_string_append_c(addr, *inptr);
-
- /* check for address is encoded word ... */
- text = camel_header_decode_string(addr->str, charset);
- if (name == NULL) {
- name = addr;
- addr = g_string_new("");
- if (text) {
- g_string_truncate(name, 0);
- g_string_append(name, text);
- }
- } else {
- g_string_append(name, text?text:addr->str);
- g_string_truncate(addr, 0);
- }
- g_free(text);
-
- /* or maybe that we've added up a bunch of broken bits to make an encoded word */
- text = rfc2047_decode_word(name->str, name->len);
- if (text) {
- g_string_truncate(name, 0);
- g_string_append(name, text);
- g_free(text);
- }
-
- goto try_address_again;
- }
- w(g_warning("invalid address, no '@' domain part at %c: %s", *inptr, *in));
- }
-
- if (closeme) {
- header_decode_lwsp(&inptr);
- if (*inptr == '>') {
- inptr++;
- } else {
- w(g_warning("invalid route address, no closing '>': %s", *in));
- }
- } else if (name == NULL && comment != NULL && inptr>comment) { /* check for comment after address */
- char *text, *tmp;
- const char *comstart, *comend;
-
- /* this is a bit messy, we go from the last known position, because
- decode_domain/etc skip over any comments on the way */
- /* FIXME: This wont detect comments inside the domain itself,
- but nobody seems to use that feature anyway ... */
-
- d(printf("checking for comment from '%s'\n", comment));
-
- comstart = strchr(comment, '(');
- if (comstart) {
- comstart++;
- header_decode_lwsp(&inptr);
- comend = inptr-1;
- while (comend > comstart && comend[0] != ')')
- comend--;
-
- if (comend > comstart) {
- d(printf(" looking at subset '%.*s'\n", comend-comstart, comstart));
- tmp = g_strndup (comstart, comend-comstart);
- text = camel_header_decode_string (tmp, charset);
- name = g_string_new (text);
- g_free (tmp);
- g_free (text);
- }
- }
- }
-
- *in = inptr;
-
- if (addr->len > 0) {
- if (!g_utf8_validate (addr->str, addr->len, NULL)) {
- /* workaround for invalid addr-specs containing 8bit chars (see bug #42170 for details) */
- const char *locale_charset;
- GString *out;
-
- locale_charset = e_iconv_locale_charset ();
-
- out = g_string_new ("");
-
- if ((charset == NULL || !append_8bit (out, addr->str, addr->len, charset))
- && (locale_charset == NULL || !append_8bit (out, addr->str, addr->len, locale_charset)))
- append_latin1 (out, addr->str, addr->len);
-
- g_string_free (addr, TRUE);
- addr = out;
- }
-
- address = camel_header_address_new_name(name ? name->str : "", addr->str);
- }
-
- d(printf("got mailbox: %s\n", addr->str));
-
- g_string_free(addr, TRUE);
- if (name)
- g_string_free(name, TRUE);
-
- return address;
-}
-
-static struct _camel_header_address *
-header_decode_address(const char **in, const char *charset)
-{
- const char *inptr = *in;
- char *pre;
- GString *group = g_string_new("");
- struct _camel_header_address *addr = NULL, *member;
-
- /* pre-scan, trying to work out format, discard results */
- header_decode_lwsp(&inptr);
- while ((pre = header_decode_word (&inptr))) {
- group = g_string_append(group, pre);
- group = g_string_append(group, " ");
- g_free(pre);
- }
- header_decode_lwsp(&inptr);
- if (*inptr == ':') {
- d(printf("group detected: %s\n", group->str));
- addr = camel_header_address_new_group(group->str);
- /* that was a group spec, scan mailbox's */
- inptr++;
- /* FIXME: check rfc 2047 encodings of words, here or above in the loop */
- header_decode_lwsp(&inptr);
- if (*inptr != ';') {
- int go = TRUE;
- do {
- member = header_decode_mailbox(&inptr, charset);
- if (member)
- camel_header_address_add_member(addr, member);
- header_decode_lwsp(&inptr);
- if (*inptr == ',')
- inptr++;
- else
- go = FALSE;
- } while (go);
- if (*inptr == ';') {
- inptr++;
- } else {
- w(g_warning("Invalid group spec, missing closing ';': %s", *in));
- }
- } else {
- inptr++;
- }
- *in = inptr;
- } else {
- addr = header_decode_mailbox(in, charset);
- }
-
- g_string_free(group, TRUE);
-
- return addr;
-}
-
-static char *
-header_msgid_decode_internal(const char **in)
-{
- const char *inptr = *in;
- char *msgid = NULL;
-
- d(printf("decoding Message-ID: '%s'\n", *in));
-
- header_decode_lwsp(&inptr);
- if (*inptr == '<') {
- inptr++;
- header_decode_lwsp(&inptr);
- msgid = header_decode_addrspec(&inptr);
- if (msgid) {
- header_decode_lwsp(&inptr);
- if (*inptr == '>') {
- inptr++;
- } else {
- w(g_warning("Missing closing '>' on message id: %s", *in));
- }
- } else {
- w(g_warning("Cannot find message id in: %s", *in));
- }
- } else {
- w(g_warning("missing opening '<' on message id: %s", *in));
- }
- *in = inptr;
-
- return msgid;
-}
-
-char *
-camel_header_msgid_decode(const char *in)
-{
- if (in == NULL)
- return NULL;
-
- return header_msgid_decode_internal(&in);
-}
-
-char *
-camel_header_contentid_decode (const char *in)
-{
- const char *inptr = in;
- gboolean at = FALSE;
- GString *addr;
- char *buf;
-
- d(printf("decoding Content-ID: '%s'\n", in));
-
- header_decode_lwsp (&inptr);
-
- /* some lame mailers quote the Content-Id */
- if (*inptr == '"')
- inptr++;
-
- /* make sure the content-id is not "" which can happen if we get a
- * content-id such as <.@> (which Eudora likes to use...) */
- if ((buf = camel_header_msgid_decode (inptr)) != NULL && *buf)
- return buf;
-
- g_free (buf);
-
- /* ugh, not a valid msg-id - try to get something useful out of it then? */
- inptr = in;
- header_decode_lwsp (&inptr);
- if (*inptr == '<') {
- inptr++;
- header_decode_lwsp (&inptr);
- }
-
- /* Eudora has been known to use <.@> as a content-id */
- if (!(buf = header_decode_word (&inptr)) && !strchr (".@", *inptr))
- return NULL;
-
- addr = g_string_new ("");
- header_decode_lwsp (&inptr);
- while (buf != NULL || *inptr == '.' || (*inptr == '@' && !at)) {
- if (buf != NULL) {
- g_string_append (addr, buf);
- g_free (buf);
- buf = NULL;
- }
-
- if (!at) {
- if (*inptr == '.') {
- g_string_append_c (addr, *inptr++);
- buf = header_decode_word (&inptr);
- } else if (*inptr == '@') {
- g_string_append_c (addr, *inptr++);
- buf = header_decode_word (&inptr);
- at = TRUE;
- }
- } else if (strchr (".[]", *inptr)) {
- g_string_append_c (addr, *inptr++);
- buf = header_decode_atom (&inptr);
- }
-
- header_decode_lwsp (&inptr);
- }
-
- buf = addr->str;
- g_string_free (addr, FALSE);
-
- return buf;
-}
-
-void
-camel_header_references_list_append_asis(struct _camel_header_references **list, char *ref)
-{
- struct _camel_header_references *w = (struct _camel_header_references *)list, *n;
- while (w->next)
- w = w->next;
- n = g_malloc(sizeof(*n));
- n->id = ref;
- n->next = 0;
- w->next = n;
-}
-
-int
-camel_header_references_list_size(struct _camel_header_references **list)
-{
- int count = 0;
- struct _camel_header_references *w = *list;
- while (w) {
- count++;
- w = w->next;
- }
- return count;
-}
-
-void
-camel_header_references_list_clear(struct _camel_header_references **list)
-{
- struct _camel_header_references *w = *list, *n;
- while (w) {
- n = w->next;
- g_free(w->id);
- g_free(w);
- w = n;
- }
- *list = NULL;
-}
-
-static void
-header_references_decode_single (const char **in, struct _camel_header_references **head)
-{
- struct _camel_header_references *ref;
- const char *inptr = *in;
- char *id, *word;
-
- while (*inptr) {
- header_decode_lwsp (&inptr);
- if (*inptr == '<') {
- id = header_msgid_decode_internal (&inptr);
- if (id) {
- ref = g_malloc (sizeof (struct _camel_header_references));
- ref->next = *head;
- ref->id = id;
- *head = ref;
- break;
- }
- } else {
- word = header_decode_word (&inptr);
- if (word)
- g_free (word);
- else if (*inptr != '\0')
- inptr++; /* Stupid mailer tricks */
- }
- }
-
- *in = inptr;
-}
-
-struct _camel_header_references *
-camel_header_references_inreplyto_decode (const char *in)
-{
- struct _camel_header_references *ref = NULL;
-
- if (in == NULL || in[0] == '\0')
- return NULL;
-
- header_references_decode_single (&in, &ref);
-
- return ref;
-}
-
-/* generate a list of references, from most recent up */
-struct _camel_header_references *
-camel_header_references_decode (const char *in)
-{
- struct _camel_header_references *refs = NULL;
-
- if (in == NULL || in[0] == '\0')
- return NULL;
-
- while (*in)
- header_references_decode_single (&in, &refs);
-
- return refs;
-}
-
-struct _camel_header_references *
-camel_header_references_dup(const struct _camel_header_references *list)
-{
- struct _camel_header_references *new = NULL, *tmp;
-
- while (list) {
- tmp = g_new(struct _camel_header_references, 1);
- tmp->next = new;
- tmp->id = g_strdup(list->id);
- new = tmp;
- list = list->next;
- }
- return new;
-}
-
-struct _camel_header_address *
-camel_header_mailbox_decode(const char *in, const char *charset)
-{
- if (in == NULL)
- return NULL;
-
- return header_decode_mailbox(&in, charset);
-}
-
-struct _camel_header_address *
-camel_header_address_decode(const char *in, const char *charset)
-{
- const char *inptr = in, *last;
- struct _camel_header_address *list = NULL, *addr;
-
- d(printf("decoding To: '%s'\n", in));
-
- if (in == NULL)
- return NULL;
-
- header_decode_lwsp(&inptr);
- if (*inptr == 0)
- return NULL;
-
- do {
- last = inptr;
- addr = header_decode_address(&inptr, charset);
- if (addr)
- camel_header_address_list_append(&list, addr);
- header_decode_lwsp(&inptr);
- if (*inptr == ',')
- inptr++;
- else
- break;
- } while (inptr != last);
-
- if (*inptr) {
- w(g_warning("Invalid input detected at %c (%d): %s\n or at: %s", *inptr, inptr-in, in, inptr));
- }
-
- if (inptr == last) {
- w(g_warning("detected invalid input loop at : %s", last));
- }
-
- return list;
-}
-
-/* this must be kept in sync with the header */
-static const char *encodings[] = {
- "",
- "7bit",
- "8bit",
- "base64",
- "quoted-printable",
- "binary",
- "x-uuencode",
-};
-
-const char *
-camel_transfer_encoding_to_string (CamelTransferEncoding encoding)
-{
- if (encoding >= sizeof (encodings) / sizeof (encodings[0]))
- encoding = 0;
-
- return encodings[encoding];
-}
-
-CamelTransferEncoding
-camel_transfer_encoding_from_string (const char *string)
-{
- int i;
-
- if (string != NULL) {
- for (i = 0; i < sizeof (encodings) / sizeof (encodings[0]); i++)
- if (!strcasecmp (string, encodings[i]))
- return i;
- }
-
- return CAMEL_TRANSFER_ENCODING_DEFAULT;
-}
-
-void
-camel_header_mime_decode(const char *in, int *maj, int *min)
-{
- const char *inptr = in;
- int major=-1, minor=-1;
-
- d(printf("decoding MIME-Version: '%s'\n", in));
-
- if (in != NULL) {
- header_decode_lwsp(&inptr);
- if (isdigit(*inptr)) {
- major = camel_header_decode_int(&inptr);
- header_decode_lwsp(&inptr);
- if (*inptr == '.') {
- inptr++;
- header_decode_lwsp(&inptr);
- if (isdigit(*inptr))
- minor = camel_header_decode_int(&inptr);
- }
- }
- }
-
- if (maj)
- *maj = major;
- if (min)
- *min = minor;
-
- d(printf("major = %d, minor = %d\n", major, minor));
-}
-
-static struct _camel_header_param *
-header_decode_param_list (const char **in)
-{
- const char *inptr = *in;
- struct _camel_header_param *head = NULL, *tail = NULL;
- gboolean last_was_rfc2184 = FALSE;
- gboolean is_rfc2184 = FALSE;
-
- header_decode_lwsp (&inptr);
-
- while (*inptr == ';') {
- struct _camel_header_param *param;
- char *name, *value;
- int rfc2184_part;
-
- inptr++;
- /* invalid format? */
- if (header_decode_param (&inptr, &name, &value, &is_rfc2184, &rfc2184_part) != 0)
- break;
-
- if (is_rfc2184 && tail && !strcasecmp (name, tail->name)) {
- /* rfc2184 allows a parameter to be broken into multiple parts
- * and it looks like we've found one. Append this value to the
- * last value.
- */
- /* FIXME: we should be ordering these based on rfc2184_part id */
- GString *gvalue;
-
- gvalue = g_string_new (tail->value);
- g_string_append (gvalue, value);
- g_free (tail->value);
- g_free (value);
- g_free (name);
-
- tail->value = gvalue->str;
- g_string_free (gvalue, FALSE);
- } else {
- if (last_was_rfc2184) {
- /* We've finished gathering the values for the last param
- * so it is now safe to decode it.
- */
- char *val;
-
- val = rfc2184_decode (tail->value, strlen (tail->value));
- if (val) {
- g_free (tail->value);
- tail->value = val;
- }
- }
-
- param = g_malloc (sizeof (struct _camel_header_param));
- param->name = name;
- param->value = value;
- param->next = NULL;
- if (head == NULL)
- head = param;
- if (tail)
- tail->next = param;
- tail = param;
- }
-
- last_was_rfc2184 = is_rfc2184;
-
- header_decode_lwsp (&inptr);
- }
-
- if (last_was_rfc2184) {
- /* We've finished gathering the values for the last param
- * so it is now safe to decode it.
- */
- char *val;
-
- val = rfc2184_decode (tail->value, strlen (tail->value));
- if (val) {
- g_free (tail->value);
- tail->value = val;
- }
- }
-
- *in = inptr;
-
- return head;
-}
-
-struct _camel_header_param *
-camel_header_param_list_decode(const char *in)
-{
- if (in == NULL)
- return NULL;
-
- return header_decode_param_list(&in);
-}
-
-
-static char *
-header_encode_param (const unsigned char *in, gboolean *encoded)
-{
- register const unsigned char *inptr = in;
- unsigned char *outbuf = NULL;
- const unsigned char *inend;
- iconv_t cd = (iconv_t) -1;
- const char *charset;
- char *outstr;
- int encoding;
- GString *out;
-
- *encoded = FALSE;
-
- g_return_val_if_fail (in != NULL, NULL);
- g_return_val_if_fail (g_utf8_validate (in, -1, NULL), NULL);
-
- /* do a quick us-ascii check (the common case?) */
- while (*inptr) {
- if (*inptr > 127)
- break;
- inptr++;
- }
-
- if (*inptr == '\0')
- return g_strdup (in);
-
- inptr = in;
- encoding = 0;
- while (inptr && *inptr) {
- const char *newinptr;
- gunichar c;
-
- newinptr = g_utf8_next_char (inptr);
- c = g_utf8_get_char (inptr);
- if (newinptr == NULL || !g_unichar_validate (c)) {
- w(g_warning ("Invalid UTF-8 sequence encountered (pos %d, char '%c'): %s",
- (inptr-in), inptr[0], in));
- inptr++;
- continue;
- }
-
- if (c > 127 && c < 256) {
- encoding = MAX (encoding, 1);
- } else if (c >= 256) {
- encoding = MAX (encoding, 2);
- }
-
- inptr = newinptr;
- }
-
- if (encoding == 2)
- charset = camel_charset_best (in, inptr - in);
- else
- charset = "iso-8859-1";
-
- if (strcasecmp (charset, "UTF-8") != 0)
- cd = e_iconv_open (charset, "UTF-8");
-
- if (cd == (iconv_t) -1) {
- charset = "UTF-8";
- inptr = in;
- inend = inptr + strlen (in);
- } else {
- size_t inleft, outleft;
- const char *inbuf;
- char *outptr;
-
- inleft = (inptr - in);
- outleft = inleft * 6 + 20;
- outptr = outbuf = g_malloc (outleft);
- inbuf = in;
-
- if (e_iconv (cd, &inbuf, &inleft, &outptr, &outleft) == (size_t) -1) {
- w(g_warning ("Conversion problem: conversion truncated: %s", strerror (errno)));
- } else {
- e_iconv (cd, NULL, 0, &outptr, &outleft);
- }
-
- e_iconv_close (cd);
-
- inptr = outbuf;
- inend = outptr;
- }
-
- /* FIXME: set the 'language' as well, assuming we can get that info...? */
- out = g_string_new ("");
- g_string_append_printf (out, "%s''", charset);
-
- while (inptr < inend) {
- unsigned char c = *inptr++;
-
- /* FIXME: make sure that '\'', '*', and ';' are also encoded */
-
- if (c > 127) {
- g_string_append_printf (out, "%%%c%c", tohex[(c >> 4) & 0xf], tohex[c & 0xf]);
- } else if (camel_mime_is_lwsp (c) || !(camel_mime_special_table[c] & CAMEL_MIME_IS_ESAFE)) {
- g_string_append_printf (out, "%%%c%c", tohex[(c >> 4) & 0xf], tohex[c & 0xf]);
- } else {
- g_string_append_c (out, c);
- }
- }
-
- g_free (outbuf);
-
- outstr = out->str;
- g_string_free (out, FALSE);
- *encoded = TRUE;
-
- return outstr;
-}
-
-void
-camel_header_param_list_format_append (GString *out, struct _camel_header_param *p)
-{
- int used = out->len;
-
- while (p) {
- gboolean encoded = FALSE;
- gboolean quote = FALSE;
- int here = out->len;
- size_t nlen, vlen;
- char *value;
-
- if (!p->value) {
- p = p->next;
- continue;
- }
-
- value = header_encode_param (p->value, &encoded);
- if (!value) {
- w(g_warning ("appending parameter %s=%s violates rfc2184", p->name, p->value));
- value = g_strdup (p->value);
- }
-
- if (!encoded) {
- char *ch;
-
- for (ch = value; *ch; ch++) {
- if (camel_mime_is_tspecial (*ch) || camel_mime_is_lwsp (*ch))
- break;
- }
-
- quote = ch && *ch;
- }
-
- nlen = strlen (p->name);
- vlen = strlen (value);
-
- if (used + nlen + vlen > CAMEL_FOLD_SIZE - 8) {
- out = g_string_append (out, ";\n\t");
- here = out->len;
- used = 0;
- } else
- out = g_string_append (out, "; ");
-
- if (nlen + vlen > CAMEL_FOLD_SIZE - 8) {
- /* we need to do special rfc2184 parameter wrapping */
- int maxlen = CAMEL_FOLD_SIZE - (nlen + 8);
- char *inptr, *inend;
- int i = 0;
-
- inptr = value;
- inend = value + vlen;
-
- while (inptr < inend) {
- char *ptr = inptr + MIN (inend - inptr, maxlen);
-
- if (encoded && ptr < inend) {
- /* be careful not to break an encoded char (ie %20) */
- char *q = ptr;
- int j = 2;
-
- for ( ; j > 0 && q > inptr && *q != '%'; j--, q--);
- if (*q == '%')
- ptr = q;
- }
-
- if (i != 0) {
- g_string_append (out, ";\n\t");
- here = out->len;
- used = 0;
- }
-
- g_string_append_printf (out, "%s*%d%s=", p->name, i++, encoded ? "*" : "");
- if (encoded || !quote)
- g_string_append_len (out, inptr, ptr - inptr);
- else
- quote_word (out, TRUE, inptr, ptr - inptr);
-
- d(printf ("wrote: %s\n", out->str + here));
-
- used += (out->len - here);
-
- inptr = ptr;
- }
- } else {
- g_string_append_printf (out, "%s%s=", p->name, encoded ? "*" : "");
-
- if (encoded || !quote)
- g_string_append (out, value);
- else
- quote_word (out, TRUE, value, vlen);
-
- used += (out->len - here);
- }
-
- g_free (value);
-
- p = p->next;
- }
-}
-
-char *
-camel_header_param_list_format(struct _camel_header_param *p)
-{
- GString *out = g_string_new("");
- char *ret;
-
- camel_header_param_list_format_append(out, p);
- ret = out->str;
- g_string_free(out, FALSE);
- return ret;
-}
-
-CamelContentType *
-camel_content_type_decode(const char *in)
-{
- const char *inptr = in;
- char *type, *subtype = NULL;
- CamelContentType *t = NULL;
-
- if (in==NULL)
- return NULL;
-
- type = decode_token(&inptr);
- header_decode_lwsp(&inptr);
- if (type) {
- if (*inptr == '/') {
- inptr++;
- subtype = decode_token(&inptr);
- }
- if (subtype == NULL && (!strcasecmp(type, "text"))) {
- w(g_warning("text type with no subtype, resorting to text/plain: %s", in));
- subtype = g_strdup("plain");
- }
- if (subtype == NULL) {
- w(g_warning("MIME type with no subtype: %s", in));
- }
-
- t = camel_content_type_new(type, subtype);
- t->params = header_decode_param_list(&inptr);
- g_free(type);
- g_free(subtype);
- } else {
- g_free(type);
- d(printf("cannot find MIME type in header (2) '%s'", in));
- }
- return t;
-}
-
-void
-camel_content_type_dump(CamelContentType *ct)
-{
- struct _camel_header_param *p;
-
- printf("Content-Type: ");
- if (ct==NULL) {
- printf("<NULL>\n");
- return;
- }
- printf("%s / %s", ct->type, ct->subtype);
- p = ct->params;
- if (p) {
- while (p) {
- printf(";\n\t%s=\"%s\"", p->name, p->value);
- p = p->next;
- }
- }
- printf("\n");
-}
-
-char *
-camel_content_type_format (CamelContentType *ct)
-{
- GString *out;
- char *ret;
-
- if (ct == NULL)
- return NULL;
-
- out = g_string_new ("");
- if (ct->type == NULL) {
- g_string_append_printf (out, "text/plain");
- w(g_warning ("Content-Type with no main type"));
- } else if (ct->subtype == NULL) {
- w(g_warning ("Content-Type with no sub type: %s", ct->type));
- if (!strcasecmp (ct->type, "multipart"))
- g_string_append_printf (out, "%s/mixed", ct->type);
- else
- g_string_append_printf (out, "%s", ct->type);
- } else {
- g_string_append_printf (out, "%s/%s", ct->type, ct->subtype);
- }
- camel_header_param_list_format_append (out, ct->params);
-
- ret = out->str;
- g_string_free (out, FALSE);
-
- return ret;
-}
-
-char *
-camel_content_type_simple (CamelContentType *ct)
-{
- if (ct->type == NULL) {
- w(g_warning ("Content-Type with no main type"));
- return g_strdup ("text/plain");
- } else if (ct->subtype == NULL) {
- w(g_warning ("Content-Type with no sub type: %s", ct->type));
- if (!strcasecmp (ct->type, "multipart"))
- return g_strdup_printf ("%s/mixed", ct->type);
- else
- return g_strdup (ct->type);
- } else
- return g_strdup_printf ("%s/%s", ct->type, ct->subtype);
-}
-
-char *
-camel_content_transfer_encoding_decode (const char *in)
-{
- if (in)
- return decode_token (&in);
-
- return NULL;
-}
-
-CamelContentDisposition *
-camel_content_disposition_decode(const char *in)
-{
- CamelContentDisposition *d = NULL;
- const char *inptr = in;
-
- if (in == NULL)
- return NULL;
-
- d = g_malloc(sizeof(*d));
- d->refcount = 1;
- d->disposition = decode_token(&inptr);
- if (d->disposition == NULL)
- w(g_warning("Empty disposition type"));
- d->params = header_decode_param_list(&inptr);
- return d;
-}
-
-void
-camel_content_disposition_ref(CamelContentDisposition *d)
-{
- if (d)
- d->refcount++;
-}
-
-void
-camel_content_disposition_unref(CamelContentDisposition *d)
-{
- if (d) {
- if (d->refcount<=1) {
- camel_header_param_list_free(d->params);
- g_free(d->disposition);
- g_free(d);
- } else {
- d->refcount--;
- }
- }
-}
-
-char *
-camel_content_disposition_format(CamelContentDisposition *d)
-{
- GString *out;
- char *ret;
-
- if (d==NULL)
- return NULL;
-
- out = g_string_new("");
- if (d->disposition)
- out = g_string_append(out, d->disposition);
- else
- out = g_string_append(out, "attachment");
- camel_header_param_list_format_append(out, d->params);
-
- ret = out->str;
- g_string_free(out, FALSE);
- return ret;
-}
-
-/* hrm, is there a library for this shit? */
-static struct {
- char *name;
- int offset;
-} tz_offsets [] = {
- { "UT", 0 },
- { "GMT", 0 },
- { "EST", -500 }, /* these are all US timezones. bloody yanks */
- { "EDT", -400 },
- { "CST", -600 },
- { "CDT", -500 },
- { "MST", -700 },
- { "MDT", -600 },
- { "PST", -800 },
- { "PDT", -700 },
- { "Z", 0 },
- { "A", -100 },
- { "M", -1200 },
- { "N", 100 },
- { "Y", 1200 },
-};
-
-static char *tz_months [] = {
- "Jan", "Feb", "Mar", "Apr", "May", "Jun",
- "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
-};
-
-static char *tz_days [] = {
- "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
-};
-
-char *
-camel_header_format_date(time_t time, int offset)
-{
- struct tm tm;
-
- d(printf("offset = %d\n", offset));
-
- d(printf("converting date %s", ctime(&time)));
-
- time += ((offset / 100) * (60*60)) + (offset % 100)*60;
-
- d(printf("converting date %s", ctime(&time)));
-
- gmtime_r (&time, &tm);
-
- return g_strdup_printf("%s, %02d %s %04d %02d:%02d:%02d %+05d",
- tz_days[tm.tm_wday],
- tm.tm_mday, tz_months[tm.tm_mon],
- tm.tm_year + 1900,
- tm.tm_hour, tm.tm_min, tm.tm_sec,
- offset);
-}
-
-/* convert a date to time_t representation */
-/* this is an awful mess oh well */
-time_t
-camel_header_decode_date(const char *in, int *saveoffset)
-{
- const char *inptr = in;
- char *monthname;
- gboolean foundmonth;
- int year, offset = 0;
- struct tm tm;
- int i;
- time_t t;
-
- if (in == NULL) {
- if (saveoffset)
- *saveoffset = 0;
- return 0;
- }
-
- d(printf ("\ndecoding date '%s'\n", inptr));
-
- memset (&tm, 0, sizeof(tm));
-
- header_decode_lwsp (&inptr);
- if (!isdigit (*inptr)) {
- char *day = decode_token (&inptr);
- /* we dont really care about the day, it's only for display */
- if (day) {
- d(printf ("got day: %s\n", day));
- g_free (day);
- header_decode_lwsp (&inptr);
- if (*inptr == ',') {
- inptr++;
- } else {
-#ifndef CLEAN_DATE
- return parse_broken_date (in, saveoffset);
-#else
- if (saveoffset)
- *saveoffset = 0;
- return 0;
-#endif /* ! CLEAN_DATE */
- }
- }
- }
- tm.tm_mday = camel_header_decode_int(&inptr);
-#ifndef CLEAN_DATE
- if (tm.tm_mday == 0) {
- return parse_broken_date (in, saveoffset);
- }
-#endif /* ! CLEAN_DATE */
-
- monthname = decode_token(&inptr);
- foundmonth = FALSE;
- if (monthname) {
- for (i=0;i<sizeof(tz_months)/sizeof(tz_months[0]);i++) {
- if (!strcasecmp(tz_months[i], monthname)) {
- tm.tm_mon = i;
- foundmonth = TRUE;
- break;
- }
- }
- g_free(monthname);
- }
-#ifndef CLEAN_DATE
- if (!foundmonth) {
- return parse_broken_date (in, saveoffset);
- }
-#endif /* ! CLEAN_DATE */
-
- year = camel_header_decode_int(&inptr);
- if (year < 69) {
- tm.tm_year = 100 + year;
- } else if (year < 100) {
- tm.tm_year = year;
- } else if (year >= 100 && year < 1900) {
- tm.tm_year = year;
- } else {
- tm.tm_year = year - 1900;
- }
- /* get the time ... yurck */
- tm.tm_hour = camel_header_decode_int(&inptr);
- header_decode_lwsp(&inptr);
- if (*inptr == ':')
- inptr++;
- tm.tm_min = camel_header_decode_int(&inptr);
- header_decode_lwsp(&inptr);
- if (*inptr == ':')
- inptr++;
- tm.tm_sec = camel_header_decode_int(&inptr);
- header_decode_lwsp(&inptr);
- if (*inptr == '+'
- || *inptr == '-') {
- offset = (*inptr++)=='-'?-1:1;
- offset = offset * camel_header_decode_int(&inptr);
- d(printf("abs signed offset = %d\n", offset));
- if (offset < -1200 || offset > 1400)
- offset = 0;
- } else if (isdigit(*inptr)) {
- offset = camel_header_decode_int(&inptr);
- d(printf("abs offset = %d\n", offset));
- if (offset < -1200 || offset > 1400)
- offset = 0;
- } else {
- char *tz = decode_token(&inptr);
-
- if (tz) {
- for (i=0;i<sizeof(tz_offsets)/sizeof(tz_offsets[0]);i++) {
- if (!strcasecmp(tz_offsets[i].name, tz)) {
- offset = tz_offsets[i].offset;
- break;
- }
- }
- g_free(tz);
- }
- /* some broken mailers seem to put in things like GMT+1030 instead of just +1030 */
- header_decode_lwsp(&inptr);
- if (*inptr == '+' || *inptr == '-') {
- int sign = (*inptr++)=='-'?-1:1;
- offset = offset + (camel_header_decode_int(&inptr)*sign);
- }
- d(printf("named offset = %d\n", offset));
- }
-
- t = e_mktime_utc(&tm);
-
- /* t is now GMT of the time we want, but not offset by the timezone ... */
-
- d(printf(" gmt normalized? = %s\n", ctime(&t)));
-
- /* this should convert the time to the GMT equiv time */
- t -= ( (offset/100) * 60*60) + (offset % 100)*60;
-
- d(printf(" gmt normalized for timezone? = %s\n", ctime(&t)));
-
- d({
- char *tmp;
- tmp = camel_header_format_date(t, offset);
- printf(" encoded again: %s\n", tmp);
- g_free(tmp);
- });
-
- if (saveoffset)
- *saveoffset = offset;
-
- return t;
-}
-
-char *
-camel_header_location_decode(const char *in)
-{
- const char *p;
-
- /* Sigh. RFC2557 says:
- * content-location = "Content-Location:" [CFWS] URI [CFWS]
- * where URI is restricted to the syntax for URLs as
- * defined in Uniform Resource Locators [URL] until
- * IETF specifies other kinds of URIs.
- *
- * But Netscape puts quotes around the URI when sending web
- * pages.
- */
-
- header_decode_lwsp(&in);
- if (*in == '"')
- return header_decode_quoted_string(&in);
- else {
- for (p = in; *p && !camel_mime_is_lwsp(*p); p++)
- ;
- return g_strndup(in, p - in);
- }
-}
-
-
-/* extra rfc checks */
-#define CHECKS
-
-#ifdef CHECKS
-static void
-check_header(struct _camel_header_raw *h)
-{
- unsigned char *p;
-
- p = h->value;
- while (p && *p) {
- if (!isascii(*p)) {
- w(g_warning("Appending header violates rfc: %s: %s", h->name, h->value));
- return;
- }
- p++;
- }
-}
-#endif
-
-void
-camel_header_raw_append_parse(struct _camel_header_raw **list, const char *header, int offset)
-{
- register const char *in;
- size_t fieldlen;
- char *name;
-
- in = header;
- while (camel_mime_is_fieldname(*in) || *in==':')
- in++;
- fieldlen = in-header-1;
- while (camel_mime_is_lwsp(*in))
- in++;
- if (fieldlen == 0 || header[fieldlen] != ':') {
- printf("Invalid header line: '%s'\n", header);
- return;
- }
- name = g_alloca (fieldlen + 1);
- memcpy(name, header, fieldlen);
- name[fieldlen] = 0;
-
- camel_header_raw_append(list, name, in, offset);
-}
-
-void
-camel_header_raw_append(struct _camel_header_raw **list, const char *name, const char *value, int offset)
-{
- struct _camel_header_raw *l, *n;
-
- d(printf("Header: %s: %s\n", name, value));
-
- n = g_malloc(sizeof(*n));
- n->next = NULL;
- n->name = g_strdup(name);
- n->value = g_strdup(value);
- n->offset = offset;
-#ifdef CHECKS
- check_header(n);
-#endif
- l = (struct _camel_header_raw *)list;
- while (l->next) {
- l = l->next;
- }
- l->next = n;
-
- /* debug */
-#if 0
- if (!strcasecmp(name, "To")) {
- printf("- Decoding To\n");
- camel_header_to_decode(value);
- } else if (!strcasecmp(name, "Content-type")) {
- printf("- Decoding content-type\n");
- camel_content_type_dump(camel_content_type_decode(value));
- } else if (!strcasecmp(name, "MIME-Version")) {
- printf("- Decoding mime version\n");
- camel_header_mime_decode(value);
- }
-#endif
-}
-
-static struct _camel_header_raw *
-header_raw_find_node(struct _camel_header_raw **list, const char *name)
-{
- struct _camel_header_raw *l;
-
- l = *list;
- while (l) {
- if (!strcasecmp(l->name, name))
- break;
- l = l->next;
- }
- return l;
-}
-
-const char *
-camel_header_raw_find(struct _camel_header_raw **list, const char *name, int *offset)
-{
- struct _camel_header_raw *l;
-
- l = header_raw_find_node(list, name);
- if (l) {
- if (offset)
- *offset = l->offset;
- return l->value;
- } else
- return NULL;
-}
-
-const char *
-camel_header_raw_find_next(struct _camel_header_raw **list, const char *name, int *offset, const char *last)
-{
- struct _camel_header_raw *l;
-
- if (last == NULL || name == NULL)
- return NULL;
-
- l = *list;
- while (l && l->value != last)
- l = l->next;
- return camel_header_raw_find(&l, name, offset);
-}
-
-static void
-header_raw_free(struct _camel_header_raw *l)
-{
- g_free(l->name);
- g_free(l->value);
- g_free(l);
-}
-
-void
-camel_header_raw_remove(struct _camel_header_raw **list, const char *name)
-{
- struct _camel_header_raw *l, *p;
-
- /* the next pointer is at the head of the structure, so this is safe */
- p = (struct _camel_header_raw *)list;
- l = *list;
- while (l) {
- if (!strcasecmp(l->name, name)) {
- p->next = l->next;
- header_raw_free(l);
- l = p->next;
- } else {
- p = l;
- l = l->next;
- }
- }
-}
-
-void
-camel_header_raw_replace(struct _camel_header_raw **list, const char *name, const char *value, int offset)
-{
- camel_header_raw_remove(list, name);
- camel_header_raw_append(list, name, value, offset);
-}
-
-void
-camel_header_raw_clear(struct _camel_header_raw **list)
-{
- struct _camel_header_raw *l, *n;
- l = *list;
- while (l) {
- n = l->next;
- header_raw_free(l);
- l = n;
- }
- *list = NULL;
-}
-
-char *
-camel_header_msgid_generate (void)
-{
- static pthread_mutex_t count_lock = PTHREAD_MUTEX_INITIALIZER;
-#define COUNT_LOCK() pthread_mutex_lock (&count_lock)
-#define COUNT_UNLOCK() pthread_mutex_unlock (&count_lock)
- char host[MAXHOSTNAMELEN];
- struct hostent *h = NULL;
- static int count = 0;
- char *msgid;
- int retval;
-
- retval = gethostname (host, sizeof (host));
-
- if (retval == 0 && *host)
- h = camel_gethostbyname (host, NULL);
- else
- host[0] = '\0';
-
- COUNT_LOCK ();
- msgid = g_strdup_printf ("%d.%d.%d.camel@%s", (int) time (NULL), getpid (), count++,
- h ? h->h_name : (*host ? host : "localhost.localdomain"));
- COUNT_UNLOCK ();
-
- if (h)
- camel_free_host (h);
-
- return msgid;
-}
-
-
-static struct {
- char *name;
- char *pattern;
- regex_t regex;
-} mail_list_magic[] = {
- /* List-Post: <mailto:gnome-hackers@gnome.org> */
- /* List-Post: <mailto:gnome-hackers> */
- { "List-Post", "[ \t]*<mailto:([^@>]+)@?([^ \n\t\r>]*)" },
- /* List-Id: GNOME stuff <gnome-hackers.gnome.org> */
- /* List-Id: <gnome-hackers.gnome.org> */
- /* List-Id: <gnome-hackers> */
- /* This old one wasn't very useful: { "List-Id", " *([^<]+)" },*/
- { "List-Id", "[^<]*<([^\\.>]+)\\.?([^ \n\t\r>]*)" },
- /* Mailing-List: list gnome-hackers@gnome.org; contact gnome-hackers-owner@gnome.org */
- { "Mailing-List", "[ \t]*list ([^@]+)@?([^ \n\t\r>;]*)" },
- /* Originator: gnome-hackers@gnome.org */
- { "Originator", "[ \t]*([^@]+)@?([^ \n\t\r>]*)" },
- /* X-Mailing-List: <gnome-hackers@gnome.org> arcive/latest/100 */
- /* X-Mailing-List: gnome-hackers@gnome.org */
- /* X-Mailing-List: gnome-hackers */
- /* X-Mailing-List: <gnome-hackers> */
- { "X-Mailing-List", "[ \t]*<?([^@>]+)@?([^ \n\t\r>]*)" },
- /* X-Loop: gnome-hackers@gnome.org */
- { "X-Loop", "[ \t]*([^@]+)@?([^ \n\t\r>]*)" },
- /* X-List: gnome-hackers */
- /* X-List: gnome-hackers@gnome.org */
- { "X-List", "[ \t]*([^@]+)@?([^ \n\t\r>]*)" },
- /* Sender: owner-gnome-hackers@gnome.org */
- /* Sender: owner-gnome-hacekrs */
- { "Sender", "[ \t]*owner-([^@]+)@?([^ @\n\t\r>]*)" },
- /* Sender: gnome-hackers-owner@gnome.org */
- /* Sender: gnome-hackers-owner */
- { "Sender", "[ \t]*([^@]+)-owner@?([^ @\n\t\r>]*)" },
- /* Delivered-To: mailing list gnome-hackers@gnome.org */
- /* Delivered-To: mailing list gnome-hackers */
- { "Delivered-To", "[ \t]*mailing list ([^@]+)@?([^ \n\t\r>]*)" },
- /* Sender: owner-gnome-hackers@gnome.org */
- /* Sender: <owner-gnome-hackers@gnome.org> */
- /* Sender: owner-gnome-hackers */
- /* Sender: <owner-gnome-hackers> */
- { "Return-Path", "[ \t]*<?owner-([^@>]+)@?([^ \n\t\r>]*)" },
- /* X-BeenThere: gnome-hackers@gnome.org */
- /* X-BeenThere: gnome-hackers */
- { "X-BeenThere", "[ \t]*([^@]+)@?([^ \n\t\r>]*)" },
- /* List-Unsubscribe: <mailto:gnome-hackers-unsubscribe@gnome.org> */
- { "List-Unsubscribe", "<mailto:(.+)-unsubscribe@([^ \n\t\r>]*)" },
-};
-
-char *
-camel_header_raw_check_mailing_list(struct _camel_header_raw **list)
-{
- const char *v;
- regmatch_t match[3];
- int i;
-
- for (i = 0; i < sizeof (mail_list_magic) / sizeof (mail_list_magic[0]); i++) {
- v = camel_header_raw_find (list, mail_list_magic[i].name, NULL);
- if (v != NULL && regexec (&mail_list_magic[i].regex, v, 3, match, 0) == 0 && match[1].rm_so != -1) {
- char *list;
- int len1, len2;
-
- len1 = match[1].rm_eo - match[1].rm_so;
- len2 = match[2].rm_eo - match[2].rm_so;
-
- list = g_malloc(len1+len2+2);
- memcpy(list, v + match[1].rm_so, len1);
- if (len2) {
- list[len1] = '@';
- memcpy(list+len1+1, v+match[2].rm_so, len2);
- list[len1+len2+1]=0;
- } else {
- list[len1] = 0;
- }
-
- return list;
- }
- }
-
- return NULL;
-}
-
-/* ok, here's the address stuff, what a mess ... */
-struct _camel_header_address *
-camel_header_address_new (void)
-{
- struct _camel_header_address *h;
- h = g_malloc0(sizeof(*h));
- h->type = HEADER_ADDRESS_NONE;
- h->refcount = 1;
- return h;
-}
-
-struct _camel_header_address *
-camel_header_address_new_name(const char *name, const char *addr)
-{
- struct _camel_header_address *h;
- h = camel_header_address_new();
- h->type = HEADER_ADDRESS_NAME;
- h->name = g_strdup(name);
- h->v.addr = g_strdup(addr);
- return h;
-}
-
-struct _camel_header_address *
-camel_header_address_new_group (const char *name)
-{
- struct _camel_header_address *h;
-
- h = camel_header_address_new();
- h->type = HEADER_ADDRESS_GROUP;
- h->name = g_strdup(name);
- return h;
-}
-
-void
-camel_header_address_ref(struct _camel_header_address *h)
-{
- if (h)
- h->refcount++;
-}
-
-void
-camel_header_address_unref(struct _camel_header_address *h)
-{
- if (h) {
- if (h->refcount <= 1) {
- if (h->type == HEADER_ADDRESS_GROUP) {
- camel_header_address_list_clear(&h->v.members);
- } else if (h->type == HEADER_ADDRESS_NAME) {
- g_free(h->v.addr);
- }
- g_free(h->name);
- g_free(h);
- } else {
- h->refcount--;
- }
- }
-}
-
-void
-camel_header_address_set_name(struct _camel_header_address *h, const char *name)
-{
- if (h) {
- g_free(h->name);
- h->name = g_strdup(name);
- }
-}
-
-void
-camel_header_address_set_addr(struct _camel_header_address *h, const char *addr)
-{
- if (h) {
- if (h->type == HEADER_ADDRESS_NAME
- || h->type == HEADER_ADDRESS_NONE) {
- h->type = HEADER_ADDRESS_NAME;
- g_free(h->v.addr);
- h->v.addr = g_strdup(addr);
- } else {
- g_warning("Trying to set the address on a group");
- }
- }
-}
-
-void
-camel_header_address_set_members(struct _camel_header_address *h, struct _camel_header_address *group)
-{
- if (h) {
- if (h->type == HEADER_ADDRESS_GROUP
- || h->type == HEADER_ADDRESS_NONE) {
- h->type = HEADER_ADDRESS_GROUP;
- camel_header_address_list_clear(&h->v.members);
- /* should this ref them? */
- h->v.members = group;
- } else {
- g_warning("Trying to set the members on a name, not group");
- }
- }
-}
-
-void
-camel_header_address_add_member(struct _camel_header_address *h, struct _camel_header_address *member)
-{
- if (h) {
- if (h->type == HEADER_ADDRESS_GROUP
- || h->type == HEADER_ADDRESS_NONE) {
- h->type = HEADER_ADDRESS_GROUP;
- camel_header_address_list_append(&h->v.members, member);
- }
- }
-}
-
-void
-camel_header_address_list_append_list(struct _camel_header_address **l, struct _camel_header_address **h)
-{
- if (l) {
- struct _camel_header_address *n = (struct _camel_header_address *)l;
-
- while (n->next)
- n = n->next;
- n->next = *h;
- }
-}
-
-
-void
-camel_header_address_list_append(struct _camel_header_address **l, struct _camel_header_address *h)
-{
- if (h) {
- camel_header_address_list_append_list(l, &h);
- h->next = NULL;
- }
-}
-
-void
-camel_header_address_list_clear(struct _camel_header_address **l)
-{
- struct _camel_header_address *a, *n;
- a = *l;
- while (a) {
- n = a->next;
- camel_header_address_unref(a);
- a = n;
- }
- *l = NULL;
-}
-
-/* if encode is true, then the result is suitable for mailing, otherwise
- the result is suitable for display only (and may not even be re-parsable) */
-static void
-header_address_list_encode_append (GString *out, int encode, struct _camel_header_address *a)
-{
- char *text;
-
- while (a) {
- switch (a->type) {
- case HEADER_ADDRESS_NAME:
- if (encode)
- text = camel_header_encode_phrase (a->name);
- else
- text = a->name;
- if (text && *text)
- g_string_append_printf (out, "%s <%s>", text, a->v.addr);
- else
- g_string_append (out, a->v.addr);
- if (encode)
- g_free (text);
- break;
- case HEADER_ADDRESS_GROUP:
- if (encode)
- text = camel_header_encode_phrase (a->name);
- else
- text = a->name;
- g_string_append_printf (out, "%s: ", text);
- header_address_list_encode_append (out, encode, a->v.members);
- g_string_append_printf (out, ";");
- if (encode)
- g_free (text);
- break;
- default:
- g_warning ("Invalid address type");
- break;
- }
- a = a->next;
- if (a)
- g_string_append (out, ", ");
- }
-}
-
-char *
-camel_header_address_list_encode (struct _camel_header_address *a)
-{
- GString *out;
- char *ret;
-
- if (a == NULL)
- return NULL;
-
- out = g_string_new ("");
- header_address_list_encode_append (out, TRUE, a);
- ret = out->str;
- g_string_free (out, FALSE);
-
- return ret;
-}
-
-char *
-camel_header_address_list_format (struct _camel_header_address *a)
-{
- GString *out;
- char *ret;
-
- if (a == NULL)
- return NULL;
-
- out = g_string_new ("");
-
- header_address_list_encode_append (out, FALSE, a);
- ret = out->str;
- g_string_free (out, FALSE);
-
- return ret;
-}
-
-char *
-camel_header_address_fold (const char *in, size_t headerlen)
-{
- size_t len, outlen;
- const char *inptr = in, *space, *p, *n;
- GString *out;
- char *ret;
- int i, needunfold = FALSE;
-
- if (in == NULL)
- return NULL;
-
- /* first, check to see if we even need to fold */
- len = headerlen + 2;
- p = in;
- while (*p) {
- n = strchr (p, '\n');
- if (n == NULL) {
- len += strlen (p);
- break;
- }
-
- needunfold = TRUE;
- len += n-p;
-
- if (len >= CAMEL_FOLD_SIZE)
- break;
- len = 0;
- p = n + 1;
- }
- if (len < CAMEL_FOLD_SIZE)
- return g_strdup (in);
-
- /* we need to fold, so first unfold (if we need to), then process */
- if (needunfold)
- inptr = in = camel_header_unfold (in);
-
- out = g_string_new ("");
- outlen = headerlen + 2;
- while (*inptr) {
- space = strchr (inptr, ' ');
- if (space) {
- len = space - inptr + 1;
- } else {
- len = strlen (inptr);
- }
-
- d(printf("next word '%.*s'\n", len, inptr));
-
- if (outlen + len > CAMEL_FOLD_SIZE) {
- d(printf("outlen = %d wordlen = %d\n", outlen, len));
- /* strip trailing space */
- if (out->len > 0 && out->str[out->len-1] == ' ')
- g_string_truncate (out, out->len-1);
- g_string_append (out, "\n\t");
- outlen = 1;
- }
-
- outlen += len;
- for (i = 0; i < len; i++) {
- g_string_append_c (out, inptr[i]);
- }
-
- inptr += len;
- }
- ret = out->str;
- g_string_free (out, FALSE);
-
- if (needunfold)
- g_free ((char *)in);
-
- return ret;
-}
-
-/* simple header folding */
-/* will work even if the header is already folded */
-char *
-camel_header_fold(const char *in, size_t headerlen)
-{
- size_t len, outlen, i;
- const char *inptr = in, *space, *p, *n;
- GString *out;
- char *ret;
- int needunfold = FALSE;
-
- if (in == NULL)
- return NULL;
-
- /* first, check to see if we even need to fold */
- len = headerlen + 2;
- p = in;
- while (*p) {
- n = strchr(p, '\n');
- if (n == NULL) {
- len += strlen (p);
- break;
- }
-
- needunfold = TRUE;
- len += n-p;
-
- if (len >= CAMEL_FOLD_SIZE)
- break;
- len = 0;
- p = n + 1;
- }
- if (len < CAMEL_FOLD_SIZE)
- return g_strdup(in);
-
- /* we need to fold, so first unfold (if we need to), then process */
- if (needunfold)
- inptr = in = camel_header_unfold(in);
-
- out = g_string_new("");
- outlen = headerlen+2;
- while (*inptr) {
- space = strchr(inptr, ' ');
- if (space) {
- len = space-inptr+1;
- } else {
- len = strlen(inptr);
- }
- d(printf("next word '%.*s'\n", len, inptr));
- if (outlen + len > CAMEL_FOLD_SIZE) {
- d(printf("outlen = %d wordlen = %d\n", outlen, len));
- /* strip trailing space */
- if (out->len > 0 && out->str[out->len-1] == ' ')
- g_string_truncate(out, out->len-1);
- g_string_append(out, "\n\t");
- outlen = 1;
- /* check for very long words, just cut them up */
- while (outlen+len > CAMEL_FOLD_MAX_SIZE) {
- for (i=0;i<CAMEL_FOLD_MAX_SIZE-outlen;i++)
- g_string_append_c(out, inptr[i]);
- inptr += CAMEL_FOLD_MAX_SIZE-outlen;
- len -= CAMEL_FOLD_MAX_SIZE-outlen;
- g_string_append(out, "\n\t");
- outlen = 1;
- }
- }
- outlen += len;
- for (i=0;i<len;i++) {
- g_string_append_c(out, inptr[i]);
- }
- inptr += len;
- }
- ret = out->str;
- g_string_free(out, FALSE);
-
- if (needunfold)
- g_free((char *)in);
-
- return ret;
-}
-
-char *
-camel_header_unfold(const char *in)
-{
- char *out = g_malloc(strlen(in)+1);
- const char *inptr = in;
- char c, *o = out;
-
- o = out;
- while ((c = *inptr++)) {
- if (c == '\n') {
- if (camel_mime_is_lwsp(*inptr)) {
- do {
- inptr++;
- } while (camel_mime_is_lwsp(*inptr));
- *o++ = ' ';
- } else {
- *o++ = c;
- }
- } else {
- *o++ = c;
- }
- }
- *o = 0;
-
- return out;
-}
-
-void
-camel_mime_utils_init(void)
-{
- int i, errcode, regex_compilation_failed=0;
-
- /* Init tables */
- header_decode_init();
- base64_init();
-
- /* precompile regex's for speed at runtime */
- for (i = 0; i < sizeof(mail_list_magic) / sizeof(mail_list_magic[0]); i++) {
- errcode = regcomp(&mail_list_magic[i].regex, mail_list_magic[i].pattern, REG_EXTENDED|REG_ICASE);
- if (errcode != 0) {
- char *errstr;
- size_t len;
-
- len = regerror(errcode, &mail_list_magic[i].regex, NULL, 0);
- errstr = g_malloc0(len + 1);
- regerror(errcode, &mail_list_magic[i].regex, errstr, len);
-
- g_warning("Internal error, compiling regex failed: %s: %s", mail_list_magic[i].pattern, errstr);
- g_free(errstr);
- regex_compilation_failed++;
- }
- }
-
- g_assert(regex_compilation_failed == 0);
-}
diff --git a/camel/camel-mime-utils.h b/camel/camel-mime-utils.h
deleted file mode 100644
index efa5b7835a..0000000000
--- a/camel/camel-mime-utils.h
+++ /dev/null
@@ -1,273 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2000-2003 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- * Jeffrey Stedfast <fejj@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-
-#ifndef _CAMEL_MIME_UTILS_H
-#define _CAMEL_MIME_UTILS_H
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <time.h>
-#include <glib.h>
-
-/* maximum recommended size of a line from camel_header_fold() */
-#define CAMEL_FOLD_SIZE (77)
-/* maximum hard size of a line from camel_header_fold() */
-#define CAMEL_FOLD_MAX_SIZE (998)
-
-#define CAMEL_UUDECODE_STATE_INIT (0)
-#define CAMEL_UUDECODE_STATE_BEGIN (1 << 16)
-#define CAMEL_UUDECODE_STATE_END (1 << 17)
-#define CAMEL_UUDECODE_STATE_MASK (CAMEL_UUDECODE_STATE_BEGIN | CAMEL_UUDECODE_STATE_END)
-
-/* note, if you change this, make sure you change the 'encodings' array in camel-mime-part.c */
-typedef enum _CamelTransferEncoding {
- CAMEL_TRANSFER_ENCODING_DEFAULT,
- CAMEL_TRANSFER_ENCODING_7BIT,
- CAMEL_TRANSFER_ENCODING_8BIT,
- CAMEL_TRANSFER_ENCODING_BASE64,
- CAMEL_TRANSFER_ENCODING_QUOTEDPRINTABLE,
- CAMEL_TRANSFER_ENCODING_BINARY,
- CAMEL_TRANSFER_ENCODING_UUENCODE,
- CAMEL_TRANSFER_NUM_ENCODINGS
-} CamelTransferEncoding;
-
-/* a list of references for this message */
-struct _camel_header_references {
- struct _camel_header_references *next;
- char *id;
-};
-
-struct _camel_header_param {
- struct _camel_header_param *next;
- char *name;
- char *value;
-};
-
-/* describes a content-type */
-typedef struct {
- char *type;
- char *subtype;
- struct _camel_header_param *params;
- unsigned int refcount;
-} CamelContentType;
-
-/* a raw rfc822 header */
-/* the value MUST be US-ASCII */
-struct _camel_header_raw {
- struct _camel_header_raw *next;
- char *name;
- char *value;
- int offset; /* in file, if known */
-};
-
-typedef struct _CamelContentDisposition {
- char *disposition;
- struct _camel_header_param *params;
- unsigned int refcount;
-} CamelContentDisposition;
-
-enum _camel_header_address_t {
- HEADER_ADDRESS_NONE, /* uninitialised */
- HEADER_ADDRESS_NAME,
- HEADER_ADDRESS_GROUP
-};
-
-struct _camel_header_address {
- struct _camel_header_address *next;
- enum _camel_header_address_t type;
- char *name;
- union {
- char *addr;
- struct _camel_header_address *members;
- } v;
- unsigned int refcount;
-};
-
-/* MUST be called before everything else */
-void camel_mime_utils_init(void);
-
-/* Address lists */
-struct _camel_header_address *camel_header_address_new (void);
-struct _camel_header_address *camel_header_address_new_name (const char *name, const char *addr);
-struct _camel_header_address *camel_header_address_new_group (const char *name);
-void camel_header_address_ref (struct _camel_header_address *);
-void camel_header_address_unref (struct _camel_header_address *);
-void camel_header_address_set_name (struct _camel_header_address *, const char *name);
-void camel_header_address_set_addr (struct _camel_header_address *, const char *addr);
-void camel_header_address_set_members (struct _camel_header_address *, struct _camel_header_address *group);
-void camel_header_address_add_member (struct _camel_header_address *, struct _camel_header_address *member);
-void camel_header_address_list_append_list (struct _camel_header_address **l, struct _camel_header_address **h);
-void camel_header_address_list_append (struct _camel_header_address **, struct _camel_header_address *);
-void camel_header_address_list_clear (struct _camel_header_address **);
-
-struct _camel_header_address *camel_header_address_decode (const char *in, const char *charset);
-struct _camel_header_address *camel_header_mailbox_decode (const char *in, const char *charset);
-/* for mailing */
-char *camel_header_address_list_encode (struct _camel_header_address *a);
-/* for display */
-char *camel_header_address_list_format (struct _camel_header_address *a);
-
-/* structured header prameters */
-struct _camel_header_param *camel_header_param_list_decode (const char *in);
-char *camel_header_param (struct _camel_header_param *p, const char *name);
-struct _camel_header_param *camel_header_set_param (struct _camel_header_param **l, const char *name, const char *value);
-void camel_header_param_list_format_append (GString *out, struct _camel_header_param *p);
-char *camel_header_param_list_format (struct _camel_header_param *p);
-void camel_header_param_list_free (struct _camel_header_param *p);
-
-/* Content-Type header */
-CamelContentType *camel_content_type_new (const char *type, const char *subtype);
-CamelContentType *camel_content_type_decode (const char *in);
-void camel_content_type_unref (CamelContentType *ct);
-void camel_content_type_ref (CamelContentType *ct);
-const char *camel_content_type_param (CamelContentType *t, const char *name);
-void camel_content_type_set_param (CamelContentType *t, const char *name, const char *value);
-int camel_content_type_is (CamelContentType *ct, const char *type, const char *subtype);
-char *camel_content_type_format (CamelContentType *ct);
-char *camel_content_type_simple (CamelContentType *ct);
-
-/* DEBUGGING function */
-void camel_content_type_dump (CamelContentType *ct);
-
-/* Content-Disposition header */
-CamelContentDisposition *camel_content_disposition_decode (const char *in);
-void camel_content_disposition_ref (CamelContentDisposition *);
-void camel_content_disposition_unref (CamelContentDisposition *);
-char *camel_content_disposition_format (CamelContentDisposition *d);
-
-/* decode the contents of a content-encoding header */
-char *camel_content_transfer_encoding_decode (const char *in);
-
-/* raw headers */
-void camel_header_raw_append (struct _camel_header_raw **list, const char *name, const char *value, int offset);
-void camel_header_raw_append_parse (struct _camel_header_raw **list, const char *header, int offset);
-const char *camel_header_raw_find (struct _camel_header_raw **list, const char *name, int *offset);
-const char *camel_header_raw_find_next (struct _camel_header_raw **list, const char *name, int *offset, const char *last);
-void camel_header_raw_replace (struct _camel_header_raw **list, const char *name, const char *value, int offset);
-void camel_header_raw_remove (struct _camel_header_raw **list, const char *name);
-void camel_header_raw_fold (struct _camel_header_raw **list);
-void camel_header_raw_clear (struct _camel_header_raw **list);
-
-char *camel_header_raw_check_mailing_list (struct _camel_header_raw **list);
-
-/* fold a header */
-char *camel_header_address_fold (const char *in, size_t headerlen);
-char *camel_header_fold (const char *in, size_t headerlen);
-char *camel_header_unfold (const char *in);
-
-/* decode a header which is a simple token */
-char *camel_header_token_decode (const char *in);
-
-int camel_header_decode_int (const char **in);
-
-/* decode/encode a string type, like a subject line */
-char *camel_header_decode_string (const char *in, const char *default_charset);
-char *camel_header_encode_string (const unsigned char *in);
-
-/* encode a phrase, like the real name of an address */
-char *camel_header_encode_phrase (const unsigned char *in);
-
-/* decode an email date field into a GMT time, + optional offset */
-time_t camel_header_decode_date (const char *in, int *saveoffset);
-char *camel_header_format_date (time_t time, int offset);
-
-/* decode a message id */
-char *camel_header_msgid_decode (const char *in);
-char *camel_header_contentid_decode (const char *in);
-
-/* generate msg id */
-char *camel_header_msgid_generate (void);
-
-/* decode a References or In-Reply-To header */
-struct _camel_header_references *camel_header_references_inreplyto_decode (const char *in);
-struct _camel_header_references *camel_header_references_decode (const char *in);
-void camel_header_references_list_clear (struct _camel_header_references **list);
-void camel_header_references_list_append_asis (struct _camel_header_references **list, char *ref);
-int camel_header_references_list_size (struct _camel_header_references **list);
-struct _camel_header_references *camel_header_references_dup (const struct _camel_header_references *list);
-
-/* decode content-location */
-char *camel_header_location_decode (const char *in);
-
-const char *camel_transfer_encoding_to_string (CamelTransferEncoding encoding);
-CamelTransferEncoding camel_transfer_encoding_from_string (const char *string);
-
-/* decode the mime-type header */
-void camel_header_mime_decode (const char *in, int *maj, int *min);
-
-/* do incremental base64/quoted-printable (de/en)coding */
-size_t camel_base64_decode_step (unsigned char *in, size_t len, unsigned char *out, int *state, unsigned int *save);
-
-size_t camel_base64_encode_step (unsigned char *in, size_t len, gboolean break_lines, unsigned char *out, int *state, int *save);
-size_t camel_base64_encode_close (unsigned char *in, size_t len, gboolean break_lines, unsigned char *out, int *state, int *save);
-
-size_t camel_uudecode_step (unsigned char *in, size_t len, unsigned char *out, int *state, guint32 *save);
-
-size_t camel_uuencode_step (unsigned char *in, size_t len, unsigned char *out, unsigned char *uubuf, int *state,
- guint32 *save);
-size_t camel_uuencode_close (unsigned char *in, size_t len, unsigned char *out, unsigned char *uubuf, int *state,
- guint32 *save);
-
-size_t camel_quoted_decode_step (unsigned char *in, size_t len, unsigned char *out, int *savestate, int *saveme);
-
-size_t camel_quoted_encode_step (unsigned char *in, size_t len, unsigned char *out, int *state, int *save);
-size_t camel_quoted_decode_close (unsigned char *in, size_t len, unsigned char *out, int *state, int *save);
-
-char *camel_base64_encode_simple (const char *data, size_t len);
-size_t camel_base64_decode_simple (char *data, size_t len);
-
-/* camel ctype type functions for rfc822/rfc2047/other, which are non-locale specific */
-enum {
- CAMEL_MIME_IS_CTRL = 1<<0,
- CAMEL_MIME_IS_LWSP = 1<<1,
- CAMEL_MIME_IS_TSPECIAL = 1<<2,
- CAMEL_MIME_IS_SPECIAL = 1<<3,
- CAMEL_MIME_IS_SPACE = 1<<4,
- CAMEL_MIME_IS_DSPECIAL = 1<<5,
- CAMEL_MIME_IS_QPSAFE = 1<<6,
- CAMEL_MIME_IS_ESAFE = 1<<7, /* encoded word safe */
- CAMEL_MIME_IS_PSAFE = 1<<8, /* encoded word in phrase safe */
-};
-
-extern unsigned short camel_mime_special_table[256];
-
-#define camel_mime_is_ctrl(x) ((camel_mime_special_table[(unsigned char)(x)] & CAMEL_MIME_IS_CTRL) != 0)
-#define camel_mime_is_lwsp(x) ((camel_mime_special_table[(unsigned char)(x)] & CAMEL_MIME_IS_LWSP) != 0)
-#define camel_mime_is_tspecial(x) ((camel_mime_special_table[(unsigned char)(x)] & CAMEL_MIME_IS_TSPECIAL) != 0)
-#define camel_mime_is_type(x, t) ((camel_mime_special_table[(unsigned char)(x)] & (t)) != 0)
-#define camel_mime_is_ttoken(x) ((camel_mime_special_table[(unsigned char)(x)] & (CAMEL_MIME_IS_TSPECIAL|CAMEL_MIME_IS_LWSP|CAMEL_MIME_IS_CTRL)) == 0)
-#define camel_mime_is_atom(x) ((camel_mime_special_table[(unsigned char)(x)] & (CAMEL_MIME_IS_SPECIAL|CAMEL_MIME_IS_SPACE|CAMEL_MIME_IS_CTRL)) == 0)
-#define camel_mime_is_dtext(x) ((camel_mime_special_table[(unsigned char)(x)] & CAMEL_MIME_IS_DSPECIAL) == 0)
-#define camel_mime_is_fieldname(x) ((camel_mime_special_table[(unsigned char)(x)] & (CAMEL_MIME_IS_CTRL|CAMEL_MIME_IS_SPACE)) == 0)
-#define camel_mime_is_qpsafe(x) ((camel_mime_special_table[(unsigned char)(x)] & CAMEL_MIME_IS_QPSAFE) != 0)
-#define camel_mime_is_especial(x) ((camel_mime_special_table[(unsigned char)(x)] & CAMEL_MIME_IS_ESPECIAL) != 0)
-#define camel_mime_is_psafe(x) ((camel_mime_special_table[(unsigned char)(x)] & CAMEL_MIME_IS_PSAFE) != 0)
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* ! _CAMEL_MIME_UTILS_H */
diff --git a/camel/camel-movemail.c b/camel/camel-movemail.c
deleted file mode 100644
index 70807195e5..0000000000
--- a/camel/camel-movemail.c
+++ /dev/null
@@ -1,542 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-movemail.c: mbox copying function */
-
-/*
- * Author:
- * Dan Winship <danw@ximian.com>
- *
- * Copyright 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <sys/stat.h>
-#include <sys/uio.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <time.h>
-#include <unistd.h>
-#include <string.h>
-#include <signal.h>
-#ifdef HAVE_ALLOCA_H
-#include <alloca.h>
-#endif
-
-#include "camel-movemail.h"
-#include "camel-exception.h"
-
-#include "camel-mime-parser.h"
-#include "camel-mime-filter.h"
-#include "camel-mime-filter-from.h"
-
-#include "camel-lock-client.h"
-
-#define d(x)
-
-#ifdef MOVEMAIL_PATH
-#include <sys/wait.h>
-
-static void movemail_external (const char *source, const char *dest,
- CamelException *ex);
-#endif
-
-#ifdef HAVE_BROKEN_SPOOL
-static int camel_movemail_copy_filter(int fromfd, int tofd, off_t start, size_t bytes, CamelMimeFilter *filter);
-static int camel_movemail_solaris (int oldsfd, int dfd, CamelException *ex);
-#else
-/* these could probably be exposed as a utility? (but only mbox needs it) */
-static int camel_movemail_copy_file(int sfd, int dfd, CamelException *ex);
-#endif
-
-#if 0
-static int camel_movemail_copy(int fromfd, int tofd, off_t start, size_t bytes);
-#endif
-
-/**
- * camel_movemail: Copy an mbox file from a shared spool directory to a
- * new folder in a Camel store
- * @source: source file
- * @dest: destination file
- * @ex: a CamelException
- *
- * This copies an mbox file from a shared directory with multiple
- * readers and writers into a private (presumably Camel-controlled)
- * directory. Dot locking is used on the source file (but not the
- * destination).
- *
- * Return Value: Returns -1 on error.
- **/
-int
-camel_movemail(const char *source, const char *dest, CamelException *ex)
-{
- int lockid = -1;
- int res = -1;
- int sfd, dfd;
- struct stat st;
-
- camel_exception_clear(ex);
-
- /* Stat and then open the spool file. If it doesn't exist or
- * is empty, the user has no mail. (There's technically a race
- * condition here in that an MDA might have just now locked it
- * to deliver a message, but we don't care. In that case,
- * assuming it's unlocked is equivalent to pretending we were
- * called a fraction earlier.)
- */
- if (stat (source, &st) == -1) {
- if (errno != ENOENT) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not check mail file %s: %s"),
- source, g_strerror (errno));
- }
- return -1;
- }
-
- if (st.st_size == 0)
- return 0;
-
- /* open files */
- sfd = open (source, O_RDWR);
- if (sfd == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not open mail file %s: %s"),
- source, g_strerror (errno));
- return -1;
- }
-
- dfd = open (dest, O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR);
- if (dfd == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not open temporary mail "
- "file %s: %s"), dest,
- g_strerror (errno));
- close (sfd);
- return -1;
- }
-
- /* lock our source mailbox */
- lockid = camel_lock_helper_lock(source, ex);
- if (lockid == -1) {
- close(sfd);
- close(dfd);
- return -1;
- }
-
-#ifdef HAVE_BROKEN_SPOOL
- res = camel_movemail_solaris(sfd, dfd, ex);
-#else
- res = camel_movemail_copy_file(sfd, dfd, ex);
-#endif
-
- /* If no errors occurred copying the data, and we successfully
- * close the destination file, then truncate the source file.
- */
- if (res != -1) {
- if (close (dfd) == 0) {
- ftruncate (sfd, 0);
- } else {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Failed to store mail in temp file %s: %s"),
- dest, g_strerror (errno));
- res = -1;
- }
- } else
- close (dfd);
- close (sfd);
-
- camel_lock_helper_unlock(lockid);
-
- return res;
-}
-
-#ifdef MOVEMAIL_PATH
-static void
-movemail_external (const char *source, const char *dest, CamelException *ex)
-{
- sigset_t mask, omask;
- pid_t pid;
- int fd[2], len = 0, nread, status;
- char buf[BUFSIZ], *output = NULL;
-
- /* Block SIGCHLD so the app can't mess us up. */
- sigemptyset (&mask);
- sigaddset (&mask, SIGCHLD);
- sigprocmask (SIG_BLOCK, &mask, &omask);
-
- if (pipe (fd) == -1) {
- sigprocmask (SIG_SETMASK, &omask, NULL);
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not create pipe: %s"),
- g_strerror (errno));
- return;
- }
-
- pid = fork ();
- switch (pid) {
- case -1:
- close (fd[0]);
- close (fd[1]);
- sigprocmask (SIG_SETMASK, &omask, NULL);
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not fork: %s"),
- g_strerror (errno));
- return;
-
- case 0:
- /* Child */
- close (fd[0]);
- close (STDIN_FILENO);
- dup2 (fd[1], STDOUT_FILENO);
- dup2 (fd[1], STDERR_FILENO);
-
- execl (MOVEMAIL_PATH, MOVEMAIL_PATH, source, dest, NULL);
- _exit (255);
- break;
-
- default:
- break;
- }
-
- /* Parent */
- close (fd[1]);
-
- /* Read movemail's output. */
- while ((nread = read (fd[0], buf, sizeof (buf))) > 0) {
- output = g_realloc (output, len + nread + 1);
- memcpy (output + len, buf, nread);
- len += nread;
- output[len] = '\0';
- }
- close (fd[0]);
-
- /* Now get the exit status. */
- while (waitpid (pid, &status, 0) == -1 && errno == EINTR)
- ;
- sigprocmask (SIG_SETMASK, &omask, NULL);
-
- if (!WIFEXITED (status) || WEXITSTATUS (status) != 0) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Movemail program failed: %s"),
- output ? output : _("(Unknown error)"));
- }
- g_free (output);
-}
-#endif
-
-#ifndef HAVE_BROKEN_SPOOL
-static int
-camel_movemail_copy_file(int sfd, int dfd, CamelException *ex)
-{
- int nread, nwrote;
- char buf[4096];
-
- while (1) {
- int written = 0;
-
- nread = read (sfd, buf, sizeof (buf));
- if (nread == 0)
- break;
- else if (nread == -1) {
- if (errno == EINTR)
- continue;
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Error reading mail file: %s"),
- g_strerror (errno));
- return -1;
- }
-
- while (nread) {
- nwrote = write (dfd, buf + written, nread);
- if (nwrote == -1) {
- if (errno == EINTR)
- continue; /* continues inner loop */
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Error writing mail temp file: %s"),
- g_strerror (errno));
- return -1;
- }
- written += nwrote;
- nread -= nwrote;
- }
- }
-
- return 0;
-}
-#endif
-
-#if 0
-static int
-camel_movemail_copy(int fromfd, int tofd, off_t start, size_t bytes)
-{
- char buffer[4096];
- int written = 0;
-
- d(printf("writing %d bytes ... ", bytes));
-
- if (lseek(fromfd, start, SEEK_SET) != start)
- return -1;
-
- while (bytes>0) {
- int toread, towrite;
-
- toread = bytes;
- if (bytes>4096)
- toread = 4096;
- else
- toread = bytes;
- do {
- towrite = read(fromfd, buffer, toread);
- } while (towrite == -1 && errno == EINTR);
-
- if (towrite == -1)
- return -1;
-
- /* check for 'end of file' */
- if (towrite == 0) {
- d(printf("end of file?\n"));
- break;
- }
-
- do {
- toread = write(tofd, buffer, towrite);
- } while (toread == -1 && errno == EINTR);
-
- if (toread == -1)
- return -1;
-
- written += toread;
- bytes -= toread;
- }
-
- d(printf("written %d bytes\n", written));
-
- return written;
-}
-#endif
-
-#define PRE_SIZE (32)
-
-#ifdef HAVE_BROKEN_SPOOL
-static int
-camel_movemail_copy_filter(int fromfd, int tofd, off_t start, size_t bytes, CamelMimeFilter *filter)
-{
- char buffer[4096+PRE_SIZE];
- int written = 0;
- char *filterbuffer;
- int filterlen, filterpre;
-
- d(printf("writing %d bytes ... ", bytes));
-
- camel_mime_filter_reset(filter);
-
- if (lseek(fromfd, start, SEEK_SET) != start)
- return -1;
-
- while (bytes>0) {
- int toread, towrite;
-
- toread = bytes;
- if (bytes>4096)
- toread = 4096;
- else
- toread = bytes;
- do {
- towrite = read(fromfd, buffer+PRE_SIZE, toread);
- } while (towrite == -1 && errno == EINTR);
-
- if (towrite == -1)
- return -1;
-
- d(printf("read %d unfiltered bytes\n", towrite));
-
- /* check for 'end of file' */
- if (towrite == 0) {
- d(printf("end of file?\n"));
- camel_mime_filter_complete(filter, buffer+PRE_SIZE, towrite, PRE_SIZE,
- &filterbuffer, &filterlen, &filterpre);
- towrite = filterlen;
- if (towrite == 0)
- break;
- } else {
- camel_mime_filter_filter(filter, buffer+PRE_SIZE, towrite, PRE_SIZE,
- &filterbuffer, &filterlen, &filterpre);
- towrite = filterlen;
- }
-
- d(printf("writing %d filtered bytes\n", towrite));
-
- do {
- toread = write(tofd, filterbuffer, towrite);
- } while (toread == -1 && errno == EINTR);
-
- if (toread == -1)
- return -1;
-
- written += toread;
- bytes -= toread;
- }
-
- d(printf("written %d bytes\n", written));
-
- return written;
-}
-
-/* write the headers back out again, but not he Content-Length header, because we dont
- want to maintain it! */
-static int
-solaris_header_write(int fd, struct _camel_header_raw *header)
-{
- struct iovec iv[4];
- int outlen = 0, len;
-
- iv[1].iov_base = ":";
- iv[1].iov_len = 1;
- iv[3].iov_base = "\n";
- iv[3].iov_len = 1;
-
- while (header) {
- if (strcasecmp(header->name, "Content-Length")) {
- iv[0].iov_base = header->name;
- iv[0].iov_len = strlen(header->name);
- iv[2].iov_base = header->value;
- iv[2].iov_len = strlen(header->value);
-
- do {
- len = writev(fd, iv, 4);
- } while (len == -1 && errno == EINTR);
-
- if (len == -1)
- return -1;
- outlen += len;
- }
- header = header->next;
- }
-
- do {
- len = write(fd, "\n", 1);
- } while (len == -1 && errno == EINTR);
-
- if (len == -1)
- return -1;
-
- outlen += 1;
-
- d(printf("Wrote %d bytes of headers\n", outlen));
-
- return outlen;
-}
-
-/* Well, since Solaris is a tad broken wrt its 'mbox' folder format,
- we must convert it to a real mbox format. Thankfully this is
- mostly pretty easy */
-static int
-camel_movemail_solaris (int oldsfd, int dfd, CamelException *ex)
-{
- CamelMimeParser *mp;
- char *buffer;
- int len;
- int sfd;
- CamelMimeFilterFrom *ffrom;
- int ret = 1;
- char *from = NULL;
-
- /* need to dup as the mime parser will close on finish */
- sfd = dup(oldsfd);
- if (sfd == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Error copying mail temp file: %s"),
- g_strerror (errno));
- return -1;
- }
-
- mp = camel_mime_parser_new();
- camel_mime_parser_scan_from(mp, TRUE);
- camel_mime_parser_init_with_fd(mp, sfd);
-
- ffrom = camel_mime_filter_from_new();
-
- while (camel_mime_parser_step(mp, &buffer, &len) == CAMEL_MIME_PARSER_STATE_FROM) {
- g_assert(camel_mime_parser_from_line(mp));
- from = g_strdup(camel_mime_parser_from_line(mp));
- if (camel_mime_parser_step(mp, &buffer, &len) != CAMEL_MIME_PARSER_STATE_FROM_END) {
- const char *cl;
- int length;
- int start, body;
- off_t newpos;
-
- ret = 0;
-
- start = camel_mime_parser_tell_start_from(mp);
- body = camel_mime_parser_tell(mp);
-
- if (write(dfd, from, strlen(from)) != strlen(from))
- goto fail;
-
- /* write out headers, but NOT content-length header */
- if (solaris_header_write(dfd, camel_mime_parser_headers_raw(mp)) == -1)
- goto fail;
-
- cl = camel_mime_parser_header(mp, "content-length", NULL);
- if (cl == NULL) {
- g_warning("Required Content-Length header is missing from solaris mail box @ %d", (int)camel_mime_parser_tell(mp));
- camel_mime_parser_drop_step(mp);
- camel_mime_parser_drop_step(mp);
- camel_mime_parser_step(mp, &buffer, &len);
- camel_mime_parser_unstep(mp);
- length = camel_mime_parser_tell_start_from(mp) - body;
- newpos = -1;
- } else {
- length = atoi(cl);
- camel_mime_parser_drop_step(mp);
- camel_mime_parser_drop_step(mp);
- newpos = length+body;
- }
- /* copy body->length converting From lines */
- if (camel_movemail_copy_filter(sfd, dfd, body, length, (CamelMimeFilter *)ffrom) == -1)
- goto fail;
- if (newpos != -1)
- camel_mime_parser_seek(mp, newpos, SEEK_SET);
- } else {
- g_error("Inalid parser state: %d", camel_mime_parser_state(mp));
- }
- g_free(from);
- }
-
- camel_object_unref((CamelObject *)mp);
- camel_object_unref((CamelObject *)ffrom);
-
- return ret;
-
-fail:
- g_free(from);
-
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Error copying mail temp file: %s"),
- g_strerror (errno));
-
-
- camel_object_unref((CamelObject *)mp);
- camel_object_unref((CamelObject *)ffrom);
-
- return -1;
-}
-#endif /* HAVE_BROKEN_SPOOL */
-
diff --git a/camel/camel-movemail.h b/camel/camel-movemail.h
deleted file mode 100644
index 3e5206f672..0000000000
--- a/camel/camel-movemail.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-movemail.h: mbox copy function */
-
-/*
- * Author:
- * Dan Winship <danw@ximian.com>
- *
- * Copyright 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifndef CAMEL_MOVEMAIL_H
-#define CAMEL_MOVEMAIL_H 1
-
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include <camel/camel-exception.h>
-
-int camel_movemail (const char *source, const char *dest, CamelException *ex);
-
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_MOVEMAIL_H */
diff --git a/camel/camel-multipart-encrypted.c b/camel/camel-multipart-encrypted.c
deleted file mode 100644
index aa036bec23..0000000000
--- a/camel/camel-multipart-encrypted.c
+++ /dev/null
@@ -1,273 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2002 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <string.h>
-
-#include "camel-multipart-encrypted.h"
-#include "camel-mime-filter-crlf.h"
-#include "camel-stream-filter.h"
-#include "camel-stream-mem.h"
-#include "camel-stream-fs.h"
-#include "camel-mime-utils.h"
-#include "camel-mime-part.h"
-
-static void camel_multipart_encrypted_class_init (CamelMultipartEncryptedClass *klass);
-static void camel_multipart_encrypted_init (gpointer object, gpointer klass);
-static void camel_multipart_encrypted_finalize (CamelObject *object);
-
-static void set_mime_type_field (CamelDataWrapper *data_wrapper, CamelContentType *mime_type);
-
-
-static CamelMultipartClass *parent_class = NULL;
-
-
-CamelType
-camel_multipart_encrypted_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_multipart_get_type (),
- "CamelMultipartEncrypted",
- sizeof (CamelMultipartEncrypted),
- sizeof (CamelMultipartEncryptedClass),
- (CamelObjectClassInitFunc) camel_multipart_encrypted_class_init,
- NULL,
- (CamelObjectInitFunc) camel_multipart_encrypted_init,
- (CamelObjectFinalizeFunc) camel_multipart_encrypted_finalize);
- }
-
- return type;
-}
-
-
-static void
-camel_multipart_encrypted_class_init (CamelMultipartEncryptedClass *klass)
-{
- CamelDataWrapperClass *camel_data_wrapper_class = CAMEL_DATA_WRAPPER_CLASS (klass);
-
- parent_class = (CamelMultipartClass *) camel_multipart_get_type ();
-
- /* virtual method overload */
- camel_data_wrapper_class->set_mime_type_field = set_mime_type_field;
-}
-
-static void
-camel_multipart_encrypted_init (gpointer object, gpointer klass)
-{
- CamelMultipartEncrypted *multipart = (CamelMultipartEncrypted *) object;
-
- camel_data_wrapper_set_mime_type (CAMEL_DATA_WRAPPER (multipart), "multipart/encrypted");
-
- multipart->decrypted = NULL;
-}
-
-static void
-camel_multipart_encrypted_finalize (CamelObject *object)
-{
- CamelMultipartEncrypted *mpe = (CamelMultipartEncrypted *) object;
-
- g_free (mpe->protocol);
-
- if (mpe->decrypted)
- camel_object_unref (mpe->decrypted);
-}
-
-/* we snoop the mime type to get the protocol */
-static void
-set_mime_type_field (CamelDataWrapper *data_wrapper, CamelContentType *mime_type)
-{
- CamelMultipartEncrypted *mpe = (CamelMultipartEncrypted *) data_wrapper;
-
- if (mime_type) {
- const char *protocol;
-
- protocol = camel_content_type_param (mime_type, "protocol");
- g_free (mpe->protocol);
- mpe->protocol = g_strdup (protocol);
- }
-
- ((CamelDataWrapperClass *) parent_class)->set_mime_type_field (data_wrapper, mime_type);
-}
-
-
-/**
- * camel_multipart_encrypted_new:
- *
- * Create a new CamelMultipartEncrypted object.
- *
- * A MultipartEncrypted should be used to store and create parts of
- * type "multipart/encrypted".
- *
- * Returns a new CamelMultipartEncrypted
- **/
-CamelMultipartEncrypted *
-camel_multipart_encrypted_new (void)
-{
- CamelMultipartEncrypted *multipart;
-
- multipart = (CamelMultipartEncrypted *) camel_object_new (CAMEL_MULTIPART_ENCRYPTED_TYPE);
-
- return multipart;
-}
-
-
-int
-camel_multipart_encrypted_encrypt (CamelMultipartEncrypted *mpe, CamelMimePart *content,
- CamelCipherContext *cipher, const char *userid,
- GPtrArray *recipients, CamelException *ex)
-{
- abort();
-
-#if 0
- CamelMimePart *version_part, *encrypted_part;
- CamelContentType *mime_type;
- CamelDataWrapper *wrapper;
- CamelStream *stream;
-
- g_return_val_if_fail (CAMEL_IS_MULTIPART_ENCRYPTED (mpe), -1);
- g_return_val_if_fail (CAMEL_IS_CIPHER_CONTEXT (cipher), -1);
- g_return_val_if_fail (cipher->encrypt_protocol != NULL, -1);
- g_return_val_if_fail (CAMEL_IS_MIME_PART (content), -1);
-
- /* encrypt the content stream */
- encrypted_part = camel_mime_part_new();
- if (camel_cipher_encrypt (cipher, userid, recipients, content, encrypted_part, ex) == -1) {
- camel_object_unref(encrypted_part);
- return -1;
- }
-
- /* construct the version part */
- stream = camel_stream_mem_new ();
- camel_stream_write_string (stream, "Version: 1\n");
- camel_stream_reset (stream);
-
- version_part = camel_mime_part_new ();
- wrapper = camel_data_wrapper_new ();
- camel_data_wrapper_set_mime_type (wrapper, cipher->encrypt_protocol);
- camel_data_wrapper_construct_from_stream (wrapper, stream);
- camel_object_unref (stream);
- camel_medium_set_content_object ((CamelMedium *) version_part, wrapper);
- camel_object_unref (wrapper);
-
- /* save the version and encrypted parts */
- /* FIXME: make sure there aren't any other parts?? */
- camel_multipart_add_part (CAMEL_MULTIPART (mpe), version_part);
- camel_object_unref (version_part);
- camel_multipart_add_part (CAMEL_MULTIPART (mpe), encrypted_part);
- camel_object_unref (encrypted_part);
-
- /* cache the decrypted content */
- camel_object_ref (content);
- mpe->decrypted = content;
-
- /* set the content-type params for this multipart/encrypted part */
- mime_type = camel_content_type_new ("multipart", "encrypted");
- camel_content_type_set_param (mime_type, "protocol", cipher->encrypt_protocol);
- camel_data_wrapper_set_mime_type_field (CAMEL_DATA_WRAPPER (mpe), mime_type);
- camel_content_type_unref (mime_type);
- camel_multipart_set_boundary ((CamelMultipart *) mpe, NULL);
-#endif
-
- return 0;
-}
-
-
-CamelMimePart *
-camel_multipart_encrypted_decrypt (CamelMultipartEncrypted *mpe,
- CamelCipherContext *cipher,
- CamelException *ex)
-{
- CamelMimePart *version_part, *encrypted_part, *decrypted_part;
- CamelContentType *mime_type;
- CamelCipherValidity *valid;
- CamelDataWrapper *wrapper;
- const char *protocol;
- char *content_type;
-
- g_return_val_if_fail (CAMEL_IS_MULTIPART_ENCRYPTED (mpe), NULL);
- g_return_val_if_fail (CAMEL_IS_CIPHER_CONTEXT (cipher), NULL);
- g_return_val_if_fail (cipher->encrypt_protocol != NULL, NULL);
-
- if (mpe->decrypted) {
- /* we seem to have already decrypted the part */
- camel_object_ref (mpe->decrypted);
- return mpe->decrypted;
- }
-
- protocol = mpe->protocol;
-
- if (protocol) {
- /* make sure the protocol matches the cipher encrypt protocol */
- if (g_ascii_strcasecmp (cipher->encrypt_protocol, protocol) != 0) {
- camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Failed to decrypt MIME part: protocol error"));
-
- return NULL;
- }
- } else {
- /* *shrug* - I guess just go on as if they match? */
- protocol = cipher->encrypt_protocol;
- }
-
- /* make sure the protocol matches the version part's content-type */
- version_part = camel_multipart_get_part (CAMEL_MULTIPART (mpe), CAMEL_MULTIPART_ENCRYPTED_VERSION);
- wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (version_part));
- content_type = camel_data_wrapper_get_mime_type (wrapper);
- if (g_ascii_strcasecmp (content_type, protocol) != 0) {
- camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Failed to decrypt MIME part: protocol error"));
-
- g_free (content_type);
-
- return NULL;
- }
- g_free (content_type);
-
- /* get the encrypted part (second part) */
- encrypted_part = camel_multipart_get_part (CAMEL_MULTIPART (mpe), CAMEL_MULTIPART_ENCRYPTED_CONTENT);
- mime_type = camel_mime_part_get_content_type (encrypted_part);
- if (!camel_content_type_is (mime_type, "application", "octet-stream")) {
- camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Failed to decrypt MIME part: invalid structure"));
- return NULL;
- }
-
- decrypted_part = camel_mime_part_new();
- valid = camel_cipher_decrypt(cipher, encrypted_part, decrypted_part, ex);
- if (valid) {
- camel_object_ref(decrypted_part);
- mpe->decrypted = decrypted_part;
- camel_cipher_validity_free(valid);
- } else {
- camel_object_ref(decrypted_part);
- decrypted_part = NULL;
- }
-
- return decrypted_part;
-}
diff --git a/camel/camel-multipart-encrypted.h b/camel/camel-multipart-encrypted.h
deleted file mode 100644
index 94bcb792cf..0000000000
--- a/camel/camel-multipart-encrypted.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2002 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifndef __CAMEL_MULTIPART_ENCRYPTED_H__
-#define __CAMEL_MULTIPART_ENCRYPTED_H__
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <camel/camel-multipart.h>
-#include <camel/camel-cipher-context.h>
-
-#define CAMEL_MULTIPART_ENCRYPTED_TYPE (camel_multipart_encrypted_get_type ())
-#define CAMEL_MULTIPART_ENCRYPTED(obj) (CAMEL_CHECK_CAST((obj), CAMEL_MULTIPART_ENCRYPTED_TYPE, CamelMultipartEncrypted))
-#define CAMEL_MULTIPART_ENCRYPTED_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_MULTIPART_ENCRYPTED_TYPE, CamelMultipartEncryptedClass))
-#define CAMEL_IS_MULTIPART_ENCRYPTED(o) (CAMEL_CHECK_TYPE((o), CAMEL_MULTIPART_ENCRYPTED_TYPE))
-
-typedef struct _CamelMultipartEncrypted CamelMultipartEncrypted;
-typedef struct _CamelMultipartEncryptedClass CamelMultipartEncryptedClass;
-
-/* 'handy' enums for getting the internal parts of the multipart */
-enum {
- CAMEL_MULTIPART_ENCRYPTED_VERSION,
- CAMEL_MULTIPART_ENCRYPTED_CONTENT,
-};
-
-struct _CamelMultipartEncrypted {
- CamelMultipart parent_object;
-
- CamelMimePart *version;
- CamelMimePart *content;
- CamelMimePart *decrypted;
-
- char *protocol;
-};
-
-
-struct _CamelMultipartEncryptedClass {
- CamelMultipartClass parent_class;
-
-};
-
-
-CamelType camel_multipart_encrypted_get_type (void);
-
-
-CamelMultipartEncrypted *camel_multipart_encrypted_new (void);
-
-int camel_multipart_encrypted_encrypt (CamelMultipartEncrypted *mpe, CamelMimePart *content,
- CamelCipherContext *cipher, const char *userid,
- GPtrArray *recipients, CamelException *ex);
-
-CamelMimePart *camel_multipart_encrypted_decrypt (CamelMultipartEncrypted *mpe,
- CamelCipherContext *cipher,
- CamelException *ex);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __CAMEL_MULTIPART_ENCRYPTED_H__ */
diff --git a/camel/camel-multipart-signed.c b/camel/camel-multipart-signed.c
deleted file mode 100644
index 5dca448a7f..0000000000
--- a/camel/camel-multipart-signed.c
+++ /dev/null
@@ -1,763 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- * camel-multipart.c : Abstract class for a multipart
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * Copyright 2002 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef HAVE_ALLOCA_H
-#include <alloca.h>
-#endif
-
-#include <stdio.h>
-
-#include <string.h>
-#include <unistd.h>
-#include <time.h>
-
-#include <errno.h>
-
-#include "camel-mime-part.h"
-#include "camel-mime-message.h"
-#include "camel-mime-parser.h"
-#include "camel-stream-mem.h"
-#include "camel-multipart-signed.h"
-#include "camel-mime-part.h"
-#include "camel-exception.h"
-#include "md5-utils.h"
-
-#include "camel-stream-filter.h"
-#include "camel-seekable-substream.h"
-#include "camel-mime-filter-crlf.h"
-#include "camel-mime-filter-canon.h"
-
-#define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))
- #include <stdio.h>;*/
-
-static void signed_add_part (CamelMultipart *multipart, CamelMimePart *part);
-static void signed_add_part_at (CamelMultipart *multipart, CamelMimePart *part, guint index);
-static void signed_remove_part (CamelMultipart *multipart, CamelMimePart *part);
-static CamelMimePart *signed_remove_part_at (CamelMultipart *multipart, guint index);
-static CamelMimePart *signed_get_part (CamelMultipart *multipart, guint index);
-static guint signed_get_number (CamelMultipart *multipart);
-
-static ssize_t write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream);
-static void set_mime_type_field (CamelDataWrapper *data_wrapper, CamelContentType *mime_type);
-static int construct_from_stream (CamelDataWrapper *data_wrapper, CamelStream *stream);
-static int signed_construct_from_parser (CamelMultipart *multipart, struct _CamelMimeParser *mp);
-
-static CamelMultipartClass *parent_class = NULL;
-
-/* Returns the class for a CamelMultipartSigned */
-#define CMP_CLASS(so) CAMEL_MULTIPART_SIGNED_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-
-/* Returns the class for a CamelDataWrapper */
-#define CDW_CLASS(so) CAMEL_DATA_WRAPPER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-
-static void
-camel_multipart_signed_class_init (CamelMultipartSignedClass *camel_multipart_signed_class)
-{
- CamelDataWrapperClass *camel_data_wrapper_class = CAMEL_DATA_WRAPPER_CLASS(camel_multipart_signed_class);
- CamelMultipartClass *mpclass = (CamelMultipartClass *)camel_multipart_signed_class;
-
- parent_class = (CamelMultipartClass *)camel_multipart_get_type();
-
- /* virtual method overload */
- camel_data_wrapper_class->construct_from_stream = construct_from_stream;
- camel_data_wrapper_class->write_to_stream = write_to_stream;
- camel_data_wrapper_class->decode_to_stream = write_to_stream;
- camel_data_wrapper_class->set_mime_type_field = set_mime_type_field;
-
- mpclass->add_part = signed_add_part;
- mpclass->add_part_at = signed_add_part_at;
- mpclass->remove_part = signed_remove_part;
- mpclass->remove_part_at = signed_remove_part_at;
- mpclass->get_part = signed_get_part;
- mpclass->get_number = signed_get_number;
- mpclass->construct_from_parser = signed_construct_from_parser;
-
-/*
- mpclass->get_boundary = signed_get_boundary;
- mpclass->set_boundary = signed_set_boundary;
-*/
-}
-
-static void
-camel_multipart_signed_init (gpointer object, gpointer klass)
-{
- CamelMultipartSigned *multipart = (CamelMultipartSigned *)object;
-
- camel_data_wrapper_set_mime_type(CAMEL_DATA_WRAPPER(multipart), "multipart/signed");
- multipart->start1 = -1;
-}
-
-static void
-camel_multipart_signed_finalize (CamelObject *object)
-{
- CamelMultipartSigned *mps = (CamelMultipartSigned *)object;
-
- g_free(mps->protocol);
- g_free(mps->micalg);
- if (mps->signature)
- camel_object_unref((CamelObject *)mps->signature);
- if (mps->content)
- camel_object_unref((CamelObject *)mps->content);
- if (mps->contentraw)
- camel_object_unref((CamelObject *)mps->contentraw);
-}
-
-CamelType
-camel_multipart_signed_get_type (void)
-{
- static CamelType camel_multipart_signed_type = CAMEL_INVALID_TYPE;
-
- if (camel_multipart_signed_type == CAMEL_INVALID_TYPE) {
- camel_multipart_signed_type = camel_type_register (camel_multipart_get_type (), "CamelMultipartSigned",
- sizeof (CamelMultipartSigned),
- sizeof (CamelMultipartSignedClass),
- (CamelObjectClassInitFunc) camel_multipart_signed_class_init,
- NULL,
- (CamelObjectInitFunc) camel_multipart_signed_init,
- (CamelObjectFinalizeFunc) camel_multipart_signed_finalize);
- }
-
- return camel_multipart_signed_type;
-}
-
-/**
- * camel_multipart_signed_new:
- *
- * Create a new CamelMultipartSigned object.
- *
- * A MultipartSigned should be used to store and create parts of
- * type "multipart/signed". This is because multipart/signed is
- * entirely broken-by-design (tm) and uses completely
- * different semantics to other mutlipart types. It must be treated
- * as opaque data by any transport. See rfc 3156 for details.
- *
- * There are 3 ways to create the part:
- * Use construct_from_stream. If this is used, then you must
- * set the mime_type appropriately to match the data uses, so
- * that the multiple parts my be extracted.
- *
- * Use construct_from_parser. The parser MUST be in the CAMEL_MIME_PARSER_STATE_HEADER
- * state, and the current content_type MUST be "multipart/signed" with
- * the appropriate boundary and it SHOULD include the appropriate protocol
- * and hash specifiers.
- *
- * Use sign_part. A signature part will automatically be created
- * and the whole part may be written using write_to_stream to
- * create a 'transport-safe' version (as safe as can be expected with
- * such a broken specification).
- *
- * Return value: a new CamelMultipartSigned
- **/
-CamelMultipartSigned *
-camel_multipart_signed_new (void)
-{
- CamelMultipartSigned *multipart;
-
- multipart = (CamelMultipartSigned *)camel_object_new(CAMEL_MULTIPART_SIGNED_TYPE);
-
- return multipart;
-}
-
-/* find the next boundary @bound from @start, return the start of the actual data
- @end points to the end of the data BEFORE the boundary */
-static char *parse_boundary(char *start, const char *bound, char **end)
-{
- char *data, *begin;
-
- begin = strstr(start, bound);
- if (begin == NULL)
- return NULL;
-
- data = begin+strlen(bound);
- if (begin > start && begin[-1] == '\n')
- begin--;
- if (begin > start && begin[-1] == '\r')
- begin--;
- if (data[0] == '\r')
- data++;
- if (data[0] == '\n')
- data++;
-
- *end = begin;
- return data;
-}
-
-/* yeah yuck.
- Well, we could probably use the normal mime parser, but then it would change our
- headers.
- This is good enough ... till its not! */
-static int
-parse_content(CamelMultipartSigned *mps)
-{
- CamelMultipart *mp = (CamelMultipart *)mps;
- char *start, *end, *start2, *end2, *last, *post;
- CamelStreamMem *mem;
- char *bound;
- const char *boundary;
-
- boundary = camel_multipart_get_boundary(mp);
- if (boundary == NULL) {
- g_warning("Trying to get multipart/signed content without setting boundary first");
- return -1;
- }
-
- /* turn it into a string, and 'fix' it up */
- /* this is extremely dodgey but should work! */
- mem = (CamelStreamMem *)((CamelDataWrapper *)mps)->stream;
- if (mem == NULL) {
- g_warning("Trying to parse multipart/signed without constructing first");
- return -1;
- }
-
- camel_stream_write((CamelStream *)mem, "", 1);
- g_byte_array_set_size(mem->buffer, mem->buffer->len-1);
- last = mem->buffer->data + mem->buffer->len;
-
- bound = alloca(strlen(boundary)+5);
- sprintf(bound, "--%s", boundary);
-
- start = parse_boundary(mem->buffer->data, bound, &end);
- if (start == NULL || start[0] == 0)
- return -1;
-
- if (end > (char *)mem->buffer->data) {
- char *tmp = g_strndup(mem->buffer->data, start-(char *)mem->buffer->data-1);
- camel_multipart_set_preface(mp, tmp);
- g_free(tmp);
- }
-
- start2 = parse_boundary(start, bound, &end);
- if (start2 == NULL || start2[0] == 0)
- return -1;
-
- sprintf(bound, "--%s--", boundary);
- post = parse_boundary(start2, bound, &end2);
- if (post == NULL)
- return -1;
-
- if (post[0])
- camel_multipart_set_postface(mp, post);
-
- mps->start1 = start-(char *)mem->buffer->data;
- mps->end1 = end-(char *)mem->buffer->data;
- mps->start2 = start2-(char *)mem->buffer->data;
- mps->end2 = end2-(char *)mem->buffer->data;
-
- return 0;
-}
-
-/* we snoop the mime type to get boundary and hash info */
-static void
-set_mime_type_field(CamelDataWrapper *data_wrapper, CamelContentType *mime_type)
-{
- CamelMultipartSigned *mps = (CamelMultipartSigned *)data_wrapper;
-
- ((CamelDataWrapperClass *)parent_class)->set_mime_type_field(data_wrapper, mime_type);
- if (mime_type) {
- const char *micalg, *protocol;
-
- protocol = camel_content_type_param(mime_type, "protocol");
- g_free(mps->protocol);
- mps->protocol = g_strdup(protocol);
-
- micalg = camel_content_type_param(mime_type, "micalg");
- g_free(mps->micalg);
- mps->micalg = g_strdup(micalg);
- }
-}
-
-static void
-signed_add_part(CamelMultipart *multipart, CamelMimePart *part)
-{
- g_warning("Cannot add parts to a signed part using add_part");
-}
-
-static void
-signed_add_part_at(CamelMultipart *multipart, CamelMimePart *part, guint index)
-{
- g_warning("Cannot add parts to a signed part using add_part_at");
-}
-
-static void
-signed_remove_part(CamelMultipart *multipart, CamelMimePart *part)
-{
- g_warning("Cannot remove parts from a signed part using remove_part");
-}
-
-static CamelMimePart *
-signed_remove_part_at (CamelMultipart *multipart, guint index)
-{
- g_warning("Cannot remove parts from a signed part using remove_part");
- return NULL;
-}
-
-static CamelMimePart *
-signed_get_part(CamelMultipart *multipart, guint index)
-{
- CamelMultipartSigned *mps = (CamelMultipartSigned *)multipart;
- CamelDataWrapper *dw = (CamelDataWrapper *)multipart;
- CamelStream *stream;
-
- switch (index) {
- case CAMEL_MULTIPART_SIGNED_CONTENT:
- if (mps->content)
- return mps->content;
- if (mps->contentraw) {
- stream = mps->contentraw;
- camel_object_ref((CamelObject *)stream);
- } else if (mps->start1 == -1
- && parse_content(mps) == -1
- && (stream = ((CamelDataWrapper *)mps)->stream) == NULL) {
- g_warning("Trying to get content on an invalid multipart/signed");
- return NULL;
- } else if (dw->stream == NULL) {
- return NULL;
- } else if (mps->start1 == -1) {
- stream = dw->stream;
- camel_object_ref(stream);
- } else {
- stream = camel_seekable_substream_new((CamelSeekableStream *)dw->stream, mps->start1, mps->end1);
- }
- camel_stream_reset(stream);
- mps->content = camel_mime_part_new();
- camel_data_wrapper_construct_from_stream((CamelDataWrapper *)mps->content, stream);
- camel_object_unref(stream);
- return mps->content;
- case CAMEL_MULTIPART_SIGNED_SIGNATURE:
- if (mps->signature)
- return mps->signature;
- if (mps->start1 == -1
- && parse_content(mps) == -1) {
- g_warning("Trying to get signature on invalid multipart/signed");
- return NULL;
- } else if (dw->stream == NULL) {
- return NULL;
- }
- stream = camel_seekable_substream_new((CamelSeekableStream *)dw->stream, mps->start2, mps->end2);
- camel_stream_reset(stream);
- mps->signature = camel_mime_part_new();
- camel_data_wrapper_construct_from_stream((CamelDataWrapper *)mps->signature, stream);
- camel_object_unref((CamelObject *)stream);
- return mps->signature;
- default:
- g_warning("trying to get object out of bounds for multipart");
- }
-
- return NULL;
-}
-
-static guint
-signed_get_number(CamelMultipart *multipart)
-{
- CamelDataWrapper *dw = (CamelDataWrapper *)multipart;
- CamelMultipartSigned *mps = (CamelMultipartSigned *)multipart;
-
- /* check what we have, so we return something reasonable */
-
- if ((mps->content || mps->contentraw) && mps->signature)
- return 2;
-
- if (mps->start1 == -1 && parse_content(mps) == -1) {
- if (dw->stream == NULL)
- return 0;
- else
- return 1;
- } else {
- return 2;
- }
-}
-
-static void
-set_stream(CamelMultipartSigned *mps, CamelStream *mem)
-{
- CamelDataWrapper *dw = (CamelDataWrapper *)mps;
-
- if (dw->stream)
- camel_object_unref((CamelObject *)dw->stream);
- dw->stream = (CamelStream *)mem;
-
- mps->start1 = -1;
- if (mps->content) {
- camel_object_unref((CamelObject *)mps->content);
- mps->content = NULL;
- }
- if (mps->contentraw) {
- camel_object_unref((CamelObject *)mps->contentraw);
- mps->contentraw = NULL;
- }
- if (mps->signature) {
- camel_object_unref((CamelObject *)mps->signature);
- mps->signature = NULL;
- }
-}
-
-static int
-construct_from_stream(CamelDataWrapper *data_wrapper, CamelStream *stream)
-{
- CamelMultipartSigned *mps = (CamelMultipartSigned *)data_wrapper;
- CamelStream *mem = camel_stream_mem_new();
-
- if (camel_stream_write_to_stream(stream, mem) == -1)
- return -1;
-
- set_stream(mps, mem);
-
- return 0;
-}
-
-static int
-signed_construct_from_parser(CamelMultipart *multipart, struct _CamelMimeParser *mp)
-{
- int err;
- CamelContentType *content_type;
- CamelMultipartSigned *mps = (CamelMultipartSigned *)multipart;
- char *buf;
- size_t len;
- CamelStream *mem;
-
- /* we *must not* be in multipart state, otherwise the mime parser will
- parse the headers which is a no no @#$@# stupid multipart/signed spec */
- g_assert(camel_mime_parser_state(mp) == CAMEL_MIME_PARSER_STATE_HEADER);
-
- /* All we do is copy it to a memstream */
- content_type = camel_mime_parser_content_type(mp);
- camel_multipart_set_boundary(multipart, camel_content_type_param(content_type, "boundary"));
-
- mem = camel_stream_mem_new();
- while (camel_mime_parser_step(mp, &buf, &len) != CAMEL_MIME_PARSER_STATE_BODY_END)
- camel_stream_write(mem, buf, len);
-
- set_stream(mps, mem);
-
- err = camel_mime_parser_errno(mp);
- if (err != 0) {
- errno = err;
- return -1;
- } else
- return 0;
-}
-
-static ssize_t
-write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
-{
- CamelMultipartSigned *mps = (CamelMultipartSigned *)data_wrapper;
- CamelMultipart *mp = (CamelMultipart *)mps;
- const char *boundary;
- ssize_t total = 0;
- ssize_t count;
-
- /* we have 3 basic cases:
- 1. constructed, we write out the data wrapper stream we got
- 2. signed content, we create and write out a new stream
- 3. invalid
- */
-
- /* 1 */
- /* FIXME: locking? */
- if (data_wrapper->stream) {
- camel_stream_reset(data_wrapper->stream);
- return camel_stream_write_to_stream(data_wrapper->stream, stream);
- }
-
- /* 3 */
- if (mps->signature == NULL || mps->contentraw == NULL)
- return -1;
-
- /* 2 */
- boundary = camel_multipart_get_boundary(mp);
- if (mp->preface) {
- count = camel_stream_write_string(stream, mp->preface);
- if (count == -1)
- return -1;
- total += count;
- }
-
- /* first boundary */
- count = camel_stream_printf(stream, "\n--%s\n", boundary);
- if (count == -1)
- return -1;
- total += count;
-
- /* output content part */
- camel_stream_reset(mps->contentraw);
- count = camel_stream_write_to_stream(mps->contentraw, stream);
- if (count == -1)
- return -1;
- total += count;
-
- /* boundary */
- count = camel_stream_printf(stream, "\n--%s\n", boundary);
- if (count == -1)
- return -1;
- total += count;
-
- /* signature */
- count = camel_data_wrapper_write_to_stream((CamelDataWrapper *)mps->signature, stream);
- if (count == -1)
- return -1;
- total += count;
-
- /* write the terminating boudary delimiter */
- count = camel_stream_printf(stream, "\n--%s--\n", boundary);
- if (count == -1)
- return -1;
- total += count;
-
- /* and finally the postface */
- if (mp->postface) {
- count = camel_stream_write_string(stream, mp->postface);
- if (count == -1)
- return -1;
- total += count;
- }
-
- return total;
-}
-
-/* See rfc3156, section 2 and others */
-/* We do this simply: Anything not base64 must be qp
- This is so that we can safely translate any occurance of "From "
- into the quoted-printable escaped version safely. */
-static void
-prepare_sign(CamelMimePart *mime_part)
-{
- CamelDataWrapper *wrapper;
- CamelTransferEncoding encoding;
- int parts, i;
-
- wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (mime_part));
- if (!wrapper)
- return;
-
- if (CAMEL_IS_MULTIPART (wrapper)) {
- parts = camel_multipart_get_number((CamelMultipart *)wrapper);
- for (i = 0; i < parts; i++)
- prepare_sign(camel_multipart_get_part((CamelMultipart *)wrapper, i));
- } else if (CAMEL_IS_MIME_MESSAGE (wrapper)) {
- prepare_sign((CamelMimePart *)wrapper);
- } else {
- encoding = camel_mime_part_get_encoding(mime_part);
-
- if (encoding != CAMEL_TRANSFER_ENCODING_BASE64
- && encoding != CAMEL_TRANSFER_ENCODING_QUOTEDPRINTABLE) {
- camel_mime_part_set_encoding(mime_part, CAMEL_TRANSFER_ENCODING_QUOTEDPRINTABLE);
- }
- }
-}
-
-/**
- * camel_multipart_signed_sign:
- * @mps:
- * @context: The CipherContext to use for signing.
- * @content: CamelMimePart content you wish to sign/transport.
- * @userid: The id of the signing key to use.
- * @hash: The algorithm to use.
- * @ex:
- *
- * Sign the part @content, and attach it as the first part
- * (CAMEL_MULTIPART_SIGNED_CONTENT) of the multipart @mps. A
- * signature object will be created and setup as the second part
- * (CAMEL_MULTIPART_SIGNED_SIGNATURE) of the object. Once a part has
- * been successfully signed the mutlipart is ready for transmission.
- *
- * This method should be used to create multipart/signed objects
- * which are properly canoncalised before signing, etc.
- *
- * Return value: -1 on error, setting @ex appropriately. On error
- * neither the content or signature parts will be setup.
- **/
-int
-camel_multipart_signed_sign(CamelMultipartSigned *mps, CamelCipherContext *context, CamelMimePart *content, const char *userid, CamelCipherHash hash, CamelException *ex)
-{
- abort();
-#if 0
- CamelMimeFilter *canon_filter;
- CamelStream *mem;
- CamelStreamFilter *filter;
- CamelContentType *mime_type;
- CamelMimePart *sigpart;
-
- /* this needs to be set */
- g_return_val_if_fail(context->sign_protocol != NULL, -1);
-
- prepare_sign(content);
-
- mem = camel_stream_mem_new();
- filter = camel_stream_filter_new_with_stream(mem);
-
- /* Note: see rfc2015 or rfc3156, section 5 */
- canon_filter = camel_mime_filter_canon_new(CAMEL_MIME_FILTER_CANON_STRIP|CAMEL_MIME_FILTER_CANON_CRLF|CAMEL_MIME_FILTER_CANON_FROM);
- camel_stream_filter_add(filter, (CamelMimeFilter *)canon_filter);
- camel_object_unref((CamelObject *)canon_filter);
-
- camel_data_wrapper_write_to_stream((CamelDataWrapper *)content, (CamelStream *)filter);
- camel_stream_flush((CamelStream *)filter);
- camel_object_unref((CamelObject *)filter);
- camel_stream_reset(mem);
-
-#if 0
- printf("-- Signing:\n");
- fwrite(((CamelStreamMem *)mem)->buffer->data, ((CamelStreamMem *)mem)->buffer->len, 1, stdout);
- printf("-- end\n");
-#endif
-
- sigpart = camel_mime_part_new();
-
- if (camel_cipher_sign(context, userid, hash, mem, sigpart, ex) == -1) {
- camel_object_unref(mem);
- camel_object_unref(sigpart);
- return -1;
- }
-
- /* setup our mime type and boundary */
- mime_type = camel_content_type_new("multipart", "signed");
- camel_content_type_set_param(mime_type, "micalg", camel_cipher_hash_to_id(context, hash));
- camel_content_type_set_param(mime_type, "protocol", context->sign_protocol);
- camel_data_wrapper_set_mime_type_field(CAMEL_DATA_WRAPPER (mps), mime_type);
- camel_content_type_unref(mime_type);
- camel_multipart_set_boundary((CamelMultipart *)mps, NULL);
-
- /* just keep the whole raw content. We dont *really* need to do this because
- we know how we just proccessed it, but, well, better to be safe than sorry */
- mps->signature = sigpart;
- mps->contentraw = mem;
- camel_stream_reset(mem);
-
- /* clear the data-wrapper stream - tells write_to_stream to use the right object */
- if (((CamelDataWrapper *)mps)->stream) {
- camel_object_unref((CamelObject *) ((CamelDataWrapper *)mps)->stream);
- ((CamelDataWrapper *)mps)->stream = NULL;
- }
-#endif
- return 0;
-}
-
-CamelStream *
-camel_multipart_signed_get_content_stream(CamelMultipartSigned *mps, CamelException *ex)
-{
- CamelStream *constream;
-
- /* we need to be able to verify stuff we just signed as well as stuff we loaded from a stream/parser */
-
- if (mps->contentraw) {
- constream = mps->contentraw;
- camel_object_ref((CamelObject *)constream);
- } else {
- CamelStream *sub;
- CamelMimeFilter *canon_filter;
-
- if (mps->start1 == -1 && parse_content(mps) == -1) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, _("parse error"));
- return NULL;
- }
-
- /* first, prepare our parts */
- sub = camel_seekable_substream_new((CamelSeekableStream *)((CamelDataWrapper *)mps)->stream, mps->start1, mps->end1);
- constream = (CamelStream *)camel_stream_filter_new_with_stream(sub);
- camel_object_unref((CamelObject *)sub);
-
- /* Note: see rfc2015 or rfc3156, section 5 */
- canon_filter = camel_mime_filter_canon_new (CAMEL_MIME_FILTER_CANON_CRLF);
- camel_stream_filter_add((CamelStreamFilter *)constream, (CamelMimeFilter *)canon_filter);
- camel_object_unref((CamelObject *)canon_filter);
- }
-
- return constream;
-}
-
-/**
- * camel_multipart_signed_verify:
- * @mps:
- * @context:
- * @ex:
- *
- * Verify a signed object. This may be used to verify newly signed
- * objects as well as those created from external streams or parsers.
- *
- * Return value: A validity value, or NULL on error, setting @ex
- * appropriately.
- **/
-CamelCipherValidity *
-camel_multipart_signed_verify(CamelMultipartSigned *mps, CamelCipherContext *context, CamelException *ex)
-{
- abort();
-
- return NULL;
-#if 0
- CamelCipherValidity *valid;
- CamelMimePart *sigpart;
- CamelStream *constream;
-
- /* we need to be able to verify stuff we just signed as well as stuff we loaded from a stream/parser */
-
- if (mps->contentraw) {
- constream = mps->contentraw;
- camel_object_ref((CamelObject *)constream);
- } else {
- CamelStream *sub;
- CamelMimeFilter *canon_filter;
-
- if (mps->start1 == -1 && parse_content(mps) == -1) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, _("parse error"));
- return NULL;
- }
-
- /* first, prepare our parts */
- sub = camel_seekable_substream_new((CamelSeekableStream *)((CamelDataWrapper *)mps)->stream, mps->start1, mps->end1);
- constream = (CamelStream *)camel_stream_filter_new_with_stream(sub);
- camel_object_unref((CamelObject *)sub);
-
- /* Note: see rfc2015 or rfc3156, section 5 */
- canon_filter = camel_mime_filter_canon_new (CAMEL_MIME_FILTER_CANON_CRLF);
- camel_stream_filter_add((CamelStreamFilter *)constream, (CamelMimeFilter *)canon_filter);
- camel_object_unref((CamelObject *)canon_filter);
- }
-
- /* we do this as a normal mime part so we can have it handle transfer encoding etc */
- sigpart = camel_multipart_get_part((CamelMultipart *)mps, CAMEL_MULTIPART_SIGNED_SIGNATURE);
-
- /* do the magic, the caller must supply the right context for this kind of object */
- valid = camel_cipher_verify(context, camel_cipher_id_to_hash(context, mps->micalg), constream, sigpart, ex);
-
-#if 0
- {
- CamelStream *sout = camel_stream_fs_new_with_fd(dup(0));
-
- camel_stream_printf(sout, "-- Verifying:\n");
- camel_stream_reset(constream);
- camel_stream_write_to_stream(constream, sout);
- camel_stream_printf(sout, "-- end\n");
- camel_object_unref((CamelObject *)sout);
- }
-#endif
-
- camel_object_unref(constream);
-
- return valid;
-#endif
-}
-
-
diff --git a/camel/camel-multipart-signed.h b/camel/camel-multipart-signed.h
deleted file mode 100644
index 2b0df64189..0000000000
--- a/camel/camel-multipart-signed.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- * camel-signed--multipart.h : class for a signed-multipart
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * Copyright 2002 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-/* Should this be a subclass of multipart?
- No, because we dont have different parts?
- I'm not really sure yet ... ? */
-
-#ifndef CAMEL_MULTIPART_SIGNED_H
-#define CAMEL_MULTIPART_SIGNED_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include <camel/camel-multipart.h>
-#include <camel/camel-cipher-context.h>
-
-#define CAMEL_MULTIPART_SIGNED_TYPE (camel_multipart_signed_get_type ())
-#define CAMEL_MULTIPART_SIGNED(obj) (CAMEL_CHECK_CAST((obj), CAMEL_MULTIPART_SIGNED_TYPE, CamelMultipartSigned))
-#define CAMEL_MULTIPART_SIGNED_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_MULTIPART_SIGNED_TYPE, CamelMultipartSignedClass))
-#define CAMEL_IS_MULTIPART_SIGNED(o) (CAMEL_CHECK_TYPE((o), CAMEL_MULTIPART_SIGNED_TYPE))
-
-/*
-enum {
- CAMEL_MULTIPART_EMPTY,
- CAMEL_MULTIPART_CONST,
- CAMEL_MULTIPART_SIGN,
- CAMEL_MULTIPART_ENCR,
-};
-*/
-
-/* 'handy' enums for getting the internal parts of the multipart */
-enum {
- CAMEL_MULTIPART_SIGNED_CONTENT,
- CAMEL_MULTIPART_SIGNED_SIGNATURE,
-};
-
-typedef struct _CamelMultipartSigned CamelMultipartSigned;
-
-struct _CamelMultipartSigned
-{
- CamelMultipart parent_object;
-
- /* these are the client visible parts, decoded forms of our data wrapper content */
- CamelMimePart *content;
- CamelMimePart *signature;
-
- /* the raw content which must go over the wire, if we have generated it */
- /* perhaps this should jsut set data_wrapper->stream and update start1/end1 accordingly, as it is done
- for other parts, or visa versa? */
- CamelStream *contentraw;
-
- /*int state;*/
-
- /* just cache some info we use */
- char *protocol;
- char *micalg;
-
- /* offset pointers of start of boundary in content object */
- off_t start1, end1;
- off_t start2, end2;
-};
-
-typedef struct {
- CamelMultipartClass parent_class;
-} CamelMultipartSignedClass;
-
-/* Standard Camel function */
-CamelType camel_multipart_signed_get_type (void);
-
-/* public methods */
-CamelMultipartSigned *camel_multipart_signed_new (void);
-
-CamelStream *camel_multipart_signed_get_content_stream(CamelMultipartSigned *mps, CamelException *ex);
-
-int camel_multipart_signed_sign (CamelMultipartSigned *mps, CamelCipherContext *context,
- CamelMimePart *content, const char *uiserid,
- CamelCipherHash hash, CamelException *ex);
-CamelCipherValidity *camel_multipart_signed_verify (CamelMultipartSigned *mps, CamelCipherContext *context,
- CamelException *ex);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_MULTIPART_SIGNED_H */
-
-
diff --git a/camel/camel-multipart.c b/camel/camel-multipart.c
deleted file mode 100644
index 3ec60147d5..0000000000
--- a/camel/camel-multipart.c
+++ /dev/null
@@ -1,589 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-multipart.c : Abstract class for a multipart */
-
-
-/*
- *
- * Author :
- * Bertrand Guiheneuf <bertrand@helixcode.com>
- *
- * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h> /* strlen() */
-#include <unistd.h> /* for getpid */
-#include <time.h> /* for time */
-#include <errno.h>
-
-#include "camel-stream-mem.h"
-#include "camel-multipart.h"
-#include "camel-mime-part.h"
-#include "camel-exception.h"
-#include "md5-utils.h"
-
-#define d(x)
-
-static gboolean is_offline (CamelDataWrapper *data_wrapper);
-static void add_part (CamelMultipart *multipart,
- CamelMimePart *part);
-static void add_part_at (CamelMultipart *multipart,
- CamelMimePart *part,
- guint index);
-static void remove_part (CamelMultipart *multipart,
- CamelMimePart *part);
-static CamelMimePart * remove_part_at (CamelMultipart *multipart,
- guint index);
-static CamelMimePart * get_part (CamelMultipart *multipart,
- guint index);
-static guint get_number (CamelMultipart *multipart);
-static void set_boundary (CamelMultipart *multipart,
- const char *boundary);
-static const gchar * get_boundary (CamelMultipart *multipart);
-static ssize_t write_to_stream (CamelDataWrapper *data_wrapper,
- CamelStream *stream);
-static void unref_part (gpointer data, gpointer user_data);
-
-static int construct_from_parser(CamelMultipart *multipart, struct _CamelMimeParser *mp);
-
-static CamelDataWrapperClass *parent_class = NULL;
-
-
-
-/* Returns the class for a CamelMultipart */
-#define CMP_CLASS(so) CAMEL_MULTIPART_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-
-/* Returns the class for a CamelDataWrapper */
-#define CDW_CLASS(so) CAMEL_DATA_WRAPPER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-
-
-static void
-camel_multipart_class_init (CamelMultipartClass *camel_multipart_class)
-{
- CamelDataWrapperClass *camel_data_wrapper_class =
- CAMEL_DATA_WRAPPER_CLASS (camel_multipart_class);
-
- parent_class = (CamelDataWrapperClass *) camel_data_wrapper_get_type ();
-
- /* virtual method definition */
- camel_multipart_class->add_part = add_part;
- camel_multipart_class->add_part_at = add_part_at;
- camel_multipart_class->remove_part = remove_part;
- camel_multipart_class->remove_part_at = remove_part_at;
- camel_multipart_class->get_part = get_part;
- camel_multipart_class->get_number = get_number;
- camel_multipart_class->set_boundary = set_boundary;
- camel_multipart_class->get_boundary = get_boundary;
- camel_multipart_class->construct_from_parser = construct_from_parser;
-
- /* virtual method overload */
- camel_data_wrapper_class->write_to_stream = write_to_stream;
- camel_data_wrapper_class->decode_to_stream = write_to_stream;
- camel_data_wrapper_class->is_offline = is_offline;
-}
-
-static void
-camel_multipart_init (gpointer object, gpointer klass)
-{
- CamelMultipart *multipart = CAMEL_MULTIPART (object);
-
- camel_data_wrapper_set_mime_type (CAMEL_DATA_WRAPPER (multipart),
- "multipart/mixed");
- multipart->preface = NULL;
- multipart->postface = NULL;
-}
-
-static void
-camel_multipart_finalize (CamelObject *object)
-{
- CamelMultipart *multipart = CAMEL_MULTIPART (object);
-
- g_list_foreach (multipart->parts, unref_part, NULL);
-
- /*if (multipart->boundary)
- g_free (multipart->boundary);*/
- if (multipart->preface)
- g_free (multipart->preface);
- if (multipart->postface)
- g_free (multipart->postface);
-}
-
-
-CamelType
-camel_multipart_get_type (void)
-{
- static CamelType camel_multipart_type = CAMEL_INVALID_TYPE;
-
- if (camel_multipart_type == CAMEL_INVALID_TYPE) {
- camel_multipart_type = camel_type_register (camel_data_wrapper_get_type (), "CamelMultipart",
- sizeof (CamelMultipart),
- sizeof (CamelMultipartClass),
- (CamelObjectClassInitFunc) camel_multipart_class_init,
- NULL,
- (CamelObjectInitFunc) camel_multipart_init,
- (CamelObjectFinalizeFunc) camel_multipart_finalize);
- }
-
- return camel_multipart_type;
-}
-
-static void
-unref_part (gpointer data, gpointer user_data)
-{
- CamelObject *part = data;
-
- camel_object_unref (part);
-}
-
-/**
- * camel_multipart_new:
- *
- * Create a new CamelMultipart object.
- *
- * Return value: a new CamelMultipart
- **/
-CamelMultipart *
-camel_multipart_new (void)
-{
- CamelMultipart *multipart;
-
- multipart = (CamelMultipart *)camel_object_new (CAMEL_MULTIPART_TYPE);
- multipart->preface = NULL;
- multipart->postface = NULL;
-
- return multipart;
-}
-
-
-static void
-add_part (CamelMultipart *multipart, CamelMimePart *part)
-{
- multipart->parts = g_list_append (multipart->parts, part);
- camel_object_ref (part);
-}
-
-/**
- * camel_multipart_add_part:
- * @multipart: a CamelMultipart
- * @part: the part to add
- *
- * Appends the part to the multipart object.
- **/
-void
-camel_multipart_add_part (CamelMultipart *multipart, CamelMimePart *part)
-{
- g_return_if_fail (CAMEL_IS_MULTIPART (multipart));
- g_return_if_fail (CAMEL_IS_MIME_PART (part));
-
- CMP_CLASS (multipart)->add_part (multipart, part);
-}
-
-
-static void
-add_part_at (CamelMultipart *multipart, CamelMimePart *part, guint index)
-{
- multipart->parts = g_list_insert (multipart->parts, part, index);
- camel_object_ref (part);
-}
-
-/**
- * camel_multipart_add_part_at:
- * @multipart: a CamelMultipart
- * @part: the part to add
- * @index: index to add the multipart at
- *
- * Adds the part to the multipart object after the @index'th
- * element. If @index is greater than the number of parts, it is
- * equivalent to camel_multipart_add_part().
- **/
-void
-camel_multipart_add_part_at (CamelMultipart *multipart,
- CamelMimePart *part, guint index)
-{
- g_return_if_fail (CAMEL_IS_MULTIPART (multipart));
- g_return_if_fail (CAMEL_IS_MIME_PART (part));
-
- CMP_CLASS (multipart)->add_part_at (multipart, part, index);
-}
-
-
-static void
-remove_part (CamelMultipart *multipart, CamelMimePart *part)
-{
- if (!multipart->parts)
- return;
- multipart->parts = g_list_remove (multipart->parts, part);
- camel_object_unref (part);
-}
-
-/**
- * camel_multipart_remove_part:
- * @multipart: a CamelMultipart
- * @part: the part to remove
- *
- * Removes @part from @multipart.
- **/
-void
-camel_multipart_remove_part (CamelMultipart *multipart,
- CamelMimePart *part)
-{
- g_return_if_fail (CAMEL_IS_MULTIPART (multipart));
- g_return_if_fail (CAMEL_IS_MIME_PART (part));
-
- CMP_CLASS (multipart)->remove_part (multipart, part);
-}
-
-
-static CamelMimePart *
-remove_part_at (CamelMultipart *multipart, guint index)
-{
- GList *parts_list;
- GList *part_to_remove;
- CamelMimePart *removed_part;
-
- if (!(multipart->parts))
- return NULL;
-
- parts_list = multipart->parts;
- part_to_remove = g_list_nth (parts_list, index);
- if (!part_to_remove) {
- g_warning ("CamelMultipart::remove_part_at: "
- "part to remove is NULL\n");
- return NULL;
- }
- removed_part = CAMEL_MIME_PART (part_to_remove->data);
-
- multipart->parts = g_list_remove_link (parts_list, part_to_remove);
- if (part_to_remove->data)
- camel_object_unref (part_to_remove->data);
- g_list_free_1 (part_to_remove);
-
- return removed_part;
-}
-
-/**
- * camel_multipart_remove_part_at:
- * @multipart: a CamelMultipart
- * @index: a zero-based index indicating the part to remove
- *
- * Remove the indicated part from the multipart object.
- *
- * Return value: the removed part. Note that it is camel_object_unref()ed
- * before being returned, which may cause it to be destroyed.
- **/
-CamelMimePart *
-camel_multipart_remove_part_at (CamelMultipart *multipart, guint index)
-{
- g_return_val_if_fail (CAMEL_IS_MULTIPART (multipart), NULL);
-
- return CMP_CLASS (multipart)->remove_part_at (multipart, index);
-}
-
-
-static CamelMimePart *
-get_part (CamelMultipart *multipart, guint index)
-{
- GList *part;
-
- if (!(multipart->parts))
- return NULL;
-
- part = g_list_nth (multipart->parts, index);
- if (part)
- return CAMEL_MIME_PART (part->data);
- else
- return NULL;
-}
-
-/**
- * camel_multipart_get_part:
- * @multipart: a CamelMultipart
- * @index: a zero-based index indicating the part to get
- *
- * Return value: the indicated subpart, or %NULL
- **/
-CamelMimePart *
-camel_multipart_get_part (CamelMultipart *multipart, guint index)
-{
- g_return_val_if_fail (CAMEL_IS_MULTIPART (multipart), NULL);
-
- return CMP_CLASS (multipart)->get_part (multipart, index);
-}
-
-
-static guint
-get_number (CamelMultipart *multipart)
-{
- return g_list_length (multipart->parts);
-}
-
-/**
- * camel_multipart_get_number:
- * @multipart: a CamelMultipart
- *
- * Return value: the number of subparts in @multipart
- **/
-guint
-camel_multipart_get_number (CamelMultipart *multipart)
-{
- g_return_val_if_fail (CAMEL_IS_MULTIPART (multipart), 0);
-
- return CMP_CLASS (multipart)->get_number (multipart);
-}
-
-
-static void
-set_boundary (CamelMultipart *multipart, const char *boundary)
-{
- CamelDataWrapper *cdw = CAMEL_DATA_WRAPPER (multipart);
- char *bgen, digest[16], bbuf[27], *p;
- int state, save;
-
- g_return_if_fail (cdw->mime_type != NULL);
-
- if (!boundary) {
- /* Generate a fairly random boundary string. */
- bgen = g_strdup_printf ("%p:%lu:%lu", multipart,
- (unsigned long) getpid(),
- (unsigned long) time(0));
- md5_get_digest (bgen, strlen (bgen), digest);
- g_free (bgen);
- strcpy (bbuf, "=-");
- p = bbuf + 2;
- state = save = 0;
- p += camel_base64_encode_step (digest, 16, FALSE, p, &state, &save);
- *p = '\0';
-
- boundary = bbuf;
- }
-
- camel_content_type_set_param (cdw->mime_type, "boundary", boundary);
-}
-
-/**
- * camel_multipart_set_boundary:
- * @multipart: a CamelMultipart
- * @boundary: the message boundary, or %NULL
- *
- * Sets the message boundary for @multipart to @boundary. This should
- * be a string which does not occur anywhere in any of @multipart's
- * subparts. If @boundary is %NULL, a randomly-generated boundary will
- * be used.
- **/
-void
-camel_multipart_set_boundary (CamelMultipart *multipart, const char *boundary)
-{
- g_return_if_fail (CAMEL_IS_MULTIPART (multipart));
-
- CMP_CLASS (multipart)->set_boundary (multipart, boundary);
-}
-
-
-static const gchar *
-get_boundary (CamelMultipart *multipart)
-{
- CamelDataWrapper *cdw = CAMEL_DATA_WRAPPER (multipart);
-
- g_return_val_if_fail (cdw->mime_type != NULL, NULL);
- return camel_content_type_param (cdw->mime_type, "boundary");
-}
-
-/**
- * camel_multipart_get_boundary:
- * @multipart: a CamelMultipart
- *
- * Return value: @multipart's message boundary
- **/
-const gchar *
-camel_multipart_get_boundary (CamelMultipart *multipart)
-{
- return CMP_CLASS (multipart)->get_boundary (multipart);
-}
-
-static gboolean
-is_offline (CamelDataWrapper *data_wrapper)
-{
- CamelMultipart *multipart = CAMEL_MULTIPART (data_wrapper);
- GList *node;
- CamelDataWrapper *part;
-
- if (parent_class->is_offline (data_wrapper))
- return TRUE;
- for (node = multipart->parts; node; node = node->next) {
- part = node->data;
- if (camel_data_wrapper_is_offline (part))
- return TRUE;
- }
-
- return FALSE;
-}
-
-/* this is MIME specific, doesn't belong here really */
-static ssize_t
-write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
-{
- CamelMultipart *multipart = CAMEL_MULTIPART (data_wrapper);
- const gchar *boundary;
- ssize_t total = 0;
- ssize_t count;
- GList *node;
-
- /* get the bundary text */
- boundary = camel_multipart_get_boundary (multipart);
-
- /* we cannot write a multipart without a boundary string */
- g_return_val_if_fail (boundary, -1);
-
- /*
- * write the preface text (usually something like
- * "This is a mime message, if you see this, then
- * your mail client probably doesn't support ...."
- */
- if (multipart->preface) {
- count = camel_stream_write_string (stream, multipart->preface);
- if (count == -1)
- return -1;
- total += count;
- }
-
- /*
- * Now, write all the parts, separated by the boundary
- * delimiter
- */
- node = multipart->parts;
- while (node) {
- count = camel_stream_printf (stream, "\n--%s\n", boundary);
- if (count == -1)
- return -1;
- total += count;
-
- count = camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (node->data), stream);
- if (count == -1)
- return -1;
- total += count;
- node = node->next;
- }
-
- /* write the terminating boudary delimiter */
- count = camel_stream_printf (stream, "\n--%s--\n", boundary);
- if (count == -1)
- return -1;
- total += count;
-
- /* and finally the postface */
- if (multipart->postface) {
- count = camel_stream_write_string (stream, multipart->postface);
- if (count == -1)
- return -1;
- total += count;
- }
-
- return total;
-}
-
-/**
- * camel_multipart_set_preface:
- * @multipart:
- * @preface:
- *
- * Set the preface text for this multipart. Will be written out infront
- * of the multipart. This text should only include US-ASCII strings, and
- * be relatively short, and will be ignored by any MIME mail client.
- **/
-void
-camel_multipart_set_preface(CamelMultipart *multipart, const char *preface)
-{
- if (multipart->preface != preface) {
- g_free(multipart->preface);
- if (preface)
- multipart->preface = g_strdup(preface);
- else
- multipart->preface = NULL;
- }
-}
-
-/**
- * camel_multipart_set_postface:
- * @multipart:
- * @postface:
- *
- * Set the postfix text for this multipart. Will be written out after
- * the last boundary of the multipart, and ignored by any MIME mail
- * client.
- *
- * Generally postface texts should not be sent with multipart messages.
- **/
-void
-camel_multipart_set_postface(CamelMultipart *multipart, const char *postface)
-{
- if (multipart->postface != postface) {
- g_free(multipart->postface);
- if (postface)
- multipart->postface = g_strdup(postface);
- else
- multipart->postface = NULL;
- }
-}
-
-static int
-construct_from_parser(CamelMultipart *multipart, struct _CamelMimeParser *mp)
-{
- int err;
- CamelContentType *content_type;
- CamelMimePart *bodypart;
- char *buf;
- size_t len;
-
- g_assert(camel_mime_parser_state(mp) == CAMEL_MIME_PARSER_STATE_MULTIPART);
-
- /* FIXME: we should use a came-mime-mutlipart, not jsut a camel-multipart, but who cares */
- d(printf("Creating multi-part\n"));
-
- content_type = camel_mime_parser_content_type(mp);
- camel_multipart_set_boundary(multipart,
- camel_content_type_param(content_type, "boundary"));
-
- while (camel_mime_parser_step(mp, &buf, &len) != CAMEL_MIME_PARSER_STATE_MULTIPART_END) {
- camel_mime_parser_unstep(mp);
- bodypart = camel_mime_part_new();
- camel_mime_part_construct_from_parser(bodypart, mp);
- camel_multipart_add_part(multipart, bodypart);
- camel_object_unref((CamelObject *)bodypart);
- }
-
- /* these are only return valid data in the MULTIPART_END state */
- camel_multipart_set_preface(multipart, camel_mime_parser_preface (mp));
- camel_multipart_set_postface(multipart, camel_mime_parser_postface (mp));
-
- err = camel_mime_parser_errno(mp);
- if (err != 0) {
- errno = err;
- return -1;
- } else
- return 0;
-}
-
-int
-camel_multipart_construct_from_parser(CamelMultipart *multipart, struct _CamelMimeParser *mp)
-{
- g_return_val_if_fail(CAMEL_IS_MULTIPART(multipart), -1);
-
- return CMP_CLASS(multipart)->construct_from_parser(multipart, mp);
-}
diff --git a/camel/camel-multipart.h b/camel/camel-multipart.h
deleted file mode 100644
index ac2e37f540..0000000000
--- a/camel/camel-multipart.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-multipart.h : class for a multipart */
-
-/*
- *
- * Author :
- * Bertrand Guiheneuf <bertrand@helixcode.com>
- *
- * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifndef CAMEL_MULTIPART_H
-#define CAMEL_MULTIPART_H 1
-
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include <camel/camel-data-wrapper.h>
-
-#define CAMEL_MULTIPART_TYPE (camel_multipart_get_type ())
-#define CAMEL_MULTIPART(obj) (CAMEL_CHECK_CAST((obj), CAMEL_MULTIPART_TYPE, CamelMultipart))
-#define CAMEL_MULTIPART_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_MULTIPART_TYPE, CamelMultipartClass))
-#define CAMEL_IS_MULTIPART(o) (CAMEL_CHECK_TYPE((o), CAMEL_MULTIPART_TYPE))
-
-struct _CamelMimeParser;
-
-struct _CamelMultipart
-{
- CamelDataWrapper parent_object;
-
- GList *parts;
- gchar *preface;
- gchar *postface;
-};
-
-typedef struct {
- CamelDataWrapperClass parent_class;
-
- /* Virtual methods */
- void (*add_part) (CamelMultipart *multipart, CamelMimePart *part);
- void (*add_part_at) (CamelMultipart *multipart, CamelMimePart *part, guint index);
- void (*remove_part) (CamelMultipart *multipart, CamelMimePart *part);
- CamelMimePart * (*remove_part_at) (CamelMultipart *multipart, guint index);
- CamelMimePart * (*get_part) (CamelMultipart *multipart, guint index);
- guint (*get_number) (CamelMultipart *multipart);
- void (*set_boundary) (CamelMultipart *multipart, const char *boundary);
- const gchar * (*get_boundary) (CamelMultipart *multipart);
-
- int (*construct_from_parser)(CamelMultipart *, struct _CamelMimeParser *);
- /*int (*construct_from_stream)(CamelMultipart *, CamelStream *);*/
-
-} CamelMultipartClass;
-
-/* Standard Camel function */
-CamelType camel_multipart_get_type (void);
-
-
-/* public methods */
-CamelMultipart * camel_multipart_new (void);
-void camel_multipart_add_part (CamelMultipart *multipart,
- CamelMimePart *part);
-void camel_multipart_add_part_at (CamelMultipart *multipart,
- CamelMimePart *part,
- guint index);
-void camel_multipart_remove_part (CamelMultipart *multipart,
- CamelMimePart *part);
-CamelMimePart * camel_multipart_remove_part_at (CamelMultipart *multipart,
- guint index);
-CamelMimePart * camel_multipart_get_part (CamelMultipart *multipart,
- guint index);
-guint camel_multipart_get_number (CamelMultipart *multipart);
-void camel_multipart_set_boundary (CamelMultipart *multipart,
- const char *boundary);
-const gchar * camel_multipart_get_boundary (CamelMultipart *multipart);
-
-void camel_multipart_set_preface (CamelMultipart *multipart, const char *preface);
-void camel_multipart_set_postface (CamelMultipart *multipart, const char *postface);
-
-int camel_multipart_construct_from_parser(CamelMultipart *multipart, struct _CamelMimeParser *mp);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_MULTIPART_H */
-
diff --git a/camel/camel-news-address.c b/camel/camel-news-address.c
deleted file mode 100644
index c8a170781a..0000000000
--- a/camel/camel-news-address.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors:
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include "camel-news-address.h"
-
-
-static void camel_news_address_class_init (CamelNewsAddressClass *klass);
-
-static CamelAddressClass *camel_news_address_parent;
-
-static void
-camel_news_address_class_init (CamelNewsAddressClass *klass)
-{
- camel_news_address_parent = CAMEL_ADDRESS_CLASS (camel_type_get_global_classfuncs (camel_address_get_type ()));
-}
-
-
-CamelType
-camel_news_address_get_type (void)
-{
- static guint type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_address_get_type (), "CamelNewsAddress",
- sizeof (CamelNewsAddress),
- sizeof (CamelNewsAddressClass),
- (CamelObjectClassInitFunc) camel_news_address_class_init,
- NULL,
- NULL,
- NULL);
- }
-
- return type;
-}
-
-/**
- * camel_news_address_new:
- *
- * Create a new CamelNewsAddress object.
- *
- * Return value: A new CamelNewsAddress widget.
- **/
-CamelNewsAddress *
-camel_news_address_new (void)
-{
- CamelNewsAddress *new = CAMEL_NEWS_ADDRESS ( camel_object_new (camel_news_address_get_type ()));
- return new;
-}
diff --git a/camel/camel-news-address.h b/camel/camel-news-address.h
deleted file mode 100644
index ca1505e9a6..0000000000
--- a/camel/camel-news-address.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Michael Zucchi <NotZed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-
-#ifndef _CAMEL_NEWS_ADDRESS_H
-#define _CAMEL_NEWS_ADDRESS_H
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <camel/camel-address.h>
-
-#define CAMEL_NEWS_ADDRESS(obj) CAMEL_CHECK_CAST (obj, camel_news_address_get_type (), CamelNewsAddress)
-#define CAMEL_NEWS_ADDRESS_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_news_address_get_type (), CamelNewsAddressClass)
-#define CAMEL_IS_NEWS_ADDRESS(obj) CAMEL_CHECK_TYPE (obj, camel_news_address_get_type ())
-
-typedef struct _CamelNewsAddressClass CamelNewsAddressClass;
-
-struct _CamelNewsAddress {
- CamelAddress parent;
-
- struct _CamelNewsAddressPrivate *priv;
-};
-
-struct _CamelNewsAddressClass {
- CamelAddressClass parent_class;
-};
-
-CamelType camel_news_address_get_type (void);
-CamelNewsAddress *camel_news_address_new (void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* ! _CAMEL_NEWS_ADDRESS_H */
diff --git a/camel/camel-object.c b/camel/camel-object.c
deleted file mode 100644
index 744e9f7566..0000000000
--- a/camel/camel-object.c
+++ /dev/null
@@ -1,1834 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- *
- *
- * Author:
- * Michael Zucchi <notzed@ximian.com>
- *
- * Copyright 2000-2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <string.h>
-#include <pthread.h>
-#include <semaphore.h>
-
-#include "camel-object.h"
-#include "camel-file-utils.h"
-
-#include <e-util/e-memory.h>
-#include <e-util/e-msgport.h>
-
-#define d(x)
-
-/* I just mashed the keyboard for these... */
-#define CAMEL_OBJECT_MAGIC 0x77A344ED
-#define CAMEL_OBJECT_CLASS_MAGIC 0xEE26A997
-#define CAMEL_OBJECT_FINALISED_MAGIC 0x84AC365F
-#define CAMEL_OBJECT_CLASS_FINALISED_MAGIC 0x7621ABCD
-
-/* ** Quickie type system ************************************************* */
-
-/* A 'locked' hooklist, that is only allocated on demand */
-typedef struct _CamelHookList {
- EMutex *lock;
-
- unsigned int depth:30; /* recursive event depth */
- unsigned int flags:2; /* flags, see below */
-
- unsigned int list_length;
- struct _CamelHookPair *list;
-} CamelHookList;
-
-#define CAMEL_HOOK_PAIR_REMOVED (1<<0)
-
-/* a 'hook pair', actually a hook tuple, we just store all hooked events in the same list,
- and just comapre as we go, rather than storing separate lists for each hook type
-
- the name field just points directly to the key field in the class's preplist hashtable.
- This way we can just use a direct pointer compare when scanning it, and also saves
- copying the string */
-typedef struct _CamelHookPair
-{
- struct _CamelHookPair *next; /* next MUST be the first member */
-
- unsigned int id:30;
- unsigned int flags:2; /* removed, etc */
-
- const char *name; /* points to the key field in the classes preplist, static memory */
- union {
- CamelObjectEventHookFunc event;
- CamelObjectEventPrepFunc prep;
- char *filename;
- } func;
- void *data;
-} CamelHookPair;
-
-struct _CamelObjectBag {
- GHashTable *object_table; /* object by key */
- GHashTable *key_table; /* key by object */
- CamelCopyFunc copy_key;
- GFreeFunc free_key;
- pthread_t owner; /* the thread that has reserved the bag for a new entry */
- sem_t reserve_sem; /* used to track ownership */
-};
-
-/* used to tag a bag hookpair */
-static const char *bag_name = "object:bag";
-
-/* meta-data stuff */
-static void co_metadata_free(CamelObject *obj, CamelObjectMeta *meta);
-static CamelObjectMeta *co_metadata_get(CamelObject *obj);
-static CamelHookPair *co_metadata_pair(CamelObject *obj, int create);
-
-static const char *meta_name = "object:meta";
-#define CAMEL_OBJECT_STATE_FILE_MAGIC "CLMD"
-
-/* ********************************************************************** */
-
-static CamelHookList *camel_object_get_hooks(CamelObject *o);
-static void camel_object_free_hooks(CamelObject *o);
-static void camel_object_bag_remove_unlocked(CamelObjectBag *inbag, CamelObject *o, CamelHookList *hooks);
-
-#define camel_object_unget_hooks(o) (e_mutex_unlock((CAMEL_OBJECT(o)->hooks->lock)))
-
-
-/* ********************************************************************** */
-
-static pthread_mutex_t chunks_lock = PTHREAD_MUTEX_INITIALIZER;
-
-static EMemChunk *pair_chunks;
-static EMemChunk *hook_chunks;
-static unsigned int pair_id = 1;
-
-static EMutex *type_lock;
-
-static GHashTable *type_table;
-static EMemChunk *type_chunks;
-
-CamelType camel_object_type;
-
-#define P_LOCK(l) (pthread_mutex_lock(&l))
-#define P_UNLOCK(l) (pthread_mutex_unlock(&l))
-#define E_LOCK(l) (e_mutex_lock(l))
-#define E_UNLOCK(l) (e_mutex_unlock(l))
-#define CLASS_LOCK(k) (g_mutex_lock((((CamelObjectClass *)k)->lock)))
-#define CLASS_UNLOCK(k) (g_mutex_unlock((((CamelObjectClass *)k)->lock)))
-
-
-static struct _CamelHookPair *
-pair_alloc(void)
-{
- CamelHookPair *pair;
-
- P_LOCK(chunks_lock);
- pair = e_memchunk_alloc(pair_chunks);
- pair->id = pair_id++;
- if (pair_id == 0)
- pair_id = 1;
- P_UNLOCK(chunks_lock);
-
- return pair;
-}
-
-static void
-pair_free(CamelHookPair *pair)
-{
- g_assert(pair_chunks != NULL);
-
- P_LOCK(chunks_lock);
- e_memchunk_free(pair_chunks, pair);
- P_UNLOCK(chunks_lock);
-}
-
-static struct _CamelHookList *
-hooks_alloc(void)
-{
- CamelHookList *hooks;
-
- P_LOCK(chunks_lock);
- hooks = e_memchunk_alloc(hook_chunks);
- P_UNLOCK(chunks_lock);
-
- return hooks;
-}
-
-static void
-hooks_free(CamelHookList *hooks)
-{
- g_assert(hook_chunks != NULL);
-
- P_LOCK(chunks_lock);
- e_memchunk_free(hook_chunks, hooks);
- P_UNLOCK(chunks_lock);
-}
-
-/* not checked locked, who cares, only required for people that want to redefine root objects */
-void
-camel_type_init(void)
-{
- static int init = FALSE;
-
- if (init)
- return;
-
- init = TRUE;
- pair_chunks = e_memchunk_new(16, sizeof(CamelHookPair));
- hook_chunks = e_memchunk_new(16, sizeof(CamelHookList));
- type_lock = e_mutex_new(E_MUTEX_REC);
- type_chunks = e_memchunk_new(32, sizeof(CamelType));
- type_table = g_hash_table_new(NULL, NULL);
-}
-
-/* ************************************************************************ */
-
-/* Should this return the object to the caller? */
-static void
-cobject_init (CamelObject *o, CamelObjectClass *klass)
-{
- o->klass = klass;
- o->magic = CAMEL_OBJECT_MAGIC;
- o->ref_count = 1;
- o->flags = 0;
-}
-
-static void
-cobject_finalise(CamelObject *o)
-{
- /*printf("%p: finalise %s\n", o, o->klass->name);*/
-
- g_assert(o->ref_count == 0);
-
- camel_object_free_hooks(o);
-
- o->magic = CAMEL_OBJECT_FINALISED_MAGIC;
- o->klass = NULL;
-}
-
-static int
-cobject_getv(CamelObject *o, CamelException *ex, CamelArgGetV *args)
-{
- int i;
- guint32 tag;
-
- for (i=0;i<args->argc;i++) {
- CamelArgGet *arg = &args->argv[i];
-
- tag = arg->tag;
-
- switch (tag & CAMEL_ARG_TAG) {
- case CAMEL_OBJECT_ARG_DESCRIPTION:
- *arg->ca_str = (char *)o->klass->name;
- break;
- case CAMEL_OBJECT_ARG_METADATA:
- *arg->ca_ptr = co_metadata_get(o);
- break;
- case CAMEL_OBJECT_ARG_STATE_FILE: {
- CamelHookPair *pair = co_metadata_pair(o, FALSE);
-
- if (pair) {
- *arg->ca_str = g_strdup(pair->func.filename);
- camel_object_unget_hooks(o);
- }
- break; }
- }
- }
-
- /* could have flags or stuff here? */
- return 0;
-}
-
-static int
-cobject_setv(CamelObject *o, CamelException *ex, CamelArgV *args)
-{
- int i;
- guint32 tag;
-
- for (i=0;i<args->argc;i++) {
- CamelArg *arg = &args->argv[i];
-
- tag = arg->tag;
-
- switch (tag & CAMEL_ARG_TAG) {
- case CAMEL_OBJECT_ARG_STATE_FILE: {
- CamelHookPair *pair;
-
- /* We store the filename on the meta-data hook-pair */
- pair = co_metadata_pair(o, TRUE);
- g_free(pair->func.filename);
- pair->func.filename = g_strdup(arg->ca_str);
- camel_object_unget_hooks(o);
- break; }
- }
- }
-
- /* could have flags or stuff here? */
- return 0;
-}
-
-static void
-cobject_free(CamelObject *o, guint32 tag, void *value)
-{
- switch(tag & CAMEL_ARG_TAG) {
- case CAMEL_OBJECT_ARG_METADATA:
- co_metadata_free(o, value);
- break;
- case CAMEL_OBJECT_ARG_STATE_FILE:
- g_free(value);
- break;
- case CAMEL_OBJECT_ARG_PERSISTENT_PROPERTIES:
- g_slist_free((GSList *)value);
- break;
- }
-}
-
-static char *
-cobject_meta_get(CamelObject *obj, const char * name)
-{
- CamelHookPair *pair;
- CamelObjectMeta *meta;
- char *res = NULL;
-
- g_return_val_if_fail(CAMEL_IS_OBJECT (obj), 0);
- g_return_val_if_fail(name != NULL, 0);
-
- pair = co_metadata_pair(obj, FALSE);
- if (pair) {
- meta = pair->data;
- while (meta) {
- if (!strcmp(meta->name, name)) {
- res = g_strdup(meta->value);
- break;
- }
- meta = meta->next;
- }
- camel_object_unget_hooks(obj);
- }
-
- return res;
-}
-
-static gboolean
-cobject_meta_set(CamelObject *obj, const char * name, const char *value)
-{
- CamelHookPair *pair;
- int changed = FALSE;
- CamelObjectMeta *meta, *metap;
-
- g_return_val_if_fail(CAMEL_IS_OBJECT (obj), FALSE);
- g_return_val_if_fail(name != NULL, FALSE);
-
- if (obj->hooks == NULL && value == NULL)
- return FALSE;
-
- pair = co_metadata_pair(obj, TRUE);
- meta = pair->data;
- metap = (CamelObjectMeta *)&pair->data;
- while (meta) {
- if (!strcmp(meta->name, name))
- break;
- metap = meta;
- meta = meta->next;
- }
-
- /* TODO: The camelobjectmeta structure is identical to
- CamelTag, they could be merged or share common code */
- if (meta == NULL) {
- if (value == NULL)
- goto done;
- meta = g_malloc(sizeof(*meta) + strlen(name));
- meta->next = pair->data;
- pair->data = meta;
- strcpy(meta->name, name);
- meta->value = g_strdup(value);
- changed = TRUE;
- } else if (value == NULL) {
- metap->next = meta->next;
- g_free(meta->value);
- g_free(meta);
- changed = TRUE;
- } else if (strcmp(meta->value, value) != 0) {
- g_free(meta->value);
- meta->value = g_strdup(value);
- changed = TRUE;
- }
-
-done:
- camel_object_unget_hooks(obj);
-
- return changed;
-}
-
-/* State file for CamelObject data. Any later versions should only append data.
-
- version:uint32
-
- Version 0 of the file:
-
- version:uint32 = 0
- count:uint32 -- count of meta-data items
- ( name:string value:string ) *count -- meta-data items
-
- Version 1 of the file adds:
- count:uint32 -- count of persistent properties
- ( tag:uing32 value:tagtype ) *count -- persistent properties
-
-*/
-
-static int
-cobject_state_read(CamelObject *obj, FILE *fp)
-{
- guint32 i, count, version;
-
- /* NB: for later versions, just check the version is 1 .. known version */
- if (camel_file_util_decode_uint32(fp, &version) == -1
- || version > 1
- || camel_file_util_decode_uint32(fp, &count) == -1)
- return -1;
-
- for (i=0;i<count;i++) {
- char *name = NULL, *value = NULL;
-
- if (camel_file_util_decode_string(fp, &name) == 0
- && camel_file_util_decode_string(fp, &value) == 0) {
- camel_object_meta_set(obj, name, value);
- g_free(name);
- g_free(value);
- } else {
- g_free(name);
- g_free(value);
-
- return -1;
- }
- }
-
- if (version > 0) {
- CamelArgV *argv;
-
- if (camel_file_util_decode_uint32(fp, &count) == -1
- || count == 0) {
- /* maybe it was just version 0 afterall */
- return 0;
- }
-
- /* we batch up the properties and set them in one go */
- argv = g_malloc(sizeof(*argv) + (count - CAMEL_ARGV_MAX) * sizeof(argv->argv[0]));
- argv->argc = 0;
- for (i=0;i<count;i++) {
- if (camel_file_util_decode_uint32(fp, &argv->argv[argv->argc].tag) == -1)
- goto cleanup;
-
- /* so far,only do strings and ints, doubles could be added,
- object's would require a serialisation interface */
-
- switch(argv->argv[argv->argc].tag & CAMEL_ARG_TYPE) {
- case CAMEL_ARG_INT:
- case CAMEL_ARG_BOO:
- if (camel_file_util_decode_uint32(fp, &argv->argv[argv->argc].ca_int) == -1)
- goto cleanup;
- break;
- case CAMEL_ARG_STR:
- if (camel_file_util_decode_string(fp, &argv->argv[argv->argc].ca_str) == -1)
- goto cleanup;
- break;
- default:
- goto cleanup;
- }
-
- argv->argc++;
- }
-
- camel_object_setv(obj, NULL, argv);
- cleanup:
- for (i=0;i<argv->argc;i++) {
- if ((argv->argv[i].tag & CAMEL_ARG_TYPE) == CAMEL_ARG_STR)
- g_free(argv->argv[i].ca_str);
- }
- g_free(argv);
- }
-
- return 0;
-}
-
-/* TODO: should pass exception around */
-static int
-cobject_state_write(CamelObject *obj, FILE *fp)
-{
- gint32 count, i;
- CamelObjectMeta *meta = NULL, *scan;
- int res = -1;
- GSList *props = NULL, *l;
- CamelArgGetV *arggetv = NULL;
- CamelArgV *argv = NULL;
-
- camel_object_get(obj, NULL, CAMEL_OBJECT_METADATA, &meta, NULL);
-
- count = 0;
- scan = meta;
- while (scan) {
- count++;
- scan = scan->next;
- }
-
- /* current version is 1 */
- if (camel_file_util_encode_uint32(fp, 1) == -1
- || camel_file_util_encode_uint32(fp, count) == -1)
- goto abort;
-
- scan = meta;
- while (scan) {
- if (camel_file_util_encode_string(fp, meta->name) == -1
- || camel_file_util_encode_string(fp, meta->value) == -1)
- goto abort;
- scan = scan->next;
- }
-
- camel_object_get(obj, NULL, CAMEL_OBJECT_PERSISTENT_PROPERTIES, &props, NULL);
-
- /* we build an arggetv to query the object atomically,
- we also need an argv to store the results - bit messy */
-
- count = g_slist_length(props);
-
- arggetv = g_malloc0(sizeof(*arggetv) + (count - CAMEL_ARGV_MAX) * sizeof(arggetv->argv[0]));
- argv = g_malloc0(sizeof(*argv) + (count - CAMEL_ARGV_MAX) * sizeof(argv->argv[0]));
- l = props;
- i = 0;
- while (l) {
- CamelProperty *prop = l->data;
-
- argv->argv[i].tag = prop->tag;
- arggetv->argv[i].tag = prop->tag;
- arggetv->argv[i].ca_ptr = &argv->argv[i].ca_ptr;
-
- i++;
- l = l->next;
- }
- arggetv->argc = i;
- argv->argc = i;
-
- camel_object_getv(obj, NULL, arggetv);
-
- if (camel_file_util_encode_uint32(fp, count) == -1)
- goto abort;
-
- for (i=0;i<argv->argc;i++) {
- CamelArg *arg = &argv->argv[i];
-
- if (camel_file_util_encode_uint32(fp, arg->tag) == -1)
- goto abort;
-
- switch (arg->tag & CAMEL_ARG_TYPE) {
- case CAMEL_ARG_INT:
- case CAMEL_ARG_BOO:
- if (camel_file_util_encode_uint32(fp, arg->ca_int) == -1)
- goto abort;
- break;
- case CAMEL_ARG_STR:
- if (camel_file_util_encode_string(fp, arg->ca_str) == -1)
- goto abort;
- break;
- }
- }
-
- res = 0;
-abort:
- for (i=0;i<argv->argc;i++) {
- CamelArg *arg = &argv->argv[i];
-
- if ((argv->argv[i].tag & CAMEL_ARG_TYPE) == CAMEL_ARG_STR)
- camel_object_free(obj, arg->tag, arg->ca_str);
- }
-
- g_free(argv);
- g_free(arggetv);
-
- if (props)
- camel_object_free(obj, CAMEL_OBJECT_PERSISTENT_PROPERTIES, props);
-
- if (meta)
- camel_object_free(obj, CAMEL_OBJECT_METADATA, meta);
-
- return res;
-}
-
-
-static void
-cobject_class_init(CamelObjectClass *klass)
-{
- klass->magic = CAMEL_OBJECT_CLASS_MAGIC;
-
- klass->getv = cobject_getv;
- klass->setv = cobject_setv;
- klass->free = cobject_free;
-
- klass->meta_get = cobject_meta_get;
- klass->meta_set = cobject_meta_set;
- klass->state_read = cobject_state_read;
- klass->state_write = cobject_state_write;
-
- camel_object_class_add_event(klass, "finalize", NULL);
- camel_object_class_add_event(klass, "meta_changed", NULL);
-}
-
-static void
-cobject_class_finalise(CamelObjectClass * klass)
-{
- klass->magic = CAMEL_OBJECT_CLASS_FINALISED_MAGIC;
-
- g_free(klass);
-}
-
-CamelType
-camel_object_get_type (void)
-{
- if (camel_object_type == CAMEL_INVALID_TYPE) {
- camel_type_init();
-
- camel_object_type = camel_type_register(NULL, "CamelObject", /*, 0, 0*/
- sizeof(CamelObject), sizeof(CamelObjectClass),
- cobject_class_init, cobject_class_finalise,
- cobject_init, cobject_finalise);
- }
-
- return camel_object_type;
-}
-
-static void
-camel_type_class_init(CamelObjectClass *klass, CamelObjectClass *type)
-{
- if (type->parent)
- camel_type_class_init(klass, type->parent);
-
- if (type->klass_init)
- type->klass_init(klass);
-}
-
-CamelType
-camel_type_register (CamelType parent, const char * name,
- /*unsigned int ver, unsigned int rev,*/
- size_t object_size, size_t klass_size,
- CamelObjectClassInitFunc class_init,
- CamelObjectClassFinalizeFunc class_finalise,
- CamelObjectInitFunc object_init,
- CamelObjectFinalizeFunc object_finalise)
-{
- CamelObjectClass *klass;
- /*int offset;
- size_t size;*/
-
- if (parent != NULL && parent->magic != CAMEL_OBJECT_CLASS_MAGIC) {
- g_warning("camel_type_register: invalid junk parent class for '%s'", name);
- return NULL;
- }
-
- E_LOCK(type_lock);
-
- /* Have to check creation, it might've happened in another thread before we got here */
- klass = g_hash_table_lookup(type_table, name);
- if (klass != NULL) {
- if (klass->klass_size != klass_size || klass->object_size != object_size
- || klass->klass_init != class_init || klass->klass_finalise != class_finalise
- || klass->init != object_init || klass->finalise != object_finalise) {
- g_warning("camel_type_register: Trying to re-register class '%s'", name);
- klass = NULL;
- }
- E_UNLOCK(type_lock);
- return klass;
- }
-
- /* this is for objects with no parent as part of their struct ('interfaces'?) */
- /*offset = parent?parent->klass_size:0;
- offset = (offset + 3) & (~3);
-
- size = offset + klass_size;
-
- klass = g_malloc0(size);
-
- klass->klass_size = size;
- klass->klass_data = offset;
-
- offset = parent?parent->object_size:0;
- offset = (offset + 3) & (~3);
-
- klass->object_size = offset + object_size;
- klass->object_data = offset;*/
-
- if (parent
- && klass_size < parent->klass_size) {
- g_warning("camel_type_register: '%s' has smaller class size than parent '%s'", name, parent->name);
- E_UNLOCK(type_lock);
- return NULL;
- }
-
- klass = g_malloc0(klass_size);
- klass->klass_size = klass_size;
- klass->object_size = object_size;
- klass->lock = g_mutex_new();
- klass->instance_chunks = e_memchunk_new(8, object_size);
-
- klass->parent = parent;
- if (parent) {
- klass->next = parent->child;
- parent->child = klass;
- }
- klass->name = name;
-
- /*klass->version = ver;
- klass->revision = rev;*/
-
- klass->klass_init = class_init;
- klass->klass_finalise = class_finalise;
-
- klass->init = object_init;
- klass->finalise = object_finalise;
-
- /* setup before class init, incase class init func uses the type or looks it up ? */
- g_hash_table_insert(type_table, (void *)name, klass);
-
- camel_type_class_init(klass, klass);
-
- E_UNLOCK(type_lock);
-
- return klass;
-}
-
-static void
-camel_object_init(CamelObject *o, CamelObjectClass *klass, CamelType type)
-{
- if (type->parent)
- camel_object_init(o, klass, type->parent);
-
- if (type->init)
- type->init(o, klass);
-}
-
-CamelObject *
-camel_object_new(CamelType type)
-{
- CamelObject *o;
-
- if (type == NULL)
- return NULL;
-
- if (type->magic != CAMEL_OBJECT_CLASS_MAGIC)
- return NULL;
-
- CLASS_LOCK(type);
-
- o = e_memchunk_alloc0(type->instance_chunks);
-
-#ifdef CAMEL_OBJECT_TRACK_INSTANCES
- if (type->instances)
- type->instances->prev = o;
- o->next = type->instances;
- o->prev = NULL;
- type->instances = o;
-#endif
-
- CLASS_UNLOCK(type);
-
- camel_object_init(o, type, type);
-
- d(printf("%p: new %s()\n", o, o->klass->name));
-
- return o;
-}
-
-void
-camel_object_ref(void *vo)
-{
- register CamelObject *o = vo;
-
- g_return_if_fail(CAMEL_IS_OBJECT(o));
-
- E_LOCK(type_lock);
-
- o->ref_count++;
- d(printf("%p: ref %s(%d)\n", o, o->klass->name, o->ref_count));
-
- E_UNLOCK(type_lock);
-}
-
-void
-camel_object_unref(void *vo)
-{
- register CamelObject *o = vo;
- register CamelObjectClass *klass, *k;
- CamelHookList *hooks = NULL;
-
- g_return_if_fail(CAMEL_IS_OBJECT(o));
-
- klass = o->klass;
-
- if (o->hooks)
- hooks = camel_object_get_hooks(o);
-
- E_LOCK(type_lock);
-
- o->ref_count--;
-
- d(printf("%p: unref %s(%d)\n", o, o->klass->name, o->ref_count));
-
- if (o->ref_count > 0
- || (o->flags & CAMEL_OBJECT_DESTROY)) {
- E_UNLOCK(type_lock);
- if (hooks)
- camel_object_unget_hooks(o);
- return;
- }
-
- o->flags |= CAMEL_OBJECT_DESTROY;
-
- if (hooks)
- camel_object_bag_remove_unlocked(NULL, o, hooks);
-
- E_UNLOCK(type_lock);
-
- if (hooks)
- camel_object_unget_hooks(o);
-
- camel_object_trigger_event(o, "finalize", NULL);
-
- k = klass;
- while (k) {
- if (k->finalise)
- k->finalise(o);
- k = k->parent;
- }
-
- o->magic = CAMEL_OBJECT_FINALISED_MAGIC;
-
- CLASS_LOCK(klass);
-#ifdef CAMEL_OBJECT_TRACK_INSTANCES
- if (o->prev)
- o->prev->next = o->next;
- else
- klass->instances = o->next;
- if (o->next)
- o->next->prev = o->prev;
-#endif
- e_memchunk_free(klass->instance_chunks, o);
- CLASS_UNLOCK(klass);
-}
-
-const char *
-camel_type_to_name (CamelType type)
-{
- if (type == NULL)
- return "(NULL class)";
-
- if (type->magic == CAMEL_OBJECT_CLASS_MAGIC)
- return type->name;
-
- return "(Junk class)";
-}
-
-CamelType camel_name_to_type(const char *name)
-{
- /* TODO: Load a class off disk (!) */
-
- return g_hash_table_lookup(type_table, name);
-}
-
-static char *
-desc_data(CamelObject *o, int ok)
-{
- char *what;
-
- if (o == NULL)
- what = g_strdup("NULL OBJECT");
- else if (o->magic == ok)
- what = NULL;
- else if (o->magic == CAMEL_OBJECT_MAGIC)
- what = g_strdup_printf("CLASS '%s'", ((CamelObjectClass *)o)->name);
- else if (o->magic == CAMEL_OBJECT_CLASS_MAGIC)
- what = g_strdup_printf("CLASS '%s'", ((CamelObjectClass *)o)->name);
- else if (o->magic == CAMEL_OBJECT_FINALISED_MAGIC)
- what = g_strdup_printf("finalised OBJECT");
- else if (o->magic == CAMEL_OBJECT_CLASS_FINALISED_MAGIC)
- what = g_strdup_printf("finalised CLASS");
- else
- what = g_strdup_printf("junk data");
-
- return what;
-}
-
-static gboolean
-check_magic(void *o, CamelType ctype, int isob)
-{
- char *what, *to;
-
- what = desc_data(o, isob?CAMEL_OBJECT_MAGIC:CAMEL_OBJECT_CLASS_MAGIC);
- to = desc_data((CamelObject *)ctype, CAMEL_OBJECT_CLASS_MAGIC);
-
- if (what || to) {
- if (what == NULL) {
- if (isob)
- what = g_strdup_printf("OBJECT '%s'", ((CamelObject *)o)->klass->name);
- else
- what = g_strdup_printf("OBJECT '%s'", ((CamelObjectClass *)o)->name);
- }
- if (to == NULL)
- to = g_strdup_printf("OBJECT '%s'", ctype->name);
- g_warning("Trying to check %s is %s", what, to);
- g_free(what);
- g_free(to);
-
- return FALSE;
- }
-
- return TRUE;
-}
-
-gboolean
-camel_object_is (CamelObject *o, CamelType ctype)
-{
- CamelObjectClass *k;
-
- g_return_val_if_fail(check_magic(o, ctype, TRUE), FALSE);
-
- k = o->klass;
- while (k) {
- if (k == ctype)
- return TRUE;
- k = k->parent;
- }
-
- return FALSE;
-}
-
-gboolean
-camel_object_class_is (CamelObjectClass *k, CamelType ctype)
-{
- g_return_val_if_fail(check_magic(k, ctype, FALSE), FALSE);
-
- while (k) {
- if (k == ctype)
- return TRUE;
- k = k->parent;
- }
-
- return FALSE;
-}
-
-CamelObject *
-camel_object_cast(CamelObject *o, CamelType ctype)
-{
- CamelObjectClass *k;
-
- g_return_val_if_fail(check_magic(o, ctype, TRUE), NULL);
-
- k = o->klass;
- while (k) {
- if (k == ctype)
- return o;
- k = k->parent;
- }
-
- g_warning("Object %p (class '%s') doesn't have '%s' in its hierarchy", o, o->klass->name, ctype->name);
-
- return NULL;
-}
-
-CamelObjectClass *
-camel_object_class_cast(CamelObjectClass *k, CamelType ctype)
-{
- CamelObjectClass *r = k;
-
- g_return_val_if_fail(check_magic(k, ctype, FALSE), NULL);
-
- while (k) {
- if (k == ctype)
- return r;
- k = k->parent;
- }
-
- g_warning("Class '%s' doesn't have '%s' in its hierarchy", r->name, ctype->name);
-
- return NULL;
-}
-
-void
-camel_object_class_add_event(CamelObjectClass *klass, const char *name, CamelObjectEventPrepFunc prep)
-{
- CamelHookPair *pair;
-
- g_return_if_fail (name);
-
- pair = klass->hooks;
- while (pair) {
- if (strcmp(pair->name, name) == 0) {
- g_warning("camel_object_class_add_event: `%s' is already declared for '%s'\n",
- name, klass->name);
- return;
- }
- pair = pair->next;
- }
-
- pair = pair_alloc();
- pair->name = name;
- pair->func.prep = prep;
- pair->flags = 0;
-
- pair->next = klass->hooks;
- klass->hooks = pair;
-}
-
-/* free hook data */
-static void
-camel_object_free_hooks (CamelObject *o)
-{
- CamelHookPair *pair, *next;
-
- if (o->hooks) {
- g_assert(o->hooks->depth == 0);
- g_assert((o->hooks->flags & CAMEL_HOOK_PAIR_REMOVED) == 0);
-
- pair = o->hooks->list;
- while (pair) {
- next = pair->next;
-
- if (pair->name == meta_name) {
- co_metadata_free(o, pair->data);
- g_free(pair->func.filename);
- }
-
- pair_free(pair);
- pair = next;
- }
- e_mutex_destroy(o->hooks->lock);
- hooks_free(o->hooks);
- o->hooks = NULL;
- }
-}
-
-/* return (allocate if required) the object's hook list, locking at the same time */
-static CamelHookList *
-camel_object_get_hooks (CamelObject *o)
-{
- static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
- CamelHookList *hooks;
-
- /* if we have it, we dont have to do any other locking,
- otherwise use a global lock to setup the object's hook data */
- if (o->hooks == NULL) {
- pthread_mutex_lock(&lock);
- if (o->hooks == NULL) {
- hooks = hooks_alloc();
- hooks->lock = e_mutex_new(E_MUTEX_REC);
- hooks->flags = 0;
- hooks->depth = 0;
- hooks->list_length = 0;
- hooks->list = NULL;
- o->hooks = hooks;
- }
- pthread_mutex_unlock(&lock);
- }
-
- e_mutex_lock(o->hooks->lock);
-
- return o->hooks;
-}
-
-unsigned int
-camel_object_hook_event(void *vo, const char * name, CamelObjectEventHookFunc func, void *data)
-{
- CamelObject *obj = vo;
- CamelHookPair *pair, *hook;
- CamelHookList *hooks;
- int id;
-
- g_return_val_if_fail(CAMEL_IS_OBJECT (obj), 0);
- g_return_val_if_fail(name != NULL, 0);
- g_return_val_if_fail(func != NULL, 0);
-
- hook = obj->klass->hooks;
- while (hook) {
- if (strcmp(hook->name, name) == 0)
- goto setup;
- hook = hook->next;
- }
-
- g_warning("camel_object_hook_event: trying to hook event `%s' in class `%s' with no defined events.",
- name, obj->klass->name);
-
- return 0;
-
-setup:
- /* setup hook pair */
- pair = pair_alloc();
- pair->name = hook->name; /* effectively static! */
- pair->func.event = func;
- pair->data = data;
- pair->flags = 0;
- id = pair->id;
-
- /* get the hook list object, locked, link in new event hook, unlock */
- hooks = camel_object_get_hooks(obj);
- pair->next = hooks->list;
- hooks->list = pair;
- hooks->list_length++;
- camel_object_unget_hooks(obj);
-
- return id;
-}
-
-void
-camel_object_remove_event(void *vo, unsigned int id)
-{
- CamelObject *obj = vo;
- CamelHookList *hooks;
- CamelHookPair *pair, *parent;
-
- g_return_if_fail (CAMEL_IS_OBJECT (obj));
- g_return_if_fail (id != 0);
-
- if (obj->hooks == NULL) {
- g_warning("camel_object_unhook_event: trying to unhook `%d` from an instance of `%s' with no hooks",
- id, obj->klass->name);
- return;
- }
-
- /* scan hooks for this event, remove it, or flag it if we're busy */
- hooks = camel_object_get_hooks(obj);
- parent = (CamelHookPair *)&hooks->list;
- pair = parent->next;
- while (pair) {
- if (pair->id == id
- && (pair->flags & CAMEL_HOOK_PAIR_REMOVED) == 0) {
- if (hooks->depth > 0) {
- pair->flags |= CAMEL_HOOK_PAIR_REMOVED;
- hooks->flags |= CAMEL_HOOK_PAIR_REMOVED;
- } else {
- parent->next = pair->next;
- pair_free(pair);
- hooks->list_length--;
- }
- camel_object_unget_hooks(obj);
- return;
- }
- parent = pair;
- pair = pair->next;
- }
- camel_object_unget_hooks(obj);
-
- g_warning("camel_object_unhook_event: cannot find hook id %d in instance of `%s'",
- id, obj->klass->name);
-}
-
-void
-camel_object_unhook_event(void *vo, const char * name, CamelObjectEventHookFunc func, void *data)
-{
- CamelObject *obj = vo;
- CamelHookList *hooks;
- CamelHookPair *pair, *parent;
-
- g_return_if_fail (CAMEL_IS_OBJECT (obj));
- g_return_if_fail (name != NULL);
- g_return_if_fail (func != NULL);
-
- if (obj->hooks == NULL) {
- g_warning("camel_object_unhook_event: trying to unhook `%s` from an instance of `%s' with no hooks",
- name, obj->klass->name);
- return;
- }
-
- /* scan hooks for this event, remove it, or flag it if we're busy */
- hooks = camel_object_get_hooks(obj);
- parent = (CamelHookPair *)&hooks->list;
- pair = parent->next;
- while (pair) {
- if (pair->func.event == func
- && pair->data == data
- && strcmp(pair->name, name) == 0
- && (pair->flags & CAMEL_HOOK_PAIR_REMOVED) == 0) {
- if (hooks->depth > 0) {
- pair->flags |= CAMEL_HOOK_PAIR_REMOVED;
- hooks->flags |= CAMEL_HOOK_PAIR_REMOVED;
- } else {
- parent->next = pair->next;
- pair_free(pair);
- hooks->list_length--;
- }
- camel_object_unget_hooks(obj);
- return;
- }
- parent = pair;
- pair = pair->next;
- }
- camel_object_unget_hooks(obj);
-
- g_warning("camel_object_unhook_event: cannot find hook/data pair %p/%p in an instance of `%s' attached to `%s'",
- func, data, obj->klass->name, name);
-}
-
-void
-camel_object_trigger_event(void *vo, const char * name, void *event_data)
-{
- CamelObject *obj = vo;
- CamelHookList *hooks;
- CamelHookPair *pair, **pairs, *parent, *hook;
- int i, size;
- const char *prepname;
-
- g_return_if_fail (CAMEL_IS_OBJECT (obj));
- g_return_if_fail (name);
-
- hook = obj->klass->hooks;
- while (hook) {
- if (strcmp(hook->name, name) == 0)
- goto trigger;
- hook = hook->next;
- }
-
- g_warning("camel_object_trigger_event: trying to trigger unknown event `%s' in class `%s'",
- name, obj->klass->name);
-
- return;
-
-trigger:
- /* try prep function, if false, then quit */
- if (hook->func.prep != NULL && !hook->func.prep(obj, event_data))
- return;
-
- /* also, no hooks, dont bother going further */
- if (obj->hooks == NULL)
- return;
-
- /* lock the object for hook emission */
- camel_object_ref(obj);
- hooks = camel_object_get_hooks(obj);
-
- if (hooks->list) {
- /* first, copy the items in the list, and say we're in an event */
- hooks->depth++;
- pair = hooks->list;
- size = 0;
- pairs = alloca(sizeof(pairs[0]) * hooks->list_length);
- prepname = hook->name;
- while (pair) {
- if (pair->name == prepname)
- pairs[size++] = pair;
- pair = pair->next;
- }
-
- /* now execute the events we have, if they haven't been removed during our calls */
- for (i=size-1;i>=0;i--) {
- pair = pairs[i];
- if ((pair->flags & CAMEL_HOOK_PAIR_REMOVED) == 0)
- (pair->func.event) (obj, event_data, pair->data);
- }
- hooks->depth--;
-
- /* and if we're out of any events, then clean up any pending removes */
- if (hooks->depth == 0 && (hooks->flags & CAMEL_HOOK_PAIR_REMOVED)) {
- parent = (CamelHookPair *)&hooks->list;
- pair = parent->next;
- while (pair) {
- if (pair->flags & CAMEL_HOOK_PAIR_REMOVED) {
- parent->next = pair->next;
- pair_free(pair);
- hooks->list_length--;
- } else {
- parent = pair;
- }
- pair = parent->next;
- }
- hooks->flags &= ~CAMEL_HOOK_PAIR_REMOVED;
- }
- }
-
- camel_object_unget_hooks(obj);
- camel_object_unref(obj);
-}
-
-/* get/set arg methods */
-int camel_object_set(void *vo, CamelException *ex, ...)
-{
- CamelArgV args;
- CamelObject *o = vo;
- CamelObjectClass *klass = o->klass;
- int ret = 0;
-
- g_return_val_if_fail(CAMEL_IS_OBJECT(o), -1);
-
- camel_argv_start(&args, ex);
-
- while (camel_argv_build(&args) && ret == 0)
- ret = klass->setv(o, ex, &args);
- if (ret == 0)
- ret = klass->setv(o, ex, &args);
-
- camel_argv_end(&args);
-
- return ret;
-}
-
-int camel_object_setv(void *vo, CamelException *ex, CamelArgV *args)
-{
- g_return_val_if_fail(CAMEL_IS_OBJECT(vo), -1);
-
- return ((CamelObject *)vo)->klass->setv(vo, ex, args);
-}
-
-int camel_object_get(void *vo, CamelException *ex, ...)
-{
- CamelObject *o = vo;
- CamelArgGetV args;
- CamelObjectClass *klass = o->klass;
- int ret = 0;
-
- g_return_val_if_fail(CAMEL_IS_OBJECT(o), -1);
-
- camel_argv_start(&args, ex);
-
- while (camel_arggetv_build(&args) && ret == 0)
- ret = klass->getv(o, ex, &args);
- if (ret == 0)
- ret = klass->getv(o, ex, &args);
-
- camel_argv_end(&args);
-
- return ret;
-}
-
-int camel_object_getv(void *vo, CamelException *ex, CamelArgGetV *args)
-{
- g_return_val_if_fail(CAMEL_IS_OBJECT(vo), -1);
-
- return ((CamelObject *)vo)->klass->getv(vo, ex, args);
-}
-
-/* NB: If this doesn't return NULL, then you must unget_hooks when done */
-static CamelHookPair *
-co_metadata_pair(CamelObject *obj, int create)
-{
- CamelHookPair *pair;
- CamelHookList *hooks;
-
- if (obj->hooks == NULL && !create)
- return NULL;
-
- hooks = camel_object_get_hooks(obj);
- pair = hooks->list;
- while (pair) {
- if (pair->name == meta_name)
- return pair;
-
- pair = pair->next;
- }
-
- if (create) {
- pair = pair_alloc();
- pair->name = meta_name;
- pair->data = NULL;
- pair->flags = 0;
- pair->func.filename = NULL;
- pair->next = hooks->list;
- hooks->list = pair;
- hooks->list_length++;
- } else {
- camel_object_unget_hooks(obj);
- }
-
- return pair;
-}
-
-static CamelObjectMeta *
-co_metadata_get(CamelObject *obj)
-{
- CamelHookPair *pair;
- CamelObjectMeta *meta = NULL, *metaout = NULL, *metalast;
-
- pair = co_metadata_pair(obj, FALSE);
- if (pair) {
- meta = pair->data;
-
- while (meta) {
- CamelObjectMeta *m;
-
- m = g_malloc(sizeof(*metalast) + strlen(meta->name));
- m->next = NULL;
- strcpy(m->name, meta->name);
- m->value = g_strdup(meta->value);
- if (metaout == NULL)
- metalast = metaout = m;
- else {
- metalast->next = m;
- metalast = m;
- }
- meta = meta->next;
- }
-
- camel_object_unget_hooks(obj);
- }
-
- return metaout;
-}
-
-static void
-co_metadata_free(CamelObject *obj, CamelObjectMeta *meta)
-{
- while (meta) {
- CamelObjectMeta *metan = meta->next;
-
- g_free(meta->value);
- g_free(meta);
- meta = metan;
- }
-}
-
-/**
- * camel_object_meta_get:
- * @vo:
- * @name:
- *
- * Get a meta-data on an object.
- *
- * Return value: NULL if the meta-data is not set.
- **/
-char *
-camel_object_meta_get(void *vo, const char * name)
-{
- CamelObject *obj = vo;
-
- g_return_val_if_fail(CAMEL_IS_OBJECT (obj), 0);
- g_return_val_if_fail(name != NULL, 0);
-
- return obj->klass->meta_get(obj, name);
-}
-
-/**
- * camel_object_meta_set:
- * @vo:
- * @name: Name of meta-data. Should be prefixed with class of setter.
- * @value: Value to set. If NULL, then the meta-data is removed.
- *
- * Set a meta-data item on an object. If the object supports persistent
- * data, then the meta-data will be persistent across sessions.
- *
- * If the meta-data changes, is added, or removed, then a
- * "meta_changed" event will be triggered with the name of the changed
- * data.
- *
- * Return Value: TRUE if the setting caused a change to the object's
- * metadata.
- **/
-gboolean
-camel_object_meta_set(void *vo, const char * name, const char *value)
-{
- CamelObject *obj = vo;
-
- g_return_val_if_fail(CAMEL_IS_OBJECT (obj), FALSE);
- g_return_val_if_fail(name != NULL, FALSE);
-
- if (obj->klass->meta_set(obj, name, value)) {
- camel_object_trigger_event(obj, "meta_changed", (void *)name);
- return TRUE;
- }
-
- return FALSE;
-}
-
-/**
- * camel_object_state_read:
- * @vo:
- *
- * Read persistent object state from object_set(CAMEL_OBJECT_STATE_FILE).
- *
- * Return value: -1 on error.
- **/
-int camel_object_state_read(void *vo)
-{
- CamelObject *obj = vo;
- int res = -1;
- char *file;
- FILE *fp;
- char magic[4];
-
- camel_object_get(vo, NULL, CAMEL_OBJECT_STATE_FILE, &file, NULL);
- if (file == NULL)
- return 0;
-
- fp = fopen(file, "r");
- if (fp != NULL) {
- if (fread(magic, 4, 1, fp) == 1
- && memcmp(magic, CAMEL_OBJECT_STATE_FILE_MAGIC, 4) == 0)
- res = obj->klass->state_read(obj, fp);
- else
- res = -1;
- fclose(fp);
- }
-
- camel_object_free(vo, CAMEL_OBJECT_STATE_FILE, file);
-
- return res;
-}
-
-/**
- * camel_object_state_write:
- * @vo:
- *
- * Write persistent state to the file as set by object_set(CAMEL_OBJECT_STATE_FILE).
- *
- * Return value: -1 on error.
- **/
-int camel_object_state_write(void *vo)
-{
- CamelObject *obj = vo;
- int res = -1;
- char *file, *savename;
- FILE *fp;
-
- camel_object_get(vo, NULL, CAMEL_OBJECT_STATE_FILE, &file, NULL);
- if (file == NULL)
- return 0;
-
- savename = camel_file_util_savename(file);
- fp = fopen(savename, "w");
- if (fp != NULL) {
- if (fwrite(CAMEL_OBJECT_STATE_FILE_MAGIC, 4, 1, fp) == 1
- && obj->klass->state_write(obj, fp) == 0) {
- if (fclose(fp) == 0) {
- res = 0;
- rename(savename, file);
- }
- } else {
- fclose(fp);
- }
- }
-
- g_free(savename);
- camel_object_free(vo, CAMEL_OBJECT_STATE_FILE, file);
-
- return res;
-}
-
-/* free an arg object, you can only free objects 1 at a time */
-void camel_object_free(void *vo, guint32 tag, void *value)
-{
- g_return_if_fail(CAMEL_IS_OBJECT(vo));
-
- /* We could also handle freeing of args differently
-
- Add a 'const' bit to the arg type field,
- specifying that the object should not be freed.
-
- And, add free handlers for any pointer objects which are
- not const. The free handlers would be hookpairs off of the
- class.
-
- Then we handle the basic types OBJ,STR here, and pass PTR
- types to their appropriate handler, without having to pass
- through the invocation heirarchy of the free method.
-
- This would also let us copy and do other things with args
- we can't do, but i can't see a use for that yet ... */
-
- ((CamelObject *)vo)->klass->free(vo, tag, value);
-}
-
-static void
-object_class_dump_tree_rec(CamelType root, int depth)
-{
- char *p;
-#ifdef CAMEL_OBJECT_TRACK_INSTANCES
- struct _CamelObject *o;
-#endif
-
- p = alloca(depth*2+1);
- memset(p, ' ', depth*2);
- p[depth*2] = 0;
-
- while (root) {
- CLASS_LOCK(root);
- printf("%sClass: %s\n", p, root->name);
- /*printf("%sVersion: %u.%u\n", p, root->version, root->revision);*/
- if (root->hooks) {
- CamelHookPair *pair = root->hooks;
-
- while (pair) {
- printf("%s event '%s' prep %p\n", p, pair->name, pair->func.prep);
- pair = pair->next;
- }
- }
-#ifdef CAMEL_OBJECT_TRACK_INSTANCES
- o = root->instances;
- while (o) {
- printf("%s instance %p [%d]\n", p, o, o->ref_count);
- /* todo: should lock hooks while it scans them */
- if (o->hooks) {
- CamelHookPair *pair = o->hooks->list;
-
- while (pair) {
- printf("%s hook '%s' func %p data %p\n", p, pair->name, pair->func.event, pair->data);
- pair = pair->next;
- }
- }
- o = o->next;
- }
-#endif
- CLASS_UNLOCK(root);
-
- if (root->child)
- object_class_dump_tree_rec(root->child, depth+1);
-
- root = root->next;
- }
-}
-
-void
-camel_object_class_dump_tree(CamelType root)
-{
- object_class_dump_tree_rec(root, 0);
-}
-
-CamelObjectBag *
-camel_object_bag_new (GHashFunc hash, GEqualFunc equal, CamelCopyFunc keycopy, GFreeFunc keyfree)
-{
- CamelObjectBag *bag;
-
- bag = g_malloc(sizeof(*bag));
- bag->object_table = g_hash_table_new(hash, equal);
- bag->copy_key = keycopy;
- bag->free_key = keyfree;
- bag->key_table = g_hash_table_new(NULL, NULL);
- bag->owner = 0;
-
- /* init the semaphore to 1 owner, this is who has reserved the bag for adding */
- sem_init(&bag->reserve_sem, 0, 1);
-
- return bag;
-}
-
-static void
-save_object(void *key, CamelObject *o, GPtrArray *objects)
-{
- g_ptr_array_add(objects, o);
-}
-
-void
-camel_object_bag_destroy (CamelObjectBag *bag)
-{
- GPtrArray *objects = g_ptr_array_new();
- int i;
-
- sem_getvalue(&bag->reserve_sem, &i);
- g_assert(i == 1);
-
- g_hash_table_foreach(bag->object_table, (GHFunc)save_object, objects);
- for (i=0;i<objects->len;i++)
- camel_object_bag_remove(bag, objects->pdata[i]);
-
- g_ptr_array_free(objects, TRUE);
- g_hash_table_destroy(bag->object_table);
- g_hash_table_destroy(bag->key_table);
- sem_destroy(&bag->reserve_sem);
- g_free(bag);
-}
-
-void
-camel_object_bag_add (CamelObjectBag *bag, const void *key, void *vo)
-{
- CamelObject *o = vo;
- CamelHookList *hooks;
- CamelHookPair *pair;
- void *k;
-
- hooks = camel_object_get_hooks(o);
- E_LOCK(type_lock);
-
- pair = hooks->list;
- while (pair) {
- if (pair->name == bag_name && pair->data == bag) {
- E_UNLOCK(type_lock);
- camel_object_unget_hooks(o);
- return;
- }
- pair = pair->next;
- }
-
- pair = pair_alloc();
- pair->name = bag_name;
- pair->data = bag;
- pair->flags = 0;
-
- pair->next = hooks->list;
- hooks->list = pair;
- hooks->list_length++;
-
- k = bag->copy_key(key);
- g_hash_table_insert(bag->object_table, k, vo);
- g_hash_table_insert(bag->key_table, vo, k);
-
- if (bag->owner == pthread_self()) {
- bag->owner = 0;
- sem_post(&bag->reserve_sem);
- }
-
- E_UNLOCK(type_lock);
- camel_object_unget_hooks(o);
-}
-
-void *
-camel_object_bag_get (CamelObjectBag *bag, const void *key)
-{
- CamelObject *o;
-
- E_LOCK(type_lock);
-
- o = g_hash_table_lookup(bag->object_table, key);
- if (o) {
- /* we use the same lock as the refcount */
- o->ref_count++;
- } else if (bag->owner != pthread_self()) {
- E_UNLOCK(type_lock);
- sem_wait(&bag->reserve_sem);
- E_LOCK(type_lock);
- /* re-check if it slipped in */
- o = g_hash_table_lookup(bag->object_table, key);
- if (o)
- o->ref_count++;
- /* we dont want to reserve the bag */
- sem_post(&bag->reserve_sem);
- }
-
- E_UNLOCK(type_lock);
-
- return o;
-}
-
-/* like get, but also reserve a spot for key if it isn't there */
-/* After calling reserve, you MUST call bag_abort or bag_add */
-/* Also note that currently you can only reserve a single key
- at any one time in a given thread */
-void *
-camel_object_bag_reserve (CamelObjectBag *bag, const void *key)
-{
- CamelObject *o;
-
- E_LOCK(type_lock);
-
- o = g_hash_table_lookup(bag->object_table, key);
- if (o) {
- o->ref_count++;
- } else {
- g_assert(bag->owner != pthread_self());
- E_UNLOCK(type_lock);
- sem_wait(&bag->reserve_sem);
- E_LOCK(type_lock);
- /* incase its slipped in while we were waiting */
- o = g_hash_table_lookup(bag->object_table, key);
- if (o) {
- o->ref_count++;
- /* in which case we dont need to reserve the bag either */
- sem_post(&bag->reserve_sem);
- } else {
- bag->owner = pthread_self();
- }
- }
-
- E_UNLOCK(type_lock);
-
- return o;
-}
-
-/* abort a reserved key */
-void
-camel_object_bag_abort (CamelObjectBag *bag, const void *key)
-{
- g_assert(bag->owner == pthread_self());
-
- bag->owner = 0;
- sem_post(&bag->reserve_sem);
-}
-
-static void
-save_bag(void *key, CamelObject *o, GPtrArray *list)
-{
- /* we have the refcount lock already */
- o->ref_count++;
- g_ptr_array_add(list, o);
-}
-
-/* get a list of all objects in the bag, ref'd
- ignores any reserved keys */
-GPtrArray *
-camel_object_bag_list (CamelObjectBag *bag)
-{
- GPtrArray *list;
-
- list = g_ptr_array_new();
-
- E_LOCK(type_lock);
- g_hash_table_foreach(bag->object_table, (GHFunc)save_bag, list);
- E_UNLOCK(type_lock);
-
- return list;
-}
-
-/* if bag is NULL, remove all bags from object */
-static void
-camel_object_bag_remove_unlocked (CamelObjectBag *inbag, CamelObject *o, CamelHookList *hooks)
-{
- CamelHookPair *pair, *parent;
- void *oldkey;
- CamelObjectBag *bag;
-
- parent = (CamelHookPair *)&hooks->list;
- pair = parent->next;
- while (pair) {
- if (pair->name == bag_name
- && (inbag == NULL || inbag == pair->data)) {
- bag = pair->data;
- /* lookup object in table? */
- oldkey = g_hash_table_lookup(bag->key_table, o);
- if (oldkey) {
- g_hash_table_remove(bag->key_table, o);
- g_hash_table_remove(bag->object_table, oldkey);
- bag->free_key(oldkey);
- }
- parent->next = pair->next;
- pair_free(pair);
- hooks->list_length--;
- } else {
- parent = pair;
- }
- pair = parent->next;
- }
-}
-
-void
-camel_object_bag_remove (CamelObjectBag *inbag, void *vo)
-{
- CamelObject *o = vo;
- CamelHookList *hooks;
-
- if (o->hooks == NULL)
- return;
-
- hooks = camel_object_get_hooks(o);
- E_LOCK(type_lock);
-
- camel_object_bag_remove_unlocked(inbag, o, hooks);
-
- E_UNLOCK(type_lock);
- camel_object_unget_hooks(o);
-}
diff --git a/camel/camel-object.h b/camel/camel-object.h
deleted file mode 100644
index 33ecefbb0a..0000000000
--- a/camel/camel-object.h
+++ /dev/null
@@ -1,290 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-object.h: Base class for Camel */
-
-/*
- * Author:
- * Dan Winship <danw@ximian.com>
- * Michael Zucchi <notzed@ximian.com>
- *
- * Copyright 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifndef CAMEL_OBJECT_H
-#define CAMEL_OBJECT_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <glib.h>
-#include <stdio.h> /* FILE */
-#include <stdlib.h> /* size_t */
-#include <stdarg.h>
-#include <pthread.h>
-
-#include <camel/camel-arg.h>
-#include <camel/camel-types.h> /* this is a @##$@#SF stupid header */
-
-/* this crap shouldn't be here */
-#include <camel/camel-i18n.h>
-
-/* turn on so that camel_object_class_dump_tree() dumps object instances as well */
-#define CAMEL_OBJECT_TRACK_INSTANCES
-
-typedef struct _CamelObjectClass *CamelType;
-
-#ifdef G_DISABLE_CHECKS
-#define CAMEL_CHECK_CAST(obj, ctype, ptype) ((ptype *) obj)
-#define CAMEL_CHECK_CLASS_CAST(klass, ctype, ptype) ((ptype *) klass)
-#else
-#define CAMEL_CHECK_CAST(obj, ctype, ptype) ((ptype *) camel_object_cast ((CamelObject *)(obj), (CamelType)(ctype)))
-#define CAMEL_CHECK_CLASS_CAST(klass, ctype, ptype) ((ptype *) camel_object_class_cast ((CamelObjectClass *)(klass), (CamelType)(ctype) ))
-#endif
-#define CAMEL_CHECK_TYPE(obj, ctype) (camel_object_is ((CamelObject *)(obj), (CamelType)(ctype) ))
-#define CAMEL_CHECK_CLASS_TYPE(klass, ctype) (camel_object_class_is ((CamelObjectClass *)(klass), (CamelType)(ctype)))
-
-extern CamelType camel_object_type;
-
-#define CAMEL_OBJECT_TYPE (camel_object_type)
-
-/* we can't check casts till we've got the type, use the global type variable because its cheaper */
-#define CAMEL_OBJECT(obj) (CAMEL_CHECK_CAST((obj), camel_object_type, CamelObject))
-#define CAMEL_OBJECT_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), camel_object_type, CamelObjectClass))
-#define CAMEL_IS_OBJECT(o) (CAMEL_CHECK_TYPE((o), camel_object_type))
-#define CAMEL_IS_OBJECT_CLASS(k) (CAMEL_CHECK_CLASS_TYPE((k), camel_object_type))
-
-#define CAMEL_OBJECT_GET_CLASS(o) ((CamelObjectClass *)(CAMEL_OBJECT(o))->klass)
-#define CAMEL_OBJECT_GET_TYPE(o) ((CamelType)(CAMEL_OBJECT(o))->klass)
-
-typedef struct _CamelObjectClass CamelObjectClass;
-typedef struct _CamelObject CamelObject;
-typedef unsigned int CamelObjectHookID;
-typedef struct _CamelObjectMeta CamelObjectMeta;
-
-typedef void (*CamelObjectClassInitFunc) (CamelObjectClass *);
-typedef void (*CamelObjectClassFinalizeFunc) (CamelObjectClass *);
-typedef void (*CamelObjectInitFunc) (CamelObject *, CamelObjectClass *);
-typedef void (*CamelObjectFinalizeFunc) (CamelObject *);
-
-typedef gboolean (*CamelObjectEventPrepFunc) (CamelObject *, gpointer);
-typedef void (*CamelObjectEventHookFunc) (CamelObject *, gpointer, gpointer);
-
-#define CAMEL_INVALID_TYPE (NULL)
-
-/* camel object args. */
-enum {
- /* Get a description of the object. */
- CAMEL_OBJECT_ARG_DESCRIPTION = CAMEL_ARG_FIRST, /* Get a copy of the meta-data list (should be freed) */
- CAMEL_OBJECT_ARG_METADATA,
- CAMEL_OBJECT_ARG_STATE_FILE,
- CAMEL_OBJECT_ARG_PERSISTENT_PROPERTIES,
-};
-
-enum {
- CAMEL_OBJECT_DESCRIPTION = CAMEL_OBJECT_ARG_DESCRIPTION | CAMEL_ARG_STR,
- /* Returns a CamelObjectMeta list */
- CAMEL_OBJECT_METADATA = CAMEL_OBJECT_ARG_METADATA | CAMEL_ARG_PTR,
- /* sets where the persistent data should reside, otherwise it isn't persistent */
- CAMEL_OBJECT_STATE_FILE = CAMEL_OBJECT_ARG_STATE_FILE | CAMEL_ARG_STR,
- /* returns a GSList CamelProperties of persistent properties */
- CAMEL_OBJECT_PERSISTENT_PROPERTIES = CAMEL_OBJECT_ARG_PERSISTENT_PROPERTIES | CAMEL_ARG_PTR,
-};
-
-enum _CamelObjectFlags {
- CAMEL_OBJECT_DESTROY = (1<<0),
-};
-
-/* returned by get::CAMEL_OBJECT_METADATA */
-struct _CamelObjectMeta {
- struct _CamelObjectMeta *next;
-
- char *value;
- char name[1]; /* allocated as part of structure */
-};
-
-/* TODO: create a simpleobject which has no events on it, or an interface for events */
-struct _CamelObject {
- struct _CamelObjectClass *klass;
-
- guint32 magic; /* only really needed for debugging ... */
-
- /* current hooks on this object */
- struct _CamelHookList *hooks;
-
- guint32 ref_count:24;
- guint32 flags:8;
-
-#ifdef CAMEL_OBJECT_TRACK_INSTANCES
- struct _CamelObject *next, *prev;
-#endif
-};
-
-struct _CamelObjectClass
-{
- struct _CamelObjectClass *parent;
-
- guint32 magic; /* in same spot for validation */
-
- struct _CamelObjectClass *next, *child; /* maintain heirarchy, just for kicks */
-
- const char *name;
-
- void *lock; /* lock when used in threading, else just pads struct */
-
- /*unsigned short version, revision;*/
-
- /* if the object's bigger than 64K, it could use redesigning */
- unsigned short object_size/*, object_data*/;
- unsigned short klass_size/*, klass_data*/;
-
- /* available hooks for this class */
- struct _CamelHookPair *hooks;
-
- /* memchunks for this type */
- struct _EMemChunk *instance_chunks;
-#ifdef CAMEL_OBJECT_TRACK_INSTANCES
- struct _CamelObject *instances;
-#endif
-
- /* init class */
- void (*klass_init)(struct _CamelObjectClass *);
- void (*klass_finalise)(struct _CamelObjectClass *);
-
- /* init/finalise object */
- void (*init)(struct _CamelObject *, struct _CamelObjectClass *);
- void (*finalise)(struct _CamelObject *);
-
- /* get/set interface */
- int (*setv)(struct _CamelObject *, struct _CamelException *ex, CamelArgV *args);
- int (*getv)(struct _CamelObject *, struct _CamelException *ex, CamelArgGetV *args);
- /* we only free 1 at a time, and only pointer types, obviously */
- void (*free)(struct _CamelObject *, guint32 tag, void *ptr);
-
- /* get/set meta-data interface */
- char *(*meta_get)(struct _CamelObject *, const char * name);
- gboolean (*meta_set)(struct _CamelObject *, const char * name, const char *value);
-
- /* persistence stuff */
- int (*state_read)(struct _CamelObject *, FILE *fp);
- int (*state_write)(struct _CamelObject *, FILE *fp);
-};
-
-/* The type system .... it's pretty simple..... */
-void camel_type_init (void);
-CamelType camel_type_register(CamelType parent, const char * name, /*unsigned int ver, unsigned int rev,*/
- size_t instance_size,
- size_t classfuncs_size,
- CamelObjectClassInitFunc class_init,
- CamelObjectClassFinalizeFunc class_finalize,
- CamelObjectInitFunc instance_init,
- CamelObjectFinalizeFunc instance_finalize);
-
-/* deprecated interface */
-#define camel_type_get_global_classfuncs(x) ((CamelObjectClass *)(x))
-
-/* object class methods (types == classes now) */
-const char *camel_type_to_name (CamelType type);
-CamelType camel_name_to_type (const char *name);
-void camel_object_class_add_event (CamelObjectClass *klass, const char *name, CamelObjectEventPrepFunc prep);
-
-void camel_object_class_dump_tree (CamelType root);
-
-/* casting */
-CamelObject *camel_object_cast(CamelObject *obj, CamelType ctype);
-gboolean camel_object_is(CamelObject *obj, CamelType ctype);
-
-CamelObjectClass *camel_object_class_cast (CamelObjectClass *klass, CamelType ctype);
-gboolean camel_object_class_is (CamelObjectClass *klass, CamelType ctype);
-
-CamelType camel_object_get_type (void);
-
-CamelObject *camel_object_new (CamelType type);
-CamelObject *camel_object_new_name (const char *name);
-
-void camel_object_ref(void *);
-void camel_object_unref(void *);
-
-#ifdef CAMEL_DEBUG
-#define camel_object_ref(o) (printf("%s (%s:%d):ref (%p)\n", __FUNCTION__, __FILE__, __LINE__, o), camel_object_ref(o))
-#define camel_object_unref(o) (printf("%s (%s:%d):unref (%p)\n", __FUNCTION__, __FILE__, __LINE__, o), camel_object_unref (o))
-#endif
-
-/* hooks */
-CamelObjectHookID camel_object_hook_event(void *obj, const char *name, CamelObjectEventHookFunc hook, void *data);
-void camel_object_remove_event(void *obj, CamelObjectHookID id);
-void camel_object_unhook_event(void *obj, const char *name, CamelObjectEventHookFunc hook, void *data);
-void camel_object_trigger_event(void *obj, const char *name, void *event_data);
-
-/* get/set methods */
-int camel_object_set(void *obj, struct _CamelException *ex, ...);
-int camel_object_setv(void *obj, struct _CamelException *ex, CamelArgV *);
-int camel_object_get(void *obj, struct _CamelException *ex, ...);
-int camel_object_getv(void *obj, struct _CamelException *ex, CamelArgGetV *);
-
-/* meta-data for user-specific data */
-char *camel_object_meta_get(void *vo, const char * name);
-gboolean camel_object_meta_set(void *vo, const char * name, const char *value);
-
-/* reads/writes the state from/to the CAMEL_OBJECT_STATE_FILE */
-int camel_object_state_read(void *vo);
-int camel_object_state_write(void *vo);
-
-/* free a bunch of objects, list must be 0 terminated */
-void camel_object_free(void *vo, guint32 tag, void *value);
-
-/* for managing bags of weakly-ref'd 'child' objects */
-typedef struct _CamelObjectBag CamelObjectBag;
-typedef void *(*CamelCopyFunc)(const void *vo);
-
-CamelObjectBag *camel_object_bag_new(GHashFunc hash, GEqualFunc equal, CamelCopyFunc keycopy, GFreeFunc keyfree);
-void *camel_object_bag_get(CamelObjectBag *bag, const void *key);
-void *camel_object_bag_reserve(CamelObjectBag *bag, const void *key);
-void camel_object_bag_add(CamelObjectBag *bag, const void *key, void *o);
-void camel_object_bag_abort(CamelObjectBag *bag, const void *key);
-GPtrArray *camel_object_bag_list(CamelObjectBag *bag);
-void camel_object_bag_remove(CamelObjectBag *bag, void *o);
-void camel_object_bag_destroy(CamelObjectBag *bag);
-
-#define CAMEL_MAKE_CLASS(type, tname, parent, pname) \
-static CamelType type##_type; \
-static pname##Class * type##_parent_class; \
- \
-CamelType \
-type##_get_type(void) \
-{ \
- if (type##_type == 0) { \
- type##_parent_class = (pname##Class *)parent##_get_type(); \
- type##_type = camel_type_register( \
- type##_parent_class, #tname "Class", \
- sizeof(tname), \
- sizeof(tname ## Class), \
- (CamelObjectClassInitFunc) type##_class_init, \
- NULL, \
- (CamelObjectInitFunc) type##_init, \
- (CamelObjectFinalizeFunc) type##_finalise); \
- } \
- \
- return type##_type; \
-}
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_OBJECT_H */
diff --git a/camel/camel-operation.c b/camel/camel-operation.c
deleted file mode 100644
index 03c0c77617..0000000000
--- a/camel/camel-operation.c
+++ /dev/null
@@ -1,687 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Michael Zucchi <NotZed@ximian.com>
- *
- * Copyright 2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <glib.h>
-
-#include <stdio.h>
-#include <sys/time.h>
-#include <unistd.h>
-#include <pthread.h>
-#ifdef HAVE_NSS
-#include <nspr.h>
-#endif
-
-#include "camel-operation.h"
-#include "e-util/e-msgport.h"
-
-#define d(x)
-
-/* ********************************************************************** */
-
-struct _status_stack {
- guint32 flags;
- char *msg;
- int pc; /* last pc reported */
- unsigned int stamp; /* last stamp reported */
-};
-
-struct _CamelOperation {
- struct _CamelOperation *next;
- struct _CamelOperation *prev;
-
- pthread_t id; /* id of running thread */
- guint32 flags; /* cancelled ? */
- int blocked; /* cancellation blocked depth */
- int refcount;
-
- CamelOperationStatusFunc status;
- void *status_data;
- unsigned int status_update;
-
- /* stack of status messages (struct _status_stack *) */
- GSList *status_stack;
- struct _status_stack *lastreport;
-
- EMsgPort *cancel_port;
- int cancel_fd;
-#ifdef HAVE_NSS
- PRFileDesc *cancel_prfd;
-#endif
-};
-
-#define CAMEL_OPERATION_CANCELLED (1<<0)
-#define CAMEL_OPERATION_TRANSIENT (1<<1)
-
-/* Delay before a transient operation has any effect on the status */
-#define CAMEL_OPERATION_TRANSIENT_DELAY (5)
-
-static pthread_mutex_t operation_lock = PTHREAD_MUTEX_INITIALIZER;
-#define LOCK() pthread_mutex_lock(&operation_lock)
-#define UNLOCK() pthread_mutex_unlock(&operation_lock)
-
-
-static unsigned int stamp (void);
-static EDList operation_list = E_DLIST_INITIALISER(operation_list);
-static pthread_key_t operation_key;
-
-typedef struct _CamelOperationMsg {
- EMsg msg;
-} CamelOperationMsg ;
-
-/**
- * camel_operation_init:
- * @void:
- *
- * Init internal variables. Only call this once.
- **/
-void
-camel_operation_init(void)
-{
- pthread_key_create(&operation_key, NULL);
-}
-
-/**
- * camel_operation_new:
- * @status: Callback for receiving status messages. This will always
- * be called with an internal lock held.
- * @status_data: User data.
- *
- * Create a new camel operation handle. Camel operation handles can
- * be used in a multithreaded application (or a single operation
- * handle can be used in a non threaded appliation) to cancel running
- * operations and to obtain notification messages of the internal
- * status of messages.
- *
- * Return value: A new operation handle.
- **/
-CamelOperation *
-camel_operation_new (CamelOperationStatusFunc status, void *status_data)
-{
- CamelOperation *cc;
-
- cc = g_malloc0(sizeof(*cc));
-
- cc->flags = 0;
- cc->blocked = 0;
- cc->refcount = 1;
- cc->status = status;
- cc->status_data = status_data;
- cc->cancel_port = e_msgport_new();
- cc->cancel_fd = -1;
-
- LOCK();
- e_dlist_addtail(&operation_list, (EDListNode *)cc);
- UNLOCK();
-
- return cc;
-}
-
-/**
- * camel_operation_mute:
- * @cc:
- *
- * mutes a camel operation permanently. from this point on you will never
- * receive operation updates, even if more are sent.
- **/
-void
-camel_operation_mute(CamelOperation *cc)
-{
- LOCK();
- cc->status = NULL;
- cc->status_data = NULL;
- UNLOCK();
-}
-
-/**
- * camel_operation_registered:
- *
- * Returns the registered operation, or %NULL if none registered.
- **/
-CamelOperation *
-camel_operation_registered (void)
-{
- CamelOperation *cc = (CamelOperation *)pthread_getspecific(operation_key);
-
- if (cc)
- camel_operation_ref(cc);
-
- return cc;
-}
-
-/**
- * camel_operation_ref:
- * @cc: operation context
- *
- * Add a reference to the CamelOperation @cc.
- **/
-void
-camel_operation_ref (CamelOperation *cc)
-{
- g_assert(cc->refcount > 0);
-
- LOCK();
- cc->refcount++;
- UNLOCK();
-}
-
-/**
- * camel_operation_unref:
- * @cc: operation context
- *
- * Unref and potentially free @cc.
- **/
-void
-camel_operation_unref (CamelOperation *cc)
-{
- GSList *n;
-
- g_assert(cc->refcount > 0);
-
- LOCK();
- if (cc->refcount == 1) {
- CamelOperationMsg *msg;
-
- e_dlist_remove((EDListNode *)cc);
-
- while ((msg = (CamelOperationMsg *)e_msgport_get(cc->cancel_port)))
- g_free(msg);
-
- e_msgport_destroy(cc->cancel_port);
-
- n = cc->status_stack;
- while (n) {
- g_warning("Camel operation status stack non empty: %s", (char *)n->data);
- g_free(n->data);
- n = n->next;
- }
- g_slist_free(cc->status_stack);
-
- g_free(cc);
- } else {
- cc->refcount--;
- }
- UNLOCK();
-}
-
-/**
- * camel_operation_cancel_block:
- * @cc: operation context
- *
- * Block cancellation for this operation. If @cc is NULL, then the
- * current thread is blocked.
- **/
-void
-camel_operation_cancel_block (CamelOperation *cc)
-{
- if (cc == NULL)
- cc = (CamelOperation *)pthread_getspecific(operation_key);
-
- if (cc) {
- LOCK();
- cc->blocked++;
- UNLOCK();
- }
-}
-
-/**
- * camel_operation_cancel_unblock:
- * @cc: operation context
- *
- * Unblock cancellation, when the unblock count reaches the block
- * count, then this operation can be cancelled. If @cc is NULL, then
- * the current thread is unblocked.
- **/
-void
-camel_operation_cancel_unblock (CamelOperation *cc)
-{
- if (cc == NULL)
- cc = (CamelOperation *)pthread_getspecific(operation_key);
-
- if (cc) {
- LOCK();
- cc->blocked--;
- UNLOCK();
- }
-}
-
-/**
- * camel_operation_cancel:
- * @cc: operation context
- *
- * Cancel a given operation. If @cc is NULL then all outstanding
- * operations are cancelled.
- **/
-void
-camel_operation_cancel (CamelOperation *cc)
-{
- CamelOperationMsg *msg;
-
- LOCK();
-
- if (cc == NULL) {
- CamelOperation *cn;
-
- cc = (CamelOperation *)operation_list.head;
- cn = cc->next;
- while (cn) {
- cc->flags |= CAMEL_OPERATION_CANCELLED;
- msg = g_malloc0(sizeof(*msg));
- e_msgport_put(cc->cancel_port, (EMsg *)msg);
- cc = cn;
- cn = cn->next;
- }
- } else if ((cc->flags & CAMEL_OPERATION_CANCELLED) == 0) {
- d(printf("cancelling thread %d\n", cc->id));
-
- cc->flags |= CAMEL_OPERATION_CANCELLED;
- msg = g_malloc0(sizeof(*msg));
- e_msgport_put(cc->cancel_port, (EMsg *)msg);
- }
-
- UNLOCK();
-}
-
-/**
- * camel_operation_register:
- * @cc: operation context
- *
- * Register a thread or the main thread for cancellation through @cc.
- * If @cc is NULL, then a new cancellation is created for this thread.
- *
- * All calls to operation_register() should be matched with calls to
- * operation_unregister(), or resources will be lost.
- *
- * Return Value: Returns @cc, or if NULL, the new operation.
- *
- **/
-CamelOperation *
-camel_operation_register (CamelOperation *cc)
-{
- CamelOperation *oldcc = pthread_getspecific(operation_key);
-
- pthread_setspecific(operation_key, cc);
-
- return oldcc;
-}
-
-/**
- * camel_operation_unregister:
- * @cc: operation context
- *
- * Unregister the current thread.
- **/
-void
-camel_operation_unregister (CamelOperation *cc)
-{
- pthread_setspecific(operation_key, NULL);
-}
-
-/**
- * camel_operation_cancel_check:
- * @cc: operation context
- *
- * Check if cancellation has been applied to @cc. If @cc is NULL,
- * then the CamelOperation registered for the current thread is used.
- *
- * Return value: TRUE if the operation has been cancelled.
- **/
-gboolean
-camel_operation_cancel_check (CamelOperation *cc)
-{
- CamelOperationMsg *msg;
- int cancelled;
-
- d(printf("checking for cancel in thread %d\n", pthread_self()));
-
- if (cc == NULL)
- cc = (CamelOperation *)pthread_getspecific(operation_key);
-
- LOCK();
-
- if (cc == NULL || cc->blocked > 0) {
- d(printf("ahah! cancellation is blocked\n"));
- cancelled = FALSE;
- } else if (cc->flags & CAMEL_OPERATION_CANCELLED) {
- d(printf("previously cancelled\n"));
- cancelled = TRUE;
- } else if ((msg = (CamelOperationMsg *)e_msgport_get(cc->cancel_port))) {
- d(printf("Got cancellation message\n"));
- g_free(msg);
- cc->flags |= CAMEL_OPERATION_CANCELLED;
- cancelled = TRUE;
- } else
- cancelled = FALSE;
-
- UNLOCK();
-
- return cancelled;
-}
-
-/**
- * camel_operation_cancel_fd:
- * @cc: operation context
- *
- * Retrieve a file descriptor that can be waited on (select, or poll)
- * for read, to asynchronously detect cancellation.
- *
- * Return value: The fd, or -1 if cancellation is not available
- * (blocked, or has not been registered for this thread).
- **/
-int
-camel_operation_cancel_fd (CamelOperation *cc)
-{
- if (cc == NULL)
- cc = (CamelOperation *)pthread_getspecific(operation_key);
-
- if (cc == NULL || cc->blocked)
- return -1;
-
- LOCK();
-
- if (cc->cancel_fd == -1)
- cc->cancel_fd = e_msgport_fd(cc->cancel_port);
-
- UNLOCK();
-
- return cc->cancel_fd;
-}
-
-#ifdef HAVE_NSS
-/**
- * camel_operation_cancel_prfd:
- * @cc: operation context
- *
- * Retrieve a file descriptor that can be waited on (select, or poll)
- * for read, to asynchronously detect cancellation.
- *
- * Return value: The fd, or NULL if cancellation is not available
- * (blocked, or has not been registered for this thread).
- **/
-PRFileDesc *
-camel_operation_cancel_prfd (CamelOperation *cc)
-{
- if (cc == NULL)
- cc = (CamelOperation *)pthread_getspecific(operation_key);
-
- if (cc == NULL || cc->blocked)
- return NULL;
-
- LOCK();
-
- if (cc->cancel_prfd == NULL)
- cc->cancel_prfd = e_msgport_prfd(cc->cancel_port);
-
- UNLOCK();
-
- return cc->cancel_prfd;
-}
-#endif /* HAVE_NSS */
-
-/**
- * camel_operation_start:
- * @cc: operation context
- * @what: action being performed (printf-style format string)
- * @Varargs: varargs
- *
- * Report the start of an operation. All start operations should have
- * similar end operations.
- **/
-void
-camel_operation_start (CamelOperation *cc, char *what, ...)
-{
- va_list ap;
- char *msg;
- struct _status_stack *s;
-
- if (cc == NULL)
- cc = (CamelOperation *)pthread_getspecific(operation_key);
-
- if (cc == NULL)
- return;
-
- LOCK();
-
- if (cc->status == NULL) {
- UNLOCK();
- return;
- }
-
- va_start(ap, what);
- msg = g_strdup_vprintf(what, ap);
- va_end(ap);
- cc->status_update = 0;
- s = g_malloc0(sizeof(*s));
- s->msg = msg;
- s->flags = 0;
- cc->lastreport = s;
- cc->status_stack = g_slist_prepend(cc->status_stack, s);
-
- UNLOCK();
-
- cc->status(cc, msg, CAMEL_OPERATION_START, cc->status_data);
-
- d(printf("start '%s'\n", msg, pc));
-}
-
-/**
- * camel_operation_start_transient:
- * @cc: operation context
- * @what: printf-style format string describing the action being performed
- * @Varargs: varargs
- *
- * Start a transient event. We only update this to the display if it
- * takes very long to process, and if we do, we then go back to the
- * previous state when finished.
- **/
-void
-camel_operation_start_transient (CamelOperation *cc, char *what, ...)
-{
- va_list ap;
- char *msg;
- struct _status_stack *s;
-
- if (cc == NULL)
- cc = (CamelOperation *)pthread_getspecific(operation_key);
-
- if (cc == NULL || cc->status == NULL)
- return;
-
- LOCK();
-
- va_start(ap, what);
- msg = g_strdup_vprintf(what, ap);
- va_end(ap);
- cc->status_update = 0;
- s = g_malloc0(sizeof(*s));
- s->msg = msg;
- s->flags = CAMEL_OPERATION_TRANSIENT;
- s->stamp = stamp();
- cc->status_stack = g_slist_prepend(cc->status_stack, s);
- d(printf("start '%s'\n", msg, pc));
-
- UNLOCK();
-
- /* we dont report it yet */
- /*cc->status(cc, msg, CAMEL_OPERATION_START, cc->status_data);*/
-}
-
-static unsigned int stamp(void)
-{
- struct timeval tv;
-
- gettimeofday(&tv, NULL);
- /* update 4 times/second */
- return (tv.tv_sec * 4) + tv.tv_usec / (1000000/4);
-}
-
-/**
- * camel_operation_progress:
- * @cc: Operation to report to.
- * @pc: Percent complete, 0 to 100.
- *
- * Report progress on the current operation. If @cc is NULL, then the
- * currently registered operation is used. @pc reports the current
- * percentage of completion, which should be in the range of 0 to 100.
- *
- * If the total percentage is not know, then use
- * camel_operation_progress_count().
- **/
-void
-camel_operation_progress (CamelOperation *cc, int pc)
-{
- unsigned int now;
- struct _status_stack *s;
- char *msg = NULL;
-
- if (cc == NULL)
- cc = (CamelOperation *)pthread_getspecific(operation_key);
-
- if (cc == NULL)
- return;
-
- LOCK();
-
- if (cc->status == NULL || cc->status_stack == NULL) {
- UNLOCK();
- return;
- }
-
- s = cc->status_stack->data;
- s->pc = pc;
-
- /* Transient messages dont start updating till 4 seconds after
- they started, then they update every second */
- now = stamp();
- if (cc->status_update == now) {
- cc = NULL;
- } else if (s->flags & CAMEL_OPERATION_TRANSIENT) {
- if (s->stamp + CAMEL_OPERATION_TRANSIENT_DELAY > now) {
- cc = NULL;
- } else {
- cc->status_update = now;
- cc->lastreport = s;
- msg = g_strdup(s->msg);
- }
- } else {
- s->stamp = cc->status_update = now;
- cc->lastreport = s;
- msg = g_strdup(s->msg);
- }
-
- UNLOCK();
-
- if (cc) {
- cc->status(cc, msg, pc, cc->status_data);
- g_free(msg);
- }
-}
-
-/**
- * camel_operation_progress_count:
- * @cc: operation context
- * @sofar:
- *
- **/
-void
-camel_operation_progress_count (CamelOperation *cc, int sofar)
-{
- camel_operation_progress(cc, sofar);
-}
-
-/**
- * camel_operation_end:
- * @cc: operation context
- * @what: Format string.
- * @Varargs: varargs
- *
- * Report the end of an operation. If @cc is NULL, then the currently
- * registered operation is notified.
- **/
-void
-camel_operation_end (CamelOperation *cc)
-{
- struct _status_stack *s, *p;
- unsigned int now;
- char *msg = NULL;
- int pc = 0;
-
- if (cc == NULL)
- cc = (CamelOperation *)pthread_getspecific(operation_key);
-
- if (cc == NULL)
- return;
-
- LOCK();
-
- if (cc->status == NULL || cc->status_stack == NULL) {
- UNLOCK();
- return;
- }
-
- /* so what we do here is this. If the operation that just
- * ended was transient, see if we have any other transient
- * messages that haven't been updated yet above us, otherwise,
- * re-update as a non-transient at the last reported pc */
- now = stamp();
- s = cc->status_stack->data;
- if (s->flags & CAMEL_OPERATION_TRANSIENT) {
- if (cc->lastreport == s) {
- GSList *l = cc->status_stack->next;
- while (l) {
- p = l->data;
- if (p->flags & CAMEL_OPERATION_TRANSIENT) {
- if (p->stamp + CAMEL_OPERATION_TRANSIENT_DELAY < now) {
- msg = g_strdup(p->msg);
- pc = p->pc;
- cc->lastreport = p;
- break;
- }
- } else {
- msg = g_strdup(p->msg);
- pc = p->pc;
- cc->lastreport = p;
- break;
- }
- l = l->next;
- }
- }
- g_free(s->msg);
- } else {
- msg = s->msg;
- pc = CAMEL_OPERATION_END;
- cc->lastreport = s;
- }
- g_free(s);
- cc->status_stack = g_slist_remove_link(cc->status_stack, cc->status_stack);
-
- UNLOCK();
-
- if (msg) {
- cc->status(cc, msg, pc, cc->status_data);
- g_free(msg);
- }
-}
diff --git a/camel/camel-operation.h b/camel/camel-operation.h
deleted file mode 100644
index 62e29dc2ac..0000000000
--- a/camel/camel-operation.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Authors: Michael Zucchi <NotZed@Ximian.com>
- *
- * Copyright 2001 Ximian, Inc. (www.ximian.com/)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifndef CAMEL_OPERATION_H
-#define CAMEL_OPERATION_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-/* cancellation helper stuff, not yet finalised */
-
-typedef struct _CamelOperation CamelOperation;
-
-typedef void (*CamelOperationStatusFunc)(struct _CamelOperation *op, const char *what, int pc, void *data);
-
-enum _camel_operation_status_t {
- CAMEL_OPERATION_START = -1,
- CAMEL_OPERATION_END = -2,
-};
-
-/* main thread functions */
-void camel_operation_init(void);
-
-CamelOperation *camel_operation_new(CamelOperationStatusFunc status, void *status_data);
-void camel_operation_mute(CamelOperation *cc);
-void camel_operation_ref(CamelOperation *cc);
-void camel_operation_unref(CamelOperation *cc);
-void camel_operation_cancel(CamelOperation *cc);
-/* subthread functions */
-CamelOperation *camel_operation_register(CamelOperation *cc);
-void camel_operation_unregister (CamelOperation *cc);
-
-/* called internally by camel, for the current thread */
-void camel_operation_cancel_block(CamelOperation *cc);
-void camel_operation_cancel_unblock(CamelOperation *cc);
-int camel_operation_cancel_check(CamelOperation *cc);
-int camel_operation_cancel_fd(CamelOperation *cc);
-#ifdef HAVE_NSS
-struct PRFileDesc *camel_operation_cancel_prfd(CamelOperation *cc);
-#endif
-/* return the registered operation for this thread, if there is one */
-CamelOperation *camel_operation_registered(void);
-
-void camel_operation_start(CamelOperation *cc, char *what, ...);
-void camel_operation_start_transient(CamelOperation *cc, char *what, ...);
-void camel_operation_progress(CamelOperation *cc, int pc);
-void camel_operation_progress_count(CamelOperation *cc, int sofar);
-void camel_operation_end(CamelOperation *cc);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_OPERATION_H */
diff --git a/camel/camel-partition-table.c b/camel/camel-partition-table.c
deleted file mode 100644
index e5b2639a4a..0000000000
--- a/camel/camel-partition-table.c
+++ /dev/null
@@ -1,998 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2001-2003 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/uio.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-
-#include "e-util/e-msgport.h"
-
-#include "camel-block-file.h"
-#include "camel-partition-table.h"
-
-/* Do we synchronously write table updates - makes the
- tables consistent after program crash without sync */
-/*#define SYNC_UPDATES*/
-
-#define d(x) /*(printf("%s(%d):%s: ", __FILE__, __LINE__, __PRETTY_FUNCTION__),(x))*/
-/* key index debug */
-#define k(x) /*(printf("%s(%d):%s: ", __FILE__, __LINE__, __PRETTY_FUNCTION__),(x))*/
-
-
-struct _CamelPartitionTablePrivate {
- pthread_mutex_t lock; /* for locking partition */
-};
-
-#define CAMEL_PARTITION_TABLE_LOCK(kf, lock) (pthread_mutex_lock(&(kf)->priv->lock))
-#define CAMEL_PARTITION_TABLE_UNLOCK(kf, lock) (pthread_mutex_unlock(&(kf)->priv->lock))
-
-
-static void
-camel_partition_table_class_init(CamelPartitionTableClass *klass)
-{
-}
-
-static void
-camel_partition_table_init(CamelPartitionTable *cpi)
-{
- struct _CamelPartitionTablePrivate *p;
-
- e_dlist_init(&cpi->partition);
-
- p = cpi->priv = g_malloc0(sizeof(*cpi->priv));
- pthread_mutex_init(&p->lock, NULL);
-}
-
-static void
-camel_partition_table_finalise(CamelPartitionTable *cpi)
-{
- CamelBlock *bl;
- struct _CamelPartitionTablePrivate *p;
-
- p = cpi->priv;
-
- if (cpi->blocks) {
- while ((bl = (CamelBlock *)e_dlist_remhead(&cpi->partition))) {
- camel_block_file_sync_block(cpi->blocks, bl);
- camel_block_file_unref_block(cpi->blocks, bl);
- }
- camel_block_file_sync(cpi->blocks);
-
- camel_object_unref((CamelObject *)cpi->blocks);
- }
-
- pthread_mutex_destroy(&p->lock);
-
- g_free(p);
-
-}
-
-CamelType
-camel_partition_table_get_type(void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register(camel_object_get_type(), "CamelPartitionTable",
- sizeof (CamelPartitionTable),
- sizeof (CamelPartitionTableClass),
- (CamelObjectClassInitFunc) camel_partition_table_class_init,
- NULL,
- (CamelObjectInitFunc) camel_partition_table_init,
- (CamelObjectFinalizeFunc) camel_partition_table_finalise);
- }
-
- return type;
-}
-
-/* ********************************************************************** */
-
-/*
- Have 2 hashes:
- Name -> nameid
- Word -> wordid
-
-nameid is pointer to name file, includes a bit to say if name is deleted
-wordid is a pointer to word file, includes pointer to start of word entries
-
-delete a name -> set it as deleted, do nothing else though
-
-lookup word, if nameid is deleted, mark it in wordlist as unused and mark for write (?)
-*/
-
-/* ********************************************************************** */
-
-/* This simple hash seems to work quite well */
-static camel_hash_t hash_key(const char *key)
-{
- camel_hash_t hash = 0xABADF00D;
-
- while (*key) {
- hash = hash * (*key) ^ (*key);
- key++;
- }
-
- return hash;
-}
-
-/* Call with lock held */
-static CamelBlock *find_partition(CamelPartitionTable *cpi, camel_hash_t id, int *indexp)
-{
- int index, jump;
- CamelBlock *bl;
- CamelPartitionMapBlock *ptb;
- CamelPartitionMap *part;
-
- /* first, find the block this key might be in, then binary search the block */
- bl = (CamelBlock *)cpi->partition.head;
- while (bl->next) {
- ptb = (CamelPartitionMapBlock *)&bl->data;
- part = ptb->partition;
- if (ptb->used > 0 && id <= part[ptb->used-1].hashid) {
- index = ptb->used/2;
- jump = ptb->used/4;
-
- if (jump == 0)
- jump = 1;
-
- while (1) {
- if (id <= part[index].hashid) {
- if (index == 0 || id > part[index-1].hashid)
- break;
- index -= jump;
- } else {
- if (index >= ptb->used-1)
- break;
- index += jump;
- }
- jump = jump/2;
- if (jump == 0)
- jump = 1;
- }
- *indexp = index;
-
- return bl;
- }
- bl = bl->next;
- }
-
- g_warning("could not find a partition that could fit ! partition table corrupt!");
-
- /* This should never be reached */
-
- return NULL;
-}
-
-CamelPartitionTable *camel_partition_table_new(struct _CamelBlockFile *bs, camel_block_t root)
-{
- CamelPartitionTable *cpi;
- CamelPartitionMapBlock *ptb;
- CamelPartitionKeyBlock *kb;
- CamelBlock *block, *pblock;
-
- cpi = (CamelPartitionTable *)camel_object_new(camel_partition_table_get_type());
- cpi->rootid = root;
- cpi->blocks = bs;
- camel_object_ref((CamelObject *)bs);
-
- /* read the partition table into memory */
- do {
- block = camel_block_file_get_block(bs, root);
- if (block == NULL)
- goto fail;
-
- ptb = (CamelPartitionMapBlock *)&block->data;
-
- d(printf("Adding partition block, used = %d, hashid = %08x\n", ptb->used, ptb->partition[0].hashid));
-
- /* if we have no data, prime initial block */
- if (ptb->used == 0 && e_dlist_empty(&cpi->partition) && ptb->next == 0) {
- pblock = camel_block_file_new_block(bs);
- if (pblock == NULL) {
- camel_block_file_unref_block(bs, block);
- goto fail;
- }
- kb = (CamelPartitionKeyBlock *)&pblock->data;
- kb->used = 0;
- ptb->used = 1;
- ptb->partition[0].hashid = 0xffffffff;
- ptb->partition[0].blockid = pblock->id;
- camel_block_file_touch_block(bs, pblock);
- camel_block_file_unref_block(bs, pblock);
- camel_block_file_touch_block(bs, block);
-#ifdef SYNC_UPDATES
- camel_block_file_sync_block(bs, block);
-#endif
- }
-
- root = ptb->next;
- camel_block_file_detach_block(bs, block);
- e_dlist_addtail(&cpi->partition, (EDListNode *)block);
- } while (root);
-
- return cpi;
-
-fail:
- camel_object_unref((CamelObject *)cpi);
- return NULL;
-}
-
-/* sync our blocks, the caller must still sync the blockfile itself */
-int
-camel_partition_table_sync(CamelPartitionTable *cpi)
-{
- CamelBlock *bl, *bn;
- struct _CamelPartitionTablePrivate *p;
- int ret = 0;
-
- CAMEL_PARTITION_TABLE_LOCK(cpi, lock);
-
- p = cpi->priv;
-
- if (cpi->blocks) {
- bl = (CamelBlock *)cpi->partition.head;
- bn = bl->next;
- while (bn) {
- ret = camel_block_file_sync_block(cpi->blocks, bl);
- if (ret == -1)
- goto fail;
- bl = bn;
- bn = bn->next;
- }
- }
-fail:
- CAMEL_PARTITION_TABLE_UNLOCK(cpi, lock);
-
- return ret;
-}
-
-camel_key_t camel_partition_table_lookup(CamelPartitionTable *cpi, const char *key)
-{
- CamelPartitionKeyBlock *pkb;
- CamelPartitionMapBlock *ptb;
- CamelBlock *block, *ptblock;
- camel_hash_t hashid;
- camel_key_t keyid = 0;
- int index, i;
-
- hashid = hash_key(key);
-
- CAMEL_PARTITION_TABLE_LOCK(cpi, lock);
-
- ptblock = find_partition(cpi, hashid, &index);
- if (ptblock == NULL) {
- CAMEL_PARTITION_TABLE_UNLOCK(cpi, lock);
- return 0;
- }
- ptb = (CamelPartitionMapBlock *)&ptblock->data;
- block = camel_block_file_get_block(cpi->blocks, ptb->partition[index].blockid);
- if (block == NULL) {
- CAMEL_PARTITION_TABLE_UNLOCK(cpi, lock);
- return 0;
- }
-
- pkb = (CamelPartitionKeyBlock *)&block->data;
-
- /* What to do about duplicate hash's? */
- for (i=0;i<pkb->used;i++) {
- if (pkb->keys[i].hashid == hashid) {
- /* !! need to: lookup and compare string value */
- /* get_key() if key == key ... */
- keyid = pkb->keys[i].keyid;
- break;
- }
- }
-
- CAMEL_PARTITION_TABLE_UNLOCK(cpi, lock);
-
- camel_block_file_unref_block(cpi->blocks, block);
-
- return keyid;
-}
-
-void camel_partition_table_remove(CamelPartitionTable *cpi, const char *key)
-{
- CamelPartitionKeyBlock *pkb;
- CamelPartitionMapBlock *ptb;
- CamelBlock *block, *ptblock;
- camel_hash_t hashid;
- camel_key_t keyid = 0;
- int index, i;
-
- hashid = hash_key(key);
-
- CAMEL_PARTITION_TABLE_LOCK(cpi, lock);
-
- ptblock = find_partition(cpi, hashid, &index);
- if (ptblock == NULL) {
- CAMEL_PARTITION_TABLE_UNLOCK(cpi, lock);
- return;
- }
- ptb = (CamelPartitionMapBlock *)&ptblock->data;
- block = camel_block_file_get_block(cpi->blocks, ptb->partition[index].blockid);
- if (block == NULL) {
- CAMEL_PARTITION_TABLE_UNLOCK(cpi, lock);
- return;
- }
- pkb = (CamelPartitionKeyBlock *)&block->data;
-
- /* What to do about duplicate hash's? */
- for (i=0;i<pkb->used;i++) {
- if (pkb->keys[i].hashid == hashid) {
- /* !! need to: lookup and compare string value */
- /* get_key() if key == key ... */
- keyid = pkb->keys[i].keyid;
-
- /* remove this key */
- pkb->used--;
- for (;i<pkb->used;i++) {
- pkb->keys[i].keyid = pkb->keys[i+1].keyid;
- pkb->keys[i].hashid = pkb->keys[i+1].hashid;
- }
- camel_block_file_touch_block(cpi->blocks, block);
- break;
- }
- }
-
- CAMEL_PARTITION_TABLE_UNLOCK(cpi, lock);
-
- camel_block_file_unref_block(cpi->blocks, block);
-}
-
-static int
-keys_cmp(const void *ap, const void *bp)
-{
- const CamelPartitionKey *a = ap;
- const CamelPartitionKey *b = bp;
-
- if (a->hashid < b->hashid)
- return -1;
- else if (a->hashid > b->hashid)
- return 1;
-
- return 0;
-}
-
-int
-camel_partition_table_add(CamelPartitionTable *cpi, const char *key, camel_key_t keyid)
-{
- camel_hash_t hashid, partid;
- int index, newindex = 0; /* initialisation of this and pkb/nkb is just to silence compiler */
- CamelPartitionMapBlock *ptb, *ptn;
- CamelPartitionKeyBlock *kb, *newkb, *nkb = NULL, *pkb = NULL;
- CamelBlock *block, *ptblock, *ptnblock;
- int i, half, len;
- struct _CamelPartitionKey keys[CAMEL_BLOCK_SIZE/4];
- int ret = -1;
-
-#define KEY_SIZE (sizeof(kb->keys)/sizeof(kb->keys[0]))
-
- hashid = hash_key(key);
-
- CAMEL_PARTITION_TABLE_LOCK(cpi, lock);
- ptblock = find_partition(cpi, hashid, &index);
- if (ptblock == NULL) {
- CAMEL_PARTITION_TABLE_UNLOCK(cpi, lock);
- return -1;
- }
- ptb = (CamelPartitionMapBlock *)&ptblock->data;
- block = camel_block_file_get_block(cpi->blocks, ptb->partition[index].blockid);
- if (block == NULL) {
- CAMEL_PARTITION_TABLE_UNLOCK(cpi, lock);
- return -1;
- }
- kb = (CamelPartitionKeyBlock *)&block->data;
-
- /* TODO: Keep the key array in sorted order, cheaper lookups and split operation */
-
- if (kb->used < sizeof(kb->keys)/sizeof(kb->keys[0])) {
- /* Have room, just put it in */
- kb->keys[kb->used].hashid = hashid;
- kb->keys[kb->used].keyid = keyid;
- kb->used++;
- } else {
- CamelBlock *newblock = NULL, *nblock = NULL, *pblock = NULL;
-
- /* Need to split? See if previous or next has room, then split across that instead */
-
- /* TODO: Should look at next/previous partition table block as well ... */
-
- if (index > 0) {
- pblock = camel_block_file_get_block(cpi->blocks, ptb->partition[index-1].blockid);
- if (pblock == NULL)
- goto fail;
- pkb = (CamelPartitionKeyBlock *)&pblock->data;
- }
- if (index < (ptb->used-1)) {
- nblock = camel_block_file_get_block(cpi->blocks, ptb->partition[index+1].blockid);
- if (nblock == NULL) {
- if (pblock)
- camel_block_file_unref_block(cpi->blocks, pblock);
- goto fail;
- }
- nkb = (CamelPartitionKeyBlock *)&nblock->data;
- }
-
- if (pblock && pkb->used < KEY_SIZE) {
- if (nblock && nkb->used < KEY_SIZE) {
- if (pkb->used < nkb->used) {
- newindex = index+1;
- newblock = nblock;
- } else {
- newindex = index-1;
- newblock = pblock;
- }
- } else {
- newindex = index-1;
- newblock = pblock;
- }
- } else {
- if (nblock && nkb->used < KEY_SIZE) {
- newindex = index+1;
- newblock = nblock;
- }
- }
-
- /* We had no room, need to split across another block */
- if (newblock == NULL) {
- /* See if we have room in the partition table for this block or need to split that too */
- if (ptb->used >= sizeof(ptb->partition)/sizeof(ptb->partition[0])) {
- /* TODO: Could check next block to see if it'll fit there first */
- ptnblock = camel_block_file_new_block(cpi->blocks);
- if (ptnblock == NULL) {
- if (nblock)
- camel_block_file_unref_block(cpi->blocks, nblock);
- if (pblock)
- camel_block_file_unref_block(cpi->blocks, pblock);
- goto fail;
- }
- camel_block_file_detach_block(cpi->blocks, ptnblock);
-
- /* split block and link on-disk, always sorted */
- ptn = (CamelPartitionMapBlock *)&ptnblock->data;
- ptn->next = ptb->next;
- ptb->next = ptnblock->id;
- len = ptb->used / 2;
- ptn->used = ptb->used - len;
- ptb->used = len;
- memcpy(ptn->partition, &ptb->partition[len], ptn->used * sizeof(ptb->partition[0]));
-
- /* link in-memory */
- ptnblock->next = ptblock->next;
- ptblock->next->prev = ptnblock;
- ptblock->next = ptnblock;
- ptnblock->prev = ptblock;
-
- /* write in right order to ensure structure */
- camel_block_file_touch_block(cpi->blocks, ptnblock);
-#ifdef SYNC_UPDATES
- camel_block_file_sync_block(cpi->blocks, ptnblock);
-#endif
- if (index > len) {
- camel_block_file_touch_block(cpi->blocks, ptblock);
-#ifdef SYNC_UPDATES
- camel_block_file_sync_block(cpi->blocks, ptblock);
-#endif
- index -= len;
- ptb = ptn;
- ptblock = ptnblock;
- }
- }
-
- /* try get newblock before modifying existing */
- newblock = camel_block_file_new_block(cpi->blocks);
- if (newblock == NULL) {
- if (nblock)
- camel_block_file_unref_block(cpi->blocks, nblock);
- if (pblock)
- camel_block_file_unref_block(cpi->blocks, pblock);
- goto fail;
- }
-
- for (i=ptb->used-1;i>index;i--) {
- ptb->partition[i+1].hashid = ptb->partition[i].hashid;
- ptb->partition[i+1].blockid = ptb->partition[i].blockid;
- }
- ptb->used++;
-
- newkb = (CamelPartitionKeyBlock *)&newblock->data;
- newkb->used = 0;
- newindex = index+1;
-
- ptb->partition[newindex].hashid = ptb->partition[index].hashid;
- ptb->partition[newindex].blockid = newblock->id;
-
- if (nblock)
- camel_block_file_unref_block(cpi->blocks, nblock);
- if (pblock)
- camel_block_file_unref_block(cpi->blocks, pblock);
- } else {
- newkb = (CamelPartitionKeyBlock *)&newblock->data;
-
- if (newblock == pblock) {
- if (nblock)
- camel_block_file_unref_block(cpi->blocks, nblock);
- } else {
- if (pblock)
- camel_block_file_unref_block(cpi->blocks, pblock);
- }
- }
-
- /* sort keys to find midpoint */
- len = kb->used;
- memcpy(keys, kb->keys, sizeof(kb->keys[0])*len);
- memcpy(keys+len, newkb->keys, sizeof(newkb->keys[0])*newkb->used);
- len += newkb->used;
- keys[len].hashid = hashid;
- keys[len].keyid = keyid;
- len++;
- qsort(keys, len, sizeof(keys[0]), keys_cmp);
-
- /* Split keys, fix partition table */
- half = len/2;
- partid = keys[half-1].hashid;
-
- if (index < newindex) {
- memcpy(kb->keys, keys, sizeof(keys[0])*half);
- kb->used = half;
- memcpy(newkb->keys, keys+half, sizeof(keys[0])*(len-half));
- newkb->used = len-half;
- ptb->partition[index].hashid = partid;
- } else {
- memcpy(newkb->keys, keys, sizeof(keys[0])*half);
- newkb->used = half;
- memcpy(kb->keys, keys+half, sizeof(keys[0])*(len-half));
- kb->used = len-half;
- ptb->partition[newindex].hashid = partid;
- }
-
- camel_block_file_touch_block(cpi->blocks, ptblock);
-#ifdef SYNC_UPDATES
- camel_block_file_sync_block(cpi->blocks, ptblock);
-#endif
- camel_block_file_touch_block(cpi->blocks, newblock);
- camel_block_file_unref_block(cpi->blocks, newblock);
- }
-
- camel_block_file_touch_block(cpi->blocks, block);
- camel_block_file_unref_block(cpi->blocks, block);
-
- ret = 0;
-fail:
- CAMEL_PARTITION_TABLE_UNLOCK(cpi, lock);
-
- return ret;
-}
-
-/* ********************************************************************** */
-
-
-struct _CamelKeyTablePrivate {
- pthread_mutex_t lock; /* for locking key */
-};
-
-#define CAMEL_KEY_TABLE_LOCK(kf, lock) (pthread_mutex_lock(&(kf)->priv->lock))
-#define CAMEL_KEY_TABLE_UNLOCK(kf, lock) (pthread_mutex_unlock(&(kf)->priv->lock))
-
-
-static void
-camel_key_table_class_init(CamelKeyTableClass *klass)
-{
-}
-
-static void
-camel_key_table_init(CamelKeyTable *ki)
-{
- struct _CamelKeyTablePrivate *p;
-
- p = ki->priv = g_malloc0(sizeof(*ki->priv));
- pthread_mutex_init(&p->lock, NULL);
-}
-
-static void
-camel_key_table_finalise(CamelKeyTable *ki)
-{
- struct _CamelKeyTablePrivate *p;
-
- p = ki->priv;
-
- if (ki->blocks) {
- if (ki->root_block) {
- camel_block_file_sync_block(ki->blocks, ki->root_block);
- camel_block_file_unref_block(ki->blocks, ki->root_block);
- }
- camel_block_file_sync(ki->blocks);
- camel_object_unref((CamelObject *)ki->blocks);
- }
-
- pthread_mutex_destroy(&p->lock);
-
- g_free(p);
-
-}
-
-CamelType
-camel_key_table_get_type(void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register(camel_object_get_type(), "CamelKeyTable",
- sizeof (CamelKeyTable),
- sizeof (CamelKeyTableClass),
- (CamelObjectClassInitFunc) camel_key_table_class_init,
- NULL,
- (CamelObjectInitFunc) camel_key_table_init,
- (CamelObjectFinalizeFunc) camel_key_table_finalise);
- }
-
- return type;
-}
-
-
-CamelKeyTable *
-camel_key_table_new(CamelBlockFile *bs, camel_block_t root)
-{
- CamelKeyTable *ki;
-
- ki = (CamelKeyTable *)camel_object_new(camel_key_table_get_type());
-
- ki->blocks = bs;
- camel_object_ref((CamelObject *)bs);
- ki->rootid = root;
-
- ki->root_block = camel_block_file_get_block(bs, ki->rootid);
- if (ki->root_block == NULL) {
- camel_object_unref((CamelObject *)ki);
- ki = NULL;
- } else {
- camel_block_file_detach_block(bs, ki->root_block);
- ki->root = (CamelKeyRootBlock *)&ki->root_block->data;
-
- k(printf("Opening key index\n"));
- k(printf(" first %u\n last %u\n free %u\n", ki->root->first, ki->root->last, ki->root->free));
- }
-
- return ki;
-}
-
-int
-camel_key_table_sync(CamelKeyTable *ki)
-{
-#ifdef SYNC_UPDATES
- return 0;
-#else
- return camel_block_file_sync_block(ki->blocks, ki->root_block);
-#endif
-}
-
-camel_key_t
-camel_key_table_add(CamelKeyTable *ki, const char *key, camel_block_t data, unsigned int flags)
-{
- CamelBlock *last, *next;
- CamelKeyBlock *kblast, *kbnext;
- int len, left;
- unsigned int offset;
- camel_key_t keyid = 0;
-
- /* Maximum key size = 128 chars */
- len = strlen(key);
- if (len > CAMEL_KEY_TABLE_MAX_KEY)
- len = 128;
-
- CAMEL_KEY_TABLE_LOCK(ki, lock);
-
- if (ki->root->last == 0) {
- last = camel_block_file_new_block(ki->blocks);
- if (last == NULL)
- goto fail;
- ki->root->last = ki->root->first = last->id;
- camel_block_file_touch_block(ki->blocks, ki->root_block);
- k(printf("adding first block, first = %u\n", ki->root->first));
- } else {
- last = camel_block_file_get_block(ki->blocks, ki->root->last);
- if (last == NULL)
- goto fail;
- }
-
- kblast = (CamelKeyBlock *)&last->data;
-
- if (kblast->used >= 127)
- goto fail;
-
- if (kblast->used > 0) {
- /*left = &kblast->u.keydata[kblast->u.keys[kblast->used-1].offset] - (char *)(&kblast->u.keys[kblast->used+1]);*/
- left = kblast->u.keys[kblast->used-1].offset - sizeof(kblast->u.keys[0])*(kblast->used+1);
- d(printf("key '%s' used = %d (%d), filled = %d, left = %d len = %d?\n",
- key, kblast->used, kblast->used * sizeof(kblast->u.keys[0]),
- sizeof(kblast->u.keydata) - kblast->u.keys[kblast->used-1].offset,
- left, len));
- if (left < len) {
- next = camel_block_file_new_block(ki->blocks);
- if (next == NULL) {
- camel_block_file_unref_block(ki->blocks, last);
- goto fail;
- }
- kbnext = (CamelKeyBlock *)&next->data;
- kblast->next = next->id;
- ki->root->last = next->id;
- d(printf("adding new block, first = %u, last = %u\n", ki->root->first, ki->root->last));
- camel_block_file_touch_block(ki->blocks, ki->root_block);
- camel_block_file_touch_block(ki->blocks, last);
- camel_block_file_unref_block(ki->blocks, last);
- kblast = kbnext;
- last = next;
- }
- }
-
- if (kblast->used > 0)
- offset = kblast->u.keys[kblast->used-1].offset - len;
- else
- offset = sizeof(kblast->u.keydata)-len;
-
- kblast->u.keys[kblast->used].flags = flags;
- kblast->u.keys[kblast->used].data = data;
- kblast->u.keys[kblast->used].offset = offset;
- memcpy(kblast->u.keydata + offset, key, len);
-
- keyid = (last->id & (~(CAMEL_BLOCK_SIZE-1))) | kblast->used;
-
- kblast->used++;
-
- g_assert(kblast->used < 127);
-
- camel_block_file_touch_block(ki->blocks, last);
- camel_block_file_unref_block(ki->blocks, last);
-
-#ifdef SYNC_UPDATES
- camel_block_file_sync_block(ki->blocks, ki->root_block);
-#endif
-fail:
- CAMEL_KEY_TABLE_UNLOCK(ki, lock);
-
- return keyid;
-}
-
-void
-camel_key_table_set_data(CamelKeyTable *ki, camel_key_t keyid, camel_block_t data)
-{
- CamelBlock *bl;
- camel_block_t blockid;
- int index;
- CamelKeyBlock *kb;
-
- if (keyid == 0)
- return;
-
- blockid = keyid & (~(CAMEL_BLOCK_SIZE-1));
- index = keyid & (CAMEL_BLOCK_SIZE-1);
-
- bl = camel_block_file_get_block(ki->blocks, blockid);
- if (bl == NULL)
- return;
- kb = (CamelKeyBlock *)&bl->data;
-
- CAMEL_KEY_TABLE_LOCK(ki, lock);
-
- if (kb->u.keys[index].data != data) {
- kb->u.keys[index].data = data;
- camel_block_file_touch_block(ki->blocks, bl);
- }
-
- CAMEL_KEY_TABLE_UNLOCK(ki, lock);
-
- camel_block_file_unref_block(ki->blocks, bl);
-}
-
-void
-camel_key_table_set_flags(CamelKeyTable *ki, camel_key_t keyid, unsigned int flags, unsigned int set)
-{
- CamelBlock *bl;
- camel_block_t blockid;
- int index;
- CamelKeyBlock *kb;
- unsigned int old;
-
- if (keyid == 0)
- return;
-
- blockid = keyid & (~(CAMEL_BLOCK_SIZE-1));
- index = keyid & (CAMEL_BLOCK_SIZE-1);
-
- bl = camel_block_file_get_block(ki->blocks, blockid);
- if (bl == NULL)
- return;
- kb = (CamelKeyBlock *)&bl->data;
-
- g_assert(kb->used < 127);
- g_assert(index < kb->used);
-
- CAMEL_KEY_TABLE_LOCK(ki, lock);
-
- old = kb->u.keys[index].flags;
- if ((old & set) != (flags & set)) {
- kb->u.keys[index].flags = (old & (~set)) | (flags & set);
- camel_block_file_touch_block(ki->blocks, bl);
- }
-
- CAMEL_KEY_TABLE_UNLOCK(ki, lock);
-
- camel_block_file_unref_block(ki->blocks, bl);
-}
-
-camel_block_t
-camel_key_table_lookup(CamelKeyTable *ki, camel_key_t keyid, char **keyp, unsigned int *flags)
-{
- CamelBlock *bl;
- camel_block_t blockid;
- int index, len, off;
- char *key;
- CamelKeyBlock *kb;
-
- if (keyp)
- *keyp = 0;
- if (flags)
- *flags = 0;
- if (keyid == 0)
- return 0;
-
- blockid = keyid & (~(CAMEL_BLOCK_SIZE-1));
- index = keyid & (CAMEL_BLOCK_SIZE-1);
-
- bl = camel_block_file_get_block(ki->blocks, blockid);
- if (bl == NULL)
- return 0;
-
- kb = (CamelKeyBlock *)&bl->data;
-
-#if 1
- g_assert(kb->used < 127); /* this should be more accurate */
- g_assert(index < kb->used);
-#else
- if (kb->used >=127 || index >= kb->used) {
- g_warning("Block %x: Invalid index or content: index %d used %d\n", blockid, index, kb->used);
- return 0;
- }
-#endif
-
- CAMEL_KEY_TABLE_LOCK(ki, lock);
-
- blockid = kb->u.keys[index].data;
- if (flags)
- *flags = kb->u.keys[index].flags;
-
- if (keyp) {
- off = kb->u.keys[index].offset;
- if (index == 0)
- len = sizeof(kb->u.keydata) - off;
- else
- len = kb->u.keys[index-1].offset - off;
- *keyp = key = g_malloc(len+1);
- memcpy(key, kb->u.keydata + off, len);
- key[len] = 0;
- }
-
- CAMEL_KEY_TABLE_UNLOCK(ki, lock);
-
- camel_block_file_unref_block(ki->blocks, bl);
-
- return blockid;
-}
-
-/* iterate through all keys */
-camel_key_t
-camel_key_table_next(CamelKeyTable *ki, camel_key_t next, char **keyp, unsigned int *flagsp, camel_block_t *datap)
-{
- CamelBlock *bl;
- CamelKeyBlock *kb;
- camel_block_t blockid;
- int index;
-
- if (keyp)
- *keyp = 0;
- if (flagsp)
- *flagsp = 0;
- if (datap)
- *datap = 0;
-
- CAMEL_KEY_TABLE_LOCK(ki, lock);
-
- if (next == 0) {
- next = ki->root->first;
- if (next == 0) {
- CAMEL_KEY_TABLE_UNLOCK(ki, lock);
- return 0;
- }
- } else
- next++;
-
- do {
- blockid = next & (~(CAMEL_BLOCK_SIZE-1));
- index = next & (CAMEL_BLOCK_SIZE-1);
-
- bl = camel_block_file_get_block(ki->blocks, blockid);
- if (bl == NULL) {
- CAMEL_KEY_TABLE_UNLOCK(ki, lock);
- return 0;
- }
-
- kb = (CamelKeyBlock *)&bl->data;
-
- /* see if we need to goto the next block */
- if (index >= kb->used) {
- /* FIXME: check for loops */
- next = kb->next;
- camel_block_file_unref_block(ki->blocks, bl);
- bl = NULL;
- }
- } while (bl == NULL);
-
- /* invalid block data */
- if ((kb->u.keys[index].offset >= sizeof(kb->u.keydata)
- /*|| kb->u.keys[index].offset < kb->u.keydata - (char *)&kb->u.keys[kb->used])*/
- || kb->u.keys[index].offset < sizeof(kb->u.keys[0]) * kb->used
- || (index > 0 &&
- (kb->u.keys[index-1].offset >= sizeof(kb->u.keydata)
- /*|| kb->u.keys[index-1].offset < kb->u.keydata - (char *)&kb->u.keys[kb->used]))) {*/
- || kb->u.keys[index-1].offset < sizeof(kb->u.keys[0]) * kb->used)))) {
- g_warning("Block %u invalid scanning keys", bl->id);
- camel_block_file_unref_block(ki->blocks, bl);
- CAMEL_KEY_TABLE_UNLOCK(ki, lock);
- return 0;
- }
-
- if (datap)
- *datap = kb->u.keys[index].data;
-
- if (flagsp)
- *flagsp = kb->u.keys[index].flags;
-
- if (keyp) {
- int len, off = kb->u.keys[index].offset;
- char *key;
-
- if (index == 0)
- len = sizeof(kb->u.keydata) - off;
- else
- len = kb->u.keys[index-1].offset - off;
- *keyp = key = g_malloc(len+1);
- memcpy(key, kb->u.keydata + off, len);
- key[len] = 0;
- }
-
- CAMEL_KEY_TABLE_UNLOCK(ki, lock);
-
- camel_block_file_unref_block(ki->blocks, bl);
-
- return next;
-}
-
-/* ********************************************************************** */
diff --git a/camel/camel-partition-table.h b/camel/camel-partition-table.h
deleted file mode 100644
index 3433da3cf1..0000000000
--- a/camel/camel-partition-table.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Copyright (C) 2001 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef _CAMEL_PARTITION_TABLE_H
-#define _CAMEL_PARTITION_TABLE_H
-
-#include <camel/camel-object.h>
-#include <glib.h>
-#include <e-util/e-msgport.h>
-
-#include "camel-block-file.h"
-
-/* ********************************************************************** */
-
-/* CamelPartitionTable - index of key to keyid */
-
-typedef guint32 camel_hash_t; /* a hashed key */
-
-typedef struct _CamelPartitionKey CamelPartitionKey;
-typedef struct _CamelPartitionKeyBlock CamelPartitionKeyBlock;
-typedef struct _CamelPartitionMap CamelPartitionMap;
-typedef struct _CamelPartitionMapBlock CamelPartitionMapBlock;
-
-typedef struct _CamelPartitionTable CamelPartitionTable;
-typedef struct _CamelPartitionTableClass CamelPartitionTableClass;
-
-struct _CamelPartitionKey {
- camel_hash_t hashid;
- camel_key_t keyid;
-};
-
-struct _CamelPartitionKeyBlock {
- guint32 used;
- struct _CamelPartitionKey keys[(CAMEL_BLOCK_SIZE-4)/sizeof(struct _CamelPartitionKey)];
-};
-
-struct _CamelPartitionMap {
- camel_hash_t hashid;
- camel_block_t blockid;
-};
-
-struct _CamelPartitionMapBlock {
- camel_block_t next;
- guint32 used;
- struct _CamelPartitionMap partition[(CAMEL_BLOCK_SIZE-8)/sizeof(struct _CamelPartitionMap)];
-};
-
-struct _CamelPartitionTable {
- CamelObject parent;
-
- struct _CamelPartitionTablePrivate *priv;
-
- CamelBlockFile *blocks;
- camel_block_t rootid;
-
- int (*is_key)(CamelPartitionTable *cpi, const char *key, camel_key_t keyid, void *data);
- void *is_key_data;
-
- /* we keep a list of partition blocks active at all times */
- EDList partition;
-};
-
-struct _CamelPartitionTableClass {
- CamelObjectClass parent;
-};
-
-CamelType camel_partition_table_get_type(void);
-
-CamelPartitionTable *camel_partition_table_new(struct _CamelBlockFile *bs, camel_block_t root);
-int camel_partition_table_sync(CamelPartitionTable *cpi);
-int camel_partition_table_add(CamelPartitionTable *cpi, const char *key, camel_key_t keyid);
-camel_key_t camel_partition_table_lookup(CamelPartitionTable *cpi, const char *key);
-void camel_partition_table_remove(CamelPartitionTable *cpi, const char *key);
-
-/* ********************************************************************** */
-
-/* CamelKeyTable - index of keyid to key and flag and data mapping */
-
-typedef struct _CamelKeyBlock CamelKeyBlock;
-typedef struct _CamelKeyRootBlock CamelKeyRootBlock;
-
-typedef struct _CamelKeyTable CamelKeyTable;
-typedef struct _CamelKeyTableClass CamelKeyTableClass;
-
-struct _CamelKeyRootBlock {
- camel_block_t first;
- camel_block_t last;
- camel_key_t free; /* free list */
-};
-
-struct _CamelKeyKey {
- camel_block_t data;
- unsigned int offset:10;
- unsigned int flags:22;
-};
-
-struct _CamelKeyBlock {
- camel_block_t next;
- guint32 used;
- union {
- struct _CamelKeyKey keys[(CAMEL_BLOCK_SIZE-8)/sizeof(struct _CamelKeyKey)];
- char keydata[CAMEL_BLOCK_SIZE-8];
- } u;
-};
-
-#define CAMEL_KEY_TABLE_MAX_KEY (128) /* max size of any key */
-
-struct _CamelKeyTable {
- CamelObject parent;
-
- struct _CamelKeyTablePrivate *priv;
-
- CamelBlockFile *blocks;
-
- camel_block_t rootid;
-
- CamelKeyRootBlock *root;
- CamelBlock *root_block;
-};
-
-struct _CamelKeyTableClass {
- CamelObjectClass parent;
-};
-
-CamelType camel_key_table_get_type(void);
-
-CamelKeyTable * camel_key_table_new(CamelBlockFile *bs, camel_block_t root);
-int camel_key_table_sync(CamelKeyTable *ki);
-camel_key_t camel_key_table_add(CamelKeyTable *ki, const char *key, camel_block_t data, unsigned int flags);
-void camel_key_table_set_data(CamelKeyTable *ki, camel_key_t keyid, camel_block_t data);
-void camel_key_table_set_flags(CamelKeyTable *ki, camel_key_t keyid, unsigned int flags, unsigned int set);
-camel_block_t camel_key_table_lookup(CamelKeyTable *ki, camel_key_t keyid, char **key, unsigned int *flags);
-camel_key_t camel_key_table_next(CamelKeyTable *ki, camel_key_t next, char **keyp, unsigned int *flagsp, camel_block_t *datap);
-
-#endif /* ! _CAMEL_PARTITION_TABLE_H */
diff --git a/camel/camel-private.h b/camel/camel-private.h
deleted file mode 100644
index 87aeeff4b7..0000000000
--- a/camel/camel-private.h
+++ /dev/null
@@ -1,168 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- * camel-private.h: Private info for class implementers.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifndef CAMEL_PRIVATE_H
-#define CAMEL_PRIVATE_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-/* need a way to configure and save this data, if this header is to
- be installed. For now, dont install it */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <pthread.h>
-#include <e-util/e-msgport.h>
-
-struct _CamelFolderPrivate {
- EMutex *lock;
- EMutex *change_lock;
- /* must require the 'change_lock' to access this */
- int frozen;
- struct _CamelFolderChangeInfo *changed_frozen; /* queues changed events */
-};
-
-#define CAMEL_FOLDER_LOCK(f, l) (e_mutex_lock(((CamelFolder *)f)->priv->l))
-#define CAMEL_FOLDER_UNLOCK(f, l) (e_mutex_unlock(((CamelFolder *)f)->priv->l))
-
-
-struct _CamelStorePrivate {
- EMutex *folder_lock; /* for locking folder operations */
-};
-
-#define CAMEL_STORE_LOCK(f, l) (e_mutex_lock(((CamelStore *)f)->priv->l))
-#define CAMEL_STORE_UNLOCK(f, l) (e_mutex_unlock(((CamelStore *)f)->priv->l))
-
-
-struct _CamelTransportPrivate {
- GMutex *send_lock; /* for locking send operations */
-};
-
-#define CAMEL_TRANSPORT_LOCK(f, l) (g_mutex_lock(((CamelTransport *)f)->priv->l))
-#define CAMEL_TRANSPORT_UNLOCK(f, l) (g_mutex_unlock(((CamelTransport *)f)->priv->l))
-
-
-struct _CamelServicePrivate {
- EMutex *connect_lock; /* for locking connection operations */
- EMutex *connect_op_lock;/* for locking the connection_op */
-};
-
-#define CAMEL_SERVICE_LOCK(f, l) (e_mutex_lock(((CamelService *)f)->priv->l))
-#define CAMEL_SERVICE_UNLOCK(f, l) (e_mutex_unlock(((CamelService *)f)->priv->l))
-#define CAMEL_SERVICE_ASSERT_LOCKED(f, l) (e_mutex_assert_locked (((CamelService *)f)->priv->l))
-
-
-struct _CamelSessionPrivate {
- GMutex *lock; /* for locking everything basically */
- GMutex *thread_lock; /* locking threads */
-
- int thread_id;
- GHashTable *thread_active;
- EThread *thread_queue;
-
- GHashTable *thread_msg_op;
-};
-
-#define CAMEL_SESSION_LOCK(f, l) (g_mutex_lock(((CamelSession *)f)->priv->l))
-#define CAMEL_SESSION_UNLOCK(f, l) (g_mutex_unlock(((CamelSession *)f)->priv->l))
-
-
-/* most of this stuff really is private, but the lock can be used by subordinate classes */
-struct _CamelFolderSummaryPrivate {
- GHashTable *filter_charset; /* CamelMimeFilterCharset's indexed by source charset */
-
- struct _CamelMimeFilterIndex *filter_index;
- struct _CamelMimeFilterBasic *filter_64;
- struct _CamelMimeFilterBasic *filter_qp;
- struct _CamelMimeFilterBasic *filter_uu;
- struct _CamelMimeFilterSave *filter_save;
- struct _CamelMimeFilterHTML *filter_html;
-
- struct _CamelStreamFilter *filter_stream;
-
- struct _CamelIndex *index;
-
- GMutex *summary_lock; /* for the summary hashtable/array */
- GMutex *io_lock; /* load/save lock, for access to saved_count, etc */
- GMutex *filter_lock; /* for accessing any of the filtering/indexing stuff, since we share them */
- GMutex *alloc_lock; /* for setting up and using allocators */
- GMutex *ref_lock; /* for reffing/unreffing messageinfo's ALWAYS obtain before summary_lock */
-};
-
-#define CAMEL_SUMMARY_LOCK(f, l) (g_mutex_lock(((CamelFolderSummary *)f)->priv->l))
-#define CAMEL_SUMMARY_UNLOCK(f, l) (g_mutex_unlock(((CamelFolderSummary *)f)->priv->l))
-
-
-struct _CamelStoreSummaryPrivate {
- GMutex *summary_lock; /* for the summary hashtable/array */
- GMutex *io_lock; /* load/save lock, for access to saved_count, etc */
- GMutex *alloc_lock; /* for setting up and using allocators */
- GMutex *ref_lock; /* for reffing/unreffing messageinfo's ALWAYS obtain before summary_lock */
-};
-
-#define CAMEL_STORE_SUMMARY_LOCK(f, l) (g_mutex_lock(((CamelStoreSummary *)f)->priv->l))
-#define CAMEL_STORE_SUMMARY_UNLOCK(f, l) (g_mutex_unlock(((CamelStoreSummary *)f)->priv->l))
-
-
-struct _CamelVeeFolderPrivate {
- GList *folders; /* lock using subfolder_lock before changing/accessing */
- GList *folders_changed; /* for list of folders that have changed between updates */
- int freeze_count;
-
- GMutex *summary_lock; /* for locking vfolder summary */
- GMutex *subfolder_lock; /* for locking the subfolder list */
- GMutex *changed_lock; /* for locking the folders-changed list */
-};
-
-#define CAMEL_VEE_FOLDER_LOCK(f, l) (g_mutex_lock(((CamelVeeFolder *)f)->priv->l))
-#define CAMEL_VEE_FOLDER_UNLOCK(f, l) (g_mutex_unlock(((CamelVeeFolder *)f)->priv->l))
-
-
-struct _CamelDataWrapperPrivate {
- pthread_mutex_t stream_lock;
-};
-
-#define CAMEL_DATA_WRAPPER_LOCK(dw, l) (pthread_mutex_lock(&((CamelDataWrapper *)dw)->priv->l))
-#define CAMEL_DATA_WRAPPER_UNLOCK(dw, l) (pthread_mutex_unlock(&((CamelDataWrapper *)dw)->priv->l))
-
-
-/* most of this stuff really is private, but the lock can be used by subordinate classes */
-struct _CamelCertDBPrivate {
- GMutex *db_lock; /* for the db hashtable/array */
- GMutex *io_lock; /* load/save lock, for access to saved_count, etc */
- GMutex *alloc_lock; /* for setting up and using allocators */
- GMutex *ref_lock; /* for reffing/unreffing certs */
-};
-
-#define CAMEL_CERTDB_LOCK(db, l) (g_mutex_lock (((CamelCertDB *) db)->priv->l))
-#define CAMEL_CERTDB_UNLOCK(db, l) (g_mutex_unlock (((CamelCertDB *) db)->priv->l))
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_PRIVATE_H */
diff --git a/camel/camel-process.c b/camel/camel-process.c
deleted file mode 100644
index 04de281294..0000000000
--- a/camel/camel-process.c
+++ /dev/null
@@ -1,151 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-
-#include "camel-process.h"
-
-
-pid_t
-camel_process_fork (const char *path, char **argv, int *infd, int *outfd, int *errfd, CamelException *ex)
-{
- int errnosav, fd[6], i;
- pid_t pid;
-
- for (i = 0; i < 6; i++)
- fds[i] = -1;
-
- for (i = 0; i < 6; i += 2) {
- if (pipe (fd + i) == -1) {
- errnosav = errno;
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Failed to create pipe to '%s': %s"),
- argv[0], strerror (errno));
-
- for (i = 0; i < 6; i++) {
- if (fd[i] == -1)
- break;
- close (fd[i]);
- }
-
- errno = errnosav;
-
- return -1;
- }
- }
-
- if (!(pid = fork ())) {
- /* child process */
- int maxfd, nullfd = -1;
-
- if (!outfd || !errfd)
- nullfd = open ("/dev/null", O_WRONLY);
-
- if (dup2 (fd[0], STDIN_FILENO) == -1)
- _exit (255);
-
- if (dup2 (outfd ? fd[3] : nullfd, STDOUT_FILENO) == -1)
- _exit (255);
-
- if (dup2 (errfd ? fd[5] : nullfd, STDERR_FILENO) == -1)
- _exit (255);
-
- setsid ();
-
- if ((maxfd = sysconf (_SC_OPEN_MAX)) > 0) {
- for (i = 3; i < maxfd; i++)
- fcntl (i, F_SETFD, FD_CLOEXEC);
- }
-
- execv (path, argv);
- _exit (255);
- } else if (pid == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Failed to create create child process '%s': %s"),
- argv[0], strerror (errno));
- return -1;
- }
-
- /* parent process */
- close (fd[0]);
- close (fd[3]);
- close (fd[5]);
-
- if (infd)
- *infd = fd[1];
- else
- close (fd[1]);
-
- if (outfd)
- *outfd = fd[2];
- else
- close (fd[2]);
-
- if (errfd)
- *errfd = fd[4];
- else
- close (fd[4]);
-
- return pid;
-}
-
-
-int
-camel_process_wait (pid_t pid)
-{
- sigset_t mask, omask;
- int status;
- pid_t r;
-
- sigemptyset (&mask);
- sigaddset (&mask, SIGALRM);
- sigprocmask (SIG_BLOCK, &mask, &omask);
- alarm (1);
-
- r = waitpid (pid, &status, 0);
-
- alarm (0);
- sigprocmask (SIG_SETMASK, &omask, NULL);
-
- if (r == (pid_t) -1 && errno == EINTR) {
- kill (pid, SIGTERM);
- sleep (1);
- r = waitpid (pid, &status, WNOHANG);
- if (r == (pid_t) 0) {
- kill (pid, SIGKILL);
- sleep (1);
- r = waitpid (pid, &status, WNOHANG);
- }
- }
-
- if (r != (pid_t) -1 && WIFEXITED (status))
- return WEXITSTATUS (status);
- else
- return -1;
-}
diff --git a/camel/camel-process.h b/camel/camel-process.h
deleted file mode 100644
index a87db24d5c..0000000000
--- a/camel/camel-process.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifndef __CAMEL_PROCESS_H__
-#define __CAMEL_PROCESS_H__
-
-#include <sys/types.h>
-
-#include <camel/camel-exception.h>
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-pid_t camel_process_fork (const char *path, char **argv, int *infd, int *outfd, int *errfd, CamelException *ex);
-
-int camel_process_wait (pid_t pid);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __CAMEL_PROCESS_H__ */
diff --git a/camel/camel-provider.c b/camel/camel-provider.c
deleted file mode 100644
index 321b3077cd..0000000000
--- a/camel/camel-provider.c
+++ /dev/null
@@ -1,192 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-provider.c: provider framework */
-
-/*
- *
- * Authors:
- * Bertrand Guiheneuf <bertrand@helixcode.com>
- * Dan Winship <danw@ximian.com>
- * Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-/* FIXME: Shouldn't we add a version number to providers ? */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <sys/types.h>
-#include <dirent.h>
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-
-#include <gmodule.h>
-
-#include "camel-provider.h"
-#include "camel-exception.h"
-#include "camel-string-utils.h"
-
-
-/**
- * camel_provider_init:
- *
- * Initialize the Camel provider system by reading in the .urls
- * files in the provider directory and creating a hash table mapping
- * URLs to module names.
- *
- * A .urls file has the same initial prefix as the shared library it
- * correspond to, and consists of a series of lines containing the URL
- * protocols that that library handles.
- *
- * Return value: a hash table mapping URLs to module names
- **/
-GHashTable *
-camel_provider_init (void)
-{
- GHashTable *providers;
- DIR *dir;
- struct dirent *d;
- char *p, *name, buf[80];
-
- providers = g_hash_table_new (camel_strcase_hash, camel_strcase_equal);
-
- dir = opendir (CAMEL_PROVIDERDIR);
- if (!dir) {
- g_error ("Could not open camel provider directory (%s): %s",
- CAMEL_PROVIDERDIR, g_strerror (errno));
- return NULL;
- }
-
- while ((d = readdir (dir))) {
- FILE *fp;
-
- p = strchr (d->d_name, '.');
- if (!p || strcmp (p, ".urls") != 0)
- continue;
-
- name = g_strdup_printf ("%s/%s", CAMEL_PROVIDERDIR, d->d_name);
- fp = fopen (name, "r");
- if (!fp) {
- g_warning ("Could not read provider info file %s: %s",
- name, g_strerror (errno));
- g_free (name);
- continue;
- }
-
- p = strrchr (name, '.');
- strcpy (p, ".so");
- while ((fgets (buf, sizeof (buf), fp))) {
- buf[sizeof (buf) - 1] = '\0';
- p = strchr (buf, '\n');
- if (p)
- *p = '\0';
-
- if (*buf)
- g_hash_table_insert (providers, g_strdup (buf), g_strdup (name));
- }
-
- g_free (name);
- fclose (fp);
- }
-
- closedir (dir);
- return providers;
-}
-
-/**
- * camel_provider_load:
- * @session: the current session
- * @path: the path to a shared library
- * @ex: a CamelException
- *
- * Loads the provider at @path, and calls its initialization function,
- * passing @session as an argument. The provider should then register
- * itself with @session.
- **/
-void
-camel_provider_load (CamelSession *session, const char *path, CamelException *ex)
-{
- GModule *module;
- CamelProvider *(*camel_provider_module_init) ();
-
- if (!g_module_supported ()) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not load %s: Module loading "
- "not supported on this system."),
- path);
- return;
- }
-
- module = g_module_open (path, 0);
- if (!module) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not load %s: %s"),
- path, g_module_error ());
- return;
- }
-
- if (!g_module_symbol (module, "camel_provider_module_init",
- (gpointer *)&camel_provider_module_init)) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not load %s: No initialization "
- "code in module."), path);
- g_module_close (module);
- return;
- }
-
- camel_provider_module_init (session);
-}
-
-
-/**
- * camel_provider_auto_detect:
- * @provider: camel provider
- * @settings: currently set settings
- * @auto_detected: output hash table of auto-detected values
- * @ex: exception
- *
- * After filling in the standard Username/Hostname/Port/Path settings
- * (which must be set in @settings), if the provider supports it, you
- * may wish to have the provider auto-detect further settings based on
- * the aformentioned settings.
- *
- * If the provider does not support auto-detection, @auto_detected
- * will be set to %NULL. Otherwise the provider will attempt to
- * auto-detect whatever it can and file them into @auto_detected. If
- * for some reason it cannot auto-detect anything (not enough
- * information provided in @settings?) then @auto_deetected will be
- * set to %NULL and an exception may be set to explain why it failed.
- *
- * Returns 0 on success or -1 on fail.
- **/
-int
-camel_provider_auto_detect (CamelProvider *provider, CamelURL *url,
- GHashTable **auto_detected, CamelException *ex)
-{
- g_return_val_if_fail (provider != NULL, -1);
-
- if (provider->auto_detect) {
- return provider->auto_detect (url, auto_detected, ex);
- } else {
- *auto_detected = NULL;
- return 0;
- }
-}
diff --git a/camel/camel-provider.h b/camel/camel-provider.h
deleted file mode 100644
index 98c5a3ed6a..0000000000
--- a/camel/camel-provider.h
+++ /dev/null
@@ -1,201 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-provider.h : provider definition */
-
-/*
- *
- * Authors:
- * Bertrand Guiheneuf <bertrand@helixcode.com>
- * Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifndef CAMEL_PROVIDER_H
-#define CAMEL_PROVIDER_H 1
-
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include <camel/camel-types.h>
-#include <camel/camel-object.h>
-#include <camel/camel-exception.h>
-#include <camel/camel-url.h>
-
-#define CAMEL_PROVIDER(obj) ((CamelProvider *)(obj))
-
-typedef enum {
- CAMEL_PROVIDER_STORE,
- CAMEL_PROVIDER_TRANSPORT,
- CAMEL_NUM_PROVIDER_TYPES
-} CamelProviderType;
-
-extern char *camel_provider_type_name[CAMEL_NUM_PROVIDER_TYPES];
-
-/* Provider flags:
- *
- * _IS_REMOTE the provider works with remote data
- * _IS_LOCAL it can be used as a backend for local folder
- * tree folders. (*Not* just the opposite of _IS_REMOTE)
- * _IS_SOURCE mail arrives there, so it should be offered as an
- * option in the mail config dialog.
- * _IS_STORAGE mail is stored there. it will appear in the folder tree.
- * _IS_EXTERNAL it appears in the folder tree but is not created by
- * the mail component.
- */
-#define CAMEL_PROVIDER_IS_REMOTE (1 << 0)
-#define CAMEL_PROVIDER_IS_LOCAL (1 << 1)
-#define CAMEL_PROVIDER_IS_EXTERNAL (1 << 2)
-#define CAMEL_PROVIDER_IS_SOURCE (1 << 3)
-#define CAMEL_PROVIDER_IS_STORAGE (1 << 4)
-#define CAMEL_PROVIDER_SUPPORTS_SSL (1 << 5)
-
-
-/* Flags for url_flags. "ALLOW" means the config dialog will let
- * the user configure it. "NEED" implies "ALLOW" but means the user
- * must configure it. Service code can assume that any url part
- * for which it has set the NEED flag will be set when the service
- * is created.
- */
-#define CAMEL_URL_PART_USER (1 << 0)
-#define CAMEL_URL_PART_AUTH (1 << 1)
-#define CAMEL_URL_PART_PASSWORD (1 << 2)
-#define CAMEL_URL_PART_HOST (1 << 3)
-#define CAMEL_URL_PART_PORT (1 << 4)
-#define CAMEL_URL_PART_PATH (1 << 5)
-
-#define CAMEL_URL_PART_NEED 8
-
-/* Use these macros to test a provider's url_flags */
-#define CAMEL_PROVIDER_ALLOWS(prov, flags) (prov->url_flags & (flags | (flags << CAMEL_URL_PART_NEED)))
-#define CAMEL_PROVIDER_NEEDS(prov, flags) (prov->url_flags & (flags << CAMEL_URL_PART_NEED))
-
-/* Providers use these macros to actually define their url_flags */
-#define CAMEL_URL_ALLOW_USER (CAMEL_URL_PART_USER)
-#define CAMEL_URL_ALLOW_AUTH (CAMEL_URL_PART_AUTH)
-#define CAMEL_URL_ALLOW_PASSWORD (CAMEL_URL_PART_PASSWORD)
-#define CAMEL_URL_ALLOW_HOST (CAMEL_URL_PART_HOST)
-#define CAMEL_URL_ALLOW_PORT (CAMEL_URL_PART_PORT)
-#define CAMEL_URL_ALLOW_PATH (CAMEL_URL_PART_PATH)
-
-#define CAMEL_URL_NEED_USER (CAMEL_URL_PART_USER << CAMEL_URL_PART_NEED)
-#define CAMEL_URL_NEED_AUTH (CAMEL_URL_PART_AUTH << CAMEL_URL_PART_NEED)
-#define CAMEL_URL_NEED_PASSWORD (CAMEL_URL_PART_PASSWORD << CAMEL_URL_PART_NEED)
-#define CAMEL_URL_NEED_HOST (CAMEL_URL_PART_HOST << CAMEL_URL_PART_NEED)
-#define CAMEL_URL_NEED_PORT (CAMEL_URL_PART_PORT << CAMEL_URL_PART_NEED)
-#define CAMEL_URL_NEED_PATH (CAMEL_URL_PART_PATH << CAMEL_URL_PART_NEED)
-
-#define CAMEL_URL_FRAGMENT_IS_PATH (1 << 30) /* url uses fragment for folder name path, not path */
-#define CAMEL_URL_PATH_IS_ABSOLUTE (1 << 31)
-
-
-#define CAMEL_PROVIDER_IS_STORE_AND_TRANSPORT(prov) (prov->object_types[CAMEL_PROVIDER_STORE] && prov->object_types[CAMEL_PROVIDER_TRANSPORT])
-
-/* Generic extra config stuff */
-typedef enum {
- CAMEL_PROVIDER_CONF_END,
- CAMEL_PROVIDER_CONF_SECTION_START,
- CAMEL_PROVIDER_CONF_SECTION_END,
- CAMEL_PROVIDER_CONF_CHECKBOX,
- CAMEL_PROVIDER_CONF_CHECKSPIN,
- CAMEL_PROVIDER_CONF_ENTRY,
- CAMEL_PROVIDER_CONF_LABEL,
-} CamelProviderConfType;
-
-typedef struct {
- CamelProviderConfType type;
- char *name, *depname;
- char *text, *value;
-} CamelProviderConfEntry;
-
-
-/* Some defaults */
-#define CAMEL_PROVIDER_CONF_DEFAULT_USERNAME { CAMEL_PROVIDER_CONF_LABEL, "username", NULL, N_("User_name:"), NULL }
-#define CAMEL_PROVIDER_CONF_DEFAULT_HOSTNAME { CAMEL_PROVIDER_CONF_LABEL, "hostname", NULL, N_("_Host:"), NULL }
-#define CAMEL_PROVIDER_CONF_DEFAULT_PATH { CAMEL_PROVIDER_CONF_ENTRY, "path", NULL, N_("_Path:"), "" }
-
-typedef int (*CamelProviderAutoDetectFunc) (CamelURL *url, GHashTable **auto_detected, CamelException *ex);
-
-typedef struct {
- /* Provider name used in CamelURLs. */
- char *protocol;
-
- /* Provider name as used by people. (May be the same as protocol) */
- char *name;
-
- /* Description of the provider. A novice user should be able
- * to read this description, and the information provided by
- * an ISP, IS department, etc, and determine whether or not
- * this provider is relevant to him, and if so, which
- * information goes with it.
- */
- char *description;
-
- /* The category of message that this provider works with.
- * (evolution-mail will only list a provider in the store/transport
- * config dialogs if its domain is "mail".)
- */
- char *domain;
-
- /* Flags describing the provider, flags describing its URLs */
- int flags, url_flags;
-
- /* Extra configuration information */
- CamelProviderConfEntry *extra_conf;
-
- /* auto-detection function */
- CamelProviderAutoDetectFunc auto_detect;
-
- /* CamelType(s) of its store and/or transport. If both are
- * set, then they are assumed to be linked together and the
- * transport type can only be used in an account that also
- * uses the store type (eg, Exchange or NNTP).
- */
- CamelType object_types[CAMEL_NUM_PROVIDER_TYPES];
-
- /* GList of CamelServiceAuthTypes the provider supports */
- GList *authtypes;
-
- CamelObjectBag *service_cache[CAMEL_NUM_PROVIDER_TYPES];
-
- GHashFunc url_hash;
- GCompareFunc url_equal;
-
- /* gettext translation domain (NULL for providers in the
- * evolution source tree).
- */
- char *translation_domain;
-} CamelProvider;
-
-GHashTable *camel_provider_init (void);
-void camel_provider_load (CamelSession *session, const char *path, CamelException *ex);
-
-/* This is defined by each module, not by camel-provider.c. */
-void camel_provider_module_init (CamelSession *session);
-
-
-int camel_provider_auto_detect (CamelProvider *provider, CamelURL *url,
- GHashTable **auto_detected, CamelException *ex);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_PROVIDER_H */
diff --git a/camel/camel-sasl-anonymous.c b/camel/camel-sasl-anonymous.c
deleted file mode 100644
index 9b97fdbc07..0000000000
--- a/camel/camel-sasl-anonymous.c
+++ /dev/null
@@ -1,152 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2001-2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-#include "camel-sasl-anonymous.h"
-#include "camel-internet-address.h"
-#include <string.h>
-
-
-CamelServiceAuthType camel_sasl_anonymous_authtype = {
- N_("Anonymous"),
-
- N_("This option will connect to the server using an anonymous login."),
-
- "ANONYMOUS",
- FALSE
-};
-
-static CamelSaslClass *parent_class = NULL;
-
-/* Returns the class for a CamelSaslAnonymous */
-#define CSA_CLASS(so) CAMEL_SASL_ANONYMOUS_CLASS (CAMEL_OBJECT_GET_CLASS (so))
-
-static GByteArray *anon_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex);
-
-static void
-camel_sasl_anonymous_class_init (CamelSaslAnonymousClass *camel_sasl_anonymous_class)
-{
- CamelSaslClass *camel_sasl_class = CAMEL_SASL_CLASS (camel_sasl_anonymous_class);
-
- parent_class = CAMEL_SASL_CLASS (camel_type_get_global_classfuncs (camel_sasl_get_type ()));
-
- /* virtual method overload */
- camel_sasl_class->challenge = anon_challenge;
-}
-
-static void
-camel_sasl_anonymous_finalize (CamelObject *object)
-{
- CamelSaslAnonymous *sasl = CAMEL_SASL_ANONYMOUS (object);
-
- g_free (sasl->trace_info);
-}
-
-
-CamelType
-camel_sasl_anonymous_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_sasl_get_type (),
- "CamelSaslAnonymous",
- sizeof (CamelSaslAnonymous),
- sizeof (CamelSaslAnonymousClass),
- (CamelObjectClassInitFunc) camel_sasl_anonymous_class_init,
- NULL,
- NULL,
- (CamelObjectFinalizeFunc) camel_sasl_anonymous_finalize);
- }
-
- return type;
-}
-
-CamelSasl *
-camel_sasl_anonymous_new (CamelSaslAnonTraceType type, const char *trace_info)
-{
- CamelSaslAnonymous *sasl_anon;
-
- if (!trace_info && type != CAMEL_SASL_ANON_TRACE_EMPTY) return NULL;
-
- sasl_anon = CAMEL_SASL_ANONYMOUS (camel_object_new (camel_sasl_anonymous_get_type ()));
- sasl_anon->trace_info = g_strdup (trace_info);
- sasl_anon->type = type;
-
- return CAMEL_SASL (sasl_anon);
-}
-
-static GByteArray *
-anon_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
-{
- CamelSaslAnonymous *sasl_anon = CAMEL_SASL_ANONYMOUS (sasl);
- CamelInternetAddress *cia;
- GByteArray *ret = NULL;
-
- if (token) {
- camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
- _("Authentication failed."));
- return NULL;
- }
-
- switch (sasl_anon->type) {
- case CAMEL_SASL_ANON_TRACE_EMAIL:
- cia = camel_internet_address_new ();
- if (camel_internet_address_add (cia, NULL, sasl_anon->trace_info) != 1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
- _("Invalid email address trace information:\n%s"),
- sasl_anon->trace_info);
- camel_object_unref (cia);
- return NULL;
- }
- camel_object_unref (cia);
- ret = g_byte_array_new ();
- g_byte_array_append (ret, sasl_anon->trace_info, strlen (sasl_anon->trace_info));
- break;
- case CAMEL_SASL_ANON_TRACE_OPAQUE:
- if (strchr (sasl_anon->trace_info, '@')) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
- _("Invalid opaque trace information:\n%s"),
- sasl_anon->trace_info);
- return NULL;
- }
- ret = g_byte_array_new ();
- g_byte_array_append (ret, sasl_anon->trace_info, strlen (sasl_anon->trace_info));
- break;
- case CAMEL_SASL_ANON_TRACE_EMPTY:
- ret = g_byte_array_new ();
- break;
- default:
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
- _("Invalid trace information:\n%s"),
- sasl_anon->trace_info);
- return NULL;
- }
-
- sasl->authenticated = TRUE;
- return ret;
-}
diff --git a/camel/camel-sasl-anonymous.h b/camel/camel-sasl-anonymous.h
deleted file mode 100644
index 5c8bed4a4b..0000000000
--- a/camel/camel-sasl-anonymous.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2001 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef CAMEL_SASL_ANONYMOUS_H
-#define CAMEL_SASL_ANONYMOUS_H
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include <camel/camel-sasl.h>
-
-#define CAMEL_SASL_ANONYMOUS_TYPE (camel_sasl_anonymous_get_type ())
-#define CAMEL_SASL_ANONYMOUS(obj) (CAMEL_CHECK_CAST((obj), CAMEL_SASL_ANONYMOUS_TYPE, CamelSaslAnonymous))
-#define CAMEL_SASL_ANONYMOUS_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_SASL_ANONYMOUS_TYPE, CamelSaslAnonymousClass))
-#define CAMEL_IS_SASL_ANONYMOUS(o) (CAMEL_CHECK_TYPE((o), CAMEL_SASL_ANONYMOUS_TYPE))
-
-typedef enum {
- CAMEL_SASL_ANON_TRACE_EMAIL,
- CAMEL_SASL_ANON_TRACE_OPAQUE,
- CAMEL_SASL_ANON_TRACE_EMPTY
-} CamelSaslAnonTraceType;
-
-typedef struct _CamelSaslAnonymous {
- CamelSasl parent_object;
-
- char *trace_info;
- CamelSaslAnonTraceType type;
-} CamelSaslAnonymous;
-
-
-typedef struct _CamelSaslAnonymousClass {
- CamelSaslClass parent_class;
-
-} CamelSaslAnonymousClass;
-
-
-/* Standard Camel function */
-CamelType camel_sasl_anonymous_get_type (void);
-
-/* public methods */
-CamelSasl *camel_sasl_anonymous_new (CamelSaslAnonTraceType type, const char *trace_info);
-
-extern CamelServiceAuthType camel_sasl_anonymous_authtype;
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_SASL_ANONYMOUS_H */
diff --git a/camel/camel-sasl-cram-md5.c b/camel/camel-sasl-cram-md5.c
deleted file mode 100644
index f544d48a22..0000000000
--- a/camel/camel-sasl-cram-md5.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2001 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <string.h>
-#include "camel-sasl-cram-md5.h"
-#include "camel-mime-utils.h"
-#include "camel-service.h"
-#include <e-util/md5-utils.h>
-
-CamelServiceAuthType camel_sasl_cram_md5_authtype = {
- N_("CRAM-MD5"),
-
- N_("This option will connect to the server using a "
- "secure CRAM-MD5 password, if the server supports it."),
-
- "CRAM-MD5",
- TRUE
-};
-
-static CamelSaslClass *parent_class = NULL;
-
-/* Returns the class for a CamelSaslCramMd5 */
-#define CSCM_CLASS(so) CAMEL_SASL_CRAM_MD5_CLASS (CAMEL_OBJECT_GET_CLASS (so))
-
-static GByteArray *cram_md5_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex);
-
-static void
-camel_sasl_cram_md5_class_init (CamelSaslCramMd5Class *camel_sasl_cram_md5_class)
-{
- CamelSaslClass *camel_sasl_class = CAMEL_SASL_CLASS (camel_sasl_cram_md5_class);
-
- parent_class = CAMEL_SASL_CLASS (camel_type_get_global_classfuncs (camel_sasl_get_type ()));
-
- /* virtual method overload */
- camel_sasl_class->challenge = cram_md5_challenge;
-}
-
-CamelType
-camel_sasl_cram_md5_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_sasl_get_type (),
- "CamelSaslCramMd5",
- sizeof (CamelSaslCramMd5),
- sizeof (CamelSaslCramMd5Class),
- (CamelObjectClassInitFunc) camel_sasl_cram_md5_class_init,
- NULL,
- NULL,
- NULL);
- }
-
- return type;
-}
-
-/* CRAM-MD5 algorithm:
- * MD5 ((passwd XOR opad), MD5 ((passwd XOR ipad), timestamp))
- */
-
-static GByteArray *
-cram_md5_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
-{
- char *passwd;
- guchar digest[16], md5asc[33], *s, *p;
- GByteArray *ret = NULL;
- guchar ipad[64];
- guchar opad[64];
- MD5Context ctx;
- int i, pw_len;
-
- /* Need to wait for the server */
- if (!token)
- return NULL;
-
- g_return_val_if_fail (sasl->service->url->passwd != NULL, NULL);
-
- memset (ipad, 0, sizeof (ipad));
- memset (opad, 0, sizeof (opad));
-
- passwd = sasl->service->url->passwd;
- pw_len = strlen (passwd);
- if (pw_len <= 64) {
- memcpy (ipad, passwd, pw_len);
- memcpy (opad, passwd, pw_len);
- } else {
- md5_get_digest (passwd, pw_len, ipad);
- memcpy (opad, ipad, 16);
- }
-
- for (i = 0; i < 64; i++) {
- ipad[i] ^= 0x36;
- opad[i] ^= 0x5c;
- }
-
- md5_init (&ctx);
- md5_update (&ctx, ipad, 64);
- md5_update (&ctx, token->data, token->len);
- md5_final (&ctx, digest);
-
- md5_init (&ctx);
- md5_update (&ctx, opad, 64);
- md5_update (&ctx, digest, 16);
- md5_final (&ctx, digest);
-
- /* lowercase hexify that bad-boy... */
- for (s = digest, p = md5asc; p < md5asc + 32; s++, p += 2)
- sprintf (p, "%.2x", *s);
-
- ret = g_byte_array_new ();
- g_byte_array_append (ret, sasl->service->url->user, strlen (sasl->service->url->user));
- g_byte_array_append (ret, " ", 1);
- g_byte_array_append (ret, md5asc, 32);
-
- sasl->authenticated = TRUE;
-
- return ret;
-}
diff --git a/camel/camel-sasl-cram-md5.h b/camel/camel-sasl-cram-md5.h
deleted file mode 100644
index 2404b453f6..0000000000
--- a/camel/camel-sasl-cram-md5.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2001 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef CAMEL_SASL_CRAM_MD5_H
-#define CAMEL_SASL_CRAM_MD5_H
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include <camel/camel-sasl.h>
-
-#define CAMEL_SASL_CRAM_MD5_TYPE (camel_sasl_cram_md5_get_type ())
-#define CAMEL_SASL_CRAM_MD5(obj) (CAMEL_CHECK_CAST((obj), CAMEL_SASL_CRAM_MD5_TYPE, CamelSaslCramMd5))
-#define CAMEL_SASL_CRAM_MD5_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_SASL_CRAM_MD5_TYPE, CamelSaslCramMd5Class))
-#define CAMEL_IS_SASL_CRAM_MD5(o) (CAMEL_CHECK_TYPE((o), CAMEL_SASL_CRAM_MD5_TYPE))
-
-typedef struct _CamelSaslCramMd5 {
- CamelSasl parent_object;
-
-} CamelSaslCramMd5;
-
-
-typedef struct _CamelSaslCramMd5Class {
- CamelSaslClass parent_class;
-
-} CamelSaslCramMd5Class;
-
-
-/* Standard Camel function */
-CamelType camel_sasl_cram_md5_get_type (void);
-
-extern CamelServiceAuthType camel_sasl_cram_md5_authtype;
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_SASL_CRAM_MD5_H */
diff --git a/camel/camel-sasl-digest-md5.c b/camel/camel-sasl-digest-md5.c
deleted file mode 100644
index e421bd5294..0000000000
--- a/camel/camel-sasl-digest-md5.c
+++ /dev/null
@@ -1,898 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2001-2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <unistd.h>
-
-#include <e-util/md5-utils.h>
-
-#include <gal/util/e-iconv.h>
-
-#include "camel-charset-map.h"
-#include "camel-mime-utils.h"
-#include "camel-sasl-digest-md5.h"
-
-#define d(x)
-
-#define PARANOID(x) x
-
-/* Implements rfc2831 */
-
-CamelServiceAuthType camel_sasl_digest_md5_authtype = {
- N_("DIGEST-MD5"),
-
- N_("This option will connect to the server using a "
- "secure DIGEST-MD5 password, if the server supports it."),
-
- "DIGEST-MD5",
- TRUE
-};
-
-static CamelSaslClass *parent_class = NULL;
-
-/* Returns the class for a CamelSaslDigestMd5 */
-#define CSCM_CLASS(so) CAMEL_SASL_DIGEST_MD5_CLASS (CAMEL_OBJECT_GET_CLASS (so))
-
-static GByteArray *digest_md5_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex);
-
-enum {
- STATE_AUTH,
- STATE_FINAL
-};
-
-typedef struct {
- char *name;
- guint type;
-} DataType;
-
-enum {
- DIGEST_REALM,
- DIGEST_NONCE,
- DIGEST_QOP,
- DIGEST_STALE,
- DIGEST_MAXBUF,
- DIGEST_CHARSET,
- DIGEST_ALGORITHM,
- DIGEST_CIPHER,
- DIGEST_UNKNOWN
-};
-
-static DataType digest_args[] = {
- { "realm", DIGEST_REALM },
- { "nonce", DIGEST_NONCE },
- { "qop", DIGEST_QOP },
- { "stale", DIGEST_STALE },
- { "maxbuf", DIGEST_MAXBUF },
- { "charset", DIGEST_CHARSET },
- { "algorithm", DIGEST_ALGORITHM },
- { "cipher", DIGEST_CIPHER },
- { NULL, DIGEST_UNKNOWN }
-};
-
-#define QOP_AUTH (1<<0)
-#define QOP_AUTH_INT (1<<1)
-#define QOP_AUTH_CONF (1<<2)
-#define QOP_INVALID (1<<3)
-
-static DataType qop_types[] = {
- { "auth", QOP_AUTH },
- { "auth-int", QOP_AUTH_INT },
- { "auth-conf", QOP_AUTH_CONF },
- { NULL, QOP_INVALID }
-};
-
-#define CIPHER_DES (1<<0)
-#define CIPHER_3DES (1<<1)
-#define CIPHER_RC4 (1<<2)
-#define CIPHER_RC4_40 (1<<3)
-#define CIPHER_RC4_56 (1<<4)
-#define CIPHER_INVALID (1<<5)
-
-static DataType cipher_types[] = {
- { "des", CIPHER_DES },
- { "3des", CIPHER_3DES },
- { "rc4", CIPHER_RC4 },
- { "rc4-40", CIPHER_RC4_40 },
- { "rc4-56", CIPHER_RC4_56 },
- { NULL, CIPHER_INVALID }
-};
-
-struct _param {
- char *name;
- char *value;
-};
-
-struct _DigestChallenge {
- GPtrArray *realms;
- char *nonce;
- guint qop;
- gboolean stale;
- gint32 maxbuf;
- char *charset;
- char *algorithm;
- guint cipher;
- GList *params;
-};
-
-struct _DigestURI {
- char *type;
- char *host;
- char *name;
-};
-
-struct _DigestResponse {
- char *username;
- char *realm;
- char *nonce;
- char *cnonce;
- char nc[9];
- guint qop;
- struct _DigestURI *uri;
- char resp[33];
- guint32 maxbuf;
- char *charset;
- guint cipher;
- char *authzid;
- char *param;
-};
-
-struct _CamelSaslDigestMd5Private {
- struct _DigestChallenge *challenge;
- struct _DigestResponse *response;
- int state;
-};
-
-static void
-camel_sasl_digest_md5_class_init (CamelSaslDigestMd5Class *camel_sasl_digest_md5_class)
-{
- CamelSaslClass *camel_sasl_class = CAMEL_SASL_CLASS (camel_sasl_digest_md5_class);
-
- parent_class = CAMEL_SASL_CLASS (camel_type_get_global_classfuncs (camel_sasl_get_type ()));
-
- /* virtual method overload */
- camel_sasl_class->challenge = digest_md5_challenge;
-}
-
-static void
-camel_sasl_digest_md5_init (gpointer object, gpointer klass)
-{
- CamelSaslDigestMd5 *sasl_digest = CAMEL_SASL_DIGEST_MD5 (object);
-
- sasl_digest->priv = g_new0 (struct _CamelSaslDigestMd5Private, 1);
-}
-
-static void
-camel_sasl_digest_md5_finalize (CamelObject *object)
-{
- CamelSaslDigestMd5 *sasl = CAMEL_SASL_DIGEST_MD5 (object);
- struct _DigestChallenge *c = sasl->priv->challenge;
- struct _DigestResponse *r = sasl->priv->response;
- GList *p;
- int i;
-
- for (i = 0; i < c->realms->len; i++)
- g_free (c->realms->pdata[i]);
- g_ptr_array_free (c->realms, TRUE);
- g_free (c->nonce);
- g_free (c->charset);
- g_free (c->algorithm);
- for (p = c->params; p; p = p->next) {
- struct _param *param = p->data;
-
- g_free (param->name);
- g_free (param->value);
- g_free (param);
- }
- g_list_free (c->params);
- g_free (c);
-
- g_free (r->username);
- g_free (r->realm);
- g_free (r->nonce);
- g_free (r->cnonce);
- if (r->uri) {
- g_free (r->uri->type);
- g_free (r->uri->host);
- g_free (r->uri->name);
- }
- g_free (r->charset);
- g_free (r->authzid);
- g_free (r->param);
- g_free (r);
-
- g_free (sasl->priv);
-}
-
-
-CamelType
-camel_sasl_digest_md5_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_sasl_get_type (),
- "CamelSaslDigestMd5",
- sizeof (CamelSaslDigestMd5),
- sizeof (CamelSaslDigestMd5Class),
- (CamelObjectClassInitFunc) camel_sasl_digest_md5_class_init,
- NULL,
- (CamelObjectInitFunc) camel_sasl_digest_md5_init,
- (CamelObjectFinalizeFunc) camel_sasl_digest_md5_finalize);
- }
-
- return type;
-}
-
-static void
-decode_lwsp (const char **in)
-{
- const char *inptr = *in;
-
- while (isspace (*inptr))
- inptr++;
-
- *in = inptr;
-}
-
-static char *
-decode_quoted_string (const char **in)
-{
- const char *inptr = *in;
- char *out = NULL, *outptr;
- int outlen;
- int c;
-
- decode_lwsp (&inptr);
- if (*inptr == '"') {
- const char *intmp;
- int skip = 0;
-
- /* first, calc length */
- inptr++;
- intmp = inptr;
- while ((c = *intmp++) && c != '"') {
- if (c == '\\' && *intmp) {
- intmp++;
- skip++;
- }
- }
-
- outlen = intmp - inptr - skip;
- out = outptr = g_malloc (outlen + 1);
-
- while ((c = *inptr++) && c != '"') {
- if (c == '\\' && *inptr) {
- c = *inptr++;
- }
- *outptr++ = c;
- }
- *outptr = '\0';
- }
-
- *in = inptr;
-
- return out;
-}
-
-static char *
-decode_token (const char **in)
-{
- const char *inptr = *in;
- const char *start;
-
- decode_lwsp (&inptr);
- start = inptr;
-
- while (*inptr && *inptr != '=' && *inptr != ',')
- inptr++;
-
- if (inptr > start) {
- *in = inptr;
- return g_strndup (start, inptr - start);
- } else {
- return NULL;
- }
-}
-
-static char *
-decode_value (const char **in)
-{
- const char *inptr = *in;
-
- decode_lwsp (&inptr);
- if (*inptr == '"') {
- d(printf ("decoding quoted string token\n"));
- return decode_quoted_string (in);
- } else {
- d(printf ("decoding string token\n"));
- return decode_token (in);
- }
-}
-
-static GList *
-parse_param_list (const char *tokens)
-{
- GList *params = NULL;
- struct _param *param;
- const char *ptr;
-
- for (ptr = tokens; ptr && *ptr; ) {
- param = g_new0 (struct _param, 1);
- param->name = decode_token (&ptr);
- if (*ptr == '=') {
- ptr++;
- param->value = decode_value (&ptr);
- }
-
- params = g_list_prepend (params, param);
-
- if (*ptr == ',')
- ptr++;
- }
-
- return params;
-}
-
-static guint
-decode_data_type (DataType *dtype, const char *name)
-{
- int i;
-
- for (i = 0; dtype[i].name; i++) {
- if (!strcasecmp (dtype[i].name, name))
- break;
- }
-
- return dtype[i].type;
-}
-
-#define get_digest_arg(name) decode_data_type (digest_args, name)
-#define decode_qop(name) decode_data_type (qop_types, name)
-#define decode_cipher(name) decode_data_type (cipher_types, name)
-
-static const char *
-type_to_string (DataType *dtype, guint type)
-{
- int i;
-
- for (i = 0; dtype[i].name; i++) {
- if (dtype[i].type == type)
- break;
- }
-
- return dtype[i].name;
-}
-
-#define qop_to_string(type) type_to_string (qop_types, type)
-#define cipher_to_string(type) type_to_string (cipher_types, type)
-
-static void
-digest_abort (gboolean *have_type, gboolean *abort)
-{
- if (*have_type)
- *abort = TRUE;
- *have_type = TRUE;
-}
-
-static struct _DigestChallenge *
-parse_server_challenge (const char *tokens, gboolean *abort)
-{
- struct _DigestChallenge *challenge = NULL;
- GList *params, *p;
- const char *ptr;
-#ifdef PARANOID
- gboolean got_algorithm = FALSE;
- gboolean got_stale = FALSE;
- gboolean got_maxbuf = FALSE;
- gboolean got_charset = FALSE;
-#endif /* PARANOID */
-
- params = parse_param_list (tokens);
- if (!params) {
- *abort = TRUE;
- return NULL;
- }
-
- *abort = FALSE;
-
- challenge = g_new0 (struct _DigestChallenge, 1);
- challenge->realms = g_ptr_array_new ();
- challenge->maxbuf = 65536;
-
- for (p = params; p; p = p->next) {
- struct _param *param = p->data;
- int type;
-
- type = get_digest_arg (param->name);
- switch (type) {
- case DIGEST_REALM:
- for (ptr = param->value; ptr && *ptr; ) {
- char *token;
-
- token = decode_token (&ptr);
- if (token)
- g_ptr_array_add (challenge->realms, token);
-
- if (*ptr == ',')
- ptr++;
- }
- g_free (param->value);
- g_free (param->name);
- g_free (param);
- break;
- case DIGEST_NONCE:
- g_free (challenge->nonce);
- challenge->nonce = param->value;
- g_free (param->name);
- g_free (param);
- break;
- case DIGEST_QOP:
- for (ptr = param->value; ptr && *ptr; ) {
- char *token;
-
- token = decode_token (&ptr);
- if (token)
- challenge->qop |= decode_qop (token);
-
- if (*ptr == ',')
- ptr++;
- }
-
- if (challenge->qop & QOP_INVALID)
- challenge->qop = QOP_INVALID;
- g_free (param->value);
- g_free (param->name);
- g_free (param);
- break;
- case DIGEST_STALE:
- PARANOID (digest_abort (&got_stale, abort));
- if (!strcasecmp (param->value, "true"))
- challenge->stale = TRUE;
- else
- challenge->stale = FALSE;
- g_free (param->value);
- g_free (param->name);
- g_free (param);
- break;
- case DIGEST_MAXBUF:
- PARANOID (digest_abort (&got_maxbuf, abort));
- challenge->maxbuf = atoi (param->value);
- g_free (param->value);
- g_free (param->name);
- g_free (param);
- break;
- case DIGEST_CHARSET:
- PARANOID (digest_abort (&got_charset, abort));
- g_free (challenge->charset);
- if (param->value && *param->value)
- challenge->charset = param->value;
- else
- challenge->charset = NULL;
- g_free (param->name);
- g_free (param);
- break;
- case DIGEST_ALGORITHM:
- PARANOID (digest_abort (&got_algorithm, abort));
- g_free (challenge->algorithm);
- challenge->algorithm = param->value;
- g_free (param->name);
- g_free (param);
- break;
- case DIGEST_CIPHER:
- for (ptr = param->value; ptr && *ptr; ) {
- char *token;
-
- token = decode_token (&ptr);
- if (token)
- challenge->cipher |= decode_cipher (token);
-
- if (*ptr == ',')
- ptr++;
- }
- if (challenge->cipher & CIPHER_INVALID)
- challenge->cipher = CIPHER_INVALID;
- g_free (param->value);
- g_free (param->name);
- g_free (param);
- break;
- default:
- challenge->params = g_list_prepend (challenge->params, param);
- break;
- }
- }
-
- g_list_free (params);
-
- return challenge;
-}
-
-static void
-digest_hex (guchar *digest, guchar hex[33])
-{
- guchar *s, *p;
-
- /* lowercase hexify that bad-boy... */
- for (s = digest, p = hex; p < hex + 32; s++, p += 2)
- sprintf (p, "%.2x", *s);
-}
-
-static char *
-digest_uri_to_string (struct _DigestURI *uri)
-{
- if (uri->name)
- return g_strdup_printf ("%s/%s/%s", uri->type, uri->host, uri->name);
- else
- return g_strdup_printf ("%s/%s", uri->type, uri->host);
-}
-
-static void
-compute_response (struct _DigestResponse *resp, const char *passwd, gboolean client, guchar out[33])
-{
- guchar hex_a1[33], hex_a2[33];
- guchar digest[16];
- MD5Context ctx;
- char *buf;
-
- /* compute A1 */
- md5_init (&ctx);
- md5_update (&ctx, resp->username, strlen (resp->username));
- md5_update (&ctx, ":", 1);
- md5_update (&ctx, resp->realm, strlen (resp->realm));
- md5_update (&ctx, ":", 1);
- md5_update (&ctx, passwd, strlen (passwd));
- md5_final (&ctx, digest);
-
- md5_init (&ctx);
- md5_update (&ctx, digest, 16);
- md5_update (&ctx, ":", 1);
- md5_update (&ctx, resp->nonce, strlen (resp->nonce));
- md5_update (&ctx, ":", 1);
- md5_update (&ctx, resp->cnonce, strlen (resp->cnonce));
- if (resp->authzid) {
- md5_update (&ctx, ":", 1);
- md5_update (&ctx, resp->authzid, strlen (resp->authzid));
- }
-
- /* hexify A1 */
- md5_final (&ctx, digest);
- digest_hex (digest, hex_a1);
-
- /* compute A2 */
- md5_init (&ctx);
- if (client) {
- /* we are calculating the client response */
- md5_update (&ctx, "AUTHENTICATE:", strlen ("AUTHENTICATE:"));
- } else {
- /* we are calculating the server rspauth */
- md5_update (&ctx, ":", 1);
- }
-
- buf = digest_uri_to_string (resp->uri);
- md5_update (&ctx, buf, strlen (buf));
- g_free (buf);
-
- if (resp->qop == QOP_AUTH_INT || resp->qop == QOP_AUTH_CONF)
- md5_update (&ctx, ":00000000000000000000000000000000", 33);
-
- /* now hexify A2 */
- md5_final (&ctx, digest);
- digest_hex (digest, hex_a2);
-
- /* compute KD */
- md5_init (&ctx);
- md5_update (&ctx, hex_a1, 32);
- md5_update (&ctx, ":", 1);
- md5_update (&ctx, resp->nonce, strlen (resp->nonce));
- md5_update (&ctx, ":", 1);
- md5_update (&ctx, resp->nc, 8);
- md5_update (&ctx, ":", 1);
- md5_update (&ctx, resp->cnonce, strlen (resp->cnonce));
- md5_update (&ctx, ":", 1);
- md5_update (&ctx, qop_to_string (resp->qop), strlen (qop_to_string (resp->qop)));
- md5_update (&ctx, ":", 1);
- md5_update (&ctx, hex_a2, 32);
- md5_final (&ctx, digest);
-
- digest_hex (digest, out);
-}
-
-static struct _DigestResponse *
-generate_response (struct _DigestChallenge *challenge, struct hostent *host,
- const char *protocol, const char *user, const char *passwd)
-{
- struct _DigestResponse *resp;
- struct _DigestURI *uri;
- char *bgen, digest[16];
-
- resp = g_new0 (struct _DigestResponse, 1);
- resp->username = g_strdup (user);
- /* FIXME: we should use the preferred realm */
- if (challenge->realms && challenge->realms->len > 0)
- resp->realm = g_strdup (challenge->realms->pdata[0]);
- else
- resp->realm = g_strdup ("");
-
- resp->nonce = g_strdup (challenge->nonce);
-
- /* generate the cnonce */
- bgen = g_strdup_printf ("%p:%lu:%lu", resp,
- (unsigned long) getpid (),
- (unsigned long) time (0));
- md5_get_digest (bgen, strlen (bgen), digest);
- g_free (bgen);
- /* take our recommended 64 bits of entropy */
- resp->cnonce = camel_base64_encode_simple (digest, 8);
-
- /* we don't support re-auth so the nonce count is always 1 */
- strcpy (resp->nc, "00000001");
-
- /* choose the QOP */
- /* FIXME: choose - probably choose "auth" ??? */
- resp->qop = QOP_AUTH;
-
- /* create the URI */
- uri = g_new0 (struct _DigestURI, 1);
- uri->type = g_strdup (protocol);
- uri->host = g_strdup (host->h_name);
- uri->name = NULL;
- resp->uri = uri;
-
- /* charsets... yay */
- if (challenge->charset) {
- /* I believe that this is only ever allowed to be
- * UTF-8. We strdup the charset specified by the
- * challenge anyway, just in case it's not UTF-8.
- */
- resp->charset = g_strdup (challenge->charset);
- }
-
- resp->cipher = CIPHER_INVALID;
- if (resp->qop == QOP_AUTH_CONF) {
- /* FIXME: choose a cipher? */
- resp->cipher = CIPHER_INVALID;
- }
-
- /* we don't really care about this... */
- resp->authzid = NULL;
-
- compute_response (resp, passwd, TRUE, resp->resp);
-
- return resp;
-}
-
-static GByteArray *
-digest_response (struct _DigestResponse *resp)
-{
- GByteArray *buffer;
- const char *str;
- char *buf;
-
- buffer = g_byte_array_new ();
- g_byte_array_append (buffer, "username=\"", 10);
- if (resp->charset) {
- /* Encode the username using the requested charset */
- char *username, *outbuf;
- const char *charset;
- size_t len, outlen;
- const char *inbuf;
- iconv_t cd;
-
- charset = e_iconv_locale_charset ();
- if (!charset)
- charset = "iso-8859-1";
-
- cd = e_iconv_open (resp->charset, charset);
-
- len = strlen (resp->username);
- outlen = 2 * len; /* plenty of space */
-
- outbuf = username = g_malloc0 (outlen + 1);
- inbuf = resp->username;
- if (cd == (iconv_t) -1 || e_iconv (cd, &inbuf, &len, &outbuf, &outlen) == (size_t) -1) {
- /* We can't convert to UTF-8 - pretend we never got a charset param? */
- g_free (resp->charset);
- resp->charset = NULL;
-
- /* Set the username to the non-UTF-8 version */
- g_free (username);
- username = g_strdup (resp->username);
- }
-
- if (cd != (iconv_t) -1)
- e_iconv_close (cd);
-
- g_byte_array_append (buffer, username, strlen (username));
- g_free (username);
- } else {
- g_byte_array_append (buffer, resp->username, strlen (resp->username));
- }
-
- g_byte_array_append (buffer, "\",realm=\"", 9);
- g_byte_array_append (buffer, resp->realm, strlen (resp->realm));
-
- g_byte_array_append (buffer, "\",nonce=\"", 9);
- g_byte_array_append (buffer, resp->nonce, strlen (resp->nonce));
-
- g_byte_array_append (buffer, "\",cnonce=\"", 10);
- g_byte_array_append (buffer, resp->cnonce, strlen (resp->cnonce));
-
- g_byte_array_append (buffer, "\",nc=", 5);
- g_byte_array_append (buffer, resp->nc, 8);
-
- g_byte_array_append (buffer, ",qop=", 5);
- str = qop_to_string (resp->qop);
- g_byte_array_append (buffer, str, strlen (str));
-
- g_byte_array_append (buffer, ",digest-uri=\"", 13);
- buf = digest_uri_to_string (resp->uri);
- g_byte_array_append (buffer, buf, strlen (buf));
- g_free (buf);
-
- g_byte_array_append (buffer, "\",response=", 11);
- g_byte_array_append (buffer, resp->resp, 32);
-
- if (resp->maxbuf > 0) {
- g_byte_array_append (buffer, ",maxbuf=", 8);
- buf = g_strdup_printf ("%d", resp->maxbuf);
- g_byte_array_append (buffer, buf, strlen (buf));
- g_free (buf);
- }
-
- if (resp->charset) {
- g_byte_array_append (buffer, ",charset=", 9);
- g_byte_array_append (buffer, resp->charset, strlen (resp->charset));
- }
-
- if (resp->cipher != CIPHER_INVALID) {
- str = cipher_to_string (resp->cipher);
- if (str) {
- g_byte_array_append (buffer, ",cipher=\"", 9);
- g_byte_array_append (buffer, str, strlen (str));
- g_byte_array_append (buffer, "\"", 1);
- }
- }
-
- if (resp->authzid) {
- g_byte_array_append (buffer, ",authzid=\"", 10);
- g_byte_array_append (buffer, resp->authzid, strlen (resp->authzid));
- g_byte_array_append (buffer, "\"", 1);
- }
-
- return buffer;
-}
-
-static GByteArray *
-digest_md5_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
-{
- CamelSaslDigestMd5 *sasl_digest = CAMEL_SASL_DIGEST_MD5 (sasl);
- struct _CamelSaslDigestMd5Private *priv = sasl_digest->priv;
- struct _param *rspauth;
- GByteArray *ret = NULL;
- gboolean abort = FALSE;
- struct hostent *h;
- const char *ptr;
- guchar out[33];
- char *tokens;
-
- /* Need to wait for the server */
- if (!token)
- return NULL;
-
- g_return_val_if_fail (sasl->service->url->passwd != NULL, NULL);
-
- switch (priv->state) {
- case STATE_AUTH:
- if (token->len > 2048) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
- _("Server challenge too long (>2048 octets)\n"));
- return NULL;
- }
-
- tokens = g_strndup (token->data, token->len);
- priv->challenge = parse_server_challenge (tokens, &abort);
- g_free (tokens);
- if (!priv->challenge || abort) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
- _("Server challenge invalid\n"));
- return NULL;
- }
-
- if (priv->challenge->qop == QOP_INVALID) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
- _("Server challenge contained invalid "
- "\"Quality of Protection\" token\n"));
- return NULL;
- }
-
- h = camel_service_gethost (sasl->service, ex);
- priv->response = generate_response (priv->challenge, h, sasl->service_name,
- sasl->service->url->user,
- sasl->service->url->passwd);
- camel_free_host(h);
- ret = digest_response (priv->response);
-
- break;
- case STATE_FINAL:
- if (token->len)
- tokens = g_strndup (token->data, token->len);
- else
- tokens = NULL;
-
- if (!tokens || !*tokens) {
- g_free (tokens);
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
- _("Server response did not contain authorization data\n"));
- return NULL;
- }
-
- rspauth = g_new0 (struct _param, 1);
-
- ptr = tokens;
- rspauth->name = decode_token (&ptr);
- if (*ptr == '=') {
- ptr++;
- rspauth->value = decode_value (&ptr);
- }
- g_free (tokens);
-
- if (!rspauth->value) {
- g_free (rspauth->name);
- g_free (rspauth);
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
- _("Server response contained incomplete authorization data\n"));
- return NULL;
- }
-
- compute_response (priv->response, sasl->service->url->passwd, FALSE, out);
- if (memcmp (out, rspauth->value, 32) != 0) {
- g_free (rspauth->name);
- g_free (rspauth->value);
- g_free (rspauth);
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
- _("Server response does not match\n"));
- sasl->authenticated = TRUE;
-
- return NULL;
- }
-
- g_free (rspauth->name);
- g_free (rspauth->value);
- g_free (rspauth);
-
- ret = g_byte_array_new ();
-
- sasl->authenticated = TRUE;
- default:
- break;
- }
-
- priv->state++;
-
- return ret;
-}
diff --git a/camel/camel-sasl-digest-md5.h b/camel/camel-sasl-digest-md5.h
deleted file mode 100644
index b71abaa1df..0000000000
--- a/camel/camel-sasl-digest-md5.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2001 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef CAMEL_SASL_DIGEST_MD5_H
-#define CAMEL_SASL_DIGEST_MD5_H
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include <sys/types.h>
-#include <netdb.h>
-#include <camel/camel-sasl.h>
-
-#define CAMEL_SASL_DIGEST_MD5_TYPE (camel_sasl_digest_md5_get_type ())
-#define CAMEL_SASL_DIGEST_MD5(obj) (CAMEL_CHECK_CAST((obj), CAMEL_SASL_DIGEST_MD5_TYPE, CamelSaslDigestMd5))
-#define CAMEL_SASL_DIGEST_MD5_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_SASL_DIGEST_MD5_TYPE, CamelSaslDigestMd5Class))
-#define CAMEL_IS_SASL_DIGEST_MD5(o) (CAMEL_CHECK_TYPE((o), CAMEL_SASL_DIGEST_MD5_TYPE))
-
-typedef struct _CamelSaslDigestMd5 {
- CamelSasl parent_object;
- struct _CamelSaslDigestMd5Private *priv;
-
-} CamelSaslDigestMd5;
-
-
-typedef struct _CamelSaslDigestMd5Class {
- CamelSaslClass parent_class;
-
-} CamelSaslDigestMd5Class;
-
-
-/* Standard Camel function */
-CamelType camel_sasl_digest_md5_get_type (void);
-
-extern CamelServiceAuthType camel_sasl_digest_md5_authtype;
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_SASL_DIGEST_MD5_H */
diff --git a/camel/camel-sasl-gssapi.c b/camel/camel-sasl-gssapi.c
deleted file mode 100644
index 4f15c43821..0000000000
--- a/camel/camel-sasl-gssapi.c
+++ /dev/null
@@ -1,340 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef HAVE_KRB5
-
-#include <string.h>
-#include <com_err.h>
-#ifdef HAVE_MIT_KRB5
-#include <gssapi/gssapi.h>
-#include <gssapi/gssapi_generic.h>
-#else /* HAVE_HEIMDAL_KRB5 */
-#include <gssapi.h>
-#define gss_nt_service_name GSS_C_NT_HOSTBASED_SERVICE
-#endif
-#include <errno.h>
-
-#ifndef GSS_C_OID_KRBV5_DES
-#define GSS_C_OID_KRBV5_DES GSS_C_NO_OID
-#endif
-
-#include "camel-sasl-gssapi.h"
-
-CamelServiceAuthType camel_sasl_gssapi_authtype = {
- N_("GSSAPI"),
-
- N_("This option will connect to the server using "
- "Kerberos 5 authentication."),
-
- "GSSAPI",
- FALSE
-};
-
-enum {
- GSSAPI_STATE_INIT,
- GSSAPI_STATE_CONTINUE_NEEDED,
- GSSAPI_STATE_COMPLETE,
- GSSAPI_STATE_AUTHENTICATED
-};
-
-#define GSSAPI_SECURITY_LAYER_NONE (1 << 0)
-#define GSSAPI_SECURITY_LAYER_INTEGRITY (1 << 1)
-#define GSSAPI_SECURITY_LAYER_PRIVACY (1 << 2)
-
-#define DESIRED_SECURITY_LAYER GSSAPI_SECURITY_LAYER_NONE
-
-struct _CamelSaslGssapiPrivate {
- int state;
- gss_ctx_id_t ctx;
- gss_name_t target;
-};
-
-
-static GByteArray *gssapi_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex);
-
-
-static CamelSaslClass *parent_class = NULL;
-
-
-static void
-camel_sasl_gssapi_class_init (CamelSaslGssapiClass *klass)
-{
- CamelSaslClass *camel_sasl_class = CAMEL_SASL_CLASS (klass);
-
- parent_class = CAMEL_SASL_CLASS (camel_type_get_global_classfuncs (camel_sasl_get_type ()));
-
- /* virtual method overload */
- camel_sasl_class->challenge = gssapi_challenge;
-}
-
-static void
-camel_sasl_gssapi_init (gpointer object, gpointer klass)
-{
- CamelSaslGssapi *gssapi = CAMEL_SASL_GSSAPI (object);
-
- gssapi->priv = g_new (struct _CamelSaslGssapiPrivate, 1);
- gssapi->priv->state = GSSAPI_STATE_INIT;
- gssapi->priv->ctx = GSS_C_NO_CONTEXT;
- gssapi->priv->target = GSS_C_NO_NAME;
-}
-
-static void
-camel_sasl_gssapi_finalize (CamelObject *object)
-{
- CamelSaslGssapi *gssapi = CAMEL_SASL_GSSAPI (object);
- guint32 status;
-
- if (gssapi->priv->ctx != GSS_C_NO_CONTEXT)
- gss_delete_sec_context (&status, &gssapi->priv->ctx, GSS_C_NO_BUFFER);
-
- if (gssapi->priv->target != GSS_C_NO_NAME)
- gss_release_name (&status, &gssapi->priv->target);
-
- g_free (gssapi->priv);
-}
-
-
-CamelType
-camel_sasl_gssapi_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (
- camel_sasl_get_type (),
- "CamelSaslGssapi",
- sizeof (CamelSaslGssapi),
- sizeof (CamelSaslGssapiClass),
- (CamelObjectClassInitFunc) camel_sasl_gssapi_class_init,
- NULL,
- (CamelObjectInitFunc) camel_sasl_gssapi_init,
- (CamelObjectFinalizeFunc) camel_sasl_gssapi_finalize);
- }
-
- return type;
-}
-
-static void
-gssapi_set_exception (OM_uint32 major, OM_uint32 minor, CamelException *ex)
-{
- const char *str;
-
- switch (major) {
- case GSS_S_BAD_MECH:
- str = _("The specified mechanism is not supported by the "
- "provided credential, or is unrecognized by the "
- "implementation.");
- break;
- case GSS_S_BAD_NAME:
- str = _("The provided target_name parameter was ill-formed.");
- break;
- case GSS_S_BAD_NAMETYPE:
- str = _("The provided target_name parameter contained an "
- "invalid or unsupported type of name.");
- break;
- case GSS_S_BAD_BINDINGS:
- str = _("The input_token contains different channel "
- "bindings to those specified via the "
- "input_chan_bindings parameter.");
- break;
- case GSS_S_BAD_SIG:
- str = _("The input_token contains an invalid signature, or a "
- "signature that could not be verified.");
- break;
- case GSS_S_NO_CRED:
- str = _("The supplied credentials were not valid for context "
- "initiation, or the credential handle did not "
- "reference any credentials.");
- break;
- case GSS_S_NO_CONTEXT:
- str = _("The supplied context handle did not refer to a valid context.");
- break;
- case GSS_S_DEFECTIVE_TOKEN:
- str = _("The consistency checks performed on the input_token failed.");
- break;
- case GSS_S_DEFECTIVE_CREDENTIAL:
- str = _("The consistency checks performed on the credential failed.");
- break;
- case GSS_S_CREDENTIALS_EXPIRED:
- str = _("The referenced credentials have expired.");
- break;
- case GSS_S_FAILURE:
- str = error_message (minor);
- break;
- default:
- str = _("Bad authentication response from server.");
- }
-
- camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE, str);
-}
-
-static GByteArray *
-gssapi_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
-{
- struct _CamelSaslGssapiPrivate *priv = CAMEL_SASL_GSSAPI (sasl)->priv;
- OM_uint32 major, minor, flags, time;
- gss_buffer_desc inbuf, outbuf;
- GByteArray *challenge = NULL;
- gss_buffer_t input_token;
- struct hostent *h;
- int conf_state;
- gss_qop_t qop;
- gss_OID mech;
- char *str;
-
- switch (priv->state) {
- case GSSAPI_STATE_INIT:
- if (!(h = camel_service_gethost (sasl->service, ex))) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Failed to resolve host `%s': %s"),
- sasl->service->url->host, g_strerror (errno));
- return NULL;
- }
-
- str = g_strdup_printf ("%s@%s", sasl->service_name, h->h_name);
- camel_free_host (h);
-
- inbuf.value = str;
- inbuf.length = strlen (str);
- major = gss_import_name (&minor, &inbuf, gss_nt_service_name, &priv->target);
- g_free (str);
-
- if (major != GSS_S_COMPLETE) {
- gssapi_set_exception (major, minor, ex);
- return NULL;
- }
-
- input_token = GSS_C_NO_BUFFER;
-
- goto challenge;
- break;
- case GSSAPI_STATE_CONTINUE_NEEDED:
- if (token == NULL) {
- camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
- _("Bad authentication response from server."));
- return NULL;
- }
-
- inbuf.value = token->data;
- inbuf.length = token->len;
- input_token = &inbuf;
-
- challenge:
- major = gss_init_sec_context (&minor, GSS_C_NO_CREDENTIAL, &priv->ctx, priv->target,
- GSS_C_OID_KRBV5_DES, GSS_C_MUTUAL_FLAG |
- GSS_C_REPLAY_FLAG | GSS_C_SEQUENCE_FLAG,
- 0, GSS_C_NO_CHANNEL_BINDINGS,
- input_token, &mech, &outbuf, &flags, &time);
-
- switch (major) {
- case GSS_S_COMPLETE:
- priv->state = GSSAPI_STATE_COMPLETE;
- break;
- case GSS_S_CONTINUE_NEEDED:
- priv->state = GSSAPI_STATE_CONTINUE_NEEDED;
- break;
- default:
- gssapi_set_exception (major, minor, ex);
- return NULL;
- }
-
- challenge = g_byte_array_new ();
- g_byte_array_append (challenge, outbuf.value, outbuf.length);
-#ifndef HAVE_HEIMDAL_KRB5
- gss_release_buffer (&minor, &outbuf);
-#endif
- break;
- case GSSAPI_STATE_COMPLETE:
- if (token == NULL) {
- camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
- _("Bad authentication response from server."));
- return NULL;
- }
-
- inbuf.value = token->data;
- inbuf.length = token->len;
-
- major = gss_unwrap (&minor, priv->ctx, &inbuf, &outbuf, &conf_state, &qop);
- if (major != GSS_S_COMPLETE) {
- gssapi_set_exception (major, minor, ex);
- return NULL;
- }
-
- if (outbuf.length < 4) {
- camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
- _("Bad authentication response from server."));
-#ifndef HAVE_HEIMDAL_KRB5
- gss_release_buffer (&minor, &outbuf);
-#endif
- return NULL;
- }
-
- /* check that our desired security layer is supported */
- if ((((unsigned char *) outbuf.value)[0] & DESIRED_SECURITY_LAYER) != DESIRED_SECURITY_LAYER) {
- camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
- _("Unsupported security layer."));
- gss_release_buffer (&minor, &outbuf);
- return NULL;
- }
-
- inbuf.length = 4 + strlen (sasl->service->url->user);
- inbuf.value = str = g_malloc (inbuf.length);
- memcpy (inbuf.value, outbuf.value, 4);
- str[0] = DESIRED_SECURITY_LAYER;
- memcpy (str + 4, sasl->service->url->user, inbuf.length - 4);
-
-#ifndef HAVE_HEIMDAL_KRB5
- gss_release_buffer (&minor, &outbuf);
-#endif
-
- major = gss_wrap (&minor, priv->ctx, FALSE, qop, &inbuf, &conf_state, &outbuf);
- if (major != GSS_S_COMPLETE) {
- gssapi_set_exception (major, minor, ex);
- g_free (str);
- return NULL;
- }
-
- g_free (str);
- challenge = g_byte_array_new ();
- g_byte_array_append (challenge, outbuf.value, outbuf.length);
-
-#ifndef HAVE_HEIMDAL_KRB5
- gss_release_buffer (&minor, &outbuf);
-#endif
-
- priv->state = GSSAPI_STATE_AUTHENTICATED;
-
- sasl->authenticated = TRUE;
- break;
- default:
- return NULL;
- }
-
- return challenge;
-}
-
-#endif /* HAVE_KRB5 */
diff --git a/camel/camel-sasl-gssapi.h b/camel/camel-sasl-gssapi.h
deleted file mode 100644
index b4a3fbc1a5..0000000000
--- a/camel/camel-sasl-gssapi.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifndef __CAMEL_SASL_GSSAPI_H__
-#define __CAMEL_SASL_GSSAPI_H__
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <sys/types.h>
-#include <camel/camel-sasl.h>
-
-#define CAMEL_SASL_GSSAPI_TYPE (camel_sasl_gssapi_get_type ())
-#define CAMEL_SASL_GSSAPI(obj) (CAMEL_CHECK_CAST((obj), CAMEL_SASL_GSSAPI_TYPE, CamelSaslGssapi))
-#define CAMEL_SASL_GSSAPI_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_SASL_GSSAPI_TYPE, CamelSaslGssapiClass))
-#define CAMEL_IS_SASL_GSSAPI(o) (CAMEL_CHECK_TYPE((o), CAMEL_SASL_GSSAPI_TYPE))
-
-typedef struct _CamelSaslGssapi CamelSaslGssapi;
-typedef struct _CamelSaslGssapiClass CamelSaslGssapiClass;
-
-struct _CamelSaslGssapi {
- CamelSasl parent_object;
-
- struct _CamelSaslGssapiPrivate *priv;
-
-};
-
-struct _CamelSaslGssapiClass {
- CamelSaslClass parent_class;
-
-};
-
-/* Standard Camel function */
-CamelType camel_sasl_gssapi_get_type (void);
-
-extern CamelServiceAuthType camel_sasl_gssapi_authtype;
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __CAMEL_SASL_GSSAPI_H__ */
diff --git a/camel/camel-sasl-kerberos4.c b/camel/camel-sasl-kerberos4.c
deleted file mode 100644
index e225c1a26c..0000000000
--- a/camel/camel-sasl-kerberos4.c
+++ /dev/null
@@ -1,224 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2001 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef HAVE_KRB4
-
-#include <krb.h>
-/* MIT krb4 des.h #defines _. Sigh. We don't need it. #undef it here
- * so we get the gettexty _ definition later.
- */
-#undef _
-
-#include <string.h>
-#include "camel-string-utils.h"
-#include "camel-sasl-kerberos4.h"
-#include "camel-service.h"
-
-CamelServiceAuthType camel_sasl_kerberos4_authtype = {
- N_("Kerberos 4"),
-
- N_("This option will connect to the server using "
- "Kerberos 4 authentication."),
-
- "KERBEROS_V4",
- FALSE
-};
-
-#define KERBEROS_V4_PROTECTION_NONE 1
-#define KERBEROS_V4_PROTECTION_INTEGRITY 2
-#define KERBEROS_V4_PROTECTION_PRIVACY 4
-
-static CamelSaslClass *parent_class = NULL;
-
-/* Returns the class for a CamelSaslKerberos4 */
-#define CSK4_CLASS(so) CAMEL_SASL_KERBEROS4_CLASS (CAMEL_OBJECT_GET_CLASS (so))
-
-static GByteArray *krb4_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex);
-
-struct _CamelSaslKerberos4Private {
- int state;
-
- guint32 nonce_n;
- guint32 nonce_h;
-
- des_cblock session;
- des_key_schedule schedule;
-};
-
-static void
-camel_sasl_kerberos4_class_init (CamelSaslKerberos4Class *camel_sasl_kerberos4_class)
-{
- CamelSaslClass *camel_sasl_class = CAMEL_SASL_CLASS (camel_sasl_kerberos4_class);
-
- parent_class = CAMEL_SASL_CLASS (camel_type_get_global_classfuncs (camel_sasl_get_type ()));
-
- /* virtual method overload */
- camel_sasl_class->challenge = krb4_challenge;
-}
-
-static void
-camel_sasl_kerberos4_init (gpointer object, gpointer klass)
-{
- CamelSaslKerberos4 *sasl_krb4 = CAMEL_SASL_KERBEROS4 (object);
-
- sasl_krb4->priv = g_new0 (struct _CamelSaslKerberos4Private, 1);
-}
-
-static void
-camel_sasl_kerberos4_finalize (CamelObject *object)
-{
- CamelSaslKerberos4 *sasl = CAMEL_SASL_KERBEROS4 (object);
-
- if (sasl->priv) {
- memset (sasl->priv, 0, sizeof (sasl->priv));
- g_free (sasl->priv);
- }
-}
-
-
-CamelType
-camel_sasl_kerberos4_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_sasl_get_type (),
- "CamelSaslKerberos4",
- sizeof (CamelSaslKerberos4),
- sizeof (CamelSaslKerberos4Class),
- (CamelObjectClassInitFunc) camel_sasl_kerberos4_class_init,
- NULL,
- (CamelObjectInitFunc) camel_sasl_kerberos4_init,
- (CamelObjectFinalizeFunc) camel_sasl_kerberos4_finalize);
- }
-
- return type;
-}
-
-static GByteArray *
-krb4_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
-{
- struct _CamelSaslKerberos4Private *priv = CAMEL_SASL_KERBEROS4 (sasl)->priv;
- GByteArray *ret = NULL;
- char *inst, *realm, *username;
- struct hostent *h;
- int status, len;
- KTEXT_ST authenticator;
- CREDENTIALS credentials;
- guint32 plus1;
-
- /* Need to wait for the server */
- if (!token)
- return NULL;
-
- switch (priv->state) {
- case 0:
- if (token->len != 4)
- goto lose;
-
- memcpy (&priv->nonce_n, token->data, 4);
- priv->nonce_h = ntohl (priv->nonce_n);
-
- /* Our response is an authenticator including that number. */
- h = camel_service_gethost (sasl->service, ex);
- inst = g_strndup (h->h_name, strcspn (h->h_name, "."));
- camel_strdown (inst);
- realm = g_strdup (krb_realmofhost (h->h_name));
- camel_free_host(h);
- status = krb_mk_req (&authenticator, sasl->service_name, inst, realm, priv->nonce_h);
- if (status == KSUCCESS) {
- status = krb_get_cred (sasl->service_name, inst, realm, &credentials);
- memcpy (priv->session, credentials.session, sizeof (priv->session));
- memset (&credentials, 0, sizeof (credentials));
- }
- g_free (inst);
- g_free (realm);
-
- if (status != KSUCCESS) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
- _("Could not get Kerberos ticket:\n%s"),
- krb_err_txt[status]);
- goto lose;
- }
- des_key_sched (&priv->session, priv->schedule);
-
- ret = g_byte_array_new ();
- g_byte_array_append (ret, (const guint8 *)authenticator.dat, authenticator.length);
- break;
-
- case 1:
- if (token->len != 8)
- goto lose;
-
- /* This one is encrypted. */
- des_ecb_encrypt ((des_cblock *)token->data, (des_cblock *)token->data, priv->schedule, 0);
-
- /* Check that the returned value is the original nonce plus one. */
- memcpy (&plus1, token->data, 4);
- if (ntohl (plus1) != priv->nonce_h + 1)
- goto lose;
-
- /* "the fifth octet contain[s] a bit-mask specifying the
- * protection mechanisms supported by the server"
- */
- if (!(token->data[4] & KERBEROS_V4_PROTECTION_NONE)) {
- g_warning ("Server does not support `no protection' :-(");
- goto lose;
- }
-
- username = sasl->service->url->user;
- len = strlen (username) + 9;
- len += 8 - len % 8;
- ret = g_byte_array_new ();
- g_byte_array_set_size (ret, len);
- memset (ret->data, 0, len);
- memcpy (ret->data, &priv->nonce_n, 4);
- ret->data[4] = KERBEROS_V4_PROTECTION_NONE;
- ret->data[5] = ret->data[6] = ret->data[7] = 0;
- strcpy (ret->data + 8, username);
-
- des_pcbc_encrypt ((void *)ret->data, (void *)ret->data, len,
- priv->schedule, &priv->session, 1);
- memset (&priv->session, 0, sizeof (priv->session));
-
- sasl->authenticated = TRUE;
- break;
- }
-
- priv->state++;
- return ret;
-
- lose:
- memset (&priv->session, 0, sizeof (priv->session));
-
- if (!camel_exception_is_set (ex)) {
- camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
- _("Bad authentication response from server."));
- }
- return NULL;
-}
-
-#endif /* HAVE_KRB4 */
diff --git a/camel/camel-sasl-kerberos4.h b/camel/camel-sasl-kerberos4.h
deleted file mode 100644
index d807fc70bc..0000000000
--- a/camel/camel-sasl-kerberos4.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2001 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef CAMEL_SASL_KERBEROS4_H
-#define CAMEL_SASL_KERBEROS4_H
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <sys/types.h>
-#include <netdb.h>
-#include <camel/camel-sasl.h>
-
-#define CAMEL_SASL_KERBEROS4_TYPE (camel_sasl_kerberos4_get_type ())
-#define CAMEL_SASL_KERBEROS4(obj) (CAMEL_CHECK_CAST((obj), CAMEL_SASL_KERBEROS4_TYPE, CamelSaslKerberos4))
-#define CAMEL_SASL_KERBEROS4_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_SASL_KERBEROS4_TYPE, CamelSaslKerberos4Class))
-#define CAMEL_IS_SASL_KERBEROS4(o) (CAMEL_CHECK_TYPE((o), CAMEL_SASL_KERBEROS4_TYPE))
-
-typedef struct _CamelSaslKerberos4 {
- CamelSasl parent_object;
- struct _CamelSaslKerberos4Private *priv;
-
-} CamelSaslKerberos4;
-
-
-typedef struct _CamelSaslKerberos4Class {
- CamelSaslClass parent_class;
-
-} CamelSaslKerberos4Class;
-
-
-/* Standard Camel function */
-CamelType camel_sasl_kerberos4_get_type (void);
-
-extern CamelServiceAuthType camel_sasl_kerberos4_authtype;
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_SASL_KERBEROS4_H */
diff --git a/camel/camel-sasl-login.c b/camel/camel-sasl-login.c
deleted file mode 100644
index f6c3c9e5f8..0000000000
--- a/camel/camel-sasl-login.c
+++ /dev/null
@@ -1,134 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2001 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-#include "camel-sasl-login.h"
-#include "camel-service.h"
-
-CamelServiceAuthType camel_sasl_login_authtype = {
- N_("Login"),
-
- N_("This option will connect to the server using a "
- "simple password."),
-
- "LOGIN",
- TRUE
-};
-
-enum {
- LOGIN_USER,
- LOGIN_PASSWD
-};
-
-static CamelSaslClass *parent_class = NULL;
-
-/* Returns the class for a CamelSaslLogin */
-#define CSP_CLASS(so) CAMEL_SASL_LOGIN_CLASS (CAMEL_OBJECT_GET_CLASS (so))
-
-static GByteArray *login_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex);
-
-struct _CamelSaslLoginPrivate {
- int state;
-};
-
-static void
-camel_sasl_login_class_init (CamelSaslLoginClass *camel_sasl_login_class)
-{
- CamelSaslClass *camel_sasl_class = CAMEL_SASL_CLASS (camel_sasl_login_class);
-
- parent_class = CAMEL_SASL_CLASS (camel_type_get_global_classfuncs (camel_sasl_get_type ()));
-
- /* virtual method overload */
- camel_sasl_class->challenge = login_challenge;
-}
-
-static void
-camel_sasl_login_init (gpointer object, gpointer klass)
-{
- CamelSaslLogin *sasl_login = CAMEL_SASL_LOGIN (object);
-
- sasl_login->priv = g_new0 (struct _CamelSaslLoginPrivate, 1);
-}
-
-static void
-camel_sasl_login_finalize (CamelObject *object)
-{
- CamelSaslLogin *sasl = CAMEL_SASL_LOGIN (object);
-
- g_free (sasl->priv);
-}
-
-
-CamelType
-camel_sasl_login_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_sasl_get_type (),
- "CamelSaslLogin",
- sizeof (CamelSaslLogin),
- sizeof (CamelSaslLoginClass),
- (CamelObjectClassInitFunc) camel_sasl_login_class_init,
- NULL,
- (CamelObjectInitFunc) camel_sasl_login_init,
- (CamelObjectFinalizeFunc) camel_sasl_login_finalize);
- }
-
- return type;
-}
-
-static GByteArray *
-login_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
-{
- struct _CamelSaslLoginPrivate *priv = CAMEL_SASL_LOGIN (sasl)->priv;
- GByteArray *buf = NULL;
- CamelURL *url = sasl->service->url;
-
- g_return_val_if_fail (url->passwd != NULL, NULL);
-
- switch (priv->state) {
- case LOGIN_USER:
- buf = g_byte_array_new ();
- g_byte_array_append (buf, url->user, strlen (url->user));
- break;
- case LOGIN_PASSWD:
- buf = g_byte_array_new ();
- g_byte_array_append (buf, url->passwd, strlen (url->passwd));
-
- sasl->authenticated = TRUE;
- break;
- default:
- if (!camel_exception_is_set (ex)) {
- camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
- _("Unknown authentication state."));
- }
- }
-
- priv->state++;
-
- return buf;
-}
diff --git a/camel/camel-sasl-login.h b/camel/camel-sasl-login.h
deleted file mode 100644
index dffa657202..0000000000
--- a/camel/camel-sasl-login.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2001 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef CAMEL_SASL_LOGIN_H
-#define CAMEL_SASL_LOGIN_H
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include <camel/camel-sasl.h>
-
-#define CAMEL_SASL_LOGIN_TYPE (camel_sasl_login_get_type ())
-#define CAMEL_SASL_LOGIN(obj) (CAMEL_CHECK_CAST((obj), CAMEL_SASL_LOGIN_TYPE, CamelSaslLogin))
-#define CAMEL_SASL_LOGIN_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_SASL_LOGIN_TYPE, CamelSaslLoginClass))
-#define CAMEL_IS_SASL_LOGIN(o) (CAMEL_CHECK_TYPE((o), CAMEL_SASL_LOGIN_TYPE))
-
-typedef struct _CamelSaslLogin {
- CamelSasl parent_object;
-
- struct _CamelSaslLoginPrivate *priv;
-
-} CamelSaslLogin;
-
-
-typedef struct _CamelSaslLoginClass {
- CamelSaslClass parent_class;
-
-} CamelSaslLoginClass;
-
-
-/* Standard Camel function */
-CamelType camel_sasl_login_get_type (void);
-
-extern CamelServiceAuthType camel_sasl_login_authtype;
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_SASL_LOGIN_H */
diff --git a/camel/camel-sasl-ntlm.c b/camel/camel-sasl-ntlm.c
deleted file mode 100644
index ad341353c4..0000000000
--- a/camel/camel-sasl-ntlm.c
+++ /dev/null
@@ -1,706 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright 2002 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "camel-sasl-ntlm.h"
-
-#include <ctype.h>
-#include <string.h>
-
-CamelServiceAuthType camel_sasl_ntlm_authtype = {
- N_("NTLM / SPA"),
-
- N_("This option will connect to a Windows-based server using "
- "NTLM / Secure Password Authentication."),
-
- "NTLM",
- TRUE
-};
-
-static CamelSaslClass *parent_class = NULL;
-
-static GByteArray *ntlm_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex);
-
-static void
-camel_sasl_ntlm_class_init (CamelSaslNTLMClass *camel_sasl_ntlm_class)
-{
- CamelSaslClass *camel_sasl_class = CAMEL_SASL_CLASS (camel_sasl_ntlm_class);
-
- parent_class = CAMEL_SASL_CLASS (camel_type_get_global_classfuncs (camel_sasl_get_type ()));
-
- /* virtual method overload */
- camel_sasl_class->challenge = ntlm_challenge;
-}
-
-CamelType
-camel_sasl_ntlm_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (
- camel_sasl_get_type (), "CamelSaslNTLM",
- sizeof (CamelSaslNTLM),
- sizeof (CamelSaslNTLMClass),
- (CamelObjectClassInitFunc) camel_sasl_ntlm_class_init,
- NULL, NULL, NULL);
- }
-
- return type;
-}
-
-#define NTLM_REQUEST "NTLMSSP\x00\x01\x00\x00\x00\x06\x82\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x30\x00\x00\x00\x00\x00\x00\x00\x30\x00\x00\x00"
-
-#define NTLM_CHALLENGE_NONCE_OFFSET 24
-#define NTLM_CHALLENGE_DOMAIN_OFFSET 48
-#define NTLM_CHALLENGE_DOMAIN_LEN_OFFSET 44
-
-#define NTLM_RESPONSE_HEADER "NTLMSSP\x00\x03\x00\x00\x00"
-#define NTLM_RESPONSE_FLAGS "\x82\x01"
-#define NTLM_RESPONSE_BASE_SIZE 64
-#define NTLM_RESPONSE_LM_RESP_OFFSET 12
-#define NTLM_RESPONSE_NT_RESP_OFFSET 20
-#define NTLM_RESPONSE_DOMAIN_OFFSET 28
-#define NTLM_RESPONSE_USER_OFFSET 36
-#define NTLM_RESPONSE_HOST_OFFSET 44
-#define NTLM_RESPONSE_FLAGS_OFFSET 60
-
-static void ntlm_calc_response (const guchar key[21],
- const guchar plaintext[8],
- guchar results[24]);
-static void ntlm_lanmanager_hash (const char *password, char hash[21]);
-static void ntlm_nt_hash (const char *password, char hash[21]);
-static void ntlm_set_string (GByteArray *ba, int offset,
- const char *data, int len);
-
-static GByteArray *
-ntlm_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
-{
- GByteArray *ret;
- guchar nonce[8], hash[21], lm_resp[24], nt_resp[24];
-
- ret = g_byte_array_new ();
-
- if (!token || !token->len) {
- g_byte_array_append (ret, NTLM_REQUEST,
- sizeof (NTLM_REQUEST) - 1);
- return ret;
- }
-
- memcpy (nonce, token->data + NTLM_CHALLENGE_NONCE_OFFSET, 8);
- ntlm_lanmanager_hash (sasl->service->url->passwd, hash);
- ntlm_calc_response (hash, nonce, lm_resp);
- ntlm_nt_hash (sasl->service->url->passwd, hash);
- ntlm_calc_response (hash, nonce, nt_resp);
-
- ret = g_byte_array_new ();
- g_byte_array_set_size (ret, NTLM_RESPONSE_BASE_SIZE);
- memset (ret->data, 0, NTLM_RESPONSE_BASE_SIZE);
- memcpy (ret->data, NTLM_RESPONSE_HEADER,
- sizeof (NTLM_RESPONSE_HEADER) - 1);
- memcpy (ret->data + NTLM_RESPONSE_FLAGS_OFFSET,
- NTLM_RESPONSE_FLAGS, sizeof (NTLM_RESPONSE_FLAGS) - 1);
-
- ntlm_set_string (ret, NTLM_RESPONSE_DOMAIN_OFFSET,
- token->data + NTLM_CHALLENGE_DOMAIN_OFFSET,
- atoi (token->data + NTLM_CHALLENGE_DOMAIN_LEN_OFFSET));
- ntlm_set_string (ret, NTLM_RESPONSE_USER_OFFSET,
- sasl->service->url->user,
- strlen (sasl->service->url->user));
- ntlm_set_string (ret, NTLM_RESPONSE_HOST_OFFSET,
- "UNKNOWN", sizeof ("UNKNOWN") - 1);
- ntlm_set_string (ret, NTLM_RESPONSE_LM_RESP_OFFSET,
- lm_resp, sizeof (lm_resp));
- ntlm_set_string (ret, NTLM_RESPONSE_NT_RESP_OFFSET,
- nt_resp, sizeof (nt_resp));
-
- sasl->authenticated = TRUE;
- return ret;
-}
-
-/* MD4 */
-static void md4sum (const unsigned char *in,
- int nbytes,
- unsigned char digest[16]);
-
-/* DES */
-typedef unsigned long DES_KS[16][2]; /* Single-key DES key schedule */
-
-static void deskey (DES_KS, unsigned char *, int);
-
-static void des (DES_KS, unsigned char *);
-
-static void setup_schedule (const guchar *key_56, DES_KS ks);
-
-
-
-#define LM_PASSWORD_MAGIC "\x4B\x47\x53\x21\x40\x23\x24\x25" \
- "\x4B\x47\x53\x21\x40\x23\x24\x25" \
- "\x00\x00\x00\x00\x00"
-
-static void
-ntlm_lanmanager_hash (const char *password, char hash[21])
-{
- guchar lm_password [15];
- DES_KS ks;
- int i;
-
- for (i = 0; i < 14 && password [i]; i++)
- lm_password [i] = toupper ((unsigned char) password [i]);
-
- for (; i < 15; i++)
- lm_password [i] = '\0';
-
- memcpy (hash, LM_PASSWORD_MAGIC, 21);
-
- setup_schedule (lm_password, ks);
- des (ks, hash);
-
- setup_schedule (lm_password + 7, ks);
- des (ks, hash + 8);
-}
-
-static void
-ntlm_nt_hash (const char *password, char hash[21])
-{
- unsigned char *buf, *p;
-
- p = buf = g_malloc (strlen (password) * 2);
-
- while (*password) {
- *p++ = *password++;
- *p++ = '\0';
- }
-
- md4sum (buf, p - buf, hash);
- memset (hash + 16, 0, 5);
-
- g_free (buf);
-}
-
-static void
-ntlm_set_string (GByteArray *ba, int offset, const char *data, int len)
-{
- ba->data[offset ] = ba->data[offset + 2] = len & 0xFF;
- ba->data[offset + 1] = ba->data[offset + 3] = (len >> 8) & 0xFF;
- ba->data[offset + 4] = ba->len & 0xFF;
- ba->data[offset + 5] = (ba->len >> 8) & 0xFF;
- g_byte_array_append (ba, data, len);
-}
-
-
-#define KEYBITS(k,s) \
- (((k[(s)/8] << ((s)%8)) & 0xFF) | (k[(s)/8+1] >> (8-(s)%8)))
-
-/* DES utils */
-/* Set up a key schedule based on a 56bit key */
-static void
-setup_schedule (const guchar *key_56, DES_KS ks)
-{
- guchar key[8];
- int i, c, bit;
-
- for (i = 0; i < 8; i++) {
- key [i] = KEYBITS (key_56, i * 7);
-
- /* Fix parity */
- for (c = bit = 0; bit < 8; bit++)
- if (key [i] & (1 << bit))
- c++;
- if (!(c & 1))
- key [i] ^= 0x01;
- }
-
- deskey (ks, key, 0);
-}
-
-static void
-ntlm_calc_response (const guchar key[21], const guchar plaintext[8],
- guchar results[24])
-{
- DES_KS ks;
-
- memcpy (results, plaintext, 8);
- memcpy (results + 8, plaintext, 8);
- memcpy (results + 16, plaintext, 8);
-
- setup_schedule (key, ks);
- des (ks, results);
-
- setup_schedule (key + 7, ks);
- des (ks, results + 8);
-
- setup_schedule (key + 14, ks);
- des (ks, results + 16);
-}
-
-
-/*
- * MD4 encoder. (The one everyone else uses is not GPL-compatible;
- * this is a reimplementation from spec.) This doesn't need to be
- * efficient for our purposes, although it would be nice to fix
- * it to not malloc()...
- */
-
-#define F(X,Y,Z) ( ((X)&(Y)) | ((~(X))&(Z)) )
-#define G(X,Y,Z) ( ((X)&(Y)) | ((X)&(Z)) | ((Y)&(Z)) )
-#define H(X,Y,Z) ( (X)^(Y)^(Z) )
-#define ROT(val, n) ( ((val) << (n)) | ((val) >> (32 - (n))) )
-
-static void
-md4sum (const unsigned char *in, int nbytes, unsigned char digest[16])
-{
- unsigned char *M;
- guint32 A, B, C, D, AA, BB, CC, DD, X[16];
- int pbytes, nbits = nbytes * 8, i, j;
-
- pbytes = (120 - (nbytes % 64)) % 64;
- M = alloca (nbytes + pbytes + 8);
- memcpy (M, in, nbytes);
- memset (M + nbytes, 0, pbytes + 8);
- M[nbytes] = 0x80;
- M[nbytes + pbytes] = nbits & 0xFF;
- M[nbytes + pbytes + 1] = (nbits >> 8) & 0xFF;
- M[nbytes + pbytes + 2] = (nbits >> 16) & 0xFF;
- M[nbytes + pbytes + 3] = (nbits >> 24) & 0xFF;
-
- A = 0x67452301;
- B = 0xEFCDAB89;
- C = 0x98BADCFE;
- D = 0x10325476;
-
- for (i = 0; i < nbytes + pbytes + 8; i += 64) {
- for (j = 0; j < 16; j++) {
- X[j] = (M[i + j*4]) |
- (M[i + j*4 + 1] << 8) |
- (M[i + j*4 + 2] << 16) |
- (M[i + j*4 + 3] << 24);
- }
-
- AA = A;
- BB = B;
- CC = C;
- DD = D;
-
- A = ROT (A + F(B, C, D) + X[0], 3);
- D = ROT (D + F(A, B, C) + X[1], 7);
- C = ROT (C + F(D, A, B) + X[2], 11);
- B = ROT (B + F(C, D, A) + X[3], 19);
- A = ROT (A + F(B, C, D) + X[4], 3);
- D = ROT (D + F(A, B, C) + X[5], 7);
- C = ROT (C + F(D, A, B) + X[6], 11);
- B = ROT (B + F(C, D, A) + X[7], 19);
- A = ROT (A + F(B, C, D) + X[8], 3);
- D = ROT (D + F(A, B, C) + X[9], 7);
- C = ROT (C + F(D, A, B) + X[10], 11);
- B = ROT (B + F(C, D, A) + X[11], 19);
- A = ROT (A + F(B, C, D) + X[12], 3);
- D = ROT (D + F(A, B, C) + X[13], 7);
- C = ROT (C + F(D, A, B) + X[14], 11);
- B = ROT (B + F(C, D, A) + X[15], 19);
-
- A = ROT (A + G(B, C, D) + X[0] + 0x5A827999, 3);
- D = ROT (D + G(A, B, C) + X[4] + 0x5A827999, 5);
- C = ROT (C + G(D, A, B) + X[8] + 0x5A827999, 9);
- B = ROT (B + G(C, D, A) + X[12] + 0x5A827999, 13);
- A = ROT (A + G(B, C, D) + X[1] + 0x5A827999, 3);
- D = ROT (D + G(A, B, C) + X[5] + 0x5A827999, 5);
- C = ROT (C + G(D, A, B) + X[9] + 0x5A827999, 9);
- B = ROT (B + G(C, D, A) + X[13] + 0x5A827999, 13);
- A = ROT (A + G(B, C, D) + X[2] + 0x5A827999, 3);
- D = ROT (D + G(A, B, C) + X[6] + 0x5A827999, 5);
- C = ROT (C + G(D, A, B) + X[10] + 0x5A827999, 9);
- B = ROT (B + G(C, D, A) + X[14] + 0x5A827999, 13);
- A = ROT (A + G(B, C, D) + X[3] + 0x5A827999, 3);
- D = ROT (D + G(A, B, C) + X[7] + 0x5A827999, 5);
- C = ROT (C + G(D, A, B) + X[11] + 0x5A827999, 9);
- B = ROT (B + G(C, D, A) + X[15] + 0x5A827999, 13);
-
- A = ROT (A + H(B, C, D) + X[0] + 0x6ED9EBA1, 3);
- D = ROT (D + H(A, B, C) + X[8] + 0x6ED9EBA1, 9);
- C = ROT (C + H(D, A, B) + X[4] + 0x6ED9EBA1, 11);
- B = ROT (B + H(C, D, A) + X[12] + 0x6ED9EBA1, 15);
- A = ROT (A + H(B, C, D) + X[2] + 0x6ED9EBA1, 3);
- D = ROT (D + H(A, B, C) + X[10] + 0x6ED9EBA1, 9);
- C = ROT (C + H(D, A, B) + X[6] + 0x6ED9EBA1, 11);
- B = ROT (B + H(C, D, A) + X[14] + 0x6ED9EBA1, 15);
- A = ROT (A + H(B, C, D) + X[1] + 0x6ED9EBA1, 3);
- D = ROT (D + H(A, B, C) + X[9] + 0x6ED9EBA1, 9);
- C = ROT (C + H(D, A, B) + X[5] + 0x6ED9EBA1, 11);
- B = ROT (B + H(C, D, A) + X[13] + 0x6ED9EBA1, 15);
- A = ROT (A + H(B, C, D) + X[3] + 0x6ED9EBA1, 3);
- D = ROT (D + H(A, B, C) + X[11] + 0x6ED9EBA1, 9);
- C = ROT (C + H(D, A, B) + X[7] + 0x6ED9EBA1, 11);
- B = ROT (B + H(C, D, A) + X[15] + 0x6ED9EBA1, 15);
-
- A += AA;
- B += BB;
- C += CC;
- D += DD;
- }
-
- digest[0] = A & 0xFF;
- digest[1] = (A >> 8) & 0xFF;
- digest[2] = (A >> 16) & 0xFF;
- digest[3] = (A >> 24) & 0xFF;
- digest[4] = B & 0xFF;
- digest[5] = (B >> 8) & 0xFF;
- digest[6] = (B >> 16) & 0xFF;
- digest[7] = (B >> 24) & 0xFF;
- digest[8] = C & 0xFF;
- digest[9] = (C >> 8) & 0xFF;
- digest[10] = (C >> 16) & 0xFF;
- digest[11] = (C >> 24) & 0xFF;
- digest[12] = D & 0xFF;
- digest[13] = (D >> 8) & 0xFF;
- digest[14] = (D >> 16) & 0xFF;
- digest[15] = (D >> 24) & 0xFF;
-}
-
-
-/* Public domain DES implementation from Phil Karn */
-static unsigned long Spbox[8][64] = {
- { 0x01010400, 0x00000000, 0x00010000, 0x01010404,
- 0x01010004, 0x00010404, 0x00000004, 0x00010000,
- 0x00000400, 0x01010400, 0x01010404, 0x00000400,
- 0x01000404, 0x01010004, 0x01000000, 0x00000004,
- 0x00000404, 0x01000400, 0x01000400, 0x00010400,
- 0x00010400, 0x01010000, 0x01010000, 0x01000404,
- 0x00010004, 0x01000004, 0x01000004, 0x00010004,
- 0x00000000, 0x00000404, 0x00010404, 0x01000000,
- 0x00010000, 0x01010404, 0x00000004, 0x01010000,
- 0x01010400, 0x01000000, 0x01000000, 0x00000400,
- 0x01010004, 0x00010000, 0x00010400, 0x01000004,
- 0x00000400, 0x00000004, 0x01000404, 0x00010404,
- 0x01010404, 0x00010004, 0x01010000, 0x01000404,
- 0x01000004, 0x00000404, 0x00010404, 0x01010400,
- 0x00000404, 0x01000400, 0x01000400, 0x00000000,
- 0x00010004, 0x00010400, 0x00000000, 0x01010004 },
- { 0x80108020, 0x80008000, 0x00008000, 0x00108020,
- 0x00100000, 0x00000020, 0x80100020, 0x80008020,
- 0x80000020, 0x80108020, 0x80108000, 0x80000000,
- 0x80008000, 0x00100000, 0x00000020, 0x80100020,
- 0x00108000, 0x00100020, 0x80008020, 0x00000000,
- 0x80000000, 0x00008000, 0x00108020, 0x80100000,
- 0x00100020, 0x80000020, 0x00000000, 0x00108000,
- 0x00008020, 0x80108000, 0x80100000, 0x00008020,
- 0x00000000, 0x00108020, 0x80100020, 0x00100000,
- 0x80008020, 0x80100000, 0x80108000, 0x00008000,
- 0x80100000, 0x80008000, 0x00000020, 0x80108020,
- 0x00108020, 0x00000020, 0x00008000, 0x80000000,
- 0x00008020, 0x80108000, 0x00100000, 0x80000020,
- 0x00100020, 0x80008020, 0x80000020, 0x00100020,
- 0x00108000, 0x00000000, 0x80008000, 0x00008020,
- 0x80000000, 0x80100020, 0x80108020, 0x00108000 },
- { 0x00000208, 0x08020200, 0x00000000, 0x08020008,
- 0x08000200, 0x00000000, 0x00020208, 0x08000200,
- 0x00020008, 0x08000008, 0x08000008, 0x00020000,
- 0x08020208, 0x00020008, 0x08020000, 0x00000208,
- 0x08000000, 0x00000008, 0x08020200, 0x00000200,
- 0x00020200, 0x08020000, 0x08020008, 0x00020208,
- 0x08000208, 0x00020200, 0x00020000, 0x08000208,
- 0x00000008, 0x08020208, 0x00000200, 0x08000000,
- 0x08020200, 0x08000000, 0x00020008, 0x00000208,
- 0x00020000, 0x08020200, 0x08000200, 0x00000000,
- 0x00000200, 0x00020008, 0x08020208, 0x08000200,
- 0x08000008, 0x00000200, 0x00000000, 0x08020008,
- 0x08000208, 0x00020000, 0x08000000, 0x08020208,
- 0x00000008, 0x00020208, 0x00020200, 0x08000008,
- 0x08020000, 0x08000208, 0x00000208, 0x08020000,
- 0x00020208, 0x00000008, 0x08020008, 0x00020200 },
- { 0x00802001, 0x00002081, 0x00002081, 0x00000080,
- 0x00802080, 0x00800081, 0x00800001, 0x00002001,
- 0x00000000, 0x00802000, 0x00802000, 0x00802081,
- 0x00000081, 0x00000000, 0x00800080, 0x00800001,
- 0x00000001, 0x00002000, 0x00800000, 0x00802001,
- 0x00000080, 0x00800000, 0x00002001, 0x00002080,
- 0x00800081, 0x00000001, 0x00002080, 0x00800080,
- 0x00002000, 0x00802080, 0x00802081, 0x00000081,
- 0x00800080, 0x00800001, 0x00802000, 0x00802081,
- 0x00000081, 0x00000000, 0x00000000, 0x00802000,
- 0x00002080, 0x00800080, 0x00800081, 0x00000001,
- 0x00802001, 0x00002081, 0x00002081, 0x00000080,
- 0x00802081, 0x00000081, 0x00000001, 0x00002000,
- 0x00800001, 0x00002001, 0x00802080, 0x00800081,
- 0x00002001, 0x00002080, 0x00800000, 0x00802001,
- 0x00000080, 0x00800000, 0x00002000, 0x00802080 },
- { 0x00000100, 0x02080100, 0x02080000, 0x42000100,
- 0x00080000, 0x00000100, 0x40000000, 0x02080000,
- 0x40080100, 0x00080000, 0x02000100, 0x40080100,
- 0x42000100, 0x42080000, 0x00080100, 0x40000000,
- 0x02000000, 0x40080000, 0x40080000, 0x00000000,
- 0x40000100, 0x42080100, 0x42080100, 0x02000100,
- 0x42080000, 0x40000100, 0x00000000, 0x42000000,
- 0x02080100, 0x02000000, 0x42000000, 0x00080100,
- 0x00080000, 0x42000100, 0x00000100, 0x02000000,
- 0x40000000, 0x02080000, 0x42000100, 0x40080100,
- 0x02000100, 0x40000000, 0x42080000, 0x02080100,
- 0x40080100, 0x00000100, 0x02000000, 0x42080000,
- 0x42080100, 0x00080100, 0x42000000, 0x42080100,
- 0x02080000, 0x00000000, 0x40080000, 0x42000000,
- 0x00080100, 0x02000100, 0x40000100, 0x00080000,
- 0x00000000, 0x40080000, 0x02080100, 0x40000100 },
- { 0x20000010, 0x20400000, 0x00004000, 0x20404010,
- 0x20400000, 0x00000010, 0x20404010, 0x00400000,
- 0x20004000, 0x00404010, 0x00400000, 0x20000010,
- 0x00400010, 0x20004000, 0x20000000, 0x00004010,
- 0x00000000, 0x00400010, 0x20004010, 0x00004000,
- 0x00404000, 0x20004010, 0x00000010, 0x20400010,
- 0x20400010, 0x00000000, 0x00404010, 0x20404000,
- 0x00004010, 0x00404000, 0x20404000, 0x20000000,
- 0x20004000, 0x00000010, 0x20400010, 0x00404000,
- 0x20404010, 0x00400000, 0x00004010, 0x20000010,
- 0x00400000, 0x20004000, 0x20000000, 0x00004010,
- 0x20000010, 0x20404010, 0x00404000, 0x20400000,
- 0x00404010, 0x20404000, 0x00000000, 0x20400010,
- 0x00000010, 0x00004000, 0x20400000, 0x00404010,
- 0x00004000, 0x00400010, 0x20004010, 0x00000000,
- 0x20404000, 0x20000000, 0x00400010, 0x20004010 },
- { 0x00200000, 0x04200002, 0x04000802, 0x00000000,
- 0x00000800, 0x04000802, 0x00200802, 0x04200800,
- 0x04200802, 0x00200000, 0x00000000, 0x04000002,
- 0x00000002, 0x04000000, 0x04200002, 0x00000802,
- 0x04000800, 0x00200802, 0x00200002, 0x04000800,
- 0x04000002, 0x04200000, 0x04200800, 0x00200002,
- 0x04200000, 0x00000800, 0x00000802, 0x04200802,
- 0x00200800, 0x00000002, 0x04000000, 0x00200800,
- 0x04000000, 0x00200800, 0x00200000, 0x04000802,
- 0x04000802, 0x04200002, 0x04200002, 0x00000002,
- 0x00200002, 0x04000000, 0x04000800, 0x00200000,
- 0x04200800, 0x00000802, 0x00200802, 0x04200800,
- 0x00000802, 0x04000002, 0x04200802, 0x04200000,
- 0x00200800, 0x00000000, 0x00000002, 0x04200802,
- 0x00000000, 0x00200802, 0x04200000, 0x00000800,
- 0x04000002, 0x04000800, 0x00000800, 0x00200002 },
- { 0x10001040, 0x00001000, 0x00040000, 0x10041040,
- 0x10000000, 0x10001040, 0x00000040, 0x10000000,
- 0x00040040, 0x10040000, 0x10041040, 0x00041000,
- 0x10041000, 0x00041040, 0x00001000, 0x00000040,
- 0x10040000, 0x10000040, 0x10001000, 0x00001040,
- 0x00041000, 0x00040040, 0x10040040, 0x10041000,
- 0x00001040, 0x00000000, 0x00000000, 0x10040040,
- 0x10000040, 0x10001000, 0x00041040, 0x00040000,
- 0x00041040, 0x00040000, 0x10041000, 0x00001000,
- 0x00000040, 0x10040040, 0x00001000, 0x00041040,
- 0x10001000, 0x00000040, 0x10000040, 0x10040000,
- 0x10040040, 0x10000000, 0x00040000, 0x10001040,
- 0x00000000, 0x10041040, 0x00040040, 0x10000040,
- 0x10040000, 0x10001000, 0x10001040, 0x00000000,
- 0x10041040, 0x00041000, 0x00041000, 0x00001040,
- 0x00001040, 0x00040040, 0x10000000, 0x10041000 }
-};
-
-#undef F
-#define F(l,r,key){\
- work = ((r >> 4) | (r << 28)) ^ key[0];\
- l ^= Spbox[6][work & 0x3f];\
- l ^= Spbox[4][(work >> 8) & 0x3f];\
- l ^= Spbox[2][(work >> 16) & 0x3f];\
- l ^= Spbox[0][(work >> 24) & 0x3f];\
- work = r ^ key[1];\
- l ^= Spbox[7][work & 0x3f];\
- l ^= Spbox[5][(work >> 8) & 0x3f];\
- l ^= Spbox[3][(work >> 16) & 0x3f];\
- l ^= Spbox[1][(work >> 24) & 0x3f];\
-}
-/* Encrypt or decrypt a block of data in ECB mode */
-static void
-des(ks,block)
-unsigned long ks[16][2]; /* Key schedule */
-unsigned char block[8]; /* Data block */
-{
- unsigned long left,right,work;
-
- /* Read input block and place in left/right in big-endian order */
- left = ((unsigned long)block[0] << 24)
- | ((unsigned long)block[1] << 16)
- | ((unsigned long)block[2] << 8)
- | (unsigned long)block[3];
- right = ((unsigned long)block[4] << 24)
- | ((unsigned long)block[5] << 16)
- | ((unsigned long)block[6] << 8)
- | (unsigned long)block[7];
-
- /* Hoey's clever initial permutation algorithm, from Outerbridge
- * (see Schneier p 478)
- *
- * The convention here is the same as Outerbridge: rotate each
- * register left by 1 bit, i.e., so that "left" contains permuted
- * input bits 2, 3, 4, ... 1 and "right" contains 33, 34, 35, ... 32
- * (using origin-1 numbering as in the FIPS). This allows us to avoid
- * one of the two rotates that would otherwise be required in each of
- * the 16 rounds.
- */
- work = ((left >> 4) ^ right) & 0x0f0f0f0f;
- right ^= work;
- left ^= work << 4;
- work = ((left >> 16) ^ right) & 0xffff;
- right ^= work;
- left ^= work << 16;
- work = ((right >> 2) ^ left) & 0x33333333;
- left ^= work;
- right ^= (work << 2);
- work = ((right >> 8) ^ left) & 0xff00ff;
- left ^= work;
- right ^= (work << 8);
- right = (right << 1) | (right >> 31);
- work = (left ^ right) & 0xaaaaaaaa;
- left ^= work;
- right ^= work;
- left = (left << 1) | (left >> 31);
-
- /* Now do the 16 rounds */
- F(left,right,ks[0]);
- F(right,left,ks[1]);
- F(left,right,ks[2]);
- F(right,left,ks[3]);
- F(left,right,ks[4]);
- F(right,left,ks[5]);
- F(left,right,ks[6]);
- F(right,left,ks[7]);
- F(left,right,ks[8]);
- F(right,left,ks[9]);
- F(left,right,ks[10]);
- F(right,left,ks[11]);
- F(left,right,ks[12]);
- F(right,left,ks[13]);
- F(left,right,ks[14]);
- F(right,left,ks[15]);
-
- /* Inverse permutation, also from Hoey via Outerbridge and Schneier */
- right = (right << 31) | (right >> 1);
- work = (left ^ right) & 0xaaaaaaaa;
- left ^= work;
- right ^= work;
- left = (left >> 1) | (left << 31);
- work = ((left >> 8) ^ right) & 0xff00ff;
- right ^= work;
- left ^= work << 8;
- work = ((left >> 2) ^ right) & 0x33333333;
- right ^= work;
- left ^= work << 2;
- work = ((right >> 16) ^ left) & 0xffff;
- left ^= work;
- right ^= work << 16;
- work = ((right >> 4) ^ left) & 0x0f0f0f0f;
- left ^= work;
- right ^= work << 4;
-
- /* Put the block back into the user's buffer with final swap */
- block[0] = right >> 24;
- block[1] = right >> 16;
- block[2] = right >> 8;
- block[3] = right;
- block[4] = left >> 24;
- block[5] = left >> 16;
- block[6] = left >> 8;
- block[7] = left;
-}
-
-/* Key schedule-related tables from FIPS-46 */
-
-/* permuted choice table (key) */
-static unsigned char pc1[] = {
- 57, 49, 41, 33, 25, 17, 9,
- 1, 58, 50, 42, 34, 26, 18,
- 10, 2, 59, 51, 43, 35, 27,
- 19, 11, 3, 60, 52, 44, 36,
-
- 63, 55, 47, 39, 31, 23, 15,
- 7, 62, 54, 46, 38, 30, 22,
- 14, 6, 61, 53, 45, 37, 29,
- 21, 13, 5, 28, 20, 12, 4
-};
-
-/* number left rotations of pc1 */
-static unsigned char totrot[] = {
- 1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28
-};
-
-/* permuted choice key (table) */
-static unsigned char pc2[] = {
- 14, 17, 11, 24, 1, 5,
- 3, 28, 15, 6, 21, 10,
- 23, 19, 12, 4, 26, 8,
- 16, 7, 27, 20, 13, 2,
- 41, 52, 31, 37, 47, 55,
- 30, 40, 51, 45, 33, 48,
- 44, 49, 39, 56, 34, 53,
- 46, 42, 50, 36, 29, 32
-};
-
-/* End of DES-defined tables */
-
-
-/* bit 0 is left-most in byte */
-static int bytebit[] = {
- 0200,0100,040,020,010,04,02,01
-};
-
-
-/* Generate key schedule for encryption or decryption
- * depending on the value of "decrypt"
- */
-static void
-deskey(k,key,decrypt)
-DES_KS k; /* Key schedule array */
-unsigned char *key; /* 64 bits (will use only 56) */
-int decrypt; /* 0 = encrypt, 1 = decrypt */
-{
- unsigned char pc1m[56]; /* place to modify pc1 into */
- unsigned char pcr[56]; /* place to rotate pc1 into */
- register int i,j,l;
- int m;
- unsigned char ks[8];
-
- for (j=0; j<56; j++) { /* convert pc1 to bits of key */
- l=pc1[j]-1; /* integer bit location */
- m = l & 07; /* find bit */
- pc1m[j]=(key[l>>3] & /* find which key byte l is in */
- bytebit[m]) /* and which bit of that byte */
- ? 1 : 0; /* and store 1-bit result */
- }
- for (i=0; i<16; i++) { /* key chunk for each iteration */
- memset(ks,0,sizeof(ks)); /* Clear key schedule */
- for (j=0; j<56; j++) /* rotate pc1 the right amount */
- pcr[j] = pc1m[(l=j+totrot[decrypt? 15-i : i])<(j<28? 28 : 56) ? l: l-28];
- /* rotate left and right halves independently */
- for (j=0; j<48; j++){ /* select bits individually */
- /* check bit that goes to ks[j] */
- if (pcr[pc2[j]-1]){
- /* mask it in if it's there */
- l= j % 6;
- ks[j/6] |= bytebit[l] >> 2;
- }
- }
- /* Now convert to packed odd/even interleaved form */
- k[i][0] = ((long)ks[0] << 24)
- | ((long)ks[2] << 16)
- | ((long)ks[4] << 8)
- | ((long)ks[6]);
- k[i][1] = ((long)ks[1] << 24)
- | ((long)ks[3] << 16)
- | ((long)ks[5] << 8)
- | ((long)ks[7]);
- }
-}
diff --git a/camel/camel-sasl-ntlm.h b/camel/camel-sasl-ntlm.h
deleted file mode 100644
index 3818081c74..0000000000
--- a/camel/camel-sasl-ntlm.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright 2002 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef CAMEL_SASL_NTLM_H
-#define CAMEL_SASL_NTLM_H
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include <camel/camel-sasl.h>
-
-#define CAMEL_SASL_NTLM_TYPE (camel_sasl_ntlm_get_type ())
-#define CAMEL_SASL_NTLM(obj) (CAMEL_CHECK_CAST((obj), CAMEL_SASL_NTLM_TYPE, CamelSaslNTLM))
-#define CAMEL_SASL_NTLM_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_SASL_NTLM_TYPE, CamelSaslNTLMClass))
-#define CAMEL_IS_SASL_NTLM(o) (CAMEL_CHECK_TYPE((o), CAMEL_SASL_NTLM_TYPE))
-
-typedef struct _CamelSaslNTLM {
- CamelSasl parent_object;
-
-} CamelSaslNTLM;
-
-
-typedef struct _CamelSaslNTLMClass {
- CamelSaslClass parent_class;
-
-} CamelSaslNTLMClass;
-
-
-/* Standard Camel function */
-CamelType camel_sasl_ntlm_get_type (void);
-
-extern CamelServiceAuthType camel_sasl_ntlm_authtype;
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_SASL_NTLM_H */
diff --git a/camel/camel-sasl-plain.c b/camel/camel-sasl-plain.c
deleted file mode 100644
index 48d1fc9a01..0000000000
--- a/camel/camel-sasl-plain.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2001 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-#include "camel-sasl-plain.h"
-#include "camel-service.h"
-
-CamelServiceAuthType camel_sasl_plain_authtype = {
- N_("PLAIN"),
-
- N_("This option will connect to the server using a "
- "simple password."),
-
- "PLAIN",
- TRUE
-};
-
-static CamelSaslClass *parent_class = NULL;
-
-/* Returns the class for a CamelSaslPlain */
-#define CSP_CLASS(so) CAMEL_SASL_PLAIN_CLASS (CAMEL_OBJECT_GET_CLASS (so))
-
-static GByteArray *plain_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex);
-
-static void
-camel_sasl_plain_class_init (CamelSaslPlainClass *camel_sasl_plain_class)
-{
- CamelSaslClass *camel_sasl_class = CAMEL_SASL_CLASS (camel_sasl_plain_class);
-
- parent_class = CAMEL_SASL_CLASS (camel_type_get_global_classfuncs (camel_sasl_get_type ()));
-
- /* virtual method overload */
- camel_sasl_class->challenge = plain_challenge;
-}
-
-CamelType
-camel_sasl_plain_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_sasl_get_type (),
- "CamelSaslPlain",
- sizeof (CamelSaslPlain),
- sizeof (CamelSaslPlainClass),
- (CamelObjectClassInitFunc) camel_sasl_plain_class_init,
- NULL,
- NULL,
- NULL);
- }
-
- return type;
-}
-
-static GByteArray *
-plain_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
-{
- GByteArray *buf = NULL;
- CamelURL *url = sasl->service->url;
-
-#if 0
- if (token) {
- camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
- _("Authentication failed."));
- return NULL;
- }
-#endif
-
- g_return_val_if_fail (url->passwd != NULL, NULL);
-
- /* FIXME: make sure these are "UTF8-SAFE" */
- buf = g_byte_array_new ();
- g_byte_array_append (buf, "", 1);
- g_byte_array_append (buf, url->user, strlen (url->user));
- g_byte_array_append (buf, "", 1);
- g_byte_array_append (buf, url->passwd, strlen (url->passwd));
-
- sasl->authenticated = TRUE;
-
- return buf;
-}
diff --git a/camel/camel-sasl-plain.h b/camel/camel-sasl-plain.h
deleted file mode 100644
index a23568047e..0000000000
--- a/camel/camel-sasl-plain.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2001 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef CAMEL_SASL_PLAIN_H
-#define CAMEL_SASL_PLAIN_H
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include <camel/camel-sasl.h>
-
-#define CAMEL_SASL_PLAIN_TYPE (camel_sasl_plain_get_type ())
-#define CAMEL_SASL_PLAIN(obj) (CAMEL_CHECK_CAST((obj), CAMEL_SASL_PLAIN_TYPE, CamelSaslPlain))
-#define CAMEL_SASL_PLAIN_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_SASL_PLAIN_TYPE, CamelSaslPlainClass))
-#define CAMEL_IS_SASL_PLAIN(o) (CAMEL_CHECK_TYPE((o), CAMEL_SASL_PLAIN_TYPE))
-
-typedef struct _CamelSaslPlain {
- CamelSasl parent_object;
-
-} CamelSaslPlain;
-
-
-typedef struct _CamelSaslPlainClass {
- CamelSaslClass parent_class;
-
-} CamelSaslPlainClass;
-
-
-/* Standard Camel function */
-CamelType camel_sasl_plain_get_type (void);
-
-extern CamelServiceAuthType camel_sasl_plain_authtype;
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_SASL_PLAIN_H */
diff --git a/camel/camel-sasl-popb4smtp.c b/camel/camel-sasl-popb4smtp.c
deleted file mode 100644
index 329151872e..0000000000
--- a/camel/camel-sasl-popb4smtp.c
+++ /dev/null
@@ -1,151 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * Copyright 2001-2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <pthread.h>
-#include <string.h>
-#include <time.h>
-
-#include "camel-sasl-popb4smtp.h"
-#include "camel-service.h"
-#include "camel-session.h"
-
-CamelServiceAuthType camel_sasl_popb4smtp_authtype = {
- N_("POP before SMTP"),
-
- N_("This option will authorise a POP connection before attempting SMTP"),
-
- "POPB4SMTP",
- FALSE,
-};
-
-/* last time the pop was accessed (through the auth method anyway), *time_t */
-static GHashTable *poplast;
-
-/* use 1 hour as our pop timeout */
-#define POPB4SMTP_TIMEOUT (60*60)
-
-static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
-#define POPB4SMTP_LOCK(l) pthread_mutex_lock(&l)
-#define POPB4SMTP_UNLOCK(l) pthread_mutex_unlock(&l)
-
-static CamelSaslClass *parent_class = NULL;
-
-/* Returns the class for a CamelSaslPOPB4SMTP */
-#define CSP_CLASS(so) CAMEL_SASL_POPB4SMTP_CLASS (CAMEL_OBJECT_GET_CLASS (so))
-
-static GByteArray *popb4smtp_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex);
-
-static void
-camel_sasl_popb4smtp_class_init (CamelSaslPOPB4SMTPClass *camel_sasl_popb4smtp_class)
-{
- CamelSaslClass *camel_sasl_class = CAMEL_SASL_CLASS (camel_sasl_popb4smtp_class);
-
- parent_class = CAMEL_SASL_CLASS (camel_type_get_global_classfuncs (camel_sasl_get_type ()));
-
- /* virtual method overload */
- camel_sasl_class->challenge = popb4smtp_challenge;
-
- poplast = g_hash_table_new(g_str_hash, g_str_equal);
-}
-
-CamelType
-camel_sasl_popb4smtp_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_sasl_get_type (),
- "CamelSaslPOPB4SMTP",
- sizeof (CamelSaslPOPB4SMTP),
- sizeof (CamelSaslPOPB4SMTPClass),
- (CamelObjectClassInitFunc) camel_sasl_popb4smtp_class_init,
- NULL,
- NULL,
- NULL);
- }
-
- return type;
-}
-
-static GByteArray *
-popb4smtp_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
-{
- char *popuri;
- CamelSession *session = sasl->service->session;
- CamelStore *store;
- time_t now, *timep;
-
- sasl->authenticated = FALSE;
-
- popuri = camel_session_get_password (session, _("POP Source URI"), FALSE, FALSE,
- sasl->service, "popb4smtp_uri", ex);
-
- if (popuri == NULL) {
- camel_exception_setv(ex, 1, _("POP Before SMTP auth using an unknown transport"));
- return NULL;
- }
-
- if (strncasecmp(popuri, "pop:", 4) != 0) {
- camel_exception_setv(ex, 1, _("POP Before SMTP auth using a non-pop source"));
- return NULL;
- }
-
- /* check if we've done it before recently in this session */
- now = time(0);
-
- /* need to lock around the whole thing until finished with timep */
-
- POPB4SMTP_LOCK(lock);
- timep = g_hash_table_lookup(poplast, popuri);
- if (timep) {
- if ((*timep + POPB4SMTP_TIMEOUT) > now) {
- sasl->authenticated = TRUE;
- POPB4SMTP_UNLOCK(lock);
- g_free(popuri);
- return NULL;
- }
- } else {
- timep = g_malloc0(sizeof(*timep));
- g_hash_table_insert(poplast, g_strdup(popuri), timep);
- }
-
- /* connect to pop session */
- store = camel_session_get_store(session, popuri, ex);
- if (store) {
- sasl->authenticated = TRUE;
- camel_object_unref((CamelObject *)store);
- *timep = now;
- } else {
- sasl->authenticated = FALSE;
- *timep = 0;
- }
-
- POPB4SMTP_UNLOCK(lock);
-
- g_free(popuri);
-
- return NULL;
-}
diff --git a/camel/camel-sasl-popb4smtp.h b/camel/camel-sasl-popb4smtp.h
deleted file mode 100644
index b94bed0d49..0000000000
--- a/camel/camel-sasl-popb4smtp.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * Copyright 2001 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef CAMEL_SASL_POPB4SMTP_H
-#define CAMEL_SASL_POPB4SMTP_H
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include <camel/camel-sasl.h>
-
-#define CAMEL_SASL_POPB4SMTP_TYPE (camel_sasl_popb4smtp_get_type ())
-#define CAMEL_SASL_POPB4SMTP(obj) (CAMEL_CHECK_CAST((obj), CAMEL_SASL_POPB4SMTP_TYPE, CamelSaslPOPB4SMTP))
-#define CAMEL_SASL_POPB4SMTP_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_SASL_POPB4SMTP_TYPE, CamelSaslPOPB4SMTPClass))
-#define CAMEL_IS_SASL_POPB4SMTP(o) (CAMEL_CHECK_TYPE((o), CAMEL_SASL_POPB4SMTP_TYPE))
-
-typedef struct _CamelSaslPOPB4SMTP {
- CamelSasl parent_object;
-
-} CamelSaslPOPB4SMTP;
-
-
-typedef struct _CamelSaslPOPB4SMTPClass {
- CamelSaslClass parent_class;
-
-} CamelSaslPOPB4SMTPClass;
-
-
-/* Standard Camel function */
-CamelType camel_sasl_popb4smtp_get_type (void);
-
-extern CamelServiceAuthType camel_sasl_popb4smtp_authtype;
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_SASL_POPB4SMTP_H */
diff --git a/camel/camel-sasl.c b/camel/camel-sasl.c
deleted file mode 100644
index 24ee6e4d94..0000000000
--- a/camel/camel-sasl.c
+++ /dev/null
@@ -1,285 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2001-2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-#include "camel-sasl.h"
-#include "camel-mime-utils.h"
-#include "camel-service.h"
-
-#include "camel-sasl-cram-md5.h"
-#include "camel-sasl-digest-md5.h"
-#include "camel-sasl-gssapi.h"
-#include "camel-sasl-kerberos4.h"
-#include "camel-sasl-login.h"
-#include "camel-sasl-plain.h"
-#include "camel-sasl-popb4smtp.h"
-#include "camel-sasl-ntlm.h"
-
-
-#define w(x)
-
-static CamelObjectClass *parent_class = NULL;
-
-/* Returns the class for a CamelSasl */
-#define CS_CLASS(so) CAMEL_SASL_CLASS (CAMEL_OBJECT_GET_CLASS (so))
-
-static GByteArray *sasl_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex);
-
-static void
-camel_sasl_class_init (CamelSaslClass *camel_sasl_class)
-{
- parent_class = camel_type_get_global_classfuncs (CAMEL_OBJECT_TYPE);
-
- /* virtual method definition */
- camel_sasl_class->challenge = sasl_challenge;
-}
-
-static void
-camel_sasl_finalize (CamelSasl *sasl)
-{
- g_free (sasl->service_name);
- g_free (sasl->mech);
- camel_object_unref (sasl->service);
-}
-
-CamelType
-camel_sasl_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (CAMEL_OBJECT_TYPE,
- "CamelSasl",
- sizeof (CamelSasl),
- sizeof (CamelSaslClass),
- (CamelObjectClassInitFunc) camel_sasl_class_init,
- NULL,
- NULL,
- (CamelObjectFinalizeFunc) camel_sasl_finalize);
- }
-
- return type;
-}
-
-
-static GByteArray *
-sasl_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
-{
- w(g_warning ("sasl_challenge: Using default implementation!"));
- return NULL;
-}
-
-/**
- * camel_sasl_challenge:
- * @sasl: a SASL object
- * @token: a token, or %NULL
- * @ex: exception
- *
- * If @token is %NULL, generate the initial SASL message to send to
- * the server. (This will be %NULL if the client doesn't initiate the
- * exchange.) Otherwise, @token is a challenge from the server, and
- * the return value is the response.
- *
- * Return value: The SASL response or %NULL. If an error occurred, @ex
- * will also be set.
- **/
-GByteArray *
-camel_sasl_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
-{
- g_return_val_if_fail (CAMEL_IS_SASL (sasl), NULL);
-
- return CS_CLASS (sasl)->challenge (sasl, token, ex);
-}
-
-/**
- * camel_sasl_challenge_base64:
- * @sasl: a SASL object
- * @token: a base64-encoded token
- * @ex: exception
- *
- * As with camel_sasl_challenge(), but the challenge @token and the
- * response are both base64-encoded.
- *
- * Return value: As with camel_sasl_challenge(), but base64-encoded.
- **/
-char *
-camel_sasl_challenge_base64 (CamelSasl *sasl, const char *token, CamelException *ex)
-{
- GByteArray *token_binary, *ret_binary;
- char *ret;
- int len;
-
- g_return_val_if_fail (CAMEL_IS_SASL (sasl), NULL);
-
- if (token) {
- token_binary = g_byte_array_new ();
- len = strlen (token);
- g_byte_array_append (token_binary, token, len);
- token_binary->len = camel_base64_decode_simple (token_binary->data, len);
- } else
- token_binary = NULL;
-
- ret_binary = camel_sasl_challenge (sasl, token_binary, ex);
- if (token_binary)
- g_byte_array_free (token_binary, TRUE);
- if (!ret_binary)
- return NULL;
-
- ret = camel_base64_encode_simple (ret_binary->data, ret_binary->len);
- g_byte_array_free (ret_binary, TRUE);
-
- return ret;
-}
-
-/**
- * camel_sasl_authenticated:
- * @sasl: a SASL object
- *
- * Return value: whether or not @sasl has successfully authenticated
- * the user. This will be %TRUE after it returns the last needed response.
- * The caller must still pass that information on to the server and verify
- * that it has accepted it.
- **/
-gboolean
-camel_sasl_authenticated (CamelSasl *sasl)
-{
- return sasl->authenticated;
-}
-
-
-/**
- * camel_sasl_new:
- * @service_name: the SASL service name
- * @mechanism: the SASL mechanism
- * @service: the CamelService that will be using this SASL
- *
- * Return value: a new CamelSasl for the given @service_name,
- * @mechanism, and @service, or %NULL if the mechanism is not
- * supported.
- **/
-CamelSasl *
-camel_sasl_new (const char *service_name, const char *mechanism, CamelService *service)
-{
- CamelSasl *sasl;
-
- g_return_val_if_fail (service_name != NULL, NULL);
- g_return_val_if_fail (mechanism != NULL, NULL);
- g_return_val_if_fail (CAMEL_IS_SERVICE (service), NULL);
-
- /* We don't do ANONYMOUS here, because it's a little bit weird. */
-
- if (!strcmp (mechanism, "CRAM-MD5"))
- sasl = (CamelSasl *) camel_object_new (CAMEL_SASL_CRAM_MD5_TYPE);
- else if (!strcmp (mechanism, "DIGEST-MD5"))
- sasl = (CamelSasl *) camel_object_new (CAMEL_SASL_DIGEST_MD5_TYPE);
-#ifdef HAVE_KRB5
- else if (!strcmp (mechanism, "GSSAPI"))
- sasl = (CamelSasl *) camel_object_new (CAMEL_SASL_GSSAPI_TYPE);
-#endif
-#ifdef HAVE_KRB4
- else if (!strcmp (mechanism, "KERBEROS_V4"))
- sasl = (CamelSasl *) camel_object_new (CAMEL_SASL_KERBEROS4_TYPE);
-#endif
- else if (!strcmp (mechanism, "PLAIN"))
- sasl = (CamelSasl *) camel_object_new (CAMEL_SASL_PLAIN_TYPE);
- else if (!strcmp (mechanism, "LOGIN"))
- sasl = (CamelSasl *) camel_object_new (CAMEL_SASL_LOGIN_TYPE);
- else if (!strcmp (mechanism, "POPB4SMTP"))
- sasl = (CamelSasl *) camel_object_new (CAMEL_SASL_POPB4SMTP_TYPE);
- else if (!strcmp (mechanism, "NTLM"))
- sasl = (CamelSasl *) camel_object_new (CAMEL_SASL_NTLM_TYPE);
- else
- return NULL;
-
- sasl->mech = g_strdup (mechanism);
- sasl->service_name = g_strdup (service_name);
- sasl->service = service;
- camel_object_ref (service);
-
- return sasl;
-}
-
-/**
- * camel_sasl_authtype_list:
- * @include_plain: whether or not to include the PLAIN mechanism
- *
- * Return value: a GList of SASL-supported authtypes. The caller must
- * free the list, but not the contents.
- **/
-GList *
-camel_sasl_authtype_list (gboolean include_plain)
-{
- GList *types = NULL;
-
- types = g_list_prepend (types, &camel_sasl_cram_md5_authtype);
- types = g_list_prepend (types, &camel_sasl_digest_md5_authtype);
-#ifdef HAVE_KRB5
- types = g_list_prepend (types, &camel_sasl_gssapi_authtype);
-#endif
-#ifdef HAVE_KRB4
- types = g_list_prepend (types, &camel_sasl_kerberos4_authtype);
-#endif
- types = g_list_prepend (types, &camel_sasl_ntlm_authtype);
- if (include_plain)
- types = g_list_prepend (types, &camel_sasl_plain_authtype);
-
- return types;
-}
-
-/**
- * camel_sasl_authtype:
- * @mechanism: the SASL mechanism to get an authtype for
- *
- * Return value: a CamelServiceAuthType for the given mechanism, if
- * it is supported.
- **/
-CamelServiceAuthType *
-camel_sasl_authtype (const char *mechanism)
-{
- if (!strcmp (mechanism, "CRAM-MD5"))
- return &camel_sasl_cram_md5_authtype;
- else if (!strcmp (mechanism, "DIGEST-MD5"))
- return &camel_sasl_digest_md5_authtype;
-#ifdef HAVE_KRB5
- else if (!strcmp (mechanism, "GSSAPI"))
- return &camel_sasl_gssapi_authtype;
-#endif
-#ifdef HAVE_KRB4
- else if (!strcmp (mechanism, "KERBEROS_V4"))
- return &camel_sasl_kerberos4_authtype;
-#endif
- else if (!strcmp (mechanism, "PLAIN"))
- return &camel_sasl_plain_authtype;
- else if (!strcmp (mechanism, "LOGIN"))
- return &camel_sasl_login_authtype;
- else if (!strcmp(mechanism, "POPB4SMTP"))
- return &camel_sasl_popb4smtp_authtype;
- else if (!strcmp (mechanism, "NTLM"))
- return &camel_sasl_ntlm_authtype;
- else
- return NULL;
-}
diff --git a/camel/camel-sasl.h b/camel/camel-sasl.h
deleted file mode 100644
index 2b5db5c447..0000000000
--- a/camel/camel-sasl.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2001 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef CAMEL_SASL_H
-#define CAMEL_SASL_H
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include <glib.h>
-#include <camel/camel-object.h>
-#include <camel/camel-exception.h>
-#include <camel/camel-service.h>
-
-#define CAMEL_SASL_TYPE (camel_sasl_get_type ())
-#define CAMEL_SASL(obj) (CAMEL_CHECK_CAST((obj), CAMEL_SASL_TYPE, CamelSasl))
-#define CAMEL_SASL_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_SASL_TYPE, CamelSaslClass))
-#define CAMEL_IS_SASL(o) (CAMEL_CHECK_TYPE((o), CAMEL_SASL_TYPE))
-
-typedef struct _CamelSasl {
- CamelObject parent_object;
-
- char *service_name;
- char *mech; /* mechanism */
- CamelService *service;
- gboolean authenticated;
-} CamelSasl;
-
-
-typedef struct _CamelSaslClass {
- CamelObjectClass parent_class;
-
- GByteArray * (*challenge) (CamelSasl *sasl, GByteArray *token, CamelException *ex);
-
-} CamelSaslClass;
-
-
-/* Standard Camel function */
-CamelType camel_sasl_get_type (void);
-
-/* public methods */
-GByteArray *camel_sasl_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex);
-char *camel_sasl_challenge_base64 (CamelSasl *sasl, const char *token, CamelException *ex);
-
-gboolean camel_sasl_authenticated (CamelSasl *sasl);
-
-/* utility functions */
-CamelSasl *camel_sasl_new (const char *service_name, const char *mechanism, CamelService *service);
-
-GList *camel_sasl_authtype_list (gboolean include_plain);
-CamelServiceAuthType *camel_sasl_authtype (const char *mechanism);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_SASL_H */
diff --git a/camel/camel-search-private.c b/camel/camel-search-private.c
deleted file mode 100644
index 2ba908bea3..0000000000
--- a/camel/camel-search-private.c
+++ /dev/null
@@ -1,684 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- * Michael Zucchi <NotZed@Ximian.com>
- *
- * Copyright 2000 Ximian, Inc. (www.ximian.com)
- * Copyright 2001 Ximian Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-/* (from glibc headers:
- POSIX says that <sys/types.h> must be included (by the caller) before <regex.h>. */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <glib.h>
-#include <sys/types.h>
-#include <regex.h>
-#include <string.h>
-#include <ctype.h>
-#include <stdio.h>
-
-#include "camel-exception.h"
-#include "camel-mime-message.h"
-#include "camel-multipart.h"
-#include "camel-stream-mem.h"
-#include "e-util/e-sexp.h"
-
-#include "camel-search-private.h"
-
-#include <glib/gunicode.h>
-
-#define d(x)
-
-/* builds the regex into pattern */
-/* taken from camel-folder-search, with added isregex & exception parameter */
-/* Basically, we build a new regex, either based on subset regex's, or substrings,
- that can be executed once over the whoel body, to match anything suitable.
- This is more efficient than multiple searches, and probably most (naive) strstr
- implementations, over long content.
-
- A small issue is that case-insenstivity wont work entirely correct for utf8 strings. */
-int
-camel_search_build_match_regex (regex_t *pattern, camel_search_flags_t type, int argc,
- struct _ESExpResult **argv, CamelException *ex)
-{
- GString *match = g_string_new("");
- int c, i, count=0, err;
- char *word;
- int flags;
-
- /* build a regex pattern we can use to match the words, we OR them together */
- if (argc>1)
- g_string_append_c (match, '(');
- for (i = 0; i < argc; i++) {
- if (argv[i]->type == ESEXP_RES_STRING) {
- if (count > 0)
- g_string_append_c (match, '|');
-
- word = argv[i]->value.string;
- if (type & CAMEL_SEARCH_MATCH_REGEX) {
- /* no need to escape because this should already be a valid regex */
- g_string_append (match, word);
- } else {
- /* escape any special chars (not sure if this list is complete) */
- if (type & CAMEL_SEARCH_MATCH_START)
- g_string_append_c (match, '^');
- while ((c = *word++)) {
- if (strchr ("*\\.()[]^$+", c) != NULL) {
- g_string_append_c (match, '\\');
- }
- g_string_append_c (match, c);
- }
- if (type & CAMEL_SEARCH_MATCH_END)
- g_string_append_c (match, '^');
- }
- count++;
- } else {
- g_warning("Invalid type passed to body-contains match function");
- }
- }
- if (argc > 1)
- g_string_append_c (match, ')');
- flags = REG_EXTENDED|REG_NOSUB;
- if (type & CAMEL_SEARCH_MATCH_ICASE)
- flags |= REG_ICASE;
- if (type & CAMEL_SEARCH_MATCH_NEWLINE)
- flags |= REG_NEWLINE;
- err = regcomp (pattern, match->str, flags);
- if (err != 0) {
- /* regerror gets called twice to get the full error string
- length to do proper posix error reporting */
- int len = regerror (err, pattern, 0, 0);
- char *buffer = g_malloc0 (len + 1);
-
- regerror (err, pattern, buffer, len);
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Regular expression compilation failed: %s: %s"),
- match->str, buffer);
-
- regfree (pattern);
- }
- d(printf("Built regex: '%s'\n", match->str));
- g_string_free (match, TRUE);
-
- return err;
-}
-
-static unsigned char soundex_table[256] = {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 49, 50, 51, 0, 49, 50, 0, 0, 50, 50, 52, 53, 53, 0,
- 49, 50, 54, 50, 51, 0, 49, 0, 50, 0, 50, 0, 0, 0, 0, 0,
- 0, 0, 49, 50, 51, 0, 49, 50, 0, 0, 50, 50, 52, 53, 53, 0,
- 49, 50, 54, 50, 51, 0, 49, 0, 50, 0, 50, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static void
-soundexify (const gchar *sound, gchar code[5])
-{
- guchar *c, last = '\0';
- gint n;
-
- for (c = (guchar *) sound; *c && !isalpha (*c); c++);
- code[0] = toupper (*c);
- memset (code + 1, '0', 3);
- for (n = 1; *c && n < 5; c++) {
- guchar ch = soundex_table[*c];
-
- if (ch && ch != last) {
- code[n++] = ch;
- last = ch;
- }
- }
- code[4] = '\0';
-}
-
-static gboolean
-header_soundex (const char *header, const char *match)
-{
- char mcode[5], hcode[5];
- const char *p;
- char c;
- GString *word;
- int truth = FALSE;
-
- soundexify (match, mcode);
-
- /* split the header into words, and soundexify and compare each one */
- /* FIXME: Should this convert to utf8, and split based on that, and what not?
- soundex only makes sense for us-ascii though ... */
-
- word = g_string_new("");
- p = header;
- do {
- c = *p++;
- if (c == 0 || isspace (c)) {
- if (word->len > 0) {
- soundexify (word->str, hcode);
- if (strcmp (hcode, mcode) == 0)
- truth = TRUE;
- }
- g_string_truncate (word, 0);
- } else if (isalpha (c))
- g_string_append_c (word, c);
- } while (c && !truth);
- g_string_free (word, TRUE);
-
- return truth;
-}
-
-/* FIXME: This is stupidly slow and needs to be removed */
-static gunichar
-utf8_get (const char **inp)
-{
- const unsigned char *p = *inp;
- gunichar c;
-
- if (p == NULL)
- return 0;
-
- c = g_utf8_get_char (p);
- *inp = g_unichar_validate (c) ? g_utf8_next_char (p) : NULL;
-
- return c;
-}
-
-const char *
-camel_ustrstrcase (const char *haystack, const char *needle)
-{
- gunichar *nuni, *puni;
- gunichar u;
- const char *p;
-
- g_return_val_if_fail (haystack != NULL, NULL);
- g_return_val_if_fail (needle != NULL, NULL);
-
- if (strlen (needle) == 0)
- return haystack;
- if (strlen (haystack) == 0)
- return NULL;
-
- puni = nuni = g_alloca (sizeof (gunichar) * strlen (needle));
-
- p = needle;
- while ((u = utf8_get (&p)))
- *puni++ = g_unichar_tolower (u);
-
- /* NULL means there was illegal utf-8 sequence */
- if (!p)
- return NULL;
-
- p = haystack;
- while ((u = utf8_get (&p))) {
- gunichar c;
-
- c = g_unichar_tolower (u);
- /* We have valid stripped char */
- if (c == nuni[0]) {
- const gchar *q = p;
- gint npos = 1;
-
- while (nuni + npos < puni) {
- u = utf8_get (&q);
- if (!q || !u)
- return NULL;
-
- c = g_unichar_tolower (u);
- if (c != nuni[npos])
- break;
-
- npos++;
- }
-
- if (nuni + npos == puni)
- return p;
- }
- }
-
- return NULL;
-}
-
-#define CAMEL_SEARCH_COMPARE(x, y, z) G_STMT_START { \
- if ((x) == (z)) { \
- if ((y) == (z)) \
- return 0; \
- else \
- return -1; \
- } else if ((y) == (z)) \
- return 1; \
-} G_STMT_END
-
-static int
-camel_ustrcasecmp (const char *s1, const char *s2)
-{
- gunichar u1, u2 = 0;
-
- CAMEL_SEARCH_COMPARE (s1, s2, NULL);
-
- u1 = utf8_get (&s1);
- u2 = utf8_get (&s2);
- while (u1 && u2) {
- u1 = g_unichar_tolower (u1);
- u2 = g_unichar_tolower (u2);
- if (u1 < u2)
- return -1;
- else if (u1 > u2)
- return 1;
-
- u1 = utf8_get (&s1);
- u2 = utf8_get (&s2);
- }
-
- /* end of one of the strings ? */
- CAMEL_SEARCH_COMPARE (u1, u2, 0);
-
- /* if we have invalid utf8 sequence ? */
- CAMEL_SEARCH_COMPARE (s1, s2, NULL);
-
- return 0;
-}
-
-static int
-camel_ustrncasecmp (const char *s1, const char *s2, size_t len)
-{
- gunichar u1, u2 = 0;
-
- CAMEL_SEARCH_COMPARE (s1, s2, NULL);
-
- u1 = utf8_get (&s1);
- u2 = utf8_get (&s2);
- while (len > 0 && u1 && u2) {
- u1 = g_unichar_tolower (u1);
- u2 = g_unichar_tolower (u2);
- if (u1 < u2)
- return -1;
- else if (u1 > u2)
- return 1;
-
- len--;
- u1 = utf8_get (&s1);
- u2 = utf8_get (&s2);
- }
-
- if (len == 0)
- return 0;
-
- /* end of one of the strings ? */
- CAMEL_SEARCH_COMPARE (u1, u2, 0);
-
- /* if we have invalid utf8 sequence ? */
- CAMEL_SEARCH_COMPARE (s1, s2, NULL);
-
- return 0;
-}
-
-/* value is the match value suitable for exact match if required */
-static int
-header_match(const char *value, const char *match, camel_search_match_t how)
-{
- const char *p;
- int vlen, mlen;
-
- if (how == CAMEL_SEARCH_MATCH_SOUNDEX)
- return header_soundex (value, match);
-
- vlen = strlen(value);
- mlen = strlen(match);
- if (vlen < mlen)
- return FALSE;
-
- /* from dan the man, if we have mixed case, perform a case-sensitive match,
- otherwise not */
- p = match;
- while (*p) {
- if (isupper(*p)) {
- switch (how) {
- case CAMEL_SEARCH_MATCH_EXACT:
- return strcmp(value, match) == 0;
- case CAMEL_SEARCH_MATCH_CONTAINS:
- return strstr(value, match) != NULL;
- case CAMEL_SEARCH_MATCH_STARTS:
- return strncmp(value, match, mlen) == 0;
- case CAMEL_SEARCH_MATCH_ENDS:
- return strcmp(value + vlen - mlen, match) == 0;
- default:
- break;
- }
- return FALSE;
- }
- p++;
- }
-
- switch (how) {
- case CAMEL_SEARCH_MATCH_EXACT:
- return camel_ustrcasecmp(value, match) == 0;
- case CAMEL_SEARCH_MATCH_CONTAINS:
- return camel_ustrstrcase(value, match) != NULL;
- case CAMEL_SEARCH_MATCH_STARTS:
- return camel_ustrncasecmp(value, match, mlen) == 0;
- case CAMEL_SEARCH_MATCH_ENDS:
- return camel_ustrcasecmp(value + vlen - mlen, match) == 0;
- default:
- break;
- }
-
- return FALSE;
-}
-
-/* searhces for match inside value, if match is mixed case, hten use case-sensitive,
- else insensitive */
-gboolean
-camel_search_header_match (const char *value, const char *match, camel_search_match_t how, camel_search_t type, const char *default_charset)
-{
- const char *name, *addr;
- int truth = FALSE, i;
- CamelInternetAddress *cia;
- char *v, *vdom, *mdom;
-
- while (*value && isspace (*value))
- value++;
-
- switch(type) {
- case CAMEL_SEARCH_TYPE_ENCODED:
- v = camel_header_decode_string(value, default_charset); /* FIXME: Find header charset */
- truth = header_match(v, match, how);
- g_free(v);
- break;
- case CAMEL_SEARCH_TYPE_MLIST:
- /* Special mailing list old-version domain hack
- If one of the mailing list names doesn't have an @ in it, its old-style, so
- only match against the pre-domain part, which should be common */
-
- vdom = strchr(value, '@');
- mdom = strchr(match, '@');
- if (mdom == NULL && vdom != NULL) {
- v = g_alloca(vdom-value+1);
- memcpy(v, value, vdom-value);
- v[vdom-value] = 0;
- value = (char *)v;
- } else if (mdom != NULL && vdom == NULL) {
- v = g_alloca(mdom-match+1);
- memcpy(v, match, mdom-match);
- v[mdom-match] = 0;
- match = (char *)v;
- }
- /* Falls through */
- case CAMEL_SEARCH_TYPE_ASIS:
- truth = header_match(value, match, how);
- break;
- case CAMEL_SEARCH_TYPE_ADDRESS_ENCODED:
- case CAMEL_SEARCH_TYPE_ADDRESS:
- /* possible simple case to save some work if we can */
- if (header_match(value, match, how))
- return TRUE;
-
- /* Now we decode any addresses, and try asis matches on name and address parts */
- cia = camel_internet_address_new();
- if (type == CAMEL_SEARCH_TYPE_ADDRESS_ENCODED)
- camel_address_decode((CamelAddress *)cia, value);
- else
- camel_address_unformat((CamelAddress *)cia, value);
-
- for (i=0; !truth && camel_internet_address_get(cia, i, &name, &addr);i++)
- truth = (name && header_match(name, match, how)) || (addr && header_match(addr, match, how));
-
- camel_object_unref (cia);
- break;
- }
-
- return truth;
-}
-
-/* performs a 'slow' content-based match */
-/* there is also an identical copy of this in camel-filter-search.c */
-gboolean
-camel_search_message_body_contains (CamelDataWrapper *object, regex_t *pattern)
-{
- CamelDataWrapper *containee;
- int truth = FALSE;
- int parts, i;
-
- containee = camel_medium_get_content_object (CAMEL_MEDIUM (object));
-
- if (containee == NULL)
- return FALSE;
-
- /* using the object types is more accurate than using the mime/types */
- if (CAMEL_IS_MULTIPART (containee)) {
- parts = camel_multipart_get_number (CAMEL_MULTIPART (containee));
- for (i = 0; i < parts && truth == FALSE; i++) {
- CamelDataWrapper *part = (CamelDataWrapper *)camel_multipart_get_part (CAMEL_MULTIPART (containee), i);
- if (part)
- truth = camel_search_message_body_contains (part, pattern);
- }
- } else if (CAMEL_IS_MIME_MESSAGE (containee)) {
- /* for messages we only look at its contents */
- truth = camel_search_message_body_contains ((CamelDataWrapper *)containee, pattern);
- } else if (camel_content_type_is(CAMEL_DATA_WRAPPER (containee)->mime_type, "text", "*")) {
- /* for all other text parts, we look inside, otherwise we dont care */
- CamelStreamMem *mem = (CamelStreamMem *)camel_stream_mem_new ();
-
- camel_data_wrapper_write_to_stream (containee, CAMEL_STREAM (mem));
- camel_stream_write (CAMEL_STREAM (mem), "", 1);
- truth = regexec (pattern, mem->buffer->data, 0, NULL, 0) == 0;
- camel_object_unref (mem);
- }
-
- return truth;
-}
-
-static inline guint32
-camel_utf8_getc(const unsigned char **ptr)
-{
- register unsigned char *p = (unsigned char *)*ptr;
- register unsigned char c, r;
- register guint32 v, m;
-
-again:
- r = *p++;
-loop:
- if (r < 0x80) {
- *ptr = p;
- v = r;
- } else if (r < 0xfe) { /* valid start char? */
- v = r;
- m = 0x7f80; /* used to mask out the length bits */
- do {
- c = *p++;
- if ((c & 0xc0) != 0x80) {
- r = c;
- goto loop;
- }
- v = (v<<6) | (c & 0x3f);
- r<<=1;
- m<<=5;
- } while (r & 0x40);
-
- *ptr = p;
-
- v &= ~m;
- } else {
- goto again;
- }
-
- return v;
-}
-
-static void
-output_c(GString *w, guint32 c, int *type)
-{
- int utf8len;
- char utf8[8];
-
- if (!g_unichar_isalnum(c))
- *type = CAMEL_SEARCH_WORD_COMPLEX | (*type & CAMEL_SEARCH_WORD_8BIT);
- else
- c = g_unichar_tolower(c);
-
- if (c > 0x80)
- *type |= CAMEL_SEARCH_WORD_8BIT;
-
- /* FIXME: use camel_utf8_putc */
- utf8len = g_unichar_to_utf8(c, utf8);
- utf8[utf8len] = 0;
- g_string_append(w, utf8);
-}
-
-static void
-output_w(GString *w, GPtrArray *list, int type)
-{
- struct _camel_search_word *word;
-
- if (w->len) {
- word = g_malloc0(sizeof(*word));
- word->word = g_strdup(w->str);
- word->type = type;
- g_ptr_array_add(list, word);
- g_string_truncate(w, 0);
- }
-}
-
-struct _camel_search_words *
-camel_search_words_split(const unsigned char *in)
-{
- int type = CAMEL_SEARCH_WORD_SIMPLE, all = 0;
- GString *w;
- struct _camel_search_words *words;
- GPtrArray *list = g_ptr_array_new();
- guint32 c;
- int inquote = 0;
-
- words = g_malloc0(sizeof(*words));
- w = g_string_new("");
-
- do {
- c = camel_utf8_getc(&in);
-
- if (c == 0
- || (inquote && c == '"')
- || (!inquote && g_unichar_isspace(c))) {
- output_w(w, list, type);
- all |= type;
- type = CAMEL_SEARCH_WORD_SIMPLE;
- inquote = 0;
- } else {
- if (c == '\\') {
- c = camel_utf8_getc(&in);
- if (c)
- output_c(w, c, &type);
- else {
- output_w(w, list, type);
- all |= type;
- }
- } else if (c == '\"') {
- inquote = 1;
- } else {
- output_c(w, c, &type);
- }
- }
- } while (c);
-
- g_string_free(w, TRUE);
- words->len = list->len;
- words->words = (struct _camel_search_word **)list->pdata;
- words->type = all;
- g_ptr_array_free(list, FALSE);
-
- return words;
-}
-
-/* takes an existing 'words' list, and converts it to another consisting of
- only simple words, with any punctuation etc stripped */
-struct _camel_search_words *
-camel_search_words_simple(struct _camel_search_words *wordin)
-{
- int i;
- const unsigned char *ptr, *start, *last;
- int type = CAMEL_SEARCH_WORD_SIMPLE, all = 0;
- GPtrArray *list = g_ptr_array_new();
- struct _camel_search_word *word;
- struct _camel_search_words *words;
- guint32 c;
-
- words = g_malloc0(sizeof(*words));
-
- for (i=0;i<wordin->len;i++) {
- if ((wordin->words[i]->type & CAMEL_SEARCH_WORD_COMPLEX) == 0) {
- word = g_malloc0(sizeof(*word));
- word->type = wordin->words[i]->type;
- word->word = g_strdup(wordin->words[i]->word);
- g_ptr_array_add(list, word);
- } else {
- ptr = wordin->words[i]->word;
- start = last = ptr;
- do {
- c = camel_utf8_getc(&ptr);
- if (c == 0 || !g_unichar_isalnum(c)) {
- if (last > start) {
- word = g_malloc0(sizeof(*word));
- word->word = g_strndup(start, last-start);
- word->type = type;
- g_ptr_array_add(list, word);
- all |= type;
- type = CAMEL_SEARCH_WORD_SIMPLE;
- }
- start = ptr;
- }
- if (c > 0x80)
- type = CAMEL_SEARCH_WORD_8BIT;
- last = ptr;
- } while (c);
- }
- }
-
- words->len = list->len;
- words->words = (struct _camel_search_word **)list->pdata;
- words->type = all;
- g_ptr_array_free(list, FALSE);
-
- return words;
-}
-
-void
-camel_search_words_free(struct _camel_search_words *words)
-{
- int i;
-
- for (i=0;i<words->len;i++) {
- struct _camel_search_word *word = words->words[i];
-
- g_free(word->word);
- g_free(word);
- }
- g_free(words->words);
- g_free(words);
-}
-
diff --git a/camel/camel-search-private.h b/camel/camel-search-private.h
deleted file mode 100644
index 8e83f7aed3..0000000000
--- a/camel/camel-search-private.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (C) 2001 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef _CAMEL_SEARCH_PRIVATE_H
-#define _CAMEL_SEARCH_PRIVATE_H
-
-#include <regex.h>
-
-typedef enum {
- CAMEL_SEARCH_MATCH_START = 1<<0,
- CAMEL_SEARCH_MATCH_END = 1<<1,
- CAMEL_SEARCH_MATCH_REGEX = 1<<2, /* disables the first 2 */
- CAMEL_SEARCH_MATCH_ICASE = 1<<3,
- CAMEL_SEARCH_MATCH_NEWLINE = 1<<4,
-} camel_search_flags_t;
-
-typedef enum {
- CAMEL_SEARCH_MATCH_EXACT,
- CAMEL_SEARCH_MATCH_CONTAINS,
- CAMEL_SEARCH_MATCH_STARTS,
- CAMEL_SEARCH_MATCH_ENDS,
- CAMEL_SEARCH_MATCH_SOUNDEX,
-} camel_search_match_t;
-
-typedef enum {
- CAMEL_SEARCH_TYPE_ASIS,
- CAMEL_SEARCH_TYPE_ENCODED,
- CAMEL_SEARCH_TYPE_ADDRESS,
- CAMEL_SEARCH_TYPE_ADDRESS_ENCODED,
- CAMEL_SEARCH_TYPE_MLIST, /* its a mailing list pseudo-header */
-} camel_search_t;
-
-/* builds a regex that represents a string search */
-int camel_search_build_match_regex(regex_t *pattern, camel_search_flags_t type, int argc, struct _ESExpResult **argv, CamelException *ex);
-gboolean camel_search_message_body_contains(CamelDataWrapper *object, regex_t *pattern);
-
-gboolean camel_search_header_match(const char *value, const char *match, camel_search_match_t how, camel_search_t type, const char *default_charset);
-gboolean camel_search_camel_header_soundex(const char *header, const char *match);
-
-/* TODO: replace with a real search function */
-const char *camel_ustrstrcase(const char *haystack, const char *needle);
-
-/* Some crappy utility functions for handling multiple search words */
-enum _camel_search_word_t {
- CAMEL_SEARCH_WORD_SIMPLE = 1,
- CAMEL_SEARCH_WORD_COMPLEX = 2,
- CAMEL_SEARCH_WORD_8BIT = 4,
-};
-struct _camel_search_word {
- enum _camel_search_word_t type;
- char *word;
-};
-
-struct _camel_search_words {
- int len;
- enum _camel_search_word_t type; /* OR of all word types in list */
- struct _camel_search_word **words;
-};
-
-struct _camel_search_words *camel_search_words_split(const unsigned char *in);
-struct _camel_search_words *camel_search_words_simple(struct _camel_search_words *wordin);
-void camel_search_words_free(struct _camel_search_words *);
-
-#endif /* ! _CAMEL_SEARCH_PRIVATE_H */
-
diff --git a/camel/camel-seekable-stream.c b/camel/camel-seekable-stream.c
deleted file mode 100644
index 874d68e40c..0000000000
--- a/camel/camel-seekable-stream.c
+++ /dev/null
@@ -1,202 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Author:
- * Bertrand Guiheneuf <bertrand@helixcode.com>
- *
- * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "camel-seekable-stream.h"
-
-static CamelStreamClass *parent_class = NULL;
-
-/* Returns the class for a CamelSeekableStream */
-#define CSS_CLASS(so) CAMEL_SEEKABLE_STREAM_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-
-static off_t seek (CamelSeekableStream *stream, off_t offset,
- CamelStreamSeekPolicy policy);
-static off_t stream_tell (CamelSeekableStream *stream);
-static int reset (CamelStream *stream);
-static int set_bounds (CamelSeekableStream *stream, off_t start, off_t end);
-
-static void
-camel_seekable_stream_class_init (CamelSeekableStreamClass *camel_seekable_stream_class)
-{
- CamelStreamClass *camel_stream_class =
- CAMEL_STREAM_CLASS (camel_seekable_stream_class);
-
- parent_class = CAMEL_STREAM_CLASS( camel_type_get_global_classfuncs( CAMEL_STREAM_TYPE ) );
-
- /* seekable stream methods */
- camel_seekable_stream_class->seek = seek;
- camel_seekable_stream_class->tell = stream_tell;
- camel_seekable_stream_class->set_bounds = set_bounds;
-
- /* camel stream methods overload */
- camel_stream_class->reset = reset;
-}
-
-static void
-camel_seekable_stream_init (void *o)
-{
- CamelSeekableStream *stream = (CamelSeekableStream *)o;
-
- stream->bound_start = 0;
- stream->bound_end = CAMEL_STREAM_UNBOUND;
-}
-
-CamelType
-camel_seekable_stream_get_type (void)
-{
- static CamelType camel_seekable_stream_type = CAMEL_INVALID_TYPE;
-
- if (camel_seekable_stream_type == CAMEL_INVALID_TYPE) {
- camel_seekable_stream_type = camel_type_register( CAMEL_STREAM_TYPE,
- "CamelSeekableStream",
- sizeof( CamelSeekableStream ),
- sizeof( CamelSeekableStreamClass ),
- (CamelObjectClassInitFunc) camel_seekable_stream_class_init,
- NULL,
- (CamelObjectInitFunc) camel_seekable_stream_init,
- NULL );
- }
-
- return camel_seekable_stream_type;
-}
-
-
-static off_t
-seek (CamelSeekableStream *stream, off_t offset,
- CamelStreamSeekPolicy policy)
-{
- g_warning ("CamelSeekableStream::seek called on default "
- "implementation\n");
- return -1;
-}
-
-/**
- * camel_stream_seek:
- * @stream: a CamelStream object.
- * @offset: offset value
- * @policy: what to do with the offset
- *
- * Seek to the specified position in @stream.
- *
- * If @policy is CAMEL_STREAM_SET, seeks to @offset.
- *
- * If @policy is CAMEL_STREAM_CUR, seeks to the current position plus
- * @offset.
- *
- * If @policy is CAMEL_STREAM_END, seeks to the end of the stream plus
- * @offset.
- *
- * Regardless of @policy, the stream's final position will be clamped
- * to the range specified by its lower and upper bounds, and the
- * stream's eos state will be updated.
- *
- * Return value: new position, -1 if operation failed.
- **/
-off_t
-camel_seekable_stream_seek (CamelSeekableStream *stream, off_t offset,
- CamelStreamSeekPolicy policy)
-{
- g_return_val_if_fail (CAMEL_IS_SEEKABLE_STREAM (stream), -1);
-
- return CSS_CLASS (stream)->seek (stream, offset, policy);
-}
-
-
-static off_t
-stream_tell (CamelSeekableStream *stream)
-{
- return stream->position;
-}
-
-/**
- * camel_seekable_stream_tell:
- * @stream: seekable stream object
- *
- * Get the current position of a seekable stream.
- *
- * Return value: the position.
- **/
-off_t
-camel_seekable_stream_tell (CamelSeekableStream *stream)
-{
- g_return_val_if_fail (CAMEL_IS_SEEKABLE_STREAM (stream), -1);
-
- return CSS_CLASS (stream)->tell (stream);
-}
-
-static int
-set_bounds (CamelSeekableStream *stream, off_t start, off_t end)
-{
- /* store the bounds */
- stream->bound_start = start;
- stream->bound_end = end;
-
- if (start > stream->position)
- return camel_seekable_stream_seek (stream, start, CAMEL_STREAM_SET);
-
- return 0;
-}
-
-/**
- * camel_seekable_stream_set_bounds:
- * @stream: a seekable stream
- * @start: the first valid position
- * @end: the first invalid position, or CAMEL_STREAM_UNBOUND
- *
- * Set the range of valid data this stream is allowed to cover. If
- * there is to be no @end value, then @end should be set to
- * #CAMEL_STREAM_UNBOUND.
- *
- * Return value: -1 on error.
- **/
-int
-camel_seekable_stream_set_bounds (CamelSeekableStream *stream,
- off_t start, off_t end)
-{
- g_return_val_if_fail (CAMEL_IS_SEEKABLE_STREAM (stream), -1);
- g_return_val_if_fail (end == CAMEL_STREAM_UNBOUND || end >= start, -1);
-
- return CSS_CLASS (stream)->set_bounds (stream, start, end);
-}
-
-/* a default implementation of reset for seekable streams */
-static int
-reset (CamelStream *stream)
-{
- CamelSeekableStream *seekable_stream;
-
- seekable_stream = CAMEL_SEEKABLE_STREAM (stream);
-
- return camel_seekable_stream_seek (seekable_stream,
- seekable_stream->bound_start,
- CAMEL_STREAM_SET);
-}
-
-
-
-
-
-
diff --git a/camel/camel-seekable-stream.h b/camel/camel-seekable-stream.h
deleted file mode 100644
index 9ac73c7ee8..0000000000
--- a/camel/camel-seekable-stream.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-stream-fs.h :stream based on unix filesystem */
-
-/*
- * Author:
- * Bertrand Guiheneuf <bertrand@helixcode.com>
- *
- * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifndef CAMEL_SEEKABLE_STREAM_H
-#define CAMEL_SEEKABLE_STREAM_H 1
-
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include <sys/types.h>
-#include <unistd.h>
-#include <camel/camel-stream.h>
-
-#define CAMEL_SEEKABLE_STREAM_TYPE (camel_seekable_stream_get_type ())
-#define CAMEL_SEEKABLE_STREAM(obj) (CAMEL_CHECK_CAST((obj), CAMEL_SEEKABLE_STREAM_TYPE, CamelSeekableStream))
-#define CAMEL_SEEKABLE_STREAM_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_SEEKABLE_STREAM_TYPE, CamelSeekableStreamClass))
-#define CAMEL_IS_SEEKABLE_STREAM(o) (CAMEL_CHECK_TYPE((o), CAMEL_SEEKABLE_STREAM_TYPE))
-
-
-typedef enum
-{
- CAMEL_STREAM_SET = SEEK_SET,
- CAMEL_STREAM_CUR = SEEK_CUR,
- CAMEL_STREAM_END = SEEK_END
-} CamelStreamSeekPolicy;
-
-#define CAMEL_STREAM_UNBOUND (~0)
-
-struct _CamelSeekableStream
-{
- CamelStream parent_object;
-
- off_t position; /* current postion in the stream */
- off_t bound_start; /* first valid position */
- off_t bound_end; /* first invalid position */
-};
-
-typedef struct {
- CamelStreamClass parent_class;
-
- /* Virtual methods */
- off_t (*seek) (CamelSeekableStream *stream, off_t offset,
- CamelStreamSeekPolicy policy);
- off_t (*tell) (CamelSeekableStream *stream);
- int (*set_bounds) (CamelSeekableStream *stream,
- off_t start, off_t end);
-} CamelSeekableStreamClass;
-
-/* Standard Camel function */
-CamelType camel_seekable_stream_get_type (void);
-
-/* public methods */
-off_t camel_seekable_stream_seek (CamelSeekableStream *stream, off_t offset,
- CamelStreamSeekPolicy policy);
-off_t camel_seekable_stream_tell (CamelSeekableStream *stream);
-int camel_seekable_stream_set_bounds (CamelSeekableStream *, off_t start, off_t end);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_SEEKABLE_STREAM_H */
diff --git a/camel/camel-seekable-substream.c b/camel/camel-seekable-substream.c
deleted file mode 100644
index e92f4e0549..0000000000
--- a/camel/camel-seekable-substream.c
+++ /dev/null
@@ -1,302 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-stream-fs.c : file system based stream
- *
- * Authors: Bertrand Guiheneuf <bertrand@helixcode.com>
- * Michael Zucchi <notzed@ximian.com>
- *
- * Copyright 1999-2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "camel-seekable-substream.h"
-
-static CamelSeekableStreamClass *parent_class = NULL;
-
-/* Returns the class for a CamelSeekableSubStream */
-#define CSS_CLASS(so) CAMEL_SEEKABLE_SUBSTREAM_CLASS (CAMEL_OBJECT(so)->klass)
-
-static ssize_t stream_read (CamelStream *stream, char *buffer, size_t n);
-static ssize_t stream_write (CamelStream *stream, const char *buffer, size_t n);
-static int stream_flush (CamelStream *stream);
-static int stream_close (CamelStream *stream);
-static gboolean eos (CamelStream *stream);
-static off_t stream_seek (CamelSeekableStream *stream, off_t offset,
- CamelStreamSeekPolicy policy);
-
-static void
-camel_seekable_substream_class_init (CamelSeekableSubstreamClass *camel_seekable_substream_class)
-{
- CamelSeekableStreamClass *camel_seekable_stream_class =
- CAMEL_SEEKABLE_STREAM_CLASS (camel_seekable_substream_class);
- CamelStreamClass *camel_stream_class =
- CAMEL_STREAM_CLASS (camel_seekable_substream_class);
-
- parent_class = CAMEL_SEEKABLE_STREAM_CLASS (camel_type_get_global_classfuncs (camel_seekable_stream_get_type ()));
-
- /* virtual method definition */
-
- /* virtual method overload */
- camel_stream_class->read = stream_read;
- camel_stream_class->write = stream_write;
- camel_stream_class->flush = stream_flush;
- camel_stream_class->close = stream_close;
- camel_stream_class->eos = eos;
-
- camel_seekable_stream_class->seek = stream_seek;
-
-}
-
-static void
-camel_seekable_substream_finalize (CamelObject *object)
-{
- CamelSeekableSubstream *seekable_substream =
- CAMEL_SEEKABLE_SUBSTREAM (object);
-
- if (seekable_substream->parent_stream)
- camel_object_unref (seekable_substream->parent_stream);
-}
-
-
-CamelType
-camel_seekable_substream_get_type (void)
-{
- static CamelType camel_seekable_substream_type = CAMEL_INVALID_TYPE;
-
- if (camel_seekable_substream_type == CAMEL_INVALID_TYPE) {
- camel_seekable_substream_type = camel_type_register (camel_seekable_stream_get_type (), "CamelSeekableSubstream",
- sizeof (CamelSeekableSubstream),
- sizeof (CamelSeekableSubstreamClass),
- (CamelObjectClassInitFunc) camel_seekable_substream_class_init,
- NULL,
- NULL,
- (CamelObjectFinalizeFunc) camel_seekable_substream_finalize);
- }
-
- return camel_seekable_substream_type;
-}
-
-/**
- * camel_seekable_substream_new:
- * @parent_stream: a seekable parent stream
- * @inf_bound: a lower bound
- * @sup_bound: an upper bound
- *
- * Creates a new CamelSeekableSubstream that references the portion
- * of @parent_stream from @inf_bound to @sup_bound. (If @sup_bound is
- * #CAMEL_STREAM_UNBOUND, it references to the end of stream, even if
- * the stream grows.)
- *
- * While the substream is open, the caller cannot assume anything about
- * the current position of @parent_stream. After the substream has been
- * closed, @parent_stream will stabilize again.
- *
- * Return value: the substream
- **/
-CamelStream *
-camel_seekable_substream_new(CamelSeekableStream *parent_stream, off_t start, off_t end)
-{
- CamelSeekableSubstream *seekable_substream;
-
- g_return_val_if_fail (CAMEL_IS_SEEKABLE_STREAM (parent_stream), NULL);
-
- /* Create the seekable substream. */
- seekable_substream = CAMEL_SEEKABLE_SUBSTREAM (camel_object_new (camel_seekable_substream_get_type ()));
-
- /* Initialize it. */
- seekable_substream->parent_stream = parent_stream;
- camel_object_ref (parent_stream);
-
- /* Set the bound of the substream. We can ignore any possible error
- * here, because if we fail to seek now, it will try again later.
- */
- camel_seekable_stream_set_bounds ((CamelSeekableStream *)seekable_substream, start, end);
-
- return CAMEL_STREAM (seekable_substream);
-}
-
-static gboolean
-parent_reset (CamelSeekableSubstream *seekable_substream, CamelSeekableStream *parent)
-{
- CamelSeekableStream *seekable_stream = CAMEL_SEEKABLE_STREAM (seekable_substream);
-
- if (camel_seekable_stream_tell (parent) == seekable_stream->position)
- return TRUE;
-
- return camel_seekable_stream_seek (parent, seekable_stream->position, CAMEL_STREAM_SET) == seekable_stream->position;
-}
-
-static ssize_t
-stream_read (CamelStream *stream, char *buffer, size_t n)
-{
- CamelSeekableStream *parent;
- CamelSeekableStream *seekable_stream = CAMEL_SEEKABLE_STREAM (stream);
- CamelSeekableSubstream *seekable_substream = CAMEL_SEEKABLE_SUBSTREAM (stream);
- ssize_t v;
-
- if (n == 0)
- return 0;
-
- parent = seekable_substream->parent_stream;
-
- /* Go to our position in the parent stream. */
- if (!parent_reset (seekable_substream, parent)) {
- stream->eos = TRUE;
- return 0;
- }
-
- /* Compute how many bytes should be read. */
- if (seekable_stream->bound_end != CAMEL_STREAM_UNBOUND)
- n = MIN (seekable_stream->bound_end - seekable_stream->position, n);
-
- if (n == 0) {
- stream->eos = TRUE;
- return 0;
- }
-
- v = camel_stream_read (CAMEL_STREAM (parent), buffer, n);
-
- /* ignore <0 - it's an error, let the caller deal */
- if (v > 0)
- seekable_stream->position += v;
-
- return v;
-}
-
-static ssize_t
-stream_write (CamelStream *stream, const char *buffer, size_t n)
-{
- CamelSeekableStream *parent;
- CamelSeekableStream *seekable_stream = CAMEL_SEEKABLE_STREAM(stream);
- CamelSeekableSubstream *seekable_substream = CAMEL_SEEKABLE_SUBSTREAM(stream);
- ssize_t v;
-
- if (n == 0)
- return 0;
-
- parent = seekable_substream->parent_stream;
-
- /* Go to our position in the parent stream. */
- if (!parent_reset (seekable_substream, parent)) {
- stream->eos = TRUE;
- return 0;
- }
-
- /* Compute how many bytes should be written. */
- if (seekable_stream->bound_end != CAMEL_STREAM_UNBOUND)
- n = MIN (seekable_stream->bound_end - seekable_stream->position, n);
-
- if (n == 0) {
- stream->eos = TRUE;
- return 0;
- }
-
- v = camel_stream_write((CamelStream *)parent, buffer, n);
-
- /* ignore <0 - it's an error, let the caller deal */
- if (v > 0)
- seekable_stream->position += v;
-
- return v;
-
-}
-
-static int
-stream_flush (CamelStream *stream)
-{
- CamelSeekableSubstream *sus = (CamelSeekableSubstream *)stream;
-
- return camel_stream_flush(CAMEL_STREAM(sus->parent_stream));
-}
-
-static int
-stream_close (CamelStream *stream)
-{
- /* we dont really want to close the substream ... */
- return 0;
-}
-
-static gboolean
-eos (CamelStream *stream)
-{
- CamelSeekableSubstream *seekable_substream = CAMEL_SEEKABLE_SUBSTREAM(stream);
- CamelSeekableStream *seekable_stream = CAMEL_SEEKABLE_STREAM(stream);
- CamelSeekableStream *parent;
- gboolean eos;
-
- if (stream->eos)
- eos = TRUE;
- else {
- parent = seekable_substream->parent_stream;
- if (!parent_reset (seekable_substream, parent))
- return TRUE;
-
- eos = camel_stream_eos (CAMEL_STREAM (parent));
- if (!eos && (seekable_stream->bound_end != CAMEL_STREAM_UNBOUND)) {
- eos = seekable_stream->position >= seekable_stream->bound_end;
- }
- }
-
- return eos;
-}
-
-static off_t
-stream_seek (CamelSeekableStream *seekable_stream, off_t offset,
- CamelStreamSeekPolicy policy)
-{
- CamelSeekableSubstream *seekable_substream = CAMEL_SEEKABLE_SUBSTREAM(seekable_stream);
- CamelStream *stream = CAMEL_STREAM(seekable_stream);
- off_t real_offset = 0;
-
- stream->eos = FALSE;
-
- switch (policy) {
- case CAMEL_STREAM_SET:
- real_offset = offset;
- break;
-
- case CAMEL_STREAM_CUR:
- real_offset = seekable_stream->position + offset;
- break;
-
- case CAMEL_STREAM_END:
- if (seekable_stream->bound_end == CAMEL_STREAM_UNBOUND) {
- real_offset = camel_seekable_stream_seek(seekable_substream->parent_stream,
- offset,
- CAMEL_STREAM_END);
- if (real_offset != -1) {
- if (real_offset<seekable_stream->bound_start)
- real_offset = seekable_stream->bound_start;
- seekable_stream->position = real_offset;
- }
- return real_offset;
- }
- real_offset = seekable_stream->bound_end + offset;
- break;
- }
-
- if (seekable_stream->bound_end != CAMEL_STREAM_UNBOUND)
- real_offset = MIN (real_offset, seekable_stream->bound_end);
-
- if (real_offset<seekable_stream->bound_start)
- real_offset = seekable_stream->bound_start;
-
- seekable_stream->position = real_offset;
- return real_offset;
-}
diff --git a/camel/camel-seekable-substream.h b/camel/camel-seekable-substream.h
deleted file mode 100644
index b500944298..0000000000
--- a/camel/camel-seekable-substream.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-seekable-substream.h: stream that piggybacks on another stream */
-
-/*
- * Author:
- * Bertrand Guiheneuf <bertrand@helixcode.com>
- *
- * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifndef CAMEL_SEEKABLE_SUBSTREAM_H
-#define CAMEL_SEEKABLE_SUBSTREAM_H 1
-
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include <camel/camel-seekable-stream.h>
-
-#define CAMEL_SEEKABLE_SUBSTREAM_TYPE (camel_seekable_substream_get_type ())
-#define CAMEL_SEEKABLE_SUBSTREAM(obj) (CAMEL_CHECK_CAST((obj), CAMEL_SEEKABLE_SUBSTREAM_TYPE, CamelSeekableSubstream))
-#define CAMEL_SEEKABLE_SUBSTREAM_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_SEEKABLE_SUBSTREAM_TYPE, CamelSeekableSubstreamClass))
-#define CAMEL_IS_SEEKABLE_SUBSTREAM(o) (CAMEL_CHECK_TYPE((o), CAMEL_SEEKABLE_SUBSTREAM_TYPE))
-
-struct _CamelSeekableSubstream
-{
- CamelSeekableStream parent_object;
-
- /* --**-- Private fields --**-- */
- CamelSeekableStream *parent_stream;
-};
-
-typedef struct {
- CamelSeekableStreamClass parent_class;
-
-} CamelSeekableSubstreamClass;
-
-/* Standard Camel function */
-CamelType camel_seekable_substream_get_type (void);
-
-/* public methods */
-
-/* obtain a new seekable substream */
-CamelStream *
-camel_seekable_substream_new(CamelSeekableStream *parent_stream, off_t start, off_t end);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_SEEKABLE_SUBSTREAM_H */
diff --git a/camel/camel-service.c b/camel/camel-service.c
deleted file mode 100644
index cd66bb9cb1..0000000000
--- a/camel/camel-service.c
+++ /dev/null
@@ -1,958 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-service.c : Abstract class for an email service */
-
-/*
- *
- * Author :
- * Bertrand Guiheneuf <bertrand@helixcode.com>
- *
- * Copyright 1999-2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-#include <pthread.h>
-#include <errno.h>
-
-#include "e-util/e-msgport.h"
-
-#include "e-util/e-host-utils.h"
-
-#include "camel-service.h"
-#include "camel-session.h"
-#include "camel-exception.h"
-#include "camel-operation.h"
-#include "camel-private.h"
-
-#define d(x)
-#define w(x)
-
-static CamelObjectClass *parent_class = NULL;
-
-/* Returns the class for a CamelService */
-#define CSERV_CLASS(so) CAMEL_SERVICE_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-
-static void construct (CamelService *service, CamelSession *session,
- CamelProvider *provider, CamelURL *url,
- CamelException *ex);
-static gboolean service_connect(CamelService *service, CamelException *ex);
-static gboolean service_disconnect(CamelService *service, gboolean clean,
- CamelException *ex);
-static void cancel_connect (CamelService *service);
-static GList *query_auth_types (CamelService *service, CamelException *ex);
-static char *get_name (CamelService *service, gboolean brief);
-static char *get_path (CamelService *service);
-
-static int service_setv (CamelObject *object, CamelException *ex, CamelArgV *args);
-static int service_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args);
-
-
-static void
-camel_service_class_init (CamelServiceClass *camel_service_class)
-{
- CamelObjectClass *object_class = CAMEL_OBJECT_CLASS (camel_service_class);
-
- parent_class = camel_type_get_global_classfuncs (CAMEL_OBJECT_TYPE);
-
- /* virtual method overloading */
- object_class->setv = service_setv;
- object_class->getv = service_getv;
-
- /* virtual method definition */
- camel_service_class->construct = construct;
- camel_service_class->connect = service_connect;
- camel_service_class->disconnect = service_disconnect;
- camel_service_class->cancel_connect = cancel_connect;
- camel_service_class->query_auth_types = query_auth_types;
- camel_service_class->get_name = get_name;
- camel_service_class->get_path = get_path;
-}
-
-static void
-camel_service_init (void *o, void *k)
-{
- CamelService *service = o;
-
- service->priv = g_malloc0(sizeof(*service->priv));
- service->priv->connect_lock = e_mutex_new(E_MUTEX_REC);
- service->priv->connect_op_lock = e_mutex_new(E_MUTEX_SIMPLE);
-}
-
-static void
-camel_service_finalize (CamelObject *object)
-{
- CamelService *service = CAMEL_SERVICE (object);
-
- if (service->status == CAMEL_SERVICE_CONNECTED) {
- CamelException ex;
-
- camel_exception_init (&ex);
- CSERV_CLASS (service)->disconnect (service, TRUE, &ex);
- if (camel_exception_is_set (&ex)) {
- w(g_warning ("camel_service_finalize: silent disconnect failure: %s",
- camel_exception_get_description (&ex)));
- }
- camel_exception_clear (&ex);
- }
-
- if (service->url)
- camel_url_free (service->url);
- if (service->session)
- camel_object_unref (service->session);
-
- e_mutex_destroy (service->priv->connect_lock);
- e_mutex_destroy (service->priv->connect_op_lock);
-
- g_free (service->priv);
-}
-
-
-
-CamelType
-camel_service_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type =
- camel_type_register (CAMEL_OBJECT_TYPE,
- "CamelService",
- sizeof (CamelService),
- sizeof (CamelServiceClass),
- (CamelObjectClassInitFunc) camel_service_class_init,
- NULL,
- (CamelObjectInitFunc) camel_service_init,
- camel_service_finalize );
- }
-
- return type;
-}
-
-
-static int
-service_setv (CamelObject *object, CamelException *ex, CamelArgV *args)
-{
- CamelService *service = (CamelService *) object;
- CamelURL *url = service->url;
- gboolean reconnect = FALSE;
- guint32 tag;
- int i;
-
- for (i = 0; i < args->argc; i++) {
- tag = args->argv[i].tag;
-
- /* make sure this arg wasn't already handled */
- if (tag & CAMEL_ARG_IGNORE)
- continue;
-
- /* make sure this is an arg we're supposed to handle */
- if ((tag & CAMEL_ARG_TAG) <= CAMEL_SERVICE_ARG_FIRST ||
- (tag & CAMEL_ARG_TAG) >= CAMEL_SERVICE_ARG_FIRST + 100)
- continue;
-
- if (tag == CAMEL_SERVICE_USERNAME) {
- /* set the username */
- if (strcmp (url->user, args->argv[i].ca_str) != 0) {
- camel_url_set_user (url, args->argv[i].ca_str);
- reconnect = TRUE;
- }
- } else if (tag == CAMEL_SERVICE_AUTH) {
- /* set the auth mechanism */
- if (strcmp (url->authmech, args->argv[i].ca_str) != 0) {
- camel_url_set_authmech (url, args->argv[i].ca_str);
- reconnect = TRUE;
- }
- } else if (tag == CAMEL_SERVICE_HOSTNAME) {
- /* set the hostname */
- if (strcmp (url->host, args->argv[i].ca_str) != 0) {
- camel_url_set_host (url, args->argv[i].ca_str);
- reconnect = TRUE;
- }
- } else if (tag == CAMEL_SERVICE_PORT) {
- /* set the port */
- if (url->port != args->argv[i].ca_int) {
- camel_url_set_port (url, args->argv[i].ca_int);
- reconnect = TRUE;
- }
- } else if (tag == CAMEL_SERVICE_PATH) {
- /* set the path */
- if (strcmp (url->path, args->argv[i].ca_str) != 0) {
- camel_url_set_host (url, args->argv[i].ca_str);
- reconnect = TRUE;
- }
- } else {
- /* error? */
- continue;
- }
-
- /* let our parent know that we've handled this arg */
- camel_argv_ignore (args, i);
- }
-
- /* FIXME: what if we are in the process of connecting? */
- if (reconnect && service->status == CAMEL_SERVICE_CONNECTED) {
- /* reconnect the service using the new URL */
- if (camel_service_disconnect (service, TRUE, ex))
- camel_service_connect (service, ex);
- }
-
- return CAMEL_OBJECT_CLASS (parent_class)->setv (object, ex, args);
-}
-
-static int
-service_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args)
-{
- CamelService *service = (CamelService *) object;
- CamelURL *url = service->url;
- guint32 tag;
- int i;
-
- for (i = 0; i < args->argc; i++) {
- tag = args->argv[i].tag;
-
- /* make sure this is an arg we're supposed to handle */
- if ((tag & CAMEL_ARG_TAG) <= CAMEL_SERVICE_ARG_FIRST ||
- (tag & CAMEL_ARG_TAG) >= CAMEL_SERVICE_ARG_FIRST + 100)
- continue;
-
- switch (tag) {
- case CAMEL_SERVICE_USERNAME:
- /* get the username */
- *args->argv[i].ca_str = url->user;
- break;
- case CAMEL_SERVICE_AUTH:
- /* get the auth mechanism */
- *args->argv[i].ca_str = url->authmech;
- break;
- case CAMEL_SERVICE_HOSTNAME:
- /* get the hostname */
- *args->argv[i].ca_str = url->host;
- break;
- case CAMEL_SERVICE_PORT:
- /* get the port */
- *args->argv[i].ca_int = url->port;
- break;
- case CAMEL_SERVICE_PATH:
- /* get the path */
- *args->argv[i].ca_str = url->path;
- break;
- default:
- /* error? */
- break;
- }
- }
-
- return CAMEL_OBJECT_CLASS (parent_class)->getv (object, ex, args);
-}
-
-static void
-construct (CamelService *service, CamelSession *session,
- CamelProvider *provider, CamelURL *url, CamelException *ex)
-{
- char *url_string;
-
- if (CAMEL_PROVIDER_NEEDS (provider, CAMEL_URL_PART_USER) &&
- (url->user == NULL || url->user[0] == '\0')) {
- url_string = camel_url_to_string (url, CAMEL_URL_HIDE_PASSWORD);
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_URL_INVALID,
- _("URL '%s' needs a username component"),
- url_string);
- g_free (url_string);
- return;
- } else if (CAMEL_PROVIDER_NEEDS (provider, CAMEL_URL_PART_HOST) &&
- (url->host == NULL || url->host[0] == '\0')) {
- url_string = camel_url_to_string (url, CAMEL_URL_HIDE_PASSWORD);
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_URL_INVALID,
- _("URL '%s' needs a host component"),
- url_string);
- g_free (url_string);
- return;
- } else if (CAMEL_PROVIDER_NEEDS (provider, CAMEL_URL_PART_PATH) &&
- (url->path == NULL || url->path[0] == '\0')) {
- url_string = camel_url_to_string (url, CAMEL_URL_HIDE_PASSWORD);
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_URL_INVALID,
- _("URL '%s' needs a path component"),
- url_string);
- g_free (url_string);
- return;
- }
-
- service->provider = provider;
- service->url = url;
- service->session = session;
- camel_object_ref (session);
-
- service->status = CAMEL_SERVICE_DISCONNECTED;
-}
-
-/**
- * camel_service_construct:
- * @service: the CamelService
- * @session: the session for the service
- * @provider: the service's provider
- * @url: the default URL for the service (may be NULL)
- * @ex: a CamelException
- *
- * Constructs a CamelService initialized with the given parameters.
- **/
-void
-camel_service_construct (CamelService *service, CamelSession *session,
- CamelProvider *provider, CamelURL *url,
- CamelException *ex)
-{
- g_return_if_fail (CAMEL_IS_SERVICE (service));
- g_return_if_fail (CAMEL_IS_SESSION (session));
-
- CSERV_CLASS (service)->construct (service, session, provider, url, ex);
-}
-
-
-static gboolean
-service_connect (CamelService *service, CamelException *ex)
-{
- /* Things like the CamelMboxStore can validly
- * not define a connect function.
- */
- return TRUE;
-}
-
-/**
- * camel_service_connect:
- * @service: CamelService object
- * @ex: a CamelException
- *
- * Connect to the service using the parameters it was initialized
- * with.
- *
- * Return value: whether or not the connection succeeded
- **/
-
-gboolean
-camel_service_connect (CamelService *service, CamelException *ex)
-{
- gboolean ret = FALSE;
- gboolean unreg = FALSE;
-
- g_return_val_if_fail (CAMEL_IS_SERVICE (service), FALSE);
- g_return_val_if_fail (service->session != NULL, FALSE);
- g_return_val_if_fail (service->url != NULL, FALSE);
-
- CAMEL_SERVICE_LOCK (service, connect_lock);
-
- if (service->status == CAMEL_SERVICE_CONNECTED) {
- CAMEL_SERVICE_UNLOCK (service, connect_lock);
- return TRUE;
- }
-
- /* Register a separate operation for connecting, so that
- * the offline code can cancel it.
- */
- CAMEL_SERVICE_LOCK (service, connect_op_lock);
- service->connect_op = camel_operation_registered ();
- if (!service->connect_op) {
- service->connect_op = camel_operation_new (NULL, NULL);
- camel_operation_register (service->connect_op);
- unreg = TRUE;
- }
- CAMEL_SERVICE_UNLOCK (service, connect_op_lock);
-
- service->status = CAMEL_SERVICE_CONNECTING;
- ret = CSERV_CLASS (service)->connect (service, ex);
- service->status = ret ? CAMEL_SERVICE_CONNECTED : CAMEL_SERVICE_DISCONNECTED;
-
- CAMEL_SERVICE_LOCK (service, connect_op_lock);
- if (service->connect_op) {
- if (unreg)
- camel_operation_unregister (service->connect_op);
-
- camel_operation_unref (service->connect_op);
- service->connect_op = NULL;
- }
- CAMEL_SERVICE_UNLOCK (service, connect_op_lock);
-
- CAMEL_SERVICE_UNLOCK (service, connect_lock);
-
- return ret;
-}
-
-static gboolean
-service_disconnect (CamelService *service, gboolean clean, CamelException *ex)
-{
- /*service->connect_level--;*/
-
- /* We let people get away with not having a disconnect
- * function -- CamelMboxStore, for example.
- */
-
- return TRUE;
-}
-
-/**
- * camel_service_disconnect:
- * @service: CamelService object
- * @clean: whether or not to try to disconnect cleanly.
- * @ex: a CamelException
- *
- * Disconnect from the service. If @clean is %FALSE, it should not
- * try to do any synchronizing or other cleanup of the connection.
- *
- * Return value: whether or not the disconnection succeeded without
- * errors. (Consult @ex if %FALSE.)
- **/
-gboolean
-camel_service_disconnect (CamelService *service, gboolean clean,
- CamelException *ex)
-{
- gboolean res = TRUE;
- int unreg = FALSE;
-
- CAMEL_SERVICE_LOCK (service, connect_lock);
-
- if (service->status != CAMEL_SERVICE_DISCONNECTED
- && service->status != CAMEL_SERVICE_DISCONNECTING) {
- CAMEL_SERVICE_LOCK (service, connect_op_lock);
- service->connect_op = camel_operation_registered ();
- if (!service->connect_op) {
- service->connect_op = camel_operation_new (NULL, NULL);
- camel_operation_register (service->connect_op);
- unreg = TRUE;
- }
- CAMEL_SERVICE_UNLOCK (service, connect_op_lock);
-
- service->status = CAMEL_SERVICE_DISCONNECTING;
- res = CSERV_CLASS (service)->disconnect (service, clean, ex);
- service->status = CAMEL_SERVICE_DISCONNECTED;
-
- CAMEL_SERVICE_LOCK (service, connect_op_lock);
- if (unreg)
- camel_operation_unregister (service->connect_op);
-
- camel_operation_unref (service->connect_op);
- service->connect_op = NULL;
- CAMEL_SERVICE_UNLOCK (service, connect_op_lock);
- }
-
- CAMEL_SERVICE_UNLOCK (service, connect_lock);
-
- return res;
-}
-
-static void
-cancel_connect (CamelService *service)
-{
- camel_operation_cancel (service->connect_op);
-}
-
-/**
- * camel_service_cancel_connect:
- * @service: a service
- *
- * If @service is currently attempting to connect to or disconnect
- * from a server, this causes it to stop and fail. Otherwise it is a
- * no-op.
- **/
-void
-camel_service_cancel_connect (CamelService *service)
-{
- CAMEL_SERVICE_LOCK (service, connect_op_lock);
- if (service->connect_op)
- CSERV_CLASS (service)->cancel_connect (service);
- CAMEL_SERVICE_UNLOCK (service, connect_op_lock);
-}
-
-/**
- * camel_service_get_url:
- * @service: a service
- *
- * Returns the URL representing a service. The returned URL must be
- * freed when it is no longer needed. For security reasons, this
- * routine does not return the password.
- *
- * Return value: the url name
- **/
-char *
-camel_service_get_url (CamelService *service)
-{
- return camel_url_to_string (service->url, CAMEL_URL_HIDE_PASSWORD);
-}
-
-
-static char *
-get_name (CamelService *service, gboolean brief)
-{
- w(g_warning ("CamelService::get_name not implemented for `%s'",
- camel_type_to_name (CAMEL_OBJECT_GET_TYPE (service))));
- return g_strdup ("???");
-}
-
-/**
- * camel_service_get_name:
- * @service: the service
- * @brief: whether or not to use a briefer form
- *
- * This gets the name of the service in a "friendly" (suitable for
- * humans) form. If @brief is %TRUE, this should be a brief description
- * such as for use in the folder tree. If @brief is %FALSE, it should
- * be a more complete and mostly unambiguous description.
- *
- * Return value: the description, which the caller must free.
- **/
-char *
-camel_service_get_name (CamelService *service, gboolean brief)
-{
- g_return_val_if_fail (CAMEL_IS_SERVICE (service), NULL);
- g_return_val_if_fail (service->url, NULL);
-
- return CSERV_CLASS (service)->get_name (service, brief);
-}
-
-
-static char *
-get_path (CamelService *service)
-{
- CamelProvider *prov = service->provider;
- CamelURL *url = service->url;
- GString *gpath;
- char *path;
-
- /* A sort of ad-hoc default implementation that works for our
- * current set of services.
- */
-
- gpath = g_string_new (service->provider->protocol);
- if (CAMEL_PROVIDER_ALLOWS (prov, CAMEL_URL_PART_USER)) {
- if (CAMEL_PROVIDER_ALLOWS (prov, CAMEL_URL_PART_HOST)) {
- g_string_append_printf (gpath, "/%s@%s",
- url->user ? url->user : "",
- url->host ? url->host : "");
-
- if (url->port)
- g_string_append_printf (gpath, ":%d", url->port);
- } else {
- g_string_append_printf (gpath, "/%s%s", url->user ? url->user : "",
- CAMEL_PROVIDER_NEEDS (prov, CAMEL_URL_PART_USER) ? "" : "@");
- }
- } else if (CAMEL_PROVIDER_ALLOWS (prov, CAMEL_URL_PART_HOST)) {
- g_string_append_printf (gpath, "/%s%s",
- CAMEL_PROVIDER_NEEDS (prov, CAMEL_URL_PART_HOST) ? "" : "@",
- url->host ? url->host : "");
-
- if (url->port)
- g_string_append_printf (gpath, ":%d", url->port);
- }
-
- if (CAMEL_PROVIDER_NEEDS (prov, CAMEL_URL_PART_PATH))
- g_string_append_printf (gpath, "%s%s", *url->path == '/' ? "" : "/", url->path);
-
- path = gpath->str;
- g_string_free (gpath, FALSE);
-
- return path;
-}
-
-/**
- * camel_service_get_path:
- * @service: the service
- *
- * This gets a valid UNIX relative path describing the service, which
- * is guaranteed to be different from the path returned for any
- * different service. This path MUST start with the name of the
- * provider, followed by a "/", but after that, it is up to the
- * provider.
- *
- * Return value: the path, which the caller must free.
- **/
-char *
-camel_service_get_path (CamelService *service)
-{
- g_return_val_if_fail (CAMEL_IS_SERVICE (service), NULL);
- g_return_val_if_fail (service->url, NULL);
-
- return CSERV_CLASS (service)->get_path (service);
-}
-
-
-/**
- * camel_service_get_session:
- * @service: a service
- *
- * Returns the CamelSession associated with the service.
- *
- * Return value: the session
- **/
-CamelSession *
-camel_service_get_session (CamelService *service)
-{
- return service->session;
-}
-
-/**
- * camel_service_get_provider:
- * @service: a service
- *
- * Returns the CamelProvider associated with the service.
- *
- * Return value: the provider
- **/
-CamelProvider *
-camel_service_get_provider (CamelService *service)
-{
- return service->provider;
-}
-
-static GList *
-query_auth_types (CamelService *service, CamelException *ex)
-{
- return NULL;
-}
-
-/**
- * camel_service_query_auth_types:
- * @service: a CamelService
- * @ex: a CamelException
- *
- * This is used by the mail source wizard to get the list of
- * authentication types supported by the protocol, and information
- * about them.
- *
- * Return value: a list of CamelServiceAuthType records. The caller
- * must free the list with g_list_free() when it is done with it.
- **/
-GList *
-camel_service_query_auth_types (CamelService *service, CamelException *ex)
-{
- GList *ret;
-
- /* note that we get the connect lock here, which means the callee
- must not call the connect functions itself */
- CAMEL_SERVICE_LOCK (service, connect_lock);
- ret = CSERV_CLASS (service)->query_auth_types (service, ex);
- CAMEL_SERVICE_UNLOCK (service, connect_lock);
-
- return ret;
-}
-
-/* URL utility routines */
-
-/**
- * camel_service_gethost:
- * @service: a CamelService
- * @ex: a CamelException
- *
- * This is a convenience function to do a gethostbyname on the host
- * for the service's URL.
- *
- * Return value: a (statically-allocated) hostent.
- **/
-struct hostent *
-camel_service_gethost (CamelService *service, CamelException *ex)
-{
- char *hostname;
-
- if (service->url->host)
- hostname = service->url->host;
- else
- hostname = "localhost";
-
- return camel_gethostbyname (hostname, ex);
-}
-
-#ifdef offsetof
-#define STRUCT_OFFSET(type, field) ((gint) offsetof (type, field))
-#else
-#define STRUCT_OFFSET(type, field) ((gint) ((gchar*) &((type *) 0)->field))
-#endif
-
-struct _lookup_msg {
- EMsg msg;
- unsigned int cancelled:1;
- const char *name;
- int len;
- int type;
- int result;
- int herr;
- struct hostent hostbuf;
- int hostbuflen;
- char *hostbufmem;
-};
-
-static void *
-get_hostbyname(void *data)
-{
- struct _lookup_msg *info = data;
-
- while ((info->result = e_gethostbyname_r(info->name, &info->hostbuf, info->hostbufmem, info->hostbuflen, &info->herr)) == ERANGE) {
- d(printf("gethostbyname fialed?\n"));
- pthread_testcancel();
- info->hostbuflen *= 2;
- info->hostbufmem = g_realloc(info->hostbufmem, info->hostbuflen);
- }
-
- d(printf("gethostbyname ok?\n"));
-
- /* If we got cancelled, dont reply, just free it */
- if (info->cancelled) {
- g_free(info->hostbufmem);
- g_free(info);
- } else {
- e_msgport_reply((EMsg *)info);
- }
-
- return NULL;
-}
-
-struct hostent *
-camel_gethostbyname (const char *name, CamelException *exout)
-{
- int fdmax, status, fd, cancel_fd;
- struct _lookup_msg *msg;
- CamelException ex;
-
- g_return_val_if_fail(name != NULL, NULL);
-
- if (camel_operation_cancel_check(NULL)) {
- camel_exception_set (exout, CAMEL_EXCEPTION_USER_CANCEL, _("Cancelled"));
- return NULL;
- }
-
- camel_exception_init(&ex);
- camel_operation_start_transient(NULL, _("Resolving: %s"), name);
-
- msg = g_malloc0(sizeof(*msg));
- msg->hostbuflen = 1024;
- msg->hostbufmem = g_malloc(msg->hostbuflen);
- msg->name = name;
- msg->result = -1;
-
- cancel_fd = camel_operation_cancel_fd(NULL);
- if (cancel_fd == -1) {
- get_hostbyname(msg);
- } else {
- EMsgPort *reply_port;
- pthread_t id;
- fd_set rdset;
- int err;
-
- reply_port = msg->msg.reply_port = e_msgport_new();
- fd = e_msgport_fd(msg->msg.reply_port);
- if ((err = pthread_create(&id, NULL, get_hostbyname, msg)) == 0) {
- d(printf("waiting for name return/cancellation in main process\n"));
- do {
- FD_ZERO(&rdset);
- FD_SET(cancel_fd, &rdset);
- FD_SET(fd, &rdset);
- fdmax = MAX(fd, cancel_fd) + 1;
- status = select(fdmax, &rdset, NULL, 0, NULL);
- } while (status == -1 && errno == EINTR);
-
- if (status == -1 || FD_ISSET(cancel_fd, &rdset)) {
- if (status == -1)
- camel_exception_setv(&ex, CAMEL_EXCEPTION_SYSTEM, _("Failure in name lookup: %s"), g_strerror(errno));
- else
- camel_exception_setv(&ex, CAMEL_EXCEPTION_USER_CANCEL, _("Cancelled"));
-
- /* We cancel so if the thread impl is decent it causes immediate exit.
- We detach so we dont need to wait for it to exit if it isn't.
- We check the reply port incase we had a reply in the mean time, which we free later */
- d(printf("Cancelling lookup thread and leaving it\n"));
- msg->cancelled = 1;
- pthread_detach(id);
- pthread_cancel(id);
- msg = (struct _lookup_msg *)e_msgport_get(reply_port);
- } else {
- struct _lookup_msg *reply = (struct _lookup_msg *)e_msgport_get(reply_port);
-
- g_assert(reply == msg);
- d(printf("waiting for child to exit\n"));
- pthread_join(id, NULL);
- d(printf("child done\n"));
- }
- } else {
- camel_exception_setv(&ex, CAMEL_EXCEPTION_SYSTEM, _("Host lookup failed: cannot create thread: %s"), g_strerror(err));
- }
- e_msgport_destroy(reply_port);
- }
-
- camel_operation_end(NULL);
-
- if (!camel_exception_is_set(&ex)) {
- if (msg->result == 0)
- return &msg->hostbuf;
-
- if (msg->herr == HOST_NOT_FOUND || msg->herr == NO_DATA)
- camel_exception_setv (&ex, CAMEL_EXCEPTION_SYSTEM,
- _("Host lookup failed: %s: host not found"), name);
- else
- camel_exception_setv (&ex, CAMEL_EXCEPTION_SYSTEM,
- _("Host lookup failed: %s: unknown reason"), name);
- }
-
- if (msg) {
- g_free(msg->hostbufmem);
- g_free(msg);
- }
-
- camel_exception_xfer(exout, &ex);
-
- return NULL;
-}
-
-static void *
-get_hostbyaddr (void *data)
-{
- struct _lookup_msg *info = data;
-
- while ((info->result = e_gethostbyaddr_r (info->name, info->len, info->type, &info->hostbuf,
- info->hostbufmem, info->hostbuflen, &info->herr)) == ERANGE) {
- d(printf ("gethostbyaddr fialed?\n"));
- pthread_testcancel ();
- info->hostbuflen *= 2;
- info->hostbufmem = g_realloc (info->hostbufmem, info->hostbuflen);
- }
-
- d(printf ("gethostbyaddr ok?\n"));
-
- if (info->cancelled) {
- g_free(info->hostbufmem);
- g_free(info);
- } else {
- e_msgport_reply((EMsg *)info);
- }
-
- return NULL;
-}
-
-
-struct hostent *
-camel_gethostbyaddr (const char *addr, int len, int type, CamelException *exout)
-{
- int fdmax, status, fd, cancel_fd;
- struct _lookup_msg *msg;
- CamelException ex;
-
- g_return_val_if_fail (addr != NULL, NULL);
-
- if (camel_operation_cancel_check (NULL)) {
- camel_exception_set (exout, CAMEL_EXCEPTION_USER_CANCEL, _("Cancelled"));
- return NULL;
- }
-
- camel_exception_init(&ex);
- camel_operation_start_transient (NULL, _("Resolving address"));
-
- msg = g_malloc0 (sizeof (struct _lookup_msg));
- msg->hostbuflen = 1024;
- msg->hostbufmem = g_malloc (msg->hostbuflen);
- msg->name = addr;
- msg->len = len;
- msg->type = type;
- msg->result = -1;
-
- cancel_fd = camel_operation_cancel_fd (NULL);
- if (cancel_fd == -1) {
- get_hostbyaddr (msg);
- } else {
- EMsgPort *reply_port;
- pthread_t id;
- fd_set rdset;
- int err;
-
- reply_port = msg->msg.reply_port = e_msgport_new ();
- fd = e_msgport_fd (msg->msg.reply_port);
- if ((err = pthread_create (&id, NULL, get_hostbyaddr, msg)) == 0) {
- d(printf("waiting for name return/cancellation in main process\n"));
- do {
- FD_ZERO(&rdset);
- FD_SET(cancel_fd, &rdset);
- FD_SET(fd, &rdset);
- fdmax = MAX(fd, cancel_fd) + 1;
- status = select (fdmax, &rdset, NULL, 0, NULL);
- } while (status == -1 && errno == EINTR);
-
- if (status == -1 || FD_ISSET(cancel_fd, &rdset)) {
- if (status == -1)
- camel_exception_setv(&ex, CAMEL_EXCEPTION_SYSTEM, _("Failure in name lookup: %s"), g_strerror(errno));
- else
- camel_exception_setv(&ex, CAMEL_EXCEPTION_USER_CANCEL, _("Cancelled"));
-
- /* We cancel so if the thread impl is decent it causes immediate exit.
- We detach so we dont need to wait for it to exit if it isn't.
- We check the reply port incase we had a reply in the mean time, which we free later */
- d(printf("Cancelling lookup thread and leaving it\n"));
- msg->cancelled = 1;
- pthread_detach(id);
- pthread_cancel(id);
- msg = (struct _lookup_msg *)e_msgport_get(reply_port);
- } else {
- struct _lookup_msg *reply = (struct _lookup_msg *)e_msgport_get(reply_port);
-
- g_assert(reply == msg);
- d(printf("waiting for child to exit\n"));
- pthread_join(id, NULL);
- d(printf("child done\n"));
- }
- } else {
- camel_exception_setv(&ex, CAMEL_EXCEPTION_SYSTEM, _("Host lookup failed: cannot create thread: %s"), g_strerror(err));
- }
-
-
- e_msgport_destroy (reply_port);
- }
-
- camel_operation_end (NULL);
-
- if (!camel_exception_is_set(&ex)) {
- if (msg->result == 0)
- return &msg->hostbuf;
-
- if (msg->herr == HOST_NOT_FOUND || msg->herr == NO_DATA)
- camel_exception_setv (&ex, CAMEL_EXCEPTION_SYSTEM,
- _("Host lookup failed: host not found"));
- else
- camel_exception_setv (&ex, CAMEL_EXCEPTION_SYSTEM,
- _("Host lookup failed: unknown reason"));
- }
-
- if (msg) {
- g_free(msg->hostbufmem);
- g_free(msg);
- }
-
- camel_exception_xfer(exout, &ex);
-
- return NULL;
-}
-
-void camel_free_host(struct hostent *h)
-{
- struct _lookup_msg *msg;
-
- g_return_if_fail(h != NULL);
-
- /* yeah this looks ugly but it is safe. we passed out a reference to inside our structure, this maps it
- to the base structure, so we can free everything right without having to keep track of it separately */
- msg = (struct _lookup_msg *)(((char *)h) - STRUCT_OFFSET(struct _lookup_msg, hostbuf));
-
- g_free(msg->hostbufmem);
- g_free(msg);
-}
diff --git a/camel/camel-service.h b/camel/camel-service.h
deleted file mode 100644
index 587749e242..0000000000
--- a/camel/camel-service.h
+++ /dev/null
@@ -1,155 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-service.h : Abstract class for an email service */
-
-/*
- *
- * Author :
- * Bertrand Guiheneuf <bertrand@helixcode.com>
- *
- * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifndef CAMEL_SERVICE_H
-#define CAMEL_SERVICE_H 1
-
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include <netdb.h>
-#include <camel/camel-object.h>
-#include <camel/camel-url.h>
-#include <camel/camel-provider.h>
-#include <camel/camel-operation.h>
-
-#define CAMEL_SERVICE_TYPE (camel_service_get_type ())
-#define CAMEL_SERVICE(obj) (CAMEL_CHECK_CAST((obj), CAMEL_SERVICE_TYPE, CamelService))
-#define CAMEL_SERVICE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_SERVICE_TYPE, CamelServiceClass))
-#define CAMEL_IS_SERVICE(o) (CAMEL_CHECK_TYPE((o), CAMEL_SERVICE_TYPE))
-
-enum {
- CAMEL_SERVICE_ARG_FIRST = CAMEL_ARG_FIRST + 100,
- CAMEL_SERVICE_ARG_USERNAME,
- CAMEL_SERVICE_ARG_AUTH,
- CAMEL_SERVICE_ARG_HOSTNAME,
- CAMEL_SERVICE_ARG_PORT,
- CAMEL_SERVICE_ARG_PATH,
-};
-
-#define CAMEL_SERVICE_USERNAME (CAMEL_SERVICE_ARG_USERNAME | CAMEL_ARG_STR)
-#define CAMEL_SERVICE_AUTH (CAMEL_SERVICE_ARG_AUTH | CAMEL_ARG_STR)
-#define CAMEL_SERVICE_HOSTNAME (CAMEL_SERVICE_ARG_HOSTNAME | CAMEL_ARG_STR)
-#define CAMEL_SERVICE_PORT (CAMEL_SERVICE_ARG_PORT | CAMEL_ARG_INT)
-#define CAMEL_SERVICE_PATH (CAMEL_SERVICE_ARG_PATH | CAMEL_ARG_STR)
-
-typedef enum {
- CAMEL_SERVICE_DISCONNECTED,
- CAMEL_SERVICE_CONNECTING,
- CAMEL_SERVICE_CONNECTED,
- CAMEL_SERVICE_DISCONNECTING
-} CamelServiceConnectionStatus;
-
-struct _CamelService {
- CamelObject parent_object;
- struct _CamelServicePrivate *priv;
-
- CamelSession *session;
- CamelProvider *provider;
- CamelServiceConnectionStatus status;
- CamelOperation *connect_op;
- CamelURL *url;
-};
-
-
-typedef struct {
- CamelObjectClass parent_class;
-
- void (*construct) (CamelService *service,
- CamelSession *session,
- CamelProvider *provider,
- CamelURL *url,
- CamelException *ex);
-
- gboolean (*connect) (CamelService *service,
- CamelException *ex);
- gboolean (*disconnect) (CamelService *service,
- gboolean clean,
- CamelException *ex);
- void (*cancel_connect) (CamelService *service);
-
- GList * (*query_auth_types) (CamelService *service,
- CamelException *ex);
-
- char * (*get_name) (CamelService *service,
- gboolean brief);
- char * (*get_path) (CamelService *service);
-
-} CamelServiceClass;
-
-
-/* query_auth_types returns a GList of these */
-typedef struct {
- char *name; /* user-friendly name */
- char *description;
- char *authproto;
-
- gboolean need_password; /* needs a password to authenticate */
-} CamelServiceAuthType;
-
-
-/* public methods */
-void camel_service_construct (CamelService *service,
- CamelSession *session,
- CamelProvider *provider,
- CamelURL *url,
- CamelException *ex);
-gboolean camel_service_connect (CamelService *service,
- CamelException *ex);
-gboolean camel_service_disconnect (CamelService *service,
- gboolean clean,
- CamelException *ex);
-void camel_service_cancel_connect (CamelService *service);
-char * camel_service_get_url (CamelService *service);
-char * camel_service_get_name (CamelService *service,
- gboolean brief);
-char * camel_service_get_path (CamelService *service);
-CamelSession * camel_service_get_session (CamelService *service);
-CamelProvider * camel_service_get_provider (CamelService *service);
-GList * camel_service_query_auth_types (CamelService *service,
- CamelException *ex);
-
-/* convenience functions */
-struct hostent * camel_service_gethost (CamelService *service,
- CamelException *ex);
-
-/* cancellable dns lookup */
-struct hostent * camel_gethostbyname (const char *name, CamelException *ex);
-struct hostent * camel_gethostbyaddr (const char *addr, int len, int type, CamelException *ex);
-void camel_free_host (struct hostent *h);
-
-/* Standard Camel function */
-CamelType camel_service_get_type (void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_SERVICE_H */
-
diff --git a/camel/camel-session.c b/camel/camel-session.c
deleted file mode 100644
index fc31530768..0000000000
--- a/camel/camel-session.c
+++ /dev/null
@@ -1,901 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-session.c : Abstract class for an email session */
-
-/*
- * Authors:
- * Dan Winship <danw@ximian.com>
- * Jeffrey Stedfast <fejj@ximian.com>
- * Bertrand Guiheneuf <bertrand@helixcode.com>
- *
- * Copyright 1999 - 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <errno.h>
-
-#include "camel-session.h"
-#include "camel-store.h"
-#include "camel-transport.h"
-#include "camel-exception.h"
-#include "camel-file-utils.h"
-#include "camel-string-utils.h"
-#include "camel-url.h"
-#include "camel-vee-store.h"
-
-#include "camel-private.h"
-
-#define d(x)
-
-#define CS_CLASS(so) CAMEL_SESSION_CLASS (CAMEL_OBJECT_GET_CLASS (so))
-
-static void register_provider (CamelSession *session, CamelProvider *provider);
-static GList *list_providers (CamelSession *session, gboolean load);
-static CamelProvider *get_provider (CamelSession *session,
- const char *url_string,
- CamelException *ex);
-
-static CamelService *get_service (CamelSession *session,
- const char *url_string,
- CamelProviderType type,
- CamelException *ex);
-static char *get_storage_path (CamelSession *session,
- CamelService *service,
- CamelException *ex);
-
-static void *session_thread_msg_new(CamelSession *session, CamelSessionThreadOps *ops, unsigned int size);
-static void session_thread_msg_free(CamelSession *session, CamelSessionThreadMsg *msg);
-static int session_thread_queue(CamelSession *session, CamelSessionThreadMsg *msg, int flags);
-static void session_thread_wait(CamelSession *session, int id);
-static void session_thread_status(CamelSession *session, CamelSessionThreadMsg *msg, const char *text, int pc);
-
-/* The vfolder provider is always available */
-static CamelProvider vee_provider = {
- "vfolder",
- N_("Virtual folder email provider"),
-
- N_("For reading mail as a query of another set of folders"),
-
- "vfolder",
-
- CAMEL_PROVIDER_IS_STORAGE,
-
- CAMEL_URL_NEED_PATH, /* url_flags */
-
- /* ... */
-};
-
-static void
-camel_session_init (CamelSession *session)
-{
- session->online = TRUE;
- session->modules = camel_provider_init ();
- session->providers = g_hash_table_new (camel_strcase_hash, camel_strcase_equal);
- session->priv = g_malloc0(sizeof(*session->priv));
-
- session->priv->lock = g_mutex_new();
- session->priv->thread_lock = g_mutex_new();
- session->priv->thread_id = 1;
- session->priv->thread_active = g_hash_table_new(NULL, NULL);
- session->priv->thread_queue = NULL;
-}
-
-#if 0
-/* NOTE: this code ruins all chance of ever having more than 1 session object */
-static gboolean
-camel_session_destroy_provider (gpointer key, gpointer value, gpointer user_data)
-{
- CamelProvider *prov = (CamelProvider *)value;
- int i;
-
- for (i = 0; i < CAMEL_NUM_PROVIDER_TYPES; i++) {
- if (prov->service_cache[i])
- camel_object_bag_destroy (prov->service_cache[i]);
- }
- return TRUE;
-}
-#endif
-
-static void
-camel_session_finalise (CamelObject *o)
-{
- CamelSession *session = (CamelSession *)o;
-
- g_hash_table_destroy(session->priv->thread_active);
- if (session->priv->thread_queue)
- e_thread_destroy(session->priv->thread_queue);
-
- g_free(session->storage_path);
- /*g_hash_table_foreach_remove (session->providers, camel_session_destroy_provider, NULL);*/
- g_hash_table_destroy (session->providers);
-
- g_mutex_free(session->priv->lock);
- g_mutex_free(session->priv->thread_lock);
-
- g_free(session->priv);
-}
-
-static void
-camel_session_class_init (CamelSessionClass *camel_session_class)
-{
- /* virtual method definition */
- camel_session_class->register_provider = register_provider;
- camel_session_class->list_providers = list_providers;
- camel_session_class->get_provider = get_provider;
- camel_session_class->get_service = get_service;
- camel_session_class->get_storage_path = get_storage_path;
-
- camel_session_class->thread_msg_new = session_thread_msg_new;
- camel_session_class->thread_msg_free = session_thread_msg_free;
- camel_session_class->thread_queue = session_thread_queue;
- camel_session_class->thread_wait = session_thread_wait;
- camel_session_class->thread_status = session_thread_status;
-
- vee_provider.object_types[CAMEL_PROVIDER_STORE] = camel_vee_store_get_type ();
- vee_provider.url_hash = camel_url_hash;
- vee_provider.url_equal = camel_url_equal;
-}
-
-CamelType
-camel_session_get_type (void)
-{
- static CamelType camel_session_type = CAMEL_INVALID_TYPE;
-
- if (camel_session_type == CAMEL_INVALID_TYPE) {
- camel_session_type = camel_type_register (
- camel_object_get_type (), "CamelSession",
- sizeof (CamelSession),
- sizeof (CamelSessionClass),
- (CamelObjectClassInitFunc) camel_session_class_init,
- NULL,
- (CamelObjectInitFunc) camel_session_init,
- (CamelObjectFinalizeFunc) camel_session_finalise);
- }
-
- return camel_session_type;
-}
-
-/**
- * camel_session_construct:
- * @session: a session object to construct
- * @storage_path: path to a directory the session can use for
- * persistent storage. (This directory must already exist.)
- *
- * Constructs @session.
- **/
-void
-camel_session_construct (CamelSession *session, const char *storage_path)
-{
- session->storage_path = g_strdup (storage_path);
- camel_session_register_provider(session, &vee_provider);
-}
-
-
-static void
-register_provider (CamelSession *session, CamelProvider *provider)
-{
- int i;
- CamelProviderConfEntry *conf;
- GList *l;
-
- for (i = 0; i < CAMEL_NUM_PROVIDER_TYPES; i++) {
- if (provider->object_types[i])
- provider->service_cache[i] = camel_object_bag_new (provider->url_hash, provider->url_equal,
- (CamelCopyFunc)camel_url_copy, (GFreeFunc)camel_url_free);
- }
-
- /* Translate all strings here */
-
-#define P_(string) dgettext (provider->translation_domain, string)
-
- provider->name = P_(provider->name);
- provider->description = P_(provider->description);
- conf = provider->extra_conf;
- if (conf) {
- for (i=0;conf[i].type != CAMEL_PROVIDER_CONF_END;i++) {
- if (conf[i].text)
- conf[i].text = P_(conf[i].text);
- }
- }
- l = provider->authtypes;
- while (l) {
- CamelServiceAuthType *auth = l->data;
-
- auth->name = P_(auth->name);
- auth->description = P_(auth->description);
- l = l->next;
- }
-
- g_hash_table_insert (session->providers, provider->protocol, provider);
-}
-
-/**
- * camel_session_register_provider:
- * @session: a session object
- * @protocol: the protocol the provider provides for
- * @provider: provider object
- *
- * Registers a protocol to provider mapping for the session.
- *
- * Assumes the session lock has already been obtained,
- * which is the case for automatically loaded provider modules.
- **/
-void
-camel_session_register_provider (CamelSession *session,
- CamelProvider *provider)
-{
- g_return_if_fail (CAMEL_IS_SESSION (session));
- g_return_if_fail (provider != NULL);
-
- CS_CLASS (session)->register_provider (session, provider);
-}
-
-
-static void
-ensure_loaded (gpointer key, gpointer value, gpointer user_data)
-{
- CamelSession *session = user_data;
- char *name = key;
- char *path = value;
-
- if (!g_hash_table_lookup (session->providers, name)) {
- CamelException ex;
-
- camel_exception_init (&ex);
- camel_provider_load (session, path, &ex);
- camel_exception_clear (&ex);
- }
-}
-
-static gint
-provider_compare (gconstpointer a, gconstpointer b)
-{
- const CamelProvider *cpa = (const CamelProvider *)a;
- const CamelProvider *cpb = (const CamelProvider *)b;
-
- return strcmp (cpa->name, cpb->name);
-}
-
-static void
-add_to_list (gpointer key, gpointer value, gpointer user_data)
-{
- GList **list = user_data;
- CamelProvider *prov = value;
-
- *list = g_list_insert_sorted (*list, prov, provider_compare);
-}
-
-static GList *
-list_providers (CamelSession *session, gboolean load)
-{
- GList *list = NULL;
-
- if (load)
- g_hash_table_foreach (session->modules, ensure_loaded, session);
-
- g_hash_table_foreach (session->providers, add_to_list, &list);
- return list;
-}
-
-/**
- * camel_session_list_providers:
- * @session: the session
- * @load: whether or not to load in providers that are not already loaded
- *
- * This returns a list of available providers in this session. If @load
- * is %TRUE, it will first load in all available providers that haven't
- * yet been loaded.
- *
- * Return value: a GList of providers, which the caller must free.
- **/
-GList *
-camel_session_list_providers (CamelSession *session, gboolean load)
-{
- GList *list;
-
- g_return_val_if_fail (CAMEL_IS_SESSION (session), NULL);
-
- CAMEL_SESSION_LOCK (session, lock);
- list = CS_CLASS (session)->list_providers (session, load);
- CAMEL_SESSION_UNLOCK (session, lock);
-
- return list;
-}
-
-
-static CamelProvider *
-get_provider (CamelSession *session, const char *url_string, CamelException *ex)
-{
- CamelProvider *provider;
- char *protocol;
-
- protocol = g_strndup (url_string, strcspn (url_string, ":"));
-
- provider = g_hash_table_lookup (session->providers, protocol);
- if (!provider) {
- /* See if there's one we can load. */
- char *path;
-
- path = g_hash_table_lookup (session->modules, protocol);
- if (path) {
- camel_provider_load (session, path, ex);
- if (camel_exception_is_set (ex)) {
- g_free (protocol);
- return NULL;
- }
- }
- provider = g_hash_table_lookup (session->providers, protocol);
- }
-
- if (!provider) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_URL_INVALID,
- _("No provider available for protocol `%s'"),
- protocol);
- }
- g_free (protocol);
-
- return provider;
-}
-
-/**
- * camel_session_get_provider:
- * @session: the session
- * @url_string: the URL for the service whose provider you want
- * @ex: a CamelException
- *
- * This returns the CamelProvider that would be used to handle
- * @url_string, loading it in from disk if necessary.
- *
- * Return value: the provider, or %NULL, in which case @ex will be set.
- **/
-CamelProvider *
-camel_session_get_provider (CamelSession *session, const char *url_string,
- CamelException *ex)
-{
- CamelProvider *provider;
-
- CAMEL_SESSION_LOCK (session, lock);
- provider = CS_CLASS (session)->get_provider (session, url_string, ex);
- CAMEL_SESSION_UNLOCK (session, lock);
-
- return provider;
-}
-
-static CamelService *
-get_service (CamelSession *session, const char *url_string,
- CamelProviderType type, CamelException *ex)
-{
- CamelURL *url;
- CamelProvider *provider;
- CamelService *service;
- CamelException internal_ex;
-
- url = camel_url_new (url_string, ex);
- if (!url)
- return NULL;
-
- /* We need to look up the provider so we can then lookup
- the service in the provider's cache */
- provider = CS_CLASS (session)->get_provider (session, url->protocol, ex);
- if (provider && !provider->object_types[type]) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_URL_INVALID,
- _("No provider available for protocol `%s'"),
- url->protocol);
- provider = NULL;
- }
-
- if (!provider) {
- camel_url_free (url);
- return NULL;
- }
-
- /* If the provider doesn't use paths but the URL contains one,
- * ignore it.
- */
- if (url->path && !CAMEL_PROVIDER_ALLOWS (provider, CAMEL_URL_PART_PATH))
- camel_url_set_path (url, NULL);
-
- /* Now look up the service in the provider's cache */
- service = camel_object_bag_reserve(provider->service_cache[type], url);
- if (service != NULL) {
- camel_url_free (url);
- return service;
- }
-
- service = (CamelService *)camel_object_new (provider->object_types[type]);
- camel_exception_init (&internal_ex);
- camel_service_construct (service, session, provider, url, &internal_ex);
- if (camel_exception_is_set (&internal_ex)) {
- camel_exception_xfer (ex, &internal_ex);
- camel_object_unref (service);
- service = NULL;
- camel_object_bag_abort(provider->service_cache[type], url);
- } else {
- camel_object_bag_add(provider->service_cache[type], url, service);
- }
-
- return service;
-}
-
-/**
- * camel_session_get_service:
- * @session: the CamelSession
- * @url_string: a Camel URL describing the service to get
- * @type: the provider type (%CAMEL_PROVIDER_STORE or
- * %CAMEL_PROVIDER_TRANSPORT) to get, since some URLs may be able
- * to specify either type.
- * @ex: a CamelException
- *
- * This resolves a CamelURL into a CamelService, including loading the
- * provider library for that service if it has not already been loaded.
- *
- * Services are cached, and asking for "the same" @url_string multiple
- * times will return the same CamelService (with its reference count
- * incremented by one each time). What constitutes "the same" URL
- * depends in part on the provider.
- *
- * Return value: the requested CamelService, or %NULL
- **/
-CamelService *
-camel_session_get_service (CamelSession *session, const char *url_string,
- CamelProviderType type, CamelException *ex)
-{
- CamelService *service;
-
- g_return_val_if_fail (CAMEL_IS_SESSION (session), NULL);
- g_return_val_if_fail (url_string != NULL, NULL);
-
- CAMEL_SESSION_LOCK (session, lock);
- service = CS_CLASS (session)->get_service (session, url_string, type, ex);
- CAMEL_SESSION_UNLOCK (session, lock);
-
- return service;
-}
-
-/**
- * camel_session_get_service_connected:
- * @session: the CamelSession
- * @url_string: a Camel URL describing the service to get
- * @type: the provider type
- * @ex: a CamelException
- *
- * This works like camel_session_get_service(), but also ensures that
- * the returned service will have been successfully connected (via
- * camel_service_connect().)
- *
- * Return value: the requested CamelService, or %NULL
- **/
-CamelService *
-camel_session_get_service_connected (CamelSession *session,
- const char *url_string,
- CamelProviderType type,
- CamelException *ex)
-{
- CamelService *svc;
-
- svc = camel_session_get_service (session, url_string, type, ex);
- if (svc == NULL)
- return NULL;
-
- if (svc->status != CAMEL_SERVICE_CONNECTED) {
- if (camel_service_connect (svc, ex) == FALSE) {
- camel_object_unref (svc);
- return NULL;
- }
- }
-
- return svc;
-}
-
-
-static char *
-get_storage_path (CamelSession *session, CamelService *service, CamelException *ex)
-{
- char *path, *p;
-
- p = camel_service_get_path (service);
- path = g_strdup_printf ("%s/%s", session->storage_path, p);
- g_free (p);
-
- if (access (path, F_OK) == 0)
- return path;
-
- if (camel_mkdir (path, S_IRWXU) == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not create directory %s:\n%s"),
- path, g_strerror (errno));
- g_free (path);
- return NULL;
- }
-
- return path;
-}
-
-/**
- * camel_session_get_storage_path:
- * @session: session object
- * @service: a CamelService
- * @ex: a CamelException
- *
- * This returns the path to a directory which the service can use for
- * its own purposes. Data stored there will remain between Evolution
- * sessions. No code outside of that service should ever touch the
- * files in this directory. If the directory does not exist, it will
- * be created.
- *
- * Return value: the path (which the caller must free), or %NULL if
- * an error occurs.
- **/
-char *
-camel_session_get_storage_path (CamelSession *session, CamelService *service,
- CamelException *ex)
-{
- g_return_val_if_fail (CAMEL_IS_SESSION (session), NULL);
- g_return_val_if_fail (CAMEL_IS_SERVICE (service), NULL);
-
- return CS_CLASS (session)->get_storage_path (session, service, ex);
-}
-
-
-/**
- * camel_session_get_password:
- * @session: session object
- * @prompt: prompt to provide to user
- * @reprompt: TRUE if the prompt should force a reprompt
- * @secret: whether or not the data is secret (eg, a password, as opposed
- * to a smartcard response)
- * @service: the service this query is being made by
- * @item: an identifier, unique within this service, for the information
- * @ex: a CamelException
- *
- * This function is used by a CamelService to ask the application and
- * the user for a password or other authentication data.
- *
- * @service and @item together uniquely identify the piece of data the
- * caller is concerned with.
- *
- * @prompt is a question to ask the user (if the application doesn't
- * already have the answer cached). If @secret is set, the user's
- * input will not be echoed back. The authenticator should set @ex
- * to %CAMEL_EXCEPTION_USER_CANCEL if the user did not provide the
- * information. The caller must g_free() the information returned when
- * it is done with it.
- *
- * Return value: the authentication information or %NULL.
- **/
-char *
-camel_session_get_password (CamelSession *session, const char *prompt,
- gboolean reprompt, gboolean secret,
- CamelService *service, const char *item,
- CamelException *ex)
-{
- g_return_val_if_fail (CAMEL_IS_SESSION (session), NULL);
- g_return_val_if_fail (prompt != NULL, NULL);
- g_return_val_if_fail (item != NULL, NULL);
-
- return CS_CLASS (session)->get_password (session, prompt, reprompt, secret, service, item, ex);
-}
-
-
-/**
- * camel_session_forget_password:
- * @session: session object
- * @service: the service rejecting the password
- * @item: an identifier, unique within this service, for the information
- * @ex: a CamelException
- *
- * This function is used by a CamelService to tell the application
- * that the authentication information it provided via
- * camel_session_get_password was rejected by the service. If the
- * application was caching this information, it should stop,
- * and if the service asks for it again, it should ask the user.
- *
- * @service and @item identify the rejected authentication information,
- * as with camel_session_get_password.
- **/
-void
-camel_session_forget_password (CamelSession *session, CamelService *service,
- const char *item, CamelException *ex)
-{
- g_return_if_fail (CAMEL_IS_SESSION (session));
- g_return_if_fail (item != NULL);
-
- CS_CLASS (session)->forget_password (session, service, item, ex);
-}
-
-
-/**
- * camel_session_alert_user:
- * @session: session object
- * @type: the type of alert (info, warning, or error)
- * @prompt: the message for the user
- * @cancel: whether or not to provide a "Cancel" option in addition to
- * an "OK" option.
- *
- * Presents the given @prompt to the user, in the style indicated by
- * @type. If @cancel is %TRUE, the user will be able to accept or
- * cancel. Otherwise, the message is purely informational.
- *
- * Return value: %TRUE if the user accepts, %FALSE if they cancel.
- */
-gboolean
-camel_session_alert_user (CamelSession *session, CamelSessionAlertType type,
- const char *prompt, gboolean cancel)
-{
- g_return_val_if_fail (CAMEL_IS_SESSION (session), FALSE);
- g_return_val_if_fail (prompt != NULL, FALSE);
-
- return CS_CLASS (session)->alert_user (session, type, prompt, cancel);
-}
-
-
-/**
- * camel_session_is_online:
- * @session: the session.
- *
- * Return value: whether or not @session is online.
- **/
-gboolean
-camel_session_is_online (CamelSession *session)
-{
- return session->online;
-}
-
-
-/**
- * camel_session_set_online:
- * @session: the session
- * @online: whether or not the session should be online
- *
- * Sets the online status of @session to @online.
- **/
-void
-camel_session_set_online (CamelSession *session, gboolean online)
-{
- session->online = online;
-}
-
-
-/**
- * camel_session_get_filter_driver:
- * @session: the session
- * @type: the type of filter (eg, "incoming")
- * @ex: a CamelException
- *
- * Return value: a filter driver, loaded with applicable rules
- **/
-CamelFilterDriver *
-camel_session_get_filter_driver (CamelSession *session,
- const char *type,
- CamelException *ex)
-{
- return CS_CLASS (session)->get_filter_driver (session, type, ex);
-}
-
-static void
-cs_thread_status(CamelOperation *op, const char *what, int pc, void *data)
-{
- CamelSessionThreadMsg *m = data;
-
- CS_CLASS(m->session)->thread_status(m->session, m, what, pc);
-}
-
-static void *session_thread_msg_new(CamelSession *session, CamelSessionThreadOps *ops, unsigned int size)
-{
- CamelSessionThreadMsg *m;
-
- g_assert(size >= sizeof(*m));
-
- m = g_malloc0(size);
- m->ops = ops;
- m->session = session;
- camel_object_ref(session);
- m->op = camel_operation_new(cs_thread_status, m);
- camel_exception_init(&m->ex);
- CAMEL_SESSION_LOCK(session, thread_lock);
- m->id = session->priv->thread_id++;
- g_hash_table_insert(session->priv->thread_active, GINT_TO_POINTER(m->id), m);
- CAMEL_SESSION_UNLOCK(session, thread_lock);
-
- return m;
-}
-
-static void session_thread_msg_free(CamelSession *session, CamelSessionThreadMsg *msg)
-{
- g_assert(msg->ops != NULL);
-
- d(printf("free message %p session %p\n", msg, session));
-
- CAMEL_SESSION_LOCK(session, thread_lock);
- g_hash_table_remove(session->priv->thread_active, GINT_TO_POINTER(msg->id));
- CAMEL_SESSION_UNLOCK(session, thread_lock);
-
- d(printf("free msg, ops->free = %p\n", msg->ops->free));
-
- if (msg->ops->free)
- msg->ops->free(session, msg);
- if (msg->op)
- camel_operation_unref(msg->op);
- camel_exception_clear(&msg->ex);
- camel_object_unref(msg->session);
- g_free(msg);
-}
-
-static void session_thread_destroy(EThread *thread, CamelSessionThreadMsg *msg, CamelSession *session)
-{
- d(printf("destroy message %p session %p\n", msg, session));
- camel_session_thread_msg_free(session, msg);
-}
-
-static void session_thread_received(EThread *thread, CamelSessionThreadMsg *msg, CamelSession *session)
-{
- d(printf("receive message %p session %p\n", msg, session));
- if (msg->ops->receive) {
- CamelOperation *oldop;
-
- oldop = camel_operation_register(msg->op);
- msg->ops->receive(session, msg);
- camel_operation_register(oldop);
- }
-}
-
-static int session_thread_queue(CamelSession *session, CamelSessionThreadMsg *msg, int flags)
-{
- int id;
-
- CAMEL_SESSION_LOCK(session, thread_lock);
- if (session->priv->thread_queue == NULL) {
- session->priv->thread_queue = e_thread_new(E_THREAD_QUEUE);
- e_thread_set_msg_destroy(session->priv->thread_queue, (EThreadFunc)session_thread_destroy, session);
- e_thread_set_msg_received(session->priv->thread_queue, (EThreadFunc)session_thread_received, session);
- }
- CAMEL_SESSION_UNLOCK(session, thread_lock);
-
- id = msg->id;
- e_thread_put(session->priv->thread_queue, &msg->msg);
-
- return id;
-}
-
-static void session_thread_wait(CamelSession *session, int id)
-{
- int wait;
-
- /* we just busy wait, only other alternative is to setup a reply port? */
- do {
- CAMEL_SESSION_LOCK(session, thread_lock);
- wait = g_hash_table_lookup(session->priv->thread_active, GINT_TO_POINTER(id)) != NULL;
- CAMEL_SESSION_UNLOCK(session, thread_lock);
- if (wait) {
- usleep(20000);
- }
- } while (wait);
-}
-
-static void session_thread_status(CamelSession *session, CamelSessionThreadMsg *msg, const char *text, int pc)
-{
-}
-
-/**
- * camel_session_thread_msg_new:
- * @session:
- * @ops:
- * @size:
- *
- * Create a new thread message, using ops as the receive/reply/free
- * ops, of @size bytes.
- *
- * @ops points to the operations used to recieve/process and finally
- * free the message.
- **/
-void *camel_session_thread_msg_new(CamelSession *session, CamelSessionThreadOps *ops, unsigned int size)
-{
- g_assert(CAMEL_IS_SESSION(session));
- g_assert(ops != NULL);
- g_assert(size >= sizeof(CamelSessionThreadMsg));
-
- return CS_CLASS (session)->thread_msg_new(session, ops, size);
-}
-
-/**
- * camel_session_thread_msg_free:
- * @session:
- * @msg:
- *
- * Free a @msg. Note that the message must have been allocated using
- * msg_new, and must nto have been submitted to any queue function.
- **/
-void camel_session_thread_msg_free(CamelSession *session, CamelSessionThreadMsg *msg)
-{
- g_assert(CAMEL_IS_SESSION(session));
- g_assert(msg != NULL);
- g_assert(msg->ops != NULL);
-
- CS_CLASS (session)->thread_msg_free(session, msg);
-}
-
-/**
- * camel_session_thread_queue:
- * @session:
- * @msg:
- * @flags: queue type flags, currently 0.
- *
- * Queue a thread message in another thread for processing.
- * The operation should be (but needn't) run in a queued manner
- * with other operations queued in this manner.
- *
- * Return value: The id of the operation queued.
- **/
-int camel_session_thread_queue(CamelSession *session, CamelSessionThreadMsg *msg, int flags)
-{
- g_assert(CAMEL_IS_SESSION(session));
- g_assert(msg != NULL);
-
- return CS_CLASS (session)->thread_queue(session, msg, flags);
-}
-
-/**
- * camel_session_thread_wait:
- * @session:
- * @id:
- *
- * Wait on an operation to complete (by id).
- **/
-void camel_session_thread_wait(CamelSession *session, int id)
-{
- g_assert(CAMEL_IS_SESSION(session));
-
- if (id == -1)
- return;
-
- CS_CLASS (session)->thread_wait(session, id);
-}
-
-/**
- * camel_session_check_junk:
- * @session:
- *
- * Do we have to check incoming messages to be junk?
- **/
-gboolean
-camel_session_check_junk (CamelSession *session)
-{
- g_assert(CAMEL_IS_SESSION(session));
-
- return session->check_junk;
-}
-
-/**
- * camel_session_set_check_junk:
- * @session:
- * @check_junk:
- *
- * Set check_junk flag, if set, incoming mail will be checked for being junk.
- **/
-void
-camel_session_set_check_junk (CamelSession *session, gboolean check_junk)
-{
- g_assert(CAMEL_IS_SESSION(session));
-
- session->check_junk = check_junk;
-}
diff --git a/camel/camel-session.h b/camel/camel-session.h
deleted file mode 100644
index e99d31a334..0000000000
--- a/camel/camel-session.h
+++ /dev/null
@@ -1,217 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-session.h : Abstract class for an email session */
-
-/*
- *
- * Author :
- * Bertrand Guiheneuf <bertrand@helixcode.com>
- *
- * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifndef CAMEL_SESSION_H
-#define CAMEL_SESSION_H 1
-
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include <camel/camel-object.h>
-#include <camel/camel-provider.h>
-#include <camel/camel-junk-plugin.h>
-
-#include <e-util/e-msgport.h>
-
-#define CAMEL_SESSION_TYPE (camel_session_get_type ())
-#define CAMEL_SESSION(obj) (CAMEL_CHECK_CAST((obj), CAMEL_SESSION_TYPE, CamelSession))
-#define CAMEL_SESSION_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_SESSION_TYPE, CamelSessionClass))
-#define CAMEL_IS_SESSION(o) (CAMEL_CHECK_TYPE((o), CAMEL_SESSION_TYPE))
-
-
-typedef gboolean (*CamelTimeoutCallback) (gpointer data);
-typedef enum {
- CAMEL_SESSION_ALERT_INFO,
- CAMEL_SESSION_ALERT_WARNING,
- CAMEL_SESSION_ALERT_ERROR
-} CamelSessionAlertType;
-
-struct _CamelSession
-{
- CamelObject parent_object;
- struct _CamelSessionPrivate *priv;
-
- char *storage_path;
- GHashTable *providers, *modules;
- gboolean online;
-
- CamelJunkPlugin *junk_plugin;
- gboolean check_junk;
-};
-
-#ifdef ENABLE_THREADS
-typedef struct _CamelSessionThreadOps CamelSessionThreadOps;
-typedef struct _CamelSessionThreadMsg CamelSessionThreadMsg;
-#endif
-
-typedef struct {
- CamelObjectClass parent_class;
-
- void (*register_provider) (CamelSession *session,
- CamelProvider *provider);
- GList * (*list_providers) (CamelSession *session,
- gboolean load);
- CamelProvider * (*get_provider) (CamelSession *session,
- const char *url_string,
- CamelException *ex);
-
- CamelService * (*get_service) (CamelSession *session,
- const char *url_string,
- CamelProviderType type,
- CamelException *ex);
- char * (*get_storage_path) (CamelSession *session,
- CamelService *service,
- CamelException *ex);
-
- char * (*get_password) (CamelSession *session,
- const char *prompt,
- gboolean reprompt,
- gboolean secret,
- CamelService *service,
- const char *item,
- CamelException *ex);
- void (*forget_password) (CamelSession *session,
- CamelService *service,
- const char *item,
- CamelException *ex);
- gboolean (*alert_user) (CamelSession *session,
- CamelSessionAlertType type,
- const char *prompt,
- gboolean cancel);
-
- CamelFilterDriver * (*get_filter_driver) (CamelSession *session,
- const char *type,
- CamelException *ex);
-#ifdef ENABLE_THREADS
- /* mechanism for creating and maintaining multiple threads of control */
- void *(*thread_msg_new)(CamelSession *session, CamelSessionThreadOps *ops, unsigned int size);
- void (*thread_msg_free)(CamelSession *session, CamelSessionThreadMsg *msg);
- int (*thread_queue)(CamelSession *session, CamelSessionThreadMsg *msg, int flags);
- void (*thread_wait)(CamelSession *session, int id);
- void (*thread_status)(CamelSession *session, CamelSessionThreadMsg *msg, const char *text, int pc);
-#endif
-
-} CamelSessionClass;
-
-
-/* public methods */
-
-/* Standard Camel function */
-CamelType camel_session_get_type (void);
-
-
-void camel_session_construct (CamelSession *session,
- const char *storage_path);
-
-void camel_session_register_provider (CamelSession *session,
- CamelProvider *provider);
-GList * camel_session_list_providers (CamelSession *session,
- gboolean load);
-
-CamelProvider * camel_session_get_provider (CamelSession *session,
- const char *url_string,
- CamelException *ex);
-
-CamelService * camel_session_get_service (CamelSession *session,
- const char *url_string,
- CamelProviderType type,
- CamelException *ex);
-CamelService * camel_session_get_service_connected (CamelSession *session,
- const char *url_string,
- CamelProviderType type,
- CamelException *ex);
-
-#define camel_session_get_store(session, url_string, ex) \
- ((CamelStore *) camel_session_get_service_connected (session, url_string, CAMEL_PROVIDER_STORE, ex))
-#define camel_session_get_transport(session, url_string, ex) \
- ((CamelTransport *) camel_session_get_service_connected (session, url_string, CAMEL_PROVIDER_TRANSPORT, ex))
-
-char * camel_session_get_storage_path (CamelSession *session,
- CamelService *service,
- CamelException *ex);
-
-char * camel_session_get_password (CamelSession *session,
- const char *prompt,
- gboolean reprompt,
- gboolean secret,
- CamelService *service,
- const char *item,
- CamelException *ex);
-void camel_session_forget_password (CamelSession *session,
- CamelService *service,
- const char *item,
- CamelException *ex);
-gboolean camel_session_alert_user (CamelSession *session,
- CamelSessionAlertType type,
- const char *prompt,
- gboolean cancel);
-
-gboolean camel_session_is_online (CamelSession *session);
-void camel_session_set_online (CamelSession *session,
- gboolean online);
-
-CamelFilterDriver *camel_session_get_filter_driver (CamelSession *session,
- const char *type,
- CamelException *ex);
-
-gboolean camel_session_check_junk (CamelSession *session);
-void camel_session_set_check_junk (CamelSession *session, gboolean check_junk);
-
-#ifdef ENABLE_THREADS
-struct _CamelSessionThreadOps {
- void (*receive)(CamelSession *session, struct _CamelSessionThreadMsg *m);
- void (*free)(CamelSession *session, struct _CamelSessionThreadMsg *m);
-};
-
-struct _CamelSessionThreadMsg {
- EMsg msg;
-
- int id;
-
- CamelException ex;
- CamelSessionThreadOps *ops;
- struct _CamelOperation *op;
- CamelSession *session;
-
- void *data; /* free for implementation to define, not used by camel, do not use in client code */
- /* user fields follow */
-};
-
-void *camel_session_thread_msg_new(CamelSession *session, CamelSessionThreadOps *ops, unsigned int size);
-void camel_session_thread_msg_free(CamelSession *session, CamelSessionThreadMsg *msg);
-int camel_session_thread_queue(CamelSession *session, CamelSessionThreadMsg *msg, int flags);
-void camel_session_thread_wait(CamelSession *session, int id);
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_SESSION_H */
diff --git a/camel/camel-smime-context.c b/camel/camel-smime-context.c
deleted file mode 100644
index dd7ed68b3f..0000000000
--- a/camel/camel-smime-context.c
+++ /dev/null
@@ -1,1061 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- * Michael Zucchi <notzed@ximian.com>
- *
- * The Initial Developer of the Original Code is Netscape
- * Communications Corporation. Portions created by Netscape are
- * Copyright (C) 1994-2000 Netscape Communications Corporation. All
- * Rights Reserved.
- *
- * Copyright 2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "nss.h"
-#include <cms.h>
-#include <cert.h>
-#include <certdb.h>
-#include <pkcs11.h>
-#include <smime.h>
-#include <pkcs11t.h>
-#include <pk11func.h>
-
-#include <errno.h>
-
-#include <camel/camel-exception.h>
-#include <camel/camel-stream-mem.h>
-#include <camel/camel-data-wrapper.h>
-
-#include <camel/camel-mime-part.h>
-#include <camel/camel-multipart-signed.h>
-#include <camel/camel-stream-fs.h>
-#include <camel/camel-stream-filter.h>
-#include <camel/camel-mime-filter-basic.h>
-#include <camel/camel-mime-filter-canon.h>
-
-#include "camel-smime-context.h"
-#include "camel-operation.h"
-
-#define d(x)
-
-struct _CamelSMIMEContextPrivate {
- CERTCertDBHandle *certdb;
-
- char *encrypt_key;
- camel_smime_sign_t sign_mode;
-
- unsigned int send_encrypt_key_prefs:1;
-};
-
-static CamelCipherContextClass *parent_class = NULL;
-
-/* used for decode content callback, for streaming decode */
-static void
-sm_write_stream(void *arg, const char *buf, unsigned long len)
-{
- camel_stream_write((CamelStream *)arg, buf, len);
-}
-
-static PK11SymKey *
-sm_decrypt_key(void *arg, SECAlgorithmID *algid)
-{
- printf("Decrypt key called\n");
- return (PK11SymKey *)arg;
-}
-
-static char *
-sm_get_passwd(PK11SlotInfo *info, PRBool retry, void *arg)
-{
- CamelSMIMEContext *context = arg;
- char *pass, *nsspass = NULL;
- char *prompt;
- CamelException *ex;
-
- printf("get passwd called '%s'\n", PK11_GetTokenName(info));
-
- ex = camel_exception_new();
- prompt = g_strdup_printf(_("Enter security pass-phrase for `%s'"), PK11_GetTokenName(info));
- pass = camel_session_get_password(((CamelCipherContext *)context)->session, prompt, FALSE, TRUE, NULL, PK11_GetTokenName(info), ex);
- camel_exception_free(ex);
- g_free(prompt);
- if (pass) {
- nsspass = PORT_Strdup(pass);
- g_free(pass);
- }
-
- return nsspass;
-}
-
-/**
- * camel_smime_context_new:
- * @session: session
- *
- * Creates a new sm cipher context object.
- *
- * Returns a new sm cipher context object.
- **/
-CamelCipherContext *
-camel_smime_context_new(CamelSession *session)
-{
- CamelCipherContext *cipher;
- CamelSMIMEContext *ctx;
-
- g_return_val_if_fail(CAMEL_IS_SESSION(session), NULL);
-
- ctx =(CamelSMIMEContext *) camel_object_new(camel_smime_context_get_type());
-
- cipher =(CamelCipherContext *) ctx;
- cipher->session = session;
- camel_object_ref(session);
-
- return cipher;
-}
-
-void
-camel_smime_context_set_encrypt_key(CamelSMIMEContext *context, gboolean use, const char *key)
-{
- context->priv->send_encrypt_key_prefs = use;
- g_free(context->priv->encrypt_key);
- context->priv->encrypt_key = g_strdup(key);
-}
-
-/* set signing mode, clearsigned multipart/signed or enveloped */
-void
-camel_smime_context_set_sign_mode(CamelSMIMEContext *context, camel_smime_sign_t type)
-{
- context->priv->sign_mode = type;
-}
-
-/* TODO: This is suboptimal, but the only other solution is to pass around NSSCMSMessages */
-guint32
-camel_smime_context_describe_part(CamelSMIMEContext *context, CamelMimePart *part)
-{
- guint32 flags = 0;
- CamelContentType *ct;
- const char *tmp;
-
- ct = camel_mime_part_get_content_type(part);
-
- if (camel_content_type_is(ct, "multipart", "signed")) {
- tmp = camel_content_type_param(ct, "protocol");
- if (tmp && g_ascii_strcasecmp(tmp, ((CamelCipherContext *)context)->sign_protocol))
- flags = CAMEL_SMIME_SIGNED;
- } else if (camel_content_type_is(ct, "application", "x-pkcs7-mime")) {
- CamelStreamMem *istream;
- NSSCMSMessage *cmsg;
- NSSCMSDecoderContext *dec;
-
- /* FIXME: stream this to the decoder incrementally */
- istream = (CamelStreamMem *)camel_stream_mem_new();
- camel_data_wrapper_decode_to_stream(camel_medium_get_content_object((CamelMedium *)part), (CamelStream *)istream);
- camel_stream_reset((CamelStream *)istream);
-
- dec = NSS_CMSDecoder_Start(NULL,
- NULL, NULL,
- sm_get_passwd, context, /* password callback */
- NULL, NULL); /* decrypt key callback */
-
- NSS_CMSDecoder_Update(dec, istream->buffer->data, istream->buffer->len);
- camel_object_unref(istream);
-
- cmsg = NSS_CMSDecoder_Finish(dec);
- if (cmsg) {
- if (NSS_CMSMessage_IsSigned(cmsg)) {
- printf("message is signed\n");
- flags |= CAMEL_SMIME_SIGNED;
- }
-
- if (NSS_CMSMessage_IsEncrypted(cmsg)) {
- printf("message is encrypted\n");
- flags |= CAMEL_SMIME_ENCRYPTED;
- }
-#if 0
- if (NSS_CMSMessage_ContainsCertsOrCrls(cmsg)) {
- printf("message contains certs or crls\n");
- flags |= CAMEL_SMIME_CERTS;
- }
-#endif
- NSS_CMSMessage_Destroy(cmsg);
- } else {
- printf("Message could not be parsed\n");
- }
- }
-
- return flags;
-}
-
-static const char *
-sm_hash_to_id(CamelCipherContext *context, CamelCipherHash hash)
-{
- switch(hash) {
- case CAMEL_CIPHER_HASH_MD5:
- return "md5";
- case CAMEL_CIPHER_HASH_SHA1:
- case CAMEL_CIPHER_HASH_DEFAULT:
- return "sha1";
- default:
- return NULL;
- }
-}
-
-static CamelCipherHash
-sm_id_to_hash(CamelCipherContext *context, const char *id)
-{
- if (id) {
- if (!strcmp(id, "md5"))
- return CAMEL_CIPHER_HASH_MD5;
- else if (!strcmp(id, "sha1"))
- return CAMEL_CIPHER_HASH_SHA1;
- }
-
- return CAMEL_CIPHER_HASH_DEFAULT;
-}
-
-static NSSCMSMessage *
-sm_signing_cmsmessage(CamelSMIMEContext *context, const char *nick, SECOidTag hash, int detached, CamelException *ex)
-{
- struct _CamelSMIMEContextPrivate *p = context->priv;
- NSSCMSMessage *cmsg = NULL;
- NSSCMSContentInfo *cinfo;
- NSSCMSSignedData *sigd;
- NSSCMSSignerInfo *signerinfo;
- CERTCertificate *cert= NULL, *ekpcert = NULL;
-
- if ((cert = CERT_FindUserCertByUsage(p->certdb,
- (char *)nick,
- certUsageEmailSigner,
- PR_FALSE,
- NULL)) == NULL) {
- camel_exception_setv(ex, 1, "Can't find certificate for '%s'", nick);
- return NULL;
- }
-
- cmsg = NSS_CMSMessage_Create(NULL); /* create a message on its own pool */
- if (cmsg == NULL) {
- camel_exception_setv(ex, 1, "Can't create CMS message");
- goto fail;
- }
-
- if ((sigd = NSS_CMSSignedData_Create(cmsg)) == NULL) {
- camel_exception_setv(ex, 1, "Can't create CMS signedData");
- goto fail;
- }
-
- cinfo = NSS_CMSMessage_GetContentInfo(cmsg);
- if (NSS_CMSContentInfo_SetContent_SignedData(cmsg, cinfo, sigd) != SECSuccess) {
- camel_exception_setv(ex, 1, "Can't attach CMS signedData");
- goto fail;
- }
-
- /* if !detatched, the contentinfo will alloc a data item for us */
- cinfo = NSS_CMSSignedData_GetContentInfo(sigd);
- if (NSS_CMSContentInfo_SetContent_Data(cmsg, cinfo, NULL, detached) != SECSuccess) {
- camel_exception_setv(ex, 1, "Can't attach CMS data");
- goto fail;
- }
-
- signerinfo = NSS_CMSSignerInfo_Create(cmsg, cert, hash);
- if (signerinfo == NULL) {
- camel_exception_setv(ex, 1, "Can't create CMS SignerInfo");
- goto fail;
- }
-
- /* we want the cert chain included for this one */
- if (NSS_CMSSignerInfo_IncludeCerts(signerinfo, NSSCMSCM_CertChain, certUsageEmailSigner) != SECSuccess) {
- camel_exception_setv(ex, 1, "Can't find cert chain");
- goto fail;
- }
-
- /* SMIME RFC says signing time should always be added */
- if (NSS_CMSSignerInfo_AddSigningTime(signerinfo, PR_Now()) != SECSuccess) {
- camel_exception_setv(ex, 1, "Can't add CMS SigningTime");
- goto fail;
- }
-
-#if 0
- /* this can but needn't be added. not sure what general usage is */
- if (NSS_CMSSignerInfo_AddSMIMECaps(signerinfo) != SECSuccess) {
- fprintf(stderr, "ERROR: cannot add SMIMECaps attribute.\n");
- goto loser;
- }
-#endif
-
- /* Check if we need to send along our return encrypt cert, rfc2633 2.5.3 */
- if (p->send_encrypt_key_prefs) {
- CERTCertificate *enccert = NULL;
-
- if (p->encrypt_key) {
- /* encrypt key has its own nick */
- if ((ekpcert = CERT_FindUserCertByUsage(
- p->certdb,
- p->encrypt_key,
- certUsageEmailRecipient, PR_FALSE, NULL)) == NULL) {
- camel_exception_setv(ex, 1, "encryption cert for '%s' does not exist", p->encrypt_key);
- goto fail;
- }
- enccert = ekpcert;
- } else if (CERT_CheckCertUsage(cert, certUsageEmailRecipient) == SECSuccess) {
- /* encrypt key is signing key */
- enccert = cert;
- } else {
- /* encrypt key uses same nick */
- if ((ekpcert = CERT_FindUserCertByUsage(
- p->certdb, (char *)nick,
- certUsageEmailRecipient, PR_FALSE, NULL)) == NULL) {
- camel_exception_setv(ex, 1, "encryption cert for '%s' does not exist", nick);
- goto fail;
- }
- enccert = ekpcert;
- }
-
- if (NSS_CMSSignerInfo_AddSMIMEEncKeyPrefs(signerinfo, enccert, p->certdb) != SECSuccess) {
- camel_exception_setv(ex, 1, "can't add SMIMEEncKeyPrefs attribute");
- goto fail;
- }
-
- if (NSS_CMSSignerInfo_AddMSSMIMEEncKeyPrefs(signerinfo, enccert, p->certdb) != SECSuccess) {
- camel_exception_setv(ex, 1, "can't add MS SMIMEEncKeyPrefs attribute");
- goto fail;
- }
-
- if (ekpcert != NULL && NSS_CMSSignedData_AddCertificate(sigd, ekpcert) != SECSuccess) {
- camel_exception_setv(ex, 1, "can't add add encryption certificate");
- goto fail;
- }
- }
-
- if (NSS_CMSSignedData_AddSignerInfo(sigd, signerinfo) != SECSuccess) {
- camel_exception_setv(ex, 1, "can't add CMS SignerInfo");
- goto fail;
- }
-
- if (ekpcert)
- CERT_DestroyCertificate(ekpcert);
-
- if (cert)
- CERT_DestroyCertificate(cert);
-
- return cmsg;
-fail:
- if (ekpcert)
- CERT_DestroyCertificate(ekpcert);
-
- if (cert)
- CERT_DestroyCertificate(cert);
-
- NSS_CMSMessage_Destroy(cmsg);
-
- return NULL;
-}
-
-static int
-sm_sign(CamelCipherContext *context, const char *userid, CamelCipherHash hash, CamelMimePart *ipart, CamelMimePart *opart, CamelException *ex)
-{
- int res = -1;
- NSSCMSMessage *cmsg;
- CamelStream *ostream, *istream;
- SECOidTag sechash;
- NSSCMSEncoderContext *enc;
- CamelDataWrapper *dw;
- CamelContentType *ct;
-
- switch (hash) {
- case CAMEL_CIPHER_HASH_SHA1:
- case CAMEL_CIPHER_HASH_DEFAULT:
- default:
- sechash = SEC_OID_SHA1;
- break;
- case CAMEL_CIPHER_HASH_MD5:
- sechash = SEC_OID_MD5;
- break;
- }
-
- cmsg = sm_signing_cmsmessage((CamelSMIMEContext *)context, userid, sechash,
- ((CamelSMIMEContext *)context)->priv->sign_mode == CAMEL_SMIME_SIGN_CLEARSIGN, ex);
- if (cmsg == NULL)
- return -1;
-
- ostream = camel_stream_mem_new();
-
- /* FIXME: stream this, we stream output at least */
- istream = camel_stream_mem_new();
- if (camel_cipher_canonical_to_stream(ipart,
- CAMEL_MIME_FILTER_CANON_STRIP
- |CAMEL_MIME_FILTER_CANON_CRLF
- |CAMEL_MIME_FILTER_CANON_FROM, istream) == -1) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not generate signing data: %s"), g_strerror(errno));
- goto fail;
- }
-
- enc = NSS_CMSEncoder_Start(cmsg,
- sm_write_stream, ostream, /* DER output callback */
- NULL, NULL, /* destination storage */
- sm_get_passwd, context, /* password callback */
- NULL, NULL, /* decrypt key callback */
- NULL, NULL ); /* detached digests */
- if (!enc) {
- camel_exception_setv(ex, 1, "Cannot create encoder context");
- goto fail;
- }
-
- if (NSS_CMSEncoder_Update(enc, ((CamelStreamMem *)istream)->buffer->data, ((CamelStreamMem *)istream)->buffer->len) != SECSuccess) {
- NSS_CMSEncoder_Cancel(enc);
- camel_exception_setv(ex, 1, "Failed to add data to CMS encoder");
- goto fail;
- }
-
- if (NSS_CMSEncoder_Finish(enc) != SECSuccess) {
- camel_exception_setv(ex, 1, "Failed to encode data");
- goto fail;
- }
-
- res = 0;
-
- dw = camel_data_wrapper_new();
- camel_stream_reset(ostream);
- camel_data_wrapper_construct_from_stream(dw, ostream);
- dw->encoding = CAMEL_TRANSFER_ENCODING_BINARY;
-
- if (((CamelSMIMEContext *)context)->priv->sign_mode == CAMEL_SMIME_SIGN_CLEARSIGN) {
- CamelMultipartSigned *mps;
- CamelMimePart *sigpart;
-
- sigpart = camel_mime_part_new();
- ct = camel_content_type_new("application", "x-pkcs7-signature");
- camel_content_type_set_param(ct, "name", "smime.p7s");
- camel_data_wrapper_set_mime_type_field(dw, ct);
- camel_content_type_unref(ct);
-
- camel_medium_set_content_object((CamelMedium *)sigpart, dw);
-
- camel_mime_part_set_filename(sigpart, "smime.p7s");
- camel_mime_part_set_disposition(sigpart, "attachment");
- camel_mime_part_set_encoding(sigpart, CAMEL_TRANSFER_ENCODING_BASE64);
-
- mps = camel_multipart_signed_new();
- ct = camel_content_type_new("multipart", "signed");
- camel_content_type_set_param(ct, "micalg", camel_cipher_hash_to_id(context, hash));
- camel_content_type_set_param(ct, "protocol", context->sign_protocol);
- camel_data_wrapper_set_mime_type_field((CamelDataWrapper *)mps, ct);
- camel_content_type_unref(ct);
- camel_multipart_set_boundary((CamelMultipart *)mps, NULL);
-
- mps->signature = sigpart;
- mps->contentraw = istream;
- camel_stream_reset(istream);
- camel_object_ref(istream);
-
- camel_medium_set_content_object((CamelMedium *)opart, (CamelDataWrapper *)mps);
- } else {
- ct = camel_content_type_new("application", "x-pkcs7-mime");
- camel_content_type_set_param(ct, "name", "smime.p7m");
- camel_content_type_set_param(ct, "smime-type", "signed-data");
- camel_data_wrapper_set_mime_type_field(dw, ct);
- camel_content_type_unref(ct);
-
- camel_medium_set_content_object((CamelMedium *)opart, dw);
-
- camel_mime_part_set_filename(opart, "smime.p7m");
- camel_mime_part_set_description(opart, "S/MIME Signed Message");
- camel_mime_part_set_disposition(opart, "attachment");
- camel_mime_part_set_encoding(opart, CAMEL_TRANSFER_ENCODING_BASE64);
- }
-
- camel_object_unref(dw);
-fail:
- camel_object_unref(ostream);
- camel_object_unref(istream);
-
- return res;
-}
-
-static const char *
-sm_status_description(NSSCMSVerificationStatus status)
-{
- /* could use this but then we can't control i18n? */
- /*NSS_CMSUtil_VerificationStatusToString(status));*/
-
- switch(status) {
- case NSSCMSVS_Unverified:
- default:
- return _("Unverified");
- case NSSCMSVS_GoodSignature:
- return _("Good signature");
- case NSSCMSVS_BadSignature:
- return _("Bad signature");
- case NSSCMSVS_DigestMismatch:
- return _("Content tampered with or altered in transit");
- case NSSCMSVS_SigningCertNotFound:
- return _("Signing certificate not found");
- case NSSCMSVS_SigningCertNotTrusted:
- return _("Signing certificate not trusted");
- case NSSCMSVS_SignatureAlgorithmUnknown:
- return _("Signature algorithm unknown");
- case NSSCMSVS_SignatureAlgorithmUnsupported:
- return _("Siganture algorithm unsupported");
- case NSSCMSVS_MalformedSignature:
- return _("Malformed signature");
- case NSSCMSVS_ProcessingError:
- return _("Processing error");
- }
-}
-
-static CamelCipherValidity *
-sm_verify_cmsg(CamelCipherContext *context, NSSCMSMessage *cmsg, CamelStream *extstream, CamelException *ex)
-{
- struct _CamelSMIMEContextPrivate *p = ((CamelSMIMEContext *)context)->priv;
- NSSCMSSignedData *sigd = NULL;
- NSSCMSEnvelopedData *envd;
- NSSCMSEncryptedData *encd;
- SECAlgorithmID **digestalgs;
- NSSCMSDigestContext *digcx;
- int count, i, nsigners, j;
- SECItem **digests;
- PLArenaPool *poolp = NULL;
- CamelStreamMem *mem;
- NSSCMSVerificationStatus status;
- CamelCipherValidity *valid;
- GString *description;
-
- description = g_string_new("");
- valid = camel_cipher_validity_new();
- camel_cipher_validity_set_valid(valid, TRUE);
- status = NSSCMSVS_Unverified;
-
- /* NB: this probably needs to go into a decoding routine that can be used for processing
- enveloped data too */
- count = NSS_CMSMessage_ContentLevelCount(cmsg);
- for (i = 0; i < count; i++) {
- NSSCMSContentInfo *cinfo = NSS_CMSMessage_ContentLevel(cmsg, i);
- SECOidTag typetag = NSS_CMSContentInfo_GetContentTypeTag(cinfo);
-
- switch (typetag) {
- case SEC_OID_PKCS7_SIGNED_DATA:
- sigd = (NSSCMSSignedData *)NSS_CMSContentInfo_GetContent(cinfo);
- if (sigd == NULL) {
- camel_exception_setv(ex, 1, "No signedData in signature");
- goto fail;
- }
-
- /* need to build digests of the content */
- if (!NSS_CMSSignedData_HasDigests(sigd)) {
- if (extstream == NULL) {
- camel_exception_setv(ex, 1, "Digests missing from enveloped data");
- goto fail;
- }
-
- if ((poolp = PORT_NewArena(1024)) == NULL) {
- camel_exception_setv(ex, 1, "out of memory");
- goto fail;
- }
-
- digestalgs = NSS_CMSSignedData_GetDigestAlgs(sigd);
-
- digcx = NSS_CMSDigestContext_StartMultiple(digestalgs);
- if (digcx == NULL) {
- camel_exception_setv(ex, 1, "Cannot calculate digests");
- goto fail;
- }
-
- mem = (CamelStreamMem *)camel_stream_mem_new();
- camel_stream_write_to_stream(extstream, (CamelStream *)mem);
- NSS_CMSDigestContext_Update(digcx, mem->buffer->data, mem->buffer->len);
- camel_object_unref(mem);
-
- if (NSS_CMSDigestContext_FinishMultiple(digcx, poolp, &digests) != SECSuccess) {
- camel_exception_setv(ex, 1, "Cannot calculate digests");
- goto fail;
- }
-
- if (NSS_CMSSignedData_SetDigests(sigd, digestalgs, digests) != SECSuccess) {
- camel_exception_setv(ex, 1, "Cannot set message digests");
- goto fail;
- }
-
- PORT_FreeArena(poolp, PR_FALSE);
- poolp = NULL;
- }
-
- /* import the certificates */
- if (NSS_CMSSignedData_ImportCerts(sigd, p->certdb, certUsageEmailSigner, PR_FALSE) != SECSuccess) {
- camel_exception_setv(ex, 1, "cert import failed");
- goto fail;
- }
-
- /* check for certs-only message */
- nsigners = NSS_CMSSignedData_SignerInfoCount(sigd);
- if (nsigners == 0) {
- /* ?? Should we check other usages? */
- NSS_CMSSignedData_ImportCerts(sigd, p->certdb, certUsageEmailSigner, PR_TRUE);
- if (NSS_CMSSignedData_VerifyCertsOnly(sigd, p->certdb, certUsageEmailSigner) != SECSuccess) {
- g_string_printf(description, "Certficate only message, cannot verify certificates");
- } else {
- status = NSSCMSVS_GoodSignature;
- g_string_printf(description, "Certficate only message, certificates imported and verified");
- }
- } else {
- if (!NSS_CMSSignedData_HasDigests(sigd)) {
- camel_exception_setv(ex, 1, "Can't find signature digests");
- goto fail;
- }
-
- for (j = 0; j < nsigners; j++) {
- NSSCMSSignerInfo *si;
- char *cn, *em;
-
- si = NSS_CMSSignedData_GetSignerInfo(sigd, j);
- NSS_CMSSignedData_VerifySignerInfo(sigd, j, p->certdb, certUsageEmailSigner);
-
- status = NSS_CMSSignerInfo_GetVerificationStatus(si);
-
- cn = NSS_CMSSignerInfo_GetSignerCommonName(si);
- em = NSS_CMSSignerInfo_GetSignerEmailAddress(si);
-
- g_string_append_printf(description, _("Signer: %s <%s>: %s\n"),
- cn?cn:"<unknown>", em?em:"<unknown>",
- sm_status_description(status));
-
- if (cn)
- PORT_Free(cn);
- if (em)
- PORT_Free(em);
-
- if (status != NSSCMSVS_GoodSignature)
- camel_cipher_validity_set_valid(valid, FALSE);
- }
- }
- break;
- case SEC_OID_PKCS7_ENVELOPED_DATA:
- envd = (NSSCMSEnvelopedData *)NSS_CMSContentInfo_GetContent(cinfo);
- break;
- case SEC_OID_PKCS7_ENCRYPTED_DATA:
- encd = (NSSCMSEncryptedData *)NSS_CMSContentInfo_GetContent(cinfo);
- break;
- case SEC_OID_PKCS7_DATA:
- break;
- default:
- break;
- }
- }
-
- camel_cipher_validity_set_valid(valid, status == NSSCMSVS_GoodSignature);
- camel_cipher_validity_set_description(valid, description->str);
- g_string_free(description, TRUE);
-
- return valid;
-
-fail:
- camel_cipher_validity_free(valid);
- g_string_free(description, TRUE);
-
- return NULL;
-}
-
-static CamelCipherValidity *
-sm_verify(CamelCipherContext *context, CamelMimePart *ipart, CamelException *ex)
-{
- NSSCMSDecoderContext *dec;
- NSSCMSMessage *cmsg;
- CamelStreamMem *mem;
- CamelStream *constream;
- CamelCipherValidity *valid = NULL;
- CamelContentType *ct;
- const char *tmp;
- CamelMimePart *sigpart;
- CamelDataWrapper *dw;
-
- dw = camel_medium_get_content_object((CamelMedium *)ipart);
- ct = dw->mime_type;
-
- /* FIXME: we should stream this to the decoder */
- mem = (CamelStreamMem *)camel_stream_mem_new();
-
- if (camel_content_type_is(ct, "multipart", "signed")) {
- CamelMultipart *mps = (CamelMultipart *)dw;
-
- tmp = camel_content_type_param(ct, "protocol");
- if (!CAMEL_IS_MULTIPART_SIGNED(mps)
- || tmp == NULL
- || g_ascii_strcasecmp(tmp, context->sign_protocol) != 0) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Cannot verify message signature: Incorrect message format"));
- goto fail;
- }
-
- constream = camel_multipart_signed_get_content_stream((CamelMultipartSigned *)mps, ex);
- if (constream == NULL)
- goto fail;
-
- sigpart = camel_multipart_get_part(mps, CAMEL_MULTIPART_SIGNED_SIGNATURE);
- if (sigpart == NULL) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Cannot verify message signature: Incorrect message format"));
- goto fail;
- }
- } else if (camel_content_type_is(ct, "application", "x-pkcs7-mime")) {
- sigpart = ipart;
- } else {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Cannot verify message signature: Incorrect message format"));
- goto fail;
- }
-
- dec = NSS_CMSDecoder_Start(NULL,
- NULL, NULL, /* content callback */
- sm_get_passwd, context, /* password callback */
- NULL, NULL); /* decrypt key callback */
-
- camel_data_wrapper_decode_to_stream(camel_medium_get_content_object((CamelMedium *)sigpart), (CamelStream *)mem);
- (void)NSS_CMSDecoder_Update(dec, mem->buffer->data, mem->buffer->len);
- cmsg = NSS_CMSDecoder_Finish(dec);
- if (cmsg == NULL) {
- camel_exception_setv(ex, 1, "Decoder failed");
- goto fail;
- }
-
- valid = sm_verify_cmsg(context, cmsg, constream, ex);
-
- NSS_CMSMessage_Destroy(cmsg);
-fail:
- camel_object_unref(mem);
- if (constream)
- camel_object_unref(constream);
-
- return valid;
-}
-
-static int
-sm_encrypt(CamelCipherContext *context, const char *userid, GPtrArray *recipients, CamelMimePart *ipart, CamelMimePart *opart, CamelException *ex)
-{
- struct _CamelSMIMEContextPrivate *p = ((CamelSMIMEContext *)context)->priv;
- /*NSSCMSRecipientInfo **recipient_infos;*/
- CERTCertificate **recipient_certs = NULL;
- NSSCMSContentInfo *cinfo;
- PK11SymKey *bulkkey = NULL;
- SECOidTag bulkalgtag;
- int bulkkeysize, i;
- CK_MECHANISM_TYPE type;
- PK11SlotInfo *slot;
- PLArenaPool *poolp;
- NSSCMSMessage *cmsg = NULL;
- NSSCMSEnvelopedData *envd;
- NSSCMSEncoderContext *enc = NULL;
- CamelStreamMem *mem;
- CamelStream *ostream = NULL;
- CamelDataWrapper *dw;
- CamelContentType *ct;
-
- poolp = PORT_NewArena(1024);
- if (poolp == NULL) {
- camel_exception_setv(ex, 1, "Out of memory");
- return -1;
- }
-
- /* Lookup all recipients certs, for later working */
- recipient_certs = (CERTCertificate **)PORT_ArenaZAlloc(poolp, sizeof(*recipient_certs[0])*(recipients->len + 1));
- if (recipient_certs == NULL) {
- camel_exception_setv(ex, 1, "Out of memory");
- goto fail;
- }
-
- for (i=0;i<recipients->len;i++) {
- recipient_certs[i] = CERT_FindCertByNicknameOrEmailAddr(p->certdb, recipients->pdata[i]);
- if (recipient_certs[i] == NULL) {
- camel_exception_setv(ex, 1, "Can't find certificate for `%s'", recipients->pdata[i]);
- goto fail;
- }
- }
-
- /* Find a common algorithm, probably 3DES anyway ... */
- if (NSS_SMIMEUtil_FindBulkAlgForRecipients(recipient_certs, &bulkalgtag, &bulkkeysize) != SECSuccess) {
- camel_exception_setv(ex, 1, "Can't find common bulk encryption algorithm");
- goto fail;
- }
-
- /* Generate a new bulk key based on the common algorithm - expensive */
- type = PK11_AlgtagToMechanism(bulkalgtag);
- slot = PK11_GetBestSlot(type, context);
- if (slot == NULL) {
- /* PORT_GetError(); ?? */
- camel_exception_setv(ex, 1, "Can't allocate slot for encryption bulk key");
- goto fail;
- }
-
- bulkkey = PK11_KeyGen(slot, type, NULL, bulkkeysize/8, context);
- PK11_FreeSlot(slot);
-
- /* Now we can start building the message */
- /* msg->envelopedData->data */
- cmsg = NSS_CMSMessage_Create(NULL);
- if (cmsg == NULL) {
- camel_exception_setv(ex, 1, "Can't create CMS Message");
- goto fail;
- }
-
- envd = NSS_CMSEnvelopedData_Create(cmsg, bulkalgtag, bulkkeysize);
- if (envd == NULL) {
- camel_exception_setv(ex, 1, "Can't create CMS EnvelopedData");
- goto fail;
- }
-
- cinfo = NSS_CMSMessage_GetContentInfo(cmsg);
- if (NSS_CMSContentInfo_SetContent_EnvelopedData(cmsg, cinfo, envd) != SECSuccess) {
- camel_exception_setv(ex, 1, "Can't attach CMS EnvelopedData");
- goto fail;
- }
-
- cinfo = NSS_CMSEnvelopedData_GetContentInfo(envd);
- if (NSS_CMSContentInfo_SetContent_Data(cmsg, cinfo, NULL, PR_FALSE) != SECSuccess) {
- camel_exception_setv(ex, 1, "Can't attach CMS data object");
- goto fail;
- }
-
- /* add recipient certs */
- for (i=0;recipient_certs[i];i++) {
- NSSCMSRecipientInfo *ri = NSS_CMSRecipientInfo_Create(cmsg, recipient_certs[i]);
-
- if (ri == NULL) {
- camel_exception_setv(ex, 1, "Can't create CMS RecipientInfo");
- goto fail;
- }
-
- if (NSS_CMSEnvelopedData_AddRecipient(envd, ri) != SECSuccess) {
- camel_exception_setv(ex, 1, "Can't add CMS RecipientInfo");
- goto fail;
- }
- }
-
- /* dump it out */
- ostream = camel_stream_mem_new();
- enc = NSS_CMSEncoder_Start(cmsg,
- sm_write_stream, ostream,
- NULL, NULL,
- sm_get_passwd, context,
- sm_decrypt_key, bulkkey,
- NULL, NULL);
- if (enc == NULL) {
- camel_exception_setv(ex, 1, "Can't create encoder context");
- goto fail;
- }
-
- /* FIXME: Stream the input */
- /* FIXME: Canonicalise the input? */
- mem = (CamelStreamMem *)camel_stream_mem_new();
- camel_data_wrapper_write_to_stream((CamelDataWrapper *)ipart, (CamelStream *)mem);
- if (NSS_CMSEncoder_Update(enc, mem->buffer->data, mem->buffer->len) != SECSuccess) {
- NSS_CMSEncoder_Cancel(enc);
- camel_object_unref(mem);
- camel_exception_setv(ex, 1, "Failed to add data to encoder");
- goto fail;
- }
- camel_object_unref(mem);
-
- if (NSS_CMSEncoder_Finish(enc) != SECSuccess) {
- camel_exception_setv(ex, 1, "Failed to encode data");
- goto fail;
- }
-
- PK11_FreeSymKey(bulkkey);
- NSS_CMSMessage_Destroy(cmsg);
- for (i=0;recipient_certs[i];i++)
- CERT_DestroyCertificate(recipient_certs[i]);
- PORT_FreeArena(poolp, PR_FALSE);
-
- dw = camel_data_wrapper_new();
- camel_data_wrapper_construct_from_stream(dw, ostream);
- camel_object_unref(ostream);
- dw->encoding = CAMEL_TRANSFER_ENCODING_BINARY;
-
- ct = camel_content_type_new("application", "x-pkcs7-mime");
- camel_content_type_set_param(ct, "name", "smime.p7m");
- camel_content_type_set_param(ct, "smime-type", "enveloped-data");
- camel_data_wrapper_set_mime_type_field(dw, ct);
- camel_content_type_unref(ct);
-
- camel_medium_set_content_object((CamelMedium *)opart, dw);
- camel_object_unref(dw);
-
- camel_mime_part_set_disposition(opart, "attachment");
- camel_mime_part_set_filename(opart, "smime.p7m");
- camel_mime_part_set_description(opart, "S/MIME Encrypted Message");
- camel_mime_part_set_encoding(opart, CAMEL_TRANSFER_ENCODING_BASE64);
-
- return 0;
-
-fail:
- if (ostream)
- camel_object_unref(ostream);
- if (cmsg)
- NSS_CMSMessage_Destroy(cmsg);
- if (bulkkey)
- PK11_FreeSymKey(bulkkey);
-
- if (recipient_certs) {
- for (i=0;recipient_certs[i];i++)
- CERT_DestroyCertificate(recipient_certs[i]);
- }
-
- PORT_FreeArena(poolp, PR_FALSE);
-
- return -1;
-}
-
-static CamelCipherValidity *
-sm_decrypt(CamelCipherContext *context, CamelMimePart *ipart, CamelMimePart *opart, CamelException *ex)
-{
- NSSCMSDecoderContext *dec;
- NSSCMSMessage *cmsg;
- CamelStreamMem *istream;
- CamelStream *ostream;
- CamelCipherValidity *valid = NULL;
-
- /* FIXME: This assumes the content is only encrypted. Perhaps its ok for
- this api to do this ... */
-
- ostream = camel_stream_mem_new();
-
- /* FIXME: stream this to the decoder incrementally */
- istream = (CamelStreamMem *)camel_stream_mem_new();
- camel_data_wrapper_decode_to_stream(camel_medium_get_content_object((CamelMedium *)ipart), (CamelStream *)istream);
- camel_stream_reset((CamelStream *)istream);
-
- dec = NSS_CMSDecoder_Start(NULL,
- sm_write_stream, ostream, /* content callback */
- sm_get_passwd, context, /* password callback */
- NULL, NULL); /* decrypt key callback */
-
- if (NSS_CMSDecoder_Update(dec, istream->buffer->data, istream->buffer->len) != SECSuccess) {
- printf("decoder update failed\n");
- }
- camel_object_unref(istream);
-
- cmsg = NSS_CMSDecoder_Finish(dec);
- if (cmsg == NULL) {
- camel_exception_setv(ex, 1, "Decoder failed, error %d", PORT_GetError());
- goto fail;
- }
-
-#if 0
- /* not sure if we really care about this? */
- if (!NSS_CMSMessage_IsEncrypted(cmsg)) {
- camel_exception_setv(ex, 1, "S/MIME Decrypt: No encrypted content found");
- NSS_CMSMessage_Destroy(cmsg);
- goto fail;
- }
-#endif
-
- camel_stream_reset(ostream);
- camel_data_wrapper_construct_from_stream((CamelDataWrapper *)opart, ostream);
-
- if (NSS_CMSMessage_IsSigned(cmsg)) {
- valid = sm_verify_cmsg(context, cmsg, NULL, ex);
- } else {
- valid = camel_cipher_validity_new();
- valid->encrypt.description = g_strdup(_("Encrypted content"));
- valid->encrypt.status = CAMEL_CIPHER_VALIDITY_ENCRYPT_ENCRYPTED;
- }
-
- NSS_CMSMessage_Destroy(cmsg);
-fail:
- camel_object_unref(ostream);
-
- return valid;
-}
-
-static int
-sm_import_keys(CamelCipherContext *context, CamelStream *istream, CamelException *ex)
-{
- camel_exception_setv(ex, 1, "import keys: unimplemented");
-
- return -1;
-}
-
-static int
-sm_export_keys(CamelCipherContext *context, GPtrArray *keys, CamelStream *ostream, CamelException *ex)
-{
- camel_exception_setv(ex, 1, "export keys: unimplemented");
-
- return -1;
-}
-
-/* ********************************************************************** */
-
-static void
-camel_smime_context_class_init(CamelSMIMEContextClass *klass)
-{
- CamelCipherContextClass *cipher_class = CAMEL_CIPHER_CONTEXT_CLASS(klass);
-
- parent_class = CAMEL_CIPHER_CONTEXT_CLASS(camel_type_get_global_classfuncs(camel_cipher_context_get_type()));
-
- cipher_class->hash_to_id = sm_hash_to_id;
- cipher_class->id_to_hash = sm_id_to_hash;
- cipher_class->sign = sm_sign;
- cipher_class->verify = sm_verify;
- cipher_class->encrypt = sm_encrypt;
- cipher_class->decrypt = sm_decrypt;
- cipher_class->import_keys = sm_import_keys;
- cipher_class->export_keys = sm_export_keys;
-}
-
-static void
-camel_smime_context_init(CamelSMIMEContext *context)
-{
- CamelCipherContext *cipher =(CamelCipherContext *) context;
-
- cipher->sign_protocol = "application/x-pkcs7-signature";
- cipher->encrypt_protocol = "application/x-pkcs7-mime";
- cipher->key_protocol = "application/x-pkcs7-signature";
-
- context->priv = g_malloc0(sizeof(*context->priv));
- context->priv->certdb = CERT_GetDefaultCertDB();
- context->priv->sign_mode = CAMEL_SMIME_SIGN_CLEARSIGN;
-}
-
-static void
-camel_smime_context_finalise(CamelObject *object)
-{
- CamelSMIMEContext *context = (CamelSMIMEContext *)object;
-
- /* FIXME: do we have to free the certdb? */
-
- g_free(context->priv);
-}
-
-CamelType
-camel_smime_context_get_type(void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register(camel_cipher_context_get_type(),
- "CamelSMIMEContext",
- sizeof(CamelSMIMEContext),
- sizeof(CamelSMIMEContextClass),
- (CamelObjectClassInitFunc) camel_smime_context_class_init,
- NULL,
- (CamelObjectInitFunc) camel_smime_context_init,
- (CamelObjectFinalizeFunc) camel_smime_context_finalise);
- }
-
- return type;
-}
diff --git a/camel/camel-smime-context.h b/camel/camel-smime-context.h
deleted file mode 100644
index 19f0e8464b..0000000000
--- a/camel/camel-smime-context.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- * Michael Zucchi <notzed@ximian.com>
- *
- * Copyright 2002,2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef __CAMEL_SMIME_CONTEXT_H__
-#define __CAMEL_SMIME_CONTEXT_H__
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <camel/camel-cipher-context.h>
-
-#define CAMEL_SMIME_CONTEXT_TYPE (camel_smime_context_get_type())
-#define CAMEL_SMIME_CONTEXT(obj) (CAMEL_CHECK_CAST((obj), CAMEL_SMIME_CONTEXT_TYPE, CamelSMIMEContext))
-#define CAMEL_SMIME_CONTEXT_CLASS(k)(CAMEL_CHECK_CLASS_CAST((k), CAMEL_SMIME_CONTEXT_TYPE, CamelSMIMEContextClass))
-#define CAMEL_IS_SMIME_CONTEXT(o) (CAMEL_CHECK_TYPE((o), CAMEL_SMIME_CONTEXT_TYPE))
-
-typedef enum _camel_smime_sign_t {
- CAMEL_SMIME_SIGN_CLEARSIGN,
- CAMEL_SMIME_SIGN_ENVELOPED
-} camel_smime_sign_t;
-
-typedef enum _camel_smime_describe_t {
- CAMEL_SMIME_SIGNED = 1<<0,
- CAMEL_SMIME_ENCRYPTED = 1<<1,
- CAMEL_SMIME_CERTS = 1<<2,
- CAMEL_SMIME_CRLS = 1<<3,
-} camel_smime_describe_t;
-
-typedef struct _CamelSMIMEContext CamelSMIMEContext;
-typedef struct _CamelSMIMEContextClass CamelSMIMEContextClass;
-
-struct _CamelSMIMEContext {
- CamelCipherContext cipher;
-
- struct _CamelSMIMEContextPrivate *priv;
-};
-
-struct _CamelSMIMEContextClass {
- CamelCipherContextClass cipher_class;
-};
-
-CamelType camel_smime_context_get_type(void);
-
-CamelCipherContext *camel_smime_context_new(CamelSession *session);
-
-/* nick to use for SMIMEEncKeyPrefs attribute for signed data */
-void camel_smime_context_set_encrypt_key(CamelSMIMEContext *context, gboolean use, const char *key);
-/* set signing mode, clearsigned multipart/signed or enveloped */
-void camel_smime_context_set_sign_mode(CamelSMIMEContext *context, camel_smime_sign_t type);
-
-guint32 camel_smime_context_describe_part(CamelSMIMEContext *, struct _CamelMimePart *);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __CAMEL_SMIME_CONTEXT_H__ */
diff --git a/camel/camel-store-summary.c b/camel/camel-store-summary.c
deleted file mode 100644
index 86e42fc98c..0000000000
--- a/camel/camel-store-summary.c
+++ /dev/null
@@ -1,928 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2001-2003 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <ctype.h>
-#include <fcntl.h>
-#include <errno.h>
-
-#include "camel-store-summary.h"
-
-#include "camel-file-utils.h"
-
-#include "e-util/md5-utils.h"
-#include "e-util/e-memory.h"
-
-#include "camel-private.h"
-#include "camel-url.h"
-
-#define d(x)
-#define io(x) /* io debug */
-
-/* possible versions, for versioning changes */
-#define CAMEL_STORE_SUMMARY_VERSION_0 (1)
-
-/* current version */
-#define CAMEL_STORE_SUMMARY_VERSION (1)
-
-#define _PRIVATE(o) (((CamelStoreSummary *)(o))->priv)
-
-static int summary_header_load(CamelStoreSummary *, FILE *);
-static int summary_header_save(CamelStoreSummary *, FILE *);
-
-static CamelStoreInfo * store_info_new(CamelStoreSummary *, const char *);
-static CamelStoreInfo * store_info_load(CamelStoreSummary *, FILE *);
-static int store_info_save(CamelStoreSummary *, FILE *, CamelStoreInfo *);
-static void store_info_free(CamelStoreSummary *, CamelStoreInfo *);
-
-static const char *store_info_string(CamelStoreSummary *, const CamelStoreInfo *, int);
-static void store_info_set_string(CamelStoreSummary *, CamelStoreInfo *, int, const char *);
-
-static void camel_store_summary_class_init (CamelStoreSummaryClass *klass);
-static void camel_store_summary_init (CamelStoreSummary *obj);
-static void camel_store_summary_finalise (CamelObject *obj);
-
-static CamelObjectClass *camel_store_summary_parent;
-
-static void
-camel_store_summary_class_init (CamelStoreSummaryClass *klass)
-{
- camel_store_summary_parent = camel_type_get_global_classfuncs (camel_object_get_type ());
-
- klass->summary_header_load = summary_header_load;
- klass->summary_header_save = summary_header_save;
-
- klass->store_info_new = store_info_new;
- klass->store_info_load = store_info_load;
- klass->store_info_save = store_info_save;
- klass->store_info_free = store_info_free;
-
- klass->store_info_string = store_info_string;
- klass->store_info_set_string = store_info_set_string;
-}
-
-static void
-camel_store_summary_init (CamelStoreSummary *s)
-{
- struct _CamelStoreSummaryPrivate *p;
-
- p = _PRIVATE(s) = g_malloc0(sizeof(*p));
-
- s->store_info_size = sizeof(CamelStoreInfo);
-
- s->store_info_chunks = NULL;
-
- s->version = CAMEL_STORE_SUMMARY_VERSION;
- s->flags = 0;
- s->count = 0;
- s->time = 0;
-
- s->folders = g_ptr_array_new();
- s->folders_path = g_hash_table_new(g_str_hash, g_str_equal);
-
- p->summary_lock = g_mutex_new();
- p->io_lock = g_mutex_new();
- p->alloc_lock = g_mutex_new();
- p->ref_lock = g_mutex_new();
-}
-
-static void
-camel_store_summary_finalise (CamelObject *obj)
-{
- struct _CamelStoreSummaryPrivate *p;
- CamelStoreSummary *s = (CamelStoreSummary *)obj;
-
- p = _PRIVATE(obj);
-
- camel_store_summary_clear(s);
- g_ptr_array_free(s->folders, TRUE);
- g_hash_table_destroy(s->folders_path);
-
- g_free(s->summary_path);
-
- if (s->store_info_chunks)
- e_memchunk_destroy(s->store_info_chunks);
-
- g_mutex_free(p->summary_lock);
- g_mutex_free(p->io_lock);
- g_mutex_free(p->alloc_lock);
- g_mutex_free(p->ref_lock);
-
- g_free(p);
-}
-
-CamelType
-camel_store_summary_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_object_get_type (), "CamelStoreSummary",
- sizeof (CamelStoreSummary),
- sizeof (CamelStoreSummaryClass),
- (CamelObjectClassInitFunc) camel_store_summary_class_init,
- NULL,
- (CamelObjectInitFunc) camel_store_summary_init,
- (CamelObjectFinalizeFunc) camel_store_summary_finalise);
- }
-
- return type;
-}
-
-/**
- * camel_store_summary_new:
- *
- * Create a new CamelStoreSummary object.
- *
- * Return value: A new CamelStoreSummary widget.
- **/
-CamelStoreSummary *
-camel_store_summary_new (void)
-{
- CamelStoreSummary *new = CAMEL_STORE_SUMMARY ( camel_object_new (camel_store_summary_get_type ())); return new;
-}
-
-/**
- * camel_store_summary_set_filename:
- * @s:
- * @name:
- *
- * Set the filename where the summary will be loaded to/saved from.
- **/
-void camel_store_summary_set_filename(CamelStoreSummary *s, const char *name)
-{
- CAMEL_STORE_SUMMARY_LOCK(s, summary_lock);
-
- g_free(s->summary_path);
- s->summary_path = g_strdup(name);
-
- CAMEL_STORE_SUMMARY_UNLOCK(s, summary_lock);
-}
-
-void camel_store_summary_set_uri_base(CamelStoreSummary *s, CamelURL *base)
-{
- CAMEL_STORE_SUMMARY_LOCK(s, summary_lock);
-
- if (s->uri_base)
- camel_url_free(s->uri_base);
- s->uri_base = camel_url_new_with_base(base, "");
-
- CAMEL_STORE_SUMMARY_UNLOCK(s, summary_lock);
-}
-
-/**
- * camel_store_summary_count:
- * @s:
- *
- * Get the number of summary items stored in this summary.
- *
- * Return value: The number of items int he summary.
- **/
-int
-camel_store_summary_count(CamelStoreSummary *s)
-{
- return s->folders->len;
-}
-
-/**
- * camel_store_summary_index:
- * @s:
- * @i:
- *
- * Retrieve a summary item by index number.
- *
- * A referenced to the summary item is returned, which may be
- * ref'd or free'd as appropriate.
- *
- * Return value: The summary item, or NULL if the index @i is out
- * of range.
- * It must be freed using camel_store_summary_info_free().
- **/
-CamelStoreInfo *
-camel_store_summary_index(CamelStoreSummary *s, int i)
-{
- CamelStoreInfo *info = NULL;
-
- CAMEL_STORE_SUMMARY_LOCK(s, ref_lock);
- CAMEL_STORE_SUMMARY_LOCK(s, summary_lock);
-
- if (i<s->folders->len)
- info = g_ptr_array_index(s->folders, i);
-
- CAMEL_STORE_SUMMARY_UNLOCK(s, summary_lock);
-
- if (info)
- info->refcount++;
-
- CAMEL_STORE_SUMMARY_UNLOCK(s, ref_lock);
-
- return info;
-}
-
-/**
- * camel_store_summary_index:
- * @s:
- * @i:
- *
- * Obtain a copy of the summary array. This is done atomically,
- * so cannot contain empty entries.
- *
- * It must be freed using camel_store_summary_array_free().
- **/
-GPtrArray *
-camel_store_summary_array(CamelStoreSummary *s)
-{
- CamelStoreInfo *info;
- GPtrArray *res = g_ptr_array_new();
- int i;
-
- CAMEL_STORE_SUMMARY_LOCK(s, ref_lock);
- CAMEL_STORE_SUMMARY_LOCK(s, summary_lock);
-
- g_ptr_array_set_size(res, s->folders->len);
- for (i=0;i<s->folders->len;i++) {
- info = res->pdata[i] = g_ptr_array_index(s->folders, i);
- info->refcount++;
- }
-
- CAMEL_STORE_SUMMARY_UNLOCK(s, summary_lock);
- CAMEL_STORE_SUMMARY_UNLOCK(s, ref_lock);
-
- return res;
-}
-
-/**
- * camel_store_summary_array_free:
- * @s:
- * @array:
- *
- * Free the folder summary array.
- **/
-void
-camel_store_summary_array_free(CamelStoreSummary *s, GPtrArray *array)
-{
- int i;
-
- for (i=0;i<array->len;i++)
- camel_store_summary_info_free(s, array->pdata[i]);
-
- g_ptr_array_free(array, TRUE);
-}
-
-/**
- * camel_store_summary_path:
- * @s:
- * @path:
- *
- * Retrieve a summary item by path name.
- *
- * A referenced to the summary item is returned, which may be
- * ref'd or free'd as appropriate.
- *
- * Return value: The summary item, or NULL if the @path name
- * is not available.
- * It must be freed using camel_store_summary_info_free().
- **/
-CamelStoreInfo *
-camel_store_summary_path(CamelStoreSummary *s, const char *path)
-{
- CamelStoreInfo *info;
-
- CAMEL_STORE_SUMMARY_LOCK(s, ref_lock);
- CAMEL_STORE_SUMMARY_LOCK(s, summary_lock);
-
- info = g_hash_table_lookup(s->folders_path, path);
-
- CAMEL_STORE_SUMMARY_UNLOCK(s, summary_lock);
-
- if (info)
- info->refcount++;
-
- CAMEL_STORE_SUMMARY_UNLOCK(s, ref_lock);
-
- return info;
-}
-
-int
-camel_store_summary_load(CamelStoreSummary *s)
-{
- FILE *in;
- int i;
- CamelStoreInfo *mi;
-
- g_assert(s->summary_path);
-
- in = fopen(s->summary_path, "r");
- if (in == NULL)
- return -1;
-
- CAMEL_STORE_SUMMARY_LOCK(s, io_lock);
- if ( ((CamelStoreSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->summary_header_load(s, in) == -1)
- goto error;
-
- /* now read in each message ... */
- for (i=0;i<s->count;i++) {
- mi = ((CamelStoreSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->store_info_load(s, in);
-
- if (mi == NULL)
- goto error;
-
- camel_store_summary_add(s, mi);
- }
-
- CAMEL_STORE_SUMMARY_UNLOCK(s, io_lock);
-
- if (fclose (in) != 0)
- return -1;
-
- s->flags &= ~CAMEL_STORE_SUMMARY_DIRTY;
-
- return 0;
-
-error:
- i = ferror (in);
- g_warning ("Cannot load summary file: %s", strerror (ferror (in)));
- CAMEL_STORE_SUMMARY_UNLOCK(s, io_lock);
- fclose (in);
- s->flags |= ~CAMEL_STORE_SUMMARY_DIRTY;
- errno = i;
-
- return -1;
-}
-
-/**
- * camel_store_summary_save:
- * @s:
- *
- * Writes the summary to disk. The summary is only written if changes
- * have occured.
- *
- * Return value: Returns -1 on error.
- **/
-int
-camel_store_summary_save(CamelStoreSummary *s)
-{
- FILE *out;
- int fd;
- int i;
- guint32 count;
- CamelStoreInfo *mi;
-
- g_assert(s->summary_path);
-
- io(printf("** saving summary\n"));
-
- if ((s->flags & CAMEL_STORE_SUMMARY_DIRTY) == 0) {
- io(printf("** summary clean no save\n"));
- return 0;
- }
-
- fd = open(s->summary_path, O_RDWR|O_CREAT|O_TRUNC, 0600);
- if (fd == -1) {
- io(printf("** open error: %s\n", strerror (errno)));
- return -1;
- }
- out = fdopen(fd, "w");
- if ( out == NULL ) {
- i = errno;
- printf("** fdopen error: %s\n", strerror (errno));
- close(fd);
- errno = i;
- return -1;
- }
-
- io(printf("saving header\n"));
-
- CAMEL_STORE_SUMMARY_LOCK(s, io_lock);
-
- if ( ((CamelStoreSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->summary_header_save(s, out) == -1) {
- i = errno;
- fclose(out);
- CAMEL_STORE_SUMMARY_UNLOCK(s, io_lock);
- errno = i;
- return -1;
- }
-
- /* now write out each message ... */
-
- /* FIXME: Locking? */
-
- count = s->folders->len;
- for (i=0;i<count;i++) {
- mi = s->folders->pdata[i];
- ((CamelStoreSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->store_info_save(s, out, mi);
- }
-
- CAMEL_STORE_SUMMARY_UNLOCK(s, io_lock);
-
- if (fflush (out) != 0 || fsync (fileno (out)) == -1) {
- i = errno;
- fclose (out);
- errno = i;
- return -1;
- }
-
- if (fclose (out) != 0)
- return -1;
-
- s->flags &= ~CAMEL_STORE_SUMMARY_DIRTY;
- return 0;
-}
-
-/**
- * camel_store_summary_header_load:
- * @s: Summary object.
- *
- * Only load the header information from the summary,
- * keep the rest on disk. This should only be done on
- * a fresh summary object.
- *
- * Return value: -1 on error.
- **/
-int camel_store_summary_header_load(CamelStoreSummary *s)
-{
- FILE *in;
- int ret;
-
- g_assert(s->summary_path);
-
- in = fopen(s->summary_path, "r");
- if (in == NULL)
- return -1;
-
- CAMEL_STORE_SUMMARY_LOCK(s, io_lock);
- ret = ((CamelStoreSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->summary_header_load(s, in);
- CAMEL_STORE_SUMMARY_UNLOCK(s, io_lock);
-
- fclose(in);
- s->flags &= ~CAMEL_STORE_SUMMARY_DIRTY;
- return ret;
-}
-
-/**
- * camel_store_summary_add:
- * @s:
- * @info:
- *
- * Adds a new @info record to the summary. If @info->uid is NULL, then a new
- * uid is automatically re-assigned by calling :next_uid_string().
- *
- * The @info record should have been generated by calling one of the
- * info_new_*() functions, as it will be free'd based on the summary
- * class. And MUST NOT be allocated directly using malloc.
- **/
-void camel_store_summary_add(CamelStoreSummary *s, CamelStoreInfo *info)
-{
- if (info == NULL)
- return;
-
- if (camel_store_info_path(s, info) == NULL) {
- g_warning("Trying to add a folder info with missing required path name\n");
- return;
- }
-
- CAMEL_STORE_SUMMARY_LOCK(s, summary_lock);
-
- g_ptr_array_add(s->folders, info);
- g_hash_table_insert(s->folders_path, (char *)camel_store_info_path(s, info), info);
- s->flags |= CAMEL_STORE_SUMMARY_DIRTY;
-
- CAMEL_STORE_SUMMARY_UNLOCK(s, summary_lock);
-}
-
-/**
- * camel_store_summary_add_from_path:
- * @s:
- * @h:
- *
- * Build a new info record based on the name, and add it to the summary.
- *
- * Return value: The newly added record.
- **/
-CamelStoreInfo *camel_store_summary_add_from_path(CamelStoreSummary *s, const char *path)
-{
- CamelStoreInfo *info;
-
- CAMEL_STORE_SUMMARY_LOCK(s, summary_lock);
-
- info = g_hash_table_lookup(s->folders_path, path);
- if (info != NULL) {
- g_warning("Trying to add folder '%s' to summary that already has it", path);
- info = NULL;
- } else {
- info = camel_store_summary_info_new_from_path(s, path);
- g_ptr_array_add(s->folders, info);
- g_hash_table_insert(s->folders_path, (char *)camel_store_info_path(s, info), info);
- s->flags |= CAMEL_STORE_SUMMARY_DIRTY;
- }
-
- CAMEL_STORE_SUMMARY_UNLOCK(s, summary_lock);
-
- return info;
-}
-
-/**
- * camel_store_summary_info_new_from_path:
- * @s:
- * @h:
- *
- * Create a new info record from a name.
- *
- * Return value: Guess? This info record MUST be freed using
- * camel_store_summary_info_free(), camel_store_info_free() will not work.
- **/
-CamelStoreInfo *camel_store_summary_info_new_from_path(CamelStoreSummary *s, const char *f)
-{
- return ((CamelStoreSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s))) -> store_info_new(s, f);
-}
-
-/**
- * camel_store_summary_info_free:
- * @s:
- * @mi:
- *
- * Unref and potentially free the message info @mi, and all associated memory.
- **/
-void camel_store_summary_info_free(CamelStoreSummary *s, CamelStoreInfo *mi)
-{
- g_assert(mi);
- g_assert(s);
-
- CAMEL_STORE_SUMMARY_LOCK(s, ref_lock);
-
- g_assert(mi->refcount >= 1);
-
- mi->refcount--;
- if (mi->refcount > 0) {
- CAMEL_STORE_SUMMARY_UNLOCK(s, ref_lock);
- return;
- }
-
- CAMEL_STORE_SUMMARY_UNLOCK(s, ref_lock);
-
- ((CamelStoreSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->store_info_free(s, mi);
-}
-
-/**
- * camel_store_summary_info_ref:
- * @s:
- * @mi:
- *
- * Add an extra reference to @mi.
- **/
-void camel_store_summary_info_ref(CamelStoreSummary *s, CamelStoreInfo *mi)
-{
- g_assert(mi);
- g_assert(s);
-
- CAMEL_STORE_SUMMARY_LOCK(s, ref_lock);
- g_assert(mi->refcount >= 1);
- mi->refcount++;
- CAMEL_STORE_SUMMARY_UNLOCK(s, ref_lock);
-}
-
-/**
- * camel_store_summary_touch:
- * @s:
- *
- * Mark the summary as changed, so that a save will save it.
- **/
-void
-camel_store_summary_touch(CamelStoreSummary *s)
-{
- CAMEL_STORE_SUMMARY_LOCK(s, summary_lock);
- s->flags |= CAMEL_STORE_SUMMARY_DIRTY;
- CAMEL_STORE_SUMMARY_UNLOCK(s, summary_lock);
-}
-
-/**
- * camel_store_summary_clear:
- * @s:
- *
- * Empty the summary contents.
- **/
-void
-camel_store_summary_clear(CamelStoreSummary *s)
-{
- int i;
-
- CAMEL_STORE_SUMMARY_LOCK(s, summary_lock);
- if (camel_store_summary_count(s) == 0) {
- CAMEL_STORE_SUMMARY_UNLOCK(s, summary_lock);
- return;
- }
-
- for (i=0;i<s->folders->len;i++)
- camel_store_summary_info_free(s, s->folders->pdata[i]);
-
- g_ptr_array_set_size(s->folders, 0);
- g_hash_table_destroy(s->folders_path);
- s->folders_path = g_hash_table_new(g_str_hash, g_str_equal);
- s->flags |= CAMEL_STORE_SUMMARY_DIRTY;
- CAMEL_STORE_SUMMARY_UNLOCK(s, summary_lock);
-}
-
-/**
- * camel_store_summary_remove:
- * @s:
- * @info:
- *
- * Remove a specific @info record from the summary.
- **/
-void camel_store_summary_remove(CamelStoreSummary *s, CamelStoreInfo *info)
-{
- CAMEL_STORE_SUMMARY_LOCK(s, summary_lock);
- g_hash_table_remove(s->folders_path, camel_store_info_path(s, info));
- g_ptr_array_remove(s->folders, info);
- s->flags |= CAMEL_STORE_SUMMARY_DIRTY;
- CAMEL_STORE_SUMMARY_UNLOCK(s, summary_lock);
-
- camel_store_summary_info_free(s, info);
-}
-
-/**
- * camel_store_summary_remove_uid:
- * @s:
- * @path:
- *
- * Remove a specific info record from the summary, by @path.
- **/
-void camel_store_summary_remove_path(CamelStoreSummary *s, const char *path)
-{
- CamelStoreInfo *oldinfo;
- char *oldpath;
-
- CAMEL_STORE_SUMMARY_LOCK(s, ref_lock);
- CAMEL_STORE_SUMMARY_LOCK(s, summary_lock);
- if (g_hash_table_lookup_extended(s->folders_path, path, (void *)&oldpath, (void *)&oldinfo)) {
- /* make sure it doesn't vanish while we're removing it */
- oldinfo->refcount++;
- CAMEL_STORE_SUMMARY_UNLOCK(s, summary_lock);
- CAMEL_STORE_SUMMARY_UNLOCK(s, ref_lock);
- camel_store_summary_remove(s, oldinfo);
- camel_store_summary_info_free(s, oldinfo);
- } else {
- CAMEL_STORE_SUMMARY_UNLOCK(s, summary_lock);
- CAMEL_STORE_SUMMARY_UNLOCK(s, ref_lock);
- }
-}
-
-/**
- * camel_store_summary_remove_index:
- * @s:
- * @index:
- *
- * Remove a specific info record from the summary, by index.
- **/
-void camel_store_summary_remove_index(CamelStoreSummary *s, int index)
-{
- CAMEL_STORE_SUMMARY_LOCK(s, summary_lock);
- if (index < s->folders->len) {
- CamelStoreInfo *info = s->folders->pdata[index];
-
- g_hash_table_remove(s->folders_path, camel_store_info_path(s, info));
- g_ptr_array_remove_index(s->folders, index);
- s->flags |= CAMEL_STORE_SUMMARY_DIRTY;
-
- CAMEL_STORE_SUMMARY_UNLOCK(s, summary_lock);
- camel_store_summary_info_free(s, info);
- } else {
- CAMEL_STORE_SUMMARY_UNLOCK(s, summary_lock);
- }
-}
-
-static int
-summary_header_load(CamelStoreSummary *s, FILE *in)
-{
- gint32 version, flags, count;
- time_t time;
-
- fseek(in, 0, SEEK_SET);
-
- io(printf("Loading header\n"));
-
- if (camel_file_util_decode_fixed_int32(in, &version) == -1
- || camel_file_util_decode_fixed_int32(in, &flags) == -1
- || camel_file_util_decode_time_t(in, &time) == -1
- || camel_file_util_decode_fixed_int32(in, &count) == -1) {
- return -1;
- }
-
- s->flags = flags;
- s->time = time;
- s->count = count;
- s->version = version;
-
- if (version < CAMEL_STORE_SUMMARY_VERSION_0) {
- g_warning("Store summary header version too low");
- return -1;
- }
-
- return 0;
-}
-
-static int
-summary_header_save(CamelStoreSummary *s, FILE *out)
-{
- fseek(out, 0, SEEK_SET);
-
- io(printf("Savining header\n"));
-
- /* always write latest version */
- camel_file_util_encode_fixed_int32(out, CAMEL_STORE_SUMMARY_VERSION);
- camel_file_util_encode_fixed_int32(out, s->flags);
- camel_file_util_encode_time_t(out, s->time);
- return camel_file_util_encode_fixed_int32(out, camel_store_summary_count(s));
-}
-
-/**
- * camel_store_summary_info_new:
- * @s:
- *
- * Allocate a new camel message info, suitable for adding
- * to this summary.
- *
- * Return value:
- **/
-CamelStoreInfo *
-camel_store_summary_info_new(CamelStoreSummary *s)
-{
- CamelStoreInfo *mi;
-
- CAMEL_STORE_SUMMARY_LOCK(s, alloc_lock);
- if (s->store_info_chunks == NULL)
- s->store_info_chunks = e_memchunk_new(32, s->store_info_size);
- mi = e_memchunk_alloc0(s->store_info_chunks);
- CAMEL_STORE_SUMMARY_UNLOCK(s, alloc_lock);
- mi->refcount = 1;
- return mi;
-}
-
-const char *camel_store_info_string(CamelStoreSummary *s, const CamelStoreInfo *mi, int type)
-{
- return ((CamelStoreSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->store_info_string(s, mi, type);
-}
-
-void camel_store_info_set_string(CamelStoreSummary *s, CamelStoreInfo *mi, int type, const char *value)
-{
- ((CamelStoreSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->store_info_set_string(s, mi, type, value);
-}
-
-static CamelStoreInfo *
-store_info_new(CamelStoreSummary *s, const char *f)
-{
- CamelStoreInfo *mi;
-
- mi = camel_store_summary_info_new(s);
-
- mi->path = g_strdup(f);
- mi->unread = CAMEL_STORE_INFO_FOLDER_UNKNOWN;
- mi->total = CAMEL_STORE_INFO_FOLDER_UNKNOWN;
-
- return mi;
-}
-
-static CamelStoreInfo *
-store_info_load(CamelStoreSummary *s, FILE *in)
-{
- CamelStoreInfo *mi;
-
- mi = camel_store_summary_info_new(s);
-
- io(printf("Loading folder info\n"));
-
- camel_file_util_decode_string(in, &mi->path);
- camel_file_util_decode_uint32(in, &mi->flags);
- camel_file_util_decode_uint32(in, &mi->unread);
- camel_file_util_decode_uint32(in, &mi->total);
-
- if (!ferror(in))
- return mi;
-
- camel_store_summary_info_free(s, mi);
-
- return NULL;
-}
-
-static int
-store_info_save(CamelStoreSummary *s, FILE *out, CamelStoreInfo *mi)
-{
- io(printf("Saving folder info\n"));
-
- camel_file_util_encode_string(out, camel_store_info_path(s, mi));
- camel_file_util_encode_uint32(out, mi->flags);
- camel_file_util_encode_uint32(out, mi->unread);
- camel_file_util_encode_uint32(out, mi->total);
-
- return ferror(out);
-}
-
-static void
-store_info_free(CamelStoreSummary *s, CamelStoreInfo *mi)
-{
- g_free(mi->path);
- g_free(mi->uri);
- e_memchunk_free(s->store_info_chunks, mi);
-}
-
-static const char *
-store_info_string(CamelStoreSummary *s, const CamelStoreInfo *mi, int type)
-{
- const char *p;
-
- /* FIXME: Locks? */
-
- g_assert (mi != NULL);
-
- switch (type) {
- case CAMEL_STORE_INFO_PATH:
- return mi->path;
- case CAMEL_STORE_INFO_NAME:
- p = strrchr(mi->path, '/');
- if (p)
- return p+1;
- else
- return mi->path;
- case CAMEL_STORE_INFO_URI:
- if (mi->uri == NULL) {
- CamelURL *uri;
-
- uri = camel_url_new_with_base(s->uri_base, mi->path);
- ((CamelStoreInfo *)mi)->uri = camel_url_to_string(uri, 0);
- camel_url_free(uri);
- }
- return mi->uri;
- }
-
- return "";
-}
-
-static void
-store_info_set_string (CamelStoreSummary *s, CamelStoreInfo *mi, int type, const char *str)
-{
- const char *p;
- char *v;
- int len;
-
- g_assert (mi != NULL);
-
- switch(type) {
- case CAMEL_STORE_INFO_PATH:
- CAMEL_STORE_SUMMARY_LOCK(s, summary_lock);
- g_hash_table_remove(s->folders_path, (char *)camel_store_info_path(s, mi));
- g_free(mi->path);
- g_free(mi->uri);
- mi->path = g_strdup(str);
- g_hash_table_insert(s->folders_path, (char *)camel_store_info_path(s, mi), mi);
- s->flags |= CAMEL_STORE_SUMMARY_DIRTY;
- CAMEL_STORE_SUMMARY_UNLOCK(s, summary_lock);
- break;
- case CAMEL_STORE_INFO_NAME:
- CAMEL_STORE_SUMMARY_LOCK(s, summary_lock);
- g_hash_table_remove(s->folders_path, (char *)camel_store_info_path(s, mi));
- p = strrchr(mi->path, '/');
- if (p) {
- len = p-mi->path+1;
- v = g_malloc(len+strlen(str)+1);
- memcpy(v, mi->path, len);
- strcpy(v+len, str);
- } else {
- v = g_strdup(str);
- }
- g_free(mi->path);
- mi->path = v;
- g_hash_table_insert(s->folders_path, (char *)camel_store_info_path(s, mi), mi);
- CAMEL_STORE_SUMMARY_UNLOCK(s, summary_lock);
- break;
- case CAMEL_STORE_INFO_URI:
- g_warning("Cannot set store info uri, aborting");
- abort();
- break;
- }
-}
diff --git a/camel/camel-store-summary.h b/camel/camel-store-summary.h
deleted file mode 100644
index dbcd6119b7..0000000000
--- a/camel/camel-store-summary.h
+++ /dev/null
@@ -1,176 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-
-#ifndef _CAMEL_STORE_SUMMARY_H
-#define _CAMEL_STORE_SUMMARY_H
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <stdio.h>
-
-#include <glib.h>
-
-#include <camel/camel-mime-parser.h>
-#include <camel/camel-object.h>
-#include <camel/camel-url.h>
-
-#define CAMEL_STORE_SUMMARY(obj) CAMEL_CHECK_CAST (obj, camel_store_summary_get_type (), CamelStoreSummary)
-#define CAMEL_STORE_SUMMARY_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_store_summary_get_type (), CamelStoreSummaryClass)
-#define CAMEL_IS_STORE_SUMMARY(obj) CAMEL_CHECK_TYPE (obj, camel_store_summary_get_type ())
-
-typedef struct _CamelStoreSummary CamelStoreSummary;
-typedef struct _CamelStoreSummaryClass CamelStoreSummaryClass;
-
-typedef struct _CamelStoreInfo CamelStoreInfo;
-
-enum _CamelStoreInfoFlags {
- CAMEL_STORE_INFO_FOLDER_NOSELECT,
- CAMEL_STORE_INFO_FOLDER_READONLY,
- CAMEL_STORE_INFO_FOLDER_SUBSCRIBED,
- CAMEL_STORE_INFO_FOLDER_FLAGGED,
-};
-
-#define CAMEL_STORE_INFO_FOLDER_UNKNOWN (~0)
-
-enum {
- CAMEL_STORE_INFO_PATH = 0,
- CAMEL_STORE_INFO_NAME,
- CAMEL_STORE_INFO_URI,
- CAMEL_STORE_INFO_LAST,
-};
-
-struct _CamelStoreInfo {
- guint32 refcount;
- char *uri;
- char *path;
- guint32 flags;
- guint32 unread;
- guint32 total;
-};
-
-enum _CamelStoreSummaryFlags {
- CAMEL_STORE_SUMMARY_DIRTY = 1<<0,
- CAMEL_STORE_SUMMARY_FRAGMENT = 1<<1, /* path name is stored in fragment rather than path */
-};
-
-struct _CamelStoreSummary {
- CamelObject parent;
-
- struct _CamelStoreSummaryPrivate *priv;
-
- /* header info */
- guint32 version; /* version of base part of file */
- guint32 flags; /* flags */
- guint32 count; /* how many were saved/loaded */
- time_t time; /* timestamp for this summary (for implementors to use) */
- struct _CamelURL *uri_base; /* url of base part of summary */
-
- /* sizes of memory objects */
- guint32 store_info_size;
-
- /* memory allocators (setup automatically) */
- struct _EMemChunk *store_info_chunks;
-
- char *summary_path;
-
- GPtrArray *folders; /* CamelStoreInfo's */
- GHashTable *folders_path; /* CamelStoreInfo's by path name */
-};
-
-struct _CamelStoreSummaryClass {
- CamelObjectClass parent_class;
-
- /* load/save the global info */
- int (*summary_header_load)(CamelStoreSummary *, FILE *);
- int (*summary_header_save)(CamelStoreSummary *, FILE *);
-
- /* create/save/load an individual message info */
- CamelStoreInfo * (*store_info_new)(CamelStoreSummary *, const char *path);
- CamelStoreInfo * (*store_info_load)(CamelStoreSummary *, FILE *);
- int (*store_info_save)(CamelStoreSummary *, FILE *, CamelStoreInfo *);
- void (*store_info_free)(CamelStoreSummary *, CamelStoreInfo *);
-
- /* virtualise access methods */
- const char *(*store_info_string)(CamelStoreSummary *, const CamelStoreInfo *, int);
- void (*store_info_set_string)(CamelStoreSummary *, CamelStoreInfo *, int, const char *);
-};
-
-CamelType camel_store_summary_get_type (void);
-CamelStoreSummary *camel_store_summary_new (void);
-
-void camel_store_summary_set_filename(CamelStoreSummary *, const char *);
-void camel_store_summary_set_uri_base(CamelStoreSummary *s, CamelURL *base);
-
-/* load/save the summary in its entirety */
-int camel_store_summary_load(CamelStoreSummary *);
-int camel_store_summary_save(CamelStoreSummary *);
-
-/* only load the header */
-int camel_store_summary_header_load(CamelStoreSummary *);
-
-/* set the dirty bit on the summary */
-void camel_store_summary_touch(CamelStoreSummary *s);
-
-/* add a new raw summary item */
-void camel_store_summary_add(CamelStoreSummary *, CamelStoreInfo *info);
-
-/* build/add raw summary items */
-CamelStoreInfo *camel_store_summary_add_from_path(CamelStoreSummary *, const char *);
-
-/* Just build raw summary items */
-CamelStoreInfo *camel_store_summary_info_new(CamelStoreSummary *s);
-CamelStoreInfo *camel_store_summary_info_new_from_path(CamelStoreSummary *s, const char *);
-
-void camel_store_summary_info_ref(CamelStoreSummary *, CamelStoreInfo *);
-void camel_store_summary_info_free(CamelStoreSummary *, CamelStoreInfo *);
-
-/* removes a summary item */
-void camel_store_summary_remove(CamelStoreSummary *s, CamelStoreInfo *info);
-void camel_store_summary_remove_path(CamelStoreSummary *s, const char *path);
-void camel_store_summary_remove_index(CamelStoreSummary *s, int);
-
-/* remove all items */
-void camel_store_summary_clear(CamelStoreSummary *s);
-
-/* lookup functions */
-int camel_store_summary_count(CamelStoreSummary *);
-CamelStoreInfo *camel_store_summary_index(CamelStoreSummary *, int);
-CamelStoreInfo *camel_store_summary_path(CamelStoreSummary *, const char *uid);
-GPtrArray *camel_store_summary_array(CamelStoreSummary *s);
-void camel_store_summary_array_free(CamelStoreSummary *s, GPtrArray *array);
-
-const char *camel_store_info_string(CamelStoreSummary *, const CamelStoreInfo *, int type);
-void camel_store_info_set_string(CamelStoreSummary *, CamelStoreInfo *, int type, const char *value);
-
-/* helper macro's */
-#define camel_store_info_path(s, i) (camel_store_info_string((CamelStoreSummary *)s, (const CamelStoreInfo *)i, CAMEL_STORE_INFO_PATH))
-#define camel_store_info_uri(s, i) (camel_store_info_string((CamelStoreSummary *)s, (const CamelStoreInfo *)i, CAMEL_STORE_INFO_URI))
-#define camel_store_info_name(s, i) (camel_store_info_string((CamelStoreSummary *)s, (const CamelStoreInfo *)i, CAMEL_STORE_INFO_NAME))
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* ! _CAMEL_STORE_SUMMARY_H */
diff --git a/camel/camel-store.c b/camel/camel-store.c
deleted file mode 100644
index 8d576d4583..0000000000
--- a/camel/camel-store.c
+++ /dev/null
@@ -1,1228 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-store.c : Abstract class for an email store */
-
-/*
- * Authors:
- * Bertrand Guiheneuf <bertrand@helixcode.com>
- * Dan Winship <danw@ximian.com>
- *
- * Copyright 1999-2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#include "camel-session.h"
-#include "camel-store.h"
-#include "camel-folder.h"
-#include "camel-vtrash-folder.h"
-#include "camel-exception.h"
-#include "camel-private.h"
-
-#define d(x)
-#define w(x)
-
-static CamelServiceClass *parent_class = NULL;
-
-/* Returns the class for a CamelStore */
-#define CS_CLASS(so) ((CamelStoreClass *)((CamelObject *)(so))->klass)
-
-static CamelFolder *get_folder (CamelStore *store, const char *folder_name,
- guint32 flags, CamelException *ex);
-static CamelFolder *get_inbox (CamelStore *store, CamelException *ex);
-
-static void init_trash (CamelStore *store);
-static CamelFolder *get_trash (CamelStore *store, CamelException *ex);
-
-static void init_junk (CamelStore *store);
-static CamelFolder *get_junk (CamelStore *store, CamelException *ex);
-
-static CamelFolderInfo *create_folder (CamelStore *store,
- const char *parent_name,
- const char *folder_name,
- CamelException *ex);
-static void delete_folder (CamelStore *store, const char *folder_name,
- CamelException *ex);
-static void rename_folder (CamelStore *store, const char *old_name,
- const char *new_name, CamelException *ex);
-
-static void store_sync (CamelStore *store, CamelException *ex);
-static CamelFolderInfo *get_folder_info (CamelStore *store, const char *top,
- guint32 flags, CamelException *ex);
-static void free_folder_info (CamelStore *store, CamelFolderInfo *tree);
-
-static gboolean folder_subscribed (CamelStore *store, const char *folder_name);
-static void subscribe_folder (CamelStore *store, const char *folder_name, CamelException *ex);
-static void unsubscribe_folder (CamelStore *store, const char *folder_name, CamelException *ex);
-
-static void noop (CamelStore *store, CamelException *ex);
-
-static void construct (CamelService *service, CamelSession *session,
- CamelProvider *provider, CamelURL *url,
- CamelException *ex);
-
-static int store_setv (CamelObject *object, CamelException *ex, CamelArgV *args);
-static int store_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args);
-
-static void
-camel_store_class_init (CamelStoreClass *camel_store_class)
-{
- CamelObjectClass *camel_object_class = CAMEL_OBJECT_CLASS (camel_store_class);
- CamelServiceClass *camel_service_class = CAMEL_SERVICE_CLASS(camel_store_class);
-
- parent_class = CAMEL_SERVICE_CLASS (camel_type_get_global_classfuncs (camel_service_get_type ()));
-
- /* virtual method definition */
- camel_store_class->hash_folder_name = g_str_hash;
- camel_store_class->compare_folder_name = g_str_equal;
- camel_store_class->get_folder = get_folder;
- camel_store_class->get_inbox = get_inbox;
- camel_store_class->init_trash = init_trash;
- camel_store_class->get_trash = get_trash;
- camel_store_class->init_junk = init_junk;
- camel_store_class->get_junk = get_junk;
- camel_store_class->create_folder = create_folder;
- camel_store_class->delete_folder = delete_folder;
- camel_store_class->rename_folder = rename_folder;
- camel_store_class->sync = store_sync;
- camel_store_class->get_folder_info = get_folder_info;
- camel_store_class->free_folder_info = free_folder_info;
- camel_store_class->folder_subscribed = folder_subscribed;
- camel_store_class->subscribe_folder = subscribe_folder;
- camel_store_class->unsubscribe_folder = unsubscribe_folder;
- camel_store_class->noop = noop;
-
- /* virtual method overload */
- camel_service_class->construct = construct;
-
- camel_object_class->setv = store_setv;
- camel_object_class->getv = store_getv;
-
- camel_object_class_add_event(camel_object_class, "folder_created", NULL);
- camel_object_class_add_event(camel_object_class, "folder_deleted", NULL);
- camel_object_class_add_event(camel_object_class, "folder_renamed", NULL);
- camel_object_class_add_event(camel_object_class, "folder_subscribed", NULL);
- camel_object_class_add_event(camel_object_class, "folder_unsubscribed", NULL);
-}
-
-static void
-camel_store_init (void *o)
-{
- CamelStore *store = o;
- CamelStoreClass *store_class = (CamelStoreClass *)CAMEL_OBJECT_GET_CLASS (o);
-
- if (store_class->hash_folder_name) {
- store->folders = camel_object_bag_new(store_class->hash_folder_name,
- store_class->compare_folder_name,
- (CamelCopyFunc)g_strdup, g_free);
- } else
- store->folders = NULL;
-
- /* set vtrash and vjunk on by default */
- store->flags = CAMEL_STORE_VTRASH | CAMEL_STORE_VJUNK;
-
- store->dir_sep = '/';
-
- store->priv = g_malloc0 (sizeof (*store->priv));
- store->priv->folder_lock = e_mutex_new (E_MUTEX_REC);
-}
-
-static void
-camel_store_finalize (CamelObject *object)
-{
- CamelStore *store = CAMEL_STORE (object);
-
- if (store->folders)
- camel_object_bag_destroy(store->folders);
-
- e_mutex_destroy (store->priv->folder_lock);
-
- g_free (store->priv);
-}
-
-
-CamelType
-camel_store_get_type (void)
-{
- static CamelType camel_store_type = CAMEL_INVALID_TYPE;
-
- if (camel_store_type == CAMEL_INVALID_TYPE) {
- camel_store_type = camel_type_register (CAMEL_SERVICE_TYPE, "CamelStore",
- sizeof (CamelStore),
- sizeof (CamelStoreClass),
- (CamelObjectClassInitFunc) camel_store_class_init,
- NULL,
- (CamelObjectInitFunc) camel_store_init,
- (CamelObjectFinalizeFunc) camel_store_finalize );
- }
-
- return camel_store_type;
-}
-
-static int
-store_setv (CamelObject *object, CamelException *ex, CamelArgV *args)
-{
- /* CamelStore doesn't currently have anything to set */
- return CAMEL_OBJECT_CLASS (parent_class)->setv (object, ex, args);
-}
-
-static int
-store_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args)
-{
- /* CamelStore doesn't currently have anything to get */
- return CAMEL_OBJECT_CLASS (parent_class)->getv (object, ex, args);
-}
-
-static void
-construct (CamelService *service, CamelSession *session,
- CamelProvider *provider, CamelURL *url,
- CamelException *ex)
-{
- CamelStore *store = CAMEL_STORE(service);
-
- parent_class->construct(service, session, provider, url, ex);
- if (camel_exception_is_set (ex))
- return;
-
- if (camel_url_get_param(url, "filter"))
- store->flags |= CAMEL_STORE_FILTER_INBOX;
-}
-
-static CamelFolder *
-get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex)
-{
- w(g_warning ("CamelStore::get_folder not implemented for `%s'",
- camel_type_to_name (CAMEL_OBJECT_GET_TYPE (store))));
-
- camel_exception_setv (ex, CAMEL_EXCEPTION_STORE_INVALID,
- _("Cannot get folder: Invalid operation on this store"));
-
- return NULL;
-}
-
-/**
- * camel_store_get_folder: Return the folder corresponding to a path.
- * @store: a CamelStore
- * @folder_name: name of the folder to get
- * @flags: folder flags (create, save body index, etc)
- * @ex: a CamelException
- *
- * Return value: the folder corresponding to the path @folder_name.
- **/
-CamelFolder *
-camel_store_get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex)
-{
- CamelFolder *folder = NULL;
-
- g_return_val_if_fail (folder_name != NULL, NULL);
-
- CAMEL_STORE_LOCK(store, folder_lock);
-
- if (store->folders)
- /* Try cache first. */
- folder = camel_object_bag_reserve(store->folders, folder_name);
-
- if (!folder) {
- folder = CS_CLASS (store)->get_folder (store, folder_name, flags, ex);
- if (folder) {
- /* Add the folder to the vTrash/vJunk folder if this store implements it */
- if (store->vtrash)
- camel_vee_folder_add_folder (CAMEL_VEE_FOLDER (store->vtrash), folder);
- if (store->vjunk)
- camel_vee_folder_add_folder (CAMEL_VEE_FOLDER (store->vjunk), folder);
-
- if (store->folders)
- camel_object_bag_add(store->folders, folder_name, folder);
- } else {
- if (store->folders)
- camel_object_bag_abort(store->folders, folder_name);
- }
- }
-
- CAMEL_STORE_UNLOCK(store, folder_lock);
- return folder;
-}
-
-static CamelFolderInfo *
-create_folder (CamelStore *store, const char *parent_name,
- const char *folder_name, CamelException *ex)
-{
- w(g_warning ("CamelStore::create_folder not implemented for `%s'",
- camel_type_to_name (CAMEL_OBJECT_GET_TYPE (store))));
-
- camel_exception_setv (ex, CAMEL_EXCEPTION_STORE_INVALID,
- _("Cannot create folder: Invalid operation on this store"));
-
- return NULL;
-}
-
-/**
- * camel_store_create_folder:
- * @store: a CamelStore
- * @parent_name: name of the new folder's parent, or %NULL
- * @folder_name: name of the folder to create
- * @ex: a CamelException
- *
- * Creates a new folder as a child of an existing folder.
- * @parent_name can be %NULL to create a new top-level folder.
- *
- * Return value: info about the created folder, which the caller must
- * free with camel_store_free_folder_info().
- **/
-CamelFolderInfo *
-camel_store_create_folder (CamelStore *store, const char *parent_name,
- const char *folder_name, CamelException *ex)
-{
- CamelFolderInfo *fi;
-
- CAMEL_STORE_LOCK(store, folder_lock);
- fi = CS_CLASS (store)->create_folder (store, parent_name, folder_name, ex);
- CAMEL_STORE_UNLOCK(store, folder_lock);
-
- return fi;
-}
-
-
-static void
-delete_folder (CamelStore *store, const char *folder_name, CamelException *ex)
-{
- w(g_warning ("CamelStore::delete_folder not implemented for `%s'",
- camel_type_to_name (CAMEL_OBJECT_GET_TYPE (store))));
-}
-
-/**
- * camel_store_delete_folder: Delete the folder corresponding to a path.
- * @store: a CamelStore
- * @folder_name: name of the folder to delete
- * @ex: a CamelException
- *
- * Deletes the named folder. The folder must be empty.
- **/
-void
-camel_store_delete_folder (CamelStore *store, const char *folder_name, CamelException *ex)
-{
- CamelFolder *folder = NULL;
-
- CAMEL_STORE_LOCK(store, folder_lock);
-
- /* NB: Note similarity of this code to unsubscribe_folder */
-
- /* if we deleted a folder, force it out of the cache, and also out of the vtrash/vjunk if setup */
- if (store->folders) {
- folder = camel_object_bag_get(store->folders, folder_name);
- if (folder) {
- if (store->vtrash)
- camel_vee_folder_remove_folder((CamelVeeFolder *)store->vtrash, folder);
- if (store->vjunk)
- camel_vee_folder_remove_folder((CamelVeeFolder *)store->vjunk, folder);
- camel_folder_delete (folder);
- }
- }
-
- CS_CLASS (store)->delete_folder (store, folder_name, ex);
-
- if (folder) {
- if (store->folders)
- camel_object_bag_remove (store->folders, folder);
-
- camel_object_unref (folder);
- }
-
- CAMEL_STORE_UNLOCK(store, folder_lock);
-}
-
-static void
-rename_folder (CamelStore *store, const char *old_name, const char *new_name, CamelException *ex)
-{
- w(g_warning ("CamelStore::rename_folder not implemented for `%s'",
- camel_type_to_name (CAMEL_OBJECT_GET_TYPE (store))));
-}
-
-/**
- * camel_store_rename_folder:
- * @store: a CamelStore
- * @old_name: the current name of the folder
- * @new_name: the new name of the folder
- * @ex: a CamelException
- *
- * Rename a named folder to a new name.
- **/
-void
-camel_store_rename_folder (CamelStore *store, const char *old_name, const char *new_name, CamelException *ex)
-{
- CamelFolder *folder;
- int i, oldlen, namelen;
- GPtrArray *folders;
-
- d(printf("store rename folder %s '%s' '%s'\n", ((CamelService *)store)->url->protocol, old_name, new_name));
-
- if (strcmp(old_name, new_name) == 0)
- return;
-
- oldlen = strlen(old_name);
-
- CAMEL_STORE_LOCK(store, folder_lock);
-
- /* If the folder is open (or any subfolders of the open folder)
- We need to rename them atomically with renaming the actual folder path */
- if (store->folders) {
- folders = camel_object_bag_list(store->folders);
- for (i=0;i<folders->len;i++) {
- folder = folders->pdata[i];
- namelen = strlen(folder->full_name);
- if ((namelen == oldlen &&
- strcmp(folder->full_name, old_name) == 0)
- || ((namelen > oldlen)
- && strncmp(folder->full_name, old_name, oldlen) == 0
- && folder->full_name[oldlen] == store->dir_sep)) {
- d(printf("Found subfolder of '%s' == '%s'\n", old_name, folder->full_name));
- CAMEL_FOLDER_LOCK(folder, lock);
- } else {
- g_ptr_array_remove_index_fast(folders, i);
- i--;
- camel_object_unref(folder);
- }
- }
- }
-
- /* Now try the real rename (will emit renamed event) */
- CS_CLASS (store)->rename_folder (store, old_name, new_name, ex);
-
- /* If it worked, update all open folders/unlock them */
- if (!camel_exception_is_set(ex)) {
- guint32 flags = CAMEL_STORE_FOLDER_INFO_RECURSIVE;
- CamelRenameInfo reninfo;
-
- for (i=0;i<folders->len;i++) {
- char *new;
-
- folder = folders->pdata[i];
-
- new = g_strdup_printf("%s%s", new_name, folder->full_name+strlen(old_name));
- camel_object_bag_remove(store->folders, folder);
- camel_object_bag_add(store->folders, new, folder);
- camel_folder_rename(folder, new);
-
- CAMEL_FOLDER_UNLOCK(folder, lock);
- camel_object_unref(folder);
- }
-
- /* Emit changed signal */
- if (store->flags & CAMEL_STORE_SUBSCRIPTIONS)
- flags |= CAMEL_STORE_FOLDER_INFO_SUBSCRIBED;
-
- reninfo.old_base = (char *)old_name;
- reninfo.new = ((CamelStoreClass *)((CamelObject *)store)->klass)->get_folder_info(store, new_name, flags, ex);
- if (reninfo.new != NULL) {
- camel_object_trigger_event (store, "folder_renamed", &reninfo);
- ((CamelStoreClass *)((CamelObject *)store)->klass)->free_folder_info(store, reninfo.new);
- }
- } else {
- /* Failed, just unlock our folders for re-use */
- for (i=0;i<folders->len;i++) {
- folder = folders->pdata[i];
- CAMEL_FOLDER_UNLOCK(folder, lock);
- camel_object_unref(folder);
- }
- }
-
- CAMEL_STORE_UNLOCK(store, folder_lock);
-
- g_ptr_array_free(folders, TRUE);
-}
-
-
-static CamelFolder *
-get_inbox (CamelStore *store, CamelException *ex)
-{
- /* Default: assume the inbox's name is "inbox"
- * and open with default flags.
- */
- return CS_CLASS (store)->get_folder (store, "inbox", 0, ex);
-}
-
-/**
- * camel_store_get_inbox:
- * @store: a CamelStore
- * @ex: a CamelException
- *
- * Return value: the folder in the store into which new mail is
- * delivered, or %NULL if no such folder exists.
- **/
-CamelFolder *
-camel_store_get_inbox (CamelStore *store, CamelException *ex)
-{
- CamelFolder *folder;
-
- CAMEL_STORE_LOCK(store, folder_lock);
- folder = CS_CLASS (store)->get_inbox (store, ex);
- CAMEL_STORE_UNLOCK(store, folder_lock);
-
- return folder;
-}
-
-static void
-trash_finalize (CamelObject *trash, gpointer event_data, gpointer user_data)
-{
- CamelStore *store = CAMEL_STORE (user_data);
-
- store->vtrash = NULL;
-}
-
-static void
-junk_finalize (CamelObject *junk, gpointer event_data, gpointer user_data)
-{
- CamelStore *store = CAMEL_STORE (user_data);
-
- store->vjunk = NULL;
-}
-
-/* FIXME: derive vjunk folder object from vee_folder */
-#include "camel-vee-store.h"
-static CamelFolder *
-camel_vjunk_folder_new (CamelStore *parent_store, const char *name)
-{
- CamelFolder *vjunk;
-
- vjunk = (CamelFolder *)camel_object_new (camel_vee_folder_get_type ());
- vjunk->folder_flags |= CAMEL_FOLDER_IS_JUNK;
- camel_vee_folder_construct (CAMEL_VEE_FOLDER (vjunk), parent_store, name,
- CAMEL_STORE_FOLDER_PRIVATE | CAMEL_STORE_FOLDER_CREATE | CAMEL_STORE_VEE_FOLDER_AUTO);
- camel_vee_folder_set_expression((CamelVeeFolder *)vjunk, "(match-all (system-flag \"Junk\"))");
-
- return vjunk;
-}
-
-static void
-init_trash_or_junk (CamelStore *store, CamelFolder *folder, void (*finalize) (CamelObject *o, gpointer event_data, gpointer user_data))
-{
- if (folder) {
- /* FIXME: this should probably use the object bag or another one ? ... */
- /* attach to the finalise event of the vtrash/vjunk */
- camel_object_hook_event (folder, "finalize", finalize, store);
-
- /* add all the pre-opened folders to the vtrash/vjunk */
- if (store->folders) {
- GPtrArray *folders = camel_object_bag_list(store->folders);
- int i;
-
- for (i=0;i<folders->len;i++) {
- camel_vee_folder_add_folder (CAMEL_VEE_FOLDER (folder), (CamelFolder *)folders->pdata[i]);
- camel_object_unref(folders->pdata[i]);
- }
- g_ptr_array_free(folders, TRUE);
- }
- }
-}
-
-static void
-init_trash (CamelStore *store)
-{
- if ((store->flags & CAMEL_STORE_VTRASH) == 0)
- return;
-
- store->vtrash = camel_vtrash_folder_new (store, CAMEL_VTRASH_NAME);
- init_trash_or_junk (store, store->vtrash, trash_finalize);
-}
-
-static void
-init_junk (CamelStore *store)
-{
- if ((store->flags & CAMEL_STORE_VJUNK) == 0)
- return;
-
- store->vjunk = camel_vjunk_folder_new (store, CAMEL_VJUNK_NAME);
- init_trash_or_junk (store, store->vjunk, junk_finalize);
-}
-
-static CamelFolder *
-get_trash (CamelStore *store, CamelException *ex)
-{
- if (store->vtrash) {
- camel_object_ref (store->vtrash);
- return store->vtrash;
- } else {
- CS_CLASS (store)->init_trash (store);
- if (store->vtrash) {
- /* We don't ref here because we don't want the
- store to own a ref on the trash folder */
- /*camel_object_ref (store->vtrash);*/
- return store->vtrash;
- } else {
- w(g_warning ("This store does not support vTrash."));
- return NULL;
- }
- }
-}
-
-static CamelFolder *
-get_junk (CamelStore *store, CamelException *ex)
-{
- if (store->vjunk) {
- camel_object_ref (CAMEL_OBJECT (store->vjunk));
- return store->vjunk;
- } else {
- CS_CLASS (store)->init_junk (store);
- if (store->vjunk) {
- /* We don't ref here because we don't want the
- store to own a ref on the junk folder */
- /*camel_object_ref (CAMEL_OBJECT (store->vjunk));*/
- return store->vjunk;
- } else {
- w(g_warning ("This store does not support vJunk."));
- return NULL;
- }
- }
-}
-
-/**
- * camel_store_get_trash:
- * @store: a CamelStore
- * @ex: a CamelException
- *
- * Return value: the folder in the store into which trash is
- * delivered, or %NULL if no such folder exists.
- **/
-CamelFolder *
-camel_store_get_trash (CamelStore *store, CamelException *ex)
-{
- CamelFolder *folder;
-
- if ((store->flags & CAMEL_STORE_VTRASH) == 0)
- return NULL;
-
- CAMEL_STORE_LOCK(store, folder_lock);
- folder = CS_CLASS (store)->get_trash (store, ex);
- CAMEL_STORE_UNLOCK(store, folder_lock);
-
- return folder;
-}
-
-/**
- * camel_store_get_junk:
- * @store: a CamelStore
- * @ex: a CamelException
- *
- * Return value: the folder in the store into which junk is
- * delivered, or %NULL if no such folder exists.
- **/
-CamelFolder *
-camel_store_get_junk (CamelStore *store, CamelException *ex)
-{
- CamelFolder *folder;
-
- if ((store->flags & CAMEL_STORE_VJUNK) == 0)
- return NULL;
-
- CAMEL_STORE_LOCK(store, folder_lock);
- folder = CS_CLASS (store)->get_junk (store, ex);
- CAMEL_STORE_UNLOCK(store, folder_lock);
-
- return folder;
-}
-
-static void
-store_sync (CamelStore *store, CamelException *ex)
-{
- if (store->folders) {
- GPtrArray *folders;
- CamelFolder *folder;
- CamelException x;
- int i;
-
- camel_exception_init(&x);
- folders = camel_object_bag_list(store->folders);
- for (i=0;i<folders->len;i++) {
- folder = folders->pdata[i];
- if (!camel_exception_is_set(&x))
- camel_folder_sync(folder, FALSE, &x);
- camel_object_unref(folder);
- }
- camel_exception_xfer(ex, &x);
- g_ptr_array_free(folders, TRUE);
- }
-}
-
-/**
- * camel_store_sync:
- * @store: a CamelStore
- * @ex: a CamelException
- *
- * Syncs any changes that have been made to the store object and its
- * folders with the real store.
- **/
-void
-camel_store_sync (CamelStore *store, CamelException *ex)
-{
- g_return_if_fail (CAMEL_IS_STORE (store));
-
- CS_CLASS (store)->sync (store, ex);
-}
-
-
-static CamelFolderInfo *
-get_folder_info (CamelStore *store, const char *top,
- guint32 flags, CamelException *ex)
-{
- w(g_warning ("CamelStore::get_folder_info not implemented for `%s'",
- camel_type_to_name (CAMEL_OBJECT_GET_TYPE (store))));
-
- return NULL;
-}
-
-static void
-add_special_info (CamelStore *store, CamelFolderInfo *info, const char *name, const char *full_name,
- const char *url_base, gboolean unread_count)
-{
- CamelFolderInfo *fi, *vinfo, *parent;
- char *uri, *path;
- CamelURL *url;
-
- g_return_if_fail (info != NULL);
-
- parent = NULL;
- for (fi = info; fi; fi = fi->sibling) {
- if (!strcmp (fi->name, name))
- break;
- parent = fi;
- }
-
- /* create our vTrash/vJunk URL */
- url = camel_url_new (info->url, NULL);
- if (((CamelService *) store)->provider->url_flags & CAMEL_URL_FRAGMENT_IS_PATH) {
- camel_url_set_fragment (url, name);
- } else {
- path = g_strdup_printf ("/%s", name);
- camel_url_set_path (url, path);
- g_free (path);
- }
-
- uri = camel_url_to_string (url, CAMEL_URL_HIDE_ALL);
- camel_url_free (url);
-
- if (fi) {
- /* We're going to replace the physical Trash/Junk folder with our vTrash/vJunk folder */
- vinfo = fi;
- g_free (vinfo->full_name);
- g_free (vinfo->name);
- g_free (vinfo->url);
- g_free (vinfo->path);
- } else {
- /* There wasn't a Trash/Junk folder so create a new folder entry */
- vinfo = g_new0 (CamelFolderInfo, 1);
-
- g_assert(parent != NULL);
-
- vinfo->flags |= CAMEL_FOLDER_NOINFERIORS | CAMEL_FOLDER_SUBSCRIBED;
-
- /* link it into the right spot */
- vinfo->sibling = parent->sibling;
- parent->sibling = vinfo;
- }
-
- /* Fill in the new fields */
- vinfo->full_name = g_strdup (full_name);
- vinfo->name = g_strdup (vinfo->full_name);
- vinfo->url = g_strdup_printf ("%s:%s", url_base, uri);
- if (!unread_count)
- vinfo->unread_message_count = -1;
- vinfo->path = g_strdup_printf ("/%s", vinfo->name);
- g_free (uri);
-}
-
-/**
- * camel_store_get_folder_info:
- * @store: a CamelStore
- * @top: the name of the folder to start from
- * @flags: various CAMEL_STORE_FOLDER_INFO_* flags to control behavior
- * @ex: a CamelException
- *
- * This fetches information about the folder structure of @store,
- * starting with @top, and returns a tree of CamelFolderInfo
- * structures. If @flags includes %CAMEL_STORE_FOLDER_INFO_SUBSCRIBED,
- * only subscribed folders will be listed. (This flag can only be used
- * for stores that support subscriptions.) If @flags includes
- * %CAMEL_STORE_FOLDER_INFO_RECURSIVE, the returned tree will include
- * all levels of hierarchy below @top. If not, it will only include
- * the immediate subfolders of @top. If @flags includes
- * %CAMEL_STORE_FOLDER_INFO_FAST, the unread_message_count fields of
- * some or all of the structures may be set to -1, if the store cannot
- * determine that information quickly.
- *
- * Return value: a CamelFolderInfo tree, which must be freed with
- * camel_store_free_folder_info.
- **/
-CamelFolderInfo *
-camel_store_get_folder_info (CamelStore *store, const char *top,
- guint32 flags, CamelException *ex)
-{
- CamelFolderInfo *info;
-
- g_return_val_if_fail (CAMEL_IS_STORE (store), NULL);
- g_return_val_if_fail ((store->flags & CAMEL_STORE_SUBSCRIPTIONS) ||
- !(flags & CAMEL_STORE_FOLDER_INFO_SUBSCRIBED),
- NULL);
-
- CAMEL_STORE_LOCK(store, folder_lock);
- info = CS_CLASS (store)->get_folder_info (store, top, flags, ex);
- CAMEL_STORE_UNLOCK(store, folder_lock);
-
- if (info && (top == NULL || *top == '\0')) {
- if (info->url && (store->flags & CAMEL_STORE_VTRASH))
- add_special_info (store, info, CAMEL_VTRASH_NAME, _("Trash"), "vtrash", FALSE);
- if (info->url && (store->flags & CAMEL_STORE_VJUNK))
- add_special_info (store, info, CAMEL_VJUNK_NAME, _("Junk"), "vjunk", TRUE);
- }
-
- return info;
-}
-
-
-static void
-free_folder_info (CamelStore *store, CamelFolderInfo *fi)
-{
- w(g_warning ("CamelStore::free_folder_info not implemented for `%s'",
- camel_type_to_name (CAMEL_OBJECT_GET_TYPE (store))));
-}
-
-/**
- * camel_store_free_folder_info:
- * @store: a CamelStore
- * @tree: the tree returned by camel_store_get_folder_info()
- *
- * Frees the data returned by camel_store_get_folder_info().
- **/
-void
-camel_store_free_folder_info (CamelStore *store, CamelFolderInfo *fi)
-{
- g_return_if_fail (CAMEL_IS_STORE (store));
-
- CS_CLASS (store)->free_folder_info (store, fi);
-}
-
-/**
- * camel_store_free_folder_info_full:
- * @store: a CamelStore
- * @tree: the tree returned by camel_store_get_folder_info()
- *
- * An implementation for CamelStore::free_folder_info. Frees all
- * of the data.
- **/
-void
-camel_store_free_folder_info_full (CamelStore *store, CamelFolderInfo *fi)
-{
- camel_folder_info_free (fi);
-}
-
-/**
- * camel_store_free_folder_info_nop:
- * @store: a CamelStore
- * @tree: the tree returned by camel_store_get_folder_info()
- *
- * An implementation for CamelStore::free_folder_info. Does nothing.
- **/
-void
-camel_store_free_folder_info_nop (CamelStore *store, CamelFolderInfo *fi)
-{
- ;
-}
-
-
-/**
- * camel_folder_info_free:
- * @fi: the CamelFolderInfo
- *
- * Frees @fi.
- **/
-void
-camel_folder_info_free (CamelFolderInfo *fi)
-{
- if (fi) {
- camel_folder_info_free (fi->sibling);
- camel_folder_info_free (fi->child);
- g_free (fi->name);
- g_free (fi->full_name);
- g_free (fi->path);
- g_free (fi->url);
- g_free (fi);
- }
-}
-
-
-/**
- * camel_folder_info_build_path:
- * @fi: folder info
- * @separator: directory separator
- *
- * Sets the folder info path based on the folder's full name and
- * directory separator.
- **/
-void
-camel_folder_info_build_path (CamelFolderInfo *fi, char separator)
-{
- const char *full_name;
- char *p;
-
- full_name = fi->full_name;
- while (*full_name == separator)
- full_name++;
-
- fi->path = g_strdup_printf ("/%s", full_name);
- if (separator != '/') {
- for (p = fi->path; *p; p++) {
- if (*p == separator)
- *p = '/';
- }
- }
-}
-
-static int
-folder_info_cmp (const void *ap, const void *bp)
-{
- const CamelFolderInfo *a = ((CamelFolderInfo **)ap)[0];
- const CamelFolderInfo *b = ((CamelFolderInfo **)bp)[0];
-
- return strcmp (a->full_name, b->full_name);
-}
-
-static void
-free_name(void *key, void *data, void *user)
-{
- g_free(key);
-}
-
-/**
- * camel_folder_info_build:
- * @folders: an array of CamelFolderInfo
- * @namespace: an ignorable prefix on the folder names
- * @separator: the hieararchy separator character
- * @short_names: %TRUE if the (short) name of a folder is the part after
- * the last @separator in the full name. %FALSE if it is the full name.
- *
- * This takes an array of folders and attaches them together according
- * to the hierarchy described by their full_names and @separator. If
- * @namespace is non-%NULL, then it will be ignored as a full_name
- * prefix, for purposes of comparison. If necessary,
- * camel_folder_info_build will create additional CamelFolderInfo with
- * %NULL urls to fill in gaps in the tree. The value of @short_names
- * is used in constructing the names of these intermediate folders.
- *
- * Return value: the top level of the tree of linked folder info.
- **/
-CamelFolderInfo *
-camel_folder_info_build (GPtrArray *folders, const char *namespace,
- char separator, gboolean short_names)
-{
- CamelFolderInfo *fi, *pfi, *top = NULL, *tail = NULL;
- GHashTable *hash;
- char *name, *p, *pname;
- int i, nlen;
-
- if (!namespace)
- namespace = "";
- nlen = strlen (namespace);
-
- qsort (folders->pdata, folders->len, sizeof (folders->pdata[0]), folder_info_cmp);
-
- /* Hash the folders. */
- hash = g_hash_table_new (g_str_hash, g_str_equal);
- for (i = 0; i < folders->len; i++) {
- fi = folders->pdata[i];
- if (!strncmp (namespace, fi->full_name, nlen))
- name = fi->full_name + nlen;
- else
- name = fi->full_name;
- if (*name == separator)
- name++;
- g_hash_table_insert (hash, g_strdup(name), fi);
- }
-
- /* Now find parents. */
- for (i = 0; i < folders->len; i++) {
- fi = folders->pdata[i];
- if (!strncmp (namespace, fi->full_name, nlen))
- name = fi->full_name + nlen;
- else
- name = fi->full_name;
- if (*name == separator)
- name++;
-
- /* set the path if it isn't already set */
- if (!fi->path)
- camel_folder_info_build_path (fi, separator);
-
- p = strrchr (name, separator);
- if (p) {
- pname = g_strndup (name, p - name);
- pfi = g_hash_table_lookup (hash, pname);
- if (pfi) {
- g_free (pname);
- } else {
- /* we are missing a folder in the heirarchy so
- create a fake folder node */
- CamelURL *url;
- char *sep;
-
- pfi = g_new0 (CamelFolderInfo, 1);
- if (short_names) {
- pfi->name = strrchr (pname, separator);
- if (pfi->name)
- pfi->name = g_strdup (pfi->name + 1);
- else
- pfi->name = g_strdup (pname);
- } else
- pfi->name = g_strdup (pname);
-
- /* FIXME: url's with fragments should have the fragment truncated, not path */
- url = camel_url_new (fi->url, NULL);
- sep = strrchr (url->path, separator);
- if (sep)
- *sep = '\0';
- else
- d(g_warning ("huh, no \"%c\" in \"%s\"?", separator, fi->url));
-
- pfi->full_name = g_strdup(url->path+1);
-
- /* since this is a "fake" folder node, it is not selectable */
- camel_url_set_param (url, "noselect", "yes");
- pfi->url = camel_url_to_string (url, 0);
- camel_url_free (url);
-
- g_hash_table_insert (hash, pname, pfi);
- g_ptr_array_add (folders, pfi);
- }
- tail = pfi->child;
- if (tail == NULL) {
- pfi->child = fi;
- } else {
- while (tail->sibling)
- tail = tail->sibling;
- tail->sibling = fi;
- }
- fi->parent = pfi;
- } else if (!top)
- top = fi;
- }
- g_hash_table_foreach(hash, free_name, NULL);
- g_hash_table_destroy (hash);
-
- /* Link together the top-level folders */
- tail = top;
- for (i = 0; i < folders->len; i++) {
- fi = folders->pdata[i];
- if (fi->parent || fi == top)
- continue;
- if (tail == NULL) {
- tail = fi;
- top = fi;
- } else {
- tail->sibling = fi;
- tail = fi;
- }
- }
-
- return top;
-}
-
-static CamelFolderInfo *folder_info_clone_rec(CamelFolderInfo *fi, CamelFolderInfo *parent)
-{
- CamelFolderInfo *info;
-
- info = g_malloc(sizeof(*info));
- info->parent = parent;
- info->url = g_strdup(fi->url);
- info->name = g_strdup(fi->name);
- info->full_name = g_strdup(fi->full_name);
- info->path = g_strdup(fi->path);
- info->unread_message_count = fi->unread_message_count;
-
- if (fi->sibling)
- info->sibling = folder_info_clone_rec(fi->sibling, parent);
- else
- info->sibling = NULL;
-
- if (fi->child)
- info->child = folder_info_clone_rec(fi->child, info);
- else
- info->child = NULL;
-
- return info;
-}
-
-CamelFolderInfo *
-camel_folder_info_clone(CamelFolderInfo *fi)
-{
- if (fi == NULL)
- return NULL;
-
- return folder_info_clone_rec(fi, NULL);
-}
-
-gboolean
-camel_store_supports_subscriptions (CamelStore *store)
-{
- return (store->flags & CAMEL_STORE_SUBSCRIPTIONS);
-}
-
-
-static gboolean
-folder_subscribed (CamelStore *store, const char *folder_name)
-{
- w(g_warning ("CamelStore::folder_subscribed not implemented for `%s'",
- camel_type_to_name (CAMEL_OBJECT_GET_TYPE (store))));
-
- return FALSE;
-}
-
-/**
- * camel_store_folder_subscribed: Tell whether or not a folder has been subscribed to.
- * @store: a CamelStore
- * @folder_name: the folder on which we're querying subscribed status.
- * Return value: TRUE if folder is subscribed, FALSE if not.
- **/
-gboolean
-camel_store_folder_subscribed (CamelStore *store,
- const char *folder_name)
-{
- gboolean ret;
-
- g_return_val_if_fail (CAMEL_IS_STORE (store), FALSE);
- g_return_val_if_fail (store->flags & CAMEL_STORE_SUBSCRIPTIONS, FALSE);
-
- CAMEL_STORE_LOCK(store, folder_lock);
-
- ret = CS_CLASS (store)->folder_subscribed (store, folder_name);
-
- CAMEL_STORE_UNLOCK(store, folder_lock);
-
- return ret;
-}
-
-static void
-subscribe_folder (CamelStore *store, const char *folder_name, CamelException *ex)
-{
- w(g_warning ("CamelStore::subscribe_folder not implemented for `%s'",
- camel_type_to_name (CAMEL_OBJECT_GET_TYPE (store))));
-}
-
-/**
- * camel_store_subscribe_folder: marks a folder as subscribed.
- * @store: a CamelStore
- * @folder_name: the folder to subscribe to.
- **/
-void
-camel_store_subscribe_folder (CamelStore *store,
- const char *folder_name,
- CamelException *ex)
-{
- g_return_if_fail (CAMEL_IS_STORE (store));
- g_return_if_fail (store->flags & CAMEL_STORE_SUBSCRIPTIONS);
-
- CAMEL_STORE_LOCK(store, folder_lock);
-
- CS_CLASS (store)->subscribe_folder (store, folder_name, ex);
-
- CAMEL_STORE_UNLOCK(store, folder_lock);
-}
-
-static void
-unsubscribe_folder (CamelStore *store, const char *folder_name, CamelException *ex)
-{
- w(g_warning ("CamelStore::unsubscribe_folder not implemented for `%s'",
- camel_type_to_name (CAMEL_OBJECT_GET_TYPE (store))));
-}
-
-
-/**
- * camel_store_unsubscribe_folder: marks a folder as unsubscribed.
- * @store: a CamelStore
- * @folder_name: the folder to unsubscribe from.
- **/
-void
-camel_store_unsubscribe_folder (CamelStore *store,
- const char *folder_name,
- CamelException *ex)
-{
- CamelFolder *folder = NULL;
-
- g_return_if_fail (CAMEL_IS_STORE (store));
- g_return_if_fail (store->flags & CAMEL_STORE_SUBSCRIPTIONS);
-
- CAMEL_STORE_LOCK(store, folder_lock);
-
- /* NB: Note similarity of this code to delete_folder */
-
- /* if we deleted a folder, force it out of the cache, and also out of the vtrash/vjunk if setup */
- if (store->folders) {
- folder = camel_object_bag_get(store->folders, folder_name);
- if (folder) {
- if (store->vtrash)
- camel_vee_folder_remove_folder((CamelVeeFolder *)store->vtrash, folder);
- if (store->vjunk)
- camel_vee_folder_remove_folder((CamelVeeFolder *)store->vjunk, folder);
- camel_folder_delete (folder);
- }
- }
-
- CS_CLASS (store)->unsubscribe_folder (store, folder_name, ex);
-
- if (folder) {
- if (store->folders)
- camel_object_bag_remove(store->folders, folder);
-
- camel_object_unref(folder);
- }
-
- CAMEL_STORE_UNLOCK(store, folder_lock);
-}
-
-
-static void
-noop (CamelStore *store, CamelException *ex)
-{
- /* no-op */
- ;
-}
-
-
-/**
- * camel_store_noop:
- * @store: CamelStore
- * @ex: exception
- *
- * Pings @store so that its connection doesn't timeout.
- **/
-void
-camel_store_noop (CamelStore *store, CamelException *ex)
-{
- CS_CLASS (store)->noop (store, ex);
-}
-
-
-/* Return true if these uri's refer to the same object */
-gboolean
-camel_store_uri_cmp(CamelStore *store, const char *uria, const char *urib)
-{
- g_assert(CAMEL_IS_STORE(store));
-
- return CS_CLASS(store)->compare_folder_name(uria, urib);
-}
diff --git a/camel/camel-store.h b/camel/camel-store.h
deleted file mode 100644
index 2b65751aac..0000000000
--- a/camel/camel-store.h
+++ /dev/null
@@ -1,242 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-store.h : Abstract class for an email store */
-
-/*
- *
- * Authors: Bertrand Guiheneuf <bertrand@helixcode.com>
- * Michael Zucchi <NotZed@ximian.com>
- * Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 1999, 2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifndef CAMEL_STORE_H
-#define CAMEL_STORE_H 1
-
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-/* for mode_t */
-#include <sys/types.h>
-
-#include <camel/camel-object.h>
-#include <camel/camel-service.h>
-
-enum {
- CAMEL_STORE_ARG_FIRST = CAMEL_SERVICE_ARG_FIRST + 100,
-};
-
-typedef struct _CamelFolderInfo {
- struct _CamelFolderInfo *parent,
- *sibling,
- *child;
- char *url;
- char *name;
- char *full_name;
- char *path;
- int unread_message_count;
- guint32 flags;
-} CamelFolderInfo;
-
-/* Note: these are abstractions (duh), its upto the provider to make them make sense */
-
-/* a folder which can't contain messages */
-#define CAMEL_FOLDER_NOSELECT (1<<0)
-/* a folder which cannot have children */
-#define CAMEL_FOLDER_NOINFERIORS (1<<1)
-/* a folder which has children (not yet fully implemented) */
-#define CAMEL_FOLDER_CHILDREN (1<<2)
-/* a folder which is subscribed */
-#define CAMEL_FOLDER_SUBSCRIBED (1<<3)
-
-/* Structure of rename event's event_data */
-typedef struct _CamelRenameInfo {
- char *old_base;
- struct _CamelFolderInfo *new;
-} CamelRenameInfo;
-
-#define CAMEL_STORE_TYPE (camel_store_get_type ())
-#define CAMEL_STORE(obj) (CAMEL_CHECK_CAST((obj), CAMEL_STORE_TYPE, CamelStore))
-#define CAMEL_STORE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_STORE_TYPE, CamelStoreClass))
-#define CAMEL_IS_STORE(o) (CAMEL_CHECK_TYPE((o), CAMEL_STORE_TYPE))
-
-
-/* Flags for store flags */
-#define CAMEL_STORE_SUBSCRIPTIONS (1 << 0)
-#define CAMEL_STORE_VTRASH (1 << 1)
-#define CAMEL_STORE_FILTER_INBOX (1 << 2)
-#define CAMEL_STORE_VJUNK (1 << 3)
-
-struct _CamelStore
-{
- CamelService parent_object;
- struct _CamelStorePrivate *priv;
-
- CamelFolder *vtrash;
- CamelFolder *vjunk;
-
- CamelObjectBag *folders;
-
- int flags;
-
- /* FIXME: This is a temporary measure until IMAP namespaces are properly implemented,
- after that, all external folder api's will assume a dir separator of '/' */
- /* This is always a copy of IMAP_STORE()->dir_sep, or '/' */
- char dir_sep;
-};
-
-
-/* open mode for folder */
-#define CAMEL_STORE_FOLDER_CREATE (1<<0)
-#define CAMEL_STORE_FOLDER_BODY_INDEX (1<<1)
-#define CAMEL_STORE_FOLDER_PRIVATE (1<<2) /* a private folder, that shouldn't show up in unmatched/folder info's, etc */
-
-#define CAMEL_STORE_FOLDER_INFO_FAST (1 << 0)
-#define CAMEL_STORE_FOLDER_INFO_RECURSIVE (1 << 1)
-#define CAMEL_STORE_FOLDER_INFO_SUBSCRIBED (1 << 2)
-
-typedef struct {
- CamelServiceClass parent_class;
-
- GHashFunc hash_folder_name;
- GCompareFunc compare_folder_name;
-
- CamelFolder * (*get_folder) (CamelStore *store,
- const char *folder_name,
- guint32 flags,
- CamelException *ex);
- CamelFolder * (*get_inbox) (CamelStore *store,
- CamelException *ex);
-
- void (*init_trash) (CamelStore *store);
- CamelFolder * (*get_trash) (CamelStore *store,
- CamelException *ex);
- void (*init_junk) (CamelStore *store);
- CamelFolder * (*get_junk) (CamelStore *store,
- CamelException *ex);
-
- CamelFolderInfo *(*create_folder) (CamelStore *store,
- const char *parent_name,
- const char *folder_name,
- CamelException *ex);
- void (*delete_folder) (CamelStore *store,
- const char *folder_name,
- CamelException *ex);
- void (*rename_folder) (CamelStore *store,
- const char *old_name,
- const char *new_name,
- CamelException *ex);
-
- void (*sync) (CamelStore *store,
- CamelException *ex);
-
- CamelFolderInfo *(*get_folder_info) (CamelStore *store,
- const char *top,
- guint32 flags,
- CamelException *ex);
- void (*free_folder_info) (CamelStore *store,
- CamelFolderInfo *fi);
-
- gboolean (*folder_subscribed) (CamelStore *store,
- const char *folder_name);
- void (*subscribe_folder) (CamelStore *store,
- const char *folder_name,
- CamelException *ex);
- void (*unsubscribe_folder) (CamelStore *store,
- const char *folder_name,
- CamelException *ex);
- void (*noop) (CamelStore *store,
- CamelException *ex);
-} CamelStoreClass;
-
-
-/* Standard Camel function */
-CamelType camel_store_get_type (void);
-
-/* public methods */
-CamelFolder * camel_store_get_folder (CamelStore *store,
- const char *folder_name,
- guint32 flags,
- CamelException *ex);
-CamelFolder * camel_store_get_inbox (CamelStore *store,
- CamelException *ex);
-CamelFolder * camel_store_get_trash (CamelStore *store,
- CamelException *ex);
-CamelFolder * camel_store_get_junk (CamelStore *store,
- CamelException *ex);
-
-CamelFolderInfo *camel_store_create_folder (CamelStore *store,
- const char *parent_name,
- const char *folder_name,
- CamelException *ex);
-void camel_store_delete_folder (CamelStore *store,
- const char *folder_name,
- CamelException *ex);
-void camel_store_rename_folder (CamelStore *store,
- const char *old_name,
- const char *new_name,
- CamelException *ex);
-
-void camel_store_sync (CamelStore *store,
- CamelException *ex);
-
-CamelFolderInfo *camel_store_get_folder_info (CamelStore *store,
- const char *top,
- guint32 flags,
- CamelException *ex);
-void camel_store_free_folder_info (CamelStore *store,
- CamelFolderInfo *fi);
-
-void camel_store_free_folder_info_full (CamelStore *store,
- CamelFolderInfo *fi);
-void camel_store_free_folder_info_nop (CamelStore *store,
- CamelFolderInfo *fi);
-
-void camel_folder_info_free (CamelFolderInfo *fi);
-void camel_folder_info_build_path (CamelFolderInfo *fi,
- char separator);
-CamelFolderInfo *camel_folder_info_build (GPtrArray *folders,
- const char *namespace,
- char separator,
- gboolean short_names);
-CamelFolderInfo *camel_folder_info_clone (CamelFolderInfo *fi);
-
-gboolean camel_store_supports_subscriptions (CamelStore *store);
-
-gboolean camel_store_folder_subscribed (CamelStore *store,
- const char *folder_name);
-void camel_store_subscribe_folder (CamelStore *store,
- const char *folder_name,
- CamelException *ex);
-void camel_store_unsubscribe_folder (CamelStore *store,
- const char *folder_name,
- CamelException *ex);
-
-void camel_store_noop (CamelStore *store,
- CamelException *ex);
-
-gboolean camel_store_uri_cmp (CamelStore *store, const char *uria, const char *urib);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_STORE_H */
diff --git a/camel/camel-stream-buffer.c b/camel/camel-stream-buffer.c
deleted file mode 100644
index 8051441ae7..0000000000
--- a/camel/camel-stream-buffer.c
+++ /dev/null
@@ -1,471 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; fill-column: 160 -*- */
-
-/* camel-stream-buffer.c : Buffer any other other stream
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * Copyright 1999-2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <errno.h>
-#include "camel-stream-buffer.h"
-
-static CamelStreamClass *parent_class = NULL;
-
-enum {
- BUF_USER = 1<<0, /* user-supplied buffer, do not free */
-};
-
-#define BUF_SIZE 1024
-
-static ssize_t stream_read (CamelStream *stream, char *buffer, size_t n);
-static ssize_t stream_write (CamelStream *stream, const char *buffer, size_t n);
-static int stream_flush (CamelStream *stream);
-static int stream_close (CamelStream *stream);
-static gboolean stream_eos (CamelStream *stream);
-
-static void init_vbuf(CamelStreamBuffer *sbf, CamelStream *s, CamelStreamBufferMode mode, char *buf, guint32 size);
-static void init(CamelStreamBuffer *sbuf, CamelStream *s, CamelStreamBufferMode mode);
-
-static void
-camel_stream_buffer_class_init (CamelStreamBufferClass *camel_stream_buffer_class)
-{
- CamelStreamClass *camel_stream_class = CAMEL_STREAM_CLASS (camel_stream_buffer_class);
-
- parent_class = CAMEL_STREAM_CLASS (camel_type_get_global_classfuncs (camel_stream_get_type ()));
-
- /* virtual method definition */
- camel_stream_buffer_class->init = init;
- camel_stream_buffer_class->init_vbuf = init_vbuf;
-
- /* virtual method overload */
- camel_stream_class->read = stream_read;
- camel_stream_class->write = stream_write;
- camel_stream_class->flush = stream_flush;
- camel_stream_class->close = stream_close;
- camel_stream_class->eos = stream_eos;
-}
-
-static void
-camel_stream_buffer_init (gpointer object, gpointer klass)
-{
- CamelStreamBuffer *sbf = CAMEL_STREAM_BUFFER (object);
-
- sbf->flags = 0;
- sbf->size = BUF_SIZE;
- sbf->buf = g_malloc(BUF_SIZE);
- sbf->ptr = sbf->buf;
- sbf->end = sbf->buf;
- sbf->mode = CAMEL_STREAM_BUFFER_READ | CAMEL_STREAM_BUFFER_BUFFER;
- sbf->stream = 0;
- sbf->linesize = 80;
- sbf->linebuf = g_malloc(sbf->linesize);
-}
-
-static void
-camel_stream_buffer_finalize (CamelObject *object)
-{
- CamelStreamBuffer *sbf = CAMEL_STREAM_BUFFER (object);
-
- if (!(sbf->flags & BUF_USER)) {
- g_free(sbf->buf);
- }
- if (sbf->stream)
- camel_object_unref (sbf->stream);
-
- g_free(sbf->linebuf);
-}
-
-
-CamelType
-camel_stream_buffer_get_type (void)
-{
- static CamelType camel_stream_buffer_type = CAMEL_INVALID_TYPE;
-
- if (camel_stream_buffer_type == CAMEL_INVALID_TYPE) {
- camel_stream_buffer_type = camel_type_register (camel_stream_get_type (), "CamelStreamBuffer",
- sizeof (CamelStreamBuffer),
- sizeof (CamelStreamBufferClass),
- (CamelObjectClassInitFunc) camel_stream_buffer_class_init,
- NULL,
- (CamelObjectInitFunc) camel_stream_buffer_init,
- (CamelObjectFinalizeFunc) camel_stream_buffer_finalize);
- }
-
- return camel_stream_buffer_type;
-}
-
-
-static void
-set_vbuf(CamelStreamBuffer *sbf, char *buf, CamelStreamBufferMode mode, int size)
-{
- if (sbf->buf && !(sbf->flags & BUF_USER)) {
- g_free(sbf->buf);
- }
- if (buf) {
- sbf->buf = buf;
- sbf->flags |= BUF_USER;
- } else {
- sbf->buf = g_malloc(size);
- sbf->flags &= ~BUF_USER;
- }
- sbf->size = size;
- sbf->mode = mode;
-}
-
-static void
-init_vbuf(CamelStreamBuffer *sbf, CamelStream *s, CamelStreamBufferMode mode, char *buf, guint32 size)
-{
- set_vbuf(sbf, buf, mode, size);
- if (sbf->stream)
- camel_object_unref (sbf->stream);
- sbf->stream = s;
- camel_object_ref (sbf->stream);
-}
-
-static void
-init(CamelStreamBuffer *sbuf, CamelStream *s, CamelStreamBufferMode mode)
-{
- init_vbuf(sbuf, s, mode, NULL, BUF_SIZE);
-}
-
-
-/**
- * camel_stream_buffer_new:
- * @stream: Existing stream to buffer.
- * @mode: Operational mode of buffered stream.
- *
- * Create a new buffered stream of another stream. A default
- * buffer size (1024 bytes), automatically managed will be used
- * for buffering.
- *
- * See camel_stream_buffer_new_with_vbuf() for details on the
- * @mode parameter.
- *
- * Return value: A newly created buffered stream.
- **/
-CamelStream *
-camel_stream_buffer_new (CamelStream *stream, CamelStreamBufferMode mode)
-{
- CamelStreamBuffer *sbf;
-
- sbf = CAMEL_STREAM_BUFFER (camel_object_new (camel_stream_buffer_get_type ()));
- CAMEL_STREAM_BUFFER_CLASS (CAMEL_OBJECT_GET_CLASS(sbf))->init (sbf, stream, mode);
-
- return CAMEL_STREAM (sbf);
-}
-
-/**
- * camel_stream_buffer_new_with_vbuf:
- * @stream: An existing stream to buffer.
- * @mode: Mode to buffer in.
- * @buf: Memory to use for buffering.
- * @size: Size of buffer to use.
- *
- * Create a new stream which buffers another stream, @stream.
- *
- * The following values are available for @mode:
- *
- * CAMEL_STREAM_BUFFER_BUFFER, Buffer the input/output in blocks.
- * CAMEL_STREAM_BUFFER_NEWLINE, Buffer on newlines (for output).
- * CAMEL_STREAM_BUFFER_NONE, Perform no buffering.
- *
- * Note that currently this is ignored and CAMEL_STREAM_BUFFER_BUFFER
- * is always used.
- *
- * In addition, one of the following mode options should be or'd
- * together with the buffering mode:
- *
- * CAMEL_STREAM_BUFFER_WRITE, Buffer in write mode.
- * CAMEL_STREAM_BUFFER_READ, Buffer in read mode.
- *
- * Buffering can only be done in one direction for any
- * buffer instance.
- *
- * If @buf is non-NULL, then use the memory pointed to
- * (for upto @size bytes) as the buffer for all buffering
- * operations. It is upto the application to free this buffer.
- * If @buf is NULL, then allocate and manage @size bytes
- * for all buffering.
- *
- * Return value: A new stream with buffering applied.
- **/
-CamelStream *camel_stream_buffer_new_with_vbuf (CamelStream *stream, CamelStreamBufferMode mode, char *buf, guint32 size)
-{
- CamelStreamBuffer *sbf;
- sbf = CAMEL_STREAM_BUFFER (camel_object_new (camel_stream_buffer_get_type ()));
- CAMEL_STREAM_BUFFER_CLASS (CAMEL_OBJECT_GET_CLASS(sbf))->init_vbuf (sbf, stream, mode, buf, size);
-
- return CAMEL_STREAM (sbf);
-}
-
-static ssize_t
-stream_read (CamelStream *stream, char *buffer, size_t n)
-{
- CamelStreamBuffer *sbf = CAMEL_STREAM_BUFFER (stream);
- ssize_t bytes_read = 1;
- ssize_t bytes_left;
- char *bptr = buffer;
-
- g_return_val_if_fail( (sbf->mode & CAMEL_STREAM_BUFFER_MODE) == CAMEL_STREAM_BUFFER_READ, 0);
-
- while (n && bytes_read > 0) {
- bytes_left = sbf->end - sbf->ptr;
- if (bytes_left < n) {
- if (bytes_left > 0) {
- memcpy(bptr, sbf->ptr, bytes_left);
- n -= bytes_left;
- bptr += bytes_left;
- sbf->ptr += bytes_left;
- }
- /* if we are reading a lot, then read directly to the destination buffer */
- if (n >= sbf->size/3) {
- bytes_read = camel_stream_read(sbf->stream, bptr, n);
- if (bytes_read>0) {
- n -= bytes_read;
- bptr += bytes_read;
- }
- } else {
- bytes_read = camel_stream_read(sbf->stream, sbf->buf, sbf->size);
- if (bytes_read>0) {
- size_t bytes_used = bytes_read > n ? n : bytes_read;
- sbf->ptr = sbf->buf;
- sbf->end = sbf->buf+bytes_read;
- memcpy(bptr, sbf->ptr, bytes_used);
- sbf->ptr += bytes_used;
- bptr += bytes_used;
- n -= bytes_used;
- }
- }
- } else {
- memcpy(bptr, sbf->ptr, n);
- sbf->ptr += n;
- bptr += n;
- n = 0;
- }
- }
-
- return (ssize_t)(bptr - buffer);
-}
-
-/* only returns the number passed in, or -1 on an error */
-static ssize_t
-stream_write_all(CamelStream *stream, const char *buffer, size_t n)
-{
- size_t left = n, w;
-
- while (left > 0) {
- w = camel_stream_write(stream, buffer, left);
- if (w == -1)
- return -1;
- left -= w;
- buffer += w;
- }
-
- return n;
-}
-
-static ssize_t
-stream_write (CamelStream *stream, const char *buffer, size_t n)
-{
- CamelStreamBuffer *sbf = CAMEL_STREAM_BUFFER (stream);
- ssize_t total = n;
- ssize_t left, todo;
-
- g_return_val_if_fail( (sbf->mode & CAMEL_STREAM_BUFFER_MODE) == CAMEL_STREAM_BUFFER_WRITE, 0);
-
- /* first, copy as much as we can */
- left = sbf->size - (sbf->ptr-sbf->buf);
- todo = MIN(left, n);
-
- memcpy(sbf->ptr, buffer, todo);
- n -= todo;
- buffer += todo;
- sbf->ptr += todo;
-
- /* if we've filled the buffer, write it out, reset buffer */
- if (left == todo) {
- if (stream_write_all(sbf->stream, sbf->buf, sbf->size) == -1)
- return -1;
-
- sbf->ptr = sbf->buf;
- }
-
- /* if we still have more, write directly, or copy to buffer */
- if (n > 0) {
- if (n >= sbf->size/3) {
- if (stream_write_all(sbf->stream, buffer, n) == -1)
- return -1;
- } else {
- memcpy(sbf->ptr, buffer, n);
- sbf->ptr += n;
- }
- }
-
- return total;
-}
-
-static int
-stream_flush (CamelStream *stream)
-{
- CamelStreamBuffer *sbf = CAMEL_STREAM_BUFFER (stream);
-
- if ((sbf->mode & CAMEL_STREAM_BUFFER_MODE) == CAMEL_STREAM_BUFFER_WRITE) {
- int len = sbf->ptr-sbf->buf;
- int written = camel_stream_write(sbf->stream, sbf->buf, len);
- if (written > 0)
- sbf->ptr += written;
- if (written != len)
- return -1;
- } else {
- /* nothing to do for read mode 'flush' */
- }
-
- return camel_stream_flush(sbf->stream);
-}
-
-static int
-stream_close (CamelStream *stream)
-{
- CamelStreamBuffer *sbf = CAMEL_STREAM_BUFFER (stream);
-
- if (stream_flush(stream) == -1)
- return -1;
- return camel_stream_close(sbf->stream);
-}
-
-static gboolean
-stream_eos (CamelStream *stream)
-{
- CamelStreamBuffer *sbf = CAMEL_STREAM_BUFFER (stream);
-
- return camel_stream_eos(sbf->stream) && sbf->ptr == sbf->end;
-}
-
-/**
- * camel_stream_buffer_gets:
- * @sbf: A CamelStreamBuffer.
- * @buf: Memory to write the string to.
- * @max: Maxmimum number of characters to store.
- *
- * Read a line of characters up to the next newline character or
- * @max-1 characters.
- *
- * If the newline character is encountered, then it will be
- * included in the buffer @buf. The buffer will be #NUL terminated.
- *
- * Return value: The number of characters read, or 0 for end of file,
- * and -1 on error.
- **/
-int camel_stream_buffer_gets(CamelStreamBuffer *sbf, char *buf, unsigned int max)
-{
- register char *outptr, *inptr, *inend, c, *outend;
- int bytes_read;
-
- outptr = buf;
- inptr = sbf->ptr;
- inend = sbf->end;
- outend = buf+max-1; /* room for NUL */
-
- do {
- while (inptr<inend && outptr<outend) {
- c = *inptr++;
- *outptr++ = c;
- if (c == '\n') {
- *outptr = 0;
- sbf->ptr = inptr;
- return outptr-buf;
- }
- }
- if (outptr == outend)
- break;
-
- bytes_read = camel_stream_read (sbf->stream, sbf->buf, sbf->size);
- if (bytes_read == -1) {
- if (buf == outptr)
- return -1;
- else
- bytes_read = 0;
- }
- inptr = sbf->ptr = sbf->buf;
- inend = sbf->end = sbf->buf + bytes_read;
- } while (bytes_read>0);
-
- sbf->ptr = inptr;
- *outptr = 0;
-
- return (int)(outptr - buf);
-}
-
-/**
- * camel_stream_buffer_read_line: read a complete line from the stream
- * @sbf: A CamelStreamBuffer
- *
- * This function reads a complete newline-terminated line from the stream
- * and returns it in allocated memory. The trailing newline (and carriage
- * return if any) are not included in the returned string.
- *
- * Return value: the line read, which the caller must free when done with,
- * or NULL on eof. If an error occurs, @ex will be set.
- **/
-char *
-camel_stream_buffer_read_line (CamelStreamBuffer *sbf)
-{
- unsigned char *p;
- int nread;
-
- p = sbf->linebuf;
-
- while (1) {
- nread = camel_stream_buffer_gets (sbf, p, sbf->linesize - (p - sbf->linebuf));
- if (nread <=0) {
- if (p > sbf->linebuf)
- break;
- return NULL;
- }
-
- p += nread;
- if (p[-1] == '\n')
- break;
-
- nread = p - sbf->linebuf;
- sbf->linesize *= 2;
- sbf->linebuf = g_realloc (sbf->linebuf, sbf->linesize);
- p = sbf->linebuf + nread;
- }
-
- p--;
- if (p > sbf->linebuf && p[-1] == '\r')
- p--;
- p[0] = 0;
-
- return g_strdup(sbf->linebuf);
-}
-
-
-
-
-
-
diff --git a/camel/camel-stream-buffer.h b/camel/camel-stream-buffer.h
deleted file mode 100644
index 03a8517066..0000000000
--- a/camel/camel-stream-buffer.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-stream-buffer.h :stream which buffers another stream */
-
-/*
- *
- * Author :
- * Michael Zucchi <notzed@ximian.com>
- *
- * Copyright 2000 Ximian Inc. (www.ximian.com) .
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifndef CAMEL_STREAM_BUFFER_H
-#define CAMEL_STREAM_BUFFER_H 1
-
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include <stdio.h>
-#include <camel/camel-seekable-stream.h>
-
-#define CAMEL_STREAM_BUFFER_TYPE (camel_stream_buffer_get_type ())
-#define CAMEL_STREAM_BUFFER(obj) (CAMEL_CHECK_CAST((obj), CAMEL_STREAM_BUFFER_TYPE, CamelStreamBuffer))
-#define CAMEL_STREAM_BUFFER_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_STREAM_BUFFER_TYPE, CamelStreamBufferClass))
-#define CAMEL_IS_STREAM_BUFFER(o) (CAMEL_CHECK_TYPE((o), CAMEL_STREAM_BUFFER_TYPE))
-
-typedef enum {
- CAMEL_STREAM_BUFFER_BUFFER = 0,
- CAMEL_STREAM_BUFFER_NONE,
- CAMEL_STREAM_BUFFER_READ = 0x00,
- CAMEL_STREAM_BUFFER_WRITE = 0x80,
- CAMEL_STREAM_BUFFER_MODE = 0x80
-} CamelStreamBufferMode;
-
-struct _CamelStreamBuffer
-{
- CamelStream parent_object;
-
- /* these are all of course, private */
- CamelStream *stream;
-
- unsigned char *buf, *ptr, *end;
- int size;
-
- unsigned char *linebuf; /* for reading lines at a time */
- int linesize;
-
- CamelStreamBufferMode mode;
- unsigned int flags; /* internal flags */
-};
-
-
-typedef struct {
- CamelStreamClass parent_class;
-
- /* Virtual methods */
- void (*init) (CamelStreamBuffer *stream_buffer, CamelStream *stream,
- CamelStreamBufferMode mode);
- void (*init_vbuf) (CamelStreamBuffer *stream_buffer,
- CamelStream *stream, CamelStreamBufferMode mode,
- char *buf, guint32 size);
-
-} CamelStreamBufferClass;
-
-
-/* Standard Camel function */
-CamelType camel_stream_buffer_get_type (void);
-
-
-/* public methods */
-CamelStream *camel_stream_buffer_new (CamelStream *s,
- CamelStreamBufferMode mode);
-CamelStream *camel_stream_buffer_new_with_vbuf (CamelStream *s,
- CamelStreamBufferMode mode,
- char *buf, guint32 size);
-
-/* unimplemented
- CamelStream *camel_stream_buffer_set_vbuf (CamelStreamBuffer *b, CamelStreamBufferMode mode, char *buf, guint32 size); */
-
-/* read a line of characters */
-int camel_stream_buffer_gets (CamelStreamBuffer *b, char *buf, unsigned int max);
-
-char *camel_stream_buffer_read_line (CamelStreamBuffer *sbf);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_STREAM_BUFFER_H */
diff --git a/camel/camel-stream-filter.c b/camel/camel-stream-filter.c
deleted file mode 100644
index 059a5198f1..0000000000
--- a/camel/camel-stream-filter.c
+++ /dev/null
@@ -1,406 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; fill-column: 160 -*- */
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <string.h>
-#include "camel-stream-filter.h"
-
-#define d(x)
-
-/* use my malloc debugger? */
-/*extern void g_check(void *mp);*/
-#define g_check(x)
-
-struct _filter {
- struct _filter *next;
- int id;
- CamelMimeFilter *filter;
-};
-
-struct _CamelStreamFilterPrivate {
- struct _filter *filters;
- int filterid; /* next filter id */
-
- char *realbuffer; /* buffer - READ_PAD */
- char *buffer; /* READ_SIZE bytes */
-
- char *filtered; /* the filtered data */
- size_t filteredlen;
-
- int last_was_read:1; /* was the last op read or write? */
- int flushed:1; /* were the filters flushed? */
-};
-
-#define READ_PAD (128) /* bytes padded before buffer */
-#define READ_SIZE (4096)
-
-#define _PRIVATE(o) (((CamelStreamFilter *)(o))->priv)
-
-static void camel_stream_filter_class_init (CamelStreamFilterClass *klass);
-static void camel_stream_filter_init (CamelStreamFilter *obj);
-
-static ssize_t do_read (CamelStream *stream, char *buffer, size_t n);
-static ssize_t do_write (CamelStream *stream, const char *buffer, size_t n);
-static int do_flush (CamelStream *stream);
-static int do_close (CamelStream *stream);
-static gboolean do_eos (CamelStream *stream);
-static int do_reset (CamelStream *stream);
-
-static CamelStreamClass *camel_stream_filter_parent;
-
-static void
-camel_stream_filter_class_init (CamelStreamFilterClass *klass)
-{
- CamelStreamClass *camel_stream_class = (CamelStreamClass *) klass;
-
- camel_stream_filter_parent = CAMEL_STREAM_CLASS (camel_type_get_global_classfuncs (camel_stream_get_type ()));
-
- camel_stream_class->read = do_read;
- camel_stream_class->write = do_write;
- camel_stream_class->flush = do_flush;
- camel_stream_class->close = do_close;
- camel_stream_class->eos = do_eos;
- camel_stream_class->reset = do_reset;
-
-}
-
-static void
-camel_stream_filter_init (CamelStreamFilter *obj)
-{
- struct _CamelStreamFilterPrivate *p;
-
- _PRIVATE(obj) = p = g_malloc0(sizeof(*p));
- p->realbuffer = g_malloc(READ_SIZE + READ_PAD);
- p->buffer = p->realbuffer + READ_PAD;
- p->last_was_read = TRUE;
- p->flushed = FALSE;
-}
-
-static void
-camel_stream_filter_finalize(CamelObject *o)
-{
- CamelStreamFilter *filter = (CamelStreamFilter *)o;
- struct _CamelStreamFilterPrivate *p = _PRIVATE(filter);
- struct _filter *fn, *f;
-
- f = p->filters;
- while (f) {
- fn = f->next;
- camel_object_unref((CamelObject *)f->filter);
- g_free(f);
- f = fn;
- }
- g_free(p->realbuffer);
- g_free(p);
- camel_object_unref((CamelObject *)filter->source);
-}
-
-CamelType
-camel_stream_filter_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (CAMEL_STREAM_TYPE, "CamelStreamFilter",
- sizeof (CamelStreamFilter),
- sizeof (CamelStreamFilterClass),
- (CamelObjectClassInitFunc) camel_stream_filter_class_init,
- NULL,
- (CamelObjectInitFunc) camel_stream_filter_init,
- (CamelObjectFinalizeFunc) camel_stream_filter_finalize);
- }
-
- return type;
-}
-
-/**
- * camel_stream_filter_new:
- *
- * Create a new CamelStreamFilter object.
- *
- * Return value: A new CamelStreamFilter object.
- **/
-CamelStreamFilter *
-camel_stream_filter_new_with_stream(CamelStream *stream)
-{
- CamelStreamFilter *new = CAMEL_STREAM_FILTER ( camel_object_new (camel_stream_filter_get_type ()));
-
- new->source = stream;
- camel_object_ref ((CamelObject *)stream);
-
- return new;
-}
-
-/**
- * camel_stream_filter_add:
- * @filter: Initialised CamelStreamFilter.
- * @mf: Filter to perform processing on stream.
- *
- * Add a new CamelMimeFilter to execute during the processing of this
- * stream. Each filter added is processed after the previous one.
- *
- * Note that a filter should only be added to a single stream
- * at a time, otherwise unpredictable results may occur.
- *
- * Return value: A filter id for this CamelStreamFilter.
- **/
-int
-camel_stream_filter_add(CamelStreamFilter *filter, CamelMimeFilter *mf)
-{
- struct _CamelStreamFilterPrivate *p = _PRIVATE(filter);
- struct _filter *fn, *f;
-
- fn = g_malloc(sizeof(*fn));
- fn->id = p->filterid++;
- fn->filter = mf;
- camel_object_ref((CamelObject *)mf);
-
- /* sure, we could use a GList, but we wouldn't save much */
- f = (struct _filter *)&p->filters;
- while (f->next)
- f = f->next;
- f->next = fn;
- fn->next = NULL;
- return fn->id;
-}
-
-/**
- * camel_stream_filter_remove:
- * @filter: Initialised CamelStreamFilter.
- * @id: Filter id, as returned from camel_stream_filter_add().
- *
- * Remove a processing filter from the stream, by id.
- **/
-void
-camel_stream_filter_remove(CamelStreamFilter *filter, int id)
-{
- struct _CamelStreamFilterPrivate *p = _PRIVATE(filter);
- struct _filter *fn, *f;
-
- f = (struct _filter *)&p->filters;
- while (f && f->next) {
- fn = f->next;
- if (fn->id == id) {
- f->next = fn->next;
- camel_object_unref((CamelObject *)fn->filter);
- g_free(fn);
- }
- f = f->next;
- }
-}
-
-static ssize_t
-do_read (CamelStream *stream, char *buffer, size_t n)
-{
- CamelStreamFilter *filter = (CamelStreamFilter *)stream;
- struct _CamelStreamFilterPrivate *p = _PRIVATE(filter);
- ssize_t size;
- struct _filter *f;
-
- p->last_was_read = TRUE;
-
- g_check(p->realbuffer);
-
- if (p->filteredlen<=0) {
- size_t presize = READ_PAD;
-
- size = camel_stream_read(filter->source, p->buffer, READ_SIZE);
- if (size <= 0) {
- /* this is somewhat untested */
- if (camel_stream_eos(filter->source)) {
- f = p->filters;
- p->filtered = p->buffer;
- p->filteredlen = 0;
- while (f) {
- camel_mime_filter_complete(f->filter, p->filtered, p->filteredlen,
- presize, &p->filtered, &p->filteredlen, &presize);
- g_check(p->realbuffer);
- f = f->next;
- }
- size = p->filteredlen;
- p->flushed = TRUE;
- }
- if (size <= 0)
- return size;
- } else {
- f = p->filters;
- p->filtered = p->buffer;
- p->filteredlen = size;
-
- d(printf ("\n\nOriginal content (%s): '", ((CamelObject *)filter->source)->klass->name));
- d(fwrite(p->filtered, sizeof(char), p->filteredlen, stdout));
- d(printf("'\n"));
-
- while (f) {
- camel_mime_filter_filter(f->filter, p->filtered, p->filteredlen, presize,
- &p->filtered, &p->filteredlen, &presize);
- g_check(p->realbuffer);
-
- d(printf ("Filtered content (%s): '", ((CamelObject *)f->filter)->klass->name));
- d(fwrite(p->filtered, sizeof(char), p->filteredlen, stdout));
- d(printf("'\n"));
-
- f = f->next;
- }
- }
- }
-
- size = MIN(n, p->filteredlen);
- memcpy(buffer, p->filtered, size);
- p->filteredlen -= size;
- p->filtered += size;
-
- g_check(p->realbuffer);
-
- return size;
-}
-
-/* Note: Since the caller expects to write out as much as they asked us to
- write (for 'success'), we return what they asked us to write (for 'success')
- rather than the true number of written bytes */
-static ssize_t
-do_write (CamelStream *stream, const char *buf, size_t n)
-{
- CamelStreamFilter *filter = (CamelStreamFilter *)stream;
- struct _CamelStreamFilterPrivate *p = _PRIVATE(filter);
- struct _filter *f;
- size_t presize;
- char *buffer = (char *)buf;
- size_t len = n;
-
- p->last_was_read = FALSE;
-
- d(printf ("\n\nWriting: Original content (%s): '", ((CamelObject *)filter->source)->klass->name));
- d(fwrite(buffer, sizeof(char), len, stdout));
- d(printf("'\n"));
-
- g_check(p->realbuffer);
-
- f = p->filters;
- presize = 0;
- while (f) {
- camel_mime_filter_filter(f->filter, buffer, len, presize, &buffer, &len, &presize);
-
- g_check(p->realbuffer);
-
- d(printf ("Filtered content (%s): '", ((CamelObject *)f->filter)->klass->name));
- d(fwrite(buffer, sizeof(char), len, stdout));
- d(printf("'\n"));
-
- f = f->next;
- }
-
- if (camel_stream_write(filter->source, buffer, len) != len)
- return -1;
-
- g_check(p->realbuffer);
-
- return n;
-}
-
-static int
-do_flush (CamelStream *stream)
-{
- CamelStreamFilter *filter = (CamelStreamFilter *)stream;
- struct _CamelStreamFilterPrivate *p = _PRIVATE(filter);
- struct _filter *f;
- char *buffer;
- size_t presize;
- size_t len;
-
- if (p->last_was_read)
- return 0;
-
- buffer = "";
- len = 0;
- presize = 0;
- f = p->filters;
-
- d(printf ("\n\nFlushing: Original content (%s): '", ((CamelObject *)filter->source)->klass->name));
- d(fwrite(buffer, sizeof(char), len, stdout));
- d(printf("'\n"));
-
- while (f) {
- camel_mime_filter_complete(f->filter, buffer, len, presize, &buffer, &len, &presize);
-
- d(printf ("Filtered content (%s): '", ((CamelObject *)f->filter)->klass->name));
- d(fwrite(buffer, sizeof(char), len, stdout));
- d(printf("'\n"));
-
- f = f->next;
- }
- if (len > 0 && camel_stream_write(filter->source, buffer, len) == -1)
- return -1;
- return camel_stream_flush(filter->source);
-}
-
-static int
-do_close (CamelStream *stream)
-{
- CamelStreamFilter *filter = (CamelStreamFilter *)stream;
- struct _CamelStreamFilterPrivate *p = _PRIVATE(filter);
-
- if (!p->last_was_read) {
- do_flush(stream);
- }
- return camel_stream_close(filter->source);
-}
-
-static gboolean
-do_eos (CamelStream *stream)
-{
- CamelStreamFilter *filter = (CamelStreamFilter *)stream;
- struct _CamelStreamFilterPrivate *p = _PRIVATE(filter);
-
- if (p->filteredlen > 0)
- return FALSE;
-
- if (!p->flushed)
- return FALSE;
-
- return camel_stream_eos(filter->source);
-}
-
-static int
-do_reset (CamelStream *stream)
-{
- CamelStreamFilter *filter = (CamelStreamFilter *)stream;
- struct _CamelStreamFilterPrivate *p = _PRIVATE(filter);
- struct _filter *f;
-
- p->filteredlen = 0;
- p->flushed = FALSE;
-
- /* and reset filters */
- f = p->filters;
- while (f) {
- camel_mime_filter_reset(f->filter);
- f = f->next;
- }
-
- return camel_stream_reset(filter->source);
-}
-
diff --git a/camel/camel-stream-filter.h b/camel/camel-stream-filter.h
deleted file mode 100644
index 3d265e8b4c..0000000000
--- a/camel/camel-stream-filter.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-
-#ifndef _CAMEL_STREAM_FILTER_H
-#define _CAMEL_STREAM_FILTER_H
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <camel/camel-stream.h>
-#include <camel/camel-mime-filter.h>
-
-#define CAMEL_STREAM_FILTER(obj) CAMEL_CHECK_CAST (obj, camel_stream_filter_get_type (), CamelStreamFilter)
-#define CAMEL_STREAM_FILTER_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_stream_filter_get_type (), CamelStreamFilterClass)
-#define CAMEL_IS_STREAM_FILTER(obj) CAMEL_CHECK_TYPE (obj, camel_stream_filter_get_type ())
-
-typedef struct _CamelStreamFilterClass CamelStreamFilterClass;
-
-struct _CamelStreamFilter {
- CamelStream parent;
-
- CamelStream *source;
-
- struct _CamelStreamFilterPrivate *priv;
-};
-
-struct _CamelStreamFilterClass {
- CamelStreamClass parent_class;
-};
-
-CamelType camel_stream_filter_get_type (void);
-
-CamelStreamFilter *camel_stream_filter_new_with_stream (CamelStream *stream);
-
-int camel_stream_filter_add (CamelStreamFilter *filter, CamelMimeFilter *);
-void camel_stream_filter_remove (CamelStreamFilter *filter, int id);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* ! _CAMEL_STREAM_FILTER_H */
diff --git a/camel/camel-stream-fs.c b/camel/camel-stream-fs.c
deleted file mode 100644
index 6560512d0c..0000000000
--- a/camel/camel-stream-fs.c
+++ /dev/null
@@ -1,304 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-stream-fs.c : file system based stream */
-
-/*
- * Authors: Bertrand Guiheneuf <bertrand@helixcode.com>
- * Michael Zucchi <notzed@ximian.com>
- *
- * Copyright 1999-2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <string.h>
-
-#include "camel-file-utils.h"
-#include "camel-operation.h"
-#include "camel-stream-fs.h"
-#include "camel-session.h"
-
-static CamelSeekableStreamClass *parent_class = NULL;
-
-/* Returns the class for a CamelStreamFS */
-#define CSFS_CLASS(so) CAMEL_STREAM_FS_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-
-static ssize_t stream_read (CamelStream *stream, char *buffer, size_t n);
-static ssize_t stream_write (CamelStream *stream, const char *buffer, size_t n);
-static int stream_flush (CamelStream *stream);
-static int stream_close (CamelStream *stream);
-static off_t stream_seek (CamelSeekableStream *stream, off_t offset,
- CamelStreamSeekPolicy policy);
-
-static void
-camel_stream_fs_class_init (CamelStreamFsClass *camel_stream_fs_class)
-{
- CamelSeekableStreamClass *camel_seekable_stream_class =
- CAMEL_SEEKABLE_STREAM_CLASS (camel_stream_fs_class);
- CamelStreamClass *camel_stream_class =
- CAMEL_STREAM_CLASS (camel_stream_fs_class);
-
- parent_class = CAMEL_SEEKABLE_STREAM_CLASS (camel_type_get_global_classfuncs (camel_seekable_stream_get_type ()));
-
- /* virtual method overload */
- camel_stream_class->read = stream_read;
- camel_stream_class->write = stream_write;
- camel_stream_class->flush = stream_flush;
- camel_stream_class->close = stream_close;
-
- camel_seekable_stream_class->seek = stream_seek;
-}
-
-static void
-camel_stream_fs_init (gpointer object, gpointer klass)
-{
- CamelStreamFs *stream = CAMEL_STREAM_FS (object);
-
- stream->fd = -1;
- ((CamelSeekableStream *)stream)->bound_end = CAMEL_STREAM_UNBOUND;
-}
-
-static void
-camel_stream_fs_finalize (CamelObject *object)
-{
- CamelStreamFs *stream_fs = CAMEL_STREAM_FS (object);
-
- if (stream_fs->fd != -1)
- close (stream_fs->fd);
-}
-
-
-CamelType
-camel_stream_fs_get_type (void)
-{
- static CamelType camel_stream_fs_type = CAMEL_INVALID_TYPE;
-
- if (camel_stream_fs_type == CAMEL_INVALID_TYPE) {
- camel_stream_fs_type = camel_type_register (camel_seekable_stream_get_type (), "CamelStreamFs",
- sizeof (CamelStreamFs),
- sizeof (CamelStreamFsClass),
- (CamelObjectClassInitFunc) camel_stream_fs_class_init,
- NULL,
- (CamelObjectInitFunc) camel_stream_fs_init,
- (CamelObjectFinalizeFunc) camel_stream_fs_finalize);
- }
-
- return camel_stream_fs_type;
-}
-
-/**
- * camel_stream_fs_new_with_fd:
- * @fd: a file descriptor
- *
- * Creates a new fs stream using the given file descriptor @fd as the
- * backing store. When the stream is destroyed, the file descriptor
- * will be closed.
- *
- * Returns a new fs stream.
- **/
-CamelStream *
-camel_stream_fs_new_with_fd (int fd)
-{
- CamelStreamFs *stream_fs;
- off_t offset;
-
- if (fd == -1)
- return NULL;
-
- stream_fs = CAMEL_STREAM_FS (camel_object_new (camel_stream_fs_get_type ()));
- stream_fs->fd = fd;
- offset = lseek (fd, 0, SEEK_CUR);
- if (offset == -1)
- offset = 0;
- CAMEL_SEEKABLE_STREAM (stream_fs)->position = offset;
-
- return CAMEL_STREAM (stream_fs);
-}
-
-/**
- * camel_stream_fs_new_with_fd_and_bounds:
- * @fd: a file descriptor
- * @start: the first valid position in the file
- * @end: the first invalid position in the file, or CAMEL_STREAM_UNBOUND
- *
- * Returns a stream associated with the given file descriptor and bounds.
- * When the stream is destroyed, the file descriptor will be closed.
- *
- * Return value: the stream
- **/
-CamelStream *
-camel_stream_fs_new_with_fd_and_bounds (int fd, off_t start, off_t end)
-{
- CamelStream *stream;
-
- stream = camel_stream_fs_new_with_fd (fd);
- camel_seekable_stream_set_bounds (CAMEL_SEEKABLE_STREAM (stream), start, end);
-
- return stream;
-}
-
-/**
- * camel_stream_fs_new_with_name:
- * @name: a local filename
- * @flags: flags as in open(2)
- * @mode: a file mode
- *
- * Creates a new CamelStream corresponding to the named file, flags,
- * and mode.
- *
- * Return value: the stream, or #NULL on error.
- **/
-CamelStream *
-camel_stream_fs_new_with_name (const char *name, int flags, mode_t mode)
-{
- int fd;
-
- fd = open (name, flags, mode);
- if (fd == -1) {
- return NULL;
- }
-
- return camel_stream_fs_new_with_fd (fd);
-}
-
-/**
- * camel_stream_fs_new_with_name_and_bounds:
- * @name: a local filename
- * @flags: flags as in open(2)
- * @mode: a file mode
- * @start: the first valid position in the file
- * @end: the first invalid position in the file, or CAMEL_STREAM_UNBOUND
- *
- * Creates a new CamelStream corresponding to the given arguments.
- *
- * Return value: the stream, or NULL on error.
- **/
-CamelStream *
-camel_stream_fs_new_with_name_and_bounds (const char *name, int flags,
- mode_t mode, off_t start, off_t end)
-{
- CamelStream *stream;
-
- stream = camel_stream_fs_new_with_name (name, flags, mode);
- if (stream == NULL)
- return NULL;
-
- camel_seekable_stream_set_bounds (CAMEL_SEEKABLE_STREAM (stream),
- start, end);
-
- return stream;
-}
-
-
-static ssize_t
-stream_read (CamelStream *stream, char *buffer, size_t n)
-{
- CamelStreamFs *stream_fs = CAMEL_STREAM_FS (stream);
- CamelSeekableStream *seekable = CAMEL_SEEKABLE_STREAM (stream);
- ssize_t nread;
-
- if (seekable->bound_end != CAMEL_STREAM_UNBOUND)
- n = MIN (seekable->bound_end - seekable->position, n);
-
- if ((nread = camel_read (stream_fs->fd, buffer, n)) > 0)
- seekable->position += nread;
- else if (nread == 0)
- stream->eos = TRUE;
-
- return nread;
-}
-
-static ssize_t
-stream_write (CamelStream *stream, const char *buffer, size_t n)
-{
- CamelStreamFs *stream_fs = CAMEL_STREAM_FS (stream);
- CamelSeekableStream *seekable = CAMEL_SEEKABLE_STREAM (stream);
- ssize_t nwritten;
-
- if (seekable->bound_end != CAMEL_STREAM_UNBOUND)
- n = MIN (seekable->bound_end - seekable->position, n);
-
- if ((nwritten = camel_write (stream_fs->fd, buffer, n)) > 0)
- seekable->position += nwritten;
-
- return nwritten;
-}
-
-static int
-stream_flush (CamelStream *stream)
-{
- return fsync(((CamelStreamFs *)stream)->fd);
-}
-
-static int
-stream_close (CamelStream *stream)
-{
- if (close (((CamelStreamFs *)stream)->fd) == -1)
- return -1;
-
- ((CamelStreamFs *)stream)->fd = -1;
- return 0;
-}
-
-static off_t
-stream_seek (CamelSeekableStream *stream, off_t offset, CamelStreamSeekPolicy policy)
-{
- CamelStreamFs *stream_fs = CAMEL_STREAM_FS (stream);
- off_t real = 0;
-
- switch (policy) {
- case CAMEL_STREAM_SET:
- real = offset;
- break;
- case CAMEL_STREAM_CUR:
- real = stream->position + offset;
- break;
- case CAMEL_STREAM_END:
- if (stream->bound_end == CAMEL_STREAM_UNBOUND) {
- real = lseek(stream_fs->fd, offset, SEEK_END);
- if (real != -1) {
- if (real<stream->bound_start)
- real = stream->bound_start;
- stream->position = real;
- }
- return real;
- }
- real = stream->bound_end + offset;
- break;
- }
-
- if (stream->bound_end != CAMEL_STREAM_UNBOUND)
- real = MIN (real, stream->bound_end);
- real = MAX (real, stream->bound_start);
-
- real = lseek(stream_fs->fd, real, SEEK_SET);
- if (real == -1)
- return -1;
-
- if (real != stream->position && ((CamelStream *)stream)->eos)
- ((CamelStream *)stream)->eos = FALSE;
-
- stream->position = real;
-
- return real;
-}
diff --git a/camel/camel-stream-fs.h b/camel/camel-stream-fs.h
deleted file mode 100644
index 7db13ac244..0000000000
--- a/camel/camel-stream-fs.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-stream-fs.h :stream based on unix filesystem */
-
-/*
- * Author:
- * Bertrand Guiheneuf <bertrand@helixcode.com>
- *
- * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifndef CAMEL_STREAM_FS_H
-#define CAMEL_STREAM_FS_H 1
-
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-/* for open flags */
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-#include <camel/camel-seekable-stream.h>
-
-#define CAMEL_STREAM_FS_TYPE (camel_stream_fs_get_type ())
-#define CAMEL_STREAM_FS(obj) (CAMEL_CHECK_CAST((obj), CAMEL_STREAM_FS_TYPE, CamelStreamFs))
-#define CAMEL_STREAM_FS_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_STREAM_FS_TYPE, CamelStreamFsClass))
-#define CAMEL_IS_STREAM_FS(o) (CAMEL_CHECK_TYPE((o), CAMEL_STREAM_FS_TYPE))
-
-struct _CamelStreamFs
-{
- CamelSeekableStream parent_object;
-
- int fd; /* file descriptor on the underlying file */
-};
-
-typedef struct {
- CamelSeekableStreamClass parent_class;
-
-} CamelStreamFsClass;
-
-/* Standard Camel function */
-CamelType camel_stream_fs_get_type (void);
-
-/* public methods */
-CamelStream * camel_stream_fs_new_with_name (const char *name, int flags, mode_t mode);
-CamelStream * camel_stream_fs_new_with_name_and_bounds (const char *name, int flags, mode_t mode,
- off_t start, off_t end);
-
-CamelStream * camel_stream_fs_new_with_fd (int fd);
-CamelStream * camel_stream_fs_new_with_fd_and_bounds (int fd, off_t start, off_t end);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_STREAM_FS_H */
diff --git a/camel/camel-stream-mem.c b/camel/camel-stream-mem.c
deleted file mode 100644
index 7b93b7864b..0000000000
--- a/camel/camel-stream-mem.c
+++ /dev/null
@@ -1,248 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-stream-mem.c: memory buffer based stream */
-
-/*
- * Authors: Bertrand Guiheneuf <bertrand@helixcode.com>
- * Michael Zucchi <notzed@ximian.com>
- *
- * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <errno.h>
-
-#include "camel-stream-mem.h"
-
-static CamelSeekableStreamClass *parent_class = NULL;
-
-/* Returns the class for a CamelStreamMem */
-#define CSM_CLASS(so) CAMEL_STREAM_MEM_CLASS(CAMEL_OBJECT_GET_CLASS(so))
-
-static ssize_t stream_read (CamelStream *stream, char *buffer, size_t n);
-static ssize_t stream_write (CamelStream *stream, const char *buffer, size_t n);
-static gboolean stream_eos (CamelStream *stream);
-static off_t stream_seek (CamelSeekableStream *stream, off_t offset,
- CamelStreamSeekPolicy policy);
-
-static void camel_stream_mem_finalize (CamelObject *object);
-
-static void
-camel_stream_mem_class_init (CamelStreamMemClass *camel_stream_mem_class)
-{
- CamelSeekableStreamClass *camel_seekable_stream_class =
- CAMEL_SEEKABLE_STREAM_CLASS (camel_stream_mem_class);
- CamelStreamClass *camel_stream_class =
- CAMEL_STREAM_CLASS (camel_stream_mem_class);
-
- parent_class = CAMEL_SEEKABLE_STREAM_CLASS( camel_type_get_global_classfuncs( CAMEL_SEEKABLE_STREAM_TYPE ) );
-
- /* virtual method overload */
- camel_stream_class->read = stream_read;
- camel_stream_class->write = stream_write;
- camel_stream_class->eos = stream_eos;
-
- camel_seekable_stream_class->seek = stream_seek;
-}
-
-static void
-camel_stream_mem_init (CamelObject *object)
-{
- CamelStreamMem *stream_mem = CAMEL_STREAM_MEM (object);
-
- stream_mem->owner = FALSE;
- stream_mem->buffer = 0;
-}
-
-CamelType
-camel_stream_mem_get_type (void)
-{
- static CamelType camel_stream_mem_type = CAMEL_INVALID_TYPE;
-
- if (camel_stream_mem_type == CAMEL_INVALID_TYPE) {
- camel_stream_mem_type = camel_type_register( CAMEL_SEEKABLE_STREAM_TYPE,
- "CamelStreamMem",
- sizeof( CamelStreamMem ),
- sizeof( CamelStreamMemClass ),
- (CamelObjectClassInitFunc) camel_stream_mem_class_init,
- NULL,
- (CamelObjectInitFunc) camel_stream_mem_init,
- (CamelObjectFinalizeFunc) camel_stream_mem_finalize );
- }
-
- return camel_stream_mem_type;
-}
-
-
-CamelStream *
-camel_stream_mem_new (void)
-{
- return camel_stream_mem_new_with_byte_array (g_byte_array_new ());
-}
-
-CamelStream *
-camel_stream_mem_new_with_buffer (const char *buffer, size_t len)
-{
- GByteArray *ba;
-
- ba = g_byte_array_new ();
- g_byte_array_append (ba, (const guint8 *)buffer, len);
- return camel_stream_mem_new_with_byte_array (ba);
-}
-
-CamelStream *
-camel_stream_mem_new_with_byte_array (GByteArray *byte_array)
-{
- CamelStreamMem *stream_mem;
-
- stream_mem = CAMEL_STREAM_MEM( camel_object_new (CAMEL_STREAM_MEM_TYPE) );
- stream_mem->buffer = byte_array;
- stream_mem->owner = TRUE;
-
- return CAMEL_STREAM (stream_mem);
-}
-
-/* note: with these functions the caller is the 'owner' of the buffer */
-void camel_stream_mem_set_byte_array (CamelStreamMem *s, GByteArray *buffer)
-{
- if (s->buffer && s->owner)
- g_byte_array_free(s->buffer, TRUE);
- s->owner = FALSE;
- s->buffer = buffer;
-}
-
-void camel_stream_mem_set_buffer (CamelStreamMem *s, const char *buffer, size_t len)
-{
- GByteArray *ba;
-
- ba = g_byte_array_new ();
- g_byte_array_append(ba, (const guint8 *)buffer, len);
- camel_stream_mem_set_byte_array(s, ba);
- s->owner = TRUE;
-}
-
-static void
-camel_stream_mem_finalize (CamelObject *object)
-{
- CamelStreamMem *stream_mem = CAMEL_STREAM_MEM (object);
-
- if (stream_mem->buffer && stream_mem->owner)
- g_byte_array_free (stream_mem->buffer, TRUE);
-
- /* Will be called automagically in the Camel Type System!
- * Wheeee!
- * G_TK_OBJECT_CLASS (parent_class)->finalize (object);
- */
-}
-
-static ssize_t
-stream_read (CamelStream *stream, char *buffer, size_t n)
-{
- CamelStreamMem *camel_stream_mem = CAMEL_STREAM_MEM (stream);
- CamelSeekableStream *seekable = CAMEL_SEEKABLE_STREAM (stream);
- ssize_t nread;
-
- if (seekable->bound_end != CAMEL_STREAM_UNBOUND)
- n = MIN(seekable->bound_end - seekable->position, n);
-
- nread = MIN (n, camel_stream_mem->buffer->len - seekable->position);
- if (nread > 0) {
- memcpy (buffer, camel_stream_mem->buffer->data + seekable->position, nread);
- seekable->position += nread;
- } else
- nread = 0;
-
- return nread;
-}
-
-static ssize_t
-stream_write (CamelStream *stream, const char *buffer, size_t n)
-{
- CamelStreamMem *stream_mem = CAMEL_STREAM_MEM (stream);
- CamelSeekableStream *seekable = CAMEL_SEEKABLE_STREAM (stream);
- ssize_t nwrite = n;
-
- if (seekable->bound_end != CAMEL_STREAM_UNBOUND)
- nwrite = MIN(seekable->bound_end - seekable->position, n);
-
- /* FIXME: we shouldn't use g_byte_arrays or g_malloc perhaps? */
- if (seekable->position == stream_mem->buffer->len) {
- g_byte_array_append(stream_mem->buffer, (const guint8 *)buffer, nwrite);
- } else {
- g_byte_array_set_size(stream_mem->buffer, nwrite + stream_mem->buffer->len);
- memcpy(stream_mem->buffer->data + seekable->position, buffer, nwrite);
- }
- seekable->position += nwrite;
-
- return nwrite;
-}
-
-static gboolean
-stream_eos (CamelStream *stream)
-{
- CamelStreamMem *stream_mem = CAMEL_STREAM_MEM (stream);
- CamelSeekableStream *seekable_stream = CAMEL_SEEKABLE_STREAM (stream);
-
- return stream_mem->buffer->len <= seekable_stream->position;
-}
-
-static off_t
-stream_seek (CamelSeekableStream *stream, off_t offset,
- CamelStreamSeekPolicy policy)
-{
- off_t position;
- CamelStreamMem *stream_mem = CAMEL_STREAM_MEM (stream);
-
- switch (policy) {
- case CAMEL_STREAM_SET:
- position = offset;
- break;
- case CAMEL_STREAM_CUR:
- position = stream->position + offset;
- break;
- case CAMEL_STREAM_END:
- position = (stream_mem->buffer)->len + offset;
- break;
- default:
- position = offset;
- break;
- }
-
- if (stream->bound_end != CAMEL_STREAM_UNBOUND)
- position = MIN (position, stream->bound_end);
- if (stream->bound_start != CAMEL_STREAM_UNBOUND)
- position = MAX (position, 0);
- else
- position = MAX (position, stream->bound_start);
-
- if (position > stream_mem->buffer->len) {
- int oldlen = stream_mem->buffer->len;
- g_byte_array_set_size (stream_mem->buffer, position);
- memset (stream_mem->buffer->data + oldlen, 0,
- position - oldlen);
- }
-
- stream->position = position;
-
- return position;
-}
diff --git a/camel/camel-stream-mem.h b/camel/camel-stream-mem.h
deleted file mode 100644
index af51c36ff7..0000000000
--- a/camel/camel-stream-mem.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-stream-mem.h: stream based on memory buffer */
-
-/*
- * Authors: Bertrand Guiheneuf <bertrand@helixcode.com>
- * Michael Zucchi <notzed@ximian.com>
- *
- * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifndef CAMEL_STREAM_MEM_H
-#define CAMEL_STREAM_MEM_H 1
-
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include <sys/types.h>
-#include <camel/camel-seekable-stream.h>
-
-#define CAMEL_STREAM_MEM_TYPE (camel_stream_mem_get_type ())
-#define CAMEL_STREAM_MEM(obj) (CAMEL_CHECK_CAST((obj), CAMEL_STREAM_MEM_TYPE, CamelStreamMem))
-#define CAMEL_STREAM_MEM_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_STREAM_MEM_TYPE, CamelStreamMemClass))
-#define CAMEL_IS_STREAM_MEM(o) (CAMEL_CHECK_TYPE((o), CAMEL_STREAM_MEM_TYPE))
-
-typedef struct _CamelStreamMemClass CamelStreamMemClass;
-
-struct _CamelStreamMem {
- CamelSeekableStream parent_object;
-
- gboolean owner; /* do we own the buffer? */
- GByteArray *buffer;
-};
-
-struct _CamelStreamMemClass {
- CamelSeekableStreamClass parent_class;
-
- /* Virtual methods */
-};
-
-/* Standard Camel function */
-CamelType camel_stream_mem_get_type (void);
-
-/* public methods */
-CamelStream *camel_stream_mem_new(void);
-CamelStream *camel_stream_mem_new_with_byte_array(GByteArray *buffer);
-CamelStream *camel_stream_mem_new_with_buffer(const char *buffer, size_t len);
-
-/* these are really only here for implementing classes */
-void camel_stream_mem_set_byte_array(CamelStreamMem *, GByteArray *buffer);
-void camel_stream_mem_set_buffer(CamelStreamMem *, const char *buffer, size_t len);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_STREAM_MEM_H */
diff --git a/camel/camel-stream-null.c b/camel/camel-stream-null.c
deleted file mode 100644
index 3c0fdee47b..0000000000
--- a/camel/camel-stream-null.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; fill-column: 160 -*- */
-/* camel-stream.c : abstract class for a stream */
-
-/*
- * Author:
- * Michael Zucchi <notzed@ximian.com>
- *
- * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "camel-stream-null.h"
-
-static CamelObjectClass *parent_class = NULL;
-
-/* Returns the class for a CamelStream */
-#define CS_CLASS(so) CAMEL_STREAM_NULL_CLASS(CAMEL_OBJECT_GET_CLASS(so))
-
-/* dummy implementations, for a NULL stream */
-static ssize_t stream_read (CamelStream *stream, char *buffer, size_t n) { return 0; }
-static ssize_t stream_write (CamelStream *stream, const char *buffer, size_t n) { ((CamelStreamNull *)stream)->written += n; return n; }
-static int stream_close (CamelStream *stream) { return 0; }
-static int stream_flush (CamelStream *stream) { return 0; }
-static gboolean stream_eos (CamelStream *stream) { return TRUE; }
-static int stream_reset (CamelStream *stream) { ((CamelStreamNull *)stream)->written = 0; return 0; }
-
-static void
-camel_stream_null_class_init (CamelStreamClass *camel_stream_null_class)
-{
- CamelStreamClass *camel_stream_class = (CamelStreamClass *)camel_stream_null_class;
-
- parent_class = camel_type_get_global_classfuncs( CAMEL_OBJECT_TYPE );
-
- /* virtual method definition */
- camel_stream_class->read = stream_read;
- camel_stream_class->write = stream_write;
- camel_stream_class->close = stream_close;
- camel_stream_class->flush = stream_flush;
- camel_stream_class->eos = stream_eos;
- camel_stream_class->reset = stream_reset;
-}
-
-CamelType
-camel_stream_null_get_type (void)
-{
- static CamelType camel_stream_null_type = CAMEL_INVALID_TYPE;
-
- if (camel_stream_null_type == CAMEL_INVALID_TYPE) {
- camel_stream_null_type = camel_type_register( camel_stream_get_type(),
- "CamelStreamNull",
- sizeof( CamelStreamNull ),
- sizeof( CamelStreamNullClass ),
- (CamelObjectClassInitFunc) camel_stream_null_class_init,
- NULL,
- NULL,
- NULL );
- }
-
- return camel_stream_null_type;
-}
-
-/**
- * camel_stream_null_new:
- *
- * Returns a NULL stream. A null stream is always at eof, and
- * always returns success for all reads and writes.
- *
- * Return value: the stream
- **/
-CamelStream *
-camel_stream_null_new(void)
-{
- return (CamelStream *)camel_object_new(camel_stream_null_get_type ());
-}
diff --git a/camel/camel-stream-null.h b/camel/camel-stream-null.h
deleted file mode 100644
index be11da7741..0000000000
--- a/camel/camel-stream-null.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-
-#ifndef _CAMEL_STREAM_NULL_H
-#define _CAMEL_STREAM_NULL_H
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <camel/camel-stream.h>
-
-#define CAMEL_STREAM_NULL(obj) CAMEL_CHECK_CAST (obj, camel_stream_null_get_type (), CamelStreamNull)
-#define CAMEL_STREAM_NULL_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_stream_null_get_type (), CamelStreamNullClass)
-#define CAMEL_IS_STREAM_NULL(obj) CAMEL_CHECK_TYPE (obj, camel_stream_null_get_type ())
-
-typedef struct _CamelStreamNullClass CamelStreamNullClass;
-
-struct _CamelStreamNull {
- CamelStream parent;
-
- size_t written;
-};
-
-struct _CamelStreamNullClass {
- CamelStreamClass parent_class;
-};
-
-CamelType camel_stream_null_get_type (void);
-
-CamelStream *camel_stream_null_new (void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* ! _CAMEL_STREAM_NULL_H */
diff --git a/camel/camel-stream-process.c b/camel/camel-stream-process.c
deleted file mode 100644
index 6a48ae40d0..0000000000
--- a/camel/camel-stream-process.c
+++ /dev/null
@@ -1,273 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; fill-column: 160 -*- */
-/* camel-stream-process.c : stream over piped process */
-
-/*
- * Copyright (C) 2003 Ximian Inc.
- *
- * Authors: David Woodhouse <dwmw2@infradead.org>,
- * Jeffrey Stedfast <fejj@ximian.com>
- *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/ioctl.h>
-#include <sys/wait.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <errno.h>
-#include <limits.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "camel-stream-process.h"
-#include "camel-file-utils.h"
-
-extern int camel_verbose_debug;
-
-static CamelObjectClass *parent_class = NULL;
-
-/* Returns the class for a CamelStream */
-#define CS_CLASS(so) CAMEL_STREAM_PROCESS_CLASS(CAMEL_OBJECT_GET_CLASS(so))
-
-/* dummy implementations, for a PROCESS stream */
-static ssize_t stream_read (CamelStream *stream, char *buffer, size_t n);
-static ssize_t stream_write (CamelStream *stream, const char *buffer, size_t n);
-static int stream_close (CamelStream *stream);
-static int stream_flush (CamelStream *stream);
-
-static void
-camel_stream_process_finalise (CamelObject *object)
-{
- /* Ensure we clean up after ourselves -- kill
- the child process and reap it. */
- stream_close (CAMEL_STREAM (object));
-}
-
-static void
-camel_stream_process_class_init (CamelStreamProcessClass *camel_stream_process_class)
-{
- CamelStreamClass *camel_stream_class = (CamelStreamClass *) camel_stream_process_class;
-
- parent_class = camel_type_get_global_classfuncs (CAMEL_OBJECT_TYPE);
-
- /* virtual method definition */
- camel_stream_class->read = stream_read;
- camel_stream_class->write = stream_write;
- camel_stream_class->close = stream_close;
- camel_stream_class->flush = stream_flush;
-}
-
-static void
-camel_stream_process_init (gpointer object, gpointer klass)
-{
- CamelStreamProcess *stream = CAMEL_STREAM_PROCESS (object);
-
- stream->sockfd = -1;
- stream->childpid = 0;
-}
-
-
-CamelType
-camel_stream_process_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_stream_get_type (),
- "CamelStreamProcess",
- sizeof (CamelStreamProcess),
- sizeof (CamelStreamProcessClass),
- (CamelObjectClassInitFunc) camel_stream_process_class_init,
- NULL,
- (CamelObjectInitFunc) camel_stream_process_init,
- (CamelObjectFinalizeFunc) camel_stream_process_finalise);
- }
-
- return type;
-}
-
-/**
- * camel_stream_process_new:
- *
- * Returns a PROCESS stream.
- *
- * Return value: the stream
- **/
-CamelStream *
-camel_stream_process_new (void)
-{
- return (CamelStream *) camel_object_new (camel_stream_process_get_type ());
-}
-
-
-static ssize_t
-stream_read (CamelStream *stream, char *buffer, size_t n)
-{
- CamelStreamProcess *stream_process = CAMEL_STREAM_PROCESS (stream);
-
- return camel_read (stream_process->sockfd, buffer, n);
-}
-
-static ssize_t
-stream_write (CamelStream *stream, const char *buffer, size_t n)
-{
- CamelStreamProcess *stream_process = CAMEL_STREAM_PROCESS (stream);
-
- return camel_write (stream_process->sockfd, buffer, n);
-}
-
-static int
-stream_flush (CamelStream *stream)
-{
- return 0;
-}
-
-static int
-stream_close (CamelStream *object)
-{
- CamelStreamProcess *stream = CAMEL_STREAM_PROCESS (object);
-
- if (camel_verbose_debug)
- fprintf (stderr, "Process stream close. sockfd %d, childpid %d\n",
- stream->sockfd, stream->childpid);
-
- if (stream->sockfd != -1) {
- close (stream->sockfd);
- stream->sockfd = -1;
- }
-
- if (stream->childpid) {
- int ret, i;
- for (i = 0; i < 4; i++) {
- ret = waitpid (stream->childpid, NULL, WNOHANG);
- if (camel_verbose_debug)
- fprintf (stderr, "waitpid() for pid %d returned %d (errno %d)\n",
- stream->childpid, ret, ret == -1 ? errno : 0);
- if (ret == stream->childpid || errno == ECHILD)
- break;
- switch (i) {
- case 0:
- if (camel_verbose_debug)
- fprintf (stderr, "Sending SIGTERM to pid %d\n",
- stream->childpid);
- kill (stream->childpid, SIGTERM);
- break;
- case 2:
- if (camel_verbose_debug)
- fprintf (stderr, "Sending SIGKILL to pid %d\n",
- stream->childpid);
- kill (stream->childpid, SIGKILL);
- break;
- case 1:
- case 3:
- sleep (1);
- break;
- }
- }
-
- stream->childpid = 0;
- }
-
- return 0;
-}
-
-static void
-do_exec_command (int fd, const char *command, char **env)
-{
- int i, maxopen;
-
- /* Not a lot we can do if there's an error other than bail. */
- if (dup2 (fd, 0) == -1)
- exit (1);
- if (dup2 (fd, 1) == -1)
- exit (1);
-
- /* What to do with stderr? Possibly put it through a separate pipe
- and bring up a dialog box with its output if anything does get
- spewed to it? It'd help the user understand what was going wrong
- with their command, but it's hard to do cleanly. For now we just
- leave it as it is. Perhaps we should close it and reopen /dev/null? */
-
- maxopen = sysconf (_SC_OPEN_MAX);
- for (i = 3; i < maxopen; i++)
- fcntl (i, F_SETFD, FD_CLOEXEC);
-
- setsid ();
-#ifdef TIOCNOTTY
- /* Detach from the controlling tty if we have one. Otherwise,
- SSH might do something stupid like trying to use it instead
- of running $SSH_ASKPASS. Doh. */
- if ((fd = open ("/dev/tty", O_RDONLY)) != -1) {
- ioctl (fd, TIOCNOTTY, NULL);
- close (fd);
- }
-#endif /* TIOCNOTTY */
-
- /* Set up child's environment. We _add_ to it, don't use execle,
- because otherwise we'd destroy stuff like SSH_AUTH_SOCK etc. */
- for ( ; env && *env; env++) {
- char *eq = strchr (*env, '=');
-
- if (!eq) {
- unsetenv (*env);
- continue;
- }
-
- *eq++ = '\0';
-
- setenv (*env, eq, 1);
- }
-
- execl ("/bin/sh", "/bin/sh", "-c", command, NULL);
-
- if (camel_verbose_debug)
- fprintf (stderr, "exec failed %d\n", errno);
-
- exit (1);
-}
-
-int
-camel_stream_process_connect (CamelStreamProcess *stream, const char *command, const char **env)
-{
- int sockfds[2];
-
- if (stream->sockfd != -1 || stream->childpid)
- stream_close (CAMEL_STREAM (stream));
-
- if (socketpair (AF_UNIX, SOCK_STREAM, 0, sockfds))
- return -1;
-
- stream->childpid = fork ();
- if (!stream->childpid) {
- do_exec_command (sockfds[1], command, (char **)env);
- } else if (stream->childpid == -1) {
- close (sockfds[0]);
- close (sockfds[1]);
- stream->sockfd = -1;
- return -1;
- }
-
- close (sockfds[1]);
- stream->sockfd = sockfds[0];
-
- return 0;
-}
diff --git a/camel/camel-stream-process.h b/camel/camel-stream-process.h
deleted file mode 100644
index 15a68e9a60..0000000000
--- a/camel/camel-stream-process.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2003 Ximian Inc.
- *
- * Authors: David Woodhouse <dwmw2@infradead.org>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-
-#ifndef _CAMEL_STREAM_NULL_H
-#define _CAMEL_STREAM_NULL_H
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <camel/camel-stream.h>
-
-#define CAMEL_STREAM_PROCESS(obj) CAMEL_CHECK_CAST (obj, camel_stream_process_get_type (), CamelStreamProcess)
-#define CAMEL_STREAM_PROCESS_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_stream_process_get_type (), CamelStreamProcessClass)
-#define CAMEL_IS_STREAM_PROCESS(obj) CAMEL_CHECK_TYPE (obj, camel_stream_process_get_type ())
-
-typedef struct _CamelStreamProcessClass CamelStreamProcessClass;
-typedef struct _CamelStreamProcess CamelStreamProcess;
-
-struct _CamelStreamProcess {
- CamelStream parent;
-
- int sockfd;
- pid_t childpid;
-};
-
-struct _CamelStreamProcessClass {
- CamelStreamClass parent_class;
-};
-
-CamelType camel_stream_process_get_type (void);
-CamelStream *camel_stream_process_new (void);
-int camel_stream_process_connect(CamelStreamProcess *, const char *, const char **);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* ! _CAMEL_STREAM_PROCESS_H */
diff --git a/camel/camel-stream.c b/camel/camel-stream.c
deleted file mode 100644
index bcc4640697..0000000000
--- a/camel/camel-stream.c
+++ /dev/null
@@ -1,281 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-stream.c : abstract class for a stream */
-
-/*
- * Author:
- * Bertrand Guiheneuf <bertrand@helixcode.com>
- *
- * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-#include "camel-stream.h"
-
-static CamelObjectClass *parent_class = NULL;
-
-/* Returns the class for a CamelStream */
-#define CS_CLASS(so) CAMEL_STREAM_CLASS(CAMEL_OBJECT_GET_CLASS(so))
-
-/* default implementations, do very little */
-static ssize_t stream_read (CamelStream *stream, char *buffer, size_t n) { return 0; }
-static ssize_t stream_write (CamelStream *stream, const char *buffer, size_t n) { return n; }
-static int stream_close (CamelStream *stream) { return 0; }
-static int stream_flush (CamelStream *stream) { return 0; }
-static gboolean stream_eos (CamelStream *stream) { return stream->eos; }
-static int stream_reset (CamelStream *stream) { return 0; }
-
-static void
-camel_stream_class_init (CamelStreamClass *camel_stream_class)
-{
- parent_class = camel_type_get_global_classfuncs( CAMEL_OBJECT_TYPE );
-
- /* virtual method definition */
- camel_stream_class->read = stream_read;
- camel_stream_class->write = stream_write;
- camel_stream_class->close = stream_close;
- camel_stream_class->flush = stream_flush;
- camel_stream_class->eos = stream_eos;
- camel_stream_class->reset = stream_reset;
-}
-
-CamelType
-camel_stream_get_type (void)
-{
- static CamelType camel_stream_type = CAMEL_INVALID_TYPE;
-
- if (camel_stream_type == CAMEL_INVALID_TYPE) {
- camel_stream_type = camel_type_register( CAMEL_OBJECT_TYPE,
- "CamelStream",
- sizeof( CamelStream ),
- sizeof( CamelStreamClass ),
- (CamelObjectClassInitFunc) camel_stream_class_init,
- NULL,
- NULL,
- NULL );
- }
-
- return camel_stream_type;
-}
-
-
-/**
- * camel_stream_read:
- * @stream: a CamelStream.
- * @buffer: output buffer
- * @n: max number of bytes to read.
- *
- * Attempts to read up to @len bytes from @stream into @buf.
- *
- * Returns the number of bytes actually read, or -1 on error and set
- * errno.
- **/
-ssize_t
-camel_stream_read (CamelStream *stream, char *buffer, size_t n)
-{
- g_return_val_if_fail (CAMEL_IS_STREAM (stream), -1);
- g_return_val_if_fail (n == 0 || buffer, -1);
-
- return CS_CLASS (stream)->read (stream, buffer, n);
-}
-
-
-/**
- * camel_stream_write:
- * @stream: a CamelStream object.
- * @buffer: buffer to write.
- * @n: number of bytes to write
- *
- * Attempts to write up to @n bytes of @buffer into @stream.
- *
- * Returns the number of bytes written to the stream, or -1 on error
- * along with setting errno.
- **/
-ssize_t
-camel_stream_write (CamelStream *stream, const char *buffer, size_t n)
-{
- g_return_val_if_fail (CAMEL_IS_STREAM (stream), -1);
- g_return_val_if_fail (n == 0 || buffer, -1);
-
- return CS_CLASS (stream)->write (stream, buffer, n);
-}
-
-
-/**
- * camel_stream_flush:
- * @stream: stream
- *
- * Flushes any buffered data to the stream's backing store. Only
- * meaningful for writable streams.
- *
- * Returns 0 on success or -1 on fail along with setting errno.
- **/
-int
-camel_stream_flush (CamelStream *stream)
-{
- g_return_val_if_fail (CAMEL_IS_STREAM (stream), -1);
-
- return CS_CLASS (stream)->flush (stream);
-}
-
-
-/**
- * camel_stream_close:
- * @stream:
- *
- * Closes the stream.
- *
- * Returns 0 on success or -1 on error.
- **/
-int
-camel_stream_close (CamelStream *stream)
-{
- g_return_val_if_fail (CAMEL_IS_STREAM (stream), -1);
-
- return CS_CLASS (stream)->close (stream);
-}
-
-
-/**
- * camel_stream_eos:
- * @stream: a CamelStream object
- *
- * Tests if there are bytes left to read on the @stream object.
- *
- * Returns %TRUE on EOS or %FALSE otherwise.
- **/
-gboolean
-camel_stream_eos (CamelStream *stream)
-{
- g_return_val_if_fail (CAMEL_IS_STREAM (stream), TRUE);
-
- return CS_CLASS (stream)->eos (stream);
-}
-
-
-/**
- * camel_stream_reset:
- * @stream: the stream object
- *
- * Resets the stream. That is, put it in a state where it can be read
- * from the beginning again. Not all streams in Camel are seekable,
- * but they must all be resettable.
- *
- * Returns 0 on success or -1 on error along with setting errno.
- **/
-int
-camel_stream_reset (CamelStream *stream)
-{
- g_return_val_if_fail (CAMEL_IS_STREAM (stream), -1);
-
- return CS_CLASS (stream)->reset (stream);
-}
-
-/***************** Utility functions ********************/
-
-/**
- * camel_stream_write_string:
- * @stream: a stream object
- * @string: a string
- *
- * Writes the string to the stream.
- *
- * Returns the number of characters written or -1 on error.
- **/
-ssize_t
-camel_stream_write_string (CamelStream *stream, const char *string)
-{
- return camel_stream_write (stream, string, strlen (string));
-}
-
-
-/**
- * camel_stream_printf:
- * @stream: a stream object
- * @fmt: a printf-style format string
- *
- * Write formatted output to a stream.
- *
- * Returns the number of characters written or -1 on error.
- **/
-ssize_t
-camel_stream_printf (CamelStream *stream, const char *fmt, ... )
-{
- va_list args;
- char *string;
- ssize_t ret;
-
- g_return_val_if_fail (CAMEL_IS_STREAM (stream), -1);
-
- va_start (args, fmt);
- string = g_strdup_vprintf (fmt, args);
- va_end (args);
-
- if (!string)
- return -1;
-
- ret = camel_stream_write (stream, string, strlen (string));
- g_free (string);
- return ret;
-}
-
-
-/**
- * camel_stream_write_to_stream:
- * @stream: Source CamelStream.
- * @output_stream: Destination CamelStream.
- *
- * Write all of a stream (until eos) into another stream, in a
- * blocking fashion.
- *
- * Returns -1 on error, or the number of bytes succesfully
- * copied across streams.
- **/
-ssize_t
-camel_stream_write_to_stream (CamelStream *stream, CamelStream *output_stream)
-{
- char tmp_buf[4096];
- ssize_t total = 0;
- ssize_t nb_read;
- ssize_t nb_written;
-
- g_return_val_if_fail (CAMEL_IS_STREAM (stream), -1);
- g_return_val_if_fail (CAMEL_IS_STREAM (output_stream), -1);
-
- while (!camel_stream_eos (stream)) {
- nb_read = camel_stream_read (stream, tmp_buf, sizeof (tmp_buf));
- if (nb_read < 0)
- return -1;
- else if (nb_read > 0) {
- nb_written = 0;
-
- while (nb_written < nb_read) {
- ssize_t len = camel_stream_write (output_stream, tmp_buf + nb_written,
- nb_read - nb_written);
- if (len < 0)
- return -1;
- nb_written += len;
- }
- total += nb_written;
- }
- }
- return total;
-}
diff --git a/camel/camel-stream.h b/camel/camel-stream.h
deleted file mode 100644
index f75e882a70..0000000000
--- a/camel/camel-stream.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; fill-column: 160 -*- */
-/* camel-stream.h : class for an abstract stream */
-
-/*
- * Author:
- * Bertrand Guiheneuf <bertrand@helixcode.com>
- *
- * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifndef CAMEL_STREAM_H
-#define CAMEL_STREAM_H 1
-
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include <stdarg.h>
-#include <unistd.h>
-#include <camel/camel-object.h>
-
-#define CAMEL_STREAM_TYPE (camel_stream_get_type ())
-#define CAMEL_STREAM(obj) (CAMEL_CHECK_CAST((obj), CAMEL_STREAM_TYPE, CamelStream))
-#define CAMEL_STREAM_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_STREAM_TYPE, CamelStreamClass))
-#define CAMEL_IS_STREAM(o) (CAMEL_CHECK_TYPE((o), CAMEL_STREAM_TYPE))
-
-struct _CamelStream
-{
- CamelObject parent_object;
-
- gboolean eos;
-};
-
-typedef struct {
- CamelObjectClass parent_class;
-
- /* Virtual methods */
-
- ssize_t (*read) (CamelStream *stream, char *buffer, size_t n);
- ssize_t (*write) (CamelStream *stream, const char *buffer, size_t n);
- int (*close) (CamelStream *stream);
- int (*flush) (CamelStream *stream);
- gboolean (*eos) (CamelStream *stream);
- int (*reset) (CamelStream *stream);
-
-} CamelStreamClass;
-
-/* Standard Camel function */
-CamelType camel_stream_get_type (void);
-
-/* public methods */
-ssize_t camel_stream_read (CamelStream *stream, char *buffer, size_t n);
-ssize_t camel_stream_write (CamelStream *stream, const char *buffer, size_t n);
-int camel_stream_flush (CamelStream *stream);
-int camel_stream_close (CamelStream *stream);
-gboolean camel_stream_eos (CamelStream *stream);
-int camel_stream_reset (CamelStream *stream);
-
-/* utility macros and funcs */
-ssize_t camel_stream_write_string (CamelStream *stream, const char *string);
-ssize_t camel_stream_printf (CamelStream *stream, const char *fmt, ... ) G_GNUC_PRINTF (2, 3);
-ssize_t camel_stream_vprintf (CamelStream *stream, const char *fmt, va_list ap);
-
-/* Write a whole stream to another stream, until eof or error on
- * either stream.
- */
-ssize_t camel_stream_write_to_stream (CamelStream *stream, CamelStream *output_stream);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_STREAM_H */
diff --git a/camel/camel-string-utils.c b/camel/camel-string-utils.c
deleted file mode 100644
index d9927d629a..0000000000
--- a/camel/camel-string-utils.c
+++ /dev/null
@@ -1,110 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2002 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-
-#include "camel-string-utils.h"
-
-
-int
-camel_strcase_equal (gconstpointer a, gconstpointer b)
-{
- return (g_ascii_strcasecmp ((const char *) a, (const char *) b) == 0);
-}
-
-guint
-camel_strcase_hash (gconstpointer v)
-{
- const char *p = (char *) v;
- guint h = 0, g;
-
- for ( ; *p != '\0'; p++) {
- h = (h << 4) + g_ascii_toupper (*p);
- if ((g = h & 0xf0000000)) {
- h = h ^ (g >> 24);
- h = h ^ g;
- }
- }
-
- return h;
-}
-
-
-static void
-free_string (gpointer string, gpointer user_data)
-{
- g_free (string);
-}
-
-void
-camel_string_list_free (GList *string_list)
-{
- if (string_list == NULL)
- return;
-
- g_list_foreach (string_list, free_string, NULL);
- g_list_free (string_list);
-}
-
-char *
-camel_strstrcase (const char *haystack, const char *needle)
-{
- /* find the needle in the haystack neglecting case */
- const char *ptr;
- guint len;
-
- g_return_val_if_fail (haystack != NULL, NULL);
- g_return_val_if_fail (needle != NULL, NULL);
-
- len = strlen (needle);
- if (len > strlen (haystack))
- return NULL;
-
- if (len == 0)
- return (char *) haystack;
-
- for (ptr = haystack; *(ptr + len - 1) != '\0'; ptr++)
- if (!strncasecmp (ptr, needle, len))
- return (char *) ptr;
-
- return NULL;
-}
-
-
-const char *
-camel_strdown (char *str)
-{
- register char *s = str;
-
- while (*s) {
- if (*s >= 'A' && *s <= 'Z')
- *s += 0x20;
- s++;
- }
-
- return str;
-}
diff --git a/camel/camel-string-utils.h b/camel/camel-string-utils.h
deleted file mode 100644
index 54cbad3fad..0000000000
--- a/camel/camel-string-utils.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2002 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifndef __CAMEL_STRING_UTILS_H__
-#define __CAMEL_STRING_UTILS_H__
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <glib.h>
-
-int camel_strcase_equal (gconstpointer a, gconstpointer b);
-guint camel_strcase_hash (gconstpointer v);
-
-void camel_string_list_free (GList *string_list);
-
-char *camel_strstrcase (const char *haystack, const char *needle);
-
-const char *camel_strdown (char *str);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __CAMEL_STRING_UTILS_H__ */
diff --git a/camel/camel-tcp-stream-openssl.c b/camel/camel-tcp-stream-openssl.c
deleted file mode 100644
index c7250a84d1..0000000000
--- a/camel/camel-tcp-stream-openssl.c
+++ /dev/null
@@ -1,954 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2001 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef HAVE_OPENSSL
-
-#include "camel-tcp-stream-ssl.h"
-
-#include <openssl/ssl.h>
-#include <openssl/x509.h>
-#include <openssl/err.h>
-#include <string.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include "camel-session.h"
-#include "camel-service.h"
-#include "camel-operation.h"
-#include "camel-certdb.h"
-
-#define d(x)
-
-#define TIMEOUT_USEC (10000)
-
-static CamelTcpStreamClass *parent_class = NULL;
-
-/* Returns the class for a CamelTcpStreamSSL */
-#define CTSR_CLASS(so) CAMEL_TCP_STREAM_SSL_CLASS (CAMEL_OBJECT_GET_CLASS (so))
-
-static ssize_t stream_read (CamelStream *stream, char *buffer, size_t n);
-static ssize_t stream_write (CamelStream *stream, const char *buffer, size_t n);
-static int stream_flush (CamelStream *stream);
-static int stream_close (CamelStream *stream);
-
-static int stream_connect (CamelTcpStream *stream, struct hostent *host, int port);
-static int stream_getsockopt (CamelTcpStream *stream, CamelSockOptData *data);
-static int stream_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data);
-static CamelTcpAddress *stream_get_local_address (CamelTcpStream *stream);
-static CamelTcpAddress *stream_get_remote_address (CamelTcpStream *stream);
-
-static SSL *open_ssl_connection (CamelService *service, int sockfd, CamelTcpStreamSSL *openssl);
-
-struct _CamelTcpStreamSSLPrivate {
- int sockfd;
- SSL *ssl;
-
- CamelService *service;
- char *expected_host;
- gboolean ssl_mode;
- guint32 flags;
-};
-
-static void
-camel_tcp_stream_ssl_class_init (CamelTcpStreamSSLClass *camel_tcp_stream_ssl_class)
-{
- CamelTcpStreamClass *camel_tcp_stream_class =
- CAMEL_TCP_STREAM_CLASS (camel_tcp_stream_ssl_class);
- CamelStreamClass *camel_stream_class =
- CAMEL_STREAM_CLASS (camel_tcp_stream_ssl_class);
-
- parent_class = CAMEL_TCP_STREAM_CLASS (camel_type_get_global_classfuncs (camel_tcp_stream_get_type ()));
-
- /* virtual method overload */
- camel_stream_class->read = stream_read;
- camel_stream_class->write = stream_write;
- camel_stream_class->flush = stream_flush;
- camel_stream_class->close = stream_close;
-
- camel_tcp_stream_class->connect = stream_connect;
- camel_tcp_stream_class->getsockopt = stream_getsockopt;
- camel_tcp_stream_class->setsockopt = stream_setsockopt;
- camel_tcp_stream_class->get_local_address = stream_get_local_address;
- camel_tcp_stream_class->get_remote_address = stream_get_remote_address;
-
- /* init OpenSSL stuff */
- SSLeay_add_ssl_algorithms ();
- SSL_load_error_strings ();
-}
-
-static void
-camel_tcp_stream_ssl_init (gpointer object, gpointer klass)
-{
- CamelTcpStreamSSL *stream = CAMEL_TCP_STREAM_SSL (object);
-
- stream->priv = g_new0 (struct _CamelTcpStreamSSLPrivate, 1);
- stream->priv->sockfd = -1;
-}
-
-static void
-camel_tcp_stream_ssl_finalize (CamelObject *object)
-{
- CamelTcpStreamSSL *stream = CAMEL_TCP_STREAM_SSL (object);
-
- if (stream->priv->ssl) {
- SSL_shutdown (stream->priv->ssl);
-
- if (stream->priv->ssl->ctx) {
- SSL_CTX_free (stream->priv->ssl->ctx);
- }
-
- SSL_free (stream->priv->ssl);
- }
-
- if (stream->priv->sockfd != -1)
- close (stream->priv->sockfd);
-
- g_free (stream->priv->expected_host);
-
- g_free (stream->priv);
-}
-
-
-CamelType
-camel_tcp_stream_ssl_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_tcp_stream_get_type (),
- "CamelTcpStreamSSL",
- sizeof (CamelTcpStreamSSL),
- sizeof (CamelTcpStreamSSLClass),
- (CamelObjectClassInitFunc) camel_tcp_stream_ssl_class_init,
- NULL,
- (CamelObjectInitFunc) camel_tcp_stream_ssl_init,
- (CamelObjectFinalizeFunc) camel_tcp_stream_ssl_finalize);
- }
-
- return type;
-}
-
-
-/**
- * camel_tcp_stream_ssl_new:
- * @service: camel service
- * @expected_host: host that the stream is expecting to connect with.
- * @flags: flags
- *
- * Since the SSL certificate authenticator may need to prompt the
- * user, a CamelService is needed. @expected_host is needed as a
- * protection against an MITM attack.
- *
- * Return value: a ssl stream (in ssl mode)
- **/
-CamelStream *
-camel_tcp_stream_ssl_new (CamelService *service, const char *expected_host, guint32 flags)
-{
- CamelTcpStreamSSL *stream;
-
- stream = CAMEL_TCP_STREAM_SSL (camel_object_new (camel_tcp_stream_ssl_get_type ()));
-
- stream->priv->service = service;
- stream->priv->expected_host = g_strdup (expected_host);
- stream->priv->ssl_mode = TRUE;
- stream->priv->flags = flags;
-
- return CAMEL_STREAM (stream);
-}
-
-
-/**
- * camel_tcp_stream_ssl_new_raw:
- * @service: camel service
- * @expected_host: host that the stream is expecting to connect with.
- * @flags: flags
- *
- * Since the SSL certificate authenticator may need to prompt the
- * user, a CamelService is needed. @expected_host is needed as a
- * protection against an MITM attack.
- *
- * Return value: a ssl-capable stream (in non ssl mode)
- **/
-CamelStream *
-camel_tcp_stream_ssl_new_raw (CamelService *service, const char *expected_host, guint32 flags)
-{
- CamelTcpStreamSSL *stream;
-
- stream = CAMEL_TCP_STREAM_SSL (camel_object_new (camel_tcp_stream_ssl_get_type ()));
-
- stream->priv->service = service;
- stream->priv->expected_host = g_strdup (expected_host);
- stream->priv->ssl_mode = FALSE;
- stream->priv->flags = flags;
-
- return CAMEL_STREAM (stream);
-}
-
-
-static int
-ssl_errno (SSL *ssl, int ret)
-{
- switch (SSL_get_error (ssl, ret)) {
- case SSL_ERROR_NONE:
- return 0;
- case SSL_ERROR_ZERO_RETURN:
- /* this one does not map well at all */
- d(printf ("ssl_errno: SSL_ERROR_ZERO_RETURN\n"));
- return EINVAL;
- case SSL_ERROR_WANT_READ: /* non-fatal; retry */
- case SSL_ERROR_WANT_WRITE: /* non-fatal; retry */
- d(printf ("ssl_errno: SSL_ERROR_WANT_[READ,WRITE]\n"));
- return EAGAIN;
- case SSL_ERROR_SYSCALL:
- d(printf ("ssl_errno: SSL_ERROR_SYSCALL\n"));
- return EINTR;
- case SSL_ERROR_SSL:
- d(printf ("ssl_errno: SSL_ERROR_SSL <-- very useful error...riiiiight\n"));
- return EINTR;
- default:
- d(printf ("ssl_errno: default error\n"));
- return EINTR;
- }
-}
-
-
-/**
- * camel_tcp_stream_ssl_enable_ssl:
- * @stream: ssl stream
- *
- * Toggles an ssl-capable stream into ssl mode (if it isn't already).
- *
- * Returns 0 on success or -1 on fail.
- **/
-int
-camel_tcp_stream_ssl_enable_ssl (CamelTcpStreamSSL *stream)
-{
- SSL *ssl;
-
- g_return_val_if_fail (CAMEL_IS_TCP_STREAM_SSL (stream), -1);
-
- if (stream->priv->sockfd != -1 && !stream->priv->ssl_mode) {
- ssl = open_ssl_connection (stream->priv->service, stream->priv->sockfd, stream);
- if (ssl == NULL) {
- stream->priv->sockfd = -1;
- return -1;
- }
-
- stream->priv->ssl = ssl;
- }
-
- stream->priv->ssl_mode = TRUE;
-
- return 0;
-}
-
-
-static ssize_t
-stream_read (CamelStream *stream, char *buffer, size_t n)
-{
- CamelTcpStreamSSL *openssl = CAMEL_TCP_STREAM_SSL (stream);
- SSL *ssl = openssl->priv->ssl;
- ssize_t nread;
- int cancel_fd;
-
- if (camel_operation_cancel_check (NULL)) {
- errno = EINTR;
- return -1;
- }
-
- cancel_fd = camel_operation_cancel_fd (NULL);
- if (cancel_fd == -1) {
- do {
- if (ssl) {
- nread = SSL_read (ssl, buffer, n);
- if (nread < 0)
- errno = ssl_errno (ssl, nread);
- } else {
- nread = read (openssl->priv->sockfd, buffer, n);
- }
- } while (nread < 0 && (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK));
- } else {
- int error, flags, fdmax;
- struct timeval timeout;
- fd_set rdset;
-
- flags = fcntl (openssl->priv->sockfd, F_GETFL);
- fcntl (openssl->priv->sockfd, F_SETFL, flags | O_NONBLOCK);
-
- fdmax = MAX (openssl->priv->sockfd, cancel_fd) + 1;
-
- do {
- FD_ZERO (&rdset);
- FD_SET (openssl->priv->sockfd, &rdset);
- FD_SET (cancel_fd, &rdset);
-
- timeout.tv_sec = 0;
- timeout.tv_usec = TIMEOUT_USEC;
- select (fdmax, &rdset, 0, 0, &timeout);
- if (FD_ISSET (cancel_fd, &rdset)) {
- fcntl (openssl->priv->sockfd, F_SETFL, flags);
- errno = EINTR;
- return -1;
- }
-
- do {
- if (ssl) {
- nread = SSL_read (ssl, buffer, n);
- if (nread < 0)
- errno = ssl_errno (ssl, nread);
- } else {
- nread = read (openssl->priv->sockfd, buffer, n);
- }
- } while (nread < 0 && errno == EINTR);
- } while (nread < 0 && (errno == EAGAIN || errno == EWOULDBLOCK));
-
- error = errno;
- fcntl (openssl->priv->sockfd, F_SETFL, flags);
- errno = error;
- }
-
- return nread;
-}
-
-static ssize_t
-stream_write (CamelStream *stream, const char *buffer, size_t n)
-{
- CamelTcpStreamSSL *openssl = CAMEL_TCP_STREAM_SSL (stream);
- SSL *ssl = openssl->priv->ssl;
- ssize_t w, written = 0;
- int cancel_fd;
-
- if (camel_operation_cancel_check (NULL)) {
- errno = EINTR;
- return -1;
- }
-
- cancel_fd = camel_operation_cancel_fd (NULL);
- if (cancel_fd == -1) {
- do {
- do {
- if (ssl) {
- w = SSL_write (ssl, buffer + written, n - written);
- if (w < 0)
- errno = ssl_errno (ssl, w);
- } else {
- w = write (openssl->priv->sockfd, buffer + written, n - written);
- }
- } while (w < 0 && (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK));
-
- if (w > 0)
- written += w;
- } while (w != -1 && written < n);
- } else {
- int error, flags, fdmax;
- struct timeval timeout;
- fd_set rdset, wrset;
-
- flags = fcntl (openssl->priv->sockfd, F_GETFL);
- fcntl (openssl->priv->sockfd, F_SETFL, flags | O_NONBLOCK);
-
- fdmax = MAX (openssl->priv->sockfd, cancel_fd) + 1;
- do {
- FD_ZERO (&rdset);
- FD_ZERO (&wrset);
- FD_SET (openssl->priv->sockfd, &wrset);
- FD_SET (cancel_fd, &rdset);
-
- timeout.tv_sec = 0;
- timeout.tv_usec = TIMEOUT_USEC;
- select (fdmax, &rdset, &wrset, 0, &timeout);
- if (FD_ISSET (cancel_fd, &rdset)) {
- fcntl (openssl->priv->sockfd, F_SETFL, flags);
- errno = EINTR;
- return -1;
- }
-
- do {
- if (ssl) {
- w = SSL_write (ssl, buffer + written, n - written);
- if (w < 0)
- errno = ssl_errno (ssl, w);
- } else {
- w = write (openssl->priv->sockfd, buffer + written, n - written);
- }
- } while (w < 0 && errno == EINTR);
-
- if (w < 0) {
- if (errno == EAGAIN || errno == EWOULDBLOCK) {
- w = 0;
- } else {
- error = errno;
- fcntl (openssl->priv->sockfd, F_SETFL, flags);
- errno = error;
- return -1;
- }
- } else
- written += w;
- } while (w >= 0 && written < n);
-
- fcntl (openssl->priv->sockfd, F_SETFL, flags);
- }
-
- return written;
-}
-
-static int
-stream_flush (CamelStream *stream)
-{
- return 0;
-}
-
-
-static void
-close_ssl_connection (SSL *ssl)
-{
- if (ssl) {
- SSL_shutdown (ssl);
-
- if (ssl->ctx)
- SSL_CTX_free (ssl->ctx);
-
- SSL_free (ssl);
- }
-}
-
-static int
-stream_close (CamelStream *stream)
-{
- close_ssl_connection (((CamelTcpStreamSSL *)stream)->priv->ssl);
- ((CamelTcpStreamSSL *)stream)->priv->ssl = NULL;
-
- if (close (((CamelTcpStreamSSL *)stream)->priv->sockfd) == -1)
- return -1;
-
- ((CamelTcpStreamSSL *)stream)->priv->sockfd = -1;
- return 0;
-}
-
-/* this is a 'cancellable' connect, cancellable from camel_operation_cancel etc */
-/* returns -1 & errno == EINTR if the connection was cancelled */
-static int
-socket_connect (struct hostent *h, int port)
-{
-#ifdef ENABLE_IPv6
- struct sockaddr_in6 sin6;
-#endif
- struct sockaddr_in sin;
- struct sockaddr *saddr;
- struct timeval tv;
- socklen_t len;
- int cancel_fd;
- int ret, fd;
-
- /* see if we're cancelled yet */
- if (camel_operation_cancel_check (NULL)) {
- errno = EINTR;
- return -1;
- }
-
- /* setup connect, we do it using a nonblocking socket so we can poll it */
-#ifdef ENABLE_IPv6
- if (h->h_addrtype == AF_INET6) {
- sin6.sin6_port = htons (port);
- sin6.sin6_family = h->h_addrtype;
- memcpy (&sin6.sin6_addr, h->h_addr, sizeof (sin6.sin6_addr));
- saddr = (struct sockaddr *) &sin6;
- len = sizeof (sin6);
- } else {
-#endif
- sin.sin_port = htons (port);
- sin.sin_family = h->h_addrtype;
- memcpy (&sin.sin_addr, h->h_addr, sizeof (sin.sin_addr));
- saddr = (struct sockaddr *) &sin;
- len = sizeof (sin);
-#ifdef ENABLE_IPv6
- }
-#endif
-
- fd = socket (h->h_addrtype, SOCK_STREAM, 0);
-
- cancel_fd = camel_operation_cancel_fd (NULL);
- if (cancel_fd == -1) {
- ret = connect (fd, saddr, len);
- if (ret == -1) {
- close (fd);
- return -1;
- }
-
- return fd;
- } else {
- fd_set rdset, wrset;
- int flags, fdmax;
-
- flags = fcntl (fd, F_GETFL);
- fcntl (fd, F_SETFL, flags | O_NONBLOCK);
-
- ret = connect (fd, saddr, len);
- if (ret == 0) {
- fcntl (fd, F_SETFL, flags);
- return fd;
- }
-
- if (errno != EINPROGRESS) {
- close (fd);
- return -1;
- }
-
- FD_ZERO (&rdset);
- FD_ZERO (&wrset);
- FD_SET (fd, &wrset);
- FD_SET (cancel_fd, &rdset);
- fdmax = MAX (fd, cancel_fd) + 1;
- tv.tv_usec = 0;
- tv.tv_sec = 60 * 4;
-
- if (select (fdmax, &rdset, &wrset, 0, &tv) == 0) {
- close (fd);
- errno = ETIMEDOUT;
- return -1;
- }
-
- if (cancel_fd != -1 && FD_ISSET (cancel_fd, &rdset)) {
- close (fd);
- errno = EINTR;
- return -1;
- } else {
- len = sizeof (int);
-
- if (getsockopt (fd, SOL_SOCKET, SO_ERROR, &ret, &len) == -1) {
- close (fd);
- return -1;
- }
-
- if (ret != 0) {
- close (fd);
- errno = ret;
- return -1;
- }
- }
-
- fcntl (fd, F_SETFL, flags);
- }
-
- return fd;
-}
-
-static const char *
-x509_strerror (int err)
-{
- switch (err) {
- case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT:
- return _("Unable to get issuer's certificate");
- case X509_V_ERR_UNABLE_TO_GET_CRL:
- return _("Unable to get Certificate Revocation List");
- case X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE:
- return _("Unable to decrypt certificate signature");
- case X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE:
- return _("Unable to decrypt Certificate Revocation List signature");
- case X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY:
- return _("Unable to decode issuer's public key");
- case X509_V_ERR_CERT_SIGNATURE_FAILURE:
- return _("Certificate signature failure");
- case X509_V_ERR_CRL_SIGNATURE_FAILURE:
- return _("Certificate Revocation List signature failure");
- case X509_V_ERR_CERT_NOT_YET_VALID:
- return _("Certificate not yet valid");
- case X509_V_ERR_CERT_HAS_EXPIRED:
- return _("Certificate has expired");
- case X509_V_ERR_CRL_NOT_YET_VALID:
- return _("CRL not yet valid");
- case X509_V_ERR_CRL_HAS_EXPIRED:
- return _("CRL has expired");
- case X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD:
- case X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD:
- case X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD:
- case X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD:
- return _("Error in CRL");
- case X509_V_ERR_OUT_OF_MEM:
- return _("Out of memory");
- case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT:
- return _("Zero-depth self-signed certificate");
- case X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN:
- return _("Self-signed certificate in chain");
- case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY:
- return _("Unable to get issuer's certificate locally");
- case X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE:
- return _("Unable to verify leaf signature");
- case X509_V_ERR_CERT_CHAIN_TOO_LONG:
- return _("Certificate chain too long");
- case X509_V_ERR_CERT_REVOKED:
- return _("Certificate Revoked");
- case X509_V_ERR_INVALID_CA:
- return _("Invalid Certificate Authority (CA)");
- case X509_V_ERR_PATH_LENGTH_EXCEEDED:
- return _("Path length exceeded");
- case X509_V_ERR_INVALID_PURPOSE:
- return _("Invalid purpose");
- case X509_V_ERR_CERT_UNTRUSTED:
- return _("Certificate untrusted");
- case X509_V_ERR_CERT_REJECTED:
- return _("Certificate rejected");
- /* These are 'informational' when looking for issuer cert */
- case X509_V_ERR_SUBJECT_ISSUER_MISMATCH:
- return _("Subject/Issuer mismatch");
- case X509_V_ERR_AKID_SKID_MISMATCH:
- return _("AKID/SKID mismatch");
- case X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH:
- return _("AKID/Issuer serial mismatch");
- case X509_V_ERR_KEYUSAGE_NO_CERTSIGN:
- return _("Key usage does not support certificate signing");
- /* The application is not happy */
- case X509_V_ERR_APPLICATION_VERIFICATION:
- return _("Error in application verification");
- default:
- return _("Unknown");
- }
-}
-
-static int
-ssl_verify (int ok, X509_STORE_CTX *ctx)
-{
- unsigned char md5sum[16], fingerprint[40], *f;
- CamelTcpStreamSSL *stream;
- CamelService *service;
- CamelCertDB *certdb = NULL;
- CamelCert *ccert = NULL;
- char *prompt, *cert_str;
- int err, md5len, i;
- char buf[257];
- X509 *cert;
- SSL *ssl;
-
- if (ok)
- return TRUE;
-
- ssl = X509_STORE_CTX_get_ex_data (ctx, SSL_get_ex_data_X509_STORE_CTX_idx ());
-
- stream = SSL_CTX_get_app_data (ssl->ctx);
- if (!stream)
- return FALSE;
-
- service = stream->priv->service;
-
- cert = X509_STORE_CTX_get_current_cert (ctx);
- err = X509_STORE_CTX_get_error (ctx);
-
- /* calculate the MD5 hash of the raw certificate */
- md5len = sizeof (md5sum);
- X509_digest (cert, EVP_md5 (), md5sum, &md5len);
- for (i = 0, f = fingerprint; i < 16; i++, f += 3)
- sprintf (f, "%.2x%c", md5sum[i], i != 15 ? ':' : '\0');
-
-#define GET_STRING(name) X509_NAME_oneline (name, buf, 256)
-
- certdb = camel_certdb_get_default ();
- if (certdb) {
- ccert = camel_certdb_get_cert (certdb, fingerprint);
- if (ccert) {
- if (ccert->trust != CAMEL_CERT_TRUST_UNKNOWN) {
- ok = ccert->trust != CAMEL_CERT_TRUST_NEVER;
- camel_certdb_cert_unref (certdb, ccert);
- camel_object_unref (certdb);
-
- return ok;
- }
- } else {
- /* create a new camel-cert */
- ccert = camel_certdb_cert_new (certdb);
- camel_cert_set_issuer (certdb, ccert, GET_STRING (X509_get_issuer_name (cert)));
- camel_cert_set_subject (certdb, ccert, GET_STRING (X509_get_subject_name (cert)));
- camel_cert_set_hostname (certdb, ccert, stream->priv->expected_host);
- camel_cert_set_fingerprint (certdb, ccert, fingerprint);
- camel_cert_set_trust (certdb, ccert, CAMEL_CERT_TRUST_UNKNOWN);
-
- /* Add the certificate to our db */
- camel_certdb_add (certdb, ccert);
- }
- }
-
- cert_str = g_strdup_printf (_("Issuer: %s\n"
- "Subject: %s\n"
- "Fingerprint: %s\n"
- "Signature: %s"),
- GET_STRING (X509_get_issuer_name (cert)),
- GET_STRING (X509_get_subject_name (cert)),
- fingerprint, cert->valid ? _("GOOD") : _("BAD"));
-
- prompt = g_strdup_printf (_("Bad certificate from %s:\n\n%s\n\n%s\n\n"
- "Do you wish to accept anyway?"),
- service->url->host, cert_str, x509_strerror (err));
-
- ok = camel_session_alert_user (service->session, CAMEL_SESSION_ALERT_WARNING, prompt, TRUE);
- g_free (prompt);
-
- if (ok && ccert) {
- camel_cert_set_trust (certdb, ccert, CAMEL_CERT_TRUST_FULLY);
- camel_certdb_touch (certdb);
- }
-
- if (certdb) {
- camel_certdb_cert_unref (certdb, ccert);
- camel_object_unref (certdb);
- }
-
- return ok;
-}
-
-static SSL *
-open_ssl_connection (CamelService *service, int sockfd, CamelTcpStreamSSL *openssl)
-{
- SSL_CTX *ssl_ctx = NULL;
- SSL *ssl = NULL;
- int n;
-
- /* SSLv23_client_method will negotiate with SSL v2, v3, or TLS v1 */
- ssl_ctx = SSL_CTX_new (SSLv23_client_method ());
- g_return_val_if_fail (ssl_ctx != NULL, NULL);
-
- SSL_CTX_set_verify (ssl_ctx, SSL_VERIFY_PEER, &ssl_verify);
- ssl = SSL_new (ssl_ctx);
- SSL_set_fd (ssl, sockfd);
-
- SSL_CTX_set_app_data (ssl_ctx, openssl);
-
- n = SSL_connect (ssl);
- if (n != 1) {
- int errnosave = ssl_errno (ssl, n);
-
- SSL_shutdown (ssl);
-
- if (ssl->ctx)
- SSL_CTX_free (ssl->ctx);
-
- SSL_free (ssl);
- ssl = NULL;
-
- close (sockfd);
-
- errno = errnosave;
- }
-
- return ssl;
-}
-
-static int
-stream_connect (CamelTcpStream *stream, struct hostent *host, int port)
-{
- CamelTcpStreamSSL *openssl = CAMEL_TCP_STREAM_SSL (stream);
- SSL *ssl = NULL;
- int fd;
-
- g_return_val_if_fail (host != NULL, -1);
-
- fd = socket_connect (host, port);
- if (fd == -1)
- return -1;
-
- if (openssl->priv->ssl_mode) {
- ssl = open_ssl_connection (openssl->priv->service, fd, openssl);
- if (!ssl)
- return -1;
- }
-
- openssl->priv->sockfd = fd;
- openssl->priv->ssl = ssl;
-
- return 0;
-}
-
-
-static int
-get_sockopt_level (const CamelSockOptData *data)
-{
- switch (data->option) {
- case CAMEL_SOCKOPT_MAXSEGMENT:
- case CAMEL_SOCKOPT_NODELAY:
- return IPPROTO_TCP;
- default:
- return SOL_SOCKET;
- }
-}
-
-static int
-get_sockopt_optname (const CamelSockOptData *data)
-{
- switch (data->option) {
- case CAMEL_SOCKOPT_MAXSEGMENT:
- return TCP_MAXSEG;
- case CAMEL_SOCKOPT_NODELAY:
- return TCP_NODELAY;
- case CAMEL_SOCKOPT_BROADCAST:
- return SO_BROADCAST;
- case CAMEL_SOCKOPT_KEEPALIVE:
- return SO_KEEPALIVE;
- case CAMEL_SOCKOPT_LINGER:
- return SO_LINGER;
- case CAMEL_SOCKOPT_RECVBUFFERSIZE:
- return SO_RCVBUF;
- case CAMEL_SOCKOPT_SENDBUFFERSIZE:
- return SO_SNDBUF;
- case CAMEL_SOCKOPT_REUSEADDR:
- return SO_REUSEADDR;
- case CAMEL_SOCKOPT_IPTYPEOFSERVICE:
- return SO_TYPE;
- default:
- return -1;
- }
-}
-
-static int
-stream_getsockopt (CamelTcpStream *stream, CamelSockOptData *data)
-{
- int optname, optlen;
-
- if ((optname = get_sockopt_optname (data)) == -1)
- return -1;
-
- if (data->option == CAMEL_SOCKOPT_NONBLOCKING) {
- int flags;
-
- flags = fcntl (((CamelTcpStreamSSL *) stream)->priv->sockfd, F_GETFL);
- if (flags == -1)
- return -1;
-
- data->value.non_blocking = flags & O_NONBLOCK ? TRUE : FALSE;
-
- return 0;
- }
-
- return getsockopt (((CamelTcpStreamSSL *) stream)->priv->sockfd,
- get_sockopt_level (data),
- optname,
- (void *) &data->value,
- &optlen);
-}
-
-static int
-stream_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data)
-{
- int optname;
-
- if ((optname = get_sockopt_optname (data)) == -1)
- return -1;
-
- if (data->option == CAMEL_SOCKOPT_NONBLOCKING) {
- int flags, set;
-
- flags = fcntl (((CamelTcpStreamSSL *) stream)->priv->sockfd, F_GETFL);
- if (flags == -1)
- return -1;
-
- set = data->value.non_blocking ? O_NONBLOCK : 0;
- flags = (flags & ~O_NONBLOCK) | set;
-
- if (fcntl (((CamelTcpStreamSSL *) stream)->priv->sockfd, F_SETFL, flags) == -1)
- return -1;
-
- return 0;
- }
-
- return setsockopt (((CamelTcpStreamSSL *) stream)->priv->sockfd,
- get_sockopt_level (data),
- optname,
- (void *) &data->value,
- sizeof (data->value));
-}
-
-#ifdef ENABLE_IPv6
-#define MIN_SOCKADDR_BUFLEN (sizeof (struct sockaddr_in6))
-#else
-#define MIN_SOCKADDR_BUFLEN (sizeof (struct sockaddr_in))
-#endif
-
-static CamelTcpAddress *
-stream_get_local_address (CamelTcpStream *stream)
-{
- unsigned char buf[MIN_SOCKADDR_BUFLEN];
-#ifdef ENABLE_IPv6
- struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) buf;
-#endif
- struct sockaddr_in *sin = (struct sockaddr_in *) buf;
- struct sockaddr *saddr = (struct sockaddr *) buf;
- gpointer address;
- socklen_t len;
- int family;
-
- len = MIN_SOCKADDR_BUFLEN;
-
- if (getsockname (CAMEL_TCP_STREAM_SSL (stream)->priv->sockfd, saddr, &len) == -1)
- return NULL;
-
- if (saddr->sa_family == AF_INET) {
- family = CAMEL_TCP_ADDRESS_IPv4;
- address = &sin->sin_addr;
-#ifdef ENABLE_IPv6
- } else if (saddr->sa_family == AF_INET6) {
- family = CAMEL_TCP_ADDRESS_IPv6;
- address = &sin6->sin6_addr;
-#endif
- } else
- return NULL;
-
- return camel_tcp_address_new (family, sin->sin_port, len, address);
-}
-
-static CamelTcpAddress *
-stream_get_remote_address (CamelTcpStream *stream)
-{
- unsigned char buf[MIN_SOCKADDR_BUFLEN];
-#ifdef ENABLE_IPv6
- struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) buf;
-#endif
- struct sockaddr_in *sin = (struct sockaddr_in *) buf;
- struct sockaddr *saddr = (struct sockaddr *) buf;
- gpointer address;
- socklen_t len;
- int family;
-
- len = MIN_SOCKADDR_BUFLEN;
-
- if (getpeername (CAMEL_TCP_STREAM_SSL (stream)->priv->sockfd, saddr, &len) == -1)
- return NULL;
-
- if (saddr->sa_family == AF_INET) {
- family = CAMEL_TCP_ADDRESS_IPv4;
- address = &sin->sin_addr;
-#ifdef ENABLE_IPv6
- } else if (saddr->sa_family == AF_INET6) {
- family = CAMEL_TCP_ADDRESS_IPv6;
- address = &sin6->sin6_addr;
-#endif
- } else
- return NULL;
-
- return camel_tcp_address_new (family, sin->sin_port, len, address);
-}
-
-#endif /* HAVE_OPENSSL */
diff --git a/camel/camel-tcp-stream-raw.c b/camel/camel-tcp-stream-raw.c
deleted file mode 100644
index 819647cff6..0000000000
--- a/camel/camel-tcp-stream-raw.c
+++ /dev/null
@@ -1,562 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2001-2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <string.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-
-#include "camel-tcp-stream-raw.h"
-#include "camel-file-utils.h"
-#include "camel-operation.h"
-
-static CamelTcpStreamClass *parent_class = NULL;
-
-/* Returns the class for a CamelTcpStreamRaw */
-#define CTSR_CLASS(so) CAMEL_TCP_STREAM_RAW_CLASS (CAMEL_OBJECT_GET_CLASS (so))
-
-static ssize_t stream_read (CamelStream *stream, char *buffer, size_t n);
-static ssize_t stream_write (CamelStream *stream, const char *buffer, size_t n);
-static int stream_flush (CamelStream *stream);
-static int stream_close (CamelStream *stream);
-
-static int stream_connect (CamelTcpStream *stream, struct hostent *host, int port);
-static int stream_getsockopt (CamelTcpStream *stream, CamelSockOptData *data);
-static int stream_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data);
-static CamelTcpAddress *stream_get_local_address (CamelTcpStream *stream);
-static CamelTcpAddress *stream_get_remote_address (CamelTcpStream *stream);
-
-static void
-camel_tcp_stream_raw_class_init (CamelTcpStreamRawClass *camel_tcp_stream_raw_class)
-{
- CamelTcpStreamClass *camel_tcp_stream_class =
- CAMEL_TCP_STREAM_CLASS (camel_tcp_stream_raw_class);
- CamelStreamClass *camel_stream_class =
- CAMEL_STREAM_CLASS (camel_tcp_stream_raw_class);
-
- parent_class = CAMEL_TCP_STREAM_CLASS (camel_type_get_global_classfuncs (camel_tcp_stream_get_type ()));
-
- /* virtual method overload */
- camel_stream_class->read = stream_read;
- camel_stream_class->write = stream_write;
- camel_stream_class->flush = stream_flush;
- camel_stream_class->close = stream_close;
-
- camel_tcp_stream_class->connect = stream_connect;
- camel_tcp_stream_class->getsockopt = stream_getsockopt;
- camel_tcp_stream_class->setsockopt = stream_setsockopt;
- camel_tcp_stream_class->get_local_address = stream_get_local_address;
- camel_tcp_stream_class->get_remote_address = stream_get_remote_address;
-}
-
-static void
-camel_tcp_stream_raw_init (gpointer object, gpointer klass)
-{
- CamelTcpStreamRaw *stream = CAMEL_TCP_STREAM_RAW (object);
-
- stream->sockfd = -1;
-}
-
-static void
-camel_tcp_stream_raw_finalize (CamelObject *object)
-{
- CamelTcpStreamRaw *stream = CAMEL_TCP_STREAM_RAW (object);
-
- if (stream->sockfd != -1)
- close (stream->sockfd);
-}
-
-
-CamelType
-camel_tcp_stream_raw_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_tcp_stream_get_type (),
- "CamelTcpStreamRaw",
- sizeof (CamelTcpStreamRaw),
- sizeof (CamelTcpStreamRawClass),
- (CamelObjectClassInitFunc) camel_tcp_stream_raw_class_init,
- NULL,
- (CamelObjectInitFunc) camel_tcp_stream_raw_init,
- (CamelObjectFinalizeFunc) camel_tcp_stream_raw_finalize);
- }
-
- return type;
-}
-
-#ifdef SIMULATE_FLAKY_NETWORK
-static ssize_t
-flaky_tcp_write (int fd, const char *buffer, size_t buflen)
-{
- size_t len = buflen;
- ssize_t nwritten;
- int val;
-
- if (buflen == 0)
- return 0;
-
- val = 1 + (int) (10.0 * rand () / (RAND_MAX + 1.0));
-
- switch (val) {
- case 1:
- printf ("flaky_tcp_write (%d, ..., %d): (-1) EINTR\n", fd, buflen);
- errno = EINTR;
- return -1;
- case 2:
- printf ("flaky_tcp_write (%d, ..., %d): (-1) EAGAIN\n", fd, buflen);
- errno = EAGAIN;
- return -1;
- case 3:
- printf ("flaky_tcp_write (%d, ..., %d): (-1) EWOULDBLOCK\n", fd, buflen);
- errno = EWOULDBLOCK;
- return -1;
- case 4:
- case 5:
- case 6:
- len = 1 + (size_t) (buflen * rand () / (RAND_MAX + 1.0));
- len = MIN (len, buflen);
- /* fall through... */
- default:
- printf ("flaky_tcp_write (%d, ..., %d): (%d) '%.*s'", fd, buflen, len, (int) len, buffer);
- nwritten = write (fd, buffer, len);
- if (nwritten < 0)
- printf (" errno => %s\n", strerror (errno));
- else if (nwritten < len)
- printf (" only wrote %d bytes\n", nwritten);
- else
- printf ("\n");
-
- return nwritten;
- }
-}
-
-#define write(fd, buffer, buflen) flaky_tcp_write (fd, buffer, buflen)
-
-static ssize_t
-flaky_tcp_read (int fd, char *buffer, size_t buflen)
-{
- size_t len = buflen;
- ssize_t nread;
- int val;
-
- if (buflen == 0)
- return 0;
-
- val = 1 + (int) (10.0 * rand () / (RAND_MAX + 1.0));
-
- switch (val) {
- case 1:
- printf ("flaky_tcp_read (%d, ..., %d): (-1) EINTR\n", fd, buflen);
- errno = EINTR;
- return -1;
- case 2:
- printf ("flaky_tcp_read (%d, ..., %d): (-1) EAGAIN\n", fd, buflen);
- errno = EAGAIN;
- return -1;
- case 3:
- printf ("flaky_tcp_read (%d, ..., %d): (-1) EWOULDBLOCK\n", fd, buflen);
- errno = EWOULDBLOCK;
- return -1;
- case 4:
- case 5:
- case 6:
- case 7:
- case 8:
- case 9:
- case 10:
- len = 1 + (size_t) (10.0 * rand () / (RAND_MAX + 1.0));
- len = MIN (len, buflen);
- /* fall through... */
- default:
- printf ("flaky_tcp_read (%d, ..., %d): (%d)", fd, buflen, len);
- nread = read (fd, buffer, len);
- if (nread < 0)
- printf (" errno => %s\n", strerror (errno));
- else if (nread < len)
- printf (" only read %d bytes\n", nread);
- else
- printf ("\n");
-
- return nread;
- }
-}
-
-#define read(fd, buffer, buflen) flaky_tcp_read (fd, buffer, buflen)
-
-#endif /* SIMULATE_FLAKY_NETWORK */
-
-
-
-/**
- * camel_tcp_stream_raw_new:
- *
- * Return value: a tcp stream
- **/
-CamelStream *
-camel_tcp_stream_raw_new ()
-{
- CamelTcpStreamRaw *stream;
-
- stream = CAMEL_TCP_STREAM_RAW (camel_object_new (camel_tcp_stream_raw_get_type ()));
-
- return CAMEL_STREAM (stream);
-}
-
-static ssize_t
-stream_read (CamelStream *stream, char *buffer, size_t n)
-{
- CamelTcpStreamRaw *raw = CAMEL_TCP_STREAM_RAW (stream);
-
- return camel_read (raw->sockfd, buffer, n);
-}
-
-static ssize_t
-stream_write (CamelStream *stream, const char *buffer, size_t n)
-{
- CamelTcpStreamRaw *raw = CAMEL_TCP_STREAM_RAW (stream);
-
- return camel_write (raw->sockfd, buffer, n);
-}
-
-static int
-stream_flush (CamelStream *stream)
-{
- return 0;
-}
-
-static int
-stream_close (CamelStream *stream)
-{
- if (close (((CamelTcpStreamRaw *)stream)->sockfd) == -1)
- return -1;
-
- ((CamelTcpStreamRaw *)stream)->sockfd = -1;
- return 0;
-}
-
-/* this is a 'cancellable' connect, cancellable from camel_operation_cancel etc */
-/* returns -1 & errno == EINTR if the connection was cancelled */
-static int
-socket_connect (struct hostent *h, int port)
-{
-#ifdef ENABLE_IPv6
- struct sockaddr_in6 sin6;
-#endif
- struct sockaddr_in sin;
- struct sockaddr *saddr;
- struct timeval tv;
- socklen_t len;
- int cancel_fd;
- int ret, fd;
-
- /* see if we're cancelled yet */
- if (camel_operation_cancel_check (NULL)) {
- errno = EINTR;
- return -1;
- }
-
- /* setup connect, we do it using a nonblocking socket so we can poll it */
-#ifdef ENABLE_IPv6
- if (h->h_addrtype == AF_INET6) {
- sin6.sin6_port = htons (port);
- sin6.sin6_family = h->h_addrtype;
- memcpy (&sin6.sin6_addr, h->h_addr, sizeof (sin6.sin6_addr));
- saddr = (struct sockaddr *) &sin6;
- len = sizeof (sin6);
- } else {
-#endif
- sin.sin_port = htons (port);
- sin.sin_family = h->h_addrtype;
- memcpy (&sin.sin_addr, h->h_addr, sizeof (sin.sin_addr));
- saddr = (struct sockaddr *) &sin;
- len = sizeof (sin);
-#ifdef ENABLE_IPv6
- }
-#endif
-
- fd = socket (h->h_addrtype, SOCK_STREAM, 0);
-
- cancel_fd = camel_operation_cancel_fd (NULL);
- if (cancel_fd == -1) {
- ret = connect (fd, saddr, len);
- if (ret == -1) {
- close (fd);
- return -1;
- }
-
- return fd;
- } else {
- int flags, fdmax, status;
- fd_set rdset, wrset;
-
- flags = fcntl (fd, F_GETFL);
- fcntl (fd, F_SETFL, flags | O_NONBLOCK);
-
- ret = connect (fd, saddr, len);
- if (ret == 0) {
- fcntl (fd, F_SETFL, flags);
- return fd;
- }
-
- if (errno != EINPROGRESS) {
- close (fd);
- return -1;
- }
-
- do {
- FD_ZERO (&rdset);
- FD_ZERO (&wrset);
- FD_SET (fd, &wrset);
- FD_SET (cancel_fd, &rdset);
- fdmax = MAX (fd, cancel_fd) + 1;
- tv.tv_sec = 60 * 4;
- tv.tv_usec = 0;
-
- status = select (fdmax, &rdset, &wrset, 0, &tv);
- } while (status == -1 && errno == EINTR);
-
- if (status <= 0) {
- close (fd);
- errno = ETIMEDOUT;
- return -1;
- }
-
- if (cancel_fd != -1 && FD_ISSET (cancel_fd, &rdset)) {
- close (fd);
- errno = EINTR;
- return -1;
- } else {
- len = sizeof (int);
-
- if (getsockopt (fd, SOL_SOCKET, SO_ERROR, &ret, &len) == -1) {
- close (fd);
- return -1;
- }
-
- if (ret != 0) {
- close (fd);
- errno = ret;
- return -1;
- }
- }
-
- fcntl (fd, F_SETFL, flags);
- }
-
- return fd;
-}
-
-static int
-stream_connect (CamelTcpStream *stream, struct hostent *host, int port)
-{
- CamelTcpStreamRaw *raw = CAMEL_TCP_STREAM_RAW (stream);
- int fd;
-
- g_return_val_if_fail (host != NULL, -1);
-
- fd = socket_connect (host, port);
- if (fd == -1)
- return -1;
-
- raw->sockfd = fd;
-
- return 0;
-}
-
-
-static int
-get_sockopt_level (const CamelSockOptData *data)
-{
- switch (data->option) {
- case CAMEL_SOCKOPT_MAXSEGMENT:
- case CAMEL_SOCKOPT_NODELAY:
- return IPPROTO_TCP;
- default:
- return SOL_SOCKET;
- }
-}
-
-static int
-get_sockopt_optname (const CamelSockOptData *data)
-{
- switch (data->option) {
- case CAMEL_SOCKOPT_MAXSEGMENT:
- return TCP_MAXSEG;
- case CAMEL_SOCKOPT_NODELAY:
- return TCP_NODELAY;
- case CAMEL_SOCKOPT_BROADCAST:
- return SO_BROADCAST;
- case CAMEL_SOCKOPT_KEEPALIVE:
- return SO_KEEPALIVE;
- case CAMEL_SOCKOPT_LINGER:
- return SO_LINGER;
- case CAMEL_SOCKOPT_RECVBUFFERSIZE:
- return SO_RCVBUF;
- case CAMEL_SOCKOPT_SENDBUFFERSIZE:
- return SO_SNDBUF;
- case CAMEL_SOCKOPT_REUSEADDR:
- return SO_REUSEADDR;
- case CAMEL_SOCKOPT_IPTYPEOFSERVICE:
- return SO_TYPE;
- default:
- return -1;
- }
-}
-
-static int
-stream_getsockopt (CamelTcpStream *stream, CamelSockOptData *data)
-{
- int optname, optlen;
-
- if ((optname = get_sockopt_optname (data)) == -1)
- return -1;
-
- if (data->option == CAMEL_SOCKOPT_NONBLOCKING) {
- int flags;
-
- flags = fcntl (((CamelTcpStreamRaw *)stream)->sockfd, F_GETFL);
- if (flags == -1)
- return -1;
-
- data->value.non_blocking = flags & O_NONBLOCK ? TRUE : FALSE;
-
- return 0;
- }
-
- return getsockopt (((CamelTcpStreamRaw *)stream)->sockfd,
- get_sockopt_level (data),
- optname,
- (void *) &data->value,
- &optlen);
-}
-
-static int
-stream_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data)
-{
- int optname;
-
- if ((optname = get_sockopt_optname (data)) == -1)
- return -1;
-
- if (data->option == CAMEL_SOCKOPT_NONBLOCKING) {
- int flags, set;
-
- flags = fcntl (((CamelTcpStreamRaw *)stream)->sockfd, F_GETFL);
- if (flags == -1)
- return -1;
-
- set = data->value.non_blocking ? O_NONBLOCK : 0;
- flags = (flags & ~O_NONBLOCK) | set;
-
- if (fcntl (((CamelTcpStreamRaw *)stream)->sockfd, F_SETFL, flags) == -1)
- return -1;
-
- return 0;
- }
-
- return setsockopt (((CamelTcpStreamRaw *)stream)->sockfd,
- get_sockopt_level (data),
- optname,
- (void *) &data->value,
- sizeof (data->value));
-}
-
-#ifdef ENABLE_IPv6
-#define MIN_SOCKADDR_BUFLEN (sizeof (struct sockaddr_in6))
-#else
-#define MIN_SOCKADDR_BUFLEN (sizeof (struct sockaddr_in))
-#endif
-
-static CamelTcpAddress *
-stream_get_local_address (CamelTcpStream *stream)
-{
- unsigned char buf[MIN_SOCKADDR_BUFLEN];
-#ifdef ENABLE_IPv6
- struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) buf;
-#endif
- struct sockaddr_in *sin = (struct sockaddr_in *) buf;
- struct sockaddr *saddr = (struct sockaddr *) buf;
- gpointer address;
- socklen_t len;
- int family;
-
- len = MIN_SOCKADDR_BUFLEN;
-
- if (getsockname (CAMEL_TCP_STREAM_RAW (stream)->sockfd, saddr, &len) == -1)
- return NULL;
-
- if (saddr->sa_family == AF_INET) {
- family = CAMEL_TCP_ADDRESS_IPv4;
- address = &sin->sin_addr;
-#ifdef ENABLE_IPv6
- } else if (saddr->sa_family == AF_INET6) {
- family = CAMEL_TCP_ADDRESS_IPv6;
- address = &sin6->sin6_addr;
-#endif
- } else
- return NULL;
-
- return camel_tcp_address_new (family, sin->sin_port, len, address);
-}
-
-static CamelTcpAddress *
-stream_get_remote_address (CamelTcpStream *stream)
-{
- unsigned char buf[MIN_SOCKADDR_BUFLEN];
-#ifdef ENABLE_IPv6
- struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) buf;
-#endif
- struct sockaddr_in *sin = (struct sockaddr_in *) buf;
- struct sockaddr *saddr = (struct sockaddr *) buf;
- gpointer address;
- socklen_t len;
- int family;
-
- len = MIN_SOCKADDR_BUFLEN;
-
- if (getpeername (CAMEL_TCP_STREAM_RAW (stream)->sockfd, saddr, &len) == -1)
- return NULL;
-
- if (saddr->sa_family == AF_INET) {
- family = CAMEL_TCP_ADDRESS_IPv4;
- address = &sin->sin_addr;
-#ifdef ENABLE_IPv6
- } else if (saddr->sa_family == AF_INET6) {
- family = CAMEL_TCP_ADDRESS_IPv6;
- address = &sin6->sin6_addr;
-#endif
- } else
- return NULL;
-
- return camel_tcp_address_new (family, sin->sin_port, len, address);
-}
diff --git a/camel/camel-tcp-stream-raw.h b/camel/camel-tcp-stream-raw.h
deleted file mode 100644
index 0ffec5cd5c..0000000000
--- a/camel/camel-tcp-stream-raw.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2001 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifndef CAMEL_TCP_STREAM_RAW_H
-#define CAMEL_TCP_STREAM_RAW_H
-
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <camel/camel-tcp-stream.h>
-
-#define CAMEL_TCP_STREAM_RAW_TYPE (camel_tcp_stream_raw_get_type ())
-#define CAMEL_TCP_STREAM_RAW(obj) (CAMEL_CHECK_CAST((obj), CAMEL_TCP_STREAM_RAW_TYPE, CamelTcpStreamRaw))
-#define CAMEL_TCP_STREAM_RAW_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_TCP_STREAM_RAW_TYPE, CamelTcpStreamRawClass))
-#define CAMEL_IS_TCP_STREAM_RAW(o) (CAMEL_CHECK_TYPE((o), CAMEL_TCP_STREAM_RAW_TYPE))
-
-struct _CamelTcpStreamRaw
-{
- CamelTcpStream parent_object;
-
- int sockfd;
-};
-
-typedef struct {
- CamelTcpStreamClass parent_class;
-
- /* virtual functions */
-
-} CamelTcpStreamRawClass;
-
-/* Standard Camel function */
-CamelType camel_tcp_stream_raw_get_type (void);
-
-/* public methods */
-CamelStream *camel_tcp_stream_raw_new (void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_TCP_STREAM_RAW_H */
diff --git a/camel/camel-tcp-stream-ssl.c b/camel/camel-tcp-stream-ssl.c
deleted file mode 100644
index 1c8f1b34de..0000000000
--- a/camel/camel-tcp-stream-ssl.c
+++ /dev/null
@@ -1,1211 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2001 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-/* NOTE: This is the default implementation of CamelTcpStreamSSL,
- * used when the Mozilla NSS libraries are used. If you configured
- * OpenSSL support instead, then this file won't be compiled and
- * the CamelTcpStreamSSL implementation in camel-tcp-stream-openssl.c
- * will be used instead.
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef HAVE_NSS
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <string.h>
-
-#include <nspr.h>
-#include <prio.h>
-#include <prerror.h>
-#include <prerr.h>
-#include <secerr.h>
-#include <sslerr.h>
-#include "nss.h" /* Don't use <> here or it will include the system nss.h instead */
-#include <ssl.h>
-#include <cert.h>
-#include <certdb.h>
-#include <pk11func.h>
-
-/* this is commented because otherwise we get an error about the
- redefinition of MD5Context...yay */
-/*#include <e-util/md5-utils.h>*/
-
-#include "camel-tcp-stream-ssl.h"
-#include "camel-stream-fs.h"
-#include "camel-session.h"
-#include "camel-certdb.h"
-#include "camel-operation.h"
-
-/* from md5-utils.h */
-void md5_get_digest (const char *buffer, int buffer_size, unsigned char digest[16]);
-
-
-static CamelTcpStreamClass *parent_class = NULL;
-
-/* Returns the class for a CamelTcpStreamSSL */
-#define CTSS_CLASS(so) CAMEL_TCP_STREAM_SSL_CLASS (CAMEL_OBJECT_GET_CLASS (so))
-
-static ssize_t stream_read (CamelStream *stream, char *buffer, size_t n);
-static ssize_t stream_write (CamelStream *stream, const char *buffer, size_t n);
-static int stream_flush (CamelStream *stream);
-static int stream_close (CamelStream *stream);
-
-static PRFileDesc *enable_ssl (CamelTcpStreamSSL *ssl, PRFileDesc *fd);
-
-static int stream_connect (CamelTcpStream *stream, struct hostent *host, int port);
-static int stream_getsockopt (CamelTcpStream *stream, CamelSockOptData *data);
-static int stream_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data);
-static CamelTcpAddress *stream_get_local_address (CamelTcpStream *stream);
-static CamelTcpAddress *stream_get_remote_address (CamelTcpStream *stream);
-
-struct _CamelTcpStreamSSLPrivate {
- PRFileDesc *sockfd;
-
- struct _CamelSession *session;
- char *expected_host;
- gboolean ssl_mode;
- guint32 flags;
-};
-
-static void
-camel_tcp_stream_ssl_class_init (CamelTcpStreamSSLClass *camel_tcp_stream_ssl_class)
-{
- CamelTcpStreamClass *camel_tcp_stream_class =
- CAMEL_TCP_STREAM_CLASS (camel_tcp_stream_ssl_class);
- CamelStreamClass *camel_stream_class =
- CAMEL_STREAM_CLASS (camel_tcp_stream_ssl_class);
-
- parent_class = CAMEL_TCP_STREAM_CLASS (camel_type_get_global_classfuncs (camel_tcp_stream_get_type ()));
-
- /* virtual method overload */
- camel_stream_class->read = stream_read;
- camel_stream_class->write = stream_write;
- camel_stream_class->flush = stream_flush;
- camel_stream_class->close = stream_close;
-
- camel_tcp_stream_class->connect = stream_connect;
- camel_tcp_stream_class->getsockopt = stream_getsockopt;
- camel_tcp_stream_class->setsockopt = stream_setsockopt;
- camel_tcp_stream_class->get_local_address = stream_get_local_address;
- camel_tcp_stream_class->get_remote_address = stream_get_remote_address;
-}
-
-static void
-camel_tcp_stream_ssl_init (gpointer object, gpointer klass)
-{
- CamelTcpStreamSSL *stream = CAMEL_TCP_STREAM_SSL (object);
-
- stream->priv = g_new0 (struct _CamelTcpStreamSSLPrivate, 1);
-}
-
-static void
-camel_tcp_stream_ssl_finalize (CamelObject *object)
-{
- CamelTcpStreamSSL *stream = CAMEL_TCP_STREAM_SSL (object);
-
- if (stream->priv->sockfd != NULL)
- PR_Close (stream->priv->sockfd);
-
- if (stream->priv->session)
- camel_object_unref(stream->priv->session);
-
- g_free (stream->priv->expected_host);
-
- g_free (stream->priv);
-}
-
-
-CamelType
-camel_tcp_stream_ssl_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_tcp_stream_get_type (),
- "CamelTcpStreamSSL",
- sizeof (CamelTcpStreamSSL),
- sizeof (CamelTcpStreamSSLClass),
- (CamelObjectClassInitFunc) camel_tcp_stream_ssl_class_init,
- NULL,
- (CamelObjectInitFunc) camel_tcp_stream_ssl_init,
- (CamelObjectFinalizeFunc) camel_tcp_stream_ssl_finalize);
- }
-
- return type;
-}
-
-
-/**
- * camel_tcp_stream_ssl_new:
- * @session: active session
- * @expected_host: host that the stream is expected to connect with.
- * @flags: ENABLE_SSL2, ENABLE_SSL3 and/or ENABLE_TLS
- *
- * Since the SSL certificate authenticator may need to prompt the
- * user, a CamelSession is needed. @expected_host is needed as a
- * protection against an MITM attack.
- *
- * Return value: a ssl stream (in ssl mode)
- **/
-CamelStream *
-camel_tcp_stream_ssl_new (CamelSession *session, const char *expected_host, guint32 flags)
-{
- CamelTcpStreamSSL *stream;
-
- g_assert(CAMEL_IS_SESSION(session));
-
- stream = CAMEL_TCP_STREAM_SSL (camel_object_new (camel_tcp_stream_ssl_get_type ()));
-
- stream->priv->session = session;
- camel_object_ref(session);
- stream->priv->expected_host = g_strdup (expected_host);
- stream->priv->ssl_mode = TRUE;
- stream->priv->flags = flags;
-
- return CAMEL_STREAM (stream);
-}
-
-
-/**
- * camel_tcp_stream_ssl_new_raw:
- * @session: active session
- * @expected_host: host that the stream is expected to connect with.
- * @flags: ENABLE_SSL2, ENABLE_SSL3 and/or ENABLE_TLS
- *
- * Since the SSL certificate authenticator may need to prompt the
- * user, a CamelSession is needed. @expected_host is needed as a
- * protection against an MITM attack.
- *
- * Return value: a ssl-capable stream (in non ssl mode)
- **/
-CamelStream *
-camel_tcp_stream_ssl_new_raw (CamelSession *session, const char *expected_host, guint32 flags)
-{
- CamelTcpStreamSSL *stream;
-
- g_assert(CAMEL_IS_SESSION(session));
-
- stream = CAMEL_TCP_STREAM_SSL (camel_object_new (camel_tcp_stream_ssl_get_type ()));
-
- stream->priv->session = session;
- camel_object_ref(session);
- stream->priv->expected_host = g_strdup (expected_host);
- stream->priv->ssl_mode = FALSE;
- stream->priv->flags = flags;
-
- return CAMEL_STREAM (stream);
-}
-
-
-static void
-set_errno (int code)
-{
- /* FIXME: this should handle more. */
- switch (code) {
- case PR_INVALID_ARGUMENT_ERROR:
- errno = EINVAL;
- break;
- case PR_PENDING_INTERRUPT_ERROR:
- errno = EINTR;
- break;
- case PR_IO_PENDING_ERROR:
- errno = EAGAIN;
- break;
- case PR_WOULD_BLOCK_ERROR:
- errno = EWOULDBLOCK;
- break;
- case PR_IN_PROGRESS_ERROR:
- errno = EINPROGRESS;
- break;
- case PR_ALREADY_INITIATED_ERROR:
- errno = EALREADY;
- break;
- case PR_NETWORK_UNREACHABLE_ERROR:
- errno = EHOSTUNREACH;
- break;
- case PR_CONNECT_REFUSED_ERROR:
- errno = ECONNREFUSED;
- break;
- case PR_CONNECT_TIMEOUT_ERROR:
- case PR_IO_TIMEOUT_ERROR:
- errno = ETIMEDOUT;
- break;
- case PR_NOT_CONNECTED_ERROR:
- errno = ENOTCONN;
- break;
- case PR_CONNECT_RESET_ERROR:
- errno = ECONNRESET;
- break;
- case PR_IO_ERROR:
- default:
- errno = EIO;
- break;
- }
-}
-
-
-/**
- * camel_tcp_stream_ssl_enable_ssl:
- * @ssl: ssl stream
- *
- * Toggles an ssl-capable stream into ssl mode (if it isn't already).
- *
- * Returns 0 on success or -1 on fail.
- **/
-int
-camel_tcp_stream_ssl_enable_ssl (CamelTcpStreamSSL *ssl)
-{
- PRFileDesc *fd;
-
- g_return_val_if_fail (CAMEL_IS_TCP_STREAM_SSL (ssl), -1);
-
- if (ssl->priv->sockfd && !ssl->priv->ssl_mode) {
- if (!(fd = enable_ssl (ssl, NULL))) {
- set_errno (PR_GetError ());
- return -1;
- }
-
- ssl->priv->sockfd = fd;
-
- if (SSL_ResetHandshake (fd, FALSE) == SECFailure) {
- set_errno (PR_GetError ());
- return -1;
- }
-
- if (SSL_ForceHandshake (fd) == -1) {
- set_errno (PR_GetError ());
- return -1;
- }
- }
-
- ssl->priv->ssl_mode = TRUE;
-
- return 0;
-}
-
-
-static ssize_t
-stream_read (CamelStream *stream, char *buffer, size_t n)
-{
- CamelTcpStreamSSL *tcp_stream_ssl = CAMEL_TCP_STREAM_SSL (stream);
- PRFileDesc *cancel_fd;
- ssize_t nread;
-
- if (camel_operation_cancel_check (NULL)) {
- errno = EINTR;
- return -1;
- }
-
- cancel_fd = camel_operation_cancel_prfd (NULL);
- if (cancel_fd == NULL) {
- do {
- nread = PR_Read (tcp_stream_ssl->priv->sockfd, buffer, n);
- if (nread == -1)
- set_errno (PR_GetError ());
- } while (nread == -1 && (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK));
- } else {
- PRSocketOptionData sockopts;
- PRPollDesc pollfds[2];
- gboolean nonblock;
- int error;
-
- /* get O_NONBLOCK options */
- sockopts.option = PR_SockOpt_Nonblocking;
- PR_GetSocketOption (tcp_stream_ssl->priv->sockfd, &sockopts);
- sockopts.option = PR_SockOpt_Nonblocking;
- nonblock = sockopts.value.non_blocking;
- sockopts.value.non_blocking = TRUE;
- PR_SetSocketOption (tcp_stream_ssl->priv->sockfd, &sockopts);
-
- pollfds[0].fd = tcp_stream_ssl->priv->sockfd;
- pollfds[0].in_flags = PR_POLL_READ;
- pollfds[1].fd = cancel_fd;
- pollfds[1].in_flags = PR_POLL_READ;
-
- do {
- pollfds[0].out_flags = 0;
- pollfds[1].out_flags = 0;
-
- nread = -1;
- if (PR_Poll (pollfds, 2, -1) != -1) {
- if (pollfds[1].out_flags == PR_POLL_READ) {
- sockopts.option = PR_SockOpt_Nonblocking;
- sockopts.value.non_blocking = nonblock;
- PR_SetSocketOption (tcp_stream_ssl->priv->sockfd, &sockopts);
- errno = EINTR;
- return -1;
- }
-
- do {
- nread = PR_Read (tcp_stream_ssl->priv->sockfd, buffer, n);
- if (nread == -1)
- set_errno (PR_GetError ());
- } while (nread == -1 && errno == EINTR);
- } else {
- errno = EAGAIN;
- }
- } while (nread == -1 && (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK));
-
- /* restore O_NONBLOCK options */
- error = errno;
- sockopts.option = PR_SockOpt_Nonblocking;
- sockopts.value.non_blocking = nonblock;
- PR_SetSocketOption (tcp_stream_ssl->priv->sockfd, &sockopts);
- errno = error;
- }
-
- return nread;
-}
-
-static ssize_t
-stream_write (CamelStream *stream, const char *buffer, size_t n)
-{
- CamelTcpStreamSSL *tcp_stream_ssl = CAMEL_TCP_STREAM_SSL (stream);
- ssize_t w, written = 0;
- PRFileDesc *cancel_fd;
-
- if (camel_operation_cancel_check (NULL)) {
- errno = EINTR;
- return -1;
- }
-
- cancel_fd = camel_operation_cancel_prfd (NULL);
- if (cancel_fd == NULL) {
- do {
- do {
- w = PR_Write (tcp_stream_ssl->priv->sockfd, buffer + written, n - written);
- if (w == -1)
- set_errno (PR_GetError ());
- } while (w == -1 && (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK));
-
- if (w > 0)
- written += w;
- } while (w != -1 && written < n);
- } else {
- PRSocketOptionData sockopts;
- PRPollDesc pollfds[2];
- gboolean nonblock;
- int error;
-
- /* get O_NONBLOCK options */
- sockopts.option = PR_SockOpt_Nonblocking;
- PR_GetSocketOption (tcp_stream_ssl->priv->sockfd, &sockopts);
- sockopts.option = PR_SockOpt_Nonblocking;
- nonblock = sockopts.value.non_blocking;
- sockopts.value.non_blocking = TRUE;
- PR_SetSocketOption (tcp_stream_ssl->priv->sockfd, &sockopts);
-
- pollfds[0].fd = tcp_stream_ssl->priv->sockfd;
- pollfds[0].in_flags = PR_POLL_WRITE;
- pollfds[1].fd = cancel_fd;
- pollfds[1].in_flags = PR_POLL_READ;
-
- do {
- pollfds[0].out_flags = 0;
- pollfds[1].out_flags = 0;
-
- w = -1;
- if (PR_Poll (pollfds, 2, -1) != -1) {
- if (pollfds[1].out_flags == PR_POLL_READ) {
- sockopts.option = PR_SockOpt_Nonblocking;
- sockopts.value.non_blocking = nonblock;
- PR_SetSocketOption (tcp_stream_ssl->priv->sockfd, &sockopts);
- errno = EINTR;
- return -1;
- }
-
- do {
- w = PR_Write (tcp_stream_ssl->priv->sockfd, buffer + written, n - written);
- if (w == -1)
- set_errno (PR_GetError ());
- } while (w == -1 && errno == EINTR);
-
- if (w == -1) {
- if (errno == EAGAIN || errno == EWOULDBLOCK) {
- w = 0;
- } else {
- error = errno;
- sockopts.option = PR_SockOpt_Nonblocking;
- sockopts.value.non_blocking = nonblock;
- PR_SetSocketOption (tcp_stream_ssl->priv->sockfd, &sockopts);
- errno = error;
- return -1;
- }
- } else
- written += w;
- } else {
- set_errno (PR_GetError ());
- if (errno == EINTR)
- w = 0;
- }
- } while (w != -1 && written < n);
-
- /* restore O_NONBLOCK options */
- error = errno;
- sockopts.option = PR_SockOpt_Nonblocking;
- sockopts.value.non_blocking = nonblock;
- PR_SetSocketOption (tcp_stream_ssl->priv->sockfd, &sockopts);
- errno = error;
- }
-
- if (w == -1)
- return -1;
-
- return written;
-}
-
-static int
-stream_flush (CamelStream *stream)
-{
- return PR_Sync (((CamelTcpStreamSSL *)stream)->priv->sockfd);
-}
-
-static int
-stream_close (CamelStream *stream)
-{
- if (PR_Close (((CamelTcpStreamSSL *)stream)->priv->sockfd) == PR_FAILURE)
- return -1;
-
- ((CamelTcpStreamSSL *)stream)->priv->sockfd = NULL;
-
- return 0;
-}
-
-#if 0
-/* Since this is default implementation, let NSS handle it. */
-static SECStatus
-ssl_get_client_auth (void *data, PRFileDesc *sockfd,
- struct CERTDistNamesStr *caNames,
- struct CERTCertificateStr **pRetCert,
- struct SECKEYPrivateKeyStr **pRetKey)
-{
- SECStatus status = SECFailure;
- SECKEYPrivateKey *privkey;
- CERTCertificate *cert;
- void *proto_win;
-
- proto_win = SSL_RevealPinArg (sockfd);
-
- if ((char *) data) {
- cert = PK11_FindCertFromNickname ((char *) data, proto_win);
- if (cert) {
- privKey = PK11_FindKeyByAnyCert (cert, proto_win);
- if (privkey) {
- status = SECSuccess;
- } else {
- CERT_DestroyCertificate (cert);
- }
- }
- } else {
- /* no nickname given, automatically find the right cert */
- CERTCertNicknames *names;
- int i;
-
- names = CERT_GetCertNicknames (CERT_GetDefaultCertDB (),
- SEC_CERT_NICKNAMES_USER,
- proto_win);
-
- if (names != NULL) {
- for (i = 0; i < names->numnicknames; i++) {
- cert = PK11_FindCertFromNickname (names->nicknames[i],
- proto_win);
- if (!cert)
- continue;
-
- /* Only check unexpired certs */
- if (CERT_CheckCertValidTimes (cert, PR_Now (), PR_FALSE) != secCertTimeValid) {
- CERT_DestroyCertificate (cert);
- continue;
- }
-
- status = NSS_CmpCertChainWCANames (cert, caNames);
- if (status == SECSuccess) {
- privkey = PK11_FindKeyByAnyCert (cert, proto_win);
- if (privkey)
- break;
-
- status = SECFailure;
- break;
- }
-
- CERT_FreeNicknames (names);
- }
- }
- }
-
- if (status == SECSuccess) {
- *pRetCert = cert;
- *pRetKey = privkey;
- }
-
- return status;
-}
-#endif
-
-#if 0
-/* Since this is the default NSS implementation, no need for us to use this. */
-static SECStatus
-ssl_auth_cert (void *data, PRFileDesc *sockfd, PRBool checksig, PRBool is_server)
-{
- CERTCertificate *cert;
- SECStatus status;
- void *pinarg;
- char *host;
-
- cert = SSL_PeerCertificate (sockfd);
- pinarg = SSL_RevealPinArg (sockfd);
- status = CERT_VerifyCertNow ((CERTCertDBHandle *)data, cert,
- checksig, certUsageSSLClient, pinarg);
-
- if (status != SECSuccess)
- return SECFailure;
-
- /* Certificate is OK. Since this is the client side of an SSL
- * connection, we need to verify that the name field in the cert
- * matches the desired hostname. This is our defense against
- * man-in-the-middle attacks.
- */
-
- /* SSL_RevealURL returns a hostname, not a URL. */
- host = SSL_RevealURL (sockfd);
-
- if (host && *host) {
- status = CERT_VerifyCertName (cert, host);
- } else {
- PR_SetError (SSL_ERROR_BAD_CERT_DOMAIN, 0);
- status = SECFailure;
- }
-
- if (host)
- PR_Free (host);
-
- return secStatus;
-}
-#endif
-
-CamelCert *camel_certdb_nss_cert_get(CamelCertDB *certdb, CERTCertificate *cert);
-CamelCert *camel_certdb_nss_cert_add(CamelCertDB *certdb, CERTCertificate *cert);
-void camel_certdb_nss_cert_set(CamelCertDB *certdb, CamelCert *ccert, CERTCertificate *cert);
-
-static char *
-cert_fingerprint(CERTCertificate *cert)
-{
- unsigned char md5sum[16], fingerprint[50], *f;
- int i;
- const char tohex[16] = "0123456789abcdef";
-
- md5_get_digest (cert->derCert.data, cert->derCert.len, md5sum);
- for (i=0,f = fingerprint; i<16; i++) {
- unsigned int c = md5sum[i];
-
- *f++ = tohex[(c >> 4) & 0xf];
- *f++ = tohex[c & 0xf];
- *f++ = ':';
- }
-
- fingerprint[47] = 0;
-
- return g_strdup(fingerprint);
-}
-
-/* lookup a cert uses fingerprint to index an on-disk file */
-CamelCert *
-camel_certdb_nss_cert_get(CamelCertDB *certdb, CERTCertificate *cert)
-{
- char *fingerprint, *path;
- CamelCert *ccert;
- struct stat st;
- size_t nread;
- ssize_t n;
- int fd;
-
- fingerprint = cert_fingerprint (cert);
- ccert = camel_certdb_get_cert (certdb, fingerprint);
- if (ccert == NULL) {
- g_free (fingerprint);
- return ccert;
- }
-
- if (ccert->rawcert == NULL) {
- path = g_strdup_printf ("%s/.camel_certs/%s", getenv ("HOME"), fingerprint);
- if (stat (path, &st) == -1
- || (fd = open (path, O_RDONLY)) == -1) {
- g_warning ("could not load cert %s: %s", path, strerror (errno));
- g_free (fingerprint);
- g_free (path);
- camel_cert_set_trust (certdb, ccert, CAMEL_CERT_TRUST_UNKNOWN);
- camel_certdb_touch (certdb);
-
- return ccert;
- }
- g_free(path);
-
- ccert->rawcert = g_byte_array_new ();
- g_byte_array_set_size (ccert->rawcert, st.st_size);
-
- nread = 0;
- do {
- do {
- n = read (fd, ccert->rawcert->data + nread, st.st_size - nread);
- } while (n == -1 && errno == EINTR);
-
- if (n > 0)
- nread += n;
- } while (nread < st.st_size && n != -1);
-
- close (fd);
-
- if (nread != st.st_size) {
- g_warning ("cert size read truncated %s: %d != %ld", path, nread, st.st_size);
- g_byte_array_free(ccert->rawcert, TRUE);
- ccert->rawcert = NULL;
- g_free(fingerprint);
- camel_cert_set_trust(certdb, ccert, CAMEL_CERT_TRUST_UNKNOWN);
- camel_certdb_touch(certdb);
-
- return ccert;
- }
- }
-
- g_free(fingerprint);
- if (ccert->rawcert->len != cert->derCert.len
- || memcmp(ccert->rawcert->data, cert->derCert.data, cert->derCert.len) != 0) {
- g_warning("rawcert != derCer");
- camel_cert_set_trust(certdb, ccert, CAMEL_CERT_TRUST_UNKNOWN);
- camel_certdb_touch(certdb);
- }
-
- return ccert;
-}
-
-/* add a cert to the certdb */
-CamelCert *
-camel_certdb_nss_cert_add(CamelCertDB *certdb, CERTCertificate *cert)
-{
- CamelCert *ccert;
- char *fingerprint;
-
- fingerprint = cert_fingerprint(cert);
-
- ccert = camel_certdb_cert_new(certdb);
- camel_cert_set_issuer(certdb, ccert, CERT_NameToAscii(&cert->issuer));
- camel_cert_set_subject(certdb, ccert, CERT_NameToAscii(&cert->subject));
- /* hostname is set in caller */
- /*camel_cert_set_hostname(certdb, ccert, ssl->priv->expected_host);*/
- camel_cert_set_fingerprint(certdb, ccert, fingerprint);
- camel_cert_set_trust(certdb, ccert, CAMEL_CERT_TRUST_UNKNOWN);
- g_free(fingerprint);
-
- camel_certdb_nss_cert_set(certdb, ccert, cert);
-
- camel_certdb_add(certdb, ccert);
-
- return ccert;
-}
-
-/* set the 'raw' cert (& save it) */
-void
-camel_certdb_nss_cert_set(CamelCertDB *certdb, CamelCert *ccert, CERTCertificate *cert)
-{
- char *dir, *path, *fingerprint;
- CamelStream *stream;
- struct stat st;
-
- fingerprint = ccert->fingerprint;
-
- if (ccert->rawcert == NULL)
- ccert->rawcert = g_byte_array_new ();
-
- g_byte_array_set_size (ccert->rawcert, cert->derCert.len);
- memcpy (ccert->rawcert->data, cert->derCert.data, cert->derCert.len);
-
- dir = g_strdup_printf ("%s/.camel_certs", getenv ("HOME"));
- if (stat (dir, &st) == -1 && mkdir (dir, 0700) == -1) {
- g_warning ("Could not create cert directory '%s': %s", dir, strerror (errno));
- g_free (dir);
- return;
- }
-
- path = g_strdup_printf ("%s/%s", dir, fingerprint);
- g_free (dir);
-
- stream = camel_stream_fs_new_with_name (path, O_WRONLY | O_CREAT | O_TRUNC, 0600);
- if (stream != NULL) {
- if (camel_stream_write (stream, ccert->rawcert->data, ccert->rawcert->len) == -1) {
- g_warning ("Could not save cert: %s: %s", path, strerror (errno));
- unlink (path);
- }
- camel_stream_close (stream);
- camel_object_unref (stream);
- } else {
- g_warning ("Could not save cert: %s: %s", path, strerror (errno));
- }
-
- g_free (path);
-}
-
-
-#if 0
-/* used by the mozilla-like code below */
-static char *
-get_nickname(CERTCertificate *cert)
-{
- char *server, *nick = NULL;
- int i;
- PRBool status = PR_TRUE;
-
- server = CERT_GetCommonName(&cert->subject);
- if (server == NULL)
- return NULL;
-
- for (i=1;status == PR_TRUE;i++) {
- if (nick) {
- g_free(nick);
- nick = g_strdup_printf("%s #%d", server, i);
- } else {
- nick = g_strdup(server);
- }
- status = SEC_CertNicknameConflict(server, &cert->derSubject, cert->dbhandle);
- }
-
- return nick;
-}
-#endif
-
-static SECStatus
-ssl_bad_cert (void *data, PRFileDesc *sockfd)
-{
- gboolean accept;
- CamelCertDB *certdb = NULL;
- CamelCert *ccert = NULL;
- char *prompt, *cert_str, *fingerprint;
- CamelTcpStreamSSL *ssl;
- CERTCertificate *cert;
- SECStatus status = SECFailure;
-
- g_return_val_if_fail (data != NULL, SECFailure);
- g_return_val_if_fail (CAMEL_IS_TCP_STREAM_SSL (data), SECFailure);
-
- ssl = data;
-
- cert = SSL_PeerCertificate (sockfd);
- if (cert == NULL)
- return SECFailure;
-
- certdb = camel_certdb_get_default();
- ccert = camel_certdb_nss_cert_get(certdb, cert);
- if (ccert == NULL) {
- ccert = camel_certdb_nss_cert_add(certdb, cert);
- camel_cert_set_hostname(certdb, ccert, ssl->priv->expected_host);
- }
-
- if (ccert->trust == CAMEL_CERT_TRUST_UNKNOWN) {
- status = CERT_VerifyCertNow(cert->dbhandle, cert, TRUE, certUsageSSLClient, NULL);
- fingerprint = cert_fingerprint(cert);
- cert_str = g_strdup_printf (_("Issuer: %s\n"
- "Subject: %s\n"
- "Fingerprint: %s\n"
- "Signature: %s"),
- CERT_NameToAscii (&cert->issuer),
- CERT_NameToAscii (&cert->subject),
- fingerprint, status == SECSuccess?_("GOOD"):_("BAD"));
- g_free(fingerprint);
-
- /* construct our user prompt */
- prompt = g_strdup_printf (_("SSL Certificate check for %s:\n\n%s\n\nDo you wish to accept?"),
- ssl->priv->expected_host, cert_str);
- g_free (cert_str);
-
- /* query the user to find out if we want to accept this certificate */
- accept = camel_session_alert_user (ssl->priv->session, CAMEL_SESSION_ALERT_WARNING, prompt, TRUE);
- g_free(prompt);
- if (accept) {
- camel_certdb_nss_cert_set(certdb, ccert, cert);
- camel_cert_set_trust(certdb, ccert, CAMEL_CERT_TRUST_FULLY);
- camel_certdb_touch(certdb);
- }
- } else {
- accept = ccert->trust != CAMEL_CERT_TRUST_NEVER;
- }
-
- camel_certdb_cert_unref(certdb, ccert);
- camel_object_unref(certdb);
-
- return accept ? SECSuccess : SECFailure;
-
-#if 0
- int i, error;
- CERTCertTrust trust;
- SECItem *certs[1];
- int go = 1;
- char *host, *nick;
-
- error = PR_GetError();
-
- /* This code is basically what mozilla does - however it doesn't seem to work here
- very reliably :-/ */
- while (go && status != SECSuccess) {
- char *prompt = NULL;
-
- printf("looping, error '%d'\n", error);
-
- switch(error) {
- case SEC_ERROR_UNKNOWN_ISSUER:
- case SEC_ERROR_CA_CERT_INVALID:
- case SEC_ERROR_UNTRUSTED_ISSUER:
- case SEC_ERROR_EXPIRED_ISSUER_CERTIFICATE:
- /* add certificate */
- printf("unknown issuer, adding ... \n");
- prompt = g_strdup_printf(_("Certificate problem: %s\nIssuer: %s"), cert->subjectName, cert->issuerName);
-
- if (camel_session_alert_user(ssl->priv->session, CAMEL_SESSION_ALERT_WARNING, prompt, TRUE)) {
-
- nick = get_nickname(cert);
- if (NULL == nick) {
- g_free(prompt);
- status = SECFailure;
- break;
- }
-
- printf("adding cert '%s'\n", nick);
-
- if (!cert->trust) {
- cert->trust = (CERTCertTrust*)PORT_ArenaZAlloc(cert->arena, sizeof(CERTCertTrust));
- CERT_DecodeTrustString(cert->trust, "P");
- }
-
- certs[0] = &cert->derCert;
- /*CERT_ImportCerts (cert->dbhandle, certUsageSSLServer, 1, certs, NULL, TRUE, FALSE, nick);*/
- CERT_ImportCerts(cert->dbhandle, certUsageUserCertImport, 1, certs, NULL, TRUE, FALSE, nick);
- g_free(nick);
-
- printf(" cert type %08x\n", cert->nsCertType);
-
- memset((void*)&trust, 0, sizeof(trust));
- if (CERT_GetCertTrust(cert, &trust) != SECSuccess) {
- CERT_DecodeTrustString(&trust, "P");
- }
- trust.sslFlags |= CERTDB_VALID_PEER | CERTDB_TRUSTED;
- if (CERT_ChangeCertTrust(cert->dbhandle, cert, &trust) != SECSuccess) {
- printf("couldn't change cert trust?\n");
- }
-
- /*status = SECSuccess;*/
-#if 1
- /* re-verify? */
- status = CERT_VerifyCertNow(cert->dbhandle, cert, TRUE, certUsageSSLServer, NULL);
- error = PR_GetError();
- printf("re-verify status %d, error %d\n", status, error);
-#endif
-
- printf(" cert type %08x\n", cert->nsCertType);
- } else {
- printf("failed/cancelled\n");
- go = 0;
- }
-
- break;
- case SSL_ERROR_BAD_CERT_DOMAIN:
- printf("bad domain\n");
-
- prompt = g_strdup_printf(_("Bad certificate domain: %s\nIssuer: %s"), cert->subjectName, cert->issuerName);
-
- if (camel_session_alert_user (ssl->priv->session, CAMEL_SESSION_ALERT_WARNING, prompt, TRUE)) {
- host = SSL_RevealURL(sockfd);
- status = CERT_AddOKDomainName(cert, host);
- printf("add ok domain name : %s\n", status == SECFailure?"fail":"ok");
- error = PR_GetError();
- if (status == SECFailure)
- go = 0;
- } else {
- go = 0;
- }
-
- break;
-
- case SEC_ERROR_EXPIRED_CERTIFICATE:
- printf("expired\n");
-
- prompt = g_strdup_printf(_("Certificate expired: %s\nIssuer: %s"), cert->subjectName, cert->issuerName);
-
- if (camel_session_alert_user(ssl->priv->session, CAMEL_SESSION_ALERT_WARNING, prompt, TRUE)) {
- cert->timeOK = PR_TRUE;
- status = CERT_VerifyCertNow(cert->dbhandle, cert, TRUE, certUsageSSLClient, NULL);
- error = PR_GetError();
- if (status == SECFailure)
- go = 0;
- } else {
- go = 0;
- }
-
- break;
-
- case SEC_ERROR_CRL_EXPIRED:
- printf("crl expired\n");
-
- prompt = g_strdup_printf(_("Certificate revocation list expired: %s\nIssuer: %s"), cert->subjectName, cert->issuerName);
-
- if (camel_session_alert_user(ssl->priv->session, CAMEL_SESSION_ALERT_WARNING, prompt, TRUE)) {
- host = SSL_RevealURL(sockfd);
- status = CERT_AddOKDomainName(cert, host);
- }
-
- go = 0;
- break;
-
- default:
- printf("generic error\n");
- go = 0;
- break;
- }
-
- g_free(prompt);
- }
-
- CERT_DestroyCertificate(cert);
-
- return status;
-#endif
-}
-
-static PRFileDesc *
-enable_ssl (CamelTcpStreamSSL *ssl, PRFileDesc *fd)
-{
- PRFileDesc *ssl_fd;
-
- ssl_fd = SSL_ImportFD (NULL, fd ? fd : ssl->priv->sockfd);
- if (!ssl_fd)
- return NULL;
-
- SSL_OptionSet (ssl_fd, SSL_SECURITY, PR_TRUE);
- if (ssl->priv->flags & CAMEL_TCP_STREAM_SSL_ENABLE_SSL2)
- SSL_OptionSet (ssl_fd, SSL_ENABLE_SSL2, PR_TRUE);
- else
- SSL_OptionSet (ssl_fd, SSL_ENABLE_SSL2, PR_FALSE);
- if (ssl->priv->flags & CAMEL_TCP_STREAM_SSL_ENABLE_SSL3)
- SSL_OptionSet (ssl_fd, SSL_ENABLE_SSL3, PR_TRUE);
- else
- SSL_OptionSet (ssl_fd, SSL_ENABLE_SSL3, PR_FALSE);
- if (ssl->priv->flags & CAMEL_TCP_STREAM_SSL_ENABLE_TLS)
- SSL_OptionSet (ssl_fd, SSL_ENABLE_TLS, PR_TRUE);
- else
- SSL_OptionSet (ssl_fd, SSL_ENABLE_TLS, PR_FALSE);
-
- SSL_SetURL (ssl_fd, ssl->priv->expected_host);
-
- /*SSL_GetClientAuthDataHook (sslSocket, ssl_get_client_auth, (void *) certNickname);*/
- /*SSL_AuthCertificateHook (ssl_fd, ssl_auth_cert, (void *) CERT_GetDefaultCertDB ());*/
- SSL_BadCertHook (ssl_fd, ssl_bad_cert, ssl);
-
- ssl->priv->ssl_mode = TRUE;
-
- return ssl_fd;
-}
-
-#define CONNECT_TIMEOUT PR_TicksPerSecond () * 120
-
-static int
-stream_connect (CamelTcpStream *stream, struct hostent *host, int port)
-{
- CamelTcpStreamSSL *ssl = CAMEL_TCP_STREAM_SSL (stream);
- PRIntervalTime timeout = CONNECT_TIMEOUT;
- PRNetAddr netaddr;
- PRFileDesc *fd;
-
- g_return_val_if_fail (host != NULL, -1);
-
- memset ((void *) &netaddr, 0, sizeof (PRNetAddr));
-#ifdef ENABLE_IPv6
- if (host->h_addrtype == AF_INET6)
- memcpy (&netaddr.ipv6.ip, host->h_addr, sizeof (netaddr.ipv6.ip));
- else
- memcpy (&netaddr.inet.ip, host->h_addr, sizeof (netaddr.inet.ip));
-#else
- memcpy (&netaddr.inet.ip, host->h_addr, sizeof (netaddr.inet.ip));
-#endif
-
- if (PR_InitializeNetAddr (PR_IpAddrNull, port, &netaddr) == PR_FAILURE) {
- set_errno (PR_GetError ());
- return -1;
- }
-
- fd = PR_OpenTCPSocket (host->h_addrtype);
- if (fd == NULL) {
- set_errno (PR_GetError ());
- return -1;
- }
-
- if (ssl->priv->ssl_mode) {
- PRFileDesc *ssl_fd;
-
- ssl_fd = enable_ssl (ssl, fd);
- if (ssl_fd == NULL) {
- int errnosave;
-
- set_errno (PR_GetError ());
- errnosave = errno;
- PR_Close (fd);
- errno = errnosave;
-
- return -1;
- }
-
- fd = ssl_fd;
- }
-
- if (PR_Connect (fd, &netaddr, timeout) == PR_FAILURE) {
- int errnosave;
-
- set_errno (PR_GetError ());
- if (errno == EINPROGRESS) {
- gboolean connected = FALSE;
- PRPollDesc poll;
-
- do {
- poll.fd = fd;
- poll.in_flags = PR_POLL_WRITE | PR_POLL_EXCEPT;
- poll.out_flags = 0;
-
- timeout = CONNECT_TIMEOUT;
-
- if (PR_Poll (&poll, 1, timeout) == PR_FAILURE) {
- set_errno (PR_GetError ());
- goto exception;
- }
-
- if (PR_GetConnectStatus (&poll) == PR_FAILURE) {
- set_errno (PR_GetError ());
- if (errno != EINPROGRESS)
- goto exception;
- } else {
- connected = TRUE;
- }
- } while (!connected);
- } else {
- exception:
- errnosave = errno;
- PR_Close (fd);
- ssl->priv->sockfd = NULL;
- errno = errnosave;
-
- return -1;
- }
-
- errno = 0;
- }
-
- ssl->priv->sockfd = fd;
-
- return 0;
-}
-
-
-static int
-stream_getsockopt (CamelTcpStream *stream, CamelSockOptData *data)
-{
- PRSocketOptionData sodata;
-
- memset ((void *) &sodata, 0, sizeof (sodata));
- memcpy ((void *) &sodata, (void *) data, sizeof (CamelSockOptData));
-
- if (PR_GetSocketOption (((CamelTcpStreamSSL *)stream)->priv->sockfd, &sodata) == PR_FAILURE)
- return -1;
-
- memcpy ((void *) data, (void *) &sodata, sizeof (CamelSockOptData));
-
- return 0;
-}
-
-static int
-stream_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data)
-{
- PRSocketOptionData sodata;
-
- memset ((void *) &sodata, 0, sizeof (sodata));
- memcpy ((void *) &sodata, (void *) data, sizeof (CamelSockOptData));
-
- if (PR_SetSocketOption (((CamelTcpStreamSSL *)stream)->priv->sockfd, &sodata) == PR_FAILURE)
- return -1;
-
- return 0;
-}
-
-static CamelTcpAddress *
-stream_get_local_address (CamelTcpStream *stream)
-{
- PRFileDesc *sockfd = CAMEL_TCP_STREAM_SSL (stream)->priv->sockfd;
- int family, length;
- gpointer address;
- PRNetAddr addr;
-
- PR_GetSockName (sockfd, &addr);
-
- if (addr.inet.family == PR_AF_INET) {
- family = CAMEL_TCP_ADDRESS_IPv4;
- address = &addr.inet.ip;
- length = 4;
-#ifdef ENABLE_IPv6
- } else if (addr.inet.family == PR_AF_INET6) {
- family = CAMEL_TCP_ADDRESS_IPv6;
- address = &addr.ipv6.ip;
- length = 16;
-#endif
- } else
- return NULL;
-
- return camel_tcp_address_new (family, addr.inet.port, length, address);
-}
-
-static CamelTcpAddress *
-stream_get_remote_address (CamelTcpStream *stream)
-{
- PRFileDesc *sockfd = CAMEL_TCP_STREAM_SSL (stream)->priv->sockfd;
- int family, length;
- gpointer address;
- PRNetAddr addr;
-
- PR_GetPeerName (sockfd, &addr);
-
- if (addr.inet.family == PR_AF_INET) {
- family = CAMEL_TCP_ADDRESS_IPv4;
- address = &addr.inet.ip;
- length = sizeof (addr.inet.ip);
-#ifdef ENABLE_IPv6
- } else if (addr.inet.family == PR_AF_INET6) {
- family = CAMEL_TCP_ADDRESS_IPv6;
- address = &addr.ipv6.ip;
- length = sizeof (addr.ipv6.ip);
-#endif
- } else
- return NULL;
-
- return camel_tcp_address_new (family, addr.inet.port, length, address);
-}
-
-#endif /* HAVE_NSS */
diff --git a/camel/camel-tcp-stream-ssl.h b/camel/camel-tcp-stream-ssl.h
deleted file mode 100644
index d11c2efdcb..0000000000
--- a/camel/camel-tcp-stream-ssl.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2001 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifndef CAMEL_TCP_STREAM_SSL_H
-#define CAMEL_TCP_STREAM_SSL_H
-
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <camel/camel-tcp-stream.h>
-
-#define CAMEL_TCP_STREAM_SSL_TYPE (camel_tcp_stream_ssl_get_type ())
-#define CAMEL_TCP_STREAM_SSL(obj) (CAMEL_CHECK_CAST((obj), CAMEL_TCP_STREAM_SSL_TYPE, CamelTcpStreamSSL))
-#define CAMEL_TCP_STREAM_SSL_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_TCP_STREAM_SSL_TYPE, CamelTcpStreamSSLClass))
-#define CAMEL_IS_TCP_STREAM_SSL(o) (CAMEL_CHECK_TYPE((o), CAMEL_TCP_STREAM_SSL_TYPE))
-
-struct _CamelSession;
-
-enum {
- CAMEL_TCP_STREAM_SSL_ENABLE_SSL2 = (1 << 0),
- CAMEL_TCP_STREAM_SSL_ENABLE_SSL3 = (1 << 1),
- CAMEL_TCP_STREAM_SSL_ENABLE_TLS = (1 << 2),
-};
-
-struct _CamelTcpStreamSSL {
- CamelTcpStream parent_object;
-
- struct _CamelTcpStreamSSLPrivate *priv;
-};
-
-typedef struct {
- CamelTcpStreamClass parent_class;
-
- /* virtual functions */
-
-} CamelTcpStreamSSLClass;
-
-/* Standard Camel function */
-CamelType camel_tcp_stream_ssl_get_type (void);
-
-/* public methods */
-CamelStream *camel_tcp_stream_ssl_new (struct _CamelSession *session, const char *expected_host, guint32 flags);
-
-CamelStream *camel_tcp_stream_ssl_new_raw (struct _CamelSession *session, const char *expected_host, guint32 flags);
-
-int camel_tcp_stream_ssl_enable_ssl (CamelTcpStreamSSL *ssl);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_TCP_STREAM_SSL_H */
diff --git a/camel/camel-tcp-stream.c b/camel/camel-tcp-stream.c
deleted file mode 100644
index fbbcbec451..0000000000
--- a/camel/camel-tcp-stream.c
+++ /dev/null
@@ -1,249 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2001 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-
-#include "camel-tcp-stream.h"
-
-#define w(x)
-
-static CamelStreamClass *parent_class = NULL;
-
-/* Returns the class for a CamelTcpStream */
-#define CTS_CLASS(so) CAMEL_TCP_STREAM_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-
-static int tcp_connect (CamelTcpStream *stream, struct hostent *host, int port);
-static int tcp_getsockopt (CamelTcpStream *stream, CamelSockOptData *data);
-static int tcp_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data);
-static CamelTcpAddress *tcp_get_local_address (CamelTcpStream *stream);
-static CamelTcpAddress *tcp_get_remote_address (CamelTcpStream *stream);
-
-
-static void
-camel_tcp_stream_class_init (CamelTcpStreamClass *camel_tcp_stream_class)
-{
- /*CamelStreamClass *camel_stream_class = CAMEL_STREAM_CLASS (camel_tcp_stream_class);*/
-
- parent_class = CAMEL_STREAM_CLASS (camel_type_get_global_classfuncs (CAMEL_STREAM_TYPE));
-
- /* tcp stream methods */
- camel_tcp_stream_class->connect = tcp_connect;
- camel_tcp_stream_class->getsockopt = tcp_getsockopt;
- camel_tcp_stream_class->setsockopt = tcp_setsockopt;
- camel_tcp_stream_class->get_local_address = tcp_get_local_address;
- camel_tcp_stream_class->get_remote_address = tcp_get_remote_address;
-}
-
-static void
-camel_tcp_stream_init (void *o)
-{
- ;
-}
-
-CamelType
-camel_tcp_stream_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (CAMEL_STREAM_TYPE,
- "CamelTcpStream",
- sizeof (CamelTcpStream),
- sizeof (CamelTcpStreamClass),
- (CamelObjectClassInitFunc) camel_tcp_stream_class_init,
- NULL,
- (CamelObjectInitFunc) camel_tcp_stream_init,
- NULL);
- }
-
- return type;
-}
-
-
-static int
-tcp_connect (CamelTcpStream *stream, struct hostent *host, int port)
-{
- w(g_warning ("CamelTcpStream::connect called on default implementation"));
- return -1;
-}
-
-/**
- * camel_tcp_stream_connect:
- * @stream: a CamelTcpStream object.
- * @host: a hostent value
- * @port: port
- *
- * Create a socket and connect based upon the data provided.
- *
- * Return value: zero on success or -1 on fail.
- **/
-int
-camel_tcp_stream_connect (CamelTcpStream *stream, struct hostent *host, int port)
-{
- g_return_val_if_fail (CAMEL_IS_TCP_STREAM (stream), -1);
-
- return CTS_CLASS (stream)->connect (stream, host, port);
-}
-
-
-static int
-tcp_getsockopt (CamelTcpStream *stream, CamelSockOptData *data)
-{
- w(g_warning ("CamelTcpStream::getsockopt called on default implementation"));
- return -1;
-}
-
-
-/**
- * camel_tcp_stream_getsockopt:
- * @stream: tcp stream object
- * @data: socket option data
- *
- * Get the socket options set on the stream and populate #data.
- *
- * Return value: zero on success or -1 on fail.
- **/
-int
-camel_tcp_stream_getsockopt (CamelTcpStream *stream, CamelSockOptData *data)
-{
- g_return_val_if_fail (CAMEL_IS_TCP_STREAM (stream), -1);
-
- return CTS_CLASS (stream)->getsockopt (stream, data);
-}
-
-
-static int
-tcp_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data)
-{
- w(g_warning ("CamelTcpStream::setsockopt called on default implementation"));
- return -1;
-}
-
-
-/**
- * camel_tcp_stream_setsockopt:
- * @stream: tcp stream object
- * @data: socket option data
- *
- * Set the socket options contained in #data on the stream.
- *
- * Return value: zero on success or -1 on fail.
- **/
-int
-camel_tcp_stream_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data)
-{
- g_return_val_if_fail (CAMEL_IS_TCP_STREAM (stream), -1);
-
- return CTS_CLASS (stream)->setsockopt (stream, data);
-}
-
-
-static CamelTcpAddress *
-tcp_get_local_address (CamelTcpStream *stream)
-{
- w(g_warning ("CamelTcpStream::get_local_address called on default implementation"));
- return NULL;
-}
-
-/**
- * camel_tcp_stream_get_local_address:
- * @stream: tcp stream object
- *
- * Get the local address of @stream.
- *
- * Return value: the stream's local address (which must be freed with
- * camel_tcp_address_free()) if the stream is connected, or %NULL if not.
- **/
-CamelTcpAddress *
-camel_tcp_stream_get_local_address (CamelTcpStream *stream)
-{
- g_return_val_if_fail (CAMEL_IS_TCP_STREAM (stream), NULL);
-
- return CTS_CLASS (stream)->get_local_address (stream);
-}
-
-
-static CamelTcpAddress *
-tcp_get_remote_address (CamelTcpStream *stream)
-{
- w(g_warning ("CamelTcpStream::get_remote_address called on default implementation"));
- return NULL;
-}
-
-/**
- * camel_tcp_stream_get_remote_address:
- * @stream: tcp stream object
- *
- * Get the remote address of @stream.
- *
- * Return value: the stream's remote address (which must be freed with
- * camel_tcp_address_free()) if the stream is connected, or %NULL if not.
- **/
-CamelTcpAddress *
-camel_tcp_stream_get_remote_address (CamelTcpStream *stream)
-{
- g_return_val_if_fail (CAMEL_IS_TCP_STREAM (stream), NULL);
-
- return CTS_CLASS (stream)->get_remote_address (stream);
-}
-
-
-/**
- * camel_tcp_address_new:
- * @family: the address family
- * @port: the port number (in network byte order)
- * @length: the length of @address
- * @address: the address data (family dependent, in network byte order)
- *
- * Return value: a new CamelTcpAddress.
- **/
-CamelTcpAddress *
-camel_tcp_address_new (CamelTcpAddressFamily family, gushort port,
- gushort length, gpointer address)
-{
- CamelTcpAddress *addr;
-
- addr = g_malloc (sizeof (CamelTcpAddress) + length - 1);
- addr->family = family;
- addr->port = port;
- addr->length = length;
- memcpy (&addr->address, address, length);
-
- return addr;
-}
-
-
-/**
- * camel_tcp_address_free:
- * @address: the address
- *
- * Frees @address.
- **/
-void
-camel_tcp_address_free (CamelTcpAddress *address)
-{
- g_free (address);
-}
diff --git a/camel/camel-tcp-stream.h b/camel/camel-tcp-stream.h
deleted file mode 100644
index 9472da10ee..0000000000
--- a/camel/camel-tcp-stream.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2001 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifndef CAMEL_TCP_STREAM_H
-#define CAMEL_TCP_STREAM_H
-
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <netdb.h>
-#include <unistd.h>
-
-#include <camel/camel-stream.h>
-
-#define CAMEL_TCP_STREAM_TYPE (camel_tcp_stream_get_type ())
-#define CAMEL_TCP_STREAM(obj) (CAMEL_CHECK_CAST((obj), CAMEL_TCP_STREAM_TYPE, CamelTcpStream))
-#define CAMEL_TCP_STREAM_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_TCP_STREAM_TYPE, CamelTcpStreamClass))
-#define CAMEL_IS_TCP_STREAM(o) (CAMEL_CHECK_TYPE((o), CAMEL_TCP_STREAM_TYPE))
-
-typedef enum {
- CAMEL_SOCKOPT_NONBLOCKING, /* nonblocking io */
- CAMEL_SOCKOPT_LINGER, /* linger on close if data present */
- CAMEL_SOCKOPT_REUSEADDR, /* allow local address reuse */
- CAMEL_SOCKOPT_KEEPALIVE, /* keep connections alive */
- CAMEL_SOCKOPT_RECVBUFFERSIZE, /* receive buffer size */
- CAMEL_SOCKOPT_SENDBUFFERSIZE, /* send buffer size */
-
- CAMEL_SOCKOPT_IPTIMETOLIVE, /* time to live */
- CAMEL_SOCKOPT_IPTYPEOFSERVICE, /* type of service and precedence */
-
- CAMEL_SOCKOPT_ADDMEMBER, /* add an IP group membership */
- CAMEL_SOCKOPT_DROPMEMBER, /* drop an IP group membership */
- CAMEL_SOCKOPT_MCASTINTERFACE, /* multicast interface address */
- CAMEL_SOCKOPT_MCASTTIMETOLIVE, /* multicast timetolive */
- CAMEL_SOCKOPT_MCASTLOOPBACK, /* multicast loopback */
-
- CAMEL_SOCKOPT_NODELAY, /* don't delay send to coalesce packets */
- CAMEL_SOCKOPT_MAXSEGMENT, /* maximum segment size */
- CAMEL_SOCKOPT_BROADCAST, /* enable broadcast */
- CAMEL_SOCKOPT_LAST
-} CamelSockOpt;
-
-typedef struct linger CamelLinger;
-
-typedef struct _CamelSockOptData {
- CamelSockOpt option;
- union {
- guint ip_ttl; /* IP time to live */
- guint mcast_ttl; /* IP multicast time to live */
- guint tos; /* IP type of service and precedence */
- gboolean non_blocking; /* Non-blocking (network) I/O */
- gboolean reuse_addr; /* Allow local address reuse */
- gboolean keep_alive; /* Keep connections alive */
- gboolean mcast_loopback; /* IP multicast loopback */
- gboolean no_delay; /* Don't delay send to coalesce packets */
- gboolean broadcast; /* Enable broadcast */
- size_t max_segment; /* Maximum segment size */
- size_t recv_buffer_size; /* Receive buffer size */
- size_t send_buffer_size; /* Send buffer size */
- CamelLinger linger; /* Time to linger on close if data present */
- } value;
-} CamelSockOptData;
-
-typedef enum {
- CAMEL_TCP_ADDRESS_IPv4,
- CAMEL_TCP_ADDRESS_IPv6
-} CamelTcpAddressFamily;
-
-typedef struct {
- CamelTcpAddressFamily family;
- gushort port, length;
- guint8 address[1];
-} CamelTcpAddress;
-
-
-struct _CamelTcpStream {
- CamelStream parent_object;
-
-};
-
-typedef struct {
- CamelStreamClass parent_class;
-
- /* Virtual methods */
- int (*connect) (CamelTcpStream *stream, struct hostent *host, int port);
- int (*getsockopt) (CamelTcpStream *stream, CamelSockOptData *data);
- int (*setsockopt) (CamelTcpStream *stream, const CamelSockOptData *data);
-
- CamelTcpAddress * (*get_local_address) (CamelTcpStream *stream);
- CamelTcpAddress * (*get_remote_address) (CamelTcpStream *stream);
-} CamelTcpStreamClass;
-
-/* Standard Camel function */
-CamelType camel_tcp_stream_get_type (void);
-
-/* public methods */
-int camel_tcp_stream_connect (CamelTcpStream *stream, struct hostent *host, int port);
-int camel_tcp_stream_getsockopt (CamelTcpStream *stream, CamelSockOptData *data);
-int camel_tcp_stream_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data);
-
-CamelTcpAddress *camel_tcp_stream_get_local_address (CamelTcpStream *stream);
-CamelTcpAddress *camel_tcp_stream_get_remote_address (CamelTcpStream *stream);
-
-CamelTcpAddress *camel_tcp_address_new (CamelTcpAddressFamily family,
- gushort port, gushort length,
- gpointer address);
-void camel_tcp_address_free (CamelTcpAddress *address);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_TCP_STREAM_H */
diff --git a/camel/camel-text-index.c b/camel/camel-text-index.c
deleted file mode 100644
index 0e8b1ca96f..0000000000
--- a/camel/camel-text-index.c
+++ /dev/null
@@ -1,1948 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; fill-column: 160 -*- */
-/*
- * Copyright (C) 2001-2003 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/uio.h>
-#include <unistd.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <ctype.h>
-
-#include "e-util/e-msgport.h"
-#include "e-util/e-memory.h"
-
-#include "camel/camel-object.h"
-
-#include "camel-text-index.h"
-#include "camel-block-file.h"
-#include "camel-partition-table.h"
-
-#include <glib/gunicode.h>
-
-
-#define w(x)
-#define io(x)
-#define d(x) /*(printf("%s(%d):%s: ", __FILE__, __LINE__, __PRETTY_FUNCTION__),(x))*/
-
-/* cursor debug */
-#define c(x)
-
-#define CAMEL_TEXT_INDEX_MAX_WORDLEN (36)
-
-#define CAMEL_TEXT_INDEX_LOCK(kf, lock) (e_mutex_lock(((CamelTextIndex *)kf)->priv->lock))
-#define CAMEL_TEXT_INDEX_UNLOCK(kf, lock) (e_mutex_unlock(((CamelTextIndex *)kf)->priv->lock))
-
-static int text_index_compress_nosync(CamelIndex *idx);
-
-/* ********************************************************************** */
-
-/* "private" data, shared between index/cursor/name classes */
-typedef struct _CamelTextIndexNamePrivate CamelTextIndexNamePrivate;
-
-struct _CamelTextIndexNamePrivate {
- GString *buffer;
- camel_key_t nameid;
- EMemPool *pool;
-};
-
-CamelTextIndexName *camel_text_index_name_new(CamelTextIndex *idx, const char *name, camel_key_t nameid);
-
-/* ****************************** */
-
-typedef struct _CamelTextIndexCursorPrivate CamelTextIndexCursorPrivate;
-
-struct _CamelTextIndexCursorPrivate {
- camel_block_t first;
- camel_block_t next;
-
- int record_index;
-
- size_t record_count;
- camel_key_t *records;
-
- char *current;
-};
-
-CamelTextIndexCursor *camel_text_index_cursor_new(CamelTextIndex *idx, camel_block_t data);
-
-/* ****************************** */
-typedef struct _CamelTextIndexKeyCursorPrivate CamelTextIndexKeyCursorPrivate;
-
-struct _CamelTextIndexKeyCursorPrivate {
- CamelKeyTable *table;
-
- camel_key_t keyid;
- unsigned int flags;
- camel_block_t data;
- char *current;
-};
-
-CamelTextIndexKeyCursor *camel_text_index_key_cursor_new(CamelTextIndex *idx, CamelKeyTable *table);
-
-/* ********************************************************************** */
-
-#define CAMEL_TEXT_INDEX_VERSION "TEXT.000"
-#define CAMEL_TEXT_INDEX_KEY_VERSION "KEYS.000"
-
-struct _CamelTextIndexPrivate {
- CamelBlockFile *blocks;
- CamelKeyFile *links;
-
- CamelKeyTable *word_index;
- CamelPartitionTable *word_hash;
-
- CamelKeyTable *name_index;
- CamelPartitionTable *name_hash;
-
- /* Cache of words to write */
- int word_cache_limit;
- int word_cache_count;
- EDList word_cache;
- GHashTable *words;
- EMutex *lock;
-};
-
-/* Root block of text index */
-struct _CamelTextIndexRoot {
- struct _CamelBlockRoot root;
-
- /* FIXME: the index root could contain a pointer to the hash root */
- camel_block_t word_index_root; /* a keyindex containing the keyid -> word mapping */
- camel_block_t word_hash_root; /* a partitionindex containing word -> keyid mapping */
-
- camel_block_t name_index_root; /* same, for names */
- camel_block_t name_hash_root;
-
- guint32 words; /* total words */
- guint32 names; /* total names */
- guint32 deleted; /* deleted names */
- guint32 keys; /* total key 'chunks' written, used with deleted to determine fragmentation */
-};
-
-struct _CamelTextIndexWord {
- struct _CamelTextIndexWord *next;
- struct _CamelTextIndexWord *prev;
-
- camel_block_t data; /* where the data starts */
- camel_key_t wordid;
- char *word;
- unsigned int used;
- camel_key_t names[32];
-};
-
-#define CTI_PRIVATE(o) (((CamelTextIndex *)(o))->priv)
-
-#define CI_CLASS(o) ((CamelTextIndexClass *)(((CamelObject *)o)->classfuncs))
-
-/* ********************************************************************** */
-/* CamelTextIndex */
-/* ********************************************************************** */
-
-static CamelObjectClass *camel_text_index_parent;
-
-/* call locked */
-static void
-text_index_add_name_to_word(CamelIndex *idx, const char *word, camel_key_t nameid)
-{
- struct _CamelTextIndexWord *w, *wp, *ww;
- struct _CamelTextIndexPrivate *p = CTI_PRIVATE(idx);
- camel_key_t wordid;
- camel_block_t data;
- struct _CamelTextIndexRoot *rb = (struct _CamelTextIndexRoot *)p->blocks->root;
-
- w = g_hash_table_lookup(p->words, word);
- if (w == NULL) {
- wordid = camel_partition_table_lookup(p->word_hash, word);
- if (wordid == 0) {
- data = 0;
- wordid = camel_key_table_add(p->word_index, word, 0, 0);
- if (wordid == 0){
- g_warning ("Could not create key entry for word '%s': %s\n",
- word, strerror (errno));
- return;
- }
- if (camel_partition_table_add(p->word_hash, word, wordid) == -1) {
- g_warning ("Could not create hash entry for word '%s': %s\n",
- word, strerror (errno));
- return;
- }
- rb->words++;
- camel_block_file_touch_block(p->blocks, p->blocks->root_block);
- } else {
- data = camel_key_table_lookup(p->word_index, wordid, NULL, 0);
- if (data == 0) {
- g_warning ("Could not find key entry for word '%s': %s\n",
- word, strerror (errno));
- return;
- }
- }
-
- w = g_malloc0(sizeof(*w));
- w->word = g_strdup(word);
- w->wordid = wordid;
- w->used = 1;
- w->data = data;
-
- w->names[0] = nameid;
- g_hash_table_insert(p->words, w->word, w);
- e_dlist_addhead(&p->word_cache, (EDListNode *)w);
- p->word_cache_count++;
- ww = (struct _CamelTextIndexWord *)p->word_cache.tailpred;
- wp = ww->prev;
- while (wp && p->word_cache_count > p->word_cache_limit) {
- io(printf("writing key file entry '%s' [%x]\n", ww->word, ww->data));
- if (camel_key_file_write(p->links, &ww->data, ww->used, ww->names) != -1) {
- io(printf(" new data [%x]\n", ww->data));
- rb->keys++;
- camel_block_file_touch_block(p->blocks, p->blocks->root_block);
- /* if this call fails - we still point to the old data - not fatal */
- camel_key_table_set_data(p->word_index, ww->wordid, ww->data);
- e_dlist_remove((EDListNode *)ww);
- g_hash_table_remove(p->words, ww->word);
- g_free(ww->word);
- g_free(ww);
- p->word_cache_count--;
- }
- ww = wp;
- wp = wp->prev;
- }
- } else {
- e_dlist_remove((EDListNode *)w);
- e_dlist_addhead(&p->word_cache, (EDListNode *)w);
- w->names[w->used] = nameid;
- w->used++;
- if (w->used == sizeof(w->names)/sizeof(w->names[0])) {
- io(printf("writing key file entry '%s' [%x]\n", w->word, w->data));
- if (camel_key_file_write(p->links, &w->data, w->used, w->names) != -1) {
- rb->keys++;
- camel_block_file_touch_block(p->blocks, p->blocks->root_block);
- /* if this call fails - we still point to the old data - not fatal */
- camel_key_table_set_data(p->word_index, w->wordid, w->data);
- }
- /* FIXME: what to on error? lost data? */
- w->used = 0;
- }
- }
-}
-
-static int
-text_index_sync(CamelIndex *idx)
-{
- struct _CamelTextIndexPrivate *p = CTI_PRIVATE(idx);
- struct _CamelTextIndexWord *ww;
- struct _CamelTextIndexRoot *rb;
- int ret = 0, wfrag, nfrag, work = FALSE;
-
- d(printf("sync: blocks = %p\n", p->blocks));
-
- if (p->blocks == NULL)
- return 0;
-
- rb = (struct _CamelTextIndexRoot *)p->blocks->root;
-
- /* sync/flush word cache */
-
- CAMEL_TEXT_INDEX_LOCK(idx, lock);
-
- /* we sync, bump down the cache limits since we dont need them for reading */
- p->blocks->block_cache_limit = 128;
- /* this doesn't really need to be dropped, its only used in updates anyway */
- p->word_cache_limit = 1024;
-
- work = !e_dlist_empty(&p->word_cache);
-
- while ( (ww = (struct _CamelTextIndexWord *)e_dlist_remhead(&p->word_cache)) ) {
- if (ww->used > 0) {
- io(printf("writing key file entry '%s' [%x]\n", ww->word, ww->data));
- if (camel_key_file_write(p->links, &ww->data, ww->used, ww->names) != -1) {
- io(printf(" new data [%x]\n", ww->data));
- rb->keys++;
- camel_block_file_touch_block(p->blocks, p->blocks->root_block);
- camel_key_table_set_data(p->word_index, ww->wordid, ww->data);
- } else {
- ret = -1;
- }
- ww->used = 0;
- }
- g_hash_table_remove(p->words, ww->word);
- g_free(ww->word);
- g_free(ww);
- }
-
- if (camel_key_table_sync(p->word_index) == -1
- || camel_key_table_sync(p->name_index) == -1
- || camel_partition_table_sync(p->word_hash) == -1
- || camel_partition_table_sync(p->name_hash) == -1)
- ret = -1;
-
- /* only do the frag/compress check if we did some new writes on this index */
- wfrag = rb->words ? (((rb->keys - rb->words) * 100)/ rb->words) : 0;
- nfrag = rb->names ? ((rb->deleted * 100) / rb->names) : 0;
- d(printf("wfrag = %d, nfrag = %d, work = %s, ret = %d\n", wfrag, nfrag, work?"true":"false", ret));
- d(printf(" words = %d, keys = %d\n", rb->words, rb->keys));
-
- if (ret == 0) {
- if (wfrag > 30 || nfrag > 20)
- ret = text_index_compress_nosync(idx);
- }
-
- ret = camel_block_file_sync(p->blocks);
-
- CAMEL_TEXT_INDEX_UNLOCK(idx, lock);
-
- return ret;
-}
-
-static void tmp_name(const char *in, char *o)
-{
- char *s;
-
- s = strrchr(in, '/');
- if (s) {
- memcpy(o, in, s-in+1);
- memcpy(o+(s-in+1), ".#", 2);
- strcpy(o+(s-in+3), s+1);
- } else {
- sprintf(o, ".#%s", in);
- }
-}
-
-static int
-text_index_compress(CamelIndex *idx)
-{
- int ret;
-
- CAMEL_TEXT_INDEX_LOCK(idx, lock);
-
- ret = camel_index_sync(idx);
- if (ret != -1)
- ret = text_index_compress_nosync(idx);
-
- CAMEL_TEXT_INDEX_UNLOCK(idx, lock);
-
- return ret;
-}
-
-/* Attempt to recover index space by compressing the indices */
-static int
-text_index_compress_nosync(CamelIndex *idx)
-{
- CamelTextIndex *newidx;
- struct _CamelTextIndexPrivate *newp, *oldp;
- camel_key_t oldkeyid, newkeyid;
- GHashTable *remap;
- unsigned int deleted;
- camel_block_t data, newdata;
- int i, ret = -1;
- char *name = NULL;
- unsigned int flags;
- char *newpath, *savepath, *oldpath;
- size_t count, newcount;
- camel_key_t *records, newrecords[256];
- struct _CamelTextIndexRoot *rb;
-
- i = strlen(idx->path)+16;
- oldpath = alloca(i);
- newpath = alloca(i);
- savepath = alloca(i);
-
- strcpy(oldpath, idx->path);
- oldpath[strlen(oldpath)-strlen(".index")] = 0;
-
- tmp_name(oldpath, newpath);
- sprintf(savepath, "%s~", oldpath);
-
- d(printf("Old index: %s\n", idx->path));
- d(printf("Old path: %s\n", oldpath));
- d(printf("New: %s\n", newpath));
- d(printf("Save: %s\n", savepath));
-
- newidx = camel_text_index_new(newpath, O_RDWR|O_CREAT);
- if (newidx == NULL)
- return -1;
-
- newp = CTI_PRIVATE(newidx);
- oldp = CTI_PRIVATE(idx);
-
- CAMEL_TEXT_INDEX_LOCK(idx, lock);
-
- rb = (struct _CamelTextIndexRoot *)newp->blocks->root;
-
- rb->words = 0;
- rb->names = 0;
- rb->deleted = 0;
- rb->keys = 0;
-
- /* Process:
- For each name we still have:
- Add it to the new index & setup remap table
-
- For each word:
- Copy word's data to a new file
- Add new word to index(*) (can we just copy blocks?) */
-
- /* Copy undeleted names to new index file, creating new indices */
- io(printf("Copying undeleted names to new file\n"));
- remap = g_hash_table_new(NULL, NULL);
- oldkeyid = 0;
- deleted = 0;
- while ( (oldkeyid = camel_key_table_next(oldp->name_index, oldkeyid, &name, &flags, &data)) ) {
- if ((flags&1) == 0) {
- io(printf("copying name '%s'\n", name));
- newkeyid = camel_key_table_add(newp->name_index, name, data, flags);
- if (newkeyid == 0)
- goto fail;
- rb->names++;
- camel_partition_table_add(newp->name_hash, name, newkeyid);
- g_hash_table_insert(remap, GINT_TO_POINTER(oldkeyid), GINT_TO_POINTER(newkeyid));
- } else
- io(printf("deleted name '%s'\n", name));
- g_free(name);
- name = NULL;
- deleted |= flags;
- }
-
- /* Copy word data across, remapping/deleting and create new index for it */
- /* We re-block the data into 256 entry lots while we're at it, since we only
- have to do 1 at a time and its cheap */
- oldkeyid = 0;
- while ( (oldkeyid = camel_key_table_next(oldp->word_index, oldkeyid, &name, &flags, &data)) ) {
- io(printf("copying word '%s'\n", name));
- newdata = 0;
- newcount = 0;
- if (data) {
- rb->words++;
- rb->keys++;
- }
- while (data) {
- if (camel_key_file_read(oldp->links, &data, &count, &records) == -1) {
- io(printf("could not read from old keys at %d for word '%s'\n", (int)data, name));
- goto fail;
- }
- for (i=0;i<count;i++) {
- newkeyid = (camel_key_t)GPOINTER_TO_INT(g_hash_table_lookup(remap, GINT_TO_POINTER(records[i])));
- if (newkeyid) {
- newrecords[newcount++] = newkeyid;
- if (newcount == sizeof(newrecords)/sizeof(newrecords[0])) {
- if (camel_key_file_write(newp->links, &newdata, newcount, newrecords) == -1) {
- g_free(records);
- goto fail;
- }
- newcount = 0;
- }
- }
- }
- g_free(records);
- }
-
- if (newcount > 0) {
- if (camel_key_file_write(newp->links, &newdata, newcount, newrecords) == -1)
- goto fail;
- }
-
- if (newdata != 0) {
- newkeyid = camel_key_table_add(newp->word_index, name, newdata, flags);
- if (newkeyid == 0)
- goto fail;
- camel_partition_table_add(newp->word_hash, name, newkeyid);
- }
- g_free(name);
- name = NULL;
- }
-
- camel_block_file_touch_block(newp->blocks, newp->blocks->root_block);
-
- if (camel_index_sync((CamelIndex *)newidx) == -1)
- goto fail;
-
- /* Rename underlying files to match */
- ret = camel_index_rename(idx, savepath);
- if (ret == -1)
- goto fail;
-
- /* If this fails, we'll pick up something during restart? */
- ret = camel_index_rename((CamelIndex *)newidx, oldpath);
-
-#define myswap(a, b) { void *tmp = a; a = b; b = tmp; }
- /* Poke the private data across to the new object */
- /* And change the fd's over, etc? */
- /* Yes: This is a hack */
- myswap(newp->blocks, oldp->blocks);
- myswap(newp->links, oldp->links);
- myswap(newp->word_index, oldp->word_index);
- myswap(newp->word_hash, oldp->word_hash);
- myswap(newp->name_index, oldp->name_index);
- myswap(newp->name_hash, oldp->name_hash);
- myswap(((CamelIndex *)newidx)->path, ((CamelIndex *)idx)->path);
-#undef myswap
-
- ret = 0;
-fail:
- CAMEL_TEXT_INDEX_UNLOCK(idx, lock);
-
- camel_index_delete((CamelIndex *)newidx);
-
- camel_object_unref((CamelObject *)newidx);
- g_free(name);
- g_hash_table_destroy(remap);
-
- /* clean up temp files always */
- sprintf(savepath, "%s~.index", oldpath);
- unlink(savepath);
- sprintf(newpath, "%s.data", savepath);
- unlink(newpath);
-
- return ret;
-}
-
-static int
-text_index_delete(CamelIndex *idx)
-{
- struct _CamelTextIndexPrivate *p = CTI_PRIVATE(idx);
- int ret = 0;
-
- if (camel_block_file_delete(p->blocks) == -1)
- ret = -1;
- if (camel_key_file_delete(p->links) == -1)
- ret = -1;
-
- return ret;
-}
-
-static int
-text_index_rename(CamelIndex *idx, const char *path)
-{
- struct _CamelTextIndexPrivate *p = CTI_PRIVATE(idx);
- char *newlink, *newblock;
- int err, ret;
-
- CAMEL_TEXT_INDEX_LOCK(idx, lock);
-
- newblock = alloca(strlen(path)+8);
- sprintf(newblock, "%s.index", path);
- ret = camel_block_file_rename(p->blocks, newblock);
- if (ret == -1) {
- CAMEL_TEXT_INDEX_UNLOCK(idx, lock);
- return -1;
- }
-
- newlink = alloca(strlen(path)+16);
- sprintf(newlink, "%s.index.data", path);
- ret = camel_key_file_rename(p->links, newlink);
- if (ret == -1) {
- err = errno;
- camel_block_file_rename(p->blocks, idx->path);
- CAMEL_TEXT_INDEX_UNLOCK(idx, lock);
- errno = err;
- return -1;
- }
-
- g_free(idx->path);
- idx->path = g_strdup(newblock);
-
- CAMEL_TEXT_INDEX_UNLOCK(idx, lock);
-
- return 0;
-}
-
-static int
-text_index_has_name(CamelIndex *idx, const char *name)
-{
- struct _CamelTextIndexPrivate *p = CTI_PRIVATE(idx);
-
- return camel_partition_table_lookup(p->name_hash, name) != 0;
-}
-
-static CamelIndexName *
-text_index_add_name(CamelIndex *idx, const char *name)
-{
- struct _CamelTextIndexPrivate *p = CTI_PRIVATE(idx);
- camel_key_t keyid;
- CamelIndexName *idn;
- struct _CamelTextIndexRoot *rb = (struct _CamelTextIndexRoot *)p->blocks->root;
-
- CAMEL_TEXT_INDEX_LOCK(idx, lock);
-
- /* if we're adding words, up the cache limits a lot */
- if (p->blocks) {
- p->blocks->block_cache_limit = 1024;
- p->word_cache_limit = 8192;
- }
-
- /* If we have it already replace it */
- keyid = camel_partition_table_lookup(p->name_hash, name);
- if (keyid != 0) {
- /* TODO: We could just update the partition table's
- key pointer rather than having to delete it */
- rb->deleted++;
- camel_key_table_set_flags(p->name_index, keyid, 1, 1);
- camel_partition_table_remove(p->name_hash, name);
- }
-
- keyid = camel_key_table_add(p->name_index, name, 0, 0);
- if (keyid != 0) {
- camel_partition_table_add(p->name_hash, name, keyid);
- rb->names++;
- }
-
- camel_block_file_touch_block(p->blocks, p->blocks->root_block);
-
- /* TODO: if keyid == 0, we had a failure, we should somehow flag that, but for
- now just return a valid object but discard its results, see text_index_write_name */
-
- CAMEL_TEXT_INDEX_UNLOCK(idx, lock);
-
- idn = (CamelIndexName *)camel_text_index_name_new((CamelTextIndex *)idx, name, keyid);
-
- return idn;
-}
-
-/* call locked */
-static void
-hash_write_word(char *word, void *data, CamelIndexName *idn)
-{
- CamelTextIndexName *tin = (CamelTextIndexName *)idn;
-
- text_index_add_name_to_word(idn->index, word, tin->priv->nameid);
-}
-
-static int
-text_index_write_name(CamelIndex *idx, CamelIndexName *idn)
-{
- /* force 'flush' of any outstanding data */
- camel_index_name_add_buffer(idn, NULL, 0);
-
- /* see text_index_add_name for when this can be 0 */
- if (((CamelTextIndexName *)idn)->priv->nameid != 0) {
- CAMEL_TEXT_INDEX_LOCK(idx, lock);
-
- g_hash_table_foreach(idn->words, (GHFunc)hash_write_word, idn);
-
- CAMEL_TEXT_INDEX_UNLOCK(idx, lock);
- }
-
- return 0;
-}
-
-static CamelIndexCursor *
-text_index_find_name(CamelIndex *idx, const char *name)
-{
- /* what was this for, umm */
- return NULL;
-}
-
-static void
-text_index_delete_name(CamelIndex *idx, const char *name)
-{
- struct _CamelTextIndexPrivate *p = CTI_PRIVATE(idx);
- camel_key_t keyid;
- struct _CamelTextIndexRoot *rb = (struct _CamelTextIndexRoot *)p->blocks->root;
-
- d(printf("Delete name: %s\n", name));
-
- /* probably doesn't really need locking, but oh well */
- CAMEL_TEXT_INDEX_LOCK(idx, lock);
-
- /* We just mark the key deleted, and remove it from the hash table */
- keyid = camel_partition_table_lookup(p->name_hash, name);
- if (keyid != 0) {
- rb->deleted++;
- camel_block_file_touch_block(p->blocks, p->blocks->root_block);
- camel_key_table_set_flags(p->name_index, keyid, 1, 1);
- camel_partition_table_remove(p->name_hash, name);
- }
-
- CAMEL_TEXT_INDEX_UNLOCK(idx, lock);
-}
-
-static CamelIndexCursor *
-text_index_find(CamelIndex *idx, const char *word)
-{
- struct _CamelTextIndexPrivate *p = CTI_PRIVATE(idx);
- camel_key_t keyid;
- camel_block_t data = 0;
- unsigned int flags;
- CamelIndexCursor *idc;
-
- CAMEL_TEXT_INDEX_LOCK(idx, lock);
-
- keyid = camel_partition_table_lookup(p->word_hash, word);
- if (keyid != 0) {
- data = camel_key_table_lookup(p->word_index, keyid, NULL, &flags);
- if (flags & 1)
- data = 0;
- }
-
- CAMEL_TEXT_INDEX_UNLOCK(idx, lock);
-
- idc = (CamelIndexCursor *)camel_text_index_cursor_new((CamelTextIndex *)idx, data);
-
- return idc;
-}
-
-static CamelIndexCursor *
-text_index_words(CamelIndex *idx)
-{
- struct _CamelTextIndexPrivate *p = CTI_PRIVATE(idx);
-
- return (CamelIndexCursor *)camel_text_index_key_cursor_new((CamelTextIndex *)idx, p->word_index);
-}
-
-static CamelIndexCursor *
-text_index_names(CamelIndex *idx)
-{
- struct _CamelTextIndexPrivate *p = CTI_PRIVATE(idx);
-
- return (CamelIndexCursor *)camel_text_index_key_cursor_new((CamelTextIndex *)idx, p->name_index);
-}
-
-static void
-camel_text_index_class_init(CamelTextIndexClass *klass)
-{
- CamelIndexClass *iklass = (CamelIndexClass *)klass;
-
- camel_text_index_parent = CAMEL_OBJECT_CLASS(camel_type_get_global_classfuncs(camel_object_get_type()));
-
- iklass->sync = text_index_sync;
- iklass->compress = text_index_compress;
- iklass->delete = text_index_delete;
-
- iklass->rename = text_index_rename;
-
- iklass->has_name = text_index_has_name;
- iklass->add_name = text_index_add_name;
- iklass->write_name = text_index_write_name;
- iklass->find_name = text_index_find_name;
- iklass->delete_name = text_index_delete_name;
- iklass->find = text_index_find;
-
- iklass->words = text_index_words;
- iklass->names = text_index_names;
-}
-
-static void
-camel_text_index_init(CamelTextIndex *idx)
-{
- struct _CamelTextIndexPrivate *p;
-
- p = CTI_PRIVATE(idx) = g_malloc0(sizeof(*p));
-
- e_dlist_init(&p->word_cache);
- p->words = g_hash_table_new(g_str_hash, g_str_equal);
- p->word_cache_count = 0;
- /* this cache size and the block cache size have been tuned for about the best
- with moderate memory usage. Doubling the memory usage barely affects performance. */
- p->word_cache_limit = 4096; /* 1024 = 128K */
-
- p->lock = e_mutex_new(E_MUTEX_REC);
-}
-
-static void
-camel_text_index_finalise(CamelTextIndex *idx)
-{
- struct _CamelTextIndexPrivate *p = CTI_PRIVATE(idx);
-
- camel_index_sync((CamelIndex *)idx);
-
- g_assert(e_dlist_empty(&p->word_cache));
- g_assert(g_hash_table_size(p->words) == 0);
-
- g_hash_table_destroy(p->words);
-
- if (p->word_index)
- camel_object_unref((CamelObject *)p->word_index);
- if (p->word_hash)
- camel_object_unref((CamelObject *)p->word_hash);
- if (p->name_index)
- camel_object_unref((CamelObject *)p->name_index);
- if (p->name_hash)
- camel_object_unref((CamelObject *)p->name_hash);
-
- if (p->blocks)
- camel_object_unref((CamelObject *)p->blocks);
- if (p->links)
- camel_object_unref((CamelObject *)p->links);
-
- e_mutex_destroy(p->lock);
-
- g_free(p);
-}
-
-CamelType
-camel_text_index_get_type(void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register(camel_index_get_type(), "CamelTextIndex",
- sizeof (CamelTextIndex),
- sizeof (CamelTextIndexClass),
- (CamelObjectClassInitFunc) camel_text_index_class_init,
- NULL,
- (CamelObjectInitFunc) camel_text_index_init,
- (CamelObjectFinalizeFunc) camel_text_index_finalise);
- }
-
- return type;
-}
-
-static char *
-text_index_normalise(CamelIndex *idx, const char *in, void *data)
-{
- char *word;
-
- /* Sigh, this is really expensive */
- /*g_utf8_normalize(in, strlen(in), G_NORMALIZE_ALL);*/
- word = g_utf8_strdown(in, -1);
-
- return word;
-}
-
-CamelTextIndex *
-camel_text_index_new(const char *path, int flags)
-{
- CamelTextIndex *idx = (CamelTextIndex *)camel_object_new(camel_text_index_get_type());
- struct _CamelTextIndexPrivate *p = CTI_PRIVATE(idx);
- struct _CamelTextIndexRoot *rb;
- char *link;
- CamelBlock *bl;
-
- camel_index_construct((CamelIndex *)idx, path, flags);
- camel_index_set_normalise((CamelIndex *)idx, text_index_normalise, NULL);
-
- p->blocks = camel_block_file_new(idx->parent.path, flags, CAMEL_TEXT_INDEX_VERSION, CAMEL_BLOCK_SIZE);
- link = alloca(strlen(idx->parent.path)+7);
- sprintf(link, "%s.data", idx->parent.path);
- p->links = camel_key_file_new(link, flags, CAMEL_TEXT_INDEX_KEY_VERSION);
-
- if (p->blocks == NULL || p->links == NULL) {
- camel_object_unref((CamelObject *)idx);
- return NULL;
- }
-
- rb = (struct _CamelTextIndexRoot *)p->blocks->root;
-
- if (rb->word_index_root == 0) {
- bl = camel_block_file_new_block(p->blocks);
- rb->word_index_root = bl->id;
- camel_block_file_unref_block(p->blocks, bl);
- camel_block_file_touch_block(p->blocks, p->blocks->root_block);
- }
-
- if (rb->word_hash_root == 0) {
- bl = camel_block_file_new_block(p->blocks);
- rb->word_hash_root = bl->id;
- camel_block_file_unref_block(p->blocks, bl);
- camel_block_file_touch_block(p->blocks, p->blocks->root_block);
- }
-
- if (rb->name_index_root == 0) {
- bl = camel_block_file_new_block(p->blocks);
- rb->name_index_root = bl->id;
- camel_block_file_unref_block(p->blocks, bl);
- camel_block_file_touch_block(p->blocks, p->blocks->root_block);
- }
-
- if (rb->name_hash_root == 0) {
- bl = camel_block_file_new_block(p->blocks);
- rb->name_hash_root = bl->id;
- camel_block_file_unref_block(p->blocks, bl);
- camel_block_file_touch_block(p->blocks, p->blocks->root_block);
- }
-
- p->word_index = camel_key_table_new(p->blocks, rb->word_index_root);
- p->word_hash = camel_partition_table_new(p->blocks, rb->word_hash_root);
- p->name_index = camel_key_table_new(p->blocks, rb->name_index_root);
- p->name_hash = camel_partition_table_new(p->blocks, rb->name_hash_root);
-
- if (p->word_index == NULL || p->word_hash == NULL
- || p->name_index == NULL || p->name_hash == NULL) {
- camel_object_unref((CamelObject *)idx);
- idx = NULL;
- }
-
- return idx;
-}
-
-/* returns 0 if the index exists, is valid, and synced, -1 otherwise */
-int
-camel_text_index_check(const char *path)
-{
- char *block, *key;
- CamelBlockFile *blocks;
- CamelKeyFile *keys;
-
- block = alloca(strlen(path)+7);
- sprintf(block, "%s.index", path);
- blocks = camel_block_file_new(block, O_RDONLY, CAMEL_TEXT_INDEX_VERSION, CAMEL_BLOCK_SIZE);
- if (blocks == NULL) {
- io(printf("Check failed: No block file: %s\n", strerror (errno)));
- return -1;
- }
- key = alloca(strlen(path)+12);
- sprintf(key, "%s.index.data", path);
- keys = camel_key_file_new(key, O_RDONLY, CAMEL_TEXT_INDEX_KEY_VERSION);
- if (keys == NULL) {
- io(printf("Check failed: No key file: %s\n", strerror (errno)));
- camel_object_unref((CamelObject *)blocks);
- return -1;
- }
-
- camel_object_unref((CamelObject *)keys);
- camel_object_unref((CamelObject *)blocks);
-
- return 0;
-}
-
-int
-camel_text_index_rename(const char *old, const char *new)
-{
- char *oldname, *newname;
- int err;
-
- /* TODO: camel_text_index_rename should find out if we have an active index and use that instead */
-
- oldname = alloca(strlen(old)+12);
- newname = alloca(strlen(new)+12);
- sprintf(oldname, "%s.index", old);
- sprintf(newname, "%s.index", new);
-
- if (rename(oldname, newname) == -1 && errno != ENOENT)
- return -1;
-
- sprintf(oldname, "%s.index.data", old);
- sprintf(newname, "%s.index.data", new);
-
- if (rename(oldname, newname) == -1 && errno != ENOENT) {
- err = errno;
- sprintf(oldname, "%s.index", old);
- sprintf(newname, "%s.index", new);
- rename(newname, oldname);
- errno = err;
- return -1;
- }
-
- return 0;
-}
-
-int
-camel_text_index_remove(const char *old)
-{
- char *block, *key;
- int ret = 0;
-
- /* TODO: needs to poke any active indices to remain unlinked */
-
- block = alloca(strlen(old)+12);
- key = alloca(strlen(old)+12);
- sprintf(block, "%s.index", old);
- sprintf(key, "%s.index.data", old);
-
- if (unlink(block) == -1 && errno != ENOENT)
- ret = -1;
- if (unlink(key) == -1 && errno != ENOENT)
- ret = -1;
-
- return ret;
-}
-
-/* Debug */
-void
-camel_text_index_info(CamelTextIndex *idx)
-{
- struct _CamelTextIndexPrivate *p = CTI_PRIVATE(idx);
- struct _CamelTextIndexRoot *rb = (struct _CamelTextIndexRoot *)p->blocks->root;
- int frag;
-
- printf("Path: '%s'\n", idx->parent.path);
- printf("Version: %d\n", idx->parent.version);
- printf("Flags: %08x\n", idx->parent.flags);
- printf("Total words: %d\n", rb->words);
- printf("Total names: %d\n", rb->names);
- printf("Total deleted: %d\n", rb->deleted);
- printf("Total key blocks: %d\n", rb->keys);
-
- if (rb->words > 0) {
- frag = ((rb->keys - rb->words) * 100)/ rb->words;
- printf("Word fragmentation: %d%%\n", frag);
- }
-
- if (rb->names > 0) {
- frag = (rb->deleted * 100)/ rb->names;
- printf("Name fragmentation: %d%%\n", frag);
- }
-}
-
-/* #define DUMP_RAW */
-
-#ifdef DUMP_RAW
-enum { KEY_ROOT = 1, KEY_DATA = 2, PARTITION_MAP = 4, PARTITION_DATA = 8 };
-
-static void
-add_type(GHashTable *map, camel_block_t id, int type)
-{
- camel_block_t old;
-
- old = g_hash_table_lookup(map, id);
- if (old == type)
- return;
-
- if (old != 0 && old != type)
- g_warning("block %x redefined as type %d, already type %d\n", id, type, old);
- g_hash_table_insert(map, id, type|old);
-}
-
-static void
-add_partition(GHashTable *map, CamelBlockFile *blocks, camel_block_t id)
-{
- CamelBlock *bl;
- CamelPartitionMapBlock *pm;
- int i;
-
- while (id) {
- add_type(map, id, PARTITION_MAP);
- bl = camel_block_file_get_block(blocks, id);
- if (bl == NULL) {
- g_warning("couldn't get parition: %x\n", id);
- return;
- }
-
- pm = (CamelPartitionMapBlock *)&bl->data;
- if (pm->used > sizeof(pm->partition)/sizeof(pm->partition[0])) {
- g_warning("Partition block %x invalid\n", id);
- camel_block_file_unref_block(blocks, bl);
- return;
- }
-
- for (i=0;i<pm->used;i++)
- add_type(map, pm->partition[i].blockid, PARTITION_DATA);
-
- id = pm->next;
- camel_block_file_unref_block(blocks, bl);
- }
-}
-
-static void
-add_keys(GHashTable *map, CamelBlockFile *blocks, camel_block_t id)
-{
- CamelBlock *rbl, *bl;
- CamelKeyRootBlock *root;
- CamelKeyBlock *kb;
-
- add_type(map, id, KEY_ROOT);
- rbl = camel_block_file_get_block(blocks, id);
- if (rbl == NULL) {
- g_warning("couldn't get key root: %x\n", id);
- return;
- }
- root = (CamelKeyRootBlock *)&rbl->data;
- id = root->first;
-
- while (id) {
- add_type(map, id, KEY_DATA);
- bl = camel_block_file_get_block(blocks, id);
- if (bl == NULL) {
- g_warning("couldn't get key: %x\n", id);
- break;
- }
-
- kb = (CamelKeyBlock *)&bl->data;
- id = kb->next;
- camel_block_file_unref_block(blocks, bl);
- }
-
- camel_block_file_unref_block(blocks, rbl);
-}
-
-static void
-dump_raw(GHashTable *map, char *path)
-{
- char buf[1024];
- char line[256];
- char *p, c, *e, *a, *o;
- int v, n, len, i, type;
- char hex[16] = "0123456789ABCDEF";
- int fd;
- camel_block_t id, total;
-
- fd = open(path, O_RDONLY);
- if (fd == -1)
- return;
-
- total = 0;
- while ((len = read(fd, buf, 1024)) == 1024) {
- id = total;
-
-
-
- type = g_hash_table_lookup(map, id);
- switch(type) {
- case 0:
- printf(" - unknown -\n");
- break;
- default:
- printf(" - invalid -\n");
- break;
- case KEY_ROOT: {
- CamelKeyRootBlock *r = (CamelKeyRootBlock *)buf;
- printf("Key root:\n");
- printf("First: %08x Last: %08x Free: %08x\n", r->first, r->last, r->free);
- } break;
- case KEY_DATA: {
- CamelKeyBlock *k = (CamelKeyBlock *)buf;
- printf("Key data:\n");
- printf("Next: %08x Used: %u\n", k->next, k->used);
- for (i=0;i<k->used;i++) {
- if (i == 0)
- len = sizeof(k->u.keydata);
- else
- len = k->u.keys[i-1].offset;
- len -= k->u.keys[i].offset;
- printf("[%03d]: %08x %5d %06x %3d '%.*s'\n", i,
- k->u.keys[i].data, k->u.keys[i].offset, k->u.keys[i].flags,
- len, len, k->u.keydata+k->u.keys[i].offset);
- }
- } break;
- case PARTITION_MAP: {
- CamelPartitionMapBlock *m = (CamelPartitionMapBlock *)buf;
- printf("Partition map\n");
- printf("Next: %08x Used: %u\n", m->next, m->used);
- for (i=0;i<m->used;i++) {
- printf("[%03d]: %08x -> %08x\n", i, m->partition[i].hashid, m->partition[i].blockid);
- }
- } break;
- case PARTITION_DATA: {
- CamelPartitionKeyBlock *k = (CamelPartitionKeyBlock *)buf;
- printf("Partition data\n");
- printf("Used: %u\n", k->used);
- } break;
- }
-
-
- printf("--raw--\n");
-
- len = 1024;
- p = buf;
- do {
- sprintf(line, "%08x: ", total);
- total += 16;
- o = line+10;
- a = o+16*2+2;
- i = 0;
- while (len && i<16) {
- c = *p++;
- *a++ = isprint(c)?c:'.';
- *o++ = hex[(c>>4)&0x0f];
- *o++ = hex[c&0x0f];
- i++;
- if (i==8)
- *o++ = ' ';
- len--;
- }
- *a = 0;
- printf("%s\n", line);
- } while (len);
- printf("\n");
- }
-}
-#endif
-
-/* Debug */
-void
-camel_text_index_dump(CamelTextIndex *idx)
-{
- struct _CamelTextIndexPrivate *p = CTI_PRIVATE(idx);
-#ifndef DUMP_RAW
- camel_key_t keyid;
- char *word;
- const char *name;
- unsigned int flags;
- camel_block_t data;
-
- /* Iterate over all names in the file first */
-
- printf("UID's in index\n");
-
- keyid = 0;
- while ( (keyid = camel_key_table_next(p->name_index, keyid, &word, &flags, &data)) ) {
- if ((flags & 1) == 0)
- printf(" %s\n", word);
- else
- printf(" %s (deleted)\n", word);
- g_free(word);
- }
-
- printf("Word's in index\n");
-
- keyid = 0;
- while ( (keyid = camel_key_table_next(p->word_index, keyid, &word, &flags, &data)) ) {
- CamelIndexCursor *idc;
-
- printf("Word: '%s':\n", word);
-
- idc = camel_index_find((CamelIndex *)idx, word);
- while ( (name = camel_index_cursor_next(idc)) ) {
- printf(" %s", name);
- }
- printf("\n");
- camel_object_unref((CamelObject *)idc);
- g_free(word);
- }
-#else
- /* a more low-level dump routine */
- GHashTable *block_type = g_hash_table_new(NULL, NULL);
- camel_block_t id;
- struct stat st;
- int type;
-
- add_keys(block_type, p->blocks, p->word_index->rootid);
- add_keys(block_type, p->blocks, p->name_index->rootid);
-
- add_partition(block_type, p->blocks, p->word_hash->rootid);
- add_partition(block_type, p->blocks, p->name_hash->rootid);
-
- dump_raw(block_type, p->blocks->path);
- g_hash_table_destroy(block_type);
-#endif
-}
-
-/* more debug stuff */
-void
-camel_text_index_validate(CamelTextIndex *idx)
-{
- struct _CamelTextIndexPrivate *p = CTI_PRIVATE(idx);
- camel_key_t keyid;
- char *word;
- const char *name;
- unsigned int flags;
- camel_block_t data;
- char *oldword;
- camel_key_t *records;
- size_t count;
-
- GHashTable *names, *deleted, *words, *keys, *name_word, *word_word;
-
- names = g_hash_table_new(NULL, NULL);
- deleted = g_hash_table_new(NULL, NULL);
-
- name_word = g_hash_table_new(g_str_hash, g_str_equal);
-
- words = g_hash_table_new(NULL, NULL);
- keys = g_hash_table_new(NULL, NULL);
-
- word_word = g_hash_table_new(g_str_hash, g_str_equal);
-
- /* Iterate over all names in the file first */
-
- printf("Checking UID consistency\n");
-
- keyid = 0;
- while ( (keyid = camel_key_table_next(p->name_index, keyid, &word, &flags, &data)) ) {
- if ((oldword = g_hash_table_lookup(names, GINT_TO_POINTER(keyid))) != NULL
- || (oldword = g_hash_table_lookup(deleted, GINT_TO_POINTER(keyid))) != NULL) {
- printf("Warning, name '%s' duplicates key (%x) with name '%s'\n", word, keyid, oldword);
- g_free(word);
- } else {
- g_hash_table_insert(name_word, word, (void *)1);
- if ((flags & 1) == 0) {
- g_hash_table_insert(names, GINT_TO_POINTER(keyid), word);
- } else {
- g_hash_table_insert(deleted, GINT_TO_POINTER(keyid), word);
- }
- }
- }
-
- printf("Checking WORD member consistency\n");
-
- keyid = 0;
- while ( (keyid = camel_key_table_next(p->word_index, keyid, &word, &flags, &data)) ) {
- CamelIndexCursor *idc;
- GHashTable *used;
-
- /* first, check for duplicates of keyid, and data */
- if ((oldword = g_hash_table_lookup(words, GINT_TO_POINTER(keyid))) != NULL) {
- printf("Warning, word '%s' duplicates key (%x) with name '%s'\n", word, keyid, oldword);
- g_free(word);
- word = oldword;
- } else {
- g_hash_table_insert(words, GINT_TO_POINTER(keyid), word);
- }
-
- if (data == 0) {
- /* This may not be an issue if things have been removed over time,
- though it is a problem if its a fresh index */
- printf("Word '%s' has no data associated with it\n", word);
- } else {
- if ((oldword = g_hash_table_lookup(keys, GUINT_TO_POINTER(data))) != NULL) {
- printf("Warning, word '%s' duplicates data (%x) with name '%s'\n", word, data, oldword);
- } else {
- g_hash_table_insert(keys, GUINT_TO_POINTER(data), word);
- }
- }
-
- if ((oldword = g_hash_table_lookup(word_word, word)) != NULL) {
- printf("Warning, word '%s' occurs more than once\n", word);
- } else {
- g_hash_table_insert(word_word, word, word);
- }
-
- used = g_hash_table_new(g_str_hash, g_str_equal);
-
- idc = camel_index_find((CamelIndex *)idx, word);
- while ( (name = camel_index_cursor_next(idc)) ) {
- if (g_hash_table_lookup(name_word, name) == NULL) {
- printf("word '%s' references non-existant name '%s'\n", word, name);
- }
- if (g_hash_table_lookup(used, name) != NULL) {
- printf("word '%s' uses word '%s' more than once\n", word, name);
- } else {
- g_hash_table_insert(used, g_strdup(name), (void *)1);
- }
- }
- camel_object_unref((CamelObject *)idc);
-
- g_hash_table_foreach(used, (GHFunc)g_free, NULL);
- g_hash_table_destroy(used);
-
- printf("word '%s'\n", word);
-
- while (data) {
- printf(" data %x ", data);
- if (camel_key_file_read(p->links, &data, &count, &records) == -1) {
- printf("Warning, read failed for word '%s', at data '%d'\n", word, data);
- data = 0;
- } else {
- printf("(%d)\n", count);
- g_free(records);
- }
- }
- }
-
- g_hash_table_destroy(names);
- g_hash_table_destroy(deleted);
- g_hash_table_destroy(words);
- g_hash_table_destroy(keys);
-
- g_hash_table_foreach(name_word, (GHFunc)g_free, NULL);
- g_hash_table_destroy(name_word);
-
- g_hash_table_foreach(word_word, (GHFunc)g_free, NULL);
- g_hash_table_destroy(word_word);
-}
-
-/* ********************************************************************** */
-/* CamelTextIndexName */
-/* ********************************************************************** */
-
-static CamelIndexNameClass *camel_text_index_name_parent;
-
-#define CIN_CLASS(o) ((CamelTextIndexNameClass *)(((CamelObject *)o)->classfuncs))
-#define CIN_PRIVATE(o) (((CamelTextIndexName *)(o))->priv)
-
-static void
-text_index_name_add_word(CamelIndexName *idn, const char *word)
-{
- struct _CamelTextIndexNamePrivate *p = ((CamelTextIndexName *)idn)->priv;
-
- if (g_hash_table_lookup(idn->words, word) == NULL) {
- char *w = e_mempool_strdup(p->pool, word);
-
- g_hash_table_insert(idn->words, w, w);
- }
-}
-
-/* Why?
- Because it doesn't hang/loop forever on bad data
- Used to clean up utf8 before it gets further */
-
-static inline guint32
-camel_utf8_next(const unsigned char **ptr, const unsigned char *ptrend)
-{
- register unsigned char *p = (unsigned char *)*ptr;
- register unsigned int c;
- register guint32 v;
- int l;
-
- if (p == ptrend)
- return 0;
-
- while ( (c = *p++) ) {
- if (c < 0x80) {
- *ptr = p;
- return c;
- } else if ((c&0xe0) == 0xc0) {
- v = c & 0x1f;
- l = 1;
- } else if ((c&0xf0) == 0xe0) {
- v = c & 0x0f;
- l = 2;
- } else if ((c&0xf8) == 0xf0) {
- v = c & 0x07;
- l = 3;
- } else if ((c&0xfc) == 0xf8) {
- v = c & 0x03;
- l = 4;
- } else if ((c&0xfe) == 0xfc) {
- v = c & 0x01;
- l = 5;
- } else
- /* Invalid, ignore and look for next start char if room */
- if (p == ptrend) {
- return 0;
- } else {
- continue;
- }
-
- /* bad data or truncated buffer */
- if (p + l > ptrend)
- return 0;
-
- while (l && ((c = *p) & 0xc0) == 0x80) {
- p++;
- l--;
- v = (v << 6) | (c & 0x3f);
- }
-
- /* valid char */
- if (l == 0) {
- *ptr = p;
- return v;
- }
-
- /* else look for a start char again */
- }
-
- return 0;
-}
-
-static size_t
-text_index_name_add_buffer(CamelIndexName *idn, const char *buffer, size_t len)
-{
- CamelTextIndexNamePrivate *p = CIN_PRIVATE(idn);
- const unsigned char *ptr, *ptrend;
- guint32 c;
- unsigned char utf8[8];
- size_t utf8len;
-
- if (buffer == NULL) {
- if (p->buffer->len) {
- camel_index_name_add_word(idn, p->buffer->str);
- g_string_truncate(p->buffer, 0);
- }
- return 0;
- }
-
- ptr = buffer;
- ptrend = buffer+len;
- while ((c = camel_utf8_next(&ptr, ptrend))) {
- if (g_unichar_isalnum(c)) {
- c = g_unichar_tolower(c);
- utf8len = g_unichar_to_utf8(c, utf8);
- utf8[utf8len] = 0;
- g_string_append(p->buffer, utf8);
- } else {
- if (p->buffer->len > 0 && p->buffer->len <= CAMEL_TEXT_INDEX_MAX_WORDLEN) {
- text_index_name_add_word(idn, p->buffer->str);
- /*camel_index_name_add_word(idn, p->buffer->str);*/
- }
-
- g_string_truncate (p->buffer, 0);
- }
- }
-
- return 0;
-}
-
-static void
-camel_text_index_name_class_init(CamelTextIndexNameClass *klass)
-{
- CamelIndexNameClass *nklass = (CamelIndexNameClass *)klass;
-
- camel_text_index_name_parent = CAMEL_INDEX_NAME_CLASS(camel_type_get_global_classfuncs(camel_index_name_get_type()));
-
- nklass->add_word = text_index_name_add_word;
- nklass->add_buffer = text_index_name_add_buffer;
-}
-
-static void
-camel_text_index_name_init(CamelTextIndexName *idn)
-{
- CamelTextIndexNamePrivate *p;
-
- idn->parent.words = g_hash_table_new(g_str_hash, g_str_equal);
-
- p = idn->priv = g_malloc0(sizeof(*idn->priv));
- p->buffer = g_string_new("");
- p->pool = e_mempool_new(256, 128, E_MEMPOOL_ALIGN_BYTE);
-}
-
-static void
-camel_text_index_name_finalise(CamelTextIndexName *idn)
-{
- CamelTextIndexNamePrivate *p = CIN_PRIVATE(idn);
-
- g_hash_table_destroy(idn->parent.words);
-
- g_string_free(p->buffer, TRUE);
- e_mempool_destroy(p->pool);
-
- g_free(p);
-}
-
-CamelType
-camel_text_index_name_get_type(void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register(camel_index_name_get_type(), "CamelTextIndexName",
- sizeof (CamelTextIndexName),
- sizeof (CamelTextIndexNameClass),
- (CamelObjectClassInitFunc) camel_text_index_name_class_init,
- NULL,
- (CamelObjectInitFunc) camel_text_index_name_init,
- (CamelObjectFinalizeFunc) camel_text_index_name_finalise);
- }
-
- return type;
-}
-
-CamelTextIndexName *
-camel_text_index_name_new(CamelTextIndex *idx, const char *name, camel_key_t nameid)
-{
- CamelTextIndexName *idn = (CamelTextIndexName *)camel_object_new(camel_text_index_name_get_type());
- CamelIndexName *cin = &idn->parent;
- CamelTextIndexNamePrivate *p = CIN_PRIVATE(idn);
-
- cin->index = (CamelIndex *)idx;
- camel_object_ref((CamelObject *)idx);
- cin->name = e_mempool_strdup(p->pool, name);
- p->nameid = nameid;
-
- return idn;
-}
-
-/* ********************************************************************** */
-/* CamelTextIndexCursor */
-/* ********************************************************************** */
-
-static CamelIndexCursorClass *camel_text_index_cursor_parent;
-
-#define CIC_CLASS(o) ((CamelTextIndexCursorClass *)(((CamelObject *)o)->classfuncs))
-#define CIC_PRIVATE(o) (((CamelTextIndexCursor *)(o))->priv)
-
-static const char *
-text_index_cursor_next(CamelIndexCursor *idc)
-{
- struct _CamelTextIndexCursorPrivate *p = CIC_PRIVATE(idc);
- struct _CamelTextIndexPrivate *tip = CTI_PRIVATE(idc->index);
- unsigned int flags;
-
- c(printf("Going to next cursor for word with data '%08x' next %08x\n", p->first, p->next));
-
- do {
- while (p->record_index >= p->record_count) {
- g_free(p->records);
- p->records = NULL;
- p->record_index = 0;
- p->record_count = 0;
- if (p->next == 0)
- return NULL;
- if (camel_key_file_read(tip->links, &p->next, &p->record_count, &p->records) == -1)
- return NULL;
- }
-
- g_free(p->current);
- camel_key_table_lookup(tip->name_index, p->records[p->record_index], &p->current, &flags);
- if (flags & 1) {
- g_free(p->current);
- p->current = NULL;
- }
- p->record_index++;
- } while (p->current == NULL);
-
- return p->current;
-}
-
-static void
-text_index_cursor_reset(CamelIndexCursor *idc)
-{
- struct _CamelTextIndexCursorPrivate *p = CIC_PRIVATE(idc);
-
- g_free(p->records);
- p->records = NULL;
- g_free(p->current);
- p->current = NULL;
- p->record_count = 0;
- p->record_index = 0;
- p->next = p->first;
-}
-
-static void
-camel_text_index_cursor_class_init(CamelTextIndexCursorClass *klass)
-{
- CamelIndexCursorClass *cklass = (CamelIndexCursorClass *)klass;
-
- camel_text_index_cursor_parent = CAMEL_INDEX_CURSOR_CLASS(camel_type_get_global_classfuncs(camel_index_cursor_get_type()));
-
- cklass->next = text_index_cursor_next;
- cklass->reset = text_index_cursor_reset;
-}
-
-static void
-camel_text_index_cursor_init(CamelTextIndexCursor *idc)
-{
- CIC_PRIVATE(idc) = g_malloc0(sizeof(struct _CamelTextIndexCursorPrivate));
-}
-
-static void
-camel_text_index_cursor_finalise(CamelTextIndexCursor *idc)
-{
- struct _CamelTextIndexCursorPrivate *p = CIC_PRIVATE(idc);
-
- g_free(p->records);
- g_free(p->current);
- g_free(p);
-}
-
-CamelType
-camel_text_index_cursor_get_type(void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register(camel_index_cursor_get_type(), "CamelTextIndexCursor",
- sizeof (CamelTextIndexCursor),
- sizeof (CamelTextIndexCursorClass),
- (CamelObjectClassInitFunc) camel_text_index_cursor_class_init,
- NULL,
- (CamelObjectInitFunc) camel_text_index_cursor_init,
- (CamelObjectFinalizeFunc) camel_text_index_cursor_finalise);
- }
-
- return type;
-}
-
-CamelTextIndexCursor *
-camel_text_index_cursor_new(CamelTextIndex *idx, camel_block_t data)
-{
- CamelTextIndexCursor *idc = (CamelTextIndexCursor *)camel_object_new(camel_text_index_cursor_get_type());
- CamelIndexCursor *cic = &idc->parent;
- struct _CamelTextIndexCursorPrivate *p = CIC_PRIVATE(idc);
-
- cic->index = (CamelIndex *)idx;
- camel_object_ref((CamelObject *)idx);
- p->first = data;
- p->next = data;
- p->record_count = 0;
- p->record_index = 0;
-
- return idc;
-}
-
-/* ********************************************************************** */
-/* CamelTextIndexKeyCursor */
-/* ********************************************************************** */
-
-static CamelIndexCursorClass *camel_text_index_key_cursor_parent;
-
-#define CIKC_CLASS(o) ((CamelTextIndexKeyCursorClass *)(((CamelObject *)o)->classfuncs))
-#define CIKC_PRIVATE(o) (((CamelTextIndexKeyCursor *)(o))->priv)
-
-static const char *
-text_index_key_cursor_next(CamelIndexCursor *idc)
-{
- struct _CamelTextIndexKeyCursorPrivate *p = CIKC_PRIVATE(idc);
-
- c(printf("Going to next cursor for keyid %08x\n", p->keyid));
-
- g_free(p->current);
- p->current = NULL;
-
- while ( (p->keyid = camel_key_table_next(p->table, p->keyid, &p->current, &p->flags, &p->data)) ) {
- if ((p->flags & 1) == 0) {
- return p->current;
- } else {
- g_free(p->current);
- p->current = NULL;
- }
- }
-
- return NULL;
-}
-
-static void
-text_index_key_cursor_reset(CamelIndexCursor *idc)
-{
- struct _CamelTextIndexKeyCursorPrivate *p = CIKC_PRIVATE(idc);
-
- p->keyid = 0;
- p->flags = 0;
- p->data = 0;
- g_free(p->current);
- p->current = NULL;
-}
-
-static void
-camel_text_index_key_cursor_class_init(CamelTextIndexKeyCursorClass *klass)
-{
- CamelIndexCursorClass *cklass = (CamelIndexCursorClass *)klass;
-
- camel_text_index_key_cursor_parent = CAMEL_INDEX_CURSOR_CLASS(camel_type_get_global_classfuncs(camel_index_cursor_get_type()));
-
- cklass->next = text_index_key_cursor_next;
- cklass->reset = text_index_key_cursor_reset;
-}
-
-static void
-camel_text_index_key_cursor_init(CamelTextIndexKeyCursor *idc)
-{
- struct _CamelTextIndexKeyCursorPrivate *p;
-
- p = idc->priv = g_malloc0(sizeof(struct _CamelTextIndexKeyCursorPrivate));
- p->keyid = 0;
- p->flags = 0;
- p->data = 0;
- p->current = NULL;
-}
-
-static void
-camel_text_index_key_cursor_finalise(CamelTextIndexKeyCursor *idc)
-{
- struct _CamelTextIndexKeyCursorPrivate *p = CIKC_PRIVATE(idc);
-
- g_free(p->current);
- if (p->table)
- camel_object_unref((CamelObject *)p->table);
- g_free(p);
-}
-
-CamelType
-camel_text_index_key_cursor_get_type(void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register(camel_index_cursor_get_type(), "CamelTextIndexKeyCursor",
- sizeof (CamelTextIndexKeyCursor),
- sizeof (CamelTextIndexKeyCursorClass),
- (CamelObjectClassInitFunc) camel_text_index_key_cursor_class_init,
- NULL,
- (CamelObjectInitFunc) camel_text_index_key_cursor_init,
- (CamelObjectFinalizeFunc) camel_text_index_key_cursor_finalise);
- }
-
- return type;
-}
-
-CamelTextIndexKeyCursor *
-camel_text_index_key_cursor_new(CamelTextIndex *idx, CamelKeyTable *table)
-{
- CamelTextIndexKeyCursor *idc = (CamelTextIndexKeyCursor *)camel_object_new(camel_text_index_key_cursor_get_type());
- CamelIndexCursor *cic = &idc->parent;
- struct _CamelTextIndexKeyCursorPrivate *p = CIKC_PRIVATE(idc);
-
- cic->index = (CamelIndex *)idx;
- camel_object_ref((CamelObject *)idx);
- p->table = table;
- camel_object_ref((CamelObject *)table);
-
- return idc;
-}
-
-/* ********************************************************************** */
-
-#define m(x)
-
-#if 0
-
-struct _CamelIndexRoot {
- struct _CamelBlockRoot root;
-
- camel_block_t word_root; /* a keyindex containing the keyid -> word mapping */
- camel_block_t word_hash_root; /* a partitionindex containing word -> keyid mapping */
-
- camel_block_t name_root; /* same, for names */
- camel_block_t name_hash_root;
-};
-
-char wordbuffer[] = "This is a buffer of multiple words. Some of the words are duplicates"
-" while other words are the same, some are in difFerenT Different different case cAsE casE,"
-" with,with:with;with-with'with\"'\"various punctuation as well. So much for those Words. and 10"
-" numbers in a row too 1,2,3,4,5,6,7,8,9,10! Yay!.";
-
-int main(int argc, char **argv)
-{
-#if 0
- CamelBlockFile *bs;
- CamelKeyTable *ki;
- CamelPartitionTable *cpi;
- CamelBlock *keyroot, *partroot;
- struct _CamelIndexRoot *root;
- FILE *fp;
- char line[256], *key;
- camel_key_t keyid;
- int index = 0, flags, data;
-#endif
- CamelIndex *idx;
- CamelIndexName *idn;
- CamelIndexCursor *idc;
- const char *word;
- int i;
-
- printf("Camel text index tester!\n");
-
- g_thread_init(NULL);
- camel_init(NULL, 0);
-
- idx = (CamelIndex *)camel_text_index_new("textindex", O_CREAT|O_RDWR|O_TRUNC);
-
-
-#if 1
- camel_index_compress(idx);
-
- return 0;
-#endif
-
- for (i=0;i<100;i++) {
- char name[16];
-
- sprintf(name, "%d", i);
- printf("Adding words to name '%s'\n", name);
- idn = camel_index_add_name(idx, name);
- camel_index_name_add_buffer(idn, wordbuffer, sizeof(wordbuffer)-1);
- camel_index_write_name(idx, idn);
- camel_object_unref((CamelObject *)idn);
- }
-
- printf("Looking up which names contain word 'word'\n");
- idc = camel_index_find(idx, "words");
- while ( (word = camel_index_cursor_next(idc)) != NULL ) {
- printf(" name is '%s'\n", word);
- }
- camel_object_unref((CamelObject *)idc);
- printf("done.\n");
-
- printf("Looking up which names contain word 'truncate'\n");
- idc = camel_index_find(idx, "truncate");
- while ( (word = camel_index_cursor_next(idc)) != NULL ) {
- printf(" name is '%s'\n", word);
- }
- camel_object_unref((CamelObject *)idc);
- printf("done.\n");
-
- camel_index_sync(idx);
- camel_object_unref((CamelObject *)idx);
-
-#if 0
- bs = camel_block_file_new("blocks", "TESTINDX", CAMEL_BLOCK_SIZE);
-
- root = (struct _CamelIndexRoot *)bs->root;
- if (root->word_root == 0) {
- keyroot = camel_block_file_new_block(bs);
- root->word_root = keyroot->id;
- camel_block_file_touch_block(bs, bs->root_block);
- }
- if (root->word_hash_root == 0) {
- partroot = camel_block_file_new_block(bs);
- root->word_hash_root = partroot->id;
- camel_block_file_touch_block(bs, bs->root_block);
- }
-
- ki = camel_key_table_new(bs, root->word_root);
- cpi = camel_partition_table_new(bs, root->word_hash_root);
-
- fp = fopen("/usr/dict/words", "r");
- if (fp == NULL) {
- perror("fopen");
- return 1;
- }
-
- while (fgets(line, sizeof(line), fp) != NULL) {
- line[strlen(line)-1] = 0;
-
- /* see if its already there */
- keyid = camel_partition_table_lookup(cpi, line);
- if (keyid == 0) {
- m(printf("Adding word '%s' %d\n", line, index));
-
- keyid = camel_key_table_add(ki, line, index, 0);
- m(printf(" key = %08x\n", keyid));
-
- camel_partition_table_add(cpi, line, keyid);
-
- m(printf("Lookup word '%s'\n", line));
- keyid = camel_partition_table_lookup(cpi, line);
- m(printf(" key = %08x\n", keyid));
- }
-
- m(printf("Lookup key %08x\n", keyid));
-
- camel_key_table_set_flags(ki, keyid, index, 1);
-
- data = camel_key_table_lookup(ki, keyid, &key, &flags);
- m(printf(" word = '%s' %d %04x\n", key, data, flags));
-
- g_assert(data == index && strcmp(key, line) == 0);
-
- g_free(key);
-
- index++;
- }
-
- printf("Scanning again\n");
- fseek(fp, SEEK_SET, 0);
- index = 0;
- while (fgets(line, sizeof(line), fp) != NULL) {
- line[strlen(line)-1] = 0;
- m(printf("Lookup word '%s' %d\n", line, index));
- keyid = camel_partition_table_lookup(cpi, line);
- m(printf(" key = %08d\n", keyid));
-
- m(printf("Lookup key %08x\n", keyid));
- data = camel_key_table_lookup(ki, keyid, &key, &flags);
- m(printf(" word = '%s' %d\n", key, data));
-
- g_assert(data == index && strcmp(key, line) == 0);
-
- g_free(key);
-
- index++;
- }
-
- printf("Freeing partition index\n");
- camel_partition_table_free(cpi);
-
- printf("Syncing block file\n");
- camel_block_file_sync(bs);
-#endif
- return 0;
-}
-
-#endif
diff --git a/camel/camel-text-index.h b/camel/camel-text-index.h
deleted file mode 100644
index fd9e6aa116..0000000000
--- a/camel/camel-text-index.h
+++ /dev/null
@@ -1,114 +0,0 @@
-
-/*
- * Copyright (C) 2001 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef _CAMEL_TEXT_INDEX_H
-#define _CAMEL_TEXT_INDEX_H
-
-#include <camel/camel-exception.h>
-#include <camel/camel-object.h>
-#include "camel-index.h"
-
-#define CAMEL_TEXT_INDEX(obj) CAMEL_CHECK_CAST (obj, camel_text_index_get_type (), CamelTextIndex)
-#define CAMEL_TEXT_INDEX_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_text_index_get_type (), CamelTextIndexClass)
-#define CAMEL_IS_TEXT_INDEX(obj) CAMEL_CHECK_TYPE (obj, camel_text_index_get_type ())
-
-typedef struct _CamelTextIndex CamelTextIndex;
-typedef struct _CamelTextIndexClass CamelTextIndexClass;
-
-typedef struct _CamelTextIndexName CamelTextIndexName;
-typedef struct _CamelTextIndexNameClass CamelTextIndexNameClass;
-
-typedef struct _CamelTextIndexCursor CamelTextIndexCursor;
-typedef struct _CamelTextIndexCursorClass CamelTextIndexCursorClass;
-
-typedef struct _CamelTextIndexKeyCursor CamelTextIndexKeyCursor;
-typedef struct _CamelTextIndexKeyCursorClass CamelTextIndexKeyCursorClass;
-
-typedef void (*CamelTextIndexFunc)(CamelTextIndex *idx, const char *word, char *buffer);
-
-/* ********************************************************************** */
-
-struct _CamelTextIndexCursor {
- CamelIndexCursor parent;
-
- struct _CamelTextIndexCursorPrivate *priv;
-};
-
-struct _CamelTextIndexCursorClass {
- CamelIndexCursorClass parent;
-};
-
-CamelType camel_text_index_cursor_get_type(void);
-
-/* ********************************************************************** */
-
-struct _CamelTextIndexKeyCursor {
- CamelIndexCursor parent;
-
- struct _CamelTextIndexKeyCursorPrivate *priv;
-};
-
-struct _CamelTextIndexKeyCursorClass {
- CamelIndexCursorClass parent;
-};
-
-CamelType camel_text_index_key_cursor_get_type(void);
-
-/* ********************************************************************** */
-
-struct _CamelTextIndexName {
- CamelIndexName parent;
-
- struct _CamelTextIndexNamePrivate *priv;
-};
-
-struct _CamelTextIndexNameClass {
- CamelIndexNameClass parent;
-};
-
-CamelType camel_text_index_name_get_type(void);
-
-/* ********************************************************************** */
-
-struct _CamelTextIndex {
- CamelIndex parent;
-
- struct _CamelTextIndexPrivate *priv;
-};
-
-struct _CamelTextIndexClass {
- CamelIndexClass parent_class;
-};
-
-CamelType camel_text_index_get_type (void);
-CamelTextIndex *camel_text_index_new(const char *path, int flags);
-
-/* static utility functions */
-int camel_text_index_check(const char *path);
-int camel_text_index_rename(const char *old, const char *new);
-int camel_text_index_remove(const char *old);
-
-void camel_text_index_dump(CamelTextIndex *idx);
-void camel_text_index_info(CamelTextIndex *idx);
-void camel_text_index_validate(CamelTextIndex *idx);
-
-#endif /* ! _CAMEL_TEXT_INDEX_H */
-
diff --git a/camel/camel-transport.c b/camel/camel-transport.c
deleted file mode 100644
index a708b1757d..0000000000
--- a/camel/camel-transport.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-transport.c : Abstract class for an email transport */
-
-/*
- *
- * Author :
- * Dan Winship <danw@ximian.com>
- *
- * Copyright 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "camel-transport.h"
-#include "camel-address.h"
-#include "camel-mime-message.h"
-#include "camel-private.h"
-
-static CamelServiceClass *parent_class = NULL;
-
-/* Returns the class for a CamelTransport */
-#define CT_CLASS(so) CAMEL_TRANSPORT_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-
-static int transport_setv (CamelObject *object, CamelException *ex, CamelArgV *args);
-static int transport_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args);
-
-
-static void
-camel_transport_class_init (CamelTransportClass *camel_transport_class)
-{
- CamelObjectClass *camel_object_class = CAMEL_OBJECT_CLASS (camel_transport_class);
-
- parent_class = CAMEL_SERVICE_CLASS (camel_type_get_global_classfuncs (camel_service_get_type ()));
-
- /* virtual method overload */
- camel_object_class->setv = transport_setv;
- camel_object_class->getv = transport_getv;
-}
-
-static void
-camel_transport_init (gpointer object, gpointer klass)
-{
- CamelTransport *xport = object;
-
- xport->priv = g_malloc0 (sizeof (struct _CamelTransportPrivate));
- xport->priv->send_lock = g_mutex_new ();
-}
-
-static void
-camel_transport_finalize (CamelObject *object)
-{
- CamelTransport *xport = CAMEL_TRANSPORT (object);
-
- g_mutex_free (xport->priv->send_lock);
- g_free (xport->priv);
-}
-
-CamelType
-camel_transport_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (CAMEL_SERVICE_TYPE,
- "CamelTransport",
- sizeof (CamelTransport),
- sizeof (CamelTransportClass),
- (CamelObjectClassInitFunc) camel_transport_class_init,
- NULL,
- (CamelObjectInitFunc) camel_transport_init,
- (CamelObjectFinalizeFunc) camel_transport_finalize);
- }
-
- return type;
-}
-
-
-static int
-transport_setv (CamelObject *object, CamelException *ex, CamelArgV *args)
-{
- /* CamelTransport doesn't currently have anything to set */
- return CAMEL_OBJECT_CLASS (parent_class)->setv (object, ex, args);
-}
-
-static int
-transport_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args)
-{
- /* CamelTransport doesn't currently have anything to get */
- return CAMEL_OBJECT_CLASS (parent_class)->getv (object, ex, args);
-}
-
-
-/**
- * camel_transport_send_to:
- * @transport: the transport
- * @message: the message
- * @from: from address
- * @recipients: the recipients
- * @ex: a CamelException
- *
- * Sends the message to the given recipients, regardless of the contents
- * of @message. If the message contains a "Bcc" header, the transport
- * is responsible for stripping it.
- *
- * Return value: success or failure.
- **/
-gboolean
-camel_transport_send_to (CamelTransport *transport, CamelMimeMessage *message,
- CamelAddress *from, CamelAddress *recipients,
- CamelException *ex)
-{
- gboolean sent;
-
- g_return_val_if_fail (CAMEL_IS_TRANSPORT (transport), FALSE);
- g_return_val_if_fail (CAMEL_IS_MIME_MESSAGE (message), FALSE);
- g_return_val_if_fail (CAMEL_IS_ADDRESS (from), FALSE);
- g_return_val_if_fail (CAMEL_IS_ADDRESS (recipients), FALSE);
-
- CAMEL_TRANSPORT_LOCK (transport, send_lock);
- sent = CT_CLASS (transport)->send_to (transport, message,
- from, recipients, ex);
- CAMEL_TRANSPORT_UNLOCK (transport, send_lock);
-
- return sent;
-}
diff --git a/camel/camel-transport.h b/camel/camel-transport.h
deleted file mode 100644
index d2c1e5b72c..0000000000
--- a/camel/camel-transport.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-transport.h : Abstract class for an email transport */
-
-/*
- *
- * Author :
- * Dan Winship <danw@ximian.com>
- *
- * Copyright 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifndef CAMEL_TRANSPORT_H
-#define CAMEL_TRANSPORT_H 1
-
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include <glib.h>
-#include <camel/camel-service.h>
-
-#define CAMEL_TRANSPORT_TYPE (camel_transport_get_type ())
-#define CAMEL_TRANSPORT(obj) (CAMEL_CHECK_CAST((obj), CAMEL_TRANSPORT_TYPE, CamelTransport))
-#define CAMEL_TRANSPORT_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_TRANSPORT_TYPE, CamelTransportClass))
-#define CAMEL_IS_TRANSPORT(o) (CAMEL_CHECK_TYPE((o), CAMEL_TRANSPORT_TYPE))
-
-
-enum {
- CAMEL_TRANSPORT_ARG_FIRST = CAMEL_SERVICE_ARG_FIRST + 100,
-};
-
-struct _CamelTransport
-{
- CamelService parent_object;
-
- struct _CamelTransportPrivate *priv;
-};
-
-
-
-typedef struct {
- CamelServiceClass parent_class;
-
- gboolean (*send_to) (CamelTransport *transport,
- CamelMimeMessage *message,
- CamelAddress *from, CamelAddress *recipients,
- CamelException *ex);
-} CamelTransportClass;
-
-
-/* public methods */
-gboolean camel_transport_send_to (CamelTransport *transport,
- CamelMimeMessage *message,
- CamelAddress *from,
- CamelAddress *recipients,
- CamelException *ex);
-
-/* Standard Camel function */
-CamelType camel_transport_get_type (void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_TRANSPORT_H */
diff --git a/camel/camel-types.h b/camel/camel-types.h
deleted file mode 100644
index 8345bbf206..0000000000
--- a/camel/camel-types.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Copyright 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifndef CAMEL_TYPES_H
-#define CAMEL_TYPES_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-typedef struct _CamelAddress CamelAddress;
-typedef struct _CamelDigestFolder CamelDigestFolder;
-typedef struct _CamelDigestStore CamelDigestStore;
-typedef struct _CamelDiscoDiary CamelDiscoDiary;
-typedef struct _CamelDiscoFolder CamelDiscoFolder;
-typedef struct _CamelDiscoStore CamelDiscoStore;
-typedef struct _CamelDataWrapper CamelDataWrapper;
-typedef struct _CamelException CamelException;
-typedef struct _CamelFilterDriver CamelFilterDriver;
-typedef struct _CamelFolder CamelFolder;
-typedef struct _CamelFolderSearch CamelFolderSearch;
-typedef struct _CamelFolderSummary CamelFolderSummary;
-typedef struct _CamelInternetAddress CamelInternetAddress;
-typedef struct _CamelMedium CamelMedium;
-typedef struct _CamelMessageContentInfo CamelMessageContentInfo;
-typedef struct _CamelMessageInfo CamelMessageInfo;
-typedef struct _CamelMimeFilter CamelMimeFilter;
-typedef struct _CamelMimeFilterBasic CamelMimeFilterBasic;
-typedef struct _CamelMimeFilterBestenc CamelMimeFilterBestenc;
-typedef struct _CamelMimeFilterCharset CamelMimeFilterCharset;
-typedef struct _CamelMimeFilterChomp CamelMimeFilterChomp;
-typedef struct _CamelMimeFilterIndex CamelMimeFilterIndex;
-typedef struct _CamelMimeFilterLinewrap CamelMimeFilterLinewrap;
-typedef struct _CamelMimeFilterSave CamelMimeFilterSave;
-typedef struct _CamelMimeFilterCRLF CamelMimeFilterCRLF;
-typedef struct _CamelMimeMessage CamelMimeMessage;
-typedef struct _CamelMimeParser CamelMimeParser;
-typedef struct _CamelMimePart CamelMimePart;
-typedef struct _CamelMultipart CamelMultipart;
-typedef struct _CamelNewsAddress CamelNewsAddress;
-typedef struct _CamelSeekableStream CamelSeekableStream;
-typedef struct _CamelSeekableSubstream CamelSeekableSubstream;
-typedef struct _CamelService CamelService;
-typedef struct _CamelSession CamelSession;
-typedef struct _CamelSimpleDataWrapper CamelSimpleDataWrapper;
-typedef struct _CamelStore CamelStore;
-typedef struct _CamelStream CamelStream;
-typedef struct _CamelStreamNull CamelStreamNull;
-typedef struct _CamelStreamBuffer CamelStreamBuffer;
-typedef struct _CamelStreamDataWrapper CamelStreamDataWrapper;
-typedef struct _CamelStreamFilter CamelStreamFilter;
-typedef struct _CamelStreamFs CamelStreamFs;
-typedef struct _CamelStreamMem CamelStreamMem;
-typedef struct _CamelTcpStream CamelTcpStream;
-typedef struct _CamelTcpStreamRaw CamelTcpStreamRaw;
-typedef struct _CamelTcpStreamSSL CamelTcpStreamSSL;
-typedef struct _CamelTcpStreamOpenSSL CamelTcpStreamOpenSSL;
-typedef struct _CamelHttpStream CamelHttpStream;
-typedef struct _CamelTransport CamelTransport;
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_TYPES_H */
diff --git a/camel/camel-uid-cache.c b/camel/camel-uid-cache.c
deleted file mode 100644
index 2a2a52daeb..0000000000
--- a/camel/camel-uid-cache.c
+++ /dev/null
@@ -1,334 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-uid-cache.c: UID caching code. */
-
-/*
- * Authors:
- * Dan Winship <danw@ximian.com>
- *
- * Copyright 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <errno.h>
-#include <fcntl.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#include "camel-uid-cache.h"
-#include "camel-file-utils.h"
-
-struct _uid_state {
- int level;
- gboolean save;
-};
-
-
-/**
- * camel_uid_cache_new:
- * @filename: path to load the cache from
- *
- * Creates a new UID cache, initialized from @filename. If @filename
- * doesn't already exist, the UID cache will be empty. Otherwise, if
- * it does exist but can't be read, the function will return %NULL.
- *
- * Return value: a new UID cache, or %NULL
- **/
-CamelUIDCache *
-camel_uid_cache_new (const char *filename)
-{
- CamelUIDCache *cache;
- struct stat st;
- char *dirname, *buf, **uids;
- int fd, i;
-
- dirname = g_path_get_dirname (filename);
- if (camel_mkdir (dirname, 0777) == -1) {
- g_free (dirname);
- return NULL;
- }
-
- g_free (dirname);
-
- if ((fd = open (filename, O_RDONLY | O_CREAT, 0666)) == -1)
- return NULL;
-
- if (fstat (fd, &st) == -1) {
- close (fd);
- return NULL;
- }
-
- buf = g_malloc (st.st_size + 1);
-
- if (st.st_size > 0 && camel_read (fd, buf, st.st_size) == -1) {
- close (fd);
- g_free (buf);
- return NULL;
- }
-
- buf[st.st_size] = '\0';
-
- close (fd);
-
- cache = g_new (CamelUIDCache, 1);
- cache->uids = g_hash_table_new (g_str_hash, g_str_equal);
- cache->filename = g_strdup (filename);
- cache->level = 1;
- cache->expired = 0;
- cache->size = 0;
- cache->fd = -1;
-
- uids = g_strsplit (buf, "\n", 0);
- g_free (buf);
- for (i = 0; uids[i]; i++) {
- struct _uid_state *state;
-
- state = g_new (struct _uid_state, 1);
- state->level = cache->level;
- state->save = TRUE;
-
- g_hash_table_insert (cache->uids, uids[i], state);
- }
-
- g_free (uids);
-
- return cache;
-}
-
-
-static void
-maybe_write_uid (gpointer key, gpointer value, gpointer data)
-{
- CamelUIDCache *cache = data;
- struct _uid_state *state = value;
-
- if (cache->fd == -1)
- return;
-
- if (state && state->level == cache->level && state->save) {
- if (camel_write (cache->fd, key, strlen (key)) == -1 ||
- camel_write (cache->fd, "\n", 1) == -1) {
- cache->fd = -1;
- } else {
- cache->size += strlen (key) + 1;
- }
- } else {
- /* keep track of how much space the expired uids would
- * have taken up in the cache */
- cache->expired += strlen (key) + 1;
- }
-}
-
-
-/**
- * camel_uid_cache_save:
- * @cache: a CamelUIDCache
- *
- * Attempts to save @cache back to disk.
- *
- * Return value: success or failure
- **/
-gboolean
-camel_uid_cache_save (CamelUIDCache *cache)
-{
- char *filename;
- int errnosav;
- int fd;
-
- filename = g_strdup_printf ("%s~", cache->filename);
- if ((fd = open (filename, O_WRONLY | O_CREAT | O_EXCL, 0666)) == -1) {
- g_free (filename);
- return FALSE;
- }
-
- cache->fd = fd;
- cache->size = 0;
- cache->expired = 0;
- g_hash_table_foreach (cache->uids, maybe_write_uid, cache);
-
- if (cache->fd == -1)
- goto exception;
-
- if (fsync (fd) == -1)
- goto exception;
-
- close (fd);
- fd = -1;
-
- if (rename (filename, cache->filename) == -1)
- goto exception;
-
- g_free (filename);
-
- return TRUE;
-
- exception:
-
- errnosav = errno;
-
-#ifdef ENABLE_SPASMOLYTIC
- if (fd != -1) {
- /**
- * If our new cache size is larger than the old cache,
- * even if we haven't finished writing it out
- * successfully, we should still attempt to replace
- * the old cache with the new cache because it will at
- * least avoid re-downloading a few extra messages
- * than if we just kept the old cache.
- *
- * Similarly, even if the new cache size is smaller
- * than the old cache size, but we've expired enough
- * uids to make up for the difference in size (or
- * more), then we should replace the old cache with
- * the new cache as well.
- **/
-
- if (stat (cache->filename, &st) == 0 &&
- (cache->size > st.st_size || cache->size + cache->expired > st.st_size)) {
- if (ftruncate (fd, (off_t) cache->size) != -1) {
- cache->size = 0;
- cache->expired = 0;
- goto overwrite;
- }
- }
-
- close (fd);
- }
-#endif
-
- unlink (filename);
- g_free (filename);
-
- errno = errnosav;
-
- return FALSE;
-}
-
-
-static void
-free_uid (gpointer key, gpointer value, gpointer data)
-{
- g_free (key);
- g_free (value);
-}
-
-
-/**
- * camel_uid_cache_destroy:
- * @cache: a CamelUIDCache
- *
- * Destroys @cache and frees its data.
- **/
-void
-camel_uid_cache_destroy (CamelUIDCache *cache)
-{
- g_hash_table_foreach (cache->uids, free_uid, NULL);
- g_hash_table_destroy (cache->uids);
- g_free (cache->filename);
- g_free (cache);
-}
-
-
-/**
- * camel_uid_cache_get_new_uids:
- * @cache: a CamelUIDCache
- * @uids: an array of UIDs
- *
- * Returns an array of UIDs from @uids that are not in @cache, and
- * removes UIDs from @cache that aren't in @uids.
- *
- * Return value: an array of new UIDs, which must be freed with
- * camel_uid_cache_free_uids().
- **/
-GPtrArray *
-camel_uid_cache_get_new_uids (CamelUIDCache *cache, GPtrArray *uids)
-{
- GPtrArray *new_uids;
- gpointer old_uid;
- char *uid;
- int i;
-
- new_uids = g_ptr_array_new ();
- cache->level++;
-
- for (i = 0; i < uids->len; i++) {
- struct _uid_state *state;
-
- uid = uids->pdata[i];
- if (g_hash_table_lookup_extended (cache->uids, uid, (void **)&old_uid, (void **)&state)) {
- g_hash_table_remove (cache->uids, uid);
- g_free (old_uid);
- } else {
- g_ptr_array_add (new_uids, g_strdup (uid));
- state = g_new (struct _uid_state, 1);
- state->save = FALSE;
- }
-
- state->level = cache->level;
- g_hash_table_insert (cache->uids, g_strdup (uid), state);
- }
-
- return new_uids;
-}
-
-
-/**
- * camel_uid_cache_save_uid:
- * @cache: a CamelUIDCache
- * @uid: a uid to save
- *
- * Marks a uid for saving.
- **/
-void
-camel_uid_cache_save_uid (CamelUIDCache *cache, const char *uid)
-{
- struct _uid_state *state;
- gpointer old_uid;
-
- g_return_if_fail (uid != NULL);
-
- if (g_hash_table_lookup_extended (cache->uids, uid, (void **)&old_uid, (void **)&state)) {
- state->save = TRUE;
- state->level = cache->level;
- } else {
- state = g_new (struct _uid_state, 1);
- state->save = TRUE;
- state->level = cache->level;
-
- g_hash_table_insert (cache->uids, g_strdup (uid), state);
- }
-}
-
-
-/**
- * camel_uid_cache_free_uids:
- * @uids: an array returned from camel_uid_cache_get_new_uids()
- *
- * Frees the array of UIDs.
- **/
-void
-camel_uid_cache_free_uids (GPtrArray *uids)
-{
- int i;
-
- for (i = 0; i < uids->len; i++)
- g_free (uids->pdata[i]);
- g_ptr_array_free (uids, TRUE);
-}
diff --git a/camel/camel-uid-cache.h b/camel/camel-uid-cache.h
deleted file mode 100644
index 37d90c89e6..0000000000
--- a/camel/camel-uid-cache.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-uid-cache.h: UID caching code. */
-
-/*
- * Authors:
- * Bertrand Guiheneuf <bertrand@helixcode.com>
- *
- * Copyright 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifndef CAMEL_UID_CACHE_H
-#define CAMEL_UID_CACHE_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <glib.h>
-
-#include <stdio.h>
-#include <sys/types.h>
-
-typedef struct {
- char *filename;
- GHashTable *uids;
- unsigned int level;
- size_t expired;
- size_t size;
- int fd;
-} CamelUIDCache;
-
-CamelUIDCache *camel_uid_cache_new (const char *filename);
-gboolean camel_uid_cache_save (CamelUIDCache *cache);
-void camel_uid_cache_destroy (CamelUIDCache *cache);
-
-GPtrArray *camel_uid_cache_get_new_uids (CamelUIDCache *cache, GPtrArray *uids);
-
-void camel_uid_cache_save_uid (CamelUIDCache *cache, const char *uid);
-void camel_uid_cache_free_uids (GPtrArray *uids);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_UID_CACHE_H */
diff --git a/camel/camel-url-scanner.c b/camel/camel-url-scanner.c
deleted file mode 100644
index 8a43b05aee..0000000000
--- a/camel/camel-url-scanner.c
+++ /dev/null
@@ -1,450 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2002 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-
-#include "e-util/e-trie.h"
-#include "camel-url-scanner.h"
-
-
-struct _CamelUrlScanner {
- GPtrArray *patterns;
- ETrie *trie;
-};
-
-
-CamelUrlScanner *
-camel_url_scanner_new (void)
-{
- CamelUrlScanner *scanner;
-
- scanner = g_new (CamelUrlScanner, 1);
- scanner->patterns = g_ptr_array_new ();
- scanner->trie = e_trie_new (TRUE);
-
- return scanner;
-}
-
-
-void
-camel_url_scanner_free (CamelUrlScanner *scanner)
-{
- g_return_if_fail (scanner != NULL);
-
- g_ptr_array_free (scanner->patterns, TRUE);
- e_trie_free (scanner->trie);
- g_free (scanner);
-}
-
-
-void
-camel_url_scanner_add (CamelUrlScanner *scanner, urlpattern_t *pattern)
-{
- g_return_if_fail (scanner != NULL);
-
- e_trie_add (scanner->trie, pattern->pattern, scanner->patterns->len);
- g_ptr_array_add (scanner->patterns, pattern);
-}
-
-
-gboolean
-camel_url_scanner_scan (CamelUrlScanner *scanner, const char *in, size_t inlen, urlmatch_t *match)
-{
- const char *pos, *inend;
- urlpattern_t *pat;
- int pattern;
-
- g_return_val_if_fail (scanner != NULL, FALSE);
- g_return_val_if_fail (in != NULL, FALSE);
-
- if (!(pos = e_trie_search (scanner->trie, in, inlen, &pattern)))
- return FALSE;
-
- pat = g_ptr_array_index (scanner->patterns, pattern);
-
- match->pattern = pat->pattern;
- match->prefix = pat->prefix;
-
- inend = in + inlen;
- if (!pat->start (in, pos, inend, match))
- return FALSE;
-
- if (!pat->end (in, pos, inend, match))
- return FALSE;
-
- return TRUE;
-}
-
-
-static unsigned char url_scanner_table[256] = {
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 9, 1, 1, 9, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 24,128,160,128,128,128,128,128,160,160,128,128,160,192,160,160,
- 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,160,160, 32,128, 32,128,
- 160, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,
- 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,160,160,160,128,128,
- 128, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,
- 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,128,128,128,128, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
-};
-
-enum {
- IS_CTRL = (1 << 0),
- IS_ALPHA = (1 << 1),
- IS_DIGIT = (1 << 2),
- IS_LWSP = (1 << 3),
- IS_SPACE = (1 << 4),
- IS_SPECIAL = (1 << 5),
- IS_DOMAIN = (1 << 6),
- IS_URLSAFE = (1 << 7),
-};
-
-#define is_ctrl(x) ((url_scanner_table[(unsigned char)(x)] & IS_CTRL) != 0)
-#define is_lwsp(x) ((url_scanner_table[(unsigned char)(x)] & IS_LWSP) != 0)
-#define is_atom(x) ((url_scanner_table[(unsigned char)(x)] & (IS_SPECIAL|IS_SPACE|IS_CTRL)) == 0)
-#define is_alpha(x) ((url_scanner_table[(unsigned char)(x)] & IS_ALPHA) != 0)
-#define is_digit(x) ((url_scanner_table[(unsigned char)(x)] & IS_DIGIT) != 0)
-#define is_domain(x) ((url_scanner_table[(unsigned char)(x)] & IS_DOMAIN) != 0)
-#define is_urlsafe(x) ((url_scanner_table[(unsigned char)(x)] & (IS_ALPHA|IS_DIGIT|IS_URLSAFE)) != 0)
-
-
-gboolean
-camel_url_addrspec_start (const char *in, const char *pos, const char *inend, urlmatch_t *match)
-{
- register const char *inptr = pos;
-
- g_assert (*inptr == '@');
-
- inptr--;
-
- while (inptr > in) {
- if (is_atom (*inptr))
- inptr--;
- else
- break;
-
- while (inptr > in && is_atom (*inptr))
- inptr--;
-
- if (inptr > in && *inptr == '.')
- inptr--;
- }
-
- if (!is_atom (*inptr))
- inptr++;
-
- if (inptr == pos)
- return FALSE;
-
- match->um_so = (inptr - in);
-
- return TRUE;
-}
-
-gboolean
-camel_url_addrspec_end (const char *in, const char *pos, const char *inend, urlmatch_t *match)
-{
- const char *inptr = pos;
- int parts = 0, digits;
-
- g_assert (*inptr == '@');
-
- inptr++;
-
- if (*inptr == '[') {
- /* domain literal */
- do {
- inptr++;
-
- digits = 0;
- while (inptr < inend && is_digit (*inptr) && digits < 3) {
- inptr++;
- digits++;
- }
-
- parts++;
-
- if (*inptr != '.' && parts != 4)
- return FALSE;
- } while (parts < 4);
-
- if (*inptr == ']')
- inptr++;
- else
- return FALSE;
- } else {
- while (inptr < inend) {
- if (is_domain (*inptr))
- inptr++;
- else
- break;
-
- while (inptr < inend && is_domain (*inptr))
- inptr++;
-
- if (inptr < inend && *inptr == '.' && is_domain (inptr[1]))
- inptr++;
- }
- }
-
- if (inptr == pos + 1)
- return FALSE;
-
- match->um_eo = (inptr - in);
-
- return TRUE;
-}
-
-static struct {
- char open;
- char close;
-} url_braces[] = {
- { '(', ')' },
- { '{', '}' },
- { '[', ']' },
- { '<', '>' },
-};
-
-static char
-url_stop_at_brace (const char *in, size_t so)
-{
- int i;
-
- if (so > 0) {
- for (i = 0; i < 4; i++) {
- if (in[so - 1] == url_braces[i].open)
- return url_braces[i].close;
- }
- }
-
- return '\0';
-}
-
-gboolean
-camel_url_file_start (const char *in, const char *pos, const char *inend, urlmatch_t *match)
-{
- match->um_so = (pos - in);
-
- return TRUE;
-}
-
-gboolean
-camel_url_file_end (const char *in, const char *pos, const char *inend, urlmatch_t *match)
-{
- register const char *inptr = pos;
- char close_brace;
-
- inptr += strlen (match->pattern);
-
- if (*inptr == '/')
- inptr++;
-
- close_brace = url_stop_at_brace (in, match->um_so);
-
- while (inptr < inend && is_urlsafe (*inptr) && *inptr != close_brace)
- inptr++;
-
- if (inptr == pos)
- return FALSE;
-
- match->um_eo = (inptr - in);
-
- return TRUE;
-}
-
-gboolean
-camel_url_web_start (const char *in, const char *pos, const char *inend, urlmatch_t *match)
-{
- match->um_so = (pos - in);
-
- return TRUE;
-}
-
-gboolean
-camel_url_web_end (const char *in, const char *pos, const char *inend, urlmatch_t *match)
-{
- register const char *inptr = pos;
- int parts = 0, digits, port;
- char close_brace;
-
- inptr += strlen (match->pattern);
-
- close_brace = url_stop_at_brace (in, match->um_so);
-
- /* find the end of the domain */
- if (is_digit (*inptr)) {
- /* domain-literal */
- do {
- digits = 0;
- while (inptr < inend && is_digit (*inptr) && digits < 3) {
- inptr++;
- digits++;
- }
-
- parts++;
-
- if (*inptr != '.' && parts != 4)
- return FALSE;
- else if (*inptr == '.')
- inptr++;
-
- } while (parts < 4);
- } else if (is_domain (*inptr)) {
- while (inptr < inend) {
- if (is_domain (*inptr))
- inptr++;
- else
- break;
-
- while (inptr < inend && is_domain (*inptr))
- inptr++;
-
- if (inptr < inend && *inptr == '.' && is_domain (inptr[1]))
- inptr++;
- }
- } else {
- return FALSE;
- }
-
- if (inptr < inend) {
- switch (*inptr) {
- case ':': /* port notation */
- inptr++;
- port = 0;
-
- while (inptr < inend && is_digit (*inptr) && port < 65536)
- port = (port * 10) + (*inptr++ - '0');
-
- if (port >= 65536)
- inptr--;
-
- if (inptr >= inend || *inptr != '/')
- break;
-
- /* we have a '/' so there could be a path - fall through */
- case '/': /* we've detected a path component to our url */
- inptr++;
-
- while (inptr < inend && is_urlsafe (*inptr) && *inptr != close_brace)
- inptr++;
-
- /* urls are extremely unlikely to end with any
- * punctuation, so strip any trailing
- * punctuation off. Also strip off any closing
- * braces. */
- while (inptr > pos && strchr (",.?!)}]", inptr[-1]))
- inptr--;
-
- break;
- default:
- break;
- }
- }
-
- match->um_eo = (inptr - in);
-
- return TRUE;
-}
-
-
-
-#ifdef BUILD_TABLE
-
-#include <stdio.h>
-
-/* got these from rfc1738 */
-#define CHARS_LWSP " \t\n\r" /* linear whitespace chars */
-#define CHARS_SPECIAL "()<>@,;:\\\".[]"
-
-/* got these from rfc1738 */
-#define CHARS_URLSAFE "$-_.+!*'(),{}|\\^~[]`#%\";/?:@&="
-
-
-static void
-table_init_bits (unsigned int mask, const unsigned char *vals)
-{
- int i;
-
- for (i = 0; vals[i] != '\0'; i++)
- url_scanner_table[vals[i]] |= mask;
-}
-
-static void
-url_scanner_table_init (void)
-{
- int i;
-
- for (i = 0; i < 256; i++) {
- url_scanner_table[i] = 0;
- if (i < 32)
- url_scanner_table[i] |= IS_CTRL;
- if ((i >= '0' && i <= '9'))
- url_scanner_table[i] |= IS_DIGIT | IS_DOMAIN;
- if ((i >= 'a' && i <= 'z') || (i >= 'A' && i <= 'Z'))
- url_scanner_table[i] |= IS_ALPHA | IS_DOMAIN;
- if (i >= 127)
- url_scanner_table[i] |= IS_CTRL;
- }
-
- url_scanner_table[' '] |= IS_SPACE;
- url_scanner_table['-'] |= IS_DOMAIN;
-
- /* not defined to be special in rfc0822, but when scanning
- backwards to find the beginning of the email address we do
- not want to include this char if we come accross it - so
- this is kind of a hack */
- url_scanner_table['/'] |= IS_SPECIAL;
-
- table_init_bits (IS_LWSP, CHARS_LWSP);
- table_init_bits (IS_SPECIAL, CHARS_SPECIAL);
- table_init_bits (IS_URLSAFE, CHARS_URLSAFE);
-}
-
-int main (int argc, char **argv)
-{
- int i;
-
- url_scanner_table_init ();
-
- printf ("static unsigned char url_scanner_table[256] = {");
- for (i = 0; i < 256; i++) {
- printf ("%s%3d%s", (i % 16) ? "" : "\n\t",
- url_scanner_table[i], i != 255 ? "," : "\n");
- }
- printf ("};\n\n");
-
- return 0;
-}
-
-#endif /* BUILD_TABLE */
diff --git a/camel/camel-url-scanner.h b/camel/camel-url-scanner.h
deleted file mode 100644
index d464c2dbf0..0000000000
--- a/camel/camel-url-scanner.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2002 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifndef __CAMEL_URL_SCANNER_H__
-#define __CAMEL_URL_SCANNER_H__
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <glib.h>
-#include <sys/types.h>
-
-
-typedef struct {
- const char *pattern;
- const char *prefix;
- off_t um_so;
- off_t um_eo;
-} urlmatch_t;
-
-typedef gboolean (*CamelUrlScanFunc) (const char *in, const char *pos, const char *inend, urlmatch_t *match);
-
-/* some default CamelUrlScanFunc's */
-gboolean camel_url_file_start (const char *in, const char *pos, const char *inend, urlmatch_t *match);
-gboolean camel_url_file_end (const char *in, const char *pos, const char *inend, urlmatch_t *match);
-gboolean camel_url_web_start (const char *in, const char *pos, const char *inend, urlmatch_t *match);
-gboolean camel_url_web_end (const char *in, const char *pos, const char *inend, urlmatch_t *match);
-gboolean camel_url_addrspec_start (const char *in, const char *pos, const char *inend, urlmatch_t *match);
-gboolean camel_url_addrspec_end (const char *in, const char *pos, const char *inend, urlmatch_t *match);
-
-typedef struct {
- char *pattern;
- char *prefix;
- CamelUrlScanFunc start;
- CamelUrlScanFunc end;
-} urlpattern_t;
-
-typedef struct _CamelUrlScanner CamelUrlScanner;
-
-CamelUrlScanner *camel_url_scanner_new (void);
-void camel_url_scanner_free (CamelUrlScanner *scanner);
-
-void camel_url_scanner_add (CamelUrlScanner *scanner, urlpattern_t *pattern);
-
-gboolean camel_url_scanner_scan (CamelUrlScanner *scanner, const char *in, size_t inlen, urlmatch_t *match);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __CAMEL_URL_SCANNER_H__ */
diff --git a/camel/camel-url.c b/camel/camel-url.c
deleted file mode 100644
index 86eb4fa104..0000000000
--- a/camel/camel-url.c
+++ /dev/null
@@ -1,584 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-url.c : utility functions to parse URLs */
-
-/*
- * Authors:
- * Dan Winship <danw@ximian.com>
- * Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 1999-2001 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "camel-url.h"
-#include "camel-exception.h"
-#include "camel-mime-utils.h"
-#include "camel-object.h"
-#include "camel-string-utils.h"
-
-static void copy_param (GQuark key_id, gpointer data, gpointer user_data);
-static void output_param (GQuark key_id, gpointer data, gpointer user_data);
-
-static void append_url_encoded (GString *str, const char *in, const char *extra_enc_chars);
-
-/**
- * camel_url_new_with_base:
- * @base: a base URL
- * @url_string: the URL
- *
- * Parses @url_string relative to @base.
- *
- * Return value: a parsed CamelURL.
- **/
-CamelURL *
-camel_url_new_with_base (CamelURL *base, const char *url_string)
-{
- CamelURL *url;
- const char *end, *hash, *colon, *semi, *at, *slash, *question;
- const char *p;
-
- url = g_new0 (CamelURL, 1);
-
- /* See RFC1808 for details. IF YOU CHANGE ANYTHING IN THIS
- * FUNCTION, RUN tests/misc/url AFTERWARDS.
- */
-
- /* Find fragment. */
- end = hash = strchr (url_string, '#');
- if (hash && hash[1]) {
- url->fragment = g_strdup (hash + 1);
- camel_url_decode (url->fragment);
- } else
- end = url_string + strlen (url_string);
-
- /* Find protocol: initial [a-z+.-]* substring until ":" */
- p = url_string;
- while (p < end && (isalnum ((unsigned char)*p) ||
- *p == '.' || *p == '+' || *p == '-'))
- p++;
-
- if (p > url_string && *p == ':') {
- url->protocol = g_strndup (url_string, p - url_string);
- camel_strdown (url->protocol);
- url_string = p + 1;
- }
-
- if (!*url_string && !base)
- return url;
-
- /* Check for authority */
- if (strncmp (url_string, "//", 2) == 0) {
- url_string += 2;
-
- slash = url_string + strcspn (url_string, "/#");
- at = strchr (url_string, '@');
- if (at && at < slash) {
- colon = strchr (url_string, ':');
- if (colon && colon < at) {
- url->passwd = g_strndup (colon + 1,
- at - colon - 1);
- camel_url_decode (url->passwd);
- } else {
- url->passwd = NULL;
- colon = at;
- }
-
- semi = strchr(url_string, ';');
- if (semi && semi < colon &&
- !strncasecmp (semi, ";auth=", 6)) {
- url->authmech = g_strndup (semi + 6,
- colon - semi - 6);
- camel_url_decode (url->authmech);
- } else {
- url->authmech = NULL;
- semi = colon;
- }
-
- url->user = g_strndup (url_string, semi - url_string);
- camel_url_decode (url->user);
- url_string = at + 1;
- } else
- url->user = url->passwd = url->authmech = NULL;
-
- /* Find host and port. */
- colon = strchr (url_string, ':');
- if (colon && colon < slash) {
- url->host = g_strndup (url_string, colon - url_string);
- url->port = strtoul (colon + 1, NULL, 10);
- } else {
- url->host = g_strndup (url_string, slash - url_string);
- camel_url_decode (url->host);
- url->port = 0;
- }
-
- url_string = slash;
- }
-
- /* Find query */
- question = memchr (url_string, '?', end - url_string);
- if (question) {
- if (question[1]) {
- url->query = g_strndup (question + 1,
- end - (question + 1));
- camel_url_decode (url->query);
- }
- end = question;
- }
-
- /* Find parameters */
- semi = memchr (url_string, ';', end - url_string);
- if (semi) {
- if (semi[1]) {
- const char *cur, *p, *eq;
- char *name, *value;
-
- for (cur = semi + 1; cur < end; cur = p + 1) {
- p = memchr (cur, ';', end - cur);
- if (!p)
- p = end;
- eq = memchr (cur, '=', p - cur);
- if (eq) {
- name = g_strndup (cur, eq - cur);
- value = g_strndup (eq + 1, p - (eq + 1));
- camel_url_decode (value);
- } else {
- name = g_strndup (cur, p - cur);
- value = g_strdup ("");
- }
- camel_url_decode (name);
- g_datalist_set_data_full (&url->params, name,
- value, g_free);
- g_free (name);
- }
- }
- end = semi;
- }
-
- if (end != url_string) {
- url->path = g_strndup (url_string, end - url_string);
- camel_url_decode (url->path);
- }
-
- /* Apply base URL. Again, this is spelled out in RFC 1808. */
- if (base && !url->protocol && url->host)
- url->protocol = g_strdup (base->protocol);
- else if (base && !url->protocol) {
- if (!url->user && !url->authmech && !url->passwd &&
- !url->host && !url->port && !url->path &&
- !url->params && !url->query && !url->fragment)
- url->fragment = g_strdup (base->fragment);
-
- url->protocol = g_strdup (base->protocol);
- url->user = g_strdup (base->user);
- url->authmech = g_strdup (base->authmech);
- url->passwd = g_strdup (base->passwd);
- url->host = g_strdup (base->host);
- url->port = base->port;
-
- if (!url->path) {
- url->path = g_strdup (base->path);
- if (!url->params) {
- g_datalist_foreach (&base->params, copy_param,
- &url->params);
- if (!url->query)
- url->query = g_strdup (base->query);
- }
- } else if (*url->path != '/') {
- char *newpath, *last, *p, *q;
-
- last = strrchr (base->path, '/');
- if (last) {
- newpath = g_strdup_printf ("%.*s/%s",
- last - base->path,
- base->path,
- url->path);
- } else
- newpath = g_strdup_printf ("/%s", url->path);
-
- /* Remove "./" where "." is a complete segment. */
- for (p = newpath + 1; *p; ) {
- if (*(p - 1) == '/' &&
- *p == '.' && *(p + 1) == '/')
- memmove (p, p + 2, strlen (p + 2) + 1);
- else
- p++;
- }
- /* Remove "." at end. */
- if (p > newpath + 2 &&
- *(p - 1) == '.' && *(p - 2) == '/')
- *(p - 1) = '\0';
- /* Remove "<segment>/../" where <segment> != ".." */
- for (p = newpath + 1; *p; ) {
- if (!strncmp (p, "../", 3)) {
- p += 3;
- continue;
- }
- q = strchr (p + 1, '/');
- if (!q)
- break;
- if (strncmp (q, "/../", 4) != 0) {
- p = q + 1;
- continue;
- }
- memmove (p, q + 4, strlen (q + 4) + 1);
- p = newpath + 1;
- }
- /* Remove "<segment>/.." at end */
- q = strrchr (newpath, '/');
- if (q && !strcmp (q, "/..")) {
- p = q - 1;
- while (p > newpath && *p != '/')
- p--;
- if (strncmp (p, "/../", 4) != 0)
- *(p + 1) = 0;
- }
- g_free (url->path);
- url->path = newpath;
- }
- }
-
- return url;
-}
-
-static void
-copy_param (GQuark key_id, gpointer data, gpointer user_data)
-{
- GData **copy = user_data;
-
- g_datalist_id_set_data_full (copy, key_id, g_strdup (data), g_free);
-}
-
-/**
- * camel_url_new:
- * @url_string: a URL
- * @ex: a CamelException
- *
- * Parses an absolute URL.
- *
- * Return value: a CamelURL, or %NULL.
- **/
-CamelURL *
-camel_url_new (const char *url_string, CamelException *ex)
-{
- CamelURL *url = camel_url_new_with_base (NULL, url_string);
-
- if (!url->protocol) {
- camel_url_free (url);
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_URL_INVALID,
- _("Could not parse URL `%s'"),
- url_string);
- return NULL;
- }
- return url;
-}
-
-/**
- * camel_url_to_string:
- * @url: a CamelURL
- * @flags: additional translation options.
- *
- * Return value: a string representing @url, which the caller must free.
- **/
-char *
-camel_url_to_string (CamelURL *url, guint32 flags)
-{
- GString *str;
- char *return_result;
-
- /* IF YOU CHANGE ANYTHING IN THIS FUNCTION, RUN
- * tests/misc/url AFTERWARD.
- */
-
- str = g_string_sized_new (20);
-
- if (url->protocol)
- g_string_append_printf (str, "%s:", url->protocol);
-
- if (url->host) {
- g_string_append (str, "//");
- if (url->user) {
- append_url_encoded (str, url->user, ":;@/");
- if (url->authmech && *url->authmech) {
- g_string_append (str, ";auth=");
- append_url_encoded (str, url->authmech, ":@/");
- }
- if (url->passwd && !(flags & CAMEL_URL_HIDE_PASSWORD)) {
- g_string_append_c (str, ':');
- append_url_encoded (str, url->passwd, "@/");
- }
- g_string_append_c (str, '@');
- }
- append_url_encoded (str, url->host, ":/");
- if (url->port)
- g_string_append_printf (str, ":%d", url->port);
- if (!url->path && (url->params || url->query || url->fragment))
- g_string_append_c (str, '/');
- }
-
- if (url->path)
- append_url_encoded (str, url->path, ";?");
- if (url->params && !(flags & CAMEL_URL_HIDE_PARAMS))
- g_datalist_foreach (&url->params, output_param, str);
- if (url->query) {
- g_string_append_c (str, '?');
- append_url_encoded (str, url->query, NULL);
- }
- if (url->fragment) {
- g_string_append_c (str, '#');
- append_url_encoded (str, url->fragment, NULL);
- }
-
- return_result = str->str;
- g_string_free (str, FALSE);
-
- return return_result;
-}
-
-static void
-output_param (GQuark key_id, gpointer data, gpointer user_data)
-{
- GString *str = user_data;
-
- g_string_append_c (str, ';');
- append_url_encoded (str, g_quark_to_string (key_id), "?=");
- if (*(char *)data) {
- g_string_append_c (str, '=');
- append_url_encoded (str, data, "?");
- }
-}
-
-/**
- * camel_url_free:
- * @url: a CamelURL
- *
- * Frees @url
- **/
-void
-camel_url_free (CamelURL *url)
-{
- if (url) {
- g_free (url->protocol);
- g_free (url->user);
- g_free (url->authmech);
- g_free (url->passwd);
- g_free (url->host);
- g_free (url->path);
- g_datalist_clear (&url->params);
- g_free (url->query);
- g_free (url->fragment);
-
- g_free (url);
- }
-}
-
-
-#define DEFINE_CAMEL_URL_SET(part) \
-void \
-camel_url_set_##part (CamelURL *url, const char *part) \
-{ \
- g_free (url->part); \
- url->part = g_strdup (part); \
-}
-
-DEFINE_CAMEL_URL_SET (protocol)
-DEFINE_CAMEL_URL_SET (user)
-DEFINE_CAMEL_URL_SET (authmech)
-DEFINE_CAMEL_URL_SET (passwd)
-DEFINE_CAMEL_URL_SET (host)
-DEFINE_CAMEL_URL_SET (path)
-DEFINE_CAMEL_URL_SET (query)
-DEFINE_CAMEL_URL_SET (fragment)
-
-void
-camel_url_set_port (CamelURL *url, int port)
-{
- url->port = port;
-}
-
-void
-camel_url_set_param (CamelURL *url, const char *name, const char *value)
-{
- g_datalist_set_data_full (&url->params, name, value ? g_strdup (value) : NULL, g_free);
-}
-
-const char *
-camel_url_get_param (CamelURL *url, const char *name)
-{
- return g_datalist_get_data (&url->params, name);
-}
-
-/* From RFC 2396 2.4.3, the characters that should always be encoded */
-static const char url_encoded_char[] = {
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x00 - 0x0f */
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x10 - 0x1f */
- 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* ' ' - '/' */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, /* '0' - '?' */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* '@' - 'O' */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, /* 'P' - '_' */
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* '`' - 'o' */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, /* 'p' - 0x7f */
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
-};
-
-static void
-append_url_encoded (GString *str, const char *in, const char *extra_enc_chars)
-{
- const unsigned char *s = (const unsigned char *)in;
-
- while (*s) {
- if (url_encoded_char[*s] ||
- (extra_enc_chars && strchr (extra_enc_chars, *s)))
- g_string_append_printf (str, "%%%02x", (int)*s++);
- else
- g_string_append_c (str, *s++);
- }
-}
-
-/**
- * camel_url_encode:
- * @part: a URL part
- * @escape_extra: additional characters beyond " \"%#<>{}|\^[]`"
- * to escape (or %NULL)
- *
- * This %-encodes the given URL part and returns the escaped version
- * in allocated memory, which the caller must free when it is done.
- **/
-char *
-camel_url_encode (const char *part, const char *escape_extra)
-{
- GString *str;
- char *encoded;
-
- str = g_string_new (NULL);
- append_url_encoded (str, part, escape_extra);
- encoded = str->str;
- g_string_free (str, FALSE);
-
- return encoded;
-}
-
-/**
- * camel_url_decode:
- * @part: a URL part
- *
- * %-decodes the passed-in URL *in place*. The decoded version is
- * never longer than the encoded version, so there does not need to
- * be any additional space at the end of the string.
- */
-void
-camel_url_decode (char *part)
-{
- unsigned char *s, *d;
-
-#define XDIGIT(c) ((c) <= '9' ? (c) - '0' : ((c) & 0x4F) - 'A' + 10)
-
- s = d = (unsigned char *)part;
- do {
- if (*s == '%' && isxdigit(s[1]) && isxdigit(s[2])) {
- *d++ = (XDIGIT (s[1]) << 4) + XDIGIT (s[2]);
- s += 2;
- } else
- *d++ = *s;
- } while (*s++);
-}
-
-
-guint
-camel_url_hash (const void *v)
-{
- const CamelURL *u = v;
- guint hash = 0;
-
-#define ADD_HASH(s) if (s) hash ^= g_str_hash (s);
-
- ADD_HASH (u->protocol);
- ADD_HASH (u->user);
- ADD_HASH (u->authmech);
- ADD_HASH (u->host);
- ADD_HASH (u->path);
- ADD_HASH (u->query);
- hash ^= u->port;
-
- return hash;
-}
-
-static int
-check_equal (char *s1, char *s2)
-{
- if (s1 == NULL) {
- if (s2 == NULL)
- return TRUE;
- else
- return FALSE;
- }
-
- if (s2 == NULL)
- return FALSE;
-
- return strcmp (s1, s2) == 0;
-}
-
-int
-camel_url_equal(const void *v, const void *v2)
-{
- const CamelURL *u1 = v, *u2 = v2;
-
- return check_equal(u1->protocol, u2->protocol)
- && check_equal(u1->user, u2->user)
- && check_equal(u1->authmech, u2->authmech)
- && check_equal(u1->host, u2->host)
- && check_equal(u1->path, u2->path)
- && check_equal(u1->query, u2->query)
- && u1->port == u2->port;
-}
-
-CamelURL *
-camel_url_copy(const CamelURL *in)
-{
- CamelURL *out;
-
- out = g_malloc(sizeof(*out));
- out->protocol = g_strdup(in->protocol);
- out->user = g_strdup(in->user);
- out->authmech = g_strdup(in->authmech);
- out->passwd = g_strdup(in->passwd);
- out->host = g_strdup(in->host);
- out->port = in->port;
- out->path = g_strdup(in->path);
- out->params = NULL;
- if (in->params)
- g_datalist_foreach(&((CamelURL *)in)->params, copy_param, &out->params);
- out->query = g_strdup(in->query);
- out->fragment = g_strdup(in->fragment);
-
- return out;
-}
diff --git a/camel/camel-url.h b/camel/camel-url.h
deleted file mode 100644
index 4efa315b3f..0000000000
--- a/camel/camel-url.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-url.h : utility functions to parse URLs */
-
-/*
- * Authors:
- * Bertrand Guiheneuf <bertrand@helixcode.com>
- * Dan Winship <danw@ximian.com>
- *
- * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifndef CAMEL_URL_H
-#define CAMEL_URL_H 1
-
-#include <glib.h>
-#include <camel/camel-types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-/* if this changes, remember to change camel_url_copy */
-typedef struct _CamelURL {
- char *protocol;
- char *user;
- char *authmech;
- char *passwd;
- char *host;
- int port;
- char *path;
- GData *params;
- char *query;
- char *fragment;
-} CamelURL;
-
-#define CAMEL_URL_HIDE_PASSWORD (1 << 0)
-#define CAMEL_URL_HIDE_PARAMS (1 << 1)
-#define CAMEL_URL_HIDE_AUTH (1 << 2)
-
-#define CAMEL_URL_HIDE_ALL (CAMEL_URL_HIDE_PASSWORD | CAMEL_URL_HIDE_PARAMS | CAMEL_URL_HIDE_AUTH)
-
-CamelURL *camel_url_new_with_base (CamelURL *base, const char *url_string);
-CamelURL *camel_url_new (const char *url_string, CamelException *ex);
-char *camel_url_to_string (CamelURL *url, guint32 flags);
-void camel_url_free (CamelURL *url);
-
-char *camel_url_encode (const char *part, const char *escape_extra);
-void camel_url_decode (char *part);
-
-/* for editing url's */
-void camel_url_set_protocol (CamelURL *url, const char *protocol);
-void camel_url_set_user (CamelURL *url, const char *user);
-void camel_url_set_authmech (CamelURL *url, const char *authmech);
-void camel_url_set_passwd (CamelURL *url, const char *passwd);
-void camel_url_set_host (CamelURL *url, const char *host);
-void camel_url_set_port (CamelURL *url, int port);
-void camel_url_set_path (CamelURL *url, const char *path);
-void camel_url_set_param (CamelURL *url, const char *name, const char *value);
-void camel_url_set_query (CamelURL *url, const char *query);
-void camel_url_set_fragment (CamelURL *url, const char *fragment);
-
-const char *camel_url_get_param (CamelURL *url, const char *name);
-
-/* for putting url's into hash tables */
-guint camel_url_hash (const void *v);
-int camel_url_equal(const void *v, const void *v2);
-CamelURL *camel_url_copy(const CamelURL *in);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* URL_UTIL_H */
diff --git a/camel/camel-utf8.c b/camel/camel-utf8.c
deleted file mode 100644
index 8fd422c944..0000000000
--- a/camel/camel-utf8.c
+++ /dev/null
@@ -1,400 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * Copyright 2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-
-#include <glib.h>
-#include "camel-utf8.h"
-
-#include <netinet/in.h>
-
-/**
- * camel_utf8_putc:
- * @ptr:
- * @c:
- *
- * Output a 32 bit unicode character as utf8 octets. At most 4 octets will
- * be written to @ptr. @ptr will be advanced to the next character position.
- **/
-void
-camel_utf8_putc(unsigned char **ptr, guint32 c)
-{
- register unsigned char *p = *ptr;
-
- if (c <= 0x7f)
- *p++ = c;
- else if (c <= 0x7ff) {
- *p++ = 0xc0 | c >> 6;
- *p++ = 0x80 | (c & 0x3f);
- } else if (c <= 0xffff) {
- *p++ = 0xe0 | c >> 12;
- *p++ = 0x80 | ((c >> 6) & 0x3f);
- *p++ = 0x80 | (c & 0x3f);
- } else {
- /* see unicode standard 3.0, S 3.8, max 4 octets */
- *p++ = 0xf0 | c >> 18;
- *p++ = 0x80 | ((c >> 12) & 0x3f);
- *p++ = 0x80 | ((c >> 6) & 0x3f);
- *p++ = 0x80 | (c & 0x3f);
- }
-
- *ptr = p;
-}
-
-/**
- * camel_utf8_getc:
- * @ptr:
- *
- * Get a Unicode character from a utf8 stream. @ptr will be advanced
- * to the next character position. Invalid utf8 characters will be
- * silently skipped. @ptr should point to a NUL terminated array.
- *
- * Return value: The next Unicode character. @ptr will be advanced to
- * the next character always.
- **/
-guint32
-camel_utf8_getc(const unsigned char **ptr)
-{
- register unsigned char *p = (unsigned char *)*ptr;
- register unsigned char c, r;
- register guint32 v, m;
-
-again:
- r = *p++;
-loop:
- if (r < 0x80) {
- *ptr = p;
- v = r;
- } else if (r < 0xf8) { /* valid start char? (max 4 octets) */
- v = r;
- m = 0x7f80; /* used to mask out the length bits */
- do {
- c = *p++;
- if ((c & 0xc0) != 0x80) {
- r = c;
- goto loop;
- }
- v = (v<<6) | (c & 0x3f);
- r<<=1;
- m<<=5;
- } while (r & 0x40);
-
- *ptr = p;
-
- v &= ~m;
- } else {
- goto again;
- }
-
- return v;
-}
-
-/**
- * camel_utf8_getc_limit:
- * @ptr:
- * @end: must not be NULL.
- *
- * Get the next utf8 char at @ptr, and return it, advancing @ptr to
- * the next character. If @end is reached before a full utf8
- * character can be read, then the invalid Unicode char 0xffff is
- * returned as a sentinel (Unicode 3.1, section 2.7), and @ptr is not
- * advanced.
- *
- * Return value: The next utf8 char, or 0xffff.
- **/
-guint32
-camel_utf8_getc_limit(const unsigned char **ptr, const unsigned char *end)
-{
- register unsigned char *p = (unsigned char *)*ptr;
- register unsigned char c, r;
- register guint32 v = 0xffff, m;
-
-again:
- while (p < end) {
- r = *p++;
-loop:
- if (r < 0x80) {
- *ptr = p;
- return r;
- } else if (r < 0xf8) { /* valid start char? (max 4 octets) */
- v = r;
- m = 0x7f80; /* used to mask out the length bits */
- do {
- if (p >= end)
- return 0xffff;
-
- c = *p++;
- if ((c & 0xc0) != 0x80) {
- r = c;
- goto loop;
- }
- v = (v<<6) | (c & 0x3f);
- r<<=1;
- m<<=5;
- } while (r & 0x40);
-
- *ptr = p;
-
- v &= ~m;
- return v;
- } else {
- goto again;
- }
- }
-
- return 0xffff;
-}
-
-void
-g_string_append_u(GString *out, guint32 c)
-{
- unsigned char buffer[8];
- unsigned char *p = buffer;
-
- camel_utf8_putc(&p, c);
- *p = 0;
- g_string_append(out, buffer);
-}
-
-static char *utf7_alphabet =
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+,";
-
-static unsigned char utf7_rank[256] = {
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3e,0x3f,0xff,0xff,0xff,
- 0x34,0x35,0x36,0x37,0x38,0x39,0x3a,0x3b,0x3c,0x3d,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,
- 0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0xff,0xff,0xff,0xff,0xff,
- 0xff,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,
- 0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,0x30,0x31,0x32,0x33,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
-};
-
-/**
- * camel_utf7_utf8:
- * @ptr:
- *
- * Convert a modified utf7 string to utf8. If the utf7 string
- * contains 8 bit characters, they are treated as iso-8859-1.
- *
- * The IMAP rules [rfc2060] are used in the utf7 encoding.
- *
- * Return value: The converted string.
- **/
-char *
-camel_utf7_utf8(const char *ptr)
-{
- const unsigned char *p = (unsigned char *)ptr;
- unsigned int c;
- guint32 v=0, x;
- GString *out;
- int i=0;
- int state = 0;
- char *ret;
-
- out = g_string_new("");
- do {
- c = *p++;
- switch(state) {
- case 0:
- if (c == '&')
- state = 1;
- else
- g_string_append_u(out, c);
- break;
- case 1:
- if (c == '-') {
- g_string_append_c(out, '&');
- state = 0;
- } else if (utf7_rank[c] != 0xff) {
- v = utf7_rank[c];
- i = 6;
- state = 2;
- } else {
- /* invalid */
- g_string_append(out, "&-");
- state = 0;
- }
- break;
- case 2:
- if (c == '-') {
- state = 0;
- } else if (utf7_rank[c] != 0xff) {
- v = (v<<6) | utf7_rank[c];
- i+=6;
- if (i >= 16) {
- x = (v >> (i-16)) & 0xffff;
- g_string_append_u(out, x);
- i-=16;
- }
- } else {
- g_string_append_u(out, c);
- state = 0;
- }
- break;
- }
- } while (c);
-
- ret = g_strdup(out->str);
- g_string_free(out, TRUE);
-
- return ret;
-}
-
-static void utf7_closeb64(GString *out, guint32 v, guint32 i)
-{
- guint32 x;
-
- if (i>0) {
- x = (v << (6-i)) & 0x3f;
- g_string_append_c(out, utf7_alphabet[x]);
- }
- g_string_append_c(out, '-');
-}
-
-/**
- * camel_utf8_utf7:
- * @ptr:
- *
- * Convert a utf8 string to a modified utf7 format.
- *
- * The IMAP rules [rfc2060] are used in the utf7 encoding.
- *
- * Return value:
- **/
-char *
-camel_utf8_utf7(const char *ptr)
-{
- const unsigned char *p = (unsigned char *)ptr;
- unsigned int c;
- guint32 x, v = 0;
- int state = 0;
- GString *out;
- int i = 0;
- char *ret;
-
- out = g_string_new("");
-
- while ( (c = camel_utf8_getc(&p)) ) {
- if (c >= 0x20 && c <= 0x7e) {
- if (state == 1) {
- utf7_closeb64(out, v, i);
- state = 0;
- i = 0;
- }
- if (c == '&')
- g_string_append(out, "&-");
- else
- g_string_append_c(out, c);
- } else {
- if (state == 0) {
- g_string_append_c(out, '&');
- state = 1;
- }
- v = (v << 16) | c;
- i += 16;
- while (i >= 6) {
- x = (v >> (i-6)) & 0x3f;
- g_string_append_c(out, utf7_alphabet[x]);
- i -= 6;
- }
- }
- }
-
- if (state == 1)
- utf7_closeb64(out, v, i);
-
- ret = g_strdup(out->str);
- g_string_free(out, TRUE);
-
- return ret;
-}
-
-/**
- * camel_utf8_ucs2:
- * @ptr:
- *
- * Convert a utf8 string into a ucs2 one. The ucs string will be in
- * network byte order, and terminated with a 16 bit NULL.
- *
- * Return value:
- **/
-char *
-camel_utf8_ucs2(const char *ptr)
-{
- GByteArray *work = g_byte_array_new();
- guint32 c;
- char *out;
-
- /* what if c is > 0xffff ? */
-
- while ( (c = camel_utf8_getc((const unsigned char **)&ptr)) ) {
- guint16 s = htons(c);
-
- g_byte_array_append(work, (char *)&s, 2);
- }
-
- g_byte_array_append(work, "\000\000", 2);
- out = g_malloc(work->len);
- memcpy(out, work->data, work->len);
- g_byte_array_free(work, TRUE);
-
- return out;
-}
-
-/**
- * camel_ucs2_utf8:
- * @ptr:
- *
- * Convert a ucs2 string into a utf8 one. The ucs2 string is treated
- * as network byte ordered, and terminated with a 16 bit NUL.
- *
- * Return value:
- **/
-char *camel_ucs2_utf8(const char *ptr)
-{
- guint16 *ucs = (guint16 *)ptr;
- guint32 c;
- GString *work = g_string_new("");
- char *out;
-
- while ( (c = *ucs++) )
- g_string_append_u(work, ntohs(c));
-
- out = g_strdup(work->str);
- g_string_free(work, TRUE);
-
- return out;
-}
diff --git a/camel/camel-utf8.h b/camel/camel-utf8.h
deleted file mode 100644
index fadce2c7e6..0000000000
--- a/camel/camel-utf8.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * Copyright 2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef _CAMEL_UTF8_H
-#define _CAMEL_UTF8_H
-
-void camel_utf8_putc(unsigned char **ptr, guint32 c);
-guint32 camel_utf8_getc(const unsigned char **ptr);
-guint32 camel_utf8_getc_limit (const unsigned char **ptr, const unsigned char *end);
-
-/* utility func for utf8 gstrings */
-void g_string_append_u(GString *out, guint32 c);
-
-/* convert utf7 to/from utf8, actually this is modified IMAP utf7 */
-char *camel_utf7_utf8(const char *ptr);
-char *camel_utf8_utf7(const char *ptr);
-
-/* convert ucs2 to/from utf8 */
-char *camel_utf8_ucs2(const char *ptr);
-char *camel_ucs2_utf8(const char *ptr);
-
-#endif /* ! _CAMEL_UTF8_H */
diff --git a/camel/camel-vee-folder.c b/camel/camel-vee-folder.c
deleted file mode 100644
index f7ceb12d59..0000000000
--- a/camel/camel-vee-folder.c
+++ /dev/null
@@ -1,1683 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2000-2003 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- * Jeffrey Stedfast <fejj@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-#include <pthread.h>
-
-#include "camel-exception.h"
-#include "camel-vee-folder.h"
-#include "camel-store.h"
-#include "camel-folder-summary.h"
-#include "camel-mime-message.h"
-#include "camel-folder-search.h"
-
-#include "camel-session.h"
-#include "camel-vee-store.h" /* for open flags */
-#include "camel-private.h"
-
-#include "e-util/md5-utils.h"
-
-#if defined (DOEPOOLV) || defined (DOESTRV)
-#include "e-util/e-memory.h"
-#endif
-
-#define d(x)
-extern int camel_verbose_debug;
-#define dd(x) (camel_verbose_debug?(x):0)
-
-#define _PRIVATE(o) (((CamelVeeFolder *)(o))->priv)
-
-static void vee_refresh_info(CamelFolder *folder, CamelException *ex);
-
-static void vee_sync (CamelFolder *folder, gboolean expunge, CamelException *ex);
-static void vee_expunge (CamelFolder *folder, CamelException *ex);
-
-static void vee_freeze (CamelFolder *folder);
-static void vee_thaw (CamelFolder *folder);
-
-static CamelMimeMessage *vee_get_message (CamelFolder *folder, const gchar *uid, CamelException *ex);
-static void vee_append_message(CamelFolder *folder, CamelMimeMessage *message, const CamelMessageInfo *info, char **appended_uid, CamelException *ex);
-static void vee_transfer_messages_to(CamelFolder *source, GPtrArray *uids, CamelFolder *dest, GPtrArray **transferred_uids, gboolean delete_originals, CamelException *ex);
-
-static GPtrArray *vee_search_by_expression(CamelFolder *folder, const char *expression, CamelException *ex);
-static GPtrArray *vee_search_by_uids(CamelFolder *folder, const char *expression, GPtrArray *uids, CamelException *ex);
-
-static void vee_set_message_flags (CamelFolder *folder, const char *uid, guint32 flags, guint32 set);
-static void vee_set_message_user_flag (CamelFolder *folder, const char *uid, const char *name, gboolean value);
-static void vee_set_message_user_tag(CamelFolder *folder, const char *uid, const char *name, const char *value);
-static void vee_rename(CamelFolder *folder, const char *new);
-
-static void camel_vee_folder_class_init (CamelVeeFolderClass *klass);
-static void camel_vee_folder_init (CamelVeeFolder *obj);
-static void camel_vee_folder_finalise (CamelObject *obj);
-
-static int vee_folder_build_folder(CamelVeeFolder *vf, CamelFolder *source, CamelException *ex);
-static void vee_folder_remove_folder(CamelVeeFolder *vf, CamelFolder *source, int killun);
-
-static void message_changed(CamelFolder *f, const char *uid, CamelVeeFolder *vf);
-static void folder_changed(CamelFolder *sub, CamelFolderChangeInfo *changes, CamelVeeFolder *vf);
-static void subfolder_deleted(CamelFolder *f, void *event_data, CamelVeeFolder *vf);
-
-static void folder_changed_remove_uid(CamelFolder *sub, const char *uid, const char hash[8], int keep, CamelVeeFolder *vf);
-
-static CamelFolderClass *camel_vee_folder_parent;
-
-/* a vfolder for unmatched messages */
-/* use folder_unmatched->summary_lock for access to unmatched_uids or appropriate internals, for consistency */
-static CamelVeeFolder *folder_unmatched;
-static GHashTable *unmatched_uids; /* a refcount of uid's that are matched by any rules */
-static pthread_mutex_t unmatched_lock = PTHREAD_MUTEX_INITIALIZER;
-/* only used to initialise folder_unmatched */
-#define UNMATCHED_LOCK() pthread_mutex_lock(&unmatched_lock)
-#define UNMATCHED_UNLOCK() pthread_mutex_unlock(&unmatched_lock)
-
-
-CamelType
-camel_vee_folder_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_folder_get_type (), "CamelVeeFolder",
- sizeof (CamelVeeFolder),
- sizeof (CamelVeeFolderClass),
- (CamelObjectClassInitFunc) camel_vee_folder_class_init,
- NULL,
- (CamelObjectInitFunc) camel_vee_folder_init,
- (CamelObjectFinalizeFunc) camel_vee_folder_finalise);
- }
-
- return type;
-}
-
-static void
-camel_vee_folder_class_init (CamelVeeFolderClass *klass)
-{
- CamelFolderClass *folder_class = (CamelFolderClass *) klass;
-
- camel_vee_folder_parent = CAMEL_FOLDER_CLASS(camel_type_get_global_classfuncs (camel_folder_get_type ()));
-
- folder_class->refresh_info = vee_refresh_info;
- folder_class->sync = vee_sync;
- folder_class->expunge = vee_expunge;
-
- folder_class->get_message = vee_get_message;
- folder_class->append_message = vee_append_message;
- folder_class->transfer_messages_to = vee_transfer_messages_to;
-
- folder_class->search_by_expression = vee_search_by_expression;
- folder_class->search_by_uids = vee_search_by_uids;
-
- folder_class->set_message_flags = vee_set_message_flags;
- folder_class->set_message_user_flag = vee_set_message_user_flag;
- folder_class->set_message_user_tag = vee_set_message_user_tag;
-
- folder_class->rename = vee_rename;
-
- folder_class->freeze = vee_freeze;
- folder_class->thaw = vee_thaw;
-}
-
-static void
-camel_vee_folder_init (CamelVeeFolder *obj)
-{
- struct _CamelVeeFolderPrivate *p;
- CamelFolder *folder = (CamelFolder *)obj;
-
- p = _PRIVATE(obj) = g_malloc0(sizeof(*p));
-
- folder->folder_flags |= (CAMEL_FOLDER_HAS_SUMMARY_CAPABILITY |
- CAMEL_FOLDER_HAS_SEARCH_CAPABILITY);
-
- /* FIXME: what to do about user flags if the subfolder doesn't support them? */
- folder->permanent_flags = CAMEL_MESSAGE_ANSWERED |
- CAMEL_MESSAGE_DELETED |
- CAMEL_MESSAGE_DRAFT |
- CAMEL_MESSAGE_FLAGGED |
- CAMEL_MESSAGE_SEEN;
-
- obj->changes = camel_folder_change_info_new();
- obj->search = camel_folder_search_new();
-
- p->summary_lock = g_mutex_new();
- p->subfolder_lock = g_mutex_new();
- p->changed_lock = g_mutex_new();
-}
-
-static void
-camel_vee_folder_finalise (CamelObject *obj)
-{
- CamelVeeFolder *vf = (CamelVeeFolder *)obj;
- struct _CamelVeeFolderPrivate *p = _PRIVATE(vf);
- GList *node;
-
- /* FIXME: check leaks */
- node = p->folders;
- while (node) {
- CamelFolder *f = node->data;
-
- if (vf != folder_unmatched) {
- camel_object_unhook_event((CamelObject *)f, "folder_changed", (CamelObjectEventHookFunc) folder_changed, vf);
- camel_object_unhook_event((CamelObject *)f, "message_changed", (CamelObjectEventHookFunc) message_changed, vf);
- camel_object_unhook_event((CamelObject *)f, "deleted", (CamelObjectEventHookFunc) subfolder_deleted, vf);
- /* this updates the vfolder */
- if ((vf->flags & CAMEL_STORE_FOLDER_PRIVATE) == 0)
- vee_folder_remove_folder(vf, f, FALSE);
- }
- camel_object_unref((CamelObject *)f);
-
- node = g_list_next(node);
- }
-
- g_free(vf->expression);
- g_free(vf->vname);
-
- g_list_free(p->folders);
- g_list_free(p->folders_changed);
-
- camel_folder_change_info_free(vf->changes);
- camel_object_unref((CamelObject *)vf->search);
-
- g_mutex_free(p->summary_lock);
- g_mutex_free(p->subfolder_lock);
- g_mutex_free(p->changed_lock);
-
- g_free(p);
-}
-
-static void
-vee_folder_construct (CamelVeeFolder *vf, CamelStore *parent_store, const char *name, guint32 flags)
-{
- CamelFolder *folder = (CamelFolder *)vf;
- char *tmp;
-
- vf->flags = flags;
- vf->vname = g_strdup(name);
- tmp = strrchr(vf->vname, '/');
- if (tmp)
- tmp++;
- else
- tmp = vf->vname;
- camel_folder_construct(folder, parent_store, vf->vname, tmp);
-
- /* should CamelVeeMessageInfo be subclassable ..? */
- folder->summary = camel_folder_summary_new();
- folder->summary->message_info_size = sizeof(CamelVeeMessageInfo);
-}
-
-void
-camel_vee_folder_construct(CamelVeeFolder *vf, CamelStore *parent_store, const char *name, guint32 flags)
-{
- UNMATCHED_LOCK();
-
- /* setup unmatched folder if we haven't yet */
- if (folder_unmatched == NULL) {
- unmatched_uids = g_hash_table_new (g_str_hash, g_str_equal);
- folder_unmatched = (CamelVeeFolder *)camel_object_new (camel_vee_folder_get_type ());
- d(printf("created foldeer unmatched %p\n", folder_unmatched));
-
- vee_folder_construct (folder_unmatched, parent_store, CAMEL_UNMATCHED_NAME, CAMEL_STORE_FOLDER_PRIVATE);
- }
-
- UNMATCHED_UNLOCK();
-
- vee_folder_construct (vf, parent_store, name, flags);
-}
-
-/**
- * camel_vee_folder_new:
- * @parent_store: the parent CamelVeeStore
- * @name: the vfolder name
- * @ex: a CamelException
- *
- * Create a new CamelVeeFolder object.
- *
- * Return value: A new CamelVeeFolder widget.
- **/
-CamelFolder *
-camel_vee_folder_new(CamelStore *parent_store, const char *name, guint32 flags)
-{
- CamelVeeFolder *vf;
-
- UNMATCHED_LOCK();
-
- /* setup unmatched folder if we haven't yet */
- if (folder_unmatched == NULL) {
- unmatched_uids = g_hash_table_new(g_str_hash, g_str_equal);
- folder_unmatched = vf = (CamelVeeFolder *)camel_object_new(camel_vee_folder_get_type());
- d(printf("created foldeer unmatched %p\n", folder_unmatched));
- vee_folder_construct (vf, parent_store, CAMEL_UNMATCHED_NAME, CAMEL_STORE_FOLDER_PRIVATE);
- }
-
- UNMATCHED_UNLOCK();
-
- if (strcmp(name, CAMEL_UNMATCHED_NAME) == 0) {
- camel_object_ref((CamelObject *)folder_unmatched);
- d(printf("returning unmatched %p, count = %d\n", folder_unmatched, camel_folder_get_message_count((CamelFolder *)folder_unmatched)));
- return (CamelFolder *)folder_unmatched;
- }
-
- vf = (CamelVeeFolder *)camel_object_new(camel_vee_folder_get_type());
- vee_folder_construct(vf, parent_store, name, flags);
-
- d(printf("returning folder %s %p, count = %d\n", name, vf, camel_folder_get_message_count((CamelFolder *)vf)));
-
- return (CamelFolder *)vf;
-}
-
-void
-camel_vee_folder_set_expression(CamelVeeFolder *vf, const char *query)
-{
- struct _CamelVeeFolderPrivate *p = _PRIVATE(vf);
- GList *node;
-
- CAMEL_VEE_FOLDER_LOCK(vf, subfolder_lock);
-
- /* no change, do nothing */
- if ((vf->expression && query && strcmp(vf->expression, query) == 0)
- || (vf->expression == NULL && query == NULL)) {
- CAMEL_VEE_FOLDER_UNLOCK(vf, subfolder_lock);
- return;
- }
-
- g_free(vf->expression);
- if (query)
- vf->expression = g_strdup(query);
-
- node = p->folders;
- while (node) {
- CamelFolder *f = node->data;
-
- if (vee_folder_build_folder(vf, f, NULL) == -1)
- break;
-
- node = node->next;
- }
-
- CAMEL_VEE_FOLDER_LOCK(vf, changed_lock);
- g_list_free(p->folders_changed);
- p->folders_changed = NULL;
- CAMEL_VEE_FOLDER_UNLOCK(vf, changed_lock);
-
- CAMEL_VEE_FOLDER_UNLOCK(vf, subfolder_lock);
-}
-
-/**
- * camel_vee_folder_add_folder:
- * @vf: Virtual Folder object
- * @sub: source CamelFolder to add to @vf
- *
- * Adds @sub as a source folder to @vf.
- **/
-void
-camel_vee_folder_add_folder(CamelVeeFolder *vf, CamelFolder *sub)
-{
- struct _CamelVeeFolderPrivate *p = _PRIVATE(vf), *up = _PRIVATE(folder_unmatched);
- int i;
-
- if (vf == (CamelVeeFolder *)sub) {
- g_warning("Adding a virtual folder to itself as source, ignored");
- return;
- }
-
- CAMEL_VEE_FOLDER_LOCK(vf, subfolder_lock);
-
- /* for normal vfolders we want only unique ones, for unmatched we want them all recorded */
- if (g_list_find(p->folders, sub) == NULL) {
- camel_object_ref((CamelObject *)sub);
- p->folders = g_list_append(p->folders, sub);
-
- /* update the freeze state of 'sub' to match our freeze state */
- for (i = 0; i < p->freeze_count; i++)
- camel_folder_freeze (sub);
- }
- if ((vf->flags & CAMEL_STORE_FOLDER_PRIVATE) == 0 && !CAMEL_IS_VEE_FOLDER(sub)) {
- camel_object_ref((CamelObject *)sub);
- up->folders = g_list_append(up->folders, sub);
- /* update the freeze state of 'sub' to match Unmatched's freeze state */
- for (i = 0; i < up->freeze_count; i++)
- camel_folder_freeze (sub);
- }
-
- CAMEL_VEE_FOLDER_UNLOCK(vf, subfolder_lock);
-
- d(printf("camel_vee_folder_add_folde(%p, %p)\n", vf, sub));
-
- camel_object_hook_event((CamelObject *)sub, "folder_changed", (CamelObjectEventHookFunc)folder_changed, vf);
- camel_object_hook_event((CamelObject *)sub, "message_changed", (CamelObjectEventHookFunc)message_changed, vf);
- camel_object_hook_event((CamelObject *)sub, "deleted", (CamelObjectEventHookFunc)subfolder_deleted, vf);
-
- vee_folder_build_folder(vf, sub, NULL);
-}
-
-/**
- * camel_vee_folder_remove_folder:
- * @vf: Virtual Folder object
- * @sub: source CamelFolder to remove from @vf
- *
- * Removed the source folder, @sub, from the virtual folder, @vf.
- **/
-void
-camel_vee_folder_remove_folder(CamelVeeFolder *vf, CamelFolder *sub)
-{
- struct _CamelVeeFolderPrivate *p = _PRIVATE(vf), *up = _PRIVATE(folder_unmatched);
- int killun = FALSE;
- int i;
-
- CAMEL_VEE_FOLDER_LOCK(vf, subfolder_lock);
-
- CAMEL_VEE_FOLDER_LOCK(vf, changed_lock);
- p->folders_changed = g_list_remove(p->folders_changed, sub);
- CAMEL_VEE_FOLDER_UNLOCK(vf, changed_lock);
-
- if (g_list_find(p->folders, sub) == NULL) {
- CAMEL_VEE_FOLDER_UNLOCK(vf, subfolder_lock);
- return;
- }
-
- camel_object_unhook_event((CamelObject *)sub, "folder_changed", (CamelObjectEventHookFunc) folder_changed, vf);
- camel_object_unhook_event((CamelObject *)sub, "message_changed", (CamelObjectEventHookFunc) message_changed, vf);
- camel_object_unhook_event((CamelObject *)sub, "deleted", (CamelObjectEventHookFunc) subfolder_deleted, vf);
-
- p->folders = g_list_remove(p->folders, sub);
-
- /* undo the freeze state that we have imposed on this source folder */
- for (i = 0; i < p->freeze_count; i++)
- camel_folder_thaw (sub);
-
- CAMEL_VEE_FOLDER_UNLOCK(vf, subfolder_lock);
-
- CAMEL_VEE_FOLDER_LOCK(folder_unmatched, subfolder_lock);
- /* if folder deleted, then blow it away from unmatched always, and remove all refs to it */
- if (sub->folder_flags & CAMEL_FOLDER_HAS_BEEN_DELETED) {
- while (g_list_find(up->folders, sub)) {
- killun = TRUE;
- up->folders = g_list_remove(up->folders, sub);
- camel_object_unref((CamelObject *)sub);
-
- /* undo the freeze state that Unmatched has imposed on this source folder */
- for (i = 0; i < up->freeze_count; i++)
- camel_folder_thaw (sub);
- }
- } else if ((vf->flags & CAMEL_STORE_FOLDER_PRIVATE) == 0) {
- if (g_list_find(up->folders, sub) != NULL) {
- up->folders = g_list_remove(up->folders, sub);
- camel_object_unref((CamelObject *)sub);
-
- /* undo the freeze state that Unmatched has imposed on this source folder */
- for (i = 0; i < up->freeze_count; i++)
- camel_folder_thaw (sub);
- }
- if (g_list_find(up->folders, sub) == NULL) {
- killun = TRUE;
- }
- }
- CAMEL_VEE_FOLDER_UNLOCK(folder_unmatched, subfolder_lock);
-
- vee_folder_remove_folder(vf, sub, killun);
-
- camel_object_unref((CamelObject *)sub);
-}
-
-static void
-remove_folders(CamelFolder *folder, CamelFolder *foldercopy, CamelVeeFolder *vf)
-{
- camel_vee_folder_remove_folder(vf, folder);
- camel_object_unref((CamelObject *)folder);
-}
-
-/**
- * camel_vee_folder_set_folders:
- * @vf:
- * @folders:
- *
- * Set the whole list of folder sources on a vee folder.
- **/
-void
-camel_vee_folder_set_folders(CamelVeeFolder *vf, GList *folders)
-{
- struct _CamelVeeFolderPrivate *p = _PRIVATE(vf);
- GHashTable *remove = g_hash_table_new(NULL, NULL);
- GList *l;
- CamelFolder *folder;
- int changed;
-
- /* setup a table of all folders we have currently */
- CAMEL_VEE_FOLDER_LOCK(vf, subfolder_lock);
- l = p->folders;
- while (l) {
- g_hash_table_insert(remove, l->data, l->data);
- camel_object_ref((CamelObject *)l->data);
- l = l->next;
- }
- CAMEL_VEE_FOLDER_UNLOCK(vf, subfolder_lock);
-
- /* if we already have the folder, ignore it, otherwise add it */
- l = folders;
- while (l) {
- if ((folder = g_hash_table_lookup(remove, l->data))) {
- g_hash_table_remove(remove, folder);
- camel_object_unref((CamelObject *)folder);
-
- /* if this was a changed folder, re-update it while we're here */
- CAMEL_VEE_FOLDER_LOCK(vf, changed_lock);
- changed = g_list_find(p->folders_changed, folder) != NULL;
- if (changed)
- p->folders_changed = g_list_remove(p->folders_changed, folder);
- CAMEL_VEE_FOLDER_UNLOCK(vf, changed_lock);
- if (changed)
- vee_folder_build_folder(vf, folder, NULL);
- } else {
- camel_vee_folder_add_folder(vf, l->data);
- }
- l = l->next;
- }
-
- /* then remove any we still have */
- g_hash_table_foreach(remove, (GHFunc)remove_folders, vf);
- g_hash_table_destroy(remove);
-}
-
-/**
- * camel_vee_folder_hash_folder:
- * @folder:
- * @:
- *
- * Create a hash string representing the folder name, which should be
- * unique, and remain static for a given folder.
- **/
-void
-camel_vee_folder_hash_folder(CamelFolder *folder, char buffer[8])
-{
- MD5Context ctx;
- unsigned char digest[16];
- unsigned int state = 0, save = 0;
- char *tmp;
- int i;
-
- md5_init(&ctx);
- tmp = camel_service_get_url((CamelService *)folder->parent_store);
- md5_update(&ctx, tmp, strlen(tmp));
- g_free(tmp);
- md5_update(&ctx, folder->full_name, strlen(folder->full_name));
- md5_final(&ctx, digest);
- camel_base64_encode_close(digest, 6, FALSE, buffer, &state, &save);
-
- for (i=0;i<8;i++) {
- if (buffer[i] == '+')
- buffer[i] = '.';
- if (buffer[i] == '/')
- buffer[i] = '_';
- }
-}
-
-/**
- * camel_vee_folder_get_location:
- * @vf:
- * @vinfo:
- * @realuid: if not NULL, set to the uid of the real message, must be
- * g_free'd by caller.
- *
- * Find the real folder (and uid)
- *
- * Return value:
- **/
-CamelFolder *
-camel_vee_folder_get_location(CamelVeeFolder *vf, const CamelVeeMessageInfo *vinfo, char **realuid)
-{
- /* locking? yes? no? although the vfolderinfo is valid when obtained
- the folder in it might not necessarily be so ...? */
- if (CAMEL_IS_VEE_FOLDER(vinfo->folder)) {
- CamelFolder *folder;
- const CamelVeeMessageInfo *vfinfo;
-
- vfinfo = (CamelVeeMessageInfo *)camel_folder_get_message_info(vinfo->folder, camel_message_info_uid(vinfo)+8);
- folder = camel_vee_folder_get_location((CamelVeeFolder *)vinfo->folder, vfinfo, realuid);
- camel_folder_free_message_info(vinfo->folder, (CamelMessageInfo *)vfinfo);
- return folder;
- } else {
- if (realuid)
- *realuid = g_strdup(camel_message_info_uid(vinfo)+8);
-
- return vinfo->folder;
- }
-}
-
-static void vee_refresh_info(CamelFolder *folder, CamelException *ex)
-{
- CamelVeeFolder *vf = (CamelVeeFolder *)folder;
- struct _CamelVeeFolderPrivate *p = _PRIVATE(vf);
- GList *node, *list;
-
- CAMEL_VEE_FOLDER_LOCK(vf, changed_lock);
- list = p->folders_changed;
- p->folders_changed = NULL;
- CAMEL_VEE_FOLDER_UNLOCK(vf, changed_lock);
-
- node = list;
- while (node) {
- CamelFolder *f = node->data;
-
- if (vee_folder_build_folder(vf, f, ex) == -1)
- break;
-
- node = node->next;
- }
-
- g_list_free(list);
-}
-
-static void
-vee_sync(CamelFolder *folder, gboolean expunge, CamelException *ex)
-{
- CamelVeeFolder *vf = (CamelVeeFolder *)folder;
- struct _CamelVeeFolderPrivate *p = _PRIVATE(vf);
- GList *node;
-
- CAMEL_VEE_FOLDER_LOCK(vf, subfolder_lock);
-
- node = p->folders;
- while (node) {
- CamelFolder *f = node->data;
-
- camel_folder_sync(f, expunge, ex);
- if (camel_exception_is_set(ex)) {
- char *desc;
-
- camel_object_get(f, NULL, CAMEL_OBJECT_DESCRIPTION, &desc, NULL);
- camel_exception_setv(ex, ex->id, _("Error storing `%s': %s"), desc, ex->desc);
- break;
- }
-
- if (vee_folder_build_folder(vf, f, ex) == -1)
- break;
-
- node = node->next;
- }
-
- if (node == NULL) {
- CAMEL_VEE_FOLDER_LOCK(vf, changed_lock);
- g_list_free(p->folders_changed);
- p->folders_changed = NULL;
- CAMEL_VEE_FOLDER_UNLOCK(vf, changed_lock);
- }
-
- CAMEL_VEE_FOLDER_UNLOCK(vf, subfolder_lock);
-}
-
-static void
-vee_expunge (CamelFolder *folder, CamelException *ex)
-{
- ((CamelFolderClass *)((CamelObject *)folder)->klass)->sync(folder, TRUE, ex);
-}
-
-static CamelMimeMessage *
-vee_get_message(CamelFolder *folder, const char *uid, CamelException *ex)
-{
- CamelVeeMessageInfo *mi;
- CamelMimeMessage *msg = NULL;
-
- mi = (CamelVeeMessageInfo *)camel_folder_summary_uid(folder->summary, uid);
- if (mi) {
- msg = camel_folder_get_message(mi->folder, camel_message_info_uid(mi)+8, ex);
- camel_folder_summary_info_free(folder->summary, (CamelMessageInfo *)mi);
- } else {
- camel_exception_setv(ex, CAMEL_EXCEPTION_FOLDER_INVALID_UID,
- _("No such message %s in %s"), uid,
- folder->name);
- }
-
- return msg;
-}
-
-static GPtrArray *
-vee_search_by_expression(CamelFolder *folder, const char *expression, CamelException *ex)
-{
- GList *node;
- GPtrArray *matches, *result = g_ptr_array_new ();
- char *expr;
- CamelVeeFolder *vf = (CamelVeeFolder *)folder;
- struct _CamelVeeFolderPrivate *p = _PRIVATE(vf);
- GHashTable *searched = g_hash_table_new(NULL, NULL);
-
- CAMEL_VEE_FOLDER_LOCK(vf, subfolder_lock);
-
- if (vf != folder_unmatched)
- expr = g_strdup_printf ("(and %s %s)", vf->expression, expression);
- else
- expr = g_strdup (expression);
-
- node = p->folders;
- while (node) {
- CamelFolder *f = node->data;
- int i;
- char hash[8];
-
- /* make sure we only search each folder once - for unmatched folder to work right */
- if (g_hash_table_lookup(searched, f) == NULL) {
- camel_vee_folder_hash_folder(f, hash);
- /* FIXME: shouldn't ignore search exception */
- matches = camel_folder_search_by_expression(f, expression, NULL);
- if (matches) {
- for (i = 0; i < matches->len; i++) {
- char *uid = matches->pdata[i], *vuid;
-
- vuid = g_malloc(strlen(uid)+9);
- memcpy(vuid, hash, 8);
- strcpy(vuid+8, uid);
- g_ptr_array_add(result, vuid);
- }
- camel_folder_search_free(f, matches);
- }
- g_hash_table_insert(searched, f, f);
- }
- node = g_list_next(node);
- }
-
- g_free(expr);
- CAMEL_VEE_FOLDER_UNLOCK(vf, subfolder_lock);
-
- g_hash_table_destroy(searched);
-
- return result;
-}
-
-static GPtrArray *
-vee_search_by_uids(CamelFolder *folder, const char *expression, GPtrArray *uids, CamelException *ex)
-{
- GList *node;
- GPtrArray *matches, *result = g_ptr_array_new ();
- GPtrArray *folder_uids = g_ptr_array_new();
- char *expr;
- CamelVeeFolder *vf = (CamelVeeFolder *)folder;
- struct _CamelVeeFolderPrivate *p = _PRIVATE(vf);
- GHashTable *searched = g_hash_table_new(NULL, NULL);
-
- CAMEL_VEE_FOLDER_LOCK(vf, subfolder_lock);
-
- expr = g_strdup_printf("(and %s %s)", vf->expression, expression);
- node = p->folders;
- while (node) {
- CamelFolder *f = node->data;
- int i;
- char hash[8];
-
- /* make sure we only search each folder once - for unmatched folder to work right */
- if (g_hash_table_lookup(searched, f) == NULL) {
- camel_vee_folder_hash_folder(f, hash);
-
- /* map the vfolder uid's to the source folder uid's first */
- g_ptr_array_set_size(folder_uids, 0);
- for (i=0;i<uids->len;i++) {
- char *uid = uids->pdata[i];
-
- if (strlen(uid) >= 8 && strncmp(uid, hash, 8) == 0)
- g_ptr_array_add(folder_uids, uid+8);
- }
- if (folder_uids->len > 0) {
- matches = camel_folder_search_by_uids(f, expression, folder_uids, ex);
- if (matches) {
- for (i = 0; i < matches->len; i++) {
- char *uid = matches->pdata[i], *vuid;
-
- vuid = g_malloc(strlen(uid)+9);
- memcpy(vuid, hash, 8);
- strcpy(vuid+8, uid);
- g_ptr_array_add(result, vuid);
- }
- camel_folder_search_free(f, matches);
- } else {
- g_warning("Search failed: %s", camel_exception_get_description(ex));
- }
- }
- g_hash_table_insert(searched, f, f);
- }
- node = g_list_next(node);
- }
-
- g_free(expr);
- CAMEL_VEE_FOLDER_UNLOCK(vf, subfolder_lock);
-
- g_hash_table_destroy(searched);
- g_ptr_array_free(folder_uids, 0);
-
- return result;
-}
-
-static void
-vee_set_message_flags(CamelFolder *folder, const char *uid, guint32 flags, guint32 set)
-{
- CamelVeeMessageInfo *mi;
-
- mi = (CamelVeeMessageInfo *)camel_folder_summary_uid(folder->summary, uid);
- if (mi) {
- camel_folder_set_message_flags(mi->folder, camel_message_info_uid(mi) + 8, flags, set);
- camel_folder_summary_info_free(folder->summary, (CamelMessageInfo *)mi);
- ((CamelFolderClass *)camel_vee_folder_parent)->set_message_flags(folder, uid, flags, set);
- }
-}
-
-static void
-vee_set_message_user_flag(CamelFolder *folder, const char *uid, const char *name, gboolean value)
-{
- CamelVeeMessageInfo *mi;
-
- mi = (CamelVeeMessageInfo *)camel_folder_summary_uid(folder->summary, uid);
- if (mi) {
- camel_folder_set_message_user_flag(mi->folder, camel_message_info_uid(mi) + 8, name, value);
- camel_folder_summary_info_free(folder->summary, (CamelMessageInfo *)mi);
- ((CamelFolderClass *)camel_vee_folder_parent)->set_message_user_flag(folder, uid, name, value);
- }
-}
-
-static void
-vee_set_message_user_tag(CamelFolder *folder, const char *uid, const char *name, const char *value)
-{
- CamelVeeMessageInfo *mi;
-
- mi = (CamelVeeMessageInfo *)camel_folder_summary_uid(folder->summary, uid);
- if (mi) {
- camel_folder_set_message_user_tag(mi->folder, camel_message_info_uid(mi) + 8, name, value);
- camel_folder_summary_info_free(folder->summary, (CamelMessageInfo *)mi);
- ((CamelFolderClass *)camel_vee_folder_parent)->set_message_user_tag(folder, uid, name, value);
- }
-}
-
-static void
-vee_append_message(CamelFolder *folder, CamelMimeMessage *message, const CamelMessageInfo *info, char **appended_uid, CamelException *ex)
-{
- camel_exception_set(ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot copy or move messages into a Virtual Folder"));
-}
-
-static void
-vee_transfer_messages_to (CamelFolder *folder, GPtrArray *uids, CamelFolder *dest, GPtrArray **transferred_uids, gboolean delete_originals, CamelException *ex)
-{
- camel_exception_set(ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot copy or move messages into a Virtual Folder"));
-}
-
-static void vee_rename(CamelFolder *folder, const char *new)
-{
- CamelVeeFolder *vf = (CamelVeeFolder *)folder;
-
- g_free(vf->vname);
- vf->vname = g_strdup(new);
-
- ((CamelFolderClass *)camel_vee_folder_parent)->rename(folder, new);
-}
-
-/* ********************************************************************** *
- utility functions */
-
-/* must be called with summary_lock held */
-static CamelVeeMessageInfo *
-vee_folder_add_info(CamelVeeFolder *vf, CamelFolder *f, CamelMessageInfo *info, const char hash[8])
-{
- CamelVeeMessageInfo *mi;
- char *vuid;
- const char *uid;
- CamelFolder *folder = (CamelFolder *)vf;
- CamelMessageInfo *dinfo;
-
- uid = camel_message_info_uid(info);
- vuid = alloca(strlen(uid)+9);
- memcpy(vuid, hash, 8);
- strcpy(vuid+8, uid);
- dinfo = camel_folder_summary_uid(folder->summary, vuid);
- if (dinfo) {
- d(printf("w:clash, we already have '%s' in summary\n", vuid));
- camel_folder_summary_info_free(folder->summary, dinfo);
- return NULL;
- }
-
- d(printf("adding vuid %s to %s\n", vuid, vf->vname));
-
- mi = (CamelVeeMessageInfo *)camel_folder_summary_info_new(folder->summary);
- camel_message_info_dup_to(info, (CamelMessageInfo *)mi);
-#ifdef DOEPOOLV
- mi->info.strings = e_poolv_set(mi->info.strings, CAMEL_MESSAGE_INFO_UID, vuid, FALSE);
-#elif defined (DOESTRV)
- mi->info.strings = e_strv_set_ref(mi->info.strings, CAMEL_MESSAGE_INFO_UID, vuid);
- mi->info.strings = e_strv_pack(mi->info.strings);
-#else
- g_free(mi->info.uid);
- mi->info.uid = g_strdup(vuid);
-#endif
- mi->folder = f;
- camel_folder_summary_add(folder->summary, (CamelMessageInfo *)mi);
-
- return mi;
-}
-
-/* must be called with summary_lock held */
-static CamelVeeMessageInfo *
-vee_folder_add_uid(CamelVeeFolder *vf, CamelFolder *f, const char *inuid, const char hash[8])
-{
- CamelMessageInfo *info;
- CamelVeeMessageInfo *mi = NULL;
-
- info = camel_folder_get_message_info(f, inuid);
- if (info) {
- mi = vee_folder_add_info(vf, f, info, hash);
- camel_folder_free_message_info(f, info);
- }
- return mi;
-}
-
-static void
-vee_folder_remove_folder(CamelVeeFolder *vf, CamelFolder *source, int killun)
-{
- int i, count, n, still, start, last;
- char *oldkey;
- CamelFolder *folder = (CamelFolder *)vf;
- char hash[8];
- /*struct _CamelVeeFolderPrivate *p = _PRIVATE(vf);*/
- CamelFolderChangeInfo *vf_changes = NULL, *unmatched_changes = NULL;
-
- if (vf == folder_unmatched)
- return;
-
- /* check if this folder is still to be part of unmatched */
- if ((vf->flags & CAMEL_STORE_FOLDER_PRIVATE) == 0 && !killun) {
- CAMEL_VEE_FOLDER_LOCK(folder_unmatched, subfolder_lock);
- still = g_list_find(_PRIVATE(folder_unmatched)->folders, source) != NULL;
- CAMEL_VEE_FOLDER_UNLOCK(folder_unmatched, subfolder_lock);
- camel_vee_folder_hash_folder(source, hash);
- } else {
- still = FALSE;
- }
-
- CAMEL_VEE_FOLDER_LOCK(vf, summary_lock);
- CAMEL_VEE_FOLDER_LOCK(folder_unmatched, summary_lock);
-
- /* See if we just blow all uid's from this folder away from unmatched, regardless */
- if (killun) {
- start = -1;
- last = -1;
- count = camel_folder_summary_count(((CamelFolder *)folder_unmatched)->summary);
- for (i=0;i<count;i++) {
- CamelVeeMessageInfo *mi = (CamelVeeMessageInfo *)camel_folder_summary_index(((CamelFolder *)folder_unmatched)->summary, i);
-
- if (mi) {
- if (mi->folder == source) {
- camel_folder_change_info_remove_uid(folder_unmatched->changes, camel_message_info_uid(mi));
- if (last == -1) {
- last = start = i;
- } else if (last+1 == i) {
- last = i;
- } else {
- camel_folder_summary_remove_range(((CamelFolder *)folder_unmatched)->summary, start, last);
- i -= (last-start)+1;
- start = last = i;
- }
- }
- camel_folder_summary_info_free(((CamelFolder *)folder_unmatched)->summary, (CamelMessageInfo *)mi);
- }
- }
- if (last != -1)
- camel_folder_summary_remove_range(((CamelFolder *)folder_unmatched)->summary, start, last);
- }
-
- start = -1;
- last = -1;
- count = camel_folder_summary_count(folder->summary);
- for (i=0;i<count;i++) {
- CamelVeeMessageInfo *mi = (CamelVeeMessageInfo *)camel_folder_summary_index(folder->summary, i);
- if (mi) {
- if (mi->folder == source) {
- const char *uid = camel_message_info_uid(mi);
-
- camel_folder_change_info_remove_uid(vf->changes, uid);
-
- if (last == -1) {
- last = start = i;
- } else if (last+1 == i) {
- last = i;
- } else {
- camel_folder_summary_remove_range(folder->summary, start, last);
- i -= (last-start)+1;
- start = last = i;
- }
- if ((vf->flags & CAMEL_STORE_FOLDER_PRIVATE) == 0) {
- if (still) {
- if (g_hash_table_lookup_extended(unmatched_uids, uid, (void **)&oldkey, (void **)&n)) {
- if (n == 1) {
- g_hash_table_remove(unmatched_uids, oldkey);
- if (vee_folder_add_uid(folder_unmatched, source, oldkey+8, hash))
- camel_folder_change_info_add_uid(folder_unmatched->changes, oldkey);
- g_free(oldkey);
- } else {
- g_hash_table_insert(unmatched_uids, oldkey, GINT_TO_POINTER(n-1));
- }
- }
- } else {
- if (g_hash_table_lookup_extended(unmatched_uids, camel_message_info_uid(mi), (void **)&oldkey, (void **)&n)) {
- g_hash_table_remove(unmatched_uids, oldkey);
- g_free(oldkey);
- }
- }
- }
- }
- camel_folder_summary_info_free(folder->summary, (CamelMessageInfo *)mi);
- }
- }
-
- if (last != -1)
- camel_folder_summary_remove_range(folder->summary, start, last);
-
- if (camel_folder_change_info_changed(folder_unmatched->changes)) {
- unmatched_changes = folder_unmatched->changes;
- folder_unmatched->changes = camel_folder_change_info_new();
- }
-
- if (camel_folder_change_info_changed(vf->changes)) {
- vf_changes = vf->changes;
- vf->changes = camel_folder_change_info_new();
- }
-
- CAMEL_VEE_FOLDER_UNLOCK(folder_unmatched, summary_lock);
- CAMEL_VEE_FOLDER_UNLOCK(vf, summary_lock);
-
- if (unmatched_changes) {
- camel_object_trigger_event((CamelObject *)folder_unmatched, "folder_changed", unmatched_changes);
- camel_folder_change_info_free(unmatched_changes);
- }
-
- if (vf_changes) {
- camel_object_trigger_event((CamelObject *)vf, "folder_changed", vf_changes);
- camel_folder_change_info_free(vf_changes);
- }
-}
-
-struct _update_data {
- CamelFolder *source;
- CamelVeeFolder *vf;
- char hash[8];
-};
-
-static void
-unmatched_check_uid(char *uidin, void *value, struct _update_data *u)
-{
- char *uid;
- int n;
-
- uid = alloca(strlen(uidin)+9);
- memcpy(uid, u->hash, 8);
- strcpy(uid+8, uidin);
- n = GPOINTER_TO_INT(g_hash_table_lookup(unmatched_uids, uid));
- if (n == 0) {
- if (vee_folder_add_uid(folder_unmatched, u->source, uidin, u->hash))
- camel_folder_change_info_add_uid(folder_unmatched->changes, uid);
- } else {
- CamelVeeMessageInfo *mi = (CamelVeeMessageInfo *)camel_folder_summary_uid(((CamelFolder *)folder_unmatched)->summary, uid);
- if (mi) {
- camel_folder_summary_remove(((CamelFolder *)folder_unmatched)->summary, (CamelMessageInfo *)mi);
- camel_folder_change_info_remove_uid(folder_unmatched->changes, uid);
- camel_folder_summary_info_free(((CamelFolder *)folder_unmatched)->summary, (CamelMessageInfo *)mi);
- }
- }
-}
-
-static void
-folder_added_uid(char *uidin, void *value, struct _update_data *u)
-{
- CamelVeeMessageInfo *mi;
- char *oldkey;
- int n;
-
- if ( (mi = vee_folder_add_uid(u->vf, u->source, uidin, u->hash)) ) {
- camel_folder_change_info_add_uid(u->vf->changes, camel_message_info_uid(mi));
-
- if (!CAMEL_IS_VEE_FOLDER(u->source)) {
- if (g_hash_table_lookup_extended(unmatched_uids, camel_message_info_uid(mi), (void **)&oldkey, (void **)&n)) {
- g_hash_table_insert(unmatched_uids, oldkey, GINT_TO_POINTER(n+1));
- } else {
- g_hash_table_insert(unmatched_uids, g_strdup(camel_message_info_uid(mi)), GINT_TO_POINTER(1));
- }
- }
- }
-}
-
-/* build query contents for a single folder */
-static int
-vee_folder_build_folder(CamelVeeFolder *vf, CamelFolder *source, CamelException *ex)
-{
- GPtrArray *match, *all;
- GHashTable *allhash, *matchhash;
- CamelFolder *f = source;
- CamelFolder *folder = (CamelFolder *)vf;
- int i, n, count, start, last;
- struct _update_data u;
- CamelFolderChangeInfo *vf_changes = NULL, *unmatched_changes = NULL;
-
- if (vf == folder_unmatched)
- return 0;
-
- /* if we have no expression, or its been cleared, then act as if no matches */
- if (vf->expression == NULL) {
- match = g_ptr_array_new();
- } else {
- match = camel_folder_search_by_expression(f, vf->expression, ex);
- if (match == NULL)
- return -1;
- }
-
- u.source = source;
- u.vf = vf;
- camel_vee_folder_hash_folder(source, u.hash);
-
- CAMEL_VEE_FOLDER_LOCK(vf, summary_lock);
-
- /* we build 2 hash tables, one for all uid's not matched, the other for all matched uid's,
- we just ref the real memory */
- matchhash = g_hash_table_new(g_str_hash, g_str_equal);
- for (i=0;i<match->len;i++)
- g_hash_table_insert(matchhash, match->pdata[i], (void *)1);
-
- allhash = g_hash_table_new(g_str_hash, g_str_equal);
- all = camel_folder_get_uids(f);
- for (i=0;i<all->len;i++)
- if (g_hash_table_lookup(matchhash, all->pdata[i]) == NULL)
- g_hash_table_insert(allhash, all->pdata[i], (void *)1);
-
- CAMEL_VEE_FOLDER_LOCK(folder_unmatched, summary_lock);
-
- /* scan, looking for "old" uid's to be removed */
- start = -1;
- last = -1;
- count = camel_folder_summary_count(folder->summary);
- for (i=0;i<count;i++) {
- CamelVeeMessageInfo *mi = (CamelVeeMessageInfo *)camel_folder_summary_index(folder->summary, i);
-
- if (mi) {
- if (mi->folder == source) {
- char *uid = (char *)camel_message_info_uid(mi), *oldkey;
-
- if (g_hash_table_lookup(matchhash, uid+8) == NULL) {
- if (last == -1) {
- last = start = i;
- } else if (last+1 == i) {
- last = i;
- } else {
- camel_folder_summary_remove_range(folder->summary, start, last);
- i -= (last-start)+1;
- start = last = i;
- }
- camel_folder_change_info_remove_uid(vf->changes, camel_message_info_uid(mi));
- if (!CAMEL_IS_VEE_FOLDER(source)
- && g_hash_table_lookup_extended(unmatched_uids, uid, (void **)&oldkey, (void **)&n)) {
- if (n == 1) {
- g_hash_table_remove(unmatched_uids, oldkey);
- g_free(oldkey);
- } else {
- g_hash_table_insert(unmatched_uids, oldkey, GINT_TO_POINTER(n-1));
- }
- }
- } else {
- g_hash_table_remove(matchhash, uid+8);
- }
- }
- camel_folder_summary_info_free(folder->summary, (CamelMessageInfo *)mi);
- }
- }
- if (last != -1)
- camel_folder_summary_remove_range(folder->summary, start, last);
-
- /* now matchhash contains any new uid's, add them, etc */
- g_hash_table_foreach(matchhash, (GHFunc)folder_added_uid, &u);
-
- /* scan unmatched, remove any that have vanished, etc */
- count = camel_folder_summary_count(((CamelFolder *)folder_unmatched)->summary);
- for (i=0;i<count;i++) {
- CamelVeeMessageInfo *mi = (CamelVeeMessageInfo *)camel_folder_summary_index(((CamelFolder *)folder_unmatched)->summary, i);
-
- if (mi) {
- if (mi->folder == source) {
- char *uid = (char *)camel_message_info_uid(mi);
-
- if (g_hash_table_lookup(allhash, uid+8) == NULL) {
- /* no longer exists at all, just remove it entirely */
- camel_folder_summary_remove_index(((CamelFolder *)folder_unmatched)->summary, i);
- camel_folder_change_info_remove_uid(folder_unmatched->changes, camel_message_info_uid(mi));
- i--;
- } else {
- g_hash_table_remove(allhash, uid+8);
- }
- }
- camel_folder_summary_info_free(((CamelFolder *)folder_unmatched)->summary, (CamelMessageInfo *)mi);
- }
- }
-
- /* now allhash contains all potentially new uid's for the unmatched folder, process */
- if (!CAMEL_IS_VEE_FOLDER(source))
- g_hash_table_foreach(allhash, (GHFunc)unmatched_check_uid, &u);
-
- /* copy any changes so we can raise them outside the lock */
- if (camel_folder_change_info_changed(folder_unmatched->changes)) {
- unmatched_changes = folder_unmatched->changes;
- folder_unmatched->changes = camel_folder_change_info_new();
- }
-
- if (camel_folder_change_info_changed(vf->changes)) {
- vf_changes = vf->changes;
- vf->changes = camel_folder_change_info_new();
- }
-
- CAMEL_VEE_FOLDER_UNLOCK(folder_unmatched, summary_lock);
- CAMEL_VEE_FOLDER_UNLOCK(vf, summary_lock);
-
- g_hash_table_destroy(matchhash);
- g_hash_table_destroy(allhash);
- /* if expression not set, we only had a null list */
- if (vf->expression == NULL)
- g_ptr_array_free(match, TRUE);
- else
- camel_folder_search_free(f, match);
- camel_folder_free_uids(f, all);
-
- if (unmatched_changes) {
- camel_object_trigger_event((CamelObject *)folder_unmatched, "folder_changed", unmatched_changes);
- camel_folder_change_info_free(unmatched_changes);
- }
-
- if (vf_changes) {
- camel_object_trigger_event((CamelObject *)vf, "folder_changed", vf_changes);
- camel_folder_change_info_free(vf_changes);
- }
-
- return 0;
-}
-
-/*
-
- (match-folder "folder1" "folder2")
-
- */
-
-
-/* Hold all these with summary lock and unmatched summary lock held */
-static void
-folder_changed_add_uid(CamelFolder *sub, const char *uid, const char hash[8], CamelVeeFolder *vf)
-{
- CamelVeeMessageInfo *vinfo;
- const char *vuid;
- char *oldkey;
- int n;
-
- vinfo = vee_folder_add_uid(vf, sub, uid, hash);
- if (vinfo == NULL)
- return;
-
- vuid = camel_message_info_uid(vinfo);
- camel_folder_change_info_add_uid(vf->changes, vuid);
-
- if ((vf->flags & CAMEL_STORE_FOLDER_PRIVATE) == 0 && !CAMEL_IS_VEE_FOLDER(sub)) {
- if (g_hash_table_lookup_extended(unmatched_uids, vuid, (void **)&oldkey, (void **)&n)) {
- g_hash_table_insert(unmatched_uids, oldkey, GINT_TO_POINTER(n+1));
- } else {
- g_hash_table_insert(unmatched_uids, g_strdup(vuid), (void *)1);
- }
- vinfo = (CamelVeeMessageInfo *)camel_folder_get_message_info((CamelFolder *)folder_unmatched, vuid);
- if (vinfo) {
- camel_folder_change_info_remove_uid(folder_unmatched->changes, vuid);
- camel_folder_summary_remove(((CamelFolder *)folder_unmatched)->summary, (CamelMessageInfo *)vinfo);
- camel_folder_free_message_info((CamelFolder *)folder_unmatched, (CamelMessageInfo *)vinfo);
- }
- }
-}
-
-static void
-folder_changed_remove_uid(CamelFolder *sub, const char *uid, const char hash[8], int keep, CamelVeeFolder *vf)
-{
- CamelFolder *folder = (CamelFolder *)vf;
- char *vuid, *oldkey;
- int n;
- CamelVeeMessageInfo *vinfo;
-
- vuid = alloca(strlen(uid)+9);
- memcpy(vuid, hash, 8);
- strcpy(vuid+8, uid);
-
- vinfo = (CamelVeeMessageInfo *)camel_folder_summary_uid(folder->summary, vuid);
- if (vinfo) {
- camel_folder_change_info_remove_uid(vf->changes, vuid);
- camel_folder_summary_remove(folder->summary, (CamelMessageInfo *)vinfo);
- camel_folder_summary_info_free(folder->summary, (CamelMessageInfo *)vinfo);
- }
-
- if ((vf->flags & CAMEL_STORE_FOLDER_PRIVATE) == 0 && !CAMEL_IS_VEE_FOLDER(sub)) {
- if (keep) {
- if (g_hash_table_lookup_extended(unmatched_uids, vuid, (void **)&oldkey, (void **)&n)) {
- if (n == 1) {
- g_hash_table_remove(unmatched_uids, oldkey);
- if (vee_folder_add_uid(folder_unmatched, sub, uid, hash))
- camel_folder_change_info_add_uid(folder_unmatched->changes, oldkey);
- g_free(oldkey);
- } else {
- g_hash_table_insert(unmatched_uids, oldkey, GINT_TO_POINTER(n-1));
- }
- } else {
- if (vee_folder_add_uid(folder_unmatched, sub, uid, hash))
- camel_folder_change_info_add_uid(folder_unmatched->changes, oldkey);
- }
- } else {
- if (g_hash_table_lookup_extended(unmatched_uids, vuid, (void **)&oldkey, (void **)&n)) {
- g_hash_table_remove(unmatched_uids, oldkey);
- g_free(oldkey);
- }
-
- vinfo = (CamelVeeMessageInfo *)camel_folder_get_message_info((CamelFolder *)folder_unmatched, vuid);
- if (vinfo) {
- camel_folder_change_info_remove_uid(folder_unmatched->changes, vuid);
- camel_folder_summary_remove_uid(((CamelFolder *)folder_unmatched)->summary, vuid);
- camel_folder_free_message_info((CamelFolder *)folder_unmatched, (CamelMessageInfo *)vinfo);
- }
- }
- }
-}
-
-static void
-folder_changed_change_uid(CamelFolder *sub, const char *uid, const char hash[8], CamelVeeFolder *vf)
-{
- char *vuid;
- CamelVeeMessageInfo *vinfo, *uinfo;
- CamelMessageInfo *info;
- CamelFolder *folder = (CamelFolder *)vf;
-
- vuid = alloca(strlen(uid)+9);
- memcpy(vuid, hash, 8);
- strcpy(vuid+8, uid);
-
- vinfo = (CamelVeeMessageInfo *)camel_folder_summary_uid(folder->summary, vuid);
- uinfo = (CamelVeeMessageInfo *)camel_folder_summary_uid(((CamelFolder *)folder_unmatched)->summary, vuid);
- if (vinfo || uinfo) {
- info = camel_folder_get_message_info(sub, uid);
- if (info) {
- if (vinfo) {
- int changed = FALSE;
-
- if (vinfo->info.flags != info->flags){
- vinfo->info.flags = info->flags;
- changed = TRUE;
- }
-
- changed |= camel_flag_list_copy(&vinfo->info.user_flags, &info->user_flags);
- changed |= camel_tag_list_copy(&vinfo->info.user_tags, &info->user_tags);
- if (changed)
- camel_folder_change_info_change_uid(vf->changes, vuid);
-
- camel_folder_summary_info_free(folder->summary, (CamelMessageInfo *)vinfo);
- }
-
- if (uinfo) {
- int changed = FALSE;
-
- if (uinfo->info.flags != info->flags){
- uinfo->info.flags = info->flags;
- changed = TRUE;
- }
-
- changed |= camel_flag_list_copy(&uinfo->info.user_flags, &info->user_flags);
- changed |= camel_tag_list_copy(&uinfo->info.user_tags, &info->user_tags);
- if (changed)
- camel_folder_change_info_change_uid(folder_unmatched->changes, vuid);
-
- camel_folder_summary_info_free(((CamelFolder *)folder_unmatched)->summary, (CamelMessageInfo *)uinfo);
- }
-
- camel_folder_free_message_info(sub, info);
- } else {
- if (vinfo) {
- folder_changed_remove_uid(sub, uid, hash, FALSE, vf);
- camel_folder_summary_info_free(folder->summary, (CamelMessageInfo *)vinfo);
- }
- if (uinfo)
- camel_folder_summary_info_free(((CamelFolder *)folder_unmatched)->summary, (CamelMessageInfo *)uinfo);
- }
- }
-}
-
-struct _folder_changed_msg {
- CamelSessionThreadMsg msg;
- CamelFolderChangeInfo *changes;
- CamelFolder *sub;
- CamelVeeFolder *vf;
-};
-
-static void
-folder_changed_change(CamelSession *session, CamelSessionThreadMsg *msg)
-{
- struct _folder_changed_msg *m = (struct _folder_changed_msg *)msg;
- CamelFolder *sub = m->sub;
- CamelFolder *folder = (CamelFolder *)m->vf;
- CamelVeeFolder *vf = m->vf;
- CamelFolderChangeInfo *changes = m->changes;
- char *vuid = NULL, hash[8];
- const char *uid;
- CamelVeeMessageInfo *vinfo;
- int i, vuidlen = 0;
- CamelFolderChangeInfo *vf_changes = NULL, *unmatched_changes = NULL;
- GPtrArray *matches_added = NULL, /* newly added, that match */
- *matches_changed = NULL, /* newly changed, that now match */
- *newchanged = NULL,
- *changed;
- GPtrArray *always_changed = NULL;
- GHashTable *matches_hash;
-
- /* Check the folder hasn't beem removed while we weren't watching */
- CAMEL_VEE_FOLDER_LOCK(vf, subfolder_lock);
- if (g_list_find(_PRIVATE(vf)->folders, sub) == NULL) {
- CAMEL_VEE_FOLDER_UNLOCK(vf, subfolder_lock);
- return;
- }
-
- camel_vee_folder_hash_folder(sub, hash);
-
- /* Lookup anything before we lock anything, to avoid deadlock with build_folder */
-
- /* Find newly added that match */
- if (changes->uid_added->len > 0) {
- dd(printf(" Searching for added matches '%s'\n", vf->expression));
- matches_added = camel_folder_search_by_uids(sub, vf->expression, changes->uid_added, NULL);
- }
-
- /* TODO:
- In this code around here, we can work out if the search will affect the changes
- we had, and only re-search against them if they might have */
-
- /* Search for changed items that newly match, but only if we dont have them */
- changed = changes->uid_changed;
- if (changed->len > 0) {
- dd(printf(" Searching for changed matches '%s'\n", vf->expression));
-
- if ((vf->flags & CAMEL_STORE_VEE_FOLDER_AUTO) == 0) {
- newchanged = g_ptr_array_new();
- always_changed = g_ptr_array_new();
- for (i=0;i<changed->len;i++) {
- uid = changed->pdata[i];
- if (strlen(uid)+9 > vuidlen) {
- vuidlen = strlen(uid)+64;
- vuid = g_realloc(vuid, vuidlen);
- }
- memcpy(vuid, hash, 8);
- strcpy(vuid+8, uid);
- vinfo = (CamelVeeMessageInfo *)camel_folder_summary_uid(folder->summary, vuid);
- if (vinfo == NULL) {
- g_ptr_array_add(newchanged, (char *)uid);
- } else {
- g_ptr_array_add(always_changed, (char *)uid);
- camel_folder_summary_info_free(folder->summary, (CamelMessageInfo *)vinfo);
- }
- }
- changed = newchanged;
- }
-
- if (changed->len)
- matches_changed = camel_folder_search_by_uids(sub, vf->expression, changed, NULL);
- }
-
- CAMEL_VEE_FOLDER_LOCK(vf, summary_lock);
- CAMEL_VEE_FOLDER_LOCK(folder_unmatched, summary_lock);
-
- dd(printf("Vfolder '%s' subfolder changed '%s'\n", folder->full_name, sub->full_name));
- dd(printf(" changed %d added %d removed %d\n", changes->uid_changed->len, changes->uid_added->len, changes->uid_removed->len));
-
- /* Always remove removed uid's, in any case */
- for (i=0;i<changes->uid_removed->len;i++) {
- dd(printf(" removing uid '%s'\n", (char *)changes->uid_removed->pdata[i]));
- folder_changed_remove_uid(sub, changes->uid_removed->pdata[i], hash, FALSE, vf);
- }
-
- /* Add any newly matched or to unmatched folder if they dont */
- if (matches_added) {
- matches_hash = g_hash_table_new(g_str_hash, g_str_equal);
- for (i=0;i<matches_added->len;i++) {
- dd(printf(" %s", (char *)matches_added->pdata[i]));
- g_hash_table_insert(matches_hash, matches_added->pdata[i], matches_added->pdata[i]);
- }
- for (i=0;i<changes->uid_added->len;i++) {
- uid = changes->uid_added->pdata[i];
- if (g_hash_table_lookup(matches_hash, uid)) {
- dd(printf(" adding uid '%s' [newly matched]\n", (char *)uid));
- folder_changed_add_uid(sub, uid, hash, vf);
- } else if ((vf->flags & CAMEL_STORE_FOLDER_PRIVATE) == 0) {
- if (strlen(uid)+9 > vuidlen) {
- vuidlen = strlen(uid)+64;
- vuid = g_realloc(vuid, vuidlen);
- }
- memcpy(vuid, hash, 8);
- strcpy(vuid+8, uid);
-
- if (!CAMEL_IS_VEE_FOLDER(sub) && g_hash_table_lookup(unmatched_uids, vuid) == NULL) {
- dd(printf(" adding uid '%s' to Unmatched [newly unmatched]\n", (char *)uid));
- vinfo = (CamelVeeMessageInfo *)camel_folder_get_message_info((CamelFolder *)folder_unmatched, vuid);
- if (vinfo == NULL) {
- if (vee_folder_add_uid(folder_unmatched, sub, uid, hash))
- camel_folder_change_info_add_uid(folder_unmatched->changes, vuid);
- } else {
- camel_folder_free_message_info((CamelFolder *)folder_unmatched, (CamelMessageInfo *)vinfo);
- }
- }
- }
- }
- g_hash_table_destroy(matches_hash);
- }
-
- /* Change any newly changed */
- if (always_changed) {
- for (i=0;i<always_changed->len;i++)
- folder_changed_change_uid(sub, always_changed->pdata[i], hash, vf);
- g_ptr_array_free(always_changed, TRUE);
- }
-
- /* Change/add/remove any changed */
- if (matches_changed) {
- /* If we are auto-updating, then re-check changed uids still match */
- dd(printf(" Vfolder %supdate\nuids match:", (vf->flags & CAMEL_STORE_VEE_FOLDER_AUTO)?"auto-":""));
- matches_hash = g_hash_table_new(g_str_hash, g_str_equal);
- for (i=0;i<matches_changed->len;i++) {
- dd(printf(" %s", (char *)matches_changed->pdata[i]));
- g_hash_table_insert(matches_hash, matches_changed->pdata[i], matches_changed->pdata[i]);
- }
- dd(printf("\n"));
- for (i=0;i<changed->len;i++) {
- uid = changed->pdata[i];
- if (strlen(uid)+9 > vuidlen) {
- vuidlen = strlen(uid)+64;
- vuid = g_realloc(vuid, vuidlen);
- }
- memcpy(vuid, hash, 8);
- strcpy(vuid+8, uid);
- vinfo = (CamelVeeMessageInfo *)camel_folder_summary_uid(folder->summary, vuid);
- if (vinfo == NULL) {
- /* A uid we dont have, but now it matches, add it */
- if (g_hash_table_lookup(matches_hash, uid)) {
- dd(printf(" adding uid '%s' [newly matched]\n", uid));
- folder_changed_add_uid(sub, uid, hash, vf);
- }
- } else {
- if ((vf->flags & CAMEL_STORE_VEE_FOLDER_AUTO) == 0
- || g_hash_table_lookup(matches_hash, uid)) {
- /* still match, or we're not auto-updating, change event, (if it changed) */
- dd(printf(" changing uid '%s' [still matches]\n", uid));
- folder_changed_change_uid(sub, uid, hash, vf);
- } else {
- /* No longer matches, remove it, but keep it in unmatched (potentially) */
- dd(printf(" removing uid '%s' [did match]\n", uid));
- folder_changed_remove_uid(sub, uid, hash, TRUE, vf);
- }
- camel_folder_summary_info_free(folder->summary, (CamelMessageInfo *)vinfo);
- }
- }
- g_hash_table_destroy(matches_hash);
- }
-
- if (camel_folder_change_info_changed(folder_unmatched->changes)) {
- unmatched_changes = folder_unmatched->changes;
- folder_unmatched->changes = camel_folder_change_info_new();
- }
-
- if (camel_folder_change_info_changed(vf->changes)) {
- vf_changes = vf->changes;
- vf->changes = camel_folder_change_info_new();
- }
-
- CAMEL_VEE_FOLDER_UNLOCK(folder_unmatched, summary_lock);
- CAMEL_VEE_FOLDER_UNLOCK(vf, summary_lock);
-
- /* Cleanup stuff on our folder */
- if (matches_added)
- camel_folder_search_free(sub, matches_added);
-
- if (matches_changed)
- camel_folder_search_free(sub, matches_changed);
-
- CAMEL_VEE_FOLDER_UNLOCK(vf, subfolder_lock);
-
- /* cleanup the rest */
- if (newchanged)
- g_ptr_array_free(newchanged, TRUE);
-
- g_free(vuid);
-
- if (unmatched_changes) {
- camel_object_trigger_event((CamelObject *)folder_unmatched, "folder_changed", unmatched_changes);
- camel_folder_change_info_free(unmatched_changes);
- }
-
- if (vf_changes) {
- /* If not auto-updating, keep track of changed folders for later re-sync */
- if ((vf->flags & CAMEL_STORE_VEE_FOLDER_AUTO) == 0) {
- CAMEL_VEE_FOLDER_LOCK(vf, changed_lock);
- if (g_list_find(vf->priv->folders_changed, sub) != NULL)
- vf->priv->folders_changed = g_list_prepend(vf->priv->folders_changed, sub);
- CAMEL_VEE_FOLDER_UNLOCK(vf, changed_lock);
- }
-
- camel_object_trigger_event((CamelObject *)vf, "folder_changed", vf_changes);
- camel_folder_change_info_free(vf_changes);
- }
-}
-
-static void
-folder_changed_free(CamelSession *session, CamelSessionThreadMsg *msg)
-{
- struct _folder_changed_msg *m = (struct _folder_changed_msg *)msg;
-
- camel_folder_change_info_free(m->changes);
- camel_object_unref((CamelObject *)m->vf);
- camel_object_unref((CamelObject *)m->sub);
-}
-
-static CamelSessionThreadOps folder_changed_ops = {
- folder_changed_change,
- folder_changed_free,
-};
-
-static void
-folder_changed(CamelFolder *sub, CamelFolderChangeInfo *changes, CamelVeeFolder *vf)
-{
- struct _folder_changed_msg *m;
- CamelSession *session = ((CamelService *)((CamelFolder *)vf)->parent_store)->session;
-
- m = camel_session_thread_msg_new(session, &folder_changed_ops, sizeof(*m));
- m->changes = camel_folder_change_info_new();
- camel_folder_change_info_cat(m->changes, changes);
- m->sub = sub;
- camel_object_ref((CamelObject *)sub);
- m->vf = vf;
- camel_object_ref((CamelObject *)vf);
- camel_session_thread_queue(session, &m->msg, 0);
-}
-
-/* track flag changes in the summary, we just promote it to a folder_changed event */
-static void
-message_changed(CamelFolder *f, const char *uid, CamelVeeFolder *vf)
-{
- CamelFolderChangeInfo *changes;
-
- changes = camel_folder_change_info_new();
- camel_folder_change_info_change_uid(changes, uid);
- folder_changed(f, changes, vf);
- camel_folder_change_info_free(changes);
-}
-
-/* track vanishing folders */
-static void
-subfolder_deleted(CamelFolder *f, void *event_data, CamelVeeFolder *vf)
-{
- camel_vee_folder_remove_folder(vf, f);
-}
-
-
-static void
-vee_freeze (CamelFolder *folder)
-{
- CamelVeeFolder *vfolder = (CamelVeeFolder *) folder;
- struct _CamelVeeFolderPrivate *p = _PRIVATE (vfolder);
- GList *node;
-
- CAMEL_VEE_FOLDER_LOCK (vfolder, subfolder_lock);
-
- p->freeze_count++;
-
- node = p->folders;
- while (node) {
- CamelFolder *f = node->data;
-
- camel_folder_freeze (f);
- node = node->next;
- }
-
- CAMEL_VEE_FOLDER_UNLOCK (vfolder, subfolder_lock);
-
- /* call parent implementation */
- CAMEL_FOLDER_CLASS (camel_vee_folder_parent)->freeze (folder);
-}
-
-static void
-vee_thaw (CamelFolder *folder)
-{
- CamelVeeFolder *vfolder = (CamelVeeFolder *) folder;
- struct _CamelVeeFolderPrivate *p = _PRIVATE (vfolder);
- GList *node;
-
- CAMEL_VEE_FOLDER_LOCK (vfolder, subfolder_lock);
-
- p->freeze_count--;
-
- node = p->folders;
- while (node) {
- CamelFolder *f = node->data;
-
- camel_folder_thaw (f);
- node = node->next;
- }
-
- CAMEL_VEE_FOLDER_UNLOCK (vfolder, subfolder_lock);
-
- /* call parent implementation */
- CAMEL_FOLDER_CLASS (camel_vee_folder_parent)->thaw (folder);
-}
diff --git a/camel/camel-vee-folder.h b/camel/camel-vee-folder.h
deleted file mode 100644
index 3339b3a1d9..0000000000
--- a/camel/camel-vee-folder.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-
-#ifndef _CAMEL_VEE_FOLDER_H
-#define _CAMEL_VEE_FOLDER_H
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <glib.h>
-#include <camel/camel-folder.h>
-
-#define CAMEL_VEE_FOLDER(obj) CAMEL_CHECK_CAST (obj, camel_vee_folder_get_type (), CamelVeeFolder)
-#define CAMEL_VEE_FOLDER_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_vee_folder_get_type (), CamelVeeFolderClass)
-#define CAMEL_IS_VEE_FOLDER(obj) CAMEL_CHECK_TYPE (obj, camel_vee_folder_get_type ())
-
-typedef struct _CamelVeeFolder CamelVeeFolder;
-typedef struct _CamelVeeFolderClass CamelVeeFolderClass;
-
-/* our message info includes the parent folder */
-typedef struct _CamelVeeMessageInfo {
- CamelMessageInfo info;
- CamelFolder *folder;
-} CamelVeeMessageInfo;
-
-struct _CamelVeeFolder {
- CamelFolder parent;
-
- struct _CamelVeeFolderPrivate *priv;
-
- char *expression; /* query expression */
- char *vname; /* local name */
-
- guint32 flags; /* folder open flags */
-
- CamelFolderChangeInfo *changes;
- CamelFolderSearch *search;
-};
-
-struct _CamelVeeFolderClass {
- CamelFolderClass parent_class;
-};
-
-#define CAMEL_UNMATCHED_NAME "UNMATCHED"
-
-CamelType camel_vee_folder_get_type (void);
-CamelFolder *camel_vee_folder_new (CamelStore *parent_store, const char *name, guint32 flags);
-void camel_vee_folder_construct (CamelVeeFolder *vf, CamelStore *parent_store, const char *name, guint32 flags);
-
-CamelFolder *camel_vee_folder_get_location(CamelVeeFolder *vf, const CamelVeeMessageInfo *vinfo, char **realuid);
-
-void camel_vee_folder_add_folder (CamelVeeFolder *vf, CamelFolder *sub);
-void camel_vee_folder_remove_folder (CamelVeeFolder *vf, CamelFolder *sub);
-void camel_vee_folder_set_folders (CamelVeeFolder *vf, GList *folders);
-void camel_vee_folder_set_expression (CamelVeeFolder *vf, const char *expr);
-
-void camel_vee_folder_hash_folder (CamelFolder *folder, char buffer[8]);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* ! _CAMEL_VEE_FOLDER_H */
diff --git a/camel/camel-vee-store.c b/camel/camel-vee-store.c
deleted file mode 100644
index b13522b8de..0000000000
--- a/camel/camel-vee-store.c
+++ /dev/null
@@ -1,324 +0,0 @@
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "camel-exception.h"
-#include "camel-vee-store.h"
-#include "camel-vee-folder.h"
-
-#include "camel-private.h"
-
-#include <string.h>
-
-#define d(x)
-
-static CamelFolder *vee_get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex);
-static void vee_delete_folder(CamelStore *store, const char *folder_name, CamelException *ex);
-static void vee_rename_folder(CamelStore *store, const char *old, const char *new, CamelException *ex);
-static void vee_init_trash (CamelStore *store);
-static CamelFolder *vee_get_trash (CamelStore *store, CamelException *ex);
-static void vee_init_junk (CamelStore *store);
-static CamelFolder *vee_get_junk (CamelStore *store, CamelException *ex);
-
-static CamelFolderInfo *vee_get_folder_info(CamelStore *store, const char *top, guint32 flags, CamelException *ex);
-
-static void camel_vee_store_class_init (CamelVeeStoreClass *klass);
-static void camel_vee_store_init (CamelVeeStore *obj);
-static void camel_vee_store_finalise (CamelObject *obj);
-
-static CamelStoreClass *camel_vee_store_parent;
-
-CamelType
-camel_vee_store_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_store_get_type (), "CamelVeeStore",
- sizeof (CamelVeeStore),
- sizeof (CamelVeeStoreClass),
- (CamelObjectClassInitFunc) camel_vee_store_class_init,
- NULL,
- (CamelObjectInitFunc) camel_vee_store_init,
- (CamelObjectFinalizeFunc) camel_vee_store_finalise);
- }
-
- return type;
-}
-
-static void
-camel_vee_store_class_init (CamelVeeStoreClass *klass)
-{
- CamelStoreClass *store_class = (CamelStoreClass *) klass;
-
- camel_vee_store_parent = (CamelStoreClass *)camel_store_get_type();
-
- /* virtual method overload */
- store_class->get_folder = vee_get_folder;
- store_class->rename_folder = vee_rename_folder;
- store_class->delete_folder = vee_delete_folder;
- store_class->get_folder_info = vee_get_folder_info;
- store_class->free_folder_info = camel_store_free_folder_info_full;
-
- store_class->init_trash = vee_init_trash;
- store_class->get_trash = vee_get_trash;
- store_class->init_junk = vee_init_junk;
- store_class->get_junk = vee_get_junk;
-}
-
-static void
-camel_vee_store_init (CamelVeeStore *obj)
-{
- CamelStore *store = (CamelStore *)obj;
-
- /* we dont want a vtrash/vjunk on this one */
- store->flags &= ~(CAMEL_STORE_VTRASH | CAMEL_STORE_VJUNK);
-}
-
-static void
-camel_vee_store_finalise (CamelObject *obj)
-{
- ;
-}
-
-/**
- * camel_vee_store_new:
- *
- * Create a new CamelVeeStore object.
- *
- * Return value: A new CamelVeeStore widget.
- **/
-CamelVeeStore *
-camel_vee_store_new (void)
-{
- CamelVeeStore *new = CAMEL_VEE_STORE(camel_object_new(camel_vee_store_get_type ()));
- return new;
-}
-
-/* flags
- 1 = delete (0 = add)
- 2 = noselect
-*/
-#define CHANGE_ADD (0)
-#define CHANGE_DELETE (1)
-#define CHANGE_NOSELECT (2)
-
-static void
-change_folder(CamelStore *store, const char *name, guint32 flags, int count)
-{
- CamelFolderInfo *fi;
- const char *tmp;
-
- fi = g_malloc0(sizeof(*fi));
- fi->full_name = g_strdup(name);
- tmp = strrchr(name, '/');
- if (tmp == NULL)
- tmp = name;
- else
- tmp++;
- fi->name = g_strdup(tmp);
- fi->url = g_strdup_printf("vfolder:%s%s#%s", ((CamelService *)store)->url->path, (flags&CHANGE_NOSELECT)?";noselect=yes":"", name);
- fi->unread_message_count = count;
- camel_folder_info_build_path(fi, '/');
- camel_object_trigger_event(store, (flags&CHANGE_DELETE)?"folder_deleted":"folder_created", fi);
- camel_folder_info_free(fi);
-}
-
-static CamelFolder *
-vee_get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex)
-{
- CamelVeeFolder *vf;
- CamelFolder *folder;
- char *name, *p;
-
- vf = (CamelVeeFolder *)camel_vee_folder_new(store, folder_name, flags);
- if ((vf->flags & CAMEL_STORE_FOLDER_PRIVATE) == 0) {
- /* Check that parents exist, if not, create dummy ones */
- name = alloca(strlen(vf->vname)+1);
- strcpy(name, vf->vname);
- p = name;
- while ( (p = strchr(p, '/'))) {
- *p = 0;
-
- folder = camel_object_bag_get(store->folders, name);
- if (folder == NULL)
- change_folder(store, name, CHANGE_ADD|CHANGE_NOSELECT, -1);
- else
- camel_object_unref(folder);
- *p++='/';
- }
-
- change_folder(store, vf->vname, CHANGE_ADD, camel_folder_get_message_count((CamelFolder *)vf));
- }
-
- return (CamelFolder *)vf;
-}
-
-static void
-vee_init_trash (CamelStore *store)
-{
- /* no-op */
- ;
-}
-
-static CamelFolder *
-vee_get_trash (CamelStore *store, CamelException *ex)
-{
- return NULL;
-}
-
-static void
-vee_init_junk (CamelStore *store)
-{
- /* no-op */
- ;
-}
-
-static CamelFolder *
-vee_get_junk (CamelStore *store, CamelException *ex)
-{
- return NULL;
-}
-
-static CamelFolderInfo *
-vee_get_folder_info(CamelStore *store, const char *top, guint32 flags, CamelException *ex)
-{
- CamelFolderInfo *info;
- GPtrArray *folders, *infos;
- int i;
-
- infos = g_ptr_array_new();
- folders = camel_object_bag_list(store->folders);
- for (i=0;i<folders->len;i++) {
- CamelVeeFolder *folder = folders->pdata[i];
- int add = FALSE;
- char *name = ((CamelFolder *)folder)->full_name;
-
- /* check we have to include this one */
- if (top) {
- if (flags & CAMEL_STORE_FOLDER_INFO_RECURSIVE) {
- int namelen = strlen(name);
- int toplen = strlen(top);
-
- add = ((namelen == toplen &&
- strcmp(name, top) == 0)
- || ((namelen > toplen)
- && strncmp(name, top, toplen) == 0
- && name[toplen] == '/'));
- } else {
- add = strcmp(name, top) == 0;
- }
- } else {
- if ((flags & CAMEL_STORE_FOLDER_INFO_RECURSIVE) == 0)
- add = strchr(name, '/') == NULL;
- }
-
- if (add) {
- /* ensures unread is correct */
- if ((flags & CAMEL_STORE_FOLDER_INFO_FAST) == 0)
- camel_folder_refresh_info((CamelFolder *)folder, NULL);
-
- info = g_malloc0(sizeof(*info));
- info->url = g_strdup_printf("vfolder:%s#%s", ((CamelService *)((CamelFolder *)folder)->parent_store)->url->path,
- ((CamelFolder *)folder)->full_name);
- info->full_name = g_strdup(((CamelFolder *)folder)->full_name);
- info->name = g_strdup(((CamelFolder *)folder)->name);
- info->unread_message_count = camel_folder_get_unread_message_count((CamelFolder *)folder);
- g_ptr_array_add(infos, info);
- }
- camel_object_unref(folder);
- }
- g_ptr_array_free(folders, TRUE);
-
- /* and always add UNMATCHED, if scanning from top/etc */
- if (top == NULL || top[0] == 0 || strncmp(top, CAMEL_UNMATCHED_NAME, strlen(CAMEL_UNMATCHED_NAME)) == 0) {
- info = g_malloc0(sizeof(*info));
- info->url = g_strdup_printf("vfolder:%s#%s", ((CamelService *)store)->url->path, CAMEL_UNMATCHED_NAME);
- info->full_name = g_strdup(CAMEL_UNMATCHED_NAME);
- info->name = g_strdup(CAMEL_UNMATCHED_NAME);
- info->unread_message_count = -1;
- camel_folder_info_build_path(info, '/');
- g_ptr_array_add(infos, info);
- }
-
- /* convert it into a tree */
- info = camel_folder_info_build(infos, (top&&top[0])?top:"", '/', TRUE);
- g_ptr_array_free(infos, TRUE);
-
- return info;
-}
-
-static void
-vee_delete_folder(CamelStore *store, const char *folder_name, CamelException *ex)
-{
- CamelFolder *folder;
-
- if (strcmp(folder_name, CAMEL_UNMATCHED_NAME) == 0) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
- _("Cannot delete folder: %s: Invalid operation"), folder_name);
- return;
- }
-
- folder = camel_object_bag_get(store->folders, folder_name);
- if (folder) {
- camel_object_bag_remove(store->folders, folder);
-
- if (store->vtrash)
- camel_vee_folder_remove_folder((CamelVeeFolder *)store->vtrash, folder);
- if (store->vjunk)
- camel_vee_folder_remove_folder((CamelVeeFolder *)store->vjunk, folder);
-
- if ((((CamelVeeFolder *)folder)->flags & CAMEL_STORE_FOLDER_PRIVATE) == 0) {
- /* what about now-empty parents? ignore? */
- change_folder(store, folder_name, CHANGE_DELETE, -1);
- }
-
- camel_object_unref(folder);
- } else {
- camel_exception_setv(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
- _("Cannot delete folder: %s: No such folder"), folder_name);
- }
-}
-
-static void
-vee_rename_folder(CamelStore *store, const char *old, const char *new, CamelException *ex)
-{
- CamelFolder *folder;
-
- d(printf("vee rename folder '%s' '%s'\n", old, new));
-
- if (strcmp(old, CAMEL_UNMATCHED_NAME) == 0) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
- _("Cannot rename folder: %s: Invalid operation"), old);
- return;
- }
-
- /* See if it exists, for vfolders, all folders are in the folders hash */
- folder = camel_object_bag_get(store->folders, old);
- if (folder == NULL) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
- _("Cannot rename folder: %s: No such folder"), old);
- } else {
- camel_object_unref(folder);
- }
-}
diff --git a/camel/camel-vee-store.h b/camel/camel-vee-store.h
deleted file mode 100644
index d0352046be..0000000000
--- a/camel/camel-vee-store.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-
-#ifndef _CAMEL_VEE_STORE_H
-#define _CAMEL_VEE_STORE_H
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <glib.h>
-#include <camel/camel-store.h>
-
-#define CAMEL_VEE_STORE(obj) CAMEL_CHECK_CAST (obj, camel_vee_store_get_type (), CamelVeeStore)
-#define CAMEL_VEE_STORE_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_vee_store_get_type (), CamelVeeStoreClass)
-#define CAMEL_IS_VEE_STORE(obj) CAMEL_CHECK_TYPE (obj, camel_vee_store_get_type ())
-
-typedef struct _CamelVeeStore CamelVeeStore;
-typedef struct _CamelVeeStoreClass CamelVeeStoreClass;
-
-/* open mode for folder, vee folder auto-update */
-#define CAMEL_STORE_VEE_FOLDER_AUTO (1<<16)
-
-struct _CamelVeeStore {
- CamelStore parent;
-
-};
-
-struct _CamelVeeStoreClass {
- CamelStoreClass parent_class;
-};
-
-CamelType camel_vee_store_get_type (void);
-CamelVeeStore *camel_vee_store_new (void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* ! _CAMEL_VEE_STORE_H */
diff --git a/camel/camel-vtrash-folder.c b/camel/camel-vtrash-folder.c
deleted file mode 100644
index aa21ce3c4c..0000000000
--- a/camel/camel-vtrash-folder.c
+++ /dev/null
@@ -1,209 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2001 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include <config.h>
-
-#include "camel-exception.h"
-#include "camel-vtrash-folder.h"
-#include "camel-store.h"
-#include "camel-vee-store.h"
-#include "camel-mime-message.h"
-
-#include <string.h>
-
-/* Returns the class for a CamelFolder */
-#define CF_CLASS(so) CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-
-static CamelVeeFolderClass *camel_vtrash_folder_parent;
-
-static void vtrash_append_message (CamelFolder *folder, CamelMimeMessage *message,
- const CamelMessageInfo *info, char **appended_uid,
- CamelException *ex);
-static void vtrash_transfer_messages_to (CamelFolder *folder, GPtrArray *uids,
- CamelFolder *dest, GPtrArray **transferred_uids,
- gboolean delete_originals, CamelException *ex);
-
-static void
-camel_vtrash_folder_class_init (CamelVTrashFolderClass *klass)
-{
- CamelFolderClass *folder_class = (CamelFolderClass *) klass;
-
- camel_vtrash_folder_parent = CAMEL_VEE_FOLDER_CLASS(camel_vee_folder_get_type());
-
- folder_class->append_message = vtrash_append_message;
- folder_class->transfer_messages_to = vtrash_transfer_messages_to;
-}
-
-static void
-camel_vtrash_folder_init (CamelVTrashFolder *vtrash)
-{
- CamelFolder *folder = CAMEL_FOLDER (vtrash);
-
- folder->folder_flags |= CAMEL_FOLDER_IS_TRASH;
-}
-
-CamelType
-camel_vtrash_folder_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (camel_vee_folder_get_type (),
- "CamelVTrashFolder",
- sizeof (CamelVTrashFolder),
- sizeof (CamelVTrashFolderClass),
- (CamelObjectClassInitFunc) camel_vtrash_folder_class_init,
- NULL,
- (CamelObjectInitFunc) camel_vtrash_folder_init,
- NULL);
- }
-
- return type;
-}
-
-/**
- * camel_vtrash_folder_new:
- * @parent_store: the parent CamelVeeStore
- * @name: the vfolder name
- * @ex: a CamelException
- *
- * Create a new CamelVeeFolder object.
- *
- * Return value: A new CamelVeeFolder widget.
- **/
-CamelFolder *
-camel_vtrash_folder_new (CamelStore *parent_store, const char *name)
-{
- CamelFolder *vtrash;
-
- vtrash = (CamelFolder *)camel_object_new (camel_vtrash_folder_get_type ());
- camel_vee_folder_construct (CAMEL_VEE_FOLDER (vtrash), parent_store, name,
- CAMEL_STORE_FOLDER_PRIVATE | CAMEL_STORE_FOLDER_CREATE | CAMEL_STORE_VEE_FOLDER_AUTO);
- camel_vee_folder_set_expression((CamelVeeFolder *)vtrash, "(match-all (system-flag \"Deleted\"))");
-
- return vtrash;
-}
-
-static void
-vtrash_append_message (CamelFolder *folder, CamelMimeMessage *message,
- const CamelMessageInfo *info, char **appended_uid,
- CamelException *ex)
-{
- /* no-op */
-}
-
-struct _transfer_data {
- CamelFolder *folder;
- CamelFolder *dest;
- GPtrArray *uids;
- gboolean delete;
-};
-
-static void
-transfer_messages(CamelFolder *folder, struct _transfer_data *md, CamelException *ex)
-{
- int i;
-
- if (!camel_exception_is_set (ex))
- camel_folder_transfer_messages_to(md->folder, md->uids, md->dest, NULL, md->delete, ex);
-
- for (i=0;i<md->uids->len;i++)
- g_free(md->uids->pdata[i]);
- g_ptr_array_free(md->uids, TRUE);
- camel_object_unref((CamelObject *)md->folder);
- g_free(md);
-}
-
-static void
-vtrash_transfer_messages_to (CamelFolder *source, GPtrArray *uids,
- CamelFolder *dest, GPtrArray **transferred_uids,
- gboolean delete_originals, CamelException *ex)
-{
- CamelVeeMessageInfo *mi;
- int i;
- GHashTable *batch = NULL;
- const char *tuid;
- struct _transfer_data *md;
-
- /* This is a special case of transfer_messages_to: Either the
- * source or the destination is a vtrash folder (but not both
- * since a store should never have more than one).
- */
-
- if (transferred_uids)
- *transferred_uids = NULL;
-
- if (CAMEL_IS_VTRASH_FOLDER (dest)) {
- /* Copy to trash is meaningless. */
- if (!delete_originals)
- return;
-
- /* Move to trash is the same as deleting the message */
- for (i = 0; i < uids->len; i++)
- camel_folder_delete_message (source, uids->pdata[i]);
- return;
- }
-
- g_return_if_fail (CAMEL_IS_VTRASH_FOLDER (source));
-
- /* Moving/Copying from the trash to the original folder = undelete.
- * Moving/Copying from the trash to a different folder = move/copy.
- *
- * Need to check this uid by uid, but we batch up the copies.
- */
-
- for (i = 0; i < uids->len; i++) {
- mi = (CamelVeeMessageInfo *)camel_folder_get_message_info (source, uids->pdata[i]);
- if (mi == NULL) {
- g_warning ("Cannot find uid %s in source folder during transfer", (char *) uids->pdata[i]);
- continue;
- }
-
- if (dest == mi->folder) {
- /* Just undelete the original message */
- camel_folder_set_message_flags (source, uids->pdata[i], CAMEL_MESSAGE_DELETED, 0);
- } else {
- if (batch == NULL)
- batch = g_hash_table_new(NULL, NULL);
- md = g_hash_table_lookup(batch, mi->folder);
- if (md == NULL) {
- md = g_malloc0(sizeof(*md));
- md->folder = mi->folder;
- camel_object_ref((CamelObject *)md->folder);
- md->uids = g_ptr_array_new();
- md->dest = dest;
- g_hash_table_insert(batch, mi->folder, md);
- }
-
- tuid = uids->pdata[i];
- if (strlen(tuid)>8)
- tuid += 8;
- g_ptr_array_add(md->uids, g_strdup(tuid));
- }
- camel_folder_free_message_info (source, (CamelMessageInfo *)mi);
- }
-
- if (batch) {
- g_hash_table_foreach(batch, (GHFunc)transfer_messages, ex);
- g_hash_table_destroy(batch);
- }
-}
diff --git a/camel/camel-vtrash-folder.h b/camel/camel-vtrash-folder.h
deleted file mode 100644
index 089c969e71..0000000000
--- a/camel/camel-vtrash-folder.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2001 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifndef _CAMEL_VTRASH_FOLDER_H
-#define _CAMEL_VTRASH_FOLDER_H
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <camel/camel-folder.h>
-#include <camel/camel-vee-folder.h>
-
-#define CAMEL_VTRASH_NAME "Trash"
-#define CAMEL_VJUNK_NAME "Junk"
-
-#define CAMEL_VTRASH_FOLDER(obj) CAMEL_CHECK_CAST (obj, camel_vtrash_folder_get_type (), CamelVTrashFolder)
-#define CAMEL_VTRASH_FOLDER_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_vtrash_folder_get_type (), CamelVTrashFolderClass)
-#define CAMEL_IS_VTRASH_FOLDER(obj) CAMEL_CHECK_TYPE (obj, camel_vtrash_folder_get_type ())
-
-typedef struct _CamelVTrashFolder CamelVTrashFolder;
-typedef struct _CamelVTrashFolderClass CamelVTrashFolderClass;
-
-struct _CamelVTrashFolder {
- CamelVeeFolder parent;
-
-};
-
-struct _CamelVTrashFolderClass {
- CamelVeeFolderClass parent_class;
-
-};
-
-CamelType camel_vtrash_folder_get_type (void);
-
-CamelFolder *camel_vtrash_folder_new (CamelStore *parent_store, const char *name);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* ! _CAMEL_VTRASH_FOLDER_H */
diff --git a/camel/camel.c b/camel/camel.c
deleted file mode 100644
index ae99da74c2..0000000000
--- a/camel/camel.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- * Bertrand Guiheneuf <bertrand@helixcode.com>
- *
- * Copyright 1999-2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <signal.h>
-
-#ifdef HAVE_NSS
-#include <nspr.h>
-#include <prthread.h>
-#include "nss.h" /* Don't use <> here or it will include the system nss.h instead */
-#include <ssl.h>
-#endif /* HAVE_NSS */
-
-#include "camel.h"
-#include "camel-certdb.h"
-#include "camel-mime-utils.h"
-
-gboolean camel_verbose_debug = FALSE;
-
-static void
-camel_shutdown (void)
-{
- CamelCertDB *certdb;
-
-#ifdef HAVE_NSS
- NSS_Shutdown ();
-
- PR_Cleanup ();
-#endif /* HAVE_NSS */
-
- certdb = camel_certdb_get_default ();
- if (certdb) {
- camel_certdb_save (certdb);
- camel_object_unref (certdb);
- }
-}
-
-int
-camel_init (const char *configdir, gboolean nss_init)
-{
- CamelCertDB *certdb;
- char *path;
- void camel_operation_init(void);
-
- if (getenv ("CAMEL_VERBOSE_DEBUG"))
- camel_verbose_debug = TRUE;
-
- /* initialise global camel_object_type */
- camel_object_get_type ();
-
- camel_mime_utils_init ();
- camel_operation_init();
-
-#ifdef HAVE_NSS
- if (nss_init) {
- PR_Init (PR_SYSTEM_THREAD, PR_PRIORITY_NORMAL, 10);
-
- if (NSS_InitReadWrite (configdir) == SECFailure) {
- /* fall back on using volatile dbs? */
- if (NSS_NoDB_Init (configdir) == SECFailure) {
- g_warning ("Failed to initialize NSS");
- return -1;
- }
- }
-
- NSS_SetDomesticPolicy ();
-
- SSL_OptionSetDefault (SSL_ENABLE_SSL2, PR_TRUE);
- SSL_OptionSetDefault (SSL_ENABLE_SSL3, PR_TRUE);
- SSL_OptionSetDefault (SSL_ENABLE_TLS, PR_TRUE);
- SSL_OptionSetDefault (SSL_V2_COMPATIBLE_HELLO, PR_TRUE /* maybe? */);
- }
-#endif /* HAVE_NSS */
-
- path = g_strdup_printf ("%s/camel-cert.db", configdir);
- certdb = camel_certdb_new ();
- camel_certdb_set_filename (certdb, path);
- g_free (path);
-
- /* if we fail to load, who cares? it'll just be a volatile certdb */
- camel_certdb_load (certdb);
-
- /* set this certdb as the default db */
- camel_certdb_set_default (certdb);
-
- camel_object_unref (certdb);
-
- g_atexit (camel_shutdown);
-
- return 0;
-}
diff --git a/camel/camel.h b/camel/camel.h
deleted file mode 100644
index 9aba4ebd1a..0000000000
--- a/camel/camel.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- *
- * Author :
- * Bertrand Guiheneuf <bertrand@helixcode.com>
- *
- * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifndef CAMEL_H
-#define CAMEL_H 1
-
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <camel/camel-cipher-context.h>
-#include <camel/camel-data-wrapper.h>
-#include <camel/camel-exception.h>
-#include <camel/camel-folder.h>
-#include <camel/camel-digest-folder.h>
-#include <camel/camel-digest-store.h>
-#include <camel/camel-disco-diary.h>
-#include <camel/camel-disco-folder.h>
-#include <camel/camel-disco-store.h>
-#include <camel/camel-vee-folder.h>
-#include <camel/camel-medium.h>
-#include <camel/camel-mime-filter-basic.h>
-#include <camel/camel-mime-filter-canon.h>
-#include <camel/camel-mime-filter-charset.h>
-#include <camel/camel-mime-filter-enriched.h>
-#include <camel/camel-mime-filter-from.h>
-#include <camel/camel-mime-filter-index.h>
-#include <camel/camel-mime-filter-save.h>
-#include <camel/camel-mime-filter-crlf.h>
-#include <camel/camel-mime-filter-tohtml.h>
-#include <camel/camel-mime-filter.h>
-#include <camel/camel-mime-message.h>
-#include <camel/camel-mime-parser.h>
-#include <camel/camel-mime-part-utils.h>
-#include <camel/camel-mime-part.h>
-#include <camel/camel-mime-utils.h>
-#include <camel/camel-movemail.h>
-#include <camel/camel-multipart.h>
-#include <camel/camel-multipart-encrypted.h>
-#include <camel/camel-multipart-signed.h>
-#include <camel/camel-gpg-context.h>
-#include <camel/camel-provider.h>
-#include <camel/camel-seekable-stream.h>
-#include <camel/camel-seekable-substream.h>
-#include <camel/camel-service.h>
-#include <camel/camel-session.h>
-#include <camel/camel-store.h>
-#include <camel/camel-stream-buffer.h>
-#include <camel/camel-stream-filter.h>
-#include <camel/camel-stream-fs.h>
-#include <camel/camel-stream-mem.h>
-#include <camel/camel-stream.h>
-#include <camel/camel-tcp-stream-raw.h>
-#include <camel/camel-tcp-stream-ssl.h>
-#include <camel/camel-tcp-stream.h>
-#include <camel/camel-transport.h>
-#include <camel/camel-uid-cache.h>
-#include <camel/camel-url.h>
-#include <camel/camel-string-utils.h>
-
-gint camel_init (const char *certdb_dir, gboolean nss_init);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_H */
diff --git a/camel/devel-docs/camel-index.txt b/camel/devel-docs/camel-index.txt
deleted file mode 100644
index 0ebc250db0..0000000000
--- a/camel/devel-docs/camel-index.txt
+++ /dev/null
@@ -1,407 +0,0 @@
-
-The history of text-indexing in evolution.
-
-CamelTextIndex was written to address several shortcomings in the
-existing libibex (referred to as libibex2), which had been written to
-address shortcomings in the original libibex.
-
-Mail indexing characteristics
-
-First, i'll cover some of the scenarios that a mail indexing system
-must cover. They are slightly different from other indexing systems,
-at least we wanted them to be.
-
-1. Indexing a few new messages, they may potentially reference most of
- the alphabet in the index.
-2. Indexing a whole mailbox for the first time
-3. Unindexing anywhere from a few to all existing messages during expunge.
-4. Searching.
-
-Cases 1, 3, and 4 occur the most often, however 2 is the most noticeable
-at first use, or if the index must be reset. So the code needs to
-work fast in all cases, which generally leads to trade-offs being
-made. Each implementation aimed to address or ignore these
-requirements in different ways, with the final implementation probably
-having the best balance so far.
-
-The main issue is that the indexing be performed real time. We index
-as we add the messages. We index before we open the mailbox. We
-index as we remove messages. Because of this we need to approach
-things differently to many other indexing systems; most of which work
-with static data in an off-line mode. This allows them to index the
-whole body of content and use as much memory and cpu time as required.
-
-We probably need to look at doing offline, or at least delayed
-indexing in the future - but this introduces some coherency problems
-with vFolders and any body searches. However, having the indexing
-library a base part of Camel helps in implementing a mechanism to
-achieve this.
-
-Ibex the first
-
-The original ibex used a memory-based hash table to store words. This made
-the index very fast for both lookups and modifications. However any
-queries required a full load of the index into memory, and any updates
-required a full write of the index to disk. After about 5-10 000
-messages occasionaly adding to the index became appreciably slower as
-the whole index needed to be loaded into memory first. This obviously
-took a toll on memory as well.
-
-I wont cover the algorithms used, they were all pretty basic, the only
-real smarts were that index deletes were only flagged and that data
-not written to disk when the index saved.
-
-Evolution 1.x, ibex 2.
-
-In an attempt to rectify the incremental update performance of
-libibex, it was completely rewritten to use an on-disk block-based
-filesystem.
-
-Note: the first attempt used libdb - however performance was so slow
-and the indices were so large it was dropped in favour of a custom
-filesystem-like data file.
-
-The motivation was that a few extra disk lookups during
-retrieval wouldn't be noticeably slower, however it should be able to
-scale up to many more messages with lower memory overhead and slower
-startup time.
-
-The block filesystem contains 3 major components:
-
-1. A hash table that mapped message's to a word id sequence list.
-2. A hash table that mapped word's to a message id sequence list.
-3. A sequence filesystem that stored sequences of id's.
-
-The id's are 32 bit identifiers that are unique for each word or
-message. They are also designed to be reversible and static.
-That is, given the id, you can map it to the string identifier that it
-represents directly, without having to look it up in the hash table.
-
-Other features of this design is that the database file should be
-kept in sync at all times with the state of the index. The message to
-wordid tables are used to remove the messageid's from the word's it
-contains when the message is expunged, and so on.
-
-Indexing operation
-
-The indexing operation consists of the basic steps:
-
-1. Lookup the messageid from the message name, using the messageid table.
-2. Generate a list of words in the message
-3. For each word:
-4. Lookup the wordid and sequence information
-5. If the word doesn't exist, create a new word/wordid
-6. Add the messageid to the word sequence.
-7. Add the wordid to the message sequence.
-
-The initial implementation only used caching at the disk-block level.
-Unfortunately, the simple hash table design chosen (fixed sized base
-table with chained buckets) scaled very poorly above about 10 000
-messages. So this approach proved to be too i/o intensive for
-practical use, and several other caches were added to improve
-performance:
-
-1. Stage (1) above is done entirely in memory. At initial startup
- the whole list of potential names is read into an in-memory hash
- table.
-2. Stage (4) above is also done entirely in memory. Even a large
- cache provided little benefit due to wide distribution of potential
- words. This cache is only created when adding to the index.
-3. Stage (6) uses the table from stage (4) and concatenates upto
- approximately one disk blocks worth of messageid's before writing
- them out to the word sequence.
-4. Stage (7) concatenates all wordid's for a given message before
- writing them out at once.
-
-As you can see, the added complexity meant we nearly have to cache as
-much as the original version! This also almost removed all of the
-startup-time benefit for incremental update of the index, as the table
-was not stored as compactly on disk as the original version.
-
-However, we only ever stored a subset of the index in memory, and only
-during updates, with some tricks to reduce memory usage for very rare
-words, so the overall memory use was still much lower.
-
-Removing a message
-
-Removing a message is fairly involved:
-
-1. Lookup the messageid and word sequence list from the messageid table.
-2. For each wordid in the sequence list
-3. Lookup the message sequence list directly from the wordid table.
-4. Scan each block in the sequence, and remove any instances of the
- messageid.
-5. Remove the message to messageid mapping in the messageid table.
-
-Unfortunately caching helped very little here, particularly if many
-messages were removed. Also note that the file could never shrink as
-the data could be spread randomly over it. Removal is an extremely
-expensive an unbounded process. Deleting all of the messages in a
-mailbox is extremely i/o intensive, with blocks potentially being
-accessed dozens of times.
-
-Performing a query
-
-Performing a query is fast:
-
-1. Lookup the messageid sequence list from the wordid table.
-2. For each messageid
-3. Lookup the message name directly from the messageid table.
-
-Even without caching this performs at a very acceptable level.
-
-Summary
-
-This index performs reasonably well upto about 10 000 messages for a
-complete re-index. However with incremental updates it degrads much
-faster, only a few thousand messages added and it becomes tiresomely
-slow and i/o bound. The index becomes more fragmented with random
-updates and removals and heavily bogs down the system as you go much
-beyond those few thousand messages.
-
-The code is also very complicated and hard to follow. There are too
-many special cases, and it is buggy. Detected on-disk structure
-errors result in the index being reset, which although it shrinks the
-index, is very slow.
-
-The indices created are bulky, and never shrink. Because of the
-reverse index used for message removal, there is 50% redundant data at
-all times. Some overly tricky techniques (very much like ReiserFS's
-tail packing) are used to waste as little space as possible, with a
-great impact on performance.
-
-One other problem is that because the index is disk based, we
-use a file descriptor continuously. With some users having
->100 folders, they quickly run out of process file descriptors and
-evolution fails. To get around this a cache of least recently used
-index files is used to flush away and free file descriptors so they
-can be re-used. This makes it hard to lock the files; this problem
-still exists with the next implementation.
-
-Anyway, a better solution is required.
-
-CamelIndex
-
-The first problem to address was the api. It was starting to age.
-Although adequate, the api wasn't terribly clean, reusable, or
-scalable. The first thing was to objectise the library, and since we
-needed to use it in Camel, the best way was to create a CamelObject.
-
-CamelIndex was born. A mostly abstract class that provides a simple
-common interface for accessing indices, including cursors and utility
-and maintenance functions.
-
-In addition, a number of the features in libibex2 were simplified or
-rewritten and abstracted into the re-usable classes that follow.
-
-By providing simple cursors, more complex queries were easier to write
-and can execute more efficiently; camel searching now does sub-string
-searches for all body queries, and still runs at a very healthy speed
-and uses less memory than before.
-
-CamelBlockFile
-
-This is basically the same block filesystem used in libibex2. It
-handles disk i/o based on blocks (CamelBlock), flushing modified
-blocks to disk, and caching of recently accessed blocks. It was
-enhanced slightly to allow blocks to be locked in memory.
-
-CamelKeyFile
-
-This is a simple reverse-linked list of sequences of keyid's.
-
-The main property of this file is that updates are only ever appended
-to the end of the file, which improves i/o characteristics markedly.
-
-When an existing keyid sequence is updated, it simply points back to
-the start of the previous one, and provides a pointer to the new
-entry. i.e. a simple linked list.
-
-CamelKeyTable
-
-This is taken from the libibex2 code for mapping keys, with few
-changes. It uses a CamelBlockFile for its i/o.
-
-The key table is a linked list of blocks (CamelKeyBlock) which contain
-key strings and and a data pointer and flags for each key. Each block
-is a packed array of string descriptors (CamelKeyKey's).
-
-A keyid (camel_key_t) is a 32 bit descriptor which identifies this key
-in a reversible way. In this case the bottom 10 bits are used to
-identify the index of the key within the key block, and the top 22
-bits are used to identify the key block itself. In this way, given
-the 32 bit key id, we can reference the block containing the key
-directly (with at most 1 access), and access the flags and key string
-using the key index.
-
-Keys can potentially be removed and their keyid's reused by simply
-re-packing the key block. This was used in libibex2, but not in
-CamelIndex.
-
-[diagram - camelkeyblock]
-
-CamelPartitionTable
-
-An implementation of a scalable, on-disk 'perfect' hash table. It
-uses the CamelBlockFile to handle its i/o. This is a completely new
-hash table implementation which was not present in libibex2.
-
-[FIXME: Reference the original paper the algorithm is based on.]
-
-A partition table consists of a list of mapping blocks
-(CamelPartitionMapBlock), which is a compact table that maps a range
-of hashid's to a partition block (CamelPartitionKeyBlock), which
-contains hashid's of that range.
-
-[diagram - camelpartitiontable]
-
-The partition block only maps the hashid to a keyid (see CamelKeyTable)
-which means it can store a lot of keys in each block.
-
-To add a new value to the partition table:
-
-1. Calculate the hash value of the key
-2. Find out which partition block the key will fit into, using the
- partition table.
-3. If the partition block is full:
-4. If there is room in the next or previous block:
-5. Merge the 2 blocks together, and split at the half-way point
-6. Update the partition table hash indices to match the blocks
-7. Else
-8. Create a new block, and split the existing block across it
-9. Insert the new block into the partition table
-10. Else
-11. Just add the key to the end of the block.
-
-Steps 5 and 8 perform a sorting of the partition key entries by hashid
-to find the midpoint. It may be beneficial to store the hashid's
-sorted always, it would then not require a sort to split the blocks.
-This would also benefit key lookups by being able to use a binary
-search. However, the incremental sort may be more expensive.
-
-If the partition table itself fills up, then perform a similar
-splitting function on its blocks, and store it over multiple blocks.
-With a block size of 1024 bytes, we can fit 127 blocks pointers, each
-with 127 keys in it - around 16000 keys. So we only need 1024 bytes
-of memory for each 16000 on-disk keys (assuming full tables).
-
-Removal is basically the same, but if we end up with an empty block we
-just remove it from the partition table. CamelTextIndex doesn't
-actually use removal although it is implemented in
-CamelPartitionTable.
-
-Lookup is very simple. We basically follow steps 1 and 2, and then
-perform a linear search through the block to find a matching hash id.
-That is our key. This is assuming a perfect hash, additionally the
-code could use the keyid to lookup in a keytable to verify the key is
-indeed the right one. This would require having to support duplicate
-hashid's and would make block splitting slightly more complex, but
-only by a couple of lines of code. This is something that will
-probably have to be addressed in the future.
-
-Using a partition table means that we can tell with 1 disk access
-whether or not a key exists (assuming a perfect hash function), and 1
-more access to look up all of the details of the key since the keyid
-is reversible. Another feature is that the partition table is always
-self-balancing for any data processed in any order.
-
-Yet one more feature is that it is quite easy to order the writes to
-the partition table so that its structure is always consistent, even
-in the event of program failure. Although this has been disabled in
-the current code to take maximal advantage of the block cache.
-
-CamelTextIndex
-
-CamelTextIndex is the implementation of CamelIndex now used by camel
-for indexing mail. It shares some features with the second
-incarnation of libibex, but is generally simpler. It uses the
-previously described classes to implement the CamelIndex interface.
-
-Indexing operation
-
-Indexing operation is similar to libibex2, but without the requirement
-to maintain the reverse index.
-
-1. Lookup the messageid from the message name, using the messageid
- partition table.
-2. Generate a list of words in the message
-3. For each word
-4. Lookup the wordid and sequence information.
-5. Append the messageid to the word sequence.
-
-In practice we also have a word cache which caches upto 32 messageid's
-for each word before it is written to the key file.
-
-Removing a message
-
-Removal is not immediate. This is one of the major performance
-improvements in CamelIndex.
-
-1. Lookup the messageid from the message name partition table
-2. Use the messageid to set a flag in the message key table to
- indicate the message has been deleted.
-3. Remove the key hash from the partition table.
-
-This comes down to a maximum of 2 disk reads and 2 disk writes.
-libibex2 had unbounded maximums, depending on the number of words in a
-given message. The key file is not changed.
-
-Because data is not removed from the files at all, an additional
-optional step is required, that of compressing the indices.
-
-Performing a query
-
-Performing a query is much the same as with libibex2. We usually have
-slightly less disk i/o because of a more efficient and scalable hash
-table implementation, and improved locality of reference of the key
-table data.
-
-1. Lookup the messageid from the message name partition table
-2. Use the messageid to get the data pointer directly from the key
- table.
-3. Iterate through the key file, reading blocks backwards through the
- file.
-
-Compressing
-
-Although it could have benefited from it, libibex2 did not ever
-compress indices - the only way to compress an index was to remove it
-and have it be rebuilt.
-
-CamelIndex requires a compression stage as data is never removed from
-it otherwise. Because of the much greater locality of reference, the
-compression stage is actually much faster than an incremental removal
-of data inside the data files.
-
-Compressing comprises the following steps:
-
-1. Open a new temporary index, an index block file and an index key
- file.
-2. For each message in the message partition table
-3. If the message is not marked deleted, add it to the new message
- partition table, and recored the old messageid to new messageid
- mapping.
-4. For each word in the word partition table
-5. For each messageid's in the word sequence list
-6. If the messageid maps to a new messageid, remap the messageid,
- else discard it.
-7. Concatenate upto 256 messageid's in a row before writing to the
- key file, to improve lookups.
-8. Create a new word in the new word key table
-9. Add the wordid and new sequence id to the word partition table.
-
-Note that at step 8 we could (should?) also check if the word has any
-messages associated with it, and discard the word from the new index.
-
-After compression, the name partition index only contains names which
-are not deleted, and the key file is compressed into larger blocks
-which takes up less space and is faster to retrieve.
-
-During index operations a number of statistics are taken which trigger
-an automatic compress when the file fragmentation or number of deleted
-messages exceed a threshold. So the index maintains itself, and does
-not need manual compression.
-
-
-
-
diff --git a/camel/devel-docs/camel_data_wrapper.dia b/camel/devel-docs/camel_data_wrapper.dia
deleted file mode 100644
index 301563d1ee..0000000000
--- a/camel/devel-docs/camel_data_wrapper.dia
+++ /dev/null
Binary files differ
diff --git a/camel/devel-docs/camel_parser_states.dia b/camel/devel-docs/camel_parser_states.dia
deleted file mode 100644
index 556a5b1c49..0000000000
--- a/camel/devel-docs/camel_parser_states.dia
+++ /dev/null
Binary files differ
diff --git a/camel/devel-docs/camel_stream.dia b/camel/devel-docs/camel_stream.dia
deleted file mode 100644
index d91d1bb153..0000000000
--- a/camel/devel-docs/camel_stream.dia
+++ /dev/null
Binary files differ
diff --git a/camel/providers/.cvsignore b/camel/providers/.cvsignore
deleted file mode 100644
index 3dda72986f..0000000000
--- a/camel/providers/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile.in
-Makefile
diff --git a/camel/providers/Makefile.am b/camel/providers/Makefile.am
deleted file mode 100644
index 119966aacb..0000000000
--- a/camel/providers/Makefile.am
+++ /dev/null
@@ -1,12 +0,0 @@
-## Process this file with automake to produce Makefile.in
-
-if ENABLE_NNTP
-NNTP_DIR=nntp
-endif
-
-if ENABLE_IMAPP
-IMAPP_DIR=imapp
-endif
-
-SUBDIRS = pop3 sendmail smtp imap $(NNTP_DIR) local $(IMAPP_DIR)
-
diff --git a/camel/providers/imap/.cvsignore b/camel/providers/imap/.cvsignore
deleted file mode 100644
index 3fa8afaa38..0000000000
--- a/camel/providers/imap/.cvsignore
+++ /dev/null
@@ -1,11 +0,0 @@
-.deps
-Makefile
-Makefile.in
-.libs
-.deps
-*.lo
-*.la
-*.bb
-*.bbg
-*.da
-*.gcov
diff --git a/camel/providers/imap/Makefile.am b/camel/providers/imap/Makefile.am
deleted file mode 100644
index 1a2f46faf9..0000000000
--- a/camel/providers/imap/Makefile.am
+++ /dev/null
@@ -1,48 +0,0 @@
-## Process this file with automake to produce Makefile.in
-
-libcamelimapincludedir = $(privincludedir)/camel
-
-camel_provider_LTLIBRARIES = libcamelimap.la
-camel_provider_DATA = libcamelimap.urls
-
-INCLUDES = -I.. \
- -I$(srcdir)/.. \
- -I$(top_srcdir)/camel \
- -I$(top_srcdir)/intl \
- -I$(top_srcdir)/e-util \
- -I$(top_srcdir) \
- $(CAMEL_CFLAGS) \
- $(GNOME_INCLUDEDIR) \
- $(GTK_INCLUDEDIR) \
- -DG_LOG_DOMAIN=\"camel-imap-provider\"
-
-libcamelimap_la_SOURCES = \
- camel-imap-command.c \
- camel-imap-folder.c \
- camel-imap-message-cache.c \
- camel-imap-provider.c \
- camel-imap-search.c \
- camel-imap-store.c \
- camel-imap-store-summary.c \
- camel-imap-summary.c \
- camel-imap-utils.c \
- camel-imap-wrapper.c
-
-libcamelimapinclude_HEADERS = \
- camel-imap-command.h \
- camel-imap-folder.h \
- camel-imap-message-cache.h \
- camel-imap-search.h \
- camel-imap-store.h \
- camel-imap-store-summary.h \
- camel-imap-summary.h \
- camel-imap-types.h \
- camel-imap-utils.h \
- camel-imap-wrapper.h
-
-libcamelimap_la_LDFLAGS = -avoid-version -module
-
-noinst_HEADERS = \
- camel-imap-private.h
-
-EXTRA_DIST = libcamelimap.urls
diff --git a/camel/providers/imap/camel-imap-command.c b/camel/providers/imap/camel-imap-command.c
deleted file mode 100644
index 45e5751b87..0000000000
--- a/camel/providers/imap/camel-imap-command.c
+++ /dev/null
@@ -1,822 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-imap-command.c: IMAP command sending/parsing routines */
-
-/*
- * Authors:
- * Dan Winship <danw@ximian.com>
- * Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2000, 2001 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdarg.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-
-#include "camel-imap-command.h"
-#include "camel-imap-utils.h"
-#include "camel-imap-folder.h"
-#include "camel-imap-store.h"
-#include "camel-imap-store-summary.h"
-#include "camel-imap-private.h"
-#include <camel/camel-exception.h>
-#include <camel/camel-private.h>
-#include <camel/camel-utf8.h>
-#include <camel/camel-session.h>
-
-
-extern int camel_verbose_debug;
-
-static gboolean imap_command_start (CamelImapStore *store, CamelFolder *folder,
- const char *cmd, CamelException *ex);
-CamelImapResponse *imap_read_response (CamelImapStore *store,
- CamelException *ex);
-static char *imap_read_untagged (CamelImapStore *store, char *line,
- CamelException *ex);
-static char *imap_command_strdup_vprintf (CamelImapStore *store,
- const char *fmt, va_list ap);
-static char *imap_command_strdup_printf (CamelImapStore *store,
- const char *fmt, ...);
-
-/**
- * camel_imap_command:
- * @store: the IMAP store
- * @folder: The folder to perform the operation in (or %NULL if not
- * relevant).
- * @ex: a CamelException
- * @fmt: a sort of printf-style format string, followed by arguments
- *
- * This function calls camel_imap_command_start() to send the
- * command, then reads the complete response to it using
- * camel_imap_command_response() and returns a CamelImapResponse
- * structure.
- *
- * As a special case, if @fmt is %NULL, it will just select @folder
- * and return the response from doing so.
- *
- * See camel_imap_command_start() for details on @fmt.
- *
- * On success, the store's connect_lock will be locked. It will be freed
- * when you call camel_imap_response_free. (The lock is recursive, so
- * callers can grab and release it themselves if they need to run
- * multiple commands atomically.)
- *
- * Return value: %NULL if an error occurred (in which case @ex will
- * be set). Otherwise, a CamelImapResponse describing the server's
- * response, which the caller must free with camel_imap_response_free().
- **/
-CamelImapResponse *
-camel_imap_command (CamelImapStore *store, CamelFolder *folder,
- CamelException *ex, const char *fmt, ...)
-{
- va_list ap;
- char *cmd;
-
- CAMEL_SERVICE_LOCK (store, connect_lock);
-
- if (fmt) {
- va_start (ap, fmt);
- cmd = imap_command_strdup_vprintf (store, fmt, ap);
- va_end (ap);
- } else {
- if (store->current_folder) {
- camel_object_unref (CAMEL_OBJECT (store->current_folder));
- store->current_folder = NULL;
- }
- store->current_folder = folder;
- camel_object_ref (CAMEL_OBJECT (folder));
- cmd = imap_command_strdup_printf (store, "SELECT %F",
- folder->full_name);
- }
-
- if (!imap_command_start (store, folder, cmd, ex)) {
- g_free (cmd);
- CAMEL_SERVICE_UNLOCK (store, connect_lock);
- return NULL;
- }
- g_free (cmd);
-
- return imap_read_response (store, ex);
-}
-
-/**
- * camel_imap_command_start:
- * @store: the IMAP store
- * @folder: The folder to perform the operation in (or %NULL if not
- * relevant).
- * @ex: a CamelException
- * @fmt: a sort of printf-style format string, followed by arguments
- *
- * This function makes sure that @folder (if non-%NULL) is the
- * currently-selected folder on @store and then sends the IMAP command
- * specified by @fmt and the following arguments.
- *
- * @fmt can include the following %-escapes ONLY:
- * %s, %d, %%: as with printf
- * %S: an IMAP "string" (quoted string or literal)
- * %F: an IMAP folder name
- *
- * %S strings will be passed as literals if the server supports LITERAL+
- * and quoted strings otherwise. (%S does not support strings that
- * contain newlines.)
- *
- * %F will have the imap store's namespace prepended and then be processed
- * like %S.
- *
- * On success, the store's connect_lock will be locked. It will be
- * freed when %CAMEL_IMAP_RESPONSE_TAGGED or %CAMEL_IMAP_RESPONSE_ERROR
- * is returned from camel_imap_command_response(). (The lock is
- * recursive, so callers can grab and release it themselves if they
- * need to run multiple commands atomically.)
- *
- * Return value: %TRUE if the command was sent successfully, %FALSE if
- * an error occurred (in which case @ex will be set).
- **/
-gboolean
-camel_imap_command_start (CamelImapStore *store, CamelFolder *folder,
- CamelException *ex, const char *fmt, ...)
-{
- va_list ap;
- char *cmd;
- gboolean ok;
-
- va_start (ap, fmt);
- cmd = imap_command_strdup_vprintf (store, fmt, ap);
- va_end (ap);
-
- CAMEL_SERVICE_LOCK (store, connect_lock);
- ok = imap_command_start (store, folder, cmd, ex);
- g_free (cmd);
-
- if (!ok)
- CAMEL_SERVICE_UNLOCK (store, connect_lock);
- return ok;
-}
-
-static gboolean
-imap_command_start (CamelImapStore *store, CamelFolder *folder,
- const char *cmd, CamelException *ex)
-{
- ssize_t nwritten;
-
- /* Check for current folder */
- if (folder && folder != store->current_folder) {
- CamelImapResponse *response;
- CamelException internal_ex;
-
- response = camel_imap_command (store, folder, ex, NULL);
- if (!response)
- return FALSE;
- camel_exception_init (&internal_ex);
- camel_imap_folder_selected (folder, response, &internal_ex);
- camel_imap_response_free (store, response);
- if (camel_exception_is_set (&internal_ex)) {
- camel_exception_xfer (ex, &internal_ex);
- return FALSE;
- }
- }
-
- /* Send the command */
- if (camel_verbose_debug) {
- const char *mask;
-
- if (!strncmp ("LOGIN \"", cmd, 7))
- mask = "LOGIN \"xxx\" xxx";
- else if (!strncmp ("LOGIN {", cmd, 7))
- mask = "LOGIN {N+}\r\nxxx {N+}\r\nxxx";
- else if (!strncmp ("LOGIN ", cmd, 6))
- mask = "LOGIN xxx xxx";
- else
- mask = cmd;
-
- fprintf (stderr, "sending : %c%.5d %s\r\n", store->tag_prefix, store->command, mask);
- }
-
- nwritten = camel_stream_printf (store->ostream, "%c%.5d %s\r\n",
- store->tag_prefix, store->command++, cmd);
-
- if (nwritten == -1) {
- if (errno == EINTR)
- camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
- _("Operation cancelled"));
- else
- camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
- g_strerror (errno));
-
- camel_service_disconnect (CAMEL_SERVICE (store), FALSE, NULL);
- return FALSE;
- }
-
- return TRUE;
-}
-
-/**
- * camel_imap_command_continuation:
- * @store: the IMAP store
- * @cmd: buffer containing the response/request data
- * @cmdlen: command length
- * @ex: a CamelException
- *
- * This method is for sending continuing responses to the IMAP server
- * after camel_imap_command() or camel_imap_command_response() returns
- * a continuation response.
- *
- * This function assumes you have an exclusive lock on the imap stream.
- *
- * Return value: as for camel_imap_command(). On failure, the store's
- * connect_lock will be released.
- **/
-CamelImapResponse *
-camel_imap_command_continuation (CamelImapStore *store, const char *cmd,
- size_t cmdlen, CamelException *ex)
-{
- if (!camel_imap_store_connected (store, ex))
- return NULL;
-
- if (camel_stream_write (store->ostream, cmd, cmdlen) == -1 ||
- camel_stream_write (store->ostream, "\r\n", 2) == -1) {
- if (errno == EINTR)
- camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
- _("Operation cancelled"));
- else
- camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
- g_strerror (errno));
- camel_service_disconnect (CAMEL_SERVICE (store), FALSE, NULL);
- CAMEL_SERVICE_UNLOCK (store, connect_lock);
- return NULL;
- }
-
- return imap_read_response (store, ex);
-}
-
-/**
- * camel_imap_command_response:
- * @store: the IMAP store
- * @response: a pointer to pass back the response data in
- * @ex: a CamelException
- *
- * This reads a single tagged, untagged, or continuation response from
- * @store into *@response. The caller must free the string when it is
- * done with it.
- *
- * Return value: One of %CAMEL_IMAP_RESPONSE_CONTINUATION,
- * %CAMEL_IMAP_RESPONSE_UNTAGGED, %CAMEL_IMAP_RESPONSE_TAGGED, or
- * %CAMEL_IMAP_RESPONSE_ERROR. If either of the last two, @store's
- * command lock will be unlocked.
- **/
-CamelImapResponseType
-camel_imap_command_response (CamelImapStore *store, char **response,
- CamelException *ex)
-{
- CamelImapResponseType type;
- char *respbuf;
-
- if (camel_imap_store_readline (store, &respbuf, ex) < 0) {
- CAMEL_SERVICE_UNLOCK (store, connect_lock);
- return CAMEL_IMAP_RESPONSE_ERROR;
- }
-
- switch (*respbuf) {
- case '*':
- if (!strncasecmp (respbuf, "* BYE", 5)) {
- /* Connection was lost, no more data to fetch */
- camel_service_disconnect (CAMEL_SERVICE (store), FALSE, NULL);
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
- _("Server unexpectedly disconnected: %s"),
- _("Unknown error")); /* g_strerror (104)); FIXME after 1.0 is released */
- store->connected = FALSE;
- g_free (respbuf);
- respbuf = NULL;
- type = CAMEL_IMAP_RESPONSE_ERROR;
- break;
- }
-
- /* Read the rest of the response. */
- type = CAMEL_IMAP_RESPONSE_UNTAGGED;
- respbuf = imap_read_untagged (store, respbuf, ex);
- if (!respbuf)
- type = CAMEL_IMAP_RESPONSE_ERROR;
- else if (!strncasecmp (respbuf, "* OK [ALERT]", 12)) {
- char *msg;
-
- /* for imap ALERT codes, account user@host */
- msg = g_strdup_printf(_("Alert from IMAP server %s@%s:\n%s"),
- ((CamelService *)store)->url->user, ((CamelService *)store)->url->host, respbuf+12);
- camel_session_alert_user(((CamelService *)store)->session, CAMEL_SESSION_ALERT_WARNING, msg, FALSE);
- g_free(msg);
- }
-
- break;
- case '+':
- type = CAMEL_IMAP_RESPONSE_CONTINUATION;
- break;
- default:
- type = CAMEL_IMAP_RESPONSE_TAGGED;
- break;
- }
- *response = respbuf;
-
- if (type == CAMEL_IMAP_RESPONSE_ERROR ||
- type == CAMEL_IMAP_RESPONSE_TAGGED)
- CAMEL_SERVICE_UNLOCK (store, connect_lock);
-
- return type;
-}
-
-CamelImapResponse *
-imap_read_response (CamelImapStore *store, CamelException *ex)
-{
- CamelImapResponse *response;
- CamelImapResponseType type;
- char *respbuf, *p;
-
- /* Get another lock so that when we reach the tagged
- * response and camel_imap_command_response unlocks,
- * we're still locked. This lock is owned by response
- * and gets unlocked when response is freed.
- */
- CAMEL_SERVICE_LOCK (store, connect_lock);
-
- response = g_new0 (CamelImapResponse, 1);
- if (store->current_folder && camel_disco_store_status (CAMEL_DISCO_STORE (store)) != CAMEL_DISCO_STORE_RESYNCING) {
- response->folder = store->current_folder;
- camel_object_ref (CAMEL_OBJECT (response->folder));
- }
-
- response->untagged = g_ptr_array_new ();
- while ((type = camel_imap_command_response (store, &respbuf, ex))
- == CAMEL_IMAP_RESPONSE_UNTAGGED)
- g_ptr_array_add (response->untagged, respbuf);
-
- if (type == CAMEL_IMAP_RESPONSE_ERROR) {
- camel_imap_response_free_without_processing (store, response);
- return NULL;
- }
-
- response->status = respbuf;
-
- /* Check for OK or continuation response. */
- if (*respbuf == '+')
- return response;
- p = strchr (respbuf, ' ');
- if (p && !strncasecmp (p, " OK", 3))
- return response;
-
- /* We should never get BAD, or anything else but +, OK, or NO
- * for that matter.
- */
- if (!p || strncasecmp (p, " NO", 3) != 0) {
- g_warning ("Unexpected response from IMAP server: %s",
- respbuf);
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
- _("Unexpected response from IMAP "
- "server: %s"), respbuf);
- camel_imap_response_free_without_processing (store, response);
- return NULL;
- }
-
- p += 3;
- if (!*p++)
- p = NULL;
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("IMAP command failed: %s"),
- p ? p : _("Unknown error"));
- camel_imap_response_free_without_processing (store, response);
- return NULL;
-}
-
-/* Given a line that is the start of an untagged response, read and
- * return the complete response, which may include an arbitrary number
- * of literals.
- */
-static char *
-imap_read_untagged (CamelImapStore *store, char *line, CamelException *ex)
-{
- int fulllen, ldigits, nread, i;
- unsigned int length;
- GPtrArray *data;
- GString *str;
- char *end, *p, *s, *d;
-
- p = strrchr (line, '{');
- if (!p)
- return line;
-
- data = g_ptr_array_new ();
- fulllen = 0;
-
- while (1) {
- str = g_string_new (line);
- g_free (line);
- fulllen += str->len;
- g_ptr_array_add (data, str);
-
- p = strrchr (str->str, '{');
- if (!p)
- break;
-
- length = strtoul (p + 1, &end, 10);
- if (*end != '}' || *(end + 1) || end == p + 1 || length >= UINT_MAX - 2)
- break;
- ldigits = end - (p + 1);
-
- /* Read the literal */
- str = g_string_sized_new (length + 2);
- str->str[0] = '\n';
- nread = camel_stream_read (store->istream, str->str + 1, length);
- if (nread == -1) {
- if (errno == EINTR)
- camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
- _("Operation cancelled"));
- else
- camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
- g_strerror (errno));
- camel_service_disconnect (CAMEL_SERVICE (store), FALSE, NULL);
- g_string_free (str, TRUE);
- goto lose;
- }
- if (nread < length) {
- camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
- _("Server response ended too soon."));
- camel_service_disconnect (CAMEL_SERVICE (store), FALSE, NULL);
- g_string_free (str, TRUE);
- goto lose;
- }
- str->str[length + 1] = '\0';
-
- /* Fix up the literal, turning CRLFs into LF. Also, if
- * we find any embedded NULs, strip them. This is
- * dubious, but:
- * - The IMAP grammar says you can't have NULs here
- * anyway, so this will not affect our behavior
- * against any completely correct server.
- * - WU-imapd 12.264 (at least) will cheerily pass
- * NULs along if they are embedded in the message
- */
-
- s = d = str->str + 1;
- end = str->str + 1 + length;
- while (s < end) {
- while (s < end && *s == '\0') {
- s++;
- length--;
- }
- if (*s == '\r' && *(s + 1) == '\n') {
- s++;
- length--;
- }
- *d++ = *s++;
- }
- *d = '\0';
- str->len = length + 1;
-
- /* p points to the "{" in the line that starts the
- * literal. The length of the CR-less response must be
- * less than or equal to the length of the response
- * with CRs, therefore overwriting the old value with
- * the new value cannot cause an overrun. However, we
- * don't want it to be shorter either, because then the
- * GString's length would be off...
- */
- sprintf (p, "{%0*d}", ldigits, length);
-
- fulllen += str->len;
- g_ptr_array_add (data, str);
-
- /* Read the next line. */
- if (camel_imap_store_readline (store, &line, ex) < 0)
- goto lose;
- }
-
- /* Now reassemble the data. */
- p = line = g_malloc (fulllen + 1);
- for (i = 0; i < data->len; i++) {
- str = data->pdata[i];
- memcpy (p, str->str, str->len);
- p += str->len;
- g_string_free (str, TRUE);
- }
- *p = '\0';
- g_ptr_array_free (data, TRUE);
- return line;
-
- lose:
- for (i = 0; i < data->len; i++)
- g_string_free (data->pdata[i], TRUE);
- g_ptr_array_free (data, TRUE);
- return NULL;
-}
-
-
-/**
- * camel_imap_response_free:
- * @store: the CamelImapStore the response is from
- * @response: a CamelImapResponse
- *
- * Frees all of the data in @response and processes any untagged
- * EXPUNGE and EXISTS responses in it. Releases @store's connect_lock.
- **/
-void
-camel_imap_response_free (CamelImapStore *store, CamelImapResponse *response)
-{
- int i, number, exists = 0;
- GArray *expunged = NULL;
- char *resp, *p;
-
- if (!response)
- return;
-
- for (i = 0; i < response->untagged->len; i++) {
- resp = response->untagged->pdata[i];
-
- if (response->folder) {
- /* Check if it's something we need to handle. */
- number = strtoul (resp + 2, &p, 10);
- if (!strcasecmp (p, " EXISTS")) {
- exists = number;
- } else if (!strcasecmp (p, " EXPUNGE")) {
- if (!expunged) {
- expunged = g_array_new (FALSE, FALSE,
- sizeof (int));
- }
- g_array_append_val (expunged, number);
- }
- }
- g_free (resp);
- }
-
- g_ptr_array_free (response->untagged, TRUE);
- g_free (response->status);
-
- if (response->folder) {
- if (exists > 0 || expunged) {
- /* Update the summary */
- camel_imap_folder_changed (response->folder,
- exists, expunged, NULL);
- if (expunged)
- g_array_free (expunged, TRUE);
- }
-
- camel_object_unref (CAMEL_OBJECT (response->folder));
- }
-
- g_free (response);
- CAMEL_SERVICE_UNLOCK (store, connect_lock);
-}
-
-/**
- * camel_imap_response_free_without_processing:
- * @store: the CamelImapStore the response is from.
- * @response: a CamelImapResponse:
- *
- * Frees all of the data in @response without processing any untagged
- * responses. Releases @store's command lock.
- **/
-void
-camel_imap_response_free_without_processing (CamelImapStore *store,
- CamelImapResponse *response)
-{
- if (!response)
- return;
-
- if (response->folder) {
- camel_object_unref (CAMEL_OBJECT (response->folder));
- response->folder = NULL;
- }
- camel_imap_response_free (store, response);
-}
-
-/**
- * camel_imap_response_extract:
- * @store: the store the response came from
- * @response: the response data returned from camel_imap_command
- * @type: the response type to extract
- * @ex: a CamelException
- *
- * This checks that @response contains a single untagged response of
- * type @type and returns just that response data. If @response
- * doesn't contain the right information, the function will set @ex
- * and return %NULL. Either way, @response will be freed and the
- * store's connect_lock released.
- *
- * Return value: the desired response string, which the caller must free.
- **/
-char *
-camel_imap_response_extract (CamelImapStore *store,
- CamelImapResponse *response,
- const char *type,
- CamelException *ex)
-{
- int len = strlen (type), i;
- char *resp;
-
- len = strlen (type);
-
- for (i = 0; i < response->untagged->len; i++) {
- resp = response->untagged->pdata[i];
- /* Skip "* ", and initial sequence number, if present */
- strtoul (resp + 2, &resp, 10);
- if (*resp == ' ')
- resp = (char *) imap_next_word (resp);
-
- if (!strncasecmp (resp, type, len))
- break;
- }
-
- if (i < response->untagged->len) {
- resp = response->untagged->pdata[i];
- g_ptr_array_remove_index (response->untagged, i);
- } else {
- resp = NULL;
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
- _("IMAP server response did not contain "
- "%s information"), type);
- }
-
- camel_imap_response_free (store, response);
- return resp;
-}
-
-/**
- * camel_imap_response_extract_continuation:
- * @store: the store the response came from
- * @response: the response data returned from camel_imap_command
- * @ex: a CamelException
- *
- * This checks that @response contains a continuation response, and
- * returns just that data. If @response doesn't contain a continuation
- * response, the function will set @ex, release @store's connect_lock,
- * and return %NULL. Either way, @response will be freed.
- *
- * Return value: the desired response string, which the caller must free.
- **/
-char *
-camel_imap_response_extract_continuation (CamelImapStore *store,
- CamelImapResponse *response,
- CamelException *ex)
-{
- char *status;
-
- if (response->status && *response->status == '+') {
- status = response->status;
- response->status = NULL;
- camel_imap_response_free (store, response);
- return status;
- }
-
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
- _("Unexpected OK response from IMAP server: %s"),
- response->status);
- camel_imap_response_free (store, response);
- return NULL;
-}
-
-static char *
-imap_command_strdup_vprintf (CamelImapStore *store, const char *fmt,
- va_list ap)
-{
- GPtrArray *args;
- const char *p, *start;
- char *out, *outptr, *string;
- int num, len, i, arglen;
-
- args = g_ptr_array_new ();
-
- /* Determine the length of the data */
- len = strlen (fmt);
- p = start = fmt;
- while (*p) {
- p = strchr (start, '%');
- if (!p)
- break;
-
- switch (*++p) {
- case 'd':
- num = va_arg (ap, int);
- g_ptr_array_add (args, GINT_TO_POINTER (num));
- start = p + 1;
- len += 10;
- break;
- case 's':
- string = va_arg (ap, char *);
- g_ptr_array_add (args, string);
- start = p + 1;
- len += strlen (string);
- break;
- case 'S':
- case 'F':
- string = va_arg (ap, char *);
- if (*p == 'F') {
- /* NB: this is freed during output */
- char *s = camel_imap_store_summary_full_from_path(store->summary, string);
- string = s?s:camel_utf8_utf7(string);
- }
- arglen = strlen (string);
- g_ptr_array_add (args, string);
- if (imap_is_atom (string)) {
- len += arglen;
- } else {
- if (store->capabilities & IMAP_CAPABILITY_LITERALPLUS)
- len += arglen + 15;
- else
- len += arglen * 2;
- }
- start = p + 1;
- break;
- case '%':
- start = p;
- break;
- default:
- g_warning ("camel-imap-command is not printf. I don't "
- "know what '%%%c' means.", *p);
- start = *p ? p + 1 : p;
- break;
- }
- }
-
- /* Now write out the string */
- outptr = out = g_malloc (len + 1);
- p = start = fmt;
- i = 0;
- while (*p) {
- p = strchr (start, '%');
- if (!p) {
- strcpy (outptr, start);
- break;
- } else {
- strncpy (outptr, start, p - start);
- outptr += p - start;
- }
-
- switch (*++p) {
- case 'd':
- num = GPOINTER_TO_INT (args->pdata[i++]);
- outptr += sprintf (outptr, "%d", num);
- break;
-
- case 's':
- string = args->pdata[i++];
- outptr += sprintf (outptr, "%s", string);
- break;
- case 'S':
- case 'F':
- string = args->pdata[i++];
- if (imap_is_atom (string)) {
- outptr += sprintf (outptr, "%s", string);
- } else {
- if (store->capabilities & IMAP_CAPABILITY_LITERALPLUS) {
- outptr += sprintf (outptr, "{%d+}\r\n%s", strlen (string), string);
- } else {
- char *quoted = imap_quote_string (string);
-
- outptr += sprintf (outptr, "%s", quoted);
- g_free (quoted);
- }
- }
-
- if (*p == 'F')
- g_free (string);
- break;
- default:
- *outptr++ = '%';
- *outptr++ = *p;
- }
-
- start = *p ? p + 1 : p;
- }
-
- return out;
-}
-
-static char *
-imap_command_strdup_printf (CamelImapStore *store, const char *fmt, ...)
-{
- va_list ap;
- char *result;
-
- va_start (ap, fmt);
- result = imap_command_strdup_vprintf (store, fmt, ap);
- va_end (ap);
-
- return result;
-}
diff --git a/camel/providers/imap/camel-imap-command.h b/camel/providers/imap/camel-imap-command.h
deleted file mode 100644
index 3539ac63d2..0000000000
--- a/camel/providers/imap/camel-imap-command.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-imap-command.h: IMAP command sending/parsing routines */
-
-/*
- * Authors:
- * Dan Winship <danw@ximian.com>
- * Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright (C) 2000, 2001 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifndef CAMEL_IMAP_COMMAND_H
-#define CAMEL_IMAP_COMMAND_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include <glib.h>
-#include "camel-imap-types.h"
-
-typedef enum {
- CAMEL_IMAP_RESPONSE_ERROR,
- CAMEL_IMAP_RESPONSE_CONTINUATION,
- CAMEL_IMAP_RESPONSE_UNTAGGED,
- CAMEL_IMAP_RESPONSE_TAGGED
-} CamelImapResponseType;
-
-struct _CamelImapResponse {
- CamelFolder *folder;
- GPtrArray *untagged;
- char *status;
-};
-
-CamelImapResponse *camel_imap_command (CamelImapStore *store,
- CamelFolder *folder,
- CamelException *ex,
- const char *fmt, ...);
-CamelImapResponse *camel_imap_command_continuation (CamelImapStore *store,
- const char *cmd,
- size_t cmdlen,
- CamelException *ex);
-
-void camel_imap_response_free (CamelImapStore *store,
- CamelImapResponse *response);
-void camel_imap_response_free_without_processing (CamelImapStore *store,
- CamelImapResponse *response);
-char *camel_imap_response_extract (CamelImapStore *store,
- CamelImapResponse *response,
- const char *type,
- CamelException *ex);
-char *camel_imap_response_extract_continuation (CamelImapStore *store,
- CamelImapResponse *response,
- CamelException *ex);
-
-gboolean camel_imap_command_start (CamelImapStore *store,
- CamelFolder *folder,
- CamelException *ex,
- const char *fmt, ...);
-CamelImapResponseType camel_imap_command_response (CamelImapStore *store,
- char **respbuf,
- CamelException *ex);
-
-#endif /* CAMEL_IMAP_COMMAND_H */
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
deleted file mode 100644
index 4db0c7a43f..0000000000
--- a/camel/providers/imap/camel-imap-folder.c
+++ /dev/null
@@ -1,2729 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-imap-folder.c: class for an imap folder */
-
-/*
- * Authors:
- * Dan Winship <danw@ximian.com>
- * Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright (C) 2000, 2001 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdlib.h>
-#include <sys/types.h>
-#include <dirent.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <errno.h>
-#include <string.h>
-#include <fcntl.h>
-#include <ctype.h>
-
-#include "e-util/e-path.h"
-#include "e-util/e-time-utils.h"
-
-#include "camel-imap-folder.h"
-#include "camel-imap-command.h"
-#include "camel-imap-message-cache.h"
-#include "camel-imap-private.h"
-#include "camel-imap-search.h"
-#include "camel-imap-store.h"
-#include "camel-imap-summary.h"
-#include "camel-imap-utils.h"
-#include "camel-imap-wrapper.h"
-#include "camel-data-wrapper.h"
-#include "camel-disco-diary.h"
-#include "camel-exception.h"
-#include "camel-mime-filter-crlf.h"
-#include "camel-mime-filter-from.h"
-#include "camel-mime-message.h"
-#include "camel-mime-utils.h"
-#include "camel-multipart.h"
-#include "camel-multipart-signed.h"
-#include "camel-multipart-encrypted.h"
-#include "camel-operation.h"
-#include "camel-session.h"
-#include "camel-stream-buffer.h"
-#include "camel-stream-filter.h"
-#include "camel-stream-mem.h"
-#include "camel-stream.h"
-#include "camel-private.h"
-#include "camel-string-utils.h"
-#include "camel-file-utils.h"
-
-
-#define d(x)
-
-/* set to -1 for infinite size */
-#define UID_SET_LIMIT (4096)
-
-
-#define CF_CLASS(o) (CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(o)))
-static CamelDiscoFolderClass *disco_folder_class = NULL;
-
-static void imap_finalize (CamelObject *object);
-static int imap_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args);
-
-static void imap_rescan (CamelFolder *folder, int exists, CamelException *ex);
-static void imap_refresh_info (CamelFolder *folder, CamelException *ex);
-static void imap_sync_online (CamelFolder *folder, CamelException *ex);
-static void imap_sync_offline (CamelFolder *folder, CamelException *ex);
-static void imap_expunge_uids_online (CamelFolder *folder, GPtrArray *uids, CamelException *ex);
-static void imap_expunge_uids_offline (CamelFolder *folder, GPtrArray *uids, CamelException *ex);
-static void imap_expunge_uids_resyncing (CamelFolder *folder, GPtrArray *uids, CamelException *ex);
-static void imap_cache_message (CamelDiscoFolder *disco_folder, const char *uid, CamelException *ex);
-static void imap_rename (CamelFolder *folder, const char *new);
-
-/* message manipulation */
-static CamelMimeMessage *imap_get_message (CamelFolder *folder, const gchar *uid,
- CamelException *ex);
-static void imap_append_online (CamelFolder *folder, CamelMimeMessage *message,
- const CamelMessageInfo *info, char **appended_uid,
- CamelException *ex);
-static void imap_append_offline (CamelFolder *folder, CamelMimeMessage *message,
- const CamelMessageInfo *info, char **appended_uid,
- CamelException *ex);
-static void imap_append_resyncing (CamelFolder *folder, CamelMimeMessage *message,
- const CamelMessageInfo *info, char **appended_uid,
- CamelException *ex);
-
-static void imap_transfer_online (CamelFolder *source, GPtrArray *uids,
- CamelFolder *dest, GPtrArray **transferred_uids,
- gboolean delete_originals,
- CamelException *ex);
-static void imap_transfer_offline (CamelFolder *source, GPtrArray *uids,
- CamelFolder *dest, GPtrArray **transferred_uids,
- gboolean delete_originals,
- CamelException *ex);
-static void imap_transfer_resyncing (CamelFolder *source, GPtrArray *uids,
- CamelFolder *dest, GPtrArray **transferred_uids,
- gboolean delete_originals,
- CamelException *ex);
-
-/* searching */
-static GPtrArray *imap_search_by_expression (CamelFolder *folder, const char *expression, CamelException *ex);
-static GPtrArray *imap_search_by_uids (CamelFolder *folder, const char *expression, GPtrArray *uids, CamelException *ex);
-static void imap_search_free (CamelFolder *folder, GPtrArray *uids);
-
-static void imap_thaw (CamelFolder *folder);
-
-static CamelObjectClass *parent_class;
-
-static GData *parse_fetch_response (CamelImapFolder *imap_folder, char *msg_att);
-
-static void
-camel_imap_folder_class_init (CamelImapFolderClass *camel_imap_folder_class)
-{
- CamelFolderClass *camel_folder_class = CAMEL_FOLDER_CLASS (camel_imap_folder_class);
- CamelDiscoFolderClass *camel_disco_folder_class = CAMEL_DISCO_FOLDER_CLASS (camel_imap_folder_class);
-
- disco_folder_class = CAMEL_DISCO_FOLDER_CLASS (camel_type_get_global_classfuncs (camel_disco_folder_get_type ()));
-
- /* virtual method overload */
- ((CamelObjectClass *)camel_imap_folder_class)->getv = imap_getv;
-
- camel_folder_class->get_message = imap_get_message;
- camel_folder_class->rename = imap_rename;
- camel_folder_class->search_by_expression = imap_search_by_expression;
- camel_folder_class->search_by_uids = imap_search_by_uids;
- camel_folder_class->search_free = imap_search_free;
- camel_folder_class->thaw = imap_thaw;
-
- camel_disco_folder_class->refresh_info_online = imap_refresh_info;
- camel_disco_folder_class->sync_online = imap_sync_online;
- camel_disco_folder_class->sync_offline = imap_sync_offline;
- /* We don't sync flags at resync time: the online code will
- * deal with it eventually.
- */
- camel_disco_folder_class->sync_resyncing = imap_sync_offline;
- camel_disco_folder_class->expunge_uids_online = imap_expunge_uids_online;
- camel_disco_folder_class->expunge_uids_offline = imap_expunge_uids_offline;
- camel_disco_folder_class->expunge_uids_resyncing = imap_expunge_uids_resyncing;
- camel_disco_folder_class->append_online = imap_append_online;
- camel_disco_folder_class->append_offline = imap_append_offline;
- camel_disco_folder_class->append_resyncing = imap_append_resyncing;
- camel_disco_folder_class->transfer_online = imap_transfer_online;
- camel_disco_folder_class->transfer_offline = imap_transfer_offline;
- camel_disco_folder_class->transfer_resyncing = imap_transfer_resyncing;
- camel_disco_folder_class->cache_message = imap_cache_message;
-}
-
-static void
-camel_imap_folder_init (gpointer object, gpointer klass)
-{
- CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (object);
- CamelFolder *folder = CAMEL_FOLDER (object);
-
- folder->permanent_flags = CAMEL_MESSAGE_ANSWERED | CAMEL_MESSAGE_DELETED |
- CAMEL_MESSAGE_DRAFT | CAMEL_MESSAGE_FLAGGED | CAMEL_MESSAGE_SEEN;
-
- folder->folder_flags |= (CAMEL_FOLDER_HAS_SUMMARY_CAPABILITY |
- CAMEL_FOLDER_HAS_SEARCH_CAPABILITY);
-
- imap_folder->priv = g_malloc0(sizeof(*imap_folder->priv));
-#ifdef ENABLE_THREADS
- imap_folder->priv->search_lock = e_mutex_new(E_MUTEX_SIMPLE);
- imap_folder->priv->cache_lock = e_mutex_new(E_MUTEX_REC);
-#endif
-
- imap_folder->need_rescan = TRUE;
-}
-
-CamelType
-camel_imap_folder_get_type (void)
-{
- static CamelType camel_imap_folder_type = CAMEL_INVALID_TYPE;
-
- if (camel_imap_folder_type == CAMEL_INVALID_TYPE) {
- parent_class = camel_disco_folder_get_type();
- camel_imap_folder_type =
- camel_type_register (parent_class, "CamelImapFolder",
- sizeof (CamelImapFolder),
- sizeof (CamelImapFolderClass),
- (CamelObjectClassInitFunc) camel_imap_folder_class_init,
- NULL,
- (CamelObjectInitFunc) camel_imap_folder_init,
- (CamelObjectFinalizeFunc) imap_finalize);
- }
-
- return camel_imap_folder_type;
-}
-
-CamelFolder *
-camel_imap_folder_new (CamelStore *parent, const char *folder_name,
- const char *folder_dir, CamelException *ex)
-{
- CamelImapStore *imap_store = CAMEL_IMAP_STORE (parent);
- CamelFolder *folder;
- CamelImapFolder *imap_folder;
- const char *short_name;
- char *summary_file;
-
- if (camel_mkdir (folder_dir, S_IRWXU) != 0) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not create directory %s: %s"),
- folder_dir, g_strerror (errno));
- return NULL;
- }
-
- folder = CAMEL_FOLDER (camel_object_new (camel_imap_folder_get_type ()));
- short_name = strrchr (folder_name, imap_store->dir_sep);
- if (short_name)
- short_name++;
- else
- short_name = folder_name;
- camel_folder_construct (folder, parent, folder_name, short_name);
-
- summary_file = g_strdup_printf ("%s/summary", folder_dir);
- folder->summary = camel_imap_summary_new (summary_file);
- g_free (summary_file);
- if (!folder->summary) {
- camel_object_unref (CAMEL_OBJECT (folder));
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not load summary for %s"),
- folder_name);
- return NULL;
- }
-
- imap_folder = CAMEL_IMAP_FOLDER (folder);
- imap_folder->cache = camel_imap_message_cache_new (folder_dir, folder->summary, ex);
- if (!imap_folder->cache) {
- camel_object_unref (CAMEL_OBJECT (folder));
- return NULL;
- }
-
- if ((imap_store->parameters & IMAP_PARAM_FILTER_INBOX) &&
- !strcasecmp (folder_name, "INBOX"))
- folder->folder_flags |= CAMEL_FOLDER_FILTER_RECENT;
-
- imap_folder->search = camel_imap_search_new(folder_dir);
-
- return folder;
-}
-
-/* Called with the store's connect_lock locked */
-void
-camel_imap_folder_selected (CamelFolder *folder, CamelImapResponse *response,
- CamelException *ex)
-{
- CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (folder);
- CamelImapSummary *imap_summary = CAMEL_IMAP_SUMMARY (folder->summary);
- unsigned long exists = 0, validity = 0, val, uid;
- CamelMessageInfo *info;
- GData *fetch_data;
- int i, count;
- char *resp;
-
- CAMEL_SERVICE_ASSERT_LOCKED (folder->parent_store, connect_lock);
-
- count = camel_folder_summary_count (folder->summary);
-
- for (i = 0; i < response->untagged->len; i++) {
- resp = response->untagged->pdata[i] + 2;
- if (!strncasecmp (resp, "FLAGS ", 6) &&
- !folder->permanent_flags) {
- resp += 6;
- folder->permanent_flags = imap_parse_flag_list (&resp);
- } else if (!strncasecmp (resp, "OK [PERMANENTFLAGS ", 19)) {
- resp += 19;
- folder->permanent_flags = imap_parse_flag_list (&resp);
- } else if (!strncasecmp (resp, "OK [UIDVALIDITY ", 16)) {
- validity = strtoul (resp + 16, NULL, 10);
- } else if (isdigit ((unsigned char)*resp)) {
- unsigned long num = strtoul (resp, &resp, 10);
-
- if (!strncasecmp (resp, " EXISTS", 7)) {
- exists = num;
- /* Remove from the response so nothing
- * else tries to interpret it.
- */
- g_free (response->untagged->pdata[i]);
- g_ptr_array_remove_index (response->untagged, i--);
- }
- }
- }
-
- if (camel_disco_store_status (CAMEL_DISCO_STORE (folder->parent_store)) == CAMEL_DISCO_STORE_RESYNCING) {
- if (validity != imap_summary->validity) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_SUMMARY_INVALID,
- _("Folder was destroyed and recreated on server."));
- return;
- }
-
- /* FIXME: find missing UIDs ? */
- return;
- }
-
- if (!imap_summary->validity)
- imap_summary->validity = validity;
- else if (validity != imap_summary->validity) {
- imap_summary->validity = validity;
- camel_folder_summary_clear (folder->summary);
- CAMEL_IMAP_FOLDER_LOCK (imap_folder, cache_lock);
- camel_imap_message_cache_clear (imap_folder->cache);
- CAMEL_IMAP_FOLDER_UNLOCK (imap_folder, cache_lock);
- imap_folder->need_rescan = FALSE;
- camel_imap_folder_changed (folder, exists, NULL, ex);
- return;
- }
-
- /* If we've lost messages, we have to rescan everything */
- if (exists < count)
- imap_folder->need_rescan = TRUE;
- else if (count != 0 && !imap_folder->need_rescan) {
- CamelImapStore *store = CAMEL_IMAP_STORE (folder->parent_store);
-
- /* Similarly, if the UID of the highest message we
- * know about has changed, then that indicates that
- * messages have been both added and removed, so we
- * have to rescan to find the removed ones. (We pass
- * NULL for the folder since we know that this folder
- * is selected, and we don't want camel_imap_command
- * to worry about it.)
- */
- response = camel_imap_command (store, NULL, ex, "FETCH %d UID", count);
- if (!response)
- return;
- uid = 0;
- for (i = 0; i < response->untagged->len; i++) {
- resp = response->untagged->pdata[i];
- val = strtoul (resp + 2, &resp, 10);
- if (val == 0)
- continue;
- if (!strcasecmp (resp, " EXISTS")) {
- /* Another one?? */
- exists = val;
- continue;
- }
- if (uid != 0 || val != count || strncasecmp (resp, " FETCH (", 8) != 0)
- continue;
-
- fetch_data = parse_fetch_response (imap_folder, resp + 7);
- uid = strtoul (g_datalist_get_data (&fetch_data, "UID"), NULL, 10);
- g_datalist_clear (&fetch_data);
- }
- camel_imap_response_free_without_processing (store, response);
-
- info = camel_folder_summary_index (folder->summary, count - 1);
- val = strtoul (camel_message_info_uid (info), NULL, 10);
- camel_folder_summary_info_free (folder->summary, info);
- if (uid == 0 || uid != val)
- imap_folder->need_rescan = TRUE;
- }
-
- /* Now rescan if we need to */
- if (imap_folder->need_rescan) {
- imap_rescan (folder, exists, ex);
- return;
- }
-
- /* If we don't need to rescan completely, but new messages
- * have been added, find out about them.
- */
- if (exists > count)
- camel_imap_folder_changed (folder, exists, NULL, ex);
-
- /* And we're done. */
-}
-
-static void
-imap_finalize (CamelObject *object)
-{
- CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (object);
-
- if (imap_folder->search)
- camel_object_unref (CAMEL_OBJECT (imap_folder->search));
- if (imap_folder->cache)
- camel_object_unref (CAMEL_OBJECT (imap_folder->cache));
-
-#ifdef ENABLE_THREADS
- e_mutex_destroy(imap_folder->priv->search_lock);
- e_mutex_destroy(imap_folder->priv->cache_lock);
-#endif
- g_free(imap_folder->priv);
-}
-
-static int
-imap_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args)
-{
- CamelFolder *folder = (CamelFolder *)object;
- int i, count=args->argc;
- guint32 tag;
-
- for (i=0;i<args->argc;i++) {
- CamelArgGet *arg = &args->argv[i];
-
- tag = arg->tag;
-
- switch (tag & CAMEL_ARG_TAG) {
- /* CamelObject args */
- case CAMEL_OBJECT_ARG_DESCRIPTION:
- if (folder->description == NULL) {
- CamelURL *uri = ((CamelService *)folder->parent_store)->url;
-
- /* what if the full name doesn't incclude /'s? does it matter? */
- folder->description = g_strdup_printf("%s@%s:%s", uri->user, uri->host, folder->full_name);
- }
- *arg->ca_str = folder->description;
- break;
- default:
- count--;
- continue;
- }
-
- arg->tag = (tag & CAMEL_ARG_TYPE) | CAMEL_ARG_IGNORE;
- }
-
- if (count)
- return ((CamelObjectClass *)parent_class)->getv(object, ex, args);
-
- return 0;
-}
-
-static void
-imap_rename (CamelFolder *folder, const char *new)
-{
- CamelImapFolder *imap_folder = (CamelImapFolder *)folder;
- CamelImapStore *imap_store = (CamelImapStore *)folder->parent_store;
- char *folder_dir, *summary_path;
- char *folders;
-
- folders = g_strconcat (imap_store->storage_path, "/folders", NULL);
- folder_dir = e_path_to_physical (folders, new);
- g_free (folders);
- summary_path = g_strdup_printf("%s/summary", folder_dir);
-
- CAMEL_IMAP_FOLDER_LOCK (folder, cache_lock);
- camel_imap_message_cache_set_path(imap_folder->cache, folder_dir);
- CAMEL_IMAP_FOLDER_UNLOCK (folder, cache_lock);
-
- camel_folder_summary_set_filename(folder->summary, summary_path);
-
- g_free(summary_path);
- g_free(folder_dir);
-
- ((CamelFolderClass *)disco_folder_class)->rename(folder, new);
-}
-
-static void
-imap_refresh_info (CamelFolder *folder, CamelException *ex)
-{
- CamelImapStore *imap_store = CAMEL_IMAP_STORE (folder->parent_store);
- CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (folder);
- CamelImapResponse *response;
-
- if (camel_disco_store_status (CAMEL_DISCO_STORE (imap_store)) == CAMEL_DISCO_STORE_OFFLINE)
- return;
-
- if (camel_folder_is_frozen (folder)) {
- imap_folder->need_refresh = TRUE;
- return;
- }
-
- /* If the folder isn't selected, select it (which will force
- * a rescan if one is needed).
- * Also, if this is the INBOX, some servers (cryus) wont tell
- * us with a NOOP of new messages, so force a reselect which
- * should do it. */
- CAMEL_SERVICE_LOCK (imap_store, connect_lock);
- if (imap_store->current_folder != folder
- || strcasecmp(folder->full_name, "INBOX") == 0) {
- CAMEL_SERVICE_UNLOCK (imap_store, connect_lock);
- response = camel_imap_command (imap_store, folder, ex, NULL);
- if (response) {
- camel_imap_folder_selected (folder, response, ex);
- camel_imap_response_free (imap_store, response);
- }
- return;
- }
- CAMEL_SERVICE_UNLOCK (imap_store, connect_lock);
-
- /* Otherwise, if we need a rescan, do it, and if not, just do
- * a NOOP to give the server a chance to tell us about new
- * messages.
- */
- if (imap_folder->need_rescan)
- imap_rescan (folder, camel_folder_summary_count (folder->summary), ex);
- else {
-#if 0
- /* on some servers need to CHECKpoint INBOX to recieve new messages?? */
- /* rfc2060 suggests this, but havent seen a server that requires it */
- if (strcasecmp(folder->full_name, "INBOX") == 0) {
- response = camel_imap_command (imap_store, folder, ex, "CHECK");
- camel_imap_response_free (imap_store, response);
- }
-#endif
- response = camel_imap_command (imap_store, folder, ex, "NOOP");
- camel_imap_response_free (imap_store, response);
- }
-}
-
-/* Called with the store's connect_lock locked */
-static void
-imap_rescan (CamelFolder *folder, int exists, CamelException *ex)
-{
- CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (folder);
- CamelImapStore *store = CAMEL_IMAP_STORE (folder->parent_store);
- struct {
- char *uid;
- guint32 flags;
- } *new;
- char *resp;
- CamelImapResponseType type;
- int i, seq, summary_len, summary_got;
- CamelMessageInfo *info;
- CamelImapMessageInfo *iinfo;
- GArray *removed;
- gboolean ok;
- CamelFolderChangeInfo *changes = NULL;
-
- CAMEL_SERVICE_ASSERT_LOCKED (store, connect_lock);
- imap_folder->need_rescan = FALSE;
-
- summary_len = camel_folder_summary_count (folder->summary);
- if (summary_len == 0) {
- if (exists)
- camel_imap_folder_changed (folder, exists, NULL, ex);
- return;
- }
-
- /* Check UIDs and flags of all messages we already know of. */
- camel_operation_start (NULL, _("Scanning for changed messages"));
- info = camel_folder_summary_index (folder->summary, summary_len - 1);
- ok = camel_imap_command_start (store, folder, ex,
- "UID FETCH 1:%s (FLAGS)",
- camel_message_info_uid (info));
- camel_folder_summary_info_free (folder->summary, info);
- if (!ok) {
- camel_operation_end (NULL);
- return;
- }
-
- new = g_malloc0 (summary_len * sizeof (*new));
- summary_got = 0;
- while ((type = camel_imap_command_response (store, &resp, ex)) == CAMEL_IMAP_RESPONSE_UNTAGGED) {
- GData *data;
- char *uid;
- guint32 flags;
-
- data = parse_fetch_response (imap_folder, resp);
- g_free (resp);
- if (!data)
- continue;
-
- seq = GPOINTER_TO_INT (g_datalist_get_data (&data, "SEQUENCE"));
- uid = g_datalist_get_data (&data, "UID");
- flags = GPOINTER_TO_UINT (g_datalist_get_data (&data, "FLAGS"));
-
- if (!uid || !seq || seq > summary_len) {
- g_datalist_clear (&data);
- continue;
- }
-
- camel_operation_progress (NULL, ++summary_got * 100 / summary_len);
- new[seq - 1].uid = g_strdup (uid);
- new[seq - 1].flags = flags;
- g_datalist_clear (&data);
- }
-
- camel_operation_end (NULL);
- if (type == CAMEL_IMAP_RESPONSE_ERROR) {
- for (i = 0; i < summary_len && new[i].uid; i++)
- g_free (new[i].uid);
- g_free (new);
- return;
- }
-
- /* Free the final tagged response */
- g_free (resp);
-
- /* If we find a UID in the summary that doesn't correspond to
- * the UID in the folder, then either: (a) it's a real UID,
- * but the message was deleted on the server, or (b) it's a
- * fake UID, and needs to be removed from the summary in order
- * to sync up with the server. So either way, we remove it
- * from the summary.
- */
- removed = g_array_new (FALSE, FALSE, sizeof (int));
- for (i = 0; i < summary_len && new[i].uid; i++) {
- info = camel_folder_summary_index (folder->summary, i);
- iinfo = (CamelImapMessageInfo *)info;
-
- if (strcmp (camel_message_info_uid (info), new[i].uid) != 0) {
- camel_folder_summary_info_free(folder->summary, info);
- seq = i + 1;
- g_array_append_val (removed, seq);
- i--;
- summary_len--;
- continue;
- }
-
- /* Update summary flags */
- if (new[i].flags != iinfo->server_flags) {
- guint32 server_set, server_cleared;
-
- server_set = new[i].flags & ~iinfo->server_flags;
- server_cleared = iinfo->server_flags & ~new[i].flags;
-
- info->flags = (info->flags | server_set) & ~server_cleared;
- iinfo->server_flags = new[i].flags;
-
- if (changes == NULL)
- changes = camel_folder_change_info_new();
- camel_folder_change_info_change_uid(changes, new[i].uid);
- }
-
- camel_folder_summary_info_free (folder->summary, info);
- g_free (new[i].uid);
- }
-
- if (changes) {
- camel_object_trigger_event(CAMEL_OBJECT (folder), "folder_changed", changes);
- camel_folder_change_info_free(changes);
- }
-
- seq = i + 1;
-
- /* Free remaining memory. */
- while (i < summary_len && new[i].uid)
- g_free (new[i++].uid);
- g_free (new);
-
- /* Remove any leftover cached summary messages. (Yes, we
- * repeatedly add the same number to the removed array.
- * See RFC2060 7.4.1)
- */
-
- for (i = seq; i <= summary_len; i++)
- g_array_append_val (removed, seq);
-
- /* And finally update the summary. */
- camel_imap_folder_changed (folder, exists, removed, ex);
- g_array_free (removed, TRUE);
-}
-
-/* the max number of chars that an unsigned 32-bit int can be is 10 chars plus 1 for a possible : */
-#define UID_SET_FULL(setlen, maxlen) (maxlen > 0 ? setlen + 11 >= maxlen : FALSE)
-
-/* Find all messages in @folder with flags matching @flags and @mask.
- * If no messages match, returns %NULL. Otherwise, returns an array of
- * CamelMessageInfo and sets *@set to a message set corresponding the
- * UIDs of the matched messages (up to @UID_SET_LIMIT bytes). The
- * caller must free the infos, the array, and the set string.
- */
-static GPtrArray *
-get_matching (CamelFolder *folder, guint32 flags, guint32 mask, char **set)
-{
- GPtrArray *matches;
- CamelMessageInfo *info;
- int i, max, range;
- GString *gset;
-
- matches = g_ptr_array_new ();
- gset = g_string_new ("");
- max = camel_folder_summary_count (folder->summary);
- range = -1;
- for (i = 0; i < max && !UID_SET_FULL (gset->len, UID_SET_LIMIT); i++) {
- info = camel_folder_summary_index (folder->summary, i);
- if (!info)
- continue;
- if ((info->flags & mask) != flags) {
- camel_folder_summary_info_free (folder->summary, info);
- if (range != -1) {
- if (range != i - 1) {
- info = matches->pdata[matches->len - 1];
- g_string_append_printf (gset, ":%s", camel_message_info_uid (info));
- }
- range = -1;
- }
- continue;
- }
-
- g_ptr_array_add (matches, info);
- if (range != -1)
- continue;
- range = i;
- if (gset->len)
- g_string_append_c (gset, ',');
- g_string_append_printf (gset, "%s", camel_message_info_uid (info));
- }
-
- if (range != -1 && range != max - 1) {
- info = matches->pdata[matches->len - 1];
- g_string_append_printf (gset, ":%s", camel_message_info_uid (info));
- }
-
- if (matches->len) {
- *set = gset->str;
- g_string_free (gset, FALSE);
- return matches;
- } else {
- *set = NULL;
- g_string_free (gset, TRUE);
- g_ptr_array_free (matches, TRUE);
- return NULL;
- }
-}
-
-static void
-imap_sync_offline (CamelFolder *folder, CamelException *ex)
-{
- camel_folder_summary_save (folder->summary);
-}
-
-static void
-imap_sync_online (CamelFolder *folder, CamelException *ex)
-{
- CamelImapStore *store = CAMEL_IMAP_STORE (folder->parent_store);
- CamelImapResponse *response = NULL;
- CamelMessageInfo *info;
- CamelException local_ex;
- GPtrArray *matches;
- char *set, *flaglist;
- gboolean unset;
- int i, j, max;
-
- camel_exception_init (&local_ex);
- CAMEL_SERVICE_LOCK (store, connect_lock);
-
- /* Find a message with changed flags, find all of the other
- * messages like it, sync them as a group, mark them as
- * updated, and continue.
- */
- max = camel_folder_summary_count (folder->summary);
- for (i = 0; i < max; i++) {
- info = camel_folder_summary_index (folder->summary, i);
- if (!info)
- continue;
- if (!(info->flags & CAMEL_MESSAGE_FOLDER_FLAGGED)) {
- camel_folder_summary_info_free (folder->summary, info);
- continue;
- }
-
- /* Note: Cyrus is broken and will not accept an
- empty-set of flags so... if this is true then we
- want to unset the previously set flags.*/
- unset = !(info->flags & CAMEL_IMAP_SERVER_FLAGS);
-
- /* Note: get_matching() uses UID_SET_LIMIT to limit
- the size of the uid-set string. We don't have to
- loop here to flush all the matching uids because
- they will be scooped up later by our parent loop (I
- think?). -- Jeff */
- matches = get_matching (folder, info->flags & (CAMEL_IMAP_SERVER_FLAGS | CAMEL_MESSAGE_FOLDER_FLAGGED),
- CAMEL_IMAP_SERVER_FLAGS | CAMEL_MESSAGE_FOLDER_FLAGGED, &set);
- camel_folder_summary_info_free (folder->summary, info);
- if (matches == NULL)
- continue;
-
- /* FIXME: since we don't know the previously set flags,
- if unset is TRUE then just unset all the flags? */
- flaglist = imap_create_flag_list (unset ? CAMEL_IMAP_SERVER_FLAGS : info->flags);
-
- /* Note: to `unset' flags, use -FLAGS.SILENT (<flag list>) */
- response = camel_imap_command (store, folder, &local_ex,
- "UID STORE %s %sFLAGS.SILENT %s",
- set, unset ? "-" : "", flaglist);
- g_free (set);
- g_free (flaglist);
-
- if (response)
- camel_imap_response_free (store, response);
-
- if (!camel_exception_is_set (&local_ex)) {
- for (j = 0; j < matches->len; j++) {
- info = matches->pdata[j];
- info->flags &= ~CAMEL_MESSAGE_FOLDER_FLAGGED;
- ((CamelImapMessageInfo*)info)->server_flags =
- info->flags & CAMEL_IMAP_SERVER_FLAGS;
- }
- camel_folder_summary_touch (folder->summary);
- }
-
- for (j = 0; j < matches->len; j++) {
- info = matches->pdata[j];
- camel_folder_summary_info_free (folder->summary, info);
- }
- g_ptr_array_free (matches, TRUE);
-
- /* We unlock here so that other threads can have a chance to grab the connect_lock */
- CAMEL_SERVICE_UNLOCK (store, connect_lock);
-
- /* check for an exception */
- if (camel_exception_is_set (&local_ex)) {
- camel_exception_xfer (ex, &local_ex);
- return;
- }
-
- /* Re-lock the connect_lock */
- CAMEL_SERVICE_LOCK (store, connect_lock);
- }
-
- /* Save the summary */
- imap_sync_offline (folder, ex);
-
- CAMEL_SERVICE_UNLOCK (store, connect_lock);
-}
-
-static int
-uid_compar (const void *va, const void *vb)
-{
- const char **sa = (const char **)va, **sb = (const char **)vb;
- unsigned long a, b;
-
- a = strtoul (*sa, NULL, 10);
- b = strtoul (*sb, NULL, 10);
- if (a < b)
- return -1;
- else if (a == b)
- return 0;
- else
- return 1;
-}
-
-static void
-imap_expunge_uids_offline (CamelFolder *folder, GPtrArray *uids, CamelException *ex)
-{
- CamelFolderChangeInfo *changes;
- int i;
-
- qsort (uids->pdata, uids->len, sizeof (void *), uid_compar);
-
- changes = camel_folder_change_info_new ();
-
- for (i = 0; i < uids->len; i++) {
- camel_folder_summary_remove_uid (folder->summary, uids->pdata[i]);
- camel_folder_change_info_remove_uid (changes, uids->pdata[i]);
- /* We intentionally don't remove it from the cache because
- * the cached data may be useful in replaying a COPY later.
- */
- }
- camel_folder_summary_save (folder->summary);
-
- camel_disco_diary_log (CAMEL_DISCO_STORE (folder->parent_store)->diary,
- CAMEL_DISCO_DIARY_FOLDER_EXPUNGE, folder, uids);
-
- camel_object_trigger_event (CAMEL_OBJECT (folder), "folder_changed", changes);
- camel_folder_change_info_free (changes);
-}
-
-static void
-imap_expunge_uids_online (CamelFolder *folder, GPtrArray *uids, CamelException *ex)
-{
- CamelImapStore *store = CAMEL_IMAP_STORE (folder->parent_store);
- CamelImapResponse *response;
- int uid = 0;
- char *set;
-
- CAMEL_SERVICE_LOCK (store, connect_lock);
-
- if ((store->capabilities & IMAP_CAPABILITY_UIDPLUS) == 0) {
- ((CamelFolderClass *)CAMEL_OBJECT_GET_CLASS(folder))->sync(folder, 0, ex);
- if (camel_exception_is_set(ex)) {
- CAMEL_SERVICE_UNLOCK (store, connect_lock);
- return;
- }
- }
-
- qsort (uids->pdata, uids->len, sizeof (void *), uid_compar);
-
- while (uid < uids->len) {
- set = imap_uid_array_to_set (folder->summary, uids, uid, UID_SET_LIMIT, &uid);
- response = camel_imap_command (store, folder, ex,
- "UID STORE %s +FLAGS.SILENT \\Deleted",
- set);
- if (response)
- camel_imap_response_free (store, response);
- if (camel_exception_is_set (ex)) {
- CAMEL_SERVICE_UNLOCK (store, connect_lock);
- g_free (set);
- return;
- }
-
- if (store->capabilities & IMAP_CAPABILITY_UIDPLUS) {
- response = camel_imap_command (store, folder, ex,
- "UID EXPUNGE %s", set);
- } else
- response = camel_imap_command (store, folder, ex, "EXPUNGE");
-
- if (response)
- camel_imap_response_free (store, response);
- }
-
- CAMEL_SERVICE_UNLOCK (store, connect_lock);
-}
-
-static void
-imap_expunge_uids_resyncing (CamelFolder *folder, GPtrArray *uids, CamelException *ex)
-{
- CamelImapStore *store = CAMEL_IMAP_STORE (folder->parent_store);
- GPtrArray *keep_uids, *mark_uids;
- CamelImapResponse *response;
- char *result;
-
- if (store->capabilities & IMAP_CAPABILITY_UIDPLUS) {
- imap_expunge_uids_online (folder, uids, ex);
- return;
- }
-
- /* If we don't have UID EXPUNGE we need to avoid expunging any
- * of the wrong messages. So we search for deleted messages,
- * and any that aren't in our to-expunge list get temporarily
- * marked un-deleted.
- */
-
- CAMEL_SERVICE_LOCK (store, connect_lock);
-
- ((CamelFolderClass *)CAMEL_OBJECT_GET_CLASS(folder))->sync(folder, 0, ex);
- if (camel_exception_is_set(ex)) {
- CAMEL_SERVICE_UNLOCK (store, connect_lock);
- return;
- }
-
- response = camel_imap_command (store, folder, ex, "UID SEARCH DELETED");
- if (!response) {
- CAMEL_SERVICE_UNLOCK (store, connect_lock);
- return;
- }
- result = camel_imap_response_extract (store, response, "SEARCH", ex);
- if (!result) {
- CAMEL_SERVICE_UNLOCK (store, connect_lock);
- return;
- }
-
- if (result[8] == ' ') {
- char *uid, *lasts = NULL;
- unsigned long euid, kuid;
- int ei, ki;
-
- keep_uids = g_ptr_array_new ();
- mark_uids = g_ptr_array_new ();
-
- /* Parse SEARCH response */
- for (uid = strtok_r (result + 9, " ", &lasts); uid; uid = strtok_r (NULL, " ", &lasts))
- g_ptr_array_add (keep_uids, uid);
- qsort (keep_uids->pdata, keep_uids->len,
- sizeof (void *), uid_compar);
-
- /* Fill in "mark_uids", empty out "keep_uids" as needed */
- for (ei = ki = 0; ei < uids->len; ei++) {
- euid = strtoul (uids->pdata[ei], NULL, 10);
-
- for (kuid = 0; ki < keep_uids->len; ki++) {
- kuid = strtoul (keep_uids->pdata[ki], NULL, 10);
-
- if (kuid >= euid)
- break;
- }
-
- if (euid == kuid)
- g_ptr_array_remove_index (keep_uids, ki);
- else
- g_ptr_array_add (mark_uids, uids->pdata[ei]);
- }
- } else {
- /* Empty SEARCH result, meaning nothing is marked deleted
- * on server.
- */
-
- keep_uids = NULL;
- mark_uids = uids;
- }
-
- /* Unmark messages to be kept */
-
- if (keep_uids) {
- char *uidset;
- int uid = 0;
-
- while (uid < keep_uids->len) {
- uidset = imap_uid_array_to_set (folder->summary, keep_uids, uid, UID_SET_LIMIT, &uid);
-
- response = camel_imap_command (store, folder, ex,
- "UID STORE %s -FLAGS.SILENT \\Deleted",
- uidset);
-
- g_free (uidset);
-
- if (!response) {
- g_ptr_array_free (keep_uids, TRUE);
- g_ptr_array_free (mark_uids, TRUE);
- CAMEL_SERVICE_UNLOCK (store, connect_lock);
- return;
- }
- camel_imap_response_free (store, response);
- }
- }
-
- /* Mark any messages that still need to be marked */
- if (mark_uids) {
- char *uidset;
- int uid = 0;
-
- while (uid < mark_uids->len) {
- uidset = imap_uid_array_to_set (folder->summary, mark_uids, uid, UID_SET_LIMIT, &uid);
-
- response = camel_imap_command (store, folder, ex,
- "UID STORE %s +FLAGS.SILENT \\Deleted",
- uidset);
-
- g_free (uidset);
-
- if (!response) {
- g_ptr_array_free (keep_uids, TRUE);
- g_ptr_array_free (mark_uids, TRUE);
- CAMEL_SERVICE_UNLOCK (store, connect_lock);
- return;
- }
- camel_imap_response_free (store, response);
- }
-
- if (mark_uids != uids)
- g_ptr_array_free (mark_uids, TRUE);
- }
-
- /* Do the actual expunging */
- response = camel_imap_command (store, folder, ex, "EXPUNGE");
- if (response)
- camel_imap_response_free (store, response);
-
- /* And fix the remaining messages if we mangled them */
- if (keep_uids) {
- char *uidset;
- int uid = 0;
-
- while (uid < keep_uids->len) {
- uidset = imap_uid_array_to_set (folder->summary, keep_uids, uid, UID_SET_LIMIT, &uid);
-
- /* Don't pass ex if it's already been set */
- response = camel_imap_command (store, folder,
- camel_exception_is_set (ex) ? NULL : ex,
- "UID STORE %s +FLAGS.SILENT \\Deleted",
- uidset);
-
- g_free (uidset);
- if (response)
- camel_imap_response_free (store, response);
- }
-
- g_ptr_array_free (keep_uids, TRUE);
- }
-
- /* now we can free this, now that we're done with keep_uids */
- g_free (result);
-
- CAMEL_SERVICE_UNLOCK (store, connect_lock);
-}
-
-static gchar *
-get_temp_uid (void)
-{
- gchar *res;
-
- static int counter = 0;
- G_LOCK_DEFINE_STATIC (lock);
-
- G_LOCK (lock);
- res = g_strdup_printf ("tempuid-%lx-%d",
- (unsigned long) time (NULL),
- counter++);
- G_UNLOCK (lock);
-
- return res;
-}
-
-static void
-imap_append_offline (CamelFolder *folder, CamelMimeMessage *message,
- const CamelMessageInfo *info, char **appended_uid,
- CamelException *ex)
-{
- CamelImapStore *imap_store = CAMEL_IMAP_STORE (folder->parent_store);
- CamelImapMessageCache *cache = CAMEL_IMAP_FOLDER (folder)->cache;
- CamelFolderChangeInfo *changes;
- char *uid;
-
- uid = get_temp_uid ();
-
- camel_imap_summary_add_offline (folder->summary, uid, message, info);
- CAMEL_IMAP_FOLDER_LOCK (folder, cache_lock);
- camel_imap_message_cache_insert_wrapper (cache, uid, "",
- CAMEL_DATA_WRAPPER (message), ex);
- CAMEL_IMAP_FOLDER_UNLOCK (folder, cache_lock);
-
- changes = camel_folder_change_info_new ();
- camel_folder_change_info_add_uid (changes, uid);
- camel_object_trigger_event (CAMEL_OBJECT (folder), "folder_changed",
- changes);
- camel_folder_change_info_free (changes);
-
- camel_disco_diary_log (CAMEL_DISCO_STORE (imap_store)->diary,
- CAMEL_DISCO_DIARY_FOLDER_APPEND, folder, uid);
- if (appended_uid)
- *appended_uid = uid;
- else
- g_free (uid);
-}
-
-static CamelImapResponse *
-do_append (CamelFolder *folder, CamelMimeMessage *message,
- const CamelMessageInfo *info, char **uid,
- CamelException *ex)
-{
- CamelImapStore *store = CAMEL_IMAP_STORE (folder->parent_store);
- CamelImapResponse *response, *response2;
- CamelStream *memstream;
- CamelMimeFilter *crlf_filter;
- CamelStreamFilter *streamfilter;
- GByteArray *ba;
- char *flagstr, *end;
-
- /* create flag string param */
- if (info && info->flags)
- flagstr = imap_create_flag_list (info->flags);
- else
- flagstr = NULL;
-
- /* encode any 8bit parts so we avoid sending embedded nul-chars and such */
- camel_mime_message_encode_8bit_parts (message);
-
- /* FIXME: We could avoid this if we knew how big the message was. */
- memstream = camel_stream_mem_new ();
- ba = g_byte_array_new ();
- camel_stream_mem_set_byte_array (CAMEL_STREAM_MEM (memstream), ba);
-
- streamfilter = camel_stream_filter_new_with_stream (memstream);
- crlf_filter = camel_mime_filter_crlf_new (CAMEL_MIME_FILTER_CRLF_ENCODE,
- CAMEL_MIME_FILTER_CRLF_MODE_CRLF_ONLY);
- camel_stream_filter_add (streamfilter, crlf_filter);
- camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (message),
- CAMEL_STREAM (streamfilter));
- camel_object_unref (CAMEL_OBJECT (streamfilter));
- camel_object_unref (CAMEL_OBJECT (crlf_filter));
- camel_object_unref (CAMEL_OBJECT (memstream));
-
- response = camel_imap_command (store, NULL, ex, "APPEND %F%s%s {%d}",
- folder->full_name, flagstr ? " " : "",
- flagstr ? flagstr : "", ba->len);
- g_free (flagstr);
-
- if (!response) {
- g_byte_array_free (ba, TRUE);
- return NULL;
- }
-
- if (*response->status != '+') {
- camel_imap_response_free (store, response);
- g_byte_array_free (ba, TRUE);
- return NULL;
- }
-
- /* send the rest of our data - the mime message */
- response2 = camel_imap_command_continuation (store, ba->data, ba->len, ex);
- g_byte_array_free (ba, TRUE);
-
- /* free it only after message is sent. This may cause more FETCHes. */
- camel_imap_response_free (store, response);
- if (!response2)
- return response2;
-
- if (store->capabilities & IMAP_CAPABILITY_UIDPLUS) {
- *uid = camel_strstrcase (response2->status, "[APPENDUID ");
- if (*uid)
- *uid = strchr (*uid + 11, ' ');
- if (*uid) {
- *uid = g_strndup (*uid + 1, strcspn (*uid + 1, "]"));
- /* Make sure it's a number */
- if (strtoul (*uid, &end, 10) == 0 || *end) {
- g_free (*uid);
- *uid = NULL;
- }
- }
- } else
- *uid = NULL;
-
- return response2;
-}
-
-static void
-imap_append_online (CamelFolder *folder, CamelMimeMessage *message,
- const CamelMessageInfo *info, char **appended_uid,
- CamelException *ex)
-{
- CamelImapStore *store = CAMEL_IMAP_STORE (folder->parent_store);
- CamelImapResponse *response;
- char *uid;
- int count;
-
- count = camel_folder_summary_count (folder->summary);
- response = do_append (folder, message, info, &uid, ex);
- if (!response)
- return;
-
- if (uid) {
- /* Cache first, since freeing response may trigger a
- * summary update that will want this information.
- */
- CAMEL_IMAP_FOLDER_LOCK (folder, cache_lock);
- camel_imap_message_cache_insert_wrapper (
- CAMEL_IMAP_FOLDER (folder)->cache, uid,
- "", CAMEL_DATA_WRAPPER (message), ex);
- CAMEL_IMAP_FOLDER_UNLOCK (folder, cache_lock);
- if (appended_uid)
- *appended_uid = uid;
- else
- g_free (uid);
- } else if (appended_uid)
- *appended_uid = NULL;
-
- camel_imap_response_free (store, response);
-
- /* Make sure a "folder_changed" is emitted. */
- CAMEL_SERVICE_LOCK (store, connect_lock);
- if (store->current_folder != folder ||
- camel_folder_summary_count (folder->summary) == count)
- imap_refresh_info (folder, ex);
- CAMEL_SERVICE_UNLOCK (store, connect_lock);
-}
-
-static void
-imap_append_resyncing (CamelFolder *folder, CamelMimeMessage *message,
- const CamelMessageInfo *info, char **appended_uid,
- CamelException *ex)
-{
- CamelImapStore *store = CAMEL_IMAP_STORE (folder->parent_store);
- CamelImapResponse *response;
- char *uid;
-
- response = do_append (folder, message, info, &uid, ex);
- if (!response)
- return;
-
- if (uid) {
- CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (folder);
- const char *olduid = camel_message_info_uid (info);
-
- CAMEL_IMAP_FOLDER_LOCK (imap_folder, cache_lock);
- camel_imap_message_cache_copy (imap_folder->cache, olduid,
- imap_folder->cache, uid, ex);
- CAMEL_IMAP_FOLDER_UNLOCK (imap_folder, cache_lock);
-
- if (appended_uid)
- *appended_uid = uid;
- else
- g_free (uid);
- } else if (appended_uid)
- *appended_uid = NULL;
-
- camel_imap_response_free (store, response);
-}
-
-
-static void
-imap_transfer_offline (CamelFolder *source, GPtrArray *uids,
- CamelFolder *dest, GPtrArray **transferred_uids,
- gboolean delete_originals, CamelException *ex)
-{
- CamelImapStore *store = CAMEL_IMAP_STORE (source->parent_store);
- CamelImapMessageCache *sc = CAMEL_IMAP_FOLDER (source)->cache;
- CamelImapMessageCache *dc = CAMEL_IMAP_FOLDER (dest)->cache;
- CamelFolderChangeInfo *changes;
- CamelMimeMessage *message;
- CamelMessageInfo *mi;
- char *uid, *destuid;
- int i;
-
- /* We grab the store's command lock first, and then grab the
- * source and destination cache_locks. This way we can't
- * deadlock in the case where we're simultaneously also trying
- * to copy messages in the other direction from another thread.
- */
- CAMEL_SERVICE_LOCK (store, connect_lock);
- CAMEL_IMAP_FOLDER_LOCK (source, cache_lock);
- CAMEL_IMAP_FOLDER_LOCK (dest, cache_lock);
- CAMEL_SERVICE_UNLOCK (store, connect_lock);
-
- if (transferred_uids) {
- *transferred_uids = g_ptr_array_new ();
- g_ptr_array_set_size (*transferred_uids, uids->len);
- }
-
- changes = camel_folder_change_info_new ();
-
- for (i = 0; i < uids->len; i++) {
- uid = uids->pdata[i];
-
- destuid = get_temp_uid ();
-
- mi = camel_folder_summary_uid (source->summary, uid);
- g_return_if_fail (mi != NULL);
-
- message = camel_folder_get_message (source, uid, NULL);
-
- if (message) {
- camel_imap_summary_add_offline (dest->summary, destuid, message, mi);
- camel_object_unref (CAMEL_OBJECT (message));
- } else
- camel_imap_summary_add_offline_uncached (dest->summary, destuid, mi);
-
- camel_imap_message_cache_copy (sc, uid, dc, destuid, ex);
- camel_folder_summary_info_free (source->summary, mi);
-
- camel_folder_change_info_add_uid (changes, destuid);
- if (transferred_uids)
- (*transferred_uids)->pdata[i] = destuid;
- else
- g_free (destuid);
-
- if (delete_originals)
- camel_folder_delete_message (source, uid);
- }
-
- CAMEL_IMAP_FOLDER_UNLOCK (dest, cache_lock);
- CAMEL_IMAP_FOLDER_UNLOCK (source, cache_lock);
-
- camel_object_trigger_event (CAMEL_OBJECT (dest), "folder_changed", changes);
- camel_folder_change_info_free (changes);
-
- camel_disco_diary_log (CAMEL_DISCO_STORE (store)->diary,
- CAMEL_DISCO_DIARY_FOLDER_TRANSFER,
- source, dest, uids, delete_originals);
-}
-
-static void
-handle_copyuid (CamelImapResponse *response, CamelFolder *source,
- CamelFolder *destination)
-{
- CamelImapMessageCache *scache = CAMEL_IMAP_FOLDER (source)->cache;
- CamelImapMessageCache *dcache = CAMEL_IMAP_FOLDER (destination)->cache;
- char *validity, *srcset, *destset;
- GPtrArray *src, *dest;
- int i;
-
- validity = camel_strstrcase (response->status, "[COPYUID ");
- if (!validity)
- return;
- validity += 9;
- if (strtoul (validity, NULL, 10) !=
- CAMEL_IMAP_SUMMARY (destination->summary)->validity)
- return;
-
- srcset = strchr (validity, ' ');
- if (!srcset++)
- goto lose;
- destset = strchr (srcset, ' ');
- if (!destset++)
- goto lose;
-
- src = imap_uid_set_to_array (source->summary, srcset);
- dest = imap_uid_set_to_array (destination->summary, destset);
-
- if (src && dest && src->len == dest->len) {
- /* We don't have to worry about deadlocking on the
- * cache locks here, because we've got the store's
- * command lock too, so no one else could be here.
- */
- CAMEL_IMAP_FOLDER_LOCK (source, cache_lock);
- CAMEL_IMAP_FOLDER_LOCK (destination, cache_lock);
- for (i = 0; i < src->len; i++) {
- camel_imap_message_cache_copy (scache, src->pdata[i],
- dcache, dest->pdata[i],
- NULL);
- }
- CAMEL_IMAP_FOLDER_UNLOCK (source, cache_lock);
- CAMEL_IMAP_FOLDER_UNLOCK (destination, cache_lock);
-
- imap_uid_array_free (src);
- imap_uid_array_free (dest);
- return;
- }
-
- imap_uid_array_free (src);
- imap_uid_array_free (dest);
- lose:
- g_warning ("Bad COPYUID response from server");
-}
-
-static void
-do_copy (CamelFolder *source, GPtrArray *uids,
- CamelFolder *destination, CamelException *ex)
-{
- CamelImapStore *store = CAMEL_IMAP_STORE (source->parent_store);
- CamelImapResponse *response;
- char *uidset;
- int uid = 0;
-
- while (uid < uids->len && !camel_exception_is_set (ex)) {
- uidset = imap_uid_array_to_set (source->summary, uids, uid, UID_SET_LIMIT, &uid);
-
- response = camel_imap_command (store, source, ex, "UID COPY %s %F",
- uidset, destination->full_name);
-
- g_free (uidset);
-
- if (response && (store->capabilities & IMAP_CAPABILITY_UIDPLUS))
- handle_copyuid (response, source, destination);
-
- camel_imap_response_free (store, response);
- }
-}
-
-static void
-imap_transfer_online (CamelFolder *source, GPtrArray *uids,
- CamelFolder *dest, GPtrArray **transferred_uids,
- gboolean delete_originals, CamelException *ex)
-{
- CamelImapStore *store = CAMEL_IMAP_STORE (source->parent_store);
- int count, i;
-
- /* Sync message flags if needed. */
- imap_sync_online (source, ex);
- if (camel_exception_is_set (ex))
- return;
-
- count = camel_folder_summary_count (dest->summary);
-
- qsort (uids->pdata, uids->len, sizeof (void *), uid_compar);
-
- /* Now copy the messages */
- do_copy (source, uids, dest, ex);
- if (camel_exception_is_set (ex))
- return;
-
- /* Make the destination notice its new messages */
- CAMEL_SERVICE_LOCK (store, connect_lock);
- if (store->current_folder != dest ||
- camel_folder_summary_count (dest->summary) == count)
- camel_folder_refresh_info (dest, ex);
- CAMEL_SERVICE_UNLOCK (store, connect_lock);
-
- if (delete_originals) {
- for (i = 0; i < uids->len; i++)
- camel_folder_delete_message (source, uids->pdata[i]);
- }
-
- /* FIXME */
- if (transferred_uids)
- *transferred_uids = NULL;
-}
-
-static void
-imap_transfer_resyncing (CamelFolder *source, GPtrArray *uids,
- CamelFolder *dest, GPtrArray **transferred_uids,
- gboolean delete_originals, CamelException *ex)
-{
- CamelDiscoDiary *diary = CAMEL_DISCO_STORE (source->parent_store)->diary;
- GPtrArray *realuids;
- int first, i;
- const char *uid;
- CamelMimeMessage *message;
- CamelMessageInfo *info;
-
- qsort (uids->pdata, uids->len, sizeof (void *), uid_compar);
-
- /* This is trickier than append_resyncing, because some of
- * the messages we are copying may have been copied or
- * appended into @source while we were offline, in which case
- * if we don't have UIDPLUS, we won't know their real UIDs,
- * so we'll have to append them rather than copying.
- */
-
- realuids = g_ptr_array_new ();
-
- i = 0;
- while (i < uids->len) {
- /* Skip past real UIDs */
- for (first = i; i < uids->len; i++) {
- uid = uids->pdata[i];
-
- if (!isdigit ((unsigned char)*uid)) {
- uid = camel_disco_diary_uidmap_lookup (diary, uid);
- if (!uid)
- break;
- }
- g_ptr_array_add (realuids, (char *)uid);
-
- if (delete_originals)
- camel_folder_delete_message (source, uid);
- }
-
- /* If we saw any real UIDs, do a COPY */
- if (i != first) {
- do_copy (source, realuids, dest, ex);
- g_ptr_array_set_size (realuids, 0);
- if (i == uids->len || camel_exception_is_set (ex))
- break;
- }
-
- /* Deal with fake UIDs */
- while (i < uids->len &&
- !isdigit (*(unsigned char *)(uids->pdata[i])) &&
- !camel_exception_is_set (ex)) {
- uid = uids->pdata[i];
- message = camel_folder_get_message (source, uid, NULL);
- if (!message) {
- /* Message must have been expunged */
- continue;
- }
- info = camel_folder_get_message_info (source, uid);
- g_return_if_fail (info != NULL);
-
- imap_append_online (dest, message, info, NULL, ex);
- camel_folder_free_message_info (source, info);
- camel_object_unref (CAMEL_OBJECT (message));
- if (delete_originals)
- camel_folder_delete_message (source, uid);
- i++;
- }
- }
-
- g_ptr_array_free (realuids, FALSE);
-
- /* FIXME */
- if (transferred_uids)
- *transferred_uids = NULL;
-}
-
-static GPtrArray *
-imap_search_by_expression (CamelFolder *folder, const char *expression, CamelException *ex)
-{
- CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (folder);
- GPtrArray *matches, *summary;
-
- /* we could get around this by creating a new search object each time,
- but i doubt its worth it since any long operation would lock the
- command channel too */
- CAMEL_IMAP_FOLDER_LOCK(folder, search_lock);
-
- camel_folder_search_set_folder (imap_folder->search, folder);
- summary = camel_folder_get_summary(folder);
- camel_folder_search_set_summary(imap_folder->search, summary);
- matches = camel_folder_search_execute_expression (imap_folder->search, expression, ex);
-
- CAMEL_IMAP_FOLDER_UNLOCK(folder, search_lock);
-
- camel_folder_free_summary(folder, summary);
-
- return matches;
-}
-
-static GPtrArray *
-imap_search_by_uids(CamelFolder *folder, const char *expression, GPtrArray *uids, CamelException *ex)
-{
- CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER(folder);
- GPtrArray *summary, *matches;
- int i;
-
- /* NOTE: could get away without the search lock by creating a new
- search object each time */
-
- qsort (uids->pdata, uids->len, sizeof (void *), uid_compar);
-
- summary = g_ptr_array_new();
- for (i=0;i<uids->len;i++) {
- CamelMessageInfo *info;
-
- info = camel_folder_get_message_info(folder, uids->pdata[i]);
- if (info)
- g_ptr_array_add(summary, info);
- }
-
- if (summary->len == 0)
- return summary;
-
- CAMEL_IMAP_FOLDER_LOCK(folder, search_lock);
-
- camel_folder_search_set_folder(imap_folder->search, folder);
- camel_folder_search_set_summary(imap_folder->search, summary);
-
- matches = camel_folder_search_execute_expression(imap_folder->search, expression, ex);
-
- CAMEL_IMAP_FOLDER_UNLOCK(folder, search_lock);
-
- for (i=0;i<summary->len;i++)
- camel_folder_free_message_info(folder, summary->pdata[i]);
- g_ptr_array_free(summary, TRUE);
-
- return matches;
-}
-
-static void
-imap_search_free (CamelFolder *folder, GPtrArray *uids)
-{
- CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (folder);
-
- g_return_if_fail (imap_folder->search);
-
- CAMEL_IMAP_FOLDER_LOCK(folder, search_lock);
-
- camel_folder_search_free_result (imap_folder->search, uids);
-
- CAMEL_IMAP_FOLDER_UNLOCK(folder, search_lock);
-}
-
-static CamelMimeMessage *get_message (CamelImapFolder *imap_folder,
- const char *uid,
- const char *part_specifier,
- CamelMessageContentInfo *ci,
- CamelException *ex);
-
-struct _part_spec_stack {
- struct _part_spec_stack *parent;
- int part;
-};
-
-static void
-part_spec_push (struct _part_spec_stack **stack, int part)
-{
- struct _part_spec_stack *node;
-
- node = g_new (struct _part_spec_stack, 1);
- node->parent = *stack;
- node->part = part;
-
- *stack = node;
-}
-
-static int
-part_spec_pop (struct _part_spec_stack **stack)
-{
- struct _part_spec_stack *node;
- int part;
-
- g_return_val_if_fail (*stack != NULL, 0);
-
- node = *stack;
- *stack = node->parent;
-
- part = node->part;
- g_free (node);
-
- return part;
-}
-
-static char *
-content_info_get_part_spec (CamelMessageContentInfo *ci)
-{
- struct _part_spec_stack *stack = NULL;
- CamelMessageContentInfo *node;
- char *part_spec, *buf;
- size_t len = 1;
- int part;
-
- node = ci;
- while (node->parent) {
- CamelMessageContentInfo *child;
-
- /* FIXME: is this only supposed to apply if 'node' is a multipart? */
- if (node->parent->parent && camel_content_type_is (node->parent->type, "message", "*")) {
- node = node->parent;
- continue;
- }
-
- child = node->parent->childs;
- for (part = 1; child; part++) {
- if (child == node)
- break;
-
- child = child->next;
- }
-
- part_spec_push (&stack, part);
-
- len += 2;
- while ((part = part / 10))
- len++;
-
- node = node->parent;
- }
-
- buf = part_spec = g_malloc (len);
- part_spec[0] = '\0';
-
- while (stack) {
- part = part_spec_pop (&stack);
- buf += sprintf (buf, "%d%s", part, stack ? "." : "");
- }
-
- return part_spec;
-}
-
-/* Fetch the contents of the MIME part indicated by @ci, which is part
- * of message @uid in @folder.
- */
-static CamelDataWrapper *
-get_content (CamelImapFolder *imap_folder, const char *uid,
- CamelMimePart *part, CamelMessageContentInfo *ci,
- CamelException *ex)
-{
- CamelDataWrapper *content = NULL;
- CamelStream *stream;
- char *part_spec;
-
- part_spec = content_info_get_part_spec (ci);
-
- /* There are three cases: multipart/signed, multipart, message/rfc822, and "other" */
- if (camel_content_type_is (ci->type, "multipart", "signed")) {
- CamelMultipartSigned *body_mp;
- char *spec;
- int ret;
-
- /* Note: because we get the content parts uninterpreted anyway, we could potentially
- just use the normalmultipart code, except that multipart/signed wont let you yet! */
-
- body_mp = camel_multipart_signed_new ();
- /* need to set this so it grabs the boundary and other info about the signed type */
- /* we assume that part->content_type is more accurate/full than ci->type */
- camel_data_wrapper_set_mime_type_field (CAMEL_DATA_WRAPPER (body_mp), CAMEL_DATA_WRAPPER (part)->mime_type);
-
- spec = g_alloca (strlen (part_spec) + 6);
- sprintf (spec, part_spec[0] ? "%s.TEXT" : "TEXT", part_spec);
- g_free (part_spec);
-
- stream = camel_imap_folder_fetch_data (imap_folder, uid, spec, FALSE, ex);
- if (stream) {
- ret = camel_data_wrapper_construct_from_stream (CAMEL_DATA_WRAPPER (body_mp), stream);
- camel_object_unref (CAMEL_OBJECT (stream));
- if (ret == -1) {
- camel_object_unref ((CamelObject *) body_mp);
- return NULL;
- }
- }
-
- return (CamelDataWrapper *) body_mp;
- } else if (camel_content_type_is (ci->type, "multipart", "*")) {
- CamelMultipart *body_mp;
- char *child_spec;
- int speclen, num;
-
- if (camel_content_type_is (ci->type, "multipart", "encrypted"))
- body_mp = (CamelMultipart *) camel_multipart_encrypted_new ();
- else
- body_mp = camel_multipart_new ();
-
- /* need to set this so it grabs the boundary and other info about the multipart */
- /* we assume that part->content_type is more accurate/full than ci->type */
- camel_data_wrapper_set_mime_type_field (CAMEL_DATA_WRAPPER (body_mp), CAMEL_DATA_WRAPPER (part)->mime_type);
-
- speclen = strlen (part_spec);
- child_spec = g_malloc (speclen + 17); /* dot + 10 + dot + MIME + nul */
- memcpy (child_spec, part_spec, speclen);
- if (speclen > 0)
- child_spec[speclen++] = '.';
- g_free (part_spec);
-
- ci = ci->childs;
- num = 1;
- while (ci) {
- sprintf (child_spec + speclen, "%d.MIME", num++);
- stream = camel_imap_folder_fetch_data (imap_folder, uid, child_spec, FALSE, ex);
- if (stream) {
- int ret;
-
- part = camel_mime_part_new ();
- ret = camel_data_wrapper_construct_from_stream (CAMEL_DATA_WRAPPER (part), stream);
- camel_object_unref (CAMEL_OBJECT (stream));
- if (ret == -1) {
- camel_object_unref (CAMEL_OBJECT (part));
- camel_object_unref (CAMEL_OBJECT (body_mp));
- g_free (child_spec);
- return NULL;
- }
-
- content = get_content (imap_folder, uid, part, ci, ex);
- }
-
- if (!stream || !content) {
- camel_object_unref (CAMEL_OBJECT (body_mp));
- g_free (child_spec);
- return NULL;
- }
-
- camel_medium_set_content_object (CAMEL_MEDIUM (part), content);
- camel_object_unref (CAMEL_OBJECT (content));
- camel_multipart_add_part (body_mp, part);
- camel_object_unref (CAMEL_OBJECT (part));
-
- ci = ci->next;
- }
-
- g_free (child_spec);
-
- return (CamelDataWrapper *) body_mp;
- } else if (camel_content_type_is (ci->type, "message", "rfc822")) {
- content = (CamelDataWrapper *) get_message (imap_folder, uid, part_spec, ci->childs, ex);
- g_free (part_spec);
- return content;
- } else {
- content = camel_imap_wrapper_new (imap_folder, ci->type, uid, *part_spec ? part_spec : "1", part);
- g_free (part_spec);
- return content;
- }
-}
-
-static CamelMimeMessage *
-get_message (CamelImapFolder *imap_folder, const char *uid,
- const char *part_spec, CamelMessageContentInfo *ci,
- CamelException *ex)
-{
- CamelImapStore *store = CAMEL_IMAP_STORE (CAMEL_FOLDER (imap_folder)->parent_store);
- CamelDataWrapper *content;
- CamelMimeMessage *msg;
- CamelStream *stream;
- char *section_text;
- int ret;
-
- section_text = g_strdup_printf ("%s%s%s", part_spec, *part_spec ? "." : "",
- store->server_level >= IMAP_LEVEL_IMAP4REV1 ? "HEADER" : "0");
- stream = camel_imap_folder_fetch_data (imap_folder, uid, section_text, FALSE, ex);
- g_free (section_text);
- if (!stream)
- return NULL;
-
- msg = camel_mime_message_new ();
- ret = camel_data_wrapper_construct_from_stream (CAMEL_DATA_WRAPPER (msg), stream);
- camel_object_unref (CAMEL_OBJECT (stream));
- if (ret == -1) {
- camel_object_unref (CAMEL_OBJECT (msg));
- return NULL;
- }
-
- content = get_content (imap_folder, uid, CAMEL_MIME_PART (msg), ci, ex);
- if (!content) {
- camel_object_unref (CAMEL_OBJECT (msg));
- return NULL;
- }
-
- camel_medium_set_content_object (CAMEL_MEDIUM (msg), content);
- camel_object_unref (CAMEL_OBJECT (content));
-
- return msg;
-}
-
-/* FIXME: I pulled this number out of my butt. */
-#define IMAP_SMALL_BODY_SIZE 5120
-
-static CamelMimeMessage *
-get_message_simple (CamelImapFolder *imap_folder, const char *uid,
- CamelStream *stream, CamelException *ex)
-{
- CamelMimeMessage *msg;
- CamelImapStore *imap_store =
- CAMEL_IMAP_STORE (CAMEL_FOLDER (imap_folder)->parent_store);
- int ret;
-
- if (!stream) {
- stream = camel_imap_folder_fetch_data (imap_folder, uid, "",
- FALSE, ex);
- if (!stream)
- return NULL;
- }
-
- msg = camel_mime_message_new ();
- ret = camel_data_wrapper_construct_from_stream (CAMEL_DATA_WRAPPER (msg),
- stream);
- camel_object_unref (CAMEL_OBJECT (stream));
- if (ret == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
- _("Unable to retrieve message: %s"),
- g_strerror (errno));
- camel_object_unref (CAMEL_OBJECT (msg));
- return NULL;
- }
-
- /* FIXME, this shouldn't be done this way. */
- camel_medium_set_header (CAMEL_MEDIUM (msg), "X-Evolution-Source",
- imap_store->base_url);
- return msg;
-}
-
-static CamelMimeMessage *
-imap_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
-{
- CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (folder);
- CamelImapStore *store = CAMEL_IMAP_STORE (folder->parent_store);
- CamelMessageInfo *mi;
- CamelMimeMessage *msg;
- CamelStream *stream = NULL;
-
- /* If the server doesn't support IMAP4rev1, or we already have
- * the whole thing cached, fetch it in one piece.
- */
- if (store->server_level < IMAP_LEVEL_IMAP4REV1 ||
- (stream = camel_imap_folder_fetch_data (imap_folder, uid, "", TRUE, NULL)))
- return get_message_simple (imap_folder, uid, stream, ex);
-
- /* If we're not actually connected and it's not in the cache,
- * that's as far as we can go.
- */
- if (camel_disco_store_check_online (CAMEL_DISCO_STORE (store), ex) == FALSE)
- return NULL;
-
- mi = camel_folder_summary_uid (folder->summary, uid);
- if (mi == NULL) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_FOLDER_INVALID_UID,
- _("Cannot get message: %s\n %s"), uid, _("No such message"));
- return NULL;
- }
-
- /* If the message is small, fetch it in one piece. */
- if (mi->size < IMAP_SMALL_BODY_SIZE) {
- camel_folder_summary_info_free (folder->summary, mi);
- return get_message_simple (imap_folder, uid, NULL, ex);
- }
-
- /* For larger messages, fetch the structure and build a message
- * with offline parts. (We check mi->content->type rather than
- * mi->content because camel_folder_summary_info_new always creates
- * an empty content struct.)
- */
- if (!mi->content->type) {
- CamelImapResponse *response;
- GData *fetch_data = NULL;
- char *body, *found_uid;
- int i;
-
- if (camel_disco_store_status (CAMEL_DISCO_STORE (store)) == CAMEL_DISCO_STORE_OFFLINE) {
- camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
- _("This message is not currently available"));
- return NULL;
- }
-
- response = camel_imap_command (store, folder, ex,
- "UID FETCH %s BODY", uid);
- if (!response) {
- camel_folder_summary_info_free (folder->summary, mi);
- return NULL;
- }
-
- for (i = 0, body = NULL; i < response->untagged->len; i++) {
- fetch_data = parse_fetch_response (imap_folder, response->untagged->pdata[i]);
- if (fetch_data) {
- found_uid = g_datalist_get_data (&fetch_data, "UID");
- body = g_datalist_get_data (&fetch_data, "BODY");
- if (found_uid && body && !strcmp (found_uid, uid))
- break;
- g_datalist_clear (&fetch_data);
- fetch_data = NULL;
- body = NULL;
- }
- }
-
- if (body)
- imap_parse_body ((const char **) &body, folder, mi->content);
-
- if (fetch_data)
- g_datalist_clear (&fetch_data);
-
- camel_imap_response_free (store, response);
-
- if (!mi->content->type) {
- /* FETCH returned OK, but we didn't parse a BODY
- * response. Courier will return invalid BODY
- * responses for invalidly MIMEd messages, so
- * fall back to fetching the entire thing and
- * let the mailer's "bad MIME" code handle it.
- */
- camel_folder_summary_info_free (folder->summary, mi);
- return get_message_simple (imap_folder, uid, NULL, ex);
- }
- }
-
- msg = get_message (imap_folder, uid, "", mi->content, ex);
- /* FIXME, this shouldn't be done this way. */
- camel_medium_set_header (CAMEL_MEDIUM (msg), "X-Evolution-Source",
- store->base_url);
- camel_folder_summary_info_free (folder->summary, mi);
-
- return msg;
-}
-
-static void
-imap_cache_message (CamelDiscoFolder *disco_folder, const char *uid,
- CamelException *ex)
-{
- CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (disco_folder);
- CamelStream *stream;
-
- stream = camel_imap_folder_fetch_data (imap_folder, uid, "", FALSE, ex);
- if (stream)
- camel_object_unref (CAMEL_OBJECT (stream));
-}
-
-/* We pretend that a FLAGS or RFC822.SIZE response is always exactly
- * 20 bytes long, and a BODY[HEADERS] response is always 2000 bytes
- * long. Since we know how many of each kind of response we're
- * expecting, we can find the total (pretend) amount of server traffic
- * to expect and then count off the responses as we read them to update
- * the progress bar.
- */
-#define IMAP_PRETEND_SIZEOF_FLAGS 20
-#define IMAP_PRETEND_SIZEOF_SIZE 20
-#define IMAP_PRETEND_SIZEOF_HEADERS 2000
-
-static char *tm_months[] = {
- "Jan", "Feb", "Mar", "Apr", "May", "Jun",
- "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
-};
-
-static gboolean
-decode_time (const unsigned char **in, int *hour, int *min, int *sec)
-{
- register const unsigned char *inptr;
- int *val, colons = 0;
-
- *hour = *min = *sec = 0;
-
- val = hour;
- for (inptr = *in; *inptr && !isspace ((int) *inptr); inptr++) {
- if (*inptr == ':') {
- colons++;
- switch (colons) {
- case 1:
- val = min;
- break;
- case 2:
- val = sec;
- break;
- default:
- return FALSE;
- }
- } else if (!isdigit ((int) *inptr))
- return FALSE;
- else
- *val = (*val * 10) + (*inptr - '0');
- }
-
- *in = inptr;
-
- return TRUE;
-}
-
-static time_t
-decode_internaldate (const unsigned char *in)
-{
- const unsigned char *inptr = in;
- int hour, min, sec, n;
- unsigned char *buf;
- struct tm tm;
- time_t date;
-
- memset ((void *) &tm, 0, sizeof (struct tm));
-
- tm.tm_mday = strtoul (inptr, (char **) &buf, 10);
- if (buf == inptr || *buf != '-')
- return (time_t) -1;
-
- inptr = buf + 1;
- if (inptr[3] != '-')
- return (time_t) -1;
-
- for (n = 0; n < 12; n++) {
- if (!strncasecmp (inptr, tm_months[n], 3))
- break;
- }
-
- if (n >= 12)
- return (time_t) -1;
-
- tm.tm_mon = n;
-
- inptr += 4;
-
- n = strtoul (inptr, (char **) &buf, 10);
- if (buf == inptr || *buf != ' ')
- return (time_t) -1;
-
- tm.tm_year = n - 1900;
-
- inptr = buf + 1;
- if (!decode_time (&inptr, &hour, &min, &sec))
- return (time_t) -1;
-
- tm.tm_hour = hour;
- tm.tm_min = min;
- tm.tm_sec = sec;
-
- n = strtol (inptr, NULL, 10);
-
- date = e_mktime_utc (&tm);
-
- /* date is now GMT of the time we want, but not offset by the timezone ... */
-
- /* this should convert the time to the GMT equiv time */
- date -= ((n / 100) * 60 * 60) + (n % 100) * 60;
-
- return date;
-}
-
-static void
-add_message_from_data (CamelFolder *folder, GPtrArray *messages,
- int first, GData *data)
-{
- CamelMimeMessage *msg;
- CamelStream *stream;
- CamelMessageInfo *mi;
- const char *idate;
- int seq;
-
- seq = GPOINTER_TO_INT (g_datalist_get_data (&data, "SEQUENCE"));
- if (seq < first)
- return;
- stream = g_datalist_get_data (&data, "BODY_PART_STREAM");
- if (!stream)
- return;
-
- if (seq - first >= messages->len)
- g_ptr_array_set_size (messages, seq - first + 1);
-
- msg = camel_mime_message_new ();
- if (camel_data_wrapper_construct_from_stream (CAMEL_DATA_WRAPPER (msg), stream) == -1) {
- camel_object_unref (CAMEL_OBJECT (msg));
- return;
- }
-
- mi = camel_folder_summary_info_new_from_message (folder->summary, msg);
- camel_object_unref (CAMEL_OBJECT (msg));
-
- if ((idate = g_datalist_get_data (&data, "INTERNALDATE")))
- mi->date_received = decode_internaldate (idate);
-
- if (mi->date_received == -1)
- mi->date_received = mi->date_sent;
-
- messages->pdata[seq - first] = mi;
-}
-
-
-#define CAMEL_MESSAGE_INFO_HEADERS "DATE FROM TO CC SUBJECT REFERENCES IN-REPLY-TO MESSAGE-ID MIME-VERSION CONTENT-TYPE"
-
-/* FIXME: this needs to be kept in sync with camel-mime-utils.c's list
- of mailing-list headers and so might be best if this were
- auto-generated? */
-#define MAILING_LIST_HEADERS "X-MAILING-LIST X-LOOP LIST-ID LIST-POST MAILING-LIST ORIGINATOR X-LIST SENDER RETURN-PATH X-BEENTHERE"
-
-static void
-imap_update_summary (CamelFolder *folder, int exists,
- CamelFolderChangeInfo *changes,
- CamelException *ex)
-{
- CamelImapStore *store = CAMEL_IMAP_STORE (folder->parent_store);
- CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (folder);
- GPtrArray *fetch_data = NULL, *messages = NULL, *needheaders;
- guint32 flags, uidval;
- int i, seq, first, size, got;
- CamelImapResponseType type;
- const char *header_spec;
- CamelMessageInfo *mi, *info;
- CamelStream *stream;
- char *uid, *resp;
- GData *data;
-
- CAMEL_SERVICE_ASSERT_LOCKED (store, connect_lock);
- if (store->server_level >= IMAP_LEVEL_IMAP4REV1)
- header_spec = "HEADER.FIELDS.NOT (RECEIVED)";
- else
- header_spec = "0";
-
- /* Figure out if any of the new messages are already cached (which
- * may be the case if we're re-syncing after disconnected operation).
- * If so, get their UIDs, FLAGS, and SIZEs. If not, get all that
- * and ask for the headers too at the same time.
- */
- seq = camel_folder_summary_count (folder->summary);
- first = seq + 1;
- if (seq > 0) {
- mi = camel_folder_summary_index (folder->summary, seq - 1);
- uidval = strtoul(camel_message_info_uid (mi), NULL, 10);
- camel_folder_summary_info_free (folder->summary, mi);
- } else
- uidval = 0;
-
- size = (exists - seq) * (IMAP_PRETEND_SIZEOF_FLAGS + IMAP_PRETEND_SIZEOF_SIZE + IMAP_PRETEND_SIZEOF_HEADERS);
- got = 0;
- if (!camel_imap_command_start (store, folder, ex,
- "UID FETCH %d:* (FLAGS RFC822.SIZE INTERNALDATE BODY.PEEK[%s])",
- uidval + 1, header_spec))
- return;
- camel_operation_start (NULL, _("Fetching summary information for new messages"));
-
- /* Parse the responses. We can't add a message to the summary
- * until we've gotten its headers, and there's no guarantee
- * the server will send the responses in a useful order...
- */
- fetch_data = g_ptr_array_new ();
- messages = g_ptr_array_new ();
- while ((type = camel_imap_command_response (store, &resp, ex)) ==
- CAMEL_IMAP_RESPONSE_UNTAGGED) {
- data = parse_fetch_response (imap_folder, resp);
- g_free (resp);
- if (!data)
- continue;
-
- seq = GPOINTER_TO_INT (g_datalist_get_data (&data, "SEQUENCE"));
- if (seq < first) {
- g_datalist_clear (&data);
- continue;
- }
-
- if (g_datalist_get_data (&data, "FLAGS"))
- got += IMAP_PRETEND_SIZEOF_FLAGS;
- if (g_datalist_get_data (&data, "RFC822.SIZE"))
- got += IMAP_PRETEND_SIZEOF_SIZE;
- stream = g_datalist_get_data (&data, "BODY_PART_STREAM");
- if (stream) {
- got += IMAP_PRETEND_SIZEOF_HEADERS;
-
- /* Use the stream now so we don't tie up many
- * many fds if we're fetching many many messages.
- */
- add_message_from_data (folder, messages, first, data);
- g_datalist_set_data (&data, "BODY_PART_STREAM", NULL);
- }
-
- camel_operation_progress (NULL, got * 100 / size);
- g_ptr_array_add (fetch_data, data);
- }
- camel_operation_end (NULL);
-
- if (type == CAMEL_IMAP_RESPONSE_ERROR)
- goto lose;
-
- /* Free the final tagged response */
- g_free (resp);
-
- /* Figure out which headers we still need to fetch. */
- needheaders = g_ptr_array_new ();
- size = got = 0;
- for (i = 0; i < fetch_data->len; i++) {
- data = fetch_data->pdata[i];
- if (g_datalist_get_data (&data, "BODY_PART_LEN"))
- continue;
-
- uid = g_datalist_get_data (&data, "UID");
- if (uid) {
- g_ptr_array_add (needheaders, uid);
- size += IMAP_PRETEND_SIZEOF_HEADERS;
- }
- }
-
- /* And fetch them */
- if (needheaders->len) {
- char *uidset;
- int uid = 0;
-
- qsort (needheaders->pdata, needheaders->len,
- sizeof (void *), uid_compar);
-
- camel_operation_start (NULL, _("Fetching summary information for new messages"));
-
- while (uid < needheaders->len) {
- uidset = imap_uid_array_to_set (folder->summary, needheaders, uid, UID_SET_LIMIT, &uid);
- if (!camel_imap_command_start (store, folder, ex,
- "UID FETCH %s BODY.PEEK[%s]",
- uidset, header_spec)) {
- g_ptr_array_free (needheaders, TRUE);
- camel_operation_end (NULL);
- g_free (uidset);
- goto lose;
- }
- g_free (uidset);
-
- while ((type = camel_imap_command_response (store, &resp, ex))
- == CAMEL_IMAP_RESPONSE_UNTAGGED) {
- data = parse_fetch_response (imap_folder, resp);
- g_free (resp);
- if (!data)
- continue;
-
- stream = g_datalist_get_data (&data, "BODY_PART_STREAM");
- if (stream) {
- add_message_from_data (folder, messages, first, data);
- got += IMAP_PRETEND_SIZEOF_HEADERS;
- camel_operation_progress (NULL, got * 100 / size);
- }
- g_datalist_clear (&data);
- }
-
- if (type == CAMEL_IMAP_RESPONSE_ERROR) {
- g_ptr_array_free (needheaders, TRUE);
- camel_operation_end (NULL);
- goto lose;
- }
- }
-
- g_ptr_array_free (needheaders, TRUE);
- camel_operation_end (NULL);
- }
-
- /* Now finish up summary entries (fix UIDs, set flags and size) */
- for (i = 0; i < fetch_data->len; i++) {
- data = fetch_data->pdata[i];
-
- seq = GPOINTER_TO_INT (g_datalist_get_data (&data, "SEQUENCE"));
- if (seq >= first + messages->len) {
- g_datalist_clear (&data);
- continue;
- }
-
- mi = messages->pdata[seq - first];
- if (mi == NULL) {
- CamelMessageInfo *pmi = NULL;
- int j;
-
- /* This is a kludge around a bug in Exchange
- * 5.5 that sometimes claims multiple messages
- * have the same UID. See bug #17694 for
- * details. The "solution" is to create a fake
- * message-info with the same details as the
- * previously valid message. Yes, the user
- * will have a clone in his/her message-list,
- * but at least we don't crash.
- */
-
- /* find the previous valid message info */
- for (j = seq - first - 1; j >= 0; j--) {
- pmi = messages->pdata[j];
- if (pmi != NULL)
- break;
- }
-
- if (pmi == NULL) {
- /* Server response is *really* fucked up,
- I guess we just pretend it never happened? */
- continue;
- }
-
- mi = camel_message_info_new ();
- camel_message_info_dup_to (pmi, mi);
- }
-
- uid = g_datalist_get_data (&data, "UID");
- if (uid)
- camel_message_info_set_uid (mi, g_strdup (uid));
- flags = GPOINTER_TO_INT (g_datalist_get_data (&data, "FLAGS"));
- if (flags) {
- ((CamelImapMessageInfo *)mi)->server_flags = flags;
- /* "or" them in with the existing flags that may
- * have been set by summary_info_new_from_message.
- */
- mi->flags |= flags;
- }
- size = GPOINTER_TO_INT (g_datalist_get_data (&data, "RFC822.SIZE"));
- if (size)
- mi->size = size;
-
- g_datalist_clear (&data);
- }
- g_ptr_array_free (fetch_data, TRUE);
-
- /* And add the entries to the summary, etc. */
- for (i = 0; i < messages->len; i++) {
- mi = messages->pdata[i];
- if (!mi) {
- g_warning ("No information for message %d", i + first);
- continue;
- }
- uid = (char *)camel_message_info_uid(mi);
- if (uid[0] == 0) {
- g_warning("Server provided no uid: message %d", i + first);
- continue;
- }
- info = camel_folder_summary_uid(folder->summary, uid);
- if (info) {
- g_warning("Message already present? %s", camel_message_info_uid(mi));
- camel_folder_summary_info_free(folder->summary, info);
- camel_folder_summary_info_free(folder->summary, mi);
- continue;
- }
-
- camel_folder_summary_add (folder->summary, mi);
- camel_folder_change_info_add_uid (changes, camel_message_info_uid (mi));
-
- if ((mi->flags & CAMEL_IMAP_MESSAGE_RECENT))
- camel_folder_change_info_recent_uid(changes, camel_message_info_uid (mi));
- }
- g_ptr_array_free (messages, TRUE);
-
- /* Kludge around Microsoft Exchange 5.5 IMAP - See bug #5348 for details */
- if (camel_folder_summary_count (folder->summary) != exists) {
- CamelImapStore *imap_store = (CamelImapStore *) folder->parent_store;
- CamelImapResponse *response;
-
- /* forget the currently selected folder */
- if (imap_store->current_folder) {
- camel_object_unref (CAMEL_OBJECT (imap_store->current_folder));
- imap_store->current_folder = NULL;
- }
-
- /* now re-select it and process the EXISTS response */
- response = camel_imap_command (imap_store, folder, ex, NULL);
- if (response) {
- camel_imap_folder_selected (folder, response, NULL);
- camel_imap_response_free (imap_store, response);
- }
- }
-
- return;
-
- lose:
- if (fetch_data) {
- for (i = 0; i < fetch_data->len; i++) {
- data = fetch_data->pdata[i];
- g_datalist_clear (&data);
- }
- g_ptr_array_free (fetch_data, TRUE);
- }
- if (messages) {
- for (i = 0; i < messages->len; i++) {
- if (messages->pdata[i])
- camel_folder_summary_info_free (folder->summary, messages->pdata[i]);
- }
- g_ptr_array_free (messages, TRUE);
- }
-}
-
-/* Called with the store's connect_lock locked */
-void
-camel_imap_folder_changed (CamelFolder *folder, int exists,
- GArray *expunged, CamelException *ex)
-{
- CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (folder);
- CamelFolderChangeInfo *changes;
- CamelMessageInfo *info;
- int len;
-
- CAMEL_SERVICE_ASSERT_LOCKED (folder->parent_store, connect_lock);
-
- changes = camel_folder_change_info_new ();
- if (expunged) {
- int i, id;
-
- for (i = 0; i < expunged->len; i++) {
- id = g_array_index (expunged, int, i);
- info = camel_folder_summary_index (folder->summary, id - 1);
- if (info == NULL) {
- /* FIXME: danw: does this mean that the summary is corrupt? */
- /* I guess a message that we never retrieved got expunged? */
- continue;
- }
-
- camel_folder_change_info_remove_uid (changes, camel_message_info_uid (info));
- CAMEL_IMAP_FOLDER_LOCK (imap_folder, cache_lock);
- camel_imap_message_cache_remove (imap_folder->cache, camel_message_info_uid (info));
- CAMEL_IMAP_FOLDER_UNLOCK (imap_folder, cache_lock);
- camel_folder_summary_remove (folder->summary, info);
- camel_folder_summary_info_free(folder->summary, info);
- }
- }
-
- len = camel_folder_summary_count (folder->summary);
- if (exists > len)
- imap_update_summary (folder, exists, changes, ex);
-
- if (camel_folder_change_info_changed (changes))
- camel_object_trigger_event (CAMEL_OBJECT (folder), "folder_changed", changes);
-
- camel_folder_change_info_free (changes);
- camel_folder_summary_save (folder->summary);
-}
-
-static void
-imap_thaw (CamelFolder *folder)
-{
- CamelImapFolder *imap_folder;
-
- CAMEL_FOLDER_CLASS (disco_folder_class)->thaw (folder);
- if (camel_folder_is_frozen (folder))
- return;
-
- imap_folder = CAMEL_IMAP_FOLDER (folder);
- if (imap_folder->need_refresh) {
- imap_folder->need_refresh = FALSE;
- imap_refresh_info (folder, NULL);
- }
-}
-
-
-CamelStream *
-camel_imap_folder_fetch_data (CamelImapFolder *imap_folder, const char *uid,
- const char *section_text, gboolean cache_only,
- CamelException *ex)
-{
- CamelFolder *folder = CAMEL_FOLDER (imap_folder);
- CamelImapStore *store = CAMEL_IMAP_STORE (folder->parent_store);
- CamelImapResponse *response;
- CamelStream *stream;
- GData *fetch_data;
- char *found_uid;
- int i;
-
- /* EXPUNGE responses have to modify the cache, which means
- * they have to grab the cache_lock while holding the
- * connect_lock. So we grab the connect_lock now, in case
- * we're going to need it below, since we can't grab it
- * after the cache_lock.
- */
- CAMEL_SERVICE_LOCK (store, connect_lock);
-
- CAMEL_IMAP_FOLDER_LOCK (imap_folder, cache_lock);
- stream = camel_imap_message_cache_get (imap_folder->cache, uid, section_text, ex);
- if (!stream && (!strcmp (section_text, "HEADER") || !strcmp (section_text, "0"))) {
- camel_exception_clear (ex);
- stream = camel_imap_message_cache_get (imap_folder->cache, uid, "", ex);
- }
-
- if (stream || cache_only) {
- CAMEL_IMAP_FOLDER_UNLOCK (imap_folder, cache_lock);
- CAMEL_SERVICE_UNLOCK (store, connect_lock);
- return stream;
- }
-
- if (camel_disco_store_status (CAMEL_DISCO_STORE (store)) == CAMEL_DISCO_STORE_OFFLINE) {
- camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
- _("This message is not currently available"));
- CAMEL_IMAP_FOLDER_UNLOCK (imap_folder, cache_lock);
- CAMEL_SERVICE_UNLOCK (store, connect_lock);
- return NULL;
- }
-
- camel_exception_clear (ex);
- if (store->server_level < IMAP_LEVEL_IMAP4REV1 && !*section_text) {
- response = camel_imap_command (store, folder, ex,
- "UID FETCH %s RFC822.PEEK",
- uid);
- } else {
- response = camel_imap_command (store, folder, ex,
- "UID FETCH %s BODY.PEEK[%s]",
- uid, section_text);
- }
- /* We won't need the connect_lock again after this. */
- CAMEL_SERVICE_UNLOCK (store, connect_lock);
-
- if (!response) {
- CAMEL_IMAP_FOLDER_UNLOCK (imap_folder, cache_lock);
- return NULL;
- }
-
- for (i = 0; i < response->untagged->len; i++) {
- fetch_data = parse_fetch_response (imap_folder, response->untagged->pdata[i]);
- found_uid = g_datalist_get_data (&fetch_data, "UID");
- stream = g_datalist_get_data (&fetch_data, "BODY_PART_STREAM");
- if (found_uid && stream && !strcmp (uid, found_uid))
- break;
-
- g_datalist_clear (&fetch_data);
- stream = NULL;
- }
- camel_imap_response_free (store, response);
- CAMEL_IMAP_FOLDER_UNLOCK (imap_folder, cache_lock);
- if (!stream) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
- _("Could not find message body in FETCH response."));
- } else {
- camel_object_ref (CAMEL_OBJECT (stream));
- g_datalist_clear (&fetch_data);
- }
-
- return stream;
-}
-
-static GData *
-parse_fetch_response (CamelImapFolder *imap_folder, char *response)
-{
- GData *data = NULL;
- char *start, *part_spec = NULL, *body = NULL, *uid = NULL, *idate = NULL;
- gboolean cache_header = TRUE, header = FALSE;
- size_t body_len = 0;
-
- if (*response != '(') {
- long seq;
-
- if (*response != '*' || *(response + 1) != ' ')
- return NULL;
- seq = strtol (response + 2, &response, 10);
- if (seq == 0)
- return NULL;
- if (strncasecmp (response, " FETCH (", 8) != 0)
- return NULL;
- response += 7;
-
- g_datalist_set_data (&data, "SEQUENCE", GINT_TO_POINTER (seq));
- }
-
- do {
- /* Skip the initial '(' or the ' ' between elements */
- response++;
-
- if (!strncasecmp (response, "FLAGS ", 6)) {
- guint32 flags;
-
- response += 6;
- /* FIXME user flags */
- flags = imap_parse_flag_list (&response);
-
- g_datalist_set_data (&data, "FLAGS", GUINT_TO_POINTER (flags));
- } else if (!strncasecmp (response, "RFC822.SIZE ", 12)) {
- unsigned long size;
-
- response += 12;
- size = strtoul (response, &response, 10);
- g_datalist_set_data (&data, "RFC822.SIZE", GUINT_TO_POINTER (size));
- } else if (!strncasecmp (response, "BODY[", 5) ||
- !strncasecmp (response, "RFC822 ", 7)) {
- char *p;
-
- if (*response == 'B') {
- response += 5;
-
- /* HEADER], HEADER.FIELDS (...)], or 0] */
- if (!strncasecmp (response, "HEADER", 6)) {
- header = TRUE;
- if (!strncasecmp (response + 6, ".FIELDS", 7))
- cache_header = FALSE;
- } else if (!strncasecmp (response, "0]", 2))
- header = TRUE;
-
- p = strchr (response, ']');
- if (!p || *(p + 1) != ' ')
- break;
-
- if (cache_header)
- part_spec = g_strndup (response, p - response);
- else
- part_spec = g_strdup ("HEADER.FIELDS");
-
- response = p + 2;
- } else {
- part_spec = g_strdup ("");
- response += 7;
-
- if (!strncasecmp (response, "HEADER", 6))
- header = TRUE;
- }
-
- body = imap_parse_nstring ((const char **) &response, &body_len);
- if (!response) {
- g_free (part_spec);
- break;
- }
-
- if (!body)
- body = g_strdup ("");
- g_datalist_set_data_full (&data, "BODY_PART_SPEC", part_spec, g_free);
- g_datalist_set_data_full (&data, "BODY_PART_DATA", body, g_free);
- g_datalist_set_data (&data, "BODY_PART_LEN", GINT_TO_POINTER (body_len));
- } else if (!strncasecmp (response, "BODY ", 5) ||
- !strncasecmp (response, "BODYSTRUCTURE ", 14)) {
- response = strchr (response, ' ') + 1;
- start = response;
- imap_skip_list ((const char **) &response);
- g_datalist_set_data_full (&data, "BODY", g_strndup (start, response - start), g_free);
- } else if (!strncasecmp (response, "UID ", 4)) {
- int len;
-
- len = strcspn (response + 4, " )");
- uid = g_strndup (response + 4, len);
- g_datalist_set_data_full (&data, "UID", uid, g_free);
- response += 4 + len;
- } else if (!strncasecmp (response, "INTERNALDATE ", 13)) {
- int len;
-
- response += 13;
- if (*response == '"') {
- response++;
- len = strcspn (response, "\"");
- idate = g_strndup (response, len);
- g_datalist_set_data_full (&data, "INTERNALDATE", idate, g_free);
- response += len + 1;
- }
- } else {
- g_warning ("Unexpected FETCH response from server: (%s", response);
- break;
- }
- } while (response && *response != ')');
-
- if (!response || *response != ')') {
- g_datalist_clear (&data);
- return NULL;
- }
-
- if (uid && body) {
- CamelStream *stream;
-
- if (header && !cache_header) {
- stream = camel_stream_mem_new_with_buffer (body, body_len);
- } else {
- CAMEL_IMAP_FOLDER_LOCK (imap_folder, cache_lock);
- stream = camel_imap_message_cache_insert (imap_folder->cache,
- uid, part_spec,
- body, body_len, NULL);
- CAMEL_IMAP_FOLDER_UNLOCK (imap_folder, cache_lock);
- }
-
- if (stream)
- g_datalist_set_data_full (&data, "BODY_PART_STREAM", stream,
- (GDestroyNotify) camel_object_unref);
- }
-
- return data;
-}
-
diff --git a/camel/providers/imap/camel-imap-folder.h b/camel/providers/imap/camel-imap-folder.h
deleted file mode 100644
index a49f7bd497..0000000000
--- a/camel/providers/imap/camel-imap-folder.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-imap-folder.h: class for an imap folder */
-
-/*
- * Authors:
- * Dan Winship <danw@ximian.com>
- * Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright (C) 2000, 2001 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifndef CAMEL_IMAP_FOLDER_H
-#define CAMEL_IMAP_FOLDER_H 1
-
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include "camel-imap-types.h"
-#include <camel/camel-disco-folder.h>
-#include <camel/camel-folder-search.h>
-
-#define CAMEL_IMAP_FOLDER_TYPE (camel_imap_folder_get_type ())
-#define CAMEL_IMAP_FOLDER(obj) (CAMEL_CHECK_CAST((obj), CAMEL_IMAP_FOLDER_TYPE, CamelImapFolder))
-#define CAMEL_IMAP_FOLDER_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_IMAP_FOLDER_TYPE, CamelImapFolderClass))
-#define CAMEL_IS_IMAP_FOLDER(o) (CAMEL_CHECK_TYPE((o), CAMEL_IMAP_FOLDER_TYPE))
-
-struct _CamelImapFolder {
- CamelDiscoFolder parent_object;
-
- struct _CamelImapFolderPrivate *priv;
-
- gboolean need_rescan, need_refresh;
- CamelFolderSearch *search;
- CamelImapMessageCache *cache;
-};
-
-
-typedef struct {
- CamelDiscoFolderClass parent_class;
-
- /* Virtual methods */
-
-} CamelImapFolderClass;
-
-
-/* public methods */
-CamelFolder *camel_imap_folder_new (CamelStore *parent,
- const char *folder_name,
- const char *folder_dir,
- CamelException *ex);
-
-void camel_imap_folder_selected (CamelFolder *folder,
- CamelImapResponse *response,
- CamelException *ex);
-
-void camel_imap_folder_changed (CamelFolder *folder, int exists,
- GArray *expunged, CamelException *ex);
-
-CamelStream *camel_imap_folder_fetch_data (CamelImapFolder *imap_folder,
- const char *uid,
- const char *section_text,
- gboolean cache_only,
- CamelException *ex);
-
-/* Standard Camel function */
-CamelType camel_imap_folder_get_type (void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_IMAP_FOLDER_H */
diff --git a/camel/providers/imap/camel-imap-message-cache.c b/camel/providers/imap/camel-imap-message-cache.c
deleted file mode 100644
index 559c6d2f88..0000000000
--- a/camel/providers/imap/camel-imap-message-cache.c
+++ /dev/null
@@ -1,527 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-imap-message-cache.c: Class for an IMAP message cache */
-
-/*
- * Author:
- * Dan Winship <danw@ximian.com>
- *
- * Copyright (C) 2001 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <sys/types.h>
-#include <dirent.h>
-#include <errno.h>
-#include <string.h>
-#include <ctype.h>
-
-#include "camel-imap-message-cache.h"
-#include "camel-data-wrapper.h"
-#include "camel-exception.h"
-#include "camel-stream-fs.h"
-
-static void finalize (CamelImapMessageCache *cache);
-static void stream_finalize (CamelObject *stream, gpointer event_data, gpointer user_data);
-
-
-CamelType
-camel_imap_message_cache_get_type (void)
-{
- static CamelType camel_imap_message_cache_type = CAMEL_INVALID_TYPE;
-
- if (camel_imap_message_cache_type == CAMEL_INVALID_TYPE) {
- camel_imap_message_cache_type = camel_type_register (
- CAMEL_OBJECT_TYPE, "CamelImapMessageCache",
- sizeof (CamelImapMessageCache),
- sizeof (CamelImapMessageCacheClass),
- NULL,
- NULL,
- NULL,
- (CamelObjectFinalizeFunc) finalize);
- }
-
- return camel_imap_message_cache_type;
-}
-
-static void
-free_part (gpointer key, gpointer value, gpointer data)
-{
- if (value) {
- if (strchr (key, '.')) {
- camel_object_unhook_event (value, "finalize",
- stream_finalize, data);
- camel_object_unref (value);
- } else
- g_ptr_array_free (value, TRUE);
- }
- g_free (key);
-}
-
-static void
-finalize (CamelImapMessageCache *cache)
-{
- if (cache->path)
- g_free (cache->path);
- if (cache->parts) {
- g_hash_table_foreach (cache->parts, free_part, cache);
- g_hash_table_destroy (cache->parts);
- }
- if (cache->cached)
- g_hash_table_destroy (cache->cached);
-}
-
-static void
-cache_put (CamelImapMessageCache *cache, const char *uid, const char *key,
- CamelStream *stream)
-{
- char *hash_key;
- GPtrArray *subparts;
- gpointer okey, ostream;
- guint32 uidval;
-
- uidval = strtoul (uid, NULL, 10);
- if (uidval > cache->max_uid)
- cache->max_uid = uidval;
-
- subparts = g_hash_table_lookup (cache->parts, uid);
- if (!subparts) {
- subparts = g_ptr_array_new ();
- g_hash_table_insert (cache->parts, g_strdup (uid), subparts);
- }
-
- if (g_hash_table_lookup_extended (cache->parts, key, &okey, &ostream)) {
- if (ostream) {
- camel_object_unhook_event (ostream, "finalize",
- stream_finalize, cache);
- g_hash_table_remove (cache->cached, ostream);
- camel_object_unref (ostream);
- }
- hash_key = okey;
- } else {
- hash_key = g_strdup (key);
- g_ptr_array_add (subparts, hash_key);
- }
-
- g_hash_table_insert (cache->parts, hash_key, stream);
- g_hash_table_insert (cache->cached, stream, hash_key);
-
- if (stream) {
- camel_object_hook_event (CAMEL_OBJECT (stream), "finalize",
- stream_finalize, cache);
- }
-}
-
-/**
- * camel_imap_message_cache_new:
- * @path: directory to use for storage
- * @summary: CamelFolderSummary for the folder we are caching
- * @ex: a CamelException
- *
- * Return value: a new CamelImapMessageCache object using @path for
- * storage. If cache files already exist in @path, then any that do not
- * correspond to messages in @summary will be deleted.
- **/
-CamelImapMessageCache *
-camel_imap_message_cache_new (const char *path, CamelFolderSummary *summary,
- CamelException *ex)
-{
- CamelImapMessageCache *cache;
- DIR *dir;
- struct dirent *d;
- char *uid, *p;
- GPtrArray *deletes;
- CamelMessageInfo *info;
-
- dir = opendir (path);
- if (!dir) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not open cache directory: %s"),
- g_strerror (errno));
- return NULL;
- }
-
- cache = (CamelImapMessageCache *)camel_object_new (CAMEL_IMAP_MESSAGE_CACHE_TYPE);
- cache->path = g_strdup (path);
-
- cache->parts = g_hash_table_new (g_str_hash, g_str_equal);
- cache->cached = g_hash_table_new (NULL, NULL);
- deletes = g_ptr_array_new ();
- while ((d = readdir (dir))) {
- if (!isdigit (d->d_name[0]))
- continue;
-
- p = strchr (d->d_name, '.');
- if (p)
- uid = g_strndup (d->d_name, p - d->d_name);
- else
- uid = g_strdup (d->d_name);
-
- info = camel_folder_summary_uid (summary, uid);
- if (info) {
- camel_folder_summary_info_free (summary, info);
- cache_put (cache, uid, d->d_name, NULL);
- } else
- g_ptr_array_add (deletes, g_strdup_printf ("%s/%s", cache->path, d->d_name));
- g_free (uid);
- }
- closedir (dir);
-
- while (deletes->len) {
- unlink (deletes->pdata[0]);
- g_free (deletes->pdata[0]);
- g_ptr_array_remove_index_fast (deletes, 0);
- }
- g_ptr_array_free (deletes, TRUE);
-
- return cache;
-}
-
-/**
- * camel_imap_message_cache_max_uid:
- * @cache: the cache
- *
- * Return value: the largest (real) UID in the cache.
- **/
-guint32
-camel_imap_message_cache_max_uid (CamelImapMessageCache *cache)
-{
- return cache->max_uid;
-}
-
-/**
- * camel_imap_message_cache_set_path:
- * @cache:
- * @path:
- *
- * Set the path used for the message cache.
- **/
-void
-camel_imap_message_cache_set_path (CamelImapMessageCache *cache, const char *path)
-{
- g_free(cache->path);
- cache->path = g_strdup(path);
-}
-
-static void
-stream_finalize (CamelObject *stream, gpointer event_data, gpointer user_data)
-{
- CamelImapMessageCache *cache = user_data;
- char *key;
-
- key = g_hash_table_lookup (cache->cached, stream);
- if (!key)
- return;
- g_hash_table_remove (cache->cached, stream);
- g_hash_table_insert (cache->parts, key, NULL);
-}
-
-
-static CamelStream *
-insert_setup (CamelImapMessageCache *cache, const char *uid, const char *part_spec,
- char **path, char **key, CamelException *ex)
-{
- CamelStream *stream;
- int fd;
-
- *path = g_strdup_printf ("%s/%s.%s", cache->path, uid, part_spec);
- *key = strrchr (*path, '/') + 1;
- stream = g_hash_table_lookup (cache->parts, *key);
- if (stream)
- camel_object_unref (CAMEL_OBJECT (stream));
-
- fd = open (*path, O_RDWR | O_CREAT | O_TRUNC, 0600);
- if (fd == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Failed to cache message %s: %s"),
- uid, g_strerror (errno));
- g_free (*path);
- return NULL;
- }
-
- return camel_stream_fs_new_with_fd (fd);
-}
-
-static CamelStream *
-insert_abort (char *path, CamelStream *stream)
-{
- unlink (path);
- g_free (path);
- camel_object_unref (CAMEL_OBJECT (stream));
- return NULL;
-}
-
-static CamelStream *
-insert_finish (CamelImapMessageCache *cache, const char *uid, char *path,
- char *key, CamelStream *stream)
-{
- camel_stream_flush (stream);
- camel_stream_reset (stream);
- cache_put (cache, uid, key, stream);
- g_free (path);
-
- return stream;
-}
-
-/**
- * camel_imap_message_cache_insert:
- * @cache: the cache
- * @uid: UID of the message data to cache
- * @part_spec: the IMAP part_spec of the data
- * @data: the data
- * @len: length of @data
- *
- * Caches the provided data into @cache.
- *
- * Return value: a CamelStream containing the cached data, which the
- * caller must unref.
- **/
-CamelStream *
-camel_imap_message_cache_insert (CamelImapMessageCache *cache, const char *uid,
- const char *part_spec, const char *data,
- int len, CamelException *ex)
-{
- char *path, *key;
- CamelStream *stream;
-
- stream = insert_setup (cache, uid, part_spec, &path, &key, ex);
- if (!stream)
- return NULL;
-
- if (camel_stream_write (stream, data, len) == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Failed to cache message %s: %s"),
- uid, g_strerror (errno));
- return insert_abort (path, stream);
- }
-
- return insert_finish (cache, uid, path, key, stream);
-}
-
-/**
- * camel_imap_message_cache_insert_stream:
- * @cache: the cache
- * @uid: UID of the message data to cache
- * @part_spec: the IMAP part_spec of the data
- * @data_stream: the stream to cache
- *
- * Caches the provided data into @cache.
- **/
-void
-camel_imap_message_cache_insert_stream (CamelImapMessageCache *cache,
- const char *uid, const char *part_spec,
- CamelStream *data_stream, CamelException *ex)
-{
- char *path, *key;
- CamelStream *stream;
-
- stream = insert_setup (cache, uid, part_spec, &path, &key, ex);
- if (!stream)
- return;
-
- if (camel_stream_write_to_stream (data_stream, stream) == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Failed to cache message %s: %s"),
- uid, g_strerror (errno));
- insert_abort (path, stream);
- } else {
- insert_finish (cache, uid, path, key, stream);
- camel_object_unref (CAMEL_OBJECT (stream));
- }
-}
-
-/**
- * camel_imap_message_cache_insert_wrapper:
- * @cache: the cache
- * @uid: UID of the message data to cache
- * @part_spec: the IMAP part_spec of the data
- * @wrapper: the wrapper to cache
- *
- * Caches the provided data into @cache.
- **/
-void
-camel_imap_message_cache_insert_wrapper (CamelImapMessageCache *cache,
- const char *uid, const char *part_spec,
- CamelDataWrapper *wrapper, CamelException *ex)
-{
- char *path, *key;
- CamelStream *stream;
-
- stream = insert_setup (cache, uid, part_spec, &path, &key, ex);
- if (!stream)
- return;
-
- if (camel_data_wrapper_write_to_stream (wrapper, stream) == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Failed to cache message %s: %s"),
- uid, g_strerror (errno));
- insert_abort (path, stream);
- } else {
- insert_finish (cache, uid, path, key, stream);
- camel_object_unref (CAMEL_OBJECT (stream));
- }
-}
-
-
-/**
- * camel_imap_message_cache_get:
- * @cache: the cache
- * @uid: the UID of the data to get
- * @part_spec: the part_spec of the data to get
- * @ex: exception
- *
- * Return value: a CamelStream containing the cached data (which the
- * caller must unref), or %NULL if that data is not cached.
- **/
-CamelStream *
-camel_imap_message_cache_get (CamelImapMessageCache *cache, const char *uid,
- const char *part_spec, CamelException *ex)
-{
- CamelStream *stream;
- char *path, *key;
-
- if (uid[0] == 0)
- return NULL;
-
- path = g_strdup_printf ("%s/%s.%s", cache->path, uid, part_spec);
- key = strrchr (path, '/') + 1;
- stream = g_hash_table_lookup (cache->parts, key);
- if (stream) {
- camel_stream_reset (CAMEL_STREAM (stream));
- camel_object_ref (CAMEL_OBJECT (stream));
- g_free (path);
- return stream;
- }
-
- stream = camel_stream_fs_new_with_name (path, O_RDONLY, 0);
- if (stream) {
- cache_put (cache, uid, key, stream);
- } else {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Failed to cache %s: %s"),
- part_spec, g_strerror (errno));
- }
-
- g_free (path);
-
- return stream;
-}
-
-/**
- * camel_imap_message_cache_remove:
- * @cache: the cache
- * @uid: UID of the data to remove
- *
- * Removes all data associated with @uid from @cache.
- **/
-void
-camel_imap_message_cache_remove (CamelImapMessageCache *cache, const char *uid)
-{
- GPtrArray *subparts;
- char *key, *path;
- CamelObject *stream;
- int i;
-
- subparts = g_hash_table_lookup (cache->parts, uid);
- if (!subparts)
- return;
- for (i = 0; i < subparts->len; i++) {
- key = subparts->pdata[i];
- path = g_strdup_printf ("%s/%s", cache->path, key);
- unlink (path);
- g_free (path);
- stream = g_hash_table_lookup (cache->parts, key);
- if (stream) {
- camel_object_unhook_event (stream, "finalize",
- stream_finalize, cache);
- camel_object_unref (stream);
- g_hash_table_remove (cache->cached, stream);
- }
- g_hash_table_remove (cache->parts, key);
- g_free (key);
- }
- g_hash_table_remove (cache->parts, uid);
- g_ptr_array_free (subparts, TRUE);
-}
-
-static void
-add_uids (gpointer key, gpointer value, gpointer data)
-{
- if (!strchr (key, '.'))
- g_ptr_array_add (data, key);
-}
-
-/**
- * camel_imap_message_cache_clear:
- * @cache: the cache
- *
- * Removes all cached data from @cache.
- **/
-void
-camel_imap_message_cache_clear (CamelImapMessageCache *cache)
-{
- GPtrArray *uids;
- int i;
-
- uids = g_ptr_array_new ();
- g_hash_table_foreach (cache->parts, add_uids, uids);
-
- for (i = 0; i < uids->len; i++)
- camel_imap_message_cache_remove (cache, uids->pdata[i]);
- g_ptr_array_free (uids, TRUE);
-}
-
-
-/**
- * camel_imap_message_cache_copy:
- * @source: the source message cache
- * @source_uid: UID of a message in @source
- * @dest: the destination message cache
- * @dest_uid: UID of the message in @dest
- *
- * Copies all cached parts from @source_uid in @source to @dest_uid in
- * @destination.
- **/
-void
-camel_imap_message_cache_copy (CamelImapMessageCache *source,
- const char *source_uid,
- CamelImapMessageCache *dest,
- const char *dest_uid,
- CamelException *ex)
-{
- GPtrArray *subparts;
- CamelStream *stream;
- char *part;
- int i;
-
- subparts = g_hash_table_lookup (source->parts, source_uid);
- if (!subparts || !subparts->len)
- return;
-
- for (i = 0; i < subparts->len; i++) {
- part = strchr (subparts->pdata[i], '.');
- if (!part++)
- continue;
-
- if ((stream = camel_imap_message_cache_get (source, source_uid, part, ex))) {
- camel_imap_message_cache_insert_stream (dest, dest_uid, part, stream, ex);
- camel_object_unref (CAMEL_OBJECT (stream));
- }
- }
-}
diff --git a/camel/providers/imap/camel-imap-message-cache.h b/camel/providers/imap/camel-imap-message-cache.h
deleted file mode 100644
index c79195cfa4..0000000000
--- a/camel/providers/imap/camel-imap-message-cache.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-imap-message-cache.h: Class for an IMAP message cache */
-
-/*
- * Author:
- * Dan Winship <danw@ximian.com>
- *
- * Copyright (C) 2001 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifndef CAMEL_IMAP_MESSAGE_CACHE_H
-#define CAMEL_IMAP_MESSAGE_CACHE_H 1
-
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include "camel-imap-types.h"
-#include "camel-folder.h"
-#include <camel/camel-folder-search.h>
-
-#define CAMEL_IMAP_MESSAGE_CACHE_TYPE (camel_imap_message_cache_get_type ())
-#define CAMEL_IMAP_MESSAGE_CACHE(obj) (CAMEL_CHECK_CAST((obj), CAMEL_IMAP_MESSAGE_CACHE_TYPE, CamelImapFolder))
-#define CAMEL_IMAP_MESSAGE_CACHE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_IMAP_MESSAGE_CACHE_TYPE, CamelImapFolderClass))
-#define CAMEL_IS_IMAP_MESSAGE_CACHE(o) (CAMEL_CHECK_TYPE((o), CAMEL_IMAP_MESSAGE_CACHE_TYPE))
-
-struct _CamelImapMessageCache {
- CamelObject parent_object;
-
- char *path;
- GHashTable *parts, *cached;
- guint32 max_uid;
-};
-
-
-typedef struct {
- CamelFolderClass parent_class;
-
- /* Virtual methods */
-
-} CamelImapMessageCacheClass;
-
-
-/* public methods */
-CamelImapMessageCache *camel_imap_message_cache_new (const char *path,
- CamelFolderSummary *summ,
- CamelException *ex);
-
-void camel_imap_message_cache_set_path (CamelImapMessageCache *cache,
- const char *path);
-
-guint32 camel_imap_message_cache_max_uid (CamelImapMessageCache *cache);
-
-CamelStream *camel_imap_message_cache_insert (CamelImapMessageCache *cache,
- const char *uid,
- const char *part_spec,
- const char *data,
- int len,
- CamelException *ex);
-void camel_imap_message_cache_insert_stream (CamelImapMessageCache *cache,
- const char *uid,
- const char *part_spec,
- CamelStream *data_stream,
- CamelException *ex);
-void camel_imap_message_cache_insert_wrapper (CamelImapMessageCache *cache,
- const char *uid,
- const char *part_spec,
- CamelDataWrapper *wrapper,
- CamelException *ex);
-
-CamelStream *camel_imap_message_cache_get (CamelImapMessageCache *cache,
- const char *uid,
- const char *part_spec,
- CamelException *ex);
-
-void camel_imap_message_cache_remove (CamelImapMessageCache *cache,
- const char *uid);
-
-void camel_imap_message_cache_clear (CamelImapMessageCache *cache);
-
-void camel_imap_message_cache_copy (CamelImapMessageCache *source,
- const char *source_uid,
- CamelImapMessageCache *dest,
- const char *dest_uid,
- CamelException *ex);
-
-/* Standard Camel function */
-CamelType camel_imap_message_cache_get_type (void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_IMAP_MESSAGE_CACHE_H */
diff --git a/camel/providers/imap/camel-imap-private.h b/camel/providers/imap/camel-imap-private.h
deleted file mode 100644
index 0f80dbfd1c..0000000000
--- a/camel/providers/imap/camel-imap-private.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- * camel-imap-private.h: Private info for imap.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifndef CAMEL_IMAP_PRIVATE_H
-#define CAMEL_IMAP_PRIVATE_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-/* need a way to configure and save this data, if this header is to
- be installed. For now, dont install it */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef ENABLE_THREADS
-#include "e-util/e-msgport.h"
-#endif
-
-struct _CamelImapFolderPrivate {
-#ifdef ENABLE_THREADS
- EMutex *search_lock; /* for locking the search object */
- EMutex *cache_lock; /* for locking the cache object */
-#endif
-};
-
-#ifdef ENABLE_THREADS
-#define CAMEL_IMAP_FOLDER_LOCK(f, l) (e_mutex_lock(((CamelImapFolder *)f)->priv->l))
-#define CAMEL_IMAP_FOLDER_UNLOCK(f, l) (e_mutex_unlock(((CamelImapFolder *)f)->priv->l))
-#else
-#define CAMEL_IMAP_FOLDER_LOCK(f, l)
-#define CAMEL_IMAP_FOLDER_UNLOCK(f, l)
-#endif
-
-struct _CamelImapWrapperPrivate {
-#ifdef ENABLE_THREADS
- GMutex *lock;
-#endif
-};
-
-#ifdef ENABLE_THREADS
-#define CAMEL_IMAP_WRAPPER_LOCK(f, l) (g_mutex_lock(((CamelImapWrapper *)f)->priv->l))
-#define CAMEL_IMAP_WRAPPER_UNLOCK(f, l) (g_mutex_unlock(((CamelImapWrapper *)f)->priv->l))
-#else
-#define CAMEL_IMAP_WRAPPER_LOCK(f, l)
-#define CAMEL_IMAP_WRAPPER_UNLOCK(f, l)
-#endif
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_IMAP_PRIVATE_H */
-
diff --git a/camel/providers/imap/camel-imap-provider.c b/camel/providers/imap/camel-imap-provider.c
deleted file mode 100644
index abda8f89a0..0000000000
--- a/camel/providers/imap/camel-imap-provider.c
+++ /dev/null
@@ -1,158 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-imap-provider.c: imap provider registration code */
-
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-#include "camel-imap-store.h"
-#include "camel-provider.h"
-#include "camel-session.h"
-#include "camel-url.h"
-#include "camel-sasl.h"
-
-static void add_hash (guint *hash, char *s);
-static guint imap_url_hash (gconstpointer key);
-static gint check_equal (char *s1, char *s2);
-static gint imap_url_equal (gconstpointer a, gconstpointer b);
-
-CamelProviderConfEntry imap_conf_entries[] = {
- { CAMEL_PROVIDER_CONF_SECTION_START, "cmdsection", NULL,
- N_("Connection to Server") },
- { CAMEL_PROVIDER_CONF_CHECKBOX, "use_command", NULL,
- N_("Use custom command to connect to server"), "0" },
- { CAMEL_PROVIDER_CONF_ENTRY, "command", "use_command",
- N_("Command:"), "ssh -C -l %u %h exec /usr/sbin/imapd" },
- { CAMEL_PROVIDER_CONF_SECTION_END },
- { CAMEL_PROVIDER_CONF_SECTION_START, "mailcheck", NULL,
- N_("Checking for new mail") },
- { CAMEL_PROVIDER_CONF_CHECKBOX, "check_all", NULL,
- N_("Check for new messages in all folders"), "1" },
- { CAMEL_PROVIDER_CONF_SECTION_END },
- { CAMEL_PROVIDER_CONF_SECTION_START, "folders", NULL,
- N_("Folders") },
- { CAMEL_PROVIDER_CONF_CHECKBOX, "use_lsub", NULL,
- N_("Show only subscribed folders"), "1" },
- { CAMEL_PROVIDER_CONF_CHECKBOX, "override_namespace", NULL,
- N_("Override server-supplied folder namespace"), "0" },
- { CAMEL_PROVIDER_CONF_ENTRY, "namespace", "override_namespace",
- N_("Namespace") },
- { CAMEL_PROVIDER_CONF_SECTION_END },
- { CAMEL_PROVIDER_CONF_CHECKBOX, "filter", NULL,
- N_("Apply filters to new messages in INBOX on this server"), "0" },
- { CAMEL_PROVIDER_CONF_CHECKBOX, "offline_sync", NULL,
- N_("Automatically synchronize remote mail locally"), "0" },
- { CAMEL_PROVIDER_CONF_END }
-};
-
-static CamelProvider imap_provider = {
- "imap",
- N_("IMAP"),
-
- N_("For reading and storing mail on IMAP servers."),
-
- "mail",
-
- CAMEL_PROVIDER_IS_REMOTE | CAMEL_PROVIDER_IS_SOURCE |
- CAMEL_PROVIDER_IS_STORAGE | CAMEL_PROVIDER_SUPPORTS_SSL,
-
- CAMEL_URL_NEED_USER | CAMEL_URL_NEED_HOST | CAMEL_URL_ALLOW_AUTH,
-
- imap_conf_entries,
-
- /* ... */
-};
-
-CamelServiceAuthType camel_imap_password_authtype = {
- N_("Password"),
-
- N_("This option will connect to the IMAP server using a "
- "plaintext password."),
-
- "",
- TRUE
-};
-
-void
-camel_provider_module_init (CamelSession *session)
-{
- imap_provider.object_types[CAMEL_PROVIDER_STORE] =
- camel_imap_store_get_type ();
- imap_provider.url_hash = imap_url_hash;
- imap_provider.url_equal = imap_url_equal;
- imap_provider.authtypes = camel_sasl_authtype_list (FALSE);
- imap_provider.authtypes = g_list_prepend (imap_provider.authtypes,
- &camel_imap_password_authtype);
-
- camel_session_register_provider (session, &imap_provider);
-}
-
-static void
-add_hash (guint *hash, char *s)
-{
- if (s)
- *hash ^= g_str_hash(s);
-}
-
-static guint
-imap_url_hash (gconstpointer key)
-{
- const CamelURL *u = (CamelURL *)key;
- guint hash = 0;
-
- add_hash (&hash, u->user);
- add_hash (&hash, u->authmech);
- add_hash (&hash, u->host);
- hash ^= u->port;
-
- return hash;
-}
-
-static gint
-check_equal (char *s1, char *s2)
-{
- if (s1 == NULL) {
- if (s2 == NULL)
- return TRUE;
- else
- return FALSE;
- }
-
- if (s2 == NULL)
- return FALSE;
-
- return strcmp (s1, s2) == 0;
-}
-
-static gint
-imap_url_equal (gconstpointer a, gconstpointer b)
-{
- const CamelURL *u1 = a, *u2 = b;
-
- return check_equal (u1->user, u2->user)
- && check_equal (u1->authmech, u2->authmech)
- && check_equal (u1->host, u2->host)
- && u1->port == u2->port;
-}
diff --git a/camel/providers/imap/camel-imap-search.c b/camel/providers/imap/camel-imap-search.c
deleted file mode 100644
index eacb839cb2..0000000000
--- a/camel/providers/imap/camel-imap-search.c
+++ /dev/null
@@ -1,499 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-imap-search.c: IMAP folder search */
-
-/*
- * Authors:
- * Dan Winship <danw@ximian.com>
- * Michael Zucchi <notzed@ximian.com>
- *
- * Copyright 2000, 2001, 2002 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-
-#include "camel-imap-command.h"
-#include "camel-imap-folder.h"
-#include "camel-imap-store.h"
-#include "camel-imap-search.h"
-#include "camel-imap-private.h"
-#include "camel-imap-utils.h"
-#include "camel-imap-summary.h"
-
-#include "e-util/md5-utils.h" /* md5 hash building */
-#include "camel-mime-utils.h" /* base64 encoding */
-
-#include "camel-seekable-stream.h"
-#include "camel-search-private.h"
-
-#define d(x)
-
-/*
- File is:
- BODY (as in body search)
- Last uid when search performed
- termcount: number of search terms
- matchcount: number of matches
- term0, term1 ...
- match0, match1, match2, ...
-*/
-
-/* size of in-memory cache */
-#define MATCH_CACHE_SIZE (32)
-
-/* Also takes care of 'endianness' file magic */
-#define MATCH_MARK (('B' << 24) | ('O' << 16) | ('D' << 8) | 'Y')
-
-/* on-disk header, in native endianness format, matches follow */
-struct _match_header {
- guint32 mark;
- guint32 validity; /* uidvalidity for this folder */
- guint32 lastuid;
- guint32 termcount;
- guint32 matchcount;
-};
-
-/* in-memory record */
-struct _match_record {
- struct _match_record *next;
- struct _match_record *prev;
-
- char hash[17];
-
- guint32 lastuid;
- guint32 validity;
-
- unsigned int termcount;
- char **terms;
- GArray *matches;
-};
-
-
-static void free_match(CamelImapSearch *is, struct _match_record *mr);
-static ESExpResult *imap_body_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
-
-static CamelFolderSearchClass *imap_search_parent_class;
-
-static void
-camel_imap_search_class_init (CamelImapSearchClass *camel_imap_search_class)
-{
- /* virtual method overload */
- CamelFolderSearchClass *camel_folder_search_class =
- CAMEL_FOLDER_SEARCH_CLASS (camel_imap_search_class);
-
- imap_search_parent_class = (CamelFolderSearchClass *)camel_type_get_global_classfuncs (camel_folder_search_get_type ());
-
- /* virtual method overload */
- camel_folder_search_class->body_contains = imap_body_contains;
-}
-
-static void
-camel_imap_search_init(CamelImapSearch *is)
-{
- e_dlist_init(&is->matches);
- is->matches_hash = g_hash_table_new(g_str_hash, g_str_equal);
- is->matches_count = 0;
- is->lastuid = 0;
-}
-
-static void
-camel_imap_search_finalise(CamelImapSearch *is)
-{
- struct _match_record *mr;
-
- while ( (mr = (struct _match_record *)e_dlist_remtail(&is->matches)) )
- free_match(is, mr);
- g_hash_table_destroy(is->matches_hash);
- if (is->cache)
- camel_object_unref((CamelObject *)is->cache);
-}
-
-CamelType
-camel_imap_search_get_type (void)
-{
- static CamelType camel_imap_search_type = CAMEL_INVALID_TYPE;
-
- if (camel_imap_search_type == CAMEL_INVALID_TYPE) {
- camel_imap_search_type = camel_type_register (
- CAMEL_FOLDER_SEARCH_TYPE, "CamelImapSearch",
- sizeof (CamelImapSearch),
- sizeof (CamelImapSearchClass),
- (CamelObjectClassInitFunc) camel_imap_search_class_init, NULL,
- (CamelObjectInitFunc) camel_imap_search_init,
- (CamelObjectFinalizeFunc) camel_imap_search_finalise);
- }
-
- return camel_imap_search_type;
-}
-
-/**
- * camel_imap_search_new:
- *
- * Return value: A new CamelImapSearch widget.
- **/
-CamelFolderSearch *
-camel_imap_search_new (const char *cachedir)
-{
- CamelFolderSearch *new = CAMEL_FOLDER_SEARCH (camel_object_new (camel_imap_search_get_type ()));
- CamelImapSearch *is = (CamelImapSearch *)new;
-
- camel_folder_search_construct (new);
-
- is->cache = camel_data_cache_new(cachedir, 0, NULL);
- if (is->cache) {
- /* Expire entries after 14 days of inactivity */
- camel_data_cache_set_expire_access(is->cache, 60*60*24*14);
- }
-
- return new;
-}
-
-
-static void
-hash_match(char hash[17], int argc, struct _ESExpResult **argv)
-{
- MD5Context ctx;
- unsigned char digest[16];
- unsigned int state = 0, save = 0;
- int i;
-
- md5_init(&ctx);
- for (i=0;i<argc;i++) {
- if (argv[i]->type == ESEXP_RES_STRING)
- md5_update(&ctx, argv[i]->value.string, strlen(argv[i]->value.string));
- }
- md5_final(&ctx, digest);
-
- camel_base64_encode_close(digest, 12, FALSE, hash, &state, &save);
-
- for (i=0;i<16;i++) {
- if (hash[i] == '+')
- hash[i] = ',';
- if (hash[i] == '/')
- hash[i] = '_';
- }
-
- hash[16] = 0;
-}
-
-static int
-save_match(CamelImapSearch *is, struct _match_record *mr)
-{
- guint32 mark = MATCH_MARK;
- int ret = 0;
- struct _match_header header;
- CamelStream *stream;
-
- /* since its a cache, doesn't matter if it doesn't save, at least we have the in-memory cache
- for this session */
- if (is->cache == NULL)
- return -1;
-
- stream = camel_data_cache_add(is->cache, "search/body-contains", mr->hash, NULL);
- if (stream == NULL)
- return -1;
-
- d(printf("Saving search cache entry to '%s': %s\n", mr->hash, mr->terms[0]));
-
- /* we write the whole thing, then re-write the header magic, saves fancy sync code */
- memcpy(&header.mark, " ", 4);
- header.termcount = 0;
- header.matchcount = mr->matches->len;
- header.lastuid = mr->lastuid;
- header.validity = mr->validity;
-
- if (camel_stream_write(stream, (char *)&header, sizeof(header)) != sizeof(header)
- || camel_stream_write(stream, mr->matches->data, mr->matches->len*sizeof(guint32)) != mr->matches->len*sizeof(guint32)
- || camel_seekable_stream_seek((CamelSeekableStream *)stream, 0, CAMEL_STREAM_SET) == -1
- || camel_stream_write(stream, (char *)&mark, sizeof(mark)) != sizeof(mark)) {
- d(printf(" saving failed, removing cache entry\n"));
- camel_data_cache_remove(is->cache, "search/body-contains", mr->hash, NULL);
- ret = -1;
- }
-
- camel_object_unref((CamelObject *)stream);
- return ret;
-}
-
-static void
-free_match(CamelImapSearch *is, struct _match_record *mr)
-{
- int i;
-
- for (i=0;i<mr->termcount;i++)
- g_free(mr->terms[i]);
- g_free(mr->terms);
- g_array_free(mr->matches, TRUE);
- g_free(mr);
-}
-
-static struct _match_record *
-load_match(CamelImapSearch *is, char hash[17], int argc, struct _ESExpResult **argv)
-{
- struct _match_record *mr;
- CamelStream *stream = NULL;
- struct _match_header header;
- int i;
-
- mr = g_malloc0(sizeof(*mr));
- mr->matches = g_array_new(0, 0, sizeof(guint32));
- g_assert(strlen(hash) == 16);
- strcpy(mr->hash, hash);
- mr->terms = g_malloc0(sizeof(mr->terms[0]) * argc);
- for (i=0;i<argc;i++) {
- if (argv[i]->type == ESEXP_RES_STRING) {
- mr->termcount++;
- mr->terms[i] = g_strdup(argv[i]->value.string);
- }
- }
-
- d(printf("Loading search cache entry to '%s': %s\n", mr->hash, mr->terms[0]));
-
- memset(&header, 0, sizeof(header));
- if (is->cache)
- stream = camel_data_cache_get(is->cache, "search/body-contains", mr->hash, NULL);
- if (stream != NULL) {
- /* 'cause i'm gonna be lazy, i'm going to have the termcount == 0 for now,
- and not load or save them since i can't think of a nice way to do it, the hash
- should be sufficient to key it */
- /* This check should also handle endianness changes, we just throw away
- the data (its only a cache) */
- if (camel_stream_read(stream, (char *)&header, sizeof(header)) == sizeof(header)
- && header.validity == is->validity
- && header.mark == MATCH_MARK
- && header.termcount == 0) {
- d(printf(" found %d matches\n", header.matchcount));
- g_array_set_size(mr->matches, header.matchcount);
- camel_stream_read(stream, mr->matches->data, sizeof(guint32)*header.matchcount);
- } else {
- d(printf(" file format invalid/validity changed\n"));
- memset(&header, 0, sizeof(header));
- }
- camel_object_unref((CamelObject *)stream);
- } else {
- d(printf(" no cache entry found\n"));
- }
-
- mr->validity = header.validity;
- if (mr->validity != is->validity)
- mr->lastuid = 0;
- else
- mr->lastuid = header.lastuid;
-
- return mr;
-}
-
-static int
-sync_match(CamelImapSearch *is, struct _match_record *mr)
-{
- char *p, *result, *lasts = NULL;
- CamelImapResponse *response = NULL;
- guint32 uid;
- CamelFolder *folder = ((CamelFolderSearch *)is)->folder;
- CamelImapStore *store = (CamelImapStore *)folder->parent_store;
- struct _camel_search_words *words;
- GString *search;
- int i;
-
- if (mr->lastuid >= is->lastuid && mr->validity == is->validity)
- return 0;
-
- d(printf ("updating match record for uid's %d:%d\n", mr->lastuid+1, is->lastuid));
-
- /* TODO: Handle multiple search terms */
-
- /* This handles multiple search words within a single term */
- words = camel_search_words_split (mr->terms[0]);
- search = g_string_new ("");
- g_string_append_printf (search, "UID %d:%d", mr->lastuid + 1, is->lastuid);
- for (i = 0; i < words->len; i++) {
- char *w = words->words[i]->word, c;
-
- g_string_append_printf (search, " BODY \"");
- while ((c = *w++)) {
- if (c == '\\' || c == '"')
- g_string_append_c (search, '\\');
- g_string_append_c (search, c);
- }
- g_string_append_c (search, '"');
- }
- camel_search_words_free (words);
-
- /* We only try search using utf8 if its non us-ascii text? */
- if ((words->type & CAMEL_SEARCH_WORD_8BIT) && (store->capabilities & IMAP_CAPABILITY_utf8_search)) {
- response = camel_imap_command (store, folder, NULL,
- "UID SEARCH CHARSET UTF-8 %s", search->str);
- /* We can't actually tell if we got a NO response, so assume always */
- if (response == NULL)
- store->capabilities &= ~IMAP_CAPABILITY_utf8_search;
- }
- if (response == NULL)
- response = camel_imap_command (store, folder, NULL,
- "UID SEARCH %s", search->str);
- g_string_free(search, TRUE);
-
- if (!response)
- return -1;
- result = camel_imap_response_extract (store, response, "SEARCH", NULL);
- if (!result)
- return -1;
-
- p = result + sizeof ("* SEARCH");
- for (p = strtok_r (p, " ", &lasts); p; p = strtok_r (NULL, " ", &lasts)) {
- uid = strtoul(p, NULL, 10);
- g_array_append_vals(mr->matches, &uid, 1);
- }
- g_free(result);
-
- mr->validity = is->validity;
- mr->lastuid = is->lastuid;
- save_match(is, mr);
-
- return 0;
-}
-
-static struct _match_record *
-get_match(CamelImapSearch *is, int argc, struct _ESExpResult **argv)
-{
- char hash[17];
- struct _match_record *mr;
-
- hash_match(hash, argc, argv);
-
- mr = g_hash_table_lookup(is->matches_hash, hash);
- if (mr == NULL) {
- while (is->matches_count >= MATCH_CACHE_SIZE) {
- mr = (struct _match_record *)e_dlist_remtail(&is->matches);
- if (mr) {
- printf("expiring match '%s' (%s)\n", mr->hash, mr->terms[0]);
- g_hash_table_remove(is->matches_hash, mr->hash);
- free_match(is, mr);
- is->matches_count--;
- } else {
- is->matches_count = 0;
- }
- }
- mr = load_match(is, hash, argc, argv);
- g_hash_table_insert(is->matches_hash, mr->hash, mr);
- is->matches_count++;
- } else {
- e_dlist_remove((EDListNode *)mr);
- }
-
- e_dlist_addhead(&is->matches, (EDListNode *)mr);
-
- /* what about offline mode? */
- /* We could cache those results too, or should we cache them elsewhere? */
- sync_match(is, mr);
-
- return mr;
-}
-
-static ESExpResult *
-imap_body_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s)
-{
- CamelImapStore *store = CAMEL_IMAP_STORE (s->folder->parent_store);
- CamelImapSearch *is = (CamelImapSearch *)s;
- char *uid;
- ESExpResult *r;
- CamelMessageInfo *info;
- GHashTable *uid_hash = NULL;
- GPtrArray *array;
- int i, j;
- struct _match_record *mr;
- guint32 uidn, *uidp;
-
- d(printf("Performing body search '%s'\n", argv[0]->value.string));
-
- /* TODO: Cache offline searches too? */
-
- /* If offline, search using the parent class, which can handle this manually */
- if (!camel_disco_store_check_online (CAMEL_DISCO_STORE (store), NULL))
- return imap_search_parent_class->body_contains(f, argc, argv, s);
-
- /* optimise the match "" case - match everything */
- if (argc == 1 && argv[0]->value.string[0] == '\0') {
- if (s->current) {
- r = e_sexp_result_new(f, ESEXP_RES_BOOL);
- r->value.bool = TRUE;
- } else {
- r = e_sexp_result_new(f, ESEXP_RES_ARRAY_PTR);
- r->value.ptrarray = g_ptr_array_new ();
- for (i = 0; i < s->summary->len; i++) {
- info = g_ptr_array_index(s->summary, i);
- g_ptr_array_add(r->value.ptrarray, (char *)camel_message_info_uid(info));
- }
- }
- } else if (argc == 0 || s->summary->len == 0) {
- /* nothing to match case, do nothing (should be handled higher up?) */
- if (s->current) {
- r = e_sexp_result_new(f, ESEXP_RES_BOOL);
- r->value.bool = FALSE;
- } else {
- r = e_sexp_result_new(f, ESEXP_RES_ARRAY_PTR);
- r->value.ptrarray = g_ptr_array_new ();
- }
- } else {
- int truth = FALSE;
-
- /* setup lastuid/validity for synchronising */
- info = g_ptr_array_index(s->summary, s->summary->len-1);
- is->lastuid = strtoul(camel_message_info_uid(info), NULL, 10);
- is->validity = ((CamelImapSummary *)(s->folder->summary))->validity;
-
- mr = get_match(is, argc, argv);
-
- if (s->current) {
- uidn = strtoul(camel_message_info_uid(s->current), NULL, 10);
- uidp = (guint32 *)mr->matches->data;
- j = mr->matches->len;
- for (i=0;i<j && !truth;i++)
- truth = *uidp++ == uidn;
- r = e_sexp_result_new(f, ESEXP_RES_BOOL);
- r->value.bool = truth;
- } else {
- r = e_sexp_result_new(f, ESEXP_RES_ARRAY_PTR);
- array = r->value.ptrarray = g_ptr_array_new();
-
- /* We use a hash to map the uid numbers to uid strings as required by the search api */
- /* We use the summary's strings so we dont need to alloc more */
- uid_hash = g_hash_table_new(NULL, NULL);
- for (i = 0; i < s->summary->len; i++) {
- info = s->summary->pdata[i];
- uid = (char *)camel_message_info_uid(info);
- uidn = strtoul(uid, NULL, 10);
- g_hash_table_insert(uid_hash, GUINT_TO_POINTER(uidn), uid);
- }
-
- uidp = (guint32 *)mr->matches->data;
- j = mr->matches->len;
- for (i=0;i<j && !truth;i++) {
- uid = g_hash_table_lookup(uid_hash, GUINT_TO_POINTER(*uidp++));
- if (uid)
- g_ptr_array_add(array, uid);
- }
-
- g_hash_table_destroy(uid_hash);
- }
- }
-
- return r;
-}
diff --git a/camel/providers/imap/camel-imap-search.h b/camel/providers/imap/camel-imap-search.h
deleted file mode 100644
index 7664c4c2ed..0000000000
--- a/camel/providers/imap/camel-imap-search.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-imap-search.h: IMAP folder search */
-
-/*
- * Authors:
- * Dan Winship <danw@ximian.com>
- *
- * Copyright 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef _CAMEL_IMAP_SEARCH_H
-#define _CAMEL_IMAP_SEARCH_H
-
-#include <camel/camel-folder-search.h>
-#include <e-util/e-msgport.h>
-#include <camel/camel-data-cache.h>
-
-#define CAMEL_IMAP_SEARCH_TYPE (camel_imap_search_get_type ())
-#define CAMEL_IMAP_SEARCH(obj) CAMEL_CHECK_CAST (obj, camel_imap_search_get_type (), CamelImapSearch)
-#define CAMEL_IMAP_SEARCH_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_imap_search_get_type (), CamelImapSearchClass)
-#define CAMEL_IS_IMAP_SEARCH(obj) CAMEL_CHECK_TYPE (obj, camel_imap_search_get_type ())
-
-typedef struct _CamelImapSearchClass CamelImapSearchClass;
-
-struct _CamelImapSearch {
- CamelFolderSearch parent;
-
- guint32 lastuid; /* current 'last uid' for the folder */
- guint32 validity; /* validity of the current folder */
-
- CamelDataCache *cache; /* disk-cache for searches */
-
- /* cache of body search matches */
- unsigned int matches_count;
- EDList matches;
- GHashTable *matches_hash;
-};
-
-struct _CamelImapSearchClass {
- CamelFolderSearchClass parent_class;
-
-};
-
-CamelType camel_imap_search_get_type (void);
-CamelFolderSearch *camel_imap_search_new (const char *cachedir);
-
-#endif /* ! _CAMEL_IMAP_SEARCH_H */
diff --git a/camel/providers/imap/camel-imap-store-summary.c b/camel/providers/imap/camel-imap-store-summary.c
deleted file mode 100644
index 32530d3c3f..0000000000
--- a/camel/providers/imap/camel-imap-store-summary.c
+++ /dev/null
@@ -1,619 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2002 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <unistd.h>
-#include <ctype.h>
-#include <string.h>
-#include <errno.h>
-#include <stdlib.h>
-
-#include "camel-imap-store-summary.h"
-
-#include "camel-file-utils.h"
-
-#include "e-util/md5-utils.h"
-#include "e-util/e-memory.h"
-
-#include "camel-private.h"
-#include "camel-utf8.h"
-
-#define d(x)
-#define io(x) /* io debug */
-
-#define CAMEL_IMAP_STORE_SUMMARY_VERSION_0 (0)
-
-#define CAMEL_IMAP_STORE_SUMMARY_VERSION (0)
-
-#define _PRIVATE(o) (((CamelImapStoreSummary *)(o))->priv)
-
-static int summary_header_load(CamelStoreSummary *, FILE *);
-static int summary_header_save(CamelStoreSummary *, FILE *);
-
-/*static CamelStoreInfo * store_info_new(CamelStoreSummary *, const char *);*/
-static CamelStoreInfo * store_info_load(CamelStoreSummary *, FILE *);
-static int store_info_save(CamelStoreSummary *, FILE *, CamelStoreInfo *);
-static void store_info_free(CamelStoreSummary *, CamelStoreInfo *);
-
-static const char *store_info_string(CamelStoreSummary *, const CamelStoreInfo *, int);
-static void store_info_set_string(CamelStoreSummary *, CamelStoreInfo *, int, const char *);
-
-static void camel_imap_store_summary_class_init (CamelImapStoreSummaryClass *klass);
-static void camel_imap_store_summary_init (CamelImapStoreSummary *obj);
-static void camel_imap_store_summary_finalise (CamelObject *obj);
-
-static CamelStoreSummaryClass *camel_imap_store_summary_parent;
-
-static void
-camel_imap_store_summary_class_init (CamelImapStoreSummaryClass *klass)
-{
- CamelStoreSummaryClass *ssklass = (CamelStoreSummaryClass *)klass;
-
- ssklass->summary_header_load = summary_header_load;
- ssklass->summary_header_save = summary_header_save;
-
- /*ssklass->store_info_new = store_info_new;*/
- ssklass->store_info_load = store_info_load;
- ssklass->store_info_save = store_info_save;
- ssklass->store_info_free = store_info_free;
-
- ssklass->store_info_string = store_info_string;
- ssklass->store_info_set_string = store_info_set_string;
-}
-
-static void
-camel_imap_store_summary_init (CamelImapStoreSummary *s)
-{
- /*struct _CamelImapStoreSummaryPrivate *p;
-
- p = _PRIVATE(s) = g_malloc0(sizeof(*p));*/
-
- ((CamelStoreSummary *)s)->store_info_size = sizeof(CamelImapStoreInfo);
- s->version = CAMEL_IMAP_STORE_SUMMARY_VERSION;
-}
-
-static void
-camel_imap_store_summary_finalise (CamelObject *obj)
-{
- /*struct _CamelImapStoreSummaryPrivate *p;*/
- /*CamelImapStoreSummary *s = (CamelImapStoreSummary *)obj;*/
-
- /*p = _PRIVATE(obj);
- g_free(p);*/
-}
-
-CamelType
-camel_imap_store_summary_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- camel_imap_store_summary_parent = (CamelStoreSummaryClass *)camel_store_summary_get_type();
- type = camel_type_register((CamelType)camel_imap_store_summary_parent, "CamelImapStoreSummary",
- sizeof (CamelImapStoreSummary),
- sizeof (CamelImapStoreSummaryClass),
- (CamelObjectClassInitFunc) camel_imap_store_summary_class_init,
- NULL,
- (CamelObjectInitFunc) camel_imap_store_summary_init,
- (CamelObjectFinalizeFunc) camel_imap_store_summary_finalise);
- }
-
- return type;
-}
-
-/**
- * camel_imap_store_summary_new:
- *
- * Create a new CamelImapStoreSummary object.
- *
- * Return value: A new CamelImapStoreSummary widget.
- **/
-CamelImapStoreSummary *
-camel_imap_store_summary_new (void)
-{
- CamelImapStoreSummary *new = CAMEL_IMAP_STORE_SUMMARY ( camel_object_new (camel_imap_store_summary_get_type ()));
-
- return new;
-}
-
-/**
- * camel_imap_store_summary_full_name:
- * @s:
- * @path:
- *
- * Retrieve a summary item by full name.
- *
- * A referenced to the summary item is returned, which may be
- * ref'd or free'd as appropriate.
- *
- * Return value: The summary item, or NULL if the @full_name name
- * is not available.
- * It must be freed using camel_store_summary_info_free().
- **/
-CamelImapStoreInfo *
-camel_imap_store_summary_full_name(CamelImapStoreSummary *s, const char *full_name)
-{
- int count, i;
- CamelImapStoreInfo *info;
-
- count = camel_store_summary_count((CamelStoreSummary *)s);
- for (i=0;i<count;i++) {
- info = (CamelImapStoreInfo *)camel_store_summary_index((CamelStoreSummary *)s, i);
- if (info) {
- if (strcmp(info->full_name, full_name) == 0)
- return info;
- camel_store_summary_info_free((CamelStoreSummary *)s, (CamelStoreInfo *)info);
- }
- }
-
- return NULL;
-}
-
-char *
-camel_imap_store_summary_full_to_path(CamelImapStoreSummary *s, const char *full_name, char dir_sep)
-{
- char *path, *p;
- int c;
- const char *f;
-
- if (dir_sep != '/') {
- p = path = alloca(strlen(full_name)*3+1);
- f = full_name;
- while ( (c = *f++ & 0xff) ) {
- if (c == dir_sep)
- *p++ = '/';
- else if (c == '/' || c == '%')
- p += sprintf(p, "%%%02X", c);
- else
- *p++ = c;
- }
- *p = 0;
- } else
- path = (char *)full_name;
-
- return camel_utf7_utf8(path);
-}
-
-static guint32 hexnib(guint32 c)
-{
- if (c >= '0' && c <= '9')
- return c-'0';
- else if (c>='A' && c <= 'Z')
- return c-'A'+10;
- else
- return 0;
-}
-
-char *
-camel_imap_store_summary_path_to_full(CamelImapStoreSummary *s, const char *path, char dir_sep)
-{
- unsigned char *full, *f;
- guint32 c, v = 0;
- const char *p;
- int state=0;
- char *subpath, *last = NULL;
- CamelStoreInfo *si;
- CamelImapStoreNamespace *ns;
-
- /* check to see if we have a subpath of path already defined */
- subpath = alloca(strlen(path)+1);
- strcpy(subpath, path);
- do {
- si = camel_store_summary_path((CamelStoreSummary *)s, subpath);
- if (si == NULL) {
- last = strrchr(subpath, '/');
- if (last)
- *last = 0;
- }
- } while (si == NULL && last);
-
- /* path is already present, use the raw version we have */
- if (si && strlen(subpath) == strlen(path)) {
- f = g_strdup(camel_imap_store_info_full_name(s, si));
- camel_store_summary_info_free((CamelStoreSummary *)s, si);
- return f;
- }
-
- ns = camel_imap_store_summary_namespace_find_path(s, path);
-
- f = full = alloca(strlen(path)*2+1);
- if (si)
- p = path + strlen(subpath);
- else if (ns)
- p = path + strlen(ns->path);
- else
- p = path;
-
- while ( (c = camel_utf8_getc((const unsigned char **)&p)) ) {
- switch(state) {
- case 0:
- if (c == '%')
- state = 1;
- else {
- if (c == '/')
- c = dir_sep;
- camel_utf8_putc(&f, c);
- }
- break;
- case 1:
- state = 2;
- v = hexnib(c)<<4;
- break;
- case 2:
- state = 0;
- v |= hexnib(c);
- camel_utf8_putc(&f, v);
- break;
- }
- }
- camel_utf8_putc(&f, c);
-
- /* merge old path part if required */
- f = camel_utf8_utf7(full);
- if (si) {
- full = g_strdup_printf("%s%s", camel_imap_store_info_full_name(s, si), f);
- g_free(f);
- camel_store_summary_info_free((CamelStoreSummary *)s, si);
- f = full;
- } else if (ns) {
- full = g_strdup_printf("%s%s", ns->full_name, f);
- g_free(f);
- f = full;
- }
-
- return f;
-}
-
-CamelImapStoreInfo *
-camel_imap_store_summary_add_from_full(CamelImapStoreSummary *s, const char *full, char dir_sep)
-{
- CamelImapStoreInfo *info;
- char *pathu8, *prefix;
- int len;
- char *full_name;
- CamelImapStoreNamespace *ns;
-
- d(printf("adding full name '%s' '%c'\n", full, dir_sep));
-
- len = strlen(full);
- full_name = alloca(len+1);
- strcpy(full_name, full);
- if (full_name[len-1] == dir_sep)
- full_name[len-1] = 0;
-
- info = camel_imap_store_summary_full_name(s, full_name);
- if (info) {
- camel_store_summary_info_free((CamelStoreSummary *)s, (CamelStoreInfo *)info);
- d(printf(" already there\n"));
- return info;
- }
-
- ns = camel_imap_store_summary_namespace_find_full(s, full_name);
- if (ns) {
- d(printf("(found namespace for '%s' ns '%s') ", full_name, ns->path));
- len = strlen(ns->full_name);
- if (len >= strlen(full_name)) {
- pathu8 = g_strdup(ns->path);
- } else {
- if (full_name[len] == ns->sep)
- len++;
-
- prefix = camel_imap_store_summary_full_to_path(s, full_name+len, ns->sep);
- if (*ns->path) {
- pathu8 = g_strdup_printf ("%s/%s", ns->path, prefix);
- g_free (prefix);
- } else {
- pathu8 = prefix;
- }
- }
- d(printf(" (pathu8 = '%s')", pathu8));
- } else {
- d(printf("(Cannot find namespace for '%s')\n", full_name));
- pathu8 = camel_imap_store_summary_full_to_path(s, full_name, dir_sep);
- }
-
- info = (CamelImapStoreInfo *)camel_store_summary_add_from_path((CamelStoreSummary *)s, pathu8);
- if (info) {
- d(printf(" '%s' -> '%s'\n", pathu8, full_name));
- camel_store_info_set_string((CamelStoreSummary *)s, (CamelStoreInfo *)info, CAMEL_IMAP_STORE_INFO_FULL_NAME, full_name);
- } else
- d(printf(" failed\n"));
-
- return info;
-}
-
-/* should this be const? */
-/* TODO: deprecate/merge this function with path_to_full */
-char *
-camel_imap_store_summary_full_from_path(CamelImapStoreSummary *s, const char *path)
-{
- CamelImapStoreNamespace *ns;
- char *name = NULL;
-
- ns = camel_imap_store_summary_namespace_find_path(s, path);
- if (ns)
- name = camel_imap_store_summary_path_to_full(s, path, ns->sep);
-
- d(printf("looking up path %s -> %s\n", path, name?name:"not found"));
-
- return name;
-}
-
-/* TODO: this api needs some more work */
-CamelImapStoreNamespace *camel_imap_store_summary_namespace_new(CamelImapStoreSummary *s, const char *full_name, char dir_sep)
-{
- CamelImapStoreNamespace *ns;
- char *p, *o, c;
- int len;
-
- ns = g_malloc0(sizeof(*ns));
- ns->full_name = g_strdup(full_name);
- len = strlen(ns->full_name)-1;
- if (len >= 0 && ns->full_name[len] == dir_sep)
- ns->full_name[len] = 0;
- ns->sep = dir_sep;
-
- o = p = ns->path = camel_imap_store_summary_full_to_path(s, ns->full_name, dir_sep);
- while ((c = *p++)) {
- if (c != '#') {
- if (c == '/')
- c = '.';
- *o++ = c;
- }
- }
- *o = 0;
-
- return ns;
-}
-
-void camel_imap_store_summary_namespace_set(CamelImapStoreSummary *s, CamelImapStoreNamespace *ns)
-{
- static void namespace_clear(CamelStoreSummary *s);
-
- d(printf("Setting namesapce to '%s' '%c' -> '%s'\n", ns->full_name, ns->sep, ns->path));
- namespace_clear((CamelStoreSummary *)s);
- s->namespace = ns;
- camel_store_summary_touch((CamelStoreSummary *)s);
-}
-
-CamelImapStoreNamespace *
-camel_imap_store_summary_namespace_find_path(CamelImapStoreSummary *s, const char *path)
-{
- int len;
- CamelImapStoreNamespace *ns;
-
- /* NB: this currently only compares against 1 namespace, in future compare against others */
- ns = s->namespace;
- while (ns) {
- len = strlen(ns->path);
- if (len == 0
- || (strncmp(ns->path, path, len) == 0
- && (path[len] == '/' || path[len] == 0)))
- break;
- ns = NULL;
- }
-
- /* have a default? */
- return ns;
-}
-
-CamelImapStoreNamespace *
-camel_imap_store_summary_namespace_find_full(CamelImapStoreSummary *s, const char *full)
-{
- int len;
- CamelImapStoreNamespace *ns;
-
- /* NB: this currently only compares against 1 namespace, in future compare against others */
- ns = s->namespace;
- while (ns) {
- len = strlen(ns->full_name);
- d(printf("find_full: comparing namespace '%s' to name '%s'\n", ns->full_name, full));
- if (len == 0
- || (strncmp(ns->full_name, full, len) == 0
- && (full[len] == ns->sep || full[len] == 0)))
- break;
- ns = NULL;
- }
-
- /* have a default? */
- return ns;
-}
-
-static void
-namespace_free(CamelStoreSummary *s, CamelImapStoreNamespace *ns)
-{
- g_free(ns->path);
- g_free(ns->full_name);
- g_free(ns);
-}
-
-static void
-namespace_clear(CamelStoreSummary *s)
-{
- CamelImapStoreSummary *is = (CamelImapStoreSummary *)s;
-
- if (is->namespace)
- namespace_free(s, is->namespace);
- is->namespace = NULL;
-}
-
-static CamelImapStoreNamespace *
-namespace_load(CamelStoreSummary *s, FILE *in)
-{
- CamelImapStoreNamespace *ns;
- guint32 sep = '/';
-
- ns = g_malloc0(sizeof(*ns));
- if (camel_file_util_decode_string(in, &ns->path) == -1
- || camel_file_util_decode_string(in, &ns->full_name) == -1
- || camel_file_util_decode_uint32(in, &sep) == -1) {
- namespace_free(s, ns);
- ns = NULL;
- } else {
- ns->sep = sep;
- }
-
- return ns;
-}
-
-static int
-namespace_save(CamelStoreSummary *s, FILE *in, CamelImapStoreNamespace *ns)
-{
- if (camel_file_util_encode_string(in, ns->path) == -1
- || camel_file_util_encode_string(in, ns->full_name) == -1
- || camel_file_util_encode_uint32(in, (guint32)ns->sep) == -1)
- return -1;
-
- return 0;
-}
-
-static int
-summary_header_load(CamelStoreSummary *s, FILE *in)
-{
- CamelImapStoreSummary *is = (CamelImapStoreSummary *)s;
- gint32 version, capabilities, count;
-
- namespace_clear(s);
-
- if (camel_imap_store_summary_parent->summary_header_load((CamelStoreSummary *)s, in) == -1
- || camel_file_util_decode_fixed_int32(in, &version) == -1)
- return -1;
-
- is->version = version;
-
- if (version < CAMEL_IMAP_STORE_SUMMARY_VERSION_0) {
- g_warning("Store summary header version too low");
- return -1;
- }
-
- /* note file format can be expanded to contain more namespaces, but only 1 at the moment */
- if (camel_file_util_decode_fixed_int32(in, &capabilities) == -1
- || camel_file_util_decode_fixed_int32(in, &count) == -1
- || count > 1)
- return -1;
-
- is->capabilities = capabilities;
- if (count == 1) {
- if ((is->namespace = namespace_load(s, in)) == NULL)
- return -1;
- }
-
- return 0;
-}
-
-static int
-summary_header_save(CamelStoreSummary *s, FILE *out)
-{
- CamelImapStoreSummary *is = (CamelImapStoreSummary *)s;
- guint32 count;
-
- count = is->namespace?1:0;
-
- /* always write as latest version */
- if (camel_imap_store_summary_parent->summary_header_save((CamelStoreSummary *)s, out) == -1
- || camel_file_util_encode_fixed_int32(out, CAMEL_IMAP_STORE_SUMMARY_VERSION) == -1
- || camel_file_util_encode_fixed_int32(out, is->capabilities) == -1
- || camel_file_util_encode_fixed_int32(out, count) == -1)
- return -1;
-
- if (is->namespace && namespace_save(s, out, is->namespace) == -1)
- return -1;
-
- return 0;
-}
-
-static CamelStoreInfo *
-store_info_load(CamelStoreSummary *s, FILE *in)
-{
- CamelImapStoreInfo *mi;
-
- mi = (CamelImapStoreInfo *)camel_imap_store_summary_parent->store_info_load(s, in);
- if (mi) {
- if (camel_file_util_decode_string(in, &mi->full_name) == -1) {
- camel_store_summary_info_free(s, (CamelStoreInfo *)mi);
- mi = NULL;
- }
- }
-
- return (CamelStoreInfo *)mi;
-}
-
-static int
-store_info_save(CamelStoreSummary *s, FILE *out, CamelStoreInfo *mi)
-{
- CamelImapStoreInfo *isi = (CamelImapStoreInfo *)mi;
-
- if (camel_imap_store_summary_parent->store_info_save(s, out, mi) == -1
- || camel_file_util_encode_string(out, isi->full_name) == -1)
- return -1;
-
- return 0;
-}
-
-static void
-store_info_free(CamelStoreSummary *s, CamelStoreInfo *mi)
-{
- CamelImapStoreInfo *isi = (CamelImapStoreInfo *)mi;
-
- g_free(isi->full_name);
- camel_imap_store_summary_parent->store_info_free(s, mi);
-}
-
-static const char *
-store_info_string(CamelStoreSummary *s, const CamelStoreInfo *mi, int type)
-{
- CamelImapStoreInfo *isi = (CamelImapStoreInfo *)mi;
-
- /* FIXME: Locks? */
-
- g_assert (mi != NULL);
-
- switch (type) {
- case CAMEL_IMAP_STORE_INFO_FULL_NAME:
- return isi->full_name;
- default:
- return camel_imap_store_summary_parent->store_info_string(s, mi, type);
- }
-}
-
-static void
-store_info_set_string(CamelStoreSummary *s, CamelStoreInfo *mi, int type, const char *str)
-{
- CamelImapStoreInfo *isi = (CamelImapStoreInfo *)mi;
-
- g_assert(mi != NULL);
-
- switch(type) {
- case CAMEL_IMAP_STORE_INFO_FULL_NAME:
- d(printf("Set full name %s -> %s\n", isi->full_name, str));
- CAMEL_STORE_SUMMARY_LOCK(s, summary_lock);
- g_free(isi->full_name);
- isi->full_name = g_strdup(str);
- CAMEL_STORE_SUMMARY_UNLOCK(s, summary_lock);
- break;
- default:
- camel_imap_store_summary_parent->store_info_set_string(s, mi, type, str);
- break;
- }
-}
diff --git a/camel/providers/imap/camel-imap-store-summary.h b/camel/providers/imap/camel-imap-store-summary.h
deleted file mode 100644
index 0fa6be0df3..0000000000
--- a/camel/providers/imap/camel-imap-store-summary.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2002 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-
-#ifndef _CAMEL_IMAP_STORE_SUMMARY_H
-#define _CAMEL_IMAP_STORE_SUMMARY_H
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <camel/camel-object.h>
-#include <camel/camel-store-summary.h>
-
-#define CAMEL_IMAP_STORE_SUMMARY(obj) CAMEL_CHECK_CAST (obj, camel_imap_store_summary_get_type (), CamelImapStoreSummary)
-#define CAMEL_IMAP_STORE_SUMMARY_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_imap_store_summary_get_type (), CamelImapStoreSummaryClass)
-#define CAMEL_IS_IMAP_STORE_SUMMARY(obj) CAMEL_CHECK_TYPE (obj, camel_imap_store_summary_get_type ())
-
-typedef struct _CamelImapStoreSummary CamelImapStoreSummary;
-typedef struct _CamelImapStoreSummaryClass CamelImapStoreSummaryClass;
-
-typedef struct _CamelImapStoreInfo CamelImapStoreInfo;
-
-enum {
- CAMEL_IMAP_STORE_INFO_FULL_NAME = CAMEL_STORE_INFO_LAST,
- CAMEL_IMAP_STORE_INFO_LAST,
-};
-
-struct _CamelImapStoreInfo {
- CamelStoreInfo info;
- char *full_name;
-};
-
-typedef struct _CamelImapStoreNamespace CamelImapStoreNamespace;
-
-struct _CamelImapStoreNamespace {
- char *path; /* display path */
- char *full_name; /* real name */
- char sep; /* directory separator */
-};
-
-struct _CamelImapStoreSummary {
- CamelStoreSummary summary;
-
- struct _CamelImapStoreSummaryPrivate *priv;
-
- /* header info */
- guint32 version; /* version of base part of file */
- guint32 capabilities;
- CamelImapStoreNamespace *namespace; /* eventually to be a list */
-};
-
-struct _CamelImapStoreSummaryClass {
- CamelStoreSummaryClass summary_class;
-};
-
-CamelType camel_imap_store_summary_get_type (void);
-CamelImapStoreSummary *camel_imap_store_summary_new (void);
-
-/* TODO: this api needs some more work, needs to support lists */
-CamelImapStoreNamespace *camel_imap_store_summary_namespace_new(CamelImapStoreSummary *s, const char *full_name, char dir_sep);
-void camel_imap_store_summary_namespace_set(CamelImapStoreSummary *s, CamelImapStoreNamespace *ns);
-CamelImapStoreNamespace *camel_imap_store_summary_namespace_find_path(CamelImapStoreSummary *s, const char *path);
-CamelImapStoreNamespace *camel_imap_store_summary_namespace_find_full(CamelImapStoreSummary *s, const char *full_name);
-
-/* converts to/from utf8 canonical nasmes */
-char *camel_imap_store_summary_full_to_path(CamelImapStoreSummary *s, const char *full_name, char dir_sep);
-char *camel_imap_store_summary_path_to_full(CamelImapStoreSummary *s, const char *path, char dir_sep);
-
-CamelImapStoreInfo *camel_imap_store_summary_full_name(CamelImapStoreSummary *s, const char *full_name);
-CamelImapStoreInfo *camel_imap_store_summary_add_from_full(CamelImapStoreSummary *s, const char *full_name, char dir_sep);
-
-/* a convenience lookup function. always use this if path known */
-char *camel_imap_store_summary_full_from_path(CamelImapStoreSummary *s, const char *path);
-
-/* helper macro's */
-#define camel_imap_store_info_full_name(s, i) (camel_store_info_string((CamelStoreSummary *)s, (const CamelStoreInfo *)i, CAMEL_IMAP_STORE_INFO_FULL_NAME))
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* ! _CAMEL_IMAP_STORE_SUMMARY_H */
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
deleted file mode 100644
index 07152eef87..0000000000
--- a/camel/providers/imap/camel-imap-store.c
+++ /dev/null
@@ -1,2845 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-imap-store.c : class for an imap store */
-
-/*
- * Authors:
- * Dan Winship <danw@ximian.com>
- * Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2000, 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <errno.h>
-
-#include "e-util/e-path.h"
-
-#include "camel-imap-store.h"
-#include "camel-imap-store-summary.h"
-#include "camel-imap-folder.h"
-#include "camel-imap-utils.h"
-#include "camel-imap-command.h"
-#include "camel-imap-summary.h"
-#include "camel-imap-message-cache.h"
-#include "camel-disco-diary.h"
-#include "camel-file-utils.h"
-#include "camel-folder.h"
-#include "camel-exception.h"
-#include "camel-session.h"
-#include "camel-stream.h"
-#include "camel-stream-buffer.h"
-#include "camel-stream-fs.h"
-#include "camel-stream-process.h"
-#include "camel-tcp-stream-raw.h"
-#include "camel-tcp-stream-ssl.h"
-#include "camel-url.h"
-#include "camel-sasl.h"
-#include "camel-utf8.h"
-#include "camel-string-utils.h"
-
-#include "camel-imap-private.h"
-#include "camel-private.h"
-
-#define d(x)
-
-/* Specified in RFC 2060 */
-#define IMAP_PORT 143
-#define SIMAP_PORT 993
-
-
-extern int camel_verbose_debug;
-
-static CamelDiscoStoreClass *parent_class = NULL;
-
-static char imap_tag_prefix = 'A';
-
-static void construct (CamelService *service, CamelSession *session,
- CamelProvider *provider, CamelURL *url,
- CamelException *ex);
-
-static int imap_setv (CamelObject *object, CamelException *ex, CamelArgV *args);
-static int imap_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args);
-
-static char *imap_get_name (CamelService *service, gboolean brief);
-
-static gboolean can_work_offline (CamelDiscoStore *disco_store);
-static gboolean imap_connect_online (CamelService *service, CamelException *ex);
-static gboolean imap_connect_offline (CamelService *service, CamelException *ex);
-static gboolean imap_disconnect_online (CamelService *service, gboolean clean, CamelException *ex);
-static gboolean imap_disconnect_offline (CamelService *service, gboolean clean, CamelException *ex);
-static void imap_noop (CamelStore *store, CamelException *ex);
-static GList *query_auth_types (CamelService *service, CamelException *ex);
-static guint hash_folder_name (gconstpointer key);
-static gint compare_folder_name (gconstpointer a, gconstpointer b);
-static CamelFolder *get_folder_online (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex);
-static CamelFolder *get_folder_offline (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex);
-static CamelFolderInfo *create_folder (CamelStore *store, const char *parent_name, const char *folder_name, CamelException *ex);
-static void delete_folder (CamelStore *store, const char *folder_name, CamelException *ex);
-static void rename_folder (CamelStore *store, const char *old_name, const char *new_name, CamelException *ex);
-static CamelFolderInfo *get_folder_info_online (CamelStore *store,
- const char *top,
- guint32 flags,
- CamelException *ex);
-static CamelFolderInfo *get_folder_info_offline (CamelStore *store,
- const char *top,
- guint32 flags,
- CamelException *ex);
-static gboolean folder_subscribed (CamelStore *store, const char *folder_name);
-static void subscribe_folder (CamelStore *store, const char *folder_name,
- CamelException *ex);
-static void unsubscribe_folder (CamelStore *store, const char *folder_name,
- CamelException *ex);
-
-static void get_folders_online (CamelImapStore *imap_store, const char *pattern,
- GPtrArray *folders, gboolean lsub, CamelException *ex);
-
-
-static void imap_folder_effectively_unsubscribed(CamelImapStore *imap_store, const char *folder_name, CamelException *ex);
-static gboolean imap_check_folder_still_extant (CamelImapStore *imap_store, const char *full_name, CamelException *ex);
-static void imap_forget_folder(CamelImapStore *imap_store, const char *folder_name, CamelException *ex);
-static void imap_set_server_level (CamelImapStore *store);
-
-static void
-camel_imap_store_class_init (CamelImapStoreClass *camel_imap_store_class)
-{
- CamelObjectClass *camel_object_class =
- CAMEL_OBJECT_CLASS (camel_imap_store_class);
- CamelServiceClass *camel_service_class =
- CAMEL_SERVICE_CLASS (camel_imap_store_class);
- CamelStoreClass *camel_store_class =
- CAMEL_STORE_CLASS (camel_imap_store_class);
- CamelDiscoStoreClass *camel_disco_store_class =
- CAMEL_DISCO_STORE_CLASS (camel_imap_store_class);
-
- parent_class = CAMEL_DISCO_STORE_CLASS (camel_type_get_global_classfuncs (camel_disco_store_get_type ()));
-
- /* virtual method overload */
- camel_object_class->setv = imap_setv;
- camel_object_class->getv = imap_getv;
-
- camel_service_class->construct = construct;
- camel_service_class->query_auth_types = query_auth_types;
- camel_service_class->get_name = imap_get_name;
-
- camel_store_class->hash_folder_name = hash_folder_name;
- camel_store_class->compare_folder_name = compare_folder_name;
- camel_store_class->create_folder = create_folder;
- camel_store_class->delete_folder = delete_folder;
- camel_store_class->rename_folder = rename_folder;
- camel_store_class->free_folder_info = camel_store_free_folder_info_full;
- camel_store_class->folder_subscribed = folder_subscribed;
- camel_store_class->subscribe_folder = subscribe_folder;
- camel_store_class->unsubscribe_folder = unsubscribe_folder;
- camel_store_class->noop = imap_noop;
-
- camel_disco_store_class->can_work_offline = can_work_offline;
- camel_disco_store_class->connect_online = imap_connect_online;
- camel_disco_store_class->connect_offline = imap_connect_offline;
- camel_disco_store_class->disconnect_online = imap_disconnect_online;
- camel_disco_store_class->disconnect_offline = imap_disconnect_offline;
- camel_disco_store_class->get_folder_online = get_folder_online;
- camel_disco_store_class->get_folder_offline = get_folder_offline;
- camel_disco_store_class->get_folder_resyncing = get_folder_online;
- camel_disco_store_class->get_folder_info_online = get_folder_info_online;
- camel_disco_store_class->get_folder_info_offline = get_folder_info_offline;
- camel_disco_store_class->get_folder_info_resyncing = get_folder_info_online;
-}
-
-static gboolean
-free_key (gpointer key, gpointer value, gpointer user_data)
-{
- g_free (key);
- return TRUE;
-}
-
-static void
-camel_imap_store_finalize (CamelObject *object)
-{
- CamelImapStore *imap_store = CAMEL_IMAP_STORE (object);
-
- /* This frees current_folder, folders, authtypes, streams, and namespace. */
- camel_service_disconnect((CamelService *)imap_store, TRUE, NULL);
-
- if (imap_store->summary) {
- camel_store_summary_save((CamelStoreSummary *)imap_store->summary);
- camel_object_unref(imap_store->summary);
- }
-
- if (imap_store->base_url)
- g_free (imap_store->base_url);
- if (imap_store->storage_path)
- g_free (imap_store->storage_path);
-
-#ifdef ENABLE_THREADS
- e_thread_destroy (imap_store->async_thread);
-#endif
-}
-
-#ifdef ENABLE_THREADS
-static void async_destroy(EThread *et, EMsg *em, void *data)
-{
- CamelImapStore *imap_store = data;
- CamelImapMsg *msg = (CamelImapMsg *)em;
-
- if (msg->free)
- msg->free (imap_store, msg);
-
- g_free (msg);
-}
-
-static void async_received(EThread *et, EMsg *em, void *data)
-{
- CamelImapStore *imap_store = data;
- CamelImapMsg *msg = (CamelImapMsg *)em;
-
- if (msg->receive)
- msg->receive(imap_store, msg);
-}
-
-CamelImapMsg *camel_imap_msg_new(void (*receive)(CamelImapStore *store, struct _CamelImapMsg *m),
- void (*free)(CamelImapStore *store, struct _CamelImapMsg *m),
- size_t size)
-{
- CamelImapMsg *msg;
-
- g_assert(size >= sizeof(*msg));
-
- msg = g_malloc0(size);
- msg->receive = receive;
- msg->free = free;
-
- return msg;
-}
-
-void camel_imap_msg_queue(CamelImapStore *store, CamelImapMsg *msg)
-{
- e_thread_put(store->async_thread, (EMsg *)msg);
-}
-
-#endif
-
-static void
-camel_imap_store_init (gpointer object, gpointer klass)
-{
- CamelImapStore *imap_store = CAMEL_IMAP_STORE (object);
-
- imap_store->istream = NULL;
- imap_store->ostream = NULL;
-
- imap_store->dir_sep = '\0';
- imap_store->current_folder = NULL;
- imap_store->connected = FALSE;
- imap_store->preauthed = FALSE;
-
- imap_store->tag_prefix = imap_tag_prefix++;
- if (imap_tag_prefix > 'Z')
- imap_tag_prefix = 'A';
-
-#ifdef ENABLE_THREADS
- imap_store->async_thread = e_thread_new(E_THREAD_QUEUE);
- e_thread_set_msg_destroy(imap_store->async_thread, async_destroy, imap_store);
- e_thread_set_msg_received(imap_store->async_thread, async_received, imap_store);
-#endif /* ENABLE_THREADS */
-}
-
-CamelType
-camel_imap_store_get_type (void)
-{
- static CamelType camel_imap_store_type = CAMEL_INVALID_TYPE;
-
- if (camel_imap_store_type == CAMEL_INVALID_TYPE) {
- camel_imap_store_type =
- camel_type_register (CAMEL_DISCO_STORE_TYPE,
- "CamelImapStore",
- sizeof (CamelImapStore),
- sizeof (CamelImapStoreClass),
- (CamelObjectClassInitFunc) camel_imap_store_class_init,
- NULL,
- (CamelObjectInitFunc) camel_imap_store_init,
- (CamelObjectFinalizeFunc) camel_imap_store_finalize);
- }
-
- return camel_imap_store_type;
-}
-
-static void
-construct (CamelService *service, CamelSession *session,
- CamelProvider *provider, CamelURL *url,
- CamelException *ex)
-{
- CamelImapStore *imap_store = CAMEL_IMAP_STORE (service);
- CamelStore *store = CAMEL_STORE (service);
- char *tmp;
- CamelURL *summary_url;
-
- CAMEL_SERVICE_CLASS (parent_class)->construct (service, session, provider, url, ex);
- if (camel_exception_is_set (ex))
- return;
-
- imap_store->storage_path = camel_session_get_storage_path (session, service, ex);
- if (!imap_store->storage_path)
- return;
-
- /* FIXME */
- imap_store->base_url = camel_url_to_string (service->url, (CAMEL_URL_HIDE_PASSWORD |
- CAMEL_URL_HIDE_PARAMS |
- CAMEL_URL_HIDE_AUTH));
-
- imap_store->parameters = 0;
- if (camel_url_get_param (url, "use_lsub"))
- store->flags |= CAMEL_STORE_SUBSCRIPTIONS;
- if (camel_url_get_param (url, "namespace")) {
- imap_store->parameters |= IMAP_PARAM_OVERRIDE_NAMESPACE;
- g_free(imap_store->namespace);
- imap_store->namespace = g_strdup (camel_url_get_param (url, "namespace"));
- }
- if (camel_url_get_param (url, "check_all"))
- imap_store->parameters |= IMAP_PARAM_CHECK_ALL;
- if (camel_url_get_param (url, "filter")) {
- imap_store->parameters |= IMAP_PARAM_FILTER_INBOX;
- store->flags |= CAMEL_STORE_FILTER_INBOX;
- }
-
- /* setup/load the store summary */
- tmp = alloca(strlen(imap_store->storage_path)+32);
- sprintf(tmp, "%s/.ev-store-summary", imap_store->storage_path);
- imap_store->summary = camel_imap_store_summary_new();
- camel_store_summary_set_filename((CamelStoreSummary *)imap_store->summary, tmp);
- summary_url = camel_url_new(imap_store->base_url, NULL);
- camel_store_summary_set_uri_base((CamelStoreSummary *)imap_store->summary, summary_url);
- camel_url_free(summary_url);
- if (camel_store_summary_load((CamelStoreSummary *)imap_store->summary) == 0) {
- CamelImapStoreSummary *is = imap_store->summary;
-
- if (is->namespace) {
- /* if namespace has changed, clear folder list */
- if (imap_store->namespace && strcmp(imap_store->namespace, is->namespace->full_name) != 0) {
- camel_store_summary_clear((CamelStoreSummary *)is);
- } else {
- imap_store->namespace = g_strdup(is->namespace->full_name);
- imap_store->dir_sep = is->namespace->sep;
- store->dir_sep = is->namespace->sep;
- }
- }
-
- imap_store->capabilities = is->capabilities;
- imap_set_server_level(imap_store);
- }
-}
-
-static int
-imap_setv (CamelObject *object, CamelException *ex, CamelArgV *args)
-{
- CamelImapStore *store = (CamelImapStore *) object;
- guint32 tag, flags;
- int i;
-
- for (i = 0; i < args->argc; i++) {
- tag = args->argv[i].tag;
-
- /* make sure this arg wasn't already handled */
- if (tag & CAMEL_ARG_IGNORE)
- continue;
-
- /* make sure this is an arg we're supposed to handle */
- if ((tag & CAMEL_ARG_TAG) <= CAMEL_IMAP_STORE_ARG_FIRST ||
- (tag & CAMEL_ARG_TAG) >= CAMEL_IMAP_STORE_ARG_FIRST + 100)
- continue;
-
- if (tag == CAMEL_IMAP_STORE_NAMESPACE) {
- if (strcmp (store->namespace, args->argv[i].ca_str) != 0) {
- g_free (store->namespace);
- store->namespace = g_strdup (args->argv[i].ca_str);
- /* the current imap code will need to do a reconnect for this to take effect */
- /*reconnect = TRUE;*/
- }
- } else if (tag == CAMEL_IMAP_STORE_OVERRIDE_NAMESPACE) {
- flags = args->argv[i].ca_int ? IMAP_PARAM_OVERRIDE_NAMESPACE : 0;
- flags |= (store->parameters & ~IMAP_PARAM_OVERRIDE_NAMESPACE);
-
- if (store->parameters != flags) {
- store->parameters = flags;
- /* the current imap code will need to do a reconnect for this to take effect */
- /*reconnect = TRUE;*/
- }
- } else if (tag == CAMEL_IMAP_STORE_CHECK_ALL) {
- flags = args->argv[i].ca_int ? IMAP_PARAM_CHECK_ALL : 0;
- flags |= (store->parameters & ~IMAP_PARAM_CHECK_ALL);
- store->parameters = flags;
- /* no need to reconnect for this option to take effect... */
- } else if (tag == CAMEL_IMAP_STORE_FILTER_INBOX) {
- flags = args->argv[i].ca_int ? IMAP_PARAM_FILTER_INBOX : 0;
- flags |= (store->parameters & ~IMAP_PARAM_FILTER_INBOX);
- store->parameters = flags;
- /* no need to reconnect for this option to take effect... */
- } else {
- /* error?? */
- continue;
- }
-
- /* let our parent know that we've handled this arg */
- camel_argv_ignore (args, i);
- }
-
- /* FIXME: if we need to reconnect for a change to take affect,
- we need to do it here... or, better yet, somehow chain it
- up to CamelService's setv implementation. */
-
- return CAMEL_OBJECT_CLASS (parent_class)->setv (object, ex, args);
-}
-
-static int
-imap_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args)
-{
- CamelImapStore *store = (CamelImapStore *) object;
- guint32 tag;
- int i;
-
- for (i = 0; i < args->argc; i++) {
- tag = args->argv[i].tag;
-
- /* make sure this is an arg we're supposed to handle */
- if ((tag & CAMEL_ARG_TAG) <= CAMEL_IMAP_STORE_ARG_FIRST ||
- (tag & CAMEL_ARG_TAG) >= CAMEL_IMAP_STORE_ARG_FIRST + 100)
- continue;
-
- switch (tag) {
- case CAMEL_IMAP_STORE_NAMESPACE:
- /* get the username */
- *args->argv[i].ca_str = store->namespace;
- break;
- case CAMEL_IMAP_STORE_OVERRIDE_NAMESPACE:
- /* get the auth mechanism */
- *args->argv[i].ca_int = store->parameters & IMAP_PARAM_OVERRIDE_NAMESPACE ? TRUE : FALSE;
- break;
- case CAMEL_IMAP_STORE_CHECK_ALL:
- /* get the hostname */
- *args->argv[i].ca_int = store->parameters & IMAP_PARAM_CHECK_ALL ? TRUE : FALSE;
- break;
- case CAMEL_IMAP_STORE_FILTER_INBOX:
- /* get the port */
- *args->argv[i].ca_int = store->parameters & IMAP_PARAM_FILTER_INBOX ? TRUE : FALSE;
- break;
- default:
- /* error? */
- break;
- }
- }
-
- return CAMEL_OBJECT_CLASS (parent_class)->getv (object, ex, args);
-}
-
-static char *
-imap_get_name (CamelService *service, gboolean brief)
-{
- if (brief)
- return g_strdup_printf (_("IMAP server %s"), service->url->host);
- else
- return g_strdup_printf (_("IMAP service for %s on %s"),
- service->url->user, service->url->host);
-}
-
-static void
-imap_set_server_level (CamelImapStore *store)
-{
- if (store->capabilities & IMAP_CAPABILITY_IMAP4REV1) {
- store->server_level = IMAP_LEVEL_IMAP4REV1;
- store->capabilities |= IMAP_CAPABILITY_STATUS;
- } else if (store->capabilities & IMAP_CAPABILITY_IMAP4)
- store->server_level = IMAP_LEVEL_IMAP4;
- else
- store->server_level = IMAP_LEVEL_UNKNOWN;
-}
-
-static struct {
- const char *name;
- guint32 flag;
-} capabilities[] = {
- { "IMAP4", IMAP_CAPABILITY_IMAP4 },
- { "IMAP4REV1", IMAP_CAPABILITY_IMAP4REV1 },
- { "STATUS", IMAP_CAPABILITY_STATUS },
- { "NAMESPACE", IMAP_CAPABILITY_NAMESPACE },
- { "UIDPLUS", IMAP_CAPABILITY_UIDPLUS },
- { "LITERAL+", IMAP_CAPABILITY_LITERALPLUS },
- { "STARTTLS", IMAP_CAPABILITY_STARTTLS },
- { NULL, 0 }
-};
-
-
-static gboolean
-imap_get_capability (CamelService *service, CamelException *ex)
-{
- CamelImapStore *store = CAMEL_IMAP_STORE (service);
- CamelImapResponse *response;
- char *result, *capa, *lasts;
- int i;
-
- CAMEL_SERVICE_ASSERT_LOCKED (store, connect_lock);
-
- /* Find out the IMAP capabilities */
- /* We assume we have utf8 capable search until a failed search tells us otherwise */
- store->capabilities = IMAP_CAPABILITY_utf8_search;
- store->authtypes = g_hash_table_new (g_str_hash, g_str_equal);
- response = camel_imap_command (store, NULL, ex, "CAPABILITY");
- if (!response)
- return FALSE;
- result = camel_imap_response_extract (store, response, "CAPABILITY ", ex);
- if (!result)
- return FALSE;
-
- /* Skip over "* CAPABILITY ". */
- capa = result + 13;
- for (capa = strtok_r (capa, " ", &lasts); capa;
- capa = strtok_r (NULL, " ", &lasts)) {
- if (!strncmp (capa, "AUTH=", 5)) {
- g_hash_table_insert (store->authtypes,
- g_strdup (capa + 5),
- GINT_TO_POINTER (1));
- continue;
- }
- for (i = 0; capabilities[i].name; i++) {
- if (strcasecmp (capa, capabilities[i].name) == 0) {
- store->capabilities |= capabilities[i].flag;
- break;
- }
- }
- }
- g_free (result);
-
- imap_set_server_level (store);
-
- if (store->summary->capabilities != store->capabilities) {
- store->summary->capabilities = store->capabilities;
- camel_store_summary_touch((CamelStoreSummary *)store->summary);
- camel_store_summary_save((CamelStoreSummary *)store->summary);
- }
-
- return TRUE;
-}
-
-enum {
- USE_SSL_NEVER,
- USE_SSL_ALWAYS,
- USE_SSL_WHEN_POSSIBLE
-};
-
-#define SSL_PORT_FLAGS (CAMEL_TCP_STREAM_SSL_ENABLE_SSL2 | CAMEL_TCP_STREAM_SSL_ENABLE_SSL3)
-#define STARTTLS_FLAGS (CAMEL_TCP_STREAM_SSL_ENABLE_TLS)
-
-static gboolean
-connect_to_server (CamelService *service, int ssl_mode, int try_starttls, CamelException *ex)
-{
- CamelImapStore *store = (CamelImapStore *) service;
- CamelImapResponse *response;
- CamelStream *tcp_stream;
- struct hostent *h;
- int clean_quit;
- int port, ret;
- char *buf;
-
- h = camel_service_gethost (service, ex);
- if (!h)
- return FALSE;
-
- port = service->url->port ? service->url->port : 143;
-
- if (ssl_mode != USE_SSL_NEVER) {
-#ifdef HAVE_SSL
- if (try_starttls) {
- tcp_stream = camel_tcp_stream_ssl_new_raw (service->session, service->url->host, STARTTLS_FLAGS);
- } else {
- port = service->url->port ? service->url->port : 993;
- tcp_stream = camel_tcp_stream_ssl_new (service->session, service->url->host, SSL_PORT_FLAGS);
- }
-#else
- if (!try_starttls)
- port = service->url->port ? service->url->port : 993;
-
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
- _("Could not connect to %s (port %d): %s"),
- service->url->host, port,
- _("SSL unavailable"));
-
- camel_free_host (h);
-
- return FALSE;
-#endif /* HAVE_SSL */
- } else {
- tcp_stream = camel_tcp_stream_raw_new ();
- }
-
- ret = camel_tcp_stream_connect (CAMEL_TCP_STREAM (tcp_stream), h, port);
- camel_free_host (h);
- if (ret == -1) {
- if (errno == EINTR)
- camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
- _("Connection cancelled"));
- else
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
- _("Could not connect to %s (port %d): %s"),
- service->url->host, port, g_strerror (errno));
-
- camel_object_unref (CAMEL_OBJECT (tcp_stream));
-
- return FALSE;
- }
-
- store->ostream = tcp_stream;
- store->istream = camel_stream_buffer_new (tcp_stream, CAMEL_STREAM_BUFFER_READ);
-
- store->connected = TRUE;
- store->preauthed = FALSE;
- store->command = 0;
-
- /* Read the greeting, if any, and deal with PREAUTH */
- if (camel_imap_store_readline (store, &buf, ex) < 0) {
- if (store->istream) {
- camel_object_unref (CAMEL_OBJECT (store->istream));
- store->istream = NULL;
- }
-
- if (store->ostream) {
- camel_object_unref (CAMEL_OBJECT (store->ostream));
- store->ostream = NULL;
- }
-
- store->connected = FALSE;
-
- return FALSE;
- }
- if (!strncmp(buf, "* PREAUTH", 9))
- store->preauthed = TRUE;
- g_free (buf);
-
- /* get the imap server capabilities */
- if (!imap_get_capability (service, ex)) {
- if (store->istream) {
- camel_object_unref (CAMEL_OBJECT (store->istream));
- store->istream = NULL;
- }
-
- if (store->ostream) {
- camel_object_unref (CAMEL_OBJECT (store->ostream));
- store->ostream = NULL;
- }
-
- store->connected = FALSE;
- return FALSE;
- }
-
-#ifdef HAVE_SSL
- if (ssl_mode == USE_SSL_WHEN_POSSIBLE) {
- if (store->capabilities & IMAP_CAPABILITY_STARTTLS)
- goto starttls;
- } else if (ssl_mode == USE_SSL_ALWAYS) {
- if (try_starttls) {
- if (store->capabilities & IMAP_CAPABILITY_STARTTLS) {
- /* attempt to toggle STARTTLS mode */
- goto starttls;
- } else {
- /* server doesn't support STARTTLS, abort */
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Failed to connect to IMAP server %s in secure mode: %s"),
- service->url->host, _("SSL/TLS extension not supported."));
- /* we have the possibility of quitting cleanly here */
- clean_quit = TRUE;
- goto exception;
- }
- }
- }
-#endif /* HAVE_SSL */
-
- return TRUE;
-
-#ifdef HAVE_SSL
- starttls:
-
- /* as soon as we send a STARTTLS command, all hope is lost of a clean QUIT if problems arise */
- clean_quit = FALSE;
-
- response = camel_imap_command (store, NULL, ex, "STARTTLS");
- if (!response) {
- camel_object_unref (CAMEL_OBJECT (store->istream));
- camel_object_unref (CAMEL_OBJECT (store->ostream));
- store->istream = store->ostream = NULL;
- return FALSE;
- }
-
- camel_imap_response_free_without_processing (store, response);
-
- /* Okay, now toggle SSL/TLS mode */
- if (camel_tcp_stream_ssl_enable_ssl (CAMEL_TCP_STREAM_SSL (tcp_stream)) == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Failed to connect to IMAP server %s in secure mode: %s"),
- service->url->host, _("SSL negotiations failed"));
- goto exception;
- }
-
- /* rfc2595, section 4 states that after a successful STLS
- command, the client MUST discard prior CAPA responses */
- if (!imap_get_capability (service, ex)) {
- if (store->istream) {
- camel_object_unref (CAMEL_OBJECT (store->istream));
- store->istream = NULL;
- }
-
- if (store->ostream) {
- camel_object_unref (CAMEL_OBJECT (store->ostream));
- store->ostream = NULL;
- }
-
- store->connected = FALSE;
-
- return FALSE;
- }
-
- return TRUE;
-
- exception:
-
- if (clean_quit && store->connected) {
- /* try to disconnect cleanly */
- response = camel_imap_command (store, NULL, ex, "LOGOUT");
- if (response)
- camel_imap_response_free_without_processing (store, response);
- }
-
- if (store->istream) {
- camel_object_unref (CAMEL_OBJECT (store->istream));
- store->istream = NULL;
- }
-
- if (store->ostream) {
- camel_object_unref (CAMEL_OBJECT (store->ostream));
- store->ostream = NULL;
- }
-
- store->connected = FALSE;
-
- return FALSE;
-#endif /* HAVE_SSL */
-}
-
-static gboolean
-connect_to_server_process (CamelService *service, const char *cmd, CamelException *ex)
-{
- CamelImapStore *store = (CamelImapStore *) service;
- CamelStream *cmd_stream;
- int ret, i = 0;
- char *buf;
- char *cmd_copy;
- char *full_cmd;
- char *child_env[7];
-
- /* Put full details in the environment, in case the connection
- program needs them */
- buf = camel_url_to_string(service->url, 0);
- child_env[i++] = g_strdup_printf("URL=%s", buf);
- g_free(buf);
-
- child_env[i++] = g_strdup_printf("URLHOST=%s", service->url->host);
- if (service->url->port)
- child_env[i++] = g_strdup_printf("URLPORT=%d", service->url->port);
- if (service->url->user)
- child_env[i++] = g_strdup_printf("URLUSER=%s", service->url->user);
- if (service->url->passwd)
- child_env[i++] = g_strdup_printf("URLPASSWD=%s", service->url->passwd);
- if (service->url->path)
- child_env[i++] = g_strdup_printf("URLPATH=%s", service->url->path);
- child_env[i] = NULL;
-
- /* Now do %h, %u, etc. substitution in cmd */
- buf = cmd_copy = g_strdup(cmd);
-
- full_cmd = g_strdup("");
-
- for(;;) {
- char *pc;
- char *tmp;
- char *var;
- int len;
-
- pc = strchr(buf, '%');
- ignore:
- if (!pc) {
- tmp = g_strdup_printf("%s%s", full_cmd, buf);
- g_free(full_cmd);
- full_cmd = tmp;
- break;
- }
-
- len = pc - buf;
-
- var = NULL;
-
- switch(pc[1]) {
- case 'h':
- var = service->url->host;
- break;
- case 'u':
- var = service->url->user;
- break;
- }
- if (!var) {
- /* If there wasn't a valid %-code, with an actual
- variable to insert, pretend we didn't see the % */
- pc = strchr(pc + 1, '%');
- goto ignore;
- }
- tmp = g_strdup_printf("%s%.*s%s", full_cmd, len, buf, var);
- g_free(full_cmd);
- full_cmd = tmp;
- buf = pc + 2;
- }
-
- g_free(cmd_copy);
-
- cmd_stream = camel_stream_process_new ();
-
- ret = camel_stream_process_connect (CAMEL_STREAM_PROCESS(cmd_stream),
- full_cmd, (const char **)child_env);
-
- while (i)
- g_free(child_env[--i]);
-
- if (ret == -1) {
- if (errno == EINTR)
- camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
- _("Connection cancelled"));
- else
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
- _("Could not connect with command \"%s\": %s"),
- full_cmd, g_strerror (errno));
-
- camel_object_unref (CAMEL_OBJECT (cmd_stream));
- g_free(full_cmd);
- return FALSE;
- }
- g_free(full_cmd);
-
- store->ostream = cmd_stream;
- store->istream = camel_stream_buffer_new (cmd_stream, CAMEL_STREAM_BUFFER_READ);
-
- store->connected = TRUE;
- store->preauthed = FALSE;
- store->command = 0;
-
- /* Read the greeting, if any, and deal with PREAUTH */
- if (camel_imap_store_readline (store, &buf, ex) < 0) {
- if (store->istream) {
- camel_object_unref (CAMEL_OBJECT (store->istream));
- store->istream = NULL;
- }
-
- if (store->ostream) {
- camel_object_unref (CAMEL_OBJECT (store->ostream));
- store->ostream = NULL;
- }
-
- store->connected = FALSE;
- return FALSE;
- }
- if (!strncmp(buf, "* PREAUTH", 9))
- store->preauthed = TRUE;
- g_free (buf);
-
- /* get the imap server capabilities */
- if (!imap_get_capability (service, ex)) {
- if (store->istream) {
- camel_object_unref (CAMEL_OBJECT (store->istream));
- store->istream = NULL;
- }
-
- if (store->ostream) {
- camel_object_unref (CAMEL_OBJECT (store->ostream));
- store->ostream = NULL;
- }
-
- store->connected = FALSE;
- return FALSE;
- }
-
- return TRUE;
-
-}
-
-static struct {
- char *value;
- int mode;
-} ssl_options[] = {
- { "", USE_SSL_ALWAYS },
- { "always", USE_SSL_ALWAYS },
- { "when-possible", USE_SSL_WHEN_POSSIBLE },
- { "never", USE_SSL_NEVER },
- { NULL, USE_SSL_NEVER },
-};
-
-static gboolean
-connect_to_server_wrapper (CamelService *service, CamelException *ex)
-{
- const char *command;
-#ifdef HAVE_SSL
- const char *use_ssl;
- int i, ssl_mode;
-#endif
- command = camel_url_get_param (service->url, "command");
- if (command)
- return connect_to_server_process (service, command, ex);
-
-#ifdef HAVE_SSL
- use_ssl = camel_url_get_param (service->url, "use_ssl");
- if (use_ssl) {
- for (i = 0; ssl_options[i].value; i++)
- if (!strcmp (ssl_options[i].value, use_ssl))
- break;
- ssl_mode = ssl_options[i].mode;
- } else
- ssl_mode = USE_SSL_NEVER;
-
- if (ssl_mode == USE_SSL_ALWAYS) {
- /* First try the ssl port */
- if (!connect_to_server (service, ssl_mode, FALSE, ex)) {
- if (camel_exception_get_id (ex) == CAMEL_EXCEPTION_SERVICE_UNAVAILABLE) {
- /* The ssl port seems to be unavailable, lets try STARTTLS */
- camel_exception_clear (ex);
- return connect_to_server (service, ssl_mode, TRUE, ex);
- } else {
- return FALSE;
- }
- }
-
- return TRUE;
- } else if (ssl_mode == USE_SSL_WHEN_POSSIBLE) {
- /* If the server supports STARTTLS, use it */
- return connect_to_server (service, ssl_mode, TRUE, ex);
- } else {
- /* User doesn't care about SSL */
- return connect_to_server (service, ssl_mode, FALSE, ex);
- }
-#else
- return connect_to_server (service, USE_SSL_NEVER, FALSE, ex);
-#endif
-}
-
-extern CamelServiceAuthType camel_imap_password_authtype;
-
-static GList *
-query_auth_types (CamelService *service, CamelException *ex)
-{
- CamelImapStore *store = CAMEL_IMAP_STORE (service);
- CamelServiceAuthType *authtype;
- GList *sasl_types, *t, *next;
- gboolean connected;
-
- if (!camel_disco_store_check_online (CAMEL_DISCO_STORE (store), ex))
- return NULL;
-
- CAMEL_SERVICE_LOCK (store, connect_lock);
- connected = connect_to_server_wrapper (service, ex);
- CAMEL_SERVICE_UNLOCK (store, connect_lock);
- if (!connected)
- return NULL;
-
- sasl_types = camel_sasl_authtype_list (FALSE);
- for (t = sasl_types; t; t = next) {
- authtype = t->data;
- next = t->next;
-
- if (!g_hash_table_lookup (store->authtypes, authtype->authproto)) {
- sasl_types = g_list_remove_link (sasl_types, t);
- g_list_free_1 (t);
- }
- }
-
- return g_list_prepend (sasl_types, &camel_imap_password_authtype);
-}
-
-/* folder_name is path name */
-static CamelFolderInfo *
-imap_build_folder_info(CamelImapStore *imap_store, const char *folder_name)
-{
- CamelURL *url;
- const char *name;
- CamelFolderInfo *fi;
-
- fi = g_malloc0(sizeof(*fi));
-
- fi->full_name = g_strdup(folder_name);
- fi->unread_message_count = 0;
-
- url = camel_url_new (imap_store->base_url, NULL);
- g_free (url->path);
- url->path = g_strdup_printf ("/%s", folder_name);
- fi->url = camel_url_to_string (url, CAMEL_URL_HIDE_ALL);
- camel_url_free(url);
- fi->path = g_strdup_printf("/%s", folder_name);
- name = strrchr (fi->path, '/');
- if (name)
- name++;
- else
- name = fi->path;
-
- fi->name = g_strdup (name);
-
- return fi;
-}
-
-static void
-imap_folder_effectively_unsubscribed(CamelImapStore *imap_store,
- const char *folder_name, CamelException *ex)
-{
- CamelFolderInfo *fi;
- CamelStoreInfo *si;
-
- si = camel_store_summary_path((CamelStoreSummary *)imap_store->summary, folder_name);
- if (si) {
- if (si->flags & CAMEL_STORE_INFO_FOLDER_SUBSCRIBED) {
- si->flags &= ~CAMEL_STORE_INFO_FOLDER_SUBSCRIBED;
- camel_store_summary_touch((CamelStoreSummary *)imap_store->summary);
- camel_store_summary_save((CamelStoreSummary *)imap_store->summary);
- }
- camel_store_summary_info_free((CamelStoreSummary *)imap_store->summary, si);
- }
-
- if (imap_store->renaming) {
- /* we don't need to emit a "folder_unsubscribed" signal
- if we are in the process of renaming folders, so we
- are done here... */
- return;
-
- }
-
- fi = imap_build_folder_info(imap_store, folder_name);
- camel_object_trigger_event (CAMEL_OBJECT (imap_store), "folder_unsubscribed", fi);
- camel_folder_info_free (fi);
-}
-
-static void
-imap_forget_folder (CamelImapStore *imap_store, const char *folder_name, CamelException *ex)
-{
- CamelFolderSummary *summary;
- CamelImapMessageCache *cache;
- char *summary_file;
- char *journal_file;
- char *folder_dir, *storage_path;
- CamelFolderInfo *fi;
- const char *name;
-
- name = strrchr (folder_name, imap_store->dir_sep);
- if (name)
- name++;
- else
- name = folder_name;
-
- storage_path = g_strdup_printf ("%s/folders", imap_store->storage_path);
- folder_dir = e_path_to_physical (storage_path, folder_name);
- g_free (storage_path);
- if (access (folder_dir, F_OK) != 0) {
- g_free (folder_dir);
- goto event;
- }
-
- summary_file = g_strdup_printf ("%s/summary", folder_dir);
- summary = camel_imap_summary_new (summary_file);
- if (!summary) {
- g_free (summary_file);
- g_free (folder_dir);
- goto event;
- }
-
- cache = camel_imap_message_cache_new (folder_dir, summary, ex);
- if (cache)
- camel_imap_message_cache_clear (cache);
-
- camel_object_unref (cache);
- camel_object_unref (summary);
-
- unlink (summary_file);
- g_free (summary_file);
-
- journal_file = g_strdup_printf ("%s/summary", folder_dir);
- unlink (journal_file);
- g_free (journal_file);
-
- rmdir (folder_dir);
- g_free (folder_dir);
-
- event:
-
- camel_store_summary_remove_path((CamelStoreSummary *)imap_store->summary, folder_name);
- camel_store_summary_save((CamelStoreSummary *)imap_store->summary);
-
- fi = imap_build_folder_info(imap_store, folder_name);
- camel_object_trigger_event (CAMEL_OBJECT (imap_store), "folder_deleted", fi);
- camel_folder_info_free (fi);
-}
-
-static gboolean
-imap_check_folder_still_extant (CamelImapStore *imap_store, const char *full_name,
- CamelException *ex)
-{
- CamelImapResponse *response;
-
- response = camel_imap_command (imap_store, NULL, ex, "LIST \"\" %S",
- full_name);
-
- if (response) {
- gboolean stillthere = response->untagged->len != 0;
-
- camel_imap_response_free_without_processing (imap_store, response);
-
- return stillthere;
- }
-
- /* if the command was rejected, there must be some other error,
- assume it worked so we dont blow away the folder unecessarily */
- return TRUE;
-}
-
-/* This is a little 'hack' to avoid the deadlock conditions that would otherwise
- ensue when calling camel_folder_refresh_info from inside a lock */
-/* NB: on second thougts this is probably not entirely safe, but it'll do for now */
-/* No, its definetly not safe. So its been changed to copy the folders first */
-/* the alternative is to:
- make the camel folder->lock recursive (which should probably be done)
- or remove it from camel_folder_refresh_info, and use another locking mechanism */
-/* also see get_folder_info_online() for the same hack repeated */
-static void
-imap_store_refresh_folders (CamelImapStore *store, CamelException *ex)
-{
- GPtrArray *folders;
- int i;
-
- folders = camel_object_bag_list(CAMEL_STORE (store)->folders);
-
- for (i = 0; i <folders->len; i++) {
- CamelFolder *folder = folders->pdata[i];
-
- CAMEL_IMAP_FOLDER (folder)->need_rescan = TRUE;
- if (!camel_exception_is_set(ex))
- CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(folder))->refresh_info(folder, ex);
-
- if (camel_exception_is_set (ex) &&
- imap_check_folder_still_extant (store, folder->full_name, ex) == FALSE) {
- gchar *namedup;
-
- /* the folder was deleted (may happen when we come back online
- * after being offline */
-
- namedup = g_strdup (folder->full_name);
- camel_object_unref(folder);
- imap_folder_effectively_unsubscribed (store, namedup, ex);
- imap_forget_folder (store, namedup, ex);
- g_free (namedup);
- } else
- camel_object_unref(folder);
- }
-
- g_ptr_array_free (folders, TRUE);
-}
-
-static gboolean
-try_auth (CamelImapStore *store, const char *mech, CamelException *ex)
-{
- CamelSasl *sasl;
- CamelImapResponse *response;
- char *resp;
- char *sasl_resp;
-
- CAMEL_SERVICE_ASSERT_LOCKED (store, connect_lock);
-
- response = camel_imap_command (store, NULL, ex, "AUTHENTICATE %s", mech);
- if (!response)
- return FALSE;
-
- sasl = camel_sasl_new ("imap", mech, CAMEL_SERVICE (store));
- while (!camel_sasl_authenticated (sasl)) {
- resp = camel_imap_response_extract_continuation (store, response, ex);
- if (!resp)
- goto lose;
-
- sasl_resp = camel_sasl_challenge_base64 (sasl, imap_next_word (resp), ex);
- g_free (resp);
- if (camel_exception_is_set (ex))
- goto break_and_lose;
-
- response = camel_imap_command_continuation (store, sasl_resp, strlen (sasl_resp), ex);
- g_free (sasl_resp);
- if (!response)
- goto lose;
- }
-
- resp = camel_imap_response_extract_continuation (store, response, NULL);
- if (resp) {
- /* Oops. SASL claims we're done, but the IMAP server
- * doesn't think so...
- */
- g_free (resp);
- goto lose;
- }
-
- camel_object_unref (CAMEL_OBJECT (sasl));
-
- return TRUE;
-
- break_and_lose:
- /* Get the server out of "waiting for continuation data" mode. */
- response = camel_imap_command_continuation (store, "*", 1, NULL);
- if (response)
- camel_imap_response_free (store, response);
-
- lose:
- if (!camel_exception_is_set (ex)) {
- camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
- _("Bad authentication response from server."));
- }
-
- camel_object_unref (CAMEL_OBJECT (sasl));
-
- return FALSE;
-}
-
-static gboolean
-imap_auth_loop (CamelService *service, CamelException *ex)
-{
- CamelImapStore *store = CAMEL_IMAP_STORE (service);
- CamelSession *session = camel_service_get_session (service);
- CamelServiceAuthType *authtype = NULL;
- CamelImapResponse *response;
- char *errbuf = NULL;
- gboolean authenticated = FALSE;
-
- CAMEL_SERVICE_ASSERT_LOCKED (store, connect_lock);
-
- if (store->preauthed) {
- if (camel_verbose_debug)
- fprintf(stderr, "Server %s has preauthenticated us.\n",
- service->url->host);
- return TRUE;
- }
-
- if (service->url->authmech) {
- if (!g_hash_table_lookup (store->authtypes, service->url->authmech)) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
- _("IMAP server %s does not support requested "
- "authentication type %s"),
- service->url->host,
- service->url->authmech);
- return FALSE;
- }
-
- authtype = camel_sasl_authtype (service->url->authmech);
- if (!authtype) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
- _("No support for authentication type %s"),
- service->url->authmech);
- return FALSE;
- }
-
- if (!authtype->need_password) {
- authenticated = try_auth (store, authtype->authproto, ex);
- if (!authenticated)
- return FALSE;
- }
- }
-
- while (!authenticated) {
- if (errbuf) {
- /* We need to un-cache the password before prompting again */
- camel_session_forget_password (session, service, "password", ex);
- g_free (service->url->passwd);
- service->url->passwd = NULL;
- }
-
- if (!service->url->passwd) {
- char *prompt;
-
- prompt = g_strdup_printf (_("%sPlease enter the IMAP "
- "password for %s@%s"),
- errbuf ? errbuf : "",
- service->url->user,
- service->url->host);
- service->url->passwd =
- camel_session_get_password (session, prompt, FALSE, TRUE,
- service, "password", ex);
- g_free (prompt);
- g_free (errbuf);
- errbuf = NULL;
-
- if (!service->url->passwd) {
- camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
- _("You didn't enter a password."));
- return FALSE;
- }
- }
-
- if (!store->connected) {
- /* Some servers (eg, courier) will disconnect on
- * a bad password. So reconnect here.
- */
- if (!connect_to_server_wrapper (service, ex))
- return FALSE;
- }
-
- if (authtype)
- authenticated = try_auth (store, authtype->authproto, ex);
- else {
- response = camel_imap_command (store, NULL, ex,
- "LOGIN %S %S",
- service->url->user,
- service->url->passwd);
- if (response) {
- camel_imap_response_free (store, response);
- authenticated = TRUE;
- }
- }
- if (!authenticated) {
- if (camel_exception_get_id(ex) == CAMEL_EXCEPTION_USER_CANCEL)
- return FALSE;
-
- errbuf = g_strdup_printf (_("Unable to authenticate "
- "to IMAP server.\n%s\n\n"),
- camel_exception_get_description (ex));
- camel_exception_clear (ex);
- }
- }
-
- return TRUE;
-}
-
-static gboolean
-can_work_offline (CamelDiscoStore *disco_store)
-{
- CamelImapStore *store = CAMEL_IMAP_STORE (disco_store);
-
- return camel_store_summary_count((CamelStoreSummary *)store->summary) != 0;
-}
-
-static gboolean
-imap_connect_online (CamelService *service, CamelException *ex)
-{
- CamelImapStore *store = CAMEL_IMAP_STORE (service);
- CamelDiscoStore *disco_store = CAMEL_DISCO_STORE (service);
- CamelImapResponse *response;
- /*struct _namespaces *namespaces;*/
- char *result, *name, *path;
- int i;
- size_t len;
- CamelImapStoreNamespace *ns;
-
- CAMEL_SERVICE_LOCK (store, connect_lock);
- if (!connect_to_server_wrapper (service, ex) ||
- !imap_auth_loop (service, ex)) {
- CAMEL_SERVICE_UNLOCK (store, connect_lock);
- camel_service_disconnect (service, TRUE, NULL);
- return FALSE;
- }
-
- /* Get namespace and hierarchy separator */
- if ((store->capabilities & IMAP_CAPABILITY_NAMESPACE) &&
- !(store->parameters & IMAP_PARAM_OVERRIDE_NAMESPACE)) {
- response = camel_imap_command (store, NULL, ex, "NAMESPACE");
- if (!response)
- goto done;
-
- result = camel_imap_response_extract (store, response, "NAMESPACE", ex);
- if (!result)
- goto done;
-
-#if 0
- /* new code... */
- namespaces = imap_parse_namespace_response (result);
- imap_namespaces_destroy (namespaces);
- /* end new code */
-#endif
-
- name = camel_strstrcase (result, "NAMESPACE ((");
- if (name) {
- char *sep;
-
- name += 12;
- store->namespace = imap_parse_string ((const char **) &name, &len);
- if (name && *name++ == ' ') {
- sep = imap_parse_string ((const char **) &name, &len);
- if (sep) {
- store->dir_sep = *sep;
- ((CamelStore *)store)->dir_sep = store->dir_sep;
- g_free (sep);
- }
- }
- }
- g_free (result);
- }
-
- if (!store->namespace)
- store->namespace = g_strdup ("");
-
- if (!store->dir_sep) {
- if (store->server_level >= IMAP_LEVEL_IMAP4REV1) {
- /* This idiom means "tell me the hierarchy separator
- * for the given path, even if that path doesn't exist.
- */
- response = camel_imap_command (store, NULL, ex,
- "LIST %S \"\"",
- store->namespace);
- } else {
- /* Plain IMAP4 doesn't have that idiom, so we fall back
- * to "tell me about this folder", which will fail if
- * the folder doesn't exist (eg, if namespace is "").
- */
- response = camel_imap_command (store, NULL, ex,
- "LIST \"\" %S",
- store->namespace);
- }
- if (!response)
- goto done;
-
- result = camel_imap_response_extract (store, response, "LIST", NULL);
- if (result) {
- imap_parse_list_response (store, result, NULL, &store->dir_sep, NULL);
- g_free (result);
- }
- if (!store->dir_sep) {
- store->dir_sep = '/'; /* Guess */
- ((CamelStore *)store)->dir_sep = store->dir_sep;
- }
- }
-
- /* canonicalize the namespace to end with dir_sep */
- len = strlen (store->namespace);
- if (len && store->namespace[len - 1] != store->dir_sep) {
- gchar *tmp;
-
- tmp = g_strdup_printf ("%s%c", store->namespace, store->dir_sep);
- g_free (store->namespace);
- store->namespace = tmp;
- }
-
- ns = camel_imap_store_summary_namespace_new(store->summary, store->namespace, store->dir_sep);
- camel_imap_store_summary_namespace_set(store->summary, ns);
-
- if (CAMEL_STORE (store)->flags & CAMEL_STORE_SUBSCRIPTIONS) {
- gboolean haveinbox = FALSE;
- GPtrArray *folders;
- char *pattern;
-
- /* this pre-fills the summary, and checks that lsub is useful */
- folders = g_ptr_array_new ();
- pattern = g_strdup_printf ("%s*", store->namespace);
- get_folders_online (store, pattern, folders, TRUE, ex);
- g_free (pattern);
-
- for (i = 0; i < folders->len; i++) {
- CamelFolderInfo *fi = folders->pdata[i];
-
- haveinbox = haveinbox || !strcasecmp (fi->full_name, "INBOX");
-
- if (fi->flags & (CAMEL_IMAP_FOLDER_MARKED | CAMEL_IMAP_FOLDER_UNMARKED))
- store->capabilities |= IMAP_CAPABILITY_useful_lsub;
- camel_folder_info_free (fi);
- }
-
- /* if the namespace is under INBOX, check INBOX explicitly */
- if (!strncasecmp (store->namespace, "INBOX", 5) && !camel_exception_is_set (ex)) {
- gboolean just_subscribed = FALSE;
- gboolean need_subscribe = FALSE;
-
- recheck:
- g_ptr_array_set_size (folders, 0);
- get_folders_online (store, "INBOX", folders, TRUE, ex);
-
- for (i = 0; i < folders->len; i++) {
- CamelFolderInfo *fi = folders->pdata[i];
-
- /* this should always be TRUE if folders->len > 0 */
- if (!strcasecmp (fi->full_name, "INBOX")) {
- haveinbox = TRUE;
-
- /* if INBOX is marked as \NoSelect then it is probably
- because it has not been subscribed to */
- if (!need_subscribe)
- need_subscribe = fi->flags & CAMEL_FOLDER_NOSELECT;
- }
-
- camel_folder_info_free (fi);
- }
-
- need_subscribe = !haveinbox || need_subscribe;
- if (need_subscribe && !just_subscribed && !camel_exception_is_set (ex)) {
- /* in order to avoid user complaints, force a subscription to INBOX */
- response = camel_imap_command (store, NULL, ex, "SUBSCRIBE INBOX");
- if (response != NULL) {
- /* force a re-check which will pre-fill the summary and
- also get any folder flags present on the INBOX */
- camel_imap_response_free (store, response);
- just_subscribed = TRUE;
- goto recheck;
- }
- }
- }
-
- g_ptr_array_free (folders, TRUE);
- }
-
- path = g_strdup_printf ("%s/journal", store->storage_path);
- disco_store->diary = camel_disco_diary_new (disco_store, path, ex);
- g_free (path);
-
- done:
- /* save any changes we had */
- camel_store_summary_save((CamelStoreSummary *)store->summary);
-
- CAMEL_SERVICE_UNLOCK (store, connect_lock);
-
- if (camel_exception_is_set (ex))
- camel_service_disconnect (service, TRUE, NULL);
- else if (camel_disco_diary_empty (disco_store->diary))
- imap_store_refresh_folders (store, ex);
-
- return !camel_exception_is_set (ex);
-}
-
-static gboolean
-imap_connect_offline (CamelService *service, CamelException *ex)
-{
- CamelImapStore *store = CAMEL_IMAP_STORE (service);
- CamelDiscoStore *disco_store = CAMEL_DISCO_STORE (service);
- char *path;
-
- path = g_strdup_printf ("%s/journal", store->storage_path);
- disco_store->diary = camel_disco_diary_new (disco_store, path, ex);
- g_free (path);
- if (!disco_store->diary)
- return FALSE;
-
- imap_store_refresh_folders (store, ex);
-
- store->connected = !camel_exception_is_set (ex);
- return store->connected;
-}
-
-static gboolean
-imap_disconnect_offline (CamelService *service, gboolean clean, CamelException *ex)
-{
- CamelImapStore *store = CAMEL_IMAP_STORE (service);
- CamelDiscoStore *disco = CAMEL_DISCO_STORE (service);
-
- store->connected = FALSE;
- if (store->current_folder) {
- camel_object_unref (CAMEL_OBJECT (store->current_folder));
- store->current_folder = NULL;
- }
-
- if (store->authtypes) {
- g_hash_table_foreach_remove (store->authtypes,
- free_key, NULL);
- g_hash_table_destroy (store->authtypes);
- store->authtypes = NULL;
- }
-
- if (store->namespace && !(store->parameters & IMAP_PARAM_OVERRIDE_NAMESPACE)) {
- g_free (store->namespace);
- store->namespace = NULL;
- }
-
- if (disco->diary) {
- camel_object_unref (CAMEL_OBJECT (disco->diary));
- disco->diary = NULL;
- }
-
- return TRUE;
-}
-
-static gboolean
-imap_disconnect_online (CamelService *service, gboolean clean, CamelException *ex)
-{
- CamelImapStore *store = CAMEL_IMAP_STORE (service);
- CamelImapResponse *response;
-
- if (store->connected && clean) {
- response = camel_imap_command (store, NULL, NULL, "LOGOUT");
- camel_imap_response_free (store, response);
- }
-
- if (store->istream) {
- camel_object_unref (CAMEL_OBJECT (store->istream));
- store->istream = NULL;
- }
-
- if (store->ostream) {
- camel_object_unref (CAMEL_OBJECT (store->ostream));
- store->ostream = NULL;
- }
-
- imap_disconnect_offline (service, clean, ex);
-
- return TRUE;
-}
-
-
-static gboolean
-imap_summary_is_dirty (CamelFolderSummary *summary)
-{
- CamelMessageInfo *info;
- int max, i;
-
- max = camel_folder_summary_count (summary);
- for (i = 0; i < max; i++) {
- info = camel_folder_summary_index (summary, i);
- if (info && (info->flags & CAMEL_MESSAGE_FOLDER_FLAGGED))
- return TRUE;
- }
-
- return FALSE;
-}
-
-static void
-imap_noop (CamelStore *store, CamelException *ex)
-{
- CamelImapStore *imap_store = (CamelImapStore *) store;
- CamelDiscoStore *disco = (CamelDiscoStore *) store;
- CamelImapResponse *response;
- CamelFolder *current_folder;
-
- if (camel_disco_store_status (disco) != CAMEL_DISCO_STORE_ONLINE)
- return;
-
- CAMEL_SERVICE_LOCK (imap_store, connect_lock);
-
- current_folder = imap_store->current_folder;
- if (current_folder && imap_summary_is_dirty (current_folder->summary)) {
- /* let's sync the flags instead. NB: must avoid folder lock */
- ((CamelFolderClass *)((CamelObject *)current_folder)->klass)->sync(current_folder, FALSE, ex);
- } else {
- response = camel_imap_command (imap_store, NULL, ex, "NOOP");
- if (response)
- camel_imap_response_free (imap_store, response);
- }
-
- CAMEL_SERVICE_UNLOCK (imap_store, connect_lock);
-}
-
-static guint
-hash_folder_name (gconstpointer key)
-{
- if (strcasecmp (key, "INBOX") == 0)
- return g_str_hash ("INBOX");
- else
- return g_str_hash (key);
-}
-
-static gint
-compare_folder_name (gconstpointer a, gconstpointer b)
-{
- gconstpointer aname = a, bname = b;
-
- if (strcasecmp (a, "INBOX") == 0)
- aname = "INBOX";
- if (strcasecmp (b, "INBOX") == 0)
- bname = "INBOX";
- return g_str_equal (aname, bname);
-}
-
-static CamelFolder *
-no_such_folder (const char *name, CamelException *ex)
-{
- camel_exception_setv (ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
- _("No such folder %s"), name);
- return NULL;
-}
-
-static int
-get_folder_status (CamelImapStore *imap_store, const char *folder_name, const char *type)
-{
- CamelImapResponse *response;
- char *status, *p;
- int out;
-
- /* FIXME: we assume the server is STATUS-capable */
-
- response = camel_imap_command (imap_store, NULL, NULL,
- "STATUS %F (%s)",
- folder_name,
- type);
-
- if (!response) {
- CamelException ex;
-
- camel_exception_init (&ex);
- if (imap_check_folder_still_extant (imap_store, folder_name, &ex) == FALSE) {
- imap_folder_effectively_unsubscribed (imap_store, folder_name, &ex);
- imap_forget_folder (imap_store, folder_name, &ex);
- }
- camel_exception_clear (&ex);
- return -1;
- }
-
- status = camel_imap_response_extract (imap_store, response,
- "STATUS", NULL);
- if (!status)
- return -1;
-
- p = camel_strstrcase (status, type);
- if (p)
- out = strtoul (p + strlen (type), NULL, 10);
- else
- out = -1;
-
- g_free (status);
- return out;
-}
-
-static CamelFolder *
-get_folder_online (CamelStore *store, const char *folder_name,
- guint32 flags, CamelException *ex)
-{
- CamelImapStore *imap_store = CAMEL_IMAP_STORE (store);
- CamelImapResponse *response;
- CamelFolder *new_folder;
- char *folder_dir, *storage_path;
-
- if (!camel_imap_store_connected (imap_store, ex))
- return NULL;
-
- if (!strcasecmp (folder_name, "INBOX"))
- folder_name = "INBOX";
-
- /* Lock around the whole lot to check/create atomically */
- CAMEL_SERVICE_LOCK (imap_store, connect_lock);
- if (imap_store->current_folder) {
- camel_object_unref (CAMEL_OBJECT (imap_store->current_folder));
- imap_store->current_folder = NULL;
- }
- response = camel_imap_command (imap_store, NULL, NULL, "SELECT %F", folder_name);
- if (!response) {
- char *folder_real;
-
- if (!flags & CAMEL_STORE_FOLDER_CREATE) {
- CAMEL_SERVICE_UNLOCK (imap_store, connect_lock);
- return no_such_folder (folder_name, ex);
- }
-
- folder_real = camel_imap_store_summary_path_to_full(imap_store->summary, folder_name, store->dir_sep);
-
- response = camel_imap_command (imap_store, NULL, ex, "CREATE %S", folder_real);
-
- if (response) {
- camel_imap_store_summary_add_from_full(imap_store->summary, folder_real, store->dir_sep);
-
- camel_imap_response_free (imap_store, response);
-
- response = camel_imap_command (imap_store, NULL, NULL, "SELECT %F", folder_name);
- }
- g_free(folder_real);
- if (!response) {
- CAMEL_SERVICE_UNLOCK (imap_store, connect_lock);
- return NULL;
- }
- }
-
- storage_path = g_strdup_printf("%s/folders", imap_store->storage_path);
- folder_dir = e_path_to_physical (storage_path, folder_name);
- g_free(storage_path);
- new_folder = camel_imap_folder_new (store, folder_name, folder_dir, ex);
- g_free (folder_dir);
- if (new_folder) {
- CamelException local_ex;
-
- imap_store->current_folder = new_folder;
- camel_object_ref (CAMEL_OBJECT (new_folder));
- camel_exception_init (&local_ex);
- camel_imap_folder_selected (new_folder, response, &local_ex);
-
- if (camel_exception_is_set (&local_ex)) {
- camel_exception_xfer (ex, &local_ex);
- camel_object_unref (CAMEL_OBJECT (imap_store->current_folder));
- imap_store->current_folder = NULL;
- camel_object_unref (CAMEL_OBJECT (new_folder));
- new_folder = NULL;
- }
- }
- camel_imap_response_free_without_processing (imap_store, response);
-
- CAMEL_SERVICE_UNLOCK (imap_store, connect_lock);
-
- return new_folder;
-}
-
-static CamelFolder *
-get_folder_offline (CamelStore *store, const char *folder_name,
- guint32 flags, CamelException *ex)
-{
- CamelImapStore *imap_store = CAMEL_IMAP_STORE (store);
- CamelFolder *new_folder;
- char *folder_dir, *storage_path;
-
- if (!imap_store->connected &&
- !camel_service_connect (CAMEL_SERVICE (store), ex))
- return NULL;
-
- if (!strcasecmp (folder_name, "INBOX"))
- folder_name = "INBOX";
-
- storage_path = g_strdup_printf("%s/folders", imap_store->storage_path);
- folder_dir = e_path_to_physical (storage_path, folder_name);
- g_free(storage_path);
- if (!folder_dir || access (folder_dir, F_OK) != 0) {
- g_free (folder_dir);
- camel_exception_setv (ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
- _("No such folder %s"), folder_name);
- return NULL;
- }
-
- new_folder = camel_imap_folder_new (store, folder_name, folder_dir, ex);
- g_free (folder_dir);
-
- return new_folder;
-}
-
-static void
-delete_folder (CamelStore *store, const char *folder_name, CamelException *ex)
-{
- CamelImapStore *imap_store = CAMEL_IMAP_STORE (store);
- CamelImapResponse *response;
-
- if (!camel_disco_store_check_online (CAMEL_DISCO_STORE (store), ex))
- return;
-
- /* make sure this folder isn't currently SELECTed */
- response = camel_imap_command (imap_store, NULL, ex, "SELECT INBOX");
- if (response) {
- camel_imap_response_free_without_processing (imap_store, response);
-
- CAMEL_SERVICE_LOCK (imap_store, connect_lock);
-
- if (imap_store->current_folder)
- camel_object_unref (CAMEL_OBJECT (imap_store->current_folder));
- /* no need to actually create a CamelFolder for INBOX */
- imap_store->current_folder = NULL;
-
- CAMEL_SERVICE_UNLOCK (imap_store, connect_lock);
- } else
- return;
-
- response = camel_imap_command (imap_store, NULL, ex, "DELETE %F",
- folder_name);
-
- if (response) {
- camel_imap_response_free (imap_store, response);
- imap_forget_folder (imap_store, folder_name, ex);
- }
-}
-
-static void
-manage_subscriptions (CamelStore *store, const char *old_name, gboolean subscribe)
-{
- CamelImapStore *imap_store = CAMEL_IMAP_STORE (store);
- CamelStoreInfo *si;
- int olen = strlen(old_name);
- const char *path;
- int i, count;
-
- count = camel_store_summary_count((CamelStoreSummary *)imap_store->summary);
- for (i=0;i<count;i++) {
- si = camel_store_summary_index((CamelStoreSummary *)imap_store->summary, i);
- if (si) {
- path = camel_store_info_path(imap_store->summary, si);
- if (strncmp(path, old_name, olen) == 0) {
- if (subscribe)
- subscribe_folder(store, path, NULL);
- else
- unsubscribe_folder(store, path, NULL);
- }
- camel_store_summary_info_free((CamelStoreSummary *)imap_store->summary, si);
- }
- }
-}
-
-static void
-rename_folder_info (CamelImapStore *imap_store, const char *old_name, const char *new_name)
-{
- int i, count;
- CamelStoreInfo *si;
- int olen = strlen(old_name);
- const char *path;
- char *npath, *nfull;
-
- count = camel_store_summary_count((CamelStoreSummary *)imap_store->summary);
- for (i=0;i<count;i++) {
- si = camel_store_summary_index((CamelStoreSummary *)imap_store->summary, i);
- if (si == NULL)
- continue;
- path = camel_store_info_path(imap_store->summary, si);
- if (strncmp(path, old_name, olen) == 0) {
- if (strlen(path) > olen)
- npath = g_strdup_printf("%s/%s", new_name, path+olen+1);
- else
- npath = g_strdup(new_name);
- nfull = camel_imap_store_summary_path_to_full(imap_store->summary, npath, imap_store->dir_sep);
-
- /* workaround for broken server (courier uses '.') that doesn't rename
- subordinate folders as required by rfc 2060 */
- if (imap_store->dir_sep == '.') {
- CamelImapResponse *response;
-
- response = camel_imap_command (imap_store, NULL, NULL, "RENAME %F %S", path, nfull);
- if (response)
- camel_imap_response_free (imap_store, response);
- }
-
- camel_store_info_set_string((CamelStoreSummary *)imap_store->summary, si, CAMEL_STORE_INFO_PATH, npath);
- camel_store_info_set_string((CamelStoreSummary *)imap_store->summary, si, CAMEL_IMAP_STORE_INFO_FULL_NAME, nfull);
-
- camel_store_summary_touch((CamelStoreSummary *)imap_store->summary);
- g_free(nfull);
- g_free(npath);
- }
- camel_store_summary_info_free((CamelStoreSummary *)imap_store->summary, si);
- }
-}
-
-static void
-rename_folder (CamelStore *store, const char *old_name, const char *new_name_in, CamelException *ex)
-{
- CamelImapStore *imap_store = CAMEL_IMAP_STORE (store);
- CamelImapResponse *response;
- char *oldpath, *newpath, *storage_path, *new_name;
-
- if (!camel_disco_store_check_online (CAMEL_DISCO_STORE (store), ex))
- return;
-
- /* make sure this folder isn't currently SELECTed - it's
- actually possible to rename INBOX but if you do another
- INBOX will immediately be created by the server */
- response = camel_imap_command (imap_store, NULL, ex, "SELECT INBOX");
- if (response) {
- camel_imap_response_free_without_processing (imap_store, response);
-
- CAMEL_SERVICE_LOCK (imap_store, connect_lock);
-
- if (imap_store->current_folder)
- camel_object_unref (CAMEL_OBJECT (imap_store->current_folder));
- /* no need to actually create a CamelFolder for INBOX */
- imap_store->current_folder = NULL;
-
- CAMEL_SERVICE_UNLOCK (imap_store, connect_lock);
- } else
- return;
-
- imap_store->renaming = TRUE;
-
- if (store->flags & CAMEL_STORE_SUBSCRIPTIONS)
- manage_subscriptions(store, old_name, FALSE);
-
- new_name = camel_imap_store_summary_path_to_full(imap_store->summary, new_name_in, store->dir_sep);
- response = camel_imap_command (imap_store, NULL, ex, "RENAME %F %S", old_name, new_name);
-
- if (!response) {
- if (store->flags & CAMEL_STORE_SUBSCRIPTIONS)
- manage_subscriptions(store, old_name, TRUE);
- g_free(new_name);
- imap_store->renaming = FALSE;
- return;
- }
-
- camel_imap_response_free (imap_store, response);
-
- /* rename summary, and handle broken server */
- rename_folder_info(imap_store, old_name, new_name_in);
-
- if (store->flags & CAMEL_STORE_SUBSCRIPTIONS)
- manage_subscriptions(store, new_name_in, TRUE);
-
- storage_path = g_strdup_printf("%s/folders", imap_store->storage_path);
- oldpath = e_path_to_physical (storage_path, old_name);
- newpath = e_path_to_physical (storage_path, new_name_in);
- g_free(storage_path);
-
- /* So do we care if this didn't work? Its just a cache? */
- if (rename (oldpath, newpath) == -1) {
- g_warning ("Could not rename message cache '%s' to '%s': %s: cache reset",
- oldpath, newpath, strerror (errno));
- }
-
- g_free (oldpath);
- g_free (newpath);
- g_free(new_name);
-
- imap_store->renaming = FALSE;
-}
-
-static CamelFolderInfo *
-create_folder (CamelStore *store, const char *parent_name,
- const char *folder_name, CamelException *ex)
-{
- CamelImapStore *imap_store = CAMEL_IMAP_STORE (store);
- char *full_name, *resp, *thisone, *parent_real, *real_name;
- CamelImapResponse *response;
- CamelException internal_ex;
- CamelFolderInfo *root = NULL;
- gboolean need_convert;
- int i = 0, flags;
-
- if (!camel_disco_store_check_online (CAMEL_DISCO_STORE (store), ex))
- return NULL;
- if (!parent_name)
- parent_name = "";
-
- if (strchr (folder_name, imap_store->dir_sep)) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID_PATH,
- _("The folder name \"%s\" is invalid because "
- "it containes the character \"%c\""),
- folder_name, imap_store->dir_sep);
- return NULL;
- }
-
- /* check if the parent allows inferiors */
-
- /* FIXME: use storesummary directly */
- parent_real = camel_imap_store_summary_full_from_path(imap_store->summary, parent_name);
- if (parent_real == NULL) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_FOLDER_INVALID_STATE,
- _("Unknown parent folder: %s"), parent_name);
- return NULL;
- }
-
- need_convert = FALSE;
- response = camel_imap_command (imap_store, NULL, ex, "LIST \"\" %S",
- parent_real);
- if (!response) /* whoa, this is bad */ {
- g_free(parent_real);
- return NULL;
- }
-
- /* FIXME: does not handle unexpected circumstances very well */
- for (i = 0; i < response->untagged->len; i++) {
- resp = response->untagged->pdata[i];
-
- if (!imap_parse_list_response (imap_store, resp, &flags, NULL, &thisone))
- continue;
-
- if (strcmp (thisone, parent_name) == 0) {
- if (flags & CAMEL_FOLDER_NOINFERIORS)
- need_convert = TRUE;
- break;
- }
- }
-
- camel_imap_response_free (imap_store, response);
-
- camel_exception_init (&internal_ex);
-
- /* if not, check if we can delete it and recreate it */
- if (need_convert) {
- char *name;
-
- if (get_folder_status (imap_store, parent_name, "MESSAGES")) {
- camel_exception_set (ex, CAMEL_EXCEPTION_FOLDER_INVALID_STATE,
- _("The parent folder is not allowed to contain subfolders"));
- g_free(parent_real);
- return NULL;
- }
-
- /* delete the old parent and recreate it */
- delete_folder (store, parent_name, &internal_ex);
- if (camel_exception_is_set (&internal_ex)) {
- camel_exception_xfer (ex, &internal_ex);
- return NULL;
- }
-
- /* add the dirsep to the end of parent_name */
- name = g_strdup_printf ("%s%c", parent_real, imap_store->dir_sep);
- response = camel_imap_command (imap_store, NULL, ex, "CREATE %S",
- name);
- g_free (name);
-
- if (!response) {
- g_free(parent_real);
- return NULL;
- } else
- camel_imap_response_free (imap_store, response);
-
- root = imap_build_folder_info(imap_store, parent_name);
- }
-
- /* ok now we can create the folder */
- real_name = camel_imap_store_summary_path_to_full(imap_store->summary, folder_name, store->dir_sep);
- full_name = imap_concat (imap_store, parent_real, real_name);
- g_free(real_name);
- response = camel_imap_command (imap_store, NULL, ex, "CREATE %S", full_name);
-
- if (response) {
- CamelImapStoreInfo *si;
- CamelFolderInfo *fi;
-
- camel_imap_response_free (imap_store, response);
-
- si = camel_imap_store_summary_add_from_full(imap_store->summary, full_name, store->dir_sep);
- camel_store_summary_save((CamelStoreSummary *)imap_store->summary);
- fi = imap_build_folder_info(imap_store, camel_store_info_path(imap_store->summary, si));
- if (root) {
- root->child = fi;
- fi->parent = root;
- } else {
- root = fi;
- }
- camel_object_trigger_event (CAMEL_OBJECT (store), "folder_created", root);
- } else if (root) {
- /* need to re-recreate the folder we just deleted */
- camel_object_trigger_event (CAMEL_OBJECT (store), "folder_created", root);
- camel_folder_info_free(root);
- root = NULL;
- }
-
- g_free (full_name);
- g_free(parent_real);
-
- return root;
-}
-
-static CamelFolderInfo *
-parse_list_response_as_folder_info (CamelImapStore *imap_store,
- const char *response)
-{
- CamelFolderInfo *fi;
- int flags;
- char sep, *dir;
- CamelURL *url;
- CamelImapStoreInfo *si;
- guint32 newflags;
-
- if (!imap_parse_list_response (imap_store, response, &flags, &sep, &dir))
- return NULL;
-
- /* FIXME: should use imap_build_folder_info, note the differences with param setting tho */
-
- si = camel_imap_store_summary_add_from_full(imap_store->summary, dir, sep?sep:'/');
- newflags = (si->info.flags & CAMEL_STORE_INFO_FOLDER_SUBSCRIBED) | (flags & ~CAMEL_STORE_INFO_FOLDER_SUBSCRIBED);
- if (si->info.flags != newflags) {
- si->info.flags = newflags;
- camel_store_summary_touch((CamelStoreSummary *)imap_store->summary);
- }
-
- fi = g_new0 (CamelFolderInfo, 1);
- fi->flags = flags;
- fi->name = g_strdup(camel_store_info_name(imap_store->summary, si));
- fi->path = g_strdup_printf("/%s", camel_store_info_path(imap_store->summary, si));
- fi->full_name = g_strdup(fi->path+1);
-
- url = camel_url_new (imap_store->base_url, NULL);
- camel_url_set_path(url, fi->path);
-
- if (flags & CAMEL_FOLDER_NOSELECT || fi->name[0] == 0)
- camel_url_set_param (url, "noselect", "yes");
- fi->url = camel_url_to_string (url, 0);
- camel_url_free (url);
-
- /* FIXME: redundant */
- if (flags & CAMEL_IMAP_FOLDER_UNMARKED)
- fi->unread_message_count = -1;
-
- return fi;
-}
-
-/* this is used when lsub doesn't provide very useful information */
-static GPtrArray *
-get_subscribed_folders (CamelImapStore *imap_store, const char *top, CamelException *ex)
-{
- GPtrArray *names, *folders;
- int i, toplen = strlen (top);
- CamelStoreInfo *si;
- CamelImapResponse *response;
- CamelFolderInfo *fi;
- char *result;
- int haveinbox = FALSE;
-
- folders = g_ptr_array_new ();
- names = g_ptr_array_new ();
- for (i=0;(si = camel_store_summary_index((CamelStoreSummary *)imap_store->summary, i));i++) {
- if (si->flags & CAMEL_STORE_INFO_FOLDER_SUBSCRIBED) {
- g_ptr_array_add(names, (char *)camel_imap_store_info_full_name(imap_store->summary, si));
- haveinbox = haveinbox || strcasecmp(camel_imap_store_info_full_name(imap_store->summary, si), "INBOX") == 0;
- }
- camel_store_summary_info_free((CamelStoreSummary *)imap_store->summary, si);
- }
-
- if (!haveinbox)
- g_ptr_array_add (names, "INBOX");
-
- for (i = 0; i < names->len; i++) {
- response = camel_imap_command (imap_store, NULL, ex,
- "LIST \"\" %S",
- names->pdata[i]);
- if (!response)
- break;
-
- result = camel_imap_response_extract (imap_store, response, "LIST", NULL);
- if (!result) {
- camel_store_summary_remove_path((CamelStoreSummary *)imap_store->summary, names->pdata[i]);
- g_ptr_array_remove_index_fast (names, i);
- i--;
- continue;
- }
-
- fi = parse_list_response_as_folder_info (imap_store, result);
- if (!fi)
- continue;
-
- if (strncmp (top, fi->full_name, toplen) != 0) {
- camel_folder_info_free (fi);
- continue;
- }
-
- g_ptr_array_add (folders, fi);
- }
-
- g_ptr_array_free (names, TRUE);
-
- return folders;
-}
-
-static int imap_match_pattern(char dir_sep, const char *pattern, const char *name)
-{
- char p, n;
-
- p = *pattern++;
- n = *name++;
- while (n && p) {
- if (n == p) {
- p = *pattern++;
- n = *name++;
- } else if (p == '%') {
- if (n != dir_sep) {
- n = *name++;
- } else {
- p = *pattern++;
- }
- } else if (p == '*') {
- return TRUE;
- } else
- return FALSE;
- }
-
- return n == 0 && (p == '%' || p == 0);
-}
-
-static void
-get_folders_online (CamelImapStore *imap_store, const char *pattern,
- GPtrArray *folders, gboolean lsub, CamelException *ex)
-{
- CamelImapResponse *response;
- CamelFolderInfo *fi;
- char *list;
- int i, count;
- GHashTable *present;
- CamelStoreInfo *si;
-
- response = camel_imap_command (imap_store, NULL, ex,
- "%s \"\" %S", lsub ? "LSUB" : "LIST",
- pattern);
- if (!response)
- return;
-
- present = g_hash_table_new(g_str_hash, g_str_equal);
- for (i = 0; i < response->untagged->len; i++) {
- list = response->untagged->pdata[i];
- fi = parse_list_response_as_folder_info (imap_store, list);
- if (fi) {
- g_ptr_array_add(folders, fi);
- g_hash_table_insert(present, fi->full_name, fi);
- }
- }
- camel_imap_response_free (imap_store, response);
-
- /* update our summary to match the server */
- count = camel_store_summary_count((CamelStoreSummary *)imap_store->summary);
- for (i=0;i<count;i++) {
- si = camel_store_summary_index((CamelStoreSummary *)imap_store->summary, i);
- if (si == NULL)
- continue;
-
- if (imap_match_pattern(((CamelStore *)imap_store)->dir_sep, pattern, camel_imap_store_info_full_name(imap_store->summary, si))) {
- if (g_hash_table_lookup(present, camel_store_info_path(imap_store->summary, si)) != NULL) {
- if (lsub && (si->flags & CAMEL_STORE_INFO_FOLDER_SUBSCRIBED) == 0) {
- si->flags |= CAMEL_STORE_INFO_FOLDER_SUBSCRIBED;
- camel_store_summary_touch((CamelStoreSummary *)imap_store->summary);
- }
- } else {
- if (lsub) {
- if (si->flags & CAMEL_STORE_INFO_FOLDER_SUBSCRIBED) {
- si->flags &= ~CAMEL_STORE_INFO_FOLDER_SUBSCRIBED;
- camel_store_summary_touch((CamelStoreSummary *)imap_store->summary);
- }
- } else {
- camel_store_summary_remove((CamelStoreSummary *)imap_store->summary, si);
- count--;
- i--;
- }
- }
- }
- camel_store_summary_info_free((CamelStoreSummary *)imap_store->summary, si);
- }
- g_hash_table_destroy(present);
-}
-
-#if 0
-static void
-dumpfi(CamelFolderInfo *fi)
-{
- int depth;
- CamelFolderInfo *n = fi;
-
- if (fi == NULL)
- return;
-
- depth = 0;
- while (n->parent) {
- depth++;
- n = n->parent;
- }
-
- while (fi) {
- printf("%-40s %-30s %*s\n", fi->path, fi->full_name, depth*2+strlen(fi->url), fi->url);
- if (fi->child)
- dumpfi(fi->child);
- fi = fi->sibling;
- }
-}
-#endif
-
-static void
-get_folder_counts(CamelImapStore *imap_store, CamelFolderInfo *fi, CamelException *ex)
-{
- GSList *q;
- CamelFolder *folder;
-
- /* non-recursive breath first search */
-
- q = g_slist_append(NULL, fi);
-
- while (q) {
- fi = q->data;
- q = g_slist_remove_link(q, q);
-
- while (fi) {
- /* ignore noselect folders, and check only inbox if we only check inbox */
- if ((fi->flags & CAMEL_FOLDER_NOSELECT) == 0
- && ( (imap_store->parameters & IMAP_PARAM_CHECK_ALL)
- || strcasecmp(fi->full_name, "inbox") == 0) ) {
-
- CAMEL_SERVICE_LOCK (imap_store, connect_lock);
- /* For the current folder, poke it to check for new
- * messages and then report that number, rather than
- * doing a STATUS command.
- */
- if (imap_store->current_folder && strcmp(imap_store->current_folder->full_name, fi->full_name) == 0) {
- /* we bypass the folder locking otherwise we can deadlock. we use the command lock for
- any operations anyway so this is 'safe'. See comment above imap_store_refresh_folders() for info */
- CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(imap_store->current_folder))->refresh_info(imap_store->current_folder, ex);
- fi->unread_message_count = camel_folder_get_unread_message_count (imap_store->current_folder);
- } else {
- fi->unread_message_count = get_folder_status (imap_store, fi->full_name, "UNSEEN");
- /* if we have this folder open, and the unread count has changed, update */
- folder = camel_object_bag_get(CAMEL_STORE(imap_store)->folders, fi->full_name);
- if (folder && fi->unread_message_count != camel_folder_get_unread_message_count(folder)) {
- CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(folder))->refresh_info(folder, ex);
- fi->unread_message_count = camel_folder_get_unread_message_count(folder);
- }
- if (folder)
- camel_object_unref(folder);
-
- }
-
- CAMEL_SERVICE_UNLOCK (imap_store, connect_lock);
- } else {
- /* since its cheap, get it if they're open */
- folder = camel_object_bag_get(CAMEL_STORE(imap_store)->folders, fi->full_name);
- if (folder) {
- fi->unread_message_count = camel_folder_get_unread_message_count(folder);
- camel_object_unref(folder);
- } else
- fi->unread_message_count = -1;
- }
-
- if (fi->child)
- q = g_slist_append(q, fi->child);
- fi = fi->sibling;
- }
- }
-}
-
-/* imap needs to treat inbox case insensitive */
-/* we'll assume the names are normalised already */
-static guint folder_hash(const void *ap)
-{
- const char *a = ap;
-
- if (strcasecmp(a, "INBOX") == 0)
- a = "INBOX";
-
- return g_str_hash(a);
-}
-
-static int folder_eq(const void *ap, const void *bp)
-{
- const char *a = ap;
- const char *b = bp;
-
- if (strcasecmp(a, "INBOX") == 0)
- a = "INBOX";
- if (strcasecmp(b, "INBOX") == 0)
- b = "INBOX";
-
- return g_str_equal(a, b);
-}
-
-static GPtrArray *
-get_folders(CamelStore *store, const char *top, guint32 flags, CamelException *ex)
-{
- CamelImapStore *imap_store = CAMEL_IMAP_STORE (store);
- GSList *p = NULL;
- GHashTable *infos;
- int i;
- GPtrArray *folders, *folders_out;
- CamelFolderInfo *fi;
- char *name;
- int depth = 0;
- int haveinbox = 0;
- static int imap_max_depth = 0;
-
- if (!camel_imap_store_connected (imap_store, ex))
- return NULL;
-
- /* allow megalomaniacs to override the max of 10 */
- if (imap_max_depth == 0) {
- name = getenv("CAMEL_IMAP_MAX_DEPTH");
- if (name) {
- imap_max_depth = atoi (name);
- imap_max_depth = MIN (MAX (imap_max_depth, 0), 2);
- } else
- imap_max_depth = 10;
- }
-
- infos = g_hash_table_new(folder_hash, folder_eq);
-
- /* get starting point & strip trailing '/' */
- if (top[0] == 0) {
- if (imap_store->namespace) {
- top = imap_store->namespace;
- i = strlen(top)-1;
- name = g_malloc(i+2);
- strcpy(name, top);
- while (i>0 && name[i] == store->dir_sep)
- name[i--] = 0;
- } else
- name = g_strdup("");
- } else {
- name = camel_imap_store_summary_full_from_path(imap_store->summary, top);
- if (name == NULL)
- name = camel_imap_store_summary_path_to_full(imap_store->summary, top, store->dir_sep);
- }
-
- d(printf("\n\nList '%s' %s\n", name, flags&CAMEL_STORE_FOLDER_INFO_RECURSIVE?"RECURSIVE":"NON-RECURSIVE"));
-
- folders_out = g_ptr_array_new();
- folders = g_ptr_array_new();
-
- /* first get working list of names */
- get_folders_online (imap_store, name[0]?name:"%", folders, flags & CAMEL_STORE_FOLDER_INFO_SUBSCRIBED, ex);
- if (camel_exception_is_set(ex))
- goto fail;
- for (i=0; i<folders->len && !haveinbox; i++) {
- fi = folders->pdata[i];
- haveinbox = (strcasecmp(fi->full_name, "INBOX")) == 0;
- }
-
- if (!haveinbox && top == imap_store->namespace) {
- get_folders_online (imap_store, "INBOX", folders,
- flags & CAMEL_STORE_FOLDER_INFO_SUBSCRIBED, ex);
-
- if (camel_exception_is_set (ex))
- goto fail;
- }
-
- for (i=0; i<folders->len; i++)
- p = g_slist_prepend(p, folders->pdata[i]);
-
- g_ptr_array_set_size(folders, 0);
-
- /* p is a reversed list of pending folders for the next level, q is the list of folders for this */
- while (p) {
- GSList *q = g_slist_reverse(p);
-
- p = NULL;
- while (q) {
- fi = q->data;
-
- q = g_slist_remove_link(q, q);
- g_ptr_array_add(folders_out, fi);
-
- d(printf("Checking folder '%s'\n", fi->full_name));
-
- /* First if we're not recursive mode on the top level, and we know it has or doesn't
- or can't have children, no need to go further - a bit ugly */
- if ( top == imap_store->namespace
- && (flags & CAMEL_STORE_FOLDER_INFO_RECURSIVE) == 0
- && (fi->flags & (CAMEL_FOLDER_CHILDREN|CAMEL_IMAP_FOLDER_NOCHILDREN|CAMEL_FOLDER_NOINFERIORS)) != 0) {
- /* do nothing */
- }
- /* Otherwise, if this has (or might have) children, scan it */
- else if ( (fi->flags & (CAMEL_IMAP_FOLDER_NOCHILDREN|CAMEL_FOLDER_NOINFERIORS)) == 0
- || (fi->flags & CAMEL_FOLDER_CHILDREN) != 0) {
- char *n, *real;
-
- real = camel_imap_store_summary_full_from_path(imap_store->summary, fi->full_name);
- n = imap_concat(imap_store, real?real:fi->full_name, "%");
- get_folders_online(imap_store, n, folders, flags & CAMEL_STORE_FOLDER_INFO_SUBSCRIBED, ex);
- g_free(n);
- g_free(real);
-
- if (folders->len > 0)
- fi->flags |= CAMEL_FOLDER_CHILDREN;
-
- for (i=0;i<folders->len;i++) {
- fi = folders->pdata[i];
- if (g_hash_table_lookup(infos, fi->full_name) == NULL) {
- g_hash_table_insert(infos, fi->full_name, fi);
- if ((flags & CAMEL_STORE_FOLDER_INFO_RECURSIVE) && depth<imap_max_depth)
- p = g_slist_prepend(p, fi);
- else
- g_ptr_array_add(folders_out, fi);
- } else {
- camel_folder_info_free(fi);
- }
- }
- g_ptr_array_set_size(folders, 0);
- }
- }
- depth++;
- }
-
- g_ptr_array_free(folders, TRUE);
- g_hash_table_destroy(infos);
- g_free(name);
-
- return folders_out;
-fail:
- g_ptr_array_free(folders, TRUE);
- g_ptr_array_free(folders_out, TRUE);
- g_hash_table_destroy(infos);
- g_free(name);
-
- return NULL;
-}
-
-static CamelFolderInfo *
-get_folder_info_online (CamelStore *store, const char *top, guint32 flags, CamelException *ex)
-{
- CamelImapStore *imap_store = CAMEL_IMAP_STORE (store);
- CamelFolderInfo *tree;
- GPtrArray *folders;
-
- if (top == NULL)
- top = "";
-
- if ((flags & CAMEL_STORE_FOLDER_INFO_SUBSCRIBED)
- && !(imap_store->capabilities & IMAP_CAPABILITY_useful_lsub)
- && (imap_store->parameters & IMAP_PARAM_CHECK_ALL))
- folders = get_subscribed_folders(imap_store, top, ex);
- else
- folders = get_folders(store, top, flags, ex);
-
- if (folders == NULL)
- return NULL;
-
- tree = camel_folder_info_build(folders, top, '/', TRUE);
- g_ptr_array_free(folders, TRUE);
-
- if (!(flags & CAMEL_STORE_FOLDER_INFO_FAST))
- get_folder_counts(imap_store, tree, ex);
-
- d(dumpfi(tree));
- camel_store_summary_save((CamelStoreSummary *)imap_store->summary);
-
- return tree;
-}
-
-static gboolean
-get_one_folder_offline (const char *physical_path, const char *path, gpointer data)
-{
- GPtrArray *folders = data;
- CamelImapStore *imap_store = folders->pdata[0];
- CamelFolderInfo *fi;
- CamelStoreInfo *si;
-
- if (*path != '/')
- return TRUE;
-
- /* folder_info_build will insert parent nodes as necessary and mark
- * them as noselect, which is information we actually don't have at
- * the moment. So let it do the right thing by bailing out if it's
- * not a folder we're explicitly interested in.
- */
-
- si = camel_store_summary_path((CamelStoreSummary *)imap_store->summary, path+1);
- if (si) {
- if ((((CamelStore *)imap_store)->flags & CAMEL_STORE_SUBSCRIPTIONS) == 0
- || (si->flags & CAMEL_STORE_INFO_FOLDER_SUBSCRIBED)) {
- fi = imap_build_folder_info(imap_store, path+1);
- fi->flags = si->flags;
- if (si->flags & CAMEL_FOLDER_NOSELECT) {
- CamelURL *url = camel_url_new(fi->url, NULL);
-
- camel_url_set_param (url, "noselect", "yes");
- g_free(fi->url);
- fi->url = camel_url_to_string (url, 0);
- camel_url_free (url);
- }
- g_ptr_array_add (folders, fi);
- }
- camel_store_summary_info_free((CamelStoreSummary *)imap_store->summary, si);
- }
-
- return TRUE;
-}
-
-static CamelFolderInfo *
-get_folder_info_offline (CamelStore *store, const char *top,
- guint32 flags, CamelException *ex)
-{
- CamelImapStore *imap_store = CAMEL_IMAP_STORE (store);
- CamelFolderInfo *fi;
- GPtrArray *folders;
- char *storage_path;
-
- if (!imap_store->connected &&
- !camel_service_connect (CAMEL_SERVICE (store), ex))
- return NULL;
-
- if ((store->flags & CAMEL_STORE_SUBSCRIPTIONS) &&
- !(flags & CAMEL_STORE_FOLDER_INFO_SUBSCRIBED)) {
- camel_disco_store_check_online (CAMEL_DISCO_STORE (store), ex);
- return NULL;
- }
-
- /* FIXME: obey other flags */
-
- folders = g_ptr_array_new ();
-
- /* A kludge to avoid having to pass a struct to the callback */
- g_ptr_array_add (folders, imap_store);
- storage_path = g_strdup_printf("%s/folders", imap_store->storage_path);
- if (!e_path_find_folders (storage_path, get_one_folder_offline, folders)) {
- camel_disco_store_check_online (CAMEL_DISCO_STORE (imap_store), ex);
- fi = NULL;
- } else {
- g_ptr_array_remove_index_fast (folders, 0);
- fi = camel_folder_info_build (folders, "", '/', TRUE);
- }
- g_free(storage_path);
-
- g_ptr_array_free (folders, TRUE);
- return fi;
-}
-
-static gboolean
-folder_subscribed (CamelStore *store, const char *folder_name)
-{
- CamelImapStore *imap_store = CAMEL_IMAP_STORE (store);
- CamelStoreInfo *si;
- int truth = FALSE;
-
- si = camel_store_summary_path((CamelStoreSummary *)imap_store->summary, folder_name);
- if (si) {
- truth = (si->flags & CAMEL_STORE_INFO_FOLDER_SUBSCRIBED) != 0;
- camel_store_summary_info_free((CamelStoreSummary *)imap_store->summary, si);
- }
-
- return truth;
-}
-
-/* Note: folder_name must match a folder as listed with get_folder_info() -> full_name */
-static void
-subscribe_folder (CamelStore *store, const char *folder_name,
- CamelException *ex)
-{
- CamelImapStore *imap_store = CAMEL_IMAP_STORE (store);
- CamelImapResponse *response;
- CamelFolderInfo *fi;
- CamelStoreInfo *si;
-
- if (!camel_disco_store_check_online (CAMEL_DISCO_STORE (store), ex))
- return;
- if (!camel_imap_store_connected (imap_store, ex))
- return;
-
- response = camel_imap_command (imap_store, NULL, ex,
- "SUBSCRIBE %F", folder_name);
- if (!response)
- return;
- camel_imap_response_free (imap_store, response);
-
- si = camel_store_summary_path((CamelStoreSummary *)imap_store->summary, folder_name);
- if (si) {
- if ((si->flags & CAMEL_STORE_INFO_FOLDER_SUBSCRIBED) == 0) {
- si->flags |= CAMEL_STORE_INFO_FOLDER_SUBSCRIBED;
- camel_store_summary_touch((CamelStoreSummary *)imap_store->summary);
- camel_store_summary_save((CamelStoreSummary *)imap_store->summary);
- }
- camel_store_summary_info_free((CamelStoreSummary *)imap_store->summary, si);
- }
-
- if (imap_store->renaming) {
- /* we don't need to emit a "folder_subscribed" signal
- if we are in the process of renaming folders, so we
- are done here... */
- return;
- }
-
- fi = imap_build_folder_info(imap_store, folder_name);
- camel_object_trigger_event (CAMEL_OBJECT (store), "folder_subscribed", fi);
- camel_folder_info_free (fi);
-}
-
-static void
-unsubscribe_folder (CamelStore *store, const char *folder_name,
- CamelException *ex)
-{
- CamelImapStore *imap_store = CAMEL_IMAP_STORE (store);
- CamelImapResponse *response;
-
- if (!camel_disco_store_check_online (CAMEL_DISCO_STORE (store), ex))
- return;
- if (!camel_imap_store_connected (imap_store, ex))
- return;
-
- response = camel_imap_command (imap_store, NULL, ex,
- "UNSUBSCRIBE %F", folder_name);
- if (!response)
- return;
- camel_imap_response_free (imap_store, response);
-
- imap_folder_effectively_unsubscribed (imap_store, folder_name, ex);
-}
-
-#if 0
-static gboolean
-folder_flags_have_changed (CamelFolder *folder)
-{
- CamelMessageInfo *info;
- int i, max;
-
- max = camel_folder_summary_count (folder->summary);
- for (i = 0; i < max; i++) {
- info = camel_folder_summary_index (folder->summary, i);
- if (!info)
- continue;
- if (info->flags & CAMEL_MESSAGE_FOLDER_FLAGGED) {
- return TRUE;
- }
- }
-
- return FALSE;
-}
-#endif
-
-
-gboolean
-camel_imap_store_connected (CamelImapStore *store, CamelException *ex)
-{
- if (store->istream == NULL || !store->connected)
- return camel_service_connect (CAMEL_SERVICE (store), ex);
- return TRUE;
-}
-
-
-/* FIXME: please god, when will the hurting stop? Thus function is so
- fucking broken it's not even funny. */
-ssize_t
-camel_imap_store_readline (CamelImapStore *store, char **dest, CamelException *ex)
-{
- CamelStreamBuffer *stream;
- char linebuf[1024];
- GByteArray *ba;
- ssize_t nread;
-
- g_return_val_if_fail (CAMEL_IS_IMAP_STORE (store), -1);
- g_return_val_if_fail (dest, -1);
-
- *dest = NULL;
-
- /* Check for connectedness. Failed (or cancelled) operations will
- * close the connection. We can't expect a read to have any
- * meaning if we reconnect, so always set an exception.
- */
-
- if (!camel_imap_store_connected (store, ex)) {
- camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_NOT_CONNECTED,
- g_strerror (errno));
- return -1;
- }
-
- stream = CAMEL_STREAM_BUFFER (store->istream);
-
- ba = g_byte_array_new ();
- while ((nread = camel_stream_buffer_gets (stream, linebuf, sizeof (linebuf))) > 0) {
- g_byte_array_append (ba, linebuf, nread);
- if (linebuf[nread - 1] == '\n')
- break;
- }
-
- if (nread <= 0) {
- if (errno == EINTR)
- camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL, _("Operation cancelled"));
- else
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
- _("Server unexpectedly disconnected: %s"),
- g_strerror (errno));
-
- camel_service_disconnect (CAMEL_SERVICE (store), FALSE, NULL);
- g_byte_array_free (ba, TRUE);
- return -1;
- }
-
- if (camel_verbose_debug) {
- fprintf (stderr, "received: ");
- fwrite (ba->data, 1, ba->len, stderr);
- }
-
- /* camel-imap-command.c:imap_read_untagged expects the CRLFs
- to be stripped off and be nul-terminated *sigh* */
- nread = ba->len - 1;
- ba->data[nread] = '\0';
- if (ba->data[nread - 1] == '\r') {
- ba->data[nread - 1] = '\0';
- nread--;
- }
-
- *dest = ba->data;
- g_byte_array_free (ba, FALSE);
-
- return nread;
-}
diff --git a/camel/providers/imap/camel-imap-store.h b/camel/providers/imap/camel-imap-store.h
deleted file mode 100644
index b45fb2110e..0000000000
--- a/camel/providers/imap/camel-imap-store.h
+++ /dev/null
@@ -1,148 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-imap-store.h : class for an imap store */
-
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright (C) 2000 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifndef CAMEL_IMAP_STORE_H
-#define CAMEL_IMAP_STORE_H 1
-
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include "camel-imap-types.h"
-#include <camel/camel-disco-store.h>
-
-#ifdef ENABLE_THREADS
-#include <e-util/e-msgport.h>
-
-typedef struct _CamelImapMsg CamelImapMsg;
-
-struct _CamelImapMsg {
- EMsg msg;
-
- void (*receive)(CamelImapStore *store, struct _CamelImapMsg *m);
- void (*free)(CamelImapStore *store, struct _CamelImapMsg *m);
-};
-
-CamelImapMsg *camel_imap_msg_new(void (*receive)(CamelImapStore *store, struct _CamelImapMsg *m),
- void (*free)(CamelImapStore *store, struct _CamelImapMsg *m),
- size_t size);
-void camel_imap_msg_queue(CamelImapStore *store, CamelImapMsg *msg);
-
-#endif
-
-#define CAMEL_IMAP_STORE_TYPE (camel_imap_store_get_type ())
-#define CAMEL_IMAP_STORE(obj) (CAMEL_CHECK_CAST((obj), CAMEL_IMAP_STORE_TYPE, CamelImapStore))
-#define CAMEL_IMAP_STORE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_IMAP_STORE_TYPE, CamelImapStoreClass))
-#define CAMEL_IS_IMAP_STORE(o) (CAMEL_CHECK_TYPE((o), CAMEL_IMAP_STORE_TYPE))
-
-enum {
- CAMEL_IMAP_STORE_ARG_FIRST = CAMEL_DISCO_STORE_ARG_FIRST + 100,
- CAMEL_IMAP_STORE_ARG_NAMESPACE,
- CAMEL_IMAP_STORE_ARG_OVERRIDE_NAMESPACE,
- CAMEL_IMAP_STORE_ARG_CHECK_ALL,
- CAMEL_IMAP_STORE_ARG_FILTER_INBOX
-};
-
-#define CAMEL_IMAP_STORE_NAMESPACE (CAMEL_IMAP_STORE_ARG_NAMESPACE | CAMEL_ARG_STR)
-#define CAMEL_IMAP_STORE_OVERRIDE_NAMESPACE (CAMEL_IMAP_STORE_ARG_OVERRIDE_NAMESPACE | CAMEL_ARG_INT)
-#define CAMEL_IMAP_STORE_CHECK_ALL (CAMEL_IMAP_STORE_ARG_CHECK_ALL | CAMEL_ARG_INT)
-#define CAMEL_IMAP_STORE_FILTER_INBOX (CAMEL_IMAP_STORE_ARG_FILTER_INBOX | CAMEL_ARG_INT)
-
-/* CamelFolderInfo flags */
-#define CAMEL_IMAP_FOLDER_MARKED (1<<16)
-#define CAMEL_IMAP_FOLDER_UNMARKED (1<<17)
-#define CAMEL_IMAP_FOLDER_NOCHILDREN (1<<18)
-
-
-typedef enum {
- IMAP_LEVEL_UNKNOWN,
- IMAP_LEVEL_IMAP4,
- IMAP_LEVEL_IMAP4REV1
-} CamelImapServerLevel;
-
-#define IMAP_CAPABILITY_IMAP4 (1 << 0)
-#define IMAP_CAPABILITY_IMAP4REV1 (1 << 1)
-#define IMAP_CAPABILITY_STATUS (1 << 2)
-#define IMAP_CAPABILITY_NAMESPACE (1 << 3)
-#define IMAP_CAPABILITY_UIDPLUS (1 << 4)
-#define IMAP_CAPABILITY_LITERALPLUS (1 << 5)
-#define IMAP_CAPABILITY_STARTTLS (1 << 6)
-#define IMAP_CAPABILITY_useful_lsub (1 << 7)
-#define IMAP_CAPABILITY_utf8_search (1 << 8)
-
-#define IMAP_PARAM_OVERRIDE_NAMESPACE (1 << 0)
-#define IMAP_PARAM_CHECK_ALL (1 << 1)
-#define IMAP_PARAM_FILTER_INBOX (1 << 2)
-
-struct _CamelImapStore {
- CamelDiscoStore parent_object;
-
- CamelStream *istream;
- CamelStream *ostream;
-
- struct _CamelImapStoreSummary *summary;
-
- /* Information about the command channel / connection status */
- gboolean connected;
- gboolean preauthed;
- char tag_prefix;
- guint32 command;
- CamelFolder *current_folder;
-
- /* Information about the server */
- CamelImapServerLevel server_level;
- guint32 capabilities, parameters;
- /* NB: namespace should be handled by summary->namespace */
- char *namespace, dir_sep, *base_url, *storage_path;
- GHashTable *authtypes;
-
- gboolean renaming;
-
-#ifdef ENABLE_THREADS
- EThread *async_thread;
-#endif
-};
-
-
-typedef struct {
- CamelDiscoStoreClass parent_class;
-
-} CamelImapStoreClass;
-
-
-/* Standard Camel function */
-CamelType camel_imap_store_get_type (void);
-
-
-gboolean camel_imap_store_connected (CamelImapStore *store, CamelException *ex);
-
-ssize_t camel_imap_store_readline (CamelImapStore *store, char **dest, CamelException *ex);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_IMAP_STORE_H */
diff --git a/camel/providers/imap/camel-imap-summary.c b/camel/providers/imap/camel-imap-summary.c
deleted file mode 100644
index dba1134fa1..0000000000
--- a/camel/providers/imap/camel-imap-summary.c
+++ /dev/null
@@ -1,255 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors:
- * Michael Zucchi <notzed@ximian.com>
- * Dan Winship <danw@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <sys/stat.h>
-#include <sys/uio.h>
-#include <unistd.h>
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include "camel-imap-summary.h"
-#include "camel-file-utils.h"
-
-#define CAMEL_IMAP_SUMMARY_VERSION (0x300)
-
-static int summary_header_load (CamelFolderSummary *, FILE *);
-static int summary_header_save (CamelFolderSummary *, FILE *);
-
-static CamelMessageInfo *message_info_load (CamelFolderSummary *s, FILE *in);
-static int message_info_save (CamelFolderSummary *s, FILE *out,
- CamelMessageInfo *info);
-static CamelMessageContentInfo *content_info_load (CamelFolderSummary *s, FILE *in);
-static int content_info_save (CamelFolderSummary *s, FILE *out,
- CamelMessageContentInfo *info);
-
-static void camel_imap_summary_class_init (CamelImapSummaryClass *klass);
-static void camel_imap_summary_init (CamelImapSummary *obj);
-
-static CamelFolderSummaryClass *camel_imap_summary_parent;
-
-CamelType
-camel_imap_summary_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register(
- camel_folder_summary_get_type(), "CamelImapSummary",
- sizeof (CamelImapSummary),
- sizeof (CamelImapSummaryClass),
- (CamelObjectClassInitFunc) camel_imap_summary_class_init,
- NULL,
- (CamelObjectInitFunc) camel_imap_summary_init,
- NULL);
- }
-
- return type;
-}
-
-static void
-camel_imap_summary_class_init (CamelImapSummaryClass *klass)
-{
- CamelFolderSummaryClass *cfs_class = (CamelFolderSummaryClass *) klass;
-
- camel_imap_summary_parent = CAMEL_FOLDER_SUMMARY_CLASS (camel_type_get_global_classfuncs (camel_folder_summary_get_type()));
-
- cfs_class->summary_header_load = summary_header_load;
- cfs_class->summary_header_save = summary_header_save;
- cfs_class->message_info_load = message_info_load;
- cfs_class->message_info_save = message_info_save;
- cfs_class->content_info_load = content_info_load;
- cfs_class->content_info_save = content_info_save;
-}
-
-static void
-camel_imap_summary_init (CamelImapSummary *obj)
-{
- CamelFolderSummary *s = (CamelFolderSummary *)obj;
-
- /* subclasses need to set the right instance data sizes */
- s->message_info_size = sizeof(CamelImapMessageInfo);
- s->content_info_size = sizeof(CamelImapMessageContentInfo);
-
- /* and a unique file version */
- s->version += CAMEL_IMAP_SUMMARY_VERSION;
-}
-
-/**
- * camel_imap_summary_new:
- * @filename: the file to store the summary in.
- *
- * This will create a new CamelImapSummary object and read in the
- * summary data from disk, if it exists.
- *
- * Return value: A new CamelImapSummary object.
- **/
-CamelFolderSummary *
-camel_imap_summary_new (const char *filename)
-{
- CamelFolderSummary *summary = CAMEL_FOLDER_SUMMARY (
- camel_object_new (camel_imap_summary_get_type ()));
-
- camel_folder_summary_set_build_content (summary, TRUE);
- camel_folder_summary_set_filename (summary, filename);
-
- if (camel_folder_summary_load (summary) == -1) {
- camel_folder_summary_clear (summary);
- camel_folder_summary_touch (summary);
- }
-
- return summary;
-}
-
-
-static int
-summary_header_load (CamelFolderSummary *s, FILE *in)
-{
- CamelImapSummary *ims = CAMEL_IMAP_SUMMARY (s);
-
- if (camel_imap_summary_parent->summary_header_load (s, in) == -1)
- return -1;
-
- return camel_file_util_decode_uint32 (in, &ims->validity);
-}
-
-static int
-summary_header_save (CamelFolderSummary *s, FILE *out)
-{
- CamelImapSummary *ims = CAMEL_IMAP_SUMMARY(s);
-
- if (camel_imap_summary_parent->summary_header_save (s, out) == -1)
- return -1;
-
- return camel_file_util_encode_uint32 (out, ims->validity);
-}
-
-
-static CamelMessageInfo *
-message_info_load (CamelFolderSummary *s, FILE *in)
-{
- CamelMessageInfo *info;
- CamelImapMessageInfo *iinfo;
-
- info = camel_imap_summary_parent->message_info_load (s, in);
- if (info) {
- iinfo = (CamelImapMessageInfo *)info;
-
- if (camel_file_util_decode_uint32 (in, &iinfo->server_flags) == -1)
- goto error;
- }
-
- return info;
-error:
- camel_folder_summary_info_free (s, info);
- return NULL;
-}
-
-static int
-message_info_save (CamelFolderSummary *s, FILE *out, CamelMessageInfo *info)
-{
- CamelImapMessageInfo *iinfo = (CamelImapMessageInfo *)info;
-
- if (camel_imap_summary_parent->message_info_save (s, out, info) == -1)
- return -1;
-
- return camel_file_util_encode_uint32 (out, iinfo->server_flags);
-}
-
-
-static CamelMessageContentInfo *
-content_info_load (CamelFolderSummary *s, FILE *in)
-{
- if (fgetc (in))
- return camel_imap_summary_parent->content_info_load (s, in);
- else
- return camel_folder_summary_content_info_new (s);
-}
-
-static int
-content_info_save (CamelFolderSummary *s, FILE *out,
- CamelMessageContentInfo *info)
-{
- if (info->type) {
- fputc (1, out);
- return camel_imap_summary_parent->content_info_save (s, out, info);
- } else
- return fputc (0, out);
-}
-
-void
-camel_imap_summary_add_offline (CamelFolderSummary *summary, const char *uid,
- CamelMimeMessage *message,
- const CamelMessageInfo *info)
-{
- CamelMessageInfo *mi;
- CamelFlag *flag;
- CamelTag *tag;
-
- /* Create summary entry */
- mi = camel_folder_summary_info_new_from_message (summary, message);
-
- /* Copy flags 'n' tags */
- mi->flags = info->flags;
- flag = info->user_flags;
- while (flag) {
- camel_flag_set (&mi->user_flags, flag->name, TRUE);
- flag = flag->next;
- }
- tag = info->user_tags;
- while (tag) {
- camel_tag_set (&mi->user_tags, tag->name, tag->value);
- tag = tag->next;
- }
-
- /* Set uid and add to summary */
- camel_message_info_set_uid (mi, g_strdup (uid));
- camel_folder_summary_add (summary, mi);
-}
-
-void
-camel_imap_summary_add_offline_uncached (CamelFolderSummary *summary, const char *uid,
- const CamelMessageInfo *info)
-{
- CamelMessageInfo *mi;
- CamelMessageContentInfo *ci;
-
- /* Create summary entry */
- mi = camel_folder_summary_info_new (summary);
- ci = camel_folder_summary_content_info_new (summary);
-
- camel_message_info_dup_to (info, mi);
- mi->content = ci;
-
- /* copy our private fields */
- ((CamelImapMessageInfo *)mi)->server_flags =
- ((CamelImapMessageInfo *)info)->server_flags;
-
- /* Set uid and add to summary */
- camel_message_info_set_uid (mi, g_strdup (uid));
- camel_folder_summary_add (summary, mi);
-}
diff --git a/camel/providers/imap/camel-imap-summary.h b/camel/providers/imap/camel-imap-summary.h
deleted file mode 100644
index 817e884408..0000000000
--- a/camel/providers/imap/camel-imap-summary.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors:
- * Michael Zucchi <notzed@ximian.com>
- * Dan Winship <danw@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef _CAMEL_IMAP_SUMMARY_H
-#define _CAMEL_IMAP_SUMMARY_H
-
-#include "camel-imap-types.h"
-#include <camel/camel-folder-summary.h>
-#include <camel/camel-exception.h>
-
-#define CAMEL_IMAP_SUMMARY(obj) CAMEL_CHECK_CAST (obj, camel_imap_summary_get_type (), CamelImapSummary)
-#define CAMEL_IMAP_SUMMARY_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_imap_summary_get_type (), CamelImapSummaryClass)
-#define CAMEL_IS_IMAP_SUMMARY(obj) CAMEL_CHECK_TYPE (obj, camel_imap_summary_get_type ())
-
-#define CAMEL_IMAP_SERVER_FLAGS (CAMEL_MESSAGE_ANSWERED | \
- CAMEL_MESSAGE_DELETED | \
- CAMEL_MESSAGE_DRAFT | \
- CAMEL_MESSAGE_FLAGGED | \
- CAMEL_MESSAGE_SEEN)
-
-#define CAMEL_IMAP_MESSAGE_RECENT (1 << 8)
-
-typedef struct _CamelImapSummaryClass CamelImapSummaryClass;
-
-typedef struct _CamelImapMessageContentInfo {
- CamelMessageContentInfo info;
-
-} CamelImapMessageContentInfo;
-
-typedef struct _CamelImapMessageInfo {
- CamelMessageInfo info;
-
- guint32 server_flags;
-} CamelImapMessageInfo;
-
-struct _CamelImapSummary {
- CamelFolderSummary parent;
-
- guint32 validity;
-};
-
-struct _CamelImapSummaryClass {
- CamelFolderSummaryClass parent_class;
-
-};
-
-CamelType camel_imap_summary_get_type (void);
-CamelFolderSummary *camel_imap_summary_new (const char *filename);
-
-void camel_imap_summary_add_offline (CamelFolderSummary *summary,
- const char *uid,
- CamelMimeMessage *message,
- const CamelMessageInfo *info);
-
-void camel_imap_summary_add_offline_uncached (CamelFolderSummary *summary,
- const char *uid,
- const CamelMessageInfo *info);
-
-#endif /* ! _CAMEL_IMAP_SUMMARY_H */
-
diff --git a/camel/providers/imap/camel-imap-types.h b/camel/providers/imap/camel-imap-types.h
deleted file mode 100644
index c5ea41acff..0000000000
--- a/camel/providers/imap/camel-imap-types.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-imap-types.h: IMAP types */
-
-/*
- * Copyright (C) 2001 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifndef CAMEL_IMAP_TYPES_H
-#define CAMEL_IMAP_TYPES_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include "camel-types.h"
-
-typedef struct _CamelImapFolder CamelImapFolder;
-typedef struct _CamelImapMessageCache CamelImapMessageCache;
-typedef struct _CamelImapResponse CamelImapResponse;
-typedef struct _CamelImapSearch CamelImapSearch;
-typedef struct _CamelImapStore CamelImapStore;
-typedef struct _CamelImapSummary CamelImapSummary;
-
-#endif /* CAMEL_IMAP_TYPES_H */
diff --git a/camel/providers/imap/camel-imap-utils.c b/camel/providers/imap/camel-imap-utils.c
deleted file mode 100644
index 879cc23cca..0000000000
--- a/camel/providers/imap/camel-imap-utils.c
+++ /dev/null
@@ -1,1261 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <ctype.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <errno.h>
-
-#include "camel-imap-utils.h"
-#include "camel-imap-summary.h"
-#include "camel-imap-store.h"
-#include "camel-folder.h"
-#include "camel-string-utils.h"
-#include "camel-utf8.h"
-
-#define d(x)
-
-const char *
-imap_next_word (const char *buf)
-{
- const char *word;
-
- /* skip over current word */
- word = buf;
- while (*word && *word != ' ')
- word++;
-
- /* skip over white space */
- while (*word && *word == ' ')
- word++;
-
- return word;
-}
-
-
-static void
-imap_namespace_destroy (struct _namespace *namespace)
-{
- struct _namespace *node, *next;
-
- node = namespace;
- while (node) {
- next = node->next;
- g_free (node->prefix);
- g_free (node);
- node = next;
- }
-}
-
-void
-imap_namespaces_destroy (struct _namespaces *namespaces)
-{
- if (namespaces) {
- imap_namespace_destroy (namespaces->personal);
- imap_namespace_destroy (namespaces->other);
- imap_namespace_destroy (namespaces->shared);
- g_free (namespaces);
- }
-}
-
-static gboolean
-imap_namespace_decode (const char **in, struct _namespace **namespace)
-{
- struct _namespace *list, *tail, *node;
- const char *inptr;
- char *astring;
- size_t len;
-
- inptr = *in;
-
- list = NULL;
- tail = (struct _namespace *) &list;
-
- if (strncasecmp (inptr, "NIL", 3) != 0) {
- if (*inptr++ != '(')
- goto exception;
-
- while (*inptr && *inptr != ')') {
- if (*inptr++ != '(')
- goto exception;
-
- node = g_new (struct _namespace, 1);
- node->next = NULL;
-
- /* get the namespace prefix */
- astring = imap_parse_astring (&inptr, &len);
- if (!astring) {
- g_free (node);
- goto exception;
- }
-
- /* decode IMAP's modified UTF-7 into UTF-8 */
- node->prefix = imap_mailbox_decode (astring, len);
- g_free (astring);
- if (!node->prefix) {
- g_free (node);
- goto exception;
- }
-
- tail->next = node;
- tail = node;
-
- /* get the namespace directory delimiter */
- inptr = imap_next_word (inptr);
-
- if (!strncasecmp (inptr, "NIL", 3)) {
- inptr = imap_next_word (inptr);
- node->delim = '\0';
- } else if (*inptr++ == '"') {
- if (*inptr == '\\')
- inptr++;
-
- node->delim = *inptr++;
-
- if (*inptr++ != '"')
- goto exception;
- } else
- goto exception;
-
- if (*inptr == ' ') {
- /* parse extra flags... for now we
- don't save them, but in the future
- we may want to? */
- while (*inptr == ' ')
- inptr++;
-
- while (*inptr && *inptr != ')') {
- /* this should be a QSTRING or ATOM */
- inptr = imap_next_word (inptr);
- if (*inptr == '(') {
- /* skip over the param list */
- imap_skip_list (&inptr);
- }
-
- while (*inptr == ' ')
- inptr++;
- }
- }
-
- if (*inptr++ != ')')
- goto exception;
-
- /* there shouldn't be spaces according to the
- ABNF grammar, but we all know how closely
- people follow specs */
- while (*inptr == ' ')
- inptr++;
- }
-
- if (*inptr == ')')
- inptr++;
- } else {
- inptr += 3;
- }
-
- *in = inptr;
- *namespace = list;
-
- return TRUE;
-
- exception:
-
- /* clean up any namespaces we may have allocated */
- imap_namespace_destroy (list);
-
- return FALSE;
-}
-
-#if d(!)0
-static void
-namespace_dump (struct _namespace *namespace)
-{
- struct _namespace *node;
-
- if (namespace) {
- printf ("(");
- node = namespace;
- while (node) {
- printf ("(\"%s\" ", node->prefix);
- if (node->delim)
- printf ("\"%c\")", node->delim);
- else
- printf ("NUL)");
-
- node = node->next;
- if (node)
- printf (" ");
- }
-
- printf (")");
- } else {
- printf ("NIL");
- }
-}
-
-static void
-namespaces_dump (struct _namespaces *namespaces)
-{
- printf ("namespace dump: ");
- namespace_dump (namespaces->personal);
- printf (" ");
- namespace_dump (namespaces->other);
- printf (" ");
- namespace_dump (namespaces->shared);
- printf ("\n");
-}
-#endif
-
-struct _namespaces *
-imap_parse_namespace_response (const char *response)
-{
- struct _namespaces *namespaces;
- const char *inptr;
-
- d(printf ("parsing: %s\n", response));
-
- if (*response != '*')
- return NULL;
-
- inptr = imap_next_word (response);
- if (strncasecmp (inptr, "NAMESPACE", 9) != 0)
- return NULL;
-
- inptr = imap_next_word (inptr);
-
- namespaces = g_new (struct _namespaces, 1);
- namespaces->personal = NULL;
- namespaces->other = NULL;
- namespaces->shared = NULL;
-
- if (!imap_namespace_decode (&inptr, &namespaces->personal))
- goto exception;
-
- if (*inptr != ' ')
- goto exception;
-
- while (*inptr == ' ')
- inptr++;
-
- if (!imap_namespace_decode (&inptr, &namespaces->other))
- goto exception;
-
- if (*inptr != ' ')
- goto exception;
-
- while (*inptr == ' ')
- inptr++;
-
- if (!imap_namespace_decode (&inptr, &namespaces->shared))
- goto exception;
-
- d(namespaces_dump (namespaces));
-
- return namespaces;
-
- exception:
-
- imap_namespaces_destroy (namespaces);
-
- return NULL;
-}
-
-/**
- * imap_parse_list_response:
- * @store: the IMAP store whose list response we're parsing
- * @buf: the LIST or LSUB response
- * @flags: a pointer to a variable to store the flags in, or %NULL
- * @sep: a pointer to a variable to store the hierarchy separator in, or %NULL
- * @folder: a pointer to a variable to store the folder name in, or %NULL
- *
- * Parses a LIST or LSUB response and returns the desired parts of it.
- * If @folder is non-%NULL, its value must be freed by the caller.
- *
- * Return value: whether or not the response was successfully parsed.
- **/
-gboolean
-imap_parse_list_response (CamelImapStore *store, const char *buf, int *flags, char *sep, char **folder)
-{
- gboolean is_lsub = FALSE;
- const char *word;
- size_t len;
-
- if (*buf != '*')
- return FALSE;
-
- word = imap_next_word (buf);
- if (strncasecmp (word, "LIST", 4) && strncasecmp (word, "LSUB", 4))
- return FALSE;
-
- /* check if we are looking at an LSUB response */
- if (word[1] == 'S' || word[1] == 's')
- is_lsub = TRUE;
-
- /* get the flags */
- word = imap_next_word (word);
- if (*word != '(')
- return FALSE;
-
- if (flags)
- *flags = 0;
-
- word++;
- while (*word != ')') {
- len = strcspn (word, " )");
- if (flags) {
- if (!strncasecmp (word, "\\NoInferiors", len))
- *flags |= CAMEL_FOLDER_NOINFERIORS;
- else if (!strncasecmp (word, "\\NoSelect", len))
- *flags |= CAMEL_FOLDER_NOSELECT;
- else if (!strncasecmp (word, "\\Marked", len))
- *flags |= CAMEL_IMAP_FOLDER_MARKED;
- else if (!strncasecmp (word, "\\Unmarked", len))
- *flags |= CAMEL_IMAP_FOLDER_UNMARKED;
- else if (!strncasecmp (word, "\\HasChildren", len))
- *flags |= CAMEL_FOLDER_CHILDREN;
- else if (!strncasecmp (word, "\\HasNoChildren", len))
- *flags |= CAMEL_IMAP_FOLDER_NOCHILDREN;
- }
-
- word += len;
- while (*word == ' ')
- word++;
- }
-
- /* get the directory separator */
- word = imap_next_word (word);
- if (!strncmp (word, "NIL", 3)) {
- if (sep)
- *sep = '\0';
- } else if (*word++ == '"') {
- if (*word == '\\')
- word++;
- if (sep)
- *sep = *word;
- word++;
- if (*word++ != '"')
- return FALSE;
- } else
- return FALSE;
-
- if (folder) {
- char *astring;
-
- /* get the folder name */
- word = imap_next_word (word);
- astring = imap_parse_astring (&word, &len);
- if (!astring)
- return FALSE;
-
- *folder = astring;
-#if 0
- char *mailbox;
-
- mailbox = imap_mailbox_decode (astring, strlen (astring));
- g_free (astring);
- if (!mailbox)
- return FALSE;
-
- /* Kludge around Courier imap's LSUB response for INBOX when it
- * isn't subscribed to.
- *
- * Ignore any \Noselect flags for INBOX when parsing
- * an LSUB response to work around the following response:
- *
- * * LSUB (\Noselect \HasChildren) "." "INBOX"
- *
- * Fixes bug #28929 (albeight in a very dodgy way imho, but what
- * can ya do when ya got the ignorance of marketing breathing
- * down your neck?)
- */
- if (is_lsub && flags && !strcasecmp (mailbox, "INBOX"))
- *flags &= ~CAMEL_FOLDER_NOSELECT;
-
- *folder = mailbox;
-#endif
- }
-
- return TRUE;
-}
-
-
-/**
- * imap_parse_folder_name:
- * @store:
- * @folder_name:
- *
- * Return an array of folder paths representing the folder heirarchy.
- * For example:
- * Full/Path/"to / from"/Folder
- * Results in:
- * Full, Full/Path, Full/Path/"to / from", Full/Path/"to / from"/Folder
- **/
-char **
-imap_parse_folder_name (CamelImapStore *store, const char *folder_name)
-{
- GPtrArray *heirarchy;
- char **paths;
- const char *p;
-
- p = folder_name;
- if (*p == store->dir_sep)
- p++;
-
- heirarchy = g_ptr_array_new ();
-
- while (*p) {
- if (*p == '"') {
- p++;
- while (*p && *p != '"')
- p++;
- if (*p)
- p++;
- continue;
- }
-
- if (*p == store->dir_sep)
- g_ptr_array_add (heirarchy, g_strndup (folder_name, p - folder_name));
-
- p++;
- }
-
- g_ptr_array_add (heirarchy, g_strdup (folder_name));
- g_ptr_array_add (heirarchy, NULL);
-
- paths = (char **) heirarchy->pdata;
- g_ptr_array_free (heirarchy, FALSE);
-
- return paths;
-}
-
-char *
-imap_create_flag_list (guint32 flags)
-{
- GString *gstr;
- char *flag_list;
-
- gstr = g_string_new ("(");
-
- if (flags & CAMEL_MESSAGE_ANSWERED)
- g_string_append (gstr, "\\Answered ");
- if (flags & CAMEL_MESSAGE_DELETED)
- g_string_append (gstr, "\\Deleted ");
- if (flags & CAMEL_MESSAGE_DRAFT)
- g_string_append (gstr, "\\Draft ");
- if (flags & CAMEL_MESSAGE_FLAGGED)
- g_string_append (gstr, "\\Flagged ");
- if (flags & CAMEL_MESSAGE_SEEN)
- g_string_append (gstr, "\\Seen ");
-
- if (gstr->str[gstr->len - 1] == ' ')
- gstr->str[gstr->len - 1] = ')';
- else
- g_string_append_c (gstr, ')');
-
- flag_list = gstr->str;
- g_string_free (gstr, FALSE);
- return flag_list;
-}
-
-guint32
-imap_parse_flag_list (char **flag_list_p)
-{
- char *flag_list = *flag_list_p;
- guint32 flags = 0;
- int len;
-
- if (*flag_list++ != '(') {
- *flag_list_p = NULL;
- return 0;
- }
-
- while (*flag_list && *flag_list != ')') {
- len = strcspn (flag_list, " )");
- if (!strncasecmp (flag_list, "\\Answered", len))
- flags |= CAMEL_MESSAGE_ANSWERED;
- else if (!strncasecmp (flag_list, "\\Deleted", len))
- flags |= CAMEL_MESSAGE_DELETED;
- else if (!strncasecmp (flag_list, "\\Draft", len))
- flags |= CAMEL_MESSAGE_DRAFT;
- else if (!strncasecmp (flag_list, "\\Flagged", len))
- flags |= CAMEL_MESSAGE_FLAGGED;
- else if (!strncasecmp (flag_list, "\\Seen", len))
- flags |= CAMEL_MESSAGE_SEEN;
- else if (!strncasecmp (flag_list, "\\Recent", len))
- flags |= CAMEL_IMAP_MESSAGE_RECENT;
-
- flag_list += len;
- if (*flag_list == ' ')
- flag_list++;
- }
-
- if (*flag_list++ != ')') {
- *flag_list_p = NULL;
- return 0;
- }
-
- *flag_list_p = flag_list;
- return flags;
-}
-
-/*
- From rfc2060
-
-ATOM_CHAR ::= <any CHAR except atom_specials>
-
-atom_specials ::= "(" / ")" / "{" / SPACE / CTL / list_wildcards /
- quoted_specials
-
-CHAR ::= <any 7-bit US-ASCII character except NUL,
- 0x01 - 0x7f>
-
-CTL ::= <any ASCII control character and DEL,
- 0x00 - 0x1f, 0x7f>
-
-SPACE ::= <ASCII SP, space, 0x20>
-
-list_wildcards ::= "%" / "*"
-
-quoted_specials ::= <"> / "\"
-*/
-
-static unsigned char imap_atom_specials[256] = {
-/* 00 */0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-/* 10 */0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-/* 20 */0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1,
-/* 30 */1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-/* 40 */1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-/* 50 */1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1,
-/* 60 */1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-/* 70 */1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-#define imap_is_atom_char(c) ((imap_atom_specials[(c)&0xff] & 0x01) != 0)
-
-gboolean
-imap_is_atom(const char *in)
-{
- register unsigned char c;
- register const char *p = in;
-
- while ((c = (unsigned char)*p)) {
- if (!imap_is_atom_char(c))
- return FALSE;
- p++;
- }
-
- /* check for empty string */
- return p!=in;
-}
-
-/**
- * imap_parse_string_generic:
- * @str_p: a pointer to a string
- * @len: a pointer to a size_t to return the length in
- * @type: type of string (#IMAP_STRING, #IMAP_ASTRING, or #IMAP_NSTRING)
- * to parse.
- *
- * This parses an IMAP "string" (quoted string or literal), "nstring"
- * (NIL or string), or "astring" (atom or string) starting at *@str_p.
- * On success, *@str_p will point to the first character after the end
- * of the string, and *@len will contain the length of the returned
- * string. On failure, *@str_p will be set to %NULL.
- *
- * This assumes that the string is in the form returned by
- * camel_imap_command(): that line breaks are indicated by LF rather
- * than CRLF.
- *
- * Return value: the parsed string, or %NULL if a NIL or no string
- * was parsed. (In the former case, *@str_p will be %NULL; in the
- * latter, it will point to the character after the NIL.)
- **/
-char *
-imap_parse_string_generic (const char **str_p, size_t *len, int type)
-{
- const char *str = *str_p;
- char *out;
-
- if (!str)
- return NULL;
- else if (*str == '"') {
- char *p;
- size_t size;
-
- str++;
- size = strcspn (str, "\"") + 1;
- p = out = g_malloc (size);
-
- /* a quoted string cannot be broken into multiple lines */
- while (*str && *str != '"' && *str != '\n') {
- if (*str == '\\')
- str++;
- *p++ = *str++;
- if (p - out == size) {
- out = g_realloc (out, size * 2);
- p = out + size;
- size *= 2;
- }
- }
- if (*str != '"') {
- *str_p = NULL;
- g_free (out);
- return NULL;
- }
- *p = '\0';
- *str_p = str + 1;
- *len = strlen (out);
- return out;
- } else if (*str == '{') {
- *len = strtoul (str + 1, (char **)&str, 10);
- if (*str++ != '}' || *str++ != '\n' || strlen (str) < *len) {
- *str_p = NULL;
- return NULL;
- }
-
- out = g_strndup (str, *len);
- *str_p = str + *len;
- return out;
- } else if (type == IMAP_NSTRING && !strncasecmp (str, "nil", 3)) {
- *str_p += 3;
- *len = 0;
- return NULL;
- } else if (type == IMAP_ASTRING && imap_is_atom_char ((unsigned char)*str)) {
- while (imap_is_atom_char ((unsigned char) *str))
- str++;
-
- *len = str - *str_p;
- out = g_strndup (*str_p, *len);
- *str_p += *len;
- return out;
- } else {
- *str_p = NULL;
- return NULL;
- }
-}
-
-static inline void
-skip_char (const char **in, char ch)
-{
- if (*in && **in == ch)
- *in = *in + 1;
- else
- *in = NULL;
-}
-
-/* Skip atom, string, or number */
-static void
-skip_asn (const char **str_p)
-{
- const char *str = *str_p;
-
- if (!str)
- return;
- else if (*str == '"') {
- while (*++str && *str != '"') {
- if (*str == '\\') {
- str++;
- if (!*str)
- break;
- }
- }
- if (*str == '"')
- *str_p = str + 1;
- else
- *str_p = NULL;
- } else if (*str == '{') {
- unsigned long len;
-
- len = strtoul (str + 1, (char **) &str, 10);
- if (*str != '}' || *(str + 1) != '\n' ||
- strlen (str + 2) < len) {
- *str_p = NULL;
- return;
- }
- *str_p = str + 2 + len;
- } else {
- /* We assume the string is well-formed and don't
- * bother making sure it's a valid atom.
- */
- while (*str && *str != ')' && *str != ' ')
- str++;
- *str_p = str;
- }
-}
-
-void
-imap_skip_list (const char **str_p)
-{
- skip_char (str_p, '(');
- while (*str_p && **str_p != ')') {
- if (**str_p == '(')
- imap_skip_list (str_p);
- else
- skip_asn (str_p);
- if (*str_p && **str_p == ' ')
- skip_char (str_p, ' ');
- }
- skip_char (str_p, ')');
-}
-
-static int
-parse_params (const char **parms_p, CamelContentType *type)
-{
- const char *parms = *parms_p;
- char *name, *value;
- size_t len;
-
- if (!strncasecmp (parms, "nil", 3)) {
- *parms_p += 3;
- return 0;
- }
-
- if (*parms++ != '(')
- return -1;
-
- while (parms && *parms != ')') {
- name = imap_parse_nstring (&parms, &len);
- skip_char (&parms, ' ');
- value = imap_parse_nstring (&parms, &len);
-
- if (name && value)
- camel_content_type_set_param (type, name, value);
- g_free (name);
- g_free (value);
-
- if (parms && *parms == ' ')
- parms++;
- }
-
- if (!parms || *parms++ != ')')
- return -1;
-
- *parms_p = parms;
-
- return 0;
-}
-
-
-static CamelMessageContentInfo *
-imap_body_decode (const char **in, CamelMessageContentInfo *ci, CamelFolder *folder, GPtrArray *cis)
-{
- const char *inptr = *in;
- CamelMessageContentInfo *child = NULL;
- char *type, *subtype, *id = NULL;
- CamelContentType *ctype = NULL;
- char *description = NULL;
- char *encoding = NULL;
- size_t len;
- size_t size;
- char *p;
-
- if (*inptr++ != '(')
- return NULL;
-
- if (ci == NULL) {
- ci = camel_folder_summary_content_info_new (folder->summary);
- g_ptr_array_add (cis, ci);
- }
-
- if (*inptr == '(') {
- /* body_type_mpart */
- CamelMessageContentInfo *tail, *children = NULL;
-
- tail = (CamelMessageContentInfo *) &children;
-
- do {
- if (!(child = imap_body_decode (&inptr, NULL, folder, cis)))
- return NULL;
-
- child->parent = ci;
- tail->next = child;
- tail = child;
- } while (*inptr == '(');
-
- if (*inptr++ != ' ')
- return NULL;
-
- if (!strncasecmp (inptr, "nil", 3) != 0) {
- subtype = imap_parse_string (&inptr, &len);
- } else {
- subtype = NULL;
- inptr += 3;
- }
-
- ctype = camel_content_type_new ("multipart", subtype ? subtype : "mixed");
- g_free (subtype);
-
- if (*inptr++ != ')') {
- camel_content_type_unref (ctype);
- return NULL;
- }
-
- ci->type = ctype;
- ci->childs = children;
- } else {
- /* body_type_1part */
- if (strncasecmp (inptr, "nil", 3) != 0) {
- type = imap_parse_string (&inptr, &len);
- if (inptr == NULL)
- return NULL;
- } else {
- return NULL;
- }
-
- if (*inptr++ != ' ') {
- g_free (type);
- return NULL;
- }
-
- if (strncasecmp (inptr, "nil", 3) != 0) {
- subtype = imap_parse_string (&inptr, &len);
- if (inptr == NULL) {
- g_free (type);
- return NULL;
- }
- } else {
- if (!strcasecmp (type, "text"))
- subtype = g_strdup ("plain");
- else
- subtype = NULL;
- inptr += 3;
- }
-
- camel_strdown (type);
- camel_strdown (subtype);
- ctype = camel_content_type_new (type, subtype);
- g_free (subtype);
- g_free (type);
-
- if (*inptr++ != ' ')
- goto exception;
-
- /* content-type params */
- if (parse_params (&inptr, ctype) == -1)
- goto exception;
-
- if (*inptr++ != ' ')
- goto exception;
-
- /* content-id */
- if (strncasecmp (inptr, "nil", 3) != 0) {
- id = imap_parse_string (&inptr, &len);
- if (inptr == NULL)
- goto exception;
- } else
- inptr += 3;
-
- if (*inptr++ != ' ')
- goto exception;
-
- /* description */
- if (strncasecmp (inptr, "nil", 3) != 0) {
- description = imap_parse_string (&inptr, &len);
- if (inptr == NULL)
- goto exception;
- } else
- inptr += 3;
-
- if (*inptr++ != ' ')
- goto exception;
-
- /* encoding */
- if (strncasecmp (inptr, "nil", 3) != 0) {
- encoding = imap_parse_string (&inptr, &len);
- if (inptr == NULL)
- goto exception;
- } else
- inptr += 3;
-
- if (*inptr++ != ' ')
- goto exception;
-
- /* size */
- size = strtoul ((const char *) inptr, &p, 10);
- inptr = (const unsigned char *) p;
-
- if (camel_content_type_is (ctype, "message", "rfc822")) {
- /* body_type_msg */
- if (*inptr++ != ' ')
- goto exception;
-
- /* envelope */
- imap_skip_list (&inptr);
-
- if (*inptr++ != ' ')
- goto exception;
-
- /* body */
- if (!(child = imap_body_decode (&inptr, NULL, folder, cis)))
- goto exception;
- child->parent = ci;
-
- if (*inptr++ != ' ')
- goto exception;
-
- /* lines */
- strtoul ((const char *) inptr, &p, 10);
- inptr = (const unsigned char *) p;
- } else if (camel_content_type_is (ctype, "text", "*")) {
- if (*inptr++ != ' ')
- goto exception;
-
- /* lines */
- strtoul ((const char *) inptr, &p, 10);
- inptr = (const unsigned char *) p;
- } else {
- /* body_type_basic */
- }
-
- if (*inptr++ != ')')
- goto exception;
-
- ci->type = ctype;
- ci->id = id;
- ci->description = description;
- ci->encoding = encoding;
- ci->size = size;
- ci->childs = child;
- }
-
- *in = inptr;
-
- return ci;
-
- exception:
-
- camel_content_type_unref (ctype);
- g_free (id);
- g_free (description);
- g_free (encoding);
-
- return NULL;
-}
-
-
-/**
- * imap_parse_body:
- * @body_p: pointer to the start of an IMAP "body"
- * @folder: an imap folder
- * @ci: a CamelMessageContentInfo to fill in
- *
- * This fills in @ci with data from *@body_p. On success *@body_p
- * will point to the character after the body. On failure, it will be
- * set to %NULL and @ci will be unchanged.
- **/
-void
-imap_parse_body (const char **body_p, CamelFolder *folder,
- CamelMessageContentInfo *ci)
-{
- const char *inptr = *body_p;
- CamelMessageContentInfo *child;
- GPtrArray *children;
- int i;
-
- if (!inptr || *inptr != '(') {
- *body_p = NULL;
- return;
- }
-
- children = g_ptr_array_new ();
-
- if (!(imap_body_decode (&inptr, ci, folder, children))) {
- for (i = 0; i < children->len; i++) {
- child = children->pdata[i];
-
- /* content_info_free will free all the child
- * nodes, but we don't want that. */
- child->next = NULL;
- child->parent = NULL;
- child->childs = NULL;
-
- camel_folder_summary_content_info_free (folder->summary, child);
- }
- *body_p = NULL;
- } else {
- *body_p = inptr;
- }
-
- g_ptr_array_free (children, TRUE);
-}
-
-
-/**
- * imap_quote_string:
- * @str: the string to quote, which must not contain CR or LF
- *
- * Return value: an IMAP "quoted" corresponding to the string, which
- * the caller must free.
- **/
-char *
-imap_quote_string (const char *str)
-{
- const char *p;
- char *quoted, *q;
- int len;
-
- g_assert (strchr (str, '\r') == NULL);
-
- len = strlen (str);
- p = str;
- while ((p = strpbrk (p, "\"\\"))) {
- len++;
- p++;
- }
-
- quoted = q = g_malloc (len + 3);
- *q++ = '"';
- for (p = str; *p; ) {
- if (strchr ("\"\\", *p))
- *q++ = '\\';
- *q++ = *p++;
- }
- *q++ = '"';
- *q = '\0';
-
- return quoted;
-}
-
-
-static inline unsigned long
-get_summary_uid_numeric (CamelFolderSummary *summary, int index)
-{
- CamelMessageInfo *info;
- unsigned long uid;
-
- info = camel_folder_summary_index (summary, index);
- uid = strtoul (camel_message_info_uid (info), NULL, 10);
- camel_folder_summary_info_free (summary, info);
- return uid;
-}
-
-/* the max number of chars that an unsigned 32-bit int can be is 10 chars plus 1 for a possible : */
-#define UID_SET_FULL(setlen, maxlen) (maxlen > 0 ? setlen + 11 >= maxlen : FALSE)
-
-/**
- * imap_uid_array_to_set:
- * @summary: summary for the folder the UIDs come from
- * @uids: a (sorted) array of UIDs
- * @uid: uid index to start at
- * @maxlen: max length of the set string (or -1 for infinite)
- * @lastuid: index offset of the last uid used
- *
- * Creates an IMAP "set" up to @maxlen bytes long, covering the listed
- * UIDs starting at index @uid and not covering any UIDs that are in
- * @summary but not in @uids. It doesn't actually require that all (or
- * any) of the UIDs be in @summary.
- *
- * After calling, @lastuid will be set the index of the first uid
- * *not* included in the returned set string.
- *
- * Note: @uids MUST be in sorted order for this code to work properly.
- *
- * Return value: the set, which the caller must free with g_free()
- **/
-char *
-imap_uid_array_to_set (CamelFolderSummary *summary, GPtrArray *uids, int uid, ssize_t maxlen, int *lastuid)
-{
- unsigned long last_uid, next_summary_uid, this_uid;
- gboolean range = FALSE;
- int si, scount;
- GString *gset;
- char *set;
-
- g_return_val_if_fail (uids->len > uid, NULL);
-
- gset = g_string_new (uids->pdata[uid]);
- last_uid = strtoul (uids->pdata[uid], NULL, 10);
- next_summary_uid = 0;
- scount = camel_folder_summary_count (summary);
-
- for (uid++, si = 0; uid < uids->len && !UID_SET_FULL (gset->len, maxlen); uid++) {
- /* Find the next UID in the summary after the one we
- * just wrote out.
- */
- for ( ; last_uid >= next_summary_uid && si < scount; si++)
- next_summary_uid = get_summary_uid_numeric (summary, si);
- if (last_uid >= next_summary_uid)
- next_summary_uid = (unsigned long) -1;
-
- /* Now get the next UID from @uids */
- this_uid = strtoul (uids->pdata[uid], NULL, 10);
- if (this_uid == next_summary_uid || this_uid == last_uid + 1)
- range = TRUE;
- else {
- if (range) {
- g_string_append_printf (gset, ":%lu", last_uid);
- range = FALSE;
- }
- g_string_append_printf (gset, ",%lu", this_uid);
- }
-
- last_uid = this_uid;
- }
-
- if (range)
- g_string_append_printf (gset, ":%lu", last_uid);
-
- *lastuid = uid;
-
- set = gset->str;
- g_string_free (gset, FALSE);
-
- return set;
-}
-
-/**
- * imap_uid_set_to_array:
- * @summary: summary for the folder the UIDs come from
- * @uids: a pointer to the start of an IMAP "set" of UIDs
- *
- * Fills an array with the UIDs corresponding to @uids and @summary.
- * There can be text after the uid set in @uids, which will be
- * ignored.
- *
- * If @uids specifies a range of UIDs that extends outside the range
- * of @summary, the function will assume that all of the "missing" UIDs
- * do exist.
- *
- * Return value: the array of uids, which the caller must free with
- * imap_uid_array_free(). (Or %NULL if the uid set can't be parsed.)
- **/
-GPtrArray *
-imap_uid_set_to_array (CamelFolderSummary *summary, const char *uids)
-{
- GPtrArray *arr;
- char *p, *q;
- unsigned long uid, suid;
- int si, scount;
-
- arr = g_ptr_array_new ();
- scount = camel_folder_summary_count (summary);
-
- p = (char *)uids;
- si = 0;
- do {
- uid = strtoul (p, &q, 10);
- if (p == q)
- goto lose;
- g_ptr_array_add (arr, g_strndup (p, q - p));
-
- if (*q == ':') {
- /* Find the summary entry for the UID after the one
- * we just saw.
- */
- while (++si < scount) {
- suid = get_summary_uid_numeric (summary, si);
- if (suid > uid)
- break;
- }
- if (si >= scount)
- suid = uid + 1;
-
- uid = strtoul (q + 1, &p, 10);
- if (p == q + 1)
- goto lose;
-
- /* Add each summary UID until we find one
- * larger than the end of the range
- */
- while (suid <= uid) {
- g_ptr_array_add (arr, g_strdup_printf ("%lu", suid));
- if (++si < scount)
- suid = get_summary_uid_numeric (summary, si);
- else
- suid++;
- }
- } else
- p = q;
- } while (*p++ == ',');
-
- return arr;
-
- lose:
- g_warning ("Invalid uid set %s", uids);
- imap_uid_array_free (arr);
- return NULL;
-}
-
-/**
- * imap_uid_array_free:
- * @arr: an array returned from imap_uid_set_to_array()
- *
- * Frees @arr
- **/
-void
-imap_uid_array_free (GPtrArray *arr)
-{
- int i;
-
- for (i = 0; i < arr->len; i++)
- g_free (arr->pdata[i]);
- g_ptr_array_free (arr, TRUE);
-}
-
-char *
-imap_concat (CamelImapStore *imap_store, const char *prefix, const char *suffix)
-{
- size_t len;
-
- len = strlen (prefix);
- if (len == 0 || prefix[len - 1] == imap_store->dir_sep)
- return g_strdup_printf ("%s%s", prefix, suffix);
- else
- return g_strdup_printf ("%s%c%s", prefix, imap_store->dir_sep, suffix);
-}
-
-char *
-imap_mailbox_encode (const unsigned char *in, size_t inlen)
-{
- char *buf;
-
- buf = g_alloca (inlen + 1);
- memcpy (buf, in, inlen);
- buf[inlen] = 0;
-
- return camel_utf8_utf7 (buf);
-}
-
-char *
-imap_mailbox_decode (const unsigned char *in, size_t inlen)
-{
- char *buf;
-
- buf = g_alloca (inlen + 1);
- memcpy (buf, in, inlen);
- buf[inlen] = 0;
-
- return camel_utf7_utf8 (buf);
-}
diff --git a/camel/providers/imap/camel-imap-utils.h b/camel/providers/imap/camel-imap-utils.h
deleted file mode 100644
index e8f570137f..0000000000
--- a/camel/providers/imap/camel-imap-utils.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef CAMEL_IMAP_UTILS_H
-#define CAMEL_IMAP_UTILS_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include <sys/types.h>
-
-#include "camel-folder-summary.h"
-#include "camel-imap-types.h"
-
-const char *imap_next_word (const char *buf);
-
-struct _namespace {
- struct _namespace *next;
- char *prefix;
- char delim;
-};
-
-struct _namespaces {
- struct _namespace *personal;
- struct _namespace *other;
- struct _namespace *shared;
-};
-
-void imap_namespaces_destroy (struct _namespaces *namespaces);
-struct _namespaces *imap_parse_namespace_response (const char *response);
-
-gboolean imap_parse_list_response (CamelImapStore *store, const char *buf, int *flags,
- char *sep, char **folder);
-
-char **imap_parse_folder_name (CamelImapStore *store, const char *folder_name);
-
-char *imap_create_flag_list (guint32 flags);
-guint32 imap_parse_flag_list (char **flag_list);
-
-
-enum { IMAP_STRING, IMAP_NSTRING, IMAP_ASTRING };
-
-char *imap_parse_string_generic (const char **str_p, size_t *len, int type);
-
-#define imap_parse_string(str_p, len_p) \
- imap_parse_string_generic (str_p, len_p, IMAP_STRING)
-#define imap_parse_nstring(str_p, len_p) \
- imap_parse_string_generic (str_p, len_p, IMAP_NSTRING)
-#define imap_parse_astring(str_p, len_p) \
- imap_parse_string_generic (str_p, len_p, IMAP_ASTRING)
-
-void imap_parse_body (const char **body_p, CamelFolder *folder,
- CamelMessageContentInfo *ci);
-
-gboolean imap_is_atom (const char *in);
-char *imap_quote_string (const char *str);
-
-void imap_skip_list (const char **str_p);
-
-char *imap_uid_array_to_set (CamelFolderSummary *summary, GPtrArray *uids, int uid, ssize_t maxlen, int *lastuid);
-GPtrArray *imap_uid_set_to_array (CamelFolderSummary *summary, const char *uids);
-void imap_uid_array_free (GPtrArray *arr);
-
-char *imap_concat (CamelImapStore *imap_store, const char *prefix, const char *suffix);
-char *imap_namespace_concat (CamelImapStore *store, const char *name);
-
-char *imap_mailbox_encode (const unsigned char *in, size_t inlen);
-char *imap_mailbox_decode (const unsigned char *in, size_t inlen);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_IMAP_UTILS_H */
diff --git a/camel/providers/imap/camel-imap-wrapper.c b/camel/providers/imap/camel-imap-wrapper.c
deleted file mode 100644
index 2cb07b3012..0000000000
--- a/camel/providers/imap/camel-imap-wrapper.c
+++ /dev/null
@@ -1,185 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; -*- */
-/* camel-imap-wrapper.c: data wrapper for offline IMAP data */
-
-/*
- * Author: Dan Winship <danw@ximian.com>
- *
- * Copyright 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <errno.h>
-#include <string.h>
-
-#include "camel-imap-folder.h"
-#include "camel-imap-wrapper.h"
-#include "camel-imap-private.h"
-#include "camel-exception.h"
-#include "camel-stream-filter.h"
-#include "camel-mime-filter-basic.h"
-#include "camel-mime-filter-crlf.h"
-#include "camel-mime-filter-charset.h"
-#include "camel-mime-part.h"
-
-static CamelDataWrapperClass *parent_class = NULL;
-
-/* Returns the class for a CamelDataWrapper */
-#define CDW_CLASS(so) CAMEL_DATA_WRAPPER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-
-static ssize_t write_to_stream (CamelDataWrapper *imap_wrapper, CamelStream *stream);
-
-static void
-camel_imap_wrapper_class_init (CamelImapWrapperClass *camel_imap_wrapper_class)
-{
- CamelDataWrapperClass *camel_data_wrapper_class =
- CAMEL_DATA_WRAPPER_CLASS (camel_imap_wrapper_class);
-
- parent_class = CAMEL_DATA_WRAPPER_CLASS (camel_type_get_global_classfuncs (camel_data_wrapper_get_type ()));
-
- /* virtual method override */
- camel_data_wrapper_class->write_to_stream = write_to_stream;
-}
-
-static void
-camel_imap_wrapper_finalize (CamelObject *object)
-{
- CamelImapWrapper *imap_wrapper = CAMEL_IMAP_WRAPPER (object);
-
- if (imap_wrapper->folder)
- camel_object_unref (CAMEL_OBJECT (imap_wrapper->folder));
- if (imap_wrapper->uid)
- g_free (imap_wrapper->uid);
- if (imap_wrapper->part)
- g_free (imap_wrapper->part_spec);
-
-#ifdef ENABLE_THREADS
- g_mutex_free (imap_wrapper->priv->lock);
-#endif
- g_free (imap_wrapper->priv);
-}
-
-static void
-camel_imap_wrapper_init (gpointer object, gpointer klass)
-{
- CamelImapWrapper *imap_wrapper = CAMEL_IMAP_WRAPPER (object);
-
- imap_wrapper->priv = g_new0 (struct _CamelImapWrapperPrivate, 1);
-#ifdef ENABLE_THREADS
- imap_wrapper->priv->lock = g_mutex_new ();
-#endif
-}
-
-CamelType
-camel_imap_wrapper_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (
- CAMEL_DATA_WRAPPER_TYPE,
- "CamelImapWrapper",
- sizeof (CamelImapWrapper),
- sizeof (CamelImapWrapperClass),
- (CamelObjectClassInitFunc) camel_imap_wrapper_class_init,
- NULL,
- (CamelObjectInitFunc) camel_imap_wrapper_init,
- (CamelObjectFinalizeFunc) camel_imap_wrapper_finalize);
- }
-
- return type;
-}
-
-
-static void
-imap_wrapper_hydrate (CamelImapWrapper *imap_wrapper, CamelStream *stream)
-{
- CamelDataWrapper *data_wrapper = (CamelDataWrapper *) imap_wrapper;
-
- camel_object_ref (stream);
- data_wrapper->stream = stream;
- data_wrapper->offline = FALSE;
-
- camel_object_unref (imap_wrapper->folder);
- imap_wrapper->folder = NULL;
- g_free (imap_wrapper->uid);
- imap_wrapper->uid = NULL;
- g_free (imap_wrapper->part_spec);
- imap_wrapper->part = NULL;
-}
-
-
-static ssize_t
-write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
-{
- CamelImapWrapper *imap_wrapper = CAMEL_IMAP_WRAPPER (data_wrapper);
-
- CAMEL_IMAP_WRAPPER_LOCK (imap_wrapper, lock);
- if (data_wrapper->offline) {
- CamelStream *datastream;
-
- datastream = camel_imap_folder_fetch_data (
- imap_wrapper->folder, imap_wrapper->uid,
- imap_wrapper->part_spec, FALSE, NULL);
- if (!datastream) {
- CAMEL_IMAP_WRAPPER_UNLOCK (imap_wrapper, lock);
- errno = ENETUNREACH;
- return -1;
- }
-
- imap_wrapper_hydrate (imap_wrapper, datastream);
- camel_object_unref (datastream);
- }
- CAMEL_IMAP_WRAPPER_UNLOCK (imap_wrapper, lock);
-
- return parent_class->write_to_stream (data_wrapper, stream);
-}
-
-
-CamelDataWrapper *
-camel_imap_wrapper_new (CamelImapFolder *imap_folder, CamelContentType *type,
- const char *uid, const char *part_spec,
- CamelMimePart *part)
-{
- CamelImapWrapper *imap_wrapper;
- CamelStream *stream;
-
- imap_wrapper = (CamelImapWrapper *)camel_object_new(camel_imap_wrapper_get_type());
-
- camel_data_wrapper_set_mime_type_field (CAMEL_DATA_WRAPPER (imap_wrapper), type);
- ((CamelDataWrapper *)imap_wrapper)->offline = TRUE;
-
- imap_wrapper->folder = imap_folder;
- camel_object_ref (imap_folder);
- imap_wrapper->uid = g_strdup (uid);
- imap_wrapper->part_spec = g_strdup (part_spec);
-
- /* Don't ref this, it's our parent. */
- imap_wrapper->part = part;
-
- /* Try the cache. */
- stream = camel_imap_folder_fetch_data (imap_folder, uid, part_spec,
- TRUE, NULL);
- if (stream) {
- imap_wrapper_hydrate (imap_wrapper, stream);
- camel_object_unref (stream);
- }
-
- return (CamelDataWrapper *)imap_wrapper;
-}
diff --git a/camel/providers/imap/camel-imap-wrapper.h b/camel/providers/imap/camel-imap-wrapper.h
deleted file mode 100644
index 4f7ca5097a..0000000000
--- a/camel/providers/imap/camel-imap-wrapper.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-imap-wrapper.h: data wrapper for offline IMAP data */
-
-/*
- * Copyright 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifndef CAMEL_IMAP_WRAPPER_H
-#define CAMEL_IMAP_WRAPPER_H 1
-
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include <camel/camel-data-wrapper.h>
-#include "camel-imap-types.h"
-
-#define CAMEL_IMAP_WRAPPER_TYPE (camel_imap_wrapper_get_type ())
-#define CAMEL_IMAP_WRAPPER(obj) (CAMEL_CHECK_CAST((obj), CAMEL_IMAP_WRAPPER_TYPE, CamelImapWrapper))
-#define CAMEL_IMAP_WRAPPER_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_IMAP_WRAPPER_TYPE, CamelImapWrapperClass))
-#define CAMEL_IS_IMAP_WRAPPER(o) (CAMEL_CHECK_TYPE((o), CAMEL_IMAP_WRAPPER_TYPE))
-
-typedef struct
-{
- CamelDataWrapper parent_object;
-
- struct _CamelImapWrapperPrivate *priv;
-
- CamelImapFolder *folder;
- char *uid, *part_spec;
- CamelMimePart *part;
-} CamelImapWrapper;
-
-typedef struct {
- CamelDataWrapperClass parent_class;
-
-} CamelImapWrapperClass;
-
-/* Standard Camel function */
-CamelType camel_imap_wrapper_get_type (void);
-
-/* Constructor */
-CamelDataWrapper *camel_imap_wrapper_new (CamelImapFolder *imap_folder,
- CamelContentType *type,
- const char *uid,
- const char *part_spec,
- CamelMimePart *part);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_DATA_WRAPPER_H */
diff --git a/camel/providers/imap/libcamelimap.urls b/camel/providers/imap/libcamelimap.urls
deleted file mode 100644
index c301c0ffac..0000000000
--- a/camel/providers/imap/libcamelimap.urls
+++ /dev/null
@@ -1 +0,0 @@
-imap
diff --git a/camel/providers/imapp/.cvsignore b/camel/providers/imapp/.cvsignore
deleted file mode 100644
index 3fa8afaa38..0000000000
--- a/camel/providers/imapp/.cvsignore
+++ /dev/null
@@ -1,11 +0,0 @@
-.deps
-Makefile
-Makefile.in
-.libs
-.deps
-*.lo
-*.la
-*.bb
-*.bbg
-*.da
-*.gcov
diff --git a/camel/providers/imapp/Makefile.am b/camel/providers/imapp/Makefile.am
deleted file mode 100644
index 7ce8c65fcd..0000000000
--- a/camel/providers/imapp/Makefile.am
+++ /dev/null
@@ -1,45 +0,0 @@
-## Process this file with automake to produce Makefile.in
-
-libcamelimappincludedir = $(privincludedir)/camel
-
-camel_provider_LTLIBRARIES = libcamelimapp.la
-camel_provider_DATA = libcamelimapp.urls
-
-INCLUDES = -I.. \
- -I$(srcdir)/.. \
- -I$(top_srcdir)/camel \
- -I$(top_srcdir)/intl \
- -I$(top_srcdir)/e-util \
- -I$(top_srcdir) \
- $(CAMEL_CFLAGS) \
- $(GNOME_INCLUDEDIR) \
- $(GTK_INCLUDEDIR) \
- -DG_LOG_DOMAIN=\"camel-imapp-provider\"
-
-libcamelimapp_la_SOURCES = \
- camel-imapp-utils.c \
- camel-imapp-engine.c \
- camel-imapp-stream.c \
- camel-imapp-store.c \
- camel-imapp-folder.c \
- camel-imapp-provider.c \
- camel-imapp-store-summary.c \
- camel-imapp-driver.c \
- camel-imapp-summary.c
-
-libcamelimappinclude_HEADERS = \
- camel-imapp-utils.h \
- camel-imapp-engine.h \
- camel-imapp-stream.h \
- camel-imapp-store.h \
- camel-imapp-folder.h \
- camel-imapp-store-summary.h \
- camel-imapp-driver.h \
- camel-imapp-summary.h
-
-libcamelimapp_la_LDFLAGS = -avoid-version -module
-
-#noinst_HEADERS = \
-# camel-imap-private.h
-
-EXTRA_DIST = libcamelimapp.urls
diff --git a/camel/providers/imapp/camel-imapp-driver.c b/camel/providers/imapp/camel-imapp-driver.c
deleted file mode 100644
index 106e98fbb3..0000000000
--- a/camel/providers/imapp/camel-imapp-driver.c
+++ /dev/null
@@ -1,771 +0,0 @@
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <ctype.h>
-
-#include "camel-imapp-driver.h"
-#include "camel-imapp-utils.h"
-#include "camel-imapp-folder.h"
-#include "camel-imapp-engine.h"
-#include "camel-imapp-summary.h"
-#include "camel-imapp-exception.h"
-
-#include <camel/camel-stream-mem.h>
-#include <camel/camel-stream-null.h>
-
-#include <camel/camel-folder-summary.h>
-#include <camel/camel-store.h>
-#include <camel/camel-mime-utils.h>
-#include <camel/camel-sasl.h>
-
-#define d(x) x
-
-static int driver_resp_fetch(CamelIMAPPEngine *ie, guint32 id, CamelIMAPPDriver *sdata);
-static int driver_resp_expunge(CamelIMAPPEngine *ie, guint32 id, CamelIMAPPDriver *sdata);
-static int driver_resp_exists(CamelIMAPPEngine *ie, guint32 id, CamelIMAPPDriver *sdata);
-static int driver_resp_list(CamelIMAPPEngine *ie, guint32 id, CamelIMAPPDriver *sdata);
-
-static void driver_status(CamelIMAPPEngine *ie, struct _status_info *sinfo, CamelIMAPPDriver *sdata);
-
-static void
-class_init(CamelIMAPPDriverClass *ieclass)
-{
-}
-
-static void
-object_init(CamelIMAPPDriver *ie, CamelIMAPPDriverClass *ieclass)
-{
- ie->summary = g_ptr_array_new();
- e_dlist_init(&ie->body_fetch);
- e_dlist_init(&ie->body_fetch_done);
-}
-
-static void
-object_finalise(CamelIMAPPDriver *ie, CamelIMAPPDriverClass *ieclass)
-{
- if (ie->folder)
- camel_object_unref((CamelObject *)ie->folder);
- if (ie->engine)
- camel_object_unref((CamelObject *)ie->engine);
- if (ie->summary)
- g_ptr_array_free(ie->summary, TRUE);
-}
-
-CamelType
-camel_imapp_driver_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (
- camel_object_get_type (),
- "CamelIMAPPDriver",
- sizeof (CamelIMAPPDriver),
- sizeof (CamelIMAPPDriverClass),
- (CamelObjectClassInitFunc) class_init,
- NULL,
- (CamelObjectInitFunc) object_init,
- (CamelObjectFinalizeFunc) object_finalise);
- }
-
- return type;
-}
-
-CamelIMAPPDriver *
-camel_imapp_driver_new(CamelIMAPPStream *stream)
-{
- CamelIMAPPDriver *driver;
- CamelIMAPPEngine *ie;
-
- driver = CAMEL_IMAPP_DRIVER (camel_object_new (CAMEL_IMAPP_DRIVER_TYPE));
- ie = driver->engine = camel_imapp_engine_new(stream);
-
- camel_imapp_engine_add_handler(ie, "FETCH", (CamelIMAPPEngineFunc)driver_resp_fetch, driver);
- camel_imapp_engine_add_handler(ie, "EXPUNGE", (CamelIMAPPEngineFunc)driver_resp_expunge, driver);
- camel_imapp_engine_add_handler(ie, "EXISTS", (CamelIMAPPEngineFunc)driver_resp_exists, driver);
- camel_imapp_engine_add_handler(ie, "LIST", (CamelIMAPPEngineFunc)driver_resp_list, driver);
- camel_object_hook_event(ie, "status", (CamelObjectEventHookFunc)driver_status, driver);
-
- return driver;
-}
-
-void
-camel_imapp_driver_set_sasl_factory(CamelIMAPPDriver *id, CamelIMAPPSASLFunc get_sasl, void *sasl_data)
-{
- id->get_sasl = get_sasl;
- id->get_sasl_data = sasl_data;
-}
-
-void
-camel_imapp_driver_set_login_query(CamelIMAPPDriver *id, CamelIMAPPLoginFunc get_login, void *login_data)
-{
- id->get_login = get_login;
- id->get_login_data = login_data;
-}
-
-void
-camel_imapp_driver_login(CamelIMAPPDriver *id)
-/* throws SERVICE_CANT_AUTHENTICATE, SYSTEM_IO */
-{
- CamelIMAPPCommand * volatile ic = NULL;
-
- /* connect? */
- /* camel_imapp_engine_connect() */
- /* or above? */
-
- CAMEL_TRY {
- CamelSasl *sasl;
-
- if (id->get_sasl
- && (sasl = id->get_sasl(id, id->get_sasl_data))) {
- ic = camel_imapp_engine_command_new(id->engine, "AUTHENTICATE", NULL, "AUTHENTICATE %A", sasl);
- camel_object_unref(sasl);
- } else {
- char *user, *pass;
-
- g_assert(id->get_login);
- id->get_login(id, &user, &pass, id->get_login_data);
- ic = camel_imapp_engine_command_new(id->engine, "LOGIN", NULL, "LOGIN %s %s", user, pass);
- g_free(user);
- g_free(pass);
- }
-
- camel_imapp_engine_command_queue(id->engine, ic);
- while (camel_imapp_engine_iterate(id->engine, ic) > 0)
- ;
-
- if (ic->status->result != IMAP_OK)
- camel_exception_throw(CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE, "Login failed: %s", ic->status->text);
- camel_imapp_engine_command_free(id->engine, ic);
- } CAMEL_CATCH(ex) {
- if (ic)
- camel_imapp_engine_command_free(id->engine, ic);
- camel_exception_throw_ex(ex);
- } CAMEL_DONE;
-}
-
-void
-camel_imapp_driver_select(CamelIMAPPDriver *id, struct _CamelIMAPPFolder *folder)
-{
- CamelIMAPPSelectResponse *sr;
- CamelIMAPPCommand * volatile ic = NULL;
- CamelIMAPPCommand * volatile ic2 = NULL;
- guint32 count;
- CamelFolderSummary *summary;
-
- if (id->folder) {
- if (folder == id->folder)
- return;
- camel_imapp_driver_sync(id, FALSE, id->folder);
- if (camel_folder_change_info_changed(id->folder->changes)) {
- camel_object_trigger_event(id->folder, "folder_changed", id->folder->changes);
- camel_folder_change_info_clear(id->folder->changes);
- }
- camel_object_unref(id->folder);
- id->folder = NULL;
- }
-
- summary = ((CamelFolder *)folder)->summary;
-
- ic = camel_imapp_engine_command_new(id->engine, "SELECT", NULL, "SELECT %t", folder->raw_name);
- camel_imapp_engine_command_queue(id->engine, ic);
- while (camel_imapp_engine_iterate(id->engine, ic)>0)
- ;
- camel_imapp_engine_command_free(id->engine, ic);
-
- id->folder = folder;
- camel_object_ref(folder);
-
- count = camel_folder_summary_count(summary);
- if (count > 0 && count <= id->exists) {
- ic = camel_imapp_engine_command_new(id->engine, "FETCH", NULL,
- "FETCH 1:%u (UID FLAGS)", count);
- camel_imapp_engine_command_queue(id->engine, ic);
- if (count < id->exists) {
- ic2 = camel_imapp_engine_command_new(id->engine, "FETCH", NULL,
- "FETCH %u:* (UID FLAGS ENVELOPE)", count+1);
- camel_imapp_engine_command_queue(id->engine, ic2);
- } else {
- ic2 = NULL;
- }
-
- while (camel_imapp_engine_iterate(id->engine, ic2?ic2:ic)>0)
- ;
-
- camel_imapp_engine_command_free(id->engine, ic);
- if (ic2)
- camel_imapp_engine_command_free(id->engine, ic2);
- } else {
- ic = camel_imapp_engine_command_new(id->engine, "FETCH", NULL,
- "FETCH 1:* (UID FLAGS ENVELOPE)");
- camel_imapp_engine_command_queue(id->engine, ic);
- while (camel_imapp_engine_iterate(id->engine, ic)>0)
- ;
- camel_imapp_engine_command_free(id->engine, ic);
- }
-
- /* TODO: need to set exists/etc in summary */
- folder->exists = id->exists;
- folder->uidvalidity = id->uidvalidity;
-
- printf("saving summary '%s'\n", summary->summary_path);
- camel_folder_summary_save(summary);
-
- if (camel_folder_change_info_changed(id->folder->changes)) {
- camel_object_trigger_event(id->folder, "folder_changed", id->folder->changes);
- camel_folder_change_info_clear(id->folder->changes);
- }
-}
-
-static void
-imapp_driver_check(CamelIMAPPDriver *id)
-{
- guint32 count;
- CamelIMAPPCommand *ic;
-
- /* FIXME: exception handling */
-
- if (id->folder->exists != id->exists) {
- count = camel_folder_summary_count(((CamelFolder *)id->folder)->summary);
- if (count < id->exists) {
- printf("fetching new messages\n");
- ic = camel_imapp_engine_command_new(id->engine, "FETCH", NULL,
- "FETCH %u:* (UID FLAGS ENVELOPE)", count+1);
- camel_imapp_engine_command_queue(id->engine, ic);
- while (camel_imapp_engine_iterate(id->engine, ic)>0)
- ;
- camel_imapp_engine_command_free(id->engine, ic);
- } else if (count > id->exists) {
- printf("folder shrank with no expunge notificaitons!? uh, dunno what to do\n");
- }
- }
-
- printf("checking for change info changes\n");
- if (camel_folder_change_info_changed(id->folder->changes)) {
- printf("got somechanges! added=%d changed=%d removed=%d\n",
- id->folder->changes->uid_added->len,
- id->folder->changes->uid_changed->len,
- id->folder->changes->uid_removed->len);
- camel_object_trigger_event(id->folder, "folder_changed", id->folder->changes);
- camel_folder_change_info_clear(id->folder->changes);
- }
-}
-
-void
-camel_imapp_driver_update(CamelIMAPPDriver *id, CamelIMAPPFolder *folder)
-{
- if (id->folder == folder) {
- CamelIMAPPCommand *ic;
-
- /* this will automagically update flags & expunge items */
- ic = camel_imapp_engine_command_new(id->engine, "NOOP", NULL, "NOOP");
- camel_imapp_engine_command_queue(id->engine, ic);
- while (camel_imapp_engine_iterate(id->engine, ic)>0)
- ;
- camel_imapp_engine_command_free(id->engine, ic);
-
- imapp_driver_check(id);
- } else {
- camel_imapp_driver_select(id, folder);
- }
-}
-
-/* FIXME: this is basically a copy of the same in camel-imapp-utils.c */
-static struct {
- char *name;
- guint32 flag;
-} flag_table[] = {
- { "\\ANSWERED", CAMEL_MESSAGE_ANSWERED },
- { "\\DELETED", CAMEL_MESSAGE_DELETED },
- { "\\DRAFT", CAMEL_MESSAGE_DRAFT },
- { "\\FLAGGED", CAMEL_MESSAGE_FLAGGED },
- { "\\SEEN", CAMEL_MESSAGE_SEEN },
- /* { "\\RECENT", CAMEL_IMAPP_MESSAGE_RECENT }, */
-};
-
-/*
- flags 00101000
- sflags 01001000
- ^ 01100000
-~flags 11010111
-& 01000000
-
-&flags 00100000
-*/
-
-static void
-imapp_write_flags(CamelIMAPPDriver *id, guint32 orset, gboolean on, CamelFolderSummary *summary)
-{
- guint32 i, j, count;
- CamelIMAPPMessageInfo *info;
- CamelIMAPPCommand *ic = NULL;
- struct _uidset_state ss;
- GSList *commands = NULL;
-
- /* FIXME: exception handling */
-
- count = camel_folder_summary_count(summary);
- for (j=0;j<sizeof(flag_table)/sizeof(flag_table[0]);j++) {
- int flush;
-
- if ((orset & flag_table[j].flag) == 0)
- continue;
-
- printf("checking/storing %s flags '%s'\n", on?"on":"off", flag_table[j].name);
-
- flush = 0;
- imapp_uidset_init(&ss, id->engine);
- for (i=0;i<count;i++) {
- info = (CamelIMAPPMessageInfo *)camel_folder_summary_index(summary, i);
- if (info) {
- guint32 flags = info->info.flags & CAMEL_IMAPP_SERVER_FLAGS;
- guint32 sflags = info->server_flags & CAMEL_IMAPP_SERVER_FLAGS;
-
- if ( (on && (((flags ^ sflags) & flags) & flag_table[j].flag))
- || (!on && (((flags ^ sflags) & ~flags) & flag_table[j].flag))) {
- if (ic == NULL)
- ic = camel_imapp_engine_command_new(id->engine, "STORE", NULL, "UID STORE ");
- flush = imapp_uidset_add(&ss, ic, camel_message_info_uid(info));
- }
- camel_folder_summary_info_free(summary, (CamelMessageInfo *)info);
- }
-
- if (i == count-1 && ic != NULL)
- flush |= imapp_uidset_done(&ss, ic);
-
- if (flush) {
- flush = 0;
- camel_imapp_engine_command_add(id->engine, ic, " %tFLAGS.SILENT (%t)", on?"+":"-", flag_table[j].name);
- camel_imapp_engine_command_queue(id->engine, ic);
- commands = g_slist_prepend(commands, ic);
- ic = NULL;
- }
- }
- }
-
- /* flush off any requests we may have outstanding */
- /* TODO: for max benefit, should have this routine do both on and off flags in one go */
- while (commands) {
- GSList *next = commands->next;
-
- ic = commands->data;
- g_slist_free_1(commands);
- commands = next;
-
- while (camel_imapp_engine_iterate(id->engine, ic)>0)
- ;
- camel_imapp_engine_command_free(id->engine, ic);
- }
-}
-
-void
-camel_imapp_driver_sync(CamelIMAPPDriver *id, gboolean expunge, CamelIMAPPFolder *folder)
-{
- CamelFolderSummary *summary;
- guint i, count, on_orset, off_orset;
- CamelIMAPPMessageInfo *info;
- CamelIMAPPCommand *ic;
-
- /* FIXME: exception handling */
-
- camel_imapp_driver_update(id, folder);
-
- summary = ((CamelFolder *)folder)->summary;
- count = camel_folder_summary_count(summary);
- /* find out which flags have turned on, which have tunred off */
- off_orset = on_orset = 0;
- for (i=0;i<count;i++) {
- guint32 flags, sflags;
-
- info = (CamelIMAPPMessageInfo *)camel_folder_summary_index(summary, i);
- if (info == NULL)
- continue;
- flags = info->info.flags & CAMEL_IMAPP_SERVER_FLAGS;
- sflags = info->server_flags & CAMEL_IMAPP_SERVER_FLAGS;
- if (flags != sflags) {
- off_orset |= ( flags ^ sflags ) & ~flags;
- on_orset |= (flags ^ sflags) & flags;
- }
- camel_folder_summary_info_free(summary, (CamelMessageInfo *)info);
- }
-
- if (on_orset || off_orset) {
- /* turn on or off all messages matching */
- if (on_orset)
- imapp_write_flags(id, on_orset, TRUE, summary);
- if (off_orset)
- imapp_write_flags(id, off_orset, FALSE, summary);
-
- /* success (no exception), make sure we match what we're supposed to */
- for (i=0;i<count;i++) {
- guint32 flags, sflags;
-
- info = (CamelIMAPPMessageInfo *)camel_folder_summary_index(summary, i);
- if (info == NULL)
- continue;
- info->server_flags = info->info.flags & CAMEL_IMAPP_SERVER_FLAGS;
- camel_folder_summary_info_free(summary, (CamelMessageInfo *)info);
- }
- camel_folder_summary_touch(summary);
- /* could save summary here, incase of failure? */
- }
-
- if (expunge) {
- ic = camel_imapp_engine_command_new(id->engine, "EXPUNGE", NULL, "EXPUNGE");
- camel_imapp_engine_command_queue(id->engine, ic);
- while (camel_imapp_engine_iterate(id->engine, ic)>0)
- ;
- camel_imapp_engine_command_free(id->engine, ic);
- }
-
- printf("saving summary '%s'\n", summary->summary_path);
- camel_folder_summary_save(summary);
-
- if (camel_folder_change_info_changed(id->folder->changes)) {
- camel_object_trigger_event(id->folder, "folder_changed", id->folder->changes);
- camel_folder_change_info_clear(id->folder->changes);
- }
-}
-
-struct _fetch_data {
- struct _fetch_data *next;
- struct _fetch_data *prev;
-
- CamelStream *data;
- const char *uid;
- const char *section;
-};
-
-CamelStream *
-camel_imapp_driver_fetch(CamelIMAPPDriver *id, CamelIMAPPFolder *folder, const char *uid, const char *section)
-{
- struct _fetch_data fd;
- CamelIMAPPCommand *ic;
-
- fd.data = NULL;
- fd.uid = uid;
- fd.section = section;
- e_dlist_addtail(&id->body_fetch, (EDListNode *)&fd);
-
- CAMEL_TRY {
- camel_imapp_driver_select(id, folder);
-
- ic = camel_imapp_engine_command_new(id->engine, "FETCH", NULL, "UID FETCH %t (BODY.PEEK[%t])", uid, section);
- camel_imapp_engine_command_queue(id->engine, ic);
- while (camel_imapp_engine_iterate(id->engine, ic)>0)
- ;
- camel_imapp_engine_command_free(id->engine, ic);
- imapp_driver_check(id);
- } CAMEL_CATCH(e) {
- /* FIXME: do exception properly */
- } CAMEL_DONE;
-
- e_dlist_remove((EDListNode *)&fd);
-
- return fd.data;
-}
-
-GPtrArray *
-camel_imapp_driver_list(CamelIMAPPDriver *id, const char *name, guint32 flags)
-{
- CamelIMAPPCommand * volatile ic;
- GPtrArray *res;
-
- g_assert(id->list_commands == NULL);
- g_assert(id->list_result == NULL);
-
- /* FIXME: make sure we only have a single list running at a time */
- /* sem_wait(id->list_sem); */
-
- /* FIXME: namespace stuff (done in store code?) */
-
- /* FIXME: if name != "", we need to also do list "name.%" (. == sep) */
-
- id->list_result = g_ptr_array_new();
- id->list_flags = flags;
- CAMEL_TRY {
- ic = camel_imapp_engine_command_new(id->engine, "LIST", NULL, "LIST \"\" %f", name[0]?name:"%");
- camel_imapp_engine_command_queue(id->engine, ic);
- while (ic) {
- while (camel_imapp_engine_iterate(id->engine, ic)>0)
- ;
- camel_imapp_engine_command_free(id->engine, ic);
-
- if (id->list_commands) {
- GSList *top = id->list_commands;
-
- id->list_commands = top->next;
- ic = top->data;
- g_slist_free_1(top);
- } else {
- ic = NULL;
- }
- }
- } CAMEL_CATCH(e) {
- GSList *top = id->list_commands;
- int i;
-
- camel_imapp_engine_command_free(id->engine, ic);
-
- while (top) {
- GSList *topn = top->next;
-
- camel_imapp_engine_command_free(id->engine, ic);
- g_slist_free_1(top);
- top = topn;
- }
- id->list_commands = NULL;
-
- res = id->list_result;
- for (i=0;i<res->len;i++)
- imap_free_list(res->pdata[i]);
- g_ptr_array_free(res, TRUE);
- id->list_result = NULL;
-
- camel_exception_throw_ex(e);
- } CAMEL_DONE;
-
- res = id->list_result;
- id->list_result = NULL;
-
- /* sem_post(id->list_sem); */
-
- return res;
-}
-
-static int
-driver_resp_list(CamelIMAPPEngine *ie, guint32 idx, CamelIMAPPDriver *id)
-{
- struct _list_info *linfo;
-
- /* FIXME: exceptions */
-
- linfo = imap_parse_list(ie->stream);
- printf("store list: '%s' ('%c')\n", linfo->name, linfo->separator);
- if (id->list_result) {
- if ((linfo->flags & CAMEL_FOLDER_NOINFERIORS) == 0
- && (id->list_flags & CAMEL_STORE_FOLDER_INFO_RECURSIVE)
- && linfo->separator) {
- int depth = 0;
- char *p = linfo->name;
- char c = linfo->separator;
-
- /* this is expensive ... but if we've listed this deep we're going slow anyway */
- while (*p && depth < 10) {
- if (*p == c)
- depth++;
- p++;
- }
-
- if (depth < 10
- && (linfo->name[0] == 0 || linfo->name[strlen(linfo->name)-1] != c)) {
- CamelIMAPPCommand *ic;
-
- ic = camel_imapp_engine_command_new(id->engine, "LIST", NULL, "LIST \"\" %t%c%%", linfo->name, c);
- id->list_commands = g_slist_prepend(id->list_commands, ic);
- camel_imapp_engine_command_queue(id->engine, ic);
- }
- }
- /* FIXME: dont add to list if name ends in separator */
- g_ptr_array_add(id->list_result, linfo);
- } else {
- g_warning("unexpected list response\n");
- imap_free_list(linfo);
- }
-
- return camel_imapp_engine_skip(ie);
-}
-
-/* ********************************************************************** */
-
-static void
-driver_status(CamelIMAPPEngine *ie, struct _status_info *sinfo, CamelIMAPPDriver *sdata)
-{
- printf("got status response ...\n");
- switch(sinfo->condition) {
- case IMAP_READ_WRITE:
- printf("folder is read-write\n");
- break;
- case IMAP_READ_ONLY:
- printf("folder is read-only\n");
- break;
- case IMAP_UIDVALIDITY:
- sdata->uidvalidity = sinfo->u.uidvalidity;
- break;
-#if 0
- /* not defined yet ... */
- case IMAP_UIDNEXT:
- printf("got uidnext for folder: %d\n", sinfo->u.uidnext);
- break;
-#endif
- case IMAP_UNSEEN:
- sdata->unseen = sinfo->u.unseen;
- break;
- case IMAP_PERMANENTFLAGS:
- sdata->permanentflags = sinfo->u.permanentflags;
- break;
- case IMAP_ALERT:
- printf("ALERT!: %s\n", sinfo->text);
- break;
- case IMAP_PARSE:
- printf("PARSE: %s\n", sinfo->text);
- break;
- default:
- break;
- }
-}
-
-static int
-driver_resp_exists(CamelIMAPPEngine *ie, guint32 id, CamelIMAPPDriver *sdata)
-{
- /* should this be an event instead? */
-
- sdata->exists = id;
-
- return camel_imapp_engine_skip(ie);
-}
-
-static int
-driver_resp_expunge(CamelIMAPPEngine *ie, guint32 id, CamelIMAPPDriver *sdata)
-{
- printf("got expunge response %u\n", id);
- if (sdata->folder != NULL) {
- CamelMessageInfo *info;
- CamelFolderSummary *summary = ((CamelFolder *)sdata->folder)->summary;
-
- info = camel_folder_summary_index(summary, id-1);
- if (info) {
- printf("expunging msg %d\n", id);
- camel_folder_summary_remove(summary, info);
- camel_folder_summary_info_free(summary, info);
- camel_folder_change_info_remove_uid(sdata->folder->changes, camel_message_info_uid(info));
- } else {
- printf("can not find msg %u from expunge\n", id);
- }
- }
-
- return camel_imapp_engine_skip(ie);
-}
-
-static int
-driver_resp_fetch(CamelIMAPPEngine *ie, guint32 id, CamelIMAPPDriver *sdata)
-{
- struct _fetch_info *finfo = NULL;
- CamelMessageInfo *info, *uinfo;
- unsigned int i;
- CamelFolderSummary *summary;
-
- printf("got fetch response %d\n", id);
-
- if (sdata->folder == NULL)
- goto done;
-
- summary = ((CamelFolder *)sdata->folder)->summary;
-
- finfo = imap_parse_fetch(ie->stream);
- imap_dump_fetch(finfo);
-
- info = camel_folder_summary_index(summary, id-1);
- if (info == NULL) {
- if (finfo->uid == NULL) {
- printf("got fetch response for currently unknown message %u\n", id);
- goto done;
- }
- uinfo = camel_folder_summary_uid(summary, finfo->uid);
- if (uinfo) {
- /* we have a problem ... index mismatch */
- printf("index mismatch, uid '%s' not at index '%u'\n",
- finfo->uid, id);
- camel_folder_summary_info_free(summary, uinfo);
- }
- /* pad out the summary till we have enough indexes */
- for (i=camel_folder_summary_count(summary);i<id;i++) {
- info = camel_folder_summary_info_new(summary);
- if (i == id-1) {
- printf("inserting new info @ %u\n", i);
- camel_message_info_set_uid(info, g_strdup(finfo->uid));
- } else {
- char uidtmp[32];
-
- sprintf(uidtmp, "blank-%u", i);
- camel_message_info_set_uid(info, g_strdup(uidtmp));
- printf("inserting empty uid %s\n", uidtmp);
- }
-
- camel_folder_summary_add(summary, info);
- }
- info = camel_folder_summary_index(summary, id-1);
- g_assert(info != NULL);
- } else {
- if (finfo->uid) {
- /* FIXME: need to handle blank-* uids, somehow */
- while (info && strcmp(camel_message_info_uid(info), finfo->uid) != 0) {
- printf("index mismatch, uid '%s' not at index '%u', got '%s' instead (removing)\n",
- finfo->uid, id, camel_message_info_uid(info));
-
- camel_folder_change_info_remove_uid(sdata->folder->changes, camel_message_info_uid(info));
- camel_folder_summary_remove(summary, info);
- camel_folder_summary_info_free(summary, info);
- info = camel_folder_summary_index(summary, id-1);
- }
- } else {
- printf("got info for unknown message %u\n", id);
- }
- }
-
- if (info) {
- if (finfo->got & FETCH_MINFO) {
- /* if we only use ENVELOPE? */
- camel_message_info_set_subject(info, g_strdup(camel_message_info_subject(finfo->minfo)));
- camel_message_info_set_from(info, g_strdup(camel_message_info_from(finfo->minfo)));
- camel_message_info_set_to(info, g_strdup(camel_message_info_to(finfo->minfo)));
- camel_message_info_set_cc(info, g_strdup(camel_message_info_cc(finfo->minfo)));
- info->date_sent = finfo->minfo->date_sent;
- camel_folder_change_info_add_uid(sdata->folder->changes, camel_message_info_uid(info));
- printf("adding change info uid '%s'\n", camel_message_info_uid(info));
- }
-
- if (finfo->got & FETCH_FLAGS) {
- if ((info->flags & CAMEL_IMAPP_SERVER_FLAGS) != (finfo->flags & CAMEL_IMAPP_SERVER_FLAGS)) {
- camel_folder_change_info_change_uid(sdata->folder->changes, camel_message_info_uid(info));
- info->flags = (info->flags & ~(CAMEL_IMAPP_SERVER_FLAGS)) | (finfo->flags & CAMEL_IMAPP_SERVER_FLAGS);
- camel_folder_summary_touch(summary);
- }
- ((CamelIMAPPMessageInfo *)info)->server_flags = finfo->flags & CAMEL_IMAPP_SERVER_FLAGS;
- }
-
- if ((finfo->got & (FETCH_BODY|FETCH_UID)) == (FETCH_BODY|FETCH_UID)) {
- struct _fetch_data *fd, *fn;
-
- fd = (struct _fetch_data *)sdata->body_fetch.head;
- fn = fd->next;
- while (fn) {
- if (!strcmp(finfo->uid, fd->uid) && !strcmp(finfo->section, fd->section)) {
- if (fd->data)
- camel_object_unref(fd->data);
- fd->data = finfo->body;
- camel_object_ref(fd->data);
- e_dlist_remove((EDListNode *)fd);
- e_dlist_addtail(&sdata->body_fetch_done, (EDListNode *)fd);
- break;
- }
- fd = fn;
- fn = fn->next;
- }
- }
-
- camel_folder_summary_info_free(summary, info);
- } else {
- printf("dont know what to do with message\n");
- }
- done:
- imap_free_fetch(finfo);
-
- return camel_imapp_engine_skip(ie);
-}
diff --git a/camel/providers/imapp/camel-imapp-driver.h b/camel/providers/imapp/camel-imapp-driver.h
deleted file mode 100644
index 3124700619..0000000000
--- a/camel/providers/imapp/camel-imapp-driver.h
+++ /dev/null
@@ -1,81 +0,0 @@
-
-#ifndef _CAMEL_IMAPP_DRIVER_H
-#define _CAMEL_IMAPP_DRIVER_H
-
-#include <camel/camel-object.h>
-#include "camel-imapp-stream.h"
-#include <e-util/e-msgport.h>
-
-#define CAMEL_IMAPP_DRIVER_TYPE (camel_imapp_driver_get_type ())
-#define CAMEL_IMAPP_DRIVER(obj) (CAMEL_CHECK_CAST((obj), CAMEL_IMAPP_DRIVER_TYPE, CamelIMAPPDriver))
-#define CAMEL_IMAPP_DRIVER_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_IMAPP_DRIVER_TYPE, CamelIMAPPDriverClass))
-#define CAMEL_IS_IMAP_DRIVER(o) (CAMEL_CHECK_TYPE((o), CAMEL_IMAPP_DRIVER_TYPE))
-
-typedef struct _CamelIMAPPDriver CamelIMAPPDriver;
-typedef struct _CamelIMAPPDriverClass CamelIMAPPDriverClass;
-
-typedef int (*CamelIMAPPDriverFunc)(struct _CamelIMAPPDriver *driver, void *data);
-typedef struct _CamelSasl * (*CamelIMAPPSASLFunc)(struct _CamelIMAPPDriver *driver, void *data);
-typedef void (*CamelIMAPPLoginFunc)(struct _CamelIMAPPDriver *driver, char **login, char **pass, void *data);
-
-struct _CamelMimeMessage;
-
-struct _CamelIMAPPDriver {
- CamelObject parent_object;
-
- struct _CamelIMAPPEngine *engine;
-
- struct _CamelIMAPPFolder *folder;
-
- /* current folder stuff */
- GPtrArray *summary;
- guint32 uidvalidity;
- guint32 exists;
- guint32 recent;
- guint32 unseen;
- guint32 permanentflags;
-
- /* list stuff */
- GPtrArray *list_result;
- GSList *list_commands;
- guint32 list_flags;
-
- /* sem_t list_sem; for controlled access to list variables */
-
- /* this is so the node is always in a list - easier exception management */
- EDList body_fetch;
- EDList body_fetch_done;
-
- /* factory to get an appropriate sasl mech */
- CamelIMAPPSASLFunc get_sasl;
- void *get_sasl_data;
-
- /* callbacks, get login username/pass */
- CamelIMAPPLoginFunc get_login;
- void *get_login_data;
-};
-
-struct _CamelIMAPPDriverClass {
- CamelObjectClass parent_class;
-};
-
-CamelType camel_imapp_driver_get_type (void);
-
-CamelIMAPPDriver * camel_imapp_driver_new(CamelIMAPPStream *stream);
-
-void camel_imapp_driver_set_sasl_factory(CamelIMAPPDriver *id, CamelIMAPPSASLFunc get_sasl, void *sasl_data);
-void camel_imapp_driver_set_login_query(CamelIMAPPDriver *id, CamelIMAPPLoginFunc get_login, void *login_data);
-
-void camel_imapp_driver_login(CamelIMAPPDriver *id);
-
-void camel_imapp_driver_select(CamelIMAPPDriver *id, struct _CamelIMAPPFolder *folder);
-void camel_imapp_driver_update(CamelIMAPPDriver *id, struct _CamelIMAPPFolder *folder);
-void camel_imapp_driver_sync(CamelIMAPPDriver *id, gboolean expunge, struct _CamelIMAPPFolder *folder);
-
-struct _CamelStream * camel_imapp_driver_fetch(CamelIMAPPDriver *id, struct _CamelIMAPPFolder *folder, const char *uid, const char *body);
-GPtrArray * camel_imapp_driver_list(CamelIMAPPDriver *id, const char *name, guint32 flags);
-
-struct _CamelStream *camel_imapp_driver_get(CamelIMAPPDriver *id, struct _CamelIMAPPFolder *folder, const char *uid);
-void camel_imapp_driver_append(CamelIMAPPDriver *id, struct _CamelIMAPPFolder *folder, struct _CamelDataWrapper *);
-
-#endif
diff --git a/camel/providers/imapp/camel-imapp-engine.c b/camel/providers/imapp/camel-imapp-engine.c
deleted file mode 100644
index df14903c5a..0000000000
--- a/camel/providers/imapp/camel-imapp-engine.c
+++ /dev/null
@@ -1,1180 +0,0 @@
-
-#include "config.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include "camel-imapp-engine.h"
-#include "camel-imapp-stream.h"
-#include "camel-imapp-utils.h"
-#include "camel-imapp-exception.h"
-
-#include <camel/camel-folder-summary.h>
-#include <camel/camel-stream-mem.h>
-#include <camel/camel-stream-null.h>
-#include <camel/camel-data-wrapper.h>
-#include <camel/camel-sasl.h>
-
-#include <ctype.h>
-
-#define e(x)
-#define c(x) /* command build debug */
-
-static void imap_engine_command_addv(CamelIMAPPEngine *imap, CamelIMAPPCommand *ic, const char *fmt, va_list ap);
-static void imap_engine_command_complete(CamelIMAPPEngine *imap, CamelIMAPPCommand *ic);
-
-struct _handler {
- CamelIMAPPEngineFunc func;
- void *data;
- char name[1];
-};
-
-static void
-class_init(CamelIMAPPEngineClass *ieclass)
-{
- ieclass->tagprefix = 'A';
-
- camel_object_class_add_event((CamelObjectClass *)ieclass, "status", NULL);
-}
-
-static void
-object_init(CamelIMAPPEngine *ie, CamelIMAPPEngineClass *ieclass)
-{
- ie->handlers = g_hash_table_new(g_str_hash, g_str_equal);
- e_dlist_init(&ie->active);
- e_dlist_init(&ie->queue);
- e_dlist_init(&ie->done);
-
- ie->tagprefix = ieclass->tagprefix;
- ieclass->tagprefix++;
- if (ieclass->tagprefix > 'Z')
- ieclass->tagprefix = 'A';
- ie->tagprefix = 'A';
-
- ie->state = IMAP_ENGINE_DISCONNECT;
-}
-
-static void
-handler_free(void *key, void *mem, void *data)
-{
- g_free(mem);
-}
-
-static void
-object_finalise(CamelIMAPPEngine *ie, CamelIMAPPEngineClass *ieclass)
-{
- /* FIXME: need to free the commands ... */
- while (camel_imapp_engine_iterate(ie, NULL) > 0)
- ;
-
- g_hash_table_foreach(ie->handlers, (GHFunc)handler_free, NULL);
- g_hash_table_destroy(ie->handlers);
-}
-
-CamelType
-camel_imapp_engine_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (
- camel_object_get_type (),
- "CamelIMAPPEngine",
- sizeof (CamelIMAPPEngine),
- sizeof (CamelIMAPPEngineClass),
- (CamelObjectClassInitFunc) class_init,
- NULL,
- (CamelObjectInitFunc) object_init,
- (CamelObjectFinalizeFunc) object_finalise);
- }
-
- return type;
-}
-
-/* FIXME: check this, just taken from old code, not rfc */
-struct {
- char *name;
- guint32 flag;
-} capa_table[] = {
- { "IMAP4", IMAP_CAPABILITY_IMAP4 },
- { "IMAP4REV1", IMAP_CAPABILITY_IMAP4REV1 },
- { "STATUS", IMAP_CAPABILITY_STATUS } ,
- { "NAMESPACE", IMAP_CAPABILITY_NAMESPACE },
- { "UIDPLUS", IMAP_CAPABILITY_UIDPLUS },
- { "LITERAL+", IMAP_CAPABILITY_LITERALPLUS },
- { "STARTTLS", IMAP_CAPABILITY_STARTTLS },
-};
-
-
-/*
-capability_data ::= "CAPABILITY" SPACE [1#capability SPACE] "IMAP4rev1"
- [SPACE 1#capability]
- ;; IMAP4rev1 servers which offer RFC 1730
- ;; compatibility MUST list "IMAP4" as the first
- ;; capability.
-*/
-static int resp_capability(CamelIMAPPEngine *ie, guint32 id, void *data)
-{
- int tok, len, i;
- unsigned char *token, *p, c;
-
- /* FIXME: handle auth types */
-
- printf("got capability response:\n");
- while (1) {
- tok = camel_imapp_stream_token(ie->stream, &token, &len);
- switch(tok) {
- case IMAP_TOK_TOKEN:
- p = token;
- while ((c = *p))
- *p++ = toupper(c);
- case IMAP_TOK_INT:
- printf(" cap: '%s'\n", token);
- for (i=0;i<(int)(sizeof(capa_table)/sizeof(capa_table[0]));i++)
- if (strcmp(token, capa_table[i].name))
- ie->capa |= capa_table[i].flag;
- break;
- case '\n':
- return 0;
- case IMAP_TOK_ERROR:
- case IMAP_TOK_PROTOCOL:
- camel_imapp_engine_skip(ie);
- return -1;
- default:
- printf("Unknown Response token %02x '%c'\n", tok, isprint(tok)?tok:'.');
- }
- } while (tok != '\n');
-
- return 0;
-}
-
-/* expunge command, id is expunged seq number */
-/* message_data ::= nz_number SPACE ("EXPUNGE" /
- ("FETCH" SPACE msg_att)) */
-static int resp_expunge(CamelIMAPPEngine *ie, guint32 id, void *data)
-{
- printf("message expunged: %d\n", id);
-
- return camel_imapp_engine_skip(ie);
-}
-
-static int resp_flags(CamelIMAPPEngine *ie, guint32 id, void *data)
-{
- guint32 flags;
-
- imap_parse_flags(ie->stream, &flags);
-
- printf("flags: %08x\n", flags);
-
- return camel_imapp_engine_skip(ie);
-}
-
-/* exists count */
-static int resp_exists(CamelIMAPPEngine *ie, guint32 id, void *data)
-{
- printf("messages exist: %d\n", id);
-
- if (ie->select_response)
- ie->select_response->exists = id;
-
- return camel_imapp_engine_skip(ie);
-}
-
-static int resp_recent(CamelIMAPPEngine *ie, guint32 id, void *data)
-{
- printf("messages recent: %d\n", id);
-
- if (ie->select_response)
- ie->select_response->recent = id;
-
- return camel_imapp_engine_skip(ie);
-}
-
-static int resp_fetch(CamelIMAPPEngine *ie, guint32 id, void *data)
-{
- struct _fetch_info *finfo;
-
- finfo = imap_parse_fetch(ie->stream);
- imap_dump_fetch(finfo);
- imap_free_fetch(finfo);
-
- return camel_imapp_engine_skip(ie);
-}
-
-#if 0
-static int resp_list(CamelIMAPPEngine *ie, guint32 id, void *data)
-{
- struct _list_info *linfo;
-
- linfo = imap_parse_list(ie->stream);
- printf("list: '%s' (%c)\n", linfo->name, linfo->separator);
- imap_free_list(linfo);
-
- return camel_imapp_engine_skip(ie);
-}
-#endif
-
-CamelIMAPPEngine *
-camel_imapp_engine_new(CamelIMAPPStream *stream)
-{
- CamelIMAPPEngine * volatile engine;
-
- engine = CAMEL_IMAPP_ENGINE (camel_object_new (CAMEL_IMAPP_ENGINE_TYPE));
- engine->stream = stream;
- camel_object_ref((CamelObject *)stream);
-
- camel_imapp_engine_add_handler(engine, "CAPABILITY", resp_capability, engine);
-
- /* mailbox_data */
- camel_imapp_engine_add_handler(engine, "FLAGS", (CamelIMAPPEngineFunc)resp_flags, engine);
- camel_imapp_engine_add_handler(engine, "EXISTS", (CamelIMAPPEngineFunc)resp_exists, engine);
- camel_imapp_engine_add_handler(engine, "RECENT", (CamelIMAPPEngineFunc)resp_recent, engine);
-
-#if 0
- camel_imapp_engine_add_handler(engine, "LIST", (CamelIMAPPEngineFunc)resp_list, engine);
- camel_imapp_engine_add_handler(engine, "LSUB", (CamelIMAPPEngineFunc)resp_list, engine);
-#endif
- /* message_data */
- camel_imapp_engine_add_handler(engine, "EXPUNGE", (CamelIMAPPEngineFunc)resp_expunge, engine);
- camel_imapp_engine_add_handler(engine, "FETCH", (CamelIMAPPEngineFunc)resp_fetch, engine);
-
- /* TODO: move this to a driver:connect call? */
- CAMEL_TRY {
- unsigned char *token;
- unsigned int len;
- int tok;
-
- tok = camel_imapp_stream_token(stream, &token, &len);
- if (tok == '*') {
- struct _status_info *sinfo = imap_parse_status(stream);
-
- switch (sinfo->result) {
- case IMAP_OK:
- engine->state = IMAP_ENGINE_CONNECT;
- printf("Server connected ok: %s\n", sinfo->text);
- break;
- case IMAP_PREAUTH:
- printf("pre-authenticated ...\n");
- engine->state = IMAP_ENGINE_AUTH;
- break;
- default:
- imap_free_status(sinfo);
- camel_exception_throw(1, "Server refused connection: %s", sinfo->text);
- break;
- }
- imap_free_status(sinfo);
- } else {
- engine->state = IMAP_ENGINE_CONNECT;
- printf("unknwon server greeting, ignored\n");
- camel_imapp_engine_skip(engine);
- }
- camel_imapp_engine_capabilities(engine);
- } CAMEL_CATCH(ex) {
- printf("connection failed: %s\n", ex->desc);
- camel_object_unref((CamelObject *)engine);
- engine = NULL;
- } CAMEL_DONE;
-
- return engine;
-}
-
-void
-camel_imapp_engine_add_handler(CamelIMAPPEngine *imap, const char *response, CamelIMAPPEngineFunc func, void *data)
-{
- struct _handler *h;
- const unsigned char *p;
- unsigned char *o, c;
-
- h = g_malloc0(sizeof(*h) + strlen(response));
- h->func = func;
- h->data = data;
-
- p = response;
- o = h->name;
- while ((c = *p++))
- *o++ = toupper(c);
- *o = 0;
-
- g_hash_table_insert(imap->handlers, h->name, h);
-}
-
-int
-camel_imapp_engine_capabilities(CamelIMAPPEngine *ie)
-{
- CamelIMAPPCommand *ic;
-
- /* reset capabilities */
- ie->capa = 0;
-
- ic = camel_imapp_engine_command_new(ie, "CAPABILITY", NULL, "CAPABILITY");
- camel_imapp_engine_command_queue(ie, ic);
- while (camel_imapp_engine_iterate(ie, ic)>0)
- ;
- camel_imapp_engine_command_free(ie, ic);
-
- return 0;
-}
-
-/* skip the rest of the line of tokens */
-int
-camel_imapp_engine_skip(CamelIMAPPEngine *imap)
-{
- int tok;
- unsigned char *token;
- unsigned int len;
-
- do {
- tok = camel_imapp_stream_token(imap->stream, &token, &len);
- if (tok == IMAP_TOK_LITERAL) {
- camel_imapp_stream_set_literal(imap->stream, len);
- while ((tok = camel_imapp_stream_getl(imap->stream, &token, &len)) > 0) {
- printf("Skip literal data '%.*s'\n", (int)len, token);
- }
- }
- } while (tok != '\n' && tok >= 0);
-
- if (tok < 0)
- return -1;
-
- return 0;
-}
-
-/* handle any untagged responses */
-static int
-iterate_untagged(CamelIMAPPEngine *imap)
-{
- unsigned int id, len;
- unsigned char *token, *p, c;
- int tok;
- struct _handler *h;
- struct _status_info *sinfo;
-
- e(printf("got untagged response\n"));
- id = 0;
- tok = camel_imapp_stream_token(imap->stream, &token, &len);
- if (tok == IMAP_TOK_INT) {
- id = strtoul(token, NULL, 10);
- tok = camel_imapp_stream_token(imap->stream, &token, &len);
- }
-
- if (tok == '\n')
- camel_exception_throw(1, "truncated server response");
-
- e(printf("Have token '%s' id %d\n", token, id));
- p = token;
- while ((c = *p))
- *p++ = toupper(c);
-
- /* first, check for generic unsolicited response */
- h = g_hash_table_lookup(imap->handlers, token);
- if (h) {
- tok = h->func(imap, id, h->data);
- if (tok < 0)
- return tok;
- return 1;
- }
-
- /* TODO: apart from bye/preauth, these could be callbacks/events? */
-
- /* now, check for status responses */
- switch (imap_tokenise(token, len)) {
- case IMAP_BYE:
- case IMAP_OK:
- case IMAP_NO:
- case IMAP_BAD:
- case IMAP_PREAUTH:
- /* TODO: validate which ones of these can happen as unsolicited responses */
- /* TODO: handle bye/preauth differently */
- /* FIXME: free sinfo */
- camel_imapp_stream_ungettoken(imap->stream, tok, token, len);
- sinfo = imap_parse_status(imap->stream);
- camel_object_trigger_event(imap, "status", sinfo);
- imap_free_status(sinfo);
-#if 0
- switch(sinfo->condition) {
- case IMAP_READ_WRITE:
- printf("folder is read-write\n");
- break;
- case IMAP_READ_ONLY:
- printf("folder is read-only\n");
- break;
- case IMAP_UIDVALIDITY:
- if (imap->select_response)
- imap->select_response->uidvalidity = sinfo->u.uidvalidity;
- break;
-#if 0
- /* not defined yet ... */
- case IMAP_UIDNEXT:
- printf("got uidnext for folder: %d\n", sinfo->u.uidnext);
- break;
-#endif
- case IMAP_UNSEEN:
- if (imap->select_response)
- imap->select_response->unseen = sinfo->u.unseen;
- break;
- case IMAP_PERMANENTFLAGS:
- if (imap->select_response)
- imap->select_response->permanentflags = sinfo->u.permanentflags;
- break;
- case IMAP_ALERT:
- printf("ALERT!: %s\n", sinfo->text);
- break;
- case IMAP_PARSE:
- printf("PARSE: %s\n", sinfo->text);
- break;
- default:
- break;
- }
-#endif
- break;
- default:
- printf("unknown token: %s\n", token);
- camel_imapp_engine_skip(imap);
- /* unknown response, just ignore it */
- }
-
- return 1;
-}
-
-/* handle any continuation requests
- either data continuations, or auth continuation */
-int
-iterate_continuation(CamelIMAPPEngine *imap)
-{
- CamelIMAPPCommand *ic;
- CamelIMAPPCommandPart *cp;
-
- printf("got continuation response\n");
-
- ic = imap->literal;
- imap->literal = NULL;
- if (ic == NULL) {
- camel_imapp_engine_skip(imap);
- printf("got continuation response with no outstanding continuation requests?\n");
- return 1;
- }
-
- printf("got continuation response for data\n");
- cp = ic->current;
- switch(cp->type & CAMEL_IMAPP_COMMAND_MASK) {
- case CAMEL_IMAPP_COMMAND_DATAWRAPPER:
- printf("writing data wrapper to literal\n");
- camel_data_wrapper_write_to_stream((CamelDataWrapper *)cp->ob, (CamelStream *)imap->stream);
- break;
- case CAMEL_IMAPP_COMMAND_STREAM:
- printf("writing stream to literal\n");
- camel_stream_write_to_stream((CamelStream *)cp->ob, (CamelStream *)imap->stream);
- break;
- case CAMEL_IMAPP_COMMAND_AUTH: {
- CamelException *ex = camel_exception_new();
- char *resp;
- unsigned char *token;
- int tok, len;
-
- tok = camel_imapp_stream_token(imap->stream, &token, &len);
- resp = camel_sasl_challenge_base64((CamelSasl *)cp->ob, token, ex);
- if (camel_exception_is_set(ex))
- camel_exception_throw_ex(ex);
- camel_exception_free(ex);
-
- printf("got auth continuation, feeding token '%s' back to auth mech\n", resp);
-
- camel_stream_write((CamelStream *)imap->stream, resp, strlen(resp));
-
- /* we want to keep getting called until we get a status reponse from the server
- ignore what sasl tells us */
- imap->literal = ic;
-
- break; }
- default:
- /* should we just ignore? */
- camel_exception_throw(1, "continuation response for non-continuation request");
- }
-
- camel_imapp_engine_skip(imap);
-
- cp = cp->next;
- if (cp->next) {
- ic->current = cp;
- printf("next part of command \"A%05u: %s\"\n", ic->tag, cp->data);
- camel_stream_printf((CamelStream *)imap->stream, "%s\r\n", cp->data);
- if (cp->type & CAMEL_IMAPP_COMMAND_CONTINUATION) {
- imap->literal = ic;
- } else {
- g_assert(cp->next->next == NULL);
- }
- } else {
- printf("%p: queueing continuation\n", ic);
- camel_stream_printf((CamelStream *)imap->stream, "\r\n");
- }
-
- if (imap->literal == NULL) {
- ic = (CamelIMAPPCommand *)e_dlist_remhead(&imap->queue);
- if (ic) {
- printf("found outstanding op, queueing\n");
- camel_imapp_engine_command_queue(imap, ic);
- }
- }
-
- return 1;
-}
-
-/* handle a completion line */
-int
-iterate_completion(CamelIMAPPEngine *imap, unsigned char *token)
-{
- CamelIMAPPCommand *ic;
- unsigned int tag;
-
- if (token[0] != imap->tagprefix)
- camel_exception_throw(1, "Server sent unexpected response: %s", token);
-
- tag = strtoul(token+1, NULL, 10);
- ic = camel_imapp_engine_command_find_tag(imap, tag);
- if (ic) {
- printf("Got completion response for command %05u '%s'\n", ic->tag, ic->name);
- printf("%p: removing command from qwueue, we were at '%s'\n", ic, ic->current->data);
- printf("%p: removing command\n", ic);
- e_dlist_remove((EDListNode *)ic);
- e_dlist_addtail(&imap->done, (EDListNode *)ic);
- if (imap->literal == ic)
- imap->literal = NULL;
- ic->status = imap_parse_status(imap->stream);
- printf("got response code: %s\n", ic->status->text);
-
- /* TODO: remove this stuff and use a completion handler? */
- /* TODO: handle 'SELECT' command cleanup here */
- /* FIXME: have this use tokeniser, have this handle close/logout/select etc as well */
- /* ok response from login/authenticate, then we're in happy land */
- if ((!strcmp(ic->name, "LOGIN") || !strcmp(ic->name, "AUTHENTICATE"))
- && ic->status->result == IMAP_OK)
- imap->state = IMAP_ENGINE_AUTH;
-
- if (ic->complete)
- ic->complete(imap, ic, ic->complete_data);
- } else {
- camel_exception_throw(1, "got response tag unexpectedly: %s", token);
- }
-
- if (imap->literal != NULL) {
- printf("Warning: continuation command '%s' finished with outstanding continuation\n", imap->literal->name);
- ic = imap->literal;
- /* set the command complete with a failure code? */
- e_dlist_remove((EDListNode *)ic);
- e_dlist_addtail(&imap->done, (EDListNode *)ic);
- imap->literal = NULL;
- }
-
- ic = (CamelIMAPPCommand *)e_dlist_remhead(&imap->queue);
- if (ic) {
- printf("found outstanding op, queueing\n");
- camel_imapp_engine_command_queue(imap, ic);
- }
-
- return 1;
-}
-
-
-/* Do work if there's any to do */
-int
-camel_imapp_engine_iterate(CamelIMAPPEngine *imap, CamelIMAPPCommand *icwait)
-/* throws IO,PARSE exception */
-{
- unsigned int len;
- unsigned char *token;
- int tok;
-
- if ((icwait && icwait->status != NULL) || e_dlist_empty(&imap->active))
- return 0;
-
- /* handle exceptions here? */
-
- /* lock here? */
-
- tok = camel_imapp_stream_token(imap->stream, &token, &len);
- if (tok == '*')
- iterate_untagged(imap);
- else if (tok == IMAP_TOK_TOKEN)
- iterate_completion(imap, token);
- else if (tok == '+')
- iterate_continuation(imap);
- else
- camel_exception_throw(1, "unexpected server response: %s", token);
-
- if (e_dlist_empty(&imap->active))
- return 0;
-
- return 1;
-}
-
-CamelIMAPPCommand *
-camel_imapp_engine_command_new(CamelIMAPPEngine *imap, const char *name, const char *select, const char *fmt, ...)
-{
- CamelIMAPPCommand *ic;
- va_list ap;
-
- ic = g_malloc0(sizeof(*ic));
- ic->tag = imap->tag++;
- ic->name = name;
- ic->mem = (CamelStreamMem *)camel_stream_mem_new();
- ic->select = g_strdup(select);
- e_dlist_init(&ic->parts);
-
- if (fmt && fmt[0]) {
- va_start(ap, fmt);
- imap_engine_command_addv(imap, ic, fmt, ap);
- va_end(ap);
- }
-
- return ic;
-}
-
-void
-camel_imapp_engine_command_add(CamelIMAPPEngine *imap, CamelIMAPPCommand *ic, const char *fmt, ...)
-{
- va_list ap;
-
- g_assert(ic->mem); /* gets reset on queue */
-
- if (fmt && fmt[0]) {
- va_start(ap, fmt);
- imap_engine_command_addv(imap, ic, fmt, ap);
- va_end(ap);
- }
-}
-
-void
-camel_imapp_engine_command_complete(CamelIMAPPEngine *imap, struct _CamelIMAPPCommand *ic, CamelIMAPPCommandFunc func, void *data)
-{
- ic->complete = func;
- ic->complete_data = data;
-}
-
-/* FIXME: make imap command's refcounted */
-void
-camel_imapp_engine_command_free (CamelIMAPPEngine *imap, CamelIMAPPCommand *ic)
-{
- CamelIMAPPCommandPart *cp, *cn;
-
- if (ic == NULL)
- return;
-
- /* validity check - we cant' free items still in any queue ... */
- /* maybe we should just have another queue to keep them? */
- {
- CamelIMAPPCommand *iw;
- int found = 0;
-
- iw = (CamelIMAPPCommand *)imap->active.head;
- while (iw->next) {
- if (iw == ic) {
- found = 1;
- g_warning("command '%s' still in active queue", iw->name);
- break;
- }
- iw = iw->next;
- }
- iw = (CamelIMAPPCommand *)imap->queue.head;
- while (iw->next) {
- if (iw == ic) {
- found = 1;
- g_warning("command '%s' still in waiting queue", iw->name);
- break;
- }
- iw = iw->next;
- }
- iw = (CamelIMAPPCommand *)imap->done.head;
- while (iw->next) {
- if (iw == ic) {
- found = 1;
- break;
- }
- iw = iw->next;
- }
- if (!found) {
- g_warning("command '%s' not found anywhere", ic->name);
- abort();
- }
- }
-
- e_dlist_remove((EDListNode *)ic);
-
- if (ic->mem)
- camel_object_unref((CamelObject *)ic->mem);
- imap_free_status(ic->status);
- g_free(ic->select);
-
- cp = (CamelIMAPPCommandPart *)ic->parts.head;
- cn = cp->next;
- while (cn) {
- g_free(cp->data);
- if (cp->ob)
- camel_object_unref(cp->ob);
- g_free(cp);
- cp = cn;
- cn = cn->next;
- }
-
- g_free(ic);
-}
-
-/* FIXME: error handling */
-void
-camel_imapp_engine_command_queue(CamelIMAPPEngine *imap, CamelIMAPPCommand *ic)
-{
- CamelIMAPPCommandPart *cp;
-
- if (ic->mem)
- imap_engine_command_complete(imap, ic);
-
- /* FIXME: remove select stuff */
-
- /* see if we need to pre-queue a select command to select the right folder first */
- if (ic->select && (imap->last_select == NULL || strcmp(ic->select, imap->last_select) != 0)) {
- CamelIMAPPCommand *select;
-
- /* of course ... we can't do anything like store/search if we have to select
- first, because it'll mess up all the sequence numbers ... hrm ... bugger */
-
- select = camel_imapp_engine_command_new(imap, "SELECT", NULL, "SELECT %s", ic->select);
- g_free(imap->last_select);
- imap->last_select = g_strdup(ic->select);
- camel_imapp_engine_command_queue(imap, select);
- /* how does it get freed? handle inside engine? */
- }
-
- /* first, check if command can be sent yet ... queue if not */
- if (imap->literal != NULL) {
- printf("%p: queueing while literal active\n", ic);
- e_dlist_addtail(&imap->queue, (EDListNode *)ic);
- return;
- }
-
- cp = (CamelIMAPPCommandPart *)ic->parts.head;
- g_assert(cp);
- ic->current = cp;
-
- /* how to handle exceptions here? */
-
- printf("queueing command \"%c%05u %s\"\n", imap->tagprefix, ic->tag, cp->data);
- camel_stream_printf((CamelStream *)imap->stream, "%c%05u %s\r\n", imap->tagprefix, ic->tag, cp->data);
-
- if (cp->type & CAMEL_IMAPP_COMMAND_CONTINUATION) {
- printf("%p: active literal\n", ic);
- g_assert(cp->next);
- imap->literal = ic;
- e_dlist_addtail(&imap->active, (EDListNode *)ic);
- } else {
- printf("%p: active non-literal\n", ic);
- g_assert(cp->next && cp->next->next == NULL);
- e_dlist_addtail(&imap->active, (EDListNode *)ic);
- }
-}
-
-CamelIMAPPCommand *
-camel_imapp_engine_command_find (CamelIMAPPEngine *imap, const char *name)
-{
- CamelIMAPPCommand *ic, *in;
-
- ic = imap->literal;
- if (ic && strcmp(ic->name, name) == 0)
- return ic;
-
- /* first, try active */
- ic = (CamelIMAPPCommand *)imap->active.head;
- in = ic->next;
- while (in) {
- if (strcmp(ic->name, name) == 0)
- return ic;
- ic = in;
- in = in->next;
- }
-
- return NULL;
-}
-
-CamelIMAPPCommand *
-camel_imapp_engine_command_find_tag(CamelIMAPPEngine *imap, unsigned int tag)
-{
- CamelIMAPPCommand *ic, *in;
-
- ic = imap->literal;
- if (ic && ic->tag == tag)
- return ic;
-
- ic = (CamelIMAPPCommand *)imap->active.head;
- in = ic->next;
- while (in) {
- if (ic->tag == tag)
- return ic;
- ic = in;
- in = in->next;
- }
-
- return NULL;
-}
-
-/* ********************************************************************** */
-
-CamelIMAPPSelectResponse *
-camel_imapp_engine_select(CamelIMAPPEngine *imap, const char *name)
-{
- CamelIMAPPSelectResponse * volatile resp;
- CamelIMAPPCommand * volatile ic = NULL;
-
- resp = g_malloc0(sizeof(*resp));
- imap->select_response = resp;
-
- CAMEL_TRY {
- ic = camel_imapp_engine_command_new(imap, "SELECT", NULL, "SELECT %s", name);
- camel_imapp_engine_command_queue(imap, ic);
- while (camel_imapp_engine_iterate(imap, ic) > 0)
- ;
-
- if (ic->status->result != IMAP_OK)
- camel_exception_throw(1, "select failed: %s", ic->status->text);
- resp->status = ic->status;
- ic->status = NULL;
- } CAMEL_CATCH (e) {
- camel_imapp_engine_command_free(imap, ic);
- camel_imapp_engine_select_free(imap, resp);
- imap->select_response = NULL;
- camel_exception_throw_ex(e);
- } CAMEL_DONE;
-
- camel_imapp_engine_command_free(imap, ic);
- imap->select_response = NULL;
-
- return resp;
-}
-
-void
-camel_imapp_engine_select_free(CamelIMAPPEngine *imap, CamelIMAPPSelectResponse *select)
-{
- if (select) {
- imap_free_status(select->status);
- g_free(select);
- }
-}
-
-/* ********************************************************************** */
-
-static void
-imap_engine_command_add_part(CamelIMAPPEngine *imap, CamelIMAPPCommand *ic, camel_imapp_command_part_t type, CamelObject *ob)
-{
- CamelIMAPPCommandPart *cp;
- CamelStreamNull *null;
- unsigned int ob_size = 0;
-
- switch(type & CAMEL_IMAPP_COMMAND_MASK) {
- case CAMEL_IMAPP_COMMAND_DATAWRAPPER:
- case CAMEL_IMAPP_COMMAND_STREAM:
- null = (CamelStreamNull *)camel_stream_null_new();
- if ( (type & CAMEL_IMAPP_COMMAND_MASK) == CAMEL_IMAPP_COMMAND_DATAWRAPPER) {
- camel_data_wrapper_write_to_stream((CamelDataWrapper *)ob, (CamelStream *)null);
- } else {
- camel_stream_reset((CamelStream *)ob);
- camel_stream_write_to_stream((CamelStream *)ob, (CamelStream *)null);
- camel_stream_reset((CamelStream *)ob);
- }
- type |= CAMEL_IMAPP_COMMAND_CONTINUATION;
- camel_object_ref(ob);
- ob_size = null->written;
- camel_object_unref((CamelObject *)null);
- camel_stream_printf((CamelStream *)ic->mem, "{%u}", ob_size);
- break;
- case CAMEL_IMAPP_COMMAND_AUTH:
- /* we presume we'll need to get additional data only if we're not authenticated yet */
- camel_object_ref(ob);
- camel_stream_printf((CamelStream *)ic->mem, "%s", ((CamelSasl *)ob)->mech);
- if (!camel_sasl_authenticated((CamelSasl *)ob))
- type |= CAMEL_IMAPP_COMMAND_CONTINUATION;
- break;
- default:
- ob_size = 0;
- }
-
- cp = g_malloc0(sizeof(*cp));
- cp->type = type;
- cp->ob_size = ob_size;
- cp->ob = ob;
- cp->data_size = ic->mem->buffer->len;
- cp->data = g_malloc(cp->data_size+1);
- memcpy(cp->data, ic->mem->buffer->data, cp->data_size);
- cp->data[cp->data_size] = 0;
-
- camel_stream_reset((CamelStream *)ic->mem);
- /* FIXME: hackish? */
- g_byte_array_set_size(ic->mem->buffer, 0);
-
- e_dlist_addtail(&ic->parts, (EDListNode *)cp);
-}
-
-static int len(EDList *list)
-{
- int count = 0;
- EDListNode *n = list->head;
-
- while (n->next) {
- n = n->next;
- count++;
- }
- return count;
-}
-
-static void
-imap_engine_command_complete(CamelIMAPPEngine *imap, CamelIMAPPCommand *ic)
-{
- c(printf("completing command buffer is [%d] '%.*s'\n", ic->mem->buffer->len, (int)ic->mem->buffer->len, ic->mem->buffer->data));
- c(printf("command has %d parts\n", len(&ic->parts)));
- if (ic->mem->buffer->len > 0)
- imap_engine_command_add_part(imap, ic, CAMEL_IMAPP_COMMAND_SIMPLE, NULL);
-
- c(printf("command has %d parts\n", len(&ic->parts)));
-
- camel_object_unref((CamelObject *)ic->mem);
- ic->mem = NULL;
-}
-
-static void
-imap_engine_command_addv(CamelIMAPPEngine *imap, CamelIMAPPCommand *ic, const char *fmt, va_list ap)
-{
- const unsigned char *p, *ps, *start;
- unsigned char c;
- unsigned int width;
- char ch;
- int llong;
- int left;
- int fill;
- int zero;
- char *s;
- int d;
- long int l;
- guint32 f;
- CamelStream *S;
- CamelDataWrapper *D;
- CamelSasl *A;
- char buffer[16];
-
- c(printf("adding command, fmt = '%s'\n", fmt));
-
- p = fmt;
- ps = fmt;
- while ( ( c = *p++ ) ) {
- switch(c) {
- case '%':
- if (*p == '%') {
- camel_stream_write((CamelStream *)ic->mem, ps, p-ps);
- p++;
- ps = p;
- } else {
- camel_stream_write((CamelStream *)ic->mem, ps, p-ps-1);
- start = p-1;
- width = 0;
- left = FALSE;
- fill = FALSE;
- zero = FALSE;
- llong = FALSE;
-
- do {
- c = *p++;
- if (c == '0')
- zero = TRUE;
- else if ( c== '-')
- left = TRUE;
- else
- break;
- } while (c);
-
- do {
- if (isdigit(c))
- width = width * 10 + (c-'0');
- else
- break;
- } while ((c = *p++));
-
- if (c == 'l') {
- llong = TRUE;
- c = *p++;
- }
-
- switch(c) {
- case 'A': /* auth object - sasl auth, treat as special kind of continuation */
- A = va_arg(ap, CamelSasl *);
- imap_engine_command_add_part(imap, ic, CAMEL_IMAPP_COMMAND_AUTH, (CamelObject *)A);
- break;
- case 'S': /* stream */
- S = va_arg(ap, CamelStream *);
- c(printf("got stream '%p'\n", S));
- imap_engine_command_add_part(imap, ic, CAMEL_IMAPP_COMMAND_STREAM, (CamelObject *)S);
- break;
- case 'D': /* datawrapper */
- D = va_arg(ap, CamelDataWrapper *);
- c(printf("got data wrapper '%p'\n", D));
- imap_engine_command_add_part(imap, ic, CAMEL_IMAPP_COMMAND_DATAWRAPPER, (CamelObject *)D);
- break;
- case 't': /* token */
- s = va_arg(ap, char *);
- camel_stream_write((CamelStream *)ic->mem, s, strlen(s));
- break;
- case 's': /* simple string */
- s = va_arg(ap, char *);
- c(printf("got string '%s'\n", s));
- /* FIXME: escpae chars, convert to literal or literal+, etc */
- camel_stream_printf((CamelStream *)ic->mem, "\"%s\"", s);
- break;
- case 'f': /* imap folder name */
- s = va_arg(ap, char *);
- c(printf("got folder '%s'\n", s));
- /* FIXME: encode folder name */
- /* FIXME: namespace? */
- camel_stream_printf((CamelStream *)ic->mem, "\"%s\"", s?s:"");
- break;
- case 'F': /* IMAP flags set */
- f = va_arg(ap, guint32);
- imap_write_flags((CamelStream *)ic->mem, f);
- break;
- case 'c':
- d = va_arg(ap, int);
- ch = d;
- camel_stream_write((CamelStream *)ic->mem, &ch, 1);
- break;
- case 'd': /* int/unsigned */
- case 'u':
- if (llong) {
- l = va_arg(ap, long int);
- c(printf("got long int '%d'\n", (int)l));
- memcpy(buffer, start, p-start);
- buffer[p-start] = 0;
- camel_stream_printf((CamelStream *)ic->mem, buffer, l);
- } else {
- d = va_arg(ap, int);
- c(printf("got int '%d'\n", d));
- memcpy(buffer, start, p-start);
- buffer[p-start] = 0;
- camel_stream_printf((CamelStream *)ic->mem, buffer, d);
- }
- break;
- }
-
- ps = p;
- }
- break;
- case '\\': /* only for \\ really, we dont support \n\r etc at all */
- c = *p;
- if (c) {
- g_assert(c == '\\');
- camel_stream_write((CamelStream *)ic->mem, ps, p-ps);
- p++;
- ps = p;
- }
- }
- }
-
- camel_stream_write((CamelStream *)ic->mem, ps, p-ps-1);
-}
-
-
-/* here temporarily while its experimental */
-
-
-#ifdef ENABLE_THREADS
-#include <pthread.h>
-
-static pthread_key_t handler_key = 0;
-
-void camel_exception_setup(void)
-{
- pthread_key_create(&handler_key, NULL);
-}
-
-#else
-/* this is per-thread in threaded mode */
-static struct _CamelExceptionEnv *handler = NULL;
-
-void camel_exception_setup(void)
-{
-}
-#endif
-
-void
-camel_exception_try(struct _CamelExceptionEnv *env)
-{
-#ifdef ENABLE_THREADS
- struct _CamelExceptionEnv *handler;
-
- handler = pthread_getspecific(handler_key);
-#endif
- env->parent = handler;
- handler = env;
- env->ex = NULL;
-
-#ifdef ENABLE_THREADS
- pthread_setspecific(handler_key, handler);
-#endif
-}
-
-void
-camel_exception_throw_ex(CamelException *ex)
-{
- struct _CamelExceptionEnv *env;
-#ifdef ENABLE_THREADS
- struct _CamelExceptionEnv *handler;
-
- handler = pthread_getspecific(handler_key);
-#endif
- printf("throwing exception '%s'\n", ex->desc);
-
- env = handler;
- if (env != NULL) {
- env->ex = ex;
- handler = env->parent;
-#ifdef ENABLE_THREADS
- pthread_setspecific(handler_key, handler);
-#endif
- longjmp(env->env, ex->id);
- } else {
- g_warning("Uncaught exception: %s\n", ex->desc);
- /* we just crash and burn, this is a code problem */
- /* we dont use g_assert_not_reached() since its not a noreturn function */
- abort();
- }
-}
-
-void
-camel_exception_throw(int id, char *fmt, ...)
-{
- CamelException *ex;
- va_list ap;
-
- ex = camel_exception_new();
- ex->id = id;
- va_start(ap, fmt);
- ex->desc = g_strdup_vprintf(fmt, ap);
- va_end(ap);
-
- camel_exception_throw_ex(ex);
-}
-
-void
-camel_exception_drop(struct _CamelExceptionEnv *env)
-{
-#ifdef ENABLE_THREADS
- pthread_setspecific(handler_key, env->parent);
-#else
- handler = env->parent;
-#endif
-}
-
-void
-camel_exception_done(struct _CamelExceptionEnv *env)
-{
-#ifdef ENABLE_THREADS
- pthread_setspecific(handler_key, env->parent);
-#else
- handler = env->parent;
-#endif
- if (env->ex != NULL) {
- camel_exception_free(env->ex);
- }
-}
diff --git a/camel/providers/imapp/camel-imapp-engine.h b/camel/providers/imapp/camel-imapp-engine.h
deleted file mode 100644
index 5f74d0654a..0000000000
--- a/camel/providers/imapp/camel-imapp-engine.h
+++ /dev/null
@@ -1,155 +0,0 @@
-
-#ifndef _CAMEL_IMAPP_ENGINE_H
-#define _CAMEL_IMAPP_ENGINE_H
-
-#include <camel/camel-object.h>
-
-#include "camel-imapp-stream.h"
-#include <e-util/e-msgport.h>
-#include "camel-imapp-folder.h"
-
-#define CAMEL_IMAPP_ENGINE_TYPE (camel_imapp_engine_get_type ())
-#define CAMEL_IMAPP_ENGINE(obj) (CAMEL_CHECK_CAST((obj), CAMEL_IMAPP_ENGINE_TYPE, CamelIMAPPEngine))
-#define CAMEL_IMAPP_ENGINE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_IMAPP_ENGINE_TYPE, CamelIMAPPEngineClass))
-#define CAMEL_IS_IMAP_ENGINE(o) (CAMEL_CHECK_TYPE((o), CAMEL_IMAPP_ENGINE_TYPE))
-
-typedef struct _CamelIMAPPEngine CamelIMAPPEngine;
-typedef struct _CamelIMAPPEngineClass CamelIMAPPEngineClass;
-
-typedef struct _CamelIMAPPCommandPart CamelIMAPPCommandPart;
-typedef struct _CamelIMAPPCommand CamelIMAPPCommand;
-
-typedef enum {
- CAMEL_IMAPP_COMMAND_SIMPLE = 0,
- CAMEL_IMAPP_COMMAND_DATAWRAPPER,
- CAMEL_IMAPP_COMMAND_STREAM,
- CAMEL_IMAPP_COMMAND_AUTH,
- CAMEL_IMAPP_COMMAND_MASK = 0xff,
- CAMEL_IMAPP_COMMAND_CONTINUATION = 0x8000 /* does this command expect continuation? */
-} camel_imapp_command_part_t;
-
-struct _CamelIMAPPCommandPart {
- struct _CamelIMAPPCommandPart *next;
- struct _CamelIMAPPCommandPart *prev;
-
- struct _CamelIMAPPCommand *parent;
-
- int data_size;
- char *data;
-
- camel_imapp_command_part_t type;
-
- int ob_size;
- CamelObject *ob;
-};
-
-typedef int (*CamelIMAPPEngineFunc)(struct _CamelIMAPPEngine *engine, guint32 id, void *data);
-typedef void (*CamelIMAPPCommandFunc)(struct _CamelIMAPPEngine *engine, struct _CamelIMAPPCommand *, void *data);
-
-/* FIXME: make this refcounted */
-struct _CamelIMAPPCommand {
- struct _CamelIMAPPCommand *next;
- struct _CamelIMAPPCommand *prev;
-
- const char *name; /* command name/type (e.g. FETCH) */
-
- /* FIXME: remove this select stuff */
- char *select; /* if we need to run against a specific folder */
- struct _status_info *status; /* status for command, indicates it is complete if != NULL */
-
- unsigned int tag;
-
- struct _CamelStreamMem *mem; /* for building the part */
- EDList parts;
- CamelIMAPPCommandPart *current;
-
- CamelIMAPPCommandFunc complete;
- void *complete_data;
-};
-
-typedef struct _CamelIMAPPSelectResponse CamelIMAPPSelectResponse;
-
-struct _CamelIMAPPSelectResponse {
- struct _status_info *status;
- guint32 exists;
- guint32 recent;
- guint32 uidvalidity;
- guint32 unseen;
- guint32 permanentflags;
-};
-
-enum {
- IMAP_CAPABILITY_IMAP4 = (1 << 0),
- IMAP_CAPABILITY_IMAP4REV1 = (1 << 1),
- IMAP_CAPABILITY_STATUS = (1 << 2),
- IMAP_CAPABILITY_NAMESPACE = (1 << 3),
- IMAP_CAPABILITY_UIDPLUS = (1 << 4),
- IMAP_CAPABILITY_LITERALPLUS = (1 << 5),
- IMAP_CAPABILITY_STARTTLS = (1 << 6),
-};
-
-/* currently selected states */
-typedef enum _camel_imapp_engine_state_t {
- IMAP_ENGINE_DISCONNECT, /* only happens during shutdown */
- IMAP_ENGINE_CONNECT, /* connected, not authenticated */
- IMAP_ENGINE_AUTH, /* connected, and authenticated */
- IMAP_ENGINE_SELECT, /* and selected, select holds selected folder */
-} camel_imapp_engine_state_t;
-
-struct _CamelIMAPPEngine {
- CamelObject parent_object;
-
- CamelIMAPPStream *stream;
-
- camel_imapp_engine_state_t state;
-
- guint32 capa; /* capabilities for this server, refresh with :capabilities() */
-
- GHashTable *handlers;
-
- unsigned char tagprefix; /* out tag prefix 'A' 'B' ... 'Z' */
- unsigned int tag; /* next command tag */
-
- char *select; /* *currently* selected folder */
- char *last_select; /* last selected or to-be selected folder (e.g. outstanding queued select) */
- CamelIMAPPCommand *literal;/* current literal op */
- EDList active; /* active queue */
- EDList queue; /* outstanding queue */
- EDList done; /* done queue, awaiting reclamation */
-
- /* keep track of running a select */
- struct _CamelIMAPPSelectResponse *select_response;
-};
-
-struct _CamelIMAPPEngineClass {
- CamelObjectClass parent_class;
-
- unsigned char tagprefix;
-
- /* Events:
- status(struct _status_info *);
- */
-};
-
-CamelType camel_imapp_engine_get_type (void);
-
-CamelIMAPPEngine *camel_imapp_engine_new(CamelIMAPPStream *stream);
-
-void camel_imapp_engine_add_handler(CamelIMAPPEngine *imap, const char *response, CamelIMAPPEngineFunc func, void *data);
-int camel_imapp_engine_iterate(CamelIMAPPEngine *imap, CamelIMAPPCommand *wait); /* throws PARSE,IO exception */
-int camel_imapp_engine_skip(CamelIMAPPEngine *imap);
-int camel_imapp_engine_capabilities(CamelIMAPPEngine *imap);
-
-CamelIMAPPCommand *camel_imapp_engine_command_new (CamelIMAPPEngine *imap, const char *name, const char *select, const char *fmt, ...);
-void camel_imapp_engine_command_complete(CamelIMAPPEngine *imap, struct _CamelIMAPPCommand *, CamelIMAPPCommandFunc func, void *data);
-void camel_imapp_engine_command_add (CamelIMAPPEngine *imap, CamelIMAPPCommand *ic, const char *fmt, ...);
-void camel_imapp_engine_command_free (CamelIMAPPEngine *imap, CamelIMAPPCommand *ic);
-void camel_imapp_engine_command_queue(CamelIMAPPEngine *imap, CamelIMAPPCommand *ic); /* throws IO exception */
-CamelIMAPPCommand *camel_imapp_engine_command_find (CamelIMAPPEngine *imap, const char *name);
-CamelIMAPPCommand *camel_imapp_engine_command_find_tag(CamelIMAPPEngine *imap, unsigned int tag);
-
-/* util functions */
-CamelIMAPPSelectResponse *camel_imapp_engine_select(CamelIMAPPEngine *imap, const char *name);
-void camel_imapp_engine_select_free(CamelIMAPPEngine *imap, CamelIMAPPSelectResponse *select);
-
-#endif
diff --git a/camel/providers/imapp/camel-imapp-exception.h b/camel/providers/imapp/camel-imapp-exception.h
deleted file mode 100644
index 5e18b6c815..0000000000
--- a/camel/providers/imapp/camel-imapp-exception.h
+++ /dev/null
@@ -1,35 +0,0 @@
-
-/* This implements 'real' exceptions that work a bit like c++/java exceptions */
-
-/* Still experimental code */
-
-#ifndef __CAMEL_IMAPP_EXCEPTION_H
-#define __CAMEL_IMAPP_EXCEPTION_H
-
-#include <setjmp.h>
-#include "camel/camel-exception.h"
-
-struct _CamelExceptionEnv {
- struct _CamelExceptionEnv *parent;
- CamelException *ex;
- jmp_buf env;
-};
-
-#define CAMEL_TRY { struct _CamelExceptionEnv __env; camel_exception_try(&__env); if (setjmp(__env.env) == 0)
-#define CAMEL_IGNORE camel_exception_done(&__env); }
-#define CAMEL_CATCH(x) { CamelException *x; x=__env.ex; if (x != NULL)
-#define CAMEL_DONE } camel_exception_done(&__env); }
-#define CAMEL_DROP() camel_exception_drop(&__env)
-
-void camel_exception_setup(void);
-
-/* internal functions, use macro's above */
-void camel_exception_try(struct _CamelExceptionEnv *env);
-void camel_exception_done(struct _CamelExceptionEnv *env);
-void camel_exception_drop(struct _CamelExceptionEnv *env);
-
-/* user functions */
-void camel_exception_throw_ex(CamelException *ex) __attribute__ ((noreturn));
-void camel_exception_throw(int id, char *fmt, ...) __attribute__ ((noreturn));
-
-#endif
diff --git a/camel/providers/imapp/camel-imapp-fetch-stream.c b/camel/providers/imapp/camel-imapp-fetch-stream.c
deleted file mode 100644
index bf18aac57b..0000000000
--- a/camel/providers/imapp/camel-imapp-fetch-stream.c
+++ /dev/null
@@ -1,183 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; fill-column: 160 -*-
- *
- * Author:
- * Michael Zucchi <notzed@ximian.com>
- *
- * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <errno.h>
-
-#include <glib.h>
-
-#include <camel/camel-stream-mem.h>
-
-#include "camel-imapp-stream.h"
-#include "camel-imapp-exception.h"
-
-#define t(x)
-#define io(x) x
-
-static CamelObjectClass *parent_class = NULL;
-
-/* Returns the class for a CamelStream */
-#define CS_CLASS(so) CAMEL_IMAPP_FETCH_STREAM_CLASS(CAMEL_OBJECT_GET_CLASS(so))
-
-static ssize_t
-stream_read(CamelStream *stream, char *buffer, size_t n)
-{
- CamelIMAPPFetchStream *is = (CamelIMAPPFetchStream *)stream;
- ssize_t max;
-
- /* make sure we have all the data read in */
- while (camel_imapp_engine_iterate(is->engine, is->command)>0)
- ;
-
- if (is->literal == 0 || n == 0)
- return 0;
-
- max = is->end - is->ptr;
- if (max > 0) {
- max = MIN(max, is->literal);
- max = MIN(max, n);
- memcpy(buffer, is->ptr, max);
- is->ptr += max;
- } else {
- max = MIN(is->literal, n);
- max = camel_stream_read(is->source, buffer, max);
- if (max <= 0)
- return max;
- }
-
- is->literal -= max;
-
- return max;
-}
-
-static ssize_t
-stream_write(CamelStream *stream, const char *buffer, size_t n)
-{
- CamelIMAPPFetchStream *is = (CamelIMAPPFetchStream *)stream;
-
- return camel_stream_write(is->source, buffer, n);
-}
-
-static int
-stream_close(CamelStream *stream)
-{
- /* nop? */
- return 0;
-}
-
-static int
-stream_flush(CamelStream *stream)
-{
- /* nop? */
- return 0;
-}
-
-static gboolean
-stream_eos(CamelStream *stream)
-{
- CamelIMAPPFetchStream *is = (CamelIMAPPFetchStream *)stream;
-
- return is->literal == 0;
-}
-
-static int
-stream_reset(CamelStream *stream)
-{
- /* nop? reset literal mode? */
- return 0;
-}
-
-static void
-camel_imapp_fetch_stream_class_init (CamelStreamClass *camel_imapp_fetch_stream_class)
-{
- CamelStreamClass *camel_stream_class = (CamelStreamClass *)camel_imapp_fetch_stream_class;
-
- parent_class = camel_type_get_global_classfuncs( CAMEL_OBJECT_TYPE );
-
- /* virtual method definition */
- camel_stream_class->read = stream_read;
- camel_stream_class->write = stream_write;
- camel_stream_class->close = stream_close;
- camel_stream_class->flush = stream_flush;
- camel_stream_class->eos = stream_eos;
- camel_stream_class->reset = stream_reset;
-}
-
-static void
-camel_imapp_fetch_stream_init(CamelIMAPPFetchStream *is, CamelIMAPPFetchStreamClass *isclass)
-{
- ;
-}
-
-static void
-camel_imapp_fetch_stream_finalise(CamelIMAPPFetchStream *is)
-{
- if (is->engine)
- camel_object_unref(is->engine);
-}
-
-CamelType
-camel_imapp_fetch_stream_get_type (void)
-{
- static CamelType camel_imapp_fetch_stream_type = CAMEL_INVALID_TYPE;
-
- if (camel_imapp_fetch_stream_type == CAMEL_INVALID_TYPE) {
- setup_table();
- camel_imapp_fetch_stream_type = camel_type_register( camel_stream_get_type(),
- "CamelIMAPPFetchStream",
- sizeof( CamelIMAPPFetchStream ),
- sizeof( CamelIMAPPFetchStreamClass ),
- (CamelObjectClassInitFunc) camel_imapp_fetch_stream_class_init,
- NULL,
- (CamelObjectInitFunc) camel_imapp_fetch_stream_init,
- (CamelObjectFinalizeFunc) camel_imapp_fetch_stream_finalise );
- }
-
- return camel_imapp_fetch_stream_type;
-}
-
-/**
- * camel_imapp_fetch_stream_new:
- *
- * Return value: the stream
- **/
-CamelStream *
-camel_imapp_fetch_stream_new(CamelIMAPPEngine *ie, const char *uid, const char *body)
-{
- CamelIMAPPFetchStream *is;
-
- is = (CamelIMAPPFetchStream *)camel_object_new(camel_imapp_fetch_stream_get_type ());
- is->engine = ie;
- camel_object_ref(ie);
-
- is->command = camel_imapp_engine_command_new(ie, "FETCH", NULL, "FETCH %t (BODY[%t]<0.4096>", uid, body);
- camel_imapp_engine_command_queue(ie, command);
-
- return (CamelStream *)is;
-}
-
diff --git a/camel/providers/imapp/camel-imapp-fetch-stream.h b/camel/providers/imapp/camel-imapp-fetch-stream.h
deleted file mode 100644
index c9281ff64f..0000000000
--- a/camel/providers/imapp/camel-imapp-fetch-stream.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef _CAMEL_IMAPP_FETCH_STREAM_H
-#define _CAMEL_IMAPP_FETCH_STREAM_H
-
-#include <camel/camel-stream.h>
-
-#define CAMEL_IMAPP_FETCH_STREAM(obj) CAMEL_CHECK_CAST (obj, camel_imapp_fetch_stream_get_type (), CamelIMAPPFetchStream)
-#define CAMEL_IMAPP_FETCH_STREAM_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_imapp_fetch_stream_get_type (), CamelIMAPPFetchStreamClass)
-#define CAMEL_IS_IMAP_FETCH_STREAM(obj) CAMEL_CHECK_TYPE (obj, camel_imapp_fetch_stream_get_type ())
-
-typedef struct _CamelIMAPPFetchStreamClass CamelIMAPPFetchStreamClass;
-typedef struct _CamelIMAPPFetchStream CamelIMAPPFetchStream;
-
-struct _CamelIMAPPFetchStream {
- CamelStream parent;
-
- struct _CamelIMAPPEngine *engine;
-};
-
-struct _CamelIMAPPFetchStreamClass {
- CamelStreamClass parent_class;
-};
-
-CamelType camel_imapp_fetch_stream_get_type (void);
-
-CamelStream *camel_imapp_fetch_stream_new (struct _CamelIMAPPEngine *src, const char *uid, const char *spec);
-
-#endif /* ! _CAMEL_IMAPP_FETCH_STREAM_H */
diff --git a/camel/providers/imapp/camel-imapp-folder.c b/camel/providers/imapp/camel-imapp-folder.c
deleted file mode 100644
index 967ab541f6..0000000000
--- a/camel/providers/imapp/camel-imapp-folder.c
+++ /dev/null
@@ -1,269 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-imap-folder.c : class for a imap folder */
-
-/*
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * Copyright (C) 2002 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <errno.h>
-
-#include "camel/camel-exception.h"
-#include "camel/camel-stream-mem.h"
-#include "camel/camel-stream-filter.h"
-#include "camel/camel-mime-message.h"
-#include "camel/camel-operation.h"
-#include "camel/camel-data-cache.h"
-#include "camel/camel-session.h"
-#include "camel/camel-file-utils.h"
-
-#include "camel-imapp-store.h"
-#include "camel-imapp-folder.h"
-#include "camel-imapp-summary.h"
-#include "camel-imapp-exception.h"
-
-#include <e-util/md5-utils.h>
-
-#include <stdlib.h>
-#include <string.h>
-
-#define d(x)
-
-#define CF_CLASS(o) (CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(o)))
-static CamelFolderClass *parent_class;
-
-static void imap_finalize (CamelObject *object);
-static void imap_refresh_info (CamelFolder *folder, CamelException *ex);
-static void imap_sync (CamelFolder *folder, gboolean expunge, CamelException *ex);
-static CamelMimeMessage *imap_get_message (CamelFolder *folder, const char *uid, CamelException *ex);
-
-static void
-imap_folder_class_init (CamelIMAPPFolderClass *camel_imapp_folder_class)
-{
- CamelFolderClass *camel_folder_class = CAMEL_FOLDER_CLASS(camel_imapp_folder_class);
-
- parent_class = CAMEL_FOLDER_CLASS(camel_folder_get_type());
-
- /* virtual method overload */
- camel_folder_class->refresh_info = imap_refresh_info;
- camel_folder_class->sync = imap_sync;
-
- camel_folder_class->get_message = imap_get_message;
- /*camel_folder_class->set_message_flags = imap_set_message_flags;*/
-}
-
-static void
-imap_folder_init(CamelObject *o, CamelObjectClass *klass)
-{
- CamelFolder *folder = (CamelFolder *)o;
- CamelIMAPPFolder *ifolder = (CamelIMAPPFolder *)o;
-
- folder->folder_flags |= (CAMEL_FOLDER_HAS_SUMMARY_CAPABILITY |
- CAMEL_FOLDER_HAS_SEARCH_CAPABILITY);
-
- folder->permanent_flags = CAMEL_MESSAGE_ANSWERED |
- CAMEL_MESSAGE_DELETED | CAMEL_MESSAGE_DRAFT |
- CAMEL_MESSAGE_FLAGGED | CAMEL_MESSAGE_SEEN | CAMEL_MESSAGE_USER;
-
- /* FIXME: this is just a skeleton */
-
- ifolder->changes = camel_folder_change_info_new();
-}
-
-CamelType
-camel_imapp_folder_get_type (void)
-{
- static CamelType camel_imapp_folder_type = CAMEL_INVALID_TYPE;
-
- if (!camel_imapp_folder_type) {
- camel_imapp_folder_type = camel_type_register (CAMEL_FOLDER_TYPE, "CamelIMAPPFolder",
- sizeof (CamelIMAPPFolder),
- sizeof (CamelIMAPPFolderClass),
- (CamelObjectClassInitFunc) imap_folder_class_init,
- NULL,
- imap_folder_init,
- (CamelObjectFinalizeFunc) imap_finalize);
- }
-
- return camel_imapp_folder_type;
-}
-
-void
-imap_finalize (CamelObject *object)
-{
- CamelIMAPPFolder *folder = (CamelIMAPPFolder *)object;
-
- camel_folder_change_info_free(folder->changes);
-}
-
-CamelFolder *
-camel_imapp_folder_new(CamelStore *store, const char *path)
-{
- CamelFolder *folder;
- char *root;
-
- d(printf("opening imap folder '%s'\n", path));
-
- folder = CAMEL_FOLDER (camel_object_new (CAMEL_IMAPP_FOLDER_TYPE));
- camel_folder_construct(folder, store, path, path);
-
- ((CamelIMAPPFolder *)folder)->raw_name = g_strdup(path);
-
- folder->summary = camel_imapp_summary_new();
-
- root = camel_session_get_storage_path(((CamelService *)store)->session, (CamelService *)store, NULL);
- if (root) {
- char *base = g_build_filename(root, path, NULL);
- char *file = g_build_filename(base, ".ev-summary", NULL);
-
- camel_mkdir(base, 0777);
- g_free(base);
-
- camel_folder_summary_set_filename(folder->summary, file);
- printf("loading summary from '%s' (root=%s)\n", file, root);
- g_free(file);
- camel_folder_summary_load(folder->summary);
- g_free(root);
- }
-
- return folder;
-}
-
-void
-camel_imapp_folder_open(CamelIMAPPFolder *folder, CamelException *ex)
-{
- /* */
-}
-
-void
-camel_imapp_folder_delete(CamelIMAPPFolder *folder, CamelException *ex)
-{
-}
-
-void
-camel_imapp_folder_rename(CamelIMAPPFolder *folder, const char *new, CamelException *ex)
-{
-}
-
-void
-camel_imapp_folder_close(CamelIMAPPFolder *folder, CamelException *ex)
-{
-}
-
-static void
-imap_refresh_info (CamelFolder *folder, CamelException *ex)
-{
- printf("imapp refresh info?\n");
-}
-
-static void
-imap_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
-{
- camel_imapp_driver_sync(((CamelIMAPPStore *)(folder->parent_store))->driver, expunge, (CamelIMAPPFolder *) folder);
-}
-
-static CamelMimeMessage *
-imap_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
-{
- CamelMimeMessage * volatile msg = NULL;
- CamelStream * volatile stream = NULL;
-
- printf("get message '%s'\n", uid);
-
- CAMEL_TRY {
- /* simple implementation, just get whole message in 1 go */
- stream = camel_imapp_driver_fetch(((CamelIMAPPStore *)(folder->parent_store))->driver, (CamelIMAPPFolder *)folder, uid, "");
- camel_stream_reset(stream);
- msg = camel_mime_message_new();
- if (camel_data_wrapper_construct_from_stream((CamelDataWrapper *)msg, stream) != -1) {
- /* do we care? */
- }
- } CAMEL_CATCH(e) {
- if (msg)
- camel_object_unref(msg);
- msg = NULL;
- camel_exception_xfer(ex, e);
- } CAMEL_DONE;
-
- if (stream)
- camel_object_unref(stream);
-
- return msg;
-}
-
-
-/* Algorithm for selecting a folder:
-
- - If uidvalidity == old uidvalidity
- and exsists == old exists
- and recent == old recent
- and unseen == old unseen
- Assume our summary is correct
- for each summary item
- mark the summary item as 'old/not updated'
- rof
- fetch flags from 1:*
- for each fetch response
- info = summary[index]
- if info.uid != uid
- info = summary_by_uid[uid]
- fi
- if info == NULL
- create new info @ index
- fi
- if got.flags
- update flags
- fi
- if got.header
- update based on header
- mark as retrieved
- else if got.body
- update based on imap body
- mark as retrieved
- fi
-
- Async fetch response:
- info = summary[index]
- if info == null
- if uid == null
- force resync/select?
- info = empty @ index
- else if uid && info.uid != uid
- force a resync?
- return
- fi
-
- if got.flags {
- info.flags = flags
- }
- if got.header {
- info.init(header)
- info.empty = false
- }
-
-info.state - 2 bit field in flags
- 0 = empty, nothing set
- 1 = uid & flags set
- 2 = update required
- 3 = up to date
-*/
-
diff --git a/camel/providers/imapp/camel-imapp-folder.h b/camel/providers/imapp/camel-imapp-folder.h
deleted file mode 100644
index 329c66b7fc..0000000000
--- a/camel/providers/imapp/camel-imapp-folder.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-imap-folder.h : Class for a IMAP folder */
-
-/*
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * Copyright (C) 2002 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifndef CAMEL_IMAPP_FOLDER_H
-#define CAMEL_IMAPP_FOLDER_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include <camel/camel-folder.h>
-
-#define CAMEL_IMAPP_FOLDER_TYPE (camel_imapp_folder_get_type ())
-#define CAMEL_IMAPP_FOLDER(obj) (CAMEL_CHECK_CAST((obj), CAMEL_IMAPP_FOLDER_TYPE, CamelIMAPPFolder))
-#define CAMEL_IMAPP_FOLDER_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_IMAPP_FOLDER_TYPE, CamelIMAPPFolderClass))
-#define CAMEL_IS_IMAP_FOLDER(o) (CAMEL_CHECK_TYPE((o), CAMEL_IMAPP_FOLDER_TYPE))
-
-typedef struct _CamelIMAPPFolder {
- CamelFolder parent_object;
-
- char *raw_name;
- CamelFolderChangeInfo *changes;
-
- guint32 exists;
- guint32 recent;
- guint32 uidvalidity;
- guint32 unseen;
- guint32 permanentflags;
-} CamelIMAPPFolder;
-
-typedef struct _CamelIMAPPFolderClass {
- CamelFolderClass parent_class;
-} CamelIMAPPFolderClass;
-
-/* Standard Camel function */
-CamelType camel_imapp_folder_get_type (void);
-
-/* public methods */
-CamelFolder *camel_imapp_folder_new(CamelStore *parent, const char *path);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_IMAPP_FOLDER_H */
diff --git a/camel/providers/imapp/camel-imapp-provider.c b/camel/providers/imapp/camel-imapp-provider.c
deleted file mode 100644
index 6b0cdd2d43..0000000000
--- a/camel/providers/imapp/camel-imapp-provider.c
+++ /dev/null
@@ -1,97 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-pop3-provider.c: pop3 provider registration code */
-
-/*
- * Authors :
- * Dan Winship <danw@ximian.com>
- * Michael Zucchi <notzed@ximian.com>
- *
- * Copyright (C) 2002 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "camel/camel-provider.h"
-#include "camel/camel-session.h"
-#include "camel/camel-url.h"
-#include "camel/camel-sasl.h"
-
-#include "camel-imapp-store.h"
-
-CamelProviderConfEntry imapp_conf_entries[] = {
- { CAMEL_PROVIDER_CONF_SECTION_START, NULL, NULL,
- N_("Message storage") },
- { CAMEL_PROVIDER_CONF_SECTION_END },
- { CAMEL_PROVIDER_CONF_END }
-};
-
-static CamelProvider imapp_provider = {
- "imapp",
-
- N_("IMAP+"),
-
- N_("Experimental IMAP 4(.1) client\n"
- "This is untested and unsupported code, you want to use plain imap instead.\n\n"
- " !!! DO NOT USE THIS FOR PRODUCTION EMAIL !!!\n"),
- "mail",
-
- CAMEL_PROVIDER_IS_REMOTE | CAMEL_PROVIDER_IS_SOURCE |
- CAMEL_PROVIDER_IS_STORAGE | CAMEL_PROVIDER_SUPPORTS_SSL,
-
- CAMEL_URL_NEED_USER | CAMEL_URL_NEED_HOST | CAMEL_URL_ALLOW_AUTH,
-
- imapp_conf_entries,
-
- /* ... */
-};
-
-CamelServiceAuthType camel_imapp_password_authtype = {
- N_("Password"),
-
- N_("This option will connect to the IMAP server using a "
- "plaintext password."),
-
- "",
- TRUE
-};
-
-void
-camel_imapp_module_init(CamelSession *session)
-{
- extern void camel_exception_setup(void);
-
- imapp_provider.object_types[CAMEL_PROVIDER_STORE] = camel_imapp_store_get_type();
- imapp_provider.url_hash = camel_url_hash;
- imapp_provider.url_equal = camel_url_equal;
-
- imapp_provider.authtypes = g_list_prepend(imapp_provider.authtypes, camel_sasl_authtype_list(FALSE));
- imapp_provider.authtypes = g_list_prepend(imapp_provider.authtypes, &camel_imapp_password_authtype);
-
- /* blah ... could just use it in object setup? */
- /* TEMPORARY */
- camel_exception_setup();
-
- camel_session_register_provider(session, &imapp_provider);
-}
-
-void
-camel_provider_module_init(CamelSession *session)
-{
- camel_imapp_module_init(session);
-}
diff --git a/camel/providers/imapp/camel-imapp-store-summary.c b/camel/providers/imapp/camel-imapp-store-summary.c
deleted file mode 100644
index a3ad57fb11..0000000000
--- a/camel/providers/imapp/camel-imapp-store-summary.c
+++ /dev/null
@@ -1,616 +0,0 @@
-/*
- * Copyright (C) 2002 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <unistd.h>
-#include <ctype.h>
-#include <string.h>
-#include <errno.h>
-#include <stdlib.h>
-
-#include "camel-imapp-store-summary.h"
-
-#include "camel/camel-file-utils.h"
-
-#include "camel-string-utils.h"
-#include "e-util/md5-utils.h"
-#include "e-util/e-memory.h"
-
-#include "camel-private.h"
-#include "camel-utf8.h"
-
-#define d(x)
-#define io(x) /* io debug */
-
-#define CAMEL_IMAPP_STORE_SUMMARY_VERSION_0 (0)
-
-#define CAMEL_IMAPP_STORE_SUMMARY_VERSION (0)
-
-#define _PRIVATE(o) (((CamelIMAPPStoreSummary *)(o))->priv)
-
-static int summary_header_load(CamelStoreSummary *, FILE *);
-static int summary_header_save(CamelStoreSummary *, FILE *);
-
-/*static CamelStoreInfo * store_info_new(CamelStoreSummary *, const char *);*/
-static CamelStoreInfo * store_info_load(CamelStoreSummary *, FILE *);
-static int store_info_save(CamelStoreSummary *, FILE *, CamelStoreInfo *);
-static void store_info_free(CamelStoreSummary *, CamelStoreInfo *);
-
-static const char *store_info_string(CamelStoreSummary *, const CamelStoreInfo *, int);
-static void store_info_set_string(CamelStoreSummary *, CamelStoreInfo *, int, const char *);
-
-static void camel_imapp_store_summary_class_init (CamelIMAPPStoreSummaryClass *klass);
-static void camel_imapp_store_summary_init (CamelIMAPPStoreSummary *obj);
-static void camel_imapp_store_summary_finalise (CamelObject *obj);
-
-static CamelStoreSummaryClass *camel_imapp_store_summary_parent;
-
-static void
-camel_imapp_store_summary_class_init (CamelIMAPPStoreSummaryClass *klass)
-{
- CamelStoreSummaryClass *ssklass = (CamelStoreSummaryClass *)klass;
-
- ssklass->summary_header_load = summary_header_load;
- ssklass->summary_header_save = summary_header_save;
-
- /*ssklass->store_info_new = store_info_new;*/
- ssklass->store_info_load = store_info_load;
- ssklass->store_info_save = store_info_save;
- ssklass->store_info_free = store_info_free;
-
- ssklass->store_info_string = store_info_string;
- ssklass->store_info_set_string = store_info_set_string;
-}
-
-static void
-camel_imapp_store_summary_init (CamelIMAPPStoreSummary *s)
-{
- /*struct _CamelIMAPPStoreSummaryPrivate *p;
-
- p = _PRIVATE(s) = g_malloc0(sizeof(*p));*/
-
- ((CamelStoreSummary *)s)->store_info_size = sizeof(CamelIMAPPStoreInfo);
- s->version = CAMEL_IMAPP_STORE_SUMMARY_VERSION;
-}
-
-static void
-camel_imapp_store_summary_finalise (CamelObject *obj)
-{
- /*struct _CamelIMAPPStoreSummaryPrivate *p;*/
- /*CamelIMAPPStoreSummary *s = (CamelIMAPPStoreSummary *)obj;*/
-
- /*p = _PRIVATE(obj);
- g_free(p);*/
-}
-
-CamelType
-camel_imapp_store_summary_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- camel_imapp_store_summary_parent = (CamelStoreSummaryClass *)camel_store_summary_get_type();
- type = camel_type_register((CamelType)camel_imapp_store_summary_parent, "CamelIMAPPStoreSummary",
- sizeof (CamelIMAPPStoreSummary),
- sizeof (CamelIMAPPStoreSummaryClass),
- (CamelObjectClassInitFunc) camel_imapp_store_summary_class_init,
- NULL,
- (CamelObjectInitFunc) camel_imapp_store_summary_init,
- (CamelObjectFinalizeFunc) camel_imapp_store_summary_finalise);
- }
-
- return type;
-}
-
-/**
- * camel_imapp_store_summary_new:
- *
- * Create a new CamelIMAPPStoreSummary object.
- *
- * Return value: A new CamelIMAPPStoreSummary widget.
- **/
-CamelIMAPPStoreSummary *
-camel_imapp_store_summary_new (void)
-{
- CamelIMAPPStoreSummary *new = CAMEL_IMAPP_STORE_SUMMARY ( camel_object_new (camel_imapp_store_summary_get_type ()));
-
- return new;
-}
-
-/**
- * camel_imapp_store_summary_full_name:
- * @s:
- * @path:
- *
- * Retrieve a summary item by full name.
- *
- * A referenced to the summary item is returned, which may be
- * ref'd or free'd as appropriate.
- *
- * Return value: The summary item, or NULL if the @full_name name
- * is not available.
- * It must be freed using camel_store_summary_info_free().
- **/
-CamelIMAPPStoreInfo *
-camel_imapp_store_summary_full_name(CamelIMAPPStoreSummary *s, const char *full_name)
-{
- int count, i;
- CamelIMAPPStoreInfo *info;
-
- count = camel_store_summary_count((CamelStoreSummary *)s);
- for (i=0;i<count;i++) {
- info = (CamelIMAPPStoreInfo *)camel_store_summary_index((CamelStoreSummary *)s, i);
- if (info) {
- if (strcmp(info->full_name, full_name) == 0)
- return info;
- camel_store_summary_info_free((CamelStoreSummary *)s, (CamelStoreInfo *)info);
- }
- }
-
- return NULL;
-}
-
-char *
-camel_imapp_store_summary_full_to_path(CamelIMAPPStoreSummary *s, const char *full_name, char dir_sep)
-{
- char *path, *p;
- int c;
- const char *f;
-
- if (dir_sep != '/') {
- p = path = alloca(strlen(full_name)*3+1);
- f = full_name;
- while ( (c = *f++ & 0xff) ) {
- if (c == dir_sep)
- *p++ = '/';
- else if (c == '/' || c == '%')
- p += sprintf(p, "%%%02X", c);
- else
- *p++ = c;
- }
- *p = 0;
- } else
- path = (char *)full_name;
-
- return camel_utf7_utf8(path);
-}
-
-static guint32 hexnib(guint32 c)
-{
- if (c >= '0' && c <= '9')
- return c-'0';
- else if (c>='A' && c <= 'Z')
- return c-'A'+10;
- else
- return 0;
-}
-
-char *
-camel_imapp_store_summary_path_to_full(CamelIMAPPStoreSummary *s, const char *path, char dir_sep)
-{
- unsigned char *full, *f;
- guint32 c, v = 0;
- const char *p;
- int state=0;
- char *subpath, *last = NULL;
- CamelStoreInfo *si;
- CamelIMAPPStoreNamespace *ns;
-
- /* check to see if we have a subpath of path already defined */
- subpath = alloca(strlen(path)+1);
- strcpy(subpath, path);
- do {
- si = camel_store_summary_path((CamelStoreSummary *)s, subpath);
- if (si == NULL) {
- last = strrchr(subpath, '/');
- if (last)
- *last = 0;
- }
- } while (si == NULL && last);
-
- /* path is already present, use the raw version we have */
- if (si && strlen(subpath) == strlen(path)) {
- f = g_strdup(camel_imapp_store_info_full_name(s, si));
- camel_store_summary_info_free((CamelStoreSummary *)s, si);
- return f;
- }
-
- ns = camel_imapp_store_summary_namespace_find_path(s, path);
-
- f = full = alloca(strlen(path)*2+1);
- if (si)
- p = path + strlen(subpath);
- else if (ns)
- p = path + strlen(ns->path);
- else
- p = path;
-
- while ( (c = camel_utf8_getc((const unsigned char **)&p)) ) {
- switch(state) {
- case 0:
- if (c == '%')
- state = 1;
- else {
- if (c == '/')
- c = dir_sep;
- camel_utf8_putc(&f, c);
- }
- break;
- case 1:
- state = 2;
- v = hexnib(c)<<4;
- break;
- case 2:
- state = 0;
- v |= hexnib(c);
- camel_utf8_putc(&f, v);
- break;
- }
- }
- camel_utf8_putc(&f, c);
-
- /* merge old path part if required */
- f = camel_utf8_utf7(full);
- if (si) {
- full = g_strdup_printf("%s%s", camel_imapp_store_info_full_name(s, si), f);
- g_free(f);
- camel_store_summary_info_free((CamelStoreSummary *)s, si);
- f = full;
- } else if (ns) {
- full = g_strdup_printf("%s%s", ns->full_name, f);
- g_free(f);
- f = full;
- }
-
- return f;
-}
-
-CamelIMAPPStoreInfo *
-camel_imapp_store_summary_add_from_full(CamelIMAPPStoreSummary *s, const char *full, char dir_sep)
-{
- CamelIMAPPStoreInfo *info;
- char *pathu8, *prefix;
- int len;
- char *full_name;
- CamelIMAPPStoreNamespace *ns;
-
- d(printf("adding full name '%s' '%c'\n", full, dir_sep));
-
- len = strlen(full);
- full_name = alloca(len+1);
- strcpy(full_name, full);
- if (full_name[len-1] == dir_sep)
- full_name[len-1] = 0;
-
- info = camel_imapp_store_summary_full_name(s, full_name);
- if (info) {
- camel_store_summary_info_free((CamelStoreSummary *)s, (CamelStoreInfo *)info);
- d(printf(" already there\n"));
- return info;
- }
-
- ns = camel_imapp_store_summary_namespace_find_full(s, full_name);
- if (ns) {
- d(printf("(found namespace for '%s' ns '%s') ", full_name, ns->path));
- len = strlen(ns->full_name);
- if (len >= strlen(full_name)) {
- pathu8 = g_strdup(ns->path);
- } else {
- if (full_name[len] == ns->sep)
- len++;
-
- prefix = camel_imapp_store_summary_full_to_path(s, full_name+len, ns->sep);
- if (*ns->path) {
- pathu8 = g_strdup_printf ("%s/%s", ns->path, prefix);
- g_free (prefix);
- } else {
- pathu8 = prefix;
- }
- }
- d(printf(" (pathu8 = '%s')", pathu8));
- } else {
- d(printf("(Cannot find namespace for '%s')\n", full_name));
- pathu8 = camel_imapp_store_summary_full_to_path(s, full_name, dir_sep);
- }
-
- info = (CamelIMAPPStoreInfo *)camel_store_summary_add_from_path((CamelStoreSummary *)s, pathu8);
- if (info) {
- d(printf(" '%s' -> '%s'\n", pathu8, full_name));
- camel_store_info_set_string((CamelStoreSummary *)s, (CamelStoreInfo *)info, CAMEL_IMAPP_STORE_INFO_FULL_NAME, full_name);
- } else
- d(printf(" failed\n"));
-
- return info;
-}
-
-/* should this be const? */
-/* TODO: deprecate/merge this function with path_to_full */
-char *
-camel_imapp_store_summary_full_from_path(CamelIMAPPStoreSummary *s, const char *path)
-{
- CamelIMAPPStoreNamespace *ns;
- char *name = NULL;
-
- ns = camel_imapp_store_summary_namespace_find_path(s, path);
- if (ns)
- name = camel_imapp_store_summary_path_to_full(s, path, ns->sep);
-
- d(printf("looking up path %s -> %s\n", path, name?name:"not found"));
-
- return name;
-}
-
-/* TODO: this api needs some more work */
-CamelIMAPPStoreNamespace *camel_imapp_store_summary_namespace_new(CamelIMAPPStoreSummary *s, const char *full_name, char dir_sep)
-{
- CamelIMAPPStoreNamespace *ns;
- char *p;
- int len;
-
- ns = g_malloc0(sizeof(*ns));
- ns->full_name = g_strdup(full_name);
- len = strlen(ns->full_name)-1;
- if (len >= 0 && ns->full_name[len] == dir_sep)
- ns->full_name[len] = 0;
- ns->sep = dir_sep;
-
- p = ns->path = camel_imapp_store_summary_full_to_path(s, ns->full_name, dir_sep);
- while (*p) {
- if (*p == '/')
- *p = '.';
- p++;
- }
-
- return ns;
-}
-
-void camel_imapp_store_summary_namespace_set(CamelIMAPPStoreSummary *s, CamelIMAPPStoreNamespace *ns)
-{
- static void namespace_clear(CamelStoreSummary *s);
-
- d(printf("Setting namesapce to '%s' '%c' -> '%s'\n", ns->full_name, ns->sep, ns->path));
- namespace_clear((CamelStoreSummary *)s);
- s->namespace = ns;
- camel_store_summary_touch((CamelStoreSummary *)s);
-}
-
-CamelIMAPPStoreNamespace *
-camel_imapp_store_summary_namespace_find_path(CamelIMAPPStoreSummary *s, const char *path)
-{
- int len;
- CamelIMAPPStoreNamespace *ns;
-
- /* NB: this currently only compares against 1 namespace, in future compare against others */
- ns = s->namespace;
- while (ns) {
- len = strlen(ns->path);
- if (len == 0
- || (strncmp(ns->path, path, len) == 0
- && (path[len] == '/' || path[len] == 0)))
- break;
- ns = NULL;
- }
-
- /* have a default? */
- return ns;
-}
-
-CamelIMAPPStoreNamespace *
-camel_imapp_store_summary_namespace_find_full(CamelIMAPPStoreSummary *s, const char *full)
-{
- int len;
- CamelIMAPPStoreNamespace *ns;
-
- /* NB: this currently only compares against 1 namespace, in future compare against others */
- ns = s->namespace;
- while (ns) {
- len = strlen(ns->full_name);
- d(printf("find_full: comparing namespace '%s' to name '%s'\n", ns->full_name, full));
- if (len == 0
- || (strncmp(ns->full_name, full, len) == 0
- && (full[len] == ns->sep || full[len] == 0)))
- break;
- ns = NULL;
- }
-
- /* have a default? */
- return ns;
-}
-
-static void
-namespace_free(CamelStoreSummary *s, CamelIMAPPStoreNamespace *ns)
-{
- g_free(ns->path);
- g_free(ns->full_name);
- g_free(ns);
-}
-
-static void
-namespace_clear(CamelStoreSummary *s)
-{
- CamelIMAPPStoreSummary *is = (CamelIMAPPStoreSummary *)s;
-
- if (is->namespace)
- namespace_free(s, is->namespace);
- is->namespace = NULL;
-}
-
-static CamelIMAPPStoreNamespace *
-namespace_load(CamelStoreSummary *s, FILE *in)
-{
- CamelIMAPPStoreNamespace *ns;
- guint32 sep = '/';
-
- ns = g_malloc0(sizeof(*ns));
- if (camel_file_util_decode_string(in, &ns->path) == -1
- || camel_file_util_decode_string(in, &ns->full_name) == -1
- || camel_file_util_decode_uint32(in, &sep) == -1) {
- namespace_free(s, ns);
- ns = NULL;
- } else {
- ns->sep = sep;
- }
-
- return ns;
-}
-
-static int
-namespace_save(CamelStoreSummary *s, FILE *in, CamelIMAPPStoreNamespace *ns)
-{
- if (camel_file_util_encode_string(in, ns->path) == -1
- || camel_file_util_encode_string(in, ns->full_name) == -1
- || camel_file_util_encode_uint32(in, (guint32)ns->sep) == -1)
- return -1;
-
- return 0;
-}
-
-static int
-summary_header_load(CamelStoreSummary *s, FILE *in)
-{
- CamelIMAPPStoreSummary *is = (CamelIMAPPStoreSummary *)s;
- gint32 version, capabilities, count;
-
- namespace_clear(s);
-
- if (camel_imapp_store_summary_parent->summary_header_load((CamelStoreSummary *)s, in) == -1
- || camel_file_util_decode_fixed_int32(in, &version) == -1)
- return -1;
-
- is->version = version;
-
- if (version < CAMEL_IMAPP_STORE_SUMMARY_VERSION_0) {
- g_warning("Store summary header version too low");
- return -1;
- }
-
- /* note file format can be expanded to contain more namespaces, but only 1 at the moment */
- if (camel_file_util_decode_fixed_int32(in, &capabilities) == -1
- || camel_file_util_decode_fixed_int32(in, &count) == -1
- || count > 1)
- return -1;
-
- is->capabilities = capabilities;
- if (count == 1) {
- if ((is->namespace = namespace_load(s, in)) == NULL)
- return -1;
- }
-
- return 0;
-}
-
-static int
-summary_header_save(CamelStoreSummary *s, FILE *out)
-{
- CamelIMAPPStoreSummary *is = (CamelIMAPPStoreSummary *)s;
- guint32 count;
-
- count = is->namespace?1:0;
-
- /* always write as latest version */
- if (camel_imapp_store_summary_parent->summary_header_save((CamelStoreSummary *)s, out) == -1
- || camel_file_util_encode_fixed_int32(out, CAMEL_IMAPP_STORE_SUMMARY_VERSION) == -1
- || camel_file_util_encode_fixed_int32(out, is->capabilities) == -1
- || camel_file_util_encode_fixed_int32(out, count) == -1)
- return -1;
-
- if (is->namespace && namespace_save(s, out, is->namespace) == -1)
- return -1;
-
- return 0;
-}
-
-static CamelStoreInfo *
-store_info_load(CamelStoreSummary *s, FILE *in)
-{
- CamelIMAPPStoreInfo *mi;
-
- mi = (CamelIMAPPStoreInfo *)camel_imapp_store_summary_parent->store_info_load(s, in);
- if (mi) {
- if (camel_file_util_decode_string(in, &mi->full_name) == -1) {
- camel_store_summary_info_free(s, (CamelStoreInfo *)mi);
- mi = NULL;
- }
- }
-
- return (CamelStoreInfo *)mi;
-}
-
-static int
-store_info_save(CamelStoreSummary *s, FILE *out, CamelStoreInfo *mi)
-{
- CamelIMAPPStoreInfo *isi = (CamelIMAPPStoreInfo *)mi;
-
- if (camel_imapp_store_summary_parent->store_info_save(s, out, mi) == -1
- || camel_file_util_encode_string(out, isi->full_name) == -1)
- return -1;
-
- return 0;
-}
-
-static void
-store_info_free(CamelStoreSummary *s, CamelStoreInfo *mi)
-{
- CamelIMAPPStoreInfo *isi = (CamelIMAPPStoreInfo *)mi;
-
- g_free(isi->full_name);
- camel_imapp_store_summary_parent->store_info_free(s, mi);
-}
-
-static const char *
-store_info_string(CamelStoreSummary *s, const CamelStoreInfo *mi, int type)
-{
- CamelIMAPPStoreInfo *isi = (CamelIMAPPStoreInfo *)mi;
-
- /* FIXME: Locks? */
-
- g_assert (mi != NULL);
-
- switch (type) {
- case CAMEL_IMAPP_STORE_INFO_FULL_NAME:
- return isi->full_name;
- default:
- return camel_imapp_store_summary_parent->store_info_string(s, mi, type);
- }
-}
-
-static void
-store_info_set_string(CamelStoreSummary *s, CamelStoreInfo *mi, int type, const char *str)
-{
- CamelIMAPPStoreInfo *isi = (CamelIMAPPStoreInfo *)mi;
-
- g_assert(mi != NULL);
-
- switch(type) {
- case CAMEL_IMAPP_STORE_INFO_FULL_NAME:
- d(printf("Set full name %s -> %s\n", isi->full_name, str));
- CAMEL_STORE_SUMMARY_LOCK(s, summary_lock);
- g_free(isi->full_name);
- isi->full_name = g_strdup(str);
- CAMEL_STORE_SUMMARY_UNLOCK(s, summary_lock);
- break;
- default:
- camel_imapp_store_summary_parent->store_info_set_string(s, mi, type, str);
- break;
- }
-}
diff --git a/camel/providers/imapp/camel-imapp-store-summary.h b/camel/providers/imapp/camel-imapp-store-summary.h
deleted file mode 100644
index 154fe8798e..0000000000
--- a/camel/providers/imapp/camel-imapp-store-summary.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2002 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-
-#ifndef _CAMEL_IMAPP_STORE_SUMMARY_H
-#define _CAMEL_IMAPP_STORE_SUMMARY_H
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <camel/camel-object.h>
-#include <camel/camel-store-summary.h>
-
-#define CAMEL_IMAPP_STORE_SUMMARY(obj) CAMEL_CHECK_CAST (obj, camel_imapp_store_summary_get_type (), CamelIMAPPStoreSummary)
-#define CAMEL_IMAPP_STORE_SUMMARY_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_imapp_store_summary_get_type (), CamelIMAPPStoreSummaryClass)
-#define CAMEL_IS_IMAP_STORE_SUMMARY(obj) CAMEL_CHECK_TYPE (obj, camel_imapp_store_summary_get_type ())
-
-typedef struct _CamelIMAPPStoreSummary CamelIMAPPStoreSummary;
-typedef struct _CamelIMAPPStoreSummaryClass CamelIMAPPStoreSummaryClass;
-
-typedef struct _CamelIMAPPStoreInfo CamelIMAPPStoreInfo;
-
-enum {
- CAMEL_IMAPP_STORE_INFO_FULL_NAME = CAMEL_STORE_INFO_LAST,
- CAMEL_IMAPP_STORE_INFO_LAST,
-};
-
-struct _CamelIMAPPStoreInfo {
- CamelStoreInfo info;
- char *full_name;
-};
-
-typedef struct _CamelIMAPPStoreNamespace CamelIMAPPStoreNamespace;
-
-struct _CamelIMAPPStoreNamespace {
- char *path; /* display path */
- char *full_name; /* real name */
- char sep; /* directory separator */
-};
-
-struct _CamelIMAPPStoreSummary {
- CamelStoreSummary summary;
-
- struct _CamelIMAPPStoreSummaryPrivate *priv;
-
- /* header info */
- guint32 version; /* version of base part of file */
- guint32 capabilities;
- CamelIMAPPStoreNamespace *namespace; /* eventually to be a list */
-};
-
-struct _CamelIMAPPStoreSummaryClass {
- CamelStoreSummaryClass summary_class;
-};
-
-CamelType camel_imapp_store_summary_get_type (void);
-CamelIMAPPStoreSummary *camel_imapp_store_summary_new (void);
-
-/* TODO: this api needs some more work, needs to support lists */
-CamelIMAPPStoreNamespace *camel_imapp_store_summary_namespace_new(CamelIMAPPStoreSummary *s, const char *full_name, char dir_sep);
-void camel_imapp_store_summary_namespace_set(CamelIMAPPStoreSummary *s, CamelIMAPPStoreNamespace *ns);
-CamelIMAPPStoreNamespace *camel_imapp_store_summary_namespace_find_path(CamelIMAPPStoreSummary *s, const char *path);
-CamelIMAPPStoreNamespace *camel_imapp_store_summary_namespace_find_full(CamelIMAPPStoreSummary *s, const char *full_name);
-
-/* converts to/from utf8 canonical nasmes */
-char *camel_imapp_store_summary_full_to_path(CamelIMAPPStoreSummary *s, const char *full_name, char dir_sep);
-char *camel_imapp_store_summary_path_to_full(CamelIMAPPStoreSummary *s, const char *path, char dir_sep);
-
-CamelIMAPPStoreInfo *camel_imapp_store_summary_full_name(CamelIMAPPStoreSummary *s, const char *full_name);
-CamelIMAPPStoreInfo *camel_imapp_store_summary_add_from_full(CamelIMAPPStoreSummary *s, const char *full_name, char dir_sep);
-
-/* a convenience lookup function. always use this if path known */
-char *camel_imapp_store_summary_full_from_path(CamelIMAPPStoreSummary *s, const char *path);
-
-/* helper macro's */
-#define camel_imapp_store_info_full_name(s, i) (camel_store_info_string((CamelStoreSummary *)s, (const CamelStoreInfo *)i, CAMEL_IMAPP_STORE_INFO_FULL_NAME))
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* ! _CAMEL_IMAPP_STORE_SUMMARY_H */
diff --git a/camel/providers/imapp/camel-imapp-store.c b/camel/providers/imapp/camel-imapp-store.c
deleted file mode 100644
index 9123102a03..0000000000
--- a/camel/providers/imapp/camel-imapp-store.c
+++ /dev/null
@@ -1,1006 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-imap-store.c : class for a imap store */
-
-/*
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * Copyright (C) 2000-2002 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <errno.h>
-
-#include "camel/camel-operation.h"
-
-#include "camel/camel-stream-buffer.h"
-#include "camel/camel-session.h"
-#include "camel/camel-exception.h"
-#include "camel/camel-url.h"
-#include "camel/camel-sasl.h"
-#include "camel/camel-data-cache.h"
-#include "camel/camel-tcp-stream.h"
-#include "camel/camel-tcp-stream-raw.h"
-#ifdef HAVE_SSL
-#include "camel/camel-tcp-stream-ssl.h"
-#endif
-
-#include "camel-imapp-store-summary.h"
-#include "camel-imapp-store.h"
-#include "camel-imapp-folder.h"
-#include "camel-imapp-engine.h"
-#include "camel-imapp-exception.h"
-#include "camel-imapp-utils.h"
-#include "camel-imapp-driver.h"
-
-/* Specified in RFC 2060 section 2.1 */
-#define IMAP_PORT 143
-
-static CamelStoreClass *parent_class = NULL;
-
-static void finalize (CamelObject *object);
-
-static void imap_construct(CamelService *service, CamelSession *session, CamelProvider *provider, CamelURL *url, CamelException *ex);
-/* static char *imap_get_name(CamelService *service, gboolean brief);*/
-static gboolean imap_connect (CamelService *service, CamelException *ex);
-static gboolean imap_disconnect (CamelService *service, gboolean clean, CamelException *ex);
-static GList *imap_query_auth_types (CamelService *service, CamelException *ex);
-
-static void imap_init_trash (CamelStore *store);
-static CamelFolder *imap_get_trash (CamelStore *store, CamelException *ex);
-
-static CamelFolder *imap_get_folder(CamelStore * store, const char *folder_name, guint32 flags, CamelException * ex);
-static CamelFolder *imap_get_inbox (CamelStore *store, CamelException *ex);
-static void imap_rename_folder(CamelStore *store, const char *old_name, const char *new_name, CamelException *ex);
-static CamelFolderInfo *imap_get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelException *ex);
-static void imap_delete_folder(CamelStore *store, const char *folder_name, CamelException *ex);
-static void imap_rename_folder(CamelStore *store, const char *old, const char *new, CamelException *ex);
-static CamelFolderInfo *imap_create_folder(CamelStore *store, const char *parent_name, const char *folder_name, CamelException *ex);
-
-static int store_resp_list(CamelIMAPPEngine *ie, guint32 id, void *data);
-
-/* yet to see if this should go global or not */
-void camel_imapp_store_folder_selected(CamelIMAPPStore *store, CamelIMAPPFolder *folder, CamelIMAPPSelectResponse *select);
-
-static void
-camel_imapp_store_class_init (CamelIMAPPStoreClass *camel_imapp_store_class)
-{
- CamelServiceClass *camel_service_class = CAMEL_SERVICE_CLASS(camel_imapp_store_class);
- CamelStoreClass *camel_store_class = CAMEL_STORE_CLASS(camel_imapp_store_class);
-
- parent_class = CAMEL_STORE_CLASS(camel_type_get_global_classfuncs(camel_store_get_type()));
-
- /* virtual method overload */
- camel_service_class->construct = imap_construct;
- /*camel_service_class->get_name = imap_get_name;*/
- camel_service_class->query_auth_types = imap_query_auth_types;
- camel_service_class->connect = imap_connect;
- camel_service_class->disconnect = imap_disconnect;
-
- camel_store_class->init_trash = imap_init_trash;
- camel_store_class->get_trash = imap_get_trash;
-
- camel_store_class->get_folder = imap_get_folder;
- camel_store_class->get_inbox = imap_get_inbox;
-
- camel_store_class->create_folder = imap_create_folder;
- camel_store_class->rename_folder = imap_rename_folder;
- camel_store_class->delete_folder = imap_delete_folder;
- camel_store_class->get_folder_info = imap_get_folder_info;
-}
-
-static void
-camel_imapp_store_init (gpointer object, gpointer klass)
-{
- CamelIMAPPStore *istore = object;
-}
-
-CamelType
-camel_imapp_store_get_type (void)
-{
- static CamelType camel_imapp_store_type = CAMEL_INVALID_TYPE;
-
- if (!camel_imapp_store_type) {
- camel_imapp_store_type = camel_type_register(CAMEL_STORE_TYPE,
- "CamelIMAPPStore",
- sizeof (CamelIMAPPStore),
- sizeof (CamelIMAPPStoreClass),
- (CamelObjectClassInitFunc) camel_imapp_store_class_init,
- NULL,
- (CamelObjectInitFunc) camel_imapp_store_init,
- finalize);
- }
-
- return camel_imapp_store_type;
-}
-
-static void
-finalize (CamelObject *object)
-{
- CamelIMAPPStore *imap_store = CAMEL_IMAPP_STORE (object);
-
- /* force disconnect so we dont have it run later, after we've cleaned up some stuff */
- /* SIGH */
-
- camel_service_disconnect((CamelService *)imap_store, TRUE, NULL);
-
- if (imap_store->driver)
- camel_object_unref(imap_store->driver);
- if (imap_store->cache)
- camel_object_unref(imap_store->cache);
-}
-
-static void imap_construct(CamelService *service, CamelSession *session, CamelProvider *provider, CamelURL *url, CamelException *ex)
-{
- char *root, *summary;
- CamelIMAPPStore *store = (CamelIMAPPStore *)service;
-
- CAMEL_SERVICE_CLASS (parent_class)->construct (service, session, provider, url, ex);
- if (camel_exception_is_set(ex))
- return;
-
- CAMEL_TRY {
- store->summary = camel_imapp_store_summary_new();
- root = camel_session_get_storage_path(service->session, service, ex);
- if (root) {
- summary = g_build_filename(root, ".ev-store-summary", NULL);
- camel_store_summary_set_filename((CamelStoreSummary *)store->summary, summary);
- /* FIXME: need to remove params, passwords, etc */
- camel_store_summary_set_uri_base((CamelStoreSummary *)store->summary, service->url);
- camel_store_summary_load((CamelStoreSummary *)store->summary);
- }
- } CAMEL_CATCH(e) {
- camel_exception_xfer(ex, e);
- } CAMEL_DONE;
-}
-
-enum {
- USE_SSL_NEVER,
- USE_SSL_ALWAYS,
- USE_SSL_WHEN_POSSIBLE
-};
-
-#define SSL_PORT_FLAGS (CAMEL_TCP_STREAM_SSL_ENABLE_SSL2 | CAMEL_TCP_STREAM_SSL_ENABLE_SSL3)
-#define STARTTLS_FLAGS (CAMEL_TCP_STREAM_SSL_ENABLE_TLS)
-
-static void
-connect_to_server (CamelService *service, int ssl_mode, int try_starttls)
-/* throws IO exception */
-{
- CamelIMAPPStore *store = CAMEL_IMAPP_STORE (service);
- CamelStream * volatile tcp_stream = NULL;
- CamelIMAPPStream * volatile imap_stream = NULL;
- struct hostent *h = NULL;
- int ret, port;
- CamelException *ex;
-
- ex = camel_exception_new();
- CAMEL_TRY {
- /* parent class connect initialization */
- CAMEL_SERVICE_CLASS (parent_class)->connect (service, ex);
- if (ex->id)
- camel_exception_throw_ex(ex);
-
- h = camel_service_gethost(service, ex);
- if (ex->id)
- camel_exception_throw_ex(ex);
-
- port = service->url->port ? service->url->port : IMAP_PORT;
-
-#ifdef HAVE_SSL
- if (camel_url_get_param (service->url, "use_ssl")) {
- if (try_starttls)
- tcp_stream = camel_tcp_stream_ssl_new_raw (service->session, service->url->host, STARTTLS_FLAGS);
- else {
- port = service->url->port ? service->url->port : 995;
- tcp_stream = camel_tcp_stream_ssl_new (service->session, service->url->host, SSL_PORT_FLAGS);
- }
- } else {
- tcp_stream = camel_tcp_stream_raw_new ();
- }
-#else
- tcp_stream = camel_tcp_stream_raw_new ();
-#endif /* HAVE_SSL */
-
- ret = camel_tcp_stream_connect (CAMEL_TCP_STREAM (tcp_stream), h, port);
- camel_free_host (h);
- if (ret == -1) {
- if (errno == EINTR)
- camel_exception_throw(CAMEL_EXCEPTION_USER_CANCEL, _("Connection cancelled"));
- else
- camel_exception_throw(CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
- _("Could not connect to %s (port %d): %s"),
- service->url->host, port, strerror(errno));
- }
-
- imap_stream = (CamelIMAPPStream *)camel_imapp_stream_new(tcp_stream);
- store->driver = camel_imapp_driver_new(imap_stream);
-
- camel_object_unref(imap_stream);
- camel_object_unref(tcp_stream);
- } CAMEL_CATCH(e) {
- if (tcp_stream)
- camel_object_unref(tcp_stream);
- if (imap_stream)
- camel_object_unref((CamelObject *)imap_stream);
- camel_exception_throw_ex(e);
- } CAMEL_DONE;
-
- camel_exception_free(ex);
-}
-
-#if 0
-
-/* leave this stuff out for now */
-
-
-static struct {
- char *value;
- int mode;
-} ssl_options[] = {
- { "", USE_SSL_ALWAYS },
- { "always", USE_SSL_ALWAYS },
- { "when-possible", USE_SSL_WHEN_POSSIBLE },
- { "never", USE_SSL_NEVER },
- { NULL, USE_SSL_NEVER },
-};
-
-static gboolean
-connect_to_server_wrapper (CamelService *service, CamelException *ex)
-{
-#ifdef HAVE_SSL
- const char *use_ssl;
- int i, ssl_mode;
-
- use_ssl = camel_url_get_param (service->url, "use_ssl");
- if (use_ssl) {
- for (i = 0; ssl_options[i].value; i++)
- if (!strcmp (ssl_options[i].value, use_ssl))
- break;
- ssl_mode = ssl_options[i].mode;
- } else
- ssl_mode = USE_SSL_NEVER;
-
- if (ssl_mode == USE_SSL_ALWAYS) {
- /* First try the ssl port */
- if (!connect_to_server (service, ssl_mode, FALSE, ex)) {
- if (camel_exception_get_id (ex) == CAMEL_EXCEPTION_SERVICE_UNAVAILABLE) {
- /* The ssl port seems to be unavailable, lets try STARTTLS */
- camel_exception_clear (ex);
- return connect_to_server (service, ssl_mode, TRUE, ex);
- } else {
- return FALSE;
- }
- }
-
- return TRUE;
- } else if (ssl_mode == USE_SSL_WHEN_POSSIBLE) {
- /* If the server supports STARTTLS, use it */
- return connect_to_server (service, ssl_mode, TRUE, ex);
- } else {
- /* User doesn't care about SSL */
- return connect_to_server (service, ssl_mode, FALSE, ex);
- }
-#else
- return connect_to_server (service, USE_SSL_NEVER, FALSE, ex);
-#endif
-}
-#endif
-
-extern CamelServiceAuthType camel_imapp_password_authtype;
-extern CamelServiceAuthType camel_imapp_apop_authtype;
-
-static GList *
-imap_query_auth_types (CamelService *service, CamelException *ex)
-{
- /*CamelIMAPPStore *store = CAMEL_IMAPP_STORE (service);*/
- GList *types = NULL;
-
- types = CAMEL_SERVICE_CLASS (parent_class)->query_auth_types (service, ex);
- if (types == NULL)
- return NULL;
-
-#if 0
- if (connect_to_server_wrapper (service, NULL)) {
- types = g_list_concat(types, g_list_copy(store->engine->auth));
- imap_disconnect (service, TRUE, NULL);
- } else {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
- _("Could not connect to POP server on %s"),
- service->url->host);
- }
-#endif
- return types;
-}
-
-static void
-store_get_pass(CamelIMAPPStore *store)
-{
- if (((CamelService *)store)->url->passwd == NULL) {
- char *prompt;
- CamelException ex;
-
- camel_exception_init(&ex);
-
- prompt = g_strdup_printf (_("%sPlease enter the IMAP password for %s@%s"),
- store->login_error?store->login_error:"",
- ((CamelService *)store)->url->user,
- ((CamelService *)store)->url->host);
- ((CamelService *)store)->url->passwd = camel_session_get_password(camel_service_get_session((CamelService *)store),
- prompt, FALSE, TRUE, (CamelService*)store, "password", &ex);
- g_free (prompt);
- if (camel_exception_is_set(&ex))
- camel_exception_throw_ex(&ex);
- }
-}
-
-static struct _CamelSasl *
-store_get_sasl(struct _CamelIMAPPDriver *driver, CamelIMAPPStore *store)
-{
- store_get_pass(store);
-
- if (((CamelService *)store)->url->authmech)
- return camel_sasl_new("imap", ((CamelService *)store)->url->authmech, (CamelService *)store);
-
- return NULL;
-}
-
-static void
-store_get_login(struct _CamelIMAPPDriver *driver, char **login, char **pass, CamelIMAPPStore *store)
-{
- store_get_pass(store);
-
- *login = g_strdup(((CamelService *)store)->url->user);
- *pass = g_strdup(((CamelService *)store)->url->passwd);
-}
-
-static gboolean
-imap_connect (CamelService *service, CamelException *ex)
-{
- CamelIMAPPStore *store = (CamelIMAPPStore *)service;
- volatile int ret = FALSE;
-
- CAMEL_TRY {
- volatile int retry = TRUE;
-
- if (store->cache == NULL) {
- char *root;
-
- root = camel_session_get_storage_path(service->session, service, ex);
- if (root) {
- store->cache = camel_data_cache_new(root, 0, ex);
- g_free(root);
- if (store->cache) {
- /* Default cache expiry - 1 week or not visited in a day */
- camel_data_cache_set_expire_age(store->cache, 60*60*24*7);
- camel_data_cache_set_expire_access(store->cache, 60*60*24);
- }
- }
- if (camel_exception_is_set(ex))
- camel_exception_throw_ex(ex);
- }
-
- connect_to_server(service, USE_SSL_NEVER, FALSE);
-
- camel_imapp_driver_set_sasl_factory(store->driver, (CamelIMAPPSASLFunc)store_get_sasl, store);
- camel_imapp_driver_set_login_query(store->driver, (CamelIMAPPLoginFunc)store_get_login, store);
- store->login_error = NULL;
-
- do {
- CAMEL_TRY {
- if (store->driver->engine->state != IMAP_ENGINE_AUTH)
- camel_imapp_driver_login(store->driver);
- ret = TRUE;
- retry = FALSE;
- } CAMEL_CATCH(e) {
- g_free(store->login_error);
- store->login_error = NULL;
- switch (e->id) {
- case CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE:
- store->login_error = g_strdup_printf("%s\n\n", e->desc);
- camel_session_forget_password(service->session, service, "password", ex);
- camel_url_set_passwd(service->url, NULL);
- break;
- default:
- camel_exception_throw_ex(e);
- break;
- }
- } CAMEL_DONE;
- } while (retry);
- } CAMEL_CATCH(e) {
- camel_exception_xfer(ex, e);
- camel_service_disconnect(service, TRUE, NULL);
- ret = FALSE;
- } CAMEL_DONE;
-
- g_free(store->login_error);
- store->login_error = NULL;
-
- return ret;
-}
-
-static gboolean
-imap_disconnect (CamelService *service, gboolean clean, CamelException *ex)
-{
- CamelIMAPPStore *store = CAMEL_IMAPP_STORE (service);
-
- /* FIXME: logout */
-
- if (!CAMEL_SERVICE_CLASS (parent_class)->disconnect (service, clean, ex))
- return FALSE;
-
- /* logout/disconnect */
- if (store->driver) {
- camel_object_unref(store->driver);
- store->driver = NULL;
- }
-
- return TRUE;
-}
-
-static void
-imap_init_trash (CamelStore *store)
-{
- /* no-op */
- ;
-}
-
-static CamelFolder *
-imap_get_trash (CamelStore *store, CamelException *ex)
-{
- /* no-op */
- return NULL;
-}
-
-static CamelFolder *
-imap_get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex)
-{
- CamelIMAPPStore *istore = (CamelIMAPPStore *)store;
- CamelIMAPPFolder * volatile folder = NULL;
-
- /* ??? */
-
- /* 1. create the folder */
- /* 2. run select? */
- /* 3. update the folder */
-
- CAMEL_TRY {
- folder = (CamelIMAPPFolder *)camel_imapp_folder_new(store, folder_name);
- camel_imapp_driver_select(istore->driver, folder);
- } CAMEL_CATCH (e) {
- if (folder) {
- camel_object_unref(folder);
- folder = NULL;
- }
- camel_exception_xfer(ex, e);
- } CAMEL_DONE;
-
- return (CamelFolder *)folder;
-}
-
-static CamelFolder *
-imap_get_inbox(CamelStore *store, CamelException *ex)
-{
- camel_exception_setv(ex, 1, "get_inbox::unimplemented");
-
- return NULL;
-}
-
-/* 8 bit, string compare */
-static int folders_build_cmp(const void *app, const void *bpp)
-{
- struct _list_info *a = *((struct _list_info **)app);
- struct _list_info *b = *((struct _list_info **)bpp);
- unsigned char *ap = (unsigned char *)(a->name);
- unsigned char *bp = (unsigned char *)(b->name);
-
- printf("qsort, cmp '%s' <> '%s'\n", ap, bp);
-
- while (*ap && *ap == *bp) {
- ap++;
- bp++;
- }
-
- if (*ap < *bp)
- return -1;
- else if (*ap > *bp)
- return 1;
- return 0;
-}
-
-/* FIXME: this should go via storesummary? */
-static CamelFolderInfo *
-folders_build_info(CamelURL *base, struct _list_info *li)
-{
- char *path, *full_name, *name;
- CamelFolderInfo *fi;
-
- full_name = imapp_list_get_path(li);
- name = strrchr(full_name, '/');
- if (name)
- name++;
- else
- name = full_name;
-
- path = alloca(strlen(full_name)+2);
- sprintf(path, "/%s", full_name);
- camel_url_set_path(base, path);
-
- fi = g_malloc0(sizeof(*fi));
- fi->url = camel_url_to_string(base, CAMEL_URL_HIDE_ALL);
- fi->name = g_strdup(name);
- fi->full_name = full_name;
- fi->path = g_strdup(path);
- fi->unread_message_count = -1;
- fi->flags = li->flags;
-
- /* TODO: could look up count here ... */
- /* ?? */
- /*folder = camel_object_bag_get(store->folders, "INBOX");*/
-
- return fi;
-}
-
-/*
- a
- a/b
- a/b/c
- a/d
- b
- c/d
-
-*/
-
-/* note, pname is the raw name, not the folderinfo name */
-/* note also this free's as we go, since we never go 'backwards' */
-static CamelFolderInfo *
-folders_build_rec(CamelURL *base, GPtrArray *folders, int *ip, CamelFolderInfo *pfi, char *pname)
-{
- int plen = 0;
- CamelFolderInfo *last = NULL, *first = NULL;
-
- if (pfi)
- plen = strlen(pname);
-
- for(;(*ip)<(int)folders->len;) {
- CamelFolderInfo *fi;
- struct _list_info *li;
-
- li = folders->pdata[*ip];
- printf("checking '%s' is child of '%s'\n", li->name, pname);
-
- /* is this a child of the parent? */
- if (pfi != NULL
- && (strncmp(pname, li->name, strlen(pname)) != 0
- || li->name[plen] != li->separator)) {
- printf(" nope\n");
- break;
- }
- printf(" yep\n");
-
- /* is this not an immediate child of the parent? */
-#if 0
- char *p;
- if (pfi != NULL
- && li->separator != 0
- && (p = strchr(li->name + plen + 1, li->separator)) != NULL) {
- if (last == NULL) {
- struct _list_info tli;
-
- tli.flags = CAMEL_FOLDER_NOSELECT|CAMEL_FOLDER_CHILDREN;
- tli.separator = li->separator;
- tli.name = g_strndup(li->name, p-li->name+1);
- fi = folders_build_info(base, &tli);
- fi->parent = pfi;
- if (pfi && pfi->child == NULL)
- pfi->child = fi;
- i = folders_build_rec(folders, i, fi, tli.name);
- break;
- }
- }
-#endif
-
- fi = folders_build_info(base, li);
- fi->parent = pfi;
- if (last != NULL)
- last->sibling = fi;
- last = fi;
- if (first == NULL)
- first = fi;
-
- (*ip)++;
- fi->child = folders_build_rec(base, folders, ip, fi, li->name);
- imap_free_list(li);
- }
-
- return first;
-}
-
-static void
-folder_info_dump(CamelFolderInfo *fi, int depth)
-{
- char *s;
-
- s = alloca(depth+1);
- memset(s, ' ', depth);
- s[depth] = 0;
- while (fi) {
- printf("%s%s (%s)\n", s, fi->name, fi->url);
- if (fi->child)
- folder_info_dump(fi->child, depth+2);
- fi = fi->sibling;
- }
-
-}
-
-static CamelFolderInfo *
-imap_get_folder_info(CamelStore *store, const char *top, guint32 flags, CamelException *ex)
-{
- CamelIMAPPStore *istore = (CamelIMAPPStore *)store;
- CamelFolderInfo * fi= NULL;
- char *name;
-
- /* FIXME: temporary, since this is not a disco store */
- if (istore->driver == NULL
- && !camel_service_connect((CamelService *)store, ex))
- return NULL;
-
- name = (char *)top;
- if (name == NULL || name[0] == 0) {
- /* namespace? */
- name = "";
- }
-
- name = "";
-
- CAMEL_TRY {
- CamelURL *base;
- int i;
- GPtrArray *folders;
-
- /* FIXME: subscriptions? lsub? */
- folders = camel_imapp_driver_list(istore->driver, name, flags);
-
- /* this greatly simplifies the tree algorithm ... but it might
- be faster just to use a hashtable to find parents? */
- qsort(folders->pdata, folders->len, sizeof(folders->pdata[0]), folders_build_cmp);
-
- i = 0;
- base = camel_url_copy(((CamelService *)store)->url);
- fi = folders_build_rec(base, folders, &i, NULL, NULL);
- camel_url_free(base);
- g_ptr_array_free(folders, TRUE);
- } CAMEL_CATCH(e) {
- camel_exception_xfer(ex, e);
- } CAMEL_DONE;
-
- printf("built folder info:\n");
- folder_info_dump(fi, 2);
-
- return fi;
-
-#if 0
- if (top == NULL || !g_ascii_strcasecmp(top, "inbox")) {
- CamelURL *uri = camel_url_copy(((CamelService *)store)->url);
-
- camel_url_set_path(uri, "/INBOX");
- fi = g_malloc0(sizeof(*fi));
- fi->url = camel_url_to_string(uri, CAMEL_URL_HIDE_ALL);
- camel_url_free(uri);
- fi->name = g_strdup("INBOX");
- fi->full_name = g_strdup("INBOX");
- fi->path = g_strdup("/INBOX");
- fi->unread_message_count = -1;
- fi->flags = 0;
-
- folder = camel_object_bag_get(store->folders, "INBOX");
- if (folder) {
- /*if (!cflags & FAST)*/
- camel_imapp_driver_update(istore->driver, (CamelIMAPPFolder *)folder);
- fi->unread_message_count = camel_folder_get_unread_message_count(folder);
- camel_object_unref(folder);
- }
- } else {
- camel_exception_setv(ex, 1, "not implemented");
- }
-#endif
- return fi;
-
-#if 0
- istore->pending_list = g_ptr_array_new();
-
- CAMEL_TRY {
- ic = camel_imapp_engine_command_new(istore->driver->engine, "LIST", NULL, "LIST \"\" %f", top);
- camel_imapp_engine_command_queue(istore->driver->engine, ic);
- while (camel_imapp_engine_iterate(istore->driver->engine, ic) > 0)
- ;
-
- if (ic->status->result != IMAP_OK)
- camel_exception_throw(1, "list failed: %s", ic->status->text);
- } CAMEL_CATCH (e) {
- camel_exception_xfer(ex, e);
- } CAMEL_DONE;
-
- camel_imapp_engine_command_free(istore->driver->engine, ic);
-
- printf("got folder list:\n");
- for (i=0;i<(int)istore->pending_list->len;i++) {
- struct _list_info *linfo = istore->pending_list->pdata[i];
-
- printf("%s (%c)\n", linfo->name, linfo->separator);
- imap_free_list(linfo);
- }
- istore->pending_list = NULL;
-
- return NULL;
-#endif
-}
-
-static void
-imap_delete_folder(CamelStore *store, const char *folder_name, CamelException *ex)
-{
- camel_exception_setv(ex, 1, "delete_folder::unimplemented");
-}
-
-static void
-imap_rename_folder(CamelStore *store, const char *old, const char *new, CamelException *ex)
-{
- camel_exception_setv(ex, 1, "rename_folder::unimplemented");
-}
-
-static CamelFolderInfo *
-imap_create_folder(CamelStore *store, const char *parent_name, const char *folder_name, CamelException *ex)
-{
- camel_exception_setv(ex, 1, "create_folder::unimplemented");
- return NULL;
-}
-
-/* ********************************************************************** */
-#if 0
-static int store_resp_fetch(CamelIMAPPEngine *ie, guint32 id, void *data)
-{
- struct _fetch_info *finfo;
- CamelIMAPPStore *istore = data;
- CamelMessageInfo *info;
- struct _pending_fetch *pending;
-
- finfo = imap_parse_fetch(ie->stream);
- if (istore->selected) {
- if ((finfo->got & FETCH_UID) == 0) {
- printf("didn't get uid in fetch response?\n");
- } else {
- info = camel_folder_summary_index(((CamelFolder *)istore->selected)->summary, id-1);
- /* exists, check/update */
- if (info) {
- if (strcmp(finfo->uid, camel_message_info_uid(info)) != 0) {
- printf("summary at index %d has uid %s expected %s\n", id, camel_message_info_uid(info), finfo->uid);
- /* uid mismatch??? try do it based on uid instead? try to reorder? i dont know? */
- camel_folder_summary_info_free(((CamelFolder *)istore->selected)->summary, info);
- info = camel_folder_summary_uid(((CamelFolder *)istore->selected)->summary, finfo->uid);
- }
- }
-
- if (info) {
- if (finfo->got & (FETCH_FLAGS)) {
- printf("updating flags for uid '%s'\n", finfo->uid);
- info->flags = finfo->flags;
- camel_folder_change_info_change_uid(istore->selected->changes, finfo->uid);
- }
- if (finfo->got & FETCH_MINFO) {
- printf("got envelope unexpectedly?\n");
- }
- /* other things go here, like body fetches */
- } else {
- pending = g_hash_table_lookup(istore->pending_fetch_table, finfo->uid);
-
- /* we need to create a new info, we only care about flags and minfo */
-
- if (pending)
- info = pending->info;
- else {
- info = camel_folder_summary_info_new(((CamelFolder *)istore->selected)->summary);
- camel_message_info_set_uid(info, g_strdup(finfo->uid));
- }
-
- if (finfo->got & FETCH_FLAGS)
- info->flags = finfo->flags;
-
- if (finfo->got & FETCH_MINFO) {
- /* if we only use ENVELOPE? */
- camel_message_info_set_subject(info, g_strdup(camel_message_info_subject(finfo->minfo)));
- camel_message_info_set_from(info, g_strdup(camel_message_info_from(finfo->minfo)));
- camel_message_info_set_to(info, g_strdup(camel_message_info_to(finfo->minfo)));
- camel_message_info_set_cc(info, g_strdup(camel_message_info_cc(finfo->minfo)));
- info->date_sent = finfo->minfo->date_sent;
- camel_folder_summary_add(((CamelFolder *)istore->selected)->summary, info);
- camel_folder_change_info_add_uid(istore->selected->changes, finfo->uid);
- if (pending) {
- e_dlist_remove((EDListNode *)pending);
- g_hash_table_remove(istore->pending_fetch_table, finfo->uid);
- /*e_memchunk_free(istore->pending_fetch_chunks, pending);*/
- }
- } else if (finfo->got & FETCH_HEADER) {
- /* if we only use HEADER? */
- CamelMimeParser *mp;
-
- if (pending == NULL)
- camel_folder_summary_info_free(((CamelFolder *)istore->selected)->summary, info);
- mp = camel_mime_parser_new();
- camel_mime_parser_init_with_stream(mp, finfo->header);
- info = camel_folder_summary_info_new_from_parser(((CamelFolder *)istore->selected)->summary, mp);
- camel_object_unref(mp);
- camel_message_info_set_uid(info, g_strdup(finfo->uid));
-
- camel_folder_summary_add(((CamelFolder *)istore->selected)->summary, info);
- camel_folder_change_info_add_uid(istore->selected->changes, finfo->uid);
- if (pending) {
- /* FIXME: use a dlist */
- e_dlist_remove((EDListNode *)pending);
- g_hash_table_remove(istore->pending_fetch_table, camel_message_info_uid(pending->info));
- camel_folder_summary_info_free(((CamelFolder *)istore->selected)->summary, pending->info);
- /*e_memchunk_free(istore->pending_fetch_chunks, pending);*/
- }
- } else if (finfo->got & FETCH_FLAGS) {
- if (pending == NULL) {
- pending = e_memchunk_alloc(istore->pending_fetch_chunks);
- pending->info = info;
- g_hash_table_insert(istore->pending_fetch_table, (char *)camel_message_info_uid(info), pending);
- e_dlist_addtail(&istore->pending_fetch_list, (EDListNode *)pending);
- }
- } else {
- if (pending == NULL)
- camel_folder_summary_info_free(((CamelFolder *)istore->selected)->summary, info);
- printf("got unexpected fetch response?\n");
- imap_dump_fetch(finfo);
- }
- }
- }
- } else {
- printf("unexpected fetch response, no folder selected?\n");
- }
- /*imap_dump_fetch(finfo);*/
- imap_free_fetch(finfo);
-
- return camel_imapp_engine_skip(ie);
-}
-#endif
-
-/* ********************************************************************** */
-
-/* should be moved to imapp-utils?
- stuff in imapp-utils should be moved to imapp-parse? */
-
-/* ********************************************************************** */
-
-#if 0
-void
-camel_imapp_store_folder_selected(CamelIMAPPStore *store, CamelIMAPPFolder *folder, CamelIMAPPSelectResponse *select)
-{
- CamelIMAPPCommand * volatile ic = NULL;
- CamelIMAPPStore *istore = (CamelIMAPPStore *)store;
- int i;
- struct _uidset_state ss;
- GPtrArray *fetch;
- CamelMessageInfo *info;
- struct _pending_fetch *fw, *fn;
-
- printf("imap folder selected\n");
-
- if (select->uidvalidity == folder->uidvalidity
- && select->exists == folder->exists
- && select->recent == folder->recent
- && select->unseen == folder->unseen) {
- /* no work to do? */
- return;
- }
-
- istore->pending_fetch_table = g_hash_table_new(g_str_hash, g_str_equal);
- istore->pending_fetch_chunks = e_memchunk_new(256, sizeof(struct _pending_fetch));
-
- /* perform an update - flags first (and see what we have) */
- CAMEL_TRY {
- ic = camel_imapp_engine_command_new(istore->engine, "FETCH", NULL, "FETCH 1:%d (UID FLAGS)", select->exists);
- camel_imapp_engine_command_queue(istore->engine, ic);
- while (camel_imapp_engine_iterate(istore->engine, ic) > 0)
- ;
-
- if (ic->status->result != IMAP_OK)
- camel_exception_throw(1, "fetch failed: %s", ic->status->text);
-
- /* pending_fetch_list now contains any new messages */
- /* FIXME: how do we work out no-longer present messages? */
- printf("now fetching info for messages?\n");
- uidset_init(&ss, store->engine);
- ic = camel_imapp_engine_command_new(istore->engine, "FETCH", NULL, "UID FETCH ");
- fw = (struct _pending_fetch *)istore->pending_fetch_list.head;
- fn = fw->next;
- while (fn) {
- info = fw->info;
- /* if the uid set fills, then flush the command out */
- if (uidset_add(&ss, ic, camel_message_info_uid(info))
- || (fn->next == NULL && uidset_done(&ss, ic))) {
- camel_imapp_engine_command_add(istore->engine, ic, " (FLAGS RFC822.HEADER)");
- camel_imapp_engine_command_queue(istore->engine, ic);
- while (camel_imapp_engine_iterate(istore->engine, ic) > 0)
- ;
- if (ic->status->result != IMAP_OK)
- camel_exception_throw(1, "fetch failed: %s", ic->status->text);
- /* if not end ... */
- camel_imapp_engine_command_free(istore->engine, ic);
- ic = camel_imapp_engine_command_new(istore->engine, "FETCH", NULL, "UID FETCH ");
- }
- fw = fn;
- fn = fn->next;
- }
-
- printf("The pending list should now be empty: %s\n", e_dlist_empty(&istore->pending_fetch_list)?"TRUE":"FALSE");
- for (i=0;i<10;i++) {
- info = camel_folder_summary_index(((CamelFolder *)istore->selected)->summary, i);
- if (info) {
- printf("message info [%d] =\n", i);
- camel_message_info_dump(info);
- camel_folder_summary_info_free(((CamelFolder *)istore->selected)->summary, info);
- }
- }
- } CAMEL_CATCH (e) {
- /* FIXME: cleanup */
- camel_exception_throw_ex(e);
- } CAMEL_DONE;
-
- g_hash_table_destroy(istore->pending_fetch_table);
- istore->pending_fetch_table = NULL;
- e_memchunk_destroy(istore->pending_fetch_chunks);
-
- camel_imapp_engine_command_free(istore->engine, ic);
-}
-#endif
-
-#if 0
-/*char *uids[] = {"1", "2", "4", "5", "6", "7", "9", "11", "12", 0};*/
-/*char *uids[] = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", 0};*/
-char *uids[] = {"1", "3", "5", "7", "9", "11", "12", "13", "14", "15", "20", "21", "24", "25", "26", 0};
-
-void
-uidset_test(CamelIMAPPEngine *ie)
-{
- struct _uidset_state ss;
- CamelIMAPPCommand *ic;
- int i;
-
- /*ic = camel_imapp_engine_command_new(ie, 0, "FETCH", NULL, "FETCH ");*/
- uidset_init(&ss, 0, 0);
- for (i=0;uids[i];i++) {
- if (uidset_add(&ss, uids[i])) {
- printf("\n[%d] flushing uids\n", i);
- }
- }
-
- if (uidset_done(&ss)) {
- printf("\nflushing uids\n");
- }
-}
-#endif
diff --git a/camel/providers/imapp/camel-imapp-store.h b/camel/providers/imapp/camel-imapp-store.h
deleted file mode 100644
index 97b7afd1d1..0000000000
--- a/camel/providers/imapp/camel-imapp-store.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-imap-store.h : class for an imap store */
-
-/*
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * Copyright (C) 2002 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifndef CAMEL_IMAPP_STORE_H
-#define CAMEL_IMAPP_STORE_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include <camel/camel-types.h>
-#include <camel/camel-store.h>
-#include "camel-imapp-driver.h"
-#include "e-util/e-memory.h"
-
-#define CAMEL_IMAPP_STORE_TYPE (camel_imapp_store_get_type ())
-#define CAMEL_IMAPP_STORE(obj) (CAMEL_CHECK_CAST((obj), CAMEL_IMAPP_STORE_TYPE, CamelIMAPPStore))
-#define CAMEL_IMAPP_STORE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_IMAPP_STORE_TYPE, CamelIMAPPStoreClass))
-#define CAMEL_IS_IMAP_STORE(o) (CAMEL_CHECK_TYPE((o), CAMEL_IMAPP_STORE_TYPE))
-
-struct _pending_fetch {
- struct _pending_fetch *next;
- struct _pending_fetch *prev;
-
- CamelMessageInfo *info;
-};
-
-typedef struct {
- CamelStore parent_object;
-
- struct _CamelIMAPPStoreSummary *summary; /* in-memory list of folders */
- struct _CamelIMAPPDriver *driver; /* IMAP processing engine */
- struct _CamelDataCache *cache;
-
- /* if we had a login error, what to show to user */
- char *login_error;
-
- GPtrArray *pending_list;
-} CamelIMAPPStore;
-
-typedef struct {
- CamelStoreClass parent_class;
-
-} CamelIMAPPStoreClass;
-
-/* Standard Camel function */
-CamelType camel_imapp_store_get_type (void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_IMAPP_STORE_H */
-
-
diff --git a/camel/providers/imapp/camel-imapp-stream.c b/camel/providers/imapp/camel-imapp-stream.c
deleted file mode 100644
index 20876beae2..0000000000
--- a/camel/providers/imapp/camel-imapp-stream.c
+++ /dev/null
@@ -1,761 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; fill-column: 160 -*-
- *
- * Author:
- * Michael Zucchi <notzed@ximian.com>
- *
- * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <errno.h>
-
-#include <glib.h>
-
-#include <camel/camel-stream-mem.h>
-
-#include "camel-imapp-stream.h"
-#include "camel-imapp-exception.h"
-
-#define t(x)
-#define io(x) x
-
-static void setup_table(void);
-
-static CamelObjectClass *parent_class = NULL;
-
-/* Returns the class for a CamelStream */
-#define CS_CLASS(so) CAMEL_IMAPP_STREAM_CLASS(CAMEL_OBJECT_GET_CLASS(so))
-
-#define CAMEL_IMAPP_STREAM_SIZE (4096)
-#define CAMEL_IMAPP_STREAM_TOKEN (4096) /* maximum token size */
-
-static int
-stream_fill(CamelIMAPPStream *is)
-{
- int left = 0;
-
- if (is->source) {
- left = is->end - is->ptr;
- memcpy(is->buf, is->ptr, left);
- is->end = is->buf + left;
- is->ptr = is->buf;
- left = camel_stream_read(is->source, is->end, CAMEL_IMAPP_STREAM_SIZE - (is->end - is->buf));
- if (left > 0) {
- is->end += left;
- io(printf("camel_imapp_read: buffer is '%.*s'\n", is->end - is->ptr, is->ptr));
- return is->end - is->ptr;
- } else {
- io(printf("camel_imapp_read: -1\n"));
- return -1;
- }
- }
-
- printf("camel_imapp_read: -1\n");
-
- return -1;
-}
-
-static ssize_t
-stream_read(CamelStream *stream, char *buffer, size_t n)
-{
- CamelIMAPPStream *is = (CamelIMAPPStream *)stream;
- ssize_t max;
-
- if (is->literal == 0 || n == 0)
- return 0;
-
- max = is->end - is->ptr;
- if (max > 0) {
- max = MIN(max, is->literal);
- max = MIN(max, n);
- memcpy(buffer, is->ptr, max);
- is->ptr += max;
- } else {
- max = MIN(is->literal, n);
- max = camel_stream_read(is->source, buffer, max);
- if (max <= 0)
- return max;
- }
-
- is->literal -= max;
-
- return max;
-}
-
-static ssize_t
-stream_write(CamelStream *stream, const char *buffer, size_t n)
-{
- CamelIMAPPStream *is = (CamelIMAPPStream *)stream;
-
- return camel_stream_write(is->source, buffer, n);
-}
-
-static int
-stream_close(CamelStream *stream)
-{
- /* nop? */
- return 0;
-}
-
-static int
-stream_flush(CamelStream *stream)
-{
- /* nop? */
- return 0;
-}
-
-static gboolean
-stream_eos(CamelStream *stream)
-{
- CamelIMAPPStream *is = (CamelIMAPPStream *)stream;
-
- return is->literal == 0;
-}
-
-static int
-stream_reset(CamelStream *stream)
-{
- /* nop? reset literal mode? */
- return 0;
-}
-
-static void
-camel_imapp_stream_class_init (CamelStreamClass *camel_imapp_stream_class)
-{
- CamelStreamClass *camel_stream_class = (CamelStreamClass *)camel_imapp_stream_class;
-
- parent_class = camel_type_get_global_classfuncs( CAMEL_OBJECT_TYPE );
-
- /* virtual method definition */
- camel_stream_class->read = stream_read;
- camel_stream_class->write = stream_write;
- camel_stream_class->close = stream_close;
- camel_stream_class->flush = stream_flush;
- camel_stream_class->eos = stream_eos;
- camel_stream_class->reset = stream_reset;
-}
-
-static void
-camel_imapp_stream_init(CamelIMAPPStream *is, CamelIMAPPStreamClass *isclass)
-{
- /* +1 is room for appending a 0 if we need to for a token */
- is->ptr = is->end = is->buf = g_malloc(CAMEL_IMAPP_STREAM_SIZE+1);
- is->tokenptr = is->tokenbuf = g_malloc(CAMEL_IMAPP_STREAM_SIZE+1);
- is->tokenend = is->tokenbuf + CAMEL_IMAPP_STREAM_SIZE;
-}
-
-static void
-camel_imapp_stream_finalise(CamelIMAPPStream *is)
-{
- g_free(is->buf);
- if (is->source)
- camel_object_unref((CamelObject *)is->source);
-}
-
-CamelType
-camel_imapp_stream_get_type (void)
-{
- static CamelType camel_imapp_stream_type = CAMEL_INVALID_TYPE;
-
- if (camel_imapp_stream_type == CAMEL_INVALID_TYPE) {
- setup_table();
- camel_imapp_stream_type = camel_type_register( camel_stream_get_type(),
- "CamelIMAPPStream",
- sizeof( CamelIMAPPStream ),
- sizeof( CamelIMAPPStreamClass ),
- (CamelObjectClassInitFunc) camel_imapp_stream_class_init,
- NULL,
- (CamelObjectInitFunc) camel_imapp_stream_init,
- (CamelObjectFinalizeFunc) camel_imapp_stream_finalise );
- }
-
- return camel_imapp_stream_type;
-}
-
-/**
- * camel_imapp_stream_new:
- *
- * Returns a NULL stream. A null stream is always at eof, and
- * always returns success for all reads and writes.
- *
- * Return value: the stream
- **/
-CamelStream *
-camel_imapp_stream_new(CamelStream *source)
-{
- CamelIMAPPStream *is;
-
- is = (CamelIMAPPStream *)camel_object_new(camel_imapp_stream_get_type ());
- camel_object_ref((CamelObject *)source);
- is->source = source;
-
- return (CamelStream *)is;
-}
-
-
-/*
- From rfc2060
-
-ATOM_CHAR ::= <any CHAR except atom_specials>
-
-atom_specials ::= "(" / ")" / "{" / SPACE / CTL / list_wildcards /
- quoted_specials
-
-CHAR ::= <any 7-bit US-ASCII character except NUL,
- 0x01 - 0x7f>
-
-CTL ::= <any ASCII control character and DEL,
- 0x00 - 0x1f, 0x7f>
-
-SPACE ::= <ASCII SP, space, 0x20>
-
-list_wildcards ::= "%" / "*"
-
-quoted_specials ::= <"> / "\"
-*/
-
-static unsigned char imap_specials[256] = {
-/* 00 */0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-/* 10 */0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-/* 20 */0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1,
-/* 30 */1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-/* 40 */1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-/* 50 */1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1,
-/* 60 */1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-/* 70 */1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-#define imap_is_atom(c) ((imap_specials[(c)&0xff] & 0x01) != 0)
-#define imap_is_simple(c) ((imap_specials[(c)&0xff] & 0x02) != 0)
-#define imap_not_id(c) ((imap_specials[(c)&0xff] & 0x04) != 0)
-
-/* could be pregenerated, but this is cheap */
-static struct {
- unsigned char *chars;
- unsigned char mask;
-} is_masks[] = {
- { "\n*()[]+", 2 },
- { " \r\n()[]+", 4 },
-};
-
-static void setup_table(void)
-{
- int i;
- unsigned char *p, c;
-
- for (i=0;i<(int)(sizeof(is_masks)/sizeof(is_masks[0]));i++) {
- p = is_masks[i].chars;
- while ((c = *p++))
- imap_specials[c] |= is_masks[i].mask;
- }
-}
-
-#if 0
-
-static int
-skip_ws(CamelIMAPPStream *is, unsigned char *pp, unsigned char *pe)
-{
- register unsigned char c, *p;
- unsigned char *e;
-
- p = is->ptr;
- e = is->end;
-
- do {
- while (p >= e ) {
- is->ptr = p;
- if (stream_fill(is) == IMAP_TOK_ERROR)
- return IMAP_TOK_ERROR;
- p = is->ptr;
- e = is->end;
- }
- c = *p++;
- } while (c == ' ' || c == '\r');
-
- is->ptr = p;
- is->end = e;
-
- return c;
-}
-#endif
-
-/* FIXME: these should probably handle it themselves,
- and get rid of the token interface? */
-int
-camel_imapp_stream_atom(CamelIMAPPStream *is, unsigned char **data, unsigned int *lenp)
-{
- unsigned char *p, c;
-
- /* this is only 'approximate' atom */
- switch(camel_imapp_stream_token(is, data, lenp)) {
- case IMAP_TOK_TOKEN:
- p = *data;
- while ((c = *p))
- *p++ = toupper(c);
- case IMAP_TOK_INT:
- return 0;
- case IMAP_TOK_ERROR:
- return IMAP_TOK_ERROR;
- default:
- camel_exception_throw(1, "expecting atom");
- printf("expecting atom!\n");
- return IMAP_TOK_PROTOCOL;
- }
-}
-
-/* gets an atom, a quoted_string, or a literal */
-int
-camel_imapp_stream_astring(CamelIMAPPStream *is, unsigned char **data)
-{
- unsigned char *p, *start;
- unsigned int len, inlen;
-
- switch(camel_imapp_stream_token(is, data, &len)) {
- case IMAP_TOK_TOKEN:
- case IMAP_TOK_INT:
- case IMAP_TOK_STRING:
- return 0;
- case IMAP_TOK_LITERAL:
- /* FIXME: just grow buffer */
- if (len >= CAMEL_IMAPP_STREAM_TOKEN) {
- camel_exception_throw(1, "astring: literal too long");
- printf("astring too long\n");
- return IMAP_TOK_PROTOCOL;
- }
- p = is->tokenptr;
- camel_imapp_stream_set_literal(is, len);
- do {
- len = camel_imapp_stream_getl(is, &start, &inlen);
- if (len < 0)
- return len;
- memcpy(p, start, inlen);
- p += inlen;
- } while (len > 0);
- *data = is->tokenptr;
- return 0;
- case IMAP_TOK_ERROR:
- /* wont get unless no exception hanlder*/
- return IMAP_TOK_ERROR;
- default:
- camel_exception_throw(1, "expecting astring");
- printf("expecting astring!\n");
- return IMAP_TOK_PROTOCOL;
- }
-}
-
-/* check for NIL or (small) quoted_string or literal */
-int
-camel_imapp_stream_nstring(CamelIMAPPStream *is, unsigned char **data)
-{
- unsigned char *p, *start;
- unsigned int len, inlen;
-
- switch(camel_imapp_stream_token(is, data, &len)) {
- case IMAP_TOK_STRING:
- return 0;
- case IMAP_TOK_LITERAL:
- /* FIXME: just grow buffer */
- if (len >= CAMEL_IMAPP_STREAM_TOKEN) {
- camel_exception_throw(1, "nstring: literal too long");
- return IMAP_TOK_PROTOCOL;
- }
- p = is->tokenptr;
- camel_imapp_stream_set_literal(is, len);
- do {
- len = camel_imapp_stream_getl(is, &start, &inlen);
- if (len < 0)
- return len;
- memcpy(p, start, inlen);
- p += inlen;
- } while (len > 0);
- *data = is->tokenptr;
- return 0;
- case IMAP_TOK_TOKEN:
- p = *data;
- if (toupper(p[0]) == 'N' && toupper(p[1]) == 'I' && toupper(p[2]) == 'L' && p[3] == 0) {
- *data = NULL;
- return 0;
- }
- default:
- camel_exception_throw(1, "expecting nstring");
- return IMAP_TOK_PROTOCOL;
- case IMAP_TOK_ERROR:
- /* we'll never get this unless there are no exception handlers anyway */
- return IMAP_TOK_ERROR;
-
- }
-}
-
-/* parse an nstring as a stream */
-int
-camel_imapp_stream_nstring_stream(CamelIMAPPStream *is, CamelStream **stream)
-/* throws IO,PARSE exception */
-{
- unsigned char *token;
- unsigned int len;
- int ret = 0;
- CamelStream * volatile mem = NULL;
-
- *stream = NULL;
-
- CAMEL_TRY {
- switch(camel_imapp_stream_token(is, &token, &len)) {
- case IMAP_TOK_STRING:
- mem = camel_stream_mem_new_with_buffer(token, len);
- *stream = mem;
- break;
- case IMAP_TOK_LITERAL:
- /* if len is big, we could automatically use a file backing */
- camel_imapp_stream_set_literal(is, len);
- mem = camel_stream_mem_new();
- if (camel_stream_write_to_stream((CamelStream *)is, mem) == -1)
- camel_exception_throw(1, "nstring: io error: %s", strerror(errno));
- camel_stream_reset(mem);
- *stream = mem;
- break;
- case IMAP_TOK_TOKEN:
- if (toupper(token[0]) == 'N' && toupper(token[1]) == 'I' && toupper(token[2]) == 'L' && token[3] == 0) {
- *stream = NULL;
- break;
- }
- default:
- ret = -1;
- camel_exception_throw(1, "nstring: token not string");
- }
- } CAMEL_CATCH(ex) {
- if (mem)
- camel_object_unref((CamelObject *)mem);
- camel_exception_throw_ex(ex);
- } CAMEL_DONE;
-
- /* never reaches here anyway */
- return ret;
-}
-
-guint32
-camel_imapp_stream_number(CamelIMAPPStream *is)
-{
- unsigned char *token;
- unsigned int len;
-
- if (camel_imapp_stream_token(is, &token, &len) != IMAP_TOK_INT) {
- camel_exception_throw(1, "expecting number");
- return 0;
- }
-
- return strtoul(token, 0, 10);
-}
-
-int
-camel_imapp_stream_text(CamelIMAPPStream *is, unsigned char **text)
-{
- GByteArray *build = g_byte_array_new();
- unsigned char *token;
- unsigned int len;
- int tok;
-
- CAMEL_TRY {
- while (is->unget > 0) {
- switch (is->unget_tok) {
- case IMAP_TOK_TOKEN:
- case IMAP_TOK_STRING:
- case IMAP_TOK_INT:
- g_byte_array_append(build, is->unget_token, is->unget_len);
- g_byte_array_append(build, " ", 1);
- default: /* invalid, but we'll ignore */
- break;
- }
- is->unget--;
- }
-
- do {
- tok = camel_imapp_stream_gets(is, &token, &len);
- if (tok < 0)
- camel_exception_throw(1, "io error: %s", strerror(errno));
- if (len)
- g_byte_array_append(build, token, len);
- } while (tok > 0);
- } CAMEL_CATCH(ex) {
- *text = NULL;
- g_byte_array_free(build, TRUE);
- camel_exception_throw_ex(ex);
- } CAMEL_DONE;
-
- g_byte_array_append(build, "", 1);
- *text = build->data;
- g_byte_array_free(build, FALSE);
-
- return 0;
-}
-
-/* Get one token from the imap stream */
-camel_imapp_token_t
-/* throws IO,PARSE exception */
-camel_imapp_stream_token(CamelIMAPPStream *is, unsigned char **data, unsigned int *len)
-{
- register unsigned char c, *p, *o, *oe;
- unsigned char *e;
- unsigned int literal;
- int digits;
-
- if (is->unget > 0) {
- is->unget--;
- *data = is->unget_token;
- *len = is->unget_len;
- /*printf("token UNGET '%c' %s\n", is->unget_tok, is->unget_token);*/
- return is->unget_tok;
- }
-
- if (is->literal > 0)
- g_warning("stream_token called with literal %d", is->literal);
-
- p = is->ptr;
- e = is->end;
-
- /* skip whitespace/prefill buffer */
- do {
- while (p >= e ) {
- is->ptr = p;
- if (stream_fill(is) == IMAP_TOK_ERROR)
- goto io_error;
- p = is->ptr;
- e = is->end;
- }
- c = *p++;
- } while (c == ' ' || c == '\r');
-
- /*strchr("\n*()[]+", c)*/
- if (imap_is_simple(c)) {
- is->ptr = p;
- t(printf("token '%c'\n", c));
- return c;
- } else if (c == '{') {
- literal = 0;
- *data = p;
- while (1) {
- while (p < e) {
- c = *p++;
- if (isdigit(c) && literal < (UINT_MAX/10)) {
- literal = literal * 10 + (c - '0');
- } else if (c == '}') {
- while (1) {
- while (p < e) {
- c = *p++;
- if (c == '\n') {
- *len = literal;
- is->ptr = p;
- is->literal = literal;
- t(printf("token LITERAL %d\n", literal));
- return IMAP_TOK_LITERAL;
- }
- }
- is->ptr = p;
- if (stream_fill(is) == IMAP_TOK_ERROR)
- goto io_error;
- p = is->ptr;
- e = is->end;
- }
- } else {
- if (isdigit(c))
- printf("Protocol error: literal too big\n");
- else
- printf("Protocol error: literal contains invalid char %02x '%c'\n", c, isprint(c)?c:c);
- goto protocol_error;
- }
- }
- is->ptr = p;
- if (stream_fill(is) == IMAP_TOK_ERROR)
- goto io_error;
- p = is->ptr;
- e = is->end;
- }
- } else if (c == '"') {
- o = is->tokenptr;
- oe = is->tokenptr + CAMEL_IMAPP_STREAM_TOKEN - 1;
- while (1) {
- while (p < e) {
- c = *p++;
- if (c == '\\') {
- while (p >= e) {
- is->ptr = p;
- if (stream_fill(is) == IMAP_TOK_ERROR)
- goto io_error;
- p = is->ptr;
- e = is->end;
- }
- c = *p++;
- } else if (c == '\"') {
- is->ptr = p;
- *o = 0;
- *data = is->tokenbuf;
- *len = o - is->tokenbuf;
- t(printf("token STRING '%s'\n", is->tokenbuf));
- return IMAP_TOK_STRING;
- }
-
- if (c == '\n' || c == '\r' || o>=oe) {
- if (o >= oe)
- printf("Protocol error: string too long\n");
- else
- printf("Protocol error: truncated string\n");
- goto protocol_error;
- } else {
- *o++ = c;
- }
- }
- is->ptr = p;
- if (stream_fill(is) == IMAP_TOK_ERROR)
- goto io_error;
- p = is->ptr;
- e = is->end;
- }
- } else {
- o = is->tokenptr;
- oe = is->tokenptr + CAMEL_IMAPP_STREAM_TOKEN - 1;
- digits = isdigit(c);
- *o++ = c;
- while (1) {
- while (p < e) {
- c = *p++;
- /*if (strchr(" \r\n*()[]+", c) != NULL) {*/
- if (imap_not_id(c)) {
- if (c == ' ' || c == '\r')
- is->ptr = p;
- else
- is->ptr = p-1;
- *o = 0;
- *data = is->tokenbuf;
- *len = o - is->tokenbuf;
- t(printf("token TOKEN '%s'\n", is->tokenbuf));
- return digits?IMAP_TOK_INT:IMAP_TOK_TOKEN;
- } else if (o < oe) {
- digits &= isdigit(c);
- *o++ = c;
- } else {
- printf("Protocol error: token too long\n");
- goto protocol_error;
- }
- }
- is->ptr = p;
- if (stream_fill(is) == IMAP_TOK_ERROR)
- goto io_error;
- p = is->ptr;
- e = is->end;
- }
- }
-
- /* Had an i/o erorr */
-io_error:
- printf("Got io error\n");
- camel_exception_throw(1, "io error");
- return IMAP_TOK_ERROR;
-
- /* Protocol error, skip until next lf? */
-protocol_error:
- printf("Got protocol error\n");
-
- if (c == '\n')
- is->ptr = p-1;
- else
- is->ptr = p;
-
- camel_exception_throw(1, "protocol error");
- return IMAP_TOK_PROTOCOL;
-}
-
-void
-camel_imapp_stream_ungettoken(CamelIMAPPStream *is, camel_imapp_token_t tok, unsigned char *token, unsigned int len)
-{
- /*printf("ungettoken: '%c' '%s'\n", tok, token);*/
- is->unget_tok = tok;
- is->unget_token = token;
- is->unget_len = len;
- is->unget++;
-}
-
-/* returns -1 on error, 0 if last lot of data, >0 if more remaining */
-int camel_imapp_stream_gets(CamelIMAPPStream *is, unsigned char **start, unsigned int *len)
-{
- int max;
- unsigned char *end;
-
- *len = 0;
-
- max = is->end - is->ptr;
- if (max == 0) {
- max = stream_fill(is);
- if (max <= 0)
- return max;
- }
-
- *start = is->ptr;
- end = memchr(is->ptr, '\n', max);
- if (end)
- max = (end - is->ptr) + 1;
- *start = is->ptr;
- *len = max;
- is->ptr += max;
-
- return end == NULL?1:0;
-}
-
-void camel_imapp_stream_set_literal(CamelIMAPPStream *is, unsigned int literal)
-{
- is->literal = literal;
-}
-
-/* returns -1 on erorr, 0 if last data, >0 if more data left */
-int camel_imapp_stream_getl(CamelIMAPPStream *is, unsigned char **start, unsigned int *len)
-{
- int max;
-
- *len = 0;
-
- if (is->literal > 0) {
- max = is->end - is->ptr;
- if (max == 0) {
- max = stream_fill(is);
- if (max <= 0)
- return max;
- }
-
- max = MIN(max, is->literal);
- *start = is->ptr;
- *len = max;
- is->ptr += max;
- is->literal -= max;
- }
-
- if (is->literal > 0)
- return 1;
-
- return 0;
-}
diff --git a/camel/providers/imapp/camel-imapp-stream.h b/camel/providers/imapp/camel-imapp-stream.h
deleted file mode 100644
index 802c018672..0000000000
--- a/camel/providers/imapp/camel-imapp-stream.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef _CAMEL_IMAPP_STREAM_H
-#define _CAMEL_IMAPP_STREAM_H
-
-#include <camel/camel-stream.h>
-
-#define CAMEL_IMAPP_STREAM(obj) CAMEL_CHECK_CAST (obj, camel_imapp_stream_get_type (), CamelIMAPPStream)
-#define CAMEL_IMAPP_STREAM_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_imapp_stream_get_type (), CamelIMAPPStreamClass)
-#define CAMEL_IS_IMAP_STREAM(obj) CAMEL_CHECK_TYPE (obj, camel_imapp_stream_get_type ())
-
-typedef struct _CamelIMAPPStreamClass CamelIMAPPStreamClass;
-typedef struct _CamelIMAPPStream CamelIMAPPStream;
-
-typedef enum {
- IMAP_TOK_PROTOCOL = -2,
- IMAP_TOK_ERROR = -1,
- IMAP_TOK_TOKEN = 256,
- IMAP_TOK_STRING,
- IMAP_TOK_INT,
- IMAP_TOK_LITERAL,
-} camel_imapp_token_t;
-
-struct _CamelIMAPPStream {
- CamelStream parent;
-
- CamelStream *source;
-
- /*int state;*/
- unsigned char *buf, *ptr, *end;
- unsigned int literal;
-
- unsigned int unget;
- camel_imapp_token_t unget_tok;
- unsigned char *unget_token;
- unsigned int unget_len;
-
- unsigned char *tokenbuf, *tokenptr, *tokenend;
-};
-
-struct _CamelIMAPPStreamClass {
- CamelStreamClass parent_class;
-};
-
-CamelType camel_imapp_stream_get_type (void);
-
-CamelStream *camel_imapp_stream_new (CamelStream *source);
-
-camel_imapp_token_t camel_imapp_stream_token (CamelIMAPPStream *is, unsigned char **start, unsigned int *len); /* throws IO,PARSE exception */
-void camel_imapp_stream_ungettoken (CamelIMAPPStream *is, camel_imapp_token_t tok, unsigned char *token, unsigned int len);
-
-void camel_imapp_stream_set_literal (CamelIMAPPStream *is, unsigned int literal);
-int camel_imapp_stream_gets (CamelIMAPPStream *is, unsigned char **start, unsigned int *len);
-int camel_imapp_stream_getl (CamelIMAPPStream *is, unsigned char **start, unsigned int *len);
-
-/* all throw IO,PARSE exceptions */
-
-/* gets an atom, upper-cases */
-int camel_imapp_stream_atom (CamelIMAPPStream *is, unsigned char **start, unsigned int *len);
-/* gets an atom or string */
-int camel_imapp_stream_astring (CamelIMAPPStream *is, unsigned char **start);
-/* gets a NIL or a string, start==NULL if NIL */
-int camel_imapp_stream_nstring (CamelIMAPPStream *is, unsigned char **start);
-/* gets a NIL or string into a stream, stream==NULL if NIL */
-int camel_imapp_stream_nstring_stream(CamelIMAPPStream *is, CamelStream **stream);
-/* gets 'text' */
-int camel_imapp_stream_text (CamelIMAPPStream *is, unsigned char **text);
-
-/* gets a 'number' */
-guint32 camel_imapp_stream_number(CamelIMAPPStream *is);
-
-#endif /* ! _CAMEL_IMAPP_STREAM_H */
diff --git a/camel/providers/imapp/camel-imapp-summary.c b/camel/providers/imapp/camel-imapp-summary.c
deleted file mode 100644
index a0df21bcb0..0000000000
--- a/camel/providers/imapp/camel-imapp-summary.c
+++ /dev/null
@@ -1,166 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright(C) 2000 Ximian Inc.
- *
- * Authors:
- * Michael Zucchi <notzed@ximian.com>
- * Dan Winship <danw@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <sys/stat.h>
-#include <sys/uio.h>
-#include <unistd.h>
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include "camel-imapp-summary.h"
-#include <camel/camel-file-utils.h>
-
-#define CAMEL_IMAPP_SUMMARY_VERSION (0x1000)
-
-static int summary_header_load(CamelFolderSummary *, FILE *);
-static int summary_header_save(CamelFolderSummary *, FILE *);
-
-static CamelMessageInfo *message_info_load(CamelFolderSummary *s, FILE *in);
-static int message_info_save(CamelFolderSummary *s, FILE *out, CamelMessageInfo *info);
-
-static void camel_imapp_summary_class_init(CamelIMAPPSummaryClass *klass);
-static void camel_imapp_summary_init (CamelIMAPPSummary *obj);
-
-static CamelFolderSummaryClass *camel_imapp_summary_parent;
-
-CamelType
-camel_imapp_summary_get_type(void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register(
- camel_folder_summary_get_type(), "CamelIMAPPSummary",
- sizeof(CamelIMAPPSummary),
- sizeof(CamelIMAPPSummaryClass),
- (CamelObjectClassInitFunc) camel_imapp_summary_class_init,
- NULL,
- (CamelObjectInitFunc) camel_imapp_summary_init,
- NULL);
- }
-
- return type;
-}
-
-static void
-camel_imapp_summary_class_init(CamelIMAPPSummaryClass *klass)
-{
- CamelFolderSummaryClass *cfs_class =(CamelFolderSummaryClass *) klass;
-
- camel_imapp_summary_parent = CAMEL_FOLDER_SUMMARY_CLASS(camel_type_get_global_classfuncs(camel_folder_summary_get_type()));
-
- cfs_class->summary_header_load = summary_header_load;
- cfs_class->summary_header_save = summary_header_save;
- cfs_class->message_info_load = message_info_load;
- cfs_class->message_info_save = message_info_save;
-}
-
-static void
-camel_imapp_summary_init(CamelIMAPPSummary *obj)
-{
- CamelFolderSummary *s =(CamelFolderSummary *)obj;
-
- /* subclasses need to set the right instance data sizes */
- s->message_info_size = sizeof(CamelIMAPPMessageInfo);
- s->content_info_size = sizeof(CamelMessageContentInfo);
-
- /* and a unique file version */
- s->version += CAMEL_IMAPP_SUMMARY_VERSION;
-}
-
-/**
- * camel_imapp_summary_new:
- * @filename: the file to store the summary in.
- *
- * This will create a new CamelIMAPPSummary object and read in the
- * summary data from disk, if it exists.
- *
- * Return value: A new CamelIMAPPSummary object.
- **/
-CamelFolderSummary *
-camel_imapp_summary_new(void)
-{
- CamelFolderSummary *summary = CAMEL_FOLDER_SUMMARY(camel_object_new(camel_imapp_summary_get_type()));
-
- return summary;
-}
-
-
-static int
-summary_header_load(CamelFolderSummary *s, FILE *in)
-{
- CamelIMAPPSummary *ims = CAMEL_IMAPP_SUMMARY(s);
-
- if (camel_imapp_summary_parent->summary_header_load(s, in) == -1)
- return -1;
-
- return camel_file_util_decode_uint32(in, &ims->uidvalidity);
-}
-
-static int
-summary_header_save(CamelFolderSummary *s, FILE *out)
-{
- CamelIMAPPSummary *ims = CAMEL_IMAPP_SUMMARY(s);
-
- if (camel_imapp_summary_parent->summary_header_save(s, out) == -1)
- return -1;
-
- return camel_file_util_encode_uint32(out, ims->uidvalidity);
-}
-
-
-static CamelMessageInfo *
-message_info_load(CamelFolderSummary *s, FILE *in)
-{
- CamelMessageInfo *info;
- CamelIMAPPMessageInfo *iinfo;
-
- info = camel_imapp_summary_parent->message_info_load(s, in);
- if (info) {
- iinfo =(CamelIMAPPMessageInfo *)info;
-
- if (camel_file_util_decode_uint32(in, &iinfo->server_flags) == -1)
- goto error;
- }
-
- return info;
-error:
- camel_folder_summary_info_free(s, info);
- return NULL;
-}
-
-static int
-message_info_save(CamelFolderSummary *s, FILE *out, CamelMessageInfo *info)
-{
- CamelIMAPPMessageInfo *iinfo =(CamelIMAPPMessageInfo *)info;
-
- if (camel_imapp_summary_parent->message_info_save(s, out, info) == -1)
- return -1;
-
- return camel_file_util_encode_uint32(out, iinfo->server_flags);
-}
diff --git a/camel/providers/imapp/camel-imapp-summary.h b/camel/providers/imapp/camel-imapp-summary.h
deleted file mode 100644
index e9783625f4..0000000000
--- a/camel/providers/imapp/camel-imapp-summary.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors:
- * Michael Zucchi <notzed@ximian.com>
- * Dan Winship <danw@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef _CAMEL_IMAPP_SUMMARY_H
-#define _CAMEL_IMAPP_SUMMARY_H
-
-#include <camel/camel-folder-summary.h>
-#include <camel/camel-exception.h>
-
-#define CAMEL_IMAPP_SUMMARY(obj) CAMEL_CHECK_CAST (obj, camel_imapp_summary_get_type (), CamelIMAPPSummary)
-#define CAMEL_IMAPP_SUMMARY_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_imapp_summary_get_type (), CamelIMAPPSummaryClass)
-#define CAMEL_IS_IMAPP_SUMMARY(obj) CAMEL_CHECK_TYPE (obj, camel_imapp_summary_get_type ())
-
-#define CAMEL_IMAPP_SERVER_FLAGS (CAMEL_MESSAGE_ANSWERED | \
- CAMEL_MESSAGE_DELETED | \
- CAMEL_MESSAGE_DRAFT | \
- CAMEL_MESSAGE_FLAGGED | \
- CAMEL_MESSAGE_SEEN)
-
-#define CAMEL_IMAPP_MESSAGE_RECENT (1 << 8)
-
-typedef struct _CamelIMAPPSummaryClass CamelIMAPPSummaryClass;
-typedef struct _CamelIMAPPSummary CamelIMAPPSummary;
-
-typedef struct _CamelIMAPPMessageInfo {
- CamelMessageInfo info;
-
- guint32 server_flags;
-} CamelIMAPPMessageInfo;
-
-struct _CamelIMAPPSummary {
- CamelFolderSummary parent;
-
- guint32 uidvalidity;
-};
-
-struct _CamelIMAPPSummaryClass {
- CamelFolderSummaryClass parent_class;
-
-};
-
-CamelType camel_imapp_summary_get_type (void);
-CamelFolderSummary *camel_imapp_summary_new (void);
-
-#endif /* ! _CAMEL_IMAPP_SUMMARY_H */
-
diff --git a/camel/providers/imapp/camel-imapp-utils.c b/camel/providers/imapp/camel-imapp-utils.c
deleted file mode 100644
index e20499689d..0000000000
--- a/camel/providers/imapp/camel-imapp-utils.c
+++ /dev/null
@@ -1,1339 +0,0 @@
-
-#include <ctype.h>
-#include <errno.h>
-#include <string.h>
-
-#include <camel/camel-folder-summary.h>
-#include <camel/camel-store.h>
-#include <camel/camel-utf8.h>
-
-#include "camel-imapp-folder.h"
-#include "camel-imapp-stream.h"
-#include "camel-imapp-utils.h"
-#include "camel-imapp-exception.h"
-#include "camel-imapp-engine.h"
-#include "e-util/e-memory.h"
-
-/* high-level parser state */
-#define p(x)
-/* debug */
-#define d(x)
-
-/* ANSI-C code produced by gperf version 2.7 */
-/* Command-line: gperf -H imap_hash -N imap_tokenise -L ANSI-C -o -t -k1,$ imap-tokens.txt */
-struct _imap_keyword { char *name; enum _imap_id id; };
-/*
- gperf input file
- best hash generated using: gperf -o -s-2 -k1,'$' -t -H imap_hash -N imap_tokenise -L ANSI-C
-*/
-
-#define TOTAL_KEYWORDS 23
-#define MIN_WORD_LENGTH 2
-#define MAX_WORD_LENGTH 14
-#define MIN_HASH_VALUE 2
-#define MAX_HASH_VALUE 38
-/* maximum key range = 37, duplicates = 0 */
-
-#ifdef __GNUC__
-__inline
-#endif
-static unsigned int
-imap_hash (register const char *str, register unsigned int len)
-{
- static unsigned char asso_values[] =
- {
- 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
- 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
- 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
- 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
- 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
- 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
- 39, 39, 39, 39, 39, 10, 15, 39, 20, 0,
- 0, 39, 0, 10, 39, 0, 39, 39, 10, 0,
- 0, 39, 0, 10, 5, 10, 39, 39, 39, 0,
- 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
- 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
- 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
- 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
- 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
- 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
- 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
- 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
- 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
- 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
- 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
- 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
- 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
- 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
- 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
- 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
- 39, 39, 39, 39, 39, 39
- };
- return len + asso_values[(unsigned char)str[len - 1]] + asso_values[(unsigned char)str[0]];
-}
-
-#ifdef __GNUC__
-__inline
-#endif
-enum _imap_id
-imap_tokenise (register const char *str, register unsigned int len)
-{
- static struct _imap_keyword wordlist[] =
- {
- {""}, {""},
- {"OK", IMAP_OK},
- {""}, {""},
- {"PARSE", IMAP_PARSE},
- {""},
- {"PREAUTH", IMAP_PREAUTH},
- {"ENVELOPE", IMAP_ENVELOPE},
- {"READ-ONLY", IMAP_READ_ONLY},
- {"READ-WRITE", IMAP_READ_WRITE},
- {"RFC822.SIZE", IMAP_RFC822_SIZE},
- {"NO", IMAP_NO},
- {"RFC822.HEADER", IMAP_RFC822_HEADER},
- {"TRYCREATE", IMAP_TRYCREATE},
- {"FLAGS", IMAP_FLAGS},
- {"RFC822.TEXT", IMAP_RFC822_TEXT},
- {"NEWNAME", IMAP_NEWNAME},
- {"BYE", IMAP_BYE},
- {"BODY", IMAP_BODY},
- {"ALERT", IMAP_ALERT},
- {"UIDVALIDITY", IMAP_UIDVALIDITY},
- {"INTERNALDATE", IMAP_INTERNALDATE},
- {""},
- {"PERMANENTFLAGS", IMAP_PERMANENTFLAGS},
- {""},
- {"UNSEEN", IMAP_UNSEEN},
- {""},
- {"BODYSTRUCTURE", IMAP_BODYSTRUCTURE},
- {""}, {""}, {""}, {""},
- {"UID", IMAP_UID},
- {""}, {""}, {""}, {""},
- {"BAD", IMAP_BAD}
- };
-
- if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
- {
- register int key = imap_hash (str, len);
-
- if (key <= MAX_HASH_VALUE && key >= 0)
- {
- register const char *s = wordlist[key].name;
-
- if (*str == *s && !strcmp (str + 1, s + 1))
- return wordlist[key].id;
- }
- }
- return 0;
-}
-
-/* flag table */
-static struct {
- char *name;
- guint32 flag;
-} flag_table[] = {
- { "\\ANSWERED", CAMEL_MESSAGE_ANSWERED },
- { "\\DELETED", CAMEL_MESSAGE_DELETED },
- { "\\DRAFT", CAMEL_MESSAGE_DRAFT },
- { "\\FLAGGED", CAMEL_MESSAGE_FLAGGED },
- { "\\SEEN", CAMEL_MESSAGE_SEEN },
- { "\\RECENT", CAMEL_IMAPP_MESSAGE_RECENT },
- { "\\*", CAMEL_MESSAGE_USER },
-};
-
-/* utility functions
- shoudl this be part of imapp-driver? */
-/* mabye this should be a stream op? */
-void
-imap_parse_flags(CamelIMAPPStream *stream, guint32 *flagsp)
-/* throws IO,PARSE exception */
-{
- int tok, len, i;
- unsigned char *token, *p, c;
- guint32 flags = 0;
-
- *flagsp = flags;
-
- tok = camel_imapp_stream_token(stream, &token, &len);
- if (tok == '(') {
- do {
- tok = camel_imapp_stream_token(stream, &token, &len);
- if (tok == IMAP_TOK_TOKEN) {
- p = token;
- while ((c=*p))
- *p++ = toupper(c);
- for (i=0;i<(int)(sizeof(flag_table)/sizeof(flag_table[0]));i++)
- if (!strcmp(token, flag_table[i].name))
- flags |= flag_table[i].flag;
- } else if (tok != ')') {
- camel_exception_throw(1, "expecting flag");
- }
- } while (tok != ')');
- } else {
- camel_exception_throw(1, "expecting flag list");
- }
-
- *flagsp = flags;
-}
-
-void
-imap_write_flags(CamelStream *stream, guint32 flags)
-/* throws IO exception */
-{
- int i;
-
- /* all this ugly exception throwing goes away once camel streams throw their own? */
- if (camel_stream_write(stream, "(", 1) == -1)
- camel_exception_throw(1, "io error: %s", strerror(errno));
-
- for (i=0;flags!=0 && i<(int)(sizeof(flag_table)/sizeof(flag_table[0]));i++) {
- if (flag_table[i].flag & flags) {
- if (camel_stream_write(stream, flag_table[i].name, strlen(flag_table[i].name)) == -1)
- camel_exception_throw(1, "io error: %s", strerror(errno));
- flags &= ~flag_table[i].flag;
- if (flags != 0)
- if (camel_stream_write(stream, " ", 1) == -1)
- camel_exception_throw(1, "io error: %s", strerror(errno));
- }
- }
-
- if (camel_stream_write(stream, ")", 1) == -1)
- camel_exception_throw(1, "io error: %s", strerror(errno));
-}
-
-/*
-body ::= "(" body_type_1part / body_type_mpart ")"
-
-body_extension ::= nstring / number / "(" 1#body_extension ")"
- ;; Future expansion. Client implementations
- ;; MUST accept body_extension fields. Server
- ;; implementations MUST NOT generate
- ;; body_extension fields except as defined by
- ;; future standard or standards-track
- ;; revisions of this specification.
-
-body_ext_1part ::= body_fld_md5 [SPACE body_fld_dsp
- [SPACE body_fld_lang
- [SPACE 1#body_extension]]]
- ;; MUST NOT be returned on non-extensible
- ;; "BODY" fetch
-
-body_ext_mpart ::= body_fld_param
- [SPACE body_fld_dsp SPACE body_fld_lang
- [SPACE 1#body_extension]]
- ;; MUST NOT be returned on non-extensible
- ;; "BODY" fetch
-
-body_fields ::= body_fld_param SPACE body_fld_id SPACE
- body_fld_desc SPACE body_fld_enc SPACE
- body_fld_octets
-
-body_fld_desc ::= nstring
-
-body_fld_dsp ::= "(" string SPACE body_fld_param ")" / nil
-
-body_fld_enc ::= (<"> ("7BIT" / "8BIT" / "BINARY" / "BASE64"/
- "QUOTED-PRINTABLE") <">) / string
-
-body_fld_id ::= nstring
-
-body_fld_lang ::= nstring / "(" 1#string ")"
-
-body_fld_lines ::= number
-
-body_fld_md5 ::= nstring
-
-body_fld_octets ::= number
-
-body_fld_param ::= "(" 1#(string SPACE string) ")" / nil
-
-body_type_1part ::= (body_type_basic / body_type_msg / body_type_text)
- [SPACE body_ext_1part]
-
-body_type_basic ::= media_basic SPACE body_fields
- ;; MESSAGE subtype MUST NOT be "RFC822"
-
-body_type_mpart ::= 1*body SPACE media_subtype
- [SPACE body_ext_mpart]
-
-body_type_msg ::= media_message SPACE body_fields SPACE envelope
- SPACE body SPACE body_fld_lines
-
-body_type_text ::= media_text SPACE body_fields SPACE body_fld_lines
-
-envelope ::= "(" env_date SPACE env_subject SPACE env_from
- SPACE env_sender SPACE env_reply_to SPACE env_to
- SPACE env_cc SPACE env_bcc SPACE env_in_reply_to
- SPACE env_message_id ")"
-
-env_bcc ::= "(" 1*address ")" / nil
-
-env_cc ::= "(" 1*address ")" / nil
-
-env_date ::= nstring
-
-env_from ::= "(" 1*address ")" / nil
-
-env_in_reply_to ::= nstring
-
-env_message_id ::= nstring
-
-env_reply_to ::= "(" 1*address ")" / nil
-
-env_sender ::= "(" 1*address ")" / nil
-
-env_subject ::= nstring
-
-env_to ::= "(" 1*address ")" / nil
-
-media_basic ::= (<"> ("APPLICATION" / "AUDIO" / "IMAGE" /
- "MESSAGE" / "VIDEO") <">) / string)
- SPACE media_subtype
- ;; Defined in [MIME-IMT]
-
-media_message ::= <"> "MESSAGE" <"> SPACE <"> "RFC822" <">
- ;; Defined in [MIME-IMT]
-
-media_subtype ::= string
- ;; Defined in [MIME-IMT]
-
-media_text ::= <"> "TEXT" <"> SPACE media_subtype
- ;; Defined in [MIME-IMT]
-
-
-
- ( "type" "subtype" body_fields [envelope body body_fld_lines]
- [body_fld_lines]
-
-
-
- (("TEXT" "PLAIN" ("CHARSET"
- "US-ASCII") NIL NIL "7BIT" 1152 23)("TEXT" "PLAIN"
- ("CHARSET" "US-ASCII" "NAME" "cc.diff")
- "<960723163407.20117h@cac.washington.edu>"
- "Compiler diff" "BASE64" 4554 73) "MIXED"))
-
-*/
-
-/*
-struct _body_fields {
- CamelContentType *ct;
- char *msgid, *desc;
- CamelTransferEncoding encoding;
- guint32 size;
- };*/
-
-void
-imap_free_body(struct _CamelMessageContentInfo *cinfo)
-{
- struct _CamelMessageContentInfo *list, *next;
-
- list = cinfo->childs;
- while (list) {
- next = list->next;
- imap_free_body(list);
- list = next;
- }
-
- if (cinfo->type)
- camel_content_type_unref(cinfo->type);
- g_free(cinfo->id);
- g_free(cinfo->description);
- g_free(cinfo->encoding);
- g_free(cinfo);
-}
-
-void
-imap_parse_param_list(CamelIMAPPStream *is, struct _camel_header_param **plist)
-{
- int tok, len;
- unsigned char *token, *param;
-
- p(printf("body_fld_param\n"));
-
- /* body_fld_param ::= "(" 1#(string SPACE string) ")" / nil */
- tok = camel_imapp_stream_token(is, &token, &len);
- if (tok == '(') {
- while (1) {
- tok = camel_imapp_stream_token(is, &token, &len);
- if (tok == ')')
- break;
- camel_imapp_stream_ungettoken(is, tok, token, len);
-
- camel_imapp_stream_astring(is, &token);
- param = alloca(strlen(token)+1);
- strcpy(param, token);
- camel_imapp_stream_astring(is, &token);
- camel_header_set_param(plist, param, token);
- }
- } /* else check nil? no need */
-}
-
-struct _CamelContentDisposition *
-imap_parse_ext_optional(CamelIMAPPStream *is)
-{
- int tok, len;
- unsigned char *token;
- struct _CamelContentDisposition * volatile dinfo = NULL;
-
- /* this parses both extension types, from the body_fld_dsp onwards */
- /* although the grammars are different, they can be parsed the same way */
-
- /* body_ext_1part ::= body_fld_md5 [SPACE body_fld_dsp
- [SPACE body_fld_lang
- [SPACE 1#body_extension]]]
- ;; MUST NOT be returned on non-extensible
- ;; "BODY" fetch */
-
- /* body_ext_mpart ::= body_fld_param
- [SPACE body_fld_dsp SPACE body_fld_lang
- [SPACE 1#body_extension]]
- ;; MUST NOT be returned on non-extensible
- ;; "BODY" fetch */
-
- CAMEL_TRY {
- /* body_fld_dsp ::= "(" string SPACE body_fld_param ")" / nil */
-
- tok = camel_imapp_stream_token(is, &token, &len);
- switch (tok) {
- case '(':
- dinfo = g_malloc0(sizeof(*dinfo));
- dinfo->refcount = 1;
- /* should be string */
- camel_imapp_stream_astring(is, &token);
-
- dinfo->disposition = g_strdup(token);
- imap_parse_param_list(is, &dinfo->params);
- case IMAP_TOK_TOKEN:
- d(printf("body_fld_dsp: NIL\n"));
- break;
- default:
- camel_exception_throw(1, "body_fld_disp: expecting nil or list");
- }
-
- p(printf("body_fld_lang\n"));
-
- /* body_fld_lang ::= nstring / "(" 1#string ")" */
-
- /* we just drop the lang string/list, save it somewhere? */
-
- tok = camel_imapp_stream_token(is, &token, &len);
- switch (tok) {
- case '(':
- while (1) {
- tok = camel_imapp_stream_token(is, &token, &len);
- if (tok == ')') {
- break;
- } else if (tok != IMAP_TOK_STRING) {
- camel_exception_throw(1, "expecting string");
- }
- }
- break;
- case IMAP_TOK_TOKEN:
- d(printf("body_fld_lang = nil\n"));
- /* treat as 'nil' */
- break;
- case IMAP_TOK_STRING:
- /* we have a string */
- break;
- case IMAP_TOK_LITERAL:
- /* we have a literal string */
- camel_imapp_stream_set_literal(is, len);
- while ((tok = camel_imapp_stream_getl(is, &token, &len)) > 0) {
- d(printf("Skip literal data '%.*s'\n", (int)len, token));
- }
- break;
-
- }
- } CAMEL_CATCH(ex) {
- if (dinfo)
- camel_content_disposition_unref(dinfo);
- camel_exception_throw_ex(ex);
- } CAMEL_DONE;
-
- return dinfo;
-}
-
-struct _CamelMessageContentInfo *
-imap_parse_body_fields(CamelIMAPPStream *is)
-{
- unsigned char *token, *type;
- struct _CamelMessageContentInfo *cinfo;
-
- /* body_fields ::= body_fld_param SPACE body_fld_id SPACE
- body_fld_desc SPACE body_fld_enc SPACE
- body_fld_octets */
-
- p(printf("body_fields\n"));
-
- cinfo = g_malloc0(sizeof(*cinfo));
-
- CAMEL_TRY {
- /* this should be string not astring */
- camel_imapp_stream_astring(is, &token);
- type = alloca(strlen(token)+1);
- strcpy(type, token);
- camel_imapp_stream_astring(is, &token);
- cinfo->type = camel_content_type_new(type, token);
- imap_parse_param_list(is, &cinfo->type->params);
-
- /* body_fld_id ::= nstring */
- camel_imapp_stream_nstring(is, &token);
- cinfo->id = g_strdup(token);
-
- /* body_fld_desc ::= nstring */
- camel_imapp_stream_nstring(is, &token);
- cinfo->description = g_strdup(token);
-
- /* body_fld_enc ::= (<"> ("7BIT" / "8BIT" / "BINARY" / "BASE64"/
- "QUOTED-PRINTABLE") <">) / string */
- camel_imapp_stream_astring(is, &token);
- cinfo->encoding = g_strdup(token);
-
- /* body_fld_octets ::= number */
- cinfo->size = camel_imapp_stream_number(is);
- } CAMEL_CATCH(ex) {
- imap_free_body(cinfo);
- camel_exception_throw_ex(ex);
- } CAMEL_DONE;
-
- return cinfo;
-}
-
-struct _camel_header_address *
-imap_parse_address_list(CamelIMAPPStream *is)
-/* throws PARSE,IO exception */
-{
- int tok, len;
- unsigned char *token, *host, *mbox;
- struct _camel_header_address *list = NULL;
-
- /* "(" 1*address ")" / nil */
-
- CAMEL_TRY {
- tok = camel_imapp_stream_token(is, &token, &len);
- if (tok == '(') {
- while (1) {
- struct _camel_header_address *addr, *group = NULL;
-
- /* address ::= "(" addr_name SPACE addr_adl SPACE addr_mailbox
- SPACE addr_host ")" */
- tok = camel_imapp_stream_token(is, &token, &len);
- if (tok == ')')
- break;
- if (tok != '(')
- camel_exception_throw(1, "missing '(' for address");
-
- addr = camel_header_address_new();
- addr->type = HEADER_ADDRESS_NAME;
- tok = camel_imapp_stream_nstring(is, &token);
- addr->name = g_strdup(token);
- /* we ignore the route, nobody uses it in the real world */
- tok = camel_imapp_stream_nstring(is, &token);
-
- /* [RFC-822] group syntax is indicated by a special
- form of address structure in which the host name
- field is NIL. If the mailbox name field is also
- NIL, this is an end of group marker (semi-colon in
- RFC 822 syntax). If the mailbox name field is
- non-NIL, this is a start of group marker, and the
- mailbox name field holds the group name phrase. */
-
- tok = camel_imapp_stream_nstring(is, &mbox);
- mbox = g_strdup(mbox);
- tok = camel_imapp_stream_nstring(is, &host);
- if (host == NULL) {
- if (mbox == NULL) {
- group = NULL;
- } else {
- d(printf("adding group '%s'\n", mbox));
- g_free(addr->name);
- addr->name = mbox;
- addr->type = HEADER_ADDRESS_GROUP;
- camel_header_address_list_append(&list, addr);
- group = addr;
- }
- } else {
- addr->v.addr = g_strdup_printf("%s%s%s", mbox?(char *)mbox:"", host?"@":"", host?(char *)host:"");
- g_free(mbox);
- d(printf("adding address '%s'\n", addr->v.addr));
- if (group != NULL)
- camel_header_address_add_member(group, addr);
- else
- camel_header_address_list_append(&list, addr);
- }
- do {
- tok = camel_imapp_stream_token(is, &token, &len);
- } while (tok != ')');
- }
- } else {
- d(printf("empty, nil '%s'\n", token));
- }
- } CAMEL_CATCH(ex) {
- camel_header_address_list_clear(&list);
- camel_exception_throw_ex(ex);
- } CAMEL_DONE;
-
- return list;
-}
-
-struct _CamelMessageInfo *
-imap_parse_envelope(CamelIMAPPStream *is)
-{
- int tok, len;
- unsigned char *token;
- struct _camel_header_address *addr, *addr_from;
- char *addrstr;
- struct _CamelMessageInfo *minfo;
-
- /* envelope ::= "(" env_date SPACE env_subject SPACE env_from
- SPACE env_sender SPACE env_reply_to SPACE env_to
- SPACE env_cc SPACE env_bcc SPACE env_in_reply_to
- SPACE env_message_id ")" */
-
- p(printf("envelope\n"));
-
- minfo = camel_message_info_new();
-
- CAMEL_TRY {
- tok = camel_imapp_stream_token(is, &token, &len);
- if (tok != '(')
- camel_exception_throw(1, "envelope: expecting '('");
-
- /* env_date ::= nstring */
- camel_imapp_stream_nstring(is, &token);
- minfo->date_sent = camel_header_decode_date(token, NULL);
-
- /* env_subject ::= nstring */
- tok = camel_imapp_stream_nstring(is, &token);
- /* DUH: this free's it!: camel_message_info_set_subject(minfo, token); */
- e_poolv_set(minfo->strings, CAMEL_MESSAGE_INFO_SUBJECT, token, FALSE);
-
- /* we merge from/sender into from, append should probably merge more smartly? */
-
- /* env_from ::= "(" 1*address ")" / nil */
- addr_from = imap_parse_address_list(is);
-
- /* env_sender ::= "(" 1*address ")" / nil */
- addr = imap_parse_address_list(is);
- if (addr_from) {
- camel_header_address_list_clear(&addr);
-#if 0
- if (addr)
- camel_header_address_list_append_list(&addr_from, &addr);
-#endif
- } else {
- if (addr)
- addr_from = addr;
- }
-
- if (addr_from) {
- addrstr = camel_header_address_list_format(addr_from);
- camel_message_info_set_from(minfo, addrstr);
- camel_header_address_list_clear(&addr_from);
- }
-
- /* we dont keep reply_to */
-
- /* env_reply_to ::= "(" 1*address ")" / nil */
- addr = imap_parse_address_list(is);
- camel_header_address_list_clear(&addr);
-
- /* env_to ::= "(" 1*address ")" / nil */
- addr = imap_parse_address_list(is);
- if (addr) {
- addrstr = camel_header_address_list_format(addr);
- camel_message_info_set_to(minfo, addrstr);
- camel_header_address_list_clear(&addr);
- }
-
- /* env_cc ::= "(" 1*address ")" / nil */
- addr = imap_parse_address_list(is);
- if (addr) {
- addrstr = camel_header_address_list_format(addr);
- camel_message_info_set_cc(minfo, addrstr);
- camel_header_address_list_clear(&addr);
- }
-
- /* we dont keep bcc either */
-
- /* env_bcc ::= "(" 1*address ")" / nil */
- addr = imap_parse_address_list(is);
- camel_header_address_list_clear(&addr);
-
- /* FIXME: need to put in-reply-to into references hash list */
-
- /* env_in_reply_to ::= nstring */
- tok = camel_imapp_stream_nstring(is, &token);
-
- /* FIXME: need to put message-id into message-id hash */
-
- /* env_message_id ::= nstring */
- tok = camel_imapp_stream_nstring(is, &token);
-
- tok = camel_imapp_stream_token(is, &token, &len);
- if (tok != ')')
- camel_exception_throw(1, "expecting ')'");
- } CAMEL_CATCH(ex) {
- camel_message_info_free(minfo);
- camel_exception_throw_ex(ex);
- } CAMEL_DONE;
-
- return minfo;
-}
-
-struct _CamelMessageContentInfo *
-imap_parse_body(CamelIMAPPStream *is)
-{
- int tok, len;
- unsigned char *token;
- struct _CamelMessageContentInfo * volatile cinfo = NULL;
- struct _CamelMessageContentInfo *subinfo, *last;
- struct _CamelContentDisposition * volatile dinfo = NULL;
- struct _CamelMessageInfo * volatile minfo = NULL;
-
- /* body ::= "(" body_type_1part / body_type_mpart ")" */
-
- p(printf("body\n"));
-
- CAMEL_TRY {
- tok = camel_imapp_stream_token(is, &token, &len);
- if (tok != '(')
- camel_exception_throw(1, "body: expecting '('");
-
- /* 1*body (optional for multiparts) */
- tok = camel_imapp_stream_token(is, &token, &len);
- camel_imapp_stream_ungettoken(is, tok, token, len);
- if (tok == '(') {
- /* body_type_mpart ::= 1*body SPACE media_subtype
- [SPACE body_ext_mpart] */
-
- cinfo = g_malloc0(sizeof(*cinfo));
- last = (struct _CamelMessageContentInfo *)&cinfo->childs;
- do {
- subinfo = imap_parse_body(is);
- last->next = subinfo;
- last = subinfo;
- subinfo->parent = cinfo;
- tok = camel_imapp_stream_token(is, &token, &len);
- camel_imapp_stream_ungettoken(is, tok, token, len);
- } while (tok == '(');
-
- d(printf("media_subtype\n"));
-
- camel_imapp_stream_astring(is, &token);
- cinfo->type = camel_content_type_new("multipart", token);
-
- /* body_ext_mpart ::= body_fld_param
- [SPACE body_fld_dsp SPACE body_fld_lang
- [SPACE 1#body_extension]]
- ;; MUST NOT be returned on non-extensible
- ;; "BODY" fetch */
-
- d(printf("body_ext_mpart\n"));
-
- tok = camel_imapp_stream_token(is, &token, &len);
- camel_imapp_stream_ungettoken(is, tok, token, len);
- if (tok == '(') {
- imap_parse_param_list(is, &cinfo->type->params);
-
- /* body_fld_dsp ::= "(" string SPACE body_fld_param ")" / nil */
-
- tok = camel_imapp_stream_token(is, &token, &len);
- camel_imapp_stream_ungettoken(is, tok, token, len);
- if (tok == '(' || tok == IMAP_TOK_TOKEN) {
- dinfo = imap_parse_ext_optional(is);
- /* other extension fields?, soaked up below */
- } else {
- camel_imapp_stream_ungettoken(is, tok, token, len);
- }
- }
- } else {
- /* body_type_1part ::= (body_type_basic / body_type_msg / body_type_text)
- [SPACE body_ext_1part]
-
- body_type_basic ::= media_basic SPACE body_fields
- body_type_text ::= media_text SPACE body_fields SPACE body_fld_lines
- body_type_msg ::= media_message SPACE body_fields SPACE envelope
- SPACE body SPACE body_fld_lines */
-
- d(printf("Single part body\n"));
-
- cinfo = imap_parse_body_fields(is);
-
- d(printf("envelope?\n"));
-
- /* do we have an envelope following */
- tok = camel_imapp_stream_token(is, &token, &len);
- camel_imapp_stream_ungettoken(is, tok, token, len);
- if (tok == '(') {
- /* what do we do with the envelope?? */
- minfo = imap_parse_envelope(is);
- /* what do we do with the message content info?? */
- minfo->content = imap_parse_body(is);
- camel_message_info_free(minfo);
- minfo = NULL;
- d(printf("Scanned envelope - what do i do with it?\n"));
- }
-
- d(printf("fld_lines?\n"));
-
- /* do we have fld_lines following? */
- tok = camel_imapp_stream_token(is, &token, &len);
- if (tok == IMAP_TOK_INT) {
- d(printf("field lines: %s\n", token));
- tok = camel_imapp_stream_token(is, &token, &len);
- }
- camel_imapp_stream_ungettoken(is, tok, token, len);
-
- /* body_ext_1part ::= body_fld_md5 [SPACE body_fld_dsp
- [SPACE body_fld_lang
- [SPACE 1#body_extension]]]
- ;; MUST NOT be returned on non-extensible
- ;; "BODY" fetch */
-
- d(printf("extension data?\n"));
-
- if (tok != ')') {
- camel_imapp_stream_nstring(is, &token);
-
- d(printf("md5: %s\n", token?(char *)token:"NIL"));
-
- /* body_fld_dsp ::= "(" string SPACE body_fld_param ")" / nil */
-
- tok = camel_imapp_stream_token(is, &token, &len);
- camel_imapp_stream_ungettoken(is, tok, token, len);
- if (tok == '(' || tok == IMAP_TOK_TOKEN) {
- dinfo = imap_parse_ext_optional(is);
- /* then other extension fields, soaked up below */
- }
- }
- }
-
- /* soak up any other extension fields that may be present */
- /* there should only be simple tokens, no lists */
- do {
- tok = camel_imapp_stream_token(is, &token, &len);
- if (tok != ')')
- d(printf("Dropping extension data '%s'\n", token));
- } while (tok != ')');
- } CAMEL_CATCH(ex) {
- if (cinfo)
- imap_free_body(cinfo);
- if (dinfo)
- camel_content_disposition_unref(dinfo);
- if (minfo)
- camel_message_info_free(minfo);
- camel_exception_throw_ex(ex);
- } CAMEL_DONE;
-
- /* FIXME: do something with the disposition, currently we have no way to pass it out? */
- if (dinfo)
- camel_content_disposition_unref(dinfo);
-
- return cinfo;
-}
-
-char *
-imap_parse_section(CamelIMAPPStream *is)
-{
- int tok, len;
- unsigned char *token;
- char * volatile section = NULL;
-
- /* currently we only return the part within the [section] specifier
- any header fields are parsed, but dropped */
-
- /*
- section ::= "[" [section_text /
- (nz_number *["." nz_number] ["." (section_text / "MIME")])] "]"
-
- section_text ::= "HEADER" / "HEADER.FIELDS" [".NOT"]
- SPACE header_list / "TEXT"
- */
-
- CAMEL_TRY {
- tok = camel_imapp_stream_token(is, &token, &len);
- if (tok != '[')
- camel_exception_throw(1, "section: expecting '['");
-
- tok = camel_imapp_stream_token(is, &token, &len);
- if (tok == IMAP_TOK_INT || tok == IMAP_TOK_TOKEN)
- section = g_strdup(token);
- else if (tok == ']') {
- section = g_strdup("");
- camel_imapp_stream_ungettoken(is, tok, token, len);
- } else
- camel_exception_throw(1, "section: expecting token");
-
- /* header_list ::= "(" 1#header_fld_name ")"
- header_fld_name ::= astring */
-
- /* we dont need the header specifiers */
- tok = camel_imapp_stream_token(is, &token, &len);
- if (tok == '(') {
- do {
- tok = camel_imapp_stream_token(is, &token, &len);
- if (tok == IMAP_TOK_STRING || tok == IMAP_TOK_TOKEN || tok == IMAP_TOK_INT) {
- /* ?do something? */
- } else if (tok != ')')
- camel_exception_throw(1, "section: header fields: expecting string");
- } while (tok != ')');
- tok = camel_imapp_stream_token(is, &token, &len);
- }
-
- if (tok != ']')
- camel_exception_throw(1, "section: expecting ']'");
- } CAMEL_CATCH(ex) {
- g_free(section);
- camel_exception_throw_ex(ex);
- } CAMEL_DONE;
-
- return section;
-}
-
-void
-imap_free_fetch(struct _fetch_info *finfo)
-{
- if (finfo == NULL)
- return;
-
- if (finfo->body)
- camel_object_unref((CamelObject *)finfo->body);
- if (finfo->text)
- camel_object_unref((CamelObject *)finfo->text);
- if (finfo->header)
- camel_object_unref((CamelObject *)finfo->header);
- if (finfo->minfo)
- camel_message_info_free(finfo->minfo);
- if (finfo->cinfo)
- imap_free_body(finfo->cinfo);
- g_free(finfo->date);
- g_free(finfo->section);
- g_free(finfo->uid);
- g_free(finfo);
-}
-
-extern void camel_content_info_dump(CamelMessageContentInfo *ci, int depth);
-extern void camel_message_info_dump(CamelMessageInfo *mi);
-
-#include <camel/camel-stream-fs.h>
-
-/* debug, dump one out */
-void
-imap_dump_fetch(struct _fetch_info *finfo)
-{
- CamelStream *sout;
- int fd;
-
- printf("Fetch info:\n");
- if (finfo == NULL) {
- printf("Empty\n");
- return;
- }
-
- fd = dup(1);
- sout = camel_stream_fs_new_with_fd(fd);
- if (finfo->body) {
- camel_stream_printf(sout, "Body content:\n");
- camel_stream_write_to_stream(finfo->body, sout);
- }
- if (finfo->text) {
- camel_stream_printf(sout, "Text content:\n");
- camel_stream_write_to_stream(finfo->text, sout);
- }
- if (finfo->header) {
- camel_stream_printf(sout, "Header content:\n");
- camel_stream_write_to_stream(finfo->header, sout);
- }
- if (finfo->minfo) {
- camel_stream_printf(sout, "Message Info:\n");
- camel_message_info_dump(finfo->minfo);
- }
- if (finfo->cinfo) {
- camel_stream_printf(sout, "Content Info:\n");
- camel_content_info_dump(finfo->cinfo, 0);
- }
- if (finfo->got & FETCH_SIZE)
- camel_stream_printf(sout, "Size: %d\n", (int)finfo->size);
- if (finfo->got & FETCH_BODY)
- camel_stream_printf(sout, "Offset: %d\n", (int)finfo->offset);
- if (finfo->got & FETCH_FLAGS)
- camel_stream_printf(sout, "Flags: %08x\n", (int)finfo->flags);
- if (finfo->date)
- camel_stream_printf(sout, "Date: '%s'\n", finfo->date);
- if (finfo->section)
- camel_stream_printf(sout, "Section: '%s'\n", finfo->section);
- if (finfo->date)
- camel_stream_printf(sout, "UID: '%s'\n", finfo->uid);
- camel_object_unref((CamelObject *)sout);
-}
-
-struct _fetch_info *
-imap_parse_fetch(CamelIMAPPStream *is)
-{
- int tok, len;
- unsigned char *token, *p, c;
- struct _fetch_info *finfo;
-
- finfo = g_malloc0(sizeof(*finfo));
-
- CAMEL_TRY {
- tok = camel_imapp_stream_token(is, &token, &len);
- if (tok != '(')
- camel_exception_throw(1, "fetch: expecting '('");
-
- while ( (tok = camel_imapp_stream_token(is, &token, &len)) == IMAP_TOK_TOKEN ) {
-
- p = token;
- while ((c=*p))
- *p++ = toupper(c);
-
- switch(imap_tokenise(token, len)) {
- case IMAP_ENVELOPE:
- finfo->minfo = imap_parse_envelope(is);
- finfo->got |= FETCH_MINFO;
- break;
- case IMAP_FLAGS:
- imap_parse_flags(is, &finfo->flags);
- finfo->got |= FETCH_FLAGS;
- break;
- case IMAP_INTERNALDATE:
- camel_imapp_stream_nstring(is, &token);
- /* TODO: convert to camel format? */
- finfo->date = g_strdup(token);
- finfo->got |= FETCH_DATE;
- break;
- case IMAP_RFC822_HEADER:
- camel_imapp_stream_nstring_stream(is, &finfo->header);
- finfo->got |= FETCH_HEADER;
- break;
- case IMAP_RFC822_TEXT:
- camel_imapp_stream_nstring_stream(is, &finfo->text);
- finfo->got |= FETCH_TEXT;
- break;
- case IMAP_RFC822_SIZE:
- finfo->size = camel_imapp_stream_number(is);
- finfo->got |= FETCH_SIZE;
- break;
- case IMAP_BODYSTRUCTURE:
- finfo->cinfo = imap_parse_body(is);
- finfo->got |= FETCH_CINFO;
- break;
- case IMAP_BODY:
- tok = camel_imapp_stream_token(is, &token, &len);
- camel_imapp_stream_ungettoken(is, tok, token, len);
- if (tok == '(') {
- finfo->cinfo = imap_parse_body(is);
- finfo->got |= FETCH_CINFO;
- } else if (tok == '[') {
- finfo->section = imap_parse_section(is);
- finfo->got |= FETCH_SECTION;
- tok = camel_imapp_stream_token(is, &token, &len);
- if (token[0] == '<') {
- finfo->offset = strtoul(token+1, NULL, 10);
- } else {
- camel_imapp_stream_ungettoken(is, tok, token, len);
- }
- camel_imapp_stream_nstring_stream(is, &finfo->body);
- finfo->got |= FETCH_BODY;
- } else {
- camel_exception_throw(1, "unknown body response");
- }
- break;
- case IMAP_UID:
- tok = camel_imapp_stream_token(is, &token, &len);
- if (tok != IMAP_TOK_INT)
- camel_exception_throw(1, "uid not integer");
- finfo->uid = g_strdup(token);
- finfo->got |= FETCH_UID;
- break;
- default:
- camel_exception_throw(1, "unknown body response");
- }
- }
-
- if (tok != ')')
- camel_exception_throw(1, "missing closing ')' on fetch response");
- } CAMEL_CATCH(ex) {
- imap_free_fetch(finfo);
- camel_exception_throw_ex(ex);
- } CAMEL_DONE;
-
- return finfo;
-}
-
-/* rfc 2060 section 7.1 Status Responses */
-/* shoudl this start after [ or before the [? token_unget anyone? */
-struct _status_info *
-imap_parse_status(CamelIMAPPStream *is)
-{
- int tok, len;
- unsigned char *token;
- struct _status_info *sinfo;
-
- sinfo = g_malloc0(sizeof(*sinfo));
-
- CAMEL_TRY {
- camel_imapp_stream_atom(is, &token, &len);
-
- /*
- resp_cond_auth ::= ("OK" / "PREAUTH") SPACE resp_text
- ;; Authentication condition
-
- resp_cond_bye ::= "BYE" SPACE resp_text
-
- resp_cond_state ::= ("OK" / "NO" / "BAD") SPACE resp_text
- ;; Status condition
- */
-
- sinfo->result = imap_tokenise(token, len);
- switch (sinfo->result) {
- case IMAP_OK:
- case IMAP_NO:
- case IMAP_BAD:
- case IMAP_PREAUTH:
- case IMAP_BYE:
- break;
- default:
- camel_exception_throw(1, "expecting OK/NO/BAD");
- }
-
- tok = camel_imapp_stream_token(is, &token, &len);
- if (tok == '[') {
- camel_imapp_stream_atom(is, &token, &len);
- sinfo->condition = imap_tokenise(token, len);
-
- /* parse any details */
- switch (sinfo->condition) {
- case IMAP_READ_ONLY:
- case IMAP_READ_WRITE:
- case IMAP_ALERT:
- case IMAP_PARSE:
- case IMAP_TRYCREATE:
- break;
- case IMAP_NEWNAME:
- /* the rfc doesn't specify the bnf for this */
- camel_imapp_stream_astring(is, &token);
- sinfo->u.newname.oldname = g_strdup(token);
- camel_imapp_stream_astring(is, &token);
- sinfo->u.newname.newname = g_strdup(token);
- break;
- case IMAP_PERMANENTFLAGS:
- imap_parse_flags(is, &sinfo->u.permanentflags);
- break;
- case IMAP_UIDVALIDITY:
- sinfo->u.uidvalidity = camel_imapp_stream_number(is);
- break;
- case IMAP_UNSEEN:
- sinfo->u.unseen = camel_imapp_stream_number(is);
- break;
- default:
- sinfo->condition = IMAP_UNKNOWN;
- printf("Got unknown response code: %s: ignored\n", token);
- }
-
- /* ignore anything we dont know about */
- do {
- tok = camel_imapp_stream_token(is, &token, &len);
- if (tok == '\n')
- camel_exception_throw(1, "server response truncated");
- } while (tok != ']');
- } else {
- camel_imapp_stream_ungettoken(is, tok, token, len);
- }
-
- /* and take the human readable response */
- camel_imapp_stream_text(is, (unsigned char **)&sinfo->text);
- } CAMEL_CATCH(ex) {
- imap_free_status(sinfo);
- camel_exception_throw_ex(ex);
- } CAMEL_DONE;
-
- return sinfo;
-}
-
-void
-imap_free_status(struct _status_info *sinfo)
-{
- if (sinfo == NULL)
- return;
-
- switch (sinfo->condition) {
- case IMAP_NEWNAME:
- g_free(sinfo->u.newname.oldname);
- g_free(sinfo->u.newname.newname);
- default:
- break;
- }
-
- g_free(sinfo->text);
- g_free(sinfo);
-}
-
-/* FIXME: use tokeniser? */
-/* FIXME: real flags */
-static struct {
- char *name;
- guint32 flag;
-} list_flag_table[] = {
- { "\\NOINFERIORS", CAMEL_FOLDER_NOINFERIORS },
- { "\\NOSELECT", CAMEL_FOLDER_NOSELECT },
- { "\\MARKED", 1<<8 },
- { "\\UNMARKED", 1<<9 },
-};
-
-struct _list_info *
-imap_parse_list(CamelIMAPPStream *is)
-/* throws io, parse */
-{
- int tok, len, i;
- unsigned char *token, *p, c;
- struct _list_info * volatile linfo;
-
- linfo = g_malloc0(sizeof(*linfo));
-
- CAMEL_TRY {
- /* mailbox_list ::= "(" #("\Marked" / "\Noinferiors" /
- "\Noselect" / "\Unmarked" / flag_extension) ")"
- SPACE (<"> QUOTED_CHAR <"> / nil) SPACE mailbox */
-
- tok = camel_imapp_stream_token(is, &token, &len);
- if (tok != '(')
- camel_exception_throw(1, "list: expecting '('");
-
- while ( (tok = camel_imapp_stream_token(is, &token, &len)) != ')' ) {
- if (tok == IMAP_TOK_STRING || tok == IMAP_TOK_TOKEN) {
- p = token;
- while ((c=*p))
- *p++ = toupper(c);
- for (i=0;i<(int)(sizeof(list_flag_table)/sizeof(list_flag_table[0]));i++)
- if (!strcmp(token, list_flag_table[i].name))
- linfo->flags |= list_flag_table[i].flag;
- } else {
- camel_exception_throw(1, "list: expecting flag or ')'");
- }
- }
-
- camel_imapp_stream_nstring(is, &token);
- linfo->separator = token?*token:0;
- camel_imapp_stream_astring(is, &token);
- linfo->name = g_strdup(token);
- } CAMEL_CATCH(ex) {
- imap_free_list(linfo);
- camel_exception_throw_ex(ex);
- } CAMEL_DONE;
-
- return linfo;
-}
-
-char *
-imapp_list_get_path(struct _list_info *li)
-{
- char *path, *p;
- int c;
- const char *f;
-
- if (li->separator != 0 && li->separator != '/') {
- p = path = alloca(strlen(li->name)*3+1);
- f = li->name;
- while ( (c = *f++ & 0xff) ) {
- if (c == li->separator)
- *p++ = '/';
- else if (c == '/' || c == '%')
- p += sprintf(p, "%%%02X", c);
- else
- *p++ = c;
- }
- *p = 0;
- } else
- path = li->name;
-
- return camel_utf7_utf8(path);
-}
-
-void
-imap_free_list(struct _list_info *linfo)
-{
- if (linfo) {
- g_free(linfo->name);
- g_free(linfo);
- }
-}
-
-
-/* ********************************************************************** */
-/* utility functions */
-
-/* should the rest of imapp-utils go into imapp-parse? */
-
-/* this creates a uid (or sequence number) set directly into the command,
- optionally breaking it into smaller chunks */
-
-void
-imapp_uidset_init(struct _uidset_state *ss, CamelIMAPPEngine *ie)
-{
- ss->ie = ie;
- ss->len = 0;
- ss->start = 0;
- ss->last = 0;
-}
-
-int
-imapp_uidset_done(struct _uidset_state *ss, CamelIMAPPCommand *ic)
-{
- int ret = 0;
-
- if (ss->last != 0 && ss->last != ss->start) {
- camel_imapp_engine_command_add(ss->ie, ic, ":%d", ss->last);
- printf(":%d", ss->last);
- }
-
- ret = ss->last != 0;
-
- ss->start = 0;
- ss->last = 0;
- ss->len = 0;
-
- return ret;
-}
-
-int
-imapp_uidset_add(struct _uidset_state *ss, CamelIMAPPCommand *ic, const char *uid)
-{
- guint32 uidn;
-
- uidn = strtoul(uid, NULL, 10);
- if (uidn == 0)
- return -1;
-
- if (ss->last == 0) {
- camel_imapp_engine_command_add(ss->ie, ic, "%d", uidn);
- printf("%d", uidn);
- ss->len ++;
- ss->start = uidn;
- } else {
- if (ss->last != uidn-1) {
- if (ss->last == ss->start) {
- camel_imapp_engine_command_add(ss->ie, ic, ",%d", uidn);
- printf(",%d", uidn);
- ss->len ++;
- } else {
- camel_imapp_engine_command_add(ss->ie, ic, ":%d,%d", ss->last, uidn);
- printf(":%d,%d", ss->last, uidn);
- ss->len+=2;
- }
- ss->start = uidn;
- }
- }
-
- ss->last = uidn;
-
- if (ss->len > 10) {
- imapp_uidset_done(ss, ic);
- return 1;
- }
-
- return 0;
-}
diff --git a/camel/providers/imapp/camel-imapp-utils.h b/camel/providers/imapp/camel-imapp-utils.h
deleted file mode 100644
index e0974bdc96..0000000000
--- a/camel/providers/imapp/camel-imapp-utils.h
+++ /dev/null
@@ -1,145 +0,0 @@
-
-#ifndef _CAMEL_IMAPP_UTILS_H
-#define _CAMEL_IMAPP_UTILS_H
-
-#include <camel/camel-mime-utils.h>
-
-/* FIXME: the enum should be split up into logical groups, so that testing
- can be done more accurately? */
-
-/* list of strings we know about that can be *quickly* tokenised */
-enum _imap_id {
- IMAP_UNKNOWN = 0,
- IMAP_ALERT,
- IMAP_BYE,
- IMAP_BAD,
- IMAP_NO,
- IMAP_OK,
- IMAP_PREAUTH,
- IMAP_NEWNAME,
- IMAP_PARSE,
- IMAP_PERMANENTFLAGS,
- IMAP_READ_ONLY,
- IMAP_READ_WRITE,
- IMAP_TRYCREATE,
- IMAP_UIDVALIDITY,
- IMAP_UNSEEN,
- IMAP_ENVELOPE,
- IMAP_FLAGS,
- IMAP_INTERNALDATE,
- IMAP_RFC822_HEADER,
- IMAP_RFC822_TEXT,
- IMAP_RFC822_SIZE,
- IMAP_BODYSTRUCTURE,
- IMAP_BODY,
- IMAP_UID,
-};
-
-/* str MUST be in upper case, tokenised using gperf function */
-enum _imap_id imap_tokenise(register const char *str, register unsigned int len);
-
-/* this flag should be part of imapfoldersummary */
-enum {
- CAMEL_IMAPP_MESSAGE_RECENT = (1<<8),
-};
-
-/* ********************************************************************** */
-void imap_parse_flags(CamelIMAPPStream *stream, guint32 *flagsp) /* IO,PARSE */;
-void imap_write_flags(CamelStream *stream, guint32 flags) /* IO */;
-
-/* ********************************************************************** */
-void imap_parse_param_list(CamelIMAPPStream *is, struct _camel_header_param **plist) /* IO,PARSE */;
-struct _CamelContentDisposition *imap_parse_ext_optional(CamelIMAPPStream *is) /* IO,PARSE */;
-struct _CamelMessageContentInfo *imap_parse_body_fields(CamelIMAPPStream *is) /* IO,PARSE */;
-struct _camel_header_address *imap_parse_address_list(CamelIMAPPStream *is) /* IO,PARSE */;
-struct _CamelMessageInfo *imap_parse_envelope(CamelIMAPPStream *is) /* IO, PARSE */;
-struct _CamelMessageContentInfo *imap_parse_body(CamelIMAPPStream *is) /* IO,PARSE */;
-char *imap_parse_section(CamelIMAPPStream *is) /* IO,PARSE */;
-void imap_free_body(struct _CamelMessageContentInfo *cinfo);
-
-/* ********************************************************************** */
-/* all the possible stuff we might get from a fetch request */
-/* this assumes the caller/server doesn't send any one of these types twice */
-struct _fetch_info {
- guint32 got; /* what we got, see below */
- CamelStream *body; /* BODY[.*](<.*>)? */
- CamelStream *text; /* RFC822.TEXT */
- CamelStream *header; /* RFC822.HEADER */
- CamelMessageInfo *minfo; /* ENVELOPE */
- CamelMessageContentInfo *cinfo; /* BODYSTRUCTURE,BODY */
- guint32 size; /* RFC822.SIZE */
- guint32 offset; /* start offset of a BODY[]<offset.length> request */
- guint32 flags; /* FLAGS */
- char *date; /* INTERNALDATE */
- char *section; /* section for a BODY[section] request */
- char *uid; /* UID */
-};
-
-#define FETCH_BODY (1<<0)
-#define FETCH_TEXT (1<<1)
-#define FETCH_HEADER (1<<2)
-#define FETCH_MINFO (1<<3)
-#define FETCH_CINFO (1<<4)
-#define FETCH_SIZE (1<<5)
-#define FETCH_OFFSET (1<<6)
-#define FETCH_FLAGS (1<<7)
-#define FETCH_DATE (1<<8)
-#define FETCH_SECTION (1<<9)
-#define FETCH_UID (1<<10)
-
-struct _fetch_info *imap_parse_fetch(CamelIMAPPStream *is);
-void imap_free_fetch(struct _fetch_info *finfo);
-void imap_dump_fetch(struct _fetch_info *finfo);
-
-/* ********************************************************************** */
-
-struct _status_info {
- enum _imap_id result; /* ok/no/bad/preauth only */
- enum _imap_id condition; /* read-only/read-write/alert/parse/trycreate/newname/permanentflags/uidvalidity/unseen */
-
- union {
- struct {
- char *oldname;
- char *newname;
- } newname;
- guint32 permanentflags;
- guint32 uidvalidity;
- guint32 unseen;
- } u;
-
- char *text;
-};
-
-struct _status_info *imap_parse_status(CamelIMAPPStream *is);
-void imap_free_status(struct _status_info *sinfo);
-
-/* ********************************************************************** */
-
-/* should this just return a FolderInfo?
- should this just return the name & flags & separator by reference? */
-struct _list_info {
- guint32 flags:24;
- char separator;
- char *name;
-};
-
-struct _list_info *imap_parse_list(CamelIMAPPStream *is);
-char *imapp_list_get_path(struct _list_info *li);
-void imap_free_list(struct _list_info *linfo);
-
-/* ********************************************************************** */
-
-struct _uidset_state {
- struct _CamelIMAPPEngine *ie;
- int len;
- guint32 start;
- guint32 last;
-};
-
-struct _CamelIMAPPEngine;
-struct _CamelIMAPPCommand;
-void imapp_uidset_init(struct _uidset_state *ss, struct _CamelIMAPPEngine *ie);
-int imapp_uidset_done(struct _uidset_state *ss, struct _CamelIMAPPCommand *ic);
-int imapp_uidset_add(struct _uidset_state *ss, struct _CamelIMAPPCommand *ic, const char *uid);
-
-#endif
diff --git a/camel/providers/imapp/libcamelimapp.urls b/camel/providers/imapp/libcamelimapp.urls
deleted file mode 100644
index aad1347834..0000000000
--- a/camel/providers/imapp/libcamelimapp.urls
+++ /dev/null
@@ -1 +0,0 @@
-imapp
diff --git a/camel/providers/local/.cvsignore b/camel/providers/local/.cvsignore
deleted file mode 100644
index 3fa8afaa38..0000000000
--- a/camel/providers/local/.cvsignore
+++ /dev/null
@@ -1,11 +0,0 @@
-.deps
-Makefile
-Makefile.in
-.libs
-.deps
-*.lo
-*.la
-*.bb
-*.bbg
-*.da
-*.gcov
diff --git a/camel/providers/local/Makefile.am b/camel/providers/local/Makefile.am
deleted file mode 100644
index ad07472e85..0000000000
--- a/camel/providers/local/Makefile.am
+++ /dev/null
@@ -1,61 +0,0 @@
-## Process this file with automake to produce Makefile.in
-
-libcamellocalincludedir = $(privincludedir)/camel
-
-camel_provider_LTLIBRARIES = libcamellocal.la
-camel_provider_DATA = libcamellocal.urls
-
-INCLUDES = -I.. \
- -I$(srcdir)/.. \
- -I$(top_srcdir)/camel \
- -I$(top_srcdir)/intl \
- -I$(top_srcdir)/e-util \
- -I$(top_srcdir) \
- $(CAMEL_CFLAGS) \
- $(GNOME_INCLUDEDIR) \
- $(GTK_INCLUDEDIR) \
- -DG_LOG_DOMAIN=\"camel-local-provider\"
-
-libcamellocal_la_SOURCES = \
- camel-local-folder.c \
- camel-local-store.c \
- camel-local-summary.c \
- camel-local-provider.c \
- camel-mh-folder.c \
- camel-mh-store.c \
- camel-mh-summary.c \
- camel-mbox-folder.c \
- camel-mbox-store.c \
- camel-mbox-summary.c \
- camel-maildir-folder.c \
- camel-maildir-store.c \
- camel-maildir-summary.c \
- camel-spool-folder.c \
- camel-spool-store.c \
- camel-spool-summary.c
-
-libcamellocalinclude_HEADERS = \
- camel-local-folder.h \
- camel-local-store.h \
- camel-local-summary.h \
- camel-mh-folder.h \
- camel-mh-store.h \
- camel-mh-summary.h \
- camel-mbox-folder.h \
- camel-mbox-store.h \
- camel-mbox-summary.h \
- camel-maildir-folder.h \
- camel-maildir-store.h \
- camel-maildir-summary.h \
- camel-spool-folder.h \
- camel-spool-store.h \
- camel-spool-summary.h
-
-noinst_HEADERS = \
- camel-local-private.h
-
-libcamellocal_la_LDFLAGS = -avoid-version -module
-
-libcamellocal_la_LIBADD = $(top_builddir)/e-util/libeutil.la
-
-EXTRA_DIST = libcamellocal.urls
diff --git a/camel/providers/local/camel-local-folder.c b/camel/providers/local/camel-local-folder.c
deleted file mode 100644
index 5bf2142f35..0000000000
--- a/camel/providers/local/camel-local-folder.c
+++ /dev/null
@@ -1,646 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * Copyright 1999-2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdlib.h>
-#include <limits.h>
-#include <sys/types.h>
-#include <dirent.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <errno.h>
-#include <string.h>
-#include <fcntl.h>
-
-#ifndef _POSIX_PATH_MAX
-#include <posix1_lim.h>
-#endif
-
-#include "camel-local-folder.h"
-#include "camel-local-store.h"
-#include "camel-stream-fs.h"
-#include "camel-local-summary.h"
-#include "camel-data-wrapper.h"
-#include "camel-mime-message.h"
-#include "camel-stream-filter.h"
-#include "camel-mime-filter-from.h"
-#include "camel-exception.h"
-
-#include "camel-local-private.h"
-
-#include "camel-text-index.h"
-
-#define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))*/
-
-#ifndef PATH_MAX
-#define PATH_MAX _POSIX_PATH_MAX
-#endif
-
-static CamelFolderClass *parent_class;
-static GSList *local_folder_properties;
-
-/* Returns the class for a CamelLocalFolder */
-#define CLOCALF_CLASS(so) CAMEL_LOCAL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-#define CF_CLASS(so) CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-#define CLOCALS_CLASS(so) CAMEL_STORE_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-
-static int local_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args);
-static int local_setv(CamelObject *object, CamelException *ex, CamelArgV *args);
-
-static int local_lock(CamelLocalFolder *lf, CamelLockType type, CamelException *ex);
-static void local_unlock(CamelLocalFolder *lf);
-
-static char *local_get_full_path (const char *toplevel_dir, const char *full_name);
-static char *local_get_meta_path (const char *toplevel_dir, const char *full_name, const char *ext);
-
-static void local_refresh_info(CamelFolder *folder, CamelException *ex);
-
-static void local_sync(CamelFolder *folder, gboolean expunge, CamelException *ex);
-static void local_expunge(CamelFolder *folder, CamelException *ex);
-
-static GPtrArray *local_search_by_expression(CamelFolder *folder, const char *expression, CamelException *ex);
-static GPtrArray *local_search_by_uids(CamelFolder *folder, const char *expression, GPtrArray *uids, CamelException *ex);
-static void local_search_free(CamelFolder *folder, GPtrArray * result);
-
-static void local_delete(CamelFolder *folder);
-static void local_rename(CamelFolder *folder, const char *newname);
-
-static void local_finalize(CamelObject * object);
-
-static void
-camel_local_folder_class_init(CamelLocalFolderClass * camel_local_folder_class)
-{
- CamelFolderClass *camel_folder_class = CAMEL_FOLDER_CLASS(camel_local_folder_class);
- CamelObjectClass *oklass = (CamelObjectClass *)camel_local_folder_class;
-
- /* virtual method definition */
-
- /* virtual method overload */
- oklass->getv = local_getv;
- oklass->setv = local_setv;
-
- camel_folder_class->refresh_info = local_refresh_info;
- camel_folder_class->sync = local_sync;
- camel_folder_class->expunge = local_expunge;
-
- camel_folder_class->search_by_expression = local_search_by_expression;
- camel_folder_class->search_by_uids = local_search_by_uids;
- camel_folder_class->search_free = local_search_free;
-
- camel_folder_class->delete = local_delete;
- camel_folder_class->rename = local_rename;
-
- camel_local_folder_class->get_full_path = local_get_full_path;
- camel_local_folder_class->get_meta_path = local_get_meta_path;
-
- camel_local_folder_class->lock = local_lock;
- camel_local_folder_class->unlock = local_unlock;
-}
-
-static void
-local_init(gpointer object, gpointer klass)
-{
- CamelFolder *folder = object;
- CamelLocalFolder *local_folder = object;
-
- folder->folder_flags |= (CAMEL_FOLDER_HAS_SUMMARY_CAPABILITY |
- CAMEL_FOLDER_HAS_SEARCH_CAPABILITY);
-
- folder->permanent_flags = CAMEL_MESSAGE_ANSWERED |
- CAMEL_MESSAGE_DELETED | CAMEL_MESSAGE_DRAFT |
- CAMEL_MESSAGE_FLAGGED | CAMEL_MESSAGE_SEEN |
- CAMEL_MESSAGE_ANSWERED_ALL | CAMEL_MESSAGE_USER;
-
- folder->summary = NULL;
- local_folder->search = NULL;
-
- local_folder->priv = g_malloc0(sizeof(*local_folder->priv));
- local_folder->priv->search_lock = g_mutex_new();
-}
-
-static void
-local_finalize(CamelObject * object)
-{
- CamelLocalFolder *local_folder = CAMEL_LOCAL_FOLDER(object);
- CamelFolder *folder = (CamelFolder *)object;
-
- if (folder->summary) {
- camel_local_summary_sync((CamelLocalSummary *)folder->summary, FALSE, local_folder->changes, NULL);
- camel_object_unref((CamelObject *)folder->summary);
- folder->summary = NULL;
- }
-
- if (local_folder->search) {
- camel_object_unref((CamelObject *)local_folder->search);
- }
-
- if (local_folder->index)
- camel_object_unref((CamelObject *)local_folder->index);
-
- while (local_folder->locked> 0)
- camel_local_folder_unlock(local_folder);
-
- g_free(local_folder->base_path);
- g_free(local_folder->folder_path);
- g_free(local_folder->summary_path);
- g_free(local_folder->index_path);
-
- camel_folder_change_info_free(local_folder->changes);
-
- g_mutex_free(local_folder->priv->search_lock);
-
- g_free(local_folder->priv);
-}
-
-static CamelProperty local_property_list[] = {
- { CAMEL_LOCAL_FOLDER_INDEX_BODY, "index_body", N_("Index message body data") },
-};
-
-CamelType
-camel_local_folder_get_type(void)
-{
- static CamelType camel_local_folder_type = CAMEL_INVALID_TYPE;
-
- if (camel_local_folder_type == CAMEL_INVALID_TYPE) {
- int i;
-
- parent_class = (CamelFolderClass *)camel_folder_get_type();
- camel_local_folder_type = camel_type_register(camel_folder_get_type(), "CamelLocalFolder",
- sizeof(CamelLocalFolder),
- sizeof(CamelLocalFolderClass),
- (CamelObjectClassInitFunc) camel_local_folder_class_init,
- NULL,
- (CamelObjectInitFunc) local_init,
- (CamelObjectFinalizeFunc) local_finalize);
-
- for (i=0;i<sizeof(local_property_list)/sizeof(local_property_list[0]);i++) {
- local_property_list[i].description = _(local_property_list[i].description);
- local_folder_properties = g_slist_prepend(local_folder_properties, &local_property_list[i]);
- }
- }
-
- return camel_local_folder_type;
-}
-
-CamelLocalFolder *
-camel_local_folder_construct(CamelLocalFolder *lf, CamelStore *parent_store, const char *full_name, guint32 flags, CamelException *ex)
-{
- CamelFolderInfo *fi;
- CamelFolder *folder;
- const char *root_dir_path, *name;
- char *tmp, *statepath;
- char folder_path[PATH_MAX];
- struct stat st;
- int forceindex, len;
-
- folder = (CamelFolder *)lf;
-
- name = strrchr(full_name, '/');
- if (name)
- name++;
- else
- name = full_name;
-
- camel_folder_construct(folder, parent_store, full_name, name);
-
- root_dir_path = camel_local_store_get_toplevel_dir(CAMEL_LOCAL_STORE(folder->parent_store));
- /* strip the trailing '/' which is always present */
- len = strlen (root_dir_path);
- tmp = g_alloca (len + 1);
- strcpy (tmp, root_dir_path);
- if (len>1 && tmp[len-1] == '/')
- tmp[len-1] = 0;
-
- lf->base_path = g_strdup(root_dir_path);
-
- /* if the base store points to a file, then use that */
- if (stat(tmp, &st) != -1 && S_ISREG(st.st_mode)) {
- lf->folder_path = g_strdup(tmp);
- /* not really sure to do with these for now? */
- lf->summary_path = g_strdup_printf("%s.ev-summary", tmp);
- lf->index_path = g_strdup_printf("%s.ibex", tmp);
- statepath = g_strdup_printf ("%s.cmeta", tmp);
- } else {
- lf->folder_path = CLOCALF_CLASS (lf)->get_full_path (root_dir_path, full_name);
- lf->summary_path = CLOCALF_CLASS (lf)->get_meta_path (root_dir_path, full_name, ".ev-summary");
- lf->index_path = CLOCALF_CLASS (lf)->get_meta_path (root_dir_path, full_name, ".ibex");
- statepath = CLOCALF_CLASS (lf)->get_meta_path (root_dir_path, full_name, ".cmeta");
- }
- camel_object_set(lf, NULL, CAMEL_OBJECT_STATE_FILE, statepath, NULL);
- g_free (statepath);
-
- lf->flags = flags;
-
- if (camel_object_state_read(lf) == -1) {
- /* FIXME: load defaults? */
- }
-
- /* follow any symlinks to the mailbox */
- if (lstat (lf->folder_path, &st) != -1 && S_ISLNK (st.st_mode) &&
- realpath (lf->folder_path, folder_path) != NULL) {
- g_free (lf->folder_path);
- lf->folder_path = g_strdup (folder_path);
- }
-
- lf->changes = camel_folder_change_info_new();
-
- /* TODO: Remove the following line, it is a temporary workaround to remove
- the old-format 'ibex' files that might be lying around */
- unlink(lf->index_path);
-
- /* FIXME: Need to run indexing off of the setv method */
-#if 1
- forceindex = FALSE;
-#else
- /* if we have no/invalid index file, force it */
- forceindex = camel_text_index_check(lf->index_path) == -1;
- if (flags & CAMEL_STORE_FOLDER_BODY_INDEX) {
- int flag = O_RDWR|O_CREAT;
- if (forceindex)
- flag |= O_TRUNC;
- lf->index = (CamelIndex *)camel_text_index_new(lf->index_path, flag);
- if (lf->index == NULL) {
- /* yes, this isn't fatal at all */
- g_warning("Could not open/create index file: %s: indexing not performed", strerror (errno));
- forceindex = FALSE;
- /* record that we dont have an index afterall */
- flags &= ~CAMEL_STORE_FOLDER_BODY_INDEX;
- }
- } else {
- /* if we do have an index file, remove it (?) */
- if (forceindex == FALSE)
- camel_text_index_remove(lf->index_path);
- forceindex = FALSE;
- }
- lf->flags = flags;
-#endif
-
- folder->summary = (CamelFolderSummary *)CLOCALF_CLASS(lf)->create_summary(lf->summary_path, lf->folder_path, lf->index);
- if (camel_local_summary_load((CamelLocalSummary *)folder->summary, forceindex, ex) == -1) {
- camel_exception_clear(ex);
- }
-
- /*if (camel_local_summary_check((CamelLocalSummary *)folder->summary, lf->changes, ex) == -1) {*/
- /* we sync here so that any hard work setting up the folder isn't lost */
- if (camel_local_summary_sync((CamelLocalSummary *)folder->summary, FALSE, lf->changes, ex) == -1) {
- camel_object_unref (CAMEL_OBJECT (folder));
- return NULL;
- }
-
- fi = g_new0 (CamelFolderInfo, 1);
- fi->full_name = g_strdup (full_name);
- fi->name = g_strdup (name);
- fi->url = g_strdup_printf("%s:%s#%s", ((CamelService *)parent_store)->url->protocol, ((CamelService *)parent_store)->url->path, full_name);
- fi->unread_message_count = camel_folder_get_unread_message_count(folder);
- camel_folder_info_build_path(fi, '/');
-
- camel_object_trigger_event(CAMEL_OBJECT (parent_store), "folder_created", fi);
- camel_folder_info_free(fi);
-
- return lf;
-}
-
-/* lock the folder, may be called repeatedly (with matching unlock calls),
- with type the same or less than the first call */
-int camel_local_folder_lock(CamelLocalFolder *lf, CamelLockType type, CamelException *ex)
-{
- if (lf->locked > 0) {
- /* lets be anal here - its important the code knows what its doing */
- g_assert(lf->locktype == type || lf->locktype == CAMEL_LOCK_WRITE);
- } else {
- if (CLOCALF_CLASS(lf)->lock(lf, type, ex) == -1)
- return -1;
- lf->locktype = type;
- }
-
- lf->locked++;
-
- return 0;
-}
-
-/* unlock folder */
-int camel_local_folder_unlock(CamelLocalFolder *lf)
-{
- g_assert(lf->locked>0);
- lf->locked--;
- if (lf->locked == 0)
- CLOCALF_CLASS(lf)->unlock(lf);
-
- return 0;
-}
-
-static int
-local_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args)
-{
- CamelFolder *folder = (CamelFolder *)object;
- int i;
- guint32 tag;
-
- for (i=0;i<args->argc;i++) {
- CamelArgGet *arg = &args->argv[i];
-
- tag = arg->tag;
-
- switch (tag & CAMEL_ARG_TAG) {
- case CAMEL_OBJECT_ARG_DESCRIPTION:
- if (folder->description == NULL) {
- char *tmp, *path;
-
- /* check some common prefixes to shorten the name */
- tmp = ((CamelService *)folder->parent_store)->url->path;
- if (tmp == NULL)
- goto skip;
-
- path = g_alloca (strlen (tmp) + strlen (folder->full_name) + 1);
- sprintf (path, "%s/%s", tmp, folder->full_name);
-
- if ((tmp = getenv("HOME")) && strncmp(tmp, path, strlen(tmp)) == 0)
- /* $HOME relative path + protocol string */
- folder->description = g_strdup_printf(_("~%s (%s)"), path+strlen(tmp),
- ((CamelService *)folder->parent_store)->url->protocol);
- else if ((tmp = "/var/spool/mail") && strncmp(tmp, path, strlen(tmp)) == 0)
- /* /var/spool/mail relative path + protocol */
- folder->description = g_strdup_printf(_("mailbox:%s (%s)"), path+strlen(tmp),
- ((CamelService *)folder->parent_store)->url->protocol);
- else if ((tmp = "/var/mail") && strncmp(tmp, path, strlen(tmp)) == 0)
- folder->description = g_strdup_printf(_("mailbox:%s (%s)"), path+strlen(tmp),
- ((CamelService *)folder->parent_store)->url->protocol);
- else
- /* a full path + protocol */
- folder->description = g_strdup_printf(_("%s (%s)"), path,
- ((CamelService *)folder->parent_store)->url->protocol);
- }
- *arg->ca_str = folder->description;
- break;
-
- case CAMEL_OBJECT_ARG_PERSISTENT_PROPERTIES:
- case CAMEL_FOLDER_ARG_PROPERTIES: {
- CamelArgGetV props;
-
- props.argc = 1;
- props.argv[0] = *arg;
- ((CamelObjectClass *)parent_class)->getv(object, ex, &props);
- *arg->ca_ptr = g_slist_concat(*arg->ca_ptr, g_slist_copy(local_folder_properties));
-
- break; }
-
- case CAMEL_LOCAL_FOLDER_ARG_INDEX_BODY:
- printf("getv:'%s' flags %08x\n", ((CamelFolder *)object)->full_name, ((CamelLocalFolder *)object)->flags);
-
- /* FIXME: remove this from sotre flags */
- *arg->ca_int = (((CamelLocalFolder *)folder)->flags & CAMEL_STORE_FOLDER_BODY_INDEX) != 0;
- break;
-
- default: skip:
- continue;
- }
-
- arg->tag = (tag & CAMEL_ARG_TYPE) | CAMEL_ARG_IGNORE;
- }
-
- return ((CamelObjectClass *)parent_class)->getv(object, ex, args);
-}
-
-static int
-local_setv(CamelObject *object, CamelException *ex, CamelArgV *args)
-{
- int i;
- guint32 tag;
-
- for (i=0;i<args->argc;i++) {
- CamelArg *arg = &args->argv[i];
-
- tag = arg->tag;
-
- switch (tag & CAMEL_ARG_TAG) {
- case CAMEL_LOCAL_FOLDER_ARG_INDEX_BODY:
- /* FIXME: implement */
- /* TODO: When turning on (off?) the index, we want to launch a task for it,
- and make sure we dont have multiple tasks doing the same job */
- if (arg->ca_int)
- ((CamelLocalFolder *)object)->flags |= CAMEL_STORE_FOLDER_BODY_INDEX;
- else
- ((CamelLocalFolder *)object)->flags &= ~CAMEL_STORE_FOLDER_BODY_INDEX;
- break;
- default:
- continue;
- }
-
- arg->tag = (tag & CAMEL_ARG_TYPE) | CAMEL_ARG_IGNORE;
- }
-
- return ((CamelObjectClass *)parent_class)->setv(object, ex, args);
-}
-
-static char *
-local_get_full_path (const char *toplevel_dir, const char *full_name)
-{
- return g_strdup_printf ("%s/%s", toplevel_dir, full_name);
-}
-
-static char *
-local_get_meta_path (const char *toplevel_dir, const char *full_name, const char *ext)
-{
- return g_strdup_printf ("%s/%s%s", toplevel_dir, full_name, ext);
-}
-
-static int
-local_lock(CamelLocalFolder *lf, CamelLockType type, CamelException *ex)
-{
- return 0;
-}
-
-static void
-local_unlock(CamelLocalFolder *lf)
-{
- /* nothing */
-}
-
-/* for auto-check to work */
-static void
-local_refresh_info(CamelFolder *folder, CamelException *ex)
-{
- CamelLocalFolder *lf = (CamelLocalFolder *)folder;
-
- if (camel_local_summary_check((CamelLocalSummary *)folder->summary, lf->changes, ex) == -1)
- return;
-
- if (camel_folder_change_info_changed(lf->changes)) {
- camel_object_trigger_event((CamelObject *)folder, "folder_changed", lf->changes);
- camel_folder_change_info_clear(lf->changes);
- }
-}
-
-static void
-local_sync(CamelFolder *folder, gboolean expunge, CamelException *ex)
-{
- CamelLocalFolder *lf = CAMEL_LOCAL_FOLDER(folder);
-
- d(printf("local sync, expunge=%s\n", expunge?"true":"false"));
-
- if (camel_local_folder_lock(lf, CAMEL_LOCK_WRITE, ex) == -1)
- return;
-
- camel_object_state_write(lf);
-
- /* if sync fails, we'll pass it up on exit through ex */
- camel_local_summary_sync((CamelLocalSummary *)folder->summary, expunge, lf->changes, ex);
- camel_local_folder_unlock(lf);
-
- if (camel_folder_change_info_changed(lf->changes)) {
- camel_object_trigger_event(CAMEL_OBJECT(folder), "folder_changed", lf->changes);
- camel_folder_change_info_clear(lf->changes);
- }
-}
-
-static void
-local_expunge(CamelFolder *folder, CamelException *ex)
-{
- d(printf("expunge\n"));
-
- /* Just do a sync with expunge, serves the same purpose */
- /* call the callback directly, to avoid locking problems */
- CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(folder))->sync(folder, TRUE, ex);
-}
-
-static void
-local_delete(CamelFolder *folder)
-{
- CamelLocalFolder *lf = (CamelLocalFolder *)folder;
-
- if (lf->index)
- camel_index_delete(lf->index);
-
- parent_class->delete(folder);
-}
-
-static void
-local_rename(CamelFolder *folder, const char *newname)
-{
- CamelLocalFolder *lf = (CamelLocalFolder *)folder;
-
- d(printf("renaming local folder paths to '%s'\n", newname));
-
- /* Sync? */
-
- g_free(lf->folder_path);
- g_free(lf->summary_path);
- g_free(lf->index_path);
- lf->folder_path = g_strdup_printf("%s/%s", lf->base_path, newname);
- lf->summary_path = g_strdup_printf("%s/%s.ev-summary", lf->base_path, newname);
- lf->index_path = g_strdup_printf("%s/%s.ibex", lf->base_path, newname);
-
- /* FIXME: Poke some internals, sigh */
- camel_folder_summary_set_filename(folder->summary, lf->summary_path);
- g_free(((CamelLocalSummary *)folder->summary)->folder_path);
- ((CamelLocalSummary *)folder->summary)->folder_path = g_strdup(lf->folder_path);
-
- parent_class->rename(folder, newname);
-}
-
-static GPtrArray *
-local_search_by_expression(CamelFolder *folder, const char *expression, CamelException *ex)
-{
- CamelLocalFolder *local_folder = CAMEL_LOCAL_FOLDER(folder);
- GPtrArray *summary, *matches;
-
- /* NOTE: could get away without the search lock by creating a new
- search object each time */
-
- CAMEL_LOCAL_FOLDER_LOCK(folder, search_lock);
-
- if (local_folder->search == NULL)
- local_folder->search = camel_folder_search_new();
-
- camel_folder_search_set_folder(local_folder->search, folder);
- camel_folder_search_set_body_index(local_folder->search, local_folder->index);
- summary = camel_folder_get_summary(folder);
- camel_folder_search_set_summary(local_folder->search, summary);
-
- matches = camel_folder_search_execute_expression(local_folder->search, expression, ex);
-
- CAMEL_LOCAL_FOLDER_UNLOCK(folder, search_lock);
-
- camel_folder_free_summary(folder, summary);
-
- return matches;
-}
-
-static GPtrArray *
-local_search_by_uids(CamelFolder *folder, const char *expression, GPtrArray *uids, CamelException *ex)
-{
- CamelLocalFolder *local_folder = CAMEL_LOCAL_FOLDER(folder);
- GPtrArray *summary, *matches;
- int i;
-
- /* NOTE: could get away without the search lock by creating a new
- search object each time */
-
- summary = g_ptr_array_new();
- for (i=0;i<uids->len;i++) {
- CamelMessageInfo *info;
-
- info = camel_folder_get_message_info(folder, uids->pdata[i]);
- if (info)
- g_ptr_array_add(summary, info);
- }
-
- if (summary->len == 0)
- return summary;
-
- CAMEL_LOCAL_FOLDER_LOCK(folder, search_lock);
-
- if (local_folder->search == NULL)
- local_folder->search = camel_folder_search_new();
-
- camel_folder_search_set_folder(local_folder->search, folder);
- camel_folder_search_set_body_index(local_folder->search, local_folder->index);
- camel_folder_search_set_summary(local_folder->search, summary);
-
- matches = camel_folder_search_execute_expression(local_folder->search, expression, ex);
-
- CAMEL_LOCAL_FOLDER_UNLOCK(folder, search_lock);
-
- for (i=0;i<summary->len;i++)
- camel_folder_free_message_info(folder, summary->pdata[i]);
- g_ptr_array_free(summary, TRUE);
-
- return matches;
-}
-
-static void
-local_search_free(CamelFolder *folder, GPtrArray * result)
-{
- CamelLocalFolder *local_folder = CAMEL_LOCAL_FOLDER(folder);
-
- /* we need to lock this free because of the way search_free_result works */
- /* FIXME: put the lock inside search_free_result */
- CAMEL_LOCAL_FOLDER_LOCK(folder, search_lock);
-
- camel_folder_search_free_result(local_folder->search, result);
-
- CAMEL_LOCAL_FOLDER_UNLOCK(folder, search_lock);
-}
diff --git a/camel/providers/local/camel-local-folder.h b/camel/providers/local/camel-local-folder.h
deleted file mode 100644
index 73059f03b3..0000000000
--- a/camel/providers/local/camel-local-folder.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Author: Michael Zucchi <notzed@ximian.com>
- *
- * Copyright (C) 1999 Ximian (www.ximian.com/).
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifndef CAMEL_LOCAL_FOLDER_H
-#define CAMEL_LOCAL_FOLDER_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include <camel/camel-folder.h>
-#include <camel/camel-folder-search.h>
-#include <camel/camel-index.h>
-#include "camel-local-summary.h"
-#include "camel-lock.h"
-
-/* #include "camel-store.h" */
-
-#define CAMEL_LOCAL_FOLDER_TYPE (camel_local_folder_get_type ())
-#define CAMEL_LOCAL_FOLDER(obj) (CAMEL_CHECK_CAST((obj), CAMEL_LOCAL_FOLDER_TYPE, CamelLocalFolder))
-#define CAMEL_LOCAL_FOLDER_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_LOCAL_FOLDER_TYPE, CamelLocalFolderClass))
-#define CAMEL_IS_LOCAL_FOLDER(o) (CAMEL_CHECK_TYPE((o), CAMEL_LOCAL_FOLDER_TYPE))
-
-enum {
- CAMEL_LOCAL_FOLDER_ARG_INDEX_BODY = CAMEL_FOLDER_ARG_LAST,
-
- CAMEL_LOCAL_FOLDER_ARG_LAST = CAMEL_FOLDER_ARG_LAST + 0x100
-};
-
-enum {
- CAMEL_LOCAL_FOLDER_INDEX_BODY = CAMEL_LOCAL_FOLDER_ARG_INDEX_BODY | CAMEL_ARG_BOO,
-};
-
-typedef struct {
- CamelFolder parent_object;
- struct _CamelLocalFolderPrivate *priv;
-
- guint32 flags; /* open mode flags */
-
- int locked; /* lock counter */
- CamelLockType locktype; /* what type of lock we have */
-
- char *base_path; /* base path of the local folder */
- char *folder_path; /* the path to the folder itself */
- char *summary_path; /* where the summary lives */
- char *index_path; /* where the index file lives */
-
- CamelIndex *index; /* index for this folder */
- CamelFolderSearch *search; /* used to run searches, we just use the real thing (tm) */
- CamelFolderChangeInfo *changes; /* used to store changes to the folder during processing */
-} CamelLocalFolder;
-
-typedef struct {
- CamelFolderClass parent_class;
-
- /* Virtual methods */
-
- /* path construction, only used at init */
- char * (* get_full_path) (const char *toplevel_dir, const char *full_name);
- char * (* get_meta_path) (const char *toplevel_dir, const char *full_name, const char *ext);
-
- /* summary factory, only used at init */
- CamelLocalSummary *(*create_summary)(const char *path, const char *folder, CamelIndex *index);
-
- /* Lock the folder for my operations */
- int (*lock)(CamelLocalFolder *, CamelLockType type, CamelException *ex);
-
- /* Unlock the folder for my operations */
- void (*unlock)(CamelLocalFolder *);
-} CamelLocalFolderClass;
-
-
-/* public methods */
-/* flags are taken from CAMEL_STORE_FOLDER_* flags */
-CamelLocalFolder *camel_local_folder_construct(CamelLocalFolder *lf, CamelStore *parent_store,
- const char *full_name, guint32 flags, CamelException *ex);
-
-/* Standard Camel function */
-CamelType camel_local_folder_get_type(void);
-
-/* Lock the folder for internal use. May be called repeatedly */
-/* UNIMPLEMENTED */
-int camel_local_folder_lock(CamelLocalFolder *lf, CamelLockType type, CamelException *ex);
-int camel_local_folder_unlock(CamelLocalFolder *lf);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_LOCAL_FOLDER_H */
diff --git a/camel/providers/local/camel-local-private.h b/camel/providers/local/camel-local-private.h
deleted file mode 100644
index e8e5061fae..0000000000
--- a/camel/providers/local/camel-local-private.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * Copyright 1999-2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifndef CAMEL_LOCAL_PRIVATE_H
-#define CAMEL_LOCAL_PRIVATE_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-/* need a way to configure and save this data, if this header is to
- be installed. For now, dont install it */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <pthread.h>
-
-struct _CamelLocalFolderPrivate {
- GMutex *search_lock; /* for locking the search object */
-};
-
-#define CAMEL_LOCAL_FOLDER_LOCK(f, l) (g_mutex_lock(((CamelLocalFolder *)f)->priv->l))
-#define CAMEL_LOCAL_FOLDER_UNLOCK(f, l) (g_mutex_unlock(((CamelLocalFolder *)f)->priv->l))
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_LOCAL_PRIVATE_H */
-
diff --git a/camel/providers/local/camel-local-provider.c b/camel/providers/local/camel-local-provider.c
deleted file mode 100644
index a52dfbde5f..0000000000
--- a/camel/providers/local/camel-local-provider.c
+++ /dev/null
@@ -1,222 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * Copyright (C) 2000 Ximian (www.ximian.com).
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <string.h>
-
-#include "camel-provider.h"
-#include "camel-session.h"
-#include "camel-url.h"
-
-#include "camel-mh-store.h"
-#include "camel-mbox-store.h"
-#include "camel-maildir-store.h"
-#include "camel-spool-store.h"
-
-#define d(x)
-
-static CamelProviderConfEntry mh_conf_entries[] = {
- CAMEL_PROVIDER_CONF_DEFAULT_PATH,
- { CAMEL_PROVIDER_CONF_CHECKBOX, "dotfolders", NULL,
- N_("Use the `.folders' folder summary file (exmh)"), "0" },
- { CAMEL_PROVIDER_CONF_END }
-};
-
-static CamelProvider mh_provider = {
- "mh",
- N_("MH-format mail directories"),
- N_("For storing local mail in MH-like mail directories."),
- "mail",
- CAMEL_PROVIDER_IS_SOURCE | CAMEL_PROVIDER_IS_STORAGE | CAMEL_PROVIDER_IS_LOCAL,
- CAMEL_URL_NEED_PATH | CAMEL_URL_PATH_IS_ABSOLUTE | CAMEL_URL_FRAGMENT_IS_PATH,
- mh_conf_entries,
- /* ... */
-};
-
-static CamelProviderConfEntry mbox_conf_entries[] = {
- CAMEL_PROVIDER_CONF_DEFAULT_PATH,
- { CAMEL_PROVIDER_CONF_END }
-};
-
-static CamelProvider mbox_provider = {
- "mbox",
- N_("Local delivery"),
- N_("For retrieving (moving) local mail from standard mbox formated spools into folders managed by Evolution."),
- "mail",
- CAMEL_PROVIDER_IS_SOURCE | CAMEL_PROVIDER_IS_STORAGE | CAMEL_PROVIDER_IS_LOCAL,
- CAMEL_URL_NEED_PATH | CAMEL_URL_PATH_IS_ABSOLUTE | CAMEL_URL_FRAGMENT_IS_PATH,
- mbox_conf_entries,
- /* ... */
-};
-
-static CamelProviderConfEntry maildir_conf_entries[] = {
- CAMEL_PROVIDER_CONF_DEFAULT_PATH,
- { CAMEL_PROVIDER_CONF_CHECKBOX, "filter", NULL,
- N_("Apply filters to new messages in INBOX"), "0" },
- { CAMEL_PROVIDER_CONF_END }
-};
-
-static CamelProvider maildir_provider = {
- "maildir",
- N_("Maildir-format mail directories"),
- N_("For storing local mail in maildir directories."),
- "mail",
- CAMEL_PROVIDER_IS_SOURCE | CAMEL_PROVIDER_IS_STORAGE | CAMEL_PROVIDER_IS_LOCAL,
- CAMEL_URL_NEED_PATH | CAMEL_URL_PATH_IS_ABSOLUTE | CAMEL_URL_FRAGMENT_IS_PATH,
- maildir_conf_entries,
- /* ... */
-};
-
-static CamelProviderConfEntry spool_conf_entries[] = {
- CAMEL_PROVIDER_CONF_DEFAULT_PATH,
- { CAMEL_PROVIDER_CONF_CHECKBOX, "filter", NULL, N_("Apply filters to new messages in INBOX"), "0" },
- { CAMEL_PROVIDER_CONF_CHECKBOX, "xstatus", NULL, N_("Store status headers in Elm/Pine/Mutt format"), "0" },
- { CAMEL_PROVIDER_CONF_END }
-};
-
-static CamelProvider spool_provider = {
- "spool",
- N_("Standard Unix mbox spool or directory"),
- N_("For reading and storing local mail in external standard mbox spool files.\nMay also be used to read a tree of Elm, Pine, or Mutt style folders."),
- "mail",
- CAMEL_PROVIDER_IS_SOURCE | CAMEL_PROVIDER_IS_STORAGE,
- CAMEL_URL_NEED_PATH | CAMEL_URL_PATH_IS_ABSOLUTE | CAMEL_URL_FRAGMENT_IS_PATH,
- spool_conf_entries,
- /* ... */
-};
-
-/* build a canonical 'path' */
-static char *
-make_can_path(char *p, char *o)
-{
- char c, last, *start = o;
-
- d(printf("canonical '%s' = ", p));
-
- last = 0;
- while ((c = *p++)) {
- if (c!='/'
- || (c=='/' && last != '/'))
- *o++ = c;
- last = c;
- }
- if (o>start && o[-1] == '/')
- o[-1] = 0;
- else
- *o = 0;
-
- d(printf("'%s'\n", start));
-
- return start;
-}
-
-/* 'helper' function for it */
-#define get_can_path(p) ((p == NULL) ? NULL : (make_can_path ((p), g_alloca (strlen (p) + 1))))
-
-static guint
-local_url_hash (const void *v)
-{
- const CamelURL *u = v;
- guint hash = 0;
-
-#define ADD_HASH(s) if (s) hash ^= g_str_hash (s);
-
- ADD_HASH (u->protocol);
- ADD_HASH (u->user);
- ADD_HASH (u->authmech);
- ADD_HASH (u->host);
- if (u->path)
- hash ^= g_str_hash(get_can_path(u->path));
- ADD_HASH (u->path);
- ADD_HASH (u->query);
- hash ^= u->port;
-
- return hash;
-}
-
-static int
-check_equal (char *s1, char *s2)
-{
- if (s1 == NULL) {
- if (s2 == NULL)
- return TRUE;
- else
- return FALSE;
- }
-
- if (s2 == NULL)
- return FALSE;
-
- return strcmp (s1, s2) == 0;
-}
-
-static int
-local_url_equal(const void *v, const void *v2)
-{
- const CamelURL *u1 = v, *u2 = v2;
- char *p1, *p2;
-
- p1 = get_can_path(u1->path);
- p2 = get_can_path(u2->path);
- return check_equal(p1, p2)
- && check_equal(u1->protocol, u2->protocol)
- && check_equal(u1->user, u2->user)
- && check_equal(u1->authmech, u2->authmech)
- && check_equal(u1->host, u2->host)
- && check_equal(u1->query, u2->query)
- && u1->port == u2->port;
-}
-
-void camel_provider_module_init(CamelSession * session)
-{
- char *path;
-
- mh_conf_entries[0].value = ""; /* default path */
- mh_provider.object_types[CAMEL_PROVIDER_STORE] = camel_mh_store_get_type ();
- mh_provider.url_hash = local_url_hash;
- mh_provider.url_equal = local_url_equal;
- camel_session_register_provider(session, &mh_provider);
-
- if (!(path = getenv ("MAIL")))
- path = g_strdup_printf (SYSTEM_MAIL_DIR "/%s", g_get_user_name ());
- mbox_conf_entries[0].value = path; /* default path */
- mbox_provider.object_types[CAMEL_PROVIDER_STORE] = camel_mbox_store_get_type ();
- mbox_provider.url_hash = local_url_hash;
- mbox_provider.url_equal = local_url_equal;
- camel_session_register_provider(session, &mbox_provider);
-
- spool_conf_entries[0].value = path; /* default path - same as mbox */
- spool_provider.object_types[CAMEL_PROVIDER_STORE] = camel_spool_store_get_type ();
- spool_provider.url_hash = local_url_hash;
- spool_provider.url_equal = local_url_equal;
- camel_session_register_provider(session, &spool_provider);
-
- path = getenv ("MAILDIR");
- maildir_conf_entries[0].value = path ? path : ""; /* default path */
- maildir_provider.object_types[CAMEL_PROVIDER_STORE] = camel_maildir_store_get_type ();
- maildir_provider.url_hash = local_url_hash;
- maildir_provider.url_equal = local_url_equal;
- camel_session_register_provider(session, &maildir_provider);
-}
diff --git a/camel/providers/local/camel-local-store.c b/camel/providers/local/camel-local-store.c
deleted file mode 100644
index a0eaf9d68f..0000000000
--- a/camel/providers/local/camel-local-store.c
+++ /dev/null
@@ -1,442 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * Copyright (C) 2000 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <sys/stat.h>
-#include <errno.h>
-#include <string.h>
-#include <unistd.h>
-#include <stdio.h>
-
-#include <glib.h>
-
-#include "camel-private.h"
-
-#include "camel-local-store.h"
-#include "camel-exception.h"
-#include "camel-url.h"
-
-#include "camel-local-folder.h"
-#include <camel/camel-text-index.h>
-
-#define d(x)
-
-/* Returns the class for a CamelLocalStore */
-#define CLOCALS_CLASS(so) CAMEL_LOCAL_STORE_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-#define CF_CLASS(so) CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-
-static void construct (CamelService *service, CamelSession *session, CamelProvider *provider, CamelURL *url, CamelException *ex);
-static CamelFolder *get_folder(CamelStore * store, const char *folder_name, guint32 flags, CamelException * ex);
-static char *get_name(CamelService *service, gboolean brief);
-static CamelFolder *get_inbox (CamelStore *store, CamelException *ex);
-static CamelFolderInfo *get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelException *ex);
-static void delete_folder(CamelStore *store, const char *folder_name, CamelException *ex);
-static void rename_folder(CamelStore *store, const char *old, const char *new, CamelException *ex);
-static CamelFolderInfo *create_folder(CamelStore *store, const char *parent_name, const char *folder_name, CamelException *ex);
-
-static CamelStoreClass *parent_class = NULL;
-
-static void
-camel_local_store_class_init (CamelLocalStoreClass *camel_local_store_class)
-{
- CamelStoreClass *camel_store_class = CAMEL_STORE_CLASS (camel_local_store_class);
- CamelServiceClass *camel_service_class = CAMEL_SERVICE_CLASS (camel_local_store_class);
-
- parent_class = CAMEL_STORE_CLASS (camel_type_get_global_classfuncs (camel_store_get_type ()));
-
- /* virtual method overload */
- camel_service_class->construct = construct;
- camel_service_class->get_name = get_name;
- camel_store_class->get_folder = get_folder;
- camel_store_class->get_inbox = get_inbox;
- camel_store_class->get_folder_info = get_folder_info;
- camel_store_class->free_folder_info = camel_store_free_folder_info_full;
-
- camel_store_class->create_folder = create_folder;
- camel_store_class->delete_folder = delete_folder;
- camel_store_class->rename_folder = rename_folder;
-}
-
-static void
-camel_local_store_finalize (CamelLocalStore *local_store)
-{
- if (local_store->toplevel_dir)
- g_free (local_store->toplevel_dir);
-}
-
-CamelType
-camel_local_store_get_type (void)
-{
- static CamelType camel_local_store_type = CAMEL_INVALID_TYPE;
-
- if (camel_local_store_type == CAMEL_INVALID_TYPE) {
- camel_local_store_type = camel_type_register (CAMEL_STORE_TYPE, "CamelLocalStore",
- sizeof (CamelLocalStore),
- sizeof (CamelLocalStoreClass),
- (CamelObjectClassInitFunc) camel_local_store_class_init,
- NULL,
- NULL,
- (CamelObjectFinalizeFunc) camel_local_store_finalize);
- }
-
- return camel_local_store_type;
-}
-
-static void
-construct (CamelService *service, CamelSession *session, CamelProvider *provider, CamelURL *url, CamelException *ex)
-{
- CamelLocalStore *local_store = CAMEL_LOCAL_STORE (service);
- int len;
-
- CAMEL_SERVICE_CLASS (parent_class)->construct (service, session, provider, url, ex);
- if (camel_exception_is_set (ex))
- return;
-
- len = strlen (service->url->path);
- if (service->url->path[len - 1] != '/')
- local_store->toplevel_dir = g_strdup_printf ("%s/", service->url->path);
- else
- local_store->toplevel_dir = g_strdup (service->url->path);
-}
-
-const char *
-camel_local_store_get_toplevel_dir (CamelLocalStore *store)
-{
- return store->toplevel_dir;
-}
-
-static CamelFolder *
-get_folder(CamelStore * store, const char *folder_name, guint32 flags, CamelException * ex)
-{
- struct stat st;
- char *path = ((CamelLocalStore *)store)->toplevel_dir;
- char *sub, *slash;
-
- if (path[0] != '/') {
- camel_exception_setv(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
- _("Store root %s is not an absolute path"), path);
- return NULL;
- }
-
- if (stat(path, &st) == 0) {
- if (!S_ISDIR(st.st_mode)) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
- _("Store root %s is not a regular directory"), path);
- return NULL;
- }
- return (CamelFolder *) 0xdeadbeef;
- }
-
- if (errno != ENOENT
- || (flags & CAMEL_STORE_FOLDER_CREATE) == 0) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
- _("Cannot get folder: %s: %s"),
- path, g_strerror (errno));
- return NULL;
- }
-
- /* need to create the dir heirarchy */
- sub = g_alloca (strlen (path) + 1);
- strcpy (sub, path);
- slash = sub;
- do {
- slash = strchr (slash + 1, '/');
- if (slash)
- *slash = 0;
- if (stat (sub, &st) == -1) {
- if (errno != ENOENT || mkdir (sub, 0700) == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
- _("Cannot get folder: %s: %s"),
- path, g_strerror (errno));
- return NULL;
- }
- }
- if (slash)
- *slash = '/';
- } while (slash);
-
- return (CamelFolder *) 0xdeadbeef;
-}
-
-static CamelFolder *
-get_inbox(CamelStore *store, CamelException *ex)
-{
- camel_exception_set(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
- _("Local stores do not have an inbox"));
- return NULL;
-}
-
-static char *
-get_name (CamelService *service, gboolean brief)
-{
- char *dir = ((CamelLocalStore*)service)->toplevel_dir;
-
- if (brief)
- return g_strdup (dir);
- else
- return g_strdup_printf (_("Local mail file %s"), dir);
-}
-
-static CamelFolderInfo *
-get_folder_info (CamelStore *store, const char *top,
- guint32 flags, CamelException *ex)
-{
- /* FIXME: This is broken, but it corresponds to what was
- * there before.
- */
-
- d(printf("-- LOCAL STORE -- get folder info: %s\n", top));
-
- return NULL;
-}
-
-static CamelFolderInfo *
-create_folder(CamelStore *store, const char *parent_name, const char *folder_name, CamelException *ex)
-{
- char *path = ((CamelLocalStore *)store)->toplevel_dir;
- char *name;
- CamelFolder *folder;
- CamelFolderInfo *info = NULL;
- struct stat st;
-
- /* This is a pretty hacky version of create folder, but should basically work */
-
- if (path[0] != '/') {
- camel_exception_setv(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
- _("Store root %s is not an absolute path"), path);
- return NULL;
- }
-
- if (parent_name)
- name = g_strdup_printf("%s/%s/%s", path, parent_name, folder_name);
- else
- name = g_strdup_printf("%s/%s", path, folder_name);
-
- if (stat(name, &st) == 0 || errno != ENOENT) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
- _("Cannot get folder: %s: %s"),
- name, g_strerror (errno));
- g_free(name);
- return NULL;
- }
-
- g_free(name);
-
- if (parent_name)
- name = g_strdup_printf("%s/%s", parent_name, folder_name);
- else
- name = g_strdup_printf("%s", folder_name);
-
- folder = ((CamelStoreClass *)((CamelObject *)store)->klass)->get_folder(store, name, CAMEL_STORE_FOLDER_CREATE, ex);
- if (folder) {
- camel_object_unref((CamelObject *)folder);
- info = ((CamelStoreClass *)((CamelObject *)store)->klass)->get_folder_info(store, name, 0, ex);
-
- /* get_folder(CREATE) will emit a folder_created event for us */
- /*if (info)
- camel_object_trigger_event((CamelObject *)store, "folder_created", info);*/
- }
-
- g_free(name);
-
- return info;
-}
-
-static int xrename(const char *oldp, const char *newp, const char *prefix, const char *suffix, int missingok, CamelException *ex)
-{
- struct stat st;
- char *old = g_strconcat(prefix, oldp, suffix, 0);
- char *new = g_strconcat(prefix, newp, suffix, 0);
- int ret = -1;
- int err = 0;
-
- d(printf("renaming %s%s to %s%s\n", oldp, suffix, newp, suffix));
-
- if (stat(old, &st) == -1) {
- if (missingok && errno == ENOENT) {
- ret = 0;
- } else {
- err = errno;
- ret = -1;
- }
- } else if (S_ISDIR(st.st_mode)) { /* use rename for dirs */
- if (rename(old, new) == 0
- || stat(new, &st) == 0) {
- ret = 0;
- } else {
- err = errno;
- ret = -1;
- }
- } else if (link(old, new) == 0 /* and link for files */
- || (stat(new, &st) == 0 && st.st_nlink == 2)) {
- if (unlink(old) == 0) {
- ret = 0;
- } else {
- err = errno;
- unlink(new);
- ret = -1;
- }
- } else {
- err = errno;
- ret = -1;
- }
-
- if (ret == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not rename folder %s to %s: %s"),
- old, new, g_strerror (err));
- }
-
- g_free(old);
- g_free(new);
- return ret;
-}
-
-/* default implementation, rename all */
-static void
-rename_folder(CamelStore *store, const char *old, const char *new, CamelException *ex)
-{
- char *path = CAMEL_LOCAL_STORE (store)->toplevel_dir;
- CamelLocalFolder *folder = NULL;
- char *newibex = g_strdup_printf("%s%s.ibex", path, new);
- char *oldibex = g_strdup_printf("%s%s.ibex", path, old);
-
- /* try to rollback failures, has obvious races */
-
- d(printf("local rename folder '%s' '%s'\n", old, new));
-
- folder = camel_object_bag_get(store->folders, old);
- if (folder && folder->index) {
- if (camel_index_rename(folder->index, newibex) == -1)
- goto ibex_failed;
- } else {
- /* TODO: camel_text_index_rename should find out if we have an active index itself? */
- if (camel_text_index_rename(oldibex, newibex) == -1)
- goto ibex_failed;
- }
-
- if (xrename(old, new, path, ".ev-summary", TRUE, ex))
- goto summary_failed;
-
- if (xrename(old, new, path, "", FALSE, ex))
- goto base_failed;
-
- g_free(newibex);
- g_free(oldibex);
-
- if (folder)
- camel_object_unref(folder);
-
- return;
-
-base_failed:
- xrename(new, old, path, ".ev-summary", TRUE, ex);
-
-summary_failed:
- if (folder) {
- if (folder->index)
- camel_index_rename(folder->index, oldibex);
- } else
- camel_text_index_rename(newibex, oldibex);
-ibex_failed:
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not rename '%s': %s"),
- old, g_strerror (errno));
-
- g_free(newibex);
- g_free(oldibex);
-
- if (folder)
- camel_object_unref(folder);
-}
-
-/* default implementation, only delete metadata */
-static void
-delete_folder(CamelStore *store, const char *folder_name, CamelException *ex)
-{
- CamelFolderInfo *fi;
- CamelException lex;
- CamelFolder *lf;
- char *name;
- char *str;
-
- /* remove metadata only */
- name = g_strdup_printf("%s%s", CAMEL_LOCAL_STORE(store)->toplevel_dir, folder_name);
- str = g_strdup_printf("%s.ev-summary", name);
- if (unlink(str) == -1 && errno != ENOENT) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not delete folder summary file `%s': %s"),
- str, g_strerror (errno));
- g_free(str);
- g_free (name);
- return;
- }
- g_free(str);
- str = g_strdup_printf("%s.ibex", name);
- if (camel_text_index_remove(str) == -1 && errno != ENOENT) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not delete folder index file `%s': %s"),
- str, g_strerror (errno));
- g_free(str);
- g_free (name);
- return;
- }
- g_free(str);
-
- camel_exception_init (&lex);
- if ((lf = camel_store_get_folder (store, folder_name, 0, &lex))) {
- camel_object_get (lf, NULL, CAMEL_OBJECT_STATE_FILE, &str, NULL);
- camel_object_set (lf, NULL, CAMEL_OBJECT_STATE_FILE, NULL, NULL);
- camel_object_unref (lf);
- } else {
- camel_exception_clear (&lex);
- }
-
- if (str == NULL)
- str = g_strdup_printf ("%s.cmeta", name);
-
- if (unlink (str) == -1 && errno != ENOENT) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not delete folder meta file `%s': %s"),
- str, g_strerror (errno));
- g_free (name);
- g_free (str);
- return;
- }
-
- g_free (str);
- g_free (name);
-
- fi = g_new0 (CamelFolderInfo, 1);
- fi->full_name = g_strdup (folder_name);
- fi->name = g_path_get_basename (folder_name);
- fi->url = g_strdup_printf ("%s:%s#%s", ((CamelService *) store)->url->protocol,
- CAMEL_LOCAL_STORE(store)->toplevel_dir, folder_name);
- fi->unread_message_count = -1;
- camel_folder_info_build_path(fi, '/');
-
- camel_object_trigger_event (store, "folder_deleted", fi);
-
- camel_folder_info_free (fi);
-}
diff --git a/camel/providers/local/camel-local-store.h b/camel/providers/local/camel-local-store.h
deleted file mode 100644
index 21d854c562..0000000000
--- a/camel/providers/local/camel-local-store.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-mbox-store.h : class for an mbox store */
-
-/*
- *
- * Copyright (C) 2000 Ximian, Inc. <bertrand@helixcode.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifndef CAMEL_LOCAL_STORE_H
-#define CAMEL_LOCAL_STORE_H 1
-
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include "camel-store.h"
-
-#define CAMEL_LOCAL_STORE_TYPE (camel_local_store_get_type ())
-#define CAMEL_LOCAL_STORE(obj) (CAMEL_CHECK_CAST((obj), CAMEL_LOCAL_STORE_TYPE, CamelLocalStore))
-#define CAMEL_LOCAL_STORE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_LOCAL_STORE_TYPE, CamelLocalStoreClass))
-#define CAMEL_IS_LOCAL_STORE(o) (CAMEL_CHECK_TYPE((o), CAMEL_LOCAL_STORE_TYPE))
-
-
-typedef struct {
- CamelStore parent_object;
- char *toplevel_dir;
-
-} CamelLocalStore;
-
-
-
-typedef struct {
- CamelStoreClass parent_class;
-
-} CamelLocalStoreClass;
-
-
-/* public methods */
-
-/* Standard Camel function */
-CamelType camel_local_store_get_type (void);
-
-const gchar *camel_local_store_get_toplevel_dir (CamelLocalStore *store);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_LOCAL_STORE_H */
-
-
diff --git a/camel/providers/local/camel-local-summary.c b/camel/providers/local/camel-local-summary.c
deleted file mode 100644
index 42534b361d..0000000000
--- a/camel/providers/local/camel-local-summary.c
+++ /dev/null
@@ -1,614 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; fill-column: 160 -*- */
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <ctype.h>
-#include <sys/stat.h>
-#include <sys/uio.h>
-#include <unistd.h>
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include "camel-local-summary.h"
-#include "camel/camel-mime-message.h"
-#include "camel/camel-stream-null.h"
-
-#define w(x)
-#define io(x)
-#define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))*/
-
-#define CAMEL_LOCAL_SUMMARY_VERSION (0x200)
-
-static CamelMessageInfo * message_info_new (CamelFolderSummary *, struct _camel_header_raw *);
-
-static int local_summary_decode_x_evolution(CamelLocalSummary *cls, const char *xev, CamelMessageInfo *mi);
-static char *local_summary_encode_x_evolution(CamelLocalSummary *cls, const CamelMessageInfo *mi);
-
-static int local_summary_load(CamelLocalSummary *cls, int forceindex, CamelException *ex);
-static int local_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changeinfo, CamelException *ex);
-static int local_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex);
-static CamelMessageInfo *local_summary_add(CamelLocalSummary *cls, CamelMimeMessage *msg, const CamelMessageInfo *info, CamelFolderChangeInfo *, CamelException *ex);
-
-static void camel_local_summary_class_init (CamelLocalSummaryClass *klass);
-static void camel_local_summary_init (CamelLocalSummary *obj);
-static void camel_local_summary_finalise (CamelObject *obj);
-static CamelFolderSummaryClass *camel_local_summary_parent;
-
-CamelType
-camel_local_summary_get_type(void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register(camel_folder_summary_get_type(), "CamelLocalSummary",
- sizeof (CamelLocalSummary),
- sizeof (CamelLocalSummaryClass),
- (CamelObjectClassInitFunc) camel_local_summary_class_init,
- NULL,
- (CamelObjectInitFunc) camel_local_summary_init,
- (CamelObjectFinalizeFunc) camel_local_summary_finalise);
- }
-
- return type;
-}
-
-static void
-camel_local_summary_class_init(CamelLocalSummaryClass *klass)
-{
- CamelFolderSummaryClass *sklass = (CamelFolderSummaryClass *) klass;
-
- camel_local_summary_parent = CAMEL_FOLDER_SUMMARY_CLASS(camel_type_get_global_classfuncs(camel_folder_summary_get_type()));
-
- sklass->message_info_new = message_info_new;
-
- klass->load = local_summary_load;
- klass->check = local_summary_check;
- klass->sync = local_summary_sync;
- klass->add = local_summary_add;
-
- klass->encode_x_evolution = local_summary_encode_x_evolution;
- klass->decode_x_evolution = local_summary_decode_x_evolution;
-}
-
-static void
-camel_local_summary_init(CamelLocalSummary *obj)
-{
- struct _CamelFolderSummary *s = (CamelFolderSummary *)obj;
-
- /* subclasses need to set the right instance data sizes */
- s->message_info_size = sizeof(CamelMessageInfo);
- s->content_info_size = sizeof(CamelMessageContentInfo);
-
- /* and a unique file version */
- s->version += CAMEL_LOCAL_SUMMARY_VERSION;
-}
-
-static void
-camel_local_summary_finalise(CamelObject *obj)
-{
- CamelLocalSummary *mbs = CAMEL_LOCAL_SUMMARY(obj);
-
- if (mbs->index)
- camel_object_unref((CamelObject *)mbs->index);
- g_free(mbs->folder_path);
-}
-
-void
-camel_local_summary_construct(CamelLocalSummary *new, const char *filename, const char *local_name, CamelIndex *index)
-{
- camel_folder_summary_set_build_content(CAMEL_FOLDER_SUMMARY(new), FALSE);
- camel_folder_summary_set_filename(CAMEL_FOLDER_SUMMARY(new), filename);
- new->folder_path = g_strdup(local_name);
- new->index = index;
- if (index)
- camel_object_ref((CamelObject *)index);
-}
-
-static int
-local_summary_load(CamelLocalSummary *cls, int forceindex, CamelException *ex)
-{
- return camel_folder_summary_load((CamelFolderSummary *)cls);
-}
-
-/* load/check the summary */
-int
-camel_local_summary_load(CamelLocalSummary *cls, int forceindex, CamelException *ex)
-{
- struct stat st;
- CamelFolderSummary *s = (CamelFolderSummary *)cls;
-
- d(printf("Loading summary ...\n"));
-
- if (forceindex
- || stat(s->summary_path, &st) == -1
- || ((CamelLocalSummaryClass *)(CAMEL_OBJECT_GET_CLASS(cls)))->load(cls, forceindex, ex) == -1) {
- w(g_warning("Could not load summary: flags may be reset"));
- camel_folder_summary_clear((CamelFolderSummary *)cls);
- return -1;
- }
-
- return 0;
-}
-
-void camel_local_summary_check_force(CamelLocalSummary *cls)
-{
- cls->check_force = 1;
-}
-
-char *
-camel_local_summary_encode_x_evolution(CamelLocalSummary *cls, const CamelMessageInfo *info)
-{
- return ((CamelLocalSummaryClass *)(CAMEL_OBJECT_GET_CLASS(cls)))->encode_x_evolution(cls, info);
-}
-
-int
-camel_local_summary_decode_x_evolution(CamelLocalSummary *cls, const char *xev, CamelMessageInfo *info)
-{
- return ((CamelLocalSummaryClass *)(CAMEL_OBJECT_GET_CLASS(cls)))->decode_x_evolution(cls, xev, info);
-}
-
-/*#define DOSTATS*/
-#ifdef DOSTATS
-struct _stat_info {
- int mitotal;
- int micount;
- int citotal;
- int cicount;
- int msgid;
- int msgcount;
-};
-
-static void
-do_stat_ci(CamelLocalSummary *cls, struct _stat_info *info, CamelMessageContentInfo *ci)
-{
- info->cicount++;
- info->citotal += ((CamelFolderSummary *)cls)->content_info_size /*+ 4 memchunks are 1/4 byte overhead per mi */;
- if (ci->id)
- info->citotal += strlen(ci->id) + 4;
- if (ci->description)
- info->citotal += strlen(ci->description) + 4;
- if (ci->encoding)
- info->citotal += strlen(ci->encoding) + 4;
- if (ci->type) {
- CamelContentType *ct = ci->type;
- struct _camel_header_param *param;
-
- info->citotal += sizeof(*ct) + 4;
- if (ct->type)
- info->citotal += strlen(ct->type) + 4;
- if (ct->subtype)
- info->citotal += strlen(ct->subtype) + 4;
- param = ct->params;
- while (param) {
- info->citotal += sizeof(*param) + 4;
- if (param->name)
- info->citotal += strlen(param->name)+4;
- if (param->value)
- info->citotal += strlen(param->value)+4;
- param = param->next;
- }
- }
- ci = ci->childs;
- while (ci) {
- do_stat_ci(cls, info, ci);
- ci = ci->next;
- }
-}
-
-static void
-do_stat_mi(CamelLocalSummary *cls, struct _stat_info *info, CamelMessageInfo *mi)
-{
- info->micount++;
- info->mitotal += ((CamelFolderSummary *)cls)->content_info_size /*+ 4*/;
-
- if (mi->subject)
- info->mitotal += strlen(mi->subject) + 4;
- if (mi->to)
- info->mitotal += strlen(mi->to) + 4;
- if (mi->from)
- info->mitotal += strlen(mi->from) + 4;
- if (mi->cc)
- info->mitotal += strlen(mi->cc) + 4;
- if (mi->uid)
- info->mitotal += strlen(mi->uid) + 4;
-
- if (mi->references) {
- info->mitotal += (mi->references->size-1) * sizeof(CamelSummaryMessageID) + sizeof(CamelSummaryReferences) + 4;
- info->msgid += (mi->references->size) * sizeof(CamelSummaryMessageID);
- info->msgcount += mi->references->size;
- }
-
- /* dont have any user flags yet */
-
- if (mi->content) {
- do_stat_ci(cls, info, mi->content);
- }
-}
-
-#endif
-
-int
-camel_local_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changeinfo, CamelException *ex)
-{
- int ret;
-
- ret = ((CamelLocalSummaryClass *)(CAMEL_OBJECT_GET_CLASS(cls)))->check(cls, changeinfo, ex);
-
-#ifdef DOSTATS
- if (ret != -1) {
- int i;
- CamelFolderSummary *s = (CamelFolderSummary *)cls;
- struct _stat_info stats = { 0 };
-
- for (i=0;i<camel_folder_summary_count(s);i++) {
- CamelMessageInfo *info = camel_folder_summary_index(s, i);
- do_stat_mi(cls, &stats, info);
- camel_folder_summary_info_free(s, info);
- }
-
- printf("\nMemory used by summary:\n\n");
- printf("Total of %d messages\n", camel_folder_summary_count(s));
- printf("Total: %d bytes (ave %f)\n", stats.citotal + stats.mitotal,
- (double)(stats.citotal+stats.mitotal)/(double)camel_folder_summary_count(s));
- printf("Message Info: %d (ave %f)\n", stats.mitotal, (double)stats.mitotal/(double)stats.micount);
- printf("Content Info; %d (ave %f) count %d\n", stats.citotal, (double)stats.citotal/(double)stats.cicount, stats.cicount);
- printf("message id's: %d (ave %f) count %d\n", stats.msgid, (double)stats.msgid/(double)stats.msgcount, stats.msgcount);
- }
-#endif
- return ret;
-}
-
-int
-camel_local_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex)
-{
- return ((CamelLocalSummaryClass *)(CAMEL_OBJECT_GET_CLASS(cls)))->sync(cls, expunge, changeinfo, ex);
-}
-
-CamelMessageInfo *
-camel_local_summary_add(CamelLocalSummary *cls, CamelMimeMessage *msg, const CamelMessageInfo *info, CamelFolderChangeInfo *ci, CamelException *ex)
-{
- return ((CamelLocalSummaryClass *)(CAMEL_OBJECT_GET_CLASS(cls)))->add(cls, msg, info, ci, ex);
-}
-
-/**
- * camel_local_summary_write_headers:
- * @fd:
- * @header:
- * @xevline:
- * @status:
- * @xstatus:
- *
- * Write a bunch of headers to the file @fd. IF xevline is non NULL, then
- * an X-Evolution header line is created at the end of all of the headers.
- * If @status is non NULL, then a Status header line is also written.
- * The headers written are termianted with a blank line.
- *
- * Return value: -1 on error, otherwise the number of bytes written.
- **/
-int
-camel_local_summary_write_headers(int fd, struct _camel_header_raw *header, const char *xevline, const char *status, const char *xstatus)
-{
- int outlen = 0, len;
- int newfd;
- FILE *out;
-
- /* dum de dum, maybe the whole sync function should just use stdio for output */
- newfd = dup(fd);
- if (newfd == -1)
- return -1;
-
- out = fdopen(newfd, "w");
- if (out == NULL) {
- close(newfd);
- errno = EINVAL;
- return -1;
- }
-
- while (header) {
- if (strcmp(header->name, "X-Evolution") != 0
- && (status == NULL || strcmp(header->name, "Status") != 0)
- && (xstatus == NULL || strcmp(header->name, "X-Status") != 0)) {
- len = fprintf(out, "%s:%s\n", header->name, header->value);
- if (len == -1) {
- fclose(out);
- return -1;
- }
- outlen += len;
- }
- header = header->next;
- }
-
- if (status) {
- len = fprintf(out, "Status: %s\n", status);
- if (len == -1) {
- fclose(out);
- return -1;
- }
- outlen += len;
- }
-
- if (xstatus) {
- len = fprintf(out, "X-Status: %s\n", xstatus);
- if (len == -1) {
- fclose(out);
- return -1;
- }
- outlen += len;
- }
-
- if (xevline) {
- len = fprintf(out, "X-Evolution: %s\n", xevline);
- if (len == -1) {
- fclose(out);
- return -1;
- }
- outlen += len;
- }
-
- len = fprintf(out, "\n");
- if (len == -1) {
- fclose(out);
- return -1;
- }
- outlen += len;
-
- if (fclose(out) == -1)
- return -1;
-
- return outlen;
-}
-
-static int
-local_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changeinfo, CamelException *ex)
-{
- /* FIXME: sync index here ? */
- return 0;
-}
-
-static int
-local_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex)
-{
- int ret = 0;
-
- ret = camel_folder_summary_save((CamelFolderSummary *)cls);
- if (ret == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not save summary: %s: %s"),
- cls->folder_path, g_strerror (errno));
-
- g_warning ("Could not save summary for %s: %s", cls->folder_path, strerror (errno));
- }
-
- if (cls->index && camel_index_sync(cls->index) == -1)
- g_warning ("Could not sync index for %s: %s", cls->folder_path, strerror (errno));
-
- return ret;
-}
-
-static CamelMessageInfo *
-local_summary_add(CamelLocalSummary *cls, CamelMimeMessage *msg, const CamelMessageInfo *info, CamelFolderChangeInfo *ci, CamelException *ex)
-{
- CamelMessageInfo *mi;
- char *xev;
-
- d(printf("Adding message to summary\n"));
-
- mi = camel_folder_summary_add_from_message((CamelFolderSummary *)cls, msg);
- if (mi) {
- d(printf("Added, uid = %s\n", mi->uid));
- if (info) {
- CamelTag *tag = info->user_tags;
- CamelFlag *flag = info->user_flags;
-
- while (flag) {
- camel_flag_set(&mi->user_flags, flag->name, TRUE);
- flag = flag->next;
- }
-
- while (tag) {
- camel_tag_set(&mi->user_tags, tag->name, tag->value);
- tag = tag->next;
- }
-
- mi->flags = mi->flags | (info->flags & 0xffff);
- if (info->size)
- mi->size = info->size;
- }
-
- /* we need to calculate the size ourselves */
- if (mi->size == 0) {
- CamelStreamNull *sn = (CamelStreamNull *)camel_stream_null_new();
-
- camel_data_wrapper_write_to_stream((CamelDataWrapper *)msg, (CamelStream *)sn);
- mi->size = sn->written;
- camel_object_unref((CamelObject *)sn);
- }
-
- mi->flags &= ~(CAMEL_MESSAGE_FOLDER_NOXEV|CAMEL_MESSAGE_FOLDER_FLAGGED);
- xev = camel_local_summary_encode_x_evolution(cls, mi);
- camel_medium_set_header((CamelMedium *)msg, "X-Evolution", xev);
- g_free(xev);
- camel_folder_change_info_add_uid(ci, camel_message_info_uid(mi));
- } else {
- d(printf("Failed!\n"));
- camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Unable to add message to summary: unknown reason"));
- }
- return mi;
-}
-
-static char *
-local_summary_encode_x_evolution(CamelLocalSummary *cls, const CamelMessageInfo *mi)
-{
- GString *out = g_string_new("");
- struct _camel_header_param *params = NULL;
- GString *val = g_string_new("");
- CamelFlag *flag = mi->user_flags;
- CamelTag *tag = mi->user_tags;
- char *ret;
- const char *p, *uidstr;
- guint32 uid;
-
- /* FIXME: work out what to do with uid's that aren't stored here? */
- /* FIXME: perhaps make that a mbox folder only issue?? */
- p = uidstr = camel_message_info_uid(mi);
- while (*p && isdigit(*p))
- p++;
- if (*p == 0 && sscanf (uidstr, "%u", &uid) == 1) {
- g_string_printf (out, "%08x-%04x", uid, mi->flags & 0xffff);
- } else {
- g_string_printf (out, "%s-%04x", uidstr, mi->flags & 0xffff);
- }
-
- if (flag || tag) {
- val = g_string_new ("");
-
- if (flag) {
- while (flag) {
- g_string_append (val, flag->name);
- if (flag->next)
- g_string_append_c (val, ',');
- flag = flag->next;
- }
- camel_header_set_param (&params, "flags", val->str);
- g_string_truncate (val, 0);
- }
- if (tag) {
- while (tag) {
- g_string_append (val, tag->name);
- g_string_append_c (val, '=');
- g_string_append (val, tag->value);
- if (tag->next)
- g_string_append_c (val, ',');
- tag = tag->next;
- }
- camel_header_set_param (&params, "tags", val->str);
- }
- g_string_free (val, TRUE);
- camel_header_param_list_format_append (out, params);
- camel_header_param_list_free (params);
- }
- ret = out->str;
- g_string_free (out, FALSE);
-
- return ret;
-}
-
-static int
-local_summary_decode_x_evolution(CamelLocalSummary *cls, const char *xev, CamelMessageInfo *mi)
-{
- struct _camel_header_param *params, *scan;
- guint32 uid, flags;
- char *header;
- int i;
-
- /* check for uid/flags */
- header = camel_header_token_decode(xev);
- if (header && strlen(header) == strlen("00000000-0000")
- && sscanf(header, "%08x-%04x", &uid, &flags) == 2) {
- char uidstr[20];
- if (mi) {
- sprintf(uidstr, "%u", uid);
- camel_message_info_set_uid(mi, g_strdup(uidstr));
- mi->flags = flags;
- }
- } else {
- g_free(header);
- return -1;
- }
- g_free(header);
-
- if (mi == NULL)
- return 0;
-
- /* check for additional data */
- header = strchr(xev, ';');
- if (header) {
- params = camel_header_param_list_decode(header+1);
- scan = params;
- while (scan) {
- if (!strcasecmp(scan->name, "flags")) {
- char **flagv = g_strsplit(scan->value, ",", 1000);
-
- for (i=0;flagv[i];i++) {
- camel_flag_set(&mi->user_flags, flagv[i], TRUE);
- }
- g_strfreev(flagv);
- } else if (!strcasecmp(scan->name, "tags")) {
- char **tagv = g_strsplit(scan->value, ",", 10000);
- char *val;
-
- for (i=0;tagv[i];i++) {
- val = strchr(tagv[i], '=');
- if (val) {
- *val++ = 0;
- camel_tag_set(&mi->user_tags, tagv[i], val);
- val[-1]='=';
- }
- }
- g_strfreev(tagv);
- }
- scan = scan->next;
- }
- camel_header_param_list_free(params);
- }
- return 0;
-}
-
-static CamelMessageInfo *
-message_info_new(CamelFolderSummary *s, struct _camel_header_raw *h)
-{
- CamelMessageInfo *mi;
- CamelLocalSummary *cls = (CamelLocalSummary *)s;
-
- mi = ((CamelFolderSummaryClass *)camel_local_summary_parent)->message_info_new(s, h);
- if (mi) {
- const char *xev;
- int doindex = FALSE;
-
- xev = camel_header_raw_find(&h, "X-Evolution", NULL);
- if (xev==NULL || camel_local_summary_decode_x_evolution(cls, xev, mi) == -1) {
- /* to indicate it has no xev header */
- mi->flags |= CAMEL_MESSAGE_FOLDER_FLAGGED | CAMEL_MESSAGE_FOLDER_NOXEV;
- camel_message_info_set_uid(mi, camel_folder_summary_next_uid_string(s));
-
- /* shortcut, no need to look it up in the index library */
- doindex = TRUE;
- }
-
- if (cls->index
- && (doindex
- || cls->index_force
- || !camel_index_has_name(cls->index, camel_message_info_uid(mi)))) {
- d(printf("Am indexing message %s\n", camel_message_info_uid(mi)));
- camel_folder_summary_set_index(s, cls->index);
- } else {
- d(printf("Not indexing message %s\n", camel_message_info_uid(mi)));
- camel_folder_summary_set_index(s, NULL);
- }
- }
-
- return mi;
-}
diff --git a/camel/providers/local/camel-local-summary.h b/camel/providers/local/camel-local-summary.h
deleted file mode 100644
index 25d77e62c3..0000000000
--- a/camel/providers/local/camel-local-summary.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef _CAMEL_LOCAL_SUMMARY_H
-#define _CAMEL_LOCAL_SUMMARY_H
-
-#include <camel/camel-folder-summary.h>
-#include <camel/camel-folder.h>
-#include <camel/camel-exception.h>
-#include <camel/camel-index.h>
-
-#define CAMEL_LOCAL_SUMMARY(obj) CAMEL_CHECK_CAST (obj, camel_local_summary_get_type (), CamelLocalSummary)
-#define CAMEL_LOCAL_SUMMARY_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_local_summary_get_type (), CamelLocalSummaryClass)
-#define CAMEL_IS_LOCAL_SUMMARY(obj) CAMEL_CHECK_TYPE (obj, camel_local_summary_get_type ())
-
-typedef struct _CamelLocalSummary CamelLocalSummary;
-typedef struct _CamelLocalSummaryClass CamelLocalSummaryClass;
-
-/* extra summary flags */
-enum {
- CAMEL_MESSAGE_FOLDER_NOXEV = 1<<17,
- CAMEL_MESSAGE_FOLDER_XEVCHANGE = 1<<18,
- CAMEL_MESSAGE_FOLDER_NOTSEEN = 1<<19, /* have we seen this in processing this loop? */
-};
-
-struct _CamelLocalSummary {
- CamelFolderSummary parent;
-
- char *folder_path; /* name of matching folder */
-
- CamelIndex *index;
- unsigned int index_force:1; /* do we force index during creation? */
- unsigned int check_force:1; /* does a check force a full check? */
-};
-
-struct _CamelLocalSummaryClass {
- CamelFolderSummaryClass parent_class;
-
- int (*load)(CamelLocalSummary *cls, int forceindex, CamelException *ex);
- int (*check)(CamelLocalSummary *cls, CamelFolderChangeInfo *changeinfo, CamelException *ex);
- int (*sync)(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex);
- CamelMessageInfo *(*add)(CamelLocalSummary *cls, CamelMimeMessage *msg, const CamelMessageInfo *info, CamelFolderChangeInfo *, CamelException *ex);
-
- char *(*encode_x_evolution)(CamelLocalSummary *cls, const CamelMessageInfo *info);
- int (*decode_x_evolution)(CamelLocalSummary *cls, const char *xev, CamelMessageInfo *info);
-};
-
-CamelType camel_local_summary_get_type (void);
-void camel_local_summary_construct (CamelLocalSummary *new, const char *filename, const char *local_name, CamelIndex *index);
-
-/* load/check the summary */
-int camel_local_summary_load(CamelLocalSummary *cls, int forceindex, CamelException *ex);
-/* check for new/removed messages */
-int camel_local_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *, CamelException *ex);
-/* perform a folder sync or expunge, if needed */
-int camel_local_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInfo *, CamelException *ex);
-/* add a new message to the summary */
-CamelMessageInfo *camel_local_summary_add(CamelLocalSummary *cls, CamelMimeMessage *msg, const CamelMessageInfo *info, CamelFolderChangeInfo *, CamelException *ex);
-
-/* force the next check to be a full check/rebuild */
-void camel_local_summary_check_force(CamelLocalSummary *cls);
-
-/* generate an X-Evolution header line */
-char *camel_local_summary_encode_x_evolution(CamelLocalSummary *cls, const CamelMessageInfo *info);
-int camel_local_summary_decode_x_evolution(CamelLocalSummary *cls, const char *xev, CamelMessageInfo *info);
-
-/* utility functions - write headers to a file with optional X-Evolution header and/or status header */
-int camel_local_summary_write_headers(int fd, struct _camel_header_raw *header, const char *xevline, const char *status, const char *xstatus);
-
-#endif /* ! _CAMEL_LOCAL_SUMMARY_H */
-
diff --git a/camel/providers/local/camel-maildir-folder.c b/camel/providers/local/camel-maildir-folder.c
deleted file mode 100644
index eca07efbef..0000000000
--- a/camel/providers/local/camel-maildir-folder.c
+++ /dev/null
@@ -1,245 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; fill-column: 160 -*-
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * Copyright (C) 1999, 2003 Ximian Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdlib.h>
-#include <sys/types.h>
-#include <dirent.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <errno.h>
-#include <string.h>
-#include <fcntl.h>
-
-#include "camel-maildir-folder.h"
-#include "camel-maildir-store.h"
-#include "camel-stream-fs.h"
-#include "camel-maildir-summary.h"
-#include "camel-data-wrapper.h"
-#include "camel-mime-message.h"
-#include "camel-exception.h"
-
-#define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))*/
-
-static CamelLocalFolderClass *parent_class = NULL;
-
-/* Returns the class for a CamelMaildirFolder */
-#define CMAILDIRF_CLASS(so) CAMEL_MAILDIR_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-#define CF_CLASS(so) CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-#define CMAILDIRS_CLASS(so) CAMEL_STORE_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-
-static CamelLocalSummary *maildir_create_summary(const char *path, const char *folder, CamelIndex *index);
-
-static void maildir_append_message(CamelFolder * folder, CamelMimeMessage * message, const CamelMessageInfo *info, char **appended_uid, CamelException * ex);
-static CamelMimeMessage *maildir_get_message(CamelFolder * folder, const gchar * uid, CamelException * ex);
-
-static void maildir_finalize(CamelObject * object);
-
-static void camel_maildir_folder_class_init(CamelObjectClass * camel_maildir_folder_class)
-{
- CamelFolderClass *camel_folder_class = CAMEL_FOLDER_CLASS(camel_maildir_folder_class);
- CamelLocalFolderClass *lclass = (CamelLocalFolderClass *)camel_maildir_folder_class;
-
- parent_class = CAMEL_LOCAL_FOLDER_CLASS (camel_type_get_global_classfuncs(camel_local_folder_get_type()));
-
- /* virtual method definition */
-
- /* virtual method overload */
- camel_folder_class->append_message = maildir_append_message;
- camel_folder_class->get_message = maildir_get_message;
-
- lclass->create_summary = maildir_create_summary;
-}
-
-static void maildir_init(gpointer object, gpointer klass)
-{
- /*CamelFolder *folder = object;
- CamelMaildirFolder *maildir_folder = object;*/
-}
-
-static void maildir_finalize(CamelObject * object)
-{
- /*CamelMaildirFolder *maildir_folder = CAMEL_MAILDIR_FOLDER(object);*/
-}
-
-CamelType camel_maildir_folder_get_type(void)
-{
- static CamelType camel_maildir_folder_type = CAMEL_INVALID_TYPE;
-
- if (camel_maildir_folder_type == CAMEL_INVALID_TYPE) {
- camel_maildir_folder_type = camel_type_register(CAMEL_LOCAL_FOLDER_TYPE, "CamelMaildirFolder",
- sizeof(CamelMaildirFolder),
- sizeof(CamelMaildirFolderClass),
- (CamelObjectClassInitFunc) camel_maildir_folder_class_init,
- NULL,
- (CamelObjectInitFunc) maildir_init,
- (CamelObjectFinalizeFunc) maildir_finalize);
- }
-
- return camel_maildir_folder_type;
-}
-
-CamelFolder *
-camel_maildir_folder_new(CamelStore *parent_store, const char *full_name, guint32 flags, CamelException *ex)
-{
- CamelFolder *folder;
-
- d(printf("Creating maildir folder: %s\n", full_name));
-
- folder = (CamelFolder *)camel_object_new(CAMEL_MAILDIR_FOLDER_TYPE);
-
- if (parent_store->flags & CAMEL_STORE_FILTER_INBOX
- && strcmp(full_name, ".") == 0)
- folder->folder_flags |= CAMEL_FOLDER_FILTER_RECENT;
-
- folder = (CamelFolder *)camel_local_folder_construct((CamelLocalFolder *)folder,
- parent_store, full_name, flags, ex);
-
- return folder;
-}
-
-static CamelLocalSummary *maildir_create_summary(const char *path, const char *folder, CamelIndex *index)
-{
- return (CamelLocalSummary *)camel_maildir_summary_new(path, folder, index);
-}
-
-static void
-maildir_append_message (CamelFolder *folder, CamelMimeMessage *message, const CamelMessageInfo *info, char **appended_uid, CamelException *ex)
-{
- CamelMaildirFolder *maildir_folder = (CamelMaildirFolder *)folder;
- CamelLocalFolder *lf = (CamelLocalFolder *)folder;
- CamelStream *output_stream;
- CamelMessageInfo *mi;
- CamelMaildirMessageInfo *mdi;
- char *name, *dest = NULL;
-
- d(printf("Appending message\n"));
-
- /* add it to the summary/assign the uid, etc */
- mi = camel_local_summary_add((CamelLocalSummary *)folder->summary, message, info, lf->changes, ex);
- if (camel_exception_is_set (ex))
- return;
-
- mdi = (CamelMaildirMessageInfo *)mi;
-
- d(printf("Appending message: uid is %s filename is %s\n", camel_message_info_uid(mi), mdi->filename));
-
- /* write it out to tmp, use the uid we got from the summary */
- name = g_strdup_printf ("%s/tmp/%s", lf->folder_path, camel_message_info_uid(mi));
- output_stream = camel_stream_fs_new_with_name (name, O_WRONLY|O_CREAT, 0600);
- if (output_stream == NULL)
- goto fail_write;
-
- if (camel_data_wrapper_write_to_stream ((CamelDataWrapper *)message, output_stream) == -1
- || camel_stream_close (output_stream) == -1)
- goto fail_write;
-
- /* now move from tmp to cur (bypass new, does it matter?) */
- dest = g_strdup_printf("%s/cur/%s", lf->folder_path, camel_maildir_info_filename (mdi));
- if (rename (name, dest) == 1)
- goto fail_write;
-
- g_free (dest);
- g_free (name);
-
- camel_object_trigger_event (CAMEL_OBJECT (folder), "folder_changed",
- ((CamelLocalFolder *)maildir_folder)->changes);
- camel_folder_change_info_clear (((CamelLocalFolder *)maildir_folder)->changes);
-
- if (appended_uid)
- *appended_uid = g_strdup(camel_message_info_uid(mi));
-
- return;
-
- fail_write:
-
- /* remove the summary info so we are not out-of-sync with the mh folder */
- camel_folder_summary_remove_uid (CAMEL_FOLDER_SUMMARY (folder->summary),
- camel_message_info_uid (mi));
-
- if (errno == EINTR)
- camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
- _("Maildir append message cancelled"));
- else
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Cannot append message to maildir folder: %s: %s"),
- name, g_strerror (errno));
-
- if (output_stream) {
- camel_object_unref (CAMEL_OBJECT (output_stream));
- unlink (name);
- }
-
- g_free (name);
- g_free (dest);
-}
-
-static CamelMimeMessage *maildir_get_message(CamelFolder * folder, const gchar * uid, CamelException * ex)
-{
- CamelLocalFolder *lf = (CamelLocalFolder *)folder;
- CamelStream *message_stream = NULL;
- CamelMimeMessage *message = NULL;
- CamelMessageInfo *info;
- char *name;
- CamelMaildirMessageInfo *mdi;
-
- d(printf("getting message: %s\n", uid));
-
- /* get the message summary info */
- if ((info = camel_folder_summary_uid(folder->summary, uid)) == NULL) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_FOLDER_INVALID_UID, _("Cannot get message: %s\n %s"), uid, _("No such message"));
- return NULL;
- }
-
- mdi = (CamelMaildirMessageInfo *)info;
-
- /* what do we do if the message flags (and :info data) changes? filename mismatch - need to recheck I guess */
- name = g_strdup_printf("%s/cur/%s", lf->folder_path, camel_maildir_info_filename(mdi));
-
- camel_folder_summary_info_free(folder->summary, info);
-
- if ((message_stream = camel_stream_fs_new_with_name(name, O_RDONLY, 0)) == NULL) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID_UID,
- _("Cannot get message: %s\n %s"),
- name, g_strerror (errno));
- g_free(name);
- return NULL;
- }
-
- message = camel_mime_message_new();
- if (camel_data_wrapper_construct_from_stream((CamelDataWrapper *)message, message_stream) == -1) {
- camel_exception_setv(ex, (errno==EINTR)?CAMEL_EXCEPTION_USER_CANCEL:CAMEL_EXCEPTION_FOLDER_INVALID_UID,
- _("Cannot get message: %s\n %s"),
- name, _("Invalid message contents"));
- g_free(name);
- camel_object_unref((CamelObject *)message_stream);
- camel_object_unref((CamelObject *)message);
- return NULL;
-
- }
- camel_object_unref((CamelObject *)message_stream);
- g_free(name);
-
- return message;
-}
diff --git a/camel/providers/local/camel-maildir-folder.h b/camel/providers/local/camel-maildir-folder.h
deleted file mode 100644
index c495d9b14d..0000000000
--- a/camel/providers/local/camel-maildir-folder.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Authors:
- * Michael Zucchi <notzed@ximian.com>
- *
- * Copyright (C) 1999 Ximian Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifndef CAMEL_MAILDIR_FOLDER_H
-#define CAMEL_MAILDIR_FOLDER_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus } */
-#include "camel-local-folder.h"
-
-#define CAMEL_MAILDIR_FOLDER_TYPE (camel_maildir_folder_get_type ())
-#define CAMEL_MAILDIR_FOLDER(obj) (CAMEL_CHECK_CAST((obj), CAMEL_MAILDIR_FOLDER_TYPE, CamelMaildirFolder))
-#define CAMEL_MAILDIR_FOLDER_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_MAILDIR_FOLDER_TYPE, CamelMaildirFolderClass))
-#define CAMEL_IS_MAILDIR_FOLDER(o) (CAMEL_CHECK_TYPE((o), CAMEL_MAILDIR_FOLDER_TYPE))
-
-typedef struct {
- CamelLocalFolder parent_object;
-
-} CamelMaildirFolder;
-
-typedef struct {
- CamelLocalFolderClass parent_class;
-
- /* Virtual methods */
-
-} CamelMaildirFolderClass;
-
-/* public methods */
-CamelFolder *camel_maildir_folder_new(CamelStore *parent_store, const char *full_name, guint32 flags, CamelException *ex);
-
-/* Standard Camel function */
-CamelType camel_maildir_folder_get_type(void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-#endif /* CAMEL_MAILDIR_FOLDER_H */
diff --git a/camel/providers/local/camel-maildir-store.c b/camel/providers/local/camel-maildir-store.c
deleted file mode 100644
index c84c37158c..0000000000
--- a/camel/providers/local/camel-maildir-store.c
+++ /dev/null
@@ -1,416 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Copyright (C) 2000 Ximian, Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <dirent.h>
-
-#include "camel-maildir-store.h"
-#include "camel-maildir-folder.h"
-#include "camel-exception.h"
-#include "camel-url.h"
-#include "camel-private.h"
-
-#define d(x)
-
-static CamelLocalStoreClass *parent_class = NULL;
-
-/* Returns the class for a CamelMaildirStore */
-#define CMAILDIRS_CLASS(so) CAMEL_MAILDIR_STORE_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-#define CF_CLASS(so) CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-#define CMAILDIRF_CLASS(so) CAMEL_MAILDIR_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-
-static CamelFolder *get_folder(CamelStore * store, const char *folder_name, guint32 flags, CamelException * ex);
-static CamelFolder *get_inbox (CamelStore *store, CamelException *ex);
-static void delete_folder(CamelStore * store, const char *folder_name, CamelException * ex);
-
-static CamelFolderInfo * get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelException *ex);
-
-static void camel_maildir_store_class_init(CamelObjectClass * camel_maildir_store_class)
-{
- CamelStoreClass *camel_store_class = CAMEL_STORE_CLASS(camel_maildir_store_class);
- /*CamelServiceClass *camel_service_class = CAMEL_SERVICE_CLASS(camel_maildir_store_class);*/
-
- parent_class = (CamelLocalStoreClass *)camel_type_get_global_classfuncs(camel_local_store_get_type());
-
- /* virtual method overload, use defaults for most */
- camel_store_class->get_folder = get_folder;
- camel_store_class->get_inbox = get_inbox;
- camel_store_class->delete_folder = delete_folder;
-
- camel_store_class->get_folder_info = get_folder_info;
- camel_store_class->free_folder_info = camel_store_free_folder_info_full;
-}
-
-CamelType camel_maildir_store_get_type(void)
-{
- static CamelType camel_maildir_store_type = CAMEL_INVALID_TYPE;
-
- if (camel_maildir_store_type == CAMEL_INVALID_TYPE) {
- camel_maildir_store_type = camel_type_register(CAMEL_LOCAL_STORE_TYPE, "CamelMaildirStore",
- sizeof(CamelMaildirStore),
- sizeof(CamelMaildirStoreClass),
- (CamelObjectClassInitFunc) camel_maildir_store_class_init,
- NULL,
- NULL,
- NULL);
- }
-
- return camel_maildir_store_type;
-}
-
-static CamelFolder *
-get_folder(CamelStore * store, const char *folder_name, guint32 flags, CamelException * ex)
-{
- char *name, *tmp, *cur, *new;
- struct stat st;
- CamelFolder *folder = NULL;
-
- if (!((CamelStoreClass *)parent_class)->get_folder(store, folder_name, flags, ex))
- return NULL;
-
- name = g_strdup_printf("%s%s", CAMEL_LOCAL_STORE(store)->toplevel_dir, folder_name);
- tmp = g_strdup_printf("%s/tmp", name);
- cur = g_strdup_printf("%s/cur", name);
- new = g_strdup_printf("%s/new", name);
-
- if (stat(name, &st) == -1) {
- if (errno != ENOENT) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not open folder `%s':\n%s"),
- folder_name, g_strerror (errno));
- } else if ((flags & CAMEL_STORE_FOLDER_CREATE) == 0) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
- _("Folder `%s' does not exist."), folder_name);
- } else {
- if (mkdir(name, 0700) != 0
- || mkdir(tmp, 0700) != 0
- || mkdir(cur, 0700) != 0
- || mkdir(new, 0700) != 0) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not create folder `%s':\n%s"),
- folder_name, g_strerror (errno));
- rmdir(tmp);
- rmdir(cur);
- rmdir(new);
- rmdir(name);
- } else {
- folder = camel_maildir_folder_new(store, folder_name, flags, ex);
- }
- }
- } else if (!S_ISDIR(st.st_mode)
- || stat(tmp, &st) != 0 || !S_ISDIR(st.st_mode)
- || stat(cur, &st) != 0 || !S_ISDIR(st.st_mode)
- || stat(new, &st) != 0 || !S_ISDIR(st.st_mode)) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
- _("`%s' is not a maildir directory."), name);
- } else {
- folder = camel_maildir_folder_new(store, folder_name, flags, ex);
- }
-
- g_free(name);
- g_free(tmp);
- g_free(cur);
- g_free(new);
-
- return folder;
-}
-
-static CamelFolder *
-get_inbox (CamelStore *store, CamelException *ex)
-{
- return get_folder (store, ".", 0, ex);
-}
-
-static void delete_folder(CamelStore * store, const char *folder_name, CamelException * ex)
-{
- char *name, *tmp, *cur, *new;
- struct stat st;
-
- name = g_strdup_printf("%s%s", CAMEL_LOCAL_STORE(store)->toplevel_dir, folder_name);
-
- tmp = g_strdup_printf("%s/tmp", name);
- cur = g_strdup_printf("%s/cur", name);
- new = g_strdup_printf("%s/new", name);
-
- if (stat(name, &st) == -1 || !S_ISDIR(st.st_mode)
- || stat(tmp, &st) == -1 || !S_ISDIR(st.st_mode)
- || stat(cur, &st) == -1 || !S_ISDIR(st.st_mode)
- || stat(new, &st) == -1 || !S_ISDIR(st.st_mode)) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not delete folder `%s': %s"),
- folder_name, errno ? g_strerror (errno) :
- _("not a maildir directory"));
- } else {
- int err = 0;
-
- /* remove subdirs first - will fail if not empty */
- if (rmdir(cur) == -1 || rmdir(new) == -1) {
- err = errno;
- } else {
- DIR *dir;
- struct dirent *d;
-
- /* for tmp (only), its contents is irrelevant */
- dir = opendir(tmp);
- if (dir) {
- while ( (d=readdir(dir)) ) {
- char *name = d->d_name, *file;
-
- if (!strcmp(name, ".") || !strcmp(name, ".."))
- continue;
- file = g_strdup_printf("%s/%s", tmp, name);
- unlink(file);
- g_free(file);
- }
- closedir(dir);
- }
- if (rmdir(tmp) == -1 || rmdir(name) == -1)
- err = errno;
- }
-
- if (err != 0) {
- /* easier just to mkdir all (and let them fail), than remember what we got to */
- mkdir(name, 0700);
- mkdir(cur, 0700);
- mkdir(new, 0700);
- mkdir(tmp, 0700);
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not delete folder `%s': %s"),
- folder_name, g_strerror (err));
- } else {
- /* and remove metadata */
- ((CamelStoreClass *)parent_class)->delete_folder(store, folder_name, ex);
- }
- }
-
- g_free(name);
- g_free(tmp);
- g_free(cur);
- g_free(new);
-}
-
-static CamelFolderInfo *camel_folder_info_new(const char *url, const char *full, const char *name, int unread)
-{
- CamelFolderInfo *fi;
-
- fi = g_malloc0(sizeof(*fi));
- fi->url = g_strdup(url);
- fi->full_name = g_strdup(full);
- fi->name = g_strdup(name);
- fi->unread_message_count = unread;
- camel_folder_info_build_path(fi, '/');
-
- d(printf("Adding maildir info: '%s' '%s' '%s' '%s'\n", fi->path, fi->name, fi->full_name, fi->url));
-
- return fi;
-}
-
-/* used to find out where we've visited already */
-struct _inode {
- dev_t dnode;
- ino_t inode;
-};
-
-/* returns number of records found at or below this level */
-static int scan_dir(CamelStore *store, GHashTable *visited, char *root, const char *path, guint32 flags, CamelFolderInfo *parent, CamelFolderInfo **fip, CamelException *ex)
-{
- DIR *dir;
- struct dirent *d;
- char *name, *uri, *tmp, *cur, *new;
- const char *base;
- CamelFolderInfo *fi = NULL;
- struct stat st;
- CamelFolder *folder;
- int unread;
-
- /* look for folders matching the right structure, recursively */
- name = g_strdup_printf("%s/%s", root, path);
-
- d(printf("checking dir '%s' part '%s' for maildir content\n", root, path));
-
- tmp = g_strdup_printf("%s/tmp", name);
- cur = g_strdup_printf("%s/cur", name);
- new = g_strdup_printf("%s/new", name);
-
- if (stat(tmp, &st) == 0 && S_ISDIR(st.st_mode)
- && stat(cur, &st) == 0 && S_ISDIR(st.st_mode)
- && stat(new, &st) == 0 && S_ISDIR(st.st_mode)) {
- uri = g_strdup_printf("maildir:%s#%s", root, path);
- } else
- uri = g_strdup_printf("maildir:%s;noselect=yes#%s", root, path);
-
- base = strrchr(path, '/');
- if (base)
- base++;
- else
- base = path;
-
- /* if we have this folder open, get the real unread count */
- folder = camel_object_bag_get(store->folders, path);
- if (folder) {
- if ((flags & CAMEL_STORE_FOLDER_INFO_FAST) == 0)
- camel_folder_refresh_info(folder, NULL);
- unread = camel_folder_get_unread_message_count(folder);
- camel_object_unref(folder);
- } else {
- unread = -1;
- }
-
- /* if we dont have a folder, then scan the directory and get the unread
- count from there, which is reasonably cheap (on decent filesystem) */
- /* Well we could get this from the summary, but this is more accurate */
- if (folder == NULL
- && (flags & CAMEL_STORE_FOLDER_INFO_FAST) == 0) {
- unread = 0;
- dir = opendir(new);
- if (dir) {
- /* we assume that all files here are unread ones */
- while ( (d = readdir(dir)) ) {
- if (d->d_name[0] != '.')
- unread++;
- }
- closedir(dir);
- }
- dir = opendir(cur);
- if (dir) {
- /* any files with flags but not the 'S' (seen) flag are unread */
- while ( (d = readdir(dir)) ) {
- char *p = strstr(d->d_name, ":2,");
-
- if (p && strchr(p, 'S') == NULL)
- unread++;
- }
- closedir(dir);
- }
- }
-
- fi = camel_folder_info_new(uri, path, base, unread);
-
- d(printf("found! uri = %s\n", fi->url));
- d(printf(" full_name = %s\n name = '%s'\n", fi->full_name, fi->name));
-
- fi->parent = parent;
- fi->sibling = *fip;
- *fip = fi;
- g_free(uri);
-
- g_free(tmp);
- g_free(cur);
- g_free(new);
-
- unread = 0;
-
- /* always look further if asked */
- if (((flags & CAMEL_STORE_FOLDER_INFO_RECURSIVE) || parent == NULL)) {
- dir = opendir(name);
- if (dir == NULL) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not scan folder `%s': %s"),
- root, g_strerror (errno));
- g_free(name);
- return -1;
- }
-
- while ( (d = readdir(dir)) ) {
- if (strcmp(d->d_name, "tmp") == 0
- || strcmp(d->d_name, "cur") == 0
- || strcmp(d->d_name, "new") == 0
- || strcmp(d->d_name, ".") == 0
- || strcmp(d->d_name, "..") == 0)
- continue;
-
- tmp = g_strdup_printf("%s/%s", name, d->d_name);
- if (stat(tmp, &st) == 0 && S_ISDIR(st.st_mode)) {
- struct _inode in = { st.st_dev, st.st_ino };
-
- /* see if we've visited already */
- if (g_hash_table_lookup(visited, &in) == NULL) {
- struct _inode *inew = g_malloc(sizeof(*inew));
-
- *inew = in;
- g_hash_table_insert(visited, inew, inew);
- new = g_strdup_printf("%s/%s", path, d->d_name);
- if (scan_dir(store, visited, root, new, flags, fi, &fi->child, ex) == -1) {
- g_free(tmp);
- g_free(new);
- closedir(dir);
- return -1;
- }
- g_free(new);
- }
- }
- g_free(tmp);
- }
- closedir(dir);
- }
-
- g_free(name);
-
- return 0;
-}
-
-static guint inode_hash(const void *d)
-{
- const struct _inode *v = d;
-
- return v->inode ^ v->dnode;
-}
-
-static gboolean inode_equal(const void *a, const void *b)
-{
- const struct _inode *v1 = a, *v2 = b;
-
- return v1->inode == v2->inode && v1->dnode == v2->dnode;
-}
-
-static void inode_free(void *k, void *v, void *d)
-{
- g_free(k);
-}
-
-static CamelFolderInfo *
-get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelException *ex)
-{
- CamelFolderInfo *fi = NULL;
- CamelLocalStore *local_store = (CamelLocalStore *)store;
- GHashTable *visited;
-
- visited = g_hash_table_new(inode_hash, inode_equal);
-
- if (scan_dir(store, visited, ((CamelService *)local_store)->url->path, top?top:".", flags, NULL, &fi, ex) == -1 && fi != NULL) {
- camel_store_free_folder_info_full(store, fi);
- fi = NULL;
- }
-
- g_hash_table_foreach(visited, inode_free, NULL);
- g_hash_table_destroy(visited);
-
- return fi;
-}
diff --git a/camel/providers/local/camel-maildir-store.h b/camel/providers/local/camel-maildir-store.h
deleted file mode 100644
index f7725bc189..0000000000
--- a/camel/providers/local/camel-maildir-store.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Copyright (C) 2000 Ximian, Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifndef CAMEL_MAILDIR_STORE_H
-#define CAMEL_MAILDIR_STORE_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus } */
-
-#include "camel-local-store.h"
-
-#define CAMEL_MAILDIR_STORE_TYPE (camel_maildir_store_get_type ())
-#define CAMEL_MAILDIR_STORE(obj) (CAMEL_CHECK_CAST((obj), CAMEL_MAILDIR_STORE_TYPE, CamelMaildirStore))
-#define CAMEL_MAILDIR_STORE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_MAILDIR_STORE_TYPE, CamelMaildirStoreClass))
-#define CAMEL_IS_MAILDIR_STORE(o) (CAMEL_CHECK_TYPE((o), CAMEL_MAILDIR_STORE_TYPE))
-
-typedef struct {
- CamelLocalStore parent_object;
-
-} CamelMaildirStore;
-
-typedef struct {
- CamelLocalStoreClass parent_class;
-
-} CamelMaildirStoreClass;
-
-/* public methods */
-
-/* Standard Camel function */
-CamelType camel_maildir_store_get_type(void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-#endif /* CAMEL_MAILDIR_STORE_H */
diff --git a/camel/providers/local/camel-maildir-summary.c b/camel/providers/local/camel-maildir-summary.c
deleted file mode 100644
index 37e1ac2ce7..0000000000
--- a/camel/providers/local/camel-maildir-summary.c
+++ /dev/null
@@ -1,807 +0,0 @@
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Not Zed <notzed@lostzed.mmc.com.au>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <sys/uio.h>
-#include <unistd.h>
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include <sys/types.h>
-#include <dirent.h>
-
-#include <ctype.h>
-
-#include "camel-maildir-summary.h"
-#include <camel/camel-mime-message.h>
-#include <camel/camel-operation.h>
-
-#include "camel-private.h"
-#include "e-util/e-memory.h"
-
-#define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))*/
-
-#define CAMEL_MAILDIR_SUMMARY_VERSION (0x2000)
-
-static CamelMessageInfo *message_info_load(CamelFolderSummary *s, FILE *in);
-static CamelMessageInfo *message_info_new(CamelFolderSummary *, struct _camel_header_raw *);
-static void message_info_free(CamelFolderSummary *, CamelMessageInfo *mi);
-
-static int maildir_summary_load(CamelLocalSummary *cls, int forceindex, CamelException *ex);
-static int maildir_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changeinfo, CamelException *ex);
-static int maildir_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex);
-static CamelMessageInfo *maildir_summary_add(CamelLocalSummary *cls, CamelMimeMessage *msg, const CamelMessageInfo *info, CamelFolderChangeInfo *, CamelException *ex);
-
-static char *maildir_summary_next_uid_string(CamelFolderSummary *s);
-static int maildir_summary_decode_x_evolution(CamelLocalSummary *cls, const char *xev, CamelMessageInfo *mi);
-static char *maildir_summary_encode_x_evolution(CamelLocalSummary *cls, const CamelMessageInfo *mi);
-
-static void camel_maildir_summary_class_init (CamelMaildirSummaryClass *class);
-static void camel_maildir_summary_init (CamelMaildirSummary *gspaper);
-static void camel_maildir_summary_finalise (CamelObject *obj);
-
-#define _PRIVATE(x) (((CamelMaildirSummary *)(x))->priv)
-
-struct _CamelMaildirSummaryPrivate {
- char *current_file;
- char *hostname;
-
- GHashTable *load_map;
-};
-
-static CamelLocalSummaryClass *parent_class;
-
-CamelType
-camel_maildir_summary_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register(camel_local_summary_get_type (), "CamelMaildirSummary",
- sizeof(CamelMaildirSummary),
- sizeof(CamelMaildirSummaryClass),
- (CamelObjectClassInitFunc)camel_maildir_summary_class_init,
- NULL,
- (CamelObjectInitFunc)camel_maildir_summary_init,
- (CamelObjectFinalizeFunc)camel_maildir_summary_finalise);
- }
-
- return type;
-}
-
-static void
-camel_maildir_summary_class_init (CamelMaildirSummaryClass *class)
-{
- CamelFolderSummaryClass *sklass = (CamelFolderSummaryClass *) class;
- CamelLocalSummaryClass *lklass = (CamelLocalSummaryClass *)class;
-
- parent_class = (CamelLocalSummaryClass *)camel_type_get_global_classfuncs(camel_local_summary_get_type ());
-
- /* override methods */
- sklass->message_info_load = message_info_load;
- sklass->message_info_new = message_info_new;
- sklass->message_info_free = message_info_free;
- sklass->next_uid_string = maildir_summary_next_uid_string;
-
- lklass->load = maildir_summary_load;
- lklass->check = maildir_summary_check;
- lklass->sync = maildir_summary_sync;
- lklass->add = maildir_summary_add;
- lklass->encode_x_evolution = maildir_summary_encode_x_evolution;
- lklass->decode_x_evolution = maildir_summary_decode_x_evolution;
-}
-
-static void
-camel_maildir_summary_init (CamelMaildirSummary *o)
-{
- struct _CamelFolderSummary *s = (CamelFolderSummary *) o;
- char hostname[256];
-
- o->priv = g_malloc0(sizeof(*o->priv));
- /* set unique file version */
- s->version += CAMEL_MAILDIR_SUMMARY_VERSION;
-
- s->message_info_size = sizeof(CamelMaildirMessageInfo);
- s->content_info_size = sizeof(CamelMaildirMessageContentInfo);
-
-#if defined (DOEPOOLV) || defined (DOESTRV)
- s->message_info_strings = CAMEL_MAILDIR_INFO_LAST;
-#endif
-
- if (gethostname(hostname, 256) == 0) {
- o->priv->hostname = g_strdup(hostname);
- } else {
- o->priv->hostname = g_strdup("localhost");
- }
-}
-
-static void
-camel_maildir_summary_finalise(CamelObject *obj)
-{
- CamelMaildirSummary *o = (CamelMaildirSummary *)obj;
-
- g_free(o->priv->hostname);
- g_free(o->priv);
-}
-
-/**
- * camel_maildir_summary_new:
- *
- * Create a new CamelMaildirSummary object.
- *
- * Return value: A new #CamelMaildirSummary object.
- **/
-CamelMaildirSummary *camel_maildir_summary_new (const char *filename, const char *maildirdir, CamelIndex *index)
-{
- CamelMaildirSummary *o = (CamelMaildirSummary *)camel_object_new(camel_maildir_summary_get_type ());
-
- camel_local_summary_construct((CamelLocalSummary *)o, filename, maildirdir, index);
- return o;
-}
-
-/* the 'standard' maildir flags. should be defined in sorted order. */
-static struct {
- char flag;
- guint32 flagbit;
-} flagbits[] = {
- { 'F', CAMEL_MESSAGE_FLAGGED },
- { 'R', CAMEL_MESSAGE_ANSWERED },
- { 'S', CAMEL_MESSAGE_SEEN },
- { 'T', CAMEL_MESSAGE_DELETED },
-};
-
-/* convert the uid + flags into a unique:info maildir format */
-char *camel_maildir_summary_info_to_name(const CamelMessageInfo *info)
-{
- const char *uid;
- char *p, *buf;
- int i;
-
- uid = camel_message_info_uid (info);
- buf = g_alloca (strlen (uid) + strlen (":2,") + (sizeof (flagbits) / sizeof (flagbits[0])) + 1);
- p = buf + sprintf (buf, "%s:2,", uid);
- for (i = 0; i < sizeof (flagbits) / sizeof (flagbits[0]); i++) {
- if (info->flags & flagbits[i].flagbit)
- *p++ = flagbits[i].flag;
- }
- *p = 0;
-
- return g_strdup(buf);
-}
-
-/* returns 0 if the info matches (or there was none), otherwise we changed it */
-int camel_maildir_summary_name_to_info(CamelMessageInfo *info, const char *name)
-{
- char *p, c;
- guint32 set = 0; /* what we set */
- /*guint32 all = 0;*/ /* all flags */
- int i;
-
- p = strstr(name, ":2,");
- if (p) {
- p+=3;
- while ((c = *p++)) {
- /* we could assume that the flags are in order, but its just as easy not to require */
- for (i=0;i<sizeof(flagbits)/sizeof(flagbits[0]);i++) {
- if (flagbits[i].flag == c && (info->flags & flagbits[i].flagbit) == 0) {
- set |= flagbits[i].flagbit;
- }
- /*all |= flagbits[i].flagbit;*/
- }
- }
-
- /* changed? */
- /*if ((info->flags & all) != set) {*/
- if ((info->flags & set) != set) {
- /* ok, they did change, only add the new flags ('merge flags'?) */
- /*info->flags &= all; if we wanted to set only the new flags, which we probably dont */
- info->flags |= set;
- return 1;
- }
- }
-
- return 0;
-}
-
-/* for maildir, x-evolution isn't used, so dont try and get anything out of it */
-static int maildir_summary_decode_x_evolution(CamelLocalSummary *cls, const char *xev, CamelMessageInfo *mi)
-{
- return -1;
-}
-
-static char *maildir_summary_encode_x_evolution(CamelLocalSummary *cls, const CamelMessageInfo *mi)
-{
- return NULL;
-}
-
-/* FIXME:
- both 'new' and 'add' will try and set the filename, this is not ideal ...
-*/
-static CamelMessageInfo *maildir_summary_add(CamelLocalSummary *cls, CamelMimeMessage *msg, const CamelMessageInfo *info, CamelFolderChangeInfo *changes, CamelException *ex)
-{
- CamelMessageInfo *mi;
-
- mi = ((CamelLocalSummaryClass *) parent_class)->add(cls, msg, info, changes, ex);
- if (mi) {
- if (info) {
- camel_maildir_info_set_filename(mi, camel_maildir_summary_info_to_name(mi));
- d(printf("Setting filename to %s\n", camel_maildir_info_filename(mi)));
- }
- }
-
- return mi;
-}
-
-static CamelMessageInfo *message_info_new(CamelFolderSummary * s, struct _camel_header_raw *h)
-{
- CamelMessageInfo *mi, *info;
- CamelMaildirSummary *mds = (CamelMaildirSummary *)s;
- CamelMaildirMessageInfo *mdi;
- const char *uid;
-
- mi = ((CamelFolderSummaryClass *) parent_class)->message_info_new(s, h);
- /* assign the uid and new filename */
- if (mi) {
- mdi = (CamelMaildirMessageInfo *)mi;
-
- uid = camel_message_info_uid(mi);
- if (uid==NULL || uid[0] == 0)
- camel_message_info_set_uid(mi, camel_folder_summary_next_uid_string(s));
-
- /* handle 'duplicates' */
- info = camel_folder_summary_uid(s, uid);
- if (info) {
- d(printf("already seen uid '%s', just summarising instead\n", uid));
- camel_folder_summary_info_free(s, mi);
- mdi = (CamelMaildirMessageInfo *)mi = info;
- }
-
- /* with maildir we know the real received date, from the filename */
- mi->date_received = strtoul(camel_message_info_uid(mi), NULL, 10);
-
- if (mds->priv->current_file) {
-#if 0
- char *p1, *p2, *p3;
- unsigned long uid;
-#endif
- /* if setting from a file, grab the flags from it */
- camel_maildir_info_set_filename(mi, g_strdup(mds->priv->current_file));
- camel_maildir_summary_name_to_info(mi, mds->priv->current_file);
-
-#if 0
- /* Actually, I dont think all this effort is worth it at all ... */
-
- /* also, see if we can extract the next-id from tne name, and safe-if-fy ourselves against collisions */
- /* we check for something.something_number.something */
- p1 = strchr(mdi->filename, '.');
- if (p1) {
- p2 = strchr(p1+1, '.');
- p3 = strchr(p1+1, '_');
- if (p2 && p3 && p3<p2) {
- uid = strtoul(p3+1, &p1, 10);
- if (p1 == p2 && uid>0)
- camel_folder_summary_set_uid(s, uid);
- }
- }
-#endif
- } else {
- /* if creating a file, set its name from the flags we have */
- camel_maildir_info_set_filename(mdi, camel_maildir_summary_info_to_name(mi));
- d(printf("Setting filename to %s\n", camel_maildir_info_filename(mi)));
- }
- }
-
- return mi;
-}
-
-
-static void message_info_free(CamelFolderSummary *s, CamelMessageInfo *mi)
-{
-#if !defined (DOEPOOLV) && !defined (DOESTRV)
- CamelMaildirMessageInfo *mdi = (CamelMaildirMessageInfo *)mi;
-
- g_free(mdi->filename);
-#endif
- ((CamelFolderSummaryClass *) parent_class)->message_info_free(s, mi);
-}
-
-
-static char *maildir_summary_next_uid_string(CamelFolderSummary *s)
-{
- CamelMaildirSummary *mds = (CamelMaildirSummary *)s;
-
- d(printf("next uid string called?\n"));
-
- /* if we have a current file, then use that to get the uid */
- if (mds->priv->current_file) {
- char *cln;
-
- cln = strchr(mds->priv->current_file, ':');
- if (cln)
- return g_strndup(mds->priv->current_file, cln-mds->priv->current_file);
- else
- return g_strdup(mds->priv->current_file);
- } else {
- /* the first would probably work, but just to be safe, check for collisions */
-#if 0
- return g_strdup_printf("%ld.%d_%u.%s", time(0), getpid(), camel_folder_summary_next_uid(s), mds->priv->hostname);
-#else
- CamelLocalSummary *cls = (CamelLocalSummary *)s;
- char *name = NULL, *uid = NULL;
- struct stat st;
- int retry = 0;
- guint32 nextuid = camel_folder_summary_next_uid(s);
-
- /* we use time.pid_count.hostname */
- do {
- if (retry > 0) {
- g_free(name);
- g_free(uid);
- sleep(2);
- }
- uid = g_strdup_printf("%ld.%d_%u.%s", time(0), getpid(), nextuid, mds->priv->hostname);
- name = g_strdup_printf("%s/tmp/%s", cls->folder_path, uid);
- retry++;
- } while (stat(name, &st) == 0 && retry<3);
-
- /* I dont know what we're supposed to do if it fails to find a unique name?? */
-
- g_free(name);
- return uid;
-#endif
- }
-}
-
-static CamelMessageInfo *
-message_info_load(CamelFolderSummary *s, FILE *in)
-{
- CamelMessageInfo *mi;
- CamelMaildirSummary *mds = (CamelMaildirSummary *)s;
-
- mi = ((CamelFolderSummaryClass *) parent_class)->message_info_load(s, in);
- if (mi) {
- char *name;
-
- if (mds->priv->load_map
- && (name = g_hash_table_lookup(mds->priv->load_map, camel_message_info_uid(mi)))) {
- d(printf("Setting filename of %s to %s\n", camel_message_info_uid(mi), name));
- camel_maildir_info_set_filename(mi, g_strdup(name));
- camel_maildir_summary_name_to_info(mi, name);
- }
- }
-
- return mi;
-}
-
-static int maildir_summary_load(CamelLocalSummary *cls, int forceindex, CamelException *ex)
-{
- char *cur;
- DIR *dir;
- struct dirent *d;
- CamelMaildirSummary *mds = (CamelMaildirSummary *)cls;
- char *uid;
- EMemPool *pool;
- int ret;
-
- cur = g_strdup_printf("%s/cur", cls->folder_path);
-
- d(printf("pre-loading uid <> filename map\n"));
-
- dir = opendir(cur);
- if (dir == NULL) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Cannot open maildir directory path: %s: %s"),
- cls->folder_path, g_strerror (errno));
- g_free(cur);
- return -1;
- }
-
- mds->priv->load_map = g_hash_table_new(g_str_hash, g_str_equal);
- pool = e_mempool_new(1024, 512, E_MEMPOOL_ALIGN_BYTE);
-
- while ( (d = readdir(dir)) ) {
- if (d->d_name[0] == '.')
- continue;
-
- /* map the filename -> uid */
- uid = strchr(d->d_name, ':');
- if (uid) {
- int len = uid-d->d_name;
- uid = e_mempool_alloc(pool, len+1);
- memcpy(uid, d->d_name, len);
- uid[len] = 0;
- g_hash_table_insert(mds->priv->load_map, uid, e_mempool_strdup(pool, d->d_name));
- } else {
- uid = e_mempool_strdup(pool, d->d_name);
- g_hash_table_insert(mds->priv->load_map, uid, uid);
- }
- }
- closedir(dir);
- g_free(cur);
-
- ret = ((CamelLocalSummaryClass *) parent_class)->load(cls, forceindex, ex);
-
- g_hash_table_destroy(mds->priv->load_map);
- mds->priv->load_map = NULL;
- e_mempool_destroy(pool);
-
- return ret;
-}
-
-static int camel_maildir_summary_add(CamelLocalSummary *cls, const char *name, int forceindex)
-{
- CamelMaildirSummary *maildirs = (CamelMaildirSummary *)cls;
- char *filename = g_strdup_printf("%s/cur/%s", cls->folder_path, name);
- int fd;
- CamelMimeParser *mp;
-
- d(printf("summarising: %s\n", name));
-
- fd = open(filename, O_RDONLY);
- if (fd == -1) {
- g_warning ("Cannot summarise/index: %s: %s", filename, strerror (errno));
- g_free(filename);
- return -1;
- }
- mp = camel_mime_parser_new();
- camel_mime_parser_scan_from(mp, FALSE);
- camel_mime_parser_init_with_fd(mp, fd);
- if (cls->index && (forceindex || !camel_index_has_name(cls->index, name))) {
- d(printf("forcing indexing of message content\n"));
- camel_folder_summary_set_index((CamelFolderSummary *)maildirs, cls->index);
- } else {
- camel_folder_summary_set_index((CamelFolderSummary *)maildirs, NULL);
- }
- maildirs->priv->current_file = (char *)name;
- camel_folder_summary_add_from_parser((CamelFolderSummary *)maildirs, mp);
- camel_object_unref((CamelObject *)mp);
- maildirs->priv->current_file = NULL;
- camel_folder_summary_set_index((CamelFolderSummary *)maildirs, NULL);
- g_free(filename);
- return 0;
-}
-
-struct _remove_data {
- CamelLocalSummary *cls;
- CamelFolderChangeInfo *changes;
-};
-
-static void
-remove_summary(char *key, CamelMessageInfo *info, struct _remove_data *rd)
-{
- d(printf("removing message %s from summary\n", key));
- if (rd->cls->index)
- camel_index_delete_name(rd->cls->index, camel_message_info_uid(info));
- if (rd->changes)
- camel_folder_change_info_remove_uid(rd->changes, key);
- camel_folder_summary_remove((CamelFolderSummary *)rd->cls, info);
- camel_folder_summary_info_free((CamelFolderSummary *)rd->cls, info);
-}
-
-static int
-sort_receive_cmp(const void *ap, const void *bp)
-{
- const CamelMessageInfo
- *a = *((CamelMessageInfo **)ap),
- *b = *((CamelMessageInfo **)bp);
-
- if (a->date_received < b->date_received)
- return -1;
- else if (a->date_received > b->date_received)
- return 1;
-
- return 0;
-}
-
-static int
-maildir_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changes, CamelException *ex)
-{
- DIR *dir;
- struct dirent *d;
- char *p;
- CamelMessageInfo *info;
- CamelMaildirMessageInfo *mdi;
- CamelFolderSummary *s = (CamelFolderSummary *)cls;
- GHashTable *left;
- int i, count, total;
- int forceindex;
- char *new, *cur;
- char *uid;
- struct _remove_data rd = { cls, changes };
-
- new = g_strdup_printf("%s/new", cls->folder_path);
- cur = g_strdup_printf("%s/cur", cls->folder_path);
-
- d(printf("checking summary ...\n"));
-
- camel_operation_start(NULL, _("Checking folder consistency"));
-
- /* scan the directory, check for mail files not in the index, or index entries that
- no longer exist */
- dir = opendir(cur);
- if (dir == NULL) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Cannot open maildir directory path: %s: %s"),
- cls->folder_path, g_strerror (errno));
- g_free(cur);
- g_free(new);
- camel_operation_end(NULL);
- return -1;
- }
-
- /* keeps track of all uid's that have not been processed */
- left = g_hash_table_new(g_str_hash, g_str_equal);
- count = camel_folder_summary_count((CamelFolderSummary *)cls);
- forceindex = count == 0;
- for (i=0;i<count;i++) {
- info = camel_folder_summary_index((CamelFolderSummary *)cls, i);
- if (info) {
- g_hash_table_insert(left, (char *)camel_message_info_uid(info), info);
- }
- }
-
- /* joy, use this to pre-count the total, so we can report progress meaningfully */
- total = 0;
- count = 0;
- while ( (d = readdir(dir)) )
- total++;
- rewinddir(dir);
-
- while ( (d = readdir(dir)) ) {
- int pc = count * 100 / total;
-
- camel_operation_progress(NULL, pc);
- count++;
-
- /* FIXME: also run stat to check for regular file */
- p = d->d_name;
- if (p[0] == '.')
- continue;
-
- /* map the filename -> uid */
- uid = strchr(d->d_name, ':');
- if (uid)
- uid = g_strndup(d->d_name, uid-d->d_name);
- else
- uid = g_strdup(d->d_name);
-
- info = g_hash_table_lookup(left, uid);
- if (info) {
- camel_folder_summary_info_free((CamelFolderSummary *)cls, info);
- g_hash_table_remove(left, uid);
- }
-
- info = camel_folder_summary_uid((CamelFolderSummary *)cls, uid);
- if (info == NULL) {
- /* must be a message incorporated by another client, this is not a 'recent' uid */
- if (camel_maildir_summary_add(cls, d->d_name, forceindex) == 0)
- if (changes)
- camel_folder_change_info_add_uid(changes, uid);
- } else {
- const char *filename;
-
- if (cls->index && (!camel_index_has_name(cls->index, uid))) {
- /* message_info_new will handle duplicates */
- camel_maildir_summary_add(cls, d->d_name, forceindex);
- }
-
- mdi = (CamelMaildirMessageInfo *)info;
- filename = camel_maildir_info_filename(mdi);
- /* TODO: only store the extension in the mdi->filename struct, not the whole lot */
- if (filename == NULL || strcmp(filename, d->d_name) != 0) {
-#ifdef DOESTRV
-#warning "cannot modify the estrv after its been setup, for mt-safe code"
- CAMEL_SUMMARY_LOCK(s, summary_lock);
- /* need to update the summary hash ref */
- g_hash_table_remove(s->messages_uid, camel_message_info_uid(info));
- info->strings = e_strv_set_ref(info->strings, CAMEL_MAILDIR_INFO_FILENAME, d->d_name);
- info->strings = e_strv_pack(info->strings);
- g_hash_table_insert(s->messages_uid, (char *)camel_message_info_uid(info), info);
- CAMEL_SUMMARY_UNLOCK(s, summary_lock);
-#else
-# ifdef DOEPOOLV
- info->strings = e_poolv_set(info->strings, CAMEL_MAILDIR_INFO_FILENAME, d->d_name, FALSE);
-# else
- g_free(mdi->filename);
- mdi->filename = g_strdup(d->d_name);
-# endif
-#endif
- }
- camel_folder_summary_info_free((CamelFolderSummary *)cls, info);
- }
- g_free(uid);
- }
- closedir(dir);
- g_hash_table_foreach(left, (GHFunc)remove_summary, &rd);
- g_hash_table_destroy(left);
-
- camel_operation_end(NULL);
-
- camel_operation_start(NULL, _("Checking for new messages"));
-
- /* now, scan new for new messages, and copy them to cur, and so forth */
- dir = opendir(new);
- if (dir != NULL) {
- total = 0;
- count = 0;
- while ( (d = readdir(dir)) )
- total++;
- rewinddir(dir);
-
- while ( (d = readdir(dir)) ) {
- char *name, *newname, *destname, *destfilename;
- char *src, *dest;
- int pc = count * 100 / total;
-
- camel_operation_progress(NULL, pc);
- count++;
-
- name = d->d_name;
- if (name[0] == '.')
- continue;
-
- /* already in summary? shouldn't happen, but just incase ... */
- if ((info = camel_folder_summary_uid((CamelFolderSummary *)cls, name))) {
- camel_folder_summary_info_free((CamelFolderSummary *)cls, info);
- newname = destname = camel_folder_summary_next_uid_string(s);
- } else {
- newname = NULL;
- destname = name;
- }
-
- /* copy this to the destination folder, use 'standard' semantics for maildir info field */
- src = g_strdup_printf("%s/%s", new, name);
- destfilename = g_strdup_printf("%s:2,", destname);
- dest = g_strdup_printf("%s/%s", cur, destfilename);
-
- /* FIXME: This should probably use link/unlink */
-
- if (rename(src, dest) == 0) {
- camel_maildir_summary_add(cls, destfilename, forceindex);
- if (changes) {
- camel_folder_change_info_add_uid(changes, destname);
- camel_folder_change_info_recent_uid(changes, destname);
- }
- } else {
- /* else? we should probably care about failures, but wont */
- g_warning("Failed to move new maildir message %s to cur %s", src, dest);
- }
-
- /* c strings are painful to work with ... */
- g_free(destfilename);
- g_free(newname);
- g_free(src);
- g_free(dest);
- }
- camel_operation_end(NULL);
- }
- closedir(dir);
-
- g_free(new);
- g_free(cur);
-
- /* sort the summary based on receive time, since the directory order is not useful */
- CAMEL_SUMMARY_LOCK(s, summary_lock);
- qsort(s->messages->pdata, s->messages->len, sizeof(CamelMessageInfo *), sort_receive_cmp);
- CAMEL_SUMMARY_UNLOCK(s, summary_lock);
-
- return 0;
-}
-
-/* sync the summary with the ondisk files. */
-static int
-maildir_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInfo *changes, CamelException *ex)
-{
- int count, i;
- CamelMessageInfo *info;
- CamelMaildirMessageInfo *mdi;
-#ifdef DOESTRV
- CamelFolderSummary *s = (CamelFolderSummary *)cls;
-#endif
- char *name;
- struct stat st;
-
- d(printf("summary_sync(expunge=%s)\n", expunge?"true":"false"));
-
- if (camel_local_summary_check(cls, changes, ex) == -1)
- return -1;
-
- camel_operation_start(NULL, _("Storing folder"));
-
- count = camel_folder_summary_count((CamelFolderSummary *)cls);
- for (i=count-1;i>=0;i--) {
- camel_operation_progress(NULL, (count-i)*100/count);
-
- info = camel_folder_summary_index((CamelFolderSummary *)cls, i);
- mdi = (CamelMaildirMessageInfo *)info;
- if (info && (info->flags & CAMEL_MESSAGE_DELETED) && expunge) {
- name = g_strdup_printf("%s/cur/%s", cls->folder_path, camel_maildir_info_filename(mdi));
- d(printf("deleting %s\n", name));
- if (unlink(name) == 0 || errno==ENOENT) {
-
- /* FIXME: put this in folder_summary::remove()? */
- if (cls->index)
- camel_index_delete_name(cls->index, camel_message_info_uid(info));
-
- camel_folder_change_info_remove_uid(changes, camel_message_info_uid(info));
- camel_folder_summary_remove((CamelFolderSummary *)cls, info);
- }
- g_free(name);
- } else if (info && (info->flags & CAMEL_MESSAGE_FOLDER_FLAGGED)) {
- char *newname = camel_maildir_summary_info_to_name(info);
- char *dest;
-
- /* do we care about additional metainfo stored inside the message? */
- /* probably should all go in the filename? */
-
- /* have our flags/ i.e. name changed? */
- if (strcmp(newname, camel_maildir_info_filename(mdi))) {
- name = g_strdup_printf("%s/cur/%s", cls->folder_path, camel_maildir_info_filename(mdi));
- dest = g_strdup_printf("%s/cur/%s", cls->folder_path, newname);
- rename(name, dest);
- if (stat(dest, &st) == -1) {
- /* we'll assume it didn't work, but dont change anything else */
- g_free(newname);
- } else {
- /* TODO: If this is made mt-safe, then this code could be a problem, since
- the estrv is being modified.
- Sigh, this may mean the maildir name has to be cached another way */
-#ifdef DOESTRV
-#warning "cannot modify the estrv after its been setup, for mt-safe code"
- CAMEL_SUMMARY_LOCK(s, summary_lock);
- /* need to update the summary hash ref */
- g_hash_table_remove(s->messages_uid, camel_message_info_uid(info));
- info->strings = e_strv_set_ref_free(info->strings, CAMEL_MAILDIR_INFO_FILENAME, newname);
- info->strings = e_strv_pack(info->strings);
- g_hash_table_insert(s->messages_uid, (char *)camel_message_info_uid(info), info);
- CAMEL_SUMMARY_UNLOCK(s, summary_lock);
-#else
-# ifdef DOEPOOLV
- info->strings = e_poolv_set(info->strings, CAMEL_MAILDIR_INFO_FILENAME, newname, TRUE);
-# else
- g_free(mdi->filename);
- mdi->filename = newname;
-# endif
-#endif
- }
- g_free(name);
- g_free(dest);
- } else {
- g_free(newname);
- }
-
- /* strip FOLDER_MESSAGE_FLAGED, etc */
- info->flags &= 0xffff;
- }
- camel_folder_summary_info_free((CamelFolderSummary *)cls, info);
- }
-
- camel_operation_end(NULL);
-
- return ((CamelLocalSummaryClass *)parent_class)->sync(cls, expunge, changes, ex);
-}
-
diff --git a/camel/providers/local/camel-maildir-summary.h b/camel/providers/local/camel-maildir-summary.h
deleted file mode 100644
index 0cae785c6c..0000000000
--- a/camel/providers/local/camel-maildir-summary.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Not Zed <notzed@lostzed.mmc.com.au>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef _CAMEL_MAILDIR_SUMMARY_H
-#define _CAMEL_MAILDIR_SUMMARY_H
-
-#include "camel-local-summary.h"
-#include <camel/camel-folder.h>
-#include <camel/camel-exception.h>
-#include <camel/camel-index.h>
-
-#define CAMEL_MAILDIR_SUMMARY(obj) CAMEL_CHECK_CAST (obj, camel_maildir_summary_get_type (), CamelMaildirSummary)
-#define CAMEL_MAILDIR_SUMMARY_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_maildir_summary_get_type (), CamelMaildirSummaryClass)
-#define CAMEL_IS_MAILDIR_SUMMARY(obj) CAMEL_CHECK_TYPE (obj, camel_maildir_summary_get_type ())
-
-typedef struct _CamelMaildirSummary CamelMaildirSummary;
-typedef struct _CamelMaildirSummaryClass CamelMaildirSummaryClass;
-
-typedef struct _CamelMaildirMessageContentInfo {
- CamelMessageContentInfo info;
-} CamelMaildirMessageContentInfo;
-
-#if defined (DOEPOOLV) || defined (DOESTRV)
-enum {
- CAMEL_MAILDIR_INFO_FILENAME = CAMEL_MESSAGE_INFO_LAST,
- CAMEL_MAILDIR_INFO_LAST,
-};
-#endif
-
-typedef struct _CamelMaildirMessageInfo {
- CamelMessageInfo info;
-
-#if !defined (DOEPOOLV) && !defined (DOESTRV)
- char *filename; /* maildir has this annoying status shit on the end of the filename, use this to get the real message id */
-#endif
-} CamelMaildirMessageInfo;
-
-struct _CamelMaildirSummary {
- CamelLocalSummary parent;
- struct _CamelMaildirSummaryPrivate *priv;
-};
-
-struct _CamelMaildirSummaryClass {
- CamelLocalSummaryClass parent_class;
-
- /* virtual methods */
-
- /* signals */
-};
-
-CamelType camel_maildir_summary_get_type (void);
-CamelMaildirSummary *camel_maildir_summary_new (const char *filename, const char *maildirdir, CamelIndex *index);
-
-/* convert some info->flags to/from the messageinfo */
-char *camel_maildir_summary_info_to_name(const CamelMessageInfo *info);
-int camel_maildir_summary_name_to_info(CamelMessageInfo *info, const char *name);
-
-#if defined (DOEPOOLV) || defined (DOESTRV)
-#define camel_maildir_info_filename(x) camel_message_info_string((const CamelMessageInfo *)(x), CAMEL_MAILDIR_INFO_FILENAME)
-#define camel_maildir_info_set_filename(x, s) camel_message_info_set_string((CamelMessageInfo *)(x), CAMEL_MAILDIR_INFO_FILENAME, s)
-#else
-#define camel_maildir_info_filename(x) (((CamelMaildirMessageInfo *)x)->filename)
-#define camel_maildir_info_set_filename(x, s) (g_free(((CamelMaildirMessageInfo *)x)->filename),((CamelMaildirMessageInfo *)x)->filename = s)
-#endif
-
-#endif /* ! _CAMEL_MAILDIR_SUMMARY_H */
-
diff --git a/camel/providers/local/camel-mbox-folder.c b/camel/providers/local/camel-mbox-folder.c
deleted file mode 100644
index 9c3a7036f2..0000000000
--- a/camel/providers/local/camel-mbox-folder.c
+++ /dev/null
@@ -1,549 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; fill-column: 160 -*-
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- * Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright (C) 1999, 2003 Ximian Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdlib.h>
-#include <sys/types.h>
-#include <dirent.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <errno.h>
-#include <string.h>
-#include <fcntl.h>
-
-#include "camel-mbox-folder.h"
-#include "camel-mbox-store.h"
-#include "camel-stream-fs.h"
-#include "camel-mbox-summary.h"
-#include "camel-data-wrapper.h"
-#include "camel-mime-message.h"
-#include "camel-stream-filter.h"
-#include "camel-mime-filter-from.h"
-#include "camel-exception.h"
-
-#define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))*/
-
-static CamelLocalFolderClass *parent_class = NULL;
-
-/* Returns the class for a CamelMboxFolder */
-#define CMBOXF_CLASS(so) CAMEL_MBOX_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-#define CF_CLASS(so) CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-#define CMBOXS_CLASS(so) CAMEL_STORE_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-
-char *camel_mbox_folder_get_full_path (const char *toplevel_dir, const char *full_name);
-char *camel_mbox_folder_get_meta_path (const char *toplevel_dir, const char *full_name, const char *ext);
-
-static int mbox_lock(CamelLocalFolder *lf, CamelLockType type, CamelException *ex);
-static void mbox_unlock(CamelLocalFolder *lf);
-
-#ifdef STATUS_PINE
-static void mbox_set_message_flags(CamelFolder *folder, const char *uid, guint32 flags, guint32 set);
-#endif
-
-static void mbox_set_message_user_flag(CamelFolder *folder, const char *uid, const char *name, gboolean value);
-static void mbox_set_message_user_tag(CamelFolder *folder, const char *uid, const char *name, const char *value);
-
-static void mbox_append_message(CamelFolder *folder, CamelMimeMessage * message, const CamelMessageInfo * info, char **appended_uid, CamelException *ex);
-static CamelMimeMessage *mbox_get_message(CamelFolder *folder, const gchar * uid, CamelException *ex);
-static CamelLocalSummary *mbox_create_summary(const char *path, const char *folder, CamelIndex *index);
-
-static void mbox_finalise(CamelObject * object);
-
-static void
-camel_mbox_folder_class_init(CamelMboxFolderClass * camel_mbox_folder_class)
-{
- CamelFolderClass *camel_folder_class = CAMEL_FOLDER_CLASS(camel_mbox_folder_class);
- CamelLocalFolderClass *lclass = (CamelLocalFolderClass *)camel_mbox_folder_class;
-
- parent_class = (CamelLocalFolderClass *)camel_type_get_global_classfuncs(camel_local_folder_get_type());
-
- /* virtual method definition */
-
- /* virtual method overload */
- camel_folder_class->append_message = mbox_append_message;
- camel_folder_class->get_message = mbox_get_message;
-
-#ifdef STATUS_PINE
- camel_folder_class->set_message_flags = mbox_set_message_flags;
-#endif
- camel_folder_class->set_message_user_flag = mbox_set_message_user_flag;
- camel_folder_class->set_message_user_tag = mbox_set_message_user_tag;
-
- lclass->get_full_path = camel_mbox_folder_get_full_path;
- lclass->get_meta_path = camel_mbox_folder_get_meta_path;
- lclass->create_summary = mbox_create_summary;
- lclass->lock = mbox_lock;
- lclass->unlock = mbox_unlock;
-}
-
-static void
-mbox_init(gpointer object, gpointer klass)
-{
- /*CamelFolder *folder = object;*/
- CamelMboxFolder *mbox_folder = object;
-
- mbox_folder->lockfd = -1;
-}
-
-static void
-mbox_finalise(CamelObject * object)
-{
- CamelMboxFolder *mbox_folder = (CamelMboxFolder *)object;
-
- g_assert(mbox_folder->lockfd == -1);
-}
-
-CamelType camel_mbox_folder_get_type(void)
-{
- static CamelType camel_mbox_folder_type = CAMEL_INVALID_TYPE;
-
- if (camel_mbox_folder_type == CAMEL_INVALID_TYPE) {
- camel_mbox_folder_type = camel_type_register(CAMEL_LOCAL_FOLDER_TYPE, "CamelMboxFolder",
- sizeof(CamelMboxFolder),
- sizeof(CamelMboxFolderClass),
- (CamelObjectClassInitFunc) camel_mbox_folder_class_init,
- NULL,
- (CamelObjectInitFunc) mbox_init,
- (CamelObjectFinalizeFunc) mbox_finalise);
- }
-
- return camel_mbox_folder_type;
-}
-
-CamelFolder *
-camel_mbox_folder_new(CamelStore *parent_store, const char *full_name, guint32 flags, CamelException *ex)
-{
- CamelFolder *folder;
-
- d(printf("Creating mbox folder: %s in %s\n", full_name, camel_local_store_get_toplevel_dir((CamelLocalStore *)parent_store)));
-
- folder = (CamelFolder *)camel_object_new(CAMEL_MBOX_FOLDER_TYPE);
- folder = (CamelFolder *)camel_local_folder_construct((CamelLocalFolder *)folder,
- parent_store, full_name, flags, ex);
-
- return folder;
-}
-
-char *
-camel_mbox_folder_get_full_path (const char *toplevel_dir, const char *full_name)
-{
- const char *inptr = full_name;
- int subdirs = 0;
- char *path, *p;
-
- while (*inptr != '\0') {
- if (*inptr == '/')
- subdirs++;
- inptr++;
- }
-
- path = g_malloc (strlen (toplevel_dir) + (inptr - full_name) + (4 * subdirs) + 1);
- p = g_stpcpy (path, toplevel_dir);
-
- inptr = full_name;
- while (*inptr != '\0') {
- while (*inptr != '/' && *inptr != '\0')
- *p++ = *inptr++;
-
- if (*inptr == '/') {
- p = g_stpcpy (p, ".sbd/");
- inptr++;
-
- /* strip extranaeous '/'s */
- while (*inptr == '/')
- inptr++;
- }
- }
-
- *p = '\0';
-
- return path;
-}
-
-char *
-camel_mbox_folder_get_meta_path (const char *toplevel_dir, const char *full_name, const char *ext)
-{
-/*#define USE_HIDDEN_META_FILES*/
-#ifdef USE_HIDDEN_META_FILES
- char *name, *slash;
-
- name = g_alloca (strlen (full_name) + strlen (ext) + 2);
- if ((slash = strrchr (full_name, '/')))
- sprintf (name, "%.*s.%s%s", slash - full_name + 1, full_name, slash + 1, ext);
- else
- sprintf (name, ".%s%s", full_name, ext);
-
- return camel_mbox_folder_get_full_path (toplevel_dir, name);
-#else
- char *full_path, *path;
-
- full_path = camel_mbox_folder_get_full_path (toplevel_dir, full_name);
- path = g_strdup_printf ("%s%s", full_path, ext);
- g_free (full_path);
-
- return path;
-#endif
-}
-
-static CamelLocalSummary *mbox_create_summary(const char *path, const char *folder, CamelIndex *index)
-{
- return (CamelLocalSummary *)camel_mbox_summary_new(path, folder, index);
-}
-
-static int mbox_lock(CamelLocalFolder *lf, CamelLockType type, CamelException *ex)
-{
- CamelMboxFolder *mf = (CamelMboxFolder *)lf;
-
- /* make sure we have matching unlocks for locks, camel-local-folder class should enforce this */
- g_assert(mf->lockfd == -1);
-
- mf->lockfd = open(lf->folder_path, O_RDWR, 0);
- if (mf->lockfd == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Cannot create folder lock on %s: %s"),
- lf->folder_path, g_strerror (errno));
- return -1;
- }
-
- if (camel_lock_folder(lf->folder_path, mf->lockfd, type, ex) == -1) {
- close(mf->lockfd);
- mf->lockfd = -1;
- return -1;
- }
-
- return 0;
-}
-
-static void mbox_unlock(CamelLocalFolder *lf)
-{
- CamelMboxFolder *mf = (CamelMboxFolder *)lf;
-
- g_assert(mf->lockfd != -1);
- camel_unlock_folder(lf->folder_path, mf->lockfd);
- close(mf->lockfd);
- mf->lockfd = -1;
-}
-
-static void
-mbox_append_message(CamelFolder *folder, CamelMimeMessage * message, const CamelMessageInfo * info, char **appended_uid, CamelException *ex)
-{
- CamelLocalFolder *lf = (CamelLocalFolder *)folder;
- CamelStream *output_stream = NULL, *filter_stream = NULL;
- CamelMimeFilter *filter_from = NULL;
- CamelMboxSummary *mbs = (CamelMboxSummary *)folder->summary;
- CamelMessageInfo *mi;
- char *fromline = NULL;
- int fd, retval;
- struct stat st;
-#if 0
- char *xev;
-#endif
- /* If we can't lock, dont do anything */
- if (camel_local_folder_lock(lf, CAMEL_LOCK_WRITE, ex) == -1)
- return;
-
- d(printf("Appending message\n"));
-
- /* first, check the summary is correct (updates folder_size too) */
- retval = camel_local_summary_check ((CamelLocalSummary *)folder->summary, lf->changes, ex);
- if (retval == -1)
- goto fail;
-
- /* add it to the summary/assign the uid, etc */
- mi = camel_local_summary_add((CamelLocalSummary *)folder->summary, message, info, lf->changes, ex);
- if (mi == NULL)
- goto fail;
-
- d(printf("Appending message: uid is %s\n", camel_message_info_uid(mi)));
-
- output_stream = camel_stream_fs_new_with_name(lf->folder_path, O_WRONLY|O_APPEND, 0600);
- if (output_stream == NULL) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Cannot open mailbox: %s: %s\n"),
- lf->folder_path, g_strerror (errno));
- goto fail;
- }
-
- /* and we need to set the frompos/XEV explicitly */
- ((CamelMboxMessageInfo *)mi)->frompos = mbs->folder_size;
-#if 0
- xev = camel_local_summary_encode_x_evolution((CamelLocalSummary *)folder->summary, mi);
- if (xev) {
- /* the x-ev header should match the 'current' flags, no problem, so store as much */
- camel_medium_set_header((CamelMedium *)message, "X-Evolution", xev);
- mi->flags &= ~ CAMEL_MESSAGE_FOLDER_NOXEV|CAMEL_MESSAGE_FOLDER_FLAGGED;
- g_free(xev);
- }
-#endif
-
- /* we must write this to the non-filtered stream ... */
- fromline = camel_mime_message_build_mbox_from(message);
- if (camel_stream_write(output_stream, fromline, strlen(fromline)) == -1)
- goto fail_write;
-
- /* and write the content to the filtering stream, that translates '\nFrom' into '\n>From' */
- filter_stream = (CamelStream *) camel_stream_filter_new_with_stream(output_stream);
- filter_from = (CamelMimeFilter *) camel_mime_filter_from_new();
- camel_stream_filter_add((CamelStreamFilter *) filter_stream, filter_from);
- if (camel_data_wrapper_write_to_stream((CamelDataWrapper *)message, filter_stream) == -1
- || camel_stream_write(filter_stream, "\n", 1) == -1
- || camel_stream_close(filter_stream) == -1)
- goto fail_write;
-
- /* filter stream ref's the output stream itself, so we need to unref it too */
- camel_object_unref((CamelObject *)filter_from);
- camel_object_unref((CamelObject *)filter_stream);
- camel_object_unref((CamelObject *)output_stream);
- g_free(fromline);
-
- /* now we 'fudge' the summary to tell it its uptodate, because its idea of uptodate has just changed */
- /* the stat really shouldn't fail, we just wrote to it */
- if (stat(lf->folder_path, &st) == 0) {
- mbs->folder_size = st.st_size;
- ((CamelFolderSummary *)mbs)->time = st.st_mtime;
- }
-
- /* unlock as soon as we can */
- camel_local_folder_unlock(lf);
-
- if (camel_folder_change_info_changed(lf->changes)) {
- camel_object_trigger_event((CamelObject *)folder, "folder_changed", lf->changes);
- camel_folder_change_info_clear(lf->changes);
- }
-
- if (appended_uid)
- *appended_uid = g_strdup(camel_message_info_uid(mi));
-
- return;
-
-fail_write:
- if (errno == EINTR)
- camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
- _("Mail append cancelled"));
- else
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Cannot append message to mbox file: %s: %s"),
- lf->folder_path, g_strerror (errno));
-
- if (filter_stream)
- camel_object_unref(CAMEL_OBJECT(filter_stream));
-
- if (output_stream)
- camel_object_unref(CAMEL_OBJECT(output_stream));
-
- if (filter_from)
- camel_object_unref(CAMEL_OBJECT(filter_from));
-
- g_free(fromline);
-
- /* reset the file to original size */
- fd = open(lf->folder_path, O_WRONLY, 0600);
- if (fd != -1) {
- ftruncate(fd, mbs->folder_size);
- close(fd);
- }
-
- /* remove the summary info so we are not out-of-sync with the mbox */
- camel_folder_summary_remove_uid (CAMEL_FOLDER_SUMMARY (mbs), camel_message_info_uid (mi));
-
- /* and tell the summary its uptodate */
- if (stat(lf->folder_path, &st) == 0) {
- mbs->folder_size = st.st_size;
- ((CamelFolderSummary *)mbs)->time = st.st_mtime;
- }
-
-fail:
- /* make sure we unlock the folder - before we start triggering events into appland */
- camel_local_folder_unlock(lf);
-
- /* cascade the changes through, anyway, if there are any outstanding */
- if (camel_folder_change_info_changed(lf->changes)) {
- camel_object_trigger_event((CamelObject *)folder, "folder_changed", lf->changes);
- camel_folder_change_info_clear(lf->changes);
- }
-}
-
-static CamelMimeMessage *
-mbox_get_message(CamelFolder *folder, const gchar * uid, CamelException *ex)
-{
- CamelLocalFolder *lf = (CamelLocalFolder *)folder;
- CamelMimeMessage *message = NULL;
- CamelMboxMessageInfo *info;
- CamelMimeParser *parser = NULL;
- int fd, retval;
- int retried = FALSE;
- off_t frompos;
-
- d(printf("Getting message %s\n", uid));
-
- /* lock the folder first, burn if we can't, need write lock for summary check */
- if (camel_local_folder_lock(lf, CAMEL_LOCK_WRITE, ex) == -1)
- return NULL;
-
- /* check for new messages always */
- if (camel_local_summary_check((CamelLocalSummary *)folder->summary, lf->changes, ex) == -1) {
- camel_local_folder_unlock(lf);
- return NULL;
- }
-
-retry:
- /* get the message summary info */
- info = (CamelMboxMessageInfo *) camel_folder_summary_uid(folder->summary, uid);
-
- if (info == NULL) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_FOLDER_INVALID_UID,
- _("Cannot get message: %s\n %s"), uid, _("No such message"));
- goto fail;
- }
-
- /* no frompos, its an error in the library (and we can't do anything with it) */
- g_assert(info->frompos != -1);
-
- frompos = info->frompos;
- camel_folder_summary_info_free(folder->summary, (CamelMessageInfo *)info);
-
- /* we use an fd instead of a normal stream here - the reason is subtle, camel_mime_part will cache
- the whole message in memory if the stream is non-seekable (which it is when built from a parser
- with no stream). This means we dont have to lock the mbox for the life of the message, but only
- while it is being created. */
-
- fd = open(lf->folder_path, O_RDONLY);
- if (fd == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID_UID,
- _("Cannot get message: %s from folder %s\n %s"),
- uid, lf->folder_path, g_strerror (errno));
- goto fail;
- }
-
- /* we use a parser to verify the message is correct, and in the correct position */
- parser = camel_mime_parser_new();
- camel_mime_parser_init_with_fd(parser, fd);
- camel_mime_parser_scan_from(parser, TRUE);
-
- camel_mime_parser_seek(parser, frompos, SEEK_SET);
- if (camel_mime_parser_step(parser, NULL, NULL) != CAMEL_MIME_PARSER_STATE_FROM
- || camel_mime_parser_tell_start_from(parser) != frompos) {
-
- g_warning("Summary doesn't match the folder contents! eek!\n"
- " expecting offset %ld got %ld, state = %d", (long int)frompos,
- (long int)camel_mime_parser_tell_start_from(parser),
- camel_mime_parser_state(parser));
-
- camel_object_unref((CamelObject *)parser);
- parser = NULL;
-
- if (!retried) {
- retried = TRUE;
- camel_local_summary_check_force((CamelLocalSummary *)folder->summary);
- retval = camel_local_summary_check((CamelLocalSummary *)folder->summary, lf->changes, ex);
- if (retval != -1)
- goto retry;
- }
-
- camel_exception_setv(ex, CAMEL_EXCEPTION_FOLDER_INVALID_UID,
- _("Cannot get message: %s from folder %s\n %s"), uid, lf->folder_path,
- _("The folder appears to be irrecoverably corrupted."));
- goto fail;
- }
-
- message = camel_mime_message_new();
- if (camel_mime_part_construct_from_parser((CamelMimePart *)message, parser) == -1) {
- camel_exception_setv(ex, errno==EINTR?CAMEL_EXCEPTION_USER_CANCEL:CAMEL_EXCEPTION_FOLDER_INVALID_UID,
- _("Cannot get message: %s from folder %s\n %s"), uid, lf->folder_path,
- _("Message construction failed: Corrupt mailbox?"));
- camel_object_unref((CamelObject *)message);
- message = NULL;
- goto fail;
- }
-
- camel_medium_remove_header((CamelMedium *)message, "X-Evolution");
-fail:
- /* and unlock now we're finished with it */
- camel_local_folder_unlock(lf);
-
- if (parser)
- camel_object_unref((CamelObject *)parser);
-
- /* use the opportunity to notify of changes (particularly if we had a rebuild) */
- if (camel_folder_change_info_changed(lf->changes)) {
- camel_object_trigger_event((CamelObject *)folder, "folder_changed", lf->changes);
- camel_folder_change_info_clear(lf->changes);
- }
-
- return message;
-}
-
-#ifdef STATUS_PINE
-static void
-mbox_set_message_flags(CamelFolder *folder, const char *uid, guint32 flags, guint32 set)
-{
- /* Basically, if anything could change the Status line, presume it does */
- if (((CamelMboxSummary *)folder->summary)->xstatus
- && (flags & (CAMEL_MESSAGE_SEEN|CAMEL_MESSAGE_FLAGGED|CAMEL_MESSAGE_ANSWERED|CAMEL_MESSAGE_DELETED))) {
- flags |= CAMEL_MESSAGE_FOLDER_XEVCHANGE|CAMEL_MESSAGE_FOLDER_FLAGGED;
- set |= CAMEL_MESSAGE_FOLDER_XEVCHANGE|CAMEL_MESSAGE_FOLDER_FLAGGED;
- }
-
- ((CamelFolderClass *)parent_class)->set_message_flags(folder, uid, flags, set);
-}
-#endif
-
-static void
-mbox_set_message_user_flag(CamelFolder *folder, const char *uid, const char *name, gboolean value)
-{
- CamelMessageInfo *info;
-
- g_return_if_fail(folder->summary != NULL);
-
- info = camel_folder_summary_uid(folder->summary, uid);
- if (info == NULL)
- return;
-
- if (camel_flag_set(&info->user_flags, name, value)) {
- info->flags |= CAMEL_MESSAGE_FOLDER_FLAGGED|CAMEL_MESSAGE_FOLDER_XEVCHANGE;
- camel_folder_summary_touch(folder->summary);
- camel_object_trigger_event(CAMEL_OBJECT(folder), "message_changed", (char *) uid);
- }
- camel_folder_summary_info_free(folder->summary, info);
-}
-
-static void
-mbox_set_message_user_tag(CamelFolder *folder, const char *uid, const char *name, const char *value)
-{
- CamelMessageInfo *info;
-
- g_return_if_fail(folder->summary != NULL);
-
- info = camel_folder_summary_uid(folder->summary, uid);
- if (info == NULL)
- return;
-
- if (camel_tag_set(&info->user_tags, name, value)) {
- info->flags |= CAMEL_MESSAGE_FOLDER_FLAGGED|CAMEL_MESSAGE_FOLDER_XEVCHANGE;
- camel_folder_summary_touch(folder->summary);
- camel_object_trigger_event(CAMEL_OBJECT(folder), "message_changed", (char *) uid);
- }
- camel_folder_summary_info_free(folder->summary, info);
-}
diff --git a/camel/providers/local/camel-mbox-folder.h b/camel/providers/local/camel-mbox-folder.h
deleted file mode 100644
index aa0b67201f..0000000000
--- a/camel/providers/local/camel-mbox-folder.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * Copyright (C) 1999 Ximian .
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifndef CAMEL_MBOX_FOLDER_H
-#define CAMEL_MBOX_FOLDER_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include "camel-local-folder.h"
-#include "camel-mbox-summary.h"
-
-#define CAMEL_MBOX_FOLDER_TYPE (camel_mbox_folder_get_type ())
-#define CAMEL_MBOX_FOLDER(obj) (CAMEL_CHECK_CAST((obj), CAMEL_MBOX_FOLDER_TYPE, CamelMboxFolder))
-#define CAMEL_MBOX_FOLDER_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_MBOX_FOLDER_TYPE, CamelMboxFolderClass))
-#define CAMEL_IS_MBOX_FOLDER(o) (CAMEL_CHECK_TYPE((o), CAMEL_MBOX_FOLDER_TYPE))
-
-typedef struct {
- CamelLocalFolder parent_object;
-
- int lockfd; /* for when we have a lock on the folder */
-} CamelMboxFolder;
-
-typedef struct {
- CamelLocalFolderClass parent_class;
-
- /* Virtual methods */
-
-} CamelMboxFolderClass;
-
-/* public methods */
-/* flags are taken from CAMEL_STORE_FOLDER_* flags */
-CamelFolder *camel_mbox_folder_new(CamelStore *parent_store, const char *full_name, guint32 flags, CamelException *ex);
-
-/* Standard Camel function */
-CamelType camel_mbox_folder_get_type(void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_MBOX_FOLDER_H */
diff --git a/camel/providers/local/camel-mbox-store.c b/camel/providers/local/camel-mbox-store.c
deleted file mode 100644
index ffce19171f..0000000000
--- a/camel/providers/local/camel-mbox-store.c
+++ /dev/null
@@ -1,753 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * Copyright (C) 2000 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <dirent.h>
-#include <fcntl.h>
-#include <errno.h>
-
-#include "camel-mbox-store.h"
-#include "camel-mbox-folder.h"
-#include "camel-file-utils.h"
-#include "camel-text-index.h"
-#include "camel-exception.h"
-#include "camel-url.h"
-
-#define d(x)
-
-static CamelLocalStoreClass *parent_class = NULL;
-
-/* Returns the class for a CamelMboxStore */
-#define CMBOXS_CLASS(so) CAMEL_MBOX_STORE_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-#define CF_CLASS(so) CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-#define CMBOXF_CLASS(so) CAMEL_MBOX_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-
-extern char *camel_mbox_folder_get_full_path (const char *toplevel_dir, const char *full_name);
-extern char *camel_mbox_folder_get_meta_path (const char *toplevel_dir, const char *full_name, const char *ext);
-
-static CamelFolder *get_folder(CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex);
-static void delete_folder(CamelStore *store, const char *folder_name, CamelException *ex);
-static void rename_folder (CamelStore *store, const char *old, const char *new, CamelException *ex);
-static CamelFolderInfo *create_folder (CamelStore *store, const char *parent_name, const char *folder_name, CamelException *ex);
-static CamelFolderInfo *get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelException *ex);
-
-static void
-camel_mbox_store_class_init (CamelMboxStoreClass *camel_mbox_store_class)
-{
- CamelStoreClass *camel_store_class = CAMEL_STORE_CLASS (camel_mbox_store_class);
-
- parent_class = (CamelLocalStoreClass *)camel_type_get_global_classfuncs(camel_local_store_get_type());
-
- /* virtual method overload */
- camel_store_class->get_folder = get_folder;
- camel_store_class->delete_folder = delete_folder;
- camel_store_class->rename_folder = rename_folder;
- camel_store_class->create_folder = create_folder;
-
- camel_store_class->get_folder_info = get_folder_info;
- camel_store_class->free_folder_info = camel_store_free_folder_info_full;
-}
-
-CamelType
-camel_mbox_store_get_type (void)
-{
- static CamelType camel_mbox_store_type = CAMEL_INVALID_TYPE;
-
- if (camel_mbox_store_type == CAMEL_INVALID_TYPE) {
- camel_mbox_store_type = camel_type_register (CAMEL_LOCAL_STORE_TYPE, "CamelMboxStore",
- sizeof (CamelMboxStore),
- sizeof (CamelMboxStoreClass),
- (CamelObjectClassInitFunc) camel_mbox_store_class_init,
- NULL,
- NULL,
- NULL);
- }
-
- return camel_mbox_store_type;
-}
-
-static char *
-mbox_folder_name_to_path (CamelStore *store, const char *folder_name)
-{
- const char *toplevel_dir = CAMEL_LOCAL_STORE (store)->toplevel_dir;
-
- return camel_mbox_folder_get_full_path (toplevel_dir, folder_name);
-}
-
-static char *
-mbox_folder_name_to_meta_path (CamelStore *store, const char *folder_name, const char *ext)
-{
- const char *toplevel_dir = CAMEL_LOCAL_STORE (store)->toplevel_dir;
-
- return camel_mbox_folder_get_meta_path (toplevel_dir, folder_name, ext);
-}
-
-static char *extensions[] = {
- ".msf", ".ev-summary", ".ibex.index", ".ibex.index.data", ".cmeta"
-};
-
-static gboolean
-ignore_file (const char *filename, gboolean sbd)
-{
- int flen, len, i;
-
- flen = strlen (filename);
- for (i = 0; i < (sizeof (extensions) / sizeof (extensions[0])); i++) {
- len = strlen (extensions[i]);
- if (len < flen && !strcmp (filename + flen - len, extensions[i]))
- return TRUE;
- }
-
- if (sbd && flen > 4 && !strcmp (filename + flen - 4, ".sbd"))
- return TRUE;
-
- return FALSE;
-}
-
-static CamelFolder *
-get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex)
-{
- struct stat st;
- char *name;
-
- if (!((CamelStoreClass *) parent_class)->get_folder (store, folder_name, flags, ex))
- return NULL;
-
- name = mbox_folder_name_to_path (store, folder_name);
-
- if (stat (name, &st) == -1) {
- char *dirname;
- int fd;
-
- if (errno != ENOENT) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not open file `%s':\n%s"),
- name, g_strerror (errno));
- g_free (name);
- return NULL;
- }
-
- if ((flags & CAMEL_STORE_FOLDER_CREATE) == 0) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
- _("Folder `%s' does not exist."),
- folder_name);
- g_free (name);
- return NULL;
- }
-
- dirname = g_path_get_dirname (name);
- if (camel_mkdir (dirname, 0777) == -1 && errno != EEXIST) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
- _("Could not create directory `%s':\n%s"),
- dirname, g_strerror (errno));
- g_free (dirname);
- g_free (name);
- return NULL;
- }
-
- g_free (dirname);
-
- fd = open (name, O_WRONLY | O_CREAT | O_APPEND, 0666);
- if (fd == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not create file `%s':\n%s"),
- name, g_strerror (errno));
- g_free (name);
- return NULL;
- }
-
- g_free (name);
- close (fd);
- } else if (!S_ISREG (st.st_mode)) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
- _("`%s' is not a regular file."),
- name);
- g_free (name);
- return NULL;
- } else
- g_free (name);
-
- return camel_mbox_folder_new (store, folder_name, flags, ex);
-}
-
-static void
-delete_folder (CamelStore *store, const char *folder_name, CamelException *ex)
-{
- CamelFolderInfo *fi;
- CamelException lex;
- CamelFolder *lf;
- char *name, *path;
- struct stat st;
-
- name = mbox_folder_name_to_path (store, folder_name);
- path = g_strdup_printf ("%s.sbd", name);
-
- if (rmdir (path) == -1 && errno != ENOENT) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not delete folder `%s':\n%s"),
- folder_name, g_strerror (errno));
- g_free (path);
- g_free (name);
- return;
- }
-
- g_free (path);
-
- if (stat (name, &st) == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not delete folder `%s':\n%s"),
- folder_name, g_strerror (errno));
- g_free (name);
- return;
- }
-
- if (!S_ISREG (st.st_mode)) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
- _("`%s' is not a regular file."), name);
- g_free (name);
- return;
- }
-
- if (st.st_size != 0) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_NON_EMPTY,
- _("Folder `%s' is not empty. Not deleted."),
- folder_name);
- g_free (name);
- return;
- }
-
- if (unlink (name) == -1 && errno != ENOENT) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not delete folder `%s':\n%s"),
- name, g_strerror (errno));
- g_free (name);
- return;
- }
-
- /* FIXME: we have to do our own meta cleanup here rather than
- * calling our parent class' delete_folder() method since our
- * naming convention is different. Need to find a way for
- * CamelLocalStore to be able to construct the folder & meta
- * paths itself */
- path = mbox_folder_name_to_meta_path (store, folder_name, ".ev-summary");
- if (unlink (path) == -1 && errno != ENOENT) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not delete folder summary file `%s': %s"),
- path, g_strerror (errno));
- g_free (path);
- g_free (name);
- return;
- }
-
- g_free (path);
-
- path = mbox_folder_name_to_meta_path (store, folder_name, ".ibex");
- if (camel_text_index_remove (path) == -1 && errno != ENOENT) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not delete folder index file `%s': %s"),
- path, g_strerror (errno));
- g_free (path);
- g_free (name);
- return;
- }
-
- g_free (path);
-
- camel_exception_init (&lex);
- if ((lf = camel_store_get_folder (store, folder_name, 0, &lex))) {
- camel_object_get (lf, NULL, CAMEL_OBJECT_STATE_FILE, &path, NULL);
- camel_object_set (lf, NULL, CAMEL_OBJECT_STATE_FILE, NULL, NULL);
- camel_object_unref (lf);
- } else {
- camel_exception_clear (&lex);
- }
-
- if (path == NULL)
- path = mbox_folder_name_to_meta_path (store, folder_name, ".cmeta");
-
- if (unlink (path) == -1 && errno != ENOENT) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not delete folder meta file `%s': %s"),
- path, g_strerror (errno));
-
- g_free (path);
- g_free (name);
- return;
- }
-
- g_free (path);
- g_free (name);
-
- fi = g_new0 (CamelFolderInfo, 1);
- fi->full_name = g_strdup (folder_name);
- fi->name = g_path_get_basename (folder_name);
- fi->url = g_strdup_printf ("mbox:%s#%s", ((CamelService *) store)->url->path, folder_name);
- fi->unread_message_count = -1;
- camel_folder_info_build_path (fi, '/');
-
- camel_object_trigger_event (store, "folder_deleted", fi);
-
- camel_folder_info_free (fi);
-}
-
-static CamelFolderInfo *
-create_folder (CamelStore *store, const char *parent_name, const char *folder_name, CamelException *ex)
-{
- /* FIXME: this is almost an exact copy of CamelLocalStore::create_folder() except that we use
- * different path schemes... need to find a way to share parent's code? */
- const char *toplevel_dir = ((CamelLocalStore *) store)->toplevel_dir;
- CamelFolderInfo *info = NULL;
- char *path, *name, *dir;
- CamelFolder *folder;
- struct stat st;
-
- if (toplevel_dir[0] != '/') {
- camel_exception_setv (ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
- _("Store root %s is not an absolute path"), toplevel_dir);
- return NULL;
- }
-
- if (folder_name[0] == '.' || ignore_file (folder_name, TRUE)) {
- camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Cannot create a folder by this name."));
- return NULL;
- }
-
- if (parent_name && *parent_name)
- name = g_strdup_printf ("%s/%s", parent_name, folder_name);
- else
- name = g_strdup (folder_name);
-
- path = mbox_folder_name_to_path (store, name);
-
- dir = g_path_get_dirname (path);
- if (camel_mkdir (dir, 0777) == -1 && errno != EEXIST) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot create directory `%s': %s."),
- dir, g_strerror (errno));
-
- g_free (path);
- g_free (name);
- g_free (dir);
-
- return NULL;
- }
-
- g_free (dir);
-
- if (stat (path, &st) == 0 || errno != ENOENT) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
- _("Cannot create folder: %s: %s"),
- path, errno ? g_strerror (errno) :
- _("Folder already exists"));
-
- g_free (path);
- g_free (name);
-
- return NULL;
- }
-
- g_free (path);
-
- folder = ((CamelStoreClass *) ((CamelObject *) store)->klass)->get_folder (store, name, CAMEL_STORE_FOLDER_CREATE, ex);
- if (folder) {
- camel_object_unref (folder);
- info = ((CamelStoreClass *) ((CamelObject *) store)->klass)->get_folder_info (store, name, 0, ex);
- }
-
- g_free (name);
-
- return info;
-}
-
-static int
-xrename (CamelStore *store, const char *old_name, const char *new_name, const char *ext, gboolean missingok, CamelException *ex)
-{
- const char *toplevel_dir = ((CamelLocalStore *) store)->toplevel_dir;
- char *oldpath, *newpath;
- struct stat st;
- int ret = -1;
- int err = 0;
-
- if (ext != NULL) {
- oldpath = camel_mbox_folder_get_meta_path (toplevel_dir, old_name, ext);
- newpath = camel_mbox_folder_get_meta_path (toplevel_dir, new_name, ext);
- } else {
- oldpath = camel_mbox_folder_get_full_path (toplevel_dir, old_name);
- newpath = camel_mbox_folder_get_full_path (toplevel_dir, new_name);
- }
-
- if (stat (oldpath, &st) == -1) {
- if (missingok && errno == ENOENT) {
- ret = 0;
- } else {
- err = errno;
- ret = -1;
- }
- } else if (S_ISDIR (st.st_mode)) {
- /* use rename for dirs */
- if (rename (oldpath, newpath) == 0 || stat (newpath, &st) == 0) {
- ret = 0;
- } else {
- err = errno;
- ret = -1;
- }
- } else if (link (oldpath, newpath) == 0 /* and link for files */
- || (stat (newpath, &st) == 0 && st.st_nlink == 2)) {
- if (unlink (oldpath) == 0) {
- ret = 0;
- } else {
- err = errno;
- unlink (newpath);
- ret = -1;
- }
- } else {
- err = errno;
- ret = -1;
- }
-
- if (ret == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not rename %s to %s: %s"),
- oldpath, newpath, g_strerror (err));
- }
-
- g_free (oldpath);
- g_free (newpath);
-
- return ret;
-}
-
-static void
-rename_folder (CamelStore *store, const char *old, const char *new, CamelException *ex)
-{
- CamelLocalFolder *folder = NULL;
- char *oldibex, *newibex;
-
- if (new[0] == '.' || ignore_file (new, TRUE)) {
- printf ("exception: The new folder name is illegal.\n");
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("The new folder name is illegal."));
- return;
- }
-
- /* try to rollback failures, has obvious races */
-
- oldibex = mbox_folder_name_to_meta_path (store, old, ".ibex");
- newibex = mbox_folder_name_to_meta_path (store, new, ".ibex");
-
- folder = camel_object_bag_get (store->folders, old);
- if (folder && folder->index) {
- if (camel_index_rename (folder->index, newibex) == -1)
- goto ibex_failed;
- } else {
- /* TODO: camel_text_index_rename should find out if we have an active index itself? */
- if (camel_text_index_rename (oldibex, newibex) == -1)
- goto ibex_failed;
- }
-
- if (xrename (store, old, new, ".ev-summary", TRUE, ex))
- goto summary_failed;
-
- if (xrename (store, old, new, NULL, FALSE, ex))
- goto base_failed;
-
- g_free (oldibex);
- g_free (newibex);
-
- if (folder)
- camel_object_unref (folder);
-
- return;
-
- base_failed:
-
- xrename (store, new, old, ".ev-summary", TRUE, ex);
-
- summary_failed:
-
- if (folder) {
- if (folder->index)
- camel_index_rename (folder->index, oldibex);
- } else
- camel_text_index_rename (newibex, oldibex);
- ibex_failed:
-
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not rename '%s': %s"),
- old, g_strerror (errno));
-
- g_free (newibex);
- g_free (oldibex);
-
- if (folder)
- camel_object_unref (folder);
-}
-
-
-/* used to find out where we've visited already */
-struct _inode {
- dev_t dnode;
- ino_t inode;
-};
-
-static guint
-inode_hash (const void *d)
-{
- const struct _inode *v = d;
-
- return v->inode ^ v->dnode;
-}
-
-static gboolean
-inode_equal (const void *a, const void *b)
-{
- const struct _inode *v1 = a, *v2 = b;
-
- return v1->inode == v2->inode && v1->dnode == v2->dnode;
-}
-
-static void
-inode_free (void *k, void *v, void *d)
-{
- g_free (k);
-}
-
-static CamelFolderInfo *
-scan_dir (CamelStore *store, GHashTable *visited, CamelFolderInfo *parent, const char *root,
- const char *name, guint32 flags, CamelException *ex)
-{
- CamelFolderInfo *folders, *tail, *fi;
- GHashTable *folder_hash;
- struct dirent *dent;
- DIR *dir;
-
- tail = folders = NULL;
-
- if (!(dir = opendir (root)))
- return NULL;
-
- folder_hash = g_hash_table_new (g_str_hash, g_str_equal);
-
- /* FIXME: it would be better if we queue'd up the recursive
- * scans till the end so that we can limit the number of
- * directory descriptors open at any given time... */
-
- while ((dent = readdir (dir))) {
- char *short_name, *full_name, *path, *ext;
- CamelFolder *folder;
- struct stat st;
- int unread = -1;
-
- if (dent->d_name[0] == '.')
- continue;
-
- if (ignore_file (dent->d_name, FALSE))
- continue;
-
- path = g_strdup_printf ("%s/%s", root, dent->d_name);
- if (stat (path, &st) == -1) {
- g_free (path);
- continue;
- }
-
- if (S_ISDIR (st.st_mode)) {
- struct _inode in = { st.st_dev, st.st_ino };
-
- if (g_hash_table_lookup (visited, &in)) {
- g_free (path);
- continue;
- }
- }
-
- short_name = g_strdup (dent->d_name);
- if ((ext = strrchr (short_name, '.')) && !strcmp (ext, ".sbd"))
- *ext = '\0';
-
- if (name != NULL)
- full_name = g_strdup_printf ("%s/%s", name, short_name);
- else
- full_name = g_strdup (short_name);
-
- if (!S_ISDIR (st.st_mode)) {
- folder = camel_object_bag_get (store->folders, full_name);
- if (folder) {
- if ((flags & CAMEL_STORE_FOLDER_INFO_FAST) == 0)
- camel_folder_refresh_info (folder, NULL);
- unread = camel_folder_get_unread_message_count (folder);
- camel_object_unref (folder);
- }
- }
-
- if ((fi = g_hash_table_lookup (folder_hash, short_name)) != NULL) {
- g_free (short_name);
- g_free (full_name);
-
- if (S_ISDIR (st.st_mode)) {
- fi->flags = (fi->flags & ~CAMEL_FOLDER_NOINFERIORS) | CAMEL_FOLDER_CHILDREN;
- } else {
- fi->unread_message_count = unread;
- fi->flags &= ~CAMEL_FOLDER_NOSELECT;
- if ((ext = strchr (fi->url, ';')) && !strncmp (ext, ";noselect=yes", 13))
- memmove (ext, ext + 13, strlen (ext + 13) + 1);
- }
- } else {
- fi = g_new0 (CamelFolderInfo, 1);
- fi->parent = parent;
-
- /* add ";noselect=yes" if we haven't found the mbox file yet. when we find it, remove the noselect */
- fi->url = g_strdup_printf ("mbox:%s%s#%s", ((CamelService *) store)->url->path,
- S_ISDIR (st.st_mode) ? ";noselect=yes" : "", full_name);
- fi->name = short_name;
- fi->full_name = full_name;
- fi->path = g_strdup_printf ("/%s", full_name);
- fi->unread_message_count = unread;
-
- if (S_ISDIR (st.st_mode))
- fi->flags = CAMEL_FOLDER_NOSELECT;
- else
- fi->flags = CAMEL_FOLDER_NOINFERIORS;
-
- if (tail == NULL)
- folders = fi;
- else
- tail->sibling = fi;
-
- tail = fi;
-
- g_hash_table_insert (folder_hash, fi->name, fi);
- }
-
- if ((flags & CAMEL_STORE_FOLDER_INFO_RECURSIVE) && S_ISDIR (st.st_mode)) {
- struct _inode in = { st.st_dev, st.st_ino };
-
- if (g_hash_table_lookup (visited, &in) == NULL) {
- struct _inode *inew = g_new (struct _inode, 1);
-
- *inew = in;
-
- g_hash_table_insert (visited, inew, inew);
-
- if ((fi->child = scan_dir (store, visited, fi, path, fi->full_name, flags, ex)))
- fi->flags |= CAMEL_FOLDER_CHILDREN;
- }
- }
-
- g_free (path);
- }
-
- closedir (dir);
-
- g_hash_table_destroy (folder_hash);
-
- return folders;
-}
-
-static CamelFolderInfo *
-get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelException *ex)
-{
- GHashTable *visited;
- struct _inode *inode;
- char *path, *subdir;
- CamelFolderInfo *fi;
- CamelFolder *folder;
- const char *base;
- struct stat st;
- int unread = -1;
-
- top = top ? top : "";
- path = mbox_folder_name_to_path (store, top);
-
- if (*top == '\0') {
- /* requesting root dir scan */
- if (stat (path, &st) == -1 || !S_ISDIR (st.st_mode)) {
- g_free (path);
- return NULL;
- }
-
- visited = g_hash_table_new (inode_hash, inode_equal);
-
- inode = g_new (struct _inode, 1);
- inode->dnode = st.st_dev;
- inode->inode = st.st_ino;
-
- g_hash_table_insert (visited, inode, inode);
-
- fi = scan_dir (store, visited, NULL, path, NULL, flags, ex);
- g_hash_table_foreach (visited, inode_free, NULL);
- g_hash_table_destroy (visited);
- g_free (path);
-
- return fi;
- }
-
- /* requesting scan of specific folder */
- if (stat (path, &st) == -1 || !S_ISREG (st.st_mode)) {
- g_free (path);
- return NULL;
- }
-
- visited = g_hash_table_new (inode_hash, inode_equal);
-
- if (!(base = strrchr (top, '/')))
- base = top;
- else
- base++;
-
- folder = camel_object_bag_get (store->folders, top);
- if (folder) {
- if ((flags & CAMEL_STORE_FOLDER_INFO_FAST) == 0)
- camel_folder_refresh_info (folder, NULL);
- unread = camel_folder_get_unread_message_count (folder);
- camel_object_unref (folder);
- }
-
- fi = g_new0 (CamelFolderInfo, 1);
- fi->parent = NULL;
- fi->url = g_strdup_printf ("mbox:%s#%s", ((CamelService *) store)->url->path, top);
- fi->name = g_strdup (base);
- fi->full_name = g_strdup (top);
- fi->unread_message_count = unread;
- fi->path = g_strdup_printf ("/%s", top);
-
- subdir = g_strdup_printf ("%s.sbd", path);
- if (stat (subdir, &st) == 0 && S_ISDIR (st.st_mode))
- fi->child = scan_dir (store, visited, fi, subdir, top, flags, ex);
-
- if (fi->child)
- fi->flags |= CAMEL_FOLDER_CHILDREN;
- else
- fi->flags |= CAMEL_FOLDER_NOINFERIORS;
-
- g_free (subdir);
-
- g_hash_table_foreach (visited, inode_free, NULL);
- g_hash_table_destroy (visited);
- g_free (path);
-
- return fi;
-}
diff --git a/camel/providers/local/camel-mbox-store.h b/camel/providers/local/camel-mbox-store.h
deleted file mode 100644
index 5b6fbdd926..0000000000
--- a/camel/providers/local/camel-mbox-store.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * Copyright (C) 2000 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifndef CAMEL_MBOX_STORE_H
-#define CAMEL_MBOX_STORE_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include "camel-local-store.h"
-
-#define CAMEL_MBOX_STORE_TYPE (camel_mbox_store_get_type ())
-#define CAMEL_MBOX_STORE(obj) (CAMEL_CHECK_CAST((obj), CAMEL_MBOX_STORE_TYPE, CamelMboxStore))
-#define CAMEL_MBOX_STORE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_MBOX_STORE_TYPE, CamelMboxStoreClass))
-#define CAMEL_IS_MBOX_STORE(o) (CAMEL_CHECK_TYPE((o), CAMEL_MBOX_STORE_TYPE))
-
-typedef struct {
- CamelLocalStore parent_object;
-
-} CamelMboxStore;
-
-typedef struct {
- CamelLocalStoreClass parent_class;
-
-} CamelMboxStoreClass;
-
-/* public methods */
-
-/* Standard Camel function */
-CamelType camel_mbox_store_get_type (void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_MBOX_STORE_H */
-
-
diff --git a/camel/providers/local/camel-mbox-summary.c b/camel/providers/local/camel-mbox-summary.c
deleted file mode 100644
index 4018fc93c9..0000000000
--- a/camel/providers/local/camel-mbox-summary.c
+++ /dev/null
@@ -1,1029 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; fill-column: 160 -*-
- *
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "camel-mbox-summary.h"
-#include "camel/camel-mime-message.h"
-#include "camel/camel-operation.h"
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <sys/uio.h>
-#include <unistd.h>
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include "camel-mbox-summary.h"
-#include "camel/camel-file-utils.h"
-#include "camel/camel-mime-message.h"
-#include "camel/camel-operation.h"
-
-#define io(x)
-#define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))*/
-
-#define CAMEL_MBOX_SUMMARY_VERSION (0x1000)
-
-static int summary_header_load (CamelFolderSummary *, FILE *);
-static int summary_header_save (CamelFolderSummary *, FILE *);
-
-static CamelMessageInfo * message_info_new (CamelFolderSummary *, struct _camel_header_raw *);
-static CamelMessageInfo * message_info_new_from_parser (CamelFolderSummary *, CamelMimeParser *);
-static CamelMessageInfo * message_info_load (CamelFolderSummary *, FILE *);
-static int message_info_save (CamelFolderSummary *, FILE *, CamelMessageInfo *);
-/*static void message_info_free (CamelFolderSummary *, CamelMessageInfo *);*/
-
-static int mbox_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changeinfo, CamelException *ex);
-static int mbox_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex);
-#ifdef STATUS_PINE
-static CamelMessageInfo *mbox_summary_add(CamelLocalSummary *cls, CamelMimeMessage *msg, const CamelMessageInfo *info, CamelFolderChangeInfo *ci, CamelException *ex);
-#endif
-
-static int mbox_summary_sync_quick(CamelMboxSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex);
-static int mbox_summary_sync_full(CamelMboxSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex);
-
-static void camel_mbox_summary_class_init (CamelMboxSummaryClass *klass);
-static void camel_mbox_summary_init (CamelMboxSummary *obj);
-static void camel_mbox_summary_finalise (CamelObject *obj);
-
-#ifdef STATUS_PINE
-/* Which status flags are stored in each separate header */
-#define STATUS_XSTATUS (CAMEL_MESSAGE_FLAGGED|CAMEL_MESSAGE_ANSWERED|CAMEL_MESSAGE_DELETED)
-#define STATUS_STATUS (CAMEL_MESSAGE_SEEN)
-
-static void encode_status(guint32 flags, char status[8]);
-static guint32 decode_status(const char *status);
-#endif
-
-static CamelLocalSummaryClass *camel_mbox_summary_parent;
-
-CamelType
-camel_mbox_summary_get_type(void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register(camel_local_summary_get_type(), "CamelMboxSummary",
- sizeof (CamelMboxSummary),
- sizeof (CamelMboxSummaryClass),
- (CamelObjectClassInitFunc) camel_mbox_summary_class_init,
- NULL,
- (CamelObjectInitFunc) camel_mbox_summary_init,
- (CamelObjectFinalizeFunc) camel_mbox_summary_finalise);
- }
-
- return type;
-}
-
-static void
-camel_mbox_summary_class_init(CamelMboxSummaryClass *klass)
-{
- CamelFolderSummaryClass *sklass = (CamelFolderSummaryClass *)klass;
- CamelLocalSummaryClass *lklass = (CamelLocalSummaryClass *)klass;
-
- camel_mbox_summary_parent = (CamelLocalSummaryClass *)camel_type_get_global_classfuncs(camel_local_summary_get_type());
-
- sklass->summary_header_load = summary_header_load;
- sklass->summary_header_save = summary_header_save;
-
- sklass->message_info_new = message_info_new;
- sklass->message_info_new_from_parser = message_info_new_from_parser;
- sklass->message_info_load = message_info_load;
- sklass->message_info_save = message_info_save;
- /*sklass->message_info_free = message_info_free;*/
-
- lklass->check = mbox_summary_check;
- lklass->sync = mbox_summary_sync;
-#ifdef STATUS_PINE
- lklass->add = mbox_summary_add;
-#endif
-
- klass->sync_quick = mbox_summary_sync_quick;
- klass->sync_full = mbox_summary_sync_full;
-}
-
-static void
-camel_mbox_summary_init(CamelMboxSummary *obj)
-{
- struct _CamelFolderSummary *s = (CamelFolderSummary *)obj;
-
- /* subclasses need to set the right instance data sizes */
- s->message_info_size = sizeof(CamelMboxMessageInfo);
- s->content_info_size = sizeof(CamelMboxMessageContentInfo);
-
- /* and a unique file version */
- s->version += CAMEL_MBOX_SUMMARY_VERSION;
-}
-
-static void
-camel_mbox_summary_finalise(CamelObject *obj)
-{
- /*CamelMboxSummary *mbs = CAMEL_MBOX_SUMMARY(obj);*/
-}
-
-/**
- * camel_mbox_summary_new:
- *
- * Create a new CamelMboxSummary object.
- *
- * Return value: A new CamelMboxSummary widget.
- **/
-CamelMboxSummary *
-camel_mbox_summary_new(const char *filename, const char *mbox_name, CamelIndex *index)
-{
- CamelMboxSummary *new = (CamelMboxSummary *)camel_object_new(camel_mbox_summary_get_type());
-
- camel_local_summary_construct((CamelLocalSummary *)new, filename, mbox_name, index);
- return new;
-}
-
-void camel_mbox_summary_xstatus(CamelMboxSummary *mbs, int state)
-{
- mbs->xstatus = state;
-}
-
-static int
-summary_header_load(CamelFolderSummary *s, FILE *in)
-{
- CamelMboxSummary *mbs = CAMEL_MBOX_SUMMARY(s);
-
- if (((CamelFolderSummaryClass *)camel_mbox_summary_parent)->summary_header_load(s, in) == -1)
- return -1;
-
- return camel_file_util_decode_uint32(in, (guint32 *) &mbs->folder_size);
-}
-
-static int
-summary_header_save(CamelFolderSummary *s, FILE *out)
-{
- CamelMboxSummary *mbs = CAMEL_MBOX_SUMMARY(s);
-
- if (((CamelFolderSummaryClass *)camel_mbox_summary_parent)->summary_header_save(s, out) == -1)
- return -1;
-
- return camel_file_util_encode_uint32(out, mbs->folder_size);
-}
-
-static CamelMessageInfo *
-message_info_new(CamelFolderSummary *s, struct _camel_header_raw *h)
-{
- CamelMessageInfo *mi;
- CamelMboxSummary *mbs = (CamelMboxSummary *)s;
-
- mi = ((CamelFolderSummaryClass *)camel_mbox_summary_parent)->message_info_new(s, h);
- if (mi) {
- CamelMboxMessageInfo *mbi = (CamelMboxMessageInfo *)mi;
- const char *xev, *uid;
- CamelMessageInfo *info = NULL;
- int add = 0; /* bitmask of things to add, 1 assign uid, 2, just add as new, 4 = recent */
-#ifdef STATUS_PINE
- const char *status = NULL, *xstatus = NULL;
- guint32 flags = 0;
-
- if (mbs->xstatus) {
- /* check for existance of status & x-status headers */
- status = camel_header_raw_find(&h, "Status", NULL);
- if (status)
- flags = decode_status(status);
- xstatus = camel_header_raw_find(&h, "X-Status", NULL);
- if (xstatus)
- flags |= decode_status(xstatus);
- }
-#endif
- /* if we have an xev header, use it, else assign a new one */
- xev = camel_header_raw_find(&h, "X-Evolution", NULL);
- if (xev != NULL
- && camel_local_summary_decode_x_evolution((CamelLocalSummary *)s, xev, mi) == 0) {
- uid = camel_message_info_uid(mi);
- d(printf("found valid x-evolution: %s\n", uid));
- info = camel_folder_summary_uid(s, uid);
- if (info) {
- if ((info->flags & CAMEL_MESSAGE_FOLDER_NOTSEEN)) {
- info->flags &= ~CAMEL_MESSAGE_FOLDER_NOTSEEN;
- camel_folder_summary_info_free(s, mi);
- mbi = (CamelMboxMessageInfo *)mi = info;
- } else {
- add = 7;
- d(printf("seen '%s' before, adding anew\n", uid));
- camel_folder_summary_info_free(s, info);
- }
- } else {
- add = 2;
- d(printf("but isn't present in summary\n"));
- }
- } else {
- d(printf("didn't find x-evolution\n"));
- add = 7;
- }
-
- if (add&1) {
- mi->flags |= CAMEL_MESSAGE_FOLDER_FLAGGED | CAMEL_MESSAGE_FOLDER_NOXEV;
- camel_message_info_set_uid(mi, camel_folder_summary_next_uid_string(s));
- } else {
- camel_folder_summary_set_uid(s, strtoul(camel_message_info_uid(mi), NULL, 10));
- }
-#ifdef STATUS_PINE
- if (mbs->xstatus && add&2) {
- /* use the status as the flags when we read it the first time */
- if (status)
- mi->flags = (mi->flags & ~(STATUS_STATUS)) | (flags & STATUS_STATUS);
- if (xstatus)
- mi->flags = (mi->flags & ~(STATUS_XSTATUS)) | (flags & STATUS_XSTATUS);
- }
-#endif
- if (mbs->changes) {
- if (add&2)
- camel_folder_change_info_add_uid(mbs->changes, camel_message_info_uid(mi));
- if ((add&4) && status == NULL)
- camel_folder_change_info_recent_uid(mbs->changes, camel_message_info_uid(mi));
- }
-
- mbi->frompos = -1;
- }
-
- return mi;
-}
-
-static CamelMessageInfo *
-message_info_new_from_parser(CamelFolderSummary *s, CamelMimeParser *mp)
-{
- CamelMessageInfo *mi;
-
- mi = ((CamelFolderSummaryClass *)camel_mbox_summary_parent)->message_info_new_from_parser(s, mp);
- if (mi) {
- CamelMboxMessageInfo *mbi = (CamelMboxMessageInfo *)mi;
-
- mbi->frompos = camel_mime_parser_tell_start_from(mp);
- }
-
- return mi;
-}
-
-static CamelMessageInfo *
-message_info_load(CamelFolderSummary *s, FILE *in)
-{
- CamelMessageInfo *mi;
-
- io(printf("loading mbox message info\n"));
-
- mi = ((CamelFolderSummaryClass *)camel_mbox_summary_parent)->message_info_load(s, in);
- if (mi) {
- CamelMboxMessageInfo *mbi = (CamelMboxMessageInfo *)mi;
-
- if (camel_file_util_decode_off_t(in, &mbi->frompos) == -1)
- goto error;
- }
-
- return mi;
-error:
- camel_folder_summary_info_free(s, mi);
- return NULL;
-}
-
-static int
-message_info_save(CamelFolderSummary *s, FILE *out, CamelMessageInfo *mi)
-{
- CamelMboxMessageInfo *mbi = (CamelMboxMessageInfo *)mi;
-
- io(printf("saving mbox message info\n"));
-
- if (((CamelFolderSummaryClass *)camel_mbox_summary_parent)->message_info_save(s, out, mi) == -1
- || camel_file_util_encode_off_t(out, mbi->frompos) == -1)
- return -1;
-
- return 0;
-}
-
-/* like summary_rebuild, but also do changeinfo stuff (if supplied) */
-static int
-summary_update(CamelLocalSummary *cls, off_t offset, CamelFolderChangeInfo *changeinfo, CamelException *ex)
-{
- int i, count;
- CamelFolderSummary *s = (CamelFolderSummary *)cls;
- CamelMboxSummary *mbs = (CamelMboxSummary *)cls;
- CamelMimeParser *mp;
- CamelMessageInfo *mi;
- int fd;
- int ok = 0;
- struct stat st;
- off_t size = 0;
-
- d(printf("Calling summary update, from pos %d\n", (int)offset));
-
- cls->index_force = FALSE;
-
- camel_operation_start(NULL, _("Storing folder"));
-
- fd = open(cls->folder_path, O_RDONLY);
- if (fd == -1) {
- d(printf("%s failed to open: %s\n", cls->folder_path, strerror (errno)));
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not open folder: %s: %s"),
- cls->folder_path, g_strerror (errno));
- camel_operation_end(NULL);
- return -1;
- }
-
- if (fstat(fd, &st) == 0)
- size = st.st_size;
-
- mp = camel_mime_parser_new();
- camel_mime_parser_init_with_fd(mp, fd);
- camel_mime_parser_scan_from(mp, TRUE);
- camel_mime_parser_seek(mp, offset, SEEK_SET);
-
- if (offset > 0) {
- if (camel_mime_parser_step(mp, NULL, NULL) == CAMEL_MIME_PARSER_STATE_FROM
- && camel_mime_parser_tell_start_from(mp) == offset) {
- camel_mime_parser_unstep(mp);
- } else {
- g_warning("The next message didn't start where I expected, building summary from start");
- camel_mime_parser_drop_step(mp);
- offset = 0;
- camel_mime_parser_seek(mp, offset, SEEK_SET);
- }
- }
-
- /* we mark messages as to whether we've seen them or not.
- If we're not starting from the start, we must be starting
- from the old end, so everything must be treated as new */
- count = camel_folder_summary_count(s);
- for (i=0;i<count;i++) {
- mi = camel_folder_summary_index(s, i);
- if (offset == 0)
- mi->flags |= CAMEL_MESSAGE_FOLDER_NOTSEEN;
- else
- mi->flags &= ~CAMEL_MESSAGE_FOLDER_NOTSEEN;
- camel_folder_summary_info_free(s, mi);
- }
- mbs->changes = changeinfo;
-
- while (camel_mime_parser_step(mp, NULL, NULL) == CAMEL_MIME_PARSER_STATE_FROM) {
- CamelMessageInfo *info;
- off_t pc = camel_mime_parser_tell_start_from (mp) + 1;
-
- camel_operation_progress (NULL, (int) (((float) pc / size) * 100));
-
- info = camel_folder_summary_add_from_parser(s, mp);
- if (info == NULL) {
- camel_exception_setv(ex, 1, _("Fatal mail parser error near position %ld in folder %s"),
- camel_mime_parser_tell(mp), cls->folder_path);
- ok = -1;
- break;
- }
-
- g_assert(camel_mime_parser_step(mp, NULL, NULL) == CAMEL_MIME_PARSER_STATE_FROM_END);
- }
-
- camel_object_unref(CAMEL_OBJECT (mp));
-
- count = camel_folder_summary_count(s);
- for (i=0;i<count;i++) {
- mi = camel_folder_summary_index(s, i);
- /* must've dissapeared from the file? */
- if (mi->flags & CAMEL_MESSAGE_FOLDER_NOTSEEN) {
- d(printf("uid '%s' vanished, removing", camel_message_info_uid(mi)));
- if (changeinfo)
- camel_folder_change_info_remove_uid(changeinfo, camel_message_info_uid(mi));
- camel_folder_summary_remove(s, mi);
- count--;
- i--;
- }
- camel_folder_summary_info_free(s, mi);
- }
- mbs->changes = NULL;
-
- /* update the file size/mtime in the summary */
- if (ok != -1) {
- if (stat(cls->folder_path, &st) == 0) {
- camel_folder_summary_touch(s);
- mbs->folder_size = st.st_size;
- s->time = st.st_mtime;
- }
- }
-
- camel_operation_end(NULL);
-
- return ok;
-}
-
-static int
-mbox_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changes, CamelException *ex)
-{
- CamelMboxSummary *mbs = (CamelMboxSummary *)cls;
- CamelFolderSummary *s = (CamelFolderSummary *)cls;
- struct stat st;
- int ret = 0;
- int i, count;
-
- d(printf("Checking summary\n"));
-
- /* check if the summary is up-to-date */
- if (stat(cls->folder_path, &st) == -1) {
- camel_folder_summary_clear(s);
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Cannot check folder: %s: %s"),
- cls->folder_path, g_strerror (errno));
- return -1;
- }
-
- if (cls->check_force)
- mbs->folder_size = 0;
- cls->check_force = 0;
-
- if (st.st_size == 0) {
- /* empty? No need to scan at all */
- d(printf("Empty mbox, clearing summary\n"));
- count= camel_folder_summary_count(s);
- for (i=0;i<count;i++) {
- CamelMessageInfo *info = camel_folder_summary_index(s, i);
-
- if (info) {
- camel_folder_change_info_remove_uid(changes, camel_message_info_uid(info));
- camel_folder_summary_info_free(s, info);
- }
- }
- camel_folder_summary_clear(s);
- ret = 0;
- } else {
- /* is the summary uptodate? */
- if (st.st_size != mbs->folder_size || st.st_mtime != s->time) {
- if (mbs->folder_size < st.st_size) {
- /* this will automatically rescan from 0 if there is a problem */
- d(printf("folder grew, attempting to rebuild from %d\n", mbs->folder_size));
- ret = summary_update(cls, mbs->folder_size, changes, ex);
- } else {
- d(printf("folder shrank! rebuilding from start\n"));
- ret = summary_update(cls, 0, changes, ex);
- }
- } else {
- d(printf("Folder unchanged, do nothing\n"));
- }
- }
-
- /* FIXME: move upstream? */
-
- if (ret != -1) {
- if (mbs->folder_size != st.st_size || s->time != st.st_mtime) {
- mbs->folder_size = st.st_size;
- s->time = st.st_mtime;
- camel_folder_summary_touch(s);
- }
- }
-
- return ret;
-}
-
-/* perform a full sync */
-static int
-mbox_summary_sync_full(CamelMboxSummary *mbs, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex)
-{
- CamelLocalSummary *cls = (CamelLocalSummary *)mbs;
- int fd = -1, fdout = -1;
- char *tmpname = NULL;
- guint32 flags = (expunge?1:0);
-
- d(printf("performing full summary/sync\n"));
-
- camel_operation_start(NULL, _("Storing folder"));
-
- fd = open(cls->folder_path, O_RDONLY);
- if (fd == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not open file: %s: %s"),
- cls->folder_path, g_strerror (errno));
- camel_operation_end(NULL);
- return -1;
- }
-
- tmpname = g_alloca (strlen (cls->folder_path) + 5);
- sprintf (tmpname, "%s.tmp", cls->folder_path);
- d(printf("Writing tmp file to %s\n", tmpname));
- fdout = open(tmpname, O_WRONLY|O_CREAT|O_TRUNC, 0600);
- if (fdout == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Cannot open temporary mailbox: %s"),
- g_strerror (errno));
- goto error;
- }
-
- if (camel_mbox_summary_sync_mbox((CamelMboxSummary *)cls, flags, changeinfo, fd, fdout, ex) == -1)
- goto error;
-
- d(printf("Closing folders\n"));
-
- if (close(fd) == -1) {
- g_warning("Cannot close source folder: %s", strerror (errno));
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not close source folder %s: %s"),
- cls->folder_path, g_strerror (errno));
- fd = -1;
- goto error;
- }
-
- if (close(fdout) == -1) {
- g_warning("Cannot close tmp folder: %s", strerror (errno));
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not close temp folder: %s"),
- g_strerror (errno));
- fdout = -1;
- goto error;
- }
-
- /* this should probably either use unlink/link/unlink, or recopy over
- the original mailbox, for various locking reasons/etc */
- if (rename(tmpname, cls->folder_path) == -1) {
- g_warning("Cannot rename folder: %s", strerror (errno));
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not rename folder: %s"),
- g_strerror (errno));
- goto error;
- }
- tmpname = NULL;
-
- camel_operation_end(NULL);
-
- return 0;
- error:
- if (fd != -1)
- close(fd);
-
- if (fdout != -1)
- close(fdout);
-
- if (tmpname)
- unlink(tmpname);
-
- camel_operation_end(NULL);
-
- return -1;
-}
-
-/* perform a quick sync - only system flags have changed */
-static int
-mbox_summary_sync_quick(CamelMboxSummary *mbs, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex)
-{
- CamelLocalSummary *cls = (CamelLocalSummary *)mbs;
- CamelFolderSummary *s = (CamelFolderSummary *)mbs;
- CamelMimeParser *mp = NULL;
- int i, count;
- CamelMboxMessageInfo *info = NULL;
- int fd = -1;
- char *xevnew, *xevtmp;
- const char *xev;
- int len;
- off_t lastpos;
-
- d(printf("Performing quick summary sync\n"));
-
- camel_operation_start(NULL, _("Storing folder"));
-
- fd = open(cls->folder_path, O_RDWR);
- if (fd == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not open file: %s: %s"),
- cls->folder_path, g_strerror (errno));
-
- camel_operation_end(NULL);
- return -1;
- }
-
- mp = camel_mime_parser_new();
- camel_mime_parser_scan_from(mp, TRUE);
- camel_mime_parser_scan_pre_from(mp, TRUE);
- camel_mime_parser_init_with_fd(mp, fd);
-
- count = camel_folder_summary_count(s);
- for (i = 0; i < count; i++) {
- int xevoffset;
- int pc = (i+1)*100/count;
-
- camel_operation_progress(NULL, pc);
-
- info = (CamelMboxMessageInfo *)camel_folder_summary_index(s, i);
-
- g_assert(info);
-
- d(printf("Checking message %s %08x\n", camel_message_info_uid(info), info->info.flags));
-
- if ((info->info.flags & CAMEL_MESSAGE_FOLDER_FLAGGED) == 0) {
- camel_folder_summary_info_free(s, (CamelMessageInfo *)info);
- info = NULL;
- continue;
- }
-
- d(printf("Updating message %s\n", camel_message_info_uid(info)));
-
- camel_mime_parser_seek(mp, info->frompos, SEEK_SET);
-
- if (camel_mime_parser_step(mp, 0, 0) != CAMEL_MIME_PARSER_STATE_FROM) {
- g_warning("Expected a From line here, didn't get it");
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Summary and folder mismatch, even after a sync"));
- goto error;
- }
-
- if (camel_mime_parser_tell_start_from(mp) != info->frompos) {
- g_warning("Didn't get the next message where I expected (%d) got %d instead",
- (int)info->frompos, (int)camel_mime_parser_tell_start_from(mp));
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Summary and folder mismatch, even after a sync"));
- goto error;
- }
-
- if (camel_mime_parser_step(mp, 0, 0) == CAMEL_MIME_PARSER_STATE_FROM_END) {
- g_warning("camel_mime_parser_step failed (2)");
- goto error;
- }
-
- xev = camel_mime_parser_header(mp, "X-Evolution", &xevoffset);
- if (xev == NULL || camel_local_summary_decode_x_evolution(cls, xev, NULL) == -1) {
- g_warning("We're supposed to have a valid x-ev header, but we dont");
- goto error;
- }
- xevnew = camel_local_summary_encode_x_evolution(cls, (CamelMessageInfo *)info);
- /* SIGH: encode_param_list is about the only function which folds headers by itself.
- This should be fixed somehow differently (either parser doesn't fold headers,
- or param_list doesn't, or something */
- xevtmp = camel_header_unfold(xevnew);
- /* the raw header contains a leading ' ', so (dis)count that too */
- if (strlen(xev)-1 != strlen(xevtmp)) {
- printf ("strlen(xev)-1 = %d; strlen(xevtmp) = %d\n", strlen(xev)-1, strlen(xevtmp));
- printf ("xev='%s'; xevtmp='%s'\n", xev, xevtmp);
- g_free(xevnew);
- g_free(xevtmp);
- g_warning("Hmm, the xev headers shouldn't have changed size, but they did");
- goto error;
- }
- g_free(xevtmp);
-
- /* we write out the xevnew string, assuming its been folded identically to the original too! */
-
- lastpos = lseek(fd, 0, SEEK_CUR);
- lseek(fd, xevoffset+strlen("X-Evolution: "), SEEK_SET);
- do {
- len = write(fd, xevnew, strlen(xevnew));
- } while (len == -1 && errno == EINTR);
- lseek(fd, lastpos, SEEK_SET);
- g_free(xevnew);
-
- camel_mime_parser_drop_step(mp);
- camel_mime_parser_drop_step(mp);
-
- info->info.flags &= 0xffff;
- camel_folder_summary_info_free(s, (CamelMessageInfo *)info);
- }
-
- d(printf("Closing folders\n"));
-
- if (close(fd) == -1) {
- g_warning ("Cannot close source folder: %s", strerror (errno));
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not close source folder %s: %s"),
- cls->folder_path, g_strerror (errno));
- fd = -1;
- goto error;
- }
-
- camel_object_unref((CamelObject *)mp);
-
- camel_operation_end(NULL);
-
- return 0;
- error:
- if (fd != -1)
- close(fd);
- if (mp)
- camel_object_unref((CamelObject *)mp);
- if (info)
- camel_folder_summary_info_free(s, (CamelMessageInfo *)info);
-
- camel_operation_end(NULL);
-
- return -1;
-}
-
-static int
-mbox_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex)
-{
- struct stat st;
- CamelMboxSummary *mbs = (CamelMboxSummary *)cls;
- CamelFolderSummary *s = (CamelFolderSummary *)cls;
- int i, count;
- int quick = TRUE, work=FALSE;
- int ret;
-
- /* first, sync ourselves up, just to make sure */
- if (camel_local_summary_check(cls, changeinfo, ex) == -1)
- return -1;
-
- count = camel_folder_summary_count(s);
- if (count == 0)
- return 0;
-
- /* check what work we have to do, if any */
- for (i=0;quick && i<count; i++) {
- CamelMessageInfo *info = camel_folder_summary_index(s, i);
- g_assert(info);
- if ((expunge && (info->flags & CAMEL_MESSAGE_DELETED)) ||
- (info->flags & (CAMEL_MESSAGE_FOLDER_NOXEV|CAMEL_MESSAGE_FOLDER_XEVCHANGE)))
- quick = FALSE;
- else
- work |= (info->flags & CAMEL_MESSAGE_FOLDER_FLAGGED) != 0;
- camel_folder_summary_info_free(s, info);
- }
-
- /* yuck i hate this logic, but its to simplify the 'all ok, update summary' and failover cases */
- ret = -1;
- if (quick) {
- if (work) {
- ret = ((CamelMboxSummaryClass *)((CamelObject *)cls)->klass)->sync_quick(mbs, expunge, changeinfo, ex);
- if (ret == -1) {
- g_warning("failed a quick-sync, trying a full sync");
- camel_exception_clear(ex);
- }
- } else {
- ret = 0;
- }
- }
-
- if (ret == -1)
- ret = ((CamelMboxSummaryClass *)((CamelObject *)cls)->klass)->sync_full(mbs, expunge, changeinfo, ex);
- if (ret == -1)
- return -1;
-
- if (stat(cls->folder_path, &st) == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Unknown error: %s"), g_strerror (errno));
- return -1;
- }
-
- if (mbs->folder_size != st.st_size || s->time != st.st_mtime) {
- s->time = st.st_mtime;
- mbs->folder_size = st.st_size;
- camel_folder_summary_touch(s);
- }
-
- return ((CamelLocalSummaryClass *)camel_mbox_summary_parent)->sync(cls, expunge, changeinfo, ex);
-}
-
-int
-camel_mbox_summary_sync_mbox(CamelMboxSummary *cls, guint32 flags, CamelFolderChangeInfo *changeinfo, int fd, int fdout, CamelException *ex)
-{
- CamelMboxSummary *mbs = (CamelMboxSummary *)cls;
- CamelFolderSummary *s = (CamelFolderSummary *)mbs;
- CamelMimeParser *mp = NULL;
- int i, count;
- CamelMboxMessageInfo *info = NULL;
- char *buffer, *xevnew = NULL;
- size_t len;
- const char *fromline;
- int lastdel = FALSE;
-#ifdef STATUS_PINE
- char statnew[8], xstatnew[8];
-#endif
-
- d(printf("performing full summary/sync\n"));
-
- /* need to dup this because the mime-parser owns the fd after we give it to it */
- fd = dup(fd);
- if (fd == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not store folder: %s"),
- g_strerror (errno));
- return -1;
- }
-
- mp = camel_mime_parser_new();
- camel_mime_parser_scan_from(mp, TRUE);
- camel_mime_parser_scan_pre_from(mp, TRUE);
- camel_mime_parser_init_with_fd(mp, fd);
-
- count = camel_folder_summary_count(s);
- for (i = 0; i < count; i++) {
- int pc = (i + 1) * 100 / count;
-
- camel_operation_progress(NULL, pc);
-
- info = (CamelMboxMessageInfo *)camel_folder_summary_index(s, i);
-
- g_assert(info);
-
- d(printf("Looking at message %s\n", camel_message_info_uid(info)));
-
- /* only need to seek past deleted messages, otherwise we should be at the right spot/state already */
- if (lastdel) {
- d(printf("seeking to %d\n", (int)info->frompos));
- camel_mime_parser_seek(mp, info->frompos, SEEK_SET);
- }
-
- if (camel_mime_parser_step(mp, &buffer, &len) != CAMEL_MIME_PARSER_STATE_FROM) {
- g_warning("Expected a From line here, didn't get it");
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Summary and folder mismatch, even after a sync"));
- goto error;
- }
-
- if (camel_mime_parser_tell_start_from(mp) != info->frompos) {
- g_warning("Didn't get the next message where I expected (%d) got %d instead",
- (int)info->frompos, (int)camel_mime_parser_tell_start_from(mp));
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Summary and folder mismatch, even after a sync"));
- goto error;
- }
-
- lastdel = FALSE;
- if ((flags&1) && info->info.flags & CAMEL_MESSAGE_DELETED) {
- const char *uid = camel_message_info_uid(info);
-
- d(printf("Deleting %s\n", uid));
-
- if (((CamelLocalSummary *)cls)->index)
- camel_index_delete_name(((CamelLocalSummary *)cls)->index, uid);
-
- /* remove it from the change list */
- camel_folder_change_info_remove_uid(changeinfo, uid);
- camel_folder_summary_remove(s, (CamelMessageInfo *)info);
- camel_folder_summary_info_free(s, (CamelMessageInfo *)info);
- count--;
- i--;
- info = NULL;
- lastdel = TRUE;
- } else {
- /* otherwise, the message is staying, copy its From_ line across */
-#if 0
- if (i>0)
- write(fdout, "\n", 1);
-#endif
- info->frompos = lseek(fdout, 0, SEEK_CUR);
- fromline = camel_mime_parser_from_line(mp);
- write(fdout, fromline, strlen(fromline));
- }
-
- if (info && info->info.flags & (CAMEL_MESSAGE_FOLDER_NOXEV | CAMEL_MESSAGE_FOLDER_FLAGGED)) {
- d(printf("Updating header for %s flags = %08x\n", camel_message_info_uid(info), info->info.flags));
-
- if (camel_mime_parser_step(mp, &buffer, &len) == CAMEL_MIME_PARSER_STATE_FROM_END) {
- g_warning("camel_mime_parser_step failed (2)");
- goto error;
- }
-
- xevnew = camel_local_summary_encode_x_evolution((CamelLocalSummary *)cls, (CamelMessageInfo *)info);
-#ifdef STATUS_PINE
- if (mbs->xstatus) {
- encode_status(((CamelMessageInfo *)info)->flags & STATUS_STATUS, statnew);
- encode_status(((CamelMessageInfo *)info)->flags & STATUS_XSTATUS, xstatnew);
- len = camel_local_summary_write_headers(fdout, camel_mime_parser_headers_raw(mp), xevnew, statnew, xstatnew);
- } else {
-#endif
- len = camel_local_summary_write_headers(fdout, camel_mime_parser_headers_raw(mp), xevnew, NULL, NULL);
-#ifdef STATUS_PINE
- }
-#endif
- if (len == -1) {
- d(printf("Error writing to tmp mailbox\n"));
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Error writing to temp mailbox: %s"),
- g_strerror (errno));
- goto error;
- }
- info->info.flags &= 0xffff;
- g_free(xevnew);
- xevnew = NULL;
- camel_mime_parser_drop_step(mp);
- }
-
- camel_mime_parser_drop_step(mp);
- if (info) {
- d(printf("looking for message content to copy across from %d\n", (int)camel_mime_parser_tell(mp)));
- while (camel_mime_parser_step(mp, &buffer, &len) == CAMEL_MIME_PARSER_STATE_PRE_FROM) {
- /*d(printf("copying mbox contents to tmp: '%.*s'\n", len, buffer));*/
- if (write(fdout, buffer, len) != len) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Writing to tmp mailbox failed: %s: %s"),
- ((CamelLocalSummary *)cls)->folder_path,
- g_strerror (errno));
- goto error;
- }
- }
-
- if (write(fdout, "\n", 1) != 1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Error writing to temp mailbox: %s"),
- g_strerror (errno));
- goto error;
- }
-
- d(printf("we are now at %d, from = %d\n", (int)camel_mime_parser_tell(mp),
- (int)camel_mime_parser_tell_start_from(mp)));
- camel_mime_parser_unstep(mp);
- camel_folder_summary_info_free(s, (CamelMessageInfo *)info);
- info = NULL;
- }
- }
-
-#if 0
- /* if last was deleted, append the \n we removed */
- if (lastdel && count > 0)
- write(fdout, "\n", 1);
-#endif
-
- camel_object_unref((CamelObject *)mp);
-
- return 0;
- error:
- g_free(xevnew);
-
- if (mp)
- camel_object_unref((CamelObject *)mp);
- if (info)
- camel_folder_summary_info_free(s, (CamelMessageInfo *)info);
-
- return -1;
-}
-
-#ifdef STATUS_PINE
-static CamelMessageInfo *
-mbox_summary_add(CamelLocalSummary *cls, CamelMimeMessage *msg, const CamelMessageInfo *info, CamelFolderChangeInfo *ci, CamelException *ex)
-{
- CamelMessageInfo *mi;
-
- mi = ((CamelLocalSummaryClass *)camel_mbox_summary_parent)->add(cls, msg, info, ci, ex);
- if (mi && ((CamelMboxSummary *)cls)->xstatus) {
- char status[8];
-
- /* we snoop and add status/x-status headers to suit */
- encode_status(mi->flags & STATUS_STATUS, status);
- camel_medium_set_header((CamelMedium *)msg, "Status", status);
- encode_status(mi->flags & STATUS_XSTATUS, status);
- camel_medium_set_header((CamelMedium *)msg, "X-Status", status);
- }
-
- return mi;
-}
-
-static struct {
- char tag;
- guint32 flag;
-} status_flags[] = {
- { 'F', CAMEL_MESSAGE_FLAGGED },
- { 'A', CAMEL_MESSAGE_ANSWERED },
- { 'D', CAMEL_MESSAGE_DELETED },
- { 'R', CAMEL_MESSAGE_SEEN },
-};
-
-static void
-encode_status(guint32 flags, char status[8])
-{
- char *p;
- int i;
-
- p = status;
- for (i=0;i<sizeof(status_flags)/sizeof(status_flags[0]);i++)
- if (status_flags[i].flag & flags)
- *p++ = status_flags[i].tag;
- *p++ = 'O';
- *p=0;
-}
-
-static guint32
-decode_status(const char *status)
-{
- const char *p;
- char c;
- guint32 flags = 0;
- int i;
-
- p = status;
- while ((c = *p++)) {
- for (i=0;i<sizeof(status_flags)/sizeof(status_flags[0]);i++)
- if (status_flags[i].tag == *p)
- flags |= status_flags[i].flag;
- }
-
- return flags;
-}
-
-#endif /* STATUS_PINE */
diff --git a/camel/providers/local/camel-mbox-summary.h b/camel/providers/local/camel-mbox-summary.h
deleted file mode 100644
index dc64aa23fa..0000000000
--- a/camel/providers/local/camel-mbox-summary.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef _CAMEL_MBOX_SUMMARY_H
-#define _CAMEL_MBOX_SUMMARY_H
-
-#include "camel-local-summary.h"
-
-/* Enable the use of elm/pine style "Status" & "X-Status" headers */
-#define STATUS_PINE
-
-#define CAMEL_MBOX_SUMMARY(obj) CAMEL_CHECK_CAST (obj, camel_mbox_summary_get_type (), CamelMboxSummary)
-#define CAMEL_MBOX_SUMMARY_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_mbox_summary_get_type (), CamelMboxSummaryClass)
-#define CAMEL_IS_MBOX_SUMMARY(obj) CAMEL_CHECK_TYPE (obj, camel_mbox_summary_get_type ())
-
-typedef struct _CamelMboxSummary CamelMboxSummary;
-typedef struct _CamelMboxSummaryClass CamelMboxSummaryClass;
-
-typedef struct _CamelMboxMessageContentInfo {
- CamelMessageContentInfo info;
-} CamelMboxMessageContentInfo;
-
-typedef struct _CamelMboxMessageInfo {
- CamelMessageInfo info;
-
- off_t frompos;
-} CamelMboxMessageInfo;
-
-struct _CamelMboxSummary {
- CamelLocalSummary parent;
-
- CamelFolderChangeInfo *changes; /* used to build change sets */
-
- size_t folder_size; /* size of the mbox file, last sync */
-
- unsigned int xstatus:1; /* do we store/honour xstatus/status headers */
-};
-
-struct _CamelMboxSummaryClass {
- CamelLocalSummaryClass parent_class;
-
- /* sync in-place */
- int (*sync_quick)(CamelMboxSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex);
- /* sync requires copy */
- int (*sync_full)(CamelMboxSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex);
-};
-
-CamelType camel_mbox_summary_get_type (void);
-CamelMboxSummary *camel_mbox_summary_new (const char *filename, const char *mbox_name, CamelIndex *index);
-
-/* do we honour/use xstatus headers, etc */
-void camel_mbox_summary_xstatus(CamelMboxSummary *mbs, int state);
-
-/* build a new mbox from an existing mbox storing summary information */
-int camel_mbox_summary_sync_mbox(CamelMboxSummary *cls, guint32 flags, CamelFolderChangeInfo *changeinfo, int fd, int fdout, CamelException *ex);
-
-#endif /* ! _CAMEL_MBOX_SUMMARY_H */
-
diff --git a/camel/providers/local/camel-mh-folder.c b/camel/providers/local/camel-mh-folder.c
deleted file mode 100644
index 25dbacc49a..0000000000
--- a/camel/providers/local/camel-mh-folder.c
+++ /dev/null
@@ -1,231 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; fill-column: 160 -*-
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * Copyright (C) 1999, 2003 Ximian Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdlib.h>
-#include <sys/types.h>
-#include <dirent.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <errno.h>
-#include <string.h>
-#include <fcntl.h>
-
-#include "camel-mh-folder.h"
-#include "camel-mh-store.h"
-#include "camel-stream-fs.h"
-#include "camel-mh-summary.h"
-#include "camel-data-wrapper.h"
-#include "camel-mime-message.h"
-#include "camel-exception.h"
-
-#define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))*/
-
-static CamelLocalFolderClass *parent_class = NULL;
-
-/* Returns the class for a CamelMhFolder */
-#define CMHF_CLASS(so) CAMEL_MH_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-#define CF_CLASS(so) CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-#define CMHS_CLASS(so) CAMEL_STORE_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-
-static CamelLocalSummary *mh_create_summary(const char *path, const char *folder, CamelIndex *index);
-
-static void mh_append_message(CamelFolder * folder, CamelMimeMessage * message, const CamelMessageInfo *info, char **appended_uid, CamelException * ex);
-static CamelMimeMessage *mh_get_message(CamelFolder * folder, const gchar * uid, CamelException * ex);
-
-static void mh_finalize(CamelObject * object);
-
-static void camel_mh_folder_class_init(CamelObjectClass * camel_mh_folder_class)
-{
- CamelFolderClass *camel_folder_class = CAMEL_FOLDER_CLASS(camel_mh_folder_class);
- CamelLocalFolderClass *lclass = (CamelLocalFolderClass *)camel_mh_folder_class;
-
- parent_class = CAMEL_LOCAL_FOLDER_CLASS (camel_type_get_global_classfuncs(camel_local_folder_get_type()));
-
- /* virtual method definition */
-
- /* virtual method overload */
- camel_folder_class->append_message = mh_append_message;
- camel_folder_class->get_message = mh_get_message;
-
- lclass->create_summary = mh_create_summary;
-}
-
-static void mh_init(gpointer object, gpointer klass)
-{
- /*CamelFolder *folder = object;
- CamelMhFolder *mh_folder = object;*/
-}
-
-static void mh_finalize(CamelObject * object)
-{
- /*CamelMhFolder *mh_folder = CAMEL_MH_FOLDER(object);*/
-}
-
-CamelType camel_mh_folder_get_type(void)
-{
- static CamelType camel_mh_folder_type = CAMEL_INVALID_TYPE;
-
- if (camel_mh_folder_type == CAMEL_INVALID_TYPE) {
- camel_mh_folder_type = camel_type_register(CAMEL_LOCAL_FOLDER_TYPE, "CamelMhFolder",
- sizeof(CamelMhFolder),
- sizeof(CamelMhFolderClass),
- (CamelObjectClassInitFunc) camel_mh_folder_class_init,
- NULL,
- (CamelObjectInitFunc) mh_init,
- (CamelObjectFinalizeFunc) mh_finalize);
- }
-
- return camel_mh_folder_type;
-}
-
-CamelFolder *
-camel_mh_folder_new(CamelStore *parent_store, const char *full_name, guint32 flags, CamelException *ex)
-{
- CamelFolder *folder;
-
- d(printf("Creating mh folder: %s\n", full_name));
-
- folder = (CamelFolder *)camel_object_new(CAMEL_MH_FOLDER_TYPE);
- folder = (CamelFolder *)camel_local_folder_construct((CamelLocalFolder *)folder,
- parent_store, full_name, flags, ex);
-
- return folder;
-}
-
-static CamelLocalSummary *mh_create_summary(const char *path, const char *folder, CamelIndex *index)
-{
- return (CamelLocalSummary *)camel_mh_summary_new(path, folder, index);
-}
-
-static void
-mh_append_message (CamelFolder *folder, CamelMimeMessage *message, const CamelMessageInfo *info, char **appended_uid, CamelException *ex)
-{
- CamelMhFolder *mh_folder = (CamelMhFolder *)folder;
- CamelLocalFolder *lf = (CamelLocalFolder *)folder;
- CamelStream *output_stream;
- CamelMessageInfo *mi;
- char *name;
-
- /* FIXME: probably needs additional locking (although mh doesn't appear do do it) */
-
- d(printf("Appending message\n"));
-
- /* add it to the summary/assign the uid, etc */
- mi = camel_local_summary_add((CamelLocalSummary *)folder->summary, message, info, lf->changes, ex);
- if (camel_exception_is_set (ex))
- return;
-
- d(printf("Appending message: uid is %s\n", camel_message_info_uid(mi)));
-
- /* write it out, use the uid we got from the summary */
- name = g_strdup_printf("%s/%s", lf->folder_path, camel_message_info_uid(mi));
- output_stream = camel_stream_fs_new_with_name(name, O_WRONLY|O_CREAT, 0600);
- if (output_stream == NULL)
- goto fail_write;
-
- if (camel_data_wrapper_write_to_stream ((CamelDataWrapper *)message, output_stream) == -1
- || camel_stream_close (output_stream) == -1)
- goto fail_write;
-
- /* close this? */
- camel_object_unref (CAMEL_OBJECT (output_stream));
-
- g_free(name);
-
- camel_object_trigger_event (CAMEL_OBJECT (folder), "folder_changed",
- ((CamelLocalFolder *)mh_folder)->changes);
- camel_folder_change_info_clear (((CamelLocalFolder *)mh_folder)->changes);
-
- if (appended_uid)
- *appended_uid = g_strdup(camel_message_info_uid(mi));
-
- return;
-
- fail_write:
-
- /* remove the summary info so we are not out-of-sync with the mh folder */
- camel_folder_summary_remove_uid (CAMEL_FOLDER_SUMMARY (folder->summary),
- camel_message_info_uid (mi));
-
- if (errno == EINTR)
- camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
- _("MH append message cancelled"));
- else
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Cannot append message to mh folder: %s: %s"),
- name, g_strerror (errno));
-
- if (output_stream) {
- camel_object_unref (CAMEL_OBJECT (output_stream));
- unlink (name);
- }
-
- g_free (name);
-}
-
-static CamelMimeMessage *mh_get_message(CamelFolder * folder, const gchar * uid, CamelException * ex)
-{
- CamelLocalFolder *lf = (CamelLocalFolder *)folder;
- CamelStream *message_stream = NULL;
- CamelMimeMessage *message = NULL;
- CamelMessageInfo *info;
- char *name;
-
- d(printf("getting message: %s\n", uid));
-
- /* get the message summary info */
- if ((info = camel_folder_summary_uid(folder->summary, uid)) == NULL) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_FOLDER_INVALID_UID, _("Cannot get message: %s\n %s"), uid, _("No such message"));
- return NULL;
- }
-
- /* we only need it to check the message exists */
- camel_folder_summary_info_free(folder->summary, info);
-
- name = g_strdup_printf("%s/%s", lf->folder_path, uid);
- if ((message_stream = camel_stream_fs_new_with_name(name, O_RDONLY, 0)) == NULL) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID_UID,
- _("Cannot get message: %s\n %s"),
- name, g_strerror (errno));
- g_free(name);
- return NULL;
- }
-
- message = camel_mime_message_new();
- if (camel_data_wrapper_construct_from_stream((CamelDataWrapper *)message, message_stream) == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID_UID,
- _("Cannot get message: %s\n %s"),
- name, _("Invalid message contents"));
- g_free(name);
- camel_object_unref((CamelObject *)message_stream);
- camel_object_unref((CamelObject *)message);
- return NULL;
-
- }
- camel_object_unref((CamelObject *)message_stream);
- g_free(name);
-
- return message;
-}
diff --git a/camel/providers/local/camel-mh-folder.h b/camel/providers/local/camel-mh-folder.h
deleted file mode 100644
index 125f8c8ac5..0000000000
--- a/camel/providers/local/camel-mh-folder.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Authors:
- * Michael Zucchi <notzed@ximian.com>
- *
- * Copyright (C) 1999 Ximian Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifndef CAMEL_MH_FOLDER_H
-#define CAMEL_MH_FOLDER_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus } */
-#include "camel-local-folder.h"
-
-#define CAMEL_MH_FOLDER_TYPE (camel_mh_folder_get_type ())
-#define CAMEL_MH_FOLDER(obj) (CAMEL_CHECK_CAST((obj), CAMEL_MH_FOLDER_TYPE, CamelMhFolder))
-#define CAMEL_MH_FOLDER_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_MH_FOLDER_TYPE, CamelMhFolderClass))
-#define CAMEL_IS_MH_FOLDER(o) (CAMEL_CHECK_TYPE((o), CAMEL_MH_FOLDER_TYPE))
-
-typedef struct {
- CamelLocalFolder parent_object;
-
-} CamelMhFolder;
-
-typedef struct {
- CamelLocalFolderClass parent_class;
-
- /* Virtual methods */
-
-} CamelMhFolderClass;
-
-/* public methods */
-CamelFolder *camel_mh_folder_new(CamelStore *parent_store, const char *full_name, guint32 flags, CamelException *ex);
-
-/* Standard Camel function */
-CamelType camel_mh_folder_get_type(void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-#endif /* CAMEL_MH_FOLDER_H */
diff --git a/camel/providers/local/camel-mh-store.c b/camel/providers/local/camel-mh-store.c
deleted file mode 100644
index 73a3d2046f..0000000000
--- a/camel/providers/local/camel-mh-store.c
+++ /dev/null
@@ -1,533 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Copyright (C) 2000 Ximian, Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <sys/stat.h>
-#include <errno.h>
-#include <string.h>
-#include <unistd.h>
-#include <dirent.h>
-
-#include "camel-mh-store.h"
-#include "camel-mh-folder.h"
-#include "camel-exception.h"
-#include "camel-url.h"
-#include "camel-private.h"
-
-#include <camel/camel-stream-fs.h>
-#include <camel/camel-stream-buffer.h>
-
-static CamelLocalStoreClass *parent_class = NULL;
-
-#define d(x)
-
-/* Returns the class for a CamelMhStore */
-#define CMHS_CLASS(so) CAMEL_MH_STORE_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-#define CF_CLASS(so) CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-#define CMHF_CLASS(so) CAMEL_MH_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-
-static void construct (CamelService *service, CamelSession *session, CamelProvider *provider, CamelURL *url, CamelException *ex);
-static CamelFolder *get_folder(CamelStore * store, const char *folder_name, guint32 flags, CamelException * ex);
-static CamelFolder *get_inbox (CamelStore *store, CamelException *ex);
-static void delete_folder(CamelStore * store, const char *folder_name, CamelException * ex);
-static void rename_folder(CamelStore *store, const char *old, const char *new, CamelException *ex);
-static CamelFolderInfo * get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelException *ex);
-
-static void camel_mh_store_class_init(CamelObjectClass * camel_mh_store_class)
-{
- CamelStoreClass *camel_store_class = CAMEL_STORE_CLASS(camel_mh_store_class);
- CamelServiceClass *camel_service_class = CAMEL_SERVICE_CLASS(camel_mh_store_class);
-
- parent_class = (CamelLocalStoreClass *)camel_type_get_global_classfuncs(camel_local_store_get_type());
-
- /* virtual method overload, use defaults for most */
- camel_service_class->construct = construct;
-
- camel_store_class->get_folder = get_folder;
- camel_store_class->get_inbox = get_inbox;
- camel_store_class->delete_folder = delete_folder;
- camel_store_class->rename_folder = rename_folder;
- camel_store_class->get_folder_info = get_folder_info;
-}
-
-CamelType camel_mh_store_get_type(void)
-{
- static CamelType camel_mh_store_type = CAMEL_INVALID_TYPE;
-
- if (camel_mh_store_type == CAMEL_INVALID_TYPE) {
- camel_mh_store_type = camel_type_register(CAMEL_LOCAL_STORE_TYPE, "CamelMhStore",
- sizeof(CamelMhStore),
- sizeof(CamelMhStoreClass),
- (CamelObjectClassInitFunc) camel_mh_store_class_init,
- NULL,
- NULL,
- NULL);
- }
-
- return camel_mh_store_type;
-}
-
-static void
-construct (CamelService *service, CamelSession *session, CamelProvider *provider, CamelURL *url, CamelException *ex)
-{
- CamelMhStore *mh_store = (CamelMhStore *)service;
-
- CAMEL_SERVICE_CLASS (parent_class)->construct (service, session, provider, url, ex);
- if (camel_exception_is_set (ex))
- return;
-
- if (camel_url_get_param(url, "dotfolders"))
- mh_store->flags |= CAMEL_MH_DOTFOLDERS;
-}
-
-enum {
- UPDATE_NONE,
- UPDATE_ADD,
- UPDATE_REMOVE,
-};
-
-/* update the .folders file if it exists, or create it if it doesn't */
-static void
-folders_update(const char *root, const char *folder, int mode)
-{
- char *tmp, *tmpnew, *line = NULL;
- CamelStream *stream, *in = NULL, *out = NULL;
-
- tmpnew = g_alloca (strlen (root) + 16);
- sprintf (tmpnew, "%s.folders~", root);
-
- out = camel_stream_fs_new_with_name(tmpnew, O_WRONLY|O_CREAT|O_TRUNC, 0666);
- if (out == NULL)
- goto fail;
-
- tmp = g_alloca (strlen (root) + 16);
- sprintf (tmp, "%s.folders", root);
- stream = camel_stream_fs_new_with_name(tmp, O_RDONLY, 0);
- if (stream) {
- in = camel_stream_buffer_new(stream, CAMEL_STREAM_BUFFER_READ);
- camel_object_unref(stream);
- }
- if (in == NULL || stream == NULL) {
- if (mode == UPDATE_ADD && camel_stream_printf(out, "%s\n", folder) == -1)
- goto fail;
- goto done;
- }
-
- while ((line = camel_stream_buffer_read_line((CamelStreamBuffer *)in))) {
- int copy = TRUE;
-
- switch (mode) {
- case UPDATE_REMOVE:
- if (strcmp(line, folder) == 0)
- copy = FALSE;
- break;
- case UPDATE_ADD: {
- int cmp = strcmp(line, folder);
-
- if (cmp > 0) {
- /* found insertion point */
- if (camel_stream_printf(out, "%s\n", folder) == -1)
- goto fail;
- mode = UPDATE_NONE;
- } else if (tmp == 0) {
- /* already there */
- mode = UPDATE_NONE;
- }
- break; }
- case UPDATE_NONE:
- break;
- }
-
- if (copy && camel_stream_printf(out, "%s\n", line) == -1)
- goto fail;
-
- g_free(line);
- line = NULL;
- }
-
- /* add to end? */
- if (mode == UPDATE_ADD && camel_stream_printf(out, "%s\n", folder) == -1)
- goto fail;
-
- if (camel_stream_close(out) == -1)
- goto fail;
-
-done:
- /* should we care if this fails? I suppose so ... */
- rename(tmpnew, tmp);
-fail:
- unlink(tmpnew); /* remove it if its there */
- g_free(line);
- if (in)
- camel_object_unref(in);
- if (out)
- camel_object_unref(out);
-}
-
-static CamelFolder *
-get_folder(CamelStore * store, const char *folder_name, guint32 flags, CamelException * ex)
-{
- char *name;
- struct stat st;
-
- if (!((CamelStoreClass *)parent_class)->get_folder(store, folder_name, flags, ex))
- return NULL;
-
- name = g_strdup_printf("%s%s", CAMEL_LOCAL_STORE(store)->toplevel_dir, folder_name);
-
- if (stat(name, &st) == -1) {
- if (errno != ENOENT) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not open folder `%s':\n%s"),
- folder_name, g_strerror (errno));
- g_free (name);
- return NULL;
- }
- if ((flags & CAMEL_STORE_FOLDER_CREATE) == 0) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
- _("Folder `%s' does not exist."), folder_name);
- g_free (name);
- return NULL;
- }
-
- if (mkdir(name, 0700) != 0) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not create folder `%s':\n%s"),
- folder_name, g_strerror (errno));
- g_free (name);
- return NULL;
- }
-
- /* add to .folders if we are supposed to */
- /* FIXME: throw exception on error */
- if (((CamelMhStore *)store)->flags & CAMEL_MH_DOTFOLDERS)
- folders_update(((CamelLocalStore *)store)->toplevel_dir, folder_name, UPDATE_ADD);
-
- } else if (!S_ISDIR(st.st_mode)) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
- _("`%s' is not a directory."), name);
- g_free (name);
- return NULL;
- }
- g_free(name);
-
- return camel_mh_folder_new(store, folder_name, flags, ex);
-}
-
-static CamelFolder *
-get_inbox (CamelStore *store, CamelException *ex)
-{
- return get_folder (store, "inbox", 0, ex);
-}
-
-static void delete_folder(CamelStore * store, const char *folder_name, CamelException * ex)
-{
- char *name;
-
- /* remove folder directory - will fail if not empty */
- name = g_strdup_printf("%s%s", CAMEL_LOCAL_STORE(store)->toplevel_dir, folder_name);
- if (rmdir(name) == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not delete folder `%s': %s"),
- folder_name, g_strerror (errno));
- g_free(name);
- return;
- }
- g_free(name);
-
- /* remove from .folders if we are supposed to */
- if (((CamelMhStore *)store)->flags & CAMEL_MH_DOTFOLDERS)
- folders_update(((CamelLocalStore *)store)->toplevel_dir, folder_name, UPDATE_REMOVE);
-
- /* and remove metadata */
- ((CamelStoreClass *)parent_class)->delete_folder(store, folder_name, ex);
-}
-
-static void
-rename_folder(CamelStore *store, const char *old, const char *new, CamelException *ex)
-{
- CamelException e;
-
- camel_exception_init(&e);
- ((CamelStoreClass *)parent_class)->rename_folder(store, old, new, &e);
- if (camel_exception_is_set(&e)) {
- camel_exception_xfer(ex, &e);
- return;
- }
- camel_exception_clear(&e);
-
- if (((CamelMhStore *)store)->flags & CAMEL_MH_DOTFOLDERS) {
- /* yeah this is messy, but so is mh! */
- folders_update(((CamelLocalStore *)store)->toplevel_dir, new, UPDATE_ADD);
- folders_update(((CamelLocalStore *)store)->toplevel_dir, old, UPDATE_REMOVE);
- }
-}
-
-static CamelFolderInfo *folder_info_new(CamelStore *store, const char *root, const char *path)
-{
- CamelFolderInfo *fi;
- char *base;
- CamelFolder *folder;
-
- base = strrchr(path, '/');
-
- /* Build the folder info structure. */
- fi = g_malloc0(sizeof(*fi));
- fi->url = g_strdup_printf("mh:%s#%s", root, path);
- fi->full_name = g_strdup(path);
- fi->name = g_strdup(base?base+1:path);
- fi->unread_message_count = 0;
-
- /* check unread count if open */
- folder = camel_object_bag_get(store->folders, path);
- if (folder) {
- if ((((CamelMhStore *)store)->flags & CAMEL_STORE_FOLDER_INFO_FAST) == 0)
- camel_folder_refresh_info(folder, NULL);
- fi->unread_message_count = camel_folder_get_unread_message_count(folder);
- camel_object_unref(folder);
- }
-
- /* We could: if we have no folder, and FAST isn't specified, perform a full
- scan of all messages for their status flags. But its probably not worth
- it as we need to read the top of every file, i.e. very very slow */
-
- camel_folder_info_build_path(fi, '/');
-
- d(printf("New folderinfo:\n '%s'\n '%s'\n '%s'\n", fi->full_name, fi->url, fi->path));
-
- return fi;
-}
-
-/* used to find out where we've visited already */
-struct _inode {
- dev_t dnode;
- ino_t inode;
-};
-
-/* Scan path, under root, for directories to add folders for. Both
- * root and path should have a trailing "/" if they aren't empty. */
-static void recursive_scan(CamelStore *store, CamelFolderInfo **fip, CamelFolderInfo *parent, GHashTable *visited, const char *root, const char *path)
-{
- char *fullpath, *tmp;
- DIR *dp;
- struct dirent *d;
- struct stat st;
- CamelFolderInfo *fi;
- struct _inode in, *inew;
-
- /* Open the specified directory. */
- if (path[0]) {
- fullpath = alloca (strlen (root) + strlen (path) + 2);
- sprintf (fullpath, "%s/%s", root, path);
- } else
- fullpath = (char *)root;
-
- if (stat(fullpath, &st) == -1 || !S_ISDIR(st.st_mode))
- return;
-
- in.dnode = st.st_dev;
- in.inode = st.st_ino;
-
- /* see if we've visited already */
- if (g_hash_table_lookup(visited, &in) != NULL)
- return;
-
- inew = g_malloc(sizeof(*inew));
- *inew = in;
- g_hash_table_insert(visited, inew, inew);
-
- /* link in ... */
- fi = folder_info_new(store, root, path);
- fi->parent = parent;
- fi->sibling = *fip;
- *fip = fi;
-
- if ((( ((CamelMhStore *)store)->flags & CAMEL_STORE_FOLDER_INFO_RECURSIVE) || parent == NULL)) {
- /* now check content for possible other directories */
- dp = opendir(fullpath);
- if (dp == NULL)
- return;
-
- /* Look for subdirectories to add and scan. */
- while ((d = readdir(dp)) != NULL) {
- /* Skip current and parent directory. */
- if (strcmp(d->d_name, ".") == 0
- || strcmp(d->d_name, "..") == 0)
- continue;
-
- /* skip fully-numerical entries (i.e. mh messages) */
- strtoul(d->d_name, &tmp, 10);
- if (*tmp == 0)
- continue;
-
- /* otherwise, treat at potential node, and recurse, a bit more expensive than needed, but tough! */
- if (path[0]) {
- tmp = g_strdup_printf("%s/%s", path, d->d_name);
- recursive_scan(store, &fi->child, fi, visited, root, tmp);
- g_free(tmp);
- } else {
- recursive_scan(store, &fi->child, fi, visited, root, d->d_name);
- }
- }
-
- closedir(dp);
- }
-}
-
-/* scan a .folders file */
-static void
-folders_scan(CamelStore *store, const char *root, const char *top, CamelFolderInfo **fip)
-{
- CamelFolderInfo *fi;
- char line[512], *path, *tmp;
- CamelStream *stream, *in;
- struct stat st;
- GPtrArray *folders;
- GHashTable *visited;
- int len;
-
- tmp = g_alloca (strlen (root) + 16);
- sprintf (tmp, "%s/.folders", root);
- stream = camel_stream_fs_new_with_name(tmp, 0, O_RDONLY);
- if (stream == NULL)
- return;
-
- in = camel_stream_buffer_new(stream, CAMEL_STREAM_BUFFER_READ);
- camel_object_unref(stream);
- if (in == NULL)
- return;
-
- visited = g_hash_table_new(g_str_hash, g_str_equal);
- folders = g_ptr_array_new();
-
- while ( (len = camel_stream_buffer_gets((CamelStreamBuffer *)in, line, sizeof(line))) > 0) {
- /* ignore blank lines */
- if (len <= 1)
- continue;
- /* check for invalidly long lines, we abort evreything and fallback */
- if (line[len-1] != '\n') {
- int i;
-
- for (i=0;i<folders->len;i++)
- camel_folder_info_free(folders->pdata[i]);
- g_ptr_array_set_size(folders, 0);
- break;
- }
- line[len-1] = 0;
-
- /* check for \r ? */
-
- if (top && top[0]) {
- int toplen = strlen(top);
-
- /* check is subdir */
- if (strncmp(top, line, len) != 0)
- continue;
-
- /* check is not sub-subdir if not recursive */
- if (( ((CamelMhStore *)store)->flags & CAMEL_STORE_FOLDER_INFO_RECURSIVE) == 0
- && (tmp = strrchr(line, '/'))
- && tmp > line+toplen)
- continue;
- }
-
- if (g_hash_table_lookup(visited, line) != NULL)
- continue;
-
- tmp = g_strdup(line);
- g_hash_table_insert(visited, tmp, tmp);
-
- path = g_strdup_printf("%s/%s", root, line);
- if (stat(path, &st) == 0 && S_ISDIR(st.st_mode)) {
- fi = folder_info_new(store, root, line);
- g_ptr_array_add(folders, fi);
- }
- g_free(path);
- }
-
- if (folders->len)
- *fip = camel_folder_info_build(folders, NULL, '/', TRUE);
- g_ptr_array_free(folders, TRUE);
-
- g_hash_table_foreach(visited, (GHFunc)g_free, NULL);
- g_hash_table_destroy(visited);
-
- camel_object_unref(in);
-}
-
-/* FIXME: move to camel-local, this is shared with maildir code */
-static guint inode_hash(const void *d)
-{
- const struct _inode *v = d;
-
- return v->inode ^ v->dnode;
-}
-
-static gboolean inode_equal(const void *a, const void *b)
-{
- const struct _inode *v1 = a, *v2 = b;
-
- return v1->inode == v2->inode && v1->dnode == v2->dnode;
-}
-
-static void inode_free(void *k, void *v, void *d)
-{
- g_free(k);
-}
-
-static CamelFolderInfo *
-get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelException *ex)
-{
- CamelFolderInfo *fi = NULL;
- char *root;
-
- root = ((CamelService *)store)->url->path;
-
- /* use .folders if we are supposed to */
- if (((CamelMhStore *)store)->flags & CAMEL_MH_DOTFOLDERS) {
- folders_scan(store, root, top, &fi);
- } else {
- GHashTable *visited = g_hash_table_new(inode_hash, inode_equal);
-
- if (top == NULL)
- top = "";
-
- recursive_scan(store, &fi, NULL, visited, root, top);
-
- /* if we actually scanned from root, we have a "" root node we dont want */
- if (fi != NULL && top[0] == 0) {
- CamelFolderInfo *rfi;
-
- rfi = fi;
- fi = rfi->child;
- rfi->child = NULL;
- camel_folder_info_free(rfi);
- }
-
- g_hash_table_foreach(visited, inode_free, NULL);
- g_hash_table_destroy(visited);
- }
-
- return fi;
-}
diff --git a/camel/providers/local/camel-mh-store.h b/camel/providers/local/camel-mh-store.h
deleted file mode 100644
index 96522cb01f..0000000000
--- a/camel/providers/local/camel-mh-store.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Copyright (C) 2000 Ximian, Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifndef CAMEL_MH_STORE_H
-#define CAMEL_MH_STORE_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus } */
-
-#include "camel-local-store.h"
-
-#define CAMEL_MH_STORE_TYPE (camel_mh_store_get_type ())
-#define CAMEL_MH_STORE(obj) (CAMEL_CHECK_CAST((obj), CAMEL_MH_STORE_TYPE, CamelMhStore))
-#define CAMEL_MH_STORE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_MH_STORE_TYPE, CamelMhStoreClass))
-#define CAMEL_IS_MH_STORE(o) (CAMEL_CHECK_TYPE((o), CAMEL_MH_STORE_TYPE))
-
-enum {
- CAMEL_MH_DOTFOLDERS = (1<<0), /* update/use .folders file */
-};
-
-typedef struct {
- CamelLocalStore parent_object;
-
- guint32 flags;
-} CamelMhStore;
-
-typedef struct {
- CamelLocalStoreClass parent_class;
-
-} CamelMhStoreClass;
-
-/* public methods */
-
-/* Standard Camel function */
-CamelType camel_mh_store_get_type(void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-#endif /* CAMEL_MH_STORE_H */
diff --git a/camel/providers/local/camel-mh-summary.c b/camel/providers/local/camel-mh-summary.c
deleted file mode 100644
index 5dd26ac9ba..0000000000
--- a/camel/providers/local/camel-mh-summary.c
+++ /dev/null
@@ -1,420 +0,0 @@
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Not Zed <notzed@lostzed.mmc.com.au>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-#include <sys/uio.h>
-#include <unistd.h>
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include <dirent.h>
-
-#include <ctype.h>
-
-#include "camel-mh-summary.h"
-#include <camel/camel-mime-message.h>
-
-#include "camel-private.h"
-
-#define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))*/
-
-#define CAMEL_MH_SUMMARY_VERSION (0x2000)
-
-static int mh_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changeinfo, CamelException *ex);
-static int mh_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex);
-/*static int mh_summary_add(CamelLocalSummary *cls, CamelMimeMessage *msg, CamelMessageInfo *info, CamelFolderChangeInfo *, CamelException *ex);*/
-
-static char *mh_summary_next_uid_string(CamelFolderSummary *s);
-
-static void camel_mh_summary_class_init (CamelMhSummaryClass *class);
-static void camel_mh_summary_init (CamelMhSummary *gspaper);
-static void camel_mh_summary_finalise (CamelObject *obj);
-
-#define _PRIVATE(x) (((CamelMhSummary *)(x))->priv)
-
-struct _CamelMhSummaryPrivate {
- char *current_uid;
-};
-
-static CamelLocalSummaryClass *parent_class;
-
-CamelType
-camel_mh_summary_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register(camel_local_summary_get_type (), "CamelMhSummary",
- sizeof(CamelMhSummary),
- sizeof(CamelMhSummaryClass),
- (CamelObjectClassInitFunc)camel_mh_summary_class_init,
- NULL,
- (CamelObjectInitFunc)camel_mh_summary_init,
- (CamelObjectFinalizeFunc)camel_mh_summary_finalise);
- }
-
- return type;
-}
-
-static void
-camel_mh_summary_class_init (CamelMhSummaryClass *class)
-{
- CamelFolderSummaryClass *sklass = (CamelFolderSummaryClass *) class;
- CamelLocalSummaryClass *lklass = (CamelLocalSummaryClass *)class;
-
- parent_class = (CamelLocalSummaryClass *)camel_type_get_global_classfuncs(camel_local_summary_get_type ());
-
- /* override methods */
- sklass->next_uid_string = mh_summary_next_uid_string;
-
- lklass->check = mh_summary_check;
- lklass->sync = mh_summary_sync;
- /*lklass->add = mh_summary_add;*/
-}
-
-static void
-camel_mh_summary_init (CamelMhSummary *o)
-{
- struct _CamelFolderSummary *s = (CamelFolderSummary *) o;
-
- o->priv = g_malloc0(sizeof(*o->priv));
- /* set unique file version */
- s->version += CAMEL_MH_SUMMARY_VERSION;
-}
-
-static void
-camel_mh_summary_finalise(CamelObject *obj)
-{
- CamelMhSummary *o = (CamelMhSummary *)obj;
-
- g_free(o->priv);
-}
-
-/**
- * camel_mh_summary_new:
- *
- * Create a new CamelMhSummary object.
- *
- * Return value: A new #CamelMhSummary object.
- **/
-CamelMhSummary *camel_mh_summary_new (const char *filename, const char *mhdir, CamelIndex *index)
-{
- CamelMhSummary *o = (CamelMhSummary *)camel_object_new(camel_mh_summary_get_type ());
-
- camel_local_summary_construct((CamelLocalSummary *)o, filename, mhdir, index);
- return o;
-}
-
-static char *mh_summary_next_uid_string(CamelFolderSummary *s)
-{
- CamelMhSummary *mhs = (CamelMhSummary *)s;
- CamelLocalSummary *cls = (CamelLocalSummary *)s;
- int fd = -1;
- guint32 uid;
- char *name;
- char *uidstr;
-
- /* if we are working to add an existing file, then use current_uid */
- if (mhs->priv->current_uid) {
- uidstr = g_strdup(mhs->priv->current_uid);
- /* tell the summary of this, so we always append numbers to the end */
- camel_folder_summary_set_uid(s, strtoul(uidstr, NULL, 10)+1);
- } else {
- /* else scan for one - and create it too, to make sure */
- do {
- close(fd);
- uid = camel_folder_summary_next_uid(s);
- name = g_strdup_printf("%s/%u", cls->folder_path, uid);
- /* O_EXCL isn't guaranteed, sigh. Oh well, bad luck, mh has problems anyway */
- fd = open(name, O_WRONLY|O_CREAT|O_EXCL, 0600);
- g_free(name);
- } while (fd == -1 && errno == EEXIST);
-
- close(fd);
-
- uidstr = g_strdup_printf("%u", uid);
- }
-
- return uidstr;
-}
-
-static int camel_mh_summary_add(CamelLocalSummary *cls, const char *name, int forceindex)
-{
- CamelMhSummary *mhs = (CamelMhSummary *)cls;
- char *filename = g_strdup_printf("%s/%s", cls->folder_path, name);
- int fd;
- CamelMimeParser *mp;
-
- d(printf("summarising: %s\n", name));
-
- fd = open(filename, O_RDONLY);
- if (fd == -1) {
- g_warning ("Cannot summarise/index: %s: %s", filename, strerror (errno));
- g_free(filename);
- return -1;
- }
- mp = camel_mime_parser_new();
- camel_mime_parser_scan_from(mp, FALSE);
- camel_mime_parser_init_with_fd(mp, fd);
- if (cls->index && (forceindex || !camel_index_has_name(cls->index, name))) {
- d(printf("forcing indexing of message content\n"));
- camel_folder_summary_set_index((CamelFolderSummary *)mhs, cls->index);
- } else {
- camel_folder_summary_set_index((CamelFolderSummary *)mhs, NULL);
- }
- mhs->priv->current_uid = (char *)name;
- camel_folder_summary_add_from_parser((CamelFolderSummary *)mhs, mp);
- camel_object_unref((CamelObject *)mp);
- mhs->priv->current_uid = NULL;
- camel_folder_summary_set_index((CamelFolderSummary *)mhs, NULL);
- g_free(filename);
- return 0;
-}
-
-static void
-remove_summary(char *key, CamelMessageInfo *info, CamelLocalSummary *cls)
-{
- d(printf("removing message %s from summary\n", key));
- if (cls->index)
- camel_index_delete_name(cls->index, camel_message_info_uid(info));
- camel_folder_summary_remove((CamelFolderSummary *)cls, info);
- camel_folder_summary_info_free((CamelFolderSummary *)cls, info);
-}
-
-static int
-sort_uid_cmp(const void *ap, const void *bp)
-{
- const CamelMessageInfo
- *a = *((CamelMessageInfo **)ap),
- *b = *((CamelMessageInfo **)bp);
- const char
- *auid = camel_message_info_uid(a),
- *buid = camel_message_info_uid(b);
- int aval = atoi(auid), bval = atoi(buid);
-
- return (aval < bval) ? -1 : (aval > bval) ? 1 : 0;
-}
-
-static int
-mh_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changeinfo, CamelException *ex)
-{
- DIR *dir;
- struct dirent *d;
- char *p, c;
- CamelMessageInfo *info;
- CamelFolderSummary *s = (CamelFolderSummary *)cls;
- GHashTable *left;
- int i, count;
- int forceindex;
-
- /* FIXME: Handle changeinfo */
-
- d(printf("checking summary ...\n"));
-
- /* scan the directory, check for mail files not in the index, or index entries that
- no longer exist */
- dir = opendir(cls->folder_path);
- if (dir == NULL) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Cannot open MH directory path: %s: %s"),
- cls->folder_path, g_strerror (errno));
- return -1;
- }
-
- /* keeps track of all uid's that have not been processed */
- left = g_hash_table_new(g_str_hash, g_str_equal);
- count = camel_folder_summary_count((CamelFolderSummary *)cls);
- forceindex = count == 0;
- for (i=0;i<count;i++) {
- info = camel_folder_summary_index((CamelFolderSummary *)cls, i);
- if (info) {
- g_hash_table_insert(left, (char *)camel_message_info_uid(info), info);
- }
- }
-
- while ( (d = readdir(dir)) ) {
- /* FIXME: also run stat to check for regular file */
- p = d->d_name;
- while ( (c = *p++) ) {
- if (!isdigit(c))
- break;
- }
- if (c==0) {
- info = camel_folder_summary_uid((CamelFolderSummary *)cls, d->d_name);
- if (info == NULL || (cls->index && (!camel_index_has_name(cls->index, d->d_name)))) {
- /* need to add this file to the summary */
- if (info != NULL) {
- g_hash_table_remove(left, camel_message_info_uid(info));
- camel_folder_summary_remove((CamelFolderSummary *)cls, info);
- camel_folder_summary_info_free((CamelFolderSummary *)cls, info);
- }
- camel_mh_summary_add(cls, d->d_name, forceindex);
- } else {
- const char *uid = camel_message_info_uid(info);
- CamelMessageInfo *old = g_hash_table_lookup(left, uid);
-
- if (old) {
- camel_folder_summary_info_free((CamelFolderSummary *)cls, old);
- g_hash_table_remove(left, uid);
- }
- camel_folder_summary_info_free((CamelFolderSummary *)cls, info);
- }
- }
- }
- closedir(dir);
- g_hash_table_foreach(left, (GHFunc)remove_summary, cls);
- g_hash_table_destroy(left);
-
- /* sort the summary based on message number (uid), since the directory order is not useful */
- CAMEL_SUMMARY_LOCK(s, summary_lock);
- qsort(s->messages->pdata, s->messages->len, sizeof(CamelMessageInfo *), sort_uid_cmp);
- CAMEL_SUMMARY_UNLOCK(s, summary_lock);
-
- return 0;
-}
-
-static int
-mh_summary_sync_message(CamelLocalSummary *cls, CamelMessageInfo *info, CamelException *ex)
-{
- CamelMimeParser *mp;
- const char *xev, *buffer;
- int xevoffset;
- int fd, outfd, len, outlen, ret=0;
- char *name, *tmpname, *xevnew;
-
- name = g_strdup_printf("%s/%s", cls->folder_path, camel_message_info_uid(info));
- fd = open(name, O_RDWR);
- if (fd == -1)
- return -1;
-
- mp = camel_mime_parser_new();
- camel_mime_parser_init_with_fd(mp, fd);
- if (camel_mime_parser_step(mp, 0, 0) != CAMEL_MIME_PARSER_STATE_EOF) {
- xev = camel_mime_parser_header(mp, "X-Evolution", &xevoffset);
- d(printf("xev = '%s'\n", xev));
- xevnew = camel_local_summary_encode_x_evolution(cls, info);
- if (xev == NULL
- || camel_local_summary_decode_x_evolution(cls, xev, NULL) == -1
- || strlen(xev)-1 != strlen(xevnew)) {
-
- d(printf("camel local summary_decode_xev = %d\n", camel_local_summary_decode_x_evolution(cls, xev, NULL)));
-
- /* need to write a new copy/unlink old */
- tmpname = g_strdup_printf("%s/.tmp.%d.%s", cls->folder_path, getpid(), camel_message_info_uid(info));
- d(printf("old xev was %d %s new xev is %d %s\n", strlen(xev), xev, strlen(xevnew), xevnew));
- d(printf("creating new message %s\n", tmpname));
- outfd = open(tmpname, O_CREAT|O_WRONLY|O_TRUNC, 0600);
- if (outfd != -1) {
- outlen = 0;
- len = camel_local_summary_write_headers(outfd, camel_mime_parser_headers_raw(mp), xevnew, NULL, NULL);
- if (len != -1) {
- while (outlen != -1 && (len = camel_mime_parser_read(mp, &buffer, 10240)) > 0) {
- d(printf("camel mime parser read, read %d bytes: %.*s\n", len, len, buffer));
- do {
- outlen = write(outfd, buffer, len);
- } while (outlen == -1 && errno == EINTR);
- }
- }
-
- d(printf("len = %d outlen = %d, renaming/finishing\n", len, outlen));
- if (close(outfd) == -1
- || len == -1
- || outlen == -1
- || rename(tmpname, name) == -1) {
- unlink(tmpname);
- ret = -1;
- }
- } else {
- g_warning("sync can't create tmp file: %s", strerror (errno));
- }
- g_free(tmpname);
- } else {
- d(printf("stamping in updated X-EV at %d\n", (int)xevoffset));
- /* else, we can just update the flags field */
- lseek(fd, xevoffset+strlen("X-Evolution: "), SEEK_SET);
- do {
- len = write(fd, xevnew, strlen(xevnew));
- } while (len == -1 && errno == EINTR);
- if (len == -1)
- ret = -1;
- }
-
- g_free(xevnew);
- }
-
- camel_object_unref((CamelObject *)mp);
- g_free(name);
- return ret;
-}
-
-/* sync the summary file with the ondisk files */
-static int
-mh_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInfo *changes, CamelException *ex)
-{
- int count, i;
- CamelMessageInfo *info;
- char *name;
- const char *uid;
-
- d(printf("summary_sync(expunge=%s)\n", expunge?"true":"false"));
-
- /* we could probably get away without this ... but why not use it, esp if we're going to
- be doing any significant io already */
- if (camel_local_summary_check(cls, changes, ex) == -1)
- return -1;
-
- count = camel_folder_summary_count((CamelFolderSummary *)cls);
- for (i=count-1;i>=0;i--) {
- info = camel_folder_summary_index((CamelFolderSummary *)cls, i);
- g_assert(info);
- if (expunge && (info->flags & CAMEL_MESSAGE_DELETED)) {
- uid = camel_message_info_uid(info);
- name = g_strdup_printf("%s/%s", cls->folder_path, uid);
- d(printf("deleting %s\n", name));
- if (unlink(name) == 0 || errno==ENOENT) {
-
- /* FIXME: put this in folder_summary::remove()? */
- if (cls->index)
- camel_index_delete_name(cls->index, (char *)uid);
-
- camel_folder_change_info_remove_uid(changes, uid);
- camel_folder_summary_remove((CamelFolderSummary *)cls, info);
- }
- g_free(name);
- } else if (info->flags & (CAMEL_MESSAGE_FOLDER_NOXEV|CAMEL_MESSAGE_FOLDER_FLAGGED)) {
- if (mh_summary_sync_message(cls, info, ex) != -1) {
- info->flags &= 0xffff;
- } else {
- g_warning("Problem occured when trying to expunge, ignored");
- }
- }
- camel_folder_summary_info_free((CamelFolderSummary *)cls, info);
- }
-
- return ((CamelLocalSummaryClass *)parent_class)->sync(cls, expunge, changes, ex);
-}
diff --git a/camel/providers/local/camel-mh-summary.h b/camel/providers/local/camel-mh-summary.h
deleted file mode 100644
index 4ee30df63b..0000000000
--- a/camel/providers/local/camel-mh-summary.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Not Zed <notzed@lostzed.mmc.com.au>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef _CAMEL_MH_SUMMARY_H
-#define _CAMEL_MH_SUMMARY_H
-
-#include "camel-local-summary.h"
-#include <camel/camel-folder.h>
-#include <camel/camel-exception.h>
-#include <camel/camel-index.h>
-
-#define CAMEL_MH_SUMMARY(obj) CAMEL_CHECK_CAST (obj, camel_mh_summary_get_type (), CamelMhSummary)
-#define CAMEL_MH_SUMMARY_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_mh_summary_get_type (), CamelMhSummaryClass)
-#define CAMEL_IS_MH_SUMMARY(obj) CAMEL_CHECK_TYPE (obj, camel_mh_summary_get_type ())
-
-typedef struct _CamelMhSummary CamelMhSummary;
-typedef struct _CamelMhSummaryClass CamelMhSummaryClass;
-
-struct _CamelMhSummary {
- CamelLocalSummary parent;
- struct _CamelMhSummaryPrivate *priv;
-};
-
-struct _CamelMhSummaryClass {
- CamelLocalSummaryClass parent_class;
-
- /* virtual methods */
-
- /* signals */
-};
-
-CamelType camel_mh_summary_get_type (void);
-CamelMhSummary *camel_mh_summary_new (const char *filename, const char *mhdir, CamelIndex *index);
-
-#endif /* ! _CAMEL_MH_SUMMARY_H */
-
diff --git a/camel/providers/local/camel-spool-folder.c b/camel/providers/local/camel-spool-folder.c
deleted file mode 100644
index 4c4a49fbf9..0000000000
--- a/camel/providers/local/camel-spool-folder.c
+++ /dev/null
@@ -1,186 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; fill-column: 160 -*-
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * Copyright (C) 2001-2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdlib.h>
-#include <sys/types.h>
-#include <dirent.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <errno.h>
-#include <string.h>
-#include <fcntl.h>
-
-#include "camel-spool-folder.h"
-#include "camel-spool-store.h"
-#include "camel-stream-fs.h"
-#include "camel-spool-summary.h"
-#include "camel-data-wrapper.h"
-#include "camel-mime-message.h"
-#include "camel-stream-filter.h"
-#include "camel-mime-filter-from.h"
-#include "camel-exception.h"
-
-#include "camel-lock-client.h"
-
-#include "camel-local-private.h"
-
-#define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))*/
-
-static CamelFolderClass *parent_class = NULL;
-
-/* Returns the class for a CamelSpoolFolder */
-#define CSPOOLF_CLASS(so) CAMEL_SPOOL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-#define CF_CLASS(so) CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-#define CSPOOLS_CLASS(so) CAMEL_STORE_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-
-static CamelLocalSummary *spool_create_summary(const char *path, const char *folder, CamelIndex *index);
-
-static int spool_lock(CamelLocalFolder *lf, CamelLockType type, CamelException *ex);
-static void spool_unlock(CamelLocalFolder *lf);
-
-static void spool_finalize(CamelObject * object);
-
-static void
-camel_spool_folder_class_init(CamelSpoolFolderClass *klass)
-{
- CamelLocalFolderClass *lklass = (CamelLocalFolderClass *)klass;
-
- parent_class = (CamelFolderClass *)camel_mbox_folder_get_type();
-
- /* virtual method overload */
- lklass->create_summary = spool_create_summary;
- lklass->lock = spool_lock;
- lklass->unlock = spool_unlock;
-}
-
-static void
-spool_init(gpointer object, gpointer klass)
-{
- CamelSpoolFolder *spool_folder = object;
-
- spool_folder->lockid = -1;
-}
-
-static void
-spool_finalize(CamelObject * object)
-{
- /*CamelSpoolFolder *spool_folder = CAMEL_SPOOL_FOLDER(object);*/
-}
-
-CamelType camel_spool_folder_get_type(void)
-{
- static CamelType camel_spool_folder_type = CAMEL_INVALID_TYPE;
-
- if (camel_spool_folder_type == CAMEL_INVALID_TYPE) {
- camel_spool_folder_type = camel_type_register(camel_mbox_folder_get_type(), "CamelSpoolFolder",
- sizeof(CamelSpoolFolder),
- sizeof(CamelSpoolFolderClass),
- (CamelObjectClassInitFunc) camel_spool_folder_class_init,
- NULL,
- (CamelObjectInitFunc) spool_init,
- (CamelObjectFinalizeFunc) spool_finalize);
- }
-
- return camel_spool_folder_type;
-}
-
-CamelFolder *
-camel_spool_folder_new(CamelStore *parent_store, const char *full_name, guint32 flags, CamelException *ex)
-{
- CamelFolder *folder;
-
- d(printf("Creating spool folder: %s in %s\n", full_name, camel_local_store_get_toplevel_dir((CamelLocalStore *)parent_store)));
-
- folder = (CamelFolder *)camel_object_new(CAMEL_SPOOL_FOLDER_TYPE);
-
- if (parent_store->flags & CAMEL_STORE_FILTER_INBOX
- && strcmp(full_name, "INBOX") == 0)
- folder->folder_flags |= CAMEL_FOLDER_FILTER_RECENT;
- flags &= CAMEL_STORE_FOLDER_BODY_INDEX;
-
- folder = (CamelFolder *)camel_local_folder_construct((CamelLocalFolder *)folder, parent_store, full_name, flags, ex);
- if (folder) {
- if (camel_url_get_param(((CamelService *)parent_store)->url, "xstatus"))
- camel_mbox_summary_xstatus((CamelMboxSummary *)folder->summary, TRUE);
- }
-
- return folder;
-}
-
-static CamelLocalSummary *
-spool_create_summary(const char *path, const char *folder, CamelIndex *index)
-{
- return (CamelLocalSummary *)camel_spool_summary_new(folder);
-}
-
-static int
-spool_lock(CamelLocalFolder *lf, CamelLockType type, CamelException *ex)
-{
- int retry = 0;
- CamelMboxFolder *mf = (CamelMboxFolder *)lf;
- CamelSpoolFolder *sf = (CamelSpoolFolder *)lf;
-
- mf->lockfd = open(lf->folder_path, O_RDWR, 0);
- if (mf->lockfd == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Cannot create folder lock on %s: %s"),
- lf->folder_path, g_strerror (errno));
- return -1;
- }
-
- while (retry < CAMEL_LOCK_RETRY) {
- if (retry > 0)
- sleep(CAMEL_LOCK_DELAY);
-
- camel_exception_clear(ex);
-
- if (camel_lock_fcntl(mf->lockfd, type, ex) == 0) {
- if (camel_lock_flock(mf->lockfd, type, ex) == 0) {
- if ((sf->lockid = camel_lock_helper_lock(lf->folder_path, ex)) != -1)
- return 0;
- camel_unlock_flock(mf->lockfd);
- }
- camel_unlock_fcntl(mf->lockfd);
- }
- retry++;
- }
-
- return -1;
-}
-
-static void
-spool_unlock(CamelLocalFolder *lf)
-{
- CamelMboxFolder *mf = (CamelMboxFolder *)lf;
- CamelSpoolFolder *sf = (CamelSpoolFolder *)lf;
-
- camel_lock_helper_unlock(sf->lockid);
- sf->lockid = -1;
- camel_unlock_flock(mf->lockfd);
- camel_unlock_fcntl(mf->lockfd);
-
- close(mf->lockfd);
- mf->lockfd = -1;
-}
diff --git a/camel/providers/local/camel-spool-folder.h b/camel/providers/local/camel-spool-folder.h
deleted file mode 100644
index e778cdecf7..0000000000
--- a/camel/providers/local/camel-spool-folder.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Author: Michael Zucchi <notzed@ximian.com>
- *
- * Copyright (C) 2001 Ximian Inc (www.ximian.com/)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifndef CAMEL_SPOOL_FOLDER_H
-#define CAMEL_SPOOL_FOLDER_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include "camel-mbox-folder.h"
-#include <camel/camel-folder-search.h>
-#include <camel/camel-index.h>
-#include "camel-spool-summary.h"
-#include "camel-lock.h"
-
-/* #include "camel-store.h" */
-
-#define CAMEL_SPOOL_FOLDER_TYPE (camel_spool_folder_get_type ())
-#define CAMEL_SPOOL_FOLDER(obj) (CAMEL_CHECK_CAST((obj), CAMEL_SPOOL_FOLDER_TYPE, CamelSpoolFolder))
-#define CAMEL_SPOOL_FOLDER_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_SPOOL_FOLDER_TYPE, CamelSpoolFolderClass))
-#define CAMEL_IS_SPOOL_FOLDER(o) (CAMEL_CHECK_TYPE((o), CAMEL_SPOOL_FOLDER_TYPE))
-
-typedef struct {
- CamelMboxFolder parent;
-
- struct _CamelSpoolFolderPrivate *priv;
-
- int lockid; /* lock id for dot locking */
-} CamelSpoolFolder;
-
-typedef struct {
- CamelMboxFolderClass parent_class;
-} CamelSpoolFolderClass;
-
-/* Standard Camel function */
-CamelType camel_spool_folder_get_type(void);
-
-CamelFolder *camel_spool_folder_new(CamelStore *parent_store, const char *full_name, guint32 flags, CamelException *ex);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_SPOOL_FOLDER_H */
diff --git a/camel/providers/local/camel-spool-store.c b/camel/providers/local/camel-spool-store.c
deleted file mode 100644
index 09720e4a01..0000000000
--- a/camel/providers/local/camel-spool-store.c
+++ /dev/null
@@ -1,483 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * Copyright (C) 2001 Ximian Inc (www.ximian.com/)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef HAVE_ALLOCA_H
-#include <alloca.h>
-#endif
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <string.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <dirent.h>
-
-#include "camel-spool-store.h"
-#include "camel-spool-folder.h"
-#include "camel-exception.h"
-#include "camel-url.h"
-#include "camel-private.h"
-
-#define d(x)
-
-/* Returns the class for a CamelSpoolStore */
-#define CSPOOLS_CLASS(so) CAMEL_SPOOL_STORE_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-#define CF_CLASS(so) CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-
-static void construct (CamelService *service, CamelSession *session, CamelProvider *provider, CamelURL *url, CamelException *ex);
-static CamelFolder *get_folder(CamelStore * store, const char *folder_name, guint32 flags, CamelException * ex);
-static char *get_name(CamelService *service, gboolean brief);
-static CamelFolder *get_inbox (CamelStore *store, CamelException *ex);
-static void rename_folder(CamelStore *store, const char *old_name, const char *new_name, CamelException *ex);
-static CamelFolderInfo *get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelException *ex);
-static void free_folder_info (CamelStore *store, CamelFolderInfo *fi);
-
-static void delete_folder(CamelStore *store, const char *folder_name, CamelException *ex);
-static void rename_folder(CamelStore *store, const char *old, const char *new, CamelException *ex);
-
-static CamelStoreClass *parent_class = NULL;
-
-static void
-camel_spool_store_class_init (CamelSpoolStoreClass *camel_spool_store_class)
-{
- CamelStoreClass *camel_store_class = CAMEL_STORE_CLASS (camel_spool_store_class);
- CamelServiceClass *camel_service_class = CAMEL_SERVICE_CLASS (camel_spool_store_class);
-
- parent_class = CAMEL_STORE_CLASS(camel_mbox_store_get_type());
-
- /* virtual method overload */
- camel_service_class->construct = construct;
- camel_service_class->get_name = get_name;
- camel_store_class->get_folder = get_folder;
- camel_store_class->get_inbox = get_inbox;
- camel_store_class->get_folder_info = get_folder_info;
- camel_store_class->free_folder_info = free_folder_info;
-
- camel_store_class->delete_folder = delete_folder;
- camel_store_class->rename_folder = rename_folder;
-}
-
-CamelType
-camel_spool_store_get_type (void)
-{
- static CamelType camel_spool_store_type = CAMEL_INVALID_TYPE;
-
- if (camel_spool_store_type == CAMEL_INVALID_TYPE) {
- camel_spool_store_type = camel_type_register (camel_mbox_store_get_type(), "CamelSpoolStore",
- sizeof (CamelSpoolStore),
- sizeof (CamelSpoolStoreClass),
- (CamelObjectClassInitFunc) camel_spool_store_class_init,
- NULL,
- NULL,
- NULL);
- }
-
- return camel_spool_store_type;
-}
-
-static void
-construct (CamelService *service, CamelSession *session, CamelProvider *provider, CamelURL *url, CamelException *ex)
-{
- struct stat st;
-
- d(printf("constructing store of type %s '%s:%s'\n",
- camel_type_to_name(((CamelObject *)service)->s.type), url->protocol, url->path));
-
- CAMEL_SERVICE_CLASS (parent_class)->construct (service, session, provider, url, ex);
- if (camel_exception_is_set (ex))
- return;
-
- if (service->url->path[0] != '/') {
- camel_exception_setv(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
- _("Store root %s is not an absolute path"), service->url->path);
- return;
- }
-
- if (stat(service->url->path, &st) == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
- _("Spool `%s' cannot be opened: %s"),
- service->url->path, g_strerror (errno));
- return;
- }
-
- if (S_ISREG(st.st_mode))
- ((CamelSpoolStore *)service)->type = CAMEL_SPOOL_STORE_MBOX;
- else if (S_ISDIR(st.st_mode))
- /* we could check here for slight variations */
- ((CamelSpoolStore *)service)->type = CAMEL_SPOOL_STORE_ELM;
- else {
- camel_exception_setv(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
- _("Spool `%s' is not a regular file or directory"),
- service->url->path);
- return;
- }
-}
-
-static CamelFolder *
-get_folder(CamelStore * store, const char *folder_name, guint32 flags, CamelException * ex)
-{
- CamelFolder *folder = NULL;
- struct stat st;
- char *name;
-
- d(printf("opening folder %s on path %s\n", folder_name, path));
-
- /* we only support an 'INBOX' in mbox mode */
- if (((CamelSpoolStore *)store)->type == CAMEL_SPOOL_STORE_MBOX) {
- if (strcmp(folder_name, "INBOX") != 0) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
- _("Folder `%s/%s' does not exist."),
- ((CamelService *)store)->url->path, folder_name);
- } else {
- folder = camel_spool_folder_new(store, folder_name, flags, ex);
- }
- } else {
- name = g_strdup_printf("%s%s", CAMEL_LOCAL_STORE(store)->toplevel_dir, folder_name);
- if (stat(name, &st) == -1) {
- if (errno != ENOENT) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not open folder `%s':\n%s"),
- folder_name, g_strerror (errno));
- } else if ((flags & CAMEL_STORE_FOLDER_CREATE) == 0) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
- _("Folder `%s' does not exist."),
- folder_name);
- } else {
- if (creat (name, 0600) == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not create folder `%s':\n%s"),
- folder_name, g_strerror (errno));
- } else {
- folder = camel_spool_folder_new(store, folder_name, flags, ex);
- }
- }
- } else if (!S_ISREG(st.st_mode)) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
- _("`%s' is not a mailbox file."), name);
- } else {
- folder = camel_spool_folder_new(store, folder_name, flags, ex);
- }
- g_free(name);
- }
-
- return folder;
-}
-
-static CamelFolder *
-get_inbox(CamelStore *store, CamelException *ex)
-{
- if (((CamelSpoolStore *)store)->type == CAMEL_SPOOL_STORE_MBOX)
- return get_folder (store, "INBOX", CAMEL_STORE_FOLDER_CREATE, ex);
- else {
- camel_exception_setv(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
- _("Store does not support an INBOX"));
- return NULL;
- }
-}
-
-static char *
-get_name (CamelService *service, gboolean brief)
-{
- if (brief)
- return g_strdup(service->url->path);
- else
- return g_strdup_printf(((CamelSpoolStore *)service)->type == CAMEL_SPOOL_STORE_MBOX?
- _("Spool mail file %s"):_("Spool folder tree %s"), service->url->path);
-}
-
-/* default implementation, rename all */
-static void
-rename_folder(CamelStore *store, const char *old, const char *new, CamelException *ex)
-{
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Spool folders cannot be renamed"));
-}
-
-/* default implementation, only delete metadata */
-static void
-delete_folder(CamelStore *store, const char *folder_name, CamelException *ex)
-{
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Spool folders cannot be deleted"));
-}
-
-static void free_folder_info (CamelStore *store, CamelFolderInfo *fi)
-{
- if (fi) {
- g_free(fi->url);
- g_free(fi->name);
- g_free(fi->full_name);
- g_free(fi->path);
- g_free(fi);
- }
-}
-
-static CamelFolderInfo *
-camel_folder_info_new(const char *url, const char *full, const char *name, int unread)
-{
- CamelFolderInfo *fi;
-
- fi = g_malloc0(sizeof(*fi));
- fi->url = g_strdup(url);
- fi->full_name = g_strdup(full);
- fi->name = g_strdup(name);
- fi->unread_message_count = unread;
- camel_folder_info_build_path(fi, '/');
-
- d(printf("Adding spoold info: '%s' '%s' '%s' '%s'\n", fi->path, fi->name, fi->full_name, fi->url));
-
- return fi;
-}
-
-/* used to find out where we've visited already */
-struct _inode {
- dev_t dnode;
- ino_t inode;
-};
-
-/* returns number of records found at or below this level */
-static int scan_dir(CamelStore *store, GHashTable *visited, char *root, const char *path, guint32 flags, CamelFolderInfo *parent, CamelFolderInfo **fip, CamelException *ex)
-{
- DIR *dir;
- struct dirent *d;
- char *name, *uri, *tmp, *fname;
- CamelFolderInfo *fi = NULL;
- struct stat st;
- CamelFolder *folder;
- int unread;
- char from[80];
- FILE *fp;
-
- d(printf("checking dir '%s' part '%s' for mbox content\n", root, path));
-
- /* look for folders matching the right structure, recursively */
- if (path) {
- name = alloca(strlen(root) + strlen(path) + 2);
- sprintf(name, "%s/%s", root, path);
- } else
- name = root;
-
- if (stat(name, &st) == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not scan folder `%s': %s"),
- name, g_strerror (errno));
- } else if (S_ISREG(st.st_mode)) {
- /* incase we start scanning from a file. messy duplication :-/ */
- if (path) {
- folder = camel_object_bag_get(store->folders, path);
- if (folder) {
- /* should this refresh if ! FAST? */
- unread = camel_folder_get_unread_message_count(folder);
- camel_object_unref(folder);
- } else
- unread = -1;
- tmp = strrchr(path, '/');
- if (tmp)
- tmp++;
- else
- tmp = (char *)path;
- uri = g_strdup_printf("%s:%s#%s", ((CamelService *)store)->url->protocol, root, path);
- fi = camel_folder_info_new(uri, path, tmp, unread);
- fi->parent = parent;
- fi->sibling = *fip;
- *fip = fi;
- g_free(uri);
- }
- return 0;
- }
-
- dir = opendir(name);
- if (dir == NULL) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not scan folder `%s': %s"),
- name, g_strerror (errno));
- return -1;
- }
-
- if (path != NULL) {
- uri = g_strdup_printf("%s:%s;noselect=yes#%s", ((CamelService *)store)->url->protocol, root, path);
- tmp = strrchr(path, '/');
- if (tmp == NULL)
- tmp = (char *)path;
- else
- tmp++;
- fi = camel_folder_info_new(uri, path, tmp, -1);
- fi->parent = parent;
- fi->sibling = *fip;
- *fip = fi;
- g_free(uri);
-
- fip = &fi->child;
- parent = fi;
- }
-
- while ( (d = readdir(dir)) ) {
- if (strcmp(d->d_name, ".") == 0
- || strcmp(d->d_name, "..") == 0)
- continue;
-
- tmp = g_strdup_printf("%s/%s", name, d->d_name);
- if (stat(tmp, &st) == 0) {
- if (path)
- fname = g_strdup_printf("%s/%s", path, d->d_name);
- else
- fname = g_strdup(d->d_name);
-
- if (S_ISREG(st.st_mode)) {
- /* first, see if we already have it open */
- folder = camel_object_bag_get(store->folders, fname);
- if (folder) {
- /* should this refresh if ! FAST? */
- unread = camel_folder_get_unread_message_count(folder);
- camel_object_unref(folder);
- } else
- unread = -1;
-
- /* no? check its content to see if its a folder or not */
- if (folder == NULL) {
- fp = fopen(tmp, "r");
- if (fp != NULL) {
- if (st.st_size == 0
- || (fgets(from, sizeof(from), fp) != NULL
- && strncmp(from, "From ", 5) == 0)) {
- folder = (CamelFolder *)1;
- /* TODO: if slow mode selected, we could look up unread counts here -
- but its pretty expensive */
- }
- fclose(fp);
- }
- }
-
- if (folder != NULL) {
- uri = g_strdup_printf("%s:%s#%s", ((CamelService *)store)->url->protocol, root, fname);
- fi = camel_folder_info_new(uri, fname, d->d_name, unread);
- fi->parent = parent;
- fi->sibling = *fip;
- *fip = fi;
- g_free(uri);
- }
-
- } else if (S_ISDIR(st.st_mode)) {
- struct _inode in = { st.st_dev, st.st_ino };
-
- /* see if we've visited already */
- if (g_hash_table_lookup(visited, &in) == NULL) {
- struct _inode *inew = g_malloc(sizeof(*inew));
-
- *inew = in;
- g_hash_table_insert(visited, inew, inew);
-
- if (scan_dir(store, visited, root, fname, flags, parent, fip, ex) == -1) {
- g_free(tmp);
- g_free(fname);
- closedir(dir);
- return -1;
- }
- }
- }
- g_free(fname);
-
- }
- g_free(tmp);
- }
- closedir(dir);
-
- return 0;
-}
-
-static guint inode_hash(const void *d)
-{
- const struct _inode *v = d;
-
- return v->inode ^ v->dnode;
-}
-
-static gboolean inode_equal(const void *a, const void *b)
-{
- const struct _inode *v1 = a, *v2 = b;
-
- return v1->inode == v2->inode && v1->dnode == v2->dnode;
-}
-
-static void inode_free(void *k, void *v, void *d)
-{
- g_free(k);
-}
-
-static CamelFolderInfo *
-get_folder_info_elm(CamelStore *store, const char *top, guint32 flags, CamelException *ex)
-{
- CamelFolderInfo *fi = NULL;
- GHashTable *visited;
-
- visited = g_hash_table_new(inode_hash, inode_equal);
-
- if (scan_dir(store, visited, ((CamelService *)store)->url->path, top, flags, NULL, &fi, ex) == -1 && fi != NULL) {
- camel_store_free_folder_info_full(store, fi);
- fi = NULL;
- }
-
- g_hash_table_foreach(visited, inode_free, NULL);
- g_hash_table_destroy(visited);
-
- return fi;
-}
-
-static CamelFolderInfo *
-get_folder_info_mbox(CamelStore *store, const char *top, guint32 flags, CamelException *ex)
-{
- CamelFolderInfo *fi = NULL;
- CamelService *service = (CamelService *)store;
- CamelFolder *folder;
-
- if (top == NULL || strcmp(top, "INBOX") == 0) {
- fi = g_malloc0(sizeof(*fi));
- fi->full_name = g_strdup("INBOX");
- fi->name = g_strdup("INBOX");
- fi->url = g_strdup_printf("%s:%s#%s", service->url->protocol, service->url->path, fi->name);
-
- folder = camel_object_bag_get(store->folders, fi->full_name);
- if (folder) {
- fi->unread_message_count = camel_folder_get_unread_message_count(folder);
- camel_object_unref(folder);
- } else
- fi->unread_message_count = -1;
-
- camel_folder_info_build_path(fi, '/');
- }
-
- return fi;
-}
-
-static CamelFolderInfo *
-get_folder_info(CamelStore *store, const char *top, guint32 flags, CamelException *ex)
-{
- if (((CamelSpoolStore *)store)->type == CAMEL_SPOOL_STORE_MBOX)
- return get_folder_info_mbox(store, top, flags, ex);
- else
- return get_folder_info_elm(store, top, flags, ex);
-}
diff --git a/camel/providers/local/camel-spool-store.h b/camel/providers/local/camel-spool-store.h
deleted file mode 100644
index 1e1753481b..0000000000
--- a/camel/providers/local/camel-spool-store.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * Copyright (C) 2001 Ximian Inc (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifndef CAMEL_SPOOL_STORE_H
-#define CAMEL_SPOOL_STORE_H 1
-
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include "camel-mbox-store.h"
-
-#define CAMEL_SPOOL_STORE_TYPE (camel_spool_store_get_type ())
-#define CAMEL_SPOOL_STORE(obj) (CAMEL_CHECK_CAST((obj), CAMEL_SPOOL_STORE_TYPE, CamelSpoolStore))
-#define CAMEL_SPOOL_STORE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_SPOOL_STORE_TYPE, CamelSpoolStoreClass))
-#define CAMEL_IS_SPOOL_STORE(o) (CAMEL_CHECK_TYPE((o), CAMEL_SPOOL_STORE_TYPE))
-
-typedef enum _camel_spool_store_t {
- CAMEL_SPOOL_STORE_MBOX, /* a single mbox */
- CAMEL_SPOOL_STORE_ELM, /* elm/pine/etc tree of mbox files in folders */
-} camel_spool_store_t;
-
-typedef struct {
- CamelMboxStore parent_object;
-
- camel_spool_store_t type;
-} CamelSpoolStore;
-
-
-
-typedef struct {
- CamelMboxStoreClass parent_class;
-
-} CamelSpoolStoreClass;
-
-
-/* public methods */
-
-/* Standard Camel function */
-CamelType camel_spool_store_get_type (void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_SPOOL_STORE_H */
-
-
diff --git a/camel/providers/local/camel-spool-summary.c b/camel/providers/local/camel-spool-summary.c
deleted file mode 100644
index 7991a881cc..0000000000
--- a/camel/providers/local/camel-spool-summary.c
+++ /dev/null
@@ -1,344 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; fill-column: 160 -*-
- *
- * Copyright (C) 2001 Ximian Inc. (www.ximian.com)
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <sys/uio.h>
-#include <unistd.h>
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include <ctype.h>
-
-#include "camel-spool-summary.h"
-#include "camel-mime-message.h"
-#include "camel-file-utils.h"
-#include "camel-operation.h"
-
-#define io(x)
-#define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))*/
-
-#define CAMEL_SPOOL_SUMMARY_VERSION (0x400)
-
-static int spool_summary_load(CamelLocalSummary *cls, int forceindex, CamelException *ex);
-static int spool_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changeinfo, CamelException *ex);
-
-static int spool_summary_sync_full(CamelMboxSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex);
-
-static void camel_spool_summary_class_init (CamelSpoolSummaryClass *klass);
-static void camel_spool_summary_init (CamelSpoolSummary *obj);
-static void camel_spool_summary_finalise (CamelObject *obj);
-
-static CamelFolderSummaryClass *camel_spool_summary_parent;
-
-CamelType
-camel_spool_summary_get_type(void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register(camel_mbox_summary_get_type(), "CamelSpoolSummary",
- sizeof (CamelSpoolSummary),
- sizeof (CamelSpoolSummaryClass),
- (CamelObjectClassInitFunc) camel_spool_summary_class_init,
- NULL,
- (CamelObjectInitFunc) camel_spool_summary_init,
- (CamelObjectFinalizeFunc) camel_spool_summary_finalise);
- }
-
- return type;
-}
-
-static void
-camel_spool_summary_class_init(CamelSpoolSummaryClass *klass)
-{
- CamelLocalSummaryClass *lklass = (CamelLocalSummaryClass *)klass;
- CamelMboxSummaryClass *mklass = (CamelMboxSummaryClass *)klass;
-
- camel_spool_summary_parent = CAMEL_FOLDER_SUMMARY_CLASS(camel_mbox_summary_get_type());
-
- lklass->load = spool_summary_load;
- lklass->check = spool_summary_check;
-
- mklass->sync_full = spool_summary_sync_full;
-}
-
-static void
-camel_spool_summary_init(CamelSpoolSummary *obj)
-{
- struct _CamelFolderSummary *s = (CamelFolderSummary *)obj;
-
- /* message info size is from mbox parent */
-
- /* and a unique file version */
- s->version += CAMEL_SPOOL_SUMMARY_VERSION;
-}
-
-static void
-camel_spool_summary_finalise(CamelObject *obj)
-{
- /*CamelSpoolSummary *mbs = CAMEL_SPOOL_SUMMARY(obj);*/
-}
-
-CamelSpoolSummary *
-camel_spool_summary_new(const char *mbox_name)
-{
- CamelSpoolSummary *new = (CamelSpoolSummary *)camel_object_new(camel_spool_summary_get_type());
-
- camel_local_summary_construct((CamelLocalSummary *)new, NULL, mbox_name, NULL);
- return new;
-}
-
-static int
-spool_summary_load(CamelLocalSummary *cls, int forceindex, CamelException *ex)
-{
- g_warning("spool summary - not loading anything\n");
- return 0;
-}
-
-/* perform a full sync */
-static int
-spool_summary_sync_full(CamelMboxSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex)
-{
- int fd = -1, fdout = -1;
- char *tmpname = NULL;
- char *buffer, *p;
- off_t spoollen, outlen;
- int size, sizeout;
- struct stat st;
- guint32 flags = (expunge?1:0);
-
- d(printf("performing full summary/sync\n"));
-
- camel_operation_start(NULL, _("Storing folder"));
-
- fd = open(((CamelLocalSummary *)cls)->folder_path, O_RDWR);
- if (fd == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not open file: %s: %s"),
- ((CamelLocalSummary *)cls)->folder_path,
- g_strerror (errno));
- camel_operation_end(NULL);
- return -1;
- }
-
-#ifdef HAVE_MKSTEMP
- tmpname = alloca (64);
- sprintf (tmpname, "/tmp/spool.camel.XXXXXX");
- fdout = mkstemp (tmpname);
-#else
-#warning "Your system has no mkstemp(3), spool updating may be insecure"
- tmpname = alloca (L_tmpnam);
- tmpnam (tmpname);
- fdout = open (tmpname, O_RDWR|O_CREAT|O_EXCL, 0600);
-#endif
- d(printf("Writing tmp file to %s\n", tmpname));
- if (fdout == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Cannot open temporary mailbox: %s"),
- g_strerror (errno));
- goto error;
- }
-
- if (camel_mbox_summary_sync_mbox((CamelMboxSummary *)cls, flags, changeinfo, fd, fdout, ex) == -1)
- goto error;
-
-
- /* sync out content */
- if (fsync(fdout) == -1) {
- g_warning("Cannot sync temporary folder: %s", strerror (errno));
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not sync temporary folder %s: %s"),
- ((CamelLocalSummary *)cls)->folder_path,
- g_strerror (errno));
- goto error;
- }
-
- /* see if we can write this much to the spool file */
- if (fstat(fd, &st) == -1) {
- g_warning("Cannot sync temporary folder: %s", strerror (errno));
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not sync temporary folder %s: %s"),
- ((CamelLocalSummary *)cls)->folder_path,
- g_strerror (errno));
- goto error;
- }
- spoollen = st.st_size;
-
- if (fstat(fdout, &st) == -1) {
- g_warning("Cannot sync temporary folder: %s", strerror (errno));
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not sync temporary folder %s: %s"),
- ((CamelLocalSummary *)cls)->folder_path,
- g_strerror (errno));
- goto error;
- }
- outlen = st.st_size;
-
- /* I think this is the right way to do this - checking that the file will fit the new data */
- if (outlen>0
- && (lseek(fd, outlen-1, SEEK_SET) == -1
- || write(fd, "", 1) != 1
- || fsync(fd) == -1
- || lseek(fd, 0, SEEK_SET) == -1
- || lseek(fdout, 0, SEEK_SET) == -1)) {
- g_warning("Cannot sync spool folder: %s", strerror (errno));
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not sync spool folder %s: %s"),
- ((CamelLocalSummary *)cls)->folder_path,
- g_strerror (errno));
- /* incase we ran out of room, remove any trailing space first */
- ftruncate(fd, spoollen);
- goto error;
- }
-
-
- /* now copy content back */
- buffer = g_malloc(8192);
- size = 1;
- while (size>0) {
- do {
- size = read(fdout, buffer, 8192);
- } while (size == -1 && errno == EINTR);
-
- if (size > 0) {
- p = buffer;
- do {
- sizeout = write(fd, p, size);
- if (sizeout > 0) {
- p+= sizeout;
- size -= sizeout;
- }
- } while ((sizeout == -1 && errno == EINTR) && size > 0);
- size = sizeout;
- }
-
- if (size == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not sync spool folder %s: %s\n"
- "Folder may be corrupt, copy saved in `%s'"),
- ((CamelLocalSummary *)cls)->folder_path,
- g_strerror (errno), tmpnam);
- /* so we dont delete it */
- close(fdout);
- tmpname = NULL;
- fdout = -1;
- g_free(buffer);
- goto error;
- }
- }
-
- g_free(buffer);
-
- d(printf("Closing folders\n"));
-
- if (ftruncate(fd, outlen) == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not sync spool folder %s: %s\n"
- "Folder may be corrupt, copy saved in `%s'"),
- ((CamelLocalSummary *)cls)->folder_path,
- g_strerror (errno), tmpnam);
- close(fdout);
- tmpname = NULL;
- fdout = -1;
- goto error;
- }
-
- if (close(fd) == -1) {
- g_warning("Cannot close source folder: %s", strerror (errno));
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not sync spool folder %s: %s\n"
- "Folder may be corrupt, copy saved in `%s'"),
- ((CamelLocalSummary *)cls)->folder_path,
- g_strerror (errno), tmpnam);
- close(fdout);
- tmpname = NULL;
- fdout = -1;
- fd = -1;
- goto error;
- }
-
- close(fdout);
- unlink(tmpname);
-
- camel_operation_end(NULL);
-
- return 0;
- error:
- if (fd != -1)
- close(fd);
-
- if (fdout != -1)
- close(fdout);
-
- if (tmpname)
- unlink(tmpname);
-
- camel_operation_end(NULL);
-
- return -1;
-}
-
-static int
-spool_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changeinfo, CamelException *ex)
-{
- int i, work, count;
- struct stat st;
- CamelFolderSummary *s = (CamelFolderSummary *)cls;
-
- if (((CamelLocalSummaryClass *)camel_spool_summary_parent)->check(cls, changeinfo, ex) == -1)
- return -1;
-
- /* check to see if we need to copy/update the file; missing xev headers prompt this */
- work = FALSE;
- count = camel_folder_summary_count(s);
- for (i=0;!work && i<count; i++) {
- CamelMessageInfo *info = camel_folder_summary_index(s, i);
- g_assert(info);
- work = (info->flags & (CAMEL_MESSAGE_FOLDER_NOXEV)) != 0;
- camel_folder_summary_info_free(s, info);
- }
-
- /* if we do, then write out the headers using sync_full, etc */
- if (work) {
- d(printf("Have to add new headers, re-syncing from the start to accomplish this\n"));
- if (((CamelMboxSummaryClass *)((CamelObject *)cls)->klass)->sync_full((CamelMboxSummary *)cls, FALSE, changeinfo, ex) == -1)
- return -1;
-
- if (stat(cls->folder_path, &st) == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Unknown error: %s"),
- g_strerror (errno));
- return -1;
- }
-
- ((CamelMboxSummary *)cls)->folder_size = st.st_size;
- ((CamelFolderSummary *)cls)->time = st.st_mtime;
- }
-
- return 0;
-}
diff --git a/camel/providers/local/camel-spool-summary.h b/camel/providers/local/camel-spool-summary.h
deleted file mode 100644
index b72aeda527..0000000000
--- a/camel/providers/local/camel-spool-summary.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (C) 2001 Ximian Inc. (www.ximian.com)
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef _CAMEL_SPOOL_SUMMARY_H
-#define _CAMEL_SPOOL_SUMMARY_H
-
-#include <camel/camel-folder-summary.h>
-#include <camel/camel-folder.h>
-#include <camel/camel-exception.h>
-#include <camel/camel-index.h>
-#include "camel-mbox-summary.h"
-
-#define CAMEL_SPOOL_SUMMARY(obj) CAMEL_CHECK_CAST (obj, camel_spool_summary_get_type (), CamelSpoolSummary)
-#define CAMEL_SPOOL_SUMMARY_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_spool_summary_get_type (), CamelSpoolSummaryClass)
-#define CAMEL_IS_SPOOL_SUMMARY(obj) CAMEL_CHECK_TYPE (obj, camel_spool_summary_get_type ())
-
-typedef struct _CamelSpoolSummary CamelSpoolSummary;
-typedef struct _CamelSpoolSummaryClass CamelSpoolSummaryClass;
-
-struct _CamelSpoolSummary {
- CamelMboxSummary parent;
-
-};
-
-struct _CamelSpoolSummaryClass {
- CamelMboxSummaryClass parent_class;
-};
-
-CamelType camel_spool_summary_get_type (void);
-void camel_spool_summary_construct (CamelSpoolSummary *new, const char *filename, const char *spool_name, CamelIndex *index);
-
-/* create the summary, in-memory only */
-CamelSpoolSummary *camel_spool_summary_new(const char *filename);
-
-/* load/check the summary */
-int camel_spool_summary_load(CamelSpoolSummary *cls, int forceindex, CamelException *ex);
-/* check for new/removed messages */
-int camel_spool_summary_check(CamelSpoolSummary *cls, CamelFolderChangeInfo *, CamelException *ex);
-/* perform a folder sync or expunge, if needed */
-int camel_spool_summary_sync(CamelSpoolSummary *cls, gboolean expunge, CamelFolderChangeInfo *, CamelException *ex);
-/* add a new message to the summary */
-CamelMessageInfo *camel_spool_summary_add(CamelSpoolSummary *cls, CamelMimeMessage *msg, const CamelMessageInfo *info, CamelFolderChangeInfo *, CamelException *ex);
-
-/* generate an X-Evolution header line */
-char *camel_spool_summary_encode_x_evolution(CamelSpoolSummary *cls, const CamelMessageInfo *info);
-int camel_spool_summary_decode_x_evolution(CamelSpoolSummary *cls, const char *xev, CamelMessageInfo *info);
-
-/* utility functions - write headers to a file with optional X-Evolution header */
-int camel_spool_summary_write_headers(int fd, struct _camel_header_raw *header, char *xevline);
-
-#endif /* ! _CAMEL_SPOOL_SUMMARY_H */
-
diff --git a/camel/providers/local/libcamellocal.urls b/camel/providers/local/libcamellocal.urls
deleted file mode 100644
index e2279ed72a..0000000000
--- a/camel/providers/local/libcamellocal.urls
+++ /dev/null
@@ -1,5 +0,0 @@
-mh
-mbox
-maildir
-spool
-spoold
diff --git a/camel/providers/nntp/.cvsignore b/camel/providers/nntp/.cvsignore
deleted file mode 100644
index 2fbeab8712..0000000000
--- a/camel/providers/nntp/.cvsignore
+++ /dev/null
@@ -1,12 +0,0 @@
-.deps
-Makefile
-Makefile.in
-.libs
-.deps
-*.lo
-*.la
-test-newsrc
-*.bb
-*.bbg
-*.da
-*.gcov
diff --git a/camel/providers/nntp/Makefile.am b/camel/providers/nntp/Makefile.am
deleted file mode 100644
index 464624b82d..0000000000
--- a/camel/providers/nntp/Makefile.am
+++ /dev/null
@@ -1,36 +0,0 @@
-## Process this file with automake to produce Makefile.in
-
-libcamelnntpincludedir = $(privincludedir)/camel
-
-camel_provider_LTLIBRARIES = libcamelnntp.la
-camel_provider_DATA = libcamelnntp.urls
-
-INCLUDES = -I../.. \
- -I$(top_srcdir)/camel \
- -I$(top_srcdir)/intl \
- -I$(top_srcdir)/e-util \
- -I$(top_srcdir) \
- $(CAMEL_CFLAGS) \
- $(GNOME_INCLUDEDIR) \
- $(GTK_INCLUDEDIR) \
- -DG_LOG_DOMAIN=\"camel-nntp-provider\"
-
-libcamelnntp_la_SOURCES = \
- camel-nntp-provider.c \
- camel-nntp-store.c \
- camel-nntp-folder.c \
- camel-nntp-stream.c \
- camel-nntp-summary.c
-
-libcamelnntpinclude_HEADERS = \
- camel-nntp-store.h \
- camel-nntp-folder.h \
- camel-nntp-stream.h \
- camel-nntp-summary.h
-
-noinst_HEADERS = \
- camel-nntp-private.h
-
-libcamelnntp_la_LDFLAGS = -avoid-version -module
-
-EXTRA_DIST = libcamelnntp.urls
diff --git a/camel/providers/nntp/camel-nntp-auth.c b/camel/providers/nntp/camel-nntp-auth.c
deleted file mode 100644
index f8d3a62e27..0000000000
--- a/camel/providers/nntp/camel-nntp-auth.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-nntp-auth.c : authentication for nntp */
-
-/*
- *
- * Copyright (C) 2000 Ximian, Inc. <toshok@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-#include <camel-nntp-auth.h>
-#include <camel-nntp-store.h>
-#include <camel-nntp-resp-codes.h>
-#include <camel-exception.h>
-#include <camel-session.h>
-
-int
-camel_nntp_auth_authenticate (CamelNNTPStore *store, CamelException *ex)
-{
- CamelService *service = CAMEL_SERVICE (store);
- CamelSession *session = camel_service_get_session (service);
- int resp;
-
- if (!service->url->authmech && !service->url->passwd) {
- gchar *prompt;
-
- prompt = g_strdup_printf (_("Please enter the NNTP password for %s@%s"),
- service->url->user, service->url->host);
- service->url->passwd =
- camel_session_get_password (session, prompt,
- TRUE, service, "password", ex);
- g_free (prompt);
-
- if (!service->url->passwd) {
- camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
- "You didn\'t enter a password.");
- resp = 666;
- goto done;
- }
- }
-
- /* first send username */
- resp = camel_nntp_command (store, ex, NULL, "AUTHINFO USER %s", service->url->user);
-
- if (resp == NNTP_AUTH_REJECTED) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
- _("Server rejected username"));
- goto done;
-
- }
- else if (resp != NNTP_AUTH_CONTINUE) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
- _("Failed to send username to server"));
- goto done;
- }
-
- /* then send the username if the server asks for it */
- resp = camel_nntp_command (store, ex, NULL, "AUTHINFO PASS %s", service->url->passwd);
-
- if (resp == NNTP_AUTH_REJECTED) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
- _("Server rejected username/password"));
- goto done;
- }
-
- done:
-
- if (service->url->passwd) {
- /* let's be paranoid */
- memset (service->url->passwd, 0, strlen (service->url->passwd));
- g_free (service->url->passwd);
- service->url->passwd = NULL;
- }
- return resp;
-}
diff --git a/camel/providers/nntp/camel-nntp-auth.h b/camel/providers/nntp/camel-nntp-auth.h
deleted file mode 100644
index fc96cf6a4e..0000000000
--- a/camel/providers/nntp/camel-nntp-auth.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-nntp-auth.h : authentication for nntp */
-
-/*
- *
- * Author : Chris Toshok <toshok@ximian.com>
- *
- * Copyright (C) 1999 Ximian .
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifndef CAMEL_NNTP_AUTH_H
-#define CAMEL_NNTP_AUTH_H 1
-
-#include <camel-nntp-store.h>
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-int camel_nntp_auth_authenticate (CamelNNTPStore *store, CamelException *ex);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_NNTP_AUTH_H */
diff --git a/camel/providers/nntp/camel-nntp-folder.c b/camel/providers/nntp/camel-nntp-folder.c
deleted file mode 100644
index 9f0832bc33..0000000000
--- a/camel/providers/nntp/camel-nntp-folder.c
+++ /dev/null
@@ -1,405 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-nntp-folder.c : Class for a news folder
- *
- * Authors : Chris Toshok <toshok@ximian.com>
- * Michael Zucchi <notzed@ximian.com>
- *
- * Copyright (C) 2001-2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <dirent.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-
-#include "camel/camel-file-utils.h"
-#include "camel/camel-stream-mem.h"
-#include "camel/camel-data-wrapper.h"
-#include "camel/camel-mime-message.h"
-#include "camel/camel-folder-search.h"
-#include "camel/camel-exception.h"
-#include "camel/camel-session.h"
-#include "camel/camel-data-cache.h"
-
-#include "camel-nntp-summary.h"
-#include "camel-nntp-store.h"
-#include "camel-nntp-folder.h"
-#include "camel-nntp-store.h"
-#include "camel-nntp-private.h"
-
-static CamelFolderClass *parent_class = NULL;
-
-/* Returns the class for a CamelNNTPFolder */
-#define CNNTPF_CLASS(so) CAMEL_NNTP_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-#define CF_CLASS(so) CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-#define CNNTPS_CLASS(so) CAMEL_STORE_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-
-static void
-nntp_folder_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
-{
- CamelNNTPStore *nntp_store;
- CamelFolderChangeInfo *changes = NULL;
- CamelNNTPFolder *nntp_folder;
-
- nntp_store = (CamelNNTPStore *)folder->parent_store;
- nntp_folder = (CamelNNTPFolder *)folder;
-
- CAMEL_NNTP_STORE_LOCK(nntp_store, command_lock);
-
- if (camel_nntp_summary_check((CamelNNTPSummary *)folder->summary, nntp_folder->changes, ex) != -1)
- camel_folder_summary_save (folder->summary);
-
- if (camel_folder_change_info_changed(nntp_folder->changes)) {
- changes = nntp_folder->changes;
- nntp_folder->changes = camel_folder_change_info_new();
- }
-
- CAMEL_NNTP_STORE_UNLOCK(nntp_store, command_lock);
-
- if (changes) {
- camel_object_trigger_event((CamelObject *)folder, "folder_changed", changes);
- camel_folder_change_info_free(changes);
- }
-}
-
-static void
-nntp_folder_set_message_flags(CamelFolder *folder, const char *uid, guint32 flags, guint32 set)
-{
- ((CamelFolderClass *)parent_class)->set_message_flags(folder, uid, flags, set);
-}
-
-static CamelMimeMessage *
-nntp_folder_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
-{
- CamelMimeMessage *message = NULL;
- CamelNNTPStore *nntp_store;
- CamelFolderChangeInfo *changes;
- CamelNNTPFolder *nntp_folder;
- CamelStream *stream = NULL;
- int ret;
- char *line;
- const char *msgid;
-
- nntp_store = (CamelNNTPStore *)folder->parent_store;
- nntp_folder = (CamelNNTPFolder *)folder;
-
- CAMEL_NNTP_STORE_LOCK(nntp_store, command_lock);
-
- msgid = strchr(uid, ',');
- if (msgid == 0) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Internal error: uid in invalid format: %s"), uid);
- goto fail;
- }
- msgid++;
-
- /* Lookup in cache, NEWS is global messageid's so use a global cache path */
- stream = camel_data_cache_get(nntp_store->cache, "cache", msgid, NULL);
- if (stream == NULL) {
- /* Not in cache, retrieve and put in cache */
- if (camel_nntp_store_set_folder(nntp_store, folder, nntp_folder->changes, ex) == -1)
- goto fail;
-
- ret = camel_nntp_command(nntp_store, &line, "article %s", msgid);
- if (ret == -1)
- goto error;
-
- if (ret == 220) {
- stream = camel_data_cache_add(nntp_store->cache, "cache", msgid, NULL);
- if (stream) {
- if (camel_stream_write_to_stream((CamelStream *)nntp_store->stream, stream) == -1)
- goto error;
- if (camel_stream_reset(stream) == -1)
- goto error;
- } else {
- stream = (CamelStream *)nntp_store->stream;
- camel_object_ref((CamelObject *)stream);
- }
- }
- }
-
- if (stream) {
- message = camel_mime_message_new();
- if (camel_data_wrapper_construct_from_stream((CamelDataWrapper *)message, stream) == -1)
- goto error;
-
- CAMEL_NNTP_STORE_UNLOCK(nntp_store, command_lock);
-
- camel_object_unref((CamelObject *)stream);
- return message;
- }
-
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot get message %s: %s"), uid, line);
-
-error:
- if (errno == EINTR)
- camel_exception_setv(ex, CAMEL_EXCEPTION_USER_CANCEL, _("User cancelled"));
- else
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot get message %s: %s"), uid, strerror(errno));
-
-fail:
- if (message)
- camel_object_unref((CamelObject *)message);
-
- if (stream)
- camel_object_unref((CamelObject *)stream);
-
- if (camel_folder_change_info_changed(nntp_folder->changes)) {
- changes = nntp_folder->changes;
- nntp_folder->changes = camel_folder_change_info_new();
- } else {
- changes = NULL;
- }
-
- CAMEL_NNTP_STORE_UNLOCK(nntp_store, command_lock);
-
- if (changes) {
- camel_object_trigger_event((CamelObject *)folder, "folder_changed", changes);
- camel_folder_change_info_free(changes);
- }
-
- return NULL;
-}
-
-static GPtrArray*
-nntp_folder_search_by_expression (CamelFolder *folder, const char *expression, CamelException *ex)
-{
- CamelNNTPFolder *nntp_folder = CAMEL_NNTP_FOLDER (folder);
- GPtrArray *matches, *summary;
-
- CAMEL_NNTP_FOLDER_LOCK(nntp_folder, search_lock);
-
- if(nntp_folder->search == NULL)
- nntp_folder->search = camel_folder_search_new();
-
- camel_folder_search_set_folder(nntp_folder->search, folder);
- summary = camel_folder_get_summary(folder);
- camel_folder_search_set_summary(nntp_folder->search, summary);
-
- matches = camel_folder_search_execute_expression(nntp_folder->search, expression, ex);
-
- CAMEL_NNTP_FOLDER_UNLOCK(nntp_folder, search_lock);
-
- camel_folder_free_summary(folder, summary);
-
- return matches;
-}
-
-static GPtrArray *
-nntp_folder_search_by_uids(CamelFolder *folder, const char *expression, GPtrArray *uids, CamelException *ex)
-{
- CamelNNTPFolder *nntp_folder = CAMEL_NNTP_FOLDER(folder);
- GPtrArray *summary, *matches;
- int i;
-
- /* NOTE: could get away without the search lock by creating a new
- search object each time */
-
- summary = g_ptr_array_new();
- for (i=0;i<uids->len;i++) {
- CamelMessageInfo *info;
-
- info = camel_folder_get_message_info(folder, uids->pdata[i]);
- if (info)
- g_ptr_array_add(summary, info);
- }
-
- if (summary->len == 0)
- return summary;
-
- CAMEL_NNTP_FOLDER_LOCK(folder, search_lock);
-
- if (nntp_folder->search == NULL)
- nntp_folder->search = camel_folder_search_new();
-
- camel_folder_search_set_folder(nntp_folder->search, folder);
- camel_folder_search_set_summary(nntp_folder->search, summary);
-
- matches = camel_folder_search_execute_expression(nntp_folder->search, expression, ex);
-
- CAMEL_NNTP_FOLDER_UNLOCK(folder, search_lock);
-
- for (i=0;i<summary->len;i++)
- camel_folder_free_message_info(folder, summary->pdata[i]);
- g_ptr_array_free(summary, TRUE);
-
- return matches;
-}
-
-static void
-nntp_folder_search_free(CamelFolder *folder, GPtrArray *result)
-{
- CamelNNTPFolder *nntp_folder = CAMEL_NNTP_FOLDER (folder);
-
- camel_folder_search_free_result(nntp_folder->search, result);
-
-}
-
-static void
-nntp_folder_init(CamelNNTPFolder *nntp_folder, CamelNNTPFolderClass *klass)
-{
- struct _CamelNNTPFolderPrivate *p;
-
- nntp_folder->changes = camel_folder_change_info_new();
- p = nntp_folder->priv = g_malloc0(sizeof(*nntp_folder->priv));
- p->search_lock = g_mutex_new();
- p->cache_lock = g_mutex_new();
-}
-
-static void
-nntp_folder_finalise (CamelNNTPFolder *nntp_folder)
-{
- struct _CamelNNTPFolderPrivate *p;
-
- g_free(nntp_folder->storage_path);
-
- p = nntp_folder->priv;
- g_mutex_free(p->search_lock);
- g_mutex_free(p->cache_lock);
- g_free(p);
-}
-
-static void
-nntp_folder_class_init (CamelNNTPFolderClass *camel_nntp_folder_class)
-{
- CamelFolderClass *camel_folder_class = CAMEL_FOLDER_CLASS (camel_nntp_folder_class);
-
- parent_class = CAMEL_FOLDER_CLASS (camel_type_get_global_classfuncs (camel_folder_get_type ()));
-
- /* virtual method definition */
-
- /* virtual method overload */
- camel_folder_class->sync = nntp_folder_sync;
- camel_folder_class->set_message_flags = nntp_folder_set_message_flags;
- camel_folder_class->get_message = nntp_folder_get_message;
- camel_folder_class->search_by_expression = nntp_folder_search_by_expression;
- camel_folder_class->search_by_uids = nntp_folder_search_by_uids;
- camel_folder_class->search_free = nntp_folder_search_free;
-}
-
-CamelType
-camel_nntp_folder_get_type (void)
-{
- static CamelType camel_nntp_folder_type = CAMEL_INVALID_TYPE;
-
- if (camel_nntp_folder_type == CAMEL_INVALID_TYPE) {
- camel_nntp_folder_type = camel_type_register (CAMEL_FOLDER_TYPE, "CamelNNTPFolder",
- sizeof (CamelNNTPFolder),
- sizeof (CamelNNTPFolderClass),
- (CamelObjectClassInitFunc) nntp_folder_class_init,
- NULL,
- (CamelObjectInitFunc) nntp_folder_init,
- (CamelObjectFinalizeFunc) nntp_folder_finalise);
- }
-
- return camel_nntp_folder_type;
-}
-
-
-/* not yet */
-/* Idea is we update in stages, but this requires a different xover command, etc */
-#ifdef ASYNC_SUMMARY
-struct _folder_check_msg {
- CamelSessionThreadMsg msg;
- CamelNNTPFolder *folder;
-};
-
-static void
-folder_check(CamelSession *session, CamelSessionThreadMsg *msg)
-{
- struct _folder_check_msg *m = (struct _folder_check_msg *)msg;
- CamelException *ex;
- CamelNNTPStore *nntp_store;
-
- nntp_store = (CamelNNTPStore *)m->folder->parent.parent_store;
-
- CAMEL_NNTP_STORE_LOCK(nntp_store, command_lock);
-
- ex = camel_exception_new();
- camel_nntp_summary_check((CamelNNTPSummary *)m->folder->parent.summary, m->folder->changes, ex);
- camel_exception_free(ex);
-
- CAMEL_NNTP_STORE_UNLOCK(nntp_store, command_lock);
-}
-
-static void
-folder_check_free(CamelSession *session, CamelSessionThreadMsg *msg)
-{
- struct _folder_check_msg *m = (struct _folder_check_msg *)msg;
-
- camel_object_unref((CamelObject *)m->folder);
-}
-
-static CamelSessionThreadOps folder_check_ops = {
- folder_check,
- folder_check_free,
-};
-#endif
-
-CamelFolder *
-camel_nntp_folder_new (CamelStore *parent, const char *folder_name, CamelException *ex)
-{
- CamelFolder *folder;
- CamelNNTPFolder *nntp_folder;
- char *root;
- CamelService *service;
-#ifdef ASYNC_SUMMARY
- struct _folder_check_msg *m;
-#endif
-
- service = (CamelService *)parent;
- root = camel_session_get_storage_path(service->session, service, ex);
- if (root == NULL)
- return NULL;
-
- /* If this doesn't work, stuff wont save, but let it continue anyway */
- camel_mkdir (root, 0777);
-
- folder = (CamelFolder *) camel_object_new (CAMEL_NNTP_FOLDER_TYPE);
- nntp_folder = (CamelNNTPFolder *)folder;
-
- camel_folder_construct (folder, parent, folder_name, folder_name);
- folder->folder_flags |= CAMEL_FOLDER_HAS_SUMMARY_CAPABILITY|CAMEL_FOLDER_HAS_SEARCH_CAPABILITY;
-
- nntp_folder->storage_path = g_strdup_printf("%s/%s", root, folder->full_name);
- g_free(root);
-
- folder->summary = (CamelFolderSummary *)camel_nntp_summary_new(nntp_folder);
- camel_folder_summary_load (folder->summary);
-#ifdef ASYNC_SUMMARY
- m = camel_session_thread_msg_new(service->session, &folder_check_ops, sizeof(*m));
- m->folder = nntp_folder;
- camel_object_ref((CamelObject *)folder);
- camel_session_thread_queue(service->session, &m->msg, 0);
-#else
- if (camel_nntp_summary_check((CamelNNTPSummary *)folder->summary, nntp_folder->changes, ex) == -1) {
- camel_object_unref((CamelObject *)folder);
- folder = NULL;
- }
-#endif
-
- return folder;
-}
diff --git a/camel/providers/nntp/camel-nntp-folder.h b/camel/providers/nntp/camel-nntp-folder.h
deleted file mode 100644
index 300d61762d..0000000000
--- a/camel/providers/nntp/camel-nntp-folder.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-nntp-folder.h : NNTP group (folder) support. */
-
-/*
- *
- * Author : Chris Toshok <toshok@ximian.com>
- *
- * Copyright (C) 2000 Ximian .
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifndef CAMEL_NNTP_FOLDER_H
-#define CAMEL_NNTP_FOLDER_H 1
-
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include "camel/camel-folder.h"
-
-/* #include "camel-store.h" */
-
-#define CAMEL_NNTP_FOLDER_TYPE (camel_nntp_folder_get_type ())
-#define CAMEL_NNTP_FOLDER(obj) (CAMEL_CHECK_CAST((obj), CAMEL_NNTP_FOLDER_TYPE, CamelNNTPFolder))
-#define CAMEL_NNTP_FOLDER_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_NNTP_FOLDER_TYPE, CamelNNTPFolderClass))
-#define CAMEL_IS_NNTP_FOLDER(o) (CAMEL_CHECK_TYPE((o), CAMEL_NNTP_FOLDER_TYPE))
-
-typedef struct _CamelNNTPFolder {
- CamelFolder parent;
-
- struct _CamelNNTPFolderPrivate *priv;
-
- struct _CamelFolderChangeInfo *changes;
- char *storage_path;
- CamelFolderSearch *search;
-} CamelNNTPFolder;
-
-typedef struct _CamelNNTPFolderClass {
- CamelFolderClass parent;
-
- /* Virtual methods */
-
-} CamelNNTPFolderClass;
-
-/* public methods */
-
-/* Standard Camel function */
-CamelType camel_nntp_folder_get_type (void);
-
-CamelFolder *camel_nntp_folder_new (CamelStore *parent, const char *folder_name, CamelException *ex);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_NNTP_FOLDER_H */
diff --git a/camel/providers/nntp/camel-nntp-grouplist.c b/camel/providers/nntp/camel-nntp-grouplist.c
deleted file mode 100644
index 7f3850f9c1..0000000000
--- a/camel/providers/nntp/camel-nntp-grouplist.c
+++ /dev/null
@@ -1,219 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-nntp-grouplist.c : getting/updating the list of newsgroups on the server. */
-
-/*
- * Author : Chris Toshok <toshok@ximian.com>
- *
- * Copyright (C) 2000 Ximian .
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#include <config.h>
-#include <errno.h>
-#include <string.h>
-
-#include "camel-exception.h"
-#include "camel-nntp-grouplist.h"
-#include "camel-nntp-resp-codes.h"
-
-static CamelNNTPGroupList *
-camel_nntp_get_grouplist_from_server (CamelNNTPStore *store, CamelException *ex)
-{
- int status;
- gboolean done = FALSE;
- CamelNNTPGroupList *list;
-
- CAMEL_NNTP_STORE_LOCK(store);
- status = camel_nntp_command (store, ex, NULL,
- "LIST");
-
- if (status != NNTP_LIST_FOLLOWS) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not get group list from server."));
- return NULL;
- }
-
- list = g_new0 (CamelNNTPGroupList, 1);
- list->time = time (NULL);
-
- while (!done) {
- char *line;
-
- if (camel_remote_store_recv_line (CAMEL_REMOTE_STORE (store), &line, ex) < 0) {
- list->group_list = g_list_reverse(list->group_list);
- return list;
- }
-
- if (*line == '.') {
- done = TRUE;
- }
- else {
- CamelNNTPGroupListEntry *entry = g_new (CamelNNTPGroupListEntry, 1);
- char **split_line = g_strsplit (line, " ", 4);
-
- entry->group_name = g_strdup (split_line[0]);
- entry->high = atoi (split_line[1]);
- entry->low = atoi (split_line[2]);
-
- g_strfreev (split_line);
-
- list->group_list = g_list_prepend (list->group_list, entry);
- }
- }
- CAMEL_NNTP_STORE_UNLOCK(store);
-
- list->group_list = g_list_reverse(list->group_list);
- return list;
-}
-
-static CamelNNTPGroupList*
-camel_nntp_get_grouplist_from_file (CamelNNTPStore *store, CamelException *ex)
-{
- gchar *root_dir = camel_nntp_store_get_toplevel_dir(CAMEL_NNTP_STORE(store));
- gchar *grouplist_file = g_strdup_printf ("%s/grouplist", root_dir);
- CamelNNTPGroupList *list;
- FILE *fp;
- char buf[300];
- unsigned long time;
-
- g_free (root_dir);
- fp = fopen (grouplist_file, "r");
- g_free (grouplist_file);
-
- if (fp == NULL) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
- _("Unable to load grouplist file for %s: %s"),
- CAMEL_SERVICE(store)->url->host,
- strerror(errno));
- return NULL;
- }
-
- /* read the time */
- if (!fgets (buf, sizeof (buf), fp)) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
- _("Unable to load grouplist file for %s: %s"),
- CAMEL_SERVICE(store)->url->host,
- strerror(errno));
- fclose (fp);
- return NULL;
- }
-
-
- list = g_new0 (CamelNNTPGroupList, 1);
- list->store = store;
- sscanf (buf, "%lu", &time);
- list->time = time;
-
- while (fgets (buf, sizeof (buf), fp)) {
- CamelNNTPGroupListEntry *entry = g_new (CamelNNTPGroupListEntry, 1);
- char **split_line = g_strsplit (buf, " ", 4);
-
- entry->group_name = g_strdup (split_line[0]);
- entry->high = atoi (split_line[1]);
- entry->low = atoi (split_line[2]);
-
- g_strfreev (split_line);
-
- list->group_list = g_list_prepend (list->group_list, entry);
- }
-
- fclose (fp);
-
- list->group_list = g_list_reverse(list->group_list);
- return list;
-}
-
-static void
-save_entry (CamelNNTPGroupListEntry *entry, FILE *fp)
-{
- fprintf (fp, "%s %d %d\n", entry->group_name, entry->low, entry->high);
-}
-
-void
-camel_nntp_grouplist_save (CamelNNTPGroupList *group_list, CamelException *ex)
-{
- FILE *fp;
- gchar *root_dir = camel_nntp_store_get_toplevel_dir(CAMEL_NNTP_STORE(group_list->store));
- gchar *grouplist_file = g_strdup_printf ("%s/grouplist", root_dir);
-
- g_free (root_dir);
- fp = fopen (grouplist_file, "w");
- g_free (grouplist_file);
-
- if (fp == NULL) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
- _("Unable to save grouplist file for %s: %s"),
- CAMEL_SERVICE(group_list->store)->url->host,
- strerror(errno));
- return;
- }
-
- fprintf (fp, "%lu\n", (long)group_list->time);
-
- g_list_foreach (group_list->group_list, (GFunc)save_entry, fp);
-
- fclose (fp);
-}
-
-static void
-free_entry (CamelNNTPGroupListEntry *entry, void *data)
-{
- g_free (entry->group_name);
- g_free (entry);
-}
-
-void
-camel_nntp_grouplist_free (CamelNNTPGroupList *group_list)
-{
- g_return_if_fail (group_list);
-
- g_list_foreach (group_list->group_list, (GFunc)free_entry, NULL);
-
- g_free (group_list);
-}
-
-CamelNNTPGroupList*
-camel_nntp_grouplist_fetch (CamelNNTPStore *store, CamelException *ex)
-{
- CamelNNTPGroupList *list;
-
- list = camel_nntp_get_grouplist_from_file (store, ex);
-
- printf ("camel_nntp_get_grouplist_from_file returned %p\n", list);
-
- if (!list) {
- camel_exception_clear (ex);
-
- list = camel_nntp_get_grouplist_from_server (store, ex);
-
- if (!list) {
- camel_nntp_grouplist_free (list);
- }
- else {
- list->store = store;
- camel_nntp_grouplist_save (list, ex);
- return list;
- }
- }
-
- return list;
-}
-
-gint
-camel_nntp_grouplist_update (CamelNNTPGroupList *group_list, CamelException *ex)
-{
- return 0;
-}
diff --git a/camel/providers/nntp/camel-nntp-grouplist.h b/camel/providers/nntp/camel-nntp-grouplist.h
deleted file mode 100644
index edd1e64cb9..0000000000
--- a/camel/providers/nntp/camel-nntp-grouplist.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-nntp-grouplist.h : getting/updating the list of newsgroups on the server. */
-
-/*
- * Author : Chris Toshok <toshok@ximian.com>
- *
- * Copyright (C) 2000 Ximian .
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifndef CAMEL_NNTP_GROUPLIST_H
-#define CAMEL_NNTP_GROUPLIST_H 1
-
-#include <time.h>
-#include "camel-nntp-store.h"
-
-struct CamelNNTPGroupListEntry {
- char *group_name;
- guint32 low;
- guint32 high;
- guint32 flags;
-};
-
-struct CamelNNTPGroupList {
- CamelNNTPStore *store;
- time_t time;
- GList *group_list;
-};
-
-CamelNNTPGroupList* camel_nntp_grouplist_fetch (CamelNNTPStore *store, CamelException *ex);
-gint camel_nntp_grouplist_update (CamelNNTPGroupList *group_list, CamelException *ex);
-void camel_nntp_grouplist_save (CamelNNTPGroupList *group_list, CamelException *ex);
-void camel_nntp_grouplist_free (CamelNNTPGroupList *group_list);
-
-#endif /* CAMEL_NNTP_GROUPLIST_H */
diff --git a/camel/providers/nntp/camel-nntp-newsrc.c b/camel/providers/nntp/camel-nntp-newsrc.c
deleted file mode 100644
index 309e1f45c8..0000000000
--- a/camel/providers/nntp/camel-nntp-newsrc.c
+++ /dev/null
@@ -1,651 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Chris Toshok <toshok@ximian.com>
- *
- * Copyright 2000-2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <glib.h>
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <pthread.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-
-#include "camel-nntp-newsrc.h"
-#include <camel/camel-folder-summary.h>
-
-#define NEWSRC_LOCK(f, l) (g_mutex_lock(((CamelNNTPNewsrc *)f)->l))
-#define NEWSRC_UNLOCK(f, l) (g_mutex_unlock(((CamelNNTPNewsrc *)f)->l))
-
-typedef struct {
- guint low;
- guint high;
-} ArticleRange;
-
-typedef struct {
- char *name;
- GArray *ranges;
- gboolean subscribed;
-} NewsrcGroup;
-
-struct CamelNNTPNewsrc {
- gchar *filename;
- GHashTable *groups;
- gboolean dirty;
- GMutex *lock;
-};
-
-
-static NewsrcGroup *
-camel_nntp_newsrc_group_add (CamelNNTPNewsrc *newsrc, const char *group_name, gboolean subscribed)
-{
- NewsrcGroup *new_group = g_malloc(sizeof(NewsrcGroup));
-
- new_group->name = g_strdup(group_name);
- new_group->subscribed = subscribed;
- new_group->ranges = g_array_new (FALSE, FALSE, sizeof (ArticleRange));
-
- g_hash_table_insert (newsrc->groups, new_group->name, new_group);
-
- newsrc->dirty = TRUE;
-
- return new_group;
-}
-
-static int
-camel_nntp_newsrc_group_get_highest_article_read(CamelNNTPNewsrc *newsrc, NewsrcGroup *group)
-{
- if (!group || group->ranges->len == 0)
- return 0;
-
- return g_array_index(group->ranges, ArticleRange, group->ranges->len - 1).high;
-}
-
-static int
-camel_nntp_newsrc_group_get_num_articles_read(CamelNNTPNewsrc *newsrc, NewsrcGroup *group)
-{
- int i;
- int count = 0;
-
- if (group == NULL)
- return 0;
-
- for (i = 0; i < group->ranges->len; i ++)
- count += (g_array_index(group->ranges, ArticleRange, i).high -
- g_array_index(group->ranges, ArticleRange, i).low) + 1;
-
- return count;
-}
-
-
-static void
-camel_nntp_newsrc_group_mark_range_read(CamelNNTPNewsrc *newsrc, NewsrcGroup *group, long low, long high)
-{
- int i;
-
- if (group->ranges->len == 1
- && g_array_index (group->ranges, ArticleRange, 0).low == 0
- && g_array_index (group->ranges, ArticleRange, 0).high == 0) {
- g_array_index (group->ranges, ArticleRange, 0).low = low;
- g_array_index (group->ranges, ArticleRange, 0).high = high;
-
- newsrc->dirty = TRUE;
- }
- else {
- ArticleRange tmp_range;
-
- for (i = 0; i < group->ranges->len; i ++) {
- guint range_low = g_array_index (group->ranges, ArticleRange, i).low;
- guint range_high = g_array_index (group->ranges, ArticleRange, i).high;
-
- /* if it's already part of a range, return immediately. */
- if (low >= range_low &&
- low <= range_high &&
- high >= range_low &&
- high <= range_high) {
- return;
- }
- /* if we have a new lower bound for this range, set it. */
- else if (low <= range_low
- && high >= range_low
- && high <= range_high) {
- g_array_index (group->ranges, ArticleRange, i).low = low;
- newsrc->dirty = TRUE;
- return;
- }
- /* if we have a new upper bound for this range, set it. */
- else if (high >= range_high
- && low >= range_low
- && low <= range_high) {
- g_array_index (group->ranges, ArticleRange, i).high = high;
- newsrc->dirty = TRUE;
- return;
- }
- /* if we would be inserting another range that
- starts one index higher than an existing
- one, make the upper value of the existing
- range the upper value of the new one. */
- else if (low == range_high + 1) {
- g_array_index (group->ranges, ArticleRange, i).high = high;
- newsrc->dirty = TRUE;
- return;
- }
- /* if we would be inserting another range that
- ends one index lower than an existing one,
- group the existing range by setting its low
- to the new low */
- else if (high == range_low - 1) {
- g_array_index (group->ranges, ArticleRange, i).low = low;
- newsrc->dirty = TRUE;
- return;
- }
- /* if the range lies entirely outside another
- range, doesn't coincide with it's
- endpoints, and has lower values, insert it
- into the middle of the list. */
- else if (low < range_low
- && high < range_low) {
- tmp_range.low = low;
- tmp_range.high = high;
-
- group->ranges = g_array_insert_val (group->ranges, i, tmp_range);
- newsrc->dirty = TRUE;
-
- return;
- }
- }
-
- /* if we made it here, the range needs to go at the end */
- tmp_range.low = low;
- tmp_range.high = high;
- group->ranges = g_array_append_val (group->ranges, tmp_range);
- newsrc->dirty = TRUE;
- }
-}
-
-int
-camel_nntp_newsrc_get_highest_article_read (CamelNNTPNewsrc *newsrc, const char *group_name)
-{
- NewsrcGroup *group;
- int ret;
-
- NEWSRC_LOCK(newsrc, lock);
-
- group = g_hash_table_lookup (newsrc->groups, group_name);
-
- if (group)
- ret = camel_nntp_newsrc_group_get_highest_article_read (newsrc, group);
- else
- ret = 0;
-
- NEWSRC_UNLOCK(newsrc, lock);
-
- return ret;
-}
-
-int
-camel_nntp_newsrc_get_num_articles_read (CamelNNTPNewsrc *newsrc, const char *group_name)
-{
- NewsrcGroup *group;
- int ret;
-
- NEWSRC_LOCK(newsrc, lock);
-
- group = g_hash_table_lookup (newsrc->groups, group_name);
-
- if (group)
- ret = camel_nntp_newsrc_group_get_num_articles_read (newsrc, group);
- else
- ret = 0;
-
- NEWSRC_UNLOCK(newsrc, lock);
-
- return ret;
-}
-
-void
-camel_nntp_newsrc_mark_article_read (CamelNNTPNewsrc *newsrc, const char *group_name, int num)
-{
- camel_nntp_newsrc_mark_range_read (newsrc, group_name, num, num);
-}
-
-void
-camel_nntp_newsrc_mark_range_read(CamelNNTPNewsrc *newsrc, const char *group_name, long low, long high)
-{
- NewsrcGroup *group;
-
- /* swap them if they're in the wrong order. */
- if (low > high) {
- long tmp;
-
- tmp = high;
- high = low;
- low = tmp;
- }
-
- NEWSRC_LOCK(newsrc, lock);
- group = g_hash_table_lookup (newsrc->groups, group_name);
-
- if (group)
- camel_nntp_newsrc_group_mark_range_read (newsrc, group, low, high);
- NEWSRC_UNLOCK(newsrc, lock);
-}
-
-gboolean
-camel_nntp_newsrc_article_is_read (CamelNNTPNewsrc *newsrc, const char *group_name, long num)
-{
- int i;
- NewsrcGroup *group;
- int ret = FALSE;
-
- NEWSRC_LOCK(newsrc, lock);
- group = g_hash_table_lookup (newsrc->groups, group_name);
-
- if (group) {
- for (i = 0; i < group->ranges->len; i++) {
- if (num >= g_array_index (group->ranges, ArticleRange, i).low &&
- num <= g_array_index (group->ranges, ArticleRange, i).high) {
- ret = TRUE;
- break;
- }
- }
- }
-
- NEWSRC_UNLOCK(newsrc, lock);
-
- return FALSE;
-}
-
-gboolean
-camel_nntp_newsrc_group_is_subscribed (CamelNNTPNewsrc *newsrc, const char *group_name)
-{
- NewsrcGroup *group;
- int ret = FALSE;
-
- NEWSRC_LOCK(newsrc, lock);
-
- group = g_hash_table_lookup (newsrc->groups, group_name);
-
- if (group) {
- ret = group->subscribed;
- }
-
- NEWSRC_UNLOCK(newsrc, lock);
-
- return ret;
-}
-
-void
-camel_nntp_newsrc_subscribe_group (CamelNNTPNewsrc *newsrc, const char *group_name)
-{
- NewsrcGroup *group;
-
- NEWSRC_LOCK(newsrc, lock);
-
- group = g_hash_table_lookup (newsrc->groups, group_name);
-
- if (group) {
- if (!group->subscribed)
- newsrc->dirty = TRUE;
- group->subscribed = TRUE;
- }
- else {
- camel_nntp_newsrc_group_add (newsrc, group_name, TRUE);
- }
-
- NEWSRC_UNLOCK(newsrc, lock);
-}
-
-void
-camel_nntp_newsrc_unsubscribe_group (CamelNNTPNewsrc *newsrc, const char *group_name)
-{
- NewsrcGroup *group;
-
- NEWSRC_LOCK(newsrc, lock);
-
- group = g_hash_table_lookup (newsrc->groups, group_name);
- if (group) {
- if (group->subscribed)
- newsrc->dirty = TRUE;
- group->subscribed = FALSE;
- }
- else {
- camel_nntp_newsrc_group_add (newsrc, group_name, FALSE);
- }
-
- NEWSRC_UNLOCK(newsrc, lock);
-}
-
-struct newsrc_ptr_array {
- GPtrArray *ptr_array;
- gboolean subscribed_only;
-};
-
-/* this needs to strdup the grup_name, if the group array is likely to change */
-static void
-get_group_foreach (char *group_name, NewsrcGroup *group, struct newsrc_ptr_array *npa)
-{
- if (group->subscribed || !npa->subscribed_only) {
- g_ptr_array_add (npa->ptr_array, group_name);
- }
-}
-
-GPtrArray *
-camel_nntp_newsrc_get_subscribed_group_names (CamelNNTPNewsrc *newsrc)
-{
- struct newsrc_ptr_array npa;
-
- g_return_val_if_fail (newsrc, NULL);
-
- NEWSRC_LOCK(newsrc, lock);
-
- npa.ptr_array = g_ptr_array_new();
- npa.subscribed_only = TRUE;
-
- g_hash_table_foreach (newsrc->groups,
- (GHFunc)get_group_foreach, &npa);
-
- NEWSRC_UNLOCK(newsrc, lock);
-
- return npa.ptr_array;
-}
-
-GPtrArray *
-camel_nntp_newsrc_get_all_group_names (CamelNNTPNewsrc *newsrc)
-{
- struct newsrc_ptr_array npa;
-
- g_return_val_if_fail (newsrc, NULL);
-
- NEWSRC_LOCK(newsrc, lock);
-
- npa.ptr_array = g_ptr_array_new();
- npa.subscribed_only = FALSE;
-
- g_hash_table_foreach (newsrc->groups,
- (GHFunc)get_group_foreach, &npa);
-
- NEWSRC_UNLOCK(newsrc, lock);
-
- return npa.ptr_array;
-}
-
-void
-camel_nntp_newsrc_free_group_names (CamelNNTPNewsrc *newsrc, GPtrArray *group_names)
-{
- g_ptr_array_free (group_names, TRUE);
-}
-
-struct newsrc_fp {
- CamelNNTPNewsrc *newsrc;
- FILE *fp;
-};
-
-static void
-camel_nntp_newsrc_write_group_line(gpointer key, NewsrcGroup *group, struct newsrc_fp *newsrc_fp)
-{
- CamelNNTPNewsrc *newsrc;
- FILE *fp;
- int i;
-
- fp = newsrc_fp->fp;
- newsrc = newsrc_fp->newsrc;
-
- fprintf (fp, "%s%c", group->name, group->subscribed ? ':' : '!');
-
- if (group->ranges->len == 1
- && g_array_index (group->ranges, ArticleRange, 0).low == 0
- && g_array_index (group->ranges, ArticleRange, 0).high == 0) {
- fprintf (fp, "\n");
-
- return; /* special case since our parsing code will insert this
- bogus range if there were no read articles. The code
- to add a range is smart enough to remove this one if we
- ever mark an article read, but we still need to deal with
- it if that code doesn't get hit. */
- }
-
- fprintf (fp, " ");
-
- for (i = 0; i < group->ranges->len; i ++) {
- char range_buffer[100];
- guint low = g_array_index (group->ranges, ArticleRange, i).low;
- guint high = g_array_index (group->ranges, ArticleRange, i).high;
-
- if (low == high)
- sprintf(range_buffer, "%d", low);
- else if (low == high - 1)
- sprintf(range_buffer, "%d,%d", low, high);
- else
- sprintf(range_buffer, "%d-%d", low, high);
-
- if (i != group->ranges->len - 1)
- strcat(range_buffer, ",");
-
- fprintf (fp, range_buffer);
- }
-
- fprintf (fp, "\n");
-}
-
-void
-camel_nntp_newsrc_write_to_file(CamelNNTPNewsrc *newsrc, FILE *fp)
-{
- struct newsrc_fp newsrc_fp;
-
- g_return_if_fail (newsrc);
-
- newsrc_fp.newsrc = newsrc;
- newsrc_fp.fp = fp;
-
- NEWSRC_LOCK(newsrc, lock);
-
- g_hash_table_foreach (newsrc->groups,
- (GHFunc)camel_nntp_newsrc_write_group_line,
- &newsrc_fp);
-
- NEWSRC_UNLOCK(newsrc, lock);
-}
-
-void
-camel_nntp_newsrc_write(CamelNNTPNewsrc *newsrc)
-{
- FILE *fp;
-
- g_return_if_fail (newsrc);
-
- NEWSRC_LOCK(newsrc, lock);
-
- if (!newsrc->dirty) {
- NEWSRC_UNLOCK(newsrc, lock);
- return;
- }
-
- if ((fp = fopen(newsrc->filename, "w")) == NULL) {
- g_warning ("Couldn't open newsrc file '%s'.\n", newsrc->filename);
- NEWSRC_UNLOCK(newsrc, lock);
- return;
- }
-
- newsrc->dirty = FALSE;
- NEWSRC_UNLOCK(newsrc, lock);
-
- camel_nntp_newsrc_write_to_file(newsrc, fp);
-
- fclose(fp);
-}
-
-static void
-camel_nntp_newsrc_parse_line(CamelNNTPNewsrc *newsrc, char *line)
-{
- char *p, *comma, *dash;
- gboolean is_subscribed;
- NewsrcGroup *group;
-
- p = strchr(line, ':');
-
- if (p) {
- is_subscribed = TRUE;
- }
- else {
- p = strchr(line, '!');
- if (p)
- is_subscribed = FALSE;
- else
- return; /* bogus line. */
- }
-
- *p++ = '\0';
-
- group = camel_nntp_newsrc_group_add (newsrc, line, is_subscribed);
-
- do {
- guint high, low;
-
- comma = strchr(p, ',');
-
- if (comma)
- *comma = '\0';
-
- dash = strchr(p, '-');
-
- if (!dash) { /* there wasn't a dash. must be just one number */
- high = low = atol(p);
- }
- else { /* there was a dash. */
- *dash = '\0';
- low = atol(p);
- *dash = '-';
- p = dash + 1;
- high = atol(p);
- }
-
- camel_nntp_newsrc_group_mark_range_read (newsrc, group, low, high);
-
- if (comma) {
- *comma = ',';
- p = comma + 1;
- }
-
- } while(comma);
-}
-
-static char*
-get_line (char *buf, char **p)
-{
- char *l;
- char *line;
-
- g_assert (*p == NULL || **p == '\n' || **p == '\0');
-
- if (*p == NULL) {
- *p = buf;
-
- if (**p == '\0')
- return NULL;
- }
- else {
- if (**p == '\0')
- return NULL;
-
- (*p) ++;
-
- /* if we just incremented to the end of the buffer, return NULL */
- if (**p == '\0')
- return NULL;
- }
-
- l = strchr (*p, '\n');
- if (l) {
- *l = '\0';
- line = g_strdup (*p);
- *l = '\n';
- *p = l;
- }
- else {
- /* we're at the last line (which isn't terminated by a \n, btw) */
- line = g_strdup (*p);
- (*p) += strlen (*p);
- }
-
- return line;
-}
-
-CamelNNTPNewsrc *
-camel_nntp_newsrc_read_for_server (const char *server)
-{
- int fd;
- char buf[1024];
- char *file_contents, *line, *p;
- char *filename;
- CamelNNTPNewsrc *newsrc;
- int newsrc_len;
- int len_read = 0;
- struct stat sb;
-
- filename = g_strdup_printf ("%s/.newsrc-%s", g_get_home_dir(), server);
-
- newsrc = g_new0(CamelNNTPNewsrc, 1);
- newsrc->filename = filename;
- newsrc->groups = g_hash_table_new (g_str_hash, g_str_equal);
- newsrc->lock = g_mutex_new();
-
- if ((fd = open(filename, O_RDONLY)) == -1) {
- g_warning ("~/.newsrc-%s not present.\n", server);
- return newsrc;
- }
-
- if (fstat (fd, &sb) == -1) {
- g_warning ("failed fstat on ~/.newsrc-%s: %s\n", server, strerror(errno));
- return newsrc;
- }
- newsrc_len = sb.st_size;
-
- file_contents = g_malloc (newsrc_len + 1);
-
- while (len_read < newsrc_len) {
- int c = read (fd, buf, sizeof (buf));
-
- if (c == -1)
- break;
-
- memcpy (&file_contents[len_read], buf, c);
- len_read += c;
- }
- file_contents [len_read] = 0;
-
- p = NULL;
- while ((line = get_line (file_contents, &p))) {
- camel_nntp_newsrc_parse_line(newsrc, line);
- g_free (line);
- }
-
- close (fd);
- g_free (file_contents);
-
- return newsrc;
-}
diff --git a/camel/providers/nntp/camel-nntp-newsrc.h b/camel/providers/nntp/camel-nntp-newsrc.h
deleted file mode 100644
index 652e3edbce..0000000000
--- a/camel/providers/nntp/camel-nntp-newsrc.h
+++ /dev/null
@@ -1,34 +0,0 @@
-
-#ifndef _CAMEL_NNTP_NEWSRC_H_
-#define _CAMEL_NNTP_NEWSRC_H_
-
-#include <stdio.h>
-#include "glib.h"
-
-typedef struct CamelNNTPNewsrc CamelNNTPNewsrc;
-
-int camel_nntp_newsrc_get_highest_article_read (CamelNNTPNewsrc *newsrc, const char *group_name);
-int camel_nntp_newsrc_get_num_articles_read (CamelNNTPNewsrc *newsrc, const char *group_name);
-void camel_nntp_newsrc_mark_article_read (CamelNNTPNewsrc *newsrc,
- const char *group_name, int num);
-void camel_nntp_newsrc_mark_range_read (CamelNNTPNewsrc *newsrc,
- const char *group_name, long low, long high);
-
-gboolean camel_nntp_newsrc_article_is_read (CamelNNTPNewsrc *newsrc,
- const char *group_name, long num);
-
-gboolean camel_nntp_newsrc_group_is_subscribed (CamelNNTPNewsrc *newsrc, const char *group_name);
-void camel_nntp_newsrc_subscribe_group (CamelNNTPNewsrc *newsrc, const char *group_name);
-void camel_nntp_newsrc_unsubscribe_group (CamelNNTPNewsrc *newsrc, const char *group_name);
-
-GPtrArray* camel_nntp_newsrc_get_subscribed_group_names (CamelNNTPNewsrc *newsrc);
-GPtrArray* camel_nntp_newsrc_get_all_group_names (CamelNNTPNewsrc *newsrc);
-void camel_nntp_newsrc_free_group_names (CamelNNTPNewsrc *newsrc, GPtrArray *group_names);
-
-void camel_nntp_newsrc_write_to_file (CamelNNTPNewsrc *newsrc, FILE *fp);
-void camel_nntp_newsrc_write (CamelNNTPNewsrc *newsrc);
-CamelNNTPNewsrc *camel_nntp_newsrc_read_for_server (const char *server);
-
-#endif /* _CAMEL_NNTP_NEWSRC_H_ */
-
-
diff --git a/camel/providers/nntp/camel-nntp-private.h b/camel/providers/nntp/camel-nntp-private.h
deleted file mode 100644
index f2cca4e187..0000000000
--- a/camel/providers/nntp/camel-nntp-private.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- * camel-nntp-private.h: Private info for nntp.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifndef CAMEL_NNTP_PRIVATE_H
-#define CAMEL_NNTP_PRIVATE_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-/* need a way to configure and save this data, if this header is to
- be installed. For now, dont install it */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "e-util/e-msgport.h"
-
-struct _CamelNNTPStorePrivate {
- EMutex *command_lock; /* for locking the command stream for a complete operation */
-};
-
-#define CAMEL_NNTP_STORE_LOCK(f, l) (e_mutex_lock(((CamelNNTPStore *)f)->priv->l))
-#define CAMEL_NNTP_STORE_UNLOCK(f, l) (e_mutex_unlock(((CamelNNTPStore *)f)->priv->l))
-
-
-struct _CamelNNTPFolderPrivate {
- GMutex *search_lock; /* for locking the search object */
- GMutex *cache_lock; /* for locking the cache object */
-};
-
-#define CAMEL_NNTP_FOLDER_LOCK(f, l) (g_mutex_lock(((CamelNNTPFolder *)f)->priv->l))
-#define CAMEL_NNTP_FOLDER_UNLOCK(f, l) (g_mutex_unlock(((CamelNNTPFolder *)f)->priv->l))
-#else
-#define CAMEL_NNTP_FOLDER_LOCK(f, l)
-#define CAMEL_NNTP_FOLDER_UNLOCK(f, l)
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_NNTP_PRIVATE_H */
-
diff --git a/camel/providers/nntp/camel-nntp-provider.c b/camel/providers/nntp/camel-nntp-provider.c
deleted file mode 100644
index 8f54b3ee98..0000000000
--- a/camel/providers/nntp/camel-nntp-provider.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-nntp-provider.c: nntp provider registration code */
-
-/*
- * Authors :
- * Chris Toshok <toshok@ximian.com>
- *
- * Copyright (C) 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-#include "camel-nntp-store.h"
-#include "camel-provider.h"
-#include "camel-session.h"
-
-static void add_hash (guint *hash, char *s);
-static guint nntp_url_hash (gconstpointer key);
-static gint check_equal (char *s1, char *s2);
-static gint nntp_url_equal (gconstpointer a, gconstpointer b);
-
-static CamelProvider news_provider = {
- "nntp",
- N_("USENET news"),
-
- N_("This is a provider for reading from and posting to"
- "USENET newsgroups."),
-
- "news",
-
- CAMEL_PROVIDER_IS_REMOTE | CAMEL_PROVIDER_IS_SOURCE |
- CAMEL_PROVIDER_IS_STORAGE,
-
- CAMEL_URL_NEED_HOST | CAMEL_URL_ALLOW_USER |
- CAMEL_URL_ALLOW_PASSWORD | CAMEL_URL_ALLOW_AUTH,
-
- /* ... */
-};
-
-void
-camel_provider_module_init (CamelSession *session)
-{
- news_provider.object_types[CAMEL_PROVIDER_STORE] =
- camel_nntp_store_get_type();
-
- news_provider.url_hash = nntp_url_hash;
- news_provider.url_equal = nntp_url_equal;
-
- camel_session_register_provider (session, &news_provider);
-}
-
-static void
-add_hash (guint *hash, char *s)
-{
- if (s)
- *hash ^= g_str_hash(s);
-}
-
-static guint
-nntp_url_hash (gconstpointer key)
-{
- const CamelURL *u = (CamelURL *)key;
- guint hash = 0;
-
- add_hash (&hash, u->user);
- add_hash (&hash, u->host);
- hash ^= u->port;
-
- return hash;
-}
-
-static gint
-check_equal (char *s1, char *s2)
-{
- if (s1 == NULL) {
- if (s2 == NULL)
- return TRUE;
- else
- return FALSE;
- }
-
- if (s2 == NULL)
- return FALSE;
-
- return strcmp (s1, s2) == 0;
-}
-
-static gint
-nntp_url_equal (gconstpointer a, gconstpointer b)
-{
- const CamelURL *u1 = a, *u2 = b;
-
- return check_equal (u1->user, u2->user)
- && check_equal (u1->host, u2->host)
- && u1->port == u2->port;
-}
diff --git a/camel/providers/nntp/camel-nntp-resp-codes.h b/camel/providers/nntp/camel-nntp-resp-codes.h
deleted file mode 100644
index d9aace81ef..0000000000
--- a/camel/providers/nntp/camel-nntp-resp-codes.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-nntp-resp-codes.h : #defines for all the response codes we care about */
-
-/*
- *
- * Copyright (C) 2000 Ximian, Inc. <toshok@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifndef CAMEL_NNTP_RESP_CODES_H
-#define CAMEL_NNTP_RESP_CODES_H 1
-
-#define CAMEL_NNTP_OK(x) ((x) < 400)
-#define CAMEL_NNTP_ERR(x) (!CAMEL_NNTP_OK(x) && (x) < 500)
-#define CAMEL_NNTP_FAIL(x) (!CAMEL_NNTP_OK(x) && !CAMEL_NNTP_ERR(x))
-
-#define NNTP_GREETING_POSTING_OK 200
-#define NNTP_GREETING_NO_POSTING 201
-
-#define NNTP_EXTENSIONS_SUPPORTED 202
-#define NNTP_GROUP_SELECTED 211
-#define NNTP_LIST_FOLLOWS 215
-#define NNTP_ARTICLE_FOLLOWS 220
-#define NNTP_HEAD_FOLLOWS 221
-#define NNTP_DATA_FOLLOWS 224
-#define NNTP_NEW_ARTICLE_LIST_FOLLOWS 230
-#define NNTP_NEW_GROUP_LIST_FOLLOWS 231
-
-#define NNTP_NO_SUCH_GROUP 411
-#define NNTP_NO_SUCH_ARTICLE 430
-
-#define NNTP_NO_PERMISSION 502
-
-/* authentication */
-#define NNTP_AUTH_ACCEPTED 281
-#define NNTP_AUTH_CONTINUE 381
-#define NNTP_AUTH_REQUIRED 480
-#define NNTP_AUTH_REJECTED 482
-
-#define NNTP_PROTOCOL_ERROR 666
-
-#endif /* CAMEL_NNTP_RESP_CODES_H */
diff --git a/camel/providers/nntp/camel-nntp-store.c b/camel/providers/nntp/camel-nntp-store.c
deleted file mode 100644
index 531d4aefdf..0000000000
--- a/camel/providers/nntp/camel-nntp-store.c
+++ /dev/null
@@ -1,576 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- *
- * Copyright (C) 2001-2003 Ximian, Inc. <www.ximain.com>
- *
- * Authors: Christopher Toshok <toshok@ximian.com>
- * Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <dirent.h>
-#include <errno.h>
-
-#include <camel/camel-url.h>
-#include <camel/camel-string-utils.h>
-#include <camel/camel-session.h>
-#include <camel/camel-tcp-stream-raw.h>
-#include <camel/camel-tcp-stream-ssl.h>
-
-#include "camel-nntp-summary.h"
-#include "camel-nntp-store.h"
-#include "camel-nntp-folder.h"
-#include "camel-nntp-private.h"
-
-#define w(x)
-extern int camel_verbose_debug;
-#define dd(x) (camel_verbose_debug?(x):0)
-
-#define NNTP_PORT 119
-#define NNTPS_PORT 563
-
-#define DUMP_EXTENSIONS
-
-/* define if you want the subscribe ui to show folders in tree form */
-/* #define INFO_AS_TREE */
-
-static CamelStoreClass *parent_class = NULL;
-static CamelServiceClass *service_class = NULL;
-
-/* Returns the class for a CamelNNTPStore */
-#define CNNTPS_CLASS(so) CAMEL_NNTP_STORE_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-#define CF_CLASS(so) CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-#define CNNTPF_CLASS(so) CAMEL_NNTP_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-
-
-enum {
- USE_SSL_NEVER,
- USE_SSL_ALWAYS,
- USE_SSL_WHEN_POSSIBLE
-};
-
-static gboolean
-connect_to_server (CamelService *service, int ssl_mode, CamelException *ex)
-{
- CamelNNTPStore *store = (CamelNNTPStore *) service;
- CamelStream *tcp_stream;
- gboolean retval = FALSE;
- unsigned char *buf;
- unsigned int len;
- struct hostent *h;
- int port, ret;
-
- CAMEL_NNTP_STORE_LOCK(store, command_lock);
-
- /* setup store-wide cache */
- if (store->cache == NULL) {
- char *root;
-
- root = camel_session_get_storage_path (service->session, service, ex);
- if (root == NULL)
- goto fail;
-
- store->cache = camel_data_cache_new (root, 0, ex);
- g_free (root);
- if (store->cache == NULL)
- goto fail;
-
- /* Default cache expiry - 2 weeks old, or not visited in 5 days */
- camel_data_cache_set_expire_age (store->cache, 60*60*24*14);
- camel_data_cache_set_expire_access (store->cache, 60*60*24*5);
- }
-
- h = camel_service_gethost (service, ex);
- if (!h)
- goto fail;
-
- port = service->url->port ? service->url->port : NNTP_PORT;
-
-#ifdef HAVE_SSL
- if (ssl_mode != USE_SSL_NEVER) {
- port = service->url->port ? service->url->port : NNTPS_PORT;
- tcp_stream = camel_tcp_stream_ssl_new (service->session, service->url->host, CAMEL_TCP_STREAM_SSL_ENABLE_SSL2 | CAMEL_TCP_STREAM_SSL_ENABLE_SSL3);
- } else {
- tcp_stream = camel_tcp_stream_raw_new ();
- }
-#else
- tcp_stream = camel_tcp_stream_raw_new ();
-#endif /* HAVE_SSL */
-
- ret = camel_tcp_stream_connect (CAMEL_TCP_STREAM (tcp_stream), h, port);
- camel_free_host (h);
- if (ret == -1) {
- if (errno == EINTR)
- camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
- _("Connection cancelled"));
- else
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
- _("Could not connect to %s (port %d): %s"),
- service->url->host, port, g_strerror (errno));
-
- camel_object_unref (CAMEL_OBJECT (tcp_stream));
-
- goto fail;
- }
-
- store->stream = (CamelNNTPStream *) camel_nntp_stream_new (tcp_stream);
- camel_object_unref (CAMEL_OBJECT (tcp_stream));
-
- /* Read the greeting, if any. */
- if (camel_nntp_stream_line (store->stream, &buf, &len) == -1) {
- if (errno == EINTR)
- camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
- _("Connection cancelled"));
- else
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
- _("Could not read greeting from %s: %s"),
- service->url->host, g_strerror (errno));
-
- camel_object_unref (CAMEL_OBJECT (store->stream));
- store->stream = NULL;
-
- goto fail;
- }
-
- len = strtoul (buf, (char **) &buf, 10);
- if (len != 200 && len != 201) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("NNTP server %s returned error code %d: %s"),
- service->url->host, len, buf);
-
- camel_object_unref (CAMEL_OBJECT (store->stream));
- store->stream = NULL;
-
- goto fail;
- }
-
- /* set 'reader' mode & ignore return code */
- camel_nntp_command (store, (char **) &buf, "mode reader");
- retval = TRUE;
-
- fail:
- CAMEL_NNTP_STORE_UNLOCK(store, command_lock);
-
- return retval;
-}
-
-static struct {
- char *value;
- int mode;
-} ssl_options[] = {
- { "", USE_SSL_ALWAYS },
- { "always", USE_SSL_ALWAYS },
- { "when-possible", USE_SSL_WHEN_POSSIBLE },
- { "never", USE_SSL_NEVER },
- { NULL, USE_SSL_NEVER },
-};
-
-static gboolean
-nntp_connect (CamelService *service, CamelException *ex)
-{
-#ifdef HAVE_SSL
- const char *use_ssl;
- int i, ssl_mode;
-
- use_ssl = camel_url_get_param (service->url, "use_ssl");
- if (use_ssl) {
- for (i = 0; ssl_options[i].value; i++)
- if (!strcmp (ssl_options[i].value, use_ssl))
- break;
- ssl_mode = ssl_options[i].mode;
- } else
- ssl_mode = USE_SSL_NEVER;
-
- if (ssl_mode == USE_SSL_ALWAYS) {
- /* Connect via SSL */
- return connect_to_server (service, ssl_mode, ex);
- } else if (ssl_mode == USE_SSL_WHEN_POSSIBLE) {
- /* If the server supports SSL, use it */
- if (!connect_to_server (service, ssl_mode, ex)) {
- if (camel_exception_get_id (ex) == CAMEL_EXCEPTION_SERVICE_UNAVAILABLE) {
- /* The ssl port seems to be unavailable, fall back to plain NNTP */
- camel_exception_clear (ex);
- return connect_to_server (service, USE_SSL_NEVER, ex);
- } else {
- return FALSE;
- }
- }
-
- return TRUE;
- } else {
- /* User doesn't care about SSL */
- return connect_to_server (service, ssl_mode, ex);
- }
-#else
- return connect_to_server (service, USE_SSL_NEVER, ex);
-#endif
-}
-
-static gboolean
-nntp_disconnect (CamelService *service, gboolean clean, CamelException *ex)
-{
- CamelNNTPStore *store = CAMEL_NNTP_STORE (service);
- char *line;
-
- CAMEL_NNTP_STORE_LOCK(store, command_lock);
-
- if (clean)
- camel_nntp_command (store, &line, "quit");
-
- if (!service_class->disconnect (service, clean, ex))
- return FALSE;
-
- camel_object_unref((CamelObject *)store->stream);
- store->stream = NULL;
-
- CAMEL_NNTP_STORE_UNLOCK(store, command_lock);
-
- return TRUE;
-}
-
-static char *
-nntp_store_get_name (CamelService *service, gboolean brief)
-{
- if (brief)
- return g_strdup_printf ("%s", service->url->host);
- else
- return g_strdup_printf (_("USENET News via %s"), service->url->host);
-
-}
-
-static CamelServiceAuthType password_authtype = {
- N_("Password"),
-
- N_("This option will authenticate with the NNTP server using a "
- "plaintext password."),
-
- "",
- TRUE
-};
-
-static GList *
-nntp_store_query_auth_types (CamelService *service, CamelException *ex)
-{
- g_warning ("nntp::query_auth_types: not implemented. Defaulting.");
-
- return g_list_append (NULL, &password_authtype);
-}
-
-static CamelFolder *
-nntp_store_get_folder(CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex)
-{
- CamelNNTPStore *nntp_store = CAMEL_NNTP_STORE (store);
- CamelFolder *folder;
-
- CAMEL_NNTP_STORE_LOCK(nntp_store, command_lock);
-
- folder = camel_nntp_folder_new(store, folder_name, ex);
-
- CAMEL_NNTP_STORE_UNLOCK(nntp_store, command_lock);
-
- return folder;
-}
-
-static CamelFolderInfo *
-nntp_store_get_folder_info(CamelStore *store, const char *top, guint32 flags, CamelException *ex)
-{
- CamelURL *url = CAMEL_SERVICE (store)->url;
- CamelNNTPStore *nntp_store = (CamelNNTPStore *)store;
- CamelFolderInfo *groups = NULL, *last = NULL, *fi;
- unsigned int len;
- unsigned char *line, *space;
- int ret = -1;
-
- CAMEL_NNTP_STORE_LOCK(nntp_store, command_lock);
-
- ret = camel_nntp_command(nntp_store, (char **)&line, "list");
- if (ret != 215) {
- ret = -1;
- goto error;
- }
-
- while ( (ret = camel_nntp_stream_line(nntp_store->stream, &line, &len)) > 0) {
- space = strchr(line, ' ');
- if (space)
- *space = 0;
-
- if (top == NULL || top[0] == 0 || strcmp(top, line) == 0) {
- fi = g_malloc0(sizeof(*fi));
- fi->name = g_strdup(line);
- fi->full_name = g_strdup(line);
- if (url->user)
- fi->url = g_strdup_printf ("nntp://%s@%s/%s", url->user, url->host, line);
- else
- fi->url = g_strdup_printf ("nntp://%s/%s", url->host, line);
- fi->unread_message_count = -1;
- camel_folder_info_build_path(fi, '/');
-
- if (last)
- last->sibling = fi;
- else
- groups = fi;
- last = fi;
- }
- }
-
- if (ret < 0)
- goto error;
-
- CAMEL_NNTP_STORE_UNLOCK(nntp_store, command_lock);
-
- return groups;
-
-error:
- CAMEL_NNTP_STORE_UNLOCK(nntp_store, command_lock);
-
- if (groups)
- camel_store_free_folder_info(store, groups);
-
- return NULL;
-}
-
-static gboolean
-nntp_store_folder_subscribed (CamelStore *store, const char *folder_name)
-{
- CamelNNTPStore *nntp_store = CAMEL_NNTP_STORE (store);
-
- nntp_store = nntp_store;
-
- /* FIXME: implement */
-
- return TRUE;
-}
-
-static void
-nntp_store_subscribe_folder (CamelStore *store, const char *folder_name,
- CamelException *ex)
-{
- CamelNNTPStore *nntp_store = CAMEL_NNTP_STORE (store);
-
- nntp_store = nntp_store;
-
- /* FIXME: implement */
-}
-
-static void
-nntp_store_unsubscribe_folder (CamelStore *store, const char *folder_name,
- CamelException *ex)
-{
- CamelNNTPStore *nntp_store = CAMEL_NNTP_STORE (store);
-
- nntp_store = nntp_store;
-
- /* FIXME: implement */
-}
-
-static void
-nntp_store_finalise (CamelObject *object)
-{
- CamelNNTPStore *nntp_store = CAMEL_NNTP_STORE (object);
- struct _CamelNNTPStorePrivate *p = nntp_store->priv;
-
- camel_service_disconnect((CamelService *)object, TRUE, NULL);
-
- camel_object_unref((CamelObject *)nntp_store->mem);
- nntp_store->mem = NULL;
- if (nntp_store->stream)
- camel_object_unref((CamelObject *)nntp_store->stream);
-
- e_mutex_destroy(p->command_lock);
-
- g_free(p);
-}
-
-static void
-nntp_store_class_init (CamelNNTPStoreClass *camel_nntp_store_class)
-{
- CamelStoreClass *camel_store_class = CAMEL_STORE_CLASS (camel_nntp_store_class);
- CamelServiceClass *camel_service_class = CAMEL_SERVICE_CLASS (camel_nntp_store_class);
-
- parent_class = CAMEL_STORE_CLASS (camel_type_get_global_classfuncs (camel_store_get_type ()));
-
- service_class = CAMEL_SERVICE_CLASS (camel_type_get_global_classfuncs (camel_service_get_type ()));
-
- /* virtual method overload */
- camel_service_class->connect = nntp_connect;
- camel_service_class->disconnect = nntp_disconnect;
- camel_service_class->query_auth_types = nntp_store_query_auth_types;
- camel_service_class->get_name = nntp_store_get_name;
-
- camel_store_class->get_folder = nntp_store_get_folder;
- camel_store_class->get_folder_info = nntp_store_get_folder_info;
- camel_store_class->free_folder_info = camel_store_free_folder_info_full;
-
- camel_store_class->folder_subscribed = nntp_store_folder_subscribed;
- camel_store_class->subscribe_folder = nntp_store_subscribe_folder;
- camel_store_class->unsubscribe_folder = nntp_store_unsubscribe_folder;
-}
-
-static void
-nntp_store_init (gpointer object, gpointer klass)
-{
- CamelNNTPStore *nntp_store = CAMEL_NNTP_STORE(object);
- CamelStore *store = CAMEL_STORE (object);
- struct _CamelNNTPStorePrivate *p;
-
- store->flags = CAMEL_STORE_SUBSCRIPTIONS;
-
- nntp_store->mem = (CamelStreamMem *)camel_stream_mem_new();
-
- p = nntp_store->priv = g_malloc0(sizeof(*p));
- p->command_lock = e_mutex_new(E_MUTEX_REC);
-}
-
-CamelType
-camel_nntp_store_get_type (void)
-{
- static CamelType camel_nntp_store_type = CAMEL_INVALID_TYPE;
-
- if (camel_nntp_store_type == CAMEL_INVALID_TYPE) {
- camel_nntp_store_type =
- camel_type_register (CAMEL_STORE_TYPE,
- "CamelNNTPStore",
- sizeof (CamelNNTPStore),
- sizeof (CamelNNTPStoreClass),
- (CamelObjectClassInitFunc) nntp_store_class_init,
- NULL,
- (CamelObjectInitFunc) nntp_store_init,
- (CamelObjectFinalizeFunc) nntp_store_finalise);
- }
-
- return camel_nntp_store_type;
-}
-
-/* enter owning lock */
-int
-camel_nntp_store_set_folder (CamelNNTPStore *store, CamelFolder *folder, CamelFolderChangeInfo *changes, CamelException *ex)
-{
- int ret;
-
- if (store->current_folder && strcmp(folder->full_name, store->current_folder) == 0)
- return 0;
-
- /* FIXME: Do something with changeinfo */
- ret = camel_nntp_summary_check((CamelNNTPSummary *)folder->summary, changes, ex);
-
- g_free(store->current_folder);
- store->current_folder = g_strdup(folder->full_name);
-
- return ret;
-}
-
-static gboolean
-nntp_connected (CamelNNTPStore *store, CamelException *ex)
-{
- if (store->stream == NULL)
- return camel_service_connect (CAMEL_SERVICE (store), ex);
- return TRUE;
-}
-
-/* Enter owning lock */
-int
-camel_nntp_command(CamelNNTPStore *store, char **line, const char *fmt, ...)
-{
- const unsigned char *p, *ps;
- unsigned char c;
- va_list ap;
- char *s;
- int d;
- unsigned int u, u2;
-
- e_mutex_assert_locked(store->priv->command_lock);
-
- if (!nntp_connected (store, NULL))
- return -1;
-
- /* Check for unprocessed data, ! */
- if (store->stream->mode == CAMEL_NNTP_STREAM_DATA) {
- g_warning("Unprocessed data left in stream, flushing");
- while (camel_nntp_stream_getd(store->stream, (unsigned char **)&p, &u) > 0)
- ;
- }
- camel_nntp_stream_set_mode(store->stream, CAMEL_NNTP_STREAM_LINE);
-
- va_start(ap, fmt);
- ps = p = fmt;
- while ( (c = *p++) ) {
- switch (c) {
- case '%':
- c = *p++;
- camel_stream_write((CamelStream *)store->mem, ps, p-ps-(c=='%'?1:2));
- ps = p;
- switch (c) {
- case 's':
- s = va_arg(ap, char *);
- camel_stream_write((CamelStream *)store->mem, s, strlen(s));
- break;
- case 'd':
- d = va_arg(ap, int);
- camel_stream_printf((CamelStream *)store->mem, "%d", d);
- break;
- case 'u':
- u = va_arg(ap, unsigned int);
- camel_stream_printf((CamelStream *)store->mem, "%u", u);
- break;
- case 'm':
- s = va_arg(ap, char *);
- camel_stream_printf((CamelStream *)store->mem, "<%s>", s);
- break;
- case 'r':
- u = va_arg(ap, unsigned int);
- u2 = va_arg(ap, unsigned int);
- if (u == u2)
- camel_stream_printf((CamelStream *)store->mem, "%u", u);
- else
- camel_stream_printf((CamelStream *)store->mem, "%u-%u", u, u2);
- break;
- default:
- g_warning("Passing unknown format to nntp_command: %c\n", c);
- g_assert(0);
- }
- }
- }
-
- camel_stream_write((CamelStream *)store->mem, ps, p-ps-1);
- dd(printf("NNTP_COMMAND: '%.*s'\n", (int)store->mem->buffer->len, store->mem->buffer->data));
- camel_stream_write((CamelStream *)store->mem, "\r\n", 2);
- camel_stream_write((CamelStream *)store->stream, store->mem->buffer->data, store->mem->buffer->len);
- camel_stream_reset((CamelStream *)store->mem);
- /* FIXME: hack */
- g_byte_array_set_size(store->mem->buffer, 0);
-
- if (camel_nntp_stream_line(store->stream, (unsigned char **)line, &u) == -1)
- return -1;
-
- u = strtoul(*line, NULL, 10);
-
- /* Handle all switching to data mode here, to make callers job easier */
- if (u == 215 || (u >= 220 && u <=224) || (u >= 230 && u <= 231))
- camel_nntp_stream_set_mode(store->stream, CAMEL_NNTP_STREAM_DATA);
-
- return u;
-}
-
diff --git a/camel/providers/nntp/camel-nntp-store.h b/camel/providers/nntp/camel-nntp-store.h
deleted file mode 100644
index a201c2cea2..0000000000
--- a/camel/providers/nntp/camel-nntp-store.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-nntp-store.h : class for an nntp store */
-
-/*
- *
- * Copyright (C) 2000 Ximian, Inc. <toshok@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifndef CAMEL_NNTP_STORE_H
-#define CAMEL_NNTP_STORE_H 1
-
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#include <camel/camel-store.h>
-#include <camel/camel-stream-mem.h>
-#include <camel/camel-data-cache.h>
-#include <camel/camel-exception.h>
-#include <camel/camel-folder.h>
-
-#include "camel-nntp-stream.h"
-
-#define CAMEL_NNTP_STORE_TYPE (camel_nntp_store_get_type ())
-#define CAMEL_NNTP_STORE(obj) (CAMEL_CHECK_CAST((obj), CAMEL_NNTP_STORE_TYPE, CamelNNTPStore))
-#define CAMEL_NNTP_STORE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_NNTP_STORE_TYPE, CamelNNTPStoreClass))
-#define CAMEL_IS_NNTP_STORE(o) (CAMEL_CHECK_TYPE((o), CAMEL_NNTP_STORE_TYPE))
-
-#define CAMEL_NNTP_EXT_SEARCH (1<<0)
-#define CAMEL_NNTP_EXT_SETGET (1<<1)
-#define CAMEL_NNTP_EXT_OVER (1<<2)
-#define CAMEL_NNTP_EXT_XPATTEXT (1<<3)
-#define CAMEL_NNTP_EXT_XACTIVE (1<<4)
-#define CAMEL_NNTP_EXT_LISTMOTD (1<<5)
-#define CAMEL_NNTP_EXT_LISTSUBSCR (1<<6)
-#define CAMEL_NNTP_EXT_LISTPNAMES (1<<7)
-
-typedef struct _CamelNNTPStore CamelNNTPStore;
-typedef struct _CamelNNTPStoreClass CamelNNTPStoreClass;
-
-struct _CamelNNTPStore {
- CamelStore parent_object;
-
- struct _CamelNNTPStorePrivate *priv;
-
- guint32 extensions;
-
- gboolean posting_allowed;
-
- CamelNNTPStream *stream;
- CamelStreamMem *mem;
-
- CamelDataCache *cache;
-
- char *current_folder;
-};
-
-struct _CamelNNTPStoreClass {
- CamelStoreClass parent_class;
-
-};
-
-/* Standard Camel function */
-CamelType camel_nntp_store_get_type (void);
-
-int camel_nntp_command(CamelNNTPStore *store, char **line, const char *fmt, ...);
-int camel_nntp_store_set_folder(CamelNNTPStore *store, CamelFolder *folder, CamelFolderChangeInfo *changes, CamelException *ex);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_NNTP_STORE_H */
-
-
diff --git a/camel/providers/nntp/camel-nntp-stream.c b/camel/providers/nntp/camel-nntp-stream.c
deleted file mode 100644
index 1e2dcb23f9..0000000000
--- a/camel/providers/nntp/camel-nntp-stream.c
+++ /dev/null
@@ -1,462 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; fill-column: 160 -*-
- *
- * Author:
- * Michael Zucchi <notzed@ximian.com>
- *
- * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <errno.h>
-
-#include <string.h>
-#include <stdio.h>
-
-#include <glib.h>
-
-#include "camel-nntp-stream.h"
-
-extern int camel_verbose_debug;
-#define dd(x) (camel_verbose_debug?(x):0)
-
-static CamelObjectClass *parent_class = NULL;
-
-/* Returns the class for a CamelStream */
-#define CS_CLASS(so) CAMEL_NNTP_STREAM_CLASS(CAMEL_OBJECT_GET_CLASS(so))
-
-#define CAMEL_NNTP_STREAM_SIZE (4096)
-#define CAMEL_NNTP_STREAM_LINE (1024) /* maximum line size */
-
-static int
-stream_fill(CamelNNTPStream *is)
-{
- int left = 0;
-
- if (is->source) {
- left = is->end - is->ptr;
- memcpy(is->buf, is->ptr, left);
- is->end = is->buf + left;
- is->ptr = is->buf;
- left = camel_stream_read(is->source, is->end, CAMEL_NNTP_STREAM_SIZE - (is->end - is->buf));
- if (left > 0) {
- is->end += left;
- is->end[0] = '\n';
- return is->end - is->ptr;
- } else {
- dd(printf("NNTP_STREAM_FILL(ERROR): '%s'\n", strerror(errno)));
- return -1;
- }
- }
-
- return 0;
-}
-
-static ssize_t
-stream_read(CamelStream *stream, char *buffer, size_t n)
-{
- CamelNNTPStream *is = (CamelNNTPStream *)stream;
- char *o, *oe;
- unsigned char *p, *e, c;
- int state;
-
- if (is->mode != CAMEL_NNTP_STREAM_DATA || n == 0)
- return 0;
-
- o = buffer;
- oe = buffer + n;
- state = is->state;
-
- /* Need to copy/strip '.'s and whatnot */
- p = is->ptr;
- e = is->end;
-
- switch(state) {
- state_0:
- case 0: /* start of line, always read at least 3 chars */
- while (e - p < 3) {
- is->ptr = p;
- if (stream_fill(is) == -1)
- return -1;
- p = is->ptr;
- e = is->end;
- }
- if (p[0] == '.') {
- if (p[1] == '\r' && p[2] == '\n') {
- is->ptr = p+3;
- is->mode = CAMEL_NNTP_STREAM_EOD;
- is->state = 0;
- dd(printf("NNTP_STREAM_READ(%d):\n%.*s\n", o-buffer, o-buffer, buffer));
- return o-buffer;
- }
- p++;
- }
- state = 1;
- /* FALLS THROUGH */
- case 1: /* looking for next sol */
- while (o < oe) {
- c = *p++;
- if (c == '\n') {
- /* end of input sentinal check */
- if (p > e) {
- is->ptr = e;
- if (stream_fill(is) == -1)
- return -1;
- p = is->ptr;
- e = is->end;
- } else {
- *o++ = '\n';
- state = 0;
- goto state_0;
- }
- } else if (c != '\r') {
- *o++ = c;
- }
- }
- break;
- }
-
- is->ptr = p;
- is->state = state;
-
- dd(printf("NNTP_STREAM_READ(%d):\n%.*s\n", o-buffer, o-buffer, buffer));
-
- return o-buffer;
-}
-
-static ssize_t
-stream_write(CamelStream *stream, const char *buffer, size_t n)
-{
- CamelNNTPStream *is = (CamelNNTPStream *)stream;
-
- return camel_stream_write(is->source, buffer, n);
-}
-
-static int
-stream_close(CamelStream *stream)
-{
- /* nop? */
- return 0;
-}
-
-static int
-stream_flush(CamelStream *stream)
-{
- /* nop? */
- return 0;
-}
-
-static gboolean
-stream_eos(CamelStream *stream)
-{
- CamelNNTPStream *is = (CamelNNTPStream *)stream;
-
- return is->mode != CAMEL_NNTP_STREAM_DATA;
-}
-
-static int
-stream_reset(CamelStream *stream)
-{
- /* nop? reset literal mode? */
- return 0;
-}
-
-static void
-camel_nntp_stream_class_init (CamelStreamClass *camel_nntp_stream_class)
-{
- CamelStreamClass *camel_stream_class = (CamelStreamClass *)camel_nntp_stream_class;
-
- parent_class = camel_type_get_global_classfuncs( CAMEL_OBJECT_TYPE );
-
- /* virtual method definition */
- camel_stream_class->read = stream_read;
- camel_stream_class->write = stream_write;
- camel_stream_class->close = stream_close;
- camel_stream_class->flush = stream_flush;
- camel_stream_class->eos = stream_eos;
- camel_stream_class->reset = stream_reset;
-}
-
-static void
-camel_nntp_stream_init(CamelNNTPStream *is, CamelNNTPStreamClass *isclass)
-{
- /* +1 is room for appending a 0 if we need to for a line */
- is->ptr = is->end = is->buf = g_malloc(CAMEL_NNTP_STREAM_SIZE+1);
- is->lineptr = is->linebuf = g_malloc(CAMEL_NNTP_STREAM_LINE+1);
- is->lineend = is->linebuf + CAMEL_NNTP_STREAM_LINE;
-
- /* init sentinal */
- is->ptr[0] = '\n';
-
- is->state = 0;
- is->mode = CAMEL_NNTP_STREAM_LINE;
-}
-
-static void
-camel_nntp_stream_finalise(CamelNNTPStream *is)
-{
- g_free(is->buf);
- g_free(is->linebuf);
- if (is->source)
- camel_object_unref((CamelObject *)is->source);
-}
-
-CamelType
-camel_nntp_stream_get_type (void)
-{
- static CamelType camel_nntp_stream_type = CAMEL_INVALID_TYPE;
-
- if (camel_nntp_stream_type == CAMEL_INVALID_TYPE) {
- camel_nntp_stream_type = camel_type_register( camel_stream_get_type(),
- "CamelNNTPStream",
- sizeof( CamelNNTPStream ),
- sizeof( CamelNNTPStreamClass ),
- (CamelObjectClassInitFunc) camel_nntp_stream_class_init,
- NULL,
- (CamelObjectInitFunc) camel_nntp_stream_init,
- (CamelObjectFinalizeFunc) camel_nntp_stream_finalise );
- }
-
- return camel_nntp_stream_type;
-}
-
-/**
- * camel_nntp_stream_new:
- *
- * Returns a NULL stream. A null stream is always at eof, and
- * always returns success for all reads and writes.
- *
- * Return value: the stream
- **/
-CamelStream *
-camel_nntp_stream_new(CamelStream *source)
-{
- CamelNNTPStream *is;
-
- is = (CamelNNTPStream *)camel_object_new(camel_nntp_stream_get_type ());
- camel_object_ref((CamelObject *)source);
- is->source = source;
-
- return (CamelStream *)is;
-}
-
-/* Get one line from the nntp stream */
-int
-camel_nntp_stream_line(CamelNNTPStream *is, unsigned char **data, unsigned int *len)
-{
- register unsigned char c, *p, *o, *oe;
- int newlen, oldlen;
- unsigned char *e;
-
- if (is->mode == CAMEL_NNTP_STREAM_EOD) {
- *data = is->linebuf;
- *len = 0;
- return 0;
- }
-
- o = is->linebuf;
- oe = is->lineend - 1;
- p = is->ptr;
- e = is->end;
-
- /* Data mode, convert leading '..' to '.', and stop when we reach a solitary '.' */
- if (is->mode == CAMEL_NNTP_STREAM_DATA) {
- /* need at least 3 chars in buffer */
- while (e-p < 3) {
- is->ptr = p;
- if (stream_fill(is) == -1)
- return -1;
- p = is->ptr;
- e = is->end;
- }
-
- /* check for isolated '.\r\n' or begging of line '.' */
- if (p[0] == '.') {
- if (p[1] == '\r' && p[2] == '\n') {
- is->ptr = p+3;
- is->mode = CAMEL_NNTP_STREAM_EOD;
- *data = is->linebuf;
- *len = 0;
- is->linebuf[0] = 0;
-
- dd(printf("NNTP_STREAM_LINE(END)\n"));
-
- return 0;
- }
- p++;
- }
- }
-
- while (1) {
- while (o < oe) {
- c = *p++;
- if (c == '\n') {
- /* sentinal? */
- if (p> e) {
- is->ptr = e;
- if (stream_fill(is) == -1)
- return -1;
- p = is->ptr;
- e = is->end;
- } else {
- is->ptr = p;
- *data = is->linebuf;
- *len = o - is->linebuf;
- *o = 0;
-
- dd(printf("NNTP_STREAM_LINE(%d): '%s'\n", *len, *data));
-
- return 1;
- }
- } else if (c != '\r') {
- *o++ = c;
- }
- }
-
- /* limit this for bad server data? */
- oldlen = o - is->linebuf;
- newlen = (is->lineend - is->linebuf) * 3 / 2;
- is->lineptr = is->linebuf = g_realloc(is->linebuf, newlen);
- is->lineend = is->linebuf + newlen;
- oe = is->lineend - 1;
- o = is->linebuf + oldlen;
- }
-
- return -1;
-}
-
-/* returns -1 on error, 0 if last lot of data, >0 if more remaining */
-int camel_nntp_stream_gets(CamelNNTPStream *is, unsigned char **start, unsigned int *len)
-{
- int max;
- unsigned char *end;
-
- *len = 0;
-
- max = is->end - is->ptr;
- if (max == 0) {
- max = stream_fill(is);
- if (max <= 0)
- return max;
- }
-
- *start = is->ptr;
- end = memchr(is->ptr, '\n', max);
- if (end)
- max = (end - is->ptr) + 1;
- *start = is->ptr;
- *len = max;
- is->ptr += max;
-
- dd(printf("NNTP_STREAM_GETS(%s,%d): '%.*s'\n", end==NULL?"more":"last", *len, (int)*len, *start));
-
- return end == NULL?1:0;
-}
-
-void camel_nntp_stream_set_mode(CamelNNTPStream *is, camel_nntp_stream_mode_t mode)
-{
- is->mode = mode;
-}
-
-/* returns -1 on erorr, 0 if last data, >0 if more data left */
-int camel_nntp_stream_getd(CamelNNTPStream *is, unsigned char **start, unsigned int *len)
-{
- unsigned char *p, *e, *s;
- int state;
-
- *len = 0;
-
- if (is->mode == CAMEL_NNTP_STREAM_EOD)
- return 0;
-
- if (is->mode == CAMEL_NNTP_STREAM_LINE) {
- g_warning("nntp_stream reading data in line mode\n");
- return 0;
- }
-
- state = is->state;
- p = is->ptr;
- e = is->end;
-
- while (e - p < 3) {
- is->ptr = p;
- if (stream_fill(is) == -1)
- return -1;
- p = is->ptr;
- e = is->end;
- }
-
- s = p;
-
- do {
- switch(state) {
- case 0:
- /* check leading '.', ... */
- if (p[0] == '.') {
- if (p[1] == '\r' && p[2] == '\n') {
- is->ptr = p+3;
- *len = p-s;
- *start = s;
- is->mode = CAMEL_NNTP_STREAM_EOD;
- is->state = 0;
-
- dd(printf("NNTP_STREAM_GETD(%s,%d): '%.*s'\n", "last", *len, (int)*len, *start));
-
- return 0;
- }
-
- /* If at start, just skip '.', else return data upto '.' but skip it */
- if (p == s) {
- s++;
- p++;
- } else {
- is->ptr = p+1;
- *len = p-s;
- *start = s;
- is->state = 1;
-
- dd(printf("NNTP_STREAM_GETD(%s,%d): '%.*s'\n", "more", *len, (int)*len, *start));
-
- return 1;
- }
- }
- state = 1;
- case 1:
- /* Scan for sentinal */
- while ((*p++)!='\n')
- ;
-
- if (p > e) {
- p = e;
- } else {
- state = 0;
- }
- break;
- }
- } while ((e-p) >= 3);
-
- is->state = state;
- is->ptr = p;
- *len = p-s;
- *start = s;
-
- dd(printf("NNTP_STREAM_GETD(%s,%d): '%.*s'\n", "more", *len, (int)*len, *start));
- return 1;
-}
-
diff --git a/camel/providers/nntp/camel-nntp-stream.h b/camel/providers/nntp/camel-nntp-stream.h
deleted file mode 100644
index eef217cef2..0000000000
--- a/camel/providers/nntp/camel-nntp-stream.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (C) 2001 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef _CAMEL_NNTP_STREAM_H
-#define _CAMEL_NNTP_STREAM_H
-
-#include <camel/camel-stream.h>
-
-#define CAMEL_NNTP_STREAM(obj) CAMEL_CHECK_CAST (obj, camel_nntp_stream_get_type (), CamelNNTPStream)
-#define CAMEL_NNTP_STREAM_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_nntp_stream_get_type (), CamelNNTPStreamClass)
-#define CAMEL_IS_NNTP_STREAM(obj) CAMEL_CHECK_TYPE (obj, camel_nntp_stream_get_type ())
-
-typedef struct _CamelNNTPStreamClass CamelNNTPStreamClass;
-typedef struct _CamelNNTPStream CamelNNTPStream;
-
-typedef enum {
- CAMEL_NNTP_STREAM_LINE,
- CAMEL_NNTP_STREAM_DATA,
- CAMEL_NNTP_STREAM_EOD, /* end of data, acts as if end of stream */
-} camel_nntp_stream_mode_t;
-
-struct _CamelNNTPStream {
- CamelStream parent;
-
- CamelStream *source;
-
- camel_nntp_stream_mode_t mode;
- int state;
-
- unsigned char *buf, *ptr, *end;
- unsigned char *linebuf, *lineptr, *lineend;
-};
-
-struct _CamelNNTPStreamClass {
- CamelStreamClass parent_class;
-};
-
-CamelType camel_nntp_stream_get_type (void);
-
-CamelStream *camel_nntp_stream_new (CamelStream *source);
-
-
-void camel_nntp_stream_set_mode (CamelNNTPStream *is, camel_nntp_stream_mode_t mode);
-
-int camel_nntp_stream_line (CamelNNTPStream *is, unsigned char **data, unsigned int *len);
-int camel_nntp_stream_gets (CamelNNTPStream *is, unsigned char **start, unsigned int *len);
-int camel_nntp_stream_getd (CamelNNTPStream *is, unsigned char **start, unsigned int *len);
-
-#endif /* ! _CAMEL_NNTP_STREAM_H */
diff --git a/camel/providers/nntp/camel-nntp-summary.c b/camel/providers/nntp/camel-nntp-summary.c
deleted file mode 100644
index 2a9669d697..0000000000
--- a/camel/providers/nntp/camel-nntp-summary.c
+++ /dev/null
@@ -1,584 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; fill-column: 160 -*- */
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <ctype.h>
-#include <sys/stat.h>
-#include <sys/uio.h>
-#include <unistd.h>
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include "camel/camel-file-utils.h"
-#include "camel/camel-mime-message.h"
-#include "camel/camel-stream-null.h"
-#include "camel/camel-operation.h"
-#include "camel/camel-data-cache.h"
-
-#include "camel-nntp-summary.h"
-#include "camel-nntp-folder.h"
-#include "camel-nntp-store.h"
-#include "camel-nntp-stream.h"
-
-#define w(x)
-#define io(x)
-#define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))*/
-extern int camel_verbose_debug;
-#define dd(x) (camel_verbose_debug?(x):0)
-
-#define CAMEL_NNTP_SUMMARY_VERSION (0x200)
-
-static int xover_setup(CamelNNTPSummary *cns, CamelException *ex);
-static int add_range_xover(CamelNNTPSummary *cns, unsigned int high, unsigned int low, CamelFolderChangeInfo *changes, CamelException *ex);
-static int add_range_head(CamelNNTPSummary *cns, unsigned int high, unsigned int low, CamelFolderChangeInfo *changes, CamelException *ex);
-
-enum _xover_t {
- XOVER_STRING = 0,
- XOVER_MSGID,
- XOVER_SIZE,
-};
-
-struct _xover_header {
- struct _xover_header *next;
-
- const char *name;
- unsigned int skip:8;
- enum _xover_t type:8;
-};
-
-struct _CamelNNTPSummaryPrivate {
- char *uid;
-
- struct _xover_header *xover; /* xoverview format */
- int xover_setup;
-};
-
-#define _PRIVATE(o) (((CamelNNTPSummary *)(o))->priv)
-
-static CamelMessageInfo * message_info_new (CamelFolderSummary *, struct _camel_header_raw *);
-static int summary_header_load(CamelFolderSummary *, FILE *);
-static int summary_header_save(CamelFolderSummary *, FILE *);
-
-static void camel_nntp_summary_class_init (CamelNNTPSummaryClass *klass);
-static void camel_nntp_summary_init (CamelNNTPSummary *obj);
-static void camel_nntp_summary_finalise (CamelObject *obj);
-static CamelFolderSummaryClass *camel_nntp_summary_parent;
-
-CamelType
-camel_nntp_summary_get_type(void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register(camel_folder_summary_get_type(), "CamelNNTPSummary",
- sizeof (CamelNNTPSummary),
- sizeof (CamelNNTPSummaryClass),
- (CamelObjectClassInitFunc) camel_nntp_summary_class_init,
- NULL,
- (CamelObjectInitFunc) camel_nntp_summary_init,
- (CamelObjectFinalizeFunc) camel_nntp_summary_finalise);
- }
-
- return type;
-}
-
-static void
-camel_nntp_summary_class_init(CamelNNTPSummaryClass *klass)
-{
- CamelFolderSummaryClass *sklass = (CamelFolderSummaryClass *) klass;
-
- camel_nntp_summary_parent = CAMEL_FOLDER_SUMMARY_CLASS(camel_type_get_global_classfuncs(camel_folder_summary_get_type()));
-
- sklass->message_info_new = message_info_new;
- sklass->summary_header_load = summary_header_load;
- sklass->summary_header_save = summary_header_save;
-}
-
-static void
-camel_nntp_summary_init(CamelNNTPSummary *obj)
-{
- struct _CamelNNTPSummaryPrivate *p;
- struct _CamelFolderSummary *s = (CamelFolderSummary *)obj;
-
- p = _PRIVATE(obj) = g_malloc0(sizeof(*p));
-
- /* subclasses need to set the right instance data sizes */
- s->message_info_size = sizeof(CamelMessageInfo);
- s->content_info_size = sizeof(CamelMessageContentInfo);
-
- /* and a unique file version */
- s->version += CAMEL_NNTP_SUMMARY_VERSION;
-}
-
-static void
-camel_nntp_summary_finalise(CamelObject *obj)
-{
- CamelNNTPSummary *cns = CAMEL_NNTP_SUMMARY(obj);
- struct _xover_header *xover, *xn;
-
- xover = cns->priv->xover;
- while (xover) {
- xn = xover->next;
- g_free(xover);
- xover = xn;
- }
-
- g_free(cns->priv);
-}
-
-CamelNNTPSummary *
-camel_nntp_summary_new(CamelNNTPFolder *folder)
-{
- CamelNNTPSummary *cns = (CamelNNTPSummary *)camel_object_new(camel_nntp_summary_get_type());
- char *path;
-
- cns->folder = folder;
- path = g_strdup_printf("%s.ev-summary", folder->storage_path);
- camel_folder_summary_set_filename((CamelFolderSummary *)cns, path);
- g_free(path);
-
- camel_folder_summary_set_build_content((CamelFolderSummary *)cns, FALSE);
-
- return cns;
-}
-
-static CamelMessageInfo *
-message_info_new(CamelFolderSummary *s, struct _camel_header_raw *h)
-{
- CamelMessageInfo *mi;
- CamelNNTPSummary *cns = (CamelNNTPSummary *)s;
-
- /* error to call without this setup */
- if (cns->priv->uid == NULL)
- return NULL;
-
- /* we shouldn't be here if we already have this uid */
- g_assert(camel_folder_summary_uid(s, cns->priv->uid) == NULL);
-
- mi = ((CamelFolderSummaryClass *)camel_nntp_summary_parent)->message_info_new(s, h);
- if (mi) {
- camel_message_info_set_uid(mi, cns->priv->uid);
- cns->priv->uid = NULL;
- }
-
- return mi;
-}
-
-static int
-summary_header_load(CamelFolderSummary *s, FILE *in)
-{
- CamelNNTPSummary *cns = CAMEL_NNTP_SUMMARY(s);
-
- if (((CamelFolderSummaryClass *)camel_nntp_summary_parent)->summary_header_load(s, in) == -1
- || camel_file_util_decode_fixed_int32(in, &cns->high) == -1
- || camel_file_util_decode_fixed_int32(in, &cns->low) == -1)
- return -1;
-
- return 0;
-}
-
-static int
-summary_header_save(CamelFolderSummary *s, FILE *out)
-{
- CamelNNTPSummary *cns = CAMEL_NNTP_SUMMARY(s);
-
- if (((CamelFolderSummaryClass *)camel_nntp_summary_parent)->summary_header_save(s, out) == -1
- || camel_file_util_encode_fixed_int32(out, cns->high) == -1
- || camel_file_util_encode_fixed_int32(out, cns->low) == -1)
- return -1;
-
- return 0;
-}
-
-/* Assumes we have the stream */
-int
-camel_nntp_summary_check(CamelNNTPSummary *cns, CamelFolderChangeInfo *changes, CamelException *ex)
-{
- CamelNNTPStore *store;
- CamelFolder *folder;
- CamelFolderSummary *s;
- int ret, i;
- char *line;
- unsigned int n, f, l;
- int count;
-
- if (xover_setup(cns, ex) == -1)
- return -1;
-
- folder = (CamelFolder *)cns->folder;
- store = (CamelNNTPStore *)folder->parent_store;
- s = (CamelFolderSummary *)cns;
-
- ret = camel_nntp_command(store, &line, "group %s", folder->full_name);
- if (ret == 411) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_FOLDER_INVALID,
- _("No such folder: %s"), line);
- return -1;
- } else if (ret != 211) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
- _("Could not get group: %s"), line);
- return -1;
- }
-
- line +=3;
- n = strtoul(line, &line, 10);
- f = strtoul(line, &line, 10);
- l = strtoul(line, &line, 10);
-
- dd(printf("nntp_summary: got last '%u' first '%u'\n"
- "nntp_summary: high '%u' low '%u'\n", l, f, cns->high, cns->low));
-
- if (cns->low == f && cns->high == l) {
- dd(printf("nntp_summary: no work to do!\n"));
- return 0;
- }
-
- /* Need to work out what to do with our messages */
-
- /* Check for messages no longer on the server */
- if (cns->low != f) {
- count = camel_folder_summary_count(s);
- for (i = 0; i < count; i++) {
- CamelMessageInfo *mi = camel_folder_summary_index(s, i);
-
- if (mi) {
- const char *uid = camel_message_info_uid(mi);
- const char *msgid;
-
- n = strtoul(uid, NULL, 10);
- if (n < f || n > l) {
- dd(printf("nntp_summary: %u is lower/higher than lowest/highest article, removed\n", n));
- /* Since we use a global cache this could prematurely remove
- a cached message that might be in another folder - not that important as
- it is a true cache */
- msgid = strchr(uid, ',');
- if (msgid)
- camel_data_cache_remove(store->cache, "cache", msgid+1, NULL);
- camel_folder_change_info_remove_uid(changes, uid);
- camel_folder_summary_remove(s, mi);
- count--;
- i--;
- }
-
- camel_folder_summary_info_free(s, mi);
- }
- }
- cns->low = f;
- }
-
- if (cns->high < l) {
- if (cns->high < f)
- cns->high = f-1;
-
- if (cns->priv->xover) {
- ret = add_range_xover(cns, l, cns->high+1, changes, ex);
- } else {
- ret = add_range_head(cns, l, cns->high+1, changes, ex);
- }
- }
-
- camel_folder_summary_touch(s);
-
- return ret;
-}
-
-static struct {
- const char *name;
- int type;
-} headers[] = {
- { "subject", 0 },
- { "from", 0 },
- { "date", 0 },
- { "message-id", 1 },
- { "references", 0 },
- { "bytes", 2 },
-};
-
-static int
-xover_setup(CamelNNTPSummary *cns, CamelException *ex)
-{
- CamelNNTPStore *store;
- CamelFolder *folder;
- CamelFolderSummary *s;
- int ret, i;
- char *line;
- unsigned int len;
- unsigned char c, *p;
- struct _xover_header *xover, *last;
-
- if (cns->priv->xover_setup)
- return 0;
-
- /* manual override */
- if (getenv("CAMEL_NNTP_DISABLE_XOVER") != NULL) {
- cns->priv->xover_setup = TRUE;
- return 0;
- }
-
- folder = (CamelFolder *)cns->folder;
- store = (CamelNNTPStore *)folder->parent_store;
- s = (CamelFolderSummary *)cns;
-
- ret = camel_nntp_command(store, &line, "list overview.fmt");
- if (ret == -1) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("NNTP Command failed: %s"), strerror(errno));
- return -1;
- }
-
- cns->priv->xover_setup = TRUE;
-
- /* unsupported command? */
- if (ret != 215)
- return 0;
-
- last = (struct _xover_header *)&cns->priv->xover;
-
- /* supported command */
- while ((ret = camel_nntp_stream_line(store->stream, (unsigned char **)&line, &len)) > 0) {
- p = line;
- xover = g_malloc0(sizeof(*xover));
- last->next = xover;
- last = xover;
- while ((c = *p++)) {
- if (c == ':') {
- p[-1] = 0;
- for (i=0;i<sizeof(headers)/sizeof(headers[0]);i++) {
- if (strcmp(line, headers[i].name) == 0) {
- xover->name = headers[i].name;
- if (strncmp(p, "full", 4) == 0)
- xover->skip = strlen(xover->name)+1;
- else
- xover->skip = 0;
- xover->type = headers[i].type;
- break;
- }
- }
- break;
- } else {
- p[-1] = tolower(c);
- }
- }
- }
-
- return ret;
-}
-
-static int
-add_range_xover(CamelNNTPSummary *cns, unsigned int high, unsigned int low, CamelFolderChangeInfo *changes, CamelException *ex)
-{
- CamelNNTPStore *store;
- CamelFolder *folder;
- CamelFolderSummary *s;
- CamelMessageInfo *mi;
- struct _camel_header_raw *headers = NULL;
- char *line, *tab;
- int len, ret;
- unsigned int n, count, total, size;
- struct _xover_header *xover;
- time_t last, now;
-
- folder = (CamelFolder *)cns->folder;
- store = (CamelNNTPStore *)folder->parent_store;
- s = (CamelFolderSummary *)cns;
-
- camel_operation_start(NULL, _("%s: Scanning new messages"), ((CamelService *)store)->url->host);
-
- ret = camel_nntp_command(store, &line, "xover %r", low, high);
- if (ret != 224) {
- camel_operation_end(NULL);
- return -1;
- }
-
- last = time(0);
- count = 0;
- total = high-low+1;
- while ((ret = camel_nntp_stream_line(store->stream, (unsigned char **)&line, &len)) > 0) {
- camel_operation_progress(NULL, (count * 100) / total);
- count++;
- n = strtoul(line, &tab, 10);
- if (*tab != '\t')
- continue;
- tab++;
- xover = cns->priv->xover;
- size = 0;
- for (;tab[0] && xover;xover = xover->next) {
- line = tab;
- tab = strchr(line, '\t');
- if (tab)
- *tab++ = 0;
- else
- tab = line+strlen(line);
-
- /* do we care about this column? */
- if (xover->name) {
- line += xover->skip;
- if (line < tab) {
- camel_header_raw_append(&headers, xover->name, line, -1);
- switch(xover->type) {
- case XOVER_STRING:
- break;
- case XOVER_MSGID:
- cns->priv->uid = g_strdup_printf("%u,%s", n, line);
- break;
- case XOVER_SIZE:
- size = strtoul(line, NULL, 10);
- break;
- }
- }
- }
- }
-
- /* truncated line? ignore? */
- if (xover == NULL) {
- mi = camel_folder_summary_uid(s, cns->priv->uid);
- if (mi == NULL) {
- mi = camel_folder_summary_add_from_header(s, headers);
- if (mi) {
- mi->size = size;
- cns->high = n;
- camel_folder_change_info_add_uid(changes, camel_message_info_uid(mi));
- }
- } else {
- camel_folder_summary_info_free(s, mi);
- }
- }
-
- if (cns->priv->uid) {
- g_free(cns->priv->uid);
- cns->priv->uid = NULL;
- }
-
- camel_header_raw_clear(&headers);
-
- now = time(0);
- if (last + 2 < now) {
- camel_object_trigger_event((CamelObject *)folder, "folder_changed", changes);
- camel_folder_change_info_clear(changes);
- last = now;
- }
- }
-
- camel_operation_end(NULL);
-
- return ret;
-}
-
-static int
-add_range_head(CamelNNTPSummary *cns, unsigned int high, unsigned int low, CamelFolderChangeInfo *changes, CamelException *ex)
-{
- CamelNNTPStore *store;
- CamelFolder *folder;
- CamelFolderSummary *s;
- int i, ret = -1;
- char *line, *msgid;
- unsigned int n, count, total;
- CamelMessageInfo *mi;
- CamelMimeParser *mp;
- time_t now, last;
-
- folder = (CamelFolder *)cns->folder;
- store = (CamelNNTPStore *)folder->parent_store;
- s = (CamelFolderSummary *)cns;
-
- mp = camel_mime_parser_new();
-
- camel_operation_start(NULL, _("%s: Scanning new messages"), ((CamelService *)store)->url->host);
-
- last = time(0);
- count = 0;
- total = high-low+1;
- for (i=low;i<high+1;i++) {
- camel_operation_progress(NULL, (count * 100) / total);
- count++;
- ret = camel_nntp_command(store, &line, "head %u", i);
- /* unknown article, ignore */
- if (ret == 423)
- continue;
- else if (ret == -1)
- goto error;
- else if (ret != 221) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, _("Unknown server response: %s"), line);
- goto ioerror;
- }
- line += 3;
- n = strtoul(line, &line, 10);
- if (n != i)
- g_warning("retrieved message '%d' when i expected '%d'?\n", n, i);
-
- if ((msgid = strchr(line, '<')) && (line = strchr(msgid+1, '>'))){
- line[1] = 0;
- cns->priv->uid = g_strdup_printf("%u,%s\n", n, msgid);
- mi = camel_folder_summary_uid(s, cns->priv->uid);
- if (mi == NULL) {
- if (camel_mime_parser_init_with_stream(mp, (CamelStream *)store->stream) == -1)
- goto error;
- mi = camel_folder_summary_add_from_parser(s, mp);
- while (camel_mime_parser_step(mp, NULL, NULL) != CAMEL_MIME_PARSER_STATE_EOF)
- ;
- if (mi == NULL) {
- goto error;
- }
- cns->high = i;
- camel_folder_change_info_add_uid(changes, camel_message_info_uid(mi));
- } else {
- /* already have, ignore */
- camel_folder_summary_info_free(s, mi);
- }
- if (cns->priv->uid) {
- g_free(cns->priv->uid);
- cns->priv->uid = NULL;
- }
- }
-
- now = time(0);
- if (last + 2 < now) {
- camel_object_trigger_event((CamelObject *)folder, "folder_changed", changes);
- camel_folder_change_info_clear(changes);
- last = now;
- }
- }
-
- ret = 0;
-error:
-
- if (ret == -1) {
- if (errno == EINTR)
- camel_exception_setv(ex, CAMEL_EXCEPTION_USER_CANCEL, _("Use cancel"));
- else
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, _("Operation failed: %s"), strerror(errno));
- }
-ioerror:
-
- if (cns->priv->uid) {
- g_free(cns->priv->uid);
- cns->priv->uid = NULL;
- }
- camel_object_unref((CamelObject *)mp);
-
- camel_operation_end(NULL);
-
- return ret;
-}
diff --git a/camel/providers/nntp/camel-nntp-summary.h b/camel/providers/nntp/camel-nntp-summary.h
deleted file mode 100644
index 82070cdc31..0000000000
--- a/camel/providers/nntp/camel-nntp-summary.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (C) 2000 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef _CAMEL_NNTP_SUMMARY_H
-#define _CAMEL_NNTP_SUMMARY_H
-
-#include <camel/camel-folder-summary.h>
-#include <camel/camel-folder.h>
-#include <camel/camel-exception.h>
-#include <libibex/ibex.h>
-
-#define CAMEL_NNTP_SUMMARY(obj) CAMEL_CHECK_CAST (obj, camel_nntp_summary_get_type (), CamelNNTPSummary)
-#define CAMEL_NNTP_SUMMARY_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_nntp_summary_get_type (), CamelNNTPSummaryClass)
-#define CAMEL_IS_LOCAL_SUMMARY(obj) CAMEL_CHECK_TYPE (obj, camel_nntp_summary_get_type ())
-
-typedef struct _CamelNNTPSummary CamelNNTPSummary;
-typedef struct _CamelNNTPSummaryClass CamelNNTPSummaryClass;
-
-struct _CamelNNTPSummary {
- CamelFolderSummary parent;
-
- struct _CamelNNTPSummaryPrivate *priv;
-
- struct _CamelNNTPFolder *folder;
-
- guint32 high, low;
-};
-
-struct _CamelNNTPSummaryClass {
- CamelFolderSummaryClass parent_class;
-};
-
-CamelType camel_nntp_summary_get_type (void);
-CamelNNTPSummary *camel_nntp_summary_new(struct _CamelNNTPFolder *folder);
-
-int camel_nntp_summary_check(CamelNNTPSummary *cns, CamelFolderChangeInfo *, CamelException *ex);
-
-#if 0
-/* load/check the summary */
-int camel_nntp_summary_load(CamelNNTPSummary *cls, CamelException *ex);
-/* check for new/removed messages */
-int camel_nntp_summary_check(CamelNNTPSummary *cls, CamelFolderChangeInfo *, CamelException *ex);
-/* perform a folder sync or expunge, if needed */
-int camel_nntp_summary_sync(CamelNNTPSummary *cls, gboolean expunge, CamelFolderChangeInfo *, CamelException *ex);
-/* add a new message to the summary */
-CamelMessageInfo *camel_nntp_summary_add(CamelNNTPSummary *cls, CamelMimeMessage *msg, const CamelMessageInfo *info, CamelFolderChangeInfo *, CamelException *ex);
-#endif
-
-#endif /* ! _CAMEL_NNTP_SUMMARY_H */
-
diff --git a/camel/providers/nntp/camel-nntp-types.h b/camel/providers/nntp/camel-nntp-types.h
deleted file mode 100644
index a37179c521..0000000000
--- a/camel/providers/nntp/camel-nntp-types.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-nntp-grouplist.h : getting/updating the list of newsgroups on the server. */
-
-/*
- * Author : Chris Toshok <toshok@ximian.com>
- *
- * Copyright (C) 2000 Ximian .
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifndef CAMEL_NNTP_TYPES_H
-#define CAMEL_NNTP_TYPES_H 1
-
-typedef struct CamelNNTPGroupList CamelNNTPGroupList;
-typedef struct CamelNNTPGroupListEntry CamelNNTPGroupListEntry;
-typedef struct CamelNNTPOverField CamelNNTPOverField;
-typedef struct CamelNNTPStore CamelNNTPStore;
-typedef struct CamelNNTPStoreClass CamelNNTPStoreClass;
-
-#endif /* CAMEL_NNTP_TYPES_H */
diff --git a/camel/providers/nntp/camel-nntp-utils.c b/camel/providers/nntp/camel-nntp-utils.c
deleted file mode 100644
index d8000a85ee..0000000000
--- a/camel/providers/nntp/camel-nntp-utils.c
+++ /dev/null
@@ -1,299 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-nntp-utils.c : utilities used by the nntp code. */
-
-/*
- * Author : Chris Toshok <toshok@ximian.com>
- *
- * Copyright (C) 2000 Ximian .
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#include "camel-folder-summary.h"
-#include "camel-nntp-resp-codes.h"
-#include "camel-nntp-folder.h"
-#include "camel-nntp-store.h"
-#include "camel-nntp-utils.h"
-#include "camel-stream-mem.h"
-#include "camel-exception.h"
-
-#include "e-util/md5-utils.h"
-
-#include <stdlib.h>
-#include <string.h>
-
-static void
-get_XOVER_headers(CamelNNTPStore *nntp_store, CamelFolder *folder,
- int first_message, int last_message, CamelException *ex)
-{
- int status;
- CamelNNTPFolder *nntp_folder = CAMEL_NNTP_FOLDER (folder);
- char digest[16];
-
- status = camel_nntp_command (nntp_store, ex, NULL,
- "XOVER %d-%d",
- first_message,
- last_message);
-
- if (status == NNTP_DATA_FOLLOWS) {
- gboolean done = FALSE;
-
- while (!done) {
- char *line;
-
- if (camel_remote_store_recv_line (CAMEL_REMOTE_STORE (nntp_store), &line, ex) < 0) {
- g_warning ("failed to recv_line while building OVER header list\n");
- break;
- }
-
- if (*line == '.') {
- done = TRUE;
- g_print ("done\n");
- }
- else {
- CamelMessageInfo *new_info = camel_folder_summary_info_new(folder->summary);
- char **split_line = g_strsplit (line, "\t", 7);
- char *subject, *from, *date, *message_id, *bytes;
- char *uid;
-
- subject = split_line [nntp_store->overview_field [CAMEL_NNTP_OVER_SUBJECT].index];
- from = split_line [nntp_store->overview_field [CAMEL_NNTP_OVER_FROM].index];
- date = split_line [nntp_store->overview_field [CAMEL_NNTP_OVER_DATE].index];
- message_id = split_line [nntp_store->overview_field [CAMEL_NNTP_OVER_MESSAGE_ID].index];
- bytes = split_line [nntp_store->overview_field [CAMEL_NNTP_OVER_BYTES].index];
-
- /* if the overview format flagged this
- field as "full", skip over the
- preceding field name and colon */
- if (nntp_store->overview_field [ CAMEL_NNTP_OVER_SUBJECT ].full)
- subject += strlen ("Subject:");
- if (nntp_store->overview_field [ CAMEL_NNTP_OVER_FROM ].full)
- from += strlen ("From:");
- if (nntp_store->overview_field [ CAMEL_NNTP_OVER_DATE ].full)
- date += strlen ("Date:");
- if (nntp_store->overview_field [ CAMEL_NNTP_OVER_MESSAGE_ID ].full)
- message_id += strlen ("Message-ID:");
- if (nntp_store->overview_field [ CAMEL_NNTP_OVER_BYTES ].full)
- bytes += strlen ("Bytes:");
-
- uid = g_strdup_printf ("%s,%s", split_line[0], message_id);
- camel_message_info_set_subject(new_info, g_strdup(subject));
- camel_message_info_set_from(new_info, g_strdup(from));
- camel_message_info_set_to(new_info, g_strdup(folder->name));
- camel_message_info_set_uid(new_info, uid);
-
- new_info->date_sent = camel_header_decode_date(date, NULL);
-#if 0
- /* XXX do we need to fill in both dates? */
- new_info->headers.date_received = g_strdup(date);
-#endif
- new_info->size = atoi(bytes);
- md5_get_digest(message_id, strlen(message_id), digest);
- memcpy(new_info->message_id.id.hash, digest, sizeof(new_info->message_id.id.hash));
-
- if (camel_nntp_newsrc_article_is_read (nntp_store->newsrc,
- folder->name,
- atoi (split_line[0])))
- new_info->flags |= CAMEL_MESSAGE_SEEN;
-
- camel_folder_summary_add (folder->summary, new_info);
- g_strfreev (split_line);
- }
- g_free (line);
- }
- }
- else {
- /* XXX */
- g_warning ("weird nntp response for XOVER: %d\n", status);
- }
-}
-
-#if 0
-static GArray*
-get_HEAD_headers(CamelNNTPStore *nntp_store, CamelFolder *folder,
- int first_message, int last_message, CamelException *ex)
-{
- int i;
- int status;
-
- for (i = first_message; i < last_message; i ++) {
- status = camel_nntp_command (nntp_store, ex, NULL,
- "HEAD %d", i);
-
- if (status == NNTP_HEAD_FOLLOWS) {
- gboolean done = FALSE;
- char *buf;
- int buf_len;
- int buf_alloc;
- int h;
- CamelStream *header_stream;
- GArray *header_array;
- CamelStream *nntp_istream;
- CamelMessageInfo *new_info = g_new0(CamelMessageInfo, 1);
-
- buf_alloc = 2048;
- buf_len = 0;
- buf = g_malloc(buf_alloc);
- done = FALSE;
-
- buf[0] = 0;
-
- nntp_istream = nntp_store->istream;
-
- while (!done) {
- char *line;
- int line_length;
-
- line = camel_stream_buffer_read_line (
- CAMEL_STREAM_BUFFER ( nntp_istream ));
- line_length = strlen ( line );
-
- if (*line == '.') {
- done = TRUE;
- }
- else {
- if (buf_len + line_length > buf_alloc) {
- buf_alloc *= 2;
- buf = g_realloc (buf, buf_alloc);
- }
- strcat(buf, line);
- strcat(buf, "\n");
- buf_len += strlen(line);
- g_free (line);
- }
- }
-
- /* create a stream from which to parse the headers */
- header_stream = camel_stream_mem_new_with_buffer (buf, buf_len,
- CAMEL_STREAM_MEM_READ);
-
- header_array = get_header_array_from_stream (header_stream);
-
- memset (&info, 0, sizeof(info));
-
- for (h = 0; h < header_array->len; h ++) {
- Rfc822Header *header = &((Rfc822Header*)header_array->data)[h];
- if (!g_strcasecmp(header->name, "From"))
- new_info->from = g_strdup(header->value);
- else if (!g_strcasecmp(header->name, "To"))
- new_info->to = g_strdup(header->value);
- else if (!g_strcasecmp(header->name, "Subject"))
- new_info->subject = g_strdup(header->value);
- else if (!g_strcasecmp(header->name, "Message-ID")) {
- new_info->uid = g_strdup_printf("%d,%s", i, header->value);
- new_info->message_id = g_strdup(header->value);
- }
- else if (!g_strcasecmp(header->name, "Date")) {
- new_info->date_sent = camel_header_decode_date (header->value);
-#if 0
- new_info->date_sent = g_strdup(header->value);
- new_info->date_received = g_strdup(header->value);
-#endif
- }
- }
-
- camel_folder_summary_add (nntp_folder->summary, new_info);
- }
- else if (status == CAMEL_NNTP_FAIL) {
- /* nasty things are afoot */
- g_warning ("failure doing HEAD\n");
- break;
- }
- }
-}
-#endif
-
-static inline int
-uid_num (CamelFolderSummary *summary, int index)
-{
- char *tmp;
- char *brk;
- CamelMessageInfo *minfo;
- int ret;
-
- minfo = camel_folder_summary_index(summary, index);
- if(minfo == NULL)
- return 0;
-
- tmp = g_strdup(camel_message_info_uid(minfo));
- camel_message_info_free(minfo);
-
- if((brk = strchr(tmp, ',')) == NULL)
- ret = 0;
- else {
- *brk = 0;
- ret = atoi(tmp);
- }
-
- g_free(tmp);
-
- return ret;
-}
-
-void
-camel_nntp_get_headers (CamelStore *store,
- CamelNNTPFolder *nntp_folder,
- CamelException *ex)
-{
- CamelNNTPStore *nntp_store = CAMEL_NNTP_STORE (store);
- CamelFolder *folder = CAMEL_FOLDER (nntp_folder);
- char *ret;
- int first_message, nb_message, last_message, last_summary;
- int status;
- int i;
-
- status = camel_nntp_command (nntp_store, ex, &ret,
- "GROUP %s", folder->name);
- sscanf (ret, "%d %d %d", &nb_message, &first_message, &last_message);
- g_free (ret);
-
- i = camel_folder_summary_count(folder->summary);
- if(i != 0) {
- last_summary = uid_num(folder->summary, i-1);
-
- if(last_summary < first_message)
- camel_folder_summary_clear(folder->summary);
- else {
- while(uid_num(folder->summary, 0) < first_message)
- camel_folder_summary_remove_index(folder->summary, 0);
-
- if(last_summary >= last_message)
- return;
-
- first_message = last_summary;
- }
- }
-
- if (status == NNTP_NO_SUCH_GROUP) {
- /* XXX throw invalid group exception */
- camel_exception_setv (ex,
- CAMEL_EXCEPTION_FOLDER_INVALID,
- "group %s not found on server",
- folder->name);
- return;
- }
-
-
- if (nntp_store->extensions & CAMEL_NNTP_EXT_OVER) {
- get_XOVER_headers (nntp_store, folder, first_message, last_message, ex);
- }
- else {
- g_warning ("need to fix get_HEAD_headers\n");
-#if 0
- get_HEAD_headers (nntp_store, folder, first_message, last_message, ex);
-#endif
- }
-
-}
diff --git a/camel/providers/nntp/camel-nntp-utils.h b/camel/providers/nntp/camel-nntp-utils.h
deleted file mode 100644
index 48fd7490c9..0000000000
--- a/camel/providers/nntp/camel-nntp-utils.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-nntp-utils.h : Utilities for the NNTP provider */
-
-/*
- *
- * Author : Chris Toshok <toshok@ximian.com>
- *
- * Copyright (C) 1999 Ximian .
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifndef CAMEL_NNTP_UTILS_H
-#define CAMEL_NNTP_UTILS_H 1
-
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-void camel_nntp_get_headers (CamelStore *store, CamelNNTPFolder *nntp_folder, CamelException *ex);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_NNTP_UTILS_H */
diff --git a/camel/providers/nntp/libcamelnntp.urls b/camel/providers/nntp/libcamelnntp.urls
deleted file mode 100644
index dee2e70f14..0000000000
--- a/camel/providers/nntp/libcamelnntp.urls
+++ /dev/null
@@ -1,2 +0,0 @@
-news
-nntp
diff --git a/camel/providers/nntp/test-newsrc.c b/camel/providers/nntp/test-newsrc.c
deleted file mode 100644
index c4b985e565..0000000000
--- a/camel/providers/nntp/test-newsrc.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <stdio.h>
-#include <glib.h>
-#include "camel-nntp-newsrc.h"
-
-int
-main(int argc, char *argv[])
-{
- CamelNNTPNewsrc *newsrc = camel_nntp_newsrc_read_for_server (argv[1]);
- camel_nntp_newsrc_write_to_file (newsrc, stdout);
-}
diff --git a/camel/providers/pop3/.cvsignore b/camel/providers/pop3/.cvsignore
deleted file mode 100644
index ddf4c8b28d..0000000000
--- a/camel/providers/pop3/.cvsignore
+++ /dev/null
@@ -1,10 +0,0 @@
-Makefile
-Makefile.in
-.libs
-.deps
-*.lo
-*.la
-*.bb
-*.bbg
-*.da
-*.gcov
diff --git a/camel/providers/pop3/Makefile.am b/camel/providers/pop3/Makefile.am
deleted file mode 100644
index 84f5477f97..0000000000
--- a/camel/providers/pop3/Makefile.am
+++ /dev/null
@@ -1,38 +0,0 @@
-## Process this file with automake to produce Makefile.in
-
-libcamelpop3includedir = $(privincludedir)/camel
-
-camel_provider_LTLIBRARIES = libcamelpop3.la
-camel_provider_DATA = libcamelpop3.urls
-
-INCLUDES = \
- -I.. \
- -I$(srcdir)/.. \
- -I$(srcdir)/../../.. \
- -I$(top_srcdir)/intl \
- -I$(top_srcdir)/camel \
- -I$(top_srcdir)/e-util \
- $(CAMEL_CFLAGS) \
- $(GNOME_INCLUDEDIR) \
- $(GTK_INCLUDEDIR) \
- -DG_LOG_DOMAIN=\"camel-pop3-provider\"
-
-libcamelpop3_la_SOURCES = \
- camel-pop3-engine.c \
- camel-pop3-folder.c \
- camel-pop3-provider.c \
- camel-pop3-stream.c \
- camel-pop3-store.c
-
-libcamelpop3include_HEADERS = \
- camel-pop3-engine.h \
- camel-pop3-folder.h \
- camel-pop3-stream.h \
- camel-pop3-store.h
-
-
-libcamelpop3_la_LDFLAGS = -avoid-version -module
-
-libcamelpop3_la_LIBADD = $(top_builddir)/e-util/libeutil.la
-
-EXTRA_DIST = libcamelpop3.urls
diff --git a/camel/providers/pop3/camel-pop3-engine.c b/camel/providers/pop3/camel-pop3-engine.c
deleted file mode 100644
index 2186136f95..0000000000
--- a/camel/providers/pop3/camel-pop3-engine.c
+++ /dev/null
@@ -1,382 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; fill-column: 160 -*-
- *
- * Author:
- * Michael Zucchi <notzed@ximian.com>
- *
- * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <errno.h>
-
-#include <string.h>
-#include <stdio.h>
-
-#include <glib.h>
-
-#include "camel-pop3-engine.h"
-#include "camel-pop3-stream.h"
-#include <camel/camel-service.h>
-#include <camel/camel-sasl.h>
-
-/* max 'outstanding' bytes in output stream, so we can't deadlock waiting
- for the server to accept our data when pipelining */
-#define CAMEL_POP3_SEND_LIMIT (1024)
-
-
-extern int camel_verbose_debug;
-#define dd(x) (camel_verbose_debug?(x):0)
-
-static void get_capabilities(CamelPOP3Engine *pe, int read_greeting);
-
-static CamelObjectClass *parent_class = NULL;
-
-/* Returns the class for a CamelStream */
-#define CS_CLASS(so) CAMEL_POP3_ENGINE_CLASS(CAMEL_OBJECT_GET_CLASS(so))
-
-static void
-camel_pop3_engine_class_init (CamelPOP3EngineClass *camel_pop3_engine_class)
-{
- parent_class = camel_type_get_global_classfuncs( CAMEL_OBJECT_TYPE );
-}
-
-static void
-camel_pop3_engine_init(CamelPOP3Engine *pe, CamelPOP3EngineClass *peclass)
-{
- e_dlist_init(&pe->active);
- e_dlist_init(&pe->queue);
- e_dlist_init(&pe->done);
- pe->state = CAMEL_POP3_ENGINE_DISCONNECT;
-}
-
-static void
-camel_pop3_engine_finalise(CamelPOP3Engine *pe)
-{
- /* FIXME: Also flush/free any outstanding requests, etc */
-
- if (pe->stream)
- camel_object_unref((CamelObject *)pe->stream);
-}
-
-CamelType
-camel_pop3_engine_get_type (void)
-{
- static CamelType camel_pop3_engine_type = CAMEL_INVALID_TYPE;
-
- if (camel_pop3_engine_type == CAMEL_INVALID_TYPE) {
- camel_pop3_engine_type = camel_type_register(camel_object_get_type(),
- "CamelPOP3Engine",
- sizeof( CamelPOP3Engine ),
- sizeof( CamelPOP3EngineClass ),
- (CamelObjectClassInitFunc) camel_pop3_engine_class_init,
- NULL,
- (CamelObjectInitFunc) camel_pop3_engine_init,
- (CamelObjectFinalizeFunc) camel_pop3_engine_finalise );
- }
-
- return camel_pop3_engine_type;
-}
-
-/**
- * camel_pop3_engine_new:
- * @source: source stream
- * @flags: engine flags
- *
- * Returns a NULL stream. A null stream is always at eof, and
- * always returns success for all reads and writes.
- *
- * Return value: the stream
- **/
-CamelPOP3Engine *
-camel_pop3_engine_new(CamelStream *source, guint32 flags)
-{
- CamelPOP3Engine *pe;
-
- pe = (CamelPOP3Engine *)camel_object_new(camel_pop3_engine_get_type ());
-
- pe->stream = (CamelPOP3Stream *)camel_pop3_stream_new(source);
- pe->state = CAMEL_POP3_ENGINE_AUTH;
- pe->flags = flags;
-
- get_capabilities(pe, TRUE);
-
- return pe;
-}
-
-
-/**
- * camel_pop3_engine_reget_capabilities:
- * @engine: pop3 engine
- *
- * Regets server capabilities (needed after a STLS command is issued for example).
- **/
-void
-camel_pop3_engine_reget_capabilities (CamelPOP3Engine *engine)
-{
- g_return_if_fail (CAMEL_IS_POP3_ENGINE (engine));
-
- get_capabilities (engine, FALSE);
-}
-
-
-/* TODO: read implementation too?
- etc? */
-struct {
- char *cap;
- guint32 flag;
-} capa[] = {
- { "APOP" , CAMEL_POP3_CAP_APOP },
- { "TOP" , CAMEL_POP3_CAP_TOP },
- { "UIDL", CAMEL_POP3_CAP_UIDL },
- { "PIPELINING", CAMEL_POP3_CAP_PIPE },
- { "STLS", CAMEL_POP3_CAP_STLS }, /* STARTTLS */
-};
-
-static void
-cmd_capa(CamelPOP3Engine *pe, CamelPOP3Stream *stream, void *data)
-{
- unsigned char *line, *tok, *next;
- unsigned int len;
- int ret;
- int i;
- CamelServiceAuthType *auth;
-
- dd(printf("cmd_capa\n"));
-
- do {
- ret = camel_pop3_stream_line(stream, &line, &len);
- if (ret >= 0) {
- if (strncmp(line, "SASL ", 5) == 0) {
- tok = line+5;
- dd(printf("scanning tokens '%s'\n", tok));
- while (tok) {
- next = strchr(tok, ' ');
- if (next)
- *next++ = 0;
- auth = camel_sasl_authtype(tok);
- if (auth) {
- dd(printf("got auth type '%s'\n", tok));
- pe->auth = g_list_prepend(pe->auth, auth);
- } else {
- dd(printf("unsupported auth type '%s'\n", tok));
- }
- tok = next;
- }
- } else {
- for (i=0;i<sizeof(capa)/sizeof(capa[0]);i++) {
- if (strcmp(capa[i].cap, line) == 0)
- pe->capa |= capa[i].flag;
- }
- }
- }
- } while (ret>0);
-}
-
-static void
-get_capabilities(CamelPOP3Engine *pe, int read_greeting)
-{
- CamelPOP3Command *pc;
- unsigned char *line, *apop, *apopend;
- unsigned int len;
- extern CamelServiceAuthType camel_pop3_password_authtype;
- extern CamelServiceAuthType camel_pop3_apop_authtype;
-
- if (read_greeting) {
- /* first, read the greeting */
- if (camel_pop3_stream_line(pe->stream, &line, &len) == -1
- || strncmp(line, "+OK", 3) != 0)
- return;
-
- if ((apop = strchr(line+3, '<'))
- && (apopend = strchr(apop, '>'))) {
- apopend[1] = 0;
- pe->apop = g_strdup(apop);
- pe->capa = CAMEL_POP3_CAP_APOP;
- pe->auth = g_list_append(pe->auth, &camel_pop3_apop_authtype);
- }
-
- pe->auth = g_list_prepend(pe->auth, &camel_pop3_password_authtype);
- }
-
- if (!(pe->flags & CAMEL_POP3_ENGINE_DISABLE_EXTENSIONS)) {
- pc = camel_pop3_engine_command_new(pe, CAMEL_POP3_COMMAND_MULTI, cmd_capa, NULL, "CAPA\r\n");
- while (camel_pop3_engine_iterate(pe, pc) > 0)
- ;
- camel_pop3_engine_command_free(pe, pc);
-
- if (pe->state == CAMEL_POP3_ENGINE_TRANSACTION && !(pe->capa & CAMEL_POP3_CAP_UIDL)) {
- /* check for UIDL support manually */
- pc = camel_pop3_engine_command_new (pe, CAMEL_POP3_COMMAND_SIMPLE, NULL, NULL, "UIDL 1\r\n");
- while (camel_pop3_engine_iterate (pe, pc) > 0)
- ;
-
- if (pc->state == CAMEL_POP3_COMMAND_OK)
- pe->capa |= CAMEL_POP3_CAP_UIDL;
-
- camel_pop3_engine_command_free (pe, pc);
- }
- }
-}
-
-/* returns true if the command was sent, false if it was just queued */
-static int
-engine_command_queue(CamelPOP3Engine *pe, CamelPOP3Command *pc)
-{
- if (((pe->capa & CAMEL_POP3_CAP_PIPE) == 0 || (pe->sentlen + strlen(pc->data)) > CAMEL_POP3_SEND_LIMIT)
- && pe->current != NULL) {
- e_dlist_addtail(&pe->queue, (EDListNode *)pc);
- return FALSE;
- } else {
- /* ??? */
- if (camel_stream_write((CamelStream *)pe->stream, pc->data, strlen(pc->data)) == -1) {
- e_dlist_addtail(&pe->queue, (EDListNode *)pc);
- return FALSE;
- }
-
- pe->sentlen += strlen(pc->data);
-
- pc->state = CAMEL_POP3_COMMAND_DISPATCHED;
-
- if (pe->current == NULL)
- pe->current = pc;
- else
- e_dlist_addtail(&pe->active, (EDListNode *)pc);
-
- return TRUE;
- }
-}
-
-/* returns -1 on error (sets errno), 0 when no work to do, or >0 if work remaining */
-int
-camel_pop3_engine_iterate(CamelPOP3Engine *pe, CamelPOP3Command *pcwait)
-{
- unsigned char *p;
- unsigned int len;
- CamelPOP3Command *pc, *pw, *pn;
-
- if (pcwait && pcwait->state >= CAMEL_POP3_COMMAND_OK)
- return 0;
-
- pc = pe->current;
- if (pc == NULL)
- return 0;
-
- /* LOCK */
-
- if (camel_pop3_stream_line(pe->stream, &pe->line, &pe->linelen) == -1)
- return -1;
-
- p = pe->line;
- switch (p[0]) {
- case '+':
- dd(printf("Got + response\n"));
- if (pc->flags & CAMEL_POP3_COMMAND_MULTI) {
- pc->state = CAMEL_POP3_COMMAND_DATA;
- camel_pop3_stream_set_mode(pe->stream, CAMEL_POP3_STREAM_DATA);
-
- if (pc->func)
- pc->func(pe, pe->stream, pc->func_data);
-
- /* Make sure we get all data before going back to command mode */
- while (camel_pop3_stream_getd(pe->stream, &p, &len) > 0)
- ;
- camel_pop3_stream_set_mode(pe->stream, CAMEL_POP3_STREAM_LINE);
- } else {
- pc->state = CAMEL_POP3_COMMAND_OK;
- }
- break;
- case '-':
- pc->state = CAMEL_POP3_COMMAND_ERR;
- break;
- default:
- /* what do we do now? f'knows! */
- g_warning("Bad server response: %s\n", p);
- pc->state = CAMEL_POP3_COMMAND_ERR;
- break;
- }
-
- e_dlist_addtail(&pe->done, (EDListNode *)pc);
- pe->sentlen -= strlen(pc->data);
-
- /* Set next command */
- pe->current = (CamelPOP3Command *)e_dlist_remhead(&pe->active);
-
- /* check the queue for sending any we can now send also */
- pw = (CamelPOP3Command *)pe->queue.head;
- pn = pw->next;
- while (pn) {
- if (((pe->capa & CAMEL_POP3_CAP_PIPE) == 0 || (pe->sentlen + strlen(pw->data)) > CAMEL_POP3_SEND_LIMIT)
- && pe->current != NULL)
- break;
-
- if (camel_stream_write((CamelStream *)pe->stream, pw->data, strlen(pw->data)) == -1)
- return -1;
-
- e_dlist_remove((EDListNode *)pw);
-
- pe->sentlen += strlen(pw->data);
- pw->state = CAMEL_POP3_COMMAND_DISPATCHED;
-
- if (pe->current == NULL)
- pe->current = pw;
- else
- e_dlist_addtail(&pe->active, (EDListNode *)pw);
-
- pw = pn;
- pn = pn->next;
- }
-
- /* UNLOCK */
-
- if (pcwait && pcwait->state >= CAMEL_POP3_COMMAND_OK)
- return 0;
-
- return pe->current==NULL?0:1;
-}
-
-CamelPOP3Command *
-camel_pop3_engine_command_new(CamelPOP3Engine *pe, guint32 flags, CamelPOP3CommandFunc func, void *data, const char *fmt, ...)
-{
- CamelPOP3Command *pc;
- va_list ap;
-
- pc = g_malloc0(sizeof(*pc));
- pc->func = func;
- pc->func_data = data;
- pc->flags = flags;
-
- va_start(ap, fmt);
- pc->data = g_strdup_vprintf(fmt, ap);
- pc->state = CAMEL_POP3_COMMAND_IDLE;
-
- /* TODO: what about write errors? */
- engine_command_queue(pe, pc);
-
- return pc;
-}
-
-void
-camel_pop3_engine_command_free(CamelPOP3Engine *pe, CamelPOP3Command *pc)
-{
- if (pe->current != pc)
- e_dlist_remove((EDListNode *)pc);
- g_free(pc->data);
- g_free(pc);
-}
diff --git a/camel/providers/pop3/camel-pop3-engine.h b/camel/providers/pop3/camel-pop3-engine.h
deleted file mode 100644
index 3114980311..0000000000
--- a/camel/providers/pop3/camel-pop3-engine.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Copyright (C) 2001 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef _CAMEL_POP3_ENGINE_H
-#define _CAMEL_POP3_ENGINE_H
-
-#include <camel/camel-object.h>
-#include "e-util/e-msgport.h"
-#include "camel-pop3-stream.h"
-
-#define CAMEL_POP3_ENGINE(obj) CAMEL_CHECK_CAST (obj, camel_pop3_engine_get_type (), CamelPOP3Engine)
-#define CAMEL_POP3_ENGINE_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_pop3_engine_get_type (), CamelPOP3EngineClass)
-#define CAMEL_IS_POP3_ENGINE(obj) CAMEL_CHECK_TYPE (obj, camel_pop3_engine_get_type ())
-
-typedef struct _CamelPOP3EngineClass CamelPOP3EngineClass;
-typedef struct _CamelPOP3Engine CamelPOP3Engine;
-typedef struct _CamelPOP3Command CamelPOP3Command;
-
-/* pop 3 connection states, actually since we're given a connected socket, we always start in auth state */
-typedef enum {
- CAMEL_POP3_ENGINE_DISCONNECT = 0,
- CAMEL_POP3_ENGINE_AUTH,
- CAMEL_POP3_ENGINE_TRANSACTION,
- CAMEL_POP3_ENGINE_UPDATE,
-} camel_pop3_engine_t;
-
-/* state of a command */
-typedef enum {
- CAMEL_POP3_COMMAND_IDLE = 0, /* command created or queued, not yet sent (e.g. non pipelined server) */
- CAMEL_POP3_COMMAND_DISPATCHED, /* command sent to server */
-
- /* completion codes */
- CAMEL_POP3_COMMAND_OK, /* plain ok response */
- CAMEL_POP3_COMMAND_DATA, /* processing command response */
- CAMEL_POP3_COMMAND_ERR, /* error response */
-} camel_pop3_command_t;
-
-/* flags for command types */
-enum {
- CAMEL_POP3_COMMAND_SIMPLE = 0, /* dont expect multiline response */
- CAMEL_POP3_COMMAND_MULTI = 1, /* expect multiline response */
-};
-
-/* flags for server options */
-enum {
- CAMEL_POP3_CAP_APOP = 1<<0,
- CAMEL_POP3_CAP_UIDL = 1<<1,
- CAMEL_POP3_CAP_SASL = 1<<2,
- CAMEL_POP3_CAP_TOP = 1<<3,
- CAMEL_POP3_CAP_PIPE = 1<<4,
- CAMEL_POP3_CAP_STLS = 1<<5
-};
-
-/* enable/disable flags for the engine itself */
-enum {
- CAMEL_POP3_ENGINE_DISABLE_EXTENSIONS = 1<<0,
-};
-
-typedef void (*CamelPOP3CommandFunc)(CamelPOP3Engine *pe, CamelPOP3Stream *stream, void *data);
-
-struct _CamelPOP3Command {
- struct _CamelPOP3Command *next;
- struct _CamelPOP3Command *prev;
-
- guint32 flags;
- camel_pop3_command_t state;
-
- CamelPOP3CommandFunc func;
- void *func_data;
-
- int data_size;
- char *data;
-};
-
-struct _CamelPOP3Engine {
- CamelObject parent;
-
- guint32 flags;
-
- camel_pop3_engine_t state;
-
- GList *auth; /* authtypes supported */
-
- guint32 capa; /* capabilities */
- char *apop; /* apop time string */
-
- unsigned char *line; /* current line buffer */
- unsigned int linelen;
-
- struct _CamelPOP3Stream *stream;
-
- unsigned int sentlen; /* data sent (so we dont overflow network buffer) */
-
- EDList active; /* active commands */
- EDList queue; /* queue of waiting commands */
- EDList done; /* list of done commands, awaiting free */
-
- CamelPOP3Command *current; /* currently busy (downloading) response */
-};
-
-struct _CamelPOP3EngineClass {
- CamelObjectClass parent_class;
-};
-
-CamelType camel_pop3_engine_get_type (void);
-
-CamelPOP3Engine *camel_pop3_engine_new (CamelStream *source, guint32 flags);
-
-void camel_pop3_engine_reget_capabilities (CamelPOP3Engine *engine);
-
-void camel_pop3_engine_command_free(CamelPOP3Engine *pe, CamelPOP3Command *pc);
-
-int camel_pop3_engine_iterate (CamelPOP3Engine *pe, CamelPOP3Command *pc);
-
-CamelPOP3Command *camel_pop3_engine_command_new (CamelPOP3Engine *pe, guint32 flags, CamelPOP3CommandFunc func, void *data, const char *fmt, ...);
-
-#endif /* ! _CAMEL_POP3_ENGINE_H */
diff --git a/camel/providers/pop3/camel-pop3-folder.c b/camel/providers/pop3/camel-pop3-folder.c
deleted file mode 100644
index db77ad8191..0000000000
--- a/camel/providers/pop3/camel-pop3-folder.c
+++ /dev/null
@@ -1,558 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-pop3-folder.c : class for a pop3 folder */
-
-/*
- * Authors:
- * Dan Winship <danw@ximian.com>
- * Michael Zucchi <notzed@ximian.com>
- *
- * Copyright (C) 2002 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <errno.h>
-
-#include "camel-pop3-folder.h"
-#include "camel-pop3-store.h"
-#include "camel-exception.h"
-#include "camel-stream-mem.h"
-#include "camel-stream-filter.h"
-#include "camel-mime-message.h"
-#include "camel-operation.h"
-#include "camel-data-cache.h"
-
-#include <e-util/md5-utils.h>
-
-#include <stdlib.h>
-#include <string.h>
-
-#define d(x)
-
-#define CF_CLASS(o) (CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(o)))
-static CamelFolderClass *parent_class;
-
-static void pop3_finalize (CamelObject *object);
-static void pop3_refresh_info (CamelFolder *folder, CamelException *ex);
-static void pop3_sync (CamelFolder *folder, gboolean expunge, CamelException *ex);
-static gint pop3_get_message_count (CamelFolder *folder);
-static GPtrArray *pop3_get_uids (CamelFolder *folder);
-static CamelMimeMessage *pop3_get_message (CamelFolder *folder, const char *uid, CamelException *ex);
-static void pop3_set_message_flags (CamelFolder *folder, const char *uid, guint32 flags, guint32 set);
-
-static void
-camel_pop3_folder_class_init (CamelPOP3FolderClass *camel_pop3_folder_class)
-{
- CamelFolderClass *camel_folder_class = CAMEL_FOLDER_CLASS(camel_pop3_folder_class);
-
- parent_class = CAMEL_FOLDER_CLASS(camel_folder_get_type());
-
- /* virtual method overload */
- camel_folder_class->refresh_info = pop3_refresh_info;
- camel_folder_class->sync = pop3_sync;
-
- camel_folder_class->get_message_count = pop3_get_message_count;
- camel_folder_class->get_uids = pop3_get_uids;
- camel_folder_class->free_uids = camel_folder_free_shallow;
-
- camel_folder_class->get_message = pop3_get_message;
- camel_folder_class->set_message_flags = pop3_set_message_flags;
-}
-
-CamelType
-camel_pop3_folder_get_type (void)
-{
- static CamelType camel_pop3_folder_type = CAMEL_INVALID_TYPE;
-
- if (!camel_pop3_folder_type) {
- camel_pop3_folder_type = camel_type_register (CAMEL_FOLDER_TYPE, "CamelPOP3Folder",
- sizeof (CamelPOP3Folder),
- sizeof (CamelPOP3FolderClass),
- (CamelObjectClassInitFunc) camel_pop3_folder_class_init,
- NULL,
- NULL,
- (CamelObjectFinalizeFunc) pop3_finalize);
- }
-
- return camel_pop3_folder_type;
-}
-
-static void
-pop3_finalize (CamelObject *object)
-{
- CamelPOP3Folder *pop3_folder = CAMEL_POP3_FOLDER (object);
- CamelPOP3FolderInfo **fi = (CamelPOP3FolderInfo **)pop3_folder->uids->pdata;
- CamelPOP3Store *pop3_store = (CamelPOP3Store *)((CamelFolder *)pop3_folder)->parent_store;
- int i;
-
- if (pop3_folder->uids) {
- for (i=0;i<pop3_folder->uids->len;i++,fi++) {
- if (fi[0]->cmd) {
- while (camel_pop3_engine_iterate(pop3_store->engine, fi[0]->cmd) > 0)
- ;
- camel_pop3_engine_command_free(pop3_store->engine, fi[0]->cmd);
- }
-
- g_free(fi[0]->uid);
- g_free(fi[0]);
- }
-
- g_ptr_array_free(pop3_folder->uids, TRUE);
- g_hash_table_destroy(pop3_folder->uids_uid);
- }
-}
-
-CamelFolder *
-camel_pop3_folder_new (CamelStore *parent, CamelException *ex)
-{
- CamelFolder *folder;
-
- d(printf("opening pop3 INBOX folder\n"));
-
- folder = CAMEL_FOLDER (camel_object_new (CAMEL_POP3_FOLDER_TYPE));
- camel_folder_construct (folder, parent, "inbox", "inbox");
-
- /* mt-ok, since we dont have the folder-lock for new() */
- camel_folder_refresh_info (folder, ex);/* mt-ok */
- if (camel_exception_is_set (ex)) {
- camel_object_unref (CAMEL_OBJECT (folder));
- folder = NULL;
- }
-
- return folder;
-}
-
-/* create a uid from md5 of 'top' output */
-static void
-cmd_builduid(CamelPOP3Engine *pe, CamelPOP3Stream *stream, void *data)
-{
- CamelPOP3FolderInfo *fi = data;
- MD5Context md5;
- unsigned char digest[16];
- struct _camel_header_raw *h;
- CamelMimeParser *mp;
-
- /* TODO; somehow work out the limit and use that for proper progress reporting
- We need a pointer to the folder perhaps? */
- camel_operation_progress_count(NULL, fi->id);
-
- md5_init(&md5);
- mp = camel_mime_parser_new();
- camel_mime_parser_init_with_stream(mp, (CamelStream *)stream);
- switch (camel_mime_parser_step(mp, NULL, NULL)) {
- case CAMEL_MIME_PARSER_STATE_HEADER:
- case CAMEL_MIME_PARSER_STATE_MESSAGE:
- case CAMEL_MIME_PARSER_STATE_MULTIPART:
- h = camel_mime_parser_headers_raw(mp);
- while (h) {
- if (strcasecmp(h->name, "status") != 0
- && strcasecmp(h->name, "x-status") != 0) {
- md5_update(&md5, h->name, strlen(h->name));
- md5_update(&md5, h->value, strlen(h->value));
- }
- h = h->next;
- }
- default:
- break;
- }
- camel_object_unref(mp);
- md5_final(&md5, digest);
- fi->uid = camel_base64_encode_simple(digest, 16);
-
- d(printf("building uid for id '%d' = '%s'\n", fi->id, fi->uid));
-}
-
-static void
-cmd_list(CamelPOP3Engine *pe, CamelPOP3Stream *stream, void *data)
-{
- int ret;
- unsigned int len, id, size;
- unsigned char *line;
- CamelFolder *folder = data;
- CamelPOP3Store *pop3_store = CAMEL_POP3_STORE (folder->parent_store);
- CamelPOP3FolderInfo *fi;
-
- do {
- ret = camel_pop3_stream_line(stream, &line, &len);
- if (ret>=0) {
- if (sscanf(line, "%u %u", &id, &size) == 2) {
- fi = g_malloc0(sizeof(*fi));
- fi->size = size;
- fi->id = id;
- fi->index = ((CamelPOP3Folder *)folder)->uids->len;
- if ((pop3_store->engine->capa & CAMEL_POP3_CAP_UIDL) == 0)
- fi->cmd = camel_pop3_engine_command_new(pe, CAMEL_POP3_COMMAND_MULTI, cmd_builduid, fi, "TOP %u 0\r\n", id);
- g_ptr_array_add(((CamelPOP3Folder *)folder)->uids, fi);
- g_hash_table_insert(((CamelPOP3Folder *)folder)->uids_id, GINT_TO_POINTER(id), fi);
- }
- }
- } while (ret>0);
-}
-
-static void
-cmd_uidl(CamelPOP3Engine *pe, CamelPOP3Stream *stream, void *data)
-{
- int ret;
- unsigned int len;
- unsigned char *line;
- char uid[1025];
- unsigned int id;
- CamelPOP3FolderInfo *fi;
- CamelPOP3Folder *folder = data;
-
- do {
- ret = camel_pop3_stream_line(stream, &line, &len);
- if (ret>=0) {
- if (strlen(line) > 1024)
- line[1024] = 0;
- if (sscanf(line, "%u %s", &id, uid) == 2) {
- fi = g_hash_table_lookup(folder->uids_id, GINT_TO_POINTER(id));
- if (fi) {
- camel_operation_progress(NULL, (fi->index+1) * 100 / folder->uids->len);
- fi->uid = g_strdup(uid);
- g_hash_table_insert(folder->uids_uid, fi->uid, fi);
- } else {
- g_warning("ID %u (uid: %s) not in previous LIST output", id, uid);
- }
- }
- }
- } while (ret>0);
-}
-
-static void
-pop3_refresh_info (CamelFolder *folder, CamelException *ex)
-{
- CamelPOP3Store *pop3_store = CAMEL_POP3_STORE (folder->parent_store);
- CamelPOP3Folder *pop3_folder = (CamelPOP3Folder *) folder;
- CamelPOP3Command *pcl, *pcu = NULL;
- int i;
-
- camel_operation_start (NULL, _("Retrieving POP summary"));
-
- pop3_folder->uids = g_ptr_array_new ();
- pop3_folder->uids_uid = g_hash_table_new(g_str_hash, g_str_equal);
- /* only used during setup */
- pop3_folder->uids_id = g_hash_table_new(NULL, NULL);
-
- pcl = camel_pop3_engine_command_new(pop3_store->engine, CAMEL_POP3_COMMAND_MULTI, cmd_list, folder, "LIST\r\n");
- if (pop3_store->engine->capa & CAMEL_POP3_CAP_UIDL) {
- pcu = camel_pop3_engine_command_new(pop3_store->engine, CAMEL_POP3_COMMAND_MULTI, cmd_uidl, folder, "UIDL\r\n");
- }
- while ((i = camel_pop3_engine_iterate(pop3_store->engine, NULL)) > 0)
- ;
-
- if (i == -1) {
- if (errno == EINTR)
- camel_exception_setv(ex, CAMEL_EXCEPTION_USER_CANCEL, _("User cancelled"));
- else
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Cannot get POP summary: %s"),
- g_strerror (errno));
- }
-
- /* TODO: check every id has a uid & commands returned OK too? */
-
- camel_pop3_engine_command_free(pop3_store->engine, pcl);
-
- if (pop3_store->engine->capa & CAMEL_POP3_CAP_UIDL) {
- camel_pop3_engine_command_free(pop3_store->engine, pcu);
- } else {
- for (i=0;i<pop3_folder->uids->len;i++) {
- CamelPOP3FolderInfo *fi = pop3_folder->uids->pdata[i];
- if (fi->cmd) {
- camel_pop3_engine_command_free(pop3_store->engine, fi->cmd);
- fi->cmd = NULL;
- }
- if (fi->uid)
- g_hash_table_insert(pop3_folder->uids_uid, fi->uid, fi);
- }
- }
-
- /* dont need this anymore */
- g_hash_table_destroy(pop3_folder->uids_id);
-
- camel_operation_end (NULL);
- return;
-}
-
-static void
-pop3_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
-{
- CamelPOP3Folder *pop3_folder;
- CamelPOP3Store *pop3_store;
- int i;
- CamelPOP3FolderInfo *fi;
-
- if (!expunge)
- return;
-
- pop3_folder = CAMEL_POP3_FOLDER (folder);
- pop3_store = CAMEL_POP3_STORE (folder->parent_store);
-
- camel_operation_start(NULL, _("Expunging deleted messages"));
-
- for (i = 0; i < pop3_folder->uids->len; i++) {
- fi = pop3_folder->uids->pdata[i];
- /* busy already? wait for that to finish first */
- if (fi->cmd) {
- while (camel_pop3_engine_iterate(pop3_store->engine, fi->cmd) > 0)
- ;
- camel_pop3_engine_command_free(pop3_store->engine, fi->cmd);
- fi->cmd = NULL;
- }
-
- if (fi->flags & CAMEL_MESSAGE_DELETED) {
- fi->cmd = camel_pop3_engine_command_new(pop3_store->engine, 0, NULL, NULL, "DELE %u\r\n", fi->id);
-
- /* also remove from cache */
- if (pop3_store->cache && fi->uid)
- camel_data_cache_remove(pop3_store->cache, "cache", fi->uid, NULL);
- }
- }
-
- for (i = 0; i < pop3_folder->uids->len; i++) {
- fi = pop3_folder->uids->pdata[i];
- /* wait for delete commands to finish */
- if (fi->cmd) {
- while (camel_pop3_engine_iterate(pop3_store->engine, fi->cmd) > 0)
- ;
- camel_pop3_engine_command_free(pop3_store->engine, fi->cmd);
- fi->cmd = NULL;
- }
- camel_operation_progress(NULL, (i+1) * 100 / pop3_folder->uids->len);
- }
-
- camel_operation_end(NULL);
-
- camel_pop3_store_expunge (pop3_store, ex);
-}
-
-static void
-cmd_tocache(CamelPOP3Engine *pe, CamelPOP3Stream *stream, void *data)
-{
- CamelPOP3FolderInfo *fi = data;
- char buffer[2048];
- int w = 0, n;
-
- /* What if it fails? */
-
- /* We write an '*' to the start of the stream to say its not complete yet */
- /* This should probably be part of the cache code */
- if ((n = camel_stream_write(fi->stream, "*", 1)) == -1)
- goto done;
-
- while ((n = camel_stream_read((CamelStream *)stream, buffer, sizeof(buffer))) > 0) {
- n = camel_stream_write(fi->stream, buffer, n);
- if (n == -1)
- break;
-
- w += n;
- if (w > fi->size)
- w = fi->size;
- if (fi->size != 0)
- camel_operation_progress(NULL, (w * 100) / fi->size);
- }
-
- /* it all worked, output a '#' to say we're a-ok */
- if (n != -1) {
- camel_stream_reset(fi->stream);
- n = camel_stream_write(fi->stream, "#", 1);
- }
-done:
- if (n == -1) {
- fi->err = errno;
- g_warning("POP3 retrieval failed: %s", strerror(errno));
- } else {
- fi->err = 0;
- }
-
- camel_object_unref((CamelObject *)fi->stream);
- fi->stream = NULL;
-}
-
-static CamelMimeMessage *
-pop3_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
-{
- CamelMimeMessage *message = NULL;
- CamelPOP3Store *pop3_store = CAMEL_POP3_STORE (folder->parent_store);
- CamelPOP3Folder *pop3_folder = (CamelPOP3Folder *)folder;
- CamelPOP3Command *pcr;
- CamelPOP3FolderInfo *fi;
- char buffer[1];
- int ok, i, last;
- CamelStream *stream = NULL;
-
- fi = g_hash_table_lookup(pop3_folder->uids_uid, uid);
- if (fi == NULL) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID_UID,
- _("No message with uid %s"), uid);
- return NULL;
- }
-
- /* Sigh, most of the crap in this function is so that the cancel button
- returns the proper exception code. Sigh. */
-
- camel_operation_start_transient(NULL, _("Retrieving POP message %d"), fi->id);
-
- /* If we have an oustanding retrieve message running, wait for that to complete
- & then retrieve from cache, otherwise, start a new one, and similar */
-
- if (fi->cmd != NULL) {
- while ((i = camel_pop3_engine_iterate(pop3_store->engine, fi->cmd)) > 0)
- ;
-
- if (i == -1)
- fi->err = errno;
-
- /* getting error code? */
- ok = fi->cmd->state == CAMEL_POP3_COMMAND_DATA;
- camel_pop3_engine_command_free(pop3_store->engine, fi->cmd);
- fi->cmd = NULL;
-
- if (fi->err != 0) {
- if (fi->err == EINTR)
- camel_exception_setv(ex, CAMEL_EXCEPTION_USER_CANCEL, _("User cancelled"));
- else
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Cannot get message %s: %s"),
- uid, g_strerror (fi->err));
- goto fail;
- }
- }
-
- /* check to see if we have safely written flag set */
- if (pop3_store->cache == NULL
- || (stream = camel_data_cache_get(pop3_store->cache, "cache", fi->uid, NULL)) == NULL
- || camel_stream_read(stream, buffer, 1) != 1
- || buffer[0] != '#') {
-
- /* Initiate retrieval, if disk backing fails, use a memory backing */
- if (pop3_store->cache == NULL
- || (stream = camel_data_cache_add(pop3_store->cache, "cache", fi->uid, NULL)) == NULL)
- stream = camel_stream_mem_new();
-
- /* ref it, the cache storage routine unref's when done */
- camel_object_ref((CamelObject *)stream);
- fi->stream = stream;
- fi->err = EIO;
- pcr = camel_pop3_engine_command_new(pop3_store->engine, CAMEL_POP3_COMMAND_MULTI, cmd_tocache, fi, "RETR %u\r\n", fi->id);
-
- /* Also initiate retrieval of some of the following messages, assume we'll be receiving them */
- if (pop3_store->cache != NULL) {
- /* This should keep track of the last one retrieved, also how many are still
- oustanding incase of random access on large folders */
- i = fi->index+1;
- last = MIN(i+10, pop3_folder->uids->len);
- for (;i<last;i++) {
- CamelPOP3FolderInfo *pfi = pop3_folder->uids->pdata[i];
-
- if (pfi->uid && pfi->cmd == NULL) {
- pfi->stream = camel_data_cache_add(pop3_store->cache, "cache", pfi->uid, NULL);
- if (pfi->stream) {
- pfi->err = EIO;
- pfi->cmd = camel_pop3_engine_command_new(pop3_store->engine, CAMEL_POP3_COMMAND_MULTI,
- cmd_tocache, pfi, "RETR %u\r\n", pfi->id);
- }
- }
- }
- }
-
- /* now wait for the first one to finish */
- while ((i = camel_pop3_engine_iterate(pop3_store->engine, pcr)) > 0)
- ;
-
- if (i == -1)
- fi->err = errno;
-
- /* getting error code? */
- ok = pcr->state == CAMEL_POP3_COMMAND_DATA;
- camel_pop3_engine_command_free(pop3_store->engine, pcr);
- camel_stream_reset(stream);
-
- /* Check to see we have safely written flag set */
- if (fi->err != 0) {
- if (fi->err == EINTR)
- camel_exception_setv(ex, CAMEL_EXCEPTION_USER_CANCEL, _("User cancelled"));
- else
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Cannot get message %s: %s"),
- uid, g_strerror (fi->err));
- goto done;
- }
-
- if (camel_stream_read(stream, buffer, 1) != 1 || buffer[0] != '#') {
- camel_exception_setv(ex, CAMEL_EXCEPTION_FOLDER_INVALID_UID,
- _("Cannot get message %s: %s"), uid, _("Unknown reason"));
- goto done;
- }
- }
-
- message = camel_mime_message_new ();
- if (camel_data_wrapper_construct_from_stream((CamelDataWrapper *)message, stream) == -1) {
- if (errno == EINTR)
- camel_exception_setv(ex, CAMEL_EXCEPTION_USER_CANCEL, _("User cancelled"));
- else
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Cannot get message %s: %s"),
- uid, g_strerror (errno));
- camel_object_unref((CamelObject *)message);
- message = NULL;
- }
-done:
- camel_object_unref((CamelObject *)stream);
-fail:
- camel_operation_end(NULL);
-
- return message;
-}
-
-static void
-pop3_set_message_flags (CamelFolder *folder, const char *uid, guint32 flags, guint32 set)
-{
- CamelPOP3Folder *pop3_folder = CAMEL_POP3_FOLDER (folder);
- CamelPOP3FolderInfo *fi;
-
- fi = g_hash_table_lookup(pop3_folder->uids_uid, uid);
- if (fi)
- fi->flags = (fi->flags & ~flags) | (set & flags);
-}
-
-static gint
-pop3_get_message_count (CamelFolder *folder)
-{
- CamelPOP3Folder *pop3_folder = CAMEL_POP3_FOLDER (folder);
-
- return pop3_folder->uids->len;
-}
-
-static GPtrArray *
-pop3_get_uids (CamelFolder *folder)
-{
- CamelPOP3Folder *pop3_folder = CAMEL_POP3_FOLDER (folder);
- GPtrArray *uids = g_ptr_array_new();
- CamelPOP3FolderInfo **fi = (CamelPOP3FolderInfo **)pop3_folder->uids->pdata;
- int i;
-
- for (i=0;i<pop3_folder->uids->len;i++,fi++) {
- if (fi[0]->uid)
- g_ptr_array_add(uids, fi[0]->uid);
- }
-
- return uids;
-}
diff --git a/camel/providers/pop3/camel-pop3-folder.h b/camel/providers/pop3/camel-pop3-folder.h
deleted file mode 100644
index 7dab07124c..0000000000
--- a/camel/providers/pop3/camel-pop3-folder.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-pop3-folder.h : Class for a POP3 folder */
-
-/*
- * Authors:
- * Dan Winship <danw@ximian.com>
- * Michael Zucchi <notzed@ximian.com>
- *
- * Copyright (C) 2002 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifndef CAMEL_POP3_FOLDER_H
-#define CAMEL_POP3_FOLDER_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include "camel-folder.h"
-
-#define CAMEL_POP3_FOLDER_TYPE (camel_pop3_folder_get_type ())
-#define CAMEL_POP3_FOLDER(obj) (CAMEL_CHECK_CAST((obj), CAMEL_POP3_FOLDER_TYPE, CamelPOP3Folder))
-#define CAMEL_POP3_FOLDER_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_POP3_FOLDER_TYPE, CamelPOP3FolderClass))
-#define CAMEL_IS_POP3_FOLDER(o) (CAMEL_CHECK_TYPE((o), CAMEL_POP3_FOLDER_TYPE))
-
-typedef struct {
- guint32 id;
- guint32 size;
- guint32 flags;
- guint32 index; /* index of request */
- char *uid;
- int err;
- struct _CamelPOP3Command *cmd;
- struct _CamelStream *stream;
-} CamelPOP3FolderInfo;
-
-typedef struct {
- CamelFolder parent_object;
-
- GPtrArray *uids;
- GHashTable *uids_uid; /* messageinfo by uid */
- GHashTable *uids_id; /* messageinfo by id */
-} CamelPOP3Folder;
-
-typedef struct {
- CamelFolderClass parent_class;
-
- /* Virtual methods */
-
-} CamelPOP3FolderClass;
-
-/* public methods */
-CamelFolder *camel_pop3_folder_new (CamelStore *parent, CamelException *ex);
-
-/* Standard Camel function */
-CamelType camel_pop3_folder_get_type (void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_POP3_FOLDER_H */
diff --git a/camel/providers/pop3/camel-pop3-provider.c b/camel/providers/pop3/camel-pop3-provider.c
deleted file mode 100644
index 1354470e69..0000000000
--- a/camel/providers/pop3/camel-pop3-provider.c
+++ /dev/null
@@ -1,108 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-pop3-provider.c: pop3 provider registration code */
-
-/*
- * Authors :
- * Dan Winship <danw@ximian.com>
- * Michael Zucchi <notzed@ximian.com>
- *
- * Copyright (C) 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "camel-pop3-store.h"
-#include "camel-provider.h"
-#include "camel-session.h"
-#include "camel-url.h"
-#include "camel-sasl.h"
-
-CamelProviderConfEntry pop3_conf_entries[] = {
- { CAMEL_PROVIDER_CONF_SECTION_START, NULL, NULL,
- N_("Message storage") },
- { CAMEL_PROVIDER_CONF_CHECKBOX, "keep_on_server", NULL,
- N_("Leave messages on server"), "0" },
-#ifdef NOT_FOR_1_0
- { CAMEL_PROVIDER_CONF_CHECKSPIN, "delete_after", "UNIMPLEMENTED",
- N_("Delete after %s day(s)"), "0:1:7:365" },
-#endif
- { CAMEL_PROVIDER_CONF_CHECKBOX, "disable_extensions", NULL,
- N_("Disable support for all POP3 extensions"), "0" },
- { CAMEL_PROVIDER_CONF_SECTION_END },
- { CAMEL_PROVIDER_CONF_END }
-};
-
-static CamelProvider pop3_provider = {
- "pop",
-
- N_("POP"),
-
- N_("For connecting to and downloading mail from POP servers."),
-
- "mail",
-
- CAMEL_PROVIDER_IS_REMOTE | CAMEL_PROVIDER_IS_SOURCE |
- CAMEL_PROVIDER_SUPPORTS_SSL,
-
- CAMEL_URL_NEED_USER | CAMEL_URL_NEED_HOST | CAMEL_URL_ALLOW_AUTH,
-
- pop3_conf_entries,
-
- /* ... */
-};
-
-CamelServiceAuthType camel_pop3_password_authtype = {
- N_("Password"),
-
- N_("This option will connect to the POP server using a plaintext "
- "password. This is the only option supported by many POP servers."),
-
- "",
- TRUE
-};
-
-CamelServiceAuthType camel_pop3_apop_authtype = {
- "APOP",
-
- N_("This option will connect to the POP server using an encrypted "
- "password via the APOP protocol. This may not work for all users "
- "even on servers that claim to support it."),
-
- "+APOP",
- TRUE
-};
-
-void
-camel_provider_module_init (CamelSession *session)
-{
- CamelServiceAuthType *auth;
-
- pop3_provider.object_types[CAMEL_PROVIDER_STORE] = camel_pop3_store_get_type();
- pop3_provider.url_hash = camel_url_hash;
- pop3_provider.url_equal = camel_url_equal;
-
- pop3_provider.authtypes = camel_sasl_authtype_list (FALSE);
- auth = camel_sasl_authtype("LOGIN");
- if (auth)
- pop3_provider.authtypes = g_list_prepend(pop3_provider.authtypes, auth);
- pop3_provider.authtypes = g_list_prepend(pop3_provider.authtypes, &camel_pop3_apop_authtype);
- pop3_provider.authtypes = g_list_prepend(pop3_provider.authtypes, &camel_pop3_password_authtype);
-
- camel_session_register_provider(session, &pop3_provider);
-}
diff --git a/camel/providers/pop3/camel-pop3-store.c b/camel/providers/pop3/camel-pop3-store.c
deleted file mode 100644
index fbdae86833..0000000000
--- a/camel/providers/pop3/camel-pop3-store.c
+++ /dev/null
@@ -1,657 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-pop3-store.c : class for a pop3 store */
-
-/*
- * Authors:
- * Dan Winship <danw@ximian.com>
- * Michael Zucchi <notzed@ximian.com>
- *
- * Copyright (C) 2000-2002 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <errno.h>
-
-#include "camel-operation.h"
-
-#include "camel-pop3-store.h"
-#include "camel-pop3-folder.h"
-#include "camel-stream-buffer.h"
-#include "camel-session.h"
-#include "camel-exception.h"
-#include "camel-url.h"
-#include "e-util/md5-utils.h"
-#include "camel-pop3-engine.h"
-#include "camel-sasl.h"
-#include "camel-data-cache.h"
-#include "camel-tcp-stream.h"
-#include "camel-tcp-stream-raw.h"
-#ifdef HAVE_SSL
-#include "camel-tcp-stream-ssl.h"
-#endif
-
-/* Specified in RFC 1939 */
-#define POP3_PORT 110
-
-static CamelStoreClass *parent_class = NULL;
-
-static void finalize (CamelObject *object);
-
-static gboolean pop3_connect (CamelService *service, CamelException *ex);
-static gboolean pop3_disconnect (CamelService *service, gboolean clean, CamelException *ex);
-static GList *query_auth_types (CamelService *service, CamelException *ex);
-
-static CamelFolder *get_folder (CamelStore *store, const char *folder_name,
- guint32 flags, CamelException *ex);
-
-static void init_trash (CamelStore *store);
-static CamelFolder *get_trash (CamelStore *store, CamelException *ex);
-
-static void
-camel_pop3_store_class_init (CamelPOP3StoreClass *camel_pop3_store_class)
-{
- CamelServiceClass *camel_service_class =
- CAMEL_SERVICE_CLASS (camel_pop3_store_class);
- CamelStoreClass *camel_store_class =
- CAMEL_STORE_CLASS (camel_pop3_store_class);
-
- parent_class = CAMEL_STORE_CLASS (camel_type_get_global_classfuncs (camel_store_get_type ()));
-
- /* virtual method overload */
- camel_service_class->query_auth_types = query_auth_types;
- camel_service_class->connect = pop3_connect;
- camel_service_class->disconnect = pop3_disconnect;
-
- camel_store_class->get_folder = get_folder;
- camel_store_class->init_trash = init_trash;
- camel_store_class->get_trash = get_trash;
-}
-
-
-
-static void
-camel_pop3_store_init (gpointer object, gpointer klass)
-{
- ;
-}
-
-CamelType
-camel_pop3_store_get_type (void)
-{
- static CamelType camel_pop3_store_type = CAMEL_INVALID_TYPE;
-
- if (!camel_pop3_store_type) {
- camel_pop3_store_type = camel_type_register (CAMEL_STORE_TYPE,
- "CamelPOP3Store",
- sizeof (CamelPOP3Store),
- sizeof (CamelPOP3StoreClass),
- (CamelObjectClassInitFunc) camel_pop3_store_class_init,
- NULL,
- (CamelObjectInitFunc) camel_pop3_store_init,
- finalize);
- }
-
- return camel_pop3_store_type;
-}
-
-static void
-finalize (CamelObject *object)
-{
- CamelPOP3Store *pop3_store = CAMEL_POP3_STORE (object);
-
- /* force disconnect so we dont have it run later, after we've cleaned up some stuff */
- /* SIGH */
-
- camel_service_disconnect((CamelService *)pop3_store, TRUE, NULL);
-
- if (pop3_store->engine)
- camel_object_unref((CamelObject *)pop3_store->engine);
- if (pop3_store->cache)
- camel_object_unref((CamelObject *)pop3_store->cache);
-}
-
-enum {
- USE_SSL_NEVER,
- USE_SSL_ALWAYS,
- USE_SSL_WHEN_POSSIBLE
-};
-
-#define SSL_PORT_FLAGS (CAMEL_TCP_STREAM_SSL_ENABLE_SSL2 | CAMEL_TCP_STREAM_SSL_ENABLE_SSL3)
-#define STARTTLS_FLAGS (CAMEL_TCP_STREAM_SSL_ENABLE_TLS)
-
-static gboolean
-connect_to_server (CamelService *service, int ssl_mode, int try_starttls, CamelException *ex)
-{
- CamelPOP3Store *store = CAMEL_POP3_STORE (service);
- CamelStream *tcp_stream;
- CamelPOP3Command *pc;
- struct hostent *h;
- guint32 flags = 0;
- int clean_quit;
- int ret, port;
-
- h = camel_service_gethost (service, ex);
- if (!h)
- return FALSE;
-
- port = service->url->port ? service->url->port : 110;
-
- if (ssl_mode != USE_SSL_NEVER) {
-#ifdef HAVE_SSL
- if (try_starttls) {
- tcp_stream = camel_tcp_stream_ssl_new_raw (service->session, service->url->host, STARTTLS_FLAGS);
- } else {
- port = service->url->port ? service->url->port : 995;
- tcp_stream = camel_tcp_stream_ssl_new (service->session, service->url->host, SSL_PORT_FLAGS);
- }
-#else
- if (!try_starttls)
- port = service->url->port ? service->url->port : 995;
-
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
- _("Could not connect to %s (port %d): %s"),
- service->url->host, port,
- _("SSL unavailable"));
-
- camel_free_host (h);
-
- return FALSE;
-#endif /* HAVE_SSL */
- } else {
- tcp_stream = camel_tcp_stream_raw_new ();
- }
-
- ret = camel_tcp_stream_connect (CAMEL_TCP_STREAM (tcp_stream), h, port);
- camel_free_host (h);
- if (ret == -1) {
- if (errno == EINTR)
- camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
- _("Connection cancelled"));
- else
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
- _("Could not connect to POP server %s (port %d): %s"),
- service->url->host, port, g_strerror (errno));
-
- camel_object_unref (CAMEL_OBJECT (tcp_stream));
-
- return FALSE;
- }
-
- /* parent class connect initialization */
- if (CAMEL_SERVICE_CLASS (parent_class)->connect (service, ex) == FALSE) {
- camel_object_unref (CAMEL_OBJECT (tcp_stream));
- return FALSE;
- }
-
- if (camel_url_get_param (service->url, "disable_extensions"))
- flags |= CAMEL_POP3_ENGINE_DISABLE_EXTENSIONS;
-
- store->engine = camel_pop3_engine_new (tcp_stream, flags);
-
-#ifdef HAVE_SSL
- if (store->engine) {
- if (ssl_mode == USE_SSL_WHEN_POSSIBLE) {
- if (store->engine->capa & CAMEL_POP3_CAP_STLS)
- goto starttls;
- } else if (ssl_mode == USE_SSL_ALWAYS) {
- if (try_starttls) {
- if (store->engine->capa & CAMEL_POP3_CAP_STLS) {
- /* attempt to toggle STARTTLS mode */
- goto starttls;
- } else {
- /* server doesn't support STARTTLS, abort */
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Failed to connect to POP server %s in secure mode: %s"),
- service->url->host, _("SSL/TLS extension not supported."));
- /* we have the possibility of quitting cleanly here */
- clean_quit = TRUE;
- goto stls_exception;
- }
- }
- }
- }
-#endif /* HAVE_SSL */
-
- camel_object_unref (CAMEL_OBJECT (tcp_stream));
-
- return store->engine != NULL;
-
-#ifdef HAVE_SSL
- starttls:
- /* as soon as we send a STLS command, all hope is lost of a clean QUIT if problems arise */
- clean_quit = FALSE;
-
- pc = camel_pop3_engine_command_new (store->engine, 0, NULL, NULL, "STLS\r\n");
- while (camel_pop3_engine_iterate (store->engine, NULL) > 0)
- ;
-
- ret = pc->state == CAMEL_POP3_COMMAND_OK;
- camel_pop3_engine_command_free (store->engine, pc);
-
- if (ret == FALSE) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Failed to connect to POP server %s in secure mode: %s"),
- service->url->host, store->engine->line);
- goto stls_exception;
- }
-
- /* Okay, now toggle SSL/TLS mode */
- ret = camel_tcp_stream_ssl_enable_ssl (CAMEL_TCP_STREAM_SSL (tcp_stream));
-
- camel_object_unref (CAMEL_OBJECT (tcp_stream));
-
- if (ret == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Failed to connect to POP server %s in secure mode: %s"),
- service->url->host, _("SSL negotiations failed"));
- goto stls_exception;
- }
-
- /* rfc2595, section 4 states that after a successful STLS
- command, the client MUST discard prior CAPA responses */
- camel_pop3_engine_reget_capabilities (store->engine);
-
- return TRUE;
-
- stls_exception:
- if (clean_quit) {
- /* try to disconnect cleanly */
- pc = camel_pop3_engine_command_new (store->engine, 0, NULL, NULL, "QUIT\r\n");
- while (camel_pop3_engine_iterate (store->engine, NULL) > 0)
- ;
- camel_pop3_engine_command_free (store->engine, pc);
- }
-
- camel_object_unref (CAMEL_OBJECT (store->engine));
- camel_object_unref (CAMEL_OBJECT (tcp_stream));
- store->engine = NULL;
-
- return FALSE;
-#endif /* HAVE_SSL */
-}
-
-static struct {
- char *value;
- int mode;
-} ssl_options[] = {
- { "", USE_SSL_ALWAYS },
- { "always", USE_SSL_ALWAYS },
- { "when-possible", USE_SSL_WHEN_POSSIBLE },
- { "never", USE_SSL_NEVER },
- { NULL, USE_SSL_NEVER },
-};
-
-static gboolean
-connect_to_server_wrapper (CamelService *service, CamelException *ex)
-{
-#ifdef HAVE_SSL
- const char *use_ssl;
- int i, ssl_mode;
-
- use_ssl = camel_url_get_param (service->url, "use_ssl");
- if (use_ssl) {
- for (i = 0; ssl_options[i].value; i++)
- if (!strcmp (ssl_options[i].value, use_ssl))
- break;
- ssl_mode = ssl_options[i].mode;
- } else
- ssl_mode = USE_SSL_NEVER;
-
- if (ssl_mode == USE_SSL_ALWAYS) {
- /* First try the ssl port */
- if (!connect_to_server (service, ssl_mode, FALSE, ex)) {
- if (camel_exception_get_id (ex) == CAMEL_EXCEPTION_SERVICE_UNAVAILABLE) {
- /* The ssl port seems to be unavailable, lets try STARTTLS */
- camel_exception_clear (ex);
- return connect_to_server (service, ssl_mode, TRUE, ex);
- } else {
- return FALSE;
- }
- }
-
- return TRUE;
- } else if (ssl_mode == USE_SSL_WHEN_POSSIBLE) {
- /* If the server supports STARTTLS, use it */
- return connect_to_server (service, ssl_mode, TRUE, ex);
- } else {
- /* User doesn't care about SSL */
- return connect_to_server (service, ssl_mode, FALSE, ex);
- }
-#else
- return connect_to_server (service, USE_SSL_NEVER, FALSE, ex);
-#endif
-}
-
-extern CamelServiceAuthType camel_pop3_password_authtype;
-extern CamelServiceAuthType camel_pop3_apop_authtype;
-
-static GList *
-query_auth_types (CamelService *service, CamelException *ex)
-{
- CamelPOP3Store *store = CAMEL_POP3_STORE (service);
- GList *types = NULL;
-
- types = CAMEL_SERVICE_CLASS (parent_class)->query_auth_types (service, ex);
- if (camel_exception_is_set (ex))
- return NULL;
-
- if (connect_to_server_wrapper (service, NULL)) {
- types = g_list_concat(types, g_list_copy(store->engine->auth));
- pop3_disconnect (service, TRUE, NULL);
- } else {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
- _("Could not connect to POP server %s"),
- service->url->host);
- }
-
- return types;
-}
-
-/**
- * camel_pop3_store_expunge:
- * @store: the store
- * @ex: a CamelException
- *
- * Expunge messages from the store. This will result in the connection
- * being closed, which may cause later commands to fail if they can't
- * reconnect.
- **/
-void
-camel_pop3_store_expunge (CamelPOP3Store *store, CamelException *ex)
-{
- CamelPOP3Command *pc;
-
- pc = camel_pop3_engine_command_new(store->engine, 0, NULL, NULL, "QUIT\r\n");
- while (camel_pop3_engine_iterate(store->engine, NULL) > 0)
- ;
- camel_pop3_engine_command_free(store->engine, pc);
-
- camel_service_disconnect (CAMEL_SERVICE (store), FALSE, ex);
-}
-
-static int
-try_sasl(CamelPOP3Store *store, const char *mech, CamelException *ex)
-{
- CamelPOP3Stream *stream = store->engine->stream;
- unsigned char *line, *resp;
- CamelSasl *sasl;
- unsigned int len;
- int ret;
-
- sasl = camel_sasl_new("pop3", mech, (CamelService *)store);
- if (sasl == NULL) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_URL_INVALID,
- _("Unable to connect to POP server %s: "
- "No support for requested authentication mechanism."),
- CAMEL_SERVICE (store)->url->host);
- return -1;
- }
-
- if (camel_stream_printf((CamelStream *)stream, "AUTH %s\r\n", mech) == -1)
- goto ioerror;
-
- while (1) {
- if (camel_pop3_stream_line(stream, &line, &len) == -1)
- goto ioerror;
- if (strncmp(line, "+OK", 3) == 0)
- break;
- if (strncmp(line, "-ERR", 4) == 0) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
- _("SASL `%s' Login failed for POP server %s: %s"),
- mech, CAMEL_SERVICE (store)->url->host, line);
- goto done;
- }
- /* If we dont get continuation, or the sasl object's run out of work, or we dont get a challenge,
- its a protocol error, so fail, and try reset the server */
- if (strncmp(line, "+ ", 2) != 0
- || camel_sasl_authenticated(sasl)
- || (resp = camel_sasl_challenge_base64(sasl, line+2, ex)) == NULL) {
- camel_stream_printf((CamelStream *)stream, "*\r\n");
- camel_pop3_stream_line(stream, &line, &len);
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
- _("Cannot login to POP server %s: SASL Protocol error"),
- CAMEL_SERVICE (store)->url->host);
- goto done;
- }
-
- ret = camel_stream_printf((CamelStream *)stream, "%s\r\n", resp);
- g_free(resp);
- if (ret == -1)
- goto ioerror;
-
- }
- camel_object_unref((CamelObject *)sasl);
- return 0;
-
- ioerror:
- if (errno == EINTR) {
- camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL, _("Cancelled"));
- } else {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Failed to authenticate on POP server %s: %s"),
- CAMEL_SERVICE (store)->url->host, g_strerror (errno));
- }
- done:
- camel_object_unref((CamelObject *)sasl);
- return -1;
-}
-
-static int
-pop3_try_authenticate (CamelService *service, gboolean reprompt, const char *errmsg, CamelException *ex)
-{
- CamelPOP3Store *store = (CamelPOP3Store *)service;
- CamelPOP3Command *pcu = NULL, *pcp = NULL;
- int status;
-
- /* override, testing only */
- /*printf("Forcing authmech to 'login'\n");
- service->url->authmech = g_strdup("LOGIN");*/
-
- if (!service->url->passwd) {
- char *prompt;
-
- prompt = g_strdup_printf (_("%sPlease enter the POP password for %s@%s"),
- errmsg ? errmsg : "",
- service->url->user,
- service->url->host);
- service->url->passwd = camel_session_get_password (camel_service_get_session (service),
- prompt, reprompt, TRUE, service, "password", ex);
- g_free (prompt);
- if (!service->url->passwd)
- return FALSE;
- }
-
- if (!service->url->authmech) {
- /* pop engine will take care of pipelining ability */
- pcu = camel_pop3_engine_command_new(store->engine, 0, NULL, NULL, "USER %s\r\n", service->url->user);
- pcp = camel_pop3_engine_command_new(store->engine, 0, NULL, NULL, "PASS %s\r\n", service->url->passwd);
- } else if (strcmp(service->url->authmech, "+APOP") == 0 && store->engine->apop) {
- char *secret, md5asc[33], *d;
- unsigned char md5sum[16], *s;
-
- secret = g_alloca(strlen(store->engine->apop)+strlen(service->url->passwd)+1);
- sprintf(secret, "%s%s", store->engine->apop, service->url->passwd);
- md5_get_digest(secret, strlen (secret), md5sum);
-
- for (s = md5sum, d = md5asc; d < md5asc + 32; s++, d += 2)
- sprintf (d, "%.2x", *s);
-
- pcp = camel_pop3_engine_command_new(store->engine, 0, NULL, NULL, "APOP %s %s\r\n",
- service->url->user, md5asc);
- } else {
- CamelServiceAuthType *auth;
- GList *l;
-
- l = store->engine->auth;
- while (l) {
- auth = l->data;
- if (strcmp(auth->authproto, service->url->authmech) == 0)
- return try_sasl(store, service->url->authmech, ex) == -1;
- l = l->next;
- }
-
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_URL_INVALID,
- _("Unable to connect to POP server %s: "
- "No support for requested authentication mechanism."),
- CAMEL_SERVICE (store)->url->host);
- return FALSE;
- }
-
- while ((status = camel_pop3_engine_iterate(store->engine, pcp)) > 0)
- ;
-
- if (status == -1) {
- if (errno == EINTR) {
- camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL, _("Cancelled"));
- } else {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Unable to connect to POP server %s.\n"
- "Error sending password: %s"),
- CAMEL_SERVICE (store)->url->host,
- errno ? g_strerror (errno) : _("Unknown error"));
- }
- } else if (pcp->state != CAMEL_POP3_COMMAND_OK)
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
- _("Unable to connect to POP server %s.\n"
- "Error sending password: %s"),
- CAMEL_SERVICE (store)->url->host,
- store->engine->line ? (char *)store->engine->line : _("Unknown error"));
-
- camel_pop3_engine_command_free(store->engine, pcp);
-
- if (pcu)
- camel_pop3_engine_command_free(store->engine, pcu);
-
- return status;
-}
-
-static gboolean
-pop3_connect (CamelService *service, CamelException *ex)
-{
- CamelPOP3Store *store = (CamelPOP3Store *)service;
- gboolean reprompt = FALSE;
- CamelSession *session;
- char *errbuf = NULL;
- int status;
-
- session = camel_service_get_session (service);
-
- if (store->cache == NULL) {
- char *root;
-
- root = camel_session_get_storage_path (session, service, ex);
- if (root) {
- store->cache = camel_data_cache_new(root, 0, ex);
- g_free(root);
- if (store->cache) {
- /* Default cache expiry - 1 week or not visited in a day */
- camel_data_cache_set_expire_age(store->cache, 60*60*24*7);
- camel_data_cache_set_expire_access(store->cache, 60*60*24);
- }
- }
- }
-
- if (!connect_to_server_wrapper (service, ex))
- return FALSE;
-
- do {
- camel_exception_clear (ex);
- status = pop3_try_authenticate (service, reprompt, errbuf, ex);
- g_free (errbuf);
- errbuf = NULL;
-
- /* we only re-prompt if we failed to authenticate, any other error and we just abort */
- if (camel_exception_get_id (ex) == CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE) {
- errbuf = g_strdup_printf ("%s\n\n", camel_exception_get_description (ex));
- g_free (service->url->passwd);
- service->url->passwd = NULL;
- reprompt = TRUE;
- }
- } while (status != -1 && ex->id == CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE);
-
- g_free (errbuf);
-
- if (status == -1 || camel_exception_is_set(ex)) {
- camel_service_disconnect(service, TRUE, ex);
- return FALSE;
- }
-
- /* Now that we are in the TRANSACTION state, try regetting the capabilities */
- store->engine->state = CAMEL_POP3_ENGINE_TRANSACTION;
- camel_pop3_engine_reget_capabilities (store->engine);
-
- return TRUE;
-}
-
-static gboolean
-pop3_disconnect (CamelService *service, gboolean clean, CamelException *ex)
-{
- CamelPOP3Store *store = CAMEL_POP3_STORE (service);
-
- if (clean) {
- CamelPOP3Command *pc;
-
- pc = camel_pop3_engine_command_new(store->engine, 0, NULL, NULL, "QUIT\r\n");
- while (camel_pop3_engine_iterate(store->engine, NULL) > 0)
- ;
- camel_pop3_engine_command_free(store->engine, pc);
- }
-
- if (!CAMEL_SERVICE_CLASS (parent_class)->disconnect (service, clean, ex))
- return FALSE;
-
- camel_object_unref((CamelObject *)store->engine);
- store->engine = NULL;
-
- return TRUE;
-}
-
-static CamelFolder *
-get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex)
-{
- if (strcasecmp (folder_name, "inbox") != 0) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID,
- _("No such folder `%s'."), folder_name);
- return NULL;
- }
- return camel_pop3_folder_new (store, ex);
-}
-
-static void
-init_trash (CamelStore *store)
-{
- /* no-op */
- ;
-}
-
-static CamelFolder *
-get_trash (CamelStore *store, CamelException *ex)
-{
- /* no-op */
- return NULL;
-}
diff --git a/camel/providers/pop3/camel-pop3-store.h b/camel/providers/pop3/camel-pop3-store.h
deleted file mode 100644
index 3b9b1f7ae1..0000000000
--- a/camel/providers/pop3/camel-pop3-store.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-pop3-store.h : class for an pop3 store */
-
-/*
- * Authors:
- * Dan Winship <danw@ximian.com>
- * Michael Zucchi <notzed@ximian.com>
- *
- * Copyright (C) 2000-2002 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifndef CAMEL_POP3_STORE_H
-#define CAMEL_POP3_STORE_H 1
-
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include <camel/camel-types.h>
-#include <camel/camel-store.h>
-#include "camel-pop3-engine.h"
-
-#define CAMEL_POP3_STORE_TYPE (camel_pop3_store_get_type ())
-#define CAMEL_POP3_STORE(obj) (CAMEL_CHECK_CAST((obj), CAMEL_POP3_STORE_TYPE, CamelPOP3Store))
-#define CAMEL_POP3_STORE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_POP3_STORE_TYPE, CamelPOP3StoreClass))
-#define CAMEL_IS_POP3_STORE(o) (CAMEL_CHECK_TYPE((o), CAMEL_POP3_STORE_TYPE))
-
-
-typedef struct {
- CamelStore parent_object;
-
- CamelPOP3Engine *engine; /* pop processing engine */
-
- struct _CamelDataCache *cache;
-} CamelPOP3Store;
-
-
-
-typedef struct {
- CamelStoreClass parent_class;
-
-} CamelPOP3StoreClass;
-
-
-/* public methods */
-void camel_pop3_store_expunge (CamelPOP3Store *store, CamelException *ex);
-
-/* support functions */
-enum { CAMEL_POP3_OK, CAMEL_POP3_ERR, CAMEL_POP3_FAIL };
-int camel_pop3_command (CamelPOP3Store *store, char **ret, CamelException *ex, char *fmt, ...);
-char *camel_pop3_command_get_additional_data (CamelPOP3Store *store, int total, CamelException *ex);
-
-/* Standard Camel function */
-CamelType camel_pop3_store_get_type (void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_POP3_STORE_H */
-
-
diff --git a/camel/providers/pop3/camel-pop3-stream.c b/camel/providers/pop3/camel-pop3-stream.c
deleted file mode 100644
index cb27bece26..0000000000
--- a/camel/providers/pop3/camel-pop3-stream.c
+++ /dev/null
@@ -1,471 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; fill-column: 160 -*-
- *
- * Author:
- * Michael Zucchi <notzed@ximian.com>
- *
- * Copyright 2002 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-/* This is *identical* to the camel-nntp-stream, so should probably
- work out a way to merge them */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <errno.h>
-
-#include <string.h>
-#include <stdio.h>
-
-#include <glib.h>
-
-#include "camel-pop3-stream.h"
-
-extern int camel_verbose_debug;
-#define dd(x) (camel_verbose_debug?(x):0)
-
-static CamelObjectClass *parent_class = NULL;
-
-/* Returns the class for a CamelStream */
-#define CS_CLASS(so) CAMEL_POP3_STREAM_CLASS(CAMEL_OBJECT_GET_CLASS(so))
-
-#define CAMEL_POP3_STREAM_SIZE (4096)
-#define CAMEL_POP3_STREAM_LINE (1024) /* maximum line size */
-
-static int
-stream_fill(CamelPOP3Stream *is)
-{
- int left = 0;
-
- if (is->source) {
- left = is->end - is->ptr;
- memcpy(is->buf, is->ptr, left);
- is->end = is->buf + left;
- is->ptr = is->buf;
- left = camel_stream_read(is->source, is->end, CAMEL_POP3_STREAM_SIZE - (is->end - is->buf));
- if (left > 0) {
- is->end += left;
- is->end[0] = '\n';
- return is->end - is->ptr;
- } else {
- dd(printf("POP3_STREAM_FILL(ERROR): '%s'\n", strerror (errno)));
- return -1;
- }
- }
-
- return 0;
-}
-
-static ssize_t
-stream_read(CamelStream *stream, char *buffer, size_t n)
-{
- CamelPOP3Stream *is = (CamelPOP3Stream *)stream;
- char *o, *oe;
- unsigned char *p, *e, c;
- int state;
-
- if (is->mode != CAMEL_POP3_STREAM_DATA || n == 0)
- return 0;
-
- o = buffer;
- oe = buffer + n;
- state = is->state;
-
- /* Need to copy/strip '.'s and whatnot */
- p = is->ptr;
- e = is->end;
-
- switch(state) {
- state_0:
- case 0: /* start of line, always read at least 3 chars */
- while (e - p < 3) {
- is->ptr = p;
- if (stream_fill(is) == -1)
- return -1;
- p = is->ptr;
- e = is->end;
- }
- if (p[0] == '.') {
- if (p[1] == '\r' && p[2] == '\n') {
- is->ptr = p+3;
- is->mode = CAMEL_POP3_STREAM_EOD;
- is->state = 0;
- dd(printf("POP3_STREAM_READ(%d):\n%.*s\n", o-buffer, o-buffer, buffer));
- return o-buffer;
- }
- p++;
- }
- state = 1;
- /* FALLS THROUGH */
- case 1: /* looking for next sol */
- while (o < oe) {
- c = *p++;
- if (c == '\n') {
- /* end of input sentinal check */
- if (p > e) {
- is->ptr = e;
- if (stream_fill(is) == -1)
- return -1;
- p = is->ptr;
- e = is->end;
- } else {
- *o++ = '\n';
- state = 0;
- goto state_0;
- }
- } else if (c != '\r') {
- *o++ = c;
- }
- }
- break;
- }
-
- is->ptr = p;
- is->state = state;
-
- dd(printf("POP3_STREAM_READ(%d):\n%.*s\n", o-buffer, o-buffer, buffer));
-
- return o-buffer;
-}
-
-static ssize_t
-stream_write(CamelStream *stream, const char *buffer, size_t n)
-{
- CamelPOP3Stream *is = (CamelPOP3Stream *)stream;
-
- if (strncmp (buffer, "PASS ", 5) != 0)
- dd(printf("POP3_STREAM_WRITE(%d):\n%.*s\n", n, (int)n, buffer));
- else
- dd(printf("POP3_STREAM_WRITE(%d):\nPASS xxxxxxxx\n", n));
-
- return camel_stream_write(is->source, buffer, n);
-}
-
-static int
-stream_close(CamelStream *stream)
-{
- /* nop? */
- return 0;
-}
-
-static int
-stream_flush(CamelStream *stream)
-{
- /* nop? */
- return 0;
-}
-
-static gboolean
-stream_eos(CamelStream *stream)
-{
- CamelPOP3Stream *is = (CamelPOP3Stream *)stream;
-
- return is->mode != CAMEL_POP3_STREAM_DATA;
-}
-
-static int
-stream_reset(CamelStream *stream)
-{
- /* nop? reset literal mode? */
- return 0;
-}
-
-static void
-camel_pop3_stream_class_init (CamelStreamClass *camel_pop3_stream_class)
-{
- CamelStreamClass *camel_stream_class = (CamelStreamClass *)camel_pop3_stream_class;
-
- parent_class = camel_type_get_global_classfuncs( CAMEL_OBJECT_TYPE );
-
- /* virtual method definition */
- camel_stream_class->read = stream_read;
- camel_stream_class->write = stream_write;
- camel_stream_class->close = stream_close;
- camel_stream_class->flush = stream_flush;
- camel_stream_class->eos = stream_eos;
- camel_stream_class->reset = stream_reset;
-}
-
-static void
-camel_pop3_stream_init(CamelPOP3Stream *is, CamelPOP3StreamClass *isclass)
-{
- /* +1 is room for appending a 0 if we need to for a line */
- is->ptr = is->end = is->buf = g_malloc(CAMEL_POP3_STREAM_SIZE+1);
- is->lineptr = is->linebuf = g_malloc(CAMEL_POP3_STREAM_LINE+1);
- is->lineend = is->linebuf + CAMEL_POP3_STREAM_LINE;
-
- /* init sentinal */
- is->ptr[0] = '\n';
-
- is->state = 0;
- is->mode = CAMEL_POP3_STREAM_LINE;
-}
-
-static void
-camel_pop3_stream_finalise(CamelPOP3Stream *is)
-{
- g_free(is->buf);
- g_free(is->linebuf);
- if (is->source)
- camel_object_unref((CamelObject *)is->source);
-}
-
-CamelType
-camel_pop3_stream_get_type (void)
-{
- static CamelType camel_pop3_stream_type = CAMEL_INVALID_TYPE;
-
- if (camel_pop3_stream_type == CAMEL_INVALID_TYPE) {
- camel_pop3_stream_type = camel_type_register( camel_stream_get_type(),
- "CamelPOP3Stream",
- sizeof( CamelPOP3Stream ),
- sizeof( CamelPOP3StreamClass ),
- (CamelObjectClassInitFunc) camel_pop3_stream_class_init,
- NULL,
- (CamelObjectInitFunc) camel_pop3_stream_init,
- (CamelObjectFinalizeFunc) camel_pop3_stream_finalise );
- }
-
- return camel_pop3_stream_type;
-}
-
-/**
- * camel_pop3_stream_new:
- *
- * Returns a NULL stream. A null stream is always at eof, and
- * always returns success for all reads and writes.
- *
- * Return value: the stream
- **/
-CamelStream *
-camel_pop3_stream_new(CamelStream *source)
-{
- CamelPOP3Stream *is;
-
- is = (CamelPOP3Stream *)camel_object_new(camel_pop3_stream_get_type ());
- camel_object_ref((CamelObject *)source);
- is->source = source;
-
- return (CamelStream *)is;
-}
-
-/* Get one line from the pop3 stream */
-int
-camel_pop3_stream_line(CamelPOP3Stream *is, unsigned char **data, unsigned int *len)
-{
- register unsigned char c, *p, *o, *oe;
- int newlen, oldlen;
- unsigned char *e;
-
- if (is->mode == CAMEL_POP3_STREAM_EOD) {
- *data = is->linebuf;
- *len = 0;
- return 0;
- }
-
- o = is->linebuf;
- oe = is->lineend - 1;
- p = is->ptr;
- e = is->end;
-
- /* Data mode, convert leading '..' to '.', and stop when we reach a solitary '.' */
- if (is->mode == CAMEL_POP3_STREAM_DATA) {
- /* need at least 3 chars in buffer */
- while (e-p < 3) {
- is->ptr = p;
- if (stream_fill(is) == -1)
- return -1;
- p = is->ptr;
- e = is->end;
- }
-
- /* check for isolated '.\r\n' or begging of line '.' */
- if (p[0] == '.') {
- if (p[1] == '\r' && p[2] == '\n') {
- is->ptr = p+3;
- is->mode = CAMEL_POP3_STREAM_EOD;
- *data = is->linebuf;
- *len = 0;
- is->linebuf[0] = 0;
-
- dd(printf("POP3_STREAM_LINE(END)\n"));
-
- return 0;
- }
- p++;
- }
- }
-
- while (1) {
- while (o < oe) {
- c = *p++;
- if (c == '\n') {
- /* sentinal? */
- if (p> e) {
- is->ptr = e;
- if (stream_fill(is) == -1)
- return -1;
- p = is->ptr;
- e = is->end;
- } else {
- is->ptr = p;
- *data = is->linebuf;
- *len = o - is->linebuf;
- *o = 0;
-
- dd(printf("POP3_STREAM_LINE(%d): '%s'\n", *len, *data));
-
- return 1;
- }
- } else if (c != '\r') {
- *o++ = c;
- }
- }
-
- /* limit this for bad server data? */
- oldlen = o - is->linebuf;
- newlen = (is->lineend - is->linebuf) * 3 / 2;
- is->lineptr = is->linebuf = g_realloc(is->linebuf, newlen);
- is->lineend = is->linebuf + newlen;
- oe = is->lineend - 1;
- o = is->linebuf + oldlen;
- }
-
- return -1;
-}
-
-/* returns -1 on error, 0 if last lot of data, >0 if more remaining */
-int camel_pop3_stream_gets(CamelPOP3Stream *is, unsigned char **start, unsigned int *len)
-{
- int max;
- unsigned char *end;
-
- *len = 0;
-
- max = is->end - is->ptr;
- if (max == 0) {
- max = stream_fill(is);
- if (max <= 0)
- return max;
- }
-
- *start = is->ptr;
- end = memchr(is->ptr, '\n', max);
- if (end)
- max = (end - is->ptr) + 1;
- *start = is->ptr;
- *len = max;
- is->ptr += max;
-
- dd(printf("POP3_STREAM_GETS(%s,%d): '%.*s'\n", end==NULL?"more":"last", *len, (int)*len, *start));
-
- return end == NULL?1:0;
-}
-
-void camel_pop3_stream_set_mode(CamelPOP3Stream *is, camel_pop3_stream_mode_t mode)
-{
- is->mode = mode;
-}
-
-/* returns -1 on erorr, 0 if last data, >0 if more data left */
-int camel_pop3_stream_getd(CamelPOP3Stream *is, unsigned char **start, unsigned int *len)
-{
- unsigned char *p, *e, *s;
- int state;
-
- *len = 0;
-
- if (is->mode == CAMEL_POP3_STREAM_EOD)
- return 0;
-
- if (is->mode == CAMEL_POP3_STREAM_LINE) {
- g_warning("pop3_stream reading data in line mode\n");
- return 0;
- }
-
- state = is->state;
- p = is->ptr;
- e = is->end;
-
- while (e - p < 3) {
- is->ptr = p;
- if (stream_fill(is) == -1)
- return -1;
- p = is->ptr;
- e = is->end;
- }
-
- s = p;
-
- do {
- switch(state) {
- case 0:
- /* check leading '.', ... */
- if (p[0] == '.') {
- if (p[1] == '\r' && p[2] == '\n') {
- is->ptr = p+3;
- *len = p-s;
- *start = s;
- is->mode = CAMEL_POP3_STREAM_EOD;
- is->state = 0;
-
- dd(printf("POP3_STREAM_GETD(%s,%d): '%.*s'\n", "last", *len, (int)*len, *start));
-
- return 0;
- }
-
- /* If at start, just skip '.', else return data upto '.' but skip it */
- if (p == s) {
- s++;
- p++;
- } else {
- is->ptr = p+1;
- *len = p-s;
- *start = s;
- is->state = 1;
-
- dd(printf("POP3_STREAM_GETD(%s,%d): '%.*s'\n", "more", *len, (int)*len, *start));
-
- return 1;
- }
- }
- state = 1;
- case 1:
- /* Scan for sentinal */
- while ((*p++)!='\n')
- ;
-
- if (p > e) {
- p = e;
- } else {
- state = 0;
- }
- break;
- }
- } while ((e-p) >= 3);
-
- is->state = state;
- is->ptr = p;
- *len = p-s;
- *start = s;
-
- dd(printf("POP3_STREAM_GETD(%s,%d): '%.*s'\n", "more", *len, (int)*len, *start));
-
- return 1;
-}
diff --git a/camel/providers/pop3/camel-pop3-stream.h b/camel/providers/pop3/camel-pop3-stream.h
deleted file mode 100644
index 2a4ebc01f2..0000000000
--- a/camel/providers/pop3/camel-pop3-stream.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (C) 2002 Ximian Inc.
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-/* This is *identical* to the camel-nntp-stream, so should probably
- work out a way to merge them */
-
-#ifndef _CAMEL_POP3_STREAM_H
-#define _CAMEL_POP3_STREAM_H
-
-#include <camel/camel-stream.h>
-
-#define CAMEL_POP3_STREAM(obj) CAMEL_CHECK_CAST (obj, camel_pop3_stream_get_type (), CamelPOP3Stream)
-#define CAMEL_POP3_STREAM_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_pop3_stream_get_type (), CamelPOP3StreamClass)
-#define CAMEL_IS_POP3_STREAM(obj) CAMEL_CHECK_TYPE (obj, camel_pop3_stream_get_type ())
-
-typedef struct _CamelPOP3StreamClass CamelPOP3StreamClass;
-typedef struct _CamelPOP3Stream CamelPOP3Stream;
-
-typedef enum {
- CAMEL_POP3_STREAM_LINE,
- CAMEL_POP3_STREAM_DATA,
- CAMEL_POP3_STREAM_EOD, /* end of data, acts as if end of stream */
-} camel_pop3_stream_mode_t;
-
-struct _CamelPOP3Stream {
- CamelStream parent;
-
- CamelStream *source;
-
- camel_pop3_stream_mode_t mode;
- int state;
-
- unsigned char *buf, *ptr, *end;
- unsigned char *linebuf, *lineptr, *lineend;
-};
-
-struct _CamelPOP3StreamClass {
- CamelStreamClass parent_class;
-};
-
-CamelType camel_pop3_stream_get_type (void);
-
-CamelStream *camel_pop3_stream_new (CamelStream *source);
-
-
-void camel_pop3_stream_set_mode (CamelPOP3Stream *is, camel_pop3_stream_mode_t mode);
-
-int camel_pop3_stream_line (CamelPOP3Stream *is, unsigned char **data, unsigned int *len);
-int camel_pop3_stream_gets (CamelPOP3Stream *is, unsigned char **start, unsigned int *len);
-int camel_pop3_stream_getd (CamelPOP3Stream *is, unsigned char **start, unsigned int *len);
-
-#endif /* ! _CAMEL_POP3_STREAM_H */
diff --git a/camel/providers/pop3/libcamelpop3.urls b/camel/providers/pop3/libcamelpop3.urls
deleted file mode 100644
index 7fffa4d861..0000000000
--- a/camel/providers/pop3/libcamelpop3.urls
+++ /dev/null
@@ -1 +0,0 @@
-pop
diff --git a/camel/providers/sendmail/.cvsignore b/camel/providers/sendmail/.cvsignore
deleted file mode 100644
index 097fdedafb..0000000000
--- a/camel/providers/sendmail/.cvsignore
+++ /dev/null
@@ -1,11 +0,0 @@
-Makefile
-Makefile.in
-.deps
-.libs
-*.lo
-*.la
-*.o
-*.bb
-*.bbg
-*.da
-*.gcov
diff --git a/camel/providers/sendmail/Makefile.am b/camel/providers/sendmail/Makefile.am
deleted file mode 100644
index 8c75af2de8..0000000000
--- a/camel/providers/sendmail/Makefile.am
+++ /dev/null
@@ -1,28 +0,0 @@
-## Process this file with automake to produce Makefile.in
-
-libcamelsendmailincludedir = $(privincludedir)/camel
-
-camel_provider_LTLIBRARIES = libcamelsendmail.la
-camel_provider_DATA = libcamelsendmail.urls
-
-INCLUDES = \
- -I.. \
- -I$(srcdir)/.. \
- -I$(srcdir)/../../.. \
- -I$(top_srcdir)/intl \
- -I$(top_srcdir)/camel \
- $(CAMEL_CFLAGS) \
- $(GNOME_INCLUDEDIR) \
- $(GTK_INCLUDEDIR) \
- -DG_LOG_DOMAIN=\"camel-sendmail-provider\"
-
-libcamelsendmail_la_SOURCES = \
- camel-sendmail-provider.c \
- camel-sendmail-transport.c
-
-libcamelsendmailinclude_HEADERS = \
- camel-sendmail-transport.h
-
-libcamelsendmail_la_LDFLAGS = -avoid-version -module
-
-EXTRA_DIST = libcamelsendmail.urls
diff --git a/camel/providers/sendmail/camel-sendmail-provider.c b/camel/providers/sendmail/camel-sendmail-provider.c
deleted file mode 100644
index 9615dff1b4..0000000000
--- a/camel/providers/sendmail/camel-sendmail-provider.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-sendmail-provider.c: sendmail provider registration code */
-
-/*
- * Authors :
- * Dan Winship <danw@ximian.com>
- *
- * Copyright (C) 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "camel-provider.h"
-#include "camel-sendmail-transport.h"
-#include "camel-session.h"
-#include "camel-url.h"
-
-static CamelProvider sendmail_provider = {
- "sendmail",
- N_("Sendmail"),
-
- N_("For delivering mail by passing it to the \"sendmail\" program "
- "on the local system."),
-
- "mail",
-
- 0, /* flags */
-
- 0, /* url_flags */
-
- /* ... */
-};
-
-void
-camel_provider_module_init (CamelSession *session)
-{
- sendmail_provider.object_types[CAMEL_PROVIDER_TRANSPORT] =
- camel_sendmail_transport_get_type();
-
- sendmail_provider.url_hash = camel_url_hash;
- sendmail_provider.url_equal = camel_url_equal;
-
- camel_session_register_provider (session, &sendmail_provider);
-}
-
-
-
diff --git a/camel/providers/sendmail/camel-sendmail-transport.c b/camel/providers/sendmail/camel-sendmail-transport.c
deleted file mode 100644
index fbf6f08a6b..0000000000
--- a/camel/providers/sendmail/camel-sendmail-transport.c
+++ /dev/null
@@ -1,262 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-sendmail-transport.c: Sendmail-based transport class. */
-
-/*
- *
- * Authors: Dan Winship <danw@ximian.com>
- *
- * Copyright 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <errno.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <sys/wait.h>
-#include <unistd.h>
-#include <string.h>
-
-#include "camel-sendmail-transport.h"
-#include "camel-mime-filter-crlf.h"
-#include "camel-stream-filter.h"
-#include "camel-mime-message.h"
-#include "camel-data-wrapper.h"
-#include "camel-stream-fs.h"
-#include "camel-exception.h"
-
-static char *get_name (CamelService *service, gboolean brief);
-
-static gboolean sendmail_send_to (CamelTransport *transport,
- CamelMimeMessage *message,
- CamelAddress *from, CamelAddress *recipients,
- CamelException *ex);
-
-
-static void
-camel_sendmail_transport_class_init (CamelSendmailTransportClass *camel_sendmail_transport_class)
-{
- CamelTransportClass *camel_transport_class =
- CAMEL_TRANSPORT_CLASS (camel_sendmail_transport_class);
- CamelServiceClass *camel_service_class =
- CAMEL_SERVICE_CLASS (camel_sendmail_transport_class);
-
- /* virtual method overload */
- camel_service_class->get_name = get_name;
- camel_transport_class->send_to = sendmail_send_to;
-}
-
-CamelType
-camel_sendmail_transport_get_type (void)
-{
- static CamelType camel_sendmail_transport_type = CAMEL_INVALID_TYPE;
-
- if (camel_sendmail_transport_type == CAMEL_INVALID_TYPE) {
- camel_sendmail_transport_type =
- camel_type_register (CAMEL_TRANSPORT_TYPE, "CamelSendmailTransport",
- sizeof (CamelSendmailTransport),
- sizeof (CamelSendmailTransportClass),
- (CamelObjectClassInitFunc) camel_sendmail_transport_class_init,
- NULL,
- (CamelObjectInitFunc) NULL,
- NULL);
- }
-
- return camel_sendmail_transport_type;
-}
-
-
-static gboolean
-sendmail_send_to (CamelTransport *transport, CamelMimeMessage *message,
- CamelAddress *from, CamelAddress *recipients,
- CamelException *ex)
-{
- struct _camel_header_raw *header, *savedbcc, *n, *tail;
- const char *from_addr, *addr, **argv;
- int i, len, fd[2], nullfd, wstat;
- CamelStreamFilter *filter;
- CamelMimeFilter *crlf;
- sigset_t mask, omask;
- CamelStream *out;
- pid_t pid;
-
- if (!camel_internet_address_get (CAMEL_INTERNET_ADDRESS (from), 0, NULL, &from_addr))
- return FALSE;
-
- len = camel_address_length (recipients);
- argv = g_malloc ((len + 6) * sizeof (char *));
- argv[0] = "sendmail";
- argv[1] = "-i";
- argv[2] = "-f";
- argv[3] = from_addr;
- argv[4] = "--";
-
- for (i = 0; i < len; i++) {
- if (!camel_internet_address_get (CAMEL_INTERNET_ADDRESS (recipients), i, NULL, &addr)) {
- camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not parse recipient list"));
- g_free (argv);
- return FALSE;
- }
-
- argv[i + 5] = addr;
- }
-
- argv[i + 5] = NULL;
-
- /* unlink the bcc headers */
- savedbcc = NULL;
- tail = (struct _camel_header_raw *) &savedbcc;
-
- header = (struct _camel_header_raw *) &CAMEL_MIME_PART (message)->headers;
- n = header->next;
- while (n != NULL) {
- if (!strcasecmp (n->name, "Bcc")) {
- header->next = n->next;
- tail->next = n;
- n->next = NULL;
- tail = n;
- } else {
- header = n;
- }
-
- n = header->next;
- }
-
- if (pipe (fd) == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not create pipe to sendmail: "
- "%s: mail not sent"),
- g_strerror (errno));
-
- /* restore the bcc headers */
- header->next = savedbcc;
-
- return FALSE;
- }
-
- /* Block SIGCHLD so the calling application doesn't notice
- * sendmail exiting before we do.
- */
- sigemptyset (&mask);
- sigaddset (&mask, SIGCHLD);
- sigprocmask (SIG_BLOCK, &mask, &omask);
-
- pid = fork ();
- switch (pid) {
- case -1:
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not fork sendmail: "
- "%s: mail not sent"),
- g_strerror (errno));
- sigprocmask (SIG_SETMASK, &omask, NULL);
- g_free (argv);
-
- /* restore the bcc headers */
- header->next = savedbcc;
-
- return FALSE;
- case 0:
- /* Child process */
- nullfd = open ("/dev/null", O_RDWR);
- dup2 (fd[0], STDIN_FILENO);
- /*dup2 (nullfd, STDOUT_FILENO);
- dup2 (nullfd, STDERR_FILENO);*/
- close (nullfd);
- close (fd[1]);
-
- execv (SENDMAIL_PATH, (char **)argv);
- _exit (255);
- }
- g_free (argv);
-
- /* Parent process. Write the message out. */
- close (fd[0]);
- out = camel_stream_fs_new_with_fd (fd[1]);
-
- /* workaround for lame sendmail implementations that can't handle CRLF eoln sequences */
- filter = camel_stream_filter_new_with_stream (out);
- crlf = camel_mime_filter_crlf_new (CAMEL_MIME_FILTER_CRLF_DECODE, CAMEL_MIME_FILTER_CRLF_MODE_CRLF_ONLY);
- camel_stream_filter_add (filter, crlf);
- camel_object_unref (crlf);
- camel_object_unref (out);
-
- out = (CamelStream *) filter;
- if (camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (message), out) == -1
- || camel_stream_close (out) == -1) {
- camel_object_unref (CAMEL_OBJECT (out));
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not send message: %s"),
- g_strerror (errno));
-
- /* Wait for sendmail to exit. */
- while (waitpid (pid, &wstat, 0) == -1 && errno == EINTR)
- ;
-
- sigprocmask (SIG_SETMASK, &omask, NULL);
-
- /* restore the bcc headers */
- header->next = savedbcc;
-
- return FALSE;
- }
-
- camel_object_unref (CAMEL_OBJECT (out));
-
- /* Wait for sendmail to exit. */
- while (waitpid (pid, &wstat, 0) == -1 && errno == EINTR)
- ;
-
- sigprocmask (SIG_SETMASK, &omask, NULL);
-
- /* restore the bcc headers */
- header->next = savedbcc;
-
- if (!WIFEXITED (wstat)) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("sendmail exited with signal %s: "
- "mail not sent."),
- g_strsignal (WTERMSIG (wstat)));
- return FALSE;
- } else if (WEXITSTATUS (wstat) != 0) {
- if (WEXITSTATUS (wstat) == 255) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not execute %s: "
- "mail not sent."),
- SENDMAIL_PATH);
- } else {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("sendmail exited with status "
- "%d: mail not sent."),
- WEXITSTATUS (wstat));
- }
- return FALSE;
- }
-
- return TRUE;
-}
-
-static char *
-get_name (CamelService *service, gboolean brief)
-{
- if (brief)
- return g_strdup (_("sendmail"));
- else
- return g_strdup (_("Mail delivery via the sendmail program"));
-}
diff --git a/camel/providers/sendmail/camel-sendmail-transport.h b/camel/providers/sendmail/camel-sendmail-transport.h
deleted file mode 100644
index 056be03bc8..0000000000
--- a/camel/providers/sendmail/camel-sendmail-transport.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-sendmail-transport.h: Sendmail-based transport class */
-
-/*
- *
- * Author :
- * Dan Winship <danw@ximian.com>
- *
- * Copyright 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifndef CAMEL_SENDMAIL_TRANSPORT_H
-#define CAMEL_SENDMAIL_TRANSPORT_H 1
-
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus }*/
-
-#include "camel-transport.h"
-
-#define CAMEL_SENDMAIL_TRANSPORT_TYPE (camel_sendmail_transport_get_type ())
-#define CAMEL_SENDMAIL_TRANSPORT(obj) (CAMEL_CHECK_CAST((obj), CAMEL_SENDMAIL_TRANSPORT_TYPE, CamelSendmailTransport))
-#define CAMEL_SENDMAIL_TRANSPORT_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_SENDMAIL_TRANSPORT_TYPE, CamelSendmailTransportClass))
-#define CAMEL_IS_SENDMAIL_TRANSPORT(o) (CAMEL_CHECK_TYPE((o), CAMEL_SENDMAIL_TRANSPORT_TYPE))
-
-
-typedef struct {
- CamelTransport parent_object;
-
-} CamelSendmailTransport;
-
-
-typedef struct {
- CamelTransportClass parent_class;
-
-} CamelSendmailTransportClass;
-
-
-/* Standard Camel function */
-CamelType camel_sendmail_transport_get_type (void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_SENDMAIL_TRANSPORT_H */
diff --git a/camel/providers/sendmail/libcamelsendmail.urls b/camel/providers/sendmail/libcamelsendmail.urls
deleted file mode 100644
index ccad52828e..0000000000
--- a/camel/providers/sendmail/libcamelsendmail.urls
+++ /dev/null
@@ -1 +0,0 @@
-sendmail
diff --git a/camel/providers/smtp/.cvsignore b/camel/providers/smtp/.cvsignore
deleted file mode 100644
index b948585108..0000000000
--- a/camel/providers/smtp/.cvsignore
+++ /dev/null
@@ -1,10 +0,0 @@
-.deps
-.libs
-Makefile
-Makefile.in
-*.lo
-*.la
-*.bb
-*.bbg
-*.da
-*.gcov
diff --git a/camel/providers/smtp/Makefile.am b/camel/providers/smtp/Makefile.am
deleted file mode 100644
index b6bba766d6..0000000000
--- a/camel/providers/smtp/Makefile.am
+++ /dev/null
@@ -1,35 +0,0 @@
-## Process this file with automake to produce Makefile.in
-
-libcamelsmtpincludedir = $(privincludedir)/camel
-
-camel_provider_LTLIBRARIES = libcamelsmtp.la
-camel_provider_DATA = libcamelsmtp.urls
-
-INCLUDES = \
- -I.. \
- -I$(srcdir)/.. \
- -I$(srcdir)/../../.. \
- -I$(top_srcdir)/intl \
- -I$(top_srcdir)/camel \
- -I$(top_srcdir)/e-util \
- $(CAMEL_CFLAGS) \
- $(GNOME_INCLUDEDIR) \
- $(GTK_INCLUDEDIR) \
- $(NSPR_CFLAGS) \
- $(NSS_CFLAGS) \
- $(OPENSSL_CFLAGS) \
- -DG_LOG_DOMAIN=\"camel-smtp-provider\"
-
-libcamelsmtp_la_SOURCES = \
- camel-smtp-provider.c \
- camel-smtp-transport.c
-
-libcamelsmtpinclude_HEADERS = \
- camel-smtp-transport.h
-
-
-libcamelsmtp_la_LDFLAGS = -avoid-version -module
-
-libcamelsmtp_la_LIBADD = $(top_builddir)/e-util/libeutil.la
-
-EXTRA_DIST = libcamelsmtp.urls
diff --git a/camel/providers/smtp/camel-smtp-provider.c b/camel/providers/smtp/camel-smtp-provider.c
deleted file mode 100644
index 07991eb695..0000000000
--- a/camel/providers/smtp/camel-smtp-provider.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-smtp-provider.c: smtp provider registration code */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2002 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "camel-smtp-transport.h"
-#include "camel-provider.h"
-#include "camel-session.h"
-#include "camel-url.h"
-#include "camel-sasl.h"
-
-static CamelProvider smtp_provider = {
- "smtp",
- N_("SMTP"),
-
- N_("For delivering mail by connecting to a remote mailhub "
- "using SMTP.\n"),
-
- "mail",
-
- CAMEL_PROVIDER_IS_REMOTE | CAMEL_PROVIDER_SUPPORTS_SSL,
-
- CAMEL_URL_NEED_HOST | CAMEL_URL_ALLOW_AUTH | CAMEL_URL_ALLOW_USER,
-
- /* ... */
-};
-
-void
-camel_provider_module_init (CamelSession *session)
-{
- smtp_provider.object_types[CAMEL_PROVIDER_TRANSPORT] =
- camel_smtp_transport_get_type ();
- smtp_provider.authtypes = g_list_append (camel_sasl_authtype_list (TRUE), camel_sasl_authtype ("LOGIN"));
- smtp_provider.authtypes = g_list_append (smtp_provider.authtypes, camel_sasl_authtype ("POPB4SMTP"));
- smtp_provider.url_hash = camel_url_hash;
- smtp_provider.url_equal = camel_url_equal;
-
- camel_session_register_provider (session, &smtp_provider);
-}
-
-
-
diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c
deleted file mode 100644
index 5bf5add2ee..0000000000
--- a/camel/providers/smtp/camel-smtp-transport.c
+++ /dev/null
@@ -1,1455 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-smtp-transport.c : class for a smtp transport */
-
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright (C) 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <unistd.h>
-#undef MIN
-#undef MAX
-#include "camel-mime-filter-crlf.h"
-#include "camel-stream-filter.h"
-#include "camel-smtp-transport.h"
-#include "camel-mime-message.h"
-#include "camel-multipart.h"
-#include "camel-mime-part.h"
-#include "camel-operation.h"
-#include "camel-stream-buffer.h"
-#include "camel-tcp-stream.h"
-#include "camel-tcp-stream-raw.h"
-#ifdef HAVE_SSL
-#include "camel-tcp-stream-ssl.h"
-#endif
-#include "camel-session.h"
-#include "camel-exception.h"
-#include "camel-sasl.h"
-
-
-extern int camel_verbose_debug;
-#define d(x) (camel_verbose_debug ? (x) : 0)
-
-/* Specified in RFC 821 */
-#define SMTP_PORT 25
-
-/* camel smtp transport class prototypes */
-static gboolean smtp_send_to (CamelTransport *transport, CamelMimeMessage *message,
- CamelAddress *from, CamelAddress *recipients, CamelException *ex);
-
-/* support prototypes */
-static void smtp_construct (CamelService *service, CamelSession *session,
- CamelProvider *provider, CamelURL *url,
- CamelException *ex);
-static gboolean smtp_connect (CamelService *service, CamelException *ex);
-static gboolean smtp_disconnect (CamelService *service, gboolean clean, CamelException *ex);
-static GHashTable *esmtp_get_authtypes (const unsigned char *buffer);
-static GList *query_auth_types (CamelService *service, CamelException *ex);
-static char *get_name (CamelService *service, gboolean brief);
-
-static gboolean smtp_helo (CamelSmtpTransport *transport, CamelException *ex);
-static gboolean smtp_auth (CamelSmtpTransport *transport, const char *mech, CamelException *ex);
-static gboolean smtp_mail (CamelSmtpTransport *transport, const char *sender,
- gboolean has_8bit_parts, CamelException *ex);
-static gboolean smtp_rcpt (CamelSmtpTransport *transport, const char *recipient, CamelException *ex);
-static gboolean smtp_data (CamelSmtpTransport *transport, CamelMimeMessage *message, CamelException *ex);
-static gboolean smtp_rset (CamelSmtpTransport *transport, CamelException *ex);
-static gboolean smtp_quit (CamelSmtpTransport *transport, CamelException *ex);
-
-static void smtp_set_exception (CamelSmtpTransport *transport, const char *respbuf,
- const char *message, CamelException *ex);
-
-/* private data members */
-static CamelTransportClass *parent_class = NULL;
-
-static void
-camel_smtp_transport_class_init (CamelSmtpTransportClass *camel_smtp_transport_class)
-{
- CamelTransportClass *camel_transport_class =
- CAMEL_TRANSPORT_CLASS (camel_smtp_transport_class);
- CamelServiceClass *camel_service_class =
- CAMEL_SERVICE_CLASS (camel_smtp_transport_class);
-
- parent_class = CAMEL_TRANSPORT_CLASS (camel_type_get_global_classfuncs (camel_transport_get_type ()));
-
- /* virtual method overload */
- camel_service_class->construct = smtp_construct;
- camel_service_class->connect = smtp_connect;
- camel_service_class->disconnect = smtp_disconnect;
- camel_service_class->query_auth_types = query_auth_types;
- camel_service_class->get_name = get_name;
-
- camel_transport_class->send_to = smtp_send_to;
-}
-
-static void
-camel_smtp_transport_init (gpointer object)
-{
- CamelSmtpTransport *smtp = CAMEL_SMTP_TRANSPORT (object);
-
- smtp->flags = 0;
- smtp->connected = FALSE;
-}
-
-CamelType
-camel_smtp_transport_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (CAMEL_TRANSPORT_TYPE,
- "CamelSmtpTransport",
- sizeof (CamelSmtpTransport),
- sizeof (CamelSmtpTransportClass),
- (CamelObjectClassInitFunc) camel_smtp_transport_class_init,
- NULL,
- (CamelObjectInitFunc) camel_smtp_transport_init,
- NULL);
- }
-
- return type;
-}
-
-static void
-smtp_construct (CamelService *service, CamelSession *session,
- CamelProvider *provider, CamelURL *url,
- CamelException *ex)
-{
- CamelSmtpTransport *smtp_transport = CAMEL_SMTP_TRANSPORT (service);
- const char *use_ssl;
-
- CAMEL_SERVICE_CLASS (parent_class)->construct (service, session, provider, url, ex);
-
- if ((use_ssl = camel_url_get_param (url, "use_ssl"))) {
- /* Note: previous versions would use "" to toggle use_ssl to 'on' */
- if (!*use_ssl || !strcmp (use_ssl, "always"))
- smtp_transport->flags |= CAMEL_SMTP_TRANSPORT_USE_SSL_ALWAYS;
- else if (!strcmp (use_ssl, "when-possible"))
- smtp_transport->flags |= CAMEL_SMTP_TRANSPORT_USE_SSL_WHEN_POSSIBLE;
- }
-}
-
-static const char *
-smtp_error_string (int error)
-{
- /* SMTP error codes grabbed from rfc821 */
- switch (error) {
- case 0:
- /* looks like a read problem, check errno */
- if (errno)
- return g_strerror (errno);
- else
- return _("Unknown");
- case 500:
- return _("Syntax error, command unrecognized");
- case 501:
- return _("Syntax error in parameters or arguments");
- case 502:
- return _("Command not implemented");
- case 504:
- return _("Command parameter not implemented");
- case 211:
- return _("System status, or system help reply");
- case 214:
- return _("Help message");
- case 220:
- return _("Service ready");
- case 221:
- return _("Service closing transmission channel");
- case 421:
- return _("Service not available, closing transmission channel");
- case 250:
- return _("Requested mail action okay, completed");
- case 251:
- return _("User not local; will forward to <forward-path>");
- case 450:
- return _("Requested mail action not taken: mailbox unavailable");
- case 550:
- return _("Requested action not taken: mailbox unavailable");
- case 451:
- return _("Requested action aborted: error in processing");
- case 551:
- return _("User not local; please try <forward-path>");
- case 452:
- return _("Requested action not taken: insufficient system storage");
- case 552:
- return _("Requested mail action aborted: exceeded storage allocation");
- case 553:
- return _("Requested action not taken: mailbox name not allowed");
- case 354:
- return _("Start mail input; end with <CRLF>.<CRLF>");
- case 554:
- return _("Transaction failed");
-
- /* AUTH error codes: */
- case 432:
- return _("A password transition is needed");
- case 534:
- return _("Authentication mechanism is too weak");
- case 538:
- return _("Encryption required for requested authentication mechanism");
- case 454:
- return _("Temporary authentication failure");
- case 530:
- return _("Authentication required");
-
- default:
- return _("Unknown");
- }
-}
-
-#define SSL_PORT_FLAGS (CAMEL_TCP_STREAM_SSL_ENABLE_SSL2 | CAMEL_TCP_STREAM_SSL_ENABLE_SSL3)
-#define STARTTLS_FLAGS (CAMEL_TCP_STREAM_SSL_ENABLE_TLS)
-
-static gboolean
-connect_to_server (CamelService *service, int try_starttls, CamelException *ex)
-{
- CamelSmtpTransport *transport = CAMEL_SMTP_TRANSPORT (service);
- CamelStream *tcp_stream;
- char *respbuf = NULL;
- struct hostent *h;
- int port, ret;
-
- if (!CAMEL_SERVICE_CLASS (parent_class)->connect (service, ex))
- return FALSE;
-
- h = camel_service_gethost (service, ex);
- if (!h)
- return FALSE;
-
- /* set some smtp transport defaults */
- transport->flags &= CAMEL_SMTP_TRANSPORT_USE_SSL; /* reset all but ssl flags */
- transport->authtypes = NULL;
-
- port = service->url->port ? service->url->port : SMTP_PORT;
-
- if (transport->flags & CAMEL_SMTP_TRANSPORT_USE_SSL) {
-#ifdef HAVE_SSL
- if (try_starttls) {
- tcp_stream = camel_tcp_stream_ssl_new_raw (service->session, service->url->host, STARTTLS_FLAGS);
- } else {
- port = service->url->port ? service->url->port : 465;
- tcp_stream = camel_tcp_stream_ssl_new (service->session, service->url->host, SSL_PORT_FLAGS);
- }
-#else
- if (!try_starttls)
- port = service->url->port ? service->url->port : 465;
-
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
- _("Could not connect to %s (port %d): %s"),
- service->url->host, port,
- _("SSL unavailable"));
-
- camel_free_host (h);
-
- return FALSE;
-#endif /* HAVE_SSL */
- } else {
- tcp_stream = camel_tcp_stream_raw_new ();
- }
-
- ret = camel_tcp_stream_connect (CAMEL_TCP_STREAM (tcp_stream), h, port);
- camel_free_host (h);
- if (ret == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
- _("Could not connect to %s (port %d): %s"),
- service->url->host, port,
- g_strerror (errno));
-
- camel_object_unref (tcp_stream);
-
- return FALSE;
- }
-
- transport->connected = TRUE;
-
- /* get the localaddr - needed later by smtp_helo */
- transport->localaddr = camel_tcp_stream_get_local_address (CAMEL_TCP_STREAM (tcp_stream));
-
- transport->ostream = tcp_stream;
- transport->istream = camel_stream_buffer_new (tcp_stream, CAMEL_STREAM_BUFFER_READ);
-
- /* Read the greeting, note whether the server is ESMTP or not. */
- do {
- /* Check for "220" */
- g_free (respbuf);
- respbuf = camel_stream_buffer_read_line (CAMEL_STREAM_BUFFER (transport->istream));
- if (!respbuf || strncmp (respbuf, "220", 3)) {
- smtp_set_exception (transport, respbuf, _("Welcome response error"), ex);
- g_free (respbuf);
- return FALSE;
- }
- } while (*(respbuf+3) == '-'); /* if we got "220-" then loop again */
- g_free (respbuf);
-
- /* Try sending EHLO */
- transport->flags |= CAMEL_SMTP_TRANSPORT_IS_ESMTP;
- if (!smtp_helo (transport, ex)) {
- if (!transport->connected)
- return FALSE;
-
- /* Fall back to HELO */
- camel_exception_clear (ex);
- transport->flags &= ~CAMEL_SMTP_TRANSPORT_IS_ESMTP;
- if (!smtp_helo (transport, ex) && !transport->connected)
- return FALSE;
- }
-
- /* clear any EHLO/HELO exception and assume that any SMTP errors encountered were non-fatal */
- camel_exception_clear (ex);
-
-#ifdef HAVE_SSL
- if (transport->flags & CAMEL_SMTP_TRANSPORT_USE_SSL_WHEN_POSSIBLE) {
- /* try_starttls is always TRUE here */
- if (transport->flags & CAMEL_SMTP_TRANSPORT_STARTTLS)
- goto starttls;
- } else if (transport->flags & CAMEL_SMTP_TRANSPORT_USE_SSL_ALWAYS) {
- if (try_starttls) {
- if (transport->flags & CAMEL_SMTP_TRANSPORT_STARTTLS) {
- goto starttls;
- } else {
- /* server doesn't support STARTTLS, abort */
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Failed to connect to SMTP server %s in secure mode: %s"),
- service->url->host, _("server does not appear to support SSL"));
- goto exception_cleanup;
- }
- }
- }
-#endif /* HAVE_SSL */
-
- return TRUE;
-
-#ifdef HAVE_SSL
- starttls:
- d(fprintf (stderr, "sending : STARTTLS\r\n"));
- if (camel_stream_write (tcp_stream, "STARTTLS\r\n", 10) == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("STARTTLS request timed out: %s"),
- g_strerror (errno));
- goto exception_cleanup;
- }
-
- respbuf = NULL;
-
- do {
- /* Check for "220 Ready for TLS" */
- g_free (respbuf);
- respbuf = camel_stream_buffer_read_line (CAMEL_STREAM_BUFFER (transport->istream));
-
- d(fprintf (stderr, "received: %s\n", respbuf ? respbuf : "(null)"));
-
- if (!respbuf || strncmp (respbuf, "220", 3)) {
- smtp_set_exception (transport, respbuf, _("STARTTLS response error"), ex);
- g_free (respbuf);
- goto exception_cleanup;
- }
- } while (*(respbuf+3) == '-'); /* if we got "220-" then loop again */
-
- /* Okay, now toggle SSL/TLS mode */
- if (camel_tcp_stream_ssl_enable_ssl (CAMEL_TCP_STREAM_SSL (tcp_stream)) == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Failed to connect to SMTP server %s in secure mode: %s"),
- service->url->host, g_strerror (errno));
- goto exception_cleanup;
- }
-
- /* We are supposed to re-EHLO after a successful STARTTLS to
- re-fetch any supported extensions. */
- if (!smtp_helo (transport, ex) && !transport->connected)
- return FALSE;
-
- return TRUE;
-
- exception_cleanup:
-
- camel_object_unref (transport->istream);
- transport->istream = NULL;
- camel_object_unref (transport->ostream);
- transport->ostream = NULL;
-
- transport->connected = FALSE;
-
- return FALSE;
-#endif /* HAVE_SSL */
-}
-
-static gboolean
-connect_to_server_wrapper (CamelService *service, CamelException *ex)
-{
-#ifdef HAVE_SSL
- CamelSmtpTransport *transport = (CamelSmtpTransport *) service;
-
- if (transport->flags & CAMEL_SMTP_TRANSPORT_USE_SSL_ALWAYS) {
- /* First try connecting to the SSL port */
- if (!connect_to_server (service, FALSE, ex)) {
- if (camel_exception_get_id (ex) == CAMEL_EXCEPTION_SERVICE_UNAVAILABLE) {
- /* Seems the SSL port is unavailable, lets try STARTTLS */
- camel_exception_clear (ex);
- return connect_to_server (service, TRUE, ex);
- } else {
- return FALSE;
- }
- }
-
- return TRUE;
- } else if (transport->flags & CAMEL_SMTP_TRANSPORT_USE_SSL_WHEN_POSSIBLE) {
- /* If the server supports STARTTLS, use it */
- return connect_to_server (service, TRUE, ex);
- } else {
- /* User doesn't care about SSL */
- return connect_to_server (service, FALSE, ex);
- }
-#else
- return connect_to_server (service, FALSE, ex);
-#endif
-}
-
-static gboolean
-smtp_connect (CamelService *service, CamelException *ex)
-{
- CamelSmtpTransport *transport = CAMEL_SMTP_TRANSPORT (service);
- gboolean has_authtypes;
-
- /* We (probably) need to check popb4smtp before we connect ... */
- if (service->url->authmech && !strcmp (service->url->authmech, "POPB4SMTP")) {
- int truth;
- GByteArray *chal;
- CamelSasl *sasl;
-
- sasl = camel_sasl_new ("smtp", "POPB4SMTP", service);
- chal = camel_sasl_challenge (sasl, NULL, ex);
- truth = camel_sasl_authenticated (sasl);
- if (chal)
- g_byte_array_free (chal, TRUE);
- camel_object_unref (sasl);
-
- if (!truth)
- return FALSE;
-
- return connect_to_server_wrapper (service, ex);
- }
-
- if (!connect_to_server_wrapper (service, ex))
- return FALSE;
-
- /* check to see if AUTH is required, if so...then AUTH ourselves */
- has_authtypes = transport->authtypes ? g_hash_table_size (transport->authtypes) > 0 : FALSE;
- if (service->url->authmech && (transport->flags & CAMEL_SMTP_TRANSPORT_IS_ESMTP) && has_authtypes) {
- CamelSession *session = camel_service_get_session (service);
- CamelServiceAuthType *authtype;
- gboolean authenticated = FALSE;
- char *errbuf = NULL;
-
- if (!g_hash_table_lookup (transport->authtypes, service->url->authmech)) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
- _("SMTP server %s does not support requested "
- "authentication type %s."),
- service->url->host, service->url->authmech);
- camel_service_disconnect (service, TRUE, NULL);
- return FALSE;
- }
-
- authtype = camel_sasl_authtype (service->url->authmech);
- if (!authtype) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
- _("No support for authentication type %s"),
- service->url->authmech);
- camel_service_disconnect (service, TRUE, NULL);
- return FALSE;
- }
-
- if (!authtype->need_password) {
- /* authentication mechanism doesn't need a password,
- so if it fails there's nothing we can do */
- authenticated = smtp_auth (transport, authtype->authproto, ex);
- if (!authenticated) {
- camel_service_disconnect (service, TRUE, NULL);
- return FALSE;
- }
- }
-
- /* keep trying to login until either we succeed or the user cancels */
- while (!authenticated) {
- if (errbuf) {
- /* We need to un-cache the password before prompting again */
- camel_session_forget_password (session, service, "password", NULL);
- g_free (service->url->passwd);
- service->url->passwd = NULL;
- }
-
- if (!service->url->passwd) {
- char *prompt;
-
- prompt = g_strdup_printf (_("%sPlease enter the SMTP password for %s@%s"),
- errbuf ? errbuf : "", service->url->user,
- service->url->host);
-
- service->url->passwd = camel_session_get_password (session, prompt, FALSE, TRUE,
- service, "password", ex);
-
- g_free (prompt);
- g_free (errbuf);
- errbuf = NULL;
-
- if (!service->url->passwd) {
- camel_service_disconnect (service, TRUE, NULL);
- return FALSE;
- }
- }
-
- authenticated = smtp_auth (transport, authtype->authproto, ex);
- if (!authenticated) {
- errbuf = g_strdup_printf (_("Unable to authenticate "
- "to SMTP server.\n%s\n\n"),
- camel_exception_get_description (ex));
- camel_exception_clear (ex);
- }
- }
-
- /* The spec says we have to re-EHLO, but some servers
- * we won't bother to name don't want you to... so ignore
- * errors.
- */
- if (!smtp_helo (transport, ex) && !transport->connected)
- return FALSE;
-
- camel_exception_clear (ex);
- }
-
- return TRUE;
-}
-
-static void
-authtypes_free (gpointer key, gpointer value, gpointer data)
-{
- g_free (value);
-}
-
-static gboolean
-smtp_disconnect (CamelService *service, gboolean clean, CamelException *ex)
-{
- CamelSmtpTransport *transport = CAMEL_SMTP_TRANSPORT (service);
-
- /*if (!service->connected)
- * return TRUE;
- */
-
- if (transport->connected && clean) {
- /* send the QUIT command to the SMTP server */
- smtp_quit (transport, ex);
- }
-
- if (!CAMEL_SERVICE_CLASS (parent_class)->disconnect (service, clean, ex))
- return FALSE;
-
- if (transport->authtypes) {
- g_hash_table_foreach (transport->authtypes, authtypes_free, NULL);
- g_hash_table_destroy (transport->authtypes);
- transport->authtypes = NULL;
- }
-
- if (transport->istream) {
- camel_object_unref (transport->istream);
- transport->istream = NULL;
- }
-
- if (transport->ostream) {
- camel_object_unref (transport->ostream);
- transport->ostream = NULL;
- }
-
- camel_tcp_address_free (transport->localaddr);
- transport->localaddr = NULL;
-
- transport->connected = FALSE;
-
- return TRUE;
-}
-
-static GHashTable *
-esmtp_get_authtypes (const unsigned char *buffer)
-{
- const unsigned char *start, *end;
- GHashTable *table = NULL;
-
- /* advance to the first token */
- start = buffer;
- while (isspace ((int) *start) || *start == '=')
- start++;
-
- if (!*start)
- return NULL;
-
- table = g_hash_table_new (g_str_hash, g_str_equal);
-
- for ( ; *start; ) {
- char *type;
-
- /* advance to the end of the token */
- end = start;
- while (*end && !isspace ((int) *end))
- end++;
-
- type = g_strndup (start, end - start);
- g_hash_table_insert (table, type, type);
-
- /* advance to the next token */
- start = end;
- while (isspace ((int) *start))
- start++;
- }
-
- return table;
-}
-
-static GList *
-query_auth_types (CamelService *service, CamelException *ex)
-{
- CamelSmtpTransport *transport = CAMEL_SMTP_TRANSPORT (service);
- CamelServiceAuthType *authtype;
- GList *types, *t, *next;
-
- if (!connect_to_server_wrapper (service, ex))
- return NULL;
-
- types = g_list_copy (service->provider->authtypes);
- for (t = types; t; t = next) {
- authtype = t->data;
- next = t->next;
-
- if (!g_hash_table_lookup (transport->authtypes, authtype->authproto)) {
- types = g_list_remove_link (types, t);
- g_list_free_1 (t);
- }
- }
-
- smtp_disconnect (service, TRUE, NULL);
-
- return types;
-}
-
-static char *
-get_name (CamelService *service, gboolean brief)
-{
- if (brief)
- return g_strdup_printf (_("SMTP server %s"), service->url->host);
- else {
- return g_strdup_printf (_("SMTP mail delivery via %s"),
- service->url->host);
- }
-}
-
-static gboolean
-smtp_send_to (CamelTransport *transport, CamelMimeMessage *message,
- CamelAddress *from, CamelAddress *recipients,
- CamelException *ex)
-{
- CamelSmtpTransport *smtp_transport = CAMEL_SMTP_TRANSPORT (transport);
- const CamelInternetAddress *cia;
- gboolean has_8bit_parts;
- const char *addr;
- int i, len;
-
- if (!camel_internet_address_get (CAMEL_INTERNET_ADDRESS (from), 0, NULL, &addr)) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Cannot send message: "
- "sender address not valid."));
- return FALSE;
- }
-
- camel_operation_start (NULL, _("Sending message"));
-
- /* find out if the message has 8bit mime parts */
- has_8bit_parts = camel_mime_message_has_8bit_parts (message);
-
- /* rfc1652 (8BITMIME) requires that you notify the ESMTP daemon that
- you'll be sending an 8bit mime message at "MAIL FROM:" time. */
- if (!smtp_mail (smtp_transport, addr, has_8bit_parts, ex)) {
- camel_operation_end (NULL);
- return FALSE;
- }
-
- len = camel_address_length (recipients);
- if (len == 0) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Cannot send message: no recipients defined."));
- camel_operation_end (NULL);
- return FALSE;
- }
-
- cia = CAMEL_INTERNET_ADDRESS (recipients);
- for (i = 0; i < len; i++) {
- char *enc;
-
- if (!camel_internet_address_get (cia, i, NULL, &addr)) {
- camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Cannot send message: one or more invalid recipients"));
- camel_operation_end (NULL);
- return FALSE;
- }
-
- enc = camel_internet_address_encode_address(NULL, NULL, addr);
- if (!smtp_rcpt (smtp_transport, enc, ex)) {
- g_free(enc);
- camel_operation_end (NULL);
- return FALSE;
- }
- g_free(enc);
- }
-
- if (!smtp_data (smtp_transport, message, ex)) {
- camel_operation_end (NULL);
- return FALSE;
- }
-
- /* reset the service for our next transfer session */
- smtp_rset (smtp_transport, ex);
-
- camel_operation_end (NULL);
-
- return TRUE;
-}
-
-static const char *
-smtp_next_token (const char *buf)
-{
- const unsigned char *token;
-
- token = (const unsigned char *) buf;
- while (*token && !isspace ((int) *token))
- token++;
-
- while (*token && isspace ((int) *token))
- token++;
-
- return (const char *) token;
-}
-
-#define HEXVAL(c) (isdigit (c) ? (c) - '0' : (c) - 'A' + 10)
-
-/**
- * example (rfc2034):
- * 5.1.1 Mailbox "nosuchuser" does not exist
- *
- * The human-readable status code is what we want. Since this text
- * could possibly be encoded, we must decode it.
- *
- * "xtext" is formally defined as follows:
- *
- * xtext = *( xchar / hexchar / linear-white-space / comment )
- *
- * xchar = any ASCII CHAR between "!" (33) and "~" (126) inclusive,
- * except for "+", "\" and "(".
- *
- * "hexchar"s are intended to encode octets that cannot be represented
- * as plain text, either because they are reserved, or because they are
- * non-printable. However, any octet value may be represented by a
- * "hexchar".
- *
- * hexchar = ASCII "+" immediately followed by two upper case
- * hexadecimal digits
- **/
-static char *
-smtp_decode_status_code (const char *in, size_t len)
-{
- unsigned char *inptr, *outptr;
- const unsigned char *inend;
- char *outbuf;
-
- outptr = outbuf = g_malloc (len + 1);
-
- inptr = (unsigned char *) in;
- inend = inptr + len;
- while (inptr < inend) {
- if (*inptr == '+') {
- if (isxdigit (inptr[1]) && isxdigit (inptr[2])) {
- *outptr++ = HEXVAL (inptr[1]) * 16 + HEXVAL (inptr[2]);
- inptr += 3;
- } else
- *outptr++ = *inptr++;
- } else
- *outptr++ = *inptr++;
- }
-
- *outptr = '\0';
-
- return outbuf;
-}
-
-static void
-smtp_set_exception (CamelSmtpTransport *transport, const char *respbuf, const char *message, CamelException *ex)
-{
- const char *token, *rbuf = respbuf;
- char *buffer = NULL;
- GString *string;
- int error;
-
- if (!respbuf || !(transport->flags & CAMEL_SMTP_TRANSPORT_ENHANCEDSTATUSCODES)) {
- fake_status_code:
- error = respbuf ? atoi (respbuf) : 0;
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, "%s: %s", message,
- smtp_error_string (error));
- } else {
- string = g_string_new ("");
- do {
- token = smtp_next_token (rbuf + 4);
- if (*token == '\0') {
- g_free (buffer);
- g_string_free (string, TRUE);
- goto fake_status_code;
- }
-
- g_string_append (string, token);
- if (*(rbuf + 3) == '-') {
- g_free (buffer);
- buffer = camel_stream_buffer_read_line (CAMEL_STREAM_BUFFER (transport->istream));
- g_string_append_c (string, '\n');
- } else {
- g_free (buffer);
- buffer = NULL;
- }
-
- rbuf = buffer;
- } while (rbuf);
-
- buffer = smtp_decode_status_code (string->str, string->len);
- g_string_free (string, TRUE);
- if (!buffer)
- goto fake_status_code;
-
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- "%s: %s", message, buffer);
-
- g_free (buffer);
- }
-
- if (!respbuf) {
- /* we got disconnected */
- transport->connected = FALSE;
- }
-}
-
-static gboolean
-smtp_helo (CamelSmtpTransport *transport, CamelException *ex)
-{
- /* say hello to the server */
- char *name = NULL, *cmdbuf = NULL, *respbuf = NULL;
- struct hostent *host;
- CamelException err;
- const char *token;
- int af;
-
- /* these are flags that we set, so unset them in case we
- are being called a second time (ie, after a STARTTLS) */
- transport->flags &= ~(CAMEL_SMTP_TRANSPORT_8BITMIME |
- CAMEL_SMTP_TRANSPORT_ENHANCEDSTATUSCODES |
- CAMEL_SMTP_TRANSPORT_STARTTLS);
-
- if (transport->authtypes) {
- g_hash_table_foreach (transport->authtypes, authtypes_free, NULL);
- g_hash_table_destroy (transport->authtypes);
- transport->authtypes = NULL;
- }
-
- camel_operation_start_transient (NULL, _("SMTP Greeting"));
-
- /* get the local host name */
- camel_exception_init (&err);
-#ifdef ENABLE_IPv6
- af = transport->localaddr->family == CAMEL_TCP_ADDRESS_IPv6 ? AF_INET6 : AF_INET;
-#else
- af = AF_INET;
-#endif
- host = camel_gethostbyaddr ((char *) &transport->localaddr->address,
- transport->localaddr->length, af, &err);
-
- camel_exception_clear (&err);
-
- if (host && host->h_name && *host->h_name) {
- name = g_strdup (host->h_name);
- } else {
-#ifdef ENABLE_IPv6
- char ip[MAXHOSTNAMELEN + 1];
- const char *proto;
-
- proto = transport->localaddr->family == CAMEL_TCP_ADDRESS_IPv6 ? "IPv6:" : "";
- name = g_strdup_printf ("[%s%s]", proto, inet_ntop (af, transport->localaddr->address, ip, MAXHOSTNAMELEN));
-#else
- /* We *could* use inet_ntoa() here, but it's probably
- not worth it since we would have to worry about
- some systems not having inet_ntoa() */
- name = g_strdup_printf ("[%d.%d.%d.%d]",
- transport->localaddr->address[0],
- transport->localaddr->address[1],
- transport->localaddr->address[2],
- transport->localaddr->address[3]);
-#endif
- }
-
- if (host)
- camel_free_host (host);
-
- /* hiya server! how are you today? */
- if (transport->flags & CAMEL_SMTP_TRANSPORT_IS_ESMTP)
- cmdbuf = g_strdup_printf ("EHLO %s\r\n", name);
- else
- cmdbuf = g_strdup_printf ("HELO %s\r\n", name);
- g_free (name);
-
- d(fprintf (stderr, "sending : %s", cmdbuf));
- if (camel_stream_write (transport->ostream, cmdbuf, strlen (cmdbuf)) == -1) {
- g_free (cmdbuf);
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("HELO request timed out: %s"),
- g_strerror (errno));
- camel_operation_end (NULL);
-
- transport->connected = FALSE;
- camel_object_unref (transport->istream);
- transport->istream = NULL;
- camel_object_unref (transport->ostream);
- transport->ostream = NULL;
-
- return FALSE;
- }
- g_free (cmdbuf);
-
- do {
- /* Check for "250" */
- g_free (respbuf);
- respbuf = camel_stream_buffer_read_line (CAMEL_STREAM_BUFFER (transport->istream));
-
- d(fprintf (stderr, "received: %s\n", respbuf ? respbuf : "(null)"));
-
- if (!respbuf || strncmp (respbuf, "250", 3)) {
- smtp_set_exception (transport, respbuf, _("HELO response error"), ex);
- camel_operation_end (NULL);
- g_free (respbuf);
-
- return FALSE;
- }
-
- token = respbuf + 4;
-
- if (transport->flags & CAMEL_SMTP_TRANSPORT_IS_ESMTP) {
- if (!strncmp (token, "8BITMIME", 8)) {
- d(fprintf (stderr, "This server supports 8bit MIME\n"));
- transport->flags |= CAMEL_SMTP_TRANSPORT_8BITMIME;
- } else if (!strncmp (token, "ENHANCEDSTATUSCODES", 19)) {
- d(fprintf (stderr, "This server supports enhanced status codes\n"));
- transport->flags |= CAMEL_SMTP_TRANSPORT_ENHANCEDSTATUSCODES;
- } else if (!strncmp (token, "STARTTLS", 8)) {
- d(fprintf (stderr, "This server supports STARTTLS\n"));
- transport->flags |= CAMEL_SMTP_TRANSPORT_STARTTLS;
- } else if (!strncmp (token, "AUTH", 4)) {
- if (!transport->authtypes || transport->flags & CAMEL_SMTP_TRANSPORT_AUTH_EQUAL) {
- /* Don't bother parsing any authtypes if we already have a list.
- * Some servers will list AUTH twice, once the standard way and
- * once the way Microsoft Outlook requires them to be:
- *
- * 250-AUTH LOGIN PLAIN DIGEST-MD5 CRAM-MD5
- * 250-AUTH=LOGIN PLAIN DIGEST-MD5 CRAM-MD5
- *
- * Since they can come in any order, parse each list that we get
- * until we parse an authtype list that does not use the AUTH=
- * format. We want to let the standard way have priority over the
- * broken way.
- **/
-
- if (token[4] == '=')
- transport->flags |= CAMEL_SMTP_TRANSPORT_AUTH_EQUAL;
- else
- transport->flags &= ~CAMEL_SMTP_TRANSPORT_AUTH_EQUAL;
-
- /* parse for supported AUTH types */
- token += 5;
-
- if (transport->authtypes) {
- g_hash_table_foreach (transport->authtypes, authtypes_free, NULL);
- g_hash_table_destroy (transport->authtypes);
- }
-
- transport->authtypes = esmtp_get_authtypes (token);
- }
- }
- }
- } while (*(respbuf+3) == '-'); /* if we got "250-" then loop again */
- g_free (respbuf);
-
- camel_operation_end (NULL);
-
- return TRUE;
-}
-
-static gboolean
-smtp_auth (CamelSmtpTransport *transport, const char *mech, CamelException *ex)
-{
- char *cmdbuf, *respbuf = NULL, *challenge;
- gboolean auth_challenge = FALSE;
- CamelSasl *sasl = NULL;
-
- camel_operation_start_transient (NULL, _("SMTP Authentication"));
-
- sasl = camel_sasl_new ("smtp", mech, CAMEL_SERVICE (transport));
- if (!sasl) {
- camel_operation_end (NULL);
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Error creating SASL authentication object."));
- return FALSE;
- }
-
- challenge = camel_sasl_challenge_base64 (sasl, NULL, ex);
- if (challenge) {
- auth_challenge = TRUE;
- cmdbuf = g_strdup_printf ("AUTH %s %s\r\n", mech, challenge);
- g_free (challenge);
- } else {
- cmdbuf = g_strdup_printf ("AUTH %s\r\n", mech);
- }
-
- d(fprintf (stderr, "sending : %s", cmdbuf));
- if (camel_stream_write (transport->ostream, cmdbuf, strlen (cmdbuf)) == -1) {
- g_free (cmdbuf);
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("AUTH request timed out: %s"),
- g_strerror (errno));
- goto lose;
- }
- g_free (cmdbuf);
-
- respbuf = camel_stream_buffer_read_line (CAMEL_STREAM_BUFFER (transport->istream));
- d(fprintf (stderr, "received: %s\n", respbuf ? respbuf : "(null)"));
-
- while (!camel_sasl_authenticated (sasl)) {
- if (!respbuf) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("AUTH request timed out: %s"),
- g_strerror (errno));
- goto lose;
- }
-
- /* the server challenge/response should follow a 334 code */
- if (strncmp (respbuf, "334", 3)) {
- g_free (respbuf);
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("AUTH request failed."));
- goto lose;
- }
-
- if (FALSE) {
- broken_smtp_server:
- d(fprintf (stderr, "Your SMTP server's implementation of the %s SASL\n"
- "authentication mechanism is broken. Please report this to the\n"
- "appropriate vendor and suggest that they re-read rfc2554 again\n"
- "for the first time (specifically Section 4).\n",
- mech));
- }
-
- /* eat whtspc */
- for (challenge = respbuf + 4; isspace (*challenge); challenge++);
-
- challenge = camel_sasl_challenge_base64 (sasl, challenge, ex);
- g_free (respbuf);
- if (challenge == NULL)
- goto break_and_lose;
-
- /* send our challenge */
- cmdbuf = g_strdup_printf ("%s\r\n", challenge);
- g_free (challenge);
- d(fprintf (stderr, "sending : %s", cmdbuf));
- if (camel_stream_write (transport->ostream, cmdbuf, strlen (cmdbuf)) == -1) {
- g_free (cmdbuf);
- goto lose;
- }
- g_free (cmdbuf);
-
- /* get the server's response */
- respbuf = camel_stream_buffer_read_line (CAMEL_STREAM_BUFFER (transport->istream));
- d(fprintf (stderr, "received: %s\n", respbuf ? respbuf : "(null)"));
- }
-
- /* check that the server says we are authenticated */
- if (!respbuf || strncmp (respbuf, "235", 3)) {
- if (respbuf && auth_challenge && !strncmp (respbuf, "334", 3)) {
- /* broken server, but lets try and work around it anyway... */
- goto broken_smtp_server;
- }
- g_free (respbuf);
- goto lose;
- }
-
- camel_object_unref (sasl);
- camel_operation_end (NULL);
-
- return TRUE;
-
- break_and_lose:
- /* Get the server out of "waiting for continuation data" mode. */
- d(fprintf (stderr, "sending : *\n"));
- camel_stream_write (transport->ostream, "*\r\n", 3);
- respbuf = camel_stream_buffer_read_line (CAMEL_STREAM_BUFFER (transport->istream));
- d(fprintf (stderr, "received: %s\n", respbuf ? respbuf : "(null)"));
-
- lose:
- if (!camel_exception_is_set (ex)) {
- camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
- _("Bad authentication response from server.\n"));
- }
-
- camel_object_unref (sasl);
- camel_operation_end (NULL);
-
- return FALSE;
-}
-
-static gboolean
-smtp_mail (CamelSmtpTransport *transport, const char *sender, gboolean has_8bit_parts, CamelException *ex)
-{
- /* we gotta tell the smtp server who we are. (our email addy) */
- char *cmdbuf, *respbuf = NULL;
-
- if (transport->flags & CAMEL_SMTP_TRANSPORT_8BITMIME && has_8bit_parts)
- cmdbuf = g_strdup_printf ("MAIL FROM:<%s> BODY=8BITMIME\r\n", sender);
- else
- cmdbuf = g_strdup_printf ("MAIL FROM:<%s>\r\n", sender);
-
- d(fprintf (stderr, "sending : %s", cmdbuf));
-
- if (camel_stream_write (transport->ostream, cmdbuf, strlen (cmdbuf)) == -1) {
- g_free (cmdbuf);
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("MAIL FROM request timed out: %s: mail not sent"),
- g_strerror (errno));
-
- camel_object_unref (transport->istream);
- transport->istream = NULL;
- camel_object_unref (transport->ostream);
- transport->ostream = NULL;
-
- return FALSE;
- }
- g_free (cmdbuf);
-
- do {
- /* Check for "250 Sender OK..." */
- g_free (respbuf);
- respbuf = camel_stream_buffer_read_line (CAMEL_STREAM_BUFFER (transport->istream));
-
- d(fprintf (stderr, "received: %s\n", respbuf ? respbuf : "(null)"));
-
- if (!respbuf || strncmp (respbuf, "250", 3)) {
- smtp_set_exception (transport, respbuf, _("MAIL FROM response error"), ex);
- g_free (respbuf);
- return FALSE;
- }
- } while (*(respbuf+3) == '-'); /* if we got "250-" then loop again */
- g_free (respbuf);
-
- return TRUE;
-}
-
-static gboolean
-smtp_rcpt (CamelSmtpTransport *transport, const char *recipient, CamelException *ex)
-{
- /* we gotta tell the smtp server who we are going to be sending
- * our email to */
- char *cmdbuf, *respbuf = NULL;
-
- cmdbuf = g_strdup_printf ("RCPT TO:<%s>\r\n", recipient);
-
- d(fprintf (stderr, "sending : %s", cmdbuf));
-
- if (camel_stream_write (transport->ostream, cmdbuf, strlen (cmdbuf)) == -1) {
- g_free (cmdbuf);
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("RCPT TO request timed out: %s: mail not sent"),
- g_strerror (errno));
-
- camel_object_unref (transport->istream);
- transport->istream = NULL;
- camel_object_unref (transport->ostream);
- transport->ostream = NULL;
-
- return FALSE;
- }
- g_free (cmdbuf);
-
- do {
- /* Check for "250 Recipient OK..." */
- g_free (respbuf);
- respbuf = camel_stream_buffer_read_line (CAMEL_STREAM_BUFFER (transport->istream));
-
- d(fprintf (stderr, "received: %s\n", respbuf ? respbuf : "(null)"));
-
- if (!respbuf || strncmp (respbuf, "250", 3)) {
- char *message;
-
- message = g_strdup_printf (_("RCPT TO <%s> failed"), recipient);
- smtp_set_exception (transport, respbuf, message, ex);
- g_free (message);
- g_free (respbuf);
- return FALSE;
- }
- } while (*(respbuf+3) == '-'); /* if we got "250-" then loop again */
- g_free (respbuf);
-
- return TRUE;
-}
-
-static gboolean
-smtp_data (CamelSmtpTransport *transport, CamelMimeMessage *message, CamelException *ex)
-{
- CamelBestencEncoding enctype = CAMEL_BESTENC_8BIT;
- struct _camel_header_raw *header, *savedbcc, *n, *tail;
- char *cmdbuf, *respbuf = NULL;
- CamelStreamFilter *filtered_stream;
- CamelMimeFilter *crlffilter;
- int ret;
-
- /* If the server doesn't support 8BITMIME, set our required encoding to be 7bit */
- if (!(transport->flags & CAMEL_SMTP_TRANSPORT_8BITMIME))
- enctype = CAMEL_BESTENC_7BIT;
-
- /* FIXME: should we get the best charset too?? */
- /* Changes the encoding of all mime parts to fit within our required
- encoding type and also force any text parts with long lines (longer
- than 998 octets) to wrap by QP or base64 encoding them. */
- camel_mime_message_set_best_encoding (message, CAMEL_BESTENC_GET_ENCODING, enctype);
-
- cmdbuf = g_strdup ("DATA\r\n");
-
- d(fprintf (stderr, "sending : %s", cmdbuf));
-
- if (camel_stream_write (transport->ostream, cmdbuf, strlen (cmdbuf)) == -1) {
- g_free (cmdbuf);
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("DATA request timed out: %s: mail not sent"),
- g_strerror (errno));
-
- camel_object_unref (transport->istream);
- transport->istream = NULL;
- camel_object_unref (transport->ostream);
- transport->ostream = NULL;
-
- return FALSE;
- }
- g_free (cmdbuf);
-
- respbuf = camel_stream_buffer_read_line (CAMEL_STREAM_BUFFER (transport->istream));
-
- d(fprintf (stderr, "received: %s\n", respbuf ? respbuf : "(null)"));
-
- if (!respbuf || strncmp (respbuf, "354", 3)) {
- /* we should have gotten instructions on how to use the DATA command:
- * 354 Enter mail, end with "." on a line by itself
- */
- smtp_set_exception (transport, respbuf, _("DATA response error"), ex);
- g_free (respbuf);
- return FALSE;
- }
-
- g_free (respbuf);
- respbuf = NULL;
-
- /* setup stream filtering */
- crlffilter = camel_mime_filter_crlf_new (CAMEL_MIME_FILTER_CRLF_ENCODE, CAMEL_MIME_FILTER_CRLF_MODE_CRLF_DOTS);
- filtered_stream = camel_stream_filter_new_with_stream (transport->ostream);
- camel_stream_filter_add (filtered_stream, CAMEL_MIME_FILTER (crlffilter));
- camel_object_unref (crlffilter);
-
- /* unlink the bcc headers */
- savedbcc = NULL;
- tail = (struct _camel_header_raw *) &savedbcc;
-
- header = (struct _camel_header_raw *) &CAMEL_MIME_PART (message)->headers;
- n = header->next;
- while (n != NULL) {
- if (!strcasecmp (n->name, "Bcc")) {
- header->next = n->next;
- tail->next = n;
- n->next = NULL;
- tail = n;
- } else {
- header = n;
- }
-
- n = header->next;
- }
-
- /* write the message */
- ret = camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (message), CAMEL_STREAM (filtered_stream));
-
- /* restore the bcc headers */
- header->next = savedbcc;
-
- if (ret == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("DATA send timed out: message termination: "
- "%s: mail not sent"),
- g_strerror (errno));
-
- camel_object_unref (filtered_stream);
-
- camel_object_unref (transport->istream);
- transport->istream = NULL;
- camel_object_unref (transport->ostream);
- transport->ostream = NULL;
-
- return FALSE;
- }
-
- camel_stream_flush (CAMEL_STREAM (filtered_stream));
- camel_object_unref (filtered_stream);
-
- /* terminate the message body */
-
- d(fprintf (stderr, "sending : \\r\\n.\\r\\n\n"));
-
- if (camel_stream_write (transport->ostream, "\r\n.\r\n", 5) == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("DATA send timed out: message termination: "
- "%s: mail not sent"),
- g_strerror (errno));
-
- camel_object_unref (transport->istream);
- transport->istream = NULL;
- camel_object_unref (transport->ostream);
- transport->ostream = NULL;
-
- return FALSE;
- }
-
- do {
- /* Check for "250 Sender OK..." */
- g_free (respbuf);
- respbuf = camel_stream_buffer_read_line (CAMEL_STREAM_BUFFER (transport->istream));
-
- d(fprintf (stderr, "received: %s\n", respbuf ? respbuf : "(null)"));
-
- if (!respbuf || strncmp (respbuf, "250", 3)) {
- smtp_set_exception (transport, respbuf, _("DATA termination response error"), ex);
- g_free (respbuf);
- return FALSE;
- }
- } while (*(respbuf+3) == '-'); /* if we got "250-" then loop again */
- g_free (respbuf);
-
- return TRUE;
-}
-
-static gboolean
-smtp_rset (CamelSmtpTransport *transport, CamelException *ex)
-{
- /* we are going to reset the smtp server (just to be nice) */
- char *cmdbuf, *respbuf = NULL;
-
- cmdbuf = g_strdup ("RSET\r\n");
-
- d(fprintf (stderr, "sending : %s", cmdbuf));
-
- if (camel_stream_write (transport->ostream, cmdbuf, strlen (cmdbuf)) == -1) {
- g_free (cmdbuf);
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("RSET request timed out: %s"),
- g_strerror (errno));
-
- camel_object_unref (transport->istream);
- transport->istream = NULL;
- camel_object_unref (transport->ostream);
- transport->ostream = NULL;
-
- return FALSE;
- }
- g_free (cmdbuf);
-
- do {
- /* Check for "250" */
- g_free (respbuf);
- respbuf = camel_stream_buffer_read_line (CAMEL_STREAM_BUFFER (transport->istream));
-
- d(fprintf (stderr, "received: %s\n", respbuf ? respbuf : "(null)"));
-
- if (!respbuf || strncmp (respbuf, "250", 3)) {
- smtp_set_exception (transport, respbuf, _("RSET response error"), ex);
- g_free (respbuf);
- return FALSE;
- }
- } while (*(respbuf+3) == '-'); /* if we got "250-" then loop again */
- g_free (respbuf);
-
- return TRUE;
-}
-
-static gboolean
-smtp_quit (CamelSmtpTransport *transport, CamelException *ex)
-{
- /* we are going to reset the smtp server (just to be nice) */
- char *cmdbuf, *respbuf = NULL;
-
- cmdbuf = g_strdup ("QUIT\r\n");
-
- d(fprintf (stderr, "sending : %s", cmdbuf));
-
- if (camel_stream_write (transport->ostream, cmdbuf, strlen (cmdbuf)) == -1) {
- g_free (cmdbuf);
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("QUIT request timed out: %s"),
- g_strerror (errno));
-
- camel_object_unref (transport->istream);
- transport->istream = NULL;
- camel_object_unref (transport->ostream);
- transport->ostream = NULL;
-
- return FALSE;
- }
- g_free (cmdbuf);
-
- do {
- /* Check for "221" */
- g_free (respbuf);
- respbuf = camel_stream_buffer_read_line (CAMEL_STREAM_BUFFER (transport->istream));
-
- d(fprintf (stderr, "received: %s\n", respbuf ? respbuf : "(null)"));
-
- if (!respbuf || strncmp (respbuf, "221", 3)) {
- smtp_set_exception (transport, respbuf, _("QUIT response error"), ex);
- g_free (respbuf);
- return FALSE;
- }
- } while (*(respbuf+3) == '-'); /* if we got "221-" then loop again */
- g_free (respbuf);
-
- return TRUE;
-}
diff --git a/camel/providers/smtp/camel-smtp-transport.h b/camel/providers/smtp/camel-smtp-transport.h
deleted file mode 100644
index ef15f2b07d..0000000000
--- a/camel/providers/smtp/camel-smtp-transport.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-smtp-transport.h : class for an smtp transfer */
-
-/*
- * Authors:
- * Jeffrey Stedfast <fejj@stampede.org>
- *
- * Copyright (C) 2000 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifndef CAMEL_SMTP_TRANSPORT_H
-#define CAMEL_SMTP_TRANSPORT_H 1
-
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-
-#include "camel-transport.h"
-#include "camel-tcp-stream.h"
-
-#define CAMEL_SMTP_TRANSPORT_TYPE (camel_smtp_transport_get_type ())
-#define CAMEL_SMTP_TRANSPORT(obj) (CAMEL_CHECK_CAST((obj), CAMEL_SMTP_TRANSPORT_TYPE, CamelSmtpTransport))
-#define CAMEL_SMTP_TRANSPORT_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_SMTP_TRANSPORT_TYPE, CamelSmtpTransportClass))
-#define CAMEL_IS_SMTP_TRANSPORT(o) (CAMEL_CHECK_TYPE((o), CAMEL_SMTP_TRANSPORT_TYPE))
-
-
-#define CAMEL_SMTP_TRANSPORT_IS_ESMTP (1 << 0)
-#define CAMEL_SMTP_TRANSPORT_8BITMIME (1 << 1)
-#define CAMEL_SMTP_TRANSPORT_ENHANCEDSTATUSCODES (1 << 2)
-#define CAMEL_SMTP_TRANSPORT_STARTTLS (1 << 3)
-
-#define CAMEL_SMTP_TRANSPORT_USE_SSL_ALWAYS (1 << 4)
-#define CAMEL_SMTP_TRANSPORT_USE_SSL_WHEN_POSSIBLE (1 << 5)
-
-#define CAMEL_SMTP_TRANSPORT_USE_SSL (CAMEL_SMTP_TRANSPORT_USE_SSL_ALWAYS | \
- CAMEL_SMTP_TRANSPORT_USE_SSL_WHEN_POSSIBLE)
-
-#define CAMEL_SMTP_TRANSPORT_AUTH_EQUAL (1 << 6) /* set if we are using authtypes from a broken AUTH= */
-
-typedef struct {
- CamelTransport parent_object;
-
- CamelStream *istream, *ostream;
-
- guint32 flags;
-
- gboolean connected;
- CamelTcpAddress *localaddr;
-
- GHashTable *authtypes;
-
-} CamelSmtpTransport;
-
-
-
-typedef struct {
- CamelTransportClass parent_class;
-
-} CamelSmtpTransportClass;
-
-
-/* Standard Camel function */
-CamelType camel_smtp_transport_get_type (void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* CAMEL_SMTP_TRANSPORT_H */
-
-
diff --git a/camel/providers/smtp/libcamelsmtp.urls b/camel/providers/smtp/libcamelsmtp.urls
deleted file mode 100644
index ec2fc0fc16..0000000000
--- a/camel/providers/smtp/libcamelsmtp.urls
+++ /dev/null
@@ -1 +0,0 @@
-smtp
diff --git a/camel/tests/.cvsignore b/camel/tests/.cvsignore
deleted file mode 100644
index fd6b811c68..0000000000
--- a/camel/tests/.cvsignore
+++ /dev/null
@@ -1,7 +0,0 @@
-.deps
-Makefile
-Makefile.in
-.libs
-.deps
-*.lo
-*.la
diff --git a/camel/tests/Makefile.am b/camel/tests/Makefile.am
deleted file mode 100644
index e32f2e455f..0000000000
--- a/camel/tests/Makefile.am
+++ /dev/null
@@ -1,3 +0,0 @@
-
-SUBDIRS = lib \
- message folder stream smime misc mime-filter
diff --git a/camel/tests/README b/camel/tests/README
deleted file mode 100644
index 6815330102..0000000000
--- a/camel/tests/README
+++ /dev/null
@@ -1,44 +0,0 @@
-
-This directory is to contain regression tests that should be run
-before committing anything to camel.
-
-In each subdirectory of tests there is a README containing a
-one-line description of each test file. This README must be kept
-uptodate.
-
-To write a new test: copy an existing one and replace the contents.
-
-See camel-test.h for a number of functions and macros which setup and
-define the test environmet, and help provide meaningful messages when
-something actually fails.
-
-All tests have the following options:
- -v[vvvv]
- verbose. more v's more verbose. 2 v's will give you
- a simple test backtrace of any partially failed tests.
- No v's give you a simple backtrace of any failed tests.
- -q
- quiet. Dont print anything, unless there is a SEGV.
-
-See the other files in lib/* for utility functions that help to
-write the tests (object comparison, creation, etc functions).
-
-Tests may fail and be non-fatal. In this case, you will see "Partial
-success" on the result of each test line. To get more information
-about the test, run the test manually with a -v command line argument.
-The more v's you have the more detail you get (upto about -vvvvv),
-generally use -vv to find out which parts of a partially successful
-test failed, and where.
-
-Note that if writing tests, non-fatal tests (bracketed by a
-camel_test_nonfatal() and camel_test_fatal() pair) should only be
-defined where: 1. The test in question should ideally pass, and 2. The
-code has known limitations currently that stop it passing, but
-otherwise works for nominal input.
-
-To debug tests, set a breakpoint on camel_test_fail, which will be
-called for any failure, even a non-fatal one. Or set it to
-camel_test_break, which will only be called for fatal errors which are
-to print to the screen.
-
- Michael <notzed@helixcode.com>
diff --git a/camel/tests/data/camel-test.gpg.pub b/camel/tests/data/camel-test.gpg.pub
deleted file mode 100644
index fdf28a59bd..0000000000
--- a/camel/tests/data/camel-test.gpg.pub
+++ /dev/null
@@ -1,24 +0,0 @@
------BEGIN PGP PUBLIC KEY BLOCK-----
-Version: GnuPG v1.0.7 (GNU/Linux)
-
-mQGiBD8qsjARBACkS39GA1e6pDUumC9sQyZaE2PEZW6VEHMGQ9IlJ/Qi2wJBFKgl
-Myl2Cko9Rpj2DmgGkBnoL6fPJNM9aCV0RvclvE15EViURU7mjYzF41uspvVMBg7b
-y3cwAzkkgyhLc/V0Inzm9UpJZ6JvrqYO5OvJUA+ka5SHrhuX4ptmjKLjNwCgwNCx
-CQHx9RIbPggYtfci1w9npm8D/3vks1q+G9r91JkRBqGTboBZ7HI1yU2tHJ38wsKp
-kamloFr3j0hmN0s5PY4wgz4daJ120yTmweJQfIljcN2+aHeI5838u7f3Wk5LJtLG
-+0xKBpBeejzqT/FzhxLIOoQl3L8aF+KAY+Oz7Bm/J/5MRPEPdxWGIB1LhnkoDP5F
-5szGA/9POpFU7y34ACid5Grzk77LUVyHMGob+vgqoVITfCNGjfGf7tnXn1LlRf6N
-TE81p1vYDz2K4bpPmOgBXuESmpaTfXvlDy6oW7buslFqgddm/MfzzM0wC2jdx5TV
-NdNApku4PKA4pE2oTSg5EuGgxQLjJG/PHkoiRiK6yG8gign8vrQbTm8gVXNlciA8
-bm8udXNlckBuby5kb21haW4+iFkEExECABkFAj8qsjAECwcDAgMVAgMDFgIBAh4B
-AheAAAoJEOvMhgJ6QMoGIQcAoIweyKELWnksPUk5mmZz26JFsmQVAJ9aTm+OO289
-+fdwq95xw/6KH2dEtrkBDQQ/KrIxEAQA26Y+QRaR7RymzyUW7MQlDbshD/vInLtb
-36FusuOWzL5TgYn6fiiu/e/J+qjZO5psucWelnBIbnLTZZJs06EgybLPCeEP34X7
-cSsAPZ2JE+TKPM93pxpQpRdWKhv+ocjJ4xPlwI8LTrQIHKxB3yF2WNCh/TQDi0hm
-6ktEi2RVusMAAwUD/3Wp0UbJ2/bgM9wOMAD8celvbl9V/L+9/UVBJrw4tH87FMZi
-NMNg13TbMrARqJjdpOoHzozMv1GOumC5sE8A0/pwbIdU9oSYA07D3+02dCQq+52a
-qtCGJoRq5okccQelRcs0cZIy/z5lzwsNnbshrmnqNdmuVf7BSdw7DjoFj5OLiEYE
-GBECAAYFAj8qsjEACgkQ68yGAnpAygZaCgCfZu68SOUfcUZC3CWi4ITBvcKGvmUA
-n1wrC5ZGv0SIRo5G1PswsKRZuEpl
-=SWoX
------END PGP PUBLIC KEY BLOCK-----
diff --git a/camel/tests/data/camel-test.gpg.sec b/camel/tests/data/camel-test.gpg.sec
deleted file mode 100644
index f2af11e82e..0000000000
--- a/camel/tests/data/camel-test.gpg.sec
+++ /dev/null
@@ -1,33 +0,0 @@
------BEGIN PGP PRIVATE KEY BLOCK-----
-Version: GnuPG v1.0.7 (GNU/Linux)
-
-lQHhBD8qsjARBACkS39GA1e6pDUumC9sQyZaE2PEZW6VEHMGQ9IlJ/Qi2wJBFKgl
-Myl2Cko9Rpj2DmgGkBnoL6fPJNM9aCV0RvclvE15EViURU7mjYzF41uspvVMBg7b
-y3cwAzkkgyhLc/V0Inzm9UpJZ6JvrqYO5OvJUA+ka5SHrhuX4ptmjKLjNwCgwNCx
-CQHx9RIbPggYtfci1w9npm8D/3vks1q+G9r91JkRBqGTboBZ7HI1yU2tHJ38wsKp
-kamloFr3j0hmN0s5PY4wgz4daJ120yTmweJQfIljcN2+aHeI5838u7f3Wk5LJtLG
-+0xKBpBeejzqT/FzhxLIOoQl3L8aF+KAY+Oz7Bm/J/5MRPEPdxWGIB1LhnkoDP5F
-5szGA/9POpFU7y34ACid5Grzk77LUVyHMGob+vgqoVITfCNGjfGf7tnXn1LlRf6N
-TE81p1vYDz2K4bpPmOgBXuESmpaTfXvlDy6oW7buslFqgddm/MfzzM0wC2jdx5TV
-NdNApku4PKA4pE2oTSg5EuGgxQLjJG/PHkoiRiK6yG8gign8vv4DAwJKsiNZxDAs
-LGBFwzjlfD8Wpo+OQQSuw8kHCJRhMpjBlkWYXuAIXrPVJBZmr3hYQbaL413EFp0w
-DeQUzP0mIzpEU0FfZmFjdG9yOgAAr2ShZqfqP4RkV02MsarSDNg/K9RXc5f9JiM6
-RFNBX2ZhY3RvcjoAAK9F/Ldv8ksX8Ns3uqh8GEEDq88XZIeh/SYjOkRTQV9mYWN0
-b3I6AACvaOM+Tasvvj5+aQ3E44IHW8xzeXdM5bQbTm8gVXNlciA8bm8udXNlckBu
-by5kb21haW4+iFkEExECABkFAj8qsjAECwcDAgMVAgMDFgIBAh4BAheAAAoJEOvM
-hgJ6QMoGIQcAniz8Z+AESmwwrtQpllkLWaXQhkNMAJ4yqLAKSsfimKf3BDjxUzJ5
-6RKTE50BVwQ/KrIxEAQA26Y+QRaR7RymzyUW7MQlDbshD/vInLtb36FusuOWzL5T
-gYn6fiiu/e/J+qjZO5psucWelnBIbnLTZZJs06EgybLPCeEP34X7cSsAPZ2JE+TK
-PM93pxpQpRdWKhv+ocjJ4xPlwI8LTrQIHKxB3yF2WNCh/TQDi0hm6ktEi2RVusMA
-AwUD/3Wp0UbJ2/bgM9wOMAD8celvbl9V/L+9/UVBJrw4tH87FMZiNMNg13TbMrAR
-qJjdpOoHzozMv1GOumC5sE8A0/pwbIdU9oSYA07D3+02dCQq+52aqtCGJoRq5okc
-cQelRcs0cZIy/z5lzwsNnbshrmnqNdmuVf7BSdw7DjoFj5OL/gMDAkqyI1nEMCws
-YMk7XUGj7+BY1uyYyNpYp50F52HFsGXEffiKYPGIuybuP+Yz3ic4W9aQTJJPcIJg
-ZqUP9b14WfY4mgIm1Tz9JiM6RUxHX2ZhY3RvcjoAAKsH4JdVQugM+lGnuNuGoj7I
-V8O8bIsP/SYjOkVMR19mYWN0b3I6AACrBzvFd1NLrbYGMjsN3SKhgBtuHjGQx/0m
-IzpFTEdfZmFjdG9yOgAAqwR77L22dgo/dV8XO8NThXMbEmQgoY39JiM6RUxHX2Zh
-Y3RvcjoAAKsFRPzjSodiTFMeiwWHgpdgf4e2qzEN/SYjOkVMR19mYWN0b3I6AACr
-BX9hqiLZJKfgpo/hs/0wK8yHq6GXh4hGBBgRAgAGBQI/KrIxAAoJEOvMhgJ6QMoG
-WgoAoKwAHwpedO9qQNBu0REM1jNR9PuuAJ9ZtHyuOiziV/JageUT+hZ8s27U3A==
-=xLRp
------END PGP PRIVATE KEY BLOCK-----
diff --git a/camel/tests/data/gendoc.pl b/camel/tests/data/gendoc.pl
deleted file mode 100755
index 732f05a4ed..0000000000
--- a/camel/tests/data/gendoc.pl
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/usr/bin/perl
-
-# Generate 'documents' in different encodings, from po files
-
-if ($#ARGV < 0) {
- print "Usage: gendoc.pl pofile pofile ...\n";
- exit 1;
-}
-
-$fmt = "| fmt -u ";
-
-sub read_msgstr()
-{
- my $str = "";
- while (<IN>) {
- if (m/^msgstr \"(.*)\"/) {
- $str = $1;
- if ($str eq "") {
- while (<IN>) {
- if (m/\"(.*)\"/) {
- $str .= $1;
- } else {
- last;
- }
- }
- }
- return $str;
- }
- }
- return "";
-}
-
-$unknown = "x-unknown-1";
-
-foreach $name (@ARGV) {
- if ($name =~ m@([^/]*).po$@) {
- $poname = $1;
-
- open IN,"<$name";
-
- $header = read_msgstr;
- if ($header =~ /Content-Type:.*charset=([-a-zA-Z0-9]*)/i) {
- $charset = $1;
- } else {
- $charset = $unknown++;
- }
-
- print "Building $poname.$charset.txt from $name\n";
-
- open OUT,"$fmt > $poname.$charset.txt";
- while (!eof(IN)) {
- $msg = read_msgstr;
- # de-escape
- $msg =~ s/\\n/\n/gso;
- $msg =~ s/\\t/\t/gso;
- $msg =~ s/\\(.)/$1/gso;
- print OUT $msg." ";
- }
- close OUT;
- close IN;
- } else {
- printf("ignoring $name, probably not intended\n");
- }
-}
-
diff --git a/camel/tests/data/genline.pl b/camel/tests/data/genline.pl
deleted file mode 100755
index 99ff43c882..0000000000
--- a/camel/tests/data/genline.pl
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/usr/bin/perl
-
-# Generate 'documents' in different encodings, from po files
-
-if ($#ARGV < 0) {
- print "Usage: genline.pl pofile pofile ...\n";
- exit 1;
-}
-
-sub read_msgstr()
-{
- my $str = "";
- while (<IN>) {
- if (m/^msgstr \"(.*)\"/) {
- $str = $1;
- if ($str eq "") {
- while (<IN>) {
- if (m/\"(.*)\"/) {
- $str .= $1;
- } else {
- last;
- }
- }
- }
- return $str;
- }
- }
- return "";
-}
-
-$unknown = "x-unknown-1";
-open OUT, ">test-lines.h";
-
-print OUT <<END;
-struct _l {
- char *type;
- char *line;
-} test_lines[] = {
-END
-
-foreach $name (@ARGV) {
- if ($name =~ m@([^/]*).po$@) {
- $poname = $1;
-
- open IN,"<$name";
-
- $header = read_msgstr;
- if ($header =~ /Content-Type:.*charset=([-a-zA-Z0-9]*)/i) {
- $charset = $1;
- } else {
- $charset = $unknown++;
- }
-
- while (!eof(IN)) {
- $msg = read_msgstr;
- if (length($msg) > 60 && length($msg) < 160) {
- print OUT "\t{ \"$charset\", \"$msg\" },\n";
- last;
- }
-# $msg =~ s/\\n/\n/gso;
-# $msg =~ s/\\t/\t/gso;
-# $msg =~ s/\\(.)/$1/gso;
-# print OUT $msg." ";
- }
- close IN;
- } else {
- printf("ignoring $name, probably not intended\n");
- }
-}
-
-print OUT "};\n";
-close OUT;
diff --git a/camel/tests/data/getaddr.pl b/camel/tests/data/getaddr.pl
deleted file mode 100755
index 74a8a81f74..0000000000
--- a/camel/tests/data/getaddr.pl
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/usr/bin/perl
-
-# get addresses out of messages
-
-if ($#ARGV < 0) {
- print "Usage: $0 message(s) mbox(es)\n";
- exit 1;
-}
-
-foreach $name (@ARGV) {
- open IN,"<$name";
- while (<IN>) {
- if (/^From: (.*)/i
- || /^To: (.*)/i
- || /^Cc: (.*)/i) {
- $base = $1;
- while (<IN>) {
- if (/^\s+(.*)/) {
- $base .= " ".$1;
- } else {
- last;
- }
- }
- $uniq{$base} = 1;
- }
- }
- close IN;
-}
-
-foreach $key (sort keys %uniq) {
- print $key."\n";
-}
diff --git a/camel/tests/data/messages/.cvsignore b/camel/tests/data/messages/.cvsignore
deleted file mode 100644
index e358dd1903..0000000000
--- a/camel/tests/data/messages/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-*.msg
diff --git a/camel/tests/folder/.cvsignore b/camel/tests/folder/.cvsignore
deleted file mode 100644
index 26eaf2f7e1..0000000000
--- a/camel/tests/folder/.cvsignore
+++ /dev/null
@@ -1,21 +0,0 @@
-.deps
-Makefile
-Makefile.in
-.libs
-.deps
-*.lo
-*.la
-temp-test
-*.bb
-*.bbg
-*.da
-*.gcov
-test1
-test2
-test3
-test4
-test5
-test6
-test7
-test8
-test9
diff --git a/camel/tests/folder/Makefile.am b/camel/tests/folder/Makefile.am
deleted file mode 100644
index e49fd92a87..0000000000
--- a/camel/tests/folder/Makefile.am
+++ /dev/null
@@ -1,28 +0,0 @@
-
-INCLUDES = \
- -I$(includedir) \
- -I$(top_srcdir) \
- -I$(top_srcdir)/intl \
- -I$(top_srcdir)/e-util \
- -I$(top_srcdir)/camel \
- -I$(top_srcdir)/camel/tests/lib \
- -DG_LOG_DOMAIN=\"evolution-tests\" \
- $(CAMEL_CFLAGS)
-
-LDADD = \
- $(top_builddir)/camel/libcamel.la \
- $(top_builddir)/e-util/libeutil.la \
- $(top_builddir)/camel/tests/lib/libcameltest.a \
- $(INTLLIBS) \
- $(EVOLUTION_MAIL_LIBS)
-
-check_PROGRAMS = \
- test1 test2 test3 \
- test4 test5 test6 \
- test7 test8 test9 \
- test10
-
-TESTS = test1 test2 test3 \
- test4 test5 test6 \
- test7 test8 test9 \
- test10
diff --git a/camel/tests/folder/README b/camel/tests/folder/README
deleted file mode 100644
index 3ab64ecd1c..0000000000
--- a/camel/tests/folder/README
+++ /dev/null
@@ -1,12 +0,0 @@
-
-test1 camel store folder operations (local only)
-test2 basic folder operations, local
-test3 folder searching and indexing, local
-test4 camel store folder operations, IMAP
-test5 camel store folder operations, NNTP
-test6 basic folder operations, IMAP
-test7 basic folder operations, NNTP
-
-test8 multithreaded folder torture test, local
-test9 filtering
-test10 multithreaded folder/store object bag torture test
diff --git a/camel/tests/folder/test1.c b/camel/tests/folder/test1.c
deleted file mode 100644
index c1d3809852..0000000000
--- a/camel/tests/folder/test1.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/* store testing */
-
-#include "camel-test.h"
-#include "folders.h"
-#include "session.h"
-
-#include <camel/camel-exception.h>
-#include <camel/camel-service.h>
-#include <camel/camel-store.h>
-
-#define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))
-
-static char *local_providers[] = {
- "mbox",
- "mh",
- "maildir"
-};
-
-int main(int argc, char **argv)
-{
- CamelSession *session;
- CamelException *ex;
- int i;
- char *path;
-
- camel_test_init(argc, argv);
-
- ex = camel_exception_new();
-
- /* clear out any camel-test data */
- system("/bin/rm -rf /tmp/camel-test");
-
- session = camel_test_session_new ("/tmp/camel-test");
-
- /* todo: cross-check everything with folder_info checks as well */
- /* todo: subscriptions? */
- /* todo: work out how to do imap/pop/nntp tests */
- for (i=0;i<ARRAY_LEN(local_providers);i++) {
- path = g_strdup_printf("%s:///tmp/camel-test/%s", local_providers[i], local_providers[i]);
-
- test_folder_basic(session, path, TRUE, FALSE);
-
- g_free(path);
- }
-
- camel_object_unref((CamelObject *)session);
- camel_exception_free(ex);
-
- return 0;
-}
diff --git a/camel/tests/folder/test10.c b/camel/tests/folder/test10.c
deleted file mode 100644
index f96c885ef0..0000000000
--- a/camel/tests/folder/test10.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/* threaded folder testing */
-
-#include <string.h>
-#include <pthread.h>
-
-#include "camel-test.h"
-#include "folders.h"
-#include "messages.h"
-#include "session.h"
-
-#include <camel/camel-exception.h>
-#include <camel/camel-service.h>
-#include <camel/camel-store.h>
-
-#define MAX_LOOP (10000)
-#define MAX_THREADS (5)
-
-#define d(x)
-
-#define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))
-
-static char *local_providers[] = {
- "mbox",
- "mh",
- "maildir"
-};
-
-static char *path;
-static CamelSession *session;
-static int testid;
-
-static void *
-worker(void *d)
-{
- int i;
- CamelException *ex = camel_exception_new();
- CamelStore *store;
- CamelFolder *folder;
-
- for (i=0;i<MAX_LOOP;i++) {
- store = camel_session_get_store(session, path, ex);
- camel_exception_clear(ex);
- folder = camel_store_get_folder(store, "testbox", CAMEL_STORE_FOLDER_CREATE, ex);
- camel_exception_clear(ex);
- if (testid == 0) {
- camel_object_unref(folder);
- camel_object_unref(store);
- } else {
- camel_object_unref(store);
- camel_object_unref(folder);
- }
- }
-
- camel_exception_free(ex);
-
- return NULL;
-}
-
-int main(int argc, char **argv)
-{
- CamelException *ex;
- int i, j;
- pthread_t threads[MAX_THREADS];
-
- camel_test_init(argc, argv);
-
- ex = camel_exception_new();
-
- /* clear out any camel-test data */
- system("/bin/rm -rf /tmp/camel-test");
-
- session = camel_test_session_new ("/tmp/camel-test");
-
- for (testid=0;testid<2;testid++) {
- if (testid == 0)
- camel_test_start("store and folder bag torture test, stacked references");
- else
- camel_test_start("store and folder bag torture test, unstacked references");
-
- for (j=0;j<ARRAY_LEN(local_providers);j++) {
-
- camel_test_push("provider %s", local_providers[j]);
- path = g_strdup_printf("%s:///tmp/camel-test/%s", local_providers[j], local_providers[j]);
-
- for (i=0;i<MAX_THREADS;i++)
- pthread_create(&threads[i], 0, worker, NULL);
-
- for (i=0;i<MAX_THREADS;i++)
- pthread_join(threads[i], NULL);
-
- test_free(path);
-
- camel_test_pull();
- }
-
- camel_test_end();
- }
-
- camel_object_unref((CamelObject *)session);
- camel_exception_free(ex);
-
- return 0;
-}
diff --git a/camel/tests/folder/test2.c b/camel/tests/folder/test2.c
deleted file mode 100644
index 57a449ff59..0000000000
--- a/camel/tests/folder/test2.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/* folder testing */
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-#include "camel-test.h"
-#include "messages.h"
-#include "folders.h"
-#include "session.h"
-
-#include <camel/camel-exception.h>
-#include <camel/camel-service.h>
-#include <camel/camel-store.h>
-
-#include <camel/camel-folder.h>
-#include <camel/camel-folder-summary.h>
-#include <camel/camel-mime-message.h>
-
-#define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))
-
-static char *stores[] = {
- "mbox:///tmp/camel-test/mbox",
- "mh:///tmp/camel-test/mh",
- "maildir:///tmp/camel-test/maildir"
-};
-
-int main(int argc, char **argv)
-{
- CamelSession *session;
- CamelException *ex;
- int i;
-
- camel_test_init(argc, argv);
-
- /* clear out any camel-test data */
- system("/bin/rm -rf /tmp/camel-test");
-
- ex = camel_exception_new();
-
- session = camel_test_session_new ("/tmp/camel-test");
-
- /* we iterate over all stores we want to test, with indexing or indexing turned on or off */
- for (i=0;i<ARRAY_LEN(stores);i++) {
- char *name = stores[i];
-
- test_folder_message_ops(session, name, TRUE, "testbox");
- }
-
- /* create a pseudo-spool file, and check that */
- creat("/tmp/camel-test/testbox", 0600);
- test_folder_message_ops(session, "spool:///tmp/camel-test/testbox", TRUE, "INBOX");
-
- check_unref(session, 1);
- camel_exception_free(ex);
-
- return 0;
-}
diff --git a/camel/tests/folder/test3.c b/camel/tests/folder/test3.c
deleted file mode 100644
index 1449821d91..0000000000
--- a/camel/tests/folder/test3.c
+++ /dev/null
@@ -1,339 +0,0 @@
-/* folder/index testing */
-
-#include <gtk/gtk.h>
-
-#include <string.h>
-
-#include "camel-test.h"
-#include "messages.h"
-#include "folders.h"
-#include "session.h"
-
-#include <camel/camel-exception.h>
-#include <camel/camel-service.h>
-#include <camel/camel-store.h>
-
-#include <camel/camel-folder.h>
-#include <camel/camel-folder-summary.h>
-#include <camel/camel-mime-message.h>
-
-#define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))
-
-static void
-test_folder_search_sub(CamelFolder *folder, const char *expr, int expected)
-{
- CamelException *ex = camel_exception_new();
- GPtrArray *uids;
- GHashTable *hash;
- int i;
-
- uids = camel_folder_search_by_expression(folder, expr, ex);
- check(uids != NULL);
- check_msg(uids->len == expected, "search %s expected %d got %d", expr, expected, uids->len);
- check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
-
- /* check the uid's are actually unique, too */
- hash = g_hash_table_new(g_str_hash, g_str_equal);
- for (i=0;i<uids->len;i++) {
- check(g_hash_table_lookup(hash, uids->pdata[i]) == NULL);
- g_hash_table_insert(hash, uids->pdata[i], uids->pdata[i]);
- }
- g_hash_table_destroy(hash);
-
- camel_folder_search_free(folder, uids);
-
- camel_exception_free(ex);
-}
-
-static void
-test_folder_search(CamelFolder *folder, const char *expr, int expected)
-{
- char *matchall;
-
-#if 0
- /* FIXME: ??? */
- camel_test_nonfatal("most searches require match-all construct");
- push("Testing search: %s", expr);
- test_folder_search_sub(folder, expr, expected);
- pull();
- camel_test_fatal();
-#endif
-
- matchall = g_strdup_printf("(match-all %s)", expr);
- push("Testing search: %s", matchall);
- test_folder_search_sub(folder, matchall, expected);
- test_free(matchall);
- pull();
-}
-
-static struct {
- int counts[3];
- char *expr;
-} searches[] = {
- { { 1, 1, 0 }, "(header-matches \"subject\" \"Test1 message99 subject\")" },
-
- { { 100, 50, 0 }, "(header-contains \"subject\" \"subject\")" },
- { { 100, 50, 0 }, "(header-contains \"subject\" \"Subject\")" },
-
- { { 100, 50, 0 }, "(body-contains \"content\")" },
- { { 100, 50, 0 }, "(body-contains \"Content\")" },
-
- { { 0, 0, 0 }, "(user-flag \"every7\")" },
- { { 100/13+1, 50/13+1, 0 }, "(user-flag \"every13\")" },
- { { 1, 1, 0 }, "(= \"7tag1\" (user-tag \"every7\"))" },
- { { 100/11+1, 50/11+1, 0 }, "(= \"11tag\" (user-tag \"every11\"))" },
-
- { { 100/13 + 100/17 + 1, 50/13 + 50/17 + 2, 0 }, "(user-flag \"every13\" \"every17\")" },
- { { 100/13 + 100/17 + 1, 50/13 + 50/17 + 2, 0 }, "(or (user-flag \"every13\") (user-flag \"every17\"))" },
- { { 1, 0, 0 }, "(and (user-flag \"every13\") (user-flag \"every17\"))" },
-
- { { 0, 0, 0 }, "(and (header-contains \"subject\" \"Test1\") (header-contains \"subject\" \"Test2\"))" },
- /* we get 11 here as the header-contains is a substring match */
- { { 11, 6, 0 }, "(and (header-contains \"subject\" \"Test1\") (header-contains \"subject\" \"subject\"))" },
- { { 1, 1, 0 }, "(and (header-contains \"subject\" \"Test19\") (header-contains \"subject\" \"subject\"))" },
- { { 0, 0, 0 }, "(and (header-contains \"subject\" \"Test191\") (header-contains \"subject\" \"subject\"))" },
- { { 1, 1, 0 }, "(and (header-contains \"subject\" \"Test1\") (header-contains \"subject\" \"message99\"))" },
-
- { { 22, 11, 0 }, "(or (header-contains \"subject\" \"Test1\") (header-contains \"subject\" \"Test2\"))" },
- { { 2, 1, 0 }, "(or (header-contains \"subject\" \"Test16\") (header-contains \"subject\" \"Test99\"))" },
- { { 1, 1, 0 }, "(or (header-contains \"subject\" \"Test123\") (header-contains \"subject\" \"Test99\"))" },
- { { 100, 50, 0 }, "(or (header-contains \"subject\" \"Test1\") (header-contains \"subject\" \"subject\"))" },
- { { 11, 6, 0 }, "(or (header-contains \"subject\" \"Test1\") (header-contains \"subject\" \"message99\"))" },
-
- /* 72000 is 24*60*100 == half the 'sent date' of the messages */
- { { 100/2, 50/2, 0 }, "(> 72000 (get-sent-date))" },
- { { 100/2-1, 50/2, 0 }, "(< 72000 (get-sent-date))" },
- { { 1, 0, 0 }, "(= 72000 (get-sent-date))" },
- { { 0, 0, 0 }, "(= 72001 (get-sent-date))" },
-
- { { (100/2-1)/17+1, (50/2-1)/17+1, 0 }, "(and (user-flag \"every17\") (< 72000 (get-sent-date)))" },
- { { (100/2-1)/17+1, (50/2-1)/17, 0 }, "(and (user-flag \"every17\") (> 72000 (get-sent-date)))" },
- { { (100/2-1)/13+1, (50/2-1)/13+1, 0 }, "(and (user-flag \"every13\") (< 72000 (get-sent-date)))" },
- { { (100/2-1)/13+1, (50/2-1)/13+1, 0 }, "(and (user-flag \"every13\") (> 72000 (get-sent-date)))" },
-
- { { 100/2+100/2/17, 50/2+50/2/17, 0 }, "(or (user-flag \"every17\") (< 72000 (get-sent-date)))" },
- { { 100/2+100/2/17+1, 50/2+50/2/17+1, 0 }, "(or (user-flag \"every17\") (> 72000 (get-sent-date)))" },
- { { 100/2+100/2/13, 50/2+50/2/13+1, 0 }, "(or (user-flag \"every13\") (< 72000 (get-sent-date)))" },
- { { 100/2+100/2/13+1, 50/2+50/2/13+1, 0 }, "(or (user-flag \"every13\") (> 72000 (get-sent-date)))" },
-};
-
-static void
-run_search(CamelFolder *folder, int m)
-{
- int i, j = 0;
-
- check(m == 50 || m == 100 || m == 0);
-
- /* *shrug* messy, but it'll do */
- if (m==50)
- j = 1;
- else if (m==0)
- j = 2;
-
- push("performing searches, expected %d", m);
- for (i=0;i<ARRAY_LEN(searches);i++) {
- push("running search %d: %s", i, searches[i].expr);
- test_folder_search(folder, searches[i].expr, searches[i].counts[j]);
- pull();
- }
- pull();
-}
-
-
-static char *stores[] = {
- "mbox:///tmp/camel-test/mbox",
- "mh:///tmp/camel-test/mh",
- "maildir:///tmp/camel-test/maildir"
-};
-
-int main(int argc, char **argv)
-{
- CamelSession *session;
- CamelStore *store;
- CamelException *ex;
- CamelFolder *folder;
- CamelMimeMessage *msg;
- int i, j;
- int indexed;
- GPtrArray *uids;
-
- gtk_init(&argc, &argv);
- camel_test_init(argc, argv);
-
- ex = camel_exception_new();
-
- /* clear out any camel-test data */
- system("/bin/rm -rf /tmp/camel-test");
-
- session = camel_test_session_new ("/tmp/camel-test");
-
- /* todo: cross-check everything with folder_info checks as well */
- /* todo: work out how to do imap/pop/nntp tests */
-
- /* we iterate over all stores we want to test, with indexing or indexing turned on or off */
- for (i=0;i<ARRAY_LEN(stores);i++) {
- char *name = stores[i];
- for (indexed = 0;indexed<2;indexed++) {
- char *what = g_strdup_printf("folder search: %s (%sindexed)", name, indexed?"":"non-");
- int flags;
-
- camel_test_start(what);
- test_free(what);
-
- push("getting store");
- store = camel_session_get_store(session, stores[i], ex);
- check_msg(!camel_exception_is_set(ex), "getting store: %s", camel_exception_get_description(ex));
- check(store != NULL);
- pull();
-
- push("creating %sindexed folder", indexed?"":"non-");
- if (indexed)
- flags = CAMEL_STORE_FOLDER_CREATE|CAMEL_STORE_FOLDER_BODY_INDEX;
- else
- flags = CAMEL_STORE_FOLDER_CREATE;
- folder = camel_store_get_folder(store, "testbox", flags, ex);
- check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
- check(folder != NULL);
-
- /* we need an empty folder for this to work */
- test_folder_counts(folder, 0, 0);
- pull();
-
- /* append a bunch of messages with specific content */
- push("appending 100 test messages");
- for (j=0;j<100;j++) {
- char *content, *subject;
-
- push("creating test message");
- msg = test_message_create_simple();
- content = g_strdup_printf("data%d content\n", j);
- test_message_set_content_simple((CamelMimePart *)msg, 0, "text/plain",
- content, strlen(content));
- test_free(content);
- subject = g_strdup_printf("Test%d message%d subject", j, 100-j);
- camel_mime_message_set_subject(msg, subject);
-
- camel_mime_message_set_date(msg, j*60*24, 0);
- pull();
-
- push("appending simple message %d", j);
- camel_folder_append_message(folder, msg, NULL, NULL, ex);
- check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
- pull();
-
- test_free(subject);
-
- check_unref(msg, 1);
- }
- pull();
-
- push("Setting up some flags &c");
- uids = camel_folder_get_uids(folder);
- check(uids->len == 100);
- for (j=0;j<100;j++) {
- char *uid = uids->pdata[j];
-
- if ((j/13)*13 == j) {
- camel_folder_set_message_user_flag(folder, uid, "every13", TRUE);
- }
- if ((j/17)*17 == j) {
- camel_folder_set_message_user_flag(folder, uid, "every17", TRUE);
- }
- if ((j/7)*7 == j) {
- char *tag = g_strdup_printf("7tag%d", j/7);
- camel_folder_set_message_user_tag(folder, uid, "every7", tag);
- test_free(tag);
- }
- if ((j/11)*11 == j) {
- camel_folder_set_message_user_tag(folder, uid, "every11", "11tag");
- }
- }
- camel_folder_free_uids(folder, uids);
- pull();
-
- camel_test_nonfatal("Index not guaranteed to be accurate before sync: should be fixed eventually");
- push("Search before sync");
- run_search(folder, 100);
- pull();
- camel_test_fatal();
-
- push("syncing folder, searching");
- camel_folder_sync(folder, FALSE, ex);
- run_search(folder, 100);
- pull();
-
- push("syncing wiht expunge, search");
- camel_folder_sync(folder, TRUE, ex);
- run_search(folder, 100);
- pull();
-
- push("deleting every 2nd message");
- uids = camel_folder_get_uids(folder);
- check(uids->len == 100);
- for (j=0;j<uids->len;j+=2) {
- camel_folder_delete_message(folder, uids->pdata[j]);
- }
- camel_folder_free_uids(folder, uids);
- run_search(folder, 100);
-
- push("syncing");
- camel_folder_sync(folder, FALSE, ex);
- check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
- run_search(folder, 100);
- pull();
-
- push("expunging");
- camel_folder_expunge(folder, ex);
- check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
- run_search(folder, 50);
- pull();
-
- pull();
-
- push("closing and re-opening folder");
- check_unref(folder, 1);
- folder = camel_store_get_folder(store, "testbox", flags&~(CAMEL_STORE_FOLDER_CREATE), ex);
- check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
- check(folder != NULL);
-
- push("deleting remaining messages");
- uids = camel_folder_get_uids(folder);
- check(uids->len == 50);
- for (j=0;j<uids->len;j++) {
- camel_folder_delete_message(folder, uids->pdata[j]);
- }
- camel_folder_free_uids(folder, uids);
- run_search(folder, 50);
-
- push("syncing");
- camel_folder_sync(folder, FALSE, ex);
- check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
- run_search(folder, 50);
- pull();
-
- push("expunging");
- camel_folder_expunge(folder, ex);
- check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
- run_search(folder, 0);
- pull();
-
- pull();
-
- check_unref(folder, 1);
- pull();
-
- push("deleting test folder, with no messages in it");
- camel_store_delete_folder(store, "testbox", ex);
- check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
- pull();
-
- check_unref(store, 1);
- camel_test_end();
- }
- }
-
- check_unref(session, 1);
- camel_exception_free(ex);
-
- return 0;
-}
diff --git a/camel/tests/folder/test4.c b/camel/tests/folder/test4.c
deleted file mode 100644
index e6c58e023d..0000000000
--- a/camel/tests/folder/test4.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/* store testing, for remote folders */
-
-#include "camel-test.h"
-#include "folders.h"
-#include "session.h"
-
-#include <camel/camel-exception.h>
-#include <camel/camel-service.h>
-#include <camel/camel-store.h>
-
-#define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))
-
-static char *remote_providers[] = {
- "IMAP_TEST_URL",
-};
-
-int main(int argc, char **argv)
-{
- CamelSession *session;
- CamelException *ex;
- int i;
- char *path;
-
- camel_test_init(argc, argv);
-
- ex = camel_exception_new();
-
- /* clear out any camel-test data */
- system("/bin/rm -rf /tmp/camel-test");
-
- session = camel_test_session_new ("/tmp/camel-test");
-
- /* todo: cross-check everything with folder_info checks as well */
- /* todo: subscriptions? */
- for (i=0;i<ARRAY_LEN(remote_providers);i++) {
- path = getenv(remote_providers[i]);
-
- if (path == NULL) {
- printf("Aborted (ignored).\n");
- printf("Set '%s', to re-run test.\n", remote_providers[i]);
- /* tells make check to ignore us in the total count */
- _exit(77);
- }
- /*camel_test_nonfatal("The IMAP code is just rooted");*/
- test_folder_basic(session, path, FALSE, FALSE);
- /*camel_test_fatal();*/
- }
-
- camel_object_unref((CamelObject *)session);
- camel_exception_free(ex);
-
- return 0;
-}
diff --git a/camel/tests/folder/test5.c b/camel/tests/folder/test5.c
deleted file mode 100644
index ccdfb23b23..0000000000
--- a/camel/tests/folder/test5.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/* store testing, for remote folders */
-
-#include "camel-test.h"
-#include "folders.h"
-#include "session.h"
-
-#include <camel/camel-exception.h>
-#include <camel/camel-service.h>
-#include <camel/camel-store.h>
-
-#define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))
-
-static char *remote_providers[] = {
- "NNTP_TEST_URL",
-};
-
-int main(int argc, char **argv)
-{
- CamelSession *session;
- CamelException *ex;
- int i;
- char *path;
-
- camel_test_init(argc, argv);
-
- ex = camel_exception_new();
-
- /* clear out any camel-test data */
- system("/bin/rm -rf /tmp/camel-test");
-
- session = camel_test_session_new ("/tmp/camel-test");
-
- /* todo: cross-check everything with folder_info checks as well */
- /* todo: subscriptions? */
- for (i=0;i<ARRAY_LEN(remote_providers);i++) {
- path = getenv(remote_providers[i]);
-
- if (path == NULL) {
- printf("Aborted (ignored).\n");
- printf("Set '%s', to re-run test.\n", remote_providers[i]);
- /* tells make check to ignore us in the total count */
- _exit(77);
- }
- camel_test_nonfatal("Not sure how many tests apply to NNTP");
- test_folder_basic(session, path, FALSE, FALSE);
- camel_test_fatal();
- }
-
- camel_object_unref((CamelObject *)session);
- camel_exception_free(ex);
-
- return 0;
-}
diff --git a/camel/tests/folder/test6.c b/camel/tests/folder/test6.c
deleted file mode 100644
index f0fd8a25ee..0000000000
--- a/camel/tests/folder/test6.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/* folder testing */
-
-#include "camel-test.h"
-#include "folders.h"
-#include "session.h"
-
-#include <camel/camel-exception.h>
-#include <camel/camel-service.h>
-#include <camel/camel-store.h>
-
-#include <camel/camel-folder.h>
-#include <camel/camel-folder-summary.h>
-#include <camel/camel-mime-message.h>
-
-#define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))
-
-static char *remote_providers[] = {
- "IMAP_TEST_URL",
-};
-
-int main(int argc, char **argv)
-{
- CamelSession *session;
- CamelException *ex;
- int i;
- char *path;
-
- camel_test_init(argc, argv);
-
- /* clear out any camel-test data */
- system("/bin/rm -rf /tmp/camel-test");
-
- ex = camel_exception_new();
-
- session = camel_test_session_new ("/tmp/camel-test");
-
- for (i=0;i<ARRAY_LEN(remote_providers);i++) {
- path = getenv(remote_providers[i]);
-
- if (path == NULL) {
- printf("Aborted (ignored).\n");
- printf("Set '%s', to re-run test.\n", remote_providers[i]);
- /* tells make check to ignore us in the total count */
- _exit(77);
- }
- /*camel_test_nonfatal("The IMAP code is just rooted");*/
- test_folder_message_ops(session, path, FALSE, "testbox");
- test_folder_message_ops(session, path, FALSE, "INBOX");
- /*camel_test_fatal();*/
- }
-
- check_unref(session, 1);
- camel_exception_free(ex);
-
- return 0;
-}
diff --git a/camel/tests/folder/test7.c b/camel/tests/folder/test7.c
deleted file mode 100644
index 3dee12916d..0000000000
--- a/camel/tests/folder/test7.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/* folder testing */
-
-#include "camel-test.h"
-#include "messages.h"
-#include "session.h"
-
-#include <camel/camel-exception.h>
-#include <camel/camel-service.h>
-#include <camel/camel-store.h>
-
-#include <camel/camel-folder.h>
-#include <camel/camel-folder-summary.h>
-#include <camel/camel-mime-message.h>
-
-#define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))
-
-static char *remote_providers[] = {
- "NNTP_TEST_URL",
-};
-
-int main(int argc, char **argv)
-{
- CamelSession *session;
- CamelException *ex;
- int i;
- char *path;
-
- camel_test_init(argc, argv);
-
- /* clear out any camel-test data */
- system("/bin/rm -rf /tmp/camel-test");
-
- ex = camel_exception_new();
-
- session = camel_test_session_new ("/tmp/camel-test");
-
- for (i=0;i<ARRAY_LEN(remote_providers);i++) {
- path = getenv(remote_providers[i]);
-
- if (path == NULL) {
- printf("Aborted (ignored).\n");
- printf("Set '%s', to re-run test.\n", remote_providers[i]);
- /* tells make check to ignore us in the total count */
- _exit(77);
- }
- camel_test_nonfatal("Dont know how many tests apply to NNTP");
- test_folder_message_ops(session, path, FALSE, "testbox");
- camel_test_fatal();
- }
-
- check_unref(session, 1);
- camel_exception_free(ex);
-
- return 0;
-}
diff --git a/camel/tests/folder/test8.c b/camel/tests/folder/test8.c
deleted file mode 100644
index c035f6227c..0000000000
--- a/camel/tests/folder/test8.c
+++ /dev/null
@@ -1,205 +0,0 @@
-/* threaded folder testing */
-
-#include <string.h>
-#include <pthread.h>
-
-#include "camel-test.h"
-#include "folders.h"
-#include "messages.h"
-#include "session.h"
-
-#include <camel/camel-exception.h>
-#include <camel/camel-service.h>
-#include <camel/camel-store.h>
-
-#define MAX_MESSAGES (100)
-#define MAX_THREADS (10)
-
-#define d(x)
-
-#define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))
-
-static char *local_providers[] = {
- "mbox",
- "mh",
- "maildir"
-};
-
-static void
-test_add_message(CamelFolder *folder, int j)
-{
- CamelMimeMessage *msg;
- char *content;
- char *subject;
- CamelException ex;
-
- camel_exception_init(&ex);
-
- push("creating message %d\n", j);
- msg = test_message_create_simple();
- content = g_strdup_printf("Test message %08x contents\n\n", j);
- test_message_set_content_simple((CamelMimePart *)msg, 0, "text/plain",
- content, strlen(content));
- test_free(content);
- subject = g_strdup_printf("Test message %08x subject", j);
- camel_mime_message_set_subject(msg, subject);
- pull();
-
- push("appending simple message %d", j);
- camel_folder_append_message(folder, msg, NULL, NULL, &ex);
- check_msg(!camel_exception_is_set(&ex), "%s", camel_exception_get_description(&ex));
- pull();
-
- check_unref(msg, 1);
-}
-
-struct _threadinfo {
- int id;
- CamelFolder *folder;
-};
-
-static void *
-worker(void *d)
-{
- struct _threadinfo *info = d;
- int i, j, id = info->id;
- char *sub, *content;
- GPtrArray *res;
- CamelException *ex = camel_exception_new();
- CamelMimeMessage *msg;
-
- /* we add a message, search for it, twiddle some flags, delete it */
- /* and flat out */
- for (i=0;i<MAX_MESSAGES;i++) {
- d(printf("Thread %ld message %i\n", pthread_self(), i));
- test_add_message(info->folder, id+i);
-
- sub = g_strdup_printf("(match-all (header-contains \"subject\" \"message %08x subject\"))", id+i);
-
- push("searching for message %d\n\tusing: %s", id+i, sub);
- res = camel_folder_search_by_expression(info->folder, sub, ex);
- check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
- check_msg(res->len == 1, "res->len = %d", res->len);
- pull();
-
- push("getting message '%s'", res->pdata[0]);
- msg = camel_folder_get_message(info->folder, (char *)res->pdata[0], ex);
- check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
- pull();
-
- content = g_strdup_printf("Test message %08x contents\n\n", id+i);
- push("comparing content '%s': '%s'", res->pdata[0], content);
- test_message_compare_content(camel_medium_get_content_object((CamelMedium *)msg), content, strlen(content));
- test_free(content);
- pull();
-
- push("deleting message, cleanup");
- j=(100.0*rand()/(RAND_MAX+1.0));
- if (j<=70) {
- camel_folder_delete_message(info->folder, res->pdata[0]);
- }
-
- camel_folder_search_free(info->folder, res);
- res = NULL;
- test_free(sub);
-
- check_unref(msg, 1);
- pull();
-
- /* about 1-in 100 calls will expunge */
- j=(200.0*rand()/(RAND_MAX+1.0));
- if (j<=2) {
- d(printf("Forcing an expuge\n"));
- push("expunging folder");
- camel_folder_expunge(info->folder, ex);
- check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
- pull();
- }
- }
-
- camel_exception_free(ex);
-
- return info;
-}
-
-int main(int argc, char **argv)
-{
- CamelSession *session;
- CamelException *ex;
- int i, j, index;
- char *path;
- CamelStore *store;
- pthread_t threads[MAX_THREADS];
- struct _threadinfo *info;
- CamelFolder *folder;
- GPtrArray *uids;
-
- camel_test_init(argc, argv);
-
- ex = camel_exception_new();
-
- /* clear out any camel-test data */
- system("/bin/rm -rf /tmp/camel-test");
-
- session = camel_test_session_new ("/tmp/camel-test");
-
- for (j=0;j<ARRAY_LEN(local_providers);j++) {
- for (index=0;index<2;index++) {
- path = g_strdup_printf("method %s %s", local_providers[j], index?"indexed":"nonindexed");
- camel_test_start(path);
- test_free(path);
-
- push("trying %s index %d", local_providers[j], index);
- path = g_strdup_printf("%s:///tmp/camel-test/%s", local_providers[j], local_providers[j]);
- store = camel_session_get_store(session, path, ex);
- check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
- test_free(path);
-
- if (index == 0)
- folder = camel_store_get_folder(store, "testbox", CAMEL_STORE_FOLDER_CREATE, ex);
- else
- folder = camel_store_get_folder(store, "testbox",
- CAMEL_STORE_FOLDER_CREATE|CAMEL_STORE_FOLDER_BODY_INDEX, ex);
- check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
-
- for (i=0;i<MAX_THREADS;i++) {
- info = g_malloc(sizeof(*info));
- info->id = i*MAX_MESSAGES;
- info->folder = folder;
- pthread_create(&threads[i], 0, worker, info);
- }
-
- for (i=0;i<MAX_THREADS;i++) {
- pthread_join(threads[i], (void **)&info);
- g_free(info);
- }
- pull();
-
- push("deleting remaining messages");
- uids = camel_folder_get_uids(folder);
- for (i=0;i<uids->len;i++) {
- camel_folder_delete_message(folder, uids->pdata[i]);
- }
- camel_folder_free_uids(folder, uids);
-
- camel_folder_expunge(folder, ex);
- check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
-
- check_unref(folder, 1);
-
- camel_store_delete_folder(store, "testbox", ex);
- check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
-
- check_unref(store, 1);
-
- pull();
-
- camel_test_end();
- }
- }
-
- camel_object_unref((CamelObject *)session);
- camel_exception_free(ex);
-
- return 0;
-}
diff --git a/camel/tests/folder/test9.c b/camel/tests/folder/test9.c
deleted file mode 100644
index 79d34c76a5..0000000000
--- a/camel/tests/folder/test9.c
+++ /dev/null
@@ -1,229 +0,0 @@
-/* folder/index testing */
-
-#include <string.h>
-
-#include "camel-test.h"
-#include "messages.h"
-#include "folders.h"
-#include "session.h"
-
-#include "camel/camel-exception.h"
-#include "camel/camel-service.h"
-#include "camel/camel-store.h"
-
-#include "camel/camel-folder.h"
-#include "camel/camel-folder-summary.h"
-#include "camel/camel-mime-message.h"
-#include "camel/camel-filter-driver.h"
-#include "camel/camel-stream-fs.h"
-
-#define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))
-
-struct {
- char *name;
- CamelFolder *folder;
-} mailboxes[] = {
- { "INBOX", NULL },
- { "folder1", NULL },
- { "folder2", NULL },
- { "folder3", NULL },
- { "folder4", NULL },
-};
-
-struct {
- char *name, *match, *action;
-} rules[] = {
- { "empty1", "(match-all (header-contains \"Frobnitz\"))", "(copy-to \"folder1\")" },
- { "empty2", "(header-contains \"Frobnitz\")", "(copy-to \"folder2\")" },
- { "count11", "(and (header-contains \"subject\" \"Test1\") (header-contains \"subject\" \"subject\"))", "(move-to \"folder3\")" },
- { "empty3", "(and (header-contains \"subject\" \"Test1\") (header-contains \"subject\" \"subject\"))", "(move-to \"folder4\")" },
- { "count1", "(body-contains \"data50\")", "(copy-to \"folder1\")" },
- { "stop", "(body-contains \"data2\")", "(stop)" },
- { "notreached1", "(body-contains \"data2\")", "(move-to \"folder2\")" },
- { "count1", "(body-contains \"data3\")", "(move-to \"folder2\")" },
- { "ustrcasecmp", "(header-matches \"Subject\" \"Test0 message100 subject\")", "(copy-to \"folder2\")" },
-};
-
-/* broken match rules */
-struct {
- char *name, *match, *action;
-} brokens[] = {
- { "count1", "(body-contains data50)", "(copy-to \"folder1\")" }, /* non string argument */
- { "count1", "(body-contains-stuff \"data3\")", "(move-to-folder \"folder2\")" }, /* invalid function */
- { "count1", "(or (body-contains \"data3\") (foo))", "(move-to-folder \"folder2\")" }, /* invalid function */
- { "count1", "(or (body-contains \"data3\") (foo)", "(move-to-folder \"folder2\")" }, /* missing ) */
- { "count1", "(and body-contains \"data3\") (foo)", "(move-to-folder \"folder2\")" }, /* missing ( */
- { "count1", "body-contains \"data3\")", "(move-to-folder \"folder2\")" }, /* missing ( */
- { "count1", "body-contains \"data3\"", "(move-to-folder \"folder2\")" }, /* missing ( ) */
- { "count1", "(body-contains \"data3\" ())", "(move-to-folder \"folder2\")" }, /* extra () */
- { "count1", "()", "(move-to-folder \"folder2\")" }, /* invalid () */
- { "count1", "", "(move-to-folder \"folder2\")" }, /* empty */
-};
-
-/* broken action rules */
-struct {
- char *name, *match, *action;
-} brokena[] = {
- { "a", "(body-contains \"data2\")", "(body-contains \"help\")" }, /* rule in action */
- { "a", "(body-contains \"data2\")", "(move-to-folder-name \"folder2\")" }, /* unknown function */
- { "a", "(body-contains \"data2\")", "(or (move-to-folder \"folder2\")" }, /* missing ) */
- { "a", "(body-contains \"data2\")", "(or move-to-folder \"folder2\"))" }, /* missing ( */
- { "a", "(body-contains \"data2\")", "move-to-folder \"folder2\")" }, /* missing ( */
- { "a", "(body-contains \"data2\")", "(move-to-folder \"folder2\" ())" }, /* invalid () */
- { "a", "(body-contains \"data2\")", "()" }, /* invalid () */
- { "a", "(body-contains \"data2\")", "" }, /* empty */
-};
-
-static CamelFolder *get_folder(CamelFilterDriver *d, const char *uri, void *data, CamelException *ex)
-{
- int i;
-
- for (i=0;i<ARRAY_LEN(mailboxes);i++)
- if (!strcmp(mailboxes[i].name, uri)) {
- camel_object_ref((CamelObject *)mailboxes[i].folder);
- return mailboxes[i].folder;
- }
- return NULL;
-}
-
-int main(int argc, char **argv)
-{
- CamelSession *session;
- CamelStore *store;
- CamelException *ex;
- CamelFolder *folder;
- CamelMimeMessage *msg;
- int i, j;
- CamelStream *mbox;
- CamelFilterDriver *driver;
-
- /*gtk_init(&argc, &argv);*/
-
- camel_test_init(argc, argv);
-
- ex = camel_exception_new();
-
- /* clear out any camel-test data */
- system("/bin/rm -rf /tmp/camel-test");
-
- camel_test_start("Simple filtering of mbox");
-
- session = camel_test_session_new ("/tmp/camel-test");
-
- /* todo: cross-check everything with folder_info checks as well */
- /* todo: work out how to do imap/pop/nntp tests */
-
- push("getting store");
- store = camel_session_get_store(session, "mbox:///tmp/camel-test/mbox", ex);
- check_msg(!camel_exception_is_set(ex), "getting store: %s", camel_exception_get_description(ex));
- check(store != NULL);
- pull();
-
- push("Creating output folders");
- for (i=0;i<ARRAY_LEN(mailboxes);i++) {
- push("creating %s", mailboxes[i].name);
- mailboxes[i].folder = folder = camel_store_get_folder(store, mailboxes[i].name, CAMEL_STORE_FOLDER_CREATE, ex);
- check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
- check(folder != NULL);
-
- /* we need an empty folder for this to work */
- test_folder_counts(folder, 0, 0);
- pull();
- }
- pull();
-
- /* append a bunch of messages with specific content */
- push("creating 100 test message mbox");
- mbox = camel_stream_fs_new_with_name("/tmp/camel-test/inbox", O_WRONLY|O_CREAT|O_EXCL, 0600);
- for (j=0;j<100;j++) {
- char *content, *subject;
-
- push("creating test message");
- msg = test_message_create_simple();
- content = g_strdup_printf("data%d content\n", j);
- test_message_set_content_simple((CamelMimePart *)msg, 0, "text/plain",
- content, strlen(content));
- test_free(content);
- subject = g_strdup_printf("Test%d message%d subject", j, 100-j);
- camel_mime_message_set_subject(msg, subject);
-
- camel_mime_message_set_date(msg, j*60*24, 0);
- pull();
-
- camel_stream_printf(mbox, "From \n");
- check(camel_data_wrapper_write_to_stream((CamelDataWrapper *)msg, mbox) != -1);
-#if 0
- push("appending simple message %d", j);
- camel_folder_append_message(folder, msg, NULL, ex);
- check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
- pull();
-#endif
- test_free(subject);
-
- check_unref(msg, 1);
- }
- check(camel_stream_close(mbox) != -1);
- check_unref(mbox, 1);
- pull();
-
- push("Building filters");
- driver = camel_filter_driver_new(session);
- camel_filter_driver_set_folder_func(driver, get_folder, NULL);
- for (i=0;i<ARRAY_LEN(rules);i++) {
- camel_filter_driver_add_rule(driver, rules[i].name, rules[i].match, rules[i].action);
- }
- pull();
-
- push("Executing filters");
- camel_filter_driver_set_default_folder(driver, mailboxes[0].folder);
- camel_filter_driver_filter_mbox(driver, "/tmp/camel-test/inbox", NULL, ex);
- check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
-
- /* now need to check the folder counts/etc */
-
- check_unref(driver, 1);
- pull();
-
- /* this tests that invalid rules are caught */
- push("Testing broken match rules");
- for (i=0;i<ARRAY_LEN(brokens);i++) {
- push("rule %s", brokens[i].match);
- driver = camel_filter_driver_new(session);
- camel_filter_driver_set_folder_func(driver, get_folder, NULL);
- camel_filter_driver_add_rule(driver, brokens[i].name, brokens[i].match, brokens[i].action);
- camel_filter_driver_filter_mbox(driver, "/tmp/camel-test/inbox", NULL, ex);
- check(camel_exception_is_set(ex));
- camel_exception_clear(ex);
- check_unref(driver, 1);
- pull();
- }
- pull();
-
- push("Testing broken action rules");
- for (i=0;i<ARRAY_LEN(brokena);i++) {
- push("rule %s", brokena[i].action);
- driver = camel_filter_driver_new(session);
- camel_filter_driver_set_folder_func(driver, get_folder, NULL);
- camel_filter_driver_add_rule(driver, brokena[i].name, brokena[i].match, brokena[i].action);
- camel_filter_driver_filter_mbox(driver, "/tmp/camel-test/inbox", NULL, ex);
- check(camel_exception_is_set(ex));
- camel_exception_clear(ex);
- check_unref(driver, 1);
- pull();
- }
- pull();
-
-
- for (i=0;i<ARRAY_LEN(mailboxes);i++) {
- check_unref(mailboxes[i].folder, 1);
- }
-
- check_unref(store, 1);
-
- check_unref(session, 1);
- camel_exception_free(ex);
-
- camel_test_end();
-
- return 0;
-}
diff --git a/camel/tests/lib/.cvsignore b/camel/tests/lib/.cvsignore
deleted file mode 100644
index ba98331a6d..0000000000
--- a/camel/tests/lib/.cvsignore
+++ /dev/null
@@ -1,12 +0,0 @@
-.deps
-Makefile
-Makefile.in
-.libs
-.deps
-*.lo
-*.la
-temp-test
-*.bb
-*.bbg
-*.da
-*.gcov
diff --git a/camel/tests/lib/Makefile.am b/camel/tests/lib/Makefile.am
deleted file mode 100644
index 93ec07abd5..0000000000
--- a/camel/tests/lib/Makefile.am
+++ /dev/null
@@ -1,22 +0,0 @@
-
-INCLUDES = \
- -I$(includedir) \
- -I$(top_srcdir) \
- -I$(top_srcdir)/intl \
- -I$(top_srcdir)/e-util \
- -I$(top_srcdir)/camel \
- $(CAMEL_CFLAGS)
-
-check_LIBRARIES = libcameltest.a
-
-libcameltest_a_SOURCES = \
- camel-test.c camel-test.h \
- messages.c messages.h \
- addresses.c addresses.h \
- folders.c folders.h \
- session.c session.h \
- streams.c streams.h \
- address-data.h
-
-libcameltest_a_LIBADD = \
- $(top_builddir)/e-util/libeutil.la
diff --git a/camel/tests/lib/address-data.h b/camel/tests/lib/address-data.h
deleted file mode 100644
index acecac596a..0000000000
--- a/camel/tests/lib/address-data.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/* BE WARY of editing this file with emacs.
- Otherwise it might be smart and try to re-encode everything, which
- you really do not want
-*/
-
-static struct _a {
- int count;
- char *addr;
- char *utf8; /* the utf8 in this table was generated by camel itself. As a result i'm making the assumption it
- was right when it was created. It also depends on the format of ::format(),. which is likely to
- change, to handle other bugs ! */
-} test_address[] = {
- { 1, "\"=?ISO-8859-1?Q?David_Guti=E9rrez_Magallanes?=\" <david@iiia.csic.es>", "David Gutiérrez Magallanes <david@iiia.csic.es>" },
- { 1, "\"=?iso-8859-1?Q?Jos=E9?= Antonio Milke G.\" <gerencia@ovoplus.com>", "José Antonio Milke G. <gerencia@ovoplus.com>" },
- { 1, "\"=?iso-8859-2?Q?Hi-Fi_Internert_market_=3D_1.Virtu=E1ln=ED_Internetov=E9_H?= =?iso-8859-2?Q?i-Fi_Studio?=\" <hifimarket@atlas.cz>", "Hi-Fi Internert market = 1.Virtuální Internetové Hi-Fi Studio <hifimarket@atlas.cz>" },
- { 3, "\"James M. Cape\" <jcape@jcinteractive.com>, =?iso-8859-1?Q?Joaqu=EDn_Cuenca_Abela?= <cuenca@ie2.u-psud.fr>, gnome-hackers@nuclecu.unam.mx", "James M. Cape <jcape@jcinteractive.com>, Joaquín Cuenca Abela <cuenca@ie2.u-psud.fr>, gnome-hackers@nuclecu.unam.mx" },
- { 1, "=?ISO-8859-1?Q?David_Guti=E9rrez_Magallanes?= <david@iiia.csic.es>", "David Gutiérrez Magallanes <david@iiia.csic.es>" },
- { 1, "=?ISO-8859-2?Q?Tomasz_K=B3oczko?= <kloczek@rudy.mif.pg.gda.pl>", "Tomasz Kłoczko <kloczek@rudy.mif.pg.gda.pl>" },
- { 1, "=?ISO-8859-2?Q?Vladim=EDr_Solnick=FD?= <vs@utia.cas.cz>", "Vladimír Solnický <vs@utia.cas.cz>" },
- { 1, "=?iso-8859-1?Q?=22S=F6rensen=2C_Daniel=22?= <dasar@wmdata.com>", "\"Sörensen, Daniel\" <dasar@wmdata.com>" },
- { 1, "=?iso-8859-1?Q?=C1=C2=AAQ=A7=CA?= <dennys@iim.nctu.edu.tw>", "ÁªQ§Ê <dennys@iim.nctu.edu.tw>" },
- { 1, "=?iso-8859-1?Q?=C1=C2=AAQ=A7=CA?= <dennys@news.iim.nctu.edu.tw>", "ÁªQ§Ê <dennys@news.iim.nctu.edu.tw>" },
- { 1, "=?iso-8859-1?Q?=C1kos?= Valentinyi <A.Valentinyi@soton.ac.uk>", "Ákos Valentinyi <A.Valentinyi@soton.ac.uk>" },
- { 1, "=?iso-8859-1?Q?Joaqu=EDn?= Cuenca Abela <cuenca@ie2.u-psud.fr>", "Joaquín Cuenca Abela <cuenca@ie2.u-psud.fr>" },
- { 2, "=?iso-8859-1?Q?Joaqu=EDn?= Cuenca Abela <cuenca@ie2.u-psud.fr>, gnome-hackers@nuclecu.unam.mx", "Joaquín Cuenca Abela <cuenca@ie2.u-psud.fr>, gnome-hackers@nuclecu.unam.mx" },
- { 1, "=?iso-8859-1?Q?Joaqu=EDn_Cuenca_Abela?= <cuenca@celium.net>", "Joaquín Cuenca Abela <cuenca@celium.net>" },
- { 1, "=?iso-8859-1?Q?Juantom=E1s=20Garc=EDa?= <juantomas@lared.es>", "Juantomás García <juantomas@lared.es>" },
- { 1, "=?iso-8859-1?Q?Kenneth_ll=E9phaane_Christiansen?= <kenneth@ripen.dk>", "Kenneth lléphaane Christiansen <kenneth@ripen.dk>" },
- { 1, "=?iso-8859-1?Q?Kjell_Tage_=D8hman?= <tage@ohman.no>", "Kjell Tage Øhman <tage@ohman.no>" },
- { 1, "=?iso-8859-1?Q?Martin_Norb=E4ck?= <d95mback@dtek.chalmers.se>", "Martin Norbäck <d95mback@dtek.chalmers.se>" },
- { 1, "=?iso-8859-1?Q?P=E5llen?= <pollen@astrakan.hig.se>", "Pållen <pollen@astrakan.hig.se>" },
- { 1, "=?iso-8859-1?Q?Ville_P=E4tsi?= <drc@gnu.org>", "Ville Pätsi <drc@gnu.org>" },
- { 1, "=?iso-8859-1?q?Joaqu=EDn?= Cuenca Abela <cuenca@celium.net>", "Joaquín Cuenca Abela <cuenca@celium.net>" },
- { 1, "=?iso-8859-2?Q?Dra=BEen_Ka=E8ar?= <dave@srce.hr>", "Dražen Kačar <dave@srce.hr>" },
- /* yep this is right, this isn't valid so doesn't decode at all */
- { 1, "=?windows-1250?Q? \"Jaka Mo=E8nik\" ?= <jaka.mocnik@kiss.uni-lj.si>", "=?windows-1250?Q? Jaka Mo=E8nik ?= <jaka.mocnik@kiss.uni-lj.si>" },
- { 3, "George <jirka@5z.com>, Juantomas =?ISO-8859-1?Q?Garc=C3=83=C2=ADa?= <juantomas@lared.es>, gnome-hackers@gnome.org", "George <jirka@5z.com>, Juantomas García <juantomas@lared.es>, gnome-hackers@gnome.org" },
- { 7, "Jon Trowbridge <trow@emccta.com>, gnome-1.4-list@gnome.org, gnome-devel-list@gnome.org, gnome-hackers@gnome.org, Dom Lachowicz <cinamod@hotmail.com>, =?iso-8859-1?Q?Joaqu=EDn_Cuenca_Abela?= <cuenca@celium.net>, sam th <sam@uchicago.edu>", "Jon Trowbridge <trow@emccta.com>, gnome-1.4-list@gnome.org, gnome-devel-list@gnome.org, gnome-hackers@gnome.org, Dom Lachowicz <cinamod@hotmail.com>, Joaquín Cuenca Abela <cuenca@celium.net>, sam th <sam@uchicago.edu>" },
- { 6, "Jon Trowbridge <trow@emccta.com>, gnome-1.4-list@gnome.org, gnome-devel-list@gnome.org, gnome-hackers@gnome.org, Dom Lachowicz <cinamod@hotmail.com>, =?iso-8859-1?Q?Joaqu=EDn_Cuenca_Abela?= <cuenca@ie2.u-psud.fr>", "Jon Trowbridge <trow@emccta.com>, gnome-1.4-list@gnome.org, gnome-devel-list@gnome.org, gnome-hackers@gnome.org, Dom Lachowicz <cinamod@hotmail.com>, Joaquín Cuenca Abela <cuenca@ie2.u-psud.fr>" },
- { 1, "Kai =?iso-8859-1?Q?Gro=DFjohann?= <Kai.Grossjohann@CS.Uni-Dortmund.DE>", "Kai Großjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>" },
- { 1, "Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai =?iso-8859-1?q?Gro=DFjohann?=)", "Kai Großjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>" },
- { 1, "Rickard =?iso-8859-1?Q?Nordstr=F6m?= <rzi@ebox.tninet.se>", "Rickard Nordström <rzi@ebox.tninet.se>" },
- { 1, "Tomasz =?iso-8859-2?q?K=B3oczko?= <kloczek@rudy.mif.pg.gda.pl>", "Tomasz Kłoczko <kloczek@rudy.mif.pg.gda.pl>" },
- { 1, "VALCKE =?iso-8859-1?Q?C=E9dric?= <cvalcke@freesurf.fr>", "VALCKE Cédric <cvalcke@freesurf.fr>" },
- { 1, "Ville =?iso-8859-1?q?P=E4tsi?= <drc@gnu.org>", "Ville Pätsi <drc@gnu.org>" },
- { 1, "david@iiia.csic.es (=?ISO-8859-1?Q?David_Guti=E9rrez_Magallanes?=)", "David Gutiérrez Magallanes <david@iiia.csic.es>" },
- { 1, "kloczek@rudy.mif.pg.gda.pl (=?ISO-8859-2?Q?Tomasz_K=B3oczko?=)", "Tomasz Kłoczko <kloczek@rudy.mif.pg.gda.pl>" },
- { 1, "lassehp@imv.aau.dk (Lasse =?ISO-8859-1?Q?Hiller=F8e?= Petersen)", "Lasse Hillerøe Petersen <lassehp@imv.aau.dk>" },
- { 1, "ysato@etl.go.jp (Yutaka Sato =?ISO-2022-JP?B?GyRAOjRGI0stGyhK?=)", "Yutaka Sato 佐藤豊 <ysato@etl.go.jp>" },
-};
-
-static struct _l {
- char *type;
- char *line;
-} test_lines[] = {
- /* commented out unsupported charsets - FIXME: camel should somehow handle this, although it can't really of course */
- /*{ "windows-1251", " .\n ?" },*/
- { "iso-8859-1", "Omple les miniatures de la finestra amb contingut de la pantalla" },
- { "ISO-8859-2", "Sprvce oken hbe s okrajem okna\n(AfterStep, Enlightenment, FVWM, IceWM, Sawmill)" },
- { "ISO-8859-1", "Vindueshndtering flytter dekorationsvindue istedet\n(AfterStep, Enlightenment, FVWM, IceWM, Sawfish)" },
- { "ISO-8859-1", "Vorschaubilder der Fenster mit dem Bildschirminhalt ausfllen" },
- { "iso-8859-7", " (-)" },
- { "iso-8859-1", "You've chosen to disable the startup hint.\nTo re-enable it, choose \"Startup Hint\"\nin the GNOME Control Centre" },
- { "iso-8859-1", "El aplique de reloj muestra en su panel la fecha y la hora de forma simple \ny ligero " },
- { "iso-8859-1", "Applet ei vasta salvestusksule.\nKas peaks ta niisama sulgema, vi veel ootama?" },
- { "iso-8859-1", "Lehio kudeatzaileak lehioaren dekorazaioa mugiarazten\n(AfterStep, Enlightenment, FVWM, IceWM, Sawmill)" },
- { "iso-8859-15", "Nyt sovellukset, joiden ikkunoista on nkyvill vain otsikkopalkki" },
- { "ISO-8859-1", "Afficher les tches qui ne sont pas dans la liste des fentres" },
- { "iso-8859-1", "Nl applet ag tabhair freagra ar iarratas sbhil.\nBain amach an applet n lean ar fnacht?" },
- { "iso-8859-1", "Amosa-las tarefas agochadas da lista de fiestras (SKIP-WINLIST)" },
- { "iso-8859-2", "Az ablakkezel a dekorcit mozgassa az ablak helyett\n(AfterStep, Enlightenment, FVWM, IceWM, SawMill)" },
- { "iso-8859-1", "Riempi la finestra delle anteprime con il contenuto dello schermo" },
- { "euc-jp", "ɥޥ͡Ͼꥦɥư\n(AfterStep, Enlightenment, FVWM, IceWM, Sawfish)" },
- { "euc-kr", "â ڰ ٹ â ̵\n(AfterStep, Enlightenment, FVWM, IceWM, Sawmill)" },
- { "iso-8859-13", "Priedas neatsakinja praym isisaugoti.\nPaalinti pried ar laukti toliau?" },
- { "iso-8859-1", "Window manager verplaatst dekoratie\n(AfterStep, Enlightenment, FVWM, IceWM, Sawmill)" },
- { "iso-8859-1", "Vindushndtereren flytter dekorasjonsvinduet i stedet\n(AfterStep, Enlightenment, FVWM, IceWM, Sawfish)" },
- { "iso-8859-2", "Przemieszczanie dekoracji zamiast okna\n(AfterStep, Enlightenment, FVWM, IceWM, Sawmill)" },
- { "iso-8859-1", "Este programa responsvel por executar outras aplicaes, embeber pequenos applets, a paz no mundo e crashes aleatrios do X." },
- { "iso-8859-1", "Mostrar tarefas que se escondem da lista de janelas (SKIP-WINLIST)" },
- { "koi8-r", " " },
- { "iso-8859-2", "Sprvca okien presva okraje okien\n(AfterStep, Enlightenment, FVWM, IceWM, Sawfish)" },
- { "iso-8859-2", "Kai posle, ki se skrivajo pred upravljalnik oken (SKIP-WINLIST)" },
- { "iso-8859-5", "Window a\n(AfterStep, Enlightenment, FVWM, IceWM, Sawmill)" },
- { "iso-8859-2", "Window menadzeri pomera dekoracioni prozor umesto toga\n(AfterStep, Enlightenment, FVWM, IceWM, Sawmill)" },
- { "iso-8859-1", "Fnsterhanteraren flyttar dekorationsfnstret istllet\n(AfterStep, Enlightenment, FVWM, IceWM, Sawfish)" },
- /*{ "TSCII", "츼- ¡ 츼 (츼--Ţ)" },*/
- { "iso-8859-9", "Kaydetme isteine bir uygulak cevap vermiyor .\nUygula sileyim mi , yoksa bekleyeyim mi ?" },
- { "koi8-u", "ͦ æ ͦ צ\n(AfterStep, Enlightenment, FVWM, IceWM, Sawfish)" },
- { "iso-8859-1", "Cwand on scriftr est bodj fo, li scriftr t totes\nles apliketes dvins sont pierdowes. Bodj ci scriftr chal?" },
- { "gb2312", "ǨƵװδڹ(AfterStep, Enlightenment, FVWM, IceWM, SawMill)" },
- { "big5", "޲z̥uʸ˹\n(AfterStep, Enlightenment, FVWM, IceWM, Sawmill)" },
-};
diff --git a/camel/tests/lib/addresses.c b/camel/tests/lib/addresses.c
deleted file mode 100644
index 57275511c4..0000000000
--- a/camel/tests/lib/addresses.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-#include <string.h>
-
-#include "addresses.h"
-#include "camel-test.h"
-
-void
-test_address_compare(CamelInternetAddress *addr, CamelInternetAddress *addr2)
-{
- const char *r1, *r2, *a1, *a2;
- char *e1, *e2, *f1, *f2;
- int j;
-
- check(camel_address_length(CAMEL_ADDRESS(addr)) == camel_address_length(CAMEL_ADDRESS(addr2)));
- for (j=0;j<camel_address_length(CAMEL_ADDRESS(addr));j++) {
-
- check(camel_internet_address_get(addr, j, &r1, &a1) == TRUE);
- check(camel_internet_address_get(addr2, j, &r2, &a2) == TRUE);
-
- check(string_equal(r1, r2));
- check(strcmp(a1, a2) == 0);
- }
- check(camel_internet_address_get(addr, j, &r1, &a1) == FALSE);
- check(camel_internet_address_get(addr2, j, &r2, &a2) == FALSE);
-
- e1 = camel_address_encode(CAMEL_ADDRESS(addr));
- e2 = camel_address_encode(CAMEL_ADDRESS(addr2));
-
- if (camel_address_length(CAMEL_ADDRESS(addr)) == 0)
- check(e1 == NULL && e2 == NULL);
- else
- check(e1 != NULL && e2 != NULL);
-
- if (e1 != NULL) {
- check_msg(string_equal(e1, e2), "e1 = '%s' e2 = '%s'", e1, e2);
- test_free(e1);
- test_free(e2);
- }
-
- f1 = camel_address_format(CAMEL_ADDRESS(addr));
- f2 = camel_address_format(CAMEL_ADDRESS(addr2));
-
- if (camel_address_length(CAMEL_ADDRESS(addr)) == 0)
- check(f1 == NULL && f2 == NULL);
- else
- check(f1 != NULL && f2 != NULL);
-
- if (f1 != NULL) {
- check_msg(string_equal(f1, f2), "f1 = '%s' f2 = '%s'", f1, f2);
- test_free(f1);
- test_free(f2);
- }
-}
diff --git a/camel/tests/lib/addresses.h b/camel/tests/lib/addresses.h
deleted file mode 100644
index dc35a19f05..0000000000
--- a/camel/tests/lib/addresses.h
+++ /dev/null
@@ -1,5 +0,0 @@
-
-#include <camel/camel-internet-address.h>
-
-/* addresses.c */
-void test_address_compare(CamelInternetAddress *addr, CamelInternetAddress *addr2);
diff --git a/camel/tests/lib/camel-test.c b/camel/tests/lib/camel-test.c
deleted file mode 100644
index 41622cb3ea..0000000000
--- a/camel/tests/lib/camel-test.c
+++ /dev/null
@@ -1,355 +0,0 @@
-
-#include "camel-test.h"
-
-#include <stdio.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <pthread.h>
-#include <unistd.h>
-#include <signal.h>
-#include <errno.h>
-
-#include <camel/camel.h>
-
-/* well i dunno, doesn't seem to be in the headers but hte manpage mentions it */
-/* a nonportable checking mutex for glibc, not really needed, just validates
- the test harness really */
-# ifdef PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
-static pthread_mutex_t lock = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP;
-# else
-static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
-# endif
-#define CAMEL_TEST_LOCK pthread_mutex_lock(&lock)
-#define CAMEL_TEST_UNLOCK pthread_mutex_unlock(&lock)
-#define CAMEL_TEST_ID (pthread_self())
-
-static int setup;
-static int ok;
-
-struct _stack {
- struct _stack *next;
- int fatal;
- char *what;
-};
-
-/* per-thread state */
-struct _state {
- char *test;
- int nonfatal;
- struct _stack *state;
-};
-
-static GHashTable *info_table;
-
-int camel_test_verbose;
-
-static void
-dump_action(int id, struct _state *s, void *d)
-{
- struct _stack *node;
-
- printf("\nThread %d:\n", id);
-
- node = s->state;
- if (node) {
- printf("Current action:\n");
- while (node) {
- printf("\t%s%s\n", node->fatal?"":"[nonfatal]", node->what);
- node = node->next;
- }
- }
- printf("\tTest: %s\n", s->test);
-}
-
-static void die(int sig)
-{
- static int indie = 0;
-
- if (!indie) {
- indie = 1;
- printf("\n\nReceived fatal signal %d\n", sig);
- g_hash_table_foreach(info_table, (GHFunc)dump_action, 0);
-
- if (camel_test_verbose > 2) {
- printf("Attach debugger to pid %d to debug\n", getpid());
- sleep(1000);
- }
- }
-
- _exit(1);
-}
-
-static struct _state *
-current_state(void)
-{
- struct _state *info;
-
- if (info_table == NULL)
- info_table = g_hash_table_new(0, 0);
-
- info = g_hash_table_lookup(info_table, (void *)CAMEL_TEST_ID);
- if (info == NULL) {
- info = g_malloc0(sizeof(*info));
- g_hash_table_insert(info_table, (void *)CAMEL_TEST_ID, info);
- }
- return info;
-}
-
-
-void camel_test_init(int argc, char **argv)
-{
- struct stat st;
- char *path;
- int i;
-
- setup = 1;
-
- /* yeah, we do need ot thread init, even though camel isn't compiled with enable threads */
- g_thread_init (NULL);
-
- path = g_strdup_printf ("/tmp/camel-test");
- if (mkdir (path, 0700) == -1 && errno != EEXIST)
- abort ();
-
- if (stat (path, &st) == -1)
- abort ();
-
- if (!S_ISDIR (st.st_mode) || access (path, R_OK | W_OK | X_OK) == -1)
- abort ();
-
- camel_init (path, FALSE);
- g_free (path);
-
- camel_type_init ();
-
- info_table = g_hash_table_new(0, 0);
-
- signal(SIGSEGV, die);
- signal(SIGABRT, die);
-
- /* default, just say what, how well we did, unless fail, then abort */
- camel_test_verbose = 1;
-
- for (i=0;i<argc;i++) {
- if (argv[i][0] == '-') {
- switch (argv[i][1]) {
- case 'v':
- camel_test_verbose = strlen(argv[i]);
- break;
- case 'q':
- camel_test_verbose = 0;
- break;
- }
- }
- }
-}
-
-void camel_test_start(const char *what)
-{
- struct _state *s;
-
- CAMEL_TEST_LOCK;
-
- s = current_state();
-
- if (!setup)
- camel_test_init(0, 0);
-
- ok = 1;
-
- s->test = g_strdup(what);
-
- if (camel_test_verbose > 0) {
- printf("Test: %s ... ", what);
- fflush(stdout);
- }
-
- CAMEL_TEST_UNLOCK;
-}
-
-void camel_test_push(const char *what, ...)
-{
- struct _stack *node;
- va_list ap;
- char *text;
- struct _state *s;
-
- CAMEL_TEST_LOCK;
-
- s = current_state();
-
- va_start(ap, what);
- text = g_strdup_vprintf(what, ap);
- va_end(ap);
-
- if (camel_test_verbose > 3)
- printf("Start step: %s\n", text);
-
- node = g_malloc(sizeof(*node));
- node->what = text;
- node->next = s->state;
- node->fatal = 1;
- s->state = node;
-
- CAMEL_TEST_UNLOCK;
-}
-
-void camel_test_pull(void)
-{
- struct _stack *node;
- struct _state *s;
-
- CAMEL_TEST_LOCK;
-
- s = current_state();
-
- g_assert(s->state);
-
- if (camel_test_verbose > 3)
- printf("Finish step: %s\n", s->state->what);
-
- node = s->state;
- s->state = node->next;
- if (!node->fatal)
- s->nonfatal--;
- g_free(node->what);
- g_free(node);
-
- CAMEL_TEST_UNLOCK;
-}
-
-/* where to set breakpoints */
-void camel_test_break(void);
-
-void camel_test_break(void)
-{
-}
-
-void camel_test_fail(const char *why, ...)
-{
- va_list ap;
-
- va_start(ap, why);
- camel_test_failv(why, ap);
- va_end(ap);
-}
-
-
-void camel_test_failv(const char *why, va_list ap)
-{
- char *text;
- struct _state *s;
-
- CAMEL_TEST_LOCK;
-
- s = current_state();
-
- text = g_strdup_vprintf(why, ap);
-
- if ((s->nonfatal == 0 && camel_test_verbose > 0)
- || (s->nonfatal && camel_test_verbose > 1)) {
- printf("Failed.\n%s\n", text);
- camel_test_break();
- }
-
- g_free(text);
-
- if ((s->nonfatal == 0 && camel_test_verbose > 0)
- || (s->nonfatal && camel_test_verbose > 2)) {
- g_hash_table_foreach(info_table, (GHFunc)dump_action, 0);
- }
-
- if (s->nonfatal == 0) {
- exit(1);
- } else {
- ok=0;
- if (camel_test_verbose > 1) {
- printf("Known problem (ignored):\n");
- dump_action(CAMEL_TEST_ID, s, 0);
- }
- }
-
- CAMEL_TEST_UNLOCK;
-}
-
-void camel_test_nonfatal(const char *what, ...)
-{
- struct _stack *node;
- va_list ap;
- char *text;
- struct _state *s;
-
- CAMEL_TEST_LOCK;
-
- s = current_state();
-
- va_start(ap, what);
- text = g_strdup_vprintf(what, ap);
- va_end(ap);
-
- if (camel_test_verbose > 3)
- printf("Start nonfatal: %s\n", text);
-
- node = g_malloc(sizeof(*node));
- node->what = text;
- node->next = s->state;
- node->fatal = 0;
- s->nonfatal++;
- s->state = node;
-
- CAMEL_TEST_UNLOCK;
-}
-
-void camel_test_fatal(void)
-{
- camel_test_pull();
-}
-
-void camel_test_end(void)
-{
- if (camel_test_verbose > 0) {
- if (ok)
- printf("Ok\n");
- else
- printf("Partial success\n");
- }
-
- fflush(stdout);
-}
-
-
-
-
-/* compare strings, ignore whitespace though */
-int string_equal(const char *a, const char *b)
-{
- const char *ap, *bp;
-
- ap = a;
- bp = b;
-
- while (*ap && *bp) {
- while (*ap == ' ' || *ap == '\n' || *ap == '\t')
- ap++;
- while (*bp == ' ' || *bp == '\n' || *bp == '\t')
- bp++;
-
- a = ap;
- b = bp;
-
- while (*ap && *ap != ' ' && *ap != '\n' && *ap != '\t')
- ap++;
- while (*bp && *bp != ' ' && *bp != '\n' && *bp != '\t')
- bp++;
-
- if (ap - a != bp - a
- && ap - 1 > 0
- && memcmp(a, b, ap-a) != 0) {
- return 0;
- }
- }
-
- return 1;
-}
-
diff --git a/camel/tests/lib/camel-test.h b/camel/tests/lib/camel-test.h
deleted file mode 100644
index 986a943fa3..0000000000
--- a/camel/tests/lib/camel-test.h
+++ /dev/null
@@ -1,68 +0,0 @@
-
-/* some utilities for testing */
-
-#include "config.h"
-
-#include <stdlib.h>
-#include <glib.h>
-
-void camel_test_failv(const char *why, va_list ap);
-
-/* perform a check assertion */
-#define check(x) do {if (!(x)) { camel_test_fail("%s:%d: %s", __FILE__, __LINE__, #x); } } while (0)
-/* check with message */
-#ifdef __GNUC__
-#define check_msg(x, y, z...) do {if (!(x)) { camel_test_fail("%s:%d: %s\n\t" #y, __FILE__, __LINE__, #x, ##z); } } while (0)
-#else
-static void check_msg(int truth, char *fmt, ...)
-{
- /* no gcc, we lose the condition that failed, nm */
- if (!truth) {
- va_list ap;
- va_start(ap, fmt);
- camel_test_failv(fmt, ap);
- va_end(ap);
- }
-}
-#endif
-
-#define check_count(object, expected) do { \
- if (CAMEL_OBJECT(object)->ref_count != expected) { \
- camel_test_fail("%s->ref_count != %s\n\tref_count = %d", #object, #expected, CAMEL_OBJECT(object)->ref_count); \
- } \
-} while (0)
-
-#define check_unref(object, expected) do { \
- check_count(object, expected); \
- camel_object_unref(CAMEL_OBJECT(object)); \
- if (expected == 1) { \
- object = NULL; \
- } \
-} while (0)
-
-#define test_free(mem) (g_free(mem), mem=NULL)
-
-#define push camel_test_push
-#define pull camel_test_pull
-
-void camel_test_init(int argc, char **argv);
-
-/* start/finish a new test */
-void camel_test_start(const char *what);
-void camel_test_end(void);
-
-/* start/finish a new test part */
-void camel_test_push(const char *what, ...);
-void camel_test_pull(void);
-
-/* fail a test, with a reason why */
-void camel_test_fail(const char *why, ...);
-void camel_test_failv(const char *why, va_list ap);
-
-/* Set whether a failed test quits. May be nested, but must be called in nonfatal/fatal pairs */
-void camel_test_nonfatal(const char *why, ...);
-void camel_test_fatal(void);
-
-/* utility functions */
-/* compare strings, ignore whitespace though */
-int string_equal(const char *a, const char *b);
diff --git a/camel/tests/lib/folders.c b/camel/tests/lib/folders.c
deleted file mode 100644
index a670576564..0000000000
--- a/camel/tests/lib/folders.c
+++ /dev/null
@@ -1,568 +0,0 @@
-#include <string.h>
-
-#include "camel-test.h"
-#include "folders.h"
-#include "messages.h"
-
-#include "camel/camel-exception.h"
-
-/* check the total/unread is what we think it should be */
-void
-test_folder_counts(CamelFolder *folder, int total, int unread)
-{
- GPtrArray *s;
- int i, myunread;
- CamelMessageInfo *info;
-
- push("test folder counts %d total %d unread", total, unread);
-
- /* first, use the standard functions */
- check(camel_folder_get_message_count(folder) == total);
- check(camel_folder_get_unread_message_count(folder) == total);
-
- /* next, use the summary */
- s = camel_folder_get_summary(folder);
- check(s != NULL);
- check(s->len == total);
- myunread = s->len;
- for (i=0;i<s->len;i++) {
- info = s->pdata[i];
- if (info->flags & CAMEL_MESSAGE_SEEN)
- myunread--;
- }
- check(unread == myunread);
- camel_folder_free_summary(folder, s);
-
- /* last, use the uid list */
- s = camel_folder_get_uids(folder);
- check(s != NULL);
- check(s->len == total);
- myunread = s->len;
- for (i=0;i<s->len;i++) {
- info = camel_folder_get_message_info(folder, s->pdata[i]);
- if (info->flags & CAMEL_MESSAGE_SEEN)
- myunread--;
- camel_folder_free_message_info(folder, info);
- }
- check(unread == myunread);
- camel_folder_free_uids(folder, s);
-
- pull();
-}
-
-static int
-safe_strcmp(const char *a, const char *b)
-{
- if (a == NULL && b == NULL)
- return 0;
- if (a == NULL)
- return 1;
- if (b == NULL)
- return -1;
- return strcmp(a, b);
-}
-
-void
-test_message_info(CamelMimeMessage *msg, const CamelMessageInfo *info)
-{
- check_msg(safe_strcmp(camel_message_info_subject(info), camel_mime_message_get_subject(msg)) == 0,
- "info->subject = '%s', get_subject() = '%s'", camel_message_info_subject(info), camel_mime_message_get_subject(msg));
-
- /* FIXME: testing from/cc/to, etc is more tricky */
-
- check(info->date_sent == camel_mime_message_get_date(msg, NULL));
-
- /* date received isn't set for messages that haven't been sent anywhere ... */
- /*check(info->date_received == camel_mime_message_get_date_received(msg, NULL));*/
-
- /* so is messageid/references, etc */
-}
-
-/* check a message is present */
-void
-test_folder_message(CamelFolder *folder, const char *uid)
-{
- CamelMimeMessage *msg;
- CamelMessageInfo *info;
- GPtrArray *s;
- int i;
- CamelException *ex = camel_exception_new();
- int found;
-
- push("uid %s is in folder", uid);
-
- /* first try getting info */
- info = camel_folder_get_message_info(folder, uid);
- check(info != NULL);
- check(strcmp(camel_message_info_uid(info), uid) == 0);
- camel_folder_free_message_info(folder, info);
-
- /* then, getting message */
- msg = camel_folder_get_message(folder, uid, ex);
- check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
- check(msg != NULL);
-
- /* cross check with info */
- test_message_info(msg, info);
-
- camel_object_unref((CamelObject *)msg);
-
- /* see if it is in the summary (only once) */
- s = camel_folder_get_summary(folder);
- check(s != NULL);
- found = 0;
- for (i=0;i<s->len;i++) {
- info = s->pdata[i];
- if (strcmp(camel_message_info_uid(info), uid) == 0)
- found++;
- }
- check(found == 1);
- camel_folder_free_summary(folder, s);
-
- /* check it is in the uid list */
- s = camel_folder_get_uids(folder);
- check(s != NULL);
- found = 0;
- for (i=0;i<s->len;i++) {
- if (strcmp(s->pdata[i], uid) == 0)
- found++;
- }
- check(found == 1);
- camel_folder_free_uids(folder, s);
-
- camel_exception_free(ex);
-
- pull();
-}
-
-/* check message not present */
-void
-test_folder_not_message(CamelFolder *folder, const char *uid)
-{
- CamelMimeMessage *msg;
- CamelMessageInfo *info;
- GPtrArray *s;
- int i;
- CamelException *ex = camel_exception_new();
- int found;
-
- push("uid '%s' is not in folder", uid);
-
- /* first try getting info */
- push("no message info");
- info = camel_folder_get_message_info(folder, uid);
- check(info == NULL);
- pull();
-
- /* then, getting message */
- push("no message");
- msg = camel_folder_get_message(folder, uid, ex);
- check(camel_exception_is_set(ex));
- check(msg == NULL);
- camel_exception_clear(ex);
- pull();
-
- /* see if it is not in the summary (only once) */
- push("not in summary list");
- s = camel_folder_get_summary(folder);
- check(s != NULL);
- found = 0;
- for (i=0;i<s->len;i++) {
- info = s->pdata[i];
- if (strcmp(camel_message_info_uid(info), uid) == 0)
- found++;
- }
- check(found == 0);
- camel_folder_free_summary(folder, s);
- pull();
-
- /* check it is not in the uid list */
- push("not in uid list");
- s = camel_folder_get_uids(folder);
- check(s != NULL);
- found = 0;
- for (i=0;i<s->len;i++) {
- if (strcmp(s->pdata[i], uid) == 0)
- found++;
- }
- check(found == 0);
- camel_folder_free_uids(folder, s);
- pull();
-
- camel_exception_free(ex);
-
- pull();
-}
-
-/* test basic store operations on folders */
-/* TODO: Add subscription stuff */
-void
-test_folder_basic(CamelSession *session, const char *storename, int local, int spool)
-{
- CamelStore *store;
- CamelException *ex = camel_exception_new();
- CamelFolder *folder;
- char *what = g_strdup_printf("testing store: %s", storename);
-
- camel_test_start(what);
- test_free(what);
-
- push("getting store");
- store = camel_session_get_store(session, storename, ex);
- check_msg(!camel_exception_is_set(ex), "getting store: %s", camel_exception_get_description(ex));
- check(store != NULL);
- pull();
-
- /* local providers == no inbox */
- push("getting inbox folder");
- folder = camel_store_get_inbox(store, ex);
- if (local) {
- check(camel_exception_is_set(ex));
- check(folder == NULL);
- camel_exception_clear(ex);
- } else {
- check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
- check(folder != NULL);
- check_unref(folder, 2);
- }
- pull();
-
- push("getting a non-existant folder, no create");
- folder = camel_store_get_folder(store, "unknown", 0, ex);
- check(camel_exception_is_set(ex));
- check(folder == NULL);
- camel_exception_clear(ex);
- pull();
-
- if (!spool) {
- push("getting a non-existant folder, with create");
- folder = camel_store_get_folder(store, "testbox", CAMEL_STORE_FOLDER_CREATE, ex);
- check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
- check(folder != NULL);
- if (local)
- check_unref(folder, 1);
- else
- check_unref(folder, 2);
- pull();
-
- push("getting an existing folder");
- folder = camel_store_get_folder(store, "testbox", 0, ex);
- check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
- check(folder != NULL);
- if (local)
- check_unref(folder, 1);
- else
- check_unref(folder, 2);
- pull();
-
- push("renaming a non-existant folder");
- camel_store_rename_folder(store, "unknown1", "unknown2", ex);
- check(camel_exception_is_set(ex));
- camel_exception_clear(ex);
- pull();
-
- push("renaming an existing folder");
- camel_store_rename_folder(store, "testbox", "testbox2", ex);
- check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
- pull();
-
- push("opening the old name of a renamed folder");
- folder = camel_store_get_folder(store, "testbox", 0, ex);
- check(camel_exception_is_set(ex));
- check(folder == NULL);
- camel_exception_clear(ex);
- pull();
-
- push("opening the new name of a renamed folder");
- folder = camel_store_get_folder(store, "testbox2", 0, ex);
- check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
- check(folder != NULL);
- if (local)
- check_unref(folder, 1);
- else
- check_unref(folder, 2);
- pull();
- }
-
- push("deleting a non-existant folder");
- camel_store_delete_folder(store, "unknown", ex);
- check(camel_exception_is_set(ex));
- camel_exception_clear(ex);
- pull();
-
- if (!spool) {
- push("deleting an existing folder");
- camel_store_delete_folder(store, "testbox2", ex);
- check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
- pull();
- }
-
- push("opening a folder that has been deleted");
- folder = camel_store_get_folder(store, "testbox2", 0, ex);
- check(camel_exception_is_set(ex));
- check(folder == NULL);
- camel_exception_clear(ex);
- pull();
-
- check_unref(store, 1);
-
- camel_test_end();
-
- camel_exception_free(ex);
-}
-
-
-/* todo: cross-check everything with folder_info checks as well */
-/* this should probably take a folder instead of a session ... */
-void
-test_folder_message_ops(CamelSession *session, const char *name, int local, const char *mailbox)
-{
- CamelStore *store;
- CamelException *ex = camel_exception_new();
- CamelFolder *folder;
- CamelMimeMessage *msg;
- int j;
- int indexed, max;
- GPtrArray *uids;
- CamelMessageInfo *info;
-
- max=local?2:1;
-
- for (indexed = 0;indexed<max;indexed++) {
- char *what = g_strdup_printf("folder ops: %s %s", name, local?(indexed?"indexed":"non-indexed"):"");
- int flags;
-
- camel_test_start(what);
- test_free(what);
-
- push("getting store");
- store = camel_session_get_store(session, name, ex);
- check_msg(!camel_exception_is_set(ex), "getting store: %s", camel_exception_get_description(ex));
- check(store != NULL);
- pull();
-
- push("creating %sindexed folder", indexed?"":"non-");
- if (indexed)
- flags = CAMEL_STORE_FOLDER_CREATE|CAMEL_STORE_FOLDER_BODY_INDEX;
- else
- flags = CAMEL_STORE_FOLDER_CREATE;
- folder = camel_store_get_folder(store, mailbox, flags, ex);
-
- /* we can't create mailbox outside of namespace, since we have no api for it, try
- using inbox namespace, works for courier */
- if (folder == NULL) {
- char *mbox = g_strdup_printf("INBOX/%s", mailbox);
- mailbox = mbox;
- camel_exception_clear(ex);
- folder = camel_store_get_folder(store, mailbox, flags, ex);
- }
-
- check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
- check(folder != NULL);
-
- /* verify empty/can't get nonexistant stuff */
- test_folder_counts(folder, 0, 0);
- test_folder_not_message(folder, "0");
- test_folder_not_message(folder, "");
-
- for (j=0;j<10;j++) {
- char *content, *subject;
-
- push("creating test message");
- msg = test_message_create_simple();
- content = g_strdup_printf("Test message %d contents\n\n", j);
- test_message_set_content_simple((CamelMimePart *)msg, 0, "text/plain",
- content, strlen(content));
- test_free(content);
- subject = g_strdup_printf("Test message %d", j);
- camel_mime_message_set_subject(msg, subject);
- pull();
-
- push("appending simple message %d", j);
- camel_folder_append_message(folder, msg, NULL, NULL, ex);
- check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
-
-#if 0
- /* sigh, this shouldn't be required, but the imap code is too dumb to do it itself */
- if (!local) {
- push("forcing a refresh of folder updates");
- camel_folder_refresh_info(folder, ex);
- check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
- pull();
- }
-#endif
- /*if (!local)
- camel_test_nonfatal("unread counts dont seem right for imap");*/
-
- test_folder_counts(folder, j+1, j+1);
-
- /*if (!local)
- camel_test_fatal();*/
-
- push("checking it is in the right uid slot & exists");
- uids = camel_folder_get_uids(folder);
- check(uids != NULL);
- check(uids->len == j+1);
- if (uids->len > j)
- test_folder_message(folder, uids->pdata[j]);
- pull();
-
- push("checking it is the right message (subject): %s", subject);
- if (uids->len > j) {
- info = camel_folder_get_message_info(folder, uids->pdata[j]);
- check(info != NULL);
- check_msg(strcmp(camel_message_info_subject(info), subject)==0,
- "info->subject %s", camel_message_info_subject(info));
- camel_folder_free_message_info(folder, info);
- }
- camel_folder_free_uids(folder, uids);
- pull();
-
- test_free(subject);
-
- /*if (!local)
- camel_test_fatal();*/
-
- check_unref(msg, 1);
- pull();
- }
-
- if (local)
- check_unref(folder, 1);
- else
- check_unref(folder, 2);
- pull();
-
-#if 0
- push("deleting test folder, with messages in it");
- camel_store_delete_folder(store, mailbox, ex);
- check(camel_exception_is_set(ex));
- camel_exception_clear(ex);
- pull();
-#endif
-
- push("re-opening folder");
- folder = camel_store_get_folder(store, mailbox, flags, ex);
- check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
- check(folder != NULL);
-
- /* verify counts */
- test_folder_counts(folder, 10, 10);
-
- /* re-check uid's, after a reload */
- uids = camel_folder_get_uids(folder);
- check(uids != NULL);
- check(uids->len == 10);
- for (j=0;j<10;j++) {
- char *subject = g_strdup_printf("Test message %d", j);
-
- push("verify reload of %s", subject);
- test_folder_message(folder, uids->pdata[j]);
-
- info = camel_folder_get_message_info(folder, uids->pdata[j]);
- check_msg(strcmp(camel_message_info_subject(info), subject)==0,
- "info->subject %s", camel_message_info_subject(info));
- test_free(subject);
- camel_folder_free_message_info(folder, info);
- pull();
- }
-
- push("deleting first message & expunging");
- camel_folder_delete_message(folder, uids->pdata[0]);
- test_folder_counts(folder, 10, 10);
- camel_folder_expunge(folder, ex);
- check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
- test_folder_not_message(folder, uids->pdata[0]);
- test_folder_counts(folder, 9, 9);
-
- camel_folder_free_uids(folder, uids);
-
- uids = camel_folder_get_uids(folder);
- check(uids != NULL);
- check(uids->len == 9);
- for (j=0;j<9;j++) {
- char *subject = g_strdup_printf("Test message %d", j+1);
-
- push("verify after expunge of %s", subject);
- test_folder_message(folder, uids->pdata[j]);
-
- info = camel_folder_get_message_info(folder, uids->pdata[j]);
- check_msg(strcmp(camel_message_info_subject(info), subject)==0,
- "info->subject %s", camel_message_info_subject(info));
- test_free(subject);
- camel_folder_free_message_info(folder, info);
- pull();
- }
- pull();
-
- push("deleting last message & expunging");
- camel_folder_delete_message(folder, uids->pdata[8]);
- /* sync? */
- test_folder_counts(folder, 9, 9);
- camel_folder_expunge(folder, ex);
- check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
- test_folder_not_message(folder, uids->pdata[8]);
- test_folder_counts(folder, 8, 8);
-
- camel_folder_free_uids(folder, uids);
-
- uids = camel_folder_get_uids(folder);
- check(uids != NULL);
- check(uids->len == 8);
- for (j=0;j<8;j++) {
- char *subject = g_strdup_printf("Test message %d", j+1);
-
- push("verify after expunge of %s", subject);
- test_folder_message(folder, uids->pdata[j]);
-
- info = camel_folder_get_message_info(folder, uids->pdata[j]);
- check_msg(strcmp(camel_message_info_subject(info), subject)==0,
- "info->subject %s", camel_message_info_subject(info));
- test_free(subject);
- camel_folder_free_message_info(folder, info);
- pull();
- }
- pull();
-
- push("deleting all messages & expunging");
- for (j=0;j<8;j++) {
- camel_folder_delete_message(folder, uids->pdata[j]);
- }
- /* sync? */
- test_folder_counts(folder, 8, 8);
- camel_folder_expunge(folder, ex);
- check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
- for (j=0;j<8;j++) {
- test_folder_not_message(folder, uids->pdata[j]);
- }
- test_folder_counts(folder, 0, 0);
-
- camel_folder_free_uids(folder, uids);
- pull();
-
- if (local)
- check_unref(folder, 1);
- else
- check_unref(folder, 2);
- pull(); /* re-opening folder */
-
- if (strcasecmp(mailbox, "INBOX") != 0) {
- push("deleting test folder, with no messages in it");
- camel_store_delete_folder(store, mailbox, ex);
- check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
- pull();
- }
-
- if (!local) {
- push("disconneect service");
- camel_service_disconnect((CamelService *)store, TRUE, ex);
- check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
- pull();
- }
-
- check_unref(store, 1);
- camel_test_end();
- }
-
- camel_exception_free(ex);
-}
diff --git a/camel/tests/lib/folders.h b/camel/tests/lib/folders.h
deleted file mode 100644
index ae981611d3..0000000000
--- a/camel/tests/lib/folders.h
+++ /dev/null
@@ -1,20 +0,0 @@
-
-#include "camel/camel-session.h"
-#include "camel/camel-store.h"
-
-#include <camel/camel-folder.h>
-#include <camel/camel-folder-summary.h>
-#include <camel/camel-mime-message.h>
-
-/* check the total/unread is what we think it should be, everywhere it can be determined */
-void test_folder_counts(CamelFolder *folder, int total, int unread);
-/* cross-check info/msg */
-void test_message_info(CamelMimeMessage *msg, const CamelMessageInfo *info);
-/* check a message is present everywhere it should be */
-void test_folder_message(CamelFolder *folder, const char *uid);
-/* check message not present everywhere it shouldn't be */
-void test_folder_not_message(CamelFolder *folder, const char *uid);
-/* test basic folder ops on a store */
-void test_folder_basic(CamelSession *session, const char *storename, int local, int spool);
-/* test basic message operations on a folder */
-void test_folder_message_ops(CamelSession *session, const char *storename, int local, const char *foldername);
diff --git a/camel/tests/lib/messages.c b/camel/tests/lib/messages.c
deleted file mode 100644
index ff3485f9c2..0000000000
--- a/camel/tests/lib/messages.c
+++ /dev/null
@@ -1,290 +0,0 @@
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-
-#include "messages.h"
-#include "camel-test.h"
-
-#include <camel/camel-multipart.h>
-#include <camel/camel-mime-message.h>
-#include <camel/camel-stream-fs.h>
-#include <camel/camel-stream-mem.h>
-
-CamelMimeMessage *
-test_message_create_simple(void)
-{
- CamelMimeMessage *msg;
- CamelInternetAddress *addr;
-
- msg = camel_mime_message_new();
-
- addr = camel_internet_address_new();
- camel_internet_address_add(addr, "Michael Zucchi", "zed@nowhere.com");
- camel_mime_message_set_from(msg, addr);
- camel_address_remove((CamelAddress *)addr, -1);
- camel_internet_address_add(addr, "POSTMASTER", "POSTMASTER@somewhere.net");
- camel_mime_message_set_recipients(msg, CAMEL_RECIPIENT_TYPE_TO, addr);
- camel_address_remove((CamelAddress *)addr, -1);
- camel_internet_address_add(addr, "Michael Zucchi", "zed@nowhere.com");
- camel_mime_message_set_recipients(msg, CAMEL_RECIPIENT_TYPE_CC, addr);
-
- check_unref(addr, 1);
-
- camel_mime_message_set_subject(msg, "Simple message subject");
- camel_mime_message_set_date(msg, time(0), 930);
-
- return msg;
-}
-
-static void
-content_finalise(CamelObject *folder, void *crap, void *ba)
-{
- g_byte_array_free(ba, TRUE);
-}
-
-void
-test_message_set_content_simple(CamelMimePart *part, int how, const char *type, const char *text, int len)
-{
- CamelStreamMem *content = NULL;
- CamelDataWrapper *dw;
- static GByteArray *ba;
-
- switch (how) {
- case 0:
- camel_mime_part_set_content(part, text, len, type);
- break;
- case 1:
- content = (CamelStreamMem *)camel_stream_mem_new_with_buffer(text, len);
- break;
- case 2:
- content = (CamelStreamMem *)camel_stream_mem_new();
- camel_stream_mem_set_buffer(content, text, len);
- break;
- case 3:
- ba = g_byte_array_new();
- g_byte_array_append(ba, text, len);
-
- content = (CamelStreamMem *)camel_stream_mem_new_with_byte_array(ba);
- ba = NULL;
- break;
- case 4:
- ba = g_byte_array_new();
- g_byte_array_append(ba, text, len);
-
- content = (CamelStreamMem *)camel_stream_mem_new();
- camel_stream_mem_set_byte_array(content, ba);
-
- camel_object_hook_event((CamelObject *)content, "finalize", content_finalise, ba);
- break;
- }
-
- if (content != 0) {
- dw = camel_data_wrapper_new();
- camel_data_wrapper_set_mime_type (dw, type);
-
- camel_data_wrapper_construct_from_stream(dw, (CamelStream *)content);
- camel_medium_set_content_object((CamelMedium *)part, dw);
-
- check_unref(content, 2);
- check_unref(dw, 2);
- }
-}
-
-int
-test_message_write_file(CamelMimeMessage *msg, const char *name)
-{
- CamelStreamFs *file;
- int ret;
-
- file = (CamelStreamFs *)camel_stream_fs_new_with_name(name, O_CREAT|O_WRONLY, 0600);
- camel_data_wrapper_write_to_stream((CamelDataWrapper *)msg, (CamelStream *)file);
- ret = camel_stream_close((CamelStream *)file);
-
- check(((CamelObject *)file)->ref_count == 1);
- camel_object_unref((CamelObject *)file);
-
- return ret;
-}
-
-CamelMimeMessage *
-test_message_read_file(const char *name)
-{
- CamelStreamFs *file;
- CamelMimeMessage *msg2;
-
- file = (CamelStreamFs *)camel_stream_fs_new_with_name(name, O_RDONLY, 0);
- msg2 = camel_mime_message_new();
-
- camel_data_wrapper_construct_from_stream((CamelDataWrapper *)msg2, (CamelStream *)file);
- /* file's refcount may be > 1 if the message is real big */
- check(CAMEL_OBJECT(file)->ref_count >=1);
- camel_object_unref((CamelObject *)file);
-
- return msg2;
-}
-
-static void
-hexdump (const unsigned char *in, int inlen)
-{
- const unsigned char *inptr = in, *start = inptr;
- const unsigned char *inend = in + inlen;
- int octets;
-
- while (inptr < inend) {
- octets = 0;
- while (inptr < inend && octets < 16) {
- printf ("%.2X ", *inptr++);
- octets++;
- }
-
- while (octets < 16) {
- printf (" ");
- octets++;
- }
-
- printf (" ");
-
- while (start < inptr) {
- fputc (isprint ((int) *start) ? *start : '.', stdout);
- start++;
- }
-
- fputc ('\n', stdout);
- }
-}
-
-int
-test_message_compare_content(CamelDataWrapper *dw, const char *text, int len)
-{
- CamelStreamMem *content;
-
- /* sigh, ok, so i len == 0, dw will probably be 0 too
- camel_mime_part_set_content is weird like that */
- if (dw == 0 && len == 0)
- return 0;
-
- content = (CamelStreamMem *)camel_stream_mem_new();
- camel_data_wrapper_decode_to_stream(dw, (CamelStream *)content);
-
- if (content->buffer->len != len) {
- printf ("original text:\n");
- hexdump (text, len);
-
- printf ("new text:\n");
- hexdump (content->buffer->data, content->buffer->len);
- }
-
- check_msg(content->buffer->len == len, "buffer->len = %d, len = %d", content->buffer->len, len);
- check_msg(memcmp(content->buffer->data, text, content->buffer->len) == 0, "len = %d", len);
-
- check_unref(content, 1);
-
- return 0;
-}
-
-int
-test_message_compare (CamelMimeMessage *msg)
-{
- CamelMimeMessage *msg2;
- CamelStreamMem *mem1, *mem2;
-
- mem1 = (CamelStreamMem *) camel_stream_mem_new ();
- check_msg(camel_data_wrapper_write_to_stream ((CamelDataWrapper *) msg, (CamelStream *) mem1) != -1, "write_to_stream 1 failed");
- camel_stream_reset ((CamelStream *) mem1);
-
- msg2 = camel_mime_message_new ();
- check_msg(camel_data_wrapper_construct_from_stream ((CamelDataWrapper *) msg2, (CamelStream *) mem1) != -1, "construct_from_stream 1 failed");
- camel_stream_reset ((CamelStream *) mem1);
-
- mem2 = (CamelStreamMem *) camel_stream_mem_new ();
- check_msg(camel_data_wrapper_write_to_stream ((CamelDataWrapper *) msg2, (CamelStream *) mem2) != -1, "write_to_stream 2 failed");
- camel_stream_reset ((CamelStream *) mem2);
-
- if (mem1->buffer->len != mem2->buffer->len) {
- CamelDataWrapper *content;
-
- printf ("mem1 stream:\n%.*s\n", mem1->buffer->len, mem1->buffer->data);
- printf ("mem2 stream:\n%.*s\n\n", mem2->buffer->len, mem2->buffer->data);
-
- printf("msg1:\n");
- test_message_dump_structure(msg);
- printf("msg2:\n");
- test_message_dump_structure(msg2);
-
- content = camel_medium_get_content_object ((CamelMedium *) msg);
- }
-
- check_unref(msg2, 1);
-
- check_msg (mem1->buffer->len == mem2->buffer->len,
- "mem1->buffer->len = %d, mem2->buffer->len = %d",
- mem1->buffer->len, mem2->buffer->len);
-
- check_msg (memcmp (mem1->buffer->data, mem2->buffer->data, mem1->buffer->len) == 0, "msg/stream compare");
-
- camel_object_unref (mem1);
- camel_object_unref (mem2);
-
- return 0;
-}
-
-int
-test_message_compare_header(CamelMimeMessage *m1, CamelMimeMessage *m2)
-{
- return 0;
-}
-
-int
-test_message_compare_messages(CamelMimeMessage *m1, CamelMimeMessage *m2)
-{
- return 0;
-}
-
-static void
-message_dump_rec(CamelMimeMessage *msg, CamelMimePart *part, int depth)
-{
- CamelDataWrapper *containee;
- int parts, i;
- char *s;
- char *mime_type;
-
- s = alloca(depth+1);
- memset(s, ' ', depth);
- s[depth] = 0;
-
- mime_type = camel_data_wrapper_get_mime_type((CamelDataWrapper *)part);
- printf("%sPart <%s>\n", s, ((CamelObject *)part)->klass->name);
- printf("%sContent-Type: %s\n", s, mime_type);
- g_free(mime_type);
- printf("%s encoding: %s\n", s, camel_transfer_encoding_to_string(((CamelDataWrapper *)part)->encoding));
- printf("%s part encoding: %s\n", s, camel_transfer_encoding_to_string(part->encoding));
-
- containee = camel_medium_get_content_object (CAMEL_MEDIUM (part));
-
- if (containee == NULL)
- return;
-
- mime_type = camel_data_wrapper_get_mime_type(containee);
- printf("%sContent <%s>\n", s, ((CamelObject *)containee)->klass->name);
- printf ("%sContent-Type: %s\n", s, mime_type);
- g_free (mime_type);
- printf("%s encoding: %s\n", s, camel_transfer_encoding_to_string(((CamelDataWrapper *)containee)->encoding));
-
- /* using the object types is more accurate than using the mime/types */
- if (CAMEL_IS_MULTIPART (containee)) {
- parts = camel_multipart_get_number (CAMEL_MULTIPART (containee));
- for (i = 0; i < parts; i++) {
- CamelMimePart *part = camel_multipart_get_part (CAMEL_MULTIPART (containee), i);
-
- message_dump_rec(msg, part, depth+1);
- }
- } else if (CAMEL_IS_MIME_MESSAGE (containee)) {
- message_dump_rec(msg, (CamelMimePart *)containee, depth+1);
- }
-}
-
-void
-test_message_dump_structure(CamelMimeMessage *m)
-{
- message_dump_rec(m, (CamelMimePart *)m, 0);
-}
diff --git a/camel/tests/lib/messages.h b/camel/tests/lib/messages.h
deleted file mode 100644
index 1f892c3cc8..0000000000
--- a/camel/tests/lib/messages.h
+++ /dev/null
@@ -1,15 +0,0 @@
-
-#include <camel/camel-mime-message.h>
-
-/* how many ways to set the content contents */
-#define SET_CONTENT_WAYS (5)
-
-/* messages.c */
-CamelMimeMessage *test_message_create_simple(void);
-void test_message_set_content_simple(CamelMimePart *part, int how, const char *type, const char *text, int len);
-int test_message_write_file(CamelMimeMessage *msg, const char *name);
-CamelMimeMessage *test_message_read_file(const char *name);
-int test_message_compare_content(CamelDataWrapper *dw, const char *text, int len);
-int test_message_compare (CamelMimeMessage *msg);
-
-void test_message_dump_structure(CamelMimeMessage *m);
diff --git a/camel/tests/lib/session.c b/camel/tests/lib/session.c
deleted file mode 100644
index bf23fbe377..0000000000
--- a/camel/tests/lib/session.c
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "session.h"
-
-static void
-class_init (CamelTestSessionClass *camel_test_session_class)
-{
- CamelSessionClass *camel_session_class =
- CAMEL_SESSION_CLASS (camel_test_session_class);
-}
-
-CamelType
-camel_test_session_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (
- camel_session_get_type (),
- "CamelTestSession",
- sizeof (CamelTestSession),
- sizeof (CamelTestSessionClass),
- (CamelObjectClassInitFunc) class_init,
- NULL,
- NULL,
- NULL);
- }
-
- return type;
-}
-
-CamelSession *
-camel_test_session_new (const char *path)
-{
- CamelSession *session;
-
- session = CAMEL_SESSION (camel_object_new (CAMEL_TEST_SESSION_TYPE));
-
- camel_session_construct (session, path);
-
- return session;
-}
diff --git a/camel/tests/lib/session.h b/camel/tests/lib/session.h
deleted file mode 100644
index e69ef65e2e..0000000000
--- a/camel/tests/lib/session.h
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <camel/camel-session.h>
-
-#define CAMEL_TEST_SESSION_TYPE (camel_test_session_get_type ())
-#define CAMEL_TEST_SESSION(obj) (CAMEL_CHECK_CAST((obj), CAMEL_TEST_SESSION_TYPE, CamelTestSession))
-#define CAMEL_TEST_SESSION_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_TEST_SESSION_TYPE, CamelTestSessionClass))
-#define CAMEL_TEST_IS_SESSION(o) (CAMEL_CHECK_TYPE((o), CAMEL_TEST_SESSION_TYPE))
-
-typedef struct _CamelTestSession {
- CamelSession parent_object;
-
-} CamelTestSession;
-
-typedef struct _CamelTestSessionClass {
- CamelSessionClass parent_class;
-
-} CamelTestSessionClass;
-
-CamelType camel_test_session_get_type (void);
-CamelSession *camel_test_session_new (const char *path);
diff --git a/camel/tests/lib/streams.c b/camel/tests/lib/streams.c
deleted file mode 100644
index e4dc006363..0000000000
--- a/camel/tests/lib/streams.c
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
- stream tests
-
- todo: do we need a seek test that seeks beyond the eos, writes,
- then reads and checks for 0's in the space?
-*/
-
-#include <string.h>
-
-#include "camel/camel-stream.h"
-#include "camel/camel-seekable-stream.h"
-#include "camel/camel-seekable-substream.h"
-
-#include "streams.h"
-
-#include "camel-test.h"
-
-static char teststring[] = "\xaa\x55\xc0\x0c\xff\x00";
-static char testbuf[10240];
-
-/* pass in an empty read/write stream */
-void
-test_stream_seekable_writepart(CamelSeekableStream *s)
-{
- off_t end;
- int i;
-
- push("seekable stream test, writing ");
-
- check(camel_seekable_stream_tell(s) == 0);
- check(camel_seekable_stream_seek(s, 0, CAMEL_STREAM_SET) == 0);
- check(camel_seekable_stream_tell(s) == 0);
-
- check(camel_stream_write(CAMEL_STREAM(s), "", 0) == 0);
- check(camel_seekable_stream_tell(s) == 0);
- check(camel_stream_write(CAMEL_STREAM(s), "\n", 1) == 1);
- check(camel_seekable_stream_tell(s) == 1);
-
- for (i=0;i<10240;i++) {
- check(camel_stream_write(CAMEL_STREAM(s), teststring, sizeof(teststring)) == sizeof(teststring));
- check(camel_seekable_stream_tell(s) == 1 + (i+1)*sizeof(teststring));
- }
- end = 10240*sizeof(teststring)+1;
-
- check_msg(camel_seekable_stream_seek(s, 0, CAMEL_STREAM_END) == end, "seek =%d end = %d",
- camel_seekable_stream_seek(s, 0, CAMEL_STREAM_END), end);
-
- check(camel_seekable_stream_seek(s, 0, CAMEL_STREAM_END) == end);
- check(camel_seekable_stream_tell(s) == end);
- /* need to read 0 first to set eos */
- check(camel_stream_read(CAMEL_STREAM(s), testbuf, 10240) == 0);
- check(camel_stream_eos(CAMEL_STREAM(s)));
-
- pull();
-}
-
-void
-test_stream_seekable_readpart(CamelSeekableStream *s)
-{
- off_t off, new, end;
- int i, j;
-
- push("seekable stream test, re-reading");
-
- end = 10240*sizeof(teststring)+1;
-
- check(camel_seekable_stream_seek(s, 0, CAMEL_STREAM_SET) == 0);
- check(camel_seekable_stream_tell(s) == 0);
- check(!camel_stream_eos(CAMEL_STREAM(s)));
-
- off = 0;
- for (i=0;i<1024;i++) {
-
- new = i*3;
-
- /* exercise all seek methods */
- switch(i % 3) {
- case 0:
- check(camel_seekable_stream_seek(s, new, CAMEL_STREAM_SET) == new);
- break;
- case 1:
- check(camel_seekable_stream_seek(s, new-off, CAMEL_STREAM_CUR) == new);
- break;
- case 2:
- check(camel_seekable_stream_seek(s, new-end, CAMEL_STREAM_END) == new);
- break;
- }
- check(camel_seekable_stream_tell(s) == new);
-
- check(camel_stream_read(CAMEL_STREAM(s), testbuf, i*3) == i*3);
- for (j=0;j<i*3;j++) {
- int k = new + j;
-
- if (k==0) {
- check(testbuf[j] == '\n');
- } else {
- check(testbuf[j] == teststring[(k-1) % sizeof(teststring)]);
- }
- }
- off = new+i*3;
- }
-
- /* verify end-of-file behaviour */
- check(camel_seekable_stream_seek(s, -1, CAMEL_STREAM_END) == end-1);
- check(camel_seekable_stream_tell(s) == end-1);
-
- check(camel_stream_read(CAMEL_STREAM(s), testbuf, 10240) == 1);
- check(testbuf[0] == teststring[sizeof(teststring)-1]);
-
- check(camel_stream_read(CAMEL_STREAM(s), testbuf, 10240) == 0);
- check(camel_seekable_stream_seek(s, 0, CAMEL_STREAM_CUR) == end);
- check(camel_seekable_stream_tell(s) == end);
- check(camel_stream_eos(CAMEL_STREAM(s)));
-
- pull();
-}
-
-/*
- 0 = write to the substream
- 1 = write to the parent stream at the right spot
-*/
-void
-test_seekable_substream_writepart(CamelStream *s, int type)
-{
- CamelSeekableStream *ss = (CamelSeekableStream *)s;
- CamelSeekableSubstream *sus = (CamelSeekableSubstream *)s;
- CamelSeekableStream *sp = sus->parent_stream;
- int i, len;
- off_t end;
-
- push("writing substream, type %d", type);
-
- if (type == 1) {
- check(camel_seekable_stream_seek(sp, ss->bound_start, CAMEL_STREAM_SET) == ss->bound_start);
- s = (CamelStream *)sp;
- } else {
- check(camel_seekable_stream_tell(ss) == ss->bound_start);
- check(camel_seekable_stream_seek(ss, 0, CAMEL_STREAM_SET) == ss->bound_start);
- }
-
- check(camel_seekable_stream_tell(CAMEL_SEEKABLE_STREAM(s)) == ss->bound_start);
-
- check(camel_stream_write(s, "", 0) == 0);
- check(camel_seekable_stream_tell(CAMEL_SEEKABLE_STREAM(s)) == ss->bound_start);
-
- /* fill up the bounds with writes */
- if (ss->bound_end != CAMEL_STREAM_UNBOUND) {
- for (i=0;i<(ss->bound_end-ss->bound_start)/sizeof(teststring);i++) {
- check(camel_stream_write(s, teststring, sizeof(teststring)) == sizeof(teststring));
- check(camel_seekable_stream_tell(CAMEL_SEEKABLE_STREAM(s)) == ss->bound_start + (i+1)*sizeof(teststring));
- }
- len = (ss->bound_end-ss->bound_start) % sizeof(teststring);
- check(camel_stream_write(s, teststring, len) == len);
- check(camel_seekable_stream_tell(CAMEL_SEEKABLE_STREAM(s)) == ss->bound_end);
- if (type == 0) {
- check(camel_stream_write(s, teststring, sizeof(teststring)) == 0);
- check(camel_stream_eos(s));
- check(camel_seekable_stream_tell(CAMEL_SEEKABLE_STREAM(s)) == ss->bound_end);
- }
- } else {
- /* just 10K */
- for (i=0;i<10240;i++) {
- check(camel_stream_write(CAMEL_STREAM(s), teststring, sizeof(teststring)) == sizeof(teststring));
- check(camel_seekable_stream_tell(CAMEL_SEEKABLE_STREAM(s)) == ss->bound_start + (i+1)*sizeof(teststring));
- }
-
- /* we can't really verify any end length here */
- }
-
- pull();
-}
-
-void
-test_seekable_substream_readpart(CamelStream *s)
-{
- CamelSeekableStream *ss = (CamelSeekableStream *)s;
- CamelSeekableSubstream *sus = (CamelSeekableSubstream *)s;
- CamelSeekableStream *sp = sus->parent_stream;
- int i, len;
- off_t end;
-
- push("reading substream");
-
- check(camel_seekable_stream_seek(ss, 0, CAMEL_STREAM_SET) == ss->bound_start);
- check(camel_seekable_stream_tell(ss) == ss->bound_start);
-
- check(camel_seekable_stream_seek(sp, ss->bound_start, CAMEL_STREAM_SET) == ss->bound_start);
- check(camel_seekable_stream_tell(sp) == ss->bound_start);
-
- /* check writes, cross check with parent stream */
- if (ss->bound_end != CAMEL_STREAM_UNBOUND) {
- for (i=0;i<(ss->bound_end-ss->bound_start)/sizeof(teststring);i++) {
- check(camel_stream_read(s, testbuf, sizeof(teststring)) == sizeof(teststring));
- check(memcmp(testbuf, teststring, sizeof(teststring)) == 0);
- check(camel_seekable_stream_tell(ss) == ss->bound_start + (i+1)*sizeof(teststring));
-
- /* yeah great, the substreams affect the seek ... */
- check(camel_seekable_stream_seek(sp, ss->bound_start + (i)*sizeof(teststring), CAMEL_STREAM_SET) == ss->bound_start + i*sizeof(teststring));
- check(camel_stream_read(CAMEL_STREAM(sp), testbuf, sizeof(teststring)) == sizeof(teststring));
- check(memcmp(testbuf, teststring, sizeof(teststring)) == 0);
- check(camel_seekable_stream_tell(sp) == ss->bound_start + (i+1)*sizeof(teststring));
- }
- len = (ss->bound_end-ss->bound_start) % sizeof(teststring);
- check(camel_stream_read(s, testbuf, len) == len);
- check(memcmp(testbuf, teststring, len) == 0);
-
- check(camel_seekable_stream_seek(sp, ss->bound_end - len, CAMEL_STREAM_SET) == ss->bound_end - len);
- check(camel_stream_read(CAMEL_STREAM(sp), testbuf, len) == len);
- check(memcmp(testbuf, teststring, len) == 0);
-
- check(camel_stream_eos(s));
- check(camel_seekable_stream_tell(ss) == ss->bound_end);
- check(camel_seekable_stream_tell(sp) == ss->bound_end);
- check(camel_stream_read(s, testbuf, 1024) == 0);
- check(camel_seekable_stream_tell(ss) == ss->bound_end);
- check(camel_seekable_stream_tell(sp) == ss->bound_end);
- check(camel_stream_eos(s));
- } else {
- /* just 10K */
- for (i=0;i<10240;i++) {
- check(camel_stream_read(s, testbuf, sizeof(teststring)) == sizeof(teststring));
- check(memcmp(testbuf, teststring, sizeof(teststring)) == 0);
- check(camel_seekable_stream_tell(ss) == ss->bound_start + (i+1)*sizeof(teststring));
-
- check(camel_seekable_stream_seek(sp, ss->bound_start + (i)*sizeof(teststring), CAMEL_STREAM_SET) == ss->bound_start + i*sizeof(teststring));
- check(camel_stream_read(CAMEL_STREAM(sp), testbuf, sizeof(teststring)) == sizeof(teststring));
- check(memcmp(testbuf, teststring, sizeof(teststring)) == 0);
- check(camel_seekable_stream_tell(sp) == ss->bound_start + (i+1)*sizeof(teststring));
- }
-
- /* unbound - we dont know the real length */
-#if 0
- end = 10240*sizeof(teststring)+ss->bound_start;
-
- check(camel_seekable_stream_seek(ss, 0, CAMEL_STREAM_END) == end);
- check(camel_seekable_stream_tell(ss) == end);
- /* need to read 0 first to set eos */
- check(camel_stream_read(s, testbuf, 10240) == 0);
- check(camel_stream_eos(s));
-#endif
- }
-
- pull();
-}
diff --git a/camel/tests/lib/streams.h b/camel/tests/lib/streams.h
deleted file mode 100644
index df52e283d0..0000000000
--- a/camel/tests/lib/streams.h
+++ /dev/null
@@ -1,12 +0,0 @@
-
-#include "camel/camel-seekable-stream.h"
-
-/* call one, then the other on the same stream content */
-void test_stream_seekable_writepart(CamelSeekableStream *s);
-void test_stream_seekable_readpart(CamelSeekableStream *s);
-
-/* same, for substreams, multiple ways of writing */
-#define SEEKABLE_SUBSTREAM_WAYS (2)
-
-void test_seekable_substream_writepart(CamelStream *s, int type);
-void test_seekable_substream_readpart(CamelStream *s);
diff --git a/camel/tests/message/.cvsignore b/camel/tests/message/.cvsignore
deleted file mode 100644
index 4f58c83bd0..0000000000
--- a/camel/tests/message/.cvsignore
+++ /dev/null
@@ -1,15 +0,0 @@
-.deps
-Makefile
-Makefile.in
-.libs
-.deps
-*.lo
-*.la
-test1
-test2
-test3
-*.msg
-*.bb
-*.bbg
-*.da
-*.gcov
diff --git a/camel/tests/message/Makefile.am b/camel/tests/message/Makefile.am
deleted file mode 100644
index 32b4294aa2..0000000000
--- a/camel/tests/message/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-
-INCLUDES = \
- -I$(includedir) \
- -I$(top_srcdir) \
- -I$(top_srcdir)/intl \
- -I$(top_srcdir)/e-util \
- -I$(top_srcdir)/camel \
- -I$(top_srcdir)/camel/tests/lib \
- -DG_LOG_DOMAIN=\"evolution-tests\" \
- $(CAMEL_CFLAGS)
-
-LDADD = \
- $(top_builddir)/camel/libcamel.la \
- $(top_builddir)/e-util/libeutil.la \
- $(top_builddir)/camel/tests/lib/libcameltest.a \
- $(INTLLIBS) \
- $(EVOLUTION_MAIL_LIBS)
-
-check_PROGRAMS = \
- test1 \
- test2 \
- test3 \
- test4
-
-TESTS = test1 test2 test3 test4
diff --git a/camel/tests/message/README b/camel/tests/message/README
deleted file mode 100644
index 4b3c953a63..0000000000
--- a/camel/tests/message/README
+++ /dev/null
@@ -1,9 +0,0 @@
-
-test1 creating, saving, loading simple messages
-test2 camelinternetaddress tests, internationalised addresses, etc.
-test3 multipart messages
-test4 more encompassing mime parser tests that test real-world messages.
- Note: In order to test this, though, you'll need to fetch
- http://primates.ximian.com/~fejj/camel-mime-tests.tar.gz and
- untar it into camel/tests/data/
-
diff --git a/camel/tests/message/test1.c b/camel/tests/message/test1.c
deleted file mode 100644
index 8dcf84c92c..0000000000
--- a/camel/tests/message/test1.c
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- test1.c
-
- Create a message, save it.
-
- Retrieve message, compare content.
-
-
- Operations:
- writing/loading from different types of streams
- reading/writing different content
- reading/writing different encodings
- reading/writing different charsets
-
- Just testing streams:
- different stream types
- different file ops
- seek, eof, etc.
-*/
-
-#include "camel-test.h"
-#include "messages.h"
-
-/* for stat */
-#include <sys/stat.h>
-#include <unistd.h>
-#include <string.h>
-
-#include <camel/camel-mime-message.h>
-#include <camel/camel-stream-fs.h>
-#include <camel/camel-stream-mem.h>
-
-struct _text {
- char *text;
- int len;
-};
-
-#define MAX_TEXTS (14)
-struct _text texts[MAX_TEXTS];
-
-static void
-setup(void)
-{
- int i, j;
- char *p;
-
- /* setup various edge and other general cases */
- texts[0].text = "";
- texts[0].len = 0;
- texts[1].text = "";
- texts[1].len = 1;
- texts[2].text = "\n";
- texts[2].len = 1;
- texts[3].text = "A";
- texts[3].len = 1;
- texts[4].text = "This is a test.\n.";
- texts[4].len = strlen(texts[4].text);
- texts[5].text = "This is a test.\n\n.\n";
- texts[5].len = strlen(texts[5].text);
- texts[6].text = g_malloc0(1024);
- texts[6].len = 1024;
- texts[7].text = g_malloc0(102400);
- texts[7].len = 102400;
- texts[8].text = g_malloc(1024);
- memset(texts[8].text, '\n', 1024);
- texts[8].len = 1024;
- texts[9].text = g_malloc(102400);
- memset(texts[9].text, '\n', 102400);
- texts[9].len = 102400;
- texts[10].text = g_malloc(1024);
- memset(texts[10].text, ' ', 1024);
- texts[10].len = 1024;
- texts[11].text = g_malloc(102400);
- memset(texts[11].text, ' ', 102400);
- texts[11].len = 102400;
-
- srand(42);
- p = texts[12].text = g_malloc(1024);
- for (i=0;i<1024;i++) {
- j = rand();
- if (j<RAND_MAX/120)
- *p++ = '\n';
- else
- *p++ = (j % 95) + 32;
- }
- texts[12].len = 1024;
- p = texts[13].text = g_malloc(102400);
- for (i=0;i<102400;i++) {
- j = rand();
- if (j<RAND_MAX/120)
- *p++ = '\n';
- else
- *p++ = (j % 95) + 32;
- }
- texts[13].len = 102400;
-}
-
-static void cleanup(void)
-{
- int i;
-
- for (i=6;i<14;i++) {
- g_free(texts[i].text);
- }
-}
-
-int main(int argc, char **argv)
-{
- CamelMimeMessage *msg, *msg2;
- int i, j;
- char *text;
- int len;
-
- camel_test_init(argc, argv);
-
- setup();
-
- camel_test_start("Simple memory-based content creation");
-
- /* test all ways of setting simple content for a message (i.e. memory based) */
- for (j=0;j<MAX_TEXTS;j++) {
- push("testing text number %d", j);
- text = texts[j].text;
- len = texts[j].len;
- for (i=0;i<SET_CONTENT_WAYS;i++) {
- push("create simple message %d", i);
- msg = test_message_create_simple();
-
- push("set simple content");
- test_message_set_content_simple((CamelMimePart *)msg, i, "text/plain", text, len);
- pull();
-
- push("compare original content");
- test_message_compare_content(camel_medium_get_content_object((CamelMedium *)msg), text, len);
- pull();
-
- push("save message to test1.msg");
- unlink("test1.msg");
- test_message_write_file(msg, "test1.msg");
- check_unref(msg, 1);
- pull();
-
- push("read from test1.msg");
- msg2 = test_message_read_file("test1.msg");
- pull();
-
- push("compare read with original content");
- test_message_compare_content(camel_medium_get_content_object((CamelMedium *)msg2), text, len);
- check_unref(msg2, 1);
- pull();
-
- unlink("test1.msg");
- pull();
- }
- pull();
- }
-
- camel_test_end();
-
- camel_test_start("Different encodings");
- for (j=0;j<MAX_TEXTS;j++) {
- push("testing text number %d", j);
- text = texts[j].text;
- len = texts[j].len;
- for (i=0;i<CAMEL_TRANSFER_NUM_ENCODINGS;i++) {
-
- push("test simple message, encoding %s", camel_transfer_encoding_to_string(i));
- msg = test_message_create_simple();
-
- push("set simple content");
- test_message_set_content_simple((CamelMimePart *)msg, 0, "text/plain", text, len);
- pull();
-
- camel_mime_part_set_encoding((CamelMimePart *)msg, i);
-
- push("save message to test1.msg");
- unlink("test1.msg");
- test_message_write_file(msg, "test1.msg");
- check_unref(msg, 1);
- pull();
-
- push("read from test1.msg");
- msg2 = test_message_read_file("test1.msg");
- pull();
-
- push("compare read with original content");
- test_message_compare_content(camel_medium_get_content_object((CamelMedium *)msg2), text, len);
- check_unref(msg2, 1);
- pull();
-
- unlink("test1.msg");
- pull();
- }
- pull();
- }
- camel_test_end();
-
- cleanup();
-
- return 0;
-}
diff --git a/camel/tests/message/test2.c b/camel/tests/message/test2.c
deleted file mode 100644
index 95b0e324aa..0000000000
--- a/camel/tests/message/test2.c
+++ /dev/null
@@ -1,326 +0,0 @@
-#include "camel-test.h"
-#include "messages.h"
-#include "addresses.h"
-
-/* for stat */
-#include <sys/stat.h>
-#include <unistd.h>
-#include <string.h>
-#include <stdio.h>
-#include <iconv.h>
-
-#include <camel/camel-internet-address.h>
-#include <camel/camel-address.h>
-
-#include "address-data.h"
-
-static char *convert(const char *in, const char *from, const char *to)
-{
- iconv_t ic = iconv_open(to, from);
- char *out, *outp;
- const char *inp;
- int inlen, outlen;
-
- if (ic == (iconv_t)-1)
- return g_strdup(in);
-
- inlen = strlen(in);
- outlen = inlen*5 + 16;
-
- outp = out = g_malloc(outlen);
- inp = in;
-
- if (iconv(ic, &inp, &inlen, &outp, &outlen) == -1) {
- test_free(out);
- iconv_close(ic);
- return g_strdup(in);
- }
-
- if (iconv(ic, NULL, 0, &outp, &outlen) == -1) {
- test_free(out);
- iconv_close(ic);
- return g_strdup(in);
- }
-
- iconv_close(ic);
-
- *outp = 0;
-
-#if 0
- /* lets see if we can convert back again? */
- {
- char *nout, *noutp;
- iconv_t ic = iconv_open(from, to);
-
- inp = out;
- inlen = strlen(out);
- outlen = inlen*5 + 16;
- noutp = nout = g_malloc(outlen);
- if (iconv(ic, &inp, &inlen, &noutp, &outlen) == -1
- || iconv(ic, NULL, 0, &noutp, &outlen) == -1) {
- g_warning("Cannot convert '%s' \n from %s to %s: %s\n", in, to, from, strerror(errno));
- }
- iconv_close(ic);
- }
-
- /* and lets see what camel thinks out optimal charset is */
- {
- printf("Camel thinks the best encoding of '%s' is %s, although we converted from %s\n",
- in, camel_charset_best(out, strlen(out)), from);
- }
-#endif
-
- return out;
-}
-
-#define to_utf8(in, type) convert(in, type, "utf-8")
-#define from_utf8(in, type) convert(in, "utf-8", type)
-
-#define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))
-
-int main(int argc, char **argv)
-{
- int i;
- CamelInternetAddress *addr, *addr2;
- char *name;
- char *charset;
- const char *real, *where;
- char *enc, *enc2, *format, *format2;
-
- camel_test_init(argc, argv);
-
- camel_test_start("CamelInternetAddress, basics");
-
- addr = camel_internet_address_new();
-
- push("Test blank address");
- check(camel_address_length(CAMEL_ADDRESS(addr)) == 0);
- check(camel_internet_address_get(addr, 0, &real, &where) == FALSE);
- pull();
-
- push("Test blank clone");
- addr2 = CAMEL_INTERNET_ADDRESS(camel_address_new_clone(CAMEL_ADDRESS(addr)));
- test_address_compare(addr, addr2);
- check_unref(addr2, 1);
- pull();
-
- push("Test add 1");
- camel_internet_address_add(addr, "Zed", "nowhere@here.com.au");
- check(camel_address_length(CAMEL_ADDRESS(addr)) == 1);
- check(camel_internet_address_get(addr, 0, &real, &where) == TRUE);
- check_msg(string_equal("Zed", real), "real = '%s'", real);
- check(strcmp(where, "nowhere@here.com.au") == 0);
- pull();
-
- push("Test clone 1");
- addr2 = CAMEL_INTERNET_ADDRESS(camel_address_new_clone(CAMEL_ADDRESS(addr)));
- test_address_compare(addr, addr2);
- check_unref(addr2, 1);
- pull();
-
- push("Test add many");
- for (i=1;i<10;i++) {
- char name[16], a[32];
- sprintf(name, "Zed %d", i);
- sprintf(a, "nowhere@here-%d.com.au", i);
- camel_internet_address_add(addr, name, a);
- check(camel_address_length(CAMEL_ADDRESS(addr)) == i+1);
- check(camel_internet_address_get(addr, i, &real, &where) == TRUE);
- check_msg(string_equal(name, real), "name = '%s' real = '%s'", name, real);
- check(strcmp(where, a) == 0);
- }
- pull();
-
- /* put a few of these in to make it look like its doing something impressive ... :) */
- camel_test_end();
- camel_test_start("CamelInternetAddress, search");
-
- push("Test search");
- camel_test_nonfatal("Address comparisons should ignore whitespace??");
- check(camel_internet_address_find_name(addr, "Zed 1", &where) == 1);
- check(camel_internet_address_find_name(addr, "Zed 9", &where) == 9);
- check(camel_internet_address_find_name(addr, "Zed", &where) == 0);
- check(camel_internet_address_find_name(addr, " Zed", &where) == 0);
- check(camel_internet_address_find_name(addr, "Zed ", &where) == 0);
- check(camel_internet_address_find_name(addr, " Zed ", &where) == 0);
- check(camel_internet_address_find_name(addr, "Zed 20", &where) == -1);
- check(camel_internet_address_find_name(addr, "", &where) == -1);
- /* interface dont handle nulls :) */
- /*check(camel_internet_address_find_name(addr, NULL, &where) == -1);*/
-
- check(camel_internet_address_find_address(addr, "nowhere@here-1.com.au", &where) == 1);
- check(camel_internet_address_find_address(addr, "nowhere@here-1 . com.au", &where) == 1);
- check(camel_internet_address_find_address(addr, "nowhere@here-2 .com.au ", &where) == 2);
- check(camel_internet_address_find_address(addr, " nowhere @here-3.com.au", &where) == 3);
- check(camel_internet_address_find_address(addr, "nowhere@here-20.com.au ", &where) == -1);
- check(camel_internet_address_find_address(addr, "", &where) == -1);
- /*check(camel_internet_address_find_address(addr, NULL, &where) == -1);*/
- camel_test_fatal();
- pull();
-
- camel_test_end();
- camel_test_start("CamelInternetAddress, copy/cat/clone");
-
- push("Test clone many");
- addr2 = CAMEL_INTERNET_ADDRESS(camel_address_new_clone(CAMEL_ADDRESS(addr)));
- test_address_compare(addr, addr2);
- pull();
-
- push("Test remove items");
- camel_address_remove(CAMEL_ADDRESS(addr2), 0);
- check(camel_address_length(CAMEL_ADDRESS(addr2)) == 9);
- camel_address_remove(CAMEL_ADDRESS(addr2), 0);
- check(camel_address_length(CAMEL_ADDRESS(addr2)) == 8);
- camel_address_remove(CAMEL_ADDRESS(addr2), 5);
- check(camel_address_length(CAMEL_ADDRESS(addr2)) == 7);
- camel_address_remove(CAMEL_ADDRESS(addr2), 10);
- check(camel_address_length(CAMEL_ADDRESS(addr2)) == 7);
- camel_address_remove(CAMEL_ADDRESS(addr2), -1);
- check(camel_address_length(CAMEL_ADDRESS(addr2)) == 0);
- check_unref(addr2, 1);
- pull();
-
- push("Testing copy/cat");
- push("clone + cat");
- addr2 = CAMEL_INTERNET_ADDRESS(camel_address_new_clone(CAMEL_ADDRESS(addr)));
- camel_address_cat(CAMEL_ADDRESS(addr2), CAMEL_ADDRESS(addr));
- check(camel_address_length(CAMEL_ADDRESS(addr)) == 10);
- check(camel_address_length(CAMEL_ADDRESS(addr2)) == 20);
- check_unref(addr2, 1);
- pull();
-
- push("cat + cat + copy");
- addr2 = camel_internet_address_new();
- camel_address_cat(CAMEL_ADDRESS(addr2), CAMEL_ADDRESS(addr));
- test_address_compare(addr, addr2);
- camel_address_cat(CAMEL_ADDRESS(addr2), CAMEL_ADDRESS(addr));
- check(camel_address_length(CAMEL_ADDRESS(addr)) == 10);
- check(camel_address_length(CAMEL_ADDRESS(addr2)) == 20);
- camel_address_copy(CAMEL_ADDRESS(addr2), CAMEL_ADDRESS(addr));
- test_address_compare(addr, addr2);
- check_unref(addr2, 1);
- pull();
-
- push("copy");
- addr2 = camel_internet_address_new();
- camel_address_copy(CAMEL_ADDRESS(addr2), CAMEL_ADDRESS(addr));
- test_address_compare(addr, addr2);
- check_unref(addr2, 1);
- pull();
-
- pull();
-
- check_unref(addr, 1);
-
- camel_test_end();
-
- camel_test_start("CamelInternetAddress, I18N");
-
- for (i=0;i<ARRAY_LEN(test_lines);i++) {
- push("Testing text line %d (%s) '%s'", i, test_lines[i].type, test_lines[i].line);
-
- addr = camel_internet_address_new();
-
- /* first, convert to api format (utf-8) */
- charset = test_lines[i].type;
- name = to_utf8(test_lines[i].line, charset);
-
- push("Address setup");
- camel_internet_address_add(addr, name, "nobody@nowhere.com");
- check(camel_internet_address_get(addr, 0, &real, &where) == TRUE);
- check_msg(string_equal(name, real), "name = '%s' real = '%s'", name, real);
- check(strcmp(where, "nobody@nowhere.com") == 0);
- test_free(name);
-
- check(camel_internet_address_get(addr, 1, &real, &where) == FALSE);
- check(camel_address_length(CAMEL_ADDRESS(addr)) == 1);
- pull();
-
- push("Address encode/decode");
- enc = camel_address_encode(CAMEL_ADDRESS(addr));
-
- addr2 = camel_internet_address_new();
- check(camel_address_decode(CAMEL_ADDRESS(addr2), enc) == 1);
- check(camel_address_length(CAMEL_ADDRESS(addr2)) == 1);
-
- enc2 = camel_address_encode(CAMEL_ADDRESS(addr2));
- check_msg(string_equal(enc, enc2), "enc = '%s' enc2 = '%s'", enc, enc2);
- test_free(enc2);
-
- push("Compare addresses");
- test_address_compare(addr, addr2);
- pull();
- check_unref(addr2, 1);
- test_free(enc);
- pull();
-
- /* FIXME: format/unformat arne't guaranteed to be reversible, at least at the moment */
- camel_test_nonfatal("format/unformat not (yet) reversible for all cases");
-
- push("Address format/unformat");
- format = camel_address_format(CAMEL_ADDRESS(addr));
-
- addr2 = camel_internet_address_new();
- check(camel_address_unformat(CAMEL_ADDRESS(addr2), format) == 1);
- check(camel_address_length(CAMEL_ADDRESS(addr2)) == 1);
-
- format2 = camel_address_format(CAMEL_ADDRESS(addr2));
- check_msg(string_equal(format, format2), "format = '%s\n\tformat2 = '%s'", format, format2);
- test_free(format2);
-
- /* currently format/unformat doesn't handle ,'s and other special chars at all */
- if (camel_address_length(CAMEL_ADDRESS(addr2)) == 1) {
- push("Compare addresses");
- test_address_compare(addr, addr2);
- pull();
- }
-
- test_free(format);
- pull();
-
- camel_test_fatal();
-
- check_unref(addr2, 1);
-
- check_unref(addr, 1);
- pull();
-
- }
-
- camel_test_end();
-
- camel_test_start("CamelInternetAddress, I18N decode");
-
- for (i=0;i<ARRAY_LEN(test_address);i++) {
- push("Testing address line %d '%s'", i, test_address[i].addr);
-
- addr = camel_internet_address_new();
- push("checking decoded");
- check(camel_address_decode(CAMEL_ADDRESS(addr), test_address[i].addr) == test_address[i].count);
- format = camel_address_format(CAMEL_ADDRESS(addr));
- check(strcmp(format, test_address[i].utf8) == 0);
- test_free(format);
- pull();
-
- push("Comparing re-encoded output");
- addr2 = CAMEL_INTERNET_ADDRESS(camel_internet_address_new());
- enc = camel_address_encode(CAMEL_ADDRESS(addr));
- check_msg(camel_address_decode(CAMEL_ADDRESS(addr2), enc) == test_address[i].count, "enc = '%s'", enc);
- test_free(enc);
- test_address_compare(addr, addr2);
- check_unref(addr2, 1);
- pull();
-
- check_unref(addr, 1);
-
- pull();
- }
-
- camel_test_end();
-
- /* FIXME: Add test of decoding of broken addresses */
-
- return 0;
-}
-
-
diff --git a/camel/tests/message/test3.c b/camel/tests/message/test3.c
deleted file mode 100644
index 0a9683d146..0000000000
--- a/camel/tests/message/test3.c
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- Multipart.
-*/
-
-#include "camel-test.h"
-#include "messages.h"
-
-/* for stat */
-#include <sys/stat.h>
-#include <unistd.h>
-#include <string.h>
-
-#include <camel/camel-mime-message.h>
-#include <camel/camel-stream-fs.h>
-#include <camel/camel-stream-mem.h>
-#include "camel/camel-multipart.h"
-
-int main(int argc, char **argv)
-{
- CamelMimeMessage *msg, *msg2, *msg3;
- CamelMultipart *mp, *mp2;
- CamelMimePart *part, *part2, *part3;
-
- camel_test_init(argc, argv);
-
- camel_test_start("multipart message");
-
- push("building message");
- msg = test_message_create_simple();
- mp = camel_multipart_new();
-
- /* Hrm, this should be able to set its own boundary, no? */
- camel_multipart_set_boundary(mp, "_=,.XYZ_Kangaroo_Meat_is_!_ABADF00D");
- check(strcmp(camel_multipart_get_boundary(mp), "_=,.XYZ_Kangaroo_Meat_is_!_ABADF00D") == 0);
-
- camel_medium_set_content_object((CamelMedium *)msg, (CamelDataWrapper *)mp);
- check(camel_multipart_get_number(mp) == 0);
- check(camel_multipart_get_part(mp, 0) == NULL);
- check(camel_multipart_get_part(mp, 1) == NULL);
-
- push("adding/removing parts");
- part = camel_mime_part_new();
- test_message_set_content_simple(part, 0, "text/plain", "content part 1", strlen("content part 1"));
- camel_multipart_add_part(mp, part);
- check(CAMEL_OBJECT(part)->ref_count == 2);
- check(camel_multipart_get_number(mp) == 1);
- check(camel_multipart_get_part(mp, 0) == part);
- check(camel_multipart_get_part(mp, 1) == NULL);
-
- camel_multipart_remove_part(mp, part);
- check(CAMEL_OBJECT(part)->ref_count == 1);
- check(camel_multipart_get_number(mp) == 0);
- check(camel_multipart_get_part(mp, 0) == NULL);
- check(camel_multipart_get_part(mp, 1) == NULL);
-
- camel_multipart_add_part_at(mp, part, 0);
- check(CAMEL_OBJECT(part)->ref_count == 2);
- check(camel_multipart_get_number(mp) == 1);
- check(camel_multipart_get_part(mp, 0) == part);
- check(camel_multipart_get_part(mp, 1) == NULL);
-
- check(camel_multipart_remove_part_at(mp, 1) == NULL);
- check(CAMEL_OBJECT(part)->ref_count == 2);
- check(camel_multipart_get_number(mp) == 1);
- check(camel_multipart_get_part(mp, 0) == part);
- check(camel_multipart_get_part(mp, 1) == NULL);
-
- check(camel_multipart_remove_part_at(mp, 0) == part);
- check(CAMEL_OBJECT(part)->ref_count == 1);
- check(camel_multipart_get_number(mp) == 0);
- check(camel_multipart_get_part(mp, 0) == NULL);
- check(camel_multipart_get_part(mp, 1) == NULL);
-
- camel_multipart_add_part(mp, part);
- check(CAMEL_OBJECT(part)->ref_count == 2);
- check(camel_multipart_get_number(mp) == 1);
- check(camel_multipart_get_part(mp, 0) == part);
- check(camel_multipart_get_part(mp, 1) == NULL);
-
- part2 = camel_mime_part_new();
- test_message_set_content_simple(part2, 0, "text/plain", "content part 2", strlen("content part 2"));
- camel_multipart_add_part(mp, part2);
- check(CAMEL_OBJECT(part2)->ref_count == 2);
- check(camel_multipart_get_number(mp) == 2);
- check(camel_multipart_get_part(mp, 0) == part);
- check(camel_multipart_get_part(mp, 1) == part2);
-
- part3 = camel_mime_part_new();
- test_message_set_content_simple(part3, 0, "text/plain", "content part 3", strlen("content part 3"));
- camel_multipart_add_part_at(mp, part3, 1);
- check(CAMEL_OBJECT(part3)->ref_count == 2);
- check(camel_multipart_get_number(mp) == 3);
- check(camel_multipart_get_part(mp, 0) == part);
- check(camel_multipart_get_part(mp, 1) == part3);
- check(camel_multipart_get_part(mp, 2) == part2);
- pull();
-
- push("save message to test3.msg");
- unlink("test3.msg");
- test_message_write_file(msg, "test3.msg");
- pull();
-
- push("read from test3.msg");
- msg2 = test_message_read_file("test3.msg");
- pull();
-
- push("compre content of multipart");
- mp2 = (CamelMultipart *)camel_medium_get_content_object((CamelMedium *)msg2);
- check(mp2 != NULL);
- check(CAMEL_IS_MULTIPART(mp2));
- check(camel_multipart_get_number(mp2) == 3);
-
- check(strcmp(camel_multipart_get_boundary(mp2), "_=,.XYZ_Kangaroo_Meat_is_!_ABADF00D") == 0);
- check(mp2->preface == NULL || strlen(mp2->preface) == 0);
-
- /* FIXME */
- camel_test_nonfatal("postface may gain a single \\n?");
- check_msg(mp2->postface == NULL || strlen(mp2->postface) == 0, "postface: '%s'", mp2->postface);
- camel_test_fatal();
-
- test_message_compare_content(camel_medium_get_content_object(CAMEL_MEDIUM(camel_multipart_get_part(mp2, 0))),
- "content part 1", strlen("content part 1"));
- test_message_compare_content(camel_medium_get_content_object(CAMEL_MEDIUM(camel_multipart_get_part(mp2, 1))),
- "content part 3", strlen("content part 3"));
- test_message_compare_content(camel_medium_get_content_object(CAMEL_MEDIUM(camel_multipart_get_part(mp2, 2))),
- "content part 2", strlen("content part 2"));
- pull();
-
- push("writing again, & re-reading");
- unlink("test3-2.msg");
- test_message_write_file(msg2, "test3-2.msg");
- msg3 = test_message_read_file("test3-2.msg");
-
- push("comparing again");
- mp2 = (CamelMultipart *)camel_medium_get_content_object((CamelMedium *)msg3);
- check(mp2 != NULL);
- check(CAMEL_IS_MULTIPART(mp2));
- check(camel_multipart_get_number(mp2) == 3);
-
- check(strcmp(camel_multipart_get_boundary(mp2), "_=,.XYZ_Kangaroo_Meat_is_!_ABADF00D") == 0);
- check(mp2->preface == NULL || strlen(mp2->preface) == 0);
-
- /* FIXME */
- camel_test_nonfatal("postface may gain a single \\n?");
- check_msg(mp2->postface == NULL || strlen(mp2->postface) == 0, "postface: '%s'", mp2->postface);
- camel_test_fatal();
-
- test_message_compare_content(camel_medium_get_content_object(CAMEL_MEDIUM(camel_multipart_get_part(mp2, 0))),
- "content part 1", strlen("content part 1"));
- test_message_compare_content(camel_medium_get_content_object(CAMEL_MEDIUM(camel_multipart_get_part(mp2, 1))),
- "content part 3", strlen("content part 3"));
- test_message_compare_content(camel_medium_get_content_object(CAMEL_MEDIUM(camel_multipart_get_part(mp2, 2))),
- "content part 2", strlen("content part 2"));
- pull();
- pull();
-
- check_unref(msg2, 1);
- check_unref(msg3, 1);
-
- push("testing pre/post text");
- camel_multipart_set_preface(mp, "pre-text\nLines.");
- camel_multipart_set_postface(mp, "post-text, no lines.\nOne line.\n");
-
- check(strcmp(mp->preface, "pre-text\nLines.") == 0);
- check(strcmp(mp->postface, "post-text, no lines.\nOne line.\n") == 0);
-
- push("writing /re-reading");
- unlink("test3-3.msg");
- test_message_write_file(msg, "test3-3.msg");
- msg2 = test_message_read_file("test3-3.msg");
-
- mp2 = (CamelMultipart *)camel_medium_get_content_object((CamelMedium *)msg2);
- check(mp2 != NULL);
- check(CAMEL_IS_MULTIPART(mp2));
- check(camel_multipart_get_number(mp2) == 3);
-
- check(strcmp(camel_multipart_get_boundary(mp2), "_=,.XYZ_Kangaroo_Meat_is_!_ABADF00D") == 0);
- check(strcmp(mp2->preface, "pre-text\nLines.") == 0);
- check(strcmp(mp2->postface, "post-text, no lines.\nOne line.\n") == 0);
- test_message_compare_content(camel_medium_get_content_object(CAMEL_MEDIUM(camel_multipart_get_part(mp2, 0))),
- "content part 1", strlen("content part 1"));
- test_message_compare_content(camel_medium_get_content_object(CAMEL_MEDIUM(camel_multipart_get_part(mp2, 1))),
- "content part 3", strlen("content part 3"));
- test_message_compare_content(camel_medium_get_content_object(CAMEL_MEDIUM(camel_multipart_get_part(mp2, 2))),
- "content part 2", strlen("content part 2"));
- pull();
- check_unref(msg2, 1);
- pull();
-
- check_unref(msg, 1);
- check_unref(mp, 1);
- check_unref(part, 1);
- check_unref(part2, 1);
- check_unref(part3, 1);
-
- camel_test_end();
-
- return 0;
-}
diff --git a/camel/tests/message/test4.c b/camel/tests/message/test4.c
deleted file mode 100644
index ff3b08af30..0000000000
--- a/camel/tests/message/test4.c
+++ /dev/null
@@ -1,129 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-
-#include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <dirent.h>
-
-#include "camel-test.h"
-#include "messages.h"
-
-#include <camel/camel-multipart.h>
-#include <camel/camel-mime-message.h>
-#include <camel/camel-stream-fs.h>
-#include <camel/camel-stream-mem.h>
-
-
-#if 0
-static void
-dump_mime_struct (CamelMimePart *mime_part, int depth)
-{
- CamelDataWrapper *content;
- char *mime_type;
- int i = 0;
-
- while (i < depth) {
- printf (" ");
- i++;
- }
-
- content = camel_medium_get_content_object ((CamelMedium *) mime_part);
-
- mime_type = camel_data_wrapper_get_mime_type (content);
- printf ("Content-Type: %s\n", mime_type);
- g_free (mime_type);
-
- if (CAMEL_IS_MULTIPART (content)) {
- guint num, index = 0;
-
- num = camel_multipart_get_number ((CamelMultipart *) content);
- while (index < num) {
- mime_part = camel_multipart_get_part ((CamelMultipart *) content, index);
- dump_mime_struct (mime_part, depth + 1);
- index++;
- }
- } else if (CAMEL_IS_MIME_MESSAGE (content)) {
- dump_mime_struct ((CamelMimePart *) content, depth + 1);
- }
-}
-#endif
-
-int main (int argc, char **argv)
-{
- struct dirent *dent;
- DIR *dir;
- int fd;
-
- camel_test_init (argc, argv);
-
- camel_test_start ("Message Test Suite");
-
- if (!(dir = opendir ("../data/messages")))
- return 77;
-
- while ((dent = readdir (dir)) != NULL) {
- CamelMimeMessage *message;
- CamelStream *stream;
- char *filename;
- struct stat st;
-
- if (dent->d_name[0] == '.')
- continue;
-
- filename = g_strdup_printf ("../data/messages/%s", dent->d_name);
- if (stat (filename, &st) == -1 || !S_ISREG (st.st_mode)) {
- g_free (filename);
- continue;
- }
-
- if ((fd = open (filename, O_RDONLY)) == -1) {
- g_free (filename);
- continue;
- }
-
- push ("testing message `%s`", filename);
- g_free (filename);
-
- stream = camel_stream_fs_new_with_fd (fd);
- message = camel_mime_message_new ();
- camel_data_wrapper_construct_from_stream ((CamelDataWrapper *) message, stream);
- camel_stream_reset (stream);
-
- /*dump_mime_struct ((CamelMimePart *) message, 0);*/
- test_message_compare (message);
-
- camel_object_unref (message);
- camel_object_unref (stream);
-
- pull ();
- }
-
- closedir (dir);
-
- camel_test_end ();
-
- return 0;
-}
diff --git a/camel/tests/mime-filter/.cvsignore b/camel/tests/mime-filter/.cvsignore
deleted file mode 100644
index f8d627b581..0000000000
--- a/camel/tests/mime-filter/.cvsignore
+++ /dev/null
@@ -1,8 +0,0 @@
-.deps
-Makefile
-Makefile.in
-.libs
-*.lo
-*.la
-test-crlf
-test-charset \ No newline at end of file
diff --git a/camel/tests/mime-filter/Makefile.am b/camel/tests/mime-filter/Makefile.am
deleted file mode 100644
index 21635f839f..0000000000
--- a/camel/tests/mime-filter/Makefile.am
+++ /dev/null
@@ -1,36 +0,0 @@
-
-INCLUDES = \
- -I$(includedir) \
- -I$(top_srcdir) \
- -I$(top_srcdir)/intl \
- -I$(top_srcdir)/e-util \
- -I$(top_srcdir)/camel \
- -I$(top_srcdir)/camel/tests/lib \
- -DG_LOG_DOMAIN=\"evolution-tests\" \
- -DSOURCEDIR=\"$(srcdir)\" \
- $(CAMEL_CFLAGS)
-
-LDADD = \
- $(top_builddir)/camel/libcamel.la \
- $(top_builddir)/e-util/libeutil.la \
- $(top_builddir)/camel/tests/lib/libcameltest.a \
- $(INTLLIBS) \
- $(EVOLUTION_MAIL_LIBS)
-
-EXTRA_DIST = \
- crlf-1.in \
- crlf-1.out \
- charset-iso-2022-jp.0.in \
- charset-iso-2022-jp.0.out \
- charset-gb2312.0.in \
- charset-gb2312.0.out
-
-check_PROGRAMS = \
- test-crlf \
- test-charset \
- test-tohtml
-
-TESTS = test-crlf test-charset test-tohtml
-
-
-
diff --git a/camel/tests/mime-filter/charset-gb2312.0.in b/camel/tests/mime-filter/charset-gb2312.0.in
deleted file mode 100644
index 82520ac916..0000000000
--- a/camel/tests/mime-filter/charset-gb2312.0.in
+++ /dev/null
@@ -1,448 +0,0 @@
-<html><head>
-<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
-<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
-<meta name="ProgId" content="FrontPage.Editor.Document">
-<title>һվʽóס漰ƹϵͳ An all-in-one solution for trading, inventory, accounting management</title>
-
-
-<style>
-<!--
-#fps0 {font-style: normal}
-#fps1 {background-color: #339933}
-#fps2 {font-family:times new roman;font-size:24pt;color:#0066ff;}
-#fps3 {font-family:times new roman;font-size:18pt;color:#0066ff;}
-#fps4 {font-family:SimSun;font-size:14pt}
-#fps5 {color:#0066ff;font-weight:bold;}
-#fps6 {font-size:10pt;}
-#fps7 {color:#ffffff;}
-#fps8 {font-family:times new roman;color:#ffffff;font-weight:bold;}
-#fps9 {font-family:times new roman;font-size:10pt;}
-#fps10 {font-size:10pt;color:#0066ff;}
--->
-</style>
-
-</head>
-
-<body topmargin="0" leftmargin="10" bgcolor="#FFFFFF" >
- <table border=0 cellpadding=0 cellspacing=0 style="border-collapse: collapse" bordercolor=#111111 id=AutoNumber1 height=233>
- <tr valign=top>
- <td height=165>
- <p align=justify>
-
-
- <em id=fps0>
- <strong>
- <span id=fps2>TRADE</span><span id=fps3>dot</span><span id=fps2>NET</span></strong></em><span lang=zh-tw><!----><span id=fps4> </span>
- </span><font color=#FF0000>
- <strong><font size=2>&nbsp;<br>
- </font></strong></font><font face=SimSun size=2>һվʽóס漰ƹϵͳܶʼ롢ݴ౨ۡƱ֡ռʡƱļЧعóס漰</font></td>
- <td height=165>
- <p align=justify>
-
-
- <em id=fps0>
- <strong>
- <span id=fps2>TRADE</span><span id=fps3>dot</span><span id=fps2>NET</span></strong></em><span lang=zh-tw><!----><span id=fps4> </span>
- </span><font size=2><!----><font color=#FF0000>
- <strong>&nbsp;<br>
- <font face="Times New Roman">What's the most annoying part during your
- work? </font>
- </strong></font><font face="Times New Roman">Endless repetitive data
- entry, calculation and paper work on quotation, invoice, inventory
- management, daily voucher, journal and reporting? Once you have installed<span id=fps5>
- TRADEdotNET</span>,<span id=fps5> </span>all of these
- annoying work will never appear in your office again!<span id=fps5><br>
- TRADEdotNET</span> is an all-in-one solution for trading, inventory,
- accounting management. In the <span id=fps5>TRADEdotNET</span>&nbsp;
- environment, all data can be continuously retrieved and reused. This will
- help you for minimizing time consumed on data entry and enhancing
- efficiency.</font></font></td>
- </tr>
- <tr valign=top>
- <td height=68><em id=fps0>
- <strong>
- <span id=fps2>TRADE</span><span id=fps3>dot</span><span id=fps2>NET</span></strong></em><span lang=zh-tw><!----><span id=fps4> </span>
- </span>ֱ<span lang=zh-tw></span>ϵͳɣó׶<font face=SimSun></font>ϵͳ</td>
- <td height=68><em id=fps0>
- <strong>
- <span id=fps2>TRADE</span><span id=fps3>dot</span><span id=fps2>NET</span></strong></em><span lang=zh-tw><!----><span id=fps4> </span>
- </span><font face="Times New Roman">Containing Trading Management
- Module, Inventory Management Module and Accounting Management Module.</font></td>
- </tr>
- </table>
- <p align=center><span id=fps6>
- <img border=0 src=Flow2.gif width=600 height=420></span></p>
- <table border=0 cellpadding=0 cellspacing=0 style="border-collapse: collapse" bordercolor=#111111 id=AutoNumber2 height=15>
- <tr valign=top>
- <td height=129>
- <em id=fps0>
- <strong>
- <span id=fps2>TRADE</span><span id=fps3>dot</span><span id=fps2>NET</span></strong></em><span lang=zh-tw><!----><span id=fps4> </span>
- </span><span id=fps6>ŵ</span><span lang=zh-tw><!----><span id=fps6></span></span><span id=fps6><br>
- </span>
- <span id=fps7><!----><span id=fps1><b>&nbsp;ϵͳ
- </b> <span id=fps6>
- <br>
- </span>
- </span></span> <span id=fps6> <br>
- IJͼʾϵͳҪ̣û˳ÿһ衣ûֻ밴ͼͼ񣬼ϵͳݷʽɽضĹܻ档</span></td>
- <td height=129>
-
-
- <p align=justify>
-
-
- <em id=fps0>
- <strong>
- <span id=fps2>TRADE</span><span id=fps3>dot</span><span id=fps2>NET</span></strong></em><span lang=zh-tw><!----><span id=fps4> </span>
- </span><font size=4 face="Times New Roman">Highlights :</font><span id=fps6><br>
- </span>
- <font color=#FFFFFF><span id=fps1>
- <span id=fps8>&nbsp;Easy Access
- </span> <span id=fps6>
- <br>
- </span>
- </span></font> <font size=2> <br>
- <span id=fps9>A Road Map showing the user-friendly system
- flow guides users throughout all steps. User can click on the menu icons,
- which act as shortcuts, and enter into the desired function.</span></font></p>
- </td>
- </tr>
- <tr valign=top>
- <td height=135>
- <span id=fps7><!----><span id=fps1><b>&nbsp;ƵIJѯѰ
- </b> <span id=fps6>
- <br>
- </span>
- </span></span> <span id=fps6>
- <br>
- Աشͻѯ򷢳ʱ׼¼̲˷ʱ䣬һش׼ȷӴʧȥⱦĿͻѯѰֲͬʵʱѯܣܿѰݼ¼ֻҪûͻšƷšƱڵһѰѰ漴ʾ </span>
- </td>
- <td height=135>
- <font color=#FFFFFF><span id=fps1>
- <span id=fps8>&nbsp;Perfect On-line Enquiry
- </span> <span id=fps6>
- <br>
- </span>
- </span></font> <font size=2>
- <br>
- <span id=fps9>Under many circumstances, staff also need to
- retrieve past transaction history for handing customer enquiry or placing
- an order, however they cannot get the required information immediately and
- this may drive away the customers. On-line Enquiry engine enables staff to
- check past transaction with searching parameters such as key words, client
- code, item code, invoice date. </span>
- </font></td>
- </tr>
- <tr valign=top>
- <td height=83>
- <span style="background-color: #339933; font-weight:700" id="fps7">&nbsp;ļ </span><span id=fps6>
- <br>
- <br>
- ϵͳʽӿԳõĴƱΪûʱӦͬռʸʽܸЧʵشճ</span></td>
- <td height=83>
- <font color=#FFFFFF face="Times New Roman">
- <span style="background-color: #339933; font-weight:700">&nbsp;Input
- Template </span></font><font size=2>
- <br>
- <br>
- <span id=fps9>The data entry journal interface is similar
- to paper voucher, so that users can handle their daily accounting
- transaction as they used to, yet more efficient.</span></font></td>
- </tr>
- <tr valign=top>
- <td height=76>
- <b>
- <font color=#FFFFFF><span id=fps1>&nbsp;޼¼ </span></font>&nbsp;</b><font size=2><br>
- <br>
- ϵͳǿ󣬲¼ޣûʱκʱڵĽ׼¼
- </font>
- </td>
- <td height=76>
- <font face="Times New Roman">
- <b>
- <font color=#FFFFFF><span id=fps1>&nbsp;Unlimited
- Data Record </span></font>&nbsp;</b></font><font size=2><br>
- <br>
- <font face="Times New Roman">The system can store unlimited number of
- records, so that users can retrieve data of any time whenever they need
- it.</font></font></td>
- </tr>
- <tr valign=top>
- <td height=105>
- <span id=fps7><!----><span id=fps1><b>&nbsp;ϵͳ
- </b> <br>
- </span></span> <span id=fps6>
- <br>
- Ƚĵϵͳ()ֻȨûģϵͳԱӦûְ趨ûȨޡ </span></td>
- <td height=105>
- <font color=#FFFFFF><span id=fps1>
- <span id=fps8>&nbsp;Login Control
- </span> <br>
- </span></font> <font size=2>
- <br>
- <span id=fps9>Advanced access control ensures access right
- is only granted to authorized users. System administrator can also define
- access level of each user according to their capacity, so that confidential
- information can only be retrieved and viewed by senior management.</span></font></td>
- </tr>
- <tr valign=top>
- <td height=87>
- <span id=fps7><!----><span id=fps1><b>&nbsp;ѡʽ
- </b> <br>
- </span></span> <span id=fps6>
- <br>
- ϵͳԿʽƣֻҪSeagate Crystal Report ()Ʊʽӱ</span></td>
- <td height=87>
- <font color=#FFFFFF><span id=fps1>
- <span id=fps8>&nbsp;Customize Report
- </span> <br>
- </span></font> <font size=2>
- <br>
- <span id=fps9>The system is designed with an open architecture
- format. When the system is used with&nbsp; Seagate Crystal Report Software, Users can
- customize report content and format of the system.</span></font></td>
- </tr>
- <tr valign=top>
- <td height=100>
- <font color=#FFFFFF><span id=fps1>
- <b>&nbsp;Ѕn <br>
- </b>
- </span></font> <span id=fps6>
- <br>
- 80%ıMS Excel/WordʽҪͼݷ֮á <br>
- MS Excel/WordȸʽԵʸ͸йԱ </span></td>
- <td height=100>
- <font color=#FFFFFF><span id=fps1>
- <b><font face="Times New Roman">&nbsp;Multi-Report Export Tools </font> <br>
- </b>
- </span></font> <font size=2>
- <br>
- <font face="Times New Roman">Over 80% of reports can be exported to MS
- Excel /&nbsp; Word and data can be translated into graphs and tables for
- further analysis.<br>
- Reports can also be export to MS Excel / Word format independently or send
- to email client with attachment directly.</font></font></td>
- </tr>
- <tr valign=top>
- <td height=118>
- <span id=fps7><!----><span id=fps1><b>&nbsp;ʻ֧
- </b> <br>
- </span>
- </span> <span id=fps6>
- <br>
- Ϊϲó׹˾ڹڻ賧ֹ˾Ҫݻͨ</span><strong><font size=2><span id=fps10>TRADEdotNET</span><font color=#FF0000> </font>
- </font></strong>
- <span id=fps6>ṩȫ氲ȫƽ̨װ</span><font color=#0066FF><strong><span id=fps10> TRADEdotNET </span></strong></font><span id=fps6>ָ֧͸ûʱ԰װ </span><strong><font size=2>
- <span id=fps10>TRADEdotNET</span><font color=#FF0000> </font>
- </font></strong>
- <span id=fps6>ı׼ MS ϵͳʹá</span></td>
- <td height=118>
- <font color=#FFFFFF><span id=fps1>
- <span id=fps8>&nbsp;Internet Ready
- </span> <br>
- </span>
- </font> <font size=2>
- <br>
- <span id=fps9>To facilitate data exchange between trading companies and their offices in
- the Mainland China or Southeast Asia Country, </span> </font>
- <font face="Times New Roman"> <span id=fps9>
- Install and makes use of<strong><font color=#0066FF> TRADEdotNET</font>
- Internet Kit </strong>&nbsp;to provide a secured platform enabling user
- to access the data from different locations anytime through the internet
- with </span><font color=#0066FF><strong><span id=fps10> TRADEdotNET </span></strong></font>
- </font>
- <span id=fps9>system. </span></td>
- </tr>
- <tr valign=top>
- <td height=90>
- <span id=fps7><!----><span id=fps1><b>&nbsp;ݿ֧
- </b> <br>
- </span>
- </span> <span id=fps6>
- <br>
- ΪϲͬС˾ıҪ</span><strong><span id=fps10>TRADEdotNET</span></strong><span id=fps6> ṩͬݿ汾ԹѡƳ MS AccessMS SQLƳ Oracle ݿ⡣<br>
- </span></td>
- <td height=90>
- <font color=#FFFFFF><span id=fps1>
- <span id=fps8>&nbsp;Multi-Database Format
- </span> <br>
- </span>
- </font> <span id=fps6>
- <br>
- </span><font face="Times New Roman"><strong><font size=2><!----><font color=#0066FF>TRADEdotNET</font><font color=#FF0000> </font>
- </font></strong>
- </font><span id=fps9>enables user to select
- different database format versions to fit their company requirements. Now
- users can choose from MS
- Access and MS SQL version.&nbsp; Oracle and other database formats are coming soon.</span></td>
- </tr>
- <tr valign=top>
- <td height=70>
- <span id=fps7><!----><span id=fps1><b>&nbsp;ֹ֧
- </b> <br>
- </span></span>
- <span id=fps6> <br>
- ֶ֧ûֶ֧๫˾ֶ֧ңֶ֧棬ֶ֧(/Ӣ)
- </span></td>
- <td height=70>
- <font color=#FFFFFF><span id=fps1>
- <span id=fps8>&nbsp;Multiple Functionality
- </span> <br>
- </span></font>
- <font size=2> <br>
- <span id=fps9>Support multi-users, multi-companies,
- multi-currencies, multi-inventory, multi-languages (Chinese / English).</span></font></td>
- </tr>
- <tr valign=top>
- <td height=142>
- <span id=fps7>
- <span id=fps1>
- <b>&nbsp;ϵͳҪ
- </b>
- <br>
- </span></span><span id=fps6><br>
- ̨<br>
- Intel Pentium II () Processor PC<br>
- Windows 98, ME, 2000 Windows NT 4.0<br>
- 64 MB RAMƼ128MB<br>
- 256ɫ֮SVGAʾ<br>
- 50MBӲ̿ռ<br>
- Windows 98, ME, 2000 Windows NT 4.0 ֧֮ӡ</span></td>
- <td height=142>
- <font color=#FFFFFF>
- <span id=fps1>
- <span id=fps8>
- &nbsp;System
- Requirements
-
- </span>
- <br>
- </span></font><font size=2><br>
- <span id=fps9>
- Workstation<br>
- Intel Pentium II (or above) Processor PC<br>
- Windows 98, ME, 2000 or Windows NT 4.0<br>
- 64MB RAM
- minimum 128MB
- recommended<br>
- 256 color SVGA display or higher<br>
- 50MB free Hard Disk<br>
- Printers
- supported by
- Windows 98, ME, 2000 Windows NT 4.0<br>
- </span></font></td>
- </tr>
- <tr valign=top>
- <td height=436>
- <span id=fps7>
- <span id=fps1>&nbsp;Χ
- </span></span><span id=fps6>
- <br>
- <br>
- ϵͳʾ<br>
- &nbsp;&nbsp;&nbsp;&nbsp; ϵͳʾ
- <br>
- <br>
- ϵͳװ<br>
- &nbsp;&nbsp;&nbsp;&nbsp; ϵͳװɱ˾רҵʦ
- <br>
- <br>
- ݱݼԭ<br>
- &nbsp;&nbsp;&nbsp;&nbsp; Ϊͻ趨ݱݼԭťϿͻ֮豸<br>
- <br>
- ļʽ<br>
- &nbsp;&nbsp;&nbsp;&nbsp; Ϊͻļʽ߹˾()<br>
- <br>
- ϵͳִ<br>
- &nbsp;&nbsp;&nbsp;&nbsp; Ϊ趨ϵͳ̱ŵִ
- <br>
- <br>
- ûѵ<br>
- &nbsp;&nbsp;&nbsp;&nbsp; ûѵڿͻ칫ңҲ޴
- <br>
- <br>
- ϵͳѯ<br>
- &nbsp;&nbsp;&nbsp;&nbsp; ṩЧֱӵѯ񣬴ϵͳ
- <br>
- <br>
- ϵͳ<br>
- &nbsp;&nbsp;&nbsp;&nbsp; ѱ
- <br>
- &nbsp;&nbsp;&nbsp;&nbsp; ڱΪͻϵͳ
- </span></td>
- <td height=436>
- <font color=#FFFFFF face="Times New Roman">
- <span id=fps1>&nbsp;Services
- Provided
- </span></font><font size=2>
- <br>
- <br>
- <span id=fps9>System Demonstration<br>
- &nbsp;&nbsp;&nbsp;&nbsp; Free-of-charge system demonstration in client's office<br>
- <br>
- System Installation<br>
- &nbsp;&nbsp;&nbsp;&nbsp;
- On-site
- installation
- by our
- professional
- engineers <br>
- <br>
- Backup/Restore<br>
- &nbsp;&nbsp;&nbsp;&nbsp; Setups of backup and restore icons associated with client's backup device (e.g. Zip Drive, MO)<br>
- <br>
- Tailored Format<br>
- &nbsp;&nbsp;&nbsp;&nbsp; Tailored designs on document formats to highlight and promote company image<br>
- <br>
- System Implementation<br>
- &nbsp;&nbsp;&nbsp;&nbsp;
- Implementation
- procedures
- customized for
- each
- organization <br>
- <br>
- User Training<br>
- &nbsp;&nbsp;&nbsp;&nbsp; Unlimited training is provided in the client's office
- <br>
- <br>
- Hot-line Enquiry<br>
- &nbsp;&nbsp;&nbsp;&nbsp; Efficient hot-line support for all system enquiries<br>
- <br>
- System Maintenance<br>
- &nbsp;&nbsp;&nbsp;&nbsp; Half-a-year free maintenance <br>
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Free
- upgrade
- services
- throughout
- warranty
- periods </span>
- </font>
- </td>
- </tr>
- </table>
- <table border=0 cellpadding=0 cellspacing=0 style="border-collapse: collapse" bordercolor=#111111 width=100% id=AutoNumber3>
- <tr>
- <td width=100%><b><font size=6 color=#FFFFFF>
- <span style="background-color: #0000FF"><br>
- ӭ Ԥ Լ ʾ &nbsp; : (852) 2591 9377</span></font></b><p> Ѷ
- ˾&nbsp; Superdata International Ltd.<br>
- Tel: (852) 2591 9377 </td>
- </tr>
- </table>
- <p>
- <font size=1>
- <font face="Times New Roman">
- *All prices,
- conditions and
- system
- specifications
- are subject to
- change without
- prior notice.
- </font>м۸漰ϵͳ֮޸ģ֪ͨ</font><span id=fps6>
-
-</span> </p>
-
- </body></html>
diff --git a/camel/tests/mime-filter/charset-gb2312.0.out b/camel/tests/mime-filter/charset-gb2312.0.out
deleted file mode 100644
index 8dcae6bdfc..0000000000
--- a/camel/tests/mime-filter/charset-gb2312.0.out
+++ /dev/null
@@ -1,448 +0,0 @@
-<html><head>
-<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
-<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
-<meta name="ProgId" content="FrontPage.Editor.Document">
-<title>一站式的贸易、库存及会计管理系统 An all-in-one solution for trading, inventory, accounting management</title>
-
-
-<style>
-<!--
-#fps0 {font-style: normal}
-#fps1 {background-color: #339933}
-#fps2 {font-family:times new roman;font-size:24pt;color:#0066ff;}
-#fps3 {font-family:times new roman;font-size:18pt;color:#0066ff;}
-#fps4 {font-family:SimSun;font-size:14pt}
-#fps5 {color:#0066ff;font-weight:bold;}
-#fps6 {font-size:10pt;}
-#fps7 {color:#ffffff;}
-#fps8 {font-family:times new roman;color:#ffffff;font-weight:bold;}
-#fps9 {font-family:times new roman;font-size:10pt;}
-#fps10 {font-size:10pt;color:#0066ff;}
--->
-</style>
-
-</head>
-
-<body topmargin="0" leftmargin="10" bgcolor="#FFFFFF" >
- <table border=0 cellpadding=0 cellspacing=0 style="border-collapse: collapse" bordercolor=#111111 id=AutoNumber1 height=233>
- <tr valign=top>
- <td height=165>
- <p align=justify>
-
-
- <em id=fps0>
- <strong>
- <span id=fps2>TRADE</span><span id=fps3>dot</span><span id=fps2>NET</span></strong></em><span lang=zh-tw><!----><span id=fps4> </span>
- </span><font color=#FF0000>
- <strong><font size=2>&nbsp;<br>
- </font></strong></font><font face=SimSun size=2>是一站式的贸易、库存及会计管理系统,助您精简周而复始的资料输入、数据处理及各类报价、发票、存仓、日记帐、传票、报表等所需的文件行政工作,让您更有效地管理贸易、库存及会计事务。</font></td>
- <td height=165>
- <p align=justify>
-
-
- <em id=fps0>
- <strong>
- <span id=fps2>TRADE</span><span id=fps3>dot</span><span id=fps2>NET</span></strong></em><span lang=zh-tw><!----><span id=fps4> </span>
- </span><font size=2><!----><font color=#FF0000>
- <strong>&nbsp;<br>
- <font face="Times New Roman">What's the most annoying part during your
- work? </font>
- </strong></font><font face="Times New Roman">Endless repetitive data
- entry, calculation and paper work on quotation, invoice, inventory
- management, daily voucher, journal and reporting? Once you have installed<span id=fps5>
- TRADEdotNET</span>,<span id=fps5> </span>all of these
- annoying work will never appear in your office again!<span id=fps5><br>
- TRADEdotNET</span> is an all-in-one solution for trading, inventory,
- accounting management. In the <span id=fps5>TRADEdotNET</span>&nbsp;
- environment, all data can be continuously retrieved and reused. This will
- help you for minimizing time consumed on data entry and enhancing
- efficiency.</font></font></td>
- </tr>
- <tr valign=top>
- <td height=68><em id=fps0>
- <strong>
- <span id=fps2>TRADE</span><span id=fps3>dot</span><span id=fps2>NET</span></strong></em><span lang=zh-tw><!----><span id=fps4> </span>
- </span>分别由<span lang=zh-tw>三</span>组系统组成:贸易订单管理<font face=SimSun>、库存</font>管理及会计系统</td>
- <td height=68><em id=fps0>
- <strong>
- <span id=fps2>TRADE</span><span id=fps3>dot</span><span id=fps2>NET</span></strong></em><span lang=zh-tw><!----><span id=fps4> </span>
- </span><font face="Times New Roman">Containing Trading Management
- Module, Inventory Management Module and Accounting Management Module.</font></td>
- </tr>
- </table>
- <p align=center><span id=fps6>
- <img border=0 src=Flow2.gif width=600 height=420></span></p>
- <table border=0 cellpadding=0 cellspacing=0 style="border-collapse: collapse" bordercolor=#111111 id=AutoNumber2 height=15>
- <tr valign=top>
- <td height=129>
- <em id=fps0>
- <strong>
- <span id=fps2>TRADE</span><span id=fps3>dot</span><span id=fps2>NET</span></strong></em><span lang=zh-tw><!----><span id=fps4> </span>
- </span><span id=fps6>的优点</span><span lang=zh-tw><!----><span id=fps6>:</span></span><span id=fps6><br>
- </span>
- <span id=fps7><!----><span id=fps1><b>&nbsp;简易系统登入
- </b> <span id=fps6>
- <br>
- </span>
- </span></span> <span id=fps6> <br>
- 简单易明的操作流程图显示整个系统的主要流程,引导用户顺利完成每一个步骤。用户只须按下流程图的图像,即系统快捷方式,便可进入特定的功能画面。</span></td>
- <td height=129>
-
-
- <p align=justify>
-
-
- <em id=fps0>
- <strong>
- <span id=fps2>TRADE</span><span id=fps3>dot</span><span id=fps2>NET</span></strong></em><span lang=zh-tw><!----><span id=fps4> </span>
- </span><font size=4 face="Times New Roman">Highlights :</font><span id=fps6><br>
- </span>
- <font color=#FFFFFF><span id=fps1>
- <span id=fps8>&nbsp;Easy Access
- </span> <span id=fps6>
- <br>
- </span>
- </span></font> <font size=2> <br>
- <span id=fps9>A Road Map showing the user-friendly system
- flow guides users throughout all steps. User can click on the menu icons,
- which act as shortcuts, and enter into the desired function.</span></font></p>
- </td>
- </tr>
- <tr valign=top>
- <td height=135>
- <span id=fps7><!----><span id=fps1><b>&nbsp;完善的查询搜寻器
- </b> <span id=fps6>
- <br>
- </span>
- </span></span> <span id=fps6>
- <br>
- 当员工回答客户查询或发出订单,经常需时翻查以往交易纪录,这个过程不仅浪费时间,万一回答不准确,更可能令您从此失去这宝贵的客户。查询搜寻器多种不同的实时查询功能,能快速搜寻所需的数据纪录,只要用户输入客户编号、货品编号、发票日期等其中一项搜寻参数,搜寻结果随即显示。 </span>
- </td>
- <td height=135>
- <font color=#FFFFFF><span id=fps1>
- <span id=fps8>&nbsp;Perfect On-line Enquiry
- </span> <span id=fps6>
- <br>
- </span>
- </span></font> <font size=2>
- <br>
- <span id=fps9>Under many circumstances, staff also need to
- retrieve past transaction history for handing customer enquiry or placing
- an order, however they cannot get the required information immediately and
- this may drive away the customers. On-line Enquiry engine enables staff to
- check past transaction with searching parameters such as key words, client
- code, item code, invoice date. </span>
- </font></td>
- </tr>
- <tr valign=top>
- <td height=83>
- <span style="background-color: #339933; font-weight:700" id="fps7">&nbsp;文件输入 </span><span id=fps6>
- <br>
- <br>
- 系统的总帐接口设计以常用的传票为蓝本,用户无需费时重新适应不同日记帐格式,而且能更有效率地处理日常会计帐项数据输入程序。</span></td>
- <td height=83>
- <font color=#FFFFFF face="Times New Roman">
- <span style="background-color: #339933; font-weight:700">&nbsp;Input
- Template </span></font><font size=2>
- <br>
- <br>
- <span id=fps9>The data entry journal interface is similar
- to paper voucher, so that users can handle their daily accounting
- transaction as they used to, yet more efficient.</span></font></td>
- </tr>
- <tr valign=top>
- <td height=76>
- <b>
- <font color=#FFFFFF><span id=fps1>&nbsp;无限纪录储存 </span></font>&nbsp;</b><font size=2><br>
- <br>
- 系统容量强大,不设纪录储存年期上限,因此用户可以随时查阅任何时期的交易纪录。
- </font>
- </td>
- <td height=76>
- <font face="Times New Roman">
- <b>
- <font color=#FFFFFF><span id=fps1>&nbsp;Unlimited
- Data Record </span></font>&nbsp;</b></font><font size=2><br>
- <br>
- <font face="Times New Roman">The system can store unlimited number of
- records, so that users can retrieve data of any time whenever they need
- it.</font></font></td>
- </tr>
- <tr valign=top>
- <td height=105>
- <span id=fps7><!----><span id=fps1><b>&nbsp;系统登入监控
- </b> <br>
- </span></span> <span id=fps6>
- <br>
- 先进的登入监控系统保障(机密)数据只供授权用户查阅,系统管理员亦可以因应用户的职级而设定个别用户的阅览权限。 </span></td>
- <td height=105>
- <font color=#FFFFFF><span id=fps1>
- <span id=fps8>&nbsp;Login Control
- </span> <br>
- </span></font> <font size=2>
- <br>
- <span id=fps9>Advanced access control ensures access right
- is only granted to authorized users. System administrator can also define
- access level of each user according to their capacity, so that confidential
- information can only be retrieved and viewed by senior management.</span></font></td>
- </tr>
- <tr valign=top>
- <td height=87>
- <span id=fps7><!----><span id=fps1><b>&nbsp;自选报表格式
- </b> <br>
- </span></span> <span id=fps6>
- <br>
- 系统报表以开放式设计,只需要配合Seagate Crystal Report (另购),即可自行设计报表格式或增加报表。</span></td>
- <td height=87>
- <font color=#FFFFFF><span id=fps1>
- <span id=fps8>&nbsp;Customize Report
- </span> <br>
- </span></font> <font size=2>
- <br>
- <span id=fps9>The system is designed with an open architecture
- format. When the system is used with&nbsp; Seagate Crystal Report Software, Users can
- customize report content and format of the system.</span></font></td>
- </tr>
- <tr valign=top>
- <td height=100>
- <font color=#FFFFFF><span id=fps1>
- <b>&nbsp;多向列n报表工具 <br>
- </b>
- </span></font> <span id=fps6>
- <br>
- 超过80%的报表可以MS Excel/Word格式输出,按需要而制作图表供数据分析之用。 <br>
- 报表可以MS Excel/Word等格式独立输出或以电邮附带传送给有关人员。 </span></td>
- <td height=100>
- <font color=#FFFFFF><span id=fps1>
- <b><font face="Times New Roman">&nbsp;Multi-Report Export Tools </font> <br>
- </b>
- </span></font> <font size=2>
- <br>
- <font face="Times New Roman">Over 80% of reports can be exported to MS
- Excel /&nbsp; Word and data can be translated into graphs and tables for
- further analysis.<br>
- Reports can also be export to MS Excel / Word format independently or send
- to email client with attachment directly.</font></font></td>
- </tr>
- <tr valign=top>
- <td height=118>
- <span id=fps7><!----><span id=fps1><b>&nbsp;国际互联支持
- </b> <br>
- </span>
- </span> <span id=fps6>
- <br>
- 为了配合不少贸易公司于国内或东南亚设厂或分公司而需要数据数据互通,</span><strong><font size=2><span id=fps10>TRADEdotNET</span><font color=#FF0000> </font>
- </font></strong>
- <span id=fps6>提供全面安全的整合平台,安装</span><font color=#0066FF><strong><span id=fps10> TRADEdotNET </span></strong></font><span id=fps6>互联网支持附件,透过互联网,用户即可随时随地以安装了 </span><strong><font size=2>
- <span id=fps10>TRADEdotNET</span><font color=#FF0000> </font>
- </font></strong>
- <span id=fps6>的标准 MS 操作系统登入使用。</span></td>
- <td height=118>
- <font color=#FFFFFF><span id=fps1>
- <span id=fps8>&nbsp;Internet Ready
- </span> <br>
- </span>
- </font> <font size=2>
- <br>
- <span id=fps9>To facilitate data exchange between trading companies and their offices in
- the Mainland China or Southeast Asia Country, </span> </font>
- <font face="Times New Roman"> <span id=fps9>
- Install and makes use of<strong><font color=#0066FF> TRADEdotNET</font>
- Internet Kit </strong>&nbsp;to provide a secured platform enabling user
- to access the data from different locations anytime through the internet
- with </span><font color=#0066FF><strong><span id=fps10> TRADEdotNET </span></strong></font>
- </font>
- <span id=fps9>system. </span></td>
- </tr>
- <tr valign=top>
- <td height=90>
- <span id=fps7><!----><span id=fps1><b>&nbsp;多种数据库支持
- </b> <br>
- </span>
- </span> <span id=fps6>
- <br>
- 为了配合不同大小公司的本身需要,</span><strong><span id=fps10>TRADEdotNET</span></strong><span id=fps6> 提供不同数据库版本以供选择。已推出有 MS Access、MS SQL,即将推出有 Oracle 及其它数据库。<br>
-  </span></td>
- <td height=90>
- <font color=#FFFFFF><span id=fps1>
- <span id=fps8>&nbsp;Multi-Database Format
- </span> <br>
- </span>
- </font> <span id=fps6>
- <br>
- </span><font face="Times New Roman"><strong><font size=2><!----><font color=#0066FF>TRADEdotNET</font><font color=#FF0000> </font>
- </font></strong>
- </font><span id=fps9>enables user to select
- different database format versions to fit their company requirements. Now
- users can choose from MS
- Access and MS SQL version.&nbsp; Oracle and other database formats are coming soon.</span></td>
- </tr>
- <tr valign=top>
- <td height=70>
- <span id=fps7><!----><span id=fps1><b>&nbsp;其它支持功能
- </b> <br>
- </span></span>
- <span id=fps6> <br>
- 支持多用户,支持多公司,支持多货币,支持多库存,支持多语言(中文/英文)
- </span></td>
- <td height=70>
- <font color=#FFFFFF><span id=fps1>
- <span id=fps8>&nbsp;Multiple Functionality
- </span> <br>
- </span></font>
- <font size=2> <br>
- <span id=fps9>Support multi-users, multi-companies,
- multi-currencies, multi-inventory, multi-languages (Chinese / English).</span></font></td>
- </tr>
- <tr valign=top>
- <td height=142>
- <span id=fps7>
- <span id=fps1>
- <b>&nbsp;系统要求
- </b>
- <br>
- </span></span><span id=fps6><br>
- 工作台<br>
- Intel Pentium II (或以上) Processor PC<br>
- Windows 98, ME, 2000 或 Windows NT 4.0<br>
- 最少用 64 MB RAM,推荐用128MB<br>
- 256色或以上之SVGA显示器<br>
- 50MB硬盘空间<br>
- Windows 98, ME, 2000 或 Windows NT 4.0 支持之打印机</span></td>
- <td height=142>
- <font color=#FFFFFF>
- <span id=fps1>
- <span id=fps8>
- &nbsp;System
- Requirements
-
- </span>
- <br>
- </span></font><font size=2><br>
- <span id=fps9>
- Workstation<br>
- Intel Pentium II (or above) Processor PC<br>
- Windows 98, ME, 2000 or Windows NT 4.0<br>
- 64MB RAM
- minimum, 128MB
- recommended<br>
- 256 color SVGA display or higher<br>
- 50MB free Hard Disk<br>
- Printers
- supported by
- Windows 98, ME, 2000 或 Windows NT 4.0<br>
-  </span></font></td>
- </tr>
- <tr valign=top>
- <td height=436>
- <span id=fps7>
- <span id=fps1>&nbsp;服务范围
- </span></span><span id=fps6>
- <br>
- <br>
- 系统示范<br>
- &nbsp;&nbsp;&nbsp;&nbsp; 免费上门作系统示范
- 。<br>
- <br>
- 系统安装<br>
- &nbsp;&nbsp;&nbsp;&nbsp; 系统安装会由本公司专业工程师负责
- 。<br>
- <br>
- 数据备份及还原<br>
- &nbsp;&nbsp;&nbsp;&nbsp; 免费为客户设定数据备份及还原按钮,以配合客户之‘备份设备’。<br>
- <br>
- 度身订做文件式样<br>
- &nbsp;&nbsp;&nbsp;&nbsp; 为客户度身订做文件式样,提高公司形象(另费)。<br>
- <br>
- 系统执行<br>
- &nbsp;&nbsp;&nbsp;&nbsp; 为各机构设定系统流程表及监察各部门的执行情况
- 。<br>
- <br>
- 用户培训<br>
- &nbsp;&nbsp;&nbsp;&nbsp; 用户培训可设在客户办公室,而且不限次数
- 。<br>
- <br>
- 系统咨询热线<br>
- &nbsp;&nbsp;&nbsp;&nbsp; 提供有效直接的热线咨询服务,处理系统疑难
- 。<br>
- <br>
- 系统保养<br>
- &nbsp;&nbsp;&nbsp;&nbsp; 半年免费保养
- ; <br>
- &nbsp;&nbsp;&nbsp;&nbsp; 于保养期内免费为客户作系统提升
- 。</span></td>
- <td height=436>
- <font color=#FFFFFF face="Times New Roman">
- <span id=fps1>&nbsp;Services
- Provided
- </span></font><font size=2>
- <br>
- <br>
- <span id=fps9>System Demonstration<br>
- &nbsp;&nbsp;&nbsp;&nbsp; Free-of-charge system demonstration in client's office<br>
- <br>
- System Installation<br>
- &nbsp;&nbsp;&nbsp;&nbsp;
- On-site
- installation
- by our
- professional
- engineers <br>
- <br>
- Backup/Restore<br>
- &nbsp;&nbsp;&nbsp;&nbsp; Setups of backup and restore icons associated with client's backup device (e.g. Zip Drive, MO)<br>
- <br>
- Tailored Format<br>
- &nbsp;&nbsp;&nbsp;&nbsp; Tailored designs on document formats to highlight and promote company image<br>
- <br>
- System Implementation<br>
- &nbsp;&nbsp;&nbsp;&nbsp;
- Implementation
- procedures
- customized for
- each
- organization <br>
- <br>
- User Training<br>
- &nbsp;&nbsp;&nbsp;&nbsp; Unlimited training is provided in the client's office
- <br>
- <br>
- Hot-line Enquiry<br>
- &nbsp;&nbsp;&nbsp;&nbsp; Efficient hot-line support for all system enquiries<br>
- <br>
- System Maintenance<br>
- &nbsp;&nbsp;&nbsp;&nbsp; Half-a-year free maintenance <br>
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Free
- upgrade
- services
- throughout
- warranty
- periods </span>
- </font>
- </td>
- </tr>
- </table>
- <table border=0 cellpadding=0 cellspacing=0 style="border-collapse: collapse" bordercolor=#111111 width=100% id=AutoNumber3>
- <tr>
- <td width=100%><b><font size=6 color=#FFFFFF>
- <span style="background-color: #0000FF"><br>
- 欢 迎 预 约 示 范&nbsp;请电 : (852) 2591 9377</span></font></b><p>精 讯 国 际 有
- 限 公 司&nbsp; Superdata International Ltd.<br>
- Tel: (852) 2591 9377 </td>
- </tr>
- </table>
- <p>
- <font size=1>
- <font face="Times New Roman">
- *All prices,
- conditions and
- system
- specifications
- are subject to
- change without
- prior notice.
- </font>所有价格,条规及系统规格之修改,将不另行通知。</font><span id=fps6>
-
- </span> </p>
-
- </body></html>
diff --git a/camel/tests/mime-filter/charset-iso-2022-jp.0.in b/camel/tests/mime-filter/charset-iso-2022-jp.0.in
deleted file mode 100644
index 8c23b208ce..0000000000
--- a/camel/tests/mime-filter/charset-iso-2022-jp.0.in
+++ /dev/null
@@ -1,5 +0,0 @@
-$B$($m$$#t#y$&$H$&$#$&$$$(#y$F#r$A$&$(#r#y$H#y#r$H$($D$*#3#9#4#5#0#9#8#0#9#4$($$#r(B
-$B$H$($D$*$($&$H$($k$H$&#t(B
-
-Thanks & Regards,
-Sures
diff --git a/camel/tests/mime-filter/charset-iso-2022-jp.0.out b/camel/tests/mime-filter/charset-iso-2022-jp.0.out
deleted file mode 100644
index c66c5f79ce..0000000000
--- a/camel/tests/mime-filter/charset-iso-2022-jp.0.out
+++ /dev/null
@@ -1,5 +0,0 @@
-えろいtyうとうぃういえyてrちうえryとyrとえつお3945098094えいr
-とえつおえうとえるとうt
-
-Thanks & Regards,
-Sures
diff --git a/camel/tests/mime-filter/crlf-1.in b/camel/tests/mime-filter/crlf-1.in
deleted file mode 100644
index d98703c725..0000000000
--- a/camel/tests/mime-filter/crlf-1.in
+++ /dev/null
@@ -1,19 +0,0 @@
-This is some text to filter and stuff. Hopefully that . will not become '..'
-when the filter is run on this text. It should, however, '..' the next line
-. The previous . should become .. in the output file, or so I hope...
-
-.
-..
-...
-....
-
-Once this text is decoded again, the above set of dots should look like:
-
- .
- ..
- ...
- ....
-
-Only it shouldn't be indented, obviously.
-
-Jeff \ No newline at end of file
diff --git a/camel/tests/mime-filter/crlf-1.out b/camel/tests/mime-filter/crlf-1.out
deleted file mode 100644
index c0b688f334..0000000000
--- a/camel/tests/mime-filter/crlf-1.out
+++ /dev/null
@@ -1,19 +0,0 @@
-This is some text to filter and stuff. Hopefully that . will not become '..'
-when the filter is run on this text. It should, however, '..' the next line
-.. The previous . should become .. in the output file, or so I hope...
-
-..
-...
-....
-.....
-
-Once this text is decoded again, the above set of dots should look like:
-
- .
- ..
- ...
- ....
-
-Only it shouldn't be indented, obviously.
-
-Jeff \ No newline at end of file
diff --git a/camel/tests/mime-filter/data/html.0.in b/camel/tests/mime-filter/data/html.0.in
deleted file mode 100644
index 217f85b4ff..0000000000
--- a/camel/tests/mime-filter/data/html.0.in
+++ /dev/null
@@ -1,10 +0,0 @@
-
-College of Engineering Students,
-
-We are contacting you to request that you consider nominating a College
-of Engineering faculty member for the College's 2003 Excellence in
-Teaching Award. The award criteria and nomination form are attached.
-They can also be found on the web at:
-
- <http://www.ce.udel.edu/teaching_award.html>
- <http://www.ce.udel.edu/nomination_form.html>
diff --git a/camel/tests/mime-filter/data/html.0.out b/camel/tests/mime-filter/data/html.0.out
deleted file mode 100644
index 3f19310dd4..0000000000
--- a/camel/tests/mime-filter/data/html.0.out
+++ /dev/null
@@ -1,10 +0,0 @@
-
-College of Engineering Students,
-
-We are contacting you to request that you consider nominating a College
-of Engineering faculty member for the College's 2003 Excellence in
-Teaching Award. The award criteria and nomination form are attached.
-They can also be found on the web at:
-
-&#9;&lt;<a href="http://www.ce.udel.edu/teaching_award.html">http://www.ce.udel.edu/teaching_award.html</a>&gt;
-&#9;&lt;<a href="http://www.ce.udel.edu/nomination_form.html">http://www.ce.udel.edu/nomination_form.html</a>&gt;
diff --git a/camel/tests/mime-filter/data/html.1.in b/camel/tests/mime-filter/data/html.1.in
deleted file mode 100644
index 8dece6113d..0000000000
--- a/camel/tests/mime-filter/data/html.1.in
+++ /dev/null
@@ -1,10 +0,0 @@
-
-College of Engineering Students,
-
-We are contacting you to request that you consider nominating a College
-of Engineering faculty member for the College's 2003 Excellence in
-Teaching Award. The award criteria and nomination form are attached.
-They can also be found on the web at:
-
- <http://www.ce.udel.edu/teaching_award.html>
- <http://www.ce.udel.edu/nomination_form.html> \ No newline at end of file
diff --git a/camel/tests/mime-filter/data/html.1.out b/camel/tests/mime-filter/data/html.1.out
deleted file mode 100644
index 71a977e7ff..0000000000
--- a/camel/tests/mime-filter/data/html.1.out
+++ /dev/null
@@ -1,10 +0,0 @@
-
-College of Engineering Students,
-
-We are contacting you to request that you consider nominating a College
-of Engineering faculty member for the College's 2003 Excellence in
-Teaching Award. The award criteria and nomination form are attached.
-They can also be found on the web at:
-
-&#9;&lt;<a href="http://www.ce.udel.edu/teaching_award.html">http://www.ce.udel.edu/teaching_award.html</a>&gt;
-&#9;&lt;<a href="http://www.ce.udel.edu/nomination_form.html">http://www.ce.udel.edu/nomination_form.html</a>&gt; \ No newline at end of file
diff --git a/camel/tests/mime-filter/test-charset.c b/camel/tests/mime-filter/test-charset.c
deleted file mode 100644
index 301cf3b2b7..0000000000
--- a/camel/tests/mime-filter/test-charset.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- test-crlf.c
-
- Test the CamelMimeFilterCharset class
-*/
-
-#include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#include <dirent.h>
-
-#include "camel-test.h"
-
-#include <camel/camel-stream-fs.h>
-#include <camel/camel-stream-mem.h>
-#include <camel/camel-stream-filter.h>
-#include <camel/camel-mime-filter-charset.h>
-
-#define d(x) x
-
-#define CHUNK_SIZE 4096
-
-int
-main (int argc, char **argv)
-{
- ssize_t comp_progress, comp_correct_chunk, comp_filter_chunk;
- char comp_correct[CHUNK_SIZE], comp_filter[CHUNK_SIZE];
- CamelStream *source;
- CamelStream *correct;
- CamelStreamFilter *filter;
- CamelMimeFilter *f;
- struct dirent *dent;
- int i, test = 0;
- DIR *dir;
-
- camel_test_init(argc, argv);
-
- dir = opendir (SOURCEDIR);
-
- while ((dent = readdir (dir))) {
- char *outfile, *charset, *work;
- const char *ext;
-
- ext = strrchr (dent->d_name, '.');
- if (!(!strncmp (dent->d_name, "charset-", 8) && ext && !strcmp (ext, ".in")))
- continue;
-
- work = g_strdup_printf ("Charset filter, test case %d (%s)", test++, dent->d_name);
- camel_test_start (work);
- g_free (work);
-
- if (!(source = camel_stream_fs_new_with_name (dent->d_name, 0, O_RDONLY))) {
- camel_test_fail ("Failed to open input case in \"%s\"", dent->d_name);
- continue;
- }
-
- outfile = g_strdup_printf ("%.*s.out", ext - dent->d_name, dent->d_name);
-
- if (!(correct = camel_stream_fs_new_with_name (outfile, 0, O_RDONLY))) {
- camel_test_fail ("Failed to open correct output in \"%s\"", outfile);
- g_free (outfile);
- continue;
- }
- g_free (outfile);
-
- if (!(filter = camel_stream_filter_new_with_stream (CAMEL_STREAM (source)))) {
- camel_test_fail ("Couldn't create CamelStreamFilter??");
- continue;
- }
-
- charset = g_strdup (dent->d_name + 8);
- ext = strchr (charset, '.');
- *((char *) ext) = '\0';
-
- if (!(f = (CamelMimeFilter *) camel_mime_filter_charset_new_convert (charset, "UTF-8"))) {
- camel_test_fail ("Couldn't create CamelMimeFilterCharset??");
- g_free (charset);
- continue;
- }
- g_free (charset);
-
- camel_stream_filter_add (filter, f);
- camel_object_unref (f);
-
- camel_test_push ("Running filter and comparing to correct result");
-
- comp_progress = 0;
-
- while (1) {
- comp_correct_chunk = camel_stream_read (correct, comp_correct, CHUNK_SIZE);
- comp_filter_chunk = 0;
-
- if (comp_correct_chunk == 0)
- break;
-
- while (comp_filter_chunk < comp_correct_chunk) {
- ssize_t delta;
-
- delta = camel_stream_read (CAMEL_STREAM (filter),
- comp_filter + comp_filter_chunk,
- CHUNK_SIZE - comp_filter_chunk);
-
- if (delta == 0) {
- camel_test_fail ("Chunks are different sizes: correct is %d, "
- "filter is %d, %d bytes into stream",
- comp_correct_chunk, comp_filter_chunk, comp_progress);
- }
-
- comp_filter_chunk += delta;
- }
-
- for (i = 0; i < comp_filter_chunk; i++) {
- if (comp_correct[i] != comp_filter[i]) {
- camel_test_fail ("Difference: correct is %c, filter is %c, "
- "%d bytes into stream",
- comp_correct[i],
- comp_filter[i],
- comp_progress + i);
- }
- }
-
- comp_progress += comp_filter_chunk;
- }
-
- camel_test_pull ();
-
- /* inefficient */
- camel_test_push ("Cleaning up");
- camel_object_unref (CAMEL_OBJECT (filter));
- camel_object_unref (CAMEL_OBJECT (correct));
- camel_object_unref (CAMEL_OBJECT (source));
- camel_test_pull ();
-
- camel_test_end ();
- }
-
- closedir (dir);
-
- return 0;
-}
diff --git a/camel/tests/mime-filter/test-crlf.c b/camel/tests/mime-filter/test-crlf.c
deleted file mode 100644
index bbf443be09..0000000000
--- a/camel/tests/mime-filter/test-crlf.c
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- test-crlf.c
-
- Test the CamelMimeFilterCrlf class
-*/
-
-#include <stdio.h>
-#include <string.h>
-
-#include "camel-test.h"
-
-#include <camel/camel-stream-fs.h>
-#include <camel/camel-stream-mem.h>
-#include <camel/camel-stream-filter.h>
-#include <camel/camel-mime-filter-crlf.h>
-
-#define d(x) x
-
-#define NUM_CASES 1
-#define CHUNK_SIZE 4096
-
-enum {
- CRLF_ENCODE,
- CRLF_DECODE,
- CRLF_DONE
-};
-
-int
-main (int argc, char **argv)
-{
- CamelStream *source;
- CamelStream *correct;
- CamelStreamFilter *filter;
- CamelMimeFilter *sh;
- char *work;
- int i;
- ssize_t comp_progress, comp_correct_chunk, comp_filter_chunk;
- int comp_i;
- char comp_correct[CHUNK_SIZE], comp_filter[CHUNK_SIZE];
-
- camel_test_init(argc, argv);
-
- for (i = 0; i < NUM_CASES; i++) {
- int j;
-
- work = g_strdup_printf ("CRLF/DOT filter, test case %d", i);
- camel_test_start (work);
- g_free (work);
-
- for (j = CRLF_ENCODE; j < CRLF_DONE; j++) {
- CamelMimeFilterCRLFDirection direction;
- char *infile = NULL, *outfile = NULL;
-
- switch (j) {
- case CRLF_ENCODE:
- camel_test_push ("Test of the encoder");
- direction = CAMEL_MIME_FILTER_CRLF_ENCODE;
- infile = g_strdup_printf ("%s/crlf-%d.in", SOURCEDIR, i + 1);
- outfile = g_strdup_printf ("%s/crlf-%d.out", SOURCEDIR, i + 1);
- break;
- case CRLF_DECODE:
- camel_test_push ("Test of the decoder");
- direction = CAMEL_MIME_FILTER_CRLF_DECODE;
- infile = g_strdup_printf ("%s/crlf-%d.out", SOURCEDIR, i + 1);
- outfile = g_strdup_printf ("%s/crlf-%d.in", SOURCEDIR, i + 1);
- break;
- default:
- break;
- }
-
- camel_test_push ("Initializing objects");
- source = camel_stream_fs_new_with_name (infile, 0, O_RDONLY);
- if (!source) {
- camel_test_fail ("Failed to open input case in \"%s\"", infile);
- g_free (infile);
- continue;
- }
- g_free (infile);
-
- correct = camel_stream_fs_new_with_name (outfile, 0, O_RDONLY);
- if (!correct) {
- camel_test_fail ("Failed to open correct output in \"%s\"", outfile);
- g_free (outfile);
- continue;
- }
- g_free (outfile);
-
- filter = camel_stream_filter_new_with_stream (CAMEL_STREAM (source));
- if (!filter) {
- camel_test_fail ("Couldn't create CamelStreamFilter??");
- continue;
- }
-
- sh = camel_mime_filter_crlf_new (direction, CAMEL_MIME_FILTER_CRLF_MODE_CRLF_DOTS);
- if (!sh) {
- camel_test_fail ("Couldn't create CamelMimeFilterCrlf??");
- continue;
- }
-
- camel_stream_filter_add (filter, sh);
- camel_test_pull ();
-
- camel_test_push ("Running filter and comparing to correct result");
-
- comp_progress = 0;
-
- while (1) {
- comp_correct_chunk = camel_stream_read (correct, comp_correct, CHUNK_SIZE);
- comp_filter_chunk = 0;
-
- if (comp_correct_chunk == 0)
- break;
-
- while (comp_filter_chunk < comp_correct_chunk) {
- ssize_t delta;
-
- delta = camel_stream_read (CAMEL_STREAM (filter),
- comp_filter + comp_filter_chunk,
- CHUNK_SIZE - comp_filter_chunk);
-
- if (delta == 0) {
- camel_test_fail ("Chunks are different sizes: correct is %d, "
- "filter is %d, %d bytes into stream",
- comp_correct_chunk, comp_filter_chunk, comp_progress);
- }
-
- comp_filter_chunk += delta;
- }
-
- for (comp_i = 0; comp_i < comp_filter_chunk; comp_i++) {
- if (comp_correct[comp_i] != comp_filter[comp_i]) {
- camel_test_fail ("Difference: correct is %c, filter is %c, "
- "%d bytes into stream",
- comp_correct[comp_i],
- comp_filter[comp_i],
- comp_progress + comp_i);
- }
- }
-
- comp_progress += comp_filter_chunk;
- }
-
- camel_test_pull ();
-
- /* inefficient */
- camel_test_push ("Cleaning up");
- camel_object_unref (CAMEL_OBJECT (filter));
- camel_object_unref (CAMEL_OBJECT (correct));
- camel_object_unref (CAMEL_OBJECT (source));
- camel_object_unref (CAMEL_OBJECT (sh));
- camel_test_pull ();
-
- camel_test_pull ();
- }
-
- camel_test_end ();
- }
-
- return 0;
-}
diff --git a/camel/tests/mime-filter/test-tohtml.c b/camel/tests/mime-filter/test-tohtml.c
deleted file mode 100644
index 5b7842fefe..0000000000
--- a/camel/tests/mime-filter/test-tohtml.c
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- test-html.c
-
- Test the CamelMimeFilterToHTML class
-*/
-
-#include <sys/stat.h>
-#include <unistd.h>
-
-#include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#include <dirent.h>
-
-#include "camel-test.h"
-
-#include <camel/camel-stream-fs.h>
-#include <camel/camel-stream-mem.h>
-#include <camel/camel-stream-filter.h>
-#include <camel/camel-mime-filter-tohtml.h>
-
-#define d(x) x
-
-#define CHUNK_SIZE 4096
-
-static void
-test_filter(CamelMimeFilter *f, const char *inname, const char *outname)
-{
- CamelStreamMem *in, *out;
- CamelStream *indisk, *outdisk, *filter;
- int id;
-
- camel_test_push("Data file `%s'", inname);
-
- camel_test_push("setup");
-
- indisk = camel_stream_fs_new_with_name(inname, O_RDONLY, 0);
- check(indisk);
- outdisk = camel_stream_fs_new_with_name(outname, O_RDONLY, 0);
- check(outdisk);
-
- out = (CamelStreamMem *)camel_stream_mem_new();
- check(camel_stream_write_to_stream(outdisk, (CamelStream *)out) > 0);
-
- camel_test_pull();
-
- camel_test_push("reading through filter stream");
-
- in = (CamelStreamMem *)camel_stream_mem_new();
-
- filter = (CamelStream *)camel_stream_filter_new_with_stream(indisk);
- check_count(indisk, 2);
- id = camel_stream_filter_add((CamelStreamFilter *)filter, f);
- check_count(f, 2);
-
- check(camel_stream_write_to_stream(filter, (CamelStream *)in) > 0);
- check_msg(in->buffer->len == out->buffer->len
- && memcmp(in->buffer->data, out->buffer->data, in->buffer->len) == 0,
- "Buffer content mismatch, %d != %d, in = '%.*s' != out = '%.*s'", in->buffer->len, out->buffer->len,
- in->buffer->len, in->buffer->data, out->buffer->len, out->buffer->data);
-
- camel_test_pull();
-
- camel_stream_filter_remove((CamelStreamFilter *)filter, id);
- check_count(f, 1);
- camel_mime_filter_reset(f);
-
- check_unref(filter, 1);
- check_count(indisk, 1);
- check_count(f, 1);
- check_unref(in, 1);
-
- check(camel_stream_reset(indisk) == 0);
-
- camel_test_push("writing through filter stream");
-
- in = (CamelStreamMem *)camel_stream_mem_new();
- filter = (CamelStream *)camel_stream_filter_new_with_stream((CamelStream *)in);
- check_count(in, 2);
- id = camel_stream_filter_add((CamelStreamFilter *)filter, f);
- check_count(f, 2);
-
- check(camel_stream_write_to_stream(indisk, filter) > 0);
- check(camel_stream_flush(filter) == 0);
- check_msg(in->buffer->len == out->buffer->len
- && memcmp(in->buffer->data, out->buffer->data, in->buffer->len) == 0,
- "Buffer content mismatch, %d != %d, in = '%.*s' != out = '%.*s'", in->buffer->len, out->buffer->len,
- in->buffer->len, in->buffer->data, out->buffer->len, out->buffer->data);
-
- camel_stream_filter_remove((CamelStreamFilter *)filter, id);
- check_unref(filter, 1);
- check_unref(in, 1);
- check_unref(indisk, 1);
- check_unref(outdisk, 1);
- check_unref(out, 1);
-
- camel_test_pull();
-
- camel_test_pull();
-}
-
-int
-main (int argc, char **argv)
-{
- int i;
-
- camel_test_init(argc, argv);
-
- camel_test_start("HTML Stream filtering");
-
- for (i=0;i<100;i++) {
- char inname[32], outname[32];
- CamelMimeFilter *f;
- struct stat st;
-
- sprintf(inname, "data/html.%d.in", i);
- sprintf(outname, "data/html.%d.out", i);
-
- if (stat(inname, &st) == -1)
- break;
-
- f = camel_mime_filter_tohtml_new(CAMEL_MIME_FILTER_TOHTML_CONVERT_URLS, 0);
-
- test_filter(f, inname, outname);
-
- check_unref(f, 1);
- }
-
- camel_test_end();
-
- return 0;
-}
diff --git a/camel/tests/misc/.cvsignore b/camel/tests/misc/.cvsignore
deleted file mode 100644
index fbb8316a8b..0000000000
--- a/camel/tests/misc/.cvsignore
+++ /dev/null
@@ -1,14 +0,0 @@
-.deps
-Makefile
-Makefile.in
-.libs
-.deps
-*.lo
-*.la
-*.bb
-*.bbg
-*.da
-*.gcov
-split
-url
-utf7 \ No newline at end of file
diff --git a/camel/tests/misc/Makefile.am b/camel/tests/misc/Makefile.am
deleted file mode 100644
index d3ed29f2e6..0000000000
--- a/camel/tests/misc/Makefile.am
+++ /dev/null
@@ -1,27 +0,0 @@
-
-INCLUDES = \
- -I$(includedir) \
- -I$(top_srcdir) \
- -I$(top_srcdir)/intl \
- -I$(top_srcdir)/e-util \
- -I$(top_srcdir)/camel \
- -I$(top_srcdir)/camel/tests/lib \
- -DG_LOG_DOMAIN=\"evolution-tests\" \
- $(CAMEL_CFLAGS)
-
-LDADD = \
- $(top_builddir)/camel/libcamel.la \
- $(top_builddir)/e-util/libeutil.la \
- $(top_builddir)/camel/tests/lib/libcameltest.a \
- $(INTLLIBS) \
- $(EVOLUTION_MAIL_LIBS)
-
-check_PROGRAMS = \
- url \
- utf7 \
- split
-
-TESTS = url utf7 split
-
-
-
diff --git a/camel/tests/misc/README b/camel/tests/misc/README
deleted file mode 100644
index e92f579cf6..0000000000
--- a/camel/tests/misc/README
+++ /dev/null
@@ -1,4 +0,0 @@
-
-url URL parsing
-utf7 UTF7 and UTF8 processing
-split word splitting for searching
diff --git a/camel/tests/misc/split.c b/camel/tests/misc/split.c
deleted file mode 100644
index 254b91974f..0000000000
--- a/camel/tests/misc/split.c
+++ /dev/null
@@ -1,113 +0,0 @@
-#include <config.h>
-
-#include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <glib.h>
-#include <e-util/e-sexp.h>
-#include <camel/camel-exception.h>
-#include <camel/camel-search-private.h>
-
-#include "camel-test.h"
-
-/* TODO: should put utf8 stuff here too */
-
-static struct {
- char *word;
- int count;
- struct {
- char *word;
- int type;
- } splits[5];
-} split_tests[] = {
- { "simple", 1, { { "simple", CAMEL_SEARCH_WORD_SIMPLE } } },
- { "two words", 2, { { "two", CAMEL_SEARCH_WORD_SIMPLE }, {"words" , CAMEL_SEARCH_WORD_SIMPLE } } },
- { "compl;ex", 1, { { "compl;ex", CAMEL_SEARCH_WORD_COMPLEX } } },
- { "compl;ex simple", 2, { { "compl;ex", CAMEL_SEARCH_WORD_COMPLEX} , {"simple", CAMEL_SEARCH_WORD_SIMPLE} } },
- { "\"quoted\"", 1, { { "quoted", CAMEL_SEARCH_WORD_SIMPLE } } },
- { "\"quoted double\"", 1, { { "quoted double", CAMEL_SEARCH_WORD_COMPLEX } } },
- { "\"quoted double\" compl;ex", 2, { { "quoted double", CAMEL_SEARCH_WORD_COMPLEX }, { "compl;ex", CAMEL_SEARCH_WORD_COMPLEX } } },
- { "\"quoted double \\\" escaped\"", 1, { { "quoted double \" escaped", CAMEL_SEARCH_WORD_COMPLEX } } },
- { "\"quoted\\\"double\" \\\" escaped\\\"", 3, { { "quoted\"double", CAMEL_SEARCH_WORD_COMPLEX }, {"\"", CAMEL_SEARCH_WORD_COMPLEX}, { "escaped\"", CAMEL_SEARCH_WORD_COMPLEX } } },
- { "\\\"escaped", 1, { { "\"escaped", CAMEL_SEARCH_WORD_COMPLEX } } },
-
-};
-#define SPLIT_LENGTH (sizeof(split_tests)/sizeof(split_tests[0]))
-
-static struct {
- char *word;
- int count;
- struct {
- char *word;
- int type;
- } splits[5];
-} simple_tests[] = {
- { "simple", 1, { {"simple", CAMEL_SEARCH_WORD_SIMPLE } } },
- { "simpleCaSe", 1, { { "simplecase", CAMEL_SEARCH_WORD_SIMPLE } } },
- { "two words", 2, { { "two", CAMEL_SEARCH_WORD_SIMPLE }, { "words", CAMEL_SEARCH_WORD_SIMPLE } } },
- { "two wordscAsE", 2, { { "two", CAMEL_SEARCH_WORD_SIMPLE} , { "wordscase", CAMEL_SEARCH_WORD_SIMPLE } } },
- { "compl;ex", 2, { { "compl", CAMEL_SEARCH_WORD_SIMPLE }, { "ex", CAMEL_SEARCH_WORD_SIMPLE } } },
- { "compl;ex simple", 3, { { "compl", CAMEL_SEARCH_WORD_SIMPLE }, { "ex", CAMEL_SEARCH_WORD_SIMPLE }, { "simple", CAMEL_SEARCH_WORD_SIMPLE } } },
- { "\"quoted compl;ex\" simple", 4, { { "quoted", CAMEL_SEARCH_WORD_SIMPLE}, { "compl", CAMEL_SEARCH_WORD_SIMPLE }, { "ex", CAMEL_SEARCH_WORD_SIMPLE }, { "simple", CAMEL_SEARCH_WORD_SIMPLE } } },
- { "\\\" \"quoted\"compl;ex\" simple", 4, { { "quoted", CAMEL_SEARCH_WORD_SIMPLE}, { "compl", CAMEL_SEARCH_WORD_SIMPLE }, { "ex", CAMEL_SEARCH_WORD_SIMPLE }, { "simple", CAMEL_SEARCH_WORD_SIMPLE } } },
-};
-
-#define SIMPLE_LENGTH (sizeof(simple_tests)/sizeof(simple_tests[0]))
-
-int
-main (int argc, char **argv)
-{
- int i, j;
- struct _camel_search_words *words, *tmp;
-
- camel_test_init(argc, argv);
-
- camel_test_start("Search splitting");
-
- for (i=0; i<SPLIT_LENGTH; i++) {
- camel_test_push("split %d '%s'", i, split_tests[i].word);
-
- words = camel_search_words_split(split_tests[i].word);
- check(words != NULL);
- check_msg(words->len == split_tests[i].count, "words->len = %d, count = %d", words->len, split_tests[i].count);
-
- for (j=0;j<words->len;j++) {
- check_msg(strcmp(split_tests[i].splits[j].word, words->words[j]->word) == 0,
- "'%s' != '%s'", split_tests[i].splits[j].word, words->words[j]->word);
- check(split_tests[i].splits[j].type == words->words[j]->type);
- }
-
- camel_search_words_free(words);
- camel_test_pull();
- }
-
- camel_test_end();
-
- camel_test_start("Search splitting - simple");
-
- for (i=0; i<SIMPLE_LENGTH; i++) {
- camel_test_push("simple split %d '%s'", i, simple_tests[i].word);
-
- tmp = camel_search_words_split(simple_tests[i].word);
- check(tmp != NULL);
-
- words = camel_search_words_simple(tmp);
- check(words != NULL);
- check_msg(words->len == simple_tests[i].count, "words->len = %d, count = %d", words->len, simple_tests[i].count);
-
- for (j=0;j<words->len;j++) {
- check_msg(strcmp(simple_tests[i].splits[j].word, words->words[j]->word) == 0,
- "'%s' != '%s'", simple_tests[i].splits[j].word, words->words[j]->word);
- check(simple_tests[i].splits[j].type == words->words[j]->type);
- }
-
- camel_search_words_free(words);
- camel_search_words_free(tmp);
- camel_test_pull();
- }
-
- camel_test_end();
-
- return 0;
-}
diff --git a/camel/tests/misc/url.c b/camel/tests/misc/url.c
deleted file mode 100644
index c2db806621..0000000000
--- a/camel/tests/misc/url.c
+++ /dev/null
@@ -1,123 +0,0 @@
-#include <config.h>
-
-#include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <camel/camel-url.h>
-#include <camel/camel-exception.h>
-
-#include "camel-test.h"
-
-char *base = "http://a/b/c/d;p?q#f";
-
-struct {
- char *url_string, *result;
-} tests[] = {
- { "g:h", "g:h" },
- { "g", "http://a/b/c/g" },
- { "./g", "http://a/b/c/g" },
- { "g/", "http://a/b/c/g/" },
- { "/g", "http://a/g" },
- { "//g", "http://g" },
- { "?y", "http://a/b/c/d;p?y" },
- { "g?y", "http://a/b/c/g?y" },
- { "g?y/./x", "http://a/b/c/g?y/./x" },
- { "#s", "http://a/b/c/d;p?q#s" },
- { "g#s", "http://a/b/c/g#s" },
- { "g#s/./x", "http://a/b/c/g#s/./x" },
- { "g?y#s", "http://a/b/c/g?y#s" },
- { ";x", "http://a/b/c/d;x" },
- { "g;x", "http://a/b/c/g;x" },
- { "g;x?y#s", "http://a/b/c/g;x?y#s" },
- { ".", "http://a/b/c/" },
- { "./", "http://a/b/c/" },
- { "..", "http://a/b/" },
- { "../", "http://a/b/" },
- { "../g", "http://a/b/g" },
- { "../..", "http://a/" },
- { "../../", "http://a/" },
- { "../../g", "http://a/g" },
- { "", "http://a/b/c/d;p?q#f" },
- { "../../../g", "http://a/../g" },
- { "../../../../g", "http://a/../../g" },
- { "/./g", "http://a/./g" },
- { "/../g", "http://a/../g" },
- { "g.", "http://a/b/c/g." },
- { ".g", "http://a/b/c/.g" },
- { "g..", "http://a/b/c/g.." },
- { "..g", "http://a/b/c/..g" },
- { "./../g", "http://a/b/g" },
- { "./g/.", "http://a/b/c/g/" },
- { "g/./h", "http://a/b/c/g/h" },
- { "g/../h", "http://a/b/c/h" },
- { "http:g", "http:g" },
- { "http:", "http:" },
-
- /* (not from rfc 1808) */
- { "sendmail:", "sendmail:" },
- { "mbox:/var/mail/user", "mbox:/var/mail/user" },
- { "pop://user@host", "pop://user@host" },
- { "pop://user@host:99", "pop://user@host:99" },
- { "pop://user:password@host", "pop://user:password@host" },
- { "pop://user:password@host:99", "pop://user:password@host:99" },
- { "pop://user;auth=APOP@host", "pop://user;auth=APOP@host" },
- { "pop://user@host/;keep_on_server", "pop://user@host/;keep_on_server" },
- { "pop://user@host/;keep_on_server=1", "pop://user@host/;keep_on_server=1" },
- { "pop://us%65r@host", "pop://user@host" },
- { "pop://us%40r@host", "pop://us%40r@host" },
- { "pop://us%3ar@host", "pop://us%3ar@host" },
- { "pop://us%2fr@host", "pop://us%2fr@host" }
-};
-int num_tests = sizeof (tests) / sizeof (tests[0]);
-
-int
-main (int argc, char **argv)
-{
- CamelURL *base_url, *url;
- CamelException ex;
- char *url_string;
- int i;
-
- camel_test_init (argc, argv);
-
- camel_test_start ("URL parsing");
-
- camel_test_push ("base URL parsing");
- camel_exception_init (&ex);
- base_url = camel_url_new (base, &ex);
- if (!base_url) {
- camel_test_fail ("Could not parse %s: %s\n", base,
- camel_exception_get_description (&ex));
- }
- camel_test_pull ();
-
- camel_test_push ("base URL unparsing");
- url_string = camel_url_to_string (base_url, 0);
- if (strcmp (url_string, base) != 0) {
- camel_test_fail ("URL <%s> unparses to <%s>\n",
- base, url_string);
- }
- camel_test_pull ();
- g_free (url_string);
-
- for (i = 0; i < num_tests; i++) {
- camel_test_push ("<%s> + <%s> = <%s>?", base, tests[i].url_string, tests[i].result);
- url = camel_url_new_with_base (base_url, tests[i].url_string);
- if (!url) {
- camel_test_fail ("could not parse");
- camel_test_pull ();
- continue;
- }
-
- url_string = camel_url_to_string (url, 0);
- if (strcmp (url_string, tests[i].result) != 0)
- camel_test_fail ("got <%s>!", url_string);
- g_free (url_string);
- camel_test_pull ();
- }
-
- camel_test_end ();
-
- return 0;
-}
diff --git a/camel/tests/misc/utf7.c b/camel/tests/misc/utf7.c
deleted file mode 100644
index dec0f4b7e5..0000000000
--- a/camel/tests/misc/utf7.c
+++ /dev/null
@@ -1,106 +0,0 @@
-#include <config.h>
-
-#include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <glib.h>
-#include <camel/camel-utf8.h>
-#include <camel/camel-exception.h>
-
-#include "camel-test.h"
-
-static struct {
- unsigned char *utf8;
- char *utf7;
- guint32 unicode[200];
-} tests[] = {
- /* the escape char */
- { "&", "&-",
- { 0x0026, } },
- /* part of set D */
- { "+", "+",
- { 0x002b, } },
- { "plain ascii text", "plain ascii text",
- { 0x0070, 0x006c, 0x0061, 0x0069, 0x006e, 0x0020, 0x0061, 0x0073, 0x0063, 0x0069, 0x0069, 0x0020, 0x0074, 0x0065, 0x0078, 0x0074, } },
- /* part of set O */
- { "'(),-./:?", "'(),-./:?",
- { 0x0027, 0x0028, 0x0029, 0x002c, 0x002d, 0x002e, 0x002f, 0x003a, 0x003f, } },
- { "!\"#$%*+-;<=>@[]^_`{|}", "!\"#$%*+-;<=>@[]^_`{|}",
- { 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x002a, 0x002b, 0x002d, 0x003b, 0x003c, 0x003d, 0x003e, 0x0040, 0x005b, 0x005d, 0x005e, 0x005f, 0x0060, 0x007b, 0x007c, 0x007d, } },
- /* example strings from rfc1642 (modified for imap utf7) */
- { "A\xe2\x89\xa2\xce\x91" ".", "A&ImIDkQ-.",
- { 0x0041, 0x2262, 0x0391, 0x002e, } },
- { "Hi Mum \xe2\x98\xba!", "Hi Mum &Jjo-!",
- { 0x0048, 0x0069, 0x0020, 0x004d, 0x0075, 0x006d, 0x0020, 0x263a, 0x0021, } },
- { "\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e", "&ZeVnLIqe-",
- { 0x65e5, 0x672c, 0x8a9e, } },
- { "Item 3 is \xc2\xa3" "1.", "Item 3 is &AKM-1.",
- { 0x0049, 0x0074, 0x0065, 0x006d, 0x0020, 0x0033, 0x0020, 0x0069, 0x0073, 0x0020, 0x00a3, 0x0031, 0x002e, } },
- { "\"The sayings of Confucius,\" James R. Ware, trans. \xe5\x8f\xb0\xe5\x8c\x97:\xe6\x96\x87\xe8\x87\xb4\xe5\x87\xba\xe7\x89\x88\xe7\xa4\xbe, 1980. (Chinese text with English translation)\xe5\x9b\x9b\xe6\x9b\xb8\xe4\xba\x94\xe7\xb6\x93, \xe5\xae\x8b\xe5\x85\x83\xe4\xba\xba\xe6\xb3\xa8, \xe5\x8c\x97\xe4\xba\xac: \xe4\xb8\xad\xe5\x9c\x8b\xe6\x9b\xb8\xe5\xba\x97, 1990.",
- "\"The sayings of Confucius,\" James R. Ware, trans. &U,BTFw-:&ZYeB9FH6ckh5Pg-, 1980. (Chinese text with English translation)&Vttm+E6UfZM-, &W4tRQ066bOg-, &UxdOrA-: &Ti1XC2b4Xpc-, 1990.",
- { 0x0022, 0x0054, 0x0068, 0x0065, 0x0020, 0x0073, 0x0061, 0x0079, 0x0069, 0x006e, 0x0067, 0x0073, 0x0020, 0x006f, 0x0066, 0x0020, 0x0043, 0x006f, 0x006e, 0x0066, 0x0075, 0x0063, 0x0069, 0x0075, 0x0073, 0x002c, 0x0022, 0x0020, 0x004a, 0x0061, 0x006d, 0x0065, 0x0073, 0x0020, 0x0052, 0x002e, 0x0020, 0x0057, 0x0061, 0x0072, 0x0065, 0x002c, 0x0020, 0x0074, 0x0072, 0x0061, 0x006e, 0x0073, 0x002e, 0x0020, 0x0020, 0x53f0, 0x5317, 0x003a, 0x6587, 0x81f4, 0x51fa, 0x7248, 0x793e, 0x002c, 0x0020, 0x0031, 0x0039, 0x0038, 0x0030, 0x002e, 0x0020, 0x0020, 0x0028, 0x0043, 0x0068, 0x0069, 0x006e, 0x0065, 0x0073, 0x0065, 0x0020, 0x0074, 0x0065, 0x0078, 0x0074, 0x0020, 0x0077, 0x0069, 0x0074, 0x0068, 0x0020, 0x0045, 0x006e, 0x0067, 0x006c, 0x0069, 0x0073, 0x0068, 0x0020, 0x0074, 0x0072, 0x0061, 0x006e, 0x0073, 0x006c, 0x0061, 0x0074, 0x0069, 0x006f, 0x006e, 0x0029, 0x56db, 0x66f8, 0x4e94, 0x7d93, 0x002c, 0x0020, 0x5b8b, 0x5143, 0x4eba, 0x6ce8, 0x002c, 0x0020, 0x5317, 0x4eac, 0x003a, 0x0020, 0x0020, 0x4e2d, 0x570b, 0x66f8, 0x5e97, 0x002c, 0x0020, 0x0031, 0x0039, 0x0039, 0x0030, 0x002e, } },
-};
-#define TESTS_LENGTH (sizeof(tests)/sizeof(tests[0]))
-
-int
-main (int argc, char **argv)
-{
- char *utf8, *utf7, *p;
- int i, j;
- guint32 u;
- char utf8enc[256];
- GString *out;
-
- camel_test_init(argc, argv);
-
- out = g_string_new("");
-
- camel_test_start("UTF8, UTF7 RFC1642+RFC2060");
-
- for (i=0; i<TESTS_LENGTH; i++) {
-
- camel_test_push("%2d: %s utf8 decode", i, tests[i].utf7);
- p = tests[i].utf8;
- j = 0;
- do {
- u = camel_utf8_getc((const unsigned char **)&p);
- check(u == tests[i].unicode[j]);
- j++;
- } while (u);
- camel_test_pull();
-
- camel_test_push("%2d: %s utf7->utf8", i, tests[i].utf7);
- utf8 = camel_utf7_utf8(tests[i].utf7);
- check_msg(strcmp(utf8, tests[i].utf8) == 0, "utf8 = '%s'", utf8);
- camel_test_pull();
-
- camel_test_push("%2d: %s utf7->utf8->utf7", i, tests[i].utf7);
- utf7 = camel_utf8_utf7(utf8);
- check_msg(strcmp(utf7, tests[i].utf7) == 0, "utf7 = '%s'", utf7);
- camel_test_pull();
-
- g_free(utf7);
- g_free(utf8);
-
- camel_test_push("%2d: %s utf8 encode", i, tests[i].utf7);
-
- g_string_truncate(out, 0);
- p = utf8enc;
- j = 0;
- do {
- u = tests[i].unicode[j++];
- camel_utf8_putc((unsigned char **)&p, u);
- g_string_append_u(out, u);
- } while (u);
-
- check(strcmp(utf8enc, out->str) == 0);
- check(strcmp(utf8enc, tests[i].utf8) == 0);
-
- camel_test_pull();
- }
-
- camel_test_end();
-
- return 0;
-}
diff --git a/camel/tests/smime/.cvsignore b/camel/tests/smime/.cvsignore
deleted file mode 100644
index c0feca5888..0000000000
--- a/camel/tests/smime/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-.deps
-.libs
-Makefile*
-pgp
-pgp-mime
diff --git a/camel/tests/smime/Makefile.am b/camel/tests/smime/Makefile.am
deleted file mode 100644
index b14d804dc3..0000000000
--- a/camel/tests/smime/Makefile.am
+++ /dev/null
@@ -1,24 +0,0 @@
-
-INCLUDES = \
- -I$(includedir) \
- -I$(top_srcdir) \
- -I$(top_srcdir)/intl \
- -I$(top_srcdir)/e-util \
- -I$(top_srcdir)/camel \
- -I$(top_srcdir)/camel/tests/lib \
- -DG_LOG_DOMAIN=\"evolution-tests\" \
- $(CAMEL_CFLAGS)
-
-LDADD = \
- $(top_builddir)/camel/libcamel.la \
- $(top_builddir)/e-util/libeutil.la \
- $(top_builddir)/camel/tests/lib/libcameltest.a \
- $(INTLLIBS) \
- $(EVOLUTION_MAIL_LIBS)
-
-check_PROGRAMS = \
- pgp
-# pgp-mime
-# pkcs7
-
-TESTS = pgp #pgp-mime pkcs7
diff --git a/camel/tests/smime/README b/camel/tests/smime/README
deleted file mode 100644
index baad91ba00..0000000000
--- a/camel/tests/smime/README
+++ /dev/null
@@ -1,2 +0,0 @@
-pgp PGP test suite
-
diff --git a/camel/tests/smime/pgp-mime.c b/camel/tests/smime/pgp-mime.c
deleted file mode 100644
index 102092679a..0000000000
--- a/camel/tests/smime/pgp-mime.c
+++ /dev/null
@@ -1,214 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/wait.h>
-#include <camel/camel-gpg-context.h>
-#include <camel/camel-multipart-signed.h>
-#include <camel/camel-multipart-encrypted.h>
-#include <camel/camel-mime-part.h>
-#include <camel/camel-stream-mem.h>
-
-#include "camel-test.h"
-#include "session.h"
-
-static char test_msg[] = "Since we need to make sure that\nFrom lines work okay, we should test that"
-"as well as test 8bit chars and other fun stuff? 8bit chars: Draen Kaar\n\nOkay, I guess that covers"
-"the basics at least...\n";
-
-
-#define CAMEL_PGP_SESSION_TYPE (camel_pgp_session_get_type ())
-#define CAMEL_PGP_SESSION(obj) (CAMEL_CHECK_CAST((obj), CAMEL_PGP_SESSION_TYPE, CamelPgpSession))
-#define CAMEL_PGP_SESSION_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_PGP_SESSION_TYPE, CamelPgpSessionClass))
-#define CAMEL_PGP_IS_SESSION(o) (CAMEL_CHECK_TYPE((o), CAMEL_PGP_SESSION_TYPE))
-
-
-typedef struct _CamelPgpSession {
- CamelSession parent_object;
-
-} CamelPgpSession;
-
-typedef struct _CamelPgpSessionClass {
- CamelSessionClass parent_class;
-
-} CamelPgpSessionClass;
-
-
-static char *get_password (CamelSession *session, const char *prompt,
- gboolean reprompt, gboolean secret,
- CamelService *service, const char *item,
- CamelException *ex);
-
-static void
-init (CamelPgpSession *session)
-{
- ;
-}
-
-static void
-class_init (CamelPgpSessionClass *camel_pgp_session_class)
-{
- CamelSessionClass *camel_session_class =
- CAMEL_SESSION_CLASS (camel_pgp_session_class);
-
- /* virtual method override */
- camel_session_class->get_password = get_password;
-}
-
-static CamelType
-camel_pgp_session_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (
- camel_test_session_get_type (),
- "CamelPgpSession",
- sizeof (CamelPgpSession),
- sizeof (CamelPgpSessionClass),
- (CamelObjectClassInitFunc) class_init,
- NULL,
- (CamelObjectInitFunc) init,
- NULL);
- }
-
- return type;
-}
-
-static char *
-get_password (CamelSession *session, const char *prompt, gboolean reprompt, gboolean secret,
- CamelService *service, const char *item, CamelException *ex)
-{
- return g_strdup ("no.secret");
-}
-
-static CamelSession *
-camel_pgp_session_new (const char *path)
-{
- CamelSession *session;
-
- session = CAMEL_SESSION (camel_object_new (CAMEL_PGP_SESSION_TYPE));
-
- camel_session_construct (session, path);
-
- return session;
-}
-
-
-int main (int argc, char **argv)
-{
- CamelSession *session;
- CamelCipherContext *ctx;
- CamelException *ex;
- CamelCipherValidity *valid;
- CamelMimePart *mime_part;
- CamelMultipartSigned *mps;
- CamelMultipartEncrypted *mpe;
- GPtrArray *recipients;
- int ret;
-
- camel_test_init (argc, argv);
-
- /* clear out any camel-test data */
- system ("/bin/rm -rf /tmp/camel-test");
- system ("/bin/mkdir /tmp/camel-test");
- setenv ("GNUPGHOME", "/tmp/camel-test/.gnupg", 1);
-
- /* import the gpg keys */
- if ((ret = system ("gpg < /dev/null > /dev/null 2>&1")) == -1)
- return 77;
- else if (WEXITSTATUS (ret) == 127)
- return 77;
-
- system ("gpg --import ../data/camel-test.gpg.pub > /dev/null 2>&1");
- system ("gpg --import ../data/camel-test.gpg.sec > /dev/null 2>&1");
-
- session = camel_pgp_session_new ("/tmp/camel-test");
-
- ex = camel_exception_new ();
-
- ctx = camel_gpg_context_new (session);
- camel_gpg_context_set_always_trust (CAMEL_GPG_CONTEXT (ctx), TRUE);
-
- camel_test_start ("Test of PGP/MIME functions");
-
- mime_part = camel_mime_part_new ();
- camel_mime_part_set_content (mime_part, test_msg, strlen (test_msg), "text/plain");
- camel_mime_part_set_description (mime_part, "Test of PGP/MIME multipart/signed stuff");
-
- camel_test_push ("PGP/MIME signing");
- mps = camel_multipart_signed_new ();
- camel_multipart_signed_sign (mps, ctx, mime_part, "no.user@no.domain", CAMEL_CIPHER_HASH_SHA1, ex);
- check_msg (!camel_exception_is_set (ex), "%s", camel_exception_get_description (ex));
- camel_test_pull ();
-
- camel_object_unref (mime_part);
- camel_exception_clear (ex);
-
- camel_test_push ("PGP/MIME verify");
- valid = camel_multipart_signed_verify (mps, ctx, ex);
- check_msg (!camel_exception_is_set (ex), "%s", camel_exception_get_description (ex));
- check_msg (camel_cipher_validity_get_valid (valid), "%s", camel_cipher_validity_get_description (valid));
- camel_cipher_validity_free (valid);
- camel_test_pull ();
-
- camel_object_unref (mps);
- camel_exception_clear (ex);
-
- mime_part = camel_mime_part_new ();
- camel_mime_part_set_content (mime_part, test_msg, strlen (test_msg), "text/plain");
- camel_mime_part_set_description (mime_part, "Test of PGP/MIME multipart/encrypted stuff");
-
- camel_test_push ("PGP/MIME encrypt");
- recipients = g_ptr_array_new ();
- g_ptr_array_add (recipients, "no.user@no.domain");
-
- mpe = camel_multipart_encrypted_new ();
- camel_multipart_encrypted_encrypt (mpe, mime_part, ctx, "no.user@no.domain", recipients, ex);
- check_msg (!camel_exception_is_set (ex), "%s", camel_exception_get_description (ex));
- g_ptr_array_free (recipients, TRUE);
- camel_test_pull ();
-
- camel_exception_clear (ex);
- camel_object_unref (mime_part);
-
- camel_test_push ("PGP/MIME decrypt");
- mime_part = camel_multipart_encrypted_decrypt (mpe, ctx, ex);
- check_msg (!camel_exception_is_set (ex), "%s", camel_exception_get_description (ex));
- camel_object_unref (mime_part);
- camel_object_unref (mpe);
- camel_test_pull ();
-
- camel_object_unref (CAMEL_OBJECT (ctx));
- camel_object_unref (CAMEL_OBJECT (session));
-
- camel_test_end ();
-
- return 0;
-}
diff --git a/camel/tests/smime/pgp.c b/camel/tests/smime/pgp.c
deleted file mode 100644
index 81ea6fabdf..0000000000
--- a/camel/tests/smime/pgp.c
+++ /dev/null
@@ -1,246 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors: Jeffrey Stedfast <fejj@ximian.com>
- *
- * Copyright 2003 Ximian, Inc. (www.ximian.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/wait.h>
-#include <camel/camel-gpg-context.h>
-#include <camel/camel-stream-mem.h>
-#include <camel/camel-mime-part.h>
-
-#include "camel-test.h"
-#include "session.h"
-
-#define CAMEL_PGP_SESSION_TYPE (camel_pgp_session_get_type ())
-#define CAMEL_PGP_SESSION(obj) (CAMEL_CHECK_CAST((obj), CAMEL_PGP_SESSION_TYPE, CamelPgpSession))
-#define CAMEL_PGP_SESSION_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_PGP_SESSION_TYPE, CamelPgpSessionClass))
-#define CAMEL_PGP_IS_SESSION(o) (CAMEL_CHECK_TYPE((o), CAMEL_PGP_SESSION_TYPE))
-
-
-typedef struct _CamelPgpSession {
- CamelSession parent_object;
-
-} CamelPgpSession;
-
-typedef struct _CamelPgpSessionClass {
- CamelSessionClass parent_class;
-
-} CamelPgpSessionClass;
-
-
-static char *get_password (CamelSession *session, const char *prompt,
- gboolean reprompt, gboolean secret,
- CamelService *service, const char *item,
- CamelException *ex);
-
-static void
-init (CamelPgpSession *session)
-{
- ;
-}
-
-static void
-class_init (CamelPgpSessionClass *camel_pgp_session_class)
-{
- CamelSessionClass *camel_session_class =
- CAMEL_SESSION_CLASS (camel_pgp_session_class);
-
- /* virtual method override */
- camel_session_class->get_password = get_password;
-}
-
-static CamelType
-camel_pgp_session_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (
- camel_test_session_get_type (),
- "CamelPgpSession",
- sizeof (CamelPgpSession),
- sizeof (CamelPgpSessionClass),
- (CamelObjectClassInitFunc) class_init,
- NULL,
- (CamelObjectInitFunc) init,
- NULL);
- }
-
- return type;
-}
-
-static char *
-get_password (CamelSession *session, const char *prompt, gboolean reprompt, gboolean secret,
- CamelService *service, const char *item, CamelException *ex)
-{
- return g_strdup ("no.secret");
-}
-
-static CamelSession *
-camel_pgp_session_new (const char *path)
-{
- CamelSession *session;
-
- session = CAMEL_SESSION (camel_object_new (CAMEL_PGP_SESSION_TYPE));
-
- camel_session_construct (session, path);
-
- return session;
-}
-
-
-int main (int argc, char **argv)
-{
- CamelSession *session;
- CamelCipherContext *ctx;
- CamelException *ex;
- CamelCipherValidity *valid;
- CamelStream *stream1, *stream2;
- struct _CamelMimePart *sigpart, *conpart, *encpart, *outpart;
- CamelDataWrapper *dw;
- GPtrArray *recipients;
- GByteArray *buf;
- char *before, *after;
- int ret;
-
- camel_test_init (argc, argv);
-
- /* clear out any camel-test data */
- system ("/bin/rm -rf /tmp/camel-test");
- system ("/bin/mkdir /tmp/camel-test");
- setenv ("GNUPGHOME", "/tmp/camel-test/.gnupg", 1);
-
- /* import the gpg keys */
- if ((ret = system ("gpg < /dev/null > /dev/null 2>&1")) == -1)
- return 77;
- else if (WEXITSTATUS (ret) == 127)
- return 77;
-
- system ("gpg --import ../data/camel-test.gpg.pub > /dev/null 2>&1");
- system ("gpg --import ../data/camel-test.gpg.sec > /dev/null 2>&1");
-
- session = camel_pgp_session_new ("/tmp/camel-test");
-
- ex = camel_exception_new ();
-
- ctx = camel_gpg_context_new (session);
- camel_gpg_context_set_always_trust (CAMEL_GPG_CONTEXT (ctx), TRUE);
-
- camel_test_start ("Test of PGP functions");
-
- stream1 = camel_stream_mem_new ();
- camel_stream_write (stream1, "Hello, I am a test stream.\n", 27);
- camel_stream_reset (stream1);
-
- conpart = camel_mime_part_new();
- dw = camel_data_wrapper_new();
- camel_data_wrapper_construct_from_stream(dw, stream1);
- camel_medium_set_content_object((CamelMedium *)conpart, dw);
- camel_object_unref(stream1);
- camel_object_unref(dw);
-
- sigpart = camel_mime_part_new();
-
- camel_test_push ("PGP signing");
- camel_cipher_sign (ctx, "no.user@no.domain", CAMEL_CIPHER_HASH_SHA1, conpart, sigpart, ex);
- check_msg (!camel_exception_is_set (ex), "%s", camel_exception_get_description (ex));
- camel_test_pull ();
-
- camel_exception_clear (ex);
-
- camel_test_push ("PGP verify");
- valid = camel_cipher_verify (ctx, sigpart, ex);
- check_msg (!camel_exception_is_set (ex), "%s", camel_exception_get_description (ex));
- check_msg (camel_cipher_validity_get_valid (valid), "%s", camel_cipher_validity_get_description (valid));
- camel_cipher_validity_free (valid);
- camel_test_pull ();
-
- camel_object_unref(conpart);
- camel_object_unref(sigpart);
-
- stream1 = camel_stream_mem_new ();
- camel_stream_write (stream1, "Hello, I am a test of encryption/decryption.", 44);
- camel_stream_reset (stream1);
-
- conpart = camel_mime_part_new();
- dw = camel_data_wrapper_new();
- camel_stream_reset(stream1);
- camel_data_wrapper_construct_from_stream(dw, stream1);
- camel_medium_set_content_object((CamelMedium *)conpart, dw);
- camel_object_unref(stream1);
- camel_object_unref(dw);
-
- encpart = camel_mime_part_new();
-
- camel_exception_clear (ex);
-
- camel_test_push ("PGP encrypt");
- recipients = g_ptr_array_new ();
- g_ptr_array_add (recipients, "no.user@no.domain");
- camel_cipher_encrypt (ctx, "no.user@no.domain", recipients, conpart, encpart, ex);
- check_msg (!camel_exception_is_set (ex), "%s", camel_exception_get_description (ex));
- g_ptr_array_free (recipients, TRUE);
- camel_test_pull ();
-
- camel_exception_clear (ex);
-
- camel_test_push ("PGP decrypt");
- outpart = camel_mime_part_new();
- valid = camel_cipher_decrypt (ctx, encpart, outpart, ex);
- check_msg (!camel_exception_is_set (ex), "%s", camel_exception_get_description (ex));
- check_msg (valid->encrypt.status == CAMEL_CIPHER_VALIDITY_ENCRYPT_ENCRYPTED, "%s", valid->encrypt.description);
-
- stream1 = camel_stream_mem_new();
- stream2 = camel_stream_mem_new();
-
- camel_data_wrapper_write_to_stream((CamelDataWrapper *)conpart, stream1);
- camel_data_wrapper_write_to_stream((CamelDataWrapper *)outpart, stream2);
-
- buf = CAMEL_STREAM_MEM (stream1)->buffer;
- before = g_strndup (buf->data, buf->len);
- buf = CAMEL_STREAM_MEM (stream2)->buffer;
- after = g_strndup (buf->data, buf->len);
- check_msg (string_equal (before, after), "before = '%s', after = '%s'", before, after);
- g_free (before);
- g_free (after);
-
- camel_object_unref(stream1);
- camel_object_unref(stream2);
- camel_object_unref(conpart);
- camel_object_unref(encpart);
- camel_object_unref(outpart);
-
- camel_test_pull ();
-
- camel_object_unref (CAMEL_OBJECT (ctx));
- camel_object_unref (CAMEL_OBJECT (session));
-
- camel_test_end ();
-
- return 0;
-}
diff --git a/camel/tests/smime/pkcs7.c b/camel/tests/smime/pkcs7.c
deleted file mode 100644
index 2248d8656d..0000000000
--- a/camel/tests/smime/pkcs7.c
+++ /dev/null
@@ -1,178 +0,0 @@
-#include <config.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <camel/camel-smime-context.h>
-#include <camel/camel-stream-mem.h>
-
-#include "camel-test.h"
-
-
-#define CAMEL_TEST_SESSION_TYPE (camel_test_session_get_type ())
-#define CAMEL_TEST_SESSION(obj) (CAMEL_CHECK_CAST((obj), CAMEL_TEST_SESSION_TYPE, CamelTestSession))
-#define CAMEL_TEST_SESSION_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_TEST_SESSION_TYPE, CamelTestSessionClass))
-#define CAMEL_TEST_IS_SESSION(o) (CAMEL_CHECK_TYPE((o), CAMEL_TEST_SESSION_TYPE))
-
-
-typedef struct _CamelTestSession {
- CamelSession parent_object;
-
-} CamelTestSession;
-
-typedef struct _CamelTestSessionClass {
- CamelSessionClass parent_class;
-
-} CamelTestSessionClass;
-
-
-static char *get_password (CamelSession *session, const char *prompt,
- gboolean secret, CamelService *service,
- const char *item, CamelException *ex);
-
-static void
-init (CamelTestSession *session)
-{
- ;
-}
-
-static void
-class_init (CamelTestSessionClass *camel_test_session_class)
-{
- CamelSessionClass *camel_session_class =
- CAMEL_SESSION_CLASS (camel_test_session_class);
-
- /* virtual method override */
- camel_session_class->get_password = get_password;
-}
-
-static CamelType
-camel_test_session_get_type (void)
-{
- static CamelType type = CAMEL_INVALID_TYPE;
-
- if (type == CAMEL_INVALID_TYPE) {
- type = camel_type_register (
- camel_test_session_get_type (),
- "CamelTestSession",
- sizeof (CamelTestSession),
- sizeof (CamelTestSessionClass),
- (CamelObjectClassInitFunc) class_init,
- NULL,
- (CamelObjectInitFunc) init,
- NULL);
- }
-
- return type;
-}
-
-static char *
-get_password (CamelSession *session, const char *prompt, gboolean secret,
- CamelService *service, const char *item, CamelException *ex)
-{
- return g_strdup ("S/MIME v3 is rfc263x, now go and read them.");
-}
-
-static CamelSession *
-camel_test_session_new (const char *path)
-{
- CamelSession *session;
-
- session = CAMEL_SESSION (camel_object_new (CAMEL_TEST_SESSION_TYPE));
-
- camel_session_construct (session, path);
-
- return session;
-}
-
-
-int main (int argc, char **argv)
-{
- CamelSession *session;
- CamelSMimeContext *ctx;
- CamelException *ex;
- CamelCipherValidity *valid;
- CamelStream *stream1, *stream2, *stream3;
- GPtrArray *recipients;
- GByteArray *buf;
- char *before, *after;
-
- camel_test_init (argc, argv);
-
- ex = camel_exception_new ();
-
- /* clear out any camel-test data */
- system ("/bin/rm -rf /tmp/camel-test");
-
- session = camel_test_session_new ("/tmp/camel-test");
-
- ctx = camel_smime_context_new (session);
-
- camel_test_start ("Test of S/MIME PKCS7 functions");
-
- stream1 = camel_stream_mem_new ();
- camel_stream_write (stream1, "Hello, I am a test stream.", 25);
- camel_stream_reset (stream1);
-
- stream2 = camel_stream_mem_new ();
-
- camel_test_push ("PKCS7 signing");
- camel_smime_sign (ctx, "smime@xtorshun.org", CAMEL_CIPHER_HASH_SHA1,
- stream1, stream2, ex);
- check_msg (!camel_exception_is_set (ex), "%s", camel_exception_get_description (ex));
- camel_test_pull ();
-
- camel_exception_clear (ex);
-
- camel_test_push ("PKCS7 verify");
- camel_stream_reset (stream1);
- camel_stream_reset (stream2);
- valid = camel_smime_verify (ctx, CAMEL_CIPHER_HASH_SHA1, stream1, stream2, ex);
- check_msg (!camel_exception_is_set (ex), "%s", camel_exception_get_description (ex));
- check_msg (camel_cipher_validity_get_valid (valid), "%s", camel_cipher_validity_get_description (valid));
- camel_cipher_validity_free (valid);
- camel_test_pull ();
-
- camel_object_unref (CAMEL_OBJECT (stream1));
- camel_object_unref (CAMEL_OBJECT (stream2));
-
- stream1 = camel_stream_mem_new ();
- stream2 = camel_stream_mem_new ();
- stream3 = camel_stream_mem_new ();
-
- camel_stream_write (stream1, "Hello, I am a test of encryption/decryption.", 44);
- camel_stream_reset (stream1);
-
- camel_exception_clear (ex);
-
- camel_test_push ("PKCS7 encrypt");
- recipients = g_ptr_array_new ();
- g_ptr_array_add (recipients, "smime@xtorshun.org");
- camel_smime_encrypt (ctx, FALSE, "smime@xtorshun.org", recipients,
- stream1, stream2, ex);
- check_msg (!camel_exception_is_set (ex), "%s", camel_exception_get_description (ex));
- g_ptr_array_free (recipients, TRUE);
- camel_test_pull ();
-
- camel_stream_reset (stream2);
- camel_exception_clear (ex);
-
- camel_test_push ("PKCS7 decrypt");
- camel_smime_decrypt (ctx, stream2, stream3, ex);
- check_msg (!camel_exception_is_set (ex), "%s", camel_exception_get_description (ex));
- buf = CAMEL_STREAM_MEM (stream1)->buffer;
- before = g_strndup (buf->data, buf->len);
- buf = CAMEL_STREAM_MEM (stream3)->buffer;
- after = g_strndup (buf->data, buf->len);
- check_msg (string_equal (before, after), "before = '%s', after = '%s'", before, after);
- g_free (before);
- g_free (after);
- camel_test_pull ();
-
- camel_object_unref (CAMEL_OBJECT (ctx));
- camel_object_unref (CAMEL_OBJECT (session));
-
- camel_test_end ();
-
- return 0;
-}
diff --git a/camel/tests/stream/.cvsignore b/camel/tests/stream/.cvsignore
deleted file mode 100644
index 36f9336c1d..0000000000
--- a/camel/tests/stream/.cvsignore
+++ /dev/null
@@ -1,14 +0,0 @@
-.deps
-Makefile
-Makefile.in
-.libs
-.deps
-*.lo
-*.la
-*.bb
-*.bbg
-*.da
-*.gcov
-test1
-test2
-test3
diff --git a/camel/tests/stream/Makefile.am b/camel/tests/stream/Makefile.am
deleted file mode 100644
index 25bd84eafd..0000000000
--- a/camel/tests/stream/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-
-INCLUDES = \
- -I$(includedir) \
- -I$(top_srcdir) \
- -I$(top_srcdir)/intl \
- -I$(top_srcdir)/e-util \
- -I$(top_srcdir)/camel \
- -I$(top_srcdir)/camel/tests/lib \
- -DG_LOG_DOMAIN=\"evolution-tests\" \
- $(CAMEL_CFLAGS)
-
-LDADD = \
- $(top_builddir)/camel/libcamel.la \
- $(top_builddir)/e-util/libeutil.la \
- $(top_builddir)/camel/tests/lib/libcameltest.a \
- $(INTLLIBS) \
- $(EVOLUTION_MAIL_LIBS)
-
-check_PROGRAMS = \
- test1 test2 test3
-
-TESTS = test1 test2 test3
-
-
-
diff --git a/camel/tests/stream/README b/camel/tests/stream/README
deleted file mode 100644
index 8ca6a9602d..0000000000
--- a/camel/tests/stream/README
+++ /dev/null
@@ -1,4 +0,0 @@
-
-test1 camelstreamfs, creating, read/write, eos, refcounting
-test2 camelstreammem, creating, read/write, eos, refcounting
-test3 camelseekablesubstream
diff --git a/camel/tests/stream/test1.c b/camel/tests/stream/test1.c
deleted file mode 100644
index 452d45274f..0000000000
--- a/camel/tests/stream/test1.c
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- test ... camelstreamfs */
-
-#include "camel-test.h"
-#include "streams.h"
-
-#include <errno.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#include "camel/camel-stream-fs.h"
-
-int main(int argc, char **argv)
-{
- CamelSeekableStream *ss = NULL;
- int i;
- int fd = -1;
- struct stat st;
- int size;
- char buffer[1024];
-
- camel_test_init(argc, argv);
-
- camel_test_start("CamelStream fs, open, seek, read, write, eos");
- for (i=0;i<2;i++) {
-
- (void)unlink("stream.txt");
-
- push("trying to open a nonexistant stream, method %d", i);
- switch(i) {
- case 0:
- ss = (CamelSeekableStream *)camel_stream_fs_new_with_name("stream.txt", O_RDWR, 0);
- break;
- case 1:
- fd = open("stream.txt", O_RDWR, 0);
- ss = (CamelSeekableStream *)camel_stream_fs_new_with_fd(fd);
- break;
- }
- check(ss == NULL && errno == ENOENT);
- check(stat("stream.txt", &st) == -1 && errno == ENOENT);
- pull();
-
- push("Creating stream using method %d", i);
- switch(i) {
- case 0:
- ss = (CamelSeekableStream *)camel_stream_fs_new_with_name("stream.txt", O_CREAT|O_RDWR|O_TRUNC, 0600);
- fd = ((CamelStreamFs *)ss)->fd;
- break;
- case 1:
- fd = open("stream.txt", O_CREAT|O_RDWR|O_TRUNC, 0600);
- ss = (CamelSeekableStream *)camel_stream_fs_new_with_fd(fd);
- break;
- }
- check(ss != NULL);
- check(stat("stream.txt", &st) == 0 && (st.st_mode&0777) == 0600 && S_ISREG(st.st_mode) && st.st_size == 0);
- pull();
-
- test_stream_seekable_writepart(ss);
- test_stream_seekable_readpart(ss);
-
- push("getting filesize");
- check(stat("stream.txt", &st) == 0 && (st.st_mode&0777) == 0600 && S_ISREG(st.st_mode));
- size = st.st_size;
- pull();
-
- push("checking close closes");
- check_unref(ss, 1);
- check(close(fd) == -1);
- pull();
-
- push("re-opening stream");
- switch(i) {
- case 0:
- ss = (CamelSeekableStream *)camel_stream_fs_new_with_name("stream.txt", O_RDWR, 0);
- fd = ((CamelStreamFs *)ss)->fd;
- break;
- case 1:
- fd = open("stream.txt", O_RDWR, 0);
- ss = (CamelSeekableStream *)camel_stream_fs_new_with_fd(fd);
- break;
- }
- check(ss != NULL);
- check(stat("stream.txt", &st) == 0 && (st.st_mode&0777) == 0600 && S_ISREG(st.st_mode) && st.st_size == size);
-
- test_stream_seekable_readpart(ss);
-
- check_unref(ss, 1);
- check(close(fd) == -1);
- pull();
-
- push("re-opening stream with truncate");
- switch(i) {
- case 0:
- ss = (CamelSeekableStream *)camel_stream_fs_new_with_name("stream.txt", O_RDWR|O_TRUNC, 0);
- fd = ((CamelStreamFs *)ss)->fd;
- break;
- case 1:
- fd = open("stream.txt", O_RDWR|O_TRUNC, 0);
- ss = (CamelSeekableStream *)camel_stream_fs_new_with_fd(fd);
- break;
- }
- check(ss != NULL);
- check(stat("stream.txt", &st) == 0 && (st.st_mode&0777) == 0600 && S_ISREG(st.st_mode) && st.st_size == 0);
-
- /* read has to return 0 before eos is set */
- check(camel_stream_read(CAMEL_STREAM(ss), buffer, 1) == 0);
- check(camel_stream_eos(CAMEL_STREAM(ss)));
-
- check_unref(ss, 1);
- check(close(fd) == -1);
- pull();
-
- (void)unlink("stream.txt");
- }
-
- camel_test_end();
-
- return 0;
-}
diff --git a/camel/tests/stream/test2.c b/camel/tests/stream/test2.c
deleted file mode 100644
index 02ad88e95c..0000000000
--- a/camel/tests/stream/test2.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- test ... camelstreammem */
-
-#include "camel-test.h"
-#include "streams.h"
-
-#include <errno.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#include "camel/camel-stream-mem.h"
-
-int main(int argc, char **argv)
-{
- CamelSeekableStream *ss = NULL;
- int i;
- int fd = -1;
- struct stat st;
- int size;
- char buffer[1024];
- GByteArray *ba;
-
- camel_test_init(argc, argv);
-
- camel_test_start("CamelStream mem, create, seek, read, write, eos");
- for (i=0;i<3;i++) {
-
- push("Creating stream using method %d", i);
- switch(i) {
- case 0:
- ss = (CamelSeekableStream *)camel_stream_mem_new();
- break;
- case 1:
- ba = g_byte_array_new();
- ss = (CamelSeekableStream *)camel_stream_mem_new_with_byte_array(ba);
- break;
- case 2:
- ss = (CamelSeekableStream *)camel_stream_mem_new_with_buffer("", 0);
- break;
- }
- check(ss != NULL);
-
- test_stream_seekable_writepart(ss);
- test_stream_seekable_readpart(ss);
-
- check_unref(ss, 1);
- pull();
- }
-
- camel_test_end();
-
- return 0;
-}
diff --git a/camel/tests/stream/test3.c b/camel/tests/stream/test3.c
deleted file mode 100644
index f85a8ce105..0000000000
--- a/camel/tests/stream/test3.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- test ... camelseekablesubstream */
-
-#include "camel-test.h"
-#include "streams.h"
-
-#include <errno.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#include "camel/camel-stream-mem.h"
-#include "camel/camel-stream-fs.h"
-#include "camel/camel-seekable-substream.h"
-
-#define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))
-
-struct {
- off_t lower, upper;
-} ranges[] = {
- { 3, 10241 },
- { 0, 1024 },
- { 0, 0 },
- { 0, 1 },
- { 0, 2 },
- { 0, 3 },
- { 0, 7 },
- { 1, 8 },
- { 1, 9 },
- { 10245, 10300 },
- { 0, CAMEL_STREAM_UNBOUND },
-/* { 1, CAMEL_STREAM_UNBOUND },
- { 2, CAMEL_STREAM_UNBOUND },
- { 3, CAMEL_STREAM_UNBOUND }, these take too long to run
- { 7, CAMEL_STREAM_UNBOUND },*/
- { 10245, CAMEL_STREAM_UNBOUND },
-};
-
-int main(int argc, char **argv)
-{
- CamelSeekableStream *ss = NULL;
- int i, j;
- CamelSeekableSubstream *sus, *sus2;
-
- camel_test_init(argc, argv);
-
- camel_test_start("CamelSeekableSubstream, mem backing");
- for (j=0;j<SEEKABLE_SUBSTREAM_WAYS;j++) {
- push("testing writing method %d", j);
- ss = (CamelSeekableStream *)camel_stream_mem_new();
- check(ss != NULL);
- for (i=0;i<ARRAY_LEN(ranges);i++) {
- push("stream subrange %d-%d", ranges[i].lower, ranges[i].upper);
- sus = (CamelSeekableSubstream *)camel_seekable_substream_new(ss, ranges[i].lower, ranges[i].upper);
- check(sus != NULL);
-
- test_seekable_substream_writepart((CamelStream *)sus, j);
- test_seekable_substream_readpart((CamelStream *)sus);
-
- sus2 = (CamelSeekableSubstream *)camel_seekable_substream_new(ss, ranges[i].lower, ranges[i].upper);
- check(sus2 != NULL);
- test_seekable_substream_readpart((CamelStream *)sus2);
-
- check_unref(sus, 1);
- check_unref(sus2, 1);
- pull();
- }
- check_unref(ss, 1);
- pull();
- }
-
- camel_test_end();
-
- (void)unlink("stream.txt");
-
- camel_test_start("CamelSeekableSubstream, file backing");
- for (j=0;j<SEEKABLE_SUBSTREAM_WAYS;j++) {
- push("testing writing method %d", j);
- ss = (CamelSeekableStream *)camel_stream_fs_new_with_name("stream.txt", O_RDWR|O_CREAT|O_TRUNC, 0600);
- check(ss != NULL);
- for (i=0;i<ARRAY_LEN(ranges);i++) {
- push("stream subrange %d-%d", ranges[i].lower, ranges[i].upper);
- sus = (CamelSeekableSubstream *)camel_seekable_substream_new(ss, ranges[i].lower, ranges[i].upper);
- check(sus != NULL);
-
- test_seekable_substream_writepart((CamelStream *)sus, j);
- test_seekable_substream_readpart((CamelStream *)sus);
-
- sus2 = (CamelSeekableSubstream *)camel_seekable_substream_new(ss, ranges[i].lower, ranges[i].upper);
- check(sus2 != NULL);
- test_seekable_substream_readpart((CamelStream *)sus2);
-
- check_unref(sus, 1);
- check_unref(sus2, 1);
- pull();
- }
- check_unref(ss, 1);
- (void)unlink("stream.txt");
- pull();
- }
-
- camel_test_end();
-
- return 0;
-}
diff --git a/composer/.cvsignore b/composer/.cvsignore
deleted file mode 100644
index 730f98b91f..0000000000
--- a/composer/.cvsignore
+++ /dev/null
@@ -1,22 +0,0 @@
-.deps
-.libs
-.pure
-evolution-msg-composer
-Makefile
-Makefile.in
-*.lo
-*.la
-Composer-stubs.c
-Composer-skels.c
-Composer-common.c
-Composer.h
-Editor-stubs.c
-Editor-skels.c
-Editor.h
-Editor-common.c
-Evolution-Addressbook-SelectNames-common.c
-Evolution-Addressbook-SelectNames-skels.c
-Evolution-Addressbook-SelectNames-stubs.c
-Evolution-Addressbook-SelectNames.h
-HTMLEditor*.[ch]
-composer-marshal.[ch] \ No newline at end of file
diff --git a/composer/ChangeLog b/composer/ChangeLog
deleted file mode 100644
index 7ba1e67a3a..0000000000
--- a/composer/ChangeLog
+++ /dev/null
@@ -1,399 +0,0 @@
-2003-12-04 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-hdrs.c (create_headers): Unifdef out the post-to
- code and fix it to use the new folder selection button.
- (e_msg_composer_hdrs_set_post_to): Same.
- (e_msg_composer_hdrs_get_post_to): Same.
-
-2003-12-03 Ettore Perazzoli <ettore@ximian.com>
-
- * e-msg-composer-hdrs.c: Do not #include
- <evolution-folder-selector-button.h>.
- (e_msg_composer_hdrs_set_post_to): #if 0 out for now.
- (e_msg_composer_hdrs_get_post_to): Likewise.
-
-2003-12-01 Rodney Dawes <dobey@ximian.com>
-
- * e-msg-composer-hdrs.h: Use BASE_VERSION for repo_ids and OAFIIDs
-
-2003-11-11 Radek Doulik <rodo@ximian.com>
-
- * e-msg-composer.c (e_msg_composer_set_autosaved): new method to
- wrap autosaved flag setting
- (e_msg_composer_unset_autosaved): ditto
- (e_msg_composer_is_autosaved): new method, says if composer was
- autosaved only
- (autosave_save_draft): unset changed so that we don't autosave all
- the time when anything else than gtkhtml control changed
-
-2003-11-06 Radek Doulik <rodo@ximian.com>
-
- * e-msg-composer.c (autosave_save_draft): call gtkhtml's saved
- command to clean is-saved flag, set composer's autosaved flag
- (do_exit): complain if last save was just autosave
- (e_msg_composer_unset_changed): reset autosaved flag
- (save): reset autosaved flag
-
- * e-msg-composer.h: added autosaved flag, it tells whether last
- save was autosave or regular save, when changed flag is reset the
- autosaved one is reset too
-
-2003-11-30 Ettore Perazzoli <ettore@ximian.com>
-
- * e-msg-composer-hdrs.c (create_headers): #if 0 the "post to"
- stuff for now (it requires the global_shell_client and the
- evolution_folder_selector_button which we don't have anymore).
-
-2003-11-26 Chris Toshok <toshok@ximian.com>
-
- * e-msg-composer.c (build_message): switch from just checking
- SMIME_SUPPORTED to checking both HAVE_NSS and SMIME_SUPPORTED.
-
-2003-11-26 JP Rosevear <jpr@ximian.com>
-
- * Makefile.am: turn on deprecated gtk widgets
-
-2003-11-03 Not Zed <NotZed@Ximian.com>
-
- * e-msg-composer.c (build_message): changed to use ciphercontext
- directly to sign the message, no multipart-signed usage.
- (build_message): do the same for multipart/encryption for gpg encrypting.
-
-2003-11-03 Ettore Perazzoli <ettore@ximian.com>
-
- * e-msg-composer-hdrs.h (SELECT_NAMES_OAFIID): Append "_2".
-
-2003-10-31 Not Zed <NotZed@Ximian.com>
-
- * e-msg-composer.c (build_message): fix for e-account smime info
- changes. Also enforce having a signing certificate set in
- preferences before doing any signing.
- (from_changed_cb): handle smime sign/encrypt default for account
- (create_composer): force a from-changed when we start, to properly
- setup signing options.
-
-2003-10-30 Not Zed <NotZed@Ximian.com>
-
- * e-msg-composer.c: Turn on SMIME_SUPPORTED.
- (build_message): move some of the security code around, and fix
- up smime code.
-
-2003-10-08 Chris Toshok <toshok@ximian.com>
-
- * evolution-composer.c (corba_recipientlist_to_destv): EDestination =>
- EABDestination, and e_destination => eab_destination.
- (impl_Composer_set_headers): same.
-
- * e-msg-composer.c (update_auto_recipients): EDestination =>
- EABDestination, and e_destination => eab_destination.
- (e_msg_composer_new_with_message): same.
- (add_recipients): same.
- (handle_mailto): same.
- (e_msg_composer_set_headers): same.
- (e_msg_composer_get_recipients): same.
- (e_msg_composer_get_to): same.
- (e_msg_composer_get_cc): same.
- (e_msg_composer_get_bcc): same.
-
- * e-msg-composer.h: EDestination => EABDestination, and
- e_destination => eab_destination.
-
- * e-msg-composer-hdrs.c (set_recipients_from_destv): EDestination
- => EABDestination, and e_destination => eab_destination.
- (e_msg_composer_hdrs_to_message_internal): same.
- (e_msg_composer_hdrs_set_to): same.
- (e_msg_composer_hdrs_set_cc): same.
- (e_msg_composer_hdrs_set_bcc): same.
- (e_msg_composer_hdrs_get_to): same.
- (e_msg_composer_hdrs_get_cc): same.
- (e_msg_composer_hdrs_get_bcc): same.
- (e_msg_composer_hdrs_get_recipients): same.
-
- * e-msg-composer-hdrs.h: EDestination => EABDestination, and
- e_destination => eab_destination.
-
-2003-09-26 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (save): Don't blindly claim that the file
- exists and then ask the user if he/she would like to overwrite
- it. First check that the file even exists, if not - then we've got
- a different error. Fixes bug #48759.
-
- * e-msg-composer-select-file.c (e_msg_composer_select_file): Use
- the proper selector title, otherwise it says "Attach files" when
- we are trying to save a message.
-
-2003-09-24 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-attachment-bar.c (get_default_charset): Same as
- below.
-
- * e-msg-composer.c (composer_get_default_charset_setting): Handle
- empty-string as the charset value gotten from gconf as this can
- happen. Partial fix for bug #47638.
-
-2003-09-13 Charles Zhang <charles.zhang@sun.com>
-
- * e-msg-composer-attachment-bar.c (remove_attachment): Add some
- assertion. Send Close response signal to the properties dialog
- while removeing an attachment.
- * e-msg-composer-attachment-bar.c (remove_selected): Fix a re-
- remove-attachment bug. [#48466]
-
-2003-09-18 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-attachment-bar.c: updated for
- CamelTransferEncoding namespace changes
-
- * e-msg-composer.c: updated for CamelTransferEncoding namespace
- changes
-
-2003-09-18 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-attachment-bar.c:
- * e-msg-composer-attachment.c:
- * e-msg-composer.c: Updated for namespace changes in Camel.
-
-2003-09-17 Not Zed <NotZed@Ximian.com>
-
- ** Merge in mail-refactor-2-branch
-
-2003-09-15 Ettore Perazzoli <ettore@ximian.com>
-
- * e-msg-composer-hdrs.c (header_new_recipient): Make the entry
- non-focusable again. The right fix for A11Y is to add
- accelerators.
-
-2003-09-11 Federico Mena Quintero <federico@ximian.com>
-
- * e-msg-composer.h (EMsgComposer): Added an entry_uic field for a
- BonoboUIComponent for the non-control entries (e.g. the Subject
- line).
-
- * e-msg-composer.c (create_composer): Set autoactivate to true on
- the HTML control's BonoboControlFrame.
- (setup_ui): Create the composer->entry_uic.
- (destroy): Free the composer->entry_uic.
- (entry_verbs): New array of verbs for the non-control entries.
- Moved the Edit* verbs to here, as they should not be part of the
- main set.
- (composer_entry_focus_in_event_cb): Load
- evolution-composer-entries.xml here for the non-control entries' UI.
- (composer_entry_focus_out_event_cb): Remove the menu items.
-
-2003-09-10 Not Zed <NotZed@Ximian.com>
-
- * listener.c (impl_event): We want to use decode to stream for
- attachment parts.
-
-2003-09-08 Not Zed <NotZed@Ximian.com>
-
- * e-msg-composer.c (autosave_load_draft): ugh, direct linking to
- evolution-mail suckage. Should these callbacks just be handled
- internally?
- (handle_multipart_encrypted, handle_multipart_signed)
- (handle_multipart_alternative, handle_multipart)
- (e_msg_composer_new_with_message): Use new em_utils stuff for
- message formatting.
-
-2003-08-22 Antonio Xu <antonio.xu@sun.com>
-
- * e-msg-composer-attachment.c (): Connect response signal to
- attachment properties dialog, fix bug #47950.
-
-2003-08-21 Antonio Xu <antonio.xu@sun.com>
-
- * Makefile.am (INCLUDES): add EVOLUTION_IMAGESDIR define
- * e-msg-composer.c (create_composer): use EVOLUTION_IMAGESDIR
- and composer icon name to get the path of composer icon.
- [#47781]
-
-2003-08-19 Jeffrey Stedfast <fejj@ximian.com>
-
- * Original patch from David Woodhouse, but modified a bit by me.
-
- * e-msg-composer.c (handle_mailto): Fix insertion of arbitrary
- headers from mailto: links. Ignore From: and Reply-To: headers.
-
-2003-08-13 Lorenzo Gil Sanchez <lgs@sicem.biz>
-
- * e-msg-composer-hdrs.c (account_removed_cb): fixed an insulting
- error message. Fixes bug #47413.
-
-2003-08-13 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-attachment-bar.c (update): This needs to use
- camel_data_wrapper_decode_to_stream() rather than
- write_to_stream(). Also simplify a bit - no sense looping to load
- the pixbuf data into the gdk-pixbuf loader 4K at a time when we
- have the whole thing in a memory buffer already. Once done, unref
- the stream instead of closing it so we don't leak.
- (attach_to_multipart): Use decode_to_stream().
-
- * e-msg-composer-attachment.c (e_msg_composer_attachment_new):
- Avoid constructing thwe data-wrapper from the stream twice for
- message/rfc822 parts.
-
-2003-07-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-attachment-bar.c (attach_to_multipart): don't set
- the rawtext bit anymore.
-
- * e-msg-composer.c (build_message): Convert the plain part's
- content stream from UTF-8 to whatever charset we want.
-
-2003-07-31 Antonio Xu <antonio.xu@sun.com>
-
- * e-msg-composer.c (drag_data_received): add the drop type of
- mozilla browser link to make composer support to handle mozilla
- DnD data. [#47131]
-
-2003-07-28 Antonio Xu <antonio.xu@sun.com>
-
- * e-msg-composer-attachment-bar.c (update): add
- gdk_pixbuf_loader_close to close pix buffer loading. [#45908]
-
-2003-07-25 Larry Ewing <lewing@ximian.com>
-
- * e-msg-composer.c (GNOME_GTKHTML_EDITOR_CONTROL_ID): require the
- new composer control version.
-
-2003-07-17 Michel Daenzer <michel@daenzer.net>
-
- * e-msg-composer.c (autosave_manager_query_load_orphans): Set
- default answer of dialog to 'yes' to try and prevent autosaved
- messages from getting lost accidentally.
-
-2003-07-23 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-attachment-bar.c (attach_to_multipart): Revert my
- previous changes here too.
-
- * e-msg-composer.c (build_message): Revert my previous changes.
-
-2003-07-23 Dan Winship <danw@ximian.com>
-
- * bad-icon.xpm: Remove this. It was only used by e-icon-list,
- which is no longer there.
-
- * composer-marshal.list: Likewise
-
- * Makefile.am: Update
-
-2003-07-21 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (build_message): Init charset to NULL.
-
-2003-07-21 Dan Winship <danw@ximian.com>
-
- * e-msg-composer.c (build_message): Make this work again.
-
-2003-07-17 Maxx Cao <maxx.cao@sun.com>
-
- ** For bug #46013
-
- * e-msg-composer-hdrs.c (header_new_recipient): To/cc/bcc buttons
- made focusable.
-
-2003-07-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-attachment-bar.c (attach_to_multipart): don't set
- the rawtext bit anymore.
-
- * e-msg-composer.c (build_message): Convert the plain part's
- content stream from UTF-8 to whatever charset we want.
-
-2003-07-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-attachment-bar.c (popup_menu_event): Fix warnings
- and other breakage introduced by Maxx.
-
-2002-07-14 Maxx Cao <maxx.cao@sun.com>
-
- ** For bug #45826
-
- * e-msg-composer-attachment-bar.c (class_init): connect the
- "popup_menu" signal, so that S-F10 keybinding will work.
- (popup_menu_event): funcion added to handle "popup_menu" (S-F10 key).
- (popup_menu_placement_callback): function added to place the popup
- menu to the center of attachment icon, in case it is activated by
- keyboard.
-
-2003-07-07 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (e_msg_composer_new_with_message): Updated to
- use camel_strcase_hash/equal.
-
-2003-07-01 Dan Winship <danw@ximian.com>
-
- * e-msg-composer-attachment-bar.c (pixbuf_for_mime_type): Gone.
- (update): Use e_icon_for_mime_type instead.
-
- * Makefile.am (INCLUDES): remove EVOLUTION_IMAGESDIR define
-
-2003-06-25 Antonio Xu <antonio.xu@sun.com>
-
- * e-msg-composer.c (handle_mailto): Change file url to absolute
- path. Fixes bug #44065.
-
-2003-07-01 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (autosave_load_draft): Connect to the
- save-draft signal too. Fixes bug #45531.
-
-2003-06-27 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (build_message): Set the rawtext bits for the
- 'plain' and 'html' data wrappers to FALSE.
-
-2003-06-19 Larry Ewing <lewing@ximian.com>
-
- * listener.c (insert_paragraph_after): free the return value.
- (impl_event): free the return value.
-
-2003-06-17 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (best_encoding): Use e_iconv_open/close so that
- we get charset aliasing for free. Fixes bug #44991.
-
-2003-06-16 Jeffrey Stedfast <fejj@ximian.com>
-
- Fixes bug #44139.
-
- * e-msg-composer-hdrs.c (attach_couple): Set the vertical and
- horizontal padding to 3 always.
- (create_from_optionmenu): Change the hbox spacing to 6 pixels.
-
- * e-msg-composer.c (create_composer): Set the border width around
- the composer's vbox to HIG specification and make the box_spacing
- 6 pixels as well.
-
-2003-06-10 Larry Ewing <lewing@ximian.com>
-
- * e-msg-composer-hdrs.c (e_msg_composer_hdrs_and_string_free):
- free the structure as well.
-
-2003-06-09 Larry Ewing <lewing@ximian.com>
-
- * listener.c (insert_paragraph_before): free the return values.
-
-2003-05-21 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (composer_get_default_charset_setting): Same as
- the rest.
- (setup_ui): We didn't even seem to be using the gconf client
- here. Removed.
- (e_msg_composer_load_config): Unref the gconf client after we're
- finished.
- (e_msg_composer_new): Same.
- (e_msg_composer_new_post): Here too.
- (e_msg_composer_set_view_from): And here.
- (e_msg_composer_set_view_replyto): And here.
- (e_msg_composer_set_view_cc): Here too.
- (e_msg_composer_set_view_bcc): Again here.
-
- * e-msg-composer-hdrs.c (create_from_optionmenu): Same as below.
- (e_msg_composer_hdrs_set_from_account): Here too.
-
- * e-msg-composer-attachment-bar.c (get_default_charset): Unref the
- gconf client.
diff --git a/composer/ChangeLog.pre-1-4 b/composer/ChangeLog.pre-1-4
deleted file mode 100644
index 58f0eebec1..0000000000
--- a/composer/ChangeLog.pre-1-4
+++ /dev/null
@@ -1,4037 +0,0 @@
-2003-05-20 Larry Ewing <lewing@ximian.com>
-
- * e-msg-composer.c (composer_settings_update): set the various
- bonobo properties that are composer preferences.
- (create_composer): add notification of gconf changes.
- (destroy): disconnect notification.
-
- * e-msg-composer.h: keep the gcond notify handler id.
-
-2003-05-15 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-attachment.c (e_msg_composer_attachment_edit):
- Don't connect to the focus-out-event in order to update the
- mime-type. Simply don't update the mime-type ever. Fixes bug
- #42798.
-
-2003-04-28 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (autosave_manager_query_load_orphans): Change
- the "would you like to recover unsaved drafts?" dialog a QUESTION
- dialog rather than an ERROR dialog. Fixes bug #42024.
-
-2003-04-25 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-attachment-bar.c (pixbuf_for_mime_type): If we
- fail to load the icon that gnome_vfs_get_icon() gave us, the
- default back to gnome-unknown.png. This is the only POSSIBLE way
- for Anna to be getting a NULL pixbuf if she has gnome-unknown.png
- that I can see. Should fix bug #41513.
-
-2003-04-23 Not Zed <NotZed@Ximian.com>
-
- * e-msg-composer.c (map_default_cb): removed debug printfs.
-
-2003-04-22 Radek Doulik <rodo@ximian.com>
-
- * e-msg-composer.c (add_attachments_handle_mime_part): added
- related argument, TRUE means that container of mime_part is
- multipart/related
- (add_attachments_handle_mime_part): add images as inline when
- related is TRUE
- (add_attachments_from_multipart): pass related to
- add_attachments_handle_mime_part
-
-2003-04-21 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (add_attachments_handle_mime_part): Don't ever
- attach non-inlined text or message parts. Reverts a prior fix.
-
-2003-04-21 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-attachment.glade: Change the order of the
- ok/cancel buttons.
-
-2003-04-19 Chris Toshok <toshok@ximian.com>
-
- [ fixes #40694 ]
- * e-msg-composer-hdrs.c (create_addressbook_entry): this can't
- hurt - set the frame to autoactivate so if by some chance the
- widget is focused the control will end up being activated.
-
- * e-msg-composer.c (map_default_cb): activate the To: control
- instead of focusing the widget.
-
-2003-04-18 Rodney Dawes <dobey@ximian.com>
-
- * Makefile.am:
- * e-msg-composer.c:
- Use PREFIX instead of EVOLUTION_DATADIR for bonobo_ui_util_set_ui ().
- Fixes bug #21499.
-
-2003-04-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-attachment.c (file_name_focus_out_cb): Return
- FALSE so the signal gets propogated further up the chain. Fixes
- bug #41238.
- (e_msg_composer_attachment_edit): The focus-out-event signal name
- changed (although the old name still works...for now?).
-
-2003-04-11 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-attachment.glade: Updated to comply with the
- HIG. Fixes bug #41239 and bug #41241.
-
-2003-04-09 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (composer_get_default_charset_setting): Use
- e_iconv_locale_charset() instead of e_iconv_locale_name(), dunno
- what I was thinking. locale_name() doesn't even exist.
- (setup_ui): Don't free the default_charset, it's a const char*.
-
- * e-msg-composer-attachment-bar.c (get_default_charset): Same.
-
-2003-04-09 Chris Toshok <toshok@ximian.com>
-
- * e-msg-composer.c (setup_ui): fix build, it's
- composer_get_default_charset_setting.
-
-2003-04-09 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (composer_get_default_charset_setting): Same as
- with attachment-bar's get_default_charset().
- (setup_ui): Instead of pulling the default charset from gconf,
- call our helper function above.
-
- * e-msg-composer-attachment-bar.c (get_default_charset): If gconf
- returns a NULL string, default back to the locale charset.
-
-2003-04-08 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (map_default_cb): Added some debug printfs.
- (create_composer): Call map_default_cb directly instead of having
- it in a "map" callback. Ettore says we shouldn't be doing this
- *shrug*. Still doesn't work tho.
-
-2003-04-07 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #39763 ]
- * e-msg-composer.c (setup_cut_copy_paste): remove the
- control_entry_focus_{in,out}_event_cb signal stuff.
- (control_entry_focus_in_event_cb): nuke
- (control_entry_focus_in_event_cb): same.
-
- * e-msg-composer-hdrs.c (create_addressbook_entry): pass the
- contain to bonobo_widget_new_control_from_objref when creating the
- entries.
-
-2003-04-04 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (autosave_save_draft): If the composer isn't
- 'dirty', then don't autosave the draft (no need to). Fixes bug
- #40764.
-
-2003-04-03 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (menu_edit_select_all_cb): Add a select-all
- callback and verb.
- (composer_entry_focus_in_event_cb): Set our bonobo-ui verbs.
-
-2003-04-02 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-select-file.c (e_msg_composer_select_file): Guard
- against the filesel's selection being NULL. Fixes bug #40679.
-
-2003-04-01 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (composer_entry_focus_in_event_cb): Keep track
- of which entry widget has focus.
- (composer_entry_focus_out_event_cb): Same.
- (control_entry_focus_in_event_cb): Same idea, but since this is in
- another component, tell that component that its widget has focus
- so it can merge bonoboui cut/copy/paste (and anything else) menus.
- (control_entry_focus_out_event_cb): Same.
- (setup_cut_copy_paste): Connect to the focus-in and focus-out
- events for all the entry widgets and the html editor.
- (menu_edit_cut_cb): New callback function since the composer will
- now own the Cut/Copy/Paste menu items sometimes (depending on
- which widget is in focus... confused yet? good).
-
- * e-msg-composer-hdrs.c (from_changed): Update the Reply-To entry
- to be a normal GtkEntry.
- (create_headers): Same.
- (e_msg_composer_hdrs_set_reply_to): Here too.
- (e_msg_composer_hdrs_get_reply_to): And finally here.
-
-2003-04-01 Not Zed <NotZed@Ximian.com>
-
- ** See bug #40300 & probably others.
-
- * e-msg-composer.c (autosave_manager_query_load_orphans): make the
- composer arg a parent arg, its only used parent the dialogue.
- Fix caller casts.
- (e_msg_composer_check_autosave): new function, checks for
- autosave files, and recovers them per user instructions.
-
-2003-03-31 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-attachment.glade: Convert to libglade-2's format.
-
- * e-msg-composer.c (set_editor_signature): E_MSG_COMPOSER_HDRS
- (composer->hdrs)->account->id can never be NULL anymore.
-
-2003-03-25 Dan Winship <danw@ximian.com>
-
- * e-msg-composer.c: Update for e_notice move
-
-2003-03-20 Jeffrey Stedfast <fejj@ximian.com>
-
- Fixes for bug #39813
-
- * e-msg-composer.c (composer_finalise): Don't unregister the
- signature event handler here.
- (destroy): Unregister it here instead.
-
-2003-03-19 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (add_attachments_handle_mime_part): Change the
- logic to attach text parts when appropriate.
- (map_default_cb): Grab the focus of the To entry widget. Fixes bug
- #39800. Fixes another #warning too.
-
-2003-03-18 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (do_exit): e_msg_composer_hdrs_get_subject()
- now returns const so don't g_free() it :-)
- (map_default_cb): Same as above. Also, the subject entry no longer
- derives from GnomeCanvas so eliminate the now unneeded casting to
- grab the focus of the subject widget.
- (e_msg_composer_get_subject): Return a const char * now.
-
- * e-msg-composer-hdrs.c (create_headers): Make the subject entry
- into a GtkEntry so we don't have to worry about i18n and other
- EEntry bugs anymore. Fixes numerous bugs (including #39924).
- (e_msg_composer_hdrs_set_subject): Use gtk_entry_set_text().
- (e_msg_composer_hdrs_to_message_internal):
- e_msg_composer_hdrs_get_subject() now returns const.
- (e_msg_composer_hdrs_get_subject): Return a const char *.
- (entry_changed): e_msg_composer_hdrs_get_subject() now returns
- const.
-
-2003-03-13 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (create_composer): Default the composer's title
- to "Create a message". Fixes bug #39696.
-
-2003-03-11 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-attachment-bar.c: Use GnomeIconList instead of
- EIconList so we don't have to maintain an exact copy/paste of
- GnomeIconList ourselves. I don't udnerstand why we ever did.
-
- * e-icon-list.[c,h]: Removed.
-
-2003-03-11 Not Zed <NotZed@Ximian.com>
-
- * evolution-composer.c (evolution_composer_new): add
- send_cb/save_draft_cb arguments.
- (impl_Composer_send): use the local send_cb.
- (evolution_composer_init): dont init send, save-draft signals
- here.
- (evolution_composer_new): init signals here, fix params to
- composer_construct().
- (evolution_composer_factory_init): remove, part of mailer now.
- (factory_fn): same.
- (finalise): disconnect from callbacks first.
-
- * evolution-composer.h: add send_cb/save_draft_cb to composer object.
-
-2003-03-10 Not Zed <NotZed@Ximian.com>
-
- * evolution-composer.c (finalise): from destroy.
- (evolution_composer_class_init): gtkobject->gobject stuff.
- (evolution_composer_new): remove old redundant stuff.
-
-2003-03-04 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (composer_get_default_charset_setting): Don't
- allow the returned charset to be NULL.
- (get_file_content): Make sure there is buffered data before trying
- to convert it to UTF-8.
-
-2003-03-04 Not Zed <NotZed@Ximian.com>
-
- * e-msg-composer-hdrs.c (destroy): disconnect any signal handlers
- on the accounts object. For bug #37873.
-
-2003-02-25 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c: Same as below.
-
- * e-msg-composer-attachment-bar.c: Go back to using
- e_iconv_charset_name().
-
-2003-02-24 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (drag_data_received): Make sure the url is !=
- NULL? I can't think of anything else in this code that could
- possibly cause bug #38382.
-
- * e-msg-composer-attachment-bar.c (pixbuf_for_mime_type): Fixed a
- memory leak.
-
-2003-02-22 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (e_msg_composer_set_send_html): Don't save the
- HTML format setting to gconf. This option menu is meant for a
- per-essage setting (ie. once the composer closes, the next
- composer will again use the default and not what the user chose
- last time).
-
-2003-02-21 Dan Winship <danw@ximian.com>
-
- * Makefile.am: build libcomposer as a shared library so it can be
- linked into libevolution-mail.so without portability problems
-
-2003-02-20 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (composer_get_default_charset_setting): Same as
- below.
-
- * e-msg-composer-attachment-bar.c (get_default_charset): Use
- camel_charset_canonical_name() rather than e_iconv_charset_name()
- as the latter will be removed shortly.
-
-2003-02-18 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-hdrs.c (e_msg_composer_hdrs_set_from_account):
- default_account is now a string value, not an int.
- (create_from_optionmenu): Same.
- (header_new_recipient): Use g_signal_connect_data() instead of the
- now deprecated gtk_signal_connect_full().
-
-2003-02-06 Dan Winship <danw@ximian.com>
-
- * Makefile.am: clean up
-
- * e-msg-composer.c (autosave_manager_query_load_orphans): #include
- string.h
- (menu_file_send_cb): s/gtk_signal_emit/g_signal_emit/
-
- * e-msg-composer-attachment.c: #include string.h
- (e_msg_composer_attachment_edit): s/E_GLADEDIR/EVOLUTION_GLADEDIR
-
- * e-msg-composer-attachment-bar.c: #include string.h
- (pixbuf_for_mime_type): s/ICONSDIR/IMAGESDIR/
-
- * e-msg-composer-hdrs.c: #include string.h
-
- * e-msg-composer-select-file.c (run_selector): Remove unused var
-
- * evolution-composer.c: #include string.h
- (evolution_composer_init): Remove unused var
-
- * listener.c: #include string.h
- (listener_new): Remove unused var
-
-2003-02-05 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (e_msg_composer_new_from_url): Split out the
- mailto handling code from here so we can use it in the drag-n-drop
- code too.
- (drag_data_received): If we find a mailto: url in the
- text/uri-list drop, pass that off to handle_mailto() so it can
- fill in the fields for us.
-
-2003-02-03 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-attachment.c: Just use
- gnome_vfs_get_mime_type_from_name().
-
-2003-02-01 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-attachment.c (update_mime_type): Give
- gnome_vfs_get_uri_from_local_path a full path.
-
-2003-01-27 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (e_msg_composer_new_from_url): If the subject
- or body components of the mailto url are not in UTF-8, convert
- them to UTF-8.
-
- * e-msg-composer-attachment.c (update_mime_type): Fixed a #warning
- by converting the filename into a uri before passing it into
- gnome_vfs_get_mime_type() since that function really needs a uri.
-
-2003-01-22 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-hdrs.c (init): Get the list of accounts here and
- ref the account-list.
- (destroy): Unref the accounts list here.
- (create_from_optionmenu): Connect to the added/changed/removed
- account-list signals here.
- (account_added_cb): New callback function that adds the newly
- added account to the from-dropdown menu.
- (account_changed_cb): New callback that changes the label for the
- account that got changed in the dropdown menu.
- (account_removed_cb): Removes the account from the from dropdown
- menu.
-
-2003-01-24 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am (iconsdir): Remove, this is now defined in
- configure.in.
-
-2003-01-23 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (e_msg_composer_load_config): Load the view
- menu states from gconf.
- (e_msg_composer_set_send_html): Save the setting via gconf instead
- of bonobo-config.
- (e_msg_composer_set_view_from): Same.
- (e_msg_composer_set_view_replyto): Here too.
- (e_msg_composer_set_view_cc): Again here.
- (e_msg_composer_set_view_bcc): And finally here.
- (setup_ui): Fixed a #warning - use gconf instead of bonobo-conf.
- (destroy): No need to sync/destroy the bonobo-conf db, we don't
- use it anymore.
-
-2003-01-16 Ettore Perazzoli <ettore@ximian.com>
-
- * e-msg-composer.c (setup_ui): Get evolution-message-composer.xml
- from EVOLUTION_UI_DIRECTORY.
-
- * Makefile.am (gladedir): Version it using $(BASE_VERSION).
- (iconsdir): Likewise.
- (libcomposerincludedir): Removed.
-
-2003-01-17 Jeffrey Stedfast <fejj@ximian.com>
-
- * evolution-composer.c (impl_Composer_set_headers): Updated to use
- EAccountList and iterators.
- (evolution_composer_init): Updated to use EAccount.
-
- * e-msg-composer.c (from_changed_cb): Updated to use the EAccount
- object.
- (e_msg_composer_new_with_message): Same.
- (e_msg_composer_get_preferred_account): Updated to return an
- EAccount object.
- (set_editor_signature): Updated to use an EAccountIdentity pointer.
- (get_signature_html): Same.
-
- * e-msg-composer-hdrs.c (create_from_optionmenu): Updated to use
- EAccount and EAccountList foo.
- (destroy): Same here.
- (e_msg_composer_hdrs_set_from_account): Here too.
- (e_msg_composer_hdrs_get_from): Updated.
-
-2003-01-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (signature_cb): mail_config_get_signature_list
- now returns a GSList.
- (setup_signatures_menu): Same.
- (set_signature_gui): Here too.
-
-2003-01-14 Ettore Perazzoli <ettore@ximian.com>
-
- * e-msg-composer.c (do_exit): Make dialog HIG compliant
- [Discard/Cancel/Save].
-
-2003-01-09 Chris Toshok <toshok@ximian.com>
-
- * e-msg-composer-hdrs.c (e_msg_composer_hdrs_set_to): don't pass
- NULL to bonobo_widget_set_property.
- (e_msg_composer_hdrs_set_cc): same.
- (e_msg_composer_hdrs_set_bcc): same.
-
-2003-01-09 Chris Toshok <toshok@ximian.com>
-
- * e-msg-composer-hdrs.c (e_msg_composer_hdrs_new): need to
- ref/sink "new" so that the g_object_unref doesn't spew a warning.
-
-2003-01-08 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am: Icons are now in $(datadir)/evolution/images
- instead of $(datadir)/images/evolution.
-
-2003-01-08 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-hdrs.c (create_from_optionmenu): Use gconf to get
- the default account index.
- (e_msg_composer_hdrs_set_from_account): Same.
-
-2003-01-07 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-attachment-bar.c (get_default_charset): New
- convenience function.
- (attach_to_multipart): Use get_default_charset().
-
- * e-msg-composer.c (composer_get_default_charset): Convenience
- function.
- (get_file_content): Use the convenience function to get the
- default charset setting.
- (best_charset): Same.
- (e_msg_composer_new): Use gconf to get the send_html setting.
- (e_msg_composer_new_post): Same.
-
-2003-01-06 Dan Winship <danw@ximian.com>
-
- * Makefile.am: Remove idldir definition. (It's defined in
- configure.in now)
-
-2002-12-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (get_signature_html): Use camel_text_to_html().
- (e_msg_composer_new_from_url): Same.
-
- * evolution-composer.c (impl_Composer_set_body): Use
- camel_text_to_html().
-
-2002-12-07 Jeffrey Stedfast <fejj@ximian.com>
-
- Fix for bug #33295
-
- * e-msg-composer-attachment.c: Change the parent_class to a
- GObjectClass pointer instead of a GtkObjectClass pointer.
- (e_msg_composer_attachment_edit): Ref the attachment object so
- that if the attachment is removed while it is still being edited,
- the attachment object will still exist and therefor foil the
- user's attempt to make Evolution crash when they close the
- properties dialog for this attachment.
- (close_cb): Unref the attachment object.
-
-2002-12-03 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (message_rfc822_dnd): Get rid of the unused
- exception variable.
-
-2002-11-27 Not Zed <NotZed@Ximian.com>
-
- * e-msg-composer.c (save): removed warning about e_notice. its
- used too much, its here to stay.
-
- * *.[ch]: run fix.sh over everything.
-
-2002-12-01 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c: s/g_str[n]casecmp/str[n]casecmp
-
-2002-11-26 Not Zed <NotZed@Ximian.com>
-
- * e-msg-composer.c (composer_finalise): properly chain finalise.
-
-2002-11-25 Not Zed <NotZed@Ximian.com>
-
- * e-msg-composer-attachment-bar.c (init): Remove the window size
- setting.
- (e_msg_composer_attachment_bar_new): Move the window size setting
- here. Also set icon width based on 15 approximate characters, so
- the icon text is more readable.
-
-2002-11-22 Not Zed <NotZed@Ximian.com>
-
- * e-msg-composer-select-file.c: rewrote most of this. Just use
- gtkfileselection directly, no e-file-selector, much
- smaller/simpler.
-
-2002-11-21 Not Zed <NotZed@Ximian.com>
-
- * e-msg-composer-attachment-bar.c (remove_attachment): fix
- g_signal_emit params, detail in wrong spot.
- (add_common): Same.
-
- * e-icon-list.c (icon_new_from_pixbuf): remove the
- 'use_broken_event_handling' set.
- (emit_select): Add detail to signal emit.
- (text_changed): Same.
-
- * e-msg-composer.c (subject_changed_cb): Duh! dont free subject &
- simplify logic a little.
-
-2002-11-20 Not Zed <NotZed@Ximian.com>
-
- * e-msg-composer-hdrs.c (entry_changed): duh, emit the signal
- using an initialised value(!).
-
-2002-11-19 Radek Doulik <rodo@ximian.com>
-
- * e-msg-composer.c (e_msg_composer_get_sig_file_content): use
- CAMEL_MIME_FILTER_TOHTML_PRESERVE_8BIT flag
-
-2002-11-19 Not Zed <NotZed@Ximian.com>
-
- * e-msg-composer-attachment-bar.c (add_from_file): dont unref
- after destroy. duh.
-
- * e-msg-composer-hdrs.c (e_msg_composer_hdrs_set_to): Add type
- code to set_property call.
- (e_msg_composer_hdrs_set_cc): "
- (e_msg_composer_hdrs_set_bcc): "
- (e_msg_composer_hdrs_get_to): Do the same for get_property calls.
- (init): ref/sink the tooltip object.
- (e_msg_composer_hdrs_get_type): fix return type.
-
- * e-msg-composer.c (GNOME_GTKHTML_EDITOR_CONTROL_ID): we want
- version 3.0 not 1.1.
- (create_composer): Add type code to set property call.
- (autosave_manager_query_load_orphans): my bad, we dont unref
- dialog's once we've destroyed 'em.
- (build_message): "
- (get_file_content): "
- (save): "
- (do_exit): "
- (composer_dispose): moved the autosave shutdown here.
-
-2002-11-18 Not Zed <NotZed@Ximian.com>
-
- * e-msg-composer.c (create_composer): Remove check for
- gtk_main_level(). as far as i can tell it serves no real purpose,
- and i think gtkmain is now redundant.
- (e_msg_composer_new_with_message): Same here.
- (destroy): moved some stuff into finalise, and made destroy
- mulitcall safe.
-
-2002-11-13 Ettore Perazzoli <ettore@ximian.com>
-
- * listener.h: Removed {BEGIN,END}_GNOME_DECLS.
-
- * e-msg-composer-select-file.c: Do not #include
- <libgnome/gnome-defs.h>.
- * e-msg-composer.c: Likewise.
- * listener.h: Likewise.
-
-2002-11-13 Not Zed <NotZed@Ximian.com>
-
- * e-msg-composer.c (setup_ui): bonobo api changes.
-
- * e-icon-list.c (e_icon_list_new): Use the right object_new method.
-
- * e-icon-list.h: get rid of BEGIN/END_GNOME_DECLS stuff.
-
-2002-11-11 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-attachment-bar.c: Remove some unused ehaders and
- ones that cause compilation failures (such as gnome-defs.h).
-
- * e-icon-list.h: Same.
-
-2002-11-08 Not Zed <NotZed@Ximian.com>
-
- * listener.c: Fix bonobo object setup.
-
- * e-msg-composer-hdrs.c: Remove oaf stuff, fix destroy to be
- multi-call safe.
-
- * e-msg-composer-attachment.c (e_msg_composer_attachment_new):
- Remove utf8 from locale conversions, & glib api changes.
- (ok_cb): "
-
- * e-msg-composer-attachment-bar.c (add_from_file): gtk message
- dialog.
- (pixbuf_for_mime_type): glib,gnome-vfs api changes.
- (init): Estimate the icon_height based on the pango font
- description size, this is probably not correct.
- (properties_cb):
- (remove_cb): Changed signature for gnomeui callbacks.
- (popup_icon_context_menu):
- (popup_context_menu): popup_menu api change
- (destroy): Protect from multiple calls.
- (e_msg_composer_attachment_bar_new): Remove push/pop
- visual/colormap stuff.
-
- * composer-marshal.list: The list of marshallers used by the
- composer.
-
- * Makefile.am (composer-marshal.h): Added composer marshal builder.
-
- * evolution-composer.c (class_init): bonobo object epv setup change.
- (factory_fn): Fix changes to factory callback.
-
- * e-icon-list.c: (icon_get_height): Use bounding box to calc
- height.
- (icon_event): drop gtk_selection_extended.
- (e_icon_list_remove): "
- (select_icon):
- (unselect_icon): "
-
- * e-msg-composer.c (autosave_save_draft): Dup fd rather than poke
- camel_stream_fd's data. Also, use camel_stream_close() rather
- than flush.
- (autosave_manager_query_load_orphans): Port to gtk dialog.
- (autosave_query_cb): Removed, redundant.
- (save): Port to gtkdialog.
- (prepare_engine): Fix bonobo-object-client code.
- (get_file_content): gtk dialog
- (do_exit): gtk dialog.
- (setup_signatures_menu): dump gtkutf8 stuff.
- (marshal_NONE__NONE_INT): What WAS jeff thinking? Removed :)
- (class_init): g object setup.
- (e_msg_composer_get_type): "
- (create_composer): remove bonobo_window_construct, use create
- property instead. g_signal stuff. bonobo stuff.
- (is_special_header): Use ascii_strncasecmp
- (e_msg_composer_set_pending_body): gtk->g_object_get/set_data.
- (e_msg_composer_set_body): use ascii_strncasecmp
- (e_msg_composer_add_inline_image_from_mime_part): make cid const.
- (autosave_manager_register):
- (autosave_manager_unregister): Use g_path_get_basename() & account
- for differences.
- (composer_shutdown): rename to finalise/etc.
- (class_init): Use object:finalize instead of shutdown.
- (e_msg_composer_set_body): Use _() rather than U_().
- (build_message): gtk dialog.
-
-2002-11-06 Not Zed <NotZed@Ximian.com>
-
- * e-msg-composer-attachment-bar.c (pixbuf_for_mime_type): Add
- error return to gdk_pixbuf_new_from_file().
-
-2002-11-01 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (e_msg_composer_new_from_url): Add support for
- an attach option in the mailto: url.
-
-2002-10-29 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (e_msg_composer_new_with_message): Make sure to
- save References and In-Reply-To headers. Fixes bug #32932.
-
-2002-10-26 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-attachment-bar.c (attach_to_multipart): Don't set
- the charset param on text parts nor tha rawtext bit on the content
- if a charset for the part is already specified.
-
-2002-10-25 Ettore Perazzoli <ettore@ximian.com>
-
- * e-msg-composer-attachment-bar.c (size_to_string): Return NULL
- instead of the empty string if the size is less than one K.
- (update): Only put the size if size_to_string() doesn't return
- NULL. [#32751]
-
-2002-10-18 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-hdrs.c (create_from_optionmenu): Only add the
- account address to the list of addresses if it is non-NULL. Fixes
- bug #32446 although it shouldn't ever happen anyway (an account
- address is not allowed to be NULL).
-
-2002-10-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-attachment.c (e_msg_composer_attachment_new): We
- need to treat message/rfc822 streams differently. Fixes bug
- #32378.
-
-2002-10-16 Not Zed <NotZed@Ximian.com>
-
- * e-msg-composer-select-file.c (select_file_internal): Mark the
- file selector modal. Quick fix for bug #32256.
-
-2002-10-04 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-attachment-bar.c (attach_to_multipart): Set
- content->rawtext to TRUE for text parts because the content is in
- its raw form (since we didn't know the charset when we created
- it). Also only write out the content-object to discover the best
- encoding, we don't want to include the headers of the MIME
- part. Second half of the fix for bug #31655.
-
-2002-10-02 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (get_file_content): Don't create a new file if
- the file doesn't exist.
-
-2002-10-01 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (build_message): If the user hits cancel when
- signing/encrypting, don't continue constructing the message,
- instead abort (and just don't pop up a dialog).
-
-2002-10-01 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (build_message): When signing/encrypting a
- part, if a USER_CANCEL occurs, re-use the part otherwise unref it
- and replace it with the new part.
-
-2002-09-30 Aaron Weber <aaron@ximian.com>
-
- * evolution-composer.c (evolution_composer_factory_init): adjust
- string on line 391
-
- * e-msg-composer.c (create_composer): adjust string on 2872
-
-2002-09-27 Dan Winship <danw@ximian.com>
-
- * Evolution-Composer.idl (setHeaders): let the caller set the
- "From" account too (by name or address).
-
- * evolution-composer.c (impl_Composer_set_headers): Update for
- that.
-
-2002-09-27 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (build_message): Don't reuse the part that
- we've signed and/or encrypted, create a new part container
- instead. Fixes bug #31379.
-
-2002-09-25 Dan Winship <danw@ximian.com>
-
- * e-msg-composer-hdrs.c (create_headers): Use "mail/*" for the
- allowed_types for the posting folder selector.
-
-2002-09-24 Dan Winship <danw@ximian.com>
-
- * e-msg-composer-hdrs.c (create_from_optionmenu): Only append the
- account name to the end of the From menu item if the email address
- is not unique. (That was added for people who have multiple
- accounts with the same email address but different transports. The
- rest of us don't need to be reminded of the account name, and
- having it there can make the window very wide.)
-
-2002-09-24 Zbigniew Chyla <cyba@gnome.pl>
-
- * e-msg-composer-attachment-bar.c (size_to_string):
- Don't mark empty string with _().
-
-2002-09-23 Ettore Perazzoli <ettore@ximian.com>
-
- * e-icon-list.c (icon_new_from_pixbuf): Removed a #warning.
-
- * e-msg-composer-attachment-bar.c (size_to_string): Don't use dots
- here so we don't get funny wrapping from GnomeIconList. [#236]
-
-2002-09-22 Dan Winship <danw@ximian.com>
-
- * e-msg-composer.c (save): Fix non-ANSI switch statement
-
-2002-09-19 Radek Doulik <rodo@ximian.com>
-
- * e-msg-composer.c (signature_cb): allow to select last 2 menu
- items
-
-2002-09-17 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (add_attachments_from_multipart): Handle
- multipart/signed and multipart/encrypted parts in a more expected
- way. Fixes bug #28453.
-
-2002-09-15 Kjartan Maraas <kmaraas@gnome.org>
-
- * e-msg-composer.c: Mark a string for translation.
-
-2002-09-05 Ettore Perazzoli <ettore@ximian.com>
-
- * e-msg-composer.c (composer_key_pressed): Don't chain the event
- handler here -- that's just wrong! Also stop emission of the
- signal when we catch Escape.
-
-2002-09-04 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (create_composer): Make it so that the composer
- will close when the user hits Escape.
-
-2002-08-27 Radek Doulik <rodo@ximian.com>
-
- * e-msg-composer.c (signature_cb): removed "Set as default" menu item
-
-2002-08-26 Peter Williams <peterw@ximian.com>
-
- * e-msg-composer.c (handle_multipart): Oops, we were overwriting
- 'multipart' with our child multipart. Fixes 29399.
- (handle_multipart_alternative): Here too.
-
-2002-08-22 Jeffrey Stedfast <fejj@ximian.com>
-
- Fixes bug #29016
-
- * e-msg-composer.c (e_msg_composer_new_with_message): If the
- X-Evolution-PostTo header exists, then treat this message composer
- as a PostTo composer rather than a mail composer.
-
- * e-msg-composer-hdrs.c (e_msg_composer_hdrs_to_message_internal):
- Set the X-Evolution-PostTo header if that is the mdoe we are in.
-
-2002-08-16 Dan Winship <danw@ximian.com>
-
- * e-msg-composer-hdrs.c (create_headers): Use an
- EvolutionFolderSelectorButton instead of a label to indicate the
- posting destination. #27920.
- (e_msg_composer_hdrs_set_post_to): Use
- evolution_folder_button_set_uri.
- (e_msg_composer_hdrs_get_post_to): Use
- evolution_folder_button_get_folder.
-
-2002-08-14 Dan Winship <danw@ximian.com>
-
- * e-msg-composer.c (from_changed_cb): Don't turn on pgp signing if
- this is an iMIP message and pgp_no_imip_sign is set.
- (e_msg_composer_set_body): If setting a text/calendar body and
- pgp_no_imip_sign is true, turn off signing.
-
-2002-08-13 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (do_exit): Make the warning dialog display the
- message subject so that it is more clear which composer the dialog
- is referring to. Fixes bug #25467.
-
-2002-08-12 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-select-file.c (create_file_selection): Set the
- file-selection window icon. Fixes the mailer part of bug #7368.
-
- * e-msg-composer-attachment.c (e_msg_composer_attachment_new):
- Don't call new_from_mime_part() since that function now does some
- copying of the mime part rather than simply reffing it.
- (e_msg_composer_attachment_new_from_mime_part): Make a copy of the
- MIME part so that if the message that this part belongs to gets
- deleted from the the remote store, the composer will still have a
- copy of it. Fixes bug #20308.
-
-2002-07-31 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (e_msg_composer_new_with_message): Parse the
- auto-cc/bcc recipients and then later when parsing the cc/bcc
- recipients into EDestination objects, if the address is an
- auto-*cc address, then set auto_recipient to TRUE on that
- EDestination. This fixes bug #28339.
-
-2002-07-29 Radek Doulik <rodo@ximian.com>
-
- * e-msg-composer.c (encode_signature_name): new helper function
- (decode_signature_name): new helper function
- (get_signature_html): use encode_signature_name
- (set_signature_gui): use decode_signature_name
-
-2002-07-26 Radek Doulik <rodo@ximian.com>
-
- * e-msg-composer.c (do_exit): don't assert on default, when ESC is
- pressed, the dialog is closed as well and we get button number -1
- (set_signature_gui): new helper method to set signature from draft
- message
- (e_msg_composer_new_with_message): use set_signature_gui
-
-2002-07-26 Ettore Perazzoli <ettore@ximian.com>
-
- * e-msg-composer-attachment-bar.c (pixbuf_for_mime_type):
- Special-case message/digest, multipart/digest and message/rfc822
- and give them a nice icon. [#9786]
-
- * Makefile.am (INCLUDES): Add -D for EVOLUTION_ICONSDIR.
-
-2002-07-24 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-hdrs.c (create_headers): Create the Post-To
- header.
- (headers_set_visibility): Possibly show the Post-To header.
- (attach_headers): Attach the Post-To header.
- (e_msg_composer_hdrs_set_post_to): Set the text for the Post-To
- header.
- (e_msg_composer_hdrs_get_post_to_label): Return the label widget
- for this header pair.
- (e_msg_composer_hdrs_set_visible_mask): New function to set the
- visible mask (so we can disallow certain headers to be shown).
- (e_msg_composer_hdrs_new): Save the visible mask argument.
- (setup_headers): To: does not always have to be visible anymore.
- (e_msg_composer_hdrs_get_post_to): New function to get the url for
- the Post-To folder.
-
- * e-msg-composer.c (e_msg_composer_get_visible_flags): Set the
- Post-To bit when it is supposed to be visible.
- (e_msg_composer_new_post): Set the visible_mask to only allow the
- headers needed for Posting.
-
-2002-07-25 Dan Winship <danw@ximian.com>
-
- * e-msg-composer.c (e_msg_composer_set_body): Fix spelling.
-
-2002-07-23 Radek Doulik <rodo@ximian.com>
-
- * e-msg-composer.c (autosave_run): restart automanager to avoid
- multiple dialog apearing
-
-2002-07-23 Not Zed <NotZed@Ximian.com>
-
- * Applied patch below.
-
-2002-07-19 Christian Kreibich <christian@whoop.org>
-
- * e.msg-composer.c (get_signature_html): Test for the signature
- delimiter not only at the beginning of a signature file, but also
- inside the signature.
-
-2002-07-23 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (e_msg_composer_set_view_bcc): Reverted some
- code that got committed by accident.
- (e_msg_composer_set_view_cc): Same.
- (e_msg_composer_set_view_replyto): Here too.
- (e_msg_composer_set_view_from): And here.
-
-2002-07-22 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c: Removed a lot of extra g_return_if_fail's that
- we don't need (if we are going to check if the pointer is a a
- composer widget using the gtk type-check macros, then there is no
- need to first check that it isn't NULL).
- (get_file_content): Signatures are now supposed to be in UTF-8 and
- not the user's locale charset, so we must first read in the
- content, then check that it is valid UTF-8. If it isn't, then we
- need to try to convert it to UTF-8.
-
-2002-07-22 Radek Doulik <rodo@ximian.com>
-
- * e-msg-composer.c: removed Insert File menu item
-
-2002-07-19 Not Zed <NotZed@Ximian.com>
-
- * e-msg-composer-hdrs.c (e_msg_composer_hdrs_to_message_internal):
- This should use address_encode, since its an rfc822 address, not
- address_format which is for display.
-
-2002-07-17 Radek Doulik <rodo@ximian.com>
-
- * e-msg-composer.c (save): use "saved" gtkhtml command
- (e_msg_composer_is_dirty): use "is-saved" gtkhtml command
-
-2002-07-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (e_msg_composer_set_headers): Set the
- from-account last so that auto-cc/bcc recipients don't get
- overwritten when setting the cc/bcc recipient fields.
-
-2002-07-16 Peter Williams <peterw@ximian.com>
-
- * e-msg-composer.c (create_composer): Instead of doing this with a
- weakref, do it by connecting to the destroy signal. The weakref was
- not getting notified in certain conditions that I could never really
- pin down, and this caused problems at exit.
-
- * e-msg-composer-hdrs.c (create_headers): Reorder to create reply_to
- before from, because create_from_optionmenu causes from_changed to
- be called, which expects reply_to.entry to exist.
-
-2002-07-15 Radek Doulik <rodo@ximian.com>
-
- * e-msg-composer.c (build_message): added save_html_object_data
- parameter, use gtkhtml command to save object data when wanted
-
-2002-07-08 Peter Williams <peterw@ximian.com>
-
- * Makefile.am (INCLUDES): Fix cflags for ebook header namespacing.
-
-2002-07-05 Jeffrey Stedfast <fejj@ximian.com>
-
- * evolution-composer.c (init): Don't connect to the postpone
- signal, but do connect to the save-draft signal.
- (evolution_composer_factory_init): No longer takes a postpone_cb
- argument, but does now take a save_draft_cb argument.
-
- * e-msg-composer.c (menu_file_send_later_cb): Removed.
- (class_init): Removed the POSTPONE signal.
- (setup_ui): Don't need to swap the Send/SendLater tooltips and
- accels anymore, since SendLater no longer exists.
-
-2002-06-26 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (build_message): Use the new
- CamelMultipartEncrypted class to do our encryption work for us. We
- also need to always get the user's userid before encrypting since
- pgp/gpg need that.
- (e_msg_composer_new_with_message): Handle multipart/signed and
- multipart/encrypted parts by adding the (decrypted) content and
- setting the composer to pgp sign/encrypt the message when the user
- re-sends it.
-
-2002-06-25 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (build_message): Use
- mail_crypto_get_pgp_cipher_context() so that the PGP/GPG decision
- is done for us.
-
-2002-06-21 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (build_message): Use the new gpg cipher context
- rather than the old pgp context.
-
-2002-06-19 Radek Doulik <rodo@ximian.com>
-
- * e-msg-composer.c (get_signature_html): don't convert text to
- html twice
-
-2002-06-10 Radek Doulik <rodo@ximian.com>
-
- * e-msg-composer.c (signature_cb): added "Set as default" menu
- item
-
- * e-msg-composer-hdrs.c (e_msg_composer_hdrs_get_from_omenu): new
- method
- (e_msg_composer_hdrs_set_from_account): use
- e_msg_composer_hdrs_get_from_omenu
-
-2002-06-07 Radek Doulik <rodo@ximian.com>
-
- * e-msg-composer.c (get_signature_html): use new script signature
- interface
-
-2002-06-06 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-hdrs.c (e_msg_composer_hdrs_set_from_account):
- Agh, priv->from.entry is no longer a GtkOptionMenu - it is an hbox
- containing the GtkOptionMenu.
-
- * e-msg-composer.c (setup_ui): Remove the customize toolbar thingy
- since Michael said that this would fix bug #17952.
-
- * e-msg-composer-hdrs.c (e_msg_composer_hdrs_set_from_account):
- Clean up the logic in this. For one, we don't need to do strstr
- using the account address (wtf??).
-
-2002-06-05 Radek Doulik <rodo@ximian.com>
-
- * e-msg-composer-hdrs.c (create_from_optionmenu): put option menu
- to hbox to make space for signatures menu
- (e_msg_composer_hdrs_get_from_hbox): new helper function
-
- * e-msg-composer.c: moved signatures from menu to option menu next
- to From:
-
-2002-06-03 Not Zed <NotZed@Ximian.com>
-
- * e-msg-composer.c (build_message): Properly handle user
- cancellation for signing/encrypting, just dont sign but create
- anyway.
- (e_msg_composer_get_subject): Wrapper function to get the subject
- from the header object.
- (e_msg_composer_get_to):
- (e_msg_composer_get_cc):
- (e_msg_composer_get_bcc): Same for the destination types.
-
-2002-06-03 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (e_msg_composer_guess_mime_type): Allocate a
- new FileInfo struct here rather than using and unref it when we're
- finished with it.
-
-2002-05-30 Not Zed <NotZed@Ximian.com>
-
- * e-msg-composer.c (build_message): Changes for multipart/signed
- api changes.
-
-2002-05-16 Ettore Perazzoli <ettore@ximian.com>
-
- * e-msg-composer.c: New local `all_composers'; keeps a list of all
- the composer windows created. Changed type of `parent_class' to
- BonoboWindowClass *.
- (do_exit): Cleaned up a bit. Raise the composer window before
- showing the message box dialog.
- (exit_dialog_cb): Removed.
- (e_msg_composer_request_close_all): New.
- (create_composer): Add the composer to the all_composers list and
- weakref it.
- (msg_composer_destroy_notify): GtkDestroyNotify function for the
- composer's weakref; remove the composer from the all_composers
- list.
-
-2002-05-15 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-attachment.c (e_msg_composer_attachment_new):
- Just use g_basename.
-
-2002-04-26 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (build_message): Check for empty-string pgp-key
- ids and don't use them.
-
-2002-04-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-hdrs.c (destroy): Unref the priv->tooltips object
- here.
-
- * e-msg-composer-attachment-bar.c (destroy): Free the priv struct.
-
- * e-msg-composer.c (set_editor_signature): We don't need a 'name'?
- So don't strdup it.
-
-2002-04-12 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-hdrs.c (from_changed): Change the Reply-To header
- contents.
- (e_msg_composer_hdrs_set_reply_to): The Reply-To entry was an
- EEntry, not a bonobo control so fix this to set the text using
- e_entry_set_text.
- (e_msg_composer_hdrs_get_reply_to): Use e_entry_get_text here for
- the same reason.
-
-2002-04-08 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (set_editor_text): No need to query for the
- persist-stream interface here, just re-use
- composer->persist_stream_interface - this might improve the speed
- at which a reply action brings up the composer.
-
-2002-04-09 Not Zed <NotZed@Ximian.com>
-
- * e-msg-composer-hdrs.c (set_recipients_from_destv): Use decode
- rather than unformat - the e_destination was changed (long time
- ago) to rfc2047 encode the addresses, so we should decode
- likewise. Should fix #16158.
-
- * e-msg-composer.c (next_word): g_utf8_next_char never returns
- NULL, it just skips to the next character. So like normal string
- code, we just check for a nul explicitly. Fixes a bug found while
- checking #16158.
-
-2002-04-05 Jeffrey Stedfast <fejj@ximian.com>
-
- Fixes bug #3980.
-
- * e-msg-composer-hdrs.c (e_msg_composer_hdrs_set_cc): If a Cc list
- is set to something non-empty, make sure to show the Cc widgets.
- (e_msg_composer_hdrs_set_bcc): Same but for Bcc.
- (e_msg_composer_hdrs_set_reply_to): And here.
-
-2002-03-28 Christopher James Lahey <clahey@ximian.com>
-
- * e-msg-composer-select-file.c: Switch to using EFileSelection
- here instead of GtkFileSelection.
-
-2002-03-27 Larry Ewing <lewing@ximian.com>
-
- * Makefile.am: fix for the changes to GTKHTML_DATADIR that include
- the release number.
-
-2002-03-18 Dan Winship <danw@ximian.com>
-
- * Evolution-Composer.idl, evolution-composer.c
- (impl_Composer_show): "Forward as iCalendar" uses set_body, so we
- can't make the composer un-showable after doing that. So get rid
- of the "cannot show" exception.
-
- * e-msg-composer.c (e_msg_composer_set_body): Prepare the composer
- to be shown in its weird state: Put an explanatory message in the
- body, then call disable_editor.
- (disable_editor): Common editor-disabling code - makes the editor
- and attachment bar insensitive and disables any menu items that
- could be used to modify them.
- (e_msg_composer_new_redirect): Use disable_editor here now.
-
-2002-03-15 Radek Doulik <rodo@ximian.com>
-
- * e-msg-composer.c: use gtkhtml editor API version 1.1
-
-2002-03-11 Dan Winship <danw@ximian.com>
-
- * listener.c (impl_event): Remove the extremely verbose printf
- here.
-
-2002-03-07 Radek Doulik <rodo@ximian.com>
-
- * e-msg-composer.c (destroy): ops, unregister and not register new
- one sig_event_client
-
-2002-03-04 Dan Winship <danw@ximian.com>
-
- * e-msg-composer.c (build_message): Fix a dumb bug in previous
- commit that broke iMIP containing 8-bit data.
-
-2002-02-25 Dan Winship <danw@ximian.com>
-
- Mailer side of 14705.
-
- * Evolution-Composer.idl (setBody): Change setBodyText to setBody
- and take a MIME type as well.
- (show): Add an exception.
-
- * evolution-composer.c (impl_Composer_set_body, etc): Update for
- IDL change. While I'm here, fix this to DTRT with both plaintext
- and HTML bodies. (It claimed to take plain text before, but then
- passed it to the composer as HTML.)
- (impl_Composer_show): Raise an exception if setBody has been
- called, since the composer window will not display the real data
- in that case.
-
- * e-msg-composer.c (e_msg_composer_set_body): interface for
- impl_Composer_set_body.
- (build_message): If e_msg_composer_set_body has been called, use
- the body and MIME type supplied to it rather than the contents of
- the HTML editor.
-
-2002-02-14 Radek Doulik <rodo@ximian.com>
-
- * e-msg-composer.c (delete_old_signature): don't insert paragraph
- here, also delete paragraph where signature was
- (e_msg_composer_show_sig_file): test if we are in empty document
- and if so, insert new paragraph for signature
-
-2002-02-12 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (e_msg_composer_flush_pending_body): Use
- set_editor_text()
- (e_msg_composer_new_from_url): Same.
- (e_msg_composer_set_body_text): Re-Show the signature.
-
-2002-02-12 Radek Doulik <rodo@ximian.com>
-
- * e-msg-composer.c (e_msg_composer_is_dirty): reflect gtkhtml API
- change
-
-2002-02-11 Radek Doulik <rodo@ximian.com>
-
- * e-msg-composer.c (e_msg_composer_drop_editor_undo): new method,
- drops undo in editor and resets dirty flag in editor
- (do_exit): remove TRUE from condition as dirty flag in editor
- should work now
- (e_msg_composer_is_dirty): use new editor API for dirty flag
-
-2002-02-01 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (update_auto_recipients): Update the
- auto-cc/bcc recipients in the composer header fields to match the
- ones chosen in the account configuration.
-
-2002-01-31 Radek Doulik <rodo@ximian.com>
-
- * e-msg-composer.c (e_msg_composer_ignore): new method, tells
- composer to ignore all word in str string
- (next_word): helper function to get next word from s, saves rest
- of s to sr
-
-2002-01-29 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (build_message): If we are in redirect mode,
- use the original message and set the resent-* headers using
- e_msg_composer_hdrs_to_redirect() and then return.
- (destroy): Unref the redirected message if it exists.
-
- * e-msg-composer-hdrs.c (e_msg_composer_hdrs_to_redirect): New
- function for a composer in redirect mode.
-
-2002-01-27 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am: Use GNOME_FULL_CFLAGS.
-
-2002-01-10 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (get_file_content): Rewrote to use CamelStreams
- and also convert the file contents to UTF-8 (assums the file
- charset is the same charset that the composer is set to).
- (menu_file_insert_file_cb): Pass the composer into
- get_file_content().
- (e_msg_composer_get_sig_file_content): Pass NULL as the composer
- argument.
-
-2002-01-09 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (class_init): Fixed the setup of the
- "save-draft" signal so that it would actually work.
-
-2002-01-08 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (is_special_header): Greatly simplified. No
- need to have a list of headers to not accept - we can just refuse
- all headers that are not X-* headers (other than X-Evolution
- headers).
-
-2002-01-07 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (e_msg_composer_get_message_draft): Set the
- X-Evolution-Format header to text/plain if that is the editing
- mode we are really in. This fixes bug #11499.
-
-2002-01-04 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (e_msg_composer_new_from_url): A few minor
- fixes to make it more compliant with rfc2368. Should now be fully
- rfc compliant as far as I can tell.
-
-2002-01-03 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-attachment.c (e_msg_composer_attachment_edit):
- Only connect to the parent's destroy/hide signals while the
- attachment editor dialog is "alive".
-
-2001-12-21 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-select-file.c (composer_hide_cb): Only cancel the
- selection dialog if it is currently in use, otherwise we'll get an
- extra gtk_main_quit and the mailer will exit :-(
-
-2001-12-17 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (read_file_content): Don't block forever if we
- are reading a fifo with no data.
-
-2001-12-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (class_init): Setup the SAVE_DRAFT signal.
- (menu_file_save_draft_cb): Emit the SAVE_DRAFT signal.
- (exit_dialog_cb): Same here.
- (save_draft): Removed. This code is now a signal that
- mail-callbacks will connect to.
-
-2001-12-11 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-attachment.c (e_msg_composer_attachment_edit):
- Attach to the parent widget's destroy signal - when that gets
- destroyed, we need to cancel the editor dialog too. Also connect
- to our parent window's "hide" signal so that when the composer
- gets hidden (ie, it's being sent), we also close the dialogs.
-
- * e-msg-composer.c (init): Default composer->enable_autosave to
- TRUE.
-
-2001-12-11 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-select-file.c (confirm): If multiple-selection is
- enabled but nothing is slected, fall back to using the filename in
- the entry box as the "selected" file.
- (create_file_selection): If the composer gets hidden (ie it's
- being "sent") then cancel the file selection dialog.
-
-2001-12-11 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-select-file.c
- (file_selection_info_destroy_notify): If the widget is non-NULL,
- then gtk_widget_destroy that bad boy...
-
-2001-12-10 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-attachment-bar.c (add_from_user):
- select_file_attachments now returns a GPtrArray so handle that and
- loop until we've added all the attachment files.
-
- * e-msg-composer-select-file.c (confirm): Add an evil kludge to
- get a list of filenames from the GtkFileSelection widget based on
- the label in the history option menu item and the base filenames
- of the selected items in the filename clist.
- (create_file_selection): Setup the clist to allow multiple
- selection.
- (file_selection_info_destroy_notify): Destroy the GPtrArray
- containing the list of xselected files.
- (select_file_internal): Return a GPtrArray of files instead of a
- char *.
-
-2001-12-10 Jon Trowbridge <trow@ximian.com>
-
- * e-msg-composer.c (get_file_content): Only execute an executable
- sig file if a magic environment variable is set.
-
-2001-12-06 Jon Trowbridge <trow@ximian.com>
-
- * e-msg-composer.c (executed_file_output): Added. Executes the
- given file and returns its output as a string.
- (get_file_content): Stats the file to see if it is executable.
- If it is, execute it and return the string. If not, just read
- the file and return the contents.
-
-2001-11-30 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (setup_ui): Change the FileSend tooltip the be
- the same as the FileSendLater tooltip if we are in offline mode.
-
-2001-11-11 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (drag_data_received): Allow drag & drop for
- vcards.
-
-2001-11-30 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (setup_ui): Change the FileSend tooltip the be
- the same as the FileSendLater tooltip if we are in offline mode.
-
-2001-11-14 Larry Ewing <lewing@ximian.com>
-
- * e-msg-composer.c (create_composer): popup failure dialog if we
- cannot get a valid editor_engine.
- (prepare_engine): make the checks robust and make sure that we
- unset the engine if any part fails.
-
-2001-11-02 Radek Doulik <rodo@ximian.com>
-
- * e-msg-composer.c (add_inlined_images): use hash table to
- eliminate duplicates
-
-2001-11-02 <NotZed@Ximian.com>
-
- * e-msg-composer.c (e_msg_composer_set_enable_autosave): New
- function, enable/disable autosave for the composer temporarily.
- (autosave_run_foreach_cb): Only save if we have enable autosave
- turned on. In other cases we want to save it regardless.
-
-2001-10-30 Dan Winship <danw@ximian.com>
-
- * e-msg-composer.c (build_message): Add back the "remove
- Content-Disposition when sending itip" hack.
-
- * Evolution-Composer.idl (setMultipartType): New.
-
- * evolution-composer.c (impl_Composer_set_multipart_type): Allow
- caller to specify a multipart/alternative rather than
- multipart/mixed.
-
- * e-msg-composer.c (build_message): Revert yesterday's changes.
- Add new ones for sending multipart/alternative.
-
-2001-10-30 Larry Ewing <lewing@ximian.com>
-
- * e-msg-composer.h: add dirty prototype.
-
- * e-msg-composer.c: add dirty implementation.
-
-2001-10-30 Radek Doulik <rodo@ximian.com>
-
- * listener.c (insert_paragraph_before): new helper function,
- extracted
- (insert_paragraph_after): ditto
- (impl_event): process command_before and command_after, use new
- functions
- (clear_signature): reset style to be sure
- (reply_indent): ditto
-
-2001-10-30 Dan Winship <danw@ximian.com>
-
- * e-msg-composer.c (build_message): Remove Content-Disposition in
- the no_body case. (More kludging around Outlook iCalendar
- brokenness.)
-
-2001-10-29 Ettore Perazzoli <ettore@ximian.com>
-
- * e-msg-composer.c (setup_ui): Put the charset encoding submenu in
- the EncodingPlaceholder.
-
-2001-10-29 Dan Winship <danw@ximian.com>
-
- * evolution-composer.c (init): Set the (new) "no_body" flag on the
- composer.
- (impl_Composer_set_body_text): And unset it here.
- (unset_no_body): And here (called if/when the composer is
- realized).
-
- * e-msg-composer.c (build_message): If the composer has the
- "no_body" flag set, and a single attachment, promote that
- attachment to be the message body.
-
-2001-10-30 Radek Doulik <rodo@ximian.com>
-
- * listener.c (reply_indent): simplified, requires new gtkhtml
-
-2001-10-29 Larry Ewing <lewing@ximian.com>
-
- * e-msg-composer.h: add GList to hold the current images.
-
- * listener.c (resolve_image_url): keep track of the images that
- the editor is currently uses in current_images as well as storing
- the images in the hash.
-
- * e-msg-composer.c (clear_current_images): clear the list of
- images actually in the message.
- (add_inlined_images): use the current image list rather than the
- hash tables.
- (build_message): clear the current image list when appropriate.
- (init): initialize current_images.
-
-2001-10-24 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (add_attachments_from_multipart): New function
- that replaces handle_multpart() and handle_multipart_alternative()
- for add_message_attachments().
- (e_msg_composer_add_message_attachments): Call
- add_attachments_from_multipart().
- (handle_multipart_alternative): Now only used by
- new_with_message() and is really only designed to work well with
- messages generated by Evolution (ie for editing Drafts and such).
- (handle_multipart): Same.
- (e_msg_composer_new_with_message): No longer calls
- add_message_attachments() because we can't ever have this fail and
- the logic in add_message_attachments() is impossible
- logic. Instead do like what we used to do before the addition of
- add_message_attachments() came along.
-
-2001-10-24 Larry Ewing <lewing@ximian.com>
-
- * e-msg-composer.c
- (e_msg_composer_add_inline_image_from_mime_part): rework this so
- that we don't end up freeing the cid then reading from it.
-
-2001-10-22 Jon Trowbridge <trow@ximian.com>
-
- * e-msg-composer-hdrs.c (create_from_optionmenu): Check that
- account->id->address != NULL.
-
-2001-10-21 Dan Winship <danw@ximian.com>
-
- Make inline images used for replies not show up as
- attachments. Also, I think this should make replies to HTML
- messages containing inline images referenced via Content-Location
- work, but that's not tested.
-
- * e-msg-composer.c (various): Keep two hash tables of inline image
- data: one mapping from cid: URLs to CamelMimeParts for all
- attachments, the other mapping from file: and Content-Location
- urls to CamelMimeParts (for those inline images that came from a
- file or have a Content-Location).
- (add_inlined_images): Simplify. Most of this code is in
- e_msg_composer_add_inline_image_from_file() now.
- (e_msg_composer_add_message_attachments, handle_multipart): Change
- "attach_all" arg to "just_inlines". If it is set, call
- e_msg_composer_add_inline_image_from_mime_part on any attachment
- with a Content-Id or Content-Location.
- (e_msg_composer_add_inline_image_from_file): Create a mime part
- from a file and add it to the inline images hash.
- (e_msg_composer_add_inline_image_from_mime_part): Add a mime part
- directly to the inline images hash.
-
- * listener.c (resolve_image_url): If asked to resolve a file: URL
- that isn't in the inline images hash, call
- e_msg_composer_add_inline_image_from_file to get a cid for it.
- (impl_event): Look up the URL in the inline_images and
- inline_images_by_url hashes.
-
- * e-msg-composer-attachment-bar.c
- (e_msg_composer_attachment_bar_find_message): Gone. No longer
- used.
-
-2001-10-19 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (handle_multipart): Now takes a 'attach_all'
- argument. If !attach_all, then only attach the attachment if the
- part has a content-id, otherwise we can safely assume that nothing
- references it thus we don't need to attach it.
- (e_msg_composer_add_message_attachments): Now takes a 'attach_all'
- argument that overrides the "only attach attachments if they have
- a content-id header" behavior.
- (e_msg_composer_new_with_message): Pass TRUE as the attach_all
- argument to add_message_attachments.
-
-2001-10-18 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (best_encoding): Don't use a
- g_return_val_if_fail after iconv_open, this is a valid error
- condition and so should use check it for real.
-
- * e-msg-composer-attachment-bar.c (attach_to_multipart): Correctly
- set the charset parameter and use camel's bestenc filter to
- determine which content transfer encoding to use.
-
-2001-10-15 Larry Ewing <lewing@ximian.com>
-
- * e-msg-composer.c (e_msg_composer_add_message_attachments):
- s/apply/flush/.
- (e_msg_composer_flush_pending_body): renamed from apply now takes
- apply as an argument.
- (e_msg_composer_show_sig_file): s/g_assert/g_return_if_fail/
- warnings make for less painful bugs than crashes.
- (set_editor_text): s/g_assert/g_return_if_fail/
-
-2001-10-13 Dan Winship <danw@ximian.com>
-
- * e-msg-composer.c (autosave_manager_unregister): Don't pop up an
- "unable to retrieve message" if the composer never finished
- initializing.
- (init): Don't call autosave_manager_register here: wait until the
- end of create_composer.
- (create_composer): Remove the distinction between this and
- e_msg_composer_construct since there's no need for the latter. Use
- e_activation_failure_dialog if either the selectnames component or
- the gtkhtml editor fails.
-
- * e-msg-composer-hdrs.c (setup_corba): Don't g_warn if the oaf
- activation fails. create_composer() will tell the user.
-
-2001-10-11 Jeffrey Stedfast <fejj@ximian.com>
-
- * listener.c (impl_event): Deleted declaration of len.
-
- * e-msg-composer.c (e_msg_composer_add_message_attachments): Take
- a settext argument.
- (e_msg_composer_new_with_message): Updated to pass the settext argument.
-
-2001-10-10 Jon Trowbridge <trow@ximian.com>
-
- * e-msg-composer-hdrs.c (e_msg_composer_hdrs_set_from_account):
- Check for either a matching account name, or for a matching e-mail
- address embedded in the passed-in string. (Fixes half of bug
- #3255)
- (destroy): Call bonobo_object_release_unref on corba_select_names,
- not CORBA_Object_release. Otherwise we leak stuff all over the
- place. (Bug #11878)
-
- * e-msg-composer.c (e_msg_composer_new_with_message): If our message
- doesn't contain an X-Evolution-Account header, pass in the From
- header as the account name. (Fixes the other half of #3255)
-
-2001-10-10 Larry Ewing <lewing@ximian.com>
-
- * e-msg-composer.h: add prototype.
-
- * e-msg-composer.c (e_msg_composer_add_message_attachments): new
- function to copy attachments from the a message to a composer.
- (e_msg_composer_set_pending_body): make simple function to
- abstract this.
- (e_msg_composer_apply_pending_body): apply the pending body to
- the composer.
- (e_msg_composer_new_with_message): use
- e_msg_composer_add_message_attachments to copy attachments.
-
-2001-10-09 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-attachment-bar.c (add_from_file): If the
- attachment fails, report the error to the user.
-
- * e-msg-composer-attachment.c (e_msg_composer_attachment_new): Now
- takes a CamelException argument.
-
- * e-msg-composer.c (setup_ui): Pass /menu/Edit as the menu path to
- e_charset_picker thingy.
-
-2001-10-05 Larry Ewing <lewing@ximian.com>
-
- * e-msg-composer-attachment-bar.c
- (e_msg_composer_attachment_bar_find_message): fix cut&pasteo.
-
- * e-msg-composer-attachment.c (e_msg_composer_attachment_new):
- remove unused variable.
-
- * e-msg-composer-attachment-bar.c
- (e_msg_composer_attachment_bar_find_message): generalize this to
- lookup content locations as well.
-
- * e-msg-composer-attachment-bar.h: change prototype to match the
- new function.
-
- * listener.c (impl_event): handle the url_requested event, look up
- parts in the attachment part and feed them down the stream if it
- is found.
-
- * e-msg-composer.c (handle_multipart_alternative): delay setting
- the body text.
- (handle_multipart): delay setting body text
- (e_msg_composer_new_with_message): set the body text from the
- object data. Doing this ensures that we will have the attachments
- processed before we try to look them up.
-
-2001-10-04 Larry Ewing <lewing@ximian.com>
-
- * e-msg-composer-attachment-bar.c
- (e_msg_composer_attachment_bar_find_content_id): change to return
- a CamelMimePart.
-
- * e-msg-composer-attachment-bar.h: update prototype.
-
- * e-msg-composer-attachment-bar.c
- (e_msg_composer_attachment_bar_find_content_id): look up an
- attachment by it's content id.
-
- * e-msg-composer-attachment-bar.h: add prototype for
- e_msg_composer_attachment_bar_find_content_id.
-
-2001-10-03 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (autosave_save_draft): Make sure to unref the
- message object so we don't leak it or any references to
- attachments (child mime parts).
-
- * e-msg-composer-attachment.c (e_msg_composer_attachment_new):
- Unref the mime part after passing it along to new_from_mime_part.
-
-2001-10-02 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (save_draft): Pass an empty flags argument to
- mail_get_folder.
-
-2001-10-02 Ettore Perazzoli <ettore@ximian.com>
-
- * e-msg-composer.c (setup_ui): Use
- `bonobo_ui_component_new_default()', not
- `bonobo_ui_component_new()'.
-
-2001-09-27 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-attachment.c (e_msg_composer_attachment_new):
- Don't set Content-Ids on these parts since they are not contained
- within a multipart/related - this fixes bug #10032.
-
-2001-09-26 Jon Trowbridge <trow@ximian.com>
-
- * e-msg-composer.c (e_msg_composer_new_from_url): Fixes glitch in
- mailto: url parsing that caused it to fail when recipient names
- contained commas. (Bug #10796)
-
-2001-09-20 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (save_draft): Update to reflect changes to
- mail_get_folder.
-
-2001-09-20 Iain Holmes <iain@ximian.com>
-
- * e-msg-composer.c (get_file_content): Open the file with O_CREAT so
- that if it doesn't exist, it's created. Never return a NULL as this
- could potentially crash on Solaris.
-
-2001-09-18 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (build_message): Attach an X-Evolution-Format
- header so if people re-edit a message in say their Sent folder, we
- will preserve format preferences.
- (e_msg_composer_get_message_draft): Don't attach
- X-Evolution-Format headers here since it is now done in
- build_message().
- (e_msg_composer_new_with_message): Make sure to remove *all*
- X-Evolution headers by using the mail-tools functions.
-
-2001-09-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer-attachment-bar.c (update): Don't
- gtk_object_destroy() the pixbuf loader, unref it instead.
-
- * e-msg-composer-hdrs.c (destroy): Don't forget to free the
- private structure.
-
-2001-09-14 Ettore Perazzoli <ettore@ximian.com>
-
- [Automake 1.5 fixes pointed out by Richard Boulton
- <richard@tartarus.org>, as per #9258.]
-
- * Makefile.am (CLEANFILES): Set directly with `=' instead of `+='.
-
-2001-09-13 Larry Ewing <lewing@ximian.com>
-
- * e-msg-composer.c (map_default_cb): free the text values we get
- from the property bag and release the property bag properly.
-
-2001-09-12 JP Rosevear <jpr@ximian.com>
-
- * evolution-composer.c (corba_recipientlist_to_destv): null
- terminate the destination vector
-
-2001-09-10 Jeffrey Stedfast <fejj@ximian.com>
-
- * evolution-composer.c (init): Don't call new_with_sig_file, it no
- longer exists.
-
- * e-msg-composer.c (setup_ui): Make sure that the session is
- non-NULL.
- (menu_file_send_cb): And here too.
- (e_msg_composer_new_with_sig_file): Removed.
-
-2001-09-10 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (build_message): Wrap the S/MIME code in ifdef
- SMIME_SUPPORTED which isn't defined but by some later version will
- be.
- (setup_ui): And again here.
-
-2001-09-09 Maciej Stachowiak <mjs@noisehavoc.org>
-
- * Makefile.am: Add VFS_CFLAGS so things don't break when the
- gnome-vfs headers move.
-
-2001-09-08 Jon Trowbridge <trow@ximian.com>
-
- * evolution-composer.c (corba_recipientlist_to_destv): Originally
- was corba_recipientlist_to_glist.
- (impl_Composer_set_headers): Use corba_recipientlist_to_destv, new
- destination-based api.
-
- * e-msg-composer.c (build_message): Get rid of that 'sending'
- stuff. That was a bad idea.
- (e_msg_composer_new_with_message): Apply the revised api and work
- with vectors of destinations rather than just lists.
- (e_msg_composer_get_recipients): Added. Returns the full set of
- recipient destinations in a vector.
-
- * e-msg-composer-hdrs.c: Removed free_destv function. We use
- e_destination_freev instead.
- (e_msg_composer_hdrs_get_to): Changed to return a vector of
- EDestinations. This function now works.
- (e_msg_composer_hdrs_get_cc): Ditto.
- (e_msg_composer_hdrs_get_bcc): Ditto.
- (e_msg_composer_hdrs_get_recipients): Added. Returns a vector of
- EDestinations that is the union of the to, cc and bcc lines.
- (e_msg_composer_hdrs_set_to): Changed to take a vector of
- EDestinations, rather than a GList.
- (e_msg_composer_hdrs_set_cc): Ditto.
- (e_msg_composer_hdrs_set_bcc): Ditto.
- (e_msg_composer_hdrs_to_message): Use our new, improved API, rather
- than a bunch of poking around in BonoboPropertyBags, etc.
-
-2001-09-07 Dan Winship <danw@ximian.com>
-
- * e-msg-composer-hdrs.c (set_recipients_from_destv): Remove some
- debugging messages that don't check for NULL strings and crash
- Solaris.
-
-2001-09-06 Dan Winship <danw@ximian.com>
-
- * e-msg-composer.c (save): Have to specify a mode when using
- O_CREAT.
- (handle_multipart_alternative, handle_multipart,
- e_msg_composer_new_with_message): Update for mail_get_message_body
- change.
-
-2001-09-05 Ettore Perazzoli <ettore@ximian.com>
-
- * e-msg-composer.c (autosave_manager_query_load_orphans):
- s/Evolution/Ximian Evolution/.
- (do_exit): Set the title to be "Warning: Modified Message".
-
-2001-08-29 Jon Trowbridge <trow@ximian.com>
-
- * e-msg-composer.c (e_msg_composer_get_message_draft): Pass
- in FALSE as the 'sending' arg to e_msg_composer_get_message.
- (build_message): Added a 'sending' arg, which is passed to
- e_msg_composer_get_message.
- (e_msg_composer_get_message): Added a 'sending' arg,
- which gets passed directly on to build_message.
-
- * e-msg-composer-hdrs.c (e_msg_composer_hdrs_to_message): Added
- a "sending" arg, which should be TRUE if the message is being
- sent now (rather than being autosaved, etc.). The address
- use scores are only updated when sending. (Bug #8332)
- Removed obsolete (#if 0/#endif-ed) code.
-
-2001-08-22 Jon Trowbridge <trow@ximian.com>
-
- * e-msg-composer-hdrs.c (set_recipients_from_destv): Added. Try
- to properly handle contact lists in which the addresses of the
- list members should be hidden.
- (e_msg_composer_hdrs_to_message): Changed to extract the
- destination data from the entries and pass it along to
- set_recipients_from_destv.
-
-2001-08-22 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (save): When reporting an error, use
- my_file_name instead of file_name since file_name can be NULL.
-
-2001-08-21 Ettore Perazzoli <ettore@ximian.com>
-
- * e-msg-composer.c (autosave_manager_query_load_orphans):
- s/attempt recovery/try to recover them/.
-
-2001-08-19 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (save_draft): Reset the "changed" state to
- FALSE after a successful save.
-
-2001-08-17 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (show_attachments): Toggle the
- View->Attachments menu item. This fixes bug #6107.
-
-2001-07-12 Peter Williams <peterw@ximian.com>
-
- * e-msg-composer.c (map_default_cb): New function. Figure out
- which widget gets the default and assign it. Harder to do than
- it sounds.
- (e_msg_composer_construct): Hook map_default_cb up to the "map"
- signal.
- (set_focus_to_editor): Removed.
- (set_focus_to_editor_idle): Removed.
-
-2001-08-10 Jon Trowbridge <trow@ximian.com>
-
- * e-msg-composer-hdrs.c (set_recipients): Removed comment about
- the need to resolve nicknames properly, because we now do that.
-
-2001-08-09 Radek Doulik <rodo@ximian.com>
-
- * e-msg-composer.c (set_focus_to_editor): new helper function,
- just setup idle callback to grab focus
- (set_focus_to_editor_idle): grab focus for editor, before we have
- better solution, it run grab-focus command on editor control
- (e_msg_composer_construct): call prepare_engine here, set focus to
- editor
-
-2001-08-10 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (autosave_manager_query_load_orphans): Don't
- forget to closedir() when we finish with dir.
-
-2001-08-09 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (from_changed_cb): Set the smime/pgp
- always-sign options when here so it updates when the user changes
- his/her identity.
-
-2001-08-08 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (e_msg_composer_get_message_draft): Set the
- PGP/MIME and S/MIME options to FALSE before getting the message
- draft and restore the values afterward.
-
-2001-08-06 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (add_inlined_image): Use g_basename().
- (setup_ui): Get the default charset from the mail config db.
-
-2001-08-06 Radek Doulik <rodo@ximian.com>
-
- * listener.c (impl_event): handle delete event
-
-2001-07-31 Peter Williams <peterw@ximian.com>
-
- * e-msg-composer.c (setup_ui): Set the config path for the composer so
- that the customize toolbar command works.
-
-2001-07-31 Jason Leach <jleach@ximian.com>
-
- * e-msg-composer.c: Use Tuomas' and Jakub's new (and beautiful)
- icons for Send and Send Later in the toolbar and menus.
-
-2001-07-30 Jeffrey Stedfast <fejj@ximian.com>
-
- * e-msg-composer.c (message_rfc822_dnd): Properly add the
- message/rfc822 part.
-
-2001-07-27 Jason Leach <jleach@ximian.com>
-